Built motion from commit e2d94e19.|2.6.7
authorsupport <support@xcally.com>
Wed, 23 Mar 2022 16:47:01 +0000 (16:47 +0000)
committersupport <support@xcally.com>
Wed, 23 Mar 2022 16:47:01 +0000 (16:47 +0000)
1189 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/authActiveDirectory/authActiveDirectory.controller.js
server/api/authActiveDirectory/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.events.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/client-side-logs.js
server/api/cloudProvider/cloudProvider.attributes.js
server/api/cloudProvider/cloudProvider.controller.js
server/api/cloudProvider/cloudProvider.model.js
server/api/cloudProvider/cloudProvider.oauth.js
server/api/cloudProvider/cloudProvider.rpc.js
server/api/cloudProvider/index.js
server/api/cmCompany/cmCompany.attributes.js
server/api/cmCompany/cmCompany.controller.js
server/api/cmCompany/cmCompany.model.js
server/api/cmCompany/cmCompany.rpc.js
server/api/cmCompany/index.js
server/api/cmContact/cmContact.attributes.js
server/api/cmContact/cmContact.controller.js
server/api/cmContact/cmContact.events.js
server/api/cmContact/cmContact.model.js
server/api/cmContact/cmContact.rpc.js
server/api/cmContact/cmContact.socket.js
server/api/cmContact/index.js
server/api/cmContactHasItem/cmContactHasItem.attributes.js
server/api/cmContactHasItem/cmContactHasItem.controller.js
server/api/cmContactHasItem/cmContactHasItem.model.js
server/api/cmContactHasItem/cmContactHasItem.rpc.js
server/api/cmContactHasItem/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/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js
server/api/cmHopperAdditionalPhone/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/contactItemType/contactItemType.attributes.js
server/api/contactItemType/contactItemType.controller.js
server/api/contactItemType/contactItemType.model.js
server/api/contactItemType/contactItemType.rpc.js
server/api/contactItemType/index.js
server/api/dashboard/dashboard.attributes.js
server/api/dashboard/dashboard.controller.js
server/api/dashboard/dashboard.events.js
server/api/dashboard/dashboard.model.js
server/api/dashboard/dashboard.rpc.js
server/api/dashboard/dashboard.socket.js
server/api/dashboard/index.js
server/api/dashboardItem/dashboardItem.attributes.js
server/api/dashboardItem/dashboardItem.controller.js
server/api/dashboardItem/dashboardItem.events.js
server/api/dashboardItem/dashboardItem.model.js
server/api/dashboardItem/dashboardItem.rpc.js
server/api/dashboardItem/dashboardItem.socket.js
server/api/dashboardItem/index.js
server/api/disposition/disposition.attributes.js
server/api/disposition/disposition.controller.js
server/api/disposition/disposition.model.js
server/api/disposition/disposition.rpc.js
server/api/disposition/index.js
server/api/faxAccount/faxAccount.attributes.js
server/api/faxAccount/faxAccount.controller.js
server/api/faxAccount/faxAccount.events.js
server/api/faxAccount/faxAccount.model.js
server/api/faxAccount/faxAccount.rpc.js
server/api/faxAccount/faxAccount.socket.js
server/api/faxAccount/index.js
server/api/faxApplication/faxApplication.attributes.js
server/api/faxApplication/faxApplication.controller.js
server/api/faxApplication/faxApplication.model.js
server/api/faxApplication/faxApplication.rpc.js
server/api/faxApplication/index.js
server/api/faxInteraction/faxInteraction.attributes.js
server/api/faxInteraction/faxInteraction.controller.js
server/api/faxInteraction/faxInteraction.events.js
server/api/faxInteraction/faxInteraction.model.js
server/api/faxInteraction/faxInteraction.rpc.js
server/api/faxInteraction/faxInteraction.socket.js
server/api/faxInteraction/index.js
server/api/faxMessage/faxMessage.attributes.js
server/api/faxMessage/faxMessage.controller.js
server/api/faxMessage/faxMessage.events.js
server/api/faxMessage/faxMessage.model.js
server/api/faxMessage/faxMessage.rpc.js
server/api/faxMessage/faxMessage.socket.js
server/api/faxMessage/index.js
server/api/faxQueue/faxQueue.attributes.js
server/api/faxQueue/faxQueue.controller.js
server/api/faxQueue/faxQueue.events.js
server/api/faxQueue/faxQueue.model.js
server/api/faxQueue/faxQueue.rpc.js
server/api/faxQueue/faxQueue.socket.js
server/api/faxQueue/index.js
server/api/faxQueueReport/faxQueueReport.attributes.js
server/api/faxQueueReport/faxQueueReport.controller.js
server/api/faxQueueReport/faxQueueReport.model.js
server/api/faxQueueReport/faxQueueReport.rpc.js
server/api/faxQueueReport/index.js
server/api/faxTransferReport/faxTransferReport.attributes.js
server/api/faxTransferReport/faxTransferReport.controller.js
server/api/faxTransferReport/faxTransferReport.model.js
server/api/faxTransferReport/faxTransferReport.rpc.js
server/api/faxTransferReport/index.js
server/api/intDeskAccount/index.js
server/api/intDeskAccount/intDeskAccount.attributes.js
server/api/intDeskAccount/intDeskAccount.controller.js
server/api/intDeskAccount/intDeskAccount.model.js
server/api/intDeskAccount/intDeskAccount.rpc.js
server/api/intDeskConfiguration/index.js
server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
server/api/intDeskConfiguration/intDeskConfiguration.controller.js
server/api/intDeskConfiguration/intDeskConfiguration.model.js
server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
server/api/intDeskField/index.js
server/api/intDeskField/intDeskField.attributes.js
server/api/intDeskField/intDeskField.controller.js
server/api/intDeskField/intDeskField.model.js
server/api/intDeskField/intDeskField.rpc.js
server/api/intDynamics365Account/index.js
server/api/intDynamics365Account/intDynamics365Account.attributes.js
server/api/intDynamics365Account/intDynamics365Account.controller.js
server/api/intDynamics365Account/intDynamics365Account.model.js
server/api/intDynamics365Account/intDynamics365Account.rpc.js
server/api/intDynamics365Configuration/index.js
server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
server/api/intDynamics365Field/index.js
server/api/intDynamics365Field/intDynamics365Field.attributes.js
server/api/intDynamics365Field/intDynamics365Field.controller.js
server/api/intDynamics365Field/intDynamics365Field.model.js
server/api/intDynamics365Field/intDynamics365Field.rpc.js
server/api/intFreshdeskAccount/index.js
server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
server/api/intFreshdeskConfiguration/index.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
server/api/intFreshdeskField/index.js
server/api/intFreshdeskField/intFreshdeskField.attributes.js
server/api/intFreshdeskField/intFreshdeskField.controller.js
server/api/intFreshdeskField/intFreshdeskField.model.js
server/api/intFreshdeskField/intFreshdeskField.rpc.js
server/api/intFreshsalesAccount/index.js
server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js
server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js
server/api/intFreshsalesAccount/intFreshsalesAccount.model.js
server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js
server/api/intFreshsalesConfiguration/index.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js
server/api/intFreshsalesField/index.js
server/api/intFreshsalesField/intFreshsalesField.attributes.js
server/api/intFreshsalesField/intFreshsalesField.controller.js
server/api/intFreshsalesField/intFreshsalesField.model.js
server/api/intFreshsalesField/intFreshsalesField.rpc.js
server/api/intSalesforceAccount/index.js
server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
server/api/intSalesforceAccount/intSalesforceAccount.controller.js
server/api/intSalesforceAccount/intSalesforceAccount.model.js
server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
server/api/intSalesforceConfiguration/index.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
server/api/intSalesforceField/index.js
server/api/intSalesforceField/intSalesforceField.attributes.js
server/api/intSalesforceField/intSalesforceField.controller.js
server/api/intSalesforceField/intSalesforceField.model.js
server/api/intSalesforceField/intSalesforceField.rpc.js
server/api/intServicenowAccount/index.js
server/api/intServicenowAccount/intServicenowAccount.attributes.js
server/api/intServicenowAccount/intServicenowAccount.controller.js
server/api/intServicenowAccount/intServicenowAccount.model.js
server/api/intServicenowAccount/intServicenowAccount.rpc.js
server/api/intServicenowConfiguration/index.js
server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
server/api/intServicenowField/index.js
server/api/intServicenowField/intServicenowField.attributes.js
server/api/intServicenowField/intServicenowField.controller.js
server/api/intServicenowField/intServicenowField.model.js
server/api/intServicenowField/intServicenowField.rpc.js
server/api/intSugarcrmAccount/index.js
server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
server/api/intSugarcrmConfiguration/index.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
server/api/intSugarcrmField/index.js
server/api/intSugarcrmField/intSugarcrmField.attributes.js
server/api/intSugarcrmField/intSugarcrmField.controller.js
server/api/intSugarcrmField/intSugarcrmField.model.js
server/api/intSugarcrmField/intSugarcrmField.rpc.js
server/api/intVtigerAccount/index.js
server/api/intVtigerAccount/intVtigerAccount.attributes.js
server/api/intVtigerAccount/intVtigerAccount.controller.js
server/api/intVtigerAccount/intVtigerAccount.model.js
server/api/intVtigerAccount/intVtigerAccount.rpc.js
server/api/intVtigerConfiguration/index.js
server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
server/api/intVtigerField/index.js
server/api/intVtigerField/intVtigerField.attributes.js
server/api/intVtigerField/intVtigerField.controller.js
server/api/intVtigerField/intVtigerField.model.js
server/api/intVtigerField/intVtigerField.rpc.js
server/api/intZendeskAccount/index.js
server/api/intZendeskAccount/intZendeskAccount.attributes.js
server/api/intZendeskAccount/intZendeskAccount.controller.js
server/api/intZendeskAccount/intZendeskAccount.model.js
server/api/intZendeskAccount/intZendeskAccount.rpc.js
server/api/intZendeskConfiguration/index.js
server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
server/api/intZendeskField/index.js
server/api/intZendeskField/intZendeskField.attributes.js
server/api/intZendeskField/intZendeskField.controller.js
server/api/intZendeskField/intZendeskField.model.js
server/api/intZendeskField/intZendeskField.rpc.js
server/api/intZohoAccount/index.js
server/api/intZohoAccount/intZohoAccount.attributes.js
server/api/intZohoAccount/intZohoAccount.controller.js
server/api/intZohoAccount/intZohoAccount.model.js
server/api/intZohoAccount/intZohoAccount.rpc.js
server/api/intZohoConfiguration/index.js
server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
server/api/intZohoConfiguration/intZohoConfiguration.controller.js
server/api/intZohoConfiguration/intZohoConfiguration.model.js
server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
server/api/intZohoField/index.js
server/api/intZohoField/intZohoField.attributes.js
server/api/intZohoField/intZohoField.controller.js
server/api/intZohoField/intZohoField.model.js
server/api/intZohoField/intZohoField.rpc.js
server/api/integration/index.js
server/api/integration/integration.attributes.js
server/api/integration/integration.controller.js
server/api/integration/integration.model.js
server/api/integration/integration.rpc.js
server/api/integrationReport/index.js
server/api/integrationReport/integrationReport.attributes.js
server/api/integrationReport/integrationReport.controller.js
server/api/integrationReport/integrationReport.model.js
server/api/integrationReport/integrationReport.rpc.js
server/api/interval/index.js
server/api/interval/interval.attributes.js
server/api/interval/interval.controller.js
server/api/interval/interval.model.js
server/api/interval/interval.rpc.js
server/api/jira/index.js
server/api/jira/jira.controller.js
server/api/jscriptyAnswerReport/index.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
server/api/jscriptyProject/index.js
server/api/jscriptyProject/jscriptyProject.attributes.js
server/api/jscriptyProject/jscriptyProject.controller.js
server/api/jscriptyProject/jscriptyProject.model.js
server/api/jscriptyProject/jscriptyProject.rpc.js
server/api/jscriptyQuestionReport/index.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
server/api/jscriptySessionReport/index.js
server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
server/api/jscriptySessionReport/jscriptySessionReport.controller.js
server/api/jscriptySessionReport/jscriptySessionReport.model.js
server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
server/api/license/index.js
server/api/license/license.attributes.js
server/api/license/license.controller.js
server/api/license/license.model.js
server/api/license/license.rpc.js
server/api/mailAccount/index.js
server/api/mailAccount/mailAccount.attributes.js
server/api/mailAccount/mailAccount.controller.js
server/api/mailAccount/mailAccount.events.js
server/api/mailAccount/mailAccount.model.js
server/api/mailAccount/mailAccount.rpc.js
server/api/mailAccount/mailAccount.socket.js
server/api/mailApplication/index.js
server/api/mailApplication/mailApplication.attributes.js
server/api/mailApplication/mailApplication.controller.js
server/api/mailApplication/mailApplication.model.js
server/api/mailApplication/mailApplication.rpc.js
server/api/mailInteraction/index.js
server/api/mailInteraction/mailInteraction.attributes.js
server/api/mailInteraction/mailInteraction.controller.js
server/api/mailInteraction/mailInteraction.events.js
server/api/mailInteraction/mailInteraction.model.js
server/api/mailInteraction/mailInteraction.rpc.js
server/api/mailInteraction/mailInteraction.socket.js
server/api/mailMessage/index.js
server/api/mailMessage/mailMessage.attributes.js
server/api/mailMessage/mailMessage.controller.js
server/api/mailMessage/mailMessage.events.js
server/api/mailMessage/mailMessage.model.js
server/api/mailMessage/mailMessage.rpc.js
server/api/mailMessage/mailMessage.socket.js
server/api/mailQueue/index.js
server/api/mailQueue/mailQueue.attributes.js
server/api/mailQueue/mailQueue.controller.js
server/api/mailQueue/mailQueue.events.js
server/api/mailQueue/mailQueue.model.js
server/api/mailQueue/mailQueue.rpc.js
server/api/mailQueue/mailQueue.socket.js
server/api/mailQueueReport/index.js
server/api/mailQueueReport/mailQueueReport.attributes.js
server/api/mailQueueReport/mailQueueReport.controller.js
server/api/mailQueueReport/mailQueueReport.model.js
server/api/mailQueueReport/mailQueueReport.rpc.js
server/api/mailServerIn/index.js
server/api/mailServerIn/mailServerIn.attributes.js
server/api/mailServerIn/mailServerIn.model.js
server/api/mailServerIn/mailServerIn.rpc.js
server/api/mailServerOut/index.js
server/api/mailServerOut/mailServerOut.attributes.js
server/api/mailServerOut/mailServerOut.controller.js
server/api/mailServerOut/mailServerOut.model.js
server/api/mailServerOut/mailServerOut.rpc.js
server/api/mailSubstatus/index.js
server/api/mailSubstatus/mailSubstatus.attributes.js
server/api/mailSubstatus/mailSubstatus.controller.js
server/api/mailSubstatus/mailSubstatus.events.js
server/api/mailSubstatus/mailSubstatus.model.js
server/api/mailSubstatus/mailSubstatus.rpc.js
server/api/mailTransferReport/index.js
server/api/mailTransferReport/mailTransferReport.attributes.js
server/api/mailTransferReport/mailTransferReport.controller.js
server/api/mailTransferReport/mailTransferReport.model.js
server/api/mailTransferReport/mailTransferReport.rpc.js
server/api/memberReport/index.js
server/api/memberReport/memberReport.attributes.js
server/api/memberReport/memberReport.controller.js
server/api/memberReport/memberReport.model.js
server/api/memberReport/memberReport.rpc.js
server/api/migration/index.js
server/api/migration/migration.attributes.js
server/api/migration/migration.controller.js
server/api/migration/migration.model.js
server/api/migration/migration.rpc.js
server/api/network/index.js
server/api/network/network.attributes.js
server/api/network/network.controller.js
server/api/network/network.model.js
server/api/network/network.rpc.js
server/api/openchannelAccount/index.js
server/api/openchannelAccount/openchannelAccount.attributes.js
server/api/openchannelAccount/openchannelAccount.controller.js
server/api/openchannelAccount/openchannelAccount.events.js
server/api/openchannelAccount/openchannelAccount.model.js
server/api/openchannelAccount/openchannelAccount.rpc.js
server/api/openchannelAccount/openchannelAccount.socket.js
server/api/openchannelApplication/index.js
server/api/openchannelApplication/openchannelApplication.attributes.js
server/api/openchannelApplication/openchannelApplication.controller.js
server/api/openchannelApplication/openchannelApplication.model.js
server/api/openchannelApplication/openchannelApplication.rpc.js
server/api/openchannelInteraction/index.js
server/api/openchannelInteraction/openchannelInteraction.attributes.js
server/api/openchannelInteraction/openchannelInteraction.controller.js
server/api/openchannelInteraction/openchannelInteraction.events.js
server/api/openchannelInteraction/openchannelInteraction.model.js
server/api/openchannelInteraction/openchannelInteraction.rpc.js
server/api/openchannelInteraction/openchannelInteraction.socket.js
server/api/openchannelMessage/index.js
server/api/openchannelMessage/openchannelMessage.attributes.js
server/api/openchannelMessage/openchannelMessage.controller.js
server/api/openchannelMessage/openchannelMessage.events.js
server/api/openchannelMessage/openchannelMessage.model.js
server/api/openchannelMessage/openchannelMessage.rpc.js
server/api/openchannelMessage/openchannelMessage.socket.js
server/api/openchannelQueue/index.js
server/api/openchannelQueue/openchannelQueue.attributes.js
server/api/openchannelQueue/openchannelQueue.controller.js
server/api/openchannelQueue/openchannelQueue.events.js
server/api/openchannelQueue/openchannelQueue.model.js
server/api/openchannelQueue/openchannelQueue.rpc.js
server/api/openchannelQueue/openchannelQueue.socket.js
server/api/openchannelQueueReport/index.js
server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
server/api/openchannelQueueReport/openchannelQueueReport.controller.js
server/api/openchannelQueueReport/openchannelQueueReport.model.js
server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
server/api/openchannelTransferReport/index.js
server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
server/api/openchannelTransferReport/openchannelTransferReport.controller.js
server/api/openchannelTransferReport/openchannelTransferReport.model.js
server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
server/api/pause/index.js
server/api/pause/pause.attributes.js
server/api/pause/pause.controller.js
server/api/pause/pause.model.js
server/api/pause/pause.rpc.js
server/api/plugin/index.js
server/api/plugin/plugin.attributes.js
server/api/plugin/plugin.controller.js
server/api/plugin/plugin.events.js
server/api/plugin/plugin.model.js
server/api/plugin/plugin.rpc.js
server/api/plugin/plugin.socket.js
server/api/pm2/index.js
server/api/pm2/pm2.controller.js
server/api/realtime/index.js
server/api/realtime/realtime.controller.js
server/api/reportAgentPreview/index.js
server/api/reportAgentPreview/reportAgentPreview.attributes.js
server/api/reportAgentPreview/reportAgentPreview.model.js
server/api/reportAgentPreview/reportAgentPreview.rpc.js
server/api/rpc/index.js
server/api/rpc/rpc.controller.js
server/api/schedule/index.js
server/api/schedule/schedule.attributes.js
server/api/schedule/schedule.controller.js
server/api/schedule/schedule.model.js
server/api/schedule/schedule.rpc.js
server/api/screenRecording/index.js
server/api/screenRecording/screenRecording.attributes.js
server/api/screenRecording/screenRecording.controller.js
server/api/screenRecording/screenRecording.model.js
server/api/screenRecording/screenRecording.rpc.js
server/api/setting/index.js
server/api/setting/setting.attributes.js
server/api/setting/setting.controller.js
server/api/setting/setting.model.js
server/api/setting/setting.rpc.js
server/api/smsAccount/index.js
server/api/smsAccount/smsAccount.attributes.js
server/api/smsAccount/smsAccount.controller.js
server/api/smsAccount/smsAccount.events.js
server/api/smsAccount/smsAccount.model.js
server/api/smsAccount/smsAccount.rpc.js
server/api/smsAccount/smsAccount.socket.js
server/api/smsApplication/index.js
server/api/smsApplication/smsApplication.attributes.js
server/api/smsApplication/smsApplication.controller.js
server/api/smsApplication/smsApplication.model.js
server/api/smsApplication/smsApplication.rpc.js
server/api/smsInteraction/index.js
server/api/smsInteraction/smsInteraction.attributes.js
server/api/smsInteraction/smsInteraction.controller.js
server/api/smsInteraction/smsInteraction.events.js
server/api/smsInteraction/smsInteraction.model.js
server/api/smsInteraction/smsInteraction.rpc.js
server/api/smsInteraction/smsInteraction.socket.js
server/api/smsMessage/index.js
server/api/smsMessage/smsMessage.attributes.js
server/api/smsMessage/smsMessage.controller.js
server/api/smsMessage/smsMessage.events.js
server/api/smsMessage/smsMessage.model.js
server/api/smsMessage/smsMessage.rpc.js
server/api/smsMessage/smsMessage.socket.js
server/api/smsQueue/index.js
server/api/smsQueue/smsQueue.attributes.js
server/api/smsQueue/smsQueue.controller.js
server/api/smsQueue/smsQueue.events.js
server/api/smsQueue/smsQueue.model.js
server/api/smsQueue/smsQueue.rpc.js
server/api/smsQueue/smsQueue.socket.js
server/api/smsQueueReport/index.js
server/api/smsQueueReport/smsQueueReport.attributes.js
server/api/smsQueueReport/smsQueueReport.controller.js
server/api/smsQueueReport/smsQueueReport.model.js
server/api/smsQueueReport/smsQueueReport.rpc.js
server/api/smsTransferReport/index.js
server/api/smsTransferReport/smsTransferReport.attributes.js
server/api/smsTransferReport/smsTransferReport.controller.js
server/api/smsTransferReport/smsTransferReport.model.js
server/api/smsTransferReport/smsTransferReport.rpc.js
server/api/sound/index.js
server/api/sound/sound.attributes.js
server/api/sound/sound.controller.js
server/api/sound/sound.model.js
server/api/sound/sound.rpc.js
server/api/squareMessage/index.js
server/api/squareMessage/squareMessage.attributes.js
server/api/squareMessage/squareMessage.controller.js
server/api/squareMessage/squareMessage.model.js
server/api/squareMessage/squareMessage.rpc.js
server/api/squareOdbc/index.js
server/api/squareOdbc/squareOdbc.attributes.js
server/api/squareOdbc/squareOdbc.controller.js
server/api/squareOdbc/squareOdbc.model.js
server/api/squareOdbc/squareOdbc.rpc.js
server/api/squareProject/index.js
server/api/squareProject/squareProject.attributes.js
server/api/squareProject/squareProject.controller.js
server/api/squareProject/squareProject.events.js
server/api/squareProject/squareProject.model.js
server/api/squareProject/squareProject.rpc.js
server/api/squareProject/squareProject.socket.js
server/api/squareRecording/index.js
server/api/squareRecording/squareRecording.attributes.js
server/api/squareRecording/squareRecording.controller.js
server/api/squareRecording/squareRecording.model.js
server/api/squareRecording/squareRecording.rpc.js
server/api/squareReport/index.js
server/api/squareReport/squareReport.attributes.js
server/api/squareReport/squareReport.controller.js
server/api/squareReport/squareReport.model.js
server/api/squareReport/squareReport.rpc.js
server/api/squareReportDetail/index.js
server/api/squareReportDetail/squareReportDetail.attributes.js
server/api/squareReportDetail/squareReportDetail.controller.js
server/api/squareReportDetail/squareReportDetail.model.js
server/api/squareReportDetail/squareReportDetail.rpc.js
server/api/system/index.js
server/api/system/system.controller.js
server/api/tag/index.js
server/api/tag/tag.attributes.js
server/api/tag/tag.controller.js
server/api/tag/tag.model.js
server/api/tag/tag.rpc.js
server/api/team/index.js
server/api/team/team.attributes.js
server/api/team/team.controller.js
server/api/team/team.events.js
server/api/team/team.model.js
server/api/team/team.rpc.js
server/api/team/team.socket.js
server/api/teamVoicePrefix/teamVoicePrefix.attributes.js
server/api/teamVoicePrefix/teamVoicePrefix.model.js
server/api/teamVoiceQueue/index.js
server/api/teamVoiceQueue/teamVoiceQueue.attributes.js
server/api/teamVoiceQueue/teamVoiceQueue.model.js
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js
server/api/template/index.js
server/api/template/template.attributes.js
server/api/template/template.controller.js
server/api/template/template.model.js
server/api/template/template.rpc.js
server/api/trigger/index.js
server/api/trigger/trigger.attributes.js
server/api/trigger/trigger.controller.js
server/api/trigger/trigger.model.js
server/api/trigger/trigger.rpc.js
server/api/trunk/index.js
server/api/trunk/trunk.attributes.js
server/api/trunk/trunk.controller.js
server/api/trunk/trunk.model.js
server/api/trunk/trunk.rpc.js
server/api/user-setting/index.js
server/api/user-setting/user-setting.attributes.js
server/api/user-setting/user-setting.controller.js
server/api/user-setting/user-setting.events.js
server/api/user-setting/user-setting.model.js
server/api/user-setting/user-setting.socket.js
server/api/user/index.js
server/api/user/user.attributes.js
server/api/user/user.controller.js
server/api/user/user.events.js
server/api/user/user.model.js
server/api/user/user.rpc.js
server/api/user/user.socket.js
server/api/userChatQueue/index.js
server/api/userChatQueue/userChatQueue.attributes.js
server/api/userChatQueue/userChatQueue.model.js
server/api/userChatQueue/userChatQueue.rpc.js
server/api/userFaxQueue/index.js
server/api/userFaxQueue/userFaxQueue.attributes.js
server/api/userFaxQueue/userFaxQueue.model.js
server/api/userFaxQueue/userFaxQueue.rpc.js
server/api/userMailQueue/index.js
server/api/userMailQueue/userMailQueue.attributes.js
server/api/userMailQueue/userMailQueue.model.js
server/api/userMailQueue/userMailQueue.rpc.js
server/api/userNotification/index.js
server/api/userNotification/userNotification.attributes.js
server/api/userNotification/userNotification.controller.js
server/api/userNotification/userNotification.events.js
server/api/userNotification/userNotification.model.js
server/api/userNotification/userNotification.rpc.js
server/api/userNotification/userNotification.socket.js
server/api/userOpenchannelQueue/index.js
server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
server/api/userProfile/index.js
server/api/userProfile/userProfile.attributes.js
server/api/userProfile/userProfile.controller.js
server/api/userProfile/userProfile.events.js
server/api/userProfile/userProfile.model.js
server/api/userProfile/userProfile.rpc.js
server/api/userProfile/userProfile.socket.js
server/api/userProfileResource/index.js
server/api/userProfileResource/userProfileResource.attributes.js
server/api/userProfileResource/userProfileResource.controller.js
server/api/userProfileResource/userProfileResource.model.js
server/api/userProfileResource/userProfileResource.rpc.js
server/api/userProfileSection/index.js
server/api/userProfileSection/userProfileSection.attributes.js
server/api/userProfileSection/userProfileSection.controller.js
server/api/userProfileSection/userProfileSection.model.js
server/api/userProfileSection/userProfileSection.rpc.js
server/api/userSmsQueue/index.js
server/api/userSmsQueue/userSmsQueue.attributes.js
server/api/userSmsQueue/userSmsQueue.model.js
server/api/userSmsQueue/userSmsQueue.rpc.js
server/api/userVoicePrefix/userVoicePrefix.attributes.js
server/api/userVoicePrefix/userVoicePrefix.model.js
server/api/userVoiceQueue/index.js
server/api/userVoiceQueue/userVoiceQueue.attributes.js
server/api/userVoiceQueue/userVoiceQueue.model.js
server/api/userVoiceQueue/userVoiceQueue.rpc.js
server/api/userVoiceQueueRt/index.js
server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js
server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
server/api/userWhatsappQueue/index.js
server/api/userWhatsappQueue/userWhatsappQueue.attributes.js
server/api/userWhatsappQueue/userWhatsappQueue.model.js
server/api/userWhatsappQueue/userWhatsappQueue.rpc.js
server/api/variable/index.js
server/api/variable/variable.attributes.js
server/api/variable/variable.controller.js
server/api/variable/variable.model.js
server/api/variable/variable.rpc.js
server/api/version/index.js
server/api/version/version.controller.js
server/api/voiceAgentReport/index.js
server/api/voiceAgentReport/voiceAgentReport.attributes.js
server/api/voiceAgentReport/voiceAgentReport.controller.js
server/api/voiceAgentReport/voiceAgentReport.model.js
server/api/voiceAgentReport/voiceAgentReport.rpc.js
server/api/voiceCallReport/index.js
server/api/voiceCallReport/voiceCallReport.attributes.js
server/api/voiceCallReport/voiceCallReport.controller.js
server/api/voiceCallReport/voiceCallReport.model.js
server/api/voiceCallReport/voiceCallReport.rpc.js
server/api/voiceChanSpy/index.js
server/api/voiceChanSpy/voiceChanSpy.attributes.js
server/api/voiceChanSpy/voiceChanSpy.controller.js
server/api/voiceChanSpy/voiceChanSpy.model.js
server/api/voiceChanSpy/voiceChanSpy.rpc.js
server/api/voiceContext/index.js
server/api/voiceContext/voiceContext.attributes.js
server/api/voiceContext/voiceContext.controller.js
server/api/voiceContext/voiceContext.model.js
server/api/voiceContext/voiceContext.rpc.js
server/api/voiceDialReport/index.js
server/api/voiceDialReport/voiceDialReport.attributes.js
server/api/voiceDialReport/voiceDialReport.controller.js
server/api/voiceDialReport/voiceDialReport.model.js
server/api/voiceDialReport/voiceDialReport.rpc.js
server/api/voiceExtension/index.js
server/api/voiceExtension/voiceExtension.attributes.js
server/api/voiceExtension/voiceExtension.controller.js
server/api/voiceExtension/voiceExtension.events.js
server/api/voiceExtension/voiceExtension.model.js
server/api/voiceExtension/voiceExtension.rpc.js
server/api/voiceExtension/voiceExtension.socket.js
server/api/voiceMail/index.js
server/api/voiceMail/voiceMail.attributes.js
server/api/voiceMail/voiceMail.controller.js
server/api/voiceMail/voiceMail.model.js
server/api/voiceMail/voiceMail.rpc.js
server/api/voiceMailMessage/index.js
server/api/voiceMailMessage/voiceMailMessage.attributes.js
server/api/voiceMailMessage/voiceMailMessage.controller.js
server/api/voiceMailMessage/voiceMailMessage.model.js
server/api/voiceMailMessage/voiceMailMessage.rpc.js
server/api/voiceMusicOnHold/index.js
server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js
server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js
server/api/voicePrefix/index.js
server/api/voicePrefix/voicePrefix.attributes.js
server/api/voicePrefix/voicePrefix.controller.js
server/api/voicePrefix/voicePrefix.events.js
server/api/voicePrefix/voicePrefix.model.js
server/api/voicePrefix/voicePrefix.rpc.js
server/api/voicePrefix/voicePrefix.socket.js
server/api/voiceQueue/index.js
server/api/voiceQueue/voiceQueue.attributes.js
server/api/voiceQueue/voiceQueue.controller.js
server/api/voiceQueue/voiceQueue.events.js
server/api/voiceQueue/voiceQueue.model.js
server/api/voiceQueue/voiceQueue.rpc.js
server/api/voiceQueue/voiceQueue.socket.js
server/api/voiceQueueReport/index.js
server/api/voiceQueueReport/voiceQueueReport.attributes.js
server/api/voiceQueueReport/voiceQueueReport.controller.js
server/api/voiceQueueReport/voiceQueueReport.events.js
server/api/voiceQueueReport/voiceQueueReport.model.js
server/api/voiceQueueReport/voiceQueueReport.rpc.js
server/api/voiceQueueReport/voiceQueueReport.socket.js
server/api/voiceQueuesLog/index.js
server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
server/api/voiceQueuesLog/voiceQueuesLog.controller.js
server/api/voiceQueuesLog/voiceQueuesLog.model.js
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
server/api/voiceRecording/index.js
server/api/voiceRecording/voiceRecording.attributes.js
server/api/voiceRecording/voiceRecording.controller.js
server/api/voiceRecording/voiceRecording.model.js
server/api/voiceRecording/voiceRecording.rpc.js
server/api/voiceTransferReport/index.js
server/api/voiceTransferReport/voiceTransferReport.attributes.js
server/api/voiceTransferReport/voiceTransferReport.controller.js
server/api/voiceTransferReport/voiceTransferReport.model.js
server/api/voiceTransferReport/voiceTransferReport.rpc.js
server/api/webbar/index.js
server/api/webbar/webbar.controller.js
server/api/whatsappAccount/index.js
server/api/whatsappAccount/whatsappAccount.attributes.js
server/api/whatsappAccount/whatsappAccount.controller.js
server/api/whatsappAccount/whatsappAccount.events.js
server/api/whatsappAccount/whatsappAccount.model.js
server/api/whatsappAccount/whatsappAccount.rpc.js
server/api/whatsappAccount/whatsappAccount.socket.js
server/api/whatsappApplication/index.js
server/api/whatsappApplication/whatsappApplication.attributes.js
server/api/whatsappApplication/whatsappApplication.controller.js
server/api/whatsappApplication/whatsappApplication.model.js
server/api/whatsappApplication/whatsappApplication.rpc.js
server/api/whatsappInteraction/index.js
server/api/whatsappInteraction/whatsappInteraction.attributes.js
server/api/whatsappInteraction/whatsappInteraction.controller.js
server/api/whatsappInteraction/whatsappInteraction.events.js
server/api/whatsappInteraction/whatsappInteraction.model.js
server/api/whatsappInteraction/whatsappInteraction.rpc.js
server/api/whatsappInteraction/whatsappInteraction.socket.js
server/api/whatsappMessage/index.js
server/api/whatsappMessage/whatsappMessage.attributes.js
server/api/whatsappMessage/whatsappMessage.controller.js
server/api/whatsappMessage/whatsappMessage.events.js
server/api/whatsappMessage/whatsappMessage.model.js
server/api/whatsappMessage/whatsappMessage.rpc.js
server/api/whatsappMessage/whatsappMessage.socket.js
server/api/whatsappQueue/index.js
server/api/whatsappQueue/whatsappQueue.attributes.js
server/api/whatsappQueue/whatsappQueue.controller.js
server/api/whatsappQueue/whatsappQueue.events.js
server/api/whatsappQueue/whatsappQueue.model.js
server/api/whatsappQueue/whatsappQueue.rpc.js
server/api/whatsappQueue/whatsappQueue.socket.js
server/api/whatsappQueueReport/index.js
server/api/whatsappQueueReport/whatsappQueueReport.attributes.js
server/api/whatsappQueueReport/whatsappQueueReport.controller.js
server/api/whatsappQueueReport/whatsappQueueReport.model.js
server/api/whatsappQueueReport/whatsappQueueReport.rpc.js
server/api/whatsappTransferReport/index.js
server/api/whatsappTransferReport/whatsappTransferReport.attributes.js
server/api/whatsappTransferReport/whatsappTransferReport.controller.js
server/api/whatsappTransferReport/whatsappTransferReport.model.js
server/api/whatsappTransferReport/whatsappTransferReport.rpc.js
server/app.js
server/components/auth/service.js
server/components/encryptor/index.js
server/components/export/csv.js
server/components/export/pdf.js
server/components/export/xlsx.js
server/components/extensions/rewrite.js
server/components/import/cm/csv.js
server/components/import/cm/csv2.js
server/components/import/cm/csvUpdates.js
server/components/integrations/configuration.js
server/components/interaction/service.js
server/components/license/service.js
server/components/parsers/advancedSearch.js
server/components/parsers/qs.js
server/config/express.js
server/config/license/hardware.js
server/config/license/index.js
server/config/license/util.js
server/config/local.env.js
server/config/logger.js
server/config/pm2/config.js
server/config/pm2/index.js
server/config/schedule/chat.js
server/config/schedule/cloud-provider.js
server/config/schedule/index.js
server/config/schedule/transcribe.js
server/config/schedule/whatsapp.js
server/config/seedContact.js
server/config/seedUsers.js
server/config/socketio.js
server/config/triggers/index.js
server/config/utils.js
server/errors/api.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/events.js
server/services/agi/graph/index.js
server/services/agi/index.js
server/services/agi/mailRpc/index.js
server/services/agi/project.js
server/services/agi/reply.js
server/services/agi/rpc/index.js
server/services/agi/scripts/aws/index.js
server/services/agi/scripts/aws/lex/index.js
server/services/agi/scripts/aws/lex/lib/api.js
server/services/agi/scripts/aws/polly/index.js
server/services/agi/scripts/aws/polly/lib/api.js
server/services/agi/scripts/google/asr/index.js
server/services/agi/scripts/google/asr/lib/api.js
server/services/agi/scripts/google/index.js
server/services/agi/scripts/index.js
server/services/agi/scripts/sestek/index.js
server/services/agi/scripts/sestek/nda/index.js
server/services/agi/scripts/tilde/asr/index.js
server/services/agi/scripts/tilde/asr/lib/api.js
server/services/agi/scripts/tilde/index.js
server/services/agi/server.js
server/services/agi/vertices.js
server/services/ami/acw/index.js
server/services/ami/ami.js
server/services/ami/client.js
server/services/ami/dialer/action.js
server/services/ami/dialer/agentComplete.js
server/services/ami/dialer/final.js
server/services/ami/dialer/hangup.js
server/services/ami/dialer/history.js
server/services/ami/dialer/index.js
server/services/ami/dialer/queueCallerAbandon.js
server/services/ami/fax/action.js
server/services/ami/fax/index.js
server/services/ami/fax/rpcDb.js
server/services/ami/fax/util/gs.js
server/services/ami/fax/util/util.js
server/services/ami/index.js
server/services/ami/model/agent.js
server/services/ami/model/campaign.js
server/services/ami/model/channel.js
server/services/ami/model/deskAccount.js
server/services/ami/model/dynamics365Account.js
server/services/ami/model/faxAccount.js
server/services/ami/model/freshdeskAccount.js
server/services/ami/model/freshsalesAccount.js
server/services/ami/model/queueReport.js
server/services/ami/model/salesforceAccount.js
server/services/ami/model/servicenowAccount.js
server/services/ami/model/sugarcrmAccount.js
server/services/ami/model/telephone.js
server/services/ami/model/template.js
server/services/ami/model/trigger.js
server/services/ami/model/trunk.js
server/services/ami/model/voiceExtension.js
server/services/ami/model/voiceQueue.js
server/services/ami/model/vtigerAccount.js
server/services/ami/model/zendeskAccount.js
server/services/ami/model/zohoAccount.js
server/services/ami/preview/action.js
server/services/ami/preview/index.js
server/services/ami/preview/rpcDb.js
server/services/ami/preview/util/util.js
server/services/ami/properties.js
server/services/ami/realtime/index.js
server/services/ami/report/index.js
server/services/ami/report/userReport.js
server/services/ami/report/voiceAgentReport.js
server/services/ami/report/voiceCallReport.js
server/services/ami/report/voiceDialReport.js
server/services/ami/report/voiceQueueReport.js
server/services/ami/rpc/agentReportPreview.js
server/services/ami/rpc/attachment.js
server/services/ami/rpc/campaign.js
server/services/ami/rpc/cmContact.js
server/services/ami/rpc/cmHopper.js
server/services/ami/rpc/cmHopperAdditionalPhone.js
server/services/ami/rpc/cmHopperBlack.js
server/services/ami/rpc/cmHopperFinal.js
server/services/ami/rpc/cmHopperHistory.js
server/services/ami/rpc/faxAccount.js
server/services/ami/rpc/faxMessage.js
server/services/ami/rpc/integrations/desk.js
server/services/ami/rpc/integrations/dynamics365.js
server/services/ami/rpc/integrations/freshdesk.js
server/services/ami/rpc/integrations/freshsales.js
server/services/ami/rpc/integrations/salesforce.js
server/services/ami/rpc/integrations/servicenow.js
server/services/ami/rpc/integrations/sugarcrm.js
server/services/ami/rpc/integrations/vtiger.js
server/services/ami/rpc/integrations/zendesk.js
server/services/ami/rpc/integrations/zoho.js
server/services/ami/rpc/memberReport.js
server/services/ami/rpc/setting.js
server/services/ami/rpc/template.js
server/services/ami/rpc/trigger.js
server/services/ami/rpc/trunk.js
server/services/ami/rpc/user.js
server/services/ami/rpc/voiceAgentReport.js
server/services/ami/rpc/voiceCallReport.js
server/services/ami/rpc/voiceDialReport.js
server/services/ami/rpc/voiceExtension.js
server/services/ami/rpc/voiceQueue.js
server/services/ami/rpc/voiceQueueReport.js
server/services/ami/rpc/voiceQueueRt.js
server/services/ami/rpc/voiceRecording.js
server/services/ami/rpc/voiceTransferReport.js
server/services/ami/server/index.js
server/services/ami/trigger/cmContact/index.js
server/services/ami/trigger/index.js
server/services/ami/trigger/integration/desk.js
server/services/ami/trigger/integration/dynamics365.js
server/services/ami/trigger/integration/freshdesk.js
server/services/ami/trigger/integration/freshsales.js
server/services/ami/trigger/integration/index.js
server/services/ami/trigger/integration/salesforce.js
server/services/ami/trigger/integration/servicenow.js
server/services/ami/trigger/integration/sugarcrm.js
server/services/ami/trigger/integration/util.js
server/services/ami/trigger/integration/vtiger.js
server/services/ami/trigger/integration/zendesk.js
server/services/ami/trigger/integration/zoho.js
server/services/ami/trigger/script/index.js
server/services/ami/trigger/urlforward/index.js
server/services/email/client.js
server/services/email/index.js
server/services/email/lib/email.js
server/services/email/lib/imap.js
server/services/email/lib/smtp.js
server/services/email/lib/utils.js
server/services/email/model/mailAccount.js
server/services/email/realtime/index.js
server/services/email/rpc/mailAccount.js
server/services/email/rpc/setting.js
server/services/email/server/index.js
server/services/express/index.js
server/services/routing/client.js
server/services/routing/index.js
server/services/routing/lib/rule-engine.js
server/services/routing/mailRpc/index.js
server/services/routing/model/agent.js
server/services/routing/model/chatQueue.js
server/services/routing/model/faxQueue.js
server/services/routing/model/interval.js
server/services/routing/model/mailQueue.js
server/services/routing/model/openchannelQueue.js
server/services/routing/model/smsQueue.js
server/services/routing/model/whatsappQueue.js
server/services/routing/realtime/index.js
server/services/routing/rpc/chatInteraction.js
server/services/routing/rpc/chatMessage.js
server/services/routing/rpc/chatQueue.js
server/services/routing/rpc/chatQueueReport.js
server/services/routing/rpc/faxInteraction.js
server/services/routing/rpc/faxMessage.js
server/services/routing/rpc/faxQueue.js
server/services/routing/rpc/faxQueueReport.js
server/services/routing/rpc/interval.js
server/services/routing/rpc/mailInteraction.js
server/services/routing/rpc/mailMessage.js
server/services/routing/rpc/mailQueue.js
server/services/routing/rpc/mailQueueReport.js
server/services/routing/rpc/openchannelInteraction.js
server/services/routing/rpc/openchannelMessage.js
server/services/routing/rpc/openchannelQueue.js
server/services/routing/rpc/openchannelQueueReport.js
server/services/routing/rpc/smsInteraction.js
server/services/routing/rpc/smsMessage.js
server/services/routing/rpc/smsQueue.js
server/services/routing/rpc/smsQueueReport.js
server/services/routing/rpc/user.js
server/services/routing/rpc/whatsappInteraction.js
server/services/routing/rpc/whatsappMessage.js
server/services/routing/rpc/whatsappQueue.js
server/services/routing/rpc/whatsappQueueReport.js
server/services/routing/server/applications/agent.js
server/services/routing/server/applications/amazonlex.js
server/services/routing/server/applications/autoreply.js
server/services/routing/server/applications/close.js
server/services/routing/server/applications/dialogflow.js
server/services/routing/server/applications/dialogflowV2.js
server/services/routing/server/applications/gotoif.js
server/services/routing/server/applications/gotop.js
server/services/routing/server/applications/message.js
server/services/routing/server/applications/noop.js
server/services/routing/server/applications/queue.js
server/services/routing/server/applications/strategy/agent.js
server/services/routing/server/applications/strategy/beepall.js
server/services/routing/server/applications/strategy/index.js
server/services/routing/server/applications/strategy/rrmemory.js
server/services/routing/server/applications/strategy/util.js
server/services/routing/server/applications/system.js
server/services/routing/server/applications/tag.js
server/services/routing/server/applications/tvox.js
server/services/routing/server/applications/utils.js
server/services/routing/server/index.js
server/services/routing/server/interval.js
server/services/xdr/agents.controller.js
server/services/xdr/calls.controller.js
server/services/xdr/core.controller.js
server/services/xdr/dials.controller.js
server/services/xdr/index.js
server/services/xdr/members.controller.js
server/services/xdr/queues.controller.js
server/services/xdr/recordings.controller.js
server/services/xdr/transfers.controller.js
server/services/xdr/utils.js
server/utils/client-side-logger.js
server/utils/loggers.js
server/utils/mask-sensitive-data.js
server/utils/safe-template.js

index f49674e..d7a97fd 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-03-23T16:22:31.519Z",
+    "time": "2022-03-23T16:38:54.059Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index a2fca33..8830c69 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-03-23T16:22:31.519Z",
+    "time": "2022-03-23T16:38:54.059Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 8c62db2..acda025 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f4c=['STRING','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','action','contactManager','integration','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x2be6e0,_0x5deab6){var _0x3ffa1b=function(_0x3bd2e8){while(--_0x3bd2e8){_0x2be6e0['push'](_0x2be6e0['shift']());}};_0x3ffa1b(++_0x5deab6);}(_0x4f4c,0x1f3));var _0xc4f4=function(_0x7140aa,_0x495b9b){_0x7140aa=_0x7140aa-0x0;var _0x6b0a41=_0x4f4c[_0x7140aa];return _0x6b0a41;};'use strict';var Sequelize=require(_0xc4f4('0x0'));module[_0xc4f4('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x36966c){return this[_0xc4f4('0x2')](_0xc4f4('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0xc4f4('0x4'),_0xc4f4('0x5'),'motionbar',_0xc4f4('0x6'),_0xc4f4('0x7'),_0xc4f4('0x8'),_0xc4f4('0x9'),'script']],'msg':_0xc4f4('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xc4f4('0xb')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xc4f4('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xc4f4('0xd')},'data4':{'type':Sequelize[_0xc4f4('0xe')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xc4f4('0xf')},'data6':{'type':Sequelize[_0xc4f4('0xe')],'comments':_0xc4f4('0x10')},'data7':{'type':Sequelize[_0xc4f4('0x11')],'comments':_0xc4f4('0x12')}};
\ No newline at end of file
+var _0xf682=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','exports','VIRTUAL','STRING','contactManager','integration','motionbar','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'];(function(_0x496333,_0x1c47d6){var _0x44256e=function(_0x58767d){while(--_0x58767d){_0x496333['push'](_0x496333['shift']());}};_0x44256e(++_0x1c47d6);}(_0xf682,0x1a4));var _0x2f68=function(_0x2b309e,_0x2b5bb3){_0x2b309e=_0x2b309e-0x0;var _0x11d36a=_0xf682[_0x2b309e];return _0x11d36a;};'use strict';var Sequelize=require('sequelize');module[_0x2f68('0x0')]={'name':{'type':Sequelize[_0x2f68('0x1')],'get':function(_0x5d0565){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x2f68('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0x2f68('0x3'),_0x2f68('0x4'),_0x2f68('0x5'),_0x2f68('0x6'),_0x2f68('0x7'),'browser',_0x2f68('0x8'),_0x2f68('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x2f68('0xa')},'data1':{'type':Sequelize[_0x2f68('0x2')](0x1000),'comment':_0x2f68('0xb')},'data2':{'type':Sequelize[_0x2f68('0x2')](0x1000),'comment':_0x2f68('0xc')},'data3':{'type':Sequelize[_0x2f68('0x2')](0x1000),'comment':_0x2f68('0xd')},'data4':{'type':Sequelize[_0x2f68('0x2')](0x1000),'comments':_0x2f68('0xe')},'data5':{'type':Sequelize[_0x2f68('0x2')](0x1000),'comments':_0x2f68('0xf')},'data6':{'type':Sequelize['STRING'],'comments':_0x2f68('0x10')},'data7':{'type':Sequelize[_0x2f68('0x11')],'comments':'urlForward[body]'}};
\ No newline at end of file
index 641bc7d..3378558 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c11=['Action','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','send','body','catch'];(function(_0xf6e73a,_0x4c2776){var _0x364816=function(_0x223d6f){while(--_0x223d6f){_0xf6e73a['push'](_0xf6e73a['shift']());}};_0x364816(++_0x4c2776);}(_0x5c11,0x162));var _0x15c1=function(_0x33875d,_0xf2f624){_0x33875d=_0x33875d-0x0;var _0x477086=_0x5c11[_0x33875d];return _0x477086;};'use strict';var emlformat=require(_0x15c1('0x0'));var rimraf=require(_0x15c1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x15c1('0x2'));var rp=require(_0x15c1('0x3'));var moment=require(_0x15c1('0x4'));var BPromise=require(_0x15c1('0x5'));var Mustache=require(_0x15c1('0x6'));var util=require('util');var path=require(_0x15c1('0x7'));var sox=require(_0x15c1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x15c1('0x9'));var squel=require(_0x15c1('0xa'));var crypto=require(_0x15c1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x15c1('0xc'));var toCsv=require(_0x15c1('0xd'));var querystring=require(_0x15c1('0xe'));var Papa=require(_0x15c1('0xf'));var Redis=require(_0x15c1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x15c1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x15c1('0x12'));var utils=require(_0x15c1('0x13'));var config=require(_0x15c1('0x14'));var licenseUtil=require(_0x15c1('0x15'));var db=require(_0x15c1('0x16'))['db'];function respondWithStatusCode(_0x1977c4,_0x247740){_0x247740=_0x247740||0xcc;return function(_0xf828af){if(_0xf828af){return _0x1977c4[_0x15c1('0x17')](_0x247740);}return _0x1977c4[_0x15c1('0x18')](_0x247740)[_0x15c1('0x19')]();};}function respondWithResult(_0x105e31,_0x2b021f){_0x2b021f=_0x2b021f||0xc8;return function(_0x32bb71){if(_0x32bb71){return _0x105e31[_0x15c1('0x18')](_0x2b021f)[_0x15c1('0x1a')](_0x32bb71);}};}function respondWithFilteredResult(_0x5c7ae0,_0xdda389){return function(_0x46621e){if(_0x46621e){var _0x4495cd=typeof _0xdda389[_0x15c1('0x1b')]===_0x15c1('0x1c')&&typeof _0xdda389[_0x15c1('0x1d')]===_0x15c1('0x1c');var _0x4d6067=_0x46621e[_0x15c1('0x1e')];var _0x35b52a=_0x4495cd?0x0:_0xdda389[_0x15c1('0x1b')];var _0x143e3b=_0x4495cd?_0x46621e['count']:_0xdda389[_0x15c1('0x1b')]+_0xdda389[_0x15c1('0x1d')];var _0x4bbcc7;if(_0x143e3b>=_0x4d6067){_0x143e3b=_0x4d6067;_0x4bbcc7=0xc8;}else{_0x4bbcc7=0xce;}_0x5c7ae0[_0x15c1('0x18')](_0x4bbcc7);return _0x5c7ae0['set']('Content-Range',_0x35b52a+'-'+_0x143e3b+'/'+_0x4d6067)['json'](_0x46621e);}return null;};}function patchUpdates(_0xf9c651){return function(_0x4941e9){try{jsonpatch[_0x15c1('0x1f')](_0x4941e9,_0xf9c651,!![]);}catch(_0x45f8c6){return BPromise[_0x15c1('0x20')](_0x45f8c6);}return _0x4941e9[_0x15c1('0x21')]();};}function saveUpdates(_0x185126,_0x4d3832){return function(_0x14325e){if(_0x14325e){return _0x14325e[_0x15c1('0x22')](_0x185126)[_0x15c1('0x23')](function(_0xa8fc3b){return _0xa8fc3b;});}return null;};}function removeEntity(_0x584896,_0x2998ac){return function(_0x5597f6){if(_0x5597f6){return _0x5597f6[_0x15c1('0x24')]()['then'](function(){_0x584896[_0x15c1('0x18')](0xcc)[_0x15c1('0x19')]();});}};}function handleEntityNotFound(_0x3880fd,_0x34ea23){return function(_0x55bfd9){if(!_0x55bfd9){_0x3880fd[_0x15c1('0x17')](0x194);}return _0x55bfd9;};}function handleError(_0x4957dd,_0x2cc93d){_0x2cc93d=_0x2cc93d||0x1f4;return function(_0x423941){logger[_0x15c1('0x25')](_0x423941[_0x15c1('0x26')]);if(_0x423941['name']){delete _0x423941['name'];}_0x4957dd[_0x15c1('0x18')](_0x2cc93d)[_0x15c1('0x27')](_0x423941);};}exports[_0x15c1('0x22')]=function(_0x473279,_0x42dfa8){if(_0x473279[_0x15c1('0x28')]['id']){delete _0x473279[_0x15c1('0x28')]['id'];}return db['Action']['find']({'where':{'id':_0x473279['params']['id']}})[_0x15c1('0x23')](handleEntityNotFound(_0x42dfa8,null))[_0x15c1('0x23')](saveUpdates(_0x473279[_0x15c1('0x28')],null))[_0x15c1('0x23')](respondWithResult(_0x42dfa8,null))[_0x15c1('0x29')](handleError(_0x42dfa8,null));};exports['destroy']=function(_0x2d1983,_0x10c995){return db[_0x15c1('0x2a')][_0x15c1('0x2b')]({'where':{'id':_0x2d1983['params']['id']}})[_0x15c1('0x23')](handleEntityNotFound(_0x10c995,null))[_0x15c1('0x23')](removeEntity(_0x10c995,null))[_0x15c1('0x29')](handleError(_0x10c995,null));};
\ No newline at end of file
+var _0xfbbe=['count','offset','set','Content-Range','json','apply','reject','save','update','then','end','error','name','send','body','find','params','catch','destroy','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit'];(function(_0x3eb3ea,_0x410c83){var _0x80c20c=function(_0x33a3bf){while(--_0x33a3bf){_0x3eb3ea['push'](_0x3eb3ea['shift']());}};_0x80c20c(++_0x410c83);}(_0xfbbe,0x196));var _0xefbb=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xfbbe[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xefbb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xefbb('0x1'));var rp=require(_0xefbb('0x2'));var moment=require(_0xefbb('0x3'));var BPromise=require(_0xefbb('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xefbb('0x5'));var sox=require(_0xefbb('0x6'));var csv=require(_0xefbb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xefbb('0x8'));var crypto=require('crypto');var jsforce=require(_0xefbb('0x9'));var deskjs=require(_0xefbb('0xa'));var toCsv=require(_0xefbb('0x7'));var querystring=require(_0xefbb('0xb'));var Papa=require(_0xefbb('0xc'));var Redis=require(_0xefbb('0xd'));var authService=require(_0xefbb('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xefbb('0xf'));var hardwareService=require(_0xefbb('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xefbb('0x11'));var config=require(_0xefbb('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xefbb('0x13'))['db'];function respondWithStatusCode(_0x5d993d,_0x1abade){_0x1abade=_0x1abade||0xcc;return function(_0x4c5e95){if(_0x4c5e95){return _0x5d993d[_0xefbb('0x14')](_0x1abade);}return _0x5d993d['status'](_0x1abade)['end']();};}function respondWithResult(_0x5f5cf9,_0x58136d){_0x58136d=_0x58136d||0xc8;return function(_0x206cce){if(_0x206cce){return _0x5f5cf9[_0xefbb('0x15')](_0x58136d)['json'](_0x206cce);}};}function respondWithFilteredResult(_0x325a57,_0x197251){return function(_0x1de17c){if(_0x1de17c){var _0x121b0b=typeof _0x197251['offset']===_0xefbb('0x16')&&typeof _0x197251[_0xefbb('0x17')]==='undefined';var _0x14995f=_0x1de17c[_0xefbb('0x18')];var _0x3cd3b2=_0x121b0b?0x0:_0x197251[_0xefbb('0x19')];var _0x32cf1a=_0x121b0b?_0x1de17c[_0xefbb('0x18')]:_0x197251[_0xefbb('0x19')]+_0x197251[_0xefbb('0x17')];var _0x4b59eb;if(_0x32cf1a>=_0x14995f){_0x32cf1a=_0x14995f;_0x4b59eb=0xc8;}else{_0x4b59eb=0xce;}_0x325a57['status'](_0x4b59eb);return _0x325a57[_0xefbb('0x1a')](_0xefbb('0x1b'),_0x3cd3b2+'-'+_0x32cf1a+'/'+_0x14995f)[_0xefbb('0x1c')](_0x1de17c);}return null;};}function patchUpdates(_0x3f27cc){return function(_0xe5af47){try{jsonpatch[_0xefbb('0x1d')](_0xe5af47,_0x3f27cc,!![]);}catch(_0x1754c2){return BPromise[_0xefbb('0x1e')](_0x1754c2);}return _0xe5af47[_0xefbb('0x1f')]();};}function saveUpdates(_0x3d7a41,_0x14a9c2){return function(_0x7c0779){if(_0x7c0779){return _0x7c0779[_0xefbb('0x20')](_0x3d7a41)[_0xefbb('0x21')](function(_0x4a892c){return _0x4a892c;});}return null;};}function removeEntity(_0x56a4fa,_0xce8a90){return function(_0x33edc2){if(_0x33edc2){return _0x33edc2['destroy']()[_0xefbb('0x21')](function(){_0x56a4fa[_0xefbb('0x15')](0xcc)[_0xefbb('0x22')]();});}};}function handleEntityNotFound(_0x5398ee,_0x1a9455){return function(_0x598825){if(!_0x598825){_0x5398ee[_0xefbb('0x14')](0x194);}return _0x598825;};}function handleError(_0x3021eb,_0x18f4c0){_0x18f4c0=_0x18f4c0||0x1f4;return function(_0x1d9162){logger[_0xefbb('0x23')](_0x1d9162['stack']);if(_0x1d9162[_0xefbb('0x24')]){delete _0x1d9162['name'];}_0x3021eb[_0xefbb('0x15')](_0x18f4c0)[_0xefbb('0x25')](_0x1d9162);};}exports['update']=function(_0x3b13b5,_0x3e9fbc){if(_0x3b13b5[_0xefbb('0x26')]['id']){delete _0x3b13b5[_0xefbb('0x26')]['id'];}return db['Action'][_0xefbb('0x27')]({'where':{'id':_0x3b13b5[_0xefbb('0x28')]['id']}})[_0xefbb('0x21')](handleEntityNotFound(_0x3e9fbc,null))['then'](saveUpdates(_0x3b13b5['body'],null))[_0xefbb('0x21')](respondWithResult(_0x3e9fbc,null))[_0xefbb('0x29')](handleError(_0x3e9fbc,null));};exports[_0xefbb('0x2a')]=function(_0x365f44,_0x5b630d){return db['Action'][_0xefbb('0x27')]({'where':{'id':_0x365f44['params']['id']}})[_0xefbb('0x21')](handleEntityNotFound(_0x5b630d,null))[_0xefbb('0x21')](removeEntity(_0x5b630d,null))[_0xefbb('0x29')](handleError(_0x5b630d,null));};
\ No newline at end of file
index 3fa298d..1d8cc04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x291d=['./action.attributes','exports','tools_actions','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x124811,_0x3968ff){var _0xe73d91=function(_0x46b792){while(--_0x46b792){_0x124811['push'](_0x124811['shift']());}};_0xe73d91(++_0x3968ff);}(_0x291d,0x1d1));var _0xd291=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x291d[_0x2b10c6];return _0x3789d2;};'use strict';var _=require('lodash');var util=require(_0xd291('0x0'));var logger=require(_0xd291('0x1'))(_0xd291('0x2'));var moment=require(_0xd291('0x3'));var BPromise=require('bluebird');var rp=require(_0xd291('0x4'));var fs=require('fs');var path=require(_0xd291('0x5'));var rimraf=require(_0xd291('0x6'));var config=require(_0xd291('0x7'));var attributes=require(_0xd291('0x8'));module[_0xd291('0x9')]=function(_0x251ae8,_0x271aff){return _0x251ae8['define']('Action',attributes,{'tableName':_0xd291('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x416b=['lodash','util','moment','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions'];(function(_0x4ce241,_0x3c80d8){var _0x4c0567=function(_0x48be5a){while(--_0x48be5a){_0x4ce241['push'](_0x4ce241['shift']());}};_0x4c0567(++_0x3c80d8);}(_0x416b,0x1c8));var _0xb416=function(_0x2c1ac1,_0x3dfb07){_0x2c1ac1=_0x2c1ac1-0x0;var _0x240e2d=_0x416b[_0x2c1ac1];return _0x240e2d;};'use strict';var _=require(_0xb416('0x0'));var util=require(_0xb416('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb416('0x2'));var BPromise=require('bluebird');var rp=require(_0xb416('0x3'));var fs=require('fs');var path=require(_0xb416('0x4'));var rimraf=require(_0xb416('0x5'));var config=require(_0xb416('0x6'));var attributes=require(_0xb416('0x7'));module[_0xb416('0x8')]=function(_0x386517,_0x35bf96){return _0x386517[_0xb416('0x9')](_0xb416('0xa'),attributes,{'tableName':_0xb416('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a3ae935..c69cc47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x514260,_0x1891e1){var _0x4ac81b=function(_0x53cab1){while(--_0x53cab1){_0x514260['push'](_0x514260['shift']());}};_0x4ac81b(++_0x1891e1);}(_0xf494,0x1c6));var _0x4f49=function(_0x3fe4a2,_0x40d6b7){_0x3fe4a2=_0x3fe4a2-0x0;var _0x3d9747=_0xf494[_0x3fe4a2];return _0x3d9747;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
+var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x53ec,0x192));var _0xc53e=function(_0x27787d,_0x3c832a){_0x27787d=_0x27787d-0x0;var _0x2ec19c=_0x53ec[_0x27787d];return _0x2ec19c;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
index 3b3d28a..898e2b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b20=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','destroy'];(function(_0x5f0df8,_0x25e88d){var _0x284b13=function(_0x3a1ec9){while(--_0x3a1ec9){_0x5f0df8['push'](_0x5f0df8['shift']());}};_0x284b13(++_0x25e88d);}(_0x0b20,0x151));var _0x00b2=function(_0x339d18,_0x2ce5cb){_0x339d18=_0x339d18-0x0;var _0x5be285=_0x0b20[_0x339d18];return _0x5be285;};'use strict';var multer=require('multer');var util=require(_0x00b2('0x0'));var path=require(_0x00b2('0x1'));var timeout=require(_0x00b2('0x2'));var express=require(_0x00b2('0x3'));var router=express[_0x00b2('0x4')]();var fs_extra=require(_0x00b2('0x5'));var auth=require(_0x00b2('0x6'));var interaction=require(_0x00b2('0x7'));var config=require(_0x00b2('0x8'));var controller=require(_0x00b2('0x9'));router[_0x00b2('0xa')]('/:id',auth[_0x00b2('0xb')](),controller[_0x00b2('0xc')]);router[_0x00b2('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x00b2('0xe')]);module[_0x00b2('0xf')]=router;
\ No newline at end of file
+var _0x0fe7=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','delete','isAuthenticated','destroy','exports','multer','util'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x0fe7,0x108));var _0x70fe=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0fe7[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x70fe('0x0'));var util=require(_0x70fe('0x1'));var path=require(_0x70fe('0x2'));var timeout=require(_0x70fe('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x70fe('0x4'));var interaction=require(_0x70fe('0x5'));var config=require(_0x70fe('0x6'));var controller=require(_0x70fe('0x7'));router[_0x70fe('0x8')](_0x70fe('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x70fe('0xa')](_0x70fe('0x9'),auth[_0x70fe('0xb')](),controller[_0x70fe('0xc')]);module[_0x70fe('0xd')]=router;
\ No newline at end of file
index dd26c1d..b6935a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x46ed,0x168));var _0xd46e=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x46ed[_0x36ed48];return _0x51c63a;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}};
\ No newline at end of file
+var _0x53ec=['STRING','TEXT','sequelize','exports'];(function(_0xd92880,_0xbf75a6){var _0x12f128=function(_0x4b313c){while(--_0x4b313c){_0xd92880['push'](_0xd92880['shift']());}};_0x12f128(++_0xbf75a6);}(_0x53ec,0x192));var _0xc53e=function(_0x213aac,_0x30117f){_0x213aac=_0x213aac-0x0;var _0x20bc6f=_0x53ec[_0x213aac];return _0x20bc6f;};'use strict';var Sequelize=require(_0xc53e('0x0'));module[_0xc53e('0x1')]={'name':{'type':Sequelize[_0xc53e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc53e('0x2')]},'parent':{'type':Sequelize[_0xc53e('0x2')]},'table':{'type':Sequelize[_0xc53e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xc53e('0x3')]}};
\ No newline at end of file
index 720cb43..ae81fc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x838a=['VIRTUAL','options','AnalyticCustomReport','include','findAll','rows','show','params','includeAll','find','create','body','user','get','role','Reports','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','AVG(%s)','getFields','ValidationErrorItem','DESC','output','web','fullPath','%s-%s.%s','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','runReport','SEC_TO_TIME(%s)','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','update','destroy','then','CustomReports','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge'];(function(_0x512b7e,_0x1903a0){var _0x5c8530=function(_0x217c82){while(--_0x217c82){_0x512b7e['push'](_0x512b7e['shift']());}};_0x5c8530(++_0x1903a0);}(_0x838a,0x65));var _0xa838=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x838a[_0x13ea00];return _0x1f7347;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa838('0x0'));var jsonpatch=require(_0xa838('0x1'));var rp=require(_0xa838('0x2'));var moment=require(_0xa838('0x3'));var BPromise=require(_0xa838('0x4'));var Mustache=require(_0xa838('0x5'));var util=require(_0xa838('0x6'));var path=require(_0xa838('0x7'));var sox=require(_0xa838('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa838('0x9'));var _=require(_0xa838('0xa'));var squel=require(_0xa838('0xb'));var crypto=require(_0xa838('0xc'));var jsforce=require(_0xa838('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa838('0xe'));var Papa=require('papaparse');var Redis=require(_0xa838('0xf'));var authService=require(_0xa838('0x10'));var qs=require(_0xa838('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa838('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xa838('0x13'));var db=require(_0xa838('0x14'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x2780d8,_0x3838c1){_0x3838c1=_0x3838c1||0xcc;return function(_0x5b0769){if(_0x5b0769){return _0x2780d8[_0xa838('0x15')](_0x3838c1);}return _0x2780d8[_0xa838('0x16')](_0x3838c1)[_0xa838('0x17')]();};}function respondWithResult(_0x5c8972,_0x3a4a20){_0x3a4a20=_0x3a4a20||0xc8;return function(_0x8544ba){if(_0x8544ba){return _0x5c8972[_0xa838('0x16')](_0x3a4a20)['json'](_0x8544ba);}};}function respondWithFilteredResult(_0x3b6bdc,_0x4083aa){return function(_0x16bad2){if(_0x16bad2){var _0x16d074=typeof _0x4083aa[_0xa838('0x18')]==='undefined'&&typeof _0x4083aa[_0xa838('0x19')]===_0xa838('0x1a');var _0x2e566c=_0x16bad2['count'];var _0x388097=_0x16d074?0x0:_0x4083aa[_0xa838('0x18')];var _0x1e1e29=_0x16d074?_0x16bad2[_0xa838('0x1b')]:_0x4083aa[_0xa838('0x18')]+_0x4083aa[_0xa838('0x19')];var _0xa85514;if(_0x1e1e29>=_0x2e566c){_0x1e1e29=_0x2e566c;_0xa85514=0xc8;}else{_0xa85514=0xce;}_0x3b6bdc[_0xa838('0x16')](_0xa85514);return _0x3b6bdc[_0xa838('0x1c')](_0xa838('0x1d'),_0x388097+'-'+_0x1e1e29+'/'+_0x2e566c)[_0xa838('0x1e')](_0x16bad2);}return null;};}function patchUpdates(_0x4fbe38){return function(_0x1fbf7a){try{jsonpatch[_0xa838('0x1f')](_0x1fbf7a,_0x4fbe38,!![]);}catch(_0x14e518){return BPromise['reject'](_0x14e518);}return _0x1fbf7a['save']();};}function saveUpdates(_0x145943,_0x40633a){return function(_0x279f8e){if(_0x279f8e){return _0x279f8e[_0xa838('0x20')](_0x145943)['then'](function(_0x4a5b1e){return _0x4a5b1e;});}return null;};}function removeEntity(_0x436aa3,_0x510211){return function(_0x4648d7){if(_0x4648d7){return _0x4648d7[_0xa838('0x21')]()[_0xa838('0x22')](function(){var _0x36e1a1=_0x4648d7['get']({'plain':!![]});var _0x263b0c=_0xa838('0x23');return db[_0xa838('0x24')][_0xa838('0x21')]({'where':{'type':_0x263b0c,'resourceId':_0x36e1a1['id']}})[_0xa838('0x22')](function(){return _0x4648d7;});})[_0xa838('0x22')](function(){_0x436aa3[_0xa838('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5263d1,_0x48066c){return function(_0x5badc3){if(!_0x5badc3){_0x5263d1[_0xa838('0x15')](0x194);}return _0x5badc3;};}function handleError(_0xaece71,_0x52809d){_0x52809d=_0x52809d||0x1f4;return function(_0x205087){logger[_0xa838('0x25')](_0x205087['stack']);if(_0x205087[_0xa838('0x26')]){delete _0x205087['name'];}_0xaece71['status'](_0x52809d)[_0xa838('0x27')](_0x205087);};}exports[_0xa838('0x28')]=function(_0x36a238,_0x118272){var _0x38c167={},_0x4753a4={},_0x22da7d={'count':0x0,'rows':[]};var _0x13f1d2=_[_0xa838('0x29')](db['AnalyticCustomReport'][_0xa838('0x2a')],function(_0x265c2d){return{'name':_0x265c2d[_0xa838('0x2b')],'type':_0x265c2d[_0xa838('0x2c')]['key']};});_0x4753a4[_0xa838('0x2d')]=_[_0xa838('0x29')](_0x13f1d2,_0xa838('0x26'));_0x4753a4['query']=_[_0xa838('0x2e')](_0x36a238[_0xa838('0x2f')]);_0x4753a4[_0xa838('0x30')]=_[_0xa838('0x31')](_0x4753a4['model'],_0x4753a4[_0xa838('0x2f')]);_0x38c167[_0xa838('0x32')]=_[_0xa838('0x31')](_0x4753a4['model'],qs[_0xa838('0x33')](_0x36a238[_0xa838('0x2f')][_0xa838('0x33')]));_0x38c167[_0xa838('0x32')]=_0x38c167[_0xa838('0x32')][_0xa838('0x34')]?_0x38c167[_0xa838('0x32')]:_0x4753a4[_0xa838('0x2d')];if(!_0x36a238[_0xa838('0x2f')]['hasOwnProperty'](_0xa838('0x35'))){_0x38c167[_0xa838('0x19')]=qs[_0xa838('0x19')](_0x36a238[_0xa838('0x2f')]['limit']);_0x38c167[_0xa838('0x18')]=qs[_0xa838('0x18')](_0x36a238[_0xa838('0x2f')][_0xa838('0x18')]);}_0x38c167[_0xa838('0x36')]=qs[_0xa838('0x37')](_0x36a238['query']['sort']);_0x38c167[_0xa838('0x38')]=qs['filters'](_[_0xa838('0x39')](_0x36a238[_0xa838('0x2f')],_0x4753a4[_0xa838('0x30')]),_0x13f1d2);if(_0x36a238[_0xa838('0x2f')][_0xa838('0x3a')]){_0x38c167[_0xa838('0x38')]=_[_0xa838('0x3b')](_0x38c167[_0xa838('0x38')],{'$or':_['map'](_0x13f1d2,function(_0x5d4211){if(_0x5d4211['type']!==_0xa838('0x3c')){var _0x3bfd54={};_0x3bfd54[_0x5d4211[_0xa838('0x26')]]={'$like':'%'+_0x36a238[_0xa838('0x2f')][_0xa838('0x3a')]+'%'};return _0x3bfd54;}})});}_0x38c167=_[_0xa838('0x3b')]({},_0x38c167,_0x36a238[_0xa838('0x3d')]);var _0x539be8={'where':_0x38c167[_0xa838('0x38')]};return db[_0xa838('0x3e')][_0xa838('0x1b')](_0x539be8)[_0xa838('0x22')](function(_0x1c5a40){_0x22da7d[_0xa838('0x1b')]=_0x1c5a40;if(_0x36a238['query']['includeAll']){_0x38c167[_0xa838('0x3f')]=[{'all':!![]}];}return db[_0xa838('0x3e')][_0xa838('0x40')](_0x38c167);})[_0xa838('0x22')](function(_0x44b3ae){_0x22da7d[_0xa838('0x41')]=_0x44b3ae;return _0x22da7d;})[_0xa838('0x22')](respondWithFilteredResult(_0x118272,_0x38c167))['catch'](handleError(_0x118272,null));};exports[_0xa838('0x42')]=function(_0x18bb5e,_0x20f50a){var _0x7f044c={'raw':![],'where':{'id':_0x18bb5e[_0xa838('0x43')]['id']}},_0x55fb14={};_0x55fb14[_0xa838('0x2d')]=_['keys'](db[_0xa838('0x3e')][_0xa838('0x2a')]);_0x55fb14['query']=_['keys'](_0x18bb5e[_0xa838('0x2f')]);_0x55fb14[_0xa838('0x30')]=_[_0xa838('0x31')](_0x55fb14[_0xa838('0x2d')],_0x55fb14[_0xa838('0x2f')]);_0x7f044c[_0xa838('0x32')]=_[_0xa838('0x31')](_0x55fb14['model'],qs[_0xa838('0x33')](_0x18bb5e[_0xa838('0x2f')][_0xa838('0x33')]));_0x7f044c[_0xa838('0x32')]=_0x7f044c[_0xa838('0x32')][_0xa838('0x34')]?_0x7f044c['attributes']:_0x55fb14[_0xa838('0x2d')];if(_0x18bb5e[_0xa838('0x2f')][_0xa838('0x44')]){_0x7f044c['include']=[{'all':!![]}];}_0x7f044c=_[_0xa838('0x3b')]({},_0x7f044c,_0x18bb5e[_0xa838('0x3d')]);return db[_0xa838('0x3e')][_0xa838('0x45')](_0x7f044c)[_0xa838('0x22')](handleEntityNotFound(_0x20f50a,null))['then'](respondWithResult(_0x20f50a,null))['catch'](handleError(_0x20f50a,null));};exports['create']=function(_0x26cc26,_0x265833){return db[_0xa838('0x3e')][_0xa838('0x46')](_0x26cc26[_0xa838('0x47')],{})[_0xa838('0x22')](function(_0x25db58){var _0x2c6c2d=_0x26cc26[_0xa838('0x48')][_0xa838('0x49')]({'plain':!![]});if(!_0x2c6c2d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c6c2d[_0xa838('0x4a')]==='user'){var _0x2e21d9=_0x25db58['get']({'plain':!![]});var _0x597a1f=_0xa838('0x4b');return db[_0xa838('0x4c')]['find']({'where':{'name':_0x597a1f,'userProfileId':_0x2c6c2d[_0xa838('0x4d')]},'raw':!![]})['then'](function(_0x18ad18){if(_0x18ad18&&_0x18ad18[_0xa838('0x4e')]===0x0){return db[_0xa838('0x24')][_0xa838('0x46')]({'name':_0x2e21d9[_0xa838('0x26')],'resourceId':_0x2e21d9['id'],'type':_0xa838('0x23'),'sectionId':_0x18ad18['id']},{})['then'](function(){return _0x25db58;});}else{return _0x25db58;}})[_0xa838('0x4f')](function(_0x364bd0){logger[_0xa838('0x25')](_0xa838('0x50'),_0x364bd0);throw _0x364bd0;});}return _0x25db58;})[_0xa838('0x22')](respondWithResult(_0x265833,0xc9))[_0xa838('0x4f')](handleError(_0x265833,null));};exports[_0xa838('0x20')]=function(_0x70511f,_0x21cf67){if(_0x70511f['body']['id']){delete _0x70511f['body']['id'];}return db[_0xa838('0x3e')][_0xa838('0x45')]({'where':{'id':_0x70511f[_0xa838('0x43')]['id']}})['then'](handleEntityNotFound(_0x21cf67,null))['then'](saveUpdates(_0x70511f[_0xa838('0x47')],null))['then'](respondWithResult(_0x21cf67,null))[_0xa838('0x4f')](handleError(_0x21cf67,null));};exports[_0xa838('0x21')]=function(_0x4a0317,_0x5b7858){return db[_0xa838('0x3e')]['find']({'where':{'id':_0x4a0317[_0xa838('0x43')]['id']}})[_0xa838('0x22')](handleEntityNotFound(_0x5b7858,null))[_0xa838('0x22')](removeEntity(_0x5b7858,null))[_0xa838('0x4f')](handleError(_0x5b7858,null));};exports[_0xa838('0x51')]=function(_0x5e7c57,_0x1d9560){var _0x5194f0=0xa;var _0x129afb=[_0xa838('0x52'),_0xa838('0x53'),_0xa838('0x54'),_0xa838('0x55')];var _0x2dd0ab={'SUM':_0xa838('0x56'),'COUNT':_0xa838('0x57'),'COUNT DISTINCT':_0xa838('0x58'),'MAX':_0xa838('0x59'),'MIN':_0xa838('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xa838('0x5b'),'GROUP_CONCAT ASC':_0xa838('0x5c'),'GROUP_CONCAT DESC':_0xa838('0x5d')};var _0x3a0443={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa838('0x5e'),'HOUR':_0xa838('0x5f'),'ROUND':_0xa838('0x60'),'UNIX_TIMESTAMP':_0xa838('0x61')};var _0x3986c3=function(_0x5c587d){return!_[_0xa838('0x62')]([_0xa838('0x63'),_0xa838('0x64'),_0xa838('0x65'),_0xa838('0x66')],_0x5c587d);};var _0x1c6ced=function(_0x31ab5f){if(!_0x31ab5f||!_0x31ab5f[_0xa838('0x67')]['length']){return'';}for(var _0x51f3a2='(',_0x2e59b8=0x0;_0x2e59b8<_0x31ab5f[_0xa838('0x67')][_0xa838('0x34')];_0x2e59b8+=0x1){_0x2e59b8>0x0&&(_0x51f3a2+='\x20'+_0x31ab5f[_0xa838('0x68')]+'\x20');_0x51f3a2+=_0x31ab5f[_0xa838('0x67')][_0x2e59b8][_0xa838('0x69')]?_0x1c6ced(_0x31ab5f[_0xa838('0x67')][_0x2e59b8]['group']):_0x31ab5f['rules'][_0x2e59b8][_0xa838('0x6a')]+'\x20'+_0x31ab5f['rules'][_0x2e59b8][_0xa838('0x6b')]+(_0x3986c3(_0x31ab5f[_0xa838('0x67')][_0x2e59b8][_0xa838('0x6b')])?'\x20'+_0x31ab5f[_0xa838('0x67')][_0x2e59b8][_0xa838('0x6c')]:'');}return _0x51f3a2+')';};var _0x4997a2={'where':{'id':_0x5e7c57['params']['id']}},_0x32fc10,_0x22c2f4,_0x50f1ce,_0x56bf5d,_0x2cbae3;_0x4997a2=_[_0xa838('0x3b')]({},_0x4997a2,_0x5e7c57['options']);return db[_0xa838('0x3e')][_0xa838('0x45')](_0x4997a2)['then'](function(_0x3e0030){if(_0x3e0030){_0x32fc10=_0x3e0030;return _0x3e0030['getFields']();}return null;})[_0xa838('0x22')](function(_0x16a921){if(_0x16a921){if(!_0x16a921[_0xa838('0x34')]){throw new db[(_0xa838('0x6d'))]['ValidationErrorItem'](_0xa838('0x6e'),0x193);}_0x22c2f4=_0x16a921;return db[_0xa838('0x6f')][_0xa838('0x40')]({'raw':!![]});}return null;})['then'](function(_0x2f45da){if(_0x2f45da){_0x50f1ce=_[_0xa838('0x70')](_0x2f45da,'id');var _0x4eb0be;var _0x298dd1=squel[_0xa838('0x71')]();_0x298dd1[_0xa838('0x72')](_0x32fc10[_0xa838('0x73')]);for(var _0x14ab38=0x0;_0x14ab38<_0x22c2f4[_0xa838('0x34')];_0x14ab38+=0x1){_0x4eb0be=_0x22c2f4[_0x14ab38][_0xa838('0x74')]?_0x50f1ce[_0x22c2f4[_0x14ab38][_0xa838('0x74')]][_0xa838('0x75')]:_0x22c2f4[_0x14ab38][_0xa838('0x6a')];_0x4eb0be=_0x22c2f4[_0x14ab38][_0xa838('0x76')]?_[_0xa838('0x77')](_0x2dd0ab[_0x22c2f4[_0x14ab38][_0xa838('0x76')]],'%s',_0x4eb0be):_0x4eb0be;_0x4eb0be=_0x22c2f4[_0x14ab38][_0xa838('0x78')]?_[_0xa838('0x77')](_0x3a0443[_0x22c2f4[_0x14ab38][_0xa838('0x78')]],'%s',_0x4eb0be):_0x4eb0be;if(_0x22c2f4[_0x14ab38]['groupBy']){_0x298dd1['group'](_0x4eb0be);}_0x22c2f4[_0x14ab38][_0xa838('0x79')]&&_0x298dd1[_0xa838('0x36')](_0x4eb0be,_0x22c2f4[_0x14ab38][_0xa838('0x79')]==='DESC'?![]:!![]);_0x298dd1[_0xa838('0x6a')](_0x4eb0be,_0x22c2f4[_0x14ab38][_0xa838('0x7a')]||_0x4eb0be);}if(_0x32fc10[_0xa838('0x7b')]){_0x32fc10[_0xa838('0x7b')]=JSON[_0xa838('0x7c')](_0x32fc10[_0xa838('0x7b')]);for(var _0x396a32=0x0;_0x396a32<_0x32fc10['joins'][_0xa838('0x34')];_0x396a32+=0x1){if(_0x32fc10[_0xa838('0x7b')][_0x396a32][_0xa838('0x2c')]&&_[_0xa838('0x62')](_0x129afb,_0x32fc10[_0xa838('0x7b')][_0x396a32][_0xa838('0x2c')])&&_0x32fc10[_0xa838('0x7b')][_0x396a32][_0xa838('0x7d')]&&_0x32fc10[_0xa838('0x7b')][_0x396a32][_0xa838('0x7e')]&&_0x32fc10[_0xa838('0x7b')][_0x396a32]['foreignKey']){_0x298dd1[_0x32fc10['joins'][_0x396a32][_0xa838('0x2c')]](_0x32fc10[_0xa838('0x7b')][_0x396a32][_0xa838('0x7e')],null,util[_0xa838('0x78')](_0xa838('0x7f'),_0x32fc10[_0xa838('0x73')],_0x32fc10['joins'][_0x396a32][_0xa838('0x7d')],_0x32fc10['joins'][_0x396a32]['foreignTable'],_0x32fc10[_0xa838('0x7b')][_0x396a32][_0xa838('0x80')]));}}}if(_0x32fc10[_0xa838('0x81')]){_0x32fc10[_0xa838('0x81')]=JSON['parse'](_0x32fc10[_0xa838('0x81')]);_0x298dd1[_0xa838('0x38')](_0x1c6ced(_0x32fc10[_0xa838('0x81')][_0xa838('0x69')]));}_0x2cbae3=_0x298dd1[_0xa838('0x82')]();_0x298dd1['limit'](_0x5194f0);_0x298dd1[_0xa838('0x18')](0x0);logger[_0xa838('0x83')](_0xa838('0x84'),_0x298dd1[_0xa838('0x85')]());return dbH[_0xa838('0x86')]['query'](_0x298dd1[_0xa838('0x85')](),{'type':dbH['sequelize'][_0xa838('0x87')][_0xa838('0x88')]});}})[_0xa838('0x22')](respondWithResult(_0x1d9560,null))['catch'](handleError(_0x1d9560,null));};function runReport(_0x587e68,_0x459e2a,_0x86d35){var _0xe67b0a=_0x459e2a[_0xa838('0x26')];var _0x7740da=0xa;var _0xba040b=[_0xa838('0x52'),_0xa838('0x53'),_0xa838('0x54'),_0xa838('0x55')];var _0x2e050b={'SUM':_0xa838('0x56'),'COUNT':_0xa838('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xa838('0x59'),'MIN':_0xa838('0x5a'),'AVG':_0xa838('0x89'),'GROUP_CONCAT':_0xa838('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xa838('0x5d')};var _0x17412f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xa838('0x5e'),'HOUR':_0xa838('0x5f'),'ROUND':_0xa838('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2d400c=function(_0x314561){return!_[_0xa838('0x62')]([_0xa838('0x63'),_0xa838('0x64'),_0xa838('0x65'),_0xa838('0x66')],_0x314561);};var _0x550c08=function(_0x37df24){if(!_0x37df24||!_0x37df24[_0xa838('0x67')][_0xa838('0x34')]){return'';}for(var _0x3c25bf='(',_0x4959d2=0x0;_0x4959d2<_0x37df24['rules'][_0xa838('0x34')];_0x4959d2+=0x1){_0x4959d2>0x0&&(_0x3c25bf+='\x20'+_0x37df24['operator']+'\x20');_0x3c25bf+=_0x37df24[_0xa838('0x67')][_0x4959d2]['group']?_0x550c08(_0x37df24[_0xa838('0x67')][_0x4959d2][_0xa838('0x69')]):_0x37df24[_0xa838('0x67')][_0x4959d2][_0xa838('0x6a')]+'\x20'+_0x37df24[_0xa838('0x67')][_0x4959d2][_0xa838('0x6b')]+(_0x2d400c(_0x37df24[_0xa838('0x67')][_0x4959d2][_0xa838('0x6b')])?'\x20'+_0x37df24[_0xa838('0x67')][_0x4959d2]['value']:'');}return _0x3c25bf+')';};var _0x5d6bc4={'where':{'id':_0x587e68['id']}},_0xa1ddec,_0x1c3e49,_0x48f364,_0x210e2f,_0x533fc8;_0x5d6bc4=_['merge']({},_0x5d6bc4,_0x86d35);return db[_0xa838('0x3e')][_0xa838('0x45')](_0x5d6bc4)[_0xa838('0x22')](function(_0x460b09){if(_0x460b09){_0xa1ddec=_0x460b09;return _0x460b09[_0xa838('0x8a')]();}return null;})[_0xa838('0x22')](function(_0xbbf8c8){if(_0xbbf8c8){if(!_0xbbf8c8['length']){throw new db[(_0xa838('0x6d'))][(_0xa838('0x8b'))](_0xa838('0x6e'),0x193);}_0x1c3e49=_0xbbf8c8;return db[_0xa838('0x6f')][_0xa838('0x40')]({'raw':!![]});}return null;})[_0xa838('0x22')](function(_0x10a45e){if(_0x10a45e){_0x48f364=_['keyBy'](_0x10a45e,'id');var _0x36da60;var _0x22e7e6=squel['select']();_0x22e7e6[_0xa838('0x72')](_0xa1ddec[_0xa838('0x73')]);for(var _0x1a4c83=0x0;_0x1a4c83<_0x1c3e49[_0xa838('0x34')];_0x1a4c83+=0x1){_0x36da60=_0x1c3e49[_0x1a4c83]['MetricId']?_0x48f364[_0x1c3e49[_0x1a4c83]['MetricId']]['metric']:_0x1c3e49[_0x1a4c83]['field'];_0x36da60=_0x1c3e49[_0x1a4c83]['function']?_['replace'](_0x2e050b[_0x1c3e49[_0x1a4c83]['function']],'%s',_0x36da60):_0x36da60;_0x36da60=_0x1c3e49[_0x1a4c83][_0xa838('0x78')]?_['replace'](_0x17412f[_0x1c3e49[_0x1a4c83][_0xa838('0x78')]],'%s',_0x36da60):_0x36da60;if(_0x1c3e49[_0x1a4c83]['groupBy']){_0x22e7e6['group'](_0x36da60);}_0x1c3e49[_0x1a4c83]['orderBy']&&_0x22e7e6['order'](_0x36da60,_0x1c3e49[_0x1a4c83][_0xa838('0x79')]===_0xa838('0x8c')?![]:!![]);_0x22e7e6['field'](_0x36da60,_0x1c3e49[_0x1a4c83][_0xa838('0x7a')]||_0x36da60);}if(_0xa1ddec['joins']){_0xa1ddec['joins']=JSON[_0xa838('0x7c')](_0xa1ddec[_0xa838('0x7b')]);for(var _0x29d547=0x0;_0x29d547<_0xa1ddec[_0xa838('0x7b')][_0xa838('0x34')];_0x29d547+=0x1){if(_0xa1ddec[_0xa838('0x7b')][_0x29d547][_0xa838('0x2c')]&&_[_0xa838('0x62')](_0xba040b,_0xa1ddec[_0xa838('0x7b')][_0x29d547][_0xa838('0x2c')])&&_0xa1ddec['joins'][_0x29d547][_0xa838('0x7d')]&&_0xa1ddec['joins'][_0x29d547][_0xa838('0x7e')]&&_0xa1ddec[_0xa838('0x7b')][_0x29d547]['foreignKey']){_0x22e7e6[_0xa1ddec['joins'][_0x29d547]['type']](_0xa1ddec['joins'][_0x29d547][_0xa838('0x7e')],null,util['format'](_0xa838('0x7f'),_0xa1ddec[_0xa838('0x73')],_0xa1ddec['joins'][_0x29d547][_0xa838('0x7d')],_0xa1ddec['joins'][_0x29d547][_0xa838('0x7e')],_0xa1ddec[_0xa838('0x7b')][_0x29d547][_0xa838('0x80')]));}}}if(_0xa1ddec[_0xa838('0x81')]){_0xa1ddec[_0xa838('0x81')]=JSON[_0xa838('0x7c')](_0xa1ddec['conditions']);_0x22e7e6[_0xa838('0x38')](_0x550c08(_0xa1ddec[_0xa838('0x81')][_0xa838('0x69')]));}_0x533fc8=_0x22e7e6['clone']();_0x22e7e6['limit'](_0x7740da);_0x22e7e6[_0xa838('0x18')](0x0);return;}})[_0xa838('0x22')](function(){if(_0x459e2a[_0xa838('0x8d')]===_0xa838('0x8e')){return null;}var _0x11f6ba=_[_0xa838('0x3b')](_0x459e2a,{'name':_0x459e2a[_0xa838('0x8f')]||_0x459e2a[_0xa838('0x26')]||_0xa1ddec[_0xa838('0x26')],'basename':_0xe67b0a,'savename':util[_0xa838('0x78')](_0xa838('0x90'),_0x459e2a['name']||_0xa1ddec['name'],require('randomstring')['generate'](0x4),_0x459e2a['output']||_0xa838('0x91')),'reportId':_0xa1ddec['id'],'reportType':_0xa838('0x92')});return db[_0xa838('0x93')][_0xa838('0x46')](_0x11f6ba,{'raw':!![]});})[_0xa838('0x22')](function(_0x246aae){if(_0xa1ddec['table']===_0xa838('0x94')){_0x533fc8[_0xa838('0x38')](_0xa1ddec[_0xa838('0x73')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x459e2a[_0xa838('0x95')],_0x459e2a[_0xa838('0x96')]);}else{_0x533fc8[_0xa838('0x38')](_0xa1ddec[_0xa838('0x73')]+_0xa838('0x97'),_0x459e2a['startDate'],_0x459e2a[_0xa838('0x96')]);}if(_0x246aae){logger[_0xa838('0x98')](_0xa838('0x99'),_0x533fc8['toString']());require(_0xa838('0x9a'))[_0xa838('0x9b')](path[_0xa838('0x52')](__dirname,'../../components/export/',_0x246aae[_0xa838('0x8d')]),[_0x246aae['id'],_0x533fc8[_0xa838('0x85')](),path[_0xa838('0x52')](__dirname,_0xa838('0x9c'),_0x246aae[_0xa838('0x9d')]),_0xe67b0a]);return _0x246aae;}else{var _0x539a48=squel[_0xa838('0x71')]();_0x539a48[_0xa838('0x72')]('('+_0x533fc8[_0xa838('0x85')]()+')','countTable');_0x539a48['field'](_0xa838('0x9e'),_0xa838('0x1b'));_0x533fc8['limit'](_0x459e2a[_0xa838('0x19')]||_0x7740da);_0x533fc8[_0xa838('0x18')](_0x459e2a[_0xa838('0x18')]||0x0);return dbH['sequelize']['query'](_0x539a48[_0xa838('0x85')](),{'type':dbH['sequelize']['QueryTypes'][_0xa838('0x88')]})[_0xa838('0x22')](function(_0x2d389e){if(!_0x2d389e[_0xa838('0x34')]){_0x210e2f=0x0;}else{_0x210e2f=_0x2d389e[0x0][_0xa838('0x1b')]||0x0;}return dbH[_0xa838('0x86')][_0xa838('0x2f')](_0x533fc8[_0xa838('0x85')](),{'type':dbH[_0xa838('0x86')]['QueryTypes'][_0xa838('0x88')]});})[_0xa838('0x22')](function(_0x4bbc83){return{'rows':_0x4bbc83||[],'count':_0x210e2f};});}});}exports['run']=function(_0x59dad4,_0xa283e4){return runReport(_0x59dad4[_0xa838('0x43')],_0x59dad4[_0xa838('0x2f')],_0x59dad4[_0xa838('0x3d')])['then'](respondWithResult(_0xa283e4,null))[_0xa838('0x4f')](handleError(_0xa283e4,null));};exports[_0xa838('0x9f')]=runReport;exports['query']=function(_0x5c1351,_0x1fcce8){var _0x36c6ec=0xa;var _0xe2e32b=[_0xa838('0x52'),'left_join','right_join',_0xa838('0x55')];var _0x348c05={'SUM':_0xa838('0x56'),'COUNT':_0xa838('0x57'),'COUNT DISTINCT':_0xa838('0x58'),'MAX':_0xa838('0x59'),'MIN':_0xa838('0x5a'),'AVG':_0xa838('0x89'),'GROUP_CONCAT':_0xa838('0x5b'),'GROUP_CONCAT ASC':_0xa838('0x5c'),'GROUP_CONCAT DESC':_0xa838('0x5d')};var _0x5d8893={'SEC_TO_TIME':_0xa838('0xa0'),'DATE':_0xa838('0x5e'),'HOUR':_0xa838('0x5f'),'ROUND':_0xa838('0x60'),'UNIX_TIMESTAMP':_0xa838('0x61')};var _0x34ecfd=function(_0x3081ee){return!_[_0xa838('0x62')]([_0xa838('0x63'),_0xa838('0x64'),_0xa838('0x65'),_0xa838('0x66')],_0x3081ee);};var _0xc40fba=function(_0x3c6b89){if(!_0x3c6b89||!_0x3c6b89['rules'][_0xa838('0x34')]){return'';}for(var _0x2f1abc='(',_0x2ada56=0x0;_0x2ada56<_0x3c6b89['rules'][_0xa838('0x34')];_0x2ada56+=0x1){_0x2ada56>0x0&&(_0x2f1abc+='\x20'+_0x3c6b89['operator']+'\x20');_0x2f1abc+=_0x3c6b89['rules'][_0x2ada56]['group']?_0xc40fba(_0x3c6b89[_0xa838('0x67')][_0x2ada56]['group']):_0x3c6b89[_0xa838('0x67')][_0x2ada56]['field']+'\x20'+_0x3c6b89[_0xa838('0x67')][_0x2ada56][_0xa838('0x6b')]+(_0x34ecfd(_0x3c6b89[_0xa838('0x67')][_0x2ada56]['condition'])?'\x20'+_0x3c6b89['rules'][_0x2ada56][_0xa838('0x6c')]:'');}return _0x2f1abc+')';};var _0x2ff7f6={'where':{'id':_0x5c1351[_0xa838('0x43')]['id']}},_0x3dc755,_0x17089b,_0x4379f8,_0x4137a6,_0x2750e4;_0x2ff7f6=_['merge']({},_0x2ff7f6,_0x5c1351[_0xa838('0x3d')]);return db['AnalyticCustomReport'][_0xa838('0x45')](_0x2ff7f6)[_0xa838('0x22')](function(_0x4fe118){if(_0x4fe118){_0x3dc755=_0x4fe118;return _0x4fe118[_0xa838('0x8a')]();}return null;})[_0xa838('0x22')](function(_0x56d1e1){if(_0x56d1e1){if(!_0x56d1e1[_0xa838('0x34')]){throw new db[(_0xa838('0x6d'))][(_0xa838('0x8b'))](_0xa838('0x6e'),0x193);}_0x17089b=_0x56d1e1;return db[_0xa838('0x6f')][_0xa838('0x40')]({'raw':!![]});}return null;})[_0xa838('0x22')](function(_0x4f826e){if(_0x4f826e){_0x4379f8=_['keyBy'](_0x4f826e,'id');var _0x2d323f;var _0x51f6ea=squel['select']();_0x51f6ea[_0xa838('0x72')](_0x3dc755[_0xa838('0x73')]);for(var _0x197bfa=0x0;_0x197bfa<_0x17089b[_0xa838('0x34')];_0x197bfa+=0x1){_0x2d323f=_0x17089b[_0x197bfa][_0xa838('0x74')]?_0x4379f8[_0x17089b[_0x197bfa][_0xa838('0x74')]]['metric']:_0x17089b[_0x197bfa][_0xa838('0x6a')];_0x2d323f=_0x17089b[_0x197bfa][_0xa838('0x76')]?_[_0xa838('0x77')](_0x348c05[_0x17089b[_0x197bfa]['function']],'%s',_0x2d323f):_0x2d323f;_0x2d323f=_0x17089b[_0x197bfa][_0xa838('0x78')]?_[_0xa838('0x77')](_0x5d8893[_0x17089b[_0x197bfa][_0xa838('0x78')]],'%s',_0x2d323f):_0x2d323f;if(_0x17089b[_0x197bfa]['groupBy']){_0x51f6ea[_0xa838('0x69')](_0x2d323f);}_0x17089b[_0x197bfa][_0xa838('0x79')]&&_0x51f6ea[_0xa838('0x36')](_0x2d323f,_0x17089b[_0x197bfa][_0xa838('0x79')]==='DESC'?![]:!![]);_0x51f6ea[_0xa838('0x6a')](_0x2d323f,_0x17089b[_0x197bfa][_0xa838('0x7a')]||_0x2d323f);}if(_0x3dc755['joins']){_0x3dc755[_0xa838('0x7b')]=JSON[_0xa838('0x7c')](_0x3dc755[_0xa838('0x7b')]);for(var _0x46051b=0x0;_0x46051b<_0x3dc755[_0xa838('0x7b')][_0xa838('0x34')];_0x46051b+=0x1){if(_0x3dc755['joins'][_0x46051b][_0xa838('0x2c')]&&_[_0xa838('0x62')](_0xe2e32b,_0x3dc755['joins'][_0x46051b][_0xa838('0x2c')])&&_0x3dc755['joins'][_0x46051b][_0xa838('0x7d')]&&_0x3dc755[_0xa838('0x7b')][_0x46051b][_0xa838('0x7e')]&&_0x3dc755[_0xa838('0x7b')][_0x46051b][_0xa838('0x80')]){_0x51f6ea[_0x3dc755[_0xa838('0x7b')][_0x46051b][_0xa838('0x2c')]](_0x3dc755[_0xa838('0x7b')][_0x46051b][_0xa838('0x7e')],null,util[_0xa838('0x78')](_0xa838('0x7f'),_0x3dc755[_0xa838('0x73')],_0x3dc755[_0xa838('0x7b')][_0x46051b]['parentKey'],_0x3dc755[_0xa838('0x7b')][_0x46051b][_0xa838('0x7e')],_0x3dc755[_0xa838('0x7b')][_0x46051b][_0xa838('0x80')]));}}}if(_0x3dc755[_0xa838('0x81')]){_0x3dc755[_0xa838('0x81')]=JSON['parse'](_0x3dc755[_0xa838('0x81')]);_0x51f6ea[_0xa838('0x38')](_0xc40fba(_0x3dc755[_0xa838('0x81')][_0xa838('0x69')]));}_0x2750e4=_0x51f6ea[_0xa838('0x82')]();_0x51f6ea[_0xa838('0x19')](_0x36c6ec);_0x51f6ea[_0xa838('0x18')](0x0);logger['debug'](_0xa838('0x84'),_0x51f6ea[_0xa838('0x85')]());return dbH['sequelize'][_0xa838('0x2f')](_0x51f6ea[_0xa838('0x85')](),{'type':dbH[_0xa838('0x86')][_0xa838('0x87')][_0xa838('0x88')]});}})[_0xa838('0x22')](function(){return{'sql':_0x2750e4['toString']()};})['then'](respondWithResult(_0x1fcce8,null))[_0xa838('0x4f')](handleError(_0x1fcce8,null));};
\ No newline at end of file
+var _0x7ad6=['apply','reject','save','then','destroy','get','CustomReports','UserProfileResource','error','stack','send','map','AnalyticCustomReport','rawAttributes','type','key','name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','left_join','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','replace','function','format','groupBy','orderBy','order','DESC','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','join','cross_join','COUNT(%s)','DATE(%s)','IS\x20NULL','IS\x20EMPTY','condition','value','Please\x20insert\x20at\x20least\x20one\x20field','parse','output','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','eml-format','rimraf','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x7ad6,0x87));var _0x67ad=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x7ad6[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x67ad('0x0'));var rimraf=require(_0x67ad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x67ad('0x2'));var rp=require(_0x67ad('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x67ad('0x4'));var path=require(_0x67ad('0x5'));var sox=require(_0x67ad('0x6'));var csv=require(_0x67ad('0x7'));var ejs=require(_0x67ad('0x8'));var fs=require('fs');var fs_extra=require(_0x67ad('0x9'));var _=require('lodash');var squel=require(_0x67ad('0xa'));var crypto=require('crypto');var jsforce=require(_0x67ad('0xb'));var deskjs=require(_0x67ad('0xc'));var toCsv=require(_0x67ad('0x7'));var querystring=require(_0x67ad('0xd'));var Papa=require(_0x67ad('0xe'));var Redis=require('ioredis');var authService=require(_0x67ad('0xf'));var qs=require(_0x67ad('0x10'));var as=require(_0x67ad('0x11'));var hardwareService=require(_0x67ad('0x12'));var logger=require(_0x67ad('0x13'))(_0x67ad('0x14'));var utils=require('../../config/utils');var config=require(_0x67ad('0x15'));var licenseUtil=require(_0x67ad('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0x67ad('0x17'))['dbH'];function respondWithStatusCode(_0x5c1e4d,_0x59c681){_0x59c681=_0x59c681||0xcc;return function(_0x4cb3b8){if(_0x4cb3b8){return _0x5c1e4d[_0x67ad('0x18')](_0x59c681);}return _0x5c1e4d[_0x67ad('0x19')](_0x59c681)[_0x67ad('0x1a')]();};}function respondWithResult(_0x44d62c,_0x52fe52){_0x52fe52=_0x52fe52||0xc8;return function(_0x2fac05){if(_0x2fac05){return _0x44d62c[_0x67ad('0x19')](_0x52fe52)[_0x67ad('0x1b')](_0x2fac05);}};}function respondWithFilteredResult(_0x5c788d,_0x13f898){return function(_0x137898){if(_0x137898){var _0x1607b1=typeof _0x13f898[_0x67ad('0x1c')]===_0x67ad('0x1d')&&typeof _0x13f898[_0x67ad('0x1e')]===_0x67ad('0x1d');var _0x9ae8bc=_0x137898[_0x67ad('0x1f')];var _0x4421f8=_0x1607b1?0x0:_0x13f898['offset'];var _0x25017b=_0x1607b1?_0x137898[_0x67ad('0x1f')]:_0x13f898[_0x67ad('0x1c')]+_0x13f898[_0x67ad('0x1e')];var _0x152bf5;if(_0x25017b>=_0x9ae8bc){_0x25017b=_0x9ae8bc;_0x152bf5=0xc8;}else{_0x152bf5=0xce;}_0x5c788d[_0x67ad('0x19')](_0x152bf5);return _0x5c788d['set'](_0x67ad('0x20'),_0x4421f8+'-'+_0x25017b+'/'+_0x9ae8bc)[_0x67ad('0x1b')](_0x137898);}return null;};}function patchUpdates(_0x461f4b){return function(_0x40ca72){try{jsonpatch[_0x67ad('0x21')](_0x40ca72,_0x461f4b,!![]);}catch(_0x4fae4c){return BPromise[_0x67ad('0x22')](_0x4fae4c);}return _0x40ca72[_0x67ad('0x23')]();};}function saveUpdates(_0xa1e13,_0x5db539){return function(_0x3123bc){if(_0x3123bc){return _0x3123bc['update'](_0xa1e13)[_0x67ad('0x24')](function(_0x2986ce){return _0x2986ce;});}return null;};}function removeEntity(_0x46e430,_0x33dac9){return function(_0x25cc35){if(_0x25cc35){return _0x25cc35[_0x67ad('0x25')]()['then'](function(){var _0x1e8cf=_0x25cc35[_0x67ad('0x26')]({'plain':!![]});var _0x514242=_0x67ad('0x27');return db[_0x67ad('0x28')][_0x67ad('0x25')]({'where':{'type':_0x514242,'resourceId':_0x1e8cf['id']}})[_0x67ad('0x24')](function(){return _0x25cc35;});})['then'](function(){_0x46e430['status'](0xcc)[_0x67ad('0x1a')]();});}};}function handleEntityNotFound(_0x4c5949,_0x1d886e){return function(_0x45d6ee){if(!_0x45d6ee){_0x4c5949[_0x67ad('0x18')](0x194);}return _0x45d6ee;};}function handleError(_0x10552f,_0x5d672c){_0x5d672c=_0x5d672c||0x1f4;return function(_0x266a58){logger[_0x67ad('0x29')](_0x266a58[_0x67ad('0x2a')]);if(_0x266a58['name']){delete _0x266a58['name'];}_0x10552f['status'](_0x5d672c)[_0x67ad('0x2b')](_0x266a58);};}exports['index']=function(_0x17f362,_0x156be9){var _0x3a49d8={},_0x546fd8={},_0x37984e={'count':0x0,'rows':[]};var _0x46267e=_[_0x67ad('0x2c')](db[_0x67ad('0x2d')][_0x67ad('0x2e')],function(_0x1df735){return{'name':_0x1df735['fieldName'],'type':_0x1df735[_0x67ad('0x2f')][_0x67ad('0x30')]};});_0x546fd8['model']=_[_0x67ad('0x2c')](_0x46267e,_0x67ad('0x31'));_0x546fd8['query']=_['keys'](_0x17f362[_0x67ad('0x32')]);_0x546fd8[_0x67ad('0x33')]=_[_0x67ad('0x34')](_0x546fd8[_0x67ad('0x35')],_0x546fd8[_0x67ad('0x32')]);_0x3a49d8[_0x67ad('0x36')]=_[_0x67ad('0x34')](_0x546fd8[_0x67ad('0x35')],qs[_0x67ad('0x37')](_0x17f362['query'][_0x67ad('0x37')]));_0x3a49d8[_0x67ad('0x36')]=_0x3a49d8[_0x67ad('0x36')][_0x67ad('0x38')]?_0x3a49d8[_0x67ad('0x36')]:_0x546fd8[_0x67ad('0x35')];if(!_0x17f362[_0x67ad('0x32')][_0x67ad('0x39')](_0x67ad('0x3a'))){_0x3a49d8[_0x67ad('0x1e')]=qs[_0x67ad('0x1e')](_0x17f362[_0x67ad('0x32')]['limit']);_0x3a49d8['offset']=qs[_0x67ad('0x1c')](_0x17f362[_0x67ad('0x32')][_0x67ad('0x1c')]);}_0x3a49d8['order']=qs[_0x67ad('0x3b')](_0x17f362[_0x67ad('0x32')][_0x67ad('0x3b')]);_0x3a49d8['where']=qs[_0x67ad('0x33')](_[_0x67ad('0x3c')](_0x17f362[_0x67ad('0x32')],_0x546fd8['filters']),_0x46267e);if(_0x17f362[_0x67ad('0x32')][_0x67ad('0x3d')]){_0x3a49d8['where']=_['merge'](_0x3a49d8[_0x67ad('0x3e')],{'$or':_[_0x67ad('0x2c')](_0x46267e,function(_0x5e1dea){if(_0x5e1dea['type']!==_0x67ad('0x3f')){var _0x509e2b={};_0x509e2b[_0x5e1dea[_0x67ad('0x31')]]={'$like':'%'+_0x17f362[_0x67ad('0x32')][_0x67ad('0x3d')]+'%'};return _0x509e2b;}})});}_0x3a49d8=_[_0x67ad('0x40')]({},_0x3a49d8,_0x17f362['options']);var _0x28a343={'where':_0x3a49d8['where']};return db[_0x67ad('0x2d')][_0x67ad('0x1f')](_0x28a343)[_0x67ad('0x24')](function(_0xb8f0cd){_0x37984e[_0x67ad('0x1f')]=_0xb8f0cd;if(_0x17f362[_0x67ad('0x32')][_0x67ad('0x41')]){_0x3a49d8[_0x67ad('0x42')]=[{'all':!![]}];}return db[_0x67ad('0x2d')][_0x67ad('0x43')](_0x3a49d8);})['then'](function(_0x376281){_0x37984e[_0x67ad('0x44')]=_0x376281;return _0x37984e;})[_0x67ad('0x24')](respondWithFilteredResult(_0x156be9,_0x3a49d8))[_0x67ad('0x45')](handleError(_0x156be9,null));};exports[_0x67ad('0x46')]=function(_0x109ccb,_0x4833e3){var _0x257087={'raw':![],'where':{'id':_0x109ccb[_0x67ad('0x47')]['id']}},_0x107ef3={};_0x107ef3[_0x67ad('0x35')]=_[_0x67ad('0x48')](db['AnalyticCustomReport'][_0x67ad('0x2e')]);_0x107ef3[_0x67ad('0x32')]=_[_0x67ad('0x48')](_0x109ccb[_0x67ad('0x32')]);_0x107ef3['filters']=_[_0x67ad('0x34')](_0x107ef3[_0x67ad('0x35')],_0x107ef3['query']);_0x257087[_0x67ad('0x36')]=_['intersection'](_0x107ef3[_0x67ad('0x35')],qs[_0x67ad('0x37')](_0x109ccb[_0x67ad('0x32')][_0x67ad('0x37')]));_0x257087[_0x67ad('0x36')]=_0x257087[_0x67ad('0x36')][_0x67ad('0x38')]?_0x257087[_0x67ad('0x36')]:_0x107ef3[_0x67ad('0x35')];if(_0x109ccb[_0x67ad('0x32')]['includeAll']){_0x257087[_0x67ad('0x42')]=[{'all':!![]}];}_0x257087=_['merge']({},_0x257087,_0x109ccb[_0x67ad('0x49')]);return db[_0x67ad('0x2d')][_0x67ad('0x4a')](_0x257087)[_0x67ad('0x24')](handleEntityNotFound(_0x4833e3,null))[_0x67ad('0x24')](respondWithResult(_0x4833e3,null))[_0x67ad('0x45')](handleError(_0x4833e3,null));};exports[_0x67ad('0x4b')]=function(_0x22d90c,_0x54cd53){return db[_0x67ad('0x2d')][_0x67ad('0x4b')](_0x22d90c['body'],{})[_0x67ad('0x24')](function(_0x1cc999){var _0x4d6306=_0x22d90c[_0x67ad('0x4c')][_0x67ad('0x26')]({'plain':!![]});if(!_0x4d6306)throw new Error(_0x67ad('0x4d'));if(_0x4d6306[_0x67ad('0x4e')]===_0x67ad('0x4c')){var _0xea9158=_0x1cc999[_0x67ad('0x26')]({'plain':!![]});var _0x334082=_0x67ad('0x4f');return db[_0x67ad('0x50')]['find']({'where':{'name':_0x334082,'userProfileId':_0x4d6306[_0x67ad('0x51')]},'raw':!![]})[_0x67ad('0x24')](function(_0x9f35a0){if(_0x9f35a0&&_0x9f35a0['autoAssociation']===0x0){return db[_0x67ad('0x28')][_0x67ad('0x4b')]({'name':_0xea9158[_0x67ad('0x31')],'resourceId':_0xea9158['id'],'type':'CustomReports','sectionId':_0x9f35a0['id']},{})[_0x67ad('0x24')](function(){return _0x1cc999;});}else{return _0x1cc999;}})[_0x67ad('0x45')](function(_0x16202b){logger['error'](_0x67ad('0x52'),_0x16202b);throw _0x16202b;});}return _0x1cc999;})['then'](respondWithResult(_0x54cd53,0xc9))['catch'](handleError(_0x54cd53,null));};exports[_0x67ad('0x53')]=function(_0x21d096,_0x4a6e92){if(_0x21d096[_0x67ad('0x54')]['id']){delete _0x21d096['body']['id'];}return db[_0x67ad('0x2d')]['find']({'where':{'id':_0x21d096['params']['id']}})[_0x67ad('0x24')](handleEntityNotFound(_0x4a6e92,null))[_0x67ad('0x24')](saveUpdates(_0x21d096[_0x67ad('0x54')],null))['then'](respondWithResult(_0x4a6e92,null))[_0x67ad('0x45')](handleError(_0x4a6e92,null));};exports[_0x67ad('0x25')]=function(_0x29f980,_0x34512c){return db[_0x67ad('0x2d')][_0x67ad('0x4a')]({'where':{'id':_0x29f980[_0x67ad('0x47')]['id']}})[_0x67ad('0x24')](handleEntityNotFound(_0x34512c,null))[_0x67ad('0x24')](removeEntity(_0x34512c,null))[_0x67ad('0x45')](handleError(_0x34512c,null));};exports['preview']=function(_0x4ae8ed,_0x3ea737){var _0x57a667=0xa;var _0xf5b561=['join',_0x67ad('0x55'),_0x67ad('0x56'),'cross_join'];var _0x10bd0e={'SUM':_0x67ad('0x57'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x67ad('0x58'),'MAX':_0x67ad('0x59'),'MIN':_0x67ad('0x5a'),'AVG':_0x67ad('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xb710e2={'SEC_TO_TIME':_0x67ad('0x5c'),'DATE':'DATE(%s)','HOUR':_0x67ad('0x5d'),'ROUND':_0x67ad('0x5e'),'UNIX_TIMESTAMP':_0x67ad('0x5f')};var _0x40336e=function(_0x44473f){return!_[_0x67ad('0x60')](['IS\x20NULL',_0x67ad('0x61'),'IS\x20EMPTY',_0x67ad('0x62')],_0x44473f);};var _0x2a9607=function(_0x31d5b1){if(!_0x31d5b1||!_0x31d5b1[_0x67ad('0x63')][_0x67ad('0x38')]){return'';}for(var _0x499599='(',_0x50690c=0x0;_0x50690c<_0x31d5b1[_0x67ad('0x63')][_0x67ad('0x38')];_0x50690c+=0x1){_0x50690c>0x0&&(_0x499599+='\x20'+_0x31d5b1[_0x67ad('0x64')]+'\x20');_0x499599+=_0x31d5b1[_0x67ad('0x63')][_0x50690c][_0x67ad('0x65')]?_0x2a9607(_0x31d5b1['rules'][_0x50690c]['group']):_0x31d5b1['rules'][_0x50690c][_0x67ad('0x66')]+'\x20'+_0x31d5b1[_0x67ad('0x63')][_0x50690c]['condition']+(_0x40336e(_0x31d5b1[_0x67ad('0x63')][_0x50690c]['condition'])?'\x20'+_0x31d5b1[_0x67ad('0x63')][_0x50690c]['value']:'');}return _0x499599+')';};var _0x5a6f24={'where':{'id':_0x4ae8ed[_0x67ad('0x47')]['id']}},_0xa51e5f,_0x50d114,_0x15875a,_0x52fb6b,_0x3c05fe;_0x5a6f24=_['merge']({},_0x5a6f24,_0x4ae8ed[_0x67ad('0x49')]);return db['AnalyticCustomReport'][_0x67ad('0x4a')](_0x5a6f24)[_0x67ad('0x24')](function(_0x395cb2){if(_0x395cb2){_0xa51e5f=_0x395cb2;return _0x395cb2[_0x67ad('0x67')]();}return null;})[_0x67ad('0x24')](function(_0x190bd6){if(_0x190bd6){if(!_0x190bd6[_0x67ad('0x38')]){throw new db[(_0x67ad('0x68'))][(_0x67ad('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x50d114=_0x190bd6;return db[_0x67ad('0x6a')][_0x67ad('0x43')]({'raw':!![]});}return null;})['then'](function(_0x7bd6f7){if(_0x7bd6f7){_0x15875a=_[_0x67ad('0x6b')](_0x7bd6f7,'id');var _0x3f7dde;var _0x7ae296=squel[_0x67ad('0x6c')]();_0x7ae296[_0x67ad('0x6d')](_0xa51e5f[_0x67ad('0x6e')]);for(var _0x14ccec=0x0;_0x14ccec<_0x50d114['length'];_0x14ccec+=0x1){_0x3f7dde=_0x50d114[_0x14ccec][_0x67ad('0x6f')]?_0x15875a[_0x50d114[_0x14ccec]['MetricId']][_0x67ad('0x70')]:_0x50d114[_0x14ccec]['field'];_0x3f7dde=_0x50d114[_0x14ccec]['function']?_[_0x67ad('0x71')](_0x10bd0e[_0x50d114[_0x14ccec][_0x67ad('0x72')]],'%s',_0x3f7dde):_0x3f7dde;_0x3f7dde=_0x50d114[_0x14ccec]['format']?_[_0x67ad('0x71')](_0xb710e2[_0x50d114[_0x14ccec][_0x67ad('0x73')]],'%s',_0x3f7dde):_0x3f7dde;if(_0x50d114[_0x14ccec][_0x67ad('0x74')]){_0x7ae296[_0x67ad('0x65')](_0x3f7dde);}_0x50d114[_0x14ccec][_0x67ad('0x75')]&&_0x7ae296[_0x67ad('0x76')](_0x3f7dde,_0x50d114[_0x14ccec][_0x67ad('0x75')]===_0x67ad('0x77')?![]:!![]);_0x7ae296[_0x67ad('0x66')](_0x3f7dde,_0x50d114[_0x14ccec][_0x67ad('0x78')]||_0x3f7dde);}if(_0xa51e5f[_0x67ad('0x79')]){_0xa51e5f['joins']=JSON['parse'](_0xa51e5f['joins']);for(var _0x1753ef=0x0;_0x1753ef<_0xa51e5f['joins'][_0x67ad('0x38')];_0x1753ef+=0x1){if(_0xa51e5f['joins'][_0x1753ef][_0x67ad('0x2f')]&&_[_0x67ad('0x60')](_0xf5b561,_0xa51e5f['joins'][_0x1753ef][_0x67ad('0x2f')])&&_0xa51e5f[_0x67ad('0x79')][_0x1753ef][_0x67ad('0x7a')]&&_0xa51e5f[_0x67ad('0x79')][_0x1753ef][_0x67ad('0x7b')]&&_0xa51e5f[_0x67ad('0x79')][_0x1753ef][_0x67ad('0x7c')]){_0x7ae296[_0xa51e5f[_0x67ad('0x79')][_0x1753ef]['type']](_0xa51e5f['joins'][_0x1753ef][_0x67ad('0x7b')],null,util[_0x67ad('0x73')](_0x67ad('0x7d'),_0xa51e5f[_0x67ad('0x6e')],_0xa51e5f[_0x67ad('0x79')][_0x1753ef][_0x67ad('0x7a')],_0xa51e5f[_0x67ad('0x79')][_0x1753ef][_0x67ad('0x7b')],_0xa51e5f[_0x67ad('0x79')][_0x1753ef][_0x67ad('0x7c')]));}}}if(_0xa51e5f[_0x67ad('0x7e')]){_0xa51e5f['conditions']=JSON['parse'](_0xa51e5f[_0x67ad('0x7e')]);_0x7ae296[_0x67ad('0x3e')](_0x2a9607(_0xa51e5f[_0x67ad('0x7e')][_0x67ad('0x65')]));}_0x3c05fe=_0x7ae296[_0x67ad('0x7f')]();_0x7ae296[_0x67ad('0x1e')](_0x57a667);_0x7ae296['offset'](0x0);logger[_0x67ad('0x80')](_0x67ad('0x81'),_0x7ae296['toString']());return dbH[_0x67ad('0x82')][_0x67ad('0x32')](_0x7ae296['toString'](),{'type':dbH[_0x67ad('0x82')][_0x67ad('0x83')][_0x67ad('0x84')]});}})['then'](respondWithResult(_0x3ea737,null))[_0x67ad('0x45')](handleError(_0x3ea737,null));};function runReport(_0x128fb7,_0x4c171d,_0x137591){var _0x395820=_0x4c171d[_0x67ad('0x31')];var _0x415c59=0xa;var _0x1fb8cf=[_0x67ad('0x85'),_0x67ad('0x55'),_0x67ad('0x56'),_0x67ad('0x86')];var _0x12dcf7={'SUM':_0x67ad('0x57'),'COUNT':_0x67ad('0x87'),'COUNT DISTINCT':_0x67ad('0x58'),'MAX':'MAX(%s)','MIN':_0x67ad('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x291168={'SEC_TO_TIME':_0x67ad('0x5c'),'DATE':_0x67ad('0x88'),'HOUR':'HOUR(%s)','ROUND':_0x67ad('0x5e'),'UNIX_TIMESTAMP':_0x67ad('0x5f')};var _0x5e1f28=function(_0xc605a7){return!_['includes']([_0x67ad('0x89'),_0x67ad('0x61'),_0x67ad('0x8a'),_0x67ad('0x62')],_0xc605a7);};var _0x397578=function(_0x587274){if(!_0x587274||!_0x587274[_0x67ad('0x63')][_0x67ad('0x38')]){return'';}for(var _0x1eded6='(',_0x47c91d=0x0;_0x47c91d<_0x587274[_0x67ad('0x63')]['length'];_0x47c91d+=0x1){_0x47c91d>0x0&&(_0x1eded6+='\x20'+_0x587274[_0x67ad('0x64')]+'\x20');_0x1eded6+=_0x587274[_0x67ad('0x63')][_0x47c91d]['group']?_0x397578(_0x587274[_0x67ad('0x63')][_0x47c91d]['group']):_0x587274['rules'][_0x47c91d][_0x67ad('0x66')]+'\x20'+_0x587274[_0x67ad('0x63')][_0x47c91d][_0x67ad('0x8b')]+(_0x5e1f28(_0x587274[_0x67ad('0x63')][_0x47c91d][_0x67ad('0x8b')])?'\x20'+_0x587274['rules'][_0x47c91d][_0x67ad('0x8c')]:'');}return _0x1eded6+')';};var _0x571e5a={'where':{'id':_0x128fb7['id']}},_0x237d53,_0x5f100f,_0x1ad01f,_0x4ddf4d,_0x4cc3cf;_0x571e5a=_[_0x67ad('0x40')]({},_0x571e5a,_0x137591);return db[_0x67ad('0x2d')]['find'](_0x571e5a)[_0x67ad('0x24')](function(_0x15fb70){if(_0x15fb70){_0x237d53=_0x15fb70;return _0x15fb70[_0x67ad('0x67')]();}return null;})['then'](function(_0x2d2a42){if(_0x2d2a42){if(!_0x2d2a42[_0x67ad('0x38')]){throw new db[(_0x67ad('0x68'))]['ValidationErrorItem'](_0x67ad('0x8d'),0x193);}_0x5f100f=_0x2d2a42;return db[_0x67ad('0x6a')][_0x67ad('0x43')]({'raw':!![]});}return null;})[_0x67ad('0x24')](function(_0x838839){if(_0x838839){_0x1ad01f=_['keyBy'](_0x838839,'id');var _0x4dfe99;var _0x567e0c=squel['select']();_0x567e0c[_0x67ad('0x6d')](_0x237d53[_0x67ad('0x6e')]);for(var _0x59eca9=0x0;_0x59eca9<_0x5f100f[_0x67ad('0x38')];_0x59eca9+=0x1){_0x4dfe99=_0x5f100f[_0x59eca9][_0x67ad('0x6f')]?_0x1ad01f[_0x5f100f[_0x59eca9][_0x67ad('0x6f')]][_0x67ad('0x70')]:_0x5f100f[_0x59eca9][_0x67ad('0x66')];_0x4dfe99=_0x5f100f[_0x59eca9][_0x67ad('0x72')]?_[_0x67ad('0x71')](_0x12dcf7[_0x5f100f[_0x59eca9][_0x67ad('0x72')]],'%s',_0x4dfe99):_0x4dfe99;_0x4dfe99=_0x5f100f[_0x59eca9][_0x67ad('0x73')]?_['replace'](_0x291168[_0x5f100f[_0x59eca9][_0x67ad('0x73')]],'%s',_0x4dfe99):_0x4dfe99;if(_0x5f100f[_0x59eca9]['groupBy']){_0x567e0c[_0x67ad('0x65')](_0x4dfe99);}_0x5f100f[_0x59eca9]['orderBy']&&_0x567e0c[_0x67ad('0x76')](_0x4dfe99,_0x5f100f[_0x59eca9][_0x67ad('0x75')]===_0x67ad('0x77')?![]:!![]);_0x567e0c[_0x67ad('0x66')](_0x4dfe99,_0x5f100f[_0x59eca9][_0x67ad('0x78')]||_0x4dfe99);}if(_0x237d53[_0x67ad('0x79')]){_0x237d53[_0x67ad('0x79')]=JSON['parse'](_0x237d53[_0x67ad('0x79')]);for(var _0x44450a=0x0;_0x44450a<_0x237d53[_0x67ad('0x79')][_0x67ad('0x38')];_0x44450a+=0x1){if(_0x237d53['joins'][_0x44450a][_0x67ad('0x2f')]&&_[_0x67ad('0x60')](_0x1fb8cf,_0x237d53['joins'][_0x44450a][_0x67ad('0x2f')])&&_0x237d53[_0x67ad('0x79')][_0x44450a][_0x67ad('0x7a')]&&_0x237d53[_0x67ad('0x79')][_0x44450a][_0x67ad('0x7b')]&&_0x237d53[_0x67ad('0x79')][_0x44450a]['foreignKey']){_0x567e0c[_0x237d53[_0x67ad('0x79')][_0x44450a][_0x67ad('0x2f')]](_0x237d53[_0x67ad('0x79')][_0x44450a][_0x67ad('0x7b')],null,util[_0x67ad('0x73')]('%s.%s\x20=\x20%s.%s',_0x237d53[_0x67ad('0x6e')],_0x237d53['joins'][_0x44450a][_0x67ad('0x7a')],_0x237d53[_0x67ad('0x79')][_0x44450a][_0x67ad('0x7b')],_0x237d53[_0x67ad('0x79')][_0x44450a][_0x67ad('0x7c')]));}}}if(_0x237d53[_0x67ad('0x7e')]){_0x237d53[_0x67ad('0x7e')]=JSON[_0x67ad('0x8e')](_0x237d53[_0x67ad('0x7e')]);_0x567e0c[_0x67ad('0x3e')](_0x397578(_0x237d53[_0x67ad('0x7e')][_0x67ad('0x65')]));}_0x4cc3cf=_0x567e0c[_0x67ad('0x7f')]();_0x567e0c[_0x67ad('0x1e')](_0x415c59);_0x567e0c['offset'](0x0);return;}})['then'](function(){if(_0x4c171d[_0x67ad('0x8f')]==='web'){return null;}var _0x2fab60=_[_0x67ad('0x40')](_0x4c171d,{'name':_0x4c171d['fullPath']||_0x4c171d[_0x67ad('0x31')]||_0x237d53['name'],'basename':_0x395820,'savename':util[_0x67ad('0x73')](_0x67ad('0x90'),_0x4c171d[_0x67ad('0x31')]||_0x237d53[_0x67ad('0x31')],require(_0x67ad('0x91'))[_0x67ad('0x92')](0x4),_0x4c171d[_0x67ad('0x8f')]||_0x67ad('0x93')),'reportId':_0x237d53['id'],'reportType':_0x67ad('0x94')});return db[_0x67ad('0x95')][_0x67ad('0x4b')](_0x2fab60,{'raw':!![]});})[_0x67ad('0x24')](function(_0x33d532){if(_0x237d53[_0x67ad('0x6e')]===_0x67ad('0x96')){_0x4cc3cf[_0x67ad('0x3e')](_0x237d53[_0x67ad('0x6e')]+_0x67ad('0x97'),_0x4c171d['startDate'],_0x4c171d['endDate']);}else{_0x4cc3cf[_0x67ad('0x3e')](_0x237d53[_0x67ad('0x6e')]+_0x67ad('0x98'),_0x4c171d[_0x67ad('0x99')],_0x4c171d[_0x67ad('0x9a')]);}if(_0x33d532){logger['info'](_0x67ad('0x9b'),_0x4cc3cf[_0x67ad('0x9c')]());require(_0x67ad('0x9d'))[_0x67ad('0x9e')](path[_0x67ad('0x85')](__dirname,_0x67ad('0x9f'),_0x33d532[_0x67ad('0x8f')]),[_0x33d532['id'],_0x4cc3cf['toString'](),path[_0x67ad('0x85')](__dirname,_0x67ad('0xa0'),_0x33d532['savename']),_0x395820]);return _0x33d532;}else{var _0xbfc68d=squel[_0x67ad('0x6c')]();_0xbfc68d[_0x67ad('0x6d')]('('+_0x4cc3cf[_0x67ad('0x9c')]()+')',_0x67ad('0xa1'));_0xbfc68d[_0x67ad('0x66')](_0x67ad('0xa2'),_0x67ad('0x1f'));_0x4cc3cf[_0x67ad('0x1e')](_0x4c171d['limit']||_0x415c59);_0x4cc3cf[_0x67ad('0x1c')](_0x4c171d[_0x67ad('0x1c')]||0x0);return dbH['sequelize'][_0x67ad('0x32')](_0xbfc68d[_0x67ad('0x9c')](),{'type':dbH[_0x67ad('0x82')][_0x67ad('0x83')][_0x67ad('0x84')]})['then'](function(_0x4fc368){if(!_0x4fc368[_0x67ad('0x38')]){_0x4ddf4d=0x0;}else{_0x4ddf4d=_0x4fc368[0x0][_0x67ad('0x1f')]||0x0;}return dbH[_0x67ad('0x82')][_0x67ad('0x32')](_0x4cc3cf[_0x67ad('0x9c')](),{'type':dbH[_0x67ad('0x82')][_0x67ad('0x83')]['SELECT']});})[_0x67ad('0x24')](function(_0x3d4a5f){return{'rows':_0x3d4a5f||[],'count':_0x4ddf4d};});}});}exports[_0x67ad('0xa3')]=function(_0x3e38ae,_0x116964){return runReport(_0x3e38ae[_0x67ad('0x47')],_0x3e38ae[_0x67ad('0x32')],_0x3e38ae[_0x67ad('0x49')])['then'](respondWithResult(_0x116964,null))['catch'](handleError(_0x116964,null));};exports[_0x67ad('0xa4')]=runReport;exports[_0x67ad('0x32')]=function(_0x348d71,_0x3a7215){var _0x5bc976=0xa;var _0x2a8f56=[_0x67ad('0x85'),'left_join',_0x67ad('0x56'),_0x67ad('0x86')];var _0x5e4c42={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x67ad('0x58'),'MAX':_0x67ad('0x59'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x67ad('0xa5'),'GROUP_CONCAT ASC':_0x67ad('0xa6'),'GROUP_CONCAT DESC':_0x67ad('0xa7')};var _0x1517a3={'SEC_TO_TIME':_0x67ad('0x5c'),'DATE':_0x67ad('0x88'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x67ad('0x5f')};var _0x426f67=function(_0x376114){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x67ad('0x8a'),'IS\x20NOT\x20EMPTY'],_0x376114);};var _0x1a8742=function(_0x13e335){if(!_0x13e335||!_0x13e335[_0x67ad('0x63')][_0x67ad('0x38')]){return'';}for(var _0x5cd6da='(',_0x494309=0x0;_0x494309<_0x13e335[_0x67ad('0x63')][_0x67ad('0x38')];_0x494309+=0x1){_0x494309>0x0&&(_0x5cd6da+='\x20'+_0x13e335['operator']+'\x20');_0x5cd6da+=_0x13e335[_0x67ad('0x63')][_0x494309][_0x67ad('0x65')]?_0x1a8742(_0x13e335[_0x67ad('0x63')][_0x494309][_0x67ad('0x65')]):_0x13e335[_0x67ad('0x63')][_0x494309]['field']+'\x20'+_0x13e335[_0x67ad('0x63')][_0x494309][_0x67ad('0x8b')]+(_0x426f67(_0x13e335[_0x67ad('0x63')][_0x494309][_0x67ad('0x8b')])?'\x20'+_0x13e335['rules'][_0x494309][_0x67ad('0x8c')]:'');}return _0x5cd6da+')';};var _0x136710={'where':{'id':_0x348d71[_0x67ad('0x47')]['id']}},_0x7cb0b9,_0x42e283,_0x4077eb,_0x2d10ed,_0x21e0c2;_0x136710=_['merge']({},_0x136710,_0x348d71[_0x67ad('0x49')]);return db[_0x67ad('0x2d')][_0x67ad('0x4a')](_0x136710)[_0x67ad('0x24')](function(_0x4fa83a){if(_0x4fa83a){_0x7cb0b9=_0x4fa83a;return _0x4fa83a[_0x67ad('0x67')]();}return null;})[_0x67ad('0x24')](function(_0x1ce1a0){if(_0x1ce1a0){if(!_0x1ce1a0[_0x67ad('0x38')]){throw new db[(_0x67ad('0x68'))]['ValidationErrorItem'](_0x67ad('0x8d'),0x193);}_0x42e283=_0x1ce1a0;return db[_0x67ad('0x6a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x503bdd){if(_0x503bdd){_0x4077eb=_['keyBy'](_0x503bdd,'id');var _0x3a04b0;var _0x486a28=squel[_0x67ad('0x6c')]();_0x486a28[_0x67ad('0x6d')](_0x7cb0b9[_0x67ad('0x6e')]);for(var _0x373cac=0x0;_0x373cac<_0x42e283[_0x67ad('0x38')];_0x373cac+=0x1){_0x3a04b0=_0x42e283[_0x373cac][_0x67ad('0x6f')]?_0x4077eb[_0x42e283[_0x373cac][_0x67ad('0x6f')]][_0x67ad('0x70')]:_0x42e283[_0x373cac][_0x67ad('0x66')];_0x3a04b0=_0x42e283[_0x373cac][_0x67ad('0x72')]?_[_0x67ad('0x71')](_0x5e4c42[_0x42e283[_0x373cac][_0x67ad('0x72')]],'%s',_0x3a04b0):_0x3a04b0;_0x3a04b0=_0x42e283[_0x373cac][_0x67ad('0x73')]?_[_0x67ad('0x71')](_0x1517a3[_0x42e283[_0x373cac]['format']],'%s',_0x3a04b0):_0x3a04b0;if(_0x42e283[_0x373cac]['groupBy']){_0x486a28['group'](_0x3a04b0);}_0x42e283[_0x373cac][_0x67ad('0x75')]&&_0x486a28[_0x67ad('0x76')](_0x3a04b0,_0x42e283[_0x373cac]['orderBy']===_0x67ad('0x77')?![]:!![]);_0x486a28['field'](_0x3a04b0,_0x42e283[_0x373cac][_0x67ad('0x78')]||_0x3a04b0);}if(_0x7cb0b9[_0x67ad('0x79')]){_0x7cb0b9[_0x67ad('0x79')]=JSON[_0x67ad('0x8e')](_0x7cb0b9[_0x67ad('0x79')]);for(var _0x2c8a5a=0x0;_0x2c8a5a<_0x7cb0b9[_0x67ad('0x79')][_0x67ad('0x38')];_0x2c8a5a+=0x1){if(_0x7cb0b9[_0x67ad('0x79')][_0x2c8a5a][_0x67ad('0x2f')]&&_['includes'](_0x2a8f56,_0x7cb0b9['joins'][_0x2c8a5a][_0x67ad('0x2f')])&&_0x7cb0b9[_0x67ad('0x79')][_0x2c8a5a][_0x67ad('0x7a')]&&_0x7cb0b9[_0x67ad('0x79')][_0x2c8a5a]['foreignTable']&&_0x7cb0b9['joins'][_0x2c8a5a][_0x67ad('0x7c')]){_0x486a28[_0x7cb0b9[_0x67ad('0x79')][_0x2c8a5a]['type']](_0x7cb0b9[_0x67ad('0x79')][_0x2c8a5a]['foreignTable'],null,util['format'](_0x67ad('0x7d'),_0x7cb0b9[_0x67ad('0x6e')],_0x7cb0b9[_0x67ad('0x79')][_0x2c8a5a][_0x67ad('0x7a')],_0x7cb0b9[_0x67ad('0x79')][_0x2c8a5a]['foreignTable'],_0x7cb0b9['joins'][_0x2c8a5a]['foreignKey']));}}}if(_0x7cb0b9[_0x67ad('0x7e')]){_0x7cb0b9[_0x67ad('0x7e')]=JSON[_0x67ad('0x8e')](_0x7cb0b9[_0x67ad('0x7e')]);_0x486a28[_0x67ad('0x3e')](_0x1a8742(_0x7cb0b9[_0x67ad('0x7e')][_0x67ad('0x65')]));}_0x21e0c2=_0x486a28['clone']();_0x486a28['limit'](_0x5bc976);_0x486a28[_0x67ad('0x1c')](0x0);logger[_0x67ad('0x80')]('Limited\x20Query:',_0x486a28[_0x67ad('0x9c')]());return dbH[_0x67ad('0x82')]['query'](_0x486a28[_0x67ad('0x9c')](),{'type':dbH[_0x67ad('0x82')][_0x67ad('0x83')][_0x67ad('0x84')]});}})['then'](function(){return{'sql':_0x21e0c2[_0x67ad('0x9c')]()};})[_0x67ad('0x24')](respondWithResult(_0x3a7215,null))['catch'](handleError(_0x3a7215,null));};
\ No newline at end of file
index 48910bd..6b4ff3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9af4=['util','../../config/logger','api','bluebird','path','rimraf','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x9af4,0xdb));var _0x49af=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9af4[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x49af('0x0'));var util=require(_0x49af('0x1'));var logger=require(_0x49af('0x2'))(_0x49af('0x3'));var moment=require('moment');var BPromise=require(_0x49af('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x49af('0x5'));var rimraf=require(_0x49af('0x6'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x49af('0x7')]=function(_0x222442,_0xef3ca2){return _0x222442[_0x49af('0x8')](_0x49af('0x9'),attributes,{'tableName':_0x49af('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6655=['AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x46d409,_0x2850c0){var _0x1bdf97=function(_0x1abfd4){while(--_0x1abfd4){_0x46d409['push'](_0x46d409['shift']());}};_0x1bdf97(++_0x2850c0);}(_0x6655,0x18a));var _0x5665=function(_0xcb813d,_0x204798){_0xcb813d=_0xcb813d-0x0;var _0x259ee8=_0x6655[_0xcb813d];return _0x259ee8;};'use strict';var _=require(_0x5665('0x0'));var util=require(_0x5665('0x1'));var logger=require(_0x5665('0x2'))(_0x5665('0x3'));var moment=require(_0x5665('0x4'));var BPromise=require(_0x5665('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5665('0x6'));var rimraf=require(_0x5665('0x7'));var config=require(_0x5665('0x8'));var attributes=require(_0x5665('0x9'));module[_0x5665('0xa')]=function(_0xa822d,_0x2560e4){return _0xa822d[_0x5665('0xb')](_0x5665('0xc'),attributes,{'tableName':_0x5665('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 55b678e..20d0922 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacb6=['jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x24f9b2,_0x5c9bc1){var _0x51d726=function(_0xcf75f1){while(--_0xcf75f1){_0x24f9b2['push'](_0x24f9b2['shift']());}};_0x51d726(++_0x5c9bc1);}(_0xacb6,0x1c6));var _0x6acb=function(_0x2223eb,_0x3ffd7b){_0x2223eb=_0x2223eb-0x0;var _0x25ebb0=_0xacb6[_0x2223eb];return _0x25ebb0;};'use strict';var _=require('lodash');var util=require(_0x6acb('0x0'));var moment=require('moment');var BPromise=require(_0x6acb('0x1'));var rs=require(_0x6acb('0x2'));var fs=require('fs');var Redis=require(_0x6acb('0x3'));var db=require(_0x6acb('0x4'))['db'];var utils=require(_0x6acb('0x5'));var logger=require(_0x6acb('0x6'))('rpc');var config=require(_0x6acb('0x7'));var jayson=require(_0x6acb('0x8'));var client=jayson[_0x6acb('0x9')][_0x6acb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ae588,_0x147a5e,_0x399be5){return new BPromise(function(_0x359b1e,_0x32f375){return client[_0x6acb('0xb')](_0x5ae588,_0x399be5)[_0x6acb('0xc')](function(_0x2246a4){logger['info'](_0x6acb('0xd'),_0x147a5e,'request\x20sent');logger[_0x6acb('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x147a5e,_0x6acb('0xf'),JSON[_0x6acb('0x10')](_0x2246a4));if(_0x2246a4['error']){if(_0x2246a4['error'][_0x6acb('0x11')]===0x1f4){logger[_0x6acb('0x12')](_0x6acb('0xd'),_0x147a5e,_0x2246a4[_0x6acb('0x12')][_0x6acb('0x13')]);return _0x32f375(_0x2246a4['error'][_0x6acb('0x13')]);}logger['error'](_0x6acb('0xd'),_0x147a5e,_0x2246a4[_0x6acb('0x12')][_0x6acb('0x13')]);return _0x359b1e(_0x2246a4[_0x6acb('0x12')][_0x6acb('0x13')]);}else{logger['info'](_0x6acb('0xd'),_0x147a5e,_0x6acb('0xf'));_0x359b1e(_0x2246a4[_0x6acb('0x14')][_0x6acb('0x13')]);}})[_0x6acb('0x15')](function(_0x2fdfc8){logger['error'](_0x6acb('0xd'),_0x147a5e,_0x2fdfc8);_0x32f375(_0x2fdfc8);});});}
\ No newline at end of file
+var _0xd203=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util'];(function(_0x3a9eb1,_0xcb21e9){var _0x36c0e1=function(_0x227f4c){while(--_0x227f4c){_0x3a9eb1['push'](_0x3a9eb1['shift']());}};_0x36c0e1(++_0xcb21e9);}(_0xd203,0xee));var _0x3d20=function(_0x2e1e83,_0xb2934f){_0x2e1e83=_0x2e1e83-0x0;var _0xd19d0b=_0xd203[_0x2e1e83];return _0xd19d0b;};'use strict';var _=require(_0x3d20('0x0'));var util=require(_0x3d20('0x1'));var moment=require(_0x3d20('0x2'));var BPromise=require(_0x3d20('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d20('0x4'));var db=require(_0x3d20('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3d20('0x6'))(_0x3d20('0x7'));var config=require(_0x3d20('0x8'));var jayson=require(_0x3d20('0x9'));var client=jayson[_0x3d20('0xa')][_0x3d20('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3cc59b,_0x1af0e7,_0x144175){return new BPromise(function(_0x518625,_0x50810a){return client['request'](_0x3cc59b,_0x144175)[_0x3d20('0xc')](function(_0x38f48f){logger[_0x3d20('0xd')](_0x3d20('0xe'),_0x1af0e7,_0x3d20('0xf'));logger['debug']('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x1af0e7,'request\x20sent',JSON['stringify'](_0x38f48f));if(_0x38f48f[_0x3d20('0x10')]){if(_0x38f48f[_0x3d20('0x10')][_0x3d20('0x11')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x1af0e7,_0x38f48f[_0x3d20('0x10')][_0x3d20('0x12')]);return _0x50810a(_0x38f48f[_0x3d20('0x10')][_0x3d20('0x12')]);}logger[_0x3d20('0x10')](_0x3d20('0xe'),_0x1af0e7,_0x38f48f['error']['message']);return _0x518625(_0x38f48f[_0x3d20('0x10')][_0x3d20('0x12')]);}else{logger[_0x3d20('0xd')](_0x3d20('0xe'),_0x1af0e7,'request\x20sent');_0x518625(_0x38f48f['result'][_0x3d20('0x12')]);}})[_0x3d20('0x13')](function(_0x48c7ad){logger[_0x3d20('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1af0e7,_0x48c7ad);_0x50810a(_0x48c7ad);});});}
\ No newline at end of file
index 0145e3d..d2f26fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cf3=['isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6cf3,0x1ed));var _0x36cf=function(_0x32ad0b,_0x1bff04){_0x32ad0b=_0x32ad0b-0x0;var _0x4467bf=_0x6cf3[_0x32ad0b];return _0x4467bf;};'use strict';var multer=require(_0x36cf('0x0'));var util=require(_0x36cf('0x1'));var path=require(_0x36cf('0x2'));var timeout=require(_0x36cf('0x3'));var express=require(_0x36cf('0x4'));var router=express['Router']();var fs_extra=require(_0x36cf('0x5'));var auth=require(_0x36cf('0x6'));var interaction=require(_0x36cf('0x7'));var config=require(_0x36cf('0x8'));var controller=require(_0x36cf('0x9'));router[_0x36cf('0xa')]('/',auth[_0x36cf('0xb')](),controller[_0x36cf('0xc')]);router[_0x36cf('0xa')](_0x36cf('0xd'),auth[_0x36cf('0xb')](),controller[_0x36cf('0xe')]);router['get'](_0x36cf('0xf'),auth[_0x36cf('0xb')](),controller[_0x36cf('0x10')]);router[_0x36cf('0xa')](_0x36cf('0x11'),auth[_0x36cf('0xb')](),controller[_0x36cf('0x12')]);router[_0x36cf('0xa')](_0x36cf('0x13'),auth[_0x36cf('0xb')](),controller[_0x36cf('0x14')]);router[_0x36cf('0x15')]('/',auth[_0x36cf('0xb')](),controller[_0x36cf('0x16')]);router[_0x36cf('0x17')](_0x36cf('0xd'),auth[_0x36cf('0xb')](),controller[_0x36cf('0x18')]);router[_0x36cf('0x19')](_0x36cf('0xd'),auth[_0x36cf('0xb')](),controller[_0x36cf('0x1a')]);module[_0x36cf('0x1b')]=router;
\ No newline at end of file
+var _0xd6ef=['../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/preview','isAuthenticated','/:id/run','/:id/query','query','post','create','put','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x2cf3f9,_0x64c2d6){var _0x38de13=function(_0x534436){while(--_0x534436){_0x2cf3f9['push'](_0x2cf3f9['shift']());}};_0x38de13(++_0x64c2d6);}(_0xd6ef,0xbf));var _0xfd6e=function(_0x42e34c,_0x133d3f){_0x42e34c=_0x42e34c-0x0;var _0x23bd03=_0xd6ef[_0x42e34c];return _0x23bd03;};'use strict';var multer=require(_0xfd6e('0x0'));var util=require(_0xfd6e('0x1'));var path=require(_0xfd6e('0x2'));var timeout=require(_0xfd6e('0x3'));var express=require('express');var router=express[_0xfd6e('0x4')]();var fs_extra=require(_0xfd6e('0x5'));var auth=require(_0xfd6e('0x6'));var interaction=require(_0xfd6e('0x7'));var config=require(_0xfd6e('0x8'));var controller=require('./analyticCustomReport.controller');router[_0xfd6e('0x9')]('/',auth['isAuthenticated'](),controller[_0xfd6e('0xa')]);router[_0xfd6e('0x9')](_0xfd6e('0xb'),auth['isAuthenticated'](),controller[_0xfd6e('0xc')]);router[_0xfd6e('0x9')](_0xfd6e('0xd'),auth[_0xfd6e('0xe')](),controller['preview']);router[_0xfd6e('0x9')](_0xfd6e('0xf'),auth[_0xfd6e('0xe')](),controller['run']);router['get'](_0xfd6e('0x10'),auth[_0xfd6e('0xe')](),controller[_0xfd6e('0x11')]);router[_0xfd6e('0x12')]('/',auth['isAuthenticated'](),controller[_0xfd6e('0x13')]);router[_0xfd6e('0x14')](_0xfd6e('0xb'),auth[_0xfd6e('0xe')](),controller['update']);router[_0xfd6e('0x15')](_0xfd6e('0xb'),auth[_0xfd6e('0xe')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 10798d5..3a81b3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46ed=['sequelize','exports','STRING','TEXT'];(function(_0x50f392,_0x1d8441){var _0x5926f2=function(_0x17df32){while(--_0x17df32){_0x50f392['push'](_0x50f392['shift']());}};_0x5926f2(++_0x1d8441);}(_0x46ed,0x168));var _0xd46e=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x46ed[_0x4ff09b];return _0x3f5c2e;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd46e('0x2')]},'parent':{'type':Sequelize[_0xd46e('0x2')]},'table':{'type':Sequelize[_0xd46e('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xd46e('0x3')]}};
\ No newline at end of file
+var _0x2675=['sequelize','STRING','TEXT'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x2675,0x75));var _0x5267=function(_0x3f2397,_0x154b0b){_0x3f2397=_0x3f2397-0x0;var _0x3d4ed5=_0x2675[_0x3f2397];return _0x3d4ed5;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}};
\ No newline at end of file
index 17cd07a..dd7299f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6d38,0x1ef));var _0x86d3=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x6d38[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));};
\ No newline at end of file
+var _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x44d64f,_0x5bb5f8){var _0x54b51a=function(_0x59e6c0){while(--_0x59e6c0){_0x44d64f['push'](_0x44d64f['shift']());}};_0x54b51a(++_0x5bb5f8);}(_0x31f0,0xb7));var _0x031f=function(_0x572736,_0x35e723){_0x572736=_0x572736-0x0;var _0x231515=_0x31f0[_0x572736];return _0x231515;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));};
\ No newline at end of file
index 5bb6ce0..08ec9e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2902=['bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x2902,0x1dd));var _0x2290=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0x2902[_0x15b399];return _0x199f2d;};'use strict';var _=require(_0x2290('0x0'));var util=require(_0x2290('0x1'));var logger=require(_0x2290('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2290('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2290('0x4'));var rimraf=require(_0x2290('0x5'));var config=require(_0x2290('0x6'));var attributes=require(_0x2290('0x7'));module[_0x2290('0x8')]=function(_0x207bc2,_0x5a9e24){return _0x207bc2[_0x2290('0x9')](_0x2290('0xa'),attributes,{'tableName':_0x2290('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0fad=['request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','../../config/logger','api','moment','bluebird'];(function(_0xbbbeae,_0x4a414a){var _0x1cb9c9=function(_0x4db7d0){while(--_0x4db7d0){_0xbbbeae['push'](_0xbbbeae['shift']());}};_0x1cb9c9(++_0x4a414a);}(_0x0fad,0x167));var _0xd0fa=function(_0x2b9ac8,_0xf820cb){_0x2b9ac8=_0x2b9ac8-0x0;var _0x3ceea9=_0x0fad[_0x2b9ac8];return _0x3ceea9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd0fa('0x0'))(_0xd0fa('0x1'));var moment=require(_0xd0fa('0x2'));var BPromise=require(_0xd0fa('0x3'));var rp=require(_0xd0fa('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd0fa('0x5'));var config=require(_0xd0fa('0x6'));var attributes=require(_0xd0fa('0x7'));module[_0xd0fa('0x8')]=function(_0x236218,_0x536205){return _0x236218[_0xd0fa('0x9')]('AnalyticDefaultReport',attributes,{'tableName':_0xd0fa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f8f9135..e3a41c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf873=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','request','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x4db86d,_0x1c4512){var _0x26f506=function(_0x5d40e9){while(--_0x5d40e9){_0x4db86d['push'](_0x4db86d['shift']());}};_0x26f506(++_0x1c4512);}(_0xf873,0x1e2));var _0x3f87=function(_0x44880f,_0x35ddf5){_0x44880f=_0x44880f-0x0;var _0x40d152=_0xf873[_0x44880f];return _0x40d152;};'use strict';var _=require(_0x3f87('0x0'));var util=require(_0x3f87('0x1'));var moment=require(_0x3f87('0x2'));var BPromise=require(_0x3f87('0x3'));var rs=require(_0x3f87('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f87('0x5'))['db'];var utils=require(_0x3f87('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3f87('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3f87('0x8')][_0x3f87('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23a1af,_0x1ad826,_0x313447){return new BPromise(function(_0x524307,_0x3f7057){return client[_0x3f87('0xa')](_0x23a1af,_0x313447)['then'](function(_0x51d73b){logger['info'](_0x3f87('0xb'),_0x1ad826,'request\x20sent');logger[_0x3f87('0xc')](_0x3f87('0xd'),_0x1ad826,_0x3f87('0xe'),JSON[_0x3f87('0xf')](_0x51d73b));if(_0x51d73b['error']){if(_0x51d73b[_0x3f87('0x10')]['code']===0x1f4){logger[_0x3f87('0x10')](_0x3f87('0xb'),_0x1ad826,_0x51d73b[_0x3f87('0x10')][_0x3f87('0x11')]);return _0x3f7057(_0x51d73b[_0x3f87('0x10')][_0x3f87('0x11')]);}logger[_0x3f87('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1ad826,_0x51d73b[_0x3f87('0x10')][_0x3f87('0x11')]);return _0x524307(_0x51d73b[_0x3f87('0x10')][_0x3f87('0x11')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1ad826,_0x3f87('0xe'));_0x524307(_0x51d73b[_0x3f87('0x12')][_0x3f87('0x11')]);}})[_0x3f87('0x13')](function(_0x4564d1){logger[_0x3f87('0x10')](_0x3f87('0xb'),_0x1ad826,_0x4564d1);_0x3f7057(_0x4564d1);});});}
\ No newline at end of file
+var _0x5a11=['stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x336030,_0x4086ea){var _0x2b203b=function(_0x10b0ad){while(--_0x10b0ad){_0x336030['push'](_0x336030['shift']());}};_0x2b203b(++_0x4086ea);}(_0x5a11,0x67));var _0x15a1=function(_0x1e498d,_0x454bd2){_0x1e498d=_0x1e498d-0x0;var _0x514ccb=_0x5a11[_0x1e498d];return _0x514ccb;};'use strict';var _=require('lodash');var util=require(_0x15a1('0x0'));var moment=require('moment');var BPromise=require(_0x15a1('0x1'));var rs=require(_0x15a1('0x2'));var fs=require('fs');var Redis=require(_0x15a1('0x3'));var db=require(_0x15a1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x15a1('0x5'))(_0x15a1('0x6'));var config=require(_0x15a1('0x7'));var jayson=require(_0x15a1('0x8'));var client=jayson[_0x15a1('0x9')][_0x15a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1386ba,_0x50a11e,_0x2b1334){return new BPromise(function(_0x424062,_0x1b280c){return client[_0x15a1('0xb')](_0x1386ba,_0x2b1334)[_0x15a1('0xc')](function(_0x45d7f7){logger['info'](_0x15a1('0xd'),_0x50a11e,_0x15a1('0xe'));logger[_0x15a1('0xf')](_0x15a1('0x10'),_0x50a11e,'request\x20sent',JSON[_0x15a1('0x11')](_0x45d7f7));if(_0x45d7f7[_0x15a1('0x12')]){if(_0x45d7f7[_0x15a1('0x12')][_0x15a1('0x13')]===0x1f4){logger[_0x15a1('0x12')](_0x15a1('0xd'),_0x50a11e,_0x45d7f7[_0x15a1('0x12')][_0x15a1('0x14')]);return _0x1b280c(_0x45d7f7[_0x15a1('0x12')][_0x15a1('0x14')]);}logger[_0x15a1('0x12')](_0x15a1('0xd'),_0x50a11e,_0x45d7f7[_0x15a1('0x12')]['message']);return _0x424062(_0x45d7f7['error'][_0x15a1('0x14')]);}else{logger[_0x15a1('0x15')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x50a11e,_0x15a1('0xe'));_0x424062(_0x45d7f7[_0x15a1('0x16')][_0x15a1('0x14')]);}})[_0x15a1('0x17')](function(_0x507b18){logger[_0x15a1('0x12')](_0x15a1('0xd'),_0x50a11e,_0x507b18);_0x1b280c(_0x507b18);});});}
\ No newline at end of file
index 36890a9..6918eab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1048=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','/:id/query','query','post','put'];(function(_0x236487,_0x39046f){var _0x1c64cc=function(_0x5e1bfb){while(--_0x5e1bfb){_0x236487['push'](_0x236487['shift']());}};_0x1c64cc(++_0x39046f);}(_0x1048,0x18a));var _0x8104=function(_0xca9e14,_0x1de326){_0xca9e14=_0xca9e14-0x0;var _0x5097af=_0x1048[_0xca9e14];return _0x5097af;};'use strict';var multer=require(_0x8104('0x0'));var util=require(_0x8104('0x1'));var path=require(_0x8104('0x2'));var timeout=require(_0x8104('0x3'));var express=require(_0x8104('0x4'));var router=express[_0x8104('0x5')]();var fs_extra=require(_0x8104('0x6'));var auth=require(_0x8104('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0x8104('0x8')]('/',auth['isAuthenticated'](),controller[_0x8104('0x9')]);router[_0x8104('0x8')](_0x8104('0xa'),auth[_0x8104('0xb')](),controller[_0x8104('0xc')]);router[_0x8104('0x8')](_0x8104('0xd'),auth[_0x8104('0xb')](),controller[_0x8104('0xe')]);router[_0x8104('0x8')](_0x8104('0xf'),auth[_0x8104('0xb')](),controller['run']);router[_0x8104('0x8')](_0x8104('0x10'),auth['isAuthenticated'](),controller[_0x8104('0x11')]);router[_0x8104('0x12')]('/',auth[_0x8104('0xb')](),controller['create']);router[_0x8104('0x13')](_0x8104('0xa'),auth[_0x8104('0xb')](),controller[_0x8104('0x14')]);router[_0x8104('0x15')](_0x8104('0xa'),auth['isAuthenticated'](),controller[_0x8104('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x1879=['isAuthenticated','query','create','update','delete','exports','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','/:id','show','/:id/preview','/:id/run','run','/:id/query'];(function(_0x5c456c,_0x5bfc13){var _0x1ba369=function(_0x22ec0c){while(--_0x22ec0c){_0x5c456c['push'](_0x5c456c['shift']());}};_0x1ba369(++_0x5bfc13);}(_0x1879,0x10a));var _0x9187=function(_0x178f52,_0x5d9675){_0x178f52=_0x178f52-0x0;var _0x556f99=_0x1879[_0x178f52];return _0x556f99;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9187('0x0'));var express=require(_0x9187('0x1'));var router=express[_0x9187('0x2')]();var fs_extra=require(_0x9187('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9187('0x4'));var config=require(_0x9187('0x5'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9187('0x6')]);router[_0x9187('0x7')](_0x9187('0x8'),auth['isAuthenticated'](),controller[_0x9187('0x9')]);router[_0x9187('0x7')](_0x9187('0xa'),auth['isAuthenticated'](),controller['preview']);router[_0x9187('0x7')](_0x9187('0xb'),auth['isAuthenticated'](),controller[_0x9187('0xc')]);router[_0x9187('0x7')](_0x9187('0xd'),auth[_0x9187('0xe')](),controller[_0x9187('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9187('0x10')]);router['put'](_0x9187('0x8'),auth['isAuthenticated'](),controller[_0x9187('0x11')]);router[_0x9187('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9187('0x13')]=router;
\ No newline at end of file
index 3117e8e..c4c30fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d3f=['manual','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','xlsx','DATE'];(function(_0x48dd48,_0x3e0163){var _0x55040e=function(_0x5ccaaa){while(--_0x5ccaaa){_0x48dd48['push'](_0x48dd48['shift']());}};_0x55040e(++_0x3e0163);}(_0x7d3f,0xb6));var _0xf7d3=function(_0x51b1a5,_0x285a4f){_0x51b1a5=_0x51b1a5-0x0;var _0x15c738=_0x7d3f[_0x51b1a5];return _0x15c738;};'use strict';var Sequelize=require(_0xf7d3('0x0'));var moment=require(_0xf7d3('0x1'));module[_0xf7d3('0x2')]={'name':{'type':Sequelize[_0xf7d3('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xf7d3('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xf7d3('0x4')](_0xf7d3('0x5'),'pdf',_0xf7d3('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xf7d3('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xf7d3('0x7')]},'endDate':{'type':Sequelize[_0xf7d3('0x7')]},'status':{'type':Sequelize[_0xf7d3('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xf7d3('0x4')](_0xf7d3('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0xf7d3('0x8')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0xf7d3('0x9')]},'reportType':{'type':Sequelize[_0xf7d3('0x3')]}};
\ No newline at end of file
+var _0x1a6f=['STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','sequelize','moment','exports'];(function(_0x239303,_0x587017){var _0x59a5ea=function(_0x5e1b09){while(--_0x5e1b09){_0x239303['push'](_0x239303['shift']());}};_0x59a5ea(++_0x587017);}(_0x1a6f,0xc3));var _0xf1a6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1a6f[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0xf1a6('0x0'));var moment=require(_0xf1a6('0x1'));module[_0xf1a6('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xf1a6('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xf1a6('0x4')](_0xf1a6('0x5'),_0xf1a6('0x6'),_0xf1a6('0x7')),'allowNull':![],'defaultValue':_0xf1a6('0x5')},'savename':{'type':Sequelize[_0xf1a6('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xf1a6('0x8')]},'endDate':{'type':Sequelize[_0xf1a6('0x8')]},'status':{'type':Sequelize[_0xf1a6('0x3')],'defaultValue':_0xf1a6('0x9')},'type':{'type':Sequelize[_0xf1a6('0x4')](_0xf1a6('0xa'),'scheduled'),'allowNull':![],'defaultValue':_0xf1a6('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 0afeb51..36730ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f54=['then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','savename','output','join','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','server/files/reports','format','%s.%s','basename','toLowerCase','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2f54,0x157));var _0x42f5=function(_0x3a6d3e,_0x4f0ac5){_0x3a6d3e=_0x3a6d3e-0x0;var _0x735896=_0x2f54[_0x3a6d3e];return _0x735896;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x42f5('0x0'));var zipdir=require(_0x42f5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x42f5('0x2'));var moment=require(_0x42f5('0x3'));var BPromise=require(_0x42f5('0x4'));var Mustache=require(_0x42f5('0x5'));var util=require(_0x42f5('0x6'));var path=require(_0x42f5('0x7'));var sox=require('sox');var csv=require(_0x42f5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x42f5('0x9'));var squel=require(_0x42f5('0xa'));var crypto=require('crypto');var jsforce=require(_0x42f5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x42f5('0x8'));var querystring=require(_0x42f5('0xc'));var Papa=require(_0x42f5('0xd'));var Redis=require(_0x42f5('0xe'));var authService=require(_0x42f5('0xf'));var qs=require(_0x42f5('0x10'));var as=require(_0x42f5('0x11'));var hardwareService=require(_0x42f5('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x42f5('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x42f5('0x14'));var db=require(_0x42f5('0x15'))['db'];function respondWithStatusCode(_0x1ca799,_0x38efad){_0x38efad=_0x38efad||0xcc;return function(_0x51f130){if(_0x51f130){return _0x1ca799['sendStatus'](_0x38efad);}return _0x1ca799[_0x42f5('0x16')](_0x38efad)['end']();};}function respondWithResult(_0xac2b72,_0x19d545){_0x19d545=_0x19d545||0xc8;return function(_0x1f4bb1){if(_0x1f4bb1){return _0xac2b72[_0x42f5('0x16')](_0x19d545)[_0x42f5('0x17')](_0x1f4bb1);}};}function respondWithFilteredResult(_0x786d86,_0x5a011c){return function(_0x256eeb){if(_0x256eeb){var _0x4d0bbd=typeof _0x5a011c[_0x42f5('0x18')]===_0x42f5('0x19')&&typeof _0x5a011c[_0x42f5('0x1a')]===_0x42f5('0x19');var _0x17365c=_0x256eeb[_0x42f5('0x1b')];var _0x5768e0=_0x4d0bbd?0x0:_0x5a011c[_0x42f5('0x18')];var _0x20fb90=_0x4d0bbd?_0x256eeb[_0x42f5('0x1b')]:_0x5a011c[_0x42f5('0x18')]+_0x5a011c[_0x42f5('0x1a')];var _0x593040;if(_0x20fb90>=_0x17365c){_0x20fb90=_0x17365c;_0x593040=0xc8;}else{_0x593040=0xce;}_0x786d86[_0x42f5('0x16')](_0x593040);return _0x786d86[_0x42f5('0x1c')](_0x42f5('0x1d'),_0x5768e0+'-'+_0x20fb90+'/'+_0x17365c)[_0x42f5('0x17')](_0x256eeb);}return null;};}function patchUpdates(_0x52141a){return function(_0x1e117d){try{jsonpatch[_0x42f5('0x1e')](_0x1e117d,_0x52141a,!![]);}catch(_0x50e18d){return BPromise[_0x42f5('0x1f')](_0x50e18d);}return _0x1e117d['save']();};}function saveUpdates(_0x18e85f,_0xde6e71){return function(_0x5d81d4){if(_0x5d81d4){return _0x5d81d4[_0x42f5('0x20')](_0x18e85f)[_0x42f5('0x21')](function(_0x2803d6){return _0x2803d6;});}return null;};}function removeEntity(_0x5579e4,_0x3b1bde){return function(_0x5d290f){if(_0x5d290f){return _0x5d290f[_0x42f5('0x22')]()[_0x42f5('0x21')](function(){var _0x1005f3=_0x5d290f[_0x42f5('0x23')]({'plain':!![]});var _0x4f2200=_0x42f5('0x24');return db[_0x42f5('0x25')][_0x42f5('0x22')]({'where':{'type':_0x4f2200,'resourceId':_0x1005f3['id']}})[_0x42f5('0x21')](function(){return _0x5d290f;});})[_0x42f5('0x21')](function(){_0x5579e4[_0x42f5('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xddec5,_0x58b71f){return function(_0x50e89f){if(!_0x50e89f){_0xddec5[_0x42f5('0x26')](0x194);}return _0x50e89f;};}function handleError(_0x30fc80,_0x3ef488){_0x3ef488=_0x3ef488||0x1f4;return function(_0x4eb028){logger[_0x42f5('0x27')](_0x4eb028[_0x42f5('0x28')]);if(_0x4eb028[_0x42f5('0x29')]){delete _0x4eb028[_0x42f5('0x29')];}_0x30fc80[_0x42f5('0x16')](_0x3ef488)[_0x42f5('0x2a')](_0x4eb028);};}exports[_0x42f5('0x2b')]=function(_0x482784,_0x494f58){var _0x45a8eb={},_0x32a56e={},_0x3a5186={'count':0x0,'rows':[]};var _0x1c7d43=_[_0x42f5('0x2c')](db[_0x42f5('0x2d')][_0x42f5('0x2e')],function(_0x139808){return{'name':_0x139808[_0x42f5('0x2f')],'type':_0x139808[_0x42f5('0x30')]['key']};});_0x32a56e['model']=_[_0x42f5('0x2c')](_0x1c7d43,_0x42f5('0x29'));_0x32a56e[_0x42f5('0x31')]=_[_0x42f5('0x32')](_0x482784[_0x42f5('0x31')]);_0x32a56e[_0x42f5('0x33')]=_['intersection'](_0x32a56e['model'],_0x32a56e['query']);_0x45a8eb[_0x42f5('0x34')]=_[_0x42f5('0x35')](_0x32a56e[_0x42f5('0x36')],qs[_0x42f5('0x37')](_0x482784[_0x42f5('0x31')][_0x42f5('0x37')]));_0x45a8eb[_0x42f5('0x34')]=_0x45a8eb[_0x42f5('0x34')][_0x42f5('0x38')]?_0x45a8eb[_0x42f5('0x34')]:_0x32a56e[_0x42f5('0x36')];if(!_0x482784['query'][_0x42f5('0x39')]('nolimit')){_0x45a8eb[_0x42f5('0x1a')]=qs[_0x42f5('0x1a')](_0x482784['query']['limit']);_0x45a8eb[_0x42f5('0x18')]=qs[_0x42f5('0x18')](_0x482784[_0x42f5('0x31')][_0x42f5('0x18')]);}_0x45a8eb[_0x42f5('0x3a')]=qs[_0x42f5('0x3b')](_0x482784[_0x42f5('0x31')][_0x42f5('0x3b')]);_0x45a8eb[_0x42f5('0x3c')]=qs[_0x42f5('0x33')](_['pick'](_0x482784[_0x42f5('0x31')],_0x32a56e[_0x42f5('0x33')]),_0x1c7d43);if(_0x482784[_0x42f5('0x31')]['filter']){_0x45a8eb[_0x42f5('0x3c')]=_[_0x42f5('0x3d')](_0x45a8eb[_0x42f5('0x3c')],{'$or':_[_0x42f5('0x2c')](_0x1c7d43,function(_0x19fe92){if(_0x19fe92[_0x42f5('0x30')]!==_0x42f5('0x3e')){var _0x2d977c={};_0x2d977c[_0x19fe92[_0x42f5('0x29')]]={'$like':'%'+_0x482784['query'][_0x42f5('0x3f')]+'%'};return _0x2d977c;}})});}_0x45a8eb=_[_0x42f5('0x3d')]({},_0x45a8eb,_0x482784[_0x42f5('0x40')]);var _0x3ca407={'where':_0x45a8eb[_0x42f5('0x3c')]};return db[_0x42f5('0x2d')][_0x42f5('0x1b')](_0x3ca407)['then'](function(_0x438feb){_0x3a5186[_0x42f5('0x1b')]=_0x438feb;if(_0x482784[_0x42f5('0x31')]['includeAll']){_0x45a8eb['include']=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x42f5('0x41')](_0x45a8eb);})[_0x42f5('0x21')](function(_0x5a2380){_0x3a5186[_0x42f5('0x42')]=_0x5a2380;return _0x3a5186;})[_0x42f5('0x21')](respondWithFilteredResult(_0x494f58,_0x45a8eb))[_0x42f5('0x43')](handleError(_0x494f58,null));};exports[_0x42f5('0x44')]=function(_0x45d34f,_0x430156){var _0x1fb383={'raw':!![],'where':{'id':_0x45d34f[_0x42f5('0x45')]['id']}},_0x2159f0={};_0x2159f0['model']=_[_0x42f5('0x32')](db['AnalyticExtractedReport'][_0x42f5('0x2e')]);_0x2159f0[_0x42f5('0x31')]=_['keys'](_0x45d34f['query']);_0x2159f0[_0x42f5('0x33')]=_[_0x42f5('0x35')](_0x2159f0['model'],_0x2159f0[_0x42f5('0x31')]);_0x1fb383[_0x42f5('0x34')]=_[_0x42f5('0x35')](_0x2159f0[_0x42f5('0x36')],qs[_0x42f5('0x37')](_0x45d34f['query'][_0x42f5('0x37')]));_0x1fb383[_0x42f5('0x34')]=_0x1fb383[_0x42f5('0x34')][_0x42f5('0x38')]?_0x1fb383[_0x42f5('0x34')]:_0x2159f0[_0x42f5('0x36')];if(_0x45d34f['query'][_0x42f5('0x46')]){_0x1fb383['include']=[{'all':!![]}];}_0x1fb383=_[_0x42f5('0x3d')]({},_0x1fb383,_0x45d34f[_0x42f5('0x40')]);return db[_0x42f5('0x2d')][_0x42f5('0x47')](_0x1fb383)[_0x42f5('0x21')](handleEntityNotFound(_0x430156,null))[_0x42f5('0x21')](respondWithResult(_0x430156,null))['catch'](handleError(_0x430156,null));};exports['create']=function(_0x29262d,_0x378e9c){return db[_0x42f5('0x2d')][_0x42f5('0x48')](_0x29262d[_0x42f5('0x49')],{})[_0x42f5('0x21')](function(_0x251991){var _0x22735c=_0x29262d[_0x42f5('0x4a')][_0x42f5('0x23')]({'plain':!![]});if(!_0x22735c)throw new Error(_0x42f5('0x4b'));if(_0x22735c[_0x42f5('0x4c')]==='user'){var _0x56cab5=_0x251991['get']({'plain':!![]});var _0x17c7b9=_0x42f5('0x24');return db[_0x42f5('0x4d')][_0x42f5('0x47')]({'where':{'name':_0x17c7b9,'userProfileId':_0x22735c[_0x42f5('0x4e')]},'raw':!![]})[_0x42f5('0x21')](function(_0x5646ec){if(_0x5646ec&&_0x5646ec[_0x42f5('0x4f')]===0x0){return db[_0x42f5('0x25')][_0x42f5('0x48')]({'name':_0x56cab5[_0x42f5('0x29')],'resourceId':_0x56cab5['id'],'type':_0x5646ec[_0x42f5('0x29')],'sectionId':_0x5646ec['id']},{})[_0x42f5('0x21')](function(){return _0x251991;});}else{return _0x251991;}})[_0x42f5('0x43')](function(_0xc70407){logger['error'](_0x42f5('0x50'),_0xc70407);throw _0xc70407;});}return _0x251991;})[_0x42f5('0x21')](respondWithResult(_0x378e9c,0xc9))[_0x42f5('0x43')](handleError(_0x378e9c,null));};exports[_0x42f5('0x20')]=function(_0x132a03,_0x151ad9){if(_0x132a03[_0x42f5('0x49')]['id']){delete _0x132a03['body']['id'];}return db['AnalyticExtractedReport'][_0x42f5('0x47')]({'where':{'id':_0x132a03[_0x42f5('0x45')]['id']}})[_0x42f5('0x21')](handleEntityNotFound(_0x151ad9,null))[_0x42f5('0x21')](saveUpdates(_0x132a03[_0x42f5('0x49')],null))[_0x42f5('0x21')](respondWithResult(_0x151ad9,null))[_0x42f5('0x43')](handleError(_0x151ad9,null));};exports[_0x42f5('0x22')]=function(_0xd33633,_0x2df301){return db[_0x42f5('0x2d')][_0x42f5('0x47')]({'where':{'id':_0xd33633[_0x42f5('0x45')]['id']}})[_0x42f5('0x21')](handleEntityNotFound(_0x2df301,null))['then'](removeEntity(_0x2df301,null))['catch'](handleError(_0x2df301,null));};exports[_0x42f5('0x51')]=function(_0x32ccbc,_0x5a0b42,_0xa9c807){return db[_0x42f5('0x2d')][_0x42f5('0x47')]({'where':{'id':_0x32ccbc[_0x42f5('0x45')]['id']},'attributes':[_0x42f5('0x29'),'basename',_0x42f5('0x52'),_0x42f5('0x53')],'raw':!![]})[_0x42f5('0x21')](handleEntityNotFound(_0x5a0b42,null))[_0x42f5('0x21')](function(_0x41bcef){if(_0x41bcef){if(!fs['existsSync'](path[_0x42f5('0x54')](config['root'],'server/files/reports',_0x41bcef[_0x42f5('0x52')]))){throw new db['Sequelize'][(_0x42f5('0x55'))](_0x42f5('0x56'));}if(_0x32ccbc[_0x42f5('0x31')][_0x42f5('0x57')]){return _0x5a0b42[_0x42f5('0x26')](0xc8);}return _0x5a0b42[_0x42f5('0x51')](path[_0x42f5('0x54')](config[_0x42f5('0x58')],_0x42f5('0x59'),_0x41bcef[_0x42f5('0x52')]),util[_0x42f5('0x5a')](_0x42f5('0x5b'),_0x41bcef[_0x42f5('0x5c')]||_0x41bcef[_0x42f5('0x29')],_0x41bcef['output'][_0x42f5('0x5d')]()));}})[_0x42f5('0x43')](handleError(_0x5a0b42,null));};
\ No newline at end of file
+var _0x1a3f=['%s.%s','toLowerCase','eml-format','zip-dir','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','download','basename','output','existsSync','join','root','savename','Sequelize','ValidationError','format'];(function(_0xbe08b3,_0x418fa1){var _0x198f71=function(_0x586f18){while(--_0x586f18){_0xbe08b3['push'](_0xbe08b3['shift']());}};_0x198f71(++_0x418fa1);}(_0x1a3f,0x110));var _0xf1a3=function(_0x680ace,_0xb396b5){_0x680ace=_0x680ace-0x0;var _0x4e73bd=_0x1a3f[_0x680ace];return _0x4e73bd;};'use strict';var emlformat=require(_0xf1a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf1a3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf1a3('0x2'));var Mustache=require(_0xf1a3('0x3'));var util=require(_0xf1a3('0x4'));var path=require(_0xf1a3('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf1a3('0x6'));var fs=require('fs');var fs_extra=require(_0xf1a3('0x7'));var _=require(_0xf1a3('0x8'));var squel=require(_0xf1a3('0x9'));var crypto=require(_0xf1a3('0xa'));var jsforce=require(_0xf1a3('0xb'));var deskjs=require(_0xf1a3('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf1a3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf1a3('0xe'));var as=require(_0xf1a3('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf1a3('0x10'));var licenseUtil=require(_0xf1a3('0x11'));var db=require(_0xf1a3('0x12'))['db'];function respondWithStatusCode(_0x3bc06a,_0x24bfa7){_0x24bfa7=_0x24bfa7||0xcc;return function(_0x4915f5){if(_0x4915f5){return _0x3bc06a[_0xf1a3('0x13')](_0x24bfa7);}return _0x3bc06a[_0xf1a3('0x14')](_0x24bfa7)[_0xf1a3('0x15')]();};}function respondWithResult(_0x13701d,_0x342351){_0x342351=_0x342351||0xc8;return function(_0x840b58){if(_0x840b58){return _0x13701d['status'](_0x342351)[_0xf1a3('0x16')](_0x840b58);}};}function respondWithFilteredResult(_0x1e7dfd,_0x2ea520){return function(_0x112067){if(_0x112067){var _0x285272=typeof _0x2ea520[_0xf1a3('0x17')]===_0xf1a3('0x18')&&typeof _0x2ea520[_0xf1a3('0x19')]==='undefined';var _0x14d5da=_0x112067[_0xf1a3('0x1a')];var _0x4c6924=_0x285272?0x0:_0x2ea520[_0xf1a3('0x17')];var _0x5cd2c2=_0x285272?_0x112067['count']:_0x2ea520[_0xf1a3('0x17')]+_0x2ea520['limit'];var _0x5c8946;if(_0x5cd2c2>=_0x14d5da){_0x5cd2c2=_0x14d5da;_0x5c8946=0xc8;}else{_0x5c8946=0xce;}_0x1e7dfd[_0xf1a3('0x14')](_0x5c8946);return _0x1e7dfd[_0xf1a3('0x1b')](_0xf1a3('0x1c'),_0x4c6924+'-'+_0x5cd2c2+'/'+_0x14d5da)[_0xf1a3('0x16')](_0x112067);}return null;};}function patchUpdates(_0x258522){return function(_0x1bc3a7){try{jsonpatch[_0xf1a3('0x1d')](_0x1bc3a7,_0x258522,!![]);}catch(_0x4a7ed9){return BPromise['reject'](_0x4a7ed9);}return _0x1bc3a7['save']();};}function saveUpdates(_0x2303ff,_0xa7d329){return function(_0xdf862a){if(_0xdf862a){return _0xdf862a['update'](_0x2303ff)[_0xf1a3('0x1e')](function(_0x5cb78d){return _0x5cb78d;});}return null;};}function removeEntity(_0x541b5a,_0xb7b615){return function(_0x570755){if(_0x570755){return _0x570755[_0xf1a3('0x1f')]()['then'](function(){var _0x53aacc=_0x570755[_0xf1a3('0x20')]({'plain':!![]});var _0x25847c=_0xf1a3('0x21');return db[_0xf1a3('0x22')][_0xf1a3('0x1f')]({'where':{'type':_0x25847c,'resourceId':_0x53aacc['id']}})[_0xf1a3('0x1e')](function(){return _0x570755;});})[_0xf1a3('0x1e')](function(){_0x541b5a['status'](0xcc)[_0xf1a3('0x15')]();});}};}function handleEntityNotFound(_0x3446d3,_0x267183){return function(_0x4c24){if(!_0x4c24){_0x3446d3[_0xf1a3('0x13')](0x194);}return _0x4c24;};}function handleError(_0xb76e0e,_0x866d7b){_0x866d7b=_0x866d7b||0x1f4;return function(_0x14e13){logger[_0xf1a3('0x23')](_0x14e13[_0xf1a3('0x24')]);if(_0x14e13[_0xf1a3('0x25')]){delete _0x14e13[_0xf1a3('0x25')];}_0xb76e0e['status'](_0x866d7b)[_0xf1a3('0x26')](_0x14e13);};}exports[_0xf1a3('0x27')]=function(_0x1719e8,_0x365f52){var _0x5119ca={},_0x13dc4f={},_0x1cb600={'count':0x0,'rows':[]};var _0x2fee23=_[_0xf1a3('0x28')](db[_0xf1a3('0x29')][_0xf1a3('0x2a')],function(_0x4a60f5){return{'name':_0x4a60f5[_0xf1a3('0x2b')],'type':_0x4a60f5['type'][_0xf1a3('0x2c')]};});_0x13dc4f[_0xf1a3('0x2d')]=_[_0xf1a3('0x28')](_0x2fee23,'name');_0x13dc4f[_0xf1a3('0x2e')]=_[_0xf1a3('0x2f')](_0x1719e8[_0xf1a3('0x2e')]);_0x13dc4f[_0xf1a3('0x30')]=_[_0xf1a3('0x31')](_0x13dc4f[_0xf1a3('0x2d')],_0x13dc4f[_0xf1a3('0x2e')]);_0x5119ca[_0xf1a3('0x32')]=_[_0xf1a3('0x31')](_0x13dc4f[_0xf1a3('0x2d')],qs[_0xf1a3('0x33')](_0x1719e8[_0xf1a3('0x2e')][_0xf1a3('0x33')]));_0x5119ca[_0xf1a3('0x32')]=_0x5119ca[_0xf1a3('0x32')][_0xf1a3('0x34')]?_0x5119ca[_0xf1a3('0x32')]:_0x13dc4f[_0xf1a3('0x2d')];if(!_0x1719e8[_0xf1a3('0x2e')]['hasOwnProperty']('nolimit')){_0x5119ca['limit']=qs[_0xf1a3('0x19')](_0x1719e8[_0xf1a3('0x2e')][_0xf1a3('0x19')]);_0x5119ca[_0xf1a3('0x17')]=qs['offset'](_0x1719e8['query']['offset']);}_0x5119ca[_0xf1a3('0x35')]=qs['sort'](_0x1719e8[_0xf1a3('0x2e')][_0xf1a3('0x36')]);_0x5119ca[_0xf1a3('0x37')]=qs['filters'](_[_0xf1a3('0x38')](_0x1719e8[_0xf1a3('0x2e')],_0x13dc4f[_0xf1a3('0x30')]),_0x2fee23);if(_0x1719e8['query'][_0xf1a3('0x39')]){_0x5119ca['where']=_[_0xf1a3('0x3a')](_0x5119ca['where'],{'$or':_[_0xf1a3('0x28')](_0x2fee23,function(_0x353f40){if(_0x353f40[_0xf1a3('0x3b')]!==_0xf1a3('0x3c')){var _0x11fe66={};_0x11fe66[_0x353f40[_0xf1a3('0x25')]]={'$like':'%'+_0x1719e8['query'][_0xf1a3('0x39')]+'%'};return _0x11fe66;}})});}_0x5119ca=_['merge']({},_0x5119ca,_0x1719e8[_0xf1a3('0x3d')]);var _0x4048de={'where':_0x5119ca[_0xf1a3('0x37')]};return db[_0xf1a3('0x29')]['count'](_0x4048de)['then'](function(_0x2dc493){_0x1cb600[_0xf1a3('0x1a')]=_0x2dc493;if(_0x1719e8['query']['includeAll']){_0x5119ca[_0xf1a3('0x3e')]=[{'all':!![]}];}return db[_0xf1a3('0x29')][_0xf1a3('0x3f')](_0x5119ca);})[_0xf1a3('0x1e')](function(_0x41e277){_0x1cb600[_0xf1a3('0x40')]=_0x41e277;return _0x1cb600;})[_0xf1a3('0x1e')](respondWithFilteredResult(_0x365f52,_0x5119ca))[_0xf1a3('0x41')](handleError(_0x365f52,null));};exports[_0xf1a3('0x42')]=function(_0x5854ef,_0x4ea168){var _0x306403={'raw':!![],'where':{'id':_0x5854ef['params']['id']}},_0x1da5b9={};_0x1da5b9[_0xf1a3('0x2d')]=_[_0xf1a3('0x2f')](db[_0xf1a3('0x29')][_0xf1a3('0x2a')]);_0x1da5b9[_0xf1a3('0x2e')]=_['keys'](_0x5854ef[_0xf1a3('0x2e')]);_0x1da5b9[_0xf1a3('0x30')]=_['intersection'](_0x1da5b9[_0xf1a3('0x2d')],_0x1da5b9[_0xf1a3('0x2e')]);_0x306403[_0xf1a3('0x32')]=_[_0xf1a3('0x31')](_0x1da5b9[_0xf1a3('0x2d')],qs[_0xf1a3('0x33')](_0x5854ef[_0xf1a3('0x2e')][_0xf1a3('0x33')]));_0x306403[_0xf1a3('0x32')]=_0x306403['attributes'][_0xf1a3('0x34')]?_0x306403['attributes']:_0x1da5b9[_0xf1a3('0x2d')];if(_0x5854ef[_0xf1a3('0x2e')][_0xf1a3('0x43')]){_0x306403[_0xf1a3('0x3e')]=[{'all':!![]}];}_0x306403=_[_0xf1a3('0x3a')]({},_0x306403,_0x5854ef['options']);return db[_0xf1a3('0x29')]['find'](_0x306403)[_0xf1a3('0x1e')](handleEntityNotFound(_0x4ea168,null))[_0xf1a3('0x1e')](respondWithResult(_0x4ea168,null))[_0xf1a3('0x41')](handleError(_0x4ea168,null));};exports[_0xf1a3('0x44')]=function(_0x379e58,_0x56093c){return db[_0xf1a3('0x29')][_0xf1a3('0x44')](_0x379e58[_0xf1a3('0x45')],{})[_0xf1a3('0x1e')](function(_0x228e76){var _0x3e9ed5=_0x379e58[_0xf1a3('0x46')][_0xf1a3('0x20')]({'plain':!![]});if(!_0x3e9ed5)throw new Error(_0xf1a3('0x47'));if(_0x3e9ed5['role']===_0xf1a3('0x46')){var _0x2632b5=_0x228e76[_0xf1a3('0x20')]({'plain':!![]});var _0x54cd80=_0xf1a3('0x21');return db['UserProfileSection']['find']({'where':{'name':_0x54cd80,'userProfileId':_0x3e9ed5[_0xf1a3('0x48')]},'raw':!![]})['then'](function(_0x3658ce){if(_0x3658ce&&_0x3658ce[_0xf1a3('0x49')]===0x0){return db[_0xf1a3('0x22')][_0xf1a3('0x44')]({'name':_0x2632b5['name'],'resourceId':_0x2632b5['id'],'type':_0x3658ce[_0xf1a3('0x25')],'sectionId':_0x3658ce['id']},{})[_0xf1a3('0x1e')](function(){return _0x228e76;});}else{return _0x228e76;}})['catch'](function(_0x4d8fe0){logger['error'](_0xf1a3('0x4a'),_0x4d8fe0);throw _0x4d8fe0;});}return _0x228e76;})['then'](respondWithResult(_0x56093c,0xc9))[_0xf1a3('0x41')](handleError(_0x56093c,null));};exports[_0xf1a3('0x4b')]=function(_0x39a45e,_0x35f655){if(_0x39a45e['body']['id']){delete _0x39a45e[_0xf1a3('0x45')]['id'];}return db[_0xf1a3('0x29')][_0xf1a3('0x4c')]({'where':{'id':_0x39a45e[_0xf1a3('0x4d')]['id']}})['then'](handleEntityNotFound(_0x35f655,null))['then'](saveUpdates(_0x39a45e[_0xf1a3('0x45')],null))['then'](respondWithResult(_0x35f655,null))[_0xf1a3('0x41')](handleError(_0x35f655,null));};exports[_0xf1a3('0x1f')]=function(_0x1f6def,_0x428c2d){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x1f6def[_0xf1a3('0x4d')]['id']}})[_0xf1a3('0x1e')](handleEntityNotFound(_0x428c2d,null))[_0xf1a3('0x1e')](removeEntity(_0x428c2d,null))['catch'](handleError(_0x428c2d,null));};exports[_0xf1a3('0x4e')]=function(_0x404223,_0x26f6d3,_0x415194){return db['AnalyticExtractedReport'][_0xf1a3('0x4c')]({'where':{'id':_0x404223[_0xf1a3('0x4d')]['id']},'attributes':['name',_0xf1a3('0x4f'),'savename',_0xf1a3('0x50')],'raw':!![]})[_0xf1a3('0x1e')](handleEntityNotFound(_0x26f6d3,null))['then'](function(_0x50df3c){if(_0x50df3c){if(!fs[_0xf1a3('0x51')](path[_0xf1a3('0x52')](config[_0xf1a3('0x53')],'server/files/reports',_0x50df3c[_0xf1a3('0x54')]))){throw new db[(_0xf1a3('0x55'))][(_0xf1a3('0x56'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x404223['query']['exists']){return _0x26f6d3[_0xf1a3('0x13')](0xc8);}return _0x26f6d3['download'](path['join'](config[_0xf1a3('0x53')],'server/files/reports',_0x50df3c[_0xf1a3('0x54')]),util[_0xf1a3('0x57')](_0xf1a3('0x58'),_0x50df3c[_0xf1a3('0x4f')]||_0x50df3c[_0xf1a3('0x25')],_0x50df3c[_0xf1a3('0x50')][_0xf1a3('0x59')]()));}})['catch'](handleError(_0x26f6d3,null));};
\ No newline at end of file
index 789e426..d0f188e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c27=['define','AnalyticExtractedReport','analytics_extracted_reports','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4ec87c,_0x40549f){var _0x4893bc=function(_0x21ea7b){while(--_0x21ea7b){_0x4ec87c['push'](_0x4ec87c['shift']());}};_0x4893bc(++_0x40549f);}(_0x9c27,0x87));var _0x79c2=function(_0x19ef32,_0x3b78ff){_0x19ef32=_0x19ef32-0x0;var _0x20034e=_0x9c27[_0x19ef32];return _0x20034e;};'use strict';var _=require('lodash');var util=require(_0x79c2('0x0'));var logger=require(_0x79c2('0x1'))('api');var moment=require(_0x79c2('0x2'));var BPromise=require('bluebird');var rp=require(_0x79c2('0x3'));var fs=require('fs');var path=require(_0x79c2('0x4'));var rimraf=require(_0x79c2('0x5'));var config=require(_0x79c2('0x6'));var attributes=require('./analyticExtractedReport.attributes');module[_0x79c2('0x7')]=function(_0x1152f9,_0x1e75ab){return _0x1152f9[_0x79c2('0x8')](_0x79c2('0x9'),attributes,{'tableName':_0x79c2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc223=['analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0x4bebd7,_0x406296){var _0x45b0de=function(_0x3fc5e6){while(--_0x3fc5e6){_0x4bebd7['push'](_0x4bebd7['shift']());}};_0x45b0de(++_0x406296);}(_0xc223,0x9b));var _0x3c22=function(_0x59aca7,_0x4a40ef){_0x59aca7=_0x59aca7-0x0;var _0x456f4d=_0xc223[_0x59aca7];return _0x456f4d;};'use strict';var _=require(_0x3c22('0x0'));var util=require(_0x3c22('0x1'));var logger=require(_0x3c22('0x2'))(_0x3c22('0x3'));var moment=require(_0x3c22('0x4'));var BPromise=require(_0x3c22('0x5'));var rp=require(_0x3c22('0x6'));var fs=require('fs');var path=require(_0x3c22('0x7'));var rimraf=require('rimraf');var config=require(_0x3c22('0x8'));var attributes=require(_0x3c22('0x9'));module[_0x3c22('0xa')]=function(_0x420368,_0x565f5d){return _0x420368[_0x3c22('0xb')](_0x3c22('0xc'),attributes,{'tableName':_0x3c22('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 125ee6a..38540ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x426a=['debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent'];(function(_0x49f856,_0x26dc54){var _0x1bacb6=function(_0xd115b3){while(--_0xd115b3){_0x49f856['push'](_0x49f856['shift']());}};_0x1bacb6(++_0x26dc54);}(_0x426a,0x6b));var _0xa426=function(_0x18905b,_0x3a81c4){_0x18905b=_0x18905b-0x0;var _0x18e801=_0x426a[_0x18905b];return _0x18e801;};'use strict';var _=require(_0xa426('0x0'));var util=require(_0xa426('0x1'));var moment=require(_0xa426('0x2'));var BPromise=require(_0xa426('0x3'));var rs=require(_0xa426('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa426('0x5'))['db'];var utils=require(_0xa426('0x6'));var logger=require(_0xa426('0x7'))(_0xa426('0x8'));var config=require(_0xa426('0x9'));var jayson=require(_0xa426('0xa'));var client=jayson[_0xa426('0xb')][_0xa426('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a481e,_0x100bce,_0x27ec68){return new BPromise(function(_0x1fe3fb,_0x2fd1f6){return client[_0xa426('0xd')](_0x3a481e,_0x27ec68)[_0xa426('0xe')](function(_0xc028af){logger[_0xa426('0xf')](_0xa426('0x10'),_0x100bce,_0xa426('0x11'));logger[_0xa426('0x12')](_0xa426('0x13'),_0x100bce,_0xa426('0x11'),JSON[_0xa426('0x14')](_0xc028af));if(_0xc028af[_0xa426('0x15')]){if(_0xc028af[_0xa426('0x15')][_0xa426('0x16')]===0x1f4){logger[_0xa426('0x15')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x100bce,_0xc028af[_0xa426('0x15')][_0xa426('0x17')]);return _0x2fd1f6(_0xc028af[_0xa426('0x15')][_0xa426('0x17')]);}logger['error'](_0xa426('0x10'),_0x100bce,_0xc028af['error'][_0xa426('0x17')]);return _0x1fe3fb(_0xc028af[_0xa426('0x15')][_0xa426('0x17')]);}else{logger[_0xa426('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x100bce,'request\x20sent');_0x1fe3fb(_0xc028af[_0xa426('0x18')][_0xa426('0x17')]);}})['catch'](function(_0x3011b8){logger[_0xa426('0x15')](_0xa426('0x10'),_0x100bce,_0x3011b8);_0x2fd1f6(_0x3011b8);});});}
\ No newline at end of file
+var _0xb31c=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','moment'];(function(_0x3f6676,_0x2ae949){var _0x49efcf=function(_0x10a4cb){while(--_0x10a4cb){_0x3f6676['push'](_0x3f6676['shift']());}};_0x49efcf(++_0x2ae949);}(_0xb31c,0x133));var _0xcb31=function(_0x142849,_0x4f35eb){_0x142849=_0x142849-0x0;var _0x59d465=_0xb31c[_0x142849];return _0x59d465;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcb31('0x0'));var BPromise=require('bluebird');var rs=require(_0xcb31('0x1'));var fs=require('fs');var Redis=require(_0xcb31('0x2'));var db=require(_0xcb31('0x3'))['db'];var utils=require(_0xcb31('0x4'));var logger=require(_0xcb31('0x5'))(_0xcb31('0x6'));var config=require(_0xcb31('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcb31('0x8')][_0xcb31('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4db4c2,_0x4db3de,_0x2fcb13){return new BPromise(function(_0x51281,_0x44fc32){return client[_0xcb31('0xa')](_0x4db4c2,_0x2fcb13)[_0xcb31('0xb')](function(_0x20493d){logger['info'](_0xcb31('0xc'),_0x4db3de,_0xcb31('0xd'));logger[_0xcb31('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x4db3de,_0xcb31('0xd'),JSON[_0xcb31('0xf')](_0x20493d));if(_0x20493d[_0xcb31('0x10')]){if(_0x20493d[_0xcb31('0x10')][_0xcb31('0x11')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4db3de,_0x20493d[_0xcb31('0x10')]['message']);return _0x44fc32(_0x20493d[_0xcb31('0x10')]['message']);}logger[_0xcb31('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4db3de,_0x20493d[_0xcb31('0x10')]['message']);return _0x51281(_0x20493d[_0xcb31('0x10')][_0xcb31('0x12')]);}else{logger[_0xcb31('0x13')](_0xcb31('0xc'),_0x4db3de,_0xcb31('0xd'));_0x51281(_0x20493d[_0xcb31('0x14')][_0xcb31('0x12')]);}})[_0xcb31('0x15')](function(_0x5dcd39){logger[_0xcb31('0x10')](_0xcb31('0xc'),_0x4db3de,_0x5dcd39);_0x44fc32(_0x5dcd39);});});}
\ No newline at end of file
index 8ac7ac1..36912bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae24=['util','path','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','index','/:id','isAuthenticated','/:id/download','post','create','put','update','delete','destroy','exports','multer'];(function(_0x4243f2,_0x168abb){var _0x5cfbac=function(_0x5bf049){while(--_0x5bf049){_0x4243f2['push'](_0x4243f2['shift']());}};_0x5cfbac(++_0x168abb);}(_0xae24,0xf6));var _0x4ae2=function(_0x4e49c2,_0x37c7eb){_0x4e49c2=_0x4e49c2-0x0;var _0x1c0ca9=_0xae24[_0x4e49c2];return _0x1c0ca9;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require(_0x4ae2('0x1'));var path=require(_0x4ae2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4ae2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4ae2('0x4'));var interaction=require(_0x4ae2('0x5'));var config=require('../../config/environment');var controller=require(_0x4ae2('0x6'));router[_0x4ae2('0x7')]('/',auth['isAuthenticated'](),controller[_0x4ae2('0x8')]);router[_0x4ae2('0x7')](_0x4ae2('0x9'),auth[_0x4ae2('0xa')](),controller['show']);router[_0x4ae2('0x7')](_0x4ae2('0xb'),auth['isAuthenticated'](),controller['download']);router[_0x4ae2('0xc')]('/',auth[_0x4ae2('0xa')](),controller[_0x4ae2('0xd')]);router[_0x4ae2('0xe')](_0x4ae2('0x9'),auth[_0x4ae2('0xa')](),controller[_0x4ae2('0xf')]);router[_0x4ae2('0x10')](_0x4ae2('0x9'),auth['isAuthenticated'](),controller[_0x4ae2('0x11')]);module[_0x4ae2('0x12')]=router;
\ No newline at end of file
+var _0xb7fa=['/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','index'];(function(_0x699fb4,_0x22d4a1){var _0x443f9d=function(_0x52b3fa){while(--_0x52b3fa){_0x699fb4['push'](_0x699fb4['shift']());}};_0x443f9d(++_0x22d4a1);}(_0xb7fa,0xf1));var _0xab7f=function(_0x17784a,_0x42fe44){_0x17784a=_0x17784a-0x0;var _0x41aded=_0xb7fa[_0x17784a];return _0x41aded;};'use strict';var multer=require(_0xab7f('0x0'));var util=require(_0xab7f('0x1'));var path=require(_0xab7f('0x2'));var timeout=require(_0xab7f('0x3'));var express=require(_0xab7f('0x4'));var router=express['Router']();var fs_extra=require(_0xab7f('0x5'));var auth=require(_0xab7f('0x6'));var interaction=require(_0xab7f('0x7'));var config=require('../../config/environment');var controller=require(_0xab7f('0x8'));router[_0xab7f('0x9')]('/',auth[_0xab7f('0xa')](),controller[_0xab7f('0xb')]);router[_0xab7f('0x9')](_0xab7f('0xc'),auth[_0xab7f('0xa')](),controller[_0xab7f('0xd')]);router[_0xab7f('0x9')](_0xab7f('0xe'),auth[_0xab7f('0xa')](),controller[_0xab7f('0xf')]);router[_0xab7f('0x10')]('/',auth[_0xab7f('0xa')](),controller[_0xab7f('0x11')]);router[_0xab7f('0x12')](_0xab7f('0xc'),auth[_0xab7f('0xa')](),controller[_0xab7f('0x13')]);router[_0xab7f('0x14')](_0xab7f('0xc'),auth[_0xab7f('0xa')](),controller[_0xab7f('0x15')]);module[_0xab7f('0x16')]=router;
\ No newline at end of file
index 3f9ed63..ab55f17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2eb5=['STRING','sequelize','exports','TEXT','BOOLEAN'];(function(_0xdc4266,_0x2b1bdd){var _0x543273=function(_0x7b7f4a){while(--_0x7b7f4a){_0xdc4266['push'](_0xdc4266['shift']());}};_0x543273(++_0x2b1bdd);}(_0x2eb5,0x9c));var _0x52eb=function(_0x3c0c0c,_0x567580){_0x3c0c0c=_0x3c0c0c-0x0;var _0x4ba2e3=_0x2eb5[_0x3c0c0c];return _0x4ba2e3;};'use strict';var Sequelize=require(_0x52eb('0x0'));module[_0x52eb('0x1')]={'field':{'type':Sequelize[_0x52eb('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x52eb('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x52eb('0x4')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xe293=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x37cf79,_0x592e3b){var _0x16da17=function(_0x15b8af){while(--_0x15b8af){_0x37cf79['push'](_0x37cf79['shift']());}};_0x16da17(++_0x592e3b);}(_0xe293,0x179));var _0x3e29=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0xe293[_0x247fa1];return _0x244f35;};'use strict';var Sequelize=require(_0x3e29('0x0'));module[_0x3e29('0x1')]={'field':{'type':Sequelize[_0x3e29('0x2')]},'alias':{'type':Sequelize[_0x3e29('0x3')]},'function':{'type':Sequelize[_0x3e29('0x3')]},'format':{'type':Sequelize[_0x3e29('0x3')]},'groupBy':{'type':Sequelize[_0x3e29('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x3e29('0x3')]},'custom':{'type':Sequelize[_0x3e29('0x4')],'defaultValue':![]}};
\ No newline at end of file
index 4490102..2669fba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7853=['fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','json','apply','reject','save','update','then','destroy','end','error','name','index','map','rawAttributes','fieldName','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','type','VIRTUAL','options','AnalyticFieldReport','include','show','params','keys','intersection','includeAll','find','catch','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','CustomReportId','rimraf'];(function(_0x23129d,_0x599b5b){var _0x4faa48=function(_0x5e9a93){while(--_0x5e9a93){_0x23129d['push'](_0x23129d['shift']());}};_0x4faa48(++_0x599b5b);}(_0x7853,0x97));var _0x3785=function(_0x51ca5b,_0x326c16){_0x51ca5b=_0x51ca5b-0x0;var _0x5bef49=_0x7853[_0x51ca5b];return _0x5bef49;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3785('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3785('0x1'));var rp=require(_0x3785('0x2'));var moment=require('moment');var BPromise=require(_0x3785('0x3'));var Mustache=require(_0x3785('0x4'));var util=require(_0x3785('0x5'));var path=require(_0x3785('0x6'));var sox=require(_0x3785('0x7'));var csv=require(_0x3785('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3785('0x9'));var _=require(_0x3785('0xa'));var squel=require(_0x3785('0xb'));var crypto=require(_0x3785('0xc'));var jsforce=require(_0x3785('0xd'));var deskjs=require(_0x3785('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3785('0xf'));var Papa=require('papaparse');var Redis=require(_0x3785('0x10'));var authService=require(_0x3785('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3785('0x12'));var utils=require(_0x3785('0x13'));var config=require(_0x3785('0x14'));var licenseUtil=require(_0x3785('0x15'));var db=require(_0x3785('0x16'))['db'];function respondWithStatusCode(_0x233b81,_0x25a06e){_0x25a06e=_0x25a06e||0xcc;return function(_0x428162){if(_0x428162){return _0x233b81[_0x3785('0x17')](_0x25a06e);}return _0x233b81['status'](_0x25a06e)['end']();};}function respondWithResult(_0x45b1a8,_0x5d4192){_0x5d4192=_0x5d4192||0xc8;return function(_0x4cac3c){if(_0x4cac3c){return _0x45b1a8[_0x3785('0x18')](_0x5d4192)['json'](_0x4cac3c);}};}function respondWithFilteredResult(_0xaaec41,_0x2e9368){return function(_0x28068b){if(_0x28068b){var _0x8de23f=typeof _0x2e9368[_0x3785('0x19')]==='undefined'&&typeof _0x2e9368[_0x3785('0x1a')]===_0x3785('0x1b');var _0xbdf511=_0x28068b[_0x3785('0x1c')];var _0x485b1c=_0x8de23f?0x0:_0x2e9368[_0x3785('0x19')];var _0x32bfaa=_0x8de23f?_0x28068b[_0x3785('0x1c')]:_0x2e9368['offset']+_0x2e9368[_0x3785('0x1a')];var _0x242721;if(_0x32bfaa>=_0xbdf511){_0x32bfaa=_0xbdf511;_0x242721=0xc8;}else{_0x242721=0xce;}_0xaaec41['status'](_0x242721);return _0xaaec41['set']('Content-Range',_0x485b1c+'-'+_0x32bfaa+'/'+_0xbdf511)[_0x3785('0x1d')](_0x28068b);}return null;};}function patchUpdates(_0x1ffc83){return function(_0x304fe3){try{jsonpatch[_0x3785('0x1e')](_0x304fe3,_0x1ffc83,!![]);}catch(_0x36ac40){return BPromise[_0x3785('0x1f')](_0x36ac40);}return _0x304fe3[_0x3785('0x20')]();};}function saveUpdates(_0x2e99d8,_0x498e50){return function(_0x1d7676){if(_0x1d7676){return _0x1d7676[_0x3785('0x21')](_0x2e99d8)[_0x3785('0x22')](function(_0x1fd370){return _0x1fd370;});}return null;};}function removeEntity(_0x3e30a1,_0x1e7e0f){return function(_0x1aab3d){if(_0x1aab3d){return _0x1aab3d[_0x3785('0x23')]()['then'](function(){_0x3e30a1[_0x3785('0x18')](0xcc)[_0x3785('0x24')]();});}};}function handleEntityNotFound(_0x31d21a,_0x26e9ee){return function(_0x335197){if(!_0x335197){_0x31d21a[_0x3785('0x17')](0x194);}return _0x335197;};}function handleError(_0x5c7487,_0x5c35ae){_0x5c35ae=_0x5c35ae||0x1f4;return function(_0x329248){logger[_0x3785('0x25')](_0x329248['stack']);if(_0x329248[_0x3785('0x26')]){delete _0x329248[_0x3785('0x26')];}_0x5c7487[_0x3785('0x18')](_0x5c35ae)['send'](_0x329248);};}exports[_0x3785('0x27')]=function(_0x388049,_0x1b08af){var _0xe4ff62={},_0xa4711a={},_0x50c6f8={'count':0x0,'rows':[]};var _0x4494ee=_[_0x3785('0x28')](db['AnalyticFieldReport'][_0x3785('0x29')],function(_0x550c66){return{'name':_0x550c66[_0x3785('0x2a')],'type':_0x550c66['type']['key']};});_0xa4711a[_0x3785('0x2b')]=_[_0x3785('0x28')](_0x4494ee,_0x3785('0x26'));_0xa4711a['query']=_['keys'](_0x388049[_0x3785('0x2c')]);_0xa4711a['filters']=_['intersection'](_0xa4711a['model'],_0xa4711a[_0x3785('0x2c')]);_0xe4ff62[_0x3785('0x2d')]=_['intersection'](_0xa4711a[_0x3785('0x2b')],qs['fields'](_0x388049[_0x3785('0x2c')][_0x3785('0x2e')]));_0xe4ff62[_0x3785('0x2d')]=_0xe4ff62[_0x3785('0x2d')][_0x3785('0x2f')]?_0xe4ff62[_0x3785('0x2d')]:_0xa4711a[_0x3785('0x2b')];if(!_0x388049[_0x3785('0x2c')][_0x3785('0x30')](_0x3785('0x31'))){_0xe4ff62[_0x3785('0x1a')]=qs[_0x3785('0x1a')](_0x388049[_0x3785('0x2c')][_0x3785('0x1a')]);_0xe4ff62['offset']=qs[_0x3785('0x19')](_0x388049[_0x3785('0x2c')][_0x3785('0x19')]);}_0xe4ff62[_0x3785('0x32')]=qs[_0x3785('0x33')](_0x388049[_0x3785('0x2c')]['sort']);_0xe4ff62['where']=qs['filters'](_['pick'](_0x388049[_0x3785('0x2c')],_0xa4711a[_0x3785('0x34')]),_0x4494ee);if(_0x388049[_0x3785('0x2c')][_0x3785('0x35')]){_0xe4ff62[_0x3785('0x36')]=_[_0x3785('0x37')](_0xe4ff62[_0x3785('0x36')],{'$or':_[_0x3785('0x28')](_0x4494ee,function(_0x4d6dfb){if(_0x4d6dfb[_0x3785('0x38')]!==_0x3785('0x39')){var _0x4fa32f={};_0x4fa32f[_0x4d6dfb['name']]={'$like':'%'+_0x388049['query'][_0x3785('0x35')]+'%'};return _0x4fa32f;}})});}_0xe4ff62=_[_0x3785('0x37')]({},_0xe4ff62,_0x388049[_0x3785('0x3a')]);var _0x1dd603={'where':_0xe4ff62[_0x3785('0x36')]};return db[_0x3785('0x3b')]['count'](_0x1dd603)[_0x3785('0x22')](function(_0x39f751){_0x50c6f8[_0x3785('0x1c')]=_0x39f751;if(_0x388049[_0x3785('0x2c')]['includeAll']){_0xe4ff62[_0x3785('0x3c')]=[{'all':!![]}];}return db[_0x3785('0x3b')]['findAll'](_0xe4ff62);})[_0x3785('0x22')](function(_0x2fa772){_0x50c6f8['rows']=_0x2fa772;return _0x50c6f8;})[_0x3785('0x22')](respondWithFilteredResult(_0x1b08af,_0xe4ff62))['catch'](handleError(_0x1b08af,null));};exports[_0x3785('0x3d')]=function(_0x4b4c0e,_0xf5db4c){var _0x49a223={'raw':![],'where':{'id':_0x4b4c0e[_0x3785('0x3e')]['id']}},_0x34a6f1={};_0x34a6f1[_0x3785('0x2b')]=_[_0x3785('0x3f')](db['AnalyticFieldReport'][_0x3785('0x29')]);_0x34a6f1['query']=_[_0x3785('0x3f')](_0x4b4c0e[_0x3785('0x2c')]);_0x34a6f1[_0x3785('0x34')]=_['intersection'](_0x34a6f1[_0x3785('0x2b')],_0x34a6f1[_0x3785('0x2c')]);_0x49a223[_0x3785('0x2d')]=_[_0x3785('0x40')](_0x34a6f1[_0x3785('0x2b')],qs[_0x3785('0x2e')](_0x4b4c0e[_0x3785('0x2c')][_0x3785('0x2e')]));_0x49a223[_0x3785('0x2d')]=_0x49a223['attributes'][_0x3785('0x2f')]?_0x49a223[_0x3785('0x2d')]:_0x34a6f1['model'];if(_0x4b4c0e['query'][_0x3785('0x41')]){_0x49a223[_0x3785('0x3c')]=[{'all':!![]}];}_0x49a223=_[_0x3785('0x37')]({},_0x49a223,_0x4b4c0e[_0x3785('0x3a')]);return db[_0x3785('0x3b')][_0x3785('0x42')](_0x49a223)[_0x3785('0x22')](handleEntityNotFound(_0xf5db4c,null))[_0x3785('0x22')](respondWithResult(_0xf5db4c,null))[_0x3785('0x43')](handleError(_0xf5db4c,null));};exports[_0x3785('0x44')]=function(_0x790f84,_0x2f7b5e){return db[_0x3785('0x3b')][_0x3785('0x44')](_0x790f84['body'],{})[_0x3785('0x22')](respondWithResult(_0x2f7b5e,0xc9))[_0x3785('0x43')](handleError(_0x2f7b5e,null));};exports[_0x3785('0x45')]=function(_0x50974a,_0x576ff3){return db['AnalyticFieldReport']['bulkCreate'](_0x50974a[_0x3785('0x46')],{'raw':![],'individualHooks':!![]})[_0x3785('0x22')](respondWithResult(_0x576ff3,0xc9))[_0x3785('0x43')](handleError(_0x576ff3,null));};exports['update']=function(_0x2a296c,_0x491925){if(_0x2a296c['body']['id']){delete _0x2a296c[_0x3785('0x46')]['id'];}return db[_0x3785('0x3b')][_0x3785('0x42')]({'where':{'id':_0x2a296c[_0x3785('0x3e')]['id']}})[_0x3785('0x22')](handleEntityNotFound(_0x491925,null))[_0x3785('0x22')](saveUpdates(_0x2a296c['body'],null))[_0x3785('0x22')](respondWithResult(_0x491925,null))[_0x3785('0x43')](handleError(_0x491925,null));};exports[_0x3785('0x23')]=function(_0x5cb069,_0x3fb4c8){return db[_0x3785('0x3b')][_0x3785('0x42')]({'where':{'id':_0x5cb069[_0x3785('0x3e')]['id']}})[_0x3785('0x22')](handleEntityNotFound(_0x3fb4c8,null))[_0x3785('0x22')](removeEntity(_0x3fb4c8,null))[_0x3785('0x43')](handleError(_0x3fb4c8,null));};exports[_0x3785('0x47')]=function(_0x1cb104,_0x2ffa4b){return db['AnalyticFieldReport'][_0x3785('0x23')]({'where':{'id':_0x1cb104[_0x3785('0x2c')][_0x3785('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x3785('0x22')](respondWithResult(_0x2ffa4b,0xcc))['catch'](handleError(_0x2ffa4b,null));};exports[_0x3785('0x49')]=function(_0x33f609,_0x4e6b99,_0x2cf8d0){return db[_0x3785('0x4a')]['findOne']({'where':{'id':_0x33f609['params']['id']}})[_0x3785('0x22')](handleEntityNotFound(_0x4e6b99,null))[_0x3785('0x22')](function(_0x59d7cc){if(_0x59d7cc){return db['sequelize']['transaction'](function(_0x50dab4){return db[_0x3785('0x3b')]['destroy']({'where':{'CustomReportId':_0x33f609['params']['id']},'transaction':_0x50dab4})['then'](function(_0x4f1ec0){var _0x3e644e=_[_0x3785('0x28')](_0x33f609[_0x3785('0x46')],function(_0x3223ed){delete _0x3223ed['id'];_0x3223ed[_0x3785('0x4b')]=_0x33f609[_0x3785('0x3e')]['id'];return _0x3223ed;});return db[_0x3785('0x3b')][_0x3785('0x45')](_0x3e644e,{'transaction':_0x50dab4});});})[_0x3785('0x22')](function(){return db[_0x3785('0x3b')]['findAll']({'where':{'CustomReportId':_0x33f609[_0x3785('0x3e')]['id']}});});}})[_0x3785('0x22')](respondWithResult(_0x4e6b99,null))[_0x3785('0x43')](handleError(_0x4e6b99,null));};
\ No newline at end of file
+var _0x400a=['limit','count','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','name','send','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','AnalyticFieldReport','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','catch','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined'];(function(_0x2d9c6a,_0x59393d){var _0xf3c918=function(_0x4f3f26){while(--_0x4f3f26){_0x2d9c6a['push'](_0x2d9c6a['shift']());}};_0xf3c918(++_0x59393d);}(_0x400a,0x18b));var _0xa400=function(_0x15ba86,_0x2a85de){_0x15ba86=_0x15ba86-0x0;var _0x45b830=_0x400a[_0x15ba86];return _0x45b830;};'use strict';var emlformat=require(_0xa400('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa400('0x1'));var jsonpatch=require(_0xa400('0x2'));var rp=require(_0xa400('0x3'));var moment=require(_0xa400('0x4'));var BPromise=require(_0xa400('0x5'));var Mustache=require(_0xa400('0x6'));var util=require(_0xa400('0x7'));var path=require('path');var sox=require(_0xa400('0x8'));var csv=require(_0xa400('0x9'));var ejs=require(_0xa400('0xa'));var fs=require('fs');var fs_extra=require(_0xa400('0xb'));var _=require(_0xa400('0xc'));var squel=require(_0xa400('0xd'));var crypto=require(_0xa400('0xe'));var jsforce=require(_0xa400('0xf'));var deskjs=require(_0xa400('0x10'));var toCsv=require(_0xa400('0x9'));var querystring=require(_0xa400('0x11'));var Papa=require(_0xa400('0x12'));var Redis=require(_0xa400('0x13'));var authService=require(_0xa400('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xa400('0x15'));var hardwareService=require(_0xa400('0x16'));var logger=require(_0xa400('0x17'))('api');var utils=require(_0xa400('0x18'));var config=require(_0xa400('0x19'));var licenseUtil=require(_0xa400('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fc8a3,_0x2161b6){_0x2161b6=_0x2161b6||0xcc;return function(_0x15f005){if(_0x15f005){return _0x2fc8a3['sendStatus'](_0x2161b6);}return _0x2fc8a3[_0xa400('0x1b')](_0x2161b6)['end']();};}function respondWithResult(_0x283653,_0x5de8bb){_0x5de8bb=_0x5de8bb||0xc8;return function(_0x543f02){if(_0x543f02){return _0x283653[_0xa400('0x1b')](_0x5de8bb)['json'](_0x543f02);}};}function respondWithFilteredResult(_0x575dc9,_0x5f3059){return function(_0x5ea145){if(_0x5ea145){var _0xddd10d=typeof _0x5f3059[_0xa400('0x1c')]===_0xa400('0x1d')&&typeof _0x5f3059[_0xa400('0x1e')]===_0xa400('0x1d');var _0x435902=_0x5ea145[_0xa400('0x1f')];var _0x30ed2b=_0xddd10d?0x0:_0x5f3059[_0xa400('0x1c')];var _0x4fde7b=_0xddd10d?_0x5ea145[_0xa400('0x1f')]:_0x5f3059[_0xa400('0x1c')]+_0x5f3059[_0xa400('0x1e')];var _0x5ed2f6;if(_0x4fde7b>=_0x435902){_0x4fde7b=_0x435902;_0x5ed2f6=0xc8;}else{_0x5ed2f6=0xce;}_0x575dc9['status'](_0x5ed2f6);return _0x575dc9['set'](_0xa400('0x20'),_0x30ed2b+'-'+_0x4fde7b+'/'+_0x435902)[_0xa400('0x21')](_0x5ea145);}return null;};}function patchUpdates(_0x4dcd71){return function(_0xdd5b9e){try{jsonpatch[_0xa400('0x22')](_0xdd5b9e,_0x4dcd71,!![]);}catch(_0xa95332){return BPromise[_0xa400('0x23')](_0xa95332);}return _0xdd5b9e[_0xa400('0x24')]();};}function saveUpdates(_0x32fb18,_0x46bafb){return function(_0x45db82){if(_0x45db82){return _0x45db82[_0xa400('0x25')](_0x32fb18)[_0xa400('0x26')](function(_0xeff1b2){return _0xeff1b2;});}return null;};}function removeEntity(_0x47e094,_0x579c46){return function(_0xa49e5b){if(_0xa49e5b){return _0xa49e5b[_0xa400('0x27')]()[_0xa400('0x26')](function(){_0x47e094[_0xa400('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x230cd6,_0x512d3c){return function(_0x11f4c5){if(!_0x11f4c5){_0x230cd6[_0xa400('0x28')](0x194);}return _0x11f4c5;};}function handleError(_0x20ef2a,_0x42b805){_0x42b805=_0x42b805||0x1f4;return function(_0x3e64fa){logger['error'](_0x3e64fa['stack']);if(_0x3e64fa[_0xa400('0x29')]){delete _0x3e64fa['name'];}_0x20ef2a[_0xa400('0x1b')](_0x42b805)[_0xa400('0x2a')](_0x3e64fa);};}exports['index']=function(_0x40bb42,_0x1db934){var _0xa92d6d={},_0x1c3b3b={},_0x10c8a9={'count':0x0,'rows':[]};var _0x494a80=_[_0xa400('0x2b')](db['AnalyticFieldReport']['rawAttributes'],function(_0x20baec){return{'name':_0x20baec[_0xa400('0x2c')],'type':_0x20baec[_0xa400('0x2d')][_0xa400('0x2e')]};});_0x1c3b3b[_0xa400('0x2f')]=_[_0xa400('0x2b')](_0x494a80,_0xa400('0x29'));_0x1c3b3b[_0xa400('0x30')]=_[_0xa400('0x31')](_0x40bb42['query']);_0x1c3b3b[_0xa400('0x32')]=_[_0xa400('0x33')](_0x1c3b3b[_0xa400('0x2f')],_0x1c3b3b[_0xa400('0x30')]);_0xa92d6d[_0xa400('0x34')]=_['intersection'](_0x1c3b3b[_0xa400('0x2f')],qs[_0xa400('0x35')](_0x40bb42[_0xa400('0x30')][_0xa400('0x35')]));_0xa92d6d[_0xa400('0x34')]=_0xa92d6d[_0xa400('0x34')]['length']?_0xa92d6d['attributes']:_0x1c3b3b['model'];if(!_0x40bb42[_0xa400('0x30')][_0xa400('0x36')](_0xa400('0x37'))){_0xa92d6d[_0xa400('0x1e')]=qs['limit'](_0x40bb42['query'][_0xa400('0x1e')]);_0xa92d6d[_0xa400('0x1c')]=qs['offset'](_0x40bb42[_0xa400('0x30')][_0xa400('0x1c')]);}_0xa92d6d[_0xa400('0x38')]=qs['sort'](_0x40bb42['query'][_0xa400('0x39')]);_0xa92d6d[_0xa400('0x3a')]=qs[_0xa400('0x32')](_[_0xa400('0x3b')](_0x40bb42[_0xa400('0x30')],_0x1c3b3b[_0xa400('0x32')]),_0x494a80);if(_0x40bb42[_0xa400('0x30')]['filter']){_0xa92d6d[_0xa400('0x3a')]=_[_0xa400('0x3c')](_0xa92d6d['where'],{'$or':_['map'](_0x494a80,function(_0xdf7cf2){if(_0xdf7cf2[_0xa400('0x2d')]!==_0xa400('0x3d')){var _0x582426={};_0x582426[_0xdf7cf2[_0xa400('0x29')]]={'$like':'%'+_0x40bb42[_0xa400('0x30')][_0xa400('0x3e')]+'%'};return _0x582426;}})});}_0xa92d6d=_['merge']({},_0xa92d6d,_0x40bb42[_0xa400('0x3f')]);var _0x7e6204={'where':_0xa92d6d[_0xa400('0x3a')]};return db[_0xa400('0x40')][_0xa400('0x1f')](_0x7e6204)[_0xa400('0x26')](function(_0x57501c){_0x10c8a9[_0xa400('0x1f')]=_0x57501c;if(_0x40bb42[_0xa400('0x30')][_0xa400('0x41')]){_0xa92d6d[_0xa400('0x42')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xa400('0x43')](_0xa92d6d);})[_0xa400('0x26')](function(_0x201b3f){_0x10c8a9[_0xa400('0x44')]=_0x201b3f;return _0x10c8a9;})['then'](respondWithFilteredResult(_0x1db934,_0xa92d6d))['catch'](handleError(_0x1db934,null));};exports[_0xa400('0x45')]=function(_0x118a60,_0x3d0c4c){var _0x20421={'raw':![],'where':{'id':_0x118a60[_0xa400('0x46')]['id']}},_0x499350={};_0x499350['model']=_[_0xa400('0x31')](db[_0xa400('0x40')][_0xa400('0x47')]);_0x499350[_0xa400('0x30')]=_[_0xa400('0x31')](_0x118a60[_0xa400('0x30')]);_0x499350[_0xa400('0x32')]=_[_0xa400('0x33')](_0x499350[_0xa400('0x2f')],_0x499350[_0xa400('0x30')]);_0x20421[_0xa400('0x34')]=_['intersection'](_0x499350[_0xa400('0x2f')],qs['fields'](_0x118a60[_0xa400('0x30')][_0xa400('0x35')]));_0x20421['attributes']=_0x20421[_0xa400('0x34')][_0xa400('0x48')]?_0x20421[_0xa400('0x34')]:_0x499350[_0xa400('0x2f')];if(_0x118a60[_0xa400('0x30')][_0xa400('0x41')]){_0x20421[_0xa400('0x42')]=[{'all':!![]}];}_0x20421=_[_0xa400('0x3c')]({},_0x20421,_0x118a60[_0xa400('0x3f')]);return db[_0xa400('0x40')][_0xa400('0x49')](_0x20421)['then'](handleEntityNotFound(_0x3d0c4c,null))[_0xa400('0x26')](respondWithResult(_0x3d0c4c,null))[_0xa400('0x4a')](handleError(_0x3d0c4c,null));};exports[_0xa400('0x4b')]=function(_0x2bcff7,_0x499953){return db[_0xa400('0x40')][_0xa400('0x4b')](_0x2bcff7['body'],{})[_0xa400('0x26')](respondWithResult(_0x499953,0xc9))[_0xa400('0x4a')](handleError(_0x499953,null));};exports['bulkCreate']=function(_0x3f40bf,_0x57a15b){return db['AnalyticFieldReport'][_0xa400('0x4c')](_0x3f40bf[_0xa400('0x4d')],{'raw':![],'individualHooks':!![]})[_0xa400('0x26')](respondWithResult(_0x57a15b,0xc9))['catch'](handleError(_0x57a15b,null));};exports[_0xa400('0x25')]=function(_0x6e44dc,_0x3666e7){if(_0x6e44dc[_0xa400('0x4d')]['id']){delete _0x6e44dc[_0xa400('0x4d')]['id'];}return db[_0xa400('0x40')][_0xa400('0x49')]({'where':{'id':_0x6e44dc[_0xa400('0x46')]['id']}})[_0xa400('0x26')](handleEntityNotFound(_0x3666e7,null))['then'](saveUpdates(_0x6e44dc[_0xa400('0x4d')],null))[_0xa400('0x26')](respondWithResult(_0x3666e7,null))[_0xa400('0x4a')](handleError(_0x3666e7,null));};exports[_0xa400('0x27')]=function(_0x17669a,_0x514102){return db[_0xa400('0x40')][_0xa400('0x49')]({'where':{'id':_0x17669a[_0xa400('0x46')]['id']}})['then'](handleEntityNotFound(_0x514102,null))['then'](removeEntity(_0x514102,null))['catch'](handleError(_0x514102,null));};exports[_0xa400('0x4e')]=function(_0x2fbd5a,_0x20cf27){return db[_0xa400('0x40')][_0xa400('0x27')]({'where':{'id':_0x2fbd5a[_0xa400('0x30')][_0xa400('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0xa400('0x26')](respondWithResult(_0x20cf27,0xcc))[_0xa400('0x4a')](handleError(_0x20cf27,null));};exports[_0xa400('0x50')]=function(_0x174c6b,_0x49571a,_0x1bacf9){return db[_0xa400('0x51')]['findOne']({'where':{'id':_0x174c6b['params']['id']}})[_0xa400('0x26')](handleEntityNotFound(_0x49571a,null))['then'](function(_0x282afa){if(_0x282afa){return db[_0xa400('0x52')][_0xa400('0x53')](function(_0x4e092d){return db[_0xa400('0x40')]['destroy']({'where':{'CustomReportId':_0x174c6b['params']['id']},'transaction':_0x4e092d})['then'](function(_0xd1aeb1){var _0x1f7fda=_['map'](_0x174c6b[_0xa400('0x4d')],function(_0x525e17){delete _0x525e17['id'];_0x525e17[_0xa400('0x54')]=_0x174c6b[_0xa400('0x46')]['id'];return _0x525e17;});return db[_0xa400('0x40')][_0xa400('0x4c')](_0x1f7fda,{'transaction':_0x4e092d});});})[_0xa400('0x26')](function(){return db[_0xa400('0x40')][_0xa400('0x43')]({'where':{'CustomReportId':_0x174c6b['params']['id']}});});}})[_0xa400('0x26')](respondWithResult(_0x49571a,null))[_0xa400('0x4a')](handleError(_0x49571a,null));};
\ No newline at end of file
index d23779d..5f0df83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cae=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x378507,_0x28b8ca){var _0x153297=function(_0x4808f6){while(--_0x4808f6){_0x378507['push'](_0x378507['shift']());}};_0x153297(++_0x28b8ca);}(_0x5cae,0x1ce));var _0xe5ca=function(_0x5b21a2,_0x2c6461){_0x5b21a2=_0x5b21a2-0x0;var _0x57166b=_0x5cae[_0x5b21a2];return _0x57166b;};'use strict';var _=require(_0xe5ca('0x0'));var util=require(_0xe5ca('0x1'));var logger=require(_0xe5ca('0x2'))('api');var moment=require(_0xe5ca('0x3'));var BPromise=require(_0xe5ca('0x4'));var rp=require(_0xe5ca('0x5'));var fs=require('fs');var path=require(_0xe5ca('0x6'));var rimraf=require(_0xe5ca('0x7'));var config=require(_0xe5ca('0x8'));var attributes=require(_0xe5ca('0x9'));module[_0xe5ca('0xa')]=function(_0x5627c1,_0x25ebdb){return _0x5627c1['define'](_0xe5ca('0xb'),attributes,{'tableName':_0xe5ca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3797=['AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./analyticFieldReport.attributes','exports'];(function(_0x421bec,_0x5efe48){var _0x26ad85=function(_0x30cdad){while(--_0x30cdad){_0x421bec['push'](_0x421bec['shift']());}};_0x26ad85(++_0x5efe48);}(_0x3797,0x157));var _0x7379=function(_0x25fe30,_0x39b37f){_0x25fe30=_0x25fe30-0x0;var _0x5d15e2=_0x3797[_0x25fe30];return _0x5d15e2;};'use strict';var _=require(_0x7379('0x0'));var util=require(_0x7379('0x1'));var logger=require(_0x7379('0x2'))(_0x7379('0x3'));var moment=require(_0x7379('0x4'));var BPromise=require('bluebird');var rp=require(_0x7379('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7379('0x6'));var config=require('../../config/environment');var attributes=require(_0x7379('0x7'));module[_0x7379('0x8')]=function(_0x49cff6,_0x4d78ef){return _0x49cff6['define'](_0x7379('0x9'),attributes,{'tableName':_0x7379('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9619231..34f79a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fea=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','request\x20sent','debug','error','AnalyticFieldReport,\x20%s,\x20%s','message','info'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x7fea,0x130));var _0xa7fe=function(_0x4b4b56,_0x4d3e8e){_0x4b4b56=_0x4b4b56-0x0;var _0x250078=_0x7fea[_0x4b4b56];return _0x250078;};'use strict';var _=require(_0xa7fe('0x0'));var util=require(_0xa7fe('0x1'));var moment=require(_0xa7fe('0x2'));var BPromise=require(_0xa7fe('0x3'));var rs=require(_0xa7fe('0x4'));var fs=require('fs');var Redis=require(_0xa7fe('0x5'));var db=require(_0xa7fe('0x6'))['db'];var utils=require(_0xa7fe('0x7'));var logger=require('../../config/logger')(_0xa7fe('0x8'));var config=require(_0xa7fe('0x9'));var jayson=require(_0xa7fe('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4eb581,_0x329ac4,_0x259ba7){return new BPromise(function(_0x329edb,_0x1e2511){return client[_0xa7fe('0xb')](_0x4eb581,_0x259ba7)[_0xa7fe('0xc')](function(_0x48e374){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x329ac4,_0xa7fe('0xd'));logger[_0xa7fe('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x329ac4,'request\x20sent',JSON['stringify'](_0x48e374));if(_0x48e374[_0xa7fe('0xf')]){if(_0x48e374[_0xa7fe('0xf')]['code']===0x1f4){logger[_0xa7fe('0xf')](_0xa7fe('0x10'),_0x329ac4,_0x48e374[_0xa7fe('0xf')][_0xa7fe('0x11')]);return _0x1e2511(_0x48e374[_0xa7fe('0xf')][_0xa7fe('0x11')]);}logger['error'](_0xa7fe('0x10'),_0x329ac4,_0x48e374['error']['message']);return _0x329edb(_0x48e374[_0xa7fe('0xf')]['message']);}else{logger[_0xa7fe('0x12')](_0xa7fe('0x10'),_0x329ac4,'request\x20sent');_0x329edb(_0x48e374['result'][_0xa7fe('0x11')]);}})['catch'](function(_0x3ec431){logger[_0xa7fe('0xf')](_0xa7fe('0x10'),_0x329ac4,_0x3ec431);_0x1e2511(_0x3ec431);});});}
\ No newline at end of file
+var _0xeebf=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1e7ead,_0x7f6227){var _0x3912b2=function(_0x1eeb03){while(--_0x1eeb03){_0x1e7ead['push'](_0x1e7ead['shift']());}};_0x3912b2(++_0x7f6227);}(_0xeebf,0x114));var _0xfeeb=function(_0x431bd7,_0x47fdf6){_0x431bd7=_0x431bd7-0x0;var _0x356280=_0xeebf[_0x431bd7];return _0x356280;};'use strict';var _=require(_0xfeeb('0x0'));var util=require(_0xfeeb('0x1'));var moment=require(_0xfeeb('0x2'));var BPromise=require(_0xfeeb('0x3'));var rs=require(_0xfeeb('0x4'));var fs=require('fs');var Redis=require(_0xfeeb('0x5'));var db=require(_0xfeeb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfeeb('0x7'))(_0xfeeb('0x8'));var config=require('../../config/environment');var jayson=require(_0xfeeb('0x9'));var client=jayson[_0xfeeb('0xa')][_0xfeeb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d3f5e,_0x506b6d,_0x305fdf){return new BPromise(function(_0x5e5127,_0x442f2b){return client['request'](_0x1d3f5e,_0x305fdf)[_0xfeeb('0xc')](function(_0x2ab593){logger[_0xfeeb('0xd')](_0xfeeb('0xe'),_0x506b6d,_0xfeeb('0xf'));logger['debug'](_0xfeeb('0x10'),_0x506b6d,_0xfeeb('0xf'),JSON[_0xfeeb('0x11')](_0x2ab593));if(_0x2ab593[_0xfeeb('0x12')]){if(_0x2ab593[_0xfeeb('0x12')][_0xfeeb('0x13')]===0x1f4){logger[_0xfeeb('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x506b6d,_0x2ab593[_0xfeeb('0x12')]['message']);return _0x442f2b(_0x2ab593[_0xfeeb('0x12')][_0xfeeb('0x14')]);}logger[_0xfeeb('0x12')](_0xfeeb('0xe'),_0x506b6d,_0x2ab593[_0xfeeb('0x12')][_0xfeeb('0x14')]);return _0x5e5127(_0x2ab593['error'][_0xfeeb('0x14')]);}else{logger[_0xfeeb('0xd')](_0xfeeb('0xe'),_0x506b6d,_0xfeeb('0xf'));_0x5e5127(_0x2ab593[_0xfeeb('0x15')][_0xfeeb('0x14')]);}})[_0xfeeb('0x16')](function(_0x307dbf){logger[_0xfeeb('0x12')](_0xfeeb('0xe'),_0x506b6d,_0x307dbf);_0x442f2b(_0x307dbf);});});}
\ No newline at end of file
index 612e17b..331e7f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x54acc9,_0x13c2ab){var _0x189fb0=function(_0x4ab002){while(--_0x4ab002){_0x54acc9['push'](_0x54acc9['shift']());}};_0x189fb0(++_0x13c2ab);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x22e19d,_0x121e11){var _0x412858=function(_0x321751){while(--_0x321751){_0x22e19d['push'](_0x22e19d['shift']());}};_0x412858(++_0x121e11);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
index 30b80f4..2b975e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb49a=['exports','STRING','name','sequelize'];(function(_0x21072f,_0x47b0f0){var _0x140d62=function(_0x1b0c71){while(--_0x1b0c71){_0x21072f['push'](_0x21072f['shift']());}};_0x140d62(++_0x47b0f0);}(_0xb49a,0xfb));var _0xab49=function(_0x3420bd,_0x34703d){_0x3420bd=_0x3420bd-0x0;var _0x5c7793=_0xb49a[_0x3420bd];return _0x5c7793;};'use strict';var Sequelize=require(_0xab49('0x0'));module[_0xab49('0x1')]={'name':{'type':Sequelize[_0xab49('0x2')],'allowNull':![],'unique':_0xab49('0x3')},'table':{'type':Sequelize[_0xab49('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xab49('0x2')]}};
\ No newline at end of file
+var _0xea28=['exports','STRING','name','TEXT','sequelize'];(function(_0xe8e4b4,_0x5b8a78){var _0x46d16d=function(_0x590093){while(--_0x590093){_0xe8e4b4['push'](_0xe8e4b4['shift']());}};_0x46d16d(++_0x5b8a78);}(_0xea28,0x13a));var _0x8ea2=function(_0x658684,_0x3b356e){_0x658684=_0x658684-0x0;var _0x192f71=_0xea28[_0x658684];return _0x192f71;};'use strict';var Sequelize=require(_0x8ea2('0x0'));module[_0x8ea2('0x1')]={'name':{'type':Sequelize[_0x8ea2('0x2')],'allowNull':![],'unique':_0x8ea2('0x3')},'table':{'type':Sequelize[_0x8ea2('0x2')]},'metric':{'type':Sequelize[_0x8ea2('0x4')]},'description':{'type':Sequelize[_0x8ea2('0x2')]}};
\ No newline at end of file
index ba25022..2e8c036 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81bd=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Metrics','stack','name','send','index','map','fieldName','query','keys'];(function(_0xcdc46b,_0x5007bf){var _0x4f46cb=function(_0xee0bfa){while(--_0xee0bfa){_0xcdc46b['push'](_0xcdc46b['shift']());}};_0x4f46cb(++_0x5007bf);}(_0x81bd,0x7c));var _0xd81b=function(_0xc9df8b,_0x21744d){_0xc9df8b=_0xc9df8b-0x0;var _0x35ca5d=_0x81bd[_0xc9df8b];return _0x35ca5d;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){var _0x341aec=_0xcb4f91[_0xd81b('0x2a')]({'plain':!![]});var _0x2ccedf=_0xd81b('0x2b');return db['UserProfileResource'][_0xd81b('0x29')]({'where':{'type':_0x2ccedf,'resourceId':_0x341aec['id']}})[_0xd81b('0x28')](function(){return _0xcb4f91;});})[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2d0d02,_0x3e28dd){return function(_0x73dc09){if(!_0x73dc09){_0x2d0d02[_0xd81b('0x1b')](0x194);}return _0x73dc09;};}function handleError(_0x483a3d,_0x469cc4){_0x469cc4=_0x469cc4||0x1f4;return function(_0x4e2eff){logger['error'](_0x4e2eff[_0xd81b('0x2c')]);if(_0x4e2eff[_0xd81b('0x2d')]){delete _0x4e2eff['name'];}_0x483a3d['status'](_0x469cc4)[_0xd81b('0x2e')](_0x4e2eff);};}exports[_0xd81b('0x2f')]=function(_0x1b1434,_0x289f54){var _0x1a1572={},_0x4654ba={},_0x5527ed={'count':0x0,'rows':[]};var _0x37d381=_[_0xd81b('0x30')](db['AnalyticMetric']['rawAttributes'],function(_0x165892){return{'name':_0x165892[_0xd81b('0x31')],'type':_0x165892['type']['key']};});_0x4654ba['model']=_[_0xd81b('0x30')](_0x37d381,_0xd81b('0x2d'));_0x4654ba[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x1b1434[_0xd81b('0x32')]);_0x4654ba[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x4654ba['model'],_0x4654ba[_0xd81b('0x32')]);_0x1a1572['attributes']=_[_0xd81b('0x35')](_0x4654ba[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x37')]));_0x1a1572[_0xd81b('0x38')]=_0x1a1572[_0xd81b('0x38')][_0xd81b('0x39')]?_0x1a1572[_0xd81b('0x38')]:_0x4654ba[_0xd81b('0x36')];if(!_0x1b1434[_0xd81b('0x32')][_0xd81b('0x3a')](_0xd81b('0x3b'))){_0x1a1572['limit']=qs['limit'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x20')]);_0x1a1572[_0xd81b('0x22')]=qs['offset'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x22')]);}_0x1a1572['order']=qs[_0xd81b('0x3c')](_0x1b1434[_0xd81b('0x32')]['sort']);_0x1a1572[_0xd81b('0x3d')]=qs['filters'](_[_0xd81b('0x3e')](_0x1b1434[_0xd81b('0x32')],_0x4654ba[_0xd81b('0x34')]),_0x37d381);if(_0x1b1434[_0xd81b('0x32')]['filter']){_0x1a1572[_0xd81b('0x3d')]=_[_0xd81b('0x3f')](_0x1a1572[_0xd81b('0x3d')],{'$or':_[_0xd81b('0x30')](_0x37d381,function(_0x3abd60){if(_0x3abd60[_0xd81b('0x40')]!==_0xd81b('0x41')){var _0x532ada={};_0x532ada[_0x3abd60[_0xd81b('0x2d')]]={'$like':'%'+_0x1b1434[_0xd81b('0x32')][_0xd81b('0x42')]+'%'};return _0x532ada;}})});}_0x1a1572=_['merge']({},_0x1a1572,_0x1b1434[_0xd81b('0x43')]);var _0x3a05f4={'where':_0x1a1572[_0xd81b('0x3d')]};return db[_0xd81b('0x44')][_0xd81b('0x21')](_0x3a05f4)['then'](function(_0x3dfba7){_0x5527ed[_0xd81b('0x21')]=_0x3dfba7;if(_0x1b1434[_0xd81b('0x32')][_0xd81b('0x45')]){_0x1a1572[_0xd81b('0x46')]=[{'all':!![]}];}return db[_0xd81b('0x44')][_0xd81b('0x47')](_0x1a1572);})[_0xd81b('0x28')](function(_0x4405a8){_0x5527ed[_0xd81b('0x48')]=_0x4405a8;return _0x5527ed;})[_0xd81b('0x28')](respondWithFilteredResult(_0x289f54,_0x1a1572))['catch'](handleError(_0x289f54,null));};exports[_0xd81b('0x49')]=function(_0x2778b3,_0x25824e){var _0xa5e391={'raw':!![],'where':{'id':_0x2778b3[_0xd81b('0x4a')]['id']}},_0x1e6654={};_0x1e6654[_0xd81b('0x36')]=_[_0xd81b('0x33')](db['AnalyticMetric']['rawAttributes']);_0x1e6654[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x2778b3[_0xd81b('0x32')]);_0x1e6654[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],_0x1e6654[_0xd81b('0x32')]);_0xa5e391[_0xd81b('0x38')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x2778b3[_0xd81b('0x32')]['fields']));_0xa5e391[_0xd81b('0x38')]=_0xa5e391[_0xd81b('0x38')][_0xd81b('0x39')]?_0xa5e391[_0xd81b('0x38')]:_0x1e6654[_0xd81b('0x36')];if(_0x2778b3[_0xd81b('0x32')][_0xd81b('0x45')]){_0xa5e391[_0xd81b('0x46')]=[{'all':!![]}];}_0xa5e391=_[_0xd81b('0x3f')]({},_0xa5e391,_0x2778b3['options']);return db[_0xd81b('0x44')][_0xd81b('0x4b')](_0xa5e391)[_0xd81b('0x28')](handleEntityNotFound(_0x25824e,null))[_0xd81b('0x28')](respondWithResult(_0x25824e,null))['catch'](handleError(_0x25824e,null));};exports[_0xd81b('0x4c')]=function(_0x151127,_0x15030b){return db[_0xd81b('0x44')][_0xd81b('0x4c')](_0x151127[_0xd81b('0x4d')],{})[_0xd81b('0x28')](function(_0x43d7ce){var _0x133a76=_0x151127['user']['get']({'plain':!![]});if(!_0x133a76)throw new Error(_0xd81b('0x4e'));if(_0x133a76[_0xd81b('0x4f')]===_0xd81b('0x50')){var _0x4da281=_0x43d7ce[_0xd81b('0x2a')]({'plain':!![]});var _0x3d6ab3=_0xd81b('0x2b');return db[_0xd81b('0x51')]['find']({'where':{'name':_0x3d6ab3,'userProfileId':_0x133a76[_0xd81b('0x52')]},'raw':!![]})[_0xd81b('0x28')](function(_0x1b523c){if(_0x1b523c&&_0x1b523c[_0xd81b('0x53')]===0x0){return db[_0xd81b('0x54')]['create']({'name':_0x4da281[_0xd81b('0x2d')],'resourceId':_0x4da281['id'],'type':_0x1b523c[_0xd81b('0x2d')],'sectionId':_0x1b523c['id']},{})['then'](function(){return _0x43d7ce;});}else{return _0x43d7ce;}})[_0xd81b('0x55')](function(_0x315bd5){logger[_0xd81b('0x56')](_0xd81b('0x57'),_0x315bd5);throw _0x315bd5;});}return _0x43d7ce;})[_0xd81b('0x28')](respondWithResult(_0x15030b,0xc9))[_0xd81b('0x55')](handleError(_0x15030b,null));};exports[_0xd81b('0x27')]=function(_0x22f588,_0x3ed626){if(_0x22f588[_0xd81b('0x4d')]['id']){delete _0x22f588[_0xd81b('0x4d')]['id'];}return db['AnalyticMetric'][_0xd81b('0x4b')]({'where':{'id':_0x22f588['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x3ed626,null))[_0xd81b('0x28')](saveUpdates(_0x22f588[_0xd81b('0x4d')],null))[_0xd81b('0x28')](respondWithResult(_0x3ed626,null))[_0xd81b('0x55')](handleError(_0x3ed626,null));};exports[_0xd81b('0x29')]=function(_0x5c196a,_0x2d978d){return db[_0xd81b('0x44')]['find']({'where':{'id':_0x5c196a['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2d978d,null))['then'](removeEntity(_0x2d978d,null))[_0xd81b('0x55')](handleError(_0x2d978d,null));};
\ No newline at end of file
+var _0x55ca=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','get','Metrics','UserProfileResource','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','AnalyticMetric','findAll','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5be8a0,_0x5f18ae){var _0x1ce890=function(_0xfb7e75){while(--_0xfb7e75){_0x5be8a0['push'](_0x5be8a0['shift']());}};_0x1ce890(++_0x5f18ae);}(_0x55ca,0x126));var _0xa55c=function(_0x7aee79,_0x124af2){_0x7aee79=_0x7aee79-0x0;var _0xcbf9d1=_0x55ca[_0x7aee79];return _0xcbf9d1;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){var _0x54b038=_0x5ba836[_0xa55c('0x21')]({'plain':!![]});var _0x190757=_0xa55c('0x22');return db[_0xa55c('0x23')][_0xa55c('0x24')]({'where':{'type':_0x190757,'resourceId':_0x54b038['id']}})[_0xa55c('0x20')](function(){return _0x5ba836;});})[_0xa55c('0x20')](function(){_0x1fc828[_0xa55c('0x18')](0xcc)[_0xa55c('0x25')]();});}};}function handleEntityNotFound(_0x3cd152,_0x1273d7){return function(_0x57f271){if(!_0x57f271){_0x3cd152[_0xa55c('0x26')](0x194);}return _0x57f271;};}function handleError(_0x28814f,_0x1c9f6b){_0x1c9f6b=_0x1c9f6b||0x1f4;return function(_0x906caa){logger['error'](_0x906caa[_0xa55c('0x27')]);if(_0x906caa[_0xa55c('0x28')]){delete _0x906caa[_0xa55c('0x28')];}_0x28814f[_0xa55c('0x18')](_0x1c9f6b)[_0xa55c('0x29')](_0x906caa);};}exports[_0xa55c('0x2a')]=function(_0x52d37f,_0x23e698){var _0x490b7d={},_0x35c9c2={},_0x1d730b={'count':0x0,'rows':[]};var _0x1cc53e=_[_0xa55c('0x2b')](db['AnalyticMetric'][_0xa55c('0x2c')],function(_0x2096ae){return{'name':_0x2096ae[_0xa55c('0x2d')],'type':_0x2096ae[_0xa55c('0x2e')][_0xa55c('0x2f')]};});_0x35c9c2[_0xa55c('0x30')]=_[_0xa55c('0x2b')](_0x1cc53e,_0xa55c('0x28'));_0x35c9c2[_0xa55c('0x31')]=_[_0xa55c('0x32')](_0x52d37f[_0xa55c('0x31')]);_0x35c9c2['filters']=_['intersection'](_0x35c9c2[_0xa55c('0x30')],_0x35c9c2[_0xa55c('0x31')]);_0x490b7d['attributes']=_[_0xa55c('0x33')](_0x35c9c2[_0xa55c('0x30')],qs[_0xa55c('0x34')](_0x52d37f[_0xa55c('0x31')][_0xa55c('0x34')]));_0x490b7d[_0xa55c('0x35')]=_0x490b7d[_0xa55c('0x35')][_0xa55c('0x36')]?_0x490b7d[_0xa55c('0x35')]:_0x35c9c2['model'];if(!_0x52d37f['query']['hasOwnProperty'](_0xa55c('0x37'))){_0x490b7d[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x52d37f['query'][_0xa55c('0x1c')]);_0x490b7d['offset']=qs[_0xa55c('0x1a')](_0x52d37f['query'][_0xa55c('0x1a')]);}_0x490b7d[_0xa55c('0x38')]=qs[_0xa55c('0x39')](_0x52d37f['query'][_0xa55c('0x39')]);_0x490b7d[_0xa55c('0x3a')]=qs['filters'](_[_0xa55c('0x3b')](_0x52d37f[_0xa55c('0x31')],_0x35c9c2['filters']),_0x1cc53e);if(_0x52d37f['query'][_0xa55c('0x3c')]){_0x490b7d['where']=_[_0xa55c('0x3d')](_0x490b7d[_0xa55c('0x3a')],{'$or':_['map'](_0x1cc53e,function(_0x542d76){if(_0x542d76['type']!=='VIRTUAL'){var _0x3b3308={};_0x3b3308[_0x542d76[_0xa55c('0x28')]]={'$like':'%'+_0x52d37f[_0xa55c('0x31')][_0xa55c('0x3c')]+'%'};return _0x3b3308;}})});}_0x490b7d=_[_0xa55c('0x3d')]({},_0x490b7d,_0x52d37f['options']);var _0x3d52d8={'where':_0x490b7d[_0xa55c('0x3a')]};return db[_0xa55c('0x3e')][_0xa55c('0x1d')](_0x3d52d8)[_0xa55c('0x20')](function(_0x23cef5){_0x1d730b['count']=_0x23cef5;if(_0x52d37f[_0xa55c('0x31')]['includeAll']){_0x490b7d['include']=[{'all':!![]}];}return db[_0xa55c('0x3e')][_0xa55c('0x3f')](_0x490b7d);})['then'](function(_0x2bd98b){_0x1d730b['rows']=_0x2bd98b;return _0x1d730b;})['then'](respondWithFilteredResult(_0x23e698,_0x490b7d))[_0xa55c('0x40')](handleError(_0x23e698,null));};exports[_0xa55c('0x41')]=function(_0x1630ac,_0x540337){var _0x1b2708={'raw':!![],'where':{'id':_0x1630ac['params']['id']}},_0xd5a006={};_0xd5a006[_0xa55c('0x30')]=_['keys'](db[_0xa55c('0x3e')][_0xa55c('0x2c')]);_0xd5a006['query']=_[_0xa55c('0x32')](_0x1630ac[_0xa55c('0x31')]);_0xd5a006['filters']=_[_0xa55c('0x33')](_0xd5a006[_0xa55c('0x30')],_0xd5a006[_0xa55c('0x31')]);_0x1b2708['attributes']=_[_0xa55c('0x33')](_0xd5a006['model'],qs[_0xa55c('0x34')](_0x1630ac[_0xa55c('0x31')][_0xa55c('0x34')]));_0x1b2708['attributes']=_0x1b2708[_0xa55c('0x35')][_0xa55c('0x36')]?_0x1b2708['attributes']:_0xd5a006[_0xa55c('0x30')];if(_0x1630ac[_0xa55c('0x31')]['includeAll']){_0x1b2708[_0xa55c('0x42')]=[{'all':!![]}];}_0x1b2708=_[_0xa55c('0x3d')]({},_0x1b2708,_0x1630ac['options']);return db[_0xa55c('0x3e')][_0xa55c('0x43')](_0x1b2708)[_0xa55c('0x20')](handleEntityNotFound(_0x540337,null))[_0xa55c('0x20')](respondWithResult(_0x540337,null))['catch'](handleError(_0x540337,null));};exports[_0xa55c('0x44')]=function(_0x58a7ea,_0x2157d6){return db[_0xa55c('0x3e')][_0xa55c('0x44')](_0x58a7ea['body'],{})[_0xa55c('0x20')](function(_0x250b00){var _0x574fe9=_0x58a7ea[_0xa55c('0x45')][_0xa55c('0x21')]({'plain':!![]});if(!_0x574fe9)throw new Error(_0xa55c('0x46'));if(_0x574fe9[_0xa55c('0x47')]===_0xa55c('0x45')){var _0x1c84d9=_0x250b00[_0xa55c('0x21')]({'plain':!![]});var _0x129626=_0xa55c('0x22');return db[_0xa55c('0x48')]['find']({'where':{'name':_0x129626,'userProfileId':_0x574fe9[_0xa55c('0x49')]},'raw':!![]})[_0xa55c('0x20')](function(_0x216de8){if(_0x216de8&&_0x216de8['autoAssociation']===0x0){return db[_0xa55c('0x23')][_0xa55c('0x44')]({'name':_0x1c84d9['name'],'resourceId':_0x1c84d9['id'],'type':_0x216de8[_0xa55c('0x28')],'sectionId':_0x216de8['id']},{})['then'](function(){return _0x250b00;});}else{return _0x250b00;}})[_0xa55c('0x40')](function(_0x228df4){logger[_0xa55c('0x4a')](_0xa55c('0x4b'),_0x228df4);throw _0x228df4;});}return _0x250b00;})[_0xa55c('0x20')](respondWithResult(_0x2157d6,0xc9))['catch'](handleError(_0x2157d6,null));};exports[_0xa55c('0x1f')]=function(_0x4607ca,_0x4b85cc){if(_0x4607ca[_0xa55c('0x4c')]['id']){delete _0x4607ca[_0xa55c('0x4c')]['id'];}return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x4607ca['params']['id']}})['then'](handleEntityNotFound(_0x4b85cc,null))[_0xa55c('0x20')](saveUpdates(_0x4607ca[_0xa55c('0x4c')],null))[_0xa55c('0x20')](respondWithResult(_0x4b85cc,null))[_0xa55c('0x40')](handleError(_0x4b85cc,null));};exports['destroy']=function(_0x30c0c9,_0x5ce463){return db[_0xa55c('0x3e')][_0xa55c('0x43')]({'where':{'id':_0x30c0c9[_0xa55c('0x4d')]['id']}})[_0xa55c('0x20')](handleEntityNotFound(_0x5ce463,null))[_0xa55c('0x20')](removeEntity(_0x5ce463,null))['catch'](handleError(_0x5ce463,null));};
\ No newline at end of file
index acee79e..e876c7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfe8=['analytics_metrics','util','api','moment','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x221abd,_0x621d76){var _0x47e399=function(_0x3c966f){while(--_0x3c966f){_0x221abd['push'](_0x221abd['shift']());}};_0x47e399(++_0x621d76);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x2d16ef,_0x44374e){_0x2d16ef=_0x2d16ef-0x0;var _0x4e4d1f=_0xbfe8[_0x2d16ef];return _0x4e4d1f;};'use strict';var _=require('lodash');var util=require(_0x8bfe('0x0'));var logger=require('../../config/logger')(_0x8bfe('0x1'));var moment=require(_0x8bfe('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8bfe('0x3'));var rimraf=require(_0x8bfe('0x4'));var config=require('../../config/environment');var attributes=require(_0x8bfe('0x5'));module[_0x8bfe('0x6')]=function(_0x314a9a,_0x4933c9){return _0x314a9a[_0x8bfe('0x7')](_0x8bfe('0x8'),attributes,{'tableName':_0x8bfe('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe14a=['exports','define','AnalyticMetric','analytics_metrics','bluebird','request-promise','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x27d185,_0x425f42){var _0x3b0526=function(_0x43807c){while(--_0x43807c){_0x27d185['push'](_0x27d185['shift']());}};_0x3b0526(++_0x425f42);}(_0xe14a,0x94));var _0xae14=function(_0x5924e0,_0x2af250){_0x5924e0=_0x5924e0-0x0;var _0x47389b=_0xe14a[_0x5924e0];return _0x47389b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xae14('0x0'));var rp=require(_0xae14('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0xae14('0x2'));var config=require(_0xae14('0x3'));var attributes=require(_0xae14('0x4'));module[_0xae14('0x5')]=function(_0x2b5138,_0x3a6279){return _0x2b5138[_0xae14('0x6')](_0xae14('0x7'),attributes,{'tableName':_0xae14('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e4ad3cc..67daa61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd103=['stringify','error','AnalyticMetric,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','request\x20sent','debug'];(function(_0x1fbd15,_0x1cde0e){var _0x3689ab=function(_0x56158d){while(--_0x56158d){_0x1fbd15['push'](_0x1fbd15['shift']());}};_0x3689ab(++_0x1cde0e);}(_0xd103,0x1e2));var _0x3d10=function(_0x581b29,_0x355ba6){_0x581b29=_0x581b29-0x0;var _0x26fda6=_0xd103[_0x581b29];return _0x26fda6;};'use strict';var _=require(_0x3d10('0x0'));var util=require(_0x3d10('0x1'));var moment=require('moment');var BPromise=require(_0x3d10('0x2'));var rs=require(_0x3d10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3d10('0x4'));var logger=require(_0x3d10('0x5'))(_0x3d10('0x6'));var config=require('../../config/environment');var jayson=require(_0x3d10('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52333c,_0x178f1d,_0x17c049){return new BPromise(function(_0x506cde,_0x394c09){return client[_0x3d10('0x8')](_0x52333c,_0x17c049)[_0x3d10('0x9')](function(_0xd5c7b1){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x178f1d,_0x3d10('0xa'));logger[_0x3d10('0xb')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x178f1d,_0x3d10('0xa'),JSON[_0x3d10('0xc')](_0xd5c7b1));if(_0xd5c7b1['error']){if(_0xd5c7b1[_0x3d10('0xd')]['code']===0x1f4){logger[_0x3d10('0xd')](_0x3d10('0xe'),_0x178f1d,_0xd5c7b1[_0x3d10('0xd')][_0x3d10('0xf')]);return _0x394c09(_0xd5c7b1[_0x3d10('0xd')]['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x178f1d,_0xd5c7b1[_0x3d10('0xd')]['message']);return _0x506cde(_0xd5c7b1[_0x3d10('0xd')][_0x3d10('0xf')]);}else{logger[_0x3d10('0x10')](_0x3d10('0xe'),_0x178f1d,_0x3d10('0xa'));_0x506cde(_0xd5c7b1[_0x3d10('0x11')][_0x3d10('0xf')]);}})[_0x3d10('0x12')](function(_0x3b1150){logger[_0x3d10('0xd')](_0x3d10('0xe'),_0x178f1d,_0x3b1150);_0x394c09(_0x3b1150);});});}
\ No newline at end of file
+var _0xfb0f=['rpc','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','ioredis','../../config/utils','../../config/logger'];(function(_0x3b7d6,_0x3fd0e4){var _0x97f072=function(_0x9d36a1){while(--_0x9d36a1){_0x3b7d6['push'](_0x3b7d6['shift']());}};_0x97f072(++_0x3fd0e4);}(_0xfb0f,0x18c));var _0xffb0=function(_0x20e52f,_0x3107f5){_0x20e52f=_0x20e52f-0x0;var _0x338748=_0xfb0f[_0x20e52f];return _0x338748;};'use strict';var _=require(_0xffb0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xffb0('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xffb0('0x2'));var logger=require(_0xffb0('0x3'))(_0xffb0('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xffb0('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x4a1a8b,_0x4bc272,_0x3d9857){return new BPromise(function(_0x48943d,_0x53e59b){return client[_0xffb0('0x6')](_0x4a1a8b,_0x3d9857)[_0xffb0('0x7')](function(_0x283399){logger['info'](_0xffb0('0x8'),_0x4bc272,_0xffb0('0x9'));logger['debug'](_0xffb0('0xa'),_0x4bc272,_0xffb0('0x9'),JSON['stringify'](_0x283399));if(_0x283399[_0xffb0('0xb')]){if(_0x283399[_0xffb0('0xb')][_0xffb0('0xc')]===0x1f4){logger[_0xffb0('0xb')](_0xffb0('0x8'),_0x4bc272,_0x283399[_0xffb0('0xb')][_0xffb0('0xd')]);return _0x53e59b(_0x283399[_0xffb0('0xb')][_0xffb0('0xd')]);}logger[_0xffb0('0xb')](_0xffb0('0x8'),_0x4bc272,_0x283399['error']['message']);return _0x48943d(_0x283399[_0xffb0('0xb')]['message']);}else{logger[_0xffb0('0xe')](_0xffb0('0x8'),_0x4bc272,_0xffb0('0x9'));_0x48943d(_0x283399['result'][_0xffb0('0xd')]);}})[_0xffb0('0xf')](function(_0x1d175b){logger[_0xffb0('0xb')](_0xffb0('0x8'),_0x4bc272,_0x1d175b);_0x53e59b(_0x1d175b);});});}
\ No newline at end of file
index 8bfe8f2..a67c6bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4491=['../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xe4fcb6,_0x41e92e){var _0x16ca9d=function(_0x5cea72){while(--_0x5cea72){_0xe4fcb6['push'](_0xe4fcb6['shift']());}};_0x16ca9d(++_0x41e92e);}(_0x4491,0x1bb));var _0x1449=function(_0x95a2d6,_0x36d066){_0x95a2d6=_0x95a2d6-0x0;var _0xd024a4=_0x4491[_0x95a2d6];return _0xd024a4;};'use strict';var multer=require(_0x1449('0x0'));var util=require('util');var path=require(_0x1449('0x1'));var timeout=require('connect-timeout');var express=require(_0x1449('0x2'));var router=express[_0x1449('0x3')]();var fs_extra=require(_0x1449('0x4'));var auth=require(_0x1449('0x5'));var interaction=require(_0x1449('0x6'));var config=require(_0x1449('0x7'));var controller=require('./analyticMetric.controller');router[_0x1449('0x8')]('/',auth['isAuthenticated'](),controller[_0x1449('0x9')]);router[_0x1449('0x8')](_0x1449('0xa'),auth[_0x1449('0xb')](),controller[_0x1449('0xc')]);router[_0x1449('0xd')]('/',auth['isAuthenticated'](),controller[_0x1449('0xe')]);router[_0x1449('0xf')]('/:id',auth[_0x1449('0xb')](),controller[_0x1449('0x10')]);router['delete'](_0x1449('0xa'),auth[_0x1449('0xb')](),controller['destroy']);module[_0x1449('0x11')]=router;
\ No newline at end of file
+var _0x1501=['show','post','put','delete','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','isAuthenticated','index','get','/:id'];(function(_0x12a414,_0x239012){var _0x4e7063=function(_0x1fa7ec){while(--_0x1fa7ec){_0x12a414['push'](_0x12a414['shift']());}};_0x4e7063(++_0x239012);}(_0x1501,0x126));var _0x1150=function(_0x1ed08f,_0x3d499a){_0x1ed08f=_0x1ed08f-0x0;var _0x9df16c=_0x1501[_0x1ed08f];return _0x9df16c;};'use strict';var multer=require('multer');var util=require(_0x1150('0x0'));var path=require(_0x1150('0x1'));var timeout=require(_0x1150('0x2'));var express=require('express');var router=express[_0x1150('0x3')]();var fs_extra=require(_0x1150('0x4'));var auth=require(_0x1150('0x5'));var interaction=require(_0x1150('0x6'));var config=require('../../config/environment');var controller=require(_0x1150('0x7'));router['get']('/',auth[_0x1150('0x8')](),controller[_0x1150('0x9')]);router[_0x1150('0xa')](_0x1150('0xb'),auth[_0x1150('0x8')](),controller[_0x1150('0xc')]);router[_0x1150('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1150('0xe')](_0x1150('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x1150('0xf')](_0x1150('0xb'),auth[_0x1150('0x8')](),controller[_0x1150('0x10')]);module['exports']=router;
\ No newline at end of file
index 9b74af4..91ed205 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7420=['exports','sequelize'];(function(_0x2b9358,_0x5a9e10){var _0x73cce8=function(_0x2c4a6f){while(--_0x2c4a6f){_0x2b9358['push'](_0x2b9358['shift']());}};_0x73cce8(++_0x5a9e10);}(_0x7420,0x183));var _0x0742=function(_0x485ed8,_0x18043e){_0x485ed8=_0x485ed8-0x0;var _0x1863f7=_0x7420[_0x485ed8];return _0x1863f7;};'use strict';var Sequelize=require(_0x0742('0x0'));module[_0x0742('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x1936=['exports','TEXT','sequelize'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0x1936,0x1d6));var _0x6193=function(_0x438e5c,_0x13c551){_0x438e5c=_0x438e5c-0x0;var _0x2104a1=_0x1936[_0x438e5c];return _0x2104a1;};'use strict';var Sequelize=require(_0x6193('0x0'));module[_0x6193('0x1')]={'tree':{'type':Sequelize[_0x6193('0x2')],'allowNull':![]}};
\ No newline at end of file
index 69291c8..a680a9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e13=['keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','fast-json-patch','moment','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','update','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','type','query'];(function(_0x2ddc53,_0x4c5578){var _0x30d728=function(_0x4e6bb5){while(--_0x4e6bb5){_0x2ddc53['push'](_0x2ddc53['shift']());}};_0x30d728(++_0x4c5578);}(_0x8e13,0x16e));var _0x38e1=function(_0x136c6a,_0x2e5e75){_0x136c6a=_0x136c6a-0x0;var _0x339477=_0x8e13[_0x136c6a];return _0x339477;};'use strict';var emlformat=require(_0x38e1('0x0'));var rimraf=require(_0x38e1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38e1('0x2'));var rp=require('request-promise');var moment=require(_0x38e1('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x38e1('0x4'));var path=require('path');var sox=require(_0x38e1('0x5'));var csv=require('to-csv');var ejs=require(_0x38e1('0x6'));var fs=require('fs');var fs_extra=require(_0x38e1('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x38e1('0x8'));var jsforce=require(_0x38e1('0x9'));var deskjs=require(_0x38e1('0xa'));var toCsv=require(_0x38e1('0xb'));var querystring=require(_0x38e1('0xc'));var Papa=require(_0x38e1('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x38e1('0xe'));var hardwareService=require(_0x38e1('0xf'));var logger=require(_0x38e1('0x10'))(_0x38e1('0x11'));var utils=require(_0x38e1('0x12'));var config=require(_0x38e1('0x13'));var licenseUtil=require(_0x38e1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b756e,_0x39d2c8){_0x39d2c8=_0x39d2c8||0xcc;return function(_0x409b43){if(_0x409b43){return _0x4b756e[_0x38e1('0x15')](_0x39d2c8);}return _0x4b756e[_0x38e1('0x16')](_0x39d2c8)[_0x38e1('0x17')]();};}function respondWithResult(_0x4bc413,_0x38362d){_0x38362d=_0x38362d||0xc8;return function(_0x5811b9){if(_0x5811b9){return _0x4bc413[_0x38e1('0x16')](_0x38362d)[_0x38e1('0x18')](_0x5811b9);}};}function respondWithFilteredResult(_0x5ae628,_0x345885){return function(_0x1062a3){if(_0x1062a3){var _0x390eb7=typeof _0x345885[_0x38e1('0x19')]==='undefined'&&typeof _0x345885[_0x38e1('0x1a')]===_0x38e1('0x1b');var _0x17db91=_0x1062a3['count'];var _0x5b4140=_0x390eb7?0x0:_0x345885['offset'];var _0x4da3a0=_0x390eb7?_0x1062a3[_0x38e1('0x1c')]:_0x345885[_0x38e1('0x19')]+_0x345885[_0x38e1('0x1a')];var _0x1652f2;if(_0x4da3a0>=_0x17db91){_0x4da3a0=_0x17db91;_0x1652f2=0xc8;}else{_0x1652f2=0xce;}_0x5ae628[_0x38e1('0x16')](_0x1652f2);return _0x5ae628['set'](_0x38e1('0x1d'),_0x5b4140+'-'+_0x4da3a0+'/'+_0x17db91)[_0x38e1('0x18')](_0x1062a3);}return null;};}function patchUpdates(_0x2a0964){return function(_0x53a592){try{jsonpatch['apply'](_0x53a592,_0x2a0964,!![]);}catch(_0x48cf09){return BPromise['reject'](_0x48cf09);}return _0x53a592['save']();};}function saveUpdates(_0x4474b4,_0x5637b6){return function(_0x1d7a1e){if(_0x1d7a1e){return _0x1d7a1e[_0x38e1('0x1e')](_0x4474b4)['then'](function(_0x5d5e29){return _0x5d5e29;});}return null;};}function removeEntity(_0x212c1f,_0x18d989){return function(_0xfa4113){if(_0xfa4113){return _0xfa4113[_0x38e1('0x1f')]()['then'](function(){_0x212c1f[_0x38e1('0x16')](0xcc)[_0x38e1('0x17')]();});}};}function handleEntityNotFound(_0x18eff2,_0x5bd4d6){return function(_0x1bc810){if(!_0x1bc810){_0x18eff2[_0x38e1('0x15')](0x194);}return _0x1bc810;};}function handleError(_0x5ed30c,_0x2d3eea){_0x2d3eea=_0x2d3eea||0x1f4;return function(_0x1083fd){logger[_0x38e1('0x20')](_0x1083fd[_0x38e1('0x21')]);if(_0x1083fd[_0x38e1('0x22')]){delete _0x1083fd[_0x38e1('0x22')];}_0x5ed30c[_0x38e1('0x16')](_0x2d3eea)[_0x38e1('0x23')](_0x1083fd);};}exports[_0x38e1('0x24')]=function(_0x9824f9,_0x53810b){var _0x35766b={},_0x2a5d30={},_0x498fa8={'count':0x0,'rows':[]};var _0x52b90c=_[_0x38e1('0x25')](db[_0x38e1('0x26')][_0x38e1('0x27')],function(_0x408a1b){return{'name':_0x408a1b['fieldName'],'type':_0x408a1b[_0x38e1('0x28')]['key']};});_0x2a5d30['model']=_[_0x38e1('0x25')](_0x52b90c,_0x38e1('0x22'));_0x2a5d30[_0x38e1('0x29')]=_[_0x38e1('0x2a')](_0x9824f9[_0x38e1('0x29')]);_0x2a5d30[_0x38e1('0x2b')]=_[_0x38e1('0x2c')](_0x2a5d30[_0x38e1('0x2d')],_0x2a5d30[_0x38e1('0x29')]);_0x35766b[_0x38e1('0x2e')]=_['intersection'](_0x2a5d30['model'],qs[_0x38e1('0x2f')](_0x9824f9[_0x38e1('0x29')]['fields']));_0x35766b[_0x38e1('0x2e')]=_0x35766b[_0x38e1('0x2e')][_0x38e1('0x30')]?_0x35766b[_0x38e1('0x2e')]:_0x2a5d30[_0x38e1('0x2d')];if(!_0x9824f9['query']['hasOwnProperty'](_0x38e1('0x31'))){_0x35766b['limit']=qs[_0x38e1('0x1a')](_0x9824f9[_0x38e1('0x29')][_0x38e1('0x1a')]);_0x35766b[_0x38e1('0x19')]=qs['offset'](_0x9824f9['query'][_0x38e1('0x19')]);}_0x35766b[_0x38e1('0x32')]=qs[_0x38e1('0x33')](_0x9824f9[_0x38e1('0x29')]['sort']);_0x35766b[_0x38e1('0x34')]=qs[_0x38e1('0x2b')](_[_0x38e1('0x35')](_0x9824f9[_0x38e1('0x29')],_0x2a5d30[_0x38e1('0x2b')]),_0x52b90c);if(_0x9824f9['query'][_0x38e1('0x36')]){_0x35766b[_0x38e1('0x34')]=_[_0x38e1('0x37')](_0x35766b['where'],{'$or':_[_0x38e1('0x25')](_0x52b90c,function(_0x4854e9){if(_0x4854e9[_0x38e1('0x28')]!=='VIRTUAL'){var _0x2a977c={};_0x2a977c[_0x4854e9[_0x38e1('0x22')]]={'$like':'%'+_0x9824f9['query']['filter']+'%'};return _0x2a977c;}})});}_0x35766b=_['merge']({},_0x35766b,_0x9824f9[_0x38e1('0x38')]);var _0x2ad1c9={'where':_0x35766b[_0x38e1('0x34')]};return db[_0x38e1('0x26')][_0x38e1('0x1c')](_0x2ad1c9)[_0x38e1('0x39')](function(_0x1e44c0){_0x498fa8['count']=_0x1e44c0;if(_0x9824f9[_0x38e1('0x29')][_0x38e1('0x3a')]){_0x35766b[_0x38e1('0x3b')]=[{'all':!![]}];}return db[_0x38e1('0x26')][_0x38e1('0x3c')](_0x35766b);})[_0x38e1('0x39')](function(_0x3bb2bd){_0x498fa8[_0x38e1('0x3d')]=_0x3bb2bd;return _0x498fa8;})[_0x38e1('0x39')](respondWithFilteredResult(_0x53810b,_0x35766b))['catch'](handleError(_0x53810b,null));};exports[_0x38e1('0x3e')]=function(_0xf93afe,_0x1c90e2){var _0xd63fb6={'raw':!![],'where':{'id':_0xf93afe[_0x38e1('0x3f')]['id']}},_0x4fc9b0={};_0x4fc9b0[_0x38e1('0x2d')]=_['keys'](db[_0x38e1('0x26')][_0x38e1('0x27')]);_0x4fc9b0['query']=_[_0x38e1('0x2a')](_0xf93afe['query']);_0x4fc9b0[_0x38e1('0x2b')]=_['intersection'](_0x4fc9b0[_0x38e1('0x2d')],_0x4fc9b0['query']);_0xd63fb6[_0x38e1('0x2e')]=_[_0x38e1('0x2c')](_0x4fc9b0[_0x38e1('0x2d')],qs[_0x38e1('0x2f')](_0xf93afe[_0x38e1('0x29')]['fields']));_0xd63fb6[_0x38e1('0x2e')]=_0xd63fb6[_0x38e1('0x2e')]['length']?_0xd63fb6['attributes']:_0x4fc9b0[_0x38e1('0x2d')];if(_0xf93afe['query'][_0x38e1('0x3a')]){_0xd63fb6[_0x38e1('0x3b')]=[{'all':!![]}];}_0xd63fb6=_['merge']({},_0xd63fb6,_0xf93afe[_0x38e1('0x38')]);return db[_0x38e1('0x26')][_0x38e1('0x40')](_0xd63fb6)['then'](handleEntityNotFound(_0x1c90e2,null))[_0x38e1('0x39')](respondWithResult(_0x1c90e2,null))[_0x38e1('0x41')](handleError(_0x1c90e2,null));};exports[_0x38e1('0x42')]=function(_0x1ff5a5,_0xb73d15){return db[_0x38e1('0x26')][_0x38e1('0x42')](_0x1ff5a5[_0x38e1('0x43')],{})['then'](respondWithResult(_0xb73d15,0xc9))[_0x38e1('0x41')](handleError(_0xb73d15,null));};exports[_0x38e1('0x1e')]=function(_0x1ed4b5,_0x251987){if(_0x1ed4b5[_0x38e1('0x43')]['id']){delete _0x1ed4b5[_0x38e1('0x43')]['id'];}return db[_0x38e1('0x26')][_0x38e1('0x40')]({'where':{'id':_0x1ed4b5[_0x38e1('0x3f')]['id']}})[_0x38e1('0x39')](handleEntityNotFound(_0x251987,null))[_0x38e1('0x39')](saveUpdates(_0x1ed4b5[_0x38e1('0x43')],null))[_0x38e1('0x39')](respondWithResult(_0x251987,null))[_0x38e1('0x41')](handleError(_0x251987,null));};exports[_0x38e1('0x1f')]=function(_0x4a57d6,_0x2083cd){return db[_0x38e1('0x26')]['find']({'where':{'id':_0x4a57d6['params']['id']}})[_0x38e1('0x39')](handleEntityNotFound(_0x2083cd,null))['then'](removeEntity(_0x2083cd,null))[_0x38e1('0x41')](handleError(_0x2083cd,null));};
\ No newline at end of file
+var _0x8d51=['destroy','error','stack','name','send','index','AnalyticTreeReport','type','key','model','map','query','keys','intersection','attributes','nolimit','sort','where','filters','pick','filter','merge','options','includeAll','catch','show','params','rawAttributes','fields','length','include','find','create','body','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','apply','reject','update','then'];(function(_0x58df61,_0x263bda){var _0x2af205=function(_0x14c8aa){while(--_0x14c8aa){_0x58df61['push'](_0x58df61['shift']());}};_0x2af205(++_0x263bda);}(_0x8d51,0x13e));var _0x18d5=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x8d51[_0x3c2a69];return _0x596bc8;};'use strict';var emlformat=require(_0x18d5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x18d5('0x1'));var jsonpatch=require(_0x18d5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x18d5('0x3'));var Mustache=require(_0x18d5('0x4'));var util=require(_0x18d5('0x5'));var path=require(_0x18d5('0x6'));var sox=require(_0x18d5('0x7'));var csv=require(_0x18d5('0x8'));var ejs=require(_0x18d5('0x9'));var fs=require('fs');var fs_extra=require(_0x18d5('0xa'));var _=require(_0x18d5('0xb'));var squel=require(_0x18d5('0xc'));var crypto=require(_0x18d5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x18d5('0xe'));var toCsv=require('to-csv');var querystring=require(_0x18d5('0xf'));var Papa=require(_0x18d5('0x10'));var Redis=require(_0x18d5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x18d5('0x12'));var as=require(_0x18d5('0x13'));var hardwareService=require(_0x18d5('0x14'));var logger=require(_0x18d5('0x15'))('api');var utils=require(_0x18d5('0x16'));var config=require(_0x18d5('0x17'));var licenseUtil=require(_0x18d5('0x18'));var db=require(_0x18d5('0x19'))['db'];function respondWithStatusCode(_0x34f790,_0x479ead){_0x479ead=_0x479ead||0xcc;return function(_0x4f0954){if(_0x4f0954){return _0x34f790[_0x18d5('0x1a')](_0x479ead);}return _0x34f790['status'](_0x479ead)[_0x18d5('0x1b')]();};}function respondWithResult(_0x477ebe,_0x914441){_0x914441=_0x914441||0xc8;return function(_0x263e47){if(_0x263e47){return _0x477ebe['status'](_0x914441)[_0x18d5('0x1c')](_0x263e47);}};}function respondWithFilteredResult(_0x1436f5,_0x4c7f7c){return function(_0xaa95eb){if(_0xaa95eb){var _0x4f4e14=typeof _0x4c7f7c['offset']===_0x18d5('0x1d')&&typeof _0x4c7f7c[_0x18d5('0x1e')]===_0x18d5('0x1d');var _0x9f1588=_0xaa95eb[_0x18d5('0x1f')];var _0x1e656d=_0x4f4e14?0x0:_0x4c7f7c[_0x18d5('0x20')];var _0x20294a=_0x4f4e14?_0xaa95eb[_0x18d5('0x1f')]:_0x4c7f7c[_0x18d5('0x20')]+_0x4c7f7c[_0x18d5('0x1e')];var _0x262db3;if(_0x20294a>=_0x9f1588){_0x20294a=_0x9f1588;_0x262db3=0xc8;}else{_0x262db3=0xce;}_0x1436f5['status'](_0x262db3);return _0x1436f5['set']('Content-Range',_0x1e656d+'-'+_0x20294a+'/'+_0x9f1588)[_0x18d5('0x1c')](_0xaa95eb);}return null;};}function patchUpdates(_0x5085a7){return function(_0x155aa2){try{jsonpatch[_0x18d5('0x21')](_0x155aa2,_0x5085a7,!![]);}catch(_0x5c86b9){return BPromise[_0x18d5('0x22')](_0x5c86b9);}return _0x155aa2['save']();};}function saveUpdates(_0x13c7ed,_0x550d29){return function(_0x4a375e){if(_0x4a375e){return _0x4a375e[_0x18d5('0x23')](_0x13c7ed)[_0x18d5('0x24')](function(_0x14f701){return _0x14f701;});}return null;};}function removeEntity(_0x20c20b,_0x81dddf){return function(_0x5a0edd){if(_0x5a0edd){return _0x5a0edd[_0x18d5('0x25')]()[_0x18d5('0x24')](function(){_0x20c20b['status'](0xcc)[_0x18d5('0x1b')]();});}};}function handleEntityNotFound(_0x3d2e6f,_0x2f22e4){return function(_0x19eb63){if(!_0x19eb63){_0x3d2e6f['sendStatus'](0x194);}return _0x19eb63;};}function handleError(_0x41a19e,_0x34238e){_0x34238e=_0x34238e||0x1f4;return function(_0x42ff10){logger[_0x18d5('0x26')](_0x42ff10[_0x18d5('0x27')]);if(_0x42ff10[_0x18d5('0x28')]){delete _0x42ff10[_0x18d5('0x28')];}_0x41a19e['status'](_0x34238e)[_0x18d5('0x29')](_0x42ff10);};}exports[_0x18d5('0x2a')]=function(_0x4c3598,_0x48ccad){var _0x464238={},_0x5ae824={},_0x4bcfe9={'count':0x0,'rows':[]};var _0x415d17=_['map'](db[_0x18d5('0x2b')]['rawAttributes'],function(_0x155e3d){return{'name':_0x155e3d['fieldName'],'type':_0x155e3d[_0x18d5('0x2c')][_0x18d5('0x2d')]};});_0x5ae824[_0x18d5('0x2e')]=_[_0x18d5('0x2f')](_0x415d17,_0x18d5('0x28'));_0x5ae824[_0x18d5('0x30')]=_[_0x18d5('0x31')](_0x4c3598[_0x18d5('0x30')]);_0x5ae824['filters']=_[_0x18d5('0x32')](_0x5ae824[_0x18d5('0x2e')],_0x5ae824['query']);_0x464238[_0x18d5('0x33')]=_[_0x18d5('0x32')](_0x5ae824[_0x18d5('0x2e')],qs['fields'](_0x4c3598[_0x18d5('0x30')]['fields']));_0x464238[_0x18d5('0x33')]=_0x464238[_0x18d5('0x33')]['length']?_0x464238[_0x18d5('0x33')]:_0x5ae824[_0x18d5('0x2e')];if(!_0x4c3598[_0x18d5('0x30')]['hasOwnProperty'](_0x18d5('0x34'))){_0x464238[_0x18d5('0x1e')]=qs[_0x18d5('0x1e')](_0x4c3598['query']['limit']);_0x464238[_0x18d5('0x20')]=qs[_0x18d5('0x20')](_0x4c3598[_0x18d5('0x30')][_0x18d5('0x20')]);}_0x464238['order']=qs[_0x18d5('0x35')](_0x4c3598[_0x18d5('0x30')][_0x18d5('0x35')]);_0x464238[_0x18d5('0x36')]=qs[_0x18d5('0x37')](_[_0x18d5('0x38')](_0x4c3598[_0x18d5('0x30')],_0x5ae824[_0x18d5('0x37')]),_0x415d17);if(_0x4c3598[_0x18d5('0x30')][_0x18d5('0x39')]){_0x464238[_0x18d5('0x36')]=_[_0x18d5('0x3a')](_0x464238['where'],{'$or':_[_0x18d5('0x2f')](_0x415d17,function(_0x5258b3){if(_0x5258b3['type']!=='VIRTUAL'){var _0x2ddfc7={};_0x2ddfc7[_0x5258b3['name']]={'$like':'%'+_0x4c3598['query']['filter']+'%'};return _0x2ddfc7;}})});}_0x464238=_[_0x18d5('0x3a')]({},_0x464238,_0x4c3598[_0x18d5('0x3b')]);var _0x220e7d={'where':_0x464238[_0x18d5('0x36')]};return db['AnalyticTreeReport']['count'](_0x220e7d)[_0x18d5('0x24')](function(_0x3ea66b){_0x4bcfe9[_0x18d5('0x1f')]=_0x3ea66b;if(_0x4c3598[_0x18d5('0x30')][_0x18d5('0x3c')]){_0x464238['include']=[{'all':!![]}];}return db[_0x18d5('0x2b')]['findAll'](_0x464238);})[_0x18d5('0x24')](function(_0x5a384c){_0x4bcfe9['rows']=_0x5a384c;return _0x4bcfe9;})[_0x18d5('0x24')](respondWithFilteredResult(_0x48ccad,_0x464238))[_0x18d5('0x3d')](handleError(_0x48ccad,null));};exports[_0x18d5('0x3e')]=function(_0x4ff96d,_0x267ced){var _0x502d28={'raw':!![],'where':{'id':_0x4ff96d[_0x18d5('0x3f')]['id']}},_0x413828={};_0x413828[_0x18d5('0x2e')]=_[_0x18d5('0x31')](db[_0x18d5('0x2b')][_0x18d5('0x40')]);_0x413828[_0x18d5('0x30')]=_[_0x18d5('0x31')](_0x4ff96d[_0x18d5('0x30')]);_0x413828['filters']=_['intersection'](_0x413828[_0x18d5('0x2e')],_0x413828[_0x18d5('0x30')]);_0x502d28[_0x18d5('0x33')]=_[_0x18d5('0x32')](_0x413828[_0x18d5('0x2e')],qs[_0x18d5('0x41')](_0x4ff96d[_0x18d5('0x30')][_0x18d5('0x41')]));_0x502d28[_0x18d5('0x33')]=_0x502d28[_0x18d5('0x33')][_0x18d5('0x42')]?_0x502d28[_0x18d5('0x33')]:_0x413828['model'];if(_0x4ff96d[_0x18d5('0x30')][_0x18d5('0x3c')]){_0x502d28[_0x18d5('0x43')]=[{'all':!![]}];}_0x502d28=_['merge']({},_0x502d28,_0x4ff96d[_0x18d5('0x3b')]);return db[_0x18d5('0x2b')][_0x18d5('0x44')](_0x502d28)[_0x18d5('0x24')](handleEntityNotFound(_0x267ced,null))[_0x18d5('0x24')](respondWithResult(_0x267ced,null))[_0x18d5('0x3d')](handleError(_0x267ced,null));};exports[_0x18d5('0x45')]=function(_0x191605,_0x25c6a7){return db[_0x18d5('0x2b')]['create'](_0x191605[_0x18d5('0x46')],{})[_0x18d5('0x24')](respondWithResult(_0x25c6a7,0xc9))[_0x18d5('0x3d')](handleError(_0x25c6a7,null));};exports['update']=function(_0x4a4d62,_0x444c1c){if(_0x4a4d62['body']['id']){delete _0x4a4d62[_0x18d5('0x46')]['id'];}return db[_0x18d5('0x2b')]['find']({'where':{'id':_0x4a4d62[_0x18d5('0x3f')]['id']}})[_0x18d5('0x24')](handleEntityNotFound(_0x444c1c,null))[_0x18d5('0x24')](saveUpdates(_0x4a4d62['body'],null))[_0x18d5('0x24')](respondWithResult(_0x444c1c,null))[_0x18d5('0x3d')](handleError(_0x444c1c,null));};exports[_0x18d5('0x25')]=function(_0x2c23a6,_0xbb33f3){return db[_0x18d5('0x2b')][_0x18d5('0x44')]({'where':{'id':_0x2c23a6[_0x18d5('0x3f')]['id']}})['then'](handleEntityNotFound(_0xbb33f3,null))[_0x18d5('0x24')](removeEntity(_0xbb33f3,null))['catch'](handleError(_0xbb33f3,null));};
\ No newline at end of file
index b43075e..61bc808 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4b1=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','lodash','../../config/logger'];(function(_0x455a09,_0x379272){var _0x57a49d=function(_0x3795fb){while(--_0x3795fb){_0x455a09['push'](_0x455a09['shift']());}};_0x57a49d(++_0x379272);}(_0xc4b1,0x1ab));var _0x1c4b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xc4b1[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x1c4b('0x0'));var util=require('util');var logger=require(_0x1c4b('0x1'))('api');var moment=require(_0x1c4b('0x2'));var BPromise=require(_0x1c4b('0x3'));var rp=require(_0x1c4b('0x4'));var fs=require('fs');var path=require(_0x1c4b('0x5'));var rimraf=require(_0x1c4b('0x6'));var config=require(_0x1c4b('0x7'));var attributes=require(_0x1c4b('0x8'));module[_0x1c4b('0x9')]=function(_0x17b1b8,_0x55a877){return _0x17b1b8['define'](_0x1c4b('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x811a=['api','moment','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','util'];(function(_0x1f530d,_0x18a19e){var _0x22103f=function(_0x2664c5){while(--_0x2664c5){_0x1f530d['push'](_0x1f530d['shift']());}};_0x22103f(++_0x18a19e);}(_0x811a,0xb9));var _0xa811=function(_0x1b09f5,_0x52d403){_0x1b09f5=_0x1b09f5-0x0;var _0x3974bf=_0x811a[_0x1b09f5];return _0x3974bf;};'use strict';var _=require(_0xa811('0x0'));var util=require(_0xa811('0x1'));var logger=require('../../config/logger')(_0xa811('0x2'));var moment=require(_0xa811('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa811('0x4'));var rimraf=require(_0xa811('0x5'));var config=require(_0xa811('0x6'));var attributes=require(_0xa811('0x7'));module[_0xa811('0x8')]=function(_0x4f520c,_0x29c97c){return _0x4f520c[_0xa811('0x9')](_0xa811('0xa'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1b22696..a0b2143 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0xd436c4,_0x298c0b){var _0x506952=function(_0x771356){while(--_0x771356){_0xd436c4['push'](_0xd436c4['shift']());}};_0x506952(++_0x298c0b);}(_0x2ef3,0xba));var _0x32ef=function(_0x4fb525,_0x16b5f9){_0x4fb525=_0x4fb525-0x0;var _0x5e8d50=_0x2ef3[_0x4fb525];return _0x5e8d50;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x1ca09e,_0x232ad1){var _0x4149bc=function(_0x51e14a){while(--_0x51e14a){_0x1ca09e['push'](_0x1ca09e['shift']());}};_0x4149bc(++_0x232ad1);}(_0xdb28,0x106));var _0x8db2=function(_0x3bf674,_0x2cb42a){_0x3bf674=_0x3bf674-0x0;var _0x3163fd=_0xdb28[_0x3bf674];return _0x3163fd;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
index d7364d6..8a5085d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7380=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports'];(function(_0x3c5191,_0x2f6745){var _0x5415a7=function(_0x1d852d){while(--_0x1d852d){_0x3c5191['push'](_0x3c5191['shift']());}};_0x5415a7(++_0x2f6745);}(_0x7380,0x17c));var _0x0738=function(_0x5c2a2b,_0x22c94e){_0x5c2a2b=_0x5c2a2b-0x0;var _0x19921f=_0x7380[_0x5c2a2b];return _0x19921f;};'use strict';var multer=require(_0x0738('0x0'));var util=require(_0x0738('0x1'));var path=require('path');var timeout=require(_0x0738('0x2'));var express=require('express');var router=express[_0x0738('0x3')]();var fs_extra=require(_0x0738('0x4'));var auth=require(_0x0738('0x5'));var interaction=require(_0x0738('0x6'));var config=require(_0x0738('0x7'));var controller=require(_0x0738('0x8'));router[_0x0738('0x9')]('/',auth[_0x0738('0xa')](),controller[_0x0738('0xb')]);router['get'](_0x0738('0xc'),auth['isAuthenticated'](),controller[_0x0738('0xd')]);router[_0x0738('0xe')]('/',auth['isAuthenticated'](),controller[_0x0738('0xf')]);router[_0x0738('0x10')](_0x0738('0xc'),auth[_0x0738('0xa')](),controller[_0x0738('0x11')]);router['delete'](_0x0738('0xc'),auth[_0x0738('0xa')](),controller[_0x0738('0x12')]);module[_0x0738('0x13')]=router;
\ No newline at end of file
+var _0xa148=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa148,0x14d));var _0x8a14=function(_0x2fe726,_0x34307b){_0x2fe726=_0x2fe726-0x0;var _0x25bc11=_0xa148[_0x2fe726];return _0x25bc11;};'use strict';var multer=require(_0x8a14('0x0'));var util=require(_0x8a14('0x1'));var path=require(_0x8a14('0x2'));var timeout=require(_0x8a14('0x3'));var express=require(_0x8a14('0x4'));var router=express['Router']();var fs_extra=require(_0x8a14('0x5'));var auth=require(_0x8a14('0x6'));var interaction=require(_0x8a14('0x7'));var config=require(_0x8a14('0x8'));var controller=require('./analyticTreeReport.controller');router[_0x8a14('0x9')]('/',auth[_0x8a14('0xa')](),controller[_0x8a14('0xb')]);router[_0x8a14('0x9')]('/:id',auth[_0x8a14('0xa')](),controller[_0x8a14('0xc')]);router[_0x8a14('0xd')]('/',auth[_0x8a14('0xa')](),controller[_0x8a14('0xe')]);router[_0x8a14('0xf')](_0x8a14('0x10'),auth[_0x8a14('0xa')](),controller[_0x8a14('0x11')]);router[_0x8a14('0x12')]('/:id',auth[_0x8a14('0xa')](),controller[_0x8a14('0x13')]);module[_0x8a14('0x14')]=router;
\ No newline at end of file
index 80f4d8e..7ffe51b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3b5=['STRING'];(function(_0xb5ac6c,_0x5c5762){var _0x48aace=function(_0x30bb19){while(--_0x30bb19){_0xb5ac6c['push'](_0xb5ac6c['shift']());}};_0x48aace(++_0x5c5762);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x1e1144,_0x187147){_0x1e1144=_0x1e1144-0x0;var _0x1ee473=_0xc3b5[_0x1e1144];return _0x1ee473;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5c3b('0x0')]},'basename':{'type':Sequelize[_0x5c3b('0x0')]},'type':{'type':Sequelize[_0x5c3b('0x0')]}};
\ No newline at end of file
+var _0xb26e=['STRING','sequelize'];(function(_0x1d128e,_0x2c87de){var _0x3d5236=function(_0x2374ff){while(--_0x2374ff){_0x1d128e['push'](_0x1d128e['shift']());}};_0x3d5236(++_0x2c87de);}(_0xb26e,0x11d));var _0xeb26=function(_0x42e25e,_0x46cfd1){_0x42e25e=_0x42e25e-0x0;var _0x1ed3a6=_0xb26e[_0x42e25e];return _0x1ed3a6;};'use strict';var Sequelize=require(_0xeb26('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xeb26('0x1')]}};
\ No newline at end of file
index bc56b62..1cb5b48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb054=['merge','options','includeAll','include','rows','params','fields','catch','clone','find','get','omit','updatedAt','body','createdAt','create','file','originalname','mimetype','download','findOne','ChatOfflineMessageId','root','offline-chat/','join','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','name','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb054,0x70));var _0x4b05=function(_0xde12cd,_0x269a1f){_0xde12cd=_0xde12cd-0x0;var _0x93a6e2=_0xb054[_0xde12cd];return _0x93a6e2;};'use strict';var emlformat=require(_0x4b05('0x0'));var rimraf=require(_0x4b05('0x1'));var zipdir=require(_0x4b05('0x2'));var jsonpatch=require(_0x4b05('0x3'));var rp=require('request-promise');var moment=require(_0x4b05('0x4'));var BPromise=require(_0x4b05('0x5'));var Mustache=require('mustache');var util=require(_0x4b05('0x6'));var path=require(_0x4b05('0x7'));var sox=require(_0x4b05('0x8'));var csv=require(_0x4b05('0x9'));var ejs=require(_0x4b05('0xa'));var fs=require('fs');var fs_extra=require(_0x4b05('0xb'));var _=require(_0x4b05('0xc'));var squel=require(_0x4b05('0xd'));var crypto=require(_0x4b05('0xe'));var jsforce=require(_0x4b05('0xf'));var deskjs=require(_0x4b05('0x10'));var toCsv=require(_0x4b05('0x9'));var querystring=require('querystring');var Papa=require(_0x4b05('0x11'));var Redis=require(_0x4b05('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4b05('0x13'));var as=require(_0x4b05('0x14'));var hardwareService=require(_0x4b05('0x15'));var logger=require('../../config/logger')(_0x4b05('0x16'));var utils=require('../../config/utils');var config=require(_0x4b05('0x17'));var licenseUtil=require(_0x4b05('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12f5ac,_0x5a52d9){_0x5a52d9=_0x5a52d9||0xcc;return function(_0x4681d5){if(_0x4681d5){return _0x12f5ac[_0x4b05('0x19')](_0x5a52d9);}return _0x12f5ac[_0x4b05('0x1a')](_0x5a52d9)[_0x4b05('0x1b')]();};}function respondWithResult(_0x460025,_0x5744f2){_0x5744f2=_0x5744f2||0xc8;return function(_0x5ced4f){if(_0x5ced4f){return _0x460025[_0x4b05('0x1a')](_0x5744f2)[_0x4b05('0x1c')](_0x5ced4f);}};}function respondWithFilteredResult(_0x4b5819,_0x396262){return function(_0x575abc){if(_0x575abc){var _0x9f1ce5=typeof _0x396262[_0x4b05('0x1d')]===_0x4b05('0x1e')&&typeof _0x396262['limit']==='undefined';var _0x2a7b14=_0x575abc[_0x4b05('0x1f')];var _0x50f2af=_0x9f1ce5?0x0:_0x396262[_0x4b05('0x1d')];var _0x5ec6bb=_0x9f1ce5?_0x575abc[_0x4b05('0x1f')]:_0x396262[_0x4b05('0x1d')]+_0x396262['limit'];var _0x1b7dc0;if(_0x5ec6bb>=_0x2a7b14){_0x5ec6bb=_0x2a7b14;_0x1b7dc0=0xc8;}else{_0x1b7dc0=0xce;}_0x4b5819['status'](_0x1b7dc0);return _0x4b5819[_0x4b05('0x20')](_0x4b05('0x21'),_0x50f2af+'-'+_0x5ec6bb+'/'+_0x2a7b14)['json'](_0x575abc);}return null;};}function patchUpdates(_0x168802){return function(_0x30a75f){try{jsonpatch[_0x4b05('0x22')](_0x30a75f,_0x168802,!![]);}catch(_0xb13ca6){return BPromise[_0x4b05('0x23')](_0xb13ca6);}return _0x30a75f['save']();};}function saveUpdates(_0x5e667a,_0x28f2d2){return function(_0x47b8c9){if(_0x47b8c9){return _0x47b8c9[_0x4b05('0x24')](_0x5e667a)[_0x4b05('0x25')](function(_0x3f8c17){return _0x3f8c17;});}return null;};}function removeEntity(_0x148966,_0x3ff2fa){return function(_0x29f82e){if(_0x29f82e){return _0x29f82e[_0x4b05('0x26')]()['then'](function(){_0x148966[_0x4b05('0x1a')](0xcc)[_0x4b05('0x1b')]();});}};}function handleEntityNotFound(_0x2a5bb8,_0x288067){return function(_0x21f212){if(!_0x21f212){_0x2a5bb8[_0x4b05('0x19')](0x194);}return _0x21f212;};}function handleError(_0x7c8f26,_0xd46e8e){_0xd46e8e=_0xd46e8e||0x1f4;return function(_0x2daa94){logger['error'](_0x2daa94['stack']);if(_0x2daa94[_0x4b05('0x27')]){delete _0x2daa94[_0x4b05('0x27')];}_0x7c8f26['status'](_0xd46e8e)['send'](_0x2daa94);};}exports[_0x4b05('0x28')]=function(_0x3514b5,_0xe8d8a){var _0x2b18e9={},_0x45c8f3={},_0x3da6cb={'count':0x0,'rows':[]};var _0x323d1d=_[_0x4b05('0x29')](db[_0x4b05('0x2a')][_0x4b05('0x2b')],function(_0x480b4d){return{'name':_0x480b4d[_0x4b05('0x2c')],'type':_0x480b4d[_0x4b05('0x2d')][_0x4b05('0x2e')]};});_0x45c8f3[_0x4b05('0x2f')]=_[_0x4b05('0x29')](_0x323d1d,_0x4b05('0x27'));_0x45c8f3[_0x4b05('0x30')]=_[_0x4b05('0x31')](_0x3514b5[_0x4b05('0x30')]);_0x45c8f3[_0x4b05('0x32')]=_[_0x4b05('0x33')](_0x45c8f3[_0x4b05('0x2f')],_0x45c8f3['query']);_0x2b18e9[_0x4b05('0x34')]=_[_0x4b05('0x33')](_0x45c8f3[_0x4b05('0x2f')],qs['fields'](_0x3514b5[_0x4b05('0x30')]['fields']));_0x2b18e9['attributes']=_0x2b18e9['attributes'][_0x4b05('0x35')]?_0x2b18e9[_0x4b05('0x34')]:_0x45c8f3['model'];if(!_0x3514b5[_0x4b05('0x30')][_0x4b05('0x36')](_0x4b05('0x37'))){_0x2b18e9[_0x4b05('0x38')]=qs[_0x4b05('0x38')](_0x3514b5[_0x4b05('0x30')][_0x4b05('0x38')]);_0x2b18e9[_0x4b05('0x1d')]=qs[_0x4b05('0x1d')](_0x3514b5[_0x4b05('0x30')][_0x4b05('0x1d')]);}_0x2b18e9[_0x4b05('0x39')]=qs[_0x4b05('0x3a')](_0x3514b5[_0x4b05('0x30')][_0x4b05('0x3a')]);_0x2b18e9[_0x4b05('0x3b')]=qs[_0x4b05('0x32')](_[_0x4b05('0x3c')](_0x3514b5[_0x4b05('0x30')],_0x45c8f3[_0x4b05('0x32')]),_0x323d1d);if(_0x3514b5[_0x4b05('0x30')]['filter']){_0x2b18e9[_0x4b05('0x3b')]=_['merge'](_0x2b18e9[_0x4b05('0x3b')],{'$or':_[_0x4b05('0x29')](_0x323d1d,function(_0x4487cb){if(_0x4487cb[_0x4b05('0x2d')]!=='VIRTUAL'){var _0x2903eb={};_0x2903eb[_0x4487cb[_0x4b05('0x27')]]={'$like':'%'+_0x3514b5[_0x4b05('0x30')][_0x4b05('0x3d')]+'%'};return _0x2903eb;}})});}_0x2b18e9=_[_0x4b05('0x3e')]({},_0x2b18e9,_0x3514b5[_0x4b05('0x3f')]);var _0x4147d2={'where':_0x2b18e9[_0x4b05('0x3b')]};return db[_0x4b05('0x2a')]['count'](_0x4147d2)[_0x4b05('0x25')](function(_0x356dda){_0x3da6cb[_0x4b05('0x1f')]=_0x356dda;if(_0x3514b5[_0x4b05('0x30')][_0x4b05('0x40')]){_0x2b18e9[_0x4b05('0x41')]=[{'all':!![]}];}return db[_0x4b05('0x2a')]['findAll'](_0x2b18e9);})[_0x4b05('0x25')](function(_0x2526f2){_0x3da6cb[_0x4b05('0x42')]=_0x2526f2;return _0x3da6cb;})[_0x4b05('0x25')](respondWithFilteredResult(_0xe8d8a,_0x2b18e9))['catch'](handleError(_0xe8d8a,null));};exports['show']=function(_0x37511c,_0x7c5267){var _0x46449f={'raw':!![],'where':{'id':_0x37511c[_0x4b05('0x43')]['id']}},_0x4916d8={};_0x4916d8['model']=_[_0x4b05('0x31')](db[_0x4b05('0x2a')]['rawAttributes']);_0x4916d8[_0x4b05('0x30')]=_[_0x4b05('0x31')](_0x37511c[_0x4b05('0x30')]);_0x4916d8[_0x4b05('0x32')]=_[_0x4b05('0x33')](_0x4916d8[_0x4b05('0x2f')],_0x4916d8[_0x4b05('0x30')]);_0x46449f['attributes']=_[_0x4b05('0x33')](_0x4916d8['model'],qs['fields'](_0x37511c[_0x4b05('0x30')][_0x4b05('0x44')]));_0x46449f['attributes']=_0x46449f['attributes']['length']?_0x46449f[_0x4b05('0x34')]:_0x4916d8[_0x4b05('0x2f')];if(_0x37511c[_0x4b05('0x30')][_0x4b05('0x40')]){_0x46449f[_0x4b05('0x41')]=[{'all':!![]}];}_0x46449f=_[_0x4b05('0x3e')]({},_0x46449f,_0x37511c['options']);return db['Attachment']['find'](_0x46449f)[_0x4b05('0x25')](handleEntityNotFound(_0x7c5267,null))[_0x4b05('0x25')](respondWithResult(_0x7c5267,null))[_0x4b05('0x45')](handleError(_0x7c5267,null));};exports[_0x4b05('0x46')]=function(_0x409ff8,_0x3c6471){var _0x51e20b={'where':{'id':_0x409ff8[_0x4b05('0x43')]['id']}},_0x20dc51={};_0x20dc51[_0x4b05('0x2f')]=_['keys'](db[_0x4b05('0x2a')][_0x4b05('0x2b')]);_0x51e20b[_0x4b05('0x34')]=_[_0x4b05('0x33')](_0x20dc51[_0x4b05('0x2f')],qs[_0x4b05('0x44')](_0x409ff8[_0x4b05('0x30')]['fields']));_0x51e20b[_0x4b05('0x34')]=_0x51e20b[_0x4b05('0x34')][_0x4b05('0x35')]?_0x51e20b[_0x4b05('0x34')]:_0x20dc51[_0x4b05('0x2f')];if(_0x409ff8[_0x4b05('0x30')][_0x4b05('0x40')]){_0x51e20b[_0x4b05('0x41')]=[{'all':!![]}];}_0x51e20b=_[_0x4b05('0x3e')]({},_0x51e20b,_0x409ff8[_0x4b05('0x3f')]);return db[_0x4b05('0x2a')][_0x4b05('0x47')](_0x51e20b)[_0x4b05('0x25')](handleEntityNotFound(_0x3c6471,null))[_0x4b05('0x25')](function(_0x16d9bc){if(_0x16d9bc){var _0x42f9e1=_0x16d9bc[_0x4b05('0x48')]({'plain':!![]});_0x42f9e1=qs[_0x4b05('0x49')](_0x42f9e1,['id','createdAt',_0x4b05('0x4a')]);_0x409ff8[_0x4b05('0x4b')]=_['omit'](_0x409ff8[_0x4b05('0x4b')],['id',_0x4b05('0x4c'),'updatedAt']);return db['Attachment'][_0x4b05('0x4d')](_[_0x4b05('0x3e')](_0x42f9e1,_0x409ff8[_0x4b05('0x4b')]),{'include':_0x409ff8[_0x4b05('0x30')][_0x4b05('0x40')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x3c6471,0xc9))[_0x4b05('0x45')](handleError(_0x3c6471,null));};exports[_0x4b05('0x24')]=function(_0xb93856,_0x166e32){if(_0xb93856[_0x4b05('0x4b')]['id']){delete _0xb93856[_0x4b05('0x4b')]['id'];}return db[_0x4b05('0x2a')][_0x4b05('0x47')]({'where':{'id':_0xb93856['params']['id']}})[_0x4b05('0x25')](handleEntityNotFound(_0x166e32,null))[_0x4b05('0x25')](saveUpdates(_0xb93856[_0x4b05('0x4b')],null))['then'](respondWithResult(_0x166e32,null))[_0x4b05('0x45')](handleError(_0x166e32,null));};exports[_0x4b05('0x26')]=function(_0x3859e6,_0x43d800){return db['Attachment']['find']({'where':{'id':_0x3859e6[_0x4b05('0x43')]['id']}})[_0x4b05('0x25')](handleEntityNotFound(_0x43d800,null))[_0x4b05('0x25')](removeEntity(_0x43d800,null))[_0x4b05('0x45')](handleError(_0x43d800,null));};exports[_0x4b05('0x4d')]=function(_0x53f9fc,_0x1951fe,_0x3e73bd){_0x53f9fc['body']['name']=_0x53f9fc[_0x4b05('0x4e')][_0x4b05('0x4f')];_0x53f9fc[_0x4b05('0x4b')]['basename']=_0x53f9fc['file']['filename'];_0x53f9fc[_0x4b05('0x4b')][_0x4b05('0x2d')]=_0x53f9fc[_0x4b05('0x4e')][_0x4b05('0x50')];return db[_0x4b05('0x2a')][_0x4b05('0x4d')](_0x53f9fc[_0x4b05('0x4b')])['then'](respondWithResult(_0x1951fe,0xc9))['catch'](handleError(_0x1951fe,null));};exports[_0x4b05('0x51')]=function(_0x3713d6,_0xc86bae,_0x52adf7){return db[_0x4b05('0x2a')][_0x4b05('0x52')]({'where':{'id':_0x3713d6[_0x4b05('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0xc86bae,null))[_0x4b05('0x25')](function(_0x184b61){if(_0x184b61){var _0x16a83f=_0x184b61[_0x4b05('0x53')]!==null;var _0x1fa34d=path['join'](config[_0x4b05('0x54')],'server/files/attachments/');if(_0x16a83f){_0x1fa34d=path['join'](_0x1fa34d,_0x4b05('0x55'));}var _0x45469a=path[_0x4b05('0x56')](_0x1fa34d,_0x184b61['basename']);return _0xc86bae[_0x4b05('0x51')](_0x45469a);}})[_0x4b05('0x45')](handleError(_0xc86bae,null));};
\ No newline at end of file
+var _0x28aa=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','Attachment','includeAll','findAll','rows','show','params','keys','include','options','find','catch','clone','get','omit','createdAt','updatedAt','body','create','file','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','eml-format','zip-dir','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0xbec8e6,_0x2841b5){var _0x4aa6f2=function(_0x583a0a){while(--_0x583a0a){_0xbec8e6['push'](_0xbec8e6['shift']());}};_0x4aa6f2(++_0x2841b5);}(_0x28aa,0xa4));var _0xa28a=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x28aa[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0xa28a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa28a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa28a('0x2'));var Mustache=require(_0xa28a('0x3'));var util=require(_0xa28a('0x4'));var path=require(_0xa28a('0x5'));var sox=require(_0xa28a('0x6'));var csv=require('to-csv');var ejs=require(_0xa28a('0x7'));var fs=require('fs');var fs_extra=require(_0xa28a('0x8'));var _=require('lodash');var squel=require(_0xa28a('0x9'));var crypto=require(_0xa28a('0xa'));var jsforce=require(_0xa28a('0xb'));var deskjs=require(_0xa28a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa28a('0xd'));var Papa=require(_0xa28a('0xe'));var Redis=require(_0xa28a('0xf'));var authService=require(_0xa28a('0x10'));var qs=require(_0xa28a('0x11'));var as=require(_0xa28a('0x12'));var hardwareService=require(_0xa28a('0x13'));var logger=require(_0xa28a('0x14'))(_0xa28a('0x15'));var utils=require(_0xa28a('0x16'));var config=require(_0xa28a('0x17'));var licenseUtil=require(_0xa28a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e78d4,_0x26d5b6){_0x26d5b6=_0x26d5b6||0xcc;return function(_0x5cbe76){if(_0x5cbe76){return _0x3e78d4[_0xa28a('0x19')](_0x26d5b6);}return _0x3e78d4[_0xa28a('0x1a')](_0x26d5b6)[_0xa28a('0x1b')]();};}function respondWithResult(_0x5b8ad1,_0x664726){_0x664726=_0x664726||0xc8;return function(_0x2f400f){if(_0x2f400f){return _0x5b8ad1['status'](_0x664726)[_0xa28a('0x1c')](_0x2f400f);}};}function respondWithFilteredResult(_0x1215ab,_0x2c6c7a){return function(_0x45fc72){if(_0x45fc72){var _0x4d91cb=typeof _0x2c6c7a[_0xa28a('0x1d')]===_0xa28a('0x1e')&&typeof _0x2c6c7a['limit']===_0xa28a('0x1e');var _0xffa08a=_0x45fc72[_0xa28a('0x1f')];var _0x4975cc=_0x4d91cb?0x0:_0x2c6c7a['offset'];var _0x16ad19=_0x4d91cb?_0x45fc72[_0xa28a('0x1f')]:_0x2c6c7a[_0xa28a('0x1d')]+_0x2c6c7a[_0xa28a('0x20')];var _0x2d8158;if(_0x16ad19>=_0xffa08a){_0x16ad19=_0xffa08a;_0x2d8158=0xc8;}else{_0x2d8158=0xce;}_0x1215ab[_0xa28a('0x1a')](_0x2d8158);return _0x1215ab[_0xa28a('0x21')](_0xa28a('0x22'),_0x4975cc+'-'+_0x16ad19+'/'+_0xffa08a)[_0xa28a('0x1c')](_0x45fc72);}return null;};}function patchUpdates(_0x106e8a){return function(_0x422b94){try{jsonpatch[_0xa28a('0x23')](_0x422b94,_0x106e8a,!![]);}catch(_0x75b573){return BPromise[_0xa28a('0x24')](_0x75b573);}return _0x422b94['save']();};}function saveUpdates(_0x5df3b4,_0x40b49f){return function(_0x165bb6){if(_0x165bb6){return _0x165bb6[_0xa28a('0x25')](_0x5df3b4)[_0xa28a('0x26')](function(_0x5741a5){return _0x5741a5;});}return null;};}function removeEntity(_0x26ff71,_0x3b0746){return function(_0xa593aa){if(_0xa593aa){return _0xa593aa[_0xa28a('0x27')]()[_0xa28a('0x26')](function(){_0x26ff71[_0xa28a('0x1a')](0xcc)[_0xa28a('0x1b')]();});}};}function handleEntityNotFound(_0x561b4a,_0x5c977b){return function(_0x41c6aa){if(!_0x41c6aa){_0x561b4a['sendStatus'](0x194);}return _0x41c6aa;};}function handleError(_0xc3e1c3,_0x1a2229){_0x1a2229=_0x1a2229||0x1f4;return function(_0x235c53){logger[_0xa28a('0x28')](_0x235c53[_0xa28a('0x29')]);if(_0x235c53[_0xa28a('0x2a')]){delete _0x235c53[_0xa28a('0x2a')];}_0xc3e1c3[_0xa28a('0x1a')](_0x1a2229)[_0xa28a('0x2b')](_0x235c53);};}exports['index']=function(_0x15ac97,_0x2572cc){var _0x480096={},_0x2f0647={},_0xeeb9fa={'count':0x0,'rows':[]};var _0x563963=_['map'](db['Attachment'][_0xa28a('0x2c')],function(_0x52c651){return{'name':_0x52c651[_0xa28a('0x2d')],'type':_0x52c651[_0xa28a('0x2e')][_0xa28a('0x2f')]};});_0x2f0647[_0xa28a('0x30')]=_[_0xa28a('0x31')](_0x563963,_0xa28a('0x2a'));_0x2f0647['query']=_['keys'](_0x15ac97[_0xa28a('0x32')]);_0x2f0647[_0xa28a('0x33')]=_[_0xa28a('0x34')](_0x2f0647['model'],_0x2f0647[_0xa28a('0x32')]);_0x480096[_0xa28a('0x35')]=_[_0xa28a('0x34')](_0x2f0647[_0xa28a('0x30')],qs[_0xa28a('0x36')](_0x15ac97[_0xa28a('0x32')]['fields']));_0x480096['attributes']=_0x480096[_0xa28a('0x35')][_0xa28a('0x37')]?_0x480096[_0xa28a('0x35')]:_0x2f0647[_0xa28a('0x30')];if(!_0x15ac97[_0xa28a('0x32')][_0xa28a('0x38')]('nolimit')){_0x480096['limit']=qs[_0xa28a('0x20')](_0x15ac97[_0xa28a('0x32')][_0xa28a('0x20')]);_0x480096[_0xa28a('0x1d')]=qs[_0xa28a('0x1d')](_0x15ac97['query']['offset']);}_0x480096[_0xa28a('0x39')]=qs[_0xa28a('0x3a')](_0x15ac97[_0xa28a('0x32')][_0xa28a('0x3a')]);_0x480096[_0xa28a('0x3b')]=qs[_0xa28a('0x33')](_[_0xa28a('0x3c')](_0x15ac97[_0xa28a('0x32')],_0x2f0647[_0xa28a('0x33')]),_0x563963);if(_0x15ac97[_0xa28a('0x32')][_0xa28a('0x3d')]){_0x480096['where']=_[_0xa28a('0x3e')](_0x480096['where'],{'$or':_[_0xa28a('0x31')](_0x563963,function(_0x2b0b10){if(_0x2b0b10[_0xa28a('0x2e')]!=='VIRTUAL'){var _0x10ceaf={};_0x10ceaf[_0x2b0b10['name']]={'$like':'%'+_0x15ac97[_0xa28a('0x32')][_0xa28a('0x3d')]+'%'};return _0x10ceaf;}})});}_0x480096=_[_0xa28a('0x3e')]({},_0x480096,_0x15ac97['options']);var _0x5f49ec={'where':_0x480096['where']};return db[_0xa28a('0x3f')]['count'](_0x5f49ec)[_0xa28a('0x26')](function(_0x5165cb){_0xeeb9fa['count']=_0x5165cb;if(_0x15ac97[_0xa28a('0x32')][_0xa28a('0x40')]){_0x480096['include']=[{'all':!![]}];}return db[_0xa28a('0x3f')][_0xa28a('0x41')](_0x480096);})[_0xa28a('0x26')](function(_0x31f476){_0xeeb9fa[_0xa28a('0x42')]=_0x31f476;return _0xeeb9fa;})[_0xa28a('0x26')](respondWithFilteredResult(_0x2572cc,_0x480096))['catch'](handleError(_0x2572cc,null));};exports[_0xa28a('0x43')]=function(_0x2b1db4,_0x386d99){var _0x28ff42={'raw':!![],'where':{'id':_0x2b1db4[_0xa28a('0x44')]['id']}},_0x280757={};_0x280757[_0xa28a('0x30')]=_[_0xa28a('0x45')](db[_0xa28a('0x3f')][_0xa28a('0x2c')]);_0x280757[_0xa28a('0x32')]=_[_0xa28a('0x45')](_0x2b1db4[_0xa28a('0x32')]);_0x280757[_0xa28a('0x33')]=_[_0xa28a('0x34')](_0x280757[_0xa28a('0x30')],_0x280757[_0xa28a('0x32')]);_0x28ff42[_0xa28a('0x35')]=_['intersection'](_0x280757['model'],qs['fields'](_0x2b1db4[_0xa28a('0x32')][_0xa28a('0x36')]));_0x28ff42['attributes']=_0x28ff42[_0xa28a('0x35')][_0xa28a('0x37')]?_0x28ff42['attributes']:_0x280757['model'];if(_0x2b1db4['query'][_0xa28a('0x40')]){_0x28ff42[_0xa28a('0x46')]=[{'all':!![]}];}_0x28ff42=_['merge']({},_0x28ff42,_0x2b1db4[_0xa28a('0x47')]);return db[_0xa28a('0x3f')][_0xa28a('0x48')](_0x28ff42)[_0xa28a('0x26')](handleEntityNotFound(_0x386d99,null))[_0xa28a('0x26')](respondWithResult(_0x386d99,null))[_0xa28a('0x49')](handleError(_0x386d99,null));};exports[_0xa28a('0x4a')]=function(_0x173145,_0xac40bb){var _0x352f83={'where':{'id':_0x173145['params']['id']}},_0x50d242={};_0x50d242[_0xa28a('0x30')]=_[_0xa28a('0x45')](db['Attachment'][_0xa28a('0x2c')]);_0x352f83['attributes']=_[_0xa28a('0x34')](_0x50d242['model'],qs[_0xa28a('0x36')](_0x173145['query'][_0xa28a('0x36')]));_0x352f83[_0xa28a('0x35')]=_0x352f83[_0xa28a('0x35')][_0xa28a('0x37')]?_0x352f83[_0xa28a('0x35')]:_0x50d242[_0xa28a('0x30')];if(_0x173145[_0xa28a('0x32')][_0xa28a('0x40')]){_0x352f83[_0xa28a('0x46')]=[{'all':!![]}];}_0x352f83=_[_0xa28a('0x3e')]({},_0x352f83,_0x173145[_0xa28a('0x47')]);return db[_0xa28a('0x3f')][_0xa28a('0x48')](_0x352f83)['then'](handleEntityNotFound(_0xac40bb,null))[_0xa28a('0x26')](function(_0x43b6ee){if(_0x43b6ee){var _0x3331c7=_0x43b6ee[_0xa28a('0x4b')]({'plain':!![]});_0x3331c7=qs[_0xa28a('0x4c')](_0x3331c7,['id',_0xa28a('0x4d'),_0xa28a('0x4e')]);_0x173145[_0xa28a('0x4f')]=_[_0xa28a('0x4c')](_0x173145[_0xa28a('0x4f')],['id',_0xa28a('0x4d'),'updatedAt']);return db[_0xa28a('0x3f')][_0xa28a('0x50')](_[_0xa28a('0x3e')](_0x3331c7,_0x173145[_0xa28a('0x4f')]),{'include':_0x173145['query'][_0xa28a('0x40')]?[{'all':!![]}]:undefined});}})[_0xa28a('0x26')](respondWithResult(_0xac40bb,0xc9))[_0xa28a('0x49')](handleError(_0xac40bb,null));};exports[_0xa28a('0x25')]=function(_0xfb6c71,_0xcc22ae){if(_0xfb6c71[_0xa28a('0x4f')]['id']){delete _0xfb6c71[_0xa28a('0x4f')]['id'];}return db[_0xa28a('0x3f')]['find']({'where':{'id':_0xfb6c71['params']['id']}})['then'](handleEntityNotFound(_0xcc22ae,null))[_0xa28a('0x26')](saveUpdates(_0xfb6c71[_0xa28a('0x4f')],null))['then'](respondWithResult(_0xcc22ae,null))[_0xa28a('0x49')](handleError(_0xcc22ae,null));};exports[_0xa28a('0x27')]=function(_0x52c6ba,_0x1c9c79){return db[_0xa28a('0x3f')][_0xa28a('0x48')]({'where':{'id':_0x52c6ba[_0xa28a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c9c79,null))[_0xa28a('0x26')](removeEntity(_0x1c9c79,null))[_0xa28a('0x49')](handleError(_0x1c9c79,null));};exports[_0xa28a('0x50')]=function(_0x1975ba,_0x505bca,_0x2681a3){_0x1975ba[_0xa28a('0x4f')][_0xa28a('0x2a')]=_0x1975ba[_0xa28a('0x51')]['originalname'];_0x1975ba['body'][_0xa28a('0x52')]=_0x1975ba[_0xa28a('0x51')][_0xa28a('0x53')];_0x1975ba[_0xa28a('0x4f')][_0xa28a('0x2e')]=_0x1975ba['file'][_0xa28a('0x54')];return db[_0xa28a('0x3f')]['create'](_0x1975ba[_0xa28a('0x4f')])[_0xa28a('0x26')](respondWithResult(_0x505bca,0xc9))['catch'](handleError(_0x505bca,null));};exports[_0xa28a('0x55')]=function(_0x37806b,_0x5f05bb,_0x3f5cb7){return db[_0xa28a('0x3f')][_0xa28a('0x56')]({'where':{'id':_0x37806b[_0xa28a('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5f05bb,null))['then'](function(_0x35ebe8){if(_0x35ebe8){var _0x4c68d4=_0x35ebe8[_0xa28a('0x57')]!==null;var _0x3b9e1e=path[_0xa28a('0x58')](config[_0xa28a('0x59')],'server/files/attachments/');if(_0x4c68d4){_0x3b9e1e=path[_0xa28a('0x58')](_0x3b9e1e,'offline-chat/');}var _0x2ff28a=path[_0xa28a('0x58')](_0x3b9e1e,_0x35ebe8[_0xa28a('0x52')]);return _0x5f05bb[_0xa28a('0x55')](_0x2ff28a);}})[_0xa28a('0x49')](handleError(_0x5f05bb,null));};
\ No newline at end of file
index 03e6e4e..3c13258 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15d8=['Attachment','attachments','lodash','../../config/logger','api','moment','bluebird','../../config/environment','./attachment.attributes','exports','define'];(function(_0x720b74,_0x4ecf2b){var _0x2e7715=function(_0x961b89){while(--_0x961b89){_0x720b74['push'](_0x720b74['shift']());}};_0x2e7715(++_0x4ecf2b);}(_0x15d8,0x1e6));var _0x815d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x15d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x815d('0x0'));var util=require('util');var logger=require(_0x815d('0x1'))(_0x815d('0x2'));var moment=require(_0x815d('0x3'));var BPromise=require(_0x815d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x815d('0x5'));var attributes=require(_0x815d('0x6'));module[_0x815d('0x7')]=function(_0x4b6991,_0x48da01){return _0x4b6991[_0x815d('0x8')](_0x815d('0x9'),attributes,{'tableName':_0x815d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc62c=['request-promise','path','rimraf','./attachment.attributes','exports','define','Attachment','attachments','lodash','../../config/logger','moment','bluebird'];(function(_0x921f7a,_0x361b59){var _0x2ae9a2=function(_0x3f370c){while(--_0x3f370c){_0x921f7a['push'](_0x921f7a['shift']());}};_0x2ae9a2(++_0x361b59);}(_0xc62c,0xc8));var _0xcc62=function(_0x34aec2,_0xb610fd){_0x34aec2=_0x34aec2-0x0;var _0x2d36f2=_0xc62c[_0x34aec2];return _0x2d36f2;};'use strict';var _=require(_0xcc62('0x0'));var util=require('util');var logger=require(_0xcc62('0x1'))('api');var moment=require(_0xcc62('0x2'));var BPromise=require(_0xcc62('0x3'));var rp=require(_0xcc62('0x4'));var fs=require('fs');var path=require(_0xcc62('0x5'));var rimraf=require(_0xcc62('0x6'));var config=require('../../config/environment');var attributes=require(_0xcc62('0x7'));module[_0xcc62('0x8')]=function(_0x496fb2,_0x452145){return _0x496fb2[_0xcc62('0x9')](_0xcc62('0xa'),attributes,{'tableName':_0xcc62('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cbd4fee..db88ad1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa2b=['Attachment','create','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','code','error','message','result','CreateAttachment'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x109a21,_0x1f1c57){_0x109a21=_0x109a21-0x0;var _0x16468e=_0xfa2b[_0x109a21];return _0x16468e;};'use strict';var _=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var moment=require(_0xbfa2('0x2'));var BPromise=require(_0xbfa2('0x3'));var rs=require(_0xbfa2('0x4'));var fs=require('fs');var Redis=require(_0xbfa2('0x5'));var db=require(_0xbfa2('0x6'))['db'];var utils=require(_0xbfa2('0x7'));var logger=require(_0xbfa2('0x8'))(_0xbfa2('0x9'));var config=require(_0xbfa2('0xa'));var jayson=require(_0xbfa2('0xb'));var client=jayson[_0xbfa2('0xc')][_0xbfa2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x26ed93,_0x26e9bf,_0x4cd9ae){return new BPromise(function(_0x46a151,_0x4f17e6){return client[_0xbfa2('0xe')](_0x26ed93,_0x4cd9ae)[_0xbfa2('0xf')](function(_0x1b1c13){logger[_0xbfa2('0x10')](_0xbfa2('0x11'),_0x26e9bf,_0xbfa2('0x12'));logger[_0xbfa2('0x13')](_0xbfa2('0x14'),_0x26e9bf,_0xbfa2('0x12'),JSON['stringify'](_0x1b1c13));if(_0x1b1c13['error']){if(_0x1b1c13['error'][_0xbfa2('0x15')]===0x1f4){logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x4f17e6(_0x1b1c13[_0xbfa2('0x16')]['message']);}logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x46a151(_0x1b1c13[_0xbfa2('0x16')]['message']);}else{logger[_0xbfa2('0x10')]('Attachment,\x20%s,\x20%s',_0x26e9bf,'request\x20sent');_0x46a151(_0x1b1c13[_0xbfa2('0x18')]['message']);}})['catch'](function(_0xab2c91){logger[_0xbfa2('0x16')]('Attachment,\x20%s,\x20%s',_0x26e9bf,_0xab2c91);_0x4f17e6(_0xab2c91);});});}exports[_0xbfa2('0x19')]=function(_0x12627a){var _0x28fe6f=this;return new Promise(function(_0x4088c5,_0x37aed6){return db[_0xbfa2('0x1a')][_0xbfa2('0x1b')](_0x12627a['body'],{'raw':_0x12627a[_0xbfa2('0x1c')]?_0x12627a[_0xbfa2('0x1c')][_0xbfa2('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x2ac6c3){logger[_0xbfa2('0x10')]('CreateAttachment',_0x12627a);logger[_0xbfa2('0x13')]('CreateAttachment',_0x12627a,JSON['stringify'](_0x2ac6c3));_0x4088c5(_0x2ac6c3);})[_0xbfa2('0x1e')](function(_0xdb059b){logger[_0xbfa2('0x16')](_0xbfa2('0x19'),_0xdb059b['message'],_0x12627a);_0x37aed6(_0x28fe6f['error'](0x1f4,_0xdb059b[_0xbfa2('0x17')]));});});};
\ No newline at end of file
+var _0x8388=['rpc','jayson/promise','client','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','Attachment,\x20%s,\x20%s','info','result','catch','CreateAttachment','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5ef161,_0x27d16c){var _0x1c6e9e=function(_0x8fc2a6){while(--_0x8fc2a6){_0x5ef161['push'](_0x5ef161['shift']());}};_0x1c6e9e(++_0x27d16c);}(_0x8388,0x18d));var _0x8838=function(_0x5f3905,_0x43a651){_0x5f3905=_0x5f3905-0x0;var _0x2923b1=_0x8388[_0x5f3905];return _0x2923b1;};'use strict';var _=require(_0x8838('0x0'));var util=require(_0x8838('0x1'));var moment=require(_0x8838('0x2'));var BPromise=require(_0x8838('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8838('0x4'));var db=require(_0x8838('0x5'))['db'];var utils=require(_0x8838('0x6'));var logger=require(_0x8838('0x7'))(_0x8838('0x8'));var config=require('../../config/environment');var jayson=require(_0x8838('0x9'));var client=jayson[_0x8838('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xca2d0f,_0x2d9615,_0x27707c){return new BPromise(function(_0x56596f,_0x4645f4){return client['request'](_0xca2d0f,_0x27707c)['then'](function(_0x8555b2){logger['info']('Attachment,\x20%s,\x20%s',_0x2d9615,_0x8838('0xb'));logger[_0x8838('0xc')](_0x8838('0xd'),_0x2d9615,_0x8838('0xb'),JSON['stringify'](_0x8555b2));if(_0x8555b2[_0x8838('0xe')]){if(_0x8555b2[_0x8838('0xe')][_0x8838('0xf')]===0x1f4){logger[_0x8838('0xe')]('Attachment,\x20%s,\x20%s',_0x2d9615,_0x8555b2[_0x8838('0xe')]['message']);return _0x4645f4(_0x8555b2['error'][_0x8838('0x10')]);}logger[_0x8838('0xe')](_0x8838('0x11'),_0x2d9615,_0x8555b2[_0x8838('0xe')][_0x8838('0x10')]);return _0x56596f(_0x8555b2[_0x8838('0xe')][_0x8838('0x10')]);}else{logger[_0x8838('0x12')]('Attachment,\x20%s,\x20%s',_0x2d9615,_0x8838('0xb'));_0x56596f(_0x8555b2[_0x8838('0x13')]['message']);}})[_0x8838('0x14')](function(_0xab3fb8){logger[_0x8838('0xe')]('Attachment,\x20%s,\x20%s',_0x2d9615,_0xab3fb8);_0x4645f4(_0xab3fb8);});});}exports[_0x8838('0x15')]=function(_0x522d44){var _0xc4129=this;return new Promise(function(_0x204120,_0xe9e4f4){return db['Attachment'][_0x8838('0x16')](_0x522d44[_0x8838('0x17')],{'raw':_0x522d44['options']?_0x522d44[_0x8838('0x18')][_0x8838('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x9de0f6){logger[_0x8838('0x12')]('CreateAttachment',_0x522d44);logger['debug'](_0x8838('0x15'),_0x522d44,JSON[_0x8838('0x1a')](_0x9de0f6));_0x204120(_0x9de0f6);})[_0x8838('0x14')](function(_0xb74e1b){logger[_0x8838('0xe')](_0x8838('0x15'),_0xb74e1b[_0x8838('0x10')],_0x522d44);_0xe9e4f4(_0xc4129[_0x8838('0xe')](0x1f4,_0xb74e1b[_0x8838('0x10')]));});});};
\ No newline at end of file
index b52c780..af792d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb28,0x106));var _0x8db2=function(_0x5526c4,_0x2f9faf){_0x5526c4=_0x5526c4-0x0;var _0x5b6678=_0xdb28[_0x5526c4];return _0x5b6678;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
+var _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x10c95f,_0x5affe0){var _0x1ae957=function(_0x12e2a0){while(--_0x12e2a0){_0x10c95f['push'](_0x10c95f['shift']());}};_0x1ae957(++_0x5affe0);}(_0x2032,0xd9));var _0x2203=function(_0x13b4ea,_0x17b356){_0x13b4ea=_0x13b4ea-0x0;var _0x14f2bf=_0x2032[_0x13b4ea];return _0x14f2bf;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
index 53feb84..deb39de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1170=['Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','Strategy','moment','activedirectory2','util','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','blockDuration','then','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blockedAt','online','admin','user','agent','domain','blocked','minutes','getLicense','catch','status','send','message','login','authenticate','ad-login'];(function(_0x65259c,_0x3b4cf9){var _0x2f9c3a=function(_0x49d13e){while(--_0x49d13e){_0x65259c['push'](_0x65259c['shift']());}};_0x2f9c3a(++_0x3b4cf9);}(_0x1170,0xbd));var _0x0117=function(_0x17ae3c,_0x4e15d5){_0x17ae3c=_0x17ae3c-0x0;var _0x56fab6=_0x1170[_0x17ae3c];return _0x56fab6;};'use strict';var passport=require(_0x0117('0x0'));var LocalStrategy=require('passport-local')[_0x0117('0x1')];var moment=require(_0x0117('0x2'));var ActiveDirectory=require(_0x0117('0x3'));var BPromise=require('bluebird');var util=require(_0x0117('0x4'));var db=require('../../mysqldb')['db'];var authService=require(_0x0117('0x5'));var utils=require(_0x0117('0x6'));var config=require('../../config/environment');var logger=require(_0x0117('0x7'))(_0x0117('0x8'));function isActiveDirectoryConfigured(_0xdcfbc1){var _0x1ae28c=![];if(typeof _0xdcfbc1[_0x0117('0x9')]!=='undefined'){_0x1ae28c=_0xdcfbc1[_0x0117('0x9')]['baseDN']&&_0xdcfbc1['activedirectory']['url']&&_0xdcfbc1[_0x0117('0x9')]['domain'];}return _0x1ae28c;}function adAuthenticate(_0x31e011,_0x4b7c63,_0x1d0fde){return new BPromise(function(_0x16bfa4,_0x105876){try{var _0x1cedcd=new ActiveDirectory(_0x31e011);_0x1cedcd['authenticate'](_0x4b7c63,_0x1d0fde,function(_0x596f85,_0x564866){if(_0x596f85){logger['error']('Error\x20authenticate\x20%s:\x20%s',_0x4b7c63,util['inspect'](_0x596f85,{'showHidden':![],'depth':null}));_0x105876(_0x0117('0xa'));}else if(!_0x564866){logger[_0x0117('0xb')](_0x0117('0xc'),_0x4b7c63);_0x105876('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x16bfa4(_0x564866);}});}catch(_0x4fa1c5){_0x105876(_0x4fa1c5);}});}function ActiveDirectoryAuthenticate(_0x49363f,_0x4bfc0c,_0xa1ac5b,_0x3018e1){var _0x4cdaa2,_0x569916;if(!isActiveDirectoryConfigured(config)){logger[_0x0117('0xb')](_0x0117('0xd'),_0x4bfc0c);return _0x3018e1(null,![],{'message':_0x0117('0xa')});}return db[_0x0117('0xe')][_0x0117('0xf')]({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x0117('0x10')],'raw':!![]})[_0x0117('0x11')](function(_0x4f1c15){_0x4cdaa2=_0x4f1c15;if(!_0x4cdaa2[_0x0117('0x12')]){logger['error'](_0x0117('0x13'),_0x4bfc0c);throw new Error(_0x0117('0xa'));}return _0x49363f['findOne']({'attributes':['id',_0x0117('0x14'),_0x0117('0x15'),_0x0117('0x16'),_0x0117('0x17'),_0x0117('0x18'),'blocked',_0x0117('0x19'),_0x0117('0x1a')],'where':{'name':_0x4bfc0c,'role':{'$or':[_0x0117('0x1b'),_0x0117('0x1c'),_0x0117('0x1d')]},'adSsoEnabled':!![]}});})[_0x0117('0x11')](function(_0x4ce874){if(!_0x4ce874||_0x4ce874&&_0x4ce874[_0x0117('0x14')]!==_0x4bfc0c){throw new Error(_0x0117('0xa'));}_0x569916=_0x4ce874;var _0x46d676=_0x569916[_0x0117('0x14')]+'@'+config['activedirectory'][_0x0117('0x1e')];return adAuthenticate(config[_0x0117('0x9')],_0x46d676,_0xa1ac5b);})['then'](function(_0x46ff70){if(_0x569916[_0x0117('0x18')]){throw new Error(_0x0117('0xa'));}if(_0x4cdaa2[_0x0117('0x10')]>0x0){if(_0x569916[_0x0117('0x1f')]){if(moment(_0x569916[_0x0117('0x19')])['add'](_0x4cdaa2[_0x0117('0x10')],_0x0117('0x20'))>moment()){throw new Error(_0x0117('0xa'));}return utils['clearBlockUser'](_0x569916,0x0,![],null)[_0x0117('0x11')](function(){return utils['getLicense'](_0x569916);})['then'](function(){return _0x3018e1(null,_0x569916);});}else{return utils['getLicense'](_0x569916)[_0x0117('0x11')](function(){return _0x3018e1(null,_0x569916);});}}else{return utils[_0x0117('0x21')](_0x569916)[_0x0117('0x11')](function(){return _0x3018e1(null,_0x569916);});}})[_0x0117('0x22')](function(_0x4835e9){return _0x3018e1(null,![],_0x4835e9);});}function handleError(_0x587b59,_0x33201b,_0x1c74fd){return _0x587b59[_0x0117('0x23')](_0x33201b||0x1f4)[_0x0117('0x24')]({'message':_0x1c74fd?_0x1c74fd[_0x0117('0x25')]||_0x1c74fd:''});}exports[_0x0117('0x26')]=function(_0x554ede,_0x2491a6,_0x11db01){passport[_0x0117('0x27')](_0x0117('0x28'),function(_0x16c3ae,_0x4a55c5,_0x38ab8b){var _0x25d9b3=_0x16c3ae||_0x38ab8b;if(_0x25d9b3){return handleError(_0x2491a6,0x191,_0x25d9b3);}if(!_0x4a55c5){return handleError(_0x2491a6,0x194,{'message':_0x0117('0x29')});}else{var _0x546b98={'payload':{'id':_0x4a55c5['id'],'role':_0x4a55c5[_0x0117('0x17')]},'options':{'expiresIn':0x15180}};return authService[_0x0117('0x2a')](_0x546b98)[_0x0117('0x11')](function(_0x54d0c0){_0x2491a6[_0x0117('0x2b')]({'id':_0x4a55c5['id'],'token':_0x54d0c0,'statusCall':'','isAlreadyLogged':_0x4a55c5[_0x0117('0x1a')]});});}})(_0x554ede,_0x2491a6,_0x11db01);};passport[_0x0117('0x2c')](_0x0117('0x28'),new LocalStrategy({'usernameField':_0x0117('0x14'),'passwordField':_0x0117('0x15')},function(_0x1f084a,_0x4a3326,_0x5218e0){return ActiveDirectoryAuthenticate(db[_0x0117('0x2d')],_0x1f084a,_0x4a3326,_0x5218e0);}));
\ No newline at end of file
+var _0x04b7=['../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','activedirectory','baseDN','url','domain','authenticate','error','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','role','disabled','online','admin','user','agent','blocked','blockedAt','minutes','clearBlockUser','getLicense','catch','status','send','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','name','activedirectory2','bluebird','util'];(function(_0x444962,_0x931e2d){var _0x429b11=function(_0x30eaf1){while(--_0x30eaf1){_0x444962['push'](_0x444962['shift']());}};_0x429b11(++_0x931e2d);}(_0x04b7,0x105));var _0x704b=function(_0x263b1f,_0x3f2376){_0x263b1f=_0x263b1f-0x0;var _0x4aa612=_0x04b7[_0x263b1f];return _0x4aa612;};'use strict';var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var moment=require('moment');var ActiveDirectory=require(_0x704b('0x0'));var BPromise=require(_0x704b('0x1'));var util=require(_0x704b('0x2'));var db=require(_0x704b('0x3'))['db'];var authService=require(_0x704b('0x4'));var utils=require(_0x704b('0x5'));var config=require('../../config/environment');var logger=require(_0x704b('0x6'))('api');function isActiveDirectoryConfigured(_0x1039d4){var _0x1232d5=![];if(typeof _0x1039d4[_0x704b('0x7')]!=='undefined'){_0x1232d5=_0x1039d4[_0x704b('0x7')][_0x704b('0x8')]&&_0x1039d4[_0x704b('0x7')][_0x704b('0x9')]&&_0x1039d4[_0x704b('0x7')][_0x704b('0xa')];}return _0x1232d5;}function adAuthenticate(_0x4a6740,_0x34f123,_0x49e40e){return new BPromise(function(_0x572e56,_0x149ce7){try{var _0x5d8811=new ActiveDirectory(_0x4a6740);_0x5d8811[_0x704b('0xb')](_0x34f123,_0x49e40e,function(_0x2757ef,_0x549a0b){if(_0x2757ef){logger[_0x704b('0xc')]('Error\x20authenticate\x20%s:\x20%s',_0x34f123,util[_0x704b('0xd')](_0x2757ef,{'showHidden':![],'depth':null}));_0x149ce7('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x549a0b){logger['error'](_0x704b('0xe'),_0x34f123);_0x149ce7(_0x704b('0xf'));}else{_0x572e56(_0x549a0b);}});}catch(_0x575e09){_0x149ce7(_0x575e09);}});}function ActiveDirectoryAuthenticate(_0x2b1ede,_0x1e495f,_0x314ffb,_0x42d812){var _0x14ebb9,_0x5b68f9;if(!isActiveDirectoryConfigured(config)){logger[_0x704b('0xc')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x1e495f);return _0x42d812(null,![],{'message':_0x704b('0xf')});}return db[_0x704b('0x10')][_0x704b('0x11')]({'where':{'id':0x1},'attributes':[_0x704b('0x12'),_0x704b('0x13')],'raw':!![]})[_0x704b('0x14')](function(_0x5a1516){_0x14ebb9=_0x5a1516;if(!_0x14ebb9[_0x704b('0x12')]){logger[_0x704b('0xc')](_0x704b('0x15'),_0x1e495f);throw new Error(_0x704b('0xf'));}return _0x2b1ede[_0x704b('0x11')]({'attributes':['id','name',_0x704b('0x16'),_0x704b('0x17'),_0x704b('0x18'),_0x704b('0x19'),'blocked','blockedAt',_0x704b('0x1a')],'where':{'name':_0x1e495f,'role':{'$or':[_0x704b('0x1b'),_0x704b('0x1c'),_0x704b('0x1d')]},'adSsoEnabled':!![]}});})['then'](function(_0x12155c){if(!_0x12155c||_0x12155c&&_0x12155c['name']!==_0x1e495f){throw new Error(_0x704b('0xf'));}_0x5b68f9=_0x12155c;var _0x112ad1=_0x5b68f9['name']+'@'+config[_0x704b('0x7')][_0x704b('0xa')];return adAuthenticate(config[_0x704b('0x7')],_0x112ad1,_0x314ffb);})[_0x704b('0x14')](function(_0x47173b){if(_0x5b68f9[_0x704b('0x19')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x14ebb9[_0x704b('0x13')]>0x0){if(_0x5b68f9[_0x704b('0x1e')]){if(moment(_0x5b68f9[_0x704b('0x1f')])['add'](_0x14ebb9['blockDuration'],_0x704b('0x20'))>moment()){throw new Error(_0x704b('0xf'));}return utils[_0x704b('0x21')](_0x5b68f9,0x0,![],null)[_0x704b('0x14')](function(){return utils[_0x704b('0x22')](_0x5b68f9);})['then'](function(){return _0x42d812(null,_0x5b68f9);});}else{return utils[_0x704b('0x22')](_0x5b68f9)[_0x704b('0x14')](function(){return _0x42d812(null,_0x5b68f9);});}}else{return utils[_0x704b('0x22')](_0x5b68f9)[_0x704b('0x14')](function(){return _0x42d812(null,_0x5b68f9);});}})[_0x704b('0x23')](function(_0x5dcede){return _0x42d812(null,![],_0x5dcede);});}function handleError(_0x42f3c2,_0xf9e754,_0x387d27){return _0x42f3c2[_0x704b('0x24')](_0xf9e754||0x1f4)[_0x704b('0x25')]({'message':_0x387d27?_0x387d27['message']||_0x387d27:''});}exports['login']=function(_0x5af0ec,_0x34fb69,_0x40b01e){passport[_0x704b('0xb')](_0x704b('0x26'),function(_0x4cf62a,_0x3fbd33,_0x382414){var _0x46bcb3=_0x4cf62a||_0x382414;if(_0x46bcb3){return handleError(_0x34fb69,0x191,_0x46bcb3);}if(!_0x3fbd33){return handleError(_0x34fb69,0x194,{'message':_0x704b('0x27')});}else{var _0x5a1176={'payload':{'id':_0x3fbd33['id'],'role':_0x3fbd33[_0x704b('0x18')]},'options':{'expiresIn':0x15180}};return authService[_0x704b('0x28')](_0x5a1176)[_0x704b('0x14')](function(_0x727b9d){_0x34fb69[_0x704b('0x29')]({'id':_0x3fbd33['id'],'token':_0x727b9d,'statusCall':'','isAlreadyLogged':_0x3fbd33[_0x704b('0x1a')]});});}})(_0x5af0ec,_0x34fb69,_0x40b01e);};passport[_0x704b('0x2a')](_0x704b('0x26'),new LocalStrategy({'usernameField':_0x704b('0x2b'),'passwordField':_0x704b('0x16')},function(_0x561b56,_0x4c4ba0,_0x248b06){return ActiveDirectoryAuthenticate(db['User'],_0x561b56,_0x4c4ba0,_0x248b06);}));
\ No newline at end of file
index e9b9343..372a23e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5621=['./authActiveDirectory.controller','exports','express','Router'];(function(_0x49ab9e,_0x2b70dd){var _0x29b735=function(_0x2d41d3){while(--_0x2d41d3){_0x49ab9e['push'](_0x49ab9e['shift']());}};_0x29b735(++_0x2b70dd);}(_0x5621,0xbe));var _0x1562=function(_0x15279e,_0x2051f1){_0x15279e=_0x15279e-0x0;var _0x5c3571=_0x5621[_0x15279e];return _0x5c3571;};'use strict';var express=require(_0x1562('0x0'));var router=express[_0x1562('0x1')]();var controller=require(_0x1562('0x2'));router['post']('/',controller['login']);module[_0x1562('0x3')]=router;
\ No newline at end of file
+var _0xe68f=['./authActiveDirectory.controller','post','login','exports','express','Router'];(function(_0xfb1077,_0x4e81ff){var _0xe73c1=function(_0x112675){while(--_0x112675){_0xfb1077['push'](_0xfb1077['shift']());}};_0xe73c1(++_0x4e81ff);}(_0xe68f,0x94));var _0xfe68=function(_0x4db48e,_0x241ab6){_0x4db48e=_0x4db48e-0x0;var _0x37167e=_0xe68f[_0x4db48e];return _0x37167e;};'use strict';var express=require(_0xfe68('0x0'));var router=express[_0xfe68('0x1')]();var controller=require(_0xfe68('0x2'));router[_0xfe68('0x3')]('/',controller[_0xfe68('0x4')]);module[_0xfe68('0x5')]=router;
\ No newline at end of file
index 5c2263b..d2066f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7a54,0x106));var _0x47a5=function(_0x591e1b,_0x19a4f0){_0x591e1b=_0x591e1b-0x0;var _0x81f866=_0x7a54[_0x591e1b];return _0x81f866;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x178f3e,_0x567056){var _0x2c73ab=function(_0x240923){while(--_0x240923){_0x178f3e['push'](_0x178f3e['shift']());}};_0x2c73ab(++_0x567056);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
index 25251c8..bb84365 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69e8=['get','/callback','login','setTokenCookie','exports','express','Router','./authGoogle.controller','../../components/auth/service'];(function(_0x50afb1,_0x4e137e){var _0x453119=function(_0x123b7d){while(--_0x123b7d){_0x50afb1['push'](_0x50afb1['shift']());}};_0x453119(++_0x4e137e);}(_0x69e8,0x137));var _0x869e=function(_0x313b59,_0x271d98){_0x313b59=_0x313b59-0x0;var _0x760cd1=_0x69e8[_0x313b59];return _0x760cd1;};'use strict';var express=require(_0x869e('0x0'));var passport=require('passport');var router=express[_0x869e('0x1')]();var controller=require(_0x869e('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x869e('0x3'));router['get']('/',controller['login']);router[_0x869e('0x4')](_0x869e('0x5'),controller['callback'],authService['isMiddleware'],userController[_0x869e('0x6')],authService[_0x869e('0x7')]);module[_0x869e('0x8')]=router;
\ No newline at end of file
+var _0x4a3f=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','setTokenCookie','exports','express','passport','Router'];(function(_0x492813,_0x4fad44){var _0x1c30ab=function(_0x454c23){while(--_0x454c23){_0x492813['push'](_0x492813['shift']());}};_0x1c30ab(++_0x4fad44);}(_0x4a3f,0x101));var _0xf4a3=function(_0x571a17,_0x63fb3d){_0x571a17=_0x571a17-0x0;var _0x3ef337=_0x4a3f[_0x571a17];return _0x3ef337;};'use strict';var express=require(_0xf4a3('0x0'));var passport=require(_0xf4a3('0x1'));var router=express[_0xf4a3('0x2')]();var controller=require(_0xf4a3('0x3'));var userController=require(_0xf4a3('0x4'));var authService=require(_0xf4a3('0x5'));router[_0xf4a3('0x6')]('/',controller[_0xf4a3('0x7')]);router['get'](_0xf4a3('0x8'),controller[_0xf4a3('0x9')],authService[_0xf4a3('0xa')],userController[_0xf4a3('0x7')],authService[_0xf4a3('0xb')]);module[_0xf4a3('0xc')]=router;
\ No newline at end of file
index b897db8..44f01f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90d2=['Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','user','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','reset','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','blockDuration','then','findOne','name','password','role','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','add','minutes','clearBlockUser','allowedLoginAttempts','getLicense','catch','find','MailServerOut','Smtp','CloudProvider'];(function(_0x17b45f,_0x2353cc){var _0x31a460=function(_0x27084f){while(--_0x27084f){_0x17b45f['push'](_0x17b45f['shift']());}};_0x31a460(++_0x2353cc);}(_0x90d2,0x86));var _0x290d=function(_0x558797,_0x387f41){_0x558797=_0x558797-0x0;var _0x29ac55=_0x90d2[_0x558797];return _0x29ac55;};'use strict';var util=require(_0x290d('0x0'));var passport=require(_0x290d('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0x290d('0x2'));var _=require('lodash');var rs=require(_0x290d('0x3'));var moment=require('moment');var db=require(_0x290d('0x4'))['db'];var authService=require(_0x290d('0x5'));var utils=require(_0x290d('0x6'));var client=jayson[_0x290d('0x7')][_0x290d('0x8')]({'port':0x232b});function localAuthenticate(_0x456c97,_0x416f5b,_0x4eeddf,_0x3aeb85){var _0x286134,_0x2fe9f7;return db[_0x290d('0x9')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x290d('0xa')],'raw':!![]})[_0x290d('0xb')](function(_0x21e6e8){_0x286134=_0x21e6e8;return _0x456c97[_0x290d('0xc')]({'attributes':['id',_0x290d('0xd'),_0x290d('0xe'),'salt',_0x290d('0xf'),'disabled',_0x290d('0x10'),_0x290d('0x11'),_0x290d('0x12')],'where':{'name':_0x416f5b,'role':{'$or':[_0x290d('0x13'),'user',_0x290d('0x14')]}}});})[_0x290d('0xb')](function(_0x19b2b3){if(!_0x19b2b3||_0x19b2b3&&_0x19b2b3[_0x290d('0xd')]!==_0x416f5b){throw new Error(_0x290d('0x15'));}else{_0x2fe9f7=_0x19b2b3;return _0x2fe9f7;}})[_0x290d('0xb')](function(){_0x2fe9f7[_0x290d('0x16')](_0x4eeddf,function(_0x39a335,_0x47a028){var _0x3b5ce9=_0x2fe9f7[_0x290d('0x12')]+0x1;if(_0x39a335){return _0x3aeb85(_0x39a335);}else if(!_0x47a028){if(_0x2fe9f7[_0x290d('0x17')]){return _0x3aeb85(null,![],{'message':_0x290d('0x15')});}else if(_0x286134['allowedLoginAttempts']>0x0){if(_0x2fe9f7['blocked']){if(_0x286134[_0x290d('0xa')]>0x0){if(moment(_0x2fe9f7['blockedAt'])[_0x290d('0x18')](_0x286134[_0x290d('0xa')],_0x290d('0x19'))>moment()){return _0x3aeb85(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x290d('0x1a')](_0x2fe9f7,_0x3b5ce9,![],null)[_0x290d('0xb')](function(){return _0x3aeb85(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x3aeb85(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3b5ce9>=_0x286134['allowedLoginAttempts']){return utils[_0x290d('0x1a')](_0x2fe9f7,0x0,!![],moment())[_0x290d('0xb')](function(){return _0x3aeb85(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x290d('0x1a')](_0x2fe9f7,_0x3b5ce9,![],null)['then'](function(){return _0x3aeb85(null,![],{'message':_0x290d('0x15')});});}}}else{return _0x3aeb85(null,![],{'message':_0x290d('0x15')});}}else{if(_0x2fe9f7[_0x290d('0x17')]){return _0x3aeb85(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x286134[_0x290d('0x1b')]>0x0){if(_0x2fe9f7[_0x290d('0x10')]){if(_0x286134[_0x290d('0xa')]>0x0){if(moment(_0x2fe9f7[_0x290d('0x11')])[_0x290d('0x18')](_0x286134[_0x290d('0xa')],'minutes')>moment()){return _0x3aeb85(null,![],{'message':_0x290d('0x15')});}else{return utils[_0x290d('0x1a')](_0x2fe9f7,0x0,![],null)[_0x290d('0xb')](function(){return utils[_0x290d('0x1c')](_0x2fe9f7);})[_0x290d('0xb')](function(){return _0x3aeb85(null,_0x2fe9f7);});}}else{return _0x3aeb85(null,![],{'message':_0x290d('0x15')});}}else{return utils[_0x290d('0x1a')](_0x2fe9f7,0x0,![],null)[_0x290d('0xb')](function(){return utils['getLicense'](_0x2fe9f7);})[_0x290d('0xb')](function(){return _0x3aeb85(null,_0x2fe9f7);})[_0x290d('0x1d')](function(_0x3611fe){return _0x3aeb85(null,![],_0x3611fe);});}}else{if(_0x2fe9f7['blocked']){return _0x3aeb85(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x290d('0x1c')](_0x2fe9f7)['then'](function(){return _0x3aeb85(null,_0x2fe9f7);});}}}});})[_0x290d('0x1d')](function(_0x5e2066){return _0x3aeb85(null,![],_0x5e2066);});}function sendServiceMail(_0x3ff913){return db['MailAccount'][_0x290d('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x290d('0xd'),'email'],'include':[{'model':db[_0x290d('0x1f')],'as':_0x290d('0x20'),'include':[{'model':db[_0x290d('0x21')],'as':_0x290d('0x21')}]}]})[_0x290d('0xb')](function(_0x4a3a27){if(!_0x4a3a27){throw new Error(_0x290d('0x22'));}var _0x41b0a0=_0x4a3a27[_0x290d('0x23')]();var _0x1c5469={'account':_0x41b0a0,'message':_[_0x290d('0x24')]({'from':util[_0x290d('0x25')](_0x290d('0x26'),_0x4a3a27['name'],_0x4a3a27[_0x290d('0x27')]||_0x4a3a27['Smtp'][_0x290d('0x28')])},_0x3ff913)};return client[_0x290d('0x29')]('SendMail',_0x1c5469);})[_0x290d('0xb')](function(_0xe75085){if(_0xe75085[_0x290d('0x2a')]){throw new Error(util[_0x290d('0x25')](_0x290d('0x2b'),_0xe75085[_0x290d('0x2a')]['message']||JSON[_0x290d('0x2c')](_0xe75085['error'])));}return!![];});}function handleError(_0x2679cc,_0x1cbaff,_0x358bcd){return _0x2679cc['status'](_0x1cbaff||0x1f4)[_0x290d('0x2d')]({'message':_0x358bcd?_0x358bcd[_0x290d('0x2e')]||_0x358bcd:''});}exports[_0x290d('0x2f')]=function(_0x46521b,_0x3ce65e,_0x189c2c){passport['authenticate'](_0x290d('0x30'),function(_0x14173a,_0xb55f10,_0x3a3f1d){var _0x27db29=_0x14173a||_0x3a3f1d;if(_0x27db29){return handleError(_0x3ce65e,0x191,_0x27db29);}if(!_0xb55f10){return handleError(_0x3ce65e,0x194,{'message':_0x290d('0x31')});}else{var _0x5fe2b9={'payload':{'id':_0xb55f10['id'],'role':_0xb55f10[_0x290d('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x290d('0x32')](_0x5fe2b9)[_0x290d('0xb')](function(_0x562b15){_0x3ce65e[_0x290d('0x33')]({'id':_0xb55f10['id'],'token':_0x562b15,'statusCall':'','isAlreadyLogged':_0xb55f10[_0x290d('0x34')]});});}})(_0x46521b,_0x3ce65e,_0x189c2c);};exports[_0x290d('0x35')]=function(_0x30803a,_0x32f058){if(!_0x30803a['body'][_0x290d('0x27')]){return handleError(_0x32f058,0x1f4,{'message':_0x290d('0x36')});}var _0x1644f9=rs[_0x290d('0x37')]();_0x30803a[_0x290d('0x38')][_0x290d('0x27')]=_0x30803a[_0x290d('0x38')][_0x290d('0x27')]['trim']()[_0x290d('0x39')]();var _0x1db4a6;return db[_0x290d('0x9')][_0x290d('0xc')]({'where':{'id':0x1},'attributes':[_0x290d('0x1b'),'blockDuration'],'raw':!![]})['then'](function(_0x27cebe){_0x1db4a6=_0x27cebe;return db['User'][_0x290d('0x1e')]({'where':{'email':_0x30803a[_0x290d('0x38')][_0x290d('0x27')]}});})[_0x290d('0xb')](function(_0x37f187){if(!_0x37f187){throw new Error(_0x290d('0x3a'));}if(_0x37f187[_0x290d('0x17')]){throw new Error(_0x290d('0x3b'));}if(_0x37f187['blocked']){if(moment(_0x37f187[_0x290d('0x11')])[_0x290d('0x18')](_0x1db4a6[_0x290d('0xa')],_0x290d('0x19'))>moment()){throw new Error(_0x290d('0x3c'));}else{_0x37f187[_0x290d('0x10')]=![];_0x37f187['blockedAt']=null;}}_0x37f187[_0x290d('0x3d')]=_0x1644f9;_0x37f187[_0x290d('0x3e')]=Date[_0x290d('0x3f')]()+0x36ee80;return _0x37f187[_0x290d('0x40')]();})[_0x290d('0xb')](function(){return sendServiceMail({'to':_0x30803a[_0x290d('0x38')][_0x290d('0x27')],'subject':_0x290d('0x41'),'text':_0x290d('0x42')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x30803a[_0x290d('0x43')]['host']+_0x290d('0x44')+_0x1644f9+'\x0a\x0a'+_0x290d('0x45')});})[_0x290d('0xb')](function(){_0x32f058[_0x290d('0x46')](0xc8)[_0x290d('0x2d')]({'message':'Reset\x20Email\x20sent!'});})[_0x290d('0x1d')](function(_0x5611b4){return handleError(_0x32f058,0x1f4,_0x5611b4);});};exports[_0x290d('0x47')]=function(_0x4e5254,_0x4e3b97){return db[_0x290d('0x48')][_0x290d('0x1e')]({'where':{'resetPasswordToken':_0x4e5254[_0x290d('0x49')][_0x290d('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x290d('0x3f')]()}}})[_0x290d('0xb')](function(_0x178e58){if(!_0x178e58){throw new Error(_0x290d('0x4b'));}return db[_0x290d('0x9')][_0x290d('0xc')]({'attributes':['id',_0x290d('0x4c'),_0x290d('0x4d'),_0x290d('0x4e')]})[_0x290d('0xb')](function(_0x17b73e){if(_0x17b73e['securePassword'])authService[_0x290d('0x4f')](_0x4e5254['body'][_0x290d('0xe')]);if(!_0x17b73e[_0x290d('0x4d')]||!_0x178e58[_0x290d('0x50')])return _0x178e58;authService[_0x290d('0x51')](_0x4e5254[_0x290d('0x38')]['password'],_0x178e58[_0x290d('0x50')],_0x17b73e[_0x290d('0x4e')]);return _0x178e58;})['then'](function(){_0x178e58[_0x290d('0xe')]=_0x4e5254[_0x290d('0x38')]['password'];_0x178e58[_0x290d('0x3d')]=null;_0x178e58[_0x290d('0x3e')]=null;return _0x178e58['save']();});})[_0x290d('0xb')](function(){_0x4e3b97[_0x290d('0x46')](0xc8)[_0x290d('0x2d')]({'message':_0x290d('0x52')});})['catch'](function(_0x64f384){return handleError(_0x4e3b97,0x1f4,_0x64f384);});};passport[_0x290d('0x53')]('local-login',new LocalStrategy({'usernameField':_0x290d('0xd'),'passwordField':_0x290d('0xe')},function(_0x5c6e61,_0x309f7d,_0x1a146c){return localAuthenticate(db[_0x290d('0x48')],_0x5c6e61,_0x309f7d,_0x1a146c);}));
\ No newline at end of file
+var _0xf454=['blocked','blockedAt','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','minutes','clearBlockUser','add','getLicense','catch','find','email','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','message','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','Setting','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','reset','User','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','then','name','password','salt','disabled'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xf454,0x188));var _0x4f45=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xf454[_0x3bf83f];return _0x22c4a9;};'use strict';var util=require(_0x4f45('0x0'));var passport=require(_0x4f45('0x1'));var LocalStrategy=require('passport-local')[_0x4f45('0x2')];var jayson=require(_0x4f45('0x3'));var _=require(_0x4f45('0x4'));var rs=require('randomstring');var moment=require(_0x4f45('0x5'));var db=require(_0x4f45('0x6'))['db'];var authService=require(_0x4f45('0x7'));var utils=require(_0x4f45('0x8'));var client=jayson[_0x4f45('0x9')][_0x4f45('0xa')]({'port':0x232b});function localAuthenticate(_0x4c346b,_0x4a2969,_0x3e2bca,_0x54aee0){var _0x2e0731,_0x47970d;return db['Setting'][_0x4f45('0xb')]({'where':{'id':0x1},'attributes':[_0x4f45('0xc'),'blockDuration'],'raw':!![]})[_0x4f45('0xd')](function(_0xb7b116){_0x2e0731=_0xb7b116;return _0x4c346b[_0x4f45('0xb')]({'attributes':['id',_0x4f45('0xe'),_0x4f45('0xf'),_0x4f45('0x10'),'role',_0x4f45('0x11'),_0x4f45('0x12'),_0x4f45('0x13'),'loginAttempts'],'where':{'name':_0x4a2969,'role':{'$or':[_0x4f45('0x14'),_0x4f45('0x15'),'agent']}}});})[_0x4f45('0xd')](function(_0x5510fd){if(!_0x5510fd||_0x5510fd&&_0x5510fd[_0x4f45('0xe')]!==_0x4a2969){throw new Error(_0x4f45('0x16'));}else{_0x47970d=_0x5510fd;return _0x47970d;}})[_0x4f45('0xd')](function(){_0x47970d[_0x4f45('0x17')](_0x3e2bca,function(_0x168770,_0x2e48dc){var _0x3dce81=_0x47970d['loginAttempts']+0x1;if(_0x168770){return _0x54aee0(_0x168770);}else if(!_0x2e48dc){if(_0x47970d[_0x4f45('0x11')]){return _0x54aee0(null,![],{'message':_0x4f45('0x16')});}else if(_0x2e0731['allowedLoginAttempts']>0x0){if(_0x47970d[_0x4f45('0x12')]){if(_0x2e0731[_0x4f45('0x18')]>0x0){if(moment(_0x47970d[_0x4f45('0x13')])['add'](_0x2e0731[_0x4f45('0x18')],_0x4f45('0x19'))>moment()){return _0x54aee0(null,![],{'message':_0x4f45('0x16')});}else{return utils[_0x4f45('0x1a')](_0x47970d,_0x3dce81,![],null)['then'](function(){return _0x54aee0(null,![],{'message':_0x4f45('0x16')});});}}else{return _0x54aee0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3dce81>=_0x2e0731[_0x4f45('0xc')]){return utils[_0x4f45('0x1a')](_0x47970d,0x0,!![],moment())['then'](function(){return _0x54aee0(null,![],{'message':_0x4f45('0x16')});});}else{return utils['clearBlockUser'](_0x47970d,_0x3dce81,![],null)[_0x4f45('0xd')](function(){return _0x54aee0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x54aee0(null,![],{'message':_0x4f45('0x16')});}}else{if(_0x47970d[_0x4f45('0x11')]){return _0x54aee0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2e0731['allowedLoginAttempts']>0x0){if(_0x47970d[_0x4f45('0x12')]){if(_0x2e0731[_0x4f45('0x18')]>0x0){if(moment(_0x47970d['blockedAt'])[_0x4f45('0x1b')](_0x2e0731[_0x4f45('0x18')],'minutes')>moment()){return _0x54aee0(null,![],{'message':_0x4f45('0x16')});}else{return utils[_0x4f45('0x1a')](_0x47970d,0x0,![],null)[_0x4f45('0xd')](function(){return utils[_0x4f45('0x1c')](_0x47970d);})[_0x4f45('0xd')](function(){return _0x54aee0(null,_0x47970d);});}}else{return _0x54aee0(null,![],{'message':_0x4f45('0x16')});}}else{return utils[_0x4f45('0x1a')](_0x47970d,0x0,![],null)['then'](function(){return utils[_0x4f45('0x1c')](_0x47970d);})['then'](function(){return _0x54aee0(null,_0x47970d);})[_0x4f45('0x1d')](function(_0xd71da){return _0x54aee0(null,![],_0xd71da);});}}else{if(_0x47970d[_0x4f45('0x12')]){return _0x54aee0(null,![],{'message':_0x4f45('0x16')});}else{return utils['getLicense'](_0x47970d)['then'](function(){return _0x54aee0(null,_0x47970d);});}}}});})[_0x4f45('0x1d')](function(_0x8ae2fe){return _0x54aee0(null,![],_0x8ae2fe);});}function sendServiceMail(_0x54c463){return db['MailAccount'][_0x4f45('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x4f45('0xe'),_0x4f45('0x1f')],'include':[{'model':db['MailServerOut'],'as':_0x4f45('0x20'),'include':[{'model':db[_0x4f45('0x21')],'as':_0x4f45('0x21')}]}]})[_0x4f45('0xd')](function(_0x23f08f){if(!_0x23f08f){throw new Error(_0x4f45('0x22'));}var _0x57e096=_0x23f08f['getSmtpOptions']();var _0x1977a5={'account':_0x57e096,'message':_[_0x4f45('0x23')]({'from':util[_0x4f45('0x24')](_0x4f45('0x25'),_0x23f08f[_0x4f45('0xe')],_0x23f08f[_0x4f45('0x1f')]||_0x23f08f[_0x4f45('0x20')][_0x4f45('0x15')])},_0x54c463)};return client['request'](_0x4f45('0x26'),_0x1977a5);})['then'](function(_0x52a799){if(_0x52a799[_0x4f45('0x27')]){throw new Error(util[_0x4f45('0x24')](_0x4f45('0x28'),_0x52a799[_0x4f45('0x27')]['message']||JSON[_0x4f45('0x29')](_0x52a799['error'])));}return!![];});}function handleError(_0x137fa0,_0x404ce2,_0x381620){return _0x137fa0[_0x4f45('0x2a')](_0x404ce2||0x1f4)[_0x4f45('0x2b')]({'message':_0x381620?_0x381620[_0x4f45('0x2c')]||_0x381620:''});}exports['login']=function(_0x5cbdd6,_0x226460,_0x4690e1){passport[_0x4f45('0x17')](_0x4f45('0x2d'),function(_0x28a686,_0x2d4765,_0x9b8702){var _0x5eb184=_0x28a686||_0x9b8702;if(_0x5eb184){return handleError(_0x226460,0x191,_0x5eb184);}if(!_0x2d4765){return handleError(_0x226460,0x194,{'message':_0x4f45('0x2e')});}else{var _0x5e81b7={'payload':{'id':_0x2d4765['id'],'role':_0x2d4765[_0x4f45('0x2f')]},'options':{'expiresIn':0x15180}};return authService[_0x4f45('0x30')](_0x5e81b7)[_0x4f45('0xd')](function(_0x57ac23){_0x226460[_0x4f45('0x31')]({'id':_0x2d4765['id'],'token':_0x57ac23,'statusCall':'','isAlreadyLogged':_0x2d4765[_0x4f45('0x32')]});});}})(_0x5cbdd6,_0x226460,_0x4690e1);};exports['forgot']=function(_0x54af9a,_0x408eb5){if(!_0x54af9a[_0x4f45('0x33')]['email']){return handleError(_0x408eb5,0x1f4,{'message':_0x4f45('0x34')});}var _0x45c49d=rs[_0x4f45('0x35')]();_0x54af9a['body'][_0x4f45('0x1f')]=_0x54af9a[_0x4f45('0x33')][_0x4f45('0x1f')][_0x4f45('0x36')]()['toLowerCase']();var _0x3f55bf;return db[_0x4f45('0x37')][_0x4f45('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x4f45('0x18')],'raw':!![]})[_0x4f45('0xd')](function(_0x1bc91f){_0x3f55bf=_0x1bc91f;return db['User'][_0x4f45('0x1e')]({'where':{'email':_0x54af9a['body'][_0x4f45('0x1f')]}});})[_0x4f45('0xd')](function(_0x56f146){if(!_0x56f146){throw new Error(_0x4f45('0x38'));}if(_0x56f146['disabled']){throw new Error(_0x4f45('0x39'));}if(_0x56f146['blocked']){if(moment(_0x56f146[_0x4f45('0x13')])[_0x4f45('0x1b')](_0x3f55bf[_0x4f45('0x18')],_0x4f45('0x19'))>moment()){throw new Error(_0x4f45('0x3a'));}else{_0x56f146['blocked']=![];_0x56f146[_0x4f45('0x13')]=null;}}_0x56f146[_0x4f45('0x3b')]=_0x45c49d;_0x56f146[_0x4f45('0x3c')]=Date[_0x4f45('0x3d')]()+0x36ee80;return _0x56f146[_0x4f45('0x3e')]();})[_0x4f45('0xd')](function(){return sendServiceMail({'to':_0x54af9a['body'][_0x4f45('0x1f')],'subject':_0x4f45('0x3f'),'text':_0x4f45('0x40')+_0x4f45('0x41')+_0x4f45('0x42')+_0x54af9a[_0x4f45('0x43')][_0x4f45('0x44')]+_0x4f45('0x45')+_0x45c49d+'\x0a\x0a'+_0x4f45('0x46')});})['then'](function(){_0x408eb5[_0x4f45('0x2a')](0xc8)[_0x4f45('0x2b')]({'message':'Reset\x20Email\x20sent!'});})[_0x4f45('0x1d')](function(_0x50dbe8){return handleError(_0x408eb5,0x1f4,_0x50dbe8);});};exports[_0x4f45('0x47')]=function(_0x3e91f9,_0x148be){return db[_0x4f45('0x48')][_0x4f45('0x1e')]({'where':{'resetPasswordToken':_0x3e91f9[_0x4f45('0x49')][_0x4f45('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x4f45('0x3d')]()}}})[_0x4f45('0xd')](function(_0x34d377){if(!_0x34d377){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x4f45('0x37')][_0x4f45('0xb')]({'attributes':['id',_0x4f45('0x4b'),_0x4f45('0x4c'),_0x4f45('0x4d')]})['then'](function(_0xbf65c6){if(_0xbf65c6[_0x4f45('0x4b')])authService['validatePasswordPattern'](_0x3e91f9[_0x4f45('0x33')][_0x4f45('0xf')]);if(!_0xbf65c6[_0x4f45('0x4c')]||!_0x34d377[_0x4f45('0x4e')])return _0x34d377;authService[_0x4f45('0x4f')](_0x3e91f9['body']['password'],_0x34d377[_0x4f45('0x4e')],_0xbf65c6[_0x4f45('0x4d')]);return _0x34d377;})[_0x4f45('0xd')](function(){_0x34d377[_0x4f45('0xf')]=_0x3e91f9[_0x4f45('0x33')][_0x4f45('0xf')];_0x34d377[_0x4f45('0x3b')]=null;_0x34d377[_0x4f45('0x3c')]=null;return _0x34d377[_0x4f45('0x3e')]();});})['then'](function(){_0x148be[_0x4f45('0x2a')](0xc8)[_0x4f45('0x2b')]({'message':_0x4f45('0x50')});})['catch'](function(_0x3aa5dc){return handleError(_0x148be,0x1f4,_0x3aa5dc);});};passport[_0x4f45('0x51')](_0x4f45('0x2d'),new LocalStrategy({'usernameField':_0x4f45('0xe'),'passwordField':_0x4f45('0xf')},function(_0x1a6df9,_0x48b336,_0x40b5d7){return localAuthenticate(db[_0x4f45('0x48')],_0x1a6df9,_0x48b336,_0x40b5d7);}));
\ No newline at end of file
index dcb17a5..82c90fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5be=['post','/forgot','forgot','/reset/:token','reset','./authLocal.controller'];(function(_0x493a20,_0x9fbf06){var _0x4ca488=function(_0x427378){while(--_0x427378){_0x493a20['push'](_0x493a20['shift']());}};_0x4ca488(++_0x9fbf06);}(_0xe5be,0x1c7));var _0xee5b=function(_0xb1158b,_0x1ed8de){_0xb1158b=_0xb1158b-0x0;var _0x5c1506=_0xe5be[_0xb1158b];return _0x5c1506;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xee5b('0x0'));router[_0xee5b('0x1')]('/',controller['login']);router[_0xee5b('0x1')](_0xee5b('0x2'),controller[_0xee5b('0x3')]);router[_0xee5b('0x1')](_0xee5b('0x4'),controller[_0xee5b('0x5')]);module['exports']=router;
\ No newline at end of file
+var _0x034c=['login','/forgot','express','Router','./authLocal.controller','post'];(function(_0x38cf3d,_0x2b8f37){var _0x4b97f0=function(_0x237829){while(--_0x237829){_0x38cf3d['push'](_0x38cf3d['shift']());}};_0x4b97f0(++_0x2b8f37);}(_0x034c,0x1c4));var _0xc034=function(_0x4b6548,_0x67b78d){_0x4b6548=_0x4b6548-0x0;var _0x8fd11e=_0x034c[_0x4b6548];return _0x8fd11e;};'use strict';var express=require(_0xc034('0x0'));var router=express[_0xc034('0x1')]();var controller=require(_0xc034('0x2'));router[_0xc034('0x3')]('/',controller[_0xc034('0x4')]);router[_0xc034('0x3')](_0xc034('0x5'),controller['forgot']);router['post']('/reset/:token',controller['reset']);module['exports']=router;
\ No newline at end of file
index 9e002e3..ebbc4df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3562=['STRING','INTEGER','sequelize','exports'];(function(_0xf03eeb,_0x42cc3c){var _0x4815af=function(_0x49a038){while(--_0x49a038){_0xf03eeb['push'](_0xf03eeb['shift']());}};_0x4815af(++_0x42cc3c);}(_0x3562,0x186));var _0x2356=function(_0x42f154,_0x32110c){_0x42f154=_0x42f154-0x0;var _0x471993=_0x3562[_0x42f154];return _0x471993;};'use strict';var Sequelize=require(_0x2356('0x0'));module[_0x2356('0x1')]={'name':{'type':Sequelize[_0x2356('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x2356('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x2356('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xe875=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x87fdaf,_0x165914){var _0x5dacf0=function(_0x4b7f61){while(--_0x4b7f61){_0x87fdaf['push'](_0x87fdaf['shift']());}};_0x5dacf0(++_0x165914);}(_0xe875,0xa1));var _0x5e87=function(_0x5bd118,_0x2553af){_0x5bd118=_0x5bd118-0x0;var _0x2db56d=_0xe875[_0x5bd118];return _0x2db56d;};'use strict';var Sequelize=require(_0x5e87('0x0'));module[_0x5e87('0x1')]={'name':{'type':Sequelize[_0x5e87('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x5e87('0x2')]},'description':{'type':Sequelize[_0x5e87('0x2')]},'status':{'type':Sequelize[_0x5e87('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5e87('0x4')],'defaultValue':0xa}};
\ No newline at end of file
index 87d9b1c..a34b32d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed38=['mustache','util','sox','to-csv','ejs','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','Automation','include','findAll','rows','catch','show','params','includeAll','find','create','body','addConditions','Condition','omit','ids','getConditions','findOne','pick','getActions','Action','rawAttributes','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0xa6d014,_0x3b7030){var _0x2b208e=function(_0x3c98ee){while(--_0x3c98ee){_0xa6d014['push'](_0xa6d014['shift']());}};_0x2b208e(++_0x3b7030);}(_0xed38,0xf1));var _0x8ed3=function(_0x27acb6,_0x54f2ad){_0x27acb6=_0x27acb6-0x0;var _0x2c3dfd=_0xed38[_0x27acb6];return _0x2c3dfd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ed3('0x0'));var zipdir=require(_0x8ed3('0x1'));var jsonpatch=require(_0x8ed3('0x2'));var rp=require('request-promise');var moment=require(_0x8ed3('0x3'));var BPromise=require(_0x8ed3('0x4'));var Mustache=require(_0x8ed3('0x5'));var util=require(_0x8ed3('0x6'));var path=require('path');var sox=require(_0x8ed3('0x7'));var csv=require(_0x8ed3('0x8'));var ejs=require(_0x8ed3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8ed3('0x8'));var querystring=require(_0x8ed3('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8ed3('0xb'));var qs=require(_0x8ed3('0xc'));var as=require(_0x8ed3('0xd'));var hardwareService=require(_0x8ed3('0xe'));var logger=require(_0x8ed3('0xf'))(_0x8ed3('0x10'));var utils=require(_0x8ed3('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x8ed3('0x12'));var db=require(_0x8ed3('0x13'))['db'];function respondWithStatusCode(_0x2768e7,_0xc49201){_0xc49201=_0xc49201||0xcc;return function(_0x13ebcb){if(_0x13ebcb){return _0x2768e7[_0x8ed3('0x14')](_0xc49201);}return _0x2768e7[_0x8ed3('0x15')](_0xc49201)[_0x8ed3('0x16')]();};}function respondWithResult(_0x10b8b8,_0x47398d){_0x47398d=_0x47398d||0xc8;return function(_0x4a4c14){if(_0x4a4c14){return _0x10b8b8[_0x8ed3('0x15')](_0x47398d)[_0x8ed3('0x17')](_0x4a4c14);}};}function respondWithFilteredResult(_0x27969f,_0x2f1dcb){return function(_0x2856aa){if(_0x2856aa){var _0x543835=typeof _0x2f1dcb[_0x8ed3('0x18')]==='undefined'&&typeof _0x2f1dcb[_0x8ed3('0x19')]===_0x8ed3('0x1a');var _0x3d70b7=_0x2856aa[_0x8ed3('0x1b')];var _0x1957e0=_0x543835?0x0:_0x2f1dcb[_0x8ed3('0x18')];var _0x1387f6=_0x543835?_0x2856aa[_0x8ed3('0x1b')]:_0x2f1dcb[_0x8ed3('0x18')]+_0x2f1dcb[_0x8ed3('0x19')];var _0x20350a;if(_0x1387f6>=_0x3d70b7){_0x1387f6=_0x3d70b7;_0x20350a=0xc8;}else{_0x20350a=0xce;}_0x27969f[_0x8ed3('0x15')](_0x20350a);return _0x27969f[_0x8ed3('0x1c')](_0x8ed3('0x1d'),_0x1957e0+'-'+_0x1387f6+'/'+_0x3d70b7)[_0x8ed3('0x17')](_0x2856aa);}return null;};}function patchUpdates(_0x465705){return function(_0x39efa7){try{jsonpatch[_0x8ed3('0x1e')](_0x39efa7,_0x465705,!![]);}catch(_0x2520d9){return BPromise[_0x8ed3('0x1f')](_0x2520d9);}return _0x39efa7[_0x8ed3('0x20')]();};}function saveUpdates(_0x4818be,_0x1aa284){return function(_0x19a794){if(_0x19a794){return _0x19a794[_0x8ed3('0x21')](_0x4818be)[_0x8ed3('0x22')](function(_0x2c133a){return _0x2c133a;});}return null;};}function removeEntity(_0x8888d,_0x4df5e3){return function(_0x178fda){if(_0x178fda){return _0x178fda[_0x8ed3('0x23')]()[_0x8ed3('0x22')](function(){_0x8888d[_0x8ed3('0x15')](0xcc)[_0x8ed3('0x16')]();});}};}function handleEntityNotFound(_0x1d8a15,_0x5219dd){return function(_0x550045){if(!_0x550045){_0x1d8a15[_0x8ed3('0x14')](0x194);}return _0x550045;};}function handleError(_0x2b1a42,_0x45176e){_0x45176e=_0x45176e||0x1f4;return function(_0xd2dc8b){logger[_0x8ed3('0x24')](_0xd2dc8b[_0x8ed3('0x25')]);if(_0xd2dc8b[_0x8ed3('0x26')]){delete _0xd2dc8b['name'];}_0x2b1a42[_0x8ed3('0x15')](_0x45176e)['send'](_0xd2dc8b);};}exports[_0x8ed3('0x27')]=function(_0xa5e83c,_0x8eb917){var _0x3f75a2={},_0x5352be={},_0x3a688={'count':0x0,'rows':[]};var _0x1aa4a6=_[_0x8ed3('0x28')](db['Automation']['rawAttributes'],function(_0x46ad06){return{'name':_0x46ad06[_0x8ed3('0x29')],'type':_0x46ad06[_0x8ed3('0x2a')][_0x8ed3('0x2b')]};});_0x5352be['model']=_['map'](_0x1aa4a6,'name');_0x5352be[_0x8ed3('0x2c')]=_[_0x8ed3('0x2d')](_0xa5e83c[_0x8ed3('0x2c')]);_0x5352be[_0x8ed3('0x2e')]=_[_0x8ed3('0x2f')](_0x5352be[_0x8ed3('0x30')],_0x5352be[_0x8ed3('0x2c')]);_0x3f75a2['attributes']=_[_0x8ed3('0x2f')](_0x5352be[_0x8ed3('0x30')],qs[_0x8ed3('0x31')](_0xa5e83c['query'][_0x8ed3('0x31')]));_0x3f75a2[_0x8ed3('0x32')]=_0x3f75a2[_0x8ed3('0x32')][_0x8ed3('0x33')]?_0x3f75a2['attributes']:_0x5352be[_0x8ed3('0x30')];if(!_0xa5e83c[_0x8ed3('0x2c')][_0x8ed3('0x34')](_0x8ed3('0x35'))){_0x3f75a2[_0x8ed3('0x19')]=qs[_0x8ed3('0x19')](_0xa5e83c['query'][_0x8ed3('0x19')]);_0x3f75a2['offset']=qs[_0x8ed3('0x18')](_0xa5e83c[_0x8ed3('0x2c')][_0x8ed3('0x18')]);}_0x3f75a2[_0x8ed3('0x36')]=qs[_0x8ed3('0x37')](_0xa5e83c[_0x8ed3('0x2c')][_0x8ed3('0x37')]);_0x3f75a2[_0x8ed3('0x38')]=qs[_0x8ed3('0x2e')](_['pick'](_0xa5e83c[_0x8ed3('0x2c')],_0x5352be['filters']),_0x1aa4a6);if(_0xa5e83c[_0x8ed3('0x2c')][_0x8ed3('0x39')]){_0x3f75a2[_0x8ed3('0x38')]=_['merge'](_0x3f75a2['where'],{'$or':_[_0x8ed3('0x28')](_0x1aa4a6,function(_0x6927d3){if(_0x6927d3[_0x8ed3('0x2a')]!==_0x8ed3('0x3a')){var _0x4a7006={};_0x4a7006[_0x6927d3[_0x8ed3('0x26')]]={'$like':'%'+_0xa5e83c[_0x8ed3('0x2c')][_0x8ed3('0x39')]+'%'};return _0x4a7006;}})});}_0x3f75a2=_[_0x8ed3('0x3b')]({},_0x3f75a2,_0xa5e83c[_0x8ed3('0x3c')]);var _0x4da127={'where':_0x3f75a2[_0x8ed3('0x38')]};return db[_0x8ed3('0x3d')][_0x8ed3('0x1b')](_0x4da127)[_0x8ed3('0x22')](function(_0x26e741){_0x3a688[_0x8ed3('0x1b')]=_0x26e741;if(_0xa5e83c['query']['includeAll']){_0x3f75a2[_0x8ed3('0x3e')]=[{'all':!![]}];}return db['Automation'][_0x8ed3('0x3f')](_0x3f75a2);})[_0x8ed3('0x22')](function(_0x7002ae){_0x3a688[_0x8ed3('0x40')]=_0x7002ae;return _0x3a688;})['then'](respondWithFilteredResult(_0x8eb917,_0x3f75a2))[_0x8ed3('0x41')](handleError(_0x8eb917,null));};exports[_0x8ed3('0x42')]=function(_0x6d98d,_0x1a0582){var _0x11ef0b={'raw':![],'where':{'id':_0x6d98d[_0x8ed3('0x43')]['id']}},_0x1ce092={};_0x1ce092['model']=_['keys'](db['Automation']['rawAttributes']);_0x1ce092[_0x8ed3('0x2c')]=_[_0x8ed3('0x2d')](_0x6d98d[_0x8ed3('0x2c')]);_0x1ce092[_0x8ed3('0x2e')]=_[_0x8ed3('0x2f')](_0x1ce092[_0x8ed3('0x30')],_0x1ce092[_0x8ed3('0x2c')]);_0x11ef0b['attributes']=_[_0x8ed3('0x2f')](_0x1ce092[_0x8ed3('0x30')],qs[_0x8ed3('0x31')](_0x6d98d['query'][_0x8ed3('0x31')]));_0x11ef0b[_0x8ed3('0x32')]=_0x11ef0b[_0x8ed3('0x32')][_0x8ed3('0x33')]?_0x11ef0b[_0x8ed3('0x32')]:_0x1ce092[_0x8ed3('0x30')];if(_0x6d98d[_0x8ed3('0x2c')][_0x8ed3('0x44')]){_0x11ef0b['include']=[{'all':!![]}];}_0x11ef0b=_['merge']({},_0x11ef0b,_0x6d98d[_0x8ed3('0x3c')]);return db['Automation'][_0x8ed3('0x45')](_0x11ef0b)[_0x8ed3('0x22')](handleEntityNotFound(_0x1a0582,null))[_0x8ed3('0x22')](respondWithResult(_0x1a0582,null))[_0x8ed3('0x41')](handleError(_0x1a0582,null));};exports[_0x8ed3('0x46')]=function(_0x141b9d,_0x152262){return db[_0x8ed3('0x3d')]['create'](_0x141b9d[_0x8ed3('0x47')],{})[_0x8ed3('0x22')](respondWithResult(_0x152262,0xc9))[_0x8ed3('0x41')](handleError(_0x152262,null));};exports['update']=function(_0x478db4,_0x52eed2){if(_0x478db4[_0x8ed3('0x47')]['id']){delete _0x478db4['body']['id'];}return db[_0x8ed3('0x3d')][_0x8ed3('0x45')]({'where':{'id':_0x478db4[_0x8ed3('0x43')]['id']}})[_0x8ed3('0x22')](handleEntityNotFound(_0x52eed2,null))[_0x8ed3('0x22')](saveUpdates(_0x478db4[_0x8ed3('0x47')],null))[_0x8ed3('0x22')](respondWithResult(_0x52eed2,null))[_0x8ed3('0x41')](handleError(_0x52eed2,null));};exports[_0x8ed3('0x23')]=function(_0x45a47b,_0x3fe21c){return db['Automation']['find']({'where':{'id':_0x45a47b['params']['id']}})[_0x8ed3('0x22')](handleEntityNotFound(_0x3fe21c,null))[_0x8ed3('0x22')](removeEntity(_0x3fe21c,null))[_0x8ed3('0x41')](handleError(_0x3fe21c,null));};exports[_0x8ed3('0x48')]=function(_0xaa211e,_0x40a7c0,_0x192015){return db[_0x8ed3('0x49')][_0x8ed3('0x45')]({'where':{'id':_0xaa211e['params']['id']}})[_0x8ed3('0x22')](handleEntityNotFound(_0x40a7c0,null))[_0x8ed3('0x22')](function(_0x3be851){if(_0x3be851){return _0x3be851['addConditions'](_0xaa211e[_0x8ed3('0x47')]['ids'],_[_0x8ed3('0x4a')](_0xaa211e[_0x8ed3('0x47')],[_0x8ed3('0x4b'),'id'])||{});}})[_0x8ed3('0x22')](respondWithResult(_0x40a7c0,null))['catch'](handleError(_0x40a7c0,null));};exports[_0x8ed3('0x4c')]=function(_0x9d21a5,_0x4dfece,_0x367368){var _0x2e790d={};var _0xe3e002={};var _0x4141c1;var _0x349e05;return db['Automation'][_0x8ed3('0x4d')]({'where':{'id':_0x9d21a5['params']['id']}})[_0x8ed3('0x22')](handleEntityNotFound(_0x4dfece,null))[_0x8ed3('0x22')](function(_0xc70e7c){if(_0xc70e7c){_0x4141c1=_0xc70e7c;_0xe3e002[_0x8ed3('0x30')]=_[_0x8ed3('0x2d')](db[_0x8ed3('0x49')]['rawAttributes']);_0xe3e002['query']=_['keys'](_0x9d21a5[_0x8ed3('0x2c')]);_0xe3e002['filters']=_[_0x8ed3('0x2f')](_0xe3e002[_0x8ed3('0x30')],_0xe3e002[_0x8ed3('0x2c')]);_0x2e790d[_0x8ed3('0x32')]=_['intersection'](_0xe3e002[_0x8ed3('0x30')],qs[_0x8ed3('0x31')](_0x9d21a5[_0x8ed3('0x2c')][_0x8ed3('0x31')]));_0x2e790d[_0x8ed3('0x32')]=_0x2e790d[_0x8ed3('0x32')][_0x8ed3('0x33')]?_0x2e790d[_0x8ed3('0x32')]:_0xe3e002[_0x8ed3('0x30')];_0x2e790d['order']=qs[_0x8ed3('0x37')](_0x9d21a5['query'][_0x8ed3('0x37')]);_0x2e790d[_0x8ed3('0x38')]=qs['filters'](_[_0x8ed3('0x4e')](_0x9d21a5['query'],_0xe3e002[_0x8ed3('0x2e')]));if(_0x9d21a5[_0x8ed3('0x2c')][_0x8ed3('0x39')]){_0x2e790d['where']=_[_0x8ed3('0x3b')](_0x2e790d['where'],{'$or':_[_0x8ed3('0x28')](_0x2e790d[_0x8ed3('0x32')],function(_0x23933f){var _0x3c6c6c={};_0x3c6c6c[_0x23933f]={'$like':'%'+_0x9d21a5[_0x8ed3('0x2c')][_0x8ed3('0x39')]+'%'};return _0x3c6c6c;})});}_0x2e790d=_[_0x8ed3('0x3b')]({},_0x2e790d,_0x9d21a5[_0x8ed3('0x3c')]);return _0x4141c1[_0x8ed3('0x4c')](_0x2e790d);}})['then'](function(_0x5ce163){if(_0x5ce163){_0x349e05=_0x5ce163[_0x8ed3('0x33')];if(!_0x9d21a5[_0x8ed3('0x2c')]['hasOwnProperty'](_0x8ed3('0x35'))){_0x2e790d['limit']=qs['limit'](_0x9d21a5[_0x8ed3('0x2c')][_0x8ed3('0x19')]);_0x2e790d[_0x8ed3('0x18')]=qs[_0x8ed3('0x18')](_0x9d21a5['query']['offset']);}return _0x4141c1[_0x8ed3('0x4c')](_0x2e790d);}})[_0x8ed3('0x22')](function(_0x1b3d19){if(_0x1b3d19){return _0x1b3d19?{'count':_0x349e05,'rows':_0x1b3d19}:null;}})['then'](respondWithResult(_0x4dfece,null))[_0x8ed3('0x41')](handleError(_0x4dfece,null));};exports['addActions']=function(_0x368e84,_0x38e776,_0xbfa1d3){return db['Action'][_0x8ed3('0x45')]({'where':{'id':_0x368e84[_0x8ed3('0x43')]['id']}})[_0x8ed3('0x22')](handleEntityNotFound(_0x38e776,null))[_0x8ed3('0x22')](function(_0x50c8c5){if(_0x50c8c5){return _0x50c8c5['addActions'](_0x368e84[_0x8ed3('0x47')][_0x8ed3('0x4b')],_[_0x8ed3('0x4a')](_0x368e84['body'],[_0x8ed3('0x4b'),'id'])||{});}})[_0x8ed3('0x22')](respondWithResult(_0x38e776,null))[_0x8ed3('0x41')](handleError(_0x38e776,null));};exports[_0x8ed3('0x4f')]=function(_0x149ef8,_0x2a19a2,_0x424e53){var _0x28e3a9={};var _0x254fcd={};var _0x5157ae;var _0x5ecaca;return db[_0x8ed3('0x3d')]['findOne']({'where':{'id':_0x149ef8[_0x8ed3('0x43')]['id']}})[_0x8ed3('0x22')](handleEntityNotFound(_0x2a19a2,null))[_0x8ed3('0x22')](function(_0x397a49){if(_0x397a49){_0x5157ae=_0x397a49;_0x254fcd[_0x8ed3('0x30')]=_[_0x8ed3('0x2d')](db[_0x8ed3('0x50')][_0x8ed3('0x51')]);_0x254fcd[_0x8ed3('0x2c')]=_[_0x8ed3('0x2d')](_0x149ef8[_0x8ed3('0x2c')]);_0x254fcd[_0x8ed3('0x2e')]=_[_0x8ed3('0x2f')](_0x254fcd[_0x8ed3('0x30')],_0x254fcd[_0x8ed3('0x2c')]);_0x28e3a9[_0x8ed3('0x32')]=_[_0x8ed3('0x2f')](_0x254fcd[_0x8ed3('0x30')],qs[_0x8ed3('0x31')](_0x149ef8[_0x8ed3('0x2c')][_0x8ed3('0x31')]));_0x28e3a9[_0x8ed3('0x32')]=_0x28e3a9[_0x8ed3('0x32')][_0x8ed3('0x33')]?_0x28e3a9['attributes']:_0x254fcd[_0x8ed3('0x30')];_0x28e3a9['order']=qs[_0x8ed3('0x37')](_0x149ef8[_0x8ed3('0x2c')][_0x8ed3('0x37')]);_0x28e3a9[_0x8ed3('0x38')]=qs[_0x8ed3('0x2e')](_[_0x8ed3('0x4e')](_0x149ef8[_0x8ed3('0x2c')],_0x254fcd['filters']));if(_0x149ef8['query'][_0x8ed3('0x39')]){_0x28e3a9['where']=_[_0x8ed3('0x3b')](_0x28e3a9['where'],{'$or':_[_0x8ed3('0x28')](_0x28e3a9[_0x8ed3('0x32')],function(_0x782c0f){var _0x12f54e={};_0x12f54e[_0x782c0f]={'$like':'%'+_0x149ef8['query'][_0x8ed3('0x39')]+'%'};return _0x12f54e;})});}_0x28e3a9=_[_0x8ed3('0x3b')]({},_0x28e3a9,_0x149ef8[_0x8ed3('0x3c')]);return _0x5157ae[_0x8ed3('0x4f')](_0x28e3a9);}})[_0x8ed3('0x22')](function(_0x48b3d9){if(_0x48b3d9){_0x5ecaca=_0x48b3d9[_0x8ed3('0x33')];if(!_0x149ef8[_0x8ed3('0x2c')][_0x8ed3('0x34')](_0x8ed3('0x35'))){_0x28e3a9[_0x8ed3('0x19')]=qs[_0x8ed3('0x19')](_0x149ef8[_0x8ed3('0x2c')][_0x8ed3('0x19')]);_0x28e3a9['offset']=qs[_0x8ed3('0x18')](_0x149ef8[_0x8ed3('0x2c')][_0x8ed3('0x18')]);}return _0x5157ae[_0x8ed3('0x4f')](_0x28e3a9);}})[_0x8ed3('0x22')](function(_0x4a6577){if(_0x4a6577){return _0x4a6577?{'count':_0x5ecaca,'rows':_0x4a6577}:null;}})[_0x8ed3('0x22')](respondWithResult(_0x2a19a2,null))[_0x8ed3('0x41')](handleError(_0x2a19a2,null));};
\ No newline at end of file
+var _0x0753=['rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','filter','where','type','VIRTUAL','merge','includeAll','findAll','rows','show','params','include','find','catch','create','body','destroy','addConditions','ids','omit','findOne','Condition','order','sort','pick','getConditions','hasOwnProperty','addActions','Action','getActions','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','error','stack','name','send','map','Automation'];(function(_0x164166,_0x537687){var _0x16d491=function(_0x3b1a02){while(--_0x3b1a02){_0x164166['push'](_0x164166['shift']());}};_0x16d491(++_0x537687);}(_0x0753,0x115));var _0x3075=function(_0x38500f,_0x31c484){_0x38500f=_0x38500f-0x0;var _0x486365=_0x0753[_0x38500f];return _0x486365;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3075('0x0'));var zipdir=require(_0x3075('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3075('0x2'));var moment=require(_0x3075('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3075('0x4'));var util=require(_0x3075('0x5'));var path=require(_0x3075('0x6'));var sox=require('sox');var csv=require(_0x3075('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3075('0x8'));var _=require(_0x3075('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3075('0xa'));var toCsv=require(_0x3075('0x7'));var querystring=require(_0x3075('0xb'));var Papa=require(_0x3075('0xc'));var Redis=require(_0x3075('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3075('0xe'));var as=require(_0x3075('0xf'));var hardwareService=require(_0x3075('0x10'));var logger=require('../../config/logger')(_0x3075('0x11'));var utils=require('../../config/utils');var config=require(_0x3075('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x3075('0x13'))['db'];function respondWithStatusCode(_0x915cfa,_0xe42f0f){_0xe42f0f=_0xe42f0f||0xcc;return function(_0x35a8cc){if(_0x35a8cc){return _0x915cfa[_0x3075('0x14')](_0xe42f0f);}return _0x915cfa[_0x3075('0x15')](_0xe42f0f)[_0x3075('0x16')]();};}function respondWithResult(_0x1b73b0,_0x56e83c){_0x56e83c=_0x56e83c||0xc8;return function(_0x92710f){if(_0x92710f){return _0x1b73b0['status'](_0x56e83c)[_0x3075('0x17')](_0x92710f);}};}function respondWithFilteredResult(_0x74144a,_0x310abb){return function(_0x3da7bc){if(_0x3da7bc){var _0x2f3d1b=typeof _0x310abb[_0x3075('0x18')]==='undefined'&&typeof _0x310abb['limit']===_0x3075('0x19');var _0x10215d=_0x3da7bc['count'];var _0x2c893d=_0x2f3d1b?0x0:_0x310abb[_0x3075('0x18')];var _0x5e811a=_0x2f3d1b?_0x3da7bc[_0x3075('0x1a')]:_0x310abb['offset']+_0x310abb[_0x3075('0x1b')];var _0x133401;if(_0x5e811a>=_0x10215d){_0x5e811a=_0x10215d;_0x133401=0xc8;}else{_0x133401=0xce;}_0x74144a['status'](_0x133401);return _0x74144a[_0x3075('0x1c')](_0x3075('0x1d'),_0x2c893d+'-'+_0x5e811a+'/'+_0x10215d)['json'](_0x3da7bc);}return null;};}function patchUpdates(_0x12afb1){return function(_0x18899b){try{jsonpatch['apply'](_0x18899b,_0x12afb1,!![]);}catch(_0x1a353a){return BPromise[_0x3075('0x1e')](_0x1a353a);}return _0x18899b['save']();};}function saveUpdates(_0x325fa8,_0x45c1d3){return function(_0x5beb0d){if(_0x5beb0d){return _0x5beb0d[_0x3075('0x1f')](_0x325fa8)['then'](function(_0x55e01b){return _0x55e01b;});}return null;};}function removeEntity(_0x161666,_0x1814cd){return function(_0x5585f1){if(_0x5585f1){return _0x5585f1['destroy']()[_0x3075('0x20')](function(){_0x161666[_0x3075('0x15')](0xcc)[_0x3075('0x16')]();});}};}function handleEntityNotFound(_0x3d84bd,_0x396ccd){return function(_0x5cd104){if(!_0x5cd104){_0x3d84bd['sendStatus'](0x194);}return _0x5cd104;};}function handleError(_0x405732,_0x5beba9){_0x5beba9=_0x5beba9||0x1f4;return function(_0x46113f){logger[_0x3075('0x21')](_0x46113f[_0x3075('0x22')]);if(_0x46113f[_0x3075('0x23')]){delete _0x46113f['name'];}_0x405732[_0x3075('0x15')](_0x5beba9)[_0x3075('0x24')](_0x46113f);};}exports['index']=function(_0x18f73b,_0x5634f4){var _0x5054ff={},_0x4c926d={},_0x1a30c3={'count':0x0,'rows':[]};var _0xf9350a=_[_0x3075('0x25')](db[_0x3075('0x26')][_0x3075('0x27')],function(_0xa5f71a){return{'name':_0xa5f71a[_0x3075('0x28')],'type':_0xa5f71a['type']['key']};});_0x4c926d[_0x3075('0x29')]=_[_0x3075('0x25')](_0xf9350a,_0x3075('0x23'));_0x4c926d[_0x3075('0x2a')]=_[_0x3075('0x2b')](_0x18f73b[_0x3075('0x2a')]);_0x4c926d[_0x3075('0x2c')]=_[_0x3075('0x2d')](_0x4c926d[_0x3075('0x29')],_0x4c926d[_0x3075('0x2a')]);_0x5054ff[_0x3075('0x2e')]=_[_0x3075('0x2d')](_0x4c926d[_0x3075('0x29')],qs[_0x3075('0x2f')](_0x18f73b['query'][_0x3075('0x2f')]));_0x5054ff['attributes']=_0x5054ff['attributes'][_0x3075('0x30')]?_0x5054ff[_0x3075('0x2e')]:_0x4c926d[_0x3075('0x29')];if(!_0x18f73b['query']['hasOwnProperty'](_0x3075('0x31'))){_0x5054ff[_0x3075('0x1b')]=qs[_0x3075('0x1b')](_0x18f73b['query'][_0x3075('0x1b')]);_0x5054ff[_0x3075('0x18')]=qs[_0x3075('0x18')](_0x18f73b[_0x3075('0x2a')][_0x3075('0x18')]);}_0x5054ff['order']=qs['sort'](_0x18f73b['query']['sort']);_0x5054ff['where']=qs[_0x3075('0x2c')](_['pick'](_0x18f73b[_0x3075('0x2a')],_0x4c926d[_0x3075('0x2c')]),_0xf9350a);if(_0x18f73b[_0x3075('0x2a')][_0x3075('0x32')]){_0x5054ff['where']=_['merge'](_0x5054ff[_0x3075('0x33')],{'$or':_[_0x3075('0x25')](_0xf9350a,function(_0x1e5412){if(_0x1e5412[_0x3075('0x34')]!==_0x3075('0x35')){var _0x52af4b={};_0x52af4b[_0x1e5412[_0x3075('0x23')]]={'$like':'%'+_0x18f73b[_0x3075('0x2a')][_0x3075('0x32')]+'%'};return _0x52af4b;}})});}_0x5054ff=_[_0x3075('0x36')]({},_0x5054ff,_0x18f73b['options']);var _0x186a14={'where':_0x5054ff[_0x3075('0x33')]};return db[_0x3075('0x26')][_0x3075('0x1a')](_0x186a14)['then'](function(_0x154c7f){_0x1a30c3['count']=_0x154c7f;if(_0x18f73b[_0x3075('0x2a')][_0x3075('0x37')]){_0x5054ff['include']=[{'all':!![]}];}return db[_0x3075('0x26')][_0x3075('0x38')](_0x5054ff);})[_0x3075('0x20')](function(_0x3b08ce){_0x1a30c3[_0x3075('0x39')]=_0x3b08ce;return _0x1a30c3;})[_0x3075('0x20')](respondWithFilteredResult(_0x5634f4,_0x5054ff))['catch'](handleError(_0x5634f4,null));};exports[_0x3075('0x3a')]=function(_0x51eea3,_0x313ca5){var _0x51697a={'raw':![],'where':{'id':_0x51eea3[_0x3075('0x3b')]['id']}},_0x54c97c={};_0x54c97c['model']=_[_0x3075('0x2b')](db['Automation'][_0x3075('0x27')]);_0x54c97c[_0x3075('0x2a')]=_[_0x3075('0x2b')](_0x51eea3[_0x3075('0x2a')]);_0x54c97c['filters']=_[_0x3075('0x2d')](_0x54c97c['model'],_0x54c97c[_0x3075('0x2a')]);_0x51697a[_0x3075('0x2e')]=_[_0x3075('0x2d')](_0x54c97c[_0x3075('0x29')],qs[_0x3075('0x2f')](_0x51eea3[_0x3075('0x2a')]['fields']));_0x51697a['attributes']=_0x51697a[_0x3075('0x2e')]['length']?_0x51697a[_0x3075('0x2e')]:_0x54c97c[_0x3075('0x29')];if(_0x51eea3['query'][_0x3075('0x37')]){_0x51697a[_0x3075('0x3c')]=[{'all':!![]}];}_0x51697a=_[_0x3075('0x36')]({},_0x51697a,_0x51eea3['options']);return db[_0x3075('0x26')][_0x3075('0x3d')](_0x51697a)[_0x3075('0x20')](handleEntityNotFound(_0x313ca5,null))['then'](respondWithResult(_0x313ca5,null))[_0x3075('0x3e')](handleError(_0x313ca5,null));};exports[_0x3075('0x3f')]=function(_0x1f7bc5,_0x1496ad){return db['Automation'][_0x3075('0x3f')](_0x1f7bc5['body'],{})[_0x3075('0x20')](respondWithResult(_0x1496ad,0xc9))['catch'](handleError(_0x1496ad,null));};exports[_0x3075('0x1f')]=function(_0xc176d4,_0x38aeab){if(_0xc176d4[_0x3075('0x40')]['id']){delete _0xc176d4['body']['id'];}return db['Automation'][_0x3075('0x3d')]({'where':{'id':_0xc176d4[_0x3075('0x3b')]['id']}})['then'](handleEntityNotFound(_0x38aeab,null))[_0x3075('0x20')](saveUpdates(_0xc176d4[_0x3075('0x40')],null))[_0x3075('0x20')](respondWithResult(_0x38aeab,null))[_0x3075('0x3e')](handleError(_0x38aeab,null));};exports[_0x3075('0x41')]=function(_0x3aef56,_0x20e5a1){return db[_0x3075('0x26')][_0x3075('0x3d')]({'where':{'id':_0x3aef56[_0x3075('0x3b')]['id']}})[_0x3075('0x20')](handleEntityNotFound(_0x20e5a1,null))[_0x3075('0x20')](removeEntity(_0x20e5a1,null))[_0x3075('0x3e')](handleError(_0x20e5a1,null));};exports[_0x3075('0x42')]=function(_0x4c4c18,_0x528091,_0xebcb12){return db['Condition']['find']({'where':{'id':_0x4c4c18[_0x3075('0x3b')]['id']}})[_0x3075('0x20')](handleEntityNotFound(_0x528091,null))[_0x3075('0x20')](function(_0xc78af9){if(_0xc78af9){return _0xc78af9[_0x3075('0x42')](_0x4c4c18[_0x3075('0x40')][_0x3075('0x43')],_[_0x3075('0x44')](_0x4c4c18[_0x3075('0x40')],[_0x3075('0x43'),'id'])||{});}})[_0x3075('0x20')](respondWithResult(_0x528091,null))[_0x3075('0x3e')](handleError(_0x528091,null));};exports['getConditions']=function(_0x3b0fdd,_0x436738,_0x3fa49f){var _0x3d1548={};var _0x38e144={};var _0x1d8e2a;var _0x496ec1;return db['Automation'][_0x3075('0x45')]({'where':{'id':_0x3b0fdd[_0x3075('0x3b')]['id']}})['then'](handleEntityNotFound(_0x436738,null))[_0x3075('0x20')](function(_0xc62089){if(_0xc62089){_0x1d8e2a=_0xc62089;_0x38e144[_0x3075('0x29')]=_[_0x3075('0x2b')](db[_0x3075('0x46')][_0x3075('0x27')]);_0x38e144[_0x3075('0x2a')]=_['keys'](_0x3b0fdd[_0x3075('0x2a')]);_0x38e144[_0x3075('0x2c')]=_[_0x3075('0x2d')](_0x38e144[_0x3075('0x29')],_0x38e144[_0x3075('0x2a')]);_0x3d1548[_0x3075('0x2e')]=_[_0x3075('0x2d')](_0x38e144[_0x3075('0x29')],qs[_0x3075('0x2f')](_0x3b0fdd[_0x3075('0x2a')][_0x3075('0x2f')]));_0x3d1548[_0x3075('0x2e')]=_0x3d1548[_0x3075('0x2e')]['length']?_0x3d1548['attributes']:_0x38e144[_0x3075('0x29')];_0x3d1548[_0x3075('0x47')]=qs[_0x3075('0x48')](_0x3b0fdd[_0x3075('0x2a')][_0x3075('0x48')]);_0x3d1548['where']=qs[_0x3075('0x2c')](_[_0x3075('0x49')](_0x3b0fdd[_0x3075('0x2a')],_0x38e144[_0x3075('0x2c')]));if(_0x3b0fdd[_0x3075('0x2a')][_0x3075('0x32')]){_0x3d1548[_0x3075('0x33')]=_[_0x3075('0x36')](_0x3d1548['where'],{'$or':_[_0x3075('0x25')](_0x3d1548['attributes'],function(_0x4f4921){var _0x202472={};_0x202472[_0x4f4921]={'$like':'%'+_0x3b0fdd['query'][_0x3075('0x32')]+'%'};return _0x202472;})});}_0x3d1548=_['merge']({},_0x3d1548,_0x3b0fdd['options']);return _0x1d8e2a[_0x3075('0x4a')](_0x3d1548);}})[_0x3075('0x20')](function(_0x163ca0){if(_0x163ca0){_0x496ec1=_0x163ca0[_0x3075('0x30')];if(!_0x3b0fdd[_0x3075('0x2a')][_0x3075('0x4b')]('nolimit')){_0x3d1548[_0x3075('0x1b')]=qs[_0x3075('0x1b')](_0x3b0fdd[_0x3075('0x2a')][_0x3075('0x1b')]);_0x3d1548[_0x3075('0x18')]=qs[_0x3075('0x18')](_0x3b0fdd[_0x3075('0x2a')][_0x3075('0x18')]);}return _0x1d8e2a[_0x3075('0x4a')](_0x3d1548);}})['then'](function(_0x57f709){if(_0x57f709){return _0x57f709?{'count':_0x496ec1,'rows':_0x57f709}:null;}})[_0x3075('0x20')](respondWithResult(_0x436738,null))[_0x3075('0x3e')](handleError(_0x436738,null));};exports[_0x3075('0x4c')]=function(_0x772d56,_0x1a2d52,_0x238c9f){return db[_0x3075('0x4d')]['find']({'where':{'id':_0x772d56[_0x3075('0x3b')]['id']}})[_0x3075('0x20')](handleEntityNotFound(_0x1a2d52,null))['then'](function(_0x3158be){if(_0x3158be){return _0x3158be[_0x3075('0x4c')](_0x772d56[_0x3075('0x40')][_0x3075('0x43')],_['omit'](_0x772d56[_0x3075('0x40')],[_0x3075('0x43'),'id'])||{});}})[_0x3075('0x20')](respondWithResult(_0x1a2d52,null))['catch'](handleError(_0x1a2d52,null));};exports[_0x3075('0x4e')]=function(_0x308671,_0x276c25,_0x598a22){var _0x5d0aec={};var _0x52d0c8={};var _0x48642f;var _0x274714;return db['Automation']['findOne']({'where':{'id':_0x308671['params']['id']}})[_0x3075('0x20')](handleEntityNotFound(_0x276c25,null))[_0x3075('0x20')](function(_0x109358){if(_0x109358){_0x48642f=_0x109358;_0x52d0c8[_0x3075('0x29')]=_[_0x3075('0x2b')](db[_0x3075('0x4d')][_0x3075('0x27')]);_0x52d0c8[_0x3075('0x2a')]=_[_0x3075('0x2b')](_0x308671[_0x3075('0x2a')]);_0x52d0c8['filters']=_[_0x3075('0x2d')](_0x52d0c8['model'],_0x52d0c8[_0x3075('0x2a')]);_0x5d0aec['attributes']=_[_0x3075('0x2d')](_0x52d0c8[_0x3075('0x29')],qs['fields'](_0x308671['query'][_0x3075('0x2f')]));_0x5d0aec[_0x3075('0x2e')]=_0x5d0aec[_0x3075('0x2e')][_0x3075('0x30')]?_0x5d0aec[_0x3075('0x2e')]:_0x52d0c8[_0x3075('0x29')];_0x5d0aec[_0x3075('0x47')]=qs[_0x3075('0x48')](_0x308671[_0x3075('0x2a')][_0x3075('0x48')]);_0x5d0aec[_0x3075('0x33')]=qs[_0x3075('0x2c')](_[_0x3075('0x49')](_0x308671['query'],_0x52d0c8['filters']));if(_0x308671['query'][_0x3075('0x32')]){_0x5d0aec[_0x3075('0x33')]=_[_0x3075('0x36')](_0x5d0aec['where'],{'$or':_['map'](_0x5d0aec['attributes'],function(_0x371615){var _0x15216c={};_0x15216c[_0x371615]={'$like':'%'+_0x308671[_0x3075('0x2a')][_0x3075('0x32')]+'%'};return _0x15216c;})});}_0x5d0aec=_[_0x3075('0x36')]({},_0x5d0aec,_0x308671['options']);return _0x48642f[_0x3075('0x4e')](_0x5d0aec);}})['then'](function(_0x3ceb3b){if(_0x3ceb3b){_0x274714=_0x3ceb3b[_0x3075('0x30')];if(!_0x308671[_0x3075('0x2a')][_0x3075('0x4b')](_0x3075('0x31'))){_0x5d0aec[_0x3075('0x1b')]=qs['limit'](_0x308671['query'][_0x3075('0x1b')]);_0x5d0aec['offset']=qs[_0x3075('0x18')](_0x308671['query'][_0x3075('0x18')]);}return _0x48642f[_0x3075('0x4e')](_0x5d0aec);}})[_0x3075('0x20')](function(_0xa13619){if(_0xa13619){return _0xa13619?{'count':_0x274714,'rows':_0xa13619}:null;}})[_0x3075('0x20')](respondWithResult(_0x276c25,null))[_0x3075('0x3e')](handleError(_0x276c25,null));};
\ No newline at end of file
index ca02aaa..311b246 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba5a=['bluebird','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','../../config/logger','api'];(function(_0x1d2bbb,_0x202267){var _0x38082b=function(_0x27d153){while(--_0x27d153){_0x1d2bbb['push'](_0x1d2bbb['shift']());}};_0x38082b(++_0x202267);}(_0xba5a,0x110));var _0xaba5=function(_0x5ec365,_0x49930c){_0x5ec365=_0x5ec365-0x0;var _0xab187d=_0xba5a[_0x5ec365];return _0xab187d;};'use strict';var _=require(_0xaba5('0x0'));var util=require('util');var logger=require(_0xaba5('0x1'))(_0xaba5('0x2'));var moment=require('moment');var BPromise=require(_0xaba5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaba5('0x4'));var config=require(_0xaba5('0x5'));var attributes=require(_0xaba5('0x6'));module[_0xaba5('0x7')]=function(_0x279666,_0x82dd65){return _0x279666[_0xaba5('0x8')](_0xaba5('0x9'),attributes,{'tableName':_0xaba5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7efd=['Automation','tools_automations','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x495ca6,_0x2bc5d4){var _0x3855c6=function(_0x838c01){while(--_0x838c01){_0x495ca6['push'](_0x495ca6['shift']());}};_0x3855c6(++_0x2bc5d4);}(_0x7efd,0x18e));var _0xd7ef=function(_0x1ba7f6,_0x4c763a){_0x1ba7f6=_0x1ba7f6-0x0;var _0x656e55=_0x7efd[_0x1ba7f6];return _0x656e55;};'use strict';var _=require('lodash');var util=require(_0xd7ef('0x0'));var logger=require(_0xd7ef('0x1'))(_0xd7ef('0x2'));var moment=require(_0xd7ef('0x3'));var BPromise=require(_0xd7ef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd7ef('0x5'));var rimraf=require(_0xd7ef('0x6'));var config=require(_0xd7ef('0x7'));var attributes=require('./automation.attributes');module[_0xd7ef('0x8')]=function(_0x159b40,_0x830234){return _0x159b40[_0xd7ef('0x9')](_0xd7ef('0xa'),attributes,{'tableName':_0xd7ef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 913f599..c601102 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c01=['catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x39e85c,_0x3bca61){var _0xf96780=function(_0x3b0708){while(--_0x3b0708){_0x39e85c['push'](_0x39e85c['shift']());}};_0xf96780(++_0x3bca61);}(_0x1c01,0x190));var _0x11c0=function(_0x1433a3,_0x11380c){_0x1433a3=_0x1433a3-0x0;var _0x463084=_0x1c01[_0x1433a3];return _0x463084;};'use strict';var _=require(_0x11c0('0x0'));var util=require(_0x11c0('0x1'));var moment=require(_0x11c0('0x2'));var BPromise=require(_0x11c0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11c0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x11c0('0x5'))(_0x11c0('0x6'));var config=require(_0x11c0('0x7'));var jayson=require(_0x11c0('0x8'));var client=jayson[_0x11c0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41b0c3,_0x599423,_0x1d0199){return new BPromise(function(_0x558a37,_0x127b2f){return client['request'](_0x41b0c3,_0x1d0199)[_0x11c0('0xa')](function(_0x5578e8){logger['info'](_0x11c0('0xb'),_0x599423,'request\x20sent');logger[_0x11c0('0xc')](_0x11c0('0xd'),_0x599423,_0x11c0('0xe'),JSON[_0x11c0('0xf')](_0x5578e8));if(_0x5578e8[_0x11c0('0x10')]){if(_0x5578e8['error'][_0x11c0('0x11')]===0x1f4){logger[_0x11c0('0x10')](_0x11c0('0xb'),_0x599423,_0x5578e8[_0x11c0('0x10')]['message']);return _0x127b2f(_0x5578e8['error'][_0x11c0('0x12')]);}logger[_0x11c0('0x10')](_0x11c0('0xb'),_0x599423,_0x5578e8[_0x11c0('0x10')][_0x11c0('0x12')]);return _0x558a37(_0x5578e8[_0x11c0('0x10')][_0x11c0('0x12')]);}else{logger['info'](_0x11c0('0xb'),_0x599423,'request\x20sent');_0x558a37(_0x5578e8[_0x11c0('0x13')]['message']);}})[_0x11c0('0x14')](function(_0x45131a){logger[_0x11c0('0x10')]('Automation,\x20%s,\x20%s',_0x599423,_0x45131a);_0x127b2f(_0x45131a);});});}
\ No newline at end of file
+var _0xbcff=['../../config/logger','rpc','../../config/environment','client','http','then','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','Automation,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x19a7cb,_0x1384f7){var _0x455ed2=function(_0x4b6306){while(--_0x4b6306){_0x19a7cb['push'](_0x19a7cb['shift']());}};_0x455ed2(++_0x1384f7);}(_0xbcff,0x12e));var _0xfbcf=function(_0x13d65a,_0x285d92){_0x13d65a=_0x13d65a-0x0;var _0x74d27b=_0xbcff[_0x13d65a];return _0x74d27b;};'use strict';var _=require(_0xfbcf('0x0'));var util=require(_0xfbcf('0x1'));var moment=require(_0xfbcf('0x2'));var BPromise=require('bluebird');var rs=require(_0xfbcf('0x3'));var fs=require('fs');var Redis=require(_0xfbcf('0x4'));var db=require(_0xfbcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfbcf('0x6'))(_0xfbcf('0x7'));var config=require(_0xfbcf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfbcf('0x9')][_0xfbcf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b87de,_0x51ee67,_0x470fa8){return new BPromise(function(_0x520d5f,_0x1481ba){return client['request'](_0x4b87de,_0x470fa8)[_0xfbcf('0xb')](function(_0xc63f23){logger['info']('Automation,\x20%s,\x20%s',_0x51ee67,_0xfbcf('0xc'));logger[_0xfbcf('0xd')](_0xfbcf('0xe'),_0x51ee67,_0xfbcf('0xc'),JSON['stringify'](_0xc63f23));if(_0xc63f23[_0xfbcf('0xf')]){if(_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x10')]===0x1f4){logger[_0xfbcf('0xf')](_0xfbcf('0x11'),_0x51ee67,_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x12')]);return _0x1481ba(_0xc63f23['error'][_0xfbcf('0x12')]);}logger['error'](_0xfbcf('0x11'),_0x51ee67,_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x12')]);return _0x520d5f(_0xc63f23[_0xfbcf('0xf')][_0xfbcf('0x12')]);}else{logger[_0xfbcf('0x13')](_0xfbcf('0x11'),_0x51ee67,_0xfbcf('0xc'));_0x520d5f(_0xc63f23[_0xfbcf('0x14')]['message']);}})[_0xfbcf('0x15')](function(_0xdb7a6a){logger[_0xfbcf('0xf')](_0xfbcf('0x11'),_0x51ee67,_0xdb7a6a);_0x1481ba(_0xdb7a6a);});});}
\ No newline at end of file
index 69f5986..0afe991 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc300=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','/:id/actions','getActions','post','addActions','put','delete','/:id','destroy','exports','multer','util'];(function(_0x36f19c,_0x5f2ab9){var _0x244075=function(_0x27971d){while(--_0x27971d){_0x36f19c['push'](_0x36f19c['shift']());}};_0x244075(++_0x5f2ab9);}(_0xc300,0x132));var _0x0c30=function(_0x23284c,_0x57bd57){_0x23284c=_0x23284c-0x0;var _0x3fdfbf=_0xc300[_0x23284c];return _0x3fdfbf;};'use strict';var multer=require(_0x0c30('0x0'));var util=require(_0x0c30('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0c30('0x2'));var router=express[_0x0c30('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0c30('0x4'));var interaction=require(_0x0c30('0x5'));var config=require(_0x0c30('0x6'));var controller=require(_0x0c30('0x7'));router[_0x0c30('0x8')]('/',auth[_0x0c30('0x9')](),controller[_0x0c30('0xa')]);router[_0x0c30('0x8')]('/:id',auth[_0x0c30('0x9')](),controller[_0x0c30('0xb')]);router['get'](_0x0c30('0xc'),auth[_0x0c30('0x9')](),controller['getConditions']);router[_0x0c30('0x8')](_0x0c30('0xd'),auth[_0x0c30('0x9')](),controller[_0x0c30('0xe')]);router[_0x0c30('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0c30('0xf')](_0x0c30('0xc'),auth['isAuthenticated'](),controller['addConditions']);router[_0x0c30('0xf')](_0x0c30('0xd'),auth[_0x0c30('0x9')](),controller[_0x0c30('0x10')]);router[_0x0c30('0x11')]('/:id',auth[_0x0c30('0x9')](),controller['update']);router[_0x0c30('0x12')](_0x0c30('0x13'),auth[_0x0c30('0x9')](),controller[_0x0c30('0x14')]);module[_0x0c30('0x15')]=router;
\ No newline at end of file
+var _0x607b=['getActions','create','addConditions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','get','/:id/conditions','getConditions','/:id/actions'];(function(_0xbf691b,_0x1abd86){var _0x25932e=function(_0x1f1c44){while(--_0x1f1c44){_0xbf691b['push'](_0xbf691b['shift']());}};_0x25932e(++_0x1abd86);}(_0x607b,0x18f));var _0xb607=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x607b[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0xb607('0x0'));var util=require('util');var path=require(_0xb607('0x1'));var timeout=require(_0xb607('0x2'));var express=require(_0xb607('0x3'));var router=express[_0xb607('0x4')]();var fs_extra=require(_0xb607('0x5'));var auth=require(_0xb607('0x6'));var interaction=require(_0xb607('0x7'));var config=require(_0xb607('0x8'));var controller=require('./automation.controller');router['get']('/',auth[_0xb607('0x9')](),controller['index']);router['get'](_0xb607('0xa'),auth[_0xb607('0x9')](),controller['show']);router[_0xb607('0xb')](_0xb607('0xc'),auth[_0xb607('0x9')](),controller[_0xb607('0xd')]);router['get'](_0xb607('0xe'),auth[_0xb607('0x9')](),controller[_0xb607('0xf')]);router['post']('/',auth[_0xb607('0x9')](),controller[_0xb607('0x10')]);router['post'](_0xb607('0xc'),auth['isAuthenticated'](),controller[_0xb607('0x11')]);router['post'](_0xb607('0xe'),auth[_0xb607('0x9')](),controller['addActions']);router[_0xb607('0x12')](_0xb607('0xa'),auth[_0xb607('0x9')](),controller[_0xb607('0x13')]);router[_0xb607('0x14')](_0xb607('0xa'),auth[_0xb607('0x9')](),controller[_0xb607('0x15')]);module[_0xb607('0x16')]=router;
\ No newline at end of file
index dabb7c5..55e004e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9da6=['#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x9da6,0xff));var _0x69da=function(_0x8f01e3,_0x17e763){_0x8f01e3=_0x8f01e3-0x0;var _0xf866d=_0x9da6[_0x8f01e3];return _0xf866d;};'use strict';var Sequelize=require(_0x69da('0x0'));module[_0x69da('0x1')]={'name':{'type':Sequelize[_0x69da('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x69da('0x3')](_0x69da('0x4')),'allowNull':![],'defaultValue':_0x69da('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x69da('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x69da('0x6')](0x4)[_0x69da('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x69da('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x69da('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69da('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69da('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x69da('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x69da('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69da('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x69da('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'defaultValue':0x3,'comment':_0x69da('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x69da('0x6')](0x5)[_0x69da('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x69da('0xe')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x69da('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x69da('0xf')},'dialTimezone':{'type':Sequelize[_0x69da('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x69da('0x10'),_0x69da('0x11'),'onlyIfOpen'),'defaultValue':_0x69da('0x10')},'dialAMDActive':{'type':Sequelize[_0x69da('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x69da('0x6')](0x9)[_0x69da('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x69da('0x6')](0x9)[_0x69da('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x69da('0x6')](0x9)[_0x69da('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x69da('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x69da('0x6')](0x9)[_0x69da('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x69da('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0x69da('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x69da('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x69da('0x6')](0x9)[_0x69da('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x69da('0x6')](0x9)[_0x69da('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x69da('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x69da('0x6')](0x5)[_0x69da('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x69da('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x69da('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x69da('0x3')]('DESC',_0x69da('0x17')),'defaultValue':_0x69da('0x18')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x69da('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x69da('0x19')},'dialCutDigit':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x69da('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69da('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x69da('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x69da('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69da('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x69da('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x69da('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69da('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x69da('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x69da('0x20')},'dialMachineMaxRetry':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69da('0x21')},'dialMachineRetryFrequency':{'type':Sequelize[_0x69da('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x69da('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x69da('0x6')](0x3)[_0x69da('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x69da('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0x17c1=['Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x17c1,0x184));var _0x117c=function(_0x1f279a,_0x1dd9d5){_0x1f279a=_0x1f279a-0x0;var _0x52f122=_0x17c1[_0x1f279a];return _0x52f122;};'use strict';var Sequelize=require(_0x117c('0x0'));module[_0x117c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x117c('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x117c('0x3')),'allowNull':![],'defaultValue':_0x117c('0x3')},'description':{'type':Sequelize[_0x117c('0x4')]},'active':{'type':Sequelize[_0x117c('0x5')],'defaultValue':0x0,'comment':_0x117c('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x117c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x117c('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x117c('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x117c('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0x117c('0x9')](0x3)[_0x117c('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x117c('0x9')](0x3)[_0x117c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x117c('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x117c('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x117c('0x9')](0x3)[_0x117c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x117c('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x117c('0x9')](0x5)[_0x117c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x117c('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x117c('0x7')],'defaultValue':0x3,'comment':_0x117c('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x117c('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x117c('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x117c('0xe')},'dialTimezone':{'type':Sequelize[_0x117c('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x117c('0x4')],'defaultValue':_0x117c('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x117c('0x10')](_0x117c('0x11'),_0x117c('0x12'),'onlyIfOpen'),'defaultValue':_0x117c('0x11')},'dialAMDActive':{'type':Sequelize[_0x117c('0x5')],'defaultValue':0x0,'comment':_0x117c('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x117c('0x9')](0x9)[_0x117c('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x117c('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x117c('0x9')](0x9)[_0x117c('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x117c('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x117c('0x9')](0x9)[_0x117c('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x117c('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x117c('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x117c('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x117c('0x9')](0x9)[_0x117c('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x117c('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x117c('0x9')](0x9)[_0x117c('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x117c('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x117c('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x117c('0x9')](0x5)[_0x117c('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x117c('0x9')](0x9)[_0x117c('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x117c('0x10')]('DESC',_0x117c('0x1a')),'defaultValue':_0x117c('0x1b')},'dialPrefix':{'type':Sequelize[_0x117c('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x117c('0x9')](0x3)[_0x117c('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x117c('0x1c')},'dialCutDigit':{'type':Sequelize[_0x117c('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x117c('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x117c('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x117c('0x9')](0x5)[_0x117c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x117c('0x1e')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x117c('0x1f')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x117c('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x117c('0x9')](0x3)[_0x117c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x117c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x117c('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x117c('0x9')](0x3)[_0x117c('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x117c('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x117c('0x9')](0x5)[_0x117c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x117c('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x117c('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x117c('0x9')](0x5)[_0x117c('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x117c('0x24')}};
\ No newline at end of file
index e64d3cd..0b64953 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd820=['params','includeAll','include','find','create','body','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','keys','omit','createdAt','updatedAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','CmHopper','CampaignId','filter','getHopperHistories','findOne','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','NOW()','scheduledAt','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','phone\x20IS\x20NOT\x20NULL','into','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBY','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','Campaign','findAll','rows','catch','show'];(function(_0x138b26,_0x5bcac8){var _0x285001=function(_0x529618){while(--_0x529618){_0x138b26['push'](_0x138b26['shift']());}};_0x285001(++_0x5bcac8);}(_0xd820,0x16f));var _0x0d82=function(_0x15e0ad,_0x3626a4){_0x15e0ad=_0x15e0ad-0x0;var _0x5c4c30=_0xd820[_0x15e0ad];return _0x5c4c30;};'use strict';var emlformat=require(_0x0d82('0x0'));var rimraf=require(_0x0d82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0d82('0x2'));var rp=require(_0x0d82('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0d82('0x4'));var util=require(_0x0d82('0x5'));var path=require(_0x0d82('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0d82('0x7'));var fs=require('fs');var fs_extra=require(_0x0d82('0x8'));var _=require(_0x0d82('0x9'));var squel=require(_0x0d82('0xa'));var crypto=require('crypto');var jsforce=require(_0x0d82('0xb'));var deskjs=require(_0x0d82('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0d82('0xd'));var Redis=require(_0x0d82('0xe'));var authService=require(_0x0d82('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d82('0x10'));var logger=require(_0x0d82('0x11'))(_0x0d82('0x12'));var utils=require(_0x0d82('0x13'));var config=require(_0x0d82('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x851dbc,_0x7fdd7a){_0x7fdd7a=_0x7fdd7a||0xcc;return function(_0x103e1d){if(_0x103e1d){return _0x851dbc['sendStatus'](_0x7fdd7a);}return _0x851dbc[_0x0d82('0x15')](_0x7fdd7a)[_0x0d82('0x16')]();};}function respondWithResult(_0x8fe5e1,_0x3ad9dd){_0x3ad9dd=_0x3ad9dd||0xc8;return function(_0x288020){if(_0x288020){return _0x8fe5e1[_0x0d82('0x15')](_0x3ad9dd)[_0x0d82('0x17')](_0x288020);}};}function respondWithFilteredResult(_0x39c982,_0x2b2d47){return function(_0x55415f){if(_0x55415f){var _0x1e9024=typeof _0x2b2d47['offset']===_0x0d82('0x18')&&typeof _0x2b2d47['limit']===_0x0d82('0x18');var _0x31397a=_0x55415f[_0x0d82('0x19')];var _0x3383d8=_0x1e9024?0x0:_0x2b2d47[_0x0d82('0x1a')];var _0x16f941=_0x1e9024?_0x55415f[_0x0d82('0x19')]:_0x2b2d47[_0x0d82('0x1a')]+_0x2b2d47[_0x0d82('0x1b')];var _0x1007be;if(_0x16f941>=_0x31397a){_0x16f941=_0x31397a;_0x1007be=0xc8;}else{_0x1007be=0xce;}_0x39c982[_0x0d82('0x15')](_0x1007be);return _0x39c982[_0x0d82('0x1c')](_0x0d82('0x1d'),_0x3383d8+'-'+_0x16f941+'/'+_0x31397a)[_0x0d82('0x17')](_0x55415f);}return null;};}function patchUpdates(_0x5a0e1c){return function(_0x517997){try{jsonpatch[_0x0d82('0x1e')](_0x517997,_0x5a0e1c,!![]);}catch(_0x365404){return BPromise[_0x0d82('0x1f')](_0x365404);}return _0x517997['save']();};}function saveUpdates(_0x5def00,_0x2e332d){return function(_0x20d5eb){if(_0x20d5eb){return _0x20d5eb[_0x0d82('0x20')](_0x5def00)[_0x0d82('0x21')](function(_0x1f99ba){return _0x1f99ba;});}return null;};}function removeEntity(_0x18c248,_0x4a2d4d){return function(_0xb04794){if(_0xb04794){return _0xb04794[_0x0d82('0x22')]()[_0x0d82('0x21')](function(){var _0x5beeec=_0xb04794[_0x0d82('0x23')]({'plain':!![]});var _0x105c9a=_0x0d82('0x24');return db['UserProfileResource'][_0x0d82('0x22')]({'where':{'type':_0x105c9a,'resourceId':_0x5beeec['id']}})[_0x0d82('0x21')](function(){return _0xb04794;});})[_0x0d82('0x21')](function(){_0x18c248['status'](0xcc)[_0x0d82('0x16')]();});}};}function handleEntityNotFound(_0xc4f851,_0x46751f){return function(_0x389623){if(!_0x389623){_0xc4f851[_0x0d82('0x25')](0x194);}return _0x389623;};}function handleError(_0x3dcbed,_0x578037){_0x578037=_0x578037||0x1f4;return function(_0x5fd0dd){logger[_0x0d82('0x26')](_0x5fd0dd[_0x0d82('0x27')]);if(_0x5fd0dd[_0x0d82('0x28')]){delete _0x5fd0dd['name'];}_0x3dcbed[_0x0d82('0x15')](_0x578037)[_0x0d82('0x29')](_0x5fd0dd);};}exports[_0x0d82('0x2a')]=function(_0x3db80d,_0x30477f){var _0x730ed9={},_0x37f7f9={},_0x4ae2ce={'count':0x0,'rows':[]};var _0x20e2a2=_[_0x0d82('0x2b')](db['Campaign'][_0x0d82('0x2c')],function(_0x55b457){return{'name':_0x55b457[_0x0d82('0x2d')],'type':_0x55b457[_0x0d82('0x2e')][_0x0d82('0x2f')]};});_0x37f7f9['model']=_[_0x0d82('0x2b')](_0x20e2a2,_0x0d82('0x28'));_0x37f7f9[_0x0d82('0x30')]=_['keys'](_0x3db80d[_0x0d82('0x30')]);_0x37f7f9[_0x0d82('0x31')]=_[_0x0d82('0x32')](_0x37f7f9['model'],_0x37f7f9[_0x0d82('0x30')]);_0x730ed9[_0x0d82('0x33')]=_['intersection'](_0x37f7f9[_0x0d82('0x34')],qs['fields'](_0x3db80d[_0x0d82('0x30')][_0x0d82('0x35')]));_0x730ed9[_0x0d82('0x33')]=_0x730ed9[_0x0d82('0x33')][_0x0d82('0x36')]?_0x730ed9[_0x0d82('0x33')]:_0x37f7f9[_0x0d82('0x34')];if(!_0x3db80d[_0x0d82('0x30')][_0x0d82('0x37')](_0x0d82('0x38'))){_0x730ed9[_0x0d82('0x1b')]=qs[_0x0d82('0x1b')](_0x3db80d[_0x0d82('0x30')][_0x0d82('0x1b')]);_0x730ed9[_0x0d82('0x1a')]=qs[_0x0d82('0x1a')](_0x3db80d[_0x0d82('0x30')][_0x0d82('0x1a')]);}_0x730ed9[_0x0d82('0x39')]=qs[_0x0d82('0x3a')](_0x3db80d[_0x0d82('0x30')]['sort']);_0x730ed9[_0x0d82('0x3b')]=qs['filters'](_[_0x0d82('0x3c')](_0x3db80d[_0x0d82('0x30')],_0x37f7f9[_0x0d82('0x31')]),_0x20e2a2);if(_0x3db80d['query']['filter']){_0x730ed9[_0x0d82('0x3b')]=_[_0x0d82('0x3d')](_0x730ed9[_0x0d82('0x3b')],{'$or':_[_0x0d82('0x2b')](_0x20e2a2,function(_0x51d103){if(_0x51d103[_0x0d82('0x2e')]!=='VIRTUAL'){var _0x124cd6={};_0x124cd6[_0x51d103[_0x0d82('0x28')]]={'$like':'%'+_0x3db80d[_0x0d82('0x30')]['filter']+'%'};return _0x124cd6;}})});}_0x730ed9=_[_0x0d82('0x3d')]({},_0x730ed9,_0x3db80d[_0x0d82('0x3e')]);var _0x116fef={'where':_0x730ed9[_0x0d82('0x3b')]};return db[_0x0d82('0x3f')]['count'](_0x116fef)[_0x0d82('0x21')](function(_0x244db0){_0x4ae2ce[_0x0d82('0x19')]=_0x244db0;if(_0x3db80d[_0x0d82('0x30')]['includeAll']){_0x730ed9['include']=[{'all':!![]}];}return db[_0x0d82('0x3f')][_0x0d82('0x40')](_0x730ed9);})['then'](function(_0x45e109){_0x4ae2ce[_0x0d82('0x41')]=_0x45e109;return _0x4ae2ce;})['then'](respondWithFilteredResult(_0x30477f,_0x730ed9))[_0x0d82('0x42')](handleError(_0x30477f,null));};exports[_0x0d82('0x43')]=function(_0x50248b,_0xc0f038){var _0x1089a2={'raw':![],'where':{'id':_0x50248b[_0x0d82('0x44')]['id']}},_0x4768a5={};_0x4768a5['model']=_['keys'](db['Campaign'][_0x0d82('0x2c')]);_0x4768a5[_0x0d82('0x30')]=_['keys'](_0x50248b['query']);_0x4768a5[_0x0d82('0x31')]=_['intersection'](_0x4768a5[_0x0d82('0x34')],_0x4768a5['query']);_0x1089a2[_0x0d82('0x33')]=_[_0x0d82('0x32')](_0x4768a5[_0x0d82('0x34')],qs['fields'](_0x50248b[_0x0d82('0x30')][_0x0d82('0x35')]));_0x1089a2[_0x0d82('0x33')]=_0x1089a2[_0x0d82('0x33')]['length']?_0x1089a2[_0x0d82('0x33')]:_0x4768a5[_0x0d82('0x34')];if(_0x50248b[_0x0d82('0x30')][_0x0d82('0x45')]){_0x1089a2[_0x0d82('0x46')]=[{'all':!![]}];}_0x1089a2=_['merge']({},_0x1089a2,_0x50248b[_0x0d82('0x3e')]);return db[_0x0d82('0x3f')][_0x0d82('0x47')](_0x1089a2)['then'](handleEntityNotFound(_0xc0f038,null))[_0x0d82('0x21')](respondWithResult(_0xc0f038,null))[_0x0d82('0x42')](handleError(_0xc0f038,null));};exports[_0x0d82('0x48')]=function(_0x7dff5a,_0x55461e){return db[_0x0d82('0x3f')]['create'](_0x7dff5a[_0x0d82('0x49')],{})['then'](function(_0x315125){var _0x3fd517=_0x7dff5a['user']['get']({'plain':!![]});if(!_0x3fd517)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fd517[_0x0d82('0x4a')]==='user'){var _0x2475b1=_0x315125[_0x0d82('0x23')]({'plain':!![]});var _0x22d539='IvrCampaigns';return db[_0x0d82('0x4b')]['find']({'where':{'name':_0x22d539,'userProfileId':_0x3fd517[_0x0d82('0x4c')]},'raw':!![]})[_0x0d82('0x21')](function(_0x29db52){if(_0x29db52&&_0x29db52[_0x0d82('0x4d')]===0x0){return db[_0x0d82('0x4e')][_0x0d82('0x48')]({'name':_0x2475b1['name'],'resourceId':_0x2475b1['id'],'type':_0x29db52['name'],'sectionId':_0x29db52['id']},{})['then'](function(){return _0x315125;});}else{return _0x315125;}})[_0x0d82('0x42')](function(_0x2e32d0){logger[_0x0d82('0x26')](_0x0d82('0x4f'),_0x2e32d0);throw _0x2e32d0;});}return _0x315125;})[_0x0d82('0x21')](respondWithResult(_0x55461e,0xc9))[_0x0d82('0x42')](handleError(_0x55461e,null));};exports[_0x0d82('0x50')]=function(_0x7cbaf6,_0x2020f6){var _0xba38d7={'where':{'id':_0x7cbaf6[_0x0d82('0x44')]['id']}},_0x35172c={};_0x35172c[_0x0d82('0x34')]=_[_0x0d82('0x51')](db[_0x0d82('0x3f')][_0x0d82('0x2c')]);_0xba38d7['attributes']=_[_0x0d82('0x32')](_0x35172c[_0x0d82('0x34')],qs[_0x0d82('0x35')](_0x7cbaf6[_0x0d82('0x30')][_0x0d82('0x35')]));_0xba38d7[_0x0d82('0x33')]=_0xba38d7['attributes'][_0x0d82('0x36')]?_0xba38d7[_0x0d82('0x33')]:_0x35172c[_0x0d82('0x34')];if(_0x7cbaf6[_0x0d82('0x30')][_0x0d82('0x45')]){_0xba38d7['include']=[{'all':!![]}];}_0xba38d7=_[_0x0d82('0x3d')]({},_0xba38d7,_0x7cbaf6[_0x0d82('0x3e')]);return db['Campaign']['find'](_0xba38d7)[_0x0d82('0x21')](handleEntityNotFound(_0x2020f6,null))[_0x0d82('0x21')](function(_0x1d1dce){if(_0x1d1dce){var _0x924fc7=_0x1d1dce[_0x0d82('0x23')]({'plain':!![]});_0x924fc7=qs[_0x0d82('0x52')](_0x924fc7,['id',_0x0d82('0x53'),_0x0d82('0x54')]);_0x7cbaf6['body']=_[_0x0d82('0x52')](_0x7cbaf6['body'],['id',_0x0d82('0x53'),_0x0d82('0x54')]);return db[_0x0d82('0x3f')][_0x0d82('0x48')](_[_0x0d82('0x3d')](_0x924fc7,_0x7cbaf6['body']),{'include':_0x7cbaf6[_0x0d82('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0x0d82('0x21')](function(_0x32ec72){var _0x2757e0=_0x7cbaf6[_0x0d82('0x55')][_0x0d82('0x23')]({'plain':!![]});if(!_0x2757e0)throw new Error(_0x0d82('0x56'));if(_0x2757e0['role']===_0x0d82('0x55')){var _0x34daea=_0x32ec72[_0x0d82('0x23')]({'plain':!![]});var _0x1eefd9=_0x0d82('0x24');return db[_0x0d82('0x4b')]['find']({'where':{'name':_0x1eefd9,'userProfileId':_0x2757e0[_0x0d82('0x4c')]},'raw':!![]})[_0x0d82('0x21')](function(_0x5557c2){if(_0x5557c2&&_0x5557c2[_0x0d82('0x4d')]===0x0){return db[_0x0d82('0x4e')][_0x0d82('0x48')]({'name':_0x34daea[_0x0d82('0x28')],'resourceId':_0x34daea['id'],'type':_0x5557c2[_0x0d82('0x28')],'sectionId':_0x5557c2['id']},{})['then'](function(){return _0x32ec72;});}else{return _0x32ec72;}})[_0x0d82('0x42')](function(_0x341a76){logger['error'](_0x0d82('0x4f'),_0x341a76);throw _0x341a76;});}return _0x32ec72;});}})['then'](respondWithResult(_0x2020f6,0xc9))[_0x0d82('0x42')](handleError(_0x2020f6,null));};exports[_0x0d82('0x20')]=function(_0x2cbbb8,_0x2d7875){if(_0x2cbbb8[_0x0d82('0x49')]['id']){delete _0x2cbbb8[_0x0d82('0x49')]['id'];}return db['Campaign'][_0x0d82('0x47')]({'where':{'id':_0x2cbbb8['params']['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x2d7875,null))[_0x0d82('0x21')](saveUpdates(_0x2cbbb8['body'],null))[_0x0d82('0x21')](respondWithResult(_0x2d7875,null))[_0x0d82('0x42')](handleError(_0x2d7875,null));};exports[_0x0d82('0x22')]=function(_0x31a389,_0x216e12){return db[_0x0d82('0x3f')][_0x0d82('0x47')]({'where':{'id':_0x31a389[_0x0d82('0x44')]['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x216e12,null))['then'](removeEntity(_0x216e12,null))['catch'](handleError(_0x216e12,null));};exports[_0x0d82('0x57')]=function(_0x23946d,_0x47e2bc,_0x45a836){var _0x33c0f8={'raw':!![],'where':{}};var _0x2542d8={};var _0x413ee2={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x23946d[_0x0d82('0x44')]['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x47e2bc,null))[_0x0d82('0x21')](function(_0x5958a1){if(_0x5958a1){_0x2542d8['model']=_[_0x0d82('0x51')](db[_0x0d82('0x58')][_0x0d82('0x2c')]);_0x2542d8['query']=_[_0x0d82('0x51')](_0x23946d[_0x0d82('0x30')]);_0x2542d8['filters']=_['intersection'](_0x2542d8['model'],_0x2542d8[_0x0d82('0x30')]);_0x33c0f8['attributes']=_[_0x0d82('0x32')](_0x2542d8[_0x0d82('0x34')],qs[_0x0d82('0x35')](_0x23946d[_0x0d82('0x30')][_0x0d82('0x35')]));_0x33c0f8[_0x0d82('0x33')]=_0x33c0f8[_0x0d82('0x33')]['length']?_0x33c0f8[_0x0d82('0x33')]:_0x2542d8[_0x0d82('0x34')];if(!_0x23946d['query']['hasOwnProperty'](_0x0d82('0x38'))){_0x33c0f8[_0x0d82('0x1b')]=qs['limit'](_0x23946d['query'][_0x0d82('0x1b')]);_0x33c0f8[_0x0d82('0x1a')]=qs[_0x0d82('0x1a')](_0x23946d[_0x0d82('0x30')][_0x0d82('0x1a')]);}_0x33c0f8['order']=qs['sort'](_0x23946d[_0x0d82('0x30')][_0x0d82('0x3a')]);_0x33c0f8[_0x0d82('0x3b')]=qs[_0x0d82('0x31')](_[_0x0d82('0x3c')](_0x23946d[_0x0d82('0x30')],_0x2542d8['filters']));_0x33c0f8[_0x0d82('0x3b')][_0x0d82('0x59')]=_0x5958a1['id'];if(_0x23946d[_0x0d82('0x30')][_0x0d82('0x5a')]){_0x33c0f8[_0x0d82('0x3b')]=_[_0x0d82('0x3d')](_0x33c0f8[_0x0d82('0x3b')],{'$or':_[_0x0d82('0x2b')](_0x33c0f8['attributes'],function(_0x27108c){var _0x1fc992={};_0x1fc992[_0x27108c]={'$like':'%'+_0x23946d[_0x0d82('0x30')]['filter']+'%'};return _0x1fc992;})});}_0x33c0f8=_[_0x0d82('0x3d')]({},_0x33c0f8,_0x23946d[_0x0d82('0x3e')]);return db['CmHopper'][_0x0d82('0x19')]({'where':_0x33c0f8['where']})[_0x0d82('0x21')](function(_0x5bf58a){_0x413ee2['count']=_0x5bf58a;if(_0x23946d[_0x0d82('0x30')]['includeAll']){_0x33c0f8[_0x0d82('0x46')]=[{'all':!![]}];}return db[_0x0d82('0x58')][_0x0d82('0x40')](_0x33c0f8);})['then'](function(_0x48ce2f){_0x413ee2[_0x0d82('0x41')]=_0x48ce2f;return _0x413ee2;});}})[_0x0d82('0x21')](respondWithFilteredResult(_0x47e2bc,_0x33c0f8))[_0x0d82('0x42')](handleError(_0x47e2bc,null));};exports[_0x0d82('0x5b')]=function(_0x58c321,_0x5d0329,_0x3240b5){var _0x12d52c={'raw':!![],'where':{}};var _0x38bc9a={};var _0x44a257={'count':0x0,'rows':[]};return db[_0x0d82('0x3f')][_0x0d82('0x5c')]({'where':{'id':_0x58c321['params']['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x5d0329,null))[_0x0d82('0x21')](function(_0x1bb5c0){if(_0x1bb5c0){_0x38bc9a[_0x0d82('0x34')]=_['keys'](db[_0x0d82('0x5d')][_0x0d82('0x2c')]);_0x38bc9a[_0x0d82('0x30')]=_[_0x0d82('0x51')](_0x58c321[_0x0d82('0x30')]);_0x38bc9a[_0x0d82('0x31')]=_[_0x0d82('0x32')](_0x38bc9a[_0x0d82('0x34')],_0x38bc9a['query']);_0x12d52c[_0x0d82('0x33')]=_[_0x0d82('0x32')](_0x38bc9a[_0x0d82('0x34')],qs['fields'](_0x58c321[_0x0d82('0x30')][_0x0d82('0x35')]));_0x12d52c[_0x0d82('0x33')]=_0x12d52c[_0x0d82('0x33')][_0x0d82('0x36')]?_0x12d52c[_0x0d82('0x33')]:_0x38bc9a[_0x0d82('0x34')];if(!_0x58c321[_0x0d82('0x30')][_0x0d82('0x37')](_0x0d82('0x38'))){_0x12d52c['limit']=qs[_0x0d82('0x1b')](_0x58c321['query'][_0x0d82('0x1b')]);_0x12d52c[_0x0d82('0x1a')]=qs[_0x0d82('0x1a')](_0x58c321[_0x0d82('0x30')]['offset']);}_0x12d52c[_0x0d82('0x39')]=qs['sort'](_0x58c321[_0x0d82('0x30')][_0x0d82('0x3a')]);_0x12d52c[_0x0d82('0x3b')]=qs[_0x0d82('0x31')](_[_0x0d82('0x3c')](_0x58c321[_0x0d82('0x30')],_0x38bc9a['filters']));_0x12d52c['where'][_0x0d82('0x59')]=_0x1bb5c0['id'];if(_0x58c321['query'][_0x0d82('0x5a')]){_0x12d52c['where']=_[_0x0d82('0x3d')](_0x12d52c['where'],{'$or':_[_0x0d82('0x2b')](_0x12d52c['attributes'],function(_0x419b3a){var _0x5250b9={};_0x5250b9[_0x419b3a]={'$like':'%'+_0x58c321[_0x0d82('0x30')][_0x0d82('0x5a')]+'%'};return _0x5250b9;})});}_0x12d52c=_[_0x0d82('0x3d')]({},_0x12d52c,_0x58c321[_0x0d82('0x3e')]);return db[_0x0d82('0x5d')][_0x0d82('0x19')]({'where':_0x12d52c[_0x0d82('0x3b')]})[_0x0d82('0x21')](function(_0xf6e55){_0x44a257[_0x0d82('0x19')]=_0xf6e55;if(_0x58c321[_0x0d82('0x30')][_0x0d82('0x45')]){_0x12d52c[_0x0d82('0x46')]=[{'all':!![]}];}return db[_0x0d82('0x5d')][_0x0d82('0x40')](_0x12d52c);})[_0x0d82('0x21')](function(_0x3def6b){_0x44a257[_0x0d82('0x41')]=_0x3def6b;return _0x44a257;});}})[_0x0d82('0x21')](respondWithFilteredResult(_0x5d0329,_0x12d52c))[_0x0d82('0x42')](handleError(_0x5d0329,null));};exports['getHopperFinals']=function(_0x399a95,_0x4a5736,_0x6a884){var _0x2e92f1={'raw':!![],'where':{}};var _0x1a4d74={};var _0x48009d={'count':0x0,'rows':[]};return db[_0x0d82('0x3f')]['findOne']({'where':{'id':_0x399a95['params']['id']}})['then'](handleEntityNotFound(_0x4a5736,null))[_0x0d82('0x21')](function(_0x26f5ee){if(_0x26f5ee){_0x1a4d74['model']=_[_0x0d82('0x51')](db[_0x0d82('0x5e')][_0x0d82('0x2c')]);_0x1a4d74[_0x0d82('0x30')]=_[_0x0d82('0x51')](_0x399a95[_0x0d82('0x30')]);_0x1a4d74[_0x0d82('0x31')]=_['intersection'](_0x1a4d74[_0x0d82('0x34')],_0x1a4d74[_0x0d82('0x30')]);_0x2e92f1[_0x0d82('0x33')]=_[_0x0d82('0x32')](_0x1a4d74[_0x0d82('0x34')],qs[_0x0d82('0x35')](_0x399a95['query'][_0x0d82('0x35')]));_0x2e92f1[_0x0d82('0x33')]=_0x2e92f1['attributes'][_0x0d82('0x36')]?_0x2e92f1[_0x0d82('0x33')]:_0x1a4d74[_0x0d82('0x34')];if(!_0x399a95[_0x0d82('0x30')][_0x0d82('0x37')]('nolimit')){_0x2e92f1[_0x0d82('0x1b')]=qs['limit'](_0x399a95[_0x0d82('0x30')]['limit']);_0x2e92f1[_0x0d82('0x1a')]=qs[_0x0d82('0x1a')](_0x399a95['query'][_0x0d82('0x1a')]);}_0x2e92f1[_0x0d82('0x39')]=qs['sort'](_0x399a95[_0x0d82('0x30')][_0x0d82('0x3a')]);_0x2e92f1[_0x0d82('0x3b')]=qs[_0x0d82('0x31')](_[_0x0d82('0x3c')](_0x399a95[_0x0d82('0x30')],_0x1a4d74[_0x0d82('0x31')]));_0x2e92f1[_0x0d82('0x3b')][_0x0d82('0x59')]=_0x26f5ee['id'];if(_0x399a95[_0x0d82('0x30')][_0x0d82('0x5a')]){_0x2e92f1[_0x0d82('0x3b')]=_[_0x0d82('0x3d')](_0x2e92f1[_0x0d82('0x3b')],{'$or':_[_0x0d82('0x2b')](_0x2e92f1[_0x0d82('0x33')],function(_0x581239){var _0x2e1ebd={};_0x2e1ebd[_0x581239]={'$like':'%'+_0x399a95[_0x0d82('0x30')][_0x0d82('0x5a')]+'%'};return _0x2e1ebd;})});}_0x2e92f1=_['merge']({},_0x2e92f1,_0x399a95[_0x0d82('0x3e')]);return db['CmHopperFinal']['count']({'where':_0x2e92f1[_0x0d82('0x3b')]})[_0x0d82('0x21')](function(_0x2e538f){_0x48009d[_0x0d82('0x19')]=_0x2e538f;if(_0x399a95[_0x0d82('0x30')][_0x0d82('0x45')]){_0x2e92f1[_0x0d82('0x46')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x0d82('0x40')](_0x2e92f1);})[_0x0d82('0x21')](function(_0x4f6a38){_0x48009d[_0x0d82('0x41')]=_0x4f6a38;return _0x48009d;});}})[_0x0d82('0x21')](respondWithFilteredResult(_0x4a5736,_0x2e92f1))[_0x0d82('0x42')](handleError(_0x4a5736,null));};exports[_0x0d82('0x5f')]=function(_0x765e57,_0x4da48c,_0x39fd5b){var _0x2f2f94={'raw':!![],'where':{}};var _0x323e4={};var _0x371012={'count':0x0,'rows':[]};return db['Campaign'][_0x0d82('0x5c')]({'where':{'id':_0x765e57[_0x0d82('0x44')]['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x4da48c,null))[_0x0d82('0x21')](function(_0x14cf87){if(_0x14cf87){_0x323e4[_0x0d82('0x34')]=_[_0x0d82('0x51')](db['CmHopperBlack'][_0x0d82('0x2c')]);_0x323e4[_0x0d82('0x30')]=_[_0x0d82('0x51')](_0x765e57['query']);_0x323e4['filters']=_[_0x0d82('0x32')](_0x323e4[_0x0d82('0x34')],_0x323e4['query']);_0x2f2f94['attributes']=_[_0x0d82('0x32')](_0x323e4[_0x0d82('0x34')],qs['fields'](_0x765e57[_0x0d82('0x30')][_0x0d82('0x35')]));_0x2f2f94[_0x0d82('0x33')]=_0x2f2f94[_0x0d82('0x33')][_0x0d82('0x36')]?_0x2f2f94[_0x0d82('0x33')]:_0x323e4['model'];if(!_0x765e57[_0x0d82('0x30')][_0x0d82('0x37')](_0x0d82('0x38'))){_0x2f2f94[_0x0d82('0x1b')]=qs[_0x0d82('0x1b')](_0x765e57[_0x0d82('0x30')][_0x0d82('0x1b')]);_0x2f2f94[_0x0d82('0x1a')]=qs[_0x0d82('0x1a')](_0x765e57['query'][_0x0d82('0x1a')]);}_0x2f2f94['order']=qs['sort'](_0x765e57['query'][_0x0d82('0x3a')]);_0x2f2f94[_0x0d82('0x3b')]=qs['filters'](_[_0x0d82('0x3c')](_0x765e57[_0x0d82('0x30')],_0x323e4['filters']));_0x2f2f94[_0x0d82('0x3b')]['CampaignId']=_0x14cf87['id'];if(_0x765e57[_0x0d82('0x30')][_0x0d82('0x5a')]){_0x2f2f94[_0x0d82('0x3b')]=_[_0x0d82('0x3d')](_0x2f2f94[_0x0d82('0x3b')],{'$or':_['map'](_0x2f2f94['attributes'],function(_0x281b62){var _0x5d0d32={};_0x5d0d32[_0x281b62]={'$like':'%'+_0x765e57[_0x0d82('0x30')][_0x0d82('0x5a')]+'%'};return _0x5d0d32;})});}_0x2f2f94=_[_0x0d82('0x3d')]({},_0x2f2f94,_0x765e57[_0x0d82('0x3e')]);return db[_0x0d82('0x60')][_0x0d82('0x19')]({'where':_0x2f2f94['where']})['then'](function(_0x1e7d67){_0x371012[_0x0d82('0x19')]=_0x1e7d67;if(_0x765e57[_0x0d82('0x30')]['includeAll']){_0x2f2f94[_0x0d82('0x46')]=[{'all':!![]}];}return db[_0x0d82('0x60')]['findAll'](_0x2f2f94);})['then'](function(_0x203f66){_0x371012[_0x0d82('0x41')]=_0x203f66;return _0x371012;});}})[_0x0d82('0x21')](respondWithFilteredResult(_0x4da48c,_0x2f2f94))[_0x0d82('0x42')](handleError(_0x4da48c,null));};exports[_0x0d82('0x61')]=function(_0x5d2702,_0x158d08,_0x33f8e3){var _0x2a82a0={};var _0x2abaa0={};var _0x5bec95;var _0x46c48d;return db['Campaign'][_0x0d82('0x5c')]({'where':{'id':_0x5d2702[_0x0d82('0x44')]['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x158d08,null))[_0x0d82('0x21')](function(_0x450b10){if(_0x450b10){_0x5bec95=_0x450b10;_0x2abaa0[_0x0d82('0x34')]=_[_0x0d82('0x51')](db[_0x0d82('0x62')][_0x0d82('0x2c')]);_0x2abaa0[_0x0d82('0x30')]=_[_0x0d82('0x51')](_0x5d2702[_0x0d82('0x30')]);_0x2abaa0[_0x0d82('0x31')]=_[_0x0d82('0x32')](_0x2abaa0[_0x0d82('0x34')],_0x2abaa0['query']);_0x2a82a0[_0x0d82('0x33')]=_[_0x0d82('0x32')](_0x2abaa0[_0x0d82('0x34')],qs[_0x0d82('0x35')](_0x5d2702[_0x0d82('0x30')][_0x0d82('0x35')]));_0x2a82a0[_0x0d82('0x33')]=_0x2a82a0[_0x0d82('0x33')][_0x0d82('0x36')]?_0x2a82a0['attributes']:_0x2abaa0[_0x0d82('0x34')];_0x2a82a0[_0x0d82('0x39')]=qs[_0x0d82('0x3a')](_0x5d2702[_0x0d82('0x30')][_0x0d82('0x3a')]);_0x2a82a0['where']=qs[_0x0d82('0x31')](_[_0x0d82('0x3c')](_0x5d2702[_0x0d82('0x30')],_0x2abaa0[_0x0d82('0x31')]));if(_0x5d2702[_0x0d82('0x30')][_0x0d82('0x5a')]){_0x2a82a0[_0x0d82('0x3b')]=_[_0x0d82('0x3d')](_0x2a82a0[_0x0d82('0x3b')],{'$or':_[_0x0d82('0x2b')](_0x2a82a0[_0x0d82('0x33')],function(_0x729ec4){var _0x3abc1b={};_0x3abc1b[_0x729ec4]={'$like':'%'+_0x5d2702['query'][_0x0d82('0x5a')]+'%'};return _0x3abc1b;})});}_0x2a82a0=_['merge']({},_0x2a82a0,_0x5d2702['options']);return _0x5bec95[_0x0d82('0x61')](_0x2a82a0);}})[_0x0d82('0x21')](function(_0x23efb3){if(_0x23efb3){_0x46c48d=_0x23efb3[_0x0d82('0x36')];if(!_0x5d2702[_0x0d82('0x30')][_0x0d82('0x37')](_0x0d82('0x38'))){_0x2a82a0['limit']=qs[_0x0d82('0x1b')](_0x5d2702[_0x0d82('0x30')][_0x0d82('0x1b')]);_0x2a82a0['offset']=qs[_0x0d82('0x1a')](_0x5d2702[_0x0d82('0x30')][_0x0d82('0x1a')]);}return _0x5bec95[_0x0d82('0x61')](_0x2a82a0);}})['then'](function(_0x28c1ed){if(_0x28c1ed){return _0x28c1ed?{'count':_0x46c48d,'rows':_0x28c1ed}:null;}})[_0x0d82('0x21')](respondWithResult(_0x158d08,null))[_0x0d82('0x42')](handleError(_0x158d08,null));};exports[_0x0d82('0x63')]=function(_0x1e1a08,_0x4bc2fe,_0x367c0e){var _0x37bf7e,_0x362972;var _0x85588a=[];var _0x3f0fc8=moment()[_0x0d82('0x64')](_0x0d82('0x65'));return db['Campaign'][_0x0d82('0x47')]({'where':{'id':_0x1e1a08[_0x0d82('0x44')]['id']}})['then'](handleEntityNotFound(_0x4bc2fe,null))['then'](function(_0x4de527){if(_0x4de527){_0x362972=_0x4de527;return _0x4de527[_0x0d82('0x63')](_0x1e1a08['body'][_0x0d82('0x66')],_['omit'](_0x1e1a08[_0x0d82('0x49')],['ids','id'])||{});}return null;})[_0x0d82('0x67')](function(_0x9802c3){var _0x3a84ed;var _0x170515;_0x37bf7e=_0x9802c3||[];var _0x377bbf=[];if(_0x9802c3){for(var _0x3a2d8e=0x0;_0x3a2d8e<_0x9802c3[_0x0d82('0x36')];_0x3a2d8e+=0x1){var _0x14f350=_0x9802c3[_0x3a2d8e][_0x0d82('0x23')]({'plain':!![]});_0x362972[_0x0d82('0x68')]=_0x1e1a08['body']['dialCheckDuplicateType']?_0x1e1a08['body'][_0x0d82('0x68')]:_0x362972[_0x0d82('0x68')];switch(_0x362972[_0x0d82('0x68')]){case'always':_0x3a84ed=squel[_0x0d82('0x69')]()['into'](_0x0d82('0x6a'))[_0x0d82('0x6b')]([_0x0d82('0x6c'),'scheduledAt',_0x0d82('0x6d'),_0x0d82('0x6e'),_0x0d82('0x59'),_0x0d82('0x53'),_0x0d82('0x54')],squel[_0x0d82('0x6f')]()[_0x0d82('0x70')](_0x0d82('0x6c'),_0x0d82('0x6c'))['field'](_0x0d82('0x71'),_0x0d82('0x72'))['field']('id',_0x0d82('0x6d'))['field'](_0x14f350[_0x0d82('0x73')][_0x0d82('0x74')](),_0x0d82('0x6e'))['field'](_0x1e1a08[_0x0d82('0x44')]['id']['toString'](),_0x0d82('0x59'))['field']('\x27'+_0x3f0fc8+'\x27',_0x0d82('0x53'))[_0x0d82('0x70')]('\x27'+_0x3f0fc8+'\x27',_0x0d82('0x54'))[_0x0d82('0x75')]('cm_contacts')[_0x0d82('0x3b')](_0x0d82('0x76'))['where'](_0x0d82('0x77'),_0x14f350[_0x0d82('0x73')][_0x0d82('0x74')]())[_0x0d82('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0x0d82('0x3b')](_0x0d82('0x78'),squel['select']()[_0x0d82('0x70')](_0x0d82('0x79'))['from'](_0x0d82('0x7a'))[_0x0d82('0x3b')]('CampaignId\x20=\x20?',_0x1e1a08[_0x0d82('0x44')]['id'][_0x0d82('0x74')]()))[_0x0d82('0x3b')](_0x0d82('0x78'),squel[_0x0d82('0x6f')]()[_0x0d82('0x70')](_0x0d82('0x7b'))[_0x0d82('0x75')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x1e1a08[_0x0d82('0x44')]['id'][_0x0d82('0x74')]())))['toString']();break;case _0x0d82('0x7c'):_0x3a84ed=squel[_0x0d82('0x69')]()['into'](_0x0d82('0x6a'))[_0x0d82('0x6b')](['phone',_0x0d82('0x72'),'ContactId',_0x0d82('0x6e'),'CampaignId',_0x0d82('0x53'),_0x0d82('0x54')],squel['select']()[_0x0d82('0x70')](_0x0d82('0x6c'),'phone')[_0x0d82('0x70')](_0x0d82('0x71'),_0x0d82('0x72'))['field']('id',_0x0d82('0x6d'))['field'](_0x14f350[_0x0d82('0x73')][_0x0d82('0x74')](),_0x0d82('0x6e'))[_0x0d82('0x70')](_0x1e1a08[_0x0d82('0x44')]['id'][_0x0d82('0x74')](),'CampaignId')[_0x0d82('0x70')]('\x27'+_0x3f0fc8+'\x27',_0x0d82('0x53'))[_0x0d82('0x70')]('\x27'+_0x3f0fc8+'\x27',_0x0d82('0x54'))[_0x0d82('0x75')](_0x0d82('0x7d'))[_0x0d82('0x3b')](_0x0d82('0x76'))['where'](_0x0d82('0x77'),_0x14f350[_0x0d82('0x73')][_0x0d82('0x74')]())[_0x0d82('0x3b')](_0x0d82('0x7e'))[_0x0d82('0x3b')](_0x0d82('0x78'),squel[_0x0d82('0x6f')]()[_0x0d82('0x70')](_0x0d82('0x7b'))['from'](_0x0d82('0x6a'))[_0x0d82('0x3b')]('CampaignId\x20=\x20?',_0x1e1a08[_0x0d82('0x44')]['id'][_0x0d82('0x74')]())))['toString']();break;default:_0x3a84ed=squel[_0x0d82('0x69')]()[_0x0d82('0x7f')]('cm_hopper')['fromQuery']([_0x0d82('0x6c'),_0x0d82('0x72'),_0x0d82('0x6d'),'ListId',_0x0d82('0x59'),_0x0d82('0x53'),_0x0d82('0x54')],squel[_0x0d82('0x6f')]()[_0x0d82('0x70')](_0x0d82('0x6c'),_0x0d82('0x6c'))[_0x0d82('0x70')](_0x0d82('0x71'),_0x0d82('0x72'))[_0x0d82('0x70')]('id','ContactId')[_0x0d82('0x70')](_0x14f350[_0x0d82('0x73')][_0x0d82('0x74')](),'ListId')['field'](_0x1e1a08[_0x0d82('0x44')]['id'][_0x0d82('0x74')](),_0x0d82('0x59'))[_0x0d82('0x70')]('\x27'+_0x3f0fc8+'\x27','createdAt')[_0x0d82('0x70')]('\x27'+_0x3f0fc8+'\x27',_0x0d82('0x54'))['from'](_0x0d82('0x7d'))[_0x0d82('0x3b')](_0x0d82('0x76'))[_0x0d82('0x3b')](_0x0d82('0x77'),_0x14f350['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x0d82('0x74')]();}_0x170515=squel['insert']()[_0x0d82('0x7f')](_0x0d82('0x80'))[_0x0d82('0x6b')](['cmHopperId',_0x0d82('0x72'),'phone',_0x0d82('0x81'),'createdAt',_0x0d82('0x54')],squel[_0x0d82('0x6f')]()[_0x0d82('0x70')](_0x0d82('0x82'),'id')['field'](_0x0d82('0x71'),_0x0d82('0x72'))[_0x0d82('0x70')](_0x0d82('0x83'),'phone')[_0x0d82('0x70')](_0x0d82('0x84'),_0x0d82('0x81'))['field']('\x27'+_0x3f0fc8+'\x27',_0x0d82('0x53'))[_0x0d82('0x70')]('\x27'+_0x3f0fc8+'\x27',_0x0d82('0x54'))[_0x0d82('0x75')]('cm_contact_has_items','ci')[_0x0d82('0x85')]('cm_hopper','h',_0x0d82('0x86'))[_0x0d82('0x3b')](_0x0d82('0x87'),_0x14f350['CmListId']['toString']())[_0x0d82('0x3b')]('h.CampaignId=?',_0x1e1a08[_0x0d82('0x44')]['id'][_0x0d82('0x74')]())['where'](_0x0d82('0x88'),_0x3f0fc8))[_0x0d82('0x74')]();_0x377bbf[_0x0d82('0x89')](db[_0x0d82('0x8a')][_0x0d82('0x30')](_0x3a84ed));_0x85588a[_0x0d82('0x89')](db[_0x0d82('0x8a')][_0x0d82('0x30')](_0x170515));}return BPromise[_0x0d82('0x8b')](_0x377bbf);}})[_0x0d82('0x21')](function(){return BPromise[_0x0d82('0x8b')](_0x85588a);})[_0x0d82('0x21')](function(){return _0x37bf7e;})['then'](respondWithResult(_0x4bc2fe,null))['catch'](handleError(_0x4bc2fe,null));};exports['removeLists']=function(_0x430e86,_0x5b9b5e,_0x54a35c){return db[_0x0d82('0x3f')][_0x0d82('0x47')]({'where':{'id':_0x430e86[_0x0d82('0x44')]['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x5b9b5e,null))[_0x0d82('0x21')](function(_0x2136c4){if(_0x2136c4){return _0x2136c4[_0x0d82('0x8c')](_0x430e86[_0x0d82('0x30')][_0x0d82('0x66')]);}})[_0x0d82('0x21')](function(_0x12ceec){if(_0x12ceec){return db[_0x0d82('0x58')][_0x0d82('0x22')]({'where':{'ListId':_0x430e86[_0x0d82('0x30')][_0x0d82('0x66')],'CampaignId':_0x430e86['params']['id']}})[_0x0d82('0x21')](function(){return _0x12ceec;});}})[_0x0d82('0x21')](respondWithStatusCode(_0x5b9b5e,null))[_0x0d82('0x42')](handleError(_0x5b9b5e,null));};exports['getBlackLists']=function(_0x35ef66,_0x12adcb,_0x47fbdb){var _0x4d7a44={};var _0x22d6a1={};var _0x3d9b77;var _0x36c438;return db[_0x0d82('0x3f')]['findOne']({'where':{'id':_0x35ef66['params']['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x12adcb,null))[_0x0d82('0x21')](function(_0x56d2f7){if(_0x56d2f7){_0x3d9b77=_0x56d2f7;_0x22d6a1[_0x0d82('0x34')]=_[_0x0d82('0x51')](db[_0x0d82('0x62')][_0x0d82('0x2c')]);_0x22d6a1[_0x0d82('0x30')]=_[_0x0d82('0x51')](_0x35ef66[_0x0d82('0x30')]);_0x22d6a1[_0x0d82('0x31')]=_[_0x0d82('0x32')](_0x22d6a1[_0x0d82('0x34')],_0x22d6a1[_0x0d82('0x30')]);_0x4d7a44['attributes']=_[_0x0d82('0x32')](_0x22d6a1[_0x0d82('0x34')],qs[_0x0d82('0x35')](_0x35ef66[_0x0d82('0x30')][_0x0d82('0x35')]));_0x4d7a44[_0x0d82('0x33')]=_0x4d7a44[_0x0d82('0x33')][_0x0d82('0x36')]?_0x4d7a44['attributes']:_0x22d6a1[_0x0d82('0x34')];_0x4d7a44[_0x0d82('0x39')]=qs[_0x0d82('0x3a')](_0x35ef66[_0x0d82('0x30')][_0x0d82('0x3a')]);_0x4d7a44['where']=qs[_0x0d82('0x31')](_['pick'](_0x35ef66[_0x0d82('0x30')],_0x22d6a1[_0x0d82('0x31')]));if(_0x35ef66[_0x0d82('0x30')][_0x0d82('0x5a')]){_0x4d7a44[_0x0d82('0x3b')]=_['merge'](_0x4d7a44[_0x0d82('0x3b')],{'$or':_['map'](_0x4d7a44['attributes'],function(_0x5ad7ee){var _0x15e754={};_0x15e754[_0x5ad7ee]={'$like':'%'+_0x35ef66['query']['filter']+'%'};return _0x15e754;})});}_0x4d7a44=_[_0x0d82('0x3d')]({},_0x4d7a44,_0x35ef66[_0x0d82('0x3e')]);return _0x3d9b77['getBlackLists'](_0x4d7a44);}})['then'](function(_0x282361){if(_0x282361){_0x36c438=_0x282361['length'];if(!_0x35ef66[_0x0d82('0x30')]['hasOwnProperty'](_0x0d82('0x38'))){_0x4d7a44[_0x0d82('0x1b')]=qs['limit'](_0x35ef66[_0x0d82('0x30')][_0x0d82('0x1b')]);_0x4d7a44['offset']=qs[_0x0d82('0x1a')](_0x35ef66[_0x0d82('0x30')]['offset']);}return _0x3d9b77[_0x0d82('0x8d')](_0x4d7a44);}})[_0x0d82('0x21')](function(_0x4f09ef){if(_0x4f09ef){return _0x4f09ef?{'count':_0x36c438,'rows':_0x4f09ef}:null;}})[_0x0d82('0x21')](respondWithResult(_0x12adcb,null))[_0x0d82('0x42')](handleError(_0x12adcb,null));};exports[_0x0d82('0x8e')]=function(_0x597113,_0x16eb56,_0x9e468d){var _0x5df13e,_0x2d29be;var _0x4fbbf5=[];var _0x7fb2da=moment()[_0x0d82('0x64')](_0x0d82('0x65'));return db[_0x0d82('0x3f')][_0x0d82('0x47')]({'where':{'id':_0x597113[_0x0d82('0x44')]['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x16eb56,null))[_0x0d82('0x21')](function(_0x34c443){if(_0x34c443){_0x2d29be=_0x34c443;return _0x34c443[_0x0d82('0x8e')](_0x597113[_0x0d82('0x49')][_0x0d82('0x66')],_['omit'](_0x597113[_0x0d82('0x49')],[_0x0d82('0x66'),'id'])||{});}return null;})[_0x0d82('0x67')](function(_0x2d5ce9){var _0xc30053;var _0x2df72d;_0x5df13e=_0x2d5ce9||[];var _0x56527f=[];if(_0x2d5ce9){for(var _0x299ebe=0x0;_0x299ebe<_0x2d5ce9[_0x0d82('0x36')];_0x299ebe+=0x1){var _0x57f83c=_0x2d5ce9[_0x299ebe][_0x0d82('0x23')]({'plain':!![]});_0xc30053=squel[_0x0d82('0x69')]()[_0x0d82('0x7f')](_0x0d82('0x8f'))[_0x0d82('0x6b')]([_0x0d82('0x6c'),_0x0d82('0x6d'),_0x0d82('0x6e'),_0x0d82('0x59'),_0x0d82('0x53'),_0x0d82('0x54')],squel['select']()[_0x0d82('0x70')]('phone',_0x0d82('0x6c'))[_0x0d82('0x70')]('id',_0x0d82('0x6d'))['field'](_0x57f83c['CmListId'][_0x0d82('0x74')](),_0x0d82('0x6e'))[_0x0d82('0x70')](_0x597113[_0x0d82('0x44')]['id'][_0x0d82('0x74')](),'CampaignId')[_0x0d82('0x70')](_0x0d82('0x71'),_0x0d82('0x53'))[_0x0d82('0x70')](_0x0d82('0x71'),'updatedAt')['from']('cm_contacts')[_0x0d82('0x3b')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x57f83c[_0x0d82('0x73')][_0x0d82('0x74')]())[_0x0d82('0x3b')](_0x0d82('0x7e')))[_0x0d82('0x74')]();_0x56527f['push'](db['sequelize'][_0x0d82('0x30')](_0xc30053));}return BPromise['all'](_0x56527f);}})[_0x0d82('0x21')](function(){return _0x5df13e;})[_0x0d82('0x21')](respondWithResult(_0x16eb56,null))[_0x0d82('0x42')](handleError(_0x16eb56,null));};exports[_0x0d82('0x90')]=function(_0x2ea2df,_0x61f297,_0x520ae5){return db['Campaign'][_0x0d82('0x47')]({'where':{'id':_0x2ea2df[_0x0d82('0x44')]['id']}})[_0x0d82('0x21')](handleEntityNotFound(_0x61f297,null))[_0x0d82('0x21')](function(_0x33b527){if(_0x33b527){return _0x33b527[_0x0d82('0x90')](_0x2ea2df[_0x0d82('0x30')][_0x0d82('0x66')]);}})[_0x0d82('0x21')](function(_0x4b56e8){if(_0x4b56e8){return db[_0x0d82('0x60')][_0x0d82('0x22')]({'where':{'ListId':_0x2ea2df['query'][_0x0d82('0x66')],'CampaignId':_0x2ea2df[_0x0d82('0x44')]['id']}})['then'](function(){return _0x4b56e8;});}})[_0x0d82('0x21')](respondWithStatusCode(_0x61f297,null))[_0x0d82('0x42')](handleError(_0x61f297,null));};
\ No newline at end of file
+var _0x9bb4=['clone','createdAt','omit','updatedAt','user','error','getHoppers','findOne','CmHopper','hasOwnProperty','order','pick','CampaignId','findAll','getHopperHistories','nolimit','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','NOW()','ContactId','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','into','cmHopperId','h.id','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','IvrCampaigns','UserProfileResource','destroy','stack','name','index','Campaign','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x579acd,_0x9ea719){var _0xcd9df9=function(_0x1b634b){while(--_0x1b634b){_0x579acd['push'](_0x579acd['shift']());}};_0xcd9df9(++_0x9ea719);}(_0x9bb4,0xd5));var _0x49bb=function(_0x1198f3,_0x4b7a07){_0x1198f3=_0x1198f3-0x0;var _0x32ad65=_0x9bb4[_0x1198f3];return _0x32ad65;};'use strict';var emlformat=require(_0x49bb('0x0'));var rimraf=require(_0x49bb('0x1'));var zipdir=require(_0x49bb('0x2'));var jsonpatch=require(_0x49bb('0x3'));var rp=require(_0x49bb('0x4'));var moment=require(_0x49bb('0x5'));var BPromise=require(_0x49bb('0x6'));var Mustache=require(_0x49bb('0x7'));var util=require(_0x49bb('0x8'));var path=require('path');var sox=require(_0x49bb('0x9'));var csv=require(_0x49bb('0xa'));var ejs=require(_0x49bb('0xb'));var fs=require('fs');var fs_extra=require(_0x49bb('0xc'));var _=require('lodash');var squel=require(_0x49bb('0xd'));var crypto=require(_0x49bb('0xe'));var jsforce=require(_0x49bb('0xf'));var deskjs=require(_0x49bb('0x10'));var toCsv=require(_0x49bb('0xa'));var querystring=require('querystring');var Papa=require(_0x49bb('0x11'));var Redis=require('ioredis');var authService=require(_0x49bb('0x12'));var qs=require(_0x49bb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49bb('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x49bb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x49bb('0x16'));var db=require(_0x49bb('0x17'))['db'];function respondWithStatusCode(_0xfab080,_0x3b85fc){_0x3b85fc=_0x3b85fc||0xcc;return function(_0x1ff6d1){if(_0x1ff6d1){return _0xfab080[_0x49bb('0x18')](_0x3b85fc);}return _0xfab080[_0x49bb('0x19')](_0x3b85fc)[_0x49bb('0x1a')]();};}function respondWithResult(_0x3beb36,_0x59472f){_0x59472f=_0x59472f||0xc8;return function(_0x13c850){if(_0x13c850){return _0x3beb36['status'](_0x59472f)[_0x49bb('0x1b')](_0x13c850);}};}function respondWithFilteredResult(_0x1f7573,_0x1f0210){return function(_0x230f20){if(_0x230f20){var _0x145d52=typeof _0x1f0210[_0x49bb('0x1c')]===_0x49bb('0x1d')&&typeof _0x1f0210[_0x49bb('0x1e')]==='undefined';var _0x2d76be=_0x230f20[_0x49bb('0x1f')];var _0x5b45c0=_0x145d52?0x0:_0x1f0210[_0x49bb('0x1c')];var _0x3d41f2=_0x145d52?_0x230f20['count']:_0x1f0210[_0x49bb('0x1c')]+_0x1f0210[_0x49bb('0x1e')];var _0x4af5e0;if(_0x3d41f2>=_0x2d76be){_0x3d41f2=_0x2d76be;_0x4af5e0=0xc8;}else{_0x4af5e0=0xce;}_0x1f7573[_0x49bb('0x19')](_0x4af5e0);return _0x1f7573[_0x49bb('0x20')]('Content-Range',_0x5b45c0+'-'+_0x3d41f2+'/'+_0x2d76be)[_0x49bb('0x1b')](_0x230f20);}return null;};}function patchUpdates(_0x5387ed){return function(_0x1728e9){try{jsonpatch['apply'](_0x1728e9,_0x5387ed,!![]);}catch(_0x47918a){return BPromise[_0x49bb('0x21')](_0x47918a);}return _0x1728e9['save']();};}function saveUpdates(_0x5b18f0,_0x16b8fa){return function(_0x1ade8b){if(_0x1ade8b){return _0x1ade8b[_0x49bb('0x22')](_0x5b18f0)[_0x49bb('0x23')](function(_0x4f2764){return _0x4f2764;});}return null;};}function removeEntity(_0x490c3e,_0x5cacdb){return function(_0x4eae24){if(_0x4eae24){return _0x4eae24['destroy']()[_0x49bb('0x23')](function(){var _0x570847=_0x4eae24['get']({'plain':!![]});var _0x6dac61=_0x49bb('0x24');return db[_0x49bb('0x25')][_0x49bb('0x26')]({'where':{'type':_0x6dac61,'resourceId':_0x570847['id']}})[_0x49bb('0x23')](function(){return _0x4eae24;});})['then'](function(){_0x490c3e[_0x49bb('0x19')](0xcc)[_0x49bb('0x1a')]();});}};}function handleEntityNotFound(_0x1a6afb,_0x712959){return function(_0x5370d7){if(!_0x5370d7){_0x1a6afb[_0x49bb('0x18')](0x194);}return _0x5370d7;};}function handleError(_0x3d025d,_0x3985a6){_0x3985a6=_0x3985a6||0x1f4;return function(_0x47540c){logger['error'](_0x47540c[_0x49bb('0x27')]);if(_0x47540c[_0x49bb('0x28')]){delete _0x47540c[_0x49bb('0x28')];}_0x3d025d[_0x49bb('0x19')](_0x3985a6)['send'](_0x47540c);};}exports[_0x49bb('0x29')]=function(_0x1537ef,_0x5cd7c2){var _0x38108d={},_0x56b65b={},_0x2fbea2={'count':0x0,'rows':[]};var _0x242371=_['map'](db[_0x49bb('0x2a')][_0x49bb('0x2b')],function(_0x521e09){return{'name':_0x521e09[_0x49bb('0x2c')],'type':_0x521e09[_0x49bb('0x2d')][_0x49bb('0x2e')]};});_0x56b65b[_0x49bb('0x2f')]=_[_0x49bb('0x30')](_0x242371,_0x49bb('0x28'));_0x56b65b[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0x1537ef['query']);_0x56b65b[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x56b65b[_0x49bb('0x2f')],_0x56b65b[_0x49bb('0x31')]);_0x38108d['attributes']=_[_0x49bb('0x34')](_0x56b65b['model'],qs[_0x49bb('0x35')](_0x1537ef['query'][_0x49bb('0x35')]));_0x38108d['attributes']=_0x38108d[_0x49bb('0x36')][_0x49bb('0x37')]?_0x38108d['attributes']:_0x56b65b['model'];if(!_0x1537ef['query']['hasOwnProperty']('nolimit')){_0x38108d[_0x49bb('0x1e')]=qs[_0x49bb('0x1e')](_0x1537ef[_0x49bb('0x31')][_0x49bb('0x1e')]);_0x38108d[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0x1537ef[_0x49bb('0x31')]['offset']);}_0x38108d['order']=qs[_0x49bb('0x38')](_0x1537ef[_0x49bb('0x31')]['sort']);_0x38108d[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_['pick'](_0x1537ef['query'],_0x56b65b[_0x49bb('0x33')]),_0x242371);if(_0x1537ef['query'][_0x49bb('0x3a')]){_0x38108d[_0x49bb('0x39')]=_[_0x49bb('0x3b')](_0x38108d[_0x49bb('0x39')],{'$or':_[_0x49bb('0x30')](_0x242371,function(_0x72d90e){if(_0x72d90e[_0x49bb('0x2d')]!==_0x49bb('0x3c')){var _0x783852={};_0x783852[_0x72d90e[_0x49bb('0x28')]]={'$like':'%'+_0x1537ef[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x783852;}})});}_0x38108d=_[_0x49bb('0x3b')]({},_0x38108d,_0x1537ef[_0x49bb('0x3d')]);var _0x25c70e={'where':_0x38108d[_0x49bb('0x39')]};return db[_0x49bb('0x2a')][_0x49bb('0x1f')](_0x25c70e)[_0x49bb('0x23')](function(_0x41b969){_0x2fbea2[_0x49bb('0x1f')]=_0x41b969;if(_0x1537ef[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x38108d['include']=[{'all':!![]}];}return db[_0x49bb('0x2a')]['findAll'](_0x38108d);})[_0x49bb('0x23')](function(_0x1eac94){_0x2fbea2[_0x49bb('0x3f')]=_0x1eac94;return _0x2fbea2;})[_0x49bb('0x23')](respondWithFilteredResult(_0x5cd7c2,_0x38108d))[_0x49bb('0x40')](handleError(_0x5cd7c2,null));};exports['show']=function(_0x445e15,_0x31aaee){var _0x138f2b={'raw':![],'where':{'id':_0x445e15[_0x49bb('0x41')]['id']}},_0x46912f={};_0x46912f['model']=_[_0x49bb('0x32')](db[_0x49bb('0x2a')][_0x49bb('0x2b')]);_0x46912f[_0x49bb('0x31')]=_['keys'](_0x445e15['query']);_0x46912f[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x46912f[_0x49bb('0x2f')],_0x46912f[_0x49bb('0x31')]);_0x138f2b[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x46912f['model'],qs[_0x49bb('0x35')](_0x445e15['query'][_0x49bb('0x35')]));_0x138f2b[_0x49bb('0x36')]=_0x138f2b['attributes']['length']?_0x138f2b['attributes']:_0x46912f['model'];if(_0x445e15[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x138f2b[_0x49bb('0x42')]=[{'all':!![]}];}_0x138f2b=_[_0x49bb('0x3b')]({},_0x138f2b,_0x445e15['options']);return db['Campaign'][_0x49bb('0x43')](_0x138f2b)[_0x49bb('0x23')](handleEntityNotFound(_0x31aaee,null))[_0x49bb('0x23')](respondWithResult(_0x31aaee,null))[_0x49bb('0x40')](handleError(_0x31aaee,null));};exports['create']=function(_0x3b0f01,_0x382bc4){return db['Campaign'][_0x49bb('0x44')](_0x3b0f01[_0x49bb('0x45')],{})[_0x49bb('0x23')](function(_0x46bb56){var _0xbad45a=_0x3b0f01['user'][_0x49bb('0x46')]({'plain':!![]});if(!_0xbad45a)throw new Error(_0x49bb('0x47'));if(_0xbad45a[_0x49bb('0x48')]==='user'){var _0x266abf=_0x46bb56[_0x49bb('0x46')]({'plain':!![]});var _0x144a77=_0x49bb('0x24');return db[_0x49bb('0x49')]['find']({'where':{'name':_0x144a77,'userProfileId':_0xbad45a[_0x49bb('0x4a')]},'raw':!![]})[_0x49bb('0x23')](function(_0xfae9ab){if(_0xfae9ab&&_0xfae9ab[_0x49bb('0x4b')]===0x0){return db[_0x49bb('0x25')][_0x49bb('0x44')]({'name':_0x266abf[_0x49bb('0x28')],'resourceId':_0x266abf['id'],'type':_0xfae9ab[_0x49bb('0x28')],'sectionId':_0xfae9ab['id']},{})[_0x49bb('0x23')](function(){return _0x46bb56;});}else{return _0x46bb56;}})[_0x49bb('0x40')](function(_0x2ead0f){logger['error'](_0x49bb('0x4c'),_0x2ead0f);throw _0x2ead0f;});}return _0x46bb56;})[_0x49bb('0x23')](respondWithResult(_0x382bc4,0xc9))[_0x49bb('0x40')](handleError(_0x382bc4,null));};exports[_0x49bb('0x4d')]=function(_0x10327c,_0x3fc2f1){var _0x4151c5={'where':{'id':_0x10327c[_0x49bb('0x41')]['id']}},_0x23e8bc={};_0x23e8bc[_0x49bb('0x2f')]=_[_0x49bb('0x32')](db[_0x49bb('0x2a')][_0x49bb('0x2b')]);_0x4151c5[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x23e8bc[_0x49bb('0x2f')],qs[_0x49bb('0x35')](_0x10327c[_0x49bb('0x31')][_0x49bb('0x35')]));_0x4151c5[_0x49bb('0x36')]=_0x4151c5[_0x49bb('0x36')][_0x49bb('0x37')]?_0x4151c5[_0x49bb('0x36')]:_0x23e8bc['model'];if(_0x10327c[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x4151c5[_0x49bb('0x42')]=[{'all':!![]}];}_0x4151c5=_[_0x49bb('0x3b')]({},_0x4151c5,_0x10327c[_0x49bb('0x3d')]);return db[_0x49bb('0x2a')][_0x49bb('0x43')](_0x4151c5)[_0x49bb('0x23')](handleEntityNotFound(_0x3fc2f1,null))[_0x49bb('0x23')](function(_0x348da4){if(_0x348da4){var _0x48a8d6=_0x348da4['get']({'plain':!![]});_0x48a8d6=qs['omit'](_0x48a8d6,['id',_0x49bb('0x4e'),'updatedAt']);_0x10327c[_0x49bb('0x45')]=_[_0x49bb('0x4f')](_0x10327c[_0x49bb('0x45')],['id',_0x49bb('0x4e'),_0x49bb('0x50')]);return db[_0x49bb('0x2a')][_0x49bb('0x44')](_[_0x49bb('0x3b')](_0x48a8d6,_0x10327c['body']),{'include':_0x10327c[_0x49bb('0x31')][_0x49bb('0x3e')]?[{'all':!![]}]:undefined})[_0x49bb('0x23')](function(_0x435761){var _0x225341=_0x10327c[_0x49bb('0x51')][_0x49bb('0x46')]({'plain':!![]});if(!_0x225341)throw new Error(_0x49bb('0x47'));if(_0x225341['role']===_0x49bb('0x51')){var _0x35bb5b=_0x435761[_0x49bb('0x46')]({'plain':!![]});var _0xb2d741='IvrCampaigns';return db[_0x49bb('0x49')][_0x49bb('0x43')]({'where':{'name':_0xb2d741,'userProfileId':_0x225341['userProfileId']},'raw':!![]})[_0x49bb('0x23')](function(_0x36ff04){if(_0x36ff04&&_0x36ff04[_0x49bb('0x4b')]===0x0){return db[_0x49bb('0x25')][_0x49bb('0x44')]({'name':_0x35bb5b['name'],'resourceId':_0x35bb5b['id'],'type':_0x36ff04[_0x49bb('0x28')],'sectionId':_0x36ff04['id']},{})[_0x49bb('0x23')](function(){return _0x435761;});}else{return _0x435761;}})[_0x49bb('0x40')](function(_0x1f273a){logger[_0x49bb('0x52')](_0x49bb('0x4c'),_0x1f273a);throw _0x1f273a;});}return _0x435761;});}})['then'](respondWithResult(_0x3fc2f1,0xc9))[_0x49bb('0x40')](handleError(_0x3fc2f1,null));};exports[_0x49bb('0x22')]=function(_0x56b2e7,_0x4b13e5){if(_0x56b2e7[_0x49bb('0x45')]['id']){delete _0x56b2e7[_0x49bb('0x45')]['id'];}return db['Campaign'][_0x49bb('0x43')]({'where':{'id':_0x56b2e7[_0x49bb('0x41')]['id']}})['then'](handleEntityNotFound(_0x4b13e5,null))[_0x49bb('0x23')](saveUpdates(_0x56b2e7[_0x49bb('0x45')],null))[_0x49bb('0x23')](respondWithResult(_0x4b13e5,null))['catch'](handleError(_0x4b13e5,null));};exports[_0x49bb('0x26')]=function(_0x4a3906,_0x4478f4){return db[_0x49bb('0x2a')][_0x49bb('0x43')]({'where':{'id':_0x4a3906[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x4478f4,null))[_0x49bb('0x23')](removeEntity(_0x4478f4,null))[_0x49bb('0x40')](handleError(_0x4478f4,null));};exports[_0x49bb('0x53')]=function(_0xcc062f,_0x52ac3b,_0x29a1b7){var _0x28da4a={'raw':!![],'where':{}};var _0x277e04={};var _0x193259={'count':0x0,'rows':[]};return db['Campaign'][_0x49bb('0x54')]({'where':{'id':_0xcc062f[_0x49bb('0x41')]['id']}})['then'](handleEntityNotFound(_0x52ac3b,null))[_0x49bb('0x23')](function(_0x437d3b){if(_0x437d3b){_0x277e04['model']=_[_0x49bb('0x32')](db[_0x49bb('0x55')][_0x49bb('0x2b')]);_0x277e04[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0xcc062f[_0x49bb('0x31')]);_0x277e04[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x277e04['model'],_0x277e04[_0x49bb('0x31')]);_0x28da4a[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x277e04[_0x49bb('0x2f')],qs[_0x49bb('0x35')](_0xcc062f[_0x49bb('0x31')][_0x49bb('0x35')]));_0x28da4a['attributes']=_0x28da4a[_0x49bb('0x36')][_0x49bb('0x37')]?_0x28da4a[_0x49bb('0x36')]:_0x277e04[_0x49bb('0x2f')];if(!_0xcc062f['query'][_0x49bb('0x56')]('nolimit')){_0x28da4a[_0x49bb('0x1e')]=qs['limit'](_0xcc062f['query']['limit']);_0x28da4a[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0xcc062f['query']['offset']);}_0x28da4a[_0x49bb('0x57')]=qs[_0x49bb('0x38')](_0xcc062f[_0x49bb('0x31')][_0x49bb('0x38')]);_0x28da4a[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_[_0x49bb('0x58')](_0xcc062f[_0x49bb('0x31')],_0x277e04[_0x49bb('0x33')]));_0x28da4a[_0x49bb('0x39')][_0x49bb('0x59')]=_0x437d3b['id'];if(_0xcc062f['query'][_0x49bb('0x3a')]){_0x28da4a[_0x49bb('0x39')]=_[_0x49bb('0x3b')](_0x28da4a[_0x49bb('0x39')],{'$or':_[_0x49bb('0x30')](_0x28da4a[_0x49bb('0x36')],function(_0x3454be){var _0x500af1={};_0x500af1[_0x3454be]={'$like':'%'+_0xcc062f[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x500af1;})});}_0x28da4a=_['merge']({},_0x28da4a,_0xcc062f[_0x49bb('0x3d')]);return db[_0x49bb('0x55')]['count']({'where':_0x28da4a[_0x49bb('0x39')]})[_0x49bb('0x23')](function(_0x37f97b){_0x193259[_0x49bb('0x1f')]=_0x37f97b;if(_0xcc062f[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x28da4a['include']=[{'all':!![]}];}return db['CmHopper'][_0x49bb('0x5a')](_0x28da4a);})[_0x49bb('0x23')](function(_0x1499b6){_0x193259[_0x49bb('0x3f')]=_0x1499b6;return _0x193259;});}})[_0x49bb('0x23')](respondWithFilteredResult(_0x52ac3b,_0x28da4a))[_0x49bb('0x40')](handleError(_0x52ac3b,null));};exports[_0x49bb('0x5b')]=function(_0xc7016a,_0x136726,_0x36db19){var _0x3459de={'raw':!![],'where':{}};var _0x426505={};var _0x81e179={'count':0x0,'rows':[]};return db[_0x49bb('0x2a')][_0x49bb('0x54')]({'where':{'id':_0xc7016a['params']['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x136726,null))['then'](function(_0x7897dd){if(_0x7897dd){_0x426505[_0x49bb('0x2f')]=_['keys'](db['CmHopperHistory'][_0x49bb('0x2b')]);_0x426505[_0x49bb('0x31')]=_['keys'](_0xc7016a[_0x49bb('0x31')]);_0x426505[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x426505[_0x49bb('0x2f')],_0x426505[_0x49bb('0x31')]);_0x3459de[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x426505[_0x49bb('0x2f')],qs['fields'](_0xc7016a[_0x49bb('0x31')]['fields']));_0x3459de[_0x49bb('0x36')]=_0x3459de[_0x49bb('0x36')][_0x49bb('0x37')]?_0x3459de['attributes']:_0x426505[_0x49bb('0x2f')];if(!_0xc7016a[_0x49bb('0x31')][_0x49bb('0x56')](_0x49bb('0x5c'))){_0x3459de[_0x49bb('0x1e')]=qs['limit'](_0xc7016a[_0x49bb('0x31')][_0x49bb('0x1e')]);_0x3459de[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0xc7016a[_0x49bb('0x31')][_0x49bb('0x1c')]);}_0x3459de[_0x49bb('0x57')]=qs[_0x49bb('0x38')](_0xc7016a[_0x49bb('0x31')][_0x49bb('0x38')]);_0x3459de[_0x49bb('0x39')]=qs['filters'](_[_0x49bb('0x58')](_0xc7016a[_0x49bb('0x31')],_0x426505[_0x49bb('0x33')]));_0x3459de[_0x49bb('0x39')]['CampaignId']=_0x7897dd['id'];if(_0xc7016a[_0x49bb('0x31')]['filter']){_0x3459de[_0x49bb('0x39')]=_['merge'](_0x3459de[_0x49bb('0x39')],{'$or':_[_0x49bb('0x30')](_0x3459de[_0x49bb('0x36')],function(_0x2b953a){var _0x5d4c93={};_0x5d4c93[_0x2b953a]={'$like':'%'+_0xc7016a[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x5d4c93;})});}_0x3459de=_[_0x49bb('0x3b')]({},_0x3459de,_0xc7016a[_0x49bb('0x3d')]);return db[_0x49bb('0x5d')]['count']({'where':_0x3459de[_0x49bb('0x39')]})[_0x49bb('0x23')](function(_0x46fcc5){_0x81e179['count']=_0x46fcc5;if(_0xc7016a[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x3459de['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x49bb('0x5a')](_0x3459de);})[_0x49bb('0x23')](function(_0x2a40aa){_0x81e179[_0x49bb('0x3f')]=_0x2a40aa;return _0x81e179;});}})['then'](respondWithFilteredResult(_0x136726,_0x3459de))[_0x49bb('0x40')](handleError(_0x136726,null));};exports[_0x49bb('0x5e')]=function(_0x535bed,_0x137965,_0x208e1b){var _0x1c9cfb={'raw':!![],'where':{}};var _0x4157ae={};var _0x1b0529={'count':0x0,'rows':[]};return db['Campaign'][_0x49bb('0x54')]({'where':{'id':_0x535bed['params']['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x137965,null))['then'](function(_0x36bf90){if(_0x36bf90){_0x4157ae[_0x49bb('0x2f')]=_[_0x49bb('0x32')](db[_0x49bb('0x5f')][_0x49bb('0x2b')]);_0x4157ae[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0x535bed['query']);_0x4157ae[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x4157ae['model'],_0x4157ae[_0x49bb('0x31')]);_0x1c9cfb[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x4157ae[_0x49bb('0x2f')],qs['fields'](_0x535bed['query'][_0x49bb('0x35')]));_0x1c9cfb['attributes']=_0x1c9cfb[_0x49bb('0x36')]['length']?_0x1c9cfb[_0x49bb('0x36')]:_0x4157ae[_0x49bb('0x2f')];if(!_0x535bed[_0x49bb('0x31')][_0x49bb('0x56')]('nolimit')){_0x1c9cfb[_0x49bb('0x1e')]=qs[_0x49bb('0x1e')](_0x535bed['query']['limit']);_0x1c9cfb[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0x535bed['query'][_0x49bb('0x1c')]);}_0x1c9cfb[_0x49bb('0x57')]=qs[_0x49bb('0x38')](_0x535bed['query'][_0x49bb('0x38')]);_0x1c9cfb[_0x49bb('0x39')]=qs['filters'](_['pick'](_0x535bed['query'],_0x4157ae[_0x49bb('0x33')]));_0x1c9cfb[_0x49bb('0x39')][_0x49bb('0x59')]=_0x36bf90['id'];if(_0x535bed[_0x49bb('0x31')][_0x49bb('0x3a')]){_0x1c9cfb['where']=_['merge'](_0x1c9cfb[_0x49bb('0x39')],{'$or':_[_0x49bb('0x30')](_0x1c9cfb['attributes'],function(_0x5b1f07){var _0x378128={};_0x378128[_0x5b1f07]={'$like':'%'+_0x535bed[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x378128;})});}_0x1c9cfb=_['merge']({},_0x1c9cfb,_0x535bed[_0x49bb('0x3d')]);return db[_0x49bb('0x5f')]['count']({'where':_0x1c9cfb[_0x49bb('0x39')]})[_0x49bb('0x23')](function(_0x3b7d47){_0x1b0529[_0x49bb('0x1f')]=_0x3b7d47;if(_0x535bed['query'][_0x49bb('0x3e')]){_0x1c9cfb[_0x49bb('0x42')]=[{'all':!![]}];}return db[_0x49bb('0x5f')][_0x49bb('0x5a')](_0x1c9cfb);})['then'](function(_0x2ccf78){_0x1b0529[_0x49bb('0x3f')]=_0x2ccf78;return _0x1b0529;});}})[_0x49bb('0x23')](respondWithFilteredResult(_0x137965,_0x1c9cfb))[_0x49bb('0x40')](handleError(_0x137965,null));};exports[_0x49bb('0x60')]=function(_0x4e6e43,_0x5a4f59,_0x251fc8){var _0x382bf9={'raw':!![],'where':{}};var _0x5bdf3d={};var _0x1dcaac={'count':0x0,'rows':[]};return db[_0x49bb('0x2a')][_0x49bb('0x54')]({'where':{'id':_0x4e6e43[_0x49bb('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a4f59,null))['then'](function(_0xe5a2){if(_0xe5a2){_0x5bdf3d[_0x49bb('0x2f')]=_['keys'](db['CmHopperBlack'][_0x49bb('0x2b')]);_0x5bdf3d[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0x4e6e43['query']);_0x5bdf3d[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x5bdf3d[_0x49bb('0x2f')],_0x5bdf3d[_0x49bb('0x31')]);_0x382bf9[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x5bdf3d[_0x49bb('0x2f')],qs['fields'](_0x4e6e43[_0x49bb('0x31')]['fields']));_0x382bf9[_0x49bb('0x36')]=_0x382bf9[_0x49bb('0x36')][_0x49bb('0x37')]?_0x382bf9['attributes']:_0x5bdf3d[_0x49bb('0x2f')];if(!_0x4e6e43[_0x49bb('0x31')][_0x49bb('0x56')]('nolimit')){_0x382bf9[_0x49bb('0x1e')]=qs['limit'](_0x4e6e43['query'][_0x49bb('0x1e')]);_0x382bf9['offset']=qs[_0x49bb('0x1c')](_0x4e6e43[_0x49bb('0x31')][_0x49bb('0x1c')]);}_0x382bf9[_0x49bb('0x57')]=qs['sort'](_0x4e6e43[_0x49bb('0x31')][_0x49bb('0x38')]);_0x382bf9[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_[_0x49bb('0x58')](_0x4e6e43[_0x49bb('0x31')],_0x5bdf3d[_0x49bb('0x33')]));_0x382bf9[_0x49bb('0x39')][_0x49bb('0x59')]=_0xe5a2['id'];if(_0x4e6e43[_0x49bb('0x31')]['filter']){_0x382bf9[_0x49bb('0x39')]=_[_0x49bb('0x3b')](_0x382bf9['where'],{'$or':_[_0x49bb('0x30')](_0x382bf9[_0x49bb('0x36')],function(_0x12b674){var _0x2822f7={};_0x2822f7[_0x12b674]={'$like':'%'+_0x4e6e43['query']['filter']+'%'};return _0x2822f7;})});}_0x382bf9=_[_0x49bb('0x3b')]({},_0x382bf9,_0x4e6e43[_0x49bb('0x3d')]);return db[_0x49bb('0x61')]['count']({'where':_0x382bf9['where']})[_0x49bb('0x23')](function(_0xf5c477){_0x1dcaac['count']=_0xf5c477;if(_0x4e6e43[_0x49bb('0x31')][_0x49bb('0x3e')]){_0x382bf9[_0x49bb('0x42')]=[{'all':!![]}];}return db[_0x49bb('0x61')]['findAll'](_0x382bf9);})['then'](function(_0x1770bc){_0x1dcaac[_0x49bb('0x3f')]=_0x1770bc;return _0x1dcaac;});}})[_0x49bb('0x23')](respondWithFilteredResult(_0x5a4f59,_0x382bf9))['catch'](handleError(_0x5a4f59,null));};exports[_0x49bb('0x62')]=function(_0x9f2ff7,_0x3f93bd,_0x504b4f){var _0x582b42={};var _0x2948a0={};var _0x5a861f;var _0xaf6237;return db[_0x49bb('0x2a')][_0x49bb('0x54')]({'where':{'id':_0x9f2ff7[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x3f93bd,null))[_0x49bb('0x23')](function(_0x59e5c1){if(_0x59e5c1){_0x5a861f=_0x59e5c1;_0x2948a0[_0x49bb('0x2f')]=_[_0x49bb('0x32')](db[_0x49bb('0x63')][_0x49bb('0x2b')]);_0x2948a0[_0x49bb('0x31')]=_[_0x49bb('0x32')](_0x9f2ff7[_0x49bb('0x31')]);_0x2948a0[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x2948a0[_0x49bb('0x2f')],_0x2948a0['query']);_0x582b42[_0x49bb('0x36')]=_[_0x49bb('0x34')](_0x2948a0[_0x49bb('0x2f')],qs[_0x49bb('0x35')](_0x9f2ff7[_0x49bb('0x31')]['fields']));_0x582b42[_0x49bb('0x36')]=_0x582b42[_0x49bb('0x36')][_0x49bb('0x37')]?_0x582b42[_0x49bb('0x36')]:_0x2948a0[_0x49bb('0x2f')];_0x582b42[_0x49bb('0x57')]=qs['sort'](_0x9f2ff7['query']['sort']);_0x582b42[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_[_0x49bb('0x58')](_0x9f2ff7[_0x49bb('0x31')],_0x2948a0[_0x49bb('0x33')]));if(_0x9f2ff7[_0x49bb('0x31')][_0x49bb('0x3a')]){_0x582b42[_0x49bb('0x39')]=_[_0x49bb('0x3b')](_0x582b42['where'],{'$or':_[_0x49bb('0x30')](_0x582b42[_0x49bb('0x36')],function(_0x42b52f){var _0x22a2e3={};_0x22a2e3[_0x42b52f]={'$like':'%'+_0x9f2ff7[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x22a2e3;})});}_0x582b42=_[_0x49bb('0x3b')]({},_0x582b42,_0x9f2ff7['options']);return _0x5a861f['getLists'](_0x582b42);}})['then'](function(_0x521567){if(_0x521567){_0xaf6237=_0x521567[_0x49bb('0x37')];if(!_0x9f2ff7['query'][_0x49bb('0x56')](_0x49bb('0x5c'))){_0x582b42[_0x49bb('0x1e')]=qs['limit'](_0x9f2ff7['query']['limit']);_0x582b42[_0x49bb('0x1c')]=qs['offset'](_0x9f2ff7['query']['offset']);}return _0x5a861f[_0x49bb('0x62')](_0x582b42);}})[_0x49bb('0x23')](function(_0x5eec09){if(_0x5eec09){return _0x5eec09?{'count':_0xaf6237,'rows':_0x5eec09}:null;}})['then'](respondWithResult(_0x3f93bd,null))['catch'](handleError(_0x3f93bd,null));};exports['addLists']=function(_0x333a64,_0x4742be,_0x3ef899){var _0x29e5f9,_0x38a3d5;var _0xd2cd1a=[];var _0x3d761d=moment()[_0x49bb('0x64')](_0x49bb('0x65'));return db[_0x49bb('0x2a')][_0x49bb('0x43')]({'where':{'id':_0x333a64[_0x49bb('0x41')]['id']}})['then'](handleEntityNotFound(_0x4742be,null))[_0x49bb('0x23')](function(_0x4092df){if(_0x4092df){_0x38a3d5=_0x4092df;return _0x4092df[_0x49bb('0x66')](_0x333a64[_0x49bb('0x45')][_0x49bb('0x67')],_[_0x49bb('0x4f')](_0x333a64[_0x49bb('0x45')],[_0x49bb('0x67'),'id'])||{});}return null;})[_0x49bb('0x68')](function(_0x534677){var _0x5b27b1;var _0x3d1da9;_0x29e5f9=_0x534677||[];var _0x20a650=[];if(_0x534677){for(var _0x33c254=0x0;_0x33c254<_0x534677[_0x49bb('0x37')];_0x33c254+=0x1){var _0x403726=_0x534677[_0x33c254]['get']({'plain':!![]});_0x38a3d5[_0x49bb('0x69')]=_0x333a64[_0x49bb('0x45')][_0x49bb('0x69')]?_0x333a64[_0x49bb('0x45')][_0x49bb('0x69')]:_0x38a3d5['dialCheckDuplicateType'];switch(_0x38a3d5[_0x49bb('0x69')]){case _0x49bb('0x6a'):_0x5b27b1=squel[_0x49bb('0x6b')]()['into'](_0x49bb('0x6c'))[_0x49bb('0x6d')]([_0x49bb('0x6e'),_0x49bb('0x6f'),'ContactId',_0x49bb('0x70'),_0x49bb('0x59'),_0x49bb('0x4e'),'updatedAt'],squel[_0x49bb('0x71')]()[_0x49bb('0x72')]('phone','phone')[_0x49bb('0x72')](_0x49bb('0x73'),_0x49bb('0x6f'))[_0x49bb('0x72')]('id',_0x49bb('0x74'))[_0x49bb('0x72')](_0x403726[_0x49bb('0x75')][_0x49bb('0x76')](),_0x49bb('0x70'))[_0x49bb('0x72')](_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')](),_0x49bb('0x59'))['field']('\x27'+_0x3d761d+'\x27',_0x49bb('0x4e'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x50'))['from'](_0x49bb('0x77'))['where'](_0x49bb('0x78'))[_0x49bb('0x39')](_0x49bb('0x79'),_0x403726['CmListId'][_0x49bb('0x76')]())[_0x49bb('0x39')](_0x49bb('0x7a'))[_0x49bb('0x39')](_0x49bb('0x7b'),squel[_0x49bb('0x71')]()['field'](_0x49bb('0x7c'))[_0x49bb('0x7d')](_0x49bb('0x7e'))[_0x49bb('0x39')](_0x49bb('0x7f'),_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')]()))[_0x49bb('0x39')](_0x49bb('0x7b'),squel[_0x49bb('0x71')]()[_0x49bb('0x72')]('COALESCE(phone,\x27\x27)')[_0x49bb('0x7d')](_0x49bb('0x6c'))['where'](_0x49bb('0x7f'),_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')]())))[_0x49bb('0x76')]();break;case _0x49bb('0x80'):_0x5b27b1=squel[_0x49bb('0x6b')]()[_0x49bb('0x81')](_0x49bb('0x6c'))[_0x49bb('0x6d')](['phone',_0x49bb('0x6f'),_0x49bb('0x74'),_0x49bb('0x70'),'CampaignId','createdAt','updatedAt'],squel['select']()[_0x49bb('0x72')](_0x49bb('0x6e'),_0x49bb('0x6e'))['field']('NOW()',_0x49bb('0x6f'))[_0x49bb('0x72')]('id',_0x49bb('0x74'))[_0x49bb('0x72')](_0x403726[_0x49bb('0x75')][_0x49bb('0x76')](),_0x49bb('0x70'))[_0x49bb('0x72')](_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')](),_0x49bb('0x59'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x4e'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x50'))[_0x49bb('0x7d')](_0x49bb('0x77'))[_0x49bb('0x39')](_0x49bb('0x78'))['where'](_0x49bb('0x79'),_0x403726[_0x49bb('0x75')]['toString']())[_0x49bb('0x39')]('phone\x20IS\x20NOT\x20NULL')[_0x49bb('0x39')](_0x49bb('0x7b'),squel[_0x49bb('0x71')]()[_0x49bb('0x72')]('COALESCE(phone,\x27\x27)')['from'](_0x49bb('0x6c'))[_0x49bb('0x39')](_0x49bb('0x7f'),_0x333a64['params']['id'][_0x49bb('0x76')]())))['toString']();break;default:_0x5b27b1=squel[_0x49bb('0x6b')]()[_0x49bb('0x81')]('cm_hopper')['fromQuery']([_0x49bb('0x6e'),_0x49bb('0x6f'),_0x49bb('0x74'),_0x49bb('0x70'),_0x49bb('0x59'),_0x49bb('0x4e'),_0x49bb('0x50')],squel[_0x49bb('0x71')]()[_0x49bb('0x72')](_0x49bb('0x6e'),'phone')[_0x49bb('0x72')]('NOW()',_0x49bb('0x6f'))[_0x49bb('0x72')]('id',_0x49bb('0x74'))[_0x49bb('0x72')](_0x403726[_0x49bb('0x75')]['toString'](),_0x49bb('0x70'))['field'](_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')](),'CampaignId')[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x4e'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x50'))[_0x49bb('0x7d')]('cm_contacts')[_0x49bb('0x39')](_0x49bb('0x78'))[_0x49bb('0x39')]('ListId\x20=\x20?',_0x403726['CmListId'][_0x49bb('0x76')]())[_0x49bb('0x39')](_0x49bb('0x7a')))[_0x49bb('0x76')]();}_0x3d1da9=squel[_0x49bb('0x6b')]()[_0x49bb('0x81')]('cm_hopper_additional_phones')[_0x49bb('0x6d')]([_0x49bb('0x82'),_0x49bb('0x6f'),_0x49bb('0x6e'),'OrderBy',_0x49bb('0x4e'),_0x49bb('0x50')],squel[_0x49bb('0x71')]()[_0x49bb('0x72')](_0x49bb('0x83'),'id')['field'](_0x49bb('0x73'),_0x49bb('0x6f'))['field']('ci.item',_0x49bb('0x6e'))[_0x49bb('0x72')]('ci.OrderBY','OrderBy')[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x4e'))[_0x49bb('0x72')]('\x27'+_0x3d761d+'\x27',_0x49bb('0x50'))[_0x49bb('0x7d')]('cm_contact_has_items','ci')[_0x49bb('0x84')](_0x49bb('0x6c'),'h',_0x49bb('0x85'))[_0x49bb('0x39')](_0x49bb('0x86'),_0x403726[_0x49bb('0x75')][_0x49bb('0x76')]())['where'](_0x49bb('0x87'),_0x333a64[_0x49bb('0x41')]['id'][_0x49bb('0x76')]())[_0x49bb('0x39')](_0x49bb('0x88'),_0x3d761d))[_0x49bb('0x76')]();_0x20a650['push'](db['sequelize'][_0x49bb('0x31')](_0x5b27b1));_0xd2cd1a[_0x49bb('0x89')](db[_0x49bb('0x8a')][_0x49bb('0x31')](_0x3d1da9));}return BPromise[_0x49bb('0x8b')](_0x20a650);}})[_0x49bb('0x23')](function(){return BPromise[_0x49bb('0x8b')](_0xd2cd1a);})[_0x49bb('0x23')](function(){return _0x29e5f9;})[_0x49bb('0x23')](respondWithResult(_0x4742be,null))[_0x49bb('0x40')](handleError(_0x4742be,null));};exports[_0x49bb('0x8c')]=function(_0x463ed6,_0x4f887c,_0x6cfddb){return db['Campaign'][_0x49bb('0x43')]({'where':{'id':_0x463ed6[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x4f887c,null))['then'](function(_0x2e2e87){if(_0x2e2e87){return _0x2e2e87[_0x49bb('0x8c')](_0x463ed6[_0x49bb('0x31')]['ids']);}})['then'](function(_0x45957b){if(_0x45957b){return db[_0x49bb('0x55')][_0x49bb('0x26')]({'where':{'ListId':_0x463ed6[_0x49bb('0x31')][_0x49bb('0x67')],'CampaignId':_0x463ed6[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](function(){return _0x45957b;});}})[_0x49bb('0x23')](respondWithStatusCode(_0x4f887c,null))[_0x49bb('0x40')](handleError(_0x4f887c,null));};exports[_0x49bb('0x8d')]=function(_0x5418e4,_0x4e133b,_0x460091){var _0x1346fa={};var _0x52a9d4={};var _0x7f3477;var _0x3b0592;return db[_0x49bb('0x2a')][_0x49bb('0x54')]({'where':{'id':_0x5418e4[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x4e133b,null))[_0x49bb('0x23')](function(_0x1036f0){if(_0x1036f0){_0x7f3477=_0x1036f0;_0x52a9d4[_0x49bb('0x2f')]=_[_0x49bb('0x32')](db['CmList'][_0x49bb('0x2b')]);_0x52a9d4['query']=_[_0x49bb('0x32')](_0x5418e4[_0x49bb('0x31')]);_0x52a9d4[_0x49bb('0x33')]=_[_0x49bb('0x34')](_0x52a9d4[_0x49bb('0x2f')],_0x52a9d4[_0x49bb('0x31')]);_0x1346fa[_0x49bb('0x36')]=_['intersection'](_0x52a9d4[_0x49bb('0x2f')],qs[_0x49bb('0x35')](_0x5418e4['query'][_0x49bb('0x35')]));_0x1346fa[_0x49bb('0x36')]=_0x1346fa[_0x49bb('0x36')][_0x49bb('0x37')]?_0x1346fa[_0x49bb('0x36')]:_0x52a9d4['model'];_0x1346fa[_0x49bb('0x57')]=qs[_0x49bb('0x38')](_0x5418e4['query'][_0x49bb('0x38')]);_0x1346fa[_0x49bb('0x39')]=qs[_0x49bb('0x33')](_[_0x49bb('0x58')](_0x5418e4[_0x49bb('0x31')],_0x52a9d4['filters']));if(_0x5418e4[_0x49bb('0x31')]['filter']){_0x1346fa['where']=_[_0x49bb('0x3b')](_0x1346fa[_0x49bb('0x39')],{'$or':_['map'](_0x1346fa[_0x49bb('0x36')],function(_0x38bac0){var _0x1021ea={};_0x1021ea[_0x38bac0]={'$like':'%'+_0x5418e4[_0x49bb('0x31')][_0x49bb('0x3a')]+'%'};return _0x1021ea;})});}_0x1346fa=_['merge']({},_0x1346fa,_0x5418e4[_0x49bb('0x3d')]);return _0x7f3477[_0x49bb('0x8d')](_0x1346fa);}})['then'](function(_0x162884){if(_0x162884){_0x3b0592=_0x162884[_0x49bb('0x37')];if(!_0x5418e4[_0x49bb('0x31')][_0x49bb('0x56')]('nolimit')){_0x1346fa[_0x49bb('0x1e')]=qs[_0x49bb('0x1e')](_0x5418e4[_0x49bb('0x31')][_0x49bb('0x1e')]);_0x1346fa[_0x49bb('0x1c')]=qs[_0x49bb('0x1c')](_0x5418e4[_0x49bb('0x31')][_0x49bb('0x1c')]);}return _0x7f3477[_0x49bb('0x8d')](_0x1346fa);}})['then'](function(_0x5bd052){if(_0x5bd052){return _0x5bd052?{'count':_0x3b0592,'rows':_0x5bd052}:null;}})[_0x49bb('0x23')](respondWithResult(_0x4e133b,null))[_0x49bb('0x40')](handleError(_0x4e133b,null));};exports[_0x49bb('0x8e')]=function(_0x5cc812,_0x308a85,_0x526469){var _0x2e4be8,_0x139929;var _0x17f942=[];var _0x4456b3=moment()[_0x49bb('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x49bb('0x2a')][_0x49bb('0x43')]({'where':{'id':_0x5cc812[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0x308a85,null))[_0x49bb('0x23')](function(_0xac35e6){if(_0xac35e6){_0x139929=_0xac35e6;return _0xac35e6[_0x49bb('0x8e')](_0x5cc812[_0x49bb('0x45')][_0x49bb('0x67')],_['omit'](_0x5cc812[_0x49bb('0x45')],[_0x49bb('0x67'),'id'])||{});}return null;})['spread'](function(_0x2caab6){var _0x5cc412;var _0x34e4bb;_0x2e4be8=_0x2caab6||[];var _0x1c7a91=[];if(_0x2caab6){for(var _0x44ef98=0x0;_0x44ef98<_0x2caab6[_0x49bb('0x37')];_0x44ef98+=0x1){var _0x526e52=_0x2caab6[_0x44ef98][_0x49bb('0x46')]({'plain':!![]});_0x5cc412=squel['insert']()[_0x49bb('0x81')](_0x49bb('0x8f'))[_0x49bb('0x6d')]([_0x49bb('0x6e'),_0x49bb('0x74'),_0x49bb('0x70'),_0x49bb('0x59'),'createdAt',_0x49bb('0x50')],squel['select']()[_0x49bb('0x72')]('phone',_0x49bb('0x6e'))[_0x49bb('0x72')]('id',_0x49bb('0x74'))[_0x49bb('0x72')](_0x526e52[_0x49bb('0x75')][_0x49bb('0x76')](),_0x49bb('0x70'))[_0x49bb('0x72')](_0x5cc812[_0x49bb('0x41')]['id'][_0x49bb('0x76')](),'CampaignId')['field']('NOW()',_0x49bb('0x4e'))[_0x49bb('0x72')](_0x49bb('0x73'),_0x49bb('0x50'))[_0x49bb('0x7d')]('cm_contacts')[_0x49bb('0x39')]('deletedAt\x20IS\x20NULL')[_0x49bb('0x39')]('ListId\x20=\x20?',_0x526e52[_0x49bb('0x75')]['toString']())[_0x49bb('0x39')](_0x49bb('0x7a')))[_0x49bb('0x76')]();_0x1c7a91[_0x49bb('0x89')](db['sequelize']['query'](_0x5cc412));}return BPromise[_0x49bb('0x8b')](_0x1c7a91);}})[_0x49bb('0x23')](function(){return _0x2e4be8;})[_0x49bb('0x23')](respondWithResult(_0x308a85,null))['catch'](handleError(_0x308a85,null));};exports[_0x49bb('0x90')]=function(_0x423817,_0xbf83a4,_0x2084e3){return db[_0x49bb('0x2a')]['find']({'where':{'id':_0x423817[_0x49bb('0x41')]['id']}})[_0x49bb('0x23')](handleEntityNotFound(_0xbf83a4,null))[_0x49bb('0x23')](function(_0x32ebdd){if(_0x32ebdd){return _0x32ebdd[_0x49bb('0x90')](_0x423817['query']['ids']);}})[_0x49bb('0x23')](function(_0x8a44b6){if(_0x8a44b6){return db[_0x49bb('0x61')][_0x49bb('0x26')]({'where':{'ListId':_0x423817[_0x49bb('0x31')]['ids'],'CampaignId':_0x423817[_0x49bb('0x41')]['id']}})['then'](function(){return _0x8a44b6;});}})[_0x49bb('0x23')](respondWithStatusCode(_0xbf83a4,null))[_0x49bb('0x40')](handleError(_0xbf83a4,null));};
\ No newline at end of file
index 7237e88..479415b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1fc1f9,_0x454fb2){var _0x4987ca=function(_0x5e90dd){while(--_0x5e90dd){_0x1fc1f9['push'](_0x1fc1f9['shift']());}};_0x4987ca(++_0x454fb2);}(_0x7a54,0x106));var _0x47a5=function(_0x4c5445,_0x3d94dd){_0x4c5445=_0x4c5445-0x0;var _0x5600de=_0x7a54[_0x4c5445];return _0x5600de;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x518db2,_0x7af163){var _0x2f00b4=function(_0x23a129){while(--_0x23a129){_0x518db2['push'](_0x518db2['shift']());}};_0x2f00b4(++_0x7af163);}(_0x7a54,0x106));var _0x47a5=function(_0x439efb,_0x2dcca8){_0x439efb=_0x439efb-0x0;var _0x531305=_0x7a54[_0x439efb];return _0x531305;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5f3c4b4..ac6f8d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd110=['options','raw','attributes','include','map','model','debug','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Campaign,\x20%s,\x20%s','GetCampaign','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd110,0x1e8));var _0x0d11=function(_0xa01ab8,_0x918083){_0xa01ab8=_0xa01ab8-0x0;var _0x46e583=_0xd110[_0xa01ab8];return _0x46e583;};'use strict';var _=require(_0x0d11('0x0'));var util=require(_0x0d11('0x1'));var moment=require(_0x0d11('0x2'));var BPromise=require('bluebird');var rs=require(_0x0d11('0x3'));var fs=require('fs');var Redis=require(_0x0d11('0x4'));var db=require(_0x0d11('0x5'))['db'];var utils=require(_0x0d11('0x6'));var logger=require(_0x0d11('0x7'))(_0x0d11('0x8'));var config=require(_0x0d11('0x9'));var jayson=require(_0x0d11('0xa'));var client=jayson['client'][_0x0d11('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a889c,_0x33c46e,_0x4f3f3f){return new BPromise(function(_0x47a493,_0x3f9f5a){return client[_0x0d11('0xc')](_0x5a889c,_0x4f3f3f)[_0x0d11('0xd')](function(_0x4c6a59){logger[_0x0d11('0xe')]('Campaign,\x20%s,\x20%s',_0x33c46e,_0x0d11('0xf'));logger['debug'](_0x0d11('0x10'),_0x33c46e,_0x0d11('0xf'),JSON[_0x0d11('0x11')](_0x4c6a59));if(_0x4c6a59[_0x0d11('0x12')]){if(_0x4c6a59['error'][_0x0d11('0x13')]===0x1f4){logger[_0x0d11('0x12')]('Campaign,\x20%s,\x20%s',_0x33c46e,_0x4c6a59[_0x0d11('0x12')][_0x0d11('0x14')]);return _0x3f9f5a(_0x4c6a59[_0x0d11('0x12')]['message']);}logger[_0x0d11('0x12')](_0x0d11('0x15'),_0x33c46e,_0x4c6a59['error'][_0x0d11('0x14')]);return _0x47a493(_0x4c6a59[_0x0d11('0x12')][_0x0d11('0x14')]);}else{logger[_0x0d11('0xe')](_0x0d11('0x15'),_0x33c46e,'request\x20sent');_0x47a493(_0x4c6a59['result'][_0x0d11('0x14')]);}})['catch'](function(_0x46aa4f){logger[_0x0d11('0x12')]('Campaign,\x20%s,\x20%s',_0x33c46e,_0x46aa4f);_0x3f9f5a(_0x46aa4f);});});}exports[_0x0d11('0x16')]=function(_0x57df83){var _0x2e4c05=this;return new Promise(function(_0x2a29db,_0x5e3bd3){return db['Campaign'][_0x0d11('0x17')]({'raw':_0x57df83[_0x0d11('0x18')]?_0x57df83[_0x0d11('0x18')][_0x0d11('0x19')]===undefined?!![]:![]:!![],'where':_0x57df83[_0x0d11('0x18')]?_0x57df83[_0x0d11('0x18')]['where']||null:null,'attributes':_0x57df83[_0x0d11('0x18')]?_0x57df83[_0x0d11('0x18')][_0x0d11('0x1a')]||null:null,'limit':_0x57df83[_0x0d11('0x18')]?_0x57df83[_0x0d11('0x18')]['limit']||null:null,'include':_0x57df83[_0x0d11('0x18')]?_0x57df83['options'][_0x0d11('0x1b')]?_[_0x0d11('0x1c')](_0x57df83[_0x0d11('0x18')]['include'],function(_0x304f7f){return{'model':db[_0x304f7f[_0x0d11('0x1d')]],'as':_0x304f7f['as'],'attributes':_0x304f7f['attributes'],'include':_0x304f7f[_0x0d11('0x1b')]?_['map'](_0x304f7f[_0x0d11('0x1b')],function(_0x510bf5){return{'model':db[_0x510bf5['model']],'as':_0x510bf5['as'],'attributes':_0x510bf5[_0x0d11('0x1a')],'include':_0x510bf5[_0x0d11('0x1b')]?_[_0x0d11('0x1c')](_0x510bf5[_0x0d11('0x1b')],function(_0x7be5a3){return{'model':db[_0x7be5a3['model']],'as':_0x7be5a3['as'],'attributes':_0x7be5a3[_0x0d11('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25e7fc){logger['info'](_0x0d11('0x16'),_0x57df83);logger[_0x0d11('0x1e')](_0x0d11('0x16'),_0x57df83,JSON[_0x0d11('0x11')](_0x25e7fc));_0x2a29db(_0x25e7fc);})[_0x0d11('0x1f')](function(_0x17a668){logger[_0x0d11('0x12')](_0x0d11('0x16'),_0x17a668[_0x0d11('0x14')],_0x57df83);_0x5e3bd3(_0x2e4c05[_0x0d11('0x12')](0x1f4,_0x17a668[_0x0d11('0x14')]));});});};
\ No newline at end of file
+var _0x22a4=['limit','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','options','raw','where','attributes'];(function(_0x5017ba,_0x2c0229){var _0x194d2=function(_0x2d0307){while(--_0x2d0307){_0x5017ba['push'](_0x5017ba['shift']());}};_0x194d2(++_0x2c0229);}(_0x22a4,0x1cb));var _0x422a=function(_0x2341c6,_0x3af092){_0x2341c6=_0x2341c6-0x0;var _0x54c34d=_0x22a4[_0x2341c6];return _0x54c34d;};'use strict';var _=require(_0x422a('0x0'));var util=require(_0x422a('0x1'));var moment=require(_0x422a('0x2'));var BPromise=require(_0x422a('0x3'));var rs=require(_0x422a('0x4'));var fs=require('fs');var Redis=require(_0x422a('0x5'));var db=require(_0x422a('0x6'))['db'];var utils=require(_0x422a('0x7'));var logger=require('../../config/logger')(_0x422a('0x8'));var config=require(_0x422a('0x9'));var jayson=require(_0x422a('0xa'));var client=jayson[_0x422a('0xb')][_0x422a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e8fe2,_0x3b5c92,_0x1b4b08){return new BPromise(function(_0x23b1b0,_0x392224){return client[_0x422a('0xd')](_0x5e8fe2,_0x1b4b08)[_0x422a('0xe')](function(_0x317466){logger[_0x422a('0xf')]('Campaign,\x20%s,\x20%s',_0x3b5c92,'request\x20sent');logger[_0x422a('0x10')](_0x422a('0x11'),_0x3b5c92,_0x422a('0x12'),JSON[_0x422a('0x13')](_0x317466));if(_0x317466[_0x422a('0x14')]){if(_0x317466[_0x422a('0x14')]['code']===0x1f4){logger['error'](_0x422a('0x15'),_0x3b5c92,_0x317466['error']['message']);return _0x392224(_0x317466['error'][_0x422a('0x16')]);}logger[_0x422a('0x14')](_0x422a('0x15'),_0x3b5c92,_0x317466[_0x422a('0x14')][_0x422a('0x16')]);return _0x23b1b0(_0x317466[_0x422a('0x14')][_0x422a('0x16')]);}else{logger[_0x422a('0xf')](_0x422a('0x15'),_0x3b5c92,_0x422a('0x12'));_0x23b1b0(_0x317466[_0x422a('0x17')][_0x422a('0x16')]);}})[_0x422a('0x18')](function(_0x3d5033){logger[_0x422a('0x14')](_0x422a('0x15'),_0x3b5c92,_0x3d5033);_0x392224(_0x3d5033);});});}exports[_0x422a('0x19')]=function(_0x5e2507){var _0x30847a=this;return new Promise(function(_0x3c5d86,_0x5b29fc){return db[_0x422a('0x1a')]['findAll']({'raw':_0x5e2507['options']?_0x5e2507[_0x422a('0x1b')][_0x422a('0x1c')]===undefined?!![]:![]:!![],'where':_0x5e2507[_0x422a('0x1b')]?_0x5e2507[_0x422a('0x1b')][_0x422a('0x1d')]||null:null,'attributes':_0x5e2507[_0x422a('0x1b')]?_0x5e2507[_0x422a('0x1b')][_0x422a('0x1e')]||null:null,'limit':_0x5e2507['options']?_0x5e2507[_0x422a('0x1b')][_0x422a('0x1f')]||null:null,'include':_0x5e2507[_0x422a('0x1b')]?_0x5e2507[_0x422a('0x1b')][_0x422a('0x20')]?_['map'](_0x5e2507[_0x422a('0x1b')][_0x422a('0x20')],function(_0x6e209d){return{'model':db[_0x6e209d['model']],'as':_0x6e209d['as'],'attributes':_0x6e209d[_0x422a('0x1e')],'include':_0x6e209d[_0x422a('0x20')]?_[_0x422a('0x21')](_0x6e209d[_0x422a('0x20')],function(_0xfc8699){return{'model':db[_0xfc8699[_0x422a('0x22')]],'as':_0xfc8699['as'],'attributes':_0xfc8699[_0x422a('0x1e')],'include':_0xfc8699[_0x422a('0x20')]?_['map'](_0xfc8699[_0x422a('0x20')],function(_0x15d2ab){return{'model':db[_0x15d2ab['model']],'as':_0x15d2ab['as'],'attributes':_0x15d2ab[_0x422a('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b88ae){logger[_0x422a('0xf')](_0x422a('0x19'),_0x5e2507);logger[_0x422a('0x10')]('GetCampaign',_0x5e2507,JSON[_0x422a('0x13')](_0x1b88ae));_0x3c5d86(_0x1b88ae);})[_0x422a('0x18')](function(_0x50cc29){logger['error'](_0x422a('0x19'),_0x50cc29[_0x422a('0x16')],_0x5e2507);_0x5b29fc(_0x30847a['error'](0x1f4,_0x50cc29['message']));});});};
\ No newline at end of file
index 08335b8..126c4ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdee8=['removeBlackLists','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','/:id/lists','post','create','/:id/clone','clone','/:id/blacklists','addBlackLists','put','update','delete','destroy','removeLists'];(function(_0x39feb0,_0x5e91e4){var _0xae50fa=function(_0x1c990a){while(--_0x1c990a){_0x39feb0['push'](_0x39feb0['shift']());}};_0xae50fa(++_0x5e91e4);}(_0xdee8,0x157));var _0x8dee=function(_0x4a7178,_0x3d0b6e){_0x4a7178=_0x4a7178-0x0;var _0x2c3d14=_0xdee8[_0x4a7178];return _0x2c3d14;};'use strict';var multer=require(_0x8dee('0x0'));var util=require('util');var path=require(_0x8dee('0x1'));var timeout=require('connect-timeout');var express=require(_0x8dee('0x2'));var router=express[_0x8dee('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8dee('0x4'));var interaction=require(_0x8dee('0x5'));var config=require(_0x8dee('0x6'));var controller=require(_0x8dee('0x7'));router[_0x8dee('0x8')]('/',auth[_0x8dee('0x9')](),controller[_0x8dee('0xa')]);router['get'](_0x8dee('0xb'),auth[_0x8dee('0x9')](),controller['show']);router[_0x8dee('0x8')](_0x8dee('0xc'),auth['isAuthenticated'](),controller[_0x8dee('0xd')]);router[_0x8dee('0x8')](_0x8dee('0xe'),auth[_0x8dee('0x9')](),controller['getHopperHistories']);router[_0x8dee('0x8')]('/:id/hopper_finals',auth[_0x8dee('0x9')](),controller[_0x8dee('0xf')]);router[_0x8dee('0x8')](_0x8dee('0x10'),auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x8dee('0x8')](_0x8dee('0x11'),auth[_0x8dee('0x9')](),controller['getLists']);router[_0x8dee('0x8')]('/:id/blacklists',auth[_0x8dee('0x9')](),controller['getBlackLists']);router[_0x8dee('0x12')]('/',auth[_0x8dee('0x9')](),controller[_0x8dee('0x13')]);router[_0x8dee('0x12')](_0x8dee('0x14'),auth[_0x8dee('0x9')](),controller[_0x8dee('0x15')]);router[_0x8dee('0x12')](_0x8dee('0x11'),auth[_0x8dee('0x9')](),controller['addLists']);router[_0x8dee('0x12')](_0x8dee('0x16'),auth['isAuthenticated'](),controller[_0x8dee('0x17')]);router[_0x8dee('0x18')](_0x8dee('0xb'),auth[_0x8dee('0x9')](),controller[_0x8dee('0x19')]);router[_0x8dee('0x1a')](_0x8dee('0xb'),auth['isAuthenticated'](),controller[_0x8dee('0x1b')]);router[_0x8dee('0x1a')](_0x8dee('0x11'),auth[_0x8dee('0x9')](),controller[_0x8dee('0x1c')]);router[_0x8dee('0x1a')]('/:id/blacklists',auth[_0x8dee('0x9')](),controller[_0x8dee('0x1d')]);module[_0x8dee('0x1e')]=router;
\ No newline at end of file
+var _0x0d7d=['update','delete','removeLists','removeBlackLists','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','addLists','addBlackLists'];(function(_0x4c536b,_0x58690d){var _0x58d9d6=function(_0x21a87b){while(--_0x21a87b){_0x4c536b['push'](_0x4c536b['shift']());}};_0x58d9d6(++_0x58690d);}(_0x0d7d,0x191));var _0xd0d7=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x0d7d[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0xd0d7('0x0'));var util=require(_0xd0d7('0x1'));var path=require(_0xd0d7('0x2'));var timeout=require('connect-timeout');var express=require(_0xd0d7('0x3'));var router=express[_0xd0d7('0x4')]();var fs_extra=require(_0xd0d7('0x5'));var auth=require(_0xd0d7('0x6'));var interaction=require(_0xd0d7('0x7'));var config=require('../../config/environment');var controller=require(_0xd0d7('0x8'));router['get']('/',auth[_0xd0d7('0x9')](),controller[_0xd0d7('0xa')]);router[_0xd0d7('0xb')](_0xd0d7('0xc'),auth[_0xd0d7('0x9')](),controller[_0xd0d7('0xd')]);router[_0xd0d7('0xb')](_0xd0d7('0xe'),auth[_0xd0d7('0x9')](),controller[_0xd0d7('0xf')]);router[_0xd0d7('0xb')](_0xd0d7('0x10'),auth[_0xd0d7('0x9')](),controller[_0xd0d7('0x11')]);router['get'](_0xd0d7('0x12'),auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0xd0d7('0x13'),auth['isAuthenticated'](),controller[_0xd0d7('0x14')]);router[_0xd0d7('0xb')](_0xd0d7('0x15'),auth['isAuthenticated'](),controller['getLists']);router[_0xd0d7('0xb')](_0xd0d7('0x16'),auth['isAuthenticated'](),controller[_0xd0d7('0x17')]);router[_0xd0d7('0x18')]('/',auth[_0xd0d7('0x9')](),controller['create']);router[_0xd0d7('0x18')](_0xd0d7('0x19'),auth['isAuthenticated'](),controller['clone']);router['post'](_0xd0d7('0x15'),auth[_0xd0d7('0x9')](),controller[_0xd0d7('0x1a')]);router[_0xd0d7('0x18')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xd0d7('0x1b')]);router['put'](_0xd0d7('0xc'),auth[_0xd0d7('0x9')](),controller[_0xd0d7('0x1c')]);router[_0xd0d7('0x1d')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xd0d7('0x1d')](_0xd0d7('0x15'),auth[_0xd0d7('0x9')](),controller[_0xd0d7('0x1e')]);router['delete']('/:id/blacklists',auth[_0xd0d7('0x9')](),controller[_0xd0d7('0x1f')]);module[_0xd0d7('0x20')]=router;
\ No newline at end of file
index 9c0068b..b6543bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c77=['key','exports','STRING','VIRTUAL'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x2c77,0x10d));var _0x72c7=function(_0x195486,_0x6149e1){_0x195486=_0x195486-0x0;var _0x1f234f=_0x2c77[_0x195486];return _0x1f234f;};'use strict';var Sequelize=require('sequelize');module[_0x72c7('0x0')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x72c7('0x1')]},'name':{'type':Sequelize[_0x72c7('0x2')],'get':function(){return this['getDataValue'](_0x72c7('0x3'));}}};
\ No newline at end of file
+var _0x3c54=['TEXT','getDataValue','key','sequelize','exports','STRING'];(function(_0x36387b,_0x5b495b){var _0x3eeb83=function(_0x17b0fe){while(--_0x17b0fe){_0x36387b['push'](_0x36387b['shift']());}};_0x3eeb83(++_0x5b495b);}(_0x3c54,0x75));var _0x43c5=function(_0x30067e,_0x56f207){_0x30067e=_0x30067e-0x0;var _0x5c048d=_0x3c54[_0x30067e];return _0x5c048d;};'use strict';var Sequelize=require(_0x43c5('0x0'));module[_0x43c5('0x1')]={'key':{'type':Sequelize[_0x43c5('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x43c5('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x43c5('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x43c5('0x4')](_0x43c5('0x5'));}}};
\ No newline at end of file
index 38a25e1..1649541 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1eb8=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','include','CannedAnswer','findAll','rows','catch','show','find','params','body','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CannedAnswers','userProfileId','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0xb8996b,_0x264773){var _0x1b61f=function(_0x1d972b){while(--_0x1d972b){_0xb8996b['push'](_0xb8996b['shift']());}};_0x1b61f(++_0x264773);}(_0x1eb8,0x16b));var _0x81eb=function(_0x447306,_0x74533c){_0x447306=_0x447306-0x0;var _0x29c3de=_0x1eb8[_0x447306];return _0x29c3de;};'use strict';var emlformat=require(_0x81eb('0x0'));var rimraf=require(_0x81eb('0x1'));var zipdir=require(_0x81eb('0x2'));var jsonpatch=require(_0x81eb('0x3'));var rp=require(_0x81eb('0x4'));var moment=require(_0x81eb('0x5'));var BPromise=require(_0x81eb('0x6'));var Mustache=require(_0x81eb('0x7'));var util=require(_0x81eb('0x8'));var path=require(_0x81eb('0x9'));var sox=require(_0x81eb('0xa'));var csv=require(_0x81eb('0xb'));var ejs=require(_0x81eb('0xc'));var fs=require('fs');var fs_extra=require(_0x81eb('0xd'));var _=require(_0x81eb('0xe'));var squel=require(_0x81eb('0xf'));var crypto=require(_0x81eb('0x10'));var jsforce=require(_0x81eb('0x11'));var deskjs=require(_0x81eb('0x12'));var toCsv=require(_0x81eb('0xb'));var querystring=require(_0x81eb('0x13'));var Papa=require(_0x81eb('0x14'));var Redis=require(_0x81eb('0x15'));var authService=require(_0x81eb('0x16'));var qs=require(_0x81eb('0x17'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x81eb('0x18'));var logger=require('../../config/logger')('api');var utils=require(_0x81eb('0x19'));var config=require(_0x81eb('0x1a'));var licenseUtil=require(_0x81eb('0x1b'));var db=require(_0x81eb('0x1c'))['db'];function respondWithStatusCode(_0x27a5cf,_0x1527a5){_0x1527a5=_0x1527a5||0xcc;return function(_0x58071c){if(_0x58071c){return _0x27a5cf[_0x81eb('0x1d')](_0x1527a5);}return _0x27a5cf[_0x81eb('0x1e')](_0x1527a5)[_0x81eb('0x1f')]();};}function respondWithResult(_0x18b464,_0x5ab0fa){_0x5ab0fa=_0x5ab0fa||0xc8;return function(_0x503f27){if(_0x503f27){return _0x18b464[_0x81eb('0x1e')](_0x5ab0fa)[_0x81eb('0x20')](_0x503f27);}};}function respondWithFilteredResult(_0x50dd1b,_0x330dbd){return function(_0xde0758){if(_0xde0758){var _0x166867=typeof _0x330dbd['offset']==='undefined'&&typeof _0x330dbd[_0x81eb('0x21')]===_0x81eb('0x22');var _0x1b3742=_0xde0758[_0x81eb('0x23')];var _0x5117f2=_0x166867?0x0:_0x330dbd[_0x81eb('0x24')];var _0x46d5e8=_0x166867?_0xde0758[_0x81eb('0x23')]:_0x330dbd[_0x81eb('0x24')]+_0x330dbd[_0x81eb('0x21')];var _0x2cb091;if(_0x46d5e8>=_0x1b3742){_0x46d5e8=_0x1b3742;_0x2cb091=0xc8;}else{_0x2cb091=0xce;}_0x50dd1b[_0x81eb('0x1e')](_0x2cb091);return _0x50dd1b[_0x81eb('0x25')](_0x81eb('0x26'),_0x5117f2+'-'+_0x46d5e8+'/'+_0x1b3742)['json'](_0xde0758);}return null;};}function patchUpdates(_0x467bd5){return function(_0x53d9b7){try{jsonpatch[_0x81eb('0x27')](_0x53d9b7,_0x467bd5,!![]);}catch(_0x52bb60){return BPromise[_0x81eb('0x28')](_0x52bb60);}return _0x53d9b7[_0x81eb('0x29')]();};}function saveUpdates(_0x5a6984,_0x509fbd){return function(_0x4f8cba){if(_0x4f8cba){return _0x4f8cba[_0x81eb('0x2a')](_0x5a6984)[_0x81eb('0x2b')](function(_0x292af3){return _0x292af3;});}return null;};}function removeEntity(_0x27a1a2,_0x1f850a){return function(_0xf13b2b){if(_0xf13b2b){return _0xf13b2b[_0x81eb('0x2c')]()[_0x81eb('0x2b')](function(){var _0x59ef10=_0xf13b2b[_0x81eb('0x2d')]({'plain':!![]});var _0x35c316='CannedAnswers';return db[_0x81eb('0x2e')][_0x81eb('0x2c')]({'where':{'type':_0x35c316,'resourceId':_0x59ef10['id']}})['then'](function(){return _0xf13b2b;});})['then'](function(){_0x27a1a2[_0x81eb('0x1e')](0xcc)[_0x81eb('0x1f')]();});}};}function handleEntityNotFound(_0xa49a1f,_0x2f9873){return function(_0x3dbfbb){if(!_0x3dbfbb){_0xa49a1f[_0x81eb('0x1d')](0x194);}return _0x3dbfbb;};}function handleError(_0x39a800,_0x885557){_0x885557=_0x885557||0x1f4;return function(_0x376c91){logger['error'](_0x376c91[_0x81eb('0x2f')]);if(_0x376c91[_0x81eb('0x30')]){delete _0x376c91[_0x81eb('0x30')];}_0x39a800[_0x81eb('0x1e')](_0x885557)['send'](_0x376c91);};}exports['index']=function(_0x1fec26,_0x589652){var _0x304213={},_0x3844ee={},_0x4efe6c={'count':0x0,'rows':[]};var _0xe66b86=_[_0x81eb('0x31')](db['CannedAnswer'][_0x81eb('0x32')],function(_0x433b8b){return{'name':_0x433b8b[_0x81eb('0x33')],'type':_0x433b8b['type']['key']};});_0x3844ee[_0x81eb('0x34')]=_[_0x81eb('0x31')](_0xe66b86,_0x81eb('0x30'));_0x3844ee[_0x81eb('0x35')]=_[_0x81eb('0x36')](_0x1fec26[_0x81eb('0x35')]);_0x3844ee[_0x81eb('0x37')]=_[_0x81eb('0x38')](_0x3844ee[_0x81eb('0x34')],_0x3844ee[_0x81eb('0x35')]);_0x304213[_0x81eb('0x39')]=_['intersection'](_0x3844ee['model'],qs[_0x81eb('0x3a')](_0x1fec26[_0x81eb('0x35')][_0x81eb('0x3a')]));_0x304213['attributes']=_0x304213[_0x81eb('0x39')][_0x81eb('0x3b')]?_0x304213[_0x81eb('0x39')]:_0x3844ee[_0x81eb('0x34')];if(!_0x1fec26[_0x81eb('0x35')]['hasOwnProperty'](_0x81eb('0x3c'))){_0x304213[_0x81eb('0x21')]=qs[_0x81eb('0x21')](_0x1fec26[_0x81eb('0x35')]['limit']);_0x304213[_0x81eb('0x24')]=qs[_0x81eb('0x24')](_0x1fec26[_0x81eb('0x35')][_0x81eb('0x24')]);}_0x304213[_0x81eb('0x3d')]=qs[_0x81eb('0x3e')](_0x1fec26['query'][_0x81eb('0x3e')]);_0x304213['where']=qs[_0x81eb('0x37')](_[_0x81eb('0x3f')](_0x1fec26[_0x81eb('0x35')],_0x3844ee[_0x81eb('0x37')]),_0xe66b86);if(_0x1fec26['query'][_0x81eb('0x40')]){_0x304213['where']=_['merge'](_0x304213[_0x81eb('0x41')],{'$or':[{'key':{'$like':'%'+_0x1fec26[_0x81eb('0x35')]['filter']+'%'}},{'value':{'$like':'%'+_0x1fec26[_0x81eb('0x35')][_0x81eb('0x40')]+'%'}}]});}_0x304213=_[_0x81eb('0x42')]({},_0x304213,_0x1fec26[_0x81eb('0x43')]);var _0x409599={'where':_0x304213[_0x81eb('0x41')]};return db['CannedAnswer']['count'](_0x409599)[_0x81eb('0x2b')](function(_0x10e374){_0x4efe6c['count']=_0x10e374;if(_0x1fec26[_0x81eb('0x35')]['includeAll']){_0x304213[_0x81eb('0x44')]=[{'all':!![]}];}return db[_0x81eb('0x45')][_0x81eb('0x46')](_0x304213);})['then'](function(_0x48707d){_0x4efe6c[_0x81eb('0x47')]=_0x48707d;return _0x4efe6c;})[_0x81eb('0x2b')](respondWithFilteredResult(_0x589652,_0x304213))[_0x81eb('0x48')](handleError(_0x589652,null));};exports[_0x81eb('0x49')]=function(_0x3deb96,_0x4a7a4b){var _0x436402={'raw':!![],'where':{'id':_0x3deb96['params']['id']}},_0x408898={};_0x408898['model']=_[_0x81eb('0x36')](db[_0x81eb('0x45')][_0x81eb('0x32')]);_0x408898['query']=_[_0x81eb('0x36')](_0x3deb96[_0x81eb('0x35')]);_0x408898[_0x81eb('0x37')]=_[_0x81eb('0x38')](_0x408898[_0x81eb('0x34')],_0x408898['query']);_0x436402[_0x81eb('0x39')]=_[_0x81eb('0x38')](_0x408898[_0x81eb('0x34')],qs[_0x81eb('0x3a')](_0x3deb96[_0x81eb('0x35')][_0x81eb('0x3a')]));_0x436402[_0x81eb('0x39')]=_0x436402[_0x81eb('0x39')]['length']?_0x436402[_0x81eb('0x39')]:_0x408898[_0x81eb('0x34')];if(_0x3deb96[_0x81eb('0x35')]['includeAll']){_0x436402['include']=[{'all':!![]}];}_0x436402=_[_0x81eb('0x42')]({},_0x436402,_0x3deb96[_0x81eb('0x43')]);return db[_0x81eb('0x45')]['find'](_0x436402)[_0x81eb('0x2b')](handleEntityNotFound(_0x4a7a4b,null))[_0x81eb('0x2b')](respondWithResult(_0x4a7a4b,null))[_0x81eb('0x48')](handleError(_0x4a7a4b,null));};exports[_0x81eb('0x2a')]=function(_0x4ee255,_0x505d09){if(_0x4ee255['body']['id']){delete _0x4ee255['body']['id'];}return db[_0x81eb('0x45')][_0x81eb('0x4a')]({'where':{'id':_0x4ee255[_0x81eb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x505d09,null))[_0x81eb('0x2b')](saveUpdates(_0x4ee255[_0x81eb('0x4c')],null))[_0x81eb('0x2b')](respondWithResult(_0x505d09,null))[_0x81eb('0x48')](handleError(_0x505d09,null));};exports[_0x81eb('0x2c')]=function(_0xddc027,_0x49ff92){return db['CannedAnswer']['find']({'where':{'id':_0xddc027[_0x81eb('0x4b')]['id']}})[_0x81eb('0x2b')](handleEntityNotFound(_0x49ff92,null))[_0x81eb('0x2b')](removeEntity(_0x49ff92,null))[_0x81eb('0x48')](handleError(_0x49ff92,null));};exports['create']=function(_0x44bb41,_0x2bc03b){var _0x46b342={'key':_0x44bb41[_0x81eb('0x4c')][_0x81eb('0x4d')]};if(_0x44bb41[_0x81eb('0x4c')][_0x81eb('0x4e')]){_0x46b342[_0x81eb('0x4e')]=_0x44bb41[_0x81eb('0x4c')][_0x81eb('0x4e')];}else if(_0x44bb41['body'][_0x81eb('0x4f')]){_0x46b342[_0x81eb('0x4f')]=_0x44bb41['body'][_0x81eb('0x4f')];}else if(_0x44bb41[_0x81eb('0x4c')][_0x81eb('0x50')]){_0x46b342[_0x81eb('0x50')]=_0x44bb41[_0x81eb('0x4c')][_0x81eb('0x50')];}else if(_0x44bb41[_0x81eb('0x4c')][_0x81eb('0x51')]){_0x46b342[_0x81eb('0x51')]=_0x44bb41['body'][_0x81eb('0x51')];}return db[_0x81eb('0x45')][_0x81eb('0x4a')]({'where':_0x46b342})[_0x81eb('0x2b')](function(_0x58c741){if(_0x58c741){throw new db[(_0x81eb('0x52'))][(_0x81eb('0x53'))](_0x81eb('0x54'));}return db[_0x81eb('0x45')][_0x81eb('0x55')](_0x44bb41[_0x81eb('0x4c')]);})[_0x81eb('0x2b')](function(_0x5393da){var _0x3a8876=_0x44bb41[_0x81eb('0x56')][_0x81eb('0x2d')]({'plain':!![]});if(!_0x3a8876)throw new Error(_0x81eb('0x57'));if(_0x3a8876[_0x81eb('0x58')]===_0x81eb('0x56')){var _0x7af777=_0x5393da[_0x81eb('0x2d')]({'plain':!![]});return db['UserProfileSection'][_0x81eb('0x4a')]({'where':{'name':_0x81eb('0x59'),'userProfileId':_0x3a8876[_0x81eb('0x5a')]},'raw':!![]})['then'](function(_0x4b6e95){if(_0x4b6e95&&_0x4b6e95['autoAssociation']===0x0){return db[_0x81eb('0x2e')][_0x81eb('0x55')]({'name':_0x7af777['name'],'resourceId':_0x7af777['id'],'type':_0x4b6e95['name'],'sectionId':_0x4b6e95['id']},{})[_0x81eb('0x2b')](function(){return _0x5393da;});}else{return _0x5393da;}})[_0x81eb('0x48')](function(_0x508363){logger[_0x81eb('0x5b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x508363);throw _0x508363;});}return _0x5393da;})[_0x81eb('0x2b')](respondWithResult(_0x2bc03b,0xc9))[_0x81eb('0x48')](handleError(_0x2bc03b,null));};
\ No newline at end of file
+var _0xd22b=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','include','CannedAnswer','rows','show','rawAttributes','includeAll','find','catch','update','body','params','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','then','destroy','get','CannedAnswers','end','error','name','send','index','map','key'];(function(_0x598f21,_0x122523){var _0x127aab=function(_0x1860b8){while(--_0x1860b8){_0x598f21['push'](_0x598f21['shift']());}};_0x127aab(++_0x122523);}(_0xd22b,0x129));var _0xbd22=function(_0x2c2067,_0x8d6bce){_0x2c2067=_0x2c2067-0x0;var _0x20f3b3=_0xd22b[_0x2c2067];return _0x20f3b3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbd22('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbd22('0x1'));var moment=require(_0xbd22('0x2'));var BPromise=require(_0xbd22('0x3'));var Mustache=require(_0xbd22('0x4'));var util=require(_0xbd22('0x5'));var path=require(_0xbd22('0x6'));var sox=require(_0xbd22('0x7'));var csv=require(_0xbd22('0x8'));var ejs=require(_0xbd22('0x9'));var fs=require('fs');var fs_extra=require(_0xbd22('0xa'));var _=require(_0xbd22('0xb'));var squel=require(_0xbd22('0xc'));var crypto=require(_0xbd22('0xd'));var jsforce=require(_0xbd22('0xe'));var deskjs=require(_0xbd22('0xf'));var toCsv=require(_0xbd22('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xbd22('0x10'));var authService=require(_0xbd22('0x11'));var qs=require(_0xbd22('0x12'));var as=require(_0xbd22('0x13'));var hardwareService=require(_0xbd22('0x14'));var logger=require(_0xbd22('0x15'))(_0xbd22('0x16'));var utils=require(_0xbd22('0x17'));var config=require(_0xbd22('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbd22('0x19'))['db'];function respondWithStatusCode(_0xb36394,_0x1c481a){_0x1c481a=_0x1c481a||0xcc;return function(_0x120a51){if(_0x120a51){return _0xb36394[_0xbd22('0x1a')](_0x1c481a);}return _0xb36394[_0xbd22('0x1b')](_0x1c481a)['end']();};}function respondWithResult(_0x1d9797,_0x7f25a8){_0x7f25a8=_0x7f25a8||0xc8;return function(_0x413ce6){if(_0x413ce6){return _0x1d9797[_0xbd22('0x1b')](_0x7f25a8)[_0xbd22('0x1c')](_0x413ce6);}};}function respondWithFilteredResult(_0x29591b,_0x3490bd){return function(_0x21c799){if(_0x21c799){var _0x582e47=typeof _0x3490bd['offset']===_0xbd22('0x1d')&&typeof _0x3490bd[_0xbd22('0x1e')]==='undefined';var _0xcb0b55=_0x21c799[_0xbd22('0x1f')];var _0x350106=_0x582e47?0x0:_0x3490bd[_0xbd22('0x20')];var _0x4edfba=_0x582e47?_0x21c799[_0xbd22('0x1f')]:_0x3490bd[_0xbd22('0x20')]+_0x3490bd[_0xbd22('0x1e')];var _0x5ec25c;if(_0x4edfba>=_0xcb0b55){_0x4edfba=_0xcb0b55;_0x5ec25c=0xc8;}else{_0x5ec25c=0xce;}_0x29591b[_0xbd22('0x1b')](_0x5ec25c);return _0x29591b[_0xbd22('0x21')](_0xbd22('0x22'),_0x350106+'-'+_0x4edfba+'/'+_0xcb0b55)[_0xbd22('0x1c')](_0x21c799);}return null;};}function patchUpdates(_0x1a49da){return function(_0x25e6b4){try{jsonpatch['apply'](_0x25e6b4,_0x1a49da,!![]);}catch(_0x5e42e9){return BPromise['reject'](_0x5e42e9);}return _0x25e6b4[_0xbd22('0x23')]();};}function saveUpdates(_0x373968,_0x2365c8){return function(_0x123936){if(_0x123936){return _0x123936['update'](_0x373968)[_0xbd22('0x24')](function(_0x4d6467){return _0x4d6467;});}return null;};}function removeEntity(_0x541098,_0x3b3118){return function(_0x35bce1){if(_0x35bce1){return _0x35bce1[_0xbd22('0x25')]()[_0xbd22('0x24')](function(){var _0x181847=_0x35bce1[_0xbd22('0x26')]({'plain':!![]});var _0x34c911=_0xbd22('0x27');return db['UserProfileResource'][_0xbd22('0x25')]({'where':{'type':_0x34c911,'resourceId':_0x181847['id']}})['then'](function(){return _0x35bce1;});})[_0xbd22('0x24')](function(){_0x541098['status'](0xcc)[_0xbd22('0x28')]();});}};}function handleEntityNotFound(_0x3871d7,_0x36906d){return function(_0xc8dcd7){if(!_0xc8dcd7){_0x3871d7[_0xbd22('0x1a')](0x194);}return _0xc8dcd7;};}function handleError(_0x3a5e75,_0x59e2d2){_0x59e2d2=_0x59e2d2||0x1f4;return function(_0x12a3c8){logger[_0xbd22('0x29')](_0x12a3c8['stack']);if(_0x12a3c8['name']){delete _0x12a3c8[_0xbd22('0x2a')];}_0x3a5e75[_0xbd22('0x1b')](_0x59e2d2)[_0xbd22('0x2b')](_0x12a3c8);};}exports[_0xbd22('0x2c')]=function(_0x4bbf52,_0x4d29bf){var _0xe2f363={},_0x475c32={},_0x22d7fc={'count':0x0,'rows':[]};var _0x309236=_[_0xbd22('0x2d')](db['CannedAnswer']['rawAttributes'],function(_0x315c86){return{'name':_0x315c86['fieldName'],'type':_0x315c86['type'][_0xbd22('0x2e')]};});_0x475c32[_0xbd22('0x2f')]=_[_0xbd22('0x2d')](_0x309236,_0xbd22('0x2a'));_0x475c32[_0xbd22('0x30')]=_[_0xbd22('0x31')](_0x4bbf52[_0xbd22('0x30')]);_0x475c32['filters']=_[_0xbd22('0x32')](_0x475c32['model'],_0x475c32[_0xbd22('0x30')]);_0xe2f363[_0xbd22('0x33')]=_[_0xbd22('0x32')](_0x475c32[_0xbd22('0x2f')],qs[_0xbd22('0x34')](_0x4bbf52[_0xbd22('0x30')][_0xbd22('0x34')]));_0xe2f363[_0xbd22('0x33')]=_0xe2f363[_0xbd22('0x33')][_0xbd22('0x35')]?_0xe2f363[_0xbd22('0x33')]:_0x475c32[_0xbd22('0x2f')];if(!_0x4bbf52['query'][_0xbd22('0x36')](_0xbd22('0x37'))){_0xe2f363[_0xbd22('0x1e')]=qs[_0xbd22('0x1e')](_0x4bbf52[_0xbd22('0x30')][_0xbd22('0x1e')]);_0xe2f363[_0xbd22('0x20')]=qs[_0xbd22('0x20')](_0x4bbf52[_0xbd22('0x30')]['offset']);}_0xe2f363['order']=qs[_0xbd22('0x38')](_0x4bbf52[_0xbd22('0x30')]['sort']);_0xe2f363[_0xbd22('0x39')]=qs[_0xbd22('0x3a')](_[_0xbd22('0x3b')](_0x4bbf52[_0xbd22('0x30')],_0x475c32['filters']),_0x309236);if(_0x4bbf52[_0xbd22('0x30')][_0xbd22('0x3c')]){_0xe2f363[_0xbd22('0x39')]=_[_0xbd22('0x3d')](_0xe2f363[_0xbd22('0x39')],{'$or':[{'key':{'$like':'%'+_0x4bbf52[_0xbd22('0x30')]['filter']+'%'}},{'value':{'$like':'%'+_0x4bbf52['query']['filter']+'%'}}]});}_0xe2f363=_[_0xbd22('0x3d')]({},_0xe2f363,_0x4bbf52[_0xbd22('0x3e')]);var _0x36d2b3={'where':_0xe2f363['where']};return db['CannedAnswer'][_0xbd22('0x1f')](_0x36d2b3)['then'](function(_0x2d0d9b){_0x22d7fc['count']=_0x2d0d9b;if(_0x4bbf52['query']['includeAll']){_0xe2f363[_0xbd22('0x3f')]=[{'all':!![]}];}return db[_0xbd22('0x40')]['findAll'](_0xe2f363);})['then'](function(_0x57fef0){_0x22d7fc[_0xbd22('0x41')]=_0x57fef0;return _0x22d7fc;})[_0xbd22('0x24')](respondWithFilteredResult(_0x4d29bf,_0xe2f363))['catch'](handleError(_0x4d29bf,null));};exports[_0xbd22('0x42')]=function(_0x17c8a4,_0x2f7e44){var _0x4b1e27={'raw':!![],'where':{'id':_0x17c8a4['params']['id']}},_0x1f91c4={};_0x1f91c4[_0xbd22('0x2f')]=_[_0xbd22('0x31')](db[_0xbd22('0x40')][_0xbd22('0x43')]);_0x1f91c4[_0xbd22('0x30')]=_[_0xbd22('0x31')](_0x17c8a4['query']);_0x1f91c4[_0xbd22('0x3a')]=_[_0xbd22('0x32')](_0x1f91c4[_0xbd22('0x2f')],_0x1f91c4[_0xbd22('0x30')]);_0x4b1e27[_0xbd22('0x33')]=_[_0xbd22('0x32')](_0x1f91c4[_0xbd22('0x2f')],qs[_0xbd22('0x34')](_0x17c8a4[_0xbd22('0x30')]['fields']));_0x4b1e27[_0xbd22('0x33')]=_0x4b1e27['attributes'][_0xbd22('0x35')]?_0x4b1e27[_0xbd22('0x33')]:_0x1f91c4[_0xbd22('0x2f')];if(_0x17c8a4[_0xbd22('0x30')][_0xbd22('0x44')]){_0x4b1e27[_0xbd22('0x3f')]=[{'all':!![]}];}_0x4b1e27=_[_0xbd22('0x3d')]({},_0x4b1e27,_0x17c8a4[_0xbd22('0x3e')]);return db['CannedAnswer'][_0xbd22('0x45')](_0x4b1e27)[_0xbd22('0x24')](handleEntityNotFound(_0x2f7e44,null))[_0xbd22('0x24')](respondWithResult(_0x2f7e44,null))[_0xbd22('0x46')](handleError(_0x2f7e44,null));};exports[_0xbd22('0x47')]=function(_0x375132,_0x6d897b){if(_0x375132[_0xbd22('0x48')]['id']){delete _0x375132[_0xbd22('0x48')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x375132[_0xbd22('0x49')]['id']}})['then'](handleEntityNotFound(_0x6d897b,null))['then'](saveUpdates(_0x375132[_0xbd22('0x48')],null))[_0xbd22('0x24')](respondWithResult(_0x6d897b,null))[_0xbd22('0x46')](handleError(_0x6d897b,null));};exports[_0xbd22('0x25')]=function(_0x3a5c8c,_0x3a996d){return db[_0xbd22('0x40')][_0xbd22('0x45')]({'where':{'id':_0x3a5c8c['params']['id']}})[_0xbd22('0x24')](handleEntityNotFound(_0x3a996d,null))[_0xbd22('0x24')](removeEntity(_0x3a996d,null))[_0xbd22('0x46')](handleError(_0x3a996d,null));};exports['create']=function(_0x14a7b4,_0x480d84){var _0x1eb49c={'key':_0x14a7b4[_0xbd22('0x48')]['key']};if(_0x14a7b4[_0xbd22('0x48')][_0xbd22('0x4a')]){_0x1eb49c[_0xbd22('0x4a')]=_0x14a7b4[_0xbd22('0x48')][_0xbd22('0x4a')];}else if(_0x14a7b4[_0xbd22('0x48')][_0xbd22('0x4b')]){_0x1eb49c[_0xbd22('0x4b')]=_0x14a7b4['body']['SmsAccountId'];}else if(_0x14a7b4['body'][_0xbd22('0x4c')]){_0x1eb49c['OpenchannelAccountId']=_0x14a7b4[_0xbd22('0x48')][_0xbd22('0x4c')];}else if(_0x14a7b4[_0xbd22('0x48')][_0xbd22('0x4d')]){_0x1eb49c[_0xbd22('0x4d')]=_0x14a7b4[_0xbd22('0x48')][_0xbd22('0x4d')];}return db[_0xbd22('0x40')]['find']({'where':_0x1eb49c})[_0xbd22('0x24')](function(_0x332372){if(_0x332372){throw new db['Sequelize']['ValidationError'](_0xbd22('0x4e'));}return db[_0xbd22('0x40')][_0xbd22('0x4f')](_0x14a7b4[_0xbd22('0x48')]);})[_0xbd22('0x24')](function(_0x461552){var _0x1498f9=_0x14a7b4[_0xbd22('0x50')][_0xbd22('0x26')]({'plain':!![]});if(!_0x1498f9)throw new Error(_0xbd22('0x51'));if(_0x1498f9[_0xbd22('0x52')]===_0xbd22('0x50')){var _0x43feb2=_0x461552[_0xbd22('0x26')]({'plain':!![]});return db[_0xbd22('0x53')][_0xbd22('0x45')]({'where':{'name':'CannedAnswers','userProfileId':_0x1498f9[_0xbd22('0x54')]},'raw':!![]})['then'](function(_0x1cd209){if(_0x1cd209&&_0x1cd209['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x43feb2[_0xbd22('0x2a')],'resourceId':_0x43feb2['id'],'type':_0x1cd209[_0xbd22('0x2a')],'sectionId':_0x1cd209['id']},{})[_0xbd22('0x24')](function(){return _0x461552;});}else{return _0x461552;}})[_0xbd22('0x46')](function(_0xd31ee4){logger[_0xbd22('0x29')](_0xbd22('0x55'),_0xd31ee4);throw _0xd31ee4;});}return _0x461552;})[_0xbd22('0x24')](respondWithResult(_0x480d84,0xc9))[_0xbd22('0x46')](handleError(_0x480d84,null));};
\ No newline at end of file
index dcd690c..ad4b43e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbafb=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci'];(function(_0x55bd12,_0x3ccb52){var _0x1941dd=function(_0x22fa61){while(--_0x22fa61){_0x55bd12['push'](_0x55bd12['shift']());}};_0x1941dd(++_0x3ccb52);}(_0xbafb,0xf0));var _0xbbaf=function(_0x237610,_0x2955a6){_0x237610=_0x237610-0x0;var _0xfb9744=_0xbafb[_0x237610];return _0xfb9744;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xbbaf('0x0'));var moment=require(_0xbbaf('0x1'));var BPromise=require(_0xbbaf('0x2'));var rp=require(_0xbbaf('0x3'));var fs=require('fs');var path=require(_0xbbaf('0x4'));var rimraf=require(_0xbbaf('0x5'));var config=require(_0xbbaf('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0xbbaf('0x7')]=function(_0x54760c,_0x25f0ba){return _0x54760c[_0xbbaf('0x8')](_0xbbaf('0x9'),attributes,{'tableName':_0xbbaf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xbbaf('0xb')});};
\ No newline at end of file
+var _0x9997=['request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird'];(function(_0x167f6e,_0x534613){var _0x2bf5e6=function(_0x1435f3){while(--_0x1435f3){_0x167f6e['push'](_0x167f6e['shift']());}};_0x2bf5e6(++_0x534613);}(_0x9997,0xf8));var _0x7999=function(_0x52ea08,_0x15d935){_0x52ea08=_0x52ea08-0x0;var _0x28d546=_0x9997[_0x52ea08];return _0x28d546;};'use strict';var _=require('lodash');var util=require(_0x7999('0x0'));var logger=require(_0x7999('0x1'))(_0x7999('0x2'));var moment=require('moment');var BPromise=require(_0x7999('0x3'));var rp=require(_0x7999('0x4'));var fs=require('fs');var path=require(_0x7999('0x5'));var rimraf=require(_0x7999('0x6'));var config=require(_0x7999('0x7'));var attributes=require(_0x7999('0x8'));module[_0x7999('0x9')]=function(_0x4d80f1,_0x118c5a){return _0x4d80f1['define'](_0x7999('0xa'),attributes,{'tableName':_0x7999('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7999('0xc'),'collate':_0x7999('0xd')});};
\ No newline at end of file
index 34e6dc6..b71957a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5f248,_0x33b1ed){var _0x2c7486=function(_0x3fd619){while(--_0x3fd619){_0x5f248['push'](_0x5f248['shift']());}};_0x2c7486(++_0x33b1ed);}(_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 Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x40867c,_0x3aa861){var _0x201b20=function(_0x8d092d){while(--_0x8d092d){_0x40867c['push'](_0x40867c['shift']());}};_0x201b20(++_0x3aa861);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
index 2b72b3a..3b13f0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcecf=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x55d911,_0x2b768c){var _0x3104c2=function(_0x1b4386){while(--_0x1b4386){_0x55d911['push'](_0x55d911['shift']());}};_0x3104c2(++_0x2b768c);}(_0xcecf,0x12f));var _0xfcec=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xcecf[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0xfcec('0x0'));var util=require(_0xfcec('0x1'));var path=require(_0xfcec('0x2'));var timeout=require(_0xfcec('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfcec('0x4'));var auth=require(_0xfcec('0x5'));var interaction=require(_0xfcec('0x6'));var config=require(_0xfcec('0x7'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xfcec('0x8')](),controller[_0xfcec('0x9')]);router[_0xfcec('0xa')]('/:id',auth[_0xfcec('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xfcec('0xb')](_0xfcec('0xc'),auth[_0xfcec('0x8')](),controller[_0xfcec('0xd')]);router[_0xfcec('0xe')]('/:id',auth[_0xfcec('0x8')](),controller[_0xfcec('0xf')]);module[_0xfcec('0x10')]=router;
\ No newline at end of file
+var _0xdf7e=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','multer'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xdf7e,0x142));var _0xedf7=function(_0x350e4b,_0x19661a){_0x350e4b=_0x350e4b-0x0;var _0x5955b4=_0xdf7e[_0x350e4b];return _0x5955b4;};'use strict';var multer=require(_0xedf7('0x0'));var util=require(_0xedf7('0x1'));var path=require('path');var timeout=require(_0xedf7('0x2'));var express=require(_0xedf7('0x3'));var router=express[_0xedf7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xedf7('0x5'));var interaction=require(_0xedf7('0x6'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router[_0xedf7('0x7')]('/',auth[_0xedf7('0x8')](),controller[_0xedf7('0x9')]);router[_0xedf7('0x7')](_0xedf7('0xa'),auth[_0xedf7('0x8')](),controller[_0xedf7('0xb')]);router[_0xedf7('0xc')]('/',auth[_0xedf7('0x8')](),controller[_0xedf7('0xd')]);router[_0xedf7('0xe')](_0xedf7('0xa'),auth[_0xedf7('0x8')](),controller[_0xedf7('0xf')]);router['delete'](_0xedf7('0xa'),auth['isAuthenticated'](),controller[_0xedf7('0x10')]);module['exports']=router;
\ No newline at end of file
index 18af401..90d1b18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x520e=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x15942a,_0x13b58c){var _0x36a9fb=function(_0x549c27){while(--_0x549c27){_0x15942a['push'](_0x15942a['shift']());}};_0x36a9fb(++_0x13b58c);}(_0x520e,0x90));var _0xe520=function(_0x3f59b1,_0x25cdbe){_0x3f59b1=_0x3f59b1-0x0;var _0x11d2e8=_0x520e[_0x3f59b1];return _0x11d2e8;};'use strict';var Sequelize=require(_0xe520('0x0'));module[_0xe520('0x1')]={'calldate':{'type':Sequelize[_0xe520('0x2')],'allowNull':![],'defaultValue':_0xe520('0x3')},'clid':{'type':Sequelize[_0xe520('0x4')]},'src':{'type':Sequelize[_0xe520('0x4')]},'dst':{'type':Sequelize[_0xe520('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe520('0x4')]},'dstchannel':{'type':Sequelize[_0xe520('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xe520('0x4')]},'duration':{'type':Sequelize[_0xe520('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe520('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe520('0x4')]},'amaflags':{'type':Sequelize[_0xe520('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe520('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xe520('0x4')]},'linkedid':{'type':Sequelize[_0xe520('0x4')]},'sequence':{'type':Sequelize[_0xe520('0x4')]},'peeraccount':{'type':Sequelize[_0xe520('0x4')]},'type':{'type':Sequelize[_0xe520('0x4')]},'tag':{'type':Sequelize[_0xe520('0x4')]}};
\ No newline at end of file
+var _0x18e0=['STRING','INTEGER','exports','1970-01-01\x2000:00:01'];(function(_0x351406,_0x3310c3){var _0x5af45d=function(_0x1e8c2c){while(--_0x1e8c2c){_0x351406['push'](_0x351406['shift']());}};_0x5af45d(++_0x3310c3);}(_0x18e0,0xa2));var _0x018e=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x18e0[_0x3070dc];return _0x431489;};'use strict';var Sequelize=require('sequelize');module[_0x018e('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x018e('0x1')},'clid':{'type':Sequelize[_0x018e('0x2')]},'src':{'type':Sequelize[_0x018e('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x018e('0x2')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x018e('0x2')]},'lastdata':{'type':Sequelize[_0x018e('0x2')]},'duration':{'type':Sequelize[_0x018e('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x018e('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x018e('0x2')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x018e('0x2')]},'linkedid':{'type':Sequelize[_0x018e('0x2')]},'sequence':{'type':Sequelize[_0x018e('0x2')]},'peeraccount':{'type':Sequelize[_0x018e('0x2')]},'type':{'type':Sequelize[_0x018e('0x2')]},'tag':{'type':Sequelize[_0x018e('0x2')]}};
\ No newline at end of file
index 67fd738..176043d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe015=['type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','params','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','limit','set','Content-Range','json','reject','update','then','destroy','name','send','index','Cdr','rawAttributes'];(function(_0x30abff,_0x5f2c5f){var _0x4c571e=function(_0x43de9a){while(--_0x43de9a){_0x30abff['push'](_0x30abff['shift']());}};_0x4c571e(++_0x5f2c5f);}(_0xe015,0x13b));var _0x5e01=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe015[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x5e01('0x0'));var rimraf=require(_0x5e01('0x1'));var zipdir=require(_0x5e01('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5e01('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5e01('0x4'));var util=require(_0x5e01('0x5'));var path=require(_0x5e01('0x6'));var sox=require(_0x5e01('0x7'));var csv=require('to-csv');var ejs=require(_0x5e01('0x8'));var fs=require('fs');var fs_extra=require(_0x5e01('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5e01('0xa'));var jsforce=require(_0x5e01('0xb'));var deskjs=require(_0x5e01('0xc'));var toCsv=require(_0x5e01('0xd'));var querystring=require(_0x5e01('0xe'));var Papa=require(_0x5e01('0xf'));var Redis=require('ioredis');var authService=require(_0x5e01('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5e01('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e01('0x12'))(_0x5e01('0x13'));var utils=require('../../config/utils');var config=require(_0x5e01('0x14'));var licenseUtil=require(_0x5e01('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x560ae2,_0x3d0b04){_0x3d0b04=_0x3d0b04||0xcc;return function(_0x160f79){if(_0x160f79){return _0x560ae2[_0x5e01('0x16')](_0x3d0b04);}return _0x560ae2[_0x5e01('0x17')](_0x3d0b04)[_0x5e01('0x18')]();};}function respondWithResult(_0x16bc8f,_0x4bd426){_0x4bd426=_0x4bd426||0xc8;return function(_0x36da26){if(_0x36da26){return _0x16bc8f['status'](_0x4bd426)['json'](_0x36da26);}};}function respondWithFilteredResult(_0x1df2e0,_0x2dd70c){return function(_0x494b8a){if(_0x494b8a){var _0x27c6e7=typeof _0x2dd70c['offset']===_0x5e01('0x19')&&typeof _0x2dd70c['limit']===_0x5e01('0x19');var _0x5d85e3=_0x494b8a[_0x5e01('0x1a')];var _0x5eda1d=_0x27c6e7?0x0:_0x2dd70c['offset'];var _0x35a002=_0x27c6e7?_0x494b8a[_0x5e01('0x1a')]:_0x2dd70c['offset']+_0x2dd70c[_0x5e01('0x1b')];var _0x2df752;if(_0x35a002>=_0x5d85e3){_0x35a002=_0x5d85e3;_0x2df752=0xc8;}else{_0x2df752=0xce;}_0x1df2e0[_0x5e01('0x17')](_0x2df752);return _0x1df2e0[_0x5e01('0x1c')](_0x5e01('0x1d'),_0x5eda1d+'-'+_0x35a002+'/'+_0x5d85e3)[_0x5e01('0x1e')](_0x494b8a);}return null;};}function patchUpdates(_0x173410){return function(_0x153eb1){try{jsonpatch['apply'](_0x153eb1,_0x173410,!![]);}catch(_0x150ebf){return BPromise[_0x5e01('0x1f')](_0x150ebf);}return _0x153eb1['save']();};}function saveUpdates(_0xf6fe3f,_0x306cff){return function(_0x337ad2){if(_0x337ad2){return _0x337ad2[_0x5e01('0x20')](_0xf6fe3f)[_0x5e01('0x21')](function(_0x284803){return _0x284803;});}return null;};}function removeEntity(_0x5efff9,_0x329315){return function(_0x720922){if(_0x720922){return _0x720922[_0x5e01('0x22')]()[_0x5e01('0x21')](function(){_0x5efff9['status'](0xcc)[_0x5e01('0x18')]();});}};}function handleEntityNotFound(_0x23264f,_0x31eb7f){return function(_0x4f94d0){if(!_0x4f94d0){_0x23264f[_0x5e01('0x16')](0x194);}return _0x4f94d0;};}function handleError(_0x23454e,_0x12a19a){_0x12a19a=_0x12a19a||0x1f4;return function(_0x28344a){logger['error'](_0x28344a['stack']);if(_0x28344a[_0x5e01('0x23')]){delete _0x28344a['name'];}_0x23454e[_0x5e01('0x17')](_0x12a19a)[_0x5e01('0x24')](_0x28344a);};}exports[_0x5e01('0x25')]=function(_0xc26cf8,_0x592a61){var _0x531f0a={},_0x4a4a9f={},_0x51a98d={'count':0x0,'rows':[]};var _0x350ab4=_['map'](db[_0x5e01('0x26')][_0x5e01('0x27')],function(_0xc6d3c2){return{'name':_0xc6d3c2['fieldName'],'type':_0xc6d3c2[_0x5e01('0x28')][_0x5e01('0x29')]};});_0x4a4a9f[_0x5e01('0x2a')]=_[_0x5e01('0x2b')](_0x350ab4,'name');_0x4a4a9f['query']=_[_0x5e01('0x2c')](_0xc26cf8[_0x5e01('0x2d')]);_0x4a4a9f[_0x5e01('0x2e')]=_[_0x5e01('0x2f')](_0x4a4a9f[_0x5e01('0x2a')],_0x4a4a9f[_0x5e01('0x2d')]);_0x531f0a[_0x5e01('0x30')]=_[_0x5e01('0x2f')](_0x4a4a9f[_0x5e01('0x2a')],qs[_0x5e01('0x31')](_0xc26cf8[_0x5e01('0x2d')][_0x5e01('0x31')]));_0x531f0a['attributes']=_0x531f0a[_0x5e01('0x30')][_0x5e01('0x32')]?_0x531f0a[_0x5e01('0x30')]:_0x4a4a9f['model'];if(!_0xc26cf8[_0x5e01('0x2d')][_0x5e01('0x33')]('nolimit')){_0x531f0a[_0x5e01('0x1b')]=qs[_0x5e01('0x1b')](_0xc26cf8[_0x5e01('0x2d')]['limit']);_0x531f0a[_0x5e01('0x34')]=qs[_0x5e01('0x34')](_0xc26cf8[_0x5e01('0x2d')][_0x5e01('0x34')]);}_0x531f0a[_0x5e01('0x35')]=qs[_0x5e01('0x36')](_0xc26cf8[_0x5e01('0x2d')][_0x5e01('0x36')]);_0x531f0a[_0x5e01('0x37')]=qs[_0x5e01('0x2e')](_[_0x5e01('0x38')](_0xc26cf8[_0x5e01('0x2d')],_0x4a4a9f[_0x5e01('0x2e')]),_0x350ab4);if(_0xc26cf8[_0x5e01('0x2d')][_0x5e01('0x39')]){_0x531f0a['where']=_[_0x5e01('0x3a')](_0x531f0a['where'],{'$or':_['map'](_0x350ab4,function(_0x34e8f5){if(_0x34e8f5[_0x5e01('0x28')]!==_0x5e01('0x3b')){var _0x117fb3={};_0x117fb3[_0x34e8f5[_0x5e01('0x23')]]={'$like':'%'+_0xc26cf8['query'][_0x5e01('0x39')]+'%'};return _0x117fb3;}})});}_0x531f0a=_[_0x5e01('0x3a')]({},_0x531f0a,_0xc26cf8['options']);var _0x3c37d5={'where':_0x531f0a[_0x5e01('0x37')]};return db[_0x5e01('0x26')]['count'](_0x3c37d5)[_0x5e01('0x21')](function(_0xfed2d2){_0x51a98d['count']=_0xfed2d2;if(_0xc26cf8[_0x5e01('0x2d')][_0x5e01('0x3c')]){_0x531f0a['include']=[{'all':!![]}];}return db['Cdr'][_0x5e01('0x3d')](_0x531f0a);})['then'](function(_0x2d7423){_0x51a98d[_0x5e01('0x3e')]=_0x2d7423;return _0x51a98d;})[_0x5e01('0x21')](respondWithFilteredResult(_0x592a61,_0x531f0a))[_0x5e01('0x3f')](handleError(_0x592a61,null));};exports['show']=function(_0x296d33,_0xb93846){var _0x23275f={'raw':!![],'where':{'id':_0x296d33[_0x5e01('0x40')]['id']}},_0x44a5e4={};_0x44a5e4[_0x5e01('0x2a')]=_[_0x5e01('0x2c')](db['Cdr'][_0x5e01('0x27')]);_0x44a5e4[_0x5e01('0x2d')]=_[_0x5e01('0x2c')](_0x296d33[_0x5e01('0x2d')]);_0x44a5e4[_0x5e01('0x2e')]=_['intersection'](_0x44a5e4[_0x5e01('0x2a')],_0x44a5e4[_0x5e01('0x2d')]);_0x23275f[_0x5e01('0x30')]=_[_0x5e01('0x2f')](_0x44a5e4[_0x5e01('0x2a')],qs[_0x5e01('0x31')](_0x296d33[_0x5e01('0x2d')]['fields']));_0x23275f[_0x5e01('0x30')]=_0x23275f['attributes'][_0x5e01('0x32')]?_0x23275f[_0x5e01('0x30')]:_0x44a5e4[_0x5e01('0x2a')];if(_0x296d33[_0x5e01('0x2d')][_0x5e01('0x3c')]){_0x23275f[_0x5e01('0x41')]=[{'all':!![]}];}_0x23275f=_['merge']({},_0x23275f,_0x296d33[_0x5e01('0x42')]);return db['Cdr'][_0x5e01('0x43')](_0x23275f)[_0x5e01('0x21')](handleEntityNotFound(_0xb93846,null))[_0x5e01('0x21')](respondWithResult(_0xb93846,null))[_0x5e01('0x3f')](handleError(_0xb93846,null));};exports[_0x5e01('0x44')]=function(_0x1fbb1f,_0x555204){return db['Cdr'][_0x5e01('0x44')](_0x1fbb1f[_0x5e01('0x45')],{})[_0x5e01('0x21')](respondWithResult(_0x555204,0xc9))[_0x5e01('0x3f')](handleError(_0x555204,null));};exports[_0x5e01('0x20')]=function(_0x389520,_0x661d){if(_0x389520[_0x5e01('0x45')]['id']){delete _0x389520[_0x5e01('0x45')]['id'];}return db[_0x5e01('0x26')][_0x5e01('0x43')]({'where':{'id':_0x389520['params']['id']}})[_0x5e01('0x21')](handleEntityNotFound(_0x661d,null))[_0x5e01('0x21')](saveUpdates(_0x389520[_0x5e01('0x45')],null))['then'](respondWithResult(_0x661d,null))[_0x5e01('0x3f')](handleError(_0x661d,null));};exports[_0x5e01('0x22')]=function(_0x3fd5ac,_0xa8ff1b){return db[_0x5e01('0x26')]['find']({'where':{'id':_0x3fd5ac[_0x5e01('0x40')]['id']}})['then'](handleEntityNotFound(_0xa8ff1b,null))[_0x5e01('0x21')](removeEntity(_0xa8ff1b,null))[_0x5e01('0x3f')](handleError(_0xa8ff1b,null));};exports[_0x5e01('0x46')]=function(_0x4c368c,_0x11b36f){return db[_0x5e01('0x26')][_0x5e01('0x46')]()[_0x5e01('0x21')](respondWithResult(_0x11b36f,null))[_0x5e01('0x3f')](handleError(_0x11b36f,null));};
\ No newline at end of file
+var _0x8c46=['filter','VIRTUAL','merge','options','include','Cdr','rows','catch','includeAll','find','create','body','params','describe','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick'];(function(_0x974739,_0x45ace0){var _0x566a02=function(_0x2d936d){while(--_0x2d936d){_0x974739['push'](_0x974739['shift']());}};_0x566a02(++_0x45ace0);}(_0x8c46,0x171));var _0x68c4=function(_0x4295fd,_0x1f2573){_0x4295fd=_0x4295fd-0x0;var _0x96f34e=_0x8c46[_0x4295fd];return _0x96f34e;};'use strict';var emlformat=require(_0x68c4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x68c4('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x68c4('0x2'));var Mustache=require(_0x68c4('0x3'));var util=require(_0x68c4('0x4'));var path=require(_0x68c4('0x5'));var sox=require(_0x68c4('0x6'));var csv=require(_0x68c4('0x7'));var ejs=require(_0x68c4('0x8'));var fs=require('fs');var fs_extra=require(_0x68c4('0x9'));var _=require(_0x68c4('0xa'));var squel=require(_0x68c4('0xb'));var crypto=require('crypto');var jsforce=require(_0x68c4('0xc'));var deskjs=require(_0x68c4('0xd'));var toCsv=require(_0x68c4('0x7'));var querystring=require('querystring');var Papa=require(_0x68c4('0xe'));var Redis=require(_0x68c4('0xf'));var authService=require(_0x68c4('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x68c4('0x11'));var logger=require(_0x68c4('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x68c4('0x13'));var licenseUtil=require(_0x68c4('0x14'));var db=require(_0x68c4('0x15'))['db'];function respondWithStatusCode(_0x48783b,_0x3a432a){_0x3a432a=_0x3a432a||0xcc;return function(_0x1f5f42){if(_0x1f5f42){return _0x48783b[_0x68c4('0x16')](_0x3a432a);}return _0x48783b['status'](_0x3a432a)[_0x68c4('0x17')]();};}function respondWithResult(_0x14919c,_0x5e1341){_0x5e1341=_0x5e1341||0xc8;return function(_0x52f031){if(_0x52f031){return _0x14919c[_0x68c4('0x18')](_0x5e1341)[_0x68c4('0x19')](_0x52f031);}};}function respondWithFilteredResult(_0x5be0de,_0xc25f7b){return function(_0x4ea2a4){if(_0x4ea2a4){var _0x1a7045=typeof _0xc25f7b['offset']==='undefined'&&typeof _0xc25f7b[_0x68c4('0x1a')]===_0x68c4('0x1b');var _0x4f4797=_0x4ea2a4[_0x68c4('0x1c')];var _0x1d757c=_0x1a7045?0x0:_0xc25f7b[_0x68c4('0x1d')];var _0x33c5c5=_0x1a7045?_0x4ea2a4[_0x68c4('0x1c')]:_0xc25f7b[_0x68c4('0x1d')]+_0xc25f7b[_0x68c4('0x1a')];var _0x415ef2;if(_0x33c5c5>=_0x4f4797){_0x33c5c5=_0x4f4797;_0x415ef2=0xc8;}else{_0x415ef2=0xce;}_0x5be0de[_0x68c4('0x18')](_0x415ef2);return _0x5be0de[_0x68c4('0x1e')](_0x68c4('0x1f'),_0x1d757c+'-'+_0x33c5c5+'/'+_0x4f4797)['json'](_0x4ea2a4);}return null;};}function patchUpdates(_0x398a71){return function(_0x4edf9f){try{jsonpatch['apply'](_0x4edf9f,_0x398a71,!![]);}catch(_0x34d3a6){return BPromise[_0x68c4('0x20')](_0x34d3a6);}return _0x4edf9f[_0x68c4('0x21')]();};}function saveUpdates(_0x42f0bc,_0x5b8135){return function(_0x35e865){if(_0x35e865){return _0x35e865[_0x68c4('0x22')](_0x42f0bc)['then'](function(_0x201742){return _0x201742;});}return null;};}function removeEntity(_0x392ccf,_0x45f9be){return function(_0x10278e){if(_0x10278e){return _0x10278e[_0x68c4('0x23')]()[_0x68c4('0x24')](function(){_0x392ccf[_0x68c4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ff4a5,_0x55355d){return function(_0xf16a78){if(!_0xf16a78){_0x2ff4a5[_0x68c4('0x16')](0x194);}return _0xf16a78;};}function handleError(_0x57f32,_0x4f9d32){_0x4f9d32=_0x4f9d32||0x1f4;return function(_0x1e14db){logger[_0x68c4('0x25')](_0x1e14db[_0x68c4('0x26')]);if(_0x1e14db[_0x68c4('0x27')]){delete _0x1e14db[_0x68c4('0x27')];}_0x57f32[_0x68c4('0x18')](_0x4f9d32)[_0x68c4('0x28')](_0x1e14db);};}exports['index']=function(_0x26d56b,_0x4b4634){var _0x3772b3={},_0x1442ba={},_0x56ed70={'count':0x0,'rows':[]};var _0x2847d1=_[_0x68c4('0x29')](db['Cdr'][_0x68c4('0x2a')],function(_0x3a1b69){return{'name':_0x3a1b69[_0x68c4('0x2b')],'type':_0x3a1b69[_0x68c4('0x2c')][_0x68c4('0x2d')]};});_0x1442ba[_0x68c4('0x2e')]=_[_0x68c4('0x29')](_0x2847d1,_0x68c4('0x27'));_0x1442ba[_0x68c4('0x2f')]=_[_0x68c4('0x30')](_0x26d56b[_0x68c4('0x2f')]);_0x1442ba[_0x68c4('0x31')]=_[_0x68c4('0x32')](_0x1442ba[_0x68c4('0x2e')],_0x1442ba[_0x68c4('0x2f')]);_0x3772b3[_0x68c4('0x33')]=_[_0x68c4('0x32')](_0x1442ba[_0x68c4('0x2e')],qs['fields'](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x34')]));_0x3772b3[_0x68c4('0x33')]=_0x3772b3[_0x68c4('0x33')][_0x68c4('0x35')]?_0x3772b3['attributes']:_0x1442ba[_0x68c4('0x2e')];if(!_0x26d56b['query']['hasOwnProperty']('nolimit')){_0x3772b3[_0x68c4('0x1a')]=qs[_0x68c4('0x1a')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x1a')]);_0x3772b3['offset']=qs[_0x68c4('0x1d')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x1d')]);}_0x3772b3['order']=qs[_0x68c4('0x36')](_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x36')]);_0x3772b3[_0x68c4('0x37')]=qs[_0x68c4('0x31')](_[_0x68c4('0x38')](_0x26d56b[_0x68c4('0x2f')],_0x1442ba[_0x68c4('0x31')]),_0x2847d1);if(_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x39')]){_0x3772b3['where']=_['merge'](_0x3772b3[_0x68c4('0x37')],{'$or':_[_0x68c4('0x29')](_0x2847d1,function(_0x460e11){if(_0x460e11[_0x68c4('0x2c')]!==_0x68c4('0x3a')){var _0x13386d={};_0x13386d[_0x460e11[_0x68c4('0x27')]]={'$like':'%'+_0x26d56b[_0x68c4('0x2f')][_0x68c4('0x39')]+'%'};return _0x13386d;}})});}_0x3772b3=_[_0x68c4('0x3b')]({},_0x3772b3,_0x26d56b[_0x68c4('0x3c')]);var _0x30a1cd={'where':_0x3772b3[_0x68c4('0x37')]};return db['Cdr']['count'](_0x30a1cd)[_0x68c4('0x24')](function(_0x2785b4){_0x56ed70[_0x68c4('0x1c')]=_0x2785b4;if(_0x26d56b[_0x68c4('0x2f')]['includeAll']){_0x3772b3[_0x68c4('0x3d')]=[{'all':!![]}];}return db[_0x68c4('0x3e')]['findAll'](_0x3772b3);})['then'](function(_0x4c564a){_0x56ed70[_0x68c4('0x3f')]=_0x4c564a;return _0x56ed70;})['then'](respondWithFilteredResult(_0x4b4634,_0x3772b3))[_0x68c4('0x40')](handleError(_0x4b4634,null));};exports['show']=function(_0x18da6f,_0x2406b1){var _0xbd848f={'raw':!![],'where':{'id':_0x18da6f['params']['id']}},_0xefe68d={};_0xefe68d[_0x68c4('0x2e')]=_[_0x68c4('0x30')](db[_0x68c4('0x3e')][_0x68c4('0x2a')]);_0xefe68d['query']=_[_0x68c4('0x30')](_0x18da6f[_0x68c4('0x2f')]);_0xefe68d[_0x68c4('0x31')]=_[_0x68c4('0x32')](_0xefe68d[_0x68c4('0x2e')],_0xefe68d['query']);_0xbd848f['attributes']=_['intersection'](_0xefe68d[_0x68c4('0x2e')],qs[_0x68c4('0x34')](_0x18da6f[_0x68c4('0x2f')][_0x68c4('0x34')]));_0xbd848f['attributes']=_0xbd848f[_0x68c4('0x33')][_0x68c4('0x35')]?_0xbd848f[_0x68c4('0x33')]:_0xefe68d[_0x68c4('0x2e')];if(_0x18da6f[_0x68c4('0x2f')][_0x68c4('0x41')]){_0xbd848f[_0x68c4('0x3d')]=[{'all':!![]}];}_0xbd848f=_[_0x68c4('0x3b')]({},_0xbd848f,_0x18da6f[_0x68c4('0x3c')]);return db[_0x68c4('0x3e')][_0x68c4('0x42')](_0xbd848f)['then'](handleEntityNotFound(_0x2406b1,null))[_0x68c4('0x24')](respondWithResult(_0x2406b1,null))['catch'](handleError(_0x2406b1,null));};exports[_0x68c4('0x43')]=function(_0x44e3c9,_0x463a6b){return db[_0x68c4('0x3e')]['create'](_0x44e3c9[_0x68c4('0x44')],{})['then'](respondWithResult(_0x463a6b,0xc9))[_0x68c4('0x40')](handleError(_0x463a6b,null));};exports[_0x68c4('0x22')]=function(_0x570e25,_0x250941){if(_0x570e25[_0x68c4('0x44')]['id']){delete _0x570e25[_0x68c4('0x44')]['id'];}return db[_0x68c4('0x3e')][_0x68c4('0x42')]({'where':{'id':_0x570e25[_0x68c4('0x45')]['id']}})['then'](handleEntityNotFound(_0x250941,null))[_0x68c4('0x24')](saveUpdates(_0x570e25[_0x68c4('0x44')],null))[_0x68c4('0x24')](respondWithResult(_0x250941,null))[_0x68c4('0x40')](handleError(_0x250941,null));};exports['destroy']=function(_0x40ecf6,_0x19aec2){return db[_0x68c4('0x3e')][_0x68c4('0x42')]({'where':{'id':_0x40ecf6[_0x68c4('0x45')]['id']}})[_0x68c4('0x24')](handleEntityNotFound(_0x19aec2,null))['then'](removeEntity(_0x19aec2,null))[_0x68c4('0x40')](handleError(_0x19aec2,null));};exports[_0x68c4('0x46')]=function(_0x3db854,_0x51db14){return db[_0x68c4('0x3e')][_0x68c4('0x46')]()['then'](respondWithResult(_0x51db14,null))['catch'](handleError(_0x51db14,null));};
\ No newline at end of file
index c27ae6c..c41af2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x1391da,_0x5bf609){var _0x41bff5=function(_0x1157d4){while(--_0x1157d4){_0x1391da['push'](_0x1391da['shift']());}};_0x41bff5(++_0x5bf609);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3c7775,_0x5aa6d8){var _0x525c8a=function(_0x33de4a){while(--_0x33de4a){_0x3c7775['push'](_0x3c7775['shift']());}};_0x525c8a(++_0x5aa6d8);}(_0x7a54,0x106));var _0x47a5=function(_0x891c6c,_0x508728){_0x891c6c=_0x891c6c-0x0;var _0x13007f=_0x7a54[_0x891c6c];return _0x13007f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
index 54d7aed..7566faa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0fa=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','code','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x176d14,_0x3984ea){var _0x89522c=function(_0x3aba48){while(--_0x3aba48){_0x176d14['push'](_0x176d14['shift']());}};_0x89522c(++_0x3984ea);}(_0xf0fa,0x1de));var _0xaf0f=function(_0x24e027,_0x1f16f2){_0x24e027=_0x24e027-0x0;var _0xf6ec3c=_0xf0fa[_0x24e027];return _0xf6ec3c;};'use strict';var _=require(_0xaf0f('0x0'));var util=require(_0xaf0f('0x1'));var moment=require(_0xaf0f('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf0f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaf0f('0x4'))['db'];var utils=require(_0xaf0f('0x5'));var logger=require(_0xaf0f('0x6'))(_0xaf0f('0x7'));var config=require(_0xaf0f('0x8'));var jayson=require(_0xaf0f('0x9'));var client=jayson[_0xaf0f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fd62a,_0x52c53f,_0xe5fe50){return new BPromise(function(_0x56f5f1,_0x584b2e){return client[_0xaf0f('0xb')](_0x2fd62a,_0xe5fe50)[_0xaf0f('0xc')](function(_0x8b69cf){logger[_0xaf0f('0xd')]('Cdr,\x20%s,\x20%s',_0x52c53f,_0xaf0f('0xe'));logger['debug'](_0xaf0f('0xf'),_0x52c53f,'request\x20sent',JSON['stringify'](_0x8b69cf));if(_0x8b69cf[_0xaf0f('0x10')]){if(_0x8b69cf[_0xaf0f('0x10')][_0xaf0f('0x11')]===0x1f4){logger['error'](_0xaf0f('0x12'),_0x52c53f,_0x8b69cf[_0xaf0f('0x10')][_0xaf0f('0x13')]);return _0x584b2e(_0x8b69cf[_0xaf0f('0x10')][_0xaf0f('0x13')]);}logger[_0xaf0f('0x10')](_0xaf0f('0x12'),_0x52c53f,_0x8b69cf['error'][_0xaf0f('0x13')]);return _0x56f5f1(_0x8b69cf[_0xaf0f('0x10')][_0xaf0f('0x13')]);}else{logger[_0xaf0f('0xd')](_0xaf0f('0x12'),_0x52c53f,_0xaf0f('0xe'));_0x56f5f1(_0x8b69cf[_0xaf0f('0x14')][_0xaf0f('0x13')]);}})[_0xaf0f('0x15')](function(_0x6ca010){logger[_0xaf0f('0x10')]('Cdr,\x20%s,\x20%s',_0x52c53f,_0x6ca010);_0x584b2e(_0x6ca010);});});}
\ No newline at end of file
+var _0xb534=['../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x2c20ef,_0x1611d8){var _0x15b51a=function(_0xef02fd){while(--_0xef02fd){_0x2c20ef['push'](_0x2c20ef['shift']());}};_0x15b51a(++_0x1611d8);}(_0xb534,0x19e));var _0x4b53=function(_0x41c037,_0x3c36c8){_0x41c037=_0x41c037-0x0;var _0x3e32f0=_0xb534[_0x41c037];return _0x3e32f0;};'use strict';var _=require(_0x4b53('0x0'));var util=require(_0x4b53('0x1'));var moment=require('moment');var BPromise=require(_0x4b53('0x2'));var rs=require(_0x4b53('0x3'));var fs=require('fs');var Redis=require(_0x4b53('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4b53('0x5'))('rpc');var config=require(_0x4b53('0x6'));var jayson=require(_0x4b53('0x7'));var client=jayson[_0x4b53('0x8')][_0x4b53('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ea697,_0x454024,_0x2adc07){return new BPromise(function(_0x278f85,_0x2082a8){return client[_0x4b53('0xa')](_0x5ea697,_0x2adc07)[_0x4b53('0xb')](function(_0x1b56da){logger[_0x4b53('0xc')](_0x4b53('0xd'),_0x454024,_0x4b53('0xe'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x454024,_0x4b53('0xe'),JSON[_0x4b53('0xf')](_0x1b56da));if(_0x1b56da[_0x4b53('0x10')]){if(_0x1b56da[_0x4b53('0x10')][_0x4b53('0x11')]===0x1f4){logger[_0x4b53('0x10')](_0x4b53('0xd'),_0x454024,_0x1b56da[_0x4b53('0x10')][_0x4b53('0x12')]);return _0x2082a8(_0x1b56da[_0x4b53('0x10')][_0x4b53('0x12')]);}logger[_0x4b53('0x10')](_0x4b53('0xd'),_0x454024,_0x1b56da[_0x4b53('0x10')]['message']);return _0x278f85(_0x1b56da[_0x4b53('0x10')][_0x4b53('0x12')]);}else{logger[_0x4b53('0xc')]('Cdr,\x20%s,\x20%s',_0x454024,'request\x20sent');_0x278f85(_0x1b56da[_0x4b53('0x13')]['message']);}})[_0x4b53('0x14')](function(_0x3065a0){logger['error'](_0x4b53('0xd'),_0x454024,_0x3065a0);_0x2082a8(_0x3065a0);});});}
\ No newline at end of file
index 870f929..3d64a2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x56ba92,_0xb3c986){var _0x8fe94d=function(_0x23b21c){while(--_0x23b21c){_0x56ba92['push'](_0x56ba92['shift']());}};_0x8fe94d(++_0xb3c986);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
index 364ff06..ca5adea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38d5=['noop','*,*,*,*','sequelize','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x38d5,0xda));var _0x538d=function(_0x251b9d,_0x2932b1){_0x251b9d=_0x251b9d-0x0;var _0x2ffcd3=_0x38d5[_0x251b9d];return _0x2ffcd3;};'use strict';var Sequelize=require(_0x538d('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x538d('0x1')],'allowNull':![],'defaultValue':_0x538d('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x538d('0x1')]},'interval':{'type':Sequelize[_0x538d('0x1')],'defaultValue':_0x538d('0x3')}};
\ No newline at end of file
+var _0x40b6=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x4acbe8,_0x1f340f){var _0x1562d4=function(_0x3f7d72){while(--_0x3f7d72){_0x4acbe8['push'](_0x4acbe8['shift']());}};_0x1562d4(++_0x1f340f);}(_0x40b6,0x7b));var _0x640b=function(_0x313df3,_0x4fca45){_0x313df3=_0x313df3-0x0;var _0x241d59=_0x40b6[_0x313df3];return _0x241d59;};'use strict';var Sequelize=require(_0x640b('0x0'));module[_0x640b('0x1')]={'priority':{'type':Sequelize[_0x640b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x640b('0x3')],'allowNull':![],'defaultValue':_0x640b('0x4')},'appdata':{'type':Sequelize[_0x640b('0x5')]()},'description':{'type':Sequelize[_0x640b('0x3')]},'interval':{'type':Sequelize[_0x640b('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index c88f9d1..f4902e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f3c=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','show','params','ChatApplication','rawAttributes','keys','query','filters','intersection','attributes','model','fields','length','includeAll','options','find','catch','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api'];(function(_0x4fa9fe,_0x14c353){var _0x558d00=function(_0x361b85){while(--_0x361b85){_0x4fa9fe['push'](_0x4fa9fe['shift']());}};_0x558d00(++_0x14c353);}(_0x4f3c,0x15d));var _0xc4f3=function(_0x3438cf,_0x73b174){_0x3438cf=_0x3438cf-0x0;var _0x278698=_0x4f3c[_0x3438cf];return _0x278698;};'use strict';var emlformat=require(_0xc4f3('0x0'));var rimraf=require(_0xc4f3('0x1'));var zipdir=require(_0xc4f3('0x2'));var jsonpatch=require(_0xc4f3('0x3'));var rp=require(_0xc4f3('0x4'));var moment=require(_0xc4f3('0x5'));var BPromise=require(_0xc4f3('0x6'));var Mustache=require(_0xc4f3('0x7'));var util=require(_0xc4f3('0x8'));var path=require(_0xc4f3('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc4f3('0xa'));var fs=require('fs');var fs_extra=require(_0xc4f3('0xb'));var _=require(_0xc4f3('0xc'));var squel=require(_0xc4f3('0xd'));var crypto=require(_0xc4f3('0xe'));var jsforce=require(_0xc4f3('0xf'));var deskjs=require(_0xc4f3('0x10'));var toCsv=require(_0xc4f3('0x11'));var querystring=require(_0xc4f3('0x12'));var Papa=require(_0xc4f3('0x13'));var Redis=require('ioredis');var authService=require(_0xc4f3('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc4f3('0x15'));var logger=require('../../config/logger')(_0xc4f3('0x16'));var utils=require(_0xc4f3('0x17'));var config=require(_0xc4f3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc4f3('0x19'))['db'];function respondWithStatusCode(_0x4e869e,_0x498374){_0x498374=_0x498374||0xcc;return function(_0x4d1c74){if(_0x4d1c74){return _0x4e869e[_0xc4f3('0x1a')](_0x498374);}return _0x4e869e[_0xc4f3('0x1b')](_0x498374)[_0xc4f3('0x1c')]();};}function respondWithResult(_0x3ffd95,_0x53e5c4){_0x53e5c4=_0x53e5c4||0xc8;return function(_0x12981d){if(_0x12981d){return _0x3ffd95[_0xc4f3('0x1b')](_0x53e5c4)[_0xc4f3('0x1d')](_0x12981d);}};}function respondWithFilteredResult(_0x47814f,_0x5583fa){return function(_0x927b26){if(_0x927b26){var _0x3a4ff3=typeof _0x5583fa['offset']===_0xc4f3('0x1e')&&typeof _0x5583fa[_0xc4f3('0x1f')]===_0xc4f3('0x1e');var _0x53b0b6=_0x927b26['count'];var _0xbc5595=_0x3a4ff3?0x0:_0x5583fa[_0xc4f3('0x20')];var _0x1dc5a8=_0x3a4ff3?_0x927b26[_0xc4f3('0x21')]:_0x5583fa['offset']+_0x5583fa[_0xc4f3('0x1f')];var _0x41e2bd;if(_0x1dc5a8>=_0x53b0b6){_0x1dc5a8=_0x53b0b6;_0x41e2bd=0xc8;}else{_0x41e2bd=0xce;}_0x47814f[_0xc4f3('0x1b')](_0x41e2bd);return _0x47814f[_0xc4f3('0x22')](_0xc4f3('0x23'),_0xbc5595+'-'+_0x1dc5a8+'/'+_0x53b0b6)[_0xc4f3('0x1d')](_0x927b26);}return null;};}function patchUpdates(_0x35111f){return function(_0x2bacbc){try{jsonpatch[_0xc4f3('0x24')](_0x2bacbc,_0x35111f,!![]);}catch(_0x16e4e7){return BPromise[_0xc4f3('0x25')](_0x16e4e7);}return _0x2bacbc['save']();};}function saveUpdates(_0x27f7e1,_0xb9b864){return function(_0x4b19a3){if(_0x4b19a3){return _0x4b19a3['update'](_0x27f7e1)[_0xc4f3('0x26')](function(_0x154729){return _0x154729;});}return null;};}function removeEntity(_0x561ea3,_0x5b3ac3){return function(_0x1f04a7){if(_0x1f04a7){return _0x1f04a7[_0xc4f3('0x27')]()[_0xc4f3('0x26')](function(){_0x561ea3['status'](0xcc)[_0xc4f3('0x1c')]();});}};}function handleEntityNotFound(_0x460ee7,_0x8a828e){return function(_0x11ea96){if(!_0x11ea96){_0x460ee7['sendStatus'](0x194);}return _0x11ea96;};}function handleError(_0x378194,_0x46f5c6){_0x46f5c6=_0x46f5c6||0x1f4;return function(_0x26c737){logger[_0xc4f3('0x28')](_0x26c737[_0xc4f3('0x29')]);if(_0x26c737[_0xc4f3('0x2a')]){delete _0x26c737[_0xc4f3('0x2a')];}_0x378194['status'](_0x46f5c6)[_0xc4f3('0x2b')](_0x26c737);};}exports[_0xc4f3('0x2c')]=function(_0x7e4227,_0x4125be){var _0x5aa950={'raw':!![],'where':{'id':_0x7e4227[_0xc4f3('0x2d')]['id']}},_0x2731a5={};_0x2731a5['model']=_['keys'](db[_0xc4f3('0x2e')][_0xc4f3('0x2f')]);_0x2731a5['query']=_[_0xc4f3('0x30')](_0x7e4227[_0xc4f3('0x31')]);_0x2731a5[_0xc4f3('0x32')]=_[_0xc4f3('0x33')](_0x2731a5['model'],_0x2731a5[_0xc4f3('0x31')]);_0x5aa950[_0xc4f3('0x34')]=_[_0xc4f3('0x33')](_0x2731a5[_0xc4f3('0x35')],qs[_0xc4f3('0x36')](_0x7e4227[_0xc4f3('0x31')][_0xc4f3('0x36')]));_0x5aa950['attributes']=_0x5aa950[_0xc4f3('0x34')][_0xc4f3('0x37')]?_0x5aa950['attributes']:_0x2731a5[_0xc4f3('0x35')];if(_0x7e4227[_0xc4f3('0x31')][_0xc4f3('0x38')]){_0x5aa950['include']=[{'all':!![]}];}_0x5aa950=_['merge']({},_0x5aa950,_0x7e4227[_0xc4f3('0x39')]);return db[_0xc4f3('0x2e')][_0xc4f3('0x3a')](_0x5aa950)[_0xc4f3('0x26')](handleEntityNotFound(_0x4125be,null))[_0xc4f3('0x26')](respondWithResult(_0x4125be,null))[_0xc4f3('0x3b')](handleError(_0x4125be,null));};exports[_0xc4f3('0x3c')]=function(_0xcd9767,_0x46f897){if(_0xcd9767[_0xc4f3('0x3d')]['id']){delete _0xcd9767[_0xc4f3('0x3d')]['id'];}return db[_0xc4f3('0x2e')]['find']({'where':{'id':_0xcd9767['params']['id']}})[_0xc4f3('0x26')](handleEntityNotFound(_0x46f897,null))[_0xc4f3('0x26')](saveUpdates(_0xcd9767[_0xc4f3('0x3d')],null))[_0xc4f3('0x26')](respondWithResult(_0x46f897,null))[_0xc4f3('0x3b')](handleError(_0x46f897,null));};exports[_0xc4f3('0x27')]=function(_0x2d35ae,_0x15456e){return db[_0xc4f3('0x2e')]['find']({'where':{'id':_0x2d35ae[_0xc4f3('0x2d')]['id']}})[_0xc4f3('0x26')](handleEntityNotFound(_0x15456e,null))['then'](removeEntity(_0x15456e,null))['catch'](handleError(_0x15456e,null));};
\ No newline at end of file
+var _0x4345=['rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','error','stack','name','show','model','keys','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','options','ChatApplication','find','then','catch','body','params','eml-format'];(function(_0x341aca,_0x265689){var _0x265000=function(_0x3630ea){while(--_0x3630ea){_0x341aca['push'](_0x341aca['shift']());}};_0x265000(++_0x265689);}(_0x4345,0x77));var _0x5434=function(_0x2864f9,_0x53903d){_0x2864f9=_0x2864f9-0x0;var _0x4903e7=_0x4345[_0x2864f9];return _0x4903e7;};'use strict';var emlformat=require(_0x5434('0x0'));var rimraf=require(_0x5434('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5434('0x2'));var rp=require(_0x5434('0x3'));var moment=require(_0x5434('0x4'));var BPromise=require(_0x5434('0x5'));var Mustache=require('mustache');var util=require(_0x5434('0x6'));var path=require('path');var sox=require(_0x5434('0x7'));var csv=require(_0x5434('0x8'));var ejs=require(_0x5434('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5434('0xa'));var squel=require('squel');var crypto=require(_0x5434('0xb'));var jsforce=require(_0x5434('0xc'));var deskjs=require(_0x5434('0xd'));var toCsv=require(_0x5434('0x8'));var querystring=require(_0x5434('0xe'));var Papa=require(_0x5434('0xf'));var Redis=require(_0x5434('0x10'));var authService=require(_0x5434('0x11'));var qs=require(_0x5434('0x12'));var as=require(_0x5434('0x13'));var hardwareService=require(_0x5434('0x14'));var logger=require(_0x5434('0x15'))(_0x5434('0x16'));var utils=require(_0x5434('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5434('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36a2d9,_0xf27177){_0xf27177=_0xf27177||0xcc;return function(_0x13a13f){if(_0x13a13f){return _0x36a2d9[_0x5434('0x19')](_0xf27177);}return _0x36a2d9['status'](_0xf27177)[_0x5434('0x1a')]();};}function respondWithResult(_0x223766,_0x5aa606){_0x5aa606=_0x5aa606||0xc8;return function(_0x44ea26){if(_0x44ea26){return _0x223766[_0x5434('0x1b')](_0x5aa606)[_0x5434('0x1c')](_0x44ea26);}};}function respondWithFilteredResult(_0x1a7a2c,_0x48be48){return function(_0x2b88c4){if(_0x2b88c4){var _0x437664=typeof _0x48be48['offset']===_0x5434('0x1d')&&typeof _0x48be48['limit']===_0x5434('0x1d');var _0x42a118=_0x2b88c4[_0x5434('0x1e')];var _0x148b3c=_0x437664?0x0:_0x48be48[_0x5434('0x1f')];var _0x2d60be=_0x437664?_0x2b88c4[_0x5434('0x1e')]:_0x48be48['offset']+_0x48be48[_0x5434('0x20')];var _0x5a4570;if(_0x2d60be>=_0x42a118){_0x2d60be=_0x42a118;_0x5a4570=0xc8;}else{_0x5a4570=0xce;}_0x1a7a2c[_0x5434('0x1b')](_0x5a4570);return _0x1a7a2c['set'](_0x5434('0x21'),_0x148b3c+'-'+_0x2d60be+'/'+_0x42a118)[_0x5434('0x1c')](_0x2b88c4);}return null;};}function patchUpdates(_0x240787){return function(_0x4d34d6){try{jsonpatch[_0x5434('0x22')](_0x4d34d6,_0x240787,!![]);}catch(_0x2513e9){return BPromise[_0x5434('0x23')](_0x2513e9);}return _0x4d34d6[_0x5434('0x24')]();};}function saveUpdates(_0x1da16d,_0x5c43ef){return function(_0x5e92d0){if(_0x5e92d0){return _0x5e92d0[_0x5434('0x25')](_0x1da16d)['then'](function(_0x4524f9){return _0x4524f9;});}return null;};}function removeEntity(_0x85a5a1,_0x464093){return function(_0xd83da2){if(_0xd83da2){return _0xd83da2['destroy']()['then'](function(){_0x85a5a1[_0x5434('0x1b')](0xcc)[_0x5434('0x1a')]();});}};}function handleEntityNotFound(_0x27ea93,_0x417dc1){return function(_0x2c8fb1){if(!_0x2c8fb1){_0x27ea93[_0x5434('0x19')](0x194);}return _0x2c8fb1;};}function handleError(_0xaa9184,_0xa0f1b2){_0xa0f1b2=_0xa0f1b2||0x1f4;return function(_0x1b827f){logger[_0x5434('0x26')](_0x1b827f[_0x5434('0x27')]);if(_0x1b827f[_0x5434('0x28')]){delete _0x1b827f['name'];}_0xaa9184['status'](_0xa0f1b2)['send'](_0x1b827f);};}exports[_0x5434('0x29')]=function(_0x124371,_0x4189f9){var _0x1330ff={'raw':!![],'where':{'id':_0x124371['params']['id']}},_0x4598bd={};_0x4598bd[_0x5434('0x2a')]=_[_0x5434('0x2b')](db['ChatApplication'][_0x5434('0x2c')]);_0x4598bd[_0x5434('0x2d')]=_['keys'](_0x124371['query']);_0x4598bd['filters']=_[_0x5434('0x2e')](_0x4598bd[_0x5434('0x2a')],_0x4598bd[_0x5434('0x2d')]);_0x1330ff[_0x5434('0x2f')]=_[_0x5434('0x2e')](_0x4598bd[_0x5434('0x2a')],qs['fields'](_0x124371[_0x5434('0x2d')][_0x5434('0x30')]));_0x1330ff[_0x5434('0x2f')]=_0x1330ff[_0x5434('0x2f')][_0x5434('0x31')]?_0x1330ff[_0x5434('0x2f')]:_0x4598bd[_0x5434('0x2a')];if(_0x124371['query'][_0x5434('0x32')]){_0x1330ff[_0x5434('0x33')]=[{'all':!![]}];}_0x1330ff=_[_0x5434('0x34')]({},_0x1330ff,_0x124371[_0x5434('0x35')]);return db[_0x5434('0x36')][_0x5434('0x37')](_0x1330ff)['then'](handleEntityNotFound(_0x4189f9,null))[_0x5434('0x38')](respondWithResult(_0x4189f9,null))[_0x5434('0x39')](handleError(_0x4189f9,null));};exports[_0x5434('0x25')]=function(_0x168db5,_0x24f907){if(_0x168db5[_0x5434('0x3a')]['id']){delete _0x168db5[_0x5434('0x3a')]['id'];}return db[_0x5434('0x36')][_0x5434('0x37')]({'where':{'id':_0x168db5[_0x5434('0x3b')]['id']}})['then'](handleEntityNotFound(_0x24f907,null))[_0x5434('0x38')](saveUpdates(_0x168db5[_0x5434('0x3a')],null))[_0x5434('0x38')](respondWithResult(_0x24f907,null))[_0x5434('0x39')](handleError(_0x24f907,null));};exports['destroy']=function(_0x243163,_0x1fe399){return db['ChatApplication']['find']({'where':{'id':_0x243163[_0x5434('0x3b')]['id']}})[_0x5434('0x38')](handleEntityNotFound(_0x1fe399,null))['then'](removeEntity(_0x1fe399,null))[_0x5434('0x39')](handleError(_0x1fe399,null));};
\ No newline at end of file
index d18fc60..76defa0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x871a=['../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','lodash','util','../../config/logger','api','moment','path'];(function(_0x346362,_0x44cedd){var _0x213899=function(_0x4d53f6){while(--_0x4d53f6){_0x346362['push'](_0x346362['shift']());}};_0x213899(++_0x44cedd);}(_0x871a,0x16e));var _0xa871=function(_0x2633c7,_0x4db8b3){_0x2633c7=_0x2633c7-0x0;var _0xbb644=_0x871a[_0x2633c7];return _0xbb644;};'use strict';var _=require(_0xa871('0x0'));var util=require(_0xa871('0x1'));var logger=require(_0xa871('0x2'))(_0xa871('0x3'));var moment=require(_0xa871('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa871('0x5'));var rimraf=require('rimraf');var config=require(_0xa871('0x6'));var attributes=require(_0xa871('0x7'));module['exports']=function(_0x588f95,_0x42a8a0){return _0x588f95[_0xa871('0x8')](_0xa871('0x9'),attributes,{'tableName':_0xa871('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa871('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6625=['./chatApplication.attributes','exports','ChatApplication','chat_applications','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6625,0x191));var _0x5662=function(_0x450aa8,_0x1436ee){_0x450aa8=_0x450aa8-0x0;var _0x5854ec=_0x6625[_0x450aa8];return _0x5854ec;};'use strict';var _=require('lodash');var util=require(_0x5662('0x0'));var logger=require(_0x5662('0x1'))(_0x5662('0x2'));var moment=require(_0x5662('0x3'));var BPromise=require(_0x5662('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5662('0x5'));var rimraf=require('rimraf');var config=require(_0x5662('0x6'));var attributes=require(_0x5662('0x7'));module[_0x5662('0x8')]=function(_0x5d367f,_0x298433){return _0x5d367f['define'](_0x5662('0x9'),attributes,{'tableName':_0x5662('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5662('0xb')});};
\ No newline at end of file
index 0b4d288..677876a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c2d=['ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x1c83d6,_0x59dfb5){var _0x8131c0=function(_0x4602cd){while(--_0x4602cd){_0x1c83d6['push'](_0x1c83d6['shift']());}};_0x8131c0(++_0x59dfb5);}(_0x4c2d,0x7b));var _0xd4c2=function(_0x51f5aa,_0x4826dc){_0x51f5aa=_0x51f5aa-0x0;var _0x166d4b=_0x4c2d[_0x51f5aa];return _0x166d4b;};'use strict';var _=require(_0xd4c2('0x0'));var util=require(_0xd4c2('0x1'));var moment=require(_0xd4c2('0x2'));var BPromise=require(_0xd4c2('0x3'));var rs=require(_0xd4c2('0x4'));var fs=require('fs');var Redis=require(_0xd4c2('0x5'));var db=require(_0xd4c2('0x6'))['db'];var utils=require(_0xd4c2('0x7'));var logger=require(_0xd4c2('0x8'))(_0xd4c2('0x9'));var config=require(_0xd4c2('0xa'));var jayson=require(_0xd4c2('0xb'));var client=jayson[_0xd4c2('0xc')][_0xd4c2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4027e9,_0x449136,_0x2a311d){return new BPromise(function(_0x222896,_0x1fe349){return client['request'](_0x4027e9,_0x2a311d)['then'](function(_0x391efa){logger[_0xd4c2('0xe')](_0xd4c2('0xf'),_0x449136,_0xd4c2('0x10'));logger[_0xd4c2('0x11')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x449136,'request\x20sent',JSON['stringify'](_0x391efa));if(_0x391efa['error']){if(_0x391efa[_0xd4c2('0x12')][_0xd4c2('0x13')]===0x1f4){logger[_0xd4c2('0x12')]('ChatApplication,\x20%s,\x20%s',_0x449136,_0x391efa[_0xd4c2('0x12')][_0xd4c2('0x14')]);return _0x1fe349(_0x391efa['error'][_0xd4c2('0x14')]);}logger['error'](_0xd4c2('0xf'),_0x449136,_0x391efa[_0xd4c2('0x12')]['message']);return _0x222896(_0x391efa[_0xd4c2('0x12')][_0xd4c2('0x14')]);}else{logger[_0xd4c2('0xe')](_0xd4c2('0xf'),_0x449136,_0xd4c2('0x10'));_0x222896(_0x391efa[_0xd4c2('0x15')]['message']);}})[_0xd4c2('0x16')](function(_0x1aa1b4){logger[_0xd4c2('0x12')](_0xd4c2('0xf'),_0x449136,_0x1aa1b4);_0x1fe349(_0x1aa1b4);});});}
\ No newline at end of file
+var _0xa76a=['result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x1e0c10,_0x33130a){var _0x2533a4=function(_0x1803d1){while(--_0x1803d1){_0x1e0c10['push'](_0x1e0c10['shift']());}};_0x2533a4(++_0x33130a);}(_0xa76a,0x10a));var _0xaa76=function(_0x5466ab,_0x227b13){_0x5466ab=_0x5466ab-0x0;var _0x40751a=_0xa76a[_0x5466ab];return _0x40751a;};'use strict';var _=require('lodash');var util=require(_0xaa76('0x0'));var moment=require(_0xaa76('0x1'));var BPromise=require(_0xaa76('0x2'));var rs=require(_0xaa76('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa76('0x4'))['db'];var utils=require(_0xaa76('0x5'));var logger=require(_0xaa76('0x6'))(_0xaa76('0x7'));var config=require('../../config/environment');var jayson=require(_0xaa76('0x8'));var client=jayson['client'][_0xaa76('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b6a8c,_0x25bb24,_0x84a21d){return new BPromise(function(_0x23f7ea,_0x133ac8){return client[_0xaa76('0xa')](_0x1b6a8c,_0x84a21d)['then'](function(_0xeebff7){logger['info'](_0xaa76('0xb'),_0x25bb24,_0xaa76('0xc'));logger[_0xaa76('0xd')](_0xaa76('0xe'),_0x25bb24,_0xaa76('0xc'),JSON[_0xaa76('0xf')](_0xeebff7));if(_0xeebff7[_0xaa76('0x10')]){if(_0xeebff7[_0xaa76('0x10')][_0xaa76('0x11')]===0x1f4){logger[_0xaa76('0x10')](_0xaa76('0xb'),_0x25bb24,_0xeebff7[_0xaa76('0x10')]['message']);return _0x133ac8(_0xeebff7[_0xaa76('0x10')][_0xaa76('0x12')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x25bb24,_0xeebff7[_0xaa76('0x10')][_0xaa76('0x12')]);return _0x23f7ea(_0xeebff7[_0xaa76('0x10')]['message']);}else{logger[_0xaa76('0x13')]('ChatApplication,\x20%s,\x20%s',_0x25bb24,_0xaa76('0xc'));_0x23f7ea(_0xeebff7[_0xaa76('0x14')][_0xaa76('0x12')]);}})[_0xaa76('0x15')](function(_0x2e44cc){logger[_0xaa76('0x10')](_0xaa76('0xb'),_0x25bb24,_0x2e44cc);_0x133ac8(_0x2e44cc);});});}
\ No newline at end of file
index 8879036..b55c186 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d1c=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','isAuthenticated','destroy','exports','multer','util'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x0d1c,0x141));var _0xc0d1=function(_0x42fcf2,_0x78099b){_0x42fcf2=_0x42fcf2-0x0;var _0x3c8efb=_0x0d1c[_0x42fcf2];return _0x3c8efb;};'use strict';var multer=require(_0xc0d1('0x0'));var util=require(_0xc0d1('0x1'));var path=require(_0xc0d1('0x2'));var timeout=require('connect-timeout');var express=require(_0xc0d1('0x3'));var router=express[_0xc0d1('0x4')]();var fs_extra=require(_0xc0d1('0x5'));var auth=require(_0xc0d1('0x6'));var interaction=require(_0xc0d1('0x7'));var config=require(_0xc0d1('0x8'));var controller=require(_0xc0d1('0x9'));router[_0xc0d1('0xa')](_0xc0d1('0xb'),auth['isAuthenticated'](),controller[_0xc0d1('0xc')]);router[_0xc0d1('0xd')](_0xc0d1('0xb'),auth[_0xc0d1('0xe')](),controller['update']);router['delete']('/:id',auth[_0xc0d1('0xe')](),controller[_0xc0d1('0xf')]);module[_0xc0d1('0x10')]=router;
\ No newline at end of file
+var _0xe3e3=['put','/:id','isAuthenticated','update','delete','destroy','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','show'];(function(_0x4b6f5c,_0x56f7ce){var _0x55548b=function(_0x125619){while(--_0x125619){_0x4b6f5c['push'](_0x4b6f5c['shift']());}};_0x55548b(++_0x56f7ce);}(_0xe3e3,0x105));var _0x3e3e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe3e3[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require(_0x3e3e('0x0'));var path=require('path');var timeout=require(_0x3e3e('0x1'));var express=require('express');var router=express[_0x3e3e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3e3e('0x3'));var interaction=require(_0x3e3e('0x4'));var config=require(_0x3e3e('0x5'));var controller=require(_0x3e3e('0x6'));router[_0x3e3e('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x3e3e('0x8')]);router[_0x3e3e('0x9')](_0x3e3e('0xa'),auth[_0x3e3e('0xb')](),controller[_0x3e3e('0xc')]);router[_0x3e3e('0xd')](_0x3e3e('0xa'),auth[_0x3e3e('0xb')](),controller[_0x3e3e('0xe')]);module['exports']=router;
\ No newline at end of file
index 8146b0b..5c8d865 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7409=['STRING','BOOLEAN','sequelize','exports'];(function(_0x1370f2,_0xfdb711){var _0x161aa4=function(_0x4b206b){while(--_0x4b206b){_0x1370f2['push'](_0x1370f2['shift']());}};_0x161aa4(++_0xfdb711);}(_0x7409,0x6e));var _0x9740=function(_0x7fab38,_0x501063){_0x7fab38=_0x7fab38-0x0;var _0xb5c718=_0x7409[_0x7fab38];return _0xb5c718;};'use strict';var Sequelize=require(_0x9740('0x0'));module[_0x9740('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9740('0x2')]},'write':{'type':Sequelize[_0x9740('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xe8b1=['sequelize','exports','STRING'];(function(_0x4e9f87,_0x4914ae){var _0x5104c9=function(_0x5ac31e){while(--_0x5ac31e){_0x4e9f87['push'](_0x4e9f87['shift']());}};_0x5104c9(++_0x4914ae);}(_0xe8b1,0x17a));var _0x1e8b=function(_0x2b78e5,_0x3126f8){_0x2b78e5=_0x2b78e5-0x0;var _0xa8d52d=_0xe8b1[_0x2b78e5];return _0xa8d52d;};'use strict';var Sequelize=require(_0x1e8b('0x0'));module[_0x1e8b('0x1')]={'name':{'type':Sequelize[_0x1e8b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1e8b('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 0478cc6..fae57af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cc3=['where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','options','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','ids','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','ChatGroup','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x13e2b1,_0x271a51){var _0x3467c2=function(_0x2f4939){while(--_0x2f4939){_0x13e2b1['push'](_0x13e2b1['shift']());}};_0x3467c2(++_0x271a51);}(_0x7cc3,0x7f));var _0x37cc=function(_0x4434c6,_0x11d834){_0x4434c6=_0x4434c6-0x0;var _0x5ddd6d=_0x7cc3[_0x4434c6];return _0x5ddd6d;};'use strict';var emlformat=require(_0x37cc('0x0'));var rimraf=require(_0x37cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x37cc('0x2'));var rp=require('request-promise');var moment=require(_0x37cc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x37cc('0x4'));var util=require(_0x37cc('0x5'));var path=require(_0x37cc('0x6'));var sox=require(_0x37cc('0x7'));var csv=require('to-csv');var ejs=require(_0x37cc('0x8'));var fs=require('fs');var fs_extra=require(_0x37cc('0x9'));var _=require('lodash');var squel=require(_0x37cc('0xa'));var crypto=require(_0x37cc('0xb'));var jsforce=require(_0x37cc('0xc'));var deskjs=require(_0x37cc('0xd'));var toCsv=require(_0x37cc('0xe'));var querystring=require(_0x37cc('0xf'));var Papa=require(_0x37cc('0x10'));var Redis=require('ioredis');var authService=require(_0x37cc('0x11'));var qs=require(_0x37cc('0x12'));var as=require(_0x37cc('0x13'));var hardwareService=require(_0x37cc('0x14'));var logger=require('../../config/logger')(_0x37cc('0x15'));var utils=require(_0x37cc('0x16'));var config=require(_0x37cc('0x17'));var licenseUtil=require(_0x37cc('0x18'));var db=require(_0x37cc('0x19'))['db'];config['redis']=_['defaults'](config[_0x37cc('0x1a')],{'host':_0x37cc('0x1b'),'port':0x18eb});var socket=require(_0x37cc('0x1c'))(new Redis(config[_0x37cc('0x1a')]));require(_0x37cc('0x1d'))[_0x37cc('0x1e')](socket);function respondWithStatusCode(_0x34f386,_0x3e8f38){_0x3e8f38=_0x3e8f38||0xcc;return function(_0x43cfa2){if(_0x43cfa2){return _0x34f386[_0x37cc('0x1f')](_0x3e8f38);}return _0x34f386['status'](_0x3e8f38)[_0x37cc('0x20')]();};}function respondWithResult(_0x6c8549,_0x443883){_0x443883=_0x443883||0xc8;return function(_0x47ab30){if(_0x47ab30){return _0x6c8549[_0x37cc('0x21')](_0x443883)[_0x37cc('0x22')](_0x47ab30);}};}function respondWithFilteredResult(_0x2b18b3,_0x12893b){return function(_0x253572){if(_0x253572){var _0x2af8e5=typeof _0x12893b[_0x37cc('0x23')]===_0x37cc('0x24')&&typeof _0x12893b[_0x37cc('0x25')]===_0x37cc('0x24');var _0x3c50b1=_0x253572[_0x37cc('0x26')];var _0x59fe68=_0x2af8e5?0x0:_0x12893b[_0x37cc('0x23')];var _0x316dbe=_0x2af8e5?_0x253572[_0x37cc('0x26')]:_0x12893b[_0x37cc('0x23')]+_0x12893b[_0x37cc('0x25')];var _0x5d29e0;if(_0x316dbe>=_0x3c50b1){_0x316dbe=_0x3c50b1;_0x5d29e0=0xc8;}else{_0x5d29e0=0xce;}_0x2b18b3[_0x37cc('0x21')](_0x5d29e0);return _0x2b18b3[_0x37cc('0x27')](_0x37cc('0x28'),_0x59fe68+'-'+_0x316dbe+'/'+_0x3c50b1)[_0x37cc('0x22')](_0x253572);}return null;};}function patchUpdates(_0x16eab7){return function(_0x454ee9){try{jsonpatch[_0x37cc('0x29')](_0x454ee9,_0x16eab7,!![]);}catch(_0x1cfcdd){return BPromise[_0x37cc('0x2a')](_0x1cfcdd);}return _0x454ee9[_0x37cc('0x2b')]();};}function saveUpdates(_0x2f4de8,_0x1b3189){return function(_0x152a2b){if(_0x152a2b){return _0x152a2b[_0x37cc('0x2c')](_0x2f4de8)['then'](function(_0x4fb6f6){return _0x4fb6f6;});}return null;};}function removeEntity(_0x3413a9,_0x1830d7){return function(_0x25e7c5){if(_0x25e7c5){return _0x25e7c5[_0x37cc('0x2d')]()[_0x37cc('0x2e')](function(){_0x3413a9[_0x37cc('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c24f6,_0x11b1cb){return function(_0x28ce48){if(!_0x28ce48){_0x5c24f6[_0x37cc('0x1f')](0x194);}return _0x28ce48;};}function handleError(_0x3a01b1,_0x440784){_0x440784=_0x440784||0x1f4;return function(_0x59b4cf){logger[_0x37cc('0x2f')](_0x59b4cf[_0x37cc('0x30')]);if(_0x59b4cf[_0x37cc('0x31')]){delete _0x59b4cf[_0x37cc('0x31')];}_0x3a01b1['status'](_0x440784)[_0x37cc('0x32')](_0x59b4cf);};}exports[_0x37cc('0x33')]=function(_0x5f4ac6,_0x5468bf){var _0x113c18={},_0x4c9117={},_0x4cc403={'count':0x0,'rows':[]};var _0x33a892=_['map'](db[_0x37cc('0x34')][_0x37cc('0x35')],function(_0x5ac021){return{'name':_0x5ac021[_0x37cc('0x36')],'type':_0x5ac021[_0x37cc('0x37')]['key']};});_0x4c9117[_0x37cc('0x38')]=_[_0x37cc('0x39')](_0x33a892,_0x37cc('0x31'));_0x4c9117[_0x37cc('0x3a')]=_[_0x37cc('0x3b')](_0x5f4ac6[_0x37cc('0x3a')]);_0x4c9117[_0x37cc('0x3c')]=_['intersection'](_0x4c9117[_0x37cc('0x38')],_0x4c9117[_0x37cc('0x3a')]);_0x113c18['attributes']=_[_0x37cc('0x3d')](_0x4c9117[_0x37cc('0x38')],qs['fields'](_0x5f4ac6[_0x37cc('0x3a')][_0x37cc('0x3e')]));_0x113c18[_0x37cc('0x3f')]=_0x113c18[_0x37cc('0x3f')][_0x37cc('0x40')]?_0x113c18[_0x37cc('0x3f')]:_0x4c9117[_0x37cc('0x38')];if(!_0x5f4ac6['query'][_0x37cc('0x41')](_0x37cc('0x42'))){_0x113c18['limit']=qs[_0x37cc('0x25')](_0x5f4ac6['query'][_0x37cc('0x25')]);_0x113c18['offset']=qs[_0x37cc('0x23')](_0x5f4ac6['query']['offset']);}_0x113c18[_0x37cc('0x43')]=qs[_0x37cc('0x44')](_0x5f4ac6[_0x37cc('0x3a')][_0x37cc('0x44')]);_0x113c18[_0x37cc('0x45')]=qs[_0x37cc('0x3c')](_[_0x37cc('0x46')](_0x5f4ac6['query'],_0x4c9117[_0x37cc('0x3c')]),_0x33a892);if(_0x5f4ac6[_0x37cc('0x3a')][_0x37cc('0x47')]){_0x113c18[_0x37cc('0x45')]=_[_0x37cc('0x48')](_0x113c18[_0x37cc('0x45')],{'$or':_['map'](_0x33a892,function(_0x3b808d){if(_0x3b808d[_0x37cc('0x37')]!==_0x37cc('0x49')){var _0x38a6d7={};_0x38a6d7[_0x3b808d[_0x37cc('0x31')]]={'$like':'%'+_0x5f4ac6[_0x37cc('0x3a')]['filter']+'%'};return _0x38a6d7;}})});}_0x113c18=_[_0x37cc('0x48')]({},_0x113c18,_0x5f4ac6['options']);var _0x33be19={'where':_0x113c18['where']};return db[_0x37cc('0x34')][_0x37cc('0x26')](_0x33be19)[_0x37cc('0x2e')](function(_0xaf8210){_0x4cc403[_0x37cc('0x26')]=_0xaf8210;if(_0x5f4ac6[_0x37cc('0x3a')]['includeAll']){_0x113c18[_0x37cc('0x4a')]=[{'all':!![]}];}return db[_0x37cc('0x34')][_0x37cc('0x4b')](_0x113c18);})[_0x37cc('0x2e')](function(_0x38da07){_0x4cc403[_0x37cc('0x4c')]=_0x38da07;return _0x4cc403;})[_0x37cc('0x2e')](respondWithFilteredResult(_0x5468bf,_0x113c18))[_0x37cc('0x4d')](handleError(_0x5468bf,null));};exports[_0x37cc('0x4e')]=function(_0x43820a,_0x40113b){var _0x827f1e={'raw':!![],'where':{'id':_0x43820a[_0x37cc('0x4f')]['id']}},_0x5d2371={};_0x5d2371[_0x37cc('0x38')]=_[_0x37cc('0x3b')](db[_0x37cc('0x34')][_0x37cc('0x35')]);_0x5d2371[_0x37cc('0x3a')]=_[_0x37cc('0x3b')](_0x43820a[_0x37cc('0x3a')]);_0x5d2371[_0x37cc('0x3c')]=_['intersection'](_0x5d2371['model'],_0x5d2371[_0x37cc('0x3a')]);_0x827f1e['attributes']=_['intersection'](_0x5d2371[_0x37cc('0x38')],qs[_0x37cc('0x3e')](_0x43820a['query']['fields']));_0x827f1e[_0x37cc('0x3f')]=_0x827f1e['attributes'][_0x37cc('0x40')]?_0x827f1e['attributes']:_0x5d2371['model'];if(_0x43820a[_0x37cc('0x3a')]['includeAll']){_0x827f1e['include']=[{'all':!![]}];}_0x827f1e=_[_0x37cc('0x48')]({},_0x827f1e,_0x43820a[_0x37cc('0x50')]);return db[_0x37cc('0x34')][_0x37cc('0x51')](_0x827f1e)[_0x37cc('0x2e')](handleEntityNotFound(_0x40113b,null))['then'](respondWithResult(_0x40113b,null))[_0x37cc('0x4d')](handleError(_0x40113b,null));};exports[_0x37cc('0x52')]=function(_0x49afdb,_0x40d10c){return db[_0x37cc('0x34')][_0x37cc('0x52')](_0x49afdb[_0x37cc('0x53')],{})[_0x37cc('0x2e')](respondWithResult(_0x40d10c,0xc9))['catch'](handleError(_0x40d10c,null));};exports[_0x37cc('0x2c')]=function(_0x297ff6,_0x2e60c8){if(_0x297ff6[_0x37cc('0x53')]['id']){delete _0x297ff6[_0x37cc('0x53')]['id'];}return db[_0x37cc('0x34')][_0x37cc('0x51')]({'where':{'id':_0x297ff6['params']['id']}})[_0x37cc('0x2e')](handleEntityNotFound(_0x2e60c8,null))[_0x37cc('0x2e')](saveUpdates(_0x297ff6['body'],null))[_0x37cc('0x2e')](respondWithResult(_0x2e60c8,null))['catch'](handleError(_0x2e60c8,null));};exports['destroy']=function(_0x20a0b9,_0x4627bb){return db[_0x37cc('0x34')]['find']({'where':{'id':_0x20a0b9['params']['id']}})[_0x37cc('0x2e')](handleEntityNotFound(_0x4627bb,null))[_0x37cc('0x2e')](removeEntity(_0x4627bb,null))[_0x37cc('0x4d')](handleError(_0x4627bb,null));};exports[_0x37cc('0x54')]=function(_0x4dc488,_0x416068){return db[_0x37cc('0x34')][_0x37cc('0x54')]()[_0x37cc('0x2e')](respondWithResult(_0x416068,null))['catch'](handleError(_0x416068,null));};exports[_0x37cc('0x55')]=function(_0xd74e6e,_0x582c4e,_0x19de61){return db[_0x37cc('0x56')][_0x37cc('0x26')]({'where':{'ChatGroupId':_0xd74e6e[_0x37cc('0x4f')]['id'],'ToId':_0xd74e6e[_0x37cc('0x57')]['id'],'read':![]}})[_0x37cc('0x2e')](function(_0x230de3){return{'id':_['toInteger'](_0xd74e6e['params']['id']),'count':_0x230de3};})[_0x37cc('0x2e')](respondWithResult(_0x582c4e,null))[_0x37cc('0x4d')](handleError(_0x582c4e,null));};exports[_0x37cc('0x58')]=function(_0x27acb9,_0x3a574c,_0x4a1d56){return db['ChatGroup'][_0x37cc('0x51')]({'where':{'id':_0x27acb9[_0x37cc('0x4f')]['id']}})[_0x37cc('0x2e')](handleEntityNotFound(_0x3a574c,null))[_0x37cc('0x2e')](function(_0x3af27d){if(_0x3af27d){return _0x3af27d[_0x37cc('0x58')](_0x27acb9[_0x37cc('0x53')][_0x37cc('0x59')],_['omit'](_0x27acb9['body'],[_0x37cc('0x59'),'id'])||{});}})[_0x37cc('0x2e')](respondWithResult(_0x3a574c,null))[_0x37cc('0x4d')](handleError(_0x3a574c,null));};exports['getMembers']=function(_0x29bb96,_0x102de0,_0x3349a0){var _0x36a3f5={};var _0x2381c1={};var _0x3a089e;var _0x35d179;return db[_0x37cc('0x34')]['findOne']({'where':{'id':_0x29bb96[_0x37cc('0x4f')]['id']}})[_0x37cc('0x2e')](handleEntityNotFound(_0x102de0,null))[_0x37cc('0x2e')](function(_0x151a6e){if(_0x151a6e){_0x3a089e=_0x151a6e;_0x2381c1['model']=_['keys'](db['User']['rawAttributes']);_0x2381c1[_0x37cc('0x3a')]=_[_0x37cc('0x3b')](_0x29bb96['query']);_0x2381c1['filters']=_[_0x37cc('0x3d')](_0x2381c1[_0x37cc('0x38')],_0x2381c1[_0x37cc('0x3a')]);_0x36a3f5[_0x37cc('0x3f')]=_['intersection'](_0x2381c1[_0x37cc('0x38')],qs[_0x37cc('0x3e')](_0x29bb96[_0x37cc('0x3a')][_0x37cc('0x3e')]));_0x36a3f5[_0x37cc('0x3f')]=_0x36a3f5['attributes'][_0x37cc('0x40')]?_0x36a3f5[_0x37cc('0x3f')]:_0x2381c1[_0x37cc('0x38')];_0x36a3f5[_0x37cc('0x43')]=qs[_0x37cc('0x44')](_0x29bb96[_0x37cc('0x3a')][_0x37cc('0x44')]);_0x36a3f5['where']=qs['filters'](_[_0x37cc('0x46')](_0x29bb96['query'],_0x2381c1[_0x37cc('0x3c')]));if(_0x29bb96[_0x37cc('0x3a')][_0x37cc('0x47')]){_0x36a3f5[_0x37cc('0x45')]=_[_0x37cc('0x48')](_0x36a3f5[_0x37cc('0x45')],{'$or':_[_0x37cc('0x39')](_0x36a3f5[_0x37cc('0x3f')],function(_0x16a34c){var _0x1aaf7d={};_0x1aaf7d[_0x16a34c]={'$like':'%'+_0x29bb96[_0x37cc('0x3a')]['filter']+'%'};return _0x1aaf7d;})});}_0x36a3f5=_[_0x37cc('0x48')]({},_0x36a3f5,_0x29bb96[_0x37cc('0x50')]);return _0x3a089e['getMembers'](_0x36a3f5);}})['then'](function(_0x5ba630){if(_0x5ba630){_0x35d179=_0x5ba630[_0x37cc('0x40')];if(!_0x29bb96[_0x37cc('0x3a')][_0x37cc('0x41')](_0x37cc('0x42'))){_0x36a3f5[_0x37cc('0x25')]=qs[_0x37cc('0x25')](_0x29bb96[_0x37cc('0x3a')][_0x37cc('0x25')]);_0x36a3f5['offset']=qs[_0x37cc('0x23')](_0x29bb96[_0x37cc('0x3a')][_0x37cc('0x23')]);}return _0x3a089e['getMembers'](_0x36a3f5);}})[_0x37cc('0x2e')](function(_0x364094){if(_0x364094){return _0x364094?{'count':_0x35d179,'rows':_0x364094}:null;}})['then'](respondWithResult(_0x102de0,null))[_0x37cc('0x4d')](handleError(_0x102de0,null));};exports[_0x37cc('0x5a')]=function(_0x508fe3,_0x299534,_0xfd1324){return db[_0x37cc('0x34')][_0x37cc('0x51')]({'where':{'id':_0x508fe3['params']['id']}})[_0x37cc('0x2e')](handleEntityNotFound(_0x299534,null))[_0x37cc('0x2e')](function(_0x25a35d){if(_0x25a35d){return _0x25a35d[_0x37cc('0x5a')](_0x508fe3[_0x37cc('0x3a')][_0x37cc('0x59')]);}})[_0x37cc('0x2e')](respondWithStatusCode(_0x299534,null))[_0x37cc('0x4d')](handleError(_0x299534,null));};exports[_0x37cc('0x5b')]=function(_0x2f5729,_0x43688a,_0x7d0f47){if(_0x2f5729['body']['id']){delete _0x2f5729['body']['id'];}return db['ChatGroup'][_0x37cc('0x51')]({'where':{'id':_0x2f5729[_0x37cc('0x4f')]['id']}})['then'](handleEntityNotFound(_0x43688a,null))['then'](function(_0x4e6b52){if(_0x4e6b52){_0x2f5729[_0x37cc('0x53')][_0x37cc('0x5c')]=_0x4e6b52['id'];return db[_0x37cc('0x56')]['create'](_0x2f5729[_0x37cc('0x53')]);}})[_0x37cc('0x2e')](respondWithResult(_0x43688a,null))['catch'](handleError(_0x43688a,null));};exports[_0x37cc('0x5d')]=function(_0x52888c,_0x51b52a,_0x38028d){var _0xa1d80c={};var _0x4b17be={};var _0x278efa;var _0x3b64d6;return db['ChatGroup'][_0x37cc('0x5e')]({'where':{'id':_0x52888c['params']['id']}})[_0x37cc('0x2e')](handleEntityNotFound(_0x51b52a,null))[_0x37cc('0x2e')](function(_0xc1bee5){if(_0xc1bee5){_0x278efa=_0xc1bee5;_0x4b17be[_0x37cc('0x38')]=_[_0x37cc('0x3b')](db['ChatInternalMessage'][_0x37cc('0x35')]);_0x4b17be['query']=_[_0x37cc('0x3b')](_0x52888c[_0x37cc('0x3a')]);_0x4b17be[_0x37cc('0x3c')]=_[_0x37cc('0x3d')](_0x4b17be[_0x37cc('0x38')],_0x4b17be[_0x37cc('0x3a')]);_0xa1d80c[_0x37cc('0x3f')]=_[_0x37cc('0x3d')](_0x4b17be[_0x37cc('0x38')],qs['fields'](_0x52888c['query'][_0x37cc('0x3e')]));_0xa1d80c[_0x37cc('0x3f')]=_0xa1d80c[_0x37cc('0x3f')][_0x37cc('0x40')]?_0xa1d80c['attributes']:_0x4b17be[_0x37cc('0x38')];_0xa1d80c['order']=qs[_0x37cc('0x44')](_0x52888c[_0x37cc('0x3a')][_0x37cc('0x44')]);_0xa1d80c[_0x37cc('0x45')]=qs[_0x37cc('0x3c')](_['pick'](_0x52888c['query'],_0x4b17be[_0x37cc('0x3c')]));if(_0x52888c[_0x37cc('0x3a')][_0x37cc('0x47')]){_0xa1d80c[_0x37cc('0x45')]=_['merge'](_0xa1d80c['where'],{'$or':_[_0x37cc('0x39')](_0xa1d80c[_0x37cc('0x3f')],function(_0xad8ccb){var _0x19b139={};_0x19b139[_0xad8ccb]={'$like':'%'+_0x52888c[_0x37cc('0x3a')][_0x37cc('0x47')]+'%'};return _0x19b139;})});}if(_0x52888c[_0x37cc('0x3a')][_0x37cc('0x5f')]){var _0x1d8163=_0x52888c[_0x37cc('0x3a')][_0x37cc('0x5f')][_0x37cc('0x60')](',');var _0x484d39={};_0x484d39[_0x1d8163[0x0]]={'$gte':moment(_0x1d8163[0x1])['format'](_0x37cc('0x61'))};_0xa1d80c[_0x37cc('0x45')]=_['merge'](_0xa1d80c[_0x37cc('0x45')],_0x484d39);}_0xa1d80c=_[_0x37cc('0x48')]({},_0xa1d80c,_0x52888c[_0x37cc('0x50')]);return _0x278efa[_0x37cc('0x5d')](_0xa1d80c);}})[_0x37cc('0x2e')](function(_0x3ffead){if(_0x3ffead){_0x3b64d6=_0x3ffead['length'];if(!_0x52888c[_0x37cc('0x3a')][_0x37cc('0x41')](_0x37cc('0x42'))){_0xa1d80c[_0x37cc('0x25')]=qs['limit'](_0x52888c[_0x37cc('0x3a')]['limit']);_0xa1d80c['offset']=qs['offset'](_0x52888c[_0x37cc('0x3a')][_0x37cc('0x23')]);}return _0x278efa[_0x37cc('0x5d')](_0xa1d80c);}})[_0x37cc('0x2e')](function(_0x13c4f5){if(_0x13c4f5){return _0x13c4f5?{'count':_0x3b64d6,'rows':_0x13c4f5}:null;}})[_0x37cc('0x2e')](respondWithResult(_0x51b52a,null))[_0x37cc('0x4d')](handleError(_0x51b52a,null));};
\ No newline at end of file
+var _0x0088=['nolimit','order','sort','where','pick','merge','options','ChatGroup','includeAll','findAll','catch','show','params','length','include','find','create','body','describe','getUnread','user','addMembers','ids','omit','getMembers','findOne','User','filter','removeMembers','addMessage','ChatGroupId','getMessages','ChatInternalMessage','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','end','status','json','offset','undefined','count','limit','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x2b5dc9,_0x5bc895){var _0x4de799=function(_0x11f6e7){while(--_0x11f6e7){_0x2b5dc9['push'](_0x2b5dc9['shift']());}};_0x4de799(++_0x5bc895);}(_0x0088,0x1f0));var _0x8008=function(_0xdfbdd6,_0xbbf179){_0xdfbdd6=_0xdfbdd6-0x0;var _0x3e8d3a=_0x0088[_0xdfbdd6];return _0x3e8d3a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8008('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8008('0x1'));var moment=require(_0x8008('0x2'));var BPromise=require(_0x8008('0x3'));var Mustache=require(_0x8008('0x4'));var util=require('util');var path=require(_0x8008('0x5'));var sox=require(_0x8008('0x6'));var csv=require(_0x8008('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8008('0x8'));var _=require('lodash');var squel=require(_0x8008('0x9'));var crypto=require(_0x8008('0xa'));var jsforce=require(_0x8008('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8008('0x7'));var querystring=require(_0x8008('0xc'));var Papa=require(_0x8008('0xd'));var Redis=require(_0x8008('0xe'));var authService=require(_0x8008('0xf'));var qs=require(_0x8008('0x10'));var as=require(_0x8008('0x11'));var hardwareService=require(_0x8008('0x12'));var logger=require('../../config/logger')(_0x8008('0x13'));var utils=require('../../config/utils');var config=require(_0x8008('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8008('0x15'))['db'];config['redis']=_['defaults'](config[_0x8008('0x16')],{'host':_0x8008('0x17'),'port':0x18eb});var socket=require(_0x8008('0x18'))(new Redis(config[_0x8008('0x16')]));require(_0x8008('0x19'))['register'](socket);function respondWithStatusCode(_0x555c06,_0x19cc5a){_0x19cc5a=_0x19cc5a||0xcc;return function(_0x2ba8d7){if(_0x2ba8d7){return _0x555c06[_0x8008('0x1a')](_0x19cc5a);}return _0x555c06['status'](_0x19cc5a)[_0x8008('0x1b')]();};}function respondWithResult(_0x2864e0,_0x5372e6){_0x5372e6=_0x5372e6||0xc8;return function(_0x55eba6){if(_0x55eba6){return _0x2864e0[_0x8008('0x1c')](_0x5372e6)[_0x8008('0x1d')](_0x55eba6);}};}function respondWithFilteredResult(_0x205bd1,_0x167863){return function(_0x3d3127){if(_0x3d3127){var _0x2da342=typeof _0x167863[_0x8008('0x1e')]===_0x8008('0x1f')&&typeof _0x167863['limit']===_0x8008('0x1f');var _0x4b8659=_0x3d3127['count'];var _0x590a90=_0x2da342?0x0:_0x167863[_0x8008('0x1e')];var _0x5d7063=_0x2da342?_0x3d3127[_0x8008('0x20')]:_0x167863[_0x8008('0x1e')]+_0x167863[_0x8008('0x21')];var _0x44887a;if(_0x5d7063>=_0x4b8659){_0x5d7063=_0x4b8659;_0x44887a=0xc8;}else{_0x44887a=0xce;}_0x205bd1[_0x8008('0x1c')](_0x44887a);return _0x205bd1['set']('Content-Range',_0x590a90+'-'+_0x5d7063+'/'+_0x4b8659)[_0x8008('0x1d')](_0x3d3127);}return null;};}function patchUpdates(_0x766fb6){return function(_0x3a7747){try{jsonpatch[_0x8008('0x22')](_0x3a7747,_0x766fb6,!![]);}catch(_0x51f5ff){return BPromise['reject'](_0x51f5ff);}return _0x3a7747[_0x8008('0x23')]();};}function saveUpdates(_0x3c1944,_0xaed04c){return function(_0x4d98a9){if(_0x4d98a9){return _0x4d98a9[_0x8008('0x24')](_0x3c1944)[_0x8008('0x25')](function(_0x8f4c65){return _0x8f4c65;});}return null;};}function removeEntity(_0x362843,_0x71974c){return function(_0x12091d){if(_0x12091d){return _0x12091d['destroy']()['then'](function(){_0x362843[_0x8008('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37b555,_0x4ab731){return function(_0x35499c){if(!_0x35499c){_0x37b555[_0x8008('0x1a')](0x194);}return _0x35499c;};}function handleError(_0x9cb0e7,_0x15207e){_0x15207e=_0x15207e||0x1f4;return function(_0x174e99){logger[_0x8008('0x26')](_0x174e99[_0x8008('0x27')]);if(_0x174e99[_0x8008('0x28')]){delete _0x174e99[_0x8008('0x28')];}_0x9cb0e7[_0x8008('0x1c')](_0x15207e)[_0x8008('0x29')](_0x174e99);};}exports[_0x8008('0x2a')]=function(_0x200a73,_0x1fdea3){var _0x42ca56={},_0x54b558={},_0x567a7f={'count':0x0,'rows':[]};var _0x13f035=_[_0x8008('0x2b')](db['ChatGroup'][_0x8008('0x2c')],function(_0x1a641a){return{'name':_0x1a641a[_0x8008('0x2d')],'type':_0x1a641a[_0x8008('0x2e')][_0x8008('0x2f')]};});_0x54b558[_0x8008('0x30')]=_[_0x8008('0x2b')](_0x13f035,_0x8008('0x28'));_0x54b558[_0x8008('0x31')]=_[_0x8008('0x32')](_0x200a73[_0x8008('0x31')]);_0x54b558[_0x8008('0x33')]=_[_0x8008('0x34')](_0x54b558[_0x8008('0x30')],_0x54b558[_0x8008('0x31')]);_0x42ca56[_0x8008('0x35')]=_['intersection'](_0x54b558[_0x8008('0x30')],qs[_0x8008('0x36')](_0x200a73[_0x8008('0x31')][_0x8008('0x36')]));_0x42ca56[_0x8008('0x35')]=_0x42ca56[_0x8008('0x35')]['length']?_0x42ca56[_0x8008('0x35')]:_0x54b558[_0x8008('0x30')];if(!_0x200a73[_0x8008('0x31')][_0x8008('0x37')](_0x8008('0x38'))){_0x42ca56[_0x8008('0x21')]=qs['limit'](_0x200a73[_0x8008('0x31')][_0x8008('0x21')]);_0x42ca56[_0x8008('0x1e')]=qs[_0x8008('0x1e')](_0x200a73[_0x8008('0x31')]['offset']);}_0x42ca56[_0x8008('0x39')]=qs[_0x8008('0x3a')](_0x200a73['query'][_0x8008('0x3a')]);_0x42ca56[_0x8008('0x3b')]=qs[_0x8008('0x33')](_[_0x8008('0x3c')](_0x200a73[_0x8008('0x31')],_0x54b558[_0x8008('0x33')]),_0x13f035);if(_0x200a73[_0x8008('0x31')]['filter']){_0x42ca56[_0x8008('0x3b')]=_['merge'](_0x42ca56[_0x8008('0x3b')],{'$or':_['map'](_0x13f035,function(_0x5c3419){if(_0x5c3419['type']!=='VIRTUAL'){var _0x4b5a6d={};_0x4b5a6d[_0x5c3419[_0x8008('0x28')]]={'$like':'%'+_0x200a73[_0x8008('0x31')]['filter']+'%'};return _0x4b5a6d;}})});}_0x42ca56=_[_0x8008('0x3d')]({},_0x42ca56,_0x200a73[_0x8008('0x3e')]);var _0x1de576={'where':_0x42ca56['where']};return db[_0x8008('0x3f')][_0x8008('0x20')](_0x1de576)[_0x8008('0x25')](function(_0x39599b){_0x567a7f[_0x8008('0x20')]=_0x39599b;if(_0x200a73[_0x8008('0x31')][_0x8008('0x40')]){_0x42ca56['include']=[{'all':!![]}];}return db[_0x8008('0x3f')][_0x8008('0x41')](_0x42ca56);})['then'](function(_0x2f824c){_0x567a7f['rows']=_0x2f824c;return _0x567a7f;})['then'](respondWithFilteredResult(_0x1fdea3,_0x42ca56))[_0x8008('0x42')](handleError(_0x1fdea3,null));};exports[_0x8008('0x43')]=function(_0x10b0c4,_0x5b3751){var _0x1dc8c3={'raw':!![],'where':{'id':_0x10b0c4[_0x8008('0x44')]['id']}},_0x36d248={};_0x36d248['model']=_[_0x8008('0x32')](db[_0x8008('0x3f')][_0x8008('0x2c')]);_0x36d248[_0x8008('0x31')]=_[_0x8008('0x32')](_0x10b0c4[_0x8008('0x31')]);_0x36d248[_0x8008('0x33')]=_[_0x8008('0x34')](_0x36d248[_0x8008('0x30')],_0x36d248[_0x8008('0x31')]);_0x1dc8c3[_0x8008('0x35')]=_[_0x8008('0x34')](_0x36d248['model'],qs['fields'](_0x10b0c4['query'][_0x8008('0x36')]));_0x1dc8c3[_0x8008('0x35')]=_0x1dc8c3[_0x8008('0x35')][_0x8008('0x45')]?_0x1dc8c3[_0x8008('0x35')]:_0x36d248[_0x8008('0x30')];if(_0x10b0c4[_0x8008('0x31')][_0x8008('0x40')]){_0x1dc8c3[_0x8008('0x46')]=[{'all':!![]}];}_0x1dc8c3=_[_0x8008('0x3d')]({},_0x1dc8c3,_0x10b0c4[_0x8008('0x3e')]);return db[_0x8008('0x3f')][_0x8008('0x47')](_0x1dc8c3)['then'](handleEntityNotFound(_0x5b3751,null))['then'](respondWithResult(_0x5b3751,null))[_0x8008('0x42')](handleError(_0x5b3751,null));};exports[_0x8008('0x48')]=function(_0x520291,_0x36d1b8){return db[_0x8008('0x3f')][_0x8008('0x48')](_0x520291[_0x8008('0x49')],{})[_0x8008('0x25')](respondWithResult(_0x36d1b8,0xc9))[_0x8008('0x42')](handleError(_0x36d1b8,null));};exports[_0x8008('0x24')]=function(_0x1c1481,_0xfd4740){if(_0x1c1481[_0x8008('0x49')]['id']){delete _0x1c1481[_0x8008('0x49')]['id'];}return db['ChatGroup']['find']({'where':{'id':_0x1c1481[_0x8008('0x44')]['id']}})[_0x8008('0x25')](handleEntityNotFound(_0xfd4740,null))[_0x8008('0x25')](saveUpdates(_0x1c1481[_0x8008('0x49')],null))['then'](respondWithResult(_0xfd4740,null))[_0x8008('0x42')](handleError(_0xfd4740,null));};exports['destroy']=function(_0x510a04,_0x1c2412){return db['ChatGroup'][_0x8008('0x47')]({'where':{'id':_0x510a04[_0x8008('0x44')]['id']}})[_0x8008('0x25')](handleEntityNotFound(_0x1c2412,null))[_0x8008('0x25')](removeEntity(_0x1c2412,null))[_0x8008('0x42')](handleError(_0x1c2412,null));};exports[_0x8008('0x4a')]=function(_0x27c508,_0x1bd2bb){return db[_0x8008('0x3f')][_0x8008('0x4a')]()[_0x8008('0x25')](respondWithResult(_0x1bd2bb,null))[_0x8008('0x42')](handleError(_0x1bd2bb,null));};exports[_0x8008('0x4b')]=function(_0x18a338,_0x35106e,_0x1bb172){return db['ChatInternalMessage'][_0x8008('0x20')]({'where':{'ChatGroupId':_0x18a338[_0x8008('0x44')]['id'],'ToId':_0x18a338[_0x8008('0x4c')]['id'],'read':![]}})[_0x8008('0x25')](function(_0x31bc78){return{'id':_['toInteger'](_0x18a338['params']['id']),'count':_0x31bc78};})[_0x8008('0x25')](respondWithResult(_0x35106e,null))[_0x8008('0x42')](handleError(_0x35106e,null));};exports[_0x8008('0x4d')]=function(_0x2f95e7,_0x1f5600,_0x5e3ae6){return db[_0x8008('0x3f')][_0x8008('0x47')]({'where':{'id':_0x2f95e7['params']['id']}})[_0x8008('0x25')](handleEntityNotFound(_0x1f5600,null))[_0x8008('0x25')](function(_0x3627b5){if(_0x3627b5){return _0x3627b5[_0x8008('0x4d')](_0x2f95e7[_0x8008('0x49')][_0x8008('0x4e')],_[_0x8008('0x4f')](_0x2f95e7[_0x8008('0x49')],[_0x8008('0x4e'),'id'])||{});}})[_0x8008('0x25')](respondWithResult(_0x1f5600,null))[_0x8008('0x42')](handleError(_0x1f5600,null));};exports[_0x8008('0x50')]=function(_0x291469,_0x15b492,_0x4bdb7a){var _0x443b97={};var _0x18911a={};var _0x16d859;var _0x571cb6;return db[_0x8008('0x3f')][_0x8008('0x51')]({'where':{'id':_0x291469[_0x8008('0x44')]['id']}})['then'](handleEntityNotFound(_0x15b492,null))[_0x8008('0x25')](function(_0x1b9500){if(_0x1b9500){_0x16d859=_0x1b9500;_0x18911a[_0x8008('0x30')]=_[_0x8008('0x32')](db[_0x8008('0x52')][_0x8008('0x2c')]);_0x18911a['query']=_[_0x8008('0x32')](_0x291469['query']);_0x18911a['filters']=_[_0x8008('0x34')](_0x18911a['model'],_0x18911a['query']);_0x443b97[_0x8008('0x35')]=_[_0x8008('0x34')](_0x18911a[_0x8008('0x30')],qs[_0x8008('0x36')](_0x291469['query']['fields']));_0x443b97[_0x8008('0x35')]=_0x443b97['attributes']['length']?_0x443b97['attributes']:_0x18911a[_0x8008('0x30')];_0x443b97['order']=qs[_0x8008('0x3a')](_0x291469[_0x8008('0x31')]['sort']);_0x443b97[_0x8008('0x3b')]=qs[_0x8008('0x33')](_[_0x8008('0x3c')](_0x291469[_0x8008('0x31')],_0x18911a[_0x8008('0x33')]));if(_0x291469[_0x8008('0x31')][_0x8008('0x53')]){_0x443b97[_0x8008('0x3b')]=_[_0x8008('0x3d')](_0x443b97['where'],{'$or':_[_0x8008('0x2b')](_0x443b97['attributes'],function(_0x442a7b){var _0x3d37be={};_0x3d37be[_0x442a7b]={'$like':'%'+_0x291469[_0x8008('0x31')]['filter']+'%'};return _0x3d37be;})});}_0x443b97=_[_0x8008('0x3d')]({},_0x443b97,_0x291469[_0x8008('0x3e')]);return _0x16d859['getMembers'](_0x443b97);}})['then'](function(_0x81ac8d){if(_0x81ac8d){_0x571cb6=_0x81ac8d[_0x8008('0x45')];if(!_0x291469[_0x8008('0x31')][_0x8008('0x37')](_0x8008('0x38'))){_0x443b97[_0x8008('0x21')]=qs[_0x8008('0x21')](_0x291469['query']['limit']);_0x443b97['offset']=qs[_0x8008('0x1e')](_0x291469[_0x8008('0x31')][_0x8008('0x1e')]);}return _0x16d859[_0x8008('0x50')](_0x443b97);}})[_0x8008('0x25')](function(_0x3a2c7a){if(_0x3a2c7a){return _0x3a2c7a?{'count':_0x571cb6,'rows':_0x3a2c7a}:null;}})[_0x8008('0x25')](respondWithResult(_0x15b492,null))[_0x8008('0x42')](handleError(_0x15b492,null));};exports[_0x8008('0x54')]=function(_0x480a57,_0x3259d4,_0x216f5b){return db[_0x8008('0x3f')][_0x8008('0x47')]({'where':{'id':_0x480a57[_0x8008('0x44')]['id']}})[_0x8008('0x25')](handleEntityNotFound(_0x3259d4,null))[_0x8008('0x25')](function(_0x1efe48){if(_0x1efe48){return _0x1efe48[_0x8008('0x54')](_0x480a57[_0x8008('0x31')][_0x8008('0x4e')]);}})[_0x8008('0x25')](respondWithStatusCode(_0x3259d4,null))[_0x8008('0x42')](handleError(_0x3259d4,null));};exports[_0x8008('0x55')]=function(_0xc015e9,_0x1c19a8,_0x31c0cb){if(_0xc015e9[_0x8008('0x49')]['id']){delete _0xc015e9[_0x8008('0x49')]['id'];}return db['ChatGroup'][_0x8008('0x47')]({'where':{'id':_0xc015e9[_0x8008('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c19a8,null))[_0x8008('0x25')](function(_0x16cdc1){if(_0x16cdc1){_0xc015e9['body'][_0x8008('0x56')]=_0x16cdc1['id'];return db['ChatInternalMessage'][_0x8008('0x48')](_0xc015e9[_0x8008('0x49')]);}})[_0x8008('0x25')](respondWithResult(_0x1c19a8,null))[_0x8008('0x42')](handleError(_0x1c19a8,null));};exports[_0x8008('0x57')]=function(_0x2aae00,_0x542c5c,_0x49493b){var _0x1bb845={};var _0x562e70={};var _0x4c4c92;var _0x522db1;return db['ChatGroup'][_0x8008('0x51')]({'where':{'id':_0x2aae00[_0x8008('0x44')]['id']}})[_0x8008('0x25')](handleEntityNotFound(_0x542c5c,null))['then'](function(_0x77209){if(_0x77209){_0x4c4c92=_0x77209;_0x562e70[_0x8008('0x30')]=_[_0x8008('0x32')](db[_0x8008('0x58')]['rawAttributes']);_0x562e70[_0x8008('0x31')]=_[_0x8008('0x32')](_0x2aae00[_0x8008('0x31')]);_0x562e70['filters']=_[_0x8008('0x34')](_0x562e70[_0x8008('0x30')],_0x562e70[_0x8008('0x31')]);_0x1bb845[_0x8008('0x35')]=_[_0x8008('0x34')](_0x562e70[_0x8008('0x30')],qs[_0x8008('0x36')](_0x2aae00[_0x8008('0x31')][_0x8008('0x36')]));_0x1bb845[_0x8008('0x35')]=_0x1bb845['attributes'][_0x8008('0x45')]?_0x1bb845['attributes']:_0x562e70[_0x8008('0x30')];_0x1bb845[_0x8008('0x39')]=qs[_0x8008('0x3a')](_0x2aae00[_0x8008('0x31')][_0x8008('0x3a')]);_0x1bb845[_0x8008('0x3b')]=qs[_0x8008('0x33')](_[_0x8008('0x3c')](_0x2aae00['query'],_0x562e70['filters']));if(_0x2aae00[_0x8008('0x31')]['filter']){_0x1bb845[_0x8008('0x3b')]=_[_0x8008('0x3d')](_0x1bb845['where'],{'$or':_[_0x8008('0x2b')](_0x1bb845['attributes'],function(_0x2fb94a){var _0x10d7eb={};_0x10d7eb[_0x2fb94a]={'$like':'%'+_0x2aae00[_0x8008('0x31')][_0x8008('0x53')]+'%'};return _0x10d7eb;})});}if(_0x2aae00[_0x8008('0x31')]['$gte']){var _0x2d1dcf=_0x2aae00[_0x8008('0x31')]['$gte'][_0x8008('0x59')](',');var _0x59b697={};_0x59b697[_0x2d1dcf[0x0]]={'$gte':moment(_0x2d1dcf[0x1])[_0x8008('0x5a')](_0x8008('0x5b'))};_0x1bb845[_0x8008('0x3b')]=_[_0x8008('0x3d')](_0x1bb845[_0x8008('0x3b')],_0x59b697);}_0x1bb845=_[_0x8008('0x3d')]({},_0x1bb845,_0x2aae00[_0x8008('0x3e')]);return _0x4c4c92[_0x8008('0x57')](_0x1bb845);}})['then'](function(_0x1a4320){if(_0x1a4320){_0x522db1=_0x1a4320[_0x8008('0x45')];if(!_0x2aae00[_0x8008('0x31')][_0x8008('0x37')](_0x8008('0x38'))){_0x1bb845[_0x8008('0x21')]=qs[_0x8008('0x21')](_0x2aae00[_0x8008('0x31')]['limit']);_0x1bb845[_0x8008('0x1e')]=qs[_0x8008('0x1e')](_0x2aae00['query']['offset']);}return _0x4c4c92[_0x8008('0x57')](_0x1bb845);}})[_0x8008('0x25')](function(_0x384b3c){if(_0x384b3c){return _0x384b3c?{'count':_0x522db1,'rows':_0x384b3c}:null;}})['then'](respondWithResult(_0x542c5c,null))[_0x8008('0x42')](handleError(_0x542c5c,null));};
\ No newline at end of file
index 919c190..fef0147 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5046=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit'];(function(_0x24ddc2,_0x4aa4cf){var _0x710070=function(_0x4eab22){while(--_0x4eab22){_0x24ddc2['push'](_0x24ddc2['shift']());}};_0x710070(++_0x4aa4cf);}(_0x5046,0x6d));var _0x6504=function(_0x51df7e,_0x15baff){_0x51df7e=_0x51df7e-0x0;var _0x5de5cb=_0x5046[_0x51df7e];return _0x5de5cb;};'use strict';var EventEmitter=require(_0x6504('0x0'));var ChatGroup=require(_0x6504('0x1'))['db'][_0x6504('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x6504('0x3')](0x0);var events={'afterCreate':_0x6504('0x4'),'afterUpdate':_0x6504('0x5'),'afterDestroy':_0x6504('0x6')};function emitEvent(_0x468e95){return function(_0x28d61b,_0x430fa8,_0x50c5ec){ChatGroupEvents[_0x6504('0x7')](_0x468e95+':'+_0x28d61b['id'],_0x28d61b);ChatGroupEvents[_0x6504('0x7')](_0x468e95,_0x28d61b);_0x50c5ec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x6504('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xe3da=['../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xfd777b,_0xe87db4){var _0x4e8fd3=function(_0x2897b8){while(--_0x2897b8){_0xfd777b['push'](_0xfd777b['shift']());}};_0x4e8fd3(++_0xe87db4);}(_0xe3da,0x1cd));var _0xae3d=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xe3da[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require(_0xae3d('0x0'));var ChatGroup=require(_0xae3d('0x1'))['db'][_0xae3d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xae3d('0x3')](0x0);var events={'afterCreate':_0xae3d('0x4'),'afterUpdate':_0xae3d('0x5'),'afterDestroy':_0xae3d('0x6')};function emitEvent(_0x17952f){return function(_0xb2dfd3,_0x22bacf,_0x1b9397){ChatGroupEvents[_0xae3d('0x7')](_0x17952f+':'+_0xb2dfd3['id'],_0xb2dfd3);ChatGroupEvents[_0xae3d('0x7')](_0x17952f,_0xb2dfd3);_0x1b9397(null);};}for(var e in events){if(events[_0xae3d('0x8')](e)){var event=events[e];ChatGroup[_0xae3d('0x9')](e,emitEvent(event));}}module[_0xae3d('0xa')]=ChatGroupEvents;
\ No newline at end of file
index 636cbaa..d362992 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe77=['../../config/environment','./chatGroup.attributes','define','ChatGroup','util','api','moment','request-promise','rimraf'];(function(_0x2a83d1,_0x294fca){var _0x4bcf2f=function(_0x491e09){while(--_0x491e09){_0x2a83d1['push'](_0x2a83d1['shift']());}};_0x4bcf2f(++_0x294fca);}(_0xfe77,0x11b));var _0x7fe7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfe77[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x7fe7('0x0'));var logger=require('../../config/logger')(_0x7fe7('0x1'));var moment=require(_0x7fe7('0x2'));var BPromise=require('bluebird');var rp=require(_0x7fe7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7fe7('0x4'));var config=require(_0x7fe7('0x5'));var attributes=require(_0x7fe7('0x6'));module['exports']=function(_0x28f64e,_0x2184dc){return _0x28f64e[_0x7fe7('0x7')](_0x7fe7('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3fab=['../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x59e0b8,_0x4029e6){var _0x4414b0=function(_0x3212ec){while(--_0x3212ec){_0x59e0b8['push'](_0x59e0b8['shift']());}};_0x4414b0(++_0x4029e6);}(_0x3fab,0x1f4));var _0xb3fa=function(_0xc78766,_0x434038){_0xc78766=_0xc78766-0x0;var _0x52f405=_0x3fab[_0xc78766];return _0x52f405;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb3fa('0x0'))(_0xb3fa('0x1'));var moment=require(_0xb3fa('0x2'));var BPromise=require(_0xb3fa('0x3'));var rp=require(_0xb3fa('0x4'));var fs=require('fs');var path=require(_0xb3fa('0x5'));var rimraf=require(_0xb3fa('0x6'));var config=require(_0xb3fa('0x7'));var attributes=require(_0xb3fa('0x8'));module[_0xb3fa('0x9')]=function(_0xbc9689,_0x282b24){return _0xbc9689[_0xb3fa('0xa')](_0xb3fa('0xb'),attributes,{'tableName':_0xb3fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5a66573..ffee9a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2ca=['message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','register','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x5decec,_0x4e5761){_0x5decec=_0x5decec-0x0;var _0x35e1b4=_0xf2ca[_0x5decec];return _0x35e1b4;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var moment=require(_0xaf2c('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf2c('0x3'));var fs=require('fs');var Redis=require(_0xaf2c('0x4'));var db=require(_0xaf2c('0x5'))['db'];var utils=require(_0xaf2c('0x6'));var logger=require(_0xaf2c('0x7'))(_0xaf2c('0x8'));var config=require('../../config/environment');var jayson=require(_0xaf2c('0x9'));var client=jayson[_0xaf2c('0xa')][_0xaf2c('0xb')]({'port':0x232a});config[_0xaf2c('0xc')]=_['defaults'](config[_0xaf2c('0xc')],{'host':_0xaf2c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaf2c('0xc')]));require('./chatGroup.socket')[_0xaf2c('0xe')](socket);function respondWithRpcPromise(_0x4a0064,_0x2f5099,_0x144a7a){return new BPromise(function(_0x2e04e5,_0xd891e9){return client['request'](_0x4a0064,_0x144a7a)['then'](function(_0x2c0d88){logger[_0xaf2c('0xf')](_0xaf2c('0x10'),_0x2f5099,_0xaf2c('0x11'));logger[_0xaf2c('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x2f5099,'request\x20sent',JSON[_0xaf2c('0x13')](_0x2c0d88));if(_0x2c0d88[_0xaf2c('0x14')]){if(_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x15')]===0x1f4){logger[_0xaf2c('0x14')](_0xaf2c('0x10'),_0x2f5099,_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x16')]);return _0xd891e9(_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x16')]);}logger[_0xaf2c('0x14')](_0xaf2c('0x10'),_0x2f5099,_0x2c0d88[_0xaf2c('0x14')][_0xaf2c('0x16')]);return _0x2e04e5(_0x2c0d88[_0xaf2c('0x14')]['message']);}else{logger[_0xaf2c('0xf')]('ChatGroup,\x20%s,\x20%s',_0x2f5099,_0xaf2c('0x11'));_0x2e04e5(_0x2c0d88[_0xaf2c('0x17')][_0xaf2c('0x16')]);}})['catch'](function(_0x28ae7b){logger[_0xaf2c('0x14')](_0xaf2c('0x10'),_0x2f5099,_0x28ae7b);_0xd891e9(_0x28ae7b);});});}
\ No newline at end of file
+var _0x4c72=['error','ChatGroup,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','../../config/logger','rpc','jayson/promise','redis','defaults','localhost','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4b333a,_0x47d4bb){var _0x2b145a=function(_0x5972df){while(--_0x5972df){_0x4b333a['push'](_0x4b333a['shift']());}};_0x2b145a(++_0x47d4bb);}(_0x4c72,0x1e4));var _0x24c7=function(_0x368c56,_0x51f049){_0x368c56=_0x368c56-0x0;var _0x1ab5eb=_0x4c72[_0x368c56];return _0x1ab5eb;};'use strict';var _=require(_0x24c7('0x0'));var util=require('util');var moment=require(_0x24c7('0x1'));var BPromise=require(_0x24c7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x24c7('0x3'))(_0x24c7('0x4'));var config=require('../../config/environment');var jayson=require(_0x24c7('0x5'));var client=jayson['client']['http']({'port':0x232a});config[_0x24c7('0x6')]=_[_0x24c7('0x7')](config[_0x24c7('0x6')],{'host':_0x24c7('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x24c7('0x6')]));require(_0x24c7('0x9'))[_0x24c7('0xa')](socket);function respondWithRpcPromise(_0x5b5eb2,_0x2a512b,_0x292d4c){return new BPromise(function(_0x13626e,_0x26190a){return client['request'](_0x5b5eb2,_0x292d4c)[_0x24c7('0xb')](function(_0x2118ce){logger[_0x24c7('0xc')]('ChatGroup,\x20%s,\x20%s',_0x2a512b,'request\x20sent');logger['debug'](_0x24c7('0xd'),_0x2a512b,_0x24c7('0xe'),JSON[_0x24c7('0xf')](_0x2118ce));if(_0x2118ce['error']){if(_0x2118ce[_0x24c7('0x10')]['code']===0x1f4){logger[_0x24c7('0x10')](_0x24c7('0x11'),_0x2a512b,_0x2118ce[_0x24c7('0x10')]['message']);return _0x26190a(_0x2118ce[_0x24c7('0x10')][_0x24c7('0x12')]);}logger[_0x24c7('0x10')](_0x24c7('0x11'),_0x2a512b,_0x2118ce['error'][_0x24c7('0x12')]);return _0x13626e(_0x2118ce[_0x24c7('0x10')]['message']);}else{logger[_0x24c7('0xc')](_0x24c7('0x11'),_0x2a512b,_0x24c7('0xe'));_0x13626e(_0x2118ce['result'][_0x24c7('0x12')]);}})[_0x24c7('0x13')](function(_0x256def){logger[_0x24c7('0x10')](_0x24c7('0x11'),_0x2a512b,_0x256def);_0x26190a(_0x256def);});});}
\ No newline at end of file
index 0b947e9..dfa8697 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8a2=['emit','register','chatGroup:','./chatGroup.events','remove','update'];(function(_0x30fe8c,_0x272cb9){var _0x4f1068=function(_0x5f52c7){while(--_0x5f52c7){_0x30fe8c['push'](_0x30fe8c['shift']());}};_0x4f1068(++_0x272cb9);}(_0xe8a2,0x15f));var _0x2e8a=function(_0xcff452,_0x28455){_0xcff452=_0xcff452-0x0;var _0x3ad961=_0xe8a2[_0xcff452];return _0x3ad961;};'use strict';var ChatGroupEvents=require(_0x2e8a('0x0'));var events=['save',_0x2e8a('0x1'),_0x2e8a('0x2')];function createListener(_0x57a1f1,_0x24aaab){return function(_0x3e89ce){_0x24aaab[_0x2e8a('0x3')](_0x57a1f1,_0x3e89ce);};}function removeListener(_0x159c50,_0x57fbb5){return function(){ChatGroupEvents['removeListener'](_0x159c50,_0x57fbb5);};}exports[_0x2e8a('0x4')]=function(_0x1a5ee4){for(var _0x35d8ba=0x0,_0x27c95a=events['length'];_0x35d8ba<_0x27c95a;_0x35d8ba++){var _0x2c6531=events[_0x35d8ba];var _0x3d3125=createListener(_0x2e8a('0x5')+_0x2c6531,_0x1a5ee4);ChatGroupEvents['on'](_0x2c6531,_0x3d3125);}};
\ No newline at end of file
+var _0x5c79=['./chatGroup.events','save','remove','update','emit','removeListener','length','chatGroup:'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5c79,0x1c8));var _0x95c7=function(_0x55d58f,_0x2bea83){_0x55d58f=_0x55d58f-0x0;var _0x1ad6e6=_0x5c79[_0x55d58f];return _0x1ad6e6;};'use strict';var ChatGroupEvents=require(_0x95c7('0x0'));var events=[_0x95c7('0x1'),_0x95c7('0x2'),_0x95c7('0x3')];function createListener(_0x4620bd,_0x3e1f83){return function(_0x1d9e95){_0x3e1f83[_0x95c7('0x4')](_0x4620bd,_0x1d9e95);};}function removeListener(_0x1b0521,_0x4bb4f9){return function(){ChatGroupEvents[_0x95c7('0x5')](_0x1b0521,_0x4bb4f9);};}exports['register']=function(_0x3775f9){for(var _0x3a1fb1=0x0,_0x4d084b=events[_0x95c7('0x6')];_0x3a1fb1<_0x4d084b;_0x3a1fb1++){var _0x367edf=events[_0x3a1fb1];var _0x1190c2=createListener(_0x95c7('0x7')+_0x367edf,_0x3775f9);ChatGroupEvents['on'](_0x367edf,_0x1190c2);}};
\ No newline at end of file
index 2c5dbfc..3737408 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac79=['index','/describe','isAuthenticated','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','addMembers','addMessage','put','update','destroy','delete','removeMembers','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get'];(function(_0x113e32,_0x5339f0){var _0x4ff939=function(_0x2be9ca){while(--_0x2be9ca){_0x113e32['push'](_0x113e32['shift']());}};_0x4ff939(++_0x5339f0);}(_0xac79,0x1e4));var _0x9ac7=function(_0x65e204,_0x3f8857){_0x65e204=_0x65e204-0x0;var _0xd44376=_0xac79[_0x65e204];return _0xd44376;};'use strict';var multer=require(_0x9ac7('0x0'));var util=require('util');var path=require(_0x9ac7('0x1'));var timeout=require(_0x9ac7('0x2'));var express=require(_0x9ac7('0x3'));var router=express['Router']();var fs_extra=require(_0x9ac7('0x4'));var auth=require(_0x9ac7('0x5'));var interaction=require(_0x9ac7('0x6'));var config=require('../../config/environment');var controller=require(_0x9ac7('0x7'));router[_0x9ac7('0x8')]('/',auth['isAuthenticated'](),controller[_0x9ac7('0x9')]);router[_0x9ac7('0x8')](_0x9ac7('0xa'),auth[_0x9ac7('0xb')](),controller[_0x9ac7('0xc')]);router[_0x9ac7('0x8')](_0x9ac7('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x9ac7('0xe'),auth[_0x9ac7('0xb')](),controller[_0x9ac7('0xf')]);router[_0x9ac7('0x8')](_0x9ac7('0x10'),auth[_0x9ac7('0xb')](),controller[_0x9ac7('0x11')]);router['get'](_0x9ac7('0x12'),auth['isAuthenticated'](),controller['getMessages']);router[_0x9ac7('0x13')]('/',auth[_0x9ac7('0xb')](),controller[_0x9ac7('0x14')]);router[_0x9ac7('0x13')](_0x9ac7('0x10'),auth[_0x9ac7('0xb')](),controller[_0x9ac7('0x15')]);router['post'](_0x9ac7('0x12'),auth[_0x9ac7('0xb')](),controller[_0x9ac7('0x16')]);router[_0x9ac7('0x17')](_0x9ac7('0xd'),auth[_0x9ac7('0xb')](),controller[_0x9ac7('0x18')]);router['delete'](_0x9ac7('0xd'),auth[_0x9ac7('0xb')](),controller[_0x9ac7('0x19')]);router[_0x9ac7('0x1a')]('/:id/members',auth['isAuthenticated'](),controller[_0x9ac7('0x1b')]);module[_0x9ac7('0x1c')]=router;
\ No newline at end of file
+var _0x2856=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','post','create','/:id/members','addMessage','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express'];(function(_0x388586,_0x276ec0){var _0x2c5762=function(_0x25c327){while(--_0x25c327){_0x388586['push'](_0x388586['shift']());}};_0x2c5762(++_0x276ec0);}(_0x2856,0x1e8));var _0x6285=function(_0x18a772,_0x1a4d3f){_0x18a772=_0x18a772-0x0;var _0xbaac04=_0x2856[_0x18a772];return _0xbaac04;};'use strict';var multer=require(_0x6285('0x0'));var util=require(_0x6285('0x1'));var path=require(_0x6285('0x2'));var timeout=require(_0x6285('0x3'));var express=require(_0x6285('0x4'));var router=express[_0x6285('0x5')]();var fs_extra=require(_0x6285('0x6'));var auth=require(_0x6285('0x7'));var interaction=require(_0x6285('0x8'));var config=require('../../config/environment');var controller=require(_0x6285('0x9'));router['get']('/',auth[_0x6285('0xa')](),controller[_0x6285('0xb')]);router[_0x6285('0xc')](_0x6285('0xd'),auth[_0x6285('0xa')](),controller[_0x6285('0xe')]);router[_0x6285('0xc')](_0x6285('0xf'),auth[_0x6285('0xa')](),controller[_0x6285('0x10')]);router[_0x6285('0xc')](_0x6285('0x11'),auth[_0x6285('0xa')](),controller[_0x6285('0x12')]);router[_0x6285('0xc')]('/:id/members',auth[_0x6285('0xa')](),controller[_0x6285('0x13')]);router[_0x6285('0xc')](_0x6285('0x14'),auth[_0x6285('0xa')](),controller['getMessages']);router[_0x6285('0x15')]('/',auth[_0x6285('0xa')](),controller[_0x6285('0x16')]);router[_0x6285('0x15')](_0x6285('0x17'),auth['isAuthenticated'](),controller['addMembers']);router['post'](_0x6285('0x14'),auth[_0x6285('0xa')](),controller[_0x6285('0x18')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6285('0x19')](_0x6285('0xf'),auth['isAuthenticated'](),controller[_0x6285('0x1a')]);router[_0x6285('0x19')](_0x6285('0x17'),auth['isAuthenticated'](),controller[_0x6285('0x1b')]);module[_0x6285('0x1c')]=router;
\ No newline at end of file
index 2d4516b..79942f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e22=['ENUM','star','thumb','TEXT','STRING','long','DATE','BOOLEAN','exports','INTEGER'];(function(_0x200953,_0x1b67d4){var _0x3d486e=function(_0x4341c9){while(--_0x4341c9){_0x200953['push'](_0x200953['shift']());}};_0x3d486e(++_0x1b67d4);}(_0x3e22,0xa8));var _0x23e2=function(_0x482918,_0x2503cb){_0x482918=_0x482918-0x0;var _0x31282d=_0x3e22[_0x482918];return _0x31282d;};'use strict';var Sequelize=require('sequelize');module[_0x23e2('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x23e2('0x1')]},'ratingType':{'type':Sequelize[_0x23e2('0x2')](_0x23e2('0x3'),_0x23e2('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x23e2('0x5')]},'mailTranscript':{'type':Sequelize[_0x23e2('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x23e2('0x6')]},'secondDisposition':{'type':Sequelize[_0x23e2('0x6')]},'thirdDisposition':{'type':Sequelize[_0x23e2('0x6')]},'note':{'type':Sequelize[_0x23e2('0x6')]},'browserName':{'type':Sequelize[_0x23e2('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x23e2('0x6')]},'osVersion':{'type':Sequelize[_0x23e2('0x6')]},'deviceModel':{'type':Sequelize[_0x23e2('0x6')]},'deviceVendor':{'type':Sequelize[_0x23e2('0x6')]},'deviceType':{'type':Sequelize[_0x23e2('0x6')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x23e2('0x6')]},'formData':{'type':Sequelize[_0x23e2('0x5')](_0x23e2('0x7'))},'read1stAt':{'type':Sequelize[_0x23e2('0x8')]},'lastMsgAt':{'type':Sequelize[_0x23e2('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x23e2('0x6')]},'customerPort':{'type':Sequelize[_0x23e2('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x23e2('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x23e2('0x9')],'defaultValue':![]}};
\ No newline at end of file
+var _0x19e1=['star','TEXT','STRING','long','DATE','ENUM','out','sequelize','exports','BOOLEAN','INTEGER','thumb'];(function(_0x5926d5,_0x3933f8){var _0x2da247=function(_0xaded86){while(--_0xaded86){_0x5926d5['push'](_0x5926d5['shift']());}};_0x2da247(++_0x3933f8);}(_0x19e1,0x163));var _0x119e=function(_0x46451c,_0x88ddd){_0x46451c=_0x46451c-0x0;var _0x12dce4=_0x19e1[_0x46451c];return _0x12dce4;};'use strict';var Sequelize=require(_0x119e('0x0'));module[_0x119e('0x1')]={'closed':{'type':Sequelize[_0x119e('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x119e('0x3')]},'ratingType':{'type':Sequelize['ENUM']('star',_0x119e('0x4')),'defaultValue':_0x119e('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x119e('0x6')]},'mailTranscript':{'type':Sequelize[_0x119e('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x119e('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x119e('0x7')]},'note':{'type':Sequelize[_0x119e('0x7')]},'browserName':{'type':Sequelize[_0x119e('0x7')]},'browserVersion':{'type':Sequelize[_0x119e('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x119e('0x7')]},'deviceModel':{'type':Sequelize[_0x119e('0x7')]},'deviceVendor':{'type':Sequelize[_0x119e('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x119e('0x7')]},'formData':{'type':Sequelize[_0x119e('0x6')](_0x119e('0x8'))},'read1stAt':{'type':Sequelize[_0x119e('0x9')]},'lastMsgAt':{'type':Sequelize[_0x119e('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x119e('0xa')]('in',_0x119e('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x119e('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x119e('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x119e('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 89945a2..0aec808 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c76=['email','isNull','follow','Sequelize','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','updateAttributes','customUpdate','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','close','mailTranscript','root','server/files/chat/upload/','format','CmContact','Messages','%s%d','System','website_alias','agentAlias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','Mail\x20Transcript','addMessage','ids','omit','getMessages','filters','$gte','YYYY-MM-DD\x20HH:mm:ss','options','findAll','getMyMessages','includeAgent','addTags','setTags','spread','chatInteractionTags:save','removeTags','server','files','tmp','transcript-%d-%s.zip','lastName','attachments','Account','Owner','mkdirSync','Chat','N.A.','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','createWriteStream','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','rimraf','zip-dir','request-promise','bluebird','mustache','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatInteraction,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','update','destroy','stack','name','send','render','contact','agent','interaction','account','Users','map','fullname','TagIds','split','forEach','waiting','talking','answered','unmanaged','abandoned','total','closed','UserId','index','ChatInteraction','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.ChatInteractionId','users','chat_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','o.fullname','Owner.fullname','o.internal','ChatInteractionId','push','all','rows','show','params','includeAll','include','create','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','https://api-vidaoo.xcally.com/api/v1/meetings'];(function(_0x469961,_0x4ab14b){var _0x55e9ef=function(_0x565236){while(--_0x565236){_0x469961['push'](_0x469961['shift']());}};_0x55e9ef(++_0x4ab14b);}(_0x6c76,0x184));var _0x66c7=function(_0x3fd737,_0x263d58){_0x3fd737=_0x3fd737-0x0;var _0x4b9e85=_0x6c76[_0x3fd737];return _0x4b9e85;};'use strict';var rimraf=require(_0x66c7('0x0'));var zipdir=require(_0x66c7('0x1'));var rp=require(_0x66c7('0x2'));var moment=require('moment');var BPromise=require(_0x66c7('0x3'));var Mustache=require(_0x66c7('0x4'));var util=require('util');var path=require('path');var ejs=require(_0x66c7('0x5'));var fs=require('fs');var _=require(_0x66c7('0x6'));var squel=require('squel');var Redis=require(_0x66c7('0x7'));var qs=require(_0x66c7('0x8'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x66c7('0x9'));var logger=require('../../config/logger')('api');var config=require(_0x66c7('0xa'));var db=require(_0x66c7('0xb'))['db'];config[_0x66c7('0xc')]=_['defaults'](config[_0x66c7('0xc')],{'host':_0x66c7('0xd'),'port':0x18eb});var socket=require(_0x66c7('0xe'))(new Redis(config[_0x66c7('0xc')]));require('./chatInteraction.socket')[_0x66c7('0xf')](socket);var jayson=require(_0x66c7('0x10'));var client=jayson[_0x66c7('0x11')][_0x66c7('0x12')]({'port':0x232b});var client9004=jayson[_0x66c7('0x11')][_0x66c7('0x12')]({'port':0x232c});function respondWithRpcPromise(_0x174717,_0x5176a3,_0x18c309,_0x760e36){return new BPromise(function(_0x35cbc2,_0xea3f56){var _0x4f6c91=_0x760e36||client;return _0x4f6c91[_0x66c7('0x13')](_0x174717,_0x18c309)[_0x66c7('0x14')](function(_0xf3b04){logger[_0x66c7('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x5176a3,_0x66c7('0x16'));logger['debug'](_0x66c7('0x17'),_0x5176a3,_0x66c7('0x16'),JSON[_0x66c7('0x18')](_0xf3b04));if(_0xf3b04[_0x66c7('0x19')]){if(_0xf3b04[_0x66c7('0x19')]['code']===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5176a3,_0xf3b04['error'][_0x66c7('0x1a')]);return _0xea3f56(_0xf3b04[_0x66c7('0x19')]['message']);}logger['error'](_0x66c7('0x1b'),_0x5176a3,_0xf3b04[_0x66c7('0x19')][_0x66c7('0x1a')]);return _0x35cbc2(_0xf3b04[_0x66c7('0x19')]['message']);}else{logger['info'](_0x66c7('0x1b'),_0x5176a3,_0x66c7('0x16'));_0x35cbc2(_0xf3b04[_0x66c7('0x1c')][_0x66c7('0x1a')]);}})[_0x66c7('0x1d')](function(_0x75f118){logger['error'](_0x66c7('0x1b'),_0x5176a3,_0x75f118);_0xea3f56(_0x75f118);});});}function respondWithStatusCode(_0x366e9b,_0x4a2b90){_0x4a2b90=_0x4a2b90||0xcc;return function(_0x7462f1){if(_0x7462f1){return _0x366e9b[_0x66c7('0x1e')](_0x4a2b90);}return _0x366e9b[_0x66c7('0x1f')](_0x4a2b90)[_0x66c7('0x20')]();};}function respondWithResult(_0x5bfaf6,_0x2736df){_0x2736df=_0x2736df||0xc8;return function(_0x42ca37){if(_0x42ca37){return _0x5bfaf6['status'](_0x2736df)[_0x66c7('0x21')](_0x42ca37);}};}function respondWithFilteredResult(_0x11a6b9,_0x2bb86d){return function(_0x2ef6a2){if(_0x2ef6a2){var _0x2af0a3=typeof _0x2bb86d['offset']==='undefined'&&typeof _0x2bb86d['limit']===_0x66c7('0x22');var _0x542ff1=_0x2ef6a2['count'];var _0x9afd50=_0x2af0a3?0x0:_0x2bb86d[_0x66c7('0x23')];var _0x205b7e=_0x2af0a3?_0x2ef6a2[_0x66c7('0x24')]:_0x2bb86d[_0x66c7('0x23')]+_0x2bb86d[_0x66c7('0x25')];var _0x570f0d;if(_0x205b7e>=_0x542ff1){_0x205b7e=_0x542ff1;_0x570f0d=0xc8;}else{_0x570f0d=0xce;}_0x11a6b9[_0x66c7('0x1f')](_0x570f0d);return _0x11a6b9[_0x66c7('0x26')](_0x66c7('0x27'),_0x9afd50+'-'+_0x205b7e+'/'+_0x542ff1)[_0x66c7('0x21')](_0x2ef6a2);}return null;};}function saveUpdates(_0x2042ea){return function(_0x592f0e){if(_0x592f0e){return _0x592f0e[_0x66c7('0x28')](_0x2042ea)['then'](function(_0xfbd97){return _0xfbd97;});}return null;};}function removeEntity(_0x543fbf){return function(_0x296875){if(_0x296875){return _0x296875[_0x66c7('0x29')]()[_0x66c7('0x14')](function(){_0x543fbf[_0x66c7('0x1f')](0xcc)[_0x66c7('0x20')]();});}};}function handleEntityNotFound(_0x24e776){return function(_0x559ab9){if(!_0x559ab9){_0x24e776['sendStatus'](0x194);}return _0x559ab9;};}function handleError(_0x367e49,_0x12e7c6){_0x12e7c6=_0x12e7c6||0x1f4;return function(_0x827cbc){logger[_0x66c7('0x19')](_0x827cbc[_0x66c7('0x2a')]);if(_0x827cbc[_0x66c7('0x2b')]){delete _0x827cbc[_0x66c7('0x2b')];}_0x367e49[_0x66c7('0x1f')](_0x12e7c6)[_0x66c7('0x2c')](_0x827cbc);};}function getMustacheRender(_0x301495,_0x1fd460){return Mustache[_0x66c7('0x2d')](_0x301495,_['merge'](_0x1fd460['body'],{'contact':_0x1fd460[_0x66c7('0x2e')],'message':_0x1fd460[_0x66c7('0x1a')],'agent':_0x1fd460[_0x66c7('0x2f')],'interaction':_0x1fd460[_0x66c7('0x30')],'account':_0x1fd460[_0x66c7('0x31')]}))||'';}function getInteractionUsers(_0x2bf7c2,_0x21d0d3){return new BPromise(function(_0x5503c3,_0x30b90f){try{if(_0x21d0d3[_0x2bf7c2['id']]){_0x2bf7c2[_0x66c7('0x32')]=_[_0x66c7('0x33')](_0x21d0d3[_0x2bf7c2['id']],function(_0xd9e0f5){return{'id':_0xd9e0f5['id'],'fullname':_0xd9e0f5[_0x66c7('0x34')]};});}}catch(_0x324696){_0x30b90f(_0x324696);}_0x5503c3(_0x2bf7c2);});}function getInteractionTags(_0x3c8638,_0x2b3ac1){return new BPromise(function(_0x175ee7,_0x274c45){try{if(_0x3c8638[_0x66c7('0x35')]){_0x3c8638['Tags']=[];_0x3c8638['TagIds'][_0x66c7('0x36')](',')[_0x66c7('0x37')](function(_0xc63941){_0x3c8638['Tags']['push'](_0x2b3ac1[_0xc63941]);});}delete _0x3c8638[_0x66c7('0x35')];}catch(_0x96a1f5){_0x274c45(_0x96a1f5);}_0x175ee7(_0x3c8638);});}function updateChatInteraction(_0x501771,_0x2d98e4,_0x6e9796){return new BPromise(function(_0x34acf0,_0x51c92b){return getInteractionUsers(_0x501771,_0x6e9796)[_0x66c7('0x14')](function(_0x16b754){return getInteractionTags(_0x16b754,_0x2d98e4);})[_0x66c7('0x14')](function(_0x14d59c){return getStateInteraction(_0x14d59c);})[_0x66c7('0x14')](function(_0x1903fd){_0x34acf0(_0x1903fd);})[_0x66c7('0x1d')](function(_0x279d27){_0x51c92b(_0x279d27);});});}function getStateInteraction(_0x28ffe9){return new BPromise(function(_0x5f34ed){_0x28ffe9[_0x66c7('0x38')]=0x0;_0x28ffe9[_0x66c7('0x39')]=0x0;_0x28ffe9[_0x66c7('0x3a')]=0x0;_0x28ffe9[_0x66c7('0x3b')]=0x0;_0x28ffe9[_0x66c7('0x3c')]=0x0;_0x28ffe9[_0x66c7('0x3d')]=0x0;if(!_0x28ffe9[_0x66c7('0x3e')]&&!_0x28ffe9[_0x66c7('0x3f')]){_0x28ffe9[_0x66c7('0x38')]+=0x1;}if(!_0x28ffe9[_0x66c7('0x3e')]&&_0x28ffe9['UserId']){_0x28ffe9['talking']+=0x1;if(_0x28ffe9['waiting']){_0x28ffe9[_0x66c7('0x38')]-=0x1;}}if(_0x28ffe9[_0x66c7('0x3e')]&&_0x28ffe9['disposition']==='abandoned'){_0x28ffe9[_0x66c7('0x3c')]+=0x1;if(_0x28ffe9[_0x66c7('0x38')]){_0x28ffe9[_0x66c7('0x38')]-=0x1;}}else if(_0x28ffe9[_0x66c7('0x3e')]&&!_0x28ffe9[_0x66c7('0x3f')]&&_0x28ffe9['disposition']){_0x28ffe9[_0x66c7('0x3b')]+=0x1;if(_0x28ffe9['waiting']){_0x28ffe9['waiting']-=0x1;}}else if(_0x28ffe9[_0x66c7('0x3e')]&&_0x28ffe9[_0x66c7('0x3f')]){_0x28ffe9[_0x66c7('0x3a')]+=0x1;if(_0x28ffe9[_0x66c7('0x39')]){_0x28ffe9['talking']-=0x1;}}_0x28ffe9['total']+=0x1;_0x5f34ed(_0x28ffe9);});}exports[_0x66c7('0x40')]=function(_0x52506a,_0x4e0c89){var _0x1ec272={},_0x230f28={},_0x2b89e1={'count':0x0,'rows':[]};var _0x18408d=_['map'](db[_0x66c7('0x41')][_0x66c7('0x42')],function(_0x2c8ffe){return{'name':_0x2c8ffe['fieldName'],'type':_0x2c8ffe[_0x66c7('0x43')][_0x66c7('0x44')]};});_0x230f28[_0x66c7('0x45')]=_[_0x66c7('0x33')](_0x18408d,_0x66c7('0x2b'));_0x230f28[_0x66c7('0x46')]=_[_0x66c7('0x47')](_0x52506a[_0x66c7('0x46')]);_0x230f28['filters']=_[_0x66c7('0x48')](_0x230f28[_0x66c7('0x45')],_0x230f28[_0x66c7('0x46')]);_0x1ec272[_0x66c7('0x49')]=_[_0x66c7('0x48')](_0x230f28[_0x66c7('0x45')],qs[_0x66c7('0x4a')](_0x52506a[_0x66c7('0x46')][_0x66c7('0x4a')]));_0x1ec272[_0x66c7('0x49')]=_0x1ec272[_0x66c7('0x49')][_0x66c7('0x4b')]?_0x1ec272[_0x66c7('0x49')]:_0x230f28[_0x66c7('0x45')];if(!_0x52506a['query'][_0x66c7('0x4c')](_0x66c7('0x4d'))){_0x1ec272[_0x66c7('0x25')]=qs[_0x66c7('0x25')](_0x52506a['query'][_0x66c7('0x25')]);_0x1ec272[_0x66c7('0x23')]=qs['offset'](_0x52506a[_0x66c7('0x46')][_0x66c7('0x23')]);}_0x1ec272[_0x66c7('0x4e')]=qs[_0x66c7('0x4f')](_0x52506a[_0x66c7('0x46')][_0x66c7('0x4f')]);_0x1ec272[_0x66c7('0x50')]=qs['filters'](_[_0x66c7('0x51')](_0x52506a[_0x66c7('0x46')],_0x230f28['filters']),_0x18408d);var _0x127dfe=[];var _0x2617af=squel[_0x66c7('0x52')]()['field']('id')[_0x66c7('0x53')](_0x66c7('0x2b'))[_0x66c7('0x53')](_0x66c7('0x54'))[_0x66c7('0x55')](_0x66c7('0x56'));var _0x1d8313=squel[_0x66c7('0x52')]()['field'](_0x66c7('0x57'))[_0x66c7('0x53')]('u.fullname')[_0x66c7('0x53')](_0x66c7('0x58'))[_0x66c7('0x55')]('user_has_chat_interactions','ui')['left_join'](_0x66c7('0x59'),'u','u.id\x20=\x20ui.UserId');var _0x3c8fd9=squel[_0x66c7('0x52')]()[_0x66c7('0x55')](_0x66c7('0x5a'),'i')[_0x66c7('0x5b')](_0x66c7('0x5c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x66c7('0x59'),'o',_0x66c7('0x5d'))['left_join']('chat_websites','a',_0x66c7('0x5e'))['left_join'](_0x66c7('0x5f'),'me',_0x66c7('0x60'))[_0x66c7('0x5b')](_0x66c7('0x61'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x66c7('0x5b')](_0x66c7('0x56'),'t',_0x66c7('0x62'));var _0x2659f5=squel[_0x66c7('0x63')]();var _0x137c4f=[];var _0x4ec465=squel[_0x66c7('0x63')]();var _0x39c18e;if(_0x52506a[_0x66c7('0x46')]['search']){_0x39c18e=as[_0x66c7('0x64')](_0x52506a['query'][_0x66c7('0x65')]);var _0x45f5de=_0x39c18e[_0x66c7('0x66')];for(var _0x445af1=0x0;_0x445af1<_0x39c18e[_0x66c7('0x67')][_0x66c7('0x4b')];_0x445af1++){var _0x4b36d2=_0x39c18e[_0x66c7('0x67')][_0x445af1];var _0x2fc1c6='i';var _0x2d9069=_[_0x66c7('0x68')](_0x18408d,[_0x66c7('0x2b'),_0x4b36d2['field']]);if(!_0x2d9069){switch(_0x4b36d2[_0x66c7('0x53')]){case _0x66c7('0x69'):if(_0x4b36d2[_0x66c7('0x6a')]==0x1){_0x3c8fd9[_0x66c7('0x6b')]('`'+_0x4b36d2[_0x66c7('0x53')]+_0x66c7('0x6c'));}else{_0x3c8fd9[_0x66c7('0x6b')]('`'+_0x4b36d2[_0x66c7('0x53')]+_0x66c7('0x6d'));}break;case _0x66c7('0x6e'):if(_0x4b36d2[_0x66c7('0x6f')]===_0x66c7('0x70')){if(_0x4b36d2['value'][_0x66c7('0x36')]('\x20')[_0x66c7('0x4b')]>0x1){_0x2659f5[_0x45f5de](_0x66c7('0x71'),qs[_0x66c7('0x72')](_0x4b36d2[_0x66c7('0x6a')]),null);}else{var _0x419b49='%'+_0x4b36d2[_0x66c7('0x6a')]+'%';_0x2659f5[_0x45f5de]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x419b49,_0x419b49,_0x419b49);}}else{_0x2d9069=_[_0x66c7('0x68')](_0x18408d,[_0x66c7('0x2b'),_0x66c7('0x73')]);_0x4b36d2[_0x66c7('0x53')]=_0x66c7('0x73');_0xd0f389=as[_0x66c7('0x74')](_0x2fc1c6,_0x2d9069[_0x66c7('0x43')],_0x4b36d2);_0x2659f5[_0x45f5de](_0xd0f389[_0x66c7('0x75')],_0xd0f389[_0x66c7('0x6a')][_0x66c7('0x76')],_0xd0f389[_0x66c7('0x6a')][_0x66c7('0x20')]);}break;case _0x66c7('0x77'):var _0x1112ec=_0x4b36d2[_0x66c7('0x6a')][_0x66c7('0x36')](',')['map'](function(_0x16d404){return Number(_0x16d404);});_0x1112ec[_0x66c7('0x37')](function(_0x43a623){_0x4ec465['or'](_0x66c7('0x78'),'%,'+_0x43a623+',%');});_0x137c4f=_[_0x66c7('0x79')](_0x137c4f,_0x1112ec);break;case _0x66c7('0x7a'):if(_0x4b36d2[_0x66c7('0x6f')]===_0x66c7('0x70')){_0x2659f5[_0x45f5de](_0x66c7('0x7b'),'%'+_0x4b36d2[_0x66c7('0x6a')]+'%',null);}else{_0x2d9069=_[_0x66c7('0x68')](_0x18408d,[_0x66c7('0x2b'),_0x66c7('0x3f')]);_0x4b36d2[_0x66c7('0x53')]=_0x66c7('0x3f');_0xd0f389=as[_0x66c7('0x74')](_0x2fc1c6,_0x2d9069[_0x66c7('0x43')],_0x4b36d2);_0x2659f5[_0x45f5de](_0xd0f389['text'],_0xd0f389[_0x66c7('0x6a')][_0x66c7('0x76')],_0xd0f389[_0x66c7('0x6a')][_0x66c7('0x20')]);}break;case _0x66c7('0x7c'):_0xd0f389=as[_0x66c7('0x74')]('me',null,_0x4b36d2);_0x2659f5[_0x45f5de](_0xd0f389['text'],_0xd0f389['value'][_0x66c7('0x76')],_0xd0f389['value'][_0x66c7('0x20')]);break;}}else{var _0xd0f389=as[_0x66c7('0x74')](_0x2fc1c6,_0x2d9069[_0x66c7('0x43')],_0x4b36d2);_0x2659f5[_0x45f5de](_0xd0f389[_0x66c7('0x75')],_0xd0f389[_0x66c7('0x6a')][_0x66c7('0x76')],_0xd0f389[_0x66c7('0x6a')][_0x66c7('0x20')]);}}}else{var _0x35ad88=_(_0x52506a[_0x66c7('0x46')])[_0x66c7('0x47')]()['map'](function(_0x25f193){return _[_0x66c7('0x7d')](_0x18408d,[_0x66c7('0x2b'),_0x25f193])?_0x25f193:undefined;})[_0x66c7('0x7e')]()['value']();if(!_[_0x66c7('0x7f')](_0x35ad88)){_0x35ad88[_0x66c7('0x37')](function(_0x4e0a54){if(_0x4e0a54===_0x66c7('0x80')){_0x3c8fd9[_0x66c7('0x50')](_0x66c7('0x81'),[][_0x66c7('0x82')](_0x52506a[_0x66c7('0x46')][_0x4e0a54]));}else if(_0x4e0a54===_0x66c7('0x83')){var _0x580212=JSON['parse'](_0x52506a[_0x66c7('0x46')][_0x4e0a54])['$gte'];var _0x570a63=JSON[_0x66c7('0x84')](_0x52506a[_0x66c7('0x46')][_0x4e0a54])[_0x66c7('0x85')];_0x3c8fd9[_0x66c7('0x50')](_0x66c7('0x86'),_0x580212,_0x570a63);}else{if(_0x52506a[_0x66c7('0x46')][_0x4e0a54]===_0x66c7('0x87')){_0x3c8fd9[_0x66c7('0x50')]('i.'+_0x4e0a54+'\x20IS\x20NULL');}else{_0x3c8fd9[_0x66c7('0x50')]('i.'+_0x4e0a54+_0x66c7('0x88'),_0x52506a[_0x66c7('0x46')][_0x4e0a54]);}}});}if(_0x52506a[_0x66c7('0x46')][_0x66c7('0x89')]){if(_0x52506a[_0x66c7('0x46')][_0x66c7('0x89')]==0x1){_0x3c8fd9[_0x66c7('0x6b')](_0x66c7('0x8a'));}else{_0x3c8fd9[_0x66c7('0x6b')](_0x66c7('0x8b'));}}if(_0x52506a[_0x66c7('0x46')][_0x66c7('0x8c')]){_0x137c4f=_[_0x66c7('0x8d')](_0x52506a[_0x66c7('0x46')][_0x66c7('0x8c')])?_0x52506a[_0x66c7('0x46')][_0x66c7('0x8c')]:new Array(_0x52506a[_0x66c7('0x46')][_0x66c7('0x8c')]);_0x137c4f[_0x66c7('0x37')](function(_0x379dc4){_0x4ec465['or'](_0x66c7('0x78'),'%,'+_0x379dc4+',%');});}if(_0x52506a[_0x66c7('0x46')][_0x66c7('0x8e')]){var _0x46d569=_0x52506a[_0x66c7('0x46')]['filter'][_0x66c7('0x8f')]('\x5c','\x5c\x5c')[_0x66c7('0x8f')](/'/g,'\x27\x27');if(qs[_0x66c7('0x90')](_0x46d569)){_0x2659f5['or']('i.id\x20LIKE\x20?',_0x46d569+'%');}else{_0x2659f5['or'](_0x66c7('0x91'),qs[_0x66c7('0x72')](_0x46d569))['or'](_0x66c7('0x92'),_0x46d569+'%');}}}_0x3c8fd9['where'](_0x2659f5);_0x3c8fd9[_0x66c7('0x93')](_0x66c7('0x94'));var _0x3abd74={'type':db['Sequelize'][_0x66c7('0x95')][_0x66c7('0x96')],'raw':!![]};var _0x280cdc=_0x3c8fd9[_0x66c7('0x97')]();_0x280cdc['field'](_0x66c7('0x94'));_0x280cdc[_0x66c7('0x53')](_0x66c7('0x98'),_0x66c7('0x69'));if(_0x1ec272['order']){_0x1ec272['order'][_0x66c7('0x37')](function(_0x2f3f75){var _0x45ccdf=_0x2f3f75[0x0]===_0x66c7('0x99')?_0x2f3f75[0x0]:'i.'+_0x2f3f75[0x0];_0x3c8fd9[_0x66c7('0x4e')](_0x45ccdf,_0x2f3f75[0x1]==='DESC'?![]:!![]);});}if(!_[_0x66c7('0x7f')](_0x137c4f)){_0x3c8fd9[_0x66c7('0x6b')](_0x4ec465);_0x280cdc[_0x66c7('0x50')](_0x66c7('0x9a'),_0x137c4f);}BPromise[_0x66c7('0x9b')]()['then'](function(){if(!_0x39c18e){if(_0x52506a[_0x66c7('0x46')][_0x66c7('0x80')])return;_0x280cdc[_0x66c7('0x50')](_0x66c7('0x9c'));_0x3c8fd9[_0x66c7('0x50')](_0x66c7('0x9c'));return;}if(_0x52506a[_0x66c7('0x9d')][_0x66c7('0x9e')]!=='agent')return;return _0x52506a[_0x66c7('0x9d')][_0x66c7('0x9f')]({'attributes':['id'],'raw':!![]})[_0x66c7('0x14')](function(_0x574e42){if(_[_0x66c7('0x7f')](_0x574e42)){_0x280cdc[_0x66c7('0x50')](_0x66c7('0xa0'));_0x3c8fd9[_0x66c7('0x50')](_0x66c7('0xa0'));}else{_0x280cdc[_0x66c7('0x50')](_0x66c7('0x81'),_[_0x66c7('0x33')](_0x574e42,'id'));_0x3c8fd9['where'](_0x66c7('0x81'),_[_0x66c7('0x33')](_0x574e42,'id'));}});})[_0x66c7('0x14')](function(){if(_0x52506a[_0x66c7('0x9d')][_0x66c7('0x9e')]===_0x66c7('0x2f')&&!_0x39c18e&&!_0x52506a['query'][_0x66c7('0x80')])return[];return db[_0x66c7('0xa1')][_0x66c7('0x46')](_0x280cdc[_0x66c7('0xa2')](),_0x3abd74);})[_0x66c7('0x14')](function(_0x14608f){_0x2b89e1[_0x66c7('0x24')]=_0x14608f[_0x66c7('0x4b')];if(_0x2b89e1['count']===0x0)return[];return db[_0x66c7('0xa1')][_0x66c7('0x46')](_0x2617af[_0x66c7('0xa2')](),_0x3abd74)['then'](function(_0x176d9d){_0x127dfe=_[_0x66c7('0xa3')](_0x176d9d,'id');_0x3abd74=_[_0x66c7('0xa4')](_0x3abd74,{'model':db[_0x66c7('0x41')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x52506a[_0x66c7('0x46')][_0x66c7('0x4a')]){_0x1ec272[_0x66c7('0x49')]['forEach'](function(_0x315996){_0x3c8fd9['field']('i.'+_0x315996);});}else{_0x3c8fd9['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x3c8fd9[_0x66c7('0x53')](_0x66c7('0xa5'),'Account.key');_0x3c8fd9['field'](_0x66c7('0xa6'),_0x66c7('0xa7'));_0x3c8fd9['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x66c7('0x99'));_0x3c8fd9['field']('i.*');_0x3c8fd9[_0x66c7('0x53')](_0x66c7('0xa8'),'Contact.firstName');_0x3c8fd9[_0x66c7('0x53')](_0x66c7('0xa9'),_0x66c7('0xaa'));_0x3c8fd9[_0x66c7('0x53')](_0x66c7('0xab'),_0x66c7('0xac'));_0x3c8fd9[_0x66c7('0x53')](_0x66c7('0xad'),_0x66c7('0xae'));_0x3c8fd9['field'](_0x66c7('0xaf'),'Contact.mobile');_0x3c8fd9[_0x66c7('0x53')](_0x66c7('0xb0'),'Contact.fax');_0x3c8fd9[_0x66c7('0x53')](_0x66c7('0xb1'),_0x66c7('0xb2'));_0x3c8fd9[_0x66c7('0x53')](_0x66c7('0xb3'),'Owner.internal');_0x3c8fd9[_0x66c7('0x53')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x66c7('0x35'));}if(_0x1ec272[_0x66c7('0x25')])_0x3c8fd9[_0x66c7('0x25')](_0x1ec272[_0x66c7('0x25')]);if(_0x1ec272[_0x66c7('0x23')])_0x3c8fd9[_0x66c7('0x23')](_0x1ec272[_0x66c7('0x23')]);return db['sequelize']['query'](_0x3c8fd9[_0x66c7('0xa2')](),_0x3abd74);})['then'](function(_0x4daa4e){if(_0x4daa4e['length']>0x0)_0x1d8313[_0x66c7('0x50')]('ui.ChatInteractionId\x20IN\x20?',_[_0x66c7('0x33')](_0x4daa4e,'id'));return db[_0x66c7('0xa1')][_0x66c7('0x46')](_0x1d8313['toString'](),_0x3abd74)[_0x66c7('0x14')](function(_0x5376d7){var _0x18f1d6=_['groupBy'](_0x5376d7,_0x66c7('0xb4'));var _0x248b31=[];_0x4daa4e[_0x66c7('0x37')](function(_0x3c8c2b){_0x248b31[_0x66c7('0xb5')](updateChatInteraction(_0x3c8c2b,_0x127dfe,_0x18f1d6));});return BPromise[_0x66c7('0xb6')](_0x248b31);});});})[_0x66c7('0x14')](function(_0x488f98){_0x2b89e1[_0x66c7('0xb7')]=_0x488f98;return _0x2b89e1;})['then'](respondWithFilteredResult(_0x4e0c89,_0x1ec272))['catch'](handleError(_0x4e0c89,null));};exports[_0x66c7('0xb8')]=function(_0xa18dfb,_0x12ee9f){var _0x44bbf2={'raw':![],'where':{'id':_0xa18dfb[_0x66c7('0xb9')]['id']}},_0x2cecc4={};_0x2cecc4[_0x66c7('0x45')]=_[_0x66c7('0x47')](db[_0x66c7('0x41')][_0x66c7('0x42')]);_0x2cecc4[_0x66c7('0x46')]=_[_0x66c7('0x47')](_0xa18dfb[_0x66c7('0x46')]);_0x2cecc4['filters']=_[_0x66c7('0x48')](_0x2cecc4['model'],_0x2cecc4[_0x66c7('0x46')]);_0x44bbf2[_0x66c7('0x49')]=_[_0x66c7('0x48')](_0x2cecc4[_0x66c7('0x45')],qs[_0x66c7('0x4a')](_0xa18dfb[_0x66c7('0x46')]['fields']));_0x44bbf2['attributes']=_0x44bbf2['attributes']['length']?_0x44bbf2['attributes']:_0x2cecc4[_0x66c7('0x45')];if(_0xa18dfb[_0x66c7('0x46')][_0x66c7('0xba')]){_0x44bbf2[_0x66c7('0xbb')]=[{'all':!![]}];}_0x44bbf2=_['merge']({},_0x44bbf2,_0xa18dfb['options']);return db[_0x66c7('0x41')][_0x66c7('0x68')](_0x44bbf2)['then'](handleEntityNotFound(_0x12ee9f,null))[_0x66c7('0x14')](respondWithResult(_0x12ee9f,null))[_0x66c7('0x1d')](handleError(_0x12ee9f,null));};exports['create']=function(_0x16965c,_0x2dfe01){return db[_0x66c7('0x41')][_0x66c7('0xbc')](_0x16965c['body'],{})['then'](respondWithResult(_0x2dfe01,0xc9))[_0x66c7('0x1d')](handleError(_0x2dfe01,null));};exports[_0x66c7('0x28')]=function(_0x433ce2,_0x221d44){if(_0x433ce2[_0x66c7('0x7c')]['id']){delete _0x433ce2[_0x66c7('0x7c')]['id'];}return db[_0x66c7('0x41')][_0x66c7('0x68')]({'where':{'id':_0x433ce2[_0x66c7('0xb9')]['id']}})[_0x66c7('0x14')](handleEntityNotFound(_0x221d44,null))['then'](saveUpdates(_0x433ce2[_0x66c7('0x7c')],null))[_0x66c7('0x14')](respondWithResult(_0x221d44,null))[_0x66c7('0x1d')](handleError(_0x221d44,null));};exports[_0x66c7('0x29')]=function(_0xbe4285,_0x3fb5eb){return db[_0x66c7('0x41')][_0x66c7('0x68')]({'where':{'id':_0xbe4285[_0x66c7('0xb9')]['id']}})[_0x66c7('0x14')](handleEntityNotFound(_0x3fb5eb,null))['then'](removeEntity(_0x3fb5eb,null))[_0x66c7('0x1d')](handleError(_0x3fb5eb,null));};exports[_0x66c7('0xbd')]=function(_0x140a3d,_0x42ef4c){return db[_0x66c7('0x41')][_0x66c7('0xbd')]()[_0x66c7('0x14')](respondWithResult(_0x42ef4c,null))[_0x66c7('0x1d')](handleError(_0x42ef4c,null));};exports['createVidaooSession']=function(_0x18c58a,_0x2bac63){var _0x4377f1=_0x18c58a[_0x66c7('0xb9')]['id'];var _0x13477f;var _0x433147;var _0x1caa25;return db[_0x66c7('0x41')][_0x66c7('0xbe')]({'where':{'id':_0x4377f1}})[_0x66c7('0x14')](function(_0x3259b1){_0x13477f=_0x3259b1;return db[_0x66c7('0xbf')]['findOne']({'where':{'id':_0x3259b1['ChatWebsiteId']},'attributes':['id',_0x66c7('0xc0'),_0x66c7('0xc1'),_0x66c7('0xc2'),_0x66c7('0xc3'),_0x66c7('0xc4')],'raw':!![]});})[_0x66c7('0x14')](function(_0x39fc6a){if(_0x39fc6a&&_0x39fc6a[_0x66c7('0xc0')]&&_0x39fc6a['vidaooEscalation']){_0x433147=_0x39fc6a;var _0xafdef8={'interaction':{'id':_0x4377f1},'agent':{'id':_0x18c58a[_0x66c7('0x9d')]['id'],'name':_0x18c58a['user'][_0x66c7('0x2b')],'fullname':_0x18c58a[_0x66c7('0x9d')][_0x66c7('0x34')],'email':_0x18c58a[_0x66c7('0x9d')]['email']},'contact':_0x18c58a[_0x66c7('0x7c')][_0x66c7('0x2e')],'account':_0x18c58a[_0x66c7('0x7c')][_0x66c7('0x31')]};var _0x582e85={'rejectUnauthorized':![],'method':'POST','url':_0x66c7('0xc5'),'headers':{'X-APIKEY':_0x39fc6a[_0x66c7('0xc0')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x18c58a[_0x66c7('0x9d')][_0x66c7('0xc6')]],'buttons':null,'topic':_0x433147[_0x66c7('0xc2')],'note':_[_0x66c7('0xc7')](_0x433147['vidaooNote'])?null:getMustacheRender(_0x433147[_0x66c7('0xc3')],_0xafdef8),'metadata':null},'redirect':_0x66c7('0xc8'),'json':!![]};try{if(!_[_0x66c7('0xc7')](_0x433147[_0x66c7('0xc4')])){var _0x4f9ac5=getMustacheRender(_0x433147[_0x66c7('0xc4')],_0xafdef8);var _0x4b01ee=JSON[_0x66c7('0x84')](_0x4f9ac5);_0x582e85['body']['metadata']=_0x4b01ee;}}catch(_0x1e8fb4){throw new db[(_0x66c7('0xc9'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x582e85);}else{throw new db[(_0x66c7('0xc9'))]['ValidationError'](_0x66c7('0xca'));}})[_0x66c7('0x14')](function(_0x2358e9){_0x1caa25=_0x2358e9;if(_0x1caa25['id']){var _0xba7a89={'body':_0x1caa25['join_url'],'ChatWebsiteId':_0x433147['id'],'ChatInteractionId':_0x13477f['id'],'direction':_0x66c7('0xcb'),'UserId':_0x18c58a[_0x66c7('0x9d')]['id']};return db[_0x66c7('0xcc')][_0x66c7('0xbc')](_0xba7a89,{});}else{throw new db[(_0x66c7('0xc9'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x66c7('0x14')](function(){return _0x13477f[_0x66c7('0xcd')]({'vidaooSessionId':_0x1caa25['id']});})[_0x66c7('0x14')](respondWithResult(_0x2bac63,null))[_0x66c7('0x1d')](handleError(_0x2bac63,null));};exports[_0x66c7('0xce')]=function(_0x501a80,_0x290fcc){if(_0x501a80[_0x66c7('0x7c')]['id']){delete _0x501a80[_0x66c7('0x7c')]['id'];}return db[_0x66c7('0x41')][_0x66c7('0x68')]({'where':{'id':_0x501a80['params']['id']},'include':[{'model':db['CmContact'],'as':_0x66c7('0x6e')}]})[_0x66c7('0x14')](handleEntityNotFound(_0x290fcc,null))['then'](saveUpdates(_0x501a80[_0x66c7('0x7c')],null))['then'](respondWithResult(_0x290fcc,null))[_0x66c7('0x1d')](handleError(_0x290fcc,null));};exports[_0x66c7('0xcf')]=function(_0x38afc7,_0x4dc210){if(_0x38afc7[_0x66c7('0x7c')]['id']){delete _0x38afc7['body']['id'];}return db[_0x66c7('0x41')]['find']({'where':{'id':_0x38afc7[_0x66c7('0xb9')]['id']}})[_0x66c7('0x14')](function(_0x201893){if(!_0x201893){logger[_0x66c7('0x19')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x66c7('0xcf'),0x194,_0x66c7('0xd0'));_0x4dc210['sendStatus'](0x194);}else{if(_0x201893[_0x66c7('0x3f')]){throw new db[(_0x66c7('0xc9'))]['ValidationError'](_0x66c7('0xd1'));}}return _0x201893;})[_0x66c7('0x14')](function(_0x4aadc8){if(_0x4aadc8){return _0x4aadc8[_0x66c7('0x28')]({'closed':_0x38afc7['body']['closed'],'disposition':_0x38afc7[_0x66c7('0x7c')]['disposition']})[_0x66c7('0x14')](function(_0x276cf8){return _0x276cf8;});}})['then'](function(){return respondWithRpcPromise(_0x66c7('0xd2'),'abandon',_0x38afc7[_0x66c7('0x7c')],client9004);})[_0x66c7('0x14')](respondWithResult(_0x4dc210,null))[_0x66c7('0x1d')](handleError(_0x4dc210,null));};exports[_0x66c7('0xd3')]=function(_0x54759e,_0x55781b){_0x54759e[_0x66c7('0x7c')]['name']=_0x54759e[_0x66c7('0xd4')][_0x66c7('0xd5')];_0x54759e[_0x66c7('0x7c')][_0x66c7('0xd6')]=_0x54759e[_0x66c7('0xd4')][_0x66c7('0xd7')];_0x54759e[_0x66c7('0x7c')][_0x66c7('0x43')]=_0x54759e[_0x66c7('0xd4')][_0x66c7('0xd8')];return db[_0x66c7('0xd9')][_0x66c7('0xbc')](_0x54759e[_0x66c7('0x7c')])[_0x66c7('0x14')](respondWithResult(_0x55781b,0xc9))[_0x66c7('0x1d')](handleError(_0x55781b,null));};exports[_0x66c7('0xda')]=function(_0x51f2c8,_0x2f74b6){return db['ChatInteraction']['findOne']({'where':{'id':_0x51f2c8[_0x66c7('0xb9')]['id']},'raw':!![]})[_0x66c7('0x14')](handleEntityNotFound(_0x2f74b6,null))['then'](function(_0x1ad31b){if(_0x1ad31b){if(_0x1ad31b[_0x66c7('0x3e')]){return _0x2f74b6[_0x66c7('0x1f')](0x193)[_0x66c7('0x21')]({'status':0x193,'message':_0x66c7('0xdb')});}return db['Attachment'][_0x66c7('0xbe')]({'where':{'id':_0x51f2c8[_0x66c7('0x46')][_0x66c7('0xdc')]},'raw':!![]})[_0x66c7('0x14')](handleEntityNotFound(_0x2f74b6,null));}})[_0x66c7('0x14')](function(_0x1b677c){if(_0x1b677c){var _0x53a34c=_0x1b677c[_0x66c7('0xdd')]!==null;var _0x598212=path[_0x66c7('0xde')](config['root'],_0x66c7('0xdf'));if(_0x53a34c){_0x598212=path[_0x66c7('0xde')](_0x598212,_0x66c7('0xe0'));}var _0x1f3b38=path[_0x66c7('0xde')](_0x598212,_0x1b677c['basename']);return _0x2f74b6[_0x66c7('0xe1')](_0x1f3b38);}})[_0x66c7('0x1d')](handleError(_0x2f74b6,null));};exports[_0x66c7('0xe2')]=function(_0x56c2ca,_0x22e8f7){var _0x511029=null;var _0x1dcadb=null;var _0x37aace=null;if(_0x56c2ca['body']['id']){delete _0x56c2ca[_0x66c7('0x7c')]['id'];}if(_0x56c2ca[_0x66c7('0x7c')][_0x66c7('0xe3')]){_0x37aace=path['join'](config[_0x66c7('0xe4')],_0x66c7('0xe5'),util[_0x66c7('0xe6')]('transcript-%s.txt',Date['now']()));_0x56c2ca[_0x66c7('0x7c')]['pathTranscript']=_0x37aace;}return db[_0x66c7('0x41')][_0x66c7('0x68')]({'where':{'id':_0x56c2ca['params']['id']},'include':[{'model':db[_0x66c7('0xcc')],'as':'Messages','include':[{'model':db['User'],'as':_0x66c7('0x7a')}]}]})[_0x66c7('0x14')](handleEntityNotFound(_0x22e8f7,null))[_0x66c7('0x14')](saveUpdates(_0x56c2ca['body'],null))[_0x66c7('0x14')](function(_0x3fff74){if(_0x3fff74){_0x511029=_0x3fff74;return db[_0x66c7('0xbf')][_0x66c7('0x68')]({'where':{'id':_0x511029[_0x66c7('0x80')]}});}})['then'](function(_0x2ce2c2){if(_0x2ce2c2){_0x1dcadb=_0x2ce2c2;return db[_0x66c7('0xe7')][_0x66c7('0x68')]({'where':{'id':_0x511029['ContactId']}});}})[_0x66c7('0x14')](function(_0x5d6306){if(_0x5d6306){if(_0x37aace){var _0x42119f=null;for(var _0x26894a=0x1;_0x26894a<_0x511029[_0x66c7('0xe8')][_0x66c7('0x4b')];++_0x26894a){_0x42119f=_0x511029[_0x66c7('0xe8')][_0x26894a];var _0x21b78a=_0x42119f['UserId']?util[_0x66c7('0xe6')](_0x66c7('0xe9'),_0x1dcadb['agentAlias'],_0x42119f[_0x66c7('0x3f')]):_0x66c7('0xea');var _0x196ae=_0x56c2ca[_0x66c7('0x7c')]['customer']||util[_0x66c7('0xe6')](_0x66c7('0xe9'),'Visitor',_0x42119f['ContactId']);switch(_0x1dcadb['agentIdentifier']){case _0x66c7('0xeb'):_0x21b78a=_0x42119f[_0x66c7('0x3f')]?util[_0x66c7('0xe6')](_0x66c7('0xe9'),_0x1dcadb[_0x66c7('0xec')],_0x42119f[_0x66c7('0x3f')]):'System';break;case _0x66c7('0xed'):_0x21b78a=_0x42119f[_0x66c7('0x3f')]?_0x42119f[_0x66c7('0x7a')][_0x66c7('0xee')]||_0x42119f[_0x66c7('0x7a')][_0x66c7('0x34')]:_0x66c7('0xea');break;case'agent_fullname':_0x21b78a=_0x42119f[_0x66c7('0x3f')]?_0x42119f['User'][_0x66c7('0x34')]:_0x66c7('0xea');break;default:_0x21b78a=_0x42119f['UserId']?util[_0x66c7('0xe6')](_0x66c7('0xe9'),_0x1dcadb[_0x66c7('0xec')],_0x42119f['UserId']):_0x66c7('0xea');}var _0x1c1023=util[_0x66c7('0xe6')](_0x66c7('0xef'),moment(_0x42119f[_0x66c7('0x83')])['format'](_0x66c7('0xf0')),_0x42119f[_0x66c7('0xf1')]==='in'?_0x196ae:_0x21b78a,_0x42119f[_0x66c7('0x7c')]);if(!_0x42119f[_0x66c7('0xf2')]){fs['appendFileSync'](_0x37aace,_0x1c1023);}}return db[_0x66c7('0xf3')][_0x66c7('0xbe')]({'where':{'service':!![]},'include':[{'model':db[_0x66c7('0xf4')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x66c7('0xf5'),'raw':!![]}]}]});}}})[_0x66c7('0x14')](function(_0x2a5aa1){if(!_0x2a5aa1||!_0x2a5aa1[_0x66c7('0xf6')]||!_0x56c2ca[_0x66c7('0x7c')])return _0x511029;var _0x8401b2=_0x2a5aa1[_0x66c7('0xf7')]();return respondWithRpcPromise(_0x66c7('0xf8'),_0x66c7('0xf9'),{'account':_0x8401b2,'message':{'from':util[_0x66c7('0xe6')]('\x22%s\x22\x20<%s>',_0x2a5aa1['name'],_0x2a5aa1[_0x66c7('0xc6')]||_0x2a5aa1[_0x66c7('0xf6')][_0x66c7('0x9d')]),'to':_0x56c2ca[_0x66c7('0x7c')][_0x66c7('0xe3')],'subject':_0x66c7('0xfa'),'text':util[_0x66c7('0xe6')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x56c2ca['body'][_0x66c7('0xe3')]),'attachments':[{'path':_0x37aace}]}})[_0x66c7('0x14')](function(){return _0x511029;})[_0x66c7('0x1d')](function(_0xb53a79){logger[_0x66c7('0x19')](_0xb53a79);});})[_0x66c7('0x14')](respondWithStatusCode(_0x22e8f7,0xc8))[_0x66c7('0x1d')](handleError(_0x22e8f7,null));};exports['addMessage']=function(_0x90a5c0,_0x471565){return db[_0x66c7('0xcc')][_0x66c7('0x68')]({'where':{'id':_0x90a5c0[_0x66c7('0xb9')]['id']}})[_0x66c7('0x14')](handleEntityNotFound(_0x471565,null))[_0x66c7('0x14')](function(_0x1ab91c){if(_0x1ab91c){return _0x1ab91c[_0x66c7('0xfb')](_0x90a5c0['body'][_0x66c7('0xfc')],_[_0x66c7('0xfd')](_0x90a5c0['body'],[_0x66c7('0xfc'),'id'])||{});}})[_0x66c7('0x14')](respondWithResult(_0x471565,null))[_0x66c7('0x1d')](handleError(_0x471565,null));};exports[_0x66c7('0xfe')]=function(_0x3cbabe,_0x17389b){var _0x51beee={'raw':![],'where':{}};var _0x21681e={};var _0x4fe200={'count':0x0,'rows':[]};return db[_0x66c7('0x41')][_0x66c7('0xbe')]({'where':{'id':_0x3cbabe[_0x66c7('0xb9')]['id']}})[_0x66c7('0x14')](handleEntityNotFound(_0x17389b,null))[_0x66c7('0x14')](function(_0x4ca682){if(_0x4ca682){_0x21681e[_0x66c7('0x45')]=_[_0x66c7('0x47')](db[_0x66c7('0xcc')][_0x66c7('0x42')]);_0x21681e[_0x66c7('0x46')]=_['keys'](_0x3cbabe[_0x66c7('0x46')]);_0x21681e[_0x66c7('0xff')]=_[_0x66c7('0x48')](_0x21681e['model'],_0x21681e[_0x66c7('0x46')]);_0x51beee[_0x66c7('0x49')]=_[_0x66c7('0x48')](_0x21681e[_0x66c7('0x45')],qs[_0x66c7('0x4a')](_0x3cbabe[_0x66c7('0x46')][_0x66c7('0x4a')]));_0x51beee['attributes']=_0x51beee[_0x66c7('0x49')][_0x66c7('0x4b')]?_0x51beee[_0x66c7('0x49')]:_0x21681e[_0x66c7('0x45')];if(!_0x3cbabe[_0x66c7('0x46')]['hasOwnProperty']('nolimit')){_0x51beee[_0x66c7('0x25')]=qs[_0x66c7('0x25')](_0x3cbabe[_0x66c7('0x46')]['limit']);_0x51beee[_0x66c7('0x23')]=qs[_0x66c7('0x23')](_0x3cbabe[_0x66c7('0x46')][_0x66c7('0x23')]);}_0x51beee[_0x66c7('0x4e')]=qs[_0x66c7('0x4f')](_0x3cbabe[_0x66c7('0x46')]['sort']);_0x51beee['where']=qs[_0x66c7('0xff')](_[_0x66c7('0x51')](_0x3cbabe['query'],_0x21681e[_0x66c7('0xff')]));_0x51beee[_0x66c7('0x50')][_0x66c7('0xb4')]=_0x4ca682['id'];if(_0x3cbabe[_0x66c7('0x46')]['filter']){_0x51beee[_0x66c7('0x50')]=_[_0x66c7('0xa4')](_0x51beee['where'],{'$or':_[_0x66c7('0x33')](_0x51beee[_0x66c7('0x49')],function(_0x3c1430){var _0x4b54ed={};_0x4b54ed[_0x3c1430]={'$like':'%'+_0x3cbabe[_0x66c7('0x46')]['filter']+'%'};return _0x4b54ed;})});}if(_0x3cbabe['query'][_0x66c7('0x100')]){var _0x3cff4f=_0x3cbabe[_0x66c7('0x46')][_0x66c7('0x100')][_0x66c7('0x36')](',');var _0x24eb7f={};_0x24eb7f[_0x3cff4f[0x0]]={'$gte':moment(_0x3cff4f[0x1])[_0x66c7('0xe6')](_0x66c7('0x101'))};_0x51beee[_0x66c7('0x50')]=_[_0x66c7('0xa4')](_0x51beee[_0x66c7('0x50')],_0x24eb7f);}_0x51beee=_[_0x66c7('0xa4')]({},_0x51beee,_0x3cbabe[_0x66c7('0x102')]);return db['ChatMessage'][_0x66c7('0x24')]({'where':_0x51beee[_0x66c7('0x50')]})[_0x66c7('0x14')](function(_0x34a021){_0x4fe200[_0x66c7('0x24')]=_0x34a021;if(_0x3cbabe[_0x66c7('0x46')][_0x66c7('0xba')]){_0x51beee['include']=[{'all':!![]}];}return db[_0x66c7('0xcc')][_0x66c7('0x103')](_0x51beee);})[_0x66c7('0x14')](function(_0x11f42d){_0x4fe200[_0x66c7('0xb7')]=_0x11f42d;return _0x4fe200;});}})[_0x66c7('0x14')](respondWithFilteredResult(_0x17389b,_0x51beee))[_0x66c7('0x1d')](handleError(_0x17389b,null));};exports[_0x66c7('0x104')]=function(_0x3d4e33,_0x17cbe7){var _0x18ef7d={'where':{}},_0x4c877a={},_0x3e34ca={'count':0x0,'rows':[]};return db[_0x66c7('0x41')][_0x66c7('0xbe')]({'where':{'id':_0x3d4e33[_0x66c7('0xb9')]['id']}})[_0x66c7('0x14')](handleEntityNotFound(_0x17cbe7,null))[_0x66c7('0x14')](function(_0x555249){if(_0x555249){_0x4c877a[_0x66c7('0x45')]=_['keys'](db[_0x66c7('0xcc')][_0x66c7('0x42')]);_0x4c877a[_0x66c7('0x46')]=_[_0x66c7('0x47')](_0x3d4e33[_0x66c7('0x46')]);_0x4c877a[_0x66c7('0xff')]=_[_0x66c7('0x48')](_0x4c877a[_0x66c7('0x45')],_0x4c877a[_0x66c7('0x46')]);_0x18ef7d[_0x66c7('0x49')]=_[_0x66c7('0x48')](_0x4c877a[_0x66c7('0x45')],qs[_0x66c7('0x4a')](_0x3d4e33[_0x66c7('0x46')][_0x66c7('0x4a')]));_0x18ef7d['attributes']=_0x18ef7d['attributes'][_0x66c7('0x4b')]?_0x18ef7d['attributes']:_0x4c877a['model'];if(!_0x3d4e33['query'][_0x66c7('0x4c')]('nolimit')){_0x18ef7d['limit']=qs['limit'](_0x3d4e33['query']['limit']);_0x18ef7d[_0x66c7('0x23')]=qs[_0x66c7('0x23')](_0x3d4e33[_0x66c7('0x46')][_0x66c7('0x23')]);}_0x18ef7d[_0x66c7('0x4e')]=qs[_0x66c7('0x4f')](_0x3d4e33[_0x66c7('0x46')]['sort']);_0x18ef7d['where']=qs[_0x66c7('0xff')](_[_0x66c7('0x51')](_0x3d4e33[_0x66c7('0x46')],_0x4c877a[_0x66c7('0xff')]));_0x18ef7d[_0x66c7('0x50')][_0x66c7('0xb4')]=_0x555249['id'];if(_0x3d4e33[_0x66c7('0x46')]['filter']){_0x18ef7d[_0x66c7('0x50')]=_[_0x66c7('0xa4')](_0x18ef7d[_0x66c7('0x50')],{'$or':_[_0x66c7('0x33')](_0x18ef7d[_0x66c7('0x49')],function(_0x51cb7c){var _0x28dd5c={};_0x28dd5c[_0x51cb7c]={'$like':'%'+_0x3d4e33[_0x66c7('0x46')]['filter']+'%'};return _0x28dd5c;})});}_0x18ef7d[_0x66c7('0x50')][_0x66c7('0xf2')]=![];if(_0x3d4e33[_0x66c7('0x46')]['id']){_0x18ef7d[_0x66c7('0x50')]['id']={'$gt':_0x3d4e33[_0x66c7('0x46')]['id']};}_0x18ef7d=_['merge']({},_0x18ef7d,_0x3d4e33['options']);return db[_0x66c7('0xcc')]['count']({'where':_0x18ef7d[_0x66c7('0x50')]})[_0x66c7('0x14')](function(_0x4c707c){_0x3e34ca[_0x66c7('0x24')]=_0x4c707c;_0x18ef7d[_0x66c7('0xbb')]=[];if(_0x3d4e33[_0x66c7('0x46')][_0x66c7('0x105')]){_0x18ef7d['include'][_0x66c7('0xb5')]({'model':db[_0x66c7('0x7a')],'as':_0x66c7('0x7a'),'attributes':['id','fullname','alias']});}if(_0x3d4e33['query'][_0x66c7('0xba')]){_0x18ef7d[_0x66c7('0xbb')]=[{'all':!![]}];}return db['ChatMessage'][_0x66c7('0x103')](_0x18ef7d);})[_0x66c7('0x14')](function(_0x31158d){_0x3e34ca[_0x66c7('0xb7')]=_0x31158d;return _0x3e34ca;});}})[_0x66c7('0x14')](respondWithFilteredResult(_0x17cbe7,_0x18ef7d))[_0x66c7('0x1d')](handleError(_0x17cbe7,null));};exports[_0x66c7('0x106')]=function(_0x20babe,_0x25efcd){return db[_0x66c7('0x41')]['find']({'where':{'id':_0x20babe[_0x66c7('0xb9')]['id']}})[_0x66c7('0x14')](handleEntityNotFound(_0x25efcd,null))[_0x66c7('0x14')](function(_0x5745d1){if(_0x5745d1){return _0x5745d1[_0x66c7('0x107')](_0x20babe['body'][_0x66c7('0xfc')],_[_0x66c7('0xfd')](_0x20babe[_0x66c7('0x7c')],['ids','id'])||{})[_0x66c7('0x108')](function(){return db[_0x66c7('0x77')][_0x66c7('0x103')]({'attributes':['id','name',_0x66c7('0x54')],'where':{'id':_0x20babe[_0x66c7('0x7c')]['ids']}});})['then'](function(_0x16db46){socket['emit'](_0x66c7('0x109'),{'id':Number(_0x20babe[_0x66c7('0xb9')]['id']),'tags':_0x16db46||[]});return{'id':Number(_0x20babe[_0x66c7('0xb9')]['id']),'tags':_0x16db46||[]};});}})[_0x66c7('0x14')](respondWithResult(_0x25efcd,null))[_0x66c7('0x1d')](handleError(_0x25efcd,null));};exports[_0x66c7('0x10a')]=function(_0x36d836,_0x93b6a9){return db[_0x66c7('0x41')][_0x66c7('0x68')]({'where':{'id':_0x36d836['params']['id']}})['then'](handleEntityNotFound(_0x93b6a9,null))[_0x66c7('0x14')](function(_0x5c6101){if(_0x5c6101){return _0x5c6101['removeTags'](_0x36d836[_0x66c7('0x46')][_0x66c7('0xfc')]);}})[_0x66c7('0x14')](respondWithStatusCode(_0x93b6a9,null))[_0x66c7('0x1d')](handleError(_0x93b6a9,null));};exports[_0x66c7('0xe1')]=function(_0x321ea2,_0x29c394){var _0x2ab0b1=moment()['unix']()[_0x66c7('0xa2')]();var _0xbfa002=path[_0x66c7('0xde')](config[_0x66c7('0xe4')],_0x66c7('0x10b'),_0x66c7('0x10c'),_0x66c7('0x10d'));var _0x3761ba=path['join'](config[_0x66c7('0xe4')],_0x66c7('0x10b'),_0x66c7('0x10c'),'attachments');var _0x395cb3=path['join'](_0xbfa002,_0x2ab0b1);var _0x293766=util[_0x66c7('0xe6')](_0x66c7('0x10e'),_0x321ea2[_0x66c7('0xb9')]['id'],_0x2ab0b1);var _0x3625ea=path[_0x66c7('0xde')](_0xbfa002,_0x293766);var _0x47e832=[];_0x47e832[_0x66c7('0xb5')]({'model':db[_0x66c7('0x7a')],'as':_0x66c7('0x7a'),'attributes':['id',_0x66c7('0x34')],'raw':!![]});_0x47e832[_0x66c7('0xb5')]({'model':db[_0x66c7('0xe7')],'as':_0x66c7('0x6e'),'attributes':['id','firstName',_0x66c7('0x10f')],'raw':!![]});if(_0x321ea2[_0x66c7('0x46')][_0x66c7('0x110')]){_0x47e832[_0x66c7('0xb5')]({'model':db[_0x66c7('0xd9')],'as':_0x66c7('0xd9'),'raw':!![]});}var _0x46d1ba=[{'model':db[_0x66c7('0xcc')],'as':_0x66c7('0xe8'),'attributes':['id',_0x66c7('0x7c'),_0x66c7('0x83'),'direction',_0x66c7('0xf2'),'read'],'include':_0x47e832}];_0x46d1ba['push']({'model':db[_0x66c7('0xbf')],'as':_0x66c7('0x111'),'attributes':['id',_0x66c7('0x2b')]});_0x46d1ba[_0x66c7('0xb5')]({'model':db[_0x66c7('0x7a')],'as':_0x66c7('0x112'),'attributes':['id',_0x66c7('0x34')]});return db[_0x66c7('0x41')]['find']({'where':{'id':_0x321ea2[_0x66c7('0xb9')]['id']},'include':_0x46d1ba})[_0x66c7('0x14')](handleEntityNotFound(_0x29c394,null))['then'](function(_0x862182){if(_0x862182){var _0x37992c=_0x862182['get']({'plain':!![]});fs[_0x66c7('0x113')](_0x395cb3);var _0x288b89={'channel':_0x66c7('0x114'),'account':_0x37992c[_0x66c7('0x111')][_0x66c7('0x2b')],'agent':_0x37992c[_0x66c7('0x112')]?_0x37992c[_0x66c7('0x112')][_0x66c7('0x34')]:_0x66c7('0x115'),'createdAt':moment(_0x37992c[_0x66c7('0x83')])[_0x66c7('0xe6')](_0x66c7('0x101'))[_0x66c7('0xa2')](),'closedAt':_0x37992c[_0x66c7('0x3e')]?moment(_0x37992c[_0x66c7('0x116')])[_0x66c7('0xe6')](_0x66c7('0x101'))[_0x66c7('0xa2')]():'','disposition':_0x37992c[_0x66c7('0x117')],'chatInfo':{'browser':_0x37992c[_0x66c7('0x118')],'os':_0x37992c[_0x66c7('0x119')],'referer':_0x37992c[_0x66c7('0x11a')],'customerIp':_0x37992c[_0x66c7('0x11b')],'customerPort':_0x37992c[_0x66c7('0x11c')]?_0x37992c[_0x66c7('0x11c')]:'N.A.'},'messages':_(_0x37992c['Messages'])[_0x66c7('0x11d')]()[_0x66c7('0x8e')]({'secret':![]})[_0x66c7('0x33')](function(_0x136e37){if(_0x136e37[_0x66c7('0xd9')]){var _0x355c89=path[_0x66c7('0xde')](_0x3761ba,_0x136e37[_0x66c7('0xd9')][_0x66c7('0xd6')]);if(fs[_0x66c7('0x11e')](_0x355c89)){fs[_0x66c7('0x11f')](_0x355c89)['pipe'](fs[_0x66c7('0x120')](path[_0x66c7('0xde')](_0x395cb3,_0x136e37[_0x66c7('0xd9')][_0x66c7('0xd6')])));}}return{'date':moment(_0x136e37[_0x66c7('0x83')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x66c7('0xa2')](),'sender':_0x136e37[_0x66c7('0xf1')]==='out'?_0x136e37[_0x66c7('0x7a')]?_0x136e37[_0x66c7('0x7a')][_0x66c7('0x34')]:'System':_0x136e37[_0x66c7('0x6e')]['firstName']+(_0x136e37[_0x66c7('0x6e')]['lastName']?'\x20'+_0x136e37[_0x66c7('0x6e')][_0x66c7('0x10f')]:''),'body':_0x136e37[_0x66c7('0xd9')]?_0x136e37['Attachment'][_0x66c7('0xd6')]:_0x136e37[_0x66c7('0x7c')],'direction':_0x136e37[_0x66c7('0xf1')]===_0x66c7('0xcb')?'A':'C','secret':_0x136e37[_0x66c7('0xf2')],'read':_0x136e37['read'],'attachment':_0x136e37['Attachment']};})[_0x66c7('0x6a')]()};return ejs['renderFile'](path[_0x66c7('0xde')](config[_0x66c7('0xe4')],_0x66c7('0x10b'),'views',_0x66c7('0x121')),{'interaction':_0x288b89})[_0x66c7('0x14')](function(_0xb321a){var _0x498a86=path['join'](_0x395cb3,_0x66c7('0x122')+_0x37992c['id']+'-'+_0x2ab0b1+_0x66c7('0x123'));var _0x438f04={'path':_0x498a86,'channel':_0x66c7('0x114'),'interactionId':_0x37992c['id']};return pdf[_0x66c7('0x124')](_0xb321a,_0x438f04);})[_0x66c7('0x14')](function(){return new Promise(function(_0x5a912b,_0x53bb0d){zipdir(_0x395cb3,{'saveTo':_0x3625ea},function(_0x555008,_0x513f44){if(_0x555008)return _0x53bb0d(_0x555008);return _0x5a912b(_0x513f44);});})[_0x66c7('0x14')](function(){return new BPromise(function(_0x159dcc,_0x2b7e3a){rimraf(_0x395cb3,function(_0xacf9a4){if(_0xacf9a4)_0x2b7e3a(_0xacf9a4);return _0x159dcc();});});})[_0x66c7('0x14')](function(){return _0x29c394[_0x66c7('0xe1')](_0x3625ea,_0x293766,function(_0x5b41d6){if(_0x5b41d6){logger[_0x66c7('0x19')]('err',_0x5b41d6);}else{fs['unlinkSync'](_0x3625ea);}});});});}else{return _0x29c394[_0x66c7('0x1e')](0xc8);}})[_0x66c7('0x1d')](handleError(_0x29c394,null));};
\ No newline at end of file
+var _0x34e8=['ejs','lodash','squel','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','status','end','offset','limit','undefined','count','set','json','update','then','destroy','sendStatus','stack','name','send','render','body','contact','account','Users','TagIds','split','forEach','Tags','talking','unmanaged','abandoned','UserId','waiting','closed','disposition','answered','total','index','map','ChatInteraction','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','field','color','select','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','$substring','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','Sequelize','QueryTypes','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','push','show','params','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','follow','isNull','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','attachmentUpload','file','filename','mimetype','Attachment','Unauthorized','attachId','join','root','offline-chat/','basename','download','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','pathTranscript','ChatMessage','User','Messages','format','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','findAll','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x4dd617,_0xf29ffc){var _0x5df97c=function(_0x244470){while(--_0x244470){_0x4dd617['push'](_0x4dd617['shift']());}};_0x5df97c(++_0xf29ffc);}(_0x34e8,0x12c));var _0x834e=function(_0xc8d1b8,_0x3fc6dd){_0xc8d1b8=_0xc8d1b8-0x0;var _0x1ce2e4=_0x34e8[_0xc8d1b8];return _0x1ce2e4;};'use strict';var rimraf=require(_0x834e('0x0'));var zipdir=require(_0x834e('0x1'));var rp=require(_0x834e('0x2'));var moment=require(_0x834e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x834e('0x4'));var util=require(_0x834e('0x5'));var path=require(_0x834e('0x6'));var ejs=require(_0x834e('0x7'));var fs=require('fs');var _=require(_0x834e('0x8'));var squel=require(_0x834e('0x9'));var Redis=require(_0x834e('0xa'));var qs=require('../../components/parsers/qs');var as=require(_0x834e('0xb'));var pdf=require('../../components/export/pdf');var logger=require(_0x834e('0xc'))(_0x834e('0xd'));var config=require(_0x834e('0xe'));var db=require(_0x834e('0xf'))['db'];config[_0x834e('0x10')]=_[_0x834e('0x11')](config[_0x834e('0x10')],{'host':_0x834e('0x12'),'port':0x18eb});var socket=require(_0x834e('0x13'))(new Redis(config[_0x834e('0x10')]));require(_0x834e('0x14'))[_0x834e('0x15')](socket);var jayson=require(_0x834e('0x16'));var client=jayson[_0x834e('0x17')][_0x834e('0x18')]({'port':0x232b});var client9004=jayson[_0x834e('0x17')][_0x834e('0x18')]({'port':0x232c});function respondWithRpcPromise(_0x538bb3,_0x5e5b6d,_0x6cd9b9,_0x58a27e){return new BPromise(function(_0x23848e,_0x2d95f2){var _0x28e659=_0x58a27e||client;return _0x28e659[_0x834e('0x19')](_0x538bb3,_0x6cd9b9)['then'](function(_0x43156c){logger[_0x834e('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5e5b6d,_0x834e('0x1b'));logger['debug'](_0x834e('0x1c'),_0x5e5b6d,_0x834e('0x1b'),JSON['stringify'](_0x43156c));if(_0x43156c[_0x834e('0x1d')]){if(_0x43156c[_0x834e('0x1d')][_0x834e('0x1e')]===0x1f4){logger['error'](_0x834e('0x1f'),_0x5e5b6d,_0x43156c[_0x834e('0x1d')][_0x834e('0x20')]);return _0x2d95f2(_0x43156c[_0x834e('0x1d')][_0x834e('0x20')]);}logger[_0x834e('0x1d')](_0x834e('0x1f'),_0x5e5b6d,_0x43156c['error'][_0x834e('0x20')]);return _0x23848e(_0x43156c[_0x834e('0x1d')][_0x834e('0x20')]);}else{logger[_0x834e('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5e5b6d,_0x834e('0x1b'));_0x23848e(_0x43156c[_0x834e('0x21')]['message']);}})[_0x834e('0x22')](function(_0x28d687){logger[_0x834e('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x5e5b6d,_0x28d687);_0x2d95f2(_0x28d687);});});}function respondWithStatusCode(_0x4e3f48,_0x231619){_0x231619=_0x231619||0xcc;return function(_0x34563b){if(_0x34563b){return _0x4e3f48['sendStatus'](_0x231619);}return _0x4e3f48[_0x834e('0x23')](_0x231619)[_0x834e('0x24')]();};}function respondWithResult(_0x58f4fd,_0x3bc4f7){_0x3bc4f7=_0x3bc4f7||0xc8;return function(_0x2e1983){if(_0x2e1983){return _0x58f4fd[_0x834e('0x23')](_0x3bc4f7)['json'](_0x2e1983);}};}function respondWithFilteredResult(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(_0x5e1cc5){var _0x5bef62=typeof _0x3e310f[_0x834e('0x25')]==='undefined'&&typeof _0x3e310f[_0x834e('0x26')]===_0x834e('0x27');var _0x3db026=_0x5e1cc5[_0x834e('0x28')];var _0x3cd928=_0x5bef62?0x0:_0x3e310f[_0x834e('0x25')];var _0x491919=_0x5bef62?_0x5e1cc5['count']:_0x3e310f['offset']+_0x3e310f['limit'];var _0x2c7a8d;if(_0x491919>=_0x3db026){_0x491919=_0x3db026;_0x2c7a8d=0xc8;}else{_0x2c7a8d=0xce;}_0x24fcf7[_0x834e('0x23')](_0x2c7a8d);return _0x24fcf7[_0x834e('0x29')]('Content-Range',_0x3cd928+'-'+_0x491919+'/'+_0x3db026)[_0x834e('0x2a')](_0x5e1cc5);}return null;};}function saveUpdates(_0x11f1ce){return function(_0x1f3671){if(_0x1f3671){return _0x1f3671[_0x834e('0x2b')](_0x11f1ce)[_0x834e('0x2c')](function(_0x390119){return _0x390119;});}return null;};}function removeEntity(_0x3d149d){return function(_0xfaf716){if(_0xfaf716){return _0xfaf716[_0x834e('0x2d')]()['then'](function(){_0x3d149d[_0x834e('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c75c2){return function(_0x3787b0){if(!_0x3787b0){_0x2c75c2[_0x834e('0x2e')](0x194);}return _0x3787b0;};}function handleError(_0x2b3418,_0x444366){_0x444366=_0x444366||0x1f4;return function(_0x4689c2){logger[_0x834e('0x1d')](_0x4689c2[_0x834e('0x2f')]);if(_0x4689c2[_0x834e('0x30')]){delete _0x4689c2[_0x834e('0x30')];}_0x2b3418['status'](_0x444366)[_0x834e('0x31')](_0x4689c2);};}function getMustacheRender(_0x2f408a,_0x24a9df){return Mustache[_0x834e('0x32')](_0x2f408a,_['merge'](_0x24a9df[_0x834e('0x33')],{'contact':_0x24a9df[_0x834e('0x34')],'message':_0x24a9df['message'],'agent':_0x24a9df['agent'],'interaction':_0x24a9df['interaction'],'account':_0x24a9df[_0x834e('0x35')]}))||'';}function getInteractionUsers(_0x41bf4d,_0x20c6ae){return new BPromise(function(_0x34fefb,_0x339e28){try{if(_0x20c6ae[_0x41bf4d['id']]){_0x41bf4d[_0x834e('0x36')]=_['map'](_0x20c6ae[_0x41bf4d['id']],function(_0x2c2d94){return{'id':_0x2c2d94['id'],'fullname':_0x2c2d94['fullname']};});}}catch(_0xe103fe){_0x339e28(_0xe103fe);}_0x34fefb(_0x41bf4d);});}function getInteractionTags(_0x6a3ac,_0x47abed){return new BPromise(function(_0x18ac3b,_0x2f56c7){try{if(_0x6a3ac['TagIds']){_0x6a3ac['Tags']=[];_0x6a3ac[_0x834e('0x37')][_0x834e('0x38')](',')[_0x834e('0x39')](function(_0x130c23){_0x6a3ac[_0x834e('0x3a')]['push'](_0x47abed[_0x130c23]);});}delete _0x6a3ac[_0x834e('0x37')];}catch(_0x548d1d){_0x2f56c7(_0x548d1d);}_0x18ac3b(_0x6a3ac);});}function updateChatInteraction(_0x50c243,_0x1b2edf,_0x4a7f76){return new BPromise(function(_0x2e5239,_0x1ba66d){return getInteractionUsers(_0x50c243,_0x4a7f76)[_0x834e('0x2c')](function(_0x3c59af){return getInteractionTags(_0x3c59af,_0x1b2edf);})[_0x834e('0x2c')](function(_0x574ea8){return getStateInteraction(_0x574ea8);})[_0x834e('0x2c')](function(_0x26b847){_0x2e5239(_0x26b847);})[_0x834e('0x22')](function(_0x58c5fb){_0x1ba66d(_0x58c5fb);});});}function getStateInteraction(_0x35380e){return new BPromise(function(_0x16ac45){_0x35380e['waiting']=0x0;_0x35380e[_0x834e('0x3b')]=0x0;_0x35380e['answered']=0x0;_0x35380e[_0x834e('0x3c')]=0x0;_0x35380e[_0x834e('0x3d')]=0x0;_0x35380e['total']=0x0;if(!_0x35380e['closed']&&!_0x35380e[_0x834e('0x3e')]){_0x35380e[_0x834e('0x3f')]+=0x1;}if(!_0x35380e[_0x834e('0x40')]&&_0x35380e[_0x834e('0x3e')]){_0x35380e[_0x834e('0x3b')]+=0x1;if(_0x35380e[_0x834e('0x3f')]){_0x35380e[_0x834e('0x3f')]-=0x1;}}if(_0x35380e['closed']&&_0x35380e[_0x834e('0x41')]==='abandoned'){_0x35380e[_0x834e('0x3d')]+=0x1;if(_0x35380e['waiting']){_0x35380e[_0x834e('0x3f')]-=0x1;}}else if(_0x35380e['closed']&&!_0x35380e[_0x834e('0x3e')]&&_0x35380e[_0x834e('0x41')]){_0x35380e['unmanaged']+=0x1;if(_0x35380e[_0x834e('0x3f')]){_0x35380e[_0x834e('0x3f')]-=0x1;}}else if(_0x35380e[_0x834e('0x40')]&&_0x35380e[_0x834e('0x3e')]){_0x35380e[_0x834e('0x42')]+=0x1;if(_0x35380e[_0x834e('0x3b')]){_0x35380e[_0x834e('0x3b')]-=0x1;}}_0x35380e[_0x834e('0x43')]+=0x1;_0x16ac45(_0x35380e);});}exports[_0x834e('0x44')]=function(_0x279ea1,_0x5f3943){var _0x3124be={},_0x6fff27={},_0x47a8a9={'count':0x0,'rows':[]};var _0x112306=_[_0x834e('0x45')](db[_0x834e('0x46')][_0x834e('0x47')],function(_0x19b5ef){return{'name':_0x19b5ef[_0x834e('0x48')],'type':_0x19b5ef['type']['key']};});_0x6fff27[_0x834e('0x49')]=_[_0x834e('0x45')](_0x112306,_0x834e('0x30'));_0x6fff27[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x279ea1[_0x834e('0x4a')]);_0x6fff27[_0x834e('0x4c')]=_[_0x834e('0x4d')](_0x6fff27[_0x834e('0x49')],_0x6fff27[_0x834e('0x4a')]);_0x3124be[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x6fff27[_0x834e('0x49')],qs[_0x834e('0x4f')](_0x279ea1[_0x834e('0x4a')][_0x834e('0x4f')]));_0x3124be[_0x834e('0x4e')]=_0x3124be[_0x834e('0x4e')][_0x834e('0x50')]?_0x3124be[_0x834e('0x4e')]:_0x6fff27['model'];if(!_0x279ea1[_0x834e('0x4a')][_0x834e('0x51')]('nolimit')){_0x3124be[_0x834e('0x26')]=qs[_0x834e('0x26')](_0x279ea1['query'][_0x834e('0x26')]);_0x3124be[_0x834e('0x25')]=qs[_0x834e('0x25')](_0x279ea1[_0x834e('0x4a')][_0x834e('0x25')]);}_0x3124be[_0x834e('0x52')]=qs[_0x834e('0x53')](_0x279ea1['query'][_0x834e('0x53')]);_0x3124be[_0x834e('0x54')]=qs[_0x834e('0x4c')](_[_0x834e('0x55')](_0x279ea1[_0x834e('0x4a')],_0x6fff27[_0x834e('0x4c')]),_0x112306);var _0x344b51=[];var _0x1bc975=squel['select']()[_0x834e('0x56')]('id')['field'](_0x834e('0x30'))['field'](_0x834e('0x57'))['from']('tools_tags');var _0x6c0b29=squel[_0x834e('0x58')]()['field']('u.id')[_0x834e('0x56')](_0x834e('0x59'))[_0x834e('0x56')](_0x834e('0x5a'))[_0x834e('0x5b')](_0x834e('0x5c'),'ui')[_0x834e('0x5d')](_0x834e('0x5e'),'u','u.id\x20=\x20ui.UserId');var _0x142334=squel[_0x834e('0x58')]()['from'](_0x834e('0x5f'),'i')['left_join'](_0x834e('0x60'),'c',_0x834e('0x61'))['left_join'](_0x834e('0x5e'),'o',_0x834e('0x62'))[_0x834e('0x5d')](_0x834e('0x63'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x834e('0x5d')](_0x834e('0x64'),'me',_0x834e('0x65'))['left_join'](_0x834e('0x66'),'it',_0x834e('0x67'))[_0x834e('0x5d')](_0x834e('0x68'),'t',_0x834e('0x69'));var _0x125f37=squel[_0x834e('0x6a')]();var _0x1def00=[];var _0x208c21=squel[_0x834e('0x6a')]();var _0x1e4310;if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x6b')]){_0x1e4310=as[_0x834e('0x6c')](_0x279ea1[_0x834e('0x4a')][_0x834e('0x6b')]);var _0x297cce=_0x1e4310[_0x834e('0x6d')];for(var _0x193a15=0x0;_0x193a15<_0x1e4310[_0x834e('0x6e')][_0x834e('0x50')];_0x193a15++){var _0x2cb233=_0x1e4310['conditions'][_0x193a15];var _0x2145cf='i';var _0x25d6f4=_[_0x834e('0x6f')](_0x112306,[_0x834e('0x30'),_0x2cb233['field']]);if(!_0x25d6f4){switch(_0x2cb233[_0x834e('0x56')]){case'unreadMessages':if(_0x2cb233['value']==0x1){_0x142334[_0x834e('0x70')]('`'+_0x2cb233[_0x834e('0x56')]+_0x834e('0x71'));}else{_0x142334[_0x834e('0x70')]('`'+_0x2cb233[_0x834e('0x56')]+_0x834e('0x72'));}break;case _0x834e('0x73'):if(_0x2cb233[_0x834e('0x74')]==='$substring'){if(_0x2cb233[_0x834e('0x75')]['split']('\x20')[_0x834e('0x50')]>0x1){_0x125f37[_0x297cce](_0x834e('0x76'),qs['getFullTextValue'](_0x2cb233['value']),null);}else{var _0x4a4def='%'+_0x2cb233[_0x834e('0x75')]+'%';_0x125f37[_0x297cce](_0x834e('0x77'),_0x4a4def,_0x4a4def,_0x4a4def);}}else{_0x25d6f4=_[_0x834e('0x6f')](_0x112306,[_0x834e('0x30'),'ContactId']);_0x2cb233[_0x834e('0x56')]=_0x834e('0x78');_0x11f6f0=as[_0x834e('0x79')](_0x2145cf,_0x25d6f4[_0x834e('0x7a')],_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x7c')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x24')]);}break;case _0x834e('0x7d'):var _0x5b2bf6=_0x2cb233[_0x834e('0x75')][_0x834e('0x38')](',')[_0x834e('0x45')](function(_0x5b5d6f){return Number(_0x5b5d6f);});_0x5b2bf6['forEach'](function(_0x46fa0d){_0x208c21['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x46fa0d+',%');});_0x1def00=_['union'](_0x1def00,_0x5b2bf6);break;case'User':if(_0x2cb233[_0x834e('0x74')]===_0x834e('0x7e')){_0x125f37[_0x297cce]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2cb233[_0x834e('0x75')]+'%',null);}else{_0x25d6f4=_[_0x834e('0x6f')](_0x112306,['name',_0x834e('0x3e')]);_0x2cb233[_0x834e('0x56')]='UserId';_0x11f6f0=as['buildExpression'](_0x2145cf,_0x25d6f4[_0x834e('0x7a')],_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x7c')],_0x11f6f0[_0x834e('0x75')]['end']);}break;case _0x834e('0x33'):_0x11f6f0=as['buildExpression']('me',null,_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')][_0x834e('0x7c')],_0x11f6f0['value'][_0x834e('0x24')]);break;}}else{var _0x11f6f0=as['buildExpression'](_0x2145cf,_0x25d6f4[_0x834e('0x7a')],_0x2cb233);_0x125f37[_0x297cce](_0x11f6f0[_0x834e('0x7b')],_0x11f6f0[_0x834e('0x75')]['start'],_0x11f6f0[_0x834e('0x75')][_0x834e('0x24')]);}}}else{var _0x402692=_(_0x279ea1[_0x834e('0x4a')])[_0x834e('0x4b')]()[_0x834e('0x45')](function(_0x1372dd){return _[_0x834e('0x7f')](_0x112306,[_0x834e('0x30'),_0x1372dd])?_0x1372dd:undefined;})[_0x834e('0x80')]()['value']();if(!_['isEmpty'](_0x402692)){_0x402692['forEach'](function(_0x36ede9){if(_0x36ede9===_0x834e('0x81')){_0x142334[_0x834e('0x54')](_0x834e('0x82'),[][_0x834e('0x83')](_0x279ea1['query'][_0x36ede9]));}else if(_0x36ede9==='createdAt'){var _0x4520fc=JSON[_0x834e('0x84')](_0x279ea1[_0x834e('0x4a')][_0x36ede9])[_0x834e('0x85')];var _0x40a705=JSON['parse'](_0x279ea1[_0x834e('0x4a')][_0x36ede9])[_0x834e('0x86')];_0x142334[_0x834e('0x54')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4520fc,_0x40a705);}else{if(_0x279ea1[_0x834e('0x4a')][_0x36ede9]===_0x834e('0x87')){_0x142334[_0x834e('0x54')]('i.'+_0x36ede9+_0x834e('0x88'));}else{_0x142334[_0x834e('0x54')]('i.'+_0x36ede9+'\x20=\x20?',_0x279ea1['query'][_0x36ede9]);}}});}if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x89')]){if(_0x279ea1['query'][_0x834e('0x89')]==0x1){_0x142334['having'](_0x834e('0x8a'));}else{_0x142334[_0x834e('0x70')](_0x834e('0x8b'));}}if(_0x279ea1['query'][_0x834e('0x8c')]){_0x1def00=_['isArray'](_0x279ea1['query']['tag'])?_0x279ea1[_0x834e('0x4a')][_0x834e('0x8c')]:new Array(_0x279ea1[_0x834e('0x4a')][_0x834e('0x8c')]);_0x1def00[_0x834e('0x39')](function(_0x2dad55){_0x208c21['or'](_0x834e('0x8d'),'%,'+_0x2dad55+',%');});}if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x8e')]){var _0x53f6e3=_0x279ea1[_0x834e('0x4a')]['filter'][_0x834e('0x8f')]('\x5c','\x5c\x5c')[_0x834e('0x8f')](/'/g,'\x27\x27');if(qs[_0x834e('0x90')](_0x53f6e3)){_0x125f37['or'](_0x834e('0x91'),_0x53f6e3+'%');}else{_0x125f37['or'](_0x834e('0x92'),qs[_0x834e('0x93')](_0x53f6e3))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x53f6e3+'%');}}}_0x142334['where'](_0x125f37);_0x142334[_0x834e('0x94')](_0x834e('0x95'));var _0x4eff8d={'type':db[_0x834e('0x96')][_0x834e('0x97')][_0x834e('0x98')],'raw':!![]};var _0x1e225f=_0x142334[_0x834e('0x99')]();_0x1e225f['field'](_0x834e('0x95'));_0x1e225f[_0x834e('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x3124be['order']){_0x3124be[_0x834e('0x52')][_0x834e('0x39')](function(_0x4f716d){var _0x23ce49=_0x4f716d[0x0]===_0x834e('0x9a')?_0x4f716d[0x0]:'i.'+_0x4f716d[0x0];_0x142334['order'](_0x23ce49,_0x4f716d[0x1]===_0x834e('0x9b')?![]:!![]);});}if(!_['isEmpty'](_0x1def00)){_0x142334['having'](_0x208c21);_0x1e225f[_0x834e('0x54')](_0x834e('0x9c'),_0x1def00);}BPromise[_0x834e('0x9d')]()[_0x834e('0x2c')](function(){if(!_0x1e4310){if(_0x279ea1['query'][_0x834e('0x81')])return;_0x1e225f[_0x834e('0x54')](_0x834e('0x9e'));_0x142334[_0x834e('0x54')](_0x834e('0x9e'));return;}if(_0x279ea1[_0x834e('0x9f')][_0x834e('0xa0')]!==_0x834e('0xa1'))return;return _0x279ea1[_0x834e('0x9f')][_0x834e('0xa2')]({'attributes':['id'],'raw':!![]})[_0x834e('0x2c')](function(_0x261e3d){if(_[_0x834e('0xa3')](_0x261e3d)){_0x1e225f[_0x834e('0x54')](_0x834e('0xa4'));_0x142334[_0x834e('0x54')](_0x834e('0xa4'));}else{_0x1e225f[_0x834e('0x54')](_0x834e('0x82'),_[_0x834e('0x45')](_0x261e3d,'id'));_0x142334[_0x834e('0x54')](_0x834e('0x82'),_['map'](_0x261e3d,'id'));}});})[_0x834e('0x2c')](function(){if(_0x279ea1[_0x834e('0x9f')][_0x834e('0xa0')]===_0x834e('0xa1')&&!_0x1e4310&&!_0x279ea1[_0x834e('0x4a')][_0x834e('0x81')])return[];return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x1e225f[_0x834e('0xa6')](),_0x4eff8d);})['then'](function(_0x5ce790){_0x47a8a9['count']=_0x5ce790[_0x834e('0x50')];if(_0x47a8a9['count']===0x0)return[];return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x1bc975[_0x834e('0xa6')](),_0x4eff8d)['then'](function(_0xae00f){_0x344b51=_[_0x834e('0xa7')](_0xae00f,'id');_0x4eff8d=_[_0x834e('0xa8')](_0x4eff8d,{'model':db[_0x834e('0x46')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x279ea1[_0x834e('0x4a')][_0x834e('0x4f')]){_0x3124be['attributes'][_0x834e('0x39')](function(_0x27bd2e){_0x142334[_0x834e('0x56')]('i.'+_0x27bd2e);});}else{_0x142334[_0x834e('0x56')](_0x834e('0xa9'),'unreadMessages');_0x142334['field']('a.key','Account.key');_0x142334[_0x834e('0x56')](_0x834e('0xaa'),'Account.mandatoryDisposition');_0x142334[_0x834e('0x56')](_0x834e('0xab'),'contactName');_0x142334[_0x834e('0x56')](_0x834e('0xac'));_0x142334[_0x834e('0x56')](_0x834e('0xad'),_0x834e('0xae'));_0x142334[_0x834e('0x56')]('c.lastName','Contact.lastName');_0x142334[_0x834e('0x56')](_0x834e('0xaf'),_0x834e('0xb0'));_0x142334['field'](_0x834e('0xb1'),_0x834e('0xb2'));_0x142334['field'](_0x834e('0xb3'),_0x834e('0xb4'));_0x142334[_0x834e('0x56')](_0x834e('0xb5'),'Contact.fax');_0x142334[_0x834e('0x56')]('o.fullname','Owner.fullname');_0x142334[_0x834e('0x56')](_0x834e('0xb6'),_0x834e('0xb7'));_0x142334[_0x834e('0x56')](_0x834e('0xb8'),_0x834e('0x37'));}if(_0x3124be['limit'])_0x142334['limit'](_0x3124be[_0x834e('0x26')]);if(_0x3124be[_0x834e('0x25')])_0x142334[_0x834e('0x25')](_0x3124be[_0x834e('0x25')]);return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x142334[_0x834e('0xa6')](),_0x4eff8d);})['then'](function(_0x435a75){if(_0x435a75[_0x834e('0x50')]>0x0)_0x6c0b29['where'](_0x834e('0xb9'),_[_0x834e('0x45')](_0x435a75,'id'));return db[_0x834e('0xa5')][_0x834e('0x4a')](_0x6c0b29[_0x834e('0xa6')](),_0x4eff8d)[_0x834e('0x2c')](function(_0x231f0b){var _0x3b44f3=_[_0x834e('0xba')](_0x231f0b,_0x834e('0xbb'));var _0x496709=[];_0x435a75[_0x834e('0x39')](function(_0x17e922){_0x496709[_0x834e('0xbc')](updateChatInteraction(_0x17e922,_0x344b51,_0x3b44f3));});return BPromise['all'](_0x496709);});});})[_0x834e('0x2c')](function(_0x20fdfd){_0x47a8a9['rows']=_0x20fdfd;return _0x47a8a9;})[_0x834e('0x2c')](respondWithFilteredResult(_0x5f3943,_0x3124be))['catch'](handleError(_0x5f3943,null));};exports[_0x834e('0xbd')]=function(_0x53c483,_0x16a42b){var _0x560d10={'raw':![],'where':{'id':_0x53c483[_0x834e('0xbe')]['id']}},_0x2b6d1={};_0x2b6d1[_0x834e('0x49')]=_[_0x834e('0x4b')](db['ChatInteraction'][_0x834e('0x47')]);_0x2b6d1[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x53c483[_0x834e('0x4a')]);_0x2b6d1[_0x834e('0x4c')]=_[_0x834e('0x4d')](_0x2b6d1[_0x834e('0x49')],_0x2b6d1[_0x834e('0x4a')]);_0x560d10[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x2b6d1[_0x834e('0x49')],qs[_0x834e('0x4f')](_0x53c483[_0x834e('0x4a')][_0x834e('0x4f')]));_0x560d10[_0x834e('0x4e')]=_0x560d10[_0x834e('0x4e')][_0x834e('0x50')]?_0x560d10['attributes']:_0x2b6d1['model'];if(_0x53c483[_0x834e('0x4a')][_0x834e('0xbf')]){_0x560d10[_0x834e('0xc0')]=[{'all':!![]}];}_0x560d10=_[_0x834e('0xa8')]({},_0x560d10,_0x53c483[_0x834e('0xc1')]);return db[_0x834e('0x46')][_0x834e('0x6f')](_0x560d10)[_0x834e('0x2c')](handleEntityNotFound(_0x16a42b,null))[_0x834e('0x2c')](respondWithResult(_0x16a42b,null))[_0x834e('0x22')](handleError(_0x16a42b,null));};exports[_0x834e('0xc2')]=function(_0x32645e,_0x513d9e){return db[_0x834e('0x46')]['create'](_0x32645e[_0x834e('0x33')],{})[_0x834e('0x2c')](respondWithResult(_0x513d9e,0xc9))[_0x834e('0x22')](handleError(_0x513d9e,null));};exports['update']=function(_0x1a65b4,_0x23a386){if(_0x1a65b4['body']['id']){delete _0x1a65b4['body']['id'];}return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0x1a65b4['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x23a386,null))[_0x834e('0x2c')](saveUpdates(_0x1a65b4[_0x834e('0x33')],null))[_0x834e('0x2c')](respondWithResult(_0x23a386,null))[_0x834e('0x22')](handleError(_0x23a386,null));};exports['destroy']=function(_0x4e7545,_0x453e58){return db['ChatInteraction']['find']({'where':{'id':_0x4e7545['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x453e58,null))[_0x834e('0x2c')](removeEntity(_0x453e58,null))['catch'](handleError(_0x453e58,null));};exports[_0x834e('0xc3')]=function(_0x66cbdc,_0x470568){return db[_0x834e('0x46')]['describe']()[_0x834e('0x2c')](respondWithResult(_0x470568,null))[_0x834e('0x22')](handleError(_0x470568,null));};exports[_0x834e('0xc4')]=function(_0x5633f4,_0x3d8af7){var _0x5f3b7d=_0x5633f4[_0x834e('0xbe')]['id'];var _0x4af2a2;var _0x461420;var _0x108100;return db['ChatInteraction'][_0x834e('0xc5')]({'where':{'id':_0x5f3b7d}})[_0x834e('0x2c')](function(_0x41e7a8){_0x4af2a2=_0x41e7a8;return db[_0x834e('0xc6')][_0x834e('0xc5')]({'where':{'id':_0x41e7a8[_0x834e('0x81')]},'attributes':['id','vidaooApiKey',_0x834e('0xc7'),_0x834e('0xc8'),_0x834e('0xc9'),_0x834e('0xca')],'raw':!![]});})[_0x834e('0x2c')](function(_0x1b8e67){if(_0x1b8e67&&_0x1b8e67['vidaooApiKey']&&_0x1b8e67[_0x834e('0xc7')]){_0x461420=_0x1b8e67;var _0x490a57={'interaction':{'id':_0x5f3b7d},'agent':{'id':_0x5633f4['user']['id'],'name':_0x5633f4[_0x834e('0x9f')]['name'],'fullname':_0x5633f4['user'][_0x834e('0xcb')],'email':_0x5633f4[_0x834e('0x9f')][_0x834e('0xcc')]},'contact':_0x5633f4[_0x834e('0x33')][_0x834e('0x34')],'account':_0x5633f4[_0x834e('0x33')][_0x834e('0x35')]};var _0x155f2d={'rejectUnauthorized':![],'method':_0x834e('0xcd'),'url':_0x834e('0xce'),'headers':{'X-APIKEY':_0x1b8e67[_0x834e('0xcf')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5633f4[_0x834e('0x9f')][_0x834e('0xcc')]],'buttons':null,'topic':_0x461420[_0x834e('0xc8')],'note':_['isNull'](_0x461420[_0x834e('0xc9')])?null:getMustacheRender(_0x461420['vidaooNote'],_0x490a57),'metadata':null},'redirect':_0x834e('0xd0'),'json':!![]};try{if(!_[_0x834e('0xd1')](_0x461420[_0x834e('0xca')])){var _0x2cdbe0=getMustacheRender(_0x461420['vidaooMetadata'],_0x490a57);var _0x5f558a=JSON[_0x834e('0x84')](_0x2cdbe0);_0x155f2d[_0x834e('0x33')]['metadata']=_0x5f558a;}}catch(_0x375c35){throw new db[(_0x834e('0x96'))]['ValidationError'](_0x834e('0xd2'));}return rp(_0x155f2d);}else{throw new db[(_0x834e('0x96'))][(_0x834e('0xd3'))](_0x834e('0xd4'));}})['then'](function(_0x57ff06){_0x108100=_0x57ff06;if(_0x108100['id']){var _0x4ead1d={'body':_0x108100['join_url'],'ChatWebsiteId':_0x461420['id'],'ChatInteractionId':_0x4af2a2['id'],'direction':_0x834e('0xd5'),'UserId':_0x5633f4[_0x834e('0x9f')]['id']};return db['ChatMessage'][_0x834e('0xc2')](_0x4ead1d,{});}else{throw new db['Sequelize'][(_0x834e('0xd3'))](_0x834e('0xd6'));}})[_0x834e('0x2c')](function(){return _0x4af2a2[_0x834e('0xd7')]({'vidaooSessionId':_0x108100['id']});})[_0x834e('0x2c')](respondWithResult(_0x3d8af7,null))[_0x834e('0x22')](handleError(_0x3d8af7,null));};exports[_0x834e('0xd8')]=function(_0x4fc61d,_0x12a0f3){if(_0x4fc61d[_0x834e('0x33')]['id']){delete _0x4fc61d['body']['id'];}return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0x4fc61d['params']['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x834e('0x2c')](handleEntityNotFound(_0x12a0f3,null))[_0x834e('0x2c')](saveUpdates(_0x4fc61d[_0x834e('0x33')],null))['then'](respondWithResult(_0x12a0f3,null))[_0x834e('0x22')](handleError(_0x12a0f3,null));};exports[_0x834e('0xd9')]=function(_0xbd0346,_0x17e729){if(_0xbd0346[_0x834e('0x33')]['id']){delete _0xbd0346[_0x834e('0x33')]['id'];}return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0xbd0346[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](function(_0x48b6c4){if(!_0x48b6c4){logger['error'](_0x834e('0xda'),_0x834e('0xd9'),0x194,_0x834e('0xdb'));_0x17e729[_0x834e('0x2e')](0x194);}else{if(_0x48b6c4[_0x834e('0x3e')]){throw new db[(_0x834e('0x96'))][(_0x834e('0xd3'))](_0x834e('0xdc'));}}return _0x48b6c4;})[_0x834e('0x2c')](function(_0x97a4b2){if(_0x97a4b2){return _0x97a4b2[_0x834e('0x2b')]({'closed':_0xbd0346[_0x834e('0x33')][_0x834e('0x40')],'disposition':_0xbd0346['body'][_0x834e('0x41')]})[_0x834e('0x2c')](function(_0x3f5b2e){return _0x3f5b2e;});}})[_0x834e('0x2c')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0xbd0346['body'],client9004);})[_0x834e('0x2c')](respondWithResult(_0x17e729,null))[_0x834e('0x22')](handleError(_0x17e729,null));};exports[_0x834e('0xdd')]=function(_0x23d7e6,_0x181ecd){_0x23d7e6[_0x834e('0x33')][_0x834e('0x30')]=_0x23d7e6[_0x834e('0xde')]['originalname'];_0x23d7e6['body']['basename']=_0x23d7e6['file'][_0x834e('0xdf')];_0x23d7e6[_0x834e('0x33')][_0x834e('0x7a')]=_0x23d7e6[_0x834e('0xde')][_0x834e('0xe0')];return db[_0x834e('0xe1')][_0x834e('0xc2')](_0x23d7e6[_0x834e('0x33')])[_0x834e('0x2c')](respondWithResult(_0x181ecd,0xc9))['catch'](handleError(_0x181ecd,null));};exports['attachmentDownload']=function(_0x4d1545,_0x5dc651){return db[_0x834e('0x46')][_0x834e('0xc5')]({'where':{'id':_0x4d1545[_0x834e('0xbe')]['id']},'raw':!![]})[_0x834e('0x2c')](handleEntityNotFound(_0x5dc651,null))[_0x834e('0x2c')](function(_0xcb9751){if(_0xcb9751){if(_0xcb9751[_0x834e('0x40')]){return _0x5dc651[_0x834e('0x23')](0x193)[_0x834e('0x2a')]({'status':0x193,'message':_0x834e('0xe2')});}return db[_0x834e('0xe1')][_0x834e('0xc5')]({'where':{'id':_0x4d1545[_0x834e('0x4a')][_0x834e('0xe3')]},'raw':!![]})[_0x834e('0x2c')](handleEntityNotFound(_0x5dc651,null));}})[_0x834e('0x2c')](function(_0x5022f2){if(_0x5022f2){var _0x13f473=_0x5022f2['ChatOfflineMessageId']!==null;var _0x1f6bb9=path[_0x834e('0xe4')](config[_0x834e('0xe5')],'server/files/attachments/');if(_0x13f473){_0x1f6bb9=path[_0x834e('0xe4')](_0x1f6bb9,_0x834e('0xe6'));}var _0x4d7fef=path['join'](_0x1f6bb9,_0x5022f2[_0x834e('0xe7')]);return _0x5dc651[_0x834e('0xe8')](_0x4d7fef);}})[_0x834e('0x22')](handleError(_0x5dc651,null));};exports[_0x834e('0xe9')]=function(_0x12d468,_0x2e9116){var _0x3eb2e8=null;var _0x239a4e=null;var _0x569a80=null;if(_0x12d468[_0x834e('0x33')]['id']){delete _0x12d468[_0x834e('0x33')]['id'];}if(_0x12d468[_0x834e('0x33')][_0x834e('0xea')]){_0x569a80=path[_0x834e('0xe4')](config[_0x834e('0xe5')],_0x834e('0xeb'),util['format'](_0x834e('0xec'),Date['now']()));_0x12d468['body'][_0x834e('0xed')]=_0x569a80;}return db[_0x834e('0x46')]['find']({'where':{'id':_0x12d468[_0x834e('0xbe')]['id']},'include':[{'model':db[_0x834e('0xee')],'as':'Messages','include':[{'model':db[_0x834e('0xef')],'as':_0x834e('0xef')}]}]})['then'](handleEntityNotFound(_0x2e9116,null))['then'](saveUpdates(_0x12d468[_0x834e('0x33')],null))[_0x834e('0x2c')](function(_0x4e6525){if(_0x4e6525){_0x3eb2e8=_0x4e6525;return db['ChatWebsite'][_0x834e('0x6f')]({'where':{'id':_0x3eb2e8[_0x834e('0x81')]}});}})['then'](function(_0x480290){if(_0x480290){_0x239a4e=_0x480290;return db['CmContact']['find']({'where':{'id':_0x3eb2e8[_0x834e('0x78')]}});}})['then'](function(_0x3be4c3){if(_0x3be4c3){if(_0x569a80){var _0x52cdcc=null;for(var _0x343348=0x1;_0x343348<_0x3eb2e8[_0x834e('0xf0')][_0x834e('0x50')];++_0x343348){_0x52cdcc=_0x3eb2e8[_0x834e('0xf0')][_0x343348];var _0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?util[_0x834e('0xf1')](_0x834e('0xf2'),_0x239a4e[_0x834e('0xf3')],_0x52cdcc[_0x834e('0x3e')]):_0x834e('0xf4');var _0x3d8abb=_0x12d468[_0x834e('0x33')][_0x834e('0xf5')]||util[_0x834e('0xf1')]('%s%d',_0x834e('0xf6'),_0x52cdcc['ContactId']);switch(_0x239a4e[_0x834e('0xf7')]){case _0x834e('0xf8'):_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?util[_0x834e('0xf1')](_0x834e('0xf2'),_0x239a4e['agentAlias'],_0x52cdcc[_0x834e('0x3e')]):'System';break;case'agent_alias':_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?_0x52cdcc[_0x834e('0xef')][_0x834e('0xf9')]||_0x52cdcc['User'][_0x834e('0xcb')]:_0x834e('0xf4');break;case _0x834e('0xfa'):_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?_0x52cdcc[_0x834e('0xef')][_0x834e('0xcb')]:_0x834e('0xf4');break;default:_0x4fabe6=_0x52cdcc[_0x834e('0x3e')]?util[_0x834e('0xf1')](_0x834e('0xf2'),_0x239a4e[_0x834e('0xf3')],_0x52cdcc['UserId']):_0x834e('0xf4');}var _0x121d87=util[_0x834e('0xf1')](_0x834e('0xfb'),moment(_0x52cdcc[_0x834e('0xfc')])[_0x834e('0xf1')]('MM/DD/YYYY\x20HH:mm:ss'),_0x52cdcc[_0x834e('0xfd')]==='in'?_0x3d8abb:_0x4fabe6,_0x52cdcc[_0x834e('0x33')]);if(!_0x52cdcc[_0x834e('0xfe')]){fs[_0x834e('0xff')](_0x569a80,_0x121d87);}}return db[_0x834e('0x100')][_0x834e('0xc5')]({'where':{'service':!![]},'include':[{'model':db[_0x834e('0x101')],'as':_0x834e('0x102'),'raw':!![],'include':[{'model':db[_0x834e('0x103')],'as':_0x834e('0x103'),'raw':!![]}]}]});}}})['then'](function(_0x571645){if(!_0x571645||!_0x571645[_0x834e('0x102')]||!_0x12d468['body'])return _0x3eb2e8;var _0x4094d5=_0x571645[_0x834e('0x104')]();return respondWithRpcPromise(_0x834e('0x105'),_0x834e('0x106'),{'account':_0x4094d5,'message':{'from':util[_0x834e('0xf1')](_0x834e('0x107'),_0x571645['name'],_0x571645[_0x834e('0xcc')]||_0x571645['Smtp']['user']),'to':_0x12d468['body'][_0x834e('0xea')],'subject':_0x834e('0x108'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x12d468['body'][_0x834e('0xea')]),'attachments':[{'path':_0x569a80}]}})[_0x834e('0x2c')](function(){return _0x3eb2e8;})[_0x834e('0x22')](function(_0x5e0bfe){logger[_0x834e('0x1d')](_0x5e0bfe);});})[_0x834e('0x2c')](respondWithStatusCode(_0x2e9116,0xc8))[_0x834e('0x22')](handleError(_0x2e9116,null));};exports[_0x834e('0x109')]=function(_0xb9635a,_0x3c1a19){return db['ChatMessage']['find']({'where':{'id':_0xb9635a['params']['id']}})['then'](handleEntityNotFound(_0x3c1a19,null))[_0x834e('0x2c')](function(_0xf82ca8){if(_0xf82ca8){return _0xf82ca8[_0x834e('0x109')](_0xb9635a[_0x834e('0x33')][_0x834e('0x10a')],_[_0x834e('0x10b')](_0xb9635a[_0x834e('0x33')],[_0x834e('0x10a'),'id'])||{});}})[_0x834e('0x2c')](respondWithResult(_0x3c1a19,null))[_0x834e('0x22')](handleError(_0x3c1a19,null));};exports[_0x834e('0x10c')]=function(_0x18735a,_0x3446ff){var _0x1e11e0={'raw':![],'where':{}};var _0x38796c={};var _0x59bd0e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x834e('0xc5')]({'where':{'id':_0x18735a[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x3446ff,null))['then'](function(_0xf89b9e){if(_0xf89b9e){_0x38796c[_0x834e('0x49')]=_[_0x834e('0x4b')](db[_0x834e('0xee')][_0x834e('0x47')]);_0x38796c[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x18735a[_0x834e('0x4a')]);_0x38796c[_0x834e('0x4c')]=_['intersection'](_0x38796c[_0x834e('0x49')],_0x38796c[_0x834e('0x4a')]);_0x1e11e0[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x38796c['model'],qs[_0x834e('0x4f')](_0x18735a[_0x834e('0x4a')][_0x834e('0x4f')]));_0x1e11e0[_0x834e('0x4e')]=_0x1e11e0[_0x834e('0x4e')][_0x834e('0x50')]?_0x1e11e0[_0x834e('0x4e')]:_0x38796c[_0x834e('0x49')];if(!_0x18735a[_0x834e('0x4a')]['hasOwnProperty'](_0x834e('0x10d'))){_0x1e11e0['limit']=qs[_0x834e('0x26')](_0x18735a['query'][_0x834e('0x26')]);_0x1e11e0[_0x834e('0x25')]=qs[_0x834e('0x25')](_0x18735a[_0x834e('0x4a')][_0x834e('0x25')]);}_0x1e11e0['order']=qs[_0x834e('0x53')](_0x18735a[_0x834e('0x4a')]['sort']);_0x1e11e0['where']=qs[_0x834e('0x4c')](_['pick'](_0x18735a['query'],_0x38796c['filters']));_0x1e11e0[_0x834e('0x54')][_0x834e('0xbb')]=_0xf89b9e['id'];if(_0x18735a[_0x834e('0x4a')][_0x834e('0x8e')]){_0x1e11e0[_0x834e('0x54')]=_[_0x834e('0xa8')](_0x1e11e0[_0x834e('0x54')],{'$or':_['map'](_0x1e11e0[_0x834e('0x4e')],function(_0x278052){var _0x4a428c={};_0x4a428c[_0x278052]={'$like':'%'+_0x18735a['query'][_0x834e('0x8e')]+'%'};return _0x4a428c;})});}if(_0x18735a[_0x834e('0x4a')]['$gte']){var _0x5920f3=_0x18735a[_0x834e('0x4a')][_0x834e('0x85')][_0x834e('0x38')](',');var _0x599664={};_0x599664[_0x5920f3[0x0]]={'$gte':moment(_0x5920f3[0x1])[_0x834e('0xf1')](_0x834e('0x10e'))};_0x1e11e0[_0x834e('0x54')]=_['merge'](_0x1e11e0[_0x834e('0x54')],_0x599664);}_0x1e11e0=_['merge']({},_0x1e11e0,_0x18735a[_0x834e('0xc1')]);return db[_0x834e('0xee')][_0x834e('0x28')]({'where':_0x1e11e0[_0x834e('0x54')]})[_0x834e('0x2c')](function(_0x516a53){_0x59bd0e[_0x834e('0x28')]=_0x516a53;if(_0x18735a[_0x834e('0x4a')][_0x834e('0xbf')]){_0x1e11e0[_0x834e('0xc0')]=[{'all':!![]}];}return db[_0x834e('0xee')]['findAll'](_0x1e11e0);})['then'](function(_0x2ca127){_0x59bd0e[_0x834e('0x10f')]=_0x2ca127;return _0x59bd0e;});}})[_0x834e('0x2c')](respondWithFilteredResult(_0x3446ff,_0x1e11e0))['catch'](handleError(_0x3446ff,null));};exports[_0x834e('0x110')]=function(_0x2e3294,_0x28d9c3){var _0x386b73={'where':{}},_0x53faec={},_0x3cc563={'count':0x0,'rows':[]};return db[_0x834e('0x46')]['findOne']({'where':{'id':_0x2e3294[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x28d9c3,null))[_0x834e('0x2c')](function(_0x3e408c){if(_0x3e408c){_0x53faec['model']=_[_0x834e('0x4b')](db['ChatMessage'][_0x834e('0x47')]);_0x53faec[_0x834e('0x4a')]=_[_0x834e('0x4b')](_0x2e3294[_0x834e('0x4a')]);_0x53faec[_0x834e('0x4c')]=_[_0x834e('0x4d')](_0x53faec['model'],_0x53faec['query']);_0x386b73[_0x834e('0x4e')]=_[_0x834e('0x4d')](_0x53faec['model'],qs[_0x834e('0x4f')](_0x2e3294['query'][_0x834e('0x4f')]));_0x386b73[_0x834e('0x4e')]=_0x386b73[_0x834e('0x4e')][_0x834e('0x50')]?_0x386b73[_0x834e('0x4e')]:_0x53faec[_0x834e('0x49')];if(!_0x2e3294[_0x834e('0x4a')]['hasOwnProperty'](_0x834e('0x10d'))){_0x386b73[_0x834e('0x26')]=qs[_0x834e('0x26')](_0x2e3294[_0x834e('0x4a')][_0x834e('0x26')]);_0x386b73['offset']=qs[_0x834e('0x25')](_0x2e3294[_0x834e('0x4a')][_0x834e('0x25')]);}_0x386b73['order']=qs['sort'](_0x2e3294['query'][_0x834e('0x53')]);_0x386b73[_0x834e('0x54')]=qs[_0x834e('0x4c')](_[_0x834e('0x55')](_0x2e3294[_0x834e('0x4a')],_0x53faec[_0x834e('0x4c')]));_0x386b73[_0x834e('0x54')][_0x834e('0xbb')]=_0x3e408c['id'];if(_0x2e3294[_0x834e('0x4a')][_0x834e('0x8e')]){_0x386b73[_0x834e('0x54')]=_['merge'](_0x386b73[_0x834e('0x54')],{'$or':_[_0x834e('0x45')](_0x386b73[_0x834e('0x4e')],function(_0x26534d){var _0x4081a1={};_0x4081a1[_0x26534d]={'$like':'%'+_0x2e3294[_0x834e('0x4a')][_0x834e('0x8e')]+'%'};return _0x4081a1;})});}_0x386b73[_0x834e('0x54')]['secret']=![];if(_0x2e3294[_0x834e('0x4a')]['id']){_0x386b73[_0x834e('0x54')]['id']={'$gt':_0x2e3294['query']['id']};}_0x386b73=_[_0x834e('0xa8')]({},_0x386b73,_0x2e3294[_0x834e('0xc1')]);return db[_0x834e('0xee')][_0x834e('0x28')]({'where':_0x386b73['where']})['then'](function(_0x3d37c8){_0x3cc563['count']=_0x3d37c8;_0x386b73[_0x834e('0xc0')]=[];if(_0x2e3294[_0x834e('0x4a')][_0x834e('0x111')]){_0x386b73[_0x834e('0xc0')][_0x834e('0xbc')]({'model':db['User'],'as':_0x834e('0xef'),'attributes':['id','fullname','alias']});}if(_0x2e3294[_0x834e('0x4a')][_0x834e('0xbf')]){_0x386b73[_0x834e('0xc0')]=[{'all':!![]}];}return db[_0x834e('0xee')][_0x834e('0x112')](_0x386b73);})[_0x834e('0x2c')](function(_0x5912ee){_0x3cc563[_0x834e('0x10f')]=_0x5912ee;return _0x3cc563;});}})[_0x834e('0x2c')](respondWithFilteredResult(_0x28d9c3,_0x386b73))['catch'](handleError(_0x28d9c3,null));};exports[_0x834e('0x113')]=function(_0x3b4264,_0x4b070a){return db[_0x834e('0x46')][_0x834e('0x6f')]({'where':{'id':_0x3b4264['params']['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x4b070a,null))[_0x834e('0x2c')](function(_0x164170){if(_0x164170){return _0x164170[_0x834e('0x114')](_0x3b4264[_0x834e('0x33')][_0x834e('0x10a')],_[_0x834e('0x10b')](_0x3b4264[_0x834e('0x33')],[_0x834e('0x10a'),'id'])||{})[_0x834e('0x115')](function(){return db['Tag'][_0x834e('0x112')]({'attributes':['id',_0x834e('0x30'),_0x834e('0x57')],'where':{'id':_0x3b4264[_0x834e('0x33')][_0x834e('0x10a')]}});})[_0x834e('0x2c')](function(_0x2d61c1){socket[_0x834e('0x116')](_0x834e('0x117'),{'id':Number(_0x3b4264[_0x834e('0xbe')]['id']),'tags':_0x2d61c1||[]});return{'id':Number(_0x3b4264[_0x834e('0xbe')]['id']),'tags':_0x2d61c1||[]};});}})[_0x834e('0x2c')](respondWithResult(_0x4b070a,null))['catch'](handleError(_0x4b070a,null));};exports[_0x834e('0x118')]=function(_0x1cd122,_0x49be08){return db['ChatInteraction']['find']({'where':{'id':_0x1cd122[_0x834e('0xbe')]['id']}})[_0x834e('0x2c')](handleEntityNotFound(_0x49be08,null))[_0x834e('0x2c')](function(_0x3530bc){if(_0x3530bc){return _0x3530bc[_0x834e('0x118')](_0x1cd122[_0x834e('0x4a')][_0x834e('0x10a')]);}})['then'](respondWithStatusCode(_0x49be08,null))['catch'](handleError(_0x49be08,null));};exports['download']=function(_0x47947b,_0x684a97){var _0x3c8fc2=moment()[_0x834e('0x119')]()['toString']();var _0x5776c5=path['join'](config[_0x834e('0xe5')],'server','files',_0x834e('0x11a'));var _0x378bf3=path[_0x834e('0xe4')](config[_0x834e('0xe5')],_0x834e('0x11b'),_0x834e('0x11c'),_0x834e('0x11d'));var _0x59a706=path[_0x834e('0xe4')](_0x5776c5,_0x3c8fc2);var _0x11f472=util[_0x834e('0xf1')](_0x834e('0x11e'),_0x47947b[_0x834e('0xbe')]['id'],_0x3c8fc2);var _0x488f82=path[_0x834e('0xe4')](_0x5776c5,_0x11f472);var _0x5a3876=[];_0x5a3876[_0x834e('0xbc')]({'model':db[_0x834e('0xef')],'as':_0x834e('0xef'),'attributes':['id','fullname'],'raw':!![]});_0x5a3876['push']({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x834e('0x11f'),_0x834e('0x120')],'raw':!![]});if(_0x47947b['query']['attachments']){_0x5a3876[_0x834e('0xbc')]({'model':db[_0x834e('0xe1')],'as':_0x834e('0xe1'),'raw':!![]});}var _0x51f527=[{'model':db[_0x834e('0xee')],'as':_0x834e('0xf0'),'attributes':['id',_0x834e('0x33'),'createdAt',_0x834e('0xfd'),_0x834e('0xfe'),_0x834e('0x89')],'include':_0x5a3876}];_0x51f527[_0x834e('0xbc')]({'model':db[_0x834e('0xc6')],'as':_0x834e('0x121'),'attributes':['id',_0x834e('0x30')]});_0x51f527['push']({'model':db[_0x834e('0xef')],'as':_0x834e('0x122'),'attributes':['id',_0x834e('0xcb')]});return db['ChatInteraction'][_0x834e('0x6f')]({'where':{'id':_0x47947b[_0x834e('0xbe')]['id']},'include':_0x51f527})[_0x834e('0x2c')](handleEntityNotFound(_0x684a97,null))[_0x834e('0x2c')](function(_0x2bbb1a){if(_0x2bbb1a){var _0x1ffed9=_0x2bbb1a[_0x834e('0x123')]({'plain':!![]});fs[_0x834e('0x124')](_0x59a706);var _0x25fa75={'channel':_0x834e('0x125'),'account':_0x1ffed9[_0x834e('0x121')][_0x834e('0x30')],'agent':_0x1ffed9['Owner']?_0x1ffed9[_0x834e('0x122')]['fullname']:_0x834e('0x126'),'createdAt':moment(_0x1ffed9['createdAt'])[_0x834e('0xf1')](_0x834e('0x10e'))[_0x834e('0xa6')](),'closedAt':_0x1ffed9[_0x834e('0x40')]?moment(_0x1ffed9[_0x834e('0x127')])[_0x834e('0xf1')](_0x834e('0x10e'))[_0x834e('0xa6')]():'','disposition':_0x1ffed9['disposition'],'chatInfo':{'browser':_0x1ffed9['browserName'],'os':_0x1ffed9['osName'],'referer':_0x1ffed9[_0x834e('0x128')],'customerIp':_0x1ffed9[_0x834e('0x129')],'customerPort':_0x1ffed9[_0x834e('0x12a')]?_0x1ffed9[_0x834e('0x12a')]:_0x834e('0x126')},'messages':_(_0x1ffed9[_0x834e('0xf0')])[_0x834e('0x12b')]()[_0x834e('0x8e')]({'secret':![]})['map'](function(_0x5a312e){if(_0x5a312e[_0x834e('0xe1')]){var _0x42e5ee=path[_0x834e('0xe4')](_0x378bf3,_0x5a312e['Attachment']['basename']);if(fs[_0x834e('0x12c')](_0x42e5ee)){fs['createReadStream'](_0x42e5ee)[_0x834e('0x12d')](fs[_0x834e('0x12e')](path[_0x834e('0xe4')](_0x59a706,_0x5a312e['Attachment'][_0x834e('0xe7')])));}}return{'date':moment(_0x5a312e[_0x834e('0xfc')])[_0x834e('0xf1')](_0x834e('0x10e'))[_0x834e('0xa6')](),'sender':_0x5a312e[_0x834e('0xfd')]===_0x834e('0xd5')?_0x5a312e['User']?_0x5a312e[_0x834e('0xef')][_0x834e('0xcb')]:_0x834e('0xf4'):_0x5a312e[_0x834e('0x73')][_0x834e('0x11f')]+(_0x5a312e[_0x834e('0x73')][_0x834e('0x120')]?'\x20'+_0x5a312e['Contact']['lastName']:''),'body':_0x5a312e[_0x834e('0xe1')]?_0x5a312e['Attachment']['basename']:_0x5a312e[_0x834e('0x33')],'direction':_0x5a312e[_0x834e('0xfd')]==='out'?'A':'C','secret':_0x5a312e[_0x834e('0xfe')],'read':_0x5a312e['read'],'attachment':_0x5a312e['Attachment']};})[_0x834e('0x75')]()};return ejs['renderFile'](path[_0x834e('0xe4')](config[_0x834e('0xe5')],_0x834e('0x11b'),_0x834e('0x12f'),_0x834e('0x130')),{'interaction':_0x25fa75})[_0x834e('0x2c')](function(_0x1a48f9){var _0x196f86=path[_0x834e('0xe4')](_0x59a706,'transcript-'+_0x1ffed9['id']+'-'+_0x3c8fc2+_0x834e('0x131'));var _0x19a42c={'path':_0x196f86,'channel':_0x834e('0x125'),'interactionId':_0x1ffed9['id']};return pdf[_0x834e('0x132')](_0x1a48f9,_0x19a42c);})['then'](function(){return new Promise(function(_0x4b1178,_0x46e533){zipdir(_0x59a706,{'saveTo':_0x488f82},function(_0x13a7e1,_0x5d801a){if(_0x13a7e1)return _0x46e533(_0x13a7e1);return _0x4b1178(_0x5d801a);});})[_0x834e('0x2c')](function(){return new BPromise(function(_0x505821,_0x2f46cf){rimraf(_0x59a706,function(_0x884f38){if(_0x884f38)_0x2f46cf(_0x884f38);return _0x505821();});});})[_0x834e('0x2c')](function(){return _0x684a97[_0x834e('0xe8')](_0x488f82,_0x11f472,function(_0xd7026f){if(_0xd7026f){logger[_0x834e('0x1d')]('err',_0xd7026f);}else{fs['unlinkSync'](_0x488f82);}});});});}else{return _0x684a97['sendStatus'](0xc8);}})[_0x834e('0x22')](handleError(_0x684a97,null));};
\ No newline at end of file
index 086eb4b..43d7b76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5165=['then','Users','map','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','exports','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x3d2a82,_0x5a9e3e){var _0x31c99d=function(_0x2777f3){while(--_0x2777f3){_0x3d2a82['push'](_0x3d2a82['shift']());}};_0x31c99d(++_0x5a9e3e);}(_0x5165,0x160));var _0x5516=function(_0x1293fa,_0x446d6b){_0x1293fa=_0x1293fa-0x0;var _0x1dd054=_0x5165[_0x1293fa];return _0x1dd054;};'use strict';var EventEmitter=require('events');var ChatInteraction=require('../../mysqldb')['db'][_0x5516('0x0')];var ChatMessage=require(_0x5516('0x1'))['db'][_0x5516('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5516('0x3')](0x0);var events={'afterCreate':_0x5516('0x4'),'afterUpdate':_0x5516('0x5'),'afterDestroy':_0x5516('0x6')};function emitEvent(_0x50426f){return function(_0x70e745,_0x3c5cf2,_0x194e2d){_0x70e745[_0x5516('0x7')]({'attributes':['id'],'raw':!![]})[_0x5516('0x8')](function(_0x2f0035){_0x70e745['setDataValue'](_0x5516('0x9'),_0x2f0035[_0x5516('0xa')](function(_0x3d5774){return{'id':_0x3d5774['id']};}));return ChatMessage[_0x5516('0xb')]({'where':{'ChatInteractionId':_0x70e745['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5516('0x8')](function(_0x5f574b){_0x70e745[_0x5516('0xc')](_0x5516('0xd'),_0x5f574b['length']);ChatInteractionEvents[_0x5516('0xe')](_0x50426f+':'+_0x70e745['id'],_0x70e745);ChatInteractionEvents[_0x5516('0xe')](_0x50426f,_0x70e745);_0x194e2d(null);})[_0x5516('0xf')](_0x194e2d(null));};}for(var e in events){if(events[_0x5516('0x10')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x5516('0x11')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xe17b=['ChatInteraction','ChatMessage','save','update','remove','getUsers','then','Users','map','setDataValue','unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xd2d54,_0x5329f7){var _0x78b113=function(_0x7d2b29){while(--_0x7d2b29){_0xd2d54['push'](_0xd2d54['shift']());}};_0x78b113(++_0x5329f7);}(_0xe17b,0x152));var _0xbe17=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xe17b[_0x53ccf2];return _0x5a2964;};'use strict';var EventEmitter=require(_0xbe17('0x0'));var ChatInteraction=require(_0xbe17('0x1'))['db'][_0xbe17('0x2')];var ChatMessage=require(_0xbe17('0x1'))['db'][_0xbe17('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe17('0x4'),'afterUpdate':_0xbe17('0x5'),'afterDestroy':_0xbe17('0x6')};function emitEvent(_0x12f97c){return function(_0x197ba8,_0x88c097,_0x5bea63){_0x197ba8[_0xbe17('0x7')]({'attributes':['id'],'raw':!![]})[_0xbe17('0x8')](function(_0x13cca2){_0x197ba8['setDataValue'](_0xbe17('0x9'),_0x13cca2[_0xbe17('0xa')](function(_0x13725b){return{'id':_0x13725b['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x197ba8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbe17('0x8')](function(_0x1997c9){_0x197ba8[_0xbe17('0xb')](_0xbe17('0xc'),_0x1997c9['length']);ChatInteractionEvents[_0xbe17('0xd')](_0x12f97c+':'+_0x197ba8['id'],_0x197ba8);ChatInteractionEvents[_0xbe17('0xd')](_0x12f97c,_0x197ba8);_0x5bea63(null);})['catch'](_0x5bea63(null));};}for(var e in events){if(events[_0xbe17('0xe')](e)){var event=events[e];ChatInteraction[_0xbe17('0xf')](e,emitEvent(event));}}module[_0xbe17('0x10')]=ChatInteractionEvents;
\ No newline at end of file
index 44c5366..23406ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea4e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4'];(function(_0x215264,_0x5d4324){var _0x1965ed=function(_0x11097f){while(--_0x11097f){_0x215264['push'](_0x215264['shift']());}};_0x1965ed(++_0x5d4324);}(_0xea4e,0x10e));var _0xeea4=function(_0x9d1971,_0x50b82e){_0x9d1971=_0x9d1971-0x0;var _0x203469=_0xea4e[_0x9d1971];return _0x203469;};'use strict';var _=require(_0xeea4('0x0'));var util=require(_0xeea4('0x1'));var logger=require(_0xeea4('0x2'))(_0xeea4('0x3'));var moment=require(_0xeea4('0x4'));var BPromise=require(_0xeea4('0x5'));var rp=require(_0xeea4('0x6'));var fs=require('fs');var path=require(_0xeea4('0x7'));var rimraf=require('rimraf');var config=require(_0xeea4('0x8'));var attributes=require(_0xeea4('0x9'));module[_0xeea4('0xa')]=function(_0x32333a,_0x391a6c){return _0x32333a[_0xeea4('0xb')](_0xeea4('0xc'),attributes,{'tableName':_0xeea4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a4ad9,_0x371c40,_0x116c65){if(_0x5a4ad9[_0xeea4('0xe')]('closed')){_0x5a4ad9['closedAt']=moment()[_0xeea4('0xf')](_0xeea4('0x10'));}_0x116c65(null,_0x5a4ad9);}},'charset':_0xeea4('0x11'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xab38=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','api','moment'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xab38,0x13e));var _0x8ab3=function(_0x44435b,_0x1a65f4){_0x44435b=_0x44435b-0x0;var _0x332e3=_0xab38[_0x44435b];return _0x332e3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8ab3('0x0'));var moment=require(_0x8ab3('0x1'));var BPromise=require(_0x8ab3('0x2'));var rp=require(_0x8ab3('0x3'));var fs=require('fs');var path=require(_0x8ab3('0x4'));var rimraf=require(_0x8ab3('0x5'));var config=require(_0x8ab3('0x6'));var attributes=require('./chatInteraction.attributes');module[_0x8ab3('0x7')]=function(_0x5a3009,_0x1a065c){return _0x5a3009[_0x8ab3('0x8')](_0x8ab3('0x9'),attributes,{'tableName':_0x8ab3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x200c43,_0x176ef8,_0x2325db){if(_0x200c43[_0x8ab3('0xb')](_0x8ab3('0xc'))){_0x200c43['closedAt']=moment()[_0x8ab3('0xd')](_0x8ab3('0xe'));}_0x2325db(null,_0x200c43);}},'charset':_0x8ab3('0xf'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index d8799c9..bd74ba3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d87=['moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateChatInteraction','update','body','raw','options','where','attributes','limit','catch','addTags','omit','spread','AddTags','lodash','util'];(function(_0x4928f8,_0x10efbb){var _0x38df27=function(_0x30d465){while(--_0x30d465){_0x4928f8['push'](_0x4928f8['shift']());}};_0x38df27(++_0x10efbb);}(_0x3d87,0x18e));var _0x73d8=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3d87[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x73d8('0x0'));var util=require(_0x73d8('0x1'));var moment=require(_0x73d8('0x2'));var BPromise=require(_0x73d8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x73d8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x73d8('0x5'));var logger=require(_0x73d8('0x6'))(_0x73d8('0x7'));var config=require(_0x73d8('0x8'));var jayson=require(_0x73d8('0x9'));var client=jayson[_0x73d8('0xa')]['http']({'port':0x232a});config['redis']=_[_0x73d8('0xb')](config[_0x73d8('0xc')],{'host':_0x73d8('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73d8('0xc')]));require(_0x73d8('0xe'))[_0x73d8('0xf')](socket);function respondWithRpcPromise(_0xe22056,_0x29034b,_0x562eb5){return new BPromise(function(_0x2aee74,_0x3970f2){return client['request'](_0xe22056,_0x562eb5)[_0x73d8('0x10')](function(_0x53b37b){logger[_0x73d8('0x11')](_0x73d8('0x12'),_0x29034b,_0x73d8('0x13'));logger[_0x73d8('0x14')](_0x73d8('0x15'),_0x29034b,_0x73d8('0x13'),JSON[_0x73d8('0x16')](_0x53b37b));if(_0x53b37b[_0x73d8('0x17')]){if(_0x53b37b['error'][_0x73d8('0x18')]===0x1f4){logger[_0x73d8('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x29034b,_0x53b37b[_0x73d8('0x17')][_0x73d8('0x19')]);return _0x3970f2(_0x53b37b[_0x73d8('0x17')][_0x73d8('0x19')]);}logger[_0x73d8('0x17')](_0x73d8('0x12'),_0x29034b,_0x53b37b[_0x73d8('0x17')][_0x73d8('0x19')]);return _0x2aee74(_0x53b37b['error'][_0x73d8('0x19')]);}else{logger[_0x73d8('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x29034b,'request\x20sent');_0x2aee74(_0x53b37b[_0x73d8('0x1a')][_0x73d8('0x19')]);}})['catch'](function(_0x542773){logger[_0x73d8('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x29034b,_0x542773);_0x3970f2(_0x542773);});});}exports[_0x73d8('0x1b')]=function(_0x36e94b){var _0xa8c8d9=this;return new Promise(function(_0x3d0f59,_0x667b4){return db['ChatInteraction'][_0x73d8('0x1c')](_0x36e94b[_0x73d8('0x1d')],{'raw':_0x36e94b['options']?_0x36e94b['options'][_0x73d8('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36e94b['options']?_0x36e94b[_0x73d8('0x1f')][_0x73d8('0x20')]||null:null,'attributes':_0x36e94b['options']?_0x36e94b[_0x73d8('0x1f')][_0x73d8('0x21')]||null:null,'limit':_0x36e94b['options']?_0x36e94b[_0x73d8('0x1f')][_0x73d8('0x22')]||null:null})[_0x73d8('0x10')](function(_0x50f3c5){logger['info'](_0x73d8('0x1b'),_0x36e94b);logger['debug']('UpdateChatInteraction',_0x36e94b,JSON['stringify'](_0x50f3c5));_0x3d0f59(_0x50f3c5);})[_0x73d8('0x23')](function(_0x104109){logger[_0x73d8('0x17')](_0x73d8('0x1b'),_0x104109[_0x73d8('0x19')],_0x36e94b);_0x667b4(_0xa8c8d9[_0x73d8('0x17')](0x1f4,_0x104109[_0x73d8('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x132dd1){return new Promise(function(_0x477247,_0x49cc21){return db['ChatInteraction']['find']({'where':_0x132dd1[_0x73d8('0x1f')]?_0x132dd1[_0x73d8('0x1f')][_0x73d8('0x20')]||null:null})[_0x73d8('0x10')](function(_0x5d60df){if(_0x5d60df){return _0x5d60df[_0x73d8('0x24')](_0x132dd1[_0x73d8('0x1d')]['ids'],_[_0x73d8('0x25')](_0x132dd1[_0x73d8('0x1d')],['ids','id'])||{});}})[_0x73d8('0x26')](function(_0x1882d8){logger['info'](_0x73d8('0x27'),_0x132dd1);logger[_0x73d8('0x14')](_0x73d8('0x27'),_0x132dd1,JSON[_0x73d8('0x16')](_0x1882d8));_0x477247(_0x1882d8);})['catch'](function(_0x51ff7d){logger[_0x73d8('0x17')](_0x73d8('0x27'),_0x51ff7d['message'],_0x132dd1);_0x49cc21(_this[_0x73d8('0x17')](0x1f4,_0x51ff7d[_0x73d8('0x19')]));});});};
\ No newline at end of file
+var _0x6159=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','request\x20sent','result','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','limit','debug','catch','AddTagsToChatInteraction','find','addTags','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x21481c,_0x1b51ba){var _0x5dd77a=function(_0x4ee13c){while(--_0x4ee13c){_0x21481c['push'](_0x21481c['shift']());}};_0x5dd77a(++_0x1b51ba);}(_0x6159,0x197));var _0x9615=function(_0x5e8644,_0x1d02d0){_0x5e8644=_0x5e8644-0x0;var _0x353a5e=_0x6159[_0x5e8644];return _0x353a5e;};'use strict';var _=require(_0x9615('0x0'));var util=require(_0x9615('0x1'));var moment=require(_0x9615('0x2'));var BPromise=require(_0x9615('0x3'));var rs=require(_0x9615('0x4'));var fs=require('fs');var Redis=require(_0x9615('0x5'));var db=require(_0x9615('0x6'))['db'];var utils=require(_0x9615('0x7'));var logger=require(_0x9615('0x8'))(_0x9615('0x9'));var config=require(_0x9615('0xa'));var jayson=require(_0x9615('0xb'));var client=jayson[_0x9615('0xc')][_0x9615('0xd')]({'port':0x232a});config[_0x9615('0xe')]=_[_0x9615('0xf')](config[_0x9615('0xe')],{'host':_0x9615('0x10'),'port':0x18eb});var socket=require(_0x9615('0x11'))(new Redis(config[_0x9615('0xe')]));require(_0x9615('0x12'))['register'](socket);function respondWithRpcPromise(_0x300710,_0xedd726,_0x2072b5){return new BPromise(function(_0x1bc77f,_0x12e68a){return client[_0x9615('0x13')](_0x300710,_0x2072b5)[_0x9615('0x14')](function(_0x184e4e){logger[_0x9615('0x15')]('ChatInteraction,\x20%s,\x20%s',_0xedd726,'request\x20sent');logger['debug'](_0x9615('0x16'),_0xedd726,'request\x20sent',JSON[_0x9615('0x17')](_0x184e4e));if(_0x184e4e[_0x9615('0x18')]){if(_0x184e4e['error'][_0x9615('0x19')]===0x1f4){logger[_0x9615('0x18')](_0x9615('0x1a'),_0xedd726,_0x184e4e['error'][_0x9615('0x1b')]);return _0x12e68a(_0x184e4e[_0x9615('0x18')][_0x9615('0x1b')]);}logger[_0x9615('0x18')](_0x9615('0x1a'),_0xedd726,_0x184e4e['error'][_0x9615('0x1b')]);return _0x1bc77f(_0x184e4e[_0x9615('0x18')]['message']);}else{logger[_0x9615('0x15')](_0x9615('0x1a'),_0xedd726,_0x9615('0x1c'));_0x1bc77f(_0x184e4e[_0x9615('0x1d')][_0x9615('0x1b')]);}})['catch'](function(_0x46e90c){logger[_0x9615('0x18')](_0x9615('0x1a'),_0xedd726,_0x46e90c);_0x12e68a(_0x46e90c);});});}exports[_0x9615('0x1e')]=function(_0xe953e8){var _0x4e5cc2=this;return new Promise(function(_0x3a6146,_0x24e885){return db[_0x9615('0x1f')][_0x9615('0x20')](_0xe953e8[_0x9615('0x21')],{'raw':_0xe953e8[_0x9615('0x22')]?_0xe953e8['options'][_0x9615('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe953e8[_0x9615('0x22')]?_0xe953e8['options'][_0x9615('0x24')]||null:null,'attributes':_0xe953e8[_0x9615('0x22')]?_0xe953e8[_0x9615('0x22')][_0x9615('0x25')]||null:null,'limit':_0xe953e8[_0x9615('0x22')]?_0xe953e8['options'][_0x9615('0x26')]||null:null})['then'](function(_0x3125d6){logger[_0x9615('0x15')](_0x9615('0x1e'),_0xe953e8);logger[_0x9615('0x27')]('UpdateChatInteraction',_0xe953e8,JSON[_0x9615('0x17')](_0x3125d6));_0x3a6146(_0x3125d6);})[_0x9615('0x28')](function(_0x556ea9){logger['error'](_0x9615('0x1e'),_0x556ea9[_0x9615('0x1b')],_0xe953e8);_0x24e885(_0x4e5cc2[_0x9615('0x18')](0x1f4,_0x556ea9[_0x9615('0x1b')]));});});};exports[_0x9615('0x29')]=function(_0x52b7a7){return new Promise(function(_0x7552fc,_0xfa705d){return db['ChatInteraction'][_0x9615('0x2a')]({'where':_0x52b7a7['options']?_0x52b7a7[_0x9615('0x22')][_0x9615('0x24')]||null:null})[_0x9615('0x14')](function(_0x8ee7a8){if(_0x8ee7a8){return _0x8ee7a8[_0x9615('0x2b')](_0x52b7a7[_0x9615('0x21')]['ids'],_[_0x9615('0x2c')](_0x52b7a7[_0x9615('0x21')],['ids','id'])||{});}})['spread'](function(_0x4f35a9){logger[_0x9615('0x15')]('AddTags',_0x52b7a7);logger[_0x9615('0x27')](_0x9615('0x2d'),_0x52b7a7,JSON[_0x9615('0x17')](_0x4f35a9));_0x7552fc(_0x4f35a9);})[_0x9615('0x28')](function(_0x467a56){logger[_0x9615('0x18')](_0x9615('0x2d'),_0x467a56[_0x9615('0x1b')],_0x52b7a7);_0xfa705d(_this[_0x9615('0x18')](0x1f4,_0x467a56[_0x9615('0x1b')]));});});};
\ No newline at end of file
index 86c6238..7d8d4e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc560=['./chatInteraction.events','remove','emit','removeListener','length'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xc560,0x82));var _0x0c56=function(_0x98cfa6,_0x4513e3){_0x98cfa6=_0x98cfa6-0x0;var _0x3e7e7a=_0xc560[_0x98cfa6];return _0x3e7e7a;};'use strict';var ChatInteractionEvents=require(_0x0c56('0x0'));var events=['save',_0x0c56('0x1'),'update'];function createListener(_0x2c4115,_0x5b4dfe){return function(_0x5c33dd){_0x5b4dfe[_0x0c56('0x2')](_0x2c4115,_0x5c33dd);};}function removeListener(_0x39dbc7,_0x37c584){return function(){ChatInteractionEvents[_0x0c56('0x3')](_0x39dbc7,_0x37c584);};}exports['register']=function(_0x2b5654){for(var _0x2bc0a0=0x0,_0x35b4ee=events[_0x0c56('0x4')];_0x2bc0a0<_0x35b4ee;_0x2bc0a0++){var _0x501a0b=events[_0x2bc0a0];var _0x429ad1=createListener('chatInteraction:'+_0x501a0b,_0x2b5654);ChatInteractionEvents['on'](_0x501a0b,_0x429ad1);}};
\ No newline at end of file
+var _0x4c88=['save','emit','register','length','./chatInteraction.events'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0x4c88,0x1c6));var _0x84c8=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x4c88[_0x2c91e9];return _0x13f0ff;};'use strict';var ChatInteractionEvents=require(_0x84c8('0x0'));var events=[_0x84c8('0x1'),'remove','update'];function createListener(_0xd2bde3,_0x2e112c){return function(_0x1beee5){_0x2e112c[_0x84c8('0x2')](_0xd2bde3,_0x1beee5);};}function removeListener(_0x1bb0b0,_0xb96aca){return function(){ChatInteractionEvents['removeListener'](_0x1bb0b0,_0xb96aca);};}exports[_0x84c8('0x3')]=function(_0x1d0174){for(var _0x3c2909=0x0,_0x3b0d24=events[_0x84c8('0x4')];_0x3c2909<_0x3b0d24;_0x3c2909++){var _0x573d37=events[_0x3c2909];var _0x7acbd6=createListener('chatInteraction:'+_0x573d37,_0x1d0174);ChatInteractionEvents['on'](_0x573d37,_0x7acbd6);}};
\ No newline at end of file
index d278b0d..b92c337 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c53=['/:id/my_messages','getMyMessages','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','/:id/attachment_upload','file','addMessage','tracked','chat','chatinteraction:addtags','addTags','put','/:id/custom_update','customUpdate','/:id/abandon','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages'];(function(_0x559491,_0x4d316d){var _0x4d05b2=function(_0x419719){while(--_0x419719){_0x559491['push'](_0x559491['shift']());}};_0x4d05b2(++_0x4d316d);}(_0x3c53,0x108));var _0x33c5=function(_0x10ac4c,_0x137e61){_0x10ac4c=_0x10ac4c-0x0;var _0x56d383=_0x3c53[_0x10ac4c];return _0x56d383;};'use strict';var multer=require('multer');var util=require(_0x33c5('0x0'));var path=require('path');var timeout=require(_0x33c5('0x1'));var express=require(_0x33c5('0x2'));var router=express[_0x33c5('0x3')]();var fs_extra=require(_0x33c5('0x4'));var auth=require(_0x33c5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x33c5('0x6'));var controller=require('./chatInteraction.controller');router[_0x33c5('0x7')]('/',auth[_0x33c5('0x8')](),controller[_0x33c5('0x9')]);router[_0x33c5('0x7')](_0x33c5('0xa'),auth[_0x33c5('0x8')](),controller[_0x33c5('0xb')]);router['get'](_0x33c5('0xc'),auth[_0x33c5('0xd')](),controller[_0x33c5('0xe')]);router['get'](_0x33c5('0xf'),auth[_0x33c5('0xd')](),controller['attachmentDownload']);router[_0x33c5('0x7')](_0x33c5('0x10'),auth[_0x33c5('0x8')](),controller[_0x33c5('0x11')]);router[_0x33c5('0x7')](_0x33c5('0x12'),auth[_0x33c5('0xd')](),controller[_0x33c5('0x13')]);router['get']('/:id/download',auth[_0x33c5('0x8')](),controller['download']);router['post']('/',auth[_0x33c5('0x8')](),controller[_0x33c5('0x14')]);router[_0x33c5('0x15')](_0x33c5('0x16'),auth[_0x33c5('0x8')](),controller[_0x33c5('0x17')]);var upload=multer({'storage':multer[_0x33c5('0x18')]({'destination':function(_0x5dd352,_0x34d5d8,_0x54fd8a){_0x54fd8a(null,path[_0x33c5('0x19')](config[_0x33c5('0x1a')],_0x33c5('0x1b')));},'filename':function(_0x1ac42e,_0x26838b,_0x110626){_0x110626(null,util[_0x33c5('0x1c')](_0x33c5('0x1d'),Date['now'](),_0x26838b['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x33c5('0x15')](_0x33c5('0x1e'),upload['single'](_0x33c5('0x1f')),controller['attachmentUpload']);router[_0x33c5('0x15')](_0x33c5('0x10'),auth[_0x33c5('0xd')](),controller[_0x33c5('0x20')]);router[_0x33c5('0x15')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x33c5('0x21')](_0x33c5('0x22'),_0x33c5('0x23')),controller[_0x33c5('0x24')]);router[_0x33c5('0x25')](_0x33c5('0xc'),auth['isAuthenticated'](),interaction[_0x33c5('0x21')](_0x33c5('0x22'),'chatinteraction:update'),controller['update']);router[_0x33c5('0x25')](_0x33c5('0x26'),controller[_0x33c5('0x27')]);router['put'](_0x33c5('0x28'),auth[_0x33c5('0xd')](),controller['abandon']);router[_0x33c5('0x25')]('/:id/close',controller[_0x33c5('0x29')]);router[_0x33c5('0x2a')](_0x33c5('0xc'),auth['isAuthenticated'](),interaction[_0x33c5('0x21')](_0x33c5('0x22'),_0x33c5('0x2b')),controller[_0x33c5('0x2c')]);router[_0x33c5('0x2a')]('/:id/tags',auth['isAuthenticated'](),controller[_0x33c5('0x2d')]);module[_0x33c5('0x2e')]=router;
\ No newline at end of file
+var _0xafc1=['../../components/interaction/service','get','isAuthenticated','index','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','create','post','/:id/vidaoo','diskStorage','root','format','%s-%s','now','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','addTags','put','chat','update','customUpdate','/:id/abandon','/:id/close','close','tracked','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x52c4e9,_0x5412d0){var _0x252a03=function(_0x57857c){while(--_0x57857c){_0x52c4e9['push'](_0x52c4e9['shift']());}};_0x252a03(++_0x5412d0);}(_0xafc1,0x86));var _0x1afc=function(_0x14bafd,_0x1a20ea){_0x14bafd=_0x14bafd-0x0;var _0x2bb48d=_0xafc1[_0x14bafd];return _0x2bb48d;};'use strict';var multer=require(_0x1afc('0x0'));var util=require(_0x1afc('0x1'));var path=require(_0x1afc('0x2'));var timeout=require('connect-timeout');var express=require(_0x1afc('0x3'));var router=express[_0x1afc('0x4')]();var fs_extra=require(_0x1afc('0x5'));var auth=require(_0x1afc('0x6'));var interaction=require(_0x1afc('0x7'));var config=require('../../config/environment');var controller=require('./chatInteraction.controller');router[_0x1afc('0x8')]('/',auth[_0x1afc('0x9')](),controller[_0x1afc('0xa')]);router[_0x1afc('0x8')]('/describe',auth[_0x1afc('0x9')](),controller[_0x1afc('0xb')]);router[_0x1afc('0x8')](_0x1afc('0xc'),auth[_0x1afc('0xd')](),controller[_0x1afc('0xe')]);router[_0x1afc('0x8')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x1afc('0xf')]);router[_0x1afc('0x8')](_0x1afc('0x10'),auth['isAuthenticated'](),controller[_0x1afc('0x11')]);router[_0x1afc('0x8')](_0x1afc('0x12'),auth[_0x1afc('0xd')](),controller['getMyMessages']);router[_0x1afc('0x8')](_0x1afc('0x13'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x1afc('0x9')](),controller[_0x1afc('0x14')]);router[_0x1afc('0x15')](_0x1afc('0x16'),auth[_0x1afc('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x1afc('0x17')]({'destination':function(_0x5b5191,_0x3d91b2,_0x209973){_0x209973(null,path['join'](config[_0x1afc('0x18')],'server/files/attachments/'));},'filename':function(_0x469479,_0x47b1b8,_0x27ea91){_0x27ea91(null,util[_0x1afc('0x19')](_0x1afc('0x1a'),Date[_0x1afc('0x1b')](),_0x47b1b8['originalname'][_0x1afc('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x1afc('0x15')](_0x1afc('0x1d'),upload[_0x1afc('0x1e')]('file'),controller[_0x1afc('0x1f')]);router[_0x1afc('0x15')](_0x1afc('0x10'),auth['isChatInteractionAuthorized'](),controller[_0x1afc('0x20')]);router[_0x1afc('0x15')](_0x1afc('0x21'),auth[_0x1afc('0x9')](),interaction['tracked']('chat','chatinteraction:addtags'),controller[_0x1afc('0x22')]);router[_0x1afc('0x23')](_0x1afc('0xc'),auth[_0x1afc('0x9')](),interaction['tracked'](_0x1afc('0x24'),'chatinteraction:update'),controller[_0x1afc('0x25')]);router[_0x1afc('0x23')]('/:id/custom_update',controller[_0x1afc('0x26')]);router[_0x1afc('0x23')](_0x1afc('0x27'),auth[_0x1afc('0xd')](),controller['abandon']);router[_0x1afc('0x23')](_0x1afc('0x28'),controller[_0x1afc('0x29')]);router['delete'](_0x1afc('0xc'),auth['isAuthenticated'](),interaction[_0x1afc('0x2a')](_0x1afc('0x24'),_0x1afc('0x2b')),controller[_0x1afc('0x2c')]);router['delete'](_0x1afc('0x21'),auth[_0x1afc('0x9')](),controller[_0x1afc('0x2d')]);module[_0x1afc('0x2e')]=router;
\ No newline at end of file
index a927a55..b689024 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53db=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x240193,_0x231fdf){var _0x14a322=function(_0x24f8c2){while(--_0x24f8c2){_0x240193['push'](_0x240193['shift']());}};_0x14a322(++_0x231fdf);}(_0x53db,0xc0));var _0xb53d=function(_0x15ff01,_0x3b26d1){_0x15ff01=_0x15ff01-0x0;var _0x2bd417=_0x53db[_0x15ff01];return _0x2bd417;};'use strict';var Sequelize=require(_0xb53d('0x0'));module[_0xb53d('0x1')]={'body':{'type':Sequelize[_0xb53d('0x2')](_0xb53d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb53d('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb53d('0x5')]}};
\ No newline at end of file
+var _0x6db2=['INTEGER','sequelize','medium','BOOLEAN'];(function(_0x193003,_0x40d469){var _0x468d1e=function(_0x26ec53){while(--_0x26ec53){_0x193003['push'](_0x193003['shift']());}};_0x468d1e(++_0x40d469);}(_0x6db2,0x15d));var _0x26db=function(_0x128a79,_0x19f331){_0x128a79=_0x128a79-0x0;var _0x2ff426=_0x6db2[_0x128a79];return _0x2ff426;};'use strict';var Sequelize=require(_0x26db('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x26db('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x26db('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x26db('0x3')]}};
\ No newline at end of file
index 3310b96..f051e19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedb6=['read','all','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','ChatInternalMessage','includeAll','findAll','rows','show','params','find','catch','body','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','user','fullname','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','createdAt','FromId','ToId'];(function(_0xa43999,_0x5a6538){var _0x2075af=function(_0x35366d){while(--_0x35366d){_0xa43999['push'](_0xa43999['shift']());}};_0x2075af(++_0x5a6538);}(_0xedb6,0x1b6));var _0x6edb=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0xedb6[_0x261e29];return _0x25ef43;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6edb('0x0'));var jsonpatch=require(_0x6edb('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6edb('0x2'));var Mustache=require(_0x6edb('0x3'));var util=require(_0x6edb('0x4'));var path=require(_0x6edb('0x5'));var sox=require(_0x6edb('0x6'));var csv=require('to-csv');var ejs=require(_0x6edb('0x7'));var fs=require('fs');var fs_extra=require(_0x6edb('0x8'));var _=require(_0x6edb('0x9'));var squel=require(_0x6edb('0xa'));var crypto=require('crypto');var jsforce=require(_0x6edb('0xb'));var deskjs=require(_0x6edb('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6edb('0xd'));var Papa=require(_0x6edb('0xe'));var Redis=require('ioredis');var authService=require(_0x6edb('0xf'));var qs=require(_0x6edb('0x10'));var as=require(_0x6edb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6edb('0x12'));var utils=require(_0x6edb('0x13'));var config=require(_0x6edb('0x14'));var licenseUtil=require(_0x6edb('0x15'));var db=require('../../mysqldb')['db'];config[_0x6edb('0x16')]=_['defaults'](config[_0x6edb('0x16')],{'host':_0x6edb('0x17'),'port':0x18eb});var socket=require(_0x6edb('0x18'))(new Redis(config[_0x6edb('0x16')]));require(_0x6edb('0x19'))[_0x6edb('0x1a')](socket);function respondWithStatusCode(_0x55af5e,_0x53d420){_0x53d420=_0x53d420||0xcc;return function(_0x152eb0){if(_0x152eb0){return _0x55af5e[_0x6edb('0x1b')](_0x53d420);}return _0x55af5e[_0x6edb('0x1c')](_0x53d420)[_0x6edb('0x1d')]();};}function respondWithResult(_0x3ab42c,_0x1c37b5){_0x1c37b5=_0x1c37b5||0xc8;return function(_0x5a4c73){if(_0x5a4c73){return _0x3ab42c['status'](_0x1c37b5)[_0x6edb('0x1e')](_0x5a4c73);}};}function respondWithFilteredResult(_0x30a727,_0x2dfda0){return function(_0x1d57f0){if(_0x1d57f0){var _0x3f2338=typeof _0x2dfda0[_0x6edb('0x1f')]===_0x6edb('0x20')&&typeof _0x2dfda0[_0x6edb('0x21')]===_0x6edb('0x20');var _0xee1b65=_0x1d57f0[_0x6edb('0x22')];var _0x277e90=_0x3f2338?0x0:_0x2dfda0['offset'];var _0x38f26c=_0x3f2338?_0x1d57f0[_0x6edb('0x22')]:_0x2dfda0[_0x6edb('0x1f')]+_0x2dfda0[_0x6edb('0x21')];var _0x4b3242;if(_0x38f26c>=_0xee1b65){_0x38f26c=_0xee1b65;_0x4b3242=0xc8;}else{_0x4b3242=0xce;}_0x30a727['status'](_0x4b3242);return _0x30a727['set']('Content-Range',_0x277e90+'-'+_0x38f26c+'/'+_0xee1b65)[_0x6edb('0x1e')](_0x1d57f0);}return null;};}function patchUpdates(_0x3cca94){return function(_0x7f7ffa){try{jsonpatch['apply'](_0x7f7ffa,_0x3cca94,!![]);}catch(_0x3f4678){return BPromise['reject'](_0x3f4678);}return _0x7f7ffa[_0x6edb('0x23')]();};}function saveUpdates(_0x5a84bd,_0x12d439){return function(_0x56bc1b){if(_0x56bc1b){return _0x56bc1b[_0x6edb('0x24')](_0x5a84bd)[_0x6edb('0x25')](function(_0x180db7){return _0x180db7;});}return null;};}function removeEntity(_0x390455,_0x2e5190){return function(_0x3fd4e1){if(_0x3fd4e1){return _0x3fd4e1[_0x6edb('0x26')]()['then'](function(){_0x390455[_0x6edb('0x1c')](0xcc)[_0x6edb('0x1d')]();});}};}function handleEntityNotFound(_0x334aec,_0x1cbd56){return function(_0x2a02ce){if(!_0x2a02ce){_0x334aec['sendStatus'](0x194);}return _0x2a02ce;};}function handleError(_0x491f88,_0x391719){_0x391719=_0x391719||0x1f4;return function(_0x3e131f){logger[_0x6edb('0x27')](_0x3e131f['stack']);if(_0x3e131f['name']){delete _0x3e131f[_0x6edb('0x28')];}_0x491f88[_0x6edb('0x1c')](_0x391719)[_0x6edb('0x29')](_0x3e131f);};}exports[_0x6edb('0x2a')]=function(_0xfeaf22,_0x12e598){var _0x2879bd={},_0x591c36={},_0x49464a={'count':0x0,'rows':[]};var _0x209c49=_[_0x6edb('0x2b')](db['ChatInternalMessage'][_0x6edb('0x2c')],function(_0x3e9486){return{'name':_0x3e9486[_0x6edb('0x2d')],'type':_0x3e9486[_0x6edb('0x2e')][_0x6edb('0x2f')]};});_0x591c36[_0x6edb('0x30')]=_[_0x6edb('0x2b')](_0x209c49,_0x6edb('0x28'));_0x591c36[_0x6edb('0x31')]=_[_0x6edb('0x32')](_0xfeaf22['query']);_0x591c36[_0x6edb('0x33')]=_[_0x6edb('0x34')](_0x591c36[_0x6edb('0x30')],_0x591c36['query']);_0x2879bd[_0x6edb('0x35')]=_[_0x6edb('0x34')](_0x591c36[_0x6edb('0x30')],qs[_0x6edb('0x36')](_0xfeaf22['query']['fields']));_0x2879bd[_0x6edb('0x35')]=_0x2879bd[_0x6edb('0x35')][_0x6edb('0x37')]?_0x2879bd[_0x6edb('0x35')]:_0x591c36['model'];if(!_0xfeaf22[_0x6edb('0x31')][_0x6edb('0x38')](_0x6edb('0x39'))){_0x2879bd['limit']=qs['limit'](_0xfeaf22['query'][_0x6edb('0x21')]);_0x2879bd[_0x6edb('0x1f')]=qs['offset'](_0xfeaf22[_0x6edb('0x31')][_0x6edb('0x1f')]);}_0x2879bd['order']=qs[_0x6edb('0x3a')](_0xfeaf22['query'][_0x6edb('0x3a')]);_0x2879bd[_0x6edb('0x3b')]=qs[_0x6edb('0x33')](_[_0x6edb('0x3c')](_0xfeaf22[_0x6edb('0x31')],_0x591c36['filters']),_0x209c49);if(_0xfeaf22[_0x6edb('0x31')]['filter']){_0x2879bd['where']=_['merge'](_0x2879bd[_0x6edb('0x3b')],{'$or':_[_0x6edb('0x2b')](_0x209c49,function(_0x34b893){if(_0x34b893[_0x6edb('0x2e')]!==_0x6edb('0x3d')){var _0x2e452f={};_0x2e452f[_0x34b893[_0x6edb('0x28')]]={'$like':'%'+_0xfeaf22[_0x6edb('0x31')][_0x6edb('0x3e')]+'%'};return _0x2e452f;}})});}_0x2879bd=_[_0x6edb('0x3f')]({},_0x2879bd,_0xfeaf22[_0x6edb('0x40')]);var _0x35374a={'where':_0x2879bd[_0x6edb('0x3b')]};return db[_0x6edb('0x41')][_0x6edb('0x22')](_0x35374a)[_0x6edb('0x25')](function(_0x1f7389){_0x49464a[_0x6edb('0x22')]=_0x1f7389;if(_0xfeaf22['query'][_0x6edb('0x42')]){_0x2879bd['include']=[{'all':!![]}];}return db[_0x6edb('0x41')][_0x6edb('0x43')](_0x2879bd);})[_0x6edb('0x25')](function(_0x3527fa){_0x49464a[_0x6edb('0x44')]=_0x3527fa;return _0x49464a;})['then'](respondWithFilteredResult(_0x12e598,_0x2879bd))['catch'](handleError(_0x12e598,null));};exports[_0x6edb('0x45')]=function(_0x3dd1f5,_0x3bcc7b){var _0x479101={'raw':!![],'where':{'id':_0x3dd1f5[_0x6edb('0x46')]['id']}},_0x17cae7={};_0x17cae7['model']=_['keys'](db[_0x6edb('0x41')][_0x6edb('0x2c')]);_0x17cae7['query']=_[_0x6edb('0x32')](_0x3dd1f5[_0x6edb('0x31')]);_0x17cae7['filters']=_[_0x6edb('0x34')](_0x17cae7[_0x6edb('0x30')],_0x17cae7[_0x6edb('0x31')]);_0x479101[_0x6edb('0x35')]=_[_0x6edb('0x34')](_0x17cae7[_0x6edb('0x30')],qs[_0x6edb('0x36')](_0x3dd1f5[_0x6edb('0x31')]['fields']));_0x479101['attributes']=_0x479101[_0x6edb('0x35')][_0x6edb('0x37')]?_0x479101[_0x6edb('0x35')]:_0x17cae7[_0x6edb('0x30')];if(_0x3dd1f5[_0x6edb('0x31')][_0x6edb('0x42')]){_0x479101['include']=[{'all':!![]}];}_0x479101=_[_0x6edb('0x3f')]({},_0x479101,_0x3dd1f5['options']);return db['ChatInternalMessage'][_0x6edb('0x47')](_0x479101)[_0x6edb('0x25')](handleEntityNotFound(_0x3bcc7b,null))[_0x6edb('0x25')](respondWithResult(_0x3bcc7b,null))[_0x6edb('0x48')](handleError(_0x3bcc7b,null));};exports['create']=function(_0x1c1f78,_0x3d1414){return db[_0x6edb('0x41')]['create'](_0x1c1f78[_0x6edb('0x49')],{})[_0x6edb('0x25')](respondWithResult(_0x3d1414,0xc9))['catch'](handleError(_0x3d1414,null));};exports[_0x6edb('0x24')]=function(_0x3cc09d,_0x2128a6){if(_0x3cc09d[_0x6edb('0x49')]['id']){delete _0x3cc09d[_0x6edb('0x49')]['id'];}return db[_0x6edb('0x41')][_0x6edb('0x47')]({'where':{'id':_0x3cc09d[_0x6edb('0x46')]['id']}})[_0x6edb('0x25')](handleEntityNotFound(_0x2128a6,null))[_0x6edb('0x25')](saveUpdates(_0x3cc09d['body'],null))[_0x6edb('0x25')](respondWithResult(_0x2128a6,null))['catch'](handleError(_0x2128a6,null));};exports[_0x6edb('0x26')]=function(_0x952fc4,_0x2b0502){return db[_0x6edb('0x41')]['find']({'where':{'id':_0x952fc4[_0x6edb('0x46')]['id']}})[_0x6edb('0x25')](handleEntityNotFound(_0x2b0502,null))['then'](removeEntity(_0x2b0502,null))[_0x6edb('0x48')](handleError(_0x2b0502,null));};exports[_0x6edb('0x4a')]=function(_0x4dd832,_0x9b2da3){return db[_0x6edb('0x41')][_0x6edb('0x4a')]()[_0x6edb('0x25')](respondWithResult(_0x9b2da3,null))[_0x6edb('0x48')](handleError(_0x9b2da3,null));};function wrapUser(_0x5d993b){return function(_0x12184d){var _0x127e63=_0x5d993b[_0x6edb('0x4b')]({'plain':!![]});_0x127e63[_0x6edb('0x4c')]=[];if(_0x12184d){_0x127e63[_0x6edb('0x4d')]=_0x12184d['createdAt'];_0x127e63[_0x6edb('0x4e')]=_0x12184d;}else{_0x127e63[_0x6edb('0x4d')]=moment(0x0)[_0x6edb('0x4f')](_0x6edb('0x50'));_0x127e63['lastMessage']={};}return _0x127e63;};}exports['getUsers']=function(_0x2b6195,_0x12cfe3,_0x557280){var _0x3f1839=[];return db[_0x6edb('0x51')][_0x6edb('0x43')]({'where':{'role':[_0x6edb('0x52'),_0x6edb('0x53'),_0x6edb('0x54')]},'attributes':['id',_0x6edb('0x55'),_0x6edb('0x28'),'role',_0x6edb('0x56'),_0x6edb('0x57'),_0x6edb('0x58'),'lastLoginAt',_0x6edb('0x59'),_0x6edb('0x5a')],'order':qs[_0x6edb('0x3a')](_0x6edb('0x5b')),'include':[{'model':db[_0x6edb('0x5c')],'as':_0x6edb('0x5d'),'attributes':['id',_0x6edb('0x28'),'type'],'through':{'attributes':[]}}]})[_0x6edb('0x25')](function(_0x1a709e){if(_0x1a709e){var _0x2f6b8b=_0x2b6195[_0x6edb('0x54')][_0x6edb('0x4b')]({'plain':!![]});if(!_0x2f6b8b)throw new Error(_0x6edb('0x5e'));if(_0x2f6b8b[_0x6edb('0x5f')]===_0x6edb('0x54')){return db[_0x6edb('0x60')][_0x6edb('0x47')]({'where':{'name':_0x6edb('0x61'),'userProfileId':_0x2f6b8b[_0x6edb('0x62')]},'raw':!![]})[_0x6edb('0x25')](function(_0x5b92d6){if(_0x5b92d6){if(_0x5b92d6[_0x6edb('0x63')]===0x0){return db[_0x6edb('0x64')]['findAll']({'where':{'sectionId':_0x5b92d6['id']},'raw':!![]})[_0x6edb('0x25')](function(_0x349a10){var _0x2c8bda=[];if(_[_0x6edb('0x65')](_0x349a10)){_0x2c8bda=_[_0x6edb('0x3e')](_0x1a709e,function(_0x3406d8){if(_0x3406d8[_0x6edb('0x5f')]!=='agent'){return _0x3406d8;}});return _0x2c8bda;}else{for(var _0x480c6d=0x0;_0x480c6d<_0x1a709e[_0x6edb('0x37')];_0x480c6d++){var _0x28232c=_0x1a709e[_0x480c6d];if(_0x28232c['role']===_0x6edb('0x52')){var _0x472136=_[_0x6edb('0x47')](_0x349a10,function(_0x42442d){return _0x42442d[_0x6edb('0x66')]===_0x28232c['id'];});if(_0x472136)_0x2c8bda['push'](_0x28232c);}else{_0x2c8bda[_0x6edb('0x67')](_0x28232c);}}return _0x2c8bda;}});}else{return _0x1a709e;}}else{var _0x28f21e=_[_0x6edb('0x3e')](_0x1a709e,function(_0x5491cd){if(_0x5491cd[_0x6edb('0x5f')]!==_0x6edb('0x52')){return _0x5491cd;}});return _0x28f21e;}});}else{return _0x1a709e;}}})[_0x6edb('0x25')](function(_0x64eabc){var _0x10fb07=[];if(_0x64eabc){_0x3f1839=_0x64eabc;for(var _0x412690=0x0;_0x412690<_0x64eabc['length'];_0x412690+=0x1){_0x3f1839[_0x412690]['messages']=[];_0x10fb07['push'](db[_0x6edb('0x41')][_0x6edb('0x47')]({'where':{'FromId':[_0x2b6195[_0x6edb('0x54')]['id'],_0x64eabc[_0x412690]['id']],'ToId':[_0x2b6195[_0x6edb('0x54')]['id'],_0x64eabc[_0x412690]['id']],'ChatGroupId':null},'attributes':['id',_0x6edb('0x68'),_0x6edb('0x69'),_0x6edb('0x6a'),_0x6edb('0x6b'),'body'],'order':qs[_0x6edb('0x3a')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x6edb('0x25')](wrapUser(_0x64eabc[_0x412690])));}return BPromise[_0x6edb('0x6c')](_0x10fb07);}return[];})[_0x6edb('0x25')](function(_0x535715){return{'rows':_0x535715,'count':_0x535715['length']};})['then'](respondWithResult(_0x12cfe3,null))[_0x6edb('0x48')](handleError(_0x12cfe3,null));};
\ No newline at end of file
+var _0x10e5=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ChatInternalMessage','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','get','messages','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','-createdAt','all','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse'];(function(_0x4de1c1,_0x34abee){var _0x31774d=function(_0x1a7b17){while(--_0x1a7b17){_0x4de1c1['push'](_0x4de1c1['shift']());}};_0x31774d(++_0x34abee);}(_0x10e5,0x1bc));var _0x510e=function(_0x4973ff,_0x30abe4){_0x4973ff=_0x4973ff-0x0;var _0x4dd6b6=_0x10e5[_0x4973ff];return _0x4dd6b6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x510e('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x510e('0x1'));var moment=require(_0x510e('0x2'));var BPromise=require(_0x510e('0x3'));var Mustache=require(_0x510e('0x4'));var util=require(_0x510e('0x5'));var path=require(_0x510e('0x6'));var sox=require(_0x510e('0x7'));var csv=require(_0x510e('0x8'));var ejs=require(_0x510e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x510e('0xa'));var squel=require(_0x510e('0xb'));var crypto=require(_0x510e('0xc'));var jsforce=require(_0x510e('0xd'));var deskjs=require(_0x510e('0xe'));var toCsv=require(_0x510e('0x8'));var querystring=require('querystring');var Papa=require(_0x510e('0xf'));var Redis=require(_0x510e('0x10'));var authService=require(_0x510e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x510e('0x12'));var hardwareService=require(_0x510e('0x13'));var logger=require(_0x510e('0x14'))('api');var utils=require(_0x510e('0x15'));var config=require(_0x510e('0x16'));var licenseUtil=require(_0x510e('0x17'));var db=require('../../mysqldb')['db'];config[_0x510e('0x18')]=_[_0x510e('0x19')](config[_0x510e('0x18')],{'host':_0x510e('0x1a'),'port':0x18eb});var socket=require(_0x510e('0x1b'))(new Redis(config[_0x510e('0x18')]));require(_0x510e('0x1c'))[_0x510e('0x1d')](socket);function respondWithStatusCode(_0x12f27a,_0x1b4977){_0x1b4977=_0x1b4977||0xcc;return function(_0x4b125c){if(_0x4b125c){return _0x12f27a[_0x510e('0x1e')](_0x1b4977);}return _0x12f27a[_0x510e('0x1f')](_0x1b4977)[_0x510e('0x20')]();};}function respondWithResult(_0x54e4b,_0x523e7c){_0x523e7c=_0x523e7c||0xc8;return function(_0x4d7d30){if(_0x4d7d30){return _0x54e4b[_0x510e('0x1f')](_0x523e7c)[_0x510e('0x21')](_0x4d7d30);}};}function respondWithFilteredResult(_0x4b5a7f,_0x1dac4a){return function(_0x383a57){if(_0x383a57){var _0x163fce=typeof _0x1dac4a['offset']===_0x510e('0x22')&&typeof _0x1dac4a[_0x510e('0x23')]==='undefined';var _0x32d58a=_0x383a57[_0x510e('0x24')];var _0x130d05=_0x163fce?0x0:_0x1dac4a[_0x510e('0x25')];var _0x1d8019=_0x163fce?_0x383a57[_0x510e('0x24')]:_0x1dac4a[_0x510e('0x25')]+_0x1dac4a[_0x510e('0x23')];var _0x2e71ae;if(_0x1d8019>=_0x32d58a){_0x1d8019=_0x32d58a;_0x2e71ae=0xc8;}else{_0x2e71ae=0xce;}_0x4b5a7f[_0x510e('0x1f')](_0x2e71ae);return _0x4b5a7f[_0x510e('0x26')](_0x510e('0x27'),_0x130d05+'-'+_0x1d8019+'/'+_0x32d58a)[_0x510e('0x21')](_0x383a57);}return null;};}function patchUpdates(_0x2ad51a){return function(_0x3884a9){try{jsonpatch[_0x510e('0x28')](_0x3884a9,_0x2ad51a,!![]);}catch(_0x44eb1c){return BPromise['reject'](_0x44eb1c);}return _0x3884a9[_0x510e('0x29')]();};}function saveUpdates(_0x338195,_0xd3a239){return function(_0x4e7f47){if(_0x4e7f47){return _0x4e7f47[_0x510e('0x2a')](_0x338195)[_0x510e('0x2b')](function(_0x55cbd0){return _0x55cbd0;});}return null;};}function removeEntity(_0x981872,_0x18400f){return function(_0x1a5fd7){if(_0x1a5fd7){return _0x1a5fd7[_0x510e('0x2c')]()['then'](function(){_0x981872[_0x510e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f5d9d,_0x3f1e11){return function(_0x5d81b2){if(!_0x5d81b2){_0x5f5d9d['sendStatus'](0x194);}return _0x5d81b2;};}function handleError(_0x40117f,_0x501ed4){_0x501ed4=_0x501ed4||0x1f4;return function(_0x388e48){logger[_0x510e('0x2d')](_0x388e48[_0x510e('0x2e')]);if(_0x388e48['name']){delete _0x388e48[_0x510e('0x2f')];}_0x40117f['status'](_0x501ed4)[_0x510e('0x30')](_0x388e48);};}exports[_0x510e('0x31')]=function(_0x523622,_0x3e2b54){var _0x2640c1={},_0x47aaa7={},_0x10cd6f={'count':0x0,'rows':[]};var _0x3643fa=_[_0x510e('0x32')](db[_0x510e('0x33')]['rawAttributes'],function(_0x4666c9){return{'name':_0x4666c9[_0x510e('0x34')],'type':_0x4666c9[_0x510e('0x35')]['key']};});_0x47aaa7[_0x510e('0x36')]=_['map'](_0x3643fa,_0x510e('0x2f'));_0x47aaa7[_0x510e('0x37')]=_[_0x510e('0x38')](_0x523622[_0x510e('0x37')]);_0x47aaa7[_0x510e('0x39')]=_[_0x510e('0x3a')](_0x47aaa7[_0x510e('0x36')],_0x47aaa7['query']);_0x2640c1[_0x510e('0x3b')]=_[_0x510e('0x3a')](_0x47aaa7['model'],qs['fields'](_0x523622[_0x510e('0x37')][_0x510e('0x3c')]));_0x2640c1[_0x510e('0x3b')]=_0x2640c1[_0x510e('0x3b')][_0x510e('0x3d')]?_0x2640c1[_0x510e('0x3b')]:_0x47aaa7[_0x510e('0x36')];if(!_0x523622['query'][_0x510e('0x3e')]('nolimit')){_0x2640c1[_0x510e('0x23')]=qs[_0x510e('0x23')](_0x523622[_0x510e('0x37')][_0x510e('0x23')]);_0x2640c1[_0x510e('0x25')]=qs['offset'](_0x523622[_0x510e('0x37')][_0x510e('0x25')]);}_0x2640c1[_0x510e('0x3f')]=qs[_0x510e('0x40')](_0x523622[_0x510e('0x37')]['sort']);_0x2640c1[_0x510e('0x41')]=qs[_0x510e('0x39')](_['pick'](_0x523622[_0x510e('0x37')],_0x47aaa7['filters']),_0x3643fa);if(_0x523622[_0x510e('0x37')][_0x510e('0x42')]){_0x2640c1[_0x510e('0x41')]=_[_0x510e('0x43')](_0x2640c1['where'],{'$or':_[_0x510e('0x32')](_0x3643fa,function(_0x554d15){if(_0x554d15[_0x510e('0x35')]!==_0x510e('0x44')){var _0x35a972={};_0x35a972[_0x554d15[_0x510e('0x2f')]]={'$like':'%'+_0x523622['query'][_0x510e('0x42')]+'%'};return _0x35a972;}})});}_0x2640c1=_[_0x510e('0x43')]({},_0x2640c1,_0x523622[_0x510e('0x45')]);var _0x1b0065={'where':_0x2640c1['where']};return db[_0x510e('0x33')][_0x510e('0x24')](_0x1b0065)[_0x510e('0x2b')](function(_0x3ee71e){_0x10cd6f[_0x510e('0x24')]=_0x3ee71e;if(_0x523622['query']['includeAll']){_0x2640c1[_0x510e('0x46')]=[{'all':!![]}];}return db[_0x510e('0x33')][_0x510e('0x47')](_0x2640c1);})[_0x510e('0x2b')](function(_0x20679f){_0x10cd6f[_0x510e('0x48')]=_0x20679f;return _0x10cd6f;})[_0x510e('0x2b')](respondWithFilteredResult(_0x3e2b54,_0x2640c1))[_0x510e('0x49')](handleError(_0x3e2b54,null));};exports[_0x510e('0x4a')]=function(_0x4b850d,_0x1fb815){var _0x33b817={'raw':!![],'where':{'id':_0x4b850d[_0x510e('0x4b')]['id']}},_0x4f50ee={};_0x4f50ee[_0x510e('0x36')]=_[_0x510e('0x38')](db['ChatInternalMessage'][_0x510e('0x4c')]);_0x4f50ee[_0x510e('0x37')]=_[_0x510e('0x38')](_0x4b850d[_0x510e('0x37')]);_0x4f50ee[_0x510e('0x39')]=_[_0x510e('0x3a')](_0x4f50ee[_0x510e('0x36')],_0x4f50ee[_0x510e('0x37')]);_0x33b817[_0x510e('0x3b')]=_[_0x510e('0x3a')](_0x4f50ee[_0x510e('0x36')],qs[_0x510e('0x3c')](_0x4b850d[_0x510e('0x37')][_0x510e('0x3c')]));_0x33b817[_0x510e('0x3b')]=_0x33b817[_0x510e('0x3b')][_0x510e('0x3d')]?_0x33b817['attributes']:_0x4f50ee[_0x510e('0x36')];if(_0x4b850d[_0x510e('0x37')][_0x510e('0x4d')]){_0x33b817[_0x510e('0x46')]=[{'all':!![]}];}_0x33b817=_['merge']({},_0x33b817,_0x4b850d[_0x510e('0x45')]);return db['ChatInternalMessage'][_0x510e('0x4e')](_0x33b817)[_0x510e('0x2b')](handleEntityNotFound(_0x1fb815,null))[_0x510e('0x2b')](respondWithResult(_0x1fb815,null))[_0x510e('0x49')](handleError(_0x1fb815,null));};exports['create']=function(_0x184439,_0x151f5a){return db[_0x510e('0x33')][_0x510e('0x4f')](_0x184439[_0x510e('0x50')],{})[_0x510e('0x2b')](respondWithResult(_0x151f5a,0xc9))[_0x510e('0x49')](handleError(_0x151f5a,null));};exports[_0x510e('0x2a')]=function(_0x286ecb,_0x232822){if(_0x286ecb[_0x510e('0x50')]['id']){delete _0x286ecb[_0x510e('0x50')]['id'];}return db[_0x510e('0x33')][_0x510e('0x4e')]({'where':{'id':_0x286ecb[_0x510e('0x4b')]['id']}})[_0x510e('0x2b')](handleEntityNotFound(_0x232822,null))[_0x510e('0x2b')](saveUpdates(_0x286ecb['body'],null))[_0x510e('0x2b')](respondWithResult(_0x232822,null))[_0x510e('0x49')](handleError(_0x232822,null));};exports[_0x510e('0x2c')]=function(_0x241a2f,_0x343fe5){return db[_0x510e('0x33')][_0x510e('0x4e')]({'where':{'id':_0x241a2f[_0x510e('0x4b')]['id']}})[_0x510e('0x2b')](handleEntityNotFound(_0x343fe5,null))[_0x510e('0x2b')](removeEntity(_0x343fe5,null))[_0x510e('0x49')](handleError(_0x343fe5,null));};exports[_0x510e('0x51')]=function(_0x373bb7,_0x292cc3){return db[_0x510e('0x33')][_0x510e('0x51')]()[_0x510e('0x2b')](respondWithResult(_0x292cc3,null))[_0x510e('0x49')](handleError(_0x292cc3,null));};function wrapUser(_0x10b2d2){return function(_0x5b28cf){var _0xacfc0d=_0x10b2d2[_0x510e('0x52')]({'plain':!![]});_0xacfc0d[_0x510e('0x53')]=[];if(_0x5b28cf){_0xacfc0d[_0x510e('0x54')]=_0x5b28cf[_0x510e('0x55')];_0xacfc0d['lastMessage']=_0x5b28cf;}else{_0xacfc0d[_0x510e('0x54')]=moment(0x0)['format'](_0x510e('0x56'));_0xacfc0d['lastMessage']={};}return _0xacfc0d;};}exports[_0x510e('0x57')]=function(_0xc65bf3,_0x9f025f,_0x3861a4){var _0x16c7c7=[];return db[_0x510e('0x58')][_0x510e('0x47')]({'where':{'role':[_0x510e('0x59'),_0x510e('0x5a'),_0x510e('0x5b')]},'attributes':['id',_0x510e('0x5c'),_0x510e('0x2f'),_0x510e('0x5d'),_0x510e('0x5e'),_0x510e('0x5f'),_0x510e('0x60'),_0x510e('0x61'),_0x510e('0x62'),_0x510e('0x63')],'order':qs['sort'](_0x510e('0x64')),'include':[{'model':db[_0x510e('0x65')],'as':_0x510e('0x66'),'attributes':['id',_0x510e('0x2f'),_0x510e('0x35')],'through':{'attributes':[]}}]})[_0x510e('0x2b')](function(_0x3c898a){if(_0x3c898a){var _0x2d8779=_0xc65bf3['user'][_0x510e('0x52')]({'plain':!![]});if(!_0x2d8779)throw new Error(_0x510e('0x67'));if(_0x2d8779[_0x510e('0x5d')]===_0x510e('0x5b')){return db[_0x510e('0x68')][_0x510e('0x4e')]({'where':{'name':_0x510e('0x69'),'userProfileId':_0x2d8779['userProfileId']},'raw':!![]})[_0x510e('0x2b')](function(_0x3daa90){if(_0x3daa90){if(_0x3daa90[_0x510e('0x6a')]===0x0){return db[_0x510e('0x6b')][_0x510e('0x47')]({'where':{'sectionId':_0x3daa90['id']},'raw':!![]})[_0x510e('0x2b')](function(_0x482320){var _0x366c55=[];if(_[_0x510e('0x6c')](_0x482320)){_0x366c55=_[_0x510e('0x42')](_0x3c898a,function(_0x6edd12){if(_0x6edd12[_0x510e('0x5d')]!=='agent'){return _0x6edd12;}});return _0x366c55;}else{for(var _0xc64562=0x0;_0xc64562<_0x3c898a[_0x510e('0x3d')];_0xc64562++){var _0x3e105f=_0x3c898a[_0xc64562];if(_0x3e105f[_0x510e('0x5d')]===_0x510e('0x59')){var _0x2e18bd=_[_0x510e('0x4e')](_0x482320,function(_0x26619d){return _0x26619d[_0x510e('0x6d')]===_0x3e105f['id'];});if(_0x2e18bd)_0x366c55[_0x510e('0x6e')](_0x3e105f);}else{_0x366c55[_0x510e('0x6e')](_0x3e105f);}}return _0x366c55;}});}else{return _0x3c898a;}}else{var _0x254c80=_[_0x510e('0x42')](_0x3c898a,function(_0x11b7af){if(_0x11b7af['role']!==_0x510e('0x59')){return _0x11b7af;}});return _0x254c80;}});}else{return _0x3c898a;}}})['then'](function(_0x39584a){var _0x382c18=[];if(_0x39584a){_0x16c7c7=_0x39584a;for(var _0x4cc5ee=0x0;_0x4cc5ee<_0x39584a[_0x510e('0x3d')];_0x4cc5ee+=0x1){_0x16c7c7[_0x4cc5ee][_0x510e('0x53')]=[];_0x382c18[_0x510e('0x6e')](db[_0x510e('0x33')]['find']({'where':{'FromId':[_0xc65bf3[_0x510e('0x5b')]['id'],_0x39584a[_0x4cc5ee]['id']],'ToId':[_0xc65bf3[_0x510e('0x5b')]['id'],_0x39584a[_0x4cc5ee]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x510e('0x6f'),_0x510e('0x70'),'read',_0x510e('0x50')],'order':qs['sort'](_0x510e('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x510e('0x2b')](wrapUser(_0x39584a[_0x4cc5ee])));}return BPromise[_0x510e('0x72')](_0x382c18);}return[];})[_0x510e('0x2b')](function(_0x23252c){return{'rows':_0x23252c,'count':_0x23252c[_0x510e('0x3d')]};})[_0x510e('0x2b')](respondWithResult(_0x9f025f,null))[_0x510e('0x49')](handleError(_0x9f025f,null));};
\ No newline at end of file
index ca58f03..1fe5f9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51d7=['ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x98f760,_0x443bd7){var _0x54f218=function(_0x7a9255){while(--_0x7a9255){_0x98f760['push'](_0x98f760['shift']());}};_0x54f218(++_0x443bd7);}(_0x51d7,0xcf));var _0x751d=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x51d7[_0x4a9fb1];return _0x348672;};'use strict';var EventEmitter=require(_0x751d('0x0'));var ChatInternalMessage=require(_0x751d('0x1'))['db'][_0x751d('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x751d('0x3')](0x0);var events={'afterCreate':_0x751d('0x4'),'afterUpdate':_0x751d('0x5'),'afterDestroy':_0x751d('0x6')};function emitEvent(_0x3daae0){return function(_0x229d5e,_0x4005a4,_0x281541){ChatInternalMessageEvents[_0x751d('0x7')](_0x3daae0+':'+_0x229d5e['id'],_0x229d5e);ChatInternalMessageEvents[_0x751d('0x7')](_0x3daae0,_0x229d5e);_0x281541(null);};}for(var e in events){if(events[_0x751d('0x8')](e)){var event=events[e];ChatInternalMessage[_0x751d('0x9')](e,emitEvent(event));}}module[_0x751d('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x2d2c=['exports','../../mysqldb','update','emit','hasOwnProperty','hook'];(function(_0x3b9566,_0x3d253a){var _0x974e63=function(_0x521bcc){while(--_0x521bcc){_0x3b9566['push'](_0x3b9566['shift']());}};_0x974e63(++_0x3d253a);}(_0x2d2c,0xaf));var _0xc2d2=function(_0x5515a7,_0x2c4af1){_0x5515a7=_0x5515a7-0x0;var _0x43f4bf=_0x2d2c[_0x5515a7];return _0x43f4bf;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xc2d2('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc2d2('0x1'),'afterDestroy':'remove'};function emitEvent(_0x5e3450){return function(_0x4b189f,_0x3973a8,_0x30677c){ChatInternalMessageEvents[_0xc2d2('0x2')](_0x5e3450+':'+_0x4b189f['id'],_0x4b189f);ChatInternalMessageEvents[_0xc2d2('0x2')](_0x5e3450,_0x4b189f);_0x30677c(null);};}for(var e in events){if(events[_0xc2d2('0x3')](e)){var event=events[e];ChatInternalMessage[_0xc2d2('0x4')](e,emitEvent(event));}}module[_0xc2d2('0x5')]=ChatInternalMessageEvents;
\ No newline at end of file
index 1f63615..41c25f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x792c=['rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3e95a4,_0x5753be){var _0x20aa73=function(_0x4e2299){while(--_0x4e2299){_0x3e95a4['push'](_0x3e95a4['shift']());}};_0x20aa73(++_0x5753be);}(_0x792c,0x180));var _0xc792=function(_0x18432e,_0xcd1583){_0x18432e=_0x18432e-0x0;var _0x47ab2b=_0x792c[_0x18432e];return _0x47ab2b;};'use strict';var _=require(_0xc792('0x0'));var util=require(_0xc792('0x1'));var logger=require(_0xc792('0x2'))('api');var moment=require(_0xc792('0x3'));var BPromise=require(_0xc792('0x4'));var rp=require(_0xc792('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc792('0x6'));var config=require(_0xc792('0x7'));var attributes=require(_0xc792('0x8'));module['exports']=function(_0x4219d8,_0x207d1f){return _0x4219d8[_0xc792('0x9')](_0xc792('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc792('0xb'),'collate':_0xc792('0xc')});};
\ No newline at end of file
+var _0xc013=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','utf8mb4'];(function(_0x42f2f7,_0x4ea2c7){var _0x20efdc=function(_0x3ba38e){while(--_0x3ba38e){_0x42f2f7['push'](_0x42f2f7['shift']());}};_0x20efdc(++_0x4ea2c7);}(_0xc013,0x12c));var _0x3c01=function(_0x164760,_0x5874b0){_0x164760=_0x164760-0x0;var _0x8b91b2=_0xc013[_0x164760];return _0x8b91b2;};'use strict';var _=require(_0x3c01('0x0'));var util=require(_0x3c01('0x1'));var logger=require(_0x3c01('0x2'))('api');var moment=require(_0x3c01('0x3'));var BPromise=require(_0x3c01('0x4'));var rp=require(_0x3c01('0x5'));var fs=require('fs');var path=require(_0x3c01('0x6'));var rimraf=require(_0x3c01('0x7'));var config=require(_0x3c01('0x8'));var attributes=require(_0x3c01('0x9'));module['exports']=function(_0x11fd48,_0x605920){return _0x11fd48['define'](_0x3c01('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3c01('0xb'),'collate':_0x3c01('0xc')});};
\ No newline at end of file
index 30d0992..1344ec1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ed5=['result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0xf16b1,_0x33c637){var _0x26f94d=function(_0x5643d7){while(--_0x5643d7){_0xf16b1['push'](_0xf16b1['shift']());}};_0x26f94d(++_0x33c637);}(_0x6ed5,0xe2));var _0x56ed=function(_0x2ae115,_0x34fe95){_0x2ae115=_0x2ae115-0x0;var _0x524af6=_0x6ed5[_0x2ae115];return _0x524af6;};'use strict';var _=require(_0x56ed('0x0'));var util=require(_0x56ed('0x1'));var moment=require('moment');var BPromise=require(_0x56ed('0x2'));var rs=require(_0x56ed('0x3'));var fs=require('fs');var Redis=require(_0x56ed('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x56ed('0x5'));var logger=require('../../config/logger')(_0x56ed('0x6'));var config=require(_0x56ed('0x7'));var jayson=require(_0x56ed('0x8'));var client=jayson[_0x56ed('0x9')][_0x56ed('0xa')]({'port':0x232a});config[_0x56ed('0xb')]=_['defaults'](config[_0x56ed('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x56ed('0xc'))(new Redis(config[_0x56ed('0xb')]));require(_0x56ed('0xd'))[_0x56ed('0xe')](socket);function respondWithRpcPromise(_0x172466,_0x2db585,_0x12183c){return new BPromise(function(_0x5be598,_0x14a61e){return client['request'](_0x172466,_0x12183c)[_0x56ed('0xf')](function(_0x313c75){logger[_0x56ed('0x10')](_0x56ed('0x11'),_0x2db585,_0x56ed('0x12'));logger[_0x56ed('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x2db585,_0x56ed('0x12'),JSON[_0x56ed('0x14')](_0x313c75));if(_0x313c75[_0x56ed('0x15')]){if(_0x313c75[_0x56ed('0x15')][_0x56ed('0x16')]===0x1f4){logger['error'](_0x56ed('0x11'),_0x2db585,_0x313c75[_0x56ed('0x15')][_0x56ed('0x17')]);return _0x14a61e(_0x313c75[_0x56ed('0x15')]['message']);}logger[_0x56ed('0x15')](_0x56ed('0x11'),_0x2db585,_0x313c75[_0x56ed('0x15')][_0x56ed('0x17')]);return _0x5be598(_0x313c75[_0x56ed('0x15')][_0x56ed('0x17')]);}else{logger[_0x56ed('0x10')](_0x56ed('0x11'),_0x2db585,_0x56ed('0x12'));_0x5be598(_0x313c75[_0x56ed('0x18')][_0x56ed('0x17')]);}})['catch'](function(_0x13b852){logger['error'](_0x56ed('0x11'),_0x2db585,_0x13b852);_0x14a61e(_0x13b852);});});}
\ No newline at end of file
+var _0x28e3=['message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x437564,_0x81b799){var _0x56bc56=function(_0x53b295){while(--_0x53b295){_0x437564['push'](_0x437564['shift']());}};_0x56bc56(++_0x81b799);}(_0x28e3,0x106));var _0x328e=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x28e3[_0x4d07cc];return _0x42de3b;};'use strict';var _=require(_0x328e('0x0'));var util=require(_0x328e('0x1'));var moment=require(_0x328e('0x2'));var BPromise=require(_0x328e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x328e('0x4'));var db=require(_0x328e('0x5'))['db'];var utils=require(_0x328e('0x6'));var logger=require(_0x328e('0x7'))(_0x328e('0x8'));var config=require(_0x328e('0x9'));var jayson=require(_0x328e('0xa'));var client=jayson[_0x328e('0xb')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x328e('0xc')],{'host':_0x328e('0xd'),'port':0x18eb});var socket=require(_0x328e('0xe'))(new Redis(config[_0x328e('0xc')]));require(_0x328e('0xf'))['register'](socket);function respondWithRpcPromise(_0x30af7c,_0x1b3bb8,_0x2d58e9){return new BPromise(function(_0x5368fb,_0x509c4d){return client['request'](_0x30af7c,_0x2d58e9)[_0x328e('0x10')](function(_0x30d2f4){logger[_0x328e('0x11')](_0x328e('0x12'),_0x1b3bb8,_0x328e('0x13'));logger[_0x328e('0x14')](_0x328e('0x15'),_0x1b3bb8,_0x328e('0x13'),JSON[_0x328e('0x16')](_0x30d2f4));if(_0x30d2f4[_0x328e('0x17')]){if(_0x30d2f4[_0x328e('0x17')]['code']===0x1f4){logger[_0x328e('0x17')](_0x328e('0x12'),_0x1b3bb8,_0x30d2f4[_0x328e('0x17')][_0x328e('0x18')]);return _0x509c4d(_0x30d2f4[_0x328e('0x17')][_0x328e('0x18')]);}logger[_0x328e('0x17')](_0x328e('0x12'),_0x1b3bb8,_0x30d2f4[_0x328e('0x17')]['message']);return _0x5368fb(_0x30d2f4[_0x328e('0x17')][_0x328e('0x18')]);}else{logger[_0x328e('0x11')](_0x328e('0x12'),_0x1b3bb8,_0x328e('0x13'));_0x5368fb(_0x30d2f4[_0x328e('0x19')][_0x328e('0x18')]);}})['catch'](function(_0x43c2c3){logger[_0x328e('0x17')](_0x328e('0x12'),_0x1b3bb8,_0x43c2c3);_0x509c4d(_0x43c2c3);});});}
\ No newline at end of file
index 36d20da..08866df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5aa6=['save','remove','removeListener','register','length','./chatInternalMessage.events'];(function(_0x585133,_0x2412a1){var _0x18254a=function(_0x4c8aaf){while(--_0x4c8aaf){_0x585133['push'](_0x585133['shift']());}};_0x18254a(++_0x2412a1);}(_0x5aa6,0x1e5));var _0x65aa=function(_0x8975f9,_0x27ba9a){_0x8975f9=_0x8975f9-0x0;var _0x218a78=_0x5aa6[_0x8975f9];return _0x218a78;};'use strict';var ChatInternalMessageEvents=require(_0x65aa('0x0'));var events=[_0x65aa('0x1'),_0x65aa('0x2'),'update'];function createListener(_0x375d1f,_0x10736d){return function(_0x473972){_0x10736d['emit'](_0x375d1f,_0x473972);};}function removeListener(_0x54564e,_0x2f2b2c){return function(){ChatInternalMessageEvents[_0x65aa('0x3')](_0x54564e,_0x2f2b2c);};}exports[_0x65aa('0x4')]=function(_0x22f44b){for(var _0x1c7f94=0x0,_0x3f9e38=events[_0x65aa('0x5')];_0x1c7f94<_0x3f9e38;_0x1c7f94++){var _0x28804f=events[_0x1c7f94];var _0x1f28fc=createListener('chatInternalMessage:'+_0x28804f,_0x22f44b);ChatInternalMessageEvents['on'](_0x28804f,_0x1f28fc);}};
\ No newline at end of file
+var _0xefc0=['register','length','./chatInternalMessage.events','save','remove','update','removeListener'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0xefc0,0xf0));var _0x0efc=function(_0x56bd89,_0x45b169){_0x56bd89=_0x56bd89-0x0;var _0x186e42=_0xefc0[_0x56bd89];return _0x186e42;};'use strict';var ChatInternalMessageEvents=require(_0x0efc('0x0'));var events=[_0x0efc('0x1'),_0x0efc('0x2'),_0x0efc('0x3')];function createListener(_0x30b8fb,_0x14fd27){return function(_0x531aaa){_0x14fd27['emit'](_0x30b8fb,_0x531aaa);};}function removeListener(_0x3bb031,_0x5a3ffe){return function(){ChatInternalMessageEvents[_0x0efc('0x4')](_0x3bb031,_0x5a3ffe);};}exports[_0x0efc('0x5')]=function(_0x108015){for(var _0x34174a=0x0,_0x2408d2=events[_0x0efc('0x6')];_0x34174a<_0x2408d2;_0x34174a++){var _0x1a2709=events[_0x34174a];var _0x9f1a72=createListener('chatInternalMessage:'+_0x1a2709,_0x108015);ChatInternalMessageEvents['on'](_0x1a2709,_0x9f1a72);}};
\ No newline at end of file
index 7670e33..4803c77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa25b=['fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa25b,0x1c6));var _0xba25=function(_0xd81df,_0x480f88){_0xd81df=_0xd81df-0x0;var _0x3edbc5=_0xa25b[_0xd81df];return _0x3edbc5;};'use strict';var multer=require(_0xba25('0x0'));var util=require(_0xba25('0x1'));var path=require(_0xba25('0x2'));var timeout=require(_0xba25('0x3'));var express=require(_0xba25('0x4'));var router=express[_0xba25('0x5')]();var fs_extra=require(_0xba25('0x6'));var auth=require(_0xba25('0x7'));var interaction=require(_0xba25('0x8'));var config=require('../../config/environment');var controller=require(_0xba25('0x9'));router[_0xba25('0xa')]('/',auth[_0xba25('0xb')](),controller[_0xba25('0xc')]);router[_0xba25('0xa')](_0xba25('0xd'),auth[_0xba25('0xb')](),controller[_0xba25('0xe')]);router[_0xba25('0xa')](_0xba25('0xf'),auth[_0xba25('0xb')](),controller['getUsers']);router[_0xba25('0xa')](_0xba25('0x10'),auth['isAuthenticated'](),controller['show']);router[_0xba25('0x11')]('/',auth[_0xba25('0xb')](),controller[_0xba25('0x12')]);router[_0xba25('0x13')](_0xba25('0x10'),controller['update']);router[_0xba25('0x14')](_0xba25('0x10'),auth[_0xba25('0xb')](),controller[_0xba25('0x15')]);module[_0xba25('0x16')]=router;
\ No newline at end of file
+var _0x30bf=['delete','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','getUsers','/:id','show','post','create','put','update'];(function(_0x3ccce0,_0x11194f){var _0x2265f8=function(_0xb6aa6e){while(--_0xb6aa6e){_0x3ccce0['push'](_0x3ccce0['shift']());}};_0x2265f8(++_0x11194f);}(_0x30bf,0xf2));var _0xf30b=function(_0x344708,_0x4244f9){_0x344708=_0x344708-0x0;var _0x59c2d7=_0x30bf[_0x344708];return _0x59c2d7;};'use strict';var multer=require('multer');var util=require(_0xf30b('0x0'));var path=require(_0xf30b('0x1'));var timeout=require(_0xf30b('0x2'));var express=require('express');var router=express[_0xf30b('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf30b('0x4'));var config=require(_0xf30b('0x5'));var controller=require(_0xf30b('0x6'));router[_0xf30b('0x7')]('/',auth[_0xf30b('0x8')](),controller['index']);router[_0xf30b('0x7')](_0xf30b('0x9'),auth[_0xf30b('0x8')](),controller[_0xf30b('0xa')]);router['get']('/users',auth[_0xf30b('0x8')](),controller[_0xf30b('0xb')]);router[_0xf30b('0x7')](_0xf30b('0xc'),auth[_0xf30b('0x8')](),controller[_0xf30b('0xd')]);router[_0xf30b('0xe')]('/',auth[_0xf30b('0x8')](),controller[_0xf30b('0xf')]);router[_0xf30b('0x10')](_0xf30b('0xc'),controller[_0xf30b('0x11')]);router[_0xf30b('0x12')](_0xf30b('0xc'),auth[_0xf30b('0x8')](),controller['destroy']);module[_0xf30b('0x13')]=router;
\ No newline at end of file
index f239684..103136f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1707=['BOOLEAN','out','DATE','STRING','TEXT','sequelize'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x1707,0x1df));var _0x7170=function(_0x2a0de1,_0x1c2565){_0x2a0de1=_0x2a0de1-0x0;var _0x22e916=_0x1707[_0x2a0de1];return _0x22e916;};'use strict';var Sequelize=require(_0x7170('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x7170('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7170('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7170('0x2')),'defaultValue':_0x7170('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7170('0x3')]},'providerName':{'type':Sequelize[_0x7170('0x4')]},'providerResponse':{'type':Sequelize[_0x7170('0x5')]}};
\ No newline at end of file
+var _0xdd4f=['DATE','TEXT','sequelize','BOOLEAN','out'];(function(_0x10a41d,_0x1aada0){var _0x864366=function(_0x513932){while(--_0x513932){_0x10a41d['push'](_0x10a41d['shift']());}};_0x864366(++_0x1aada0);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x355422,_0x1311c9){_0x355422=_0x355422-0x0;var _0x597fa8=_0xdd4f[_0x355422];return _0x597fa8;};'use strict';var Sequelize=require(_0xfdd4('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xfdd4('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0xfdd4('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xfdd4('0x2')),'defaultValue':_0xfdd4('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0xfdd4('0x3')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xfdd4('0x4')]}};
\ No newline at end of file
index 9995b8e..a466b23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf98=['fullname','email','internal','interface','channel','motionChannel','event','EventManager','acceptmessage','formData','reject','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','SIP/%s','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','show','params','keys','include','options','find','create','body','describe','chat-interactions','accept','read','readAt','format','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact'];(function(_0x1780f8,_0x11ba93){var _0x33a410=function(_0x2a015f){while(--_0x2a015f){_0x1780f8['push'](_0x1780f8['shift']());}};_0x33a410(++_0x11ba93);}(_0xbf98,0x1a5));var _0x8bf9=function(_0x591e6e,_0x3f466f){_0x591e6e=_0x591e6e-0x0;var _0x279e1c=_0xbf98[_0x591e6e];return _0x279e1c;};'use strict';var emlformat=require(_0x8bf9('0x0'));var rimraf=require(_0x8bf9('0x1'));var zipdir=require(_0x8bf9('0x2'));var jsonpatch=require(_0x8bf9('0x3'));var rp=require(_0x8bf9('0x4'));var moment=require(_0x8bf9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8bf9('0x6'));var path=require('path');var sox=require(_0x8bf9('0x7'));var csv=require(_0x8bf9('0x8'));var ejs=require(_0x8bf9('0x9'));var fs=require('fs');var fs_extra=require(_0x8bf9('0xa'));var _=require(_0x8bf9('0xb'));var squel=require(_0x8bf9('0xc'));var crypto=require(_0x8bf9('0xd'));var jsforce=require(_0x8bf9('0xe'));var deskjs=require(_0x8bf9('0xf'));var toCsv=require(_0x8bf9('0x8'));var querystring=require(_0x8bf9('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8bf9('0x11'));var as=require(_0x8bf9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8bf9('0x13'))('api');var utils=require(_0x8bf9('0x14'));var config=require(_0x8bf9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8bf9('0x16'))['db'];config[_0x8bf9('0x17')]=_[_0x8bf9('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8bf9('0x19'))[_0x8bf9('0x1a')](socket);var jayson=require(_0x8bf9('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x8bf9('0x1c')][_0x8bf9('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4da83e,_0x10b66a,_0xfc96c5,_0x582fa4){return new BPromise(function(_0x45d2d3,_0x1ad5e7){var _0x4d08f8=_0x582fa4||client;return _0x4d08f8['request'](_0x4da83e,_0xfc96c5)[_0x8bf9('0x1e')](function(_0x48f300){logger[_0x8bf9('0x1f')](_0x8bf9('0x20'),_0x10b66a,_0x8bf9('0x21'));logger[_0x8bf9('0x22')](_0x8bf9('0x23'),_0x10b66a,_0x8bf9('0x21'),JSON[_0x8bf9('0x24')](_0x48f300));if(_0x48f300['error']){if(_0x48f300[_0x8bf9('0x25')]['code']===0x1f4){logger[_0x8bf9('0x25')](_0x8bf9('0x20'),_0x10b66a,_0x48f300[_0x8bf9('0x25')][_0x8bf9('0x26')]);return _0x1ad5e7(_0x48f300['error']['message']);}logger[_0x8bf9('0x25')](_0x8bf9('0x20'),_0x10b66a,_0x48f300[_0x8bf9('0x25')][_0x8bf9('0x26')]);return _0x45d2d3(_0x48f300[_0x8bf9('0x25')]['message']);}else{logger['info'](_0x8bf9('0x20'),_0x10b66a,'request\x20sent');_0x45d2d3(_0x48f300[_0x8bf9('0x27')][_0x8bf9('0x26')]);}})[_0x8bf9('0x28')](function(_0x3d5bd2){logger[_0x8bf9('0x25')]('ChatMessage,\x20%s,\x20%s',_0x10b66a,_0x3d5bd2);_0x1ad5e7(_0x3d5bd2);});});}function respondWithStatusCode(_0xcfb2e,_0x33a17f){_0x33a17f=_0x33a17f||0xcc;return function(_0x34d704){if(_0x34d704){return _0xcfb2e[_0x8bf9('0x29')](_0x33a17f);}return _0xcfb2e['status'](_0x33a17f)[_0x8bf9('0x2a')]();};}function respondWithResult(_0x3f640a,_0x8766e1){_0x8766e1=_0x8766e1||0xc8;return function(_0x47cfbe){if(_0x47cfbe){return _0x3f640a[_0x8bf9('0x2b')](_0x8766e1)[_0x8bf9('0x2c')](_0x47cfbe);}};}function respondWithFilteredResult(_0x2a59f6,_0x3497fd){return function(_0x5ac79c){if(_0x5ac79c){var _0x5c66c1=typeof _0x3497fd['offset']===_0x8bf9('0x2d')&&typeof _0x3497fd[_0x8bf9('0x2e')]===_0x8bf9('0x2d');var _0x330da6=_0x5ac79c[_0x8bf9('0x2f')];var _0x5cc056=_0x5c66c1?0x0:_0x3497fd[_0x8bf9('0x30')];var _0x5573fb=_0x5c66c1?_0x5ac79c[_0x8bf9('0x2f')]:_0x3497fd['offset']+_0x3497fd['limit'];var _0x165710;if(_0x5573fb>=_0x330da6){_0x5573fb=_0x330da6;_0x165710=0xc8;}else{_0x165710=0xce;}_0x2a59f6['status'](_0x165710);return _0x2a59f6[_0x8bf9('0x31')](_0x8bf9('0x32'),_0x5cc056+'-'+_0x5573fb+'/'+_0x330da6)[_0x8bf9('0x2c')](_0x5ac79c);}return null;};}function patchUpdates(_0x1275e4){return function(_0x5a5f10){try{jsonpatch['apply'](_0x5a5f10,_0x1275e4,!![]);}catch(_0x2cb19a){return BPromise['reject'](_0x2cb19a);}return _0x5a5f10[_0x8bf9('0x33')]();};}function saveUpdates(_0x91151e,_0x1ebb08){return function(_0x5a4bfa){if(_0x5a4bfa){return _0x5a4bfa[_0x8bf9('0x34')](_0x91151e)[_0x8bf9('0x1e')](function(_0x176748){return _0x176748;});}return null;};}function removeEntity(_0x32b224,_0x182503){return function(_0x53f982){if(_0x53f982){return _0x53f982[_0x8bf9('0x35')]()[_0x8bf9('0x1e')](function(){_0x32b224[_0x8bf9('0x2b')](0xcc)[_0x8bf9('0x2a')]();});}};}function handleEntityNotFound(_0x2010c8,_0x252661){return function(_0x308536){if(!_0x308536){_0x2010c8[_0x8bf9('0x29')](0x194);}return _0x308536;};}function handleError(_0x3feecb,_0xb8e1ae){_0xb8e1ae=_0xb8e1ae||0x1f4;return function(_0x284f6a){logger[_0x8bf9('0x25')](_0x284f6a[_0x8bf9('0x36')]);if(_0x284f6a[_0x8bf9('0x37')]){delete _0x284f6a[_0x8bf9('0x37')];}_0x3feecb[_0x8bf9('0x2b')](_0xb8e1ae)[_0x8bf9('0x38')](_0x284f6a);};}exports[_0x8bf9('0x39')]=function(_0x53e524,_0x16247e){var _0x3bd0ee={},_0x504fa9={},_0x3a20ca={'count':0x0,'rows':[]};var _0x1a890f=_['map'](db[_0x8bf9('0x3a')][_0x8bf9('0x3b')],function(_0x526fe4){return{'name':_0x526fe4[_0x8bf9('0x3c')],'type':_0x526fe4[_0x8bf9('0x3d')][_0x8bf9('0x3e')]};});_0x504fa9[_0x8bf9('0x3f')]=_[_0x8bf9('0x40')](_0x1a890f,'name');_0x504fa9[_0x8bf9('0x41')]=_['keys'](_0x53e524['query']);_0x504fa9[_0x8bf9('0x42')]=_['intersection'](_0x504fa9[_0x8bf9('0x3f')],_0x504fa9[_0x8bf9('0x41')]);_0x3bd0ee['attributes']=_[_0x8bf9('0x43')](_0x504fa9[_0x8bf9('0x3f')],qs[_0x8bf9('0x44')](_0x53e524[_0x8bf9('0x41')][_0x8bf9('0x44')]));_0x3bd0ee[_0x8bf9('0x45')]=_0x3bd0ee[_0x8bf9('0x45')][_0x8bf9('0x46')]?_0x3bd0ee['attributes']:_0x504fa9[_0x8bf9('0x3f')];if(!_0x53e524[_0x8bf9('0x41')][_0x8bf9('0x47')](_0x8bf9('0x48'))){_0x3bd0ee[_0x8bf9('0x2e')]=qs[_0x8bf9('0x2e')](_0x53e524[_0x8bf9('0x41')][_0x8bf9('0x2e')]);_0x3bd0ee['offset']=qs['offset'](_0x53e524[_0x8bf9('0x41')][_0x8bf9('0x30')]);}_0x3bd0ee['order']=qs[_0x8bf9('0x49')](_0x53e524[_0x8bf9('0x41')][_0x8bf9('0x49')]);_0x3bd0ee[_0x8bf9('0x4a')]=qs[_0x8bf9('0x42')](_[_0x8bf9('0x4b')](_0x53e524[_0x8bf9('0x41')],_0x504fa9[_0x8bf9('0x42')]),_0x1a890f);if(_0x53e524[_0x8bf9('0x41')]['filter']){_0x3bd0ee[_0x8bf9('0x4a')]=_[_0x8bf9('0x4c')](_0x3bd0ee['where'],{'$or':_[_0x8bf9('0x40')](_0x1a890f,function(_0x515384){if(_0x515384['type']!==_0x8bf9('0x4d')){var _0x5c3871={};_0x5c3871[_0x515384['name']]={'$like':'%'+_0x53e524['query'][_0x8bf9('0x4e')]+'%'};return _0x5c3871;}})});}_0x3bd0ee=_[_0x8bf9('0x4c')]({},_0x3bd0ee,_0x53e524['options']);var _0x5671bd={'where':_0x3bd0ee[_0x8bf9('0x4a')]};return db[_0x8bf9('0x3a')][_0x8bf9('0x2f')](_0x5671bd)['then'](function(_0x5c6942){_0x3a20ca[_0x8bf9('0x2f')]=_0x5c6942;if(_0x53e524[_0x8bf9('0x41')][_0x8bf9('0x4f')]){_0x3bd0ee['include']=[{'all':!![]}];}return db[_0x8bf9('0x3a')]['findAll'](_0x3bd0ee);})[_0x8bf9('0x1e')](function(_0x1d9a95){_0x3a20ca['rows']=_0x1d9a95;return _0x3a20ca;})[_0x8bf9('0x1e')](respondWithFilteredResult(_0x16247e,_0x3bd0ee))[_0x8bf9('0x28')](handleError(_0x16247e,null));};exports[_0x8bf9('0x50')]=function(_0x4b4631,_0x1909d9){var _0x1c9a8d={'raw':!![],'where':{'id':_0x4b4631[_0x8bf9('0x51')]['id']}},_0x433486={};_0x433486[_0x8bf9('0x3f')]=_['keys'](db[_0x8bf9('0x3a')][_0x8bf9('0x3b')]);_0x433486[_0x8bf9('0x41')]=_[_0x8bf9('0x52')](_0x4b4631[_0x8bf9('0x41')]);_0x433486['filters']=_['intersection'](_0x433486[_0x8bf9('0x3f')],_0x433486[_0x8bf9('0x41')]);_0x1c9a8d[_0x8bf9('0x45')]=_['intersection'](_0x433486[_0x8bf9('0x3f')],qs[_0x8bf9('0x44')](_0x4b4631['query']['fields']));_0x1c9a8d[_0x8bf9('0x45')]=_0x1c9a8d[_0x8bf9('0x45')][_0x8bf9('0x46')]?_0x1c9a8d[_0x8bf9('0x45')]:_0x433486['model'];if(_0x4b4631['query'][_0x8bf9('0x4f')]){_0x1c9a8d[_0x8bf9('0x53')]=[{'all':!![]}];}_0x1c9a8d=_[_0x8bf9('0x4c')]({},_0x1c9a8d,_0x4b4631[_0x8bf9('0x54')]);return db['ChatMessage'][_0x8bf9('0x55')](_0x1c9a8d)[_0x8bf9('0x1e')](handleEntityNotFound(_0x1909d9,null))[_0x8bf9('0x1e')](respondWithResult(_0x1909d9,null))[_0x8bf9('0x28')](handleError(_0x1909d9,null));};exports[_0x8bf9('0x56')]=function(_0x47c0d1,_0x1df739){return db[_0x8bf9('0x3a')]['create'](_0x47c0d1[_0x8bf9('0x57')],{})[_0x8bf9('0x1e')](respondWithResult(_0x1df739,0xc9))[_0x8bf9('0x28')](handleError(_0x1df739,null));};exports[_0x8bf9('0x34')]=function(_0x3c25bf,_0x45900e){if(_0x3c25bf['body']['id']){delete _0x3c25bf[_0x8bf9('0x57')]['id'];}return db[_0x8bf9('0x3a')]['find']({'where':{'id':_0x3c25bf[_0x8bf9('0x51')]['id']}})[_0x8bf9('0x1e')](handleEntityNotFound(_0x45900e,null))['then'](saveUpdates(_0x3c25bf[_0x8bf9('0x57')],null))['then'](respondWithResult(_0x45900e,null))[_0x8bf9('0x28')](handleError(_0x45900e,null));};exports['destroy']=function(_0x599007,_0x4f596a){return db[_0x8bf9('0x3a')][_0x8bf9('0x55')]({'where':{'id':_0x599007['params']['id']}})[_0x8bf9('0x1e')](handleEntityNotFound(_0x4f596a,null))[_0x8bf9('0x1e')](removeEntity(_0x4f596a,null))['catch'](handleError(_0x4f596a,null));};exports[_0x8bf9('0x58')]=function(_0x4bc1d1,_0x4b5b81){return db[_0x8bf9('0x3a')][_0x8bf9('0x58')]()[_0x8bf9('0x1e')](respondWithResult(_0x4b5b81,null))[_0x8bf9('0x28')](handleError(_0x4b5b81,null));};var interaction_log=require(_0x8bf9('0x13'))(_0x8bf9('0x59'));exports[_0x8bf9('0x5a')]=function(_0xd236b5,_0x420d5c,_0x5e056c){var _0x1006c9={'agent':{},'channel':'chat'};if(_0xd236b5[_0x8bf9('0x57')]['id']){delete _0xd236b5[_0x8bf9('0x57')]['id'];}_0xd236b5[_0x8bf9('0x57')][_0x8bf9('0x5b')]=!![];_0xd236b5[_0x8bf9('0x57')][_0x8bf9('0x5c')]=moment()[_0x8bf9('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');_0xd236b5[_0x8bf9('0x57')][_0x8bf9('0x5e')]=_0xd236b5[_0x8bf9('0x57')]['UserId']||_0xd236b5[_0x8bf9('0x5f')]['id'];_0x1006c9[_0x8bf9('0x60')]['id']=_0xd236b5['body']['UserId'];return db[_0x8bf9('0x3a')][_0x8bf9('0x55')]({'where':{'id':_0xd236b5[_0x8bf9('0x51')]['id'],'UserId':null}})[_0x8bf9('0x1e')](handleEntityNotFound(_0x420d5c,null))['then'](saveUpdates(_0xd236b5['body'],null))[_0x8bf9('0x1e')](function(_0x112b45){if(_0x112b45){_0x1006c9[_0x8bf9('0x26')]=_0x112b45[_0x8bf9('0x61')]({'plain':!![]});return db[_0x8bf9('0x62')][_0x8bf9('0x55')]({'where':{'id':_0x112b45[_0x8bf9('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x420d5c,null))['then'](function(_0xc7c57a){if(_0xc7c57a){return _0xc7c57a[_0x8bf9('0x34')]({'UserId':_0xd236b5[_0x8bf9('0x57')]['UserId'],'read1stAt':_[_0x8bf9('0x64')](_0xc7c57a[_0x8bf9('0x65')])?moment()[_0x8bf9('0x5d')](_0x8bf9('0x66')):undefined});}return null;})['then'](function(_0x22b77c){if(_0x22b77c){_0x1006c9[_0x8bf9('0x67')]=_0x22b77c[_0x8bf9('0x61')]({'plain':!![]});interaction_log[_0x8bf9('0x1f')](_0x8bf9('0x68'),_0xd236b5[_0x8bf9('0x5f')]['id'],_0xd236b5[_0x8bf9('0x5f')][_0x8bf9('0x37')],_0xd236b5[_0x8bf9('0x5f')][_0x8bf9('0x69')],_0x1006c9[_0x8bf9('0x67')]['id'],_0xd236b5['body']?JSON['stringify'](_0xd236b5['body']):_0x8bf9('0x6a'));return respondWithRpcPromise(_0x8bf9('0x6b'),_0x8bf9('0x6c'),_0x1006c9);}return null;})[_0x8bf9('0x1e')](function(_0xa9ad94){var _0x22c658='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xa9ad94[_0x8bf9('0x26')][_0x8bf9('0x6d')];return db[_0x8bf9('0x6e')]['query'](_0x22c658,{'type':db[_0x8bf9('0x6f')][_0x8bf9('0x70')][_0x8bf9('0x71')],'raw':!![]})[_0x8bf9('0x1e')](function(_0x2b87cc){return _0x2b87cc;});})[_0x8bf9('0x1e')](function(_0x524389){if(_0x524389){_0x1006c9[_0x8bf9('0x26')][_0x8bf9('0x72')]=_0x524389[0x0];if(!_0xd236b5[_0x8bf9('0x57')][_0x8bf9('0x5e')])return;return db['User'][_0x8bf9('0x55')]({'where':{'id':_0xd236b5[_0x8bf9('0x57')]['UserId'],'role':_0x8bf9('0x60')},'attributes':['id',_0x8bf9('0x37'),_0x8bf9('0x73'),_0x8bf9('0x74'),_0x8bf9('0x75')],'raw':!![]});}return null;})[_0x8bf9('0x1e')](function(_0xf24dba){if(!_0xf24dba)return null;_0x1006c9['message'][_0x8bf9('0x60')]=_0xf24dba;return _0x1006c9;})['then'](function(_0x2af951){if(_0x2af951){if(_0xd236b5[_0x8bf9('0x57')]['manual']){_0x1006c9[_0x8bf9('0x26')][_0x8bf9('0x76')]=util[_0x8bf9('0x5d')]('SIP/%s',_0xd236b5[_0x8bf9('0x5f')][_0x8bf9('0x37')]);_0x1006c9[_0x8bf9('0x26')][_0x8bf9('0x77')]=_0x1006c9[_0x8bf9('0x77')];_0x1006c9[_0x8bf9('0x26')][_0x8bf9('0x78')]=_0x1006c9[_0x8bf9('0x77')];_0x1006c9[_0x8bf9('0x26')][_0x8bf9('0x79')]=_0x8bf9('0x5a');return respondWithRpcPromise(_0x8bf9('0x7a'),'EventManager',{'event':_0x8bf9('0x7b'),'message':_[_0x8bf9('0x4c')](_0x1006c9[_0x8bf9('0x26')],JSON['parse'](_0x1006c9[_0x8bf9('0x67')][_0x8bf9('0x7c')]))},client9002)[_0x8bf9('0x1e')](function(){return _0x1006c9;});}return _0x1006c9;}return null;})['then'](respondWithResult(_0x420d5c,null))[_0x8bf9('0x28')](handleError(_0x420d5c,null));};var interaction_log=require(_0x8bf9('0x13'))(_0x8bf9('0x59'));exports[_0x8bf9('0x7d')]=function(_0x539e70,_0x3d8aea,_0x8cf51b){var _0x4a1464={'agent':{},'channel':_0x8bf9('0x7e')};if(_0x539e70['body']['id']){delete _0x539e70[_0x8bf9('0x57')]['id'];}_0x539e70[_0x8bf9('0x57')][_0x8bf9('0x5e')]=_0x539e70[_0x8bf9('0x57')][_0x8bf9('0x5e')]||_0x539e70[_0x8bf9('0x5f')]['id'];_0x4a1464['agent']['id']=_0x539e70[_0x8bf9('0x57')][_0x8bf9('0x5e')];return db['ChatMessage'][_0x8bf9('0x55')]({'where':{'id':_0x539e70['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3d8aea,null))[_0x8bf9('0x1e')](function(_0x55905a){if(_0x55905a){_0x4a1464['message']=_0x55905a[_0x8bf9('0x61')]({'plain':!![]});return db[_0x8bf9('0x62')][_0x8bf9('0x55')]({'where':{'id':_0x55905a[_0x8bf9('0x63')]}});}return null;})[_0x8bf9('0x1e')](handleEntityNotFound(_0x3d8aea,null))[_0x8bf9('0x1e')](function(_0x525e4f){if(_0x525e4f){_0x4a1464[_0x8bf9('0x67')]=_0x525e4f[_0x8bf9('0x61')]({'plain':!![]});interaction_log['info'](_0x8bf9('0x7f'),_0x539e70[_0x8bf9('0x5f')]['id'],_0x539e70[_0x8bf9('0x5f')][_0x8bf9('0x37')],_0x539e70[_0x8bf9('0x5f')][_0x8bf9('0x69')],_0x4a1464[_0x8bf9('0x67')]['id'],_0x539e70[_0x8bf9('0x57')]?JSON['stringify'](_0x539e70['body']):_0x8bf9('0x6a'));return respondWithRpcPromise(_0x8bf9('0x80'),_0x8bf9('0x81'),_0x4a1464);}return null;})[_0x8bf9('0x1e')](function(_0x42a801){var _0x48b006='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x42a801['message'][_0x8bf9('0x6d')];return db['sequelize']['query'](_0x48b006,{'type':db['Sequelize'][_0x8bf9('0x70')][_0x8bf9('0x71')],'raw':!![]})['then'](function(_0x4593e5){return _0x4593e5;});})[_0x8bf9('0x1e')](function(_0x32d323){if(_0x32d323){_0x4a1464[_0x8bf9('0x26')]['contact']=_0x32d323[0x0];if(!_0x539e70[_0x8bf9('0x57')][_0x8bf9('0x5e')])return;return db[_0x8bf9('0x82')][_0x8bf9('0x55')]({'where':{'id':_0x539e70['body']['UserId'],'role':_0x8bf9('0x60')},'attributes':['id',_0x8bf9('0x37'),'fullname',_0x8bf9('0x74'),_0x8bf9('0x75')],'raw':!![]});}return null;})[_0x8bf9('0x1e')](function(_0x310990){if(!_0x310990)return null;_0x4a1464[_0x8bf9('0x26')]['agent']=_0x310990;return _0x4a1464;})[_0x8bf9('0x1e')](function(_0x1bdce8){if(_0x1bdce8){_0x1bdce8['message'][_0x8bf9('0x76')]=util[_0x8bf9('0x5d')](_0x8bf9('0x83'),_0x539e70[_0x8bf9('0x5f')]['name']);_0x1bdce8[_0x8bf9('0x26')][_0x8bf9('0x77')]=_0x4a1464[_0x8bf9('0x77')];_0x1bdce8[_0x8bf9('0x26')][_0x8bf9('0x78')]=_0x4a1464[_0x8bf9('0x77')];_0x1bdce8[_0x8bf9('0x26')][_0x8bf9('0x79')]='reject';respondWithRpcPromise(_0x8bf9('0x7a'),'EventManager',{'event':_0x8bf9('0x84'),'message':_['merge'](_0x4a1464[_0x8bf9('0x26')],JSON[_0x8bf9('0x85')](_0x4a1464[_0x8bf9('0x67')][_0x8bf9('0x7c')]))},client9002);return _0x4a1464;}return null;})[_0x8bf9('0x1e')](respondWithResult(_0x3d8aea,null))[_0x8bf9('0x28')](handleError(_0x3d8aea,null));};
\ No newline at end of file
+var _0xc86b=['rows','show','params','keys','find','body','describe','accept','chat','read','readAt','format','UserId','user','agent','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','User','fullname','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','chat-interactions','reject','get','RejectMessage','rejectMessage','ContactId','sequelize','Sequelize','contact','internal','rejectmessage','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','merge','options','ChatMessage','includeAll','include'];(function(_0xdb2727,_0xce46aa){var _0x36d766=function(_0x62a5a7){while(--_0x62a5a7){_0xdb2727['push'](_0xdb2727['shift']());}};_0x36d766(++_0xce46aa);}(_0xc86b,0x1cd));var _0xbc86=function(_0x41a489,_0x53545a){_0x41a489=_0x41a489-0x0;var _0x5a5365=_0xc86b[_0x41a489];return _0x5a5365;};'use strict';var emlformat=require(_0xbc86('0x0'));var rimraf=require(_0xbc86('0x1'));var zipdir=require(_0xbc86('0x2'));var jsonpatch=require(_0xbc86('0x3'));var rp=require(_0xbc86('0x4'));var moment=require(_0xbc86('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xbc86('0x6'));var sox=require(_0xbc86('0x7'));var csv=require(_0xbc86('0x8'));var ejs=require(_0xbc86('0x9'));var fs=require('fs');var fs_extra=require(_0xbc86('0xa'));var _=require(_0xbc86('0xb'));var squel=require(_0xbc86('0xc'));var crypto=require(_0xbc86('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbc86('0xe'));var toCsv=require(_0xbc86('0x8'));var querystring=require('querystring');var Papa=require(_0xbc86('0xf'));var Redis=require(_0xbc86('0x10'));var authService=require(_0xbc86('0x11'));var qs=require(_0xbc86('0x12'));var as=require(_0xbc86('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc86('0x14'))(_0xbc86('0x15'));var utils=require(_0xbc86('0x16'));var config=require(_0xbc86('0x17'));var licenseUtil=require(_0xbc86('0x18'));var db=require(_0xbc86('0x19'))['db'];config[_0xbc86('0x1a')]=_[_0xbc86('0x1b')](config[_0xbc86('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xbc86('0x1c'))(new Redis(config[_0xbc86('0x1a')]));require(_0xbc86('0x1d'))[_0xbc86('0x1e')](socket);var jayson=require(_0xbc86('0x1f'));var client=jayson[_0xbc86('0x20')][_0xbc86('0x21')]({'port':0x232c});var client9002=jayson[_0xbc86('0x20')][_0xbc86('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x5a0fa1,_0xb3473d,_0x58b2f3,_0x536be5){return new BPromise(function(_0x18e01c,_0x68f173){var _0x5dd72c=_0x536be5||client;return _0x5dd72c[_0xbc86('0x22')](_0x5a0fa1,_0x58b2f3)[_0xbc86('0x23')](function(_0x2ddb0f){logger[_0xbc86('0x24')](_0xbc86('0x25'),_0xb3473d,_0xbc86('0x26'));logger[_0xbc86('0x27')](_0xbc86('0x28'),_0xb3473d,_0xbc86('0x26'),JSON[_0xbc86('0x29')](_0x2ddb0f));if(_0x2ddb0f['error']){if(_0x2ddb0f[_0xbc86('0x2a')][_0xbc86('0x2b')]===0x1f4){logger[_0xbc86('0x2a')](_0xbc86('0x25'),_0xb3473d,_0x2ddb0f[_0xbc86('0x2a')][_0xbc86('0x2c')]);return _0x68f173(_0x2ddb0f['error'][_0xbc86('0x2c')]);}logger[_0xbc86('0x2a')](_0xbc86('0x25'),_0xb3473d,_0x2ddb0f[_0xbc86('0x2a')][_0xbc86('0x2c')]);return _0x18e01c(_0x2ddb0f[_0xbc86('0x2a')][_0xbc86('0x2c')]);}else{logger[_0xbc86('0x24')](_0xbc86('0x25'),_0xb3473d,_0xbc86('0x26'));_0x18e01c(_0x2ddb0f[_0xbc86('0x2d')]['message']);}})[_0xbc86('0x2e')](function(_0x139531){logger[_0xbc86('0x2a')](_0xbc86('0x25'),_0xb3473d,_0x139531);_0x68f173(_0x139531);});});}function respondWithStatusCode(_0x3d69aa,_0x491c63){_0x491c63=_0x491c63||0xcc;return function(_0x4aab9e){if(_0x4aab9e){return _0x3d69aa[_0xbc86('0x2f')](_0x491c63);}return _0x3d69aa['status'](_0x491c63)[_0xbc86('0x30')]();};}function respondWithResult(_0xdaa3e6,_0x5c105e){_0x5c105e=_0x5c105e||0xc8;return function(_0xf9892){if(_0xf9892){return _0xdaa3e6[_0xbc86('0x31')](_0x5c105e)[_0xbc86('0x32')](_0xf9892);}};}function respondWithFilteredResult(_0x5a91a6,_0x3af7dc){return function(_0x1e86a7){if(_0x1e86a7){var _0x3263f9=typeof _0x3af7dc[_0xbc86('0x33')]===_0xbc86('0x34')&&typeof _0x3af7dc[_0xbc86('0x35')]===_0xbc86('0x34');var _0x4e7159=_0x1e86a7[_0xbc86('0x36')];var _0x15c061=_0x3263f9?0x0:_0x3af7dc['offset'];var _0x302494=_0x3263f9?_0x1e86a7[_0xbc86('0x36')]:_0x3af7dc[_0xbc86('0x33')]+_0x3af7dc[_0xbc86('0x35')];var _0x3f73a1;if(_0x302494>=_0x4e7159){_0x302494=_0x4e7159;_0x3f73a1=0xc8;}else{_0x3f73a1=0xce;}_0x5a91a6[_0xbc86('0x31')](_0x3f73a1);return _0x5a91a6[_0xbc86('0x37')]('Content-Range',_0x15c061+'-'+_0x302494+'/'+_0x4e7159)[_0xbc86('0x32')](_0x1e86a7);}return null;};}function patchUpdates(_0x1d3ee7){return function(_0x16eabe){try{jsonpatch[_0xbc86('0x38')](_0x16eabe,_0x1d3ee7,!![]);}catch(_0x202c74){return BPromise['reject'](_0x202c74);}return _0x16eabe[_0xbc86('0x39')]();};}function saveUpdates(_0x3a9bbd,_0x24d59f){return function(_0x29a9e3){if(_0x29a9e3){return _0x29a9e3[_0xbc86('0x3a')](_0x3a9bbd)[_0xbc86('0x23')](function(_0x2e5d04){return _0x2e5d04;});}return null;};}function removeEntity(_0x4754ab,_0xaa6d76){return function(_0x454e5f){if(_0x454e5f){return _0x454e5f[_0xbc86('0x3b')]()[_0xbc86('0x23')](function(){_0x4754ab[_0xbc86('0x31')](0xcc)[_0xbc86('0x30')]();});}};}function handleEntityNotFound(_0x48eff7,_0xf78760){return function(_0x350083){if(!_0x350083){_0x48eff7[_0xbc86('0x2f')](0x194);}return _0x350083;};}function handleError(_0x270d35,_0x2aae74){_0x2aae74=_0x2aae74||0x1f4;return function(_0x19715b){logger[_0xbc86('0x2a')](_0x19715b[_0xbc86('0x3c')]);if(_0x19715b[_0xbc86('0x3d')]){delete _0x19715b[_0xbc86('0x3d')];}_0x270d35[_0xbc86('0x31')](_0x2aae74)['send'](_0x19715b);};}exports[_0xbc86('0x3e')]=function(_0x5cd983,_0x58fb7e){var _0x34d322={},_0x3ea317={},_0x36ce9b={'count':0x0,'rows':[]};var _0x20c19b=_['map'](db['ChatMessage'][_0xbc86('0x3f')],function(_0x57a206){return{'name':_0x57a206[_0xbc86('0x40')],'type':_0x57a206[_0xbc86('0x41')][_0xbc86('0x42')]};});_0x3ea317[_0xbc86('0x43')]=_[_0xbc86('0x44')](_0x20c19b,_0xbc86('0x3d'));_0x3ea317[_0xbc86('0x45')]=_['keys'](_0x5cd983['query']);_0x3ea317[_0xbc86('0x46')]=_[_0xbc86('0x47')](_0x3ea317['model'],_0x3ea317['query']);_0x34d322[_0xbc86('0x48')]=_['intersection'](_0x3ea317[_0xbc86('0x43')],qs[_0xbc86('0x49')](_0x5cd983[_0xbc86('0x45')][_0xbc86('0x49')]));_0x34d322[_0xbc86('0x48')]=_0x34d322['attributes'][_0xbc86('0x4a')]?_0x34d322[_0xbc86('0x48')]:_0x3ea317[_0xbc86('0x43')];if(!_0x5cd983[_0xbc86('0x45')][_0xbc86('0x4b')]('nolimit')){_0x34d322['limit']=qs[_0xbc86('0x35')](_0x5cd983['query'][_0xbc86('0x35')]);_0x34d322[_0xbc86('0x33')]=qs[_0xbc86('0x33')](_0x5cd983[_0xbc86('0x45')][_0xbc86('0x33')]);}_0x34d322[_0xbc86('0x4c')]=qs[_0xbc86('0x4d')](_0x5cd983[_0xbc86('0x45')]['sort']);_0x34d322['where']=qs[_0xbc86('0x46')](_[_0xbc86('0x4e')](_0x5cd983[_0xbc86('0x45')],_0x3ea317[_0xbc86('0x46')]),_0x20c19b);if(_0x5cd983[_0xbc86('0x45')][_0xbc86('0x4f')]){_0x34d322['where']=_['merge'](_0x34d322[_0xbc86('0x50')],{'$or':_['map'](_0x20c19b,function(_0x5b7711){if(_0x5b7711[_0xbc86('0x41')]!==_0xbc86('0x51')){var _0x2eee7c={};_0x2eee7c[_0x5b7711['name']]={'$like':'%'+_0x5cd983[_0xbc86('0x45')][_0xbc86('0x4f')]+'%'};return _0x2eee7c;}})});}_0x34d322=_[_0xbc86('0x52')]({},_0x34d322,_0x5cd983[_0xbc86('0x53')]);var _0x2e7966={'where':_0x34d322['where']};return db[_0xbc86('0x54')]['count'](_0x2e7966)[_0xbc86('0x23')](function(_0x3cfaeb){_0x36ce9b[_0xbc86('0x36')]=_0x3cfaeb;if(_0x5cd983[_0xbc86('0x45')][_0xbc86('0x55')]){_0x34d322[_0xbc86('0x56')]=[{'all':!![]}];}return db[_0xbc86('0x54')]['findAll'](_0x34d322);})[_0xbc86('0x23')](function(_0x37f855){_0x36ce9b[_0xbc86('0x57')]=_0x37f855;return _0x36ce9b;})[_0xbc86('0x23')](respondWithFilteredResult(_0x58fb7e,_0x34d322))[_0xbc86('0x2e')](handleError(_0x58fb7e,null));};exports[_0xbc86('0x58')]=function(_0x274cb1,_0x486fb7){var _0x1ee23a={'raw':!![],'where':{'id':_0x274cb1[_0xbc86('0x59')]['id']}},_0x5c27c9={};_0x5c27c9['model']=_[_0xbc86('0x5a')](db[_0xbc86('0x54')][_0xbc86('0x3f')]);_0x5c27c9[_0xbc86('0x45')]=_[_0xbc86('0x5a')](_0x274cb1['query']);_0x5c27c9['filters']=_[_0xbc86('0x47')](_0x5c27c9[_0xbc86('0x43')],_0x5c27c9['query']);_0x1ee23a[_0xbc86('0x48')]=_[_0xbc86('0x47')](_0x5c27c9[_0xbc86('0x43')],qs[_0xbc86('0x49')](_0x274cb1[_0xbc86('0x45')][_0xbc86('0x49')]));_0x1ee23a[_0xbc86('0x48')]=_0x1ee23a[_0xbc86('0x48')][_0xbc86('0x4a')]?_0x1ee23a[_0xbc86('0x48')]:_0x5c27c9[_0xbc86('0x43')];if(_0x274cb1[_0xbc86('0x45')]['includeAll']){_0x1ee23a['include']=[{'all':!![]}];}_0x1ee23a=_[_0xbc86('0x52')]({},_0x1ee23a,_0x274cb1[_0xbc86('0x53')]);return db[_0xbc86('0x54')][_0xbc86('0x5b')](_0x1ee23a)[_0xbc86('0x23')](handleEntityNotFound(_0x486fb7,null))['then'](respondWithResult(_0x486fb7,null))[_0xbc86('0x2e')](handleError(_0x486fb7,null));};exports['create']=function(_0x37daa7,_0x22ab27){return db['ChatMessage']['create'](_0x37daa7[_0xbc86('0x5c')],{})[_0xbc86('0x23')](respondWithResult(_0x22ab27,0xc9))['catch'](handleError(_0x22ab27,null));};exports[_0xbc86('0x3a')]=function(_0x39f42d,_0x296b20){if(_0x39f42d['body']['id']){delete _0x39f42d['body']['id'];}return db[_0xbc86('0x54')][_0xbc86('0x5b')]({'where':{'id':_0x39f42d[_0xbc86('0x59')]['id']}})['then'](handleEntityNotFound(_0x296b20,null))[_0xbc86('0x23')](saveUpdates(_0x39f42d[_0xbc86('0x5c')],null))[_0xbc86('0x23')](respondWithResult(_0x296b20,null))[_0xbc86('0x2e')](handleError(_0x296b20,null));};exports['destroy']=function(_0x3a5583,_0x507c01){return db[_0xbc86('0x54')]['find']({'where':{'id':_0x3a5583[_0xbc86('0x59')]['id']}})[_0xbc86('0x23')](handleEntityNotFound(_0x507c01,null))[_0xbc86('0x23')](removeEntity(_0x507c01,null))[_0xbc86('0x2e')](handleError(_0x507c01,null));};exports[_0xbc86('0x5d')]=function(_0x41c068,_0x29fc1b){return db[_0xbc86('0x54')][_0xbc86('0x5d')]()[_0xbc86('0x23')](respondWithResult(_0x29fc1b,null))[_0xbc86('0x2e')](handleError(_0x29fc1b,null));};var interaction_log=require(_0xbc86('0x14'))('chat-interactions');exports[_0xbc86('0x5e')]=function(_0x415974,_0x4828ee,_0x1569ea){var _0x29404a={'agent':{},'channel':_0xbc86('0x5f')};if(_0x415974[_0xbc86('0x5c')]['id']){delete _0x415974[_0xbc86('0x5c')]['id'];}_0x415974[_0xbc86('0x5c')][_0xbc86('0x60')]=!![];_0x415974['body'][_0xbc86('0x61')]=moment()[_0xbc86('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x415974[_0xbc86('0x5c')][_0xbc86('0x63')]=_0x415974['body'][_0xbc86('0x63')]||_0x415974[_0xbc86('0x64')]['id'];_0x29404a[_0xbc86('0x65')]['id']=_0x415974['body'][_0xbc86('0x63')];return db[_0xbc86('0x54')][_0xbc86('0x5b')]({'where':{'id':_0x415974[_0xbc86('0x59')]['id'],'UserId':null}})[_0xbc86('0x23')](handleEntityNotFound(_0x4828ee,null))[_0xbc86('0x23')](saveUpdates(_0x415974[_0xbc86('0x5c')],null))['then'](function(_0x3f3bec){if(_0x3f3bec){_0x29404a[_0xbc86('0x2c')]=_0x3f3bec['get']({'plain':!![]});return db[_0xbc86('0x66')][_0xbc86('0x5b')]({'where':{'id':_0x3f3bec[_0xbc86('0x67')]}});}return null;})[_0xbc86('0x23')](handleEntityNotFound(_0x4828ee,null))[_0xbc86('0x23')](function(_0x3b75a7){if(_0x3b75a7){return _0x3b75a7[_0xbc86('0x3a')]({'UserId':_0x415974[_0xbc86('0x5c')][_0xbc86('0x63')],'read1stAt':_[_0xbc86('0x68')](_0x3b75a7[_0xbc86('0x69')])?moment()[_0xbc86('0x62')](_0xbc86('0x6a')):undefined});}return null;})[_0xbc86('0x23')](function(_0xdd8a9){if(_0xdd8a9){_0x29404a[_0xbc86('0x6b')]=_0xdd8a9['get']({'plain':!![]});interaction_log[_0xbc86('0x24')](_0xbc86('0x6c'),_0x415974[_0xbc86('0x64')]['id'],_0x415974[_0xbc86('0x64')]['name'],_0x415974[_0xbc86('0x64')][_0xbc86('0x6d')],_0x29404a['interaction']['id'],_0x415974[_0xbc86('0x5c')]?JSON[_0xbc86('0x29')](_0x415974[_0xbc86('0x5c')]):'null');return respondWithRpcPromise(_0xbc86('0x6e'),_0xbc86('0x6f'),_0x29404a);}return null;})['then'](function(_0x23008c){var _0x1188a0=_0xbc86('0x70')+_0x23008c[_0xbc86('0x2c')]['ContactId'];return db['sequelize'][_0xbc86('0x45')](_0x1188a0,{'type':db['Sequelize']['QueryTypes'][_0xbc86('0x71')],'raw':!![]})[_0xbc86('0x23')](function(_0x48df76){return _0x48df76;});})[_0xbc86('0x23')](function(_0x368f63){if(_0x368f63){_0x29404a[_0xbc86('0x2c')]['contact']=_0x368f63[0x0];if(!_0x415974[_0xbc86('0x5c')][_0xbc86('0x63')])return;return db[_0xbc86('0x72')][_0xbc86('0x5b')]({'where':{'id':_0x415974[_0xbc86('0x5c')][_0xbc86('0x63')],'role':_0xbc86('0x65')},'attributes':['id',_0xbc86('0x3d'),_0xbc86('0x73'),'email','internal'],'raw':!![]});}return null;})[_0xbc86('0x23')](function(_0x5a9e91){if(!_0x5a9e91)return null;_0x29404a['message'][_0xbc86('0x65')]=_0x5a9e91;return _0x29404a;})[_0xbc86('0x23')](function(_0x10537c){if(_0x10537c){if(_0x415974[_0xbc86('0x5c')][_0xbc86('0x74')]){_0x29404a[_0xbc86('0x2c')][_0xbc86('0x75')]=util['format'](_0xbc86('0x76'),_0x415974[_0xbc86('0x64')][_0xbc86('0x3d')]);_0x29404a[_0xbc86('0x2c')]['channel']=_0x29404a[_0xbc86('0x77')];_0x29404a['message'][_0xbc86('0x78')]=_0x29404a[_0xbc86('0x77')];_0x29404a[_0xbc86('0x2c')][_0xbc86('0x79')]=_0xbc86('0x5e');return respondWithRpcPromise(_0xbc86('0x7a'),_0xbc86('0x7a'),{'event':_0xbc86('0x7b'),'message':_[_0xbc86('0x52')](_0x29404a[_0xbc86('0x2c')],JSON[_0xbc86('0x7c')](_0x29404a[_0xbc86('0x6b')]['formData']))},client9002)['then'](function(){return _0x29404a;});}return _0x29404a;}return null;})['then'](respondWithResult(_0x4828ee,null))[_0xbc86('0x2e')](handleError(_0x4828ee,null));};var interaction_log=require('../../config/logger')(_0xbc86('0x7d'));exports[_0xbc86('0x7e')]=function(_0xcf9704,_0x1383e3,_0x4f6e2e){var _0x1ee6c4={'agent':{},'channel':_0xbc86('0x5f')};if(_0xcf9704[_0xbc86('0x5c')]['id']){delete _0xcf9704['body']['id'];}_0xcf9704[_0xbc86('0x5c')][_0xbc86('0x63')]=_0xcf9704[_0xbc86('0x5c')]['UserId']||_0xcf9704[_0xbc86('0x64')]['id'];_0x1ee6c4[_0xbc86('0x65')]['id']=_0xcf9704[_0xbc86('0x5c')][_0xbc86('0x63')];return db[_0xbc86('0x54')][_0xbc86('0x5b')]({'where':{'id':_0xcf9704[_0xbc86('0x59')]['id'],'UserId':null}})[_0xbc86('0x23')](handleEntityNotFound(_0x1383e3,null))[_0xbc86('0x23')](function(_0x2590a7){if(_0x2590a7){_0x1ee6c4[_0xbc86('0x2c')]=_0x2590a7[_0xbc86('0x7f')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x2590a7[_0xbc86('0x67')]}});}return null;})[_0xbc86('0x23')](handleEntityNotFound(_0x1383e3,null))[_0xbc86('0x23')](function(_0x1135c6){if(_0x1135c6){_0x1ee6c4['interaction']=_0x1135c6[_0xbc86('0x7f')]({'plain':!![]});interaction_log[_0xbc86('0x24')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xcf9704[_0xbc86('0x64')]['id'],_0xcf9704[_0xbc86('0x64')][_0xbc86('0x3d')],_0xcf9704['user'][_0xbc86('0x6d')],_0x1ee6c4['interaction']['id'],_0xcf9704[_0xbc86('0x5c')]?JSON[_0xbc86('0x29')](_0xcf9704[_0xbc86('0x5c')]):'null');return respondWithRpcPromise(_0xbc86('0x80'),_0xbc86('0x81'),_0x1ee6c4);}return null;})['then'](function(_0x46c0a5){var _0x7eb224='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x46c0a5[_0xbc86('0x2c')][_0xbc86('0x82')];return db[_0xbc86('0x83')]['query'](_0x7eb224,{'type':db[_0xbc86('0x84')]['QueryTypes']['SELECT'],'raw':!![]})[_0xbc86('0x23')](function(_0x417e66){return _0x417e66;});})[_0xbc86('0x23')](function(_0x4aae9f){if(_0x4aae9f){_0x1ee6c4[_0xbc86('0x2c')][_0xbc86('0x85')]=_0x4aae9f[0x0];if(!_0xcf9704['body'][_0xbc86('0x63')])return;return db[_0xbc86('0x72')]['find']({'where':{'id':_0xcf9704[_0xbc86('0x5c')][_0xbc86('0x63')],'role':_0xbc86('0x65')},'attributes':['id',_0xbc86('0x3d'),_0xbc86('0x73'),'email',_0xbc86('0x86')],'raw':!![]});}return null;})[_0xbc86('0x23')](function(_0x39e3ce){if(!_0x39e3ce)return null;_0x1ee6c4[_0xbc86('0x2c')][_0xbc86('0x65')]=_0x39e3ce;return _0x1ee6c4;})[_0xbc86('0x23')](function(_0x113853){if(_0x113853){_0x113853['message'][_0xbc86('0x75')]=util[_0xbc86('0x62')](_0xbc86('0x76'),_0xcf9704[_0xbc86('0x64')][_0xbc86('0x3d')]);_0x113853[_0xbc86('0x2c')][_0xbc86('0x77')]=_0x1ee6c4[_0xbc86('0x77')];_0x113853[_0xbc86('0x2c')][_0xbc86('0x78')]=_0x1ee6c4['channel'];_0x113853[_0xbc86('0x2c')][_0xbc86('0x79')]=_0xbc86('0x7e');respondWithRpcPromise(_0xbc86('0x7a'),_0xbc86('0x7a'),{'event':_0xbc86('0x87'),'message':_[_0xbc86('0x52')](_0x1ee6c4[_0xbc86('0x2c')],JSON[_0xbc86('0x7c')](_0x1ee6c4['interaction'][_0xbc86('0x88')]))},client9002);return _0x1ee6c4;}return null;})[_0xbc86('0x23')](respondWithResult(_0x1383e3,null))[_0xbc86('0x2e')](handleError(_0x1383e3,null));};
\ No newline at end of file
index c620769..aaa5cbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3337=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0x3e5e09,_0x18f56c){var _0x5da589=function(_0x45ee7c){while(--_0x45ee7c){_0x3e5e09['push'](_0x3e5e09['shift']());}};_0x5da589(++_0x18f56c);}(_0x3337,0x130));var _0x7333=function(_0x2b338b,_0x4a06ba){_0x2b338b=_0x2b338b-0x0;var _0x256f66=_0x3337[_0x2b338b];return _0x256f66;};'use strict';var EventEmitter=require(_0x7333('0x0'));var ChatMessage=require(_0x7333('0x1'))['db'][_0x7333('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7333('0x3')](0x0);var events={'afterCreate':_0x7333('0x4'),'afterUpdate':_0x7333('0x5'),'afterDestroy':'remove'};function emitEvent(_0x490e2d){return function(_0x16fb81,_0x1cabb6,_0x6b59fe){ChatMessageEvents[_0x7333('0x6')](_0x490e2d+':'+_0x16fb81['id'],_0x16fb81);ChatMessageEvents[_0x7333('0x6')](_0x490e2d,_0x16fb81);_0x6b59fe(null);};}for(var e in events){if(events[_0x7333('0x7')](e)){var event=events[e];ChatMessage[_0x7333('0x8')](e,emitEvent(event));}}module[_0x7333('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0xa433=['emit','hasOwnProperty','events','../../mysqldb','ChatMessage','setMaxListeners','update'];(function(_0x1f5e3c,_0x5515ec){var _0x1f0372=function(_0x42d2f9){while(--_0x42d2f9){_0x1f5e3c['push'](_0x1f5e3c['shift']());}};_0x1f0372(++_0x5515ec);}(_0xa433,0xf7));var _0x3a43=function(_0x283845,_0x3e2263){_0x283845=_0x283845-0x0;var _0x3b0b24=_0xa433[_0x283845];return _0x3b0b24;};'use strict';var EventEmitter=require(_0x3a43('0x0'));var ChatMessage=require(_0x3a43('0x1'))['db'][_0x3a43('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3a43('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3a43('0x4'),'afterDestroy':'remove'};function emitEvent(_0x24240e){return function(_0x11aa77,_0x5574e8,_0x4e7bc5){ChatMessageEvents['emit'](_0x24240e+':'+_0x11aa77['id'],_0x11aa77);ChatMessageEvents[_0x3a43('0x5')](_0x24240e,_0x11aa77);_0x4e7bc5(null);};}for(var e in events){if(events[_0x3a43('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
index 0d9bd01..82e53d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4e5=['FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','then','createdAt','catch','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body'];(function(_0x15273a,_0xb0393d){var _0x5d9fac=function(_0x3dfa88){while(--_0x3dfa88){_0x15273a['push'](_0x15273a['shift']());}};_0x5d9fac(++_0xb0393d);}(_0xb4e5,0x17a));var _0x5b4e=function(_0x383685,_0x50eadf){_0x383685=_0x383685-0x0;var _0x554106=_0xb4e5[_0x383685];return _0x554106;};'use strict';var _=require('lodash');var util=require(_0x5b4e('0x0'));var logger=require(_0x5b4e('0x1'))(_0x5b4e('0x2'));var moment=require(_0x5b4e('0x3'));var BPromise=require(_0x5b4e('0x4'));var rp=require(_0x5b4e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5b4e('0x6'));var config=require(_0x5b4e('0x7'));var attributes=require(_0x5b4e('0x8'));module[_0x5b4e('0x9')]=function(_0x3c5c6b,_0x5420b8){return _0x3c5c6b[_0x5b4e('0xa')](_0x5b4e('0xb'),attributes,{'tableName':_0x5b4e('0xc'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x5b4e('0xd')],'type':_0x5b4e('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4df5fe,_0x1d6ebe,_0x4a1abf){var _0x5501b2=_0x3c5c6b[_0x5b4e('0xf')];var _0x12b231=_0x4df5fe[_0x5b4e('0x10')]({'plain':!![]});if(_0x12b231[_0x5b4e('0x11')][_0x5b4e('0x12')]()==='in'||_0x12b231[_0x5b4e('0x11')][_0x5b4e('0x12')]()===_0x5b4e('0x13')&&!_0x12b231[_0x5b4e('0x14')]&&!_['isNil'](_0x12b231[_0x5b4e('0x15')])){_0x5501b2[_0x5b4e('0x16')][_0x5b4e('0x17')]({'where':{'id':_0x12b231['ChatInteractionId']}})[_0x5b4e('0x18')](function(_0x4ef56f){if(_0x4ef56f){_0x4ef56f['update']({'lastMsgAt':_0x12b231[_0x5b4e('0x19')],'lastMsgDirection':_0x12b231['direction'][_0x5b4e('0x12')]()});}})[_0x5b4e('0x1a')](function(_0x56210f){console['error'](_0x56210f);});}_0x4a1abf();}},'charset':'utf8mb4','collate':_0x5b4e('0x1b')});};
\ No newline at end of file
+var _0x433f=['secret','isNil','findOne','ChatInteractionId','update','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x433f,0x13c));var _0xf433=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x433f[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xf433('0x0'));var util=require(_0xf433('0x1'));var logger=require(_0xf433('0x2'))(_0xf433('0x3'));var moment=require(_0xf433('0x4'));var BPromise=require('bluebird');var rp=require(_0xf433('0x5'));var fs=require('fs');var path=require(_0xf433('0x6'));var rimraf=require(_0xf433('0x7'));var config=require(_0xf433('0x8'));var attributes=require('./chatMessage.attributes');module[_0xf433('0x9')]=function(_0x5b599e,_0x1f86f1){return _0x5b599e[_0xf433('0xa')](_0xf433('0xb'),attributes,{'tableName':_0xf433('0xc'),'paranoid':![],'indexes':[{'name':_0xf433('0xd'),'fields':[_0xf433('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x631b1b,_0x13408d,_0x1106b0){var _0x38fd0c=_0x5b599e[_0xf433('0xf')];var _0x3deba4=_0x631b1b[_0xf433('0x10')]({'plain':!![]});if(_0x3deba4[_0xf433('0x11')]['toLowerCase']()==='in'||_0x3deba4[_0xf433('0x11')][_0xf433('0x12')]()===_0xf433('0x13')&&!_0x3deba4[_0xf433('0x14')]&&!_[_0xf433('0x15')](_0x3deba4['UserId'])){_0x38fd0c['ChatInteraction'][_0xf433('0x16')]({'where':{'id':_0x3deba4[_0xf433('0x17')]}})['then'](function(_0xc2f494){if(_0xc2f494){_0xc2f494[_0xf433('0x18')]({'lastMsgAt':_0x3deba4['createdAt'],'lastMsgDirection':_0x3deba4[_0xf433('0x11')][_0xf433('0x12')]()});}})['catch'](function(_0x52fd0d){console[_0xf433('0x19')](_0x52fd0d);});}_0x1106b0();}},'charset':_0xf433('0x1a'),'collate':_0xf433('0x1b')});};
\ No newline at end of file
index 9cfb145..4e42b73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b5a=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','raw','then','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x187bc0,_0x41ed6d){var _0x2a6cca=function(_0x326f7b){while(--_0x326f7b){_0x187bc0['push'](_0x187bc0['shift']());}};_0x2a6cca(++_0x41ed6d);}(_0x6b5a,0xd2));var _0xa6b5=function(_0x2256d8,_0x5853cf){_0x2256d8=_0x2256d8-0x0;var _0x2d8c9d=_0x6b5a[_0x2256d8];return _0x2d8c9d;};'use strict';var _=require('lodash');var util=require(_0xa6b5('0x0'));var moment=require(_0xa6b5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6b5('0x2'));var db=require(_0xa6b5('0x3'))['db'];var utils=require(_0xa6b5('0x4'));var logger=require(_0xa6b5('0x5'))('rpc');var config=require(_0xa6b5('0x6'));var jayson=require(_0xa6b5('0x7'));var client=jayson[_0xa6b5('0x8')]['http']({'port':0x232a});config[_0xa6b5('0x9')]=_[_0xa6b5('0xa')](config[_0xa6b5('0x9')],{'host':_0xa6b5('0xb'),'port':0x18eb});var socket=require(_0xa6b5('0xc'))(new Redis(config[_0xa6b5('0x9')]));require(_0xa6b5('0xd'))[_0xa6b5('0xe')](socket);function respondWithRpcPromise(_0x177bdc,_0xd35884,_0x2e740b){return new BPromise(function(_0x4e1b2f,_0xfa0045){return client[_0xa6b5('0xf')](_0x177bdc,_0x2e740b)['then'](function(_0x11a15a){logger[_0xa6b5('0x10')](_0xa6b5('0x11'),_0xd35884,_0xa6b5('0x12'));logger[_0xa6b5('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0xd35884,_0xa6b5('0x12'),JSON[_0xa6b5('0x14')](_0x11a15a));if(_0x11a15a['error']){if(_0x11a15a['error']['code']===0x1f4){logger[_0xa6b5('0x15')](_0xa6b5('0x11'),_0xd35884,_0x11a15a[_0xa6b5('0x15')][_0xa6b5('0x16')]);return _0xfa0045(_0x11a15a[_0xa6b5('0x15')][_0xa6b5('0x16')]);}logger[_0xa6b5('0x15')](_0xa6b5('0x11'),_0xd35884,_0x11a15a[_0xa6b5('0x15')]['message']);return _0x4e1b2f(_0x11a15a[_0xa6b5('0x15')][_0xa6b5('0x16')]);}else{logger[_0xa6b5('0x10')](_0xa6b5('0x11'),_0xd35884,_0xa6b5('0x12'));_0x4e1b2f(_0x11a15a[_0xa6b5('0x17')][_0xa6b5('0x16')]);}})[_0xa6b5('0x18')](function(_0x13667d){logger[_0xa6b5('0x15')](_0xa6b5('0x11'),_0xd35884,_0x13667d);_0xfa0045(_0x13667d);});});}exports[_0xa6b5('0x19')]=function(_0x38b441){var _0x42cb8f=this;return new Promise(function(_0x3a1aea,_0x49001a){return db[_0xa6b5('0x1a')][_0xa6b5('0x1b')](_0x38b441[_0xa6b5('0x1c')],{'raw':_0x38b441['options']?_0x38b441['options'][_0xa6b5('0x1d')]===undefined?!![]:![]:!![]})[_0xa6b5('0x1e')](function(_0x1574c1){logger['info']('CreateChatMessage',_0x38b441);logger['debug'](_0xa6b5('0x19'),_0x38b441,JSON['stringify'](_0x1574c1));_0x3a1aea(_0x1574c1);})['catch'](function(_0x3453bc){logger['error'](_0xa6b5('0x19'),_0x3453bc[_0xa6b5('0x16')],_0x38b441);_0x49001a(_0x42cb8f['error'](0x1f4,_0x3453bc['message']));});});};
\ No newline at end of file
+var _0x2718=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateChatMessage','ChatMessage','create','body','options','raw','then','stringify'];(function(_0x2ce727,_0x1152e4){var _0x180169=function(_0x32889d){while(--_0x32889d){_0x2ce727['push'](_0x2ce727['shift']());}};_0x180169(++_0x1152e4);}(_0x2718,0x18d));var _0x8271=function(_0x145e13,_0x162d05){_0x145e13=_0x145e13-0x0;var _0x2d0070=_0x2718[_0x145e13];return _0x2d0070;};'use strict';var _=require(_0x8271('0x0'));var util=require(_0x8271('0x1'));var moment=require(_0x8271('0x2'));var BPromise=require(_0x8271('0x3'));var rs=require(_0x8271('0x4'));var fs=require('fs');var Redis=require(_0x8271('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8271('0x6'));var logger=require('../../config/logger')(_0x8271('0x7'));var config=require(_0x8271('0x8'));var jayson=require(_0x8271('0x9'));var client=jayson[_0x8271('0xa')][_0x8271('0xb')]({'port':0x232a});config['redis']=_[_0x8271('0xc')](config[_0x8271('0xd')],{'host':_0x8271('0xe'),'port':0x18eb});var socket=require(_0x8271('0xf'))(new Redis(config[_0x8271('0xd')]));require(_0x8271('0x10'))[_0x8271('0x11')](socket);function respondWithRpcPromise(_0x33a6b4,_0x4edb07,_0x47cb7d){return new BPromise(function(_0x3588e7,_0x267a52){return client['request'](_0x33a6b4,_0x47cb7d)['then'](function(_0x1948ca){logger[_0x8271('0x12')](_0x8271('0x13'),_0x4edb07,_0x8271('0x14'));logger[_0x8271('0x15')](_0x8271('0x16'),_0x4edb07,_0x8271('0x14'),JSON['stringify'](_0x1948ca));if(_0x1948ca[_0x8271('0x17')]){if(_0x1948ca[_0x8271('0x17')][_0x8271('0x18')]===0x1f4){logger[_0x8271('0x17')](_0x8271('0x13'),_0x4edb07,_0x1948ca[_0x8271('0x17')][_0x8271('0x19')]);return _0x267a52(_0x1948ca['error']['message']);}logger[_0x8271('0x17')](_0x8271('0x13'),_0x4edb07,_0x1948ca[_0x8271('0x17')][_0x8271('0x19')]);return _0x3588e7(_0x1948ca[_0x8271('0x17')][_0x8271('0x19')]);}else{logger['info'](_0x8271('0x13'),_0x4edb07,_0x8271('0x14'));_0x3588e7(_0x1948ca[_0x8271('0x1a')][_0x8271('0x19')]);}})['catch'](function(_0x4273ab){logger[_0x8271('0x17')](_0x8271('0x13'),_0x4edb07,_0x4273ab);_0x267a52(_0x4273ab);});});}exports[_0x8271('0x1b')]=function(_0x5b78b7){var _0x343daf=this;return new Promise(function(_0x9ec477,_0x16b691){return db[_0x8271('0x1c')][_0x8271('0x1d')](_0x5b78b7[_0x8271('0x1e')],{'raw':_0x5b78b7[_0x8271('0x1f')]?_0x5b78b7[_0x8271('0x1f')][_0x8271('0x20')]===undefined?!![]:![]:!![]})[_0x8271('0x21')](function(_0x2d6741){logger[_0x8271('0x12')]('CreateChatMessage',_0x5b78b7);logger['debug'](_0x8271('0x1b'),_0x5b78b7,JSON[_0x8271('0x22')](_0x2d6741));_0x9ec477(_0x2d6741);})[_0x8271('0x23')](function(_0x5a70fc){logger[_0x8271('0x17')]('CreateChatMessage',_0x5a70fc[_0x8271('0x19')],_0x5b78b7);_0x16b691(_0x343daf[_0x8271('0x17')](0x1f4,_0x5a70fc[_0x8271('0x19')]));});});};
\ No newline at end of file
index a301e19..0f45399 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19da=['update','register','length','save'];(function(_0x157ed1,_0x4162fb){var _0x4c3f53=function(_0x5a3ba1){while(--_0x5a3ba1){_0x157ed1['push'](_0x157ed1['shift']());}};_0x4c3f53(++_0x4162fb);}(_0x19da,0x9f));var _0xa19d=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x19da[_0x50a0c2];return _0x5ebadd;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xa19d('0x0'),'remove',_0xa19d('0x1')];function createListener(_0x5ba569,_0x3a48f4){return function(_0x17f1c6){_0x3a48f4['emit'](_0x5ba569,_0x17f1c6);};}function removeListener(_0x179db7,_0x28ec9a){return function(){ChatMessageEvents['removeListener'](_0x179db7,_0x28ec9a);};}exports[_0xa19d('0x2')]=function(_0x330adb){for(var _0x1f6e10=0x0,_0x14dc68=events[_0xa19d('0x3')];_0x1f6e10<_0x14dc68;_0x1f6e10++){var _0x4b4627=events[_0x1f6e10];var _0x197c4e=createListener('chatMessage:'+_0x4b4627,_0x330adb);ChatMessageEvents['on'](_0x4b4627,_0x197c4e);}};
\ No newline at end of file
+var _0xae1c=['removeListener','register','length','emit'];(function(_0x161ffe,_0x514051){var _0x5bec90=function(_0x55debc){while(--_0x55debc){_0x161ffe['push'](_0x161ffe['shift']());}};_0x5bec90(++_0x514051);}(_0xae1c,0xff));var _0xcae1=function(_0xe5f49c,_0x4959d9){_0xe5f49c=_0xe5f49c-0x0;var _0x392cee=_0xae1c[_0xe5f49c];return _0x392cee;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save','remove','update'];function createListener(_0x1ab262,_0x19e218){return function(_0x3e2e25){_0x19e218[_0xcae1('0x0')](_0x1ab262,_0x3e2e25);};}function removeListener(_0x1d37db,_0x2b6b57){return function(){ChatMessageEvents[_0xcae1('0x1')](_0x1d37db,_0x2b6b57);};}exports[_0xcae1('0x2')]=function(_0x3513e5){for(var _0x40fcec=0x0,_0x3c35c7=events[_0xcae1('0x3')];_0x40fcec<_0x3c35c7;_0x40fcec++){var _0x7a27b8=events[_0x40fcec];var _0x50d451=createListener('chatMessage:'+_0x7a27b8,_0x3513e5);ChatMessageEvents['on'](_0x7a27b8,_0x50d451);}};
\ No newline at end of file
index 11aee4b..68d7d14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0e8=['reject','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','/:id','post','tracked','chat','chatmessage:create','create','put','update','/:id/reject'];(function(_0x98ee7c,_0x499bff){var _0xe4d709=function(_0x12791a){while(--_0x12791a){_0x98ee7c['push'](_0x98ee7c['shift']());}};_0xe4d709(++_0x499bff);}(_0xb0e8,0xff));var _0x8b0e=function(_0x211087,_0x354fdd){_0x211087=_0x211087-0x0;var _0x2a581f=_0xb0e8[_0x211087];return _0x2a581f;};'use strict';var multer=require(_0x8b0e('0x0'));var util=require(_0x8b0e('0x1'));var path=require(_0x8b0e('0x2'));var timeout=require(_0x8b0e('0x3'));var express=require(_0x8b0e('0x4'));var router=express[_0x8b0e('0x5')]();var fs_extra=require(_0x8b0e('0x6'));var auth=require(_0x8b0e('0x7'));var interaction=require(_0x8b0e('0x8'));var config=require('../../config/environment');var controller=require(_0x8b0e('0x9'));router[_0x8b0e('0xa')]('/',auth[_0x8b0e('0xb')](),controller['index']);router[_0x8b0e('0xa')]('/describe',auth[_0x8b0e('0xb')](),controller['describe']);router[_0x8b0e('0xa')](_0x8b0e('0xc'),auth[_0x8b0e('0xb')](),controller['show']);router[_0x8b0e('0xd')]('/',auth[_0x8b0e('0xb')](),interaction[_0x8b0e('0xe')](_0x8b0e('0xf'),_0x8b0e('0x10')),controller[_0x8b0e('0x11')]);router[_0x8b0e('0x12')](_0x8b0e('0xc'),controller[_0x8b0e('0x13')]);router[_0x8b0e('0x12')]('/:id/accept',auth[_0x8b0e('0xb')](),controller['accept']);router['put'](_0x8b0e('0x14'),auth[_0x8b0e('0xb')](),controller[_0x8b0e('0x15')]);router['delete'](_0x8b0e('0xc'),auth['isAuthenticated'](),controller[_0x8b0e('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xe657=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','/:id','show','post','tracked','chat','create','put','/:id/accept','accept','reject','delete','destroy','multer','path','connect-timeout'];(function(_0x4fff35,_0x256fed){var _0x13ad17=function(_0x1d43c5){while(--_0x1d43c5){_0x4fff35['push'](_0x4fff35['shift']());}};_0x13ad17(++_0x256fed);}(_0xe657,0x101));var _0x7e65=function(_0x4d9a48,_0x20bc50){_0x4d9a48=_0x4d9a48-0x0;var _0xef464d=_0xe657[_0x4d9a48];return _0xef464d;};'use strict';var multer=require(_0x7e65('0x0'));var util=require('util');var path=require(_0x7e65('0x1'));var timeout=require(_0x7e65('0x2'));var express=require(_0x7e65('0x3'));var router=express[_0x7e65('0x4')]();var fs_extra=require(_0x7e65('0x5'));var auth=require(_0x7e65('0x6'));var interaction=require(_0x7e65('0x7'));var config=require(_0x7e65('0x8'));var controller=require(_0x7e65('0x9'));router[_0x7e65('0xa')]('/',auth['isAuthenticated'](),controller[_0x7e65('0xb')]);router[_0x7e65('0xa')](_0x7e65('0xc'),auth[_0x7e65('0xd')](),controller['describe']);router['get'](_0x7e65('0xe'),auth[_0x7e65('0xd')](),controller[_0x7e65('0xf')]);router[_0x7e65('0x10')]('/',auth[_0x7e65('0xd')](),interaction[_0x7e65('0x11')](_0x7e65('0x12'),'chatmessage:create'),controller[_0x7e65('0x13')]);router['put']('/:id',controller['update']);router[_0x7e65('0x14')](_0x7e65('0x15'),auth[_0x7e65('0xd')](),controller[_0x7e65('0x16')]);router[_0x7e65('0x14')]('/:id/reject',auth[_0x7e65('0xd')](),controller[_0x7e65('0x17')]);router[_0x7e65('0x18')](_0x7e65('0xe'),auth[_0x7e65('0xd')](),controller[_0x7e65('0x19')]);module['exports']=router;
\ No newline at end of file
index 2579e67..eb504fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x427eed,_0x69d704){var _0x3187bb=function(_0x2d2449){while(--_0x2d2449){_0x427eed['push'](_0x427eed['shift']());}};_0x3187bb(++_0x69d704);}(_0x5f2f,0x73));var _0xf5f2=function(_0x525ef9,_0x12b1c2){_0x525ef9=_0x525ef9-0x0;var _0x5561fb=_0x5f2f[_0x525ef9];return _0x5561fb;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0xadb5=['medium','TEXT','exports'];(function(_0x52c5f3,_0x24adc9){var _0x415968=function(_0x2f08ea){while(--_0x2f08ea){_0x52c5f3['push'](_0x52c5f3['shift']());}};_0x415968(++_0x24adc9);}(_0xadb5,0xad));var _0x5adb=function(_0x3f1d92,_0x3584d8){_0x3f1d92=_0x3f1d92-0x0;var _0x424d8f=_0xadb5[_0x3f1d92];return _0x424d8f;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
index a647239..ada18f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x5bc6ac,_0x5516c1){var _0x56aef3=function(_0x8fcb2a){while(--_0x8fcb2a){_0x5bc6ac['push'](_0x5bc6ac['shift']());}};_0x56aef3(++_0x5516c1);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x5f57b0,_0xce8c48){var _0x2e774f=function(_0x5a41d7){while(--_0x5a41d7){_0x5f57b0['push'](_0x5f57b0['shift']());}};_0x2e774f(++_0xce8c48);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
index a28e7ef..b6ead1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb799=['emit','hook','exports','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb799,0x163));var _0x9b79=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb799[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x9b79('0x0'))['db'][_0x9b79('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x9b79('0x2')](0x0);var events={'afterCreate':_0x9b79('0x3'),'afterUpdate':_0x9b79('0x4'),'afterDestroy':'remove'};function emitEvent(_0x549d07){return function(_0x508557,_0x495997,_0x3f222d){ChatOfflineMessageEvents[_0x9b79('0x5')](_0x549d07+':'+_0x508557['id'],_0x508557);ChatOfflineMessageEvents[_0x9b79('0x5')](_0x549d07,_0x508557);_0x3f222d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x9b79('0x6')](e,emitEvent(event));}}module[_0x9b79('0x7')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x2c92=['emit','hasOwnProperty','hook','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2c92,0x93));var _0x22c9=function(_0x13cab0,_0x14d825){_0x13cab0=_0x13cab0-0x0;var _0x38804f=_0x2c92[_0x13cab0];return _0x38804f;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x22c9('0x0'))['db'][_0x22c9('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x22c9('0x2')](0x0);var events={'afterCreate':_0x22c9('0x3'),'afterUpdate':_0x22c9('0x4'),'afterDestroy':_0x22c9('0x5')};function emitEvent(_0x12782d){return function(_0x4bc85f,_0x7b7b2b,_0x1f3877){ChatOfflineMessageEvents[_0x22c9('0x6')](_0x12782d+':'+_0x4bc85f['id'],_0x4bc85f);ChatOfflineMessageEvents[_0x22c9('0x6')](_0x12782d,_0x4bc85f);_0x1f3877(null);};}for(var e in events){if(events[_0x22c9('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x22c9('0x8')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
index 163912b..4e74f29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce09=['chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage'];(function(_0x22ced5,_0xf8882f){var _0x11e29b=function(_0x40246b){while(--_0x40246b){_0x22ced5['push'](_0x22ced5['shift']());}};_0x11e29b(++_0xf8882f);}(_0xce09,0x1c5));var _0x9ce0=function(_0x23b1fd,_0x347756){_0x23b1fd=_0x23b1fd-0x0;var _0x2bac5d=_0xce09[_0x23b1fd];return _0x2bac5d;};'use strict';var attributes=require(_0x9ce0('0x0'));module['exports']=function(_0x21ba4d){return _0x21ba4d[_0x9ce0('0x1')](_0x9ce0('0x2'),attributes,{'tableName':_0x9ce0('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ce0('0x4'),'collate':_0x9ce0('0x5')});};
\ No newline at end of file
+var _0x805f=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x3a686f,_0x5292c4){var _0x21b6e3=function(_0x1ce27c){while(--_0x1ce27c){_0x3a686f['push'](_0x3a686f['shift']());}};_0x21b6e3(++_0x5292c4);}(_0x805f,0xda));var _0xf805=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x805f[_0x122ef9];return _0x42fba0;};'use strict';var attributes=require(_0xf805('0x0'));module['exports']=function(_0x12621a){return _0x12621a[_0xf805('0x1')](_0xf805('0x2'),attributes,{'tableName':_0xf805('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf805('0x4'),'collate':_0xf805('0x5')});};
\ No newline at end of file
index 1861317..6ca4d2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8f6=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','ChatOfflineMessage,\x20%s,\x20%s','catch','util','moment'];(function(_0xab3d10,_0x3cbea2){var _0x1b64c7=function(_0x144e62){while(--_0x144e62){_0xab3d10['push'](_0xab3d10['shift']());}};_0x1b64c7(++_0x3cbea2);}(_0xd8f6,0xf0));var _0x6d8f=function(_0x312456,_0x19cd57){_0x312456=_0x312456-0x0;var _0x1b708b=_0xd8f6[_0x312456];return _0x1b708b;};'use strict';var _=require('lodash');var util=require(_0x6d8f('0x0'));var moment=require(_0x6d8f('0x1'));var BPromise=require(_0x6d8f('0x2'));var rs=require(_0x6d8f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d8f('0x4'))['db'];var utils=require(_0x6d8f('0x5'));var logger=require(_0x6d8f('0x6'))('rpc');var config=require(_0x6d8f('0x7'));var jayson=require(_0x6d8f('0x8'));var client=jayson[_0x6d8f('0x9')][_0x6d8f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ec4ba,_0x3ab3be,_0x5c6ac7){return new BPromise(function(_0x17f33d,_0x166f73){return client[_0x6d8f('0xb')](_0x5ec4ba,_0x5c6ac7)[_0x6d8f('0xc')](function(_0x331e84){logger[_0x6d8f('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3ab3be,_0x6d8f('0xe'));logger['debug'](_0x6d8f('0xf'),_0x3ab3be,_0x6d8f('0xe'),JSON[_0x6d8f('0x10')](_0x331e84));if(_0x331e84['error']){if(_0x331e84['error'][_0x6d8f('0x11')]===0x1f4){logger[_0x6d8f('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3ab3be,_0x331e84[_0x6d8f('0x12')][_0x6d8f('0x13')]);return _0x166f73(_0x331e84[_0x6d8f('0x12')][_0x6d8f('0x13')]);}logger[_0x6d8f('0x12')](_0x6d8f('0x14'),_0x3ab3be,_0x331e84[_0x6d8f('0x12')][_0x6d8f('0x13')]);return _0x17f33d(_0x331e84['error'][_0x6d8f('0x13')]);}else{logger[_0x6d8f('0xd')](_0x6d8f('0x14'),_0x3ab3be,_0x6d8f('0xe'));_0x17f33d(_0x331e84['result']['message']);}})[_0x6d8f('0x15')](function(_0x526f0a){logger[_0x6d8f('0x12')](_0x6d8f('0x14'),_0x3ab3be,_0x526f0a);_0x166f73(_0x526f0a);});});}
\ No newline at end of file
+var _0x1403=['then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x8fee0f,_0x118ab0){var _0xa5e569=function(_0x3d5a70){while(--_0x3d5a70){_0x8fee0f['push'](_0x8fee0f['shift']());}};_0xa5e569(++_0x118ab0);}(_0x1403,0x153));var _0x3140=function(_0x2273fd,_0x1290c0){_0x2273fd=_0x2273fd-0x0;var _0x46527d=_0x1403[_0x2273fd];return _0x46527d;};'use strict';var _=require(_0x3140('0x0'));var util=require(_0x3140('0x1'));var moment=require(_0x3140('0x2'));var BPromise=require(_0x3140('0x3'));var rs=require(_0x3140('0x4'));var fs=require('fs');var Redis=require(_0x3140('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3140('0x6'));var logger=require(_0x3140('0x7'))(_0x3140('0x8'));var config=require('../../config/environment');var jayson=require(_0x3140('0x9'));var client=jayson[_0x3140('0xa')][_0x3140('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23188b,_0x3d6162,_0x4ea0d2){return new BPromise(function(_0x104eec,_0x59ea50){return client[_0x3140('0xc')](_0x23188b,_0x4ea0d2)[_0x3140('0xd')](function(_0x2d5211){logger[_0x3140('0xe')](_0x3140('0xf'),_0x3d6162,_0x3140('0x10'));logger[_0x3140('0x11')](_0x3140('0x12'),_0x3d6162,_0x3140('0x10'),JSON[_0x3140('0x13')](_0x2d5211));if(_0x2d5211[_0x3140('0x14')]){if(_0x2d5211[_0x3140('0x14')]['code']===0x1f4){logger[_0x3140('0x14')](_0x3140('0xf'),_0x3d6162,_0x2d5211['error'][_0x3140('0x15')]);return _0x59ea50(_0x2d5211[_0x3140('0x14')][_0x3140('0x15')]);}logger['error'](_0x3140('0xf'),_0x3d6162,_0x2d5211[_0x3140('0x14')]['message']);return _0x104eec(_0x2d5211['error']['message']);}else{logger[_0x3140('0xe')](_0x3140('0xf'),_0x3d6162,_0x3140('0x10'));_0x104eec(_0x2d5211['result'][_0x3140('0x15')]);}})['catch'](function(_0x407bab){logger[_0x3140('0x14')](_0x3140('0xf'),_0x3d6162,_0x407bab);_0x59ea50(_0x407bab);});});}
\ No newline at end of file
index 340d60c..485f3c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cb9=['get','/describe','isAuthenticated','/:id','show','post','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../config/environment'];(function(_0x30538b,_0x19e98e){var _0xf5171b=function(_0x2b6a5f){while(--_0x2b6a5f){_0x30538b['push'](_0x30538b['shift']());}};_0xf5171b(++_0x19e98e);}(_0x2cb9,0x86));var _0x92cb=function(_0x4234f5,_0x130d72){_0x4234f5=_0x4234f5-0x0;var _0x554390=_0x2cb9[_0x4234f5];return _0x554390;};'use strict';var multer=require(_0x92cb('0x0'));var util=require('util');var path=require(_0x92cb('0x1'));var timeout=require(_0x92cb('0x2'));var express=require('express');var router=express[_0x92cb('0x3')]();var fs_extra=require(_0x92cb('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x92cb('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0x92cb('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x92cb('0x6')](_0x92cb('0x7'),auth[_0x92cb('0x8')](),controller['describe']);router[_0x92cb('0x6')](_0x92cb('0x9'),auth['isAuthenticated'](),controller[_0x92cb('0xa')]);router[_0x92cb('0xb')]('/',auth[_0x92cb('0x8')](),controller['create']);router['put']('/:id',auth[_0x92cb('0x8')](),controller['update']);router[_0x92cb('0xc')](_0x92cb('0x9'),auth['isAuthenticated'](),controller[_0x92cb('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xff89=['../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/:id','show','post','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x40a098,_0x33f92a){var _0x4db5f0=function(_0x2f608e){while(--_0x2f608e){_0x40a098['push'](_0x40a098['shift']());}};_0x4db5f0(++_0x33f92a);}(_0xff89,0x109));var _0x9ff8=function(_0x37ebbf,_0x2e0d70){_0x37ebbf=_0x37ebbf-0x0;var _0x27b75e=_0xff89[_0x37ebbf];return _0x27b75e;};'use strict';var multer=require(_0x9ff8('0x0'));var util=require(_0x9ff8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9ff8('0x2'));var router=express[_0x9ff8('0x3')]();var fs_extra=require(_0x9ff8('0x4'));var auth=require(_0x9ff8('0x5'));var interaction=require(_0x9ff8('0x6'));var config=require(_0x9ff8('0x7'));var controller=require(_0x9ff8('0x8'));router[_0x9ff8('0x9')]('/',auth[_0x9ff8('0xa')](),controller['index']);router[_0x9ff8('0x9')]('/describe',auth[_0x9ff8('0xa')](),controller['describe']);router[_0x9ff8('0x9')](_0x9ff8('0xb'),auth[_0x9ff8('0xa')](),controller[_0x9ff8('0xc')]);router[_0x9ff8('0xd')]('/',auth[_0x9ff8('0xa')](),controller['create']);router['put'](_0x9ff8('0xb'),auth[_0x9ff8('0xa')](),controller[_0x9ff8('0xe')]);router[_0x9ff8('0xf')]('/:id',auth[_0x9ff8('0xa')](),controller['destroy']);module[_0x9ff8('0x10')]=router;
\ No newline at end of file
index b12cafd..8491ead 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa617=['STRING','ENUM','mouseOver','sequelize','exports'];(function(_0x1179e4,_0x53658c){var _0x172bc5=function(_0x8d4438){while(--_0x8d4438){_0x1179e4['push'](_0x1179e4['shift']());}};_0x172bc5(++_0x53658c);}(_0xa617,0x76));var _0x7a61=function(_0x5bea5c,_0x1a2340){_0x5bea5c=_0x5bea5c-0x0;var _0x34768f=_0xa617[_0x5bea5c];return _0x34768f;};'use strict';var Sequelize=require(_0x7a61('0x0'));module[_0x7a61('0x1')]={'name':{'type':Sequelize[_0x7a61('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7a61('0x3')](_0x7a61('0x4'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x7a61('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x8698=['INTEGER','sequelize','exports','ENUM','mouseOver','timeout'];(function(_0x31a321,_0x5cd2d4){var _0x53b946=function(_0x2f965e){while(--_0x2f965e){_0x31a321['push'](_0x31a321['shift']());}};_0x53b946(++_0x5cd2d4);}(_0x8698,0x97));var _0x8869=function(_0x20ef3f,_0x181d32){_0x20ef3f=_0x20ef3f-0x0;var _0x4fc506=_0x8698[_0x20ef3f];return _0x4fc506;};'use strict';var Sequelize=require(_0x8869('0x0'));module[_0x8869('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x8869('0x2')](_0x8869('0x3'),_0x8869('0x4')),'defaultValue':_0x8869('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x8869('0x5')]}};
\ No newline at end of file
index ead318b..c251408 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2171=['querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','json','apply','reject','save','then','destroy','stack','name','send','show','params','model','rawAttributes','query','keys','intersection','fields','attributes','includeAll','merge','options','ChatProactiveAction','find','catch','create','body','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x51cd85,_0x1ea665){var _0x1b793a=function(_0x8afc78){while(--_0x8afc78){_0x51cd85['push'](_0x51cd85['shift']());}};_0x1b793a(++_0x1ea665);}(_0x2171,0x143));var _0x1217=function(_0x2b3d5f,_0x54cdb3){_0x2b3d5f=_0x2b3d5f-0x0;var _0x7a0e57=_0x2171[_0x2b3d5f];return _0x7a0e57;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1217('0x0'));var zipdir=require(_0x1217('0x1'));var jsonpatch=require(_0x1217('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1217('0x3'));var Mustache=require('mustache');var util=require(_0x1217('0x4'));var path=require(_0x1217('0x5'));var sox=require(_0x1217('0x6'));var csv=require(_0x1217('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1217('0x8'));var _=require(_0x1217('0x9'));var squel=require(_0x1217('0xa'));var crypto=require('crypto');var jsforce=require(_0x1217('0xb'));var deskjs=require(_0x1217('0xc'));var toCsv=require(_0x1217('0x7'));var querystring=require(_0x1217('0xd'));var Papa=require(_0x1217('0xe'));var Redis=require(_0x1217('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1217('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1217('0x11'));var logger=require(_0x1217('0x12'))(_0x1217('0x13'));var utils=require(_0x1217('0x14'));var config=require(_0x1217('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1217('0x16'))['db'];function respondWithStatusCode(_0x358007,_0x1e34e9){_0x1e34e9=_0x1e34e9||0xcc;return function(_0x107d99){if(_0x107d99){return _0x358007[_0x1217('0x17')](_0x1e34e9);}return _0x358007['status'](_0x1e34e9)['end']();};}function respondWithResult(_0xb06ed5,_0x5d8f22){_0x5d8f22=_0x5d8f22||0xc8;return function(_0x4aa848){if(_0x4aa848){return _0xb06ed5[_0x1217('0x18')](_0x5d8f22)['json'](_0x4aa848);}};}function respondWithFilteredResult(_0x4ef9be,_0x2300f0){return function(_0x24a3f3){if(_0x24a3f3){var _0x417cfe=typeof _0x2300f0[_0x1217('0x19')]==='undefined'&&typeof _0x2300f0[_0x1217('0x1a')]===_0x1217('0x1b');var _0x41c34f=_0x24a3f3[_0x1217('0x1c')];var _0x512159=_0x417cfe?0x0:_0x2300f0[_0x1217('0x19')];var _0x24033f=_0x417cfe?_0x24a3f3[_0x1217('0x1c')]:_0x2300f0[_0x1217('0x19')]+_0x2300f0[_0x1217('0x1a')];var _0x20ccb9;if(_0x24033f>=_0x41c34f){_0x24033f=_0x41c34f;_0x20ccb9=0xc8;}else{_0x20ccb9=0xce;}_0x4ef9be[_0x1217('0x18')](_0x20ccb9);return _0x4ef9be[_0x1217('0x1d')]('Content-Range',_0x512159+'-'+_0x24033f+'/'+_0x41c34f)[_0x1217('0x1e')](_0x24a3f3);}return null;};}function patchUpdates(_0x49382b){return function(_0x3bb618){try{jsonpatch[_0x1217('0x1f')](_0x3bb618,_0x49382b,!![]);}catch(_0x5f018c){return BPromise[_0x1217('0x20')](_0x5f018c);}return _0x3bb618[_0x1217('0x21')]();};}function saveUpdates(_0x4ea5e6,_0xb4e4ea){return function(_0x2c625b){if(_0x2c625b){return _0x2c625b['update'](_0x4ea5e6)[_0x1217('0x22')](function(_0x11f512){return _0x11f512;});}return null;};}function removeEntity(_0x1516e8,_0x5b9b7a){return function(_0x4a9c32){if(_0x4a9c32){return _0x4a9c32[_0x1217('0x23')]()[_0x1217('0x22')](function(){_0x1516e8[_0x1217('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x463c66,_0x8bd9d9){return function(_0x1bde0b){if(!_0x1bde0b){_0x463c66[_0x1217('0x17')](0x194);}return _0x1bde0b;};}function handleError(_0x465209,_0x446dc3){_0x446dc3=_0x446dc3||0x1f4;return function(_0x518a0a){logger['error'](_0x518a0a[_0x1217('0x24')]);if(_0x518a0a[_0x1217('0x25')]){delete _0x518a0a['name'];}_0x465209[_0x1217('0x18')](_0x446dc3)[_0x1217('0x26')](_0x518a0a);};}exports[_0x1217('0x27')]=function(_0x21392c,_0x2f5387){var _0x5eb398={'raw':!![],'where':{'id':_0x21392c[_0x1217('0x28')]['id']}},_0xdb98d5={};_0xdb98d5[_0x1217('0x29')]=_['keys'](db['ChatProactiveAction'][_0x1217('0x2a')]);_0xdb98d5[_0x1217('0x2b')]=_[_0x1217('0x2c')](_0x21392c['query']);_0xdb98d5['filters']=_[_0x1217('0x2d')](_0xdb98d5[_0x1217('0x29')],_0xdb98d5[_0x1217('0x2b')]);_0x5eb398['attributes']=_['intersection'](_0xdb98d5[_0x1217('0x29')],qs[_0x1217('0x2e')](_0x21392c[_0x1217('0x2b')][_0x1217('0x2e')]));_0x5eb398[_0x1217('0x2f')]=_0x5eb398['attributes']['length']?_0x5eb398['attributes']:_0xdb98d5['model'];if(_0x21392c[_0x1217('0x2b')][_0x1217('0x30')]){_0x5eb398['include']=[{'all':!![]}];}_0x5eb398=_[_0x1217('0x31')]({},_0x5eb398,_0x21392c[_0x1217('0x32')]);return db[_0x1217('0x33')][_0x1217('0x34')](_0x5eb398)[_0x1217('0x22')](handleEntityNotFound(_0x2f5387,null))[_0x1217('0x22')](respondWithResult(_0x2f5387,null))[_0x1217('0x35')](handleError(_0x2f5387,null));};exports[_0x1217('0x36')]=function(_0x2d6653,_0x445bd2){return db[_0x1217('0x33')][_0x1217('0x36')](_0x2d6653[_0x1217('0x37')],{})[_0x1217('0x22')](respondWithResult(_0x445bd2,0xc9))[_0x1217('0x35')](handleError(_0x445bd2,null));};exports['update']=function(_0xc189a6,_0x3ac293){if(_0xc189a6[_0x1217('0x37')]['id']){delete _0xc189a6['body']['id'];}return db[_0x1217('0x33')]['find']({'where':{'id':_0xc189a6[_0x1217('0x28')]['id']}})['then'](handleEntityNotFound(_0x3ac293,null))[_0x1217('0x22')](saveUpdates(_0xc189a6[_0x1217('0x37')],null))[_0x1217('0x22')](respondWithResult(_0x3ac293,null))[_0x1217('0x35')](handleError(_0x3ac293,null));};exports['destroy']=function(_0xc699b3,_0x437f54){return db[_0x1217('0x33')]['find']({'where':{'id':_0xc699b3[_0x1217('0x28')]['id']}})['then'](handleEntityNotFound(_0x437f54,null))[_0x1217('0x22')](removeEntity(_0x437f54,null))[_0x1217('0x35')](handleError(_0x437f54,null));};
\ No newline at end of file
+var _0x6dfa=['catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','stack','name','send','show','params','model','keys','ChatProactiveAction','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x6dfa,0x7b));var _0xa6df=function(_0x1f8bb0,_0x3cfd5c){_0x1f8bb0=_0x1f8bb0-0x0;var _0x15e553=_0x6dfa[_0x1f8bb0];return _0x15e553;};'use strict';var emlformat=require(_0xa6df('0x0'));var rimraf=require(_0xa6df('0x1'));var zipdir=require(_0xa6df('0x2'));var jsonpatch=require(_0xa6df('0x3'));var rp=require(_0xa6df('0x4'));var moment=require('moment');var BPromise=require(_0xa6df('0x5'));var Mustache=require('mustache');var util=require(_0xa6df('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xa6df('0x7'));var ejs=require(_0xa6df('0x8'));var fs=require('fs');var fs_extra=require(_0xa6df('0x9'));var _=require(_0xa6df('0xa'));var squel=require(_0xa6df('0xb'));var crypto=require(_0xa6df('0xc'));var jsforce=require(_0xa6df('0xd'));var deskjs=require(_0xa6df('0xe'));var toCsv=require(_0xa6df('0x7'));var querystring=require(_0xa6df('0xf'));var Papa=require('papaparse');var Redis=require(_0xa6df('0x10'));var authService=require(_0xa6df('0x11'));var qs=require(_0xa6df('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa6df('0x13'));var logger=require('../../config/logger')(_0xa6df('0x14'));var utils=require(_0xa6df('0x15'));var config=require(_0xa6df('0x16'));var licenseUtil=require(_0xa6df('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x6bdaa,_0x500e77){_0x500e77=_0x500e77||0xcc;return function(_0x1540f1){if(_0x1540f1){return _0x6bdaa[_0xa6df('0x18')](_0x500e77);}return _0x6bdaa[_0xa6df('0x19')](_0x500e77)[_0xa6df('0x1a')]();};}function respondWithResult(_0x53325a,_0x1e536d){_0x1e536d=_0x1e536d||0xc8;return function(_0x5bbd9e){if(_0x5bbd9e){return _0x53325a[_0xa6df('0x19')](_0x1e536d)[_0xa6df('0x1b')](_0x5bbd9e);}};}function respondWithFilteredResult(_0x59c2a2,_0x300a72){return function(_0x414cae){if(_0x414cae){var _0x23f4c1=typeof _0x300a72[_0xa6df('0x1c')]===_0xa6df('0x1d')&&typeof _0x300a72['limit']===_0xa6df('0x1d');var _0x3f9a6b=_0x414cae[_0xa6df('0x1e')];var _0x172bb9=_0x23f4c1?0x0:_0x300a72['offset'];var _0x203375=_0x23f4c1?_0x414cae[_0xa6df('0x1e')]:_0x300a72[_0xa6df('0x1c')]+_0x300a72[_0xa6df('0x1f')];var _0x48de1c;if(_0x203375>=_0x3f9a6b){_0x203375=_0x3f9a6b;_0x48de1c=0xc8;}else{_0x48de1c=0xce;}_0x59c2a2['status'](_0x48de1c);return _0x59c2a2[_0xa6df('0x20')]('Content-Range',_0x172bb9+'-'+_0x203375+'/'+_0x3f9a6b)[_0xa6df('0x1b')](_0x414cae);}return null;};}function patchUpdates(_0xfefceb){return function(_0x297e0f){try{jsonpatch[_0xa6df('0x21')](_0x297e0f,_0xfefceb,!![]);}catch(_0x2f41e1){return BPromise['reject'](_0x2f41e1);}return _0x297e0f[_0xa6df('0x22')]();};}function saveUpdates(_0x37dcbd,_0x3c09de){return function(_0x10fb11){if(_0x10fb11){return _0x10fb11[_0xa6df('0x23')](_0x37dcbd)[_0xa6df('0x24')](function(_0x539be3){return _0x539be3;});}return null;};}function removeEntity(_0x4be3e0,_0xcaa3a1){return function(_0x111659){if(_0x111659){return _0x111659[_0xa6df('0x25')]()[_0xa6df('0x24')](function(){_0x4be3e0[_0xa6df('0x19')](0xcc)[_0xa6df('0x1a')]();});}};}function handleEntityNotFound(_0x557aa6,_0x51e836){return function(_0x1f138b){if(!_0x1f138b){_0x557aa6[_0xa6df('0x18')](0x194);}return _0x1f138b;};}function handleError(_0x2745f8,_0x50e7b8){_0x50e7b8=_0x50e7b8||0x1f4;return function(_0x54ff44){logger['error'](_0x54ff44[_0xa6df('0x26')]);if(_0x54ff44['name']){delete _0x54ff44[_0xa6df('0x27')];}_0x2745f8[_0xa6df('0x19')](_0x50e7b8)[_0xa6df('0x28')](_0x54ff44);};}exports[_0xa6df('0x29')]=function(_0x37b079,_0x25a36a){var _0x55161d={'raw':!![],'where':{'id':_0x37b079[_0xa6df('0x2a')]['id']}},_0x42fa1b={};_0x42fa1b[_0xa6df('0x2b')]=_[_0xa6df('0x2c')](db[_0xa6df('0x2d')]['rawAttributes']);_0x42fa1b[_0xa6df('0x2e')]=_[_0xa6df('0x2c')](_0x37b079['query']);_0x42fa1b[_0xa6df('0x2f')]=_[_0xa6df('0x30')](_0x42fa1b['model'],_0x42fa1b[_0xa6df('0x2e')]);_0x55161d[_0xa6df('0x31')]=_[_0xa6df('0x30')](_0x42fa1b[_0xa6df('0x2b')],qs[_0xa6df('0x32')](_0x37b079['query'][_0xa6df('0x32')]));_0x55161d[_0xa6df('0x31')]=_0x55161d[_0xa6df('0x31')][_0xa6df('0x33')]?_0x55161d['attributes']:_0x42fa1b[_0xa6df('0x2b')];if(_0x37b079['query'][_0xa6df('0x34')]){_0x55161d[_0xa6df('0x35')]=[{'all':!![]}];}_0x55161d=_[_0xa6df('0x36')]({},_0x55161d,_0x37b079[_0xa6df('0x37')]);return db[_0xa6df('0x2d')][_0xa6df('0x38')](_0x55161d)[_0xa6df('0x24')](handleEntityNotFound(_0x25a36a,null))[_0xa6df('0x24')](respondWithResult(_0x25a36a,null))[_0xa6df('0x39')](handleError(_0x25a36a,null));};exports[_0xa6df('0x3a')]=function(_0x55c1e3,_0x48c21f){return db['ChatProactiveAction'][_0xa6df('0x3a')](_0x55c1e3[_0xa6df('0x3b')],{})[_0xa6df('0x24')](respondWithResult(_0x48c21f,0xc9))[_0xa6df('0x39')](handleError(_0x48c21f,null));};exports[_0xa6df('0x23')]=function(_0x4e2d03,_0x463d54){if(_0x4e2d03[_0xa6df('0x3b')]['id']){delete _0x4e2d03[_0xa6df('0x3b')]['id'];}return db[_0xa6df('0x2d')][_0xa6df('0x38')]({'where':{'id':_0x4e2d03['params']['id']}})[_0xa6df('0x24')](handleEntityNotFound(_0x463d54,null))[_0xa6df('0x24')](saveUpdates(_0x4e2d03[_0xa6df('0x3b')],null))['then'](respondWithResult(_0x463d54,null))[_0xa6df('0x39')](handleError(_0x463d54,null));};exports['destroy']=function(_0x56c2bf,_0x56d9e6){return db[_0xa6df('0x2d')][_0xa6df('0x38')]({'where':{'id':_0x56c2bf['params']['id']}})['then'](handleEntityNotFound(_0x56d9e6,null))[_0xa6df('0x24')](removeEntity(_0x56d9e6,null))[_0xa6df('0x39')](handleError(_0x56d9e6,null));};
\ No newline at end of file
index 0ef4f64..8de56b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x770a=['chat_proactive_actions','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define'];(function(_0x486f4a,_0x515ec6){var _0x1ad150=function(_0xf5c85e){while(--_0xf5c85e){_0x486f4a['push'](_0x486f4a['shift']());}};_0x1ad150(++_0x515ec6);}(_0x770a,0x175));var _0xa770=function(_0x3a400b,_0x1b97c6){_0x3a400b=_0x3a400b-0x0;var _0x560b1a=_0x770a[_0x3a400b];return _0x560b1a;};'use strict';var _=require(_0xa770('0x0'));var util=require(_0xa770('0x1'));var logger=require(_0xa770('0x2'))('api');var moment=require(_0xa770('0x3'));var BPromise=require('bluebird');var rp=require(_0xa770('0x4'));var fs=require('fs');var path=require(_0xa770('0x5'));var rimraf=require(_0xa770('0x6'));var config=require(_0xa770('0x7'));var attributes=require(_0xa770('0x8'));module[_0xa770('0x9')]=function(_0x59004,_0x761354){return _0x59004[_0xa770('0xa')]('ChatProactiveAction',attributes,{'tableName':_0xa770('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf892=['bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','moment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf892,0x196));var _0x2f89=function(_0x28dd58,_0x4336e9){_0x28dd58=_0x28dd58-0x0;var _0x2b0f07=_0xf892[_0x28dd58];return _0x2b0f07;};'use strict';var _=require('lodash');var util=require(_0x2f89('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2f89('0x1'));var BPromise=require(_0x2f89('0x2'));var rp=require(_0x2f89('0x3'));var fs=require('fs');var path=require(_0x2f89('0x4'));var rimraf=require(_0x2f89('0x5'));var config=require(_0x2f89('0x6'));var attributes=require(_0x2f89('0x7'));module[_0x2f89('0x8')]=function(_0x149ad7,_0x20a368){return _0x149ad7[_0x2f89('0x9')](_0x2f89('0xa'),attributes,{'tableName':_0x2f89('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1abdda1..1ecb756 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2ea=['request\x20sent','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x5f1e8e,_0x2774f2){var _0x517bc4=function(_0x4c92eb){while(--_0x4c92eb){_0x5f1e8e['push'](_0x5f1e8e['shift']());}};_0x517bc4(++_0x2774f2);}(_0xe2ea,0x71));var _0xae2e=function(_0x29c964,_0x406ece){_0x29c964=_0x29c964-0x0;var _0x499778=_0xe2ea[_0x29c964];return _0x499778;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xae2e('0x0'));var BPromise=require(_0xae2e('0x1'));var rs=require(_0xae2e('0x2'));var fs=require('fs');var Redis=require(_0xae2e('0x3'));var db=require(_0xae2e('0x4'))['db'];var utils=require(_0xae2e('0x5'));var logger=require(_0xae2e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xae2e('0x7'));var client=jayson[_0xae2e('0x8')][_0xae2e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x512c4c,_0xf64b3c,_0xfebf59){return new BPromise(function(_0x1df7f9,_0x5e1f41){return client[_0xae2e('0xa')](_0x512c4c,_0xfebf59)[_0xae2e('0xb')](function(_0x48dd08){logger['info'](_0xae2e('0xc'),_0xf64b3c,'request\x20sent');logger['debug'](_0xae2e('0xd'),_0xf64b3c,'request\x20sent',JSON[_0xae2e('0xe')](_0x48dd08));if(_0x48dd08[_0xae2e('0xf')]){if(_0x48dd08[_0xae2e('0xf')][_0xae2e('0x10')]===0x1f4){logger[_0xae2e('0xf')](_0xae2e('0xc'),_0xf64b3c,_0x48dd08['error']['message']);return _0x5e1f41(_0x48dd08[_0xae2e('0xf')]['message']);}logger[_0xae2e('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0xf64b3c,_0x48dd08[_0xae2e('0xf')]['message']);return _0x1df7f9(_0x48dd08[_0xae2e('0xf')][_0xae2e('0x11')]);}else{logger[_0xae2e('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0xf64b3c,_0xae2e('0x13'));_0x1df7f9(_0x48dd08[_0xae2e('0x14')][_0xae2e('0x11')]);}})[_0xae2e('0x15')](function(_0x499704){logger[_0xae2e('0xf')](_0xae2e('0xc'),_0xf64b3c,_0x499704);_0x5e1f41(_0x499704);});});}
\ No newline at end of file
+var _0xd540=['ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x39cd32,_0x440510){var _0xadbc55=function(_0x1368f1){while(--_0x1368f1){_0x39cd32['push'](_0x39cd32['shift']());}};_0xadbc55(++_0x440510);}(_0xd540,0x68));var _0x0d54=function(_0x1ed2db,_0x4a0537){_0x1ed2db=_0x1ed2db-0x0;var _0x28fe68=_0xd540[_0x1ed2db];return _0x28fe68;};'use strict';var _=require(_0x0d54('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0d54('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d54('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d54('0x3'));var logger=require(_0x0d54('0x4'))(_0x0d54('0x5'));var config=require(_0x0d54('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0d54('0x7')][_0x0d54('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a0c06,_0x59f183,_0x465a72){return new BPromise(function(_0x1346fc,_0x3d888d){return client['request'](_0x1a0c06,_0x465a72)['then'](function(_0x36584b){logger[_0x0d54('0x9')]('ChatProactiveAction,\x20%s,\x20%s',_0x59f183,_0x0d54('0xa'));logger[_0x0d54('0xb')](_0x0d54('0xc'),_0x59f183,_0x0d54('0xa'),JSON[_0x0d54('0xd')](_0x36584b));if(_0x36584b[_0x0d54('0xe')]){if(_0x36584b[_0x0d54('0xe')][_0x0d54('0xf')]===0x1f4){logger[_0x0d54('0xe')](_0x0d54('0x10'),_0x59f183,_0x36584b[_0x0d54('0xe')][_0x0d54('0x11')]);return _0x3d888d(_0x36584b[_0x0d54('0xe')][_0x0d54('0x11')]);}logger[_0x0d54('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x59f183,_0x36584b[_0x0d54('0xe')][_0x0d54('0x11')]);return _0x1346fc(_0x36584b[_0x0d54('0xe')][_0x0d54('0x11')]);}else{logger[_0x0d54('0x9')](_0x0d54('0x10'),_0x59f183,_0x0d54('0xa'));_0x1346fc(_0x36584b[_0x0d54('0x12')][_0x0d54('0x11')]);}})[_0x0d54('0x13')](function(_0x260e1b){logger['error'](_0x0d54('0x10'),_0x59f183,_0x260e1b);_0x3d888d(_0x260e1b);});});}
\ No newline at end of file
index 6f9897f..0e67558 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeff8=['isAuthenticated','show','post','create','put','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xeff8,0x186));var _0x8eff=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xeff8[_0x424a9a];return _0xa7831c;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8eff('0x5'));var interaction=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var controller=require(_0x8eff('0x8'));router['get'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xb')]);router[_0x8eff('0xc')]('/',auth['isAuthenticated'](),controller[_0x8eff('0xd')]);router[_0x8eff('0xe')](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller['update']);router['delete'](_0x8eff('0x9'),auth[_0x8eff('0xa')](),controller[_0x8eff('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xc4aa=['show','post','update','destroy','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated'];(function(_0x3697e5,_0x311f94){var _0x476d4e=function(_0x5d9b67){while(--_0x5d9b67){_0x3697e5['push'](_0x3697e5['shift']());}};_0x476d4e(++_0x311f94);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xc4aa[_0x346737];return _0x1ade2e;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')](_0xac4a('0x9'),auth[_0xac4a('0xa')](),controller[_0xac4a('0xb')]);router[_0xac4a('0xc')]('/',auth[_0xac4a('0xa')](),controller['create']);router['put'](_0xac4a('0x9'),auth[_0xac4a('0xa')](),controller[_0xac4a('0xd')]);router['delete'](_0xac4a('0x9'),auth[_0xac4a('0xa')](),controller[_0xac4a('0xe')]);module['exports']=router;
\ No newline at end of file
index ea74c68..15c37a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6a0=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x3cc9d9,_0x69ed38){var _0x1a425d=function(_0x44d109){while(--_0x44d109){_0x3cc9d9['push'](_0x3cc9d9['shift']());}};_0x1a425d(++_0x69ed38);}(_0xc6a0,0x170));var _0x0c6a=function(_0xc1a550,_0x3ddc8a){_0xc1a550=_0xc1a550-0x0;var _0x896e2c=_0xc6a0[_0xc1a550];return _0x896e2c;};'use strict';var Sequelize=require(_0x0c6a('0x0'));module[_0x0c6a('0x1')]={'name':{'type':Sequelize[_0x0c6a('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0c6a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0c6a('0x4')](_0x0c6a('0x5'),_0x0c6a('0x6'),_0x0c6a('0x7'))}};
\ No newline at end of file
+var _0x246e=['exports','STRING','rrmemory','beepall','roundrobin','sequelize'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x246e,0x1df));var _0xe246=function(_0x48ecc8,_0x2c6d4b){_0x48ecc8=_0x48ecc8-0x0;var _0x36249c=_0x246e[_0x48ecc8];return _0x36249c;};'use strict';var Sequelize=require(_0xe246('0x0'));module[_0xe246('0x1')]={'name':{'type':Sequelize[_0xe246('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe246('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xe246('0x3'),_0xe246('0x4'),_0xe246('0x5'))}};
\ No newline at end of file
index 3881f5f..703f81e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4a0=['online','voicePause','Agents','addTeams','each','findOrCreate','emit','select','tq.TeamId','from','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','removeAgents','isArray','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','client','http','request','then','info','request\x20sent','error','ChatQueue,\x20%s,\x20%s','message','result','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','save','get','ChatQueues','UserProfileResource','destroy','stack','name','send','index','ChatQueue','rawAttributes','fieldName','key','model','map','keys','query','filters','attributes','intersection','fields','length','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','params','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','hasOwnProperty','nolimit','ChatQueueId','UserChatQueue','findAll','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','ids'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xf4a0,0xb9));var _0x0f4a=function(_0x5b6ff4,_0x40c57f){_0x5b6ff4=_0x5b6ff4-0x0;var _0x141c44=_0xf4a0[_0x5b6ff4];return _0x141c44;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f4a('0x0'));var zipdir=require(_0x0f4a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f4a('0x2'));var moment=require(_0x0f4a('0x3'));var BPromise=require(_0x0f4a('0x4'));var Mustache=require(_0x0f4a('0x5'));var util=require(_0x0f4a('0x6'));var path=require(_0x0f4a('0x7'));var sox=require(_0x0f4a('0x8'));var csv=require('to-csv');var ejs=require(_0x0f4a('0x9'));var fs=require('fs');var fs_extra=require(_0x0f4a('0xa'));var _=require(_0x0f4a('0xb'));var squel=require(_0x0f4a('0xc'));var crypto=require('crypto');var jsforce=require(_0x0f4a('0xd'));var deskjs=require(_0x0f4a('0xe'));var toCsv=require(_0x0f4a('0xf'));var querystring=require(_0x0f4a('0x10'));var Papa=require(_0x0f4a('0x11'));var Redis=require(_0x0f4a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0f4a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f4a('0x14'))(_0x0f4a('0x15'));var utils=require(_0x0f4a('0x16'));var config=require(_0x0f4a('0x17'));var licenseUtil=require(_0x0f4a('0x18'));var db=require('../../mysqldb')['db'];config[_0x0f4a('0x19')]=_[_0x0f4a('0x1a')](config[_0x0f4a('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0f4a('0x1b'))(new Redis(config[_0x0f4a('0x19')]));require('./chatQueue.socket')[_0x0f4a('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x0f4a('0x1d')][_0x0f4a('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x10cf4f,_0x2a7d3a,_0x573b89,_0x5dccca){return new BPromise(function(_0x2e886f,_0x2f8564){var _0x5999c1=_0x5dccca||client;return _0x5999c1[_0x0f4a('0x1f')](_0x10cf4f,_0x573b89)[_0x0f4a('0x20')](function(_0x321360){logger[_0x0f4a('0x21')]('ChatQueue,\x20%s,\x20%s',_0x2a7d3a,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2a7d3a,_0x0f4a('0x22'),JSON['stringify'](_0x321360));if(_0x321360[_0x0f4a('0x23')]){if(_0x321360[_0x0f4a('0x23')]['code']===0x1f4){logger['error'](_0x0f4a('0x24'),_0x2a7d3a,_0x321360['error'][_0x0f4a('0x25')]);return _0x2f8564(_0x321360['error']['message']);}logger[_0x0f4a('0x23')]('ChatQueue,\x20%s,\x20%s',_0x2a7d3a,_0x321360['error'][_0x0f4a('0x25')]);return _0x2e886f(_0x321360[_0x0f4a('0x23')]['message']);}else{logger[_0x0f4a('0x21')](_0x0f4a('0x24'),_0x2a7d3a,_0x0f4a('0x22'));_0x2e886f(_0x321360[_0x0f4a('0x26')][_0x0f4a('0x25')]);}})['catch'](function(_0x19d0e4){logger[_0x0f4a('0x23')](_0x0f4a('0x24'),_0x2a7d3a,_0x19d0e4);_0x2f8564(_0x19d0e4);});});}function respondWithStatusCode(_0x3e822c,_0xdb238f){_0xdb238f=_0xdb238f||0xcc;return function(_0x326325){if(_0x326325){return _0x3e822c[_0x0f4a('0x27')](_0xdb238f);}return _0x3e822c['status'](_0xdb238f)[_0x0f4a('0x28')]();};}function respondWithResult(_0xec1d9e,_0xf812e4){_0xf812e4=_0xf812e4||0xc8;return function(_0x50ede3){if(_0x50ede3){return _0xec1d9e['status'](_0xf812e4)[_0x0f4a('0x29')](_0x50ede3);}};}function respondWithFilteredResult(_0x226d45,_0x22a038){return function(_0x25f74d){if(_0x25f74d){var _0x553dd8=typeof _0x22a038[_0x0f4a('0x2a')]===_0x0f4a('0x2b')&&typeof _0x22a038[_0x0f4a('0x2c')]==='undefined';var _0x50b6ea=_0x25f74d[_0x0f4a('0x2d')];var _0x5955e4=_0x553dd8?0x0:_0x22a038['offset'];var _0x28b829=_0x553dd8?_0x25f74d[_0x0f4a('0x2d')]:_0x22a038[_0x0f4a('0x2a')]+_0x22a038['limit'];var _0x3f0d3c;if(_0x28b829>=_0x50b6ea){_0x28b829=_0x50b6ea;_0x3f0d3c=0xc8;}else{_0x3f0d3c=0xce;}_0x226d45[_0x0f4a('0x2e')](_0x3f0d3c);return _0x226d45[_0x0f4a('0x2f')]('Content-Range',_0x5955e4+'-'+_0x28b829+'/'+_0x50b6ea)[_0x0f4a('0x29')](_0x25f74d);}return null;};}function patchUpdates(_0x8c8837){return function(_0x2f36a3){try{jsonpatch[_0x0f4a('0x30')](_0x2f36a3,_0x8c8837,!![]);}catch(_0x577705){return BPromise['reject'](_0x577705);}return _0x2f36a3[_0x0f4a('0x31')]();};}function saveUpdates(_0xb4fb14,_0x2626b5){return function(_0x5646cf){if(_0x5646cf){return _0x5646cf['update'](_0xb4fb14)[_0x0f4a('0x20')](function(_0x4d580){return _0x4d580;});}return null;};}function removeEntity(_0x3896e2,_0x3666c5){return function(_0x50f486){if(_0x50f486){return _0x50f486['destroy']()[_0x0f4a('0x20')](function(){var _0x486e38=_0x50f486[_0x0f4a('0x32')]({'plain':!![]});var _0x5a3112=_0x0f4a('0x33');return db[_0x0f4a('0x34')][_0x0f4a('0x35')]({'where':{'type':_0x5a3112,'resourceId':_0x486e38['id']}})[_0x0f4a('0x20')](function(){return _0x50f486;});})[_0x0f4a('0x20')](function(){_0x3896e2[_0x0f4a('0x2e')](0xcc)[_0x0f4a('0x28')]();});}};}function handleEntityNotFound(_0x2f39f7,_0x4f7a0c){return function(_0xc9388e){if(!_0xc9388e){_0x2f39f7[_0x0f4a('0x27')](0x194);}return _0xc9388e;};}function handleError(_0x1eb1de,_0x3a0a0d){_0x3a0a0d=_0x3a0a0d||0x1f4;return function(_0xd60779){logger[_0x0f4a('0x23')](_0xd60779[_0x0f4a('0x36')]);if(_0xd60779['name']){delete _0xd60779[_0x0f4a('0x37')];}_0x1eb1de['status'](_0x3a0a0d)[_0x0f4a('0x38')](_0xd60779);};}exports[_0x0f4a('0x39')]=function(_0x4116ae,_0xa75e40){var _0x44829f={},_0x5605b0={},_0x63937b={'count':0x0,'rows':[]};var _0x55f580=_['map'](db[_0x0f4a('0x3a')][_0x0f4a('0x3b')],function(_0x1869e9){return{'name':_0x1869e9[_0x0f4a('0x3c')],'type':_0x1869e9['type'][_0x0f4a('0x3d')]};});_0x5605b0[_0x0f4a('0x3e')]=_[_0x0f4a('0x3f')](_0x55f580,_0x0f4a('0x37'));_0x5605b0['query']=_[_0x0f4a('0x40')](_0x4116ae[_0x0f4a('0x41')]);_0x5605b0[_0x0f4a('0x42')]=_['intersection'](_0x5605b0[_0x0f4a('0x3e')],_0x5605b0[_0x0f4a('0x41')]);_0x44829f[_0x0f4a('0x43')]=_[_0x0f4a('0x44')](_0x5605b0['model'],qs[_0x0f4a('0x45')](_0x4116ae[_0x0f4a('0x41')][_0x0f4a('0x45')]));_0x44829f[_0x0f4a('0x43')]=_0x44829f[_0x0f4a('0x43')][_0x0f4a('0x46')]?_0x44829f[_0x0f4a('0x43')]:_0x5605b0[_0x0f4a('0x3e')];if(!_0x4116ae['query']['hasOwnProperty']('nolimit')){_0x44829f[_0x0f4a('0x2c')]=qs[_0x0f4a('0x2c')](_0x4116ae[_0x0f4a('0x41')][_0x0f4a('0x2c')]);_0x44829f['offset']=qs[_0x0f4a('0x2a')](_0x4116ae[_0x0f4a('0x41')]['offset']);}_0x44829f[_0x0f4a('0x47')]=qs[_0x0f4a('0x48')](_0x4116ae[_0x0f4a('0x41')][_0x0f4a('0x48')]);_0x44829f[_0x0f4a('0x49')]=qs[_0x0f4a('0x42')](_[_0x0f4a('0x4a')](_0x4116ae[_0x0f4a('0x41')],_0x5605b0['filters']),_0x55f580);if(_0x4116ae[_0x0f4a('0x41')]['filter']){_0x44829f[_0x0f4a('0x49')]=_[_0x0f4a('0x4b')](_0x44829f[_0x0f4a('0x49')],{'$or':_[_0x0f4a('0x3f')](_0x55f580,function(_0x4a1384){if(_0x4a1384[_0x0f4a('0x4c')]!==_0x0f4a('0x4d')){var _0x1968aa={};_0x1968aa[_0x4a1384[_0x0f4a('0x37')]]={'$like':'%'+_0x4116ae[_0x0f4a('0x41')][_0x0f4a('0x4e')]+'%'};return _0x1968aa;}})});}_0x44829f=_[_0x0f4a('0x4b')]({},_0x44829f,_0x4116ae['options']);var _0x657358={'where':_0x44829f['where']};return db['ChatQueue']['count'](_0x657358)[_0x0f4a('0x20')](function(_0xfff0be){_0x63937b[_0x0f4a('0x2d')]=_0xfff0be;if(_0x4116ae['query'][_0x0f4a('0x4f')]){_0x44829f[_0x0f4a('0x50')]=[{'all':!![]}];}return db[_0x0f4a('0x3a')]['findAll'](_0x44829f);})[_0x0f4a('0x20')](function(_0x4f4bd3){_0x63937b[_0x0f4a('0x51')]=_0x4f4bd3;return _0x63937b;})[_0x0f4a('0x20')](respondWithFilteredResult(_0xa75e40,_0x44829f))[_0x0f4a('0x52')](handleError(_0xa75e40,null));};exports['show']=function(_0x4852fd,_0x380648){var _0x23592b={'raw':!![],'where':{'id':_0x4852fd[_0x0f4a('0x53')]['id']}},_0x1ddc18={};_0x1ddc18[_0x0f4a('0x3e')]=_['keys'](db[_0x0f4a('0x3a')][_0x0f4a('0x3b')]);_0x1ddc18['query']=_['keys'](_0x4852fd[_0x0f4a('0x41')]);_0x1ddc18[_0x0f4a('0x42')]=_[_0x0f4a('0x44')](_0x1ddc18[_0x0f4a('0x3e')],_0x1ddc18['query']);_0x23592b[_0x0f4a('0x43')]=_[_0x0f4a('0x44')](_0x1ddc18[_0x0f4a('0x3e')],qs[_0x0f4a('0x45')](_0x4852fd[_0x0f4a('0x41')]['fields']));_0x23592b[_0x0f4a('0x43')]=_0x23592b[_0x0f4a('0x43')][_0x0f4a('0x46')]?_0x23592b['attributes']:_0x1ddc18[_0x0f4a('0x3e')];if(_0x4852fd[_0x0f4a('0x41')][_0x0f4a('0x4f')]){_0x23592b[_0x0f4a('0x50')]=[{'all':!![]}];}_0x23592b=_['merge']({},_0x23592b,_0x4852fd[_0x0f4a('0x54')]);return db[_0x0f4a('0x3a')][_0x0f4a('0x55')](_0x23592b)[_0x0f4a('0x20')](handleEntityNotFound(_0x380648,null))['then'](respondWithResult(_0x380648,null))['catch'](handleError(_0x380648,null));};exports['create']=function(_0x11034e,_0x498c59){return db[_0x0f4a('0x3a')]['create'](_0x11034e[_0x0f4a('0x56')],{})[_0x0f4a('0x20')](function(_0x136f84){var _0x470064=_0x11034e[_0x0f4a('0x57')]['get']({'plain':!![]});if(!_0x470064)throw new Error(_0x0f4a('0x58'));if(_0x470064[_0x0f4a('0x59')]==='user'){var _0x31ff87=_0x136f84[_0x0f4a('0x32')]({'plain':!![]});var _0x3ea46e=_0x0f4a('0x33');return db[_0x0f4a('0x5a')][_0x0f4a('0x55')]({'where':{'name':_0x3ea46e,'userProfileId':_0x470064[_0x0f4a('0x5b')]},'raw':!![]})['then'](function(_0x2d9347){if(_0x2d9347&&_0x2d9347[_0x0f4a('0x5c')]===0x0){return db[_0x0f4a('0x34')][_0x0f4a('0x5d')]({'name':_0x31ff87[_0x0f4a('0x37')],'resourceId':_0x31ff87['id'],'type':_0x2d9347[_0x0f4a('0x37')],'sectionId':_0x2d9347['id']},{})[_0x0f4a('0x20')](function(){return _0x136f84;});}else{return _0x136f84;}})[_0x0f4a('0x52')](function(_0x5ca079){logger[_0x0f4a('0x23')](_0x0f4a('0x5e'),_0x5ca079);throw _0x5ca079;});}return _0x136f84;})[_0x0f4a('0x20')](respondWithResult(_0x498c59,0xc9))[_0x0f4a('0x52')](handleError(_0x498c59,null));};exports[_0x0f4a('0x5f')]=function(_0x52e33e,_0x4f89de){if(_0x52e33e[_0x0f4a('0x56')]['id']){delete _0x52e33e[_0x0f4a('0x56')]['id'];}return db['ChatQueue'][_0x0f4a('0x55')]({'where':{'id':_0x52e33e[_0x0f4a('0x53')]['id']}})['then'](handleEntityNotFound(_0x4f89de,null))[_0x0f4a('0x20')](saveUpdates(_0x52e33e[_0x0f4a('0x56')],null))[_0x0f4a('0x20')](respondWithResult(_0x4f89de,null))['catch'](handleError(_0x4f89de,null));};exports[_0x0f4a('0x35')]=function(_0x4e84ae,_0x126104){return db[_0x0f4a('0x3a')][_0x0f4a('0x55')]({'where':{'id':_0x4e84ae[_0x0f4a('0x53')]['id']}})['then'](handleEntityNotFound(_0x126104,null))[_0x0f4a('0x20')](removeEntity(_0x126104,null))[_0x0f4a('0x52')](handleError(_0x126104,null));};exports[_0x0f4a('0x60')]=function(_0x47665,_0x2e2df4){return db[_0x0f4a('0x3a')][_0x0f4a('0x60')]()[_0x0f4a('0x20')](respondWithResult(_0x2e2df4,null))[_0x0f4a('0x52')](handleError(_0x2e2df4,null));};exports[_0x0f4a('0x61')]=function(_0x24c41a,_0x4d44a2,_0x2e697){var _0x541c1e={'raw':!![],'where':{}},_0x29f874={},_0x5b6c3c;return db['ChatQueue']['findOne']({'where':{'id':_0x24c41a['params']['id']}})[_0x0f4a('0x20')](handleEntityNotFound(_0x4d44a2,null))[_0x0f4a('0x20')](function(_0x4db15b){if(_0x4db15b){_0x5b6c3c=_0x4db15b[_0x0f4a('0x32')]({'plain':!![]});_0x29f874[_0x0f4a('0x3e')]=_['keys'](db['UserChatQueue'][_0x0f4a('0x3b')]);_0x29f874[_0x0f4a('0x41')]=_['keys'](_0x24c41a['query']);_0x29f874[_0x0f4a('0x42')]=_[_0x0f4a('0x44')](_0x29f874[_0x0f4a('0x3e')],_0x29f874[_0x0f4a('0x41')]);_0x541c1e[_0x0f4a('0x43')]=_[_0x0f4a('0x44')](_0x29f874[_0x0f4a('0x3e')],qs[_0x0f4a('0x45')](_0x24c41a[_0x0f4a('0x41')][_0x0f4a('0x45')]));_0x541c1e[_0x0f4a('0x43')]=_0x541c1e[_0x0f4a('0x43')][_0x0f4a('0x46')]?_0x541c1e[_0x0f4a('0x43')]:_0x29f874[_0x0f4a('0x3e')];if(!_0x24c41a['query'][_0x0f4a('0x62')](_0x0f4a('0x63'))){_0x541c1e[_0x0f4a('0x2c')]=qs['limit'](_0x24c41a[_0x0f4a('0x41')][_0x0f4a('0x2c')]);_0x541c1e[_0x0f4a('0x2a')]=qs[_0x0f4a('0x2a')](_0x24c41a[_0x0f4a('0x41')][_0x0f4a('0x2a')]);}_0x541c1e[_0x0f4a('0x47')]=qs[_0x0f4a('0x48')](_0x24c41a['query'][_0x0f4a('0x48')]);_0x541c1e[_0x0f4a('0x49')]=qs[_0x0f4a('0x42')](_['pick'](_0x24c41a[_0x0f4a('0x41')],_0x29f874[_0x0f4a('0x42')]));_0x541c1e[_0x0f4a('0x49')][_0x0f4a('0x64')]=_0x4db15b['id'];if(_0x24c41a[_0x0f4a('0x41')][_0x0f4a('0x4e')]){_0x541c1e[_0x0f4a('0x49')]=_[_0x0f4a('0x4b')](_0x541c1e[_0x0f4a('0x49')],{'$or':_[_0x0f4a('0x3f')](_0x541c1e[_0x0f4a('0x43')],function(_0x861fed){var _0x46ab8f={};_0x46ab8f[_0x861fed]={'$like':'%'+_0x24c41a[_0x0f4a('0x41')][_0x0f4a('0x4e')]+'%'};return _0x46ab8f;})});}_0x541c1e=_[_0x0f4a('0x4b')]({},_0x541c1e,_0x24c41a['options']);return db[_0x0f4a('0x65')][_0x0f4a('0x66')](_0x541c1e);}})[_0x0f4a('0x20')](function(_0x4ef725){if(_0x4ef725){return db[_0x0f4a('0x67')][_0x0f4a('0x68')]({'where':{'id':_[_0x0f4a('0x3f')](_0x4ef725,_0x0f4a('0x69')),'role':_0x0f4a('0x6a')},'attributes':['id','name','chatPause',_0x0f4a('0x6b'),_0x0f4a('0x6c')]});}})['then'](function(_0x14133e){if(_0x14133e){return{'count':_0x14133e[_0x0f4a('0x2d')],'rows':_[_0x0f4a('0x3f')](_0x14133e[_0x0f4a('0x51')],function(_0x5968da){return{'membername':_0x5968da[_0x0f4a('0x37')],'UserId':_0x5968da['id'],'queue_name':_0x5b6c3c[_0x0f4a('0x37')],'ChatQueueId':_0x5b6c3c['id'],'interface':util[_0x0f4a('0x6d')](_0x0f4a('0x6e'),'SIP',_0x5968da['name']),'penalty':0x0,'paused':_0x5968da['chatPause'],'createdAt':_0x5968da[_0x0f4a('0x6c')],'updatedAt':_0x5968da[_0x0f4a('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0f4a('0x20')](respondWithFilteredResult(_0x4d44a2,_0x541c1e))[_0x0f4a('0x52')](handleError(_0x4d44a2,null));};exports[_0x0f4a('0x6f')]=function(_0x4a10d8,_0x123a26,_0x5db69d){var _0x2d716f={};var _0x5ef382={};var _0x298e09;var _0x115fa8;return db[_0x0f4a('0x3a')][_0x0f4a('0x70')]({'where':{'id':_0x4a10d8['params']['id']}})[_0x0f4a('0x20')](handleEntityNotFound(_0x123a26,null))[_0x0f4a('0x20')](function(_0x1e3bf5){if(_0x1e3bf5){_0x298e09=_0x1e3bf5;_0x5ef382[_0x0f4a('0x3e')]=_[_0x0f4a('0x40')](db[_0x0f4a('0x71')][_0x0f4a('0x3b')]);_0x5ef382[_0x0f4a('0x41')]=_['keys'](_0x4a10d8['query']);_0x5ef382['filters']=_[_0x0f4a('0x44')](_0x5ef382[_0x0f4a('0x3e')],_0x5ef382[_0x0f4a('0x41')]);_0x2d716f['attributes']=_[_0x0f4a('0x44')](_0x5ef382[_0x0f4a('0x3e')],qs[_0x0f4a('0x45')](_0x4a10d8[_0x0f4a('0x41')][_0x0f4a('0x45')]));_0x2d716f['attributes']=_0x2d716f['attributes'][_0x0f4a('0x46')]?_0x2d716f[_0x0f4a('0x43')]:_0x5ef382[_0x0f4a('0x3e')];_0x2d716f[_0x0f4a('0x47')]=qs[_0x0f4a('0x48')](_0x4a10d8['query'][_0x0f4a('0x48')]);_0x2d716f[_0x0f4a('0x49')]=qs['filters'](_[_0x0f4a('0x4a')](_0x4a10d8[_0x0f4a('0x41')],_0x5ef382[_0x0f4a('0x42')]));if(_0x4a10d8[_0x0f4a('0x41')][_0x0f4a('0x4e')]){_0x2d716f['where']=_[_0x0f4a('0x4b')](_0x2d716f[_0x0f4a('0x49')],{'$or':_[_0x0f4a('0x3f')](_0x2d716f[_0x0f4a('0x43')],function(_0x2f95a6){var _0x53947e={};_0x53947e[_0x2f95a6]={'$like':'%'+_0x4a10d8[_0x0f4a('0x41')][_0x0f4a('0x4e')]+'%'};return _0x53947e;})});}_0x2d716f=_['merge']({},_0x2d716f,_0x4a10d8[_0x0f4a('0x54')]);return _0x298e09[_0x0f4a('0x6f')](_0x2d716f);}})[_0x0f4a('0x20')](function(_0x35526f){if(_0x35526f){_0x115fa8=_0x35526f['length'];if(!_0x4a10d8['query'][_0x0f4a('0x62')](_0x0f4a('0x63'))){_0x2d716f[_0x0f4a('0x2c')]=qs[_0x0f4a('0x2c')](_0x4a10d8[_0x0f4a('0x41')]['limit']);_0x2d716f[_0x0f4a('0x2a')]=qs['offset'](_0x4a10d8[_0x0f4a('0x41')][_0x0f4a('0x2a')]);}return _0x298e09[_0x0f4a('0x6f')](_0x2d716f);}})['then'](function(_0x5a8e99){if(_0x5a8e99){return _0x5a8e99?{'count':_0x115fa8,'rows':_0x5a8e99}:null;}})[_0x0f4a('0x20')](respondWithResult(_0x123a26,null))['catch'](handleError(_0x123a26,null));};exports['addTeams']=function(_0x491970,_0x38a11d,_0x50e8d0){var _0x282065=_0x491970['body'][_0x0f4a('0x72')];return db['Team']['findAll']({'where':{'id':_0x282065},'attributes':['id'],'include':[{'model':db[_0x0f4a('0x67')],'as':'Agents','attributes':['id','name',_0x0f4a('0x73'),_0x0f4a('0x74'),'interface'],'raw':!![]}]})[_0x0f4a('0x20')](function(_0x4d9797){if(_0x4d9797){var _0x23a610=_['flatMap'](_0x4d9797,function(_0x12a234){var _0x5d6ac2=_0x12a234['get']({'plain':!![]});return _0x5d6ac2[_0x0f4a('0x75')];});return db[_0x0f4a('0x3a')][_0x0f4a('0x55')]({'where':{'id':_0x491970[_0x0f4a('0x53')]['id']}})['then'](function(_0x3b5622){return db['sequelize']['transaction'](function(_0x35dc55){return _0x3b5622[_0x0f4a('0x76')](_0x282065,{'transaction':_0x35dc55})[_0x0f4a('0x20')](function(){return BPromise[_0x0f4a('0x77')](_0x23a610,function(_0x232ad5){return db[_0x0f4a('0x65')][_0x0f4a('0x78')]({'where':{'UserId':_0x232ad5['id'],'ChatQueueId':_0x491970[_0x0f4a('0x53')]['id']},'transaction':_0x35dc55});});})[_0x0f4a('0x20')](function(){_0x23a610['forEach'](function(_0x222af1){socket[_0x0f4a('0x79')]('userChatQueue:save',{'UserId':_0x222af1['id'],'ChatQueueId':_0x3b5622['id']});});});});});}})[_0x0f4a('0x20')](respondWithStatusCode(_0x38a11d,null))['catch'](handleError(_0x38a11d,null));};exports['removeTeams']=function(_0x2c5647,_0xb8e340,_0x31064b){return db[_0x0f4a('0x71')][_0x0f4a('0x66')]({'where':{'id':_0x2c5647[_0x0f4a('0x41')][_0x0f4a('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0f4a('0x20')](handleEntityNotFound(_0xb8e340,null))[_0x0f4a('0x20')](function(_0x4826a2){var _0x548a79=_['map'](_0x4826a2,'id');var _0xe5a8ac=[];var _0x11a4b6=[];var _0x3af110=squel[_0x0f4a('0x7a')]();_0x3af110['field'](_0x0f4a('0x7b'))[_0x0f4a('0x7c')](_0x0f4a('0x7d'),'tq')['join'](_0x0f4a('0x7e'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0f4a('0x49')](_0x0f4a('0x7f'),_0x2c5647[_0x0f4a('0x53')]['id']);for(var _0x5b9699=0x0;_0x5b9699<_0x4826a2[_0x0f4a('0x46')];_0x5b9699+=0x1){let _0x1709aa=_0x4826a2[_0x5b9699];for(var _0x4c90ae=0x0;_0x4c90ae<_0x1709aa[_0x0f4a('0x75')]['length'];_0x4c90ae+=0x1){let _0x41a203=_0x1709aa[_0x0f4a('0x75')][_0x4c90ae];var _0x109f8d=_0x3af110[_0x0f4a('0x80')]();_0x109f8d[_0x0f4a('0x49')](_0x0f4a('0x81'),_0x41a203['id']);_0x11a4b6[_0x0f4a('0x82')](db['sequelize'][_0x0f4a('0x41')](_0x109f8d['toString'](),{'type':db[_0x0f4a('0x83')][_0x0f4a('0x84')]['SELECT']})[_0x0f4a('0x20')](function(_0x10fb1e){if(_0x10fb1e['length']===0x1){return _0x41a203['id'];}else{var _0x26e1ad=_[_0x0f4a('0x85')](_[_0x0f4a('0x3f')](_0x10fb1e,_0x0f4a('0x86')),function(_0x105b62){return _[_0x0f4a('0x87')](_0x548a79,_0x105b62);});if(_0x26e1ad){return _0x41a203['id'];}}}));}}return BPromise[_0x0f4a('0x88')](_0x11a4b6)['then'](function(_0x17d7fd){_0xe5a8ac=_(_0xe5a8ac)[_0x0f4a('0x89')](_0x17d7fd)[_0x0f4a('0x8a')]()[_0x0f4a('0x8b')]();return db[_0x0f4a('0x3a')]['find']({'where':{'id':_0x2c5647[_0x0f4a('0x53')]['id']}})[_0x0f4a('0x20')](function(_0x80e2e8){return db[_0x0f4a('0x83')][_0x0f4a('0x8c')](function(_0x341508){return _0x80e2e8['removeTeams'](_0x2c5647[_0x0f4a('0x41')][_0x0f4a('0x72')],{'transaction':_0x341508})[_0x0f4a('0x20')](function(){if(!_[_0x0f4a('0x8d')](_0xe5a8ac)){return _0x80e2e8['removeAgents'](_0xe5a8ac,{'transaction':_0x341508});}})['then'](function(){_0xe5a8ac['forEach'](function(_0x2a88a0){socket[_0x0f4a('0x79')](_0x0f4a('0x8e'),{'UserId':_0x2a88a0,'ChatQueueId':_0x80e2e8['id']});});});});});});})[_0x0f4a('0x20')](respondWithStatusCode(_0xb8e340,null))[_0x0f4a('0x52')](handleError(_0xb8e340,null));};exports[_0x0f4a('0x8f')]=function(_0x46824b,_0x1c9ad5,_0xed7b9f){return db['ChatQueue'][_0x0f4a('0x55')]({'where':{'id':_0x46824b[_0x0f4a('0x53')]['id']}})['then'](handleEntityNotFound(_0x1c9ad5,null))[_0x0f4a('0x20')](function(_0x2258b0){if(_0x2258b0){return _0x2258b0[_0x0f4a('0x8f')](_0x46824b[_0x0f4a('0x56')][_0x0f4a('0x72')],_[_0x0f4a('0x90')](_0x46824b[_0x0f4a('0x56')],[_0x0f4a('0x72'),'id'])||{})[_0x0f4a('0x91')](function(_0xb6df24){for(var _0x1022c7=0x0;_0x1022c7<_0x46824b[_0x0f4a('0x56')]['ids']['length'];_0x1022c7+=0x1){socket[_0x0f4a('0x79')](_0x0f4a('0x92'),{'UserId':Number(_0x46824b['body']['ids'][_0x1022c7]),'ChatQueueId':Number(_0x46824b['params']['id'])});}return _0xb6df24;});}})['then'](respondWithResult(_0x1c9ad5,null))[_0x0f4a('0x52')](handleError(_0x1c9ad5,null));};exports[_0x0f4a('0x93')]=function(_0x562c86,_0x4a3a09,_0x13d5fd){return db[_0x0f4a('0x3a')]['find']({'where':{'id':_0x562c86['params']['id']}})[_0x0f4a('0x20')](handleEntityNotFound(_0x4a3a09,null))[_0x0f4a('0x20')](function(_0x150a5b){if(_0x150a5b){return _0x150a5b[_0x0f4a('0x93')](_0x562c86[_0x0f4a('0x41')][_0x0f4a('0x72')])[_0x0f4a('0x20')](function(){if(_[_0x0f4a('0x94')](_0x562c86[_0x0f4a('0x41')][_0x0f4a('0x72')])){for(var _0x4d4eda=0x0;_0x4d4eda<_0x562c86[_0x0f4a('0x41')]['ids']['length'];_0x4d4eda+=0x1){socket[_0x0f4a('0x79')]('userChatQueue:remove',{'UserId':Number(_0x562c86['query']['ids'][_0x4d4eda]),'ChatQueueId':Number(_0x562c86[_0x0f4a('0x53')]['id'])});}}else{socket['emit']('userChatQueue:remove',{'UserId':Number(_0x562c86['query'][_0x0f4a('0x72')]),'ChatQueueId':Number(_0x562c86[_0x0f4a('0x53')]['id'])});}});}})[_0x0f4a('0x20')](respondWithStatusCode(_0x4a3a09,null))[_0x0f4a('0x52')](handleError(_0x4a3a09,null));};exports[_0x0f4a('0x95')]=function(_0x13ebeb,_0x4e12a3,_0x37c858){var _0x4e3b45={};var _0x106bd4={};var _0xa4c535;var _0x682ad3;return db['ChatQueue'][_0x0f4a('0x70')]({'where':{'id':_0x13ebeb[_0x0f4a('0x53')]['id']}})[_0x0f4a('0x20')](handleEntityNotFound(_0x4e12a3,null))['then'](function(_0x305c98){if(_0x305c98){_0xa4c535=_0x305c98;_0x106bd4[_0x0f4a('0x3e')]=_[_0x0f4a('0x40')](db[_0x0f4a('0x67')]['rawAttributes']);_0x106bd4['query']=_[_0x0f4a('0x40')](_0x13ebeb[_0x0f4a('0x41')]);_0x106bd4[_0x0f4a('0x42')]=_['intersection'](_0x106bd4[_0x0f4a('0x3e')],_0x106bd4['query']);_0x4e3b45[_0x0f4a('0x43')]=_['intersection'](_0x106bd4[_0x0f4a('0x3e')],qs[_0x0f4a('0x45')](_0x13ebeb[_0x0f4a('0x41')][_0x0f4a('0x45')]));_0x4e3b45[_0x0f4a('0x43')]=_0x4e3b45[_0x0f4a('0x43')][_0x0f4a('0x46')]?_0x4e3b45['attributes']:_0x106bd4['model'];_0x4e3b45[_0x0f4a('0x47')]=qs['sort'](_0x13ebeb['query'][_0x0f4a('0x48')]);_0x4e3b45[_0x0f4a('0x49')]=qs[_0x0f4a('0x42')](_['pick'](_0x13ebeb[_0x0f4a('0x41')],_0x106bd4[_0x0f4a('0x42')]));if(_0x13ebeb[_0x0f4a('0x41')]['filter']){_0x4e3b45[_0x0f4a('0x49')]=_['merge'](_0x4e3b45[_0x0f4a('0x49')],{'$or':_[_0x0f4a('0x3f')](_0x4e3b45[_0x0f4a('0x43')],function(_0x4c7dba){var _0x596618={};_0x596618[_0x4c7dba]={'$like':'%'+_0x13ebeb['query']['filter']+'%'};return _0x596618;})});}_0x4e3b45=_[_0x0f4a('0x4b')]({},_0x4e3b45,_0x13ebeb['options']);return _0xa4c535[_0x0f4a('0x95')](_0x4e3b45);}})[_0x0f4a('0x20')](function(_0x4417b8){if(_0x4417b8){_0x682ad3=_0x4417b8[_0x0f4a('0x46')];if(!_0x13ebeb[_0x0f4a('0x41')][_0x0f4a('0x62')]('nolimit')){_0x4e3b45[_0x0f4a('0x2c')]=qs[_0x0f4a('0x2c')](_0x13ebeb['query'][_0x0f4a('0x2c')]);_0x4e3b45[_0x0f4a('0x2a')]=qs[_0x0f4a('0x2a')](_0x13ebeb[_0x0f4a('0x41')]['offset']);}return _0xa4c535[_0x0f4a('0x95')](_0x4e3b45);}})[_0x0f4a('0x20')](function(_0x42db87){if(_0x42db87){return _0x42db87?{'count':_0x682ad3,'rows':_0x42db87}:null;}})['then'](respondWithResult(_0x4e12a3,null))['catch'](handleError(_0x4e12a3,null));};
\ No newline at end of file
+var _0x6994=['value','ids','isEmpty','forEach','emit','addAgents','omit','spread','removeAgents','isArray','userChatQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','destroy','then','get','ChatQueues','stack','name','send','index','map','ChatQueue','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','show','params','rawAttributes','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserChatQueue','ChatQueueId','findAndCountAll','agent','updatedAt','createdAt','%s/%s','chatPause','getTeams','findOne','Team','User','online','voicePause','interface','flatMap','Agents','transaction','addTeams','userChatQueue:save','removeTeams','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','TeamId','all','union','compact'];(function(_0x3776b4,_0x19a1e3){var _0x1636d9=function(_0x320ae3){while(--_0x320ae3){_0x3776b4['push'](_0x3776b4['shift']());}};_0x1636d9(++_0x19a1e3);}(_0x6994,0x1d1));var _0x4699=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x6994[_0x5a3cf0];return _0x5a64ee;};'use strict';var emlformat=require(_0x4699('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4699('0x1'));var jsonpatch=require(_0x4699('0x2'));var rp=require(_0x4699('0x3'));var moment=require(_0x4699('0x4'));var BPromise=require(_0x4699('0x5'));var Mustache=require(_0x4699('0x6'));var util=require(_0x4699('0x7'));var path=require(_0x4699('0x8'));var sox=require('sox');var csv=require(_0x4699('0x9'));var ejs=require(_0x4699('0xa'));var fs=require('fs');var fs_extra=require(_0x4699('0xb'));var _=require(_0x4699('0xc'));var squel=require(_0x4699('0xd'));var crypto=require('crypto');var jsforce=require(_0x4699('0xe'));var deskjs=require(_0x4699('0xf'));var toCsv=require(_0x4699('0x9'));var querystring=require('querystring');var Papa=require(_0x4699('0x10'));var Redis=require(_0x4699('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4699('0x12'));var as=require(_0x4699('0x13'));var hardwareService=require(_0x4699('0x14'));var logger=require(_0x4699('0x15'))('api');var utils=require(_0x4699('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4699('0x17'));var db=require('../../mysqldb')['db'];config[_0x4699('0x18')]=_[_0x4699('0x19')](config[_0x4699('0x18')],{'host':_0x4699('0x1a'),'port':0x18eb});var socket=require(_0x4699('0x1b'))(new Redis(config['redis']));require(_0x4699('0x1c'))[_0x4699('0x1d')](socket);var jayson=require(_0x4699('0x1e'));var client=jayson[_0x4699('0x1f')][_0x4699('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xbd46e3,_0x3282be,_0x26a0b1,_0x5842a7){return new BPromise(function(_0x3f68a0,_0x2a5a4c){var _0x5c78c8=_0x5842a7||client;return _0x5c78c8['request'](_0xbd46e3,_0x26a0b1)['then'](function(_0x2d6f4f){logger['info'](_0x4699('0x21'),_0x3282be,_0x4699('0x22'));logger[_0x4699('0x23')](_0x4699('0x24'),_0x3282be,_0x4699('0x22'),JSON[_0x4699('0x25')](_0x2d6f4f));if(_0x2d6f4f['error']){if(_0x2d6f4f[_0x4699('0x26')]['code']===0x1f4){logger[_0x4699('0x26')](_0x4699('0x21'),_0x3282be,_0x2d6f4f[_0x4699('0x26')][_0x4699('0x27')]);return _0x2a5a4c(_0x2d6f4f['error'][_0x4699('0x27')]);}logger[_0x4699('0x26')](_0x4699('0x21'),_0x3282be,_0x2d6f4f[_0x4699('0x26')][_0x4699('0x27')]);return _0x3f68a0(_0x2d6f4f[_0x4699('0x26')]['message']);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x3282be,_0x4699('0x22'));_0x3f68a0(_0x2d6f4f[_0x4699('0x28')][_0x4699('0x27')]);}})[_0x4699('0x29')](function(_0x1789b){logger[_0x4699('0x26')](_0x4699('0x21'),_0x3282be,_0x1789b);_0x2a5a4c(_0x1789b);});});}function respondWithStatusCode(_0xca6426,_0x2ca876){_0x2ca876=_0x2ca876||0xcc;return function(_0x66ad12){if(_0x66ad12){return _0xca6426[_0x4699('0x2a')](_0x2ca876);}return _0xca6426[_0x4699('0x2b')](_0x2ca876)[_0x4699('0x2c')]();};}function respondWithResult(_0x5d5946,_0x56b211){_0x56b211=_0x56b211||0xc8;return function(_0x3c8748){if(_0x3c8748){return _0x5d5946[_0x4699('0x2b')](_0x56b211)['json'](_0x3c8748);}};}function respondWithFilteredResult(_0x366624,_0x3e6e8c){return function(_0x42cc1f){if(_0x42cc1f){var _0x29cffc=typeof _0x3e6e8c[_0x4699('0x2d')]===_0x4699('0x2e')&&typeof _0x3e6e8c['limit']===_0x4699('0x2e');var _0x4b2bcd=_0x42cc1f[_0x4699('0x2f')];var _0x4c3e18=_0x29cffc?0x0:_0x3e6e8c[_0x4699('0x2d')];var _0x1d783d=_0x29cffc?_0x42cc1f[_0x4699('0x2f')]:_0x3e6e8c[_0x4699('0x2d')]+_0x3e6e8c[_0x4699('0x30')];var _0x169714;if(_0x1d783d>=_0x4b2bcd){_0x1d783d=_0x4b2bcd;_0x169714=0xc8;}else{_0x169714=0xce;}_0x366624[_0x4699('0x2b')](_0x169714);return _0x366624['set'](_0x4699('0x31'),_0x4c3e18+'-'+_0x1d783d+'/'+_0x4b2bcd)[_0x4699('0x32')](_0x42cc1f);}return null;};}function patchUpdates(_0x4dd7b1){return function(_0x4e18bd){try{jsonpatch[_0x4699('0x33')](_0x4e18bd,_0x4dd7b1,!![]);}catch(_0x5b0cba){return BPromise[_0x4699('0x34')](_0x5b0cba);}return _0x4e18bd[_0x4699('0x35')]();};}function saveUpdates(_0x1cd490,_0x3f7519){return function(_0x3eba28){if(_0x3eba28){return _0x3eba28[_0x4699('0x36')](_0x1cd490)['then'](function(_0x9d6f17){return _0x9d6f17;});}return null;};}function removeEntity(_0x396667,_0x1a1a92){return function(_0x59b4ff){if(_0x59b4ff){return _0x59b4ff[_0x4699('0x37')]()[_0x4699('0x38')](function(){var _0x281f78=_0x59b4ff[_0x4699('0x39')]({'plain':!![]});var _0x26d2cf=_0x4699('0x3a');return db['UserProfileResource'][_0x4699('0x37')]({'where':{'type':_0x26d2cf,'resourceId':_0x281f78['id']}})['then'](function(){return _0x59b4ff;});})['then'](function(){_0x396667[_0x4699('0x2b')](0xcc)[_0x4699('0x2c')]();});}};}function handleEntityNotFound(_0x4361f0,_0x44a445){return function(_0x42f346){if(!_0x42f346){_0x4361f0[_0x4699('0x2a')](0x194);}return _0x42f346;};}function handleError(_0x3c4bba,_0x28f63b){_0x28f63b=_0x28f63b||0x1f4;return function(_0x17dc2b){logger['error'](_0x17dc2b[_0x4699('0x3b')]);if(_0x17dc2b['name']){delete _0x17dc2b[_0x4699('0x3c')];}_0x3c4bba[_0x4699('0x2b')](_0x28f63b)[_0x4699('0x3d')](_0x17dc2b);};}exports[_0x4699('0x3e')]=function(_0x3b93b8,_0x357f9d){var _0x5ebbfa={},_0x4f2653={},_0x14aaf3={'count':0x0,'rows':[]};var _0x475a4c=_[_0x4699('0x3f')](db[_0x4699('0x40')]['rawAttributes'],function(_0x46c4b9){return{'name':_0x46c4b9[_0x4699('0x41')],'type':_0x46c4b9[_0x4699('0x42')][_0x4699('0x43')]};});_0x4f2653[_0x4699('0x44')]=_[_0x4699('0x3f')](_0x475a4c,_0x4699('0x3c'));_0x4f2653[_0x4699('0x45')]=_[_0x4699('0x46')](_0x3b93b8['query']);_0x4f2653[_0x4699('0x47')]=_[_0x4699('0x48')](_0x4f2653[_0x4699('0x44')],_0x4f2653[_0x4699('0x45')]);_0x5ebbfa[_0x4699('0x49')]=_[_0x4699('0x48')](_0x4f2653[_0x4699('0x44')],qs[_0x4699('0x4a')](_0x3b93b8['query']['fields']));_0x5ebbfa[_0x4699('0x49')]=_0x5ebbfa['attributes'][_0x4699('0x4b')]?_0x5ebbfa[_0x4699('0x49')]:_0x4f2653[_0x4699('0x44')];if(!_0x3b93b8[_0x4699('0x45')][_0x4699('0x4c')](_0x4699('0x4d'))){_0x5ebbfa['limit']=qs['limit'](_0x3b93b8['query']['limit']);_0x5ebbfa['offset']=qs[_0x4699('0x2d')](_0x3b93b8['query']['offset']);}_0x5ebbfa[_0x4699('0x4e')]=qs[_0x4699('0x4f')](_0x3b93b8['query'][_0x4699('0x4f')]);_0x5ebbfa[_0x4699('0x50')]=qs[_0x4699('0x47')](_[_0x4699('0x51')](_0x3b93b8[_0x4699('0x45')],_0x4f2653[_0x4699('0x47')]),_0x475a4c);if(_0x3b93b8[_0x4699('0x45')][_0x4699('0x52')]){_0x5ebbfa[_0x4699('0x50')]=_[_0x4699('0x53')](_0x5ebbfa[_0x4699('0x50')],{'$or':_[_0x4699('0x3f')](_0x475a4c,function(_0x288c27){if(_0x288c27[_0x4699('0x42')]!==_0x4699('0x54')){var _0x162875={};_0x162875[_0x288c27[_0x4699('0x3c')]]={'$like':'%'+_0x3b93b8['query'][_0x4699('0x52')]+'%'};return _0x162875;}})});}_0x5ebbfa=_[_0x4699('0x53')]({},_0x5ebbfa,_0x3b93b8[_0x4699('0x55')]);var _0x48f7af={'where':_0x5ebbfa[_0x4699('0x50')]};return db[_0x4699('0x40')][_0x4699('0x2f')](_0x48f7af)[_0x4699('0x38')](function(_0x4f2f85){_0x14aaf3['count']=_0x4f2f85;if(_0x3b93b8[_0x4699('0x45')]['includeAll']){_0x5ebbfa['include']=[{'all':!![]}];}return db[_0x4699('0x40')][_0x4699('0x56')](_0x5ebbfa);})['then'](function(_0x6154cc){_0x14aaf3['rows']=_0x6154cc;return _0x14aaf3;})[_0x4699('0x38')](respondWithFilteredResult(_0x357f9d,_0x5ebbfa))[_0x4699('0x29')](handleError(_0x357f9d,null));};exports[_0x4699('0x57')]=function(_0x3c0e60,_0x4869d6){var _0x29a9e6={'raw':!![],'where':{'id':_0x3c0e60[_0x4699('0x58')]['id']}},_0x22c73d={};_0x22c73d[_0x4699('0x44')]=_['keys'](db[_0x4699('0x40')][_0x4699('0x59')]);_0x22c73d[_0x4699('0x45')]=_[_0x4699('0x46')](_0x3c0e60[_0x4699('0x45')]);_0x22c73d[_0x4699('0x47')]=_[_0x4699('0x48')](_0x22c73d[_0x4699('0x44')],_0x22c73d[_0x4699('0x45')]);_0x29a9e6['attributes']=_['intersection'](_0x22c73d[_0x4699('0x44')],qs['fields'](_0x3c0e60['query'][_0x4699('0x4a')]));_0x29a9e6['attributes']=_0x29a9e6[_0x4699('0x49')][_0x4699('0x4b')]?_0x29a9e6[_0x4699('0x49')]:_0x22c73d[_0x4699('0x44')];if(_0x3c0e60[_0x4699('0x45')][_0x4699('0x5a')]){_0x29a9e6[_0x4699('0x5b')]=[{'all':!![]}];}_0x29a9e6=_[_0x4699('0x53')]({},_0x29a9e6,_0x3c0e60[_0x4699('0x55')]);return db[_0x4699('0x40')][_0x4699('0x5c')](_0x29a9e6)[_0x4699('0x38')](handleEntityNotFound(_0x4869d6,null))[_0x4699('0x38')](respondWithResult(_0x4869d6,null))[_0x4699('0x29')](handleError(_0x4869d6,null));};exports['create']=function(_0x1b5d07,_0x140296){return db[_0x4699('0x40')][_0x4699('0x5d')](_0x1b5d07[_0x4699('0x5e')],{})['then'](function(_0x1a6897){var _0x4d2d80=_0x1b5d07[_0x4699('0x5f')]['get']({'plain':!![]});if(!_0x4d2d80)throw new Error(_0x4699('0x60'));if(_0x4d2d80['role']===_0x4699('0x5f')){var _0xe5550f=_0x1a6897['get']({'plain':!![]});var _0x12699e=_0x4699('0x3a');return db[_0x4699('0x61')][_0x4699('0x5c')]({'where':{'name':_0x12699e,'userProfileId':_0x4d2d80['userProfileId']},'raw':!![]})[_0x4699('0x38')](function(_0x58f038){if(_0x58f038&&_0x58f038[_0x4699('0x62')]===0x0){return db[_0x4699('0x63')][_0x4699('0x5d')]({'name':_0xe5550f[_0x4699('0x3c')],'resourceId':_0xe5550f['id'],'type':_0x58f038[_0x4699('0x3c')],'sectionId':_0x58f038['id']},{})[_0x4699('0x38')](function(){return _0x1a6897;});}else{return _0x1a6897;}})[_0x4699('0x29')](function(_0x1c151b){logger[_0x4699('0x26')](_0x4699('0x64'),_0x1c151b);throw _0x1c151b;});}return _0x1a6897;})['then'](respondWithResult(_0x140296,0xc9))[_0x4699('0x29')](handleError(_0x140296,null));};exports[_0x4699('0x36')]=function(_0x4b72cd,_0x4dd31b){if(_0x4b72cd[_0x4699('0x5e')]['id']){delete _0x4b72cd['body']['id'];}return db[_0x4699('0x40')][_0x4699('0x5c')]({'where':{'id':_0x4b72cd['params']['id']}})[_0x4699('0x38')](handleEntityNotFound(_0x4dd31b,null))['then'](saveUpdates(_0x4b72cd[_0x4699('0x5e')],null))[_0x4699('0x38')](respondWithResult(_0x4dd31b,null))['catch'](handleError(_0x4dd31b,null));};exports[_0x4699('0x37')]=function(_0x92a35e,_0x1da266){return db[_0x4699('0x40')]['find']({'where':{'id':_0x92a35e[_0x4699('0x58')]['id']}})[_0x4699('0x38')](handleEntityNotFound(_0x1da266,null))[_0x4699('0x38')](removeEntity(_0x1da266,null))[_0x4699('0x29')](handleError(_0x1da266,null));};exports[_0x4699('0x65')]=function(_0x3c3ac0,_0x3c5dca){return db[_0x4699('0x40')][_0x4699('0x65')]()[_0x4699('0x38')](respondWithResult(_0x3c5dca,null))[_0x4699('0x29')](handleError(_0x3c5dca,null));};exports['getMembers']=function(_0x2f0fb9,_0x3002cb,_0x372eac){var _0x5d7698={'raw':!![],'where':{}},_0x23b907={},_0x43d714;return db[_0x4699('0x40')]['findOne']({'where':{'id':_0x2f0fb9['params']['id']}})['then'](handleEntityNotFound(_0x3002cb,null))[_0x4699('0x38')](function(_0x5cfdc5){if(_0x5cfdc5){_0x43d714=_0x5cfdc5[_0x4699('0x39')]({'plain':!![]});_0x23b907[_0x4699('0x44')]=_[_0x4699('0x46')](db[_0x4699('0x66')][_0x4699('0x59')]);_0x23b907[_0x4699('0x45')]=_[_0x4699('0x46')](_0x2f0fb9[_0x4699('0x45')]);_0x23b907[_0x4699('0x47')]=_[_0x4699('0x48')](_0x23b907[_0x4699('0x44')],_0x23b907[_0x4699('0x45')]);_0x5d7698[_0x4699('0x49')]=_[_0x4699('0x48')](_0x23b907[_0x4699('0x44')],qs['fields'](_0x2f0fb9[_0x4699('0x45')][_0x4699('0x4a')]));_0x5d7698[_0x4699('0x49')]=_0x5d7698[_0x4699('0x49')][_0x4699('0x4b')]?_0x5d7698[_0x4699('0x49')]:_0x23b907[_0x4699('0x44')];if(!_0x2f0fb9[_0x4699('0x45')][_0x4699('0x4c')](_0x4699('0x4d'))){_0x5d7698[_0x4699('0x30')]=qs[_0x4699('0x30')](_0x2f0fb9[_0x4699('0x45')][_0x4699('0x30')]);_0x5d7698[_0x4699('0x2d')]=qs[_0x4699('0x2d')](_0x2f0fb9[_0x4699('0x45')][_0x4699('0x2d')]);}_0x5d7698[_0x4699('0x4e')]=qs[_0x4699('0x4f')](_0x2f0fb9[_0x4699('0x45')][_0x4699('0x4f')]);_0x5d7698[_0x4699('0x50')]=qs[_0x4699('0x47')](_[_0x4699('0x51')](_0x2f0fb9[_0x4699('0x45')],_0x23b907[_0x4699('0x47')]));_0x5d7698[_0x4699('0x50')][_0x4699('0x67')]=_0x5cfdc5['id'];if(_0x2f0fb9[_0x4699('0x45')][_0x4699('0x52')]){_0x5d7698[_0x4699('0x50')]=_['merge'](_0x5d7698[_0x4699('0x50')],{'$or':_[_0x4699('0x3f')](_0x5d7698[_0x4699('0x49')],function(_0x4f68e9){var _0x59c523={};_0x59c523[_0x4f68e9]={'$like':'%'+_0x2f0fb9[_0x4699('0x45')][_0x4699('0x52')]+'%'};return _0x59c523;})});}_0x5d7698=_[_0x4699('0x53')]({},_0x5d7698,_0x2f0fb9[_0x4699('0x55')]);return db[_0x4699('0x66')]['findAll'](_0x5d7698);}})[_0x4699('0x38')](function(_0x5c6818){if(_0x5c6818){return db['User'][_0x4699('0x68')]({'where':{'id':_['map'](_0x5c6818,'UserId'),'role':_0x4699('0x69')},'attributes':['id',_0x4699('0x3c'),'chatPause',_0x4699('0x6a'),_0x4699('0x6b')]});}})[_0x4699('0x38')](function(_0x2cc2c1){if(_0x2cc2c1){return{'count':_0x2cc2c1[_0x4699('0x2f')],'rows':_[_0x4699('0x3f')](_0x2cc2c1['rows'],function(_0x268f39){return{'membername':_0x268f39['name'],'UserId':_0x268f39['id'],'queue_name':_0x43d714[_0x4699('0x3c')],'ChatQueueId':_0x43d714['id'],'interface':util['format'](_0x4699('0x6c'),'SIP',_0x268f39[_0x4699('0x3c')]),'penalty':0x0,'paused':_0x268f39[_0x4699('0x6d')],'createdAt':_0x268f39[_0x4699('0x6b')],'updatedAt':_0x268f39['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x4699('0x38')](respondWithFilteredResult(_0x3002cb,_0x5d7698))[_0x4699('0x29')](handleError(_0x3002cb,null));};exports[_0x4699('0x6e')]=function(_0x4165b5,_0x228451,_0x4fc8b8){var _0x1bb22a={};var _0x558b29={};var _0x352154;var _0x214fc4;return db[_0x4699('0x40')][_0x4699('0x6f')]({'where':{'id':_0x4165b5[_0x4699('0x58')]['id']}})[_0x4699('0x38')](handleEntityNotFound(_0x228451,null))['then'](function(_0x109f28){if(_0x109f28){_0x352154=_0x109f28;_0x558b29['model']=_[_0x4699('0x46')](db[_0x4699('0x70')][_0x4699('0x59')]);_0x558b29[_0x4699('0x45')]=_[_0x4699('0x46')](_0x4165b5[_0x4699('0x45')]);_0x558b29[_0x4699('0x47')]=_[_0x4699('0x48')](_0x558b29['model'],_0x558b29[_0x4699('0x45')]);_0x1bb22a['attributes']=_['intersection'](_0x558b29['model'],qs[_0x4699('0x4a')](_0x4165b5['query'][_0x4699('0x4a')]));_0x1bb22a[_0x4699('0x49')]=_0x1bb22a[_0x4699('0x49')][_0x4699('0x4b')]?_0x1bb22a['attributes']:_0x558b29['model'];_0x1bb22a['order']=qs[_0x4699('0x4f')](_0x4165b5['query'][_0x4699('0x4f')]);_0x1bb22a['where']=qs[_0x4699('0x47')](_[_0x4699('0x51')](_0x4165b5['query'],_0x558b29[_0x4699('0x47')]));if(_0x4165b5[_0x4699('0x45')][_0x4699('0x52')]){_0x1bb22a[_0x4699('0x50')]=_[_0x4699('0x53')](_0x1bb22a['where'],{'$or':_[_0x4699('0x3f')](_0x1bb22a[_0x4699('0x49')],function(_0x1b69dd){var _0x3f5406={};_0x3f5406[_0x1b69dd]={'$like':'%'+_0x4165b5[_0x4699('0x45')]['filter']+'%'};return _0x3f5406;})});}_0x1bb22a=_[_0x4699('0x53')]({},_0x1bb22a,_0x4165b5[_0x4699('0x55')]);return _0x352154[_0x4699('0x6e')](_0x1bb22a);}})['then'](function(_0x1b33a5){if(_0x1b33a5){_0x214fc4=_0x1b33a5['length'];if(!_0x4165b5[_0x4699('0x45')][_0x4699('0x4c')](_0x4699('0x4d'))){_0x1bb22a[_0x4699('0x30')]=qs[_0x4699('0x30')](_0x4165b5[_0x4699('0x45')]['limit']);_0x1bb22a['offset']=qs['offset'](_0x4165b5['query'][_0x4699('0x2d')]);}return _0x352154[_0x4699('0x6e')](_0x1bb22a);}})['then'](function(_0x2bf759){if(_0x2bf759){return _0x2bf759?{'count':_0x214fc4,'rows':_0x2bf759}:null;}})['then'](respondWithResult(_0x228451,null))[_0x4699('0x29')](handleError(_0x228451,null));};exports['addTeams']=function(_0x521d78,_0x11619f,_0x54affd){var _0x1e0c4a=_0x521d78[_0x4699('0x5e')]['ids'];return db[_0x4699('0x70')][_0x4699('0x56')]({'where':{'id':_0x1e0c4a},'attributes':['id'],'include':[{'model':db[_0x4699('0x71')],'as':'Agents','attributes':['id',_0x4699('0x3c'),_0x4699('0x72'),_0x4699('0x73'),_0x4699('0x74')],'raw':!![]}]})[_0x4699('0x38')](function(_0x185240){if(_0x185240){var _0xd7172c=_[_0x4699('0x75')](_0x185240,function(_0x35bc0a){var _0x54501a=_0x35bc0a[_0x4699('0x39')]({'plain':!![]});return _0x54501a[_0x4699('0x76')];});return db['ChatQueue'][_0x4699('0x5c')]({'where':{'id':_0x521d78['params']['id']}})[_0x4699('0x38')](function(_0x34b500){return db['sequelize'][_0x4699('0x77')](function(_0x532796){return _0x34b500[_0x4699('0x78')](_0x1e0c4a,{'transaction':_0x532796})[_0x4699('0x38')](function(){return BPromise['each'](_0xd7172c,function(_0x38ae09){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x38ae09['id'],'ChatQueueId':_0x521d78['params']['id']},'transaction':_0x532796});});})[_0x4699('0x38')](function(){_0xd7172c['forEach'](function(_0x2a5064){socket['emit'](_0x4699('0x79'),{'UserId':_0x2a5064['id'],'ChatQueueId':_0x34b500['id']});});});});});}})['then'](respondWithStatusCode(_0x11619f,null))[_0x4699('0x29')](handleError(_0x11619f,null));};exports[_0x4699('0x7a')]=function(_0x4a222e,_0x521a3f,_0x490cfa){return db[_0x4699('0x70')][_0x4699('0x56')]({'where':{'id':_0x4a222e[_0x4699('0x45')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4699('0x71')],'as':_0x4699('0x76'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x521a3f,null))[_0x4699('0x38')](function(_0x5bf4a7){var _0x45640a=_[_0x4699('0x3f')](_0x5bf4a7,'id');var _0x138bfa=[];var _0x4f1d4f=[];var _0x58c8be=squel['select']();_0x58c8be[_0x4699('0x7b')](_0x4699('0x7c'))[_0x4699('0x7d')](_0x4699('0x7e'),'tq')[_0x4699('0x7f')](_0x4699('0x80'),'ut',_0x4699('0x81'))[_0x4699('0x50')](_0x4699('0x82'),_0x4a222e[_0x4699('0x58')]['id']);for(var _0x2461ed=0x0;_0x2461ed<_0x5bf4a7[_0x4699('0x4b')];_0x2461ed+=0x1){let _0x45916c=_0x5bf4a7[_0x2461ed];for(var _0x3bb9a0=0x0;_0x3bb9a0<_0x45916c[_0x4699('0x76')][_0x4699('0x4b')];_0x3bb9a0+=0x1){let _0x560644=_0x45916c[_0x4699('0x76')][_0x3bb9a0];var _0x48df19=_0x58c8be['clone']();_0x48df19[_0x4699('0x50')](_0x4699('0x83'),_0x560644['id']);_0x4f1d4f[_0x4699('0x84')](db[_0x4699('0x85')][_0x4699('0x45')](_0x48df19['toString'](),{'type':db[_0x4699('0x85')][_0x4699('0x86')]['SELECT']})[_0x4699('0x38')](function(_0x3e1577){if(_0x3e1577[_0x4699('0x4b')]===0x1){return _0x560644['id'];}else{var _0x52711d=_['every'](_[_0x4699('0x3f')](_0x3e1577,_0x4699('0x87')),function(_0x1aa703){return _['includes'](_0x45640a,_0x1aa703);});if(_0x52711d){return _0x560644['id'];}}}));}}return BPromise[_0x4699('0x88')](_0x4f1d4f)[_0x4699('0x38')](function(_0x2c4a90){_0x138bfa=_(_0x138bfa)[_0x4699('0x89')](_0x2c4a90)[_0x4699('0x8a')]()[_0x4699('0x8b')]();return db[_0x4699('0x40')][_0x4699('0x5c')]({'where':{'id':_0x4a222e[_0x4699('0x58')]['id']}})['then'](function(_0x53ed75){return db[_0x4699('0x85')][_0x4699('0x77')](function(_0x4acf3f){return _0x53ed75[_0x4699('0x7a')](_0x4a222e['query'][_0x4699('0x8c')],{'transaction':_0x4acf3f})[_0x4699('0x38')](function(){if(!_[_0x4699('0x8d')](_0x138bfa)){return _0x53ed75['removeAgents'](_0x138bfa,{'transaction':_0x4acf3f});}})['then'](function(){_0x138bfa[_0x4699('0x8e')](function(_0x55540c){socket[_0x4699('0x8f')]('userChatQueue:remove',{'UserId':_0x55540c,'ChatQueueId':_0x53ed75['id']});});});});});});})[_0x4699('0x38')](respondWithStatusCode(_0x521a3f,null))[_0x4699('0x29')](handleError(_0x521a3f,null));};exports[_0x4699('0x90')]=function(_0x31f6d5,_0x31dffa,_0x3800eb){return db[_0x4699('0x40')]['find']({'where':{'id':_0x31f6d5[_0x4699('0x58')]['id']}})[_0x4699('0x38')](handleEntityNotFound(_0x31dffa,null))['then'](function(_0x1588fc){if(_0x1588fc){return _0x1588fc[_0x4699('0x90')](_0x31f6d5[_0x4699('0x5e')]['ids'],_[_0x4699('0x91')](_0x31f6d5[_0x4699('0x5e')],[_0x4699('0x8c'),'id'])||{})[_0x4699('0x92')](function(_0x118a28){for(var _0x355c63=0x0;_0x355c63<_0x31f6d5[_0x4699('0x5e')]['ids'][_0x4699('0x4b')];_0x355c63+=0x1){socket[_0x4699('0x8f')]('userChatQueue:save',{'UserId':Number(_0x31f6d5[_0x4699('0x5e')][_0x4699('0x8c')][_0x355c63]),'ChatQueueId':Number(_0x31f6d5[_0x4699('0x58')]['id'])});}return _0x118a28;});}})[_0x4699('0x38')](respondWithResult(_0x31dffa,null))[_0x4699('0x29')](handleError(_0x31dffa,null));};exports[_0x4699('0x93')]=function(_0x40fafc,_0xdbd490,_0x176258){return db[_0x4699('0x40')][_0x4699('0x5c')]({'where':{'id':_0x40fafc[_0x4699('0x58')]['id']}})[_0x4699('0x38')](handleEntityNotFound(_0xdbd490,null))[_0x4699('0x38')](function(_0x28f70c){if(_0x28f70c){return _0x28f70c['removeAgents'](_0x40fafc[_0x4699('0x45')][_0x4699('0x8c')])[_0x4699('0x38')](function(){if(_[_0x4699('0x94')](_0x40fafc['query']['ids'])){for(var _0x39c7f0=0x0;_0x39c7f0<_0x40fafc[_0x4699('0x45')][_0x4699('0x8c')][_0x4699('0x4b')];_0x39c7f0+=0x1){socket['emit'](_0x4699('0x95'),{'UserId':Number(_0x40fafc[_0x4699('0x45')]['ids'][_0x39c7f0]),'ChatQueueId':Number(_0x40fafc[_0x4699('0x58')]['id'])});}}else{socket['emit'](_0x4699('0x95'),{'UserId':Number(_0x40fafc['query'][_0x4699('0x8c')]),'ChatQueueId':Number(_0x40fafc[_0x4699('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0xdbd490,null))[_0x4699('0x29')](handleError(_0xdbd490,null));};exports[_0x4699('0x96')]=function(_0x2131db,_0x499479,_0x36c0f5){var _0x4129b3={};var _0x4f7592={};var _0x477799;var _0x3cd5fa;return db[_0x4699('0x40')][_0x4699('0x6f')]({'where':{'id':_0x2131db[_0x4699('0x58')]['id']}})[_0x4699('0x38')](handleEntityNotFound(_0x499479,null))[_0x4699('0x38')](function(_0x4b1e3f){if(_0x4b1e3f){_0x477799=_0x4b1e3f;_0x4f7592['model']=_[_0x4699('0x46')](db[_0x4699('0x71')]['rawAttributes']);_0x4f7592[_0x4699('0x45')]=_[_0x4699('0x46')](_0x2131db[_0x4699('0x45')]);_0x4f7592[_0x4699('0x47')]=_[_0x4699('0x48')](_0x4f7592['model'],_0x4f7592[_0x4699('0x45')]);_0x4129b3[_0x4699('0x49')]=_[_0x4699('0x48')](_0x4f7592[_0x4699('0x44')],qs[_0x4699('0x4a')](_0x2131db[_0x4699('0x45')][_0x4699('0x4a')]));_0x4129b3[_0x4699('0x49')]=_0x4129b3[_0x4699('0x49')]['length']?_0x4129b3[_0x4699('0x49')]:_0x4f7592[_0x4699('0x44')];_0x4129b3[_0x4699('0x4e')]=qs[_0x4699('0x4f')](_0x2131db['query'][_0x4699('0x4f')]);_0x4129b3[_0x4699('0x50')]=qs[_0x4699('0x47')](_[_0x4699('0x51')](_0x2131db['query'],_0x4f7592[_0x4699('0x47')]));if(_0x2131db[_0x4699('0x45')][_0x4699('0x52')]){_0x4129b3[_0x4699('0x50')]=_[_0x4699('0x53')](_0x4129b3[_0x4699('0x50')],{'$or':_[_0x4699('0x3f')](_0x4129b3['attributes'],function(_0x113d09){var _0x2100ff={};_0x2100ff[_0x113d09]={'$like':'%'+_0x2131db[_0x4699('0x45')][_0x4699('0x52')]+'%'};return _0x2100ff;})});}_0x4129b3=_[_0x4699('0x53')]({},_0x4129b3,_0x2131db[_0x4699('0x55')]);return _0x477799[_0x4699('0x96')](_0x4129b3);}})[_0x4699('0x38')](function(_0xadeeb4){if(_0xadeeb4){_0x3cd5fa=_0xadeeb4[_0x4699('0x4b')];if(!_0x2131db[_0x4699('0x45')][_0x4699('0x4c')]('nolimit')){_0x4129b3[_0x4699('0x30')]=qs['limit'](_0x2131db[_0x4699('0x45')][_0x4699('0x30')]);_0x4129b3['offset']=qs[_0x4699('0x2d')](_0x2131db['query'][_0x4699('0x2d')]);}return _0x477799['getAgents'](_0x4129b3);}})[_0x4699('0x38')](function(_0xc04a4d){if(_0xc04a4d){return _0xc04a4d?{'count':_0x3cd5fa,'rows':_0xc04a4d}:null;}})[_0x4699('0x38')](respondWithResult(_0x499479,null))[_0x4699('0x29')](handleError(_0x499479,null));};
\ No newline at end of file
index 9a3c05e..aa1a08c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb24=['ChatQueue','setMaxListeners','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x2b7338,_0x71669b){var _0x26660e=function(_0x575e78){while(--_0x575e78){_0x2b7338['push'](_0x2b7338['shift']());}};_0x26660e(++_0x71669b);}(_0xeb24,0x12e));var _0x4eb2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xeb24[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x4eb2('0x0'));var ChatQueue=require(_0x4eb2('0x1'))['db'][_0x4eb2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4eb2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4eb2('0x4')};function emitEvent(_0x56faf4){return function(_0x469c2e,_0x42059f,_0x5e8bc2){ChatQueueEvents[_0x4eb2('0x5')](_0x56faf4+':'+_0x469c2e['id'],_0x469c2e);ChatQueueEvents[_0x4eb2('0x5')](_0x56faf4,_0x469c2e);_0x5e8bc2(null);};}for(var e in events){if(events[_0x4eb2('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x4eb2('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0xe338=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','save','update','remove','emit'];(function(_0x209f56,_0x24449e){var _0x22767d=function(_0x17e2d0){while(--_0x17e2d0){_0x209f56['push'](_0x209f56['shift']());}};_0x22767d(++_0x24449e);}(_0xe338,0x99));var _0x8e33=function(_0x3a75f3,_0x1fa9e3){_0x3a75f3=_0x3a75f3-0x0;var _0x15be50=_0xe338[_0x3a75f3];return _0x15be50;};'use strict';var EventEmitter=require(_0x8e33('0x0'));var ChatQueue=require(_0x8e33('0x1'))['db'][_0x8e33('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8e33('0x3'),'afterUpdate':_0x8e33('0x4'),'afterDestroy':_0x8e33('0x5')};function emitEvent(_0x3f2254){return function(_0x331746,_0x430e45,_0x315e94){ChatQueueEvents[_0x8e33('0x6')](_0x3f2254+':'+_0x331746['id'],_0x331746);ChatQueueEvents[_0x8e33('0x6')](_0x3f2254,_0x331746);_0x315e94(null);};}for(var e in events){if(events[_0x8e33('0x7')](e)){var event=events[e];ChatQueue[_0x8e33('0x8')](e,emitEvent(event));}}module[_0x8e33('0x9')]=ChatQueueEvents;
\ No newline at end of file
index 5080c51..decaaa0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf31e=['define','ChatQueue','chat_queues','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf31e,0x1bb));var _0xef31=function(_0x6ce9fb,_0x5a2013){_0x6ce9fb=_0x6ce9fb-0x0;var _0x42794c=_0xf31e[_0x6ce9fb];return _0x42794c;};'use strict';var _=require(_0xef31('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xef31('0x1'));var moment=require(_0xef31('0x2'));var BPromise=require(_0xef31('0x3'));var rp=require(_0xef31('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xef31('0x5'));var config=require(_0xef31('0x6'));var attributes=require('./chatQueue.attributes');module[_0xef31('0x7')]=function(_0x317396,_0x6dfff){return _0x317396[_0xef31('0x8')](_0xef31('0x9'),attributes,{'tableName':_0xef31('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x45d6=['./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2b8981,_0x24c688){var _0x377d15=function(_0x398128){while(--_0x398128){_0x2b8981['push'](_0x2b8981['shift']());}};_0x377d15(++_0x24c688);}(_0x45d6,0xbb));var _0x645d=function(_0x5da90b,_0x3e13cd){_0x5da90b=_0x5da90b-0x0;var _0x530e40=_0x45d6[_0x5da90b];return _0x530e40;};'use strict';var _=require(_0x645d('0x0'));var util=require(_0x645d('0x1'));var logger=require(_0x645d('0x2'))(_0x645d('0x3'));var moment=require(_0x645d('0x4'));var BPromise=require('bluebird');var rp=require(_0x645d('0x5'));var fs=require('fs');var path=require(_0x645d('0x6'));var rimraf=require(_0x645d('0x7'));var config=require(_0x645d('0x8'));var attributes=require(_0x645d('0x9'));module[_0x645d('0xa')]=function(_0x3e0d23,_0x550a93){return _0x3e0d23[_0x645d('0xb')](_0x645d('0xc'),attributes,{'tableName':_0x645d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1f7841d..f040772 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe511=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','raw','options','where','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','ChatQueue','find','lodash','util','bluebird'];(function(_0x38eb23,_0x196e8b){var _0x48506a=function(_0x36edb0){while(--_0x36edb0){_0x38eb23['push'](_0x38eb23['shift']());}};_0x48506a(++_0x196e8b);}(_0xe511,0x16f));var _0x1e51=function(_0x4f0f9b,_0x4e963e){_0x4f0f9b=_0x4f0f9b-0x0;var _0x970f94=_0xe511[_0x4f0f9b];return _0x970f94;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var moment=require('moment');var BPromise=require(_0x1e51('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e51('0x3'));var db=require(_0x1e51('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e51('0x5'))(_0x1e51('0x6'));var config=require(_0x1e51('0x7'));var jayson=require(_0x1e51('0x8'));var client=jayson['client'][_0x1e51('0x9')]({'port':0x232a});config[_0x1e51('0xa')]=_['defaults'](config['redis'],{'host':_0x1e51('0xb'),'port':0x18eb});var socket=require(_0x1e51('0xc'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x1e51('0xd')](socket);function respondWithRpcPromise(_0x2712e0,_0x29da1f,_0x706e60){return new BPromise(function(_0x4241a6,_0x141e2e){return client['request'](_0x2712e0,_0x706e60)[_0x1e51('0xe')](function(_0xcdfa5d){logger[_0x1e51('0xf')](_0x1e51('0x10'),_0x29da1f,_0x1e51('0x11'));logger[_0x1e51('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x29da1f,_0x1e51('0x11'),JSON[_0x1e51('0x13')](_0xcdfa5d));if(_0xcdfa5d[_0x1e51('0x14')]){if(_0xcdfa5d[_0x1e51('0x14')][_0x1e51('0x15')]===0x1f4){logger[_0x1e51('0x14')](_0x1e51('0x10'),_0x29da1f,_0xcdfa5d[_0x1e51('0x14')][_0x1e51('0x16')]);return _0x141e2e(_0xcdfa5d[_0x1e51('0x14')]['message']);}logger[_0x1e51('0x14')](_0x1e51('0x10'),_0x29da1f,_0xcdfa5d[_0x1e51('0x14')]['message']);return _0x4241a6(_0xcdfa5d[_0x1e51('0x14')]['message']);}else{logger['info'](_0x1e51('0x10'),_0x29da1f,_0x1e51('0x11'));_0x4241a6(_0xcdfa5d[_0x1e51('0x17')][_0x1e51('0x16')]);}})[_0x1e51('0x18')](function(_0x3e4234){logger['error'](_0x1e51('0x10'),_0x29da1f,_0x3e4234);_0x141e2e(_0x3e4234);});});}exports['GetChatQueue']=function(_0xea581d){var _0x1cbd1c=this;return new Promise(function(_0x309a87,_0x183a95){return db['ChatQueue']['findAll']({'raw':_0xea581d['options']?_0xea581d['options'][_0x1e51('0x19')]===undefined?!![]:![]:!![],'where':_0xea581d['options']?_0xea581d[_0x1e51('0x1a')][_0x1e51('0x1b')]||null:null,'attributes':_0xea581d[_0x1e51('0x1a')]?_0xea581d[_0x1e51('0x1a')][_0x1e51('0x1c')]||null:null,'limit':_0xea581d[_0x1e51('0x1a')]?_0xea581d[_0x1e51('0x1a')][_0x1e51('0x1d')]||null:null,'include':_0xea581d['options']?_0xea581d['options'][_0x1e51('0x1e')]?_[_0x1e51('0x1f')](_0xea581d[_0x1e51('0x1a')][_0x1e51('0x1e')],function(_0x505d79){return{'model':db[_0x505d79['model']],'as':_0x505d79['as'],'attributes':_0x505d79['attributes'],'include':_0x505d79[_0x1e51('0x1e')]?_[_0x1e51('0x1f')](_0x505d79[_0x1e51('0x1e')],function(_0x5412bc){return{'model':db[_0x5412bc[_0x1e51('0x20')]],'as':_0x5412bc['as'],'attributes':_0x5412bc['attributes'],'include':_0x5412bc['include']?_[_0x1e51('0x1f')](_0x5412bc['include'],function(_0x170ec6){return{'model':db[_0x170ec6[_0x1e51('0x20')]],'as':_0x170ec6['as'],'attributes':_0x170ec6['attributes']};}):[]};}):[]};}):[]:[]})[_0x1e51('0xe')](function(_0x10ee23){logger[_0x1e51('0xf')](_0x1e51('0x21'),_0xea581d);logger['debug']('GetChatQueue',_0xea581d,JSON['stringify'](_0x10ee23));_0x309a87(_0x10ee23);})[_0x1e51('0x18')](function(_0x288b50){logger[_0x1e51('0x14')](_0x1e51('0x21'),_0x288b50[_0x1e51('0x16')],_0xea581d);_0x183a95(_0x1cbd1c[_0x1e51('0x14')](0x1f4,_0x288b50[_0x1e51('0x16')]));});});};exports[_0x1e51('0x22')]=function(_0x31b678){var _0x3167b6=this;return new Promise(function(_0x27b550,_0x54c84e){return db[_0x1e51('0x23')][_0x1e51('0x24')]({'raw':_0x31b678[_0x1e51('0x1a')]?_0x31b678[_0x1e51('0x1a')][_0x1e51('0x19')]===undefined?!![]:![]:!![],'where':_0x31b678['options']?_0x31b678[_0x1e51('0x1a')]['where']||null:null,'attributes':_0x31b678[_0x1e51('0x1a')]?_0x31b678[_0x1e51('0x1a')][_0x1e51('0x1c')]||null:null,'include':_0x31b678['options']?_0x31b678[_0x1e51('0x1a')]['include']?_[_0x1e51('0x1f')](_0x31b678['options']['include'],function(_0x463afa){return{'model':db[_0x463afa[_0x1e51('0x20')]],'as':_0x463afa['as'],'attributes':_0x463afa[_0x1e51('0x1c')],'include':_0x463afa['include']?_[_0x1e51('0x1f')](_0x463afa['include'],function(_0x3797a6){return{'model':db[_0x3797a6[_0x1e51('0x20')]],'as':_0x3797a6['as'],'attributes':_0x3797a6['attributes'],'include':_0x3797a6[_0x1e51('0x1e')]?_[_0x1e51('0x1f')](_0x3797a6[_0x1e51('0x1e')],function(_0xeeff34){return{'model':db[_0xeeff34[_0x1e51('0x20')]],'as':_0xeeff34['as'],'attributes':_0xeeff34[_0x1e51('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x509f7d){logger[_0x1e51('0xf')]('ShowChatQueue',_0x31b678);logger[_0x1e51('0x12')](_0x1e51('0x22'),_0x31b678,JSON[_0x1e51('0x13')](_0x509f7d));_0x27b550(_0x509f7d);})[_0x1e51('0x18')](function(_0x1ce020){logger[_0x1e51('0x14')](_0x1e51('0x22'),_0x1ce020[_0x1e51('0x16')],_0x31b678);_0x54c84e(_0x3167b6[_0x1e51('0x14')](0x1f4,_0x1ce020[_0x1e51('0x16')]));});});};
\ No newline at end of file
+var _0x62cf=['attributes','limit','map','model','include','debug','ShowChatQueue','find','raw','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','request','then','info','request\x20sent','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','findAll','options','where'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x62cf,0x81));var _0xf62c=function(_0x16e3d8,_0x201862){_0x16e3d8=_0x16e3d8-0x0;var _0x35009a=_0x62cf[_0x16e3d8];return _0x35009a;};'use strict';var _=require(_0xf62c('0x0'));var util=require('util');var moment=require(_0xf62c('0x1'));var BPromise=require('bluebird');var rs=require(_0xf62c('0x2'));var fs=require('fs');var Redis=require(_0xf62c('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf62c('0x4'))(_0xf62c('0x5'));var config=require(_0xf62c('0x6'));var jayson=require(_0xf62c('0x7'));var client=jayson[_0xf62c('0x8')][_0xf62c('0x9')]({'port':0x232a});config[_0xf62c('0xa')]=_[_0xf62c('0xb')](config[_0xf62c('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xf62c('0xc'))(new Redis(config['redis']));require(_0xf62c('0xd'))[_0xf62c('0xe')](socket);function respondWithRpcPromise(_0x9b92cb,_0x424bf6,_0x24c553){return new BPromise(function(_0x250c8c,_0x336122){return client[_0xf62c('0xf')](_0x9b92cb,_0x24c553)[_0xf62c('0x10')](function(_0x9a583f){logger[_0xf62c('0x11')]('ChatQueue,\x20%s,\x20%s',_0x424bf6,_0xf62c('0x12'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x424bf6,_0xf62c('0x12'),JSON[_0xf62c('0x13')](_0x9a583f));if(_0x9a583f['error']){if(_0x9a583f[_0xf62c('0x14')][_0xf62c('0x15')]===0x1f4){logger['error'](_0xf62c('0x16'),_0x424bf6,_0x9a583f['error'][_0xf62c('0x17')]);return _0x336122(_0x9a583f[_0xf62c('0x14')]['message']);}logger[_0xf62c('0x14')](_0xf62c('0x16'),_0x424bf6,_0x9a583f['error'][_0xf62c('0x17')]);return _0x250c8c(_0x9a583f[_0xf62c('0x14')][_0xf62c('0x17')]);}else{logger['info'](_0xf62c('0x16'),_0x424bf6,_0xf62c('0x12'));_0x250c8c(_0x9a583f[_0xf62c('0x18')][_0xf62c('0x17')]);}})[_0xf62c('0x19')](function(_0x5020f6){logger[_0xf62c('0x14')](_0xf62c('0x16'),_0x424bf6,_0x5020f6);_0x336122(_0x5020f6);});});}exports[_0xf62c('0x1a')]=function(_0x55a475){var _0x5e4dac=this;return new Promise(function(_0x3ae15e,_0x3c3624){return db[_0xf62c('0x1b')][_0xf62c('0x1c')]({'raw':_0x55a475[_0xf62c('0x1d')]?_0x55a475['options']['raw']===undefined?!![]:![]:!![],'where':_0x55a475['options']?_0x55a475[_0xf62c('0x1d')][_0xf62c('0x1e')]||null:null,'attributes':_0x55a475[_0xf62c('0x1d')]?_0x55a475[_0xf62c('0x1d')][_0xf62c('0x1f')]||null:null,'limit':_0x55a475[_0xf62c('0x1d')]?_0x55a475['options'][_0xf62c('0x20')]||null:null,'include':_0x55a475[_0xf62c('0x1d')]?_0x55a475[_0xf62c('0x1d')]['include']?_['map'](_0x55a475['options']['include'],function(_0x2165ae){return{'model':db[_0x2165ae['model']],'as':_0x2165ae['as'],'attributes':_0x2165ae[_0xf62c('0x1f')],'include':_0x2165ae['include']?_[_0xf62c('0x21')](_0x2165ae['include'],function(_0x9da128){return{'model':db[_0x9da128[_0xf62c('0x22')]],'as':_0x9da128['as'],'attributes':_0x9da128[_0xf62c('0x1f')],'include':_0x9da128[_0xf62c('0x23')]?_[_0xf62c('0x21')](_0x9da128['include'],function(_0x1ecd60){return{'model':db[_0x1ecd60[_0xf62c('0x22')]],'as':_0x1ecd60['as'],'attributes':_0x1ecd60[_0xf62c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf62c('0x10')](function(_0x9dde25){logger[_0xf62c('0x11')](_0xf62c('0x1a'),_0x55a475);logger[_0xf62c('0x24')](_0xf62c('0x1a'),_0x55a475,JSON[_0xf62c('0x13')](_0x9dde25));_0x3ae15e(_0x9dde25);})['catch'](function(_0x398d1c){logger[_0xf62c('0x14')]('GetChatQueue',_0x398d1c[_0xf62c('0x17')],_0x55a475);_0x3c3624(_0x5e4dac['error'](0x1f4,_0x398d1c[_0xf62c('0x17')]));});});};exports[_0xf62c('0x25')]=function(_0x515292){var _0x5e7590=this;return new Promise(function(_0x3c21c9,_0x198a36){return db['ChatQueue'][_0xf62c('0x26')]({'raw':_0x515292['options']?_0x515292[_0xf62c('0x1d')][_0xf62c('0x27')]===undefined?!![]:![]:!![],'where':_0x515292[_0xf62c('0x1d')]?_0x515292[_0xf62c('0x1d')]['where']||null:null,'attributes':_0x515292['options']?_0x515292[_0xf62c('0x1d')]['attributes']||null:null,'include':_0x515292[_0xf62c('0x1d')]?_0x515292['options'][_0xf62c('0x23')]?_[_0xf62c('0x21')](_0x515292[_0xf62c('0x1d')][_0xf62c('0x23')],function(_0x5db4cb){return{'model':db[_0x5db4cb[_0xf62c('0x22')]],'as':_0x5db4cb['as'],'attributes':_0x5db4cb[_0xf62c('0x1f')],'include':_0x5db4cb[_0xf62c('0x23')]?_[_0xf62c('0x21')](_0x5db4cb['include'],function(_0x13aeaa){return{'model':db[_0x13aeaa[_0xf62c('0x22')]],'as':_0x13aeaa['as'],'attributes':_0x13aeaa['attributes'],'include':_0x13aeaa[_0xf62c('0x23')]?_[_0xf62c('0x21')](_0x13aeaa[_0xf62c('0x23')],function(_0x304f5e){return{'model':db[_0x304f5e[_0xf62c('0x22')]],'as':_0x304f5e['as'],'attributes':_0x304f5e[_0xf62c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf62c('0x10')](function(_0x2c4100){logger[_0xf62c('0x11')](_0xf62c('0x25'),_0x515292);logger[_0xf62c('0x24')](_0xf62c('0x25'),_0x515292,JSON[_0xf62c('0x13')](_0x2c4100));_0x3c21c9(_0x2c4100);})[_0xf62c('0x19')](function(_0x23976e){logger[_0xf62c('0x14')](_0xf62c('0x25'),_0x23976e[_0xf62c('0x17')],_0x515292);_0x198a36(_0x5e7590[_0xf62c('0x14')](0x1f4,_0x23976e[_0xf62c('0x17')]));});});};
\ No newline at end of file
index 3a8559c..db2f60a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x579c=['chatQueue:','./chatQueue.events','save','remove','update','removeListener','register'];(function(_0x17efa2,_0x58db0d){var _0x46f952=function(_0x7a4122){while(--_0x7a4122){_0x17efa2['push'](_0x17efa2['shift']());}};_0x46f952(++_0x58db0d);}(_0x579c,0xda));var _0xc579=function(_0x26aa88,_0x12eb93){_0x26aa88=_0x26aa88-0x0;var _0x5560b0=_0x579c[_0x26aa88];return _0x5560b0;};'use strict';var ChatQueueEvents=require(_0xc579('0x0'));var events=[_0xc579('0x1'),_0xc579('0x2'),_0xc579('0x3')];function createListener(_0x397136,_0x586948){return function(_0x1e2808){_0x586948['emit'](_0x397136,_0x1e2808);};}function removeListener(_0x21a0a2,_0x3b913c){return function(){ChatQueueEvents[_0xc579('0x4')](_0x21a0a2,_0x3b913c);};}exports[_0xc579('0x5')]=function(_0x124ee5){for(var _0x1bd276=0x0,_0x2e451b=events['length'];_0x1bd276<_0x2e451b;_0x1bd276++){var _0x1c6d9c=events[_0x1bd276];var _0x293c4a=createListener(_0xc579('0x6')+_0x1c6d9c,_0x124ee5);ChatQueueEvents['on'](_0x1c6d9c,_0x293c4a);}};
\ No newline at end of file
+var _0x8ce3=['emit','removeListener','length','./chatQueue.events','save','update'];(function(_0x23de6d,_0xb9088e){var _0x2231cf=function(_0x378137){while(--_0x378137){_0x23de6d['push'](_0x23de6d['shift']());}};_0x2231cf(++_0xb9088e);}(_0x8ce3,0xc3));var _0x38ce=function(_0x30225a,_0x233ad6){_0x30225a=_0x30225a-0x0;var _0x3551ef=_0x8ce3[_0x30225a];return _0x3551ef;};'use strict';var ChatQueueEvents=require(_0x38ce('0x0'));var events=[_0x38ce('0x1'),'remove',_0x38ce('0x2')];function createListener(_0x2b99b0,_0xee1d0e){return function(_0x26ec48){_0xee1d0e[_0x38ce('0x3')](_0x2b99b0,_0x26ec48);};}function removeListener(_0x17b96d,_0x1efae3){return function(){ChatQueueEvents[_0x38ce('0x4')](_0x17b96d,_0x1efae3);};}exports['register']=function(_0x372f86){for(var _0xb24f4c=0x0,_0x58074c=events[_0x38ce('0x5')];_0xb24f4c<_0x58074c;_0xb24f4c++){var _0xbe7332=events[_0xb24f4c];var _0x3f8011=createListener('chatQueue:'+_0xbe7332,_0x372f86);ChatQueueEvents['on'](_0xbe7332,_0x3f8011);}};
\ No newline at end of file
index edabffb..322e9b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x5a3604,_0x3d15b5){var _0x17ce7e=function(_0x1ccff8){while(--_0x1ccff8){_0x5a3604['push'](_0x5a3604['shift']());}};_0x17ce7e(++_0x3d15b5);}(_0xe14b,0x93));var _0xbe14=function(_0x117db9,_0x4b8520){_0x117db9=_0x117db9-0x0;var _0x19da3f=_0xe14b[_0x117db9];return _0x19da3f;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
+var _0x55ca=['post','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','addTeams'];(function(_0x1a8be3,_0xa1d303){var _0xac9769=function(_0x3e5ccb){while(--_0x3e5ccb){_0x1a8be3['push'](_0x1a8be3['shift']());}};_0xac9769(++_0xa1d303);}(_0x55ca,0x126));var _0xa55c=function(_0x2e891a,_0xb5a3b5){_0x2e891a=_0x2e891a-0x0;var _0x39f989=_0x55ca[_0x2e891a];return _0x39f989;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getAgents']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/teams',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x13')]);router['put'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router[_0xa55c('0x15')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x16')]);router[_0xa55c('0x15')](_0xa55c('0xe'),auth['isAuthenticated'](),controller[_0xa55c('0x17')]);router[_0xa55c('0x15')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x18')]);module[_0xa55c('0x19')]=router;
\ No newline at end of file
index 9e1a267..b339db8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8810=['DATE','moment','sequelize','STRING'];(function(_0x3449f4,_0x5710d2){var _0x5a684d=function(_0x4da3cb){while(--_0x4da3cb){_0x3449f4['push'](_0x3449f4['shift']());}};_0x5a684d(++_0x5710d2);}(_0x8810,0x85));var _0x0881=function(_0xa57938,_0x3acf3a){_0xa57938=_0xa57938-0x0;var _0xb42015=_0x8810[_0xa57938];return _0xb42015;};'use strict';var moment=require(_0x0881('0x0'));var Sequelize=require(_0x0881('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x0881('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x0881('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0881('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0881('0x3')]},'reason':{'type':Sequelize[_0x0881('0x2')]}};
\ No newline at end of file
+var _0x45d4=['moment','exports','STRING','DATE'];(function(_0x4d05e9,_0x361c7d){var _0x197a51=function(_0x1442f7){while(--_0x1442f7){_0x4d05e9['push'](_0x4d05e9['shift']());}};_0x197a51(++_0x361c7d);}(_0x45d4,0x170));var _0x445d=function(_0x26404d,_0xdab8ab){_0x26404d=_0x26404d-0x0;var _0x40eaa8=_0x45d4[_0x26404d];return _0x40eaa8;};'use strict';var moment=require(_0x445d('0x0'));var Sequelize=require('sequelize');module[_0x445d('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x445d('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x445d('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x445d('0x2')]}};
\ No newline at end of file
index 96dede4..b7563cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d59=['squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','limit','count','offset','set','Content-Range','apply','save','update','then','end','error','stack','name','map','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatQueueReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','lodash'];(function(_0x43c4f5,_0x5d46d9){var _0x56774c=function(_0x57f171){while(--_0x57f171){_0x43c4f5['push'](_0x43c4f5['shift']());}};_0x56774c(++_0x5d46d9);}(_0x5d59,0x15f));var _0x95d5=function(_0x3f6c60,_0x486af8){_0x3f6c60=_0x3f6c60-0x0;var _0x2bbe6a=_0x5d59[_0x3f6c60];return _0x2bbe6a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x95d5('0x0'));var zipdir=require(_0x95d5('0x1'));var jsonpatch=require(_0x95d5('0x2'));var rp=require(_0x95d5('0x3'));var moment=require(_0x95d5('0x4'));var BPromise=require(_0x95d5('0x5'));var Mustache=require('mustache');var util=require(_0x95d5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x95d5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95d5('0x8'));var squel=require(_0x95d5('0x9'));var crypto=require(_0x95d5('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x95d5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x95d5('0xc'));var Papa=require('papaparse');var Redis=require(_0x95d5('0xd'));var authService=require(_0x95d5('0xe'));var qs=require(_0x95d5('0xf'));var as=require(_0x95d5('0x10'));var hardwareService=require(_0x95d5('0x11'));var logger=require(_0x95d5('0x12'))(_0x95d5('0x13'));var utils=require(_0x95d5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x95d5('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47fb16,_0x12b0ff){_0x12b0ff=_0x12b0ff||0xcc;return function(_0x30ad51){if(_0x30ad51){return _0x47fb16[_0x95d5('0x16')](_0x12b0ff);}return _0x47fb16[_0x95d5('0x17')](_0x12b0ff)['end']();};}function respondWithResult(_0x33d769,_0x2ce559){_0x2ce559=_0x2ce559||0xc8;return function(_0x3c0c3e){if(_0x3c0c3e){return _0x33d769[_0x95d5('0x17')](_0x2ce559)[_0x95d5('0x18')](_0x3c0c3e);}};}function respondWithFilteredResult(_0x3a59df,_0x3d8de7){return function(_0x1f03eb){if(_0x1f03eb){var _0x14d8a9=typeof _0x3d8de7['offset']==='undefined'&&typeof _0x3d8de7[_0x95d5('0x19')]==='undefined';var _0x34a382=_0x1f03eb[_0x95d5('0x1a')];var _0x5bdf14=_0x14d8a9?0x0:_0x3d8de7[_0x95d5('0x1b')];var _0x3793eb=_0x14d8a9?_0x1f03eb[_0x95d5('0x1a')]:_0x3d8de7[_0x95d5('0x1b')]+_0x3d8de7[_0x95d5('0x19')];var _0x11e905;if(_0x3793eb>=_0x34a382){_0x3793eb=_0x34a382;_0x11e905=0xc8;}else{_0x11e905=0xce;}_0x3a59df['status'](_0x11e905);return _0x3a59df[_0x95d5('0x1c')](_0x95d5('0x1d'),_0x5bdf14+'-'+_0x3793eb+'/'+_0x34a382)[_0x95d5('0x18')](_0x1f03eb);}return null;};}function patchUpdates(_0x5bd58d){return function(_0x5e8a19){try{jsonpatch[_0x95d5('0x1e')](_0x5e8a19,_0x5bd58d,!![]);}catch(_0x4023d3){return BPromise['reject'](_0x4023d3);}return _0x5e8a19[_0x95d5('0x1f')]();};}function saveUpdates(_0x2557e7,_0x2ca4b6){return function(_0x51ba73){if(_0x51ba73){return _0x51ba73[_0x95d5('0x20')](_0x2557e7)['then'](function(_0x5a5a7e){return _0x5a5a7e;});}return null;};}function removeEntity(_0x4f64ac,_0x554f4d){return function(_0x588825){if(_0x588825){return _0x588825['destroy']()[_0x95d5('0x21')](function(){_0x4f64ac[_0x95d5('0x17')](0xcc)[_0x95d5('0x22')]();});}};}function handleEntityNotFound(_0x260582,_0x54f64c){return function(_0x3fe6ef){if(!_0x3fe6ef){_0x260582[_0x95d5('0x16')](0x194);}return _0x3fe6ef;};}function handleError(_0x316d19,_0x1b8d73){_0x1b8d73=_0x1b8d73||0x1f4;return function(_0xe12a95){logger[_0x95d5('0x23')](_0xe12a95[_0x95d5('0x24')]);if(_0xe12a95[_0x95d5('0x25')]){delete _0xe12a95[_0x95d5('0x25')];}_0x316d19[_0x95d5('0x17')](_0x1b8d73)['send'](_0xe12a95);};}exports['index']=function(_0xd9b81c,_0x18121f){var _0x256727={},_0x5dfe00={},_0x1c8626={'count':0x0,'rows':[]};var _0x4e6f3b=_[_0x95d5('0x26')](db['ChatQueueReport'][_0x95d5('0x27')],function(_0x14b058){return{'name':_0x14b058[_0x95d5('0x28')],'type':_0x14b058[_0x95d5('0x29')][_0x95d5('0x2a')]};});_0x5dfe00[_0x95d5('0x2b')]=_[_0x95d5('0x26')](_0x4e6f3b,_0x95d5('0x25'));_0x5dfe00['query']=_['keys'](_0xd9b81c['query']);_0x5dfe00[_0x95d5('0x2c')]=_[_0x95d5('0x2d')](_0x5dfe00[_0x95d5('0x2b')],_0x5dfe00[_0x95d5('0x2e')]);_0x256727[_0x95d5('0x2f')]=_[_0x95d5('0x2d')](_0x5dfe00['model'],qs[_0x95d5('0x30')](_0xd9b81c[_0x95d5('0x2e')][_0x95d5('0x30')]));_0x256727[_0x95d5('0x2f')]=_0x256727[_0x95d5('0x2f')][_0x95d5('0x31')]?_0x256727[_0x95d5('0x2f')]:_0x5dfe00[_0x95d5('0x2b')];if(!_0xd9b81c[_0x95d5('0x2e')]['hasOwnProperty']('nolimit')){_0x256727[_0x95d5('0x19')]=qs[_0x95d5('0x19')](_0xd9b81c[_0x95d5('0x2e')][_0x95d5('0x19')]);_0x256727['offset']=qs[_0x95d5('0x1b')](_0xd9b81c['query'][_0x95d5('0x1b')]);}_0x256727[_0x95d5('0x32')]=qs[_0x95d5('0x33')](_0xd9b81c['query'][_0x95d5('0x33')]);_0x256727[_0x95d5('0x34')]=qs[_0x95d5('0x2c')](_[_0x95d5('0x35')](_0xd9b81c[_0x95d5('0x2e')],_0x5dfe00[_0x95d5('0x2c')]),_0x4e6f3b);if(_0xd9b81c['query'][_0x95d5('0x36')]){_0x256727[_0x95d5('0x34')]=_[_0x95d5('0x37')](_0x256727[_0x95d5('0x34')],{'$or':_[_0x95d5('0x26')](_0x4e6f3b,function(_0x236e98){if(_0x236e98[_0x95d5('0x29')]!==_0x95d5('0x38')){var _0x172396={};_0x172396[_0x236e98[_0x95d5('0x25')]]={'$like':'%'+_0xd9b81c['query']['filter']+'%'};return _0x172396;}})});}_0x256727=_[_0x95d5('0x37')]({},_0x256727,_0xd9b81c[_0x95d5('0x39')]);var _0x28a05e={'where':_0x256727[_0x95d5('0x34')]};return db[_0x95d5('0x3a')]['count'](_0x28a05e)[_0x95d5('0x21')](function(_0xc7b674){_0x1c8626[_0x95d5('0x1a')]=_0xc7b674;if(_0xd9b81c[_0x95d5('0x2e')][_0x95d5('0x3b')]){_0x256727[_0x95d5('0x3c')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x95d5('0x3d')](_0x256727);})[_0x95d5('0x21')](function(_0xb00cd0){_0x1c8626[_0x95d5('0x3e')]=_0xb00cd0;return _0x1c8626;})[_0x95d5('0x21')](respondWithFilteredResult(_0x18121f,_0x256727))[_0x95d5('0x3f')](handleError(_0x18121f,null));};exports[_0x95d5('0x40')]=function(_0x344d4f,_0x2baab8){var _0x5bc9c8={'raw':!![],'where':{'id':_0x344d4f[_0x95d5('0x41')]['id']}},_0x37238b={};_0x37238b[_0x95d5('0x2b')]=_[_0x95d5('0x42')](db['ChatQueueReport'][_0x95d5('0x27')]);_0x37238b['query']=_[_0x95d5('0x42')](_0x344d4f[_0x95d5('0x2e')]);_0x37238b[_0x95d5('0x2c')]=_[_0x95d5('0x2d')](_0x37238b[_0x95d5('0x2b')],_0x37238b['query']);_0x5bc9c8[_0x95d5('0x2f')]=_[_0x95d5('0x2d')](_0x37238b[_0x95d5('0x2b')],qs[_0x95d5('0x30')](_0x344d4f[_0x95d5('0x2e')][_0x95d5('0x30')]));_0x5bc9c8[_0x95d5('0x2f')]=_0x5bc9c8[_0x95d5('0x2f')]['length']?_0x5bc9c8['attributes']:_0x37238b[_0x95d5('0x2b')];if(_0x344d4f[_0x95d5('0x2e')][_0x95d5('0x3b')]){_0x5bc9c8['include']=[{'all':!![]}];}_0x5bc9c8=_[_0x95d5('0x37')]({},_0x5bc9c8,_0x344d4f[_0x95d5('0x39')]);return db['ChatQueueReport'][_0x95d5('0x43')](_0x5bc9c8)['then'](handleEntityNotFound(_0x2baab8,null))[_0x95d5('0x21')](respondWithResult(_0x2baab8,null))[_0x95d5('0x3f')](handleError(_0x2baab8,null));};exports[_0x95d5('0x44')]=function(_0x13419e,_0x2ebc44){return db[_0x95d5('0x3a')][_0x95d5('0x44')](_0x13419e[_0x95d5('0x45')],{})['then'](respondWithResult(_0x2ebc44,0xc9))['catch'](handleError(_0x2ebc44,null));};exports[_0x95d5('0x20')]=function(_0x1d24e8,_0x1f7efd){if(_0x1d24e8[_0x95d5('0x45')]['id']){delete _0x1d24e8[_0x95d5('0x45')]['id'];}return db['ChatQueueReport'][_0x95d5('0x43')]({'where':{'id':_0x1d24e8[_0x95d5('0x41')]['id']}})['then'](handleEntityNotFound(_0x1f7efd,null))[_0x95d5('0x21')](saveUpdates(_0x1d24e8[_0x95d5('0x45')],null))['then'](respondWithResult(_0x1f7efd,null))[_0x95d5('0x3f')](handleError(_0x1f7efd,null));};exports[_0x95d5('0x46')]=function(_0x170116,_0x4cceae){return db[_0x95d5('0x3a')][_0x95d5('0x43')]({'where':{'id':_0x170116['params']['id']}})[_0x95d5('0x21')](handleEntityNotFound(_0x4cceae,null))[_0x95d5('0x21')](removeEntity(_0x4cceae,null))['catch'](handleError(_0x4cceae,null));};exports[_0x95d5('0x47')]=function(_0x302952,_0x4b0e15){return db['ChatQueueReport'][_0x95d5('0x47')]()[_0x95d5('0x21')](respondWithResult(_0x4b0e15,null))[_0x95d5('0x3f')](handleError(_0x4b0e15,null));};
\ No newline at end of file
+var _0x3837=['find','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ChatQueueReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','length'];(function(_0x1b95df,_0x135ab4){var _0x5e530a=function(_0x4917cb){while(--_0x4917cb){_0x1b95df['push'](_0x1b95df['shift']());}};_0x5e530a(++_0x135ab4);}(_0x3837,0x1d1));var _0x7383=function(_0xac6177,_0x34af46){_0xac6177=_0xac6177-0x0;var _0x5902a9=_0x3837[_0xac6177];return _0x5902a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7383('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7383('0x1'));var rp=require('request-promise');var moment=require(_0x7383('0x2'));var BPromise=require(_0x7383('0x3'));var Mustache=require(_0x7383('0x4'));var util=require(_0x7383('0x5'));var path=require(_0x7383('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7383('0x7'));var fs=require('fs');var fs_extra=require(_0x7383('0x8'));var _=require(_0x7383('0x9'));var squel=require(_0x7383('0xa'));var crypto=require(_0x7383('0xb'));var jsforce=require(_0x7383('0xc'));var deskjs=require(_0x7383('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7383('0xe'));var Papa=require(_0x7383('0xf'));var Redis=require(_0x7383('0x10'));var authService=require(_0x7383('0x11'));var qs=require(_0x7383('0x12'));var as=require(_0x7383('0x13'));var hardwareService=require(_0x7383('0x14'));var logger=require('../../config/logger')(_0x7383('0x15'));var utils=require(_0x7383('0x16'));var config=require(_0x7383('0x17'));var licenseUtil=require(_0x7383('0x18'));var db=require(_0x7383('0x19'))['db'];function respondWithStatusCode(_0x35e5f4,_0xe359e8){_0xe359e8=_0xe359e8||0xcc;return function(_0x70b32){if(_0x70b32){return _0x35e5f4[_0x7383('0x1a')](_0xe359e8);}return _0x35e5f4[_0x7383('0x1b')](_0xe359e8)[_0x7383('0x1c')]();};}function respondWithResult(_0x5b018f,_0x43c1d6){_0x43c1d6=_0x43c1d6||0xc8;return function(_0x3a2c78){if(_0x3a2c78){return _0x5b018f[_0x7383('0x1b')](_0x43c1d6)[_0x7383('0x1d')](_0x3a2c78);}};}function respondWithFilteredResult(_0x4aa59d,_0x566949){return function(_0x47b4c4){if(_0x47b4c4){var _0x5cf093=typeof _0x566949[_0x7383('0x1e')]===_0x7383('0x1f')&&typeof _0x566949[_0x7383('0x20')]===_0x7383('0x1f');var _0x1f733d=_0x47b4c4['count'];var _0x1cf7bb=_0x5cf093?0x0:_0x566949[_0x7383('0x1e')];var _0x1c7645=_0x5cf093?_0x47b4c4[_0x7383('0x21')]:_0x566949[_0x7383('0x1e')]+_0x566949[_0x7383('0x20')];var _0x115ff6;if(_0x1c7645>=_0x1f733d){_0x1c7645=_0x1f733d;_0x115ff6=0xc8;}else{_0x115ff6=0xce;}_0x4aa59d[_0x7383('0x1b')](_0x115ff6);return _0x4aa59d[_0x7383('0x22')](_0x7383('0x23'),_0x1cf7bb+'-'+_0x1c7645+'/'+_0x1f733d)['json'](_0x47b4c4);}return null;};}function patchUpdates(_0x42d970){return function(_0x2aebe0){try{jsonpatch[_0x7383('0x24')](_0x2aebe0,_0x42d970,!![]);}catch(_0x4a65e9){return BPromise[_0x7383('0x25')](_0x4a65e9);}return _0x2aebe0[_0x7383('0x26')]();};}function saveUpdates(_0x47e145,_0x316204){return function(_0x57420d){if(_0x57420d){return _0x57420d[_0x7383('0x27')](_0x47e145)[_0x7383('0x28')](function(_0x5c617a){return _0x5c617a;});}return null;};}function removeEntity(_0x1afeab,_0x3c5467){return function(_0x1edf1d){if(_0x1edf1d){return _0x1edf1d[_0x7383('0x29')]()[_0x7383('0x28')](function(){_0x1afeab['status'](0xcc)[_0x7383('0x1c')]();});}};}function handleEntityNotFound(_0x5eaf6a,_0x4c3e40){return function(_0x388964){if(!_0x388964){_0x5eaf6a[_0x7383('0x1a')](0x194);}return _0x388964;};}function handleError(_0x82bd92,_0x208ef9){_0x208ef9=_0x208ef9||0x1f4;return function(_0x4a1840){logger[_0x7383('0x2a')](_0x4a1840['stack']);if(_0x4a1840[_0x7383('0x2b')]){delete _0x4a1840[_0x7383('0x2b')];}_0x82bd92[_0x7383('0x1b')](_0x208ef9)[_0x7383('0x2c')](_0x4a1840);};}exports[_0x7383('0x2d')]=function(_0x439d09,_0x272d78){var _0x43f7a5={},_0x2b550d={},_0x15b14c={'count':0x0,'rows':[]};var _0x512a98=_[_0x7383('0x2e')](db[_0x7383('0x2f')]['rawAttributes'],function(_0x5e52ce){return{'name':_0x5e52ce['fieldName'],'type':_0x5e52ce[_0x7383('0x30')][_0x7383('0x31')]};});_0x2b550d[_0x7383('0x32')]=_[_0x7383('0x2e')](_0x512a98,_0x7383('0x2b'));_0x2b550d[_0x7383('0x33')]=_[_0x7383('0x34')](_0x439d09[_0x7383('0x33')]);_0x2b550d[_0x7383('0x35')]=_[_0x7383('0x36')](_0x2b550d[_0x7383('0x32')],_0x2b550d[_0x7383('0x33')]);_0x43f7a5[_0x7383('0x37')]=_[_0x7383('0x36')](_0x2b550d[_0x7383('0x32')],qs[_0x7383('0x38')](_0x439d09[_0x7383('0x33')][_0x7383('0x38')]));_0x43f7a5[_0x7383('0x37')]=_0x43f7a5[_0x7383('0x37')]['length']?_0x43f7a5[_0x7383('0x37')]:_0x2b550d[_0x7383('0x32')];if(!_0x439d09['query'][_0x7383('0x39')](_0x7383('0x3a'))){_0x43f7a5[_0x7383('0x20')]=qs[_0x7383('0x20')](_0x439d09[_0x7383('0x33')]['limit']);_0x43f7a5[_0x7383('0x1e')]=qs[_0x7383('0x1e')](_0x439d09[_0x7383('0x33')][_0x7383('0x1e')]);}_0x43f7a5[_0x7383('0x3b')]=qs[_0x7383('0x3c')](_0x439d09[_0x7383('0x33')]['sort']);_0x43f7a5['where']=qs['filters'](_[_0x7383('0x3d')](_0x439d09[_0x7383('0x33')],_0x2b550d[_0x7383('0x35')]),_0x512a98);if(_0x439d09[_0x7383('0x33')][_0x7383('0x3e')]){_0x43f7a5[_0x7383('0x3f')]=_[_0x7383('0x40')](_0x43f7a5[_0x7383('0x3f')],{'$or':_[_0x7383('0x2e')](_0x512a98,function(_0x4f307a){if(_0x4f307a[_0x7383('0x30')]!==_0x7383('0x41')){var _0x3c2795={};_0x3c2795[_0x4f307a[_0x7383('0x2b')]]={'$like':'%'+_0x439d09[_0x7383('0x33')][_0x7383('0x3e')]+'%'};return _0x3c2795;}})});}_0x43f7a5=_['merge']({},_0x43f7a5,_0x439d09[_0x7383('0x42')]);var _0x5329a6={'where':_0x43f7a5['where']};return db[_0x7383('0x2f')][_0x7383('0x21')](_0x5329a6)[_0x7383('0x28')](function(_0x3f14a6){_0x15b14c[_0x7383('0x21')]=_0x3f14a6;if(_0x439d09['query']['includeAll']){_0x43f7a5[_0x7383('0x43')]=[{'all':!![]}];}return db[_0x7383('0x2f')]['findAll'](_0x43f7a5);})['then'](function(_0x271cd5){_0x15b14c[_0x7383('0x44')]=_0x271cd5;return _0x15b14c;})[_0x7383('0x28')](respondWithFilteredResult(_0x272d78,_0x43f7a5))[_0x7383('0x45')](handleError(_0x272d78,null));};exports[_0x7383('0x46')]=function(_0x53c999,_0x141728){var _0x5d9085={'raw':!![],'where':{'id':_0x53c999[_0x7383('0x47')]['id']}},_0x3951d1={};_0x3951d1[_0x7383('0x32')]=_[_0x7383('0x34')](db['ChatQueueReport'][_0x7383('0x48')]);_0x3951d1[_0x7383('0x33')]=_[_0x7383('0x34')](_0x53c999[_0x7383('0x33')]);_0x3951d1['filters']=_[_0x7383('0x36')](_0x3951d1[_0x7383('0x32')],_0x3951d1[_0x7383('0x33')]);_0x5d9085[_0x7383('0x37')]=_[_0x7383('0x36')](_0x3951d1[_0x7383('0x32')],qs[_0x7383('0x38')](_0x53c999[_0x7383('0x33')][_0x7383('0x38')]));_0x5d9085[_0x7383('0x37')]=_0x5d9085[_0x7383('0x37')][_0x7383('0x49')]?_0x5d9085[_0x7383('0x37')]:_0x3951d1['model'];if(_0x53c999[_0x7383('0x33')]['includeAll']){_0x5d9085[_0x7383('0x43')]=[{'all':!![]}];}_0x5d9085=_[_0x7383('0x40')]({},_0x5d9085,_0x53c999[_0x7383('0x42')]);return db['ChatQueueReport'][_0x7383('0x4a')](_0x5d9085)[_0x7383('0x28')](handleEntityNotFound(_0x141728,null))['then'](respondWithResult(_0x141728,null))[_0x7383('0x45')](handleError(_0x141728,null));};exports['create']=function(_0x10ac80,_0x49e4f1){return db[_0x7383('0x2f')]['create'](_0x10ac80[_0x7383('0x4b')],{})[_0x7383('0x28')](respondWithResult(_0x49e4f1,0xc9))[_0x7383('0x45')](handleError(_0x49e4f1,null));};exports['update']=function(_0xd6ea61,_0x15ed37){if(_0xd6ea61[_0x7383('0x4b')]['id']){delete _0xd6ea61['body']['id'];}return db['ChatQueueReport'][_0x7383('0x4a')]({'where':{'id':_0xd6ea61[_0x7383('0x47')]['id']}})[_0x7383('0x28')](handleEntityNotFound(_0x15ed37,null))[_0x7383('0x28')](saveUpdates(_0xd6ea61[_0x7383('0x4b')],null))[_0x7383('0x28')](respondWithResult(_0x15ed37,null))[_0x7383('0x45')](handleError(_0x15ed37,null));};exports[_0x7383('0x29')]=function(_0x380316,_0x65a7d2){return db['ChatQueueReport'][_0x7383('0x4a')]({'where':{'id':_0x380316[_0x7383('0x47')]['id']}})[_0x7383('0x28')](handleEntityNotFound(_0x65a7d2,null))[_0x7383('0x28')](removeEntity(_0x65a7d2,null))[_0x7383('0x45')](handleError(_0x65a7d2,null));};exports['describe']=function(_0x210351,_0xa7233a){return db['ChatQueueReport'][_0x7383('0x4c')]()[_0x7383('0x28')](respondWithResult(_0xa7233a,null))[_0x7383('0x45')](handleError(_0xa7233a,null));};
\ No newline at end of file
index 5984ab4..f10ecb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x371a1d,_0x3591f3){var _0x4ba340=function(_0x57cfbc){while(--_0x57cfbc){_0x371a1d['push'](_0x371a1d['shift']());}};_0x4ba340(++_0x3591f3);}(_0xb10b,0x12a));var _0xbb10=function(_0x17044c,_0x208790){_0x17044c=_0x17044c-0x0;var _0x5e6db0=_0xb10b[_0x17044c];return _0x5e6db0;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x4947d7,_0x270f05){var _0x4b6e94=function(_0x469ae4){while(--_0x469ae4){_0x4947d7['push'](_0x4947d7['shift']());}};_0x4b6e94(++_0x270f05);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xb7e7[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index ec70b2f..9343fdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b03=['../../config/utils','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','create','body','options','UpdateChatQueueReport','ChatQueueReport','update','raw','where','limit','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x450653,_0x29a247){var _0x53b38e=function(_0x4c5a4f){while(--_0x4c5a4f){_0x450653['push'](_0x450653['shift']());}};_0x53b38e(++_0x29a247);}(_0x9b03,0x102));var _0x39b0=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x9b03[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0x39b0('0x0'));var util=require(_0x39b0('0x1'));var moment=require('moment');var BPromise=require(_0x39b0('0x2'));var rs=require(_0x39b0('0x3'));var fs=require('fs');var Redis=require(_0x39b0('0x4'));var db=require(_0x39b0('0x5'))['db'];var utils=require(_0x39b0('0x6'));var logger=require('../../config/logger')(_0x39b0('0x7'));var config=require('../../config/environment');var jayson=require(_0x39b0('0x8'));var client=jayson[_0x39b0('0x9')][_0x39b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c3671,_0x37bc0c,_0x3634c9){return new BPromise(function(_0x4b0e3e,_0x3ecfd8){return client[_0x39b0('0xb')](_0x3c3671,_0x3634c9)[_0x39b0('0xc')](function(_0x3b74bf){logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x37bc0c,_0x39b0('0xd'));logger[_0x39b0('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x37bc0c,_0x39b0('0xd'),JSON[_0x39b0('0xf')](_0x3b74bf));if(_0x3b74bf[_0x39b0('0x10')]){if(_0x3b74bf[_0x39b0('0x10')][_0x39b0('0x11')]===0x1f4){logger[_0x39b0('0x10')](_0x39b0('0x12'),_0x37bc0c,_0x3b74bf[_0x39b0('0x10')][_0x39b0('0x13')]);return _0x3ecfd8(_0x3b74bf[_0x39b0('0x10')][_0x39b0('0x13')]);}logger[_0x39b0('0x10')](_0x39b0('0x12'),_0x37bc0c,_0x3b74bf[_0x39b0('0x10')][_0x39b0('0x13')]);return _0x4b0e3e(_0x3b74bf['error'][_0x39b0('0x13')]);}else{logger['info']('ChatQueueReport,\x20%s,\x20%s',_0x37bc0c,_0x39b0('0xd'));_0x4b0e3e(_0x3b74bf[_0x39b0('0x14')][_0x39b0('0x13')]);}})[_0x39b0('0x15')](function(_0x159543){logger['error'](_0x39b0('0x12'),_0x37bc0c,_0x159543);_0x3ecfd8(_0x159543);});});}exports[_0x39b0('0x16')]=function(_0x32fd46){var _0x2ff45f=this;return new Promise(function(_0x551678,_0x475b40){return db['ChatQueueReport'][_0x39b0('0x17')](_0x32fd46[_0x39b0('0x18')],{'raw':_0x32fd46[_0x39b0('0x19')]?_0x32fd46[_0x39b0('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x84c2cf){logger['info'](_0x39b0('0x16'),_0x32fd46);logger[_0x39b0('0xe')](_0x39b0('0x16'),_0x32fd46,JSON[_0x39b0('0xf')](_0x84c2cf));_0x551678(_0x84c2cf);})[_0x39b0('0x15')](function(_0x2a30f7){logger[_0x39b0('0x10')](_0x39b0('0x16'),_0x2a30f7['message'],_0x32fd46);_0x475b40(_0x2ff45f[_0x39b0('0x10')](0x1f4,_0x2a30f7['message']));});});};exports[_0x39b0('0x1a')]=function(_0x105ad3){var _0x576720=this;return new Promise(function(_0x3f9f0c,_0x5c444a){return db[_0x39b0('0x1b')][_0x39b0('0x1c')](_0x105ad3[_0x39b0('0x18')],{'raw':_0x105ad3[_0x39b0('0x19')]?_0x105ad3[_0x39b0('0x19')][_0x39b0('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x105ad3['options']?_0x105ad3[_0x39b0('0x19')][_0x39b0('0x1e')]||null:null,'attributes':_0x105ad3['options']?_0x105ad3[_0x39b0('0x19')]['attributes']||null:null,'limit':_0x105ad3[_0x39b0('0x19')]?_0x105ad3[_0x39b0('0x19')][_0x39b0('0x1f')]||null:null})[_0x39b0('0xc')](function(_0xe8784d){logger[_0x39b0('0x20')](_0x39b0('0x1a'),_0x105ad3);logger[_0x39b0('0xe')]('UpdateChatQueueReport',_0x105ad3,JSON[_0x39b0('0xf')](_0xe8784d));_0x3f9f0c(_0xe8784d);})['catch'](function(_0x1aec95){logger[_0x39b0('0x10')]('UpdateChatQueueReport',_0x1aec95[_0x39b0('0x13')],_0x105ad3);_0x5c444a(_0x576720[_0x39b0('0x10')](0x1f4,_0x1aec95[_0x39b0('0x13')]));});});};
\ No newline at end of file
+var _0x3a00=['../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','UpdateChatQueueReport','update','raw','where','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc'];(function(_0x325c35,_0x420083){var _0x420c21=function(_0x27ee88){while(--_0x27ee88){_0x325c35['push'](_0x325c35['shift']());}};_0x420c21(++_0x420083);}(_0x3a00,0xe0));var _0x03a0=function(_0x10b317,_0x2adf32){_0x10b317=_0x10b317-0x0;var _0x1e3054=_0x3a00[_0x10b317];return _0x1e3054;};'use strict';var _=require(_0x03a0('0x0'));var util=require(_0x03a0('0x1'));var moment=require('moment');var BPromise=require(_0x03a0('0x2'));var rs=require(_0x03a0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x03a0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x03a0('0x5'))(_0x03a0('0x6'));var config=require(_0x03a0('0x7'));var jayson=require(_0x03a0('0x8'));var client=jayson['client'][_0x03a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ff322,_0x399b95,_0x2c62b4){return new BPromise(function(_0x2dd72d,_0x345ca9){return client['request'](_0x1ff322,_0x2c62b4)[_0x03a0('0xa')](function(_0x4498e7){logger[_0x03a0('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x399b95,_0x03a0('0xc'));logger[_0x03a0('0xd')](_0x03a0('0xe'),_0x399b95,_0x03a0('0xc'),JSON[_0x03a0('0xf')](_0x4498e7));if(_0x4498e7[_0x03a0('0x10')]){if(_0x4498e7['error'][_0x03a0('0x11')]===0x1f4){logger['error'](_0x03a0('0x12'),_0x399b95,_0x4498e7[_0x03a0('0x10')]['message']);return _0x345ca9(_0x4498e7[_0x03a0('0x10')]['message']);}logger[_0x03a0('0x10')](_0x03a0('0x12'),_0x399b95,_0x4498e7[_0x03a0('0x10')][_0x03a0('0x13')]);return _0x2dd72d(_0x4498e7[_0x03a0('0x10')][_0x03a0('0x13')]);}else{logger[_0x03a0('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x399b95,'request\x20sent');_0x2dd72d(_0x4498e7[_0x03a0('0x14')]['message']);}})[_0x03a0('0x15')](function(_0x17beaf){logger['error'](_0x03a0('0x12'),_0x399b95,_0x17beaf);_0x345ca9(_0x17beaf);});});}exports[_0x03a0('0x16')]=function(_0x3dc022){var _0x36c6a1=this;return new Promise(function(_0x2b88c4,_0x3c4949){return db[_0x03a0('0x17')][_0x03a0('0x18')](_0x3dc022[_0x03a0('0x19')],{'raw':_0x3dc022[_0x03a0('0x1a')]?_0x3dc022[_0x03a0('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x03a0('0xa')](function(_0x288647){logger[_0x03a0('0xb')](_0x03a0('0x16'),_0x3dc022);logger['debug'](_0x03a0('0x16'),_0x3dc022,JSON['stringify'](_0x288647));_0x2b88c4(_0x288647);})[_0x03a0('0x15')](function(_0x580da4){logger[_0x03a0('0x10')]('CreateChatQueueReport',_0x580da4[_0x03a0('0x13')],_0x3dc022);_0x3c4949(_0x36c6a1[_0x03a0('0x10')](0x1f4,_0x580da4['message']));});});};exports[_0x03a0('0x1b')]=function(_0x5c3307){var _0x1b215b=this;return new Promise(function(_0x4ce2a6,_0x142792){return db['ChatQueueReport'][_0x03a0('0x1c')](_0x5c3307[_0x03a0('0x19')],{'raw':_0x5c3307['options']?_0x5c3307['options'][_0x03a0('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c3307[_0x03a0('0x1a')]?_0x5c3307[_0x03a0('0x1a')][_0x03a0('0x1e')]||null:null,'attributes':_0x5c3307['options']?_0x5c3307[_0x03a0('0x1a')][_0x03a0('0x1f')]||null:null,'limit':_0x5c3307[_0x03a0('0x1a')]?_0x5c3307[_0x03a0('0x1a')][_0x03a0('0x20')]||null:null})[_0x03a0('0xa')](function(_0x271843){logger[_0x03a0('0xb')]('UpdateChatQueueReport',_0x5c3307);logger['debug'](_0x03a0('0x1b'),_0x5c3307,JSON[_0x03a0('0xf')](_0x271843));_0x4ce2a6(_0x271843);})[_0x03a0('0x15')](function(_0x17b07f){logger[_0x03a0('0x10')](_0x03a0('0x1b'),_0x17b07f['message'],_0x5c3307);_0x142792(_0x1b215b['error'](0x1f4,_0x17b07f[_0x03a0('0x13')]));});});};
\ No newline at end of file
index 7f3b450..12f4c90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7387=['isAuthenticated','index','/describe','/:id','show','create','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','get'];(function(_0x1c5643,_0x3c5cb2){var _0x1c981f=function(_0x4d3d61){while(--_0x4d3d61){_0x1c5643['push'](_0x1c5643['shift']());}};_0x1c981f(++_0x3c5cb2);}(_0x7387,0x16a));var _0x7738=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7387[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7738('0x0'));var timeout=require('connect-timeout');var express=require(_0x7738('0x1'));var router=express[_0x7738('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x7738('0x3'));var interaction=require(_0x7738('0x4'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0x7738('0x5')]('/',auth[_0x7738('0x6')](),controller[_0x7738('0x7')]);router['get'](_0x7738('0x8'),auth[_0x7738('0x6')](),controller['describe']);router[_0x7738('0x5')](_0x7738('0x9'),auth[_0x7738('0x6')](),controller[_0x7738('0xa')]);router['post']('/',auth[_0x7738('0x6')](),controller[_0x7738('0xb')]);router['put']('/:id',auth[_0x7738('0x6')](),controller[_0x7738('0xc')]);router[_0x7738('0xd')]('/:id',auth[_0x7738('0x6')](),controller[_0x7738('0xe')]);module[_0x7738('0xf')]=router;
\ No newline at end of file
+var _0xdb90=['/:id','show','post','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','describe'];(function(_0x28c54b,_0x124ccb){var _0x5b76b5=function(_0x3c32d7){while(--_0x3c32d7){_0x28c54b['push'](_0x28c54b['shift']());}};_0x5b76b5(++_0x124ccb);}(_0xdb90,0x6d));var _0x0db9=function(_0x21a173,_0x1f6b9a){_0x21a173=_0x21a173-0x0;var _0x244d96=_0xdb90[_0x21a173];return _0x244d96;};'use strict';var multer=require(_0x0db9('0x0'));var util=require(_0x0db9('0x1'));var path=require('path');var timeout=require(_0x0db9('0x2'));var express=require(_0x0db9('0x3'));var router=express[_0x0db9('0x4')]();var fs_extra=require(_0x0db9('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0db9('0x6'));var controller=require('./chatQueueReport.controller');router[_0x0db9('0x7')]('/',auth[_0x0db9('0x8')](),controller['index']);router['get']('/describe',auth[_0x0db9('0x8')](),controller[_0x0db9('0x9')]);router[_0x0db9('0x7')](_0x0db9('0xa'),auth[_0x0db9('0x8')](),controller[_0x0db9('0xb')]);router[_0x0db9('0xc')]('/',auth[_0x0db9('0x8')](),controller[_0x0db9('0xd')]);router[_0x0db9('0xe')]('/:id',auth[_0x0db9('0x8')](),controller[_0x0db9('0xf')]);router['delete'](_0x0db9('0xa'),auth['isAuthenticated'](),controller[_0x0db9('0x10')]);module['exports']=router;
\ No newline at end of file
index 3bc7164..3ebcedf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x38ce4c,_0xfdbe8c){var _0x5d4544=function(_0x503537){while(--_0x503537){_0x38ce4c['push'](_0x38ce4c['shift']());}};_0x5d4544(++_0xfdbe8c);}(_0xb43b,0x1b2));var _0xbb43=function(_0x202787,_0x35d489){_0x202787=_0x202787-0x0;var _0x151e66=_0xb43b[_0x202787];return _0x151e66;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
+var _0xe706=['NOW','moment','sequelize','exports','ENUM','account','agent','queue','DATE'];(function(_0x188f90,_0xa82ba3){var _0x574df5=function(_0x47b055){while(--_0x47b055){_0x188f90['push'](_0x188f90['shift']());}};_0x574df5(++_0xa82ba3);}(_0xe706,0xa3));var _0x6e70=function(_0x1f625b,_0x276b0e){_0x1f625b=_0x1f625b-0x0;var _0x748222=_0xe706[_0x1f625b];return _0x748222;};'use strict';var moment=require(_0x6e70('0x0'));var Sequelize=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6e70('0x3')](_0x6e70('0x4'),_0x6e70('0x5'),_0x6e70('0x6')),'allowNull':![],'defaultValue':_0x6e70('0x6')},'transferredAt':{'type':Sequelize[_0x6e70('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x6e70('0x8')]}};
\ No newline at end of file
index 42207a1..34393ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbe8=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','Content-Range','json','apply','save','then','destroy','name','index','ChatTransferReport','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','show','keys','find','create','catch','update','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util'];(function(_0x35d7a7,_0x1383cc){var _0x38cdf0=function(_0x36d423){while(--_0x36d423){_0x35d7a7['push'](_0x35d7a7['shift']());}};_0x38cdf0(++_0x1383cc);}(_0xcbe8,0x1e4));var _0x8cbe=function(_0x394ef9,_0x4756e6){_0x394ef9=_0x394ef9-0x0;var _0x571ea0=_0xcbe8[_0x394ef9];return _0x571ea0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8cbe('0x0'));var zipdir=require(_0x8cbe('0x1'));var jsonpatch=require(_0x8cbe('0x2'));var rp=require(_0x8cbe('0x3'));var moment=require(_0x8cbe('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8cbe('0x5'));var path=require(_0x8cbe('0x6'));var sox=require(_0x8cbe('0x7'));var csv=require(_0x8cbe('0x8'));var ejs=require(_0x8cbe('0x9'));var fs=require('fs');var fs_extra=require(_0x8cbe('0xa'));var _=require(_0x8cbe('0xb'));var squel=require('squel');var crypto=require(_0x8cbe('0xc'));var jsforce=require(_0x8cbe('0xd'));var deskjs=require(_0x8cbe('0xe'));var toCsv=require(_0x8cbe('0x8'));var querystring=require('querystring');var Papa=require(_0x8cbe('0xf'));var Redis=require(_0x8cbe('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8cbe('0x11'));var hardwareService=require(_0x8cbe('0x12'));var logger=require(_0x8cbe('0x13'))(_0x8cbe('0x14'));var utils=require(_0x8cbe('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8cbe('0x16'));var db=require(_0x8cbe('0x17'))['db'];function respondWithStatusCode(_0xb6d819,_0x2ceb7b){_0x2ceb7b=_0x2ceb7b||0xcc;return function(_0x1a546f){if(_0x1a546f){return _0xb6d819[_0x8cbe('0x18')](_0x2ceb7b);}return _0xb6d819[_0x8cbe('0x19')](_0x2ceb7b)[_0x8cbe('0x1a')]();};}function respondWithResult(_0x39640f,_0x4d6579){_0x4d6579=_0x4d6579||0xc8;return function(_0x5993ee){if(_0x5993ee){return _0x39640f[_0x8cbe('0x19')](_0x4d6579)['json'](_0x5993ee);}};}function respondWithFilteredResult(_0x564468,_0x477ce5){return function(_0x47c44e){if(_0x47c44e){var _0x3596fb=typeof _0x477ce5['offset']==='undefined'&&typeof _0x477ce5[_0x8cbe('0x1b')]===_0x8cbe('0x1c');var _0x1270dd=_0x47c44e[_0x8cbe('0x1d')];var _0x5849f6=_0x3596fb?0x0:_0x477ce5[_0x8cbe('0x1e')];var _0x469bd8=_0x3596fb?_0x47c44e[_0x8cbe('0x1d')]:_0x477ce5[_0x8cbe('0x1e')]+_0x477ce5[_0x8cbe('0x1b')];var _0x2b1073;if(_0x469bd8>=_0x1270dd){_0x469bd8=_0x1270dd;_0x2b1073=0xc8;}else{_0x2b1073=0xce;}_0x564468[_0x8cbe('0x19')](_0x2b1073);return _0x564468['set'](_0x8cbe('0x1f'),_0x5849f6+'-'+_0x469bd8+'/'+_0x1270dd)[_0x8cbe('0x20')](_0x47c44e);}return null;};}function patchUpdates(_0x12e37a){return function(_0x498825){try{jsonpatch[_0x8cbe('0x21')](_0x498825,_0x12e37a,!![]);}catch(_0x73019b){return BPromise['reject'](_0x73019b);}return _0x498825[_0x8cbe('0x22')]();};}function saveUpdates(_0x357913,_0x1aa168){return function(_0x5b973c){if(_0x5b973c){return _0x5b973c['update'](_0x357913)[_0x8cbe('0x23')](function(_0x21e567){return _0x21e567;});}return null;};}function removeEntity(_0x4587cd,_0x2ca27f){return function(_0xed33dd){if(_0xed33dd){return _0xed33dd[_0x8cbe('0x24')]()[_0x8cbe('0x23')](function(){_0x4587cd[_0x8cbe('0x19')](0xcc)[_0x8cbe('0x1a')]();});}};}function handleEntityNotFound(_0x5ed8d6,_0xf6a184){return function(_0x30c07c){if(!_0x30c07c){_0x5ed8d6[_0x8cbe('0x18')](0x194);}return _0x30c07c;};}function handleError(_0x139496,_0x47d479){_0x47d479=_0x47d479||0x1f4;return function(_0x2406bb){logger['error'](_0x2406bb['stack']);if(_0x2406bb[_0x8cbe('0x25')]){delete _0x2406bb[_0x8cbe('0x25')];}_0x139496[_0x8cbe('0x19')](_0x47d479)['send'](_0x2406bb);};}exports[_0x8cbe('0x26')]=function(_0x56b0b1,_0x3f6320){var _0x3b5cc9={},_0x56338f={},_0x51eda4={'count':0x0,'rows':[]};var _0x33813e=_['map'](db[_0x8cbe('0x27')]['rawAttributes'],function(_0x3af13b){return{'name':_0x3af13b['fieldName'],'type':_0x3af13b[_0x8cbe('0x28')][_0x8cbe('0x29')]};});_0x56338f[_0x8cbe('0x2a')]=_[_0x8cbe('0x2b')](_0x33813e,_0x8cbe('0x25'));_0x56338f[_0x8cbe('0x2c')]=_['keys'](_0x56b0b1[_0x8cbe('0x2c')]);_0x56338f[_0x8cbe('0x2d')]=_[_0x8cbe('0x2e')](_0x56338f[_0x8cbe('0x2a')],_0x56338f[_0x8cbe('0x2c')]);_0x3b5cc9[_0x8cbe('0x2f')]=_[_0x8cbe('0x2e')](_0x56338f[_0x8cbe('0x2a')],qs[_0x8cbe('0x30')](_0x56b0b1[_0x8cbe('0x2c')][_0x8cbe('0x30')]));_0x3b5cc9[_0x8cbe('0x2f')]=_0x3b5cc9[_0x8cbe('0x2f')][_0x8cbe('0x31')]?_0x3b5cc9['attributes']:_0x56338f[_0x8cbe('0x2a')];if(!_0x56b0b1[_0x8cbe('0x2c')]['hasOwnProperty'](_0x8cbe('0x32'))){_0x3b5cc9[_0x8cbe('0x1b')]=qs[_0x8cbe('0x1b')](_0x56b0b1['query'][_0x8cbe('0x1b')]);_0x3b5cc9['offset']=qs[_0x8cbe('0x1e')](_0x56b0b1[_0x8cbe('0x2c')]['offset']);}_0x3b5cc9[_0x8cbe('0x33')]=qs[_0x8cbe('0x34')](_0x56b0b1[_0x8cbe('0x2c')]['sort']);_0x3b5cc9[_0x8cbe('0x35')]=qs['filters'](_[_0x8cbe('0x36')](_0x56b0b1[_0x8cbe('0x2c')],_0x56338f[_0x8cbe('0x2d')]),_0x33813e);if(_0x56b0b1[_0x8cbe('0x2c')][_0x8cbe('0x37')]){_0x3b5cc9['where']=_['merge'](_0x3b5cc9[_0x8cbe('0x35')],{'$or':_[_0x8cbe('0x2b')](_0x33813e,function(_0x244dda){if(_0x244dda[_0x8cbe('0x28')]!==_0x8cbe('0x38')){var _0x3e3e41={};_0x3e3e41[_0x244dda[_0x8cbe('0x25')]]={'$like':'%'+_0x56b0b1[_0x8cbe('0x2c')][_0x8cbe('0x37')]+'%'};return _0x3e3e41;}})});}_0x3b5cc9=_['merge']({},_0x3b5cc9,_0x56b0b1[_0x8cbe('0x39')]);var _0x184502={'where':_0x3b5cc9[_0x8cbe('0x35')]};return db[_0x8cbe('0x27')][_0x8cbe('0x1d')](_0x184502)[_0x8cbe('0x23')](function(_0x455e63){_0x51eda4[_0x8cbe('0x1d')]=_0x455e63;if(_0x56b0b1[_0x8cbe('0x2c')][_0x8cbe('0x3a')]){_0x3b5cc9[_0x8cbe('0x3b')]=[{'all':!![]}];}return db[_0x8cbe('0x27')]['findAll'](_0x3b5cc9);})[_0x8cbe('0x23')](function(_0x2a1bd3){_0x51eda4[_0x8cbe('0x3c')]=_0x2a1bd3;return _0x51eda4;})[_0x8cbe('0x23')](respondWithFilteredResult(_0x3f6320,_0x3b5cc9))['catch'](handleError(_0x3f6320,null));};exports[_0x8cbe('0x3d')]=function(_0x3099e9,_0x5d2e64){var _0x28b65a={'raw':!![],'where':{'id':_0x3099e9['params']['id']}},_0x29efcb={};_0x29efcb[_0x8cbe('0x2a')]=_['keys'](db[_0x8cbe('0x27')]['rawAttributes']);_0x29efcb[_0x8cbe('0x2c')]=_[_0x8cbe('0x3e')](_0x3099e9[_0x8cbe('0x2c')]);_0x29efcb[_0x8cbe('0x2d')]=_[_0x8cbe('0x2e')](_0x29efcb[_0x8cbe('0x2a')],_0x29efcb[_0x8cbe('0x2c')]);_0x28b65a['attributes']=_['intersection'](_0x29efcb['model'],qs['fields'](_0x3099e9[_0x8cbe('0x2c')][_0x8cbe('0x30')]));_0x28b65a[_0x8cbe('0x2f')]=_0x28b65a[_0x8cbe('0x2f')][_0x8cbe('0x31')]?_0x28b65a[_0x8cbe('0x2f')]:_0x29efcb[_0x8cbe('0x2a')];if(_0x3099e9[_0x8cbe('0x2c')][_0x8cbe('0x3a')]){_0x28b65a['include']=[{'all':!![]}];}_0x28b65a=_['merge']({},_0x28b65a,_0x3099e9['options']);return db[_0x8cbe('0x27')][_0x8cbe('0x3f')](_0x28b65a)['then'](handleEntityNotFound(_0x5d2e64,null))[_0x8cbe('0x23')](respondWithResult(_0x5d2e64,null))['catch'](handleError(_0x5d2e64,null));};exports[_0x8cbe('0x40')]=function(_0x2ab603,_0x150334){return db[_0x8cbe('0x27')][_0x8cbe('0x40')](_0x2ab603['body'],{})['then'](respondWithResult(_0x150334,0xc9))[_0x8cbe('0x41')](handleError(_0x150334,null));};exports[_0x8cbe('0x42')]=function(_0x310277,_0x48d9dc){if(_0x310277[_0x8cbe('0x43')]['id']){delete _0x310277[_0x8cbe('0x43')]['id'];}return db[_0x8cbe('0x27')][_0x8cbe('0x3f')]({'where':{'id':_0x310277[_0x8cbe('0x44')]['id']}})['then'](handleEntityNotFound(_0x48d9dc,null))['then'](saveUpdates(_0x310277[_0x8cbe('0x43')],null))[_0x8cbe('0x23')](respondWithResult(_0x48d9dc,null))[_0x8cbe('0x41')](handleError(_0x48d9dc,null));};exports[_0x8cbe('0x24')]=function(_0xd0c356,_0x4ebedc){return db[_0x8cbe('0x27')]['find']({'where':{'id':_0xd0c356[_0x8cbe('0x44')]['id']}})[_0x8cbe('0x23')](handleEntityNotFound(_0x4ebedc,null))[_0x8cbe('0x23')](removeEntity(_0x4ebedc,null))[_0x8cbe('0x41')](handleError(_0x4ebedc,null));};exports[_0x8cbe('0x45')]=function(_0x4dadfa,_0x52efbb){return db[_0x8cbe('0x27')][_0x8cbe('0x45')]()[_0x8cbe('0x23')](respondWithResult(_0x52efbb,null))[_0x8cbe('0x41')](handleError(_0x52efbb,null));};
\ No newline at end of file
+var _0x7e06=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','show','include','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length'];(function(_0x31ead7,_0x2e9a7c){var _0x3516f0=function(_0x47fa36){while(--_0x47fa36){_0x31ead7['push'](_0x31ead7['shift']());}};_0x3516f0(++_0x2e9a7c);}(_0x7e06,0x1d6));var _0x67e0=function(_0x523ba7,_0x40a2c6){_0x523ba7=_0x523ba7-0x0;var _0x4c45ea=_0x7e06[_0x523ba7];return _0x4c45ea;};'use strict';var emlformat=require(_0x67e0('0x0'));var rimraf=require(_0x67e0('0x1'));var zipdir=require(_0x67e0('0x2'));var jsonpatch=require(_0x67e0('0x3'));var rp=require(_0x67e0('0x4'));var moment=require('moment');var BPromise=require(_0x67e0('0x5'));var Mustache=require(_0x67e0('0x6'));var util=require(_0x67e0('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x67e0('0x8'));var ejs=require(_0x67e0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x67e0('0xa'));var squel=require(_0x67e0('0xb'));var crypto=require('crypto');var jsforce=require(_0x67e0('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x67e0('0xd'));var Papa=require(_0x67e0('0xe'));var Redis=require(_0x67e0('0xf'));var authService=require(_0x67e0('0x10'));var qs=require(_0x67e0('0x11'));var as=require(_0x67e0('0x12'));var hardwareService=require(_0x67e0('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x67e0('0x14'));var config=require(_0x67e0('0x15'));var licenseUtil=require(_0x67e0('0x16'));var db=require(_0x67e0('0x17'))['db'];function respondWithStatusCode(_0x519638,_0xf5a7a2){_0xf5a7a2=_0xf5a7a2||0xcc;return function(_0x198ed2){if(_0x198ed2){return _0x519638['sendStatus'](_0xf5a7a2);}return _0x519638[_0x67e0('0x18')](_0xf5a7a2)[_0x67e0('0x19')]();};}function respondWithResult(_0x283fdc,_0x379aaf){_0x379aaf=_0x379aaf||0xc8;return function(_0x3cd5a3){if(_0x3cd5a3){return _0x283fdc[_0x67e0('0x18')](_0x379aaf)['json'](_0x3cd5a3);}};}function respondWithFilteredResult(_0x568ae2,_0x5456c5){return function(_0x44cf77){if(_0x44cf77){var _0x7db199=typeof _0x5456c5[_0x67e0('0x1a')]===_0x67e0('0x1b')&&typeof _0x5456c5[_0x67e0('0x1c')]==='undefined';var _0x3ebad5=_0x44cf77[_0x67e0('0x1d')];var _0x5270f3=_0x7db199?0x0:_0x5456c5[_0x67e0('0x1a')];var _0x2ca948=_0x7db199?_0x44cf77[_0x67e0('0x1d')]:_0x5456c5[_0x67e0('0x1a')]+_0x5456c5[_0x67e0('0x1c')];var _0x10a749;if(_0x2ca948>=_0x3ebad5){_0x2ca948=_0x3ebad5;_0x10a749=0xc8;}else{_0x10a749=0xce;}_0x568ae2[_0x67e0('0x18')](_0x10a749);return _0x568ae2[_0x67e0('0x1e')]('Content-Range',_0x5270f3+'-'+_0x2ca948+'/'+_0x3ebad5)['json'](_0x44cf77);}return null;};}function patchUpdates(_0x3fae26){return function(_0x1a4567){try{jsonpatch['apply'](_0x1a4567,_0x3fae26,!![]);}catch(_0x3ece77){return BPromise[_0x67e0('0x1f')](_0x3ece77);}return _0x1a4567[_0x67e0('0x20')]();};}function saveUpdates(_0x3d9d3e,_0x4ace72){return function(_0x42e99c){if(_0x42e99c){return _0x42e99c[_0x67e0('0x21')](_0x3d9d3e)[_0x67e0('0x22')](function(_0x67b71){return _0x67b71;});}return null;};}function removeEntity(_0xd60cdd,_0x2630b8){return function(_0x3f9b18){if(_0x3f9b18){return _0x3f9b18[_0x67e0('0x23')]()[_0x67e0('0x22')](function(){_0xd60cdd[_0x67e0('0x18')](0xcc)[_0x67e0('0x19')]();});}};}function handleEntityNotFound(_0x18066d,_0xa31093){return function(_0x24527d){if(!_0x24527d){_0x18066d[_0x67e0('0x24')](0x194);}return _0x24527d;};}function handleError(_0x69aa2d,_0x456be6){_0x456be6=_0x456be6||0x1f4;return function(_0x216ae7){logger[_0x67e0('0x25')](_0x216ae7[_0x67e0('0x26')]);if(_0x216ae7['name']){delete _0x216ae7[_0x67e0('0x27')];}_0x69aa2d['status'](_0x456be6)[_0x67e0('0x28')](_0x216ae7);};}exports[_0x67e0('0x29')]=function(_0x240a2c,_0x3ad743){var _0x17debb={},_0x149d2c={},_0x1055fd={'count':0x0,'rows':[]};var _0x5c221d=_[_0x67e0('0x2a')](db[_0x67e0('0x2b')][_0x67e0('0x2c')],function(_0x4a6efe){return{'name':_0x4a6efe['fieldName'],'type':_0x4a6efe[_0x67e0('0x2d')][_0x67e0('0x2e')]};});_0x149d2c['model']=_[_0x67e0('0x2a')](_0x5c221d,'name');_0x149d2c[_0x67e0('0x2f')]=_[_0x67e0('0x30')](_0x240a2c['query']);_0x149d2c[_0x67e0('0x31')]=_['intersection'](_0x149d2c[_0x67e0('0x32')],_0x149d2c['query']);_0x17debb[_0x67e0('0x33')]=_[_0x67e0('0x34')](_0x149d2c[_0x67e0('0x32')],qs[_0x67e0('0x35')](_0x240a2c[_0x67e0('0x2f')][_0x67e0('0x35')]));_0x17debb['attributes']=_0x17debb[_0x67e0('0x33')][_0x67e0('0x36')]?_0x17debb['attributes']:_0x149d2c['model'];if(!_0x240a2c[_0x67e0('0x2f')][_0x67e0('0x37')](_0x67e0('0x38'))){_0x17debb[_0x67e0('0x1c')]=qs[_0x67e0('0x1c')](_0x240a2c[_0x67e0('0x2f')]['limit']);_0x17debb[_0x67e0('0x1a')]=qs[_0x67e0('0x1a')](_0x240a2c[_0x67e0('0x2f')][_0x67e0('0x1a')]);}_0x17debb[_0x67e0('0x39')]=qs[_0x67e0('0x3a')](_0x240a2c[_0x67e0('0x2f')][_0x67e0('0x3a')]);_0x17debb[_0x67e0('0x3b')]=qs['filters'](_[_0x67e0('0x3c')](_0x240a2c[_0x67e0('0x2f')],_0x149d2c[_0x67e0('0x31')]),_0x5c221d);if(_0x240a2c[_0x67e0('0x2f')][_0x67e0('0x3d')]){_0x17debb[_0x67e0('0x3b')]=_[_0x67e0('0x3e')](_0x17debb[_0x67e0('0x3b')],{'$or':_['map'](_0x5c221d,function(_0x3fa7db){if(_0x3fa7db['type']!=='VIRTUAL'){var _0x132264={};_0x132264[_0x3fa7db[_0x67e0('0x27')]]={'$like':'%'+_0x240a2c[_0x67e0('0x2f')]['filter']+'%'};return _0x132264;}})});}_0x17debb=_[_0x67e0('0x3e')]({},_0x17debb,_0x240a2c[_0x67e0('0x3f')]);var _0x4d344e={'where':_0x17debb[_0x67e0('0x3b')]};return db[_0x67e0('0x2b')][_0x67e0('0x1d')](_0x4d344e)[_0x67e0('0x22')](function(_0x1bd8e7){_0x1055fd[_0x67e0('0x1d')]=_0x1bd8e7;if(_0x240a2c[_0x67e0('0x2f')][_0x67e0('0x40')]){_0x17debb['include']=[{'all':!![]}];}return db[_0x67e0('0x2b')][_0x67e0('0x41')](_0x17debb);})['then'](function(_0x508371){_0x1055fd[_0x67e0('0x42')]=_0x508371;return _0x1055fd;})[_0x67e0('0x22')](respondWithFilteredResult(_0x3ad743,_0x17debb))['catch'](handleError(_0x3ad743,null));};exports[_0x67e0('0x43')]=function(_0x2e3004,_0x47972e){var _0x1f3165={'raw':!![],'where':{'id':_0x2e3004['params']['id']}},_0x510d21={};_0x510d21['model']=_[_0x67e0('0x30')](db[_0x67e0('0x2b')][_0x67e0('0x2c')]);_0x510d21[_0x67e0('0x2f')]=_[_0x67e0('0x30')](_0x2e3004[_0x67e0('0x2f')]);_0x510d21[_0x67e0('0x31')]=_[_0x67e0('0x34')](_0x510d21[_0x67e0('0x32')],_0x510d21['query']);_0x1f3165['attributes']=_[_0x67e0('0x34')](_0x510d21[_0x67e0('0x32')],qs['fields'](_0x2e3004[_0x67e0('0x2f')][_0x67e0('0x35')]));_0x1f3165[_0x67e0('0x33')]=_0x1f3165[_0x67e0('0x33')][_0x67e0('0x36')]?_0x1f3165[_0x67e0('0x33')]:_0x510d21[_0x67e0('0x32')];if(_0x2e3004['query']['includeAll']){_0x1f3165[_0x67e0('0x44')]=[{'all':!![]}];}_0x1f3165=_[_0x67e0('0x3e')]({},_0x1f3165,_0x2e3004[_0x67e0('0x3f')]);return db['ChatTransferReport'][_0x67e0('0x45')](_0x1f3165)[_0x67e0('0x22')](handleEntityNotFound(_0x47972e,null))['then'](respondWithResult(_0x47972e,null))[_0x67e0('0x46')](handleError(_0x47972e,null));};exports[_0x67e0('0x47')]=function(_0x15db0d,_0x554baa){return db[_0x67e0('0x2b')][_0x67e0('0x47')](_0x15db0d[_0x67e0('0x48')],{})['then'](respondWithResult(_0x554baa,0xc9))[_0x67e0('0x46')](handleError(_0x554baa,null));};exports[_0x67e0('0x21')]=function(_0x125676,_0x2f7e65){if(_0x125676[_0x67e0('0x48')]['id']){delete _0x125676[_0x67e0('0x48')]['id'];}return db['ChatTransferReport'][_0x67e0('0x45')]({'where':{'id':_0x125676[_0x67e0('0x49')]['id']}})[_0x67e0('0x22')](handleEntityNotFound(_0x2f7e65,null))['then'](saveUpdates(_0x125676['body'],null))[_0x67e0('0x22')](respondWithResult(_0x2f7e65,null))[_0x67e0('0x46')](handleError(_0x2f7e65,null));};exports['destroy']=function(_0x23e29b,_0x4019d){return db['ChatTransferReport'][_0x67e0('0x45')]({'where':{'id':_0x23e29b[_0x67e0('0x49')]['id']}})[_0x67e0('0x22')](handleEntityNotFound(_0x4019d,null))[_0x67e0('0x22')](removeEntity(_0x4019d,null))[_0x67e0('0x46')](handleError(_0x4019d,null));};exports[_0x67e0('0x4a')]=function(_0x2acd45,_0x4dd803){return db[_0x67e0('0x2b')][_0x67e0('0x4a')]()[_0x67e0('0x22')](respondWithResult(_0x4dd803,null))['catch'](handleError(_0x4dd803,null));};
\ No newline at end of file
index 0aab79d..dc1c99c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12c8=['path','../../config/environment','ChatTransferReport','report_chat_transfer','uniqueid','lodash','moment','bluebird','request-promise'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0x12c8,0x1be));var _0x812c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12c8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x812c('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x812c('0x1'));var BPromise=require(_0x812c('0x2'));var rp=require(_0x812c('0x3'));var fs=require('fs');var path=require(_0x812c('0x4'));var rimraf=require('rimraf');var config=require(_0x812c('0x5'));var attributes=require('./chatTransferReport.attributes');module['exports']=function(_0x50853f,_0x3e5d43){return _0x50853f['define'](_0x812c('0x6'),attributes,{'tableName':_0x812c('0x7'),'paranoid':![],'indexes':[{'name':_0x812c('0x8'),'fields':[_0x812c('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xda9e=['report_chat_transfer','uniqueid','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport'];(function(_0x17527f,_0x194435){var _0x2ccfa6=function(_0xd753f6){while(--_0xd753f6){_0x17527f['push'](_0x17527f['shift']());}};_0x2ccfa6(++_0x194435);}(_0xda9e,0x195));var _0xeda9=function(_0x2a7bf1,_0x2c1220){_0x2a7bf1=_0x2a7bf1-0x0;var _0x4d5458=_0xda9e[_0x2a7bf1];return _0x4d5458;};'use strict';var _=require('lodash');var util=require(_0xeda9('0x0'));var logger=require(_0xeda9('0x1'))(_0xeda9('0x2'));var moment=require(_0xeda9('0x3'));var BPromise=require('bluebird');var rp=require(_0xeda9('0x4'));var fs=require('fs');var path=require(_0xeda9('0x5'));var rimraf=require('rimraf');var config=require(_0xeda9('0x6'));var attributes=require(_0xeda9('0x7'));module[_0xeda9('0x8')]=function(_0x4fe61e,_0x1badf0){return _0x4fe61e[_0xeda9('0x9')](_0xeda9('0xa'),attributes,{'tableName':_0xeda9('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xeda9('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 4c6c8ed..64125bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b86=['message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5ad794,_0x330eb1){var _0x58d45e=function(_0x28c899){while(--_0x28c899){_0x5ad794['push'](_0x5ad794['shift']());}};_0x58d45e(++_0x330eb1);}(_0x1b86,0x163));var _0x61b8=function(_0x588828,_0x4dad43){_0x588828=_0x588828-0x0;var _0x15117f=_0x1b86[_0x588828];return _0x15117f;};'use strict';var _=require(_0x61b8('0x0'));var util=require(_0x61b8('0x1'));var moment=require(_0x61b8('0x2'));var BPromise=require(_0x61b8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x61b8('0x4'))['db'];var utils=require(_0x61b8('0x5'));var logger=require(_0x61b8('0x6'))(_0x61b8('0x7'));var config=require(_0x61b8('0x8'));var jayson=require(_0x61b8('0x9'));var client=jayson[_0x61b8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23d5a5,_0x443d46,_0x2d4e0){return new BPromise(function(_0x38eecb,_0x11344c){return client['request'](_0x23d5a5,_0x2d4e0)['then'](function(_0x5c9522){logger[_0x61b8('0xb')](_0x61b8('0xc'),_0x443d46,_0x61b8('0xd'));logger[_0x61b8('0xe')](_0x61b8('0xf'),_0x443d46,'request\x20sent',JSON[_0x61b8('0x10')](_0x5c9522));if(_0x5c9522[_0x61b8('0x11')]){if(_0x5c9522[_0x61b8('0x11')][_0x61b8('0x12')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x443d46,_0x5c9522[_0x61b8('0x11')][_0x61b8('0x13')]);return _0x11344c(_0x5c9522[_0x61b8('0x11')][_0x61b8('0x13')]);}logger[_0x61b8('0x11')](_0x61b8('0xc'),_0x443d46,_0x5c9522[_0x61b8('0x11')][_0x61b8('0x13')]);return _0x38eecb(_0x5c9522[_0x61b8('0x11')]['message']);}else{logger[_0x61b8('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x443d46,_0x61b8('0xd'));_0x38eecb(_0x5c9522[_0x61b8('0x14')]['message']);}})[_0x61b8('0x15')](function(_0x350316){logger[_0x61b8('0x11')](_0x61b8('0xc'),_0x443d46,_0x350316);_0x11344c(_0x350316);});});}
\ No newline at end of file
+var _0xa19a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x2867f0,_0x1e5c4a){var _0x31b383=function(_0x59ccef){while(--_0x59ccef){_0x2867f0['push'](_0x2867f0['shift']());}};_0x31b383(++_0x1e5c4a);}(_0xa19a,0x14b));var _0xaa19=function(_0x377a56,_0x5d3477){_0x377a56=_0x377a56-0x0;var _0x558cbf=_0xa19a[_0x377a56];return _0x558cbf;};'use strict';var _=require(_0xaa19('0x0'));var util=require(_0xaa19('0x1'));var moment=require(_0xaa19('0x2'));var BPromise=require(_0xaa19('0x3'));var rs=require(_0xaa19('0x4'));var fs=require('fs');var Redis=require(_0xaa19('0x5'));var db=require(_0xaa19('0x6'))['db'];var utils=require(_0xaa19('0x7'));var logger=require(_0xaa19('0x8'))(_0xaa19('0x9'));var config=require(_0xaa19('0xa'));var jayson=require(_0xaa19('0xb'));var client=jayson[_0xaa19('0xc')][_0xaa19('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4d797c,_0xf09dd3,_0x6612cf){return new BPromise(function(_0x2f8854,_0x369a55){return client[_0xaa19('0xe')](_0x4d797c,_0x6612cf)['then'](function(_0x81fcdd){logger[_0xaa19('0xf')](_0xaa19('0x10'),_0xf09dd3,'request\x20sent');logger['debug'](_0xaa19('0x11'),_0xf09dd3,_0xaa19('0x12'),JSON[_0xaa19('0x13')](_0x81fcdd));if(_0x81fcdd[_0xaa19('0x14')]){if(_0x81fcdd['error']['code']===0x1f4){logger[_0xaa19('0x14')](_0xaa19('0x10'),_0xf09dd3,_0x81fcdd[_0xaa19('0x14')][_0xaa19('0x15')]);return _0x369a55(_0x81fcdd[_0xaa19('0x14')][_0xaa19('0x15')]);}logger['error'](_0xaa19('0x10'),_0xf09dd3,_0x81fcdd[_0xaa19('0x14')][_0xaa19('0x15')]);return _0x2f8854(_0x81fcdd[_0xaa19('0x14')][_0xaa19('0x15')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0xf09dd3,_0xaa19('0x12'));_0x2f8854(_0x81fcdd[_0xaa19('0x16')][_0xaa19('0x15')]);}})[_0xaa19('0x17')](function(_0x40944c){logger[_0xaa19('0x14')](_0xaa19('0x10'),_0xf09dd3,_0x40944c);_0x369a55(_0x40944c);});});}
\ No newline at end of file
index dee0191..fac7062 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf64c=['./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x13d82c,_0x4f9f64){var _0x2ba899=function(_0x520617){while(--_0x520617){_0x13d82c['push'](_0x13d82c['shift']());}};_0x2ba899(++_0x4f9f64);}(_0xf64c,0x125));var _0xcf64=function(_0x361367,_0x2b888d){_0x361367=_0x361367-0x0;var _0x1fe5ff=_0xf64c[_0x361367];return _0x1fe5ff;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcf64('0x0'));var timeout=require(_0xcf64('0x1'));var express=require(_0xcf64('0x2'));var router=express[_0xcf64('0x3')]();var fs_extra=require(_0xcf64('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcf64('0x5'));var config=require(_0xcf64('0x6'));var controller=require(_0xcf64('0x7'));router[_0xcf64('0x8')]('/',auth[_0xcf64('0x9')](),controller[_0xcf64('0xa')]);router[_0xcf64('0x8')](_0xcf64('0xb'),auth[_0xcf64('0x9')](),controller[_0xcf64('0xc')]);router['get'](_0xcf64('0xd'),auth[_0xcf64('0x9')](),controller['show']);router['post']('/',auth[_0xcf64('0x9')](),controller[_0xcf64('0xe')]);router[_0xcf64('0xf')](_0xcf64('0xd'),auth['isAuthenticated'](),controller[_0xcf64('0x10')]);router[_0xcf64('0x11')](_0xcf64('0xd'),auth[_0xcf64('0x9')](),controller[_0xcf64('0x12')]);module[_0xcf64('0x13')]=router;
\ No newline at end of file
+var _0xef29=['put','update','/:id','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create'];(function(_0x37ad39,_0x5909d4){var _0x29fed5=function(_0x4a753c){while(--_0x4a753c){_0x37ad39['push'](_0x37ad39['shift']());}};_0x29fed5(++_0x5909d4);}(_0xef29,0x12a));var _0x9ef2=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xef29[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0x9ef2('0x0'));var util=require(_0x9ef2('0x1'));var path=require(_0x9ef2('0x2'));var timeout=require('connect-timeout');var express=require(_0x9ef2('0x3'));var router=express[_0x9ef2('0x4')]();var fs_extra=require(_0x9ef2('0x5'));var auth=require(_0x9ef2('0x6'));var interaction=require(_0x9ef2('0x7'));var config=require('../../config/environment');var controller=require(_0x9ef2('0x8'));router['get']('/',auth[_0x9ef2('0x9')](),controller[_0x9ef2('0xa')]);router[_0x9ef2('0xb')](_0x9ef2('0xc'),auth['isAuthenticated'](),controller[_0x9ef2('0xd')]);router[_0x9ef2('0xb')]('/:id',auth[_0x9ef2('0x9')](),controller[_0x9ef2('0xe')]);router[_0x9ef2('0xf')]('/',auth[_0x9ef2('0x9')](),controller[_0x9ef2('0x10')]);router[_0x9ef2('0x11')]('/:id',auth[_0x9ef2('0x9')](),controller[_0x9ef2('0x12')]);router['delete'](_0x9ef2('0x13'),auth[_0x9ef2('0x9')](),controller['destroy']);module[_0x9ef2('0x14')]=router;
\ No newline at end of file
index 799dcb4..84fffbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','rounded','squared','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right'];(function(_0xedb29f,_0x18fa51){var _0xdee9a=function(_0xe2df8b){while(--_0xe2df8b){_0xedb29f['push'](_0xedb29f['shift']());}};_0xdee9a(++_0x18fa51);}(_0x54ef,0x112));var _0xf54e=function(_0x5cd829,_0x17d802){_0x5cd829=_0x5cd829-0x0;var _0x22db18=_0x54ef[_0x5cd829];return _0x22db18;};'use strict';var Sequelize=require(_0xf54e('0x0'));var rs=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'unique':_0xf54e('0x4')},'description':{'type':Sequelize[_0xf54e('0x3')]},'mapKey':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x5')},'mapKeyOffline':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0x6')},'customerAlias':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'defaultValue':_0xf54e('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf54e('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf54e('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf54e('0x3')]},'animation':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xf54e('0xa'),_0xf54e('0xb')),'defaultValue':_0xf54e('0xa')},'header_online':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0xc')},'header_offline':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0xd')},'download_transcript':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xf54e('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x11')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x12')},'placeholderMessage':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x13')},'closingMessage':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x14')},'closingMessageButton':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0xc')},'skipMessageButton':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x15')},'conditionAgreement':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0x16')},'ratingType':{'type':Sequelize[_0xf54e('0x17')](_0xf54e('0x18'),_0xf54e('0x19')),'defaultValue':_0xf54e('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xf54e('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xf54e('0xf')],'defaultValue':function(){return JSON[_0xf54e('0x1a')]({'items':[{'type':_0xf54e('0x1b'),'variable':null,'config':{'placeholder':_0xf54e('0x1c'),'type':_0xf54e('0x1d'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xf54e('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xf54e('0x5'),'type':_0xf54e('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf54e('0x1e')](_0xf54e('0x1f'))?JSON[_0xf54e('0x20')](this[_0xf54e('0x1e')](_0xf54e('0x1f'))):{};},'set':function(_0x43488d){return this[_0xf54e('0x21')](_0xf54e('0x1f'),JSON[_0xf54e('0x1a')](_0x43488d));}},'offlineForm':{'type':Sequelize[_0xf54e('0xf')],'defaultValue':function(){return JSON[_0xf54e('0x1a')]({'items':[{'type':'input','props':{'title':_0xf54e('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xf54e('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0xf54e('0x22')},'props':{'title':_0xf54e('0x22'),'helpText':_0xf54e('0x23')}}],'fromKey':0x0});},'get':function(){return this[_0xf54e('0x1e')](_0xf54e('0x24'))?JSON[_0xf54e('0x20')](this[_0xf54e('0x1e')]('offlineForm')):{};},'set':function(_0x4b3c73){return this[_0xf54e('0x21')](_0xf54e('0x24'),JSON[_0xf54e('0x1a')](_0x4b3c73));}},'token':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':function(){return rs[_0xf54e('0x25')]();}},'autoclose':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xf54e('0x3')]},'forwardOffline':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xf54e('0x26')},'waitingMessage':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x27')},'offlineMessageBody':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x15')},'sendUnmanaged':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xf54e('0xf')],'defaultValue':function(){return _0xf54e('0x29');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2b')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2c')},'messagesAlignment':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2d')},'defaultTitle':{'type':Sequelize[_0xf54e('0x3')]},'customerAvatar':{'type':Sequelize[_0xf54e('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf54e('0x3')],'allowNull':![],'defaultValue':_0xf54e('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf54e('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':_0xf54e('0x2f')},'systemAvatar':{'type':Sequelize[_0xf54e('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf54e('0x8')],'comment':_0xf54e('0x30')},'mandatoryDisposition':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![],'comment':_0xf54e('0x31'),'set':function(_0x2087b3){if(!_0x2087b3)this[_0xf54e('0x21')](_0xf54e('0x32'),null);this[_0xf54e('0x21')](_0xf54e('0x33'),_0x2087b3);}},'vidaooEscalation':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xf54e('0x3')],'defaultValue':function(){return _0xf54e('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf54e('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf54e('0xf')]}};
\ No newline at end of file
+var _0xb821=['All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','address','email','STRING','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','input','text','name','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','parse','generate'];(function(_0xe4a5ce,_0xb35d50){var _0x22133e=function(_0x2b4c14){while(--_0x2b4c14){_0xe4a5ce['push'](_0xe4a5ce['shift']());}};_0x22133e(++_0xb35d50);}(_0xb821,0xa7));var _0x1b82=function(_0x17ef4a,_0x354902){_0x17ef4a=_0x17ef4a-0x0;var _0xe65f66=_0xb821[_0x17ef4a];return _0xe65f66;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x1b82('0x0'));module[_0x1b82('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1b82('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x3')},'mapKeyOffline':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x3')},'key':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x5')},'customerAlias':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1b82('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1b82('0x4')]},'animation':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1b82('0xa')](_0x1b82('0xb'),_0x1b82('0xc')),'defaultValue':_0x1b82('0xb')},'header_online':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0xd')},'offline_chat_button':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0xe')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1b82('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x12')},'placeholderMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x13')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0xe')},'skipMessageButton':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x14')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x15')},'ratingType':{'type':Sequelize['ENUM'](_0x1b82('0x16'),_0x1b82('0x17')),'defaultValue':_0x1b82('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x1b82('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x1b82('0x10')],'defaultValue':function(){return JSON[_0x1b82('0x18')]({'items':[{'type':_0x1b82('0x19'),'variable':null,'config':{'placeholder':'name','type':_0x1b82('0x1a'),'required':!![]},'props':{'title':_0x1b82('0x1b'),'helpText':''}},{'type':'input','props':{'title':_0x1b82('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x1b82('0x3'),'type':_0x1b82('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x1b82('0x1c'))?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0xf2e556){return this[_0x1b82('0x1d')](_0x1b82('0x1c'),JSON[_0x1b82('0x18')](_0xf2e556));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x1b82('0x18')]({'items':[{'type':_0x1b82('0x19'),'props':{'title':_0x1b82('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x1b82('0x3'),'type':_0x1b82('0x3')},'variable':null},{'type':_0x1b82('0x1e'),'config':{'placeholder':_0x1b82('0x1f')},'props':{'title':_0x1b82('0x1f'),'helpText':_0x1b82('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x1b82('0x21')](_0x1b82('0x22'))?JSON[_0x1b82('0x23')](this[_0x1b82('0x21')]('offlineForm')):{};},'set':function(_0x17b3aa){return this[_0x1b82('0x1d')](_0x1b82('0x22'),JSON[_0x1b82('0x18')](_0x17b3aa));}},'token':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':function(){return rs[_0x1b82('0x24')]();}},'autoclose':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1b82('0x4')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x1b82('0x4')]},'waitingTitle':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x25')},'waitingMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x14')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x1b82('0x10')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1b82('0x4')]},'notificationTemplate':{'type':Sequelize[_0x1b82('0x10')],'defaultValue':function(){return _0x1b82('0x28');}},'notificationSound':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x1b82('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x2b')},'messagesAlignment':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x2c')},'defaultTitle':{'type':Sequelize[_0x1b82('0x4')]},'customerAvatar':{'type':Sequelize[_0x1b82('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x1b82('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':_0x1b82('0x2d')},'systemAvatar':{'type':Sequelize[_0x1b82('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1b82('0x8')],'comment':_0x1b82('0x2e')},'mandatoryDisposition':{'type':Sequelize[_0x1b82('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x17d214){if(!_0x17d214)this['setDataValue'](_0x1b82('0x2f'),null);this['setDataValue'](_0x1b82('0x30'),_0x17d214);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x1b82('0x4')],'allowNull':![],'defaultValue':_0x1b82('0x31')},'vidaooNote':{'type':Sequelize[_0x1b82('0x4')],'defaultValue':function(){return _0x1b82('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x1b82('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x1b82('0x10')]}};
\ No newline at end of file
index 5d7c958..0db24bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3386=['some','readFileSync','stringify','x-real-ip','remoteAddress','alignment','verticalAlignment','textColor','textButtonColor','color_button','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','ChatApplication','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','online','false','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','path','ejs','fs-extra','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','html-to-text','jayson/promise','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','undefined','limit','count','offset','Content-Range','json','destroy','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','join','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','account','applications','Applications','list','orderBy','priority','asc','mapKey','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','x-real-port','referer','browser','format','%s\x20%s','unknown','version','device','vendor','threadId','ChatInteraction','externalUrl','interaction','spread','firstName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','files','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','MailAccountId','originalname','subjectOffline','toPairsIn','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','increment','chatLicenseExceeded','Intervals','all'];(function(_0x534c16,_0x4f3d34){var _0x54cbad=function(_0x97ba34){while(--_0x97ba34){_0x534c16['push'](_0x534c16['shift']());}};_0x54cbad(++_0x4f3d34);}(_0x3386,0x145));var _0x6338=function(_0xe27035,_0x1f4876){_0xe27035=_0xe27035-0x0;var _0x3745bc=_0x3386[_0xe27035];return _0x3745bc;};'use strict';var BPromise=require(_0x6338('0x0'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6338('0x1'));var ejs=require(_0x6338('0x2'));var fs=require('fs');var fs_extra=require(_0x6338('0x3'));var _=require(_0x6338('0x4'));var querystring=require('querystring');var Redis=require('ioredis');var qs=require(_0x6338('0x5'));var logger=require(_0x6338('0x6'))(_0x6338('0x7'));var config=require('../../config/environment');var db=require(_0x6338('0x8'))['db'];config[_0x6338('0x9')]=_[_0x6338('0xa')](config[_0x6338('0x9')],{'host':_0x6338('0xb'),'port':0x18eb});var socket=require(_0x6338('0xc'))(new Redis(config[_0x6338('0x9')]));require('./chatWebsite.socket')[_0x6338('0xd')](socket);var htmlToText=require(_0x6338('0xe'));var jayson=require(_0x6338('0xf'));var client=jayson[_0x6338('0x10')][_0x6338('0x11')]({'port':0x232c});var client9002=jayson[_0x6338('0x10')][_0x6338('0x11')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0x6338('0x10')][_0x6338('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x124127,_0x17ee6f,_0x25acef,_0x1d76ae){return new BPromise(function(_0x38202d,_0x3f94c5){var _0xb246b1=_0x1d76ae||client;return _0xb246b1[_0x6338('0x12')](_0x124127,_0x25acef)[_0x6338('0x13')](function(_0x5112f4){logger[_0x6338('0x14')](_0x6338('0x15'),_0x17ee6f,_0x6338('0x16'));logger['debug'](_0x6338('0x17'),_0x17ee6f,_0x6338('0x16'),JSON['stringify'](_0x5112f4));if(_0x5112f4['error']){if(_0x5112f4[_0x6338('0x18')][_0x6338('0x19')]===0x1f4){logger[_0x6338('0x18')](_0x6338('0x15'),_0x17ee6f,_0x5112f4[_0x6338('0x18')][_0x6338('0x1a')]);return _0x3f94c5(_0x5112f4[_0x6338('0x18')]['message']);}logger[_0x6338('0x18')](_0x6338('0x15'),_0x17ee6f,_0x5112f4[_0x6338('0x18')][_0x6338('0x1a')]);return _0x38202d(_0x5112f4['error'][_0x6338('0x1a')]);}else{logger['info'](_0x6338('0x15'),_0x17ee6f,_0x6338('0x16'));_0x38202d(_0x5112f4[_0x6338('0x1b')]['message']);}})[_0x6338('0x1c')](function(_0xa8ef97){logger[_0x6338('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x17ee6f,_0xa8ef97);_0x3f94c5(_0xa8ef97);});});}function respondWithStatusCode(_0x250e98,_0x189cc2){_0x189cc2=_0x189cc2||0xcc;return function(_0x2c0f03){if(_0x2c0f03){return _0x250e98[_0x6338('0x1d')](_0x189cc2);}return _0x250e98[_0x6338('0x1e')](_0x189cc2)['end']();};}function respondWithResult(_0x5e78ef,_0x23ac9a){_0x23ac9a=_0x23ac9a||0xc8;return function(_0x22c026){if(_0x22c026){return _0x5e78ef[_0x6338('0x1e')](_0x23ac9a)['json'](_0x22c026);}};}function respondWithFilteredResult(_0x268e64,_0x148721){return function(_0x36c6c8){if(_0x36c6c8){var _0x3fe509=typeof _0x148721['offset']===_0x6338('0x1f')&&typeof _0x148721[_0x6338('0x20')]===_0x6338('0x1f');var _0x16df91=_0x36c6c8[_0x6338('0x21')];var _0x268e24=_0x3fe509?0x0:_0x148721['offset'];var _0x39e620=_0x3fe509?_0x36c6c8[_0x6338('0x21')]:_0x148721[_0x6338('0x22')]+_0x148721[_0x6338('0x20')];var _0x45a726;if(_0x39e620>=_0x16df91){_0x39e620=_0x16df91;_0x45a726=0xc8;}else{_0x45a726=0xce;}_0x268e64['status'](_0x45a726);return _0x268e64['set'](_0x6338('0x23'),_0x268e24+'-'+_0x39e620+'/'+_0x16df91)[_0x6338('0x24')](_0x36c6c8);}return null;};}function saveUpdates(_0x1e2599){return function(_0x325f4f){if(_0x325f4f){return _0x325f4f['update'](_0x1e2599)[_0x6338('0x13')](function(_0x157c30){return _0x157c30;});}return null;};}function removeEntity(_0x424722){return function(_0x295a4c){if(_0x295a4c){return _0x295a4c[_0x6338('0x25')]()[_0x6338('0x13')](function(){var _0x3e9907=_0x295a4c['get']({'plain':!![]});var _0x5cbab6=_0x6338('0x26');return db[_0x6338('0x27')]['destroy']({'where':{'type':_0x5cbab6,'resourceId':_0x3e9907['id']}})['then'](function(){return _0x295a4c;});})[_0x6338('0x13')](function(){_0x424722['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9bc2a5){return function(_0x5f5808){if(!_0x5f5808){_0x9bc2a5[_0x6338('0x1d')](0x194);}return _0x5f5808;};}function handleError(_0x17af72,_0x2774c7){_0x2774c7=_0x2774c7||0x1f4;return function(_0x5270d9){logger[_0x6338('0x18')](_0x5270d9[_0x6338('0x28')]);if(_0x5270d9[_0x6338('0x29')]){delete _0x5270d9['name'];}_0x17af72[_0x6338('0x1e')](_0x2774c7)['send'](_0x5270d9);};}exports[_0x6338('0x2a')]=function(_0x18200c,_0x14b64d){var _0x6a071d={'include':[{'model':db[_0x6338('0x2b')],'as':_0x6338('0x2c')}]},_0x607e86={},_0x331ef6={'count':0x0,'rows':[]};var _0x123f70=_[_0x6338('0x2d')](db[_0x6338('0x2e')]['rawAttributes'],function(_0x3226c5){return{'name':_0x3226c5[_0x6338('0x2f')],'type':_0x3226c5[_0x6338('0x30')][_0x6338('0x31')]};});_0x607e86[_0x6338('0x32')]=_[_0x6338('0x2d')](_0x123f70,'name');_0x607e86[_0x6338('0x33')]=_[_0x6338('0x34')](_0x18200c[_0x6338('0x33')]);_0x607e86['filters']=_[_0x6338('0x35')](_0x607e86[_0x6338('0x32')],_0x607e86[_0x6338('0x33')]);_0x6a071d['attributes']=_[_0x6338('0x35')](_0x607e86[_0x6338('0x32')],qs[_0x6338('0x36')](_0x18200c[_0x6338('0x33')][_0x6338('0x36')]));_0x6a071d[_0x6338('0x37')]=_0x6a071d[_0x6338('0x37')][_0x6338('0x38')]?_0x6a071d[_0x6338('0x37')]:_0x607e86[_0x6338('0x32')];if(!_0x18200c[_0x6338('0x33')][_0x6338('0x39')](_0x6338('0x3a'))){_0x6a071d[_0x6338('0x20')]=qs[_0x6338('0x20')](_0x18200c[_0x6338('0x33')][_0x6338('0x20')]);_0x6a071d[_0x6338('0x22')]=qs[_0x6338('0x22')](_0x18200c[_0x6338('0x33')][_0x6338('0x22')]);}_0x6a071d[_0x6338('0x3b')]=qs[_0x6338('0x3c')](_0x18200c[_0x6338('0x33')][_0x6338('0x3c')]);_0x6a071d['where']=qs[_0x6338('0x3d')](_[_0x6338('0x3e')](_0x18200c[_0x6338('0x33')],_0x607e86[_0x6338('0x3d')]),_0x123f70);if(_0x18200c[_0x6338('0x33')]['filter']){_0x6a071d[_0x6338('0x3f')]=_[_0x6338('0x40')](_0x6a071d['where'],{'$or':_[_0x6338('0x2d')](_0x123f70,function(_0x5d1e18){if(_0x5d1e18[_0x6338('0x30')]!==_0x6338('0x41')){var _0x3c829e={};_0x3c829e[_0x5d1e18[_0x6338('0x29')]]={'$like':'%'+_0x18200c[_0x6338('0x33')][_0x6338('0x42')]+'%'};return _0x3c829e;}})});}_0x6a071d=_['merge']({},_0x6a071d,_0x18200c[_0x6338('0x43')]);var _0x4ebb38={'where':_0x6a071d[_0x6338('0x3f')]};return db['ChatWebsite'][_0x6338('0x21')](_0x4ebb38)[_0x6338('0x13')](function(_0x283cca){_0x331ef6[_0x6338('0x21')]=_0x283cca;if(_0x18200c[_0x6338('0x33')][_0x6338('0x44')]){_0x6a071d['include']=[{'all':!![]}];}return db[_0x6338('0x2e')][_0x6338('0x45')](_0x6a071d);})[_0x6338('0x13')](function(_0x3c3fa5){_0x331ef6[_0x6338('0x46')]=_0x3c3fa5;return _0x331ef6;})['then'](respondWithFilteredResult(_0x14b64d,_0x6a071d))[_0x6338('0x1c')](handleError(_0x14b64d,null));};exports['show']=function(_0x16e9e1,_0x2ef92c){var _0x4e2364={'raw':![],'where':{'id':_0x16e9e1['params']['id']},'include':[{'model':db['Pause'],'as':_0x6338('0x2c')}]},_0x35c952={};_0x35c952[_0x6338('0x32')]=_[_0x6338('0x34')](db['ChatWebsite'][_0x6338('0x47')]);_0x35c952[_0x6338('0x33')]=_['keys'](_0x16e9e1['query']);_0x35c952['filters']=_[_0x6338('0x35')](_0x35c952[_0x6338('0x32')],_0x35c952['query']);_0x4e2364['attributes']=_[_0x6338('0x35')](_0x35c952[_0x6338('0x32')],qs[_0x6338('0x36')](_0x16e9e1[_0x6338('0x33')][_0x6338('0x36')]));_0x4e2364['attributes']=_0x4e2364[_0x6338('0x37')]['length']?_0x4e2364[_0x6338('0x37')]:_0x35c952[_0x6338('0x32')];if(_0x16e9e1[_0x6338('0x33')][_0x6338('0x44')]){_0x4e2364['include']=[{'all':!![]}];}_0x4e2364=_['merge']({},_0x4e2364,_0x16e9e1['options']);return db[_0x6338('0x2e')][_0x6338('0x48')](_0x4e2364)[_0x6338('0x13')](handleEntityNotFound(_0x2ef92c,null))[_0x6338('0x13')](respondWithResult(_0x2ef92c,null))[_0x6338('0x1c')](handleError(_0x2ef92c,null));};exports[_0x6338('0x49')]=function(_0x22c57d,_0x51080f){return db[_0x6338('0x2e')][_0x6338('0x49')](_0x22c57d['body'],{})[_0x6338('0x13')](function(_0x193f25){var _0x2e183e=_0x22c57d[_0x6338('0x4a')][_0x6338('0x4b')]({'plain':!![]});if(!_0x2e183e)throw new Error(_0x6338('0x4c'));if(_0x2e183e['role']===_0x6338('0x4a')){var _0x3990e2=_0x193f25['get']({'plain':!![]});var _0x521ef5=_0x6338('0x26');return db[_0x6338('0x4d')]['find']({'where':{'name':_0x521ef5,'userProfileId':_0x2e183e[_0x6338('0x4e')]},'raw':!![]})['then'](function(_0x2a7888){if(_0x2a7888&&_0x2a7888['autoAssociation']===0x0){return db[_0x6338('0x27')]['create']({'name':_0x3990e2[_0x6338('0x29')],'resourceId':_0x3990e2['id'],'type':_0x2a7888[_0x6338('0x29')],'sectionId':_0x2a7888['id']},{})[_0x6338('0x13')](function(){return _0x193f25;});}else{return _0x193f25;}})['catch'](function(_0x515dc9){logger[_0x6338('0x18')](_0x6338('0x4f'),_0x515dc9);throw _0x515dc9;});}return _0x193f25;})[_0x6338('0x13')](respondWithResult(_0x51080f,0xc9))['catch'](handleError(_0x51080f,null));};exports['update']=function(_0x34b7b5,_0x40755c){if(_0x34b7b5[_0x6338('0x50')]['id']){delete _0x34b7b5[_0x6338('0x50')]['id'];}return db[_0x6338('0x2e')]['find']({'where':{'id':_0x34b7b5[_0x6338('0x51')]['id']},'include':[{'model':db[_0x6338('0x2b')],'as':_0x6338('0x2c')}]})[_0x6338('0x13')](handleEntityNotFound(_0x40755c,null))[_0x6338('0x13')](saveUpdates(_0x34b7b5[_0x6338('0x50')],null))['then'](respondWithResult(_0x40755c,null))[_0x6338('0x1c')](handleError(_0x40755c,null));};exports[_0x6338('0x25')]=function(_0x27cca9,_0xe88101){return db['ChatWebsite'][_0x6338('0x48')]({'where':{'id':_0x27cca9[_0x6338('0x51')]['id']}})['then'](handleEntityNotFound(_0xe88101,null))[_0x6338('0x13')](removeEntity(_0xe88101,null))['catch'](handleError(_0xe88101,null));};exports[_0x6338('0x52')]=function(_0x459cbc,_0x31f3d1){return db[_0x6338('0x2e')][_0x6338('0x52')]()['then'](respondWithResult(_0x31f3d1,null))[_0x6338('0x1c')](handleError(_0x31f3d1,null));};exports[_0x6338('0x53')]=function(_0x5b4d5a,_0x5a68e5){if(_0x5b4d5a[_0x6338('0x50')]['id']){delete _0x5b4d5a[_0x6338('0x50')]['id'];}return db[_0x6338('0x2e')]['find']({'where':{'id':_0x5b4d5a[_0x6338('0x51')]['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x5a68e5,null))[_0x6338('0x13')](function(_0x5c9b89){if(_0x5c9b89){_0x5b4d5a['body'][_0x6338('0x54')]=_0x5c9b89['id'];return db[_0x6338('0x55')][_0x6338('0x49')](_0x5b4d5a[_0x6338('0x50')]);}})[_0x6338('0x13')](respondWithResult(_0x5a68e5,null))[_0x6338('0x1c')](handleError(_0x5a68e5,null));};exports[_0x6338('0x56')]=function(_0x24842c,_0x2b8f24){var _0x1e384c={'raw':![],'where':{}};var _0x5abaae={};var _0x557127={'count':0x0,'rows':[]};return db[_0x6338('0x2e')][_0x6338('0x57')]({'where':{'id':_0x24842c[_0x6338('0x51')]['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x2b8f24,null))['then'](function(_0x54d8e9){if(_0x54d8e9){_0x5abaae['model']=_[_0x6338('0x34')](db[_0x6338('0x55')][_0x6338('0x47')]);_0x5abaae['query']=_[_0x6338('0x34')](_0x24842c[_0x6338('0x33')]);_0x5abaae[_0x6338('0x3d')]=_[_0x6338('0x35')](_0x5abaae[_0x6338('0x32')],_0x5abaae[_0x6338('0x33')]);_0x1e384c[_0x6338('0x37')]=_[_0x6338('0x35')](_0x5abaae[_0x6338('0x32')],qs[_0x6338('0x36')](_0x24842c['query'][_0x6338('0x36')]));_0x1e384c[_0x6338('0x37')]=_0x1e384c['attributes'][_0x6338('0x38')]?_0x1e384c['attributes']:_0x5abaae['model'];if(!_0x24842c[_0x6338('0x33')][_0x6338('0x39')](_0x6338('0x3a'))){_0x1e384c[_0x6338('0x20')]=qs['limit'](_0x24842c[_0x6338('0x33')]['limit']);_0x1e384c[_0x6338('0x22')]=qs[_0x6338('0x22')](_0x24842c['query']['offset']);}_0x1e384c[_0x6338('0x3b')]=qs['sort'](_0x24842c[_0x6338('0x33')][_0x6338('0x3c')]);_0x1e384c[_0x6338('0x3f')]=qs['filters'](_[_0x6338('0x3e')](_0x24842c[_0x6338('0x33')],_0x5abaae['filters']));_0x1e384c[_0x6338('0x3f')][_0x6338('0x54')]=_0x54d8e9['id'];if(_0x24842c[_0x6338('0x33')][_0x6338('0x42')]){_0x1e384c[_0x6338('0x3f')]=_[_0x6338('0x40')](_0x1e384c[_0x6338('0x3f')],{'$or':_[_0x6338('0x2d')](_0x1e384c[_0x6338('0x37')],function(_0x5a3b29){var _0xe4f23c={};_0xe4f23c[_0x5a3b29]={'$like':'%'+_0x24842c['query'][_0x6338('0x42')]+'%'};return _0xe4f23c;})});}_0x1e384c=_[_0x6338('0x40')]({},_0x1e384c,_0x24842c[_0x6338('0x43')]);return db[_0x6338('0x55')][_0x6338('0x21')]({'where':_0x1e384c['where']})[_0x6338('0x13')](function(_0x15c7fb){_0x557127[_0x6338('0x21')]=_0x15c7fb;if(_0x24842c[_0x6338('0x33')][_0x6338('0x44')]){_0x1e384c[_0x6338('0x58')]=[{'all':!![]}];}return db[_0x6338('0x55')]['findAll'](_0x1e384c);})[_0x6338('0x13')](function(_0x1fd3be){_0x557127[_0x6338('0x46')]=_0x1fd3be;return _0x557127;});}})[_0x6338('0x13')](respondWithFilteredResult(_0x2b8f24,_0x1e384c))[_0x6338('0x1c')](handleError(_0x2b8f24,null));};exports[_0x6338('0x59')]=function(_0x1fcbee,_0x1da507){return db[_0x6338('0x2e')][_0x6338('0x48')]({'where':{'id':_0x1fcbee['params']['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x1da507,null))['then'](function(_0x1da729){if(_0x1da729){return _0x1da729['removeDispositions'](_0x1fcbee[_0x6338('0x33')][_0x6338('0x5a')]);}})['then'](respondWithStatusCode(_0x1da507,null))[_0x6338('0x1c')](handleError(_0x1da507,null));};exports[_0x6338('0x5b')]=function(_0x230a79,_0x16622e){if(_0x230a79['body']['id']){delete _0x230a79[_0x6338('0x50')]['id'];}return db[_0x6338('0x2e')][_0x6338('0x48')]({'where':{'id':_0x230a79['params']['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x16622e,null))[_0x6338('0x13')](function(_0x52357e){if(_0x52357e){_0x230a79[_0x6338('0x50')][_0x6338('0x54')]=_0x52357e['id'];return db[_0x6338('0x5c')][_0x6338('0x49')](_0x230a79['body']);}})['then'](respondWithResult(_0x16622e,null))[_0x6338('0x1c')](handleError(_0x16622e,null));};exports[_0x6338('0x5d')]=function(_0x253086,_0x1fbee1){var _0x56739d={'raw':![],'where':{}};var _0x1b4b9c={};var _0x303266={'count':0x0,'rows':[]};return db[_0x6338('0x2e')][_0x6338('0x57')]({'where':{'id':_0x253086['params']['id']}})['then'](handleEntityNotFound(_0x1fbee1,null))['then'](function(_0x1c9236){if(_0x1c9236){_0x1b4b9c[_0x6338('0x32')]=_['keys'](db[_0x6338('0x5c')][_0x6338('0x47')]);_0x1b4b9c[_0x6338('0x33')]=_['keys'](_0x253086[_0x6338('0x33')]);_0x1b4b9c['filters']=_[_0x6338('0x35')](_0x1b4b9c['model'],_0x1b4b9c[_0x6338('0x33')]);_0x56739d[_0x6338('0x37')]=_[_0x6338('0x35')](_0x1b4b9c[_0x6338('0x32')],qs['fields'](_0x253086['query'][_0x6338('0x36')]));_0x56739d['attributes']=_0x56739d['attributes'][_0x6338('0x38')]?_0x56739d['attributes']:_0x1b4b9c[_0x6338('0x32')];if(!_0x253086[_0x6338('0x33')]['hasOwnProperty'](_0x6338('0x3a'))){_0x56739d[_0x6338('0x20')]=qs[_0x6338('0x20')](_0x253086[_0x6338('0x33')]['limit']);_0x56739d['offset']=qs[_0x6338('0x22')](_0x253086[_0x6338('0x33')][_0x6338('0x22')]);}_0x56739d[_0x6338('0x3b')]=qs['sort'](_0x253086['query'][_0x6338('0x3c')]);_0x56739d['where']=qs[_0x6338('0x3d')](_[_0x6338('0x3e')](_0x253086['query'],_0x1b4b9c[_0x6338('0x3d')]));_0x56739d['where'][_0x6338('0x54')]=_0x1c9236['id'];if(_0x253086['query'][_0x6338('0x42')]){_0x56739d[_0x6338('0x3f')]=_['merge'](_0x56739d[_0x6338('0x3f')],{'$or':_[_0x6338('0x2d')](_0x56739d[_0x6338('0x37')],function(_0x33a2d7){var _0x207e3e={};_0x207e3e[_0x33a2d7]={'$like':'%'+_0x253086[_0x6338('0x33')][_0x6338('0x42')]+'%'};return _0x207e3e;})});}_0x56739d=_[_0x6338('0x40')]({},_0x56739d,_0x253086[_0x6338('0x43')]);return db[_0x6338('0x5c')][_0x6338('0x21')]({'where':_0x56739d[_0x6338('0x3f')]})['then'](function(_0x47cc31){_0x303266[_0x6338('0x21')]=_0x47cc31;if(_0x253086['query']['includeAll']){_0x56739d['include']=[{'all':!![]}];}return db[_0x6338('0x5c')][_0x6338('0x45')](_0x56739d);})[_0x6338('0x13')](function(_0x2105fe){_0x303266[_0x6338('0x46')]=_0x2105fe;return _0x303266;});}})[_0x6338('0x13')](respondWithFilteredResult(_0x1fbee1,_0x56739d))[_0x6338('0x1c')](handleError(_0x1fbee1,null));};exports[_0x6338('0x5e')]=function(_0x56de02,_0x405bff){return db[_0x6338('0x2e')][_0x6338('0x48')]({'where':{'id':_0x56de02['params']['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x405bff,null))[_0x6338('0x13')](function(_0x343095){if(_0x343095){return _0x343095[_0x6338('0x5e')](_0x56de02[_0x6338('0x33')][_0x6338('0x5a')]);}})[_0x6338('0x13')](respondWithStatusCode(_0x405bff,null))[_0x6338('0x1c')](handleError(_0x405bff,null));};exports[_0x6338('0x5f')]=function(_0x4c00bb,_0x3d9f9a){_0x4c00bb[_0x6338('0x50')][_0x6338('0x60')]=_0x4c00bb['file'][_0x6338('0x61')];return db['ChatWebsite']['find']({'where':{'id':_0x4c00bb[_0x6338('0x51')]['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x3d9f9a,null))[_0x6338('0x13')](saveUpdates(_0x4c00bb['body'],null))[_0x6338('0x13')](respondWithResult(_0x3d9f9a,null))[_0x6338('0x1c')](handleError(_0x3d9f9a,null));};exports[_0x6338('0x62')]=function(_0x462c20,_0x56d912){_0x462c20[_0x6338('0x50')][_0x6338('0x63')]=_0x462c20[_0x6338('0x64')]['filename'];return db[_0x6338('0x2e')]['find']({'where':{'id':_0x462c20[_0x6338('0x51')]['id']}})['then'](handleEntityNotFound(_0x56d912,null))[_0x6338('0x13')](saveUpdates(_0x462c20[_0x6338('0x50')],null))[_0x6338('0x13')](respondWithResult(_0x56d912,null))[_0x6338('0x1c')](handleError(_0x56d912,null));};exports[_0x6338('0x65')]=function(_0x263555,_0x1326ca){_0x263555[_0x6338('0x50')]['customerAvatar']=_0x263555[_0x6338('0x64')][_0x6338('0x61')];return db['ChatWebsite']['find']({'where':{'id':_0x263555[_0x6338('0x51')]['id']}})['then'](handleEntityNotFound(_0x1326ca,null))[_0x6338('0x13')](saveUpdates(_0x263555[_0x6338('0x50')],null))[_0x6338('0x13')](respondWithResult(_0x1326ca,null))[_0x6338('0x1c')](handleError(_0x1326ca,null));};exports[_0x6338('0x66')]=function(_0x578042,_0x496be1){_0x578042[_0x6338('0x50')][_0x6338('0x67')]=_0x578042['file']['filename'];return db[_0x6338('0x2e')]['find']({'where':{'id':_0x578042[_0x6338('0x51')]['id']}})['then'](handleEntityNotFound(_0x496be1,null))[_0x6338('0x13')](saveUpdates(_0x578042[_0x6338('0x50')],null))[_0x6338('0x13')](respondWithResult(_0x496be1,null))['catch'](handleError(_0x496be1,null));};exports[_0x6338('0x68')]=function(_0x4890bd,_0x423b54){var _0x3c80aa=path['join'](config[_0x6338('0x69')],_0x6338('0x6a'));var _0x2c87c9={'where':{'id':_0x4890bd[_0x6338('0x51')]['id']},'attributes':['id',_0x6338('0x60')],'raw':!![]};var _0x4dfb32=![];return require(_0x6338('0x6b'))[_0x6338('0x6c')]()[_0x6338('0x13')](function(_0x440ba0){if(_0x440ba0){_0x4dfb32=_0x440ba0[_0x6338('0x6d')];}})[_0x6338('0x13')](function(){return db[_0x6338('0x2e')][_0x6338('0x48')](_0x2c87c9);})[_0x6338('0x13')](handleEntityNotFound(_0x423b54,null))[_0x6338('0x13')](function(_0x19a78c){if(_0x19a78c){if(!_[_0x6338('0x6e')](_0x19a78c[_0x6338('0x60')])){if(fs[_0x6338('0x6f')](path['join'](config[_0x6338('0x69')],_0x6338('0x70'),_0x19a78c[_0x6338('0x60')]))&&_0x4dfb32){_0x3c80aa=path[_0x6338('0x71')](config['root'],'server/files/images/logos/',_0x19a78c['sitepic']);}}return _0x423b54[_0x6338('0x72')](_0x3c80aa);}})[_0x6338('0x1c')](handleError(_0x423b54,null));};exports['getAvatar']=function(_0x33f7da,_0x3b6e8b){var _0x363679=path[_0x6338('0x71')](config[_0x6338('0x69')],_0x6338('0x73'));var _0x269d95={'where':{'id':_0x33f7da[_0x6338('0x51')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x6338('0x2e')][_0x6338('0x48')](_0x269d95)[_0x6338('0x13')](handleEntityNotFound(_0x3b6e8b,null))[_0x6338('0x13')](function(_0x52230b){if(_0x52230b){if(!_['isNil'](_0x52230b[_0x6338('0x63')])){if(fs[_0x6338('0x6f')](path[_0x6338('0x71')](config[_0x6338('0x69')],_0x6338('0x74'),_0x52230b[_0x6338('0x63')]))){_0x363679=path[_0x6338('0x71')](config['root'],'server/files/images/avatars/',_0x52230b[_0x6338('0x63')]);}}return _0x3b6e8b[_0x6338('0x72')](_0x363679);}})['catch'](handleError(_0x3b6e8b,null));};exports[_0x6338('0x75')]=function(_0x1069be,_0x3d4e73){var _0x36cfd5=path[_0x6338('0x71')](config['root'],_0x6338('0x76'));var _0x33a4b8={'where':{'id':_0x1069be[_0x6338('0x51')]['id']},'attributes':['id',_0x6338('0x77'),_0x6338('0x78')],'raw':!![]};return db[_0x6338('0x2e')][_0x6338('0x48')](_0x33a4b8)[_0x6338('0x13')](handleEntityNotFound(_0x3d4e73,null))[_0x6338('0x13')](function(_0x571486){if(_0x571486){if(!_[_0x6338('0x6e')](_0x571486[_0x6338('0x77')])){if(fs[_0x6338('0x6f')](path[_0x6338('0x71')](config['root'],_0x6338('0x74'),_0x571486[_0x6338('0x77')]))&&_0x571486[_0x6338('0x78')]){_0x36cfd5=path['join'](config['root'],'server/files/images/avatars/',_0x571486[_0x6338('0x77')]);}}return _0x3d4e73['download'](_0x36cfd5);}})['catch'](handleError(_0x3d4e73,null));};exports[_0x6338('0x79')]=function(_0x2085e9,_0xec8193){var _0xd70687=path[_0x6338('0x71')](config[_0x6338('0x69')],_0x6338('0x7a'));var _0xdd5d30={'where':{'id':_0x2085e9['params']['id']},'attributes':['id',_0x6338('0x67')],'raw':!![]};return db[_0x6338('0x2e')][_0x6338('0x48')](_0xdd5d30)[_0x6338('0x13')](handleEntityNotFound(_0xec8193,null))[_0x6338('0x13')](function(_0x1791e1){if(_0x1791e1){if(!_[_0x6338('0x6e')](_0x1791e1['systemAvatar'])){if(fs['existsSync'](path[_0x6338('0x71')](config[_0x6338('0x69')],'server/files/images/avatars/',_0x1791e1['systemAvatar']))){_0xd70687=path[_0x6338('0x71')](config[_0x6338('0x69')],_0x6338('0x74'),_0x1791e1[_0x6338('0x67')]);}}return _0xec8193[_0x6338('0x72')](_0xd70687);}})[_0x6338('0x1c')](handleError(_0xec8193,null));};exports[_0x6338('0x7b')]=function(_0x53070b,_0x5b553e){var _0x3488dc=require(_0x6338('0x7c'));var _0x1473bd=new _0x3488dc();var _0x102690=_0x1473bd['setUA'](_0x53070b[_0x6338('0x7d')][_0x6338('0x7e')])[_0x6338('0x7f')]();var _0x139306={'body':_0x53070b['body'],'channel':_0x6338('0x80')};var _0x1b0157=[];var _0x1696be=[];var _0x336cdb={};var _0x40121d=![];return db['CmContact']['describe']()['then'](function(_0x6fe74){if(!_0x6fe74){throw new db[(_0x6338('0x81'))][(_0x6338('0x82'))](_0x6338('0x83'));}_0x1b0157=_[_0x6338('0x84')](_[_0x6338('0x34')](_0x6fe74),[_0x6338('0x85'),_0x6338('0x86')]);_0x1696be=_[_0x6338('0x84')](_['keys'](_0x6fe74),[_0x6338('0x85'),'updatedAt',_0x6338('0x87'),_0x6338('0x88')]);if(_0x53070b[_0x6338('0x50')]['id']){delete _0x53070b[_0x6338('0x50')]['id'];}if(_[_0x6338('0x6e')](_0x53070b['body'][_0x6338('0x89')])){throw new db[(_0x6338('0x81'))][(_0x6338('0x82'))](_0x6338('0x8a'));}if(_[_0x6338('0x6e')](_0x53070b[_0x6338('0x50')][_0x6338('0x50')])||_0x53070b[_0x6338('0x50')][_0x6338('0x50')]===''){throw new db[(_0x6338('0x81'))]['ValidationError'](_0x6338('0x8b'));}if(_[_0x6338('0x6e')](_0x53070b[_0x6338('0x50')]['mapKey'])){throw new db[(_0x6338('0x81'))][(_0x6338('0x82'))](_0x6338('0x8c')+_0x1696be);}if(!_[_0x6338('0x8d')](_0x1696be,_0x53070b['body']['mapKey'])){throw new db[(_0x6338('0x81'))]['ValidationError'](_0x6338('0x8e')+_0x1696be);}_0x336cdb[_0x53070b[_0x6338('0x50')]['mapKey']]=_0x53070b[_0x6338('0x50')][_0x6338('0x89')];})['then'](function(){return db['ChatWebsite'][_0x6338('0x48')]({'where':{'id':_0x53070b[_0x6338('0x51')]['id']},'include':[{'model':db[_0x6338('0x8f')],'as':_0x6338('0x90'),'include':[{'model':db[_0x6338('0x91')],'as':_0x6338('0x92'),'where':_0x336cdb,'limit':0x1,'order':[[_0x6338('0x86'),_0x6338('0x93')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x5b553e,null))[_0x6338('0x13')](function(_0x275af0){if(_0x275af0&&_0x275af0[_0x6338('0x90')]){_0x139306[_0x6338('0x94')]=_0x275af0;_0x139306[_0x6338('0x95')]=_0x275af0[_0x6338('0x96')];_0x139306[_0x6338('0x97')]=_0x275af0[_0x6338('0x90')];_0x139306['applications']=_[_0x6338('0x98')](_0x139306[_0x6338('0x95')],[_0x6338('0x99')],[_0x6338('0x9a')]);if(_0x139306[_0x6338('0x94')][_0x6338('0x96')]){delete _0x139306[_0x6338('0x94')][_0x6338('0x96')];}if(_0x139306['account'][_0x6338('0x90')]&&_0x139306['account'][_0x6338('0x90')]['Contacts'][_0x6338('0x38')]){return _0x139306[_0x6338('0x94')]['List'][_0x6338('0x92')][0x0];}var _0x33f444=_[_0x6338('0xa')](_0x53070b['body'],{'firstName':_0x53070b['body'][_0x6338('0x89')],'ListId':_0x275af0[_0x6338('0x88')]});_0x33f444[_0x53070b[_0x6338('0x50')][_0x6338('0x9b')]]=_0x53070b['body']['from'];return db[_0x6338('0x91')]['create'](_0x33f444,{'fields':_0x1b0157,'raw':!![]});}})[_0x6338('0x13')](handleEntityNotFound(_0x5b553e,null))[_0x6338('0x13')](function(_0x55ce94){_0x139306[_0x6338('0x9c')]=_0x55ce94;var _0x345810=_0x53070b['body'][_0x6338('0x9d')];if(_0x53070b['headers'][_0x6338('0x9e')]){_0x345810=_0x53070b['headers'][_0x6338('0x9e')];}else if(_0x53070b[_0x6338('0x7d')][_0x6338('0x9f')]){_0x345810=_[_0x6338('0xa0')](_0x53070b[_0x6338('0x7d')][_0x6338('0x9f')][_0x6338('0xa1')](','));}if(_0x55ce94){var _0x367e51={'ContactId':_0x55ce94['id'],'ChatWebsiteId':_0x53070b[_0x6338('0x51')]['id'],'from':(_0x55ce94['firstName']||'')+'\x20'+(_0x55ce94[_0x6338('0xa2')]||''),'customerIp':_0x345810,'customerPort':_0x53070b[_0x6338('0x7d')][_0x6338('0xa3')]?_0x53070b[_0x6338('0x7d')]['x-real-port']:null,'referer':_0x53070b['body'][_0x6338('0xa4')],'browserName':_0x102690[_0x6338('0xa5')]['name']&&_0x102690[_0x6338('0xa5')]['version']?util[_0x6338('0xa6')](_0x6338('0xa7'),_0x102690[_0x6338('0xa5')][_0x6338('0x29')],_0x102690[_0x6338('0xa5')]['version']):_0x6338('0xa8'),'browserVersion':_0x102690[_0x6338('0xa5')][_0x6338('0xa9')]||_0x6338('0xa8'),'osName':util['format'](_0x6338('0xa7'),_0x102690['os'][_0x6338('0x29')],_0x102690['os'][_0x6338('0xa9')]),'osVersion':_0x102690['os']['version'],'deviceModel':_0x102690['device'][_0x6338('0x32')]&&_0x102690[_0x6338('0xaa')][_0x6338('0xab')]?util[_0x6338('0xa6')]('%s\x20%s\x20%s',_0x102690[_0x6338('0xaa')][_0x6338('0x32')],_0x102690['device']['vendor'],_0x102690[_0x6338('0xaa')][_0x6338('0x30')]):null,'deviceVendor':_0x102690[_0x6338('0xaa')][_0x6338('0xab')],'deviceType':_0x102690['device'][_0x6338('0x30')],'formData':JSON['stringify'](_0x53070b[_0x6338('0x50')])};var _0x90f96d={'ChatWebsiteId':_0x53070b[_0x6338('0x51')]['id'],'closed':![]};if(_0x53070b['body'][_0x6338('0xac')]){_0x90f96d['threadId']=_0x53070b[_0x6338('0x50')][_0x6338('0xac')];return db[_0x6338('0xad')][_0x6338('0x48')]({'where':_0x90f96d})['then'](function(_0x24208a){if(_0x24208a){return[_0x24208a,![]];}_0x367e51[_0x6338('0xac')]=_0x53070b[_0x6338('0x50')][_0x6338('0xac')];_0x367e51[_0x6338('0xae')]=_0x53070b[_0x6338('0x50')]['externalUrl'];return db[_0x6338('0xad')][_0x6338('0x49')](_0x367e51)[_0x6338('0x13')](function(_0x194a36){return[_0x194a36,!![]];});});}_0x90f96d['ContactId']=_0x55ce94['id'];if(_0x53070b[_0x6338('0x50')]['interaction']&&_0x53070b[_0x6338('0x50')]['interaction']['id']){_0x90f96d['id']=_0x53070b['body'][_0x6338('0xaf')]['id'];return db[_0x6338('0xad')][_0x6338('0x48')]({'where':_0x90f96d})[_0x6338('0x13')](function(_0x46123a){if(_0x46123a){return[_0x46123a,![]];}return db[_0x6338('0xad')][_0x6338('0x49')](_0x367e51)['then'](function(_0x1ce1fa){return[_0x1ce1fa,!![]];});});}return db[_0x6338('0xad')][_0x6338('0x49')](_0x367e51)['then'](function(_0x484276){return[_0x484276,!![]];});}})[_0x6338('0xb0')](function(_0x11b549,_0x32b031){if(_0x11b549){_0x40121d=_0x32b031;if(!_0x32b031){var _0x1ce1cf={'from':(_0x139306[_0x6338('0x9c')][_0x6338('0xb1')]||'')+'\x20'+(_0x139306[_0x6338('0x9c')][_0x6338('0xa2')]||'')};if(_0x53070b['body']['threadId']&&_0x53070b[_0x6338('0x50')][_0x6338('0xb2')]&&_0x53070b[_0x6338('0x50')][_0x6338('0xac')]!=_0x53070b[_0x6338('0x50')][_0x6338('0xb2')]){_0x1ce1cf[_0x6338('0xac')]=_0x53070b[_0x6338('0x50')]['messageId'];}return _0x11b549['update'](_0x1ce1cf);}else{return _0x11b549;}}})[_0x6338('0x13')](function(_0x277c8e){_0x139306[_0x6338('0xaf')]=_0x277c8e[_0x6338('0x4b')]({'plain':!![]});_0x139306[_0x6338('0xaf')][_0x6338('0xb3')]=_0x40121d;if(_0x139306[_0x6338('0xaf')]['created']){if(_0x139306[_0x6338('0x94')][_0x6338('0xb4')]){_0x139306[_0x6338('0x95')][_0x6338('0xb5')]({'id':0x0,'priority':_0x139306['applications']['length']+0x1,'app':_0x6338('0xb6'),'appdata':_0x6338('0xb7'),'interval':_0x6338('0xb8')});}}return db[_0x6338('0xb9')][_0x6338('0x49')]({'body':_0x53070b[_0x6338('0x50')]['body'],'ChatWebsiteId':_0x53070b[_0x6338('0x51')]['id'],'ChatInteractionId':_0x277c8e['id'],'direction':'in','ContactId':_0x139306['contact']['id'],'AttachmentId':_0x53070b['body'][_0x6338('0xba')]});})[_0x6338('0x13')](function(_0x3a0c63){_0x139306['message']=_0x3a0c63;if(_0x139306[_0x6338('0xaf')][_0x6338('0xbb')]){return db[_0x6338('0xbc')][_0x6338('0x48')]({'attributes':['id',_0x6338('0x29')],'where':{'id':_0x139306[_0x6338('0xaf')]['UserId']}})[_0x6338('0x13')](function(_0x4732e7){if(_0x4732e7){_0x139306[_0x6338('0x95')][_0x6338('0xbd')]({'id':0x0,'priority':0x0,'app':_0x6338('0xbe'),'appdata':_0x4732e7['name']+','+(_0x139306[_0x6338('0x94')][_0x6338('0xbf')]||0xa),'interval':_0x6338('0xb8')});_0x139306['forcedOwnership']=!![];}return respondWithRpcPromise(_0x6338('0xc0'),_0x6338('0xc1'),_0x139306);});}return respondWithRpcPromise(_0x6338('0xc0'),'startRouting',_0x139306);})[_0x6338('0x13')](function(_0x550b18){respondWithRpcPromise(_0x6338('0xc2'),'EventManager',{'event':_0x6338('0x7b'),'message':_0x550b18},client9002);return _0x550b18;})['then'](respondWithResult(_0x5b553e,null))['catch'](handleError(_0x5b553e,null));};exports[_0x6338('0xc3')]=function(_0x366dd1,_0x5a91ed){var _0x43113b,_0x42fb9b,_0x1bae0d;var _0x49960f=[];var _0x29dd18={};var _0x54001f=_0x366dd1[_0x6338('0xc4')]||[];var _0x339b6f=[];var _0x182316;return db[_0x6338('0x91')]['describe']()[_0x6338('0x13')](function(_0x3a3bd1){if(!_0x3a3bd1){throw new db[(_0x6338('0x81'))]['ValidationError']('no\x20available\x20attributes');}_0x49960f=_[_0x6338('0x84')](_[_0x6338('0x34')](_0x3a3bd1),[_0x6338('0x85'),_0x6338('0x86'),_0x6338('0x87'),'ListId']);if(_0x366dd1[_0x6338('0x50')]['id']){delete _0x366dd1[_0x6338('0x50')]['id'];}if(_[_0x6338('0x6e')](_0x366dd1[_0x6338('0x50')]['from'])){throw _0x5a91ed[_0x6338('0x1e')](0x1f4)['send'](new db[(_0x6338('0x81'))][(_0x6338('0x82'))](_0x6338('0x8a')));}if(_[_0x6338('0x6e')](_0x366dd1[_0x6338('0x50')][_0x6338('0x50')])||_0x366dd1['body'][_0x6338('0x50')]===''){throw _0x5a91ed[_0x6338('0x1e')](0x1f4)[_0x6338('0xc5')](new db[(_0x6338('0x81'))][(_0x6338('0x82'))](_0x6338('0x8b')));}if(_[_0x6338('0x6e')](_0x366dd1['body']['mapKeyOffline'])){throw _0x5a91ed[_0x6338('0x1e')](0x1f4)[_0x6338('0xc5')](new db[(_0x6338('0x81'))][(_0x6338('0x82'))](_0x6338('0xc6')+_0x49960f));}if(!_[_0x6338('0x8d')](_0x49960f,_0x366dd1[_0x6338('0x50')][_0x6338('0xc7')])){throw _0x5a91ed['status'](0x1f4)[_0x6338('0xc5')](new db[(_0x6338('0x81'))][(_0x6338('0x82'))](_0x6338('0xc8')+_0x49960f));}_0x29dd18[_0x366dd1['body'][_0x6338('0xc7')]]=_0x366dd1[_0x6338('0x50')][_0x6338('0x89')];})[_0x6338('0x13')](function(){return db[_0x6338('0x2e')]['find']({'where':{'id':_0x366dd1[_0x6338('0x51')]['id']},'include':[{'model':db[_0x6338('0x8f')],'as':_0x6338('0x90')},{'model':db[_0x6338('0xc9')],'as':_0x6338('0xc9')}]});})[_0x6338('0x13')](handleEntityNotFound(_0x5a91ed,null))[_0x6338('0x13')](function(_0xfff942){if(_0xfff942&&_0xfff942['List']){_0x42fb9b=_0xfff942;var _0x491b0c=_[_0x6338('0xa')](_0x366dd1[_0x6338('0x50')],{'firstName':_0x366dd1[_0x6338('0x50')][_0x6338('0x89')],'phone':_0x366dd1['body'][_0x6338('0x89')],'ListId':_0xfff942[_0x6338('0x88')]});_0x491b0c[_0x366dd1[_0x6338('0x50')][_0x6338('0xc7')]]=_0x366dd1[_0x6338('0x50')]['from'];return db['CmContact'][_0x6338('0xca')]({'where':_0x29dd18,'defaults':_0x491b0c});}})[_0x6338('0xb0')](function(_0x45ea5f){if(_0x45ea5f){_0x1bae0d=_0x45ea5f;var _0x1a10e0=fs['readFileSync'](path[_0x6338('0x71')](config[_0x6338('0x69')],_0x6338('0xcb')),_0x6338('0xcc'));var _0x310eaf=ejs[_0x6338('0xcd')](_0x1a10e0,{'body':_['toPairs'](_0x366dd1['body'][_0x6338('0x50')]),'bodyTitle':_0x42fb9b[_0x6338('0xce')]});return db[_0x6338('0xcf')][_0x6338('0x49')]({'body':_0x310eaf,'plainBody':htmlToText[_0x6338('0xd0')](_0x310eaf),'ContactId':_0x45ea5f['id'],'ChatWebsiteId':_0x42fb9b['id']});}})[_0x6338('0x13')](function(_0x3099b7){_0x182316=_0x3099b7;if(_0x54001f[_0x6338('0x38')]){var _0xff60b0=_0x54001f[_0x6338('0x2d')](function(_0x3973e0){return{'name':_0x3973e0['originalname'],'basename':_0x3973e0[_0x6338('0x61')],'type':_0x3973e0[_0x6338('0xd1')],'ChatOfflineMessageId':_0x3099b7['id']};});_0x339b6f=_0xff60b0[_0x6338('0x2d')](_0x3d6ccd=>{var _0x5a4458={'filename':_0x3d6ccd[_0x6338('0x29')],'path':path['join'](config[_0x6338('0x69')],'server','files',_0x6338('0xd2'),_0x6338('0xd3'),_0x3d6ccd[_0x6338('0xd4')])};return _0x5a4458;});if(!_0x42fb9b[_0x6338('0xd5')]){return db[_0x6338('0xd6')][_0x6338('0xd7')](function(_0x3fc768){return db[_0x6338('0xd8')][_0x6338('0xd9')](_0xff60b0,{'transaction':_0x3fc768});});}}})[_0x6338('0x13')](function(){if(_0x182316){_0x43113b=_0x182316;return db[_0x6338('0xc9')][_0x6338('0x57')]({'where':{'service':!![]},'include':[{'model':db[_0x6338('0xda')],'as':_0x6338('0xdb'),'raw':!![],'include':[{'model':db[_0x6338('0xdc')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x6338('0x13')](function(_0x41bfe7){if(_0x41bfe7&&_0x41bfe7[_0x6338('0xdb')]&&_0x42fb9b[_0x6338('0xdd')]&&_0x42fb9b['forwardOfflineAddress']){var _0x1c0974=_0x41bfe7[_0x6338('0xde')]();return respondWithRpcPromise(_0x6338('0xdf'),'sendMail',{'account':_0x1c0974,'message':{'from':util[_0x6338('0xa6')](_0x6338('0xe0'),_0x41bfe7['name'],_0x41bfe7[_0x6338('0xe1')]||_0x41bfe7[_0x6338('0xdb')][_0x6338('0x4a')]),'to':_0x42fb9b['forwardOfflineAddress'],'subject':_0x42fb9b['offlineMessageSubject'],'html':_0x43113b[_0x6338('0x50')],'attachments':_0x339b6f}},client9003)['then'](function(){return _0x43113b;})[_0x6338('0x1c')](function(_0x3e9d89){logger[_0x6338('0x18')](_0x3e9d89);});}})[_0x6338('0x13')](function(){if(_0x42fb9b&&_0x42fb9b['openNewInteraction']&&_0x42fb9b[_0x6338('0xe2')]){var _0x56013=[];if(_0x54001f['length']){_0x56013=_0x54001f['map'](function(_0x4294ff){return{'name':_0x4294ff[_0x6338('0xe3')],'basename':_0x4294ff[_0x6338('0x61')],'type':_0x4294ff['mimetype'],'ChatOfflineMessageId':_0x182316['id']};});}var _0x3deb21;if(!_[_0x6338('0x6e')](_0x42fb9b[_0x6338('0xe4')])){var _0x4787bf=_[_0x6338('0x2d')](_0x366dd1[_0x6338('0x50')],function(_0x1a5210){return _0x1a5210;});var _0x41580a=_[_0x6338('0xe5')](_0x4787bf)[0x0];var _0x27a87c=_['mapValues'](_0x41580a,function(_0x5c27f8){return _0x5c27f8;});_0x3deb21=_0x27a87c[0x1][_0x42fb9b[_0x6338('0xe4')]];}var _0x4be38a={'from':_0x1bae0d[_0x6338('0xe1')],'firstName':_0x1bae0d[_0x6338('0xb1')],'lastName':_0x1bae0d[_0x6338('0xa2')],'mapKey':'email','message':{'from':_0x1bae0d[_0x6338('0xe1')],'to':_0x42fb9b[_0x6338('0xc9')][_0x6338('0xe1')],'cc':'','subject':_[_0x6338('0x6e')](_0x3deb21)?_0x42fb9b[_0x6338('0xe6')]:_0x3deb21,'messageId':'','sentAt':new Date(),'attach':_0x56013['length'],'attachments':_0x56013,'originChannel':_0x6338('0xe7'),'ChatWebsiteId':_0x42fb9b['id'],'ChatOfflineMessageId':_0x43113b['id'],'originTo':_0x42fb9b['MailAccount'][_0x6338('0xe1')]},'body':_0x43113b[_0x6338('0x50')]};var _0x4d2c90={'account':{'id':_0x42fb9b[_0x6338('0xe2')]},'body':_0x4be38a,'log':_0x6338('0xe8')};return respondWithRpcPromise(_0x6338('0xe8'),_0x6338('0xe9'),_0x4d2c90,client9001)['then'](function(){return _0x43113b;})['catch'](function(_0x51acee){logger['error'](_0x51acee);});}return;})[_0x6338('0x13')](function(){if(_0x43113b){return _0x43113b;}})[_0x6338('0x13')](respondWithResult(_0x5a91ed,null))['catch'](function(_0x72b619){logger[_0x6338('0x18')](_0x6338('0x1c'),_0x72b619);for(var _0x48d27d of _0x54001f){var _0x444d99=path['join'](config['root'],_0x6338('0xea'),'files',_0x6338('0xd2'),'offline-chat',_0x48d27d[_0x6338('0x61')]);fs_extra[_0x6338('0xeb')](_0x444d99)[_0x6338('0x1c')](function(_0x966e57){logger[_0x6338('0x18')](_0x6338('0xec'),_0x444d99,_0x966e57);});}});};exports[_0x6338('0xed')]=function(_0x5f5a0f,_0x520117){return db[_0x6338('0xad')][_0x6338('0x48')]({'where':{'id':_0x5f5a0f[_0x6338('0x51')]['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x520117,null))[_0x6338('0x13')](function(_0xb2a369){if(_0xb2a369){return _0xb2a369[_0x6338('0xed')](_0x5f5a0f[_0x6338('0x50')][_0x6338('0x5a')],_['omit'](_0x5f5a0f[_0x6338('0x50')],[_0x6338('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x520117,null))[_0x6338('0x1c')](handleError(_0x520117,null));};exports[_0x6338('0xee')]=function(_0x4272d8,_0x3d0661){var _0x433395={'raw':![],'where':{}};var _0x582b9c={};var _0x4985c3={'count':0x0,'rows':[]};return db[_0x6338('0x2e')]['findOne']({'where':{'id':_0x4272d8[_0x6338('0x51')]['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x3d0661,null))[_0x6338('0x13')](function(_0x51b074){if(_0x51b074){_0x582b9c['model']=_['keys'](db[_0x6338('0xad')][_0x6338('0x47')]);_0x582b9c[_0x6338('0x33')]=_[_0x6338('0x34')](_0x4272d8['query']);_0x582b9c[_0x6338('0x3d')]=_[_0x6338('0x35')](_0x582b9c[_0x6338('0x32')],_0x582b9c['query']);_0x433395[_0x6338('0x37')]=_[_0x6338('0x35')](_0x582b9c[_0x6338('0x32')],qs['fields'](_0x4272d8['query'][_0x6338('0x36')]));_0x433395['attributes']=_0x433395[_0x6338('0x37')][_0x6338('0x38')]?_0x433395[_0x6338('0x37')]:_0x582b9c['model'];if(!_0x4272d8[_0x6338('0x33')][_0x6338('0x39')](_0x6338('0x3a'))){_0x433395[_0x6338('0x20')]=qs['limit'](_0x4272d8[_0x6338('0x33')][_0x6338('0x20')]);_0x433395[_0x6338('0x22')]=qs[_0x6338('0x22')](_0x4272d8[_0x6338('0x33')][_0x6338('0x22')]);}_0x433395['order']=qs['sort'](_0x4272d8[_0x6338('0x33')][_0x6338('0x3c')]);_0x433395['where']=qs[_0x6338('0x3d')](_[_0x6338('0x3e')](_0x4272d8[_0x6338('0x33')],_0x582b9c['filters']));_0x433395[_0x6338('0x3f')][_0x6338('0x54')]=_0x51b074['id'];if(_0x4272d8[_0x6338('0x33')][_0x6338('0x42')]){_0x433395[_0x6338('0x3f')]=_['merge'](_0x433395['where'],{'$or':_[_0x6338('0x2d')](_0x433395[_0x6338('0x37')],function(_0x3eebff){var _0x82187a={};_0x82187a[_0x3eebff]={'$like':'%'+_0x4272d8[_0x6338('0x33')][_0x6338('0x42')]+'%'};return _0x82187a;})});}_0x433395=_[_0x6338('0x40')]({},_0x433395,_0x4272d8[_0x6338('0x43')]);return db[_0x6338('0xad')][_0x6338('0x21')]({'where':_0x433395[_0x6338('0x3f')]})['then'](function(_0x1afa88){_0x4985c3[_0x6338('0x21')]=_0x1afa88;if(_0x4272d8['query']['includeAll']){_0x433395[_0x6338('0x58')]=[{'model':db[_0x6338('0x91')],'as':_0x6338('0xef'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x6338('0x29'),_0x6338('0xf0'),'internal'],'required':![]},{'model':db[_0x6338('0xf1')],'as':_0x6338('0xf2'),'attributes':['id',_0x6338('0x29'),_0x6338('0xf3')],'where':_0x4272d8[_0x6338('0x33')][_0x6338('0xf4')]?{'id':_0x4272d8[_0x6338('0x33')]['tag']}:undefined,'required':_0x4272d8[_0x6338('0x33')][_0x6338('0xf4')]?!![]:![]}];}return db['ChatInteraction'][_0x6338('0x45')](_0x433395);})[_0x6338('0x13')](function(_0xc490e){_0x4985c3['rows']=_0xc490e;return _0x4985c3;});}})[_0x6338('0x13')](respondWithFilteredResult(_0x3d0661,_0x433395))['catch'](handleError(_0x3d0661,null));};function iftimePromise(_0x193b47,_0x2f11cb){return respondWithRpcPromise(_0x6338('0xf5'),_0x6338('0xf6'),{'command':_0x2f11cb[_0x6338('0xf7')]?util[_0x6338('0xa6')](_0x6338('0xf8'),_0x193b47[_0x6338('0xf9')],_0x2f11cb[_0x6338('0xf7')]):util[_0x6338('0xa6')](_0x6338('0xfa'),_0x193b47[_0x6338('0xf9')])},client9002)[_0x6338('0x13')](function(_0x30e8e1){var _0x26507a=_0x30e8e1&&_0x30e8e1['indexOf'](_0x6338('0xfb'))>=0x0?!![]:![];logger[_0x6338('0x14')](_0x6338('0xfc'),_0x2f11cb['id'],_0x193b47['id'],_0x193b47[_0x6338('0xf9')],_0x26507a?_0x6338('0xfd'):'OFFLINE',_0x2f11cb[_0x6338('0xf7')]?_0x2f11cb[_0x6338('0xf7')]:_0x6338('0xfe'));return _0x26507a;})['catch'](function(_0x235383){logger[_0x6338('0x18')](_0x6338('0xfc'),_0x2f11cb['id'],_0x193b47['id'],_0x193b47['interval'],util[_0x6338('0xff')](_0x235383,{'showHidden':![],'depth':null}),_0x2f11cb[_0x6338('0xf7')]?_0x2f11cb['timezone']:_0x6338('0xfe'));return![];});}exports[_0x6338('0xf6')]=function(_0x4b2116,_0x5313a1){var _0x5716f6=0x0;var _0x4998d8=0x0;var _0x20a4a0=![];var _0x5aa22e;var _0x22177c;return db[_0x6338('0x2e')][_0x6338('0x48')]({'where':{'id':_0x4b2116[_0x6338('0x51')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x6338('0x100')],'as':'Intervals','attributes':['id',_0x6338('0xf9')],'raw':!![]}]}]})[_0x6338('0x13')](handleEntityNotFound(_0x5313a1,null))['then'](function(_0x480fc8){if(_0x480fc8){_0x5aa22e=_0x480fc8;return _0x480fc8[_0x6338('0x101')]({'raw':!![]});}})[_0x6338('0x13')](function(_0x5520de){if(_0x5aa22e){if(_0x5520de){_0x22177c=_0x5520de;}}return require(_0x6338('0x6b'))[_0x6338('0x6c')]();})['then'](function(_0x5a45a7){if(_0x5a45a7){_0x4998d8=_0x5a45a7[_0x6338('0x102')];_0x20a4a0=_0x5a45a7[_0x6338('0x6d')];}})['then'](function(){return db['ChatInteraction'][_0x6338('0x21')]({'where':{'closed':![]}});})[_0x6338('0x13')](function(_0xd35c3f){_0x5716f6=_0xd35c3f;if(_0x4998d8&&_0xd35c3f>_0x4998d8){return db['License'][_0x6338('0x57')]({'where':{'id':0x1}})['then'](function(_0x43b757){if(_0x43b757){_0x43b757[_0x6338('0x103')](_0x6338('0x104'));}});}})['then'](function(){if(_0x5aa22e['Interval']&&_0x5aa22e[_0x6338('0x100')]['Intervals']){var _0x120b1f=[];for(var _0x148668=0x0;_0x148668<_0x5aa22e[_0x6338('0x100')]['Intervals']['length'];_0x148668++){var _0x3d33a7=_0x5aa22e['Interval'][_0x6338('0x105')][_0x148668]['get']({'plain':!![]});_0x120b1f[_0x6338('0xb5')](iftimePromise(_0x3d33a7,_0x5aa22e));}return BPromise[_0x6338('0x106')](_0x120b1f)['then'](function(_0x52f212){return _[_0x6338('0x107')](_0x52f212);});}else{return!![];}})[_0x6338('0x13')](function(_0x4aeacd){var _0x4f43e9=fs[_0x6338('0x108')](path['join'](config[_0x6338('0x69')],'server/files/chat/iframe.ejs'),_0x6338('0xcc'));var _0x3cfdd0={'remote':_0x5aa22e['remote'],'query':querystring[_0x6338('0x109')](_[_0x6338('0x40')](_0x5aa22e[_0x6338('0x4b')]({'plain':!![]}),{'customerIp':_0x4b2116[_0x6338('0x7d')][_0x6338('0x9f')]||_0x4b2116['headers'][_0x6338('0x10a')]||_0x4b2116['connection'][_0x6338('0x10b')]||_0x4b2116['ip'],'referer':_0x4b2116['headers'][_0x6338('0xa4')],'openedInteractions':_0x5716f6,'maxInteractions':_0x4998d8,'virtual':_0x20a4a0[_0x6338('0x102')],'online':_0x4aeacd,'custom':_0x20a4a0}))['replace'](/'/g,'\x5c\x27')};_0x5313a1[_0x6338('0xc5')](ejs['render'](Mustache['render'](_0x4f43e9,_0x3cfdd0),{'proactiveActions':_0x22177c,'alignment':_0x5aa22e[_0x6338('0x10c')],'verticalAlignment':_0x5aa22e[_0x6338('0x10d')],'div_color':_0x5aa22e[_0x6338('0xf3')],'labelText':_0x5aa22e['labelText'],'text_color':_0x5aa22e[_0x6338('0x10e')],'text_button_color':_0x5aa22e[_0x6338('0x10f')],'button_color':_0x5aa22e[_0x6338('0x110')],'background_color':_0x5aa22e['backgroundColor'],'hideWhenOffline':_0x5aa22e['hideWhenOffline'],'interval':_0x5aa22e[_0x6338('0x111')]}));})[_0x6338('0x1c')](handleError(_0x5313a1,null));};exports[_0x6338('0x112')]=function(_0x49aaa5,_0x13e062){var _0x5c85ad=_0x49aaa5[_0x6338('0x51')]['id'];var _0x278aea=_0x49aaa5['body'];var _0x209232=0xc8;var _0x77db06=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x6338('0xd6')][_0x6338('0x113')][_0x6338('0x114')]['READ_COMMITTED']},function(_0x1fc3a4){return db[_0x6338('0x2e')][_0x6338('0x57')]({'where':{'id':_0x5c85ad},'transaction':_0x1fc3a4})['then'](function(_0x947a80){if(_0x947a80){return db[_0x6338('0x115')]['destroy']({'where':{'ChatWebsiteId':_0x5c85ad},'transaction':_0x1fc3a4})['then'](function(){var _0x153c49=_['map'](_0x278aea,function(_0x53f642){_0x53f642[_0x6338('0x54')]=_0x5c85ad;return _0x53f642;});return db['ChatApplication'][_0x6338('0xd9')](_0x153c49,{'transaction':_0x1fc3a4});});}else{_0x209232=0x194;_0x77db06=[];}});})[_0x6338('0x13')](function(){if(_0x209232!==0x194){return db[_0x6338('0x115')][_0x6338('0x116')]({'where':{'ChatWebsiteId':_0x5c85ad},'order':_0x6338('0x99')})[_0x6338('0x13')](function(_0x336e14){_0x77db06=_0x336e14;});}})[_0x6338('0x1c')](function(_0x4fd6e2){_0x209232=0x1f4;logger[_0x6338('0x18')](_0x4fd6e2['stack']);if(_0x4fd6e2['name']){delete _0x4fd6e2[_0x6338('0x29')];}_0x77db06=_0x4fd6e2;})['finally'](function(){if(_0x77db06===null){_0x13e062[_0x6338('0x1d')](_0x209232);}else{if(_0x209232===0x1f4){_0x13e062[_0x6338('0x1e')](_0x209232)[_0x6338('0xc5')](_0x77db06);}else{_0x13e062[_0x6338('0x1e')](_0x209232)['json'](_0x77db06);}}});};exports[_0x6338('0x117')]=function(_0x5e890b,_0x39d535){var _0x4783af={};var _0x4b8184={};var _0x2f5792;var _0x568cd3;return db[_0x6338('0x2e')][_0x6338('0x57')]({'where':{'id':_0x5e890b['params']['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x39d535,null))[_0x6338('0x13')](function(_0x596b54){if(_0x596b54){_0x2f5792=_0x596b54;_0x4b8184[_0x6338('0x32')]=_['keys'](db[_0x6338('0x115')][_0x6338('0x47')]);_0x4b8184[_0x6338('0x33')]=_[_0x6338('0x34')](_0x5e890b[_0x6338('0x33')]);_0x4b8184[_0x6338('0x3d')]=_[_0x6338('0x35')](_0x4b8184['model'],_0x4b8184[_0x6338('0x33')]);_0x4783af['attributes']=_[_0x6338('0x35')](_0x4b8184[_0x6338('0x32')],qs[_0x6338('0x36')](_0x5e890b[_0x6338('0x33')][_0x6338('0x36')]));_0x4783af[_0x6338('0x37')]=_0x4783af[_0x6338('0x37')][_0x6338('0x38')]?_0x4783af[_0x6338('0x37')]:_0x4b8184['model'];_0x4783af[_0x6338('0x3b')]=qs[_0x6338('0x3c')](_0x5e890b['query']['sort']);_0x4783af[_0x6338('0x3f')]=qs['filters'](_['pick'](_0x5e890b['query'],_0x4b8184[_0x6338('0x3d')]));if(_0x5e890b[_0x6338('0x33')][_0x6338('0x42')]){_0x4783af[_0x6338('0x3f')]=_[_0x6338('0x40')](_0x4783af[_0x6338('0x3f')],{'$or':_[_0x6338('0x2d')](_0x4783af['attributes'],function(_0x573a73){var _0x5b0ae6={};_0x5b0ae6[_0x573a73]={'$like':'%'+_0x5e890b[_0x6338('0x33')]['filter']+'%'};return _0x5b0ae6;})});}_0x4783af=_['merge']({},_0x4783af,_0x5e890b['options']);return _0x2f5792[_0x6338('0x117')](_0x4783af);}})['then'](function(_0x136577){if(_0x136577){_0x568cd3=_0x136577[_0x6338('0x38')];if(!_0x5e890b[_0x6338('0x33')][_0x6338('0x39')](_0x6338('0x3a'))){_0x4783af[_0x6338('0x20')]=qs[_0x6338('0x20')](_0x5e890b['query'][_0x6338('0x20')]);_0x4783af['offset']=qs[_0x6338('0x22')](_0x5e890b['query'][_0x6338('0x22')]);}return _0x2f5792[_0x6338('0x117')](_0x4783af);}})['then'](function(_0x1e69bf){if(_0x1e69bf){return _0x1e69bf?{'count':_0x568cd3,'rows':_0x1e69bf}:null;}})[_0x6338('0x13')](respondWithResult(_0x39d535,null))[_0x6338('0x1c')](handleError(_0x39d535,null));};exports[_0x6338('0x118')]=function(_0x283a8c,_0x75fae3){return db[_0x6338('0x119')][_0x6338('0x48')]({'where':{'id':_0x283a8c[_0x6338('0x51')]['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x75fae3,null))[_0x6338('0x13')](function(_0x3c9d60){if(_0x3c9d60){return _0x3c9d60[_0x6338('0x118')](_0x283a8c['body'][_0x6338('0x5a')],_['omit'](_0x283a8c[_0x6338('0x50')],[_0x6338('0x5a'),'id'])||{});}})[_0x6338('0x13')](respondWithResult(_0x75fae3,null))[_0x6338('0x1c')](handleError(_0x75fae3,null));};exports['getProactiveActions']=function(_0x1e07c2,_0x2d93da){var _0x5fe76c={};var _0x420798={};var _0x305d1f;var _0x17b4db;return db[_0x6338('0x2e')][_0x6338('0x57')]({'where':{'id':_0x1e07c2[_0x6338('0x51')]['id']}})['then'](handleEntityNotFound(_0x2d93da,null))[_0x6338('0x13')](function(_0x3c80bc){if(_0x3c80bc){_0x305d1f=_0x3c80bc;_0x420798[_0x6338('0x32')]=_[_0x6338('0x34')](db['ChatProactiveAction'][_0x6338('0x47')]);_0x420798['query']=_['keys'](_0x1e07c2[_0x6338('0x33')]);_0x420798['filters']=_[_0x6338('0x35')](_0x420798[_0x6338('0x32')],_0x420798[_0x6338('0x33')]);_0x5fe76c['attributes']=_[_0x6338('0x35')](_0x420798[_0x6338('0x32')],qs[_0x6338('0x36')](_0x1e07c2['query'][_0x6338('0x36')]));_0x5fe76c['attributes']=_0x5fe76c[_0x6338('0x37')]['length']?_0x5fe76c[_0x6338('0x37')]:_0x420798[_0x6338('0x32')];_0x5fe76c['order']=qs['sort'](_0x1e07c2[_0x6338('0x33')][_0x6338('0x3c')]);_0x5fe76c[_0x6338('0x3f')]=qs['filters'](_['pick'](_0x1e07c2[_0x6338('0x33')],_0x420798[_0x6338('0x3d')]));if(_0x1e07c2[_0x6338('0x33')][_0x6338('0x42')]){_0x5fe76c[_0x6338('0x3f')]=_['merge'](_0x5fe76c[_0x6338('0x3f')],{'$or':_[_0x6338('0x2d')](_0x5fe76c[_0x6338('0x37')],function(_0x1accd9){var _0x7282cd={};_0x7282cd[_0x1accd9]={'$like':'%'+_0x1e07c2[_0x6338('0x33')]['filter']+'%'};return _0x7282cd;})});}_0x5fe76c=_[_0x6338('0x40')]({},_0x5fe76c,_0x1e07c2[_0x6338('0x43')]);return _0x305d1f[_0x6338('0x101')](_0x5fe76c);}})[_0x6338('0x13')](function(_0x32cf57){if(_0x32cf57){_0x17b4db=_0x32cf57[_0x6338('0x38')];if(!_0x1e07c2[_0x6338('0x33')][_0x6338('0x39')](_0x6338('0x3a'))){_0x5fe76c[_0x6338('0x20')]=qs[_0x6338('0x20')](_0x1e07c2[_0x6338('0x33')][_0x6338('0x20')]);_0x5fe76c[_0x6338('0x22')]=qs[_0x6338('0x22')](_0x1e07c2['query'][_0x6338('0x22')]);}return _0x305d1f[_0x6338('0x101')](_0x5fe76c);}})[_0x6338('0x13')](function(_0xca126b){if(_0xca126b){return _0xca126b?{'count':_0x17b4db,'rows':_0xca126b}:null;}})[_0x6338('0x13')](respondWithResult(_0x2d93da,null))[_0x6338('0x1c')](handleError(_0x2d93da,null));};exports['getFields']=function(_0x56d74d,_0x5204ec){var _0x1cb7cf=_0x56d74d[_0x6338('0x33')][_0x6338('0x11a')]===_0x6338('0x11b')?'offlineForm':'onlineForm';return db['ChatWebsite'][_0x6338('0x48')]({'attributes':['id',_0x1cb7cf],'where':{'id':_0x56d74d['params']['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x5204ec,null))[_0x6338('0x13')](function(_0x43cde7){if(_0x43cde7){var _0x4fe2a8=_0x43cde7[_0x1cb7cf];var _0x313ecd=_0x4fe2a8&&_0x4fe2a8[_0x6338('0x11c')]?_0x4fe2a8[_0x6338('0x11c')]:[];_0x5204ec[_0x6338('0xc5')]({'fromKey':_[_0x6338('0x6e')](_0x4fe2a8['fromKey'])?undefined:_0x4fe2a8[_0x6338('0x11d')],'count':_0x313ecd[_0x6338('0x38')],'rows':_0x313ecd});}})[_0x6338('0x1c')](handleError(_0x5204ec,null));};exports[_0x6338('0x11e')]=function(_0x228b41,_0x1788f4){var _0x576b35={'raw':![],'where':{}};var _0x264904={};var _0x4568a7={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x228b41[_0x6338('0x51')]['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x1788f4,null))['then'](function(_0x41eb01){if(_0x41eb01){_0x264904[_0x6338('0x32')]=_[_0x6338('0x34')](db[_0x6338('0xcf')][_0x6338('0x47')]);_0x264904[_0x6338('0x33')]=_[_0x6338('0x34')](_0x228b41[_0x6338('0x33')]);_0x264904[_0x6338('0x3d')]=_[_0x6338('0x35')](_0x264904[_0x6338('0x32')],_0x264904[_0x6338('0x33')]);_0x576b35['attributes']=_[_0x6338('0x35')](_0x264904[_0x6338('0x32')],qs['fields'](_0x228b41[_0x6338('0x33')][_0x6338('0x36')]));_0x576b35[_0x6338('0x37')]=_0x576b35[_0x6338('0x37')][_0x6338('0x38')]?_0x576b35[_0x6338('0x37')]:_0x264904[_0x6338('0x32')];if(!_0x228b41[_0x6338('0x33')][_0x6338('0x39')](_0x6338('0x3a'))){_0x576b35[_0x6338('0x20')]=qs['limit'](_0x228b41['query'][_0x6338('0x20')]);_0x576b35['offset']=qs[_0x6338('0x22')](_0x228b41[_0x6338('0x33')][_0x6338('0x22')]);}_0x576b35[_0x6338('0x3b')]=qs['sort'](_0x228b41[_0x6338('0x33')][_0x6338('0x3c')]);_0x576b35['where']=qs['filters'](_[_0x6338('0x3e')](_0x228b41[_0x6338('0x33')],_0x264904[_0x6338('0x3d')]));_0x576b35[_0x6338('0x3f')][_0x6338('0x54')]=_0x41eb01['id'];if(_0x228b41[_0x6338('0x33')][_0x6338('0x42')]){_0x576b35[_0x6338('0x3f')]=_[_0x6338('0x40')](_0x576b35[_0x6338('0x3f')],{'$or':_[_0x6338('0x2d')](_0x576b35['attributes'],function(_0x5b3723){var _0x5c81ff={};_0x5c81ff[_0x5b3723]={'$like':'%'+_0x228b41['query'][_0x6338('0x42')]+'%'};return _0x5c81ff;})});}_0x576b35=_[_0x6338('0x40')]({},_0x576b35,_0x228b41[_0x6338('0x43')]);return db[_0x6338('0xcf')]['count']({'where':_0x576b35['where']})[_0x6338('0x13')](function(_0x9fd01){_0x4568a7[_0x6338('0x21')]=_0x9fd01;if(_0x228b41[_0x6338('0x33')][_0x6338('0x44')]){_0x576b35[_0x6338('0x58')]=[{'all':!![]}];}else{_0x576b35['include']=[{'model':db[_0x6338('0x91')],'as':'Contact','required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db['ChatOfflineMessage'][_0x6338('0x45')](_0x576b35);})['then'](function(_0x22f3f3){_0x4568a7[_0x6338('0x46')]=_0x22f3f3;return _0x4568a7;});}})['then'](respondWithFilteredResult(_0x1788f4,_0x576b35))[_0x6338('0x1c')](handleError(_0x1788f4,null));};exports[_0x6338('0x11f')]=function(_0x3d1971,_0x30408b){return db[_0x6338('0x2e')]['find']({'where':{'id':_0x3d1971[_0x6338('0x51')]['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x30408b,null))[_0x6338('0x13')](function(_0x1c2fc5){if(_0x1c2fc5){return _0x1c2fc5[_0x6338('0x11f')](_0x3d1971['body']['ids'],_['omit'](_0x3d1971[_0x6338('0x50')],[_0x6338('0x5a'),'id'])||{})['spread'](function(_0x4b8545){for(var _0x551005=0x0;_0x551005<_0x3d1971['body'][_0x6338('0x5a')][_0x6338('0x38')];_0x551005+=0x1){socket[_0x6338('0x120')](_0x6338('0x121'),{'UserId':Number(_0x3d1971[_0x6338('0x50')][_0x6338('0x5a')][_0x551005]),'ChatWebsiteId':Number(_0x3d1971[_0x6338('0x51')]['id'])});}return _0x4b8545;});}})[_0x6338('0x13')](respondWithResult(_0x30408b,null))[_0x6338('0x1c')](handleError(_0x30408b,null));};exports[_0x6338('0x122')]=function(_0x4264e7,_0x349d41){return db[_0x6338('0x2e')][_0x6338('0x48')]({'where':{'id':_0x4264e7['params']['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x349d41,null))[_0x6338('0x13')](function(_0x1bc6c5){if(_0x1bc6c5){return _0x1bc6c5[_0x6338('0x122')](_0x4264e7['query'][_0x6338('0x5a')])['then'](function(){if(_[_0x6338('0x123')](_0x4264e7[_0x6338('0x33')][_0x6338('0x5a')])){for(var _0x1c9a4f=0x0;_0x1c9a4f<_0x4264e7[_0x6338('0x33')][_0x6338('0x5a')][_0x6338('0x38')];_0x1c9a4f+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x4264e7[_0x6338('0x33')][_0x6338('0x5a')][_0x1c9a4f]),'ChatWebsiteId':Number(_0x4264e7[_0x6338('0x51')]['id'])});}}else{socket[_0x6338('0x120')](_0x6338('0x124'),{'UserId':Number(_0x4264e7[_0x6338('0x33')][_0x6338('0x5a')]),'ChatWebsiteId':Number(_0x4264e7[_0x6338('0x51')]['id'])});}});}})[_0x6338('0x13')](respondWithStatusCode(_0x349d41,null))['catch'](handleError(_0x349d41,null));};exports[_0x6338('0x125')]=function(_0x33abc0,_0x3a15ed){var _0x17787c={};var _0x580922={};var _0xa5bc22;var _0xe48063;return db[_0x6338('0x2e')][_0x6338('0x57')]({'where':{'id':_0x33abc0['params']['id']}})[_0x6338('0x13')](handleEntityNotFound(_0x3a15ed,null))[_0x6338('0x13')](function(_0x34882f){if(_0x34882f){_0xa5bc22=_0x34882f;_0x580922['model']=_[_0x6338('0x34')](db[_0x6338('0xbc')]['rawAttributes']);_0x580922[_0x6338('0x33')]=_[_0x6338('0x34')](_0x33abc0['query']);_0x580922[_0x6338('0x3d')]=_[_0x6338('0x35')](_0x580922[_0x6338('0x32')],_0x580922[_0x6338('0x33')]);_0x17787c[_0x6338('0x37')]=_[_0x6338('0x35')](_0x580922['model'],qs['fields'](_0x33abc0[_0x6338('0x33')]['fields']));_0x17787c['attributes']=_0x17787c[_0x6338('0x37')][_0x6338('0x38')]?_0x17787c['attributes']:_0x580922[_0x6338('0x32')];_0x17787c[_0x6338('0x3b')]=qs[_0x6338('0x3c')](_0x33abc0[_0x6338('0x33')][_0x6338('0x3c')]);_0x17787c[_0x6338('0x3f')]=qs[_0x6338('0x3d')](_[_0x6338('0x3e')](_0x33abc0[_0x6338('0x33')],_0x580922[_0x6338('0x3d')]));if(_0x33abc0[_0x6338('0x33')][_0x6338('0x42')]){_0x17787c[_0x6338('0x3f')]=_['merge'](_0x17787c[_0x6338('0x3f')],{'$or':_['map'](_0x17787c['attributes'],function(_0x483388){var _0x46cfd9={};_0x46cfd9[_0x483388]={'$like':'%'+_0x33abc0[_0x6338('0x33')][_0x6338('0x42')]+'%'};return _0x46cfd9;})});}_0x17787c=_['merge']({},_0x17787c,_0x33abc0['options']);return _0xa5bc22[_0x6338('0x125')](_0x17787c);}})[_0x6338('0x13')](function(_0x226549){if(_0x226549){_0xe48063=_0x226549['length'];if(!_0x33abc0[_0x6338('0x33')][_0x6338('0x39')]('nolimit')){_0x17787c['limit']=qs['limit'](_0x33abc0[_0x6338('0x33')]['limit']);_0x17787c['offset']=qs[_0x6338('0x22')](_0x33abc0[_0x6338('0x33')][_0x6338('0x22')]);}return _0xa5bc22['getAgents'](_0x17787c);}})[_0x6338('0x13')](function(_0x224ee6){if(_0x224ee6){return _0x224ee6?{'count':_0xe48063,'rows':_0x224ee6}:null;}})[_0x6338('0x13')](respondWithResult(_0x3a15ed,null))[_0x6338('0x1c')](handleError(_0x3a15ed,null));};
\ No newline at end of file
+var _0x8050=['destroy','then','get','ChatWebsites','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','model','query','fields','attributes','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','keys','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','file','addAvatar','customerAvatar','filename','addSystemAvatar','systemAvatar','getLogo','root','custom','existsSync','server/files/images/logos/','join','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','agentAvatar','server/files/images/avatars/','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','headers','user-agent','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','from','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','ChatApplication','Applications','List','account','applications','list','orderBy','priority','asc','Contacts','defaults','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','close','unmanaged','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','CompanyId','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','mimetype','server','files','attachments','offline-chat','sequelize','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','openNewInteraction','originalname','toPairsIn','MailAccountId','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','internal','Tags','color','tag','findAll','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','getLicense','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','virtual','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','hideWhenOffline','addApplications','transaction','Transaction','ISOLATION_LEVELS','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','querystring','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','html-to-text','jayson/promise','client','http','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','update'];(function(_0x46e603,_0x324b67){var _0xbba20e=function(_0x3a2b04){while(--_0x3a2b04){_0x46e603['push'](_0x46e603['shift']());}};_0xbba20e(++_0x324b67);}(_0x8050,0xff));var _0x0805=function(_0x38c71d,_0x49e6b7){_0x38c71d=_0x38c71d-0x0;var _0x1953d8=_0x8050[_0x38c71d];return _0x1953d8;};'use strict';var BPromise=require(_0x0805('0x0'));var Mustache=require(_0x0805('0x1'));var util=require(_0x0805('0x2'));var path=require(_0x0805('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0805('0x4'));var _=require('lodash');var querystring=require(_0x0805('0x5'));var Redis=require(_0x0805('0x6'));var qs=require(_0x0805('0x7'));var logger=require(_0x0805('0x8'))('api');var config=require(_0x0805('0x9'));var db=require(_0x0805('0xa'))['db'];config[_0x0805('0xb')]=_['defaults'](config['redis'],{'host':_0x0805('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0805('0xb')]));require('./chatWebsite.socket')['register'](socket);var htmlToText=require(_0x0805('0xd'));var jayson=require(_0x0805('0xe'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x0805('0xf')]['http']({'port':0x232a});var client9003=jayson[_0x0805('0xf')][_0x0805('0x10')]({'port':0x232b});var client9001=jayson[_0x0805('0xf')][_0x0805('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x12f5b4,_0x107cc0,_0x579291,_0x297480){return new BPromise(function(_0x821163,_0xece44a){var _0x25dd1c=_0x297480||client;return _0x25dd1c[_0x0805('0x11')](_0x12f5b4,_0x579291)['then'](function(_0x13cd70){logger['info'](_0x0805('0x12'),_0x107cc0,_0x0805('0x13'));logger[_0x0805('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x107cc0,_0x0805('0x13'),JSON[_0x0805('0x15')](_0x13cd70));if(_0x13cd70[_0x0805('0x16')]){if(_0x13cd70[_0x0805('0x16')][_0x0805('0x17')]===0x1f4){logger[_0x0805('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x107cc0,_0x13cd70[_0x0805('0x16')][_0x0805('0x18')]);return _0xece44a(_0x13cd70['error']['message']);}logger['error'](_0x0805('0x12'),_0x107cc0,_0x13cd70['error']['message']);return _0x821163(_0x13cd70['error'][_0x0805('0x18')]);}else{logger['info'](_0x0805('0x12'),_0x107cc0,'request\x20sent');_0x821163(_0x13cd70[_0x0805('0x19')][_0x0805('0x18')]);}})[_0x0805('0x1a')](function(_0x56b268){logger[_0x0805('0x16')](_0x0805('0x12'),_0x107cc0,_0x56b268);_0xece44a(_0x56b268);});});}function respondWithStatusCode(_0x3040b0,_0x31d4d8){_0x31d4d8=_0x31d4d8||0xcc;return function(_0x181786){if(_0x181786){return _0x3040b0[_0x0805('0x1b')](_0x31d4d8);}return _0x3040b0[_0x0805('0x1c')](_0x31d4d8)[_0x0805('0x1d')]();};}function respondWithResult(_0x43061f,_0x578486){_0x578486=_0x578486||0xc8;return function(_0x38f7ec){if(_0x38f7ec){return _0x43061f[_0x0805('0x1c')](_0x578486)[_0x0805('0x1e')](_0x38f7ec);}};}function respondWithFilteredResult(_0x2d84f0,_0x444632){return function(_0x2fa1f5){if(_0x2fa1f5){var _0x19b957=typeof _0x444632[_0x0805('0x1f')]==='undefined'&&typeof _0x444632['limit']===_0x0805('0x20');var _0xf37a6=_0x2fa1f5[_0x0805('0x21')];var _0x15acd7=_0x19b957?0x0:_0x444632[_0x0805('0x1f')];var _0x57286d=_0x19b957?_0x2fa1f5['count']:_0x444632[_0x0805('0x1f')]+_0x444632['limit'];var _0x4a59a9;if(_0x57286d>=_0xf37a6){_0x57286d=_0xf37a6;_0x4a59a9=0xc8;}else{_0x4a59a9=0xce;}_0x2d84f0[_0x0805('0x1c')](_0x4a59a9);return _0x2d84f0[_0x0805('0x22')]('Content-Range',_0x15acd7+'-'+_0x57286d+'/'+_0xf37a6)['json'](_0x2fa1f5);}return null;};}function saveUpdates(_0x265675){return function(_0x369cea){if(_0x369cea){return _0x369cea[_0x0805('0x23')](_0x265675)['then'](function(_0x2305d1){return _0x2305d1;});}return null;};}function removeEntity(_0xc0085){return function(_0x1c5378){if(_0x1c5378){return _0x1c5378[_0x0805('0x24')]()[_0x0805('0x25')](function(){var _0x377f7a=_0x1c5378[_0x0805('0x26')]({'plain':!![]});var _0x4d7b18=_0x0805('0x27');return db[_0x0805('0x28')]['destroy']({'where':{'type':_0x4d7b18,'resourceId':_0x377f7a['id']}})[_0x0805('0x25')](function(){return _0x1c5378;});})[_0x0805('0x25')](function(){_0xc0085['status'](0xcc)[_0x0805('0x1d')]();});}};}function handleEntityNotFound(_0x45d150){return function(_0x359234){if(!_0x359234){_0x45d150[_0x0805('0x1b')](0x194);}return _0x359234;};}function handleError(_0x56978d,_0x190509){_0x190509=_0x190509||0x1f4;return function(_0x3b56b4){logger[_0x0805('0x16')](_0x3b56b4['stack']);if(_0x3b56b4[_0x0805('0x29')]){delete _0x3b56b4[_0x0805('0x29')];}_0x56978d['status'](_0x190509)[_0x0805('0x2a')](_0x3b56b4);};}exports[_0x0805('0x2b')]=function(_0x1f6f5a,_0x3bdb7d){var _0x41519a={'include':[{'model':db[_0x0805('0x2c')],'as':_0x0805('0x2d')}]},_0x35568d={},_0x2f86cb={'count':0x0,'rows':[]};var _0x4db594=_[_0x0805('0x2e')](db[_0x0805('0x2f')][_0x0805('0x30')],function(_0x512898){return{'name':_0x512898[_0x0805('0x31')],'type':_0x512898['type']['key']};});_0x35568d[_0x0805('0x32')]=_['map'](_0x4db594,'name');_0x35568d[_0x0805('0x33')]=_['keys'](_0x1f6f5a[_0x0805('0x33')]);_0x35568d['filters']=_['intersection'](_0x35568d[_0x0805('0x32')],_0x35568d[_0x0805('0x33')]);_0x41519a['attributes']=_['intersection'](_0x35568d[_0x0805('0x32')],qs[_0x0805('0x34')](_0x1f6f5a['query'][_0x0805('0x34')]));_0x41519a[_0x0805('0x35')]=_0x41519a['attributes'][_0x0805('0x36')]?_0x41519a['attributes']:_0x35568d['model'];if(!_0x1f6f5a[_0x0805('0x33')][_0x0805('0x37')]('nolimit')){_0x41519a[_0x0805('0x38')]=qs[_0x0805('0x38')](_0x1f6f5a[_0x0805('0x33')][_0x0805('0x38')]);_0x41519a[_0x0805('0x1f')]=qs['offset'](_0x1f6f5a[_0x0805('0x33')][_0x0805('0x1f')]);}_0x41519a[_0x0805('0x39')]=qs[_0x0805('0x3a')](_0x1f6f5a['query'][_0x0805('0x3a')]);_0x41519a[_0x0805('0x3b')]=qs[_0x0805('0x3c')](_[_0x0805('0x3d')](_0x1f6f5a[_0x0805('0x33')],_0x35568d[_0x0805('0x3c')]),_0x4db594);if(_0x1f6f5a[_0x0805('0x33')][_0x0805('0x3e')]){_0x41519a[_0x0805('0x3b')]=_[_0x0805('0x3f')](_0x41519a[_0x0805('0x3b')],{'$or':_['map'](_0x4db594,function(_0x3bf916){if(_0x3bf916[_0x0805('0x40')]!==_0x0805('0x41')){var _0x4495ef={};_0x4495ef[_0x3bf916[_0x0805('0x29')]]={'$like':'%'+_0x1f6f5a[_0x0805('0x33')][_0x0805('0x3e')]+'%'};return _0x4495ef;}})});}_0x41519a=_[_0x0805('0x3f')]({},_0x41519a,_0x1f6f5a[_0x0805('0x42')]);var _0x556287={'where':_0x41519a['where']};return db[_0x0805('0x2f')][_0x0805('0x21')](_0x556287)[_0x0805('0x25')](function(_0x53f09e){_0x2f86cb[_0x0805('0x21')]=_0x53f09e;if(_0x1f6f5a['query'][_0x0805('0x43')]){_0x41519a[_0x0805('0x44')]=[{'all':!![]}];}return db[_0x0805('0x2f')]['findAll'](_0x41519a);})[_0x0805('0x25')](function(_0x2f6e62){_0x2f86cb[_0x0805('0x45')]=_0x2f6e62;return _0x2f86cb;})['then'](respondWithFilteredResult(_0x3bdb7d,_0x41519a))['catch'](handleError(_0x3bdb7d,null));};exports[_0x0805('0x46')]=function(_0x1af756,_0x281b31){var _0x1c1058={'raw':![],'where':{'id':_0x1af756[_0x0805('0x47')]['id']},'include':[{'model':db[_0x0805('0x2c')],'as':_0x0805('0x2d')}]},_0x44ee5e={};_0x44ee5e[_0x0805('0x32')]=_['keys'](db['ChatWebsite'][_0x0805('0x30')]);_0x44ee5e['query']=_[_0x0805('0x48')](_0x1af756['query']);_0x44ee5e[_0x0805('0x3c')]=_[_0x0805('0x49')](_0x44ee5e[_0x0805('0x32')],_0x44ee5e['query']);_0x1c1058['attributes']=_['intersection'](_0x44ee5e['model'],qs[_0x0805('0x34')](_0x1af756[_0x0805('0x33')][_0x0805('0x34')]));_0x1c1058['attributes']=_0x1c1058[_0x0805('0x35')][_0x0805('0x36')]?_0x1c1058[_0x0805('0x35')]:_0x44ee5e[_0x0805('0x32')];if(_0x1af756[_0x0805('0x33')][_0x0805('0x43')]){_0x1c1058[_0x0805('0x44')]=[{'all':!![]}];}_0x1c1058=_[_0x0805('0x3f')]({},_0x1c1058,_0x1af756[_0x0805('0x42')]);return db[_0x0805('0x2f')][_0x0805('0x4a')](_0x1c1058)[_0x0805('0x25')](handleEntityNotFound(_0x281b31,null))['then'](respondWithResult(_0x281b31,null))[_0x0805('0x1a')](handleError(_0x281b31,null));};exports[_0x0805('0x4b')]=function(_0x3ab97a,_0x383872){return db[_0x0805('0x2f')]['create'](_0x3ab97a[_0x0805('0x4c')],{})[_0x0805('0x25')](function(_0x445b58){var _0xa08631=_0x3ab97a['user'][_0x0805('0x26')]({'plain':!![]});if(!_0xa08631)throw new Error(_0x0805('0x4d'));if(_0xa08631[_0x0805('0x4e')]===_0x0805('0x4f')){var _0x10ff0f=_0x445b58['get']({'plain':!![]});var _0x484f14=_0x0805('0x27');return db['UserProfileSection'][_0x0805('0x4a')]({'where':{'name':_0x484f14,'userProfileId':_0xa08631['userProfileId']},'raw':!![]})[_0x0805('0x25')](function(_0x5dd867){if(_0x5dd867&&_0x5dd867[_0x0805('0x50')]===0x0){return db[_0x0805('0x28')]['create']({'name':_0x10ff0f[_0x0805('0x29')],'resourceId':_0x10ff0f['id'],'type':_0x5dd867[_0x0805('0x29')],'sectionId':_0x5dd867['id']},{})[_0x0805('0x25')](function(){return _0x445b58;});}else{return _0x445b58;}})[_0x0805('0x1a')](function(_0x5c83d8){logger[_0x0805('0x16')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c83d8);throw _0x5c83d8;});}return _0x445b58;})['then'](respondWithResult(_0x383872,0xc9))[_0x0805('0x1a')](handleError(_0x383872,null));};exports['update']=function(_0x1f45bd,_0x13b16c){if(_0x1f45bd[_0x0805('0x4c')]['id']){delete _0x1f45bd[_0x0805('0x4c')]['id'];}return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x1f45bd[_0x0805('0x47')]['id']},'include':[{'model':db[_0x0805('0x2c')],'as':'mandatoryDispositionPause'}]})[_0x0805('0x25')](handleEntityNotFound(_0x13b16c,null))['then'](saveUpdates(_0x1f45bd['body'],null))[_0x0805('0x25')](respondWithResult(_0x13b16c,null))[_0x0805('0x1a')](handleError(_0x13b16c,null));};exports[_0x0805('0x24')]=function(_0x41c4a6,_0x512743){return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x41c4a6['params']['id']}})['then'](handleEntityNotFound(_0x512743,null))[_0x0805('0x25')](removeEntity(_0x512743,null))['catch'](handleError(_0x512743,null));};exports[_0x0805('0x51')]=function(_0x2a7db1,_0xf13252){return db['ChatWebsite'][_0x0805('0x51')]()[_0x0805('0x25')](respondWithResult(_0xf13252,null))[_0x0805('0x1a')](handleError(_0xf13252,null));};exports[_0x0805('0x52')]=function(_0x5750eb,_0x3cf35d){if(_0x5750eb[_0x0805('0x4c')]['id']){delete _0x5750eb[_0x0805('0x4c')]['id'];}return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x5750eb['params']['id']}})['then'](handleEntityNotFound(_0x3cf35d,null))[_0x0805('0x25')](function(_0x250f00){if(_0x250f00){_0x5750eb[_0x0805('0x4c')][_0x0805('0x53')]=_0x250f00['id'];return db[_0x0805('0x54')][_0x0805('0x4b')](_0x5750eb[_0x0805('0x4c')]);}})[_0x0805('0x25')](respondWithResult(_0x3cf35d,null))['catch'](handleError(_0x3cf35d,null));};exports[_0x0805('0x55')]=function(_0x10e383,_0x45dc5a){var _0x2e100e={'raw':![],'where':{}};var _0x4f97f1={};var _0x25d0b8={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x10e383[_0x0805('0x47')]['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x45dc5a,null))[_0x0805('0x25')](function(_0x1954a3){if(_0x1954a3){_0x4f97f1[_0x0805('0x32')]=_[_0x0805('0x48')](db['Disposition'][_0x0805('0x30')]);_0x4f97f1[_0x0805('0x33')]=_[_0x0805('0x48')](_0x10e383[_0x0805('0x33')]);_0x4f97f1['filters']=_['intersection'](_0x4f97f1[_0x0805('0x32')],_0x4f97f1[_0x0805('0x33')]);_0x2e100e['attributes']=_[_0x0805('0x49')](_0x4f97f1[_0x0805('0x32')],qs[_0x0805('0x34')](_0x10e383[_0x0805('0x33')][_0x0805('0x34')]));_0x2e100e[_0x0805('0x35')]=_0x2e100e[_0x0805('0x35')][_0x0805('0x36')]?_0x2e100e[_0x0805('0x35')]:_0x4f97f1[_0x0805('0x32')];if(!_0x10e383['query'][_0x0805('0x37')](_0x0805('0x56'))){_0x2e100e['limit']=qs['limit'](_0x10e383[_0x0805('0x33')][_0x0805('0x38')]);_0x2e100e[_0x0805('0x1f')]=qs[_0x0805('0x1f')](_0x10e383[_0x0805('0x33')][_0x0805('0x1f')]);}_0x2e100e[_0x0805('0x39')]=qs[_0x0805('0x3a')](_0x10e383[_0x0805('0x33')][_0x0805('0x3a')]);_0x2e100e['where']=qs[_0x0805('0x3c')](_[_0x0805('0x3d')](_0x10e383[_0x0805('0x33')],_0x4f97f1['filters']));_0x2e100e['where'][_0x0805('0x53')]=_0x1954a3['id'];if(_0x10e383['query'][_0x0805('0x3e')]){_0x2e100e[_0x0805('0x3b')]=_[_0x0805('0x3f')](_0x2e100e[_0x0805('0x3b')],{'$or':_[_0x0805('0x2e')](_0x2e100e[_0x0805('0x35')],function(_0x5e62e7){var _0x54406e={};_0x54406e[_0x5e62e7]={'$like':'%'+_0x10e383['query'][_0x0805('0x3e')]+'%'};return _0x54406e;})});}_0x2e100e=_['merge']({},_0x2e100e,_0x10e383[_0x0805('0x42')]);return db['Disposition'][_0x0805('0x21')]({'where':_0x2e100e[_0x0805('0x3b')]})[_0x0805('0x25')](function(_0x48af2f){_0x25d0b8['count']=_0x48af2f;if(_0x10e383['query'][_0x0805('0x43')]){_0x2e100e[_0x0805('0x44')]=[{'all':!![]}];}return db[_0x0805('0x54')]['findAll'](_0x2e100e);})['then'](function(_0x1b0448){_0x25d0b8[_0x0805('0x45')]=_0x1b0448;return _0x25d0b8;});}})['then'](respondWithFilteredResult(_0x45dc5a,_0x2e100e))[_0x0805('0x1a')](handleError(_0x45dc5a,null));};exports['removeDispositions']=function(_0x40404e,_0x47a328){return db[_0x0805('0x2f')]['find']({'where':{'id':_0x40404e[_0x0805('0x47')]['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x47a328,null))[_0x0805('0x25')](function(_0x3a7a79){if(_0x3a7a79){return _0x3a7a79[_0x0805('0x57')](_0x40404e['query'][_0x0805('0x58')]);}})[_0x0805('0x25')](respondWithStatusCode(_0x47a328,null))[_0x0805('0x1a')](handleError(_0x47a328,null));};exports[_0x0805('0x59')]=function(_0x19f473,_0x75ecf0){if(_0x19f473[_0x0805('0x4c')]['id']){delete _0x19f473[_0x0805('0x4c')]['id'];}return db[_0x0805('0x2f')]['find']({'where':{'id':_0x19f473[_0x0805('0x47')]['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x75ecf0,null))[_0x0805('0x25')](function(_0x360388){if(_0x360388){_0x19f473[_0x0805('0x4c')][_0x0805('0x53')]=_0x360388['id'];return db[_0x0805('0x5a')]['create'](_0x19f473[_0x0805('0x4c')]);}})[_0x0805('0x25')](respondWithResult(_0x75ecf0,null))[_0x0805('0x1a')](handleError(_0x75ecf0,null));};exports[_0x0805('0x5b')]=function(_0x48804b,_0x5c7da9){var _0x2c5834={'raw':![],'where':{}};var _0x24279f={};var _0x1de493={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x0805('0x5c')]({'where':{'id':_0x48804b['params']['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x5c7da9,null))[_0x0805('0x25')](function(_0x4235e0){if(_0x4235e0){_0x24279f[_0x0805('0x32')]=_[_0x0805('0x48')](db['CannedAnswer'][_0x0805('0x30')]);_0x24279f[_0x0805('0x33')]=_['keys'](_0x48804b[_0x0805('0x33')]);_0x24279f[_0x0805('0x3c')]=_[_0x0805('0x49')](_0x24279f[_0x0805('0x32')],_0x24279f[_0x0805('0x33')]);_0x2c5834[_0x0805('0x35')]=_['intersection'](_0x24279f[_0x0805('0x32')],qs[_0x0805('0x34')](_0x48804b[_0x0805('0x33')][_0x0805('0x34')]));_0x2c5834[_0x0805('0x35')]=_0x2c5834[_0x0805('0x35')][_0x0805('0x36')]?_0x2c5834['attributes']:_0x24279f[_0x0805('0x32')];if(!_0x48804b[_0x0805('0x33')][_0x0805('0x37')](_0x0805('0x56'))){_0x2c5834[_0x0805('0x38')]=qs[_0x0805('0x38')](_0x48804b[_0x0805('0x33')][_0x0805('0x38')]);_0x2c5834[_0x0805('0x1f')]=qs['offset'](_0x48804b[_0x0805('0x33')][_0x0805('0x1f')]);}_0x2c5834[_0x0805('0x39')]=qs[_0x0805('0x3a')](_0x48804b[_0x0805('0x33')][_0x0805('0x3a')]);_0x2c5834[_0x0805('0x3b')]=qs['filters'](_['pick'](_0x48804b[_0x0805('0x33')],_0x24279f[_0x0805('0x3c')]));_0x2c5834[_0x0805('0x3b')][_0x0805('0x53')]=_0x4235e0['id'];if(_0x48804b[_0x0805('0x33')][_0x0805('0x3e')]){_0x2c5834['where']=_[_0x0805('0x3f')](_0x2c5834[_0x0805('0x3b')],{'$or':_[_0x0805('0x2e')](_0x2c5834[_0x0805('0x35')],function(_0x5069ea){var _0x366bb0={};_0x366bb0[_0x5069ea]={'$like':'%'+_0x48804b['query'][_0x0805('0x3e')]+'%'};return _0x366bb0;})});}_0x2c5834=_['merge']({},_0x2c5834,_0x48804b['options']);return db[_0x0805('0x5a')]['count']({'where':_0x2c5834[_0x0805('0x3b')]})['then'](function(_0x57f83e){_0x1de493['count']=_0x57f83e;if(_0x48804b[_0x0805('0x33')]['includeAll']){_0x2c5834[_0x0805('0x44')]=[{'all':!![]}];}return db[_0x0805('0x5a')]['findAll'](_0x2c5834);})[_0x0805('0x25')](function(_0x2bc428){_0x1de493[_0x0805('0x45')]=_0x2bc428;return _0x1de493;});}})['then'](respondWithFilteredResult(_0x5c7da9,_0x2c5834))[_0x0805('0x1a')](handleError(_0x5c7da9,null));};exports['removeAnswers']=function(_0x356549,_0x4054cc){return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x356549['params']['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x4054cc,null))[_0x0805('0x25')](function(_0x57d9f6){if(_0x57d9f6){return _0x57d9f6[_0x0805('0x5d')](_0x356549['query'][_0x0805('0x58')]);}})[_0x0805('0x25')](respondWithStatusCode(_0x4054cc,null))[_0x0805('0x1a')](handleError(_0x4054cc,null));};exports[_0x0805('0x5e')]=function(_0x3b18a2,_0x24770a){_0x3b18a2[_0x0805('0x4c')][_0x0805('0x5f')]=_0x3b18a2[_0x0805('0x60')]['filename'];return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x3b18a2['params']['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x24770a,null))[_0x0805('0x25')](saveUpdates(_0x3b18a2[_0x0805('0x4c')],null))[_0x0805('0x25')](respondWithResult(_0x24770a,null))[_0x0805('0x1a')](handleError(_0x24770a,null));};exports[_0x0805('0x61')]=function(_0x354c36,_0x50f80d){_0x354c36[_0x0805('0x4c')]['agentAvatar']=_0x354c36[_0x0805('0x60')]['filename'];return db[_0x0805('0x2f')]['find']({'where':{'id':_0x354c36[_0x0805('0x47')]['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x50f80d,null))[_0x0805('0x25')](saveUpdates(_0x354c36['body'],null))['then'](respondWithResult(_0x50f80d,null))[_0x0805('0x1a')](handleError(_0x50f80d,null));};exports['addCustomerAvatar']=function(_0x14ea1d,_0x29e7a4){_0x14ea1d[_0x0805('0x4c')][_0x0805('0x62')]=_0x14ea1d['file'][_0x0805('0x63')];return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x14ea1d[_0x0805('0x47')]['id']}})['then'](handleEntityNotFound(_0x29e7a4,null))[_0x0805('0x25')](saveUpdates(_0x14ea1d[_0x0805('0x4c')],null))['then'](respondWithResult(_0x29e7a4,null))[_0x0805('0x1a')](handleError(_0x29e7a4,null));};exports[_0x0805('0x64')]=function(_0x11aa2c,_0x4e44a5){_0x11aa2c['body'][_0x0805('0x65')]=_0x11aa2c[_0x0805('0x60')][_0x0805('0x63')];return db['ChatWebsite'][_0x0805('0x4a')]({'where':{'id':_0x11aa2c['params']['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x4e44a5,null))[_0x0805('0x25')](saveUpdates(_0x11aa2c[_0x0805('0x4c')],null))['then'](respondWithResult(_0x4e44a5,null))['catch'](handleError(_0x4e44a5,null));};exports[_0x0805('0x66')]=function(_0x5529d3,_0x4a5ca4){var _0x24c151=path['join'](config[_0x0805('0x67')],'server/files/images/logos/default_logo.svg');var _0x5055be={'where':{'id':_0x5529d3['params']['id']},'attributes':['id',_0x0805('0x5f')],'raw':!![]};var _0x5193c9=![];return require('../../config/license/util')['getLicense']()['then'](function(_0x2851a5){if(_0x2851a5){_0x5193c9=_0x2851a5[_0x0805('0x68')];}})[_0x0805('0x25')](function(){return db[_0x0805('0x2f')][_0x0805('0x4a')](_0x5055be);})[_0x0805('0x25')](handleEntityNotFound(_0x4a5ca4,null))[_0x0805('0x25')](function(_0xbb03c4){if(_0xbb03c4){if(!_['isNil'](_0xbb03c4[_0x0805('0x5f')])){if(fs[_0x0805('0x69')](path['join'](config[_0x0805('0x67')],_0x0805('0x6a'),_0xbb03c4[_0x0805('0x5f')]))&&_0x5193c9){_0x24c151=path[_0x0805('0x6b')](config['root'],_0x0805('0x6a'),_0xbb03c4[_0x0805('0x5f')]);}}return _0x4a5ca4[_0x0805('0x6c')](_0x24c151);}})[_0x0805('0x1a')](handleError(_0x4a5ca4,null));};exports[_0x0805('0x6d')]=function(_0x498aaa,_0x1fa22e){var _0xe33e23=path[_0x0805('0x6b')](config[_0x0805('0x67')],_0x0805('0x6e'));var _0x4dbcf0={'where':{'id':_0x498aaa[_0x0805('0x47')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x0805('0x2f')][_0x0805('0x4a')](_0x4dbcf0)[_0x0805('0x25')](handleEntityNotFound(_0x1fa22e,null))[_0x0805('0x25')](function(_0x905a4e){if(_0x905a4e){if(!_[_0x0805('0x6f')](_0x905a4e[_0x0805('0x70')])){if(fs['existsSync'](path[_0x0805('0x6b')](config[_0x0805('0x67')],_0x0805('0x71'),_0x905a4e[_0x0805('0x70')]))){_0xe33e23=path[_0x0805('0x6b')](config[_0x0805('0x67')],'server/files/images/avatars/',_0x905a4e['agentAvatar']);}}return _0x1fa22e[_0x0805('0x6c')](_0xe33e23);}})[_0x0805('0x1a')](handleError(_0x1fa22e,null));};exports['getCustomerAvatar']=function(_0x51a30d,_0x5c4ead){var _0x28c5da=path[_0x0805('0x6b')](config[_0x0805('0x67')],'server/files/images/avatars/customer_avatar.png');var _0x20f6c5={'where':{'id':_0x51a30d['params']['id']},'attributes':['id',_0x0805('0x62'),_0x0805('0x72')],'raw':!![]};return db[_0x0805('0x2f')][_0x0805('0x4a')](_0x20f6c5)[_0x0805('0x25')](handleEntityNotFound(_0x5c4ead,null))[_0x0805('0x25')](function(_0xa8a160){if(_0xa8a160){if(!_[_0x0805('0x6f')](_0xa8a160['customerAvatar'])){if(fs['existsSync'](path[_0x0805('0x6b')](config[_0x0805('0x67')],_0x0805('0x71'),_0xa8a160[_0x0805('0x62')]))&&_0xa8a160['showCustomerAvatar']){_0x28c5da=path['join'](config[_0x0805('0x67')],_0x0805('0x71'),_0xa8a160[_0x0805('0x62')]);}}return _0x5c4ead[_0x0805('0x6c')](_0x28c5da);}})[_0x0805('0x1a')](handleError(_0x5c4ead,null));};exports[_0x0805('0x73')]=function(_0x176a73,_0x41b354){var _0x298b48=path['join'](config['root'],_0x0805('0x74'));var _0x2e5e26={'where':{'id':_0x176a73['params']['id']},'attributes':['id',_0x0805('0x65')],'raw':!![]};return db[_0x0805('0x2f')]['find'](_0x2e5e26)['then'](handleEntityNotFound(_0x41b354,null))[_0x0805('0x25')](function(_0x17d2da){if(_0x17d2da){if(!_['isNil'](_0x17d2da[_0x0805('0x65')])){if(fs['existsSync'](path[_0x0805('0x6b')](config[_0x0805('0x67')],_0x0805('0x71'),_0x17d2da[_0x0805('0x65')]))){_0x298b48=path[_0x0805('0x6b')](config['root'],'server/files/images/avatars/',_0x17d2da['systemAvatar']);}}return _0x41b354[_0x0805('0x6c')](_0x298b48);}})['catch'](handleError(_0x41b354,null));};exports['notify']=function(_0x26daf2,_0xb46681){var _0x264359=require('user-agent-parser');var _0x53921a=new _0x264359();var _0x4c657e=_0x53921a['setUA'](_0x26daf2[_0x0805('0x75')][_0x0805('0x76')])['getResult']();var _0x386e64={'body':_0x26daf2[_0x0805('0x4c')],'channel':'chat'};var _0x4b87a7=[];var _0x5d1bb9=[];var _0x2b8810={};var _0x3b45e2=![];return db[_0x0805('0x77')][_0x0805('0x51')]()[_0x0805('0x25')](function(_0xd2d725){if(!_0xd2d725){throw new db[(_0x0805('0x78'))][(_0x0805('0x79'))](_0x0805('0x7a'));}_0x4b87a7=_[_0x0805('0x7b')](_[_0x0805('0x48')](_0xd2d725),[_0x0805('0x7c'),'updatedAt']);_0x5d1bb9=_[_0x0805('0x7b')](_[_0x0805('0x48')](_0xd2d725),['createdAt',_0x0805('0x7d'),'CompanyId','ListId']);if(_0x26daf2[_0x0805('0x4c')]['id']){delete _0x26daf2[_0x0805('0x4c')]['id'];}if(_['isNil'](_0x26daf2[_0x0805('0x4c')][_0x0805('0x7e')])){throw new db[(_0x0805('0x78'))][(_0x0805('0x79'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x26daf2['body'][_0x0805('0x4c')])||_0x26daf2[_0x0805('0x4c')][_0x0805('0x4c')]===''){throw new db['Sequelize']['ValidationError'](_0x0805('0x7f'));}if(_[_0x0805('0x6f')](_0x26daf2[_0x0805('0x4c')][_0x0805('0x80')])){throw new db[(_0x0805('0x78'))][(_0x0805('0x79'))](_0x0805('0x81')+_0x5d1bb9);}if(!_[_0x0805('0x82')](_0x5d1bb9,_0x26daf2[_0x0805('0x4c')][_0x0805('0x80')])){throw new db['Sequelize'][(_0x0805('0x79'))](_0x0805('0x83')+_0x5d1bb9);}_0x2b8810[_0x26daf2[_0x0805('0x4c')][_0x0805('0x80')]]=_0x26daf2[_0x0805('0x4c')][_0x0805('0x7e')];})[_0x0805('0x25')](function(){return db['ChatWebsite'][_0x0805('0x4a')]({'where':{'id':_0x26daf2[_0x0805('0x47')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x0805('0x77')],'as':'Contacts','where':_0x2b8810,'limit':0x1,'order':[[_0x0805('0x7d'),'DESC']]}]},{'model':db[_0x0805('0x84')],'as':_0x0805('0x85')}]});})[_0x0805('0x25')](handleEntityNotFound(_0xb46681,null))['then'](function(_0x565b1d){if(_0x565b1d&&_0x565b1d[_0x0805('0x86')]){_0x386e64[_0x0805('0x87')]=_0x565b1d;_0x386e64[_0x0805('0x88')]=_0x565b1d[_0x0805('0x85')];_0x386e64[_0x0805('0x89')]=_0x565b1d[_0x0805('0x86')];_0x386e64[_0x0805('0x88')]=_[_0x0805('0x8a')](_0x386e64[_0x0805('0x88')],[_0x0805('0x8b')],[_0x0805('0x8c')]);if(_0x386e64[_0x0805('0x87')][_0x0805('0x85')]){delete _0x386e64['account'][_0x0805('0x85')];}if(_0x386e64[_0x0805('0x87')][_0x0805('0x86')]&&_0x386e64[_0x0805('0x87')][_0x0805('0x86')][_0x0805('0x8d')]['length']){return _0x386e64[_0x0805('0x87')][_0x0805('0x86')]['Contacts'][0x0];}var _0x4cf847=_[_0x0805('0x8e')](_0x26daf2[_0x0805('0x4c')],{'firstName':_0x26daf2[_0x0805('0x4c')][_0x0805('0x7e')],'ListId':_0x565b1d[_0x0805('0x8f')]});_0x4cf847[_0x26daf2[_0x0805('0x4c')]['mapKey']]=_0x26daf2[_0x0805('0x4c')]['from'];return db[_0x0805('0x77')]['create'](_0x4cf847,{'fields':_0x4b87a7,'raw':!![]});}})[_0x0805('0x25')](handleEntityNotFound(_0xb46681,null))[_0x0805('0x25')](function(_0x31aa47){_0x386e64[_0x0805('0x90')]=_0x31aa47;var _0x2d7839=_0x26daf2[_0x0805('0x4c')][_0x0805('0x91')];if(_0x26daf2['headers'][_0x0805('0x92')]){_0x2d7839=_0x26daf2[_0x0805('0x75')][_0x0805('0x92')];}else if(_0x26daf2[_0x0805('0x75')][_0x0805('0x93')]){_0x2d7839=_[_0x0805('0x94')](_0x26daf2[_0x0805('0x75')]['x-forwarded-for']['split'](','));}if(_0x31aa47){var _0x6a0345={'ContactId':_0x31aa47['id'],'ChatWebsiteId':_0x26daf2['params']['id'],'from':(_0x31aa47[_0x0805('0x95')]||'')+'\x20'+(_0x31aa47[_0x0805('0x96')]||''),'customerIp':_0x2d7839,'customerPort':_0x26daf2['headers'][_0x0805('0x97')]?_0x26daf2[_0x0805('0x75')][_0x0805('0x97')]:null,'referer':_0x26daf2[_0x0805('0x4c')][_0x0805('0x98')],'browserName':_0x4c657e[_0x0805('0x99')]['name']&&_0x4c657e[_0x0805('0x99')][_0x0805('0x9a')]?util[_0x0805('0x9b')](_0x0805('0x9c'),_0x4c657e[_0x0805('0x99')]['name'],_0x4c657e['browser'][_0x0805('0x9a')]):_0x0805('0x9d'),'browserVersion':_0x4c657e[_0x0805('0x99')][_0x0805('0x9a')]||_0x0805('0x9d'),'osName':util[_0x0805('0x9b')](_0x0805('0x9c'),_0x4c657e['os'][_0x0805('0x29')],_0x4c657e['os'][_0x0805('0x9a')]),'osVersion':_0x4c657e['os']['version'],'deviceModel':_0x4c657e[_0x0805('0x9e')][_0x0805('0x32')]&&_0x4c657e['device']['vendor']?util[_0x0805('0x9b')](_0x0805('0x9f'),_0x4c657e['device'][_0x0805('0x32')],_0x4c657e[_0x0805('0x9e')][_0x0805('0xa0')],_0x4c657e[_0x0805('0x9e')][_0x0805('0x40')]):null,'deviceVendor':_0x4c657e[_0x0805('0x9e')][_0x0805('0xa0')],'deviceType':_0x4c657e[_0x0805('0x9e')][_0x0805('0x40')],'formData':JSON[_0x0805('0x15')](_0x26daf2[_0x0805('0x4c')])};var _0x386aaa={'ChatWebsiteId':_0x26daf2[_0x0805('0x47')]['id'],'closed':![]};if(_0x26daf2[_0x0805('0x4c')][_0x0805('0xa1')]){_0x386aaa[_0x0805('0xa1')]=_0x26daf2[_0x0805('0x4c')][_0x0805('0xa1')];return db[_0x0805('0xa2')][_0x0805('0x4a')]({'where':_0x386aaa})[_0x0805('0x25')](function(_0x20d4ba){if(_0x20d4ba){return[_0x20d4ba,![]];}_0x6a0345[_0x0805('0xa1')]=_0x26daf2[_0x0805('0x4c')][_0x0805('0xa1')];_0x6a0345[_0x0805('0xa3')]=_0x26daf2[_0x0805('0x4c')][_0x0805('0xa3')];return db[_0x0805('0xa2')][_0x0805('0x4b')](_0x6a0345)[_0x0805('0x25')](function(_0x1a45a4){return[_0x1a45a4,!![]];});});}_0x386aaa[_0x0805('0xa4')]=_0x31aa47['id'];if(_0x26daf2[_0x0805('0x4c')][_0x0805('0xa5')]&&_0x26daf2['body'][_0x0805('0xa5')]['id']){_0x386aaa['id']=_0x26daf2['body'][_0x0805('0xa5')]['id'];return db[_0x0805('0xa2')][_0x0805('0x4a')]({'where':_0x386aaa})[_0x0805('0x25')](function(_0x579496){if(_0x579496){return[_0x579496,![]];}return db[_0x0805('0xa2')]['create'](_0x6a0345)['then'](function(_0x3f3c1e){return[_0x3f3c1e,!![]];});});}return db[_0x0805('0xa2')][_0x0805('0x4b')](_0x6a0345)[_0x0805('0x25')](function(_0x196430){return[_0x196430,!![]];});}})[_0x0805('0xa6')](function(_0x34eeb3,_0x3f91da){if(_0x34eeb3){_0x3b45e2=_0x3f91da;if(!_0x3f91da){var _0x55ecf8={'from':(_0x386e64[_0x0805('0x90')]['firstName']||'')+'\x20'+(_0x386e64[_0x0805('0x90')]['lastName']||'')};if(_0x26daf2[_0x0805('0x4c')]['threadId']&&_0x26daf2[_0x0805('0x4c')][_0x0805('0xa7')]&&_0x26daf2[_0x0805('0x4c')][_0x0805('0xa1')]!=_0x26daf2['body'][_0x0805('0xa7')]){_0x55ecf8[_0x0805('0xa1')]=_0x26daf2[_0x0805('0x4c')][_0x0805('0xa7')];}return _0x34eeb3[_0x0805('0x23')](_0x55ecf8);}else{return _0x34eeb3;}}})[_0x0805('0x25')](function(_0x18cccc){_0x386e64[_0x0805('0xa5')]=_0x18cccc[_0x0805('0x26')]({'plain':!![]});_0x386e64[_0x0805('0xa5')][_0x0805('0xa8')]=_0x3b45e2;if(_0x386e64[_0x0805('0xa5')][_0x0805('0xa8')]){if(_0x386e64[_0x0805('0x87')]['autoclose']){_0x386e64[_0x0805('0x88')][_0x0805('0xa9')]({'id':0x0,'priority':_0x386e64[_0x0805('0x88')][_0x0805('0x36')]+0x1,'app':_0x0805('0xaa'),'appdata':_0x0805('0xab'),'interval':'*,*,*,*'});}}return db['ChatMessage'][_0x0805('0x4b')]({'body':_0x26daf2[_0x0805('0x4c')][_0x0805('0x4c')],'ChatWebsiteId':_0x26daf2[_0x0805('0x47')]['id'],'ChatInteractionId':_0x18cccc['id'],'direction':'in','ContactId':_0x386e64['contact']['id'],'AttachmentId':_0x26daf2[_0x0805('0x4c')][_0x0805('0xac')]});})[_0x0805('0x25')](function(_0x360810){_0x386e64['message']=_0x360810;if(_0x386e64[_0x0805('0xa5')][_0x0805('0xad')]){return db['User'][_0x0805('0x4a')]({'attributes':['id',_0x0805('0x29')],'where':{'id':_0x386e64[_0x0805('0xa5')][_0x0805('0xad')]}})[_0x0805('0x25')](function(_0x11a773){if(_0x11a773){_0x386e64[_0x0805('0x88')][_0x0805('0xae')]({'id':0x0,'priority':0x0,'app':_0x0805('0xaf'),'appdata':_0x11a773[_0x0805('0x29')]+','+(_0x386e64[_0x0805('0x87')][_0x0805('0xb0')]||0xa),'interval':_0x0805('0xb1')});_0x386e64[_0x0805('0xb2')]=!![];}return respondWithRpcPromise(_0x0805('0xb3'),'startRouting',_0x386e64);});}return respondWithRpcPromise(_0x0805('0xb3'),_0x0805('0xb4'),_0x386e64);})[_0x0805('0x25')](function(_0x20167e){respondWithRpcPromise(_0x0805('0xb5'),'EventManager',{'event':'notify','message':_0x20167e},client9002);return _0x20167e;})[_0x0805('0x25')](respondWithResult(_0xb46681,null))[_0x0805('0x1a')](handleError(_0xb46681,null));};exports[_0x0805('0xb6')]=function(_0x329ecc,_0xd60f85){var _0x1ed87a,_0x34f830,_0x283490;var _0x1f9c07=[];var _0x23a1a5={};var _0x7f2651=_0x329ecc['files']||[];var _0x80ef78=[];var _0x5a670c;return db['CmContact']['describe']()[_0x0805('0x25')](function(_0xf466dd){if(!_0xf466dd){throw new db['Sequelize'][(_0x0805('0x79'))](_0x0805('0x7a'));}_0x1f9c07=_[_0x0805('0x7b')](_[_0x0805('0x48')](_0xf466dd),['createdAt',_0x0805('0x7d'),_0x0805('0xb7'),_0x0805('0x8f')]);if(_0x329ecc[_0x0805('0x4c')]['id']){delete _0x329ecc[_0x0805('0x4c')]['id'];}if(_[_0x0805('0x6f')](_0x329ecc[_0x0805('0x4c')][_0x0805('0x7e')])){throw _0xd60f85[_0x0805('0x1c')](0x1f4)[_0x0805('0x2a')](new db[(_0x0805('0x78'))][(_0x0805('0x79'))](_0x0805('0xb8')));}if(_[_0x0805('0x6f')](_0x329ecc['body'][_0x0805('0x4c')])||_0x329ecc[_0x0805('0x4c')]['body']===''){throw _0xd60f85['status'](0x1f4)['send'](new db[(_0x0805('0x78'))][(_0x0805('0x79'))](_0x0805('0x7f')));}if(_[_0x0805('0x6f')](_0x329ecc[_0x0805('0x4c')][_0x0805('0xb9')])){throw _0xd60f85[_0x0805('0x1c')](0x1f4)[_0x0805('0x2a')](new db[(_0x0805('0x78'))][(_0x0805('0x79'))](_0x0805('0xba')+_0x1f9c07));}if(!_[_0x0805('0x82')](_0x1f9c07,_0x329ecc[_0x0805('0x4c')][_0x0805('0xb9')])){throw _0xd60f85['status'](0x1f4)[_0x0805('0x2a')](new db['Sequelize']['ValidationError']('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1f9c07));}_0x23a1a5[_0x329ecc[_0x0805('0x4c')][_0x0805('0xb9')]]=_0x329ecc[_0x0805('0x4c')][_0x0805('0x7e')];})[_0x0805('0x25')](function(){return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x329ecc[_0x0805('0x47')]['id']},'include':[{'model':db[_0x0805('0xbb')],'as':_0x0805('0x86')},{'model':db[_0x0805('0xbc')],'as':'MailAccount'}]});})[_0x0805('0x25')](handleEntityNotFound(_0xd60f85,null))[_0x0805('0x25')](function(_0x294246){if(_0x294246&&_0x294246[_0x0805('0x86')]){_0x34f830=_0x294246;var _0x4cdd48=_[_0x0805('0x8e')](_0x329ecc[_0x0805('0x4c')],{'firstName':_0x329ecc[_0x0805('0x4c')][_0x0805('0x7e')],'phone':_0x329ecc['body'][_0x0805('0x7e')],'ListId':_0x294246[_0x0805('0x8f')]});_0x4cdd48[_0x329ecc[_0x0805('0x4c')][_0x0805('0xb9')]]=_0x329ecc['body'][_0x0805('0x7e')];return db[_0x0805('0x77')][_0x0805('0xbd')]({'where':_0x23a1a5,'defaults':_0x4cdd48});}})[_0x0805('0xa6')](function(_0x16a461){if(_0x16a461){_0x283490=_0x16a461;var _0x55febf=fs[_0x0805('0xbe')](path[_0x0805('0x6b')](config[_0x0805('0x67')],_0x0805('0xbf')),_0x0805('0xc0'));var _0x1cb2fc=ejs[_0x0805('0xc1')](_0x55febf,{'body':_[_0x0805('0xc2')](_0x329ecc[_0x0805('0x4c')][_0x0805('0x4c')]),'bodyTitle':_0x34f830[_0x0805('0xc3')]});return db[_0x0805('0xc4')]['create']({'body':_0x1cb2fc,'plainBody':htmlToText[_0x0805('0xc5')](_0x1cb2fc),'ContactId':_0x16a461['id'],'ChatWebsiteId':_0x34f830['id']});}})[_0x0805('0x25')](function(_0x399ea0){_0x5a670c=_0x399ea0;if(_0x7f2651[_0x0805('0x36')]){var _0x4974af=_0x7f2651['map'](function(_0xca89ca){return{'name':_0xca89ca['originalname'],'basename':_0xca89ca[_0x0805('0x63')],'type':_0xca89ca[_0x0805('0xc6')],'ChatOfflineMessageId':_0x399ea0['id']};});_0x80ef78=_0x4974af[_0x0805('0x2e')](_0x390009=>{var _0x469f85={'filename':_0x390009['name'],'path':path[_0x0805('0x6b')](config[_0x0805('0x67')],_0x0805('0xc7'),_0x0805('0xc8'),_0x0805('0xc9'),_0x0805('0xca'),_0x390009['basename'])};return _0x469f85;});if(!_0x34f830['openNewInteraction']){return db[_0x0805('0xcb')]['transaction'](function(_0x5c1113){return db['Attachment'][_0x0805('0xcc')](_0x4974af,{'transaction':_0x5c1113});});}}})['then'](function(){if(_0x5a670c){_0x1ed87a=_0x5a670c;return db[_0x0805('0xbc')][_0x0805('0x5c')]({'where':{'service':!![]},'include':[{'model':db[_0x0805('0xcd')],'as':_0x0805('0xce'),'raw':!![],'include':[{'model':db[_0x0805('0xcf')],'as':_0x0805('0xcf'),'raw':!![]}]}]});}})[_0x0805('0x25')](function(_0x891d8a){if(_0x891d8a&&_0x891d8a[_0x0805('0xce')]&&_0x34f830[_0x0805('0xd0')]&&_0x34f830['forwardOfflineAddress']){var _0x2ac8b7=_0x891d8a[_0x0805('0xd1')]();return respondWithRpcPromise(_0x0805('0xd2'),'sendMail',{'account':_0x2ac8b7,'message':{'from':util['format'](_0x0805('0xd3'),_0x891d8a[_0x0805('0x29')],_0x891d8a[_0x0805('0xd4')]||_0x891d8a[_0x0805('0xce')][_0x0805('0x4f')]),'to':_0x34f830['forwardOfflineAddress'],'subject':_0x34f830[_0x0805('0xd5')],'html':_0x1ed87a[_0x0805('0x4c')],'attachments':_0x80ef78}},client9003)['then'](function(){return _0x1ed87a;})[_0x0805('0x1a')](function(_0x109063){logger['error'](_0x109063);});}})['then'](function(){if(_0x34f830&&_0x34f830[_0x0805('0xd6')]&&_0x34f830['MailAccountId']){var _0x3e9ab4=[];if(_0x7f2651[_0x0805('0x36')]){_0x3e9ab4=_0x7f2651[_0x0805('0x2e')](function(_0x2f0ec1){return{'name':_0x2f0ec1[_0x0805('0xd7')],'basename':_0x2f0ec1[_0x0805('0x63')],'type':_0x2f0ec1[_0x0805('0xc6')],'ChatOfflineMessageId':_0x5a670c['id']};});}var _0xd0050b;if(!_['isNil'](_0x34f830['subjectOffline'])){var _0x404efa=_[_0x0805('0x2e')](_0x329ecc['body'],function(_0x25b37b){return _0x25b37b;});var _0x424d85=_[_0x0805('0xd8')](_0x404efa)[0x0];var _0x1f1781=_['mapValues'](_0x424d85,function(_0x52d567){return _0x52d567;});_0xd0050b=_0x1f1781[0x1][_0x34f830['subjectOffline']];}var _0x383591={'from':_0x283490[_0x0805('0xd4')],'firstName':_0x283490['firstName'],'lastName':_0x283490['lastName'],'mapKey':'email','message':{'from':_0x283490[_0x0805('0xd4')],'to':_0x34f830[_0x0805('0xbc')]['email'],'cc':'','subject':_[_0x0805('0x6f')](_0xd0050b)?_0x34f830[_0x0805('0xd5')]:_0xd0050b,'messageId':'','sentAt':new Date(),'attach':_0x3e9ab4[_0x0805('0x36')],'attachments':_0x3e9ab4,'originChannel':'Chat','ChatWebsiteId':_0x34f830['id'],'ChatOfflineMessageId':_0x1ed87a['id'],'originTo':_0x34f830[_0x0805('0xbc')][_0x0805('0xd4')]},'body':_0x1ed87a[_0x0805('0x4c')]};var _0x32f40a={'account':{'id':_0x34f830[_0x0805('0xd9')]},'body':_0x383591,'log':_0x0805('0xda')};return respondWithRpcPromise(_0x0805('0xda'),'notifyMail',_0x32f40a,client9001)[_0x0805('0x25')](function(){return _0x1ed87a;})[_0x0805('0x1a')](function(_0x2d1f26){logger[_0x0805('0x16')](_0x2d1f26);});}return;})[_0x0805('0x25')](function(){if(_0x1ed87a){return _0x1ed87a;}})[_0x0805('0x25')](respondWithResult(_0xd60f85,null))[_0x0805('0x1a')](function(_0xb07324){logger['error'](_0x0805('0x1a'),_0xb07324);for(var _0x471c8f of _0x7f2651){var _0x5ca234=path[_0x0805('0x6b')](config['root'],_0x0805('0xc7'),_0x0805('0xc8'),'attachments',_0x0805('0xca'),_0x471c8f[_0x0805('0x63')]);fs_extra[_0x0805('0xdb')](_0x5ca234)[_0x0805('0x1a')](function(_0x51b5dc){logger[_0x0805('0x16')](_0x0805('0xdc'),_0x5ca234,_0x51b5dc);});}});};exports[_0x0805('0xdd')]=function(_0x2a154d,_0x3c51f0){return db[_0x0805('0xa2')][_0x0805('0x4a')]({'where':{'id':_0x2a154d['params']['id']}})['then'](handleEntityNotFound(_0x3c51f0,null))['then'](function(_0x4b1412){if(_0x4b1412){return _0x4b1412[_0x0805('0xdd')](_0x2a154d[_0x0805('0x4c')][_0x0805('0x58')],_[_0x0805('0xde')](_0x2a154d[_0x0805('0x4c')],[_0x0805('0x58'),'id'])||{});}})['then'](respondWithResult(_0x3c51f0,null))[_0x0805('0x1a')](handleError(_0x3c51f0,null));};exports[_0x0805('0xdf')]=function(_0x1601fd,_0x53ef11){var _0x332851={'raw':![],'where':{}};var _0x2a8618={};var _0x953ff7={'count':0x0,'rows':[]};return db[_0x0805('0x2f')][_0x0805('0x5c')]({'where':{'id':_0x1601fd['params']['id']}})['then'](handleEntityNotFound(_0x53ef11,null))['then'](function(_0x4ba840){if(_0x4ba840){_0x2a8618['model']=_[_0x0805('0x48')](db[_0x0805('0xa2')][_0x0805('0x30')]);_0x2a8618[_0x0805('0x33')]=_[_0x0805('0x48')](_0x1601fd[_0x0805('0x33')]);_0x2a8618[_0x0805('0x3c')]=_[_0x0805('0x49')](_0x2a8618['model'],_0x2a8618['query']);_0x332851[_0x0805('0x35')]=_[_0x0805('0x49')](_0x2a8618[_0x0805('0x32')],qs[_0x0805('0x34')](_0x1601fd[_0x0805('0x33')]['fields']));_0x332851[_0x0805('0x35')]=_0x332851[_0x0805('0x35')][_0x0805('0x36')]?_0x332851['attributes']:_0x2a8618[_0x0805('0x32')];if(!_0x1601fd[_0x0805('0x33')][_0x0805('0x37')](_0x0805('0x56'))){_0x332851[_0x0805('0x38')]=qs[_0x0805('0x38')](_0x1601fd[_0x0805('0x33')]['limit']);_0x332851[_0x0805('0x1f')]=qs[_0x0805('0x1f')](_0x1601fd[_0x0805('0x33')][_0x0805('0x1f')]);}_0x332851[_0x0805('0x39')]=qs['sort'](_0x1601fd[_0x0805('0x33')][_0x0805('0x3a')]);_0x332851[_0x0805('0x3b')]=qs[_0x0805('0x3c')](_[_0x0805('0x3d')](_0x1601fd[_0x0805('0x33')],_0x2a8618[_0x0805('0x3c')]));_0x332851[_0x0805('0x3b')]['ChatWebsiteId']=_0x4ba840['id'];if(_0x1601fd['query'][_0x0805('0x3e')]){_0x332851[_0x0805('0x3b')]=_['merge'](_0x332851['where'],{'$or':_[_0x0805('0x2e')](_0x332851[_0x0805('0x35')],function(_0xbf4eeb){var _0xd3bbb7={};_0xd3bbb7[_0xbf4eeb]={'$like':'%'+_0x1601fd[_0x0805('0x33')][_0x0805('0x3e')]+'%'};return _0xd3bbb7;})});}_0x332851=_[_0x0805('0x3f')]({},_0x332851,_0x1601fd[_0x0805('0x42')]);return db[_0x0805('0xa2')][_0x0805('0x21')]({'where':_0x332851[_0x0805('0x3b')]})[_0x0805('0x25')](function(_0x8d7cc8){_0x953ff7[_0x0805('0x21')]=_0x8d7cc8;if(_0x1601fd[_0x0805('0x33')]['includeAll']){_0x332851[_0x0805('0x44')]=[{'model':db['CmContact'],'as':_0x0805('0xe0'),'required':![]},{'model':db[_0x0805('0xe1')],'as':_0x0805('0xe2'),'attributes':[_0x0805('0x29'),'fullname',_0x0805('0xe3')],'required':![]},{'model':db['Tag'],'as':_0x0805('0xe4'),'attributes':['id',_0x0805('0x29'),_0x0805('0xe5')],'where':_0x1601fd[_0x0805('0x33')]['tag']?{'id':_0x1601fd['query']['tag']}:undefined,'required':_0x1601fd[_0x0805('0x33')][_0x0805('0xe6')]?!![]:![]}];}return db['ChatInteraction'][_0x0805('0xe7')](_0x332851);})[_0x0805('0x25')](function(_0x3f2bb3){_0x953ff7[_0x0805('0x45')]=_0x3f2bb3;return _0x953ff7;});}})['then'](respondWithFilteredResult(_0x53ef11,_0x332851))['catch'](handleError(_0x53ef11,null));};function iftimePromise(_0x382d94,_0x8c6135){return respondWithRpcPromise(_0x0805('0xe8'),_0x0805('0xe9'),{'command':_0x8c6135[_0x0805('0xea')]?util['format'](_0x0805('0xeb'),_0x382d94[_0x0805('0xec')],_0x8c6135[_0x0805('0xea')]):util[_0x0805('0x9b')]('iftime\x20%s',_0x382d94['interval'])},client9002)[_0x0805('0x25')](function(_0x73af60){var _0x484a4a=_0x73af60&&_0x73af60[_0x0805('0xed')](_0x0805('0xee'))>=0x0?!![]:![];logger[_0x0805('0xef')](_0x0805('0xf0'),_0x8c6135['id'],_0x382d94['id'],_0x382d94[_0x0805('0xec')],_0x484a4a?_0x0805('0xf1'):_0x0805('0xf2'),_0x8c6135[_0x0805('0xea')]?_0x8c6135[_0x0805('0xea')]:_0x0805('0xf3'));return _0x484a4a;})[_0x0805('0x1a')](function(_0x1c4676){logger[_0x0805('0x16')](_0x0805('0xf0'),_0x8c6135['id'],_0x382d94['id'],_0x382d94[_0x0805('0xec')],util[_0x0805('0xf4')](_0x1c4676,{'showHidden':![],'depth':null}),_0x8c6135[_0x0805('0xea')]?_0x8c6135['timezone']:_0x0805('0xf3'));return![];});}exports[_0x0805('0xe9')]=function(_0x9e0285,_0x3df48b){var _0x2ac708=0x0;var _0x2b16de=0x0;var _0x19a021=![];var _0xdeafa1;var _0x31c4a4;return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x9e0285[_0x0805('0x47')]['id']},'include':[{'model':db[_0x0805('0xf5')],'as':_0x0805('0xf5'),'include':[{'model':db['Interval'],'as':_0x0805('0xf6'),'attributes':['id',_0x0805('0xec')],'raw':!![]}]}]})[_0x0805('0x25')](handleEntityNotFound(_0x3df48b,null))[_0x0805('0x25')](function(_0x464885){if(_0x464885){_0xdeafa1=_0x464885;return _0x464885[_0x0805('0xf7')]({'raw':!![]});}})[_0x0805('0x25')](function(_0x58d758){if(_0xdeafa1){if(_0x58d758){_0x31c4a4=_0x58d758;}}return require('../../config/license/util')[_0x0805('0xf8')]();})['then'](function(_0x58027f){if(_0x58027f){_0x2b16de=_0x58027f['virtual'];_0x19a021=_0x58027f['custom'];}})[_0x0805('0x25')](function(){return db[_0x0805('0xa2')][_0x0805('0x21')]({'where':{'closed':![]}});})[_0x0805('0x25')](function(_0x4fcdb4){_0x2ac708=_0x4fcdb4;if(_0x2b16de&&_0x4fcdb4>_0x2b16de){return db['License'][_0x0805('0x5c')]({'where':{'id':0x1}})[_0x0805('0x25')](function(_0x3497fc){if(_0x3497fc){_0x3497fc[_0x0805('0xf9')](_0x0805('0xfa'));}});}})['then'](function(){if(_0xdeafa1[_0x0805('0xf5')]&&_0xdeafa1[_0x0805('0xf5')][_0x0805('0xf6')]){var _0x129f0f=[];for(var _0x3fe908=0x0;_0x3fe908<_0xdeafa1[_0x0805('0xf5')][_0x0805('0xf6')]['length'];_0x3fe908++){var _0x11115e=_0xdeafa1['Interval'][_0x0805('0xf6')][_0x3fe908][_0x0805('0x26')]({'plain':!![]});_0x129f0f[_0x0805('0xa9')](iftimePromise(_0x11115e,_0xdeafa1));}return BPromise[_0x0805('0xfb')](_0x129f0f)[_0x0805('0x25')](function(_0x1d0b1f){return _[_0x0805('0xfc')](_0x1d0b1f);});}else{return!![];}})['then'](function(_0x686bee){var _0x36a7f8=fs['readFileSync'](path[_0x0805('0x6b')](config[_0x0805('0x67')],_0x0805('0xfd')),_0x0805('0xc0'));var _0x23e1b3={'remote':_0xdeafa1[_0x0805('0xfe')],'query':querystring[_0x0805('0x15')](_[_0x0805('0x3f')](_0xdeafa1[_0x0805('0x26')]({'plain':!![]}),{'customerIp':_0x9e0285[_0x0805('0x75')]['x-forwarded-for']||_0x9e0285[_0x0805('0x75')][_0x0805('0xff')]||_0x9e0285[_0x0805('0x100')]['remoteAddress']||_0x9e0285['ip'],'referer':_0x9e0285[_0x0805('0x75')]['referer'],'openedInteractions':_0x2ac708,'maxInteractions':_0x2b16de,'virtual':_0x19a021[_0x0805('0x101')],'online':_0x686bee,'custom':_0x19a021}))[_0x0805('0x102')](/'/g,'\x5c\x27')};_0x3df48b['send'](ejs[_0x0805('0xc1')](Mustache['render'](_0x36a7f8,_0x23e1b3),{'proactiveActions':_0x31c4a4,'alignment':_0xdeafa1[_0x0805('0x103')],'verticalAlignment':_0xdeafa1[_0x0805('0x104')],'div_color':_0xdeafa1[_0x0805('0xe5')],'labelText':_0xdeafa1[_0x0805('0x105')],'text_color':_0xdeafa1[_0x0805('0x106')],'text_button_color':_0xdeafa1[_0x0805('0x107')],'button_color':_0xdeafa1[_0x0805('0x108')],'background_color':_0xdeafa1['backgroundColor'],'hideWhenOffline':_0xdeafa1[_0x0805('0x109')],'interval':_0xdeafa1['IntervalId']}));})[_0x0805('0x1a')](handleError(_0x3df48b,null));};exports[_0x0805('0x10a')]=function(_0x10d28c,_0x232d17){var _0x3a280c=_0x10d28c[_0x0805('0x47')]['id'];var _0x488896=_0x10d28c[_0x0805('0x4c')];var _0x41c135=0xc8;var _0x839d9=null;return db[_0x0805('0xcb')][_0x0805('0x10b')]({'isolationLevel':db[_0x0805('0xcb')][_0x0805('0x10c')][_0x0805('0x10d')]['READ_COMMITTED']},function(_0x2bc99b){return db[_0x0805('0x2f')][_0x0805('0x5c')]({'where':{'id':_0x3a280c},'transaction':_0x2bc99b})['then'](function(_0x430fa9){if(_0x430fa9){return db['ChatApplication'][_0x0805('0x24')]({'where':{'ChatWebsiteId':_0x3a280c},'transaction':_0x2bc99b})[_0x0805('0x25')](function(){var _0x871e12=_[_0x0805('0x2e')](_0x488896,function(_0x3dfce5){_0x3dfce5['ChatWebsiteId']=_0x3a280c;return _0x3dfce5;});return db[_0x0805('0x84')][_0x0805('0xcc')](_0x871e12,{'transaction':_0x2bc99b});});}else{_0x41c135=0x194;_0x839d9=[];}});})[_0x0805('0x25')](function(){if(_0x41c135!==0x194){return db[_0x0805('0x84')][_0x0805('0x10e')]({'where':{'ChatWebsiteId':_0x3a280c},'order':'priority'})[_0x0805('0x25')](function(_0x117823){_0x839d9=_0x117823;});}})[_0x0805('0x1a')](function(_0x2101a8){_0x41c135=0x1f4;logger[_0x0805('0x16')](_0x2101a8[_0x0805('0x10f')]);if(_0x2101a8[_0x0805('0x29')]){delete _0x2101a8[_0x0805('0x29')];}_0x839d9=_0x2101a8;})[_0x0805('0x110')](function(){if(_0x839d9===null){_0x232d17['sendStatus'](_0x41c135);}else{if(_0x41c135===0x1f4){_0x232d17[_0x0805('0x1c')](_0x41c135)[_0x0805('0x2a')](_0x839d9);}else{_0x232d17[_0x0805('0x1c')](_0x41c135)[_0x0805('0x1e')](_0x839d9);}}});};exports[_0x0805('0x111')]=function(_0x16afff,_0x4a39f0){var _0x1f2227={};var _0x404ae3={};var _0x1cdbb3;var _0xf43f55;return db[_0x0805('0x2f')][_0x0805('0x5c')]({'where':{'id':_0x16afff[_0x0805('0x47')]['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x4a39f0,null))[_0x0805('0x25')](function(_0x151440){if(_0x151440){_0x1cdbb3=_0x151440;_0x404ae3[_0x0805('0x32')]=_[_0x0805('0x48')](db[_0x0805('0x84')][_0x0805('0x30')]);_0x404ae3[_0x0805('0x33')]=_[_0x0805('0x48')](_0x16afff[_0x0805('0x33')]);_0x404ae3['filters']=_[_0x0805('0x49')](_0x404ae3[_0x0805('0x32')],_0x404ae3[_0x0805('0x33')]);_0x1f2227[_0x0805('0x35')]=_['intersection'](_0x404ae3['model'],qs['fields'](_0x16afff['query'][_0x0805('0x34')]));_0x1f2227[_0x0805('0x35')]=_0x1f2227[_0x0805('0x35')][_0x0805('0x36')]?_0x1f2227[_0x0805('0x35')]:_0x404ae3['model'];_0x1f2227[_0x0805('0x39')]=qs[_0x0805('0x3a')](_0x16afff[_0x0805('0x33')][_0x0805('0x3a')]);_0x1f2227[_0x0805('0x3b')]=qs[_0x0805('0x3c')](_[_0x0805('0x3d')](_0x16afff[_0x0805('0x33')],_0x404ae3[_0x0805('0x3c')]));if(_0x16afff[_0x0805('0x33')][_0x0805('0x3e')]){_0x1f2227[_0x0805('0x3b')]=_[_0x0805('0x3f')](_0x1f2227[_0x0805('0x3b')],{'$or':_['map'](_0x1f2227['attributes'],function(_0x142d9c){var _0x1f2379={};_0x1f2379[_0x142d9c]={'$like':'%'+_0x16afff[_0x0805('0x33')][_0x0805('0x3e')]+'%'};return _0x1f2379;})});}_0x1f2227=_[_0x0805('0x3f')]({},_0x1f2227,_0x16afff[_0x0805('0x42')]);return _0x1cdbb3[_0x0805('0x111')](_0x1f2227);}})['then'](function(_0x1c7b06){if(_0x1c7b06){_0xf43f55=_0x1c7b06[_0x0805('0x36')];if(!_0x16afff[_0x0805('0x33')][_0x0805('0x37')]('nolimit')){_0x1f2227[_0x0805('0x38')]=qs['limit'](_0x16afff[_0x0805('0x33')][_0x0805('0x38')]);_0x1f2227[_0x0805('0x1f')]=qs['offset'](_0x16afff['query'][_0x0805('0x1f')]);}return _0x1cdbb3['getApplications'](_0x1f2227);}})[_0x0805('0x25')](function(_0x2f6876){if(_0x2f6876){return _0x2f6876?{'count':_0xf43f55,'rows':_0x2f6876}:null;}})['then'](respondWithResult(_0x4a39f0,null))['catch'](handleError(_0x4a39f0,null));};exports[_0x0805('0x112')]=function(_0x229243,_0x3c1e72){return db[_0x0805('0x113')][_0x0805('0x4a')]({'where':{'id':_0x229243[_0x0805('0x47')]['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x3c1e72,null))['then'](function(_0x62bd8d){if(_0x62bd8d){return _0x62bd8d[_0x0805('0x112')](_0x229243[_0x0805('0x4c')][_0x0805('0x58')],_[_0x0805('0xde')](_0x229243[_0x0805('0x4c')],[_0x0805('0x58'),'id'])||{});}})[_0x0805('0x25')](respondWithResult(_0x3c1e72,null))[_0x0805('0x1a')](handleError(_0x3c1e72,null));};exports[_0x0805('0xf7')]=function(_0x10f80f,_0x22bd4f){var _0x4e281d={};var _0x5f5c9b={};var _0xdc4f94;var _0x5233de;return db[_0x0805('0x2f')][_0x0805('0x5c')]({'where':{'id':_0x10f80f[_0x0805('0x47')]['id']}})['then'](handleEntityNotFound(_0x22bd4f,null))[_0x0805('0x25')](function(_0x1208f0){if(_0x1208f0){_0xdc4f94=_0x1208f0;_0x5f5c9b[_0x0805('0x32')]=_[_0x0805('0x48')](db['ChatProactiveAction'][_0x0805('0x30')]);_0x5f5c9b[_0x0805('0x33')]=_[_0x0805('0x48')](_0x10f80f[_0x0805('0x33')]);_0x5f5c9b[_0x0805('0x3c')]=_['intersection'](_0x5f5c9b[_0x0805('0x32')],_0x5f5c9b[_0x0805('0x33')]);_0x4e281d['attributes']=_[_0x0805('0x49')](_0x5f5c9b[_0x0805('0x32')],qs['fields'](_0x10f80f[_0x0805('0x33')]['fields']));_0x4e281d['attributes']=_0x4e281d[_0x0805('0x35')][_0x0805('0x36')]?_0x4e281d[_0x0805('0x35')]:_0x5f5c9b['model'];_0x4e281d[_0x0805('0x39')]=qs[_0x0805('0x3a')](_0x10f80f[_0x0805('0x33')][_0x0805('0x3a')]);_0x4e281d[_0x0805('0x3b')]=qs[_0x0805('0x3c')](_[_0x0805('0x3d')](_0x10f80f['query'],_0x5f5c9b['filters']));if(_0x10f80f[_0x0805('0x33')]['filter']){_0x4e281d[_0x0805('0x3b')]=_[_0x0805('0x3f')](_0x4e281d[_0x0805('0x3b')],{'$or':_['map'](_0x4e281d[_0x0805('0x35')],function(_0x3db38d){var _0xf218df={};_0xf218df[_0x3db38d]={'$like':'%'+_0x10f80f[_0x0805('0x33')][_0x0805('0x3e')]+'%'};return _0xf218df;})});}_0x4e281d=_[_0x0805('0x3f')]({},_0x4e281d,_0x10f80f[_0x0805('0x42')]);return _0xdc4f94[_0x0805('0xf7')](_0x4e281d);}})[_0x0805('0x25')](function(_0x177fb4){if(_0x177fb4){_0x5233de=_0x177fb4[_0x0805('0x36')];if(!_0x10f80f['query'][_0x0805('0x37')](_0x0805('0x56'))){_0x4e281d[_0x0805('0x38')]=qs['limit'](_0x10f80f[_0x0805('0x33')][_0x0805('0x38')]);_0x4e281d[_0x0805('0x1f')]=qs[_0x0805('0x1f')](_0x10f80f[_0x0805('0x33')][_0x0805('0x1f')]);}return _0xdc4f94['getProactiveActions'](_0x4e281d);}})['then'](function(_0x3f4222){if(_0x3f4222){return _0x3f4222?{'count':_0x5233de,'rows':_0x3f4222}:null;}})[_0x0805('0x25')](respondWithResult(_0x22bd4f,null))[_0x0805('0x1a')](handleError(_0x22bd4f,null));};exports[_0x0805('0x114')]=function(_0x2548bf,_0x4c87a7){var _0x15bf4d=_0x2548bf[_0x0805('0x33')][_0x0805('0x115')]===_0x0805('0x116')?_0x0805('0x117'):'onlineForm';return db[_0x0805('0x2f')][_0x0805('0x4a')]({'attributes':['id',_0x15bf4d],'where':{'id':_0x2548bf[_0x0805('0x47')]['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x4c87a7,null))[_0x0805('0x25')](function(_0x5c378a){if(_0x5c378a){var _0x4edc76=_0x5c378a[_0x15bf4d];var _0x3dbbb0=_0x4edc76&&_0x4edc76[_0x0805('0x118')]?_0x4edc76[_0x0805('0x118')]:[];_0x4c87a7[_0x0805('0x2a')]({'fromKey':_[_0x0805('0x6f')](_0x4edc76[_0x0805('0x119')])?undefined:_0x4edc76[_0x0805('0x119')],'count':_0x3dbbb0[_0x0805('0x36')],'rows':_0x3dbbb0});}})['catch'](handleError(_0x4c87a7,null));};exports[_0x0805('0x11a')]=function(_0x5cde12,_0x22e280){var _0x3b88ef={'raw':![],'where':{}};var _0x2df240={};var _0x5d5d04={'count':0x0,'rows':[]};return db[_0x0805('0x2f')]['findOne']({'where':{'id':_0x5cde12[_0x0805('0x47')]['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x22e280,null))[_0x0805('0x25')](function(_0x5720f7){if(_0x5720f7){_0x2df240['model']=_[_0x0805('0x48')](db[_0x0805('0xc4')][_0x0805('0x30')]);_0x2df240[_0x0805('0x33')]=_[_0x0805('0x48')](_0x5cde12[_0x0805('0x33')]);_0x2df240[_0x0805('0x3c')]=_[_0x0805('0x49')](_0x2df240[_0x0805('0x32')],_0x2df240[_0x0805('0x33')]);_0x3b88ef[_0x0805('0x35')]=_[_0x0805('0x49')](_0x2df240['model'],qs[_0x0805('0x34')](_0x5cde12['query'][_0x0805('0x34')]));_0x3b88ef[_0x0805('0x35')]=_0x3b88ef[_0x0805('0x35')][_0x0805('0x36')]?_0x3b88ef[_0x0805('0x35')]:_0x2df240[_0x0805('0x32')];if(!_0x5cde12[_0x0805('0x33')]['hasOwnProperty'](_0x0805('0x56'))){_0x3b88ef[_0x0805('0x38')]=qs['limit'](_0x5cde12[_0x0805('0x33')][_0x0805('0x38')]);_0x3b88ef[_0x0805('0x1f')]=qs[_0x0805('0x1f')](_0x5cde12['query']['offset']);}_0x3b88ef[_0x0805('0x39')]=qs[_0x0805('0x3a')](_0x5cde12[_0x0805('0x33')]['sort']);_0x3b88ef[_0x0805('0x3b')]=qs[_0x0805('0x3c')](_[_0x0805('0x3d')](_0x5cde12[_0x0805('0x33')],_0x2df240[_0x0805('0x3c')]));_0x3b88ef[_0x0805('0x3b')][_0x0805('0x53')]=_0x5720f7['id'];if(_0x5cde12[_0x0805('0x33')][_0x0805('0x3e')]){_0x3b88ef[_0x0805('0x3b')]=_[_0x0805('0x3f')](_0x3b88ef[_0x0805('0x3b')],{'$or':_['map'](_0x3b88ef[_0x0805('0x35')],function(_0x86b2bc){var _0x993361={};_0x993361[_0x86b2bc]={'$like':'%'+_0x5cde12[_0x0805('0x33')][_0x0805('0x3e')]+'%'};return _0x993361;})});}_0x3b88ef=_['merge']({},_0x3b88ef,_0x5cde12[_0x0805('0x42')]);return db[_0x0805('0xc4')][_0x0805('0x21')]({'where':_0x3b88ef[_0x0805('0x3b')]})[_0x0805('0x25')](function(_0x1804d3){_0x5d5d04[_0x0805('0x21')]=_0x1804d3;if(_0x5cde12[_0x0805('0x33')][_0x0805('0x43')]){_0x3b88ef[_0x0805('0x44')]=[{'all':!![]}];}else{_0x3b88ef[_0x0805('0x44')]=[{'model':db[_0x0805('0x77')],'as':_0x0805('0xe0'),'required':![]},{'model':db[_0x0805('0x11b')],'as':_0x0805('0x11c'),'required':![]}];}return db['ChatOfflineMessage'][_0x0805('0xe7')](_0x3b88ef);})[_0x0805('0x25')](function(_0x1699f5){_0x5d5d04[_0x0805('0x45')]=_0x1699f5;return _0x5d5d04;});}})['then'](respondWithFilteredResult(_0x22e280,_0x3b88ef))['catch'](handleError(_0x22e280,null));};exports[_0x0805('0x11d')]=function(_0x481f50,_0x2cbf16){return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x481f50[_0x0805('0x47')]['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x2cbf16,null))[_0x0805('0x25')](function(_0x3d33dc){if(_0x3d33dc){return _0x3d33dc['addAgents'](_0x481f50['body'][_0x0805('0x58')],_['omit'](_0x481f50['body'],[_0x0805('0x58'),'id'])||{})[_0x0805('0xa6')](function(_0x34a43f){for(var _0x502ad3=0x0;_0x502ad3<_0x481f50[_0x0805('0x4c')]['ids'][_0x0805('0x36')];_0x502ad3+=0x1){socket['emit'](_0x0805('0x11e'),{'UserId':Number(_0x481f50[_0x0805('0x4c')][_0x0805('0x58')][_0x502ad3]),'ChatWebsiteId':Number(_0x481f50[_0x0805('0x47')]['id'])});}return _0x34a43f;});}})[_0x0805('0x25')](respondWithResult(_0x2cbf16,null))[_0x0805('0x1a')](handleError(_0x2cbf16,null));};exports[_0x0805('0x11f')]=function(_0x21c587,_0x14e1cf){return db[_0x0805('0x2f')][_0x0805('0x4a')]({'where':{'id':_0x21c587['params']['id']}})[_0x0805('0x25')](handleEntityNotFound(_0x14e1cf,null))['then'](function(_0x3146d7){if(_0x3146d7){return _0x3146d7[_0x0805('0x11f')](_0x21c587['query'][_0x0805('0x58')])[_0x0805('0x25')](function(){if(_['isArray'](_0x21c587[_0x0805('0x33')][_0x0805('0x58')])){for(var _0xccbbdd=0x0;_0xccbbdd<_0x21c587[_0x0805('0x33')][_0x0805('0x58')][_0x0805('0x36')];_0xccbbdd+=0x1){socket[_0x0805('0x120')](_0x0805('0x121'),{'UserId':Number(_0x21c587['query']['ids'][_0xccbbdd]),'ChatWebsiteId':Number(_0x21c587['params']['id'])});}}else{socket[_0x0805('0x120')](_0x0805('0x121'),{'UserId':Number(_0x21c587['query']['ids']),'ChatWebsiteId':Number(_0x21c587['params']['id'])});}});}})['then'](respondWithStatusCode(_0x14e1cf,null))[_0x0805('0x1a')](handleError(_0x14e1cf,null));};exports[_0x0805('0x122')]=function(_0x40a193,_0x16450c){var _0x4920b2={};var _0x5d28ac={};var _0x5da4c4;var _0x309d5e;return db[_0x0805('0x2f')][_0x0805('0x5c')]({'where':{'id':_0x40a193[_0x0805('0x47')]['id']}})['then'](handleEntityNotFound(_0x16450c,null))[_0x0805('0x25')](function(_0x4c273b){if(_0x4c273b){_0x5da4c4=_0x4c273b;_0x5d28ac[_0x0805('0x32')]=_[_0x0805('0x48')](db[_0x0805('0xe1')][_0x0805('0x30')]);_0x5d28ac[_0x0805('0x33')]=_[_0x0805('0x48')](_0x40a193[_0x0805('0x33')]);_0x5d28ac['filters']=_['intersection'](_0x5d28ac[_0x0805('0x32')],_0x5d28ac['query']);_0x4920b2[_0x0805('0x35')]=_[_0x0805('0x49')](_0x5d28ac[_0x0805('0x32')],qs[_0x0805('0x34')](_0x40a193[_0x0805('0x33')][_0x0805('0x34')]));_0x4920b2[_0x0805('0x35')]=_0x4920b2[_0x0805('0x35')]['length']?_0x4920b2[_0x0805('0x35')]:_0x5d28ac[_0x0805('0x32')];_0x4920b2[_0x0805('0x39')]=qs[_0x0805('0x3a')](_0x40a193['query'][_0x0805('0x3a')]);_0x4920b2[_0x0805('0x3b')]=qs[_0x0805('0x3c')](_[_0x0805('0x3d')](_0x40a193['query'],_0x5d28ac['filters']));if(_0x40a193[_0x0805('0x33')][_0x0805('0x3e')]){_0x4920b2['where']=_[_0x0805('0x3f')](_0x4920b2[_0x0805('0x3b')],{'$or':_['map'](_0x4920b2[_0x0805('0x35')],function(_0x17d533){var _0x2362d9={};_0x2362d9[_0x17d533]={'$like':'%'+_0x40a193[_0x0805('0x33')]['filter']+'%'};return _0x2362d9;})});}_0x4920b2=_[_0x0805('0x3f')]({},_0x4920b2,_0x40a193[_0x0805('0x42')]);return _0x5da4c4[_0x0805('0x122')](_0x4920b2);}})[_0x0805('0x25')](function(_0x900042){if(_0x900042){_0x309d5e=_0x900042['length'];if(!_0x40a193[_0x0805('0x33')]['hasOwnProperty']('nolimit')){_0x4920b2['limit']=qs[_0x0805('0x38')](_0x40a193[_0x0805('0x33')][_0x0805('0x38')]);_0x4920b2['offset']=qs[_0x0805('0x1f')](_0x40a193[_0x0805('0x33')][_0x0805('0x1f')]);}return _0x5da4c4[_0x0805('0x122')](_0x4920b2);}})[_0x0805('0x25')](function(_0x213d46){if(_0x213d46){return _0x213d46?{'count':_0x309d5e,'rows':_0x213d46}:null;}})['then'](respondWithResult(_0x16450c,null))[_0x0805('0x1a')](handleError(_0x16450c,null));};
\ No newline at end of file
index 6d32e50..907c4bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a28=['emit','hasOwnProperty','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x8a28,0xfd));var _0x88a2=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x8a28[_0xbca1b1];return _0x4e1686;};'use strict';var EventEmitter=require(_0x88a2('0x0'));var ChatWebsite=require(_0x88a2('0x1'))['db'][_0x88a2('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x88a2('0x3')](0x0);var events={'afterCreate':_0x88a2('0x4'),'afterUpdate':_0x88a2('0x5'),'afterDestroy':_0x88a2('0x6')};function emitEvent(_0x3fc89d){return function(_0x5d5b92,_0x2f482e,_0x238f2a){ChatWebsiteEvents[_0x88a2('0x7')](_0x3fc89d+':'+_0x5d5b92['id'],_0x5d5b92);ChatWebsiteEvents[_0x88a2('0x7')](_0x3fc89d,_0x5d5b92);_0x238f2a(null);};}for(var e in events){if(events[_0x88a2('0x8')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x88a2('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x3351=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x647c6c,_0x4cb7f){var _0xa57805=function(_0x692f69){while(--_0x692f69){_0x647c6c['push'](_0x647c6c['shift']());}};_0xa57805(++_0x4cb7f);}(_0x3351,0x1b4));var _0x1335=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x3351[_0x3899d1];return _0xeb4a7d;};'use strict';var EventEmitter=require(_0x1335('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x1335('0x1')](0x0);var events={'afterCreate':_0x1335('0x2'),'afterUpdate':_0x1335('0x3'),'afterDestroy':_0x1335('0x4')};function emitEvent(_0x21ea3d){return function(_0x173f26,_0x1f635d,_0x4d503a){ChatWebsiteEvents[_0x1335('0x5')](_0x21ea3d+':'+_0x173f26['id'],_0x173f26);ChatWebsiteEvents[_0x1335('0x5')](_0x21ea3d,_0x173f26);_0x4d503a(null);};}for(var e in events){if(events[_0x1335('0x6')](e)){var event=events[e];ChatWebsite[_0x1335('0x7')](e,emitEvent(event));}}module[_0x1335('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
index 81c7322..b9eab57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5510=['api','request-promise','path','rimraf','../../config/environment','exports','define','ChatWebsite','chat_websites','lodash','../../config/logger'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x5510,0x98));var _0x0551=function(_0x21b359,_0x4dc80e){_0x21b359=_0x21b359-0x0;var _0x57b8e7=_0x5510[_0x21b359];return _0x57b8e7;};'use strict';var _=require(_0x0551('0x0'));var util=require('util');var logger=require(_0x0551('0x1'))(_0x0551('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0551('0x3'));var fs=require('fs');var path=require(_0x0551('0x4'));var rimraf=require(_0x0551('0x5'));var config=require(_0x0551('0x6'));var attributes=require('./chatWebsite.attributes');module[_0x0551('0x7')]=function(_0x4b606f,_0x4f6924){return _0x4b606f[_0x0551('0x8')](_0x0551('0x9'),attributes,{'tableName':_0x0551('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6600=['chat_websites','lodash','api','bluebird','request-promise','rimraf','./chatWebsite.attributes','define','ChatWebsite'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x6600,0x106));var _0x0660=function(_0x2cbcd2,_0x12fea5){_0x2cbcd2=_0x2cbcd2-0x0;var _0x5d36df=_0x6600[_0x2cbcd2];return _0x5d36df;};'use strict';var _=require(_0x0660('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0660('0x1'));var moment=require('moment');var BPromise=require(_0x0660('0x2'));var rp=require(_0x0660('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0660('0x4'));var config=require('../../config/environment');var attributes=require(_0x0660('0x5'));module['exports']=function(_0x43d4d3,_0x594a5c){return _0x43d4d3[_0x0660('0x6')](_0x0660('0x7'),attributes,{'tableName':_0x0660('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 55d4150..9f7820e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d11=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x7c8195,_0x2dec77){var _0x4ebaf3=function(_0xa3d211){while(--_0xa3d211){_0x7c8195['push'](_0x7c8195['shift']());}};_0x4ebaf3(++_0x2dec77);}(_0x7d11,0x17b));var _0x17d1=function(_0x1ccf70,_0x1f6416){_0x1ccf70=_0x1ccf70-0x0;var _0x4a0de6=_0x7d11[_0x1ccf70];return _0x4a0de6;};'use strict';var _=require(_0x17d1('0x0'));var util=require(_0x17d1('0x1'));var moment=require('moment');var BPromise=require(_0x17d1('0x2'));var rs=require(_0x17d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x17d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x17d1('0x5'))('rpc');var config=require(_0x17d1('0x6'));var jayson=require(_0x17d1('0x7'));var client=jayson[_0x17d1('0x8')][_0x17d1('0x9')]({'port':0x232a});config[_0x17d1('0xa')]=_[_0x17d1('0xb')](config[_0x17d1('0xa')],{'host':_0x17d1('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x17d1('0xa')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x2349ab,_0x87ee7b,_0x37329c){return new BPromise(function(_0xf01f19,_0x510457){return client['request'](_0x2349ab,_0x37329c)['then'](function(_0x4a9f9c){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x87ee7b,_0x17d1('0xd'));logger[_0x17d1('0xe')](_0x17d1('0xf'),_0x87ee7b,'request\x20sent',JSON[_0x17d1('0x10')](_0x4a9f9c));if(_0x4a9f9c[_0x17d1('0x11')]){if(_0x4a9f9c[_0x17d1('0x11')][_0x17d1('0x12')]===0x1f4){logger[_0x17d1('0x11')](_0x17d1('0x13'),_0x87ee7b,_0x4a9f9c[_0x17d1('0x11')]['message']);return _0x510457(_0x4a9f9c['error'][_0x17d1('0x14')]);}logger[_0x17d1('0x11')](_0x17d1('0x13'),_0x87ee7b,_0x4a9f9c[_0x17d1('0x11')][_0x17d1('0x14')]);return _0xf01f19(_0x4a9f9c[_0x17d1('0x11')][_0x17d1('0x14')]);}else{logger[_0x17d1('0x15')](_0x17d1('0x13'),_0x87ee7b,'request\x20sent');_0xf01f19(_0x4a9f9c[_0x17d1('0x16')]['message']);}})[_0x17d1('0x17')](function(_0x3f7408){logger['error'](_0x17d1('0x13'),_0x87ee7b,_0x3f7408);_0x510457(_0x3f7408);});});}
\ No newline at end of file
+var _0x3a8d=['./chatWebsite.socket','register','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x4a292c,_0x176acd){var _0xaee381=function(_0x4100b6){while(--_0x4100b6){_0x4a292c['push'](_0x4a292c['shift']());}};_0xaee381(++_0x176acd);}(_0x3a8d,0xa8));var _0xd3a8=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0x3a8d[_0x251d9c];return _0x16ae64;};'use strict';var _=require(_0xd3a8('0x0'));var util=require(_0xd3a8('0x1'));var moment=require(_0xd3a8('0x2'));var BPromise=require(_0xd3a8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3a8('0x4'));var db=require(_0xd3a8('0x5'))['db'];var utils=require(_0xd3a8('0x6'));var logger=require('../../config/logger')(_0xd3a8('0x7'));var config=require(_0xd3a8('0x8'));var jayson=require(_0xd3a8('0x9'));var client=jayson['client'][_0xd3a8('0xa')]({'port':0x232a});config[_0xd3a8('0xb')]=_[_0xd3a8('0xc')](config[_0xd3a8('0xb')],{'host':_0xd3a8('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd3a8('0xb')]));require(_0xd3a8('0xe'))[_0xd3a8('0xf')](socket);function respondWithRpcPromise(_0x5e344c,_0x19e390,_0x7ac38b){return new BPromise(function(_0x2ddf5e,_0x3f2b47){return client['request'](_0x5e344c,_0x7ac38b)['then'](function(_0x9e2701){logger[_0xd3a8('0x10')](_0xd3a8('0x11'),_0x19e390,'request\x20sent');logger[_0xd3a8('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x19e390,_0xd3a8('0x13'),JSON[_0xd3a8('0x14')](_0x9e2701));if(_0x9e2701[_0xd3a8('0x15')]){if(_0x9e2701[_0xd3a8('0x15')][_0xd3a8('0x16')]===0x1f4){logger[_0xd3a8('0x15')](_0xd3a8('0x11'),_0x19e390,_0x9e2701[_0xd3a8('0x15')][_0xd3a8('0x17')]);return _0x3f2b47(_0x9e2701[_0xd3a8('0x15')]['message']);}logger[_0xd3a8('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x19e390,_0x9e2701[_0xd3a8('0x15')][_0xd3a8('0x17')]);return _0x2ddf5e(_0x9e2701[_0xd3a8('0x15')][_0xd3a8('0x17')]);}else{logger[_0xd3a8('0x10')](_0xd3a8('0x11'),_0x19e390,_0xd3a8('0x13'));_0x2ddf5e(_0x9e2701[_0xd3a8('0x18')]['message']);}})[_0xd3a8('0x19')](function(_0x143893){logger[_0xd3a8('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x19e390,_0x143893);_0x3f2b47(_0x143893);});});}
\ No newline at end of file
index a284aa8..09bb4d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda69=['save','remove','update','emit','register','chatWebsite:','./chatWebsite.events'];(function(_0x17f594,_0x52319f){var _0x28e31c=function(_0x76ef43){while(--_0x76ef43){_0x17f594['push'](_0x17f594['shift']());}};_0x28e31c(++_0x52319f);}(_0xda69,0x148));var _0x9da6=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xda69[_0x12f688];return _0x59c3de;};'use strict';var ChatWebsiteEvents=require(_0x9da6('0x0'));var events=[_0x9da6('0x1'),_0x9da6('0x2'),_0x9da6('0x3')];function createListener(_0x1d7586,_0x4304e9){return function(_0x498e87){_0x4304e9[_0x9da6('0x4')](_0x1d7586,_0x498e87);};}function removeListener(_0x37d973,_0x22a70f){return function(){ChatWebsiteEvents['removeListener'](_0x37d973,_0x22a70f);};}exports[_0x9da6('0x5')]=function(_0x571337){for(var _0x58fb3b=0x0,_0x3d4d03=events['length'];_0x58fb3b<_0x3d4d03;_0x58fb3b++){var _0x1e2cea=events[_0x58fb3b];var _0x4c43b6=createListener(_0x9da6('0x6')+_0x1e2cea,_0x571337);ChatWebsiteEvents['on'](_0x1e2cea,_0x4c43b6);}};
\ No newline at end of file
+var _0xd655=['register','length','chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener'];(function(_0x87506e,_0x5680ec){var _0x5496a4=function(_0x1e29ab){while(--_0x1e29ab){_0x87506e['push'](_0x87506e['shift']());}};_0x5496a4(++_0x5680ec);}(_0xd655,0xe4));var _0x5d65=function(_0x1f3aec,_0x24c18e){_0x1f3aec=_0x1f3aec-0x0;var _0x409f0d=_0xd655[_0x1f3aec];return _0x409f0d;};'use strict';var ChatWebsiteEvents=require(_0x5d65('0x0'));var events=[_0x5d65('0x1'),_0x5d65('0x2'),_0x5d65('0x3')];function createListener(_0x2b463d,_0x3516b7){return function(_0x15bf7e){_0x3516b7[_0x5d65('0x4')](_0x2b463d,_0x15bf7e);};}function removeListener(_0x59ebdb,_0x4c02d3){return function(){ChatWebsiteEvents[_0x5d65('0x5')](_0x59ebdb,_0x4c02d3);};}exports[_0x5d65('0x6')]=function(_0x439121){for(var _0x1c8db9=0x0,_0x500f59=events[_0x5d65('0x7')];_0x1c8db9<_0x500f59;_0x1c8db9++){var _0x1883e1=events[_0x1c8db9];var _0x1a5860=createListener(_0x5d65('0x8')+_0x1883e1,_0x439121);ChatWebsiteEvents['on'](_0x1883e1,_0x1a5860);}};
\ No newline at end of file
index 2107ee6..b309406 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2583=['addAgents','put','delete','removeDispositions','removeAnswers','/:id/users','exports','multer','express','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','getDispositions','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','/:id/dispositions','addDisposition','/:id/canned_answers','join','server/files/images/logos/','format','%s-%s','now','originalname','file','root','addAvatar','diskStorage','server/files/images/avatars/','single','addCustomerAvatar','/:id/system_avatar','addSystemAvatar','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x2583,0x1ce));var _0x3258=function(_0x35f9f8,_0x3b66c2){_0x35f9f8=_0x35f9f8-0x0;var _0x4cea3c=_0x2583[_0x35f9f8];return _0x4cea3c;};'use strict';var multer=require(_0x3258('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3258('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3258('0x2'));var config=require(_0x3258('0x3'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x3258('0x4')](),controller['index']);router[_0x3258('0x5')]('/describe',auth[_0x3258('0x4')](),controller['describe']);router[_0x3258('0x5')](_0x3258('0x6'),auth['isAuthenticated'](),controller['show']);router[_0x3258('0x5')]('/:id/dispositions',auth[_0x3258('0x4')](),controller[_0x3258('0x7')]);router[_0x3258('0x5')]('/:id/canned_answers',auth[_0x3258('0x4')](),controller['getAnswers']);router['get'](_0x3258('0x8'),controller[_0x3258('0x9')]);router['get'](_0x3258('0xa'),controller[_0x3258('0xb')]);router[_0x3258('0x5')](_0x3258('0xc'),controller[_0x3258('0xd')]);router[_0x3258('0x5')]('/:id/system_avatar',controller[_0x3258('0xe')]);router[_0x3258('0x5')](_0x3258('0xf'),auth[_0x3258('0x4')](),controller[_0x3258('0x10')]);router[_0x3258('0x5')](_0x3258('0x11'),controller['getSnippet']);router[_0x3258('0x5')](_0x3258('0x12'),auth[_0x3258('0x4')](),controller[_0x3258('0x13')]);router[_0x3258('0x5')]('/:id/proactive_actions',auth[_0x3258('0x4')](),controller[_0x3258('0x14')]);router[_0x3258('0x5')]('/:id/fields',controller[_0x3258('0x15')]);router['get'](_0x3258('0x16'),auth[_0x3258('0x4')](),controller[_0x3258('0x17')]);router[_0x3258('0x5')]('/:id/users',auth[_0x3258('0x4')](),controller[_0x3258('0x18')]);router[_0x3258('0x19')]('/',auth[_0x3258('0x4')](),controller[_0x3258('0x1a')]);router['post'](_0x3258('0x1b'),auth[_0x3258('0x4')](),controller[_0x3258('0x1c')]);router[_0x3258('0x19')](_0x3258('0x1d'),auth[_0x3258('0x4')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xe916f3,_0x24cce5,_0xc969f6){_0xc969f6(null,path[_0x3258('0x1e')](config['root'],_0x3258('0x1f')));},'filename':function(_0x112cab,_0x5cd40f,_0x23f824){_0x23f824(null,util[_0x3258('0x20')](_0x3258('0x21'),Date[_0x3258('0x22')](),_0x5cd40f[_0x3258('0x23')]));}})});router[_0x3258('0x19')]('/:id/logo',upload['single'](_0x3258('0x24')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x46469e,_0xb28938,_0x3734f4){_0x3734f4(null,path[_0x3258('0x1e')](config[_0x3258('0x25')],'server/files/images/avatars/'));},'filename':function(_0x32349e,_0x1c60a0,_0x134b89){_0x134b89(null,util[_0x3258('0x20')](_0x3258('0x21'),Date['now'](),_0x1c60a0['originalname']));}})});router[_0x3258('0x19')](_0x3258('0xa'),upload['single'](_0x3258('0x24')),controller[_0x3258('0x26')]);var upload=multer({'storage':multer[_0x3258('0x27')]({'destination':function(_0x68dc95,_0x2c082b,_0x3fe701){_0x3fe701(null,path[_0x3258('0x1e')](config[_0x3258('0x25')],_0x3258('0x28')));},'filename':function(_0x15e839,_0x270e77,_0x38708f){_0x38708f(null,util[_0x3258('0x20')](_0x3258('0x21'),Date[_0x3258('0x22')](),_0x270e77[_0x3258('0x23')]));}})});router[_0x3258('0x19')]('/:id/customer_avatar',upload[_0x3258('0x29')](_0x3258('0x24')),controller[_0x3258('0x2a')]);var upload=multer({'storage':multer[_0x3258('0x27')]({'destination':function(_0x3e1cd6,_0x2d802e,_0x303bbe){_0x303bbe(null,path[_0x3258('0x1e')](config[_0x3258('0x25')],_0x3258('0x28')));},'filename':function(_0x440ad2,_0x313da0,_0x15eff6){_0x15eff6(null,util['format']('%s-%s',Date['now'](),_0x313da0['originalname']));}})});router['post'](_0x3258('0x2b'),upload[_0x3258('0x29')](_0x3258('0x24')),controller[_0x3258('0x2c')]);router[_0x3258('0x19')]('/:id/notify',controller[_0x3258('0x2d')]);const offlineUploadMulter=multer({'storage':multer[_0x3258('0x27')]({'destination':function(_0x16a7d6,_0x198eeb,_0x21a96a){const _0x5ab2b8=path[_0x3258('0x1e')](config[_0x3258('0x25')],_0x3258('0x2e'),_0x3258('0x2f'),_0x3258('0x30'));fs_extra[_0x3258('0x31')](_0x5ab2b8,function(){_0x21a96a(null,_0x5ab2b8);});},'filename':function(_0x14540d,_0x2fd2c0,_0x4e0c38){const _0x523ccb=_0x2fd2c0[_0x3258('0x23')][_0x3258('0x32')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2a3c08=path[_0x3258('0x33')](_0x523ccb);const _0x259286=Date[_0x3258('0x22')]()+'-'+_0x523ccb['replace'](_0x2a3c08,'')+_0x2a3c08;_0x4e0c38(null,_0x259286);}})});router[_0x3258('0x19')](_0x3258('0x34'),offlineUploadMulter['any'](),controller[_0x3258('0x35')]);router[_0x3258('0x19')](_0x3258('0xf'),auth['isAuthenticated'](),controller[_0x3258('0x36')]);router[_0x3258('0x19')](_0x3258('0x12'),auth[_0x3258('0x4')](),controller[_0x3258('0x37')]);router[_0x3258('0x19')](_0x3258('0x38'),auth[_0x3258('0x4')](),controller[_0x3258('0x39')]);router[_0x3258('0x19')]('/:id/users',auth[_0x3258('0x4')](),controller[_0x3258('0x3a')]);router[_0x3258('0x3b')](_0x3258('0x6'),auth[_0x3258('0x4')](),controller['update']);router[_0x3258('0x3c')](_0x3258('0x6'),auth[_0x3258('0x4')](),controller['destroy']);router[_0x3258('0x3c')](_0x3258('0x1b'),auth[_0x3258('0x4')](),controller[_0x3258('0x3d')]);router['delete']('/:id/canned_answers',auth[_0x3258('0x4')](),controller[_0x3258('0x3e')]);router['delete'](_0x3258('0x3f'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x3258('0x40')]=router;
\ No newline at end of file
+var _0x3806=['notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','getDispositions','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','getFields','/:id/offline_messages','/:id/users','getAgents','post','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','join','root','server/files/images/logos/','format','now','originalname','single','file','addLogo','server/files/images/avatars/','%s-%s','addAvatar','diskStorage','addCustomerAvatar','addSystemAvatar','/:id/notify'];(function(_0x17ccc4,_0x2a06fa){var _0x58ba42=function(_0x5d14e3){while(--_0x5d14e3){_0x17ccc4['push'](_0x17ccc4['shift']());}};_0x58ba42(++_0x2a06fa);}(_0x3806,0x187));var _0x6380=function(_0x3e63fd,_0x5a6ca6){_0x3e63fd=_0x3e63fd-0x0;var _0x53e79a=_0x3806[_0x3e63fd];return _0x53e79a;};'use strict';var multer=require(_0x6380('0x0'));var util=require(_0x6380('0x1'));var path=require(_0x6380('0x2'));var timeout=require('connect-timeout');var express=require(_0x6380('0x3'));var router=express[_0x6380('0x4')]();var fs_extra=require(_0x6380('0x5'));var auth=require(_0x6380('0x6'));var interaction=require(_0x6380('0x7'));var config=require(_0x6380('0x8'));var controller=require('./chatWebsite.controller');router[_0x6380('0x9')]('/',auth[_0x6380('0xa')](),controller[_0x6380('0xb')]);router[_0x6380('0x9')](_0x6380('0xc'),auth[_0x6380('0xa')](),controller['describe']);router[_0x6380('0x9')]('/:id',auth[_0x6380('0xa')](),controller[_0x6380('0xd')]);router[_0x6380('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x6380('0xe')]);router['get']('/:id/canned_answers',auth[_0x6380('0xa')](),controller['getAnswers']);router[_0x6380('0x9')](_0x6380('0xf'),controller[_0x6380('0x10')]);router[_0x6380('0x9')](_0x6380('0x11'),controller['getAvatar']);router[_0x6380('0x9')](_0x6380('0x12'),controller[_0x6380('0x13')]);router['get'](_0x6380('0x14'),controller[_0x6380('0x15')]);router[_0x6380('0x9')](_0x6380('0x16'),auth[_0x6380('0xa')](),controller[_0x6380('0x17')]);router[_0x6380('0x9')](_0x6380('0x18'),controller[_0x6380('0x19')]);router['get'](_0x6380('0x1a'),auth['isAuthenticated'](),controller[_0x6380('0x1b')]);router[_0x6380('0x9')]('/:id/proactive_actions',auth[_0x6380('0xa')](),controller['getProactiveActions']);router[_0x6380('0x9')]('/:id/fields',controller[_0x6380('0x1c')]);router[_0x6380('0x9')](_0x6380('0x1d'),auth[_0x6380('0xa')](),controller['getOfflineMessages']);router[_0x6380('0x9')](_0x6380('0x1e'),auth[_0x6380('0xa')](),controller[_0x6380('0x1f')]);router[_0x6380('0x20')]('/',auth[_0x6380('0xa')](),controller['create']);router['post'](_0x6380('0x21'),auth[_0x6380('0xa')](),controller[_0x6380('0x22')]);router[_0x6380('0x20')](_0x6380('0x23'),auth[_0x6380('0xa')](),controller[_0x6380('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x9c18a1,_0x4a738f,_0x97e0d8){_0x97e0d8(null,path[_0x6380('0x25')](config[_0x6380('0x26')],_0x6380('0x27')));},'filename':function(_0x573f7c,_0x1c578e,_0x284d5b){_0x284d5b(null,util[_0x6380('0x28')]('%s-%s',Date[_0x6380('0x29')](),_0x1c578e[_0x6380('0x2a')]));}})});router[_0x6380('0x20')](_0x6380('0xf'),upload[_0x6380('0x2b')](_0x6380('0x2c')),controller[_0x6380('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4c3ed4,_0xcde724,_0x3cca59){_0x3cca59(null,path[_0x6380('0x25')](config[_0x6380('0x26')],_0x6380('0x2e')));},'filename':function(_0x398cca,_0x45a3bf,_0xaa58d9){_0xaa58d9(null,util['format'](_0x6380('0x2f'),Date['now'](),_0x45a3bf['originalname']));}})});router[_0x6380('0x20')](_0x6380('0x11'),upload['single']('file'),controller[_0x6380('0x30')]);var upload=multer({'storage':multer[_0x6380('0x31')]({'destination':function(_0x4b20d2,_0x7ba24f,_0x4d4415){_0x4d4415(null,path[_0x6380('0x25')](config[_0x6380('0x26')],_0x6380('0x2e')));},'filename':function(_0x20284a,_0xffc7dd,_0x44ed7a){_0x44ed7a(null,util[_0x6380('0x28')](_0x6380('0x2f'),Date['now'](),_0xffc7dd[_0x6380('0x2a')]));}})});router[_0x6380('0x20')](_0x6380('0x12'),upload[_0x6380('0x2b')](_0x6380('0x2c')),controller[_0x6380('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x30d456,_0x46dc8b,_0x3f173e){_0x3f173e(null,path[_0x6380('0x25')](config[_0x6380('0x26')],_0x6380('0x2e')));},'filename':function(_0x225467,_0x14ec10,_0x11c701){_0x11c701(null,util[_0x6380('0x28')]('%s-%s',Date[_0x6380('0x29')](),_0x14ec10[_0x6380('0x2a')]));}})});router[_0x6380('0x20')]('/:id/system_avatar',upload[_0x6380('0x2b')](_0x6380('0x2c')),controller[_0x6380('0x33')]);router[_0x6380('0x20')](_0x6380('0x34'),controller[_0x6380('0x35')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x5c013b,_0x36a134,_0x445ec2){const _0x225b15=path[_0x6380('0x25')](config[_0x6380('0x26')],'server/files',_0x6380('0x36'),_0x6380('0x37'));fs_extra[_0x6380('0x38')](_0x225b15,function(){_0x445ec2(null,_0x225b15);});},'filename':function(_0x603e14,_0x2d2e56,_0x5236af){const _0x2bcc29=_0x2d2e56[_0x6380('0x2a')][_0x6380('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3d09be=path[_0x6380('0x3a')](_0x2bcc29);const _0x1ed709=Date[_0x6380('0x29')]()+'-'+_0x2bcc29[_0x6380('0x39')](_0x3d09be,'')+_0x3d09be;_0x5236af(null,_0x1ed709);}})});router['post'](_0x6380('0x3b'),offlineUploadMulter[_0x6380('0x3c')](),controller[_0x6380('0x3d')]);router[_0x6380('0x20')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x6380('0x3e')]);router[_0x6380('0x20')](_0x6380('0x1a'),auth['isAuthenticated'](),controller['addApplications']);router[_0x6380('0x20')]('/:id/proactive_actions',auth[_0x6380('0xa')](),controller[_0x6380('0x3f')]);router[_0x6380('0x20')](_0x6380('0x1e'),auth[_0x6380('0xa')](),controller[_0x6380('0x40')]);router[_0x6380('0x41')](_0x6380('0x42'),auth[_0x6380('0xa')](),controller[_0x6380('0x43')]);router[_0x6380('0x44')](_0x6380('0x42'),auth[_0x6380('0xa')](),controller[_0x6380('0x45')]);router['delete'](_0x6380('0x21'),auth[_0x6380('0xa')](),controller[_0x6380('0x46')]);router[_0x6380('0x44')](_0x6380('0x23'),auth['isAuthenticated'](),controller[_0x6380('0x47')]);router['delete'](_0x6380('0x1e'),auth[_0x6380('0xa')](),controller[_0x6380('0x48')]);module[_0x6380('0x49')]=router;
\ No newline at end of file
index 3e0cf7d..e3ce0ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd568=['get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','exports','beaver-logger/server','../components/auth/service','../config/environment','Router','env','production'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd568,0xe4));var _0x8d56=function(_0x22c90a,_0x88f294){_0x22c90a=_0x22c90a-0x0;var _0x25240c=_0xd568[_0x22c90a];return _0x25240c;};var beaverLogger=require(_0x8d56('0x0'));var express=require('express');var auth=require(_0x8d56('0x1'));var config=require(_0x8d56('0x2'));var router=express[_0x8d56('0x3')]();var isProduction=config[_0x8d56('0x4')]===_0x8d56('0x5')||![];function clientSideLogs(_0x394a42,_0x50d06a,_0x2d0e10){var _0x1d4183=_0x394a42['app'][_0x8d56('0x6')](_0x8d56('0x7'));if(!_0x1d4183){throw new Error(_0x8d56('0x8'));}return beaverLogger[_0x8d56('0x9')]({'uri':_0x8d56('0xa'),'logger':_0x1d4183,'enableCors':!isProduction})(_0x394a42,_0x50d06a,_0x2d0e10);}router[_0x8d56('0xb')](auth['isAuthenticated'](),clientSideLogs);module[_0x8d56('0xc')]=router;
\ No newline at end of file
+var _0xf76f=['client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','production','app','get'];(function(_0x5e3a45,_0x45f0c5){var _0x13419f=function(_0x5ac996){while(--_0x5ac996){_0x5e3a45['push'](_0x5e3a45['shift']());}};_0x13419f(++_0x45f0c5);}(_0xf76f,0x70));var _0xff76=function(_0x422bf5,_0x12274c){_0x422bf5=_0x422bf5-0x0;var _0x269d3c=_0xf76f[_0x422bf5];return _0x269d3c;};var beaverLogger=require(_0xff76('0x0'));var express=require(_0xff76('0x1'));var auth=require(_0xff76('0x2'));var config=require(_0xff76('0x3'));var router=express[_0xff76('0x4')]();var isProduction=config['env']===_0xff76('0x5')||![];function clientSideLogs(_0x3e9ba0,_0x12b666,_0x407f2b){var _0x314ae9=_0x3e9ba0[_0xff76('0x6')][_0xff76('0x7')](_0xff76('0x8'));if(!_0x314ae9){throw new Error(_0xff76('0x9'));}return beaverLogger[_0xff76('0xa')]({'uri':_0xff76('0xb'),'logger':_0x314ae9,'enableCors':!isProduction})(_0x3e9ba0,_0x12b666,_0x407f2b);}router[_0xff76('0xc')](auth[_0xff76('0xd')](),clientSideLogs);module[_0xff76('0xe')]=router;
\ No newline at end of file
index b7f01b2..8e62440 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e41=['TEXT','MicrosoftAzure\x20=>\x20refresh_token','sequelize','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x1e41,0x12d));var _0x11e4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x1e41[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x11e4('0x0'));module[_0x11e4('0x1')]={'name':{'type':Sequelize[_0x11e4('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x11e4('0x3')](_0x11e4('0x4'),'Google',_0x11e4('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x11e4('0x3')](_0x11e4('0x6'),_0x11e4('0x7'))},'data1':{'type':Sequelize[_0x11e4('0x2')],'comment':_0x11e4('0x8')},'data2':{'type':Sequelize[_0x11e4('0x2')],'comment':_0x11e4('0x9')},'data3':{'type':Sequelize[_0x11e4('0x2')],'comment':_0x11e4('0xa')},'data4':{'type':Sequelize[_0x11e4('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20access_token'},'data6':{'type':Sequelize[_0x11e4('0xb')],'comment':_0x11e4('0xc')},'data7':{'type':Sequelize[_0x11e4('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0xfc7d=['sequelize','exports','STRING','ENUM','AmazonAWS','Google','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'];(function(_0x31172e,_0xa59e5){var _0x414ada=function(_0x37ede4){while(--_0x37ede4){_0x31172e['push'](_0x31172e['shift']());}};_0x414ada(++_0xa59e5);}(_0xfc7d,0xa5));var _0xdfc7=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xfc7d[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xdfc7('0x0'));module[_0xdfc7('0x1')]={'name':{'type':Sequelize[_0xdfc7('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xdfc7('0x3')](_0xdfc7('0x4'),_0xdfc7('0x5'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xdfc7('0x3')](_0xdfc7('0x6'),_0xdfc7('0x7'))},'data1':{'type':Sequelize[_0xdfc7('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xdfc7('0x2')],'comment':_0xdfc7('0x8')},'data3':{'type':Sequelize['STRING'],'comment':_0xdfc7('0x9')},'data4':{'type':Sequelize[_0xdfc7('0x2')],'comment':_0xdfc7('0xa')},'data5':{'type':Sequelize[_0xdfc7('0xb')],'comment':_0xdfc7('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':_0xdfc7('0xd')},'data7':{'type':Sequelize[_0xdfc7('0xb')],'comment':_0xdfc7('0xe')}};
\ No newline at end of file
index 3330568..e6092da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x920b=['map','CloudProvider','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','options','include','findAll','rows','service','MicrosoftAzure','decryptString','params','length','find','data3','catch','create','Service\x20parameter\x20not\x20specified','values','includes','body','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','update','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','refresh_token','startRefreshInterval','emit','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','then','destroy','name','send','padEnd','index'];(function(_0x5d7005,_0x41f35a){var _0x31ed20=function(_0x3624f8){while(--_0x3624f8){_0x5d7005['push'](_0x5d7005['shift']());}};_0x31ed20(++_0x41f35a);}(_0x920b,0xa4));var _0xb920=function(_0x2c03ca,_0x2b03b6){_0x2c03ca=_0x2c03ca-0x0;var _0xfaa0a0=_0x920b[_0x2c03ca];return _0xfaa0a0;};'use strict';var _=require(_0xb920('0x0'));var Redis=require('ioredis');var qs=require(_0xb920('0x1'));var encryptor=require(_0xb920('0x2'));var config=require(_0xb920('0x3'));var logger=require(_0xb920('0x4'))(_0xb920('0x5'));var db=require(_0xb920('0x6'))['db'];var oauth=require(_0xb920('0x7'));config['redis']=_[_0xb920('0x8')](config[_0xb920('0x9')],{'host':_0xb920('0xa'),'port':0x18eb});var socket=require(_0xb920('0xb'))(new Redis(config[_0xb920('0x9')]));var redis=new Redis(config[_0xb920('0x9')]);function respondWithStatusCode(_0x44320b,_0x1a45d2){_0x1a45d2=_0x1a45d2||0xcc;return function(_0x24616d){if(_0x24616d){return _0x44320b[_0xb920('0xc')](_0x1a45d2);}return _0x44320b['status'](_0x1a45d2)[_0xb920('0xd')]();};}function respondWithResult(_0x5af32f,_0x118bad){_0x118bad=_0x118bad||0xc8;return function(_0x347ad5){if(_0x347ad5){return _0x5af32f[_0xb920('0xe')](_0x118bad)['json'](_0x347ad5);}};}function respondWithFilteredResult(_0x13cad9,_0x300997){return function(_0x36c69e){if(_0x36c69e){var _0x230f1a=typeof _0x300997[_0xb920('0xf')]===_0xb920('0x10')&&typeof _0x300997['limit']===_0xb920('0x10');var _0x50e0ce=_0x36c69e[_0xb920('0x11')];var _0x4c6d8b=_0x230f1a?0x0:_0x300997[_0xb920('0xf')];var _0x293e20=_0x230f1a?_0x36c69e[_0xb920('0x11')]:_0x300997['offset']+_0x300997[_0xb920('0x12')];var _0x1dbc2b;if(_0x293e20>=_0x50e0ce){_0x293e20=_0x50e0ce;_0x1dbc2b=0xc8;}else{_0x1dbc2b=0xce;}_0x13cad9[_0xb920('0xe')](_0x1dbc2b);return _0x13cad9[_0xb920('0x13')](_0xb920('0x14'),_0x4c6d8b+'-'+_0x293e20+'/'+_0x50e0ce)[_0xb920('0x15')](_0x36c69e);}return null;};}function saveUpdates(_0x5275db){return function(_0x28cf61){if(_0x28cf61){return _0x28cf61['update'](_0x5275db)[_0xb920('0x16')](function(_0x36d307){return _0x36d307;});}return null;};}function removeEntity(_0x12c395){return function(_0x2322cd){if(_0x2322cd){return _0x2322cd[_0xb920('0x17')]()['then'](function(){_0x12c395[_0xb920('0xe')](0xcc)[_0xb920('0xd')]();});}};}function handleEntityNotFound(_0x26b775){return function(_0x59ea9d){if(!_0x59ea9d){_0x26b775[_0xb920('0xc')](0x194);}return _0x59ea9d;};}function handleError(_0x3f4798,_0x539f30){_0x539f30=_0x539f30||0x1f4;return function(_0x318aa9){logger['error'](_0x318aa9['stack']);if(_0x318aa9[_0xb920('0x18')]){delete _0x318aa9[_0xb920('0x18')];}_0x3f4798[_0xb920('0xe')](_0x539f30)[_0xb920('0x19')](_0x318aa9);};}function maskClientSecret(_0xa8549c){return _[_0xb920('0x1a')](_0xa8549c['slice'](0x0,0x3),0x14,'*');}exports[_0xb920('0x1b')]=function(_0x457529,_0x3297d7){var _0x247015={},_0x11d411={},_0xc6cfc9={'count':0x0,'rows':[]};var _0x44d397=_[_0xb920('0x1c')](db[_0xb920('0x1d')][_0xb920('0x1e')],function(_0x1e838b){return{'name':_0x1e838b[_0xb920('0x1f')],'type':_0x1e838b['type'][_0xb920('0x20')]};});_0x11d411[_0xb920('0x21')]=_[_0xb920('0x1c')](_0x44d397,'name');_0x11d411[_0xb920('0x22')]=_[_0xb920('0x23')](_0x457529[_0xb920('0x22')]);_0x11d411[_0xb920('0x24')]=_['intersection'](_0x11d411[_0xb920('0x21')],_0x11d411[_0xb920('0x22')]);_0x247015[_0xb920('0x25')]=_[_0xb920('0x26')](_0x11d411[_0xb920('0x21')],qs[_0xb920('0x27')](_0x457529['query'][_0xb920('0x27')]));_0x247015[_0xb920('0x25')]=_0x247015['attributes']['length']?_0x247015[_0xb920('0x25')]:_0x11d411[_0xb920('0x21')];if(!_0x457529[_0xb920('0x22')][_0xb920('0x28')]('nolimit')){_0x247015['limit']=qs[_0xb920('0x12')](_0x457529['query']['limit']);_0x247015[_0xb920('0xf')]=qs[_0xb920('0xf')](_0x457529[_0xb920('0x22')][_0xb920('0xf')]);}_0x247015[_0xb920('0x29')]=qs[_0xb920('0x2a')](_0x457529['query']['sort']);_0x247015[_0xb920('0x2b')]=qs[_0xb920('0x24')](_[_0xb920('0x2c')](_0x457529[_0xb920('0x22')],_0x11d411['filters']),_0x44d397);if(_0x457529[_0xb920('0x22')]['filter']){_0x247015[_0xb920('0x2b')]=_[_0xb920('0x2d')](_0x247015[_0xb920('0x2b')],{'$or':_[_0xb920('0x1c')](_0x44d397,function(_0xbd3535){if(_0xbd3535[_0xb920('0x2e')]!==_0xb920('0x2f')){var _0x3f3d94={};_0x3f3d94[_0xbd3535[_0xb920('0x18')]]={'$like':'%'+_0x457529[_0xb920('0x22')]['filter']+'%'};return _0x3f3d94;}})});}_0x247015=_[_0xb920('0x2d')]({},_0x247015,_0x457529[_0xb920('0x30')]);var _0x2645cf={'where':_0x247015[_0xb920('0x2b')]};return db['CloudProvider'][_0xb920('0x11')](_0x2645cf)[_0xb920('0x16')](function(_0xf573b){_0xc6cfc9['count']=_0xf573b;if(_0x457529['query']['includeAll']){_0x247015[_0xb920('0x31')]=[{'all':!![]}];}return db[_0xb920('0x1d')][_0xb920('0x32')](_0x247015);})[_0xb920('0x16')](function(_0x39447e){_0xc6cfc9[_0xb920('0x33')]=_[_0xb920('0x1c')](_0x39447e,function(_0x55f0ce){if(_0x55f0ce[_0xb920('0x34')]===_0xb920('0x35')){var _0x36f2a5=encryptor[_0xb920('0x36')](_0x55f0ce['data3']);_0x55f0ce['data3']=maskClientSecret(_0x36f2a5);}return _0x55f0ce;});return _0xc6cfc9;})['then'](respondWithFilteredResult(_0x3297d7,_0x247015))['catch'](handleError(_0x3297d7,null));};exports['show']=function(_0x9d513a,_0x4823d8){var _0x1e2582={'raw':!![],'where':{'id':_0x9d513a[_0xb920('0x37')]['id']}},_0x1e3a04={};_0x1e3a04[_0xb920('0x21')]=_[_0xb920('0x23')](db[_0xb920('0x1d')][_0xb920('0x1e')]);_0x1e3a04[_0xb920('0x22')]=_[_0xb920('0x23')](_0x9d513a[_0xb920('0x22')]);_0x1e3a04[_0xb920('0x24')]=_[_0xb920('0x26')](_0x1e3a04[_0xb920('0x21')],_0x1e3a04['query']);_0x1e2582['attributes']=_['intersection'](_0x1e3a04[_0xb920('0x21')],qs[_0xb920('0x27')](_0x9d513a['query'][_0xb920('0x27')]));_0x1e2582[_0xb920('0x25')]=_0x1e2582[_0xb920('0x25')][_0xb920('0x38')]?_0x1e2582[_0xb920('0x25')]:_0x1e3a04[_0xb920('0x21')];if(_0x9d513a[_0xb920('0x22')]['includeAll']){_0x1e2582[_0xb920('0x31')]=[{'all':!![]}];}_0x1e2582=_[_0xb920('0x2d')]({},_0x1e2582,_0x9d513a[_0xb920('0x30')]);return db[_0xb920('0x1d')][_0xb920('0x39')](_0x1e2582)[_0xb920('0x16')](handleEntityNotFound(_0x4823d8,null))['then'](function(_0x139bb6){if(_0x139bb6['service']===_0xb920('0x35')){var _0x4fc980=encryptor[_0xb920('0x36')](_0x139bb6[_0xb920('0x3a')]);_0x139bb6[_0xb920('0x3a')]=maskClientSecret(_0x4fc980);}return _0x139bb6;})['then'](respondWithResult(_0x4823d8,null))[_0xb920('0x3b')](handleError(_0x4823d8,null));};exports[_0xb920('0x3c')]=function(_0xcf23b3,_0x36e9b9){if(!_0xcf23b3['body'][_0xb920('0x18')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0xcf23b3['body'][_0xb920('0x34')])throw new Error(_0xb920('0x3d'));var _0x3807e0=db[_0xb920('0x1d')][_0xb920('0x1e')][_0xb920('0x34')][_0xb920('0x3e')];if(!_0x3807e0[_0xb920('0x3f')](_0xcf23b3[_0xb920('0x40')][_0xb920('0x34')]))throw new Error(_0xb920('0x41')+_0x3807e0[_0xb920('0x42')](',\x20'));if(_0xcf23b3[_0xb920('0x40')][_0xb920('0x34')]===_0xb920('0x35')&&_0xcf23b3[_0xb920('0x40')][_0xb920('0x3a')]){_0xcf23b3[_0xb920('0x40')][_0xb920('0x3a')]=encryptor['encryptString'](_0xcf23b3[_0xb920('0x40')][_0xb920('0x3a')]);}return db[_0xb920('0x1d')]['create'](_0xcf23b3[_0xb920('0x40')],{})[_0xb920('0x16')](respondWithResult(_0x36e9b9,0xc9))['catch'](handleError(_0x36e9b9,null));};exports[_0xb920('0x43')]=function(_0x38c6a9,_0x1a4a01){if(_0x38c6a9['body']['id']){delete _0x38c6a9[_0xb920('0x40')]['id'];}return db[_0xb920('0x1d')]['find']({'where':{'id':_0x38c6a9['params']['id']}})[_0xb920('0x16')](handleEntityNotFound(_0x1a4a01,null))[_0xb920('0x16')](function(_0x2f456c){if(_0x2f456c[_0xb920('0x34')]===_0xb920('0x35')&&_0x38c6a9[_0xb920('0x40')]['data3']){_0x38c6a9[_0xb920('0x40')]['data3']=encryptor[_0xb920('0x44')](_0x38c6a9[_0xb920('0x40')][_0xb920('0x3a')]);}return _0x2f456c;})[_0xb920('0x16')](saveUpdates(_0x38c6a9['body'],null))[_0xb920('0x16')](respondWithResult(_0x1a4a01,null))['catch'](handleError(_0x1a4a01,null));};exports[_0xb920('0x17')]=function(_0x13d359,_0x5ced79){return db[_0xb920('0x1d')][_0xb920('0x39')]({'where':{'id':_0x13d359[_0xb920('0x37')]['id']}})[_0xb920('0x16')](handleEntityNotFound(_0x5ced79,null))[_0xb920('0x16')](removeEntity(_0x5ced79,null))[_0xb920('0x3b')](handleError(_0x5ced79,null));};exports[_0xb920('0x45')]=function(_0xeefd51,_0x2f192c){return db['CloudProvider'][_0xb920('0x46')]({'where':{'id':_0xeefd51[_0xb920('0x37')]['id']},'raw':!![]})[_0xb920('0x16')](function(_0x43d4e5){if(!_0x43d4e5)return _0x2f192c[_0xb920('0xc')](0x194);return{'url':oauth[_0xb920('0x47')](_0x43d4e5,_0xeefd51[_0xb920('0x48')]['id'])};})[_0xb920('0x16')](respondWithResult(_0x2f192c,null))[_0xb920('0x3b')](handleError(_0x2f192c,null));};exports[_0xb920('0x49')]=function(_0x2ed89b,_0x19aea1){var _0x40950d=_0x2ed89b[_0xb920('0x40')];var _0x53a167;var _0x497880;if(_0x40950d[_0xb920('0x4a')])throw _0x40950d;redis[_0xb920('0x4b')](_0x40950d[_0xb920('0x4c')])[_0xb920('0x16')](function(_0x2093dd){if(!_0x2093dd)throw new Error(_0xb920('0x4d'));_0x53a167=JSON[_0xb920('0x4e')](_0x2093dd);var _0x2c000f=Buffer[_0xb920('0x4f')](_0x40950d[_0xb920('0x4c')],_0xb920('0x50'))[_0xb920('0x51')]('ascii');_0x497880=JSON[_0xb920('0x4e')](_0x2c000f);if(!oauth[_0xb920('0x52')](_0x40950d[_0xb920('0x53')],_0x53a167['oauth2Claims']))throw new Error(_0xb920('0x54'));redis[_0xb920('0x55')](_0x40950d[_0xb920('0x4c')]);return oauth[_0xb920('0x56')](_0x40950d[_0xb920('0x57')],_0x53a167);})[_0xb920('0x16')](function(_0xecc869){_0x53a167[_0xb920('0x58')]=_0xecc869['access_token'];_0x53a167['data6']=_0xecc869[_0xb920('0x59')];return db[_0xb920('0x1d')][_0xb920('0x43')]({'data5':_0x53a167['data5'],'data6':_0x53a167['data6']},{'where':{'id':_0x53a167['id']}});})['then'](function(){oauth[_0xb920('0x5a')](_0x53a167);socket[_0xb920('0x5b')]('microsoftAuthorization:success',{'id':_0x497880['id']});return;})['then'](respondWithStatusCode(_0x19aea1,null))[_0xb920('0x3b')](function(_0x2ca0cc){if(_0x497880){socket[_0xb920('0x5b')](_0xb920('0x5c'),{'id':_0x497880['id']});}if(!_0x53a167){logger[_0xb920('0x4a')](_0xb920('0x5d'),_0x2ca0cc);return _0x19aea1['status'](0x1f4)['send'](_0x2ca0cc['message']);}logger[_0xb920('0x4a')](_0xb920('0x5e'),_0x53a167['id'],JSON[_0xb920('0x5f')](_0x2ca0cc));});};
\ No newline at end of file
+var _0xa228=['join','encryptString','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','Invalid\x20state\x20parameter','parse','from','base64','ascii','isValidIdToken','id_token','Unable\x20to\x20validate\x20id_token','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','error','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','update','then','name','send','slice','map','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','CloudProvider','includeAll','include','service','MicrosoftAzure','data3','catch','show','params','find','decryptString','create','Name\x20parameter\x20not\x20specified','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa228,0x192));var _0x8a22=function(_0x35af98,_0x103f33){_0x35af98=_0x35af98-0x0;var _0x5f5a62=_0xa228[_0x35af98];return _0x5f5a62;};'use strict';var _=require(_0x8a22('0x0'));var Redis=require(_0x8a22('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0x8a22('0x2'));var config=require(_0x8a22('0x3'));var logger=require('../../config/logger')(_0x8a22('0x4'));var db=require(_0x8a22('0x5'))['db'];var oauth=require(_0x8a22('0x6'));config[_0x8a22('0x7')]=_['defaults'](config['redis'],{'host':_0x8a22('0x8'),'port':0x18eb});var socket=require(_0x8a22('0x9'))(new Redis(config[_0x8a22('0x7')]));var redis=new Redis(config[_0x8a22('0x7')]);function respondWithStatusCode(_0x1423bb,_0x414863){_0x414863=_0x414863||0xcc;return function(_0x82bbed){if(_0x82bbed){return _0x1423bb[_0x8a22('0xa')](_0x414863);}return _0x1423bb['status'](_0x414863)[_0x8a22('0xb')]();};}function respondWithResult(_0x34be90,_0x16d1bf){_0x16d1bf=_0x16d1bf||0xc8;return function(_0x2f6e92){if(_0x2f6e92){return _0x34be90[_0x8a22('0xc')](_0x16d1bf)['json'](_0x2f6e92);}};}function respondWithFilteredResult(_0x1fbadc,_0x57ca70){return function(_0x23f1ad){if(_0x23f1ad){var _0x414a73=typeof _0x57ca70[_0x8a22('0xd')]===_0x8a22('0xe')&&typeof _0x57ca70[_0x8a22('0xf')]===_0x8a22('0xe');var _0x15adcf=_0x23f1ad[_0x8a22('0x10')];var _0x15a483=_0x414a73?0x0:_0x57ca70[_0x8a22('0xd')];var _0x54c011=_0x414a73?_0x23f1ad[_0x8a22('0x10')]:_0x57ca70[_0x8a22('0xd')]+_0x57ca70[_0x8a22('0xf')];var _0x553a85;if(_0x54c011>=_0x15adcf){_0x54c011=_0x15adcf;_0x553a85=0xc8;}else{_0x553a85=0xce;}_0x1fbadc['status'](_0x553a85);return _0x1fbadc[_0x8a22('0x11')](_0x8a22('0x12'),_0x15a483+'-'+_0x54c011+'/'+_0x15adcf)[_0x8a22('0x13')](_0x23f1ad);}return null;};}function saveUpdates(_0x56518f){return function(_0x41d82b){if(_0x41d82b){return _0x41d82b[_0x8a22('0x14')](_0x56518f)[_0x8a22('0x15')](function(_0x5a8374){return _0x5a8374;});}return null;};}function removeEntity(_0x2cd243){return function(_0x46991a){if(_0x46991a){return _0x46991a['destroy']()['then'](function(){_0x2cd243[_0x8a22('0xc')](0xcc)[_0x8a22('0xb')]();});}};}function handleEntityNotFound(_0x930c25){return function(_0x512289){if(!_0x512289){_0x930c25['sendStatus'](0x194);}return _0x512289;};}function handleError(_0x4f80e2,_0x3b4329){_0x3b4329=_0x3b4329||0x1f4;return function(_0x304b14){logger['error'](_0x304b14['stack']);if(_0x304b14[_0x8a22('0x16')]){delete _0x304b14[_0x8a22('0x16')];}_0x4f80e2[_0x8a22('0xc')](_0x3b4329)[_0x8a22('0x17')](_0x304b14);};}function maskClientSecret(_0x2ea91b){return _['padEnd'](_0x2ea91b[_0x8a22('0x18')](0x0,0x3),0x14,'*');}exports['index']=function(_0x34b553,_0x28b2be){var _0x1159a8={},_0x2d21e0={},_0x210b36={'count':0x0,'rows':[]};var _0x3fcb=_[_0x8a22('0x19')](db['CloudProvider'][_0x8a22('0x1a')],function(_0x3665c9){return{'name':_0x3665c9[_0x8a22('0x1b')],'type':_0x3665c9[_0x8a22('0x1c')]['key']};});_0x2d21e0['model']=_['map'](_0x3fcb,_0x8a22('0x16'));_0x2d21e0['query']=_[_0x8a22('0x1d')](_0x34b553[_0x8a22('0x1e')]);_0x2d21e0['filters']=_[_0x8a22('0x1f')](_0x2d21e0[_0x8a22('0x20')],_0x2d21e0[_0x8a22('0x1e')]);_0x1159a8[_0x8a22('0x21')]=_['intersection'](_0x2d21e0[_0x8a22('0x20')],qs[_0x8a22('0x22')](_0x34b553[_0x8a22('0x1e')][_0x8a22('0x22')]));_0x1159a8['attributes']=_0x1159a8[_0x8a22('0x21')][_0x8a22('0x23')]?_0x1159a8['attributes']:_0x2d21e0[_0x8a22('0x20')];if(!_0x34b553[_0x8a22('0x1e')]['hasOwnProperty'](_0x8a22('0x24'))){_0x1159a8[_0x8a22('0xf')]=qs[_0x8a22('0xf')](_0x34b553[_0x8a22('0x1e')][_0x8a22('0xf')]);_0x1159a8['offset']=qs[_0x8a22('0xd')](_0x34b553[_0x8a22('0x1e')][_0x8a22('0xd')]);}_0x1159a8[_0x8a22('0x25')]=qs[_0x8a22('0x26')](_0x34b553[_0x8a22('0x1e')][_0x8a22('0x26')]);_0x1159a8[_0x8a22('0x27')]=qs[_0x8a22('0x28')](_[_0x8a22('0x29')](_0x34b553['query'],_0x2d21e0['filters']),_0x3fcb);if(_0x34b553[_0x8a22('0x1e')][_0x8a22('0x2a')]){_0x1159a8['where']=_[_0x8a22('0x2b')](_0x1159a8['where'],{'$or':_[_0x8a22('0x19')](_0x3fcb,function(_0x28c4c9){if(_0x28c4c9['type']!==_0x8a22('0x2c')){var _0x33a607={};_0x33a607[_0x28c4c9[_0x8a22('0x16')]]={'$like':'%'+_0x34b553[_0x8a22('0x1e')][_0x8a22('0x2a')]+'%'};return _0x33a607;}})});}_0x1159a8=_[_0x8a22('0x2b')]({},_0x1159a8,_0x34b553[_0x8a22('0x2d')]);var _0x114fd5={'where':_0x1159a8['where']};return db[_0x8a22('0x2e')][_0x8a22('0x10')](_0x114fd5)[_0x8a22('0x15')](function(_0x1374fc){_0x210b36['count']=_0x1374fc;if(_0x34b553[_0x8a22('0x1e')][_0x8a22('0x2f')]){_0x1159a8[_0x8a22('0x30')]=[{'all':!![]}];}return db[_0x8a22('0x2e')]['findAll'](_0x1159a8);})[_0x8a22('0x15')](function(_0x31e983){_0x210b36['rows']=_[_0x8a22('0x19')](_0x31e983,function(_0x4ed05c){if(_0x4ed05c[_0x8a22('0x31')]===_0x8a22('0x32')){var _0x536d10=encryptor['decryptString'](_0x4ed05c[_0x8a22('0x33')]);_0x4ed05c[_0x8a22('0x33')]=maskClientSecret(_0x536d10);}return _0x4ed05c;});return _0x210b36;})[_0x8a22('0x15')](respondWithFilteredResult(_0x28b2be,_0x1159a8))[_0x8a22('0x34')](handleError(_0x28b2be,null));};exports[_0x8a22('0x35')]=function(_0x5b8e94,_0x20b376){var _0x1e4c81={'raw':!![],'where':{'id':_0x5b8e94[_0x8a22('0x36')]['id']}},_0x10d22c={};_0x10d22c['model']=_[_0x8a22('0x1d')](db['CloudProvider'][_0x8a22('0x1a')]);_0x10d22c['query']=_['keys'](_0x5b8e94['query']);_0x10d22c[_0x8a22('0x28')]=_[_0x8a22('0x1f')](_0x10d22c[_0x8a22('0x20')],_0x10d22c['query']);_0x1e4c81[_0x8a22('0x21')]=_[_0x8a22('0x1f')](_0x10d22c[_0x8a22('0x20')],qs['fields'](_0x5b8e94[_0x8a22('0x1e')][_0x8a22('0x22')]));_0x1e4c81['attributes']=_0x1e4c81[_0x8a22('0x21')][_0x8a22('0x23')]?_0x1e4c81[_0x8a22('0x21')]:_0x10d22c[_0x8a22('0x20')];if(_0x5b8e94['query'][_0x8a22('0x2f')]){_0x1e4c81[_0x8a22('0x30')]=[{'all':!![]}];}_0x1e4c81=_[_0x8a22('0x2b')]({},_0x1e4c81,_0x5b8e94[_0x8a22('0x2d')]);return db[_0x8a22('0x2e')][_0x8a22('0x37')](_0x1e4c81)[_0x8a22('0x15')](handleEntityNotFound(_0x20b376,null))[_0x8a22('0x15')](function(_0x5087c6){if(_0x5087c6['service']===_0x8a22('0x32')){var _0x1860e4=encryptor[_0x8a22('0x38')](_0x5087c6[_0x8a22('0x33')]);_0x5087c6['data3']=maskClientSecret(_0x1860e4);}return _0x5087c6;})[_0x8a22('0x15')](respondWithResult(_0x20b376,null))[_0x8a22('0x34')](handleError(_0x20b376,null));};exports[_0x8a22('0x39')]=function(_0x4f4784,_0x2f3dd7){if(!_0x4f4784['body']['name'])throw new Error(_0x8a22('0x3a'));if(!_0x4f4784[_0x8a22('0x3b')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0xadbe1f=db[_0x8a22('0x2e')]['rawAttributes'][_0x8a22('0x31')][_0x8a22('0x3c')];if(!_0xadbe1f[_0x8a22('0x3d')](_0x4f4784['body']['service']))throw new Error(_0x8a22('0x3e')+_0xadbe1f[_0x8a22('0x3f')](',\x20'));if(_0x4f4784['body']['service']===_0x8a22('0x32')&&_0x4f4784[_0x8a22('0x3b')][_0x8a22('0x33')]){_0x4f4784[_0x8a22('0x3b')][_0x8a22('0x33')]=encryptor[_0x8a22('0x40')](_0x4f4784[_0x8a22('0x3b')][_0x8a22('0x33')]);}return db[_0x8a22('0x2e')][_0x8a22('0x39')](_0x4f4784['body'],{})[_0x8a22('0x15')](respondWithResult(_0x2f3dd7,0xc9))[_0x8a22('0x34')](handleError(_0x2f3dd7,null));};exports[_0x8a22('0x14')]=function(_0x28db6a,_0xf89e5a){if(_0x28db6a[_0x8a22('0x3b')]['id']){delete _0x28db6a[_0x8a22('0x3b')]['id'];}return db[_0x8a22('0x2e')][_0x8a22('0x37')]({'where':{'id':_0x28db6a['params']['id']}})[_0x8a22('0x15')](handleEntityNotFound(_0xf89e5a,null))[_0x8a22('0x15')](function(_0x1ab8d1){if(_0x1ab8d1['service']===_0x8a22('0x32')&&_0x28db6a[_0x8a22('0x3b')][_0x8a22('0x33')]){_0x28db6a[_0x8a22('0x3b')][_0x8a22('0x33')]=encryptor[_0x8a22('0x40')](_0x28db6a[_0x8a22('0x3b')]['data3']);}return _0x1ab8d1;})[_0x8a22('0x15')](saveUpdates(_0x28db6a[_0x8a22('0x3b')],null))[_0x8a22('0x15')](respondWithResult(_0xf89e5a,null))[_0x8a22('0x34')](handleError(_0xf89e5a,null));};exports[_0x8a22('0x41')]=function(_0x4eb39e,_0x2c77c7){return db[_0x8a22('0x2e')][_0x8a22('0x37')]({'where':{'id':_0x4eb39e[_0x8a22('0x36')]['id']}})[_0x8a22('0x15')](handleEntityNotFound(_0x2c77c7,null))[_0x8a22('0x15')](removeEntity(_0x2c77c7,null))['catch'](handleError(_0x2c77c7,null));};exports[_0x8a22('0x42')]=function(_0x5e5abf,_0x2b0d85){return db[_0x8a22('0x2e')][_0x8a22('0x43')]({'where':{'id':_0x5e5abf['params']['id']},'raw':!![]})['then'](function(_0x41d0a9){if(!_0x41d0a9)return _0x2b0d85['sendStatus'](0x194);return{'url':oauth[_0x8a22('0x44')](_0x41d0a9,_0x5e5abf[_0x8a22('0x45')]['id'])};})['then'](respondWithResult(_0x2b0d85,null))[_0x8a22('0x34')](handleError(_0x2b0d85,null));};exports[_0x8a22('0x46')]=function(_0xa8b65,_0x3794f6){var _0x28bc1b=_0xa8b65[_0x8a22('0x3b')];var _0x56cde0;var _0x5ef9f0;if(_0x28bc1b['error'])throw _0x28bc1b;redis['get'](_0x28bc1b[_0x8a22('0x47')])[_0x8a22('0x15')](function(_0x2cf3ce){if(!_0x2cf3ce)throw new Error(_0x8a22('0x48'));_0x56cde0=JSON[_0x8a22('0x49')](_0x2cf3ce);var _0x37988e=Buffer[_0x8a22('0x4a')](_0x28bc1b[_0x8a22('0x47')],_0x8a22('0x4b'))['toString'](_0x8a22('0x4c'));_0x5ef9f0=JSON[_0x8a22('0x49')](_0x37988e);if(!oauth[_0x8a22('0x4d')](_0x28bc1b[_0x8a22('0x4e')],_0x56cde0['oauth2Claims']))throw new Error(_0x8a22('0x4f'));redis['del'](_0x28bc1b[_0x8a22('0x47')]);return oauth['getOauth2MicrosoftAccessToken'](_0x28bc1b['code'],_0x56cde0);})[_0x8a22('0x15')](function(_0x4c3b99){_0x56cde0[_0x8a22('0x50')]=_0x4c3b99[_0x8a22('0x51')];_0x56cde0[_0x8a22('0x52')]=_0x4c3b99[_0x8a22('0x53')];return db[_0x8a22('0x2e')][_0x8a22('0x14')]({'data5':_0x56cde0['data5'],'data6':_0x56cde0['data6']},{'where':{'id':_0x56cde0['id']}});})[_0x8a22('0x15')](function(){oauth[_0x8a22('0x54')](_0x56cde0);socket[_0x8a22('0x55')](_0x8a22('0x56'),{'id':_0x5ef9f0['id']});return;})[_0x8a22('0x15')](respondWithStatusCode(_0x3794f6,null))[_0x8a22('0x34')](function(_0x4a4c28){if(_0x5ef9f0){socket[_0x8a22('0x55')](_0x8a22('0x57'),{'id':_0x5ef9f0['id']});}if(!_0x56cde0){logger['error'](_0x8a22('0x58'),_0x4a4c28);return _0x3794f6[_0x8a22('0xc')](0x1f4)['send'](_0x4a4c28[_0x8a22('0x59')]);}logger[_0x8a22('0x5a')](_0x8a22('0x5b'),_0x56cde0['id'],JSON[_0x8a22('0x5c')](_0x4a4c28));});};
\ No newline at end of file
index 05579cc..ca4ca32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb40=['../../config/environment','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x17daa3,_0x5ea740){var _0x1eb9b2=function(_0x268902){while(--_0x268902){_0x17daa3['push'](_0x17daa3['shift']());}};_0x1eb9b2(++_0x5ea740);}(_0xcb40,0x18b));var _0x0cb4=function(_0xba81f5,_0x340a4b){_0xba81f5=_0xba81f5-0x0;var _0x399dbb=_0xcb40[_0xba81f5];return _0x399dbb;};'use strict';var _=require(_0x0cb4('0x0'));var util=require(_0x0cb4('0x1'));var logger=require(_0x0cb4('0x2'))(_0x0cb4('0x3'));var moment=require('moment');var BPromise=require(_0x0cb4('0x4'));var rp=require(_0x0cb4('0x5'));var fs=require('fs');var path=require(_0x0cb4('0x6'));var rimraf=require(_0x0cb4('0x7'));var config=require(_0x0cb4('0x8'));var attributes=require(_0x0cb4('0x9'));module[_0x0cb4('0xa')]=function(_0x1e0941,_0x1ce71c){return _0x1e0941['define'](_0x0cb4('0xb'),attributes,{'tableName':_0x0cb4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0670=['moment','bluebird','../../config/environment','./cloudProvider.attributes','lodash','util','../../config/logger','api'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x0670,0xf4));var _0x0067=function(_0x451735,_0x391a76){_0x451735=_0x451735-0x0;var _0x41d1e2=_0x0670[_0x451735];return _0x41d1e2;};'use strict';var _=require(_0x0067('0x0'));var util=require(_0x0067('0x1'));var logger=require(_0x0067('0x2'))(_0x0067('0x3'));var moment=require(_0x0067('0x4'));var BPromise=require(_0x0067('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0067('0x6'));var attributes=require(_0x0067('0x7'));module['exports']=function(_0x5f5561,_0x4252c8){return _0x5f5561['define']('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 43c861c..b5574f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1e6=['lodash','jsonwebtoken','moment','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','offline_access','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','push','data7','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','Dynamics365','/.default','data2','code','id_token','from','stringify','toString','randomBytes','client_id','data1','redirect_uri','data4','scope','prompt','oauth2Claims','replace','oauth2/','set','decode','payload','aud','audience','nonce','isAfter','unix','resolve','then','CloudProvider','findOne','refresh_token','data6','decryptString','data3','{TENANT_ID}','data5','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','POST','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s'];(function(_0x32b071,_0x3f20ec){var _0x5c1e99=function(_0x19015b){while(--_0x19015b){_0x32b071['push'](_0x32b071['shift']());}};_0x5c1e99(++_0x3f20ec);}(_0xb1e6,0x172));var _0x6b1e=function(_0x4f08dd,_0x3784ec){_0x4f08dd=_0x4f08dd-0x0;var _0x3017ee=_0xb1e6[_0x4f08dd];return _0x3017ee;};'use strict';var _=require(_0x6b1e('0x0'));var crypto=require('crypto');var jwt=require(_0x6b1e('0x1'));var moment=require(_0x6b1e('0x2'));var Redis=require('ioredis');var rp=require('request-promise');var util=require(_0x6b1e('0x3'));var encryptor=require(_0x6b1e('0x4'));var config=require(_0x6b1e('0x5'));var logger=require(_0x6b1e('0x6'))(_0x6b1e('0x7'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x6b1e('0x8'))['db'];config[_0x6b1e('0x9')]=_[_0x6b1e('0xa')](config[_0x6b1e('0x9')],{'host':_0x6b1e('0xb'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x6b1e('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x6b1e('0xd'),_0x6b1e('0xe'),'email',_0x6b1e('0xf'),'https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All',_0x6b1e('0x10')],'Dynamics365':[_0x6b1e('0xd'),_0x6b1e('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x6b1e('0x11');var MICROSOFT_TOKEN_ENDPOINT=_0x6b1e('0x12');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5d608e){var _0x9194e8=_[_0x6b1e('0x13')](AZURE_AUTH_SCOPES[_0x5d608e[_0x6b1e('0x14')]]);if(_0x5d608e[_0x6b1e('0x14')]==='Dynamics365')_0x9194e8[_0x6b1e('0x15')](_0x5d608e[_0x6b1e('0x16')]+'/.default');return _0x9194e8[_0x6b1e('0x17')]('\x20');}function getAccessTokenScope(_0x20a8cc){if(_0x20a8cc[_0x6b1e('0x14')]===_0x6b1e('0x18'))return _0x6b1e('0x19');if(_0x20a8cc['type']===_0x6b1e('0x1a'))return _0x20a8cc[_0x6b1e('0x16')]+_0x6b1e('0x1b');}function generateMicrosoftAuthorizationUrl(_0x270052,_0x29cfa2){var _0x1297a3=MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x270052[_0x6b1e('0x1c')]);var _0x3fae79=[_0x6b1e('0x1d'),_0x6b1e('0x1e')];var _0x29fca7=Buffer[_0x6b1e('0x1f')](JSON[_0x6b1e('0x20')]({'id':_0x29cfa2}))[_0x6b1e('0x21')]('base64');var _0x4250ba=crypto[_0x6b1e('0x22')](0x10)['toString']('hex');var _0xbfd516=getAuthorizationScopes(_0x270052);var _0x1057d9=[{'key':_0x6b1e('0x23'),'value':_0x270052[_0x6b1e('0x24')]},{'key':'response_type','value':encodeURIComponent(_0x3fae79[_0x6b1e('0x17')]('\x20'))},{'key':_0x6b1e('0x25'),'value':_0x270052[_0x6b1e('0x26')]},{'key':'response_mode','value':'form_post'},{'key':_0x6b1e('0x27'),'value':encodeURIComponent(_0xbfd516)},{'key':'state','value':_0x29fca7},{'key':'nonce','value':_0x4250ba},{'key':_0x6b1e('0x28'),'value':'login'}];var _0x1ba9c4=_0x1297a3+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x6b1e('0x13')](_0x1057d9,function(_0x2e44e6){return _0x2e44e6['key']+'='+_0x2e44e6['value'];})[_0x6b1e('0x17')]('&');_0x270052[_0x6b1e('0x29')]={'issuer':_0x1297a3[_0x6b1e('0x2a')](_0x6b1e('0x2b'),''),'audience':_0x270052[_0x6b1e('0x24')],'state':_0x29fca7,'nonce':_0x4250ba};redis[_0x6b1e('0x2c')](_0x29fca7,JSON[_0x6b1e('0x20')](_0x270052));return _0x1ba9c4;}function isValidIdToken(_0x99a378,_0x50a4a6){try{var _0x67154d=jwt[_0x6b1e('0x2d')](_0x99a378,{'complete':!![]});var _0x5da510=_0x67154d[_0x6b1e('0x2e')];if(_0x5da510['iss']!==_0x50a4a6['issuer'])return![];if(_0x5da510[_0x6b1e('0x2f')]!==_0x50a4a6[_0x6b1e('0x30')])return![];if(_0x5da510[_0x6b1e('0x31')]!==_0x50a4a6[_0x6b1e('0x31')])return![];if(moment()[_0x6b1e('0x32')](moment[_0x6b1e('0x33')](_0x5da510['exp'])))return![];return!![];}catch(_0x4f92df){throw _0x4f92df;}}function refreshOauth2MicrosoftAccessToken(_0x30ab51){return Promise[_0x6b1e('0x34')]()[_0x6b1e('0x35')](function(){if(_0x30ab51['data3'])return _0x30ab51;return db[_0x6b1e('0x36')][_0x6b1e('0x37')]({'where':{'id':_0x30ab51['id']},'raw':!![]});})[_0x6b1e('0x35')](function(_0x472df9){var _0xa81492={'grant_type':_0x6b1e('0x38'),'refresh_token':_0x472df9[_0x6b1e('0x39')],'scope':getAccessTokenScope(_0x472df9),'redirect_uri':_0x472df9['data4'],'client_id':_0x472df9['data1'],'client_secret':encryptor[_0x6b1e('0x3a')](_0x472df9[_0x6b1e('0x3b')])};var _0x120153={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x6b1e('0x2a')](_0x6b1e('0x3c'),_0x472df9['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0xa81492,'json':!![]};return rp(_0x120153);})[_0x6b1e('0x35')](function(_0x22438e){_0x30ab51[_0x6b1e('0x3d')]=_0x22438e['access_token'];_0x30ab51['data6']=_0x22438e[_0x6b1e('0x38')];return db['CloudProvider'][_0x6b1e('0x3e')]({'data5':_0x30ab51[_0x6b1e('0x3d')],'data6':_0x30ab51[_0x6b1e('0x39')]},{'where':{'id':_0x30ab51['id']}});})[_0x6b1e('0x35')](function(){return _0x30ab51;})[_0x6b1e('0x3f')](function(_0x257176){logger[_0x6b1e('0x40')](_0x6b1e('0x41'),_0x30ab51['id'],_0x257176);});}function getOauth2MicrosoftAccessToken(_0x791989,_0x2a4868){var _0x3736aa={'grant_type':_0x6b1e('0x42'),'code':_0x791989,'scope':getAccessTokenScope(_0x2a4868),'redirect_uri':_0x2a4868[_0x6b1e('0x26')],'client_id':_0x2a4868['data1'],'client_secret':encryptor['decryptString'](_0x2a4868[_0x6b1e('0x3b')])};var _0x372166={'method':_0x6b1e('0x43'),'uri':MICROSOFT_AUTH_URL[_0x6b1e('0x2a')](_0x6b1e('0x3c'),_0x2a4868['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3736aa,'json':!![]};return rp(_0x372166);}function startRefreshInterval(_0x54572d){var _0x3df530=schedule[_0x6b1e('0x44')];if(_0x3df530[_0x54572d['id']])clearInterval(_0x3df530[_0x54572d['id']]);_0x3df530[_0x54572d['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x6b1e('0x45')](this,{'id':_0x54572d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x3df530;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x6b1e('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x6b1e('0x35')](function(_0x21f746){var _0x3ad97a=_0x21f746[_0x6b1e('0x13')](function(_0x1ee170){return refreshOauth2MicrosoftAccessToken(_0x1ee170)[_0x6b1e('0x35')](function(_0x1e9cda){startRefreshInterval(_0x1e9cda);});});return Promise[_0x6b1e('0x47')](_0x3ad97a);})[_0x6b1e('0x3f')](function(_0x556c82){var _0xfa078c=_0x556c82?util[_0x6b1e('0x48')](_0x556c82,{'showHidden':![],'depth':null}):'';logger['error'](_0x6b1e('0x49'),_0xfa078c);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x77e9=['data3','data6','decryptString','POST','data5','access_token','refresh_token','CloudProvider','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data1','intervals','bind','findAll','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','../../components/encryptor','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','push','data7','join','Outlook365','Dynamics365','/.default','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','client_id','response_type','redirect_uri','data4','response_mode','form_post','scope','state','prompt','value','oauth2Claims','iss','issuer','aud','audience','nonce','isAfter','unix','exp','then'];(function(_0x3f0d61,_0x5ad324){var _0xfde3f6=function(_0x525073){while(--_0x525073){_0x3f0d61['push'](_0x3f0d61['shift']());}};_0xfde3f6(++_0x5ad324);}(_0x77e9,0x1e1));var _0x977e=function(_0x614b66,_0x580c83){_0x614b66=_0x614b66-0x0;var _0x2c7a20=_0x77e9[_0x614b66];return _0x2c7a20;};'use strict';var _=require(_0x977e('0x0'));var crypto=require(_0x977e('0x1'));var jwt=require(_0x977e('0x2'));var moment=require(_0x977e('0x3'));var Redis=require('ioredis');var rp=require('request-promise');var util=require('util');var encryptor=require(_0x977e('0x4'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x977e('0x5'));var schedule=require(_0x977e('0x6'));var db=require(_0x977e('0x7'))['db'];config[_0x977e('0x8')]=_[_0x977e('0x9')](config['redis'],{'host':_0x977e('0xa'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x977e('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0x977e('0xc'),_0x977e('0xd'),_0x977e('0xe'),_0x977e('0xf'),_0x977e('0x10'),_0x977e('0x11'),_0x977e('0x12')],'Dynamics365':['openid',_0x977e('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x977e('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0x977e('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x28ae5c){var _0x1cd9dd=_[_0x977e('0x15')](AZURE_AUTH_SCOPES[_0x28ae5c[_0x977e('0x16')]]);if(_0x28ae5c['type']==='Dynamics365')_0x1cd9dd[_0x977e('0x17')](_0x28ae5c[_0x977e('0x18')]+'/.default');return _0x1cd9dd[_0x977e('0x19')]('\x20');}function getAccessTokenScope(_0x3f8e72){if(_0x3f8e72[_0x977e('0x16')]===_0x977e('0x1a'))return _0x977e('0x10');if(_0x3f8e72['type']===_0x977e('0x1b'))return _0x3f8e72[_0x977e('0x18')]+_0x977e('0x1c');}function generateMicrosoftAuthorizationUrl(_0x28c469,_0x5c0349){var _0x3cf7ff=MICROSOFT_AUTH_URL[_0x977e('0x1d')](_0x977e('0x1e'),_0x28c469[_0x977e('0x1f')]);var _0x2f5d45=[_0x977e('0x20'),_0x977e('0x21')];var _0x142f50=Buffer[_0x977e('0x22')](JSON[_0x977e('0x23')]({'id':_0x5c0349}))[_0x977e('0x24')](_0x977e('0x25'));var _0xdc37c8=crypto['randomBytes'](0x10)[_0x977e('0x24')]('hex');var _0x1c22e4=getAuthorizationScopes(_0x28c469);var _0x2df98b=[{'key':_0x977e('0x26'),'value':_0x28c469['data1']},{'key':_0x977e('0x27'),'value':encodeURIComponent(_0x2f5d45[_0x977e('0x19')]('\x20'))},{'key':_0x977e('0x28'),'value':_0x28c469[_0x977e('0x29')]},{'key':_0x977e('0x2a'),'value':_0x977e('0x2b')},{'key':_0x977e('0x2c'),'value':encodeURIComponent(_0x1c22e4)},{'key':_0x977e('0x2d'),'value':_0x142f50},{'key':'nonce','value':_0xdc37c8},{'key':_0x977e('0x2e'),'value':'login'}];var _0x39e10e=_0x3cf7ff+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x977e('0x15')](_0x2df98b,function(_0x2c3f74){return _0x2c3f74['key']+'='+_0x2c3f74[_0x977e('0x2f')];})[_0x977e('0x19')]('&');_0x28c469[_0x977e('0x30')]={'issuer':_0x3cf7ff[_0x977e('0x1d')]('oauth2/',''),'audience':_0x28c469['data1'],'state':_0x142f50,'nonce':_0xdc37c8};redis['set'](_0x142f50,JSON[_0x977e('0x23')](_0x28c469));return _0x39e10e;}function isValidIdToken(_0x3cd383,_0x365d32){try{var _0x520332=jwt['decode'](_0x3cd383,{'complete':!![]});var _0x452e2a=_0x520332['payload'];if(_0x452e2a[_0x977e('0x31')]!==_0x365d32[_0x977e('0x32')])return![];if(_0x452e2a[_0x977e('0x33')]!==_0x365d32[_0x977e('0x34')])return![];if(_0x452e2a['nonce']!==_0x365d32[_0x977e('0x35')])return![];if(moment()[_0x977e('0x36')](moment[_0x977e('0x37')](_0x452e2a[_0x977e('0x38')])))return![];return!![];}catch(_0x2e5cb0){throw _0x2e5cb0;}}function refreshOauth2MicrosoftAccessToken(_0x130daa){return Promise['resolve']()[_0x977e('0x39')](function(){if(_0x130daa[_0x977e('0x3a')])return _0x130daa;return db['CloudProvider']['findOne']({'where':{'id':_0x130daa['id']},'raw':!![]});})[_0x977e('0x39')](function(_0x173386){var _0x5b65a2={'grant_type':'refresh_token','refresh_token':_0x173386[_0x977e('0x3b')],'scope':getAccessTokenScope(_0x173386),'redirect_uri':_0x173386[_0x977e('0x29')],'client_id':_0x173386['data1'],'client_secret':encryptor[_0x977e('0x3c')](_0x173386[_0x977e('0x3a')])};var _0x5554be={'method':_0x977e('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x977e('0x1d')](_0x977e('0x1e'),_0x173386['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5b65a2,'json':!![]};return rp(_0x5554be);})['then'](function(_0x20ca9b){_0x130daa[_0x977e('0x3e')]=_0x20ca9b[_0x977e('0x3f')];_0x130daa[_0x977e('0x3b')]=_0x20ca9b[_0x977e('0x40')];return db[_0x977e('0x41')]['update']({'data5':_0x130daa[_0x977e('0x3e')],'data6':_0x130daa[_0x977e('0x3b')]},{'where':{'id':_0x130daa['id']}});})['then'](function(){return _0x130daa;})[_0x977e('0x42')](function(_0x17170a){logger[_0x977e('0x43')](_0x977e('0x44'),_0x130daa['id'],_0x17170a);});}function getOauth2MicrosoftAccessToken(_0x3194dc,_0x47f85d){var _0x47ee70={'grant_type':_0x977e('0x45'),'code':_0x3194dc,'scope':getAccessTokenScope(_0x47f85d),'redirect_uri':_0x47f85d['data4'],'client_id':_0x47f85d[_0x977e('0x46')],'client_secret':encryptor['decryptString'](_0x47f85d[_0x977e('0x3a')])};var _0x25295f={'method':_0x977e('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x977e('0x1d')]('{TENANT_ID}',_0x47f85d[_0x977e('0x1f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x47ee70,'json':!![]};return rp(_0x25295f);}function startRefreshInterval(_0x4515fa){var _0x26df43=schedule[_0x977e('0x47')];if(_0x26df43[_0x4515fa['id']])clearInterval(_0x26df43[_0x4515fa['id']]);_0x26df43[_0x4515fa['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x977e('0x48')](this,{'id':_0x4515fa['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x26df43;}function startAllRefreshIntervals(){return db[_0x977e('0x41')][_0x977e('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x977e('0x39')](function(_0x3577ad){var _0x35fbeb=_0x3577ad[_0x977e('0x15')](function(_0x31f5f8){return refreshOauth2MicrosoftAccessToken(_0x31f5f8)[_0x977e('0x39')](function(_0x100726){startRefreshInterval(_0x100726);});});return Promise['all'](_0x35fbeb);})['catch'](function(_0x5dd2d2){var _0x584f75=_0x5dd2d2?util[_0x977e('0x4a')](_0x5dd2d2,{'showHidden':![],'depth':null}):'';logger[_0x977e('0x43')](_0x977e('0x4b'),_0x584f75);});}module[_0x977e('0x4c')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
index 1c83e47..5716369 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeba2=['result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0xeba2,0x70));var _0x2eba=function(_0x22aa61,_0x45e107){_0x22aa61=_0x22aa61-0x0;var _0x51500a=_0xeba2[_0x22aa61];return _0x51500a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2eba('0x0'));var BPromise=require(_0x2eba('0x1'));var rs=require(_0x2eba('0x2'));var fs=require('fs');var Redis=require(_0x2eba('0x3'));var db=require(_0x2eba('0x4'))['db'];var utils=require(_0x2eba('0x5'));var logger=require(_0x2eba('0x6'))(_0x2eba('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2eba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b4d9a,_0x14c40a,_0x4e7a50){return new BPromise(function(_0x279806,_0x1fed79){return client[_0x2eba('0x9')](_0x1b4d9a,_0x4e7a50)[_0x2eba('0xa')](function(_0x1cc4e){logger[_0x2eba('0xb')](_0x2eba('0xc'),_0x14c40a,_0x2eba('0xd'));logger[_0x2eba('0xe')](_0x2eba('0xf'),_0x14c40a,'request\x20sent',JSON[_0x2eba('0x10')](_0x1cc4e));if(_0x1cc4e[_0x2eba('0x11')]){if(_0x1cc4e['error'][_0x2eba('0x12')]===0x1f4){logger[_0x2eba('0x11')](_0x2eba('0xc'),_0x14c40a,_0x1cc4e[_0x2eba('0x11')][_0x2eba('0x13')]);return _0x1fed79(_0x1cc4e[_0x2eba('0x11')][_0x2eba('0x13')]);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x14c40a,_0x1cc4e[_0x2eba('0x11')][_0x2eba('0x13')]);return _0x279806(_0x1cc4e[_0x2eba('0x11')][_0x2eba('0x13')]);}else{logger[_0x2eba('0xb')]('CloudProvider,\x20%s,\x20%s',_0x14c40a,_0x2eba('0xd'));_0x279806(_0x1cc4e[_0x2eba('0x14')][_0x2eba('0x13')]);}})[_0x2eba('0x15')](function(_0x2de66e){logger['error'](_0x2eba('0xc'),_0x14c40a,_0x2de66e);_0x1fed79(_0x2de66e);});});}
\ No newline at end of file
+var _0xa9e1=['ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','code','CloudProvider,\x20%s,\x20%s','message','error','request\x20sent','result','lodash','util','bluebird','randomstring'];(function(_0xfbe06e,_0x2fb7ab){var _0x24e5b6=function(_0x48569f){while(--_0x48569f){_0xfbe06e['push'](_0xfbe06e['shift']());}};_0x24e5b6(++_0x2fb7ab);}(_0xa9e1,0x7a));var _0x1a9e=function(_0x56daff,_0xadca9a){_0x56daff=_0x56daff-0x0;var _0x132c82=_0xa9e1[_0x56daff];return _0x132c82;};'use strict';var _=require(_0x1a9e('0x0'));var util=require(_0x1a9e('0x1'));var moment=require('moment');var BPromise=require(_0x1a9e('0x2'));var rs=require(_0x1a9e('0x3'));var fs=require('fs');var Redis=require(_0x1a9e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1a9e('0x5'));var logger=require('../../config/logger')(_0x1a9e('0x6'));var config=require('../../config/environment');var jayson=require(_0x1a9e('0x7'));var client=jayson[_0x1a9e('0x8')][_0x1a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc9409c,_0x2b8600,_0x91b2c3){return new BPromise(function(_0x9bf04c,_0x32c466){return client[_0x1a9e('0xa')](_0xc9409c,_0x91b2c3)[_0x1a9e('0xb')](function(_0x4f9f78){logger[_0x1a9e('0xc')]('CloudProvider,\x20%s,\x20%s',_0x2b8600,'request\x20sent');logger['debug'](_0x1a9e('0xd'),_0x2b8600,'request\x20sent',JSON[_0x1a9e('0xe')](_0x4f9f78));if(_0x4f9f78['error']){if(_0x4f9f78['error'][_0x1a9e('0xf')]===0x1f4){logger['error'](_0x1a9e('0x10'),_0x2b8600,_0x4f9f78['error'][_0x1a9e('0x11')]);return _0x32c466(_0x4f9f78[_0x1a9e('0x12')][_0x1a9e('0x11')]);}logger[_0x1a9e('0x12')](_0x1a9e('0x10'),_0x2b8600,_0x4f9f78[_0x1a9e('0x12')][_0x1a9e('0x11')]);return _0x9bf04c(_0x4f9f78[_0x1a9e('0x12')]['message']);}else{logger[_0x1a9e('0xc')](_0x1a9e('0x10'),_0x2b8600,_0x1a9e('0x13'));_0x9bf04c(_0x4f9f78[_0x1a9e('0x14')][_0x1a9e('0x11')]);}})['catch'](function(_0x303979){logger[_0x1a9e('0x12')](_0x1a9e('0x10'),_0x2b8600,_0x303979);_0x32c466(_0x303979);});});}
\ No newline at end of file
index 9cb6259..e56b546 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0x5f2f,0x73));var _0xf5f2=function(_0x37ab7b,_0x509b5b){_0x37ab7b=_0x37ab7b-0x0;var _0x3b871f=_0x5f2f[_0x37ab7b];return _0x3b871f;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
+var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x37a858,_0x42a793){var _0x1807a7=function(_0x37fd2c){while(--_0x37fd2c){_0x37a858['push'](_0x37a858['shift']());}};_0x1807a7(++_0x42a793);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router;
\ No newline at end of file
index 59402e4..885ea36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7c6=['sequelize','exports','STRING'];(function(_0x58225c,_0x10d79f){var _0x268260=function(_0x31f50d){while(--_0x31f50d){_0x58225c['push'](_0x58225c['shift']());}};_0x268260(++_0x10d79f);}(_0xc7c6,0x14a));var _0x6c7c=function(_0x3f8529,_0xd67c1a){_0x3f8529=_0x3f8529-0x0;var _0x34091f=_0xc7c6[_0x3f8529];return _0x34091f;};'use strict';var Sequelize=require(_0x6c7c('0x0'));module[_0x6c7c('0x1')]={'name':{'type':Sequelize[_0x6c7c('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x6c7c('0x2')]},'companyId':{'type':Sequelize[_0x6c7c('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x6c7c('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x6c7c('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x6c7c('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x6c7c('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x6c7c('0x2')]},'sStreet':{'type':Sequelize[_0x6c7c('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x6c7c('0x2')]},'sCountry':{'type':Sequelize[_0x6c7c('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4b84=['STRING','sequelize','exports'];(function(_0x1b8b95,_0x3ea343){var _0x3657ae=function(_0x3703e1){while(--_0x3703e1){_0x1b8b95['push'](_0x1b8b95['shift']());}};_0x3657ae(++_0x3ea343);}(_0x4b84,0x1cc));var _0x44b8=function(_0x12e073,_0x4d43db){_0x12e073=_0x12e073-0x0;var _0x267748=_0x4b84[_0x12e073];return _0x267748;};'use strict';var Sequelize=require(_0x44b8('0x0'));module[_0x44b8('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x44b8('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x44b8('0x2')]},'fax':{'type':Sequelize[_0x44b8('0x2')]},'type':{'type':Sequelize[_0x44b8('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x44b8('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x44b8('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x44b8('0x2')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x44b8('0x2')]}};
\ No newline at end of file
index 4dd30b7..06f0a13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebf2=['end','json','offset','undefined','count','limit','reject','save','update','destroy','then','get','Companies','stack','name','send','index','CmCompany','model','keys','query','filters','attributes','fields','length','nolimit','sort','where','pick','filter','map','merge','options','include','findAll','catch','params','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','getContacts','findOne','rawAttributes','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x57cdfe,_0xb7d00e){var _0x1a8c81=function(_0x17e1e1){while(--_0x17e1e1){_0x57cdfe['push'](_0x57cdfe['shift']());}};_0x1a8c81(++_0xb7d00e);}(_0xebf2,0x91));var _0x2ebf=function(_0x4c54c0,_0x112d91){_0x4c54c0=_0x4c54c0-0x0;var _0x147adb=_0xebf2[_0x4c54c0];return _0x147adb;};'use strict';var emlformat=require(_0x2ebf('0x0'));var rimraf=require(_0x2ebf('0x1'));var zipdir=require(_0x2ebf('0x2'));var jsonpatch=require(_0x2ebf('0x3'));var rp=require(_0x2ebf('0x4'));var moment=require(_0x2ebf('0x5'));var BPromise=require(_0x2ebf('0x6'));var Mustache=require('mustache');var util=require(_0x2ebf('0x7'));var path=require('path');var sox=require(_0x2ebf('0x8'));var csv=require(_0x2ebf('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ebf('0xa'));var _=require(_0x2ebf('0xb'));var squel=require(_0x2ebf('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2ebf('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2ebf('0xe'));var Papa=require(_0x2ebf('0xf'));var Redis=require(_0x2ebf('0x10'));var authService=require(_0x2ebf('0x11'));var qs=require(_0x2ebf('0x12'));var as=require(_0x2ebf('0x13'));var hardwareService=require(_0x2ebf('0x14'));var logger=require(_0x2ebf('0x15'))(_0x2ebf('0x16'));var utils=require(_0x2ebf('0x17'));var config=require(_0x2ebf('0x18'));var licenseUtil=require(_0x2ebf('0x19'));var db=require(_0x2ebf('0x1a'))['db'];function respondWithStatusCode(_0x17150e,_0x13011a){_0x13011a=_0x13011a||0xcc;return function(_0x2b8108){if(_0x2b8108){return _0x17150e[_0x2ebf('0x1b')](_0x13011a);}return _0x17150e[_0x2ebf('0x1c')](_0x13011a)[_0x2ebf('0x1d')]();};}function respondWithResult(_0x1a299d,_0x34085d){_0x34085d=_0x34085d||0xc8;return function(_0x397d76){if(_0x397d76){return _0x1a299d[_0x2ebf('0x1c')](_0x34085d)[_0x2ebf('0x1e')](_0x397d76);}};}function respondWithFilteredResult(_0x251eb7,_0x235eca){return function(_0x4a26d0){if(_0x4a26d0){var _0xa9c300=typeof _0x235eca[_0x2ebf('0x1f')]===_0x2ebf('0x20')&&typeof _0x235eca['limit']===_0x2ebf('0x20');var _0x4f2585=_0x4a26d0[_0x2ebf('0x21')];var _0x291181=_0xa9c300?0x0:_0x235eca[_0x2ebf('0x1f')];var _0x322c63=_0xa9c300?_0x4a26d0[_0x2ebf('0x21')]:_0x235eca[_0x2ebf('0x1f')]+_0x235eca[_0x2ebf('0x22')];var _0x4802ad;if(_0x322c63>=_0x4f2585){_0x322c63=_0x4f2585;_0x4802ad=0xc8;}else{_0x4802ad=0xce;}_0x251eb7[_0x2ebf('0x1c')](_0x4802ad);return _0x251eb7['set']('Content-Range',_0x291181+'-'+_0x322c63+'/'+_0x4f2585)[_0x2ebf('0x1e')](_0x4a26d0);}return null;};}function patchUpdates(_0x44c3bc){return function(_0x20ab2b){try{jsonpatch['apply'](_0x20ab2b,_0x44c3bc,!![]);}catch(_0x2b54d6){return BPromise[_0x2ebf('0x23')](_0x2b54d6);}return _0x20ab2b[_0x2ebf('0x24')]();};}function saveUpdates(_0x3ed9d6,_0xc6399){return function(_0x412d40){if(_0x412d40){return _0x412d40[_0x2ebf('0x25')](_0x3ed9d6)['then'](function(_0x3148cf){return _0x3148cf;});}return null;};}function removeEntity(_0x34af32,_0x4af01d){return function(_0x4ab6bc){if(_0x4ab6bc){return _0x4ab6bc[_0x2ebf('0x26')]()[_0x2ebf('0x27')](function(){var _0x2c855f=_0x4ab6bc[_0x2ebf('0x28')]({'plain':!![]});var _0x280f93=_0x2ebf('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x280f93,'resourceId':_0x2c855f['id']}})[_0x2ebf('0x27')](function(){return _0x4ab6bc;});})[_0x2ebf('0x27')](function(){_0x34af32[_0x2ebf('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4529d9,_0x596229){return function(_0x2c4087){if(!_0x2c4087){_0x4529d9['sendStatus'](0x194);}return _0x2c4087;};}function handleError(_0x5c4184,_0x1383d2){_0x1383d2=_0x1383d2||0x1f4;return function(_0x55f678){logger['error'](_0x55f678[_0x2ebf('0x2a')]);if(_0x55f678[_0x2ebf('0x2b')]){delete _0x55f678[_0x2ebf('0x2b')];}_0x5c4184[_0x2ebf('0x1c')](_0x1383d2)[_0x2ebf('0x2c')](_0x55f678);};}exports[_0x2ebf('0x2d')]=function(_0x5b56f6,_0x435220){var _0x13a232={},_0x19dd72={},_0x3cd709={'count':0x0,'rows':[]};return db[_0x2ebf('0x2e')]['describe']()[_0x2ebf('0x27')](function(_0x8f381a){_0x19dd72[_0x2ebf('0x2f')]=_[_0x2ebf('0x30')](_0x8f381a);_0x19dd72[_0x2ebf('0x31')]=_[_0x2ebf('0x30')](_0x5b56f6[_0x2ebf('0x31')]);_0x19dd72[_0x2ebf('0x32')]=_['intersection'](_0x19dd72[_0x2ebf('0x2f')],_0x19dd72[_0x2ebf('0x31')]);_0x13a232[_0x2ebf('0x33')]=_['intersection'](_0x19dd72[_0x2ebf('0x2f')],qs[_0x2ebf('0x34')](_0x5b56f6[_0x2ebf('0x31')]['fields']));_0x13a232[_0x2ebf('0x33')]=_0x13a232[_0x2ebf('0x33')][_0x2ebf('0x35')]?_0x13a232[_0x2ebf('0x33')]:_0x19dd72[_0x2ebf('0x2f')];if(!_0x5b56f6[_0x2ebf('0x31')]['hasOwnProperty'](_0x2ebf('0x36'))){_0x13a232[_0x2ebf('0x22')]=qs[_0x2ebf('0x22')](_0x5b56f6[_0x2ebf('0x31')][_0x2ebf('0x22')]);_0x13a232[_0x2ebf('0x1f')]=qs[_0x2ebf('0x1f')](_0x5b56f6[_0x2ebf('0x31')]['offset']);}_0x13a232['order']=qs['sort'](_0x5b56f6[_0x2ebf('0x31')][_0x2ebf('0x37')]);_0x13a232[_0x2ebf('0x38')]=qs[_0x2ebf('0x32')](_[_0x2ebf('0x39')](_0x5b56f6[_0x2ebf('0x31')],_0x19dd72[_0x2ebf('0x32')]),_0x8f381a);if(_0x5b56f6[_0x2ebf('0x31')][_0x2ebf('0x3a')]){_0x13a232[_0x2ebf('0x38')]=_['merge'](_0x13a232[_0x2ebf('0x38')],{'$or':_[_0x2ebf('0x3b')](_0x13a232[_0x2ebf('0x33')],function(_0x31c6d0){var _0x451475={};_0x451475[_0x31c6d0]={'$like':'%'+_0x5b56f6[_0x2ebf('0x31')]['filter']+'%'};return _0x451475;})});}_0x13a232=_[_0x2ebf('0x3c')]({},_0x13a232,_0x5b56f6[_0x2ebf('0x3d')]);var _0x189d37={'where':_0x13a232[_0x2ebf('0x38')]};return db[_0x2ebf('0x2e')][_0x2ebf('0x21')](_0x189d37)['then'](function(_0x58d93d){_0x3cd709[_0x2ebf('0x21')]=_0x58d93d;if(_0x5b56f6[_0x2ebf('0x31')]['includeAll']){_0x13a232[_0x2ebf('0x3e')]=[{'all':!![]}];}return db[_0x2ebf('0x2e')][_0x2ebf('0x3f')](_0x13a232);})[_0x2ebf('0x27')](function(_0xad3ff4){_0x3cd709['rows']=_0xad3ff4;return _0x3cd709;})[_0x2ebf('0x27')](respondWithFilteredResult(_0x435220,_0x13a232))[_0x2ebf('0x40')](handleError(_0x435220,null));})[_0x2ebf('0x40')](handleError(_0x435220,null));};exports['show']=function(_0xda9404,_0x4a6531){var _0x2785d2={'raw':![],'where':{'id':_0xda9404[_0x2ebf('0x41')]['id']}},_0x2b5124={};_0x2b5124[_0x2ebf('0x2f')]=_['keys'](db[_0x2ebf('0x2e')]['rawAttributes']);_0x2b5124[_0x2ebf('0x31')]=_[_0x2ebf('0x30')](_0xda9404[_0x2ebf('0x31')]);_0x2b5124[_0x2ebf('0x32')]=_[_0x2ebf('0x42')](_0x2b5124[_0x2ebf('0x2f')],_0x2b5124['query']);_0x2785d2[_0x2ebf('0x33')]=_[_0x2ebf('0x42')](_0x2b5124[_0x2ebf('0x2f')],qs[_0x2ebf('0x34')](_0xda9404[_0x2ebf('0x31')][_0x2ebf('0x34')]));_0x2785d2[_0x2ebf('0x33')]=_0x2785d2[_0x2ebf('0x33')][_0x2ebf('0x35')]?_0x2785d2[_0x2ebf('0x33')]:_0x2b5124[_0x2ebf('0x2f')];if(_0xda9404['query'][_0x2ebf('0x43')]){_0x2785d2[_0x2ebf('0x3e')]=[{'all':!![]}];}_0x2785d2=_[_0x2ebf('0x3c')]({},_0x2785d2,_0xda9404[_0x2ebf('0x3d')]);return db[_0x2ebf('0x2e')][_0x2ebf('0x44')](_0x2785d2)[_0x2ebf('0x27')](handleEntityNotFound(_0x4a6531,null))['then'](respondWithResult(_0x4a6531,null))['catch'](handleError(_0x4a6531,null));};exports['create']=function(_0x142f54,_0x479c4b){return db['CmCompany'][_0x2ebf('0x45')](_0x142f54[_0x2ebf('0x46')],{})[_0x2ebf('0x27')](function(_0x7163d1){var _0x38adda=_0x142f54[_0x2ebf('0x47')][_0x2ebf('0x28')]({'plain':!![]});if(!_0x38adda)throw new Error(_0x2ebf('0x48'));if(_0x38adda[_0x2ebf('0x49')]===_0x2ebf('0x47')){var _0x13b67d=_0x7163d1[_0x2ebf('0x28')]({'plain':!![]});var _0x445063=_0x2ebf('0x29');return db[_0x2ebf('0x4a')]['find']({'where':{'name':_0x445063,'userProfileId':_0x38adda[_0x2ebf('0x4b')]},'raw':!![]})['then'](function(_0x344dbc){if(_0x344dbc&&_0x344dbc[_0x2ebf('0x4c')]===0x0){return db['UserProfileResource'][_0x2ebf('0x45')]({'name':_0x13b67d[_0x2ebf('0x2b')],'resourceId':_0x13b67d['id'],'type':_0x344dbc[_0x2ebf('0x2b')],'sectionId':_0x344dbc['id']},{})[_0x2ebf('0x27')](function(){return _0x7163d1;});}else{return _0x7163d1;}})[_0x2ebf('0x40')](function(_0x44eea6){logger[_0x2ebf('0x4d')](_0x2ebf('0x4e'),_0x44eea6);throw _0x44eea6;});}return _0x7163d1;})[_0x2ebf('0x27')](respondWithResult(_0x479c4b,0xc9))[_0x2ebf('0x40')](handleError(_0x479c4b,null));};exports[_0x2ebf('0x25')]=function(_0x4fbf79,_0x2d3109){if(_0x4fbf79['body']['id']){delete _0x4fbf79['body']['id'];}return db['CmCompany'][_0x2ebf('0x44')]({'where':{'id':_0x4fbf79['params']['id']}})['then'](handleEntityNotFound(_0x2d3109,null))['then'](saveUpdates(_0x4fbf79[_0x2ebf('0x46')],null))[_0x2ebf('0x27')](respondWithResult(_0x2d3109,null))[_0x2ebf('0x40')](handleError(_0x2d3109,null));};exports[_0x2ebf('0x26')]=function(_0x3936ed,_0x5865f8){return db['CmCompany'][_0x2ebf('0x44')]({'where':{'id':_0x3936ed[_0x2ebf('0x41')]['id']}})[_0x2ebf('0x27')](handleEntityNotFound(_0x5865f8,null))['then'](removeEntity(_0x5865f8,null))['catch'](handleError(_0x5865f8,null));};exports[_0x2ebf('0x4f')]=function(_0x56d5f3,_0x2b8d28){return db[_0x2ebf('0x2e')][_0x2ebf('0x4f')]()['then'](respondWithResult(_0x2b8d28,null))[_0x2ebf('0x40')](handleError(_0x2b8d28,null));};exports[_0x2ebf('0x50')]=function(_0x1f5c9c,_0x5821e2,_0x5b7189){return db[_0x2ebf('0x51')][_0x2ebf('0x44')]({'where':{'id':_0x1f5c9c['params']['id']}})[_0x2ebf('0x27')](handleEntityNotFound(_0x5821e2,null))[_0x2ebf('0x27')](function(_0x5ea750){if(_0x5ea750){return _0x5ea750[_0x2ebf('0x50')](_0x1f5c9c['body'][_0x2ebf('0x52')],_['omit'](_0x1f5c9c[_0x2ebf('0x46')],[_0x2ebf('0x52'),'id'])||{});}})[_0x2ebf('0x27')](respondWithResult(_0x5821e2,null))['catch'](handleError(_0x5821e2,null));};exports[_0x2ebf('0x53')]=function(_0x319985,_0x787f32,_0x1bd646){var _0x10d9aa={};var _0x422e8f={};var _0x1eadea;var _0x57753a;return db[_0x2ebf('0x2e')][_0x2ebf('0x54')]({'where':{'id':_0x319985[_0x2ebf('0x41')]['id']}})[_0x2ebf('0x27')](handleEntityNotFound(_0x787f32,null))[_0x2ebf('0x27')](function(_0x147c26){if(_0x147c26){_0x1eadea=_0x147c26;_0x422e8f[_0x2ebf('0x2f')]=_[_0x2ebf('0x30')](db[_0x2ebf('0x51')][_0x2ebf('0x55')]);_0x422e8f[_0x2ebf('0x31')]=_[_0x2ebf('0x30')](_0x319985[_0x2ebf('0x31')]);_0x422e8f[_0x2ebf('0x32')]=_[_0x2ebf('0x42')](_0x422e8f[_0x2ebf('0x2f')],_0x422e8f[_0x2ebf('0x31')]);_0x10d9aa[_0x2ebf('0x33')]=_[_0x2ebf('0x42')](_0x422e8f['model'],qs[_0x2ebf('0x34')](_0x319985[_0x2ebf('0x31')][_0x2ebf('0x34')]));_0x10d9aa[_0x2ebf('0x33')]=_0x10d9aa[_0x2ebf('0x33')][_0x2ebf('0x35')]?_0x10d9aa[_0x2ebf('0x33')]:_0x422e8f[_0x2ebf('0x2f')];_0x10d9aa[_0x2ebf('0x56')]=qs[_0x2ebf('0x37')](_0x319985[_0x2ebf('0x31')][_0x2ebf('0x37')]);_0x10d9aa[_0x2ebf('0x38')]=qs[_0x2ebf('0x32')](_[_0x2ebf('0x39')](_0x319985[_0x2ebf('0x31')],_0x422e8f[_0x2ebf('0x32')]));if(_0x319985[_0x2ebf('0x31')][_0x2ebf('0x3a')]){_0x10d9aa[_0x2ebf('0x38')]=_[_0x2ebf('0x3c')](_0x10d9aa[_0x2ebf('0x38')],{'$or':_[_0x2ebf('0x3b')](_0x10d9aa[_0x2ebf('0x33')],function(_0x52233b){var _0x5d6510={};_0x5d6510[_0x52233b]={'$like':'%'+_0x319985[_0x2ebf('0x31')][_0x2ebf('0x3a')]+'%'};return _0x5d6510;})});}_0x10d9aa=_[_0x2ebf('0x3c')]({},_0x10d9aa,_0x319985[_0x2ebf('0x3d')]);return _0x1eadea[_0x2ebf('0x53')](_0x10d9aa);}})['then'](function(_0x132d5b){if(_0x132d5b){_0x57753a=_0x132d5b[_0x2ebf('0x35')];if(!_0x319985[_0x2ebf('0x31')]['hasOwnProperty'](_0x2ebf('0x36'))){_0x10d9aa[_0x2ebf('0x22')]=qs['limit'](_0x319985[_0x2ebf('0x31')][_0x2ebf('0x22')]);_0x10d9aa[_0x2ebf('0x1f')]=qs[_0x2ebf('0x1f')](_0x319985[_0x2ebf('0x31')][_0x2ebf('0x1f')]);}return _0x1eadea[_0x2ebf('0x53')](_0x10d9aa);}})[_0x2ebf('0x27')](function(_0x4b5628){if(_0x4b5628){return _0x4b5628?{'count':_0x57753a,'rows':_0x4b5628}:null;}})[_0x2ebf('0x27')](respondWithResult(_0x787f32,null))[_0x2ebf('0x40')](handleError(_0x787f32,null));};
\ No newline at end of file
+var _0x68f6=['count','Content-Range','apply','reject','save','destroy','get','Companies','UserProfileResource','then','error','stack','name','send','index','model','keys','query','filters','attributes','fields','length','nolimit','sort','pick','filter','where','merge','map','options','includeAll','include','CmCompany','findAll','catch','params','rawAttributes','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addContacts','CmContact','ids','omit','getContacts','findOne','order','hasOwnProperty','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x68f6,0x90));var _0x668f=function(_0x563fd2,_0x1e1629){_0x563fd2=_0x563fd2-0x0;var _0x3ef9fc=_0x68f6[_0x563fd2];return _0x3ef9fc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x668f('0x0'));var jsonpatch=require(_0x668f('0x1'));var rp=require('request-promise');var moment=require(_0x668f('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x668f('0x3'));var util=require(_0x668f('0x4'));var path=require(_0x668f('0x5'));var sox=require(_0x668f('0x6'));var csv=require(_0x668f('0x7'));var ejs=require(_0x668f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x668f('0x9'));var squel=require(_0x668f('0xa'));var crypto=require(_0x668f('0xb'));var jsforce=require(_0x668f('0xc'));var deskjs=require(_0x668f('0xd'));var toCsv=require(_0x668f('0x7'));var querystring=require('querystring');var Papa=require(_0x668f('0xe'));var Redis=require('ioredis');var authService=require(_0x668f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x668f('0x10'));var hardwareService=require(_0x668f('0x11'));var logger=require(_0x668f('0x12'))(_0x668f('0x13'));var utils=require(_0x668f('0x14'));var config=require(_0x668f('0x15'));var licenseUtil=require(_0x668f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd3808a,_0x43063b){_0x43063b=_0x43063b||0xcc;return function(_0x4217cb){if(_0x4217cb){return _0xd3808a[_0x668f('0x17')](_0x43063b);}return _0xd3808a[_0x668f('0x18')](_0x43063b)[_0x668f('0x19')]();};}function respondWithResult(_0x285b40,_0xbb5c8c){_0xbb5c8c=_0xbb5c8c||0xc8;return function(_0x3cb7cd){if(_0x3cb7cd){return _0x285b40[_0x668f('0x18')](_0xbb5c8c)[_0x668f('0x1a')](_0x3cb7cd);}};}function respondWithFilteredResult(_0x565724,_0x322dba){return function(_0x4f8133){if(_0x4f8133){var _0x50ed10=typeof _0x322dba[_0x668f('0x1b')]==='undefined'&&typeof _0x322dba[_0x668f('0x1c')]===_0x668f('0x1d');var _0x8472d4=_0x4f8133[_0x668f('0x1e')];var _0x241fdb=_0x50ed10?0x0:_0x322dba[_0x668f('0x1b')];var _0x26978b=_0x50ed10?_0x4f8133['count']:_0x322dba[_0x668f('0x1b')]+_0x322dba[_0x668f('0x1c')];var _0x2d021d;if(_0x26978b>=_0x8472d4){_0x26978b=_0x8472d4;_0x2d021d=0xc8;}else{_0x2d021d=0xce;}_0x565724[_0x668f('0x18')](_0x2d021d);return _0x565724['set'](_0x668f('0x1f'),_0x241fdb+'-'+_0x26978b+'/'+_0x8472d4)[_0x668f('0x1a')](_0x4f8133);}return null;};}function patchUpdates(_0x32f32c){return function(_0x218253){try{jsonpatch[_0x668f('0x20')](_0x218253,_0x32f32c,!![]);}catch(_0x42ae81){return BPromise[_0x668f('0x21')](_0x42ae81);}return _0x218253[_0x668f('0x22')]();};}function saveUpdates(_0x1fe5b9,_0x38d649){return function(_0x147549){if(_0x147549){return _0x147549['update'](_0x1fe5b9)['then'](function(_0x4f2094){return _0x4f2094;});}return null;};}function removeEntity(_0x5d945b,_0x21a1aa){return function(_0x2fde18){if(_0x2fde18){return _0x2fde18[_0x668f('0x23')]()['then'](function(){var _0x2e1f7f=_0x2fde18[_0x668f('0x24')]({'plain':!![]});var _0x18f4be=_0x668f('0x25');return db[_0x668f('0x26')][_0x668f('0x23')]({'where':{'type':_0x18f4be,'resourceId':_0x2e1f7f['id']}})[_0x668f('0x27')](function(){return _0x2fde18;});})['then'](function(){_0x5d945b[_0x668f('0x18')](0xcc)[_0x668f('0x19')]();});}};}function handleEntityNotFound(_0x204e86,_0x39fb89){return function(_0x412daa){if(!_0x412daa){_0x204e86[_0x668f('0x17')](0x194);}return _0x412daa;};}function handleError(_0xf3822,_0xce66bd){_0xce66bd=_0xce66bd||0x1f4;return function(_0x3ade18){logger[_0x668f('0x28')](_0x3ade18[_0x668f('0x29')]);if(_0x3ade18['name']){delete _0x3ade18[_0x668f('0x2a')];}_0xf3822[_0x668f('0x18')](_0xce66bd)[_0x668f('0x2b')](_0x3ade18);};}exports[_0x668f('0x2c')]=function(_0x286b12,_0xc6d314){var _0x28990d={},_0x4dc384={},_0x318234={'count':0x0,'rows':[]};return db['CmCompany']['describe']()['then'](function(_0x59c29f){_0x4dc384[_0x668f('0x2d')]=_[_0x668f('0x2e')](_0x59c29f);_0x4dc384[_0x668f('0x2f')]=_[_0x668f('0x2e')](_0x286b12[_0x668f('0x2f')]);_0x4dc384[_0x668f('0x30')]=_['intersection'](_0x4dc384[_0x668f('0x2d')],_0x4dc384[_0x668f('0x2f')]);_0x28990d[_0x668f('0x31')]=_['intersection'](_0x4dc384[_0x668f('0x2d')],qs[_0x668f('0x32')](_0x286b12['query'][_0x668f('0x32')]));_0x28990d['attributes']=_0x28990d[_0x668f('0x31')][_0x668f('0x33')]?_0x28990d['attributes']:_0x4dc384[_0x668f('0x2d')];if(!_0x286b12[_0x668f('0x2f')]['hasOwnProperty'](_0x668f('0x34'))){_0x28990d[_0x668f('0x1c')]=qs[_0x668f('0x1c')](_0x286b12[_0x668f('0x2f')][_0x668f('0x1c')]);_0x28990d[_0x668f('0x1b')]=qs[_0x668f('0x1b')](_0x286b12[_0x668f('0x2f')][_0x668f('0x1b')]);}_0x28990d['order']=qs[_0x668f('0x35')](_0x286b12['query'][_0x668f('0x35')]);_0x28990d['where']=qs[_0x668f('0x30')](_[_0x668f('0x36')](_0x286b12[_0x668f('0x2f')],_0x4dc384['filters']),_0x59c29f);if(_0x286b12['query'][_0x668f('0x37')]){_0x28990d[_0x668f('0x38')]=_[_0x668f('0x39')](_0x28990d['where'],{'$or':_[_0x668f('0x3a')](_0x28990d[_0x668f('0x31')],function(_0x3ba000){var _0xb99da8={};_0xb99da8[_0x3ba000]={'$like':'%'+_0x286b12[_0x668f('0x2f')][_0x668f('0x37')]+'%'};return _0xb99da8;})});}_0x28990d=_['merge']({},_0x28990d,_0x286b12[_0x668f('0x3b')]);var _0x5dae97={'where':_0x28990d[_0x668f('0x38')]};return db['CmCompany'][_0x668f('0x1e')](_0x5dae97)[_0x668f('0x27')](function(_0x4c7960){_0x318234['count']=_0x4c7960;if(_0x286b12[_0x668f('0x2f')][_0x668f('0x3c')]){_0x28990d[_0x668f('0x3d')]=[{'all':!![]}];}return db[_0x668f('0x3e')][_0x668f('0x3f')](_0x28990d);})[_0x668f('0x27')](function(_0x42b184){_0x318234['rows']=_0x42b184;return _0x318234;})[_0x668f('0x27')](respondWithFilteredResult(_0xc6d314,_0x28990d))['catch'](handleError(_0xc6d314,null));})[_0x668f('0x40')](handleError(_0xc6d314,null));};exports['show']=function(_0x42a175,_0x59a8c6){var _0x3b525c={'raw':![],'where':{'id':_0x42a175[_0x668f('0x41')]['id']}},_0x5392c7={};_0x5392c7['model']=_[_0x668f('0x2e')](db[_0x668f('0x3e')][_0x668f('0x42')]);_0x5392c7[_0x668f('0x2f')]=_[_0x668f('0x2e')](_0x42a175['query']);_0x5392c7['filters']=_[_0x668f('0x43')](_0x5392c7[_0x668f('0x2d')],_0x5392c7['query']);_0x3b525c[_0x668f('0x31')]=_['intersection'](_0x5392c7[_0x668f('0x2d')],qs[_0x668f('0x32')](_0x42a175[_0x668f('0x2f')][_0x668f('0x32')]));_0x3b525c[_0x668f('0x31')]=_0x3b525c[_0x668f('0x31')][_0x668f('0x33')]?_0x3b525c['attributes']:_0x5392c7[_0x668f('0x2d')];if(_0x42a175[_0x668f('0x2f')][_0x668f('0x3c')]){_0x3b525c[_0x668f('0x3d')]=[{'all':!![]}];}_0x3b525c=_[_0x668f('0x39')]({},_0x3b525c,_0x42a175[_0x668f('0x3b')]);return db['CmCompany'][_0x668f('0x44')](_0x3b525c)[_0x668f('0x27')](handleEntityNotFound(_0x59a8c6,null))[_0x668f('0x27')](respondWithResult(_0x59a8c6,null))['catch'](handleError(_0x59a8c6,null));};exports[_0x668f('0x45')]=function(_0x459680,_0x26a422){return db[_0x668f('0x3e')]['create'](_0x459680['body'],{})[_0x668f('0x27')](function(_0x12e0ab){var _0x2acb3b=_0x459680[_0x668f('0x46')]['get']({'plain':!![]});if(!_0x2acb3b)throw new Error(_0x668f('0x47'));if(_0x2acb3b[_0x668f('0x48')]==='user'){var _0x40288f=_0x12e0ab[_0x668f('0x24')]({'plain':!![]});var _0x52674f=_0x668f('0x25');return db[_0x668f('0x49')][_0x668f('0x44')]({'where':{'name':_0x52674f,'userProfileId':_0x2acb3b[_0x668f('0x4a')]},'raw':!![]})[_0x668f('0x27')](function(_0xd49656){if(_0xd49656&&_0xd49656[_0x668f('0x4b')]===0x0){return db[_0x668f('0x26')][_0x668f('0x45')]({'name':_0x40288f[_0x668f('0x2a')],'resourceId':_0x40288f['id'],'type':_0xd49656[_0x668f('0x2a')],'sectionId':_0xd49656['id']},{})['then'](function(){return _0x12e0ab;});}else{return _0x12e0ab;}})['catch'](function(_0x42053a){logger[_0x668f('0x28')](_0x668f('0x4c'),_0x42053a);throw _0x42053a;});}return _0x12e0ab;})[_0x668f('0x27')](respondWithResult(_0x26a422,0xc9))['catch'](handleError(_0x26a422,null));};exports[_0x668f('0x4d')]=function(_0xc38e31,_0x19903b){if(_0xc38e31['body']['id']){delete _0xc38e31[_0x668f('0x4e')]['id'];}return db[_0x668f('0x3e')][_0x668f('0x44')]({'where':{'id':_0xc38e31[_0x668f('0x41')]['id']}})['then'](handleEntityNotFound(_0x19903b,null))[_0x668f('0x27')](saveUpdates(_0xc38e31[_0x668f('0x4e')],null))['then'](respondWithResult(_0x19903b,null))[_0x668f('0x40')](handleError(_0x19903b,null));};exports[_0x668f('0x23')]=function(_0x185021,_0x4eda1f){return db[_0x668f('0x3e')][_0x668f('0x44')]({'where':{'id':_0x185021[_0x668f('0x41')]['id']}})[_0x668f('0x27')](handleEntityNotFound(_0x4eda1f,null))[_0x668f('0x27')](removeEntity(_0x4eda1f,null))[_0x668f('0x40')](handleError(_0x4eda1f,null));};exports['describe']=function(_0xd455b7,_0xc1ff9){return db[_0x668f('0x3e')]['describe']()['then'](respondWithResult(_0xc1ff9,null))[_0x668f('0x40')](handleError(_0xc1ff9,null));};exports[_0x668f('0x4f')]=function(_0x411d43,_0x3be79e,_0x4cb7eb){return db[_0x668f('0x50')]['find']({'where':{'id':_0x411d43[_0x668f('0x41')]['id']}})[_0x668f('0x27')](handleEntityNotFound(_0x3be79e,null))[_0x668f('0x27')](function(_0x1427f5){if(_0x1427f5){return _0x1427f5[_0x668f('0x4f')](_0x411d43[_0x668f('0x4e')][_0x668f('0x51')],_[_0x668f('0x52')](_0x411d43[_0x668f('0x4e')],['ids','id'])||{});}})['then'](respondWithResult(_0x3be79e,null))[_0x668f('0x40')](handleError(_0x3be79e,null));};exports[_0x668f('0x53')]=function(_0xd85b37,_0x340818,_0x260d93){var _0xaeb810={};var _0x83eba8={};var _0x58f49f;var _0x5e848f;return db['CmCompany'][_0x668f('0x54')]({'where':{'id':_0xd85b37[_0x668f('0x41')]['id']}})[_0x668f('0x27')](handleEntityNotFound(_0x340818,null))[_0x668f('0x27')](function(_0x2b1f3d){if(_0x2b1f3d){_0x58f49f=_0x2b1f3d;_0x83eba8[_0x668f('0x2d')]=_[_0x668f('0x2e')](db[_0x668f('0x50')][_0x668f('0x42')]);_0x83eba8[_0x668f('0x2f')]=_[_0x668f('0x2e')](_0xd85b37[_0x668f('0x2f')]);_0x83eba8[_0x668f('0x30')]=_['intersection'](_0x83eba8[_0x668f('0x2d')],_0x83eba8[_0x668f('0x2f')]);_0xaeb810[_0x668f('0x31')]=_['intersection'](_0x83eba8['model'],qs['fields'](_0xd85b37[_0x668f('0x2f')][_0x668f('0x32')]));_0xaeb810['attributes']=_0xaeb810[_0x668f('0x31')][_0x668f('0x33')]?_0xaeb810[_0x668f('0x31')]:_0x83eba8[_0x668f('0x2d')];_0xaeb810[_0x668f('0x55')]=qs['sort'](_0xd85b37['query'][_0x668f('0x35')]);_0xaeb810[_0x668f('0x38')]=qs['filters'](_[_0x668f('0x36')](_0xd85b37[_0x668f('0x2f')],_0x83eba8[_0x668f('0x30')]));if(_0xd85b37[_0x668f('0x2f')][_0x668f('0x37')]){_0xaeb810[_0x668f('0x38')]=_[_0x668f('0x39')](_0xaeb810[_0x668f('0x38')],{'$or':_['map'](_0xaeb810[_0x668f('0x31')],function(_0x2b9613){var _0x3939f4={};_0x3939f4[_0x2b9613]={'$like':'%'+_0xd85b37[_0x668f('0x2f')][_0x668f('0x37')]+'%'};return _0x3939f4;})});}_0xaeb810=_['merge']({},_0xaeb810,_0xd85b37[_0x668f('0x3b')]);return _0x58f49f[_0x668f('0x53')](_0xaeb810);}})[_0x668f('0x27')](function(_0x1b4e89){if(_0x1b4e89){_0x5e848f=_0x1b4e89[_0x668f('0x33')];if(!_0xd85b37['query'][_0x668f('0x56')](_0x668f('0x34'))){_0xaeb810['limit']=qs[_0x668f('0x1c')](_0xd85b37[_0x668f('0x2f')][_0x668f('0x1c')]);_0xaeb810[_0x668f('0x1b')]=qs[_0x668f('0x1b')](_0xd85b37['query'][_0x668f('0x1b')]);}return _0x58f49f[_0x668f('0x53')](_0xaeb810);}})[_0x668f('0x27')](function(_0x254356){if(_0x254356){return _0x254356?{'count':_0x5e848f,'rows':_0x254356}:null;}})[_0x668f('0x27')](respondWithResult(_0x340818,null))[_0x668f('0x40')](handleError(_0x340818,null));};
\ No newline at end of file
index b6944c9..2e72014 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46f1=['CmCompany','cm_companies','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x438ff1,_0x1d84fa){var _0x1302fd=function(_0x229c92){while(--_0x229c92){_0x438ff1['push'](_0x438ff1['shift']());}};_0x1302fd(++_0x1d84fa);}(_0x46f1,0x195));var _0x146f=function(_0xf3b01b,_0x1d72e0){_0xf3b01b=_0xf3b01b-0x0;var _0x50d699=_0x46f1[_0xf3b01b];return _0x50d699;};'use strict';var _=require(_0x146f('0x0'));var util=require(_0x146f('0x1'));var logger=require(_0x146f('0x2'))(_0x146f('0x3'));var moment=require('moment');var BPromise=require(_0x146f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x146f('0x5'));var rimraf=require(_0x146f('0x6'));var config=require(_0x146f('0x7'));var attributes=require(_0x146f('0x8'));module[_0x146f('0x9')]=function(_0x47ec9f,_0x415507){return _0x47ec9f[_0x146f('0xa')](_0x146f('0xb'),attributes,{'tableName':_0x146f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe66d=['rimraf','./cmCompany.attributes','CmCompany','cm_companies','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x48fef8,_0x325b32){var _0x2e169f=function(_0x24a9a8){while(--_0x24a9a8){_0x48fef8['push'](_0x48fef8['shift']());}};_0x2e169f(++_0x325b32);}(_0xe66d,0x68));var _0xde66=function(_0x1522db,_0x7efece){_0x1522db=_0x1522db-0x0;var _0x165585=_0xe66d[_0x1522db];return _0x165585;};'use strict';var _=require(_0xde66('0x0'));var util=require(_0xde66('0x1'));var logger=require(_0xde66('0x2'))('api');var moment=require(_0xde66('0x3'));var BPromise=require(_0xde66('0x4'));var rp=require(_0xde66('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde66('0x6'));var config=require('../../config/environment');var attributes=require(_0xde66('0x7'));module['exports']=function(_0x23f943,_0x62b009){return _0x23f943['define'](_0xde66('0x8'),attributes,{'tableName':_0xde66('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ee310e0..f9e6573 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x949d=['info','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','CmCompany,\x20%s,\x20%s','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0xf26c2e,_0x56c3ea){var _0x46ecb4=function(_0x1be516){while(--_0x1be516){_0xf26c2e['push'](_0xf26c2e['shift']());}};_0x46ecb4(++_0x56c3ea);}(_0x949d,0xe9));var _0xd949=function(_0x4c165b,_0x39b5fb){_0x4c165b=_0x4c165b-0x0;var _0x42c49a=_0x949d[_0x4c165b];return _0x42c49a;};'use strict';var _=require(_0xd949('0x0'));var util=require(_0xd949('0x1'));var moment=require(_0xd949('0x2'));var BPromise=require('bluebird');var rs=require(_0xd949('0x3'));var fs=require('fs');var Redis=require(_0xd949('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd949('0x5'));var logger=require(_0xd949('0x6'))(_0xd949('0x7'));var config=require(_0xd949('0x8'));var jayson=require(_0xd949('0x9'));var client=jayson[_0xd949('0xa')][_0xd949('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42c2dc,_0x35c603,_0x57e023){return new BPromise(function(_0x1af661,_0x369e9c){return client[_0xd949('0xc')](_0x42c2dc,_0x57e023)['then'](function(_0x105d93){logger['info'](_0xd949('0xd'),_0x35c603,_0xd949('0xe'));logger['debug'](_0xd949('0xf'),_0x35c603,_0xd949('0xe'),JSON[_0xd949('0x10')](_0x105d93));if(_0x105d93[_0xd949('0x11')]){if(_0x105d93[_0xd949('0x11')]['code']===0x1f4){logger[_0xd949('0x11')](_0xd949('0xd'),_0x35c603,_0x105d93[_0xd949('0x11')][_0xd949('0x12')]);return _0x369e9c(_0x105d93['error'][_0xd949('0x12')]);}logger['error'](_0xd949('0xd'),_0x35c603,_0x105d93[_0xd949('0x11')][_0xd949('0x12')]);return _0x1af661(_0x105d93[_0xd949('0x11')][_0xd949('0x12')]);}else{logger[_0xd949('0x13')](_0xd949('0xd'),_0x35c603,'request\x20sent');_0x1af661(_0x105d93[_0xd949('0x14')][_0xd949('0x12')]);}})['catch'](function(_0x215eba){logger['error'](_0xd949('0xd'),_0x35c603,_0x215eba);_0x369e9c(_0x215eba);});});}
\ No newline at end of file
+var _0x454b=['jayson/promise','client','http','then','info','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1d17a5,_0x133cc9){var _0x25f3d1=function(_0x20118c){while(--_0x20118c){_0x1d17a5['push'](_0x1d17a5['shift']());}};_0x25f3d1(++_0x133cc9);}(_0x454b,0xc6));var _0xb454=function(_0x4b8156,_0x437af2){_0x4b8156=_0x4b8156-0x0;var _0x4a819c=_0x454b[_0x4b8156];return _0x4a819c;};'use strict';var _=require(_0xb454('0x0'));var util=require('util');var moment=require(_0xb454('0x1'));var BPromise=require(_0xb454('0x2'));var rs=require(_0xb454('0x3'));var fs=require('fs');var Redis=require(_0xb454('0x4'));var db=require(_0xb454('0x5'))['db'];var utils=require(_0xb454('0x6'));var logger=require(_0xb454('0x7'))(_0xb454('0x8'));var config=require('../../config/environment');var jayson=require(_0xb454('0x9'));var client=jayson[_0xb454('0xa')][_0xb454('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38d925,_0x33d2eb,_0x2ab69b){return new BPromise(function(_0x2065b1,_0x144e6d){return client['request'](_0x38d925,_0x2ab69b)[_0xb454('0xc')](function(_0x5909e0){logger[_0xb454('0xd')]('CmCompany,\x20%s,\x20%s',_0x33d2eb,_0xb454('0xe'));logger['debug'](_0xb454('0xf'),_0x33d2eb,_0xb454('0xe'),JSON[_0xb454('0x10')](_0x5909e0));if(_0x5909e0['error']){if(_0x5909e0[_0xb454('0x11')][_0xb454('0x12')]===0x1f4){logger[_0xb454('0x11')](_0xb454('0x13'),_0x33d2eb,_0x5909e0[_0xb454('0x11')]['message']);return _0x144e6d(_0x5909e0[_0xb454('0x11')][_0xb454('0x14')]);}logger[_0xb454('0x11')]('CmCompany,\x20%s,\x20%s',_0x33d2eb,_0x5909e0['error'][_0xb454('0x14')]);return _0x2065b1(_0x5909e0[_0xb454('0x11')][_0xb454('0x14')]);}else{logger[_0xb454('0xd')](_0xb454('0x13'),_0x33d2eb,_0xb454('0xe'));_0x2065b1(_0x5909e0[_0xb454('0x15')][_0xb454('0x14')]);}})[_0xb454('0x16')](function(_0x1c8417){logger[_0xb454('0x11')]('CmCompany,\x20%s,\x20%s',_0x33d2eb,_0x1c8417);_0x144e6d(_0x1c8417);});});}
\ No newline at end of file
index 207f502..1f8ee7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2f2=['../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','getContacts','post','create','/:id','update','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xa2f2,0x67));var _0x2a2f=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xa2f2[_0x164eca];return _0x2ce562;};'use strict';var multer=require('multer');var util=require(_0x2a2f('0x0'));var path=require(_0x2a2f('0x1'));var timeout=require(_0x2a2f('0x2'));var express=require(_0x2a2f('0x3'));var router=express[_0x2a2f('0x4')]();var fs_extra=require(_0x2a2f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2a2f('0x6'));var config=require(_0x2a2f('0x7'));var controller=require(_0x2a2f('0x8'));router[_0x2a2f('0x9')]('/',auth[_0x2a2f('0xa')](),controller[_0x2a2f('0xb')]);router[_0x2a2f('0x9')](_0x2a2f('0xc'),auth['isAuthenticated'](),controller[_0x2a2f('0xd')]);router['get']('/:id',auth[_0x2a2f('0xa')](),controller[_0x2a2f('0xe')]);router[_0x2a2f('0x9')](_0x2a2f('0xf'),auth['isAuthenticated'](),controller[_0x2a2f('0x10')]);router[_0x2a2f('0x11')]('/',auth[_0x2a2f('0xa')](),controller[_0x2a2f('0x12')]);router[_0x2a2f('0x11')]('/:id/contacts',auth[_0x2a2f('0xa')](),controller['addContacts']);router['put'](_0x2a2f('0x13'),auth[_0x2a2f('0xa')](),controller[_0x2a2f('0x14')]);router['delete'](_0x2a2f('0x13'),auth[_0x2a2f('0xa')](),controller[_0x2a2f('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xa192=['/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','/describe','get'];(function(_0x1ce723,_0x3995d1){var _0x22b4ca=function(_0x2734a0){while(--_0x2734a0){_0x1ce723['push'](_0x1ce723['shift']());}};_0x22b4ca(++_0x3995d1);}(_0xa192,0x150));var _0x2a19=function(_0x42e30d,_0x3bfb1a){_0x42e30d=_0x42e30d-0x0;var _0x52f82c=_0xa192[_0x42e30d];return _0x52f82c;};'use strict';var multer=require('multer');var util=require(_0x2a19('0x0'));var path=require(_0x2a19('0x1'));var timeout=require(_0x2a19('0x2'));var express=require(_0x2a19('0x3'));var router=express[_0x2a19('0x4')]();var fs_extra=require(_0x2a19('0x5'));var auth=require(_0x2a19('0x6'));var interaction=require(_0x2a19('0x7'));var config=require(_0x2a19('0x8'));var controller=require(_0x2a19('0x9'));router['get']('/',auth[_0x2a19('0xa')](),controller[_0x2a19('0xb')]);router['get'](_0x2a19('0xc'),auth[_0x2a19('0xa')](),controller['describe']);router[_0x2a19('0xd')](_0x2a19('0xe'),auth[_0x2a19('0xa')](),controller[_0x2a19('0xf')]);router[_0x2a19('0xd')](_0x2a19('0x10'),auth[_0x2a19('0xa')](),controller[_0x2a19('0x11')]);router[_0x2a19('0x12')]('/',auth[_0x2a19('0xa')](),controller[_0x2a19('0x13')]);router['post'](_0x2a19('0x10'),auth[_0x2a19('0xa')](),controller[_0x2a19('0x14')]);router[_0x2a19('0x15')]('/:id',auth[_0x2a19('0xa')](),controller[_0x2a19('0x16')]);router[_0x2a19('0x17')](_0x2a19('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x2a19('0x18')]=router;
\ No newline at end of file
index a1fb45b..1c79870 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaa8=['exports','STRING','TEXT','INTEGER','DATE','NOW','sequelize'];(function(_0xdd0313,_0x251c2b){var _0x2bd7e8=function(_0x340f1f){while(--_0x340f1f){_0xdd0313['push'](_0xdd0313['shift']());}};_0x2bd7e8(++_0x251c2b);}(_0xbaa8,0x6f));var _0x8baa=function(_0xbc2e6,_0x763a5e){_0xbc2e6=_0xbc2e6-0x0;var _0xc05648=_0xbaa8[_0xbc2e6];return _0xc05648;};'use strict';var _=require('lodash');var Sequelize=require(_0x8baa('0x0'));module[_0x8baa('0x1')]={'firstName':{'type':Sequelize[_0x8baa('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x8baa('0x2')]},'postalCode':{'type':Sequelize[_0x8baa('0x2')]},'city':{'type':Sequelize[_0x8baa('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x8baa('0x2')]},'description':{'type':Sequelize[_0x8baa('0x3')]},'phone':{'type':Sequelize[_0x8baa('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x8baa('0x2')]},'email':{'type':Sequelize[_0x8baa('0x2')]},'url':{'type':Sequelize[_0x8baa('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x8baa('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x8baa('0x2')]},'teams':{'type':Sequelize[_0x8baa('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x8baa('0x2')]},'telegram':{'type':Sequelize[_0x8baa('0x2')]},'UserId':{'type':Sequelize[_0x8baa('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x8baa('0x2')]},'priority':{'type':Sequelize[_0x8baa('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x8baa('0x5')],'defaultValue':Sequelize[_0x8baa('0x6')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x8baa('0x4')]}};
\ No newline at end of file
+var _0xebe7=['NOW','lodash','sequelize','STRING','TEXT','INTEGER','DATE'];(function(_0x53f37f,_0xfb0b18){var _0x2fe5f8=function(_0x76ef2d){while(--_0x76ef2d){_0x53f37f['push'](_0x53f37f['shift']());}};_0x2fe5f8(++_0xfb0b18);}(_0xebe7,0x13c));var _0x7ebe=function(_0x900f0a,_0x3f2907){_0x900f0a=_0x900f0a-0x0;var _0x2c6bc3=_0xebe7[_0x900f0a];return _0x2c6bc3;};'use strict';var _=require(_0x7ebe('0x0'));var Sequelize=require(_0x7ebe('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x7ebe('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x7ebe('0x2')]},'street':{'type':Sequelize[_0x7ebe('0x2')]},'postalCode':{'type':Sequelize[_0x7ebe('0x2')]},'city':{'type':Sequelize[_0x7ebe('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x7ebe('0x2')]},'description':{'type':Sequelize[_0x7ebe('0x3')]},'phone':{'type':Sequelize[_0x7ebe('0x2')]},'mobile':{'type':Sequelize[_0x7ebe('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x7ebe('0x2')]},'url':{'type':Sequelize[_0x7ebe('0x2')]},'facebook':{'type':Sequelize[_0x7ebe('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x7ebe('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x7ebe('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x7ebe('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x7ebe('0x2')]},'priority':{'type':Sequelize[_0x7ebe('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x7ebe('0x5')],'defaultValue':Sequelize[_0x7ebe('0x6')]},'dialTimezone':{'type':Sequelize[_0x7ebe('0x2')]},'utcOffset':{'type':Sequelize[_0x7ebe('0x4')]}};
\ No newline at end of file
index 21de8ef..d070c62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46e6=['Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','type','start','end','filter','Contact','push','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','having','t.id\x20IN\x20?','some','user','getLists','c.ListId\x20IS\x20NULL','role','agent','sequelize','toString','keyBy','merge','c.firstName','c.phone','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','Tags','TagIds','rows','catch','find','params','tags','columnName','analytics','findAll','displayName','alias','custom','values','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','each','duplicates','$or','spread','additionalPhones','contact','show','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','omit','cf_%d','pickBy','table','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','options','setTags','ids','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','pick','ContactId','include','includeAll','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','fork','../../components/import/cm/csv','binding_keys','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','binding','child_process','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','stringify','exit','mail','chat','openchannel','fax','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','createdAt','userDisposition','userThirdDisposition','UserId','fullname','findAndCountAll','closed','note','disposition','secondDisposition','thirdDisposition','Account','key','browserName','customerIp','deviceModel','osName','ratingMessage','ratingType','referer','subject','externalUrl','threadId','startCase','Interaction','Owner','flatten','sortBy','reverse','slice','moment','bluebird','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment/shared','defaults','redis','./cmContact.socket','json','offset','limit','count','status','set','update','destroy','then','error','stack','name','send','CmContact','describe','keys','length','startsWith','cf_','CmCustomField','findOne','trimStart','all','fieldType','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','left_join','tools_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions'];(function(_0x3a991b,_0x3277ee){var _0x16d074=function(_0x1e3c4a){while(--_0x1e3c4a){_0x3a991b['push'](_0x3a991b['shift']());}};_0x16d074(++_0x3277ee);}(_0x46e6,0xfa));var _0x646e=function(_0x58fbc1,_0x40f7f4){_0x58fbc1=_0x58fbc1-0x0;var _0x455e0c=_0x46e6[_0x58fbc1];return _0x455e0c;};'use strict';var moment=require(_0x646e('0x0'));var BPromise=require(_0x646e('0x1'));var util=require('util');var path=require(_0x646e('0x2'));var fs=require('fs');var _=require(_0x646e('0x3'));var squel=require(_0x646e('0x4'));var Papa=require(_0x646e('0x5'));var Redis=require(_0x646e('0x6'));var qs=require(_0x646e('0x7'));var as=require(_0x646e('0x8'));var logger=require(_0x646e('0x9'))(_0x646e('0xa'));var config=require('../../config/environment');var shared=require(_0x646e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x646e('0xc')](config[_0x646e('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x646e('0xe'))['register'](socket);function respondWithResult(_0x168138,_0x20af02){_0x20af02=_0x20af02||0xc8;return function(_0x13c7e7){if(_0x13c7e7){return _0x168138['status'](_0x20af02)[_0x646e('0xf')](_0x13c7e7);}};}function respondWithFilteredResult(_0x4b522f,_0x49f347){return function(_0x41de1f){if(_0x41de1f){var _0x3d9081=typeof _0x49f347[_0x646e('0x10')]==='undefined'&&typeof _0x49f347[_0x646e('0x11')]==='undefined';var _0x417530=_0x41de1f['count'];var _0x5a6e26=_0x3d9081?0x0:_0x49f347[_0x646e('0x10')];var _0xaf4739=_0x3d9081?_0x41de1f[_0x646e('0x12')]:_0x49f347[_0x646e('0x10')]+_0x49f347['limit'];var _0x414209;if(_0xaf4739>=_0x417530){_0xaf4739=_0x417530;_0x414209=0xc8;}else{_0x414209=0xce;}_0x4b522f[_0x646e('0x13')](_0x414209);return _0x4b522f[_0x646e('0x14')]('Content-Range',_0x5a6e26+'-'+_0xaf4739+'/'+_0x417530)['json'](_0x41de1f);}return null;};}function saveUpdates(_0x337bd1){return function(_0x2e4651){if(_0x2e4651){return _0x2e4651[_0x646e('0x15')](_0x337bd1)['then'](function(_0x5a2910){return _0x5a2910;});}return null;};}function removeEntity(_0x337c84){return function(_0x1a837f){if(_0x1a837f){return _0x1a837f[_0x646e('0x16')]()[_0x646e('0x17')](function(){_0x337c84[_0x646e('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x250ca5){return function(_0x1d886e){if(!_0x1d886e){_0x250ca5['sendStatus'](0x194);}return _0x1d886e;};}function handleError(_0xa7e7d1,_0x1760bd){_0x1760bd=_0x1760bd||0x1f4;return function(_0x522d3a){logger[_0x646e('0x18')](_0x522d3a[_0x646e('0x19')]);if(_0x522d3a[_0x646e('0x1a')]){delete _0x522d3a[_0x646e('0x1a')];}_0xa7e7d1[_0x646e('0x13')](_0x1760bd)[_0x646e('0x1b')](_0x522d3a);};}exports['index']=function(_0x57cfd7,_0xc6c341){var _0x16a99b={},_0x54b5e9={},_0x49c043={'count':0x0,'rows':[]};return db[_0x646e('0x1c')][_0x646e('0x1d')]()[_0x646e('0x17')](function(_0x3c0f0f){var _0x12c702=[];for(var _0x48d1a6=0x0;_0x48d1a6<Object[_0x646e('0x1e')](_0x3c0f0f)[_0x646e('0x1f')];_0x48d1a6++){var _0x3e93fb=Object[_0x646e('0x1e')](_0x3c0f0f)[_0x48d1a6];if(_[_0x646e('0x20')](_0x3e93fb,_0x646e('0x21'))){_0x12c702['push'](db[_0x646e('0x22')][_0x646e('0x23')]({'where':{'id':_[_0x646e('0x24')](_0x3e93fb,'cf_')},'raw':!![]}));}}return BPromise[_0x646e('0x25')](_0x12c702)['then'](function(_0x1b42d0){for(var _0x5f3236=0x0;_0x5f3236<_0x1b42d0['length'];_0x5f3236++){if(_0x1b42d0[_0x5f3236]){var _0x363b0b=_0x646e('0x21')+_0x1b42d0[_0x5f3236]['id'];var _0x28d317=_0x3c0f0f[_0x363b0b];_0x28d317[_0x646e('0x26')]=_0x1b42d0[_0x5f3236]['type'];}}return _0x3c0f0f;});})[_0x646e('0x17')](function(_0x37b8da){_0x54b5e9[_0x646e('0x27')]=_[_0x646e('0x1e')](_0x37b8da);_0x54b5e9[_0x646e('0x28')]=_[_0x646e('0x1e')](_0x57cfd7[_0x646e('0x28')]);_0x54b5e9[_0x646e('0x29')]=_[_0x646e('0x2a')](_0x54b5e9[_0x646e('0x27')],_0x54b5e9['query']);_0x16a99b[_0x646e('0x2b')]=_[_0x646e('0x2a')](_0x54b5e9[_0x646e('0x27')],qs[_0x646e('0x2c')](_0x57cfd7['query']['fields']));_0x16a99b[_0x646e('0x2b')]=_0x16a99b[_0x646e('0x2b')][_0x646e('0x1f')]?_0x16a99b[_0x646e('0x2b')]:_0x54b5e9['model'];if(!_0x57cfd7[_0x646e('0x28')][_0x646e('0x2d')](_0x646e('0x2e'))){_0x16a99b['limit']=qs['limit'](_0x57cfd7['query']['limit']);_0x16a99b['offset']=qs[_0x646e('0x10')](_0x57cfd7['query'][_0x646e('0x10')]);}_0x16a99b[_0x646e('0x2f')]=qs[_0x646e('0x30')](_0x57cfd7[_0x646e('0x28')][_0x646e('0x30')]);_0x16a99b[_0x646e('0x31')]=qs[_0x646e('0x29')](_['pick'](_0x57cfd7[_0x646e('0x28')],_0x54b5e9['filters']),_0x37b8da);var _0x2170a1=[];var _0x1e3f50=squel[_0x646e('0x32')]()[_0x646e('0x33')]('id')[_0x646e('0x33')](_0x646e('0x1a'))[_0x646e('0x33')](_0x646e('0x34'))['from']('tools_tags');var _0x3b6e83=squel['select']()[_0x646e('0x35')]('cm_contacts','c')['left_join']('cm_user_has_contacts','uc','uc.CmContactId\x20=\x20c.id')['left_join'](_0x646e('0x36'),'ct',_0x646e('0x37'))[_0x646e('0x38')](_0x646e('0x39'),'t',_0x646e('0x3a'))['where'](_0x646e('0x3b'));var _0x2ec780=squel[_0x646e('0x3c')]();var _0x118af5=[];var _0x519a14=squel['expr']();var _0x27559c;if(_0x57cfd7[_0x646e('0x28')][_0x646e('0x3d')]){_0x27559c=as[_0x646e('0x3e')](_0x57cfd7[_0x646e('0x28')][_0x646e('0x3d')]);var _0x25f3f1=_0x27559c[_0x646e('0x3f')];for(var _0x5290d2=0x0;_0x5290d2<_0x27559c['conditions']['length'];_0x5290d2++){var _0xbae371=_0x27559c[_0x646e('0x40')][_0x5290d2];var _0x38de9e='c';var _0x1fdaf2=_(_0x37b8da)[_0x646e('0x1e')]()['find'](function(_0xb1b474){return _0xb1b474===_0xbae371['field'];});if(_0x1fdaf2)_0x1fdaf2=_0x37b8da[_0xbae371[_0x646e('0x33')]];if(!_0x1fdaf2){if(_0xbae371[_0x646e('0x33')]===_0x646e('0x41')){var _0x23a811=_0xbae371[_0x646e('0x42')][_0x646e('0x43')](',')[_0x646e('0x44')](function(_0x4fa4c9){return Number(_0x4fa4c9);});_0x23a811[_0x646e('0x45')](function(_0x5ad87e){_0x519a14['or'](_0x646e('0x46'),'%,'+_0x5ad87e+',%');});_0x118af5=_[_0x646e('0x47')](_0x118af5,_0x23a811);}else if(_0xbae371[_0x646e('0x33')]===_0x646e('0x48')){_0x2ec780[_0x646e('0x49')](_0x646e('0x4a'),_0xbae371[_0x646e('0x42')]);}}else{if(_0xbae371[_0x646e('0x33')]===_0x646e('0x4b')||_0x1fdaf2[_0x646e('0x26')]===_0x646e('0x4c'))_0xbae371[_0x646e('0x4d')]=_0x646e('0x4e');var _0x5e2332=as[_0x646e('0x4f')](_0x38de9e,_0x1fdaf2[_0x646e('0x50')],_0xbae371);_0x2ec780[_0x25f3f1](_0x5e2332['text'],_0x5e2332[_0x646e('0x42')][_0x646e('0x51')],_0x5e2332[_0x646e('0x42')][_0x646e('0x52')]);}}}else{var _0x567805=_(Object[_0x646e('0x1e')](_0x57cfd7[_0x646e('0x28')]))[_0x646e('0x44')](function(_0x3b76b7){return _0x37b8da[_0x646e('0x2d')](_0x3b76b7)?_0x3b76b7:undefined;})[_0x646e('0x53')](function(_0x5d7baf){return!_['isNil'](_0x5d7baf);})['value']();if(_0x57cfd7[_0x646e('0x28')][_0x646e('0x54')])_0x567805[_0x646e('0x55')]('Contact');if(!_[_0x646e('0x56')](_0x567805)){_0x567805['forEach'](function(_0x8a8810){if(_0x8a8810===_0x646e('0x57')){_0x3b6e83[_0x646e('0x31')](_0x646e('0x58'),[][_0x646e('0x59')](_0x57cfd7[_0x646e('0x28')][_0x8a8810]));}else if(_0x8a8810===_0x646e('0x54')){var _0x4be7e8='%'+_0x57cfd7[_0x646e('0x28')][_0x8a8810]+'%';_0x3b6e83[_0x646e('0x31')](_0x646e('0x5a'),_0x4be7e8);}else{_0x3b6e83[_0x646e('0x31')]('c.'+_0x8a8810+_0x646e('0x5b'),_0x57cfd7['query'][_0x8a8810]);}});}if(_0x57cfd7[_0x646e('0x28')][_0x646e('0x5c')]){_0x118af5=_[_0x646e('0x5d')](_0x57cfd7[_0x646e('0x28')]['tag'])?_0x57cfd7[_0x646e('0x28')][_0x646e('0x5c')]:new Array(_0x57cfd7[_0x646e('0x28')]['tag']);_0x118af5[_0x646e('0x45')](function(_0x371df0){_0x519a14['or'](_0x646e('0x46'),'%,'+_0x371df0+',%');});}if(_0x57cfd7[_0x646e('0x28')][_0x646e('0x53')]){var _0x4dd3a5=_0x57cfd7[_0x646e('0x28')][_0x646e('0x53')][_0x646e('0x5e')]('\x5c','\x5c\x5c')[_0x646e('0x5e')](/'/g,'\x27\x27');if(_0x4dd3a5[_0x646e('0x43')]('\x20')['length']>0x1){_0x2ec780['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x646e('0x5f')](_0x4dd3a5),null);}else{if(qs[_0x646e('0x60')](_0x4dd3a5)){_0x2ec780['or'](_0x646e('0x61'),_0x4dd3a5+'%');_0x2ec780['or'](_0x646e('0x62'),_0x4dd3a5+'%');_0x2ec780['or'](_0x646e('0x63'),_0x4dd3a5+'%');_0x2ec780['or']('c.fax\x20LIKE\x20?',_0x4dd3a5+'%');}else if(qs['isEmail'](_0x4dd3a5)){_0x2ec780['or'](_0x646e('0x64'),_0x4dd3a5+'%');}else{_0x2ec780['or']('c.firstName\x20LIKE\x20?','%'+_0x4dd3a5+'%');_0x2ec780['or'](_0x646e('0x65'),'%'+_0x4dd3a5+'%');_0x2ec780['or'](_0x646e('0x64'),'%'+_0x4dd3a5+'%');}}}}_0x3b6e83[_0x646e('0x31')](_0x2ec780);_0x3b6e83[_0x646e('0x66')](_0x646e('0x67'));var _0x4b7b38={'type':db[_0x646e('0x68')][_0x646e('0x69')][_0x646e('0x6a')],'raw':!![]};var _0x385cb0=_0x3b6e83[_0x646e('0x6b')]()[_0x646e('0x33')]('c.id');if(_0x16a99b[_0x646e('0x2f')]){_0x16a99b[_0x646e('0x2f')][_0x646e('0x45')](function(_0x2b959f){_0x3b6e83['order']('c.'+_0x2b959f[0x0],_0x2b959f[0x1]===_0x646e('0x6c')?![]:!![]);});}if(!_[_0x646e('0x56')](_0x118af5)){_0x3b6e83[_0x646e('0x6d')](_0x519a14);_0x385cb0['where'](_0x646e('0x6e'),_0x118af5);}BPromise['resolve']()[_0x646e('0x17')](function(){if(!_0x27559c)return;if(_0x57cfd7['user']['role']!=='agent')return;if(!_[_0x646e('0x6f')](_0x27559c[_0x646e('0x40')],[_0x646e('0x33'),_0x646e('0x48')])){return _0x57cfd7[_0x646e('0x70')][_0x646e('0x71')]({'attributes':['id'],'raw':!![]})[_0x646e('0x17')](function(_0x575772){if(_[_0x646e('0x56')](_0x575772)){_0x385cb0[_0x646e('0x31')]('c.ListId\x20IS\x20NULL');_0x3b6e83['where'](_0x646e('0x72'));}else{_0x385cb0['where'](_0x646e('0x58'),_[_0x646e('0x44')](_0x575772,'id'));_0x3b6e83[_0x646e('0x31')](_0x646e('0x58'),_[_0x646e('0x44')](_0x575772,'id'));}});}})[_0x646e('0x17')](function(){if(_0x57cfd7[_0x646e('0x70')][_0x646e('0x73')]===_0x646e('0x74')&&!_0x27559c&&!_0x57cfd7[_0x646e('0x28')][_0x646e('0x57')])return[];return db[_0x646e('0x75')][_0x646e('0x28')](_0x385cb0['toString'](),_0x4b7b38);})[_0x646e('0x17')](function(_0x52c0d9){_0x49c043[_0x646e('0x12')]=_0x52c0d9[_0x646e('0x1f')];if(_0x49c043[_0x646e('0x12')]===0x0)return[];return db[_0x646e('0x75')][_0x646e('0x28')](_0x1e3f50[_0x646e('0x76')](),_0x4b7b38)[_0x646e('0x17')](function(_0x35443c){_0x2170a1=_[_0x646e('0x77')](_0x35443c,'id');_0x4b7b38=_[_0x646e('0x78')](_0x4b7b38,{'model':db[_0x646e('0x1c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x57cfd7['query'][_0x646e('0x2c')]){_0x16a99b[_0x646e('0x2b')][_0x646e('0x45')](function(_0x32822a){_0x3b6e83['field']('c.'+_0x32822a);});}else{_0x3b6e83['field']('c.id');_0x3b6e83[_0x646e('0x33')](_0x646e('0x79'));_0x3b6e83[_0x646e('0x33')]('c.lastName');_0x3b6e83['field'](_0x646e('0x7a'));_0x3b6e83[_0x646e('0x33')]('c.mobile');_0x3b6e83[_0x646e('0x33')](_0x646e('0x7b'));_0x3b6e83[_0x646e('0x33')](_0x646e('0x7c'));_0x3b6e83[_0x646e('0x33')](_0x646e('0x7d'));_0x3b6e83[_0x646e('0x33')](_0x646e('0x7e'));_0x3b6e83[_0x646e('0x33')](_0x646e('0x7f'));_0x3b6e83[_0x646e('0x33')](_0x646e('0x80'));_0x3b6e83[_0x646e('0x33')](_0x646e('0x81'),'TagIds');}if(_0x16a99b[_0x646e('0x11')])_0x3b6e83[_0x646e('0x11')](_0x16a99b[_0x646e('0x11')]);if(_0x16a99b[_0x646e('0x10')])_0x3b6e83[_0x646e('0x10')](_0x16a99b[_0x646e('0x10')]);return db[_0x646e('0x75')][_0x646e('0x28')](_0x3b6e83[_0x646e('0x76')](),_0x4b7b38);});})[_0x646e('0x17')](function(_0x63abe5){_0x63abe5['forEach'](function(_0x162388){if(_0x162388['TagIds']){_0x162388[_0x646e('0x82')]=[];_0x162388[_0x646e('0x83')][_0x646e('0x43')](',')[_0x646e('0x45')](function(_0x55b450){_0x162388['Tags']['push'](_0x2170a1[_0x55b450]);});}delete _0x162388[_0x646e('0x83')];});_0x49c043[_0x646e('0x84')]=_0x63abe5;return _0x49c043;})['then'](respondWithFilteredResult(_0xc6c341,_0x16a99b));})[_0x646e('0x85')](handleError(_0xc6c341,null));};exports[_0x646e('0x16')]=function(_0xf6e47f,_0x1291ab){return db[_0x646e('0x1c')][_0x646e('0x86')]({'where':{'id':_0xf6e47f[_0x646e('0x87')]['id']}})[_0x646e('0x17')](handleEntityNotFound(_0x1291ab,null))['then'](removeEntity(_0x1291ab,null))[_0x646e('0x85')](handleError(_0x1291ab,null));};exports[_0x646e('0x1d')]=function(_0x2b947d,_0x428671){return db[_0x646e('0x1c')][_0x646e('0x1d')]()[_0x646e('0x17')](function(_0x176d35){delete _0x176d35[_0x646e('0x88')];for(var _0x181191=0x0;_0x181191<Object[_0x646e('0x1e')](_0x176d35)[_0x646e('0x1f')];_0x181191++){var _0x426c1e=Object[_0x646e('0x1e')](_0x176d35)[_0x181191];if(!_['startsWith'](_0x426c1e,_0x646e('0x21'))){_0x176d35[_0x426c1e][_0x646e('0x89')]=_0x426c1e;_0x176d35[_0x426c1e]['displayName']=_0x426c1e;}}return _0x176d35;})[_0x646e('0x17')](function(_0xdb8634){var _0x5881e4={'where':Boolean(_0x2b947d[_0x646e('0x28')][_0x646e('0x8a')])===!![]?undefined:{'$or':[{'ListId':_0x2b947d[_0x646e('0x28')]['id']},{'ListId':null}]},'raw':!![]};return db['CmCustomField'][_0x646e('0x8b')](_0x5881e4)[_0x646e('0x17')](function(_0x562b61){for(var _0x4d4f40=0x0;_0x4d4f40<_0x562b61['length'];_0x4d4f40++){var _0x23cea5=_0x646e('0x21')+_0x562b61[_0x4d4f40]['id'];_0xdb8634[_0x23cea5][_0x646e('0x89')]=_0x23cea5;_0xdb8634[_0x23cea5][_0x646e('0x8c')]=_0x562b61[_0x4d4f40][_0x646e('0x8d')];_0xdb8634[_0x23cea5][_0x646e('0x8e')]={'type':_0x562b61[_0x4d4f40][_0x646e('0x50')],'values':_0x562b61[_0x4d4f40][_0x646e('0x8f')]};}Object['keys'](_0xdb8634)[_0x646e('0x45')](function(_0x48eaa9){if(!_0xdb8634[_0x48eaa9][_0x646e('0x2d')](_0x646e('0x89'))){delete _0xdb8634[_0x48eaa9];}});return _0xdb8634;});})[_0x646e('0x17')](respondWithResult(_0x428671,null))[_0x646e('0x85')](handleError(_0x428671,null));};exports['merge']=function(_0x13ec56,_0x59f169){var _0xfd752e;var _0x13af49;var _0x4aee6d;if(_0x13ec56[_0x646e('0x90')]['id']){delete _0x13ec56[_0x646e('0x90')]['id'];}return db[_0x646e('0x1c')][_0x646e('0x8b')]({'where':{'id':[_0x13ec56['body']['to'],_0x13ec56[_0x646e('0x90')]['from']]}})[_0x646e('0x17')](function(_0x60697){if(_0x60697){if(_0x60697[_0x646e('0x1f')]!==0x2){return null;}_0x60697[0x0]=_0x60697[0x0][_0x646e('0x91')]({'plain':!![]});_0x60697[0x1]=_0x60697[0x1]['get']({'plain':!![]});delete _0x60697[0x0]['id'];delete _0x60697[0x1]['id'];return _[_0x646e('0x92')](_0x60697[0x0],_0x60697[0x1],function(_0x20904f,_0x1fa657){if(Array[_0x646e('0x5d')](_0x1fa657)&&!_0x1fa657[_0x646e('0x1f')]){return _0x20904f;}else if(!_0x1fa657){return _0x20904f;}});}})[_0x646e('0x17')](handleEntityNotFound(_0x59f169,null))['then'](function(_0x3b8c4c){if(_0x3b8c4c){if(_0x3b8c4c[_0x646e('0x88')]&&_[_0x646e('0x5d')](_0x3b8c4c['tags'])){_0x3b8c4c[_0x646e('0x88')]=_0x3b8c4c[_0x646e('0x88')][_0x646e('0x93')]();}logger[_0x646e('0x94')](_0x646e('0x95'),_0x13ec56[_0x646e('0x90')]['to'],_0x13ec56['body']['from']);return db[_0x646e('0x96')][_0x646e('0x16')]({'where':{'ContactId':[_0x13ec56[_0x646e('0x90')]['to'],_0x13ec56[_0x646e('0x90')][_0x646e('0x35')]]}})['then'](function(_0x4d90f3){logger['info'](_0x646e('0x97'),_0x4d90f3);return db[_0x646e('0x98')][_0x646e('0x16')]({'where':{'ContactId':[_0x13ec56['body']['to'],_0x13ec56[_0x646e('0x90')][_0x646e('0x35')]]}})[_0x646e('0x17')](function(_0x40ab79){logger[_0x646e('0x94')](_0x646e('0x99'),_0x40ab79);return db[_0x646e('0x1c')][_0x646e('0x9a')](_0x3b8c4c);});});}})[_0x646e('0x17')](function(_0x1e81ef){if(_0x1e81ef){_0xfd752e=_0x1e81ef;_0x13af49={'ContactId':_0xfd752e['id']};_0x4aee6d={'where':{'ContactId':[_0x13ec56[_0x646e('0x90')]['to'],_0x13ec56[_0x646e('0x90')]['from']]}};return db['ChatInteraction'][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})['then'](function(){if(_0xfd752e){return db[_0x646e('0x9b')][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})['then'](function(){if(_0xfd752e){return db[_0x646e('0x9c')][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})[_0x646e('0x17')](function(){if(_0xfd752e){return db[_0x646e('0x9d')]['update'](_0x13af49,_0x4aee6d);}})[_0x646e('0x17')](function(){if(_0xfd752e){return db['MailMessage'][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})[_0x646e('0x17')](function(){if(_0xfd752e){return db['MailInteraction'][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})['then'](function(){if(_0xfd752e){return db['MailMessage'][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})[_0x646e('0x17')](function(){if(_0xfd752e){return db[_0x646e('0x9e')][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})[_0x646e('0x17')](function(){if(_0xfd752e){return db[_0x646e('0x9f')][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})['then'](function(){if(_0xfd752e){return db[_0x646e('0xa0')][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})['then'](function(){if(_0xfd752e){return db['FaxMessage'][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})['then'](function(){if(_0xfd752e){return db[_0x646e('0xa1')][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})[_0x646e('0x17')](function(){if(_0xfd752e){return db[_0x646e('0xa2')][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})[_0x646e('0x17')](function(){if(_0xfd752e){return db[_0x646e('0xa3')][_0x646e('0x15')]({'CmContactId':_0xfd752e['id']},{'where':{'CmContactId':[_0x13ec56[_0x646e('0x90')]['to'],_0x13ec56[_0x646e('0x90')]['from']]}});}})[_0x646e('0x17')](function(){if(_0xfd752e){return db[_0x646e('0xa4')][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})[_0x646e('0x17')](function(){if(_0xfd752e){return db[_0x646e('0xa5')][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})['then'](function(){if(_0xfd752e){return db[_0x646e('0xa6')][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})[_0x646e('0x17')](function(){if(_0xfd752e){return db[_0x646e('0xa7')]['update'](_0x13af49,_0x4aee6d);}})['then'](function(){if(_0xfd752e){return db[_0x646e('0xa8')][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})[_0x646e('0x17')](function(){if(_0xfd752e){return db['FaxQueueReport']['update'](_0x13af49,_0x4aee6d);}})[_0x646e('0x17')](function(){if(_0xfd752e){return db['MailQueueReport'][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})[_0x646e('0x17')](function(){if(_0xfd752e){return db[_0x646e('0xa9')][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})[_0x646e('0x17')](function(){if(_0xfd752e){return db[_0x646e('0xaa')]['update'](_0x13af49,_0x4aee6d);}})[_0x646e('0x17')](function(){if(_0xfd752e){return db[_0x646e('0xab')][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})[_0x646e('0x17')](function(){if(_0xfd752e){return db[_0x646e('0xac')][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})[_0x646e('0x17')](function(){if(_0xfd752e){return db[_0x646e('0xad')]['update'](_0x13af49,_0x4aee6d);}})[_0x646e('0x17')](function(){if(_0xfd752e){return db[_0x646e('0xae')][_0x646e('0x15')](_0x13af49,_0x4aee6d);}})[_0x646e('0x17')](function(){if(_0xfd752e){return db[_0x646e('0x1c')][_0x646e('0x16')]({'where':{'id':[_0x13ec56[_0x646e('0x90')]['to'],_0x13ec56[_0x646e('0x90')][_0x646e('0x35')]]}});}})[_0x646e('0x17')](function(){if(_0xfd752e){return _0xfd752e;}})[_0x646e('0x17')](respondWithResult(_0x59f169,null))[_0x646e('0x85')](handleError(_0x59f169,null));};exports[_0x646e('0x9a')]=function(_0x2545f7,_0xdb1b05){return db['CmContact'][_0x646e('0x1d')]()[_0x646e('0x17')](function(_0x5f3e1b){if(_0x2545f7[_0x646e('0x90')]['tags']&&_[_0x646e('0x5d')](_0x2545f7['body'][_0x646e('0x88')])){if(_0x2545f7[_0x646e('0x90')][_0x646e('0x88')][_0x646e('0x1f')]){_0x2545f7['body']['tags']=_0x2545f7[_0x646e('0x90')][_0x646e('0x88')][_0x646e('0x93')](';')+';';}else{_0x2545f7[_0x646e('0x90')][_0x646e('0x88')]=null;}}else{_0x2545f7['body'][_0x646e('0x88')]=null;}if(!_[_0x646e('0xaf')](_0x2545f7['body'][_0x646e('0xb0')])){var _0x59125f=_0x2545f7[_0x646e('0x90')]['dialTimezone'];if(!_[_0x646e('0xaf')](shared[_0x646e('0xb1')][_0x59125f]))_0x2545f7[_0x646e('0x90')][_0x646e('0xb2')]=shared[_0x646e('0xb1')][_0x59125f]['utcOffset'];}return db[_0x646e('0x1c')]['create'](_0x2545f7[_0x646e('0x90')],{'fields':_[_0x646e('0x1e')](_0x5f3e1b),'raw':!![]});})['then'](function(_0x486d2e){if(_0x2545f7['body']['additionalPhones']){return insertAdditionalPhones(_0x486d2e,_0x2545f7['body']['additionalPhones']);}else{return _0x486d2e;}})[_0x646e('0x17')](respondWithResult(_0xdb1b05,0xc9))[_0x646e('0x85')](handleError(_0xdb1b05,null));};exports['bulkCreate']=function(_0x1d15b0,_0x675e07){var _0x2b0ff7=0x0;var _0x57824e=0x0;var _0xa226d=0x0;var _0x5af6b6=[];return db['CmContact']['describe']()['then'](function(_0x462944){return BPromise[_0x646e('0xb3')](_0x1d15b0[_0x646e('0x90')],function(_0x4c24b8){var _0x37f9bb={'where':{'$or':[]},'defaults':_0x4c24b8,'fields':_[_0x646e('0x1e')](_0x462944),'raw':!![]};if(_0x4c24b8[_0x646e('0xb4')]){for(var _0x5361d7=0x0;_0x5361d7<_0x4c24b8[_0x646e('0xb4')][_0x646e('0x1f')];_0x5361d7++){var _0x584673={};_0x584673[_0x4c24b8[_0x646e('0xb4')][_0x5361d7]]=_0x4c24b8[_0x4c24b8[_0x646e('0xb4')][_0x5361d7]];_0x37f9bb[_0x646e('0x31')][_0x646e('0xb5')][_0x646e('0x55')](_0x584673);}_0x37f9bb[_0x646e('0x31')][_0x646e('0x57')]=_0x4c24b8[_0x646e('0x57')];}return db[_0x646e('0x1c')]['findOrCreate'](_0x37f9bb)[_0x646e('0xb6')](function(_0x3febdb,_0x192aba){if(_0x192aba){if(_0x4c24b8['hasOwnProperty']('additionalPhones')){_0x5af6b6[_0x646e('0x55')]({'contact':_0x3febdb,'additionalPhones':_0x4c24b8[_0x646e('0xb7')]});}_0x2b0ff7++;}else{_0xa226d++;}})[_0x646e('0x85')](function(){_0x57824e++;});});})[_0x646e('0x17')](function(_0x317f26){if(_0x317f26){if(_0x5af6b6[_0x646e('0x1f')]>0x0){return new Promise(function(_0x5fdf4,_0x9d94d){var _0x51a66c=[];for(var _0x20f138=0x0;_0x20f138<_0x5af6b6['length'];_0x20f138++){_0x51a66c[_0x646e('0x55')](insertAdditionalPhones(_0x5af6b6[_0x20f138][_0x646e('0xb8')],_0x5af6b6[_0x20f138]['additionalPhones']));}Promise['all'](_0x51a66c)['then'](function(){_0x5fdf4(0x1);});})[_0x646e('0x17')](function(){return{'success':_0x2b0ff7,'failure':_0x57824e,'duplicates':_0xa226d};});}else{return{'success':_0x2b0ff7,'failure':_0x57824e,'duplicates':_0xa226d};}}})['then'](respondWithResult(_0x675e07,0xc9))['catch'](handleError(_0x675e07,null));};exports[_0x646e('0xb9')]=function(_0x2ba48,_0x48efa6){var _0x7e72d6;return db[_0x646e('0x1c')]['describe']()[_0x646e('0x17')](function(_0x37f1fe){return db[_0x646e('0x1c')][_0x646e('0x86')]({'where':{'id':_0x2ba48['params']['id']},'include':[{'model':db[_0x646e('0x41')],'as':_0x646e('0x82'),'attributes':['id','name',_0x646e('0x34')],'required':_0x2ba48[_0x646e('0x28')][_0x646e('0x5c')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x646e('0xba'),'where':{'CmContactId':_0x2ba48[_0x646e('0x87')]['id']},'required':![],'include':[{'model':db[_0x646e('0xbb')],'as':_0x646e('0xbc')}]}],'order':[db[_0x646e('0x75')][_0x646e('0xbd')](_0x646e('0xbe'))],'attributes':_[_0x646e('0x1e')](_0x37f1fe)});})['then'](function(_0x3bd6c6){if(!_[_0x646e('0xaf')](_0x3bd6c6)){_0x7e72d6=_0x3bd6c6[_0x646e('0x91')]({'plain':!![]});var _0xa7526e={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3bd6c6&&_0x3bd6c6[_0x646e('0x57')]){if(_0x3bd6c6[_0x646e('0x57')]){_0xa7526e[_0x646e('0x31')][_0x646e('0xbf')]['push']({'ListId':{'$ne':_0x3bd6c6[_0x646e('0x57')]}});}}return db[_0x646e('0x22')][_0x646e('0x8b')](_0xa7526e);}})[_0x646e('0x17')](function(_0x3e2ba0){if(!_[_0x646e('0xaf')](_0x3e2ba0)){return _[_0x646e('0xc0')](_0x7e72d6,_[_0x646e('0x44')](_0x3e2ba0,function(_0x2eb984){return util['format'](_0x646e('0xc1'),_0x2eb984['id']);}));}})['then'](handleEntityNotFound(_0x48efa6,null))['then'](respondWithResult(_0x48efa6,null))['catch'](handleError(_0x48efa6,null));};exports['update']=function(_0x8b835,_0x3c258c){var _0x1a2935;if(_0x8b835[_0x646e('0x90')]['id']){delete _0x8b835[_0x646e('0x90')]['id'];}if(!_[_0x646e('0xaf')](_0x8b835[_0x646e('0x90')][_0x646e('0xb0')])){var _0x5d0c49=_0x8b835[_0x646e('0x90')]['dialTimezone'];if(!_[_0x646e('0xaf')](shared[_0x646e('0xb1')][_0x5d0c49]))_0x8b835[_0x646e('0x90')][_0x646e('0xb2')]=shared[_0x646e('0xb1')][_0x5d0c49][_0x646e('0xb2')];}return db[_0x646e('0x1c')][_0x646e('0x86')]({'where':{'id':_0x8b835['params']['id']}})['then'](handleEntityNotFound(_0x3c258c,null))['then'](saveUpdates(_0x8b835[_0x646e('0x90')],null))[_0x646e('0x17')](function(_0x417c2a){_0x1a2935=_0x417c2a;var _0xbefa58={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x417c2a&&_0x417c2a[_0x646e('0x57')]){if(_0x417c2a[_0x646e('0x57')]){_0xbefa58[_0x646e('0x31')][_0x646e('0xbf')][_0x646e('0x55')]({'ListId':{'$ne':_0x417c2a[_0x646e('0x57')]}});}}return db[_0x646e('0x22')]['findAll'](_0xbefa58);})[_0x646e('0x17')](function(_0x749e70){if(_0x749e70){return _[_0x646e('0xc0')](_[_0x646e('0xc2')](_0x8b835[_0x646e('0x90')],function(_0x13d3a1,_0x518b7d){return _[_0x646e('0x20')](_0x518b7d,_0x646e('0x21'));}),_['map'](_0x749e70,function(_0x12029a){return util['format'](_0x646e('0xc1'),_0x12029a['id']);}));}})[_0x646e('0x17')](function(_0x36cffc){if(_0x36cffc&&!_[_0x646e('0x56')](_0x36cffc)){var _0x3edd61=squel[_0x646e('0x15')]()[_0x646e('0xc3')]('cm_contacts')[_0x646e('0xc4')](_0x36cffc)[_0x646e('0x31')](_0x646e('0xc5'),_0x8b835[_0x646e('0x87')]['id'])[_0x646e('0xc6')]();return db[_0x646e('0x75')][_0x646e('0x28')](_0x3edd61['text'],{'replacements':_0x3edd61[_0x646e('0x8f')]});}})[_0x646e('0x17')](function(){if(_0x8b835[_0x646e('0x90')][_0x646e('0xc7')]&&_0x1a2935){return db[_0x646e('0x96')]['update']({'phone':_0x8b835[_0x646e('0x90')]['phone'],'OrderBy':0x0},{'where':{'ContactId':_0x1a2935['id']}});}})[_0x646e('0x17')](function(){return _0x1a2935;})[_0x646e('0x17')](respondWithResult(_0x3c258c,null))[_0x646e('0x85')](handleError(_0x3c258c,null));};exports[_0x646e('0xc8')]=function(_0x5bc550,_0x50d76e){var _0xed5ef7={};var _0x5a6c79={};var _0x409b41;var _0x15ec4d;return db[_0x646e('0x1c')][_0x646e('0x23')]({'where':{'id':_0x5bc550[_0x646e('0x87')]['id']}})[_0x646e('0x17')](handleEntityNotFound(_0x50d76e,null))[_0x646e('0x17')](function(_0x3dac78){if(_0x3dac78){_0x409b41=_0x3dac78;_0x5a6c79['model']=_[_0x646e('0x1e')](db[_0x646e('0x41')][_0x646e('0xc9')]);_0x5a6c79[_0x646e('0x28')]=_[_0x646e('0x1e')](_0x5bc550[_0x646e('0x28')]);_0x5a6c79['filters']=_[_0x646e('0x2a')](_0x5a6c79['model'],_0x5a6c79['query']);_0xed5ef7[_0x646e('0x2b')]=_[_0x646e('0x2a')](_0x5a6c79[_0x646e('0x27')],qs['fields'](_0x5bc550[_0x646e('0x28')][_0x646e('0x2c')]));_0xed5ef7[_0x646e('0x2b')]=_0xed5ef7[_0x646e('0x2b')][_0x646e('0x1f')]?_0xed5ef7[_0x646e('0x2b')]:_0x5a6c79[_0x646e('0x27')];_0xed5ef7[_0x646e('0x2f')]=qs[_0x646e('0x30')](_0x5bc550['query'][_0x646e('0x30')]);_0xed5ef7[_0x646e('0x31')]=qs[_0x646e('0x29')](_['pick'](_0x5bc550['query'],_0x5a6c79[_0x646e('0x29')]));if(_0x5bc550[_0x646e('0x28')][_0x646e('0x53')]){_0xed5ef7[_0x646e('0x31')]=_[_0x646e('0x78')](_0xed5ef7[_0x646e('0x31')],{'$or':_[_0x646e('0x44')](_0xed5ef7[_0x646e('0x2b')],function(_0xfa44d3){var _0x270b43={};_0x270b43[_0xfa44d3]={'$like':'%'+_0x5bc550[_0x646e('0x28')][_0x646e('0x53')]+'%'};return _0x270b43;})});}_0xed5ef7=_['merge']({},_0xed5ef7,_0x5bc550[_0x646e('0xca')]);return _0x409b41[_0x646e('0xc8')](_0xed5ef7);}})[_0x646e('0x17')](function(_0x36f79b){if(_0x36f79b){_0x15ec4d=_0x36f79b['length'];if(!_0x5bc550[_0x646e('0x28')]['hasOwnProperty'](_0x646e('0x2e'))){_0xed5ef7[_0x646e('0x11')]=qs[_0x646e('0x11')](_0x5bc550[_0x646e('0x28')][_0x646e('0x11')]);_0xed5ef7[_0x646e('0x10')]=qs[_0x646e('0x10')](_0x5bc550['query'][_0x646e('0x10')]);}return _0x409b41[_0x646e('0xc8')](_0xed5ef7);}})[_0x646e('0x17')](function(_0x3586fb){if(_0x3586fb){return _0x3586fb?{'count':_0x15ec4d,'rows':_0x3586fb}:null;}})[_0x646e('0x17')](respondWithResult(_0x50d76e,null))[_0x646e('0x85')](handleError(_0x50d76e,null));};exports[_0x646e('0xcb')]=function(_0x2cf119,_0x2f14dd){if(_0x2cf119[_0x646e('0x90')]['id']){delete _0x2cf119[_0x646e('0x90')]['id'];}return db[_0x646e('0x1c')]['findOne']({'where':{'id':_0x2cf119['params']['id']}})[_0x646e('0x17')](handleEntityNotFound(_0x2f14dd,null))['then'](function(_0x565ed3){if(_0x565ed3){return _0x565ed3[_0x646e('0xcb')](_0x2cf119[_0x646e('0x90')][_0x646e('0xcc')]||[]);}return null;})[_0x646e('0x17')](respondWithResult(_0x2f14dd,null))[_0x646e('0x85')](handleError(_0x2f14dd,null));};exports['setAdditionalPhones']=function(_0x6f1243,_0x5bcd4a){var _0x2b47ea=[];_0x2b47ea['push'](addAdditionalPhones(_0x6f1243[_0x646e('0x90')]));Promise['all'](_0x2b47ea)[_0x646e('0x17')](function(){_0x2b47ea=[];_0x2b47ea['push'](deleteCmHopperPhones(_0x6f1243[_0x646e('0x90')]['id']));_0x2b47ea[_0x646e('0x55')](addCmHopperPhones(_0x6f1243[_0x646e('0x90')]['id']));Promise['all'](_0x2b47ea)[_0x646e('0x17')](function(){return[0x1];})[_0x646e('0x17')](respondWithResult(_0x5bcd4a,null));});};function addAdditionalPhones(_0x40ae61){var _0x48cd5f;return new Promise(function(_0x6971b7,_0xba6758){return db[_0x646e('0xa3')][_0x646e('0x16')]({'where':{'CmContactId':_0x40ae61['id']}})['then'](function(){db[_0x646e('0xbb')][_0x646e('0x8b')]({'raw':!![],'attributes':['id',_0x646e('0xcd')]})[_0x646e('0x17')](function(_0x9dcbf3){var _0x1934e4=[];for(var _0x442a3b=0x0;_0x442a3b<_0x40ae61[_0x646e('0xce')][_0x646e('0x1f')];_0x442a3b++){var _0x473200=_0x40ae61[_0x646e('0xcf')]?_[_0x646e('0xaf')](_0x40ae61[_0x646e('0xcf')][_0x442a3b])?'':_0x40ae61['item_types'][_0x442a3b]:_0x40ae61['items'][_0x442a3b][_0x646e('0xd0')]?_0x40ae61[_0x646e('0xce')][_0x442a3b][_0x646e('0xd0')]:'';var _0x215679=_['isNil'](_0x40ae61[_0x646e('0xce')][_0x442a3b][_0x646e('0xd1')])?'':_0x40ae61[_0x646e('0xce')][_0x442a3b][_0x646e('0xd1')];var _0x333dae=_0x473200+':'+_0x40ae61[_0x646e('0xce')][_0x442a3b]['phone']+'§'+_0x215679;if(_[_0x646e('0xaf')](_0x48cd5f))_0x48cd5f=_0x333dae;else _0x48cd5f+=';'+_0x333dae;var _0x5ba348=null;if(_0x40ae61['item_types']){if(!_[_0x646e('0xaf')](_0x40ae61[_0x646e('0xcf')][_0x442a3b])){var _0xf2f867=_[_0x646e('0x86')](_0x9dcbf3,function(_0x18e4e3){return _0x18e4e3['id']===_0x40ae61[_0x646e('0xcf')][_0x442a3b];});if(!_[_0x646e('0xaf')](_0xf2f867)){_0x5ba348=_0xf2f867[_0x646e('0xcd')];}}}else{if(!_['isNil'](_0x40ae61[_0x646e('0xce')][_0x442a3b])){var _0xf2f867=_[_0x646e('0x86')](_0x9dcbf3,function(_0x2b0fc7){return _0x2b0fc7['id']===_0x40ae61[_0x646e('0xce')][_0x442a3b][_0x646e('0xd0')];});if(!_['isNil'](_0xf2f867)){_0x5ba348=_0x442a3b;}}}if(_[_0x646e('0xaf')](_0x5ba348)){_0x5ba348=0x64;}_0x1934e4['push'](addAdditionalPhone(_0x40ae61['id'],_0x40ae61[_0x646e('0xce')][_0x442a3b][_0x646e('0xc7')],_0x40ae61[_0x646e('0xcf')]?_[_0x646e('0xaf')](_0x40ae61[_0x646e('0xcf')][_0x442a3b])?null:_0x40ae61[_0x646e('0xcf')][_0x442a3b]:_0x40ae61[_0x646e('0xce')][_0x442a3b][_0x646e('0xd0')]?_0x40ae61[_0x646e('0xce')][_0x442a3b][_0x646e('0xd0')]:null,_0x5ba348,_0x215679));}Promise[_0x646e('0x25')](_0x1934e4)[_0x646e('0x17')](function(){db['CmContact'][_0x646e('0x15')]({'AdditionalPhones':_0x48cd5f},{'where':{'id':_0x40ae61['id']}})[_0x646e('0x17')](function(){_0x6971b7(0x1);});});});});});}function addAdditionalPhone(_0x432bec,_0x12fae4,_0x1ac1c7,_0x3553c0,_0x5d9ebc){return db['CmContactHasItem'][_0x646e('0x86')]({'where':{'CmContactId':_0x432bec,'item':_0x12fae4}})[_0x646e('0x17')](function(_0x364c91){if(_0x364c91)logger[_0x646e('0x94')](_0x646e('0xd2'),_0x364c91);else{db[_0x646e('0xa3')]['create']({'CmContactId':_0x432bec,'item':_0x12fae4,'ItemTypeId':_0x1ac1c7,'OrderBy':_0x3553c0,'ItemClass':_0x646e('0xd3'),'description':_0x5d9ebc});}});}function deletePhones(_0x336144){return db[_0x646e('0xa3')][_0x646e('0x16')]({'where':{'CmContactId':_0x336144}});}function deleteCmHopperPhones(_0x5006e6){return new Promise(function(_0x9929b2,_0x4ac13b){return db['CmHopper'][_0x646e('0x8b')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x5006e6}})[_0x646e('0x17')](function(_0x1429b2){db['CmHopperAdditionalPhone'][_0x646e('0x16')]({'where':{'CmHopperId':{'$in':_[_0x646e('0x44')](_0x1429b2,'id')}}});})['then'](function(){_0x9929b2(0x1);});});}function addCmHopperPhones(_0x16eb86){return new Promise(function(_0x342972,_0x593602){return db[_0x646e('0x96')][_0x646e('0x8b')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x16eb86}})[_0x646e('0x17')](function(_0x3c6779){var _0x8290f3=[];_[_0x646e('0x44')](_0x3c6779,function(_0x5e4ca6){_0x8290f3[_0x646e('0x55')](createCmHopperPhone(_0x16eb86,_0x5e4ca6['id']));});Promise['all'](_0x8290f3)['then'](function(){_0x342972(0x1);});});});}function createCmHopperPhone(_0x1b5cde,_0x30ba32){return new Promise(function(_0x2c7557,_0x565ab8){db[_0x646e('0xa3')][_0x646e('0x8b')]({'raw':!![],'attributes':[_0x646e('0xd4'),_0x646e('0xcd')],'where':{'CmContactId':_0x1b5cde,'ItemClass':'PHONE'},'include':[{'model':db['ContactItemType'],'attributes':[_0x646e('0xcd')],'as':_0x646e('0xbc')}],'order':[_0x646e('0xcd'),db[_0x646e('0x75')]['literal'](_0x646e('0xd5'))]})[_0x646e('0x17')](function(_0x45b9e3){var _0x156acd=0x1;var _0x346755=_[_0x646e('0x44')](_0x45b9e3,function(_0x1ba8da){_0x1ba8da[_0x646e('0xd6')]=_0x30ba32;_0x1ba8da[_0x646e('0xc7')]=_0x1ba8da[_0x646e('0xd4')];_0x1ba8da['OrderBy']=_0x156acd;delete _0x1ba8da[_0x646e('0xd7')];_0x156acd=_0x156acd+0x1;return _0x1ba8da;});return db['CmHopperAdditionalPhone']['bulkCreate'](_0x346755,{});})[_0x646e('0x17')](function(){_0x2c7557(0x1);});});}function insertAdditionalPhones(_0x147542,_0x2fb972){return new Promise(function(_0xca909d,_0x496f22){var _0x997187=[];for(var _0x2f60f6=0x0;_0x2f60f6<_0x2fb972[_0x646e('0x1f')];_0x2f60f6++){var _0x53ffdd=_0x2fb972[_0x2f60f6];_0x997187[_0x646e('0x55')](parseContactItemType(_0x53ffdd));}Promise[_0x646e('0x25')](_0x997187)[_0x646e('0x17')](function(){var _0x3dc7ed={'id':_0x147542['id'],'items':_0x2fb972};return addAdditionalPhones(_0x3dc7ed)[_0x646e('0x17')](function(_0x150fa5){return addCmHopperPhones(_0x147542['id']);});})[_0x646e('0x17')](function(){_0xca909d(_0x147542);});});}function parseContactItemType(_0x1b1ae2){return new Promise(function(_0x3e4ae4,_0x1ba652){if(_0x1b1ae2['hasOwnProperty'](_0x646e('0xd0'))){_0x3e4ae4(_0x1b1ae2);}else{return db[_0x646e('0xbb')][_0x646e('0x86')]({'where':{'name':_0x1b1ae2[_0x646e('0xbc')]}})[_0x646e('0x17')](function(_0x5ccb63){if(_[_0x646e('0xaf')](_0x5ccb63))_0x1b1ae2[_0x646e('0xd0')]=null;else _0x1b1ae2['ItemTypeId']=_0x5ccb63['id'];_0x3e4ae4(_0x1b1ae2);});}});}exports[_0x646e('0xd8')]=function(_0x111a72,_0x2edd10){return db['CmContactHasItem'][_0x646e('0x8b')]({'raw':!![],'where':{'CmContactId':_0x111a72['params']['id'],'ItemClass':_0x646e('0xd3')},'include':[{'model':db[_0x646e('0xbb')],'as':_0x646e('0xbc')}],'order':[[_0x646e('0xcd')],[db[_0x646e('0x75')][_0x646e('0xbd')](_0x646e('0xd5'))]]})[_0x646e('0x17')](function(_0x15802b){return _0x15802b;})[_0x646e('0x17')](respondWithResult(_0x2edd10,null))[_0x646e('0x85')](handleError(_0x2edd10,null));};exports[_0x646e('0xd9')]=function(_0x5910fd,_0x148fa4){return db[_0x646e('0xa3')][_0x646e('0x8b')]({'raw':!![],'where':{'CmContactId':_0x5910fd[_0x646e('0x90')][_0x646e('0xda')]}})[_0x646e('0x17')](function(_0x506a67){var _0x25a252=_[_0x646e('0x44')](_0x506a67,function(_0x753d0b){_0x753d0b[_0x646e('0xdb')]=_0x5910fd[_0x646e('0x90')][_0x646e('0xdc')];return _0x753d0b;});return db['CmContactHasItem']['bulkCreate'](_0x25a252,{});})[_0x646e('0x17')](function(_0x582fe9){return addCmHopperPhones(_0x5910fd[_0x646e('0x90')]['toContactId']);})[_0x646e('0x17')](function(_0xdfd8dd){return['ok'];})[_0x646e('0x17')](respondWithResult(_0x148fa4,null))[_0x646e('0x85')](handleError(_0x148fa4,null));};exports[_0x646e('0xdd')]=function(_0x1c55df,_0x596c49){var _0x352006=[];_0x352006['push'](createCmHopperPhone(_0x1c55df[_0x646e('0x90')]['id'],_0x1c55df[_0x646e('0x90')][_0x646e('0xde')]));Promise['all'](_0x352006)[_0x646e('0x17')](function(){return[0x1];})[_0x646e('0x17')](respondWithResult(_0x596c49,null));};exports[_0x646e('0xdf')]=function(_0x17c4c7,_0x15c327){var _0x1161cd={'raw':![],'where':{}};var _0x4bdf66={};var _0x1e15d5={'count':0x0,'rows':[]};return db[_0x646e('0x1c')][_0x646e('0x23')]({'where':{'id':_0x17c4c7[_0x646e('0x87')]['id']}})[_0x646e('0x17')](handleEntityNotFound(_0x15c327,null))['then'](function(_0x2ed62a){if(_0x2ed62a){_0x4bdf66[_0x646e('0x27')]=_['keys'](db[_0x646e('0x96')][_0x646e('0xc9')]);_0x4bdf66['query']=_[_0x646e('0x1e')](_0x17c4c7[_0x646e('0x28')]);_0x4bdf66[_0x646e('0x29')]=_[_0x646e('0x2a')](_0x4bdf66['model'],_0x4bdf66['query']);_0x1161cd[_0x646e('0x2b')]=_[_0x646e('0x2a')](_0x4bdf66[_0x646e('0x27')],qs['fields'](_0x17c4c7[_0x646e('0x28')]['fields']));_0x1161cd[_0x646e('0x2b')]=_0x1161cd[_0x646e('0x2b')][_0x646e('0x1f')]?_0x1161cd[_0x646e('0x2b')]:_0x4bdf66[_0x646e('0x27')];if(!_0x17c4c7['query'][_0x646e('0x2d')]('nolimit')){_0x1161cd[_0x646e('0x11')]=qs[_0x646e('0x11')](_0x17c4c7[_0x646e('0x28')][_0x646e('0x11')]);_0x1161cd[_0x646e('0x10')]=qs[_0x646e('0x10')](_0x17c4c7[_0x646e('0x28')][_0x646e('0x10')]);}_0x1161cd[_0x646e('0x2f')]=qs[_0x646e('0x30')](_0x17c4c7[_0x646e('0x28')]['sort']);_0x1161cd[_0x646e('0x31')]=qs[_0x646e('0x29')](_[_0x646e('0xe0')](_0x17c4c7[_0x646e('0x28')],_0x4bdf66[_0x646e('0x29')]));_0x1161cd['where'][_0x646e('0xe1')]=_0x2ed62a['id'];if(_0x17c4c7['query']['filter']){_0x1161cd[_0x646e('0x31')]=_['merge'](_0x1161cd['where'],{'$or':_[_0x646e('0x44')](_0x1161cd[_0x646e('0x2b')],function(_0x38f059){var _0x43f26f={};_0x43f26f[_0x38f059]={'$like':'%'+_0x17c4c7[_0x646e('0x28')][_0x646e('0x53')]+'%'};return _0x43f26f;})});}_0x1161cd=_['merge']({},_0x1161cd,_0x17c4c7[_0x646e('0xca')]);return db['CmHopper']['count']({'where':_0x1161cd[_0x646e('0x31')]})['then'](function(_0x53ca56){_0x1e15d5[_0x646e('0x12')]=_0x53ca56;if(_0x17c4c7[_0x646e('0x28')]['includeAll']){_0x1161cd[_0x646e('0xe2')]=[{'all':!![]}];}return db[_0x646e('0x96')][_0x646e('0x8b')](_0x1161cd);})['then'](function(_0x262190){_0x1e15d5[_0x646e('0x84')]=_0x262190;return _0x1e15d5;});}})[_0x646e('0x17')](respondWithFilteredResult(_0x15c327,_0x1161cd))['catch'](handleError(_0x15c327,null));};exports['getHopperHistories']=function(_0x57573d,_0x3c4d70){var _0x51ddaa={'raw':!![],'where':{}};var _0x371533={};var _0x2a2207={'count':0x0,'rows':[]};return db[_0x646e('0x1c')][_0x646e('0x23')]({'where':{'id':_0x57573d[_0x646e('0x87')]['id']}})['then'](handleEntityNotFound(_0x3c4d70,null))[_0x646e('0x17')](function(_0x413488){if(_0x413488){_0x371533['model']=_[_0x646e('0x1e')](db[_0x646e('0xa5')]['rawAttributes']);_0x371533['query']=_[_0x646e('0x1e')](_0x57573d[_0x646e('0x28')]);_0x371533['filters']=_[_0x646e('0x2a')](_0x371533[_0x646e('0x27')],_0x371533[_0x646e('0x28')]);_0x51ddaa[_0x646e('0x2b')]=_[_0x646e('0x2a')](_0x371533[_0x646e('0x27')],qs[_0x646e('0x2c')](_0x57573d[_0x646e('0x28')][_0x646e('0x2c')]));_0x51ddaa[_0x646e('0x2b')]=_0x51ddaa[_0x646e('0x2b')][_0x646e('0x1f')]?_0x51ddaa[_0x646e('0x2b')]:_0x371533[_0x646e('0x27')];if(!_0x57573d['query'][_0x646e('0x2d')](_0x646e('0x2e'))){_0x51ddaa[_0x646e('0x11')]=qs[_0x646e('0x11')](_0x57573d[_0x646e('0x28')]['limit']);_0x51ddaa[_0x646e('0x10')]=qs['offset'](_0x57573d[_0x646e('0x28')][_0x646e('0x10')]);}_0x51ddaa[_0x646e('0x2f')]=qs[_0x646e('0x30')](_0x57573d['query']['sort']);_0x51ddaa[_0x646e('0x31')]=qs[_0x646e('0x29')](_[_0x646e('0xe0')](_0x57573d[_0x646e('0x28')],_0x371533[_0x646e('0x29')]));_0x51ddaa[_0x646e('0x31')][_0x646e('0xe1')]=_0x413488['id'];if(_0x57573d[_0x646e('0x28')]['filter']){_0x51ddaa[_0x646e('0x31')]=_[_0x646e('0x78')](_0x51ddaa[_0x646e('0x31')],{'$or':_[_0x646e('0x44')](_0x51ddaa[_0x646e('0x2b')],function(_0x40ec2d){var _0x373257={};_0x373257[_0x40ec2d]={'$like':'%'+_0x57573d[_0x646e('0x28')][_0x646e('0x53')]+'%'};return _0x373257;})});}_0x51ddaa=_[_0x646e('0x78')]({},_0x51ddaa,_0x57573d['options']);return db['CmHopperHistory'][_0x646e('0x12')]({'where':_0x51ddaa[_0x646e('0x31')]})[_0x646e('0x17')](function(_0x470eb5){_0x2a2207[_0x646e('0x12')]=_0x470eb5;if(_0x57573d[_0x646e('0x28')][_0x646e('0xe3')]){_0x51ddaa[_0x646e('0xe2')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x646e('0x8b')](_0x51ddaa);})[_0x646e('0x17')](function(_0x1d9957){_0x2a2207[_0x646e('0x84')]=_0x1d9957;return _0x2a2207;});}})[_0x646e('0x17')](respondWithFilteredResult(_0x3c4d70,_0x51ddaa))[_0x646e('0x85')](handleError(_0x3c4d70,null));};exports['getHopperFinals']=function(_0x2f16e7,_0x346700){var _0xa63fa7={'raw':!![],'where':{}};var _0x5bef57={};var _0x25ec83={'count':0x0,'rows':[]};return db[_0x646e('0x1c')][_0x646e('0x23')]({'where':{'id':_0x2f16e7[_0x646e('0x87')]['id']}})[_0x646e('0x17')](handleEntityNotFound(_0x346700,null))[_0x646e('0x17')](function(_0xa0ba05){if(_0xa0ba05){_0x5bef57[_0x646e('0x27')]=_[_0x646e('0x1e')](db['CmHopperFinal'][_0x646e('0xc9')]);_0x5bef57['query']=_[_0x646e('0x1e')](_0x2f16e7[_0x646e('0x28')]);_0x5bef57[_0x646e('0x29')]=_[_0x646e('0x2a')](_0x5bef57['model'],_0x5bef57[_0x646e('0x28')]);_0xa63fa7[_0x646e('0x2b')]=_[_0x646e('0x2a')](_0x5bef57[_0x646e('0x27')],qs[_0x646e('0x2c')](_0x2f16e7[_0x646e('0x28')][_0x646e('0x2c')]));_0xa63fa7[_0x646e('0x2b')]=_0xa63fa7[_0x646e('0x2b')][_0x646e('0x1f')]?_0xa63fa7[_0x646e('0x2b')]:_0x5bef57[_0x646e('0x27')];if(!_0x2f16e7['query'][_0x646e('0x2d')](_0x646e('0x2e'))){_0xa63fa7[_0x646e('0x11')]=qs['limit'](_0x2f16e7[_0x646e('0x28')][_0x646e('0x11')]);_0xa63fa7[_0x646e('0x10')]=qs[_0x646e('0x10')](_0x2f16e7['query'][_0x646e('0x10')]);}_0xa63fa7[_0x646e('0x2f')]=qs[_0x646e('0x30')](_0x2f16e7[_0x646e('0x28')][_0x646e('0x30')]);_0xa63fa7['where']=qs[_0x646e('0x29')](_[_0x646e('0xe0')](_0x2f16e7[_0x646e('0x28')],_0x5bef57[_0x646e('0x29')]));_0xa63fa7['where'][_0x646e('0xe1')]=_0xa0ba05['id'];if(_0x2f16e7[_0x646e('0x28')]['filter']){_0xa63fa7[_0x646e('0x31')]=_['merge'](_0xa63fa7['where'],{'$or':_['map'](_0xa63fa7[_0x646e('0x2b')],function(_0x1c0af1){var _0x5ad557={};_0x5ad557[_0x1c0af1]={'$like':'%'+_0x2f16e7[_0x646e('0x28')]['filter']+'%'};return _0x5ad557;})});}_0xa63fa7=_[_0x646e('0x78')]({},_0xa63fa7,_0x2f16e7['options']);return db[_0x646e('0xa4')][_0x646e('0x12')]({'where':_0xa63fa7[_0x646e('0x31')]})['then'](function(_0x59daae){_0x25ec83[_0x646e('0x12')]=_0x59daae;if(_0x2f16e7['query'][_0x646e('0xe3')]){_0xa63fa7[_0x646e('0xe2')]=[{'all':!![]}];}return db[_0x646e('0xa4')][_0x646e('0x8b')](_0xa63fa7);})[_0x646e('0x17')](function(_0x349645){_0x25ec83[_0x646e('0x84')]=_0x349645;return _0x25ec83;});}})[_0x646e('0x17')](respondWithFilteredResult(_0x346700,_0xa63fa7))[_0x646e('0x85')](handleError(_0x346700,null));};exports[_0x646e('0xe4')]=function(_0x45a6a6,_0x3f60c7){var _0x58646b={'raw':!![],'where':{}};var _0x2b9b9e={};var _0x1e57e5={'count':0x0,'rows':[]};return db[_0x646e('0x1c')][_0x646e('0x23')]({'where':{'id':_0x45a6a6[_0x646e('0x87')]['id']}})[_0x646e('0x17')](handleEntityNotFound(_0x3f60c7,null))[_0x646e('0x17')](function(_0x3b33aa){if(_0x3b33aa){_0x2b9b9e[_0x646e('0x27')]=_[_0x646e('0x1e')](db[_0x646e('0xab')][_0x646e('0xc9')]);_0x2b9b9e[_0x646e('0x28')]=_[_0x646e('0x1e')](_0x45a6a6['query']);_0x2b9b9e[_0x646e('0x29')]=_[_0x646e('0x2a')](_0x2b9b9e[_0x646e('0x27')],_0x2b9b9e[_0x646e('0x28')]);_0x58646b[_0x646e('0x2b')]=_[_0x646e('0x2a')](_0x2b9b9e['model'],qs[_0x646e('0x2c')](_0x45a6a6[_0x646e('0x28')][_0x646e('0x2c')]));_0x58646b[_0x646e('0x2b')]=_0x58646b[_0x646e('0x2b')]['length']?_0x58646b[_0x646e('0x2b')]:_0x2b9b9e[_0x646e('0x27')];if(!_0x45a6a6[_0x646e('0x28')][_0x646e('0x2d')](_0x646e('0x2e'))){_0x58646b[_0x646e('0x11')]=qs['limit'](_0x45a6a6[_0x646e('0x28')][_0x646e('0x11')]);_0x58646b[_0x646e('0x10')]=qs[_0x646e('0x10')](_0x45a6a6[_0x646e('0x28')][_0x646e('0x10')]);}_0x58646b[_0x646e('0x2f')]=qs[_0x646e('0x30')](_0x45a6a6[_0x646e('0x28')][_0x646e('0x30')]);_0x58646b['where']=qs['filters'](_[_0x646e('0xe0')](_0x45a6a6['query'],_0x2b9b9e[_0x646e('0x29')]));_0x58646b['where'][_0x646e('0xe1')]=_0x3b33aa['id'];if(_0x45a6a6[_0x646e('0x28')][_0x646e('0x53')]){_0x58646b[_0x646e('0x31')]=_[_0x646e('0x78')](_0x58646b[_0x646e('0x31')],{'$or':_[_0x646e('0x44')](_0x58646b[_0x646e('0x2b')],function(_0x51bda5){var _0x33601c={};_0x33601c[_0x51bda5]={'$like':'%'+_0x45a6a6[_0x646e('0x28')][_0x646e('0x53')]+'%'};return _0x33601c;})});}_0x58646b=_[_0x646e('0x78')]({},_0x58646b,_0x45a6a6['options']);return db[_0x646e('0xab')][_0x646e('0x12')]({'where':_0x58646b[_0x646e('0x31')]})[_0x646e('0x17')](function(_0x129612){_0x1e57e5['count']=_0x129612;if(_0x45a6a6['query']['includeAll']){_0x58646b[_0x646e('0xe2')]=[{'all':!![]}];}return db[_0x646e('0xab')][_0x646e('0x8b')](_0x58646b);})['then'](function(_0x476efd){_0x1e57e5[_0x646e('0x84')]=_0x476efd;return _0x1e57e5;});}})['then'](respondWithFilteredResult(_0x3f60c7,_0x58646b))['catch'](handleError(_0x3f60c7,null));};exports[_0x646e('0xe5')]=function(_0x3e43b6,_0x22e4bf){try{if(!_0x3e43b6[_0x646e('0x90')][_0x646e('0x57')]){throw new Error(_0x646e('0xe6'));}if(!_0x3e43b6[_0x646e('0x90')]['binding_keys']){throw new Error(_0x646e('0xe7'));}if(!_0x3e43b6[_0x646e('0x90')][_0x646e('0xe8')]){throw new Error(_0x646e('0xe9'));}if(!_0x3e43b6[_0x646e('0x90')][_0x646e('0xea')]){throw new Error(_0x646e('0xeb'));}var _0x631759=_0x3e43b6['body']['binding_keys'][_0x646e('0x43')](',');var _0x4d1b6c=_0x3e43b6[_0x646e('0x90')][_0x646e('0xe8')][_0x646e('0x43')](',');if(!_0x631759[_0x646e('0x1f')]||!_0x4d1b6c[_0x646e('0x1f')]||_0x631759['length']!==_0x4d1b6c[_0x646e('0x1f')]){throw new Error(_0x646e('0xec'));}_0x3e43b6[_0x646e('0x90')][_0x646e('0x2c')]=_['zipObject'](_0x631759,_0x4d1b6c);if(!_0x3e43b6[_0x646e('0x90')][_0x646e('0x2c')][_0x646e('0xc7')]){throw new Error(_0x646e('0xed'));}if(!_0x3e43b6['body'][_0x646e('0x2c')][_0x646e('0xee')]){throw new Error(_0x646e('0xef'));}var _0x364a2c=path[_0x646e('0x93')](config[_0x646e('0xf0')],'server/files/tmp',_0x3e43b6[_0x646e('0xf1')][_0x646e('0xf2')]);fs[_0x646e('0xf3')](_0x364a2c,parseInt('0777',0x8));var _0x4ccda9=require('child_process')[_0x646e('0xf4')](path['join'](__dirname,_0x646e('0xf5')),[_0x364a2c,_0x3e43b6[_0x646e('0x90')][_0x646e('0xf6')],_0x3e43b6[_0x646e('0x90')][_0x646e('0xe8')],_0x3e43b6[_0x646e('0x90')][_0x646e('0x57')],_0x3e43b6[_0x646e('0x90')][_0x646e('0xf7')],_0x3e43b6['body'][_0x646e('0xb4')],_0x3e43b6[_0x646e('0x90')]['socket_timestamp']]);return _0x22e4bf['status'](0xc8)['json']({'message':_0x646e('0xf8'),'pid':_0x4ccda9[_0x646e('0xf9')]});}catch(_0x2001e4){return _0x22e4bf[_0x646e('0x13')](0x1f4)[_0x646e('0x1b')](_0x2001e4);}};exports[_0x646e('0xfa')]=function(_0x209323,_0x601057){var _0x434b16=fs[_0x646e('0xfb')](_0x209323[_0x646e('0xf1')][_0x646e('0x2')]);Papa[_0x646e('0xfc')](_0x434b16,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x225204){return _0x601057[_0x646e('0x13')](0xc8)[_0x646e('0xf')]({'file':_0x209323['file'],'fields':_0x225204[_0x646e('0xfd')][_0x646e('0x2c')]});}});};exports[_0x646e('0xfe')]=function(_0x1fab22,_0x2f9a49){return db[_0x646e('0x48')][_0x646e('0x8b')]({'raw':!![],'attributes':['id'],'where':{'role':_0x646e('0x74')}})[_0x646e('0x17')](function(_0x4e5260){var _0x14dd14=![];if(!_0x1fab22['body']['ListId']){throw new Error(_0x646e('0xe6'));}if(!_0x1fab22['body'][_0x646e('0xff')][_0x646e('0xc7')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x1fab22['body'][_0x646e('0xff')][_0x646e('0xee')]){throw new Error(_0x646e('0xef'));}if(!_0x1fab22[_0x646e('0x90')][_0x646e('0xea')]){throw new Error(_0x646e('0xeb'));}var _0x4e3782=require(_0x646e('0x100'))['fork'](path[_0x646e('0x93')](__dirname,'../../components/import/cm/csv2'),[_0x1fab22[_0x646e('0x87')]['id'],JSON['stringify'](_0x1fab22['body']),JSON['stringify'](_0x4e5260)]);_0x4e3782['on'](_0x646e('0x101'),function(){_0x14dd14=!![];return _0x2f9a49[_0x646e('0x13')](0xc8)['json']({'message':_0x646e('0x102'),'pid':_0x4e3782[_0x646e('0xf9')]});});_0x4e3782['on']('exit',function(_0x136bfc){if(_0x136bfc&&!_0x14dd14){return _0x2f9a49[_0x646e('0x13')](0x1f4)['json']({'message':_0x646e('0x103'),'pid':_0x4e3782[_0x646e('0xf9')]});}});})[_0x646e('0x85')](handleError(_0x2f9a49,null));};exports[_0x646e('0x104')]=function(_0x26749d,_0x48d6cd,_0x5c85c3){return db[_0x646e('0x48')][_0x646e('0x8b')]({'raw':!![],'attributes':['id'],'where':{'role':_0x646e('0x74')}})['then'](function(_0x50cb5f){var _0x49994f=![];if(!_0x26749d[_0x646e('0x90')][_0x646e('0x57')]){throw new Error(_0x646e('0xe6'));}if(!_0x26749d[_0x646e('0x90')][_0x646e('0xff')][_0x646e('0xc7')]){throw new Error(_0x646e('0xed'));}if(!_0x26749d[_0x646e('0x90')][_0x646e('0xff')][_0x646e('0xee')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x26749d[_0x646e('0x90')][_0x646e('0xea')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x3e10a7=require('child_process')[_0x646e('0xf4')](path[_0x646e('0x93')](__dirname,_0x646e('0x105')),[_0x26749d[_0x646e('0x87')]['id'],JSON[_0x646e('0x106')](_0x26749d[_0x646e('0x90')]),JSON['stringify'](_0x50cb5f)]);_0x3e10a7['on'](_0x646e('0x101'),function(_0x33943d){_0x49994f=!![];return _0x48d6cd[_0x646e('0x13')](0xc8)[_0x646e('0xf')]({'message':_0x646e('0x102'),'pid':_0x3e10a7[_0x646e('0xf9')]});});_0x3e10a7['on'](_0x646e('0x107'),function(_0x166237){if(_0x166237&&!_0x49994f){return _0x48d6cd[_0x646e('0x13')](0x1f4)['json']({'message':'error\x20child\x20process','pid':_0x3e10a7[_0x646e('0xf9')]});}});})[_0x646e('0x85')](handleError(_0x48d6cd,null));};exports['getJourney']=function(_0x171022,_0x3977cd){var _0x37e5a9=[_0x646e('0x108'),_0x646e('0x109'),'sms',_0x646e('0x10a'),_0x646e('0x10b'),'whatsapp',_0x646e('0x10c')];var _0x41d282={'offset':0x0,'order':qs[_0x646e('0x30')](_0x646e('0x10d'))},_0xeeca68={'count':0x0,'rows':[]};Promise['resolve']()[_0x646e('0x17')](function(){if(_0x171022[_0x646e('0x28')][_0x646e('0x10e')]){if(!_[_0x646e('0x10f')](_0x37e5a9,_0x171022[_0x646e('0x28')][_0x646e('0x10e')][_0x646e('0x110')]())){throw new Error(_0x646e('0x111'));}_0x37e5a9=[_0x171022[_0x646e('0x28')]['channel'][_0x646e('0x110')]()];}if(_0x171022[_0x646e('0x28')][_0x646e('0x112')]){try{var _0x452e87=JSON[_0x646e('0xfc')](_0x171022[_0x646e('0x28')][_0x646e('0x112')]);if(!moment(_0x452e87[_0x646e('0x35')])[_0x646e('0x113')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x452e87['to'])['isValid']()){throw new Error(_0x646e('0x114'));}}catch(_0x52a6ec){throw new Error(_0x646e('0x115'));}}if(!_0x171022[_0x646e('0x28')]['hasOwnProperty'](_0x646e('0x2e'))){_0x41d282[_0x646e('0x11')]=qs[_0x646e('0x11')](_0x171022[_0x646e('0x28')][_0x646e('0x11')]||0xa);_0x41d282[_0x646e('0x10')]=qs[_0x646e('0x10')](_0x171022['query']['offset']);}var _0x4f3c8e=_0x37e5a9[_0x646e('0x44')](function(_0x1913f4){if(_0x1913f4==='voice'){var _0x50077d={'attributes':['id',_0x646e('0x116'),_0x646e('0x50'),_0x646e('0x117'),_0x646e('0x118'),_0x646e('0x119'),_0x646e('0x11a'),_0x646e('0x11b'),_0x646e('0x11c'),'note',_0x646e('0x11d'),_0x646e('0x11e'),'userSecondDisposition',_0x646e('0x11f'),_0x646e('0x120')],'where':{'ContactId':_0x171022[_0x646e('0x87')]['id']},'include':[{'model':db['User'],'as':'User','attributes':['id',_0x646e('0x1a'),_0x646e('0x121'),'alias']}],'order':[[_0x646e('0x11d'),'DESC']]};if(_0x171022[_0x646e('0x28')][_0x646e('0x112')]){_0x50077d[_0x646e('0x31')][_0x646e('0x11d')]={'$gte':_0x452e87[_0x646e('0x35')],'$lte':_0x452e87['to']};}return db[_0x646e('0xa7')][_0x646e('0x122')](_0x50077d)['then'](function(_0x2da879){_0xeeca68[_0x646e('0x12')]+=_0x2da879[_0x646e('0x12')];return _[_0x646e('0x44')](_0x2da879[_0x646e('0x84')],function(_0x5c4697){var _0x2ef28b=_0x5c4697[_0x646e('0x91')]({'plain':!![]});_0x2ef28b[_0x646e('0x10e')]=_0x1913f4;if(_0x2ef28b['User']){_0x2ef28b[_0x646e('0x48')]={'id':_0x2ef28b[_0x646e('0x48')]['id'],'name':_0x2ef28b[_0x646e('0x48')][_0x646e('0x1a')],'fullname':_0x2ef28b[_0x646e('0x48')][_0x646e('0x121')],'alias':_0x2ef28b[_0x646e('0x48')][_0x646e('0x8d')]};}return _0x2ef28b;});});}else{var _0x3c9ec0=_['startCase'](_0x1913f4)+(_0x1913f4===_0x646e('0x109')?'Website':'Account');var _0x5968c0={'attributes':['id',_0x646e('0x123'),'closedAt',_0x646e('0x11d'),_0x646e('0x124'),_0x646e('0x125'),_0x646e('0x126'),_0x646e('0x127'),_0x646e('0x120'),_0x3c9ec0+'Id'],'where':{'ContactId':_0x171022[_0x646e('0x87')]['id']},'include':[{'model':db[_0x3c9ec0],'as':_0x646e('0x128'),'attributes':['id',_0x646e('0x1a'),_0x646e('0x129')]},{'model':db[_0x646e('0x48')],'as':'Owner','attributes':['id',_0x646e('0x1a'),'fullname']},{'model':db[_0x646e('0x41')],'as':'Tags','attributes':['id',_0x646e('0x1a'),_0x646e('0x34')],'through':{'attributes':[]}}],'order':[['createdAt',_0x646e('0x6c')]]};if(_0x171022[_0x646e('0x28')][_0x646e('0x112')]){_0x5968c0['where'][_0x646e('0x11d')]={'$gte':_0x452e87[_0x646e('0x35')],'$lte':_0x452e87['to']};}switch(_0x1913f4){case _0x646e('0x109'):_0x5968c0[_0x646e('0x2b')][_0x646e('0x55')](_0x646e('0x12a'),_0x646e('0x12b'),'customerPort',_0x646e('0x12c'),_0x646e('0x12d'),_0x646e('0x12e'),_0x646e('0x12f'),'ratingValue',_0x646e('0x130'));break;case _0x646e('0x108'):_0x5968c0[_0x646e('0x2b')]['push'](_0x646e('0x131'),'substatus');break;case _0x646e('0x10a'):_0x5968c0[_0x646e('0x2b')][_0x646e('0x55')](_0x646e('0x132'),_0x646e('0x133'));break;}return db[_[_0x646e('0x134')](_0x1913f4)+_0x646e('0x135')][_0x646e('0x122')](_0x5968c0)[_0x646e('0x17')](function(_0x1dea8c){_0xeeca68[_0x646e('0x12')]+=_0x1dea8c[_0x646e('0x12')];return _[_0x646e('0x44')](_0x1dea8c[_0x646e('0x84')],function(_0x19d11e){var _0x382fc9=_0x19d11e[_0x646e('0x91')]({'plain':!![]});_0x382fc9['channel']=_0x1913f4;if(_0x382fc9[_0x646e('0x136')]){_0x382fc9[_0x646e('0x136')]={'id':_0x382fc9[_0x646e('0x136')]['id'],'name':_0x382fc9[_0x646e('0x136')][_0x646e('0x1a')],'fullname':_0x382fc9[_0x646e('0x136')][_0x646e('0x121')]};}return _0x382fc9;});});}});return Promise[_0x646e('0x25')](_0x4f3c8e);})['then'](function(_0x2232aa){return _(_0x2232aa)[_0x646e('0x137')]()[_0x646e('0x138')](_0x646e('0x11d'))[_0x646e('0x139')]()[_0x646e('0x42')]();})[_0x646e('0x17')](function(_0x306db7){_0xeeca68['rows']=_0x41d282[_0x646e('0x11')]?_0x306db7[_0x646e('0x13a')](_0x41d282[_0x646e('0x10')],_0x41d282['offset']+_0x41d282[_0x646e('0x11')]):_0x306db7;return _0xeeca68;})[_0x646e('0x17')](respondWithFilteredResult(_0x3977cd,_0x41d282))[_0x646e('0x85')](handleError(_0x3977cd,null));};
\ No newline at end of file
+var _0x0c33=['tools_tags','c.deletedAt\x20IS\x20NULL','search','sqlOperator','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','and','datetime','castTo','DATE','buildExpression','type','text','start','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','group','Sequelize','QueryTypes','clone','c.id','having','t.id\x20IN\x20?','resolve','some','User','getLists','c.ListId\x20IS\x20NULL','user','role','agent','sequelize','toString','merge','c.firstName','c.fax','c.ListId','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','destroy','params','catch','tags','startsWith','columnName','displayName','CmCustomField','findAll','custom','values','body','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','info','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','$or','findOrCreate','contact','show','CmContactHasItem','Phones','ContactItemType','ItemType','Phones.OrderBy','$and','format','cf_%d','omit','table','setFields','toParam','phone','CmHopper','getTags','rawAttributes','options','setTags','ids','item_types','items','ItemTypeId','description','OrderBy','contact\x20phone\x20exists','PHONE','literal','CmHopperId','ItemType.OrderBy','CmHopperAdditionalPhone','getAdditionalPhones','`ItemType`.OrderBy','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','hopperId','ContactId','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','createReadStream','parse','binding','child_process','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','importUpdates','../../components/import/cm/csvUpdates','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','includes','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','starttime','duration','note','createdAt','userDisposition','userSecondDisposition','DESC','findAndCountAll','fullname','alias','startCase','Account','closed','closedAt','secondDisposition','thirdDisposition','key','Owner','customerIp','customerPort','ratingMessage','ratingType','referer','subject','externalUrl','threadId','flatten','sortBy','reverse','slice','moment','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','undefined','limit','count','offset','set','Content-Range','json','update','then','end','sendStatus','error','stack','name','send','index','CmContact','describe','keys','cf_','push','findOne','trimStart','all','length','fieldType','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','cm_contacts','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id'];(function(_0x5c202d,_0x448be5){var _0x393bf7=function(_0x45258d){while(--_0x45258d){_0x5c202d['push'](_0x5c202d['shift']());}};_0x393bf7(++_0x448be5);}(_0x0c33,0xef));var _0x30c3=function(_0x5ca52d,_0x3a4a22){_0x5ca52d=_0x5ca52d-0x0;var _0x89e54e=_0x0c33[_0x5ca52d];return _0x89e54e;};'use strict';var moment=require(_0x30c3('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x30c3('0x1'));var fs=require('fs');var _=require(_0x30c3('0x2'));var squel=require(_0x30c3('0x3'));var Papa=require(_0x30c3('0x4'));var Redis=require(_0x30c3('0x5'));var qs=require(_0x30c3('0x6'));var as=require(_0x30c3('0x7'));var logger=require(_0x30c3('0x8'))('api');var config=require(_0x30c3('0x9'));var shared=require(_0x30c3('0xa'));var db=require(_0x30c3('0xb'))['db'];config[_0x30c3('0xc')]=_[_0x30c3('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x30c3('0xe'))(new Redis(config[_0x30c3('0xc')]));require(_0x30c3('0xf'))[_0x30c3('0x10')](socket);function respondWithResult(_0xa2a547,_0x27d583){_0x27d583=_0x27d583||0xc8;return function(_0x5d34d6){if(_0x5d34d6){return _0xa2a547[_0x30c3('0x11')](_0x27d583)['json'](_0x5d34d6);}};}function respondWithFilteredResult(_0x23bf86,_0x443c83){return function(_0x1aef96){if(_0x1aef96){var _0x1a3034=typeof _0x443c83['offset']===_0x30c3('0x12')&&typeof _0x443c83[_0x30c3('0x13')]===_0x30c3('0x12');var _0x222c79=_0x1aef96[_0x30c3('0x14')];var _0x1cfe22=_0x1a3034?0x0:_0x443c83[_0x30c3('0x15')];var _0x1f412a=_0x1a3034?_0x1aef96[_0x30c3('0x14')]:_0x443c83[_0x30c3('0x15')]+_0x443c83[_0x30c3('0x13')];var _0x375d2c;if(_0x1f412a>=_0x222c79){_0x1f412a=_0x222c79;_0x375d2c=0xc8;}else{_0x375d2c=0xce;}_0x23bf86[_0x30c3('0x11')](_0x375d2c);return _0x23bf86[_0x30c3('0x16')](_0x30c3('0x17'),_0x1cfe22+'-'+_0x1f412a+'/'+_0x222c79)[_0x30c3('0x18')](_0x1aef96);}return null;};}function saveUpdates(_0x227e77){return function(_0x1e0221){if(_0x1e0221){return _0x1e0221[_0x30c3('0x19')](_0x227e77)[_0x30c3('0x1a')](function(_0xdbf6eb){return _0xdbf6eb;});}return null;};}function removeEntity(_0x4a7a05){return function(_0x3e90f2){if(_0x3e90f2){return _0x3e90f2['destroy']()['then'](function(){_0x4a7a05['status'](0xcc)[_0x30c3('0x1b')]();});}};}function handleEntityNotFound(_0x483c79){return function(_0x3bf79b){if(!_0x3bf79b){_0x483c79[_0x30c3('0x1c')](0x194);}return _0x3bf79b;};}function handleError(_0x163bc9,_0x418ed0){_0x418ed0=_0x418ed0||0x1f4;return function(_0x31a13e){logger[_0x30c3('0x1d')](_0x31a13e[_0x30c3('0x1e')]);if(_0x31a13e[_0x30c3('0x1f')]){delete _0x31a13e[_0x30c3('0x1f')];}_0x163bc9[_0x30c3('0x11')](_0x418ed0)[_0x30c3('0x20')](_0x31a13e);};}exports[_0x30c3('0x21')]=function(_0x321448,_0x37de0d){var _0x57d138={},_0x42ee4f={},_0x542712={'count':0x0,'rows':[]};return db[_0x30c3('0x22')][_0x30c3('0x23')]()[_0x30c3('0x1a')](function(_0x3017dc){var _0xb9571a=[];for(var _0xfbf47f=0x0;_0xfbf47f<Object[_0x30c3('0x24')](_0x3017dc)['length'];_0xfbf47f++){var _0x1eaca1=Object[_0x30c3('0x24')](_0x3017dc)[_0xfbf47f];if(_['startsWith'](_0x1eaca1,_0x30c3('0x25'))){_0xb9571a[_0x30c3('0x26')](db['CmCustomField'][_0x30c3('0x27')]({'where':{'id':_[_0x30c3('0x28')](_0x1eaca1,_0x30c3('0x25'))},'raw':!![]}));}}return BPromise[_0x30c3('0x29')](_0xb9571a)['then'](function(_0x247559){for(var _0x1bbe96=0x0;_0x1bbe96<_0x247559[_0x30c3('0x2a')];_0x1bbe96++){if(_0x247559[_0x1bbe96]){var _0x57a127=_0x30c3('0x25')+_0x247559[_0x1bbe96]['id'];var _0x26eb7b=_0x3017dc[_0x57a127];_0x26eb7b[_0x30c3('0x2b')]=_0x247559[_0x1bbe96]['type'];}}return _0x3017dc;});})['then'](function(_0x40440f){_0x42ee4f[_0x30c3('0x2c')]=_['keys'](_0x40440f);_0x42ee4f[_0x30c3('0x2d')]=_[_0x30c3('0x24')](_0x321448[_0x30c3('0x2d')]);_0x42ee4f[_0x30c3('0x2e')]=_[_0x30c3('0x2f')](_0x42ee4f[_0x30c3('0x2c')],_0x42ee4f[_0x30c3('0x2d')]);_0x57d138[_0x30c3('0x30')]=_[_0x30c3('0x2f')](_0x42ee4f[_0x30c3('0x2c')],qs[_0x30c3('0x31')](_0x321448[_0x30c3('0x2d')][_0x30c3('0x31')]));_0x57d138[_0x30c3('0x30')]=_0x57d138[_0x30c3('0x30')][_0x30c3('0x2a')]?_0x57d138['attributes']:_0x42ee4f[_0x30c3('0x2c')];if(!_0x321448[_0x30c3('0x2d')][_0x30c3('0x32')](_0x30c3('0x33'))){_0x57d138[_0x30c3('0x13')]=qs[_0x30c3('0x13')](_0x321448[_0x30c3('0x2d')]['limit']);_0x57d138[_0x30c3('0x15')]=qs['offset'](_0x321448[_0x30c3('0x2d')][_0x30c3('0x15')]);}_0x57d138[_0x30c3('0x34')]=qs[_0x30c3('0x35')](_0x321448[_0x30c3('0x2d')][_0x30c3('0x35')]);_0x57d138[_0x30c3('0x36')]=qs[_0x30c3('0x2e')](_[_0x30c3('0x37')](_0x321448[_0x30c3('0x2d')],_0x42ee4f[_0x30c3('0x2e')]),_0x40440f);var _0x201585=[];var _0x34f145=squel[_0x30c3('0x38')]()[_0x30c3('0x39')]('id')[_0x30c3('0x39')](_0x30c3('0x1f'))['field'](_0x30c3('0x3a'))[_0x30c3('0x3b')]('tools_tags');var _0x55b4af=squel[_0x30c3('0x38')]()[_0x30c3('0x3b')](_0x30c3('0x3c'),'c')[_0x30c3('0x3d')]('cm_user_has_contacts','uc',_0x30c3('0x3e'))['left_join'](_0x30c3('0x3f'),'ct',_0x30c3('0x40'))[_0x30c3('0x3d')](_0x30c3('0x41'),'t','t.id\x20=\x20ct.TagId')[_0x30c3('0x36')](_0x30c3('0x42'));var _0x9b4710=squel['expr']();var _0x1401d3=[];var _0x4030d5=squel['expr']();var _0x1b3625;if(_0x321448[_0x30c3('0x2d')][_0x30c3('0x43')]){_0x1b3625=as['parseSearch'](_0x321448['query'][_0x30c3('0x43')]);var _0x22eb72=_0x1b3625[_0x30c3('0x44')];for(var _0x1e8194=0x0;_0x1e8194<_0x1b3625[_0x30c3('0x45')][_0x30c3('0x2a')];_0x1e8194++){var _0x50df9f=_0x1b3625[_0x30c3('0x45')][_0x1e8194];var _0x12e061='c';var _0x5778fe=_(_0x40440f)[_0x30c3('0x24')]()[_0x30c3('0x46')](function(_0x2f9eec){return _0x2f9eec===_0x50df9f[_0x30c3('0x39')];});if(_0x5778fe)_0x5778fe=_0x40440f[_0x50df9f[_0x30c3('0x39')]];if(!_0x5778fe){if(_0x50df9f[_0x30c3('0x39')]===_0x30c3('0x47')){var _0x3bbc16=_0x50df9f[_0x30c3('0x48')][_0x30c3('0x49')](',')[_0x30c3('0x4a')](function(_0x2d98d6){return Number(_0x2d98d6);});_0x3bbc16[_0x30c3('0x4b')](function(_0x46a8df){_0x4030d5['or'](_0x30c3('0x4c'),'%,'+_0x46a8df+',%');});_0x1401d3=_[_0x30c3('0x4d')](_0x1401d3,_0x3bbc16);}else if(_0x50df9f[_0x30c3('0x39')]==='User'){_0x9b4710[_0x30c3('0x4e')]('uc.UserId\x20=\x20?',_0x50df9f[_0x30c3('0x48')]);}}else{if(_0x50df9f[_0x30c3('0x39')]==='dateOfBirth'||_0x5778fe[_0x30c3('0x2b')]===_0x30c3('0x4f'))_0x50df9f[_0x30c3('0x50')]=_0x30c3('0x51');var _0x3981a8=as[_0x30c3('0x52')](_0x12e061,_0x5778fe[_0x30c3('0x53')],_0x50df9f);_0x9b4710[_0x22eb72](_0x3981a8[_0x30c3('0x54')],_0x3981a8['value'][_0x30c3('0x55')],_0x3981a8[_0x30c3('0x48')][_0x30c3('0x1b')]);}}}else{var _0x4e6e62=_(Object['keys'](_0x321448[_0x30c3('0x2d')]))[_0x30c3('0x4a')](function(_0x39e336){return _0x40440f[_0x30c3('0x32')](_0x39e336)?_0x39e336:undefined;})[_0x30c3('0x56')](function(_0x553d91){return!_[_0x30c3('0x57')](_0x553d91);})[_0x30c3('0x48')]();if(_0x321448[_0x30c3('0x2d')]['Contact'])_0x4e6e62[_0x30c3('0x26')](_0x30c3('0x58'));if(!_[_0x30c3('0x59')](_0x4e6e62)){_0x4e6e62[_0x30c3('0x4b')](function(_0x100ec9){if(_0x100ec9===_0x30c3('0x5a')){_0x55b4af['where'](_0x30c3('0x5b'),[][_0x30c3('0x5c')](_0x321448[_0x30c3('0x2d')][_0x100ec9]));}else if(_0x100ec9===_0x30c3('0x58')){var _0x480834='%'+_0x321448['query'][_0x100ec9]+'%';_0x55b4af[_0x30c3('0x36')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x480834);}else{_0x55b4af[_0x30c3('0x36')]('c.'+_0x100ec9+_0x30c3('0x5d'),_0x321448['query'][_0x100ec9]);}});}if(_0x321448[_0x30c3('0x2d')][_0x30c3('0x5e')]){_0x1401d3=_['isArray'](_0x321448[_0x30c3('0x2d')]['tag'])?_0x321448[_0x30c3('0x2d')][_0x30c3('0x5e')]:new Array(_0x321448['query'][_0x30c3('0x5e')]);_0x1401d3[_0x30c3('0x4b')](function(_0xa032c1){_0x4030d5['or'](_0x30c3('0x4c'),'%,'+_0xa032c1+',%');});}if(_0x321448['query'][_0x30c3('0x56')]){var _0x50e9d5=_0x321448[_0x30c3('0x2d')][_0x30c3('0x56')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x50e9d5[_0x30c3('0x49')]('\x20')[_0x30c3('0x2a')]>0x1){_0x9b4710['or'](_0x30c3('0x5f'),qs[_0x30c3('0x60')](_0x50e9d5),null);}else{if(qs[_0x30c3('0x61')](_0x50e9d5)){_0x9b4710['or']('c.id\x20LIKE\x20?',_0x50e9d5+'%');_0x9b4710['or'](_0x30c3('0x62'),_0x50e9d5+'%');_0x9b4710['or'](_0x30c3('0x63'),_0x50e9d5+'%');_0x9b4710['or'](_0x30c3('0x64'),_0x50e9d5+'%');}else if(qs['isEmail'](_0x50e9d5)){_0x9b4710['or'](_0x30c3('0x65'),_0x50e9d5+'%');}else{_0x9b4710['or'](_0x30c3('0x66'),'%'+_0x50e9d5+'%');_0x9b4710['or']('c.lastName\x20LIKE\x20?','%'+_0x50e9d5+'%');_0x9b4710['or'](_0x30c3('0x65'),'%'+_0x50e9d5+'%');}}}}_0x55b4af[_0x30c3('0x36')](_0x9b4710);_0x55b4af[_0x30c3('0x67')]('c.id');var _0x391129={'type':db[_0x30c3('0x68')][_0x30c3('0x69')]['SELECT'],'raw':!![]};var _0x5c4aa5=_0x55b4af[_0x30c3('0x6a')]()[_0x30c3('0x39')](_0x30c3('0x6b'));if(_0x57d138[_0x30c3('0x34')]){_0x57d138[_0x30c3('0x34')][_0x30c3('0x4b')](function(_0x5e7c31){_0x55b4af[_0x30c3('0x34')]('c.'+_0x5e7c31[0x0],_0x5e7c31[0x1]==='DESC'?![]:!![]);});}if(!_[_0x30c3('0x59')](_0x1401d3)){_0x55b4af[_0x30c3('0x6c')](_0x4030d5);_0x5c4aa5[_0x30c3('0x36')](_0x30c3('0x6d'),_0x1401d3);}BPromise[_0x30c3('0x6e')]()[_0x30c3('0x1a')](function(){if(!_0x1b3625)return;if(_0x321448['user']['role']!=='agent')return;if(!_[_0x30c3('0x6f')](_0x1b3625[_0x30c3('0x45')],[_0x30c3('0x39'),_0x30c3('0x70')])){return _0x321448['user'][_0x30c3('0x71')]({'attributes':['id'],'raw':!![]})['then'](function(_0xba0137){if(_[_0x30c3('0x59')](_0xba0137)){_0x5c4aa5['where'](_0x30c3('0x72'));_0x55b4af['where']('c.ListId\x20IS\x20NULL');}else{_0x5c4aa5[_0x30c3('0x36')](_0x30c3('0x5b'),_[_0x30c3('0x4a')](_0xba0137,'id'));_0x55b4af[_0x30c3('0x36')](_0x30c3('0x5b'),_[_0x30c3('0x4a')](_0xba0137,'id'));}});}})['then'](function(){if(_0x321448[_0x30c3('0x73')][_0x30c3('0x74')]===_0x30c3('0x75')&&!_0x1b3625&&!_0x321448[_0x30c3('0x2d')][_0x30c3('0x5a')])return[];return db[_0x30c3('0x76')]['query'](_0x5c4aa5[_0x30c3('0x77')](),_0x391129);})[_0x30c3('0x1a')](function(_0x3944b2){_0x542712[_0x30c3('0x14')]=_0x3944b2[_0x30c3('0x2a')];if(_0x542712[_0x30c3('0x14')]===0x0)return[];return db['sequelize'][_0x30c3('0x2d')](_0x34f145['toString'](),_0x391129)[_0x30c3('0x1a')](function(_0x41f6e4){_0x201585=_['keyBy'](_0x41f6e4,'id');_0x391129=_[_0x30c3('0x78')](_0x391129,{'model':db[_0x30c3('0x22')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x321448[_0x30c3('0x2d')][_0x30c3('0x31')]){_0x57d138[_0x30c3('0x30')][_0x30c3('0x4b')](function(_0x2e9043){_0x55b4af['field']('c.'+_0x2e9043);});}else{_0x55b4af[_0x30c3('0x39')](_0x30c3('0x6b'));_0x55b4af['field'](_0x30c3('0x79'));_0x55b4af[_0x30c3('0x39')]('c.lastName');_0x55b4af[_0x30c3('0x39')]('c.phone');_0x55b4af[_0x30c3('0x39')]('c.mobile');_0x55b4af['field'](_0x30c3('0x7a'));_0x55b4af[_0x30c3('0x39')]('c.email');_0x55b4af['field'](_0x30c3('0x7b'));_0x55b4af[_0x30c3('0x39')]('c.createdAt');_0x55b4af[_0x30c3('0x39')](_0x30c3('0x7c'));_0x55b4af[_0x30c3('0x39')](_0x30c3('0x7d'));_0x55b4af[_0x30c3('0x39')](_0x30c3('0x7e'),_0x30c3('0x7f'));}if(_0x57d138[_0x30c3('0x13')])_0x55b4af[_0x30c3('0x13')](_0x57d138[_0x30c3('0x13')]);if(_0x57d138[_0x30c3('0x15')])_0x55b4af[_0x30c3('0x15')](_0x57d138[_0x30c3('0x15')]);return db['sequelize'][_0x30c3('0x2d')](_0x55b4af[_0x30c3('0x77')](),_0x391129);});})['then'](function(_0x31cb1e){_0x31cb1e[_0x30c3('0x4b')](function(_0x2f0ee0){if(_0x2f0ee0['TagIds']){_0x2f0ee0[_0x30c3('0x80')]=[];_0x2f0ee0[_0x30c3('0x7f')]['split'](',')['forEach'](function(_0x191f07){_0x2f0ee0['Tags'][_0x30c3('0x26')](_0x201585[_0x191f07]);});}delete _0x2f0ee0[_0x30c3('0x7f')];});_0x542712[_0x30c3('0x81')]=_0x31cb1e;return _0x542712;})[_0x30c3('0x1a')](respondWithFilteredResult(_0x37de0d,_0x57d138));})['catch'](handleError(_0x37de0d,null));};exports[_0x30c3('0x82')]=function(_0x5a9dc5,_0x5a454c){return db['CmContact'][_0x30c3('0x46')]({'where':{'id':_0x5a9dc5[_0x30c3('0x83')]['id']}})[_0x30c3('0x1a')](handleEntityNotFound(_0x5a454c,null))['then'](removeEntity(_0x5a454c,null))[_0x30c3('0x84')](handleError(_0x5a454c,null));};exports['describe']=function(_0x1d5359,_0x308ab3){return db['CmContact'][_0x30c3('0x23')]()[_0x30c3('0x1a')](function(_0x486573){delete _0x486573[_0x30c3('0x85')];for(var _0x134a02=0x0;_0x134a02<Object[_0x30c3('0x24')](_0x486573)[_0x30c3('0x2a')];_0x134a02++){var _0x144296=Object[_0x30c3('0x24')](_0x486573)[_0x134a02];if(!_[_0x30c3('0x86')](_0x144296,_0x30c3('0x25'))){_0x486573[_0x144296][_0x30c3('0x87')]=_0x144296;_0x486573[_0x144296][_0x30c3('0x88')]=_0x144296;}}return _0x486573;})['then'](function(_0x4a0ad5){var _0x43f0a0={'where':Boolean(_0x1d5359['query']['analytics'])===!![]?undefined:{'$or':[{'ListId':_0x1d5359['query']['id']},{'ListId':null}]},'raw':!![]};return db[_0x30c3('0x89')][_0x30c3('0x8a')](_0x43f0a0)['then'](function(_0x448900){for(var _0x3961bf=0x0;_0x3961bf<_0x448900[_0x30c3('0x2a')];_0x3961bf++){var _0x3120a3='cf_'+_0x448900[_0x3961bf]['id'];_0x4a0ad5[_0x3120a3][_0x30c3('0x87')]=_0x3120a3;_0x4a0ad5[_0x3120a3]['displayName']=_0x448900[_0x3961bf]['alias'];_0x4a0ad5[_0x3120a3][_0x30c3('0x8b')]={'type':_0x448900[_0x3961bf][_0x30c3('0x53')],'values':_0x448900[_0x3961bf][_0x30c3('0x8c')]};}Object['keys'](_0x4a0ad5)[_0x30c3('0x4b')](function(_0x1e2f8f){if(!_0x4a0ad5[_0x1e2f8f][_0x30c3('0x32')](_0x30c3('0x87'))){delete _0x4a0ad5[_0x1e2f8f];}});return _0x4a0ad5;});})['then'](respondWithResult(_0x308ab3,null))['catch'](handleError(_0x308ab3,null));};exports[_0x30c3('0x78')]=function(_0x2d0be6,_0x473800){var _0xe10ca4;var _0x351a27;var _0x3fefbc;if(_0x2d0be6['body']['id']){delete _0x2d0be6[_0x30c3('0x8d')]['id'];}return db['CmContact'][_0x30c3('0x8a')]({'where':{'id':[_0x2d0be6[_0x30c3('0x8d')]['to'],_0x2d0be6[_0x30c3('0x8d')][_0x30c3('0x3b')]]}})['then'](function(_0x2574ed){if(_0x2574ed){if(_0x2574ed[_0x30c3('0x2a')]!==0x2){return null;}_0x2574ed[0x0]=_0x2574ed[0x0][_0x30c3('0x8e')]({'plain':!![]});_0x2574ed[0x1]=_0x2574ed[0x1][_0x30c3('0x8e')]({'plain':!![]});delete _0x2574ed[0x0]['id'];delete _0x2574ed[0x1]['id'];return _[_0x30c3('0x8f')](_0x2574ed[0x0],_0x2574ed[0x1],function(_0x7f8caa,_0x192485){if(Array[_0x30c3('0x90')](_0x192485)&&!_0x192485[_0x30c3('0x2a')]){return _0x7f8caa;}else if(!_0x192485){return _0x7f8caa;}});}})[_0x30c3('0x1a')](handleEntityNotFound(_0x473800,null))['then'](function(_0x109dcf){if(_0x109dcf){if(_0x109dcf[_0x30c3('0x85')]&&_[_0x30c3('0x90')](_0x109dcf[_0x30c3('0x85')])){_0x109dcf[_0x30c3('0x85')]=_0x109dcf[_0x30c3('0x85')][_0x30c3('0x91')]();}logger['info'](_0x30c3('0x92'),_0x2d0be6[_0x30c3('0x8d')]['to'],_0x2d0be6['body'][_0x30c3('0x3b')]);return db['CmHopper'][_0x30c3('0x82')]({'where':{'ContactId':[_0x2d0be6['body']['to'],_0x2d0be6[_0x30c3('0x8d')]['from']]}})[_0x30c3('0x1a')](function(_0x2d0d3e){logger[_0x30c3('0x93')]('[CmContact][merge][destroy][CmHopper],\x20%s',_0x2d0d3e);return db['CmHopperBlack'][_0x30c3('0x82')]({'where':{'ContactId':[_0x2d0be6[_0x30c3('0x8d')]['to'],_0x2d0be6['body']['from']]}})[_0x30c3('0x1a')](function(_0x9c3ebc){logger[_0x30c3('0x93')]('[CmContact][merge][destroy][CmHopperBlack],\x20%s',_0x9c3ebc);return db['CmContact']['create'](_0x109dcf);});});}})[_0x30c3('0x1a')](function(_0x1aea6c){if(_0x1aea6c){_0xe10ca4=_0x1aea6c;_0x351a27={'ContactId':_0xe10ca4['id']};_0x3fefbc={'where':{'ContactId':[_0x2d0be6[_0x30c3('0x8d')]['to'],_0x2d0be6[_0x30c3('0x8d')]['from']]}};return db[_0x30c3('0x94')][_0x30c3('0x19')](_0x351a27,_0x3fefbc);}})[_0x30c3('0x1a')](function(){if(_0xe10ca4){return db['ChatMessage'][_0x30c3('0x19')](_0x351a27,_0x3fefbc);}})[_0x30c3('0x1a')](function(){if(_0xe10ca4){return db[_0x30c3('0x95')][_0x30c3('0x19')](_0x351a27,_0x3fefbc);}})['then'](function(){if(_0xe10ca4){return db[_0x30c3('0x96')]['update'](_0x351a27,_0x3fefbc);}})[_0x30c3('0x1a')](function(){if(_0xe10ca4){return db[_0x30c3('0x97')][_0x30c3('0x19')](_0x351a27,_0x3fefbc);}})[_0x30c3('0x1a')](function(){if(_0xe10ca4){return db[_0x30c3('0x96')][_0x30c3('0x19')](_0x351a27,_0x3fefbc);}})[_0x30c3('0x1a')](function(){if(_0xe10ca4){return db['MailMessage'][_0x30c3('0x19')](_0x351a27,_0x3fefbc);}})[_0x30c3('0x1a')](function(){if(_0xe10ca4){return db[_0x30c3('0x98')][_0x30c3('0x19')](_0x351a27,_0x3fefbc);}})['then'](function(){if(_0xe10ca4){return db[_0x30c3('0x99')]['update'](_0x351a27,_0x3fefbc);}})[_0x30c3('0x1a')](function(){if(_0xe10ca4){return db[_0x30c3('0x9a')]['update'](_0x351a27,_0x3fefbc);}})['then'](function(){if(_0xe10ca4){return db[_0x30c3('0x9b')][_0x30c3('0x19')](_0x351a27,_0x3fefbc);}})['then'](function(){if(_0xe10ca4){return db[_0x30c3('0x9c')]['update'](_0x351a27,_0x3fefbc);}})[_0x30c3('0x1a')](function(){if(_0xe10ca4){return db['OpenchannelMessage'][_0x30c3('0x19')](_0x351a27,_0x3fefbc);}})[_0x30c3('0x1a')](function(){if(_0xe10ca4){return db['CmContactHasItem'][_0x30c3('0x19')]({'CmContactId':_0xe10ca4['id']},{'where':{'CmContactId':[_0x2d0be6[_0x30c3('0x8d')]['to'],_0x2d0be6[_0x30c3('0x8d')][_0x30c3('0x3b')]]}});}})['then'](function(){if(_0xe10ca4){return db[_0x30c3('0x9d')]['update'](_0x351a27,_0x3fefbc);}})[_0x30c3('0x1a')](function(){if(_0xe10ca4){return db[_0x30c3('0x9e')][_0x30c3('0x19')](_0x351a27,_0x3fefbc);}})['then'](function(){if(_0xe10ca4){return db['ReportAgentPreview'][_0x30c3('0x19')](_0x351a27,_0x3fefbc);}})[_0x30c3('0x1a')](function(){if(_0xe10ca4){return db[_0x30c3('0x9f')][_0x30c3('0x19')](_0x351a27,_0x3fefbc);}})[_0x30c3('0x1a')](function(){if(_0xe10ca4){return db[_0x30c3('0xa0')]['update'](_0x351a27,_0x3fefbc);}})['then'](function(){if(_0xe10ca4){return db[_0x30c3('0xa1')][_0x30c3('0x19')](_0x351a27,_0x3fefbc);}})[_0x30c3('0x1a')](function(){if(_0xe10ca4){return db['MailQueueReport']['update'](_0x351a27,_0x3fefbc);}})[_0x30c3('0x1a')](function(){if(_0xe10ca4){return db[_0x30c3('0xa2')][_0x30c3('0x19')](_0x351a27,_0x3fefbc);}})['then'](function(){if(_0xe10ca4){return db['SmsQueueReport'][_0x30c3('0x19')](_0x351a27,_0x3fefbc);}})['then'](function(){if(_0xe10ca4){return db[_0x30c3('0xa3')][_0x30c3('0x19')](_0x351a27,_0x3fefbc);}})[_0x30c3('0x1a')](function(){if(_0xe10ca4){return db[_0x30c3('0xa4')]['update'](_0x351a27,_0x3fefbc);}})[_0x30c3('0x1a')](function(){if(_0xe10ca4){return db[_0x30c3('0xa5')][_0x30c3('0x19')](_0x351a27,_0x3fefbc);}})[_0x30c3('0x1a')](function(){if(_0xe10ca4){return db[_0x30c3('0xa6')][_0x30c3('0x19')](_0x351a27,_0x3fefbc);}})[_0x30c3('0x1a')](function(){if(_0xe10ca4){return db[_0x30c3('0x22')][_0x30c3('0x82')]({'where':{'id':[_0x2d0be6[_0x30c3('0x8d')]['to'],_0x2d0be6[_0x30c3('0x8d')][_0x30c3('0x3b')]]}});}})[_0x30c3('0x1a')](function(){if(_0xe10ca4){return _0xe10ca4;}})['then'](respondWithResult(_0x473800,null))[_0x30c3('0x84')](handleError(_0x473800,null));};exports[_0x30c3('0xa7')]=function(_0x5a0028,_0x15011e){return db['CmContact']['describe']()[_0x30c3('0x1a')](function(_0x35b7f8){if(_0x5a0028[_0x30c3('0x8d')]['tags']&&_['isArray'](_0x5a0028['body'][_0x30c3('0x85')])){if(_0x5a0028[_0x30c3('0x8d')]['tags'][_0x30c3('0x2a')]){_0x5a0028[_0x30c3('0x8d')][_0x30c3('0x85')]=_0x5a0028[_0x30c3('0x8d')][_0x30c3('0x85')][_0x30c3('0x91')](';')+';';}else{_0x5a0028['body'][_0x30c3('0x85')]=null;}}else{_0x5a0028[_0x30c3('0x8d')][_0x30c3('0x85')]=null;}if(!_[_0x30c3('0x57')](_0x5a0028[_0x30c3('0x8d')][_0x30c3('0xa8')])){var _0x2f8bda=_0x5a0028[_0x30c3('0x8d')][_0x30c3('0xa8')];if(!_[_0x30c3('0x57')](shared[_0x30c3('0xa9')][_0x2f8bda]))_0x5a0028[_0x30c3('0x8d')]['utcOffset']=shared[_0x30c3('0xa9')][_0x2f8bda][_0x30c3('0xaa')];}return db['CmContact'][_0x30c3('0xa7')](_0x5a0028[_0x30c3('0x8d')],{'fields':_[_0x30c3('0x24')](_0x35b7f8),'raw':!![]});})[_0x30c3('0x1a')](function(_0x261fa5){if(_0x5a0028['body'][_0x30c3('0xab')]){return insertAdditionalPhones(_0x261fa5,_0x5a0028[_0x30c3('0x8d')][_0x30c3('0xab')]);}else{return _0x261fa5;}})[_0x30c3('0x1a')](respondWithResult(_0x15011e,0xc9))['catch'](handleError(_0x15011e,null));};exports[_0x30c3('0xac')]=function(_0x3c4147,_0x2d7913){var _0x16aad3=0x0;var _0x196f70=0x0;var _0xd4bf18=0x0;var _0x426c73=[];return db[_0x30c3('0x22')][_0x30c3('0x23')]()['then'](function(_0x500d99){return BPromise['each'](_0x3c4147[_0x30c3('0x8d')],function(_0x2084f1){var _0x3cd131={'where':{'$or':[]},'defaults':_0x2084f1,'fields':_[_0x30c3('0x24')](_0x500d99),'raw':!![]};if(_0x2084f1['duplicates']){for(var _0x25f779=0x0;_0x25f779<_0x2084f1[_0x30c3('0xad')][_0x30c3('0x2a')];_0x25f779++){var _0x32d11c={};_0x32d11c[_0x2084f1[_0x30c3('0xad')][_0x25f779]]=_0x2084f1[_0x2084f1[_0x30c3('0xad')][_0x25f779]];_0x3cd131[_0x30c3('0x36')][_0x30c3('0xae')][_0x30c3('0x26')](_0x32d11c);}_0x3cd131['where']['ListId']=_0x2084f1[_0x30c3('0x5a')];}return db['CmContact'][_0x30c3('0xaf')](_0x3cd131)['spread'](function(_0x4fda4c,_0x469046){if(_0x469046){if(_0x2084f1[_0x30c3('0x32')](_0x30c3('0xab'))){_0x426c73[_0x30c3('0x26')]({'contact':_0x4fda4c,'additionalPhones':_0x2084f1['additionalPhones']});}_0x16aad3++;}else{_0xd4bf18++;}})[_0x30c3('0x84')](function(){_0x196f70++;});});})[_0x30c3('0x1a')](function(_0x224f29){if(_0x224f29){if(_0x426c73[_0x30c3('0x2a')]>0x0){return new Promise(function(_0x5935c8,_0x47fd52){var _0x226d56=[];for(var _0x1de50f=0x0;_0x1de50f<_0x426c73[_0x30c3('0x2a')];_0x1de50f++){_0x226d56['push'](insertAdditionalPhones(_0x426c73[_0x1de50f][_0x30c3('0xb0')],_0x426c73[_0x1de50f][_0x30c3('0xab')]));}Promise['all'](_0x226d56)[_0x30c3('0x1a')](function(){_0x5935c8(0x1);});})[_0x30c3('0x1a')](function(){return{'success':_0x16aad3,'failure':_0x196f70,'duplicates':_0xd4bf18};});}else{return{'success':_0x16aad3,'failure':_0x196f70,'duplicates':_0xd4bf18};}}})[_0x30c3('0x1a')](respondWithResult(_0x2d7913,0xc9))[_0x30c3('0x84')](handleError(_0x2d7913,null));};exports[_0x30c3('0xb1')]=function(_0x4b9781,_0xa67404){var _0x839ebf;return db[_0x30c3('0x22')][_0x30c3('0x23')]()['then'](function(_0x1a48e5){return db[_0x30c3('0x22')]['find']({'where':{'id':_0x4b9781['params']['id']},'include':[{'model':db[_0x30c3('0x47')],'as':_0x30c3('0x80'),'attributes':['id','name',_0x30c3('0x3a')],'required':_0x4b9781[_0x30c3('0x2d')][_0x30c3('0x5e')]?!![]:![]},{'model':db[_0x30c3('0xb2')],'as':_0x30c3('0xb3'),'where':{'CmContactId':_0x4b9781[_0x30c3('0x83')]['id']},'required':![],'include':[{'model':db[_0x30c3('0xb4')],'as':_0x30c3('0xb5')}]}],'order':[db['sequelize']['literal'](_0x30c3('0xb6'))],'attributes':_[_0x30c3('0x24')](_0x1a48e5)});})[_0x30c3('0x1a')](function(_0x36192c){if(!_[_0x30c3('0x57')](_0x36192c)){_0x839ebf=_0x36192c['get']({'plain':!![]});var _0x3ef736={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x36192c&&_0x36192c[_0x30c3('0x5a')]){if(_0x36192c[_0x30c3('0x5a')]){_0x3ef736[_0x30c3('0x36')][_0x30c3('0xb7')][_0x30c3('0x26')]({'ListId':{'$ne':_0x36192c[_0x30c3('0x5a')]}});}}return db[_0x30c3('0x89')][_0x30c3('0x8a')](_0x3ef736);}})['then'](function(_0x4f2855){if(!_[_0x30c3('0x57')](_0x4f2855)){return _['omit'](_0x839ebf,_[_0x30c3('0x4a')](_0x4f2855,function(_0x4976fb){return util[_0x30c3('0xb8')](_0x30c3('0xb9'),_0x4976fb['id']);}));}})[_0x30c3('0x1a')](handleEntityNotFound(_0xa67404,null))[_0x30c3('0x1a')](respondWithResult(_0xa67404,null))[_0x30c3('0x84')](handleError(_0xa67404,null));};exports[_0x30c3('0x19')]=function(_0x539231,_0x44c1fa){var _0x1de8d9;if(_0x539231['body']['id']){delete _0x539231['body']['id'];}if(!_[_0x30c3('0x57')](_0x539231[_0x30c3('0x8d')][_0x30c3('0xa8')])){var _0x370842=_0x539231[_0x30c3('0x8d')][_0x30c3('0xa8')];if(!_[_0x30c3('0x57')](shared['timezones'][_0x370842]))_0x539231['body'][_0x30c3('0xaa')]=shared[_0x30c3('0xa9')][_0x370842][_0x30c3('0xaa')];}return db['CmContact'][_0x30c3('0x46')]({'where':{'id':_0x539231[_0x30c3('0x83')]['id']}})[_0x30c3('0x1a')](handleEntityNotFound(_0x44c1fa,null))[_0x30c3('0x1a')](saveUpdates(_0x539231[_0x30c3('0x8d')],null))[_0x30c3('0x1a')](function(_0x3a9b55){_0x1de8d9=_0x3a9b55;var _0x4ea858={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3a9b55&&_0x3a9b55[_0x30c3('0x5a')]){if(_0x3a9b55['ListId']){_0x4ea858[_0x30c3('0x36')][_0x30c3('0xb7')][_0x30c3('0x26')]({'ListId':{'$ne':_0x3a9b55[_0x30c3('0x5a')]}});}}return db['CmCustomField'][_0x30c3('0x8a')](_0x4ea858);})['then'](function(_0x40c124){if(_0x40c124){return _[_0x30c3('0xba')](_['pickBy'](_0x539231[_0x30c3('0x8d')],function(_0x294464,_0x4ffbab){return _[_0x30c3('0x86')](_0x4ffbab,_0x30c3('0x25'));}),_[_0x30c3('0x4a')](_0x40c124,function(_0x26f603){return util[_0x30c3('0xb8')](_0x30c3('0xb9'),_0x26f603['id']);}));}})[_0x30c3('0x1a')](function(_0x2b4977){if(_0x2b4977&&!_[_0x30c3('0x59')](_0x2b4977)){var _0x45a444=squel['update']()[_0x30c3('0xbb')](_0x30c3('0x3c'))[_0x30c3('0xbc')](_0x2b4977)[_0x30c3('0x36')]('id\x20=\x20?',_0x539231[_0x30c3('0x83')]['id'])[_0x30c3('0xbd')]();return db[_0x30c3('0x76')]['query'](_0x45a444[_0x30c3('0x54')],{'replacements':_0x45a444['values']});}})['then'](function(){if(_0x539231[_0x30c3('0x8d')][_0x30c3('0xbe')]&&_0x1de8d9){return db[_0x30c3('0xbf')][_0x30c3('0x19')]({'phone':_0x539231[_0x30c3('0x8d')][_0x30c3('0xbe')],'OrderBy':0x0},{'where':{'ContactId':_0x1de8d9['id']}});}})[_0x30c3('0x1a')](function(){return _0x1de8d9;})[_0x30c3('0x1a')](respondWithResult(_0x44c1fa,null))[_0x30c3('0x84')](handleError(_0x44c1fa,null));};exports[_0x30c3('0xc0')]=function(_0x4bbdf3,_0xdab127){var _0x4d883c={};var _0xcaab46={};var _0x4fdcd0;var _0x4f49fe;return db[_0x30c3('0x22')][_0x30c3('0x27')]({'where':{'id':_0x4bbdf3[_0x30c3('0x83')]['id']}})['then'](handleEntityNotFound(_0xdab127,null))[_0x30c3('0x1a')](function(_0x203d79){if(_0x203d79){_0x4fdcd0=_0x203d79;_0xcaab46[_0x30c3('0x2c')]=_[_0x30c3('0x24')](db[_0x30c3('0x47')][_0x30c3('0xc1')]);_0xcaab46['query']=_[_0x30c3('0x24')](_0x4bbdf3['query']);_0xcaab46['filters']=_['intersection'](_0xcaab46['model'],_0xcaab46[_0x30c3('0x2d')]);_0x4d883c['attributes']=_[_0x30c3('0x2f')](_0xcaab46['model'],qs['fields'](_0x4bbdf3[_0x30c3('0x2d')]['fields']));_0x4d883c[_0x30c3('0x30')]=_0x4d883c['attributes']['length']?_0x4d883c[_0x30c3('0x30')]:_0xcaab46[_0x30c3('0x2c')];_0x4d883c[_0x30c3('0x34')]=qs[_0x30c3('0x35')](_0x4bbdf3[_0x30c3('0x2d')][_0x30c3('0x35')]);_0x4d883c[_0x30c3('0x36')]=qs[_0x30c3('0x2e')](_[_0x30c3('0x37')](_0x4bbdf3[_0x30c3('0x2d')],_0xcaab46[_0x30c3('0x2e')]));if(_0x4bbdf3['query']['filter']){_0x4d883c[_0x30c3('0x36')]=_[_0x30c3('0x78')](_0x4d883c['where'],{'$or':_[_0x30c3('0x4a')](_0x4d883c[_0x30c3('0x30')],function(_0x4cd84c){var _0x188655={};_0x188655[_0x4cd84c]={'$like':'%'+_0x4bbdf3[_0x30c3('0x2d')]['filter']+'%'};return _0x188655;})});}_0x4d883c=_[_0x30c3('0x78')]({},_0x4d883c,_0x4bbdf3[_0x30c3('0xc2')]);return _0x4fdcd0[_0x30c3('0xc0')](_0x4d883c);}})['then'](function(_0x1d1d25){if(_0x1d1d25){_0x4f49fe=_0x1d1d25[_0x30c3('0x2a')];if(!_0x4bbdf3['query'][_0x30c3('0x32')](_0x30c3('0x33'))){_0x4d883c[_0x30c3('0x13')]=qs['limit'](_0x4bbdf3['query'][_0x30c3('0x13')]);_0x4d883c['offset']=qs[_0x30c3('0x15')](_0x4bbdf3['query'][_0x30c3('0x15')]);}return _0x4fdcd0['getTags'](_0x4d883c);}})['then'](function(_0x51bf67){if(_0x51bf67){return _0x51bf67?{'count':_0x4f49fe,'rows':_0x51bf67}:null;}})['then'](respondWithResult(_0xdab127,null))[_0x30c3('0x84')](handleError(_0xdab127,null));};exports[_0x30c3('0xc3')]=function(_0x3bf120,_0x230312){if(_0x3bf120[_0x30c3('0x8d')]['id']){delete _0x3bf120[_0x30c3('0x8d')]['id'];}return db[_0x30c3('0x22')]['findOne']({'where':{'id':_0x3bf120[_0x30c3('0x83')]['id']}})[_0x30c3('0x1a')](handleEntityNotFound(_0x230312,null))[_0x30c3('0x1a')](function(_0x4222af){if(_0x4222af){return _0x4222af[_0x30c3('0xc3')](_0x3bf120[_0x30c3('0x8d')][_0x30c3('0xc4')]||[]);}return null;})[_0x30c3('0x1a')](respondWithResult(_0x230312,null))[_0x30c3('0x84')](handleError(_0x230312,null));};exports['setAdditionalPhones']=function(_0x3cd1a3,_0x450085){var _0x22a0fc=[];_0x22a0fc[_0x30c3('0x26')](addAdditionalPhones(_0x3cd1a3[_0x30c3('0x8d')]));Promise[_0x30c3('0x29')](_0x22a0fc)[_0x30c3('0x1a')](function(){_0x22a0fc=[];_0x22a0fc[_0x30c3('0x26')](deleteCmHopperPhones(_0x3cd1a3['body']['id']));_0x22a0fc[_0x30c3('0x26')](addCmHopperPhones(_0x3cd1a3[_0x30c3('0x8d')]['id']));Promise[_0x30c3('0x29')](_0x22a0fc)[_0x30c3('0x1a')](function(){return[0x1];})[_0x30c3('0x1a')](respondWithResult(_0x450085,null));});};function addAdditionalPhones(_0x2869ab){var _0x426515;return new Promise(function(_0x2185c2,_0x4f6bba){return db[_0x30c3('0xb2')][_0x30c3('0x82')]({'where':{'CmContactId':_0x2869ab['id']}})[_0x30c3('0x1a')](function(){db[_0x30c3('0xb4')]['findAll']({'raw':!![],'attributes':['id','OrderBy']})['then'](function(_0x3a80ea){var _0x1d6192=[];for(var _0x460d13=0x0;_0x460d13<_0x2869ab['items'][_0x30c3('0x2a')];_0x460d13++){var _0x38a333=_0x2869ab[_0x30c3('0xc5')]?_[_0x30c3('0x57')](_0x2869ab[_0x30c3('0xc5')][_0x460d13])?'':_0x2869ab[_0x30c3('0xc5')][_0x460d13]:_0x2869ab[_0x30c3('0xc6')][_0x460d13][_0x30c3('0xc7')]?_0x2869ab[_0x30c3('0xc6')][_0x460d13][_0x30c3('0xc7')]:'';var _0x13ba17=_['isNil'](_0x2869ab[_0x30c3('0xc6')][_0x460d13][_0x30c3('0xc8')])?'':_0x2869ab[_0x30c3('0xc6')][_0x460d13][_0x30c3('0xc8')];var _0x376664=_0x38a333+':'+_0x2869ab['items'][_0x460d13][_0x30c3('0xbe')]+'§'+_0x13ba17;if(_['isNil'](_0x426515))_0x426515=_0x376664;else _0x426515+=';'+_0x376664;var _0x4353b9=null;if(_0x2869ab[_0x30c3('0xc5')]){if(!_[_0x30c3('0x57')](_0x2869ab['item_types'][_0x460d13])){var _0x422203=_['find'](_0x3a80ea,function(_0x1abeac){return _0x1abeac['id']===_0x2869ab[_0x30c3('0xc5')][_0x460d13];});if(!_[_0x30c3('0x57')](_0x422203)){_0x4353b9=_0x422203[_0x30c3('0xc9')];}}}else{if(!_['isNil'](_0x2869ab['items'][_0x460d13])){var _0x422203=_[_0x30c3('0x46')](_0x3a80ea,function(_0x31fd19){return _0x31fd19['id']===_0x2869ab[_0x30c3('0xc6')][_0x460d13][_0x30c3('0xc7')];});if(!_[_0x30c3('0x57')](_0x422203)){_0x4353b9=_0x460d13;}}}if(_['isNil'](_0x4353b9)){_0x4353b9=0x64;}_0x1d6192[_0x30c3('0x26')](addAdditionalPhone(_0x2869ab['id'],_0x2869ab[_0x30c3('0xc6')][_0x460d13][_0x30c3('0xbe')],_0x2869ab[_0x30c3('0xc5')]?_[_0x30c3('0x57')](_0x2869ab[_0x30c3('0xc5')][_0x460d13])?null:_0x2869ab['item_types'][_0x460d13]:_0x2869ab['items'][_0x460d13][_0x30c3('0xc7')]?_0x2869ab[_0x30c3('0xc6')][_0x460d13][_0x30c3('0xc7')]:null,_0x4353b9,_0x13ba17));}Promise[_0x30c3('0x29')](_0x1d6192)[_0x30c3('0x1a')](function(){db[_0x30c3('0x22')]['update']({'AdditionalPhones':_0x426515},{'where':{'id':_0x2869ab['id']}})[_0x30c3('0x1a')](function(){_0x2185c2(0x1);});});});});});}function addAdditionalPhone(_0x1e16ef,_0x34d48a,_0x3e2243,_0xb30cb3,_0x5402b6){return db['CmContactHasItem']['find']({'where':{'CmContactId':_0x1e16ef,'item':_0x34d48a}})[_0x30c3('0x1a')](function(_0x3fc64a){if(_0x3fc64a)logger[_0x30c3('0x93')](_0x30c3('0xca'),_0x3fc64a);else{db[_0x30c3('0xb2')][_0x30c3('0xa7')]({'CmContactId':_0x1e16ef,'item':_0x34d48a,'ItemTypeId':_0x3e2243,'OrderBy':_0xb30cb3,'ItemClass':'PHONE','description':_0x5402b6});}});}function deletePhones(_0x46fbfe){return db['CmContactHasItem']['destroy']({'where':{'CmContactId':_0x46fbfe}});}function deleteCmHopperPhones(_0x59d48e){return new Promise(function(_0x14a98c,_0x3ae1ed){return db[_0x30c3('0xbf')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x59d48e}})[_0x30c3('0x1a')](function(_0x458798){db['CmHopperAdditionalPhone'][_0x30c3('0x82')]({'where':{'CmHopperId':{'$in':_['map'](_0x458798,'id')}}});})[_0x30c3('0x1a')](function(){_0x14a98c(0x1);});});}function addCmHopperPhones(_0xc0627a){return new Promise(function(_0x592e33,_0x27e18e){return db[_0x30c3('0xbf')][_0x30c3('0x8a')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xc0627a}})['then'](function(_0x1831ba){var _0x2a062f=[];_[_0x30c3('0x4a')](_0x1831ba,function(_0x1969b0){_0x2a062f[_0x30c3('0x26')](createCmHopperPhone(_0xc0627a,_0x1969b0['id']));});Promise[_0x30c3('0x29')](_0x2a062f)[_0x30c3('0x1a')](function(){_0x592e33(0x1);});});});}function createCmHopperPhone(_0x11ea79,_0x3fe7bb){return new Promise(function(_0x5268f9,_0x378b39){db[_0x30c3('0xb2')]['findAll']({'raw':!![],'attributes':['item','OrderBy'],'where':{'CmContactId':_0x11ea79,'ItemClass':_0x30c3('0xcb')},'include':[{'model':db[_0x30c3('0xb4')],'attributes':[_0x30c3('0xc9')],'as':'ItemType'}],'order':['OrderBy',db[_0x30c3('0x76')][_0x30c3('0xcc')]('`ItemType`.OrderBy')]})[_0x30c3('0x1a')](function(_0x42f4ad){var _0x1052fa=0x1;var _0x46a895=_[_0x30c3('0x4a')](_0x42f4ad,function(_0x1777ea){_0x1777ea[_0x30c3('0xcd')]=_0x3fe7bb;_0x1777ea[_0x30c3('0xbe')]=_0x1777ea['item'];_0x1777ea[_0x30c3('0xc9')]=_0x1052fa;delete _0x1777ea[_0x30c3('0xce')];_0x1052fa=_0x1052fa+0x1;return _0x1777ea;});return db[_0x30c3('0xcf')][_0x30c3('0xac')](_0x46a895,{});})['then'](function(){_0x5268f9(0x1);});});}function insertAdditionalPhones(_0x3860e3,_0x3a1dcd){return new Promise(function(_0x52697d,_0x25f612){var _0x1ba80b=[];for(var _0x4bdce5=0x0;_0x4bdce5<_0x3a1dcd[_0x30c3('0x2a')];_0x4bdce5++){var _0x2e6e7e=_0x3a1dcd[_0x4bdce5];_0x1ba80b[_0x30c3('0x26')](parseContactItemType(_0x2e6e7e));}Promise[_0x30c3('0x29')](_0x1ba80b)['then'](function(){var _0x3c4f18={'id':_0x3860e3['id'],'items':_0x3a1dcd};return addAdditionalPhones(_0x3c4f18)[_0x30c3('0x1a')](function(_0x4b131e){return addCmHopperPhones(_0x3860e3['id']);});})[_0x30c3('0x1a')](function(){_0x52697d(_0x3860e3);});});}function parseContactItemType(_0x3cb2c8){return new Promise(function(_0x3be6eb,_0x1f292e){if(_0x3cb2c8[_0x30c3('0x32')](_0x30c3('0xc7'))){_0x3be6eb(_0x3cb2c8);}else{return db[_0x30c3('0xb4')][_0x30c3('0x46')]({'where':{'name':_0x3cb2c8[_0x30c3('0xb5')]}})[_0x30c3('0x1a')](function(_0x2cf390){if(_['isNil'](_0x2cf390))_0x3cb2c8['ItemTypeId']=null;else _0x3cb2c8['ItemTypeId']=_0x2cf390['id'];_0x3be6eb(_0x3cb2c8);});}});}exports[_0x30c3('0xd0')]=function(_0x362384,_0x5b3988){return db[_0x30c3('0xb2')][_0x30c3('0x8a')]({'raw':!![],'where':{'CmContactId':_0x362384[_0x30c3('0x83')]['id'],'ItemClass':'PHONE'},'include':[{'model':db['ContactItemType'],'as':_0x30c3('0xb5')}],'order':[[_0x30c3('0xc9')],[db[_0x30c3('0x76')][_0x30c3('0xcc')](_0x30c3('0xd1'))]]})['then'](function(_0x5d470e){return _0x5d470e;})['then'](respondWithResult(_0x5b3988,null))['catch'](handleError(_0x5b3988,null));};exports[_0x30c3('0xd2')]=function(_0x4e524f,_0x56c561){return db[_0x30c3('0xb2')][_0x30c3('0x8a')]({'raw':!![],'where':{'CmContactId':_0x4e524f[_0x30c3('0x8d')][_0x30c3('0xd3')]}})['then'](function(_0x121906){var _0x34708c=_['map'](_0x121906,function(_0x3fc3de){_0x3fc3de[_0x30c3('0xd4')]=_0x4e524f['body'][_0x30c3('0xd5')];return _0x3fc3de;});return db['CmContactHasItem']['bulkCreate'](_0x34708c,{});})[_0x30c3('0x1a')](function(_0x25a3b8){return addCmHopperPhones(_0x4e524f[_0x30c3('0x8d')]['toContactId']);})[_0x30c3('0x1a')](function(_0x34e4a0){return['ok'];})[_0x30c3('0x1a')](respondWithResult(_0x56c561,null))['catch'](handleError(_0x56c561,null));};exports['rescheduleAdditionalPhones']=function(_0x453bc0,_0x28864c){var _0x6bab16=[];_0x6bab16[_0x30c3('0x26')](createCmHopperPhone(_0x453bc0[_0x30c3('0x8d')]['id'],_0x453bc0[_0x30c3('0x8d')][_0x30c3('0xd6')]));Promise[_0x30c3('0x29')](_0x6bab16)[_0x30c3('0x1a')](function(){return[0x1];})[_0x30c3('0x1a')](respondWithResult(_0x28864c,null));};exports['getHoppers']=function(_0x2c5be6,_0x14f2bc){var _0x303bc6={'raw':![],'where':{}};var _0x4b0b46={};var _0x568507={'count':0x0,'rows':[]};return db[_0x30c3('0x22')][_0x30c3('0x27')]({'where':{'id':_0x2c5be6[_0x30c3('0x83')]['id']}})['then'](handleEntityNotFound(_0x14f2bc,null))[_0x30c3('0x1a')](function(_0x261007){if(_0x261007){_0x4b0b46[_0x30c3('0x2c')]=_[_0x30c3('0x24')](db[_0x30c3('0xbf')]['rawAttributes']);_0x4b0b46[_0x30c3('0x2d')]=_['keys'](_0x2c5be6[_0x30c3('0x2d')]);_0x4b0b46['filters']=_['intersection'](_0x4b0b46['model'],_0x4b0b46[_0x30c3('0x2d')]);_0x303bc6[_0x30c3('0x30')]=_[_0x30c3('0x2f')](_0x4b0b46[_0x30c3('0x2c')],qs[_0x30c3('0x31')](_0x2c5be6[_0x30c3('0x2d')][_0x30c3('0x31')]));_0x303bc6[_0x30c3('0x30')]=_0x303bc6['attributes']['length']?_0x303bc6[_0x30c3('0x30')]:_0x4b0b46[_0x30c3('0x2c')];if(!_0x2c5be6[_0x30c3('0x2d')][_0x30c3('0x32')](_0x30c3('0x33'))){_0x303bc6[_0x30c3('0x13')]=qs[_0x30c3('0x13')](_0x2c5be6[_0x30c3('0x2d')][_0x30c3('0x13')]);_0x303bc6[_0x30c3('0x15')]=qs['offset'](_0x2c5be6[_0x30c3('0x2d')][_0x30c3('0x15')]);}_0x303bc6[_0x30c3('0x34')]=qs['sort'](_0x2c5be6[_0x30c3('0x2d')][_0x30c3('0x35')]);_0x303bc6[_0x30c3('0x36')]=qs['filters'](_[_0x30c3('0x37')](_0x2c5be6[_0x30c3('0x2d')],_0x4b0b46['filters']));_0x303bc6[_0x30c3('0x36')][_0x30c3('0xd7')]=_0x261007['id'];if(_0x2c5be6['query']['filter']){_0x303bc6['where']=_[_0x30c3('0x78')](_0x303bc6[_0x30c3('0x36')],{'$or':_[_0x30c3('0x4a')](_0x303bc6[_0x30c3('0x30')],function(_0x14579b){var _0x4a2381={};_0x4a2381[_0x14579b]={'$like':'%'+_0x2c5be6['query'][_0x30c3('0x56')]+'%'};return _0x4a2381;})});}_0x303bc6=_['merge']({},_0x303bc6,_0x2c5be6[_0x30c3('0xc2')]);return db['CmHopper'][_0x30c3('0x14')]({'where':_0x303bc6['where']})[_0x30c3('0x1a')](function(_0x52b958){_0x568507[_0x30c3('0x14')]=_0x52b958;if(_0x2c5be6[_0x30c3('0x2d')][_0x30c3('0xd8')]){_0x303bc6[_0x30c3('0xd9')]=[{'all':!![]}];}return db[_0x30c3('0xbf')][_0x30c3('0x8a')](_0x303bc6);})['then'](function(_0x8456f1){_0x568507[_0x30c3('0x81')]=_0x8456f1;return _0x568507;});}})[_0x30c3('0x1a')](respondWithFilteredResult(_0x14f2bc,_0x303bc6))[_0x30c3('0x84')](handleError(_0x14f2bc,null));};exports[_0x30c3('0xda')]=function(_0x56307a,_0x1d35b5){var _0x12ecba={'raw':!![],'where':{}};var _0x3e52a7={};var _0xe39c69={'count':0x0,'rows':[]};return db[_0x30c3('0x22')][_0x30c3('0x27')]({'where':{'id':_0x56307a[_0x30c3('0x83')]['id']}})[_0x30c3('0x1a')](handleEntityNotFound(_0x1d35b5,null))[_0x30c3('0x1a')](function(_0x30189f){if(_0x30189f){_0x3e52a7[_0x30c3('0x2c')]=_[_0x30c3('0x24')](db['CmHopperHistory'][_0x30c3('0xc1')]);_0x3e52a7[_0x30c3('0x2d')]=_['keys'](_0x56307a[_0x30c3('0x2d')]);_0x3e52a7[_0x30c3('0x2e')]=_['intersection'](_0x3e52a7[_0x30c3('0x2c')],_0x3e52a7[_0x30c3('0x2d')]);_0x12ecba['attributes']=_[_0x30c3('0x2f')](_0x3e52a7['model'],qs[_0x30c3('0x31')](_0x56307a[_0x30c3('0x2d')]['fields']));_0x12ecba[_0x30c3('0x30')]=_0x12ecba[_0x30c3('0x30')][_0x30c3('0x2a')]?_0x12ecba[_0x30c3('0x30')]:_0x3e52a7[_0x30c3('0x2c')];if(!_0x56307a['query'][_0x30c3('0x32')](_0x30c3('0x33'))){_0x12ecba[_0x30c3('0x13')]=qs[_0x30c3('0x13')](_0x56307a[_0x30c3('0x2d')]['limit']);_0x12ecba[_0x30c3('0x15')]=qs[_0x30c3('0x15')](_0x56307a[_0x30c3('0x2d')]['offset']);}_0x12ecba[_0x30c3('0x34')]=qs['sort'](_0x56307a[_0x30c3('0x2d')][_0x30c3('0x35')]);_0x12ecba['where']=qs['filters'](_[_0x30c3('0x37')](_0x56307a[_0x30c3('0x2d')],_0x3e52a7[_0x30c3('0x2e')]));_0x12ecba[_0x30c3('0x36')][_0x30c3('0xd7')]=_0x30189f['id'];if(_0x56307a[_0x30c3('0x2d')][_0x30c3('0x56')]){_0x12ecba[_0x30c3('0x36')]=_['merge'](_0x12ecba[_0x30c3('0x36')],{'$or':_[_0x30c3('0x4a')](_0x12ecba[_0x30c3('0x30')],function(_0xdfe20a){var _0x44a790={};_0x44a790[_0xdfe20a]={'$like':'%'+_0x56307a['query'][_0x30c3('0x56')]+'%'};return _0x44a790;})});}_0x12ecba=_['merge']({},_0x12ecba,_0x56307a[_0x30c3('0xc2')]);return db[_0x30c3('0x9e')][_0x30c3('0x14')]({'where':_0x12ecba[_0x30c3('0x36')]})[_0x30c3('0x1a')](function(_0x1970ce){_0xe39c69['count']=_0x1970ce;if(_0x56307a['query'][_0x30c3('0xd8')]){_0x12ecba[_0x30c3('0xd9')]=[{'all':!![]}];}return db[_0x30c3('0x9e')]['findAll'](_0x12ecba);})[_0x30c3('0x1a')](function(_0x336747){_0xe39c69[_0x30c3('0x81')]=_0x336747;return _0xe39c69;});}})['then'](respondWithFilteredResult(_0x1d35b5,_0x12ecba))['catch'](handleError(_0x1d35b5,null));};exports[_0x30c3('0xdb')]=function(_0x7b8d3d,_0x56a1f0){var _0x3fdd30={'raw':!![],'where':{}};var _0x1b31c8={};var _0x11441a={'count':0x0,'rows':[]};return db[_0x30c3('0x22')][_0x30c3('0x27')]({'where':{'id':_0x7b8d3d[_0x30c3('0x83')]['id']}})['then'](handleEntityNotFound(_0x56a1f0,null))[_0x30c3('0x1a')](function(_0x3860a8){if(_0x3860a8){_0x1b31c8[_0x30c3('0x2c')]=_[_0x30c3('0x24')](db['CmHopperFinal'][_0x30c3('0xc1')]);_0x1b31c8['query']=_[_0x30c3('0x24')](_0x7b8d3d[_0x30c3('0x2d')]);_0x1b31c8[_0x30c3('0x2e')]=_[_0x30c3('0x2f')](_0x1b31c8[_0x30c3('0x2c')],_0x1b31c8[_0x30c3('0x2d')]);_0x3fdd30[_0x30c3('0x30')]=_[_0x30c3('0x2f')](_0x1b31c8[_0x30c3('0x2c')],qs[_0x30c3('0x31')](_0x7b8d3d['query'][_0x30c3('0x31')]));_0x3fdd30[_0x30c3('0x30')]=_0x3fdd30['attributes'][_0x30c3('0x2a')]?_0x3fdd30[_0x30c3('0x30')]:_0x1b31c8[_0x30c3('0x2c')];if(!_0x7b8d3d[_0x30c3('0x2d')][_0x30c3('0x32')](_0x30c3('0x33'))){_0x3fdd30['limit']=qs[_0x30c3('0x13')](_0x7b8d3d[_0x30c3('0x2d')][_0x30c3('0x13')]);_0x3fdd30['offset']=qs['offset'](_0x7b8d3d[_0x30c3('0x2d')][_0x30c3('0x15')]);}_0x3fdd30['order']=qs[_0x30c3('0x35')](_0x7b8d3d['query'][_0x30c3('0x35')]);_0x3fdd30['where']=qs[_0x30c3('0x2e')](_[_0x30c3('0x37')](_0x7b8d3d[_0x30c3('0x2d')],_0x1b31c8[_0x30c3('0x2e')]));_0x3fdd30[_0x30c3('0x36')]['ContactId']=_0x3860a8['id'];if(_0x7b8d3d[_0x30c3('0x2d')]['filter']){_0x3fdd30[_0x30c3('0x36')]=_[_0x30c3('0x78')](_0x3fdd30['where'],{'$or':_[_0x30c3('0x4a')](_0x3fdd30['attributes'],function(_0xe07f63){var _0x28314c={};_0x28314c[_0xe07f63]={'$like':'%'+_0x7b8d3d[_0x30c3('0x2d')][_0x30c3('0x56')]+'%'};return _0x28314c;})});}_0x3fdd30=_['merge']({},_0x3fdd30,_0x7b8d3d[_0x30c3('0xc2')]);return db['CmHopperFinal']['count']({'where':_0x3fdd30['where']})[_0x30c3('0x1a')](function(_0x553ba3){_0x11441a[_0x30c3('0x14')]=_0x553ba3;if(_0x7b8d3d[_0x30c3('0x2d')]['includeAll']){_0x3fdd30[_0x30c3('0xd9')]=[{'all':!![]}];}return db[_0x30c3('0x9d')][_0x30c3('0x8a')](_0x3fdd30);})[_0x30c3('0x1a')](function(_0x37d016){_0x11441a['rows']=_0x37d016;return _0x11441a;});}})[_0x30c3('0x1a')](respondWithFilteredResult(_0x56a1f0,_0x3fdd30))[_0x30c3('0x84')](handleError(_0x56a1f0,null));};exports[_0x30c3('0xdc')]=function(_0x553c21,_0x4f1570){var _0x512ae0={'raw':!![],'where':{}};var _0x523a22={};var _0x19cc7d={'count':0x0,'rows':[]};return db[_0x30c3('0x22')][_0x30c3('0x27')]({'where':{'id':_0x553c21['params']['id']}})[_0x30c3('0x1a')](handleEntityNotFound(_0x4f1570,null))[_0x30c3('0x1a')](function(_0x25b7ae){if(_0x25b7ae){_0x523a22[_0x30c3('0x2c')]=_['keys'](db[_0x30c3('0xa3')]['rawAttributes']);_0x523a22[_0x30c3('0x2d')]=_['keys'](_0x553c21[_0x30c3('0x2d')]);_0x523a22[_0x30c3('0x2e')]=_[_0x30c3('0x2f')](_0x523a22[_0x30c3('0x2c')],_0x523a22[_0x30c3('0x2d')]);_0x512ae0['attributes']=_[_0x30c3('0x2f')](_0x523a22[_0x30c3('0x2c')],qs[_0x30c3('0x31')](_0x553c21[_0x30c3('0x2d')][_0x30c3('0x31')]));_0x512ae0[_0x30c3('0x30')]=_0x512ae0[_0x30c3('0x30')][_0x30c3('0x2a')]?_0x512ae0['attributes']:_0x523a22[_0x30c3('0x2c')];if(!_0x553c21[_0x30c3('0x2d')][_0x30c3('0x32')]('nolimit')){_0x512ae0[_0x30c3('0x13')]=qs[_0x30c3('0x13')](_0x553c21['query'][_0x30c3('0x13')]);_0x512ae0['offset']=qs[_0x30c3('0x15')](_0x553c21[_0x30c3('0x2d')][_0x30c3('0x15')]);}_0x512ae0['order']=qs['sort'](_0x553c21[_0x30c3('0x2d')]['sort']);_0x512ae0[_0x30c3('0x36')]=qs[_0x30c3('0x2e')](_[_0x30c3('0x37')](_0x553c21[_0x30c3('0x2d')],_0x523a22[_0x30c3('0x2e')]));_0x512ae0['where'][_0x30c3('0xd7')]=_0x25b7ae['id'];if(_0x553c21[_0x30c3('0x2d')][_0x30c3('0x56')]){_0x512ae0[_0x30c3('0x36')]=_[_0x30c3('0x78')](_0x512ae0[_0x30c3('0x36')],{'$or':_['map'](_0x512ae0['attributes'],function(_0x5b74e8){var _0x3f8c12={};_0x3f8c12[_0x5b74e8]={'$like':'%'+_0x553c21[_0x30c3('0x2d')][_0x30c3('0x56')]+'%'};return _0x3f8c12;})});}_0x512ae0=_['merge']({},_0x512ae0,_0x553c21[_0x30c3('0xc2')]);return db[_0x30c3('0xa3')]['count']({'where':_0x512ae0[_0x30c3('0x36')]})[_0x30c3('0x1a')](function(_0x29b18e){_0x19cc7d['count']=_0x29b18e;if(_0x553c21[_0x30c3('0x2d')][_0x30c3('0xd8')]){_0x512ae0['include']=[{'all':!![]}];}return db[_0x30c3('0xa3')]['findAll'](_0x512ae0);})[_0x30c3('0x1a')](function(_0x34c10a){_0x19cc7d[_0x30c3('0x81')]=_0x34c10a;return _0x19cc7d;});}})[_0x30c3('0x1a')](respondWithFilteredResult(_0x4f1570,_0x512ae0))[_0x30c3('0x84')](handleError(_0x4f1570,null));};exports['uploadCsv']=function(_0x4107d0,_0x18da89){try{if(!_0x4107d0[_0x30c3('0x8d')][_0x30c3('0x5a')]){throw new Error(_0x30c3('0xdd'));}if(!_0x4107d0[_0x30c3('0x8d')]['binding_keys']){throw new Error(_0x30c3('0xde'));}if(!_0x4107d0[_0x30c3('0x8d')]['binding_values']){throw new Error(_0x30c3('0xdf'));}if(!_0x4107d0[_0x30c3('0x8d')][_0x30c3('0xe0')]){throw new Error(_0x30c3('0xe1'));}var _0x43bcf7=_0x4107d0[_0x30c3('0x8d')][_0x30c3('0xe2')][_0x30c3('0x49')](',');var _0x201061=_0x4107d0[_0x30c3('0x8d')][_0x30c3('0xe3')][_0x30c3('0x49')](',');if(!_0x43bcf7[_0x30c3('0x2a')]||!_0x201061[_0x30c3('0x2a')]||_0x43bcf7[_0x30c3('0x2a')]!==_0x201061[_0x30c3('0x2a')]){throw new Error(_0x30c3('0xe4'));}_0x4107d0[_0x30c3('0x8d')]['fields']=_[_0x30c3('0xe5')](_0x43bcf7,_0x201061);if(!_0x4107d0[_0x30c3('0x8d')][_0x30c3('0x31')][_0x30c3('0xbe')]){throw new Error(_0x30c3('0xe6'));}if(!_0x4107d0[_0x30c3('0x8d')]['fields'][_0x30c3('0xe7')]){throw new Error(_0x30c3('0xe8'));}var _0x3fd0a9=path['join'](config[_0x30c3('0xe9')],'server/files/tmp',_0x4107d0[_0x30c3('0xea')][_0x30c3('0xeb')]);fs[_0x30c3('0xec')](_0x3fd0a9,parseInt(_0x30c3('0xed'),0x8));var _0x3fd01a=require('child_process')[_0x30c3('0xee')](path[_0x30c3('0x91')](__dirname,_0x30c3('0xef')),[_0x3fd0a9,_0x4107d0[_0x30c3('0x8d')][_0x30c3('0xe2')],_0x4107d0[_0x30c3('0x8d')]['binding_values'],_0x4107d0['body']['ListId'],_0x4107d0['body']['CompanyId'],_0x4107d0[_0x30c3('0x8d')][_0x30c3('0xad')],_0x4107d0[_0x30c3('0x8d')][_0x30c3('0xe0')]]);return _0x18da89[_0x30c3('0x11')](0xc8)[_0x30c3('0x18')]({'message':_0x30c3('0xf0'),'pid':_0x3fd01a[_0x30c3('0xf1')]});}catch(_0x48b545){return _0x18da89[_0x30c3('0x11')](0x1f4)[_0x30c3('0x20')](_0x48b545);}};exports['upload']=function(_0x45efc0,_0x48bc94){var _0x323223=fs[_0x30c3('0xf2')](_0x45efc0['file'][_0x30c3('0x1')]);Papa[_0x30c3('0xf3')](_0x323223,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x153b3f){return _0x48bc94[_0x30c3('0x11')](0xc8)[_0x30c3('0x18')]({'file':_0x45efc0[_0x30c3('0xea')],'fields':_0x153b3f['meta'][_0x30c3('0x31')]});}});};exports['import']=function(_0x5611fd,_0x498802){return db[_0x30c3('0x70')][_0x30c3('0x8a')]({'raw':!![],'attributes':['id'],'where':{'role':_0x30c3('0x75')}})[_0x30c3('0x1a')](function(_0x31c68c){var _0x216122=![];if(!_0x5611fd[_0x30c3('0x8d')]['ListId']){throw new Error(_0x30c3('0xdd'));}if(!_0x5611fd['body'][_0x30c3('0xf4')][_0x30c3('0xbe')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x5611fd['body'][_0x30c3('0xf4')][_0x30c3('0xe7')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x5611fd[_0x30c3('0x8d')][_0x30c3('0xe0')]){throw new Error(_0x30c3('0xe1'));}var _0x35f708=require(_0x30c3('0xf5'))[_0x30c3('0xee')](path[_0x30c3('0x91')](__dirname,_0x30c3('0xf6')),[_0x5611fd[_0x30c3('0x83')]['id'],JSON[_0x30c3('0xf7')](_0x5611fd['body']),JSON[_0x30c3('0xf7')](_0x31c68c)]);_0x35f708['on'](_0x30c3('0xf8'),function(){_0x216122=!![];return _0x498802[_0x30c3('0x11')](0xc8)[_0x30c3('0x18')]({'message':_0x30c3('0xf9'),'pid':_0x35f708[_0x30c3('0xf1')]});});_0x35f708['on'](_0x30c3('0xfa'),function(_0x1c30f8){if(_0x1c30f8&&!_0x216122){return _0x498802[_0x30c3('0x11')](0x1f4)[_0x30c3('0x18')]({'message':'error\x20child\x20process','pid':_0x35f708[_0x30c3('0xf1')]});}});})[_0x30c3('0x84')](handleError(_0x498802,null));};exports[_0x30c3('0xfb')]=function(_0x279cbb,_0x145dc1,_0x29f542){return db[_0x30c3('0x70')][_0x30c3('0x8a')]({'raw':!![],'attributes':['id'],'where':{'role':_0x30c3('0x75')}})['then'](function(_0x257135){var _0x2b158f=![];if(!_0x279cbb[_0x30c3('0x8d')]['ListId']){throw new Error(_0x30c3('0xdd'));}if(!_0x279cbb['body']['binding']['phone']){throw new Error(_0x30c3('0xe6'));}if(!_0x279cbb['body'][_0x30c3('0xf4')][_0x30c3('0xe7')]){throw new Error(_0x30c3('0xe8'));}if(!_0x279cbb[_0x30c3('0x8d')][_0x30c3('0xe0')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x262b7d=require(_0x30c3('0xf5'))['fork'](path['join'](__dirname,_0x30c3('0xfc')),[_0x279cbb['params']['id'],JSON[_0x30c3('0xf7')](_0x279cbb[_0x30c3('0x8d')]),JSON['stringify'](_0x257135)]);_0x262b7d['on'](_0x30c3('0xf8'),function(_0x154296){_0x2b158f=!![];return _0x145dc1[_0x30c3('0x11')](0xc8)[_0x30c3('0x18')]({'message':_0x30c3('0xf9'),'pid':_0x262b7d[_0x30c3('0xf1')]});});_0x262b7d['on'](_0x30c3('0xfa'),function(_0x56c4ab){if(_0x56c4ab&&!_0x2b158f){return _0x145dc1[_0x30c3('0x11')](0x1f4)[_0x30c3('0x18')]({'message':_0x30c3('0xfd'),'pid':_0x262b7d[_0x30c3('0xf1')]});}});})[_0x30c3('0x84')](handleError(_0x145dc1,null));};exports[_0x30c3('0xfe')]=function(_0x470a4d,_0x251f2e){var _0x3e75b1=[_0x30c3('0xff'),_0x30c3('0x100'),_0x30c3('0x101'),_0x30c3('0x102'),_0x30c3('0x103'),_0x30c3('0x104'),_0x30c3('0x105')];var _0xd6e90e={'offset':0x0,'order':qs['sort'](_0x30c3('0x106'))},_0x37c9fd={'count':0x0,'rows':[]};Promise[_0x30c3('0x6e')]()[_0x30c3('0x1a')](function(){if(_0x470a4d['query']['channel']){if(!_[_0x30c3('0x107')](_0x3e75b1,_0x470a4d[_0x30c3('0x2d')][_0x30c3('0x108')][_0x30c3('0x109')]())){throw new Error(_0x30c3('0x10a'));}_0x3e75b1=[_0x470a4d[_0x30c3('0x2d')][_0x30c3('0x108')]['toLowerCase']()];}if(_0x470a4d['query'][_0x30c3('0x10b')]){try{var _0x4b0fef=JSON['parse'](_0x470a4d[_0x30c3('0x2d')][_0x30c3('0x10b')]);if(!moment(_0x4b0fef[_0x30c3('0x3b')])[_0x30c3('0x10c')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x4b0fef['to'])[_0x30c3('0x10c')]()){throw new Error(_0x30c3('0x10d'));}}catch(_0x115f01){throw new Error(_0x30c3('0x10e'));}}if(!_0x470a4d[_0x30c3('0x2d')][_0x30c3('0x32')](_0x30c3('0x33'))){_0xd6e90e[_0x30c3('0x13')]=qs['limit'](_0x470a4d[_0x30c3('0x2d')]['limit']||0xa);_0xd6e90e[_0x30c3('0x15')]=qs[_0x30c3('0x15')](_0x470a4d[_0x30c3('0x2d')][_0x30c3('0x15')]);}var _0x3ef1da=_0x3e75b1[_0x30c3('0x4a')](function(_0x4aa034){if(_0x4aa034===_0x30c3('0x105')){var _0x596122={'attributes':['id',_0x30c3('0x10f'),_0x30c3('0x53'),_0x30c3('0x110'),_0x30c3('0x111'),'callerid',_0x30c3('0x112'),'endtime',_0x30c3('0x113'),_0x30c3('0x114'),_0x30c3('0x115'),_0x30c3('0x116'),_0x30c3('0x117'),'userThirdDisposition','UserId'],'where':{'ContactId':_0x470a4d[_0x30c3('0x83')]['id']},'include':[{'model':db[_0x30c3('0x70')],'as':_0x30c3('0x70'),'attributes':['id',_0x30c3('0x1f'),'fullname','alias']}],'order':[[_0x30c3('0x115'),_0x30c3('0x118')]]};if(_0x470a4d[_0x30c3('0x2d')][_0x30c3('0x10b')]){_0x596122[_0x30c3('0x36')][_0x30c3('0x115')]={'$gte':_0x4b0fef[_0x30c3('0x3b')],'$lte':_0x4b0fef['to']};}return db[_0x30c3('0x9f')][_0x30c3('0x119')](_0x596122)[_0x30c3('0x1a')](function(_0x28e62e){_0x37c9fd['count']+=_0x28e62e['count'];return _['map'](_0x28e62e['rows'],function(_0x5a775d){var _0x557b17=_0x5a775d[_0x30c3('0x8e')]({'plain':!![]});_0x557b17[_0x30c3('0x108')]=_0x4aa034;if(_0x557b17['User']){_0x557b17[_0x30c3('0x70')]={'id':_0x557b17[_0x30c3('0x70')]['id'],'name':_0x557b17['User']['name'],'fullname':_0x557b17[_0x30c3('0x70')][_0x30c3('0x11a')],'alias':_0x557b17['User'][_0x30c3('0x11b')]};}return _0x557b17;});});}else{var _0x583353=_[_0x30c3('0x11c')](_0x4aa034)+(_0x4aa034===_0x30c3('0x100')?'Website':_0x30c3('0x11d'));var _0x2c0ddb={'attributes':['id',_0x30c3('0x11e'),_0x30c3('0x11f'),_0x30c3('0x115'),_0x30c3('0x114'),'disposition',_0x30c3('0x120'),_0x30c3('0x121'),'UserId',_0x583353+'Id'],'where':{'ContactId':_0x470a4d[_0x30c3('0x83')]['id']},'include':[{'model':db[_0x583353],'as':_0x30c3('0x11d'),'attributes':['id','name',_0x30c3('0x122')]},{'model':db[_0x30c3('0x70')],'as':_0x30c3('0x123'),'attributes':['id',_0x30c3('0x1f'),_0x30c3('0x11a')]},{'model':db[_0x30c3('0x47')],'as':_0x30c3('0x80'),'attributes':['id',_0x30c3('0x1f'),_0x30c3('0x3a')],'through':{'attributes':[]}}],'order':[[_0x30c3('0x115'),_0x30c3('0x118')]]};if(_0x470a4d[_0x30c3('0x2d')][_0x30c3('0x10b')]){_0x2c0ddb[_0x30c3('0x36')][_0x30c3('0x115')]={'$gte':_0x4b0fef[_0x30c3('0x3b')],'$lte':_0x4b0fef['to']};}switch(_0x4aa034){case _0x30c3('0x100'):_0x2c0ddb[_0x30c3('0x30')][_0x30c3('0x26')]('browserName',_0x30c3('0x124'),_0x30c3('0x125'),'deviceModel','osName',_0x30c3('0x126'),_0x30c3('0x127'),'ratingValue',_0x30c3('0x128'));break;case'mail':_0x2c0ddb[_0x30c3('0x30')]['push'](_0x30c3('0x129'),'substatus');break;case'openchannel':_0x2c0ddb[_0x30c3('0x30')][_0x30c3('0x26')](_0x30c3('0x12a'),_0x30c3('0x12b'));break;}return db[_[_0x30c3('0x11c')](_0x4aa034)+'Interaction'][_0x30c3('0x119')](_0x2c0ddb)[_0x30c3('0x1a')](function(_0x1f61f5){_0x37c9fd['count']+=_0x1f61f5[_0x30c3('0x14')];return _[_0x30c3('0x4a')](_0x1f61f5[_0x30c3('0x81')],function(_0x605ad){var _0x57d1fa=_0x605ad[_0x30c3('0x8e')]({'plain':!![]});_0x57d1fa['channel']=_0x4aa034;if(_0x57d1fa[_0x30c3('0x123')]){_0x57d1fa[_0x30c3('0x123')]={'id':_0x57d1fa['Owner']['id'],'name':_0x57d1fa[_0x30c3('0x123')][_0x30c3('0x1f')],'fullname':_0x57d1fa[_0x30c3('0x123')][_0x30c3('0x11a')]};}return _0x57d1fa;});});}});return Promise[_0x30c3('0x29')](_0x3ef1da);})['then'](function(_0x5cc30e){return _(_0x5cc30e)[_0x30c3('0x12c')]()[_0x30c3('0x12d')](_0x30c3('0x115'))[_0x30c3('0x12e')]()[_0x30c3('0x48')]();})[_0x30c3('0x1a')](function(_0x5c0ab6){_0x37c9fd[_0x30c3('0x81')]=_0xd6e90e['limit']?_0x5c0ab6[_0x30c3('0x12f')](_0xd6e90e['offset'],_0xd6e90e[_0x30c3('0x15')]+_0xd6e90e['limit']):_0x5c0ab6;return _0x37c9fd;})['then'](respondWithFilteredResult(_0x251f2e,_0xd6e90e))['catch'](handleError(_0x251f2e,null));};
\ No newline at end of file
index 8f834ad..5407b35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5449=['../../mysqldb','CmContact','setMaxListeners','save','remove','emit','hasOwnProperty','hook','events'];(function(_0x38c464,_0x37b6db){var _0x1efe17=function(_0x5bc455){while(--_0x5bc455){_0x38c464['push'](_0x38c464['shift']());}};_0x1efe17(++_0x37b6db);}(_0x5449,0xe0));var _0x9544=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x5449[_0x2a6809];return _0x11c371;};'use strict';var EventEmitter=require(_0x9544('0x0'));var CmContact=require(_0x9544('0x1'))['db'][_0x9544('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x9544('0x3')](0x0);var events={'afterCreate':_0x9544('0x4'),'afterUpdate':'update','afterDestroy':_0x9544('0x5')};function emitEvent(_0x3b0a3d){return function(_0x3ef208,_0x56e745,_0x301235){CmContactEvents[_0x9544('0x6')](_0x3b0a3d+':'+_0x3ef208['id'],_0x3ef208);CmContactEvents[_0x9544('0x6')](_0x3b0a3d,_0x3ef208);_0x301235(null);};}for(var e in events){if(events[_0x9544('0x7')](e)){var event=events[e];CmContact[_0x9544('0x8')](e,emitEvent(event));}}module['exports']=CmContactEvents;
\ No newline at end of file
+var _0x8882=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8882,0x136));var _0x2888=function(_0x5bf03b,_0xe57382){_0x5bf03b=_0x5bf03b-0x0;var _0x4e7740=_0x8882[_0x5bf03b];return _0x4e7740;};'use strict';var EventEmitter=require(_0x2888('0x0'));var CmContact=require(_0x2888('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0x2888('0x2')](0x0);var events={'afterCreate':_0x2888('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1fe702){return function(_0x59901f,_0x362ce8,_0x34daf6){CmContactEvents[_0x2888('0x4')](_0x1fe702+':'+_0x59901f['id'],_0x59901f);CmContactEvents[_0x2888('0x4')](_0x1fe702,_0x59901f);_0x34daf6(null);};}for(var e in events){if(events[_0x2888('0x5')](e)){var event=events[e];CmContact[_0x2888('0x6')](e,emitEvent(event));}}module[_0x2888('0x7')]=CmContactEvents;
\ No newline at end of file
index 25e8dd5..c6907d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a22=['isEmpty','destroy','ContactId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./cmContact.attributes','exports','cm_contacts','phone','fti_cm_contacts','lastName','mobile','utf8mb4','utf8mb4_unicode_ci','models','get','cmContact','afterCreate','inspect','scheduledat','isNil','VoiceQueue','findOne','then','dialTimezone','timezones','format','YYYY-MM-DD\x20HH:mm:ss','ret','cmContact,\x20afterCreate\x20','create','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','error','Campaign','utcOffset','minutes','CmHopper','\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','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','CmList','Lists','length','dialCheckDuplicateType','always','onlyIfOpen','cmContact,\x20%s,\x20%s','BlackLists','CmHopperBlack','message'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x3a22,0x1a6));var _0x23a2=function(_0xeff4f1,_0x149ba6){_0xeff4f1=_0xeff4f1-0x0;var _0x59b7d2=_0x3a22[_0xeff4f1];return _0x59b7d2;};'use strict';var _=require(_0x23a2('0x0'));var util=require(_0x23a2('0x1'));var logger=require(_0x23a2('0x2'))(_0x23a2('0x3'));var moment=require(_0x23a2('0x4'));var BPromise=require('bluebird');var rp=require(_0x23a2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x23a2('0x6'));var config=require('../../config/environment');var shared=require('../../config/environment/shared');var attributes=require(_0x23a2('0x7'));module[_0x23a2('0x8')]=function(_0x2e3d72,_0x3ea290){return _0x2e3d72['define']('CmContact',attributes,{'tableName':_0x23a2('0x9'),'paranoid':!![],'indexes':[{'name':_0x23a2('0xa'),'fields':[_0x23a2('0xa')]},{'name':_0x23a2('0xb'),'fields':['firstName',_0x23a2('0xc'),_0x23a2('0xa'),_0x23a2('0xd'),'fax','email'],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x23a2('0xe'),'collate':_0x23a2('0xf'),'hooks':{'afterCreate':function(_0x4e0b0c,_0x50d3e5,_0x1057a3){var _0x157649=_0x2e3d72[_0x23a2('0x10')];var _0x12bdb7=_0x4e0b0c[_0x23a2('0x11')]({'plain':!![]});function _0x42e684(){return function(_0x4c88e3){logger['error'](_0x23a2('0x12'),_0x23a2('0x13'),util[_0x23a2('0x14')](_0x4c88e3,{'showHidden':![],'depth':null}));};}function _0x43c97d(_0x271b08,_0x44b100){var _0x553c2d=_0x44b100[_0x23a2('0x15')]?_0x44b100['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x6529d1,_0xb4a88a){if(_[_0x23a2('0x16')](_0x44b100['dialTimezone'])){_0x6529d1({'ret':_0x553c2d});}else{_0x157649[_0x23a2('0x17')][_0x23a2('0x18')]({'where':{'id':_0x271b08['id']}})[_0x23a2('0x19')](function(_0x2f7bbe){if(!_[_0x23a2('0x16')](_0x2f7bbe)){var _0x3469a2=_0x2f7bbe[_0x23a2('0x1a')];if(!_[_0x23a2('0x16')](_0x3469a2)){var _0x5c55f1=shared[_0x23a2('0x1b')];var _0x7872bc=_0x5c55f1[_0x3469a2];var _0x43b5e5=_0x5c55f1[_0x44b100[_0x23a2('0x1a')]];if(!_[_0x23a2('0x16')](_0x7872bc)&&!_[_0x23a2('0x16')](_0x43b5e5)){var _0x411bc6=_0x7872bc['utcOffset']-_0x43b5e5['utcOffset'];_0x553c2d=_0x44b100[_0x23a2('0x15')]?_0x44b100['scheduledat']:moment();var _0x117794=moment(_0x553c2d)['add'](_0x411bc6,'minutes');_0x6529d1({'ret':_0x117794[_0x23a2('0x1c')](_0x23a2('0x1d'))});}else _0x6529d1({'ret':_0x553c2d});}else _0x6529d1({'ret':_0x553c2d});}else{_0x6529d1({'ret':_0x553c2d});}});}});return 0xa;}var _0x40e750=function(_0x4486ef){return new BPromise(function(_0x530239,_0x1bbe72){_0x43c97d(_0x4486ef,_0x12bdb7)[_0x23a2('0x19')](function(_0x1faf6c){_0x12bdb7[_0x23a2('0x15')]=_0x1faf6c[_0x23a2('0x1e')];_0x157649['CmHopper'][_0x23a2('0x18')]({'where':{'phone':_0x12bdb7[_0x23a2('0xa')],'VoiceQueueId':_0x4486ef['id']}})[_0x23a2('0x19')](function(_0x28f908){if(!_[_0x23a2('0x16')](_0x28f908)){throw new Error(_0x23a2('0x1f')+_0x12bdb7[_0x23a2('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x4486ef['id']);}return _0x157649['CmHopper'][_0x23a2('0x20')]({'phone':_0x12bdb7[_0x23a2('0xa')],'ContactId':_0x12bdb7['id'],'ListId':_0x12bdb7[_0x23a2('0x21')],'priority':_0x12bdb7[_0x23a2('0x22')]?_0x12bdb7[_0x23a2('0x22')]:0x2,'scheduledat':_0x12bdb7['scheduledat']?_0x12bdb7[_0x23a2('0x15')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x12bdb7[_0x23a2('0x23')]?!![]:![],'callbackuniqueid':_0x12bdb7[_0x23a2('0x23')]?_0x12bdb7[_0x23a2('0x23')]:undefined,'callbackat':_0x12bdb7[_0x23a2('0x23')]?moment()[_0x23a2('0x1c')](_0x23a2('0x1d')):undefined,'VoiceQueueId':_0x4486ef['id']});})[_0x23a2('0x24')](function(_0x4e65f7){_0x1bbe72(_0x4e65f7);});});});};var _0x59a1ca=function(_0x1b2345){return new BPromise(function(_0x165d7f,_0x144731){_0x43c97d(_0x1b2345,_0x12bdb7)[_0x23a2('0x19')](function(_0x16fbc8){_0x12bdb7['scheduledat']=_0x16fbc8[_0x23a2('0x1e')];_0x157649['CmHopper'][_0x23a2('0x18')]({'where':{'phone':_0x12bdb7[_0x23a2('0xa')],'VoiceQueueId':_0x1b2345['id']}})[_0x23a2('0x19')](function(_0x79c871){if(!_['isNil'](_0x79c871)){throw new Error(_0x23a2('0x1f')+_0x12bdb7[_0x23a2('0xa')]+_0x23a2('0x25')+_0x1b2345['id']);}return _0x157649[_0x23a2('0x26')][_0x23a2('0x18')]({'where':{'calleridnum':_0x12bdb7[_0x23a2('0xa')],'VoiceQueueId':_0x1b2345['id']}});})['then'](function(_0x5bfd7d){if(!_['isNil'](_0x5bfd7d)){throw new Error(_0x23a2('0x27')+_0x12bdb7[_0x23a2('0xa')]+_0x23a2('0x28')+_0x1b2345['id']);}return _0x157649['CmHopper'][_0x23a2('0x20')]({'phone':_0x12bdb7['phone'],'ContactId':_0x12bdb7['id'],'ListId':_0x12bdb7['ListId'],'priority':_0x12bdb7[_0x23a2('0x22')]?_0x12bdb7[_0x23a2('0x22')]:0x2,'scheduledat':_0x12bdb7[_0x23a2('0x15')]?_0x12bdb7[_0x23a2('0x15')]:moment()[_0x23a2('0x1c')](_0x23a2('0x1d')),'callback':_0x12bdb7[_0x23a2('0x23')]?!![]:![],'callbackuniqueid':_0x12bdb7[_0x23a2('0x23')]?_0x12bdb7[_0x23a2('0x23')]:undefined,'callbackat':_0x12bdb7[_0x23a2('0x23')]?moment()[_0x23a2('0x1c')](_0x23a2('0x1d')):undefined,'VoiceQueueId':_0x1b2345['id']});})[_0x23a2('0x24')](function(_0x25c396){_0x144731(_0x25c396);});});});};function _0xd08ebe(){return function(_0x145ba7){logger[_0x23a2('0x29')]('cmContact',_0x23a2('0x13'),util['inspect'](_0x145ba7,{'showHidden':![],'depth':null}));};}function _0x30025c(_0x484600,_0x5d2453){var _0x35a578=_0x5d2453['scheduledat']?_0x5d2453[_0x23a2('0x15')]:moment()['format'](_0x23a2('0x1d'));return new BPromise(function(_0x50dfd6,_0x596678){if(_['isNil'](_0x5d2453['dialTimezone'])){_0x50dfd6({'ret':_0x35a578});}else{_0x157649[_0x23a2('0x2a')][_0x23a2('0x18')]({'where':{'id':_0x484600['id']}})[_0x23a2('0x19')](function(_0x5b0937){if(!_[_0x23a2('0x16')](_0x5b0937)){var _0x3988a6=_0x5b0937['dialTimezone'];if(!_[_0x23a2('0x16')](_0x3988a6)){var _0x502ea4=shared['timezones'];var _0x46503c=_0x502ea4[_0x3988a6];var _0x55133e=_0x502ea4[_0x5d2453[_0x23a2('0x1a')]];if(!_[_0x23a2('0x16')](_0x46503c)&&!_[_0x23a2('0x16')](_0x55133e)){var _0x5e2135=_0x46503c[_0x23a2('0x2b')]-_0x55133e[_0x23a2('0x2b')];_0x35a578=_0x5d2453[_0x23a2('0x15')]?_0x5d2453[_0x23a2('0x15')]:moment();var _0x19be0e=moment(_0x35a578)['add'](_0x5e2135,_0x23a2('0x2c'));_0x50dfd6({'ret':_0x19be0e[_0x23a2('0x1c')](_0x23a2('0x1d'))});}else _0x50dfd6({'ret':_0x35a578});}else _0x50dfd6({'ret':_0x35a578});}else{_0x50dfd6({'ret':_0x35a578});}});}});return 0xa;}var _0x41aad3=function(_0x15771c){return new BPromise(function(_0x42d4a4,_0x2f435c){_0x30025c(_0x15771c,_0x12bdb7)[_0x23a2('0x19')](function(_0x18c58d){_0x12bdb7[_0x23a2('0x15')]=_0x18c58d[_0x23a2('0x1e')];_0x157649[_0x23a2('0x2d')][_0x23a2('0x18')]({'where':{'phone':_0x12bdb7['phone'],'CampaignId':_0x15771c['id']}})['then'](function(_0x101ccf){if(!_['isNil'](_0x101ccf)){throw new Error(_0x23a2('0x1f')+_0x12bdb7['phone']+_0x23a2('0x2e')+_0x15771c['id']);}return _0x157649['CmHopper'][_0x23a2('0x20')]({'phone':_0x12bdb7[_0x23a2('0xa')],'ContactId':_0x12bdb7['id'],'ListId':_0x12bdb7['ListId'],'priority':_0x12bdb7[_0x23a2('0x22')]?_0x12bdb7['priority']:0x2,'scheduledat':_0x12bdb7[_0x23a2('0x15')]?_0x12bdb7['scheduledat']:moment()[_0x23a2('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x12bdb7['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x12bdb7[_0x23a2('0x23')]?_0x12bdb7[_0x23a2('0x23')]:undefined,'callbackat':_0x12bdb7[_0x23a2('0x23')]?moment()[_0x23a2('0x1c')](_0x23a2('0x1d')):undefined,'CampaignId':_0x15771c['id']});})[_0x23a2('0x24')](function(_0x1a9a4d){_0x2f435c(_0x1a9a4d);});});});};var _0x2f69db=function(_0x3e5980){return new BPromise(function(_0x32a859,_0x5e10f1){_0x30025c(_0x3e5980,_0x12bdb7)['then'](function(_0x20f768){_0x12bdb7[_0x23a2('0x15')]=_0x20f768[_0x23a2('0x1e')];_0x157649[_0x23a2('0x2d')][_0x23a2('0x18')]({'where':{'phone':_0x12bdb7[_0x23a2('0xa')],'CampaignId':_0x3e5980['id']}})[_0x23a2('0x19')](function(_0x4a49a5){if(!_['isNil'](_0x4a49a5)){throw new Error(_0x23a2('0x1f')+_0x12bdb7[_0x23a2('0xa')]+_0x23a2('0x2f')+_0x3e5980['id']);}return _0x157649[_0x23a2('0x26')][_0x23a2('0x18')]({'where':{'calleridnum':_0x12bdb7['phone'],'CampaignId':_0x3e5980['id']}});})[_0x23a2('0x19')](function(_0x260094){if(!_['isNil'](_0x260094)){throw new Error(_0x23a2('0x27')+_0x12bdb7['phone']+_0x23a2('0x30')+_0x3e5980['id']);}return _0x157649[_0x23a2('0x2d')][_0x23a2('0x20')]({'phone':_0x12bdb7[_0x23a2('0xa')],'ContactId':_0x12bdb7['id'],'ListId':_0x12bdb7[_0x23a2('0x21')],'priority':_0x12bdb7['priority']?_0x12bdb7[_0x23a2('0x22')]:0x2,'scheduledat':_0x12bdb7[_0x23a2('0x15')]?_0x12bdb7['scheduledat']:moment()[_0x23a2('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x12bdb7['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x12bdb7[_0x23a2('0x23')]?_0x12bdb7['callbackUniqueid']:undefined,'callbackat':_0x12bdb7[_0x23a2('0x23')]?moment()[_0x23a2('0x1c')](_0x23a2('0x1d')):undefined,'CampaignId':_0x3e5980['id']});})['catch'](function(_0x422f74){_0x5e10f1(_0x422f74);});});});};if(_0x12bdb7[_0x23a2('0x21')]){_0x157649[_0x23a2('0x17')][_0x23a2('0x31')]({'where':{'type':_0x23a2('0x32')},'attributes':['id','dialCheckDuplicateType',_0x23a2('0x1a')],'include':[{'model':_0x157649[_0x23a2('0x33')],'as':_0x23a2('0x34'),'where':{'id':_0x12bdb7[_0x23a2('0x21')]}}]})[_0x23a2('0x19')](function(_0x561012){if(_0x561012){var _0x106ecd=[];for(var _0x562efd=0x0,_0x3a3f92;_0x562efd<_0x561012[_0x23a2('0x35')];_0x562efd+=0x1){_0x3a3f92=_0x561012[_0x562efd][_0x23a2('0x11')]({'plain':!![]});switch(_0x3a3f92[_0x23a2('0x36')]){case _0x23a2('0x37'):_0x59a1ca(_0x3a3f92)['catch'](_0x42e684());break;case _0x23a2('0x38'):_0x40e750(_0x3a3f92)[_0x23a2('0x24')](_0x42e684());break;default:_0x30025c(_0x3a3f92,_0x12bdb7)[_0x23a2('0x19')](function(_0x54dff7){_0x12bdb7[_0x23a2('0x15')]=_0x54dff7[_0x23a2('0x1e')];_0x157649['CmHopper'][_0x23a2('0x20')]({'phone':_0x12bdb7[_0x23a2('0xa')],'ContactId':_0x12bdb7['id'],'ListId':_0x12bdb7['ListId'],'scheduledat':_0x12bdb7[_0x23a2('0x15')]?_0x12bdb7[_0x23a2('0x15')]:moment()[_0x23a2('0x1c')](_0x23a2('0x1d')),'priority':_0x12bdb7[_0x23a2('0x22')]?_0x12bdb7[_0x23a2('0x22')]:0x2,'callback':_0x12bdb7[_0x23a2('0x23')]?!![]:![],'callbackuniqueid':_0x12bdb7[_0x23a2('0x23')]?_0x12bdb7[_0x23a2('0x23')]:undefined,'callbackat':_0x12bdb7[_0x23a2('0x23')]?moment()['format'](_0x23a2('0x1d')):undefined,'VoiceQueueId':_0x3a3f92['id']})[_0x23a2('0x24')](_0x42e684());});}}}})[_0x23a2('0x19')](function(){return _0x157649['VoiceQueue'][_0x23a2('0x31')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x157649[_0x23a2('0x33')],'as':'BlackLists','where':{'id':_0x12bdb7[_0x23a2('0x21')]}}]})[_0x23a2('0x19')](function(_0x137d4f){if(_0x137d4f){var _0x4cf266=[];for(var _0x1fb98c=0x0,_0x51a957;_0x1fb98c<_0x137d4f[_0x23a2('0x35')];_0x1fb98c+=0x1){_0x51a957=_0x137d4f[_0x1fb98c][_0x23a2('0x11')]({'plain':!![]});_0x157649['CmHopperBlack'][_0x23a2('0x20')]({'phone':_0x12bdb7[_0x23a2('0xa')],'ContactId':_0x12bdb7['id'],'ListId':_0x12bdb7[_0x23a2('0x21')],'VoiceQueueId':_0x51a957['id']})[_0x23a2('0x24')](function(_0x2663b4){logger[_0x23a2('0x29')](_0x23a2('0x39'),_0x23a2('0x13'),_0x2663b4['message']);});}}});})[_0x23a2('0x19')](function(){return _0x157649[_0x23a2('0x2a')][_0x23a2('0x31')]({'attributes':['id','dialCheckDuplicateType',_0x23a2('0x1a')],'include':[{'model':_0x157649[_0x23a2('0x33')],'as':_0x23a2('0x34'),'where':{'id':_0x12bdb7['ListId']}}]})[_0x23a2('0x19')](function(_0x50ec83){if(_0x50ec83){var _0x152f12=[];for(var _0x218290=0x0,_0x32a7da;_0x218290<_0x50ec83[_0x23a2('0x35')];_0x218290+=0x1){_0x32a7da=_0x50ec83[_0x218290][_0x23a2('0x11')]({'plain':!![]});switch(_0x32a7da['dialCheckDuplicateType']){case _0x23a2('0x37'):_0x2f69db(_0x32a7da)[_0x23a2('0x24')](_0xd08ebe());break;case _0x23a2('0x38'):_0x41aad3(_0x32a7da)[_0x23a2('0x24')](_0xd08ebe());break;default:_0x157649[_0x23a2('0x2d')][_0x23a2('0x20')]({'phone':_0x12bdb7[_0x23a2('0xa')],'ContactId':_0x12bdb7['id'],'ListId':_0x12bdb7[_0x23a2('0x21')],'scheduledat':_0x12bdb7['scheduledat']?_0x12bdb7[_0x23a2('0x15')]:moment()[_0x23a2('0x1c')](_0x23a2('0x1d')),'priority':_0x12bdb7[_0x23a2('0x22')]?_0x12bdb7[_0x23a2('0x22')]:0x2,'callback':_0x12bdb7[_0x23a2('0x23')]?!![]:![],'callbackuniqueid':_0x12bdb7[_0x23a2('0x23')]?_0x12bdb7[_0x23a2('0x23')]:undefined,'callbackat':_0x12bdb7[_0x23a2('0x23')]?moment()[_0x23a2('0x1c')](_0x23a2('0x1d')):undefined,'CampaignId':_0x32a7da['id']})[_0x23a2('0x24')](_0xd08ebe());}}}});})['then'](function(){return _0x157649[_0x23a2('0x2a')][_0x23a2('0x31')]({'attributes':['id'],'include':[{'model':_0x157649[_0x23a2('0x33')],'as':_0x23a2('0x3a'),'where':{'id':_0x12bdb7['ListId']}}]})['then'](function(_0x34d4e8){if(_0x34d4e8){var _0x22fb6b=[];for(var _0x2ffc7c=0x0,_0x342bf2;_0x2ffc7c<_0x34d4e8[_0x23a2('0x35')];_0x2ffc7c+=0x1){_0x342bf2=_0x34d4e8[_0x2ffc7c]['get']({'plain':!![]});_0x157649[_0x23a2('0x3b')][_0x23a2('0x20')]({'phone':_0x12bdb7[_0x23a2('0xa')],'ContactId':_0x12bdb7['id'],'ListId':_0x12bdb7[_0x23a2('0x21')],'CampaignId':_0x342bf2['id']})[_0x23a2('0x24')](function(_0x1e9c75){logger[_0x23a2('0x29')](_0x23a2('0x39'),_0x23a2('0x13'),_0x1e9c75[_0x23a2('0x3c')]);});}}});})[_0x23a2('0x19')](function(){_0x1057a3();})[_0x23a2('0x24')](function(_0x4843bc){logger[_0x23a2('0x29')]('cmContact,\x20%s,\x20%s',_0x23a2('0x13'),_0x4843bc[_0x23a2('0x3c')]);_0x1057a3(_0x4843bc);});}else{_0x1057a3(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0xb8a240,_0x49ceb5,_0x1522e6){var _0x440942=_0x2e3d72[_0x23a2('0x10')];var _0x27f744=_0xb8a240[_0x23a2('0x11')]({'plain':!![]});return _0x440942[_0x23a2('0x2d')]['findAll']({'raw':!![],'where':{'ListId':_0x27f744[_0x23a2('0x21')],'ContactId':_0x27f744['id']}})[_0x23a2('0x19')](function(_0x43d981){if(!_[_0x23a2('0x3d')](_0x43d981)){var _0xabdd58=[];for(var _0x31b205=0x0;_0x31b205<_0x43d981[_0x23a2('0x35')];_0x31b205+=0x1){var _0x4b97e2=_0x440942[_0x23a2('0x2d')][_0x23a2('0x3e')]({'where':{'ListId':_0x43d981[_0x31b205][_0x23a2('0x21')],'ContactId':_0x43d981[_0x31b205][_0x23a2('0x3f')],'VoiceQueueId':_0x43d981[_0x31b205]['VoiceQueueId'],'CampaignId':_0x43d981[_0x31b205]['CampaignId']}});_0xabdd58[_0x23a2('0x40')](_0x4b97e2);}return BPromise[_0x23a2('0x41')](_0xabdd58);}})[_0x23a2('0x19')](function(_0x44c1c1){logger[_0x23a2('0x42')](_0x23a2('0x43'),util[_0x23a2('0x14')](_0x44c1c1,{'showHidden':![],'depth':null}));_0x1522e6();})[_0x23a2('0x24')](function(_0x147258){logger[_0x23a2('0x29')](_0x23a2('0x44'),util[_0x23a2('0x14')](_0x147258,{'showHidden':![],'depth':null}));_0x1522e6(_0x147258);});}}});};
\ No newline at end of file
+var _0x2057=['cmContact,\x20afterCreate,\x20','error','Campaign','utcOffset','\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','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','onlyIfOpen','BlackLists','length','cmContact,\x20%s,\x20%s','message','CmHopperBlack','List\x20not\x20found','isEmpty','destroy','CampaignId','push','all','info','[CmContact][afterDestroy][Error]','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','../../config/environment/shared','exports','define','CmContact','phone','fti_cm_contacts','firstName','lastName','mobile','email','FULLTEXT','get','cmContact','afterCreate','inspect','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','VoiceQueue','findOne','then','isNil','timezones','add','minutes','ret','CmHopper','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal'];(function(_0x4bc314,_0x20a3dd){var _0xfc7d8c=function(_0x5b7ea6){while(--_0x5b7ea6){_0x4bc314['push'](_0x4bc314['shift']());}};_0xfc7d8c(++_0x20a3dd);}(_0x2057,0x13b));var _0x7205=function(_0x33bea9,_0x5b0c0f){_0x33bea9=_0x33bea9-0x0;var _0x1d178b=_0x2057[_0x33bea9];return _0x1d178b;};'use strict';var _=require('lodash');var util=require(_0x7205('0x0'));var logger=require(_0x7205('0x1'))(_0x7205('0x2'));var moment=require(_0x7205('0x3'));var BPromise=require(_0x7205('0x4'));var rp=require(_0x7205('0x5'));var fs=require('fs');var path=require(_0x7205('0x6'));var rimraf=require('rimraf');var config=require(_0x7205('0x7'));var shared=require(_0x7205('0x8'));var attributes=require('./cmContact.attributes');module[_0x7205('0x9')]=function(_0x13e60e,_0x2e97fd){return _0x13e60e[_0x7205('0xa')](_0x7205('0xb'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x7205('0xc'),'fields':[_0x7205('0xc')]},{'name':_0x7205('0xd'),'fields':[_0x7205('0xe'),_0x7205('0xf'),_0x7205('0xc'),_0x7205('0x10'),'fax',_0x7205('0x11')],'type':_0x7205('0x12')}],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x7abe63,_0x488611,_0x5f1f2b){var _0x21438e=_0x13e60e['models'];var _0x35aba1=_0x7abe63[_0x7205('0x13')]({'plain':!![]});function _0x699836(){return function(_0x33e947){logger['error'](_0x7205('0x14'),_0x7205('0x15'),util[_0x7205('0x16')](_0x33e947,{'showHidden':![],'depth':null}));};}function _0x450217(_0x520e6d,_0x5e5279){var _0x49ab82=_0x5e5279[_0x7205('0x17')]?_0x5e5279[_0x7205('0x17')]:moment()[_0x7205('0x18')](_0x7205('0x19'));return new BPromise(function(_0x58c19c,_0x28bf25){if(_['isNil'](_0x5e5279[_0x7205('0x1a')])){_0x58c19c({'ret':_0x49ab82});}else{_0x21438e[_0x7205('0x1b')][_0x7205('0x1c')]({'where':{'id':_0x520e6d['id']}})[_0x7205('0x1d')](function(_0x50e406){if(!_[_0x7205('0x1e')](_0x50e406)){var _0x34d2f7=_0x50e406['dialTimezone'];if(!_[_0x7205('0x1e')](_0x34d2f7)){var _0xeed14f=shared[_0x7205('0x1f')];var _0x5e5cdd=_0xeed14f[_0x34d2f7];var _0x5d51fe=_0xeed14f[_0x5e5279[_0x7205('0x1a')]];if(!_[_0x7205('0x1e')](_0x5e5cdd)&&!_[_0x7205('0x1e')](_0x5d51fe)){var _0x42af8b=_0x5e5cdd['utcOffset']-_0x5d51fe['utcOffset'];_0x49ab82=_0x5e5279[_0x7205('0x17')]?_0x5e5279[_0x7205('0x17')]:moment();var _0x2754c8=moment(_0x49ab82)[_0x7205('0x20')](_0x42af8b,_0x7205('0x21'));_0x58c19c({'ret':_0x2754c8[_0x7205('0x18')](_0x7205('0x19'))});}else _0x58c19c({'ret':_0x49ab82});}else _0x58c19c({'ret':_0x49ab82});}else{_0x58c19c({'ret':_0x49ab82});}});}});return 0xa;}var _0x141ad4=function(_0x1fc129){return new BPromise(function(_0x36bae5,_0x4f31d3){_0x450217(_0x1fc129,_0x35aba1)[_0x7205('0x1d')](function(_0x1a458a){_0x35aba1['scheduledat']=_0x1a458a[_0x7205('0x22')];_0x21438e[_0x7205('0x23')][_0x7205('0x1c')]({'where':{'phone':_0x35aba1['phone'],'VoiceQueueId':_0x1fc129['id']}})[_0x7205('0x1d')](function(_0x5972e4){if(!_[_0x7205('0x1e')](_0x5972e4)){throw new Error('cmContact,\x20afterCreate\x20'+_0x35aba1[_0x7205('0xc')]+_0x7205('0x24')+_0x1fc129['id']);}return _0x21438e[_0x7205('0x23')][_0x7205('0x25')]({'phone':_0x35aba1['phone'],'ContactId':_0x35aba1['id'],'ListId':_0x35aba1[_0x7205('0x26')],'priority':_0x35aba1[_0x7205('0x27')]?_0x35aba1[_0x7205('0x27')]:0x2,'scheduledat':_0x35aba1['scheduledat']?_0x35aba1['scheduledat']:moment()[_0x7205('0x18')](_0x7205('0x19')),'callback':_0x35aba1[_0x7205('0x28')]?!![]:![],'callbackuniqueid':_0x35aba1[_0x7205('0x28')]?_0x35aba1['callbackUniqueid']:undefined,'callbackat':_0x35aba1[_0x7205('0x28')]?moment()[_0x7205('0x18')](_0x7205('0x19')):undefined,'VoiceQueueId':_0x1fc129['id']});})[_0x7205('0x29')](function(_0x577554){_0x4f31d3(_0x577554);});});});};var _0x16e810=function(_0x1b0f4e){return new BPromise(function(_0x2f9b26,_0x531a72){_0x450217(_0x1b0f4e,_0x35aba1)[_0x7205('0x1d')](function(_0xcad167){_0x35aba1[_0x7205('0x17')]=_0xcad167[_0x7205('0x22')];_0x21438e[_0x7205('0x23')]['findOne']({'where':{'phone':_0x35aba1[_0x7205('0xc')],'VoiceQueueId':_0x1b0f4e['id']}})[_0x7205('0x1d')](function(_0x2fa4dd){if(!_[_0x7205('0x1e')](_0x2fa4dd)){throw new Error(_0x7205('0x2a')+_0x35aba1[_0x7205('0xc')]+_0x7205('0x2b')+_0x1b0f4e['id']);}return _0x21438e[_0x7205('0x2c')]['findOne']({'where':{'calleridnum':_0x35aba1[_0x7205('0xc')],'VoiceQueueId':_0x1b0f4e['id']}});})[_0x7205('0x1d')](function(_0x55c463){if(!_[_0x7205('0x1e')](_0x55c463)){throw new Error(_0x7205('0x2d')+_0x35aba1['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x1b0f4e['id']);}return _0x21438e[_0x7205('0x23')][_0x7205('0x25')]({'phone':_0x35aba1[_0x7205('0xc')],'ContactId':_0x35aba1['id'],'ListId':_0x35aba1[_0x7205('0x26')],'priority':_0x35aba1[_0x7205('0x27')]?_0x35aba1[_0x7205('0x27')]:0x2,'scheduledat':_0x35aba1[_0x7205('0x17')]?_0x35aba1[_0x7205('0x17')]:moment()[_0x7205('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x35aba1[_0x7205('0x28')]?!![]:![],'callbackuniqueid':_0x35aba1[_0x7205('0x28')]?_0x35aba1[_0x7205('0x28')]:undefined,'callbackat':_0x35aba1[_0x7205('0x28')]?moment()[_0x7205('0x18')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x1b0f4e['id']});})['catch'](function(_0x7fc982){_0x531a72(_0x7fc982);});});});};function _0x494151(){return function(_0xf4e8f0){logger[_0x7205('0x2e')](_0x7205('0x14'),_0x7205('0x15'),util[_0x7205('0x16')](_0xf4e8f0,{'showHidden':![],'depth':null}));};}function _0x11165c(_0x233c70,_0xfa5db){var _0xb495cb=_0xfa5db[_0x7205('0x17')]?_0xfa5db[_0x7205('0x17')]:moment()[_0x7205('0x18')](_0x7205('0x19'));return new BPromise(function(_0x5082d1,_0x2fc6bb){if(_[_0x7205('0x1e')](_0xfa5db[_0x7205('0x1a')])){_0x5082d1({'ret':_0xb495cb});}else{_0x21438e[_0x7205('0x2f')]['findOne']({'where':{'id':_0x233c70['id']}})[_0x7205('0x1d')](function(_0x350422){if(!_[_0x7205('0x1e')](_0x350422)){var _0x1e242d=_0x350422[_0x7205('0x1a')];if(!_[_0x7205('0x1e')](_0x1e242d)){var _0x53ea03=shared['timezones'];var _0x582494=_0x53ea03[_0x1e242d];var _0x4097e6=_0x53ea03[_0xfa5db[_0x7205('0x1a')]];if(!_[_0x7205('0x1e')](_0x582494)&&!_[_0x7205('0x1e')](_0x4097e6)){var _0x50a951=_0x582494[_0x7205('0x30')]-_0x4097e6[_0x7205('0x30')];_0xb495cb=_0xfa5db[_0x7205('0x17')]?_0xfa5db[_0x7205('0x17')]:moment();var _0x1a0f0e=moment(_0xb495cb)[_0x7205('0x20')](_0x50a951,_0x7205('0x21'));_0x5082d1({'ret':_0x1a0f0e[_0x7205('0x18')](_0x7205('0x19'))});}else _0x5082d1({'ret':_0xb495cb});}else _0x5082d1({'ret':_0xb495cb});}else{_0x5082d1({'ret':_0xb495cb});}});}});return 0xa;}var _0x5cafc9=function(_0x59ae2f){return new BPromise(function(_0x423d72,_0x2a4dbe){_0x11165c(_0x59ae2f,_0x35aba1)[_0x7205('0x1d')](function(_0x842f4e){_0x35aba1['scheduledat']=_0x842f4e['ret'];_0x21438e['CmHopper'][_0x7205('0x1c')]({'where':{'phone':_0x35aba1[_0x7205('0xc')],'CampaignId':_0x59ae2f['id']}})[_0x7205('0x1d')](function(_0x54fd14){if(!_['isNil'](_0x54fd14)){throw new Error(_0x7205('0x2a')+_0x35aba1[_0x7205('0xc')]+_0x7205('0x31')+_0x59ae2f['id']);}return _0x21438e[_0x7205('0x23')]['create']({'phone':_0x35aba1[_0x7205('0xc')],'ContactId':_0x35aba1['id'],'ListId':_0x35aba1[_0x7205('0x26')],'priority':_0x35aba1[_0x7205('0x27')]?_0x35aba1[_0x7205('0x27')]:0x2,'scheduledat':_0x35aba1[_0x7205('0x17')]?_0x35aba1['scheduledat']:moment()[_0x7205('0x18')](_0x7205('0x19')),'callback':_0x35aba1[_0x7205('0x28')]?!![]:![],'callbackuniqueid':_0x35aba1['callbackUniqueid']?_0x35aba1[_0x7205('0x28')]:undefined,'callbackat':_0x35aba1[_0x7205('0x28')]?moment()[_0x7205('0x18')](_0x7205('0x19')):undefined,'CampaignId':_0x59ae2f['id']});})[_0x7205('0x29')](function(_0x2477d6){_0x2a4dbe(_0x2477d6);});});});};var _0x2f808a=function(_0x249357){return new BPromise(function(_0x4fa962,_0x490d80){_0x11165c(_0x249357,_0x35aba1)[_0x7205('0x1d')](function(_0x5568d3){_0x35aba1['scheduledat']=_0x5568d3[_0x7205('0x22')];_0x21438e['CmHopper']['findOne']({'where':{'phone':_0x35aba1[_0x7205('0xc')],'CampaignId':_0x249357['id']}})[_0x7205('0x1d')](function(_0xb49b26){if(!_[_0x7205('0x1e')](_0xb49b26)){throw new Error('cmContact,\x20afterCreate\x20'+_0x35aba1[_0x7205('0xc')]+_0x7205('0x32')+_0x249357['id']);}return _0x21438e[_0x7205('0x2c')][_0x7205('0x1c')]({'where':{'calleridnum':_0x35aba1['phone'],'CampaignId':_0x249357['id']}});})[_0x7205('0x1d')](function(_0x384356){if(!_[_0x7205('0x1e')](_0x384356)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x35aba1['phone']+_0x7205('0x33')+_0x249357['id']);}return _0x21438e[_0x7205('0x23')][_0x7205('0x25')]({'phone':_0x35aba1['phone'],'ContactId':_0x35aba1['id'],'ListId':_0x35aba1[_0x7205('0x26')],'priority':_0x35aba1[_0x7205('0x27')]?_0x35aba1[_0x7205('0x27')]:0x2,'scheduledat':_0x35aba1[_0x7205('0x17')]?_0x35aba1['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x35aba1['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x35aba1[_0x7205('0x28')]?_0x35aba1[_0x7205('0x28')]:undefined,'callbackat':_0x35aba1[_0x7205('0x28')]?moment()[_0x7205('0x18')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x249357['id']});})['catch'](function(_0x2a9563){_0x490d80(_0x2a9563);});});});};if(_0x35aba1['ListId']){_0x21438e[_0x7205('0x1b')][_0x7205('0x34')]({'where':{'type':_0x7205('0x35')},'attributes':['id',_0x7205('0x36'),_0x7205('0x1a')],'include':[{'model':_0x21438e[_0x7205('0x37')],'as':_0x7205('0x38'),'where':{'id':_0x35aba1[_0x7205('0x26')]}}]})['then'](function(_0x45364d){if(_0x45364d){var _0x1cc6b0=[];for(var _0x10c6fa=0x0,_0x3c443b;_0x10c6fa<_0x45364d['length'];_0x10c6fa+=0x1){_0x3c443b=_0x45364d[_0x10c6fa]['get']({'plain':!![]});switch(_0x3c443b[_0x7205('0x36')]){case _0x7205('0x39'):_0x16e810(_0x3c443b)[_0x7205('0x29')](_0x699836());break;case _0x7205('0x3a'):_0x141ad4(_0x3c443b)[_0x7205('0x29')](_0x699836());break;default:_0x11165c(_0x3c443b,_0x35aba1)[_0x7205('0x1d')](function(_0x51dc0c){_0x35aba1[_0x7205('0x17')]=_0x51dc0c[_0x7205('0x22')];_0x21438e['CmHopper'][_0x7205('0x25')]({'phone':_0x35aba1['phone'],'ContactId':_0x35aba1['id'],'ListId':_0x35aba1[_0x7205('0x26')],'scheduledat':_0x35aba1[_0x7205('0x17')]?_0x35aba1[_0x7205('0x17')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x35aba1[_0x7205('0x27')]?_0x35aba1[_0x7205('0x27')]:0x2,'callback':_0x35aba1[_0x7205('0x28')]?!![]:![],'callbackuniqueid':_0x35aba1[_0x7205('0x28')]?_0x35aba1[_0x7205('0x28')]:undefined,'callbackat':_0x35aba1['callbackUniqueid']?moment()[_0x7205('0x18')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x3c443b['id']})[_0x7205('0x29')](_0x699836());});}}}})['then'](function(){return _0x21438e[_0x7205('0x1b')][_0x7205('0x34')]({'where':{'type':_0x7205('0x35')},'attributes':['id'],'include':[{'model':_0x21438e[_0x7205('0x37')],'as':_0x7205('0x3b'),'where':{'id':_0x35aba1['ListId']}}]})[_0x7205('0x1d')](function(_0x42f2b9){if(_0x42f2b9){var _0x153c3a=[];for(var _0x5b335a=0x0,_0x68885c;_0x5b335a<_0x42f2b9[_0x7205('0x3c')];_0x5b335a+=0x1){_0x68885c=_0x42f2b9[_0x5b335a][_0x7205('0x13')]({'plain':!![]});_0x21438e['CmHopperBlack']['create']({'phone':_0x35aba1[_0x7205('0xc')],'ContactId':_0x35aba1['id'],'ListId':_0x35aba1[_0x7205('0x26')],'VoiceQueueId':_0x68885c['id']})[_0x7205('0x29')](function(_0x544835){logger['error'](_0x7205('0x3d'),_0x7205('0x15'),_0x544835[_0x7205('0x3e')]);});}}});})[_0x7205('0x1d')](function(){return _0x21438e['Campaign'][_0x7205('0x34')]({'attributes':['id',_0x7205('0x36'),_0x7205('0x1a')],'include':[{'model':_0x21438e[_0x7205('0x37')],'as':_0x7205('0x38'),'where':{'id':_0x35aba1[_0x7205('0x26')]}}]})[_0x7205('0x1d')](function(_0x3ae100){if(_0x3ae100){var _0xf9dfed=[];for(var _0x13200e=0x0,_0x5101ee;_0x13200e<_0x3ae100[_0x7205('0x3c')];_0x13200e+=0x1){_0x5101ee=_0x3ae100[_0x13200e][_0x7205('0x13')]({'plain':!![]});switch(_0x5101ee[_0x7205('0x36')]){case _0x7205('0x39'):_0x2f808a(_0x5101ee)[_0x7205('0x29')](_0x494151());break;case'onlyIfOpen':_0x5cafc9(_0x5101ee)['catch'](_0x494151());break;default:_0x21438e['CmHopper'][_0x7205('0x25')]({'phone':_0x35aba1[_0x7205('0xc')],'ContactId':_0x35aba1['id'],'ListId':_0x35aba1['ListId'],'scheduledat':_0x35aba1[_0x7205('0x17')]?_0x35aba1[_0x7205('0x17')]:moment()[_0x7205('0x18')](_0x7205('0x19')),'priority':_0x35aba1[_0x7205('0x27')]?_0x35aba1['priority']:0x2,'callback':_0x35aba1[_0x7205('0x28')]?!![]:![],'callbackuniqueid':_0x35aba1[_0x7205('0x28')]?_0x35aba1[_0x7205('0x28')]:undefined,'callbackat':_0x35aba1['callbackUniqueid']?moment()[_0x7205('0x18')](_0x7205('0x19')):undefined,'CampaignId':_0x5101ee['id']})['catch'](_0x494151());}}}});})[_0x7205('0x1d')](function(){return _0x21438e[_0x7205('0x2f')][_0x7205('0x34')]({'attributes':['id'],'include':[{'model':_0x21438e[_0x7205('0x37')],'as':_0x7205('0x3b'),'where':{'id':_0x35aba1['ListId']}}]})[_0x7205('0x1d')](function(_0x1a5405){if(_0x1a5405){var _0x2b279a=[];for(var _0xb16230=0x0,_0x39b9c6;_0xb16230<_0x1a5405[_0x7205('0x3c')];_0xb16230+=0x1){_0x39b9c6=_0x1a5405[_0xb16230][_0x7205('0x13')]({'plain':!![]});_0x21438e[_0x7205('0x3f')][_0x7205('0x25')]({'phone':_0x35aba1[_0x7205('0xc')],'ContactId':_0x35aba1['id'],'ListId':_0x35aba1['ListId'],'CampaignId':_0x39b9c6['id']})[_0x7205('0x29')](function(_0x565e44){logger['error'](_0x7205('0x3d'),'afterCreate',_0x565e44[_0x7205('0x3e')]);});}}});})['then'](function(){_0x5f1f2b();})[_0x7205('0x29')](function(_0x27a51d){logger[_0x7205('0x2e')](_0x7205('0x3d'),_0x7205('0x15'),_0x27a51d[_0x7205('0x3e')]);_0x5f1f2b(_0x27a51d);});}else{_0x5f1f2b(new Error(_0x7205('0x40')));}},'afterDestroy':function(_0x1c8ce9,_0x21854b,_0x1b2641){var _0x497cff=_0x13e60e['models'];var _0x21b246=_0x1c8ce9[_0x7205('0x13')]({'plain':!![]});return _0x497cff[_0x7205('0x23')][_0x7205('0x34')]({'raw':!![],'where':{'ListId':_0x21b246[_0x7205('0x26')],'ContactId':_0x21b246['id']}})['then'](function(_0x2bb7f5){if(!_[_0x7205('0x41')](_0x2bb7f5)){var _0x3e0c3a=[];for(var _0x2e12e2=0x0;_0x2e12e2<_0x2bb7f5[_0x7205('0x3c')];_0x2e12e2+=0x1){var _0x383aa7=_0x497cff[_0x7205('0x23')][_0x7205('0x42')]({'where':{'ListId':_0x2bb7f5[_0x2e12e2]['ListId'],'ContactId':_0x2bb7f5[_0x2e12e2]['ContactId'],'VoiceQueueId':_0x2bb7f5[_0x2e12e2]['VoiceQueueId'],'CampaignId':_0x2bb7f5[_0x2e12e2][_0x7205('0x43')]}});_0x3e0c3a[_0x7205('0x44')](_0x383aa7);}return BPromise[_0x7205('0x45')](_0x3e0c3a);}})[_0x7205('0x1d')](function(_0x419447){logger[_0x7205('0x46')]('[CmContact][afterDestroy][Succesfull]',util[_0x7205('0x16')](_0x419447,{'showHidden':![],'depth':null}));_0x1b2641();})[_0x7205('0x29')](function(_0x35e35e){logger[_0x7205('0x2e')](_0x7205('0x47'),util[_0x7205('0x16')](_0x35e35e,{'showHidden':![],'depth':null}));_0x1b2641(_0x35e35e);});}}});};
\ No newline at end of file
index 44caaeb..49cabc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a<Object[_0x0a9e('0x2d')](_0x2cc7a0[_0x0a9e('0x2c')])[_0x0a9e('0x2e')];_0x24936a++){var _0x4f41ae=Object[_0x0a9e('0x2d')](_0x2cc7a0[_0x0a9e('0x2c')])[_0x24936a];if(_0x4f41ae[_0x0a9e('0x2f')]('cf_')){_0x5640eb=squel[_0x0a9e('0x30')]()[_0x0a9e('0x31')](_0x0a9e('0x32'))['set'](_0x4f41ae,_0x2cc7a0['body'][_0x4f41ae])[_0x0a9e('0x1d')](_0x0a9e('0x33'),_0x1e8694['id'])['toString']();break;}}if(!_0x5640eb)return _0x1e8694;return db[_0x0a9e('0x34')][_0x0a9e('0x35')](_0x5640eb)[_0x0a9e('0x23')](function(){return _0x1e8694;});})[_0x0a9e('0x23')](function(_0x4b38d9){logger['info'](_0x0a9e('0x36'),_0x2cc7a0);logger[_0x0a9e('0x12')]('CreateCmContact',_0x2cc7a0,JSON[_0x0a9e('0x24')](_0x4b38d9));_0x2b7e7f(_0x4b38d9);})[_0x0a9e('0x18')](function(_0x1459bb){logger['error'](_0x0a9e('0x36'),_0x1459bb[_0x0a9e('0x16')],_0x2cc7a0);_0x3f3d41(_0x14b13f[_0x0a9e('0x14')](0x1f4,_0x1459bb[_0x0a9e('0x16')]));});});};
\ No newline at end of file
+var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x5cae10,_0x57a807){var _0x380213=function(_0x283532){while(--_0x283532){_0x5cae10['push'](_0x5cae10['shift']());}};_0x380213(++_0x57a807);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6<Object[_0x7995('0x32')](_0x5e67fe['body'])[_0x7995('0x26')];_0xf612e6++){var _0x235df7=Object[_0x7995('0x32')](_0x5e67fe[_0x7995('0x31')])[_0xf612e6];if(_0x235df7[_0x7995('0x33')](_0x7995('0x34'))){_0x242713=squel['update']()[_0x7995('0x35')](_0x7995('0x36'))[_0x7995('0x37')](_0x235df7,_0x5e67fe[_0x7995('0x31')][_0x235df7])[_0x7995('0x38')](_0x7995('0x39'),_0x2d4285['id'])[_0x7995('0x3a')]();break;}}if(!_0x242713)return _0x2d4285;return db[_0x7995('0x3b')][_0x7995('0x3c')](_0x242713)[_0x7995('0x12')](function(){return _0x2d4285;});})[_0x7995('0x12')](function(_0x270d52){logger[_0x7995('0x13')]('CreateCmContact',_0x5e67fe);logger['debug'](_0x7995('0x2f'),_0x5e67fe,JSON[_0x7995('0x18')](_0x270d52));_0x3e99cd(_0x270d52);})['catch'](function(_0x4b0855){logger[_0x7995('0x1a')]('CreateCmContact',_0x4b0855['message'],_0x5e67fe);_0xe328b1(_0x5d2428[_0x7995('0x1a')](0x1f4,_0x4b0855[_0x7995('0x1b')]));});});};
\ No newline at end of file
index 623eddd..5362e9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var CmContactEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){CmContactEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var CmContactEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){CmContactEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index 194f01f..946f7ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x4779ad,_0x12668e){var _0xd82d80=function(_0x2e908f){while(--_0x2e908f){_0x4779ad['push'](_0x4779ad['shift']());}};_0xd82d80(++_0x12668e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router;
\ No newline at end of file
+var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x201f39,_0x37ffe1){var _0x2a0754=function(_0x2a8374){while(--_0x2a8374){_0x201f39['push'](_0x201f39['shift']());}};_0x2a0754(++_0x37ffe1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router;
\ No newline at end of file
index 0c04b27..157d94b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c37=['INTEGER','STRING','sequelize','exports'];(function(_0x4384f2,_0x596e79){var _0x3629de=function(_0x492f0e){while(--_0x492f0e){_0x4384f2['push'](_0x4384f2['shift']());}};_0x3629de(++_0x596e79);}(_0x5c37,0x11e));var _0x75c3=function(_0x13187a,_0x2fcec4){_0x13187a=_0x13187a-0x0;var _0x65b85f=_0x5c37[_0x13187a];return _0x65b85f;};'use strict';var Sequelize=require(_0x75c3('0x0'));module[_0x75c3('0x1')]={'CmContactId':{'type':Sequelize[_0x75c3('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x75c3('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x75c3('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x75c3('0x3')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0x75c3('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x75c3('0x3')],'defaultValue':null}};
\ No newline at end of file
+var _0xf109=['STRING','sequelize','exports','INTEGER','PHONE'];(function(_0x1c8181,_0x424b01){var _0x3d1cb=function(_0x270e8e){while(--_0x270e8e){_0x1c8181['push'](_0x1c8181['shift']());}};_0x3d1cb(++_0x424b01);}(_0xf109,0xce));var _0x9f10=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0xf109[_0x29d915];return _0x160f86;};'use strict';var Sequelize=require(_0x9f10('0x0'));module[_0x9f10('0x1')]={'CmContactId':{'type':Sequelize[_0x9f10('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize['INTEGER'],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x9f10('0x3')},'OrderBy':{'type':Sequelize[_0x9f10('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x9f10('0x4')],'defaultValue':null}};
\ No newline at end of file
index 7eec1c2..edb89d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x560e=['include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','reject','update','then','get','CmContactHasItems','UserProfileResource','destroy','error','stack','name','map','CmContactHasItem','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','count','includeAll'];(function(_0x17f9ea,_0x441409){var _0x3fc400=function(_0x39d020){while(--_0x39d020){_0x17f9ea['push'](_0x17f9ea['shift']());}};_0x3fc400(++_0x441409);}(_0x560e,0xfe));var _0xe560=function(_0x1eb078,_0x145a1e){_0x1eb078=_0x1eb078-0x0;var _0xb6f3e=_0x560e[_0x1eb078];return _0xb6f3e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe560('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe560('0x1'));var Mustache=require(_0xe560('0x2'));var util=require(_0xe560('0x3'));var path=require(_0xe560('0x4'));var sox=require(_0xe560('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe560('0x6'));var _=require(_0xe560('0x7'));var squel=require(_0xe560('0x8'));var crypto=require(_0xe560('0x9'));var jsforce=require(_0xe560('0xa'));var deskjs=require(_0xe560('0xb'));var toCsv=require(_0xe560('0xc'));var querystring=require(_0xe560('0xd'));var Papa=require(_0xe560('0xe'));var Redis=require(_0xe560('0xf'));var authService=require(_0xe560('0x10'));var qs=require(_0xe560('0x11'));var as=require(_0xe560('0x12'));var hardwareService=require(_0xe560('0x13'));var logger=require('../../config/logger')(_0xe560('0x14'));var utils=require('../../config/utils');var config=require(_0xe560('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ee420,_0x11c5f2){_0x11c5f2=_0x11c5f2||0xcc;return function(_0x407295){if(_0x407295){return _0x2ee420[_0xe560('0x16')](_0x11c5f2);}return _0x2ee420[_0xe560('0x17')](_0x11c5f2)[_0xe560('0x18')]();};}function respondWithResult(_0x5eba6e,_0xb1161e){_0xb1161e=_0xb1161e||0xc8;return function(_0x1b584e){if(_0x1b584e){return _0x5eba6e['status'](_0xb1161e)[_0xe560('0x19')](_0x1b584e);}};}function respondWithFilteredResult(_0x2e2273,_0x162fe0){return function(_0x4b114e){if(_0x4b114e){var _0x29cdd9=typeof _0x162fe0[_0xe560('0x1a')]==='undefined'&&typeof _0x162fe0[_0xe560('0x1b')]===_0xe560('0x1c');var _0x50f13a=_0x4b114e['count'];var _0x394678=_0x29cdd9?0x0:_0x162fe0[_0xe560('0x1a')];var _0x5f04de=_0x29cdd9?_0x4b114e['count']:_0x162fe0[_0xe560('0x1a')]+_0x162fe0[_0xe560('0x1b')];var _0x5e918d;if(_0x5f04de>=_0x50f13a){_0x5f04de=_0x50f13a;_0x5e918d=0xc8;}else{_0x5e918d=0xce;}_0x2e2273['status'](_0x5e918d);return _0x2e2273[_0xe560('0x1d')](_0xe560('0x1e'),_0x394678+'-'+_0x5f04de+'/'+_0x50f13a)['json'](_0x4b114e);}return null;};}function patchUpdates(_0x9e963){return function(_0x321e3a){try{jsonpatch['apply'](_0x321e3a,_0x9e963,!![]);}catch(_0x3a53bd){return BPromise[_0xe560('0x1f')](_0x3a53bd);}return _0x321e3a['save']();};}function saveUpdates(_0x2a398e,_0x3f6769){return function(_0x44a9d4){if(_0x44a9d4){return _0x44a9d4[_0xe560('0x20')](_0x2a398e)[_0xe560('0x21')](function(_0x962859){return _0x962859;});}return null;};}function removeEntity(_0x48219e,_0x33d331){return function(_0x45757b){if(_0x45757b){return _0x45757b['destroy']()[_0xe560('0x21')](function(){var _0x525834=_0x45757b[_0xe560('0x22')]({'plain':!![]});var _0x19e806=_0xe560('0x23');return db[_0xe560('0x24')][_0xe560('0x25')]({'where':{'type':_0x19e806,'resourceId':_0x525834['id']}})[_0xe560('0x21')](function(){return _0x45757b;});})[_0xe560('0x21')](function(){_0x48219e[_0xe560('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x192b5e,_0x3ae48d){return function(_0x4d05d8){if(!_0x4d05d8){_0x192b5e['sendStatus'](0x194);}return _0x4d05d8;};}function handleError(_0x1a3d34,_0x39ddde){_0x39ddde=_0x39ddde||0x1f4;return function(_0x1f9bd2){logger[_0xe560('0x26')](_0x1f9bd2[_0xe560('0x27')]);if(_0x1f9bd2['name']){delete _0x1f9bd2[_0xe560('0x28')];}_0x1a3d34[_0xe560('0x17')](_0x39ddde)['send'](_0x1f9bd2);};}exports['index']=function(_0x124ee1,_0x292c4c){var _0x3f3997={},_0x32e1fe={},_0x4ad9e7={'count':0x0,'rows':[]};var _0x5a4700=_[_0xe560('0x29')](db[_0xe560('0x2a')]['rawAttributes'],function(_0x30aef4){return{'name':_0x30aef4['fieldName'],'type':_0x30aef4[_0xe560('0x2b')][_0xe560('0x2c')]};});_0x32e1fe[_0xe560('0x2d')]=_[_0xe560('0x29')](_0x5a4700,'name');_0x32e1fe[_0xe560('0x2e')]=_['keys'](_0x124ee1[_0xe560('0x2e')]);_0x32e1fe[_0xe560('0x2f')]=_[_0xe560('0x30')](_0x32e1fe[_0xe560('0x2d')],_0x32e1fe[_0xe560('0x2e')]);_0x3f3997[_0xe560('0x31')]=_[_0xe560('0x30')](_0x32e1fe['model'],qs[_0xe560('0x32')](_0x124ee1[_0xe560('0x2e')][_0xe560('0x32')]));_0x3f3997[_0xe560('0x31')]=_0x3f3997[_0xe560('0x31')]['length']?_0x3f3997[_0xe560('0x31')]:_0x32e1fe[_0xe560('0x2d')];if(!_0x124ee1[_0xe560('0x2e')]['hasOwnProperty'](_0xe560('0x33'))){_0x3f3997[_0xe560('0x1b')]=qs[_0xe560('0x1b')](_0x124ee1[_0xe560('0x2e')][_0xe560('0x1b')]);_0x3f3997[_0xe560('0x1a')]=qs[_0xe560('0x1a')](_0x124ee1[_0xe560('0x2e')][_0xe560('0x1a')]);}_0x3f3997[_0xe560('0x34')]=qs['sort'](_0x124ee1[_0xe560('0x2e')][_0xe560('0x35')]);_0x3f3997[_0xe560('0x36')]=qs[_0xe560('0x2f')](_[_0xe560('0x37')](_0x124ee1[_0xe560('0x2e')],_0x32e1fe['filters']),_0x5a4700);if(_0x124ee1[_0xe560('0x2e')]['filter']){_0x3f3997[_0xe560('0x36')]=_['merge'](_0x3f3997[_0xe560('0x36')],{'$or':_[_0xe560('0x29')](_0x5a4700,function(_0x5448bb){if(_0x5448bb[_0xe560('0x2b')]!==_0xe560('0x38')){var _0x408e03={};_0x408e03[_0x5448bb[_0xe560('0x28')]]={'$like':'%'+_0x124ee1['query'][_0xe560('0x39')]+'%'};return _0x408e03;}})});}_0x3f3997=_[_0xe560('0x3a')]({},_0x3f3997,_0x124ee1[_0xe560('0x3b')]);var _0x750be3={'where':_0x3f3997['where']};return db[_0xe560('0x2a')][_0xe560('0x3c')](_0x750be3)[_0xe560('0x21')](function(_0x3f87d4){_0x4ad9e7['count']=_0x3f87d4;if(_0x124ee1[_0xe560('0x2e')][_0xe560('0x3d')]){_0x3f3997[_0xe560('0x3e')]=[{'all':!![]}];}return db['CmContactHasItem'][_0xe560('0x3f')](_0x3f3997);})['then'](function(_0x203e4a){_0x4ad9e7[_0xe560('0x40')]=_0x203e4a;return _0x4ad9e7;})['then'](respondWithFilteredResult(_0x292c4c,_0x3f3997))[_0xe560('0x41')](handleError(_0x292c4c,null));};exports[_0xe560('0x42')]=function(_0x50cd16,_0x50a09f){var _0x475101={'raw':!![],'where':{'id':_0x50cd16[_0xe560('0x43')]['id']}},_0x431936={};_0x431936[_0xe560('0x2d')]=_[_0xe560('0x44')](db[_0xe560('0x2a')][_0xe560('0x45')]);_0x431936[_0xe560('0x2e')]=_[_0xe560('0x44')](_0x50cd16[_0xe560('0x2e')]);_0x431936[_0xe560('0x2f')]=_[_0xe560('0x30')](_0x431936[_0xe560('0x2d')],_0x431936['query']);_0x475101[_0xe560('0x31')]=_[_0xe560('0x30')](_0x431936[_0xe560('0x2d')],qs[_0xe560('0x32')](_0x50cd16[_0xe560('0x2e')]['fields']));_0x475101[_0xe560('0x31')]=_0x475101['attributes']['length']?_0x475101['attributes']:_0x431936['model'];if(_0x50cd16[_0xe560('0x2e')][_0xe560('0x3d')]){_0x475101[_0xe560('0x3e')]=[{'all':!![]}];}_0x475101=_[_0xe560('0x3a')]({},_0x475101,_0x50cd16[_0xe560('0x3b')]);return db['CmContactHasItem'][_0xe560('0x46')](_0x475101)[_0xe560('0x21')](handleEntityNotFound(_0x50a09f,null))['then'](respondWithResult(_0x50a09f,null))[_0xe560('0x41')](handleError(_0x50a09f,null));};exports['create']=function(_0x230f76,_0x402c9a){return db[_0xe560('0x2a')][_0xe560('0x47')](_0x230f76[_0xe560('0x48')],{})[_0xe560('0x21')](function(_0x54a660){var _0x2954ee=_0x230f76[_0xe560('0x49')][_0xe560('0x22')]({'plain':!![]});if(!_0x2954ee)throw new Error(_0xe560('0x4a'));if(_0x2954ee[_0xe560('0x4b')]===_0xe560('0x49')){var _0x1867b6=_0x54a660[_0xe560('0x22')]({'plain':!![]});var _0x49918b='CmContactHasItems';return db['UserProfileSection'][_0xe560('0x46')]({'where':{'name':_0x49918b,'userProfileId':_0x2954ee[_0xe560('0x4c')]},'raw':!![]})[_0xe560('0x21')](function(_0x285b2d){if(_0x285b2d&&_0x285b2d[_0xe560('0x4d')]===0x0){return db[_0xe560('0x24')][_0xe560('0x47')]({'name':_0x1867b6[_0xe560('0x28')],'resourceId':_0x1867b6['id'],'type':_0x285b2d['name'],'sectionId':_0x285b2d['id']},{})[_0xe560('0x21')](function(){return _0x54a660;});}else{return _0x54a660;}})['catch'](function(_0x42945a){logger[_0xe560('0x26')](_0xe560('0x4e'),_0x42945a);throw _0x42945a;});}return _0x54a660;})[_0xe560('0x21')](respondWithResult(_0x402c9a,0xc9))['catch'](handleError(_0x402c9a,null));};exports['update']=function(_0x3a1fda,_0xae862f){if(_0x3a1fda[_0xe560('0x48')]['id']){delete _0x3a1fda['body']['id'];}return db[_0xe560('0x2a')][_0xe560('0x46')]({'where':{'id':_0x3a1fda['params']['id']}})[_0xe560('0x21')](handleEntityNotFound(_0xae862f,null))[_0xe560('0x21')](saveUpdates(_0x3a1fda['body'],null))[_0xe560('0x21')](respondWithResult(_0xae862f,null))[_0xe560('0x41')](handleError(_0xae862f,null));};exports[_0xe560('0x25')]=function(_0x13683d,_0x19dc33){return db[_0xe560('0x2a')]['find']({'where':{'id':_0x13683d[_0xe560('0x43')]['id']}})[_0xe560('0x21')](handleEntityNotFound(_0x19dc33,null))[_0xe560('0x21')](removeEntity(_0x19dc33,null))['catch'](handleError(_0x19dc33,null));};
\ No newline at end of file
+var _0xbb09=['sort','where','filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','fields','merge','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmContactHasItems','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','request-promise','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','stack','name','index','map','CmContactHasItem','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','length','nolimit','order'];(function(_0x7be9bb,_0x139c44){var _0x56d71f=function(_0x716a56){while(--_0x716a56){_0x7be9bb['push'](_0x7be9bb['shift']());}};_0x56d71f(++_0x139c44);}(_0xbb09,0x65));var _0x9bb0=function(_0x12c280,_0x51dd07){_0x12c280=_0x12c280-0x0;var _0x3638d3=_0xbb09[_0x12c280];return _0x3638d3;};'use strict';var emlformat=require(_0x9bb0('0x0'));var rimraf=require(_0x9bb0('0x1'));var zipdir=require(_0x9bb0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9bb0('0x3'));var moment=require('moment');var BPromise=require(_0x9bb0('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x9bb0('0x5'));var sox=require('sox');var csv=require(_0x9bb0('0x6'));var ejs=require(_0x9bb0('0x7'));var fs=require('fs');var fs_extra=require(_0x9bb0('0x8'));var _=require(_0x9bb0('0x9'));var squel=require(_0x9bb0('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9bb0('0xb'));var toCsv=require('to-csv');var querystring=require(_0x9bb0('0xc'));var Papa=require(_0x9bb0('0xd'));var Redis=require(_0x9bb0('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x9bb0('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9bb0('0x10'));var logger=require(_0x9bb0('0x11'))(_0x9bb0('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9bb0('0x13'));var db=require(_0x9bb0('0x14'))['db'];function respondWithStatusCode(_0x35725e,_0x477a05){_0x477a05=_0x477a05||0xcc;return function(_0x3200b5){if(_0x3200b5){return _0x35725e[_0x9bb0('0x15')](_0x477a05);}return _0x35725e['status'](_0x477a05)[_0x9bb0('0x16')]();};}function respondWithResult(_0x3155ac,_0x14bc85){_0x14bc85=_0x14bc85||0xc8;return function(_0x4ea723){if(_0x4ea723){return _0x3155ac[_0x9bb0('0x17')](_0x14bc85)[_0x9bb0('0x18')](_0x4ea723);}};}function respondWithFilteredResult(_0x2ce3dd,_0x1e64f2){return function(_0x86b084){if(_0x86b084){var _0x140cbd=typeof _0x1e64f2[_0x9bb0('0x19')]===_0x9bb0('0x1a')&&typeof _0x1e64f2[_0x9bb0('0x1b')]===_0x9bb0('0x1a');var _0x18fd55=_0x86b084[_0x9bb0('0x1c')];var _0x3f282e=_0x140cbd?0x0:_0x1e64f2[_0x9bb0('0x19')];var _0x3246f5=_0x140cbd?_0x86b084[_0x9bb0('0x1c')]:_0x1e64f2[_0x9bb0('0x19')]+_0x1e64f2['limit'];var _0x1425f3;if(_0x3246f5>=_0x18fd55){_0x3246f5=_0x18fd55;_0x1425f3=0xc8;}else{_0x1425f3=0xce;}_0x2ce3dd[_0x9bb0('0x17')](_0x1425f3);return _0x2ce3dd[_0x9bb0('0x1d')](_0x9bb0('0x1e'),_0x3f282e+'-'+_0x3246f5+'/'+_0x18fd55)[_0x9bb0('0x18')](_0x86b084);}return null;};}function patchUpdates(_0x5cb897){return function(_0x467492){try{jsonpatch['apply'](_0x467492,_0x5cb897,!![]);}catch(_0x2339d6){return BPromise[_0x9bb0('0x1f')](_0x2339d6);}return _0x467492[_0x9bb0('0x20')]();};}function saveUpdates(_0x10b359,_0x5769f2){return function(_0x590505){if(_0x590505){return _0x590505['update'](_0x10b359)[_0x9bb0('0x21')](function(_0x10b0ef){return _0x10b0ef;});}return null;};}function removeEntity(_0x358cd4,_0xf465e){return function(_0x5a3414){if(_0x5a3414){return _0x5a3414[_0x9bb0('0x22')]()[_0x9bb0('0x21')](function(){var _0x4c04ac=_0x5a3414['get']({'plain':!![]});var _0x31cc2b='CmContactHasItems';return db['UserProfileResource']['destroy']({'where':{'type':_0x31cc2b,'resourceId':_0x4c04ac['id']}})[_0x9bb0('0x21')](function(){return _0x5a3414;});})[_0x9bb0('0x21')](function(){_0x358cd4[_0x9bb0('0x17')](0xcc)[_0x9bb0('0x16')]();});}};}function handleEntityNotFound(_0x4e3a73,_0x28106c){return function(_0x2e187f){if(!_0x2e187f){_0x4e3a73[_0x9bb0('0x15')](0x194);}return _0x2e187f;};}function handleError(_0x280fbb,_0x441cf4){_0x441cf4=_0x441cf4||0x1f4;return function(_0x2a647e){logger['error'](_0x2a647e[_0x9bb0('0x23')]);if(_0x2a647e[_0x9bb0('0x24')]){delete _0x2a647e[_0x9bb0('0x24')];}_0x280fbb[_0x9bb0('0x17')](_0x441cf4)['send'](_0x2a647e);};}exports[_0x9bb0('0x25')]=function(_0x170966,_0x85e663){var _0xa73aa0={},_0x1aafb2={},_0x3ea55b={'count':0x0,'rows':[]};var _0x386e5a=_[_0x9bb0('0x26')](db[_0x9bb0('0x27')][_0x9bb0('0x28')],function(_0x25a1cc){return{'name':_0x25a1cc[_0x9bb0('0x29')],'type':_0x25a1cc[_0x9bb0('0x2a')]['key']};});_0x1aafb2[_0x9bb0('0x2b')]=_[_0x9bb0('0x26')](_0x386e5a,'name');_0x1aafb2[_0x9bb0('0x2c')]=_['keys'](_0x170966[_0x9bb0('0x2c')]);_0x1aafb2[_0x9bb0('0x2d')]=_['intersection'](_0x1aafb2[_0x9bb0('0x2b')],_0x1aafb2[_0x9bb0('0x2c')]);_0xa73aa0[_0x9bb0('0x2e')]=_[_0x9bb0('0x2f')](_0x1aafb2[_0x9bb0('0x2b')],qs['fields'](_0x170966[_0x9bb0('0x2c')]['fields']));_0xa73aa0[_0x9bb0('0x2e')]=_0xa73aa0[_0x9bb0('0x2e')][_0x9bb0('0x30')]?_0xa73aa0[_0x9bb0('0x2e')]:_0x1aafb2['model'];if(!_0x170966[_0x9bb0('0x2c')]['hasOwnProperty'](_0x9bb0('0x31'))){_0xa73aa0[_0x9bb0('0x1b')]=qs['limit'](_0x170966[_0x9bb0('0x2c')][_0x9bb0('0x1b')]);_0xa73aa0[_0x9bb0('0x19')]=qs[_0x9bb0('0x19')](_0x170966[_0x9bb0('0x2c')]['offset']);}_0xa73aa0[_0x9bb0('0x32')]=qs['sort'](_0x170966[_0x9bb0('0x2c')][_0x9bb0('0x33')]);_0xa73aa0[_0x9bb0('0x34')]=qs[_0x9bb0('0x2d')](_['pick'](_0x170966[_0x9bb0('0x2c')],_0x1aafb2[_0x9bb0('0x2d')]),_0x386e5a);if(_0x170966['query'][_0x9bb0('0x35')]){_0xa73aa0[_0x9bb0('0x34')]=_['merge'](_0xa73aa0[_0x9bb0('0x34')],{'$or':_['map'](_0x386e5a,function(_0x1a3646){if(_0x1a3646['type']!==_0x9bb0('0x36')){var _0x222bad={};_0x222bad[_0x1a3646['name']]={'$like':'%'+_0x170966['query']['filter']+'%'};return _0x222bad;}})});}_0xa73aa0=_['merge']({},_0xa73aa0,_0x170966['options']);var _0x252f7b={'where':_0xa73aa0[_0x9bb0('0x34')]};return db[_0x9bb0('0x27')][_0x9bb0('0x1c')](_0x252f7b)[_0x9bb0('0x21')](function(_0x1be91b){_0x3ea55b[_0x9bb0('0x1c')]=_0x1be91b;if(_0x170966[_0x9bb0('0x2c')][_0x9bb0('0x37')]){_0xa73aa0[_0x9bb0('0x38')]=[{'all':!![]}];}return db[_0x9bb0('0x27')][_0x9bb0('0x39')](_0xa73aa0);})[_0x9bb0('0x21')](function(_0x3a0385){_0x3ea55b[_0x9bb0('0x3a')]=_0x3a0385;return _0x3ea55b;})[_0x9bb0('0x21')](respondWithFilteredResult(_0x85e663,_0xa73aa0))[_0x9bb0('0x3b')](handleError(_0x85e663,null));};exports[_0x9bb0('0x3c')]=function(_0x1a4a85,_0xdb8306){var _0x1906ea={'raw':!![],'where':{'id':_0x1a4a85[_0x9bb0('0x3d')]['id']}},_0x585373={};_0x585373[_0x9bb0('0x2b')]=_[_0x9bb0('0x3e')](db[_0x9bb0('0x27')][_0x9bb0('0x28')]);_0x585373[_0x9bb0('0x2c')]=_['keys'](_0x1a4a85['query']);_0x585373[_0x9bb0('0x2d')]=_[_0x9bb0('0x2f')](_0x585373['model'],_0x585373[_0x9bb0('0x2c')]);_0x1906ea[_0x9bb0('0x2e')]=_['intersection'](_0x585373['model'],qs[_0x9bb0('0x3f')](_0x1a4a85['query'][_0x9bb0('0x3f')]));_0x1906ea[_0x9bb0('0x2e')]=_0x1906ea[_0x9bb0('0x2e')]['length']?_0x1906ea['attributes']:_0x585373['model'];if(_0x1a4a85[_0x9bb0('0x2c')][_0x9bb0('0x37')]){_0x1906ea[_0x9bb0('0x38')]=[{'all':!![]}];}_0x1906ea=_[_0x9bb0('0x40')]({},_0x1906ea,_0x1a4a85['options']);return db[_0x9bb0('0x27')]['find'](_0x1906ea)[_0x9bb0('0x21')](handleEntityNotFound(_0xdb8306,null))[_0x9bb0('0x21')](respondWithResult(_0xdb8306,null))[_0x9bb0('0x3b')](handleError(_0xdb8306,null));};exports['create']=function(_0x3ce7ee,_0x8dbab1){return db[_0x9bb0('0x27')][_0x9bb0('0x41')](_0x3ce7ee['body'],{})[_0x9bb0('0x21')](function(_0x24a1a8){var _0xfbe4a7=_0x3ce7ee[_0x9bb0('0x42')][_0x9bb0('0x43')]({'plain':!![]});if(!_0xfbe4a7)throw new Error(_0x9bb0('0x44'));if(_0xfbe4a7[_0x9bb0('0x45')]===_0x9bb0('0x42')){var _0x5bec7d=_0x24a1a8[_0x9bb0('0x43')]({'plain':!![]});var _0x38573a=_0x9bb0('0x46');return db[_0x9bb0('0x47')][_0x9bb0('0x48')]({'where':{'name':_0x38573a,'userProfileId':_0xfbe4a7['userProfileId']},'raw':!![]})[_0x9bb0('0x21')](function(_0xa4a3ba){if(_0xa4a3ba&&_0xa4a3ba['autoAssociation']===0x0){return db['UserProfileResource'][_0x9bb0('0x41')]({'name':_0x5bec7d[_0x9bb0('0x24')],'resourceId':_0x5bec7d['id'],'type':_0xa4a3ba['name'],'sectionId':_0xa4a3ba['id']},{})[_0x9bb0('0x21')](function(){return _0x24a1a8;});}else{return _0x24a1a8;}})[_0x9bb0('0x3b')](function(_0x392050){logger['error'](_0x9bb0('0x49'),_0x392050);throw _0x392050;});}return _0x24a1a8;})['then'](respondWithResult(_0x8dbab1,0xc9))[_0x9bb0('0x3b')](handleError(_0x8dbab1,null));};exports[_0x9bb0('0x4a')]=function(_0x4926ba,_0x1c24d0){if(_0x4926ba[_0x9bb0('0x4b')]['id']){delete _0x4926ba[_0x9bb0('0x4b')]['id'];}return db[_0x9bb0('0x27')][_0x9bb0('0x48')]({'where':{'id':_0x4926ba[_0x9bb0('0x3d')]['id']}})[_0x9bb0('0x21')](handleEntityNotFound(_0x1c24d0,null))['then'](saveUpdates(_0x4926ba['body'],null))[_0x9bb0('0x21')](respondWithResult(_0x1c24d0,null))[_0x9bb0('0x3b')](handleError(_0x1c24d0,null));};exports[_0x9bb0('0x22')]=function(_0x407b57,_0x49459f){return db[_0x9bb0('0x27')][_0x9bb0('0x48')]({'where':{'id':_0x407b57[_0x9bb0('0x3d')]['id']}})[_0x9bb0('0x21')](handleEntityNotFound(_0x49459f,null))[_0x9bb0('0x21')](removeEntity(_0x49459f,null))[_0x9bb0('0x3b')](handleError(_0x49459f,null));};
\ No newline at end of file
index 4dff63c..1105ba5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7ae=['path','../../config/environment','exports','define','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger'];(function(_0xaa6efc,_0x56ca71){var _0x3a0acc=function(_0x2ac8bd){while(--_0x2ac8bd){_0xaa6efc['push'](_0xaa6efc['shift']());}};_0x3a0acc(++_0x56ca71);}(_0xd7ae,0x72));var _0xed7a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd7ae[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xed7a('0x0'));var util=require(_0xed7a('0x1'));var logger=require(_0xed7a('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xed7a('0x3'));var rimraf=require('rimraf');var config=require(_0xed7a('0x4'));var attributes=require('./cmContactHasItem.attributes');module[_0xed7a('0x5')]=function(_0x369963,_0x2b968c){return _0x369963[_0xed7a('0x6')](_0xed7a('0x7'),attributes,{'tableName':_0xed7a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3262=['CmContactHasItem','cm_contact_has_items','api','moment','bluebird','request-promise','path','../../config/environment','./cmContactHasItem.attributes'];(function(_0x305c31,_0x466b17){var _0x17f39f=function(_0x53ae03){while(--_0x53ae03){_0x305c31['push'](_0x305c31['shift']());}};_0x17f39f(++_0x466b17);}(_0x3262,0x146));var _0x2326=function(_0x30edd9,_0x3a66f8){_0x30edd9=_0x30edd9-0x0;var _0x35a7ee=_0x3262[_0x30edd9];return _0x35a7ee;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2326('0x0'));var moment=require(_0x2326('0x1'));var BPromise=require(_0x2326('0x2'));var rp=require(_0x2326('0x3'));var fs=require('fs');var path=require(_0x2326('0x4'));var rimraf=require('rimraf');var config=require(_0x2326('0x5'));var attributes=require(_0x2326('0x6'));module['exports']=function(_0x332617,_0x2f22bb){return _0x332617['define'](_0x2326('0x7'),attributes,{'tableName':_0x2326('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 652a66c..b440ba9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a47=['rpc','client','http','request','then','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CmContactHasItem,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x26bcf4,_0x2212bb){var _0x11b54b=function(_0x251a2e){while(--_0x251a2e){_0x26bcf4['push'](_0x26bcf4['shift']());}};_0x11b54b(++_0x2212bb);}(_0x0a47,0x1b0));var _0x70a4=function(_0x5f3d94,_0x5dd572){_0x5f3d94=_0x5f3d94-0x0;var _0x42abe2=_0x0a47[_0x5f3d94];return _0x42abe2;};'use strict';var _=require(_0x70a4('0x0'));var util=require(_0x70a4('0x1'));var moment=require(_0x70a4('0x2'));var BPromise=require('bluebird');var rs=require(_0x70a4('0x3'));var fs=require('fs');var Redis=require(_0x70a4('0x4'));var db=require(_0x70a4('0x5'))['db'];var utils=require(_0x70a4('0x6'));var logger=require(_0x70a4('0x7'))(_0x70a4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x70a4('0x9')][_0x70a4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1daff5,_0x19825f,_0x446695){return new BPromise(function(_0xf4fc61,_0x308203){return client[_0x70a4('0xb')](_0x1daff5,_0x446695)[_0x70a4('0xc')](function(_0xfd8f22){logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x19825f,'request\x20sent');logger['debug'](_0x70a4('0xd'),_0x19825f,_0x70a4('0xe'),JSON['stringify'](_0xfd8f22));if(_0xfd8f22[_0x70a4('0xf')]){if(_0xfd8f22[_0x70a4('0xf')][_0x70a4('0x10')]===0x1f4){logger[_0x70a4('0xf')](_0x70a4('0x11'),_0x19825f,_0xfd8f22[_0x70a4('0xf')]['message']);return _0x308203(_0xfd8f22['error'][_0x70a4('0x12')]);}logger[_0x70a4('0xf')](_0x70a4('0x11'),_0x19825f,_0xfd8f22[_0x70a4('0xf')]['message']);return _0xf4fc61(_0xfd8f22[_0x70a4('0xf')][_0x70a4('0x12')]);}else{logger[_0x70a4('0x13')](_0x70a4('0x11'),_0x19825f,_0x70a4('0xe'));_0xf4fc61(_0xfd8f22[_0x70a4('0x14')][_0x70a4('0x12')]);}})[_0x70a4('0x15')](function(_0x3a907a){logger[_0x70a4('0xf')](_0x70a4('0x11'),_0x19825f,_0x3a907a);_0x308203(_0x3a907a);});});}
\ No newline at end of file
+var _0x4501=['info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x4eedc6,_0x27632a){var _0x1f0ea0=function(_0x545585){while(--_0x545585){_0x4eedc6['push'](_0x4eedc6['shift']());}};_0x1f0ea0(++_0x27632a);}(_0x4501,0x1d5));var _0x1450=function(_0x58e4fc,_0x14f05c){_0x58e4fc=_0x58e4fc-0x0;var _0x220fde=_0x4501[_0x58e4fc];return _0x220fde;};'use strict';var _=require(_0x1450('0x0'));var util=require(_0x1450('0x1'));var moment=require(_0x1450('0x2'));var BPromise=require('bluebird');var rs=require(_0x1450('0x3'));var fs=require('fs');var Redis=require(_0x1450('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1450('0x5'));var logger=require(_0x1450('0x6'))('rpc');var config=require(_0x1450('0x7'));var jayson=require(_0x1450('0x8'));var client=jayson[_0x1450('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x353bbd,_0x2c07f6,_0x58d844){return new BPromise(function(_0x23fb97,_0x519f4b){return client[_0x1450('0xa')](_0x353bbd,_0x58d844)['then'](function(_0x25d431){logger[_0x1450('0xb')](_0x1450('0xc'),_0x2c07f6,_0x1450('0xd'));logger[_0x1450('0xe')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x2c07f6,_0x1450('0xd'),JSON[_0x1450('0xf')](_0x25d431));if(_0x25d431['error']){if(_0x25d431[_0x1450('0x10')][_0x1450('0x11')]===0x1f4){logger['error'](_0x1450('0xc'),_0x2c07f6,_0x25d431[_0x1450('0x10')]['message']);return _0x519f4b(_0x25d431[_0x1450('0x10')][_0x1450('0x12')]);}logger[_0x1450('0x10')](_0x1450('0xc'),_0x2c07f6,_0x25d431['error'][_0x1450('0x12')]);return _0x23fb97(_0x25d431[_0x1450('0x10')]['message']);}else{logger[_0x1450('0xb')](_0x1450('0xc'),_0x2c07f6,_0x1450('0xd'));_0x23fb97(_0x25d431[_0x1450('0x13')][_0x1450('0x12')]);}})['catch'](function(_0xd6b9f6){logger[_0x1450('0x10')](_0x1450('0xc'),_0x2c07f6,_0xd6b9f6);_0x519f4b(_0xd6b9f6);});});}
\ No newline at end of file
index 6ca8e26..47c525e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5b2=['get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xb5b2,0x10f));var _0x2b5b=function(_0xcf2110,_0x3b5461){_0xcf2110=_0xcf2110-0x0;var _0x47d595=_0xb5b2[_0xcf2110];return _0x47d595;};'use strict';var multer=require(_0x2b5b('0x0'));var util=require(_0x2b5b('0x1'));var path=require('path');var timeout=require(_0x2b5b('0x2'));var express=require(_0x2b5b('0x3'));var router=express[_0x2b5b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2b5b('0x5'));var interaction=require(_0x2b5b('0x6'));var config=require(_0x2b5b('0x7'));var controller=require(_0x2b5b('0x8'));router[_0x2b5b('0x9')]('/',auth[_0x2b5b('0xa')](),controller[_0x2b5b('0xb')]);router['get'](_0x2b5b('0xc'),auth[_0x2b5b('0xa')](),controller[_0x2b5b('0xd')]);router[_0x2b5b('0xe')]('/',auth[_0x2b5b('0xa')](),controller['create']);router[_0x2b5b('0xf')](_0x2b5b('0xc'),auth['isAuthenticated'](),controller[_0x2b5b('0x10')]);router[_0x2b5b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x2b5b('0x12')]);module[_0x2b5b('0x13')]=router;
\ No newline at end of file
+var _0xf1e6=['util','path','express','fs-extra','../../components/auth/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','multer'];(function(_0x1d0ad1,_0x50c33f){var _0x4a4a0e=function(_0x1fd9ae){while(--_0x1fd9ae){_0x1d0ad1['push'](_0x1d0ad1['shift']());}};_0x4a4a0e(++_0x50c33f);}(_0xf1e6,0x76));var _0x6f1e=function(_0x4e0e9b,_0x45999e){_0x4e0e9b=_0x4e0e9b-0x0;var _0x4790b2=_0xf1e6[_0x4e0e9b];return _0x4790b2;};'use strict';var multer=require(_0x6f1e('0x0'));var util=require(_0x6f1e('0x1'));var path=require(_0x6f1e('0x2'));var timeout=require('connect-timeout');var express=require(_0x6f1e('0x3'));var router=express['Router']();var fs_extra=require(_0x6f1e('0x4'));var auth=require(_0x6f1e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6f1e('0x6'));var controller=require(_0x6f1e('0x7'));router[_0x6f1e('0x8')]('/',auth[_0x6f1e('0x9')](),controller[_0x6f1e('0xa')]);router[_0x6f1e('0x8')](_0x6f1e('0xb'),auth[_0x6f1e('0x9')](),controller['show']);router[_0x6f1e('0xc')]('/',auth[_0x6f1e('0x9')](),controller[_0x6f1e('0xd')]);router['put']('/:id',auth[_0x6f1e('0x9')](),controller[_0x6f1e('0xe')]);router[_0x6f1e('0xf')](_0x6f1e('0xb'),auth[_0x6f1e('0x9')](),controller[_0x6f1e('0x10')]);module['exports']=router;
\ No newline at end of file
index e0919a7..c091381 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dbf=['name','STRING','TEXT','long','type','select','parse','values','isArray','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','alias','setDataValue','getDataValue'];(function(_0x3a04c6,_0x12a482){var _0xf4131a=function(_0x413ea2){while(--_0x413ea2){_0x3a04c6['push'](_0x3a04c6['shift']());}};_0xf4131a(++_0x12a482);}(_0x8dbf,0x1ae));var _0xf8db=function(_0xc42ff1,_0x499107){_0xc42ff1=_0xc42ff1-0x0;var _0x40b2d7=_0x8dbf[_0xc42ff1];return _0x40b2d7;};'use strict';var Sequelize=require(_0xf8db('0x0'));var _=require(_0xf8db('0x1'));module[_0xf8db('0x2')]={'name':{'type':Sequelize[_0xf8db('0x3')],'get':function(_0xe4b409){return this['getDataValue'](_0xf8db('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x5a792f){this[_0xf8db('0x5')](_0xf8db('0x4'),_0x5a792f?_0x5a792f:this[_0xf8db('0x6')](_0xf8db('0x7')));}},'type':{'type':Sequelize[_0xf8db('0x8')],'allowNull':![]},'values':{'type':Sequelize[_0xf8db('0x9')](_0xf8db('0xa')),'get':function(){if(this[_0xf8db('0x6')](_0xf8db('0xb'))===_0xf8db('0xc')){return JSON[_0xf8db('0xd')](this[_0xf8db('0x6')](_0xf8db('0xe')));}else{return this[_0xf8db('0x6')](_0xf8db('0xe'));}},'set':function(_0x3b2da0){if(Array[_0xf8db('0xf')](_0x3b2da0)){this[_0xf8db('0x5')](_0xf8db('0xe'),JSON['stringify'](_0x3b2da0));}else{this[_0xf8db('0x5')](_0xf8db('0xe'),_0x3b2da0);}}},'required':{'type':Sequelize[_0xf8db('0x10')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xf8db('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xf8db('0x11')](_0xf8db('0x12'))}};
\ No newline at end of file
+var _0x27cc=['stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','STRING','setDataValue','alias','name','TEXT','type','select','values','isArray'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x27cc,0xa6));var _0xc27c=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x27cc[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0xc27c('0x0'));var _=require(_0xc27c('0x1'));module[_0xc27c('0x2')]={'name':{'type':Sequelize[_0xc27c('0x3')],'get':function(_0x46cecb){return this[_0xc27c('0x4')]('alias');}},'alias':{'type':Sequelize[_0xc27c('0x5')],'allowNull':![],'set':function(_0x24626a){this[_0xc27c('0x6')](_0xc27c('0x7'),_0x24626a?_0x24626a:this[_0xc27c('0x4')](_0xc27c('0x8')));}},'type':{'type':Sequelize[_0xc27c('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xc27c('0x9')]('long'),'get':function(){if(this['getDataValue'](_0xc27c('0xa'))===_0xc27c('0xb')){return JSON['parse'](this['getDataValue'](_0xc27c('0xc')));}else{return this[_0xc27c('0x4')](_0xc27c('0xc'));}},'set':function(_0x290b17){if(Array[_0xc27c('0xd')](_0x290b17)){this[_0xc27c('0x6')](_0xc27c('0xc'),JSON[_0xc27c('0xe')](_0x290b17));}else{this['setDataValue'](_0xc27c('0xc'),_0x290b17);}}},'required':{'type':Sequelize[_0xc27c('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xc27c('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xc27c('0x10')](_0xc27c('0x11'))}};
\ No newline at end of file
index b15b540..a3ece10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66f3=['catch','body','create','sequelize','transaction','TEXT','text','number','INTEGER','Sequelize','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','apply','update','then','destroy','end','error','stack','name','send','index','CmCustomField','rawAttributes','type','key','model','differenceBy','map','query','filters','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','intersection','fields','find'];(function(_0x8854f2,_0x79542c){var _0x38505d=function(_0x5af02b){while(--_0x5af02b){_0x8854f2['push'](_0x8854f2['shift']());}};_0x38505d(++_0x79542c);}(_0x66f3,0xba));var _0x366f=function(_0x2409ad,_0x5f4078){_0x2409ad=_0x2409ad-0x0;var _0x2c24c9=_0x66f3[_0x2409ad];return _0x2c24c9;};'use strict';var emlformat=require(_0x366f('0x0'));var rimraf=require(_0x366f('0x1'));var zipdir=require(_0x366f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x366f('0x3'));var moment=require(_0x366f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x366f('0x5'));var util=require(_0x366f('0x6'));var path=require(_0x366f('0x7'));var sox=require(_0x366f('0x8'));var csv=require(_0x366f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x366f('0xa'));var _=require(_0x366f('0xb'));var squel=require('squel');var crypto=require(_0x366f('0xc'));var jsforce=require(_0x366f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x366f('0x9'));var querystring=require(_0x366f('0xe'));var Papa=require('papaparse');var Redis=require(_0x366f('0xf'));var authService=require(_0x366f('0x10'));var qs=require(_0x366f('0x11'));var as=require(_0x366f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x366f('0x13'));var utils=require(_0x366f('0x14'));var config=require(_0x366f('0x15'));var licenseUtil=require(_0x366f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x518b0b,_0x327056){_0x327056=_0x327056||0xcc;return function(_0xa72acd){if(_0xa72acd){return _0x518b0b[_0x366f('0x17')](_0x327056);}return _0x518b0b[_0x366f('0x18')](_0x327056)['end']();};}function respondWithResult(_0x578230,_0x29542e){_0x29542e=_0x29542e||0xc8;return function(_0x4ed40c){if(_0x4ed40c){return _0x578230['status'](_0x29542e)[_0x366f('0x19')](_0x4ed40c);}};}function respondWithFilteredResult(_0x37582e,_0xb04f66){return function(_0x553607){if(_0x553607){var _0xea0c30=typeof _0xb04f66[_0x366f('0x1a')]==='undefined'&&typeof _0xb04f66[_0x366f('0x1b')]===_0x366f('0x1c');var _0x13112d=_0x553607['count'];var _0x179470=_0xea0c30?0x0:_0xb04f66[_0x366f('0x1a')];var _0x25c462=_0xea0c30?_0x553607[_0x366f('0x1d')]:_0xb04f66[_0x366f('0x1a')]+_0xb04f66['limit'];var _0x4a5e7e;if(_0x25c462>=_0x13112d){_0x25c462=_0x13112d;_0x4a5e7e=0xc8;}else{_0x4a5e7e=0xce;}_0x37582e[_0x366f('0x18')](_0x4a5e7e);return _0x37582e[_0x366f('0x1e')]('Content-Range',_0x179470+'-'+_0x25c462+'/'+_0x13112d)[_0x366f('0x19')](_0x553607);}return null;};}function patchUpdates(_0xf5f09d){return function(_0xb9e66b){try{jsonpatch[_0x366f('0x1f')](_0xb9e66b,_0xf5f09d,!![]);}catch(_0x44b02d){return BPromise['reject'](_0x44b02d);}return _0xb9e66b['save']();};}function saveUpdates(_0x25b68d,_0x35135e){return function(_0x59e281){if(_0x59e281){return _0x59e281[_0x366f('0x20')](_0x25b68d)[_0x366f('0x21')](function(_0x41703b){return _0x41703b;});}return null;};}function removeEntity(_0x4404f3,_0x2851b9){return function(_0x24c3ec){if(_0x24c3ec){return _0x24c3ec[_0x366f('0x22')]()[_0x366f('0x21')](function(){_0x4404f3[_0x366f('0x18')](0xcc)[_0x366f('0x23')]();});}};}function handleEntityNotFound(_0x293ecd,_0x4beaa2){return function(_0xb2b14f){if(!_0xb2b14f){_0x293ecd[_0x366f('0x17')](0x194);}return _0xb2b14f;};}function handleError(_0x17748c,_0x34e891){_0x34e891=_0x34e891||0x1f4;return function(_0x152014){logger[_0x366f('0x24')](_0x152014[_0x366f('0x25')]);if(_0x152014[_0x366f('0x26')]){delete _0x152014['name'];}_0x17748c[_0x366f('0x18')](_0x34e891)[_0x366f('0x27')](_0x152014);};}exports[_0x366f('0x28')]=function(_0x21d9af,_0x26a6d5){var _0x357ee6={},_0x1c0419={},_0x3631f6={'count':0x0,'rows':[]};var _0x520370=_['map'](db[_0x366f('0x29')][_0x366f('0x2a')],function(_0x33b0fa){return{'name':_0x33b0fa['fieldName'],'type':_0x33b0fa[_0x366f('0x2b')][_0x366f('0x2c')]};});_0x1c0419[_0x366f('0x2d')]=_[_0x366f('0x2e')](_[_0x366f('0x2f')](_0x520370,'name'),[_0x366f('0x26')]);_0x1c0419[_0x366f('0x30')]=_['keys'](_0x21d9af['query']);_0x1c0419[_0x366f('0x31')]=_['intersection'](_0x1c0419['model'],_0x1c0419[_0x366f('0x30')]);_0x357ee6['attributes']=_['intersection'](_0x1c0419[_0x366f('0x2d')],qs['fields'](_0x21d9af[_0x366f('0x30')]['fields']));_0x357ee6[_0x366f('0x32')]=_0x357ee6[_0x366f('0x32')]['length']?_0x357ee6[_0x366f('0x32')]:_0x1c0419[_0x366f('0x2d')];if(!_0x21d9af['query'][_0x366f('0x33')](_0x366f('0x34'))){_0x357ee6[_0x366f('0x1b')]=qs[_0x366f('0x1b')](_0x21d9af[_0x366f('0x30')][_0x366f('0x1b')]);_0x357ee6[_0x366f('0x1a')]=qs[_0x366f('0x1a')](_0x21d9af[_0x366f('0x30')][_0x366f('0x1a')]);}_0x357ee6['order']=qs[_0x366f('0x35')](_0x21d9af[_0x366f('0x30')][_0x366f('0x35')]);_0x357ee6[_0x366f('0x36')]=qs[_0x366f('0x31')](_['pick'](_0x21d9af[_0x366f('0x30')],_0x1c0419['filters']),_0x520370);if(_0x21d9af[_0x366f('0x30')][_0x366f('0x37')]){_0x357ee6[_0x366f('0x36')]=_[_0x366f('0x38')](_0x357ee6[_0x366f('0x36')],{'$or':_['map'](_0x520370,function(_0x3dd374){if(_0x3dd374['type']!==_0x366f('0x39')){var _0x50d7e3={};_0x50d7e3[_0x3dd374['name']]={'$like':'%'+_0x21d9af['query'][_0x366f('0x37')]+'%'};return _0x50d7e3;}})});}_0x357ee6=_[_0x366f('0x38')]({},_0x357ee6,_0x21d9af[_0x366f('0x3a')]);var _0x5dab1c={'where':_0x357ee6[_0x366f('0x36')]};return db[_0x366f('0x29')]['count'](_0x5dab1c)[_0x366f('0x21')](function(_0x4df8d4){_0x3631f6[_0x366f('0x1d')]=_0x4df8d4;if(_0x21d9af['query'][_0x366f('0x3b')]){_0x357ee6[_0x366f('0x3c')]=[{'all':!![]}];}return db[_0x366f('0x29')][_0x366f('0x3d')](_0x357ee6);})[_0x366f('0x21')](function(_0x49fd82){_0x3631f6[_0x366f('0x3e')]=_0x49fd82;return _0x3631f6;})[_0x366f('0x21')](respondWithFilteredResult(_0x26a6d5,_0x357ee6))['catch'](handleError(_0x26a6d5,null));};exports[_0x366f('0x3f')]=function(_0x36abeb,_0x3306bf){var _0x355925={'raw':!![],'where':{'id':_0x36abeb[_0x366f('0x40')]['id']}},_0xa03871={};_0xa03871['model']=_[_0x366f('0x41')](db[_0x366f('0x29')][_0x366f('0x2a')]);_0xa03871['query']=_[_0x366f('0x41')](_0x36abeb[_0x366f('0x30')]);_0xa03871['filters']=_[_0x366f('0x42')](_0xa03871[_0x366f('0x2d')],_0xa03871[_0x366f('0x30')]);_0x355925['attributes']=_['intersection'](_0xa03871['model'],qs[_0x366f('0x43')](_0x36abeb[_0x366f('0x30')][_0x366f('0x43')]));_0x355925[_0x366f('0x32')]=_0x355925[_0x366f('0x32')]['length']?_0x355925[_0x366f('0x32')]:_0xa03871[_0x366f('0x2d')];if(_0x36abeb[_0x366f('0x30')][_0x366f('0x3b')]){_0x355925[_0x366f('0x3c')]=[{'all':!![]}];}_0x355925=_[_0x366f('0x38')]({},_0x355925,_0x36abeb[_0x366f('0x3a')]);return db['CmCustomField'][_0x366f('0x44')](_0x355925)[_0x366f('0x21')](handleEntityNotFound(_0x3306bf,null))[_0x366f('0x21')](respondWithResult(_0x3306bf,null))[_0x366f('0x45')](handleError(_0x3306bf,null));};exports[_0x366f('0x20')]=function(_0x4f36c2,_0x2947b0){if(_0x4f36c2[_0x366f('0x46')]['id']){delete _0x4f36c2[_0x366f('0x46')]['id'];}return db[_0x366f('0x29')][_0x366f('0x44')]({'where':{'id':_0x4f36c2[_0x366f('0x40')]['id']}})[_0x366f('0x21')](handleEntityNotFound(_0x2947b0,null))[_0x366f('0x21')](saveUpdates(_0x4f36c2[_0x366f('0x46')],null))[_0x366f('0x21')](respondWithResult(_0x2947b0,null))['catch'](handleError(_0x2947b0,null));};exports[_0x366f('0x22')]=function(_0x2aeb73,_0xdae03e){return db[_0x366f('0x29')][_0x366f('0x44')]({'where':{'id':_0x2aeb73[_0x366f('0x40')]['id']}})['then'](handleEntityNotFound(_0xdae03e,null))[_0x366f('0x21')](removeEntity(_0xdae03e,null))['catch'](handleError(_0xdae03e,null));};exports[_0x366f('0x47')]=function(_0x486b72,_0x4c96d2){var _0x19fe60;return db[_0x366f('0x48')][_0x366f('0x49')](function(_0x590147){return db[_0x366f('0x29')][_0x366f('0x47')](_0x486b72[_0x366f('0x46')],{'transaction':_0x590147})[_0x366f('0x21')](function(_0x558a7d){_0x19fe60=_0x558a7d;var _0x4c3f8e={'type':db['Sequelize'][_0x366f('0x4a')],'transaction':_0x590147};switch(_0x486b72[_0x366f('0x46')]['type']){case _0x366f('0x4b'):_0x4c3f8e['type']=db['Sequelize'][_0x366f('0x4a')];break;case _0x366f('0x4c'):_0x4c3f8e['type']=db['Sequelize'][_0x366f('0x4d')];break;case'switch':_0x4c3f8e[_0x366f('0x2b')]=db[_0x366f('0x4e')][_0x366f('0x4f')];_0x4c3f8e[_0x366f('0x50')]=![];break;default:}return db[_0x366f('0x48')][_0x366f('0x51')][_0x366f('0x52')](_0x366f('0x53'),util['format'](_0x366f('0x54'),_0x19fe60['id']),_0x4c3f8e);})[_0x366f('0x21')](function(){return _0x19fe60;});})[_0x366f('0x21')](respondWithResult(_0x4c96d2,0xc9))['catch'](handleError(_0x4c96d2,null));};
\ No newline at end of file
+var _0x1477=['index','map','CmCustomField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','includeAll','findAll','rows','catch','params','include','options','find','update','body','create','sequelize','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','error','stack','name'];(function(_0x307dce,_0x2e367f){var _0x454e3e=function(_0x212ceb){while(--_0x212ceb){_0x307dce['push'](_0x307dce['shift']());}};_0x454e3e(++_0x2e367f);}(_0x1477,0x122));var _0x7147=function(_0x15f00f,_0x323ca1){_0x15f00f=_0x15f00f-0x0;var _0x552a57=_0x1477[_0x15f00f];return _0x552a57;};'use strict';var emlformat=require(_0x7147('0x0'));var rimraf=require(_0x7147('0x1'));var zipdir=require(_0x7147('0x2'));var jsonpatch=require(_0x7147('0x3'));var rp=require(_0x7147('0x4'));var moment=require('moment');var BPromise=require(_0x7147('0x5'));var Mustache=require(_0x7147('0x6'));var util=require('util');var path=require(_0x7147('0x7'));var sox=require(_0x7147('0x8'));var csv=require(_0x7147('0x9'));var ejs=require(_0x7147('0xa'));var fs=require('fs');var fs_extra=require(_0x7147('0xb'));var _=require(_0x7147('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7147('0x9'));var querystring=require(_0x7147('0xd'));var Papa=require('papaparse');var Redis=require(_0x7147('0xe'));var authService=require(_0x7147('0xf'));var qs=require(_0x7147('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7147('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x7147('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7147('0x13'));var db=require(_0x7147('0x14'))['db'];function respondWithStatusCode(_0x50e05e,_0x495512){_0x495512=_0x495512||0xcc;return function(_0x24d58b){if(_0x24d58b){return _0x50e05e[_0x7147('0x15')](_0x495512);}return _0x50e05e[_0x7147('0x16')](_0x495512)[_0x7147('0x17')]();};}function respondWithResult(_0xd4156b,_0x4ded34){_0x4ded34=_0x4ded34||0xc8;return function(_0xe1a401){if(_0xe1a401){return _0xd4156b[_0x7147('0x16')](_0x4ded34)[_0x7147('0x18')](_0xe1a401);}};}function respondWithFilteredResult(_0xd3fabf,_0x36a6a7){return function(_0x40d373){if(_0x40d373){var _0x32fdc9=typeof _0x36a6a7['offset']===_0x7147('0x19')&&typeof _0x36a6a7[_0x7147('0x1a')]===_0x7147('0x19');var _0x517bf9=_0x40d373[_0x7147('0x1b')];var _0x4ae0d3=_0x32fdc9?0x0:_0x36a6a7['offset'];var _0x10b987=_0x32fdc9?_0x40d373[_0x7147('0x1b')]:_0x36a6a7[_0x7147('0x1c')]+_0x36a6a7[_0x7147('0x1a')];var _0x272229;if(_0x10b987>=_0x517bf9){_0x10b987=_0x517bf9;_0x272229=0xc8;}else{_0x272229=0xce;}_0xd3fabf[_0x7147('0x16')](_0x272229);return _0xd3fabf[_0x7147('0x1d')]('Content-Range',_0x4ae0d3+'-'+_0x10b987+'/'+_0x517bf9)[_0x7147('0x18')](_0x40d373);}return null;};}function patchUpdates(_0x43a9a3){return function(_0x58ed61){try{jsonpatch[_0x7147('0x1e')](_0x58ed61,_0x43a9a3,!![]);}catch(_0xb7a297){return BPromise[_0x7147('0x1f')](_0xb7a297);}return _0x58ed61[_0x7147('0x20')]();};}function saveUpdates(_0x2f19a3,_0x37acfa){return function(_0x12b2a0){if(_0x12b2a0){return _0x12b2a0['update'](_0x2f19a3)[_0x7147('0x21')](function(_0x2cc01b){return _0x2cc01b;});}return null;};}function removeEntity(_0x1a4048,_0x169dd9){return function(_0x12cdcc){if(_0x12cdcc){return _0x12cdcc[_0x7147('0x22')]()[_0x7147('0x21')](function(){_0x1a4048[_0x7147('0x16')](0xcc)[_0x7147('0x17')]();});}};}function handleEntityNotFound(_0x5ecc40,_0x43a7f2){return function(_0x278402){if(!_0x278402){_0x5ecc40[_0x7147('0x15')](0x194);}return _0x278402;};}function handleError(_0x4919ad,_0x26198c){_0x26198c=_0x26198c||0x1f4;return function(_0x2092ad){logger[_0x7147('0x23')](_0x2092ad[_0x7147('0x24')]);if(_0x2092ad[_0x7147('0x25')]){delete _0x2092ad[_0x7147('0x25')];}_0x4919ad[_0x7147('0x16')](_0x26198c)['send'](_0x2092ad);};}exports[_0x7147('0x26')]=function(_0x574a43,_0x34cb07){var _0x1c50fd={},_0x30c86a={},_0xe5ff17={'count':0x0,'rows':[]};var _0x87cc1d=_[_0x7147('0x27')](db[_0x7147('0x28')][_0x7147('0x29')],function(_0x39dd79){return{'name':_0x39dd79[_0x7147('0x2a')],'type':_0x39dd79[_0x7147('0x2b')][_0x7147('0x2c')]};});_0x30c86a[_0x7147('0x2d')]=_['differenceBy'](_['map'](_0x87cc1d,_0x7147('0x25')),['name']);_0x30c86a[_0x7147('0x2e')]=_[_0x7147('0x2f')](_0x574a43[_0x7147('0x2e')]);_0x30c86a[_0x7147('0x30')]=_[_0x7147('0x31')](_0x30c86a[_0x7147('0x2d')],_0x30c86a[_0x7147('0x2e')]);_0x1c50fd[_0x7147('0x32')]=_[_0x7147('0x31')](_0x30c86a['model'],qs[_0x7147('0x33')](_0x574a43[_0x7147('0x2e')][_0x7147('0x33')]));_0x1c50fd[_0x7147('0x32')]=_0x1c50fd['attributes'][_0x7147('0x34')]?_0x1c50fd[_0x7147('0x32')]:_0x30c86a['model'];if(!_0x574a43[_0x7147('0x2e')]['hasOwnProperty'](_0x7147('0x35'))){_0x1c50fd[_0x7147('0x1a')]=qs['limit'](_0x574a43[_0x7147('0x2e')][_0x7147('0x1a')]);_0x1c50fd[_0x7147('0x1c')]=qs[_0x7147('0x1c')](_0x574a43['query'][_0x7147('0x1c')]);}_0x1c50fd[_0x7147('0x36')]=qs[_0x7147('0x37')](_0x574a43[_0x7147('0x2e')][_0x7147('0x37')]);_0x1c50fd[_0x7147('0x38')]=qs['filters'](_[_0x7147('0x39')](_0x574a43[_0x7147('0x2e')],_0x30c86a[_0x7147('0x30')]),_0x87cc1d);if(_0x574a43[_0x7147('0x2e')]['filter']){_0x1c50fd[_0x7147('0x38')]=_[_0x7147('0x3a')](_0x1c50fd['where'],{'$or':_['map'](_0x87cc1d,function(_0x4fe735){if(_0x4fe735[_0x7147('0x2b')]!=='VIRTUAL'){var _0x397b5f={};_0x397b5f[_0x4fe735['name']]={'$like':'%'+_0x574a43[_0x7147('0x2e')][_0x7147('0x3b')]+'%'};return _0x397b5f;}})});}_0x1c50fd=_[_0x7147('0x3a')]({},_0x1c50fd,_0x574a43['options']);var _0x4d9c6b={'where':_0x1c50fd[_0x7147('0x38')]};return db[_0x7147('0x28')][_0x7147('0x1b')](_0x4d9c6b)[_0x7147('0x21')](function(_0x8c5f0a){_0xe5ff17[_0x7147('0x1b')]=_0x8c5f0a;if(_0x574a43[_0x7147('0x2e')][_0x7147('0x3c')]){_0x1c50fd['include']=[{'all':!![]}];}return db['CmCustomField'][_0x7147('0x3d')](_0x1c50fd);})['then'](function(_0xe47e18){_0xe5ff17[_0x7147('0x3e')]=_0xe47e18;return _0xe5ff17;})[_0x7147('0x21')](respondWithFilteredResult(_0x34cb07,_0x1c50fd))[_0x7147('0x3f')](handleError(_0x34cb07,null));};exports['show']=function(_0x2b273c,_0x355245){var _0xf2a1d0={'raw':!![],'where':{'id':_0x2b273c[_0x7147('0x40')]['id']}},_0x11d421={};_0x11d421[_0x7147('0x2d')]=_[_0x7147('0x2f')](db[_0x7147('0x28')][_0x7147('0x29')]);_0x11d421[_0x7147('0x2e')]=_[_0x7147('0x2f')](_0x2b273c['query']);_0x11d421[_0x7147('0x30')]=_[_0x7147('0x31')](_0x11d421[_0x7147('0x2d')],_0x11d421[_0x7147('0x2e')]);_0xf2a1d0[_0x7147('0x32')]=_['intersection'](_0x11d421[_0x7147('0x2d')],qs[_0x7147('0x33')](_0x2b273c['query'][_0x7147('0x33')]));_0xf2a1d0['attributes']=_0xf2a1d0[_0x7147('0x32')][_0x7147('0x34')]?_0xf2a1d0[_0x7147('0x32')]:_0x11d421[_0x7147('0x2d')];if(_0x2b273c[_0x7147('0x2e')][_0x7147('0x3c')]){_0xf2a1d0[_0x7147('0x41')]=[{'all':!![]}];}_0xf2a1d0=_[_0x7147('0x3a')]({},_0xf2a1d0,_0x2b273c[_0x7147('0x42')]);return db[_0x7147('0x28')][_0x7147('0x43')](_0xf2a1d0)[_0x7147('0x21')](handleEntityNotFound(_0x355245,null))['then'](respondWithResult(_0x355245,null))[_0x7147('0x3f')](handleError(_0x355245,null));};exports[_0x7147('0x44')]=function(_0x1105a3,_0x51fa52){if(_0x1105a3[_0x7147('0x45')]['id']){delete _0x1105a3[_0x7147('0x45')]['id'];}return db[_0x7147('0x28')][_0x7147('0x43')]({'where':{'id':_0x1105a3['params']['id']}})['then'](handleEntityNotFound(_0x51fa52,null))[_0x7147('0x21')](saveUpdates(_0x1105a3[_0x7147('0x45')],null))[_0x7147('0x21')](respondWithResult(_0x51fa52,null))['catch'](handleError(_0x51fa52,null));};exports['destroy']=function(_0x825217,_0x491bd8){return db[_0x7147('0x28')][_0x7147('0x43')]({'where':{'id':_0x825217['params']['id']}})['then'](handleEntityNotFound(_0x491bd8,null))['then'](removeEntity(_0x491bd8,null))[_0x7147('0x3f')](handleError(_0x491bd8,null));};exports[_0x7147('0x46')]=function(_0x263fe2,_0x40a8bf){var _0x47cb27;return db[_0x7147('0x47')]['transaction'](function(_0x1d4f8f){return db[_0x7147('0x28')][_0x7147('0x46')](_0x263fe2['body'],{'transaction':_0x1d4f8f})[_0x7147('0x21')](function(_0x1244f8){_0x47cb27=_0x1244f8;var _0x486092={'type':db[_0x7147('0x48')][_0x7147('0x49')],'transaction':_0x1d4f8f};switch(_0x263fe2['body']['type']){case _0x7147('0x4a'):_0x486092['type']=db[_0x7147('0x48')][_0x7147('0x49')];break;case'number':_0x486092['type']=db[_0x7147('0x48')][_0x7147('0x4b')];break;case _0x7147('0x4c'):_0x486092[_0x7147('0x2b')]=db['Sequelize'][_0x7147('0x4d')];_0x486092[_0x7147('0x4e')]=![];break;default:}return db['sequelize'][_0x7147('0x4f')]['addColumn'](_0x7147('0x50'),util['format'](_0x7147('0x51'),_0x47cb27['id']),_0x486092);})[_0x7147('0x21')](function(){return _0x47cb27;});})[_0x7147('0x21')](respondWithResult(_0x40a8bf,0xc9))['catch'](handleError(_0x40a8bf,null));};
\ No newline at end of file
index b8d6a2d..dbb02a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6212=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./cmCustomField.attributes','CmCustomField','lodash'];(function(_0x4ab329,_0x307204){var _0x19356e=function(_0x45201e){while(--_0x45201e){_0x4ab329['push'](_0x4ab329['shift']());}};_0x19356e(++_0x307204);}(_0x6212,0xb3));var _0x2621=function(_0x3533d3,_0x2c94a7){_0x3533d3=_0x3533d3-0x0;var _0x329b59=_0x6212[_0x3533d3];return _0x329b59;};'use strict';var _=require(_0x2621('0x0'));var util=require(_0x2621('0x1'));var logger=require(_0x2621('0x2'))(_0x2621('0x3'));var moment=require(_0x2621('0x4'));var BPromise=require(_0x2621('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2621('0x6'));var rimraf=require('rimraf');var config=require(_0x2621('0x7'));var attributes=require(_0x2621('0x8'));module['exports']=function(_0x3a4a0e,_0x4be87c){return _0x3a4a0e['define'](_0x2621('0x9'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4610=['../../config/environment','./cmCustomField.attributes','define','CmCustomField','cm_custom_fields','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x30a640,_0x300254){var _0x21f6b4=function(_0x5f330d){while(--_0x5f330d){_0x30a640['push'](_0x30a640['shift']());}};_0x21f6b4(++_0x300254);}(_0x4610,0x16d));var _0x0461=function(_0x3871d7,_0x3cfcc5){_0x3871d7=_0x3871d7-0x0;var _0x28ec09=_0x4610[_0x3871d7];return _0x28ec09;};'use strict';var _=require(_0x0461('0x0'));var util=require(_0x0461('0x1'));var logger=require('../../config/logger')(_0x0461('0x2'));var moment=require(_0x0461('0x3'));var BPromise=require(_0x0461('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0461('0x5'));var rimraf=require(_0x0461('0x6'));var config=require(_0x0461('0x7'));var attributes=require(_0x0461('0x8'));module['exports']=function(_0x8c63e2,_0x66e5d3){return _0x8c63e2[_0x0461('0x9')](_0x0461('0xa'),attributes,{'tableName':_0x0461('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 00ed562..b40fbff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa284=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','error','message','info','catch','moment'];(function(_0x592d77,_0x5267ed){var _0x4b905d=function(_0x297480){while(--_0x297480){_0x592d77['push'](_0x592d77['shift']());}};_0x4b905d(++_0x5267ed);}(_0xa284,0x1da));var _0x4a28=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xa284[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4a28('0x0'));var BPromise=require(_0x4a28('0x1'));var rs=require(_0x4a28('0x2'));var fs=require('fs');var Redis=require(_0x4a28('0x3'));var db=require(_0x4a28('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4a28('0x5'))(_0x4a28('0x6'));var config=require(_0x4a28('0x7'));var jayson=require(_0x4a28('0x8'));var client=jayson[_0x4a28('0x9')][_0x4a28('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12a71a,_0x31d17b,_0x5dc5){return new BPromise(function(_0x15900b,_0x7c0b2a){return client['request'](_0x12a71a,_0x5dc5)[_0x4a28('0xb')](function(_0x2eadaf){logger['info'](_0x4a28('0xc'),_0x31d17b,_0x4a28('0xd'));logger[_0x4a28('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x31d17b,_0x4a28('0xd'),JSON['stringify'](_0x2eadaf));if(_0x2eadaf[_0x4a28('0xf')]){if(_0x2eadaf[_0x4a28('0xf')]['code']===0x1f4){logger[_0x4a28('0xf')]('CmCustomField,\x20%s,\x20%s',_0x31d17b,_0x2eadaf['error'][_0x4a28('0x10')]);return _0x7c0b2a(_0x2eadaf[_0x4a28('0xf')][_0x4a28('0x10')]);}logger[_0x4a28('0xf')]('CmCustomField,\x20%s,\x20%s',_0x31d17b,_0x2eadaf[_0x4a28('0xf')]['message']);return _0x15900b(_0x2eadaf['error'][_0x4a28('0x10')]);}else{logger[_0x4a28('0x11')]('CmCustomField,\x20%s,\x20%s',_0x31d17b,_0x4a28('0xd'));_0x15900b(_0x2eadaf['result'][_0x4a28('0x10')]);}})[_0x4a28('0x12')](function(_0x5cb34e){logger[_0x4a28('0xf')](_0x4a28('0xc'),_0x31d17b,_0x5cb34e);_0x7c0b2a(_0x5cb34e);});});}
\ No newline at end of file
+var _0x34cf=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','CmCustomField,\x20%s,\x20%s','message','result','util','bluebird','randomstring','ioredis'];(function(_0x2254f2,_0x2a8245){var _0x188eed=function(_0x399a26){while(--_0x399a26){_0x2254f2['push'](_0x2254f2['shift']());}};_0x188eed(++_0x2a8245);}(_0x34cf,0x81));var _0xf34c=function(_0x123d88,_0x15c3c6){_0x123d88=_0x123d88-0x0;var _0x15e738=_0x34cf[_0x123d88];return _0x15e738;};'use strict';var _=require('lodash');var util=require(_0xf34c('0x0'));var moment=require('moment');var BPromise=require(_0xf34c('0x1'));var rs=require(_0xf34c('0x2'));var fs=require('fs');var Redis=require(_0xf34c('0x3'));var db=require(_0xf34c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf34c('0x5'))(_0xf34c('0x6'));var config=require('../../config/environment');var jayson=require(_0xf34c('0x7'));var client=jayson[_0xf34c('0x8')][_0xf34c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fbc69,_0x33cd62,_0x5f5b3f){return new BPromise(function(_0x4797d7,_0x1901af){return client['request'](_0x2fbc69,_0x5f5b3f)[_0xf34c('0xa')](function(_0xaf5565){logger['info']('CmCustomField,\x20%s,\x20%s',_0x33cd62,_0xf34c('0xb'));logger[_0xf34c('0xc')](_0xf34c('0xd'),_0x33cd62,_0xf34c('0xb'),JSON[_0xf34c('0xe')](_0xaf5565));if(_0xaf5565[_0xf34c('0xf')]){if(_0xaf5565[_0xf34c('0xf')]['code']===0x1f4){logger[_0xf34c('0xf')](_0xf34c('0x10'),_0x33cd62,_0xaf5565[_0xf34c('0xf')][_0xf34c('0x11')]);return _0x1901af(_0xaf5565[_0xf34c('0xf')]['message']);}logger[_0xf34c('0xf')]('CmCustomField,\x20%s,\x20%s',_0x33cd62,_0xaf5565[_0xf34c('0xf')][_0xf34c('0x11')]);return _0x4797d7(_0xaf5565[_0xf34c('0xf')][_0xf34c('0x11')]);}else{logger['info']('CmCustomField,\x20%s,\x20%s',_0x33cd62,_0xf34c('0xb'));_0x4797d7(_0xaf5565[_0xf34c('0x12')][_0xf34c('0x11')]);}})['catch'](function(_0x40f42c){logger[_0xf34c('0xf')]('CmCustomField,\x20%s,\x20%s',_0x33cd62,_0x40f42c);_0x1901af(_0x40f42c);});});}
\ No newline at end of file
index c477df6..155b49e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3ff=['../../components/auth/service','../../config/environment','./cmCustomField.controller','get','index','isAuthenticated','show','put','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x43941d,_0x45fd0d){var _0x27b82a=function(_0x21851e){while(--_0x21851e){_0x43941d['push'](_0x43941d['shift']());}};_0x27b82a(++_0x45fd0d);}(_0xf3ff,0xae));var _0xff3f=function(_0x18c14d,_0x4b76a){_0x18c14d=_0x18c14d-0x0;var _0x477fce=_0xf3ff[_0x18c14d];return _0x477fce;};'use strict';var multer=require(_0xff3f('0x0'));var util=require('util');var path=require(_0xff3f('0x1'));var timeout=require(_0xff3f('0x2'));var express=require(_0xff3f('0x3'));var router=express[_0xff3f('0x4')]();var fs_extra=require(_0xff3f('0x5'));var auth=require(_0xff3f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xff3f('0x7'));var controller=require(_0xff3f('0x8'));router[_0xff3f('0x9')]('/',auth['isAuthenticated'](),controller[_0xff3f('0xa')]);router[_0xff3f('0x9')]('/:id',auth[_0xff3f('0xb')](),controller[_0xff3f('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xff3f('0xd')]('/:id',auth[_0xff3f('0xb')](),controller['update']);router[_0xff3f('0xe')](_0xff3f('0xf'),auth[_0xff3f('0xb')](),controller[_0xff3f('0x10')]);module[_0xff3f('0x11')]=router;
\ No newline at end of file
+var _0x1d63=['get','isAuthenticated','index','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1d63,0x16f));var _0x31d6=function(_0x411804,_0x12ff56){_0x411804=_0x411804-0x0;var _0x2823c3=_0x1d63[_0x411804];return _0x2823c3;};'use strict';var multer=require(_0x31d6('0x0'));var util=require('util');var path=require(_0x31d6('0x1'));var timeout=require(_0x31d6('0x2'));var express=require(_0x31d6('0x3'));var router=express['Router']();var fs_extra=require(_0x31d6('0x4'));var auth=require(_0x31d6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x31d6('0x6'));var controller=require('./cmCustomField.controller');router[_0x31d6('0x7')]('/',auth[_0x31d6('0x8')](),controller[_0x31d6('0x9')]);router[_0x31d6('0x7')]('/:id',auth[_0x31d6('0x8')](),controller[_0x31d6('0xa')]);router[_0x31d6('0xb')]('/',auth['isAuthenticated'](),controller[_0x31d6('0xc')]);router[_0x31d6('0xd')]('/:id',auth[_0x31d6('0x8')](),controller[_0x31d6('0xe')]);router[_0x31d6('0xf')]('/:id',auth[_0x31d6('0x8')](),controller[_0x31d6('0x10')]);module['exports']=router;
\ No newline at end of file
index c16872c..86d02a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x143b=['format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','DATE','sequelize','exports','STRING','BOOLEAN'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x143b,0x100));var _0xb143=function(_0xaf4bc7,_0x4e8b9e){_0xaf4bc7=_0xaf4bc7-0x0;var _0x819be3=_0x143b[_0xaf4bc7];return _0x819be3;};'use strict';var moment=require('moment');var Sequelize=require(_0xb143('0x0'));module[_0xb143('0x1')]={'phone':{'type':Sequelize[_0xb143('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xb143('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xb143('0x4')](_0xb143('0x5'))},'countbusyretry':{'type':Sequelize[_0xb143('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xb143('0x6')](0x2)[_0xb143('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xb143('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xb143('0x6')],'unique':_0xb143('0x8')},'ListId':{'type':Sequelize[_0xb143('0x6')],'unique':_0xb143('0x8')},'UserId':{'type':Sequelize[_0xb143('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xb143('0x6')],'unique':_0xb143('0x8')},'CampaignId':{'type':Sequelize[_0xb143('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xb143('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb143('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb143('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb143('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb143('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xb143('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xb143('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0xb143('0x9')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
+var _0xcc56=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','STRING','DATE','UNSIGNED','contactListQueue','moment','sequelize','exports'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0xcc56,0x101));var _0x6cc5=function(_0x1436d8,_0x5135aa){_0x1436d8=_0x1436d8-0x0;var _0x252c31=_0xcc56[_0x1436d8];return _0x252c31;};'use strict';var moment=require(_0x6cc5('0x0'));var Sequelize=require(_0x6cc5('0x1'));module[_0x6cc5('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0x6cc5('0x3'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6cc5('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6cc5('0x4')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x6cc5('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6cc5('0x6')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6cc5('0x7')]},'priority':{'type':Sequelize[_0x6cc5('0x4')](0x2)[_0x6cc5('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x6cc5('0x5')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x6cc5('0x4')],'unique':_0x6cc5('0x9')},'ListId':{'type':Sequelize[_0x6cc5('0x4')],'unique':_0x6cc5('0x9')},'UserId':{'type':Sequelize[_0x6cc5('0x4')]},'VoiceQueueId':{'type':Sequelize[_0x6cc5('0x4')],'unique':_0x6cc5('0x9')},'CampaignId':{'type':Sequelize[_0x6cc5('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6cc5('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6cc5('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6cc5('0x4')],'defaultValue':0x0},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x6cc5('0x6')]},'recallmeNotifiedDate':{'type':Sequelize[_0x6cc5('0x7')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
index 13ed1c1..5e3eef1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3e6=['ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','create','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','format','value','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','findOne','scheduledat','phone','recallme','UPDATE','Contact','CmCompany','Company','VoiceQueue','Queue','dialActive','getPreviewRecall','LOCK','CmList','List','error','getOpenContacts','entity\x20not\x20found','push','utcOffset','timezones','moment','../../components/parsers/qs','api','../../config/environment','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','update','then','sendStatus','stack','name','map','CmHopper','rawAttributes','fieldName','key','query','keys','intersection','model','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','params','fields','find','catch','body','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','deleted','campaign','membername','user','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype'];(function(_0x2b172e,_0x5970ae){var _0x504614=function(_0x436d1f){while(--_0x436d1f){_0x2b172e['push'](_0x2b172e['shift']());}};_0x504614(++_0x5970ae);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x257c67,_0x25bf59){_0x257c67=_0x257c67-0x0;var _0x435dfb=_0xa3e6[_0x257c67];return _0x435dfb;};'use strict';var moment=require(_0x6a3e('0x0'));var _=require('lodash');var qs=require(_0x6a3e('0x1'));var logger=require('../../config/logger')(_0x6a3e('0x2'));var shared=require(_0x6a3e('0x3'));var db=require(_0x6a3e('0x4'))['db'];function respondWithResult(_0x56e3f4,_0xe03261){_0xe03261=_0xe03261||0xc8;return function(_0x5e9a85){if(_0x5e9a85){return _0x56e3f4[_0x6a3e('0x5')](_0xe03261)[_0x6a3e('0x6')](_0x5e9a85);}};}function respondWithFilteredResult(_0x1c7709,_0x315ed8){return function(_0x19dd88){if(_0x19dd88){var _0x52a2f8=typeof _0x315ed8[_0x6a3e('0x7')]===_0x6a3e('0x8')&&typeof _0x315ed8['limit']==='undefined';var _0x2d2477=_0x19dd88['count'];var _0x54a40c=_0x52a2f8?0x0:_0x315ed8[_0x6a3e('0x7')];var _0x4f5a4a=_0x52a2f8?_0x19dd88[_0x6a3e('0x9')]:_0x315ed8['offset']+_0x315ed8[_0x6a3e('0xa')];var _0x3159db;if(_0x4f5a4a>=_0x2d2477){_0x4f5a4a=_0x2d2477;_0x3159db=0xc8;}else{_0x3159db=0xce;}_0x1c7709[_0x6a3e('0x5')](_0x3159db);return _0x1c7709[_0x6a3e('0xb')](_0x6a3e('0xc'),_0x54a40c+'-'+_0x4f5a4a+'/'+_0x2d2477)[_0x6a3e('0x6')](_0x19dd88);}return null;};}function saveUpdates(_0x4a3a97,_0x27e169){return function(_0x385c29){if(_0x385c29){return _0x385c29[_0x6a3e('0xd')](_0x4a3a97)[_0x6a3e('0xe')](function(_0x1364be){return _0x1364be;});}return null;};}function handleEntityNotFound(_0x31aefa,_0x222f7c){return function(_0x4bd05f){if(!_0x4bd05f){_0x31aefa[_0x6a3e('0xf')](0x194);}return _0x4bd05f;};}function handleError(_0x13b172,_0x8ed74b){_0x8ed74b=_0x8ed74b||0x1f4;return function(_0x2a62a8){logger['error'](_0x2a62a8[_0x6a3e('0x10')]);if(_0x2a62a8[_0x6a3e('0x11')]){delete _0x2a62a8['name'];}_0x13b172['status'](_0x8ed74b)['send'](_0x2a62a8);};}exports['index']=function(_0x48adf6,_0x3693a2){var _0x467e2c={},_0x31a190={},_0x701d04={'count':0x0,'rows':[]};var _0x17fde0=_[_0x6a3e('0x12')](db[_0x6a3e('0x13')][_0x6a3e('0x14')],function(_0x493454){return{'name':_0x493454[_0x6a3e('0x15')],'type':_0x493454['type'][_0x6a3e('0x16')]};});_0x31a190['model']=_[_0x6a3e('0x12')](_0x17fde0,_0x6a3e('0x11'));_0x31a190[_0x6a3e('0x17')]=_[_0x6a3e('0x18')](_0x48adf6['query']);_0x31a190['filters']=_[_0x6a3e('0x19')](_0x31a190[_0x6a3e('0x1a')],_0x31a190[_0x6a3e('0x17')]);_0x31a190[_0x6a3e('0x1b')]=_[_0x6a3e('0x1c')](_0x31a190[_0x6a3e('0x1b')],[_0x6a3e('0x1d'),_0x6a3e('0x1e'),_0x6a3e('0x1f'),_0x6a3e('0x20'),_0x6a3e('0x21'),_0x6a3e('0x22'),_0x6a3e('0x23'),_0x6a3e('0x24'),_0x6a3e('0x25'),'$between','$notBetween',_0x6a3e('0x26'),_0x6a3e('0x27'),_0x6a3e('0x28'),_0x6a3e('0x29'),_0x6a3e('0x2a'),_0x6a3e('0x2b'),_0x6a3e('0x28'),_0x6a3e('0x2c'),_0x6a3e('0x2d'),_0x6a3e('0x2e'),_0x6a3e('0x2f')]);_0x467e2c['attributes']=_['intersection'](_0x31a190[_0x6a3e('0x1a')],qs['fields'](_0x48adf6[_0x6a3e('0x17')]['fields']));_0x467e2c['attributes']=_0x467e2c[_0x6a3e('0x30')][_0x6a3e('0x31')]?_0x467e2c['attributes']:_0x31a190['model'];if(!_0x48adf6[_0x6a3e('0x17')][_0x6a3e('0x32')](_0x6a3e('0x33'))){_0x467e2c[_0x6a3e('0xa')]=qs['limit'](_0x48adf6['query'][_0x6a3e('0xa')]);_0x467e2c[_0x6a3e('0x7')]=qs[_0x6a3e('0x7')](_0x48adf6[_0x6a3e('0x17')]['offset']);}_0x467e2c[_0x6a3e('0x34')]=qs[_0x6a3e('0x35')](_0x48adf6['query']['sort']);_0x467e2c['where']=qs[_0x6a3e('0x1b')](_[_0x6a3e('0x36')](_0x48adf6[_0x6a3e('0x17')],_0x31a190[_0x6a3e('0x1b')]),_0x17fde0);if(_0x48adf6[_0x6a3e('0x17')][_0x6a3e('0x37')]){_0x467e2c[_0x6a3e('0x38')]=_[_0x6a3e('0x39')](_0x467e2c[_0x6a3e('0x38')],{'$or':_[_0x6a3e('0x12')](_0x17fde0,function(_0xe442a9){if(_0xe442a9[_0x6a3e('0x3a')]!==_0x6a3e('0x3b')){var _0x12469a={};_0x12469a[_0xe442a9[_0x6a3e('0x11')]]={'$like':'%'+_0x48adf6['query'][_0x6a3e('0x37')]+'%'};return _0x12469a;}})});}_0x467e2c=_[_0x6a3e('0x39')]({},_0x467e2c,_0x48adf6[_0x6a3e('0x3c')]);var _0x5cf995={'where':_0x467e2c[_0x6a3e('0x38')]};return db[_0x6a3e('0x13')]['count'](_0x5cf995)[_0x6a3e('0xe')](function(_0x3f7e1){_0x701d04[_0x6a3e('0x9')]=_0x3f7e1;if(_0x48adf6['query'][_0x6a3e('0x3d')]){_0x467e2c[_0x6a3e('0x3e')]=[{'all':!![]}];}return db[_0x6a3e('0x13')][_0x6a3e('0x3f')](_0x467e2c);})[_0x6a3e('0xe')](function(_0x1f7d13){_0x701d04['rows']=_0x1f7d13;return _0x701d04;})[_0x6a3e('0xe')](respondWithFilteredResult(_0x3693a2,_0x467e2c))['catch'](handleError(_0x3693a2,null));};exports['show']=function(_0x4bc630,_0xfbbb78){var _0x4bb1ba={'raw':!![],'where':{'id':_0x4bc630[_0x6a3e('0x40')]['id']}},_0x1a6b68={};_0x1a6b68[_0x6a3e('0x1a')]=_[_0x6a3e('0x18')](db[_0x6a3e('0x13')][_0x6a3e('0x14')]);_0x1a6b68['query']=_['keys'](_0x4bc630[_0x6a3e('0x17')]);_0x1a6b68[_0x6a3e('0x1b')]=_[_0x6a3e('0x19')](_0x1a6b68[_0x6a3e('0x1a')],_0x1a6b68[_0x6a3e('0x17')]);_0x4bb1ba['attributes']=_[_0x6a3e('0x19')](_0x1a6b68[_0x6a3e('0x1a')],qs['fields'](_0x4bc630[_0x6a3e('0x17')][_0x6a3e('0x41')]));_0x4bb1ba[_0x6a3e('0x30')]=_0x4bb1ba['attributes'][_0x6a3e('0x31')]?_0x4bb1ba[_0x6a3e('0x30')]:_0x1a6b68[_0x6a3e('0x1a')];if(_0x4bc630[_0x6a3e('0x17')][_0x6a3e('0x3d')]){_0x4bb1ba[_0x6a3e('0x3e')]=[{'all':!![]}];}_0x4bb1ba=_['merge']({},_0x4bb1ba,_0x4bc630[_0x6a3e('0x3c')]);return db[_0x6a3e('0x13')][_0x6a3e('0x42')](_0x4bb1ba)['then'](handleEntityNotFound(_0xfbbb78,null))[_0x6a3e('0xe')](respondWithResult(_0xfbbb78,null))['catch'](handleError(_0xfbbb78,null));};exports['create']=function(_0x1b801e,_0x2788a8){return db[_0x6a3e('0x13')]['create'](_0x1b801e['body'],{})[_0x6a3e('0xe')](respondWithResult(_0x2788a8,0xc9))[_0x6a3e('0x43')](handleError(_0x2788a8,null));};exports[_0x6a3e('0xd')]=function(_0x320530,_0x1c9f75){if(_0x320530[_0x6a3e('0x44')]['id']){delete _0x320530['body']['id'];}return db[_0x6a3e('0x13')][_0x6a3e('0x42')]({'where':{'id':_0x320530[_0x6a3e('0x40')]['id']}})[_0x6a3e('0xe')](handleEntityNotFound(_0x1c9f75,null))[_0x6a3e('0xe')](saveUpdates(_0x320530[_0x6a3e('0x44')],null))[_0x6a3e('0xe')](respondWithResult(_0x1c9f75,null))[_0x6a3e('0x43')](handleError(_0x1c9f75,null));};exports[_0x6a3e('0x45')]=function(_0x4d36e2,_0x40a09d){return db[_0x6a3e('0x13')]['describe']()[_0x6a3e('0xe')](respondWithResult(_0x40a09d,null))['catch'](handleError(_0x40a09d,null));};exports[_0x6a3e('0x46')]=function(_0x10cd8e,_0x28a3e9){var _0x4f288d;var _0x25fa0c=_0x10cd8e[_0x6a3e('0x40')]['id'];return db['CmHopper']['find']({'where':{'id':_0x10cd8e['params']['id']}})[_0x6a3e('0xe')](handleEntityNotFound(_0x28a3e9,null))[_0x6a3e('0xe')](function(_0x32fb36){if(_0x32fb36){return _0x32fb36[_0x6a3e('0x46')]()[_0x6a3e('0xe')](function(_0x448e46){return _0x448e46;});}})[_0x6a3e('0xe')](function(_0x1ce964){_0x4f288d=_0x1ce964;if(_0x1ce964){if(_0x1ce964[_0x6a3e('0x47')]||_0x1ce964[_0x6a3e('0x48')]){return db[_0x1ce964[_0x6a3e('0x47')]?'VoiceQueue':_0x6a3e('0x49')][_0x6a3e('0x42')]({'where':{'id':_0x1ce964[_0x6a3e('0x47')]?_0x1ce964[_0x6a3e('0x47')]:_0x1ce964[_0x6a3e('0x48')]},'attributes':['id','name'],'raw':!![]});}}})[_0x6a3e('0xe')](function(_0x4d1882){var _0x1afa0a={};if(_0x4d1882){_[_0x6a3e('0x39')](_0x1afa0a,_[_0x6a3e('0x4a')](_0x4f288d[_0x6a3e('0x4b')],[_0x6a3e('0x4c'),'updatedAt','id']));_0x1afa0a['state']=0x15;_0x1afa0a['statedesc']=_0x6a3e('0x4d');_0x1afa0a[_0x6a3e('0x4e')]=_0x4d1882[_0x6a3e('0x11')];_0x1afa0a[_0x6a3e('0x4f')]=_0x10cd8e[_0x6a3e('0x50')][_0x6a3e('0x11')];_0x1afa0a['UserId']=_0x10cd8e[_0x6a3e('0x50')]['id'];_0x1afa0a['deleted']=!![];_0x1afa0a['deletedat']=moment()['format'](_0x6a3e('0x51'));_0x1afa0a[_0x6a3e('0x52')]=_0x4f288d['phone'];_0x1afa0a[_0x6a3e('0x53')]=_0x4f288d[_0x6a3e('0x47')]?'queue':_0x6a3e('0x54');return db[_0x6a3e('0x55')][_0x6a3e('0x42')]({'where':{'id':_0x1afa0a[_0x6a3e('0x56')]},'attributes':[_0x6a3e('0x57'),'lastName']})[_0x6a3e('0xe')](function(_0x9128f8){if(!_['isNil'](_0x28a3e9)&&!_[_0x6a3e('0x58')](_0x9128f8[_0x6a3e('0x57')])){_0x1afa0a[_0x6a3e('0x59')]=_0x9128f8[_0x6a3e('0x57')];if(!_[_0x6a3e('0x58')](_0x9128f8[_0x6a3e('0x5a')])){_0x1afa0a[_0x6a3e('0x59')]+='\x20'+_0x9128f8[_0x6a3e('0x5a')];}}})[_0x6a3e('0x5b')](function(){return db[_0x6a3e('0x5c')][_0x6a3e('0x5d')](_0x1afa0a);});}})['then'](function(_0x2870be){return db[_0x6a3e('0x5e')][_0x6a3e('0x46')]({'where':{'CmHopperId':_0x25fa0c}});})['then'](function(){return _0x28a3e9[_0x6a3e('0x5')](0xcc)[_0x6a3e('0x5f')]();})[_0x6a3e('0x43')](handleError(_0x28a3e9,null));};exports[_0x6a3e('0x60')]=function(_0x582ad9,_0x3e29a8){var _0x5ed33d=[];return db[_0x6a3e('0x55')]['describe']()[_0x6a3e('0xe')](function(_0x486d4a){_0x5ed33d=_[_0x6a3e('0x18')](_0x486d4a);return _0x582ad9[_0x6a3e('0x50')][_0x6a3e('0x61')]({'where':{'type':_0x6a3e('0x62'),'dialActive':!![],'dialMethod':_0x6a3e('0x63')},'attributes':['id',_0x6a3e('0x64'),_0x6a3e('0x65')],'raw':!![]});})['then'](function(_0x3a5f9d){if(_0x3a5f9d&&_0x3a5f9d[_0x6a3e('0x31')]){return db[_0x6a3e('0x66')][_0x6a3e('0x67')](function(_0x145655){var _0x3a4a29={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6a3e('0x68')](_0x6a3e('0x51'))},'VoiceQueueId':{'$in':_[_0x6a3e('0x12')](_0x3a5f9d,'id')},'$or':[{'UserId':null},{'UserId':_0x582ad9[_0x6a3e('0x50')]['id']}]};var _0x3c7bd0={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3a5f9d)[_0x6a3e('0x37')](['dialPreviewAutoRecallMe',0x0])[_0x6a3e('0x12')]('id')[_0x6a3e('0x69')]()},'$or':[{'UserId':null},{'UserId':_0x582ad9[_0x6a3e('0x50')]['id']}]};var _0x5d11f9={'$or':[_0x3a4a29,_0x3c7bd0]};var _0x4420b9=[];if(_0x582ad9['body'][_0x6a3e('0x6a')]&&_0x582ad9[_0x6a3e('0x44')]['direction']===_0x6a3e('0x6b')){if(!_[_0x6a3e('0x6c')](_0x582ad9['body'][_0x6a3e('0x6d')])){_0x5d11f9['id']={'$in':_0x582ad9[_0x6a3e('0x44')][_0x6a3e('0x6d')]};}_0x4420b9=[[_0x6a3e('0x6e'),_0x6a3e('0x6f')],['scheduledAt',_0x3a5f9d[0x0][_0x6a3e('0x64')]==='ASC'?_0x6a3e('0x70'):'ASC'],db[_0x6a3e('0x66')][_0x6a3e('0x71')](_0x6a3e('0x72')),['id',_0x6a3e('0x70')]];}else{if(!_['isEmpty'](_0x582ad9['body'][_0x6a3e('0x6d')])){_0x5d11f9['id']={'$notIn':_0x582ad9[_0x6a3e('0x44')]['hopperIds']};}_0x4420b9=[[_0x6a3e('0x6e'),_0x6a3e('0x70')],[_0x6a3e('0x73'),_0x3a5f9d[0x0][_0x6a3e('0x64')]],db[_0x6a3e('0x66')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x6a3e('0x6f')]];}return db[_0x6a3e('0x13')][_0x6a3e('0x74')]({'attributes':['id',_0x6a3e('0x75'),_0x6a3e('0x76'),_0x6a3e('0x77')],'where':_0x5d11f9,'order':_0x4420b9,'transaction':_0x145655,'lock':_0x145655['LOCK'][_0x6a3e('0x78')],'include':[{'model':db[_0x6a3e('0x55')],'as':_0x6a3e('0x79'),'attributes':_0x5ed33d,'include':[{'model':db[_0x6a3e('0x7a')],'as':_0x6a3e('0x7b'),'attributes':['id',_0x6a3e('0x11')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x6a3e('0x11')]},{'model':db[_0x6a3e('0x7c')],'as':_0x6a3e('0x7d'),'attributes':['id',_0x6a3e('0x11'),_0x6a3e('0x7e')]}]})[_0x6a3e('0xe')](function(_0x2208e9){if(_0x2208e9){return _0x2208e9[_0x6a3e('0xd')]({'UserId':_0x582ad9[_0x6a3e('0x50')]['id']},{'transaction':_0x145655});}});});}})['then'](handleEntityNotFound(_0x3e29a8,null))[_0x6a3e('0xe')](respondWithResult(_0x3e29a8,null))[_0x6a3e('0x43')](handleError(_0x3e29a8,null));};exports[_0x6a3e('0x7f')]=function(_0x2e8af7,_0x35bbfe,_0x281fba){var _0x7e983a=[];var _0x687f86=_0x2e8af7['params']['id'];var _0x477bfb=_0x2e8af7['user']['id'];return db['CmContact'][_0x6a3e('0x45')]()[_0x6a3e('0xe')](function(_0x3f68c6){_0x7e983a=_['keys'](_0x3f68c6);return db[_0x6a3e('0x66')][_0x6a3e('0x67')](function(_0x20fdf4){const _0x672d9d={'id':_0x687f86};return db[_0x6a3e('0x13')][_0x6a3e('0x74')]({'attributes':['id',_0x6a3e('0x75'),_0x6a3e('0x77')],'where':_0x672d9d,'transaction':_0x20fdf4,'lock':_0x20fdf4[_0x6a3e('0x80')]['UPDATE'],'include':[{'model':db[_0x6a3e('0x55')],'as':_0x6a3e('0x79'),'attributes':_0x7e983a,'include':[{'model':db[_0x6a3e('0x7a')],'as':_0x6a3e('0x7b'),'attributes':['id',_0x6a3e('0x11')]}]},{'model':db[_0x6a3e('0x81')],'as':_0x6a3e('0x82'),'attributes':['id',_0x6a3e('0x11')]},{'model':db[_0x6a3e('0x7c')],'as':_0x6a3e('0x7d'),'attributes':['id',_0x6a3e('0x11'),'dialActive']}]})['then'](function(_0x5148de){if(_0x5148de){return _0x5148de[_0x6a3e('0xd')]({'UserId':_0x477bfb},{'transaction':_0x20fdf4});}});});})['then'](handleEntityNotFound(_0x35bbfe,null))['then'](respondWithResult(_0x35bbfe,null))[_0x6a3e('0x43')](handleError(_0x35bbfe,null));};exports['getOpenContacts']=function(_0x1029f9,_0x7bf1b2){return _0x1029f9[_0x6a3e('0x50')][_0x6a3e('0x61')]({'where':{'type':_0x6a3e('0x62'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x6a3e('0xe')](function(_0x5bb624){if(_0x5bb624&&_0x5bb624[_0x6a3e('0x31')]){return db[_0x6a3e('0x13')][_0x6a3e('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6a3e('0x68')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x5bb624,'id')},'$or':[{'UserId':null},{'UserId':_0x1029f9[_0x6a3e('0x50')]['id']}]}});}return 0x0;})[_0x6a3e('0xe')](function(_0x242f2e){if(!_[_0x6a3e('0x58')](_0x242f2e)&&_['isNumber'](_0x242f2e)){return _0x7bf1b2[_0x6a3e('0x5')](0xc8)[_0x6a3e('0x6')]({'contacts':_0x242f2e});}else{logger[_0x6a3e('0x83')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x6a3e('0x84'),0x194,_0x6a3e('0x85'));_0x7bf1b2[_0x6a3e('0xf')](0x194);}})['catch'](handleError(_0x7bf1b2,null));};exports['getTimezones']=function(_0x242c45,_0xe89e40){var _0x35cefc=shared['timezones'];var _0xb9d497=[];_[_0x6a3e('0x12')](_0x35cefc,function(_0x5bf103){_0xb9d497[_0x6a3e('0x86')]({'id':_0x5bf103[_0x6a3e('0x11')],'name':_0x5bf103[_0x6a3e('0x11')],'utcOffset':_0x5bf103[_0x6a3e('0x87')]});});return _0xe89e40['status'](0xc8)['json']({'tz':_0xb9d497});};exports['getTimezone']=function(_0x4b71f4,_0x515764){var _0x32aefd=shared[_0x6a3e('0x88')];var _0x442eca={};if(!_[_0x6a3e('0x58')](_0x32aefd[_0x4b71f4[_0x6a3e('0x44')]['id']]))_0x442eca=_0x32aefd[_0x4b71f4['body']['id']];return _0x515764[_0x6a3e('0x5')](0xc8)[_0x6a3e('0x6')](_0x442eca);};
\ No newline at end of file
+var _0x4f17=['scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','List','Queue','dialActive','getPreviewRecall','getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','sendStatus','getTimezones','timezones','utcOffset','getTimezone','moment','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','offset','undefined','limit','count','status','set','Content-Range','json','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','concat','$and','$or','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$iLike','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmHopper','include','findAll','rows','show','params','includeAll','find','create','body','catch','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperAdditionalPhone','getPreview','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','transaction','value','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','findOne'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0x4f17,0x9e));var _0x74f1=function(_0x5517c0,_0x358609){_0x5517c0=_0x5517c0-0x0;var _0x33803b=_0x4f17[_0x5517c0];return _0x33803b;};'use strict';var moment=require(_0x74f1('0x0'));var _=require('lodash');var qs=require(_0x74f1('0x1'));var logger=require(_0x74f1('0x2'))('api');var shared=require(_0x74f1('0x3'));var db=require(_0x74f1('0x4'))['db'];function respondWithResult(_0x3f16b2,_0x62251d){_0x62251d=_0x62251d||0xc8;return function(_0x2d1ff2){if(_0x2d1ff2){return _0x3f16b2['status'](_0x62251d)['json'](_0x2d1ff2);}};}function respondWithFilteredResult(_0x3f65bb,_0x4b894a){return function(_0xe54c30){if(_0xe54c30){var _0x51effb=typeof _0x4b894a[_0x74f1('0x5')]===_0x74f1('0x6')&&typeof _0x4b894a[_0x74f1('0x7')]==='undefined';var _0x31b7ec=_0xe54c30['count'];var _0x291858=_0x51effb?0x0:_0x4b894a['offset'];var _0x1b116c=_0x51effb?_0xe54c30[_0x74f1('0x8')]:_0x4b894a['offset']+_0x4b894a['limit'];var _0x28307c;if(_0x1b116c>=_0x31b7ec){_0x1b116c=_0x31b7ec;_0x28307c=0xc8;}else{_0x28307c=0xce;}_0x3f65bb[_0x74f1('0x9')](_0x28307c);return _0x3f65bb[_0x74f1('0xa')](_0x74f1('0xb'),_0x291858+'-'+_0x1b116c+'/'+_0x31b7ec)[_0x74f1('0xc')](_0xe54c30);}return null;};}function saveUpdates(_0x2b91bc,_0x467e15){return function(_0x3a2ce6){if(_0x3a2ce6){return _0x3a2ce6[_0x74f1('0xd')](_0x2b91bc)[_0x74f1('0xe')](function(_0x4f34fd){return _0x4f34fd;});}return null;};}function handleEntityNotFound(_0xf135d0,_0x4e156f){return function(_0x41488b){if(!_0x41488b){_0xf135d0['sendStatus'](0x194);}return _0x41488b;};}function handleError(_0x25f605,_0x17762d){_0x17762d=_0x17762d||0x1f4;return function(_0x373b73){logger[_0x74f1('0xf')](_0x373b73[_0x74f1('0x10')]);if(_0x373b73['name']){delete _0x373b73[_0x74f1('0x11')];}_0x25f605[_0x74f1('0x9')](_0x17762d)['send'](_0x373b73);};}exports[_0x74f1('0x12')]=function(_0x149ad8,_0x520aae){var _0x1cc44b={},_0x29de10={},_0x37dbc7={'count':0x0,'rows':[]};var _0x1e5cf1=_[_0x74f1('0x13')](db['CmHopper'][_0x74f1('0x14')],function(_0x85ab91){return{'name':_0x85ab91[_0x74f1('0x15')],'type':_0x85ab91[_0x74f1('0x16')][_0x74f1('0x17')]};});_0x29de10[_0x74f1('0x18')]=_['map'](_0x1e5cf1,'name');_0x29de10['query']=_[_0x74f1('0x19')](_0x149ad8[_0x74f1('0x1a')]);_0x29de10[_0x74f1('0x1b')]=_[_0x74f1('0x1c')](_0x29de10[_0x74f1('0x18')],_0x29de10[_0x74f1('0x1a')]);_0x29de10[_0x74f1('0x1b')]=_[_0x74f1('0x1d')](_0x29de10[_0x74f1('0x1b')],[_0x74f1('0x1e'),_0x74f1('0x1f'),'$gt','$gte',_0x74f1('0x20'),_0x74f1('0x21'),_0x74f1('0x22'),_0x74f1('0x23'),_0x74f1('0x24'),_0x74f1('0x25'),_0x74f1('0x26'),'$in',_0x74f1('0x27'),_0x74f1('0x28'),'$notLike',_0x74f1('0x29'),'$notILike','$like',_0x74f1('0x2a'),_0x74f1('0x2b'),_0x74f1('0x2c'),_0x74f1('0x2d')]);_0x1cc44b[_0x74f1('0x2e')]=_[_0x74f1('0x1c')](_0x29de10[_0x74f1('0x18')],qs[_0x74f1('0x2f')](_0x149ad8[_0x74f1('0x1a')][_0x74f1('0x2f')]));_0x1cc44b[_0x74f1('0x2e')]=_0x1cc44b[_0x74f1('0x2e')][_0x74f1('0x30')]?_0x1cc44b['attributes']:_0x29de10[_0x74f1('0x18')];if(!_0x149ad8[_0x74f1('0x1a')][_0x74f1('0x31')](_0x74f1('0x32'))){_0x1cc44b['limit']=qs[_0x74f1('0x7')](_0x149ad8['query'][_0x74f1('0x7')]);_0x1cc44b[_0x74f1('0x5')]=qs[_0x74f1('0x5')](_0x149ad8[_0x74f1('0x1a')]['offset']);}_0x1cc44b[_0x74f1('0x33')]=qs['sort'](_0x149ad8[_0x74f1('0x1a')][_0x74f1('0x34')]);_0x1cc44b[_0x74f1('0x35')]=qs[_0x74f1('0x1b')](_[_0x74f1('0x36')](_0x149ad8[_0x74f1('0x1a')],_0x29de10[_0x74f1('0x1b')]),_0x1e5cf1);if(_0x149ad8[_0x74f1('0x1a')][_0x74f1('0x37')]){_0x1cc44b['where']=_[_0x74f1('0x38')](_0x1cc44b[_0x74f1('0x35')],{'$or':_['map'](_0x1e5cf1,function(_0x3a1246){if(_0x3a1246[_0x74f1('0x16')]!==_0x74f1('0x39')){var _0x2eaad6={};_0x2eaad6[_0x3a1246[_0x74f1('0x11')]]={'$like':'%'+_0x149ad8[_0x74f1('0x1a')]['filter']+'%'};return _0x2eaad6;}})});}_0x1cc44b=_[_0x74f1('0x38')]({},_0x1cc44b,_0x149ad8[_0x74f1('0x3a')]);var _0x120939={'where':_0x1cc44b[_0x74f1('0x35')]};return db[_0x74f1('0x3b')][_0x74f1('0x8')](_0x120939)[_0x74f1('0xe')](function(_0x4352cb){_0x37dbc7[_0x74f1('0x8')]=_0x4352cb;if(_0x149ad8[_0x74f1('0x1a')]['includeAll']){_0x1cc44b[_0x74f1('0x3c')]=[{'all':!![]}];}return db['CmHopper'][_0x74f1('0x3d')](_0x1cc44b);})[_0x74f1('0xe')](function(_0x51ed35){_0x37dbc7[_0x74f1('0x3e')]=_0x51ed35;return _0x37dbc7;})[_0x74f1('0xe')](respondWithFilteredResult(_0x520aae,_0x1cc44b))['catch'](handleError(_0x520aae,null));};exports[_0x74f1('0x3f')]=function(_0x64706e,_0x5c4939){var _0x3693cc={'raw':!![],'where':{'id':_0x64706e[_0x74f1('0x40')]['id']}},_0x312371={};_0x312371[_0x74f1('0x18')]=_[_0x74f1('0x19')](db[_0x74f1('0x3b')]['rawAttributes']);_0x312371['query']=_[_0x74f1('0x19')](_0x64706e[_0x74f1('0x1a')]);_0x312371[_0x74f1('0x1b')]=_[_0x74f1('0x1c')](_0x312371[_0x74f1('0x18')],_0x312371[_0x74f1('0x1a')]);_0x3693cc[_0x74f1('0x2e')]=_[_0x74f1('0x1c')](_0x312371[_0x74f1('0x18')],qs[_0x74f1('0x2f')](_0x64706e['query']['fields']));_0x3693cc[_0x74f1('0x2e')]=_0x3693cc['attributes'][_0x74f1('0x30')]?_0x3693cc[_0x74f1('0x2e')]:_0x312371[_0x74f1('0x18')];if(_0x64706e['query'][_0x74f1('0x41')]){_0x3693cc[_0x74f1('0x3c')]=[{'all':!![]}];}_0x3693cc=_[_0x74f1('0x38')]({},_0x3693cc,_0x64706e[_0x74f1('0x3a')]);return db[_0x74f1('0x3b')][_0x74f1('0x42')](_0x3693cc)[_0x74f1('0xe')](handleEntityNotFound(_0x5c4939,null))[_0x74f1('0xe')](respondWithResult(_0x5c4939,null))['catch'](handleError(_0x5c4939,null));};exports['create']=function(_0x2194c9,_0x5dcd33){return db[_0x74f1('0x3b')][_0x74f1('0x43')](_0x2194c9[_0x74f1('0x44')],{})[_0x74f1('0xe')](respondWithResult(_0x5dcd33,0xc9))[_0x74f1('0x45')](handleError(_0x5dcd33,null));};exports[_0x74f1('0xd')]=function(_0x2aca84,_0x5e41f5){if(_0x2aca84[_0x74f1('0x44')]['id']){delete _0x2aca84[_0x74f1('0x44')]['id'];}return db[_0x74f1('0x3b')][_0x74f1('0x42')]({'where':{'id':_0x2aca84[_0x74f1('0x40')]['id']}})['then'](handleEntityNotFound(_0x5e41f5,null))[_0x74f1('0xe')](saveUpdates(_0x2aca84[_0x74f1('0x44')],null))[_0x74f1('0xe')](respondWithResult(_0x5e41f5,null))[_0x74f1('0x45')](handleError(_0x5e41f5,null));};exports[_0x74f1('0x46')]=function(_0x2f362c,_0x400090){return db[_0x74f1('0x3b')][_0x74f1('0x46')]()['then'](respondWithResult(_0x400090,null))[_0x74f1('0x45')](handleError(_0x400090,null));};exports[_0x74f1('0x47')]=function(_0x26199c,_0x4b0a12){var _0x579dd0;var _0x2d8949=_0x26199c[_0x74f1('0x40')]['id'];return db[_0x74f1('0x3b')][_0x74f1('0x42')]({'where':{'id':_0x26199c[_0x74f1('0x40')]['id']}})[_0x74f1('0xe')](handleEntityNotFound(_0x4b0a12,null))[_0x74f1('0xe')](function(_0x228f73){if(_0x228f73){return _0x228f73['destroy']()[_0x74f1('0xe')](function(_0x2c8906){return _0x2c8906;});}})[_0x74f1('0xe')](function(_0x23bf0d){_0x579dd0=_0x23bf0d;if(_0x23bf0d){if(_0x23bf0d[_0x74f1('0x48')]||_0x23bf0d[_0x74f1('0x49')]){return db[_0x23bf0d['VoiceQueueId']?_0x74f1('0x4a'):_0x74f1('0x4b')]['find']({'where':{'id':_0x23bf0d[_0x74f1('0x48')]?_0x23bf0d[_0x74f1('0x48')]:_0x23bf0d[_0x74f1('0x49')]},'attributes':['id',_0x74f1('0x11')],'raw':!![]});}}})[_0x74f1('0xe')](function(_0x400e81){var _0x137ff9={};if(_0x400e81){_[_0x74f1('0x38')](_0x137ff9,_[_0x74f1('0x4c')](_0x579dd0[_0x74f1('0x4d')],[_0x74f1('0x4e'),_0x74f1('0x4f'),'id']));_0x137ff9[_0x74f1('0x50')]=0x15;_0x137ff9[_0x74f1('0x51')]=_0x74f1('0x52');_0x137ff9[_0x74f1('0x53')]=_0x400e81[_0x74f1('0x11')];_0x137ff9[_0x74f1('0x54')]=_0x26199c[_0x74f1('0x55')][_0x74f1('0x11')];_0x137ff9[_0x74f1('0x56')]=_0x26199c[_0x74f1('0x55')]['id'];_0x137ff9[_0x74f1('0x52')]=!![];_0x137ff9[_0x74f1('0x57')]=moment()[_0x74f1('0x58')](_0x74f1('0x59'));_0x137ff9[_0x74f1('0x5a')]=_0x579dd0[_0x74f1('0x5b')];_0x137ff9['campaigntype']=_0x579dd0[_0x74f1('0x48')]?_0x74f1('0x5c'):_0x74f1('0x5d');return db[_0x74f1('0x5e')][_0x74f1('0x42')]({'where':{'id':_0x137ff9[_0x74f1('0x5f')]},'attributes':['firstName',_0x74f1('0x60')]})[_0x74f1('0xe')](function(_0x36f62d){if(!_[_0x74f1('0x61')](_0x4b0a12)&&!_[_0x74f1('0x61')](_0x36f62d[_0x74f1('0x62')])){_0x137ff9[_0x74f1('0x63')]=_0x36f62d['firstName'];if(!_[_0x74f1('0x61')](_0x36f62d[_0x74f1('0x60')])){_0x137ff9['calleridname']+='\x20'+_0x36f62d[_0x74f1('0x60')];}}})[_0x74f1('0x64')](function(){return db['CmHopperFinal'][_0x74f1('0x43')](_0x137ff9);});}})[_0x74f1('0xe')](function(_0x4f2f8d){return db[_0x74f1('0x65')][_0x74f1('0x47')]({'where':{'CmHopperId':_0x2d8949}});})['then'](function(){return _0x4b0a12[_0x74f1('0x9')](0xcc)['end']();})[_0x74f1('0x45')](handleError(_0x4b0a12,null));};exports[_0x74f1('0x66')]=function(_0x29e381,_0x45b4de){var _0x441d5f=[];return db[_0x74f1('0x5e')][_0x74f1('0x46')]()[_0x74f1('0xe')](function(_0xb74a0b){_0x441d5f=_[_0x74f1('0x19')](_0xb74a0b);return _0x29e381[_0x74f1('0x55')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x74f1('0x67')},'attributes':['id',_0x74f1('0x68'),_0x74f1('0x69')],'raw':!![]});})[_0x74f1('0xe')](function(_0x2320aa){if(_0x2320aa&&_0x2320aa['length']){return db[_0x74f1('0x6a')][_0x74f1('0x6b')](function(_0x4f32e2){var _0x2044a7={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x74f1('0x58')](_0x74f1('0x59'))},'VoiceQueueId':{'$in':_[_0x74f1('0x13')](_0x2320aa,'id')},'$or':[{'UserId':null},{'UserId':_0x29e381[_0x74f1('0x55')]['id']}]};var _0xebed2c={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2320aa)[_0x74f1('0x37')](['dialPreviewAutoRecallMe',0x0])['map']('id')[_0x74f1('0x6c')]()},'$or':[{'UserId':null},{'UserId':_0x29e381['user']['id']}]};var _0x3b1fdd={'$or':[_0x2044a7,_0xebed2c]};var _0x3331e2=[];if(_0x29e381[_0x74f1('0x44')]['direction']&&_0x29e381[_0x74f1('0x44')]['direction']==='prev'){if(!_[_0x74f1('0x6d')](_0x29e381['body'][_0x74f1('0x6e')])){_0x3b1fdd['id']={'$in':_0x29e381[_0x74f1('0x44')][_0x74f1('0x6e')]};}_0x3331e2=[[_0x74f1('0x6f'),_0x74f1('0x70')],[_0x74f1('0x71'),_0x2320aa[0x0][_0x74f1('0x68')]===_0x74f1('0x70')?_0x74f1('0x72'):_0x74f1('0x70')],db[_0x74f1('0x6a')][_0x74f1('0x73')](_0x74f1('0x74')),['id',_0x74f1('0x72')]];}else{if(!_[_0x74f1('0x6d')](_0x29e381['body'][_0x74f1('0x6e')])){_0x3b1fdd['id']={'$notIn':_0x29e381[_0x74f1('0x44')][_0x74f1('0x6e')]};}_0x3331e2=[['priority',_0x74f1('0x72')],['scheduledAt',_0x2320aa[0x0][_0x74f1('0x68')]],db[_0x74f1('0x6a')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x74f1('0x70')]];}return db['CmHopper'][_0x74f1('0x75')]({'attributes':['id',_0x74f1('0x76'),_0x74f1('0x5b'),'recallme'],'where':_0x3b1fdd,'order':_0x3331e2,'transaction':_0x4f32e2,'lock':_0x4f32e2[_0x74f1('0x77')][_0x74f1('0x78')],'include':[{'model':db['CmContact'],'as':_0x74f1('0x79'),'attributes':_0x441d5f,'include':[{'model':db[_0x74f1('0x7a')],'as':_0x74f1('0x7b'),'attributes':['id',_0x74f1('0x11')]}]},{'model':db['CmList'],'as':_0x74f1('0x7c'),'attributes':['id',_0x74f1('0x11')]},{'model':db[_0x74f1('0x4a')],'as':_0x74f1('0x7d'),'attributes':['id',_0x74f1('0x11'),_0x74f1('0x7e')]}]})['then'](function(_0x34a203){if(_0x34a203){return _0x34a203[_0x74f1('0xd')]({'UserId':_0x29e381[_0x74f1('0x55')]['id']},{'transaction':_0x4f32e2});}});});}})['then'](handleEntityNotFound(_0x45b4de,null))[_0x74f1('0xe')](respondWithResult(_0x45b4de,null))[_0x74f1('0x45')](handleError(_0x45b4de,null));};exports[_0x74f1('0x7f')]=function(_0x26199b,_0x44b9fa,_0x15f1bd){var _0x507c75=[];var _0x789773=_0x26199b['params']['id'];var _0x3f565f=_0x26199b['user']['id'];return db['CmContact'][_0x74f1('0x46')]()[_0x74f1('0xe')](function(_0x21f0f7){_0x507c75=_[_0x74f1('0x19')](_0x21f0f7);return db[_0x74f1('0x6a')][_0x74f1('0x6b')](function(_0x430c28){const _0x2a343e={'id':_0x789773};return db[_0x74f1('0x3b')][_0x74f1('0x75')]({'attributes':['id',_0x74f1('0x76'),'recallme'],'where':_0x2a343e,'transaction':_0x430c28,'lock':_0x430c28[_0x74f1('0x77')][_0x74f1('0x78')],'include':[{'model':db[_0x74f1('0x5e')],'as':_0x74f1('0x79'),'attributes':_0x507c75,'include':[{'model':db[_0x74f1('0x7a')],'as':_0x74f1('0x7b'),'attributes':['id',_0x74f1('0x11')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x74f1('0x11')]},{'model':db[_0x74f1('0x4a')],'as':'Queue','attributes':['id','name',_0x74f1('0x7e')]}]})['then'](function(_0xabdf94){if(_0xabdf94){return _0xabdf94[_0x74f1('0xd')]({'UserId':_0x3f565f},{'transaction':_0x430c28});}});});})[_0x74f1('0xe')](handleEntityNotFound(_0x44b9fa,null))[_0x74f1('0xe')](respondWithResult(_0x44b9fa,null))[_0x74f1('0x45')](handleError(_0x44b9fa,null));};exports['getOpenContacts']=function(_0x5345f5,_0x49e809){return _0x5345f5[_0x74f1('0x55')][_0x74f1('0x80')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x74f1('0x67')},'attributes':['id'],'raw':!![]})[_0x74f1('0xe')](function(_0x28b9bf){if(_0x28b9bf&&_0x28b9bf['length']){return db[_0x74f1('0x3b')][_0x74f1('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x74f1('0x58')](_0x74f1('0x59'))},'VoiceQueueId':{'$in':_[_0x74f1('0x13')](_0x28b9bf,'id')},'$or':[{'UserId':null},{'UserId':_0x5345f5[_0x74f1('0x55')]['id']}]}});}return 0x0;})[_0x74f1('0xe')](function(_0x13ba42){if(!_['isNil'](_0x13ba42)&&_[_0x74f1('0x81')](_0x13ba42)){return _0x49e809[_0x74f1('0x9')](0xc8)[_0x74f1('0xc')]({'contacts':_0x13ba42});}else{logger[_0x74f1('0xf')](_0x74f1('0x82'),_0x74f1('0x83'),0x194,_0x74f1('0x84'));_0x49e809[_0x74f1('0x85')](0x194);}})[_0x74f1('0x45')](handleError(_0x49e809,null));};exports[_0x74f1('0x86')]=function(_0x1f1563,_0x5629d7){var _0x29024d=shared[_0x74f1('0x87')];var _0x28ff0b=[];_[_0x74f1('0x13')](_0x29024d,function(_0x5be66c){_0x28ff0b['push']({'id':_0x5be66c['name'],'name':_0x5be66c[_0x74f1('0x11')],'utcOffset':_0x5be66c[_0x74f1('0x88')]});});return _0x5629d7[_0x74f1('0x9')](0xc8)[_0x74f1('0xc')]({'tz':_0x28ff0b});};exports[_0x74f1('0x89')]=function(_0x2bf4fa,_0x330a7e){var _0xeb4a70=shared['timezones'];var _0x4ce487={};if(!_[_0x74f1('0x61')](_0xeb4a70[_0x2bf4fa[_0x74f1('0x44')]['id']]))_0x4ce487=_0xeb4a70[_0x2bf4fa['body']['id']];return _0x330a7e[_0x74f1('0x9')](0xc8)[_0x74f1('0xc')](_0x4ce487);};
\ No newline at end of file
index a2c08b3..a12ebce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2542=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x103a8b,_0x46a303){var _0x266992=function(_0x1a313a){while(--_0x1a313a){_0x103a8b['push'](_0x103a8b['shift']());}};_0x266992(++_0x46a303);}(_0x2542,0x169));var _0x2254=function(_0x1cb0f8,_0x1d037c){_0x1cb0f8=_0x1cb0f8-0x0;var _0x3dff3a=_0x2542[_0x1cb0f8];return _0x3dff3a;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2254('0x5'));var rimraf=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var attributes=require(_0x2254('0x8'));module[_0x2254('0x9')]=function(_0x508183,_0x19ad3c){return _0x508183[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[{'name':_0x2254('0xd'),'fields':[_0x2254('0xd')]},{'name':_0x2254('0xe'),'fields':[_0x2254('0xe')]},{'name':_0x2254('0xf'),'fields':[_0x2254('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','priority','lodash'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x326f,0xd1));var _0xf326=function(_0x1a2c7a,_0x46996b){_0x1a2c7a=_0x1a2c7a-0x0;var _0x2906b0=_0x326f[_0x1a2c7a];return _0x2906b0;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['scheduledat']},{'name':'phone','fields':['phone']},{'name':_0xf326('0xe'),'fields':[_0xf326('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 2e92784..bdc7182 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb875=['User','Agent','name','voicePause','length','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','LOCK','GetCmHopperPreview','keys','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','lodash','../../mysqldb','rpc','jayson/promise','http','request','then','info','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','CmHopper,\x20%s,\x20%s','message','result','GetCmHopper','CmHopper','findAll','options','where','attributes','include','model','map','debug','catch','ShowCmHopper','find','CreateCmHopper','body','raw','UpdateCmHopper','update','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','transaction','order','UPDATE','CmContact','Contact'];(function(_0x58594a,_0x5f262c){var _0x2433bc=function(_0x56f532){while(--_0x56f532){_0x58594a['push'](_0x58594a['shift']());}};_0x2433bc(++_0x5f262c);}(_0xb875,0x167));var _0x5b87=function(_0x45c712,_0x2e68b2){_0x45c712=_0x45c712-0x0;var _0xb612e0=_0xb875[_0x45c712];return _0xb612e0;};'use strict';var _=require(_0x5b87('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var db=require(_0x5b87('0x1'))['db'];var logger=require('../../config/logger')(_0x5b87('0x2'));var jayson=require(_0x5b87('0x3'));var client=jayson['client'][_0x5b87('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x315670,_0xb525e1,_0x32ed83){return new BPromise(function(_0x253d91,_0x5b27af){return client[_0x5b87('0x5')](_0x315670,_0x32ed83)[_0x5b87('0x6')](function(_0x1fb944){logger[_0x5b87('0x7')]('CmHopper,\x20%s,\x20%s',_0xb525e1,_0x5b87('0x8'));logger['debug'](_0x5b87('0x9'),_0xb525e1,_0x5b87('0x8'),JSON[_0x5b87('0xa')](_0x1fb944));if(_0x1fb944[_0x5b87('0xb')]){if(_0x1fb944['error']['code']===0x1f4){logger[_0x5b87('0xb')](_0x5b87('0xc'),_0xb525e1,_0x1fb944['error'][_0x5b87('0xd')]);return _0x5b27af(_0x1fb944[_0x5b87('0xb')][_0x5b87('0xd')]);}logger[_0x5b87('0xb')](_0x5b87('0xc'),_0xb525e1,_0x1fb944[_0x5b87('0xb')][_0x5b87('0xd')]);return _0x253d91(_0x1fb944[_0x5b87('0xb')][_0x5b87('0xd')]);}else{logger['info'](_0x5b87('0xc'),_0xb525e1,'request\x20sent');_0x253d91(_0x1fb944[_0x5b87('0xe')][_0x5b87('0xd')]);}})['catch'](function(_0x59bf2b){logger[_0x5b87('0xb')]('CmHopper,\x20%s,\x20%s',_0xb525e1,_0x59bf2b);_0x5b27af(_0x59bf2b);});});}exports[_0x5b87('0xf')]=function(_0x175452){var _0x126371=this;return new Promise(function(_0x13cb13,_0x29d580){return db[_0x5b87('0x10')][_0x5b87('0x11')]({'raw':_0x175452['options']?_0x175452['options']['raw']===undefined?!![]:![]:!![],'where':_0x175452['options']?_0x175452[_0x5b87('0x12')][_0x5b87('0x13')]||null:null,'attributes':_0x175452[_0x5b87('0x12')]?_0x175452[_0x5b87('0x12')][_0x5b87('0x14')]||null:null,'limit':_0x175452['options']?_0x175452[_0x5b87('0x12')]['limit']||null:null,'include':_0x175452['options']?_0x175452[_0x5b87('0x12')][_0x5b87('0x15')]?_['map'](_0x175452[_0x5b87('0x12')][_0x5b87('0x15')],function(_0x21033f){return{'model':db[_0x21033f[_0x5b87('0x16')]],'as':_0x21033f['as'],'attributes':_0x21033f[_0x5b87('0x14')],'include':_0x21033f[_0x5b87('0x15')]?_[_0x5b87('0x17')](_0x21033f[_0x5b87('0x15')],function(_0x1dcaf4){return{'model':db[_0x1dcaf4[_0x5b87('0x16')]],'as':_0x1dcaf4['as'],'attributes':_0x1dcaf4['attributes'],'include':_0x1dcaf4[_0x5b87('0x15')]?_[_0x5b87('0x17')](_0x1dcaf4[_0x5b87('0x15')],function(_0x19d2d4){return{'model':db[_0x19d2d4[_0x5b87('0x16')]],'as':_0x19d2d4['as'],'attributes':_0x19d2d4[_0x5b87('0x14')]};}):[]};}):[]};}):[]:[]})[_0x5b87('0x6')](function(_0x27b4e1){logger[_0x5b87('0x7')](_0x5b87('0xf'),_0x175452);logger[_0x5b87('0x18')]('GetCmHopper',_0x175452,JSON['stringify'](_0x27b4e1));_0x13cb13(_0x27b4e1);})[_0x5b87('0x19')](function(_0x4b97b7){logger[_0x5b87('0xb')](_0x5b87('0xf'),_0x4b97b7['message'],_0x175452);_0x29d580(_0x126371['error'](0x1f4,_0x4b97b7[_0x5b87('0xd')]));});});};exports[_0x5b87('0x1a')]=function(_0x1e640d){var _0x2a2143=this;return new Promise(function(_0xa87aad,_0x583449){return db[_0x5b87('0x10')][_0x5b87('0x1b')]({'raw':_0x1e640d['options']?_0x1e640d[_0x5b87('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x1e640d[_0x5b87('0x12')]?_0x1e640d[_0x5b87('0x12')][_0x5b87('0x13')]||null:null,'attributes':_0x1e640d['options']?_0x1e640d[_0x5b87('0x12')][_0x5b87('0x14')]||null:null,'include':_0x1e640d[_0x5b87('0x12')]?_0x1e640d[_0x5b87('0x12')]['include']?_['map'](_0x1e640d['options'][_0x5b87('0x15')],function(_0x4caa9b){return{'model':db[_0x4caa9b[_0x5b87('0x16')]],'as':_0x4caa9b['as'],'attributes':_0x4caa9b['attributes'],'include':_0x4caa9b[_0x5b87('0x15')]?_[_0x5b87('0x17')](_0x4caa9b['include'],function(_0x2b9a2a){return{'model':db[_0x2b9a2a[_0x5b87('0x16')]],'as':_0x2b9a2a['as'],'attributes':_0x2b9a2a[_0x5b87('0x14')],'include':_0x2b9a2a[_0x5b87('0x15')]?_['map'](_0x2b9a2a[_0x5b87('0x15')],function(_0xfb83bf){return{'model':db[_0xfb83bf[_0x5b87('0x16')]],'as':_0xfb83bf['as'],'attributes':_0xfb83bf[_0x5b87('0x14')]};}):[]};}):[]};}):[]:[]})[_0x5b87('0x6')](function(_0x219316){logger[_0x5b87('0x7')](_0x5b87('0x1a'),_0x1e640d);logger[_0x5b87('0x18')](_0x5b87('0x1a'),_0x1e640d,JSON[_0x5b87('0xa')](_0x219316));_0xa87aad(_0x219316);})['catch'](function(_0x27c728){logger['error'](_0x5b87('0x1a'),_0x27c728[_0x5b87('0xd')],_0x1e640d);_0x583449(_0x2a2143[_0x5b87('0xb')](0x1f4,_0x27c728[_0x5b87('0xd')]));});});};exports[_0x5b87('0x1c')]=function(_0x3c7575){var _0x17b264=this;return new Promise(function(_0x213a9c,_0x31d108){return db[_0x5b87('0x10')]['create'](_0x3c7575[_0x5b87('0x1d')],{'raw':_0x3c7575[_0x5b87('0x12')]?_0x3c7575['options'][_0x5b87('0x1e')]===undefined?!![]:![]:!![]})[_0x5b87('0x6')](function(_0x416311){logger[_0x5b87('0x7')](_0x5b87('0x1c'),_0x3c7575);logger['debug'](_0x5b87('0x1c'),_0x3c7575,JSON[_0x5b87('0xa')](_0x416311));_0x213a9c(_0x416311);})[_0x5b87('0x19')](function(_0x5ce30e){logger[_0x5b87('0xb')](_0x5b87('0x1c'),_0x5ce30e['message'],_0x3c7575);_0x31d108(_0x17b264[_0x5b87('0xb')](0x1f4,_0x5ce30e[_0x5b87('0xd')]));});});};exports[_0x5b87('0x1f')]=function(_0x17dd76){var _0x5cbaba=this;return new Promise(function(_0x28ed0f,_0x43d421){return db[_0x5b87('0x10')][_0x5b87('0x20')](_0x17dd76[_0x5b87('0x1d')],{'raw':_0x17dd76['options']?_0x17dd76[_0x5b87('0x12')][_0x5b87('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17dd76[_0x5b87('0x12')]?_0x17dd76[_0x5b87('0x12')][_0x5b87('0x13')]||null:null,'attributes':_0x17dd76[_0x5b87('0x12')]?_0x17dd76['options'][_0x5b87('0x14')]||null:null,'limit':_0x17dd76[_0x5b87('0x12')]?_0x17dd76['options'][_0x5b87('0x21')]||null:null})[_0x5b87('0x6')](function(_0x116fc0){logger['info'](_0x5b87('0x1f'),_0x17dd76);logger[_0x5b87('0x7')](_0x5b87('0x22'),JSON[_0x5b87('0xa')](_0x17dd76[_0x5b87('0x12')]['where']),_0x17dd76[_0x5b87('0x1d')][_0x5b87('0x23')]);logger[_0x5b87('0x18')](_0x5b87('0x1f'),_0x17dd76,JSON[_0x5b87('0xa')](_0x116fc0));_0x28ed0f(_0x116fc0);})['catch'](function(_0x3a43e7){logger[_0x5b87('0xb')](_0x5b87('0x1f'),_0x3a43e7[_0x5b87('0xd')],_0x17dd76);_0x43d421(_0x5cbaba['error'](0x1f4,_0x3a43e7[_0x5b87('0xd')]));});});};exports[_0x5b87('0x24')]=function(_0x2d63ac){var _0x4bf627=this;return new Promise(function(_0x47e00d,_0x408ca7){return db[_0x5b87('0x10')][_0x5b87('0x25')]({'where':_0x2d63ac['options']?_0x2d63ac[_0x5b87('0x12')][_0x5b87('0x13')]||null:null})[_0x5b87('0x6')](function(_0x1ed2c3){logger[_0x5b87('0x7')](_0x5b87('0x24'),_0x2d63ac);logger[_0x5b87('0x18')](_0x5b87('0x24'),_0x2d63ac,JSON[_0x5b87('0xa')](_0x1ed2c3));_0x47e00d(_0x1ed2c3);})[_0x5b87('0x19')](function(_0x152a04){logger[_0x5b87('0xb')]('DestroyCmHopper',_0x152a04['message'],_0x2d63ac);_0x408ca7(_0x4bf627['error'](0x1f4,_0x152a04[_0x5b87('0xd')]));});});};exports[_0x5b87('0x26')]=function(_0x4e9601){var _0x5a699d=this;return new Promise(function(_0x407988,_0xc8f5e5){return db['CmContact'][_0x5b87('0x27')]()[_0x5b87('0x6')](function(_0xf35b47){return db[_0x5b87('0x28')][_0x5b87('0x29')](function(_0x3a771a){return db['CmHopper']['findAll']({'where':_0x4e9601[_0x5b87('0x12')]?_0x4e9601['options'][_0x5b87('0x13')]||null:null,'attributes':_0x4e9601[_0x5b87('0x12')]?_0x4e9601[_0x5b87('0x12')][_0x5b87('0x14')]||null:null,'limit':_0x4e9601[_0x5b87('0x12')]?_0x4e9601[_0x5b87('0x12')][_0x5b87('0x21')]||null:null,'order':_0x4e9601['options']?_0x4e9601[_0x5b87('0x12')][_0x5b87('0x2a')]||null:null,'transaction':_0x3a771a,'lock':_0x3a771a['LOCK'][_0x5b87('0x2b')],'include':[{'model':db[_0x5b87('0x2c')],'as':_0x5b87('0x2d'),'attributes':_['keys'](_0xf35b47)},{'model':db[_0x5b87('0x2e')],'as':_0x5b87('0x2f'),'attributes':['id',_0x5b87('0x30'),_0x5b87('0x31')]}]})[_0x5b87('0x6')](function(_0x238989){var _0x5cfe6e=[];var _0x1f2a59=[];for(var _0x5d8e75=0x0;_0x5d8e75<_0x238989[_0x5b87('0x32')];_0x5d8e75+=0x1){var _0x17b178=_0x238989[_0x5d8e75]['UserId'];if(_0x17b178===null){_0x5cfe6e[_0x5b87('0x33')](_0x238989[_0x5d8e75][_0x5b87('0x20')](_0x4e9601[_0x5b87('0x1d')],{'transaction':_0x3a771a}));}else if(!_0x1f2a59['includes'](_0x17b178)){_0x1f2a59[_0x5b87('0x33')](_0x17b178);_0x5cfe6e['push'](_0x238989[_0x5d8e75][_0x5b87('0x20')](_0x4e9601[_0x5b87('0x1d')],{'transaction':_0x3a771a}));}}return BPromise[_0x5b87('0x34')](_0x5cfe6e);});})[_0x5b87('0x6')](function(_0x2087de){logger['info'](_0x5b87('0x26'),_0x4e9601);if(_0x2087de[_0x5b87('0x32')]>0x0){logger[_0x5b87('0x7')](_0x5b87('0x35'),_0x2087de[0x0]['dataValues']['id'],_0x2087de[0x0][_0x5b87('0x36')][_0x5b87('0x37')],_0x2087de[0x0][_0x5b87('0x36')][_0x5b87('0x23')]);}logger[_0x5b87('0x18')](_0x5b87('0x26'),_0x4e9601,JSON[_0x5b87('0xa')](_0x2087de));_0x407988(_0x2087de);})[_0x5b87('0x19')](function(_0x34c661){logger[_0x5b87('0xb')]('GetContactDialer',_0x34c661[_0x5b87('0xd')],_0x4e9601);_0xc8f5e5(_0x5a699d['error'](0x1f4,_0x34c661['message']));});});});};exports[_0x5b87('0x38')]=function(_0x3603e9){var _0x58c4b5=this;return new Promise(function(_0x455607,_0x46a56f){return db[_0x5b87('0x28')][_0x5b87('0x29')](function(_0x4e5626){return db[_0x5b87('0x39')][_0x5b87('0x3a')](_0x3603e9[_0x5b87('0x1d')],{'raw':_0x3603e9[_0x5b87('0x12')]?_0x3603e9[_0x5b87('0x12')][_0x5b87('0x1e')]===undefined?!![]:![]:!![],'transaction':_0x4e5626})[_0x5b87('0x6')](function(){logger['info'](_0x5b87('0x3b'),JSON[_0x5b87('0xa')](_0x3603e9[_0x5b87('0x12')][_0x5b87('0x13')]),_0x3603e9[_0x5b87('0x12')][_0x5b87('0x13')][_0x5b87('0x23')]);return db['CmHopper']['destroy']({'where':_0x3603e9[_0x5b87('0x12')]?_0x3603e9['options'][_0x5b87('0x13')]||null:null,'transaction':_0x4e5626});});})[_0x5b87('0x6')](function(_0x4a310e){logger[_0x5b87('0x7')](_0x5b87('0x38'),_0x3603e9);logger[_0x5b87('0x18')](_0x5b87('0x38'),_0x3603e9,JSON[_0x5b87('0xa')](_0x4a310e));_0x455607(_0x4a310e);})[_0x5b87('0x19')](function(_0x2f1168){logger[_0x5b87('0xb')](_0x5b87('0x38'),_0x2f1168[_0x5b87('0xd')],_0x3603e9);_0x46a56f(_0x58c4b5[_0x5b87('0xb')](0x1f4,_0x2f1168[_0x5b87('0xd')]));});});};exports[_0x5b87('0x3c')]=function(_0x1962c5){var _0xbe9e25=this;return new Promise(function(_0x529c2f,_0x2734bc){return db[_0x5b87('0x10')]['findAll']({'raw':_0x1962c5['options']?_0x1962c5[_0x5b87('0x12')][_0x5b87('0x1e')]===undefined?!![]:![]:!![],'where':_0x1962c5['options']?_0x1962c5[_0x5b87('0x12')][_0x5b87('0x13')]||null:null,'attributes':[[db[_0x5b87('0x28')]['fn'](_0x5b87('0x3d'),db[_0x5b87('0x28')]['fn']('IF',db[_0x5b87('0x28')][_0x5b87('0x3e')]('`scheduledat`\x20>=\x20'+util[_0x5b87('0x3f')]('\x22%s\x22',moment()[_0x5b87('0x3f')](_0x5b87('0x40')))+_0x5b87('0x41')))),_0x5b87('0x42')]]})[_0x5b87('0x6')](function(_0x5d38a8){logger[_0x5b87('0x7')]('CountReScheduled',_0x1962c5);logger['debug'](_0x5b87('0x3c'),_0x1962c5,JSON[_0x5b87('0xa')](_0x5d38a8));_0x529c2f(_0x5d38a8);})[_0x5b87('0x19')](function(_0x1c9616){logger['error'](_0x5b87('0x3c'),_0x1c9616[_0x5b87('0xd')],_0x1962c5);_0x2734bc(_0xbe9e25['error'](0x1f4,_0x1c9616['message']));});});};exports[_0x5b87('0x43')]=function(_0x2a0370){var _0x257306=this;return new Promise(function(_0x123b1e,_0x49b6dc){return db[_0x5b87('0x2c')]['describe']()[_0x5b87('0x6')](function(_0x3baf41){return db[_0x5b87('0x28')][_0x5b87('0x29')](function(_0x31cf78){return db['CmHopper']['findAll']({'where':_0x2a0370[_0x5b87('0x12')]?_0x2a0370[_0x5b87('0x12')][_0x5b87('0x13')]||null:null,'attributes':_0x2a0370['options']?_0x2a0370['options']['attributes']||null:null,'limit':0x1,'order':_0x2a0370['options']?_0x2a0370[_0x5b87('0x12')][_0x5b87('0x2a')]||null:null,'group':db[_0x5b87('0x10')]['UserId'],'transaction':_0x31cf78,'lock':_0x31cf78[_0x5b87('0x44')]['UPDATE'],'include':_0x2a0370[_0x5b87('0x12')]?_0x2a0370['options'][_0x5b87('0x15')]?_['map'](_0x2a0370[_0x5b87('0x12')][_0x5b87('0x15')],function(_0x426690){return{'model':db[_0x426690[_0x5b87('0x16')]],'as':_0x426690['as'],'attributes':_0x426690[_0x5b87('0x14')],'include':_0x426690[_0x5b87('0x15')]?_[_0x5b87('0x17')](_0x426690[_0x5b87('0x15')],function(_0x3b29d5){return{'model':db[_0x3b29d5['model']],'as':_0x3b29d5['as'],'attributes':_0x3b29d5[_0x5b87('0x14')],'include':_0x3b29d5[_0x5b87('0x15')]?_[_0x5b87('0x17')](_0x3b29d5[_0x5b87('0x15')],function(_0x28f2d4){return{'model':db[_0x28f2d4[_0x5b87('0x16')]],'as':_0x28f2d4['as'],'attributes':_0x28f2d4['attributes']};}):[]};}):[]};}):[]:[]})[_0x5b87('0x6')](function(_0x369d83){var _0x1b49ba=[];for(var _0x38f12a=0x0;_0x38f12a<_0x369d83[_0x5b87('0x32')];_0x38f12a+=0x1){_0x1b49ba[_0x5b87('0x33')](_0x369d83[_0x38f12a][_0x5b87('0x20')](_0x2a0370['body'],{'transaction':_0x31cf78}));}return BPromise[_0x5b87('0x34')](_0x1b49ba);});})[_0x5b87('0x6')](function(_0x186b05){logger[_0x5b87('0x7')](_0x5b87('0x43'),_0x2a0370);logger[_0x5b87('0x18')]('GetContactRecallMe',_0x2a0370,JSON['stringify'](_0x186b05));_0x123b1e(_0x186b05);})['catch'](function(_0x4c9231){logger[_0x5b87('0xb')](_0x5b87('0x43'),_0x4c9231['message'],_0x2a0370);_0x49b6dc(_0x257306[_0x5b87('0xb')](0x1f4,_0x4c9231['message']));});});});};exports[_0x5b87('0x45')]=function(_0x2d55c1){var _0x4e850b=this;return new Promise(function(_0x5873c3,_0x3bd642){db[_0x5b87('0x2c')][_0x5b87('0x27')]()['then'](function(_0x2c4a4b){return db[_0x5b87('0x10')][_0x5b87('0x11')]({'raw':_0x2d55c1[_0x5b87('0x12')]?_0x2d55c1[_0x5b87('0x12')][_0x5b87('0x1e')]===undefined?!![]:![]:!![],'where':_0x2d55c1[_0x5b87('0x12')]?_0x2d55c1['options'][_0x5b87('0x13')]||null:null,'attributes':_0x2d55c1[_0x5b87('0x12')]?_0x2d55c1['options'][_0x5b87('0x14')]||null:null,'limit':_0x2d55c1[_0x5b87('0x12')]?_0x2d55c1['options']['limit']||null:null,'include':_0x2d55c1['options']?_0x2d55c1[_0x5b87('0x12')][_0x5b87('0x15')]?_[_0x5b87('0x17')](_0x2d55c1['options'][_0x5b87('0x15')],function(_0xf14b29){return{'model':db[_0xf14b29[_0x5b87('0x16')]],'as':_0xf14b29['as'],'attributes':_0xf14b29['as']==='Contact'?_[_0x5b87('0x46')](_0x2c4a4b):_0xf14b29['attributes'],'include':_0xf14b29[_0x5b87('0x15')]?_['map'](_0xf14b29[_0x5b87('0x15')],function(_0x3db380){return{'model':db[_0x3db380['model']],'as':_0x3db380['as'],'attributes':_0x3db380[_0x5b87('0x14')],'include':_0x3db380[_0x5b87('0x15')]?_[_0x5b87('0x17')](_0x3db380[_0x5b87('0x15')],function(_0x414faf){return{'model':db[_0x414faf[_0x5b87('0x16')]],'as':_0x414faf['as'],'attributes':_0x414faf[_0x5b87('0x14')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xaf289e){logger[_0x5b87('0x7')](_0x5b87('0xf'),_0x2d55c1);logger['debug'](_0x5b87('0xf'),_0x2d55c1,JSON[_0x5b87('0xa')](_0xaf289e));_0x5873c3(_0xaf289e);})[_0x5b87('0x19')](function(_0x16b996){logger[_0x5b87('0xb')](_0x5b87('0xf'),_0x16b996['message'],_0x2d55c1);_0x3bd642(_0x4e850b['error'](0x1f4,_0x16b996[_0x5b87('0xd')]));});});});};exports['GetContactByPhone']=function(_0x2e14cb){var _0x1519e1=this;return new Promise(function(_0x55bcd9,_0x2d1a24){return db['CmContact'][_0x5b87('0x47')]({'raw':!![],'where':{'phone':_0x2e14cb[_0x5b87('0x12')][_0x5b87('0x13')][_0x5b87('0x48')]},'attributes':['id',_0x5b87('0x49')],'order':[['id',_0x5b87('0x4a')]]})[_0x5b87('0x6')](function(_0x5d2570){logger[_0x5b87('0x7')](_0x5b87('0x4b'),_0x2e14cb);logger[_0x5b87('0x18')](_0x5b87('0x4b'),_0x2e14cb,JSON[_0x5b87('0xa')](_0x5d2570));_0x55bcd9(_0x5d2570);})[_0x5b87('0x19')](function(_0x502e5e){logger[_0x5b87('0xb')](_0x5b87('0x4b'),_0x502e5e['message'],_0x2e14cb);_0x2d1a24(_0x1519e1[_0x5b87('0xb')](0x1f4,_0x502e5e[_0x5b87('0xd')]));});});};exports[_0x5b87('0x4c')]=function(_0x559086){var _0x3c0aaf=this;return new Promise(function(_0x4068d4,_0x46c6b2){return db[_0x5b87('0x28')][_0x5b87('0x29')](function(_0x32d930){return db['CmHopper'][_0x5b87('0x20')]({'active':![]},{'where':{},'transaction':_0x32d930})['then'](function(_0x13493e){logger[_0x5b87('0x7')]('ResetActiveCalls',_0x559086);logger[_0x5b87('0x18')](_0x5b87('0x4c'),_0x559086,JSON[_0x5b87('0xa')](_0x13493e));_0x4068d4(_0x13493e);})[_0x5b87('0x19')](function(_0x25c11e){logger['error'](_0x5b87('0x4c'),_0x25c11e[_0x5b87('0xd')],_0x559086);_0x46c6b2(_0x3c0aaf[_0x5b87('0xb')](0x1f4,_0x25c11e[_0x5b87('0xd')]));});});});};exports[_0x5b87('0x4d')]=function(_0x311498){var _0x107844=this;var _0x19083e=_0x311498[_0x5b87('0x1d')][_0x5b87('0x13')][_0x5b87('0x4e')];var _0x4829a2=_0x311498['body'][_0x5b87('0x13')][_0x5b87('0x4f')];var _0x2f05ee=_0x311498[_0x5b87('0x1d')]['where'][_0x5b87('0x50')];return new Promise(function(_0x4a5ff3,_0x1e4624){return db[_0x5b87('0x10')]['findAll']({'where':{'voiceQueueId':{'$in':_0x19083e},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize']['literal']('NOW()\x20+\x20INTERVAL\x20'+_0x4829a2+'\x20MINUTE'),'$gt':db['sequelize']['literal']('NOW()')}},'UserId':{'$in':_0x2f05ee}},'include':[{'model':db['CmContact'],'as':_0x5b87('0x2d')},{'model':db['User'],'as':_0x5b87('0x2f'),'attributes':['id','name',_0x5b87('0x31')]},{'model':db['CmList'],'as':'List'}]})[_0x5b87('0x6')](function(_0x3b29b1){if(_0x3b29b1[_0x5b87('0x32')]>0x0){return db[_0x5b87('0x28')][_0x5b87('0x29')](function(_0x216b87){return db['CmHopper'][_0x5b87('0x20')]({'recallmeNotifiedDate':db['sequelize'][_0x5b87('0x3e')]('NOW()')},{'where':{'id':{'$in':_[_0x5b87('0x17')](_0x3b29b1,'id')}},'transaction':_0x216b87})[_0x5b87('0x6')](function(){_0x4a5ff3(_0x3b29b1);})[_0x5b87('0x19')](function(_0x25d880){logger['error'](_0x5b87('0x4d'),_0x25d880[_0x5b87('0xd')],_0x311498);_0x1e4624(_0x107844[_0x5b87('0xb')](0x1f4,_0x25d880[_0x5b87('0xd')]));});})[_0x5b87('0x19')](function(_0xba68f2){logger[_0x5b87('0xb')]('CmHopperHandlePreviewRecallNotifications',_0xba68f2['message'],_0x311498);_0x1e4624(_0x107844[_0x5b87('0xb')](0x1f4,_0xba68f2[_0x5b87('0xd')]));});}else{_0x4a5ff3(_0x3b29b1);}});});};
\ No newline at end of file
+var _0x7c59=['jayson/promise','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','GetCmHopper','CmHopper','findAll','options','where','attributes','limit','include','model','map','ShowCmHopper','raw','CreateCmHopper','create','body','update','UpdateCmHopper','active','DestroyCmHopper','GetContactDialer','CmContact','sequelize','transaction','order','UPDATE','Contact','keys','User','name','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','describe','LOCK','GetCmHopperPreview','GetContactByPhone','findOne','phone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','NOW()','Agent','CmList','List','util','moment','bluebird','../../mysqldb','rpc'];(function(_0x867a4a,_0xb4984){var _0x191bb3=function(_0x573572){while(--_0x573572){_0x867a4a['push'](_0x867a4a['shift']());}};_0x191bb3(++_0xb4984);}(_0x7c59,0x147));var _0x97c5=function(_0x5c9c7b,_0x7b9156){_0x5c9c7b=_0x5c9c7b-0x0;var _0x1f54c9=_0x7c59[_0x5c9c7b];return _0x1f54c9;};'use strict';var _=require('lodash');var util=require(_0x97c5('0x0'));var moment=require(_0x97c5('0x1'));var BPromise=require(_0x97c5('0x2'));var db=require(_0x97c5('0x3'))['db'];var logger=require('../../config/logger')(_0x97c5('0x4'));var jayson=require(_0x97c5('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x42b9bc,_0x434211,_0x29832f){return new BPromise(function(_0xb7c5e1,_0x13663d){return client['request'](_0x42b9bc,_0x29832f)[_0x97c5('0x6')](function(_0x58d9b0){logger['info'](_0x97c5('0x7'),_0x434211,_0x97c5('0x8'));logger[_0x97c5('0x9')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x434211,_0x97c5('0x8'),JSON[_0x97c5('0xa')](_0x58d9b0));if(_0x58d9b0[_0x97c5('0xb')]){if(_0x58d9b0[_0x97c5('0xb')]['code']===0x1f4){logger[_0x97c5('0xb')](_0x97c5('0x7'),_0x434211,_0x58d9b0[_0x97c5('0xb')]['message']);return _0x13663d(_0x58d9b0[_0x97c5('0xb')][_0x97c5('0xc')]);}logger[_0x97c5('0xb')](_0x97c5('0x7'),_0x434211,_0x58d9b0[_0x97c5('0xb')]['message']);return _0xb7c5e1(_0x58d9b0['error'][_0x97c5('0xc')]);}else{logger[_0x97c5('0xd')](_0x97c5('0x7'),_0x434211,_0x97c5('0x8'));_0xb7c5e1(_0x58d9b0[_0x97c5('0xe')][_0x97c5('0xc')]);}})[_0x97c5('0xf')](function(_0x3b2e49){logger[_0x97c5('0xb')]('CmHopper,\x20%s,\x20%s',_0x434211,_0x3b2e49);_0x13663d(_0x3b2e49);});});}exports[_0x97c5('0x10')]=function(_0x566c70){var _0x4150f4=this;return new Promise(function(_0x240989,_0x12d644){return db[_0x97c5('0x11')][_0x97c5('0x12')]({'raw':_0x566c70['options']?_0x566c70[_0x97c5('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x566c70[_0x97c5('0x13')]?_0x566c70['options'][_0x97c5('0x14')]||null:null,'attributes':_0x566c70[_0x97c5('0x13')]?_0x566c70['options'][_0x97c5('0x15')]||null:null,'limit':_0x566c70['options']?_0x566c70[_0x97c5('0x13')][_0x97c5('0x16')]||null:null,'include':_0x566c70[_0x97c5('0x13')]?_0x566c70[_0x97c5('0x13')][_0x97c5('0x17')]?_['map'](_0x566c70[_0x97c5('0x13')]['include'],function(_0x2dc7d8){return{'model':db[_0x2dc7d8[_0x97c5('0x18')]],'as':_0x2dc7d8['as'],'attributes':_0x2dc7d8['attributes'],'include':_0x2dc7d8[_0x97c5('0x17')]?_['map'](_0x2dc7d8[_0x97c5('0x17')],function(_0x4caa2c){return{'model':db[_0x4caa2c[_0x97c5('0x18')]],'as':_0x4caa2c['as'],'attributes':_0x4caa2c[_0x97c5('0x15')],'include':_0x4caa2c[_0x97c5('0x17')]?_[_0x97c5('0x19')](_0x4caa2c['include'],function(_0x4199e3){return{'model':db[_0x4199e3['model']],'as':_0x4199e3['as'],'attributes':_0x4199e3[_0x97c5('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c7db7){logger[_0x97c5('0xd')](_0x97c5('0x10'),_0x566c70);logger[_0x97c5('0x9')](_0x97c5('0x10'),_0x566c70,JSON[_0x97c5('0xa')](_0x2c7db7));_0x240989(_0x2c7db7);})[_0x97c5('0xf')](function(_0x4a397c){logger[_0x97c5('0xb')](_0x97c5('0x10'),_0x4a397c['message'],_0x566c70);_0x12d644(_0x4150f4[_0x97c5('0xb')](0x1f4,_0x4a397c[_0x97c5('0xc')]));});});};exports[_0x97c5('0x1a')]=function(_0x3b2038){var _0x339d7d=this;return new Promise(function(_0x2a5395,_0x4b946f){return db[_0x97c5('0x11')]['find']({'raw':_0x3b2038[_0x97c5('0x13')]?_0x3b2038['options'][_0x97c5('0x1b')]===undefined?!![]:![]:!![],'where':_0x3b2038[_0x97c5('0x13')]?_0x3b2038[_0x97c5('0x13')][_0x97c5('0x14')]||null:null,'attributes':_0x3b2038[_0x97c5('0x13')]?_0x3b2038[_0x97c5('0x13')][_0x97c5('0x15')]||null:null,'include':_0x3b2038['options']?_0x3b2038['options']['include']?_['map'](_0x3b2038['options'][_0x97c5('0x17')],function(_0x1af82c){return{'model':db[_0x1af82c['model']],'as':_0x1af82c['as'],'attributes':_0x1af82c[_0x97c5('0x15')],'include':_0x1af82c[_0x97c5('0x17')]?_[_0x97c5('0x19')](_0x1af82c['include'],function(_0x4c89ea){return{'model':db[_0x4c89ea[_0x97c5('0x18')]],'as':_0x4c89ea['as'],'attributes':_0x4c89ea['attributes'],'include':_0x4c89ea[_0x97c5('0x17')]?_['map'](_0x4c89ea[_0x97c5('0x17')],function(_0xf796c9){return{'model':db[_0xf796c9[_0x97c5('0x18')]],'as':_0xf796c9['as'],'attributes':_0xf796c9['attributes']};}):[]};}):[]};}):[]:[]})[_0x97c5('0x6')](function(_0x34ee66){logger['info'](_0x97c5('0x1a'),_0x3b2038);logger[_0x97c5('0x9')](_0x97c5('0x1a'),_0x3b2038,JSON['stringify'](_0x34ee66));_0x2a5395(_0x34ee66);})[_0x97c5('0xf')](function(_0xe2fc62){logger[_0x97c5('0xb')]('ShowCmHopper',_0xe2fc62[_0x97c5('0xc')],_0x3b2038);_0x4b946f(_0x339d7d['error'](0x1f4,_0xe2fc62[_0x97c5('0xc')]));});});};exports[_0x97c5('0x1c')]=function(_0x2bef09){var _0x11ca68=this;return new Promise(function(_0x425215,_0x24e701){return db[_0x97c5('0x11')][_0x97c5('0x1d')](_0x2bef09[_0x97c5('0x1e')],{'raw':_0x2bef09['options']?_0x2bef09['options'][_0x97c5('0x1b')]===undefined?!![]:![]:!![]})[_0x97c5('0x6')](function(_0x3aff50){logger[_0x97c5('0xd')](_0x97c5('0x1c'),_0x2bef09);logger['debug'](_0x97c5('0x1c'),_0x2bef09,JSON['stringify'](_0x3aff50));_0x425215(_0x3aff50);})[_0x97c5('0xf')](function(_0x216648){logger['error']('CreateCmHopper',_0x216648[_0x97c5('0xc')],_0x2bef09);_0x24e701(_0x11ca68[_0x97c5('0xb')](0x1f4,_0x216648[_0x97c5('0xc')]));});});};exports['UpdateCmHopper']=function(_0xf86e53){var _0xee7bbe=this;return new Promise(function(_0x4eae20,_0x3e2f5d){return db[_0x97c5('0x11')][_0x97c5('0x1f')](_0xf86e53['body'],{'raw':_0xf86e53[_0x97c5('0x13')]?_0xf86e53[_0x97c5('0x13')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf86e53[_0x97c5('0x13')]?_0xf86e53[_0x97c5('0x13')][_0x97c5('0x14')]||null:null,'attributes':_0xf86e53[_0x97c5('0x13')]?_0xf86e53[_0x97c5('0x13')][_0x97c5('0x15')]||null:null,'limit':_0xf86e53[_0x97c5('0x13')]?_0xf86e53[_0x97c5('0x13')][_0x97c5('0x16')]||null:null})[_0x97c5('0x6')](function(_0x288bd8){logger[_0x97c5('0xd')](_0x97c5('0x20'),_0xf86e53);logger[_0x97c5('0xd')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0xf86e53[_0x97c5('0x13')][_0x97c5('0x14')]),_0xf86e53[_0x97c5('0x1e')][_0x97c5('0x21')]);logger[_0x97c5('0x9')]('UpdateCmHopper',_0xf86e53,JSON[_0x97c5('0xa')](_0x288bd8));_0x4eae20(_0x288bd8);})[_0x97c5('0xf')](function(_0x4bc52a){logger[_0x97c5('0xb')](_0x97c5('0x20'),_0x4bc52a[_0x97c5('0xc')],_0xf86e53);_0x3e2f5d(_0xee7bbe['error'](0x1f4,_0x4bc52a[_0x97c5('0xc')]));});});};exports[_0x97c5('0x22')]=function(_0x4ee644){var _0x591c1d=this;return new Promise(function(_0x258c0d,_0x4def7b){return db['CmHopper']['destroy']({'where':_0x4ee644['options']?_0x4ee644[_0x97c5('0x13')][_0x97c5('0x14')]||null:null})[_0x97c5('0x6')](function(_0x583b33){logger[_0x97c5('0xd')](_0x97c5('0x22'),_0x4ee644);logger[_0x97c5('0x9')](_0x97c5('0x22'),_0x4ee644,JSON['stringify'](_0x583b33));_0x258c0d(_0x583b33);})[_0x97c5('0xf')](function(_0x5aac42){logger[_0x97c5('0xb')](_0x97c5('0x22'),_0x5aac42['message'],_0x4ee644);_0x4def7b(_0x591c1d[_0x97c5('0xb')](0x1f4,_0x5aac42['message']));});});};exports[_0x97c5('0x23')]=function(_0x2a5342){var _0x5663f6=this;return new Promise(function(_0x2d7a24,_0x44af6d){return db[_0x97c5('0x24')]['describe']()['then'](function(_0x5a7b91){return db[_0x97c5('0x25')][_0x97c5('0x26')](function(_0x81788){return db[_0x97c5('0x11')][_0x97c5('0x12')]({'where':_0x2a5342['options']?_0x2a5342[_0x97c5('0x13')][_0x97c5('0x14')]||null:null,'attributes':_0x2a5342[_0x97c5('0x13')]?_0x2a5342['options'][_0x97c5('0x15')]||null:null,'limit':_0x2a5342['options']?_0x2a5342[_0x97c5('0x13')][_0x97c5('0x16')]||null:null,'order':_0x2a5342[_0x97c5('0x13')]?_0x2a5342[_0x97c5('0x13')][_0x97c5('0x27')]||null:null,'transaction':_0x81788,'lock':_0x81788['LOCK'][_0x97c5('0x28')],'include':[{'model':db[_0x97c5('0x24')],'as':_0x97c5('0x29'),'attributes':_[_0x97c5('0x2a')](_0x5a7b91)},{'model':db[_0x97c5('0x2b')],'as':'Agent','attributes':['id',_0x97c5('0x2c'),_0x97c5('0x2d')]}]})['then'](function(_0x1c0073){var _0x28908a=[];var _0x1dbeff=[];for(var _0x39d5dd=0x0;_0x39d5dd<_0x1c0073[_0x97c5('0x2e')];_0x39d5dd+=0x1){var _0xb7a2d=_0x1c0073[_0x39d5dd][_0x97c5('0x2f')];if(_0xb7a2d===null){_0x28908a[_0x97c5('0x30')](_0x1c0073[_0x39d5dd][_0x97c5('0x1f')](_0x2a5342[_0x97c5('0x1e')],{'transaction':_0x81788}));}else if(!_0x1dbeff[_0x97c5('0x31')](_0xb7a2d)){_0x1dbeff[_0x97c5('0x30')](_0xb7a2d);_0x28908a[_0x97c5('0x30')](_0x1c0073[_0x39d5dd][_0x97c5('0x1f')](_0x2a5342['body'],{'transaction':_0x81788}));}}return BPromise[_0x97c5('0x32')](_0x28908a);});})['then'](function(_0x1acc60){logger[_0x97c5('0xd')]('GetContactDialer',_0x2a5342);if(_0x1acc60[_0x97c5('0x2e')]>0x0){logger['info'](_0x97c5('0x33'),_0x1acc60[0x0][_0x97c5('0x34')]['id'],_0x1acc60[0x0][_0x97c5('0x34')]['ContactId'],_0x1acc60[0x0][_0x97c5('0x34')]['active']);}logger[_0x97c5('0x9')]('GetContactDialer',_0x2a5342,JSON['stringify'](_0x1acc60));_0x2d7a24(_0x1acc60);})['catch'](function(_0xfa7afc){logger['error'](_0x97c5('0x23'),_0xfa7afc['message'],_0x2a5342);_0x44af6d(_0x5663f6[_0x97c5('0xb')](0x1f4,_0xfa7afc[_0x97c5('0xc')]));});});});};exports[_0x97c5('0x35')]=function(_0x1163d4){var _0xe00e34=this;return new Promise(function(_0x398b66,_0x44b9a1){return db[_0x97c5('0x25')][_0x97c5('0x26')](function(_0xf25a1a){return db['CmHopperFinal'][_0x97c5('0x1d')](_0x1163d4[_0x97c5('0x1e')],{'raw':_0x1163d4[_0x97c5('0x13')]?_0x1163d4[_0x97c5('0x13')]['raw']===undefined?!![]:![]:!![],'transaction':_0xf25a1a})[_0x97c5('0x6')](function(){logger[_0x97c5('0xd')](_0x97c5('0x36'),JSON[_0x97c5('0xa')](_0x1163d4[_0x97c5('0x13')][_0x97c5('0x14')]),_0x1163d4['options'][_0x97c5('0x14')]['active']);return db[_0x97c5('0x11')][_0x97c5('0x37')]({'where':_0x1163d4[_0x97c5('0x13')]?_0x1163d4[_0x97c5('0x13')][_0x97c5('0x14')]||null:null,'transaction':_0xf25a1a});});})[_0x97c5('0x6')](function(_0xb74ceb){logger[_0x97c5('0xd')](_0x97c5('0x35'),_0x1163d4);logger['debug'](_0x97c5('0x35'),_0x1163d4,JSON['stringify'](_0xb74ceb));_0x398b66(_0xb74ceb);})[_0x97c5('0xf')](function(_0x15eb36){logger[_0x97c5('0xb')](_0x97c5('0x35'),_0x15eb36[_0x97c5('0xc')],_0x1163d4);_0x44b9a1(_0xe00e34[_0x97c5('0xb')](0x1f4,_0x15eb36[_0x97c5('0xc')]));});});};exports[_0x97c5('0x38')]=function(_0x4e79e8){var _0x2b038f=this;return new Promise(function(_0x22ba89,_0x27d345){return db[_0x97c5('0x11')][_0x97c5('0x12')]({'raw':_0x4e79e8[_0x97c5('0x13')]?_0x4e79e8[_0x97c5('0x13')][_0x97c5('0x1b')]===undefined?!![]:![]:!![],'where':_0x4e79e8[_0x97c5('0x13')]?_0x4e79e8[_0x97c5('0x13')][_0x97c5('0x14')]||null:null,'attributes':[[db[_0x97c5('0x25')]['fn'](_0x97c5('0x39'),db[_0x97c5('0x25')]['fn']('IF',db[_0x97c5('0x25')][_0x97c5('0x3a')](_0x97c5('0x3b')+util[_0x97c5('0x3c')](_0x97c5('0x3d'),moment()[_0x97c5('0x3c')](_0x97c5('0x3e')))+_0x97c5('0x3f')))),_0x97c5('0x40')]]})['then'](function(_0x1a872d){logger[_0x97c5('0xd')]('CountReScheduled',_0x4e79e8);logger['debug'](_0x97c5('0x38'),_0x4e79e8,JSON[_0x97c5('0xa')](_0x1a872d));_0x22ba89(_0x1a872d);})[_0x97c5('0xf')](function(_0x35d488){logger[_0x97c5('0xb')]('CountReScheduled',_0x35d488[_0x97c5('0xc')],_0x4e79e8);_0x27d345(_0x2b038f[_0x97c5('0xb')](0x1f4,_0x35d488[_0x97c5('0xc')]));});});};exports[_0x97c5('0x41')]=function(_0x2c36ef){var _0x4b346f=this;return new Promise(function(_0x1508b5,_0x237c63){return db[_0x97c5('0x24')][_0x97c5('0x42')]()[_0x97c5('0x6')](function(_0x5b0f3f){return db[_0x97c5('0x25')][_0x97c5('0x26')](function(_0x418cf5){return db['CmHopper']['findAll']({'where':_0x2c36ef['options']?_0x2c36ef[_0x97c5('0x13')][_0x97c5('0x14')]||null:null,'attributes':_0x2c36ef[_0x97c5('0x13')]?_0x2c36ef[_0x97c5('0x13')][_0x97c5('0x15')]||null:null,'limit':0x1,'order':_0x2c36ef[_0x97c5('0x13')]?_0x2c36ef[_0x97c5('0x13')][_0x97c5('0x27')]||null:null,'group':db[_0x97c5('0x11')][_0x97c5('0x2f')],'transaction':_0x418cf5,'lock':_0x418cf5[_0x97c5('0x43')][_0x97c5('0x28')],'include':_0x2c36ef[_0x97c5('0x13')]?_0x2c36ef[_0x97c5('0x13')][_0x97c5('0x17')]?_[_0x97c5('0x19')](_0x2c36ef[_0x97c5('0x13')][_0x97c5('0x17')],function(_0x567540){return{'model':db[_0x567540[_0x97c5('0x18')]],'as':_0x567540['as'],'attributes':_0x567540[_0x97c5('0x15')],'include':_0x567540[_0x97c5('0x17')]?_[_0x97c5('0x19')](_0x567540['include'],function(_0x5cf77c){return{'model':db[_0x5cf77c[_0x97c5('0x18')]],'as':_0x5cf77c['as'],'attributes':_0x5cf77c[_0x97c5('0x15')],'include':_0x5cf77c[_0x97c5('0x17')]?_[_0x97c5('0x19')](_0x5cf77c[_0x97c5('0x17')],function(_0x4c2c2b){return{'model':db[_0x4c2c2b[_0x97c5('0x18')]],'as':_0x4c2c2b['as'],'attributes':_0x4c2c2b['attributes']};}):[]};}):[]};}):[]:[]})[_0x97c5('0x6')](function(_0x520606){var _0x52c90c=[];for(var _0xbcdc2f=0x0;_0xbcdc2f<_0x520606[_0x97c5('0x2e')];_0xbcdc2f+=0x1){_0x52c90c['push'](_0x520606[_0xbcdc2f]['update'](_0x2c36ef[_0x97c5('0x1e')],{'transaction':_0x418cf5}));}return BPromise[_0x97c5('0x32')](_0x52c90c);});})[_0x97c5('0x6')](function(_0xf2bd01){logger[_0x97c5('0xd')](_0x97c5('0x41'),_0x2c36ef);logger[_0x97c5('0x9')](_0x97c5('0x41'),_0x2c36ef,JSON[_0x97c5('0xa')](_0xf2bd01));_0x1508b5(_0xf2bd01);})[_0x97c5('0xf')](function(_0x553730){logger[_0x97c5('0xb')]('GetContactRecallMe',_0x553730[_0x97c5('0xc')],_0x2c36ef);_0x237c63(_0x4b346f[_0x97c5('0xb')](0x1f4,_0x553730[_0x97c5('0xc')]));});});});};exports[_0x97c5('0x44')]=function(_0x262b03){var _0x332251=this;return new Promise(function(_0x56e438,_0x3fd66a){db['CmContact'][_0x97c5('0x42')]()[_0x97c5('0x6')](function(_0x4fd5c3){return db[_0x97c5('0x11')][_0x97c5('0x12')]({'raw':_0x262b03[_0x97c5('0x13')]?_0x262b03[_0x97c5('0x13')][_0x97c5('0x1b')]===undefined?!![]:![]:!![],'where':_0x262b03[_0x97c5('0x13')]?_0x262b03['options'][_0x97c5('0x14')]||null:null,'attributes':_0x262b03['options']?_0x262b03[_0x97c5('0x13')][_0x97c5('0x15')]||null:null,'limit':_0x262b03[_0x97c5('0x13')]?_0x262b03[_0x97c5('0x13')][_0x97c5('0x16')]||null:null,'include':_0x262b03[_0x97c5('0x13')]?_0x262b03[_0x97c5('0x13')]['include']?_[_0x97c5('0x19')](_0x262b03['options']['include'],function(_0x4889d8){return{'model':db[_0x4889d8[_0x97c5('0x18')]],'as':_0x4889d8['as'],'attributes':_0x4889d8['as']===_0x97c5('0x29')?_[_0x97c5('0x2a')](_0x4fd5c3):_0x4889d8[_0x97c5('0x15')],'include':_0x4889d8[_0x97c5('0x17')]?_['map'](_0x4889d8['include'],function(_0x9c3472){return{'model':db[_0x9c3472[_0x97c5('0x18')]],'as':_0x9c3472['as'],'attributes':_0x9c3472[_0x97c5('0x15')],'include':_0x9c3472['include']?_[_0x97c5('0x19')](_0x9c3472['include'],function(_0x4e3f61){return{'model':db[_0x4e3f61[_0x97c5('0x18')]],'as':_0x4e3f61['as'],'attributes':_0x4e3f61[_0x97c5('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a16bb){logger['info'](_0x97c5('0x10'),_0x262b03);logger[_0x97c5('0x9')](_0x97c5('0x10'),_0x262b03,JSON['stringify'](_0x5a16bb));_0x56e438(_0x5a16bb);})[_0x97c5('0xf')](function(_0x50f960){logger[_0x97c5('0xb')]('GetCmHopper',_0x50f960['message'],_0x262b03);_0x3fd66a(_0x332251[_0x97c5('0xb')](0x1f4,_0x50f960[_0x97c5('0xc')]));});});});};exports[_0x97c5('0x45')]=function(_0x47de53){var _0x740c6=this;return new Promise(function(_0x39920d,_0x56dbbc){return db[_0x97c5('0x24')][_0x97c5('0x46')]({'raw':!![],'where':{'phone':_0x47de53[_0x97c5('0x13')]['where'][_0x97c5('0x47')]},'attributes':['id','dialTimezone'],'order':[['id','DESC']]})[_0x97c5('0x6')](function(_0x4796f3){logger[_0x97c5('0xd')](_0x97c5('0x48'),_0x47de53);logger[_0x97c5('0x9')](_0x97c5('0x48'),_0x47de53,JSON[_0x97c5('0xa')](_0x4796f3));_0x39920d(_0x4796f3);})[_0x97c5('0xf')](function(_0xd10aed){logger['error'](_0x97c5('0x48'),_0xd10aed[_0x97c5('0xc')],_0x47de53);_0x56dbbc(_0x740c6[_0x97c5('0xb')](0x1f4,_0xd10aed[_0x97c5('0xc')]));});});};exports[_0x97c5('0x49')]=function(_0xf4dce3){var _0xe5777b=this;return new Promise(function(_0x43e19b,_0x277e93){return db[_0x97c5('0x25')][_0x97c5('0x26')](function(_0x1ead45){return db['CmHopper'][_0x97c5('0x1f')]({'active':![]},{'where':{},'transaction':_0x1ead45})['then'](function(_0x511a8b){logger[_0x97c5('0xd')]('ResetActiveCalls',_0xf4dce3);logger[_0x97c5('0x9')]('ResetActiveCalls',_0xf4dce3,JSON[_0x97c5('0xa')](_0x511a8b));_0x43e19b(_0x511a8b);})[_0x97c5('0xf')](function(_0x16940f){logger[_0x97c5('0xb')]('ResetActiveCalls',_0x16940f[_0x97c5('0xc')],_0xf4dce3);_0x277e93(_0xe5777b[_0x97c5('0xb')](0x1f4,_0x16940f[_0x97c5('0xc')]));});});});};exports[_0x97c5('0x4a')]=function(_0x127d7d){var _0x1ea34f=this;var _0x38e6ad=_0x127d7d['body'][_0x97c5('0x14')][_0x97c5('0x4b')];var _0x2d29af=_0x127d7d[_0x97c5('0x1e')][_0x97c5('0x14')][_0x97c5('0x4c')];var _0x17d567=_0x127d7d['body'][_0x97c5('0x14')][_0x97c5('0x4d')];return new Promise(function(_0x3e737a,_0x13fee4){return db[_0x97c5('0x11')]['findAll']({'where':{'voiceQueueId':{'$in':_0x38e6ad},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x97c5('0x25')][_0x97c5('0x3a')](_0x97c5('0x4e')+_0x2d29af+'\x20MINUTE'),'$gt':db[_0x97c5('0x25')][_0x97c5('0x3a')](_0x97c5('0x4f'))}},'UserId':{'$in':_0x17d567}},'include':[{'model':db[_0x97c5('0x24')],'as':_0x97c5('0x29')},{'model':db[_0x97c5('0x2b')],'as':_0x97c5('0x50'),'attributes':['id',_0x97c5('0x2c'),_0x97c5('0x2d')]},{'model':db[_0x97c5('0x51')],'as':_0x97c5('0x52')}]})[_0x97c5('0x6')](function(_0x154dd7){if(_0x154dd7['length']>0x0){return db[_0x97c5('0x25')][_0x97c5('0x26')](function(_0x196cf3){return db[_0x97c5('0x11')][_0x97c5('0x1f')]({'recallmeNotifiedDate':db[_0x97c5('0x25')][_0x97c5('0x3a')]('NOW()')},{'where':{'id':{'$in':_[_0x97c5('0x19')](_0x154dd7,'id')}},'transaction':_0x196cf3})['then'](function(){_0x3e737a(_0x154dd7);})[_0x97c5('0xf')](function(_0x4ff6ce){logger[_0x97c5('0xb')](_0x97c5('0x4a'),_0x4ff6ce[_0x97c5('0xc')],_0x127d7d);_0x13fee4(_0x1ea34f[_0x97c5('0xb')](0x1f4,_0x4ff6ce[_0x97c5('0xc')]));});})[_0x97c5('0xf')](function(_0x1b42c1){logger[_0x97c5('0xb')](_0x97c5('0x4a'),_0x1b42c1['message'],_0x127d7d);_0x13fee4(_0x1ea34f[_0x97c5('0xb')](0x1f4,_0x1b42c1['message']));});}else{_0x3e737a(_0x154dd7);}});});};
\ No newline at end of file
index 7dc5b2e..b3e9fb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6539=['getTimezones','/:id','getPreviewRecall','post','/preview','/timezone','getTimezone','put','update','delete','destroy','exports','express','Router','../../components/auth/service','get','index','/describe','describe','/opencontacts','isAuthenticated','getOpenContacts'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6539,0x16c));var _0x9653=function(_0x43ac53,_0x470cc5){_0x43ac53=_0x43ac53-0x0;var _0x3b10a3=_0x6539[_0x43ac53];return _0x3b10a3;};'use strict';var express=require(_0x9653('0x0'));var router=express[_0x9653('0x1')]();var auth=require(_0x9653('0x2'));var controller=require('./cmHopper.controller');router[_0x9653('0x3')]('/',auth['isAuthenticated'](),controller[_0x9653('0x4')]);router[_0x9653('0x3')](_0x9653('0x5'),auth['isAuthenticated'](),controller[_0x9653('0x6')]);router['get'](_0x9653('0x7'),auth[_0x9653('0x8')](),controller[_0x9653('0x9')]);router['get']('/timezones',auth[_0x9653('0x8')](),controller[_0x9653('0xa')]);router['get'](_0x9653('0xb'),auth[_0x9653('0x8')](),controller['show']);router[_0x9653('0x3')]('/:id/previewrecall',auth[_0x9653('0x8')](),controller[_0x9653('0xc')]);router[_0x9653('0xd')]('/',auth[_0x9653('0x8')](),controller['create']);router[_0x9653('0xd')](_0x9653('0xe'),auth[_0x9653('0x8')](),controller['getPreview']);router['post'](_0x9653('0xf'),auth[_0x9653('0x8')](),controller[_0x9653('0x10')]);router[_0x9653('0x11')](_0x9653('0xb'),auth['isAuthenticated'](),controller[_0x9653('0x12')]);router[_0x9653('0x13')](_0x9653('0xb'),auth[_0x9653('0x8')](),controller[_0x9653('0x14')]);module[_0x9653('0x15')]=router;
\ No newline at end of file
+var _0x0ca0=['Router','../../components/auth/service','./cmHopper.controller','index','get','isAuthenticated','describe','/opencontacts','getOpenContacts','/timezones','/:id','show','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','getTimezone','update','delete','destroy'];(function(_0x5b3e41,_0x24f76a){var _0x225766=function(_0x5da1aa){while(--_0x5da1aa){_0x5b3e41['push'](_0x5b3e41['shift']());}};_0x225766(++_0x24f76a);}(_0x0ca0,0xb0));var _0x00ca=function(_0x356a38,_0x5c9a7f){_0x356a38=_0x356a38-0x0;var _0x4513d1=_0x0ca0[_0x356a38];return _0x4513d1;};'use strict';var express=require('express');var router=express[_0x00ca('0x0')]();var auth=require(_0x00ca('0x1'));var controller=require(_0x00ca('0x2'));router['get']('/',auth['isAuthenticated'](),controller[_0x00ca('0x3')]);router[_0x00ca('0x4')]('/describe',auth[_0x00ca('0x5')](),controller[_0x00ca('0x6')]);router[_0x00ca('0x4')](_0x00ca('0x7'),auth[_0x00ca('0x5')](),controller[_0x00ca('0x8')]);router[_0x00ca('0x4')](_0x00ca('0x9'),auth[_0x00ca('0x5')](),controller['getTimezones']);router[_0x00ca('0x4')](_0x00ca('0xa'),auth[_0x00ca('0x5')](),controller[_0x00ca('0xb')]);router['get'](_0x00ca('0xc'),auth[_0x00ca('0x5')](),controller[_0x00ca('0xd')]);router[_0x00ca('0xe')]('/',auth[_0x00ca('0x5')](),controller[_0x00ca('0xf')]);router[_0x00ca('0xe')](_0x00ca('0x10'),auth[_0x00ca('0x5')](),controller[_0x00ca('0x11')]);router[_0x00ca('0xe')]('/timezone',auth['isAuthenticated'](),controller[_0x00ca('0x12')]);router['put'](_0x00ca('0xa'),auth[_0x00ca('0x5')](),controller[_0x00ca('0x13')]);router[_0x00ca('0x14')](_0x00ca('0xa'),auth['isAuthenticated'](),controller[_0x00ca('0x15')]);module['exports']=router;
\ No newline at end of file
index 2c6895c..b8fad95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dae=['YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER','STRING','DATE','format'];(function(_0x167cd0,_0x23a5cc){var _0x3acca3=function(_0x423233){while(--_0x423233){_0x167cd0['push'](_0x167cd0['shift']());}};_0x3acca3(++_0x23a5cc);}(_0x8dae,0x69));var _0xe8da=function(_0x49eae9,_0x294226){_0x49eae9=_0x49eae9-0x0;var _0x8099b2=_0x8dae[_0x49eae9];return _0x8099b2;};'use strict';var moment=require(_0xe8da('0x0'));var Sequelize=require(_0xe8da('0x1'));module[_0xe8da('0x2')]={'CmHopperId':{'type':Sequelize[_0xe8da('0x3')]},'phone':{'type':Sequelize[_0xe8da('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xe8da('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xe8da('0x5')],'defaultValue':moment()[_0xe8da('0x6')](_0xe8da('0x7'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe8da('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe8da('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xe8da('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe8da('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe8da('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe8da('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xcc58=['format','moment','sequelize','INTEGER','STRING','DATE'];(function(_0x4539fd,_0x9e2997){var _0x406cfa=function(_0x32602e){while(--_0x32602e){_0x4539fd['push'](_0x4539fd['shift']());}};_0x406cfa(++_0x9e2997);}(_0xcc58,0xf1));var _0x8cc5=function(_0x5ed248,_0x4300eb){_0x5ed248=_0x5ed248-0x0;var _0x28acf4=_0xcc58[_0x5ed248];return _0x28acf4;};'use strict';var moment=require(_0x8cc5('0x0'));var Sequelize=require(_0x8cc5('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0x8cc5('0x2')]},'phone':{'type':Sequelize[_0x8cc5('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x8cc5('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x8cc5('0x4')],'defaultValue':moment()[_0x8cc5('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8cc5('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x8cc5('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8cc5('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 0e5a25a..5e0113a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe760=['filters','filter','merge','VIRTUAL','includeAll','findAll','catch','show','keys','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x3c4c6a,_0x55d546){var _0x43b3d6=function(_0x275ddf){while(--_0x275ddf){_0x3c4c6a['push'](_0x3c4c6a['shift']());}};_0x43b3d6(++_0x55d546);}(_0xe760,0x1b5));var _0x0e76=function(_0x57772c,_0x19df22){_0x57772c=_0x57772c-0x0;var _0x109f6c=_0xe760[_0x57772c];return _0x109f6c;};'use strict';var emlformat=require(_0x0e76('0x0'));var rimraf=require(_0x0e76('0x1'));var zipdir=require(_0x0e76('0x2'));var jsonpatch=require(_0x0e76('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0e76('0x4'));var path=require('path');var sox=require(_0x0e76('0x5'));var csv=require(_0x0e76('0x6'));var ejs=require(_0x0e76('0x7'));var fs=require('fs');var fs_extra=require(_0x0e76('0x8'));var _=require(_0x0e76('0x9'));var squel=require(_0x0e76('0xa'));var crypto=require(_0x0e76('0xb'));var jsforce=require(_0x0e76('0xc'));var deskjs=require(_0x0e76('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0e76('0xe'));var Papa=require(_0x0e76('0xf'));var Redis=require(_0x0e76('0x10'));var authService=require(_0x0e76('0x11'));var qs=require(_0x0e76('0x12'));var as=require(_0x0e76('0x13'));var hardwareService=require(_0x0e76('0x14'));var logger=require(_0x0e76('0x15'))('api');var utils=require(_0x0e76('0x16'));var config=require(_0x0e76('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0e76('0x18'))['db'];function respondWithStatusCode(_0x4ae903,_0x16c461){_0x16c461=_0x16c461||0xcc;return function(_0x16cf01){if(_0x16cf01){return _0x4ae903[_0x0e76('0x19')](_0x16c461);}return _0x4ae903[_0x0e76('0x1a')](_0x16c461)[_0x0e76('0x1b')]();};}function respondWithResult(_0x339a99,_0x1c52be){_0x1c52be=_0x1c52be||0xc8;return function(_0x409990){if(_0x409990){return _0x339a99['status'](_0x1c52be)[_0x0e76('0x1c')](_0x409990);}};}function respondWithFilteredResult(_0x187882,_0x36b200){return function(_0x446ec2){if(_0x446ec2){var _0x1c9dc5=typeof _0x36b200[_0x0e76('0x1d')]==='undefined'&&typeof _0x36b200[_0x0e76('0x1e')]==='undefined';var _0x14c37a=_0x446ec2[_0x0e76('0x1f')];var _0x1dd0c0=_0x1c9dc5?0x0:_0x36b200[_0x0e76('0x1d')];var _0x144ff9=_0x1c9dc5?_0x446ec2['count']:_0x36b200[_0x0e76('0x1d')]+_0x36b200[_0x0e76('0x1e')];var _0x3a6261;if(_0x144ff9>=_0x14c37a){_0x144ff9=_0x14c37a;_0x3a6261=0xc8;}else{_0x3a6261=0xce;}_0x187882[_0x0e76('0x1a')](_0x3a6261);return _0x187882[_0x0e76('0x20')](_0x0e76('0x21'),_0x1dd0c0+'-'+_0x144ff9+'/'+_0x14c37a)[_0x0e76('0x1c')](_0x446ec2);}return null;};}function patchUpdates(_0x1b5a04){return function(_0xb03940){try{jsonpatch['apply'](_0xb03940,_0x1b5a04,!![]);}catch(_0x2281b0){return BPromise[_0x0e76('0x22')](_0x2281b0);}return _0xb03940[_0x0e76('0x23')]();};}function saveUpdates(_0x175550,_0x232019){return function(_0x5561cd){if(_0x5561cd){return _0x5561cd['update'](_0x175550)[_0x0e76('0x24')](function(_0x5935d3){return _0x5935d3;});}return null;};}function removeEntity(_0x4fe241,_0x304ca8){return function(_0x20ff47){if(_0x20ff47){return _0x20ff47[_0x0e76('0x25')]()[_0x0e76('0x24')](function(){var _0x50c6f6=_0x20ff47[_0x0e76('0x26')]({'plain':!![]});var _0x372f7b=_0x0e76('0x27');return db[_0x0e76('0x28')][_0x0e76('0x25')]({'where':{'type':_0x372f7b,'resourceId':_0x50c6f6['id']}})[_0x0e76('0x24')](function(){return _0x20ff47;});})[_0x0e76('0x24')](function(){_0x4fe241[_0x0e76('0x1a')](0xcc)[_0x0e76('0x1b')]();});}};}function handleEntityNotFound(_0x28a5a0,_0xb1104d){return function(_0x5a25e5){if(!_0x5a25e5){_0x28a5a0[_0x0e76('0x19')](0x194);}return _0x5a25e5;};}function handleError(_0x1575e1,_0x489317){_0x489317=_0x489317||0x1f4;return function(_0x3f4be2){logger[_0x0e76('0x29')](_0x3f4be2[_0x0e76('0x2a')]);if(_0x3f4be2[_0x0e76('0x2b')]){delete _0x3f4be2[_0x0e76('0x2b')];}_0x1575e1[_0x0e76('0x1a')](_0x489317)['send'](_0x3f4be2);};}exports[_0x0e76('0x2c')]=function(_0x49c376,_0x11a339){var _0x273b7f={},_0x44791c={},_0xfe8105={'count':0x0,'rows':[]};var _0x14daf4=_[_0x0e76('0x2d')](db[_0x0e76('0x2e')][_0x0e76('0x2f')],function(_0x54e514){return{'name':_0x54e514[_0x0e76('0x30')],'type':_0x54e514[_0x0e76('0x31')][_0x0e76('0x32')]};});_0x44791c[_0x0e76('0x33')]=_[_0x0e76('0x2d')](_0x14daf4,'name');_0x44791c[_0x0e76('0x34')]=_['keys'](_0x49c376[_0x0e76('0x34')]);_0x44791c['filters']=_[_0x0e76('0x35')](_0x44791c['model'],_0x44791c[_0x0e76('0x34')]);_0x273b7f[_0x0e76('0x36')]=_[_0x0e76('0x35')](_0x44791c[_0x0e76('0x33')],qs[_0x0e76('0x37')](_0x49c376[_0x0e76('0x34')][_0x0e76('0x37')]));_0x273b7f[_0x0e76('0x36')]=_0x273b7f['attributes'][_0x0e76('0x38')]?_0x273b7f[_0x0e76('0x36')]:_0x44791c['model'];if(!_0x49c376['query'][_0x0e76('0x39')](_0x0e76('0x3a'))){_0x273b7f[_0x0e76('0x1e')]=qs[_0x0e76('0x1e')](_0x49c376['query'][_0x0e76('0x1e')]);_0x273b7f[_0x0e76('0x1d')]=qs[_0x0e76('0x1d')](_0x49c376[_0x0e76('0x34')][_0x0e76('0x1d')]);}_0x273b7f['order']=qs[_0x0e76('0x3b')](_0x49c376[_0x0e76('0x34')]['sort']);_0x273b7f[_0x0e76('0x3c')]=qs[_0x0e76('0x3d')](_['pick'](_0x49c376['query'],_0x44791c['filters']),_0x14daf4);if(_0x49c376[_0x0e76('0x34')][_0x0e76('0x3e')]){_0x273b7f[_0x0e76('0x3c')]=_[_0x0e76('0x3f')](_0x273b7f[_0x0e76('0x3c')],{'$or':_['map'](_0x14daf4,function(_0x5c28cd){if(_0x5c28cd[_0x0e76('0x31')]!==_0x0e76('0x40')){var _0x2bc959={};_0x2bc959[_0x5c28cd[_0x0e76('0x2b')]]={'$like':'%'+_0x49c376[_0x0e76('0x34')]['filter']+'%'};return _0x2bc959;}})});}_0x273b7f=_['merge']({},_0x273b7f,_0x49c376['options']);var _0x1b5374={'where':_0x273b7f[_0x0e76('0x3c')]};return db[_0x0e76('0x2e')][_0x0e76('0x1f')](_0x1b5374)[_0x0e76('0x24')](function(_0x32edc1){_0xfe8105[_0x0e76('0x1f')]=_0x32edc1;if(_0x49c376[_0x0e76('0x34')][_0x0e76('0x41')]){_0x273b7f['include']=[{'all':!![]}];}return db[_0x0e76('0x2e')][_0x0e76('0x42')](_0x273b7f);})['then'](function(_0x277da8){_0xfe8105['rows']=_0x277da8;return _0xfe8105;})[_0x0e76('0x24')](respondWithFilteredResult(_0x11a339,_0x273b7f))[_0x0e76('0x43')](handleError(_0x11a339,null));};exports[_0x0e76('0x44')]=function(_0x365143,_0x4bce95){var _0x29e6b0={'raw':!![],'where':{'id':_0x365143['params']['id']}},_0x52adad={};_0x52adad['model']=_[_0x0e76('0x45')](db[_0x0e76('0x2e')][_0x0e76('0x2f')]);_0x52adad[_0x0e76('0x34')]=_[_0x0e76('0x45')](_0x365143[_0x0e76('0x34')]);_0x52adad[_0x0e76('0x3d')]=_[_0x0e76('0x35')](_0x52adad['model'],_0x52adad[_0x0e76('0x34')]);_0x29e6b0[_0x0e76('0x36')]=_['intersection'](_0x52adad[_0x0e76('0x33')],qs[_0x0e76('0x37')](_0x365143[_0x0e76('0x34')]['fields']));_0x29e6b0['attributes']=_0x29e6b0[_0x0e76('0x36')][_0x0e76('0x38')]?_0x29e6b0['attributes']:_0x52adad[_0x0e76('0x33')];if(_0x365143[_0x0e76('0x34')][_0x0e76('0x41')]){_0x29e6b0[_0x0e76('0x46')]=[{'all':!![]}];}_0x29e6b0=_[_0x0e76('0x3f')]({},_0x29e6b0,_0x365143[_0x0e76('0x47')]);return db[_0x0e76('0x2e')][_0x0e76('0x48')](_0x29e6b0)['then'](handleEntityNotFound(_0x4bce95,null))[_0x0e76('0x24')](respondWithResult(_0x4bce95,null))[_0x0e76('0x43')](handleError(_0x4bce95,null));};exports[_0x0e76('0x49')]=function(_0x38f297,_0x113828){return db[_0x0e76('0x2e')][_0x0e76('0x49')](_0x38f297['body'],{})['then'](function(_0x3a2021){var _0x526cd1=_0x38f297[_0x0e76('0x4a')][_0x0e76('0x26')]({'plain':!![]});if(!_0x526cd1)throw new Error(_0x0e76('0x4b'));if(_0x526cd1[_0x0e76('0x4c')]===_0x0e76('0x4a')){var _0x1b233f=_0x3a2021[_0x0e76('0x26')]({'plain':!![]});var _0x35b9ee=_0x0e76('0x27');return db['UserProfileSection'][_0x0e76('0x48')]({'where':{'name':_0x35b9ee,'userProfileId':_0x526cd1[_0x0e76('0x4d')]},'raw':!![]})['then'](function(_0x1f5958){if(_0x1f5958&&_0x1f5958[_0x0e76('0x4e')]===0x0){return db[_0x0e76('0x28')]['create']({'name':_0x1b233f[_0x0e76('0x2b')],'resourceId':_0x1b233f['id'],'type':_0x1f5958[_0x0e76('0x2b')],'sectionId':_0x1f5958['id']},{})[_0x0e76('0x24')](function(){return _0x3a2021;});}else{return _0x3a2021;}})['catch'](function(_0x368225){logger['error'](_0x0e76('0x4f'),_0x368225);throw _0x368225;});}return _0x3a2021;})[_0x0e76('0x24')](respondWithResult(_0x113828,0xc9))['catch'](handleError(_0x113828,null));};exports[_0x0e76('0x50')]=function(_0x214ccc,_0x244de4){if(_0x214ccc[_0x0e76('0x51')]['id']){delete _0x214ccc['body']['id'];}return db[_0x0e76('0x2e')][_0x0e76('0x48')]({'where':{'id':_0x214ccc['params']['id']}})[_0x0e76('0x24')](handleEntityNotFound(_0x244de4,null))[_0x0e76('0x24')](saveUpdates(_0x214ccc[_0x0e76('0x51')],null))[_0x0e76('0x24')](respondWithResult(_0x244de4,null))[_0x0e76('0x43')](handleError(_0x244de4,null));};exports[_0x0e76('0x25')]=function(_0x4e1b46,_0x381c4d){return db[_0x0e76('0x2e')][_0x0e76('0x48')]({'where':{'id':_0x4e1b46[_0x0e76('0x52')]['id']}})[_0x0e76('0x24')](handleEntityNotFound(_0x381c4d,null))[_0x0e76('0x24')](removeEntity(_0x381c4d,null))[_0x0e76('0x43')](handleError(_0x381c4d,null));};
\ No newline at end of file
+var _0xa614=['pick','filter','type','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','map','CmHopperAdditionalPhone','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where'];(function(_0x17a83e,_0x471b30){var _0x56683e=function(_0x44e103){while(--_0x44e103){_0x17a83e['push'](_0x17a83e['shift']());}};_0x56683e(++_0x471b30);}(_0xa614,0x6d));var _0x4a61=function(_0x4d2263,_0x3fbf0d){_0x4d2263=_0x4d2263-0x0;var _0x24aba0=_0xa614[_0x4d2263];return _0x24aba0;};'use strict';var emlformat=require(_0x4a61('0x0'));var rimraf=require(_0x4a61('0x1'));var zipdir=require(_0x4a61('0x2'));var jsonpatch=require(_0x4a61('0x3'));var rp=require('request-promise');var moment=require(_0x4a61('0x4'));var BPromise=require(_0x4a61('0x5'));var Mustache=require(_0x4a61('0x6'));var util=require(_0x4a61('0x7'));var path=require('path');var sox=require(_0x4a61('0x8'));var csv=require(_0x4a61('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a61('0xa'));var _=require(_0x4a61('0xb'));var squel=require(_0x4a61('0xc'));var crypto=require(_0x4a61('0xd'));var jsforce=require(_0x4a61('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4a61('0x9'));var querystring=require(_0x4a61('0xf'));var Papa=require(_0x4a61('0x10'));var Redis=require(_0x4a61('0x11'));var authService=require(_0x4a61('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4a61('0x13'));var logger=require(_0x4a61('0x14'))(_0x4a61('0x15'));var utils=require(_0x4a61('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4a61('0x17'));var db=require(_0x4a61('0x18'))['db'];function respondWithStatusCode(_0x11e345,_0x398761){_0x398761=_0x398761||0xcc;return function(_0x2a74fd){if(_0x2a74fd){return _0x11e345[_0x4a61('0x19')](_0x398761);}return _0x11e345[_0x4a61('0x1a')](_0x398761)[_0x4a61('0x1b')]();};}function respondWithResult(_0x4b099a,_0x34f5bc){_0x34f5bc=_0x34f5bc||0xc8;return function(_0x544646){if(_0x544646){return _0x4b099a[_0x4a61('0x1a')](_0x34f5bc)[_0x4a61('0x1c')](_0x544646);}};}function respondWithFilteredResult(_0x2bcf7a,_0x4666a2){return function(_0x987bf1){if(_0x987bf1){var _0x342064=typeof _0x4666a2[_0x4a61('0x1d')]===_0x4a61('0x1e')&&typeof _0x4666a2[_0x4a61('0x1f')]===_0x4a61('0x1e');var _0x3498e6=_0x987bf1[_0x4a61('0x20')];var _0x1aa3f6=_0x342064?0x0:_0x4666a2['offset'];var _0x1ef091=_0x342064?_0x987bf1[_0x4a61('0x20')]:_0x4666a2['offset']+_0x4666a2[_0x4a61('0x1f')];var _0xd541f3;if(_0x1ef091>=_0x3498e6){_0x1ef091=_0x3498e6;_0xd541f3=0xc8;}else{_0xd541f3=0xce;}_0x2bcf7a[_0x4a61('0x1a')](_0xd541f3);return _0x2bcf7a[_0x4a61('0x21')](_0x4a61('0x22'),_0x1aa3f6+'-'+_0x1ef091+'/'+_0x3498e6)[_0x4a61('0x1c')](_0x987bf1);}return null;};}function patchUpdates(_0x57260f){return function(_0x5a10f0){try{jsonpatch[_0x4a61('0x23')](_0x5a10f0,_0x57260f,!![]);}catch(_0x478bd8){return BPromise['reject'](_0x478bd8);}return _0x5a10f0[_0x4a61('0x24')]();};}function saveUpdates(_0x4ae537,_0x1dad2d){return function(_0x55daea){if(_0x55daea){return _0x55daea[_0x4a61('0x25')](_0x4ae537)[_0x4a61('0x26')](function(_0x1ac76b){return _0x1ac76b;});}return null;};}function removeEntity(_0x266975,_0x1a49a9){return function(_0x3a8027){if(_0x3a8027){return _0x3a8027[_0x4a61('0x27')]()[_0x4a61('0x26')](function(){var _0x568d64=_0x3a8027[_0x4a61('0x28')]({'plain':!![]});var _0xfe2fa=_0x4a61('0x29');return db[_0x4a61('0x2a')][_0x4a61('0x27')]({'where':{'type':_0xfe2fa,'resourceId':_0x568d64['id']}})[_0x4a61('0x26')](function(){return _0x3a8027;});})['then'](function(){_0x266975[_0x4a61('0x1a')](0xcc)[_0x4a61('0x1b')]();});}};}function handleEntityNotFound(_0x22e65f,_0x46153a){return function(_0x12e36c){if(!_0x12e36c){_0x22e65f['sendStatus'](0x194);}return _0x12e36c;};}function handleError(_0x20fb40,_0x514e30){_0x514e30=_0x514e30||0x1f4;return function(_0x204b56){logger[_0x4a61('0x2b')](_0x204b56[_0x4a61('0x2c')]);if(_0x204b56[_0x4a61('0x2d')]){delete _0x204b56['name'];}_0x20fb40[_0x4a61('0x1a')](_0x514e30)[_0x4a61('0x2e')](_0x204b56);};}exports['index']=function(_0x2933ac,_0x471c2c){var _0xa54dfe={},_0x40b47a={},_0x55f1d6={'count':0x0,'rows':[]};var _0x2699bc=_[_0x4a61('0x2f')](db[_0x4a61('0x30')][_0x4a61('0x31')],function(_0x99f6e8){return{'name':_0x99f6e8[_0x4a61('0x32')],'type':_0x99f6e8['type'][_0x4a61('0x33')]};});_0x40b47a[_0x4a61('0x34')]=_[_0x4a61('0x2f')](_0x2699bc,_0x4a61('0x2d'));_0x40b47a[_0x4a61('0x35')]=_[_0x4a61('0x36')](_0x2933ac[_0x4a61('0x35')]);_0x40b47a[_0x4a61('0x37')]=_['intersection'](_0x40b47a[_0x4a61('0x34')],_0x40b47a[_0x4a61('0x35')]);_0xa54dfe[_0x4a61('0x38')]=_[_0x4a61('0x39')](_0x40b47a['model'],qs[_0x4a61('0x3a')](_0x2933ac[_0x4a61('0x35')]['fields']));_0xa54dfe[_0x4a61('0x38')]=_0xa54dfe[_0x4a61('0x38')]['length']?_0xa54dfe[_0x4a61('0x38')]:_0x40b47a[_0x4a61('0x34')];if(!_0x2933ac['query'][_0x4a61('0x3b')]('nolimit')){_0xa54dfe[_0x4a61('0x1f')]=qs[_0x4a61('0x1f')](_0x2933ac[_0x4a61('0x35')]['limit']);_0xa54dfe['offset']=qs[_0x4a61('0x1d')](_0x2933ac['query'][_0x4a61('0x1d')]);}_0xa54dfe[_0x4a61('0x3c')]=qs['sort'](_0x2933ac[_0x4a61('0x35')][_0x4a61('0x3d')]);_0xa54dfe[_0x4a61('0x3e')]=qs[_0x4a61('0x37')](_[_0x4a61('0x3f')](_0x2933ac['query'],_0x40b47a[_0x4a61('0x37')]),_0x2699bc);if(_0x2933ac[_0x4a61('0x35')][_0x4a61('0x40')]){_0xa54dfe[_0x4a61('0x3e')]=_['merge'](_0xa54dfe[_0x4a61('0x3e')],{'$or':_[_0x4a61('0x2f')](_0x2699bc,function(_0x36e268){if(_0x36e268[_0x4a61('0x41')]!==_0x4a61('0x42')){var _0x425d61={};_0x425d61[_0x36e268[_0x4a61('0x2d')]]={'$like':'%'+_0x2933ac[_0x4a61('0x35')][_0x4a61('0x40')]+'%'};return _0x425d61;}})});}_0xa54dfe=_['merge']({},_0xa54dfe,_0x2933ac[_0x4a61('0x43')]);var _0x27d0b1={'where':_0xa54dfe[_0x4a61('0x3e')]};return db[_0x4a61('0x30')][_0x4a61('0x20')](_0x27d0b1)[_0x4a61('0x26')](function(_0x440319){_0x55f1d6['count']=_0x440319;if(_0x2933ac[_0x4a61('0x35')]['includeAll']){_0xa54dfe[_0x4a61('0x44')]=[{'all':!![]}];}return db[_0x4a61('0x30')][_0x4a61('0x45')](_0xa54dfe);})[_0x4a61('0x26')](function(_0x296a3c){_0x55f1d6['rows']=_0x296a3c;return _0x55f1d6;})['then'](respondWithFilteredResult(_0x471c2c,_0xa54dfe))[_0x4a61('0x46')](handleError(_0x471c2c,null));};exports[_0x4a61('0x47')]=function(_0xef357,_0x20abe4){var _0x2bbf28={'raw':!![],'where':{'id':_0xef357[_0x4a61('0x48')]['id']}},_0x398ea5={};_0x398ea5[_0x4a61('0x34')]=_[_0x4a61('0x36')](db['CmHopperAdditionalPhone']['rawAttributes']);_0x398ea5['query']=_['keys'](_0xef357['query']);_0x398ea5[_0x4a61('0x37')]=_[_0x4a61('0x39')](_0x398ea5[_0x4a61('0x34')],_0x398ea5[_0x4a61('0x35')]);_0x2bbf28[_0x4a61('0x38')]=_['intersection'](_0x398ea5['model'],qs[_0x4a61('0x3a')](_0xef357[_0x4a61('0x35')][_0x4a61('0x3a')]));_0x2bbf28[_0x4a61('0x38')]=_0x2bbf28[_0x4a61('0x38')][_0x4a61('0x49')]?_0x2bbf28[_0x4a61('0x38')]:_0x398ea5[_0x4a61('0x34')];if(_0xef357[_0x4a61('0x35')][_0x4a61('0x4a')]){_0x2bbf28[_0x4a61('0x44')]=[{'all':!![]}];}_0x2bbf28=_[_0x4a61('0x4b')]({},_0x2bbf28,_0xef357[_0x4a61('0x43')]);return db[_0x4a61('0x30')][_0x4a61('0x4c')](_0x2bbf28)[_0x4a61('0x26')](handleEntityNotFound(_0x20abe4,null))[_0x4a61('0x26')](respondWithResult(_0x20abe4,null))[_0x4a61('0x46')](handleError(_0x20abe4,null));};exports[_0x4a61('0x4d')]=function(_0x1090b3,_0x25a66a){return db[_0x4a61('0x30')][_0x4a61('0x4d')](_0x1090b3[_0x4a61('0x4e')],{})[_0x4a61('0x26')](function(_0x1f76b2){var _0x372540=_0x1090b3[_0x4a61('0x4f')][_0x4a61('0x28')]({'plain':!![]});if(!_0x372540)throw new Error(_0x4a61('0x50'));if(_0x372540[_0x4a61('0x51')]===_0x4a61('0x4f')){var _0x3a3adc=_0x1f76b2[_0x4a61('0x28')]({'plain':!![]});var _0xa285fe=_0x4a61('0x29');return db[_0x4a61('0x52')]['find']({'where':{'name':_0xa285fe,'userProfileId':_0x372540[_0x4a61('0x53')]},'raw':!![]})[_0x4a61('0x26')](function(_0x11a8e0){if(_0x11a8e0&&_0x11a8e0[_0x4a61('0x54')]===0x0){return db['UserProfileResource'][_0x4a61('0x4d')]({'name':_0x3a3adc[_0x4a61('0x2d')],'resourceId':_0x3a3adc['id'],'type':_0x11a8e0[_0x4a61('0x2d')],'sectionId':_0x11a8e0['id']},{})[_0x4a61('0x26')](function(){return _0x1f76b2;});}else{return _0x1f76b2;}})[_0x4a61('0x46')](function(_0x570801){logger['error'](_0x4a61('0x55'),_0x570801);throw _0x570801;});}return _0x1f76b2;})[_0x4a61('0x26')](respondWithResult(_0x25a66a,0xc9))['catch'](handleError(_0x25a66a,null));};exports[_0x4a61('0x25')]=function(_0x2f2432,_0x54e73a){if(_0x2f2432[_0x4a61('0x4e')]['id']){delete _0x2f2432[_0x4a61('0x4e')]['id'];}return db['CmHopperAdditionalPhone'][_0x4a61('0x4c')]({'where':{'id':_0x2f2432[_0x4a61('0x48')]['id']}})['then'](handleEntityNotFound(_0x54e73a,null))[_0x4a61('0x26')](saveUpdates(_0x2f2432[_0x4a61('0x4e')],null))[_0x4a61('0x26')](respondWithResult(_0x54e73a,null))[_0x4a61('0x46')](handleError(_0x54e73a,null));};exports[_0x4a61('0x27')]=function(_0x5e79b7,_0x3373a8){return db[_0x4a61('0x30')][_0x4a61('0x4c')]({'where':{'id':_0x5e79b7[_0x4a61('0x48')]['id']}})['then'](handleEntityNotFound(_0x3373a8,null))[_0x4a61('0x26')](removeEntity(_0x3373a8,null))[_0x4a61('0x46')](handleError(_0x3373a8,null));};
\ No newline at end of file
index 66df14a..a35d23d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d3f=['cm_hopper_additional_phones','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x0d3f,0x1d5));var _0xf0d3=function(_0x11deef,_0x34bbdb){_0x11deef=_0x11deef-0x0;var _0xe9ba85=_0x0d3f[_0x11deef];return _0xe9ba85;};'use strict';var _=require(_0xf0d3('0x0'));var util=require('util');var logger=require(_0xf0d3('0x1'))(_0xf0d3('0x2'));var moment=require(_0xf0d3('0x3'));var BPromise=require(_0xf0d3('0x4'));var rp=require(_0xf0d3('0x5'));var fs=require('fs');var path=require(_0xf0d3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf0d3('0x7'));module[_0xf0d3('0x8')]=function(_0x5ce5a2,_0x3bf2ba){return _0x5ce5a2[_0xf0d3('0x9')](_0xf0d3('0xa'),attributes,{'tableName':_0xf0d3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8b5b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','CmHopperAdditionalPhone','cm_hopper_additional_phones','../../config/logger'];(function(_0x30edbb,_0x3fb273){var _0x198361=function(_0x36e26b){while(--_0x36e26b){_0x30edbb['push'](_0x30edbb['shift']());}};_0x198361(++_0x3fb273);}(_0x8b5b,0x137));var _0xb8b5=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8b5b[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb8b5('0x0'))(_0xb8b5('0x1'));var moment=require(_0xb8b5('0x2'));var BPromise=require(_0xb8b5('0x3'));var rp=require(_0xb8b5('0x4'));var fs=require('fs');var path=require(_0xb8b5('0x5'));var rimraf=require(_0xb8b5('0x6'));var config=require(_0xb8b5('0x7'));var attributes=require(_0xb8b5('0x8'));module[_0xb8b5('0x9')]=function(_0x2a02e9,_0xb474f8){return _0x2a02e9['define'](_0xb8b5('0xa'),attributes,{'tableName':_0xb8b5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9d3019a..a06da5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1903=['countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','phone','countcongestionretry','createdAt','updatedAt','sequelize','update','IncrementPreviewCounters','lodash','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','stringify','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','catch','VerifyAdditionalPhones','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','findOne','OrderBy','ASC','countbusyretry'];(function(_0xb74c89,_0x246040){var _0xe4ccef=function(_0x12b652){while(--_0x12b652){_0xb74c89['push'](_0xb74c89['shift']());}};_0xe4ccef(++_0x246040);}(_0x1903,0xe6));var _0x3190=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1903[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3190('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3190('0x1'));var db=require(_0x3190('0x2'))['db'];var utils=require(_0x3190('0x3'));var logger=require('../../config/logger')(_0x3190('0x4'));var config=require(_0x3190('0x5'));var jayson=require(_0x3190('0x6'));var client=jayson['client'][_0x3190('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5033b,_0x1bae99,_0x506b76){return new BPromise(function(_0x1af23b,_0x35c032){return client[_0x3190('0x8')](_0x5033b,_0x506b76)['then'](function(_0x33fbdf){logger[_0x3190('0x9')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1bae99,_0x3190('0xa'));logger['debug']('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x1bae99,_0x3190('0xa'),JSON[_0x3190('0xb')](_0x33fbdf));if(_0x33fbdf[_0x3190('0xc')]){if(_0x33fbdf[_0x3190('0xc')][_0x3190('0xd')]===0x1f4){logger[_0x3190('0xc')](_0x3190('0xe'),_0x1bae99,_0x33fbdf['error']['message']);return _0x35c032(_0x33fbdf[_0x3190('0xc')][_0x3190('0xf')]);}logger[_0x3190('0xc')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x1bae99,_0x33fbdf[_0x3190('0xc')]['message']);return _0x1af23b(_0x33fbdf[_0x3190('0xc')][_0x3190('0xf')]);}else{logger[_0x3190('0x9')](_0x3190('0xe'),_0x1bae99,_0x3190('0xa'));_0x1af23b(_0x33fbdf['result'][_0x3190('0xf')]);}})[_0x3190('0x10')](function(_0xfd2707){logger['error'](_0x3190('0xe'),_0x1bae99,_0xfd2707);_0x35c032(_0xfd2707);});});}exports[_0x3190('0x11')]=function(_0x41c39b){var _0x421b30=this;return new Promise(function(_0x473d01,_0x28d873){return db[_0x3190('0x12')]['findOne']({'raw':!![],'where':{'ContactId':_0x41c39b[_0x3190('0x13')][_0x3190('0x14')],'ListId':_0x41c39b[_0x3190('0x13')][_0x3190('0x15')],'VoiceQueueId':_0x41c39b[_0x3190('0x13')][_0x3190('0x16')]===undefined?null:_0x41c39b['body'][_0x3190('0x16')],'CampaignId':_0x41c39b[_0x3190('0x13')][_0x3190('0x17')]===undefined?null:_0x41c39b[_0x3190('0x13')][_0x3190('0x17')]}})[_0x3190('0x18')](function(_0x2029cf){if(_0x2029cf!=null){return db[_0x3190('0x19')][_0x3190('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x2029cf['id'],'OrderBy':{'$gt':_0x2029cf[_0x3190('0x1b')]}},'order':[[_0x3190('0x1b'),_0x3190('0x1c')]]})['then'](function(_0x594366){var _0x5eec6e=0x0;if(_0x594366){if(_0x594366[_0x3190('0x1d')]+_0x594366['countcongestionretry']+_0x594366[_0x3190('0x1e')]+_0x594366[_0x3190('0x1f')]+_0x594366[_0x3190('0x20')]+_0x594366[_0x3190('0x21')]+_0x594366['countmachineretry']+_0x594366['countagentrejectretry']<_0x41c39b['entity']['dialGlobalMaxRetry'])_0x5eec6e=0x1;_0x473d01({'additional':_0x5eec6e});}else{return db[_0x3190('0x19')][_0x3190('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x2029cf['id']},'order':[[_0x3190('0x1b'),_0x3190('0x1c')]]})['then'](function(_0x20d9e6){var _0x51eeea=0x0;if(_0x20d9e6){if(_0x20d9e6[_0x3190('0x1d')]+_0x20d9e6['countcongestionretry']+_0x20d9e6[_0x3190('0x1e')]+_0x20d9e6[_0x3190('0x1f')]+_0x20d9e6[_0x3190('0x20')]+_0x20d9e6[_0x3190('0x21')]+_0x20d9e6[_0x3190('0x22')]+_0x20d9e6[_0x3190('0x23')]<_0x41c39b[_0x3190('0x24')][_0x3190('0x25')])_0x51eeea=0x1;_0x473d01({'additional':_0x51eeea});}else{_0x473d01({'additional':0x0});}})[_0x3190('0x10')](function(_0x86362a){logger[_0x3190('0xc')](_0x3190('0x11'),_0x86362a[_0x3190('0xf')]);_0x28d873(_0x421b30['error'](0x1f4,_0x86362a[_0x3190('0xf')]));});}})[_0x3190('0x10')](function(_0x42c7e5){logger[_0x3190('0xc')](_0x3190('0x11'),_0x42c7e5[_0x3190('0xf')]);_0x28d873(_0x421b30[_0x3190('0xc')](0x1f4,_0x42c7e5[_0x3190('0xf')]));});}else _0x473d01({'additional':0x0});});});};exports[_0x3190('0x26')]=function(_0x3e16ef){var _0x14955a=this;return new Promise(function(_0x5507b7,_0x532f70){return db[_0x3190('0x12')][_0x3190('0x1a')]({'raw':!![],'where':{'ContactId':_0x3e16ef['body'][_0x3190('0x14')],'ListId':_0x3e16ef[_0x3190('0x13')][_0x3190('0x15')],'VoiceQueueId':_0x3e16ef[_0x3190('0x13')]['VoiceQueueId']===undefined?null:_0x3e16ef[_0x3190('0x13')][_0x3190('0x16')],'CampaignId':_0x3e16ef[_0x3190('0x13')][_0x3190('0x17')]===undefined?null:_0x3e16ef[_0x3190('0x13')][_0x3190('0x17')]}})[_0x3190('0x18')](function(_0x476939){if(_0x476939!=null){return db[_0x3190('0x19')][_0x3190('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x476939['id'],'OrderBy':{'$gte':_0x476939[_0x3190('0x1b')]}},'order':[[_0x3190('0x1b'),_0x3190('0x1c')]]})[_0x3190('0x18')](function(_0x85aae7){if(_0x85aae7)return activateAdditionalPhone(_0x476939,_0x3e16ef['body'],_0x85aae7,_0x3e16ef[_0x3190('0x27')],_0x3e16ef[_0x3190('0x28')])['then'](function(_0x4807b7){_0x5507b7(_0x4807b7);});else{return db[_0x3190('0x19')][_0x3190('0x1a')]({'raw':!![],'where':{'CmHopperId':_0x476939['id']},'order':[[_0x3190('0x1b'),_0x3190('0x1c')]]})['then'](function(_0xbea6d6){if(_0xbea6d6)return activateAdditionalPhone(_0x476939,_0x3e16ef[_0x3190('0x13')],_0xbea6d6,_0x3e16ef[_0x3190('0x27')],_0x3e16ef[_0x3190('0x28')])[_0x3190('0x18')](function(_0x133d15){_0x5507b7(_0x133d15);});else{_0x5507b7({'id':_0x476939['id'],'phone':''});}})[_0x3190('0x10')](function(_0x5780e3){logger['error'](_0x3190('0x11'),_0x5780e3[_0x3190('0xf')]);_0x532f70(_0x14955a['error'](0x1f4,_0x5780e3[_0x3190('0xf')]));});}})[_0x3190('0x10')](function(_0x781ebc){logger[_0x3190('0xc')]('VerifyAdditionalPhones',_0x781ebc[_0x3190('0xf')]);_0x532f70(_0x14955a[_0x3190('0xc')](0x1f4,_0x781ebc['message']));});}else _0x5507b7(0x1);});});};function activateAdditionalPhone(_0x55bab7,_0x57f194,_0x2a0661,_0x43764d,_0xae4b02){return new Promise(function(_0x5c7d54,_0x5d6284){var _0x50c6a2;if(_[_0x3190('0x29')](_0x2a0661[_0x3190('0x2a')])){_0x2a0661[_0x3190('0x2a')]=moment();}if(moment()>moment(_0x2a0661[_0x3190('0x2a')])){_0x50c6a2=moment()['add'](_0xae4b02||0x3,'minutes');}else{if(_0x2a0661[_0x3190('0x1b')]==0x0){_0x50c6a2=moment(_0x2a0661[_0x3190('0x2a')]);}else{_0x50c6a2=moment()[_0x3190('0x2b')](_0xae4b02||0x3,_0x3190('0x2c'));}}if(_['isNil'](_0x50c6a2)){_0x50c6a2=moment()[_0x3190('0x2b')](_0xae4b02||0x3,_0x3190('0x2c'));}var _0x263593={'phone':_0x55bab7[_0x3190('0x2d')],'active':0x0,'OrderBy':_['isNil'](_0x55bab7[_0x3190('0x1b')])?0x0:_0x55bab7[_0x3190('0x1b')],'scheduledat':moment()['add'](_0x43764d||0x1,_0x3190('0x2c')),'countbusyretry':_0x57f194[_0x3190('0x1d')],'countcongestionretry':_0x57f194[_0x3190('0x2e')],'countnoanswerretry':_0x57f194[_0x3190('0x1e')],'countnosuchnumberretry':_0x57f194[_0x3190('0x1f')],'countdropretry':_0x57f194[_0x3190('0x20')],'countabandonedretry':_0x57f194[_0x3190('0x21')],'countmachineretry':_0x57f194[_0x3190('0x22')],'countagentrejectretry':_0x57f194[_0x3190('0x23')],'createdAt':_0x57f194[_0x3190('0x2f')],'updatedAt':_0x57f194[_0x3190('0x30')]};var _0x5bd9fd={'CmHopperId':_0x55bab7['id'],'phone':_0x2a0661[_0x3190('0x2d')],'active':0x0,'OrderBy':_[_0x3190('0x29')](_0x2a0661[_0x3190('0x1b')])?0x0:_0x2a0661[_0x3190('0x1b')],'scheduledat':_0x50c6a2,'countbusyretry':_0x2a0661[_0x3190('0x1d')],'countcongestionretry':_0x2a0661[_0x3190('0x2e')],'countnoanswerretry':_0x2a0661[_0x3190('0x1e')],'countnosuchnumberretry':_0x2a0661[_0x3190('0x1f')],'countdropretry':_0x2a0661[_0x3190('0x20')],'countabandonedretry':_0x2a0661['countabandonedretry'],'countmachineretry':_0x2a0661['countmachineretry'],'countagentrejectretry':_0x2a0661['countagentrejectretry'],'createdAt':_0x2a0661['createdAt'],'updatedAt':_0x2a0661[_0x3190('0x30')]};return db[_0x3190('0x31')]['transaction'](function(_0x50cae9){return db[_0x3190('0x19')]['update'](_0x263593,{'where':{'id':_0x2a0661['id']}},{'transaction':_0x50cae9})[_0x3190('0x18')](function(){return db[_0x3190('0x12')][_0x3190('0x32')](_0x5bd9fd,{'where':{'id':_0x55bab7['id']}},{'transaction':_0x50cae9});});})[_0x3190('0x18')](function(_0x5523c4){_0x5c7d54({'id':_0x55bab7['id'],'phone':_0x2a0661[_0x3190('0x2d')]});})['catch'](function(_0x57a7bb){logger[_0x3190('0xc')]('activateAdditionalPhone',_0x57a7bb[_0x3190('0xf')]);_0x5d6284({'error':_0x57a7bb['message']});});});}exports[_0x3190('0x33')]=function(_0x3f6add){var _0x27b5a7=this;return new Promise(function(_0x2e9ac5,_0xe7f82f){return db[_0x3190('0x12')][_0x3190('0x32')](_0x3f6add[_0x3190('0x13')]['field'],{'where':{'id':_0x3f6add[_0x3190('0x13')]['id']}})['then'](function(_0x29825a){_0x2e9ac5(_0x29825a);})[_0x3190('0x10')](function(_0x120c5b){logger['error'](_0x3190('0x33'),_0x120c5b[_0x3190('0xf')]);_0xe7f82f(_0x27b5a7[_0x3190('0xc')](0x1f4,_0x120c5b[_0x3190('0xf')]));});});};
\ No newline at end of file
+var _0xc8a9=['createdAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmHopperAdditionalPhone,\x20%s,\x20%s','message','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','ASC','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','OrderBy','entity','dialGlobalMaxRetry','duration','waitTime','scheduledat','add','minutes','phone','countnoanswerretry','updatedAt','isNil','countagentrejectretry'];(function(_0x1098db,_0x39ba6b){var _0x14f090=function(_0x473ffe){while(--_0x473ffe){_0x1098db['push'](_0x1098db['shift']());}};_0x14f090(++_0x39ba6b);}(_0xc8a9,0x128));var _0x9c8a=function(_0x56a444,_0x3e116c){_0x56a444=_0x56a444-0x0;var _0x33e043=_0xc8a9[_0x56a444];return _0x33e043;};'use strict';var _=require(_0x9c8a('0x0'));var util=require(_0x9c8a('0x1'));var moment=require(_0x9c8a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9c8a('0x3'));var db=require(_0x9c8a('0x4'))['db'];var utils=require(_0x9c8a('0x5'));var logger=require(_0x9c8a('0x6'))(_0x9c8a('0x7'));var config=require(_0x9c8a('0x8'));var jayson=require(_0x9c8a('0x9'));var client=jayson[_0x9c8a('0xa')][_0x9c8a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2400c3,_0x46cbec,_0x1e88ba){return new BPromise(function(_0x2195c9,_0x53c907){return client[_0x9c8a('0xc')](_0x2400c3,_0x1e88ba)[_0x9c8a('0xd')](function(_0x53a851){logger[_0x9c8a('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x46cbec,'request\x20sent');logger['debug'](_0x9c8a('0xf'),_0x46cbec,_0x9c8a('0x10'),JSON[_0x9c8a('0x11')](_0x53a851));if(_0x53a851[_0x9c8a('0x12')]){if(_0x53a851['error'][_0x9c8a('0x13')]===0x1f4){logger[_0x9c8a('0x12')](_0x9c8a('0x14'),_0x46cbec,_0x53a851[_0x9c8a('0x12')][_0x9c8a('0x15')]);return _0x53c907(_0x53a851[_0x9c8a('0x12')][_0x9c8a('0x15')]);}logger[_0x9c8a('0x12')](_0x9c8a('0x14'),_0x46cbec,_0x53a851[_0x9c8a('0x12')][_0x9c8a('0x15')]);return _0x2195c9(_0x53a851[_0x9c8a('0x12')]['message']);}else{logger[_0x9c8a('0xe')](_0x9c8a('0x14'),_0x46cbec,_0x9c8a('0x10'));_0x2195c9(_0x53a851['result'][_0x9c8a('0x15')]);}})[_0x9c8a('0x16')](function(_0x1e63ca){logger[_0x9c8a('0x12')](_0x9c8a('0x14'),_0x46cbec,_0x1e63ca);_0x53c907(_0x1e63ca);});});}exports[_0x9c8a('0x17')]=function(_0xb875e0){var _0x35c432=this;return new Promise(function(_0x219763,_0x374638){return db[_0x9c8a('0x18')][_0x9c8a('0x19')]({'raw':!![],'where':{'ContactId':_0xb875e0[_0x9c8a('0x1a')][_0x9c8a('0x1b')],'ListId':_0xb875e0[_0x9c8a('0x1a')][_0x9c8a('0x1c')],'VoiceQueueId':_0xb875e0['body'][_0x9c8a('0x1d')]===undefined?null:_0xb875e0[_0x9c8a('0x1a')][_0x9c8a('0x1d')],'CampaignId':_0xb875e0[_0x9c8a('0x1a')][_0x9c8a('0x1e')]===undefined?null:_0xb875e0[_0x9c8a('0x1a')][_0x9c8a('0x1e')]}})[_0x9c8a('0xd')](function(_0x47a3e0){if(_0x47a3e0!=null){return db[_0x9c8a('0x1f')][_0x9c8a('0x19')]({'raw':!![],'where':{'CmHopperId':_0x47a3e0['id'],'OrderBy':{'$gt':_0x47a3e0['OrderBy']}},'order':[['OrderBy',_0x9c8a('0x20')]]})[_0x9c8a('0xd')](function(_0x4126b8){var _0x3a5b66=0x0;if(_0x4126b8){if(_0x4126b8[_0x9c8a('0x21')]+_0x4126b8[_0x9c8a('0x22')]+_0x4126b8['countnoanswerretry']+_0x4126b8[_0x9c8a('0x23')]+_0x4126b8[_0x9c8a('0x24')]+_0x4126b8[_0x9c8a('0x25')]+_0x4126b8[_0x9c8a('0x26')]+_0x4126b8['countagentrejectretry']<_0xb875e0['entity']['dialGlobalMaxRetry'])_0x3a5b66=0x1;_0x219763({'additional':_0x3a5b66});}else{return db[_0x9c8a('0x1f')][_0x9c8a('0x19')]({'raw':!![],'where':{'CmHopperId':_0x47a3e0['id']},'order':[[_0x9c8a('0x27'),_0x9c8a('0x20')]]})[_0x9c8a('0xd')](function(_0xc912f4){var _0x19b842=0x0;if(_0xc912f4){if(_0xc912f4[_0x9c8a('0x21')]+_0xc912f4[_0x9c8a('0x22')]+_0xc912f4['countnoanswerretry']+_0xc912f4[_0x9c8a('0x23')]+_0xc912f4['countdropretry']+_0xc912f4['countabandonedretry']+_0xc912f4[_0x9c8a('0x26')]+_0xc912f4['countagentrejectretry']<_0xb875e0[_0x9c8a('0x28')][_0x9c8a('0x29')])_0x19b842=0x1;_0x219763({'additional':_0x19b842});}else{_0x219763({'additional':0x0});}})[_0x9c8a('0x16')](function(_0x1325de){logger['error'](_0x9c8a('0x17'),_0x1325de[_0x9c8a('0x15')]);_0x374638(_0x35c432[_0x9c8a('0x12')](0x1f4,_0x1325de[_0x9c8a('0x15')]));});}})[_0x9c8a('0x16')](function(_0x2dd6ad){logger[_0x9c8a('0x12')](_0x9c8a('0x17'),_0x2dd6ad['message']);_0x374638(_0x35c432[_0x9c8a('0x12')](0x1f4,_0x2dd6ad['message']));});}else _0x219763({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x1b6713){var _0x44d78d=this;return new Promise(function(_0x4ecd87,_0x4357dc){return db[_0x9c8a('0x18')][_0x9c8a('0x19')]({'raw':!![],'where':{'ContactId':_0x1b6713[_0x9c8a('0x1a')][_0x9c8a('0x1b')],'ListId':_0x1b6713[_0x9c8a('0x1a')][_0x9c8a('0x1c')],'VoiceQueueId':_0x1b6713['body'][_0x9c8a('0x1d')]===undefined?null:_0x1b6713[_0x9c8a('0x1a')][_0x9c8a('0x1d')],'CampaignId':_0x1b6713[_0x9c8a('0x1a')][_0x9c8a('0x1e')]===undefined?null:_0x1b6713[_0x9c8a('0x1a')][_0x9c8a('0x1e')]}})[_0x9c8a('0xd')](function(_0x4c44da){if(_0x4c44da!=null){return db[_0x9c8a('0x1f')][_0x9c8a('0x19')]({'raw':!![],'where':{'CmHopperId':_0x4c44da['id'],'OrderBy':{'$gte':_0x4c44da['OrderBy']}},'order':[[_0x9c8a('0x27'),_0x9c8a('0x20')]]})[_0x9c8a('0xd')](function(_0x4146a7){if(_0x4146a7)return activateAdditionalPhone(_0x4c44da,_0x1b6713[_0x9c8a('0x1a')],_0x4146a7,_0x1b6713[_0x9c8a('0x2a')],_0x1b6713['waitTime'])[_0x9c8a('0xd')](function(_0x5f2ffc){_0x4ecd87(_0x5f2ffc);});else{return db[_0x9c8a('0x1f')][_0x9c8a('0x19')]({'raw':!![],'where':{'CmHopperId':_0x4c44da['id']},'order':[[_0x9c8a('0x27'),'ASC']]})[_0x9c8a('0xd')](function(_0x1b507e){if(_0x1b507e)return activateAdditionalPhone(_0x4c44da,_0x1b6713[_0x9c8a('0x1a')],_0x1b507e,_0x1b6713[_0x9c8a('0x2a')],_0x1b6713[_0x9c8a('0x2b')])[_0x9c8a('0xd')](function(_0x3a4b3f){_0x4ecd87(_0x3a4b3f);});else{_0x4ecd87({'id':_0x4c44da['id'],'phone':''});}})[_0x9c8a('0x16')](function(_0x4a39bf){logger[_0x9c8a('0x12')](_0x9c8a('0x17'),_0x4a39bf[_0x9c8a('0x15')]);_0x4357dc(_0x44d78d['error'](0x1f4,_0x4a39bf[_0x9c8a('0x15')]));});}})[_0x9c8a('0x16')](function(_0x33e7f4){logger['error']('VerifyAdditionalPhones',_0x33e7f4[_0x9c8a('0x15')]);_0x4357dc(_0x44d78d[_0x9c8a('0x12')](0x1f4,_0x33e7f4[_0x9c8a('0x15')]));});}else _0x4ecd87(0x1);});});};function activateAdditionalPhone(_0x41cbab,_0x134e6c,_0x281874,_0x42a9c0,_0xb99486){return new Promise(function(_0x58a348,_0x1dc140){var _0x8e33e0;if(_['isNil'](_0x281874['scheduledat'])){_0x281874[_0x9c8a('0x2c')]=moment();}if(moment()>moment(_0x281874[_0x9c8a('0x2c')])){_0x8e33e0=moment()[_0x9c8a('0x2d')](_0xb99486||0x3,_0x9c8a('0x2e'));}else{if(_0x281874[_0x9c8a('0x27')]==0x0){_0x8e33e0=moment(_0x281874[_0x9c8a('0x2c')]);}else{_0x8e33e0=moment()[_0x9c8a('0x2d')](_0xb99486||0x3,_0x9c8a('0x2e'));}}if(_['isNil'](_0x8e33e0)){_0x8e33e0=moment()[_0x9c8a('0x2d')](_0xb99486||0x3,_0x9c8a('0x2e'));}var _0x2086d8={'phone':_0x41cbab[_0x9c8a('0x2f')],'active':0x0,'OrderBy':_['isNil'](_0x41cbab[_0x9c8a('0x27')])?0x0:_0x41cbab[_0x9c8a('0x27')],'scheduledat':moment()[_0x9c8a('0x2d')](_0x42a9c0||0x1,_0x9c8a('0x2e')),'countbusyretry':_0x134e6c['countbusyretry'],'countcongestionretry':_0x134e6c[_0x9c8a('0x22')],'countnoanswerretry':_0x134e6c[_0x9c8a('0x30')],'countnosuchnumberretry':_0x134e6c[_0x9c8a('0x23')],'countdropretry':_0x134e6c[_0x9c8a('0x24')],'countabandonedretry':_0x134e6c['countabandonedretry'],'countmachineretry':_0x134e6c[_0x9c8a('0x26')],'countagentrejectretry':_0x134e6c['countagentrejectretry'],'createdAt':_0x134e6c['createdAt'],'updatedAt':_0x134e6c[_0x9c8a('0x31')]};var _0x11fce0={'CmHopperId':_0x41cbab['id'],'phone':_0x281874[_0x9c8a('0x2f')],'active':0x0,'OrderBy':_[_0x9c8a('0x32')](_0x281874['OrderBy'])?0x0:_0x281874[_0x9c8a('0x27')],'scheduledat':_0x8e33e0,'countbusyretry':_0x281874['countbusyretry'],'countcongestionretry':_0x281874[_0x9c8a('0x22')],'countnoanswerretry':_0x281874[_0x9c8a('0x30')],'countnosuchnumberretry':_0x281874['countnosuchnumberretry'],'countdropretry':_0x281874[_0x9c8a('0x24')],'countabandonedretry':_0x281874[_0x9c8a('0x25')],'countmachineretry':_0x281874[_0x9c8a('0x26')],'countagentrejectretry':_0x281874[_0x9c8a('0x33')],'createdAt':_0x281874[_0x9c8a('0x34')],'updatedAt':_0x281874[_0x9c8a('0x31')]};return db[_0x9c8a('0x35')][_0x9c8a('0x36')](function(_0x3b9572){return db[_0x9c8a('0x1f')][_0x9c8a('0x37')](_0x2086d8,{'where':{'id':_0x281874['id']}},{'transaction':_0x3b9572})[_0x9c8a('0xd')](function(){return db[_0x9c8a('0x18')]['update'](_0x11fce0,{'where':{'id':_0x41cbab['id']}},{'transaction':_0x3b9572});});})['then'](function(_0x2b4658){_0x58a348({'id':_0x41cbab['id'],'phone':_0x281874[_0x9c8a('0x2f')]});})['catch'](function(_0x499263){logger['error'](_0x9c8a('0x38'),_0x499263[_0x9c8a('0x15')]);_0x1dc140({'error':_0x499263[_0x9c8a('0x15')]});});});}exports[_0x9c8a('0x39')]=function(_0x4364fa){var _0x1fbb9e=this;return new Promise(function(_0x14f136,_0x2a7b27){return db[_0x9c8a('0x18')][_0x9c8a('0x37')](_0x4364fa[_0x9c8a('0x1a')]['field'],{'where':{'id':_0x4364fa[_0x9c8a('0x1a')]['id']}})[_0x9c8a('0xd')](function(_0x1fd367){_0x14f136(_0x1fd367);})[_0x9c8a('0x16')](function(_0x2f1170){logger[_0x9c8a('0x12')]('IncrementPreviewCounters',_0x2f1170[_0x9c8a('0x15')]);_0x2a7b27(_0x1fbb9e[_0x9c8a('0x12')](0x1f4,_0x2f1170[_0x9c8a('0x15')]));});});};
\ No newline at end of file
index 9973f52..2c71abc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa660=['fs-extra','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x2baef7,_0x9a913f){var _0x5e4fe8=function(_0x5dfbee){while(--_0x5dfbee){_0x2baef7['push'](_0x2baef7['shift']());}};_0x5e4fe8(++_0x9a913f);}(_0xa660,0x1c6));var _0x0a66=function(_0x22881e,_0x251f15){_0x22881e=_0x22881e-0x0;var _0x26228e=_0xa660[_0x22881e];return _0x26228e;};'use strict';var multer=require(_0x0a66('0x0'));var util=require(_0x0a66('0x1'));var path=require(_0x0a66('0x2'));var timeout=require('connect-timeout');var express=require(_0x0a66('0x3'));var router=express[_0x0a66('0x4')]();var fs_extra=require(_0x0a66('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0a66('0x6'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0x0a66('0x7')]('/',auth[_0x0a66('0x8')](),controller['index']);router[_0x0a66('0x7')](_0x0a66('0x9'),auth[_0x0a66('0x8')](),controller[_0x0a66('0xa')]);router[_0x0a66('0xb')]('/',auth[_0x0a66('0x8')](),controller[_0x0a66('0xc')]);router[_0x0a66('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x0a66('0xe')]);router[_0x0a66('0xf')](_0x0a66('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x0a66('0x10')]=router;
\ No newline at end of file
+var _0x0e30=['post','create','put','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','/:id'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x0e30,0x1d5));var _0x00e3=function(_0x512d0b,_0x236dd2){_0x512d0b=_0x512d0b-0x0;var _0xb38f83=_0x0e30[_0x512d0b];return _0xb38f83;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x00e3('0x0'));var timeout=require('connect-timeout');var express=require(_0x00e3('0x1'));var router=express[_0x00e3('0x2')]();var fs_extra=require(_0x00e3('0x3'));var auth=require(_0x00e3('0x4'));var interaction=require(_0x00e3('0x5'));var config=require(_0x00e3('0x6'));var controller=require(_0x00e3('0x7'));router[_0x00e3('0x8')]('/',auth[_0x00e3('0x9')](),controller['index']);router[_0x00e3('0x8')](_0x00e3('0xa'),auth[_0x00e3('0x9')](),controller['show']);router[_0x00e3('0xb')]('/',auth['isAuthenticated'](),controller[_0x00e3('0xc')]);router[_0x00e3('0xd')]('/:id',auth[_0x00e3('0x9')](),controller['update']);router['delete'](_0x00e3('0xa'),auth[_0x00e3('0x9')](),controller[_0x00e3('0xe')]);module[_0x00e3('0xf')]=router;
\ No newline at end of file
index a940515..c06c035 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2a0=['sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x59f5bb,_0x41383d){var _0x5aba85=function(_0x5798f1){while(--_0x5798f1){_0x59f5bb['push'](_0x59f5bb['shift']());}};_0x5aba85(++_0x41383d);}(_0xf2a0,0x7d));var _0x0f2a=function(_0xf67a90,_0x2eb2f3){_0xf67a90=_0xf67a90-0x0;var _0x648b2=_0xf2a0[_0xf67a90];return _0x648b2;};'use strict';var moment=require('moment');var Sequelize=require(_0x0f2a('0x0'));module[_0x0f2a('0x1')]={'phone':{'type':Sequelize[_0x0f2a('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x0f2a('0x3')],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x0f2a('0x3')],'unique':_0x0f2a('0x4')},'VoiceQueueId':{'type':Sequelize[_0x0f2a('0x3')],'unique':'contactListQueue'}};
\ No newline at end of file
+var _0x38ec=['exports','STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x27e04b,_0x5c954b){var _0x16e544=function(_0xd10f83){while(--_0xd10f83){_0x27e04b['push'](_0x27e04b['shift']());}};_0x16e544(++_0x5c954b);}(_0x38ec,0xfa));var _0xc38e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x38ec[_0xa464c9];return _0x3d73c4;};'use strict';var moment=require(_0xc38e('0x0'));var Sequelize=require(_0xc38e('0x1'));module[_0xc38e('0x2')]={'phone':{'type':Sequelize[_0xc38e('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xc38e('0x4')],'unique':_0xc38e('0x5')},'ListId':{'type':Sequelize[_0xc38e('0x4')],'unique':_0xc38e('0x5')},'VoiceQueueId':{'type':Sequelize[_0xc38e('0x4')],'unique':'contactListQueue'}};
\ No newline at end of file
index 56a3644..4a678f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0093=['fields','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','find','catch','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','save','then','destroy','end','error','stack','send','index','CmHopperBlack','fieldName','type','key','model','name','keys','query','filters','intersection','attributes'];(function(_0x4f7314,_0x57bddd){var _0x5e1674=function(_0x507dea){while(--_0x507dea){_0x4f7314['push'](_0x4f7314['shift']());}};_0x5e1674(++_0x57bddd);}(_0x0093,0xf0));var _0x3009=function(_0x23ae35,_0x1e8658){_0x23ae35=_0x23ae35-0x0;var _0x297e9f=_0x0093[_0x23ae35];return _0x297e9f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3009('0x0'));var zipdir=require(_0x3009('0x1'));var jsonpatch=require(_0x3009('0x2'));var rp=require(_0x3009('0x3'));var moment=require(_0x3009('0x4'));var BPromise=require(_0x3009('0x5'));var Mustache=require(_0x3009('0x6'));var util=require(_0x3009('0x7'));var path=require('path');var sox=require(_0x3009('0x8'));var csv=require('to-csv');var ejs=require(_0x3009('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3009('0xa'));var squel=require(_0x3009('0xb'));var crypto=require(_0x3009('0xc'));var jsforce=require(_0x3009('0xd'));var deskjs=require(_0x3009('0xe'));var toCsv=require(_0x3009('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3009('0x10'));var authService=require(_0x3009('0x11'));var qs=require(_0x3009('0x12'));var as=require(_0x3009('0x13'));var hardwareService=require(_0x3009('0x14'));var logger=require(_0x3009('0x15'))(_0x3009('0x16'));var utils=require(_0x3009('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3009('0x18'))['db'];function respondWithStatusCode(_0x6e5015,_0x243984){_0x243984=_0x243984||0xcc;return function(_0x57e669){if(_0x57e669){return _0x6e5015[_0x3009('0x19')](_0x243984);}return _0x6e5015[_0x3009('0x1a')](_0x243984)['end']();};}function respondWithResult(_0x33d4f4,_0x5ebf4e){_0x5ebf4e=_0x5ebf4e||0xc8;return function(_0x3f75c4){if(_0x3f75c4){return _0x33d4f4['status'](_0x5ebf4e)[_0x3009('0x1b')](_0x3f75c4);}};}function respondWithFilteredResult(_0x16c328,_0x357c44){return function(_0x162588){if(_0x162588){var _0x5d62f4=typeof _0x357c44[_0x3009('0x1c')]==='undefined'&&typeof _0x357c44[_0x3009('0x1d')]===_0x3009('0x1e');var _0x39e115=_0x162588[_0x3009('0x1f')];var _0x20fb25=_0x5d62f4?0x0:_0x357c44[_0x3009('0x1c')];var _0x420545=_0x5d62f4?_0x162588[_0x3009('0x1f')]:_0x357c44[_0x3009('0x1c')]+_0x357c44[_0x3009('0x1d')];var _0x1b093f;if(_0x420545>=_0x39e115){_0x420545=_0x39e115;_0x1b093f=0xc8;}else{_0x1b093f=0xce;}_0x16c328[_0x3009('0x1a')](_0x1b093f);return _0x16c328[_0x3009('0x20')]('Content-Range',_0x20fb25+'-'+_0x420545+'/'+_0x39e115)[_0x3009('0x1b')](_0x162588);}return null;};}function patchUpdates(_0x189136){return function(_0x34b3e4){try{jsonpatch['apply'](_0x34b3e4,_0x189136,!![]);}catch(_0x35eb7d){return BPromise['reject'](_0x35eb7d);}return _0x34b3e4[_0x3009('0x21')]();};}function saveUpdates(_0x973b29,_0x59e5c4){return function(_0xcf165a){if(_0xcf165a){return _0xcf165a['update'](_0x973b29)[_0x3009('0x22')](function(_0x2d0e09){return _0x2d0e09;});}return null;};}function removeEntity(_0x53c75c,_0x4fee7c){return function(_0x3271fe){if(_0x3271fe){return _0x3271fe[_0x3009('0x23')]()[_0x3009('0x22')](function(){_0x53c75c[_0x3009('0x1a')](0xcc)[_0x3009('0x24')]();});}};}function handleEntityNotFound(_0x3ffb47,_0x51b08f){return function(_0x29bfcb){if(!_0x29bfcb){_0x3ffb47[_0x3009('0x19')](0x194);}return _0x29bfcb;};}function handleError(_0x15e348,_0x5e93d8){_0x5e93d8=_0x5e93d8||0x1f4;return function(_0x45215b){logger[_0x3009('0x25')](_0x45215b[_0x3009('0x26')]);if(_0x45215b['name']){delete _0x45215b['name'];}_0x15e348[_0x3009('0x1a')](_0x5e93d8)[_0x3009('0x27')](_0x45215b);};}exports[_0x3009('0x28')]=function(_0x3a01c0,_0xf65255){var _0x3e8f86={},_0x1c6066={},_0x55d69e={'count':0x0,'rows':[]};var _0x3b1412=_['map'](db[_0x3009('0x29')]['rawAttributes'],function(_0x52684f){return{'name':_0x52684f[_0x3009('0x2a')],'type':_0x52684f[_0x3009('0x2b')][_0x3009('0x2c')]};});_0x1c6066[_0x3009('0x2d')]=_['map'](_0x3b1412,_0x3009('0x2e'));_0x1c6066['query']=_[_0x3009('0x2f')](_0x3a01c0[_0x3009('0x30')]);_0x1c6066[_0x3009('0x31')]=_[_0x3009('0x32')](_0x1c6066[_0x3009('0x2d')],_0x1c6066['query']);_0x3e8f86[_0x3009('0x33')]=_[_0x3009('0x32')](_0x1c6066[_0x3009('0x2d')],qs[_0x3009('0x34')](_0x3a01c0['query'][_0x3009('0x34')]));_0x3e8f86[_0x3009('0x33')]=_0x3e8f86[_0x3009('0x33')]['length']?_0x3e8f86['attributes']:_0x1c6066[_0x3009('0x2d')];if(!_0x3a01c0[_0x3009('0x30')]['hasOwnProperty']('nolimit')){_0x3e8f86['limit']=qs['limit'](_0x3a01c0[_0x3009('0x30')][_0x3009('0x1d')]);_0x3e8f86[_0x3009('0x1c')]=qs[_0x3009('0x1c')](_0x3a01c0[_0x3009('0x30')][_0x3009('0x1c')]);}_0x3e8f86['order']=qs[_0x3009('0x35')](_0x3a01c0['query']['sort']);_0x3e8f86[_0x3009('0x36')]=qs[_0x3009('0x31')](_[_0x3009('0x37')](_0x3a01c0[_0x3009('0x30')],_0x1c6066[_0x3009('0x31')]),_0x3b1412);if(_0x3a01c0['query'][_0x3009('0x38')]){_0x3e8f86[_0x3009('0x36')]=_[_0x3009('0x39')](_0x3e8f86[_0x3009('0x36')],{'$or':_[_0x3009('0x3a')](_0x3b1412,function(_0x3afa47){if(_0x3afa47[_0x3009('0x2b')]!==_0x3009('0x3b')){var _0x47ae73={};_0x47ae73[_0x3afa47[_0x3009('0x2e')]]={'$like':'%'+_0x3a01c0[_0x3009('0x30')][_0x3009('0x38')]+'%'};return _0x47ae73;}})});}_0x3e8f86=_['merge']({},_0x3e8f86,_0x3a01c0[_0x3009('0x3c')]);var _0x2f7e34={'where':_0x3e8f86[_0x3009('0x36')]};return db[_0x3009('0x29')][_0x3009('0x1f')](_0x2f7e34)['then'](function(_0xf25139){_0x55d69e[_0x3009('0x1f')]=_0xf25139;if(_0x3a01c0[_0x3009('0x30')][_0x3009('0x3d')]){_0x3e8f86[_0x3009('0x3e')]=[{'all':!![]}];}return db[_0x3009('0x29')][_0x3009('0x3f')](_0x3e8f86);})[_0x3009('0x22')](function(_0x354525){_0x55d69e[_0x3009('0x40')]=_0x354525;return _0x55d69e;})[_0x3009('0x22')](respondWithFilteredResult(_0xf65255,_0x3e8f86))['catch'](handleError(_0xf65255,null));};exports[_0x3009('0x41')]=function(_0xaa8d05,_0x4df384){var _0x25bcb9={'raw':!![],'where':{'id':_0xaa8d05[_0x3009('0x42')]['id']}},_0x4f78ff={};_0x4f78ff[_0x3009('0x2d')]=_[_0x3009('0x2f')](db[_0x3009('0x29')][_0x3009('0x43')]);_0x4f78ff[_0x3009('0x30')]=_[_0x3009('0x2f')](_0xaa8d05[_0x3009('0x30')]);_0x4f78ff['filters']=_[_0x3009('0x32')](_0x4f78ff[_0x3009('0x2d')],_0x4f78ff['query']);_0x25bcb9[_0x3009('0x33')]=_['intersection'](_0x4f78ff[_0x3009('0x2d')],qs[_0x3009('0x34')](_0xaa8d05[_0x3009('0x30')]['fields']));_0x25bcb9[_0x3009('0x33')]=_0x25bcb9['attributes'][_0x3009('0x44')]?_0x25bcb9[_0x3009('0x33')]:_0x4f78ff[_0x3009('0x2d')];if(_0xaa8d05[_0x3009('0x30')][_0x3009('0x3d')]){_0x25bcb9[_0x3009('0x3e')]=[{'all':!![]}];}_0x25bcb9=_[_0x3009('0x39')]({},_0x25bcb9,_0xaa8d05[_0x3009('0x3c')]);return db[_0x3009('0x29')][_0x3009('0x45')](_0x25bcb9)['then'](handleEntityNotFound(_0x4df384,null))[_0x3009('0x22')](respondWithResult(_0x4df384,null))[_0x3009('0x46')](handleError(_0x4df384,null));};exports['update']=function(_0x156dd9,_0x1495ab){if(_0x156dd9['body']['id']){delete _0x156dd9[_0x3009('0x47')]['id'];}return db[_0x3009('0x29')][_0x3009('0x45')]({'where':{'id':_0x156dd9[_0x3009('0x42')]['id']}})['then'](handleEntityNotFound(_0x1495ab,null))[_0x3009('0x22')](saveUpdates(_0x156dd9[_0x3009('0x47')],null))[_0x3009('0x22')](respondWithResult(_0x1495ab,null))[_0x3009('0x46')](handleError(_0x1495ab,null));};exports[_0x3009('0x23')]=function(_0x3ecffb,_0x53e51d){return db['CmHopperBlack']['find']({'where':{'id':_0x3ecffb['params']['id']}})[_0x3009('0x22')](handleEntityNotFound(_0x53e51d,null))[_0x3009('0x22')](removeEntity(_0x53e51d,null))['catch'](handleError(_0x53e51d,null));};exports['describe']=function(_0x3fc6ee,_0x35bb48){return db[_0x3009('0x29')][_0x3009('0x48')]()['then'](respondWithResult(_0x35bb48,null))[_0x3009('0x46')](handleError(_0x35bb48,null));};
\ No newline at end of file
+var _0xd3f7=['catch','show','params','find','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','error','name','send','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3f7,0xe2));var _0x7d3f=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0xd3f7[_0x37cc52];return _0x2b4a90;};'use strict';var emlformat=require(_0x7d3f('0x0'));var rimraf=require(_0x7d3f('0x1'));var zipdir=require(_0x7d3f('0x2'));var jsonpatch=require(_0x7d3f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7d3f('0x4'));var Mustache=require(_0x7d3f('0x5'));var util=require(_0x7d3f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7d3f('0x7'));var ejs=require(_0x7d3f('0x8'));var fs=require('fs');var fs_extra=require(_0x7d3f('0x9'));var _=require(_0x7d3f('0xa'));var squel=require(_0x7d3f('0xb'));var crypto=require(_0x7d3f('0xc'));var jsforce=require(_0x7d3f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7d3f('0xe'));var Redis=require(_0x7d3f('0xf'));var authService=require(_0x7d3f('0x10'));var qs=require(_0x7d3f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d3f('0x12'));var logger=require(_0x7d3f('0x13'))(_0x7d3f('0x14'));var utils=require(_0x7d3f('0x15'));var config=require(_0x7d3f('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x226638,_0x316c92){_0x316c92=_0x316c92||0xcc;return function(_0x2d9f31){if(_0x2d9f31){return _0x226638[_0x7d3f('0x17')](_0x316c92);}return _0x226638[_0x7d3f('0x18')](_0x316c92)[_0x7d3f('0x19')]();};}function respondWithResult(_0x3289e4,_0x415417){_0x415417=_0x415417||0xc8;return function(_0x3252d7){if(_0x3252d7){return _0x3289e4[_0x7d3f('0x18')](_0x415417)[_0x7d3f('0x1a')](_0x3252d7);}};}function respondWithFilteredResult(_0x9d9c50,_0xd8db00){return function(_0x44ef43){if(_0x44ef43){var _0x58e080=typeof _0xd8db00[_0x7d3f('0x1b')]===_0x7d3f('0x1c')&&typeof _0xd8db00['limit']===_0x7d3f('0x1c');var _0xd1bac4=_0x44ef43[_0x7d3f('0x1d')];var _0x242bb6=_0x58e080?0x0:_0xd8db00['offset'];var _0x565128=_0x58e080?_0x44ef43['count']:_0xd8db00[_0x7d3f('0x1b')]+_0xd8db00['limit'];var _0x455afc;if(_0x565128>=_0xd1bac4){_0x565128=_0xd1bac4;_0x455afc=0xc8;}else{_0x455afc=0xce;}_0x9d9c50['status'](_0x455afc);return _0x9d9c50[_0x7d3f('0x1e')](_0x7d3f('0x1f'),_0x242bb6+'-'+_0x565128+'/'+_0xd1bac4)[_0x7d3f('0x1a')](_0x44ef43);}return null;};}function patchUpdates(_0x5aeb18){return function(_0x51bedf){try{jsonpatch[_0x7d3f('0x20')](_0x51bedf,_0x5aeb18,!![]);}catch(_0x16abac){return BPromise[_0x7d3f('0x21')](_0x16abac);}return _0x51bedf[_0x7d3f('0x22')]();};}function saveUpdates(_0x134f11,_0x509da4){return function(_0x545b1a){if(_0x545b1a){return _0x545b1a[_0x7d3f('0x23')](_0x134f11)[_0x7d3f('0x24')](function(_0x3b6217){return _0x3b6217;});}return null;};}function removeEntity(_0xc34bee,_0x102fa4){return function(_0x43e5fb){if(_0x43e5fb){return _0x43e5fb['destroy']()[_0x7d3f('0x24')](function(){_0xc34bee[_0x7d3f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bf514,_0x5bec01){return function(_0x53bb70){if(!_0x53bb70){_0x1bf514[_0x7d3f('0x17')](0x194);}return _0x53bb70;};}function handleError(_0x3997d2,_0x1d9896){_0x1d9896=_0x1d9896||0x1f4;return function(_0x40c748){logger[_0x7d3f('0x25')](_0x40c748['stack']);if(_0x40c748[_0x7d3f('0x26')]){delete _0x40c748[_0x7d3f('0x26')];}_0x3997d2['status'](_0x1d9896)[_0x7d3f('0x27')](_0x40c748);};}exports['index']=function(_0x320f68,_0x639598){var _0xcc1cb3={},_0x4749a5={},_0x1e7caf={'count':0x0,'rows':[]};var _0xcc8605=_[_0x7d3f('0x28')](db[_0x7d3f('0x29')][_0x7d3f('0x2a')],function(_0x267862){return{'name':_0x267862[_0x7d3f('0x2b')],'type':_0x267862[_0x7d3f('0x2c')][_0x7d3f('0x2d')]};});_0x4749a5[_0x7d3f('0x2e')]=_['map'](_0xcc8605,_0x7d3f('0x26'));_0x4749a5[_0x7d3f('0x2f')]=_[_0x7d3f('0x30')](_0x320f68[_0x7d3f('0x2f')]);_0x4749a5['filters']=_[_0x7d3f('0x31')](_0x4749a5[_0x7d3f('0x2e')],_0x4749a5[_0x7d3f('0x2f')]);_0xcc1cb3[_0x7d3f('0x32')]=_[_0x7d3f('0x31')](_0x4749a5[_0x7d3f('0x2e')],qs[_0x7d3f('0x33')](_0x320f68[_0x7d3f('0x2f')][_0x7d3f('0x33')]));_0xcc1cb3[_0x7d3f('0x32')]=_0xcc1cb3[_0x7d3f('0x32')]['length']?_0xcc1cb3[_0x7d3f('0x32')]:_0x4749a5['model'];if(!_0x320f68[_0x7d3f('0x2f')][_0x7d3f('0x34')]('nolimit')){_0xcc1cb3[_0x7d3f('0x35')]=qs['limit'](_0x320f68[_0x7d3f('0x2f')][_0x7d3f('0x35')]);_0xcc1cb3['offset']=qs[_0x7d3f('0x1b')](_0x320f68[_0x7d3f('0x2f')]['offset']);}_0xcc1cb3[_0x7d3f('0x36')]=qs[_0x7d3f('0x37')](_0x320f68['query'][_0x7d3f('0x37')]);_0xcc1cb3['where']=qs[_0x7d3f('0x38')](_[_0x7d3f('0x39')](_0x320f68[_0x7d3f('0x2f')],_0x4749a5['filters']),_0xcc8605);if(_0x320f68[_0x7d3f('0x2f')][_0x7d3f('0x3a')]){_0xcc1cb3[_0x7d3f('0x3b')]=_[_0x7d3f('0x3c')](_0xcc1cb3[_0x7d3f('0x3b')],{'$or':_[_0x7d3f('0x28')](_0xcc8605,function(_0x2d587d){if(_0x2d587d['type']!=='VIRTUAL'){var _0x292fec={};_0x292fec[_0x2d587d['name']]={'$like':'%'+_0x320f68[_0x7d3f('0x2f')][_0x7d3f('0x3a')]+'%'};return _0x292fec;}})});}_0xcc1cb3=_[_0x7d3f('0x3c')]({},_0xcc1cb3,_0x320f68[_0x7d3f('0x3d')]);var _0x3f9291={'where':_0xcc1cb3[_0x7d3f('0x3b')]};return db[_0x7d3f('0x29')][_0x7d3f('0x1d')](_0x3f9291)[_0x7d3f('0x24')](function(_0x42d280){_0x1e7caf[_0x7d3f('0x1d')]=_0x42d280;if(_0x320f68[_0x7d3f('0x2f')][_0x7d3f('0x3e')]){_0xcc1cb3[_0x7d3f('0x3f')]=[{'all':!![]}];}return db[_0x7d3f('0x29')][_0x7d3f('0x40')](_0xcc1cb3);})[_0x7d3f('0x24')](function(_0x4fbd73){_0x1e7caf[_0x7d3f('0x41')]=_0x4fbd73;return _0x1e7caf;})[_0x7d3f('0x24')](respondWithFilteredResult(_0x639598,_0xcc1cb3))[_0x7d3f('0x42')](handleError(_0x639598,null));};exports[_0x7d3f('0x43')]=function(_0x315dee,_0x25a0fd){var _0x3d25fc={'raw':!![],'where':{'id':_0x315dee[_0x7d3f('0x44')]['id']}},_0x390aba={};_0x390aba[_0x7d3f('0x2e')]=_[_0x7d3f('0x30')](db[_0x7d3f('0x29')][_0x7d3f('0x2a')]);_0x390aba[_0x7d3f('0x2f')]=_[_0x7d3f('0x30')](_0x315dee[_0x7d3f('0x2f')]);_0x390aba['filters']=_[_0x7d3f('0x31')](_0x390aba[_0x7d3f('0x2e')],_0x390aba['query']);_0x3d25fc[_0x7d3f('0x32')]=_[_0x7d3f('0x31')](_0x390aba[_0x7d3f('0x2e')],qs[_0x7d3f('0x33')](_0x315dee[_0x7d3f('0x2f')][_0x7d3f('0x33')]));_0x3d25fc[_0x7d3f('0x32')]=_0x3d25fc[_0x7d3f('0x32')]['length']?_0x3d25fc[_0x7d3f('0x32')]:_0x390aba[_0x7d3f('0x2e')];if(_0x315dee[_0x7d3f('0x2f')]['includeAll']){_0x3d25fc[_0x7d3f('0x3f')]=[{'all':!![]}];}_0x3d25fc=_[_0x7d3f('0x3c')]({},_0x3d25fc,_0x315dee[_0x7d3f('0x3d')]);return db[_0x7d3f('0x29')][_0x7d3f('0x45')](_0x3d25fc)[_0x7d3f('0x24')](handleEntityNotFound(_0x25a0fd,null))[_0x7d3f('0x24')](respondWithResult(_0x25a0fd,null))[_0x7d3f('0x42')](handleError(_0x25a0fd,null));};exports[_0x7d3f('0x23')]=function(_0x3fdf98,_0x252b65){if(_0x3fdf98[_0x7d3f('0x46')]['id']){delete _0x3fdf98[_0x7d3f('0x46')]['id'];}return db[_0x7d3f('0x29')][_0x7d3f('0x45')]({'where':{'id':_0x3fdf98['params']['id']}})[_0x7d3f('0x24')](handleEntityNotFound(_0x252b65,null))[_0x7d3f('0x24')](saveUpdates(_0x3fdf98[_0x7d3f('0x46')],null))[_0x7d3f('0x24')](respondWithResult(_0x252b65,null))[_0x7d3f('0x42')](handleError(_0x252b65,null));};exports[_0x7d3f('0x47')]=function(_0x2597d2,_0x1e3653){return db['CmHopperBlack'][_0x7d3f('0x45')]({'where':{'id':_0x2597d2[_0x7d3f('0x44')]['id']}})[_0x7d3f('0x24')](handleEntityNotFound(_0x1e3653,null))[_0x7d3f('0x24')](removeEntity(_0x1e3653,null))[_0x7d3f('0x42')](handleError(_0x1e3653,null));};exports[_0x7d3f('0x48')]=function(_0x5e23d5,_0x441e68){return db[_0x7d3f('0x29')][_0x7d3f('0x48')]()[_0x7d3f('0x24')](respondWithResult(_0x441e68,null))[_0x7d3f('0x42')](handleError(_0x441e68,null));};
\ No newline at end of file
index 294b884..69071cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87fc=['request-promise','path','../../config/environment','define','lodash','moment'];(function(_0x37dbda,_0x542219){var _0x254c17=function(_0x47f33f){while(--_0x47f33f){_0x37dbda['push'](_0x37dbda['shift']());}};_0x254c17(++_0x542219);}(_0x87fc,0x82));var _0xc87f=function(_0x2c2bac,_0x3ecd02){_0x2c2bac=_0x2c2bac-0x0;var _0x35921b=_0x87fc[_0x2c2bac];return _0x35921b;};'use strict';var _=require(_0xc87f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc87f('0x1'));var BPromise=require('bluebird');var rp=require(_0xc87f('0x2'));var fs=require('fs');var path=require(_0xc87f('0x3'));var rimraf=require('rimraf');var config=require(_0xc87f('0x4'));var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x44f9c4,_0x2c96d7){return _0x44f9c4[_0xc87f('0x5')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfaf8=['../../config/environment','define','cm_hopper_black','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x463376,_0x13871c){var _0x336ccd=function(_0x33afd2){while(--_0x33afd2){_0x463376['push'](_0x463376['shift']());}};_0x336ccd(++_0x13871c);}(_0xfaf8,0x158));var _0x8faf=function(_0x5b4704,_0x3eca4a){_0x5b4704=_0x5b4704-0x0;var _0x7bac45=_0xfaf8[_0x5b4704];return _0x7bac45;};'use strict';var _=require(_0x8faf('0x0'));var util=require(_0x8faf('0x1'));var logger=require(_0x8faf('0x2'))(_0x8faf('0x3'));var moment=require('moment');var BPromise=require(_0x8faf('0x4'));var rp=require(_0x8faf('0x5'));var fs=require('fs');var path=require(_0x8faf('0x6'));var rimraf=require(_0x8faf('0x7'));var config=require(_0x8faf('0x8'));var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x390b0e,_0x44fb38){return _0x390b0e[_0x8faf('0x9')]('CmHopperBlack',attributes,{'tableName':_0x8faf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b7128b4..1546eff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4758=['debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result','findAll','options','raw','where','attributes','map','include','model','GetCmHopperBlack','stringify','catch','UpdateCmHopperBlack','CmHopperBlack','update','limit','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0x4758,0x128));var _0x8475=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4758[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8475('0x0'));var util=require('util');var moment=require(_0x8475('0x1'));var BPromise=require(_0x8475('0x2'));var rs=require(_0x8475('0x3'));var fs=require('fs');var Redis=require(_0x8475('0x4'));var db=require(_0x8475('0x5'))['db'];var utils=require(_0x8475('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8475('0x7'));var jayson=require(_0x8475('0x8'));var client=jayson[_0x8475('0x9')][_0x8475('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cce29,_0x1cd1b4,_0x4b18eb){return new BPromise(function(_0x2d2655,_0x52659d){return client[_0x8475('0xb')](_0x3cce29,_0x4b18eb)[_0x8475('0xc')](function(_0x4dc16f){logger[_0x8475('0xd')](_0x8475('0xe'),_0x1cd1b4,_0x8475('0xf'));logger[_0x8475('0x10')](_0x8475('0x11'),_0x1cd1b4,_0x8475('0xf'),JSON['stringify'](_0x4dc16f));if(_0x4dc16f[_0x8475('0x12')]){if(_0x4dc16f[_0x8475('0x12')][_0x8475('0x13')]===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x1cd1b4,_0x4dc16f[_0x8475('0x12')][_0x8475('0x14')]);return _0x52659d(_0x4dc16f[_0x8475('0x12')][_0x8475('0x14')]);}logger[_0x8475('0x12')](_0x8475('0xe'),_0x1cd1b4,_0x4dc16f[_0x8475('0x12')][_0x8475('0x14')]);return _0x2d2655(_0x4dc16f[_0x8475('0x12')][_0x8475('0x14')]);}else{logger[_0x8475('0xd')](_0x8475('0xe'),_0x1cd1b4,_0x8475('0xf'));_0x2d2655(_0x4dc16f[_0x8475('0x15')][_0x8475('0x14')]);}})['catch'](function(_0x2c4adc){logger[_0x8475('0x12')](_0x8475('0xe'),_0x1cd1b4,_0x2c4adc);_0x52659d(_0x2c4adc);});});}exports['GetCmHopperBlack']=function(_0x4eda95){var _0x176114=this;return new Promise(function(_0x810072,_0x539c19){return db['CmHopperBlack'][_0x8475('0x16')]({'raw':_0x4eda95[_0x8475('0x17')]?_0x4eda95[_0x8475('0x17')][_0x8475('0x18')]===undefined?!![]:![]:!![],'where':_0x4eda95['options']?_0x4eda95[_0x8475('0x17')][_0x8475('0x19')]||null:null,'attributes':_0x4eda95['options']?_0x4eda95[_0x8475('0x17')][_0x8475('0x1a')]||null:null,'limit':_0x4eda95[_0x8475('0x17')]?_0x4eda95['options']['limit']||null:null,'include':_0x4eda95[_0x8475('0x17')]?_0x4eda95['options']['include']?_[_0x8475('0x1b')](_0x4eda95[_0x8475('0x17')][_0x8475('0x1c')],function(_0x5547b4){return{'model':db[_0x5547b4[_0x8475('0x1d')]],'as':_0x5547b4['as'],'attributes':_0x5547b4[_0x8475('0x1a')],'include':_0x5547b4[_0x8475('0x1c')]?_[_0x8475('0x1b')](_0x5547b4[_0x8475('0x1c')],function(_0x1d3b93){return{'model':db[_0x1d3b93['model']],'as':_0x1d3b93['as'],'attributes':_0x1d3b93[_0x8475('0x1a')],'include':_0x1d3b93[_0x8475('0x1c')]?_['map'](_0x1d3b93['include'],function(_0x42c956){return{'model':db[_0x42c956[_0x8475('0x1d')]],'as':_0x42c956['as'],'attributes':_0x42c956[_0x8475('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8475('0xc')](function(_0x5d7304){logger[_0x8475('0xd')](_0x8475('0x1e'),_0x4eda95);logger[_0x8475('0x10')](_0x8475('0x1e'),_0x4eda95,JSON[_0x8475('0x1f')](_0x5d7304));_0x810072(_0x5d7304);})[_0x8475('0x20')](function(_0x161fee){logger[_0x8475('0x12')]('GetCmHopperBlack',_0x161fee['message'],_0x4eda95);_0x539c19(_0x176114[_0x8475('0x12')](0x1f4,_0x161fee[_0x8475('0x14')]));});});};exports[_0x8475('0x21')]=function(_0x348c8b){var _0x5c4a63=this;return new Promise(function(_0x2b5403,_0x2e9ba){return db[_0x8475('0x22')][_0x8475('0x23')](_0x348c8b['body'],{'raw':_0x348c8b[_0x8475('0x17')]?_0x348c8b[_0x8475('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x348c8b[_0x8475('0x17')]?_0x348c8b[_0x8475('0x17')][_0x8475('0x19')]||null:null,'attributes':_0x348c8b[_0x8475('0x17')]?_0x348c8b[_0x8475('0x17')][_0x8475('0x1a')]||null:null,'limit':_0x348c8b[_0x8475('0x17')]?_0x348c8b[_0x8475('0x17')][_0x8475('0x24')]||null:null})[_0x8475('0xc')](function(_0x57d4d6){logger['info']('UpdateCmHopperBlack',_0x348c8b);logger[_0x8475('0x10')](_0x8475('0x21'),_0x348c8b,JSON[_0x8475('0x1f')](_0x57d4d6));_0x2b5403(_0x57d4d6);})[_0x8475('0x20')](function(_0x5d04b1){logger['error'](_0x8475('0x21'),_0x5d04b1[_0x8475('0x14')],_0x348c8b);_0x2e9ba(_0x5c4a63[_0x8475('0x12')](0x1f4,_0x5d04b1['message']));});});};exports[_0x8475('0x25')]=function(_0x3b8964){var _0x3776aa=this;return new Promise(function(_0x1425f1,_0x39e8fc){return db[_0x8475('0x22')][_0x8475('0x26')]({'where':_0x3b8964[_0x8475('0x17')]?_0x3b8964['options'][_0x8475('0x19')]||null:null})[_0x8475('0xc')](function(_0x90f543){logger[_0x8475('0xd')](_0x8475('0x25'),_0x3b8964);logger[_0x8475('0x10')](_0x8475('0x25'),_0x3b8964,JSON[_0x8475('0x1f')](_0x90f543));_0x1425f1(_0x90f543);})['catch'](function(_0x7ce7c2){logger['error'](_0x8475('0x25'),_0x7ce7c2[_0x8475('0x14')],_0x3b8964);_0x39e8fc(_0x3776aa[_0x8475('0x12')](0x1f4,_0x7ce7c2[_0x8475('0x14')]));});});};
\ No newline at end of file
+var _0x8a2e=['CmHopperBlack,\x20%s,\x20%s,\x20%s','error','message','result','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','map','include','model','stringify','catch','body','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2f0274,_0x2dd966){var _0x188cca=function(_0x28e7b1){while(--_0x28e7b1){_0x2f0274['push'](_0x2f0274['shift']());}};_0x188cca(++_0x2dd966);}(_0x8a2e,0x174));var _0xe8a2=function(_0x360ca6,_0xcfc705){_0x360ca6=_0x360ca6-0x0;var _0x4eb07a=_0x8a2e[_0x360ca6];return _0x4eb07a;};'use strict';var _=require('lodash');var util=require(_0xe8a2('0x0'));var moment=require(_0xe8a2('0x1'));var BPromise=require(_0xe8a2('0x2'));var rs=require(_0xe8a2('0x3'));var fs=require('fs');var Redis=require(_0xe8a2('0x4'));var db=require(_0xe8a2('0x5'))['db'];var utils=require(_0xe8a2('0x6'));var logger=require(_0xe8a2('0x7'))(_0xe8a2('0x8'));var config=require(_0xe8a2('0x9'));var jayson=require(_0xe8a2('0xa'));var client=jayson[_0xe8a2('0xb')][_0xe8a2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf07b94,_0x397ba3,_0x511146){return new BPromise(function(_0x910597,_0x275dd9){return client['request'](_0xf07b94,_0x511146)[_0xe8a2('0xd')](function(_0x32de71){logger[_0xe8a2('0xe')](_0xe8a2('0xf'),_0x397ba3,_0xe8a2('0x10'));logger[_0xe8a2('0x11')](_0xe8a2('0x12'),_0x397ba3,_0xe8a2('0x10'),JSON['stringify'](_0x32de71));if(_0x32de71[_0xe8a2('0x13')]){if(_0x32de71[_0xe8a2('0x13')]['code']===0x1f4){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x397ba3,_0x32de71['error'][_0xe8a2('0x14')]);return _0x275dd9(_0x32de71[_0xe8a2('0x13')]['message']);}logger[_0xe8a2('0x13')](_0xe8a2('0xf'),_0x397ba3,_0x32de71[_0xe8a2('0x13')][_0xe8a2('0x14')]);return _0x910597(_0x32de71[_0xe8a2('0x13')][_0xe8a2('0x14')]);}else{logger[_0xe8a2('0xe')](_0xe8a2('0xf'),_0x397ba3,_0xe8a2('0x10'));_0x910597(_0x32de71[_0xe8a2('0x15')][_0xe8a2('0x14')]);}})['catch'](function(_0x2943db){logger[_0xe8a2('0x13')](_0xe8a2('0xf'),_0x397ba3,_0x2943db);_0x275dd9(_0x2943db);});});}exports[_0xe8a2('0x16')]=function(_0x1f5cc2){var _0x4cea5f=this;return new Promise(function(_0x2e3805,_0x17f4ab){return db[_0xe8a2('0x17')][_0xe8a2('0x18')]({'raw':_0x1f5cc2[_0xe8a2('0x19')]?_0x1f5cc2['options'][_0xe8a2('0x1a')]===undefined?!![]:![]:!![],'where':_0x1f5cc2[_0xe8a2('0x19')]?_0x1f5cc2['options'][_0xe8a2('0x1b')]||null:null,'attributes':_0x1f5cc2['options']?_0x1f5cc2[_0xe8a2('0x19')][_0xe8a2('0x1c')]||null:null,'limit':_0x1f5cc2['options']?_0x1f5cc2[_0xe8a2('0x19')][_0xe8a2('0x1d')]||null:null,'include':_0x1f5cc2[_0xe8a2('0x19')]?_0x1f5cc2['options']['include']?_[_0xe8a2('0x1e')](_0x1f5cc2[_0xe8a2('0x19')][_0xe8a2('0x1f')],function(_0x134708){return{'model':db[_0x134708[_0xe8a2('0x20')]],'as':_0x134708['as'],'attributes':_0x134708['attributes'],'include':_0x134708[_0xe8a2('0x1f')]?_[_0xe8a2('0x1e')](_0x134708[_0xe8a2('0x1f')],function(_0x241ec0){return{'model':db[_0x241ec0[_0xe8a2('0x20')]],'as':_0x241ec0['as'],'attributes':_0x241ec0['attributes'],'include':_0x241ec0[_0xe8a2('0x1f')]?_[_0xe8a2('0x1e')](_0x241ec0['include'],function(_0x532f12){return{'model':db[_0x532f12[_0xe8a2('0x20')]],'as':_0x532f12['as'],'attributes':_0x532f12[_0xe8a2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe8a2('0xd')](function(_0x2358cb){logger['info']('GetCmHopperBlack',_0x1f5cc2);logger[_0xe8a2('0x11')](_0xe8a2('0x16'),_0x1f5cc2,JSON[_0xe8a2('0x21')](_0x2358cb));_0x2e3805(_0x2358cb);})[_0xe8a2('0x22')](function(_0x27c9f8){logger[_0xe8a2('0x13')](_0xe8a2('0x16'),_0x27c9f8['message'],_0x1f5cc2);_0x17f4ab(_0x4cea5f[_0xe8a2('0x13')](0x1f4,_0x27c9f8[_0xe8a2('0x14')]));});});};exports['UpdateCmHopperBlack']=function(_0x505e8a){var _0x318b06=this;return new Promise(function(_0x2a68a8,_0x2969c3){return db[_0xe8a2('0x17')]['update'](_0x505e8a[_0xe8a2('0x23')],{'raw':_0x505e8a['options']?_0x505e8a[_0xe8a2('0x19')][_0xe8a2('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x505e8a[_0xe8a2('0x19')]?_0x505e8a[_0xe8a2('0x19')][_0xe8a2('0x1b')]||null:null,'attributes':_0x505e8a[_0xe8a2('0x19')]?_0x505e8a[_0xe8a2('0x19')][_0xe8a2('0x1c')]||null:null,'limit':_0x505e8a['options']?_0x505e8a[_0xe8a2('0x19')][_0xe8a2('0x1d')]||null:null})[_0xe8a2('0xd')](function(_0x3188dd){logger[_0xe8a2('0xe')](_0xe8a2('0x24'),_0x505e8a);logger[_0xe8a2('0x11')](_0xe8a2('0x24'),_0x505e8a,JSON[_0xe8a2('0x21')](_0x3188dd));_0x2a68a8(_0x3188dd);})[_0xe8a2('0x22')](function(_0x1dd8d8){logger[_0xe8a2('0x13')]('UpdateCmHopperBlack',_0x1dd8d8['message'],_0x505e8a);_0x2969c3(_0x318b06[_0xe8a2('0x13')](0x1f4,_0x1dd8d8['message']));});});};exports[_0xe8a2('0x25')]=function(_0x2ebd4e){var _0x49bbff=this;return new Promise(function(_0xeca364,_0x49e572){return db[_0xe8a2('0x17')][_0xe8a2('0x26')]({'where':_0x2ebd4e['options']?_0x2ebd4e[_0xe8a2('0x19')][_0xe8a2('0x1b')]||null:null})[_0xe8a2('0xd')](function(_0x23278a){logger[_0xe8a2('0xe')](_0xe8a2('0x25'),_0x2ebd4e);logger[_0xe8a2('0x11')]('DestroyCmHopperBlack',_0x2ebd4e,JSON[_0xe8a2('0x21')](_0x23278a));_0xeca364(_0x23278a);})[_0xe8a2('0x22')](function(_0x4d7cd8){logger[_0xe8a2('0x13')](_0xe8a2('0x25'),_0x4d7cd8['message'],_0x2ebd4e);_0x49e572(_0x49bbff[_0xe8a2('0x13')](0x1f4,_0x4d7cd8[_0xe8a2('0x14')]));});});};
\ No newline at end of file
index 68091f4..5fb9e17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf55=['../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','delete','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x25cdb9,_0x4d338f){var _0x2ce804=function(_0xd1eb7e){while(--_0xd1eb7e){_0x25cdb9['push'](_0x25cdb9['shift']());}};_0x2ce804(++_0x4d338f);}(_0xdf55,0x83));var _0x5df5=function(_0x3fcf30,_0xe3a49e){_0x3fcf30=_0x3fcf30-0x0;var _0x2ed4b0=_0xdf55[_0x3fcf30];return _0x2ed4b0;};'use strict';var multer=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var path=require('path');var timeout=require(_0x5df5('0x2'));var express=require(_0x5df5('0x3'));var router=express['Router']();var fs_extra=require(_0x5df5('0x4'));var auth=require(_0x5df5('0x5'));var interaction=require(_0x5df5('0x6'));var config=require('../../config/environment');var controller=require(_0x5df5('0x7'));router[_0x5df5('0x8')]('/',auth[_0x5df5('0x9')](),controller[_0x5df5('0xa')]);router[_0x5df5('0x8')](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xc')]);router['get'](_0x5df5('0xd'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xe')]);router['put']('/:id',auth[_0x5df5('0x9')](),controller['update']);router[_0x5df5('0xf')](_0x5df5('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x5df5('0x10')]=router;
\ No newline at end of file
+var _0xf072=['../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','multer','util','path','express','fs-extra'];(function(_0x155574,_0x3b4bfe){var _0x50e79b=function(_0x3a5a11){while(--_0x3a5a11){_0x155574['push'](_0x155574['shift']());}};_0x50e79b(++_0x3b4bfe);}(_0xf072,0x1cf));var _0x2f07=function(_0x2689b3,_0x544cac){_0x2689b3=_0x2689b3-0x0;var _0x51f32c=_0xf072[_0x2689b3];return _0x51f32c;};'use strict';var multer=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var path=require(_0x2f07('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f07('0x3'));var router=express['Router']();var fs_extra=require(_0x2f07('0x4'));var auth=require(_0x2f07('0x5'));var interaction=require(_0x2f07('0x6'));var config=require('../../config/environment');var controller=require(_0x2f07('0x7'));router[_0x2f07('0x8')]('/',auth[_0x2f07('0x9')](),controller[_0x2f07('0xa')]);router[_0x2f07('0x8')](_0x2f07('0xb'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xc')]);router[_0x2f07('0x8')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xe')]);router[_0x2f07('0xf')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller['update']);router[_0x2f07('0x10')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller[_0x2f07('0x11')]);module['exports']=router;
\ No newline at end of file
index c00f77a..5cb93cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf5=['BOOLEAN','sequelize','moment','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','seconds'];(function(_0x179b74,_0x5dc97d){var _0x268f76=function(_0x19c8c2){while(--_0x19c8c2){_0x179b74['push'](_0x179b74['shift']());}};_0x268f76(++_0x5dc97d);}(_0xbaf5,0xa9));var _0x5baf=function(_0x2d1cf4,_0x2ea9ee){_0x2d1cf4=_0x2d1cf4-0x0;var _0x554a7c=_0xbaf5[_0x2d1cf4];return _0x554a7c;};'use strict';var Sequelize=require(_0x5baf('0x0'));var moment=require(_0x5baf('0x1'));module['exports']={'state':{'type':Sequelize[_0x5baf('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x5baf('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5baf('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5baf('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x5baf('0x3')]},'originatecalleridname':{'type':Sequelize[_0x5baf('0x3')]},'calleridnum':{'type':Sequelize[_0x5baf('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x5baf('0x4')]},'responsetime':{'type':Sequelize[_0x5baf('0x4')]},'answertime':{'type':Sequelize[_0x5baf('0x4')]},'droptime':{'type':Sequelize[_0x5baf('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x5baf('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5baf('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5baf('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5baf('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x5baf('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x5baf('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5baf('0x3')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x1932cb){var _0x433d7d=this[_0x5baf('0x5')](_0x5baf('0x6'));if(_0x433d7d&&_0x1932cb){this[_0x5baf('0x7')](_0x5baf('0x8'),moment(_0x1932cb)[_0x5baf('0x9')](moment(_0x433d7d),_0x5baf('0xa')));}}},'amd':{'type':Sequelize[_0x5baf('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x5baf('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5baf('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x5baf('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5baf('0x4')]},'deleted':{'type':Sequelize[_0x5baf('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x5baf('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x5baf('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x5baf('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5baf('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5baf('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5baf('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe566=['followuptime','diff','BOOLEAN','sequelize','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue'];(function(_0x5e4cd6,_0xfb732a){var _0xd7c226=function(_0x574888){while(--_0x574888){_0x5e4cd6['push'](_0x5e4cd6['shift']());}};_0xd7c226(++_0xfb732a);}(_0xe566,0x12c));var _0x6e56=function(_0x4e4466,_0x203433){_0x4e4466=_0x4e4466-0x0;var _0x28ba4b=_0xe566[_0x4e4466];return _0x28ba4b;};'use strict';var Sequelize=require(_0x6e56('0x0'));var moment=require('moment');module[_0x6e56('0x1')]={'state':{'type':Sequelize[_0x6e56('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6e56('0x3')]},'scheduledat':{'type':Sequelize[_0x6e56('0x4')]},'countbusyretry':{'type':Sequelize[_0x6e56('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6e56('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6e56('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x6e56('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6e56('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x6e56('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6e56('0x3')]},'starttime':{'type':Sequelize[_0x6e56('0x4')]},'responsetime':{'type':Sequelize[_0x6e56('0x4')]},'answertime':{'type':Sequelize[_0x6e56('0x4')]},'droptime':{'type':Sequelize[_0x6e56('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x6e56('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6e56('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6e56('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x6e56('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x6e56('0x3')]},'disposition':{'type':Sequelize[_0x6e56('0x3')]},'secondDisposition':{'type':Sequelize[_0x6e56('0x3')]},'thirdDisposition':{'type':Sequelize[_0x6e56('0x3')]},'dispositionat':{'type':Sequelize[_0x6e56('0x4')],'set':function(_0x3c85a7){var _0x53d55a=this[_0x6e56('0x5')](_0x6e56('0x6'));if(_0x53d55a&&_0x3c85a7){this[_0x6e56('0x7')](_0x6e56('0x8'),moment(_0x3c85a7)[_0x6e56('0x9')](moment(_0x53d55a),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x6e56('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x6e56('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x6e56('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x6e56('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6e56('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6e56('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0x6e56('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x6e56('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x6e56('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6e56('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6e56('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6e56('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6e56('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 8ee2756..c4a1beb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafc4=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','CmHopperFinal','includeAll','catch','show','params','describe','body','uniqueid','find','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','phone','scheduledAt','ListId','VoiceQueueId','createdAt','select','field','ANY_VALUE(calleridnum)','NOW()','ContactId','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','Campaign','fromQuery','CampaignId','CampaignId\x20=\x20?','group','CmHopper','findOne','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api'];(function(_0x3f428e,_0x460b83){var _0x40c0c4=function(_0x8f28d0){while(--_0x8f28d0){_0x3f428e['push'](_0x3f428e['shift']());}};_0x40c0c4(++_0x460b83);}(_0xafc4,0x69));var _0x4afc=function(_0x594335,_0x40266c){_0x594335=_0x594335-0x0;var _0x487d93=_0xafc4[_0x594335];return _0x487d93;};'use strict';var emlformat=require(_0x4afc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4afc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4afc('0x2'));var moment=require(_0x4afc('0x3'));var BPromise=require(_0x4afc('0x4'));var Mustache=require(_0x4afc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4afc('0x6'));var ejs=require(_0x4afc('0x7'));var fs=require('fs');var fs_extra=require(_0x4afc('0x8'));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('0x6'));var querystring=require(_0x4afc('0xd'));var Papa=require(_0x4afc('0xe'));var Redis=require(_0x4afc('0xf'));var authService=require(_0x4afc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4afc('0x11'));var logger=require('../../config/logger')(_0x4afc('0x12'));var utils=require(_0x4afc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4afc('0x14'));var db=require(_0x4afc('0x15'))['db'];function respondWithStatusCode(_0x2b191c,_0x2768bf){_0x2768bf=_0x2768bf||0xcc;return function(_0x1d8f98){if(_0x1d8f98){return _0x2b191c[_0x4afc('0x16')](_0x2768bf);}return _0x2b191c[_0x4afc('0x17')](_0x2768bf)[_0x4afc('0x18')]();};}function respondWithResult(_0x5effb4,_0x26f3f1){_0x26f3f1=_0x26f3f1||0xc8;return function(_0x429fd8){if(_0x429fd8){return _0x5effb4[_0x4afc('0x17')](_0x26f3f1)[_0x4afc('0x19')](_0x429fd8);}};}function respondWithFilteredResult(_0x5f2dc9,_0x4e32e8){return function(_0x2452ae){if(_0x2452ae){var _0x4f3127=typeof _0x4e32e8[_0x4afc('0x1a')]===_0x4afc('0x1b')&&typeof _0x4e32e8[_0x4afc('0x1c')]===_0x4afc('0x1b');var _0x3a306f=_0x2452ae[_0x4afc('0x1d')];var _0x22f809=_0x4f3127?0x0:_0x4e32e8[_0x4afc('0x1a')];var _0x16365f=_0x4f3127?_0x2452ae[_0x4afc('0x1d')]:_0x4e32e8[_0x4afc('0x1a')]+_0x4e32e8['limit'];var _0x1a8f49;if(_0x16365f>=_0x3a306f){_0x16365f=_0x3a306f;_0x1a8f49=0xc8;}else{_0x1a8f49=0xce;}_0x5f2dc9[_0x4afc('0x17')](_0x1a8f49);return _0x5f2dc9[_0x4afc('0x1e')](_0x4afc('0x1f'),_0x22f809+'-'+_0x16365f+'/'+_0x3a306f)['json'](_0x2452ae);}return null;};}function patchUpdates(_0x3bddc0){return function(_0x30eda3){try{jsonpatch[_0x4afc('0x20')](_0x30eda3,_0x3bddc0,!![]);}catch(_0x280587){return BPromise[_0x4afc('0x21')](_0x280587);}return _0x30eda3[_0x4afc('0x22')]();};}function saveUpdates(_0x3ad7a5,_0x573a75){return function(_0x5403e4){if(_0x5403e4){return _0x5403e4[_0x4afc('0x23')](_0x3ad7a5)['then'](function(_0x37debf){return _0x37debf;});}return null;};}function removeEntity(_0x4e9a48,_0x1aa676){return function(_0x2a0314){if(_0x2a0314){return _0x2a0314[_0x4afc('0x24')]()[_0x4afc('0x25')](function(){_0x4e9a48[_0x4afc('0x17')](0xcc)[_0x4afc('0x18')]();});}};}function handleEntityNotFound(_0x40a0db,_0x383a71){return function(_0x2bb837){if(!_0x2bb837){_0x40a0db[_0x4afc('0x16')](0x194);}return _0x2bb837;};}function handleError(_0x4e8273,_0x359c07){_0x359c07=_0x359c07||0x1f4;return function(_0x35f5b3){logger['error'](_0x35f5b3[_0x4afc('0x26')]);if(_0x35f5b3[_0x4afc('0x27')]){delete _0x35f5b3[_0x4afc('0x27')];}_0x4e8273['status'](_0x359c07)['send'](_0x35f5b3);};}exports['index']=function(_0x426e9d,_0x5db47e){var _0x5e4747={},_0xd26d2f={},_0x628e42={'count':0x0,'rows':[]};var _0x494fe7=_['map'](db['CmHopperFinal'][_0x4afc('0x28')],function(_0x34434a){return{'name':_0x34434a[_0x4afc('0x29')],'type':_0x34434a[_0x4afc('0x2a')][_0x4afc('0x2b')]};});_0xd26d2f[_0x4afc('0x2c')]=_['map'](_0x494fe7,_0x4afc('0x27'));_0xd26d2f[_0x4afc('0x2d')]=_[_0x4afc('0x2e')](_0x426e9d[_0x4afc('0x2d')]);_0xd26d2f[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0xd26d2f[_0x4afc('0x2c')],_0xd26d2f[_0x4afc('0x2d')]);_0x5e4747['attributes']=_[_0x4afc('0x30')](_0xd26d2f['model'],qs['fields'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x5e4747[_0x4afc('0x32')]=_0x5e4747[_0x4afc('0x32')][_0x4afc('0x33')]?_0x5e4747[_0x4afc('0x32')]:_0xd26d2f['model'];if(!_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x34')](_0x4afc('0x35'))){_0x5e4747[_0x4afc('0x1c')]=qs[_0x4afc('0x1c')](_0x426e9d[_0x4afc('0x2d')]['limit']);_0x5e4747[_0x4afc('0x1a')]=qs[_0x4afc('0x1a')](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x1a')]);}_0x5e4747['order']=qs['sort'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x36')]);_0x5e4747[_0x4afc('0x37')]=qs['filters'](_['pick'](_0x426e9d[_0x4afc('0x2d')],_0xd26d2f['filters']),_0x494fe7);if(_0x426e9d['query'][_0x4afc('0x38')]){_0x5e4747[_0x4afc('0x37')]=_[_0x4afc('0x39')](_0x5e4747[_0x4afc('0x37')],{'$or':_[_0x4afc('0x3a')](_0x494fe7,function(_0x4420fb){if(_0x4420fb[_0x4afc('0x2a')]!==_0x4afc('0x3b')){var _0x3ccc5a={};_0x3ccc5a[_0x4420fb[_0x4afc('0x27')]]={'$like':'%'+_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x38')]+'%'};return _0x3ccc5a;}})});}_0x5e4747=_[_0x4afc('0x39')]({},_0x5e4747,_0x426e9d[_0x4afc('0x3c')]);var _0x46dd2a={'where':_0x5e4747['where']};return db[_0x4afc('0x3d')][_0x4afc('0x1d')](_0x46dd2a)[_0x4afc('0x25')](function(_0xe6db12){_0x628e42[_0x4afc('0x1d')]=_0xe6db12;if(_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x3e')]){_0x5e4747['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x5e4747);})[_0x4afc('0x25')](function(_0x105c03){_0x628e42['rows']=_0x105c03;return _0x628e42;})[_0x4afc('0x25')](respondWithFilteredResult(_0x5db47e,_0x5e4747))[_0x4afc('0x3f')](handleError(_0x5db47e,null));};exports[_0x4afc('0x40')]=function(_0x397996,_0x545109){var _0x12b5db={'raw':!![],'where':{'id':_0x397996[_0x4afc('0x41')]['id']}},_0x45c9c3={};_0x45c9c3[_0x4afc('0x2c')]=_[_0x4afc('0x2e')](db[_0x4afc('0x3d')]['rawAttributes']);_0x45c9c3[_0x4afc('0x2d')]=_['keys'](_0x397996[_0x4afc('0x2d')]);_0x45c9c3[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0x45c9c3['model'],_0x45c9c3['query']);_0x12b5db[_0x4afc('0x32')]=_[_0x4afc('0x30')](_0x45c9c3[_0x4afc('0x2c')],qs[_0x4afc('0x31')](_0x397996[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x12b5db[_0x4afc('0x32')]=_0x12b5db[_0x4afc('0x32')]['length']?_0x12b5db[_0x4afc('0x32')]:_0x45c9c3[_0x4afc('0x2c')];if(_0x397996['query'][_0x4afc('0x3e')]){_0x12b5db['include']=[{'all':!![]}];}_0x12b5db=_[_0x4afc('0x39')]({},_0x12b5db,_0x397996[_0x4afc('0x3c')]);return db[_0x4afc('0x3d')]['find'](_0x12b5db)[_0x4afc('0x25')](handleEntityNotFound(_0x545109,null))[_0x4afc('0x25')](respondWithResult(_0x545109,null))[_0x4afc('0x3f')](handleError(_0x545109,null));};exports[_0x4afc('0x42')]=function(_0x4772db,_0x19a0ac){return db['CmHopperFinal']['describe']()['then'](respondWithResult(_0x19a0ac,null))[_0x4afc('0x3f')](handleError(_0x19a0ac,null));};exports[_0x4afc('0x23')]=function(_0x42e274,_0x269c24){if(_0x42e274[_0x4afc('0x43')][_0x4afc('0x44')]){delete _0x42e274[_0x4afc('0x43')][_0x4afc('0x44')];}return db[_0x4afc('0x3d')][_0x4afc('0x45')]({'where':{'uniqueid':_0x42e274['params']['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x269c24,null))['then'](saveUpdates(_0x42e274['body'],null))[_0x4afc('0x25')](respondWithResult(_0x269c24,null))['catch'](handleError(_0x269c24,null));};exports[_0x4afc('0x46')]=function(_0x355198,_0x2fe2ae,_0x2cafc3){return db['CmHopperFinal'][_0x4afc('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x355198['params']['id']},'attributes':[[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db[_0x4afc('0x48')][_0x4afc('0x4a')](_0x4afc('0x4b')))),_0x4afc('0x4c')],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db[_0x4afc('0x48')][_0x4afc('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0x4afc('0x4d')],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db[_0x4afc('0x48')][_0x4afc('0x4a')](_0x4afc('0x4e')))),_0x4afc('0x4f')],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db[_0x4afc('0x48')][_0x4afc('0x4a')]('`state`\x20=\x208,\x201,\x20null'))),_0x4afc('0x50')],[db['sequelize']['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db[_0x4afc('0x48')][_0x4afc('0x4a')]('`state`\x20=\x2010\x20,\x201,\x20null'))),'dropContacts'],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db['sequelize']['fn']('IF',db[_0x4afc('0x48')][_0x4afc('0x4a')](_0x4afc('0x51')))),_0x4afc('0x52')],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db[_0x4afc('0x48')][_0x4afc('0x4a')](_0x4afc('0x53')))),_0x4afc('0x54')],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db['sequelize'][_0x4afc('0x4a')](_0x4afc('0x55')))),_0x4afc('0x56')]]})[_0x4afc('0x25')](handleEntityNotFound(_0x2fe2ae,null))[_0x4afc('0x25')](respondWithResult(_0x2fe2ae,null))[_0x4afc('0x3f')](handleError(_0x2fe2ae,null));};exports[_0x4afc('0x57')]=function(_0x4985c6,_0x1771e8,_0x323c65){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x4985c6[_0x4afc('0x41')]['id']},'attributes':[[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db[_0x4afc('0x48')][_0x4afc('0x4a')](_0x4afc('0x4b')))),_0x4afc('0x4c')],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db['sequelize']['fn']('IF',db['sequelize'][_0x4afc('0x4a')](_0x4afc('0x58')))),'noAnswerContacts'],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db['sequelize']['fn']('IF',db['sequelize'][_0x4afc('0x4a')](_0x4afc('0x4e')))),_0x4afc('0x4f')],[db['sequelize']['fn'](_0x4afc('0x49'),db['sequelize']['fn']('IF',db['sequelize'][_0x4afc('0x4a')](_0x4afc('0x59')))),_0x4afc('0x50')],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db[_0x4afc('0x48')][_0x4afc('0x4a')](_0x4afc('0x5a')))),'dropContacts'],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x4afc('0x52')],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db['sequelize']['fn']('IF',db[_0x4afc('0x48')]['literal']('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db[_0x4afc('0x48')]['fn'](_0x4afc('0x49'),db[_0x4afc('0x48')]['fn']('IF',db['sequelize'][_0x4afc('0x4a')](_0x4afc('0x55')))),_0x4afc('0x56')]]})['then'](handleEntityNotFound(_0x1771e8,null))[_0x4afc('0x25')](respondWithResult(_0x1771e8,null))[_0x4afc('0x3f')](handleError(_0x1771e8,null));};exports[_0x4afc('0x5b')]=function(_0x392252,_0x1f652a,_0x481263){return db['VoiceQueue'][_0x4afc('0x45')]({'where':{'id':_0x392252[_0x4afc('0x41')]['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x1f652a,null))['then'](function(_0x380c56){var _0x14a216;if(_0x380c56){_0x14a216=squel[_0x4afc('0x5c')]()[_0x4afc('0x5d')](_0x4afc('0x5e'))['fromQuery']([_0x4afc('0x5f'),_0x4afc('0x60'),'ContactId',_0x4afc('0x61'),_0x4afc('0x62'),_0x4afc('0x63'),'updatedAt'],squel[_0x4afc('0x64')]()[_0x4afc('0x65')](_0x4afc('0x66'),_0x4afc('0x5f'))[_0x4afc('0x65')](_0x4afc('0x67'),_0x4afc('0x60'))[_0x4afc('0x65')]('ANY_VALUE(ContactId)',_0x4afc('0x68'))['field']('ANY_VALUE(ListId)',_0x4afc('0x61'))[_0x4afc('0x65')](_0x4afc('0x69'),'VoiceQueueId')['field'](_0x4afc('0x67'),_0x4afc('0x63'))[_0x4afc('0x65')](_0x4afc('0x67'),_0x4afc('0x6a'))[_0x4afc('0x6b')](_0x4afc('0x6c'))[_0x4afc('0x37')](_0x4afc('0x6d'),_0x392252[_0x4afc('0x41')]['id'][_0x4afc('0x6e')]())[_0x4afc('0x37')](_0x4afc('0x6f'),_0x392252[_0x4afc('0x43')][_0x4afc('0x70')][_0x4afc('0x6e')]())['where'](_0x4afc('0x71'))[_0x4afc('0x37')](_0x4afc('0x72'),squel[_0x4afc('0x64')]()[_0x4afc('0x65')](_0x4afc('0x5f'))[_0x4afc('0x6b')](_0x4afc('0x5e'))[_0x4afc('0x37')]('VoiceQueueId\x20=\x20?',_0x392252[_0x4afc('0x41')]['id'][_0x4afc('0x6e')]()))[_0x4afc('0x37')](_0x4afc('0x72'),squel['select']()[_0x4afc('0x65')](_0x4afc('0x73'))[_0x4afc('0x6b')](_0x4afc('0x6c'))[_0x4afc('0x37')](_0x4afc('0x6d'),_0x392252[_0x4afc('0x41')]['id'][_0x4afc('0x6e')]())[_0x4afc('0x37')](_0x4afc('0x74')))['group'](_0x4afc('0x68')))[_0x4afc('0x6e')]();return db['sequelize'][_0x4afc('0x2d')](_0x14a216);}return[];})[_0x4afc('0x25')](respondWithResult(_0x1f652a,null))[_0x4afc('0x3f')](handleError(_0x1f652a,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x1c3d20,_0x3478aa,_0x24553b){return db[_0x4afc('0x75')]['find']({'where':{'id':_0x1c3d20[_0x4afc('0x41')]['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x3478aa,null))['then'](function(_0x2dc8a1){var _0x36f3ea;if(_0x2dc8a1){_0x36f3ea=squel[_0x4afc('0x5c')]()['into']('cm_hopper')[_0x4afc('0x76')]([_0x4afc('0x5f'),_0x4afc('0x60'),_0x4afc('0x68'),_0x4afc('0x61'),_0x4afc('0x77'),_0x4afc('0x63'),_0x4afc('0x6a')],squel[_0x4afc('0x64')]()[_0x4afc('0x65')](_0x4afc('0x66'),_0x4afc('0x5f'))[_0x4afc('0x65')](_0x4afc('0x67'),_0x4afc('0x60'))[_0x4afc('0x65')]('ANY_VALUE(ContactId)',_0x4afc('0x68'))[_0x4afc('0x65')]('ANY_VALUE(ListId)',_0x4afc('0x61'))['field']('ANY_VALUE(CampaignId)',_0x4afc('0x77'))['field']('NOW()',_0x4afc('0x63'))['field'](_0x4afc('0x67'),'updatedAt')[_0x4afc('0x6b')](_0x4afc('0x6c'))[_0x4afc('0x37')](_0x4afc('0x78'),_0x1c3d20[_0x4afc('0x41')]['id']['toString']())[_0x4afc('0x37')](_0x4afc('0x6f'),_0x1c3d20['body']['state'][_0x4afc('0x6e')]())[_0x4afc('0x37')](_0x4afc('0x71'))[_0x4afc('0x37')](_0x4afc('0x72'),squel['select']()[_0x4afc('0x65')](_0x4afc('0x5f'))[_0x4afc('0x6b')](_0x4afc('0x5e'))['where'](_0x4afc('0x78'),_0x1c3d20['params']['id'][_0x4afc('0x6e')]()))[_0x4afc('0x37')](_0x4afc('0x72'),squel[_0x4afc('0x64')]()[_0x4afc('0x65')](_0x4afc('0x73'))[_0x4afc('0x6b')](_0x4afc('0x6c'))[_0x4afc('0x37')](_0x4afc('0x78'),_0x1c3d20[_0x4afc('0x41')]['id']['toString']())[_0x4afc('0x37')]('state\x20=\x204'))[_0x4afc('0x79')]('ContactId'))['toString']();return db[_0x4afc('0x48')]['query'](_0x36f3ea);}return[];})['then'](respondWithResult(_0x3478aa,null))[_0x4afc('0x3f')](handleError(_0x3478aa,null));};exports['checkContactHopper']=function(_0x272e36,_0x24bf53,_0x5b1421){return db[_0x4afc('0x7a')][_0x4afc('0x7b')]({'where':{'VoiceQueueId':_0x272e36['body'][_0x4afc('0x62')],'CampaignId':_0x272e36[_0x4afc('0x43')][_0x4afc('0x77')],'ContactId':_0x272e36['body'][_0x4afc('0x68')]}})[_0x4afc('0x25')](handleEntityNotFound(_0x24bf53,null))[_0x4afc('0x25')](function(_0x16eb6d){if(_0x16eb6d){return _0x16eb6d;}return null;})[_0x4afc('0x25')](respondWithResult(_0x24bf53,null))[_0x4afc('0x3f')](handleError(_0x24bf53,null));};
\ No newline at end of file
+var _0x90b1=['uniqueid','countContactsQueueCampaignHopperFinal','findAll','params','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','into','ListId','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','CmHopperFinal','includeAll','rows','include','find','catch','update','body'];(function(_0x758841,_0x29e9df){var _0x24e623=function(_0x5474ea){while(--_0x5474ea){_0x758841['push'](_0x758841['shift']());}};_0x24e623(++_0x29e9df);}(_0x90b1,0x1bb));var _0x190b=function(_0x1d3906,_0x551f8c){_0x1d3906=_0x1d3906-0x0;var _0x90e496=_0x90b1[_0x1d3906];return _0x90e496;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['CmHopperFinal'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':!![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['describe']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['describe']()[_0x190b('0x22')](respondWithResult(_0xadc789,null))[_0x190b('0x42')](handleError(_0xadc789,null));};exports[_0x190b('0x43')]=function(_0x505e52,_0x4cb561){if(_0x505e52[_0x190b('0x44')][_0x190b('0x45')]){delete _0x505e52[_0x190b('0x44')][_0x190b('0x45')];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'uniqueid':_0x505e52['params']['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x4cb561,null))[_0x190b('0x22')](saveUpdates(_0x505e52[_0x190b('0x44')],null))['then'](respondWithResult(_0x4cb561,null))[_0x190b('0x42')](handleError(_0x4cb561,null));};exports[_0x190b('0x46')]=function(_0x215ab6,_0x503700,_0xbc6757){return db[_0x190b('0x3d')][_0x190b('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x215ab6[_0x190b('0x48')]['id']},'attributes':[[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4c')))),_0x190b('0x4d')],[db['sequelize']['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')]('`state`\x20=\x203,\x201,\x20null'))),_0x190b('0x4e')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4f')))),_0x190b('0x50')],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')]['literal'](_0x190b('0x51')))),'congestionContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x52')))),_0x190b('0x53')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x54')))),_0x190b('0x55')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db['sequelize'][_0x190b('0x4b')]('`state`\x20=\x2019,\x201,\x20null'))),_0x190b('0x57')]]})[_0x190b('0x22')](handleEntityNotFound(_0x503700,null))[_0x190b('0x22')](respondWithResult(_0x503700,null))['catch'](handleError(_0x503700,null));};exports[_0x190b('0x58')]=function(_0x270b59,_0xffe7cb,_0x405e04){return db[_0x190b('0x3d')][_0x190b('0x47')]({'raw':![],'where':{'CampaignId':_0x270b59[_0x190b('0x48')]['id']},'attributes':[[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db['sequelize'][_0x190b('0x4b')](_0x190b('0x4c')))),_0x190b('0x4d')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')]['literal'](_0x190b('0x59')))),_0x190b('0x4e')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4f')))),'busyContacts'],[db[_0x190b('0x49')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x51')))),'congestionContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x52')))),_0x190b('0x53')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x54')))),_0x190b('0x55')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')]('`state`\x20=\x2022,\x201,\x20null'))),_0x190b('0x5a')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db['sequelize'][_0x190b('0x4b')](_0x190b('0x5b')))),_0x190b('0x57')]]})[_0x190b('0x22')](handleEntityNotFound(_0xffe7cb,null))['then'](respondWithResult(_0xffe7cb,null))[_0x190b('0x42')](handleError(_0xffe7cb,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x2495c9,_0x348beb,_0x360d39){return db[_0x190b('0x5c')]['find']({'where':{'id':_0x2495c9[_0x190b('0x48')]['id']}})['then'](handleEntityNotFound(_0x348beb,null))[_0x190b('0x22')](function(_0x5073d2){var _0x49b60c;if(_0x5073d2){_0x49b60c=squel[_0x190b('0x5d')]()['into'](_0x190b('0x5e'))[_0x190b('0x5f')]([_0x190b('0x60'),_0x190b('0x61'),_0x190b('0x62'),'ListId',_0x190b('0x63'),_0x190b('0x64'),_0x190b('0x65')],squel['select']()[_0x190b('0x66')](_0x190b('0x67'),'phone')[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x61'))['field'](_0x190b('0x69'),_0x190b('0x62'))[_0x190b('0x66')](_0x190b('0x6a'),'ListId')[_0x190b('0x66')](_0x190b('0x6b'),_0x190b('0x63'))['field'](_0x190b('0x68'),_0x190b('0x64'))[_0x190b('0x66')]('NOW()',_0x190b('0x65'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9['params']['id']['toString']())[_0x190b('0x3a')](_0x190b('0x6f'),_0x2495c9['body'][_0x190b('0x70')][_0x190b('0x71')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x190b('0x3a')](_0x190b('0x72'),squel['select']()['field'](_0x190b('0x60'))[_0x190b('0x6c')](_0x190b('0x5e'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9['params']['id']['toString']()))[_0x190b('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x74'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9[_0x190b('0x48')]['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x75')))['group'](_0x190b('0x62')))[_0x190b('0x71')]();return db[_0x190b('0x49')]['query'](_0x49b60c);}return[];})['then'](respondWithResult(_0x348beb,null))[_0x190b('0x42')](handleError(_0x348beb,null));};exports[_0x190b('0x76')]=function(_0x4b988d,_0x40ac95,_0x18c5f4){return db[_0x190b('0x77')]['find']({'where':{'id':_0x4b988d[_0x190b('0x48')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x40ac95,null))['then'](function(_0x23298e){var _0x2ba27b;if(_0x23298e){_0x2ba27b=squel['insert']()[_0x190b('0x78')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x190b('0x62'),_0x190b('0x79'),'CampaignId',_0x190b('0x64'),_0x190b('0x65')],squel['select']()[_0x190b('0x66')](_0x190b('0x67'),_0x190b('0x60'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x61'))[_0x190b('0x66')](_0x190b('0x69'),_0x190b('0x62'))['field'](_0x190b('0x6a'),'ListId')['field'](_0x190b('0x7a'),_0x190b('0x7b'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x64'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x65'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x7c'),_0x4b988d['params']['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x6f'),_0x4b988d[_0x190b('0x44')][_0x190b('0x70')][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x7d'))[_0x190b('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x60'))['from'](_0x190b('0x5e'))[_0x190b('0x3a')]('CampaignId\x20=\x20?',_0x4b988d['params']['id'][_0x190b('0x71')]()))[_0x190b('0x3a')](_0x190b('0x72'),squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x74'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x7c'),_0x4b988d['params']['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x75')))['group'](_0x190b('0x62')))[_0x190b('0x71')]();return db[_0x190b('0x49')][_0x190b('0x2d')](_0x2ba27b);}return[];})[_0x190b('0x22')](respondWithResult(_0x40ac95,null))[_0x190b('0x42')](handleError(_0x40ac95,null));};exports['checkContactHopper']=function(_0x476c86,_0x298824,_0x5e7c76){return db[_0x190b('0x7e')][_0x190b('0x7f')]({'where':{'VoiceQueueId':_0x476c86[_0x190b('0x44')][_0x190b('0x63')],'CampaignId':_0x476c86[_0x190b('0x44')][_0x190b('0x7b')],'ContactId':_0x476c86[_0x190b('0x44')][_0x190b('0x62')]}})['then'](handleEntityNotFound(_0x298824,null))[_0x190b('0x22')](function(_0x1b3168){if(_0x1b3168){return _0x1b3168;}return null;})[_0x190b('0x22')](respondWithResult(_0x298824,null))[_0x190b('0x42')](handleError(_0x298824,null));};
\ No newline at end of file
index e7e75aa..fee37fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d18=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','util'];(function(_0x3b30c1,_0xa9bc2e){var _0x31d847=function(_0x35f942){while(--_0x35f942){_0x3b30c1['push'](_0x3b30c1['shift']());}};_0x31d847(++_0xa9bc2e);}(_0x7d18,0x1a3));var _0x87d1=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0x7d18[_0x5bfa44];return _0x43815f;};'use strict';var _=require('lodash');var util=require(_0x87d1('0x0'));var logger=require(_0x87d1('0x1'))('api');var moment=require(_0x87d1('0x2'));var BPromise=require(_0x87d1('0x3'));var rp=require(_0x87d1('0x4'));var fs=require('fs');var path=require(_0x87d1('0x5'));var rimraf=require(_0x87d1('0x6'));var config=require(_0x87d1('0x7'));var attributes=require(_0x87d1('0x8'));module[_0x87d1('0x9')]=function(_0x4f0828,_0x1ecf74){return _0x4f0828[_0x87d1('0xa')]('CmHopperFinal',attributes,{'tableName':_0x87d1('0xb'),'paranoid':![],'indexes':[{'name':_0x87d1('0xc'),'fields':['calleridnum']},{'name':_0x87d1('0xd'),'fields':[_0x87d1('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c41=['moment','../../config/environment','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','lodash','api'];(function(_0x966a17,_0xfc5b1){var _0xea4f3c=function(_0x4678e3){while(--_0x4678e3){_0x966a17['push'](_0x966a17['shift']());}};_0xea4f3c(++_0xfc5b1);}(_0x9c41,0xf1));var _0x19c4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9c41[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x19c4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x19c4('0x1'));var moment=require(_0x19c4('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x19c4('0x3'));var attributes=require(_0x19c4('0x4'));module[_0x19c4('0x5')]=function(_0x3ebf3,_0x3f31b5){return _0x3ebf3['define'](_0x19c4('0x6'),attributes,{'tableName':_0x19c4('0x7'),'paranoid':![],'indexes':[{'name':_0x19c4('0x8'),'fields':['calleridnum']},{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 4b59958..5b9e85a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x965a0a,_0x5494f7){var _0x16081e=function(_0x8d4864){while(--_0x8d4864){_0x965a0a['push'](_0x965a0a['shift']());}};_0x16081e(++_0x5494f7);}(_0x7a54,0x106));var _0x47a5=function(_0x13b5e1,_0x532f61){_0x13b5e1=_0x13b5e1-0x0;var _0x7baf57=_0x7a54[_0x13b5e1];return _0x7baf57;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};
\ No newline at end of file
+var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x7c941,_0x1d9e09){var _0x4f6202=function(_0x1ad7da){while(--_0x1ad7da){_0x7c941['push'](_0x7c941['shift']());}};_0x4f6202(++_0x1d9e09);}(_0x7a54,0x106));var _0x47a5=function(_0x55aaa6,_0x3246dd){_0x55aaa6=_0x55aaa6-0x0;var _0x50af05=_0x7a54[_0x55aaa6];return _0x50af05;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};
\ No newline at end of file
index 81c1d35..e2860fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c78=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','update','multer','util','path','connect-timeout'];(function(_0xb6a965,_0x5c5ace){var _0x51d37d=function(_0x1c7c0d){while(--_0x1c7c0d){_0xb6a965['push'](_0xb6a965['shift']());}};_0x51d37d(++_0x5c5ace);}(_0x0c78,0x1ea));var _0x80c7=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x0c78[_0x376b45];return _0x2341b3;};'use strict';var multer=require(_0x80c7('0x0'));var util=require(_0x80c7('0x1'));var path=require(_0x80c7('0x2'));var timeout=require(_0x80c7('0x3'));var express=require('express');var router=express[_0x80c7('0x4')]();var fs_extra=require(_0x80c7('0x5'));var auth=require(_0x80c7('0x6'));var interaction=require(_0x80c7('0x7'));var config=require(_0x80c7('0x8'));var controller=require(_0x80c7('0x9'));router[_0x80c7('0xa')]('/',auth['isAuthenticated'](),controller[_0x80c7('0xb')]);router[_0x80c7('0xa')](_0x80c7('0xc'),auth[_0x80c7('0xd')](),controller[_0x80c7('0xe')]);router[_0x80c7('0xa')](_0x80c7('0xf'),auth[_0x80c7('0xd')](),controller[_0x80c7('0x10')]);router[_0x80c7('0xa')](_0x80c7('0x11'),auth[_0x80c7('0xd')](),controller[_0x80c7('0x12')]);router[_0x80c7('0xa')](_0x80c7('0x13'),auth[_0x80c7('0xd')](),controller[_0x80c7('0x14')]);router[_0x80c7('0x15')]('/voice/queue/moveContacts/:id',auth[_0x80c7('0xd')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0x80c7('0x15')](_0x80c7('0x16'),auth[_0x80c7('0xd')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x80c7('0x15')](_0x80c7('0x17'),auth[_0x80c7('0xd')](),controller[_0x80c7('0x18')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x80c7('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0xa23f=['post','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','/describe','describe','show','get','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal'];(function(_0x15a208,_0x2811ab){var _0x5442ca=function(_0x275599){while(--_0x275599){_0x15a208['push'](_0x15a208['shift']());}};_0x5442ca(++_0x2811ab);}(_0xa23f,0x18d));var _0xfa23=function(_0x4b92d5,_0x4cb414){_0x4b92d5=_0x4b92d5-0x0;var _0x4ff0c5=_0xa23f[_0x4b92d5];return _0x4ff0c5;};'use strict';var multer=require(_0xfa23('0x0'));var util=require(_0xfa23('0x1'));var path=require(_0xfa23('0x2'));var timeout=require(_0xfa23('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfa23('0x4'));var auth=require(_0xfa23('0x5'));var interaction=require(_0xfa23('0x6'));var config=require(_0xfa23('0x7'));var controller=require(_0xfa23('0x8'));router['get']('/',auth[_0xfa23('0x9')](),controller[_0xfa23('0xa')]);router['get'](_0xfa23('0xb'),auth['isAuthenticated'](),controller[_0xfa23('0xc')]);router['get']('/:id',auth[_0xfa23('0x9')](),controller[_0xfa23('0xd')]);router[_0xfa23('0xe')](_0xfa23('0xf'),auth['isAuthenticated'](),controller[_0xfa23('0x10')]);router[_0xfa23('0xe')](_0xfa23('0x11'),auth[_0xfa23('0x9')](),controller[_0xfa23('0x12')]);router['post']('/voice/queue/moveContacts/:id',auth[_0xfa23('0x9')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xfa23('0x13')]('/voice/campaign/moveContacts/:id',auth[_0xfa23('0x9')](),controller[_0xfa23('0x14')]);router[_0xfa23('0x13')](_0xfa23('0x15'),auth['isAuthenticated'](),controller[_0xfa23('0x16')]);router[_0xfa23('0x17')](_0xfa23('0x18'),auth[_0xfa23('0x9')](),controller['update']);module[_0xfa23('0x19')]=router;
\ No newline at end of file
index b29de8d..31f465c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf17=['DATE','STRING','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x7aee79,_0x124af2){var _0xcbf9d1=function(_0x3f9f5f){while(--_0x3f9f5f){_0x7aee79['push'](_0x7aee79['shift']());}};_0xcbf9d1(++_0x124af2);}(_0xbf17,0x69));var _0x7bf1=function(_0x13f41b,_0x106593){_0x13f41b=_0x13f41b-0x0;var _0x3b6a75=_0xbf17[_0x13f41b];return _0x3b6a75;};'use strict';var Sequelize=require(_0x7bf1('0x0'));module[_0x7bf1('0x1')]={'state':{'type':Sequelize[_0x7bf1('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x7bf1('0x3')]},'countbusyretry':{'type':Sequelize[_0x7bf1('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7bf1('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7bf1('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x7bf1('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x7bf1('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x7bf1('0x4')]},'originatecalleridname':{'type':Sequelize[_0x7bf1('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x7bf1('0x3')]},'responsetime':{'type':Sequelize[_0x7bf1('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x7bf1('0x3')]},'endtime':{'type':Sequelize[_0x7bf1('0x3')]},'ringtime':{'type':Sequelize[_0x7bf1('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x7bf1('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x7bf1('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x7bf1('0x4')]},'campaign':{'type':Sequelize[_0x7bf1('0x4')]},'campaigntype':{'type':Sequelize[_0x7bf1('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x7bf1('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x7bf1('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x7bf1('0x3')]},'edited':{'type':Sequelize[_0x7bf1('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7bf1('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7bf1('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7bf1('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x65aa=['INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x3dd8d9,_0x48341b){var _0x421c1d=function(_0x269042){while(--_0x269042){_0x3dd8d9['push'](_0x3dd8d9['shift']());}};_0x421c1d(++_0x48341b);}(_0x65aa,0x185));var _0xa65a=function(_0x2cb66f,_0xda3f05){_0x2cb66f=_0x2cb66f-0x0;var _0xd0fb1d=_0x65aa[_0x2cb66f];return _0xd0fb1d;};'use strict';var Sequelize=require(_0xa65a('0x0'));module['exports']={'state':{'type':Sequelize[_0xa65a('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xa65a('0x2')]},'scheduledat':{'type':Sequelize[_0xa65a('0x3')]},'countbusyretry':{'type':Sequelize[_0xa65a('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa65a('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa65a('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa65a('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xa65a('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xa65a('0x2')]},'originatecalleridname':{'type':Sequelize[_0xa65a('0x2')]},'calleridnum':{'type':Sequelize[_0xa65a('0x2')]},'calleridname':{'type':Sequelize[_0xa65a('0x2')]},'starttime':{'type':Sequelize[_0xa65a('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xa65a('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa65a('0x3')]},'ringtime':{'type':Sequelize[_0xa65a('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa65a('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xa65a('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa65a('0x2')]},'campaign':{'type':Sequelize[_0xa65a('0x2')]},'campaigntype':{'type':Sequelize[_0xa65a('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xa65a('0x2')]},'amd':{'type':Sequelize[_0xa65a('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0xa65a('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0xa65a('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa65a('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0xa65a('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa65a('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa65a('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa65a('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xa65a('0x2')]}};
\ No newline at end of file
index cca3b80..958f09f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a75=['send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperHistory','includeAll','include','findAll','show','params','rawAttributes','find','create','body','catch','describe','uniqueid','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','apply','reject','save','update','then','error','stack','name'];(function(_0x3e8777,_0x54fce6){var _0x29aa0c=function(_0x3e93e3){while(--_0x3e93e3){_0x3e8777['push'](_0x3e8777['shift']());}};_0x29aa0c(++_0x54fce6);}(_0x2a75,0x111));var _0x52a7=function(_0x132ccc,_0x3e7453){_0x132ccc=_0x132ccc-0x0;var _0xe51d61=_0x2a75[_0x132ccc];return _0xe51d61;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x52a7('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x52a7('0x1'));var moment=require(_0x52a7('0x2'));var BPromise=require(_0x52a7('0x3'));var Mustache=require(_0x52a7('0x4'));var util=require(_0x52a7('0x5'));var path=require(_0x52a7('0x6'));var sox=require(_0x52a7('0x7'));var csv=require('to-csv');var ejs=require(_0x52a7('0x8'));var fs=require('fs');var fs_extra=require(_0x52a7('0x9'));var _=require('lodash');var squel=require(_0x52a7('0xa'));var crypto=require(_0x52a7('0xb'));var jsforce=require(_0x52a7('0xc'));var deskjs=require(_0x52a7('0xd'));var toCsv=require(_0x52a7('0xe'));var querystring=require(_0x52a7('0xf'));var Papa=require(_0x52a7('0x10'));var Redis=require(_0x52a7('0x11'));var authService=require(_0x52a7('0x12'));var qs=require(_0x52a7('0x13'));var as=require(_0x52a7('0x14'));var hardwareService=require(_0x52a7('0x15'));var logger=require(_0x52a7('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x52a7('0x17'));var licenseUtil=require(_0x52a7('0x18'));var db=require(_0x52a7('0x19'))['db'];function respondWithStatusCode(_0x462640,_0x4c7514){_0x4c7514=_0x4c7514||0xcc;return function(_0xc5bb87){if(_0xc5bb87){return _0x462640[_0x52a7('0x1a')](_0x4c7514);}return _0x462640['status'](_0x4c7514)[_0x52a7('0x1b')]();};}function respondWithResult(_0xffb11e,_0x5e3dbf){_0x5e3dbf=_0x5e3dbf||0xc8;return function(_0x14c3eb){if(_0x14c3eb){return _0xffb11e['status'](_0x5e3dbf)['json'](_0x14c3eb);}};}function respondWithFilteredResult(_0x5b9c28,_0x2461c2){return function(_0x518a54){if(_0x518a54){var _0x2d2fa1=typeof _0x2461c2[_0x52a7('0x1c')]===_0x52a7('0x1d')&&typeof _0x2461c2[_0x52a7('0x1e')]===_0x52a7('0x1d');var _0xb050bc=_0x518a54[_0x52a7('0x1f')];var _0x28843b=_0x2d2fa1?0x0:_0x2461c2[_0x52a7('0x1c')];var _0x3d388c=_0x2d2fa1?_0x518a54['count']:_0x2461c2['offset']+_0x2461c2[_0x52a7('0x1e')];var _0x5ba1c0;if(_0x3d388c>=_0xb050bc){_0x3d388c=_0xb050bc;_0x5ba1c0=0xc8;}else{_0x5ba1c0=0xce;}_0x5b9c28[_0x52a7('0x20')](_0x5ba1c0);return _0x5b9c28['set'](_0x52a7('0x21'),_0x28843b+'-'+_0x3d388c+'/'+_0xb050bc)[_0x52a7('0x22')](_0x518a54);}return null;};}function patchUpdates(_0x4ec149){return function(_0x32081e){try{jsonpatch[_0x52a7('0x23')](_0x32081e,_0x4ec149,!![]);}catch(_0x445a31){return BPromise[_0x52a7('0x24')](_0x445a31);}return _0x32081e[_0x52a7('0x25')]();};}function saveUpdates(_0x2fd20f,_0x3b397d){return function(_0x5e664d){if(_0x5e664d){return _0x5e664d[_0x52a7('0x26')](_0x2fd20f)[_0x52a7('0x27')](function(_0x11df1b){return _0x11df1b;});}return null;};}function removeEntity(_0x36ed81,_0x308820){return function(_0x4a5a37){if(_0x4a5a37){return _0x4a5a37['destroy']()[_0x52a7('0x27')](function(){_0x36ed81[_0x52a7('0x20')](0xcc)[_0x52a7('0x1b')]();});}};}function handleEntityNotFound(_0x2935fe,_0x41139d){return function(_0x2c14f9){if(!_0x2c14f9){_0x2935fe[_0x52a7('0x1a')](0x194);}return _0x2c14f9;};}function handleError(_0x43bb24,_0x5653b0){_0x5653b0=_0x5653b0||0x1f4;return function(_0x2c8758){logger[_0x52a7('0x28')](_0x2c8758[_0x52a7('0x29')]);if(_0x2c8758[_0x52a7('0x2a')]){delete _0x2c8758[_0x52a7('0x2a')];}_0x43bb24['status'](_0x5653b0)[_0x52a7('0x2b')](_0x2c8758);};}exports[_0x52a7('0x2c')]=function(_0x3cc8bc,_0x74a375){var _0x333b3c={},_0x2c1327={},_0x95a0ee={'count':0x0,'rows':[]};var _0x4d5359=_[_0x52a7('0x2d')](db['CmHopperHistory']['rawAttributes'],function(_0x2a4056){return{'name':_0x2a4056[_0x52a7('0x2e')],'type':_0x2a4056[_0x52a7('0x2f')][_0x52a7('0x30')]};});_0x2c1327[_0x52a7('0x31')]=_[_0x52a7('0x2d')](_0x4d5359,_0x52a7('0x2a'));_0x2c1327[_0x52a7('0x32')]=_[_0x52a7('0x33')](_0x3cc8bc['query']);_0x2c1327[_0x52a7('0x34')]=_[_0x52a7('0x35')](_0x2c1327['model'],_0x2c1327[_0x52a7('0x32')]);_0x333b3c[_0x52a7('0x36')]=_[_0x52a7('0x35')](_0x2c1327[_0x52a7('0x31')],qs[_0x52a7('0x37')](_0x3cc8bc[_0x52a7('0x32')][_0x52a7('0x37')]));_0x333b3c[_0x52a7('0x36')]=_0x333b3c[_0x52a7('0x36')][_0x52a7('0x38')]?_0x333b3c['attributes']:_0x2c1327['model'];if(!_0x3cc8bc[_0x52a7('0x32')][_0x52a7('0x39')](_0x52a7('0x3a'))){_0x333b3c[_0x52a7('0x1e')]=qs[_0x52a7('0x1e')](_0x3cc8bc[_0x52a7('0x32')][_0x52a7('0x1e')]);_0x333b3c[_0x52a7('0x1c')]=qs[_0x52a7('0x1c')](_0x3cc8bc[_0x52a7('0x32')][_0x52a7('0x1c')]);}_0x333b3c['order']=qs[_0x52a7('0x3b')](_0x3cc8bc[_0x52a7('0x32')][_0x52a7('0x3b')]);_0x333b3c[_0x52a7('0x3c')]=qs['filters'](_[_0x52a7('0x3d')](_0x3cc8bc[_0x52a7('0x32')],_0x2c1327[_0x52a7('0x34')]),_0x4d5359);if(_0x3cc8bc[_0x52a7('0x32')][_0x52a7('0x3e')]){_0x333b3c[_0x52a7('0x3c')]=_[_0x52a7('0x3f')](_0x333b3c['where'],{'$or':_[_0x52a7('0x2d')](_0x4d5359,function(_0x5be393){if(_0x5be393[_0x52a7('0x2f')]!==_0x52a7('0x40')){var _0x3dc7cb={};_0x3dc7cb[_0x5be393[_0x52a7('0x2a')]]={'$like':'%'+_0x3cc8bc['query'][_0x52a7('0x3e')]+'%'};return _0x3dc7cb;}})});}_0x333b3c=_[_0x52a7('0x3f')]({},_0x333b3c,_0x3cc8bc[_0x52a7('0x41')]);var _0x9be9bf={'where':_0x333b3c[_0x52a7('0x3c')]};return db[_0x52a7('0x42')][_0x52a7('0x1f')](_0x9be9bf)[_0x52a7('0x27')](function(_0x3e8192){_0x95a0ee['count']=_0x3e8192;if(_0x3cc8bc[_0x52a7('0x32')][_0x52a7('0x43')]){_0x333b3c[_0x52a7('0x44')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x52a7('0x45')](_0x333b3c);})['then'](function(_0x230f1e){_0x95a0ee['rows']=_0x230f1e;return _0x95a0ee;})[_0x52a7('0x27')](respondWithFilteredResult(_0x74a375,_0x333b3c))['catch'](handleError(_0x74a375,null));};exports[_0x52a7('0x46')]=function(_0x375300,_0x4761bb){var _0x12e8ac={'raw':!![],'where':{'id':_0x375300[_0x52a7('0x47')]['id']}},_0x592560={};_0x592560[_0x52a7('0x31')]=_[_0x52a7('0x33')](db['CmHopperHistory'][_0x52a7('0x48')]);_0x592560[_0x52a7('0x32')]=_['keys'](_0x375300[_0x52a7('0x32')]);_0x592560[_0x52a7('0x34')]=_[_0x52a7('0x35')](_0x592560[_0x52a7('0x31')],_0x592560['query']);_0x12e8ac['attributes']=_[_0x52a7('0x35')](_0x592560[_0x52a7('0x31')],qs['fields'](_0x375300[_0x52a7('0x32')][_0x52a7('0x37')]));_0x12e8ac[_0x52a7('0x36')]=_0x12e8ac['attributes'][_0x52a7('0x38')]?_0x12e8ac[_0x52a7('0x36')]:_0x592560[_0x52a7('0x31')];if(_0x375300[_0x52a7('0x32')]['includeAll']){_0x12e8ac[_0x52a7('0x44')]=[{'all':!![]}];}_0x12e8ac=_[_0x52a7('0x3f')]({},_0x12e8ac,_0x375300['options']);return db[_0x52a7('0x42')][_0x52a7('0x49')](_0x12e8ac)[_0x52a7('0x27')](handleEntityNotFound(_0x4761bb,null))[_0x52a7('0x27')](respondWithResult(_0x4761bb,null))['catch'](handleError(_0x4761bb,null));};exports[_0x52a7('0x4a')]=function(_0x5cfe2b,_0x21bec6){return db[_0x52a7('0x42')][_0x52a7('0x4a')](_0x5cfe2b[_0x52a7('0x4b')],{})[_0x52a7('0x27')](respondWithResult(_0x21bec6,0xc9))[_0x52a7('0x4c')](handleError(_0x21bec6,null));};exports[_0x52a7('0x4d')]=function(_0x35d7b5,_0x1c5f1c){return db['CmHopperHistory'][_0x52a7('0x4d')]()[_0x52a7('0x27')](respondWithResult(_0x1c5f1c,null))[_0x52a7('0x4c')](handleError(_0x1c5f1c,null));};exports[_0x52a7('0x26')]=function(_0x3601d4,_0x481f7a){if(_0x3601d4[_0x52a7('0x4b')][_0x52a7('0x4e')]){delete _0x3601d4[_0x52a7('0x4b')][_0x52a7('0x4e')];}return db[_0x52a7('0x42')][_0x52a7('0x49')]({'where':{'uniqueid':_0x3601d4[_0x52a7('0x47')]['id']}})[_0x52a7('0x27')](handleEntityNotFound(_0x481f7a,null))[_0x52a7('0x27')](saveUpdates(_0x3601d4['body'],null))[_0x52a7('0x27')](respondWithResult(_0x481f7a,null))[_0x52a7('0x4c')](handleError(_0x481f7a,null));};
\ No newline at end of file
+var _0x2b87=['findAll','rows','show','keys','rawAttributes','options','find','catch','create','body','describe','update','uniqueid','params','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','CmHopperHistory','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','includeAll'];(function(_0x33452f,_0x40c508){var _0x1c3dcc=function(_0x5e7997){while(--_0x5e7997){_0x33452f['push'](_0x33452f['shift']());}};_0x1c3dcc(++_0x40c508);}(_0x2b87,0x17b));var _0x72b8=function(_0x265826,_0x444f0b){_0x265826=_0x265826-0x0;var _0x22eece=_0x2b87[_0x265826];return _0x22eece;};'use strict';var emlformat=require(_0x72b8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x72b8('0x1'));var rp=require('request-promise');var moment=require(_0x72b8('0x2'));var BPromise=require(_0x72b8('0x3'));var Mustache=require(_0x72b8('0x4'));var util=require(_0x72b8('0x5'));var path=require(_0x72b8('0x6'));var sox=require(_0x72b8('0x7'));var csv=require('to-csv');var ejs=require(_0x72b8('0x8'));var fs=require('fs');var fs_extra=require(_0x72b8('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x72b8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x72b8('0xb'));var toCsv=require(_0x72b8('0xc'));var querystring=require(_0x72b8('0xd'));var Papa=require('papaparse');var Redis=require(_0x72b8('0xe'));var authService=require(_0x72b8('0xf'));var qs=require(_0x72b8('0x10'));var as=require(_0x72b8('0x11'));var hardwareService=require(_0x72b8('0x12'));var logger=require('../../config/logger')(_0x72b8('0x13'));var utils=require('../../config/utils');var config=require(_0x72b8('0x14'));var licenseUtil=require(_0x72b8('0x15'));var db=require(_0x72b8('0x16'))['db'];function respondWithStatusCode(_0x5d20c8,_0x46111e){_0x46111e=_0x46111e||0xcc;return function(_0x380c5c){if(_0x380c5c){return _0x5d20c8[_0x72b8('0x17')](_0x46111e);}return _0x5d20c8[_0x72b8('0x18')](_0x46111e)[_0x72b8('0x19')]();};}function respondWithResult(_0x29afdf,_0x314f4a){_0x314f4a=_0x314f4a||0xc8;return function(_0x195d9a){if(_0x195d9a){return _0x29afdf[_0x72b8('0x18')](_0x314f4a)[_0x72b8('0x1a')](_0x195d9a);}};}function respondWithFilteredResult(_0x5b8129,_0x2ad210){return function(_0x664b8a){if(_0x664b8a){var _0x2f30ad=typeof _0x2ad210[_0x72b8('0x1b')]==='undefined'&&typeof _0x2ad210['limit']==='undefined';var _0x21abd9=_0x664b8a['count'];var _0x926e44=_0x2f30ad?0x0:_0x2ad210[_0x72b8('0x1b')];var _0x5b5ca1=_0x2f30ad?_0x664b8a[_0x72b8('0x1c')]:_0x2ad210[_0x72b8('0x1b')]+_0x2ad210['limit'];var _0x5d9213;if(_0x5b5ca1>=_0x21abd9){_0x5b5ca1=_0x21abd9;_0x5d9213=0xc8;}else{_0x5d9213=0xce;}_0x5b8129[_0x72b8('0x18')](_0x5d9213);return _0x5b8129[_0x72b8('0x1d')](_0x72b8('0x1e'),_0x926e44+'-'+_0x5b5ca1+'/'+_0x21abd9)[_0x72b8('0x1a')](_0x664b8a);}return null;};}function patchUpdates(_0x1126e7){return function(_0x2ed17){try{jsonpatch[_0x72b8('0x1f')](_0x2ed17,_0x1126e7,!![]);}catch(_0x28c84c){return BPromise[_0x72b8('0x20')](_0x28c84c);}return _0x2ed17[_0x72b8('0x21')]();};}function saveUpdates(_0x13af9e,_0x308a67){return function(_0x547227){if(_0x547227){return _0x547227['update'](_0x13af9e)[_0x72b8('0x22')](function(_0x148046){return _0x148046;});}return null;};}function removeEntity(_0x190820,_0x1d4b55){return function(_0x260793){if(_0x260793){return _0x260793[_0x72b8('0x23')]()[_0x72b8('0x22')](function(){_0x190820[_0x72b8('0x18')](0xcc)[_0x72b8('0x19')]();});}};}function handleEntityNotFound(_0x20b0d4,_0x2b6bda){return function(_0x50307e){if(!_0x50307e){_0x20b0d4['sendStatus'](0x194);}return _0x50307e;};}function handleError(_0x174a8b,_0x3f8ddf){_0x3f8ddf=_0x3f8ddf||0x1f4;return function(_0x636223){logger[_0x72b8('0x24')](_0x636223[_0x72b8('0x25')]);if(_0x636223[_0x72b8('0x26')]){delete _0x636223['name'];}_0x174a8b[_0x72b8('0x18')](_0x3f8ddf)[_0x72b8('0x27')](_0x636223);};}exports['index']=function(_0x2b4ab6,_0x5c169a){var _0x4e1c43={},_0x22546c={},_0x23413c={'count':0x0,'rows':[]};var _0x21becf=_[_0x72b8('0x28')](db[_0x72b8('0x29')]['rawAttributes'],function(_0x567478){return{'name':_0x567478['fieldName'],'type':_0x567478[_0x72b8('0x2a')][_0x72b8('0x2b')]};});_0x22546c['model']=_[_0x72b8('0x28')](_0x21becf,'name');_0x22546c[_0x72b8('0x2c')]=_['keys'](_0x2b4ab6[_0x72b8('0x2c')]);_0x22546c[_0x72b8('0x2d')]=_[_0x72b8('0x2e')](_0x22546c[_0x72b8('0x2f')],_0x22546c[_0x72b8('0x2c')]);_0x4e1c43['attributes']=_[_0x72b8('0x2e')](_0x22546c[_0x72b8('0x2f')],qs[_0x72b8('0x30')](_0x2b4ab6[_0x72b8('0x2c')][_0x72b8('0x30')]));_0x4e1c43[_0x72b8('0x31')]=_0x4e1c43['attributes'][_0x72b8('0x32')]?_0x4e1c43[_0x72b8('0x31')]:_0x22546c[_0x72b8('0x2f')];if(!_0x2b4ab6[_0x72b8('0x2c')][_0x72b8('0x33')](_0x72b8('0x34'))){_0x4e1c43[_0x72b8('0x35')]=qs[_0x72b8('0x35')](_0x2b4ab6[_0x72b8('0x2c')][_0x72b8('0x35')]);_0x4e1c43[_0x72b8('0x1b')]=qs[_0x72b8('0x1b')](_0x2b4ab6[_0x72b8('0x2c')]['offset']);}_0x4e1c43['order']=qs[_0x72b8('0x36')](_0x2b4ab6[_0x72b8('0x2c')][_0x72b8('0x36')]);_0x4e1c43['where']=qs['filters'](_['pick'](_0x2b4ab6['query'],_0x22546c[_0x72b8('0x2d')]),_0x21becf);if(_0x2b4ab6[_0x72b8('0x2c')]['filter']){_0x4e1c43[_0x72b8('0x37')]=_['merge'](_0x4e1c43[_0x72b8('0x37')],{'$or':_['map'](_0x21becf,function(_0x1b217e){if(_0x1b217e[_0x72b8('0x2a')]!=='VIRTUAL'){var _0x3efa05={};_0x3efa05[_0x1b217e[_0x72b8('0x26')]]={'$like':'%'+_0x2b4ab6[_0x72b8('0x2c')][_0x72b8('0x38')]+'%'};return _0x3efa05;}})});}_0x4e1c43=_[_0x72b8('0x39')]({},_0x4e1c43,_0x2b4ab6['options']);var _0x47f920={'where':_0x4e1c43[_0x72b8('0x37')]};return db['CmHopperHistory'][_0x72b8('0x1c')](_0x47f920)[_0x72b8('0x22')](function(_0x60e826){_0x23413c[_0x72b8('0x1c')]=_0x60e826;if(_0x2b4ab6[_0x72b8('0x2c')][_0x72b8('0x3a')]){_0x4e1c43['include']=[{'all':!![]}];}return db[_0x72b8('0x29')][_0x72b8('0x3b')](_0x4e1c43);})['then'](function(_0x4c5af2){_0x23413c[_0x72b8('0x3c')]=_0x4c5af2;return _0x23413c;})[_0x72b8('0x22')](respondWithFilteredResult(_0x5c169a,_0x4e1c43))['catch'](handleError(_0x5c169a,null));};exports[_0x72b8('0x3d')]=function(_0x4c1f8b,_0x5ee240){var _0xe9d7a0={'raw':!![],'where':{'id':_0x4c1f8b['params']['id']}},_0x326464={};_0x326464['model']=_[_0x72b8('0x3e')](db[_0x72b8('0x29')][_0x72b8('0x3f')]);_0x326464[_0x72b8('0x2c')]=_['keys'](_0x4c1f8b[_0x72b8('0x2c')]);_0x326464[_0x72b8('0x2d')]=_[_0x72b8('0x2e')](_0x326464[_0x72b8('0x2f')],_0x326464[_0x72b8('0x2c')]);_0xe9d7a0['attributes']=_[_0x72b8('0x2e')](_0x326464[_0x72b8('0x2f')],qs[_0x72b8('0x30')](_0x4c1f8b[_0x72b8('0x2c')][_0x72b8('0x30')]));_0xe9d7a0['attributes']=_0xe9d7a0[_0x72b8('0x31')][_0x72b8('0x32')]?_0xe9d7a0[_0x72b8('0x31')]:_0x326464[_0x72b8('0x2f')];if(_0x4c1f8b[_0x72b8('0x2c')][_0x72b8('0x3a')]){_0xe9d7a0['include']=[{'all':!![]}];}_0xe9d7a0=_['merge']({},_0xe9d7a0,_0x4c1f8b[_0x72b8('0x40')]);return db[_0x72b8('0x29')][_0x72b8('0x41')](_0xe9d7a0)[_0x72b8('0x22')](handleEntityNotFound(_0x5ee240,null))[_0x72b8('0x22')](respondWithResult(_0x5ee240,null))[_0x72b8('0x42')](handleError(_0x5ee240,null));};exports['create']=function(_0x4f7077,_0x4c4676){return db[_0x72b8('0x29')][_0x72b8('0x43')](_0x4f7077[_0x72b8('0x44')],{})[_0x72b8('0x22')](respondWithResult(_0x4c4676,0xc9))[_0x72b8('0x42')](handleError(_0x4c4676,null));};exports[_0x72b8('0x45')]=function(_0x1c3ed7,_0x2241c4){return db[_0x72b8('0x29')][_0x72b8('0x45')]()[_0x72b8('0x22')](respondWithResult(_0x2241c4,null))['catch'](handleError(_0x2241c4,null));};exports[_0x72b8('0x46')]=function(_0x15807e,_0x47594d){if(_0x15807e[_0x72b8('0x44')]['uniqueid']){delete _0x15807e[_0x72b8('0x44')][_0x72b8('0x47')];}return db['CmHopperHistory'][_0x72b8('0x41')]({'where':{'uniqueid':_0x15807e[_0x72b8('0x48')]['id']}})[_0x72b8('0x22')](handleEntityNotFound(_0x47594d,null))[_0x72b8('0x22')](saveUpdates(_0x15807e[_0x72b8('0x44')],null))['then'](respondWithResult(_0x47594d,null))[_0x72b8('0x42')](handleError(_0x47594d,null));};
\ No newline at end of file
index f90691d..c2623d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef4d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0x112e2a,_0x364486){var _0x4f8af9=function(_0xa11c0d){while(--_0xa11c0d){_0x112e2a['push'](_0x112e2a['shift']());}};_0x4f8af9(++_0x364486);}(_0xef4d,0x165));var _0xdef4=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xef4d[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0xdef4('0x0'));var util=require(_0xdef4('0x1'));var logger=require(_0xdef4('0x2'))(_0xdef4('0x3'));var moment=require(_0xdef4('0x4'));var BPromise=require(_0xdef4('0x5'));var rp=require(_0xdef4('0x6'));var fs=require('fs');var path=require(_0xdef4('0x7'));var rimraf=require(_0xdef4('0x8'));var config=require(_0xdef4('0x9'));var attributes=require(_0xdef4('0xa'));module[_0xdef4('0xb')]=function(_0x18ea9b,_0x5c6884){return _0x18ea9b[_0xdef4('0xc')](_0xdef4('0xd'),attributes,{'tableName':_0xdef4('0xe'),'paranoid':![],'indexes':[{'name':_0xdef4('0xf'),'fields':[_0xdef4('0xf')]},{'name':_0xdef4('0x10'),'fields':[_0xdef4('0x10')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb1ad=['CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define'];(function(_0x2229c4,_0x5b5747){var _0x328b33=function(_0x2d5149){while(--_0x2d5149){_0x2229c4['push'](_0x2229c4['shift']());}};_0x328b33(++_0x5b5747);}(_0xb1ad,0x184));var _0xdb1a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xb1ad[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xdb1a('0x0'));var util=require(_0xdb1a('0x1'));var logger=require(_0xdb1a('0x2'))(_0xdb1a('0x3'));var moment=require(_0xdb1a('0x4'));var BPromise=require(_0xdb1a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb1a('0x6'));var rimraf=require(_0xdb1a('0x7'));var config=require(_0xdb1a('0x8'));var attributes=require(_0xdb1a('0x9'));module[_0xdb1a('0xa')]=function(_0x3a19a1,_0x368208){return _0x3a19a1[_0xdb1a('0xb')](_0xdb1a('0xc'),attributes,{'tableName':_0xdb1a('0xd'),'paranoid':![],'indexes':[{'name':_0xdb1a('0xe'),'fields':[_0xdb1a('0xe')]},{'name':_0xdb1a('0xf'),'fields':[_0xdb1a('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index 8cd5ad8..d85a0d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab26=['`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','col','ivrAnswerCallsDay','lodash','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','CreateCmHopperHistory','CmHopperHistory','body','raw','stringify','catch','AvgHandleTime','findAll','options','sequelize','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','where','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null'];(function(_0x2019c0,_0x103e01){var _0x354cbf=function(_0x32a77d){while(--_0x32a77d){_0x2019c0['push'](_0x2019c0['shift']());}};_0x354cbf(++_0x103e01);}(_0xab26,0xd2));var _0x6ab2=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xab26[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x6ab2('0x0'));var util=require(_0x6ab2('0x1'));var moment=require(_0x6ab2('0x2'));var BPromise=require('bluebird');var rs=require(_0x6ab2('0x3'));var fs=require('fs');var Redis=require(_0x6ab2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6ab2('0x5'))('rpc');var config=require(_0x6ab2('0x6'));var jayson=require(_0x6ab2('0x7'));var client=jayson[_0x6ab2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41643a,_0x337cdf,_0x54bf93){return new BPromise(function(_0x140cc1,_0x3157f1){return client[_0x6ab2('0x9')](_0x41643a,_0x54bf93)[_0x6ab2('0xa')](function(_0x3bb68b){logger[_0x6ab2('0xb')](_0x6ab2('0xc'),_0x337cdf,_0x6ab2('0xd'));logger[_0x6ab2('0xe')](_0x6ab2('0xf'),_0x337cdf,_0x6ab2('0xd'),JSON['stringify'](_0x3bb68b));if(_0x3bb68b[_0x6ab2('0x10')]){if(_0x3bb68b[_0x6ab2('0x10')][_0x6ab2('0x11')]===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x337cdf,_0x3bb68b[_0x6ab2('0x10')][_0x6ab2('0x12')]);return _0x3157f1(_0x3bb68b[_0x6ab2('0x10')][_0x6ab2('0x12')]);}logger[_0x6ab2('0x10')](_0x6ab2('0xc'),_0x337cdf,_0x3bb68b[_0x6ab2('0x10')][_0x6ab2('0x12')]);return _0x140cc1(_0x3bb68b['error'][_0x6ab2('0x12')]);}else{logger['info'](_0x6ab2('0xc'),_0x337cdf,_0x6ab2('0xd'));_0x140cc1(_0x3bb68b['result']['message']);}})['catch'](function(_0x2adc75){logger[_0x6ab2('0x10')](_0x6ab2('0xc'),_0x337cdf,_0x2adc75);_0x3157f1(_0x2adc75);});});}exports[_0x6ab2('0x13')]=function(_0x272bd0){var _0x237ecd=this;return new Promise(function(_0x508376,_0x128b34){return db[_0x6ab2('0x14')]['create'](_0x272bd0[_0x6ab2('0x15')],{'raw':_0x272bd0['options']?_0x272bd0['options'][_0x6ab2('0x16')]===undefined?!![]:![]:!![]})[_0x6ab2('0xa')](function(_0x2ca855){logger[_0x6ab2('0xb')](_0x6ab2('0x13'),_0x272bd0);logger['debug'](_0x6ab2('0x13'),_0x272bd0,JSON[_0x6ab2('0x17')](_0x2ca855));_0x508376(_0x2ca855);})[_0x6ab2('0x18')](function(_0x3fad2b){logger[_0x6ab2('0x10')](_0x6ab2('0x13'),_0x3fad2b[_0x6ab2('0x12')],_0x272bd0);_0x128b34(_0x237ecd[_0x6ab2('0x10')](0x1f4,_0x3fad2b[_0x6ab2('0x12')]));});});};exports[_0x6ab2('0x19')]=function(_0x4fd76d){var _0x5a569e=this;return new Promise(function(_0x5769b8,_0x11e287){return db[_0x6ab2('0x14')][_0x6ab2('0x1a')]({'raw':_0x4fd76d['options']?_0x4fd76d[_0x6ab2('0x1b')][_0x6ab2('0x16')]===undefined?!![]:![]:!![],'where':_0x4fd76d[_0x6ab2('0x1b')]?_0x4fd76d[_0x6ab2('0x1b')]['where']||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x6ab2('0x1c')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0x6ab2('0x1c')]['fn'](_0x6ab2('0x1d'),db[_0x6ab2('0x1c')]['fn']('IF',db[_0x6ab2('0x1c')][_0x6ab2('0x1e')](_0x6ab2('0x1f')))),_0x6ab2('0x20')],[db[_0x6ab2('0x1c')]['fn'](_0x6ab2('0x1d'),db['sequelize']['fn']('IF',db[_0x6ab2('0x1c')][_0x6ab2('0x1e')]('`state`\x20=\x2010,\x201,\x20null'))),_0x6ab2('0x21')],[db['sequelize']['fn'](_0x6ab2('0x1d'),db[_0x6ab2('0x1c')]['fn']('IF',db[_0x6ab2('0x1c')][_0x6ab2('0x1e')](_0x6ab2('0x22')))),_0x6ab2('0x23')],[db['sequelize']['fn'](_0x6ab2('0x24'),db[_0x6ab2('0x1c')]['fn']('IF',db[_0x6ab2('0x1c')][_0x6ab2('0x1e')](_0x6ab2('0x25')))),_0x6ab2('0x26')],[db[_0x6ab2('0x1c')]['fn']('AVG',db[_0x6ab2('0x1c')]['fn']('IF',db[_0x6ab2('0x1c')]['literal']('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x6ab2('0x27')]]})[_0x6ab2('0xa')](function(_0x309165){logger[_0x6ab2('0xb')](_0x6ab2('0x19'),_0x4fd76d);logger[_0x6ab2('0xe')](_0x6ab2('0x19'),_0x4fd76d,JSON[_0x6ab2('0x17')](_0x309165));_0x5769b8(_0x309165);})['catch'](function(_0x5a4c87){logger[_0x6ab2('0x10')](_0x6ab2('0x19'),_0x5a4c87[_0x6ab2('0x12')],_0x4fd76d);_0x11e287(_0x5a569e[_0x6ab2('0x10')](0x1f4,_0x5a4c87[_0x6ab2('0x12')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x208701){var _0x7a7c66=this;return new Promise(function(_0x36cf31,_0x4ad1a6){return db[_0x6ab2('0x14')][_0x6ab2('0x1a')]({'raw':_0x208701['options']?_0x208701[_0x6ab2('0x1b')][_0x6ab2('0x16')]===undefined?!![]:![]:!![],'where':_0x208701[_0x6ab2('0x1b')]?_0x208701[_0x6ab2('0x1b')][_0x6ab2('0x28')]||null:null,'attributes':[[_0x6ab2('0x29'),_0x6ab2('0x2a')],[db['sequelize']['fn'](_0x6ab2('0x1d'),db['sequelize']['fn']('IF',db[_0x6ab2('0x1c')][_0x6ab2('0x1e')](_0x6ab2('0x2b')))),'outboundNoSuchCallsDay'],[db['sequelize']['fn'](_0x6ab2('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0x6ab2('0x1e')](_0x6ab2('0x2c')))),_0x6ab2('0x2d')],[db[_0x6ab2('0x1c')]['fn'](_0x6ab2('0x1d'),db['sequelize']['fn']('IF',db[_0x6ab2('0x1c')]['literal'](_0x6ab2('0x1f')))),_0x6ab2('0x2e')],[db[_0x6ab2('0x1c')]['fn'](_0x6ab2('0x1d'),db['sequelize']['fn']('IF',db[_0x6ab2('0x1c')][_0x6ab2('0x1e')](_0x6ab2('0x2f')))),_0x6ab2('0x30')],[db[_0x6ab2('0x1c')]['fn'](_0x6ab2('0x1d'),db[_0x6ab2('0x1c')]['fn']('IF',db[_0x6ab2('0x1c')][_0x6ab2('0x1e')](_0x6ab2('0x31')))),_0x6ab2('0x32')],[db[_0x6ab2('0x1c')]['fn']('COUNT',db[_0x6ab2('0x1c')]['fn']('IF',db[_0x6ab2('0x1c')][_0x6ab2('0x1e')](_0x6ab2('0x33')))),_0x6ab2('0x34')],[db[_0x6ab2('0x1c')]['fn']('COUNT',db[_0x6ab2('0x1c')]['fn']('IF',db[_0x6ab2('0x1c')][_0x6ab2('0x1e')](_0x6ab2('0x35')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn'](_0x6ab2('0x1d'),db[_0x6ab2('0x1c')]['fn']('IF',db[_0x6ab2('0x1c')][_0x6ab2('0x1e')](_0x6ab2('0x36')))),'outboundUnknownCallsDay'],[db[_0x6ab2('0x1c')]['fn'](_0x6ab2('0x1d'),db[_0x6ab2('0x1c')]['fn']('IF',db[_0x6ab2('0x1c')]['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0x6ab2('0x37')],[db[_0x6ab2('0x1c')]['fn']('COUNT',db[_0x6ab2('0x1c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2014,\x201,\x20null'))),_0x6ab2('0x38')],[db[_0x6ab2('0x1c')]['fn']('COUNT',db[_0x6ab2('0x1c')]['fn']('IF',db['sequelize'][_0x6ab2('0x1e')](_0x6ab2('0x39')))),_0x6ab2('0x3a')],[db[_0x6ab2('0x1c')]['fn']('COUNT',db[_0x6ab2('0x1c')]['fn']('IF',db[_0x6ab2('0x1c')][_0x6ab2('0x1e')](_0x6ab2('0x3b')))),_0x6ab2('0x3c')],[db[_0x6ab2('0x1c')]['fn'](_0x6ab2('0x1d'),db['sequelize']['fn']('IF',db[_0x6ab2('0x1c')][_0x6ab2('0x1e')](_0x6ab2('0x3d')))),_0x6ab2('0x3a')],[db[_0x6ab2('0x1c')]['fn'](_0x6ab2('0x1d'),db['sequelize']['fn']('IF',db[_0x6ab2('0x1c')]['literal'](_0x6ab2('0x3e')))),_0x6ab2('0x3f')]],'group':[_0x6ab2('0x29')]})[_0x6ab2('0xa')](function(_0x145428){logger[_0x6ab2('0xb')](_0x6ab2('0x40'),_0x208701);logger[_0x6ab2('0xe')](_0x6ab2('0x40'),_0x208701,JSON['stringify'](_0x145428));_0x36cf31(_0x145428);})[_0x6ab2('0x18')](function(_0x5df5be){logger['error'](_0x6ab2('0x40'),_0x5df5be[_0x6ab2('0x12')],_0x208701);_0x4ad1a6(_0x7a7c66[_0x6ab2('0x10')](0x1f4,_0x5df5be[_0x6ab2('0x12')]));});});};exports[_0x6ab2('0x41')]=function(_0x3ebcde){var _0x7f1000=this;return new Promise(function(_0x2f9aea,_0x2e76ab){return db[_0x6ab2('0x14')][_0x6ab2('0x1a')]({'raw':_0x3ebcde[_0x6ab2('0x1b')]?_0x3ebcde['options'][_0x6ab2('0x16')]===undefined?!![]:![]:!![],'where':_0x3ebcde[_0x6ab2('0x1b')]?_0x3ebcde[_0x6ab2('0x1b')][_0x6ab2('0x28')]||null:null,'attributes':[[_0x6ab2('0x29'),_0x6ab2('0x2a')],[db[_0x6ab2('0x1c')]['fn'](_0x6ab2('0x1d'),db[_0x6ab2('0x1c')][_0x6ab2('0x42')]('id')),'ivrTotalCallsDays'],[db[_0x6ab2('0x1c')]['fn'](_0x6ab2('0x1d'),db[_0x6ab2('0x1c')]['fn']('IF',db[_0x6ab2('0x1c')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x6ab2('0x43')]],'group':[_0x6ab2('0x29')]})[_0x6ab2('0xa')](function(_0x42a36a){logger['info'](_0x6ab2('0x41'),_0x3ebcde);logger[_0x6ab2('0xe')](_0x6ab2('0x41'),_0x3ebcde,JSON['stringify'](_0x42a36a));_0x2f9aea(_0x42a36a);})['catch'](function(_0xbc5aed){logger[_0x6ab2('0x10')](_0x6ab2('0x41'),_0xbc5aed[_0x6ab2('0x12')],_0x3ebcde);_0x2e76ab(_0x7f1000['error'](0x1f4,_0xbc5aed['message']));});});};
\ No newline at end of file
+var _0xa3b9=['ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CmHopperHistory','create','options','CreateCmHopperHistory','AvgHandleTime','raw','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','findAll','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','ivrTotalCallsDays'];(function(_0x33b83d,_0x3a2144){var _0x23e782=function(_0x571d5f){while(--_0x571d5f){_0x33b83d['push'](_0x33b83d['shift']());}};_0x23e782(++_0x3a2144);}(_0xa3b9,0x112));var _0x9a3b=function(_0x2bb023,_0x57522c){_0x2bb023=_0x2bb023-0x0;var _0x57b9cb=_0xa3b9[_0x2bb023];return _0x57b9cb;};'use strict';var _=require(_0x9a3b('0x0'));var util=require(_0x9a3b('0x1'));var moment=require(_0x9a3b('0x2'));var BPromise=require(_0x9a3b('0x3'));var rs=require(_0x9a3b('0x4'));var fs=require('fs');var Redis=require(_0x9a3b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9a3b('0x6'));var logger=require(_0x9a3b('0x7'))(_0x9a3b('0x8'));var config=require(_0x9a3b('0x9'));var jayson=require(_0x9a3b('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3a6a0d,_0x2357b8,_0x242fbe){return new BPromise(function(_0x2da1e2,_0x204d1f){return client[_0x9a3b('0xb')](_0x3a6a0d,_0x242fbe)[_0x9a3b('0xc')](function(_0x593fef){logger[_0x9a3b('0xd')](_0x9a3b('0xe'),_0x2357b8,_0x9a3b('0xf'));logger[_0x9a3b('0x10')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x2357b8,_0x9a3b('0xf'),JSON[_0x9a3b('0x11')](_0x593fef));if(_0x593fef[_0x9a3b('0x12')]){if(_0x593fef['error']['code']===0x1f4){logger[_0x9a3b('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x2357b8,_0x593fef['error'][_0x9a3b('0x13')]);return _0x204d1f(_0x593fef[_0x9a3b('0x12')]['message']);}logger[_0x9a3b('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x2357b8,_0x593fef[_0x9a3b('0x12')][_0x9a3b('0x13')]);return _0x2da1e2(_0x593fef[_0x9a3b('0x12')]['message']);}else{logger['info'](_0x9a3b('0xe'),_0x2357b8,'request\x20sent');_0x2da1e2(_0x593fef[_0x9a3b('0x14')][_0x9a3b('0x13')]);}})[_0x9a3b('0x15')](function(_0x43126b){logger[_0x9a3b('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x2357b8,_0x43126b);_0x204d1f(_0x43126b);});});}exports['CreateCmHopperHistory']=function(_0xa2975){var _0x2dbf3b=this;return new Promise(function(_0x5c1af2,_0x22cbbb){return db[_0x9a3b('0x16')][_0x9a3b('0x17')](_0xa2975['body'],{'raw':_0xa2975['options']?_0xa2975[_0x9a3b('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x34665e){logger[_0x9a3b('0xd')](_0x9a3b('0x19'),_0xa2975);logger[_0x9a3b('0x10')](_0x9a3b('0x19'),_0xa2975,JSON[_0x9a3b('0x11')](_0x34665e));_0x5c1af2(_0x34665e);})['catch'](function(_0x448324){logger[_0x9a3b('0x12')](_0x9a3b('0x19'),_0x448324[_0x9a3b('0x13')],_0xa2975);_0x22cbbb(_0x2dbf3b[_0x9a3b('0x12')](0x1f4,_0x448324[_0x9a3b('0x13')]));});});};exports[_0x9a3b('0x1a')]=function(_0x375804){var _0x5cc2be=this;return new Promise(function(_0x1a388b,_0xff2a20){return db['CmHopperHistory']['findAll']({'raw':_0x375804[_0x9a3b('0x18')]?_0x375804[_0x9a3b('0x18')][_0x9a3b('0x1b')]===undefined?!![]:![]:!![],'where':_0x375804[_0x9a3b('0x18')]?_0x375804['options'][_0x9a3b('0x1c')]||null:null,'attributes':[[db[_0x9a3b('0x1d')]['fn'](_0x9a3b('0x1e'),db[_0x9a3b('0x1d')][_0x9a3b('0x1f')]('id')),_0x9a3b('0x20')],[db['sequelize']['fn'](_0x9a3b('0x1e'),db[_0x9a3b('0x1d')]['fn']('IF',db[_0x9a3b('0x1d')][_0x9a3b('0x21')](_0x9a3b('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0x9a3b('0x1d')]['fn'](_0x9a3b('0x1e'),db[_0x9a3b('0x1d')]['fn']('IF',db[_0x9a3b('0x1d')][_0x9a3b('0x21')](_0x9a3b('0x23')))),'predictiveIntervalDroppedCallsTimeout'],[db['sequelize']['fn'](_0x9a3b('0x1e'),db[_0x9a3b('0x1d')]['fn']('IF',db[_0x9a3b('0x1d')][_0x9a3b('0x21')](_0x9a3b('0x24')))),'predictiveIntervalDroppedCallsCallersExit'],[db['sequelize']['fn']('AVG',db[_0x9a3b('0x1d')]['fn']('IF',db[_0x9a3b('0x1d')]['literal'](_0x9a3b('0x25')))),_0x9a3b('0x26')],[db[_0x9a3b('0x1d')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x9a3b('0x1d')]['literal'](_0x9a3b('0x27')))),'predictiveIntervalAvgTalktime']]})[_0x9a3b('0xc')](function(_0x563649){logger[_0x9a3b('0xd')](_0x9a3b('0x1a'),_0x375804);logger[_0x9a3b('0x10')](_0x9a3b('0x1a'),_0x375804,JSON[_0x9a3b('0x11')](_0x563649));_0x1a388b(_0x563649);})['catch'](function(_0xf4cbbb){logger['error'](_0x9a3b('0x1a'),_0xf4cbbb[_0x9a3b('0x13')],_0x375804);_0xff2a20(_0x5cc2be[_0x9a3b('0x12')](0x1f4,_0xf4cbbb[_0x9a3b('0x13')]));});});};exports[_0x9a3b('0x28')]=function(_0x35cdc3){var _0x54c89d=this;return new Promise(function(_0x545180,_0x3f06b6){return db[_0x9a3b('0x16')][_0x9a3b('0x29')]({'raw':_0x35cdc3['options']?_0x35cdc3[_0x9a3b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x35cdc3[_0x9a3b('0x18')]?_0x35cdc3[_0x9a3b('0x18')][_0x9a3b('0x1c')]||null:null,'attributes':[['campaign',_0x9a3b('0x2a')],[db[_0x9a3b('0x1d')]['fn'](_0x9a3b('0x1e'),db[_0x9a3b('0x1d')]['fn']('IF',db[_0x9a3b('0x1d')][_0x9a3b('0x21')]('`state`\x20=\x200,\x201,\x20null'))),_0x9a3b('0x2b')],[db[_0x9a3b('0x1d')]['fn'](_0x9a3b('0x1e'),db['sequelize']['fn']('IF',db[_0x9a3b('0x1d')][_0x9a3b('0x21')](_0x9a3b('0x2c')))),_0x9a3b('0x2d')],[db[_0x9a3b('0x1d')]['fn'](_0x9a3b('0x1e'),db[_0x9a3b('0x1d')]['fn']('IF',db[_0x9a3b('0x1d')][_0x9a3b('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x9a3b('0x2e')],[db[_0x9a3b('0x1d')]['fn'](_0x9a3b('0x1e'),db[_0x9a3b('0x1d')]['fn']('IF',db[_0x9a3b('0x1d')][_0x9a3b('0x21')](_0x9a3b('0x2f')))),_0x9a3b('0x30')],[db[_0x9a3b('0x1d')]['fn'](_0x9a3b('0x1e'),db[_0x9a3b('0x1d')]['fn']('IF',db[_0x9a3b('0x1d')][_0x9a3b('0x21')](_0x9a3b('0x31')))),_0x9a3b('0x32')],[db[_0x9a3b('0x1d')]['fn'](_0x9a3b('0x1e'),db[_0x9a3b('0x1d')]['fn']('IF',db[_0x9a3b('0x1d')][_0x9a3b('0x21')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x9a3b('0x33')],[db[_0x9a3b('0x1d')]['fn'](_0x9a3b('0x1e'),db[_0x9a3b('0x1d')]['fn']('IF',db[_0x9a3b('0x1d')][_0x9a3b('0x21')](_0x9a3b('0x34')))),_0x9a3b('0x35')],[db[_0x9a3b('0x1d')]['fn'](_0x9a3b('0x1e'),db[_0x9a3b('0x1d')]['fn']('IF',db[_0x9a3b('0x1d')][_0x9a3b('0x21')]('`state`\x20=\x2012,\x201,\x20null'))),_0x9a3b('0x36')],[db[_0x9a3b('0x1d')]['fn'](_0x9a3b('0x1e'),db[_0x9a3b('0x1d')]['fn']('IF',db[_0x9a3b('0x1d')][_0x9a3b('0x21')]('`state`\x20=\x2013,\x201,\x20null'))),'outboundBlacklistCallsDay'],[db[_0x9a3b('0x1d')]['fn']('COUNT',db[_0x9a3b('0x1d')]['fn']('IF',db[_0x9a3b('0x1d')][_0x9a3b('0x21')](_0x9a3b('0x37')))),_0x9a3b('0x38')],[db[_0x9a3b('0x1d')]['fn'](_0x9a3b('0x1e'),db[_0x9a3b('0x1d')]['fn']('IF',db[_0x9a3b('0x1d')][_0x9a3b('0x21')](_0x9a3b('0x39')))),_0x9a3b('0x3a')],[db[_0x9a3b('0x1d')]['fn'](_0x9a3b('0x1e'),db[_0x9a3b('0x1d')]['fn']('IF',db['sequelize'][_0x9a3b('0x21')](_0x9a3b('0x3b')))),_0x9a3b('0x3c')],[db['sequelize']['fn'](_0x9a3b('0x1e'),db[_0x9a3b('0x1d')]['fn']('IF',db['sequelize'][_0x9a3b('0x21')](_0x9a3b('0x3d')))),_0x9a3b('0x3a')],[db[_0x9a3b('0x1d')]['fn'](_0x9a3b('0x1e'),db[_0x9a3b('0x1d')]['fn']('IF',db[_0x9a3b('0x1d')][_0x9a3b('0x21')](_0x9a3b('0x3e')))),_0x9a3b('0x3f')]],'group':[_0x9a3b('0x40')]})[_0x9a3b('0xc')](function(_0x1576d7){logger[_0x9a3b('0xd')](_0x9a3b('0x28'),_0x35cdc3);logger[_0x9a3b('0x10')](_0x9a3b('0x28'),_0x35cdc3,JSON[_0x9a3b('0x11')](_0x1576d7));_0x545180(_0x1576d7);})[_0x9a3b('0x15')](function(_0x5488de){logger['error'](_0x9a3b('0x28'),_0x5488de[_0x9a3b('0x13')],_0x35cdc3);_0x3f06b6(_0x54c89d[_0x9a3b('0x12')](0x1f4,_0x5488de[_0x9a3b('0x13')]));});});};exports['GetCampaignHopperHistory']=function(_0x9e49c){var _0x123909=this;return new Promise(function(_0x480848,_0x1406e8){return db[_0x9a3b('0x16')]['findAll']({'raw':_0x9e49c['options']?_0x9e49c['options']['raw']===undefined?!![]:![]:!![],'where':_0x9e49c['options']?_0x9e49c['options'][_0x9a3b('0x1c')]||null:null,'attributes':[[_0x9a3b('0x40'),_0x9a3b('0x2a')],[db['sequelize']['fn'](_0x9a3b('0x1e'),db[_0x9a3b('0x1d')][_0x9a3b('0x1f')]('id')),_0x9a3b('0x41')],[db[_0x9a3b('0x1d')]['fn'](_0x9a3b('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x9a3b('0x21')](_0x9a3b('0x22')))),_0x9a3b('0x42')]],'group':[_0x9a3b('0x40')]})['then'](function(_0x4bfff2){logger[_0x9a3b('0xd')]('GetCampaignHopperHistory',_0x9e49c);logger[_0x9a3b('0x10')](_0x9a3b('0x43'),_0x9e49c,JSON[_0x9a3b('0x11')](_0x4bfff2));_0x480848(_0x4bfff2);})[_0x9a3b('0x15')](function(_0x1fc29e){logger[_0x9a3b('0x12')](_0x9a3b('0x43'),_0x1fc29e[_0x9a3b('0x13')],_0x9e49c);_0x1406e8(_0x123909[_0x9a3b('0x12')](0x1f4,_0x1fc29e[_0x9a3b('0x13')]));});});};
\ No newline at end of file
index a99f124..0348f28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0b0=['/describe','/:id','show','post','create','put','update','exports','util','express','../../components/auth/service','../../components/interaction/service','./cmHopperHistory.controller','get','isAuthenticated','index'];(function(_0x2acd36,_0x597a4e){var _0x48c079=function(_0x43f7ec){while(--_0x43f7ec){_0x2acd36['push'](_0x2acd36['shift']());}};_0x48c079(++_0x597a4e);}(_0xc0b0,0x98));var _0x0c0b=function(_0x533329,_0x3f6584){_0x533329=_0x533329-0x0;var _0x11311e=_0xc0b0[_0x533329];return _0x11311e;};'use strict';var multer=require('multer');var util=require(_0x0c0b('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0c0b('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0c0b('0x2'));var interaction=require(_0x0c0b('0x3'));var config=require('../../config/environment');var controller=require(_0x0c0b('0x4'));router[_0x0c0b('0x5')]('/',auth[_0x0c0b('0x6')](),controller[_0x0c0b('0x7')]);router[_0x0c0b('0x5')](_0x0c0b('0x8'),auth[_0x0c0b('0x6')](),controller['describe']);router[_0x0c0b('0x5')](_0x0c0b('0x9'),auth['isAuthenticated'](),controller[_0x0c0b('0xa')]);router[_0x0c0b('0xb')]('/',auth[_0x0c0b('0x6')](),controller[_0x0c0b('0xc')]);router[_0x0c0b('0xd')]('/:id',auth[_0x0c0b('0x6')](),controller[_0x0c0b('0xe')]);module[_0x0c0b('0xf')]=router;
\ No newline at end of file
+var _0x3e2d=['update','exports','util','path','express','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','get','/describe','describe','/:id','show','post','put'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3e2d,0x1b2));var _0xd3e2=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x3e2d[_0x4b055c];return _0x4b62bb;};'use strict';var multer=require('multer');var util=require(_0xd3e2('0x0'));var path=require(_0xd3e2('0x1'));var timeout=require('connect-timeout');var express=require(_0xd3e2('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd3e2('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd3e2('0x4'));var controller=require(_0xd3e2('0x5'));router['get']('/',auth[_0xd3e2('0x6')](),controller['index']);router[_0xd3e2('0x7')](_0xd3e2('0x8'),auth[_0xd3e2('0x6')](),controller[_0xd3e2('0x9')]);router[_0xd3e2('0x7')](_0xd3e2('0xa'),auth[_0xd3e2('0x6')](),controller[_0xd3e2('0xb')]);router[_0xd3e2('0xc')]('/',auth[_0xd3e2('0x6')](),controller['create']);router[_0xd3e2('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xd3e2('0xe')]);module[_0xd3e2('0xf')]=router;
\ No newline at end of file
index 634e566..2ed4cc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd58c=['exports','STRING','sequelize'];(function(_0x2b6eb3,_0x138b84){var _0x1b7956=function(_0x38206b){while(--_0x38206b){_0x2b6eb3['push'](_0x2b6eb3['shift']());}};_0x1b7956(++_0x138b84);}(_0xd58c,0xb6));var _0xcd58=function(_0x586030,_0x404ef4){_0x586030=_0x586030-0x0;var _0x1cdb3b=_0xd58c[_0x586030];return _0x1cdb3b;};'use strict';var Sequelize=require(_0xcd58('0x0'));module[_0xcd58('0x1')]={'name':{'type':Sequelize[_0xcd58('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xcd58('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5b20=['STRING','name','sequelize','exports'];(function(_0x235cf7,_0xebafcb){var _0x5a5383=function(_0x4633ed){while(--_0x4633ed){_0x235cf7['push'](_0x235cf7['shift']());}};_0x5a5383(++_0xebafcb);}(_0x5b20,0x86));var _0x05b2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5b20[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x05b2('0x0'));module[_0x05b2('0x1')]={'name':{'type':Sequelize[_0x05b2('0x2')],'unique':_0x05b2('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x05b2('0x2')]},'dialPrefix':{'type':Sequelize[_0x05b2('0x2')]}};
\ No newline at end of file
index 9ea5839..e530dc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbc6=['dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','concat','format','raw','getContactsCsv','OrderBy','CmCustomField','alias','select','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','from','description_additionalPhone_','toString','writeFileSync','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','switch','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','error','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','save','then','destroy','Lists','UserProfileResource','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','body','describe','addDisposition','ListId','Disposition','getDispositions','findOne','order','pick','removeDispositions','ids','addContacts','CmContact','tags','isArray','each','success','push'];(function(_0x2f8512,_0x271ada){var _0x53374e=function(_0x39d8b8){while(--_0x39d8b8){_0x2f8512['push'](_0x2f8512['shift']());}};_0x53374e(++_0x271ada);}(_0xbbc6,0xd4));var _0x6bbc=function(_0x50570a,_0x1f78e8){_0x50570a=_0x50570a-0x0;var _0x3cf737=_0xbbc6[_0x50570a];return _0x3cf737;};'use strict';var emlformat=require(_0x6bbc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6bbc('0x1'));var jsonpatch=require(_0x6bbc('0x2'));var rp=require('request-promise');var moment=require(_0x6bbc('0x3'));var BPromise=require(_0x6bbc('0x4'));var Mustache=require(_0x6bbc('0x5'));var util=require('util');var path=require(_0x6bbc('0x6'));var sox=require('sox');var csv=require(_0x6bbc('0x7'));var ejs=require(_0x6bbc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6bbc('0x9'));var squel=require(_0x6bbc('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6bbc('0xb'));var toCsv=require('to-csv');var querystring=require(_0x6bbc('0xc'));var Papa=require(_0x6bbc('0xd'));var Redis=require(_0x6bbc('0xe'));var authService=require(_0x6bbc('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6bbc('0x10'));var hardwareService=require(_0x6bbc('0x11'));var logger=require('../../config/logger')(_0x6bbc('0x12'));var utils=require(_0x6bbc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6bbc('0x14'));var db=require(_0x6bbc('0x15'))['db'];var csv_results;config[_0x6bbc('0x16')]=_[_0x6bbc('0x17')](config[_0x6bbc('0x16')],{'host':_0x6bbc('0x18'),'port':0x18eb});var socket=require(_0x6bbc('0x19'))(new Redis(config[_0x6bbc('0x16')]));require(_0x6bbc('0x1a'))[_0x6bbc('0x1b')](socket);function respondWithStatusCode(_0x6461a4,_0x317777){_0x317777=_0x317777||0xcc;return function(_0x434fdb){if(_0x434fdb){return _0x6461a4[_0x6bbc('0x1c')](_0x317777);}return _0x6461a4[_0x6bbc('0x1d')](_0x317777)[_0x6bbc('0x1e')]();};}function respondWithResult(_0x3c2110,_0x167902){_0x167902=_0x167902||0xc8;return function(_0x236c16){if(_0x236c16){return _0x3c2110['status'](_0x167902)['json'](_0x236c16);}};}function respondWithFilteredResult(_0x10e8d9,_0x300acc){return function(_0x408484){if(_0x408484){var _0x3f5672=typeof _0x300acc[_0x6bbc('0x1f')]===_0x6bbc('0x20')&&typeof _0x300acc['limit']===_0x6bbc('0x20');var _0x1c2af6=_0x408484[_0x6bbc('0x21')];var _0x76e5fb=_0x3f5672?0x0:_0x300acc[_0x6bbc('0x1f')];var _0x2a2c8a=_0x3f5672?_0x408484[_0x6bbc('0x21')]:_0x300acc[_0x6bbc('0x1f')]+_0x300acc[_0x6bbc('0x22')];var _0x479596;if(_0x2a2c8a>=_0x1c2af6){_0x2a2c8a=_0x1c2af6;_0x479596=0xc8;}else{_0x479596=0xce;}_0x10e8d9[_0x6bbc('0x1d')](_0x479596);return _0x10e8d9[_0x6bbc('0x23')]('Content-Range',_0x76e5fb+'-'+_0x2a2c8a+'/'+_0x1c2af6)[_0x6bbc('0x24')](_0x408484);}return null;};}function patchUpdates(_0x5d4b5e){return function(_0x44500e){try{jsonpatch[_0x6bbc('0x25')](_0x44500e,_0x5d4b5e,!![]);}catch(_0x51a741){return BPromise['reject'](_0x51a741);}return _0x44500e[_0x6bbc('0x26')]();};}function saveUpdates(_0xcca380,_0x551fac){return function(_0x39d941){if(_0x39d941){return _0x39d941['update'](_0xcca380)[_0x6bbc('0x27')](function(_0x337e1f){return _0x337e1f;});}return null;};}function removeEntity(_0x5df06e,_0xf027ee){return function(_0x34899d){if(_0x34899d){return _0x34899d[_0x6bbc('0x28')]()[_0x6bbc('0x27')](function(){var _0x347999=_0x34899d['get']({'plain':!![]});var _0x41cc06=_0x6bbc('0x29');return db[_0x6bbc('0x2a')][_0x6bbc('0x28')]({'where':{'type':_0x41cc06,'resourceId':_0x347999['id']}})[_0x6bbc('0x27')](function(){return _0x34899d;});})['then'](function(){_0x5df06e[_0x6bbc('0x1d')](0xcc)[_0x6bbc('0x1e')]();});}};}function handleEntityNotFound(_0x3d7d2c,_0x3ce278){return function(_0x5056b1){if(!_0x5056b1){_0x3d7d2c[_0x6bbc('0x1c')](0x194);}return _0x5056b1;};}function handleError(_0x42b45e,_0x51687b){_0x51687b=_0x51687b||0x1f4;return function(_0x1c0ed1){logger['error'](_0x1c0ed1[_0x6bbc('0x2b')]);if(_0x1c0ed1[_0x6bbc('0x2c')]){delete _0x1c0ed1[_0x6bbc('0x2c')];}_0x42b45e[_0x6bbc('0x1d')](_0x51687b)[_0x6bbc('0x2d')](_0x1c0ed1);};}exports[_0x6bbc('0x2e')]=function(_0x24f860,_0x1c16d5){var _0x693bfc={},_0xc8b6a6={},_0x295ff3={'count':0x0,'rows':[]};var _0x3e98fa=_[_0x6bbc('0x2f')](db[_0x6bbc('0x30')][_0x6bbc('0x31')],function(_0x24d0d4){return{'name':_0x24d0d4[_0x6bbc('0x32')],'type':_0x24d0d4[_0x6bbc('0x33')][_0x6bbc('0x34')]};});_0xc8b6a6['model']=_[_0x6bbc('0x2f')](_0x3e98fa,_0x6bbc('0x2c'));_0xc8b6a6[_0x6bbc('0x35')]=_[_0x6bbc('0x36')](_0x24f860[_0x6bbc('0x35')]);_0xc8b6a6[_0x6bbc('0x37')]=_[_0x6bbc('0x38')](_0xc8b6a6[_0x6bbc('0x39')],_0xc8b6a6[_0x6bbc('0x35')]);_0x693bfc[_0x6bbc('0x3a')]=_[_0x6bbc('0x38')](_0xc8b6a6[_0x6bbc('0x39')],qs[_0x6bbc('0x3b')](_0x24f860['query'][_0x6bbc('0x3b')]));_0x693bfc[_0x6bbc('0x3a')]=_0x693bfc[_0x6bbc('0x3a')][_0x6bbc('0x3c')]?_0x693bfc[_0x6bbc('0x3a')]:_0xc8b6a6['model'];if(!_0x24f860[_0x6bbc('0x35')][_0x6bbc('0x3d')](_0x6bbc('0x3e'))){_0x693bfc[_0x6bbc('0x22')]=qs[_0x6bbc('0x22')](_0x24f860['query'][_0x6bbc('0x22')]);_0x693bfc[_0x6bbc('0x1f')]=qs[_0x6bbc('0x1f')](_0x24f860[_0x6bbc('0x35')][_0x6bbc('0x1f')]);}_0x693bfc['order']=qs['sort'](_0x24f860[_0x6bbc('0x35')][_0x6bbc('0x3f')]);_0x693bfc[_0x6bbc('0x40')]=qs['filters'](_['pick'](_0x24f860[_0x6bbc('0x35')],_0xc8b6a6[_0x6bbc('0x37')]),_0x3e98fa);if(_0x24f860[_0x6bbc('0x35')][_0x6bbc('0x41')]){_0x693bfc[_0x6bbc('0x40')]=_[_0x6bbc('0x42')](_0x693bfc[_0x6bbc('0x40')],{'$or':_['map'](_0x3e98fa,function(_0x46d000){if(_0x46d000[_0x6bbc('0x33')]!==_0x6bbc('0x43')){var _0x1f0875={};_0x1f0875[_0x46d000[_0x6bbc('0x2c')]]={'$like':'%'+_0x24f860[_0x6bbc('0x35')]['filter']+'%'};return _0x1f0875;}})});}_0x693bfc=_['merge']({},_0x693bfc,_0x24f860[_0x6bbc('0x44')]);var _0x1aea59={'where':_0x693bfc[_0x6bbc('0x40')]};return db['CmList'][_0x6bbc('0x21')](_0x1aea59)[_0x6bbc('0x27')](function(_0x30e269){_0x295ff3[_0x6bbc('0x21')]=_0x30e269;if(_0x24f860[_0x6bbc('0x35')][_0x6bbc('0x45')]){_0x693bfc[_0x6bbc('0x46')]=[{'all':!![]}];}return db['CmList'][_0x6bbc('0x47')](_0x693bfc);})[_0x6bbc('0x27')](function(_0x3326d4){_0x295ff3[_0x6bbc('0x48')]=_0x3326d4;return _0x295ff3;})[_0x6bbc('0x27')](respondWithFilteredResult(_0x1c16d5,_0x693bfc))[_0x6bbc('0x49')](handleError(_0x1c16d5,null));};exports[_0x6bbc('0x4a')]=function(_0x4ac5b4,_0x1598a4){var _0x5d100d={'raw':![],'where':{'id':_0x4ac5b4[_0x6bbc('0x4b')]['id']}},_0xd07bec={};_0xd07bec[_0x6bbc('0x39')]=_[_0x6bbc('0x36')](db[_0x6bbc('0x30')][_0x6bbc('0x31')]);_0xd07bec[_0x6bbc('0x35')]=_['keys'](_0x4ac5b4[_0x6bbc('0x35')]);_0xd07bec[_0x6bbc('0x37')]=_[_0x6bbc('0x38')](_0xd07bec[_0x6bbc('0x39')],_0xd07bec[_0x6bbc('0x35')]);_0x5d100d['attributes']=_[_0x6bbc('0x38')](_0xd07bec[_0x6bbc('0x39')],qs[_0x6bbc('0x3b')](_0x4ac5b4['query'][_0x6bbc('0x3b')]));_0x5d100d[_0x6bbc('0x3a')]=_0x5d100d['attributes'][_0x6bbc('0x3c')]?_0x5d100d[_0x6bbc('0x3a')]:_0xd07bec['model'];if(_0x4ac5b4[_0x6bbc('0x35')][_0x6bbc('0x45')]){_0x5d100d['include']=[{'all':!![]}];}_0x5d100d=_['merge']({},_0x5d100d,_0x4ac5b4['options']);return db[_0x6bbc('0x30')]['find'](_0x5d100d)[_0x6bbc('0x27')](handleEntityNotFound(_0x1598a4,null))[_0x6bbc('0x27')](respondWithResult(_0x1598a4,null))[_0x6bbc('0x49')](handleError(_0x1598a4,null));};exports[_0x6bbc('0x4c')]=function(_0x31921c,_0x163d3e){return db['CmList'][_0x6bbc('0x4c')](_0x31921c['body'],{})['then'](function(_0x24e3a8){var _0x226de6=_0x31921c[_0x6bbc('0x4d')]['get']({'plain':!![]});if(!_0x226de6)throw new Error(_0x6bbc('0x4e'));if(_0x226de6[_0x6bbc('0x4f')]===_0x6bbc('0x4d')){var _0x163aa4=_0x24e3a8[_0x6bbc('0x50')]({'plain':!![]});var _0x5bd9a3=_0x6bbc('0x29');return db[_0x6bbc('0x51')][_0x6bbc('0x52')]({'where':{'name':_0x5bd9a3,'userProfileId':_0x226de6[_0x6bbc('0x53')]},'raw':!![]})[_0x6bbc('0x27')](function(_0x48fa43){if(_0x48fa43&&_0x48fa43['autoAssociation']===0x0){return db[_0x6bbc('0x2a')]['create']({'name':_0x163aa4['name'],'resourceId':_0x163aa4['id'],'type':_0x48fa43[_0x6bbc('0x2c')],'sectionId':_0x48fa43['id']},{})[_0x6bbc('0x27')](function(){return _0x24e3a8;});}else{return _0x24e3a8;}})[_0x6bbc('0x49')](function(_0x2b61a0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b61a0);throw _0x2b61a0;});}return _0x24e3a8;})[_0x6bbc('0x27')](respondWithResult(_0x163d3e,0xc9))[_0x6bbc('0x49')](handleError(_0x163d3e,null));};exports['update']=function(_0x307139,_0x4d8412){if(_0x307139[_0x6bbc('0x54')]['id']){delete _0x307139[_0x6bbc('0x54')]['id'];}return db[_0x6bbc('0x30')][_0x6bbc('0x52')]({'where':{'id':_0x307139[_0x6bbc('0x4b')]['id']}})[_0x6bbc('0x27')](handleEntityNotFound(_0x4d8412,null))[_0x6bbc('0x27')](saveUpdates(_0x307139[_0x6bbc('0x54')],null))['then'](respondWithResult(_0x4d8412,null))[_0x6bbc('0x49')](handleError(_0x4d8412,null));};exports['destroy']=function(_0x11da42,_0x50b310){return db[_0x6bbc('0x30')][_0x6bbc('0x52')]({'where':{'id':_0x11da42[_0x6bbc('0x4b')]['id']}})['then'](handleEntityNotFound(_0x50b310,null))[_0x6bbc('0x27')](removeEntity(_0x50b310,null))['catch'](handleError(_0x50b310,null));};exports[_0x6bbc('0x55')]=function(_0x23ad96,_0x57b2cf){return db[_0x6bbc('0x30')]['describe']()[_0x6bbc('0x27')](respondWithResult(_0x57b2cf,null))[_0x6bbc('0x49')](handleError(_0x57b2cf,null));};exports[_0x6bbc('0x56')]=function(_0x3d3bd7,_0x19aace,_0x1d0dd1){if(_0x3d3bd7['body']['id']){delete _0x3d3bd7[_0x6bbc('0x54')]['id'];}return db[_0x6bbc('0x30')]['find']({'where':{'id':_0x3d3bd7[_0x6bbc('0x4b')]['id']}})[_0x6bbc('0x27')](handleEntityNotFound(_0x19aace,null))['then'](function(_0x54f846){if(_0x54f846){_0x3d3bd7[_0x6bbc('0x54')][_0x6bbc('0x57')]=_0x54f846['id'];return db[_0x6bbc('0x58')][_0x6bbc('0x4c')](_0x3d3bd7['body']);}})[_0x6bbc('0x27')](respondWithResult(_0x19aace,null))[_0x6bbc('0x49')](handleError(_0x19aace,null));};exports[_0x6bbc('0x59')]=function(_0x1d004a,_0x2997aa,_0x1ff68f){var _0x4ee50b={'raw':![],'where':{}};var _0xaf3c34={};var _0x14a8d6={'count':0x0,'rows':[]};return db[_0x6bbc('0x30')][_0x6bbc('0x5a')]({'where':{'id':_0x1d004a[_0x6bbc('0x4b')]['id']}})[_0x6bbc('0x27')](handleEntityNotFound(_0x2997aa,null))[_0x6bbc('0x27')](function(_0x3ed095){if(_0x3ed095){_0xaf3c34[_0x6bbc('0x39')]=_[_0x6bbc('0x36')](db[_0x6bbc('0x58')][_0x6bbc('0x31')]);_0xaf3c34['query']=_[_0x6bbc('0x36')](_0x1d004a['query']);_0xaf3c34[_0x6bbc('0x37')]=_['intersection'](_0xaf3c34['model'],_0xaf3c34[_0x6bbc('0x35')]);_0x4ee50b[_0x6bbc('0x3a')]=_[_0x6bbc('0x38')](_0xaf3c34[_0x6bbc('0x39')],qs[_0x6bbc('0x3b')](_0x1d004a[_0x6bbc('0x35')][_0x6bbc('0x3b')]));_0x4ee50b[_0x6bbc('0x3a')]=_0x4ee50b[_0x6bbc('0x3a')][_0x6bbc('0x3c')]?_0x4ee50b[_0x6bbc('0x3a')]:_0xaf3c34['model'];if(!_0x1d004a['query'][_0x6bbc('0x3d')](_0x6bbc('0x3e'))){_0x4ee50b[_0x6bbc('0x22')]=qs[_0x6bbc('0x22')](_0x1d004a['query'][_0x6bbc('0x22')]);_0x4ee50b[_0x6bbc('0x1f')]=qs[_0x6bbc('0x1f')](_0x1d004a['query']['offset']);}_0x4ee50b[_0x6bbc('0x5b')]=qs[_0x6bbc('0x3f')](_0x1d004a[_0x6bbc('0x35')][_0x6bbc('0x3f')]);_0x4ee50b[_0x6bbc('0x40')]=qs[_0x6bbc('0x37')](_[_0x6bbc('0x5c')](_0x1d004a[_0x6bbc('0x35')],_0xaf3c34[_0x6bbc('0x37')]));_0x4ee50b[_0x6bbc('0x40')][_0x6bbc('0x57')]=_0x3ed095['id'];if(_0x1d004a[_0x6bbc('0x35')]['filter']){_0x4ee50b['where']=_[_0x6bbc('0x42')](_0x4ee50b[_0x6bbc('0x40')],{'$or':_[_0x6bbc('0x2f')](_0x4ee50b[_0x6bbc('0x3a')],function(_0x4ed3a3){var _0x2aaf6a={};_0x2aaf6a[_0x4ed3a3]={'$like':'%'+_0x1d004a[_0x6bbc('0x35')][_0x6bbc('0x41')]+'%'};return _0x2aaf6a;})});}_0x4ee50b=_[_0x6bbc('0x42')]({},_0x4ee50b,_0x1d004a['options']);return db['Disposition'][_0x6bbc('0x21')]({'where':_0x4ee50b['where']})['then'](function(_0x5b9bfe){_0x14a8d6[_0x6bbc('0x21')]=_0x5b9bfe;if(_0x1d004a[_0x6bbc('0x35')][_0x6bbc('0x45')]){_0x4ee50b[_0x6bbc('0x46')]=[{'all':!![]}];}return db[_0x6bbc('0x58')][_0x6bbc('0x47')](_0x4ee50b);})['then'](function(_0x4b043d){_0x14a8d6[_0x6bbc('0x48')]=_0x4b043d;return _0x14a8d6;});}})[_0x6bbc('0x27')](respondWithFilteredResult(_0x2997aa,_0x4ee50b))[_0x6bbc('0x49')](handleError(_0x2997aa,null));};exports[_0x6bbc('0x5d')]=function(_0x178b4f,_0x2f2b22,_0x3a2aca){return db[_0x6bbc('0x30')][_0x6bbc('0x52')]({'where':{'id':_0x178b4f['params']['id']}})[_0x6bbc('0x27')](handleEntityNotFound(_0x2f2b22,null))['then'](function(_0xf42b){if(_0xf42b){return _0xf42b['removeDispositions'](_0x178b4f['query'][_0x6bbc('0x5e')]);}})[_0x6bbc('0x27')](respondWithStatusCode(_0x2f2b22,null))[_0x6bbc('0x49')](handleError(_0x2f2b22,null));};exports[_0x6bbc('0x5f')]=function(_0x34203c,_0x48adb8,_0xeb5857){return db['CmList'][_0x6bbc('0x52')]({'where':{'id':_0x34203c[_0x6bbc('0x4b')]['id']}})[_0x6bbc('0x27')](handleEntityNotFound(_0x48adb8,null))[_0x6bbc('0x27')](function(_0x5e3eaf){if(_0x5e3eaf){var _0x5019d4=[];var _0x234044={'success':[],'errors':[]};return db[_0x6bbc('0x60')]['describe']()[_0x6bbc('0x27')](function(_0x9043d8){if(_0x34203c['body'][_0x6bbc('0x61')]&&_['isArray'](_0x34203c[_0x6bbc('0x54')][_0x6bbc('0x61')])){if(_0x34203c[_0x6bbc('0x54')]['tags']['length']){_0x34203c[_0x6bbc('0x54')][_0x6bbc('0x61')]=_0x34203c['body'][_0x6bbc('0x61')]['join'](';')+';';}else{_0x34203c['body'][_0x6bbc('0x61')]=null;}}else{_0x34203c['body'][_0x6bbc('0x61')]=null;}if(_0x34203c[_0x6bbc('0x54')]&&_[_0x6bbc('0x62')](_0x34203c[_0x6bbc('0x54')])){for(var _0x455be8=0x0;_0x455be8<_0x34203c['body'][_0x6bbc('0x3c')];_0x455be8+=0x1){_0x34203c['body'][_0x455be8]['ListId']=_0x34203c[_0x6bbc('0x4b')]['id'];_0x5019d4['push'](_0x34203c[_0x6bbc('0x54')][_0x455be8]);}return BPromise[_0x6bbc('0x63')](_0x5019d4,function(_0x2019b3){return db[_0x6bbc('0x60')][_0x6bbc('0x4c')](_['omit'](_0x2019b3,['ids','id'])||{},{'fields':_[_0x6bbc('0x36')](_0x9043d8),'raw':!![]})[_0x6bbc('0x27')](function(_0x576643){_0x234044[_0x6bbc('0x64')][_0x6bbc('0x65')](_0x576643[_0x6bbc('0x66')]);})[_0x6bbc('0x49')](function(_0x561ca3){_0x234044[_0x6bbc('0x67')][_0x6bbc('0x65')]({'data':_0x2019b3,'error':_0x561ca3[_0x6bbc('0x68')]});});})['then'](function(_0x38e1ff){return _0x234044;})['catch'](function(_0x51db0b){return _0x51db0b;});}else{_0x48adb8[_0x6bbc('0x1d')](0x190)['json']({'message':_0x6bbc('0x69')});}});}})['then'](respondWithResult(_0x48adb8,null))['catch'](handleError(_0x48adb8,null));};exports[_0x6bbc('0x6a')]=function(_0x3013e0,_0x32d7fc,_0x3cef09){var _0x416849;return db['CmList'][_0x6bbc('0x52')]({'where':{'id':_0x3013e0[_0x6bbc('0x4b')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x6bbc('0x27')](handleEntityNotFound(_0x32d7fc,null))['then'](function(_0xff6c9f){if(_0xff6c9f){_0x416849=_0xff6c9f;return db[_0x6bbc('0x60')][_0x6bbc('0x31')];}})[_0x6bbc('0x27')](function(_0x32014d){if(_0x32014d){var _0x5623a2={};var _0x11fadb={};_0x11fadb[_0x6bbc('0x39')]=_[_0x6bbc('0x6b')](_['keys'](_0x32014d),_[_0x6bbc('0x2f')](_0x416849['CustomFields'],function(_0x3c0c26){return util[_0x6bbc('0x6c')]('cf_%d',_0x3c0c26['id']);}));_0x11fadb[_0x6bbc('0x35')]=_[_0x6bbc('0x36')](_0x3013e0[_0x6bbc('0x35')]);_0x11fadb[_0x6bbc('0x37')]=_[_0x6bbc('0x38')](_0x11fadb['model'],_0x11fadb[_0x6bbc('0x35')]);_0x5623a2['attributes']=_[_0x6bbc('0x38')](_0x11fadb[_0x6bbc('0x39')],qs[_0x6bbc('0x3b')](_0x3013e0[_0x6bbc('0x35')][_0x6bbc('0x3b')]));_0x5623a2['attributes']=_0x5623a2[_0x6bbc('0x3a')][_0x6bbc('0x3c')]?_0x5623a2[_0x6bbc('0x3a')]:_0x11fadb[_0x6bbc('0x39')];if(!_0x3013e0[_0x6bbc('0x35')][_0x6bbc('0x3d')]('nolimit')){_0x5623a2['limit']=qs['limit'](_0x3013e0[_0x6bbc('0x35')][_0x6bbc('0x22')]);_0x5623a2['offset']=qs[_0x6bbc('0x1f')](_0x3013e0[_0x6bbc('0x35')]['offset']);}_0x5623a2['order']=qs[_0x6bbc('0x3f')](_0x3013e0['query'][_0x6bbc('0x3f')]);_0x5623a2['where']=qs['filters'](_[_0x6bbc('0x5c')](_0x3013e0[_0x6bbc('0x35')],_0x11fadb[_0x6bbc('0x37')]));_0x5623a2[_0x6bbc('0x6d')]=!![];if(_0x3013e0[_0x6bbc('0x35')][_0x6bbc('0x41')]){_0x5623a2['where']=_[_0x6bbc('0x42')](_0x5623a2['where'],{'$or':_[_0x6bbc('0x2f')](_0x5623a2[_0x6bbc('0x3a')],function(_0xfda55f){var _0x1b9d6c={};_0x1b9d6c[_0xfda55f]={'$like':'%'+_0x3013e0[_0x6bbc('0x35')][_0x6bbc('0x41')]+'%'};return _0x1b9d6c;})});}_0x5623a2=_[_0x6bbc('0x42')]({},_0x5623a2,_0x3013e0[_0x6bbc('0x44')]);return _0x416849['getContacts'](_0x5623a2);}})[_0x6bbc('0x27')](respondWithResult(_0x32d7fc,null))['catch'](handleError(_0x32d7fc,null));};exports[_0x6bbc('0x6e')]=function(_0xfc65ae,_0x415c10,_0x15fc93){var _0x2eb737;var _0x5cee67;var _0x10dff0;var _0x42aa11=_0xfc65ae[_0x6bbc('0x4b')]['id'];csv_results=[];return db['ContactItemType']['findAll']({'attributes':['id',_0x6bbc('0x2c')],'raw':!![],'order':[_0x6bbc('0x6f')]})[_0x6bbc('0x27')](function(_0x39dd31){_0x2eb737=_0x39dd31;var _0x53d3b3=_[_0x6bbc('0x36')](db[_0x6bbc('0x60')][_0x6bbc('0x31')]);return db[_0x6bbc('0x70')][_0x6bbc('0x47')]({'raw':!![],'attributes':['id',_0x6bbc('0x71')]})[_0x6bbc('0x27')](function(_0x182001){_0x5cee67=_0x182001;var _0x228991=squel[_0x6bbc('0x72')]()[_0x6bbc('0x3b')](_0x53d3b3)['from']('cm_contacts','c')[_0x6bbc('0x40')](_0x6bbc('0x73'),_0x42aa11)[_0x6bbc('0x40')](_0x6bbc('0x74'))[_0x6bbc('0x75')]();for(var _0x4ca949=0x0;_0x4ca949<_0x5cee67[_0x6bbc('0x3c')];_0x4ca949++){_0x228991[_0x6bbc('0x76')]('c.cf_'+_0x5cee67[_0x4ca949]['id'],_0x6bbc('0x77')+_0x5cee67[_0x4ca949]['alias']);}for(var _0x4ca949=0x0;_0x4ca949<_0x2eb737[_0x6bbc('0x3c')];_0x4ca949++){_0x228991[_0x6bbc('0x76')](squel['select']()[_0x6bbc('0x76')](_0x6bbc('0x78'))['from'](_0x6bbc('0x79'))[_0x6bbc('0x40')](_0x6bbc('0x7a'),_0x2eb737[_0x4ca949]['id'])[_0x6bbc('0x40')](_0x6bbc('0x7b')),'additionalPhone_'+_0x2eb737[_0x4ca949]['name']);_0x228991[_0x6bbc('0x76')](squel[_0x6bbc('0x72')]()[_0x6bbc('0x76')]('description')[_0x6bbc('0x7c')](_0x6bbc('0x79'))['where'](_0x6bbc('0x7a'),_0x2eb737[_0x4ca949]['id'])['where']('CmContactId\x20=\x20c.id'),_0x6bbc('0x7d')+_0x2eb737[_0x4ca949][_0x6bbc('0x2c')]);}var _0x401529=[];_0x401529[_0x6bbc('0x65')](_0x228991['toString']());BPromise[_0x6bbc('0x63')](_0x401529,handleQuery)[_0x6bbc('0x27')](function(_0x5c5b95){handleQuery(_0x228991[_0x6bbc('0x7e')]());var _0xa126e4=csv_results[0x0];if(!_['isEmpty'](_0xa126e4)){var _0x240188=toCsv(_0xa126e4);var _0x2a72ce=Date['now']();fs[_0x6bbc('0x7f')](util['format']('/tmp/list_%d_%s.csv',_0x42aa11,_0x2a72ce),_0x240188);_0x415c10[_0x6bbc('0x80')]('Content-disposition',_0x6bbc('0x81')+util[_0x6bbc('0x6c')](_0x6bbc('0x82'),_0x42aa11,_0x2a72ce));_0x415c10[_0x6bbc('0x80')](_0x6bbc('0x83'),_0x6bbc('0x84'));return _0x415c10['download'](util[_0x6bbc('0x6c')]('/tmp/list_%d_%s.csv',_0x42aa11,_0x2a72ce));}else{return _0x415c10[_0x6bbc('0x1c')](0xcc);}});});});};exports[_0x6bbc('0x85')]=function(_0x26fdfa,_0x1cc2f4,_0x2be1e4){var _0x5bcc1a;delete _0x26fdfa[_0x6bbc('0x54')]['id'];return db['CmList']['findOne']({'where':{'id':_0x26fdfa[_0x6bbc('0x4b')]['id']}})[_0x6bbc('0x27')](handleEntityNotFound(_0x1cc2f4,null))[_0x6bbc('0x27')](function(_0x12ca6e){if(_0x12ca6e){return db[_0x6bbc('0x86')][_0x6bbc('0x87')](function(_0x92096e){return db[_0x6bbc('0x70')]['create'](_0x26fdfa[_0x6bbc('0x54')],{'transaction':_0x92096e})[_0x6bbc('0x27')](function(_0x23eeeb){_0x5bcc1a=_0x23eeeb;return _0x12ca6e[_0x6bbc('0x88')](_0x23eeeb,{'transaction':_0x92096e});})[_0x6bbc('0x27')](function(){var _0x5e53e5={'type':db[_0x6bbc('0x89')][_0x6bbc('0x8a')],'transaction':_0x92096e};switch(_0x26fdfa['body'][_0x6bbc('0x33')]){case _0x6bbc('0x8b'):_0x5e53e5[_0x6bbc('0x33')]=db[_0x6bbc('0x89')]['TEXT'];break;case _0x6bbc('0x8c'):_0x5e53e5[_0x6bbc('0x33')]=db[_0x6bbc('0x89')]['INTEGER'];break;case _0x6bbc('0x8d'):_0x5e53e5[_0x6bbc('0x33')]=db[_0x6bbc('0x89')]['BOOLEAN'];_0x5e53e5['defaultValue']=![];break;default:}return db['sequelize']['queryInterface'][_0x6bbc('0x8e')](_0x6bbc('0x8f'),util['format'](_0x6bbc('0x90'),_0x5bcc1a['id']),_0x5e53e5);})[_0x6bbc('0x27')](function(){return _0x5bcc1a;});});}})[_0x6bbc('0x27')](respondWithResult(_0x1cc2f4,null))[_0x6bbc('0x49')](handleError(_0x1cc2f4,null));};exports[_0x6bbc('0x91')]=function(_0x4da4f0,_0x6ec0e7,_0x314d0c){var _0x4e39b4={};var _0x4cf6d4={};var _0x43e1a5;var _0x403104;return db['CmList'][_0x6bbc('0x5a')]({'where':{'id':_0x4da4f0[_0x6bbc('0x4b')]['id']}})[_0x6bbc('0x27')](handleEntityNotFound(_0x6ec0e7,null))[_0x6bbc('0x27')](function(_0x5e2410){if(_0x5e2410){_0x43e1a5=_0x5e2410;_0x4cf6d4[_0x6bbc('0x39')]=_['keys'](db[_0x6bbc('0x70')]['rawAttributes']);_0x4cf6d4[_0x6bbc('0x35')]=_['keys'](_0x4da4f0['query']);_0x4cf6d4[_0x6bbc('0x37')]=_[_0x6bbc('0x38')](_0x4cf6d4[_0x6bbc('0x39')],_0x4cf6d4[_0x6bbc('0x35')]);_0x4e39b4['attributes']=_[_0x6bbc('0x38')](_0x4cf6d4[_0x6bbc('0x39')],qs[_0x6bbc('0x3b')](_0x4da4f0[_0x6bbc('0x35')][_0x6bbc('0x3b')]));_0x4e39b4['attributes']=_0x4e39b4[_0x6bbc('0x3a')][_0x6bbc('0x3c')]?_0x4e39b4[_0x6bbc('0x3a')]:_0x4cf6d4[_0x6bbc('0x39')];_0x4e39b4[_0x6bbc('0x5b')]=qs[_0x6bbc('0x3f')](_0x4da4f0[_0x6bbc('0x35')][_0x6bbc('0x3f')]);_0x4e39b4[_0x6bbc('0x40')]=qs[_0x6bbc('0x37')](_['pick'](_0x4da4f0[_0x6bbc('0x35')],_0x4cf6d4[_0x6bbc('0x37')]));_0x4e39b4[_0x6bbc('0x40')]=_[_0x6bbc('0x42')](_0x4e39b4[_0x6bbc('0x40')],{'$or':[{'ListId':_0x5e2410['id']},{'ListId':null}]});if(_0x4da4f0['query'][_0x6bbc('0x41')]){_0x4e39b4[_0x6bbc('0x40')]=_[_0x6bbc('0x42')](_0x4e39b4[_0x6bbc('0x40')],{'$or':_['map'](_0x4e39b4[_0x6bbc('0x3a')],function(_0xb6a8d5){var _0x268ac6={};_0x268ac6[_0xb6a8d5]={'$like':'%'+_0x4da4f0['query'][_0x6bbc('0x41')]+'%'};return _0x268ac6;})});}_0x4e39b4=_['merge']({},_0x4e39b4,_0x4da4f0[_0x6bbc('0x44')]);return db[_0x6bbc('0x70')][_0x6bbc('0x92')](_0x4e39b4);}})['then'](respondWithResult(_0x6ec0e7,null))['catch'](handleError(_0x6ec0e7,null));};exports['getGlobalCustomFields']=function(_0x4bc1c6,_0x25e441){return db['CmCustomField'][_0x6bbc('0x92')]({'where':{'ListId':null}})[_0x6bbc('0x27')](handleEntityNotFound(_0x25e441,null))[_0x6bbc('0x27')](function(_0x5c0679){return _0x5c0679;})[_0x6bbc('0x27')](respondWithResult(_0x25e441,null))['catch'](handleError(_0x25e441,null));};exports[_0x6bbc('0x93')]=function(_0x7d5808,_0x56ea45,_0x1592be){return db[_0x6bbc('0x30')]['find']({'where':{'id':_0x7d5808[_0x6bbc('0x4b')]['id']}})[_0x6bbc('0x27')](handleEntityNotFound(_0x56ea45,null))['then'](function(_0x1506b7){if(_0x1506b7){return _0x1506b7[_0x6bbc('0x93')](_0x7d5808['body'][_0x6bbc('0x5e')],_[_0x6bbc('0x94')](_0x7d5808['body'],[_0x6bbc('0x5e'),'id'])||{})[_0x6bbc('0x95')](function(_0x4cd608){for(var _0x440c43=0x0;_0x440c43<_0x7d5808['body'][_0x6bbc('0x5e')][_0x6bbc('0x3c')];_0x440c43+=0x1){socket[_0x6bbc('0x96')](_0x6bbc('0x97'),{'UserId':Number(_0x7d5808[_0x6bbc('0x54')][_0x6bbc('0x5e')][_0x440c43]),'CmListId':Number(_0x7d5808['params']['id'])});}return _0x4cd608;});}})['then'](respondWithResult(_0x56ea45,null))['catch'](handleError(_0x56ea45,null));};exports[_0x6bbc('0x98')]=function(_0x4ab585,_0x41bd66,_0x5040b7){return db[_0x6bbc('0x30')]['find']({'where':{'id':_0x4ab585[_0x6bbc('0x4b')]['id']}})[_0x6bbc('0x27')](handleEntityNotFound(_0x41bd66,null))[_0x6bbc('0x27')](function(_0x216095){if(_0x216095){return _0x216095['removeAgents'](_0x4ab585[_0x6bbc('0x35')][_0x6bbc('0x5e')])[_0x6bbc('0x27')](function(){if(_[_0x6bbc('0x62')](_0x4ab585[_0x6bbc('0x35')][_0x6bbc('0x5e')])){for(var _0x5539b2=0x0;_0x5539b2<_0x4ab585['query'][_0x6bbc('0x5e')]['length'];_0x5539b2+=0x1){socket[_0x6bbc('0x96')]('userCmList:remove',{'UserId':Number(_0x4ab585[_0x6bbc('0x35')][_0x6bbc('0x5e')][_0x5539b2]),'CmListId':Number(_0x4ab585[_0x6bbc('0x4b')]['id'])});}}else{socket[_0x6bbc('0x96')](_0x6bbc('0x99'),{'UserId':Number(_0x4ab585[_0x6bbc('0x35')][_0x6bbc('0x5e')]),'CmListId':Number(_0x4ab585[_0x6bbc('0x4b')]['id'])});}});}})[_0x6bbc('0x27')](respondWithStatusCode(_0x41bd66,null))[_0x6bbc('0x49')](handleError(_0x41bd66,null));};exports[_0x6bbc('0x9a')]=function(_0x44edad,_0x2ae719,_0xdcdb7d){var _0x5d12df={};var _0x33ab8e={};var _0x476be6;var _0x1aded0;return db[_0x6bbc('0x30')][_0x6bbc('0x5a')]({'where':{'id':_0x44edad[_0x6bbc('0x4b')]['id']}})[_0x6bbc('0x27')](handleEntityNotFound(_0x2ae719,null))['then'](function(_0x2be1d8){if(_0x2be1d8){_0x476be6=_0x2be1d8;_0x33ab8e[_0x6bbc('0x39')]=_[_0x6bbc('0x36')](db[_0x6bbc('0x9b')][_0x6bbc('0x31')]);_0x33ab8e['query']=_['keys'](_0x44edad[_0x6bbc('0x35')]);_0x33ab8e[_0x6bbc('0x37')]=_[_0x6bbc('0x38')](_0x33ab8e[_0x6bbc('0x39')],_0x33ab8e[_0x6bbc('0x35')]);_0x5d12df['attributes']=_['intersection'](_0x33ab8e['model'],qs[_0x6bbc('0x3b')](_0x44edad[_0x6bbc('0x35')][_0x6bbc('0x3b')]));_0x5d12df['attributes']=_0x5d12df[_0x6bbc('0x3a')]['length']?_0x5d12df['attributes']:_0x33ab8e[_0x6bbc('0x39')];_0x5d12df[_0x6bbc('0x5b')]=qs[_0x6bbc('0x3f')](_0x44edad[_0x6bbc('0x35')][_0x6bbc('0x3f')]);_0x5d12df['where']=qs[_0x6bbc('0x37')](_[_0x6bbc('0x5c')](_0x44edad[_0x6bbc('0x35')],_0x33ab8e[_0x6bbc('0x37')]));if(_0x44edad[_0x6bbc('0x35')][_0x6bbc('0x41')]){_0x5d12df[_0x6bbc('0x40')]=_[_0x6bbc('0x42')](_0x5d12df[_0x6bbc('0x40')],{'$or':_[_0x6bbc('0x2f')](_0x5d12df[_0x6bbc('0x3a')],function(_0x4cbeb4){var _0x30790d={};_0x30790d[_0x4cbeb4]={'$like':'%'+_0x44edad[_0x6bbc('0x35')][_0x6bbc('0x41')]+'%'};return _0x30790d;})});}_0x5d12df=_[_0x6bbc('0x42')]({},_0x5d12df,_0x44edad[_0x6bbc('0x44')]);return _0x476be6['getAgents'](_0x5d12df);}})[_0x6bbc('0x27')](function(_0x46b90a){if(_0x46b90a){_0x1aded0=_0x46b90a[_0x6bbc('0x3c')];if(!_0x44edad[_0x6bbc('0x35')][_0x6bbc('0x3d')](_0x6bbc('0x3e'))){_0x5d12df[_0x6bbc('0x22')]=qs['limit'](_0x44edad[_0x6bbc('0x35')]['limit']);_0x5d12df[_0x6bbc('0x1f')]=qs[_0x6bbc('0x1f')](_0x44edad[_0x6bbc('0x35')][_0x6bbc('0x1f')]);}return _0x476be6['getAgents'](_0x5d12df);}})[_0x6bbc('0x27')](function(_0x58b799){if(_0x58b799){return _0x58b799?{'count':_0x1aded0,'rows':_0x58b799}:null;}})['then'](respondWithResult(_0x2ae719,null))[_0x6bbc('0x49')](handleError(_0x2ae719,null));};function handleQuery(_0x5dbeca){logger['info'](_0x5dbeca);return db[_0x6bbc('0x86')]['query'](_0x5dbeca)[_0x6bbc('0x95')](function(_0x5ce8c0){csv_results[_0x6bbc('0x65')](_0x5ce8c0);})[_0x6bbc('0x49')](function(_0x1021cc){logger[_0x6bbc('0x9c')](_0x1021cc[_0x6bbc('0x68')]);});}
\ No newline at end of file
+var _0x4aab=['key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','removeDispositions','addContacts','CmContact','tags','isArray','push','omit','ids','success','dataValues','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','format','raw','getContactsCsv','ContactItemType','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','field','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','description_additionalPhone_','toString','each','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','text/csv','download','addCustomField','findOne','sequelize','transaction','CmCustomField','text','Sequelize','TEXT','number','switch','BOOLEAN','queryInterface','addColumn','cf_%s','findAndCountAll','getGlobalCustomFields','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','info','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','offset','limit','undefined','count','status','Content-Range','json','apply','reject','save','update','then','destroy','Lists','UserProfileResource','end','error','stack','name','send','index','CmList','rawAttributes','type'];(function(_0x2d8423,_0x51318a){var _0x27e8dd=function(_0x2f8542){while(--_0x2f8542){_0x2d8423['push'](_0x2d8423['shift']());}};_0x27e8dd(++_0x51318a);}(_0x4aab,0x111));var _0xb4aa=function(_0x1e7b51,_0x3f3fb7){_0x1e7b51=_0x1e7b51-0x0;var _0x1a5109=_0x4aab[_0x1e7b51];return _0x1a5109;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb4aa('0x0'));var zipdir=require(_0xb4aa('0x1'));var jsonpatch=require(_0xb4aa('0x2'));var rp=require(_0xb4aa('0x3'));var moment=require(_0xb4aa('0x4'));var BPromise=require(_0xb4aa('0x5'));var Mustache=require(_0xb4aa('0x6'));var util=require(_0xb4aa('0x7'));var path=require('path');var sox=require(_0xb4aa('0x8'));var csv=require(_0xb4aa('0x9'));var ejs=require(_0xb4aa('0xa'));var fs=require('fs');var fs_extra=require(_0xb4aa('0xb'));var _=require('lodash');var squel=require(_0xb4aa('0xc'));var crypto=require(_0xb4aa('0xd'));var jsforce=require(_0xb4aa('0xe'));var deskjs=require(_0xb4aa('0xf'));var toCsv=require(_0xb4aa('0x9'));var querystring=require('querystring');var Papa=require(_0xb4aa('0x10'));var Redis=require(_0xb4aa('0x11'));var authService=require(_0xb4aa('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb4aa('0x13'));var hardwareService=require(_0xb4aa('0x14'));var logger=require(_0xb4aa('0x15'))(_0xb4aa('0x16'));var utils=require(_0xb4aa('0x17'));var config=require(_0xb4aa('0x18'));var licenseUtil=require(_0xb4aa('0x19'));var db=require(_0xb4aa('0x1a'))['db'];var csv_results;config[_0xb4aa('0x1b')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb4aa('0x1c'))(new Redis(config['redis']));require('./cmList.socket')[_0xb4aa('0x1d')](socket);function respondWithStatusCode(_0xb8f7d1,_0x495eb7){_0x495eb7=_0x495eb7||0xcc;return function(_0x4d537){if(_0x4d537){return _0xb8f7d1[_0xb4aa('0x1e')](_0x495eb7);}return _0xb8f7d1['status'](_0x495eb7)['end']();};}function respondWithResult(_0x4fd9f0,_0x572be8){_0x572be8=_0x572be8||0xc8;return function(_0x34f6d7){if(_0x34f6d7){return _0x4fd9f0['status'](_0x572be8)['json'](_0x34f6d7);}};}function respondWithFilteredResult(_0x1ee68f,_0x367b64){return function(_0x22d385){if(_0x22d385){var _0x3fca51=typeof _0x367b64[_0xb4aa('0x1f')]==='undefined'&&typeof _0x367b64[_0xb4aa('0x20')]===_0xb4aa('0x21');var _0x345e8e=_0x22d385['count'];var _0x351f66=_0x3fca51?0x0:_0x367b64['offset'];var _0x44e3c1=_0x3fca51?_0x22d385[_0xb4aa('0x22')]:_0x367b64['offset']+_0x367b64['limit'];var _0x4023f7;if(_0x44e3c1>=_0x345e8e){_0x44e3c1=_0x345e8e;_0x4023f7=0xc8;}else{_0x4023f7=0xce;}_0x1ee68f[_0xb4aa('0x23')](_0x4023f7);return _0x1ee68f['set'](_0xb4aa('0x24'),_0x351f66+'-'+_0x44e3c1+'/'+_0x345e8e)[_0xb4aa('0x25')](_0x22d385);}return null;};}function patchUpdates(_0x49c991){return function(_0x2d56b6){try{jsonpatch[_0xb4aa('0x26')](_0x2d56b6,_0x49c991,!![]);}catch(_0x4bf24e){return BPromise[_0xb4aa('0x27')](_0x4bf24e);}return _0x2d56b6[_0xb4aa('0x28')]();};}function saveUpdates(_0x1058ec,_0x573725){return function(_0x548dcc){if(_0x548dcc){return _0x548dcc[_0xb4aa('0x29')](_0x1058ec)[_0xb4aa('0x2a')](function(_0x457fe5){return _0x457fe5;});}return null;};}function removeEntity(_0x2167bb,_0x20fe41){return function(_0xc2b2cb){if(_0xc2b2cb){return _0xc2b2cb[_0xb4aa('0x2b')]()[_0xb4aa('0x2a')](function(){var _0x3fd640=_0xc2b2cb['get']({'plain':!![]});var _0x102d72=_0xb4aa('0x2c');return db[_0xb4aa('0x2d')]['destroy']({'where':{'type':_0x102d72,'resourceId':_0x3fd640['id']}})[_0xb4aa('0x2a')](function(){return _0xc2b2cb;});})[_0xb4aa('0x2a')](function(){_0x2167bb[_0xb4aa('0x23')](0xcc)[_0xb4aa('0x2e')]();});}};}function handleEntityNotFound(_0x5d467b,_0x238504){return function(_0x33ee1f){if(!_0x33ee1f){_0x5d467b[_0xb4aa('0x1e')](0x194);}return _0x33ee1f;};}function handleError(_0x2c43a7,_0x4c8715){_0x4c8715=_0x4c8715||0x1f4;return function(_0x3064de){logger[_0xb4aa('0x2f')](_0x3064de[_0xb4aa('0x30')]);if(_0x3064de[_0xb4aa('0x31')]){delete _0x3064de[_0xb4aa('0x31')];}_0x2c43a7['status'](_0x4c8715)[_0xb4aa('0x32')](_0x3064de);};}exports[_0xb4aa('0x33')]=function(_0x255db3,_0x1a889d){var _0x35a816={},_0x36e15b={},_0x78e6df={'count':0x0,'rows':[]};var _0x2a15fc=_['map'](db[_0xb4aa('0x34')][_0xb4aa('0x35')],function(_0x4c47da){return{'name':_0x4c47da['fieldName'],'type':_0x4c47da[_0xb4aa('0x36')][_0xb4aa('0x37')]};});_0x36e15b[_0xb4aa('0x38')]=_[_0xb4aa('0x39')](_0x2a15fc,'name');_0x36e15b[_0xb4aa('0x3a')]=_['keys'](_0x255db3[_0xb4aa('0x3a')]);_0x36e15b['filters']=_[_0xb4aa('0x3b')](_0x36e15b['model'],_0x36e15b[_0xb4aa('0x3a')]);_0x35a816[_0xb4aa('0x3c')]=_[_0xb4aa('0x3b')](_0x36e15b[_0xb4aa('0x38')],qs[_0xb4aa('0x3d')](_0x255db3[_0xb4aa('0x3a')][_0xb4aa('0x3d')]));_0x35a816[_0xb4aa('0x3c')]=_0x35a816['attributes'][_0xb4aa('0x3e')]?_0x35a816['attributes']:_0x36e15b[_0xb4aa('0x38')];if(!_0x255db3[_0xb4aa('0x3a')][_0xb4aa('0x3f')](_0xb4aa('0x40'))){_0x35a816[_0xb4aa('0x20')]=qs[_0xb4aa('0x20')](_0x255db3[_0xb4aa('0x3a')]['limit']);_0x35a816[_0xb4aa('0x1f')]=qs['offset'](_0x255db3['query'][_0xb4aa('0x1f')]);}_0x35a816[_0xb4aa('0x41')]=qs[_0xb4aa('0x42')](_0x255db3[_0xb4aa('0x3a')][_0xb4aa('0x42')]);_0x35a816[_0xb4aa('0x43')]=qs[_0xb4aa('0x44')](_[_0xb4aa('0x45')](_0x255db3[_0xb4aa('0x3a')],_0x36e15b[_0xb4aa('0x44')]),_0x2a15fc);if(_0x255db3[_0xb4aa('0x3a')]['filter']){_0x35a816[_0xb4aa('0x43')]=_[_0xb4aa('0x46')](_0x35a816[_0xb4aa('0x43')],{'$or':_[_0xb4aa('0x39')](_0x2a15fc,function(_0x3db51f){if(_0x3db51f['type']!==_0xb4aa('0x47')){var _0x24f525={};_0x24f525[_0x3db51f[_0xb4aa('0x31')]]={'$like':'%'+_0x255db3['query'][_0xb4aa('0x48')]+'%'};return _0x24f525;}})});}_0x35a816=_[_0xb4aa('0x46')]({},_0x35a816,_0x255db3[_0xb4aa('0x49')]);var _0x5b5e32={'where':_0x35a816[_0xb4aa('0x43')]};return db[_0xb4aa('0x34')]['count'](_0x5b5e32)[_0xb4aa('0x2a')](function(_0x43bd57){_0x78e6df[_0xb4aa('0x22')]=_0x43bd57;if(_0x255db3[_0xb4aa('0x3a')][_0xb4aa('0x4a')]){_0x35a816[_0xb4aa('0x4b')]=[{'all':!![]}];}return db[_0xb4aa('0x34')][_0xb4aa('0x4c')](_0x35a816);})[_0xb4aa('0x2a')](function(_0x135b77){_0x78e6df[_0xb4aa('0x4d')]=_0x135b77;return _0x78e6df;})[_0xb4aa('0x2a')](respondWithFilteredResult(_0x1a889d,_0x35a816))['catch'](handleError(_0x1a889d,null));};exports[_0xb4aa('0x4e')]=function(_0x38adfb,_0x59c11b){var _0x28a85c={'raw':![],'where':{'id':_0x38adfb[_0xb4aa('0x4f')]['id']}},_0x54373c={};_0x54373c[_0xb4aa('0x38')]=_[_0xb4aa('0x50')](db[_0xb4aa('0x34')][_0xb4aa('0x35')]);_0x54373c[_0xb4aa('0x3a')]=_['keys'](_0x38adfb[_0xb4aa('0x3a')]);_0x54373c['filters']=_[_0xb4aa('0x3b')](_0x54373c['model'],_0x54373c[_0xb4aa('0x3a')]);_0x28a85c['attributes']=_[_0xb4aa('0x3b')](_0x54373c[_0xb4aa('0x38')],qs[_0xb4aa('0x3d')](_0x38adfb[_0xb4aa('0x3a')][_0xb4aa('0x3d')]));_0x28a85c[_0xb4aa('0x3c')]=_0x28a85c[_0xb4aa('0x3c')]['length']?_0x28a85c[_0xb4aa('0x3c')]:_0x54373c[_0xb4aa('0x38')];if(_0x38adfb[_0xb4aa('0x3a')][_0xb4aa('0x4a')]){_0x28a85c[_0xb4aa('0x4b')]=[{'all':!![]}];}_0x28a85c=_[_0xb4aa('0x46')]({},_0x28a85c,_0x38adfb[_0xb4aa('0x49')]);return db[_0xb4aa('0x34')]['find'](_0x28a85c)[_0xb4aa('0x2a')](handleEntityNotFound(_0x59c11b,null))[_0xb4aa('0x2a')](respondWithResult(_0x59c11b,null))[_0xb4aa('0x51')](handleError(_0x59c11b,null));};exports['create']=function(_0x147e14,_0xff6413){return db['CmList'][_0xb4aa('0x52')](_0x147e14[_0xb4aa('0x53')],{})[_0xb4aa('0x2a')](function(_0x536711){var _0x2e91f5=_0x147e14[_0xb4aa('0x54')][_0xb4aa('0x55')]({'plain':!![]});if(!_0x2e91f5)throw new Error(_0xb4aa('0x56'));if(_0x2e91f5['role']===_0xb4aa('0x54')){var _0x539571=_0x536711[_0xb4aa('0x55')]({'plain':!![]});var _0x2fe32b=_0xb4aa('0x2c');return db[_0xb4aa('0x57')][_0xb4aa('0x58')]({'where':{'name':_0x2fe32b,'userProfileId':_0x2e91f5[_0xb4aa('0x59')]},'raw':!![]})[_0xb4aa('0x2a')](function(_0x4f5cbf){if(_0x4f5cbf&&_0x4f5cbf[_0xb4aa('0x5a')]===0x0){return db['UserProfileResource']['create']({'name':_0x539571['name'],'resourceId':_0x539571['id'],'type':_0x4f5cbf[_0xb4aa('0x31')],'sectionId':_0x4f5cbf['id']},{})[_0xb4aa('0x2a')](function(){return _0x536711;});}else{return _0x536711;}})[_0xb4aa('0x51')](function(_0x41d2df){logger['error'](_0xb4aa('0x5b'),_0x41d2df);throw _0x41d2df;});}return _0x536711;})[_0xb4aa('0x2a')](respondWithResult(_0xff6413,0xc9))[_0xb4aa('0x51')](handleError(_0xff6413,null));};exports[_0xb4aa('0x29')]=function(_0xfa2a62,_0x3dadbf){if(_0xfa2a62[_0xb4aa('0x53')]['id']){delete _0xfa2a62[_0xb4aa('0x53')]['id'];}return db[_0xb4aa('0x34')][_0xb4aa('0x58')]({'where':{'id':_0xfa2a62['params']['id']}})[_0xb4aa('0x2a')](handleEntityNotFound(_0x3dadbf,null))[_0xb4aa('0x2a')](saveUpdates(_0xfa2a62[_0xb4aa('0x53')],null))[_0xb4aa('0x2a')](respondWithResult(_0x3dadbf,null))[_0xb4aa('0x51')](handleError(_0x3dadbf,null));};exports[_0xb4aa('0x2b')]=function(_0x5b1ee9,_0x569c71){return db['CmList']['find']({'where':{'id':_0x5b1ee9[_0xb4aa('0x4f')]['id']}})[_0xb4aa('0x2a')](handleEntityNotFound(_0x569c71,null))[_0xb4aa('0x2a')](removeEntity(_0x569c71,null))[_0xb4aa('0x51')](handleError(_0x569c71,null));};exports[_0xb4aa('0x5c')]=function(_0x4c382a,_0x491f15){return db[_0xb4aa('0x34')][_0xb4aa('0x5c')]()[_0xb4aa('0x2a')](respondWithResult(_0x491f15,null))[_0xb4aa('0x51')](handleError(_0x491f15,null));};exports[_0xb4aa('0x5d')]=function(_0x7aca32,_0x1d4751,_0x28e7d4){if(_0x7aca32['body']['id']){delete _0x7aca32[_0xb4aa('0x53')]['id'];}return db[_0xb4aa('0x34')][_0xb4aa('0x58')]({'where':{'id':_0x7aca32[_0xb4aa('0x4f')]['id']}})[_0xb4aa('0x2a')](handleEntityNotFound(_0x1d4751,null))[_0xb4aa('0x2a')](function(_0x531cb9){if(_0x531cb9){_0x7aca32[_0xb4aa('0x53')][_0xb4aa('0x5e')]=_0x531cb9['id'];return db[_0xb4aa('0x5f')][_0xb4aa('0x52')](_0x7aca32['body']);}})[_0xb4aa('0x2a')](respondWithResult(_0x1d4751,null))[_0xb4aa('0x51')](handleError(_0x1d4751,null));};exports['getDispositions']=function(_0x120725,_0x1e1273,_0x15b618){var _0x2b6ff3={'raw':![],'where':{}};var _0x549637={};var _0x4ef895={'count':0x0,'rows':[]};return db[_0xb4aa('0x34')]['findOne']({'where':{'id':_0x120725[_0xb4aa('0x4f')]['id']}})[_0xb4aa('0x2a')](handleEntityNotFound(_0x1e1273,null))[_0xb4aa('0x2a')](function(_0x48385b){if(_0x48385b){_0x549637[_0xb4aa('0x38')]=_[_0xb4aa('0x50')](db[_0xb4aa('0x5f')]['rawAttributes']);_0x549637[_0xb4aa('0x3a')]=_[_0xb4aa('0x50')](_0x120725[_0xb4aa('0x3a')]);_0x549637[_0xb4aa('0x44')]=_[_0xb4aa('0x3b')](_0x549637[_0xb4aa('0x38')],_0x549637[_0xb4aa('0x3a')]);_0x2b6ff3['attributes']=_[_0xb4aa('0x3b')](_0x549637['model'],qs[_0xb4aa('0x3d')](_0x120725[_0xb4aa('0x3a')][_0xb4aa('0x3d')]));_0x2b6ff3[_0xb4aa('0x3c')]=_0x2b6ff3['attributes']['length']?_0x2b6ff3[_0xb4aa('0x3c')]:_0x549637[_0xb4aa('0x38')];if(!_0x120725[_0xb4aa('0x3a')][_0xb4aa('0x3f')]('nolimit')){_0x2b6ff3[_0xb4aa('0x20')]=qs[_0xb4aa('0x20')](_0x120725[_0xb4aa('0x3a')][_0xb4aa('0x20')]);_0x2b6ff3[_0xb4aa('0x1f')]=qs['offset'](_0x120725[_0xb4aa('0x3a')][_0xb4aa('0x1f')]);}_0x2b6ff3[_0xb4aa('0x41')]=qs[_0xb4aa('0x42')](_0x120725['query'][_0xb4aa('0x42')]);_0x2b6ff3[_0xb4aa('0x43')]=qs[_0xb4aa('0x44')](_[_0xb4aa('0x45')](_0x120725[_0xb4aa('0x3a')],_0x549637[_0xb4aa('0x44')]));_0x2b6ff3['where'][_0xb4aa('0x5e')]=_0x48385b['id'];if(_0x120725[_0xb4aa('0x3a')]['filter']){_0x2b6ff3['where']=_[_0xb4aa('0x46')](_0x2b6ff3[_0xb4aa('0x43')],{'$or':_[_0xb4aa('0x39')](_0x2b6ff3['attributes'],function(_0x477ed8){var _0x481f69={};_0x481f69[_0x477ed8]={'$like':'%'+_0x120725[_0xb4aa('0x3a')][_0xb4aa('0x48')]+'%'};return _0x481f69;})});}_0x2b6ff3=_[_0xb4aa('0x46')]({},_0x2b6ff3,_0x120725['options']);return db[_0xb4aa('0x5f')][_0xb4aa('0x22')]({'where':_0x2b6ff3['where']})[_0xb4aa('0x2a')](function(_0x7f95a8){_0x4ef895[_0xb4aa('0x22')]=_0x7f95a8;if(_0x120725[_0xb4aa('0x3a')][_0xb4aa('0x4a')]){_0x2b6ff3[_0xb4aa('0x4b')]=[{'all':!![]}];}return db['Disposition'][_0xb4aa('0x4c')](_0x2b6ff3);})[_0xb4aa('0x2a')](function(_0x16e847){_0x4ef895[_0xb4aa('0x4d')]=_0x16e847;return _0x4ef895;});}})[_0xb4aa('0x2a')](respondWithFilteredResult(_0x1e1273,_0x2b6ff3))[_0xb4aa('0x51')](handleError(_0x1e1273,null));};exports['removeDispositions']=function(_0x465e0f,_0x5145a0,_0x1dbaea){return db[_0xb4aa('0x34')][_0xb4aa('0x58')]({'where':{'id':_0x465e0f[_0xb4aa('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5145a0,null))[_0xb4aa('0x2a')](function(_0x1f987a){if(_0x1f987a){return _0x1f987a[_0xb4aa('0x60')](_0x465e0f['query']['ids']);}})[_0xb4aa('0x2a')](respondWithStatusCode(_0x5145a0,null))[_0xb4aa('0x51')](handleError(_0x5145a0,null));};exports[_0xb4aa('0x61')]=function(_0x38ad87,_0x40052e,_0x42a1d4){return db['CmList'][_0xb4aa('0x58')]({'where':{'id':_0x38ad87[_0xb4aa('0x4f')]['id']}})[_0xb4aa('0x2a')](handleEntityNotFound(_0x40052e,null))['then'](function(_0xdc3a3d){if(_0xdc3a3d){var _0x3d27a0=[];var _0x5df585={'success':[],'errors':[]};return db[_0xb4aa('0x62')][_0xb4aa('0x5c')]()[_0xb4aa('0x2a')](function(_0x2df83c){if(_0x38ad87[_0xb4aa('0x53')][_0xb4aa('0x63')]&&_['isArray'](_0x38ad87[_0xb4aa('0x53')]['tags'])){if(_0x38ad87[_0xb4aa('0x53')][_0xb4aa('0x63')]['length']){_0x38ad87[_0xb4aa('0x53')][_0xb4aa('0x63')]=_0x38ad87[_0xb4aa('0x53')]['tags']['join'](';')+';';}else{_0x38ad87[_0xb4aa('0x53')][_0xb4aa('0x63')]=null;}}else{_0x38ad87[_0xb4aa('0x53')][_0xb4aa('0x63')]=null;}if(_0x38ad87[_0xb4aa('0x53')]&&_[_0xb4aa('0x64')](_0x38ad87['body'])){for(var _0xf514ec=0x0;_0xf514ec<_0x38ad87[_0xb4aa('0x53')][_0xb4aa('0x3e')];_0xf514ec+=0x1){_0x38ad87['body'][_0xf514ec][_0xb4aa('0x5e')]=_0x38ad87['params']['id'];_0x3d27a0[_0xb4aa('0x65')](_0x38ad87['body'][_0xf514ec]);}return BPromise['each'](_0x3d27a0,function(_0x242b9d){return db[_0xb4aa('0x62')]['create'](_[_0xb4aa('0x66')](_0x242b9d,[_0xb4aa('0x67'),'id'])||{},{'fields':_[_0xb4aa('0x50')](_0x2df83c),'raw':!![]})[_0xb4aa('0x2a')](function(_0x454186){_0x5df585[_0xb4aa('0x68')]['push'](_0x454186[_0xb4aa('0x69')]);})['catch'](function(_0x5d17c6){_0x5df585['errors'][_0xb4aa('0x65')]({'data':_0x242b9d,'error':_0x5d17c6[_0xb4aa('0x6a')]});});})[_0xb4aa('0x2a')](function(_0x5a6b5f){return _0x5df585;})['catch'](function(_0x4ed435){return _0x4ed435;});}else{_0x40052e[_0xb4aa('0x23')](0x190)[_0xb4aa('0x25')]({'message':_0xb4aa('0x6b')});}});}})[_0xb4aa('0x2a')](respondWithResult(_0x40052e,null))[_0xb4aa('0x51')](handleError(_0x40052e,null));};exports[_0xb4aa('0x6c')]=function(_0xa21edd,_0x68f7a2,_0x44d70d){var _0x18631d;return db[_0xb4aa('0x34')]['find']({'where':{'id':_0xa21edd['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0xb4aa('0x6d')}]})[_0xb4aa('0x2a')](handleEntityNotFound(_0x68f7a2,null))['then'](function(_0x170c33){if(_0x170c33){_0x18631d=_0x170c33;return db[_0xb4aa('0x62')][_0xb4aa('0x35')];}})[_0xb4aa('0x2a')](function(_0x25bed9){if(_0x25bed9){var _0x36c29f={};var _0x3c2ea8={};_0x3c2ea8[_0xb4aa('0x38')]=_[_0xb4aa('0x6e')](_[_0xb4aa('0x50')](_0x25bed9),_['map'](_0x18631d[_0xb4aa('0x6d')],function(_0x19851a){return util[_0xb4aa('0x6f')]('cf_%d',_0x19851a['id']);}));_0x3c2ea8['query']=_['keys'](_0xa21edd['query']);_0x3c2ea8['filters']=_[_0xb4aa('0x3b')](_0x3c2ea8['model'],_0x3c2ea8[_0xb4aa('0x3a')]);_0x36c29f[_0xb4aa('0x3c')]=_['intersection'](_0x3c2ea8[_0xb4aa('0x38')],qs[_0xb4aa('0x3d')](_0xa21edd[_0xb4aa('0x3a')][_0xb4aa('0x3d')]));_0x36c29f['attributes']=_0x36c29f['attributes'][_0xb4aa('0x3e')]?_0x36c29f[_0xb4aa('0x3c')]:_0x3c2ea8[_0xb4aa('0x38')];if(!_0xa21edd[_0xb4aa('0x3a')]['hasOwnProperty'](_0xb4aa('0x40'))){_0x36c29f[_0xb4aa('0x20')]=qs[_0xb4aa('0x20')](_0xa21edd['query'][_0xb4aa('0x20')]);_0x36c29f[_0xb4aa('0x1f')]=qs[_0xb4aa('0x1f')](_0xa21edd[_0xb4aa('0x3a')][_0xb4aa('0x1f')]);}_0x36c29f[_0xb4aa('0x41')]=qs[_0xb4aa('0x42')](_0xa21edd['query']['sort']);_0x36c29f[_0xb4aa('0x43')]=qs['filters'](_['pick'](_0xa21edd[_0xb4aa('0x3a')],_0x3c2ea8[_0xb4aa('0x44')]));_0x36c29f[_0xb4aa('0x70')]=!![];if(_0xa21edd['query'][_0xb4aa('0x48')]){_0x36c29f[_0xb4aa('0x43')]=_[_0xb4aa('0x46')](_0x36c29f[_0xb4aa('0x43')],{'$or':_[_0xb4aa('0x39')](_0x36c29f[_0xb4aa('0x3c')],function(_0x1d5d81){var _0x2ea10a={};_0x2ea10a[_0x1d5d81]={'$like':'%'+_0xa21edd['query']['filter']+'%'};return _0x2ea10a;})});}_0x36c29f=_['merge']({},_0x36c29f,_0xa21edd[_0xb4aa('0x49')]);return _0x18631d[_0xb4aa('0x6c')](_0x36c29f);}})[_0xb4aa('0x2a')](respondWithResult(_0x68f7a2,null))[_0xb4aa('0x51')](handleError(_0x68f7a2,null));};exports[_0xb4aa('0x71')]=function(_0x22da0d,_0x1ee2f1,_0x53ca50){var _0x218f1b;var _0x4275d7;var _0x300faf;var _0x5efa09=_0x22da0d['params']['id'];csv_results=[];return db[_0xb4aa('0x72')][_0xb4aa('0x4c')]({'attributes':['id',_0xb4aa('0x31')],'raw':!![],'order':['OrderBy']})[_0xb4aa('0x2a')](function(_0x210a80){_0x218f1b=_0x210a80;var _0x12f80b=_[_0xb4aa('0x50')](db['CmContact'][_0xb4aa('0x35')]);return db['CmCustomField'][_0xb4aa('0x4c')]({'raw':!![],'attributes':['id',_0xb4aa('0x73')]})[_0xb4aa('0x2a')](function(_0xd6d973){_0x4275d7=_0xd6d973;var _0x3ab210=squel[_0xb4aa('0x74')]()[_0xb4aa('0x3d')](_0x12f80b)[_0xb4aa('0x75')](_0xb4aa('0x76'),'c')[_0xb4aa('0x43')](_0xb4aa('0x77'),_0x5efa09)[_0xb4aa('0x43')](_0xb4aa('0x78'))['distinct']();for(var _0x4a32ea=0x0;_0x4a32ea<_0x4275d7[_0xb4aa('0x3e')];_0x4a32ea++){_0x3ab210['field']('c.cf_'+_0x4275d7[_0x4a32ea]['id'],'customField_'+_0x4275d7[_0x4a32ea][_0xb4aa('0x73')]);}for(var _0x4a32ea=0x0;_0x4a32ea<_0x218f1b['length'];_0x4a32ea++){_0x3ab210[_0xb4aa('0x79')](squel[_0xb4aa('0x74')]()[_0xb4aa('0x79')](_0xb4aa('0x7a'))[_0xb4aa('0x75')](_0xb4aa('0x7b'))['where'](_0xb4aa('0x7c'),_0x218f1b[_0x4a32ea]['id'])['where'](_0xb4aa('0x7d')),_0xb4aa('0x7e')+_0x218f1b[_0x4a32ea][_0xb4aa('0x31')]);_0x3ab210[_0xb4aa('0x79')](squel[_0xb4aa('0x74')]()[_0xb4aa('0x79')](_0xb4aa('0x7f'))[_0xb4aa('0x75')]('cm_contact_has_items')['where'](_0xb4aa('0x7c'),_0x218f1b[_0x4a32ea]['id'])[_0xb4aa('0x43')](_0xb4aa('0x7d')),_0xb4aa('0x80')+_0x218f1b[_0x4a32ea][_0xb4aa('0x31')]);}var _0xdb9258=[];_0xdb9258[_0xb4aa('0x65')](_0x3ab210[_0xb4aa('0x81')]());BPromise[_0xb4aa('0x82')](_0xdb9258,handleQuery)[_0xb4aa('0x2a')](function(_0x518724){handleQuery(_0x3ab210[_0xb4aa('0x81')]());var _0x306a48=csv_results[0x0];if(!_[_0xb4aa('0x83')](_0x306a48)){var _0x5ced66=toCsv(_0x306a48);var _0x5a89a8=Date[_0xb4aa('0x84')]();fs[_0xb4aa('0x85')](util[_0xb4aa('0x6f')](_0xb4aa('0x86'),_0x5efa09,_0x5a89a8),_0x5ced66);_0x1ee2f1[_0xb4aa('0x87')]('Content-disposition',_0xb4aa('0x88')+util[_0xb4aa('0x6f')]('list_%d_%s.csv',_0x5efa09,_0x5a89a8));_0x1ee2f1['setHeader']('Content-type',_0xb4aa('0x89'));return _0x1ee2f1[_0xb4aa('0x8a')](util[_0xb4aa('0x6f')](_0xb4aa('0x86'),_0x5efa09,_0x5a89a8));}else{return _0x1ee2f1[_0xb4aa('0x1e')](0xcc);}});});});};exports[_0xb4aa('0x8b')]=function(_0x4f6083,_0x306b6e,_0x325da2){var _0x3d3178;delete _0x4f6083[_0xb4aa('0x53')]['id'];return db[_0xb4aa('0x34')][_0xb4aa('0x8c')]({'where':{'id':_0x4f6083[_0xb4aa('0x4f')]['id']}})[_0xb4aa('0x2a')](handleEntityNotFound(_0x306b6e,null))[_0xb4aa('0x2a')](function(_0x22df83){if(_0x22df83){return db[_0xb4aa('0x8d')][_0xb4aa('0x8e')](function(_0x76466d){return db[_0xb4aa('0x8f')]['create'](_0x4f6083[_0xb4aa('0x53')],{'transaction':_0x76466d})[_0xb4aa('0x2a')](function(_0xe23652){_0x3d3178=_0xe23652;return _0x22df83['addCustomFields'](_0xe23652,{'transaction':_0x76466d});})[_0xb4aa('0x2a')](function(){var _0x18ce22={'type':db['Sequelize']['TEXT'],'transaction':_0x76466d};switch(_0x4f6083[_0xb4aa('0x53')]['type']){case _0xb4aa('0x90'):_0x18ce22[_0xb4aa('0x36')]=db[_0xb4aa('0x91')][_0xb4aa('0x92')];break;case _0xb4aa('0x93'):_0x18ce22[_0xb4aa('0x36')]=db[_0xb4aa('0x91')]['INTEGER'];break;case _0xb4aa('0x94'):_0x18ce22[_0xb4aa('0x36')]=db['Sequelize'][_0xb4aa('0x95')];_0x18ce22['defaultValue']=![];break;default:}return db['sequelize'][_0xb4aa('0x96')][_0xb4aa('0x97')](_0xb4aa('0x76'),util[_0xb4aa('0x6f')](_0xb4aa('0x98'),_0x3d3178['id']),_0x18ce22);})[_0xb4aa('0x2a')](function(){return _0x3d3178;});});}})['then'](respondWithResult(_0x306b6e,null))['catch'](handleError(_0x306b6e,null));};exports['getCustomFields']=function(_0x5ad3a5,_0x44f66e,_0x1f2612){var _0x4281ca={};var _0x88f8dd={};var _0x22a195;var _0x5020a4;return db['CmList'][_0xb4aa('0x8c')]({'where':{'id':_0x5ad3a5[_0xb4aa('0x4f')]['id']}})[_0xb4aa('0x2a')](handleEntityNotFound(_0x44f66e,null))[_0xb4aa('0x2a')](function(_0xa11047){if(_0xa11047){_0x22a195=_0xa11047;_0x88f8dd['model']=_['keys'](db[_0xb4aa('0x8f')][_0xb4aa('0x35')]);_0x88f8dd['query']=_[_0xb4aa('0x50')](_0x5ad3a5[_0xb4aa('0x3a')]);_0x88f8dd['filters']=_['intersection'](_0x88f8dd[_0xb4aa('0x38')],_0x88f8dd[_0xb4aa('0x3a')]);_0x4281ca[_0xb4aa('0x3c')]=_[_0xb4aa('0x3b')](_0x88f8dd[_0xb4aa('0x38')],qs[_0xb4aa('0x3d')](_0x5ad3a5[_0xb4aa('0x3a')][_0xb4aa('0x3d')]));_0x4281ca[_0xb4aa('0x3c')]=_0x4281ca[_0xb4aa('0x3c')][_0xb4aa('0x3e')]?_0x4281ca[_0xb4aa('0x3c')]:_0x88f8dd['model'];_0x4281ca['order']=qs[_0xb4aa('0x42')](_0x5ad3a5[_0xb4aa('0x3a')][_0xb4aa('0x42')]);_0x4281ca[_0xb4aa('0x43')]=qs[_0xb4aa('0x44')](_[_0xb4aa('0x45')](_0x5ad3a5[_0xb4aa('0x3a')],_0x88f8dd[_0xb4aa('0x44')]));_0x4281ca[_0xb4aa('0x43')]=_[_0xb4aa('0x46')](_0x4281ca['where'],{'$or':[{'ListId':_0xa11047['id']},{'ListId':null}]});if(_0x5ad3a5[_0xb4aa('0x3a')][_0xb4aa('0x48')]){_0x4281ca['where']=_[_0xb4aa('0x46')](_0x4281ca[_0xb4aa('0x43')],{'$or':_[_0xb4aa('0x39')](_0x4281ca[_0xb4aa('0x3c')],function(_0x5aff80){var _0x5a4a56={};_0x5a4a56[_0x5aff80]={'$like':'%'+_0x5ad3a5[_0xb4aa('0x3a')]['filter']+'%'};return _0x5a4a56;})});}_0x4281ca=_[_0xb4aa('0x46')]({},_0x4281ca,_0x5ad3a5[_0xb4aa('0x49')]);return db[_0xb4aa('0x8f')][_0xb4aa('0x99')](_0x4281ca);}})[_0xb4aa('0x2a')](respondWithResult(_0x44f66e,null))['catch'](handleError(_0x44f66e,null));};exports[_0xb4aa('0x9a')]=function(_0x42c299,_0x5cf962){return db['CmCustomField'][_0xb4aa('0x99')]({'where':{'ListId':null}})[_0xb4aa('0x2a')](handleEntityNotFound(_0x5cf962,null))[_0xb4aa('0x2a')](function(_0x4ae466){return _0x4ae466;})[_0xb4aa('0x2a')](respondWithResult(_0x5cf962,null))[_0xb4aa('0x51')](handleError(_0x5cf962,null));};exports[_0xb4aa('0x9b')]=function(_0x3bfa46,_0x3bdafe,_0x2550ce){return db['CmList']['find']({'where':{'id':_0x3bfa46['params']['id']}})[_0xb4aa('0x2a')](handleEntityNotFound(_0x3bdafe,null))[_0xb4aa('0x2a')](function(_0x104d25){if(_0x104d25){return _0x104d25[_0xb4aa('0x9b')](_0x3bfa46[_0xb4aa('0x53')][_0xb4aa('0x67')],_['omit'](_0x3bfa46[_0xb4aa('0x53')],['ids','id'])||{})[_0xb4aa('0x9c')](function(_0x132e2f){for(var _0x388c6d=0x0;_0x388c6d<_0x3bfa46[_0xb4aa('0x53')][_0xb4aa('0x67')]['length'];_0x388c6d+=0x1){socket['emit'](_0xb4aa('0x9d'),{'UserId':Number(_0x3bfa46[_0xb4aa('0x53')][_0xb4aa('0x67')][_0x388c6d]),'CmListId':Number(_0x3bfa46['params']['id'])});}return _0x132e2f;});}})[_0xb4aa('0x2a')](respondWithResult(_0x3bdafe,null))[_0xb4aa('0x51')](handleError(_0x3bdafe,null));};exports[_0xb4aa('0x9e')]=function(_0x19a69b,_0x594992,_0x308899){return db[_0xb4aa('0x34')][_0xb4aa('0x58')]({'where':{'id':_0x19a69b['params']['id']}})[_0xb4aa('0x2a')](handleEntityNotFound(_0x594992,null))['then'](function(_0x370326){if(_0x370326){return _0x370326[_0xb4aa('0x9e')](_0x19a69b['query'][_0xb4aa('0x67')])['then'](function(){if(_[_0xb4aa('0x64')](_0x19a69b[_0xb4aa('0x3a')]['ids'])){for(var _0x3a8f6d=0x0;_0x3a8f6d<_0x19a69b[_0xb4aa('0x3a')][_0xb4aa('0x67')][_0xb4aa('0x3e')];_0x3a8f6d+=0x1){socket[_0xb4aa('0x9f')](_0xb4aa('0xa0'),{'UserId':Number(_0x19a69b[_0xb4aa('0x3a')][_0xb4aa('0x67')][_0x3a8f6d]),'CmListId':Number(_0x19a69b[_0xb4aa('0x4f')]['id'])});}}else{socket[_0xb4aa('0x9f')](_0xb4aa('0xa0'),{'UserId':Number(_0x19a69b[_0xb4aa('0x3a')][_0xb4aa('0x67')]),'CmListId':Number(_0x19a69b[_0xb4aa('0x4f')]['id'])});}});}})[_0xb4aa('0x2a')](respondWithStatusCode(_0x594992,null))[_0xb4aa('0x51')](handleError(_0x594992,null));};exports[_0xb4aa('0xa1')]=function(_0x105cb3,_0x427b05,_0x2f5613){var _0x53a5a6={};var _0x29a198={};var _0x1ee6f0;var _0x4bd3f3;return db['CmList'][_0xb4aa('0x8c')]({'where':{'id':_0x105cb3[_0xb4aa('0x4f')]['id']}})[_0xb4aa('0x2a')](handleEntityNotFound(_0x427b05,null))[_0xb4aa('0x2a')](function(_0x296efb){if(_0x296efb){_0x1ee6f0=_0x296efb;_0x29a198[_0xb4aa('0x38')]=_[_0xb4aa('0x50')](db[_0xb4aa('0xa2')]['rawAttributes']);_0x29a198[_0xb4aa('0x3a')]=_['keys'](_0x105cb3['query']);_0x29a198['filters']=_[_0xb4aa('0x3b')](_0x29a198[_0xb4aa('0x38')],_0x29a198['query']);_0x53a5a6['attributes']=_[_0xb4aa('0x3b')](_0x29a198[_0xb4aa('0x38')],qs[_0xb4aa('0x3d')](_0x105cb3['query'][_0xb4aa('0x3d')]));_0x53a5a6[_0xb4aa('0x3c')]=_0x53a5a6[_0xb4aa('0x3c')][_0xb4aa('0x3e')]?_0x53a5a6[_0xb4aa('0x3c')]:_0x29a198[_0xb4aa('0x38')];_0x53a5a6[_0xb4aa('0x41')]=qs['sort'](_0x105cb3[_0xb4aa('0x3a')][_0xb4aa('0x42')]);_0x53a5a6[_0xb4aa('0x43')]=qs['filters'](_['pick'](_0x105cb3[_0xb4aa('0x3a')],_0x29a198[_0xb4aa('0x44')]));if(_0x105cb3['query'][_0xb4aa('0x48')]){_0x53a5a6[_0xb4aa('0x43')]=_[_0xb4aa('0x46')](_0x53a5a6[_0xb4aa('0x43')],{'$or':_[_0xb4aa('0x39')](_0x53a5a6[_0xb4aa('0x3c')],function(_0x39cdbb){var _0x12249c={};_0x12249c[_0x39cdbb]={'$like':'%'+_0x105cb3[_0xb4aa('0x3a')]['filter']+'%'};return _0x12249c;})});}_0x53a5a6=_[_0xb4aa('0x46')]({},_0x53a5a6,_0x105cb3[_0xb4aa('0x49')]);return _0x1ee6f0[_0xb4aa('0xa1')](_0x53a5a6);}})[_0xb4aa('0x2a')](function(_0x3e52ed){if(_0x3e52ed){_0x4bd3f3=_0x3e52ed['length'];if(!_0x105cb3[_0xb4aa('0x3a')]['hasOwnProperty'](_0xb4aa('0x40'))){_0x53a5a6['limit']=qs['limit'](_0x105cb3['query'][_0xb4aa('0x20')]);_0x53a5a6['offset']=qs[_0xb4aa('0x1f')](_0x105cb3[_0xb4aa('0x3a')][_0xb4aa('0x1f')]);}return _0x1ee6f0[_0xb4aa('0xa1')](_0x53a5a6);}})[_0xb4aa('0x2a')](function(_0x2a8d0f){if(_0x2a8d0f){return _0x2a8d0f?{'count':_0x4bd3f3,'rows':_0x2a8d0f}:null;}})['then'](respondWithResult(_0x427b05,null))[_0xb4aa('0x51')](handleError(_0x427b05,null));};function handleQuery(_0x73db95){logger[_0xb4aa('0xa3')](_0x73db95);return db['sequelize'][_0xb4aa('0x3a')](_0x73db95)[_0xb4aa('0x9c')](function(_0x1b4cee){csv_results['push'](_0x1b4cee);})['catch'](function(_0xcc9b02){logger[_0xb4aa('0x2f')](_0xcc9b02[_0xb4aa('0x6a')]);});}
\ No newline at end of file
index 01cf78a..81d362c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x55ca,0x126));var _0xa55c=function(_0x2d991c,_0x1583d4){_0x2d991c=_0x2d991c-0x0;var _0x3d5af5=_0x55ca[_0x2d991c];return _0x3d5af5;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents;
\ No newline at end of file
+var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x326e79,_0x33dc91){var _0x37eb89=function(_0xbaef25){while(--_0xbaef25){_0x326e79['push'](_0x326e79['shift']());}};_0x37eb89(++_0x33dc91);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3f00ee,_0x1d1673){_0x3f00ee=_0x3f00ee-0x0;var _0x18a07e=_0x5fc3[_0x3f00ee];return _0x18a07e;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents;
\ No newline at end of file
index 0d29b85..de5bda3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['rimraf','../../config/environment','./cmList.attributes','CmList','cm_lists','lodash','util','api','moment','bluebird','path'];(function(_0x5d4800,_0x262613){var _0xdf408f=function(_0x45e173){while(--_0x45e173){_0x5d4800['push'](_0x5d4800['shift']());}};_0xdf408f(++_0x262613);}(_0xb43b,0x1b2));var _0xbb43=function(_0x56d4d3,_0x359044){_0x56d4d3=_0x56d4d3-0x0;var _0x492100=_0xb43b[_0x56d4d3];return _0x492100;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb43('0x5'));var rimraf=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var attributes=require(_0xbb43('0x8'));module['exports']=function(_0x491fb9,_0x378df5){return _0x491fb9['define'](_0xbb43('0x9'),attributes,{'tableName':_0xbb43('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6324=['define','cm_lists','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','exports'];(function(_0x396fc0,_0xddf8b9){var _0x34a4b3=function(_0x162a69){while(--_0x162a69){_0x396fc0['push'](_0x396fc0['shift']());}};_0x34a4b3(++_0xddf8b9);}(_0x6324,0x142));var _0x4632=function(_0xff9cb,_0x1b45d7){_0xff9cb=_0xff9cb-0x0;var _0x455a53=_0x6324[_0xff9cb];return _0x455a53;};'use strict';var _=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var logger=require(_0x4632('0x2'))(_0x4632('0x3'));var moment=require('moment');var BPromise=require(_0x4632('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4632('0x5'));var rimraf=require('rimraf');var config=require(_0x4632('0x6'));var attributes=require('./cmList.attributes');module[_0x4632('0x7')]=function(_0x24aba6,_0x1f3077){return _0x24aba6[_0x4632('0x8')]('CmList',attributes,{'tableName':_0x4632('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5b5cc90..989590a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x364c=['request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s'];(function(_0x5d79ba,_0x77939f){var _0xea0ff7=function(_0x102f16){while(--_0x102f16){_0x5d79ba['push'](_0x5d79ba['shift']());}};_0xea0ff7(++_0x77939f);}(_0x364c,0x182));var _0xc364=function(_0xc15b0a,_0x52f3bd){_0xc15b0a=_0xc15b0a-0x0;var _0x52361b=_0x364c[_0xc15b0a];return _0x52361b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc364('0x0'));var rs=require(_0xc364('0x1'));var fs=require('fs');var Redis=require(_0xc364('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc364('0x3'));var logger=require(_0xc364('0x4'))(_0xc364('0x5'));var config=require(_0xc364('0x6'));var jayson=require(_0xc364('0x7'));var client=jayson[_0xc364('0x8')][_0xc364('0x9')]({'port':0x232a});config[_0xc364('0xa')]=_['defaults'](config[_0xc364('0xa')],{'host':_0xc364('0xb'),'port':0x18eb});var socket=require(_0xc364('0xc'))(new Redis(config[_0xc364('0xa')]));require(_0xc364('0xd'))[_0xc364('0xe')](socket);function respondWithRpcPromise(_0x1d354a,_0x39e465,_0x293154){return new BPromise(function(_0x564173,_0x2ad389){return client[_0xc364('0xf')](_0x1d354a,_0x293154)[_0xc364('0x10')](function(_0x135cb1){logger[_0xc364('0x11')](_0xc364('0x12'),_0x39e465,_0xc364('0x13'));logger[_0xc364('0x14')](_0xc364('0x15'),_0x39e465,_0xc364('0x13'),JSON[_0xc364('0x16')](_0x135cb1));if(_0x135cb1[_0xc364('0x17')]){if(_0x135cb1[_0xc364('0x17')][_0xc364('0x18')]===0x1f4){logger[_0xc364('0x17')](_0xc364('0x12'),_0x39e465,_0x135cb1[_0xc364('0x17')][_0xc364('0x19')]);return _0x2ad389(_0x135cb1['error'][_0xc364('0x19')]);}logger[_0xc364('0x17')](_0xc364('0x12'),_0x39e465,_0x135cb1[_0xc364('0x17')][_0xc364('0x19')]);return _0x564173(_0x135cb1[_0xc364('0x17')][_0xc364('0x19')]);}else{logger[_0xc364('0x11')](_0xc364('0x12'),_0x39e465,_0xc364('0x13'));_0x564173(_0x135cb1['result']['message']);}})[_0xc364('0x1a')](function(_0x19b4e4){logger[_0xc364('0x17')](_0xc364('0x12'),_0x39e465,_0x19b4e4);_0x2ad389(_0x19b4e4);});});}
\ No newline at end of file
+var _0x80b0=['request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x3a4c1a,_0x166eac){var _0x31d0b9=function(_0x45226a){while(--_0x45226a){_0x3a4c1a['push'](_0x3a4c1a['shift']());}};_0x31d0b9(++_0x166eac);}(_0x80b0,0x193));var _0x080b=function(_0x4cdf78,_0x363cd5){_0x4cdf78=_0x4cdf78-0x0;var _0x5043ef=_0x80b0[_0x4cdf78];return _0x5043ef;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x080b('0x0'));var BPromise=require(_0x080b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x080b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x080b('0x3'));var logger=require(_0x080b('0x4'))(_0x080b('0x5'));var config=require(_0x080b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x080b('0x7')][_0x080b('0x8')]({'port':0x232a});config[_0x080b('0x9')]=_[_0x080b('0xa')](config[_0x080b('0x9')],{'host':_0x080b('0xb'),'port':0x18eb});var socket=require(_0x080b('0xc'))(new Redis(config[_0x080b('0x9')]));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x5163f2,_0x32e1a0,_0x4349cb){return new BPromise(function(_0x37f2f1,_0x370cfb){return client[_0x080b('0xd')](_0x5163f2,_0x4349cb)[_0x080b('0xe')](function(_0x5791a6){logger[_0x080b('0xf')](_0x080b('0x10'),_0x32e1a0,_0x080b('0x11'));logger[_0x080b('0x12')](_0x080b('0x13'),_0x32e1a0,'request\x20sent',JSON[_0x080b('0x14')](_0x5791a6));if(_0x5791a6[_0x080b('0x15')]){if(_0x5791a6[_0x080b('0x15')][_0x080b('0x16')]===0x1f4){logger[_0x080b('0x15')]('CmList,\x20%s,\x20%s',_0x32e1a0,_0x5791a6[_0x080b('0x15')][_0x080b('0x17')]);return _0x370cfb(_0x5791a6['error'][_0x080b('0x17')]);}logger[_0x080b('0x15')](_0x080b('0x10'),_0x32e1a0,_0x5791a6[_0x080b('0x15')][_0x080b('0x17')]);return _0x37f2f1(_0x5791a6['error'][_0x080b('0x17')]);}else{logger[_0x080b('0xf')]('CmList,\x20%s,\x20%s',_0x32e1a0,_0x080b('0x11'));_0x37f2f1(_0x5791a6[_0x080b('0x18')]['message']);}})[_0x080b('0x19')](function(_0x693f99){logger[_0x080b('0x15')](_0x080b('0x10'),_0x32e1a0,_0x693f99);_0x370cfb(_0x693f99);});});}
\ No newline at end of file
index 35c1070..a93a10a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07fb=['length','cmList:','remove','update','emit','removeListener','register'];(function(_0x466441,_0x1ef7fd){var _0x5293e7=function(_0x2fa1fe){while(--_0x2fa1fe){_0x466441['push'](_0x466441['shift']());}};_0x5293e7(++_0x1ef7fd);}(_0x07fb,0x113));var _0xb07f=function(_0x417157,_0x23eb0f){_0x417157=_0x417157-0x0;var _0x33d7d2=_0x07fb[_0x417157];return _0x33d7d2;};'use strict';var CmListEvents=require('./cmList.events');var events=['save',_0xb07f('0x0'),_0xb07f('0x1')];function createListener(_0x57c710,_0x4c1af1){return function(_0x44a1c7){_0x4c1af1[_0xb07f('0x2')](_0x57c710,_0x44a1c7);};}function removeListener(_0x859638,_0x3aba3b){return function(){CmListEvents[_0xb07f('0x3')](_0x859638,_0x3aba3b);};}exports[_0xb07f('0x4')]=function(_0x3c3b17){for(var _0x438e12=0x0,_0xb6b7ee=events[_0xb07f('0x5')];_0x438e12<_0xb6b7ee;_0x438e12++){var _0xbb2f6b=events[_0x438e12];var _0x198402=createListener(_0xb07f('0x6')+_0xbb2f6b,_0x3c3b17);CmListEvents['on'](_0xbb2f6b,_0x198402);}};
\ No newline at end of file
+var _0x9073=['length','cmList:','./cmList.events','save','remove','update','emit','removeListener','register'];(function(_0x5c8064,_0x30dd4c){var _0x4c0b2c=function(_0x180ed5){while(--_0x180ed5){_0x5c8064['push'](_0x5c8064['shift']());}};_0x4c0b2c(++_0x30dd4c);}(_0x9073,0x1cd));var _0x3907=function(_0xa72931,_0x37d87a){_0xa72931=_0xa72931-0x0;var _0x13b2f5=_0x9073[_0xa72931];return _0x13b2f5;};'use strict';var CmListEvents=require(_0x3907('0x0'));var events=[_0x3907('0x1'),_0x3907('0x2'),_0x3907('0x3')];function createListener(_0x331d2d,_0x41a215){return function(_0x315716){_0x41a215[_0x3907('0x4')](_0x331d2d,_0x315716);};}function removeListener(_0x3e56d1,_0x22ae97){return function(){CmListEvents[_0x3907('0x5')](_0x3e56d1,_0x22ae97);};}exports[_0x3907('0x6')]=function(_0x378c5e){for(var _0x3ae6db=0x0,_0x48d8f7=events[_0x3907('0x7')];_0x3ae6db<_0x48d8f7;_0x3ae6db++){var _0x359d8f=events[_0x3ae6db];var _0x1f6f14=createListener(_0x3907('0x8')+_0x359d8f,_0x378c5e);CmListEvents['on'](_0x359d8f,_0x1f6f14);}};
\ No newline at end of file
index 86db601..d7d916a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcd1=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','index','/describe','isAuthenticated','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addContacts','addAgents','put','delete','destroy','removeDispositions','removeAgents','exports','multer'];(function(_0x518999,_0x135b42){var _0x2c32bc=function(_0x23053f){while(--_0x23053f){_0x518999['push'](_0x518999['shift']());}};_0x2c32bc(++_0x135b42);}(_0xbcd1,0x1ed));var _0x1bcd=function(_0x532d1b,_0x5f0d39){_0x532d1b=_0x532d1b-0x0;var _0x1c4f3c=_0xbcd1[_0x532d1b];return _0x1c4f3c;};'use strict';var multer=require(_0x1bcd('0x0'));var util=require(_0x1bcd('0x1'));var path=require(_0x1bcd('0x2'));var timeout=require(_0x1bcd('0x3'));var express=require(_0x1bcd('0x4'));var router=express[_0x1bcd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1bcd('0x6'));var interaction=require(_0x1bcd('0x7'));var config=require('../../config/environment');var controller=require(_0x1bcd('0x8'));router[_0x1bcd('0x9')]('/',auth['isAuthenticated'](),controller[_0x1bcd('0xa')]);router[_0x1bcd('0x9')](_0x1bcd('0xb'),auth[_0x1bcd('0xc')](),controller[_0x1bcd('0xd')]);router[_0x1bcd('0x9')](_0x1bcd('0xe'),auth[_0x1bcd('0xc')](),controller[_0x1bcd('0xf')]);router['get'](_0x1bcd('0x10'),auth[_0x1bcd('0xc')](),controller[_0x1bcd('0x11')]);router['get']('/:id/dispositions',auth[_0x1bcd('0xc')](),controller['getDispositions']);router[_0x1bcd('0x9')](_0x1bcd('0x12'),auth[_0x1bcd('0xc')](),controller[_0x1bcd('0x13')]);router['get'](_0x1bcd('0x14'),auth[_0x1bcd('0xc')](),controller[_0x1bcd('0x15')]);router['get'](_0x1bcd('0x16'),auth['isAuthenticated'](),controller[_0x1bcd('0x17')]);router[_0x1bcd('0x9')](_0x1bcd('0x18'),auth['isAuthenticated'](),controller[_0x1bcd('0x19')]);router[_0x1bcd('0x1a')]('/',auth[_0x1bcd('0xc')](),controller[_0x1bcd('0x1b')]);router[_0x1bcd('0x1a')](_0x1bcd('0x1c'),auth[_0x1bcd('0xc')](),controller[_0x1bcd('0x1d')]);router['post'](_0x1bcd('0x12'),auth[_0x1bcd('0xc')](),controller[_0x1bcd('0x1e')]);router[_0x1bcd('0x1a')](_0x1bcd('0x16'),auth[_0x1bcd('0xc')](),controller['addCustomField']);router[_0x1bcd('0x1a')](_0x1bcd('0x18'),auth[_0x1bcd('0xc')](),controller[_0x1bcd('0x1f')]);router[_0x1bcd('0x20')](_0x1bcd('0x10'),auth[_0x1bcd('0xc')](),controller['update']);router[_0x1bcd('0x21')]('/:id',auth[_0x1bcd('0xc')](),controller[_0x1bcd('0x22')]);router[_0x1bcd('0x21')](_0x1bcd('0x1c'),auth[_0x1bcd('0xc')](),controller[_0x1bcd('0x23')]);router['delete'](_0x1bcd('0x18'),auth['isAuthenticated'](),controller[_0x1bcd('0x24')]);module[_0x1bcd('0x25')]=router;
\ No newline at end of file
+var _0xc212=['create','post','addDisposition','addContacts','addCustomField','addAgents','update','delete','destroy','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','describe','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getCustomFields','/:id/users'];(function(_0xe84805,_0x2702d9){var _0x398efd=function(_0x37cfad){while(--_0x37cfad){_0xe84805['push'](_0xe84805['shift']());}};_0x398efd(++_0x2702d9);}(_0xc212,0x1af));var _0x2c21=function(_0x3a23c1,_0x438edd){_0x3a23c1=_0x3a23c1-0x0;var _0x4c4e23=_0xc212[_0x3a23c1];return _0x4c4e23;};'use strict';var multer=require('multer');var util=require(_0x2c21('0x0'));var path=require(_0x2c21('0x1'));var timeout=require(_0x2c21('0x2'));var express=require(_0x2c21('0x3'));var router=express[_0x2c21('0x4')]();var fs_extra=require(_0x2c21('0x5'));var auth=require(_0x2c21('0x6'));var interaction=require(_0x2c21('0x7'));var config=require(_0x2c21('0x8'));var controller=require(_0x2c21('0x9'));router[_0x2c21('0xa')]('/',auth[_0x2c21('0xb')](),controller[_0x2c21('0xc')]);router[_0x2c21('0xa')]('/describe',auth[_0x2c21('0xb')](),controller[_0x2c21('0xd')]);router[_0x2c21('0xa')]('/global_fields',auth['isAuthenticated'](),controller[_0x2c21('0xe')]);router[_0x2c21('0xa')](_0x2c21('0xf'),auth[_0x2c21('0xb')](),controller[_0x2c21('0x10')]);router['get'](_0x2c21('0x11'),auth['isAuthenticated'](),controller[_0x2c21('0x12')]);router[_0x2c21('0xa')](_0x2c21('0x13'),auth[_0x2c21('0xb')](),controller[_0x2c21('0x14')]);router['get'](_0x2c21('0x15'),auth['isAuthenticated'](),controller['getContactsCsv']);router[_0x2c21('0xa')]('/:id/fields',auth[_0x2c21('0xb')](),controller[_0x2c21('0x16')]);router[_0x2c21('0xa')](_0x2c21('0x17'),auth[_0x2c21('0xb')](),controller['getAgents']);router['post']('/',auth[_0x2c21('0xb')](),controller[_0x2c21('0x18')]);router[_0x2c21('0x19')]('/:id/dispositions',auth[_0x2c21('0xb')](),controller[_0x2c21('0x1a')]);router['post'](_0x2c21('0x13'),auth['isAuthenticated'](),controller[_0x2c21('0x1b')]);router[_0x2c21('0x19')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2c21('0x1c')]);router[_0x2c21('0x19')]('/:id/users',auth[_0x2c21('0xb')](),controller[_0x2c21('0x1d')]);router['put'](_0x2c21('0xf'),auth['isAuthenticated'](),controller[_0x2c21('0x1e')]);router[_0x2c21('0x1f')](_0x2c21('0xf'),auth['isAuthenticated'](),controller[_0x2c21('0x20')]);router[_0x2c21('0x1f')](_0x2c21('0x11'),auth[_0x2c21('0xb')](),controller['removeDispositions']);router[_0x2c21('0x1f')]('/:id/users',auth[_0x2c21('0xb')](),controller[_0x2c21('0x21')]);module[_0x2c21('0x22')]=router;
\ No newline at end of file
index 22ad65a..cb8d3a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16ce=['field','STRING','sequelize','exports','VIRTUAL','getDataValue'];(function(_0x3b76f7,_0x566c53){var _0x43984e=function(_0x164f77){while(--_0x164f77){_0x3b76f7['push'](_0x3b76f7['shift']());}};_0x43984e(++_0x566c53);}(_0x16ce,0x104));var _0xe16c=function(_0x5c88d6,_0xd1df85){_0x5c88d6=_0x5c88d6-0x0;var _0x14e77f=_0x16ce[_0x5c88d6];return _0x14e77f;};'use strict';var Sequelize=require(_0xe16c('0x0'));module[_0xe16c('0x1')]={'name':{'type':Sequelize[_0xe16c('0x2')],'get':function(_0x39df8d){return this[_0xe16c('0x3')](_0xe16c('0x4'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xe16c('0x5')],'allowNull':![]}};
\ No newline at end of file
+var _0xd356=['sequelize','exports','VIRTUAL','STRING'];(function(_0x7f8862,_0x3eb772){var _0x42f06b=function(_0x30b5e4){while(--_0x30b5e4){_0x7f8862['push'](_0x7f8862['shift']());}};_0x42f06b(++_0x3eb772);}(_0xd356,0x1e0));var _0x6d35=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd356[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6d35('0x0'));module[_0x6d35('0x1')]={'name':{'type':Sequelize[_0x6d35('0x2')],'get':function(_0x57ea43){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0x6d35('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x6d35('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x6d35('0x3')],'allowNull':![]}};
\ No newline at end of file
index eaacc24..314a02f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x5d8cbb,_0x2bf24b){var _0x57c5a2=function(_0x32d058){while(--_0x32d058){_0x5d8cbb['push'](_0x5d8cbb['shift']());}};_0x57c5a2(++_0x2bf24b);}(_0x7a54,0x106));var _0x47a5=function(_0x27d932,_0x2e68dd){_0x27d932=_0x27d932-0x0;var _0x44f46c=_0x7a54[_0x27d932];return _0x44f46c;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));};
\ No newline at end of file
+var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0xd89c66,_0x1230ce){var _0x20d7fa=function(_0x72964d){while(--_0x72964d){_0xd89c66['push'](_0xd89c66['shift']());}};_0x20d7fa(++_0x1230ce);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));};
\ No newline at end of file
index 90b19f7..fe2ff13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea3f=['bluebird','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','util','api'];(function(_0x5a6988,_0x106484){var _0x636c6c=function(_0x1651af){while(--_0x1651af){_0x5a6988['push'](_0x5a6988['shift']());}};_0x636c6c(++_0x106484);}(_0xea3f,0xe4));var _0xfea3=function(_0x549d16,_0x4d069a){_0x549d16=_0x549d16-0x0;var _0x344ccc=_0xea3f[_0x549d16];return _0x344ccc;};'use strict';var _=require('lodash');var util=require(_0xfea3('0x0'));var logger=require('../../config/logger')(_0xfea3('0x1'));var moment=require('moment');var BPromise=require(_0xfea3('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xfea3('0x3'));var config=require(_0xfea3('0x4'));var attributes=require(_0xfea3('0x5'));module[_0xfea3('0x6')]=function(_0xdd4f5d,_0x26124a){return _0xdd4f5d[_0xfea3('0x7')](_0xfea3('0x8'),attributes,{'tableName':_0xfea3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x755a=['moment','request-promise','path','rimraf','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger'];(function(_0x2b7d9b,_0xf253ad){var _0x452b6e=function(_0x2e3334){while(--_0x2e3334){_0x2b7d9b['push'](_0x2b7d9b['shift']());}};_0x452b6e(++_0xf253ad);}(_0x755a,0x159));var _0xa755=function(_0x32624e,_0x2043f9){_0x32624e=_0x32624e-0x0;var _0x313fbe=_0x755a[_0x32624e];return _0x313fbe;};'use strict';var _=require(_0xa755('0x0'));var util=require(_0xa755('0x1'));var logger=require(_0xa755('0x2'))('api');var moment=require(_0xa755('0x3'));var BPromise=require('bluebird');var rp=require(_0xa755('0x4'));var fs=require('fs');var path=require(_0xa755('0x5'));var rimraf=require(_0xa755('0x6'));var config=require('../../config/environment');var attributes=require(_0xa755('0x7'));module[_0xa755('0x8')]=function(_0x33d998,_0x4d647d){return _0x33d998[_0xa755('0x9')](_0xa755('0xa'),attributes,{'tableName':_0xa755('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dfc9b2c..5cfa605 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ede=['../../config/utils','../../config/logger','jayson/promise','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x47707a,_0x4f7d3d){var _0x28c05b=function(_0x402d9f){while(--_0x402d9f){_0x47707a['push'](_0x47707a['shift']());}};_0x28c05b(++_0x4f7d3d);}(_0x1ede,0x73));var _0xe1ed=function(_0x485bb8,_0x3757e7){_0x485bb8=_0x485bb8-0x0;var _0x5d5c74=_0x1ede[_0x485bb8];return _0x5d5c74;};'use strict';var _=require('lodash');var util=require(_0xe1ed('0x0'));var moment=require(_0xe1ed('0x1'));var BPromise=require(_0xe1ed('0x2'));var rs=require(_0xe1ed('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe1ed('0x4'))['db'];var utils=require(_0xe1ed('0x5'));var logger=require(_0xe1ed('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe1ed('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xbdc641,_0x5739fd,_0x1bbabd){return new BPromise(function(_0x338c31,_0x54c721){return client[_0xe1ed('0x8')](_0xbdc641,_0x1bbabd)[_0xe1ed('0x9')](function(_0x5b39ca){logger[_0xe1ed('0xa')](_0xe1ed('0xb'),_0x5739fd,_0xe1ed('0xc'));logger[_0xe1ed('0xd')](_0xe1ed('0xe'),_0x5739fd,_0xe1ed('0xc'),JSON[_0xe1ed('0xf')](_0x5b39ca));if(_0x5b39ca[_0xe1ed('0x10')]){if(_0x5b39ca[_0xe1ed('0x10')]['code']===0x1f4){logger['error'](_0xe1ed('0xb'),_0x5739fd,_0x5b39ca[_0xe1ed('0x10')][_0xe1ed('0x11')]);return _0x54c721(_0x5b39ca[_0xe1ed('0x10')][_0xe1ed('0x11')]);}logger['error'](_0xe1ed('0xb'),_0x5739fd,_0x5b39ca['error'][_0xe1ed('0x11')]);return _0x338c31(_0x5b39ca[_0xe1ed('0x10')][_0xe1ed('0x11')]);}else{logger[_0xe1ed('0xa')](_0xe1ed('0xb'),_0x5739fd,'request\x20sent');_0x338c31(_0x5b39ca[_0xe1ed('0x12')]['message']);}})[_0xe1ed('0x13')](function(_0x16bf5d){logger['error'](_0xe1ed('0xb'),_0x5739fd,_0x16bf5d);_0x54c721(_0x16bf5d);});});}
\ No newline at end of file
+var _0x7bcd=['request\x20sent','debug','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Condition,\x20%s,\x20%s'];(function(_0x3fe129,_0x4d9b00){var _0xc0cb87=function(_0x21a114){while(--_0x21a114){_0x3fe129['push'](_0x3fe129['shift']());}};_0xc0cb87(++_0x4d9b00);}(_0x7bcd,0x102));var _0xd7bc=function(_0x46d87a,_0x5183db){_0x46d87a=_0x46d87a-0x0;var _0x115296=_0x7bcd[_0x46d87a];return _0x115296;};'use strict';var _=require(_0xd7bc('0x0'));var util=require(_0xd7bc('0x1'));var moment=require('moment');var BPromise=require(_0xd7bc('0x2'));var rs=require(_0xd7bc('0x3'));var fs=require('fs');var Redis=require(_0xd7bc('0x4'));var db=require(_0xd7bc('0x5'))['db'];var utils=require(_0xd7bc('0x6'));var logger=require('../../config/logger')(_0xd7bc('0x7'));var config=require(_0xd7bc('0x8'));var jayson=require(_0xd7bc('0x9'));var client=jayson[_0xd7bc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b35ec,_0x21b79a,_0x5e898a){return new BPromise(function(_0x345d38,_0x1c20fd){return client[_0xd7bc('0xb')](_0x4b35ec,_0x5e898a)[_0xd7bc('0xc')](function(_0x344594){logger[_0xd7bc('0xd')](_0xd7bc('0xe'),_0x21b79a,_0xd7bc('0xf'));logger[_0xd7bc('0x10')]('Condition,\x20%s,\x20%s,\x20%s',_0x21b79a,'request\x20sent',JSON[_0xd7bc('0x11')](_0x344594));if(_0x344594['error']){if(_0x344594[_0xd7bc('0x12')]['code']===0x1f4){logger[_0xd7bc('0x12')](_0xd7bc('0xe'),_0x21b79a,_0x344594['error']['message']);return _0x1c20fd(_0x344594[_0xd7bc('0x12')][_0xd7bc('0x13')]);}logger[_0xd7bc('0x12')](_0xd7bc('0xe'),_0x21b79a,_0x344594[_0xd7bc('0x12')][_0xd7bc('0x13')]);return _0x345d38(_0x344594[_0xd7bc('0x12')]['message']);}else{logger['info'](_0xd7bc('0xe'),_0x21b79a,_0xd7bc('0xf'));_0x345d38(_0x344594[_0xd7bc('0x14')][_0xd7bc('0x13')]);}})['catch'](function(_0x289f22){logger[_0xd7bc('0x12')](_0xd7bc('0xe'),_0x21b79a,_0x289f22);_0x1c20fd(_0x289f22);});});}
\ No newline at end of file
index 72d05ed..59efffe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6ec=['express','Router','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x2d5a5e,_0x35e9ab){var _0x3b0448=function(_0x31968f){while(--_0x31968f){_0x2d5a5e['push'](_0x2d5a5e['shift']());}};_0x3b0448(++_0x35e9ab);}(_0xb6ec,0x1e7));var _0xcb6e=function(_0x39ce54,_0x4fe996){_0x39ce54=_0x39ce54-0x0;var _0x35b9a5=_0xb6ec[_0x39ce54];return _0x35b9a5;};'use strict';var multer=require(_0xcb6e('0x0'));var util=require('util');var path=require(_0xcb6e('0x1'));var timeout=require(_0xcb6e('0x2'));var express=require(_0xcb6e('0x3'));var router=express[_0xcb6e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcb6e('0x5'));var interaction=require(_0xcb6e('0x6'));var config=require('../../config/environment');var controller=require(_0xcb6e('0x7'));router[_0xcb6e('0x8')](_0xcb6e('0x9'),auth['isAuthenticated'](),controller[_0xcb6e('0xa')]);router[_0xcb6e('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xcb6e('0xc')]);module[_0xcb6e('0xd')]=router;
\ No newline at end of file
+var _0x920b=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy','exports','util'];(function(_0x3a5f1c,_0x21ab9a){var _0x1cfa01=function(_0x433c15){while(--_0x433c15){_0x3a5f1c['push'](_0x3a5f1c['shift']());}};_0x1cfa01(++_0x21ab9a);}(_0x920b,0x86));var _0xb920=function(_0x4c6dd6,_0xd2f803){_0x4c6dd6=_0x4c6dd6-0x0;var _0x2c05f0=_0x920b[_0x4c6dd6];return _0x2c05f0;};'use strict';var multer=require('multer');var util=require(_0xb920('0x0'));var path=require(_0xb920('0x1'));var timeout=require(_0xb920('0x2'));var express=require(_0xb920('0x3'));var router=express[_0xb920('0x4')]();var fs_extra=require(_0xb920('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb920('0x6'));var config=require(_0xb920('0x7'));var controller=require('./condition.controller');router[_0xb920('0x8')](_0xb920('0x9'),auth[_0xb920('0xa')](),controller[_0xb920('0xb')]);router[_0xb920('0xc')](_0xb920('0x9'),auth[_0xb920('0xa')](),controller[_0xb920('0xd')]);module[_0xb920('0xe')]=router;
\ No newline at end of file
index 0621bb8..4bc9963 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0825=['sequelize','exports','INTEGER','STRING'];(function(_0x34a14d,_0xc49d24){var _0x2015f2=function(_0x2a0b48){while(--_0x2a0b48){_0x34a14d['push'](_0x34a14d['shift']());}};_0x2015f2(++_0xc49d24);}(_0x0825,0x1e4));var _0x5082=function(_0x3ca35f,_0x2b9ce9){_0x3ca35f=_0x3ca35f-0x0;var _0x179d47=_0x0825[_0x3ca35f];return _0x179d47;};'use strict';var Sequelize=require(_0x5082('0x0'));module[_0x5082('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x5082('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x5082('0x3')],'allowNull':!![]}};
\ No newline at end of file
+var _0xdb2e=['STRING','name','INTEGER','sequelize'];(function(_0x77d61b,_0x1ee538){var _0x48c6a2=function(_0x25ce9a){while(--_0x25ce9a){_0x77d61b['push'](_0x77d61b['shift']());}};_0x48c6a2(++_0x1ee538);}(_0xdb2e,0xa3));var _0xedb2=function(_0x1a1072,_0x84a807){_0x1a1072=_0x1a1072-0x0;var _0x415142=_0xdb2e[_0x1a1072];return _0x415142;};'use strict';var Sequelize=require(_0xedb2('0x0'));module['exports']={'name':{'type':Sequelize[_0xedb2('0x1')],'allowNull':![],'unique':_0xedb2('0x2')},'OrderBy':{'type':Sequelize[_0xedb2('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xedb2('0x1')],'allowNull':!![]}};
\ No newline at end of file
index 76e3f9c..b1cd680 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4325=['path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','name','map','ContactItemType','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','VIRTUAL','options','includeAll','include','rows','catch','show','params','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ContactItemTypes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContactHasItem','eml-format','rimraf','fast-json-patch','request-promise','moment','util'];(function(_0x4b5790,_0x53b969){var _0x251ac0=function(_0x585aed){while(--_0x585aed){_0x4b5790['push'](_0x4b5790['shift']());}};_0x251ac0(++_0x53b969);}(_0x4325,0x1da));var _0x5432=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4325[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0x5432('0x0'));var rimraf=require(_0x5432('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5432('0x2'));var rp=require(_0x5432('0x3'));var moment=require(_0x5432('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5432('0x5'));var path=require(_0x5432('0x6'));var sox=require(_0x5432('0x7'));var csv=require('to-csv');var ejs=require(_0x5432('0x8'));var fs=require('fs');var fs_extra=require(_0x5432('0x9'));var _=require('lodash');var squel=require(_0x5432('0xa'));var crypto=require('crypto');var jsforce=require(_0x5432('0xb'));var deskjs=require(_0x5432('0xc'));var toCsv=require(_0x5432('0xd'));var querystring=require(_0x5432('0xe'));var Papa=require(_0x5432('0xf'));var Redis=require('ioredis');var authService=require(_0x5432('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5432('0x11'));var hardwareService=require(_0x5432('0x12'));var logger=require(_0x5432('0x13'))(_0x5432('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5432('0x15'));var db=require(_0x5432('0x16'))['db'];function respondWithStatusCode(_0x5366a0,_0x10a289){_0x10a289=_0x10a289||0xcc;return function(_0x111c54){if(_0x111c54){return _0x5366a0[_0x5432('0x17')](_0x10a289);}return _0x5366a0[_0x5432('0x18')](_0x10a289)[_0x5432('0x19')]();};}function respondWithResult(_0x1a084d,_0x54f41a){_0x54f41a=_0x54f41a||0xc8;return function(_0x5617ce){if(_0x5617ce){return _0x1a084d[_0x5432('0x18')](_0x54f41a)[_0x5432('0x1a')](_0x5617ce);}};}function respondWithFilteredResult(_0x3859d1,_0x364152){return function(_0x9d2023){if(_0x9d2023){var _0x11db3c=typeof _0x364152['offset']===_0x5432('0x1b')&&typeof _0x364152['limit']===_0x5432('0x1b');var _0x3de07a=_0x9d2023[_0x5432('0x1c')];var _0x32fe60=_0x11db3c?0x0:_0x364152[_0x5432('0x1d')];var _0x5f011f=_0x11db3c?_0x9d2023[_0x5432('0x1c')]:_0x364152[_0x5432('0x1d')]+_0x364152[_0x5432('0x1e')];var _0x2bfe04;if(_0x5f011f>=_0x3de07a){_0x5f011f=_0x3de07a;_0x2bfe04=0xc8;}else{_0x2bfe04=0xce;}_0x3859d1[_0x5432('0x18')](_0x2bfe04);return _0x3859d1[_0x5432('0x1f')](_0x5432('0x20'),_0x32fe60+'-'+_0x5f011f+'/'+_0x3de07a)['json'](_0x9d2023);}return null;};}function patchUpdates(_0x66911a){return function(_0x29cde7){try{jsonpatch[_0x5432('0x21')](_0x29cde7,_0x66911a,!![]);}catch(_0xa6c864){return BPromise[_0x5432('0x22')](_0xa6c864);}return _0x29cde7['save']();};}function saveUpdates(_0x5901e2,_0x4d09cd){return function(_0x61827e){if(_0x61827e){return _0x61827e[_0x5432('0x23')](_0x5901e2)[_0x5432('0x24')](function(_0x1f4870){return _0x1f4870;});}return null;};}function removeEntity(_0x4af9f6,_0x4af5f4){return function(_0x3e0b66){if(_0x3e0b66){return _0x3e0b66[_0x5432('0x25')]()['then'](function(){var _0x19e6b2=_0x3e0b66[_0x5432('0x26')]({'plain':!![]});var _0x637582='ContactItemTypes';return db[_0x5432('0x27')][_0x5432('0x25')]({'where':{'type':_0x637582,'resourceId':_0x19e6b2['id']}})[_0x5432('0x24')](function(){return _0x3e0b66;});})['then'](function(){_0x4af9f6['status'](0xcc)[_0x5432('0x19')]();});}};}function handleEntityNotFound(_0x2114b8,_0x589f79){return function(_0x1abe73){if(!_0x1abe73){_0x2114b8[_0x5432('0x17')](0x194);}return _0x1abe73;};}function handleError(_0x1f2e8f,_0x4add5b){_0x4add5b=_0x4add5b||0x1f4;return function(_0x29dc15){logger['error'](_0x29dc15['stack']);if(_0x29dc15[_0x5432('0x28')]){delete _0x29dc15['name'];}_0x1f2e8f[_0x5432('0x18')](_0x4add5b)['send'](_0x29dc15);};}exports['index']=function(_0x465a09,_0x21735e){var _0x345b51={},_0x4e92d5={},_0x31490c={'count':0x0,'rows':[]};var _0x1d436c=_[_0x5432('0x29')](db[_0x5432('0x2a')][_0x5432('0x2b')],function(_0x308b4c){return{'name':_0x308b4c[_0x5432('0x2c')],'type':_0x308b4c[_0x5432('0x2d')][_0x5432('0x2e')]};});_0x4e92d5['model']=_['map'](_0x1d436c,_0x5432('0x28'));_0x4e92d5[_0x5432('0x2f')]=_[_0x5432('0x30')](_0x465a09[_0x5432('0x2f')]);_0x4e92d5[_0x5432('0x31')]=_['intersection'](_0x4e92d5[_0x5432('0x32')],_0x4e92d5['query']);_0x345b51[_0x5432('0x33')]=_[_0x5432('0x34')](_0x4e92d5[_0x5432('0x32')],qs[_0x5432('0x35')](_0x465a09[_0x5432('0x2f')][_0x5432('0x35')]));_0x345b51['attributes']=_0x345b51[_0x5432('0x33')][_0x5432('0x36')]?_0x345b51[_0x5432('0x33')]:_0x4e92d5[_0x5432('0x32')];if(!_0x465a09['query'][_0x5432('0x37')](_0x5432('0x38'))){_0x345b51[_0x5432('0x1e')]=qs[_0x5432('0x1e')](_0x465a09[_0x5432('0x2f')][_0x5432('0x1e')]);_0x345b51[_0x5432('0x1d')]=qs[_0x5432('0x1d')](_0x465a09[_0x5432('0x2f')][_0x5432('0x1d')]);}_0x345b51[_0x5432('0x39')]=qs[_0x5432('0x3a')](_0x465a09[_0x5432('0x2f')][_0x5432('0x3a')]);_0x345b51['where']=qs[_0x5432('0x31')](_['pick'](_0x465a09[_0x5432('0x2f')],_0x4e92d5[_0x5432('0x31')]),_0x1d436c);if(_0x465a09[_0x5432('0x2f')][_0x5432('0x3b')]){_0x345b51['where']=_['merge'](_0x345b51['where'],{'$or':_[_0x5432('0x29')](_0x1d436c,function(_0x2053ed){if(_0x2053ed[_0x5432('0x2d')]!==_0x5432('0x3c')){var _0x52b296={};_0x52b296[_0x2053ed[_0x5432('0x28')]]={'$like':'%'+_0x465a09[_0x5432('0x2f')][_0x5432('0x3b')]+'%'};return _0x52b296;}})});}_0x345b51=_['merge']({},_0x345b51,_0x465a09[_0x5432('0x3d')]);var _0x38c951={'where':_0x345b51['where']};return db[_0x5432('0x2a')][_0x5432('0x1c')](_0x38c951)['then'](function(_0x23f8f4){_0x31490c['count']=_0x23f8f4;if(_0x465a09[_0x5432('0x2f')][_0x5432('0x3e')]){_0x345b51[_0x5432('0x3f')]=[{'all':!![]}];}return db[_0x5432('0x2a')]['findAll'](_0x345b51);})[_0x5432('0x24')](function(_0x4b93b4){_0x31490c[_0x5432('0x40')]=_0x4b93b4;return _0x31490c;})[_0x5432('0x24')](respondWithFilteredResult(_0x21735e,_0x345b51))[_0x5432('0x41')](handleError(_0x21735e,null));};exports[_0x5432('0x42')]=function(_0xc656ca,_0x23119a){var _0x2234da={'raw':!![],'where':{'id':_0xc656ca[_0x5432('0x43')]['id']}},_0x4ab024={};_0x4ab024[_0x5432('0x32')]=_[_0x5432('0x30')](db[_0x5432('0x2a')][_0x5432('0x2b')]);_0x4ab024[_0x5432('0x2f')]=_[_0x5432('0x30')](_0xc656ca['query']);_0x4ab024[_0x5432('0x31')]=_[_0x5432('0x34')](_0x4ab024[_0x5432('0x32')],_0x4ab024[_0x5432('0x2f')]);_0x2234da[_0x5432('0x33')]=_['intersection'](_0x4ab024[_0x5432('0x32')],qs['fields'](_0xc656ca[_0x5432('0x2f')][_0x5432('0x35')]));_0x2234da['attributes']=_0x2234da[_0x5432('0x33')]['length']?_0x2234da[_0x5432('0x33')]:_0x4ab024[_0x5432('0x32')];if(_0xc656ca['query']['includeAll']){_0x2234da[_0x5432('0x3f')]=[{'all':!![]}];}_0x2234da=_[_0x5432('0x44')]({},_0x2234da,_0xc656ca[_0x5432('0x3d')]);return db[_0x5432('0x2a')][_0x5432('0x45')](_0x2234da)[_0x5432('0x24')](handleEntityNotFound(_0x23119a,null))[_0x5432('0x24')](respondWithResult(_0x23119a,null))['catch'](handleError(_0x23119a,null));};exports[_0x5432('0x46')]=function(_0x14763c,_0x429da8){return db['ContactItemType']['create'](_0x14763c['body'],{})['then'](function(_0x26d6ae){var _0x42212f=_0x14763c[_0x5432('0x47')][_0x5432('0x26')]({'plain':!![]});if(!_0x42212f)throw new Error(_0x5432('0x48'));if(_0x42212f['role']===_0x5432('0x47')){var _0xce691b=_0x26d6ae[_0x5432('0x26')]({'plain':!![]});var _0x536229=_0x5432('0x49');return db[_0x5432('0x4a')][_0x5432('0x45')]({'where':{'name':_0x536229,'userProfileId':_0x42212f[_0x5432('0x4b')]},'raw':!![]})[_0x5432('0x24')](function(_0x50cd7c){if(_0x50cd7c&&_0x50cd7c[_0x5432('0x4c')]===0x0){return db['UserProfileResource'][_0x5432('0x46')]({'name':_0xce691b['name'],'resourceId':_0xce691b['id'],'type':_0x50cd7c[_0x5432('0x28')],'sectionId':_0x50cd7c['id']},{})[_0x5432('0x24')](function(){return _0x26d6ae;});}else{return _0x26d6ae;}})['catch'](function(_0x7129e2){logger['error'](_0x5432('0x4d'),_0x7129e2);throw _0x7129e2;});}return _0x26d6ae;})[_0x5432('0x24')](respondWithResult(_0x429da8,0xc9))[_0x5432('0x41')](handleError(_0x429da8,null));};exports[_0x5432('0x23')]=function(_0x5f08eb,_0x3757b1){if(_0x5f08eb['body']['id']){delete _0x5f08eb[_0x5432('0x4e')]['id'];}return db['ContactItemType'][_0x5432('0x45')]({'where':{'id':_0x5f08eb[_0x5432('0x43')]['id']}})[_0x5432('0x24')](handleEntityNotFound(_0x3757b1,null))[_0x5432('0x24')](saveUpdates(_0x5f08eb[_0x5432('0x4e')],null))[_0x5432('0x24')](respondWithResult(_0x3757b1,null))[_0x5432('0x41')](handleError(_0x3757b1,null));};exports[_0x5432('0x25')]=function(_0x3e0259,_0x20d9f5){return db['ContactItemType'][_0x5432('0x45')]({'where':{'id':_0x3e0259[_0x5432('0x43')]['id']}})['then'](handleEntityNotFound(_0x20d9f5,null))[_0x5432('0x24')](db[_0x5432('0x4f')][_0x5432('0x23')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x3e0259[_0x5432('0x43')]['id']}}))[_0x5432('0x24')](removeEntity(_0x20d9f5,null))['catch'](handleError(_0x20d9f5,null));};
\ No newline at end of file
+var _0x5eb8=['role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','ContactItemTypes','UserProfileResource','sendStatus','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','includeAll','include','ContactItemType','findAll','rows','catch','show','params','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x37193b,_0x5d4653){var _0x1969c9=function(_0x58b008){while(--_0x58b008){_0x37193b['push'](_0x37193b['shift']());}};_0x1969c9(++_0x5d4653);}(_0x5eb8,0xb0));var _0x85eb=function(_0x1e53ca,_0x2692ed){_0x1e53ca=_0x1e53ca-0x0;var _0x55e658=_0x5eb8[_0x1e53ca];return _0x55e658;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x85eb('0x0'));var jsonpatch=require(_0x85eb('0x1'));var rp=require(_0x85eb('0x2'));var moment=require(_0x85eb('0x3'));var BPromise=require(_0x85eb('0x4'));var Mustache=require(_0x85eb('0x5'));var util=require(_0x85eb('0x6'));var path=require(_0x85eb('0x7'));var sox=require(_0x85eb('0x8'));var csv=require(_0x85eb('0x9'));var ejs=require(_0x85eb('0xa'));var fs=require('fs');var fs_extra=require(_0x85eb('0xb'));var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0x9'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var as=require(_0x85eb('0x13'));var hardwareService=require(_0x85eb('0x14'));var logger=require(_0x85eb('0x15'))('api');var utils=require(_0x85eb('0x16'));var config=require(_0x85eb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x85eb('0x18'))['db'];function respondWithStatusCode(_0x784583,_0x2f42ba){_0x2f42ba=_0x2f42ba||0xcc;return function(_0x259f72){if(_0x259f72){return _0x784583['sendStatus'](_0x2f42ba);}return _0x784583['status'](_0x2f42ba)[_0x85eb('0x19')]();};}function respondWithResult(_0x5c760a,_0x18ca53){_0x18ca53=_0x18ca53||0xc8;return function(_0x23a82a){if(_0x23a82a){return _0x5c760a[_0x85eb('0x1a')](_0x18ca53)[_0x85eb('0x1b')](_0x23a82a);}};}function respondWithFilteredResult(_0x183b0c,_0x49efdf){return function(_0x2e5c0a){if(_0x2e5c0a){var _0x59237b=typeof _0x49efdf[_0x85eb('0x1c')]===_0x85eb('0x1d')&&typeof _0x49efdf[_0x85eb('0x1e')]===_0x85eb('0x1d');var _0x5dbeda=_0x2e5c0a['count'];var _0x50d2a8=_0x59237b?0x0:_0x49efdf[_0x85eb('0x1c')];var _0x39ca96=_0x59237b?_0x2e5c0a[_0x85eb('0x1f')]:_0x49efdf[_0x85eb('0x1c')]+_0x49efdf[_0x85eb('0x1e')];var _0x34f875;if(_0x39ca96>=_0x5dbeda){_0x39ca96=_0x5dbeda;_0x34f875=0xc8;}else{_0x34f875=0xce;}_0x183b0c['status'](_0x34f875);return _0x183b0c[_0x85eb('0x20')](_0x85eb('0x21'),_0x50d2a8+'-'+_0x39ca96+'/'+_0x5dbeda)[_0x85eb('0x1b')](_0x2e5c0a);}return null;};}function patchUpdates(_0x4e8041){return function(_0x4b4b38){try{jsonpatch['apply'](_0x4b4b38,_0x4e8041,!![]);}catch(_0x55b9e4){return BPromise[_0x85eb('0x22')](_0x55b9e4);}return _0x4b4b38[_0x85eb('0x23')]();};}function saveUpdates(_0x329fc5,_0x255ca7){return function(_0x465c74){if(_0x465c74){return _0x465c74[_0x85eb('0x24')](_0x329fc5)['then'](function(_0x5491d5){return _0x5491d5;});}return null;};}function removeEntity(_0x5b48d9,_0x298e84){return function(_0x1426c8){if(_0x1426c8){return _0x1426c8[_0x85eb('0x25')]()[_0x85eb('0x26')](function(){var _0x312b3e=_0x1426c8[_0x85eb('0x27')]({'plain':!![]});var _0x5dfc96=_0x85eb('0x28');return db[_0x85eb('0x29')][_0x85eb('0x25')]({'where':{'type':_0x5dfc96,'resourceId':_0x312b3e['id']}})[_0x85eb('0x26')](function(){return _0x1426c8;});})[_0x85eb('0x26')](function(){_0x5b48d9['status'](0xcc)[_0x85eb('0x19')]();});}};}function handleEntityNotFound(_0x792d3a,_0x291557){return function(_0x3e7eb9){if(!_0x3e7eb9){_0x792d3a[_0x85eb('0x2a')](0x194);}return _0x3e7eb9;};}function handleError(_0x29d262,_0x50541a){_0x50541a=_0x50541a||0x1f4;return function(_0x562792){logger[_0x85eb('0x2b')](_0x562792['stack']);if(_0x562792[_0x85eb('0x2c')]){delete _0x562792['name'];}_0x29d262[_0x85eb('0x1a')](_0x50541a)[_0x85eb('0x2d')](_0x562792);};}exports[_0x85eb('0x2e')]=function(_0x1d9278,_0xa67e1c){var _0xf4ac13={},_0x41ed76={},_0x5decd5={'count':0x0,'rows':[]};var _0x237f19=_[_0x85eb('0x2f')](db['ContactItemType'][_0x85eb('0x30')],function(_0x5af2de){return{'name':_0x5af2de['fieldName'],'type':_0x5af2de[_0x85eb('0x31')][_0x85eb('0x32')]};});_0x41ed76[_0x85eb('0x33')]=_[_0x85eb('0x2f')](_0x237f19,_0x85eb('0x2c'));_0x41ed76[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x1d9278[_0x85eb('0x34')]);_0x41ed76[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x41ed76['model'],_0x41ed76[_0x85eb('0x34')]);_0xf4ac13[_0x85eb('0x38')]=_['intersection'](_0x41ed76['model'],qs[_0x85eb('0x39')](_0x1d9278[_0x85eb('0x34')][_0x85eb('0x39')]));_0xf4ac13[_0x85eb('0x38')]=_0xf4ac13[_0x85eb('0x38')][_0x85eb('0x3a')]?_0xf4ac13[_0x85eb('0x38')]:_0x41ed76[_0x85eb('0x33')];if(!_0x1d9278[_0x85eb('0x34')][_0x85eb('0x3b')](_0x85eb('0x3c'))){_0xf4ac13[_0x85eb('0x1e')]=qs[_0x85eb('0x1e')](_0x1d9278[_0x85eb('0x34')]['limit']);_0xf4ac13[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x1d9278['query']['offset']);}_0xf4ac13[_0x85eb('0x3d')]=qs[_0x85eb('0x3e')](_0x1d9278['query'][_0x85eb('0x3e')]);_0xf4ac13['where']=qs[_0x85eb('0x36')](_['pick'](_0x1d9278[_0x85eb('0x34')],_0x41ed76['filters']),_0x237f19);if(_0x1d9278[_0x85eb('0x34')]['filter']){_0xf4ac13[_0x85eb('0x3f')]=_[_0x85eb('0x40')](_0xf4ac13['where'],{'$or':_[_0x85eb('0x2f')](_0x237f19,function(_0x5a1c15){if(_0x5a1c15[_0x85eb('0x31')]!==_0x85eb('0x41')){var _0x5c0156={};_0x5c0156[_0x5a1c15[_0x85eb('0x2c')]]={'$like':'%'+_0x1d9278['query']['filter']+'%'};return _0x5c0156;}})});}_0xf4ac13=_[_0x85eb('0x40')]({},_0xf4ac13,_0x1d9278['options']);var _0x17cc20={'where':_0xf4ac13[_0x85eb('0x3f')]};return db['ContactItemType']['count'](_0x17cc20)[_0x85eb('0x26')](function(_0x422ec3){_0x5decd5['count']=_0x422ec3;if(_0x1d9278['query'][_0x85eb('0x42')]){_0xf4ac13[_0x85eb('0x43')]=[{'all':!![]}];}return db[_0x85eb('0x44')][_0x85eb('0x45')](_0xf4ac13);})[_0x85eb('0x26')](function(_0x5b7411){_0x5decd5[_0x85eb('0x46')]=_0x5b7411;return _0x5decd5;})[_0x85eb('0x26')](respondWithFilteredResult(_0xa67e1c,_0xf4ac13))[_0x85eb('0x47')](handleError(_0xa67e1c,null));};exports[_0x85eb('0x48')]=function(_0x2ed39d,_0xbc43a7){var _0x40e2a2={'raw':!![],'where':{'id':_0x2ed39d[_0x85eb('0x49')]['id']}},_0x3e11a8={};_0x3e11a8['model']=_[_0x85eb('0x35')](db[_0x85eb('0x44')]['rawAttributes']);_0x3e11a8[_0x85eb('0x34')]=_[_0x85eb('0x35')](_0x2ed39d[_0x85eb('0x34')]);_0x3e11a8[_0x85eb('0x36')]=_[_0x85eb('0x37')](_0x3e11a8[_0x85eb('0x33')],_0x3e11a8['query']);_0x40e2a2[_0x85eb('0x38')]=_[_0x85eb('0x37')](_0x3e11a8[_0x85eb('0x33')],qs[_0x85eb('0x39')](_0x2ed39d[_0x85eb('0x34')][_0x85eb('0x39')]));_0x40e2a2[_0x85eb('0x38')]=_0x40e2a2[_0x85eb('0x38')]['length']?_0x40e2a2[_0x85eb('0x38')]:_0x3e11a8[_0x85eb('0x33')];if(_0x2ed39d[_0x85eb('0x34')][_0x85eb('0x42')]){_0x40e2a2[_0x85eb('0x43')]=[{'all':!![]}];}_0x40e2a2=_[_0x85eb('0x40')]({},_0x40e2a2,_0x2ed39d[_0x85eb('0x4a')]);return db[_0x85eb('0x44')][_0x85eb('0x4b')](_0x40e2a2)[_0x85eb('0x26')](handleEntityNotFound(_0xbc43a7,null))[_0x85eb('0x26')](respondWithResult(_0xbc43a7,null))[_0x85eb('0x47')](handleError(_0xbc43a7,null));};exports['create']=function(_0x11da79,_0x2c951b){return db[_0x85eb('0x44')]['create'](_0x11da79[_0x85eb('0x4c')],{})[_0x85eb('0x26')](function(_0x2cf928){var _0xd2f302=_0x11da79[_0x85eb('0x4d')]['get']({'plain':!![]});if(!_0xd2f302)throw new Error(_0x85eb('0x4e'));if(_0xd2f302[_0x85eb('0x4f')]===_0x85eb('0x4d')){var _0x50e264=_0x2cf928[_0x85eb('0x27')]({'plain':!![]});var _0x4550fd=_0x85eb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x4550fd,'userProfileId':_0xd2f302[_0x85eb('0x50')]},'raw':!![]})['then'](function(_0x5ed98a){if(_0x5ed98a&&_0x5ed98a[_0x85eb('0x51')]===0x0){return db['UserProfileResource'][_0x85eb('0x52')]({'name':_0x50e264[_0x85eb('0x2c')],'resourceId':_0x50e264['id'],'type':_0x5ed98a['name'],'sectionId':_0x5ed98a['id']},{})['then'](function(){return _0x2cf928;});}else{return _0x2cf928;}})[_0x85eb('0x47')](function(_0x249511){logger[_0x85eb('0x2b')](_0x85eb('0x53'),_0x249511);throw _0x249511;});}return _0x2cf928;})[_0x85eb('0x26')](respondWithResult(_0x2c951b,0xc9))['catch'](handleError(_0x2c951b,null));};exports[_0x85eb('0x24')]=function(_0x30062e,_0x270bb2){if(_0x30062e[_0x85eb('0x4c')]['id']){delete _0x30062e[_0x85eb('0x4c')]['id'];}return db['ContactItemType'][_0x85eb('0x4b')]({'where':{'id':_0x30062e['params']['id']}})[_0x85eb('0x26')](handleEntityNotFound(_0x270bb2,null))[_0x85eb('0x26')](saveUpdates(_0x30062e['body'],null))[_0x85eb('0x26')](respondWithResult(_0x270bb2,null))[_0x85eb('0x47')](handleError(_0x270bb2,null));};exports[_0x85eb('0x25')]=function(_0x26e04a,_0x214ef7){return db[_0x85eb('0x44')]['find']({'where':{'id':_0x26e04a[_0x85eb('0x49')]['id']}})['then'](handleEntityNotFound(_0x214ef7,null))[_0x85eb('0x26')](db[_0x85eb('0x54')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x26e04a[_0x85eb('0x49')]['id']}}))[_0x85eb('0x26')](removeEntity(_0x214ef7,null))['catch'](handleError(_0x214ef7,null));};
\ No newline at end of file
index 52bfb90..1d52fae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3165=['util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./contactItemType.attributes','exports','ContactItemType','tools_contact_item_types','lodash'];(function(_0x20fd49,_0x245bfa){var _0x307f96=function(_0x4d2dc4){while(--_0x4d2dc4){_0x20fd49['push'](_0x20fd49['shift']());}};_0x307f96(++_0x245bfa);}(_0x3165,0x149));var _0x5316=function(_0x494002,_0x1df724){_0x494002=_0x494002-0x0;var _0x3cf358=_0x3165[_0x494002];return _0x3cf358;};'use strict';var _=require(_0x5316('0x0'));var util=require(_0x5316('0x1'));var logger=require(_0x5316('0x2'))('api');var moment=require(_0x5316('0x3'));var BPromise=require('bluebird');var rp=require(_0x5316('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5316('0x5'));var config=require(_0x5316('0x6'));var attributes=require(_0x5316('0x7'));module[_0x5316('0x8')]=function(_0x3d0f70,_0x5a6d26){return _0x3d0f70['define'](_0x5316('0x9'),attributes,{'tableName':_0x5316('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xec1f=['path','rimraf','tools_contact_item_types','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1bfdae,_0x251340){var _0x1f75b6=function(_0xc4404b){while(--_0xc4404b){_0x1bfdae['push'](_0x1bfdae['shift']());}};_0x1f75b6(++_0x251340);}(_0xec1f,0x78));var _0xfec1=function(_0x27b18b,_0x46957d){_0x27b18b=_0x27b18b-0x0;var _0x5da677=_0xec1f[_0x27b18b];return _0x5da677;};'use strict';var _=require(_0xfec1('0x0'));var util=require(_0xfec1('0x1'));var logger=require(_0xfec1('0x2'))(_0xfec1('0x3'));var moment=require('moment');var BPromise=require(_0xfec1('0x4'));var rp=require(_0xfec1('0x5'));var fs=require('fs');var path=require(_0xfec1('0x6'));var rimraf=require(_0xfec1('0x7'));var config=require('../../config/environment');var attributes=require('./contactItemType.attributes');module['exports']=function(_0x2224ae,_0x189262){return _0x2224ae['define']('ContactItemType',attributes,{'tableName':_0xfec1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 897255b..8dc31bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b65=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','error','code','ContactItemType,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x57ec62,_0x477fec){var _0x2bd069=function(_0x209f70){while(--_0x209f70){_0x57ec62['push'](_0x57ec62['shift']());}};_0x2bd069(++_0x477fec);}(_0x2b65,0x131));var _0x52b6=function(_0x5ca0b3,_0x33f5ef){_0x5ca0b3=_0x5ca0b3-0x0;var _0x6ba806=_0x2b65[_0x5ca0b3];return _0x6ba806;};'use strict';var _=require(_0x52b6('0x0'));var util=require(_0x52b6('0x1'));var moment=require(_0x52b6('0x2'));var BPromise=require(_0x52b6('0x3'));var rs=require(_0x52b6('0x4'));var fs=require('fs');var Redis=require(_0x52b6('0x5'));var db=require(_0x52b6('0x6'))['db'];var utils=require(_0x52b6('0x7'));var logger=require('../../config/logger')(_0x52b6('0x8'));var config=require(_0x52b6('0x9'));var jayson=require(_0x52b6('0xa'));var client=jayson[_0x52b6('0xb')][_0x52b6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d451f,_0x70579,_0x1af78f){return new BPromise(function(_0x432726,_0x27c5b9){return client['request'](_0x2d451f,_0x1af78f)[_0x52b6('0xd')](function(_0x1c2cb5){logger[_0x52b6('0xe')]('ContactItemType,\x20%s,\x20%s',_0x70579,_0x52b6('0xf'));logger[_0x52b6('0x10')](_0x52b6('0x11'),_0x70579,_0x52b6('0xf'),JSON['stringify'](_0x1c2cb5));if(_0x1c2cb5[_0x52b6('0x12')]){if(_0x1c2cb5[_0x52b6('0x12')][_0x52b6('0x13')]===0x1f4){logger['error'](_0x52b6('0x14'),_0x70579,_0x1c2cb5[_0x52b6('0x12')]['message']);return _0x27c5b9(_0x1c2cb5[_0x52b6('0x12')]['message']);}logger['error'](_0x52b6('0x14'),_0x70579,_0x1c2cb5[_0x52b6('0x12')][_0x52b6('0x15')]);return _0x432726(_0x1c2cb5[_0x52b6('0x12')][_0x52b6('0x15')]);}else{logger[_0x52b6('0xe')](_0x52b6('0x14'),_0x70579,_0x52b6('0xf'));_0x432726(_0x1c2cb5[_0x52b6('0x16')][_0x52b6('0x15')]);}})[_0x52b6('0x17')](function(_0x307594){logger[_0x52b6('0x12')]('ContactItemType,\x20%s,\x20%s',_0x70579,_0x307594);_0x27c5b9(_0x307594);});});}
\ No newline at end of file
+var _0xb025=['ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ContactItemType,\x20%s,\x20%s'];(function(_0x27ddf5,_0x5a3e18){var _0x26e74a=function(_0x5f24ac){while(--_0x5f24ac){_0x27ddf5['push'](_0x27ddf5['shift']());}};_0x26e74a(++_0x5a3e18);}(_0xb025,0x168));var _0x5b02=function(_0xca5a2,_0x5b4936){_0xca5a2=_0xca5a2-0x0;var _0x43f512=_0xb025[_0xca5a2];return _0x43f512;};'use strict';var _=require('lodash');var util=require(_0x5b02('0x0'));var moment=require(_0x5b02('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5b02('0x2'));var db=require(_0x5b02('0x3'))['db'];var utils=require(_0x5b02('0x4'));var logger=require(_0x5b02('0x5'))(_0x5b02('0x6'));var config=require(_0x5b02('0x7'));var jayson=require(_0x5b02('0x8'));var client=jayson[_0x5b02('0x9')][_0x5b02('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f6b06,_0x543f1e,_0x5842ff){return new BPromise(function(_0x365544,_0x52b406){return client[_0x5b02('0xb')](_0x3f6b06,_0x5842ff)['then'](function(_0x3c435c){logger[_0x5b02('0xc')](_0x5b02('0xd'),_0x543f1e,'request\x20sent');logger['debug'](_0x5b02('0xe'),_0x543f1e,_0x5b02('0xf'),JSON[_0x5b02('0x10')](_0x3c435c));if(_0x3c435c[_0x5b02('0x11')]){if(_0x3c435c[_0x5b02('0x11')][_0x5b02('0x12')]===0x1f4){logger[_0x5b02('0x11')](_0x5b02('0xd'),_0x543f1e,_0x3c435c[_0x5b02('0x11')][_0x5b02('0x13')]);return _0x52b406(_0x3c435c['error'][_0x5b02('0x13')]);}logger['error'](_0x5b02('0xd'),_0x543f1e,_0x3c435c[_0x5b02('0x11')][_0x5b02('0x13')]);return _0x365544(_0x3c435c[_0x5b02('0x11')]['message']);}else{logger[_0x5b02('0xc')](_0x5b02('0xd'),_0x543f1e,_0x5b02('0xf'));_0x365544(_0x3c435c[_0x5b02('0x14')][_0x5b02('0x13')]);}})[_0x5b02('0x15')](function(_0x297769){logger['error'](_0x5b02('0xd'),_0x543f1e,_0x297769);_0x52b406(_0x297769);});});}
\ No newline at end of file
index 20d696e..6061544 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x807e=['/:id','isAuthenticated','post','create','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get'];(function(_0x140892,_0x8632f1){var _0x3bd331=function(_0x257fb9){while(--_0x257fb9){_0x140892['push'](_0x140892['shift']());}};_0x3bd331(++_0x8632f1);}(_0x807e,0x157));var _0xe807=function(_0x27d1ab,_0x1b1d42){_0x27d1ab=_0x27d1ab-0x0;var _0x51fbb8=_0x807e[_0x27d1ab];return _0x51fbb8;};'use strict';var multer=require('multer');var util=require(_0xe807('0x0'));var path=require('path');var timeout=require(_0xe807('0x1'));var express=require(_0xe807('0x2'));var router=express[_0xe807('0x3')]();var fs_extra=require(_0xe807('0x4'));var auth=require(_0xe807('0x5'));var interaction=require(_0xe807('0x6'));var config=require('../../config/environment');var controller=require('./contactItemType.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe807('0x7')]);router[_0xe807('0x8')](_0xe807('0x9'),auth[_0xe807('0xa')](),controller['show']);router[_0xe807('0xb')]('/',auth[_0xe807('0xa')](),controller[_0xe807('0xc')]);router['put'](_0xe807('0x9'),auth[_0xe807('0xa')](),controller['update']);router[_0xe807('0xd')]('/:id',auth[_0xe807('0xa')](),controller[_0xe807('0xe')]);module[_0xe807('0xf')]=router;
\ No newline at end of file
+var _0xabeb=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','path','express'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xabeb,0x1eb));var _0xbabe=function(_0x56f3d4,_0xfc65dd){_0x56f3d4=_0x56f3d4-0x0;var _0x2c7ef0=_0xabeb[_0x56f3d4];return _0x2c7ef0;};'use strict';var multer=require(_0xbabe('0x0'));var util=require('util');var path=require(_0xbabe('0x1'));var timeout=require('connect-timeout');var express=require(_0xbabe('0x2'));var router=express[_0xbabe('0x3')]();var fs_extra=require(_0xbabe('0x4'));var auth=require(_0xbabe('0x5'));var interaction=require(_0xbabe('0x6'));var config=require(_0xbabe('0x7'));var controller=require(_0xbabe('0x8'));router[_0xbabe('0x9')]('/',auth[_0xbabe('0xa')](),controller[_0xbabe('0xb')]);router[_0xbabe('0x9')](_0xbabe('0xc'),auth[_0xbabe('0xa')](),controller[_0xbabe('0xd')]);router[_0xbabe('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbabe('0xf')](_0xbabe('0xc'),auth[_0xbabe('0xa')](),controller[_0xbabe('0x10')]);router[_0xbabe('0x11')](_0xbabe('0xc'),auth['isAuthenticated'](),controller[_0xbabe('0x12')]);module['exports']=router;
\ No newline at end of file
index 340c0e4..fcb9c98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['name','exports','STRING'];(function(_0x2aefd3,_0x13f33a){var _0x5f41c3=function(_0x47a865){while(--_0x47a865){_0x2aefd3['push'](_0x2aefd3['shift']());}};_0x5f41c3(++_0x13f33a);}(_0x2032,0xd9));var _0x2203=function(_0x51f3c6,_0x173b7a){_0x51f3c6=_0x51f3c6-0x0;var _0x499cc6=_0x2032[_0x51f3c6];return _0x499cc6;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2032=['name','exports','STRING'];(function(_0x3838a5,_0x1ca46e){var _0x2d5f75=function(_0x3a5556){while(--_0x3a5556){_0x3838a5['push'](_0x3838a5['shift']());}};_0x2d5f75(++_0x1ca46e);}(_0x2032,0xd9));var _0x2203=function(_0x2afb5a,_0x1b6d7b){_0x2afb5a=_0x2afb5a-0x0;var _0xf89d57=_0x2032[_0x2afb5a];return _0xf89d57;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 7bcb3e7..b7c2da6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1c4=['user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','role','attrUrl','attrs','value','https://','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','order','nolimit','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboard.socket','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','CustomDashboards','UserProfileResource','error','stack','name','send','map','Dashboard','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','pick','type','filter','merge','options','where','includeAll','include','rows','catch','show','params','keys','find','create','body'];(function(_0x4ca796,_0x10dc47){var _0x171f87=function(_0x198d29){while(--_0x198d29){_0x4ca796['push'](_0x4ca796['shift']());}};_0x171f87(++_0x10dc47);}(_0xb1c4,0x129));var _0x4b1c=function(_0x1e7431,_0x664994){_0x1e7431=_0x1e7431-0x0;var _0x1d4f15=_0xb1c4[_0x1e7431];return _0x1d4f15;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4b1c('0x0'));var zipdir=require(_0x4b1c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b1c('0x2'));var moment=require(_0x4b1c('0x3'));var BPromise=require(_0x4b1c('0x4'));var Mustache=require(_0x4b1c('0x5'));var util=require('util');var path=require(_0x4b1c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4b1c('0x7'));var fs=require('fs');var fs_extra=require(_0x4b1c('0x8'));var _=require(_0x4b1c('0x9'));var squel=require(_0x4b1c('0xa'));var crypto=require(_0x4b1c('0xb'));var jsforce=require(_0x4b1c('0xc'));var deskjs=require(_0x4b1c('0xd'));var toCsv=require(_0x4b1c('0xe'));var querystring=require('querystring');var Papa=require(_0x4b1c('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4b1c('0x10'));var hardwareService=require(_0x4b1c('0x11'));var logger=require(_0x4b1c('0x12'))(_0x4b1c('0x13'));var utils=require(_0x4b1c('0x14'));var config=require(_0x4b1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4b1c('0x16'))['db'];config[_0x4b1c('0x17')]=_[_0x4b1c('0x18')](config[_0x4b1c('0x17')],{'host':_0x4b1c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4b1c('0x17')]));require(_0x4b1c('0x1a'))['register'](socket);function respondWithStatusCode(_0x17bcf3,_0x5561f8){_0x5561f8=_0x5561f8||0xcc;return function(_0x597f1e){if(_0x597f1e){return _0x17bcf3[_0x4b1c('0x1b')](_0x5561f8);}return _0x17bcf3['status'](_0x5561f8)[_0x4b1c('0x1c')]();};}function respondWithResult(_0x3b04c1,_0xb284fc){_0xb284fc=_0xb284fc||0xc8;return function(_0x4da699){if(_0x4da699){return _0x3b04c1[_0x4b1c('0x1d')](_0xb284fc)['json'](_0x4da699);}};}function respondWithFilteredResult(_0xebe3ae,_0x241b37){return function(_0x503a66){if(_0x503a66){var _0x50a043=typeof _0x241b37[_0x4b1c('0x1e')]===_0x4b1c('0x1f')&&typeof _0x241b37[_0x4b1c('0x20')]===_0x4b1c('0x1f');var _0x394e91=_0x503a66[_0x4b1c('0x21')];var _0x30cc5f=_0x50a043?0x0:_0x241b37[_0x4b1c('0x1e')];var _0x463167=_0x50a043?_0x503a66[_0x4b1c('0x21')]:_0x241b37['offset']+_0x241b37['limit'];var _0x158f6a;if(_0x463167>=_0x394e91){_0x463167=_0x394e91;_0x158f6a=0xc8;}else{_0x158f6a=0xce;}_0xebe3ae[_0x4b1c('0x1d')](_0x158f6a);return _0xebe3ae[_0x4b1c('0x22')](_0x4b1c('0x23'),_0x30cc5f+'-'+_0x463167+'/'+_0x394e91)[_0x4b1c('0x24')](_0x503a66);}return null;};}function patchUpdates(_0x35cf41){return function(_0x585f4d){try{jsonpatch[_0x4b1c('0x25')](_0x585f4d,_0x35cf41,!![]);}catch(_0x393d18){return BPromise['reject'](_0x393d18);}return _0x585f4d[_0x4b1c('0x26')]();};}function saveUpdates(_0x3948fa,_0x2ff9b8){return function(_0x41d027){if(_0x41d027){return _0x41d027[_0x4b1c('0x27')](_0x3948fa)[_0x4b1c('0x28')](function(_0x4a80e4){return _0x4a80e4;});}return null;};}function removeEntity(_0x2ede04,_0x488dbf){return function(_0x3f5fd4){if(_0x3f5fd4){return _0x3f5fd4[_0x4b1c('0x29')]()[_0x4b1c('0x28')](function(){var _0x5e47fe=_0x3f5fd4['get']({'plain':!![]});var _0x16a305=_0x4b1c('0x2a');return db[_0x4b1c('0x2b')][_0x4b1c('0x29')]({'where':{'type':_0x16a305,'resourceId':_0x5e47fe['id']}})[_0x4b1c('0x28')](function(){return _0x3f5fd4;});})[_0x4b1c('0x28')](function(){_0x2ede04['status'](0xcc)[_0x4b1c('0x1c')]();});}};}function handleEntityNotFound(_0x1518c3,_0x5c29a7){return function(_0x4e63fd){if(!_0x4e63fd){_0x1518c3[_0x4b1c('0x1b')](0x194);}return _0x4e63fd;};}function handleError(_0x5b3a8b,_0x23094d){_0x23094d=_0x23094d||0x1f4;return function(_0x1aee58){logger[_0x4b1c('0x2c')](_0x1aee58[_0x4b1c('0x2d')]);if(_0x1aee58[_0x4b1c('0x2e')]){delete _0x1aee58[_0x4b1c('0x2e')];}_0x5b3a8b[_0x4b1c('0x1d')](_0x23094d)[_0x4b1c('0x2f')](_0x1aee58);};}exports['index']=function(_0x473f75,_0x2a71cf){var _0x3bc223={},_0x54f397={},_0x3be795={'count':0x0,'rows':[]};var _0x13cd4f=_[_0x4b1c('0x30')](db[_0x4b1c('0x31')][_0x4b1c('0x32')],function(_0x282dde){return{'name':_0x282dde[_0x4b1c('0x33')],'type':_0x282dde['type'][_0x4b1c('0x34')]};});_0x54f397[_0x4b1c('0x35')]=_[_0x4b1c('0x30')](_0x13cd4f,_0x4b1c('0x2e'));_0x54f397['query']=_['keys'](_0x473f75[_0x4b1c('0x36')]);_0x54f397[_0x4b1c('0x37')]=_[_0x4b1c('0x38')](_0x54f397[_0x4b1c('0x35')],_0x54f397['query']);_0x3bc223[_0x4b1c('0x39')]=_[_0x4b1c('0x38')](_0x54f397[_0x4b1c('0x35')],qs[_0x4b1c('0x3a')](_0x473f75[_0x4b1c('0x36')]['fields']));_0x3bc223[_0x4b1c('0x39')]=_0x3bc223[_0x4b1c('0x39')][_0x4b1c('0x3b')]?_0x3bc223['attributes']:_0x54f397[_0x4b1c('0x35')];if(!_0x473f75['query'][_0x4b1c('0x3c')]('nolimit')){_0x3bc223[_0x4b1c('0x20')]=qs[_0x4b1c('0x20')](_0x473f75[_0x4b1c('0x36')][_0x4b1c('0x20')]);_0x3bc223[_0x4b1c('0x1e')]=qs[_0x4b1c('0x1e')](_0x473f75[_0x4b1c('0x36')]['offset']);}_0x3bc223['order']=qs[_0x4b1c('0x3d')](_0x473f75[_0x4b1c('0x36')][_0x4b1c('0x3d')]);_0x3bc223['where']=qs[_0x4b1c('0x37')](_[_0x4b1c('0x3e')](_0x473f75[_0x4b1c('0x36')],_0x54f397[_0x4b1c('0x37')]),_0x13cd4f);if(_0x473f75[_0x4b1c('0x36')]['filter']){_0x3bc223['where']=_['merge'](_0x3bc223['where'],{'$or':_['map'](_0x13cd4f,function(_0x2a4f8e){if(_0x2a4f8e[_0x4b1c('0x3f')]!=='VIRTUAL'){var _0x39da6b={};_0x39da6b[_0x2a4f8e[_0x4b1c('0x2e')]]={'$like':'%'+_0x473f75[_0x4b1c('0x36')][_0x4b1c('0x40')]+'%'};return _0x39da6b;}})});}_0x3bc223=_[_0x4b1c('0x41')]({},_0x3bc223,_0x473f75[_0x4b1c('0x42')]);var _0xa925eb={'where':_0x3bc223[_0x4b1c('0x43')]};return db[_0x4b1c('0x31')][_0x4b1c('0x21')](_0xa925eb)[_0x4b1c('0x28')](function(_0x2215f7){_0x3be795['count']=_0x2215f7;if(_0x473f75[_0x4b1c('0x36')][_0x4b1c('0x44')]){_0x3bc223[_0x4b1c('0x45')]=[{'all':!![]}];}return db[_0x4b1c('0x31')]['findAll'](_0x3bc223);})[_0x4b1c('0x28')](function(_0x514798){_0x3be795[_0x4b1c('0x46')]=_0x514798;return _0x3be795;})['then'](respondWithFilteredResult(_0x2a71cf,_0x3bc223))[_0x4b1c('0x47')](handleError(_0x2a71cf,null));};exports[_0x4b1c('0x48')]=function(_0x561ea2,_0x89fd76){var _0x40f16a={'raw':![],'where':{'id':_0x561ea2[_0x4b1c('0x49')]['id']}},_0x1ec405={};_0x1ec405[_0x4b1c('0x35')]=_['keys'](db[_0x4b1c('0x31')][_0x4b1c('0x32')]);_0x1ec405[_0x4b1c('0x36')]=_[_0x4b1c('0x4a')](_0x561ea2[_0x4b1c('0x36')]);_0x1ec405['filters']=_['intersection'](_0x1ec405[_0x4b1c('0x35')],_0x1ec405[_0x4b1c('0x36')]);_0x40f16a['attributes']=_[_0x4b1c('0x38')](_0x1ec405['model'],qs[_0x4b1c('0x3a')](_0x561ea2['query'][_0x4b1c('0x3a')]));_0x40f16a[_0x4b1c('0x39')]=_0x40f16a[_0x4b1c('0x39')][_0x4b1c('0x3b')]?_0x40f16a[_0x4b1c('0x39')]:_0x1ec405[_0x4b1c('0x35')];if(_0x561ea2[_0x4b1c('0x36')][_0x4b1c('0x44')]){_0x40f16a[_0x4b1c('0x45')]=[{'all':!![]}];}_0x40f16a=_['merge']({},_0x40f16a,_0x561ea2['options']);return db['Dashboard'][_0x4b1c('0x4b')](_0x40f16a)[_0x4b1c('0x28')](handleEntityNotFound(_0x89fd76,null))[_0x4b1c('0x28')](respondWithResult(_0x89fd76,null))[_0x4b1c('0x47')](handleError(_0x89fd76,null));};exports[_0x4b1c('0x4c')]=function(_0x3170e1,_0xe8417f){return db[_0x4b1c('0x31')][_0x4b1c('0x4c')](_0x3170e1[_0x4b1c('0x4d')],{})[_0x4b1c('0x28')](function(_0x368c8e){var _0x22b057=_0x3170e1[_0x4b1c('0x4e')][_0x4b1c('0x4f')]({'plain':!![]});if(!_0x22b057)throw new Error(_0x4b1c('0x50'));if(_0x22b057['role']===_0x4b1c('0x4e')){var _0x5ba394=_0x368c8e['get']({'plain':!![]});var _0x42cae4='CustomDashboards';return db[_0x4b1c('0x51')][_0x4b1c('0x4b')]({'where':{'name':_0x42cae4,'userProfileId':_0x22b057[_0x4b1c('0x52')]},'raw':!![]})[_0x4b1c('0x28')](function(_0x190c21){if(_0x190c21&&_0x190c21[_0x4b1c('0x53')]===0x0){return db[_0x4b1c('0x2b')][_0x4b1c('0x4c')]({'name':_0x5ba394[_0x4b1c('0x2e')],'resourceId':_0x5ba394['id'],'type':_0x190c21[_0x4b1c('0x2e')],'sectionId':_0x190c21['id']},{})[_0x4b1c('0x28')](function(){return _0x368c8e;});}else{return _0x368c8e;}})[_0x4b1c('0x47')](function(_0x3f37fc){logger[_0x4b1c('0x2c')](_0x4b1c('0x54'),_0x3f37fc);throw _0x3f37fc;});}return _0x368c8e;})['then'](respondWithResult(_0xe8417f,0xc9))[_0x4b1c('0x47')](handleError(_0xe8417f,null));};exports['clone']=function(_0xf9ce2a,_0x932aae){var _0xe352c7={'where':{'id':_0xf9ce2a[_0x4b1c('0x49')]['id']}},_0x4ea222={};_0x4ea222[_0x4b1c('0x35')]=_['keys'](db[_0x4b1c('0x31')]['rawAttributes']);_0xe352c7[_0x4b1c('0x39')]=_[_0x4b1c('0x38')](_0x4ea222[_0x4b1c('0x35')],qs[_0x4b1c('0x3a')](_0xf9ce2a[_0x4b1c('0x36')]['fields']));_0xe352c7[_0x4b1c('0x39')]=_0xe352c7[_0x4b1c('0x39')]['length']?_0xe352c7[_0x4b1c('0x39')]:_0x4ea222[_0x4b1c('0x35')];if(_0xf9ce2a[_0x4b1c('0x36')][_0x4b1c('0x44')]){_0xe352c7['include']=[{'all':!![]}];}_0xe352c7=_[_0x4b1c('0x41')]({},_0xe352c7,_0xf9ce2a['options']);return db['Dashboard'][_0x4b1c('0x4b')](_0xe352c7)[_0x4b1c('0x28')](handleEntityNotFound(_0x932aae,null))[_0x4b1c('0x28')](function(_0x145ae0){if(_0x145ae0){var _0x47869b=_0x145ae0[_0x4b1c('0x4f')]({'plain':!![]});_0x47869b=qs[_0x4b1c('0x55')](_0x47869b,['id',_0x4b1c('0x56'),_0x4b1c('0x57')]);_0xf9ce2a[_0x4b1c('0x4d')]=_['omit'](_0xf9ce2a[_0x4b1c('0x4d')],['id',_0x4b1c('0x56'),_0x4b1c('0x57')]);return db[_0x4b1c('0x31')][_0x4b1c('0x4c')](_[_0x4b1c('0x41')](_0x47869b,_0xf9ce2a[_0x4b1c('0x4d')]),{'include':_0xf9ce2a[_0x4b1c('0x36')][_0x4b1c('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0x38f0d2){var _0x282d0c=_0xf9ce2a['user'][_0x4b1c('0x4f')]({'plain':!![]});if(!_0x282d0c)throw new Error(_0x4b1c('0x50'));if(_0x282d0c[_0x4b1c('0x58')]===_0x4b1c('0x4e')){var _0xd6bc6d=_0x38f0d2[_0x4b1c('0x4f')]({'plain':!![]});var _0x5e3e86='CustomDashboards';return db[_0x4b1c('0x51')][_0x4b1c('0x4b')]({'where':{'name':_0x5e3e86,'userProfileId':_0x282d0c['userProfileId']},'raw':!![]})['then'](function(_0x35cd82){if(_0x35cd82&&_0x35cd82['autoAssociation']===0x0){return db[_0x4b1c('0x2b')][_0x4b1c('0x4c')]({'name':_0xd6bc6d[_0x4b1c('0x2e')],'resourceId':_0xd6bc6d['id'],'type':_0x35cd82[_0x4b1c('0x2e')],'sectionId':_0x35cd82['id']},{})[_0x4b1c('0x28')](function(){return _0x38f0d2;});}else{return _0x38f0d2;}})['catch'](function(_0xbc0834){logger[_0x4b1c('0x2c')](_0x4b1c('0x54'),_0xbc0834);throw _0xbc0834;});}return _0x38f0d2;});}})[_0x4b1c('0x28')](respondWithResult(_0x932aae,0xc9))[_0x4b1c('0x47')](handleError(_0x932aae,null));};exports[_0x4b1c('0x27')]=function(_0x36fb1f,_0x119e42){if(_0x36fb1f['body']['id']){delete _0x36fb1f[_0x4b1c('0x4d')]['id'];}return db[_0x4b1c('0x31')][_0x4b1c('0x4b')]({'where':{'id':_0x36fb1f['params']['id']}})[_0x4b1c('0x28')](handleEntityNotFound(_0x119e42,null))['then'](saveUpdates(_0x36fb1f['body'],null))['then'](respondWithResult(_0x119e42,null))[_0x4b1c('0x47')](handleError(_0x119e42,null));};exports['destroy']=function(_0x2c52a4,_0x4e8e93){return db['Dashboard'][_0x4b1c('0x4b')]({'where':{'id':_0x2c52a4[_0x4b1c('0x49')]['id']}})[_0x4b1c('0x28')](handleEntityNotFound(_0x4e8e93,null))[_0x4b1c('0x28')](removeEntity(_0x4e8e93,null))[_0x4b1c('0x47')](handleError(_0x4e8e93,null));};function widgetAttributes(_0x3ecc90){try{switch(_0x3ecc90[_0x4b1c('0x3f')]){case'iframe':return[{'name':_0x4b1c('0x59'),'value':_0x3ecc90[_0x4b1c('0x59')]||(_0x3ecc90[_0x4b1c('0x5a')]&&_0x3ecc90[_0x4b1c('0x5a')][0x0]?_0x3ecc90['attrs'][0x0][_0x4b1c('0x5b')]:undefined)||_0x4b1c('0x5c')}];case'custom':return[{'name':'attrPath','value':_0x3ecc90['attrPath']||(_0x3ecc90['attrs']&&_0x3ecc90['attrs'][0x0]?_0x3ecc90[_0x4b1c('0x5a')][0x0][_0x4b1c('0x5b')]:undefined)||''}];case _0x4b1c('0x5d'):return[{'name':'attrHourFormat','value':_0x3ecc90[_0x4b1c('0x5e')]||(_0x3ecc90[_0x4b1c('0x5a')]&&_0x3ecc90[_0x4b1c('0x5a')][0x0]?_0x3ecc90[_0x4b1c('0x5a')][0x0][_0x4b1c('0x5b')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x3ecc90[_0x4b1c('0x5f')]||(_0x3ecc90[_0x4b1c('0x5a')]&&_0x3ecc90[_0x4b1c('0x5a')][0x1]?_0x3ecc90[_0x4b1c('0x5a')][0x1][_0x4b1c('0x5b')]:undefined)||_0x4b1c('0x60')},{'name':'attrFontSize','value':_0x3ecc90[_0x4b1c('0x61')]||(_0x3ecc90['attrs']&&_0x3ecc90['attrs'][0x2]?_0x3ecc90['attrs'][0x2][_0x4b1c('0x5b')]:undefined)||0xc}];case _0x4b1c('0x62'):return[{'name':_0x4b1c('0x63'),'value':_0x3ecc90[_0x4b1c('0x63')]||(_0x3ecc90[_0x4b1c('0x5a')]&&_0x3ecc90[_0x4b1c('0x5a')][0x0]?_0x3ecc90[_0x4b1c('0x5a')][0x0][_0x4b1c('0x5b')]:undefined)||_0x4b1c('0x64')},{'name':_0x4b1c('0x65'),'value':_0x3ecc90[_0x4b1c('0x65')]||(_0x3ecc90[_0x4b1c('0x5a')]&&_0x3ecc90[_0x4b1c('0x5a')][0x1]?_0x3ecc90[_0x4b1c('0x5a')][0x1][_0x4b1c('0x5b')]:undefined)||[]},{'name':_0x4b1c('0x61'),'value':_0x3ecc90[_0x4b1c('0x61')]||(_0x3ecc90[_0x4b1c('0x5a')]&&_0x3ecc90['attrs'][0x2]?_0x3ecc90[_0x4b1c('0x5a')][0x2][_0x4b1c('0x5b')]:undefined)||0x14},{'name':_0x4b1c('0x66'),'value':_0x3ecc90[_0x4b1c('0x66')]||(_0x3ecc90['attrs']&&_0x3ecc90[_0x4b1c('0x5a')][0x3]?_0x3ecc90[_0x4b1c('0x5a')][0x3]['value']:undefined)||_0x4b1c('0x67')},{'name':_0x4b1c('0x68'),'value':_0x3ecc90[_0x4b1c('0x68')]||(_0x3ecc90['attrs']&&_0x3ecc90['attrs'][0x4]?_0x3ecc90[_0x4b1c('0x5a')][0x4]['value']:undefined)||''},{'name':_0x4b1c('0x69'),'value':_0x3ecc90[_0x4b1c('0x69')]||(_0x3ecc90['attrs']&&_0x3ecc90[_0x4b1c('0x5a')][0x5]?_0x3ecc90['attrs'][0x5][_0x4b1c('0x5b')]:undefined)||''},{'name':_0x4b1c('0x6a'),'value':_0x3ecc90[_0x4b1c('0x6a')]||(_0x3ecc90[_0x4b1c('0x5a')]&&_0x3ecc90['attrs'][0x6]?_0x3ecc90[_0x4b1c('0x5a')][0x6]['value']:undefined)||''},{'name':_0x4b1c('0x6b'),'value':_0x3ecc90[_0x4b1c('0x6b')]||(_0x3ecc90[_0x4b1c('0x5a')]&&_0x3ecc90['attrs'][0x7]?_0x3ecc90[_0x4b1c('0x5a')][0x7]['value']:undefined)||''},{'name':_0x4b1c('0x6c'),'value':_0x3ecc90[_0x4b1c('0x6c')]||(_0x3ecc90['attrs']&&_0x3ecc90['attrs'][0x8]?_0x3ecc90[_0x4b1c('0x5a')][0x8][_0x4b1c('0x5b')]:undefined)||''},{'name':_0x4b1c('0x6d'),'value':_0x3ecc90[_0x4b1c('0x6d')]||(_0x3ecc90[_0x4b1c('0x5a')]&&_0x3ecc90[_0x4b1c('0x5a')][0x9]?_0x3ecc90[_0x4b1c('0x5a')][0x9][_0x4b1c('0x5b')]:undefined)||''}];case _0x4b1c('0x6e'):case _0x4b1c('0x6f'):return[{'name':_0x4b1c('0x70'),'value':_0x3ecc90[_0x4b1c('0x70')]||(_0x3ecc90[_0x4b1c('0x5a')]&&_0x3ecc90[_0x4b1c('0x5a')][0x0]?_0x3ecc90['attrs'][0x0]['value']:undefined)||_0x4b1c('0x64')},{'name':_0x4b1c('0x71'),'value':_0x3ecc90[_0x4b1c('0x71')]||(_0x3ecc90[_0x4b1c('0x5a')]&&_0x3ecc90[_0x4b1c('0x5a')][0x1]?_0x3ecc90['attrs'][0x1]['value']:undefined)||null},{'name':_0x4b1c('0x72'),'value':_0x3ecc90[_0x4b1c('0x72')]||(_0x3ecc90['attrs']&&_0x3ecc90[_0x4b1c('0x5a')][0x2]?_0x3ecc90[_0x4b1c('0x5a')][0x2][_0x4b1c('0x5b')]:undefined)||null},{'name':_0x4b1c('0x65'),'value':_0x3ecc90[_0x4b1c('0x65')]||(_0x3ecc90[_0x4b1c('0x5a')]&&_0x3ecc90['attrs'][0x3]?_0x3ecc90[_0x4b1c('0x5a')][0x3][_0x4b1c('0x5b')]:undefined)||[]},{'name':_0x4b1c('0x66'),'value':_0x3ecc90[_0x4b1c('0x66')]||(_0x3ecc90[_0x4b1c('0x5a')]&&_0x3ecc90[_0x4b1c('0x5a')][0x4]?_0x3ecc90[_0x4b1c('0x5a')][0x4]['value']:undefined)||'voice'},{'name':_0x4b1c('0x68'),'value':_0x3ecc90[_0x4b1c('0x68')]||(_0x3ecc90['attrs']&&_0x3ecc90['attrs'][0x5]?_0x3ecc90[_0x4b1c('0x5a')][0x5]['value']:undefined)||''},{'name':_0x4b1c('0x69'),'value':_0x3ecc90[_0x4b1c('0x69')]||(_0x3ecc90['attrs']&&_0x3ecc90[_0x4b1c('0x5a')][0x6]?_0x3ecc90[_0x4b1c('0x5a')][0x6]['value']:undefined)||''},{'name':_0x4b1c('0x6a'),'value':_0x3ecc90[_0x4b1c('0x6a')]||(_0x3ecc90[_0x4b1c('0x5a')]&&_0x3ecc90[_0x4b1c('0x5a')][0x7]?_0x3ecc90[_0x4b1c('0x5a')][0x7][_0x4b1c('0x5b')]:undefined)||''},{'name':_0x4b1c('0x6b'),'value':_0x3ecc90[_0x4b1c('0x6b')]||(_0x3ecc90[_0x4b1c('0x5a')]&&_0x3ecc90[_0x4b1c('0x5a')][0x8]?_0x3ecc90[_0x4b1c('0x5a')][0x8][_0x4b1c('0x5b')]:undefined)||''},{'name':_0x4b1c('0x6c'),'value':_0x3ecc90['attrWhatsappAccounts']||(_0x3ecc90[_0x4b1c('0x5a')]&&_0x3ecc90[_0x4b1c('0x5a')][0x9]?_0x3ecc90['attrs'][0x9][_0x4b1c('0x5b')]:undefined)||''},{'name':_0x4b1c('0x6d'),'value':_0x3ecc90[_0x4b1c('0x6d')]||(_0x3ecc90[_0x4b1c('0x5a')]&&_0x3ecc90[_0x4b1c('0x5a')][0xa]?_0x3ecc90[_0x4b1c('0x5a')][0xa][_0x4b1c('0x5b')]:undefined)||''}];case _0x4b1c('0x73'):return[{'name':_0x4b1c('0x74'),'type':_0x3ecc90['reportType']||(_0x3ecc90['attrs']&&_0x3ecc90[_0x4b1c('0x5a')][0x0]?_0x3ecc90[_0x4b1c('0x5a')][0x0]['type']:undefined)||null,'value':_0x3ecc90[_0x4b1c('0x74')]||(_0x3ecc90[_0x4b1c('0x5a')]&&_0x3ecc90[_0x4b1c('0x5a')][0x0]?_0x3ecc90[_0x4b1c('0x5a')][0x0][_0x4b1c('0x5b')]:undefined)||null},{'name':_0x4b1c('0x75'),'value':_0x3ecc90['attrRefresh']||(_0x3ecc90[_0x4b1c('0x5a')]&&_0x3ecc90[_0x4b1c('0x5a')][0x1]?_0x3ecc90[_0x4b1c('0x5a')][0x1][_0x4b1c('0x5b')]:undefined)||0x0}];default:return[];}}catch(_0x70ab36){logger[_0x4b1c('0x2c')](_0x4b1c('0x76'),JSON['stringify'](_0x70ab36));return[];}}exports[_0x4b1c('0x77')]=function(_0x347ae2,_0x1428b6,_0xe1d144){if(_0x347ae2[_0x4b1c('0x4d')]['id']){delete _0x347ae2[_0x4b1c('0x4d')]['id'];}return db['Dashboard'][_0x4b1c('0x4b')]({'where':{'id':_0x347ae2[_0x4b1c('0x49')]['id']}})[_0x4b1c('0x28')](handleEntityNotFound(_0x1428b6,null))[_0x4b1c('0x28')](function(_0x2314a2){if(_0x2314a2){_0x347ae2[_0x4b1c('0x4d')][_0x4b1c('0x78')]=_0x2314a2['id'];_0x347ae2['body'][_0x4b1c('0x5a')]=widgetAttributes(_0x347ae2[_0x4b1c('0x4d')]);return db[_0x4b1c('0x79')][_0x4b1c('0x4c')](_0x347ae2[_0x4b1c('0x4d')]);}})[_0x4b1c('0x28')](respondWithResult(_0x1428b6,null))[_0x4b1c('0x47')](handleError(_0x1428b6,null));};exports[_0x4b1c('0x7a')]=function(_0x488c6f,_0x5aaa69,_0x5822cb){var _0x1bbd03={};var _0x114d31={};var _0x142e99;var _0x34ef16;return db[_0x4b1c('0x31')]['findOne']({'where':{'id':_0x488c6f[_0x4b1c('0x49')]['id']}})[_0x4b1c('0x28')](handleEntityNotFound(_0x5aaa69,null))[_0x4b1c('0x28')](function(_0x5233ee){if(_0x5233ee){_0x142e99=_0x5233ee;_0x114d31['model']=_[_0x4b1c('0x4a')](db[_0x4b1c('0x79')][_0x4b1c('0x32')]);_0x114d31[_0x4b1c('0x36')]=_[_0x4b1c('0x4a')](_0x488c6f[_0x4b1c('0x36')]);_0x114d31[_0x4b1c('0x37')]=_[_0x4b1c('0x38')](_0x114d31[_0x4b1c('0x35')],_0x114d31['query']);_0x1bbd03[_0x4b1c('0x39')]=_['intersection'](_0x114d31['model'],qs[_0x4b1c('0x3a')](_0x488c6f[_0x4b1c('0x36')]['fields']));_0x1bbd03['attributes']=_0x1bbd03[_0x4b1c('0x39')]['length']?_0x1bbd03[_0x4b1c('0x39')]:_0x114d31[_0x4b1c('0x35')];_0x1bbd03[_0x4b1c('0x7b')]=qs[_0x4b1c('0x3d')](_0x488c6f[_0x4b1c('0x36')][_0x4b1c('0x3d')]);_0x1bbd03[_0x4b1c('0x43')]=qs[_0x4b1c('0x37')](_[_0x4b1c('0x3e')](_0x488c6f[_0x4b1c('0x36')],_0x114d31[_0x4b1c('0x37')]));if(_0x488c6f[_0x4b1c('0x36')]['filter']){_0x1bbd03[_0x4b1c('0x43')]=_['merge'](_0x1bbd03[_0x4b1c('0x43')],{'$or':_[_0x4b1c('0x30')](_0x1bbd03['attributes'],function(_0x33e6b4){var _0x169027={};_0x169027[_0x33e6b4]={'$like':'%'+_0x488c6f[_0x4b1c('0x36')][_0x4b1c('0x40')]+'%'};return _0x169027;})});}_0x1bbd03=_[_0x4b1c('0x41')]({},_0x1bbd03,_0x488c6f[_0x4b1c('0x42')]);return _0x142e99[_0x4b1c('0x7a')](_0x1bbd03);}})['then'](function(_0x1ba21d){if(_0x1ba21d){_0x34ef16=_0x1ba21d['length'];if(!_0x488c6f[_0x4b1c('0x36')][_0x4b1c('0x3c')](_0x4b1c('0x7c'))){_0x1bbd03['limit']=qs['limit'](_0x488c6f[_0x4b1c('0x36')][_0x4b1c('0x20')]);_0x1bbd03['offset']=qs['offset'](_0x488c6f[_0x4b1c('0x36')][_0x4b1c('0x1e')]);}return _0x142e99[_0x4b1c('0x7a')](_0x1bbd03);}})['then'](function(_0x228a1f){if(_0x228a1f){return _0x228a1f?{'count':_0x34ef16,'rows':_0x228a1f}:null;}})['then'](respondWithResult(_0x5aaa69,null))['catch'](handleError(_0x5aaa69,null));};
\ No newline at end of file
+var _0x6085=['length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','UserProfileResource','clone','omit','createdAt','updatedAt','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrFaxAccounts','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardItem','getItems','findOne','pick','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./dashboard.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','get','CustomDashboards','error','stack','name','send','index','map','Dashboard','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields'];(function(_0x3baf4e,_0x36c265){var _0x57ab07=function(_0x2334a9){while(--_0x2334a9){_0x3baf4e['push'](_0x3baf4e['shift']());}};_0x57ab07(++_0x36c265);}(_0x6085,0x145));var _0x5608=function(_0x59197f,_0x238902){_0x59197f=_0x59197f-0x0;var _0x15271e=_0x6085[_0x59197f];return _0x15271e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5608('0x0'));var jsonpatch=require(_0x5608('0x1'));var rp=require(_0x5608('0x2'));var moment=require(_0x5608('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5608('0x4'));var util=require(_0x5608('0x5'));var path=require(_0x5608('0x6'));var sox=require(_0x5608('0x7'));var csv=require(_0x5608('0x8'));var ejs=require(_0x5608('0x9'));var fs=require('fs');var fs_extra=require(_0x5608('0xa'));var _=require(_0x5608('0xb'));var squel=require(_0x5608('0xc'));var crypto=require(_0x5608('0xd'));var jsforce=require(_0x5608('0xe'));var deskjs=require(_0x5608('0xf'));var toCsv=require(_0x5608('0x8'));var querystring=require(_0x5608('0x10'));var Papa=require(_0x5608('0x11'));var Redis=require(_0x5608('0x12'));var authService=require(_0x5608('0x13'));var qs=require(_0x5608('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5608('0x15'));var logger=require(_0x5608('0x16'))(_0x5608('0x17'));var utils=require(_0x5608('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5608('0x19'));var db=require(_0x5608('0x1a'))['db'];config[_0x5608('0x1b')]=_[_0x5608('0x1c')](config[_0x5608('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5608('0x1b')]));require(_0x5608('0x1d'))['register'](socket);function respondWithStatusCode(_0x3af04b,_0x6e3b62){_0x6e3b62=_0x6e3b62||0xcc;return function(_0x18a78d){if(_0x18a78d){return _0x3af04b[_0x5608('0x1e')](_0x6e3b62);}return _0x3af04b[_0x5608('0x1f')](_0x6e3b62)[_0x5608('0x20')]();};}function respondWithResult(_0x5d920f,_0x2da9bf){_0x2da9bf=_0x2da9bf||0xc8;return function(_0x30d8f9){if(_0x30d8f9){return _0x5d920f[_0x5608('0x1f')](_0x2da9bf)[_0x5608('0x21')](_0x30d8f9);}};}function respondWithFilteredResult(_0x4dea15,_0x4dc8ad){return function(_0x5d70a0){if(_0x5d70a0){var _0x394293=typeof _0x4dc8ad[_0x5608('0x22')]===_0x5608('0x23')&&typeof _0x4dc8ad['limit']===_0x5608('0x23');var _0x615e31=_0x5d70a0['count'];var _0x447cc9=_0x394293?0x0:_0x4dc8ad['offset'];var _0x1130a6=_0x394293?_0x5d70a0[_0x5608('0x24')]:_0x4dc8ad[_0x5608('0x22')]+_0x4dc8ad[_0x5608('0x25')];var _0x1edcf5;if(_0x1130a6>=_0x615e31){_0x1130a6=_0x615e31;_0x1edcf5=0xc8;}else{_0x1edcf5=0xce;}_0x4dea15[_0x5608('0x1f')](_0x1edcf5);return _0x4dea15[_0x5608('0x26')]('Content-Range',_0x447cc9+'-'+_0x1130a6+'/'+_0x615e31)['json'](_0x5d70a0);}return null;};}function patchUpdates(_0x2edbb7){return function(_0x5f3256){try{jsonpatch[_0x5608('0x27')](_0x5f3256,_0x2edbb7,!![]);}catch(_0xc9ded5){return BPromise[_0x5608('0x28')](_0xc9ded5);}return _0x5f3256['save']();};}function saveUpdates(_0x56b9bd,_0x29184e){return function(_0x3fe3b3){if(_0x3fe3b3){return _0x3fe3b3[_0x5608('0x29')](_0x56b9bd)[_0x5608('0x2a')](function(_0x3e9e7f){return _0x3e9e7f;});}return null;};}function removeEntity(_0x19b04c,_0x24daf7){return function(_0x314836){if(_0x314836){return _0x314836[_0x5608('0x2b')]()[_0x5608('0x2a')](function(){var _0x855ec1=_0x314836[_0x5608('0x2c')]({'plain':!![]});var _0x4dd48c=_0x5608('0x2d');return db['UserProfileResource'][_0x5608('0x2b')]({'where':{'type':_0x4dd48c,'resourceId':_0x855ec1['id']}})[_0x5608('0x2a')](function(){return _0x314836;});})[_0x5608('0x2a')](function(){_0x19b04c[_0x5608('0x1f')](0xcc)[_0x5608('0x20')]();});}};}function handleEntityNotFound(_0x5b031a,_0x43651c){return function(_0x24b1bf){if(!_0x24b1bf){_0x5b031a[_0x5608('0x1e')](0x194);}return _0x24b1bf;};}function handleError(_0x5411e5,_0x3ea40c){_0x3ea40c=_0x3ea40c||0x1f4;return function(_0xf87970){logger[_0x5608('0x2e')](_0xf87970[_0x5608('0x2f')]);if(_0xf87970[_0x5608('0x30')]){delete _0xf87970[_0x5608('0x30')];}_0x5411e5['status'](_0x3ea40c)[_0x5608('0x31')](_0xf87970);};}exports[_0x5608('0x32')]=function(_0x262c27,_0x587948){var _0x3ff54d={},_0x1349ba={},_0x3974a9={'count':0x0,'rows':[]};var _0x3221b7=_[_0x5608('0x33')](db[_0x5608('0x34')]['rawAttributes'],function(_0x1e9be1){return{'name':_0x1e9be1[_0x5608('0x35')],'type':_0x1e9be1[_0x5608('0x36')][_0x5608('0x37')]};});_0x1349ba[_0x5608('0x38')]=_['map'](_0x3221b7,_0x5608('0x30'));_0x1349ba[_0x5608('0x39')]=_[_0x5608('0x3a')](_0x262c27[_0x5608('0x39')]);_0x1349ba[_0x5608('0x3b')]=_[_0x5608('0x3c')](_0x1349ba[_0x5608('0x38')],_0x1349ba[_0x5608('0x39')]);_0x3ff54d[_0x5608('0x3d')]=_['intersection'](_0x1349ba[_0x5608('0x38')],qs['fields'](_0x262c27[_0x5608('0x39')]['fields']));_0x3ff54d[_0x5608('0x3d')]=_0x3ff54d['attributes']['length']?_0x3ff54d[_0x5608('0x3d')]:_0x1349ba[_0x5608('0x38')];if(!_0x262c27['query'][_0x5608('0x3e')](_0x5608('0x3f'))){_0x3ff54d['limit']=qs[_0x5608('0x25')](_0x262c27[_0x5608('0x39')]['limit']);_0x3ff54d[_0x5608('0x22')]=qs[_0x5608('0x22')](_0x262c27[_0x5608('0x39')]['offset']);}_0x3ff54d[_0x5608('0x40')]=qs[_0x5608('0x41')](_0x262c27['query'][_0x5608('0x41')]);_0x3ff54d['where']=qs[_0x5608('0x3b')](_['pick'](_0x262c27[_0x5608('0x39')],_0x1349ba['filters']),_0x3221b7);if(_0x262c27['query'][_0x5608('0x42')]){_0x3ff54d[_0x5608('0x43')]=_[_0x5608('0x44')](_0x3ff54d[_0x5608('0x43')],{'$or':_[_0x5608('0x33')](_0x3221b7,function(_0x5b5434){if(_0x5b5434[_0x5608('0x36')]!==_0x5608('0x45')){var _0x195e35={};_0x195e35[_0x5b5434[_0x5608('0x30')]]={'$like':'%'+_0x262c27[_0x5608('0x39')][_0x5608('0x42')]+'%'};return _0x195e35;}})});}_0x3ff54d=_[_0x5608('0x44')]({},_0x3ff54d,_0x262c27[_0x5608('0x46')]);var _0x34a876={'where':_0x3ff54d[_0x5608('0x43')]};return db['Dashboard'][_0x5608('0x24')](_0x34a876)[_0x5608('0x2a')](function(_0xab699){_0x3974a9[_0x5608('0x24')]=_0xab699;if(_0x262c27[_0x5608('0x39')][_0x5608('0x47')]){_0x3ff54d[_0x5608('0x48')]=[{'all':!![]}];}return db[_0x5608('0x34')][_0x5608('0x49')](_0x3ff54d);})[_0x5608('0x2a')](function(_0x5b7589){_0x3974a9[_0x5608('0x4a')]=_0x5b7589;return _0x3974a9;})[_0x5608('0x2a')](respondWithFilteredResult(_0x587948,_0x3ff54d))[_0x5608('0x4b')](handleError(_0x587948,null));};exports[_0x5608('0x4c')]=function(_0xfe8e2,_0x3ae8a6){var _0x390d7a={'raw':![],'where':{'id':_0xfe8e2[_0x5608('0x4d')]['id']}},_0x2fb28c={};_0x2fb28c[_0x5608('0x38')]=_['keys'](db['Dashboard'][_0x5608('0x4e')]);_0x2fb28c[_0x5608('0x39')]=_[_0x5608('0x3a')](_0xfe8e2[_0x5608('0x39')]);_0x2fb28c[_0x5608('0x3b')]=_[_0x5608('0x3c')](_0x2fb28c['model'],_0x2fb28c[_0x5608('0x39')]);_0x390d7a['attributes']=_['intersection'](_0x2fb28c[_0x5608('0x38')],qs[_0x5608('0x4f')](_0xfe8e2[_0x5608('0x39')][_0x5608('0x4f')]));_0x390d7a[_0x5608('0x3d')]=_0x390d7a[_0x5608('0x3d')][_0x5608('0x50')]?_0x390d7a['attributes']:_0x2fb28c[_0x5608('0x38')];if(_0xfe8e2['query'][_0x5608('0x47')]){_0x390d7a['include']=[{'all':!![]}];}_0x390d7a=_[_0x5608('0x44')]({},_0x390d7a,_0xfe8e2[_0x5608('0x46')]);return db[_0x5608('0x34')][_0x5608('0x51')](_0x390d7a)['then'](handleEntityNotFound(_0x3ae8a6,null))['then'](respondWithResult(_0x3ae8a6,null))[_0x5608('0x4b')](handleError(_0x3ae8a6,null));};exports[_0x5608('0x52')]=function(_0x18e5c6,_0x2f2207){return db['Dashboard'][_0x5608('0x52')](_0x18e5c6[_0x5608('0x53')],{})[_0x5608('0x2a')](function(_0x3d27ac){var _0x345114=_0x18e5c6['user'][_0x5608('0x2c')]({'plain':!![]});if(!_0x345114)throw new Error(_0x5608('0x54'));if(_0x345114['role']===_0x5608('0x55')){var _0x5b1811=_0x3d27ac[_0x5608('0x2c')]({'plain':!![]});var _0x214ddb=_0x5608('0x2d');return db['UserProfileSection'][_0x5608('0x51')]({'where':{'name':_0x214ddb,'userProfileId':_0x345114[_0x5608('0x56')]},'raw':!![]})[_0x5608('0x2a')](function(_0x4e6c6a){if(_0x4e6c6a&&_0x4e6c6a[_0x5608('0x57')]===0x0){return db[_0x5608('0x58')]['create']({'name':_0x5b1811[_0x5608('0x30')],'resourceId':_0x5b1811['id'],'type':_0x4e6c6a[_0x5608('0x30')],'sectionId':_0x4e6c6a['id']},{})['then'](function(){return _0x3d27ac;});}else{return _0x3d27ac;}})[_0x5608('0x4b')](function(_0x12f028){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12f028);throw _0x12f028;});}return _0x3d27ac;})[_0x5608('0x2a')](respondWithResult(_0x2f2207,0xc9))[_0x5608('0x4b')](handleError(_0x2f2207,null));};exports[_0x5608('0x59')]=function(_0x4c452e,_0x1967df){var _0x157c02={'where':{'id':_0x4c452e[_0x5608('0x4d')]['id']}},_0x289865={};_0x289865[_0x5608('0x38')]=_[_0x5608('0x3a')](db['Dashboard'][_0x5608('0x4e')]);_0x157c02[_0x5608('0x3d')]=_[_0x5608('0x3c')](_0x289865[_0x5608('0x38')],qs[_0x5608('0x4f')](_0x4c452e['query'][_0x5608('0x4f')]));_0x157c02['attributes']=_0x157c02[_0x5608('0x3d')][_0x5608('0x50')]?_0x157c02['attributes']:_0x289865['model'];if(_0x4c452e[_0x5608('0x39')][_0x5608('0x47')]){_0x157c02['include']=[{'all':!![]}];}_0x157c02=_[_0x5608('0x44')]({},_0x157c02,_0x4c452e[_0x5608('0x46')]);return db[_0x5608('0x34')]['find'](_0x157c02)['then'](handleEntityNotFound(_0x1967df,null))[_0x5608('0x2a')](function(_0x59021d){if(_0x59021d){var _0x58b7bf=_0x59021d['get']({'plain':!![]});_0x58b7bf=qs[_0x5608('0x5a')](_0x58b7bf,['id',_0x5608('0x5b'),_0x5608('0x5c')]);_0x4c452e['body']=_[_0x5608('0x5a')](_0x4c452e[_0x5608('0x53')],['id',_0x5608('0x5b'),_0x5608('0x5c')]);return db[_0x5608('0x34')][_0x5608('0x52')](_[_0x5608('0x44')](_0x58b7bf,_0x4c452e[_0x5608('0x53')]),{'include':_0x4c452e['query'][_0x5608('0x47')]?[{'all':!![]}]:undefined})[_0x5608('0x2a')](function(_0x43d4cb){var _0x382819=_0x4c452e[_0x5608('0x55')][_0x5608('0x2c')]({'plain':!![]});if(!_0x382819)throw new Error(_0x5608('0x54'));if(_0x382819[_0x5608('0x5d')]==='user'){var _0xbeb5f4=_0x43d4cb['get']({'plain':!![]});var _0x303348=_0x5608('0x2d');return db[_0x5608('0x5e')][_0x5608('0x51')]({'where':{'name':_0x303348,'userProfileId':_0x382819[_0x5608('0x56')]},'raw':!![]})['then'](function(_0x2c6a2b){if(_0x2c6a2b&&_0x2c6a2b[_0x5608('0x57')]===0x0){return db[_0x5608('0x58')][_0x5608('0x52')]({'name':_0xbeb5f4[_0x5608('0x30')],'resourceId':_0xbeb5f4['id'],'type':_0x2c6a2b['name'],'sectionId':_0x2c6a2b['id']},{})[_0x5608('0x2a')](function(){return _0x43d4cb;});}else{return _0x43d4cb;}})[_0x5608('0x4b')](function(_0x45030c){logger['error'](_0x5608('0x5f'),_0x45030c);throw _0x45030c;});}return _0x43d4cb;});}})[_0x5608('0x2a')](respondWithResult(_0x1967df,0xc9))[_0x5608('0x4b')](handleError(_0x1967df,null));};exports[_0x5608('0x29')]=function(_0x31ef42,_0x5cac18){if(_0x31ef42[_0x5608('0x53')]['id']){delete _0x31ef42[_0x5608('0x53')]['id'];}return db[_0x5608('0x34')][_0x5608('0x51')]({'where':{'id':_0x31ef42['params']['id']}})[_0x5608('0x2a')](handleEntityNotFound(_0x5cac18,null))['then'](saveUpdates(_0x31ef42[_0x5608('0x53')],null))[_0x5608('0x2a')](respondWithResult(_0x5cac18,null))[_0x5608('0x4b')](handleError(_0x5cac18,null));};exports[_0x5608('0x2b')]=function(_0xb077b2,_0x2c5ab7){return db[_0x5608('0x34')][_0x5608('0x51')]({'where':{'id':_0xb077b2['params']['id']}})[_0x5608('0x2a')](handleEntityNotFound(_0x2c5ab7,null))[_0x5608('0x2a')](removeEntity(_0x2c5ab7,null))['catch'](handleError(_0x2c5ab7,null));};function widgetAttributes(_0x43856d){try{switch(_0x43856d[_0x5608('0x36')]){case _0x5608('0x60'):return[{'name':_0x5608('0x61'),'value':_0x43856d[_0x5608('0x61')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d[_0x5608('0x62')][0x0]?_0x43856d[_0x5608('0x62')][0x0]['value']:undefined)||_0x5608('0x63')}];case _0x5608('0x64'):return[{'name':_0x5608('0x65'),'value':_0x43856d[_0x5608('0x65')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d['attrs'][0x0]?_0x43856d[_0x5608('0x62')][0x0][_0x5608('0x66')]:undefined)||''}];case _0x5608('0x67'):return[{'name':'attrHourFormat','value':_0x43856d[_0x5608('0x68')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d['attrs'][0x0]?_0x43856d['attrs'][0x0][_0x5608('0x66')]:undefined)||_0x5608('0x69')},{'name':'attrTimezone','value':_0x43856d['attrTimezone']||(_0x43856d[_0x5608('0x62')]&&_0x43856d['attrs'][0x1]?_0x43856d[_0x5608('0x62')][0x1][_0x5608('0x66')]:undefined)||_0x5608('0x6a')},{'name':'attrFontSize','value':_0x43856d[_0x5608('0x6b')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d['attrs'][0x2]?_0x43856d[_0x5608('0x62')][0x2][_0x5608('0x66')]:undefined)||0xc}];case _0x5608('0x6c'):return[{'name':_0x5608('0x6d'),'value':_0x43856d[_0x5608('0x6d')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d[_0x5608('0x62')][0x0]?_0x43856d[_0x5608('0x62')][0x0][_0x5608('0x66')]:undefined)||_0x5608('0x6e')},{'name':_0x5608('0x6f'),'value':_0x43856d[_0x5608('0x6f')]||(_0x43856d['attrs']&&_0x43856d[_0x5608('0x62')][0x1]?_0x43856d[_0x5608('0x62')][0x1][_0x5608('0x66')]:undefined)||[]},{'name':_0x5608('0x6b'),'value':_0x43856d[_0x5608('0x6b')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d[_0x5608('0x62')][0x2]?_0x43856d[_0x5608('0x62')][0x2]['value']:undefined)||0x14},{'name':_0x5608('0x70'),'value':_0x43856d[_0x5608('0x70')]||(_0x43856d['attrs']&&_0x43856d[_0x5608('0x62')][0x3]?_0x43856d[_0x5608('0x62')][0x3][_0x5608('0x66')]:undefined)||_0x5608('0x71')},{'name':_0x5608('0x72'),'value':_0x43856d[_0x5608('0x72')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d[_0x5608('0x62')][0x4]?_0x43856d[_0x5608('0x62')][0x4][_0x5608('0x66')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x43856d['attrFaxAccounts']||(_0x43856d[_0x5608('0x62')]&&_0x43856d['attrs'][0x5]?_0x43856d[_0x5608('0x62')][0x5][_0x5608('0x66')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x43856d[_0x5608('0x73')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d[_0x5608('0x62')][0x6]?_0x43856d[_0x5608('0x62')][0x6]['value']:undefined)||''},{'name':_0x5608('0x74'),'value':_0x43856d['attrOpenchannelAccounts']||(_0x43856d['attrs']&&_0x43856d[_0x5608('0x62')][0x7]?_0x43856d[_0x5608('0x62')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x43856d[_0x5608('0x75')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d['attrs'][0x8]?_0x43856d['attrs'][0x8]['value']:undefined)||''},{'name':_0x5608('0x76'),'value':_0x43856d[_0x5608('0x76')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d[_0x5608('0x62')][0x9]?_0x43856d['attrs'][0x9][_0x5608('0x66')]:undefined)||''}];case _0x5608('0x77'):case _0x5608('0x78'):return[{'name':_0x5608('0x79'),'value':_0x43856d[_0x5608('0x79')]||(_0x43856d['attrs']&&_0x43856d['attrs'][0x0]?_0x43856d[_0x5608('0x62')][0x0]['value']:undefined)||_0x5608('0x6e')},{'name':_0x5608('0x7a'),'value':_0x43856d['attrSerie2']||(_0x43856d[_0x5608('0x62')]&&_0x43856d[_0x5608('0x62')][0x1]?_0x43856d[_0x5608('0x62')][0x1][_0x5608('0x66')]:undefined)||null},{'name':_0x5608('0x7b'),'value':_0x43856d[_0x5608('0x7b')]||(_0x43856d['attrs']&&_0x43856d['attrs'][0x2]?_0x43856d[_0x5608('0x62')][0x2][_0x5608('0x66')]:undefined)||null},{'name':_0x5608('0x6f'),'value':_0x43856d[_0x5608('0x6f')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d[_0x5608('0x62')][0x3]?_0x43856d[_0x5608('0x62')][0x3]['value']:undefined)||[]},{'name':_0x5608('0x70'),'value':_0x43856d[_0x5608('0x70')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d['attrs'][0x4]?_0x43856d[_0x5608('0x62')][0x4][_0x5608('0x66')]:undefined)||_0x5608('0x71')},{'name':'attrEmailAccounts','value':_0x43856d[_0x5608('0x72')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d[_0x5608('0x62')][0x5]?_0x43856d['attrs'][0x5][_0x5608('0x66')]:undefined)||''},{'name':_0x5608('0x7c'),'value':_0x43856d[_0x5608('0x7c')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d[_0x5608('0x62')][0x6]?_0x43856d[_0x5608('0x62')][0x6][_0x5608('0x66')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x43856d[_0x5608('0x73')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d[_0x5608('0x62')][0x7]?_0x43856d[_0x5608('0x62')][0x7][_0x5608('0x66')]:undefined)||''},{'name':_0x5608('0x74'),'value':_0x43856d['attrOpenchannelAccounts']||(_0x43856d[_0x5608('0x62')]&&_0x43856d[_0x5608('0x62')][0x8]?_0x43856d[_0x5608('0x62')][0x8][_0x5608('0x66')]:undefined)||''},{'name':_0x5608('0x75'),'value':_0x43856d[_0x5608('0x75')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d[_0x5608('0x62')][0x9]?_0x43856d[_0x5608('0x62')][0x9][_0x5608('0x66')]:undefined)||''},{'name':'attrChatWebsites','value':_0x43856d[_0x5608('0x76')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d[_0x5608('0x62')][0xa]?_0x43856d['attrs'][0xa][_0x5608('0x66')]:undefined)||''}];case _0x5608('0x7d'):return[{'name':_0x5608('0x7e'),'type':_0x43856d[_0x5608('0x7f')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d[_0x5608('0x62')][0x0]?_0x43856d[_0x5608('0x62')][0x0][_0x5608('0x36')]:undefined)||null,'value':_0x43856d[_0x5608('0x7e')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d[_0x5608('0x62')][0x0]?_0x43856d[_0x5608('0x62')][0x0][_0x5608('0x66')]:undefined)||null},{'name':_0x5608('0x80'),'value':_0x43856d[_0x5608('0x80')]||(_0x43856d[_0x5608('0x62')]&&_0x43856d[_0x5608('0x62')][0x1]?_0x43856d[_0x5608('0x62')][0x1][_0x5608('0x66')]:undefined)||0x0}];default:return[];}}catch(_0x46adbb){logger[_0x5608('0x2e')](_0x5608('0x81'),JSON[_0x5608('0x82')](_0x46adbb));return[];}}exports['addItem']=function(_0x5b907e,_0x3a7d74,_0x1e892a){if(_0x5b907e[_0x5608('0x53')]['id']){delete _0x5b907e['body']['id'];}return db[_0x5608('0x34')]['find']({'where':{'id':_0x5b907e[_0x5608('0x4d')]['id']}})[_0x5608('0x2a')](handleEntityNotFound(_0x3a7d74,null))[_0x5608('0x2a')](function(_0x37d8d1){if(_0x37d8d1){_0x5b907e[_0x5608('0x53')]['DashboardId']=_0x37d8d1['id'];_0x5b907e[_0x5608('0x53')][_0x5608('0x62')]=widgetAttributes(_0x5b907e[_0x5608('0x53')]);return db[_0x5608('0x83')]['create'](_0x5b907e['body']);}})['then'](respondWithResult(_0x3a7d74,null))['catch'](handleError(_0x3a7d74,null));};exports[_0x5608('0x84')]=function(_0x10a41d,_0x5c5cb7,_0x1082dd){var _0x4c1695={};var _0x12107a={};var _0x20a6cc;var _0x1a6817;return db[_0x5608('0x34')][_0x5608('0x85')]({'where':{'id':_0x10a41d[_0x5608('0x4d')]['id']}})[_0x5608('0x2a')](handleEntityNotFound(_0x5c5cb7,null))[_0x5608('0x2a')](function(_0x33aa29){if(_0x33aa29){_0x20a6cc=_0x33aa29;_0x12107a[_0x5608('0x38')]=_[_0x5608('0x3a')](db[_0x5608('0x83')][_0x5608('0x4e')]);_0x12107a['query']=_[_0x5608('0x3a')](_0x10a41d[_0x5608('0x39')]);_0x12107a[_0x5608('0x3b')]=_[_0x5608('0x3c')](_0x12107a[_0x5608('0x38')],_0x12107a['query']);_0x4c1695[_0x5608('0x3d')]=_[_0x5608('0x3c')](_0x12107a['model'],qs[_0x5608('0x4f')](_0x10a41d['query'][_0x5608('0x4f')]));_0x4c1695['attributes']=_0x4c1695['attributes'][_0x5608('0x50')]?_0x4c1695[_0x5608('0x3d')]:_0x12107a[_0x5608('0x38')];_0x4c1695['order']=qs['sort'](_0x10a41d[_0x5608('0x39')]['sort']);_0x4c1695[_0x5608('0x43')]=qs[_0x5608('0x3b')](_[_0x5608('0x86')](_0x10a41d[_0x5608('0x39')],_0x12107a['filters']));if(_0x10a41d[_0x5608('0x39')]['filter']){_0x4c1695[_0x5608('0x43')]=_[_0x5608('0x44')](_0x4c1695['where'],{'$or':_[_0x5608('0x33')](_0x4c1695[_0x5608('0x3d')],function(_0x1430b3){var _0x52cd7d={};_0x52cd7d[_0x1430b3]={'$like':'%'+_0x10a41d[_0x5608('0x39')][_0x5608('0x42')]+'%'};return _0x52cd7d;})});}_0x4c1695=_['merge']({},_0x4c1695,_0x10a41d[_0x5608('0x46')]);return _0x20a6cc[_0x5608('0x84')](_0x4c1695);}})[_0x5608('0x2a')](function(_0xc05353){if(_0xc05353){_0x1a6817=_0xc05353['length'];if(!_0x10a41d[_0x5608('0x39')][_0x5608('0x3e')](_0x5608('0x3f'))){_0x4c1695[_0x5608('0x25')]=qs[_0x5608('0x25')](_0x10a41d[_0x5608('0x39')][_0x5608('0x25')]);_0x4c1695[_0x5608('0x22')]=qs['offset'](_0x10a41d['query'][_0x5608('0x22')]);}return _0x20a6cc['getItems'](_0x4c1695);}})[_0x5608('0x2a')](function(_0x4e4257){if(_0x4e4257){return _0x4e4257?{'count':_0x1a6817,'rows':_0x4e4257}:null;}})['then'](respondWithResult(_0x5c5cb7,null))['catch'](handleError(_0x5c5cb7,null));};
\ No newline at end of file
index 026a69c..00d0726 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7f8=['../../mysqldb','Dashboard','setMaxListeners','save','remove','emit','hook','events'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc7f8,0xcf));var _0x8c7f=function(_0x6e280a,_0x2ac5cc){_0x6e280a=_0x6e280a-0x0;var _0x51bbb4=_0xc7f8[_0x6e280a];return _0x51bbb4;};'use strict';var EventEmitter=require(_0x8c7f('0x0'));var Dashboard=require(_0x8c7f('0x1'))['db'][_0x8c7f('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x8c7f('0x3')](0x0);var events={'afterCreate':_0x8c7f('0x4'),'afterUpdate':'update','afterDestroy':_0x8c7f('0x5')};function emitEvent(_0x1884f0){return function(_0x418a1b,_0x1ff10c,_0x36e2ef){DashboardEvents[_0x8c7f('0x6')](_0x1884f0+':'+_0x418a1b['id'],_0x418a1b);DashboardEvents[_0x8c7f('0x6')](_0x1884f0,_0x418a1b);_0x36e2ef(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x8c7f('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents;
\ No newline at end of file
+var _0xbe22=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Dashboard'];(function(_0x36a855,_0x3af789){var _0x569605=function(_0x5522b8){while(--_0x5522b8){_0x36a855['push'](_0x36a855['shift']());}};_0x569605(++_0x3af789);}(_0xbe22,0x86));var _0x2be2=function(_0x51900a,_0x2544ff){_0x51900a=_0x51900a-0x0;var _0x239f84=_0xbe22[_0x51900a];return _0x239f84;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x2be2('0x0'))['db'][_0x2be2('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2be2('0x2'),'afterDestroy':_0x2be2('0x3')};function emitEvent(_0x241ad9){return function(_0x1c9b36,_0x21d445,_0x58e66a){DashboardEvents[_0x2be2('0x4')](_0x241ad9+':'+_0x1c9b36['id'],_0x1c9b36);DashboardEvents[_0x2be2('0x4')](_0x241ad9,_0x1c9b36);_0x58e66a(null);};}for(var e in events){if(events[_0x2be2('0x5')](e)){var event=events[e];Dashboard[_0x2be2('0x6')](e,emitEvent(event));}}module[_0x2be2('0x7')]=DashboardEvents;
\ No newline at end of file
index 959c1ca..4220a66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc489=['./dashboard.attributes','define','Dashboard','dashboards','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x14437f,_0xc14167){var _0x4d0175=function(_0xb74854){while(--_0xb74854){_0x14437f['push'](_0x14437f['shift']());}};_0x4d0175(++_0xc14167);}(_0xc489,0x13a));var _0x9c48=function(_0x20a977,_0x8ad388){_0x20a977=_0x20a977-0x0;var _0x406649=_0xc489[_0x20a977];return _0x406649;};'use strict';var _=require('lodash');var util=require(_0x9c48('0x0'));var logger=require('../../config/logger')(_0x9c48('0x1'));var moment=require(_0x9c48('0x2'));var BPromise=require(_0x9c48('0x3'));var rp=require(_0x9c48('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c48('0x5'));var config=require('../../config/environment');var attributes=require(_0x9c48('0x6'));module['exports']=function(_0x1f9273,_0xd1aec9){return _0x1f9273[_0x9c48('0x7')](_0x9c48('0x8'),attributes,{'tableName':_0x9c48('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcc65=['rimraf','define','Dashboard','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x23556e,_0x7efd43){var _0xfd8780=function(_0x15d583){while(--_0x15d583){_0x23556e['push'](_0x23556e['shift']());}};_0xfd8780(++_0x7efd43);}(_0xcc65,0x71));var _0x5cc6=function(_0x32e2f3,_0x5c9fe7){_0x32e2f3=_0x32e2f3-0x0;var _0xcc7735=_0xcc65[_0x32e2f3];return _0xcc7735;};'use strict';var _=require(_0x5cc6('0x0'));var util=require('util');var logger=require(_0x5cc6('0x1'))(_0x5cc6('0x2'));var moment=require(_0x5cc6('0x3'));var BPromise=require(_0x5cc6('0x4'));var rp=require(_0x5cc6('0x5'));var fs=require('fs');var path=require(_0x5cc6('0x6'));var rimraf=require(_0x5cc6('0x7'));var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module['exports']=function(_0x591179,_0x277248){return _0x591179[_0x5cc6('0x8')](_0x5cc6('0x9'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a4683ef..c3cc498 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cec=['Dashboard,\x20%s,\x20%s,\x20%s','error','code','Dashboard,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','info','request\x20sent','debug'];(function(_0x7cb10c,_0x2fcc3a){var _0x11df59=function(_0x75305f){while(--_0x75305f){_0x7cb10c['push'](_0x7cb10c['shift']());}};_0x11df59(++_0x2fcc3a);}(_0x1cec,0xa9));var _0xc1ce=function(_0x246573,_0x856eb9){_0x246573=_0x246573-0x0;var _0x441c04=_0x1cec[_0x246573];return _0x441c04;};'use strict';var _=require('lodash');var util=require(_0xc1ce('0x0'));var moment=require('moment');var BPromise=require(_0xc1ce('0x1'));var rs=require(_0xc1ce('0x2'));var fs=require('fs');var Redis=require(_0xc1ce('0x3'));var db=require(_0xc1ce('0x4'))['db'];var utils=require(_0xc1ce('0x5'));var logger=require('../../config/logger')(_0xc1ce('0x6'));var config=require(_0xc1ce('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc1ce('0x8')][_0xc1ce('0x9')]({'port':0x232a});config[_0xc1ce('0xa')]=_[_0xc1ce('0xb')](config[_0xc1ce('0xa')],{'host':_0xc1ce('0xc'),'port':0x18eb});var socket=require(_0xc1ce('0xd'))(new Redis(config[_0xc1ce('0xa')]));require(_0xc1ce('0xe'))[_0xc1ce('0xf')](socket);function respondWithRpcPromise(_0x1c22a0,_0x2985bf,_0x39ef32){return new BPromise(function(_0x45aea4,_0x8d6d81){return client[_0xc1ce('0x10')](_0x1c22a0,_0x39ef32)['then'](function(_0x24dc15){logger[_0xc1ce('0x11')]('Dashboard,\x20%s,\x20%s',_0x2985bf,_0xc1ce('0x12'));logger[_0xc1ce('0x13')](_0xc1ce('0x14'),_0x2985bf,_0xc1ce('0x12'),JSON['stringify'](_0x24dc15));if(_0x24dc15[_0xc1ce('0x15')]){if(_0x24dc15[_0xc1ce('0x15')][_0xc1ce('0x16')]===0x1f4){logger[_0xc1ce('0x15')](_0xc1ce('0x17'),_0x2985bf,_0x24dc15['error'][_0xc1ce('0x18')]);return _0x8d6d81(_0x24dc15['error'][_0xc1ce('0x18')]);}logger[_0xc1ce('0x15')]('Dashboard,\x20%s,\x20%s',_0x2985bf,_0x24dc15[_0xc1ce('0x15')][_0xc1ce('0x18')]);return _0x45aea4(_0x24dc15[_0xc1ce('0x15')][_0xc1ce('0x18')]);}else{logger[_0xc1ce('0x11')](_0xc1ce('0x17'),_0x2985bf,_0xc1ce('0x12'));_0x45aea4(_0x24dc15[_0xc1ce('0x19')]['message']);}})[_0xc1ce('0x1a')](function(_0x270887){logger['error'](_0xc1ce('0x17'),_0x2985bf,_0x270887);_0x8d6d81(_0x270887);});});}
\ No newline at end of file
+var _0x7127=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./dashboard.socket','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird'];(function(_0x3d517a,_0x2a6dd1){var _0x129148=function(_0x58e71d){while(--_0x58e71d){_0x3d517a['push'](_0x3d517a['shift']());}};_0x129148(++_0x2a6dd1);}(_0x7127,0xe2));var _0x7712=function(_0x8c217,_0x38b1e7){_0x8c217=_0x8c217-0x0;var _0x3ac946=_0x7127[_0x8c217];return _0x3ac946;};'use strict';var _=require(_0x7712('0x0'));var util=require(_0x7712('0x1'));var moment=require(_0x7712('0x2'));var BPromise=require(_0x7712('0x3'));var rs=require(_0x7712('0x4'));var fs=require('fs');var Redis=require(_0x7712('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7712('0x6'))(_0x7712('0x7'));var config=require(_0x7712('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7712('0x9')][_0x7712('0xa')]({'port':0x232a});config[_0x7712('0xb')]=_[_0x7712('0xc')](config[_0x7712('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7712('0xd'))['register'](socket);function respondWithRpcPromise(_0x308586,_0x586961,_0x33b345){return new BPromise(function(_0x5ad80d,_0x914f29){return client['request'](_0x308586,_0x33b345)[_0x7712('0xe')](function(_0x1fb931){logger['info'](_0x7712('0xf'),_0x586961,_0x7712('0x10'));logger[_0x7712('0x11')](_0x7712('0x12'),_0x586961,_0x7712('0x10'),JSON[_0x7712('0x13')](_0x1fb931));if(_0x1fb931[_0x7712('0x14')]){if(_0x1fb931[_0x7712('0x14')]['code']===0x1f4){logger[_0x7712('0x14')](_0x7712('0xf'),_0x586961,_0x1fb931[_0x7712('0x14')]['message']);return _0x914f29(_0x1fb931[_0x7712('0x14')][_0x7712('0x15')]);}logger['error'](_0x7712('0xf'),_0x586961,_0x1fb931[_0x7712('0x14')]['message']);return _0x5ad80d(_0x1fb931['error'][_0x7712('0x15')]);}else{logger['info'](_0x7712('0xf'),_0x586961,_0x7712('0x10'));_0x5ad80d(_0x1fb931[_0x7712('0x16')][_0x7712('0x15')]);}})['catch'](function(_0xf4fd1b){logger[_0x7712('0x14')](_0x7712('0xf'),_0x586961,_0xf4fd1b);_0x914f29(_0xf4fd1b);});});}
\ No newline at end of file
index 6e644e7..b630f8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a29=['register','length','dashboard:','./dashboard.events','update','emit','removeListener'];(function(_0x4cbb2a,_0x5e8fbd){var _0x2b4fa0=function(_0x3445c0){while(--_0x3445c0){_0x4cbb2a['push'](_0x4cbb2a['shift']());}};_0x2b4fa0(++_0x5e8fbd);}(_0x2a29,0x1a7));var _0x92a2=function(_0x34d23a,_0x17dcfc){_0x34d23a=_0x34d23a-0x0;var _0x5563dd=_0x2a29[_0x34d23a];return _0x5563dd;};'use strict';var DashboardEvents=require(_0x92a2('0x0'));var events=['save','remove',_0x92a2('0x1')];function createListener(_0x24885e,_0x2cec82){return function(_0x355bf1){_0x2cec82[_0x92a2('0x2')](_0x24885e,_0x355bf1);};}function removeListener(_0x45a311,_0x527433){return function(){DashboardEvents[_0x92a2('0x3')](_0x45a311,_0x527433);};}exports[_0x92a2('0x4')]=function(_0x2f49e1){for(var _0x453ac2=0x0,_0x343157=events[_0x92a2('0x5')];_0x453ac2<_0x343157;_0x453ac2++){var _0x4c62ea=events[_0x453ac2];var _0x375c16=createListener(_0x92a2('0x6')+_0x4c62ea,_0x2f49e1);DashboardEvents['on'](_0x4c62ea,_0x375c16);}};
\ No newline at end of file
+var _0x4dec=['./dashboard.events','save','remove','update','emit','register','length','dashboard:'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x4dec,0x170));var _0xc4de=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4dec[_0x3b380d];return _0x54502b;};'use strict';var DashboardEvents=require(_0xc4de('0x0'));var events=[_0xc4de('0x1'),_0xc4de('0x2'),_0xc4de('0x3')];function createListener(_0x3d355b,_0x1a2a72){return function(_0x44a887){_0x1a2a72[_0xc4de('0x4')](_0x3d355b,_0x44a887);};}function removeListener(_0x127072,_0x480377){return function(){DashboardEvents['removeListener'](_0x127072,_0x480377);};}exports[_0xc4de('0x5')]=function(_0x1da4a9){for(var _0x483cf3=0x0,_0x3c68ca=events[_0xc4de('0x6')];_0x483cf3<_0x3c68ca;_0x483cf3++){var _0x3ecfbb=events[_0x483cf3];var _0xa777aa=createListener(_0xc4de('0x7')+_0x3ecfbb,_0x1da4a9);DashboardEvents['on'](_0x3ecfbb,_0xa777aa);}};
\ No newline at end of file
index 332aec4..6b00122 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc360=['post','create','/:id/clone','/:id/items','addItem','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id','isAuthenticated'];(function(_0x54cb64,_0x3d376c){var _0x426a88=function(_0x3efb7a){while(--_0x3efb7a){_0x54cb64['push'](_0x54cb64['shift']());}};_0x426a88(++_0x3d376c);}(_0xc360,0xeb));var _0x0c36=function(_0x3d070e,_0x22d705){_0x3d070e=_0x3d070e-0x0;var _0x9b50fd=_0xc360[_0x3d070e];return _0x9b50fd;};'use strict';var multer=require(_0x0c36('0x0'));var util=require(_0x0c36('0x1'));var path=require(_0x0c36('0x2'));var timeout=require(_0x0c36('0x3'));var express=require(_0x0c36('0x4'));var router=express[_0x0c36('0x5')]();var fs_extra=require(_0x0c36('0x6'));var auth=require(_0x0c36('0x7'));var interaction=require(_0x0c36('0x8'));var config=require(_0x0c36('0x9'));var controller=require(_0x0c36('0xa'));router[_0x0c36('0xb')]('/',auth['isAuthenticated'](),controller[_0x0c36('0xc')]);router['get'](_0x0c36('0xd'),auth[_0x0c36('0xe')](),controller['show']);router[_0x0c36('0xb')]('/:id/items',auth[_0x0c36('0xe')](),controller['getItems']);router[_0x0c36('0xf')]('/',auth[_0x0c36('0xe')](),controller[_0x0c36('0x10')]);router['post'](_0x0c36('0x11'),auth[_0x0c36('0xe')](),controller['clone']);router['post'](_0x0c36('0x12'),auth[_0x0c36('0xe')](),controller[_0x0c36('0x13')]);router[_0x0c36('0x14')](_0x0c36('0xd'),auth[_0x0c36('0xe')](),controller[_0x0c36('0x15')]);router[_0x0c36('0x16')](_0x0c36('0xd'),auth[_0x0c36('0xe')](),controller[_0x0c36('0x17')]);module[_0x0c36('0x18')]=router;
\ No newline at end of file
+var _0x2e72=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index','get','show','/:id/items','getItems','create','post','/:id/clone','clone','put','update','delete','/:id','destroy','exports','multer'];(function(_0x1ef921,_0x455f2b){var _0x2e945e=function(_0x3c075e){while(--_0x3c075e){_0x1ef921['push'](_0x1ef921['shift']());}};_0x2e945e(++_0x455f2b);}(_0x2e72,0x18f));var _0x22e7=function(_0x53f04f,_0x419aa8){_0x53f04f=_0x53f04f-0x0;var _0x16a824=_0x2e72[_0x53f04f];return _0x16a824;};'use strict';var multer=require(_0x22e7('0x0'));var util=require(_0x22e7('0x1'));var path=require(_0x22e7('0x2'));var timeout=require(_0x22e7('0x3'));var express=require('express');var router=express[_0x22e7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x22e7('0x5'));var interaction=require(_0x22e7('0x6'));var config=require(_0x22e7('0x7'));var controller=require(_0x22e7('0x8'));router['get']('/',auth[_0x22e7('0x9')](),controller[_0x22e7('0xa')]);router[_0x22e7('0xb')]('/:id',auth[_0x22e7('0x9')](),controller[_0x22e7('0xc')]);router[_0x22e7('0xb')](_0x22e7('0xd'),auth[_0x22e7('0x9')](),controller[_0x22e7('0xe')]);router['post']('/',auth[_0x22e7('0x9')](),controller[_0x22e7('0xf')]);router[_0x22e7('0x10')](_0x22e7('0x11'),auth[_0x22e7('0x9')](),controller[_0x22e7('0x12')]);router[_0x22e7('0x10')]('/:id/items',auth[_0x22e7('0x9')](),controller['addItem']);router[_0x22e7('0x13')]('/:id',auth[_0x22e7('0x9')](),controller[_0x22e7('0x14')]);router[_0x22e7('0x15')](_0x22e7('0x16'),auth[_0x22e7('0x9')](),controller[_0x22e7('0x17')]);module[_0x22e7('0x18')]=router;
\ No newline at end of file
index 6285fc1..40003bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1883=['stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue'];(function(_0x296754,_0x5befe9){var _0x1d9f1d=function(_0x3f033e){while(--_0x3f033e){_0x296754['push'](_0x296754['shift']());}};_0x1d9f1d(++_0x5befe9);}(_0x1883,0xab));var _0x3188=function(_0x3eedb9,_0x374b89){_0x3eedb9=_0x3eedb9-0x0;var _0x2c276c=_0x1883[_0x3eedb9];return _0x2c276c;};'use strict';var Sequelize=require(_0x3188('0x0'));var squel=require(_0x3188('0x1'));var _=require(_0x3188('0x2'));module[_0x3188('0x3')]={'title':{'type':Sequelize[_0x3188('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x3188('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x3188('0x5')](_0x3188('0x6')),'get':function(){try{return JSON[_0x3188('0x7')](this[_0x3188('0x8')](_0x3188('0x9')));}catch(_0x345612){return[];}},'set':function(_0x408ae0){try{this[_0x3188('0xa')](_0x3188('0x9'),JSON[_0x3188('0xb')](_0x408ae0));}catch(_0x3e3afb){this['setDataValue'](_0x3188('0x9'),JSON[_0x3188('0xb')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x3188('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x3188('0xc')]},'background':{'type':Sequelize[_0x3188('0x4')],'allowNull':![],'defaultValue':_0x3188('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x3188('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x3188('0x4')]},'titleFontSize':{'type':Sequelize[_0x3188('0xc')],'defaultValue':0xc}};
\ No newline at end of file
+var _0x814b=['lodash','exports','STRING','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel'];(function(_0x6bbb11,_0x44e6b5){var _0x4c4dc3=function(_0x1307e8){while(--_0x1307e8){_0x6bbb11['push'](_0x6bbb11['shift']());}};_0x4c4dc3(++_0x44e6b5);}(_0x814b,0x1a2));var _0xb814=function(_0x596c43,_0x28647a){_0x596c43=_0x596c43-0x0;var _0x4e1315=_0x814b[_0x596c43];return _0x4e1315;};'use strict';var Sequelize=require(_0xb814('0x0'));var squel=require(_0xb814('0x1'));var _=require(_0xb814('0x2'));module[_0xb814('0x3')]={'title':{'type':Sequelize[_0xb814('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xb814('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xb814('0x5')),'get':function(){try{return JSON[_0xb814('0x6')](this[_0xb814('0x7')](_0xb814('0x8')));}catch(_0x44931c){return[];}},'set':function(_0x322a70){try{this['setDataValue'](_0xb814('0x8'),JSON[_0xb814('0x9')](_0x322a70));}catch(_0x5c8539){this[_0xb814('0xa')](_0xb814('0x8'),JSON[_0xb814('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0xb814('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xb814('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xb814('0xb')]},'col':{'type':Sequelize[_0xb814('0xb')]},'background':{'type':Sequelize[_0xb814('0x4')],'allowNull':![],'defaultValue':_0xb814('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xb814('0x4')],'allowNull':![],'defaultValue':_0xb814('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xb814('0xb')],'defaultValue':0xc}};
\ No newline at end of file
index 0c945de..5d057d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6808=['attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','end','error','name','send','show','params','model','DashboardItem','rawAttributes','query','keys','filters','intersection','attributes','fields','length','include','merge','options','catch','destroy','type','iframe','attrUrl','attrs','value','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6808,0xd1));var _0x8680=function(_0x89efd1,_0xe83371){_0x89efd1=_0x89efd1-0x0;var _0x3af8f=_0x6808[_0x89efd1];return _0x3af8f;};'use strict';var emlformat=require(_0x8680('0x0'));var rimraf=require(_0x8680('0x1'));var zipdir=require(_0x8680('0x2'));var jsonpatch=require(_0x8680('0x3'));var rp=require(_0x8680('0x4'));var moment=require(_0x8680('0x5'));var BPromise=require(_0x8680('0x6'));var Mustache=require(_0x8680('0x7'));var util=require('util');var path=require(_0x8680('0x8'));var sox=require(_0x8680('0x9'));var csv=require(_0x8680('0xa'));var ejs=require(_0x8680('0xb'));var fs=require('fs');var fs_extra=require(_0x8680('0xc'));var _=require('lodash');var squel=require(_0x8680('0xd'));var crypto=require(_0x8680('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8680('0xa'));var querystring=require(_0x8680('0xf'));var Papa=require('papaparse');var Redis=require(_0x8680('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8680('0x11'));var logger=require(_0x8680('0x12'))(_0x8680('0x13'));var utils=require(_0x8680('0x14'));var config=require(_0x8680('0x15'));var licenseUtil=require(_0x8680('0x16'));var db=require(_0x8680('0x17'))['db'];config['redis']=_['defaults'](config[_0x8680('0x18')],{'host':_0x8680('0x19'),'port':0x18eb});var socket=require(_0x8680('0x1a'))(new Redis(config['redis']));require(_0x8680('0x1b'))[_0x8680('0x1c')](socket);function respondWithStatusCode(_0x3951ee,_0x36a2b9){_0x36a2b9=_0x36a2b9||0xcc;return function(_0x4707e6){if(_0x4707e6){return _0x3951ee[_0x8680('0x1d')](_0x36a2b9);}return _0x3951ee[_0x8680('0x1e')](_0x36a2b9)['end']();};}function respondWithResult(_0x42fb98,_0x5d6737){_0x5d6737=_0x5d6737||0xc8;return function(_0x2f5bcb){if(_0x2f5bcb){return _0x42fb98['status'](_0x5d6737)[_0x8680('0x1f')](_0x2f5bcb);}};}function respondWithFilteredResult(_0x3d2443,_0x5184ea){return function(_0x2b1d1f){if(_0x2b1d1f){var _0x90fbd7=typeof _0x5184ea[_0x8680('0x20')]==='undefined'&&typeof _0x5184ea['limit']===_0x8680('0x21');var _0x25929e=_0x2b1d1f[_0x8680('0x22')];var _0x1db50f=_0x90fbd7?0x0:_0x5184ea[_0x8680('0x20')];var _0x42938b=_0x90fbd7?_0x2b1d1f[_0x8680('0x22')]:_0x5184ea[_0x8680('0x20')]+_0x5184ea['limit'];var _0x29fdef;if(_0x42938b>=_0x25929e){_0x42938b=_0x25929e;_0x29fdef=0xc8;}else{_0x29fdef=0xce;}_0x3d2443['status'](_0x29fdef);return _0x3d2443[_0x8680('0x23')](_0x8680('0x24'),_0x1db50f+'-'+_0x42938b+'/'+_0x25929e)[_0x8680('0x1f')](_0x2b1d1f);}return null;};}function patchUpdates(_0x5b247a){return function(_0xc3977){try{jsonpatch[_0x8680('0x25')](_0xc3977,_0x5b247a,!![]);}catch(_0x25f5db){return BPromise[_0x8680('0x26')](_0x25f5db);}return _0xc3977[_0x8680('0x27')]();};}function saveUpdates(_0x692a22,_0x60feaf){return function(_0x20aec2){if(_0x20aec2){return _0x20aec2[_0x8680('0x28')](_0x692a22)[_0x8680('0x29')](function(_0xd6b559){return _0xd6b559;});}return null;};}function removeEntity(_0x12bf2a,_0x41e4a0){return function(_0x335c62){if(_0x335c62){return _0x335c62['destroy']()[_0x8680('0x29')](function(){_0x12bf2a[_0x8680('0x1e')](0xcc)[_0x8680('0x2a')]();});}};}function handleEntityNotFound(_0x2796d3,_0x1c4540){return function(_0xbc82ac){if(!_0xbc82ac){_0x2796d3[_0x8680('0x1d')](0x194);}return _0xbc82ac;};}function handleError(_0x52bedf,_0x388856){_0x388856=_0x388856||0x1f4;return function(_0x5c2458){logger[_0x8680('0x2b')](_0x5c2458['stack']);if(_0x5c2458[_0x8680('0x2c')]){delete _0x5c2458[_0x8680('0x2c')];}_0x52bedf[_0x8680('0x1e')](_0x388856)[_0x8680('0x2d')](_0x5c2458);};}exports[_0x8680('0x2e')]=function(_0x3d44b4,_0x9abf44){var _0x1c98f3={'raw':![],'where':{'id':_0x3d44b4[_0x8680('0x2f')]['id']}},_0x11cbb7={};_0x11cbb7[_0x8680('0x30')]=_['keys'](db[_0x8680('0x31')][_0x8680('0x32')]);_0x11cbb7[_0x8680('0x33')]=_[_0x8680('0x34')](_0x3d44b4[_0x8680('0x33')]);_0x11cbb7[_0x8680('0x35')]=_[_0x8680('0x36')](_0x11cbb7['model'],_0x11cbb7['query']);_0x1c98f3[_0x8680('0x37')]=_[_0x8680('0x36')](_0x11cbb7[_0x8680('0x30')],qs[_0x8680('0x38')](_0x3d44b4[_0x8680('0x33')][_0x8680('0x38')]));_0x1c98f3[_0x8680('0x37')]=_0x1c98f3[_0x8680('0x37')][_0x8680('0x39')]?_0x1c98f3[_0x8680('0x37')]:_0x11cbb7['model'];if(_0x3d44b4[_0x8680('0x33')]['includeAll']){_0x1c98f3[_0x8680('0x3a')]=[{'all':!![]}];}_0x1c98f3=_[_0x8680('0x3b')]({},_0x1c98f3,_0x3d44b4[_0x8680('0x3c')]);return db['DashboardItem']['find'](_0x1c98f3)[_0x8680('0x29')](handleEntityNotFound(_0x9abf44,null))[_0x8680('0x29')](respondWithResult(_0x9abf44,null))[_0x8680('0x3d')](handleError(_0x9abf44,null));};exports[_0x8680('0x3e')]=function(_0x432b36,_0x273b65){return db[_0x8680('0x31')]['find']({'where':{'id':_0x432b36[_0x8680('0x2f')]['id']}})[_0x8680('0x29')](handleEntityNotFound(_0x273b65,null))['then'](removeEntity(_0x273b65,null))['catch'](handleError(_0x273b65,null));};function widgetAttributes(_0xf6743f){try{switch(_0xf6743f[_0x8680('0x3f')]){case _0x8680('0x40'):return[{'name':_0x8680('0x41'),'value':_0xf6743f[_0x8680('0x41')]||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f[_0x8680('0x42')][0x0]?_0xf6743f[_0x8680('0x42')][0x0][_0x8680('0x43')]:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0xf6743f[_0x8680('0x44')]||(_0xf6743f['attrs']&&_0xf6743f[_0x8680('0x42')][0x0]?_0xf6743f['attrs'][0x0][_0x8680('0x43')]:undefined)||''}];case'clock':return[{'name':_0x8680('0x45'),'value':_0xf6743f[_0x8680('0x45')]||(_0xf6743f['attrs']&&_0xf6743f['attrs'][0x0]?_0xf6743f[_0x8680('0x42')][0x0]['value']:undefined)||_0x8680('0x46')},{'name':_0x8680('0x47'),'value':_0xf6743f[_0x8680('0x47')]||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f[_0x8680('0x42')][0x1]?_0xf6743f[_0x8680('0x42')][0x1][_0x8680('0x43')]:undefined)||_0x8680('0x48')},{'name':_0x8680('0x49'),'value':_0xf6743f[_0x8680('0x49')]||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f[_0x8680('0x42')][0x2]?_0xf6743f[_0x8680('0x42')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x8680('0x4a'),'value':_0xf6743f[_0x8680('0x4a')]||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f['attrs'][0x0]?_0xf6743f[_0x8680('0x42')][0x0][_0x8680('0x43')]:undefined)||_0x8680('0x4b')},{'name':'attrVoiceQueues','value':_0xf6743f[_0x8680('0x4c')]||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f[_0x8680('0x42')][0x1]?_0xf6743f[_0x8680('0x42')][0x1][_0x8680('0x43')]:undefined)||[]},{'name':_0x8680('0x49'),'value':_0xf6743f[_0x8680('0x49')]||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f[_0x8680('0x42')][0x2]?_0xf6743f[_0x8680('0x42')][0x2][_0x8680('0x43')]:undefined)||0x14},{'name':_0x8680('0x4d'),'value':_0xf6743f[_0x8680('0x4d')]||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f[_0x8680('0x42')][0x3]?_0xf6743f[_0x8680('0x42')][0x3][_0x8680('0x43')]:undefined)||_0x8680('0x4e')},{'name':_0x8680('0x4f'),'value':_0xf6743f[_0x8680('0x4f')]||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f[_0x8680('0x42')][0x4]?_0xf6743f[_0x8680('0x42')][0x4][_0x8680('0x43')]:undefined)||''},{'name':_0x8680('0x50'),'value':_0xf6743f['attrFaxAccounts']||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f[_0x8680('0x42')][0x5]?_0xf6743f[_0x8680('0x42')][0x5][_0x8680('0x43')]:undefined)||''},{'name':'attrSmsAccounts','value':_0xf6743f[_0x8680('0x51')]||(_0xf6743f['attrs']&&_0xf6743f[_0x8680('0x42')][0x6]?_0xf6743f['attrs'][0x6][_0x8680('0x43')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0xf6743f[_0x8680('0x52')]||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f[_0x8680('0x42')][0x7]?_0xf6743f[_0x8680('0x42')][0x7][_0x8680('0x43')]:undefined)||''},{'name':_0x8680('0x53'),'value':_0xf6743f[_0x8680('0x53')]||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f['attrs'][0x8]?_0xf6743f[_0x8680('0x42')][0x8]['value']:undefined)||''},{'name':'attrChatWebsites','value':_0xf6743f[_0x8680('0x54')]||(_0xf6743f['attrs']&&_0xf6743f['attrs'][0x9]?_0xf6743f['attrs'][0x9][_0x8680('0x43')]:undefined)||''}];case _0x8680('0x55'):case _0x8680('0x56'):return[{'name':_0x8680('0x57'),'value':_0xf6743f['attrSerie1']||(_0xf6743f['attrs']&&_0xf6743f[_0x8680('0x42')][0x0]?_0xf6743f[_0x8680('0x42')][0x0][_0x8680('0x43')]:undefined)||_0x8680('0x4b')},{'name':_0x8680('0x58'),'value':_0xf6743f[_0x8680('0x58')]||(_0xf6743f['attrs']&&_0xf6743f[_0x8680('0x42')][0x1]?_0xf6743f['attrs'][0x1][_0x8680('0x43')]:undefined)||null},{'name':_0x8680('0x59'),'value':_0xf6743f['attrSerie3']||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f[_0x8680('0x42')][0x2]?_0xf6743f[_0x8680('0x42')][0x2]['value']:undefined)||null},{'name':_0x8680('0x4c'),'value':_0xf6743f['attrVoiceQueues']||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f[_0x8680('0x42')][0x3]?_0xf6743f[_0x8680('0x42')][0x3][_0x8680('0x43')]:undefined)||[]},{'name':'attrChannel','value':_0xf6743f[_0x8680('0x4d')]||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f['attrs'][0x4]?_0xf6743f['attrs'][0x4][_0x8680('0x43')]:undefined)||_0x8680('0x4e')},{'name':_0x8680('0x4f'),'value':_0xf6743f[_0x8680('0x4f')]||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f[_0x8680('0x42')][0x5]?_0xf6743f[_0x8680('0x42')][0x5][_0x8680('0x43')]:undefined)||''},{'name':_0x8680('0x50'),'value':_0xf6743f[_0x8680('0x50')]||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f[_0x8680('0x42')][0x6]?_0xf6743f[_0x8680('0x42')][0x6][_0x8680('0x43')]:undefined)||''},{'name':_0x8680('0x51'),'value':_0xf6743f['attrSmsAccounts']||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f[_0x8680('0x42')][0x7]?_0xf6743f[_0x8680('0x42')][0x7][_0x8680('0x43')]:undefined)||''},{'name':_0x8680('0x52'),'value':_0xf6743f['attrOpenchannelAccounts']||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f[_0x8680('0x42')][0x8]?_0xf6743f['attrs'][0x8][_0x8680('0x43')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0xf6743f[_0x8680('0x53')]||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f[_0x8680('0x42')][0x9]?_0xf6743f[_0x8680('0x42')][0x9][_0x8680('0x43')]:undefined)||''},{'name':_0x8680('0x54'),'value':_0xf6743f[_0x8680('0x54')]||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f['attrs'][0xa]?_0xf6743f[_0x8680('0x42')][0xa][_0x8680('0x43')]:undefined)||''}];case _0x8680('0x5a'):return[{'name':_0x8680('0x5b'),'type':_0xf6743f[_0x8680('0x5c')]||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f[_0x8680('0x42')][0x0]?_0xf6743f['attrs'][0x0]['type']:undefined)||null,'value':_0xf6743f['attrReport']||(_0xf6743f[_0x8680('0x42')]&&_0xf6743f[_0x8680('0x42')][0x0]?_0xf6743f[_0x8680('0x42')][0x0][_0x8680('0x43')]:undefined)||null},{'name':_0x8680('0x5d'),'value':_0xf6743f[_0x8680('0x5d')]||(_0xf6743f['attrs']&&_0xf6743f[_0x8680('0x42')][0x1]?_0xf6743f[_0x8680('0x42')][0x1][_0x8680('0x43')]:undefined)||0x0}];default:return[];}}catch(_0x3bc5f5){logger[_0x8680('0x2b')](_0x8680('0x5e'),JSON[_0x8680('0x5f')](_0x3bc5f5));return[];}}exports['create']=function(_0x401200,_0x1826c8){if(_0x401200[_0x8680('0x60')]){_0x401200[_0x8680('0x60')]['attrs']=widgetAttributes(_0x401200[_0x8680('0x60')]);}return db[_0x8680('0x31')][_0x8680('0x61')](_0x401200[_0x8680('0x60')],{})[_0x8680('0x29')](respondWithResult(_0x1826c8,0xc9))[_0x8680('0x3d')](handleError(_0x1826c8,null));};exports[_0x8680('0x28')]=function(_0x3970b7,_0x43bae5){if(_0x3970b7[_0x8680('0x60')]['id']){delete _0x3970b7[_0x8680('0x60')]['id'];}_0x3970b7[_0x8680('0x60')]['attrs']=widgetAttributes(_0x3970b7[_0x8680('0x60')]);return db[_0x8680('0x31')][_0x8680('0x62')]({'where':{'id':_0x3970b7[_0x8680('0x2f')]['id']}})['then'](handleEntityNotFound(_0x43bae5,null))['then'](saveUpdates(_0x3970b7[_0x8680('0x60')],null))[_0x8680('0x29')](respondWithResult(_0x43bae5,null))[_0x8680('0x3d')](handleError(_0x43bae5,null));};
\ No newline at end of file
+var _0x770d=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','show','params','model','rawAttributes','query','filters','intersection','attributes','fields','length','include','options','DashboardItem','find','catch','type','iframe','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','total','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','body','create','update','eml-format'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x770d,0x122));var _0xd770=function(_0xb68666,_0x31137a){_0xb68666=_0xb68666-0x0;var _0x5b199e=_0x770d[_0xb68666];return _0x5b199e;};'use strict';var emlformat=require(_0xd770('0x0'));var rimraf=require(_0xd770('0x1'));var zipdir=require(_0xd770('0x2'));var jsonpatch=require(_0xd770('0x3'));var rp=require(_0xd770('0x4'));var moment=require(_0xd770('0x5'));var BPromise=require(_0xd770('0x6'));var Mustache=require('mustache');var util=require(_0xd770('0x7'));var path=require(_0xd770('0x8'));var sox=require(_0xd770('0x9'));var csv=require(_0xd770('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd770('0xb'));var squel=require(_0xd770('0xc'));var crypto=require(_0xd770('0xd'));var jsforce=require(_0xd770('0xe'));var deskjs=require(_0xd770('0xf'));var toCsv=require(_0xd770('0xa'));var querystring=require(_0xd770('0x10'));var Papa=require('papaparse');var Redis=require(_0xd770('0x11'));var authService=require(_0xd770('0x12'));var qs=require(_0xd770('0x13'));var as=require(_0xd770('0x14'));var hardwareService=require(_0xd770('0x15'));var logger=require('../../config/logger')(_0xd770('0x16'));var utils=require(_0xd770('0x17'));var config=require(_0xd770('0x18'));var licenseUtil=require(_0xd770('0x19'));var db=require(_0xd770('0x1a'))['db'];config[_0xd770('0x1b')]=_[_0xd770('0x1c')](config[_0xd770('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd770('0x1b')]));require(_0xd770('0x1d'))[_0xd770('0x1e')](socket);function respondWithStatusCode(_0x4561bb,_0x51dacf){_0x51dacf=_0x51dacf||0xcc;return function(_0x2f6832){if(_0x2f6832){return _0x4561bb[_0xd770('0x1f')](_0x51dacf);}return _0x4561bb[_0xd770('0x20')](_0x51dacf)[_0xd770('0x21')]();};}function respondWithResult(_0x47a84f,_0xb759ea){_0xb759ea=_0xb759ea||0xc8;return function(_0x58017e){if(_0x58017e){return _0x47a84f[_0xd770('0x20')](_0xb759ea)[_0xd770('0x22')](_0x58017e);}};}function respondWithFilteredResult(_0x38c57d,_0x3040c6){return function(_0x1ed1b5){if(_0x1ed1b5){var _0x38f458=typeof _0x3040c6[_0xd770('0x23')]===_0xd770('0x24')&&typeof _0x3040c6[_0xd770('0x25')]==='undefined';var _0x22968f=_0x1ed1b5['count'];var _0x143ee1=_0x38f458?0x0:_0x3040c6['offset'];var _0x28ac07=_0x38f458?_0x1ed1b5[_0xd770('0x26')]:_0x3040c6[_0xd770('0x23')]+_0x3040c6[_0xd770('0x25')];var _0x434c4f;if(_0x28ac07>=_0x22968f){_0x28ac07=_0x22968f;_0x434c4f=0xc8;}else{_0x434c4f=0xce;}_0x38c57d['status'](_0x434c4f);return _0x38c57d[_0xd770('0x27')](_0xd770('0x28'),_0x143ee1+'-'+_0x28ac07+'/'+_0x22968f)['json'](_0x1ed1b5);}return null;};}function patchUpdates(_0x3c0aa8){return function(_0x21dc92){try{jsonpatch[_0xd770('0x29')](_0x21dc92,_0x3c0aa8,!![]);}catch(_0x1b9aa4){return BPromise['reject'](_0x1b9aa4);}return _0x21dc92[_0xd770('0x2a')]();};}function saveUpdates(_0xdfb694,_0x1b404d){return function(_0x398ebf){if(_0x398ebf){return _0x398ebf['update'](_0xdfb694)[_0xd770('0x2b')](function(_0xa58995){return _0xa58995;});}return null;};}function removeEntity(_0x4f64df,_0x4cc1e3){return function(_0x330447){if(_0x330447){return _0x330447[_0xd770('0x2c')]()[_0xd770('0x2b')](function(){_0x4f64df[_0xd770('0x20')](0xcc)[_0xd770('0x21')]();});}};}function handleEntityNotFound(_0x112aaf,_0x46bf88){return function(_0x49ef4d){if(!_0x49ef4d){_0x112aaf[_0xd770('0x1f')](0x194);}return _0x49ef4d;};}function handleError(_0x4355e0,_0x589da7){_0x589da7=_0x589da7||0x1f4;return function(_0x56f299){logger[_0xd770('0x2d')](_0x56f299[_0xd770('0x2e')]);if(_0x56f299['name']){delete _0x56f299[_0xd770('0x2f')];}_0x4355e0[_0xd770('0x20')](_0x589da7)[_0xd770('0x30')](_0x56f299);};}exports[_0xd770('0x31')]=function(_0x4969c0,_0x33a2b3){var _0x4e8716={'raw':![],'where':{'id':_0x4969c0[_0xd770('0x32')]['id']}},_0x4c6c2d={};_0x4c6c2d[_0xd770('0x33')]=_['keys'](db['DashboardItem'][_0xd770('0x34')]);_0x4c6c2d[_0xd770('0x35')]=_['keys'](_0x4969c0[_0xd770('0x35')]);_0x4c6c2d[_0xd770('0x36')]=_[_0xd770('0x37')](_0x4c6c2d[_0xd770('0x33')],_0x4c6c2d['query']);_0x4e8716[_0xd770('0x38')]=_['intersection'](_0x4c6c2d[_0xd770('0x33')],qs[_0xd770('0x39')](_0x4969c0[_0xd770('0x35')][_0xd770('0x39')]));_0x4e8716[_0xd770('0x38')]=_0x4e8716[_0xd770('0x38')][_0xd770('0x3a')]?_0x4e8716[_0xd770('0x38')]:_0x4c6c2d['model'];if(_0x4969c0[_0xd770('0x35')]['includeAll']){_0x4e8716[_0xd770('0x3b')]=[{'all':!![]}];}_0x4e8716=_['merge']({},_0x4e8716,_0x4969c0[_0xd770('0x3c')]);return db[_0xd770('0x3d')][_0xd770('0x3e')](_0x4e8716)[_0xd770('0x2b')](handleEntityNotFound(_0x33a2b3,null))[_0xd770('0x2b')](respondWithResult(_0x33a2b3,null))[_0xd770('0x3f')](handleError(_0x33a2b3,null));};exports[_0xd770('0x2c')]=function(_0x15d7d0,_0x129edb){return db[_0xd770('0x3d')][_0xd770('0x3e')]({'where':{'id':_0x15d7d0[_0xd770('0x32')]['id']}})['then'](handleEntityNotFound(_0x129edb,null))[_0xd770('0x2b')](removeEntity(_0x129edb,null))[_0xd770('0x3f')](handleError(_0x129edb,null));};function widgetAttributes(_0x48de84){try{switch(_0x48de84[_0xd770('0x40')]){case _0xd770('0x41'):return[{'name':'attrUrl','value':_0x48de84['attrUrl']||(_0x48de84[_0xd770('0x42')]&&_0x48de84[_0xd770('0x42')][0x0]?_0x48de84['attrs'][0x0][_0xd770('0x43')]:undefined)||_0xd770('0x44')}];case _0xd770('0x45'):return[{'name':_0xd770('0x46'),'value':_0x48de84[_0xd770('0x46')]||(_0x48de84[_0xd770('0x42')]&&_0x48de84[_0xd770('0x42')][0x0]?_0x48de84['attrs'][0x0]['value']:undefined)||''}];case _0xd770('0x47'):return[{'name':_0xd770('0x48'),'value':_0x48de84[_0xd770('0x48')]||(_0x48de84[_0xd770('0x42')]&&_0x48de84[_0xd770('0x42')][0x0]?_0x48de84[_0xd770('0x42')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0xd770('0x49'),'value':_0x48de84[_0xd770('0x49')]||(_0x48de84[_0xd770('0x42')]&&_0x48de84[_0xd770('0x42')][0x1]?_0x48de84['attrs'][0x1][_0xd770('0x43')]:undefined)||'0.00'},{'name':_0xd770('0x4a'),'value':_0x48de84['attrFontSize']||(_0x48de84[_0xd770('0x42')]&&_0x48de84['attrs'][0x2]?_0x48de84[_0xd770('0x42')][0x2][_0xd770('0x43')]:undefined)||0xc}];case _0xd770('0x4b'):return[{'name':_0xd770('0x4c'),'value':_0x48de84[_0xd770('0x4c')]||(_0x48de84[_0xd770('0x42')]&&_0x48de84[_0xd770('0x42')][0x0]?_0x48de84[_0xd770('0x42')][0x0][_0xd770('0x43')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x48de84[_0xd770('0x4d')]||(_0x48de84['attrs']&&_0x48de84[_0xd770('0x42')][0x1]?_0x48de84[_0xd770('0x42')][0x1][_0xd770('0x43')]:undefined)||[]},{'name':_0xd770('0x4a'),'value':_0x48de84['attrFontSize']||(_0x48de84[_0xd770('0x42')]&&_0x48de84[_0xd770('0x42')][0x2]?_0x48de84[_0xd770('0x42')][0x2][_0xd770('0x43')]:undefined)||0x14},{'name':_0xd770('0x4e'),'value':_0x48de84[_0xd770('0x4e')]||(_0x48de84[_0xd770('0x42')]&&_0x48de84[_0xd770('0x42')][0x3]?_0x48de84['attrs'][0x3][_0xd770('0x43')]:undefined)||_0xd770('0x4f')},{'name':_0xd770('0x50'),'value':_0x48de84[_0xd770('0x50')]||(_0x48de84[_0xd770('0x42')]&&_0x48de84['attrs'][0x4]?_0x48de84[_0xd770('0x42')][0x4][_0xd770('0x43')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x48de84[_0xd770('0x51')]||(_0x48de84[_0xd770('0x42')]&&_0x48de84['attrs'][0x5]?_0x48de84[_0xd770('0x42')][0x5][_0xd770('0x43')]:undefined)||''},{'name':_0xd770('0x52'),'value':_0x48de84[_0xd770('0x52')]||(_0x48de84['attrs']&&_0x48de84[_0xd770('0x42')][0x6]?_0x48de84[_0xd770('0x42')][0x6][_0xd770('0x43')]:undefined)||''},{'name':_0xd770('0x53'),'value':_0x48de84[_0xd770('0x53')]||(_0x48de84[_0xd770('0x42')]&&_0x48de84[_0xd770('0x42')][0x7]?_0x48de84['attrs'][0x7][_0xd770('0x43')]:undefined)||''},{'name':_0xd770('0x54'),'value':_0x48de84[_0xd770('0x54')]||(_0x48de84['attrs']&&_0x48de84[_0xd770('0x42')][0x8]?_0x48de84[_0xd770('0x42')][0x8]['value']:undefined)||''},{'name':_0xd770('0x55'),'value':_0x48de84['attrChatWebsites']||(_0x48de84[_0xd770('0x42')]&&_0x48de84[_0xd770('0x42')][0x9]?_0x48de84[_0xd770('0x42')][0x9][_0xd770('0x43')]:undefined)||''}];case _0xd770('0x56'):case _0xd770('0x57'):return[{'name':'attrSerie1','value':_0x48de84['attrSerie1']||(_0x48de84['attrs']&&_0x48de84[_0xd770('0x42')][0x0]?_0x48de84[_0xd770('0x42')][0x0][_0xd770('0x43')]:undefined)||_0xd770('0x58')},{'name':_0xd770('0x59'),'value':_0x48de84['attrSerie2']||(_0x48de84[_0xd770('0x42')]&&_0x48de84[_0xd770('0x42')][0x1]?_0x48de84[_0xd770('0x42')][0x1][_0xd770('0x43')]:undefined)||null},{'name':_0xd770('0x5a'),'value':_0x48de84[_0xd770('0x5a')]||(_0x48de84[_0xd770('0x42')]&&_0x48de84[_0xd770('0x42')][0x2]?_0x48de84['attrs'][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x48de84[_0xd770('0x4d')]||(_0x48de84[_0xd770('0x42')]&&_0x48de84[_0xd770('0x42')][0x3]?_0x48de84['attrs'][0x3][_0xd770('0x43')]:undefined)||[]},{'name':_0xd770('0x4e'),'value':_0x48de84[_0xd770('0x4e')]||(_0x48de84['attrs']&&_0x48de84[_0xd770('0x42')][0x4]?_0x48de84['attrs'][0x4][_0xd770('0x43')]:undefined)||_0xd770('0x4f')},{'name':_0xd770('0x50'),'value':_0x48de84[_0xd770('0x50')]||(_0x48de84[_0xd770('0x42')]&&_0x48de84[_0xd770('0x42')][0x5]?_0x48de84['attrs'][0x5][_0xd770('0x43')]:undefined)||''},{'name':_0xd770('0x51'),'value':_0x48de84[_0xd770('0x51')]||(_0x48de84[_0xd770('0x42')]&&_0x48de84[_0xd770('0x42')][0x6]?_0x48de84['attrs'][0x6][_0xd770('0x43')]:undefined)||''},{'name':_0xd770('0x52'),'value':_0x48de84[_0xd770('0x52')]||(_0x48de84[_0xd770('0x42')]&&_0x48de84['attrs'][0x7]?_0x48de84[_0xd770('0x42')][0x7]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x48de84[_0xd770('0x53')]||(_0x48de84[_0xd770('0x42')]&&_0x48de84['attrs'][0x8]?_0x48de84[_0xd770('0x42')][0x8][_0xd770('0x43')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x48de84[_0xd770('0x54')]||(_0x48de84[_0xd770('0x42')]&&_0x48de84[_0xd770('0x42')][0x9]?_0x48de84['attrs'][0x9][_0xd770('0x43')]:undefined)||''},{'name':'attrChatWebsites','value':_0x48de84[_0xd770('0x55')]||(_0x48de84[_0xd770('0x42')]&&_0x48de84[_0xd770('0x42')][0xa]?_0x48de84['attrs'][0xa][_0xd770('0x43')]:undefined)||''}];case'web-report':return[{'name':_0xd770('0x5b'),'type':_0x48de84[_0xd770('0x5c')]||(_0x48de84[_0xd770('0x42')]&&_0x48de84[_0xd770('0x42')][0x0]?_0x48de84[_0xd770('0x42')][0x0][_0xd770('0x40')]:undefined)||null,'value':_0x48de84[_0xd770('0x5b')]||(_0x48de84[_0xd770('0x42')]&&_0x48de84['attrs'][0x0]?_0x48de84[_0xd770('0x42')][0x0][_0xd770('0x43')]:undefined)||null},{'name':'attrRefresh','value':_0x48de84[_0xd770('0x5d')]||(_0x48de84[_0xd770('0x42')]&&_0x48de84[_0xd770('0x42')][0x1]?_0x48de84['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0xa074dc){logger['error']('widgetAttributes:\x20%s',JSON['stringify'](_0xa074dc));return[];}}exports['create']=function(_0x95b383,_0x57d5a2){if(_0x95b383[_0xd770('0x5e')]){_0x95b383[_0xd770('0x5e')]['attrs']=widgetAttributes(_0x95b383[_0xd770('0x5e')]);}return db[_0xd770('0x3d')][_0xd770('0x5f')](_0x95b383[_0xd770('0x5e')],{})[_0xd770('0x2b')](respondWithResult(_0x57d5a2,0xc9))['catch'](handleError(_0x57d5a2,null));};exports[_0xd770('0x60')]=function(_0x4da71a,_0x3f10b3){if(_0x4da71a[_0xd770('0x5e')]['id']){delete _0x4da71a[_0xd770('0x5e')]['id'];}_0x4da71a[_0xd770('0x5e')][_0xd770('0x42')]=widgetAttributes(_0x4da71a[_0xd770('0x5e')]);return db[_0xd770('0x3d')][_0xd770('0x3e')]({'where':{'id':_0x4da71a[_0xd770('0x32')]['id']}})['then'](handleEntityNotFound(_0x3f10b3,null))[_0xd770('0x2b')](saveUpdates(_0x4da71a[_0xd770('0x5e')],null))['then'](respondWithResult(_0x3f10b3,null))[_0xd770('0x3f')](handleError(_0x3f10b3,null));};
\ No newline at end of file
index 99ecbc3..269eb83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c8f=['update','emit','hasOwnProperty','hook','events','../../mysqldb','DashboardItem','setMaxListeners','save'];(function(_0x4bf4d0,_0x31c460){var _0x3782f5=function(_0x1c6f8a){while(--_0x1c6f8a){_0x4bf4d0['push'](_0x4bf4d0['shift']());}};_0x3782f5(++_0x31c460);}(_0x7c8f,0xee));var _0xf7c8=function(_0x55d4fe,_0x49af91){_0x55d4fe=_0x55d4fe-0x0;var _0x542488=_0x7c8f[_0x55d4fe];return _0x542488;};'use strict';var EventEmitter=require(_0xf7c8('0x0'));var DashboardItem=require(_0xf7c8('0x1'))['db'][_0xf7c8('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xf7c8('0x3')](0x0);var events={'afterCreate':_0xf7c8('0x4'),'afterUpdate':_0xf7c8('0x5'),'afterDestroy':'remove'};function emitEvent(_0x31658c){return function(_0x404a01,_0x54434b,_0xfbeba){DashboardItemEvents[_0xf7c8('0x6')](_0x31658c+':'+_0x404a01['id'],_0x404a01);DashboardItemEvents[_0xf7c8('0x6')](_0x31658c,_0x404a01);_0xfbeba(null);};}for(var e in events){if(events[_0xf7c8('0x7')](e)){var event=events[e];DashboardItem[_0xf7c8('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
+var _0x161a=['update','emit','hasOwnProperty','hook','exports','DashboardItem','setMaxListeners'];(function(_0x2ce007,_0x38e5bf){var _0x5a2395=function(_0x2f8ffe){while(--_0x2f8ffe){_0x2ce007['push'](_0x2ce007['shift']());}};_0x5a2395(++_0x38e5bf);}(_0x161a,0x140));var _0xa161=function(_0x4d2f00,_0x4e94d5){_0x4d2f00=_0x4d2f00-0x0;var _0x2d7b7f=_0x161a[_0x4d2f00];return _0x2d7b7f;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0xa161('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xa161('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa161('0x2'),'afterDestroy':'remove'};function emitEvent(_0x302a8f){return function(_0x36340b,_0x50d9b4,_0x551cc8){DashboardItemEvents[_0xa161('0x3')](_0x302a8f+':'+_0x36340b['id'],_0x36340b);DashboardItemEvents[_0xa161('0x3')](_0x302a8f,_0x36340b);_0x551cc8(null);};}for(var e in events){if(events[_0xa161('0x4')](e)){var event=events[e];DashboardItem[_0xa161('0x5')](e,emitEvent(event));}}module[_0xa161('0x6')]=DashboardItemEvents;
\ No newline at end of file
index 58e148d..1b4b760 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe644=['path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xae0c4f,_0x228008){var _0x541443=function(_0x3d2597){while(--_0x3d2597){_0xae0c4f['push'](_0xae0c4f['shift']());}};_0x541443(++_0x228008);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var logger=require(_0x4e64('0x2'))(_0x4e64('0x3'));var moment=require(_0x4e64('0x4'));var BPromise=require(_0x4e64('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e64('0x6'));var rimraf=require(_0x4e64('0x7'));var config=require(_0x4e64('0x8'));var attributes=require(_0x4e64('0x9'));module[_0x4e64('0xa')]=function(_0x13fa90,_0x55c23b){return _0x13fa90[_0x4e64('0xb')](_0x4e64('0xc'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x94c0=['rimraf','../../config/environment','./dashboardItem.attributes','define','DashboardItem','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x1ff3a6,_0x3e3ea4){var _0x297614=function(_0x412ae0){while(--_0x412ae0){_0x1ff3a6['push'](_0x1ff3a6['shift']());}};_0x297614(++_0x3e3ea4);}(_0x94c0,0xaa));var _0x094c=function(_0x352fbf,_0x5d417d){_0x352fbf=_0x352fbf-0x0;var _0x45784a=_0x94c0[_0x352fbf];return _0x45784a;};'use strict';var _=require(_0x094c('0x0'));var util=require(_0x094c('0x1'));var logger=require(_0x094c('0x2'))(_0x094c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x094c('0x4'));var fs=require('fs');var path=require(_0x094c('0x5'));var rimraf=require(_0x094c('0x6'));var config=require(_0x094c('0x7'));var attributes=require(_0x094c('0x8'));module['exports']=function(_0x4e8d3e,_0x1ea415){return _0x4e8d3e[_0x094c('0x9')](_0x094c('0xa'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index feb85aa..0df876b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb36e=['catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x2406b4,_0x2f9771){var _0x7f3752=function(_0x583971){while(--_0x583971){_0x2406b4['push'](_0x2406b4['shift']());}};_0x7f3752(++_0x2f9771);}(_0xb36e,0xeb));var _0xeb36=function(_0x19f3d4,_0x2609e3){_0x19f3d4=_0x19f3d4-0x0;var _0x1e459c=_0xb36e[_0x19f3d4];return _0x1e459c;};'use strict';var _=require('lodash');var util=require(_0xeb36('0x0'));var moment=require(_0xeb36('0x1'));var BPromise=require('bluebird');var rs=require(_0xeb36('0x2'));var fs=require('fs');var Redis=require(_0xeb36('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xeb36('0x4'));var logger=require(_0xeb36('0x5'))(_0xeb36('0x6'));var config=require(_0xeb36('0x7'));var jayson=require(_0xeb36('0x8'));var client=jayson[_0xeb36('0x9')][_0xeb36('0xa')]({'port':0x232a});config[_0xeb36('0xb')]=_[_0xeb36('0xc')](config['redis'],{'host':_0xeb36('0xd'),'port':0x18eb});var socket=require(_0xeb36('0xe'))(new Redis(config['redis']));require(_0xeb36('0xf'))[_0xeb36('0x10')](socket);function respondWithRpcPromise(_0x1b9ec9,_0x168c7d,_0x5c6d1f){return new BPromise(function(_0xeca4ee,_0x3531c5){return client['request'](_0x1b9ec9,_0x5c6d1f)['then'](function(_0x1e105d){logger['info'](_0xeb36('0x11'),_0x168c7d,_0xeb36('0x12'));logger[_0xeb36('0x13')](_0xeb36('0x14'),_0x168c7d,_0xeb36('0x12'),JSON['stringify'](_0x1e105d));if(_0x1e105d['error']){if(_0x1e105d[_0xeb36('0x15')][_0xeb36('0x16')]===0x1f4){logger[_0xeb36('0x15')](_0xeb36('0x11'),_0x168c7d,_0x1e105d[_0xeb36('0x15')][_0xeb36('0x17')]);return _0x3531c5(_0x1e105d[_0xeb36('0x15')][_0xeb36('0x17')]);}logger[_0xeb36('0x15')](_0xeb36('0x11'),_0x168c7d,_0x1e105d[_0xeb36('0x15')][_0xeb36('0x17')]);return _0xeca4ee(_0x1e105d[_0xeb36('0x15')]['message']);}else{logger[_0xeb36('0x18')]('DashboardItem,\x20%s,\x20%s',_0x168c7d,'request\x20sent');_0xeca4ee(_0x1e105d['result'][_0xeb36('0x17')]);}})[_0xeb36('0x19')](function(_0x553864){logger[_0xeb36('0x15')]('DashboardItem,\x20%s,\x20%s',_0x168c7d,_0x553864);_0x3531c5(_0x553864);});});}
\ No newline at end of file
+var _0xf641=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf641,0x70));var _0x1f64=function(_0x20e06e,_0x15a44a){_0x20e06e=_0x20e06e-0x0;var _0x2b2387=_0xf641[_0x20e06e];return _0x2b2387;};'use strict';var _=require(_0x1f64('0x0'));var util=require(_0x1f64('0x1'));var moment=require(_0x1f64('0x2'));var BPromise=require(_0x1f64('0x3'));var rs=require(_0x1f64('0x4'));var fs=require('fs');var Redis=require(_0x1f64('0x5'));var db=require(_0x1f64('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f64('0x7'))(_0x1f64('0x8'));var config=require(_0x1f64('0x9'));var jayson=require(_0x1f64('0xa'));var client=jayson['client'][_0x1f64('0xb')]({'port':0x232a});config[_0x1f64('0xc')]=_['defaults'](config[_0x1f64('0xc')],{'host':_0x1f64('0xd'),'port':0x18eb});var socket=require(_0x1f64('0xe'))(new Redis(config[_0x1f64('0xc')]));require(_0x1f64('0xf'))[_0x1f64('0x10')](socket);function respondWithRpcPromise(_0x514e07,_0x5b168a,_0x5ec204){return new BPromise(function(_0x2f010c,_0x5ddcca){return client[_0x1f64('0x11')](_0x514e07,_0x5ec204)[_0x1f64('0x12')](function(_0x2a1ac5){logger['info'](_0x1f64('0x13'),_0x5b168a,_0x1f64('0x14'));logger[_0x1f64('0x15')](_0x1f64('0x16'),_0x5b168a,_0x1f64('0x14'),JSON['stringify'](_0x2a1ac5));if(_0x2a1ac5[_0x1f64('0x17')]){if(_0x2a1ac5['error'][_0x1f64('0x18')]===0x1f4){logger[_0x1f64('0x17')](_0x1f64('0x13'),_0x5b168a,_0x2a1ac5['error'][_0x1f64('0x19')]);return _0x5ddcca(_0x2a1ac5[_0x1f64('0x17')][_0x1f64('0x19')]);}logger['error'](_0x1f64('0x13'),_0x5b168a,_0x2a1ac5[_0x1f64('0x17')][_0x1f64('0x19')]);return _0x2f010c(_0x2a1ac5['error'][_0x1f64('0x19')]);}else{logger[_0x1f64('0x1a')]('DashboardItem,\x20%s,\x20%s',_0x5b168a,_0x1f64('0x14'));_0x2f010c(_0x2a1ac5[_0x1f64('0x1b')]['message']);}})[_0x1f64('0x1c')](function(_0x53146e){logger[_0x1f64('0x17')](_0x1f64('0x13'),_0x5b168a,_0x53146e);_0x5ddcca(_0x53146e);});});}
\ No newline at end of file
index 6044f67..ab3b919 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe41c=['dashboardItem:','remove','update','register','length'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0xe41c,0x164));var _0xce41=function(_0x3336c8,_0x475c27){_0x3336c8=_0x3336c8-0x0;var _0x17997d=_0xe41c[_0x3336c8];return _0x17997d;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=['save',_0xce41('0x0'),_0xce41('0x1')];function createListener(_0x18849b,_0x56ddbb){return function(_0xf3e369){_0x56ddbb['emit'](_0x18849b,_0xf3e369);};}function removeListener(_0x4cbf39,_0x43b0c4){return function(){DashboardItemEvents['removeListener'](_0x4cbf39,_0x43b0c4);};}exports[_0xce41('0x2')]=function(_0x478ba2){for(var _0x5e4680=0x0,_0x1a6c8f=events[_0xce41('0x3')];_0x5e4680<_0x1a6c8f;_0x5e4680++){var _0x370aea=events[_0x5e4680];var _0x580c8c=createListener(_0xce41('0x4')+_0x370aea,_0x478ba2);DashboardItemEvents['on'](_0x370aea,_0x580c8c);}};
\ No newline at end of file
+var _0x4dce=['update','register','length','dashboardItem:','./dashboardItem.events','remove'];(function(_0x165360,_0x5ca20b){var _0x5acc59=function(_0x4f9d07){while(--_0x4f9d07){_0x165360['push'](_0x165360['shift']());}};_0x5acc59(++_0x5ca20b);}(_0x4dce,0xb2));var _0xe4dc=function(_0x42020e,_0x4b92fb){_0x42020e=_0x42020e-0x0;var _0x561551=_0x4dce[_0x42020e];return _0x561551;};'use strict';var DashboardItemEvents=require(_0xe4dc('0x0'));var events=['save',_0xe4dc('0x1'),_0xe4dc('0x2')];function createListener(_0x1fa527,_0x1e6b78){return function(_0x2c9773){_0x1e6b78['emit'](_0x1fa527,_0x2c9773);};}function removeListener(_0x293dad,_0x30de7c){return function(){DashboardItemEvents['removeListener'](_0x293dad,_0x30de7c);};}exports[_0xe4dc('0x3')]=function(_0x5b10cc){for(var _0x444ffa=0x0,_0x409da1=events[_0xe4dc('0x4')];_0x444ffa<_0x409da1;_0x444ffa++){var _0x460c5e=events[_0x444ffa];var _0x58b1e9=createListener(_0xe4dc('0x5')+_0x460c5e,_0x5b10cc);DashboardItemEvents['on'](_0x460c5e,_0x58b1e9);}};
\ No newline at end of file
index 2f697d4..56c7486 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3ef=['express','Router','../../components/auth/service','../../components/interaction/service','/:id','isAuthenticated','post','create','put','delete','destroy','multer','path','connect-timeout'];(function(_0x43eb6c,_0x576f0a){var _0x5b2792=function(_0x49f4e9){while(--_0x49f4e9){_0x43eb6c['push'](_0x43eb6c['shift']());}};_0x5b2792(++_0x576f0a);}(_0xa3ef,0x13f));var _0xfa3e=function(_0x250d45,_0x2b8706){_0x250d45=_0x250d45-0x0;var _0x543e60=_0xa3ef[_0x250d45];return _0x543e60;};'use strict';var multer=require(_0xfa3e('0x0'));var util=require('util');var path=require(_0xfa3e('0x1'));var timeout=require(_0xfa3e('0x2'));var express=require(_0xfa3e('0x3'));var router=express[_0xfa3e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfa3e('0x5'));var interaction=require(_0xfa3e('0x6'));var config=require('../../config/environment');var controller=require('./dashboardItem.controller');router['get'](_0xfa3e('0x7'),auth[_0xfa3e('0x8')](),controller['show']);router[_0xfa3e('0x9')]('/',auth[_0xfa3e('0x8')](),controller[_0xfa3e('0xa')]);router[_0xfa3e('0xb')]('/:id',auth[_0xfa3e('0x8')](),controller['update']);router[_0xfa3e('0xc')](_0xfa3e('0x7'),auth['isAuthenticated'](),controller[_0xfa3e('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x5907=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','post','create','/:id','delete','destroy','exports','util','path'];(function(_0x243750,_0x16d8f3){var _0x58998b=function(_0x53d83d){while(--_0x53d83d){_0x243750['push'](_0x243750['shift']());}};_0x58998b(++_0x16d8f3);}(_0x5907,0x10e));var _0x7590=function(_0x2b12ad,_0x301715){_0x2b12ad=_0x2b12ad-0x0;var _0x150b0b=_0x5907[_0x2b12ad];return _0x150b0b;};'use strict';var multer=require('multer');var util=require(_0x7590('0x0'));var path=require(_0x7590('0x1'));var timeout=require(_0x7590('0x2'));var express=require(_0x7590('0x3'));var router=express['Router']();var fs_extra=require(_0x7590('0x4'));var auth=require(_0x7590('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7590('0x6'));var controller=require('./dashboardItem.controller');router[_0x7590('0x7')]('/:id',auth[_0x7590('0x8')](),controller[_0x7590('0x9')]);router[_0x7590('0xa')]('/',auth['isAuthenticated'](),controller[_0x7590('0xb')]);router['put'](_0x7590('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x7590('0xd')](_0x7590('0xc'),auth[_0x7590('0x8')](),controller[_0x7590('0xe')]);module[_0x7590('0xf')]=router;
\ No newline at end of file
index 6344d40..926fba4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42a7=['ENUM','first','second','exports','STRING'];(function(_0x2cec07,_0x37a3f8){var _0x99de95=function(_0x54e1b4){while(--_0x54e1b4){_0x2cec07['push'](_0x2cec07['shift']());}};_0x99de95(++_0x37a3f8);}(_0x42a7,0x14d));var _0x742a=function(_0x2acb7a,_0x18bbb3){_0x2acb7a=_0x2acb7a-0x0;var _0x51850e=_0x42a7[_0x2acb7a];return _0x51850e;};'use strict';var Sequelize=require('sequelize');module[_0x742a('0x0')]={'name':{'type':Sequelize[_0x742a('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x742a('0x2')](_0x742a('0x3'),_0x742a('0x4'),'third'),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x742a('0x1')]}};
\ No newline at end of file
+var _0x7dec=['first','second','third','STRING','ENUM'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x7dec,0x162));var _0xc7de=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x7dec[_0x102e37];return _0x35a07c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xc7de('0x0')](_0xc7de('0x1'),_0xc7de('0x2'),_0xc7de('0x3')),'allowNull':![],'defaultValue':_0xc7de('0x1')},'description':{'type':Sequelize[_0xc7de('0x4')]}};
\ No newline at end of file
index c6cb968..1ac2ae4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3de2=['Disposition','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','error','stack','name'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0x3de2,0x79));var _0x23de=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x3de2[_0x11ce46];return _0x368a1e;};'use strict';var emlformat=require(_0x23de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x23de('0x1'));var jsonpatch=require(_0x23de('0x2'));var rp=require(_0x23de('0x3'));var moment=require(_0x23de('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x23de('0x5'));var path=require(_0x23de('0x6'));var sox=require(_0x23de('0x7'));var csv=require(_0x23de('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x23de('0x9'));var _=require('lodash');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(_0x23de('0xe'));var Papa=require(_0x23de('0xf'));var Redis=require('ioredis');var authService=require(_0x23de('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x23de('0x11'));var hardwareService=require(_0x23de('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x23de('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x23de('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb10ae1,_0x2f8052){_0x2f8052=_0x2f8052||0xcc;return function(_0x1d8c06){if(_0x1d8c06){return _0xb10ae1[_0x23de('0x15')](_0x2f8052);}return _0xb10ae1[_0x23de('0x16')](_0x2f8052)[_0x23de('0x17')]();};}function respondWithResult(_0x448f0a,_0x4200e0){_0x4200e0=_0x4200e0||0xc8;return function(_0x3b182e){if(_0x3b182e){return _0x448f0a[_0x23de('0x16')](_0x4200e0)[_0x23de('0x18')](_0x3b182e);}};}function respondWithFilteredResult(_0x32781b,_0x47eb8c){return function(_0x2aec6c){if(_0x2aec6c){var _0x19f1e9=typeof _0x47eb8c[_0x23de('0x19')]===_0x23de('0x1a')&&typeof _0x47eb8c['limit']==='undefined';var _0x2a1829=_0x2aec6c[_0x23de('0x1b')];var _0x42cc7d=_0x19f1e9?0x0:_0x47eb8c[_0x23de('0x19')];var _0x20de0d=_0x19f1e9?_0x2aec6c[_0x23de('0x1b')]:_0x47eb8c[_0x23de('0x19')]+_0x47eb8c[_0x23de('0x1c')];var _0x48acea;if(_0x20de0d>=_0x2a1829){_0x20de0d=_0x2a1829;_0x48acea=0xc8;}else{_0x48acea=0xce;}_0x32781b[_0x23de('0x16')](_0x48acea);return _0x32781b['set'](_0x23de('0x1d'),_0x42cc7d+'-'+_0x20de0d+'/'+_0x2a1829)['json'](_0x2aec6c);}return null;};}function patchUpdates(_0x5db027){return function(_0x4f78b6){try{jsonpatch[_0x23de('0x1e')](_0x4f78b6,_0x5db027,!![]);}catch(_0x1dec81){return BPromise[_0x23de('0x1f')](_0x1dec81);}return _0x4f78b6[_0x23de('0x20')]();};}function saveUpdates(_0x12103c,_0x1dfedd){return function(_0xa14ef8){if(_0xa14ef8){return _0xa14ef8[_0x23de('0x21')](_0x12103c)[_0x23de('0x22')](function(_0x27316a){return _0x27316a;});}return null;};}function removeEntity(_0x459417,_0x5c5420){return function(_0x5840f6){if(_0x5840f6){return _0x5840f6[_0x23de('0x23')]()[_0x23de('0x22')](function(){var _0x3cff36=_0x5840f6[_0x23de('0x24')]({'plain':!![]});var _0x1ed8fb=_0x23de('0x25');return db['UserProfileResource'][_0x23de('0x23')]({'where':{'type':_0x1ed8fb,'resourceId':_0x3cff36['id']}})['then'](function(){return _0x5840f6;});})['then'](function(){_0x459417[_0x23de('0x16')](0xcc)[_0x23de('0x17')]();});}};}function handleEntityNotFound(_0xb994a1,_0x40e65e){return function(_0xca0675){if(!_0xca0675){_0xb994a1[_0x23de('0x15')](0x194);}return _0xca0675;};}function handleError(_0x28f8bf,_0x93c31b){_0x93c31b=_0x93c31b||0x1f4;return function(_0x347bd2){logger[_0x23de('0x26')](_0x347bd2[_0x23de('0x27')]);if(_0x347bd2[_0x23de('0x28')]){delete _0x347bd2['name'];}_0x28f8bf['status'](_0x93c31b)['send'](_0x347bd2);};}exports['index']=function(_0x5aacc0,_0x1d7d9f){var _0x2d270a={},_0x40d7a7={},_0xa3650d={'count':0x0,'rows':[]};var _0x3041d8=_['map'](db[_0x23de('0x29')]['rawAttributes'],function(_0x2e08af){return{'name':_0x2e08af[_0x23de('0x2a')],'type':_0x2e08af[_0x23de('0x2b')][_0x23de('0x2c')]};});_0x40d7a7['model']=_[_0x23de('0x2d')](_0x3041d8,_0x23de('0x28'));_0x40d7a7[_0x23de('0x2e')]=_[_0x23de('0x2f')](_0x5aacc0[_0x23de('0x2e')]);_0x40d7a7[_0x23de('0x30')]=_[_0x23de('0x31')](_0x40d7a7[_0x23de('0x32')],_0x40d7a7[_0x23de('0x2e')]);_0x2d270a[_0x23de('0x33')]=_['intersection'](_0x40d7a7['model'],qs[_0x23de('0x34')](_0x5aacc0[_0x23de('0x2e')]['fields']));_0x2d270a['attributes']=_0x2d270a[_0x23de('0x33')][_0x23de('0x35')]?_0x2d270a[_0x23de('0x33')]:_0x40d7a7[_0x23de('0x32')];if(!_0x5aacc0[_0x23de('0x2e')][_0x23de('0x36')](_0x23de('0x37'))){_0x2d270a[_0x23de('0x1c')]=qs[_0x23de('0x1c')](_0x5aacc0[_0x23de('0x2e')][_0x23de('0x1c')]);_0x2d270a[_0x23de('0x19')]=qs['offset'](_0x5aacc0[_0x23de('0x2e')][_0x23de('0x19')]);}_0x2d270a[_0x23de('0x38')]=qs[_0x23de('0x39')](_0x5aacc0[_0x23de('0x2e')][_0x23de('0x39')]);_0x2d270a[_0x23de('0x3a')]=qs[_0x23de('0x30')](_[_0x23de('0x3b')](_0x5aacc0[_0x23de('0x2e')],_0x40d7a7[_0x23de('0x30')]),_0x3041d8);if(_0x5aacc0['query'][_0x23de('0x3c')]){_0x2d270a[_0x23de('0x3a')]=_['merge'](_0x2d270a['where'],{'$or':_['map'](_0x3041d8,function(_0x5c05be){if(_0x5c05be['type']!==_0x23de('0x3d')){var _0x72d83d={};_0x72d83d[_0x5c05be[_0x23de('0x28')]]={'$like':'%'+_0x5aacc0['query'][_0x23de('0x3c')]+'%'};return _0x72d83d;}})});}_0x2d270a=_[_0x23de('0x3e')]({},_0x2d270a,_0x5aacc0['options']);var _0x146def={'where':_0x2d270a[_0x23de('0x3a')]};return db[_0x23de('0x29')][_0x23de('0x1b')](_0x146def)[_0x23de('0x22')](function(_0x3f6d9f){_0xa3650d[_0x23de('0x1b')]=_0x3f6d9f;if(_0x5aacc0[_0x23de('0x2e')][_0x23de('0x3f')]){_0x2d270a[_0x23de('0x40')]=[{'all':!![]}];}return db[_0x23de('0x29')][_0x23de('0x41')](_0x2d270a);})[_0x23de('0x22')](function(_0x529131){_0xa3650d[_0x23de('0x42')]=_0x529131;return _0xa3650d;})['then'](respondWithFilteredResult(_0x1d7d9f,_0x2d270a))[_0x23de('0x43')](handleError(_0x1d7d9f,null));};exports['show']=function(_0x3ce58c,_0x1ecf27){var _0x489353={'raw':!![],'where':{'id':_0x3ce58c[_0x23de('0x44')]['id']}},_0x4b3a7c={};_0x4b3a7c['model']=_[_0x23de('0x2f')](db[_0x23de('0x29')][_0x23de('0x45')]);_0x4b3a7c['query']=_[_0x23de('0x2f')](_0x3ce58c['query']);_0x4b3a7c[_0x23de('0x30')]=_[_0x23de('0x31')](_0x4b3a7c[_0x23de('0x32')],_0x4b3a7c[_0x23de('0x2e')]);_0x489353[_0x23de('0x33')]=_[_0x23de('0x31')](_0x4b3a7c[_0x23de('0x32')],qs[_0x23de('0x34')](_0x3ce58c['query'][_0x23de('0x34')]));_0x489353[_0x23de('0x33')]=_0x489353[_0x23de('0x33')]['length']?_0x489353[_0x23de('0x33')]:_0x4b3a7c[_0x23de('0x32')];if(_0x3ce58c['query'][_0x23de('0x3f')]){_0x489353[_0x23de('0x40')]=[{'all':!![]}];}_0x489353=_[_0x23de('0x3e')]({},_0x489353,_0x3ce58c[_0x23de('0x46')]);return db[_0x23de('0x29')][_0x23de('0x47')](_0x489353)[_0x23de('0x22')](handleEntityNotFound(_0x1ecf27,null))[_0x23de('0x22')](respondWithResult(_0x1ecf27,null))[_0x23de('0x43')](handleError(_0x1ecf27,null));};exports['create']=function(_0x4a5c9d,_0x45aeec){return db['Disposition'][_0x23de('0x48')](_0x4a5c9d['body'],{})['then'](function(_0x5842ae){var _0x208f5a=_0x4a5c9d['user'][_0x23de('0x24')]({'plain':!![]});if(!_0x208f5a)throw new Error(_0x23de('0x49'));if(_0x208f5a[_0x23de('0x4a')]===_0x23de('0x4b')){var _0x237637=_0x5842ae[_0x23de('0x24')]({'plain':!![]});var _0x477c85=_0x23de('0x25');return db[_0x23de('0x4c')][_0x23de('0x47')]({'where':{'name':_0x477c85,'userProfileId':_0x208f5a[_0x23de('0x4d')]},'raw':!![]})[_0x23de('0x22')](function(_0x40b0c5){if(_0x40b0c5&&_0x40b0c5[_0x23de('0x4e')]===0x0){return db[_0x23de('0x4f')][_0x23de('0x48')]({'name':_0x237637[_0x23de('0x28')],'resourceId':_0x237637['id'],'type':_0x40b0c5[_0x23de('0x28')],'sectionId':_0x40b0c5['id']},{})[_0x23de('0x22')](function(){return _0x5842ae;});}else{return _0x5842ae;}})[_0x23de('0x43')](function(_0x275d77){logger[_0x23de('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x275d77);throw _0x275d77;});}return _0x5842ae;})[_0x23de('0x22')](respondWithResult(_0x45aeec,0xc9))[_0x23de('0x43')](handleError(_0x45aeec,null));};exports[_0x23de('0x21')]=function(_0x590c92,_0x17b758){if(_0x590c92[_0x23de('0x50')]['id']){delete _0x590c92[_0x23de('0x50')]['id'];}return db[_0x23de('0x29')][_0x23de('0x47')]({'where':{'id':_0x590c92['params']['id']}})[_0x23de('0x22')](handleEntityNotFound(_0x17b758,null))[_0x23de('0x22')](saveUpdates(_0x590c92[_0x23de('0x50')],null))[_0x23de('0x22')](respondWithResult(_0x17b758,null))['catch'](handleError(_0x17b758,null));};exports[_0x23de('0x23')]=function(_0x581784,_0xe22f10){return db['Disposition'][_0x23de('0x47')]({'where':{'id':_0x581784[_0x23de('0x44')]['id']}})[_0x23de('0x22')](handleEntityNotFound(_0xe22f10,null))[_0x23de('0x22')](removeEntity(_0xe22f10,null))['catch'](handleError(_0xe22f10,null));};
\ No newline at end of file
+var _0x5a63=['user','role','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','Content-Range','json','apply','save','update','then','destroy','get','Dispositions','UserProfileResource','sendStatus','stack','name','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','find','create','body'];(function(_0x48706d,_0x22b412){var _0xb046da=function(_0x8572f6){while(--_0x8572f6){_0x48706d['push'](_0x48706d['shift']());}};_0xb046da(++_0x22b412);}(_0x5a63,0xe3));var _0x35a6=function(_0x373376,_0x51eac2){_0x373376=_0x373376-0x0;var _0x267c32=_0x5a63[_0x373376];return _0x267c32;};'use strict';var emlformat=require(_0x35a6('0x0'));var rimraf=require(_0x35a6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x35a6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x35a6('0x3'));var util=require(_0x35a6('0x4'));var path=require(_0x35a6('0x5'));var sox=require(_0x35a6('0x6'));var csv=require(_0x35a6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x35a6('0x8'));var _=require('lodash');var squel=require(_0x35a6('0x9'));var crypto=require('crypto');var jsforce=require(_0x35a6('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x35a6('0x7'));var querystring=require(_0x35a6('0xb'));var Papa=require(_0x35a6('0xc'));var Redis=require(_0x35a6('0xd'));var authService=require(_0x35a6('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x35a6('0xf'));var hardwareService=require(_0x35a6('0x10'));var logger=require(_0x35a6('0x11'))('api');var utils=require(_0x35a6('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x35a6('0x13'));var db=require(_0x35a6('0x14'))['db'];function respondWithStatusCode(_0x2baa42,_0x20593b){_0x20593b=_0x20593b||0xcc;return function(_0x617ea0){if(_0x617ea0){return _0x2baa42['sendStatus'](_0x20593b);}return _0x2baa42[_0x35a6('0x15')](_0x20593b)[_0x35a6('0x16')]();};}function respondWithResult(_0x2e6d86,_0x21f7c1){_0x21f7c1=_0x21f7c1||0xc8;return function(_0x250c7){if(_0x250c7){return _0x2e6d86[_0x35a6('0x15')](_0x21f7c1)['json'](_0x250c7);}};}function respondWithFilteredResult(_0x32347a,_0x40c1be){return function(_0x313380){if(_0x313380){var _0x474e34=typeof _0x40c1be[_0x35a6('0x17')]===_0x35a6('0x18')&&typeof _0x40c1be['limit']===_0x35a6('0x18');var _0x4047d2=_0x313380[_0x35a6('0x19')];var _0x39e50d=_0x474e34?0x0:_0x40c1be[_0x35a6('0x17')];var _0x108fb3=_0x474e34?_0x313380[_0x35a6('0x19')]:_0x40c1be['offset']+_0x40c1be[_0x35a6('0x1a')];var _0xbedcb7;if(_0x108fb3>=_0x4047d2){_0x108fb3=_0x4047d2;_0xbedcb7=0xc8;}else{_0xbedcb7=0xce;}_0x32347a[_0x35a6('0x15')](_0xbedcb7);return _0x32347a['set'](_0x35a6('0x1b'),_0x39e50d+'-'+_0x108fb3+'/'+_0x4047d2)[_0x35a6('0x1c')](_0x313380);}return null;};}function patchUpdates(_0x3183eb){return function(_0x4a68b6){try{jsonpatch[_0x35a6('0x1d')](_0x4a68b6,_0x3183eb,!![]);}catch(_0x2d0fa2){return BPromise['reject'](_0x2d0fa2);}return _0x4a68b6[_0x35a6('0x1e')]();};}function saveUpdates(_0x146eca,_0x4b3b00){return function(_0x492be8){if(_0x492be8){return _0x492be8[_0x35a6('0x1f')](_0x146eca)[_0x35a6('0x20')](function(_0x3f1c73){return _0x3f1c73;});}return null;};}function removeEntity(_0x1bb48f,_0x643a2a){return function(_0x43adbe){if(_0x43adbe){return _0x43adbe[_0x35a6('0x21')]()[_0x35a6('0x20')](function(){var _0x28bd6a=_0x43adbe[_0x35a6('0x22')]({'plain':!![]});var _0x32553e=_0x35a6('0x23');return db[_0x35a6('0x24')][_0x35a6('0x21')]({'where':{'type':_0x32553e,'resourceId':_0x28bd6a['id']}})[_0x35a6('0x20')](function(){return _0x43adbe;});})['then'](function(){_0x1bb48f['status'](0xcc)[_0x35a6('0x16')]();});}};}function handleEntityNotFound(_0x287c0b,_0x2680ef){return function(_0x4d68cd){if(!_0x4d68cd){_0x287c0b[_0x35a6('0x25')](0x194);}return _0x4d68cd;};}function handleError(_0x384c42,_0x1b8487){_0x1b8487=_0x1b8487||0x1f4;return function(_0x422ca0){logger['error'](_0x422ca0[_0x35a6('0x26')]);if(_0x422ca0[_0x35a6('0x27')]){delete _0x422ca0[_0x35a6('0x27')];}_0x384c42[_0x35a6('0x15')](_0x1b8487)['send'](_0x422ca0);};}exports['index']=function(_0x19bd13,_0x4189f4){var _0x47aa11={},_0x2a0719={},_0x88953f={'count':0x0,'rows':[]};var _0x26b173=_[_0x35a6('0x28')](db[_0x35a6('0x29')][_0x35a6('0x2a')],function(_0x4d08f8){return{'name':_0x4d08f8[_0x35a6('0x2b')],'type':_0x4d08f8[_0x35a6('0x2c')][_0x35a6('0x2d')]};});_0x2a0719[_0x35a6('0x2e')]=_[_0x35a6('0x28')](_0x26b173,'name');_0x2a0719[_0x35a6('0x2f')]=_[_0x35a6('0x30')](_0x19bd13['query']);_0x2a0719[_0x35a6('0x31')]=_[_0x35a6('0x32')](_0x2a0719[_0x35a6('0x2e')],_0x2a0719[_0x35a6('0x2f')]);_0x47aa11[_0x35a6('0x33')]=_[_0x35a6('0x32')](_0x2a0719[_0x35a6('0x2e')],qs[_0x35a6('0x34')](_0x19bd13[_0x35a6('0x2f')][_0x35a6('0x34')]));_0x47aa11[_0x35a6('0x33')]=_0x47aa11[_0x35a6('0x33')][_0x35a6('0x35')]?_0x47aa11[_0x35a6('0x33')]:_0x2a0719['model'];if(!_0x19bd13['query'][_0x35a6('0x36')]('nolimit')){_0x47aa11[_0x35a6('0x1a')]=qs[_0x35a6('0x1a')](_0x19bd13[_0x35a6('0x2f')]['limit']);_0x47aa11['offset']=qs[_0x35a6('0x17')](_0x19bd13[_0x35a6('0x2f')][_0x35a6('0x17')]);}_0x47aa11[_0x35a6('0x37')]=qs[_0x35a6('0x38')](_0x19bd13[_0x35a6('0x2f')][_0x35a6('0x38')]);_0x47aa11[_0x35a6('0x39')]=qs['filters'](_[_0x35a6('0x3a')](_0x19bd13[_0x35a6('0x2f')],_0x2a0719['filters']),_0x26b173);if(_0x19bd13['query'][_0x35a6('0x3b')]){_0x47aa11['where']=_[_0x35a6('0x3c')](_0x47aa11[_0x35a6('0x39')],{'$or':_[_0x35a6('0x28')](_0x26b173,function(_0x51bca6){if(_0x51bca6[_0x35a6('0x2c')]!==_0x35a6('0x3d')){var _0xa582a0={};_0xa582a0[_0x51bca6[_0x35a6('0x27')]]={'$like':'%'+_0x19bd13[_0x35a6('0x2f')]['filter']+'%'};return _0xa582a0;}})});}_0x47aa11=_['merge']({},_0x47aa11,_0x19bd13['options']);var _0x57eb5d={'where':_0x47aa11['where']};return db[_0x35a6('0x29')][_0x35a6('0x19')](_0x57eb5d)[_0x35a6('0x20')](function(_0x3e9507){_0x88953f[_0x35a6('0x19')]=_0x3e9507;if(_0x19bd13[_0x35a6('0x2f')]['includeAll']){_0x47aa11[_0x35a6('0x3e')]=[{'all':!![]}];}return db['Disposition'][_0x35a6('0x3f')](_0x47aa11);})[_0x35a6('0x20')](function(_0x341520){_0x88953f[_0x35a6('0x40')]=_0x341520;return _0x88953f;})[_0x35a6('0x20')](respondWithFilteredResult(_0x4189f4,_0x47aa11))[_0x35a6('0x41')](handleError(_0x4189f4,null));};exports[_0x35a6('0x42')]=function(_0x221602,_0x42b3f8){var _0x480b3e={'raw':!![],'where':{'id':_0x221602[_0x35a6('0x43')]['id']}},_0x13cda8={};_0x13cda8[_0x35a6('0x2e')]=_[_0x35a6('0x30')](db[_0x35a6('0x29')][_0x35a6('0x2a')]);_0x13cda8[_0x35a6('0x2f')]=_[_0x35a6('0x30')](_0x221602[_0x35a6('0x2f')]);_0x13cda8['filters']=_[_0x35a6('0x32')](_0x13cda8[_0x35a6('0x2e')],_0x13cda8[_0x35a6('0x2f')]);_0x480b3e[_0x35a6('0x33')]=_[_0x35a6('0x32')](_0x13cda8[_0x35a6('0x2e')],qs[_0x35a6('0x34')](_0x221602[_0x35a6('0x2f')][_0x35a6('0x34')]));_0x480b3e[_0x35a6('0x33')]=_0x480b3e[_0x35a6('0x33')][_0x35a6('0x35')]?_0x480b3e[_0x35a6('0x33')]:_0x13cda8[_0x35a6('0x2e')];if(_0x221602[_0x35a6('0x2f')][_0x35a6('0x44')]){_0x480b3e[_0x35a6('0x3e')]=[{'all':!![]}];}_0x480b3e=_[_0x35a6('0x3c')]({},_0x480b3e,_0x221602[_0x35a6('0x45')]);return db[_0x35a6('0x29')][_0x35a6('0x46')](_0x480b3e)[_0x35a6('0x20')](handleEntityNotFound(_0x42b3f8,null))['then'](respondWithResult(_0x42b3f8,null))[_0x35a6('0x41')](handleError(_0x42b3f8,null));};exports[_0x35a6('0x47')]=function(_0x1ac050,_0x29062e){return db[_0x35a6('0x29')][_0x35a6('0x47')](_0x1ac050[_0x35a6('0x48')],{})[_0x35a6('0x20')](function(_0x41aab6){var _0x75ddbf=_0x1ac050[_0x35a6('0x49')][_0x35a6('0x22')]({'plain':!![]});if(!_0x75ddbf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x75ddbf[_0x35a6('0x4a')]==='user'){var _0x10dff=_0x41aab6[_0x35a6('0x22')]({'plain':!![]});var _0x3e8206=_0x35a6('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x3e8206,'userProfileId':_0x75ddbf['userProfileId']},'raw':!![]})[_0x35a6('0x20')](function(_0x5820a5){if(_0x5820a5&&_0x5820a5['autoAssociation']===0x0){return db[_0x35a6('0x24')][_0x35a6('0x47')]({'name':_0x10dff[_0x35a6('0x27')],'resourceId':_0x10dff['id'],'type':_0x5820a5['name'],'sectionId':_0x5820a5['id']},{})[_0x35a6('0x20')](function(){return _0x41aab6;});}else{return _0x41aab6;}})[_0x35a6('0x41')](function(_0x3573f5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3573f5);throw _0x3573f5;});}return _0x41aab6;})[_0x35a6('0x20')](respondWithResult(_0x29062e,0xc9))[_0x35a6('0x41')](handleError(_0x29062e,null));};exports[_0x35a6('0x1f')]=function(_0x373da5,_0x581600){if(_0x373da5[_0x35a6('0x48')]['id']){delete _0x373da5[_0x35a6('0x48')]['id'];}return db[_0x35a6('0x29')][_0x35a6('0x46')]({'where':{'id':_0x373da5['params']['id']}})[_0x35a6('0x20')](handleEntityNotFound(_0x581600,null))['then'](saveUpdates(_0x373da5['body'],null))['then'](respondWithResult(_0x581600,null))['catch'](handleError(_0x581600,null));};exports[_0x35a6('0x21')]=function(_0x28433d,_0x13a59c){return db['Disposition'][_0x35a6('0x46')]({'where':{'id':_0x28433d[_0x35a6('0x43')]['id']}})['then'](handleEntityNotFound(_0x13a59c,null))[_0x35a6('0x20')](removeEntity(_0x13a59c,null))['catch'](handleError(_0x13a59c,null));};
\ No newline at end of file
index 41117f5..a71a913 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63f3=['rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1ad188,_0x12744d){var _0x5ab6e5=function(_0x4881ff){while(--_0x4881ff){_0x1ad188['push'](_0x1ad188['shift']());}};_0x5ab6e5(++_0x12744d);}(_0x63f3,0xd0));var _0x363f=function(_0x2892da,_0x191a40){_0x2892da=_0x2892da-0x0;var _0x28cff2=_0x63f3[_0x2892da];return _0x28cff2;};'use strict';var _=require(_0x363f('0x0'));var util=require(_0x363f('0x1'));var logger=require(_0x363f('0x2'))(_0x363f('0x3'));var moment=require(_0x363f('0x4'));var BPromise=require(_0x363f('0x5'));var rp=require(_0x363f('0x6'));var fs=require('fs');var path=require(_0x363f('0x7'));var rimraf=require(_0x363f('0x8'));var config=require(_0x363f('0x9'));var attributes=require(_0x363f('0xa'));module[_0x363f('0xb')]=function(_0x434a10,_0x50ca6a){return _0x434a10[_0x363f('0xc')](_0x363f('0xd'),attributes,{'tableName':_0x363f('0xe'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x363f('0xf'),'fields':[_0x363f('0x10'),_0x363f('0x11')]},{'unique':!![],'name':_0x363f('0x12'),'fields':[_0x363f('0x10'),_0x363f('0x13')]},{'unique':!![],'name':_0x363f('0x14'),'fields':[_0x363f('0x10'),_0x363f('0x15')]},{'unique':!![],'name':'name_sms','fields':[_0x363f('0x10'),_0x363f('0x16')]},{'unique':!![],'name':_0x363f('0x17'),'fields':[_0x363f('0x10'),'FaxAccountId']},{'unique':!![],'name':_0x363f('0x18'),'fields':[_0x363f('0x10'),_0x363f('0x19')]},{'unique':!![],'name':_0x363f('0x1a'),'fields':[_0x363f('0x10'),'WhatsappAccountId']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5998=['name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','name_mail','SmsAccountId'];(function(_0x27bf23,_0xff7a37){var _0x5befd0=function(_0x3d0b47){while(--_0x3d0b47){_0x27bf23['push'](_0x27bf23['shift']());}};_0x5befd0(++_0xff7a37);}(_0x5998,0xeb));var _0x8599=function(_0x19b98d,_0x358818){_0x19b98d=_0x19b98d-0x0;var _0x6670e2=_0x5998[_0x19b98d];return _0x6670e2;};'use strict';var _=require(_0x8599('0x0'));var util=require(_0x8599('0x1'));var logger=require(_0x8599('0x2'))(_0x8599('0x3'));var moment=require(_0x8599('0x4'));var BPromise=require(_0x8599('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8599('0x6'));var rimraf=require('rimraf');var config=require(_0x8599('0x7'));var attributes=require('./disposition.attributes');module[_0x8599('0x8')]=function(_0x114bc8,_0x18f179){return _0x114bc8[_0x8599('0x9')](_0x8599('0xa'),attributes,{'tableName':_0x8599('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x8599('0xc'),'fields':[_0x8599('0xd'),_0x8599('0xe')]},{'unique':!![],'name':_0x8599('0xf'),'fields':[_0x8599('0xd'),'ChatWebsiteId']},{'unique':!![],'name':_0x8599('0x10'),'fields':[_0x8599('0xd'),'MailAccountId']},{'unique':!![],'name':'name_sms','fields':[_0x8599('0xd'),_0x8599('0x11')]},{'unique':!![],'name':_0x8599('0x12'),'fields':[_0x8599('0xd'),_0x8599('0x13')]},{'unique':!![],'name':_0x8599('0x14'),'fields':[_0x8599('0xd'),_0x8599('0x15')]},{'unique':!![],'name':_0x8599('0x16'),'fields':[_0x8599('0xd'),'WhatsappAccountId']}],'timestamps':!![]});};
\ No newline at end of file
index b07cf7f..3fa2611 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2aa94d,_0x574c87){var _0x529bfb=function(_0x1580d1){while(--_0x1580d1){_0x2aa94d['push'](_0x2aa94d['shift']());}};_0x529bfb(++_0x574c87);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2af5bb,_0x2d5040){var _0x485474=function(_0x5d464f){while(--_0x5d464f){_0x2af5bb['push'](_0x2af5bb['shift']());}};_0x485474(++_0x2d5040);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
index 6b8078c..2c2478b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fc2=['../../components/interaction/service','../../config/environment','./disposition.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','multer','express','Router','fs-extra'];(function(_0x24392f,_0x15a3e5){var _0x591e33=function(_0xe0ccea){while(--_0xe0ccea){_0x24392f['push'](_0x24392f['shift']());}};_0x591e33(++_0x15a3e5);}(_0x0fc2,0x14c));var _0x20fc=function(_0x270862,_0x4509d4){_0x270862=_0x270862-0x0;var _0x485bbc=_0x0fc2[_0x270862];return _0x485bbc;};'use strict';var multer=require(_0x20fc('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x20fc('0x1'));var router=express[_0x20fc('0x2')]();var fs_extra=require(_0x20fc('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x20fc('0x4'));var config=require(_0x20fc('0x5'));var controller=require(_0x20fc('0x6'));router[_0x20fc('0x7')]('/',auth['isAuthenticated'](),controller[_0x20fc('0x8')]);router['get'](_0x20fc('0x9'),auth[_0x20fc('0xa')](),controller['show']);router[_0x20fc('0xb')]('/',auth[_0x20fc('0xa')](),controller['create']);router[_0x20fc('0xc')]('/:id',auth[_0x20fc('0xa')](),controller[_0x20fc('0xd')]);router[_0x20fc('0xe')](_0x20fc('0x9'),auth[_0x20fc('0xa')](),controller[_0x20fc('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xc171=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','delete','destroy','exports','util','path','connect-timeout'];(function(_0x329437,_0x1de73a){var _0x3789d9=function(_0x37832e){while(--_0x37832e){_0x329437['push'](_0x329437['shift']());}};_0x3789d9(++_0x1de73a);}(_0xc171,0x140));var _0x1c17=function(_0x22d8a6,_0x4383d6){_0x22d8a6=_0x22d8a6-0x0;var _0x1364e0=_0xc171[_0x22d8a6];return _0x1364e0;};'use strict';var multer=require('multer');var util=require(_0x1c17('0x0'));var path=require(_0x1c17('0x1'));var timeout=require(_0x1c17('0x2'));var express=require(_0x1c17('0x3'));var router=express['Router']();var fs_extra=require(_0x1c17('0x4'));var auth=require(_0x1c17('0x5'));var interaction=require(_0x1c17('0x6'));var config=require(_0x1c17('0x7'));var controller=require('./disposition.controller');router[_0x1c17('0x8')]('/',auth[_0x1c17('0x9')](),controller[_0x1c17('0xa')]);router[_0x1c17('0x8')](_0x1c17('0xb'),auth[_0x1c17('0x9')](),controller[_0x1c17('0xc')]);router['post']('/',auth[_0x1c17('0x9')](),controller[_0x1c17('0xd')]);router['put'](_0x1c17('0xb'),auth[_0x1c17('0x9')](),controller['update']);router[_0x1c17('0xe')](_0x1c17('0xb'),auth[_0x1c17('0x9')](),controller[_0x1c17('0xf')]);module[_0x1c17('0x10')]=router;
\ No newline at end of file
index 44cc5d5..ee1716f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17c1=['INTEGER','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','7200','9600','12000','4800','v17,v27,v29'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x17c1,0x105));var _0x117c=function(_0x8778a9,_0x1f49dc){_0x8778a9=_0x8778a9-0x0;var _0x491668=_0x17c1[_0x8778a9];return _0x491668;};'use strict';var Sequelize=require(_0x117c('0x0'));module[_0x117c('0x1')]={'name':{'type':Sequelize[_0x117c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x117c('0x3')](_0x117c('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x117c('0x5')},'localstationid':{'type':Sequelize[_0x117c('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize['ENUM'](_0x117c('0x6'),'4800',_0x117c('0x7'),_0x117c('0x8'),_0x117c('0x9'),'14400'),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x117c('0x3')](_0x117c('0x6'),_0x117c('0xa'),_0x117c('0x7'),_0x117c('0x8'),_0x117c('0x9'),'14400'),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x117c('0x2')],'defaultValue':_0x117c('0xb')},'gateway':{'type':Sequelize[_0x117c('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x117c('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x117c('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x117c('0x3')](_0x117c('0xd'),_0x117c('0xe'),_0x117c('0xf'),_0x117c('0x10')),'defaultValue':_0x117c('0xd')},'key':{'type':Sequelize[_0x117c('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x117c('0x11');}},'notificationSound':{'type':Sequelize[_0x117c('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x117c('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x117c('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x117c('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x117c('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x117c('0xc')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x117c('0x12')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x12aff8){if(!_0x12aff8)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x117c('0x13')](_0x117c('0x14'),_0x12aff8);}}};
\ No newline at end of file
+var _0x34b0=['sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','IAX','DADHI','KHOMP','SIP','TEXT','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition'];(function(_0x55e28b,_0x53dc09){var _0x3cff16=function(_0x619f2f){while(--_0x619f2f){_0x55e28b['push'](_0x55e28b['shift']());}};_0x3cff16(++_0x53dc09);}(_0x34b0,0x145));var _0x034b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x34b0[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x034b('0x0'));module[_0x034b('0x1')]={'name':{'type':Sequelize[_0x034b('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x034b('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x034b('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x034b('0x2')],'defaultValue':_0x034b('0x4')},'localstationid':{'type':Sequelize[_0x034b('0x2')],'unique':_0x034b('0x5')},'minrate':{'type':Sequelize[_0x034b('0x6')](_0x034b('0x7'),_0x034b('0x8'),_0x034b('0x9'),_0x034b('0xa'),_0x034b('0xb'),_0x034b('0xc')),'defaultValue':_0x034b('0x8')},'maxrate':{'type':Sequelize[_0x034b('0x6')](_0x034b('0x7'),'4800','7200','9600',_0x034b('0xb'),'14400'),'defaultValue':_0x034b('0xc')},'modem':{'type':Sequelize[_0x034b('0x2')],'defaultValue':_0x034b('0xd')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x034b('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x034b('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x034b('0x6')]('SIP',_0x034b('0xf'),_0x034b('0x10'),_0x034b('0x11')),'defaultValue':_0x034b('0x12')},'key':{'type':Sequelize[_0x034b('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x034b('0x13')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x034b('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x034b('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x034b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x034b('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x034b('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x034b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x034b('0xe')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x034b('0x14')],'defaultValue':![],'comment':_0x034b('0x15'),'set':function(_0xa31bd1){if(!_0xa31bd1)this['setDataValue'](_0x034b('0x16'),null);this[_0x034b('0x17')](_0x034b('0x18'),_0xa31bd1);}}};
\ No newline at end of file
index 74514cf..3cf9bd7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7674=['fieldName','type','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','create','body','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','length','order','pick','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','context','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','/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','sequelize','VoiceExtension','tech','key','updatedAt','findById','getMessages','FaxMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','CmList','DESC','attachments','join','basename','CheckAfterSend','isNil','from','format','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','user','out','Contact\x20not\x20found','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','emit','userFaxAccount:remove','getAgents','eml-format','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','request','then','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','FaxAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes'];(function(_0x1edb78,_0x5153ce){var _0x3759a0=function(_0x1dcbe0){while(--_0x1dcbe0){_0x1edb78['push'](_0x1edb78['shift']());}};_0x3759a0(++_0x5153ce);}(_0x7674,0x79));var _0x4767=function(_0x270a02,_0x223adb){_0x270a02=_0x270a02-0x0;var _0x3cd07b=_0x7674[_0x270a02];return _0x3cd07b;};'use strict';var emlformat=require(_0x4767('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4767('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x4767('0x2'));var util=require(_0x4767('0x3'));var path=require(_0x4767('0x4'));var sox=require(_0x4767('0x5'));var csv=require(_0x4767('0x6'));var ejs=require(_0x4767('0x7'));var fs=require('fs');var fs_extra=require(_0x4767('0x8'));var _=require(_0x4767('0x9'));var squel=require(_0x4767('0xa'));var crypto=require('crypto');var jsforce=require(_0x4767('0xb'));var deskjs=require(_0x4767('0xc'));var toCsv=require(_0x4767('0x6'));var querystring=require(_0x4767('0xd'));var Papa=require(_0x4767('0xe'));var Redis=require('ioredis');var authService=require(_0x4767('0xf'));var qs=require(_0x4767('0x10'));var as=require(_0x4767('0x11'));var hardwareService=require(_0x4767('0x12'));var logger=require(_0x4767('0x13'))(_0x4767('0x14'));var utils=require(_0x4767('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4767('0x16'));var db=require(_0x4767('0x17'))['db'];config[_0x4767('0x18')]=_[_0x4767('0x19')](config[_0x4767('0x18')],{'host':_0x4767('0x1a'),'port':0x18eb});var socket=require(_0x4767('0x1b'))(new Redis(config[_0x4767('0x18')]));require(_0x4767('0x1c'))[_0x4767('0x1d')](socket);var jayson=require(_0x4767('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x4767('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x23792c,_0x1e695c,_0x5d8945,_0x5827e4){return new BPromise(function(_0x5272cd,_0x113560){var _0x27316a=_0x5827e4||client;return _0x27316a[_0x4767('0x20')](_0x23792c,_0x5d8945)[_0x4767('0x21')](function(_0x4d8bc7){logger[_0x4767('0x22')]('FaxAccount,\x20%s,\x20%s',_0x1e695c,'request\x20sent');logger[_0x4767('0x23')](_0x4767('0x24'),_0x1e695c,_0x4767('0x25'),JSON[_0x4767('0x26')](_0x4d8bc7));if(_0x4d8bc7[_0x4767('0x27')]){if(_0x4d8bc7['error'][_0x4767('0x28')]===0x1f4){logger[_0x4767('0x27')]('FaxAccount,\x20%s,\x20%s',_0x1e695c,_0x4d8bc7[_0x4767('0x27')][_0x4767('0x29')]);return _0x113560(_0x4d8bc7['error']['message']);}logger['error'](_0x4767('0x2a'),_0x1e695c,_0x4d8bc7[_0x4767('0x27')][_0x4767('0x29')]);return _0x5272cd(_0x4d8bc7[_0x4767('0x27')][_0x4767('0x29')]);}else{logger[_0x4767('0x22')]('FaxAccount,\x20%s,\x20%s',_0x1e695c,'request\x20sent');_0x5272cd(_0x4d8bc7[_0x4767('0x2b')]['message']);}})[_0x4767('0x2c')](function(_0x38c6a1){logger[_0x4767('0x27')](_0x4767('0x2a'),_0x1e695c,_0x38c6a1);_0x113560(_0x38c6a1);});});}function respondWithStatusCode(_0x2a5a95,_0x28f71e){_0x28f71e=_0x28f71e||0xcc;return function(_0xc9a973){if(_0xc9a973){return _0x2a5a95[_0x4767('0x2d')](_0x28f71e);}return _0x2a5a95['status'](_0x28f71e)[_0x4767('0x2e')]();};}function respondWithResult(_0x4deb37,_0x92146b){_0x92146b=_0x92146b||0xc8;return function(_0xd5d21){if(_0xd5d21){return _0x4deb37[_0x4767('0x2f')](_0x92146b)[_0x4767('0x30')](_0xd5d21);}};}function respondWithFilteredResult(_0x481dbe,_0x3c3bc4){return function(_0x3b9085){if(_0x3b9085){var _0x294f8c=typeof _0x3c3bc4[_0x4767('0x31')]===_0x4767('0x32')&&typeof _0x3c3bc4[_0x4767('0x33')]==='undefined';var _0x109588=_0x3b9085[_0x4767('0x34')];var _0x13b22b=_0x294f8c?0x0:_0x3c3bc4[_0x4767('0x31')];var _0x3a6bed=_0x294f8c?_0x3b9085[_0x4767('0x34')]:_0x3c3bc4[_0x4767('0x31')]+_0x3c3bc4['limit'];var _0x7ea190;if(_0x3a6bed>=_0x109588){_0x3a6bed=_0x109588;_0x7ea190=0xc8;}else{_0x7ea190=0xce;}_0x481dbe['status'](_0x7ea190);return _0x481dbe[_0x4767('0x35')](_0x4767('0x36'),_0x13b22b+'-'+_0x3a6bed+'/'+_0x109588)[_0x4767('0x30')](_0x3b9085);}return null;};}function patchUpdates(_0x19a786){return function(_0x22e7cf){try{jsonpatch[_0x4767('0x37')](_0x22e7cf,_0x19a786,!![]);}catch(_0x5416af){return BPromise[_0x4767('0x38')](_0x5416af);}return _0x22e7cf[_0x4767('0x39')]();};}function saveUpdates(_0x129679,_0x3bddcd){return function(_0x5e4846){if(_0x5e4846){return _0x5e4846[_0x4767('0x3a')](_0x129679)[_0x4767('0x21')](function(_0x5f5def){return _0x5f5def;});}return null;};}function removeEntity(_0xe56da0,_0x362114){return function(_0x4d90d3){if(_0x4d90d3){return _0x4d90d3[_0x4767('0x3b')]()[_0x4767('0x21')](function(){var _0x2e27a7=_0x4d90d3[_0x4767('0x3c')]({'plain':!![]});var _0x3fdac5=_0x4767('0x3d');return db[_0x4767('0x3e')][_0x4767('0x3b')]({'where':{'type':_0x3fdac5,'resourceId':_0x2e27a7['id']}})[_0x4767('0x21')](function(){return _0x4d90d3;});})[_0x4767('0x21')](function(){_0xe56da0[_0x4767('0x2f')](0xcc)[_0x4767('0x2e')]();});}};}function handleEntityNotFound(_0x5d595f,_0x2b2d23){return function(_0xa032af){if(!_0xa032af){_0x5d595f['sendStatus'](0x194);}return _0xa032af;};}function handleError(_0x4a2f16,_0x312547){_0x312547=_0x312547||0x1f4;return function(_0x4f5bd9){logger[_0x4767('0x27')](_0x4f5bd9['stack']);if(_0x4f5bd9['name']){delete _0x4f5bd9[_0x4767('0x3f')];}_0x4a2f16['status'](_0x312547)[_0x4767('0x40')](_0x4f5bd9);};}exports[_0x4767('0x41')]=function(_0x102e78,_0x515850){var _0x229ecb={'include':[{'model':db[_0x4767('0x42')],'as':_0x4767('0x43')}]},_0x4508fb={},_0x93a475={'count':0x0,'rows':[]};var _0x99fd3d=_[_0x4767('0x44')](db[_0x4767('0x45')][_0x4767('0x46')],function(_0x408d77){return{'name':_0x408d77[_0x4767('0x47')],'type':_0x408d77[_0x4767('0x48')]['key']};});_0x4508fb[_0x4767('0x49')]=_[_0x4767('0x44')](_0x99fd3d,_0x4767('0x3f'));_0x4508fb[_0x4767('0x4a')]=_[_0x4767('0x4b')](_0x102e78[_0x4767('0x4a')]);_0x4508fb['filters']=_[_0x4767('0x4c')](_0x4508fb[_0x4767('0x49')],_0x4508fb[_0x4767('0x4a')]);_0x229ecb['attributes']=_[_0x4767('0x4c')](_0x4508fb[_0x4767('0x49')],qs[_0x4767('0x4d')](_0x102e78['query'][_0x4767('0x4d')]));_0x229ecb[_0x4767('0x4e')]=_0x229ecb[_0x4767('0x4e')]['length']?_0x229ecb[_0x4767('0x4e')]:_0x4508fb[_0x4767('0x49')];if(!_0x102e78[_0x4767('0x4a')][_0x4767('0x4f')](_0x4767('0x50'))){_0x229ecb[_0x4767('0x33')]=qs[_0x4767('0x33')](_0x102e78[_0x4767('0x4a')][_0x4767('0x33')]);_0x229ecb[_0x4767('0x31')]=qs[_0x4767('0x31')](_0x102e78['query'][_0x4767('0x31')]);}_0x229ecb['order']=qs[_0x4767('0x51')](_0x102e78['query'][_0x4767('0x51')]);_0x229ecb[_0x4767('0x52')]=qs[_0x4767('0x53')](_['pick'](_0x102e78[_0x4767('0x4a')],_0x4508fb[_0x4767('0x53')]),_0x99fd3d);if(_0x102e78[_0x4767('0x4a')][_0x4767('0x54')]){_0x229ecb[_0x4767('0x52')]=_[_0x4767('0x55')](_0x229ecb['where'],{'$or':_[_0x4767('0x44')](_0x99fd3d,function(_0x2bf6f6){if(_0x2bf6f6[_0x4767('0x48')]!==_0x4767('0x56')){var _0x47fa51={};_0x47fa51[_0x2bf6f6[_0x4767('0x3f')]]={'$like':'%'+_0x102e78[_0x4767('0x4a')][_0x4767('0x54')]+'%'};return _0x47fa51;}})});}_0x229ecb=_[_0x4767('0x55')]({},_0x229ecb,_0x102e78[_0x4767('0x57')]);var _0x4d40d7={'where':_0x229ecb['where']};return db[_0x4767('0x45')][_0x4767('0x34')](_0x4d40d7)['then'](function(_0x972ce2){_0x93a475[_0x4767('0x34')]=_0x972ce2;if(_0x102e78[_0x4767('0x4a')][_0x4767('0x58')]){_0x229ecb[_0x4767('0x59')]=[{'all':!![]}];}return db[_0x4767('0x45')][_0x4767('0x5a')](_0x229ecb);})[_0x4767('0x21')](function(_0x3ded65){_0x93a475[_0x4767('0x5b')]=_0x3ded65;return _0x93a475;})[_0x4767('0x21')](respondWithFilteredResult(_0x515850,_0x229ecb))[_0x4767('0x2c')](handleError(_0x515850,null));};exports['show']=function(_0x5b5d7a,_0x8c59a2){var _0x36a21b={'raw':![],'where':{'id':_0x5b5d7a['params']['id']},'include':[{'model':db[_0x4767('0x42')],'as':_0x4767('0x43')}]},_0x59bf93={};_0x59bf93['model']=_['keys'](db[_0x4767('0x45')]['rawAttributes']);_0x59bf93['query']=_[_0x4767('0x4b')](_0x5b5d7a[_0x4767('0x4a')]);_0x59bf93['filters']=_[_0x4767('0x4c')](_0x59bf93[_0x4767('0x49')],_0x59bf93[_0x4767('0x4a')]);_0x36a21b[_0x4767('0x4e')]=_['intersection'](_0x59bf93[_0x4767('0x49')],qs['fields'](_0x5b5d7a[_0x4767('0x4a')]['fields']));_0x36a21b['attributes']=_0x36a21b['attributes']['length']?_0x36a21b[_0x4767('0x4e')]:_0x59bf93[_0x4767('0x49')];if(_0x5b5d7a[_0x4767('0x4a')][_0x4767('0x58')]){_0x36a21b['include']=[{'all':!![]}];}_0x36a21b=_[_0x4767('0x55')]({},_0x36a21b,_0x5b5d7a[_0x4767('0x57')]);return db['FaxAccount'][_0x4767('0x5c')](_0x36a21b)[_0x4767('0x21')](handleEntityNotFound(_0x8c59a2,null))[_0x4767('0x21')](respondWithResult(_0x8c59a2,null))['catch'](handleError(_0x8c59a2,null));};exports[_0x4767('0x5d')]=function(_0x1184a6,_0x3a7403){return db[_0x4767('0x45')][_0x4767('0x5d')](_0x1184a6[_0x4767('0x5e')],{})[_0x4767('0x21')](function(_0x4cab3c){var _0x305a82=_0x1184a6['user'][_0x4767('0x3c')]({'plain':!![]});if(!_0x305a82)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x305a82[_0x4767('0x5f')]==='user'){var _0x206dfc=_0x4cab3c[_0x4767('0x3c')]({'plain':!![]});var _0x1f1376=_0x4767('0x3d');return db[_0x4767('0x60')][_0x4767('0x5c')]({'where':{'name':_0x1f1376,'userProfileId':_0x305a82['userProfileId']},'raw':!![]})['then'](function(_0x47c38c){if(_0x47c38c&&_0x47c38c[_0x4767('0x61')]===0x0){return db[_0x4767('0x3e')]['create']({'name':_0x206dfc['name'],'resourceId':_0x206dfc['id'],'type':_0x47c38c[_0x4767('0x3f')],'sectionId':_0x47c38c['id']},{})[_0x4767('0x21')](function(){return _0x4cab3c;});}else{return _0x4cab3c;}})[_0x4767('0x2c')](function(_0x30d210){logger[_0x4767('0x27')](_0x4767('0x62'),_0x30d210);throw _0x30d210;});}return _0x4cab3c;})[_0x4767('0x21')](respondWithResult(_0x3a7403,0xc9))['catch'](handleError(_0x3a7403,null));};exports[_0x4767('0x3a')]=function(_0x3bdc12,_0x43affa){if(_0x3bdc12[_0x4767('0x5e')]['id']){delete _0x3bdc12[_0x4767('0x5e')]['id'];}return db[_0x4767('0x45')][_0x4767('0x5c')]({'where':{'id':_0x3bdc12[_0x4767('0x63')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x4767('0x21')](handleEntityNotFound(_0x43affa,null))[_0x4767('0x21')](saveUpdates(_0x3bdc12[_0x4767('0x5e')],null))[_0x4767('0x21')](respondWithResult(_0x43affa,null))['catch'](handleError(_0x43affa,null));};exports[_0x4767('0x3b')]=function(_0x3b324c,_0x12a857){return db[_0x4767('0x45')]['find']({'where':{'id':_0x3b324c['params']['id']}})['then'](handleEntityNotFound(_0x12a857,null))[_0x4767('0x21')](removeEntity(_0x12a857,null))[_0x4767('0x2c')](handleError(_0x12a857,null));};exports[_0x4767('0x64')]=function(_0x3f703a,_0x585140){return db['FaxAccount']['describe']()[_0x4767('0x21')](respondWithResult(_0x585140,null))[_0x4767('0x2c')](handleError(_0x585140,null));};exports[_0x4767('0x65')]=function(_0x142f7c,_0xddaa29,_0x14ad5e){if(_0x142f7c[_0x4767('0x5e')]['id']){delete _0x142f7c[_0x4767('0x5e')]['id'];}return db[_0x4767('0x45')][_0x4767('0x5c')]({'where':{'id':_0x142f7c[_0x4767('0x63')]['id']}})['then'](handleEntityNotFound(_0xddaa29,null))['then'](function(_0x56164d){if(_0x56164d){_0x142f7c[_0x4767('0x5e')][_0x4767('0x66')]=_0x56164d['id'];return db[_0x4767('0x67')][_0x4767('0x5d')](_0x142f7c['body']);}})[_0x4767('0x21')](respondWithResult(_0xddaa29,null))[_0x4767('0x2c')](handleError(_0xddaa29,null));};exports[_0x4767('0x68')]=function(_0x5029c0,_0x40b182,_0x299198){var _0x370ab7={'raw':![],'where':{}};var _0x251f85={};var _0x408854={'count':0x0,'rows':[]};return db['FaxAccount'][_0x4767('0x69')]({'where':{'id':_0x5029c0['params']['id']}})['then'](handleEntityNotFound(_0x40b182,null))['then'](function(_0x33349e){if(_0x33349e){_0x251f85[_0x4767('0x49')]=_['keys'](db[_0x4767('0x67')][_0x4767('0x46')]);_0x251f85[_0x4767('0x4a')]=_[_0x4767('0x4b')](_0x5029c0[_0x4767('0x4a')]);_0x251f85[_0x4767('0x53')]=_['intersection'](_0x251f85[_0x4767('0x49')],_0x251f85['query']);_0x370ab7[_0x4767('0x4e')]=_[_0x4767('0x4c')](_0x251f85['model'],qs['fields'](_0x5029c0[_0x4767('0x4a')][_0x4767('0x4d')]));_0x370ab7['attributes']=_0x370ab7['attributes'][_0x4767('0x6a')]?_0x370ab7[_0x4767('0x4e')]:_0x251f85[_0x4767('0x49')];if(!_0x5029c0[_0x4767('0x4a')][_0x4767('0x4f')](_0x4767('0x50'))){_0x370ab7[_0x4767('0x33')]=qs[_0x4767('0x33')](_0x5029c0[_0x4767('0x4a')]['limit']);_0x370ab7['offset']=qs[_0x4767('0x31')](_0x5029c0[_0x4767('0x4a')][_0x4767('0x31')]);}_0x370ab7[_0x4767('0x6b')]=qs[_0x4767('0x51')](_0x5029c0['query'][_0x4767('0x51')]);_0x370ab7[_0x4767('0x52')]=qs['filters'](_[_0x4767('0x6c')](_0x5029c0[_0x4767('0x4a')],_0x251f85[_0x4767('0x53')]));_0x370ab7[_0x4767('0x52')][_0x4767('0x66')]=_0x33349e['id'];if(_0x5029c0[_0x4767('0x4a')][_0x4767('0x54')]){_0x370ab7[_0x4767('0x52')]=_[_0x4767('0x55')](_0x370ab7[_0x4767('0x52')],{'$or':_[_0x4767('0x44')](_0x370ab7['attributes'],function(_0x25eaf0){var _0x3b7d59={};_0x3b7d59[_0x25eaf0]={'$like':'%'+_0x5029c0[_0x4767('0x4a')][_0x4767('0x54')]+'%'};return _0x3b7d59;})});}_0x370ab7=_[_0x4767('0x55')]({},_0x370ab7,_0x5029c0[_0x4767('0x57')]);return db[_0x4767('0x67')][_0x4767('0x34')]({'where':_0x370ab7['where']})[_0x4767('0x21')](function(_0xdf427b){_0x408854[_0x4767('0x34')]=_0xdf427b;if(_0x5029c0[_0x4767('0x4a')][_0x4767('0x58')]){_0x370ab7[_0x4767('0x59')]=[{'all':!![]}];}return db[_0x4767('0x67')][_0x4767('0x5a')](_0x370ab7);})[_0x4767('0x21')](function(_0x55df01){_0x408854['rows']=_0x55df01;return _0x408854;});}})[_0x4767('0x21')](respondWithFilteredResult(_0x40b182,_0x370ab7))['catch'](handleError(_0x40b182,null));};exports[_0x4767('0x6d')]=function(_0x36244b,_0x3401fe,_0x4e76ca){return db[_0x4767('0x45')][_0x4767('0x5c')]({'where':{'id':_0x36244b[_0x4767('0x63')]['id']}})[_0x4767('0x21')](handleEntityNotFound(_0x3401fe,null))[_0x4767('0x21')](function(_0x348f58){if(_0x348f58){return _0x348f58[_0x4767('0x6d')](_0x36244b['query'][_0x4767('0x6e')]);}})['then'](respondWithStatusCode(_0x3401fe,null))[_0x4767('0x2c')](handleError(_0x3401fe,null));};exports['addAnswer']=function(_0x24762f,_0x42b306,_0x4489aa){if(_0x24762f[_0x4767('0x5e')]['id']){delete _0x24762f[_0x4767('0x5e')]['id'];}return db[_0x4767('0x45')][_0x4767('0x5c')]({'where':{'id':_0x24762f[_0x4767('0x63')]['id']}})[_0x4767('0x21')](handleEntityNotFound(_0x42b306,null))[_0x4767('0x21')](function(_0x206075){if(_0x206075){_0x24762f[_0x4767('0x5e')][_0x4767('0x66')]=_0x206075['id'];return db[_0x4767('0x6f')][_0x4767('0x5d')](_0x24762f[_0x4767('0x5e')]);}})['then'](respondWithResult(_0x42b306,null))['catch'](handleError(_0x42b306,null));};exports[_0x4767('0x70')]=function(_0x5cd23b,_0x34fdb3,_0x910248){var _0x58025c={'raw':![],'where':{}};var _0x335e21={};var _0xe91e4a={'count':0x0,'rows':[]};return db[_0x4767('0x45')][_0x4767('0x69')]({'where':{'id':_0x5cd23b[_0x4767('0x63')]['id']}})['then'](handleEntityNotFound(_0x34fdb3,null))[_0x4767('0x21')](function(_0x121c56){if(_0x121c56){_0x335e21[_0x4767('0x49')]=_[_0x4767('0x4b')](db[_0x4767('0x6f')][_0x4767('0x46')]);_0x335e21[_0x4767('0x4a')]=_[_0x4767('0x4b')](_0x5cd23b[_0x4767('0x4a')]);_0x335e21[_0x4767('0x53')]=_['intersection'](_0x335e21[_0x4767('0x49')],_0x335e21[_0x4767('0x4a')]);_0x58025c[_0x4767('0x4e')]=_[_0x4767('0x4c')](_0x335e21[_0x4767('0x49')],qs[_0x4767('0x4d')](_0x5cd23b[_0x4767('0x4a')]['fields']));_0x58025c[_0x4767('0x4e')]=_0x58025c['attributes'][_0x4767('0x6a')]?_0x58025c['attributes']:_0x335e21[_0x4767('0x49')];if(!_0x5cd23b[_0x4767('0x4a')][_0x4767('0x4f')](_0x4767('0x50'))){_0x58025c['limit']=qs['limit'](_0x5cd23b[_0x4767('0x4a')][_0x4767('0x33')]);_0x58025c[_0x4767('0x31')]=qs[_0x4767('0x31')](_0x5cd23b[_0x4767('0x4a')][_0x4767('0x31')]);}_0x58025c[_0x4767('0x6b')]=qs[_0x4767('0x51')](_0x5cd23b[_0x4767('0x4a')][_0x4767('0x51')]);_0x58025c[_0x4767('0x52')]=qs[_0x4767('0x53')](_[_0x4767('0x6c')](_0x5cd23b['query'],_0x335e21[_0x4767('0x53')]));_0x58025c['where']['FaxAccountId']=_0x121c56['id'];if(_0x5cd23b[_0x4767('0x4a')][_0x4767('0x54')]){_0x58025c[_0x4767('0x52')]=_[_0x4767('0x55')](_0x58025c[_0x4767('0x52')],{'$or':_[_0x4767('0x44')](_0x58025c[_0x4767('0x4e')],function(_0x4df3ca){var _0x43e82a={};_0x43e82a[_0x4df3ca]={'$like':'%'+_0x5cd23b[_0x4767('0x4a')][_0x4767('0x54')]+'%'};return _0x43e82a;})});}_0x58025c=_[_0x4767('0x55')]({},_0x58025c,_0x5cd23b[_0x4767('0x57')]);return db[_0x4767('0x6f')][_0x4767('0x34')]({'where':_0x58025c[_0x4767('0x52')]})[_0x4767('0x21')](function(_0x290f6c){_0xe91e4a[_0x4767('0x34')]=_0x290f6c;if(_0x5cd23b[_0x4767('0x4a')][_0x4767('0x58')]){_0x58025c[_0x4767('0x59')]=[{'all':!![]}];}return db[_0x4767('0x6f')][_0x4767('0x5a')](_0x58025c);})[_0x4767('0x21')](function(_0x1950dc){_0xe91e4a[_0x4767('0x5b')]=_0x1950dc;return _0xe91e4a;});}})[_0x4767('0x21')](respondWithFilteredResult(_0x34fdb3,_0x58025c))['catch'](handleError(_0x34fdb3,null));};exports[_0x4767('0x71')]=function(_0x148510,_0x196bdd,_0x486917){return db[_0x4767('0x45')][_0x4767('0x5c')]({'where':{'id':_0x148510['params']['id']}})['then'](handleEntityNotFound(_0x196bdd,null))['then'](function(_0x2c519e){if(_0x2c519e){return _0x2c519e[_0x4767('0x71')](_0x148510['query']['ids']);}})[_0x4767('0x21')](respondWithStatusCode(_0x196bdd,null))[_0x4767('0x2c')](handleError(_0x196bdd,null));};exports['addInteraction']=function(_0x573cb6,_0x3a734d,_0xb2907b){return db[_0x4767('0x72')][_0x4767('0x5c')]({'where':{'id':_0x573cb6[_0x4767('0x63')]['id']}})[_0x4767('0x21')](handleEntityNotFound(_0x3a734d,null))[_0x4767('0x21')](function(_0x3741a2){if(_0x3741a2){return _0x3741a2[_0x4767('0x73')](_0x573cb6[_0x4767('0x5e')][_0x4767('0x6e')],_[_0x4767('0x74')](_0x573cb6[_0x4767('0x5e')],['ids','id'])||{});}})[_0x4767('0x21')](respondWithResult(_0x3a734d,null))['catch'](handleError(_0x3a734d,null));};exports[_0x4767('0x75')]=function(_0x333214,_0x1443da,_0x250462){var _0x3e51dd={'raw':![],'where':{}};var _0x2086b6={};var _0x24e572={'count':0x0,'rows':[]};return db[_0x4767('0x45')][_0x4767('0x69')]({'where':{'id':_0x333214['params']['id']}})[_0x4767('0x21')](handleEntityNotFound(_0x1443da,null))[_0x4767('0x21')](function(_0x22ffa8){if(_0x22ffa8){_0x2086b6[_0x4767('0x49')]=_[_0x4767('0x4b')](db[_0x4767('0x72')][_0x4767('0x46')]);_0x2086b6[_0x4767('0x4a')]=_[_0x4767('0x4b')](_0x333214[_0x4767('0x4a')]);_0x2086b6['filters']=_['intersection'](_0x2086b6[_0x4767('0x49')],_0x2086b6[_0x4767('0x4a')]);_0x3e51dd[_0x4767('0x4e')]=_['intersection'](_0x2086b6['model'],qs['fields'](_0x333214[_0x4767('0x4a')][_0x4767('0x4d')]));_0x3e51dd[_0x4767('0x4e')]=_0x3e51dd['attributes'][_0x4767('0x6a')]?_0x3e51dd['attributes']:_0x2086b6[_0x4767('0x49')];if(!_0x333214[_0x4767('0x4a')][_0x4767('0x4f')](_0x4767('0x50'))){_0x3e51dd['limit']=qs['limit'](_0x333214['query'][_0x4767('0x33')]);_0x3e51dd[_0x4767('0x31')]=qs[_0x4767('0x31')](_0x333214[_0x4767('0x4a')]['offset']);}_0x3e51dd[_0x4767('0x6b')]=qs[_0x4767('0x51')](_0x333214[_0x4767('0x4a')][_0x4767('0x51')]);_0x3e51dd[_0x4767('0x52')]=qs['filters'](_[_0x4767('0x6c')](_0x333214[_0x4767('0x4a')],_0x2086b6[_0x4767('0x53')]));_0x3e51dd[_0x4767('0x52')][_0x4767('0x66')]=_0x22ffa8['id'];if(_0x333214[_0x4767('0x4a')][_0x4767('0x54')]){_0x3e51dd['where']=_[_0x4767('0x55')](_0x3e51dd['where'],{'$or':_[_0x4767('0x44')](_0x3e51dd[_0x4767('0x4e')],function(_0x1402c2){var _0x127c74={};_0x127c74[_0x1402c2]={'$like':'%'+_0x333214[_0x4767('0x4a')][_0x4767('0x54')]+'%'};return _0x127c74;})});}_0x3e51dd=_['merge']({},_0x3e51dd,_0x333214[_0x4767('0x57')]);return db['FaxInteraction']['count']({'where':_0x3e51dd[_0x4767('0x52')]})['then'](function(_0x3fcc5a){_0x24e572[_0x4767('0x34')]=_0x3fcc5a;if(_0x333214[_0x4767('0x4a')][_0x4767('0x58')]){_0x3e51dd[_0x4767('0x59')]=[{'model':db[_0x4767('0x76')],'as':_0x4767('0x77'),'required':![]},{'model':db[_0x4767('0x78')],'as':_0x4767('0x79'),'attributes':[_0x4767('0x3f'),_0x4767('0x7a'),'internal'],'required':![]},{'model':db[_0x4767('0x7b')],'as':_0x4767('0x7c'),'attributes':['id',_0x4767('0x3f'),_0x4767('0x7d')],'where':_0x333214[_0x4767('0x4a')][_0x4767('0x7e')]?{'id':_0x333214[_0x4767('0x4a')]['tag']}:undefined,'required':_0x333214[_0x4767('0x4a')]['tag']?!![]:![]}];}return db[_0x4767('0x72')][_0x4767('0x5a')](_0x3e51dd);})[_0x4767('0x21')](function(_0x339621){_0x24e572[_0x4767('0x5b')]=_0x339621;return _0x24e572;});}})[_0x4767('0x21')](respondWithFilteredResult(_0x1443da,_0x3e51dd))[_0x4767('0x2c')](handleError(_0x1443da,null));};exports[_0x4767('0x7f')]=function(_0x2f2f5e,_0x495716){var _0x18c796=_0x2f2f5e[_0x4767('0x63')]['id'];var _0x22e4bc=_0x2f2f5e[_0x4767('0x5e')];var _0x44649f=0xc8;var _0x56c482=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0x4767('0x80')][_0x4767('0x81')]['READ_COMMITTED']},function(_0x2341d2){return db[_0x4767('0x45')][_0x4767('0x69')]({'where':{'id':_0x18c796},'transaction':_0x2341d2})[_0x4767('0x21')](function(_0x37ef0d){if(_0x37ef0d){return db[_0x4767('0x82')]['destroy']({'where':{'FaxAccountId':_0x18c796},'transaction':_0x2341d2})[_0x4767('0x21')](function(){var _0x261ea8=_['map'](_0x22e4bc,function(_0x35e8b7){_0x35e8b7[_0x4767('0x66')]=_0x18c796;return _0x35e8b7;});return db[_0x4767('0x82')][_0x4767('0x83')](_0x261ea8,{'transaction':_0x2341d2});});}else{_0x44649f=0x194;_0x56c482=[];}});})[_0x4767('0x21')](function(){if(_0x44649f!==0x194){return db['FaxApplication'][_0x4767('0x84')]({'where':{'FaxAccountId':_0x18c796},'order':_0x4767('0x85')})[_0x4767('0x21')](function(_0x2eb0e3){_0x56c482=_0x2eb0e3;});}})[_0x4767('0x2c')](function(_0x361834){_0x44649f=0x1f4;logger[_0x4767('0x27')](_0x361834[_0x4767('0x86')]);if(_0x361834['name']){delete _0x361834[_0x4767('0x3f')];}_0x56c482=_0x361834;})[_0x4767('0x87')](function(){if(_0x56c482===null){_0x495716[_0x4767('0x2d')](_0x44649f);}else{if(_0x44649f===0x1f4){_0x495716[_0x4767('0x2f')](_0x44649f)[_0x4767('0x40')](_0x56c482);}else{_0x495716[_0x4767('0x2f')](_0x44649f)[_0x4767('0x30')](_0x56c482);}}});};exports['getApplications']=function(_0x1dd31b,_0x4e3efb,_0x260acd){var _0x3a0e3c={};var _0x169ede={};var _0x1d2d55;var _0x59a209;return db[_0x4767('0x45')]['findOne']({'where':{'id':_0x1dd31b[_0x4767('0x63')]['id']}})[_0x4767('0x21')](handleEntityNotFound(_0x4e3efb,null))[_0x4767('0x21')](function(_0x506fee){if(_0x506fee){_0x1d2d55=_0x506fee;_0x169ede['model']=_[_0x4767('0x4b')](db[_0x4767('0x82')][_0x4767('0x46')]);_0x169ede['query']=_[_0x4767('0x4b')](_0x1dd31b[_0x4767('0x4a')]);_0x169ede[_0x4767('0x53')]=_['intersection'](_0x169ede['model'],_0x169ede['query']);_0x3a0e3c[_0x4767('0x4e')]=_['intersection'](_0x169ede[_0x4767('0x49')],qs[_0x4767('0x4d')](_0x1dd31b[_0x4767('0x4a')][_0x4767('0x4d')]));_0x3a0e3c[_0x4767('0x4e')]=_0x3a0e3c[_0x4767('0x4e')][_0x4767('0x6a')]?_0x3a0e3c[_0x4767('0x4e')]:_0x169ede['model'];_0x3a0e3c['order']=qs[_0x4767('0x51')](_0x1dd31b['query'][_0x4767('0x51')]);_0x3a0e3c['where']=qs[_0x4767('0x53')](_[_0x4767('0x6c')](_0x1dd31b[_0x4767('0x4a')],_0x169ede[_0x4767('0x53')]));if(_0x1dd31b['query'][_0x4767('0x54')]){_0x3a0e3c[_0x4767('0x52')]=_[_0x4767('0x55')](_0x3a0e3c['where'],{'$or':_[_0x4767('0x44')](_0x3a0e3c[_0x4767('0x4e')],function(_0x1ddc33){var _0x2201bd={};_0x2201bd[_0x1ddc33]={'$like':'%'+_0x1dd31b[_0x4767('0x4a')][_0x4767('0x54')]+'%'};return _0x2201bd;})});}_0x3a0e3c=_[_0x4767('0x55')]({},_0x3a0e3c,_0x1dd31b[_0x4767('0x57')]);return _0x1d2d55[_0x4767('0x88')](_0x3a0e3c);}})[_0x4767('0x21')](function(_0x2d7589){if(_0x2d7589){_0x59a209=_0x2d7589[_0x4767('0x6a')];if(!_0x1dd31b[_0x4767('0x4a')]['hasOwnProperty'](_0x4767('0x50'))){_0x3a0e3c[_0x4767('0x33')]=qs[_0x4767('0x33')](_0x1dd31b[_0x4767('0x4a')][_0x4767('0x33')]);_0x3a0e3c[_0x4767('0x31')]=qs['offset'](_0x1dd31b[_0x4767('0x4a')][_0x4767('0x31')]);}return _0x1d2d55[_0x4767('0x88')](_0x3a0e3c);}})[_0x4767('0x21')](function(_0x43e8c1){if(_0x43e8c1){return _0x43e8c1?{'count':_0x59a209,'rows':_0x43e8c1}:null;}})['then'](respondWithResult(_0x4e3efb,null))['catch'](handleError(_0x4e3efb,null));};function Extension(_0x52a578,_0x55a77c,_0x11311a,_0x170a5a){this[_0x4767('0x89')]='from-voip-provider';this['exten']=_0x52a578[_0x4767('0x8a')];this[_0x4767('0x8b')]=_0x170a5a;this['type']=_0x4767('0x8c');this[_0x4767('0x8d')]=_0x4767('0x8e');this['FaxAccountId']=_0x52a578['id'];this[_0x4767('0x85')]=_0x55a77c;this[_0x4767('0x8f')]=_0x11311a;}function createExtensionsReciveFax(_0xd7bca){var _0x35b747=0x1;var _0x156875=[];_0x156875[_0x4767('0x90')](new Extension(_0xd7bca,_0x35b747,'',_0x4767('0x91')));_0x35b747+=0x1;_0x156875[_0x4767('0x90')](new Extension(_0xd7bca,_0x35b747,_0x4767('0x92'),_0x4767('0x93')));_0x35b747+=0x1;for(var _0x44778c in _0xd7bca){if(_0xd7bca[_0x4767('0x4f')](_0x44778c)&&(_0x44778c===_0x4767('0x94')||_0x44778c==='localstationid'||_0x44778c==='gateway'||_0x44778c==='faxdetect'||_0x44778c===_0x4767('0x95')||_0x44778c===_0x4767('0x96')||_0x44778c===_0x4767('0x97')||_0x44778c===_0x4767('0x98')||_0x44778c===_0x4767('0x99'))){_0x156875['push'](new Extension(_0xd7bca,_0x35b747,_0x4767('0x9a')+_0x44778c+')='+_0xd7bca[_0x44778c],'Set'));_0x35b747+=0x1;}}_0x156875[_0x4767('0x90')](new Extension(_0xd7bca,_0x35b747,'6','Wait'));_0x35b747+=0x1;_0x156875[_0x4767('0x90')](new Extension(_0xd7bca,_0x35b747,_0x4767('0x9b'),'ReceiveFax'));_0x35b747=0x0;return _0x156875;}exports['addAccountApplications']=function(_0x1af496,_0x4848e9,_0x5c6f5e){var _0x5aadf5;return db[_0x4767('0x9c')]['transaction'](function(_0xf9837e){return db[_0x4767('0x45')][_0x4767('0x5d')](_0x1af496[_0x4767('0x5e')],{'transaction':_0xf9837e})[_0x4767('0x21')](function(_0x239b11){_0x5aadf5=_0x239b11['get']({'plain':!![]});return db[_0x4767('0x9d')][_0x4767('0x83')](createExtensionsReciveFax(_0x5aadf5),{'transaction':_0xf9837e});});})['then'](function(){return _0x5aadf5;})[_0x4767('0x21')](respondWithResult(_0x4848e9,null))[_0x4767('0x2c')](handleError(_0x4848e9,null));};exports['updateAccountApplications']=function(_0x4125d8,_0x5e382d,_0x19e6e7){var _0x33bf20;return db[_0x4767('0x9c')]['transaction'](function(_0x59fed7){return db['FaxAccount']['update'](_0x4125d8[_0x4767('0x5e')],{'where':{'id':_0x4125d8['body']['id']},'transaction':_0x59fed7})[_0x4767('0x21')](function(_0x15c83b){return db[_0x4767('0x9d')][_0x4767('0x3b')]({'where':{'FaxAccountId':_0x4125d8['body']['id']},'transaction':_0x59fed7})[_0x4767('0x21')](function(_0x3dd24f){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0x4767('0x74')](_0x4125d8[_0x4767('0x5e')],[_0x4767('0x9e'),_0x4767('0x9f'),'createdAt',_0x4767('0xa0'),'TrunkId','ListId'])),{'transaction':_0x59fed7});});});})[_0x4767('0x21')](function(){return db[_0x4767('0x45')][_0x4767('0xa1')](_0x4125d8['body']['id']);})[_0x4767('0x21')](respondWithResult(_0x5e382d,null))[_0x4767('0x2c')](handleError(_0x5e382d,null));};exports[_0x4767('0xa2')]=function(_0x5a489f,_0x7880cb,_0x10c008){var _0x40d28e={'raw':!![],'where':{}};var _0x58a97a={};var _0xe6baae={'count':0x0,'rows':[]};return db[_0x4767('0x45')][_0x4767('0x69')]({'where':{'id':_0x5a489f[_0x4767('0x63')]['id']}})[_0x4767('0x21')](handleEntityNotFound(_0x7880cb,null))[_0x4767('0x21')](function(_0x8c86a6){if(_0x8c86a6){_0x58a97a[_0x4767('0x49')]=_['keys'](db[_0x4767('0xa3')][_0x4767('0x46')]);_0x58a97a[_0x4767('0x4a')]=_['keys'](_0x5a489f[_0x4767('0x4a')]);_0x58a97a[_0x4767('0x53')]=_[_0x4767('0x4c')](_0x58a97a['model'],_0x58a97a[_0x4767('0x4a')]);_0x40d28e[_0x4767('0x4e')]=_[_0x4767('0x4c')](_0x58a97a[_0x4767('0x49')],qs[_0x4767('0x4d')](_0x5a489f[_0x4767('0x4a')][_0x4767('0x4d')]));_0x40d28e[_0x4767('0x4e')]=_0x40d28e[_0x4767('0x4e')][_0x4767('0x6a')]?_0x40d28e[_0x4767('0x4e')]:_0x58a97a[_0x4767('0x49')];if(!_0x5a489f['query'][_0x4767('0x4f')](_0x4767('0x50'))){_0x40d28e[_0x4767('0x33')]=qs[_0x4767('0x33')](_0x5a489f['query']['limit']);_0x40d28e['offset']=qs['offset'](_0x5a489f[_0x4767('0x4a')]['offset']);}_0x40d28e[_0x4767('0x6b')]=qs[_0x4767('0x51')](_0x5a489f['query'][_0x4767('0x51')]);_0x40d28e['where']=qs[_0x4767('0x53')](_[_0x4767('0x6c')](_0x5a489f[_0x4767('0x4a')],_0x58a97a[_0x4767('0x53')]));_0x40d28e[_0x4767('0x52')][_0x4767('0x66')]=_0x8c86a6['id'];if(_0x5a489f[_0x4767('0x4a')][_0x4767('0x54')]){_0x40d28e[_0x4767('0x52')]=_[_0x4767('0x55')](_0x40d28e[_0x4767('0x52')],{'$or':_[_0x4767('0x44')](_0x40d28e[_0x4767('0x4e')],function(_0x324950){var _0x3990ec={};_0x3990ec[_0x324950]={'$like':'%'+_0x5a489f[_0x4767('0x4a')]['filter']+'%'};return _0x3990ec;})});}if(_0x5a489f[_0x4767('0x4a')][_0x4767('0xa4')]){var _0x4ec22d=_0x5a489f[_0x4767('0x4a')][_0x4767('0xa4')]['split'](',');var _0x2045a4={};_0x2045a4[_0x4ec22d[0x0]]={'$gte':moment(_0x4ec22d[0x1])['format'](_0x4767('0xa5'))};_0x40d28e['where']=_[_0x4767('0x55')](_0x40d28e[_0x4767('0x52')],_0x2045a4);}_0x40d28e=_['merge']({},_0x40d28e,_0x5a489f[_0x4767('0x57')]);return db['FaxMessage']['count']({'where':_0x40d28e[_0x4767('0x52')]})[_0x4767('0x21')](function(_0x5020c7){_0xe6baae[_0x4767('0x34')]=_0x5020c7;if(_0x5a489f[_0x4767('0x4a')][_0x4767('0x58')]){_0x40d28e[_0x4767('0x59')]=[{'all':!![]}];}return db[_0x4767('0xa3')][_0x4767('0x5a')](_0x40d28e);})[_0x4767('0x21')](function(_0xbd19c1){_0xe6baae[_0x4767('0x5b')]=_0xbd19c1;return _0xe6baae;});}})[_0x4767('0x21')](respondWithFilteredResult(_0x7880cb,_0x40d28e))['catch'](handleError(_0x7880cb,null));};exports['send']=function(_0x10445a,_0x173054,_0x2d346a){var _0x4db741,_0x1641b5={},_0x16161d;if(_0x10445a[_0x4767('0x5e')]['to']){_0x16161d=_0x10445a[_0x4767('0x5e')]['to'][0x0];}return db[_0x4767('0x45')][_0x4767('0x5c')]({'where':{'id':_0x10445a['params']['id']},'include':[{'model':db[_0x4767('0xa6')],'as':'List','include':[{'model':db[_0x4767('0x76')],'as':'Contacts','where':{'fax':_0x16161d},'limit':0x1,'order':[[_0x4767('0xa0'),_0x4767('0xa7')]]}]}]})['then'](handleEntityNotFound(_0x173054,null))[_0x4767('0x21')](function(_0x25129e){_0x4db741=_0x25129e;if(_0x10445a['body'][_0x4767('0xa8')]&&_0x10445a['body'][_0x4767('0xa8')][_0x4767('0x6a')]){for(var _0x52a016=0x0;_0x52a016<_0x10445a[_0x4767('0x5e')][_0x4767('0xa8')]['length'];_0x52a016+=0x1){_0x10445a[_0x4767('0x5e')][_0x4767('0xa8')][_0x52a016]={'filename':_0x10445a['body'][_0x4767('0xa8')][_0x52a016][_0x4767('0x3f')],'id':_0x10445a['body']['attachments'][_0x52a016]['id'],'path':path[_0x4767('0xa9')](config['root'],'server/files/attachments',_0x10445a[_0x4767('0x5e')][_0x4767('0xa8')][_0x52a016][_0x4767('0xaa')])};}}return respondWithRpcPromise(_0x4767('0xab'),_0x4767('0xab'),{'FaxAccountId':_[_0x4767('0xac')](_0x10445a['params']['id'])?undefined:_0x10445a[_0x4767('0x63')]['id'],'path':_[_0x4767('0xac')](_0x10445a[_0x4767('0x5e')]['attachments'][0x0]['path'])?undefined:_0x10445a[_0x4767('0x5e')][_0x4767('0xa8')][0x0][_0x4767('0x4')],'fax':_[_0x4767('0xac')](_0x10445a['body']['to'][0x0])?undefined:_0x10445a['body']['to'][0x0]},client9002);})[_0x4767('0x21')](function(){if(_0x4db741){if(_[_0x4767('0xac')](_0x10445a[_0x4767('0x5e')][_0x4767('0xad')])){_0x10445a[_0x4767('0x5e')][_0x4767('0xad')]=util[_0x4767('0xae')]('\x22%s\x22\x20<%s>',_0x4db741[_0x4767('0x3f')],_0x4db741[_0x4767('0xaf')]);}if(_0x4db741['List']){if(_0x4db741['List']['Contacts'][_0x4767('0x6a')]){return _0x4db741[_0x4767('0xb0')]['Contacts'][0x0];}else{return db[_0x4767('0x76')]['create'](_[_0x4767('0x19')](_0x10445a[_0x4767('0x5e')],{'firstName':_0x10445a[_0x4767('0x5e')]['to'][0x0],'phone':_0x10445a[_0x4767('0x5e')]['to'][0x0],'fax':_0x10445a[_0x4767('0x5e')]['to'][0x0],'ListId':_0x4db741['ListId']}));}}else{throw new Error(_0x4767('0xb1'));}}else{throw new Error(_0x4767('0xb2'));}})[_0x4767('0x21')](function(_0x671adb){if(_0x671adb){return db[_0x4767('0x72')][_0x4767('0x5c')]({'where':{'ContactId':_0x671adb['id'],'closed':![],'FaxAccountId':_0x4db741['id']}})[_0x4767('0x21')](function(_0x23e86a){if(_0x23e86a){return[_0x23e86a,![]];}return db[_0x4767('0x72')][_0x4767('0x5d')]({'UserId':_0x10445a[_0x4767('0xb3')]['id'],'ContactId':_0x671adb['id'],'FaxAccountId':_0x4db741['id'],'fax':_0x10445a['body']['to'][0x0],'firstMsgDirection':_0x4767('0xb4'),'Messages':[_['merge'](_0x10445a[_0x4767('0x5e')],{'read':![],'body':_0x10445a[_0x4767('0x5e')][_0x4767('0xa8')][0x0]['filename'],'FaxAccountId':_0x4db741['id'],'UserId':_0x10445a[_0x4767('0xb3')]['id'],'ContactId':_0x671adb['id'],'AttachmentId':_0x10445a[_0x4767('0x5e')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x4767('0xa3')],'as':'Messages'}]})[_0x4767('0x21')](function(_0x3078b3){return[_0x3078b3,!![]];});});}else{throw new Error(_0x4767('0xb5'));}})['spread'](function(_0x11b490,_0x25771e){if(_0x25771e){return _0x11b490;}return db[_0x4767('0xa3')][_0x4767('0x5d')]({'direction':_0x4767('0xb4'),'read':![],'body':_0x10445a[_0x4767('0x5e')][_0x4767('0xa8')][0x0]['filename'],'FaxAccountId':_0x4db741['id'],'FaxInteractionId':_0x11b490['id'],'UserId':_0x10445a[_0x4767('0xb3')]['id'],'ContactId':_0x11b490[_0x4767('0xb6')],'AttachmentId':_0x10445a['body'][_0x4767('0xa8')][0x0]['id']})[_0x4767('0x21')](function(_0x3eb47b){_0x11b490['dataValues']['Messages']=[];_0x11b490[_0x4767('0xb7')]['Messages']['push'](_0x3eb47b['dataValues']);return _0x11b490;});})[_0x4767('0x21')](function(_0x574d58){respondWithRpcPromise(_0x4767('0xb8'),_0x4767('0xb8'),{'FaxAccountId':_[_0x4767('0xac')](_0x10445a['params']['id'])?undefined:_0x10445a[_0x4767('0x63')]['id'],'path':_[_0x4767('0xac')](_0x10445a[_0x4767('0x5e')][_0x4767('0xa8')][0x0][_0x4767('0x4')])?undefined:_0x10445a[_0x4767('0x5e')][_0x4767('0xa8')][0x0][_0x4767('0x4')],'fax':_[_0x4767('0xac')](_0x10445a['body']['to'][0x0])?undefined:_0x10445a[_0x4767('0x5e')]['to'][0x0],'AttachmentId':_0x10445a['body'][_0x4767('0xa8')][0x0]['id']},client9002)[_0x4767('0x21')](function(_0x32c095){logger[_0x4767('0x22')](_0x4767('0xb9'),_0x32c095);})[_0x4767('0x2c')](function(_0xb8aeb6){logger['info']('SendFaxRpc,\x20%s',_0xb8aeb6);});return _0x574d58;})['then'](respondWithResult(_0x173054,null))['catch'](handleError(_0x173054,null));};exports[_0x4767('0xba')]=function(_0x5cfc44,_0x8435bb,_0x15c975){return db[_0x4767('0x45')][_0x4767('0x5c')]({'where':{'id':_0x5cfc44[_0x4767('0x63')]['id']}})['then'](handleEntityNotFound(_0x8435bb,null))[_0x4767('0x21')](function(_0x12e0cb){if(_0x12e0cb){return _0x12e0cb['addAgents'](_0x5cfc44['body']['ids'],_[_0x4767('0x74')](_0x5cfc44[_0x4767('0x5e')],[_0x4767('0x6e'),'id'])||{})['spread'](function(_0x2507a9){for(var _0x4e04f6=0x0;_0x4e04f6<_0x5cfc44[_0x4767('0x5e')][_0x4767('0x6e')]['length'];_0x4e04f6+=0x1){socket['emit'](_0x4767('0xbb'),{'UserId':Number(_0x5cfc44[_0x4767('0x5e')][_0x4767('0x6e')][_0x4e04f6]),'FaxAccountId':Number(_0x5cfc44[_0x4767('0x63')]['id'])});}return _0x2507a9;});}})[_0x4767('0x21')](respondWithResult(_0x8435bb,null))[_0x4767('0x2c')](handleError(_0x8435bb,null));};exports[_0x4767('0xbc')]=function(_0x598803,_0x4ca7aa,_0x37773b){return db[_0x4767('0x45')][_0x4767('0x5c')]({'where':{'id':_0x598803[_0x4767('0x63')]['id']}})[_0x4767('0x21')](handleEntityNotFound(_0x4ca7aa,null))[_0x4767('0x21')](function(_0x1d1dfe){if(_0x1d1dfe){return _0x1d1dfe[_0x4767('0xbc')](_0x598803[_0x4767('0x4a')]['ids'])[_0x4767('0x21')](function(){if(_['isArray'](_0x598803[_0x4767('0x4a')]['ids'])){for(var _0x61ee6b=0x0;_0x61ee6b<_0x598803[_0x4767('0x4a')][_0x4767('0x6e')][_0x4767('0x6a')];_0x61ee6b+=0x1){socket[_0x4767('0xbd')](_0x4767('0xbe'),{'UserId':Number(_0x598803[_0x4767('0x4a')][_0x4767('0x6e')][_0x61ee6b]),'FaxAccountId':Number(_0x598803[_0x4767('0x63')]['id'])});}}else{socket[_0x4767('0xbd')](_0x4767('0xbe'),{'UserId':Number(_0x598803['query']['ids']),'FaxAccountId':Number(_0x598803[_0x4767('0x63')]['id'])});}});}})[_0x4767('0x21')](respondWithStatusCode(_0x4ca7aa,null))[_0x4767('0x2c')](handleError(_0x4ca7aa,null));};exports[_0x4767('0xbf')]=function(_0x4925ce,_0x1a93fe,_0x321b95){var _0x996767={};var _0x36be8e={};var _0x45b2cb;var _0x2e6069;return db['FaxAccount'][_0x4767('0x69')]({'where':{'id':_0x4925ce['params']['id']}})[_0x4767('0x21')](handleEntityNotFound(_0x1a93fe,null))[_0x4767('0x21')](function(_0xfa0813){if(_0xfa0813){_0x45b2cb=_0xfa0813;_0x36be8e[_0x4767('0x49')]=_[_0x4767('0x4b')](db[_0x4767('0x78')][_0x4767('0x46')]);_0x36be8e[_0x4767('0x4a')]=_[_0x4767('0x4b')](_0x4925ce['query']);_0x36be8e[_0x4767('0x53')]=_[_0x4767('0x4c')](_0x36be8e['model'],_0x36be8e[_0x4767('0x4a')]);_0x996767[_0x4767('0x4e')]=_[_0x4767('0x4c')](_0x36be8e['model'],qs[_0x4767('0x4d')](_0x4925ce[_0x4767('0x4a')][_0x4767('0x4d')]));_0x996767[_0x4767('0x4e')]=_0x996767['attributes'][_0x4767('0x6a')]?_0x996767['attributes']:_0x36be8e[_0x4767('0x49')];_0x996767[_0x4767('0x6b')]=qs[_0x4767('0x51')](_0x4925ce[_0x4767('0x4a')][_0x4767('0x51')]);_0x996767[_0x4767('0x52')]=qs[_0x4767('0x53')](_['pick'](_0x4925ce[_0x4767('0x4a')],_0x36be8e[_0x4767('0x53')]));if(_0x4925ce['query'][_0x4767('0x54')]){_0x996767[_0x4767('0x52')]=_[_0x4767('0x55')](_0x996767[_0x4767('0x52')],{'$or':_['map'](_0x996767[_0x4767('0x4e')],function(_0x1974e0){var _0x124f57={};_0x124f57[_0x1974e0]={'$like':'%'+_0x4925ce[_0x4767('0x4a')]['filter']+'%'};return _0x124f57;})});}_0x996767=_['merge']({},_0x996767,_0x4925ce[_0x4767('0x57')]);return _0x45b2cb[_0x4767('0xbf')](_0x996767);}})[_0x4767('0x21')](function(_0x5aca33){if(_0x5aca33){_0x2e6069=_0x5aca33['length'];if(!_0x4925ce[_0x4767('0x4a')][_0x4767('0x4f')](_0x4767('0x50'))){_0x996767[_0x4767('0x33')]=qs[_0x4767('0x33')](_0x4925ce[_0x4767('0x4a')][_0x4767('0x33')]);_0x996767[_0x4767('0x31')]=qs[_0x4767('0x31')](_0x4925ce[_0x4767('0x4a')][_0x4767('0x31')]);}return _0x45b2cb[_0x4767('0xbf')](_0x996767);}})[_0x4767('0x21')](function(_0x25daa9){if(_0x25daa9){return _0x25daa9?{'count':_0x2e6069,'rows':_0x25daa9}:null;}})['then'](respondWithResult(_0x1a93fe,null))[_0x4767('0x2c')](handleError(_0x1a93fe,null));};
\ No newline at end of file
+var _0x073c=['moment','path','sox','to-csv','ejs','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxAccount.socket','jayson/promise','http','client','request','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','get','FaxAccounts','UserProfileResource','stack','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','findOne','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','finally','getApplications','from-voip-provider','app','system','description','Fax\x20Extension','appdata','push','Answer','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','Messages','Contact\x20not\x20found','spread','filename','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','fast-json-patch'];(function(_0x213179,_0x3a73fb){var _0x530a6a=function(_0x4b401f){while(--_0x4b401f){_0x213179['push'](_0x213179['shift']());}};_0x530a6a(++_0x3a73fb);}(_0x073c,0x187));var _0xc073=function(_0xbde666,_0x5ed16f){_0xbde666=_0xbde666-0x0;var _0x4374b4=_0x073c[_0xbde666];return _0x4374b4;};'use strict';var emlformat=require(_0xc073('0x0'));var rimraf=require(_0xc073('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc073('0x2'));var rp=require('request-promise');var moment=require(_0xc073('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc073('0x4'));var sox=require(_0xc073('0x5'));var csv=require(_0xc073('0x6'));var ejs=require(_0xc073('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc073('0x8'));var squel=require(_0xc073('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc073('0xa'));var toCsv=require(_0xc073('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc073('0xb'));var authService=require(_0xc073('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xc073('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc073('0xe'))(_0xc073('0xf'));var utils=require(_0xc073('0x10'));var config=require(_0xc073('0x11'));var licenseUtil=require(_0xc073('0x12'));var db=require(_0xc073('0x13'))['db'];config[_0xc073('0x14')]=_[_0xc073('0x15')](config[_0xc073('0x14')],{'host':_0xc073('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc073('0x17'))['register'](socket);var jayson=require(_0xc073('0x18'));var client=jayson['client'][_0xc073('0x19')]({'port':0x232c});var client9002=jayson[_0xc073('0x1a')][_0xc073('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x5de2dc,_0x7c6760,_0x57ff13,_0xca8382){return new BPromise(function(_0x18001f,_0x57c9ca){var _0xcba944=_0xca8382||client;return _0xcba944[_0xc073('0x1b')](_0x5de2dc,_0x57ff13)['then'](function(_0x34d19e){logger['info'](_0xc073('0x1c'),_0x7c6760,_0xc073('0x1d'));logger[_0xc073('0x1e')](_0xc073('0x1f'),_0x7c6760,'request\x20sent',JSON[_0xc073('0x20')](_0x34d19e));if(_0x34d19e[_0xc073('0x21')]){if(_0x34d19e[_0xc073('0x21')][_0xc073('0x22')]===0x1f4){logger[_0xc073('0x21')](_0xc073('0x1c'),_0x7c6760,_0x34d19e['error']['message']);return _0x57c9ca(_0x34d19e[_0xc073('0x21')][_0xc073('0x23')]);}logger['error'](_0xc073('0x1c'),_0x7c6760,_0x34d19e[_0xc073('0x21')][_0xc073('0x23')]);return _0x18001f(_0x34d19e['error']['message']);}else{logger[_0xc073('0x24')]('FaxAccount,\x20%s,\x20%s',_0x7c6760,_0xc073('0x1d'));_0x18001f(_0x34d19e[_0xc073('0x25')][_0xc073('0x23')]);}})[_0xc073('0x26')](function(_0x516a56){logger[_0xc073('0x21')](_0xc073('0x1c'),_0x7c6760,_0x516a56);_0x57c9ca(_0x516a56);});});}function respondWithStatusCode(_0x4e02a7,_0x4b6495){_0x4b6495=_0x4b6495||0xcc;return function(_0x4c93c5){if(_0x4c93c5){return _0x4e02a7[_0xc073('0x27')](_0x4b6495);}return _0x4e02a7[_0xc073('0x28')](_0x4b6495)[_0xc073('0x29')]();};}function respondWithResult(_0x4ebb2b,_0x177fe9){_0x177fe9=_0x177fe9||0xc8;return function(_0x4a452d){if(_0x4a452d){return _0x4ebb2b[_0xc073('0x28')](_0x177fe9)[_0xc073('0x2a')](_0x4a452d);}};}function respondWithFilteredResult(_0x32a2c5,_0x27ae81){return function(_0x1081f5){if(_0x1081f5){var _0x56738d=typeof _0x27ae81[_0xc073('0x2b')]===_0xc073('0x2c')&&typeof _0x27ae81[_0xc073('0x2d')]===_0xc073('0x2c');var _0x2fd2de=_0x1081f5[_0xc073('0x2e')];var _0x392f76=_0x56738d?0x0:_0x27ae81[_0xc073('0x2b')];var _0x152c26=_0x56738d?_0x1081f5[_0xc073('0x2e')]:_0x27ae81[_0xc073('0x2b')]+_0x27ae81['limit'];var _0xfbf95f;if(_0x152c26>=_0x2fd2de){_0x152c26=_0x2fd2de;_0xfbf95f=0xc8;}else{_0xfbf95f=0xce;}_0x32a2c5[_0xc073('0x28')](_0xfbf95f);return _0x32a2c5[_0xc073('0x2f')](_0xc073('0x30'),_0x392f76+'-'+_0x152c26+'/'+_0x2fd2de)['json'](_0x1081f5);}return null;};}function patchUpdates(_0x579274){return function(_0x45246c){try{jsonpatch[_0xc073('0x31')](_0x45246c,_0x579274,!![]);}catch(_0x41d7ec){return BPromise['reject'](_0x41d7ec);}return _0x45246c[_0xc073('0x32')]();};}function saveUpdates(_0x277aea,_0x1e405a){return function(_0x36c1ce){if(_0x36c1ce){return _0x36c1ce['update'](_0x277aea)[_0xc073('0x33')](function(_0x4b1ef5){return _0x4b1ef5;});}return null;};}function removeEntity(_0x91db5a,_0x25f500){return function(_0x3802db){if(_0x3802db){return _0x3802db[_0xc073('0x34')]()['then'](function(){var _0x2c35e7=_0x3802db[_0xc073('0x35')]({'plain':!![]});var _0x176934=_0xc073('0x36');return db[_0xc073('0x37')][_0xc073('0x34')]({'where':{'type':_0x176934,'resourceId':_0x2c35e7['id']}})[_0xc073('0x33')](function(){return _0x3802db;});})[_0xc073('0x33')](function(){_0x91db5a['status'](0xcc)[_0xc073('0x29')]();});}};}function handleEntityNotFound(_0x15afaa,_0x490bc9){return function(_0x2e67cd){if(!_0x2e67cd){_0x15afaa['sendStatus'](0x194);}return _0x2e67cd;};}function handleError(_0x39bb96,_0x5029be){_0x5029be=_0x5029be||0x1f4;return function(_0x52c00a){logger[_0xc073('0x21')](_0x52c00a[_0xc073('0x38')]);if(_0x52c00a['name']){delete _0x52c00a['name'];}_0x39bb96[_0xc073('0x28')](_0x5029be)[_0xc073('0x39')](_0x52c00a);};}exports[_0xc073('0x3a')]=function(_0x2181b8,_0x2a4e9f){var _0xb072fe={'include':[{'model':db[_0xc073('0x3b')],'as':_0xc073('0x3c')}]},_0x5704f8={},_0x3e2fa8={'count':0x0,'rows':[]};var _0x32cc83=_[_0xc073('0x3d')](db[_0xc073('0x3e')][_0xc073('0x3f')],function(_0x1143da){return{'name':_0x1143da[_0xc073('0x40')],'type':_0x1143da[_0xc073('0x41')][_0xc073('0x42')]};});_0x5704f8['model']=_[_0xc073('0x3d')](_0x32cc83,'name');_0x5704f8[_0xc073('0x43')]=_[_0xc073('0x44')](_0x2181b8[_0xc073('0x43')]);_0x5704f8[_0xc073('0x45')]=_['intersection'](_0x5704f8[_0xc073('0x46')],_0x5704f8[_0xc073('0x43')]);_0xb072fe[_0xc073('0x47')]=_[_0xc073('0x48')](_0x5704f8['model'],qs[_0xc073('0x49')](_0x2181b8['query']['fields']));_0xb072fe['attributes']=_0xb072fe[_0xc073('0x47')]['length']?_0xb072fe[_0xc073('0x47')]:_0x5704f8['model'];if(!_0x2181b8['query'][_0xc073('0x4a')](_0xc073('0x4b'))){_0xb072fe[_0xc073('0x2d')]=qs[_0xc073('0x2d')](_0x2181b8['query'][_0xc073('0x2d')]);_0xb072fe[_0xc073('0x2b')]=qs[_0xc073('0x2b')](_0x2181b8[_0xc073('0x43')][_0xc073('0x2b')]);}_0xb072fe[_0xc073('0x4c')]=qs[_0xc073('0x4d')](_0x2181b8[_0xc073('0x43')][_0xc073('0x4d')]);_0xb072fe[_0xc073('0x4e')]=qs['filters'](_[_0xc073('0x4f')](_0x2181b8[_0xc073('0x43')],_0x5704f8['filters']),_0x32cc83);if(_0x2181b8[_0xc073('0x43')][_0xc073('0x50')]){_0xb072fe['where']=_[_0xc073('0x51')](_0xb072fe[_0xc073('0x4e')],{'$or':_[_0xc073('0x3d')](_0x32cc83,function(_0x3ab7b8){if(_0x3ab7b8[_0xc073('0x41')]!==_0xc073('0x52')){var _0x52b997={};_0x52b997[_0x3ab7b8[_0xc073('0x53')]]={'$like':'%'+_0x2181b8['query'][_0xc073('0x50')]+'%'};return _0x52b997;}})});}_0xb072fe=_[_0xc073('0x51')]({},_0xb072fe,_0x2181b8[_0xc073('0x54')]);var _0x52cdb2={'where':_0xb072fe[_0xc073('0x4e')]};return db[_0xc073('0x3e')][_0xc073('0x2e')](_0x52cdb2)[_0xc073('0x33')](function(_0x1c722e){_0x3e2fa8[_0xc073('0x2e')]=_0x1c722e;if(_0x2181b8['query'][_0xc073('0x55')]){_0xb072fe[_0xc073('0x56')]=[{'all':!![]}];}return db[_0xc073('0x3e')][_0xc073('0x57')](_0xb072fe);})[_0xc073('0x33')](function(_0x3631ed){_0x3e2fa8[_0xc073('0x58')]=_0x3631ed;return _0x3e2fa8;})[_0xc073('0x33')](respondWithFilteredResult(_0x2a4e9f,_0xb072fe))[_0xc073('0x26')](handleError(_0x2a4e9f,null));};exports[_0xc073('0x59')]=function(_0x2c485b,_0x467d2e){var _0x2c763b={'raw':![],'where':{'id':_0x2c485b[_0xc073('0x5a')]['id']},'include':[{'model':db['Pause'],'as':_0xc073('0x3c')}]},_0x2f7814={};_0x2f7814[_0xc073('0x46')]=_[_0xc073('0x44')](db[_0xc073('0x3e')][_0xc073('0x3f')]);_0x2f7814[_0xc073('0x43')]=_['keys'](_0x2c485b[_0xc073('0x43')]);_0x2f7814[_0xc073('0x45')]=_[_0xc073('0x48')](_0x2f7814[_0xc073('0x46')],_0x2f7814[_0xc073('0x43')]);_0x2c763b['attributes']=_[_0xc073('0x48')](_0x2f7814['model'],qs[_0xc073('0x49')](_0x2c485b[_0xc073('0x43')][_0xc073('0x49')]));_0x2c763b[_0xc073('0x47')]=_0x2c763b[_0xc073('0x47')][_0xc073('0x5b')]?_0x2c763b[_0xc073('0x47')]:_0x2f7814[_0xc073('0x46')];if(_0x2c485b[_0xc073('0x43')][_0xc073('0x55')]){_0x2c763b[_0xc073('0x56')]=[{'all':!![]}];}_0x2c763b=_[_0xc073('0x51')]({},_0x2c763b,_0x2c485b[_0xc073('0x54')]);return db[_0xc073('0x3e')][_0xc073('0x5c')](_0x2c763b)[_0xc073('0x33')](handleEntityNotFound(_0x467d2e,null))[_0xc073('0x33')](respondWithResult(_0x467d2e,null))[_0xc073('0x26')](handleError(_0x467d2e,null));};exports[_0xc073('0x5d')]=function(_0x23d925,_0x4c9df7){return db[_0xc073('0x3e')][_0xc073('0x5d')](_0x23d925['body'],{})[_0xc073('0x33')](function(_0x432d3b){var _0x1fa549=_0x23d925[_0xc073('0x5e')][_0xc073('0x35')]({'plain':!![]});if(!_0x1fa549)throw new Error(_0xc073('0x5f'));if(_0x1fa549[_0xc073('0x60')]===_0xc073('0x5e')){var _0x57aa1c=_0x432d3b['get']({'plain':!![]});var _0x43b842=_0xc073('0x36');return db['UserProfileSection']['find']({'where':{'name':_0x43b842,'userProfileId':_0x1fa549['userProfileId']},'raw':!![]})['then'](function(_0x168cc9){if(_0x168cc9&&_0x168cc9[_0xc073('0x61')]===0x0){return db[_0xc073('0x37')]['create']({'name':_0x57aa1c[_0xc073('0x53')],'resourceId':_0x57aa1c['id'],'type':_0x168cc9[_0xc073('0x53')],'sectionId':_0x168cc9['id']},{})[_0xc073('0x33')](function(){return _0x432d3b;});}else{return _0x432d3b;}})['catch'](function(_0x31d055){logger['error'](_0xc073('0x62'),_0x31d055);throw _0x31d055;});}return _0x432d3b;})[_0xc073('0x33')](respondWithResult(_0x4c9df7,0xc9))[_0xc073('0x26')](handleError(_0x4c9df7,null));};exports[_0xc073('0x63')]=function(_0xd6e024,_0x31459b){if(_0xd6e024['body']['id']){delete _0xd6e024[_0xc073('0x64')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0xd6e024[_0xc073('0x5a')]['id']},'include':[{'model':db[_0xc073('0x3b')],'as':_0xc073('0x3c')}]})[_0xc073('0x33')](handleEntityNotFound(_0x31459b,null))[_0xc073('0x33')](saveUpdates(_0xd6e024[_0xc073('0x64')],null))[_0xc073('0x33')](respondWithResult(_0x31459b,null))[_0xc073('0x26')](handleError(_0x31459b,null));};exports[_0xc073('0x34')]=function(_0x3b6f73,_0x191e4d){return db[_0xc073('0x3e')][_0xc073('0x5c')]({'where':{'id':_0x3b6f73[_0xc073('0x5a')]['id']}})['then'](handleEntityNotFound(_0x191e4d,null))[_0xc073('0x33')](removeEntity(_0x191e4d,null))[_0xc073('0x26')](handleError(_0x191e4d,null));};exports[_0xc073('0x65')]=function(_0x1a42ff,_0x306b17){return db[_0xc073('0x3e')]['describe']()[_0xc073('0x33')](respondWithResult(_0x306b17,null))[_0xc073('0x26')](handleError(_0x306b17,null));};exports[_0xc073('0x66')]=function(_0x235606,_0x50f091,_0x4381cc){if(_0x235606['body']['id']){delete _0x235606['body']['id'];}return db[_0xc073('0x3e')]['find']({'where':{'id':_0x235606[_0xc073('0x5a')]['id']}})[_0xc073('0x33')](handleEntityNotFound(_0x50f091,null))[_0xc073('0x33')](function(_0x337f48){if(_0x337f48){_0x235606[_0xc073('0x64')][_0xc073('0x67')]=_0x337f48['id'];return db[_0xc073('0x68')][_0xc073('0x5d')](_0x235606['body']);}})[_0xc073('0x33')](respondWithResult(_0x50f091,null))['catch'](handleError(_0x50f091,null));};exports[_0xc073('0x69')]=function(_0x531429,_0x116d78,_0x3dc7e9){var _0x10a4d6={'raw':![],'where':{}};var _0x58fb23={};var _0x492bb9={'count':0x0,'rows':[]};return db[_0xc073('0x3e')]['findOne']({'where':{'id':_0x531429[_0xc073('0x5a')]['id']}})[_0xc073('0x33')](handleEntityNotFound(_0x116d78,null))[_0xc073('0x33')](function(_0x3203f4){if(_0x3203f4){_0x58fb23[_0xc073('0x46')]=_[_0xc073('0x44')](db['Disposition'][_0xc073('0x3f')]);_0x58fb23[_0xc073('0x43')]=_[_0xc073('0x44')](_0x531429[_0xc073('0x43')]);_0x58fb23[_0xc073('0x45')]=_[_0xc073('0x48')](_0x58fb23[_0xc073('0x46')],_0x58fb23[_0xc073('0x43')]);_0x10a4d6['attributes']=_[_0xc073('0x48')](_0x58fb23[_0xc073('0x46')],qs[_0xc073('0x49')](_0x531429['query'][_0xc073('0x49')]));_0x10a4d6[_0xc073('0x47')]=_0x10a4d6[_0xc073('0x47')][_0xc073('0x5b')]?_0x10a4d6[_0xc073('0x47')]:_0x58fb23[_0xc073('0x46')];if(!_0x531429['query'][_0xc073('0x4a')](_0xc073('0x4b'))){_0x10a4d6['limit']=qs[_0xc073('0x2d')](_0x531429[_0xc073('0x43')][_0xc073('0x2d')]);_0x10a4d6[_0xc073('0x2b')]=qs[_0xc073('0x2b')](_0x531429[_0xc073('0x43')][_0xc073('0x2b')]);}_0x10a4d6[_0xc073('0x4c')]=qs['sort'](_0x531429[_0xc073('0x43')][_0xc073('0x4d')]);_0x10a4d6[_0xc073('0x4e')]=qs[_0xc073('0x45')](_[_0xc073('0x4f')](_0x531429[_0xc073('0x43')],_0x58fb23['filters']));_0x10a4d6[_0xc073('0x4e')][_0xc073('0x67')]=_0x3203f4['id'];if(_0x531429['query']['filter']){_0x10a4d6[_0xc073('0x4e')]=_['merge'](_0x10a4d6[_0xc073('0x4e')],{'$or':_[_0xc073('0x3d')](_0x10a4d6[_0xc073('0x47')],function(_0x1b5bbe){var _0x19c666={};_0x19c666[_0x1b5bbe]={'$like':'%'+_0x531429[_0xc073('0x43')][_0xc073('0x50')]+'%'};return _0x19c666;})});}_0x10a4d6=_[_0xc073('0x51')]({},_0x10a4d6,_0x531429[_0xc073('0x54')]);return db[_0xc073('0x68')]['count']({'where':_0x10a4d6[_0xc073('0x4e')]})['then'](function(_0x1b4d56){_0x492bb9[_0xc073('0x2e')]=_0x1b4d56;if(_0x531429[_0xc073('0x43')][_0xc073('0x55')]){_0x10a4d6[_0xc073('0x56')]=[{'all':!![]}];}return db['Disposition'][_0xc073('0x57')](_0x10a4d6);})['then'](function(_0x5b7d03){_0x492bb9[_0xc073('0x58')]=_0x5b7d03;return _0x492bb9;});}})['then'](respondWithFilteredResult(_0x116d78,_0x10a4d6))['catch'](handleError(_0x116d78,null));};exports[_0xc073('0x6a')]=function(_0x4e5fe2,_0x113a76,_0x2f94bc){return db[_0xc073('0x3e')][_0xc073('0x5c')]({'where':{'id':_0x4e5fe2['params']['id']}})['then'](handleEntityNotFound(_0x113a76,null))[_0xc073('0x33')](function(_0x54b7f5){if(_0x54b7f5){return _0x54b7f5[_0xc073('0x6a')](_0x4e5fe2[_0xc073('0x43')][_0xc073('0x6b')]);}})[_0xc073('0x33')](respondWithStatusCode(_0x113a76,null))['catch'](handleError(_0x113a76,null));};exports[_0xc073('0x6c')]=function(_0x1f124d,_0x6a7a97,_0x4c093d){if(_0x1f124d[_0xc073('0x64')]['id']){delete _0x1f124d[_0xc073('0x64')]['id'];}return db['FaxAccount'][_0xc073('0x5c')]({'where':{'id':_0x1f124d['params']['id']}})[_0xc073('0x33')](handleEntityNotFound(_0x6a7a97,null))[_0xc073('0x33')](function(_0x4086aa){if(_0x4086aa){_0x1f124d[_0xc073('0x64')][_0xc073('0x67')]=_0x4086aa['id'];return db[_0xc073('0x6d')][_0xc073('0x5d')](_0x1f124d[_0xc073('0x64')]);}})['then'](respondWithResult(_0x6a7a97,null))[_0xc073('0x26')](handleError(_0x6a7a97,null));};exports[_0xc073('0x6e')]=function(_0x169205,_0x39c8fa,_0x11e9bb){var _0x1f2d77={'raw':![],'where':{}};var _0x41574c={};var _0x28eeeb={'count':0x0,'rows':[]};return db[_0xc073('0x3e')]['findOne']({'where':{'id':_0x169205[_0xc073('0x5a')]['id']}})[_0xc073('0x33')](handleEntityNotFound(_0x39c8fa,null))[_0xc073('0x33')](function(_0x4fc306){if(_0x4fc306){_0x41574c[_0xc073('0x46')]=_[_0xc073('0x44')](db[_0xc073('0x6d')]['rawAttributes']);_0x41574c['query']=_['keys'](_0x169205[_0xc073('0x43')]);_0x41574c[_0xc073('0x45')]=_[_0xc073('0x48')](_0x41574c[_0xc073('0x46')],_0x41574c['query']);_0x1f2d77[_0xc073('0x47')]=_[_0xc073('0x48')](_0x41574c['model'],qs['fields'](_0x169205[_0xc073('0x43')][_0xc073('0x49')]));_0x1f2d77[_0xc073('0x47')]=_0x1f2d77[_0xc073('0x47')][_0xc073('0x5b')]?_0x1f2d77[_0xc073('0x47')]:_0x41574c[_0xc073('0x46')];if(!_0x169205[_0xc073('0x43')]['hasOwnProperty'](_0xc073('0x4b'))){_0x1f2d77[_0xc073('0x2d')]=qs['limit'](_0x169205[_0xc073('0x43')][_0xc073('0x2d')]);_0x1f2d77['offset']=qs[_0xc073('0x2b')](_0x169205[_0xc073('0x43')][_0xc073('0x2b')]);}_0x1f2d77['order']=qs[_0xc073('0x4d')](_0x169205[_0xc073('0x43')][_0xc073('0x4d')]);_0x1f2d77[_0xc073('0x4e')]=qs[_0xc073('0x45')](_['pick'](_0x169205[_0xc073('0x43')],_0x41574c[_0xc073('0x45')]));_0x1f2d77['where'][_0xc073('0x67')]=_0x4fc306['id'];if(_0x169205['query'][_0xc073('0x50')]){_0x1f2d77[_0xc073('0x4e')]=_[_0xc073('0x51')](_0x1f2d77['where'],{'$or':_[_0xc073('0x3d')](_0x1f2d77[_0xc073('0x47')],function(_0x4ac694){var _0x396de5={};_0x396de5[_0x4ac694]={'$like':'%'+_0x169205[_0xc073('0x43')][_0xc073('0x50')]+'%'};return _0x396de5;})});}_0x1f2d77=_[_0xc073('0x51')]({},_0x1f2d77,_0x169205[_0xc073('0x54')]);return db['CannedAnswer'][_0xc073('0x2e')]({'where':_0x1f2d77[_0xc073('0x4e')]})[_0xc073('0x33')](function(_0x1cf809){_0x28eeeb[_0xc073('0x2e')]=_0x1cf809;if(_0x169205[_0xc073('0x43')][_0xc073('0x55')]){_0x1f2d77[_0xc073('0x56')]=[{'all':!![]}];}return db[_0xc073('0x6d')][_0xc073('0x57')](_0x1f2d77);})[_0xc073('0x33')](function(_0x555207){_0x28eeeb[_0xc073('0x58')]=_0x555207;return _0x28eeeb;});}})[_0xc073('0x33')](respondWithFilteredResult(_0x39c8fa,_0x1f2d77))['catch'](handleError(_0x39c8fa,null));};exports[_0xc073('0x6f')]=function(_0x260c5f,_0x11bbca,_0x298a96){return db[_0xc073('0x3e')]['find']({'where':{'id':_0x260c5f[_0xc073('0x5a')]['id']}})[_0xc073('0x33')](handleEntityNotFound(_0x11bbca,null))[_0xc073('0x33')](function(_0x5b6e31){if(_0x5b6e31){return _0x5b6e31[_0xc073('0x6f')](_0x260c5f['query'][_0xc073('0x6b')]);}})[_0xc073('0x33')](respondWithStatusCode(_0x11bbca,null))[_0xc073('0x26')](handleError(_0x11bbca,null));};exports[_0xc073('0x70')]=function(_0x576a96,_0x4ce77a,_0x433426){return db[_0xc073('0x71')][_0xc073('0x5c')]({'where':{'id':_0x576a96[_0xc073('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4ce77a,null))['then'](function(_0x4dafaf){if(_0x4dafaf){return _0x4dafaf[_0xc073('0x70')](_0x576a96['body'][_0xc073('0x6b')],_[_0xc073('0x72')](_0x576a96[_0xc073('0x64')],[_0xc073('0x6b'),'id'])||{});}})[_0xc073('0x33')](respondWithResult(_0x4ce77a,null))[_0xc073('0x26')](handleError(_0x4ce77a,null));};exports['getInteractions']=function(_0x3f3f75,_0x31e8f0,_0x5a1d68){var _0x167f0f={'raw':![],'where':{}};var _0x5a2d4a={};var _0x502125={'count':0x0,'rows':[]};return db[_0xc073('0x3e')][_0xc073('0x73')]({'where':{'id':_0x3f3f75['params']['id']}})[_0xc073('0x33')](handleEntityNotFound(_0x31e8f0,null))['then'](function(_0x3c5296){if(_0x3c5296){_0x5a2d4a[_0xc073('0x46')]=_[_0xc073('0x44')](db[_0xc073('0x71')][_0xc073('0x3f')]);_0x5a2d4a['query']=_[_0xc073('0x44')](_0x3f3f75[_0xc073('0x43')]);_0x5a2d4a[_0xc073('0x45')]=_[_0xc073('0x48')](_0x5a2d4a[_0xc073('0x46')],_0x5a2d4a[_0xc073('0x43')]);_0x167f0f['attributes']=_[_0xc073('0x48')](_0x5a2d4a[_0xc073('0x46')],qs[_0xc073('0x49')](_0x3f3f75[_0xc073('0x43')][_0xc073('0x49')]));_0x167f0f['attributes']=_0x167f0f[_0xc073('0x47')][_0xc073('0x5b')]?_0x167f0f[_0xc073('0x47')]:_0x5a2d4a['model'];if(!_0x3f3f75[_0xc073('0x43')][_0xc073('0x4a')](_0xc073('0x4b'))){_0x167f0f[_0xc073('0x2d')]=qs['limit'](_0x3f3f75[_0xc073('0x43')][_0xc073('0x2d')]);_0x167f0f['offset']=qs[_0xc073('0x2b')](_0x3f3f75[_0xc073('0x43')]['offset']);}_0x167f0f[_0xc073('0x4c')]=qs['sort'](_0x3f3f75[_0xc073('0x43')][_0xc073('0x4d')]);_0x167f0f[_0xc073('0x4e')]=qs[_0xc073('0x45')](_[_0xc073('0x4f')](_0x3f3f75[_0xc073('0x43')],_0x5a2d4a[_0xc073('0x45')]));_0x167f0f[_0xc073('0x4e')][_0xc073('0x67')]=_0x3c5296['id'];if(_0x3f3f75[_0xc073('0x43')][_0xc073('0x50')]){_0x167f0f['where']=_[_0xc073('0x51')](_0x167f0f[_0xc073('0x4e')],{'$or':_[_0xc073('0x3d')](_0x167f0f[_0xc073('0x47')],function(_0x557bc0){var _0x19dc26={};_0x19dc26[_0x557bc0]={'$like':'%'+_0x3f3f75['query'][_0xc073('0x50')]+'%'};return _0x19dc26;})});}_0x167f0f=_[_0xc073('0x51')]({},_0x167f0f,_0x3f3f75[_0xc073('0x54')]);return db[_0xc073('0x71')][_0xc073('0x2e')]({'where':_0x167f0f[_0xc073('0x4e')]})[_0xc073('0x33')](function(_0x43a709){_0x502125[_0xc073('0x2e')]=_0x43a709;if(_0x3f3f75[_0xc073('0x43')][_0xc073('0x55')]){_0x167f0f[_0xc073('0x56')]=[{'model':db[_0xc073('0x74')],'as':_0xc073('0x75'),'required':![]},{'model':db[_0xc073('0x76')],'as':_0xc073('0x77'),'attributes':['name',_0xc073('0x78'),_0xc073('0x79')],'required':![]},{'model':db[_0xc073('0x7a')],'as':_0xc073('0x7b'),'attributes':['id',_0xc073('0x53'),_0xc073('0x7c')],'where':_0x3f3f75[_0xc073('0x43')][_0xc073('0x7d')]?{'id':_0x3f3f75[_0xc073('0x43')][_0xc073('0x7d')]}:undefined,'required':_0x3f3f75[_0xc073('0x43')]['tag']?!![]:![]}];}return db[_0xc073('0x71')][_0xc073('0x57')](_0x167f0f);})[_0xc073('0x33')](function(_0x2f10fd){_0x502125[_0xc073('0x58')]=_0x2f10fd;return _0x502125;});}})['then'](respondWithFilteredResult(_0x31e8f0,_0x167f0f))[_0xc073('0x26')](handleError(_0x31e8f0,null));};exports[_0xc073('0x7e')]=function(_0x127506,_0x136d3f){var _0x45e35a=_0x127506[_0xc073('0x5a')]['id'];var _0x52a5e3=_0x127506[_0xc073('0x64')];var _0x1f9962=0xc8;var _0x2f1823=null;return db[_0xc073('0x7f')][_0xc073('0x80')]({'isolationLevel':db['sequelize'][_0xc073('0x81')][_0xc073('0x82')]['READ_COMMITTED']},function(_0x16b96f){return db[_0xc073('0x3e')]['findOne']({'where':{'id':_0x45e35a},'transaction':_0x16b96f})[_0xc073('0x33')](function(_0x44d1d2){if(_0x44d1d2){return db[_0xc073('0x83')]['destroy']({'where':{'FaxAccountId':_0x45e35a},'transaction':_0x16b96f})[_0xc073('0x33')](function(){var _0xab8c7d=_[_0xc073('0x3d')](_0x52a5e3,function(_0x1df042){_0x1df042['FaxAccountId']=_0x45e35a;return _0x1df042;});return db['FaxApplication'][_0xc073('0x84')](_0xab8c7d,{'transaction':_0x16b96f});});}else{_0x1f9962=0x194;_0x2f1823=[];}});})[_0xc073('0x33')](function(){if(_0x1f9962!==0x194){return db[_0xc073('0x83')][_0xc073('0x85')]({'where':{'FaxAccountId':_0x45e35a},'order':'priority'})[_0xc073('0x33')](function(_0x46cf7e){_0x2f1823=_0x46cf7e;});}})[_0xc073('0x26')](function(_0x21674b){_0x1f9962=0x1f4;logger[_0xc073('0x21')](_0x21674b[_0xc073('0x38')]);if(_0x21674b[_0xc073('0x53')]){delete _0x21674b[_0xc073('0x53')];}_0x2f1823=_0x21674b;})[_0xc073('0x86')](function(){if(_0x2f1823===null){_0x136d3f[_0xc073('0x27')](_0x1f9962);}else{if(_0x1f9962===0x1f4){_0x136d3f[_0xc073('0x28')](_0x1f9962)[_0xc073('0x39')](_0x2f1823);}else{_0x136d3f[_0xc073('0x28')](_0x1f9962)['json'](_0x2f1823);}}});};exports['getApplications']=function(_0x7172b4,_0x21500e,_0x18ffdd){var _0x2ae334={};var _0x46cdb9={};var _0x33719b;var _0x2c0149;return db[_0xc073('0x3e')]['findOne']({'where':{'id':_0x7172b4[_0xc073('0x5a')]['id']}})[_0xc073('0x33')](handleEntityNotFound(_0x21500e,null))['then'](function(_0x291dcd){if(_0x291dcd){_0x33719b=_0x291dcd;_0x46cdb9['model']=_['keys'](db[_0xc073('0x83')]['rawAttributes']);_0x46cdb9[_0xc073('0x43')]=_[_0xc073('0x44')](_0x7172b4[_0xc073('0x43')]);_0x46cdb9['filters']=_[_0xc073('0x48')](_0x46cdb9[_0xc073('0x46')],_0x46cdb9['query']);_0x2ae334[_0xc073('0x47')]=_['intersection'](_0x46cdb9['model'],qs[_0xc073('0x49')](_0x7172b4['query'][_0xc073('0x49')]));_0x2ae334[_0xc073('0x47')]=_0x2ae334[_0xc073('0x47')][_0xc073('0x5b')]?_0x2ae334[_0xc073('0x47')]:_0x46cdb9[_0xc073('0x46')];_0x2ae334['order']=qs[_0xc073('0x4d')](_0x7172b4[_0xc073('0x43')][_0xc073('0x4d')]);_0x2ae334[_0xc073('0x4e')]=qs[_0xc073('0x45')](_[_0xc073('0x4f')](_0x7172b4[_0xc073('0x43')],_0x46cdb9[_0xc073('0x45')]));if(_0x7172b4[_0xc073('0x43')][_0xc073('0x50')]){_0x2ae334[_0xc073('0x4e')]=_[_0xc073('0x51')](_0x2ae334['where'],{'$or':_['map'](_0x2ae334['attributes'],function(_0x44b2f8){var _0x4e6188={};_0x4e6188[_0x44b2f8]={'$like':'%'+_0x7172b4['query'][_0xc073('0x50')]+'%'};return _0x4e6188;})});}_0x2ae334=_['merge']({},_0x2ae334,_0x7172b4[_0xc073('0x54')]);return _0x33719b['getApplications'](_0x2ae334);}})[_0xc073('0x33')](function(_0x17977b){if(_0x17977b){_0x2c0149=_0x17977b[_0xc073('0x5b')];if(!_0x7172b4['query'][_0xc073('0x4a')]('nolimit')){_0x2ae334[_0xc073('0x2d')]=qs['limit'](_0x7172b4[_0xc073('0x43')][_0xc073('0x2d')]);_0x2ae334['offset']=qs[_0xc073('0x2b')](_0x7172b4[_0xc073('0x43')][_0xc073('0x2b')]);}return _0x33719b[_0xc073('0x87')](_0x2ae334);}})['then'](function(_0x1cdb1f){if(_0x1cdb1f){return _0x1cdb1f?{'count':_0x2c0149,'rows':_0x1cdb1f}:null;}})[_0xc073('0x33')](respondWithResult(_0x21500e,null))['catch'](handleError(_0x21500e,null));};function Extension(_0x2a94be,_0x37bbaa,_0x4bdc7b,_0xc8ab46){this['context']=_0xc073('0x88');this['exten']=_0x2a94be['localstationid'];this[_0xc073('0x89')]=_0xc8ab46;this[_0xc073('0x41')]=_0xc073('0x8a');this[_0xc073('0x8b')]=_0xc073('0x8c');this[_0xc073('0x67')]=_0x2a94be['id'];this['priority']=_0x37bbaa;this[_0xc073('0x8d')]=_0x4bdc7b;}function createExtensionsReciveFax(_0x2868e3){var _0x18decc=0x1;var _0x2296f6=[];_0x2296f6[_0xc073('0x8e')](new Extension(_0x2868e3,_0x18decc,'',_0xc073('0x8f')));_0x18decc+=0x1;_0x2296f6[_0xc073('0x8e')](new Extension(_0x2868e3,_0x18decc,'CDR(type)=inbound-fax','Set'));_0x18decc+=0x1;for(var _0x24358d in _0x2868e3){if(_0x2868e3[_0xc073('0x4a')](_0x24358d)&&(_0x24358d==='ecm'||_0x24358d==='localstationid'||_0x24358d==='gateway'||_0x24358d===_0xc073('0x90')||_0x24358d===_0xc073('0x91')||_0x24358d===_0xc073('0x92')||_0x24358d===_0xc073('0x93')||_0x24358d===_0xc073('0x94')||_0x24358d===_0xc073('0x95'))){_0x2296f6[_0xc073('0x8e')](new Extension(_0x2868e3,_0x18decc,_0xc073('0x96')+_0x24358d+')='+_0x2868e3[_0x24358d],'Set'));_0x18decc+=0x1;}}_0x2296f6[_0xc073('0x8e')](new Extension(_0x2868e3,_0x18decc,'6',_0xc073('0x97')));_0x18decc+=0x1;_0x2296f6['push'](new Extension(_0x2868e3,_0x18decc,_0xc073('0x98'),_0xc073('0x99')));_0x18decc=0x0;return _0x2296f6;}exports[_0xc073('0x9a')]=function(_0x17e34c,_0x32db1c,_0x3ece59){var _0x56f292;return db[_0xc073('0x7f')][_0xc073('0x80')](function(_0x40a152){return db[_0xc073('0x3e')][_0xc073('0x5d')](_0x17e34c[_0xc073('0x64')],{'transaction':_0x40a152})['then'](function(_0x11227b){_0x56f292=_0x11227b[_0xc073('0x35')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x56f292),{'transaction':_0x40a152});});})[_0xc073('0x33')](function(){return _0x56f292;})['then'](respondWithResult(_0x32db1c,null))['catch'](handleError(_0x32db1c,null));};exports['updateAccountApplications']=function(_0x5665c0,_0x2f9eca,_0x324881){var _0x99f5c;return db[_0xc073('0x7f')][_0xc073('0x80')](function(_0x1256de){return db['FaxAccount']['update'](_0x5665c0[_0xc073('0x64')],{'where':{'id':_0x5665c0[_0xc073('0x64')]['id']},'transaction':_0x1256de})[_0xc073('0x33')](function(_0x5d7cb4){return db[_0xc073('0x9b')][_0xc073('0x34')]({'where':{'FaxAccountId':_0x5665c0[_0xc073('0x64')]['id']},'transaction':_0x1256de})[_0xc073('0x33')](function(_0x5a1cbd){return db[_0xc073('0x9b')][_0xc073('0x84')](createExtensionsReciveFax(_[_0xc073('0x72')](_0x5665c0[_0xc073('0x64')],[_0xc073('0x9c'),'key',_0xc073('0x9d'),_0xc073('0x9e'),_0xc073('0x9f'),_0xc073('0xa0')])),{'transaction':_0x1256de});});});})['then'](function(){return db[_0xc073('0x3e')][_0xc073('0xa1')](_0x5665c0['body']['id']);})[_0xc073('0x33')](respondWithResult(_0x2f9eca,null))['catch'](handleError(_0x2f9eca,null));};exports['getMessages']=function(_0x292b06,_0x1e430a,_0x4c31e4){var _0x575832={'raw':!![],'where':{}};var _0x4169a1={};var _0x452a35={'count':0x0,'rows':[]};return db['FaxAccount'][_0xc073('0x73')]({'where':{'id':_0x292b06[_0xc073('0x5a')]['id']}})[_0xc073('0x33')](handleEntityNotFound(_0x1e430a,null))[_0xc073('0x33')](function(_0x174c93){if(_0x174c93){_0x4169a1[_0xc073('0x46')]=_[_0xc073('0x44')](db['FaxMessage'][_0xc073('0x3f')]);_0x4169a1[_0xc073('0x43')]=_[_0xc073('0x44')](_0x292b06['query']);_0x4169a1[_0xc073('0x45')]=_[_0xc073('0x48')](_0x4169a1[_0xc073('0x46')],_0x4169a1[_0xc073('0x43')]);_0x575832['attributes']=_[_0xc073('0x48')](_0x4169a1['model'],qs[_0xc073('0x49')](_0x292b06[_0xc073('0x43')]['fields']));_0x575832[_0xc073('0x47')]=_0x575832[_0xc073('0x47')]['length']?_0x575832[_0xc073('0x47')]:_0x4169a1[_0xc073('0x46')];if(!_0x292b06[_0xc073('0x43')][_0xc073('0x4a')]('nolimit')){_0x575832[_0xc073('0x2d')]=qs[_0xc073('0x2d')](_0x292b06[_0xc073('0x43')]['limit']);_0x575832[_0xc073('0x2b')]=qs[_0xc073('0x2b')](_0x292b06[_0xc073('0x43')][_0xc073('0x2b')]);}_0x575832[_0xc073('0x4c')]=qs[_0xc073('0x4d')](_0x292b06[_0xc073('0x43')][_0xc073('0x4d')]);_0x575832['where']=qs[_0xc073('0x45')](_[_0xc073('0x4f')](_0x292b06[_0xc073('0x43')],_0x4169a1[_0xc073('0x45')]));_0x575832[_0xc073('0x4e')]['FaxAccountId']=_0x174c93['id'];if(_0x292b06[_0xc073('0x43')]['filter']){_0x575832['where']=_[_0xc073('0x51')](_0x575832['where'],{'$or':_[_0xc073('0x3d')](_0x575832[_0xc073('0x47')],function(_0x530dab){var _0x3cfe62={};_0x3cfe62[_0x530dab]={'$like':'%'+_0x292b06[_0xc073('0x43')][_0xc073('0x50')]+'%'};return _0x3cfe62;})});}if(_0x292b06['query'][_0xc073('0xa2')]){var _0x369914=_0x292b06[_0xc073('0x43')][_0xc073('0xa2')][_0xc073('0xa3')](',');var _0x2b5b4b={};_0x2b5b4b[_0x369914[0x0]]={'$gte':moment(_0x369914[0x1])[_0xc073('0xa4')](_0xc073('0xa5'))};_0x575832[_0xc073('0x4e')]=_[_0xc073('0x51')](_0x575832[_0xc073('0x4e')],_0x2b5b4b);}_0x575832=_['merge']({},_0x575832,_0x292b06[_0xc073('0x54')]);return db[_0xc073('0xa6')]['count']({'where':_0x575832['where']})[_0xc073('0x33')](function(_0xea02a7){_0x452a35[_0xc073('0x2e')]=_0xea02a7;if(_0x292b06['query'][_0xc073('0x55')]){_0x575832['include']=[{'all':!![]}];}return db['FaxMessage'][_0xc073('0x57')](_0x575832);})[_0xc073('0x33')](function(_0xd60d77){_0x452a35[_0xc073('0x58')]=_0xd60d77;return _0x452a35;});}})[_0xc073('0x33')](respondWithFilteredResult(_0x1e430a,_0x575832))[_0xc073('0x26')](handleError(_0x1e430a,null));};exports[_0xc073('0x39')]=function(_0x265e20,_0x2efb95,_0x4e2628){var _0x1f2387,_0x2339cc={},_0x1d0b26;if(_0x265e20[_0xc073('0x64')]['to']){_0x1d0b26=_0x265e20['body']['to'][0x0];}return db[_0xc073('0x3e')]['find']({'where':{'id':_0x265e20[_0xc073('0x5a')]['id']},'include':[{'model':db[_0xc073('0xa7')],'as':_0xc073('0xa8'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x1d0b26},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x2efb95,null))[_0xc073('0x33')](function(_0x1dd14a){_0x1f2387=_0x1dd14a;if(_0x265e20['body']['attachments']&&_0x265e20[_0xc073('0x64')][_0xc073('0xa9')]['length']){for(var _0x59f70d=0x0;_0x59f70d<_0x265e20['body']['attachments'][_0xc073('0x5b')];_0x59f70d+=0x1){_0x265e20['body'][_0xc073('0xa9')][_0x59f70d]={'filename':_0x265e20[_0xc073('0x64')][_0xc073('0xa9')][_0x59f70d][_0xc073('0x53')],'id':_0x265e20[_0xc073('0x64')][_0xc073('0xa9')][_0x59f70d]['id'],'path':path[_0xc073('0xaa')](config[_0xc073('0xab')],_0xc073('0xac'),_0x265e20[_0xc073('0x64')]['attachments'][_0x59f70d][_0xc073('0xad')])};}}return respondWithRpcPromise('CheckAfterSend',_0xc073('0xae'),{'FaxAccountId':_[_0xc073('0xaf')](_0x265e20[_0xc073('0x5a')]['id'])?undefined:_0x265e20[_0xc073('0x5a')]['id'],'path':_[_0xc073('0xaf')](_0x265e20[_0xc073('0x64')][_0xc073('0xa9')][0x0][_0xc073('0x4')])?undefined:_0x265e20['body'][_0xc073('0xa9')][0x0][_0xc073('0x4')],'fax':_[_0xc073('0xaf')](_0x265e20[_0xc073('0x64')]['to'][0x0])?undefined:_0x265e20['body']['to'][0x0]},client9002);})[_0xc073('0x33')](function(){if(_0x1f2387){if(_[_0xc073('0xaf')](_0x265e20[_0xc073('0x64')][_0xc073('0xb0')])){_0x265e20[_0xc073('0x64')][_0xc073('0xb0')]=util[_0xc073('0xa4')](_0xc073('0xb1'),_0x1f2387[_0xc073('0x53')],_0x1f2387['fax']);}if(_0x1f2387[_0xc073('0xa8')]){if(_0x1f2387[_0xc073('0xa8')][_0xc073('0xb2')][_0xc073('0x5b')]){return _0x1f2387[_0xc073('0xa8')]['Contacts'][0x0];}else{return db[_0xc073('0x74')][_0xc073('0x5d')](_[_0xc073('0x15')](_0x265e20[_0xc073('0x64')],{'firstName':_0x265e20[_0xc073('0x64')]['to'][0x0],'phone':_0x265e20['body']['to'][0x0],'fax':_0x265e20[_0xc073('0x64')]['to'][0x0],'ListId':_0x1f2387[_0xc073('0xa0')]}));}}else{throw new Error(_0xc073('0xb3'));}}else{throw new Error(_0xc073('0xb4'));}})[_0xc073('0x33')](function(_0x2e440d){if(_0x2e440d){return db[_0xc073('0x71')]['find']({'where':{'ContactId':_0x2e440d['id'],'closed':![],'FaxAccountId':_0x1f2387['id']}})[_0xc073('0x33')](function(_0x38c6c8){if(_0x38c6c8){return[_0x38c6c8,![]];}return db[_0xc073('0x71')][_0xc073('0x5d')]({'UserId':_0x265e20[_0xc073('0x5e')]['id'],'ContactId':_0x2e440d['id'],'FaxAccountId':_0x1f2387['id'],'fax':_0x265e20[_0xc073('0x64')]['to'][0x0],'firstMsgDirection':_0xc073('0xb5'),'Messages':[_['merge'](_0x265e20['body'],{'read':![],'body':_0x265e20['body'][_0xc073('0xa9')][0x0]['filename'],'FaxAccountId':_0x1f2387['id'],'UserId':_0x265e20[_0xc073('0x5e')]['id'],'ContactId':_0x2e440d['id'],'AttachmentId':_0x265e20[_0xc073('0x64')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0xc073('0xa6')],'as':_0xc073('0xb6')}]})[_0xc073('0x33')](function(_0x4af3ad){return[_0x4af3ad,!![]];});});}else{throw new Error(_0xc073('0xb7'));}})[_0xc073('0xb8')](function(_0x5bf380,_0x49187a){if(_0x49187a){return _0x5bf380;}return db[_0xc073('0xa6')][_0xc073('0x5d')]({'direction':_0xc073('0xb5'),'read':![],'body':_0x265e20[_0xc073('0x64')][_0xc073('0xa9')][0x0][_0xc073('0xb9')],'FaxAccountId':_0x1f2387['id'],'FaxInteractionId':_0x5bf380['id'],'UserId':_0x265e20[_0xc073('0x5e')]['id'],'ContactId':_0x5bf380[_0xc073('0xba')],'AttachmentId':_0x265e20[_0xc073('0x64')]['attachments'][0x0]['id']})[_0xc073('0x33')](function(_0x294e09){_0x5bf380['dataValues'][_0xc073('0xb6')]=[];_0x5bf380[_0xc073('0xbb')]['Messages'][_0xc073('0x8e')](_0x294e09[_0xc073('0xbb')]);return _0x5bf380;});})[_0xc073('0x33')](function(_0x4a9a1e){respondWithRpcPromise('SendFax',_0xc073('0xbc'),{'FaxAccountId':_[_0xc073('0xaf')](_0x265e20[_0xc073('0x5a')]['id'])?undefined:_0x265e20[_0xc073('0x5a')]['id'],'path':_[_0xc073('0xaf')](_0x265e20['body'][_0xc073('0xa9')][0x0][_0xc073('0x4')])?undefined:_0x265e20[_0xc073('0x64')]['attachments'][0x0][_0xc073('0x4')],'fax':_['isNil'](_0x265e20[_0xc073('0x64')]['to'][0x0])?undefined:_0x265e20[_0xc073('0x64')]['to'][0x0],'AttachmentId':_0x265e20[_0xc073('0x64')][_0xc073('0xa9')][0x0]['id']},client9002)[_0xc073('0x33')](function(_0x5a43d9){logger['info'](_0xc073('0xbd'),_0x5a43d9);})[_0xc073('0x26')](function(_0x5da488){logger[_0xc073('0x24')](_0xc073('0xbd'),_0x5da488);});return _0x4a9a1e;})[_0xc073('0x33')](respondWithResult(_0x2efb95,null))[_0xc073('0x26')](handleError(_0x2efb95,null));};exports[_0xc073('0xbe')]=function(_0x40b1fa,_0x2e7528,_0xeb73a9){return db[_0xc073('0x3e')][_0xc073('0x5c')]({'where':{'id':_0x40b1fa[_0xc073('0x5a')]['id']}})[_0xc073('0x33')](handleEntityNotFound(_0x2e7528,null))[_0xc073('0x33')](function(_0x55ad9c){if(_0x55ad9c){return _0x55ad9c[_0xc073('0xbe')](_0x40b1fa[_0xc073('0x64')][_0xc073('0x6b')],_[_0xc073('0x72')](_0x40b1fa['body'],[_0xc073('0x6b'),'id'])||{})['spread'](function(_0x190598){for(var _0x93734b=0x0;_0x93734b<_0x40b1fa[_0xc073('0x64')][_0xc073('0x6b')][_0xc073('0x5b')];_0x93734b+=0x1){socket[_0xc073('0xbf')](_0xc073('0xc0'),{'UserId':Number(_0x40b1fa[_0xc073('0x64')][_0xc073('0x6b')][_0x93734b]),'FaxAccountId':Number(_0x40b1fa['params']['id'])});}return _0x190598;});}})[_0xc073('0x33')](respondWithResult(_0x2e7528,null))[_0xc073('0x26')](handleError(_0x2e7528,null));};exports['removeAgents']=function(_0x5b9b9e,_0x586b06,_0x403f4f){return db[_0xc073('0x3e')]['find']({'where':{'id':_0x5b9b9e[_0xc073('0x5a')]['id']}})[_0xc073('0x33')](handleEntityNotFound(_0x586b06,null))[_0xc073('0x33')](function(_0x1f0411){if(_0x1f0411){return _0x1f0411[_0xc073('0xc1')](_0x5b9b9e['query'][_0xc073('0x6b')])['then'](function(){if(_[_0xc073('0xc2')](_0x5b9b9e['query'][_0xc073('0x6b')])){for(var _0x2dfe52=0x0;_0x2dfe52<_0x5b9b9e[_0xc073('0x43')]['ids']['length'];_0x2dfe52+=0x1){socket[_0xc073('0xbf')](_0xc073('0xc3'),{'UserId':Number(_0x5b9b9e[_0xc073('0x43')]['ids'][_0x2dfe52]),'FaxAccountId':Number(_0x5b9b9e['params']['id'])});}}else{socket[_0xc073('0xbf')](_0xc073('0xc3'),{'UserId':Number(_0x5b9b9e[_0xc073('0x43')][_0xc073('0x6b')]),'FaxAccountId':Number(_0x5b9b9e[_0xc073('0x5a')]['id'])});}});}})['then'](respondWithStatusCode(_0x586b06,null))[_0xc073('0x26')](handleError(_0x586b06,null));};exports[_0xc073('0xc4')]=function(_0x2a8539,_0x15edb5,_0x1f955e){var _0x10a42d={};var _0x1f1e1e={};var _0x1b518b;var _0x291626;return db['FaxAccount'][_0xc073('0x73')]({'where':{'id':_0x2a8539[_0xc073('0x5a')]['id']}})[_0xc073('0x33')](handleEntityNotFound(_0x15edb5,null))[_0xc073('0x33')](function(_0x560b0a){if(_0x560b0a){_0x1b518b=_0x560b0a;_0x1f1e1e[_0xc073('0x46')]=_['keys'](db['User']['rawAttributes']);_0x1f1e1e[_0xc073('0x43')]=_[_0xc073('0x44')](_0x2a8539[_0xc073('0x43')]);_0x1f1e1e[_0xc073('0x45')]=_[_0xc073('0x48')](_0x1f1e1e[_0xc073('0x46')],_0x1f1e1e[_0xc073('0x43')]);_0x10a42d[_0xc073('0x47')]=_[_0xc073('0x48')](_0x1f1e1e[_0xc073('0x46')],qs[_0xc073('0x49')](_0x2a8539[_0xc073('0x43')]['fields']));_0x10a42d[_0xc073('0x47')]=_0x10a42d['attributes'][_0xc073('0x5b')]?_0x10a42d[_0xc073('0x47')]:_0x1f1e1e[_0xc073('0x46')];_0x10a42d[_0xc073('0x4c')]=qs['sort'](_0x2a8539[_0xc073('0x43')][_0xc073('0x4d')]);_0x10a42d[_0xc073('0x4e')]=qs[_0xc073('0x45')](_[_0xc073('0x4f')](_0x2a8539[_0xc073('0x43')],_0x1f1e1e[_0xc073('0x45')]));if(_0x2a8539[_0xc073('0x43')][_0xc073('0x50')]){_0x10a42d[_0xc073('0x4e')]=_[_0xc073('0x51')](_0x10a42d[_0xc073('0x4e')],{'$or':_['map'](_0x10a42d[_0xc073('0x47')],function(_0x176f58){var _0x24ba20={};_0x24ba20[_0x176f58]={'$like':'%'+_0x2a8539[_0xc073('0x43')]['filter']+'%'};return _0x24ba20;})});}_0x10a42d=_[_0xc073('0x51')]({},_0x10a42d,_0x2a8539[_0xc073('0x54')]);return _0x1b518b[_0xc073('0xc4')](_0x10a42d);}})[_0xc073('0x33')](function(_0x1a6525){if(_0x1a6525){_0x291626=_0x1a6525[_0xc073('0x5b')];if(!_0x2a8539[_0xc073('0x43')][_0xc073('0x4a')]('nolimit')){_0x10a42d[_0xc073('0x2d')]=qs[_0xc073('0x2d')](_0x2a8539[_0xc073('0x43')][_0xc073('0x2d')]);_0x10a42d[_0xc073('0x2b')]=qs[_0xc073('0x2b')](_0x2a8539[_0xc073('0x43')]['offset']);}return _0x1b518b[_0xc073('0xc4')](_0x10a42d);}})[_0xc073('0x33')](function(_0x4e7984){if(_0x4e7984){return _0x4e7984?{'count':_0x291626,'rows':_0x4e7984}:null;}})[_0xc073('0x33')](respondWithResult(_0x15edb5,null))[_0xc073('0x26')](handleError(_0x15edb5,null));};
\ No newline at end of file
index b9cfe34..1ac069c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf780=['exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove','emit','hook'];(function(_0x3aeae6,_0x201d94){var _0xc3594=function(_0x585f54){while(--_0x585f54){_0x3aeae6['push'](_0x3aeae6['shift']());}};_0xc3594(++_0x201d94);}(_0xf780,0xd3));var _0x0f78=function(_0x5d1f47,_0x3c3c8b){_0x5d1f47=_0x5d1f47-0x0;var _0x57c75c=_0xf780[_0x5d1f47];return _0x57c75c;};'use strict';var EventEmitter=require(_0x0f78('0x0'));var FaxAccount=require(_0x0f78('0x1'))['db'][_0x0f78('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x0f78('0x3')](0x0);var events={'afterCreate':_0x0f78('0x4'),'afterUpdate':_0x0f78('0x5'),'afterDestroy':_0x0f78('0x6')};function emitEvent(_0xb045f4){return function(_0x5c47e6,_0xf5dc27,_0xbf7d88){FaxAccountEvents['emit'](_0xb045f4+':'+_0x5c47e6['id'],_0x5c47e6);FaxAccountEvents[_0x0f78('0x7')](_0xb045f4,_0x5c47e6);_0xbf7d88(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x0f78('0x8')](e,emitEvent(event));}}module[_0x0f78('0x9')]=FaxAccountEvents;
\ No newline at end of file
+var _0xeed2=['update','emit','hasOwnProperty','events','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0x1b8ebe,_0x2fdc60){var _0x148f28=function(_0x13c01d){while(--_0x13c01d){_0x1b8ebe['push'](_0x1b8ebe['shift']());}};_0x148f28(++_0x2fdc60);}(_0xeed2,0xf3));var _0x2eed=function(_0x5c2738,_0x48ab6d){_0x5c2738=_0x5c2738-0x0;var _0x1bf104=_0xeed2[_0x5c2738];return _0x1bf104;};'use strict';var EventEmitter=require(_0x2eed('0x0'));var FaxAccount=require(_0x2eed('0x1'))['db'][_0x2eed('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x2eed('0x3')](0x0);var events={'afterCreate':_0x2eed('0x4'),'afterUpdate':_0x2eed('0x5'),'afterDestroy':'remove'};function emitEvent(_0xd5ab3b){return function(_0x408315,_0x45a78d,_0x38df5a){FaxAccountEvents['emit'](_0xd5ab3b+':'+_0x408315['id'],_0x408315);FaxAccountEvents[_0x2eed('0x6')](_0xd5ab3b,_0x408315);_0x38df5a(null);};}for(var e in events){if(events[_0x2eed('0x7')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module['exports']=FaxAccountEvents;
\ No newline at end of file
index 5dff42d..2cd6847 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x443b=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxAccount.attributes','define','FaxAccount','lodash'];(function(_0x116f0a,_0x57d3a3){var _0x19c84c=function(_0x201c87){while(--_0x201c87){_0x116f0a['push'](_0x116f0a['shift']());}};_0x19c84c(++_0x57d3a3);}(_0x443b,0x137));var _0xb443=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x443b[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xb443('0x0'));var util=require(_0xb443('0x1'));var logger=require(_0xb443('0x2'))(_0xb443('0x3'));var moment=require(_0xb443('0x4'));var BPromise=require(_0xb443('0x5'));var rp=require(_0xb443('0x6'));var fs=require('fs');var path=require(_0xb443('0x7'));var rimraf=require('rimraf');var config=require(_0xb443('0x8'));var attributes=require(_0xb443('0x9'));module['exports']=function(_0x27d1bb,_0x5a7712){return _0x27d1bb[_0xb443('0xa')](_0xb443('0xb'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3243=['FaxAccount','fax_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxAccount.attributes','define'];(function(_0x1c9bd0,_0x1216d6){var _0x216fa1=function(_0x5cafbd){while(--_0x5cafbd){_0x1c9bd0['push'](_0x1c9bd0['shift']());}};_0x216fa1(++_0x1216d6);}(_0x3243,0x116));var _0x3324=function(_0x4836a3,_0x1df063){_0x4836a3=_0x4836a3-0x0;var _0x67c8b0=_0x3243[_0x4836a3];return _0x67c8b0;};'use strict';var _=require(_0x3324('0x0'));var util=require('util');var logger=require(_0x3324('0x1'))(_0x3324('0x2'));var moment=require(_0x3324('0x3'));var BPromise=require(_0x3324('0x4'));var rp=require(_0x3324('0x5'));var fs=require('fs');var path=require(_0x3324('0x6'));var rimraf=require('rimraf');var config=require(_0x3324('0x7'));var attributes=require(_0x3324('0x8'));module['exports']=function(_0x1dd28b,_0x4f46af){return _0x1dd28b[_0x3324('0x9')](_0x3324('0xa'),attributes,{'tableName':_0x3324('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d11c602..4b24b63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63e4=['get','applications','list','orderBy','asc','account','length','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','push','close','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','findAll','options','raw','where','attributes','limit','map','include','model','NotifyFaxAccount','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','CompanyId','ListId','body','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','CmList','List','Contacts','updatedAt','DESC','Applications'];(function(_0x4ed1d4,_0x512d9a){var _0x28e363=function(_0x2bdfb7){while(--_0x2bdfb7){_0x4ed1d4['push'](_0x4ed1d4['shift']());}};_0x28e363(++_0x512d9a);}(_0x63e4,0x183));var _0x463e=function(_0x211e65,_0x325bc3){_0x211e65=_0x211e65-0x0;var _0x3ae494=_0x63e4[_0x211e65];return _0x3ae494;};'use strict';var _=require(_0x463e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x463e('0x1'));var fs=require('fs');var Redis=require(_0x463e('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x463e('0x3'))(_0x463e('0x4'));var config=require(_0x463e('0x5'));var jayson=require(_0x463e('0x6'));var client=jayson[_0x463e('0x7')][_0x463e('0x8')]({'port':0x232c});config[_0x463e('0x9')]=_['defaults'](config[_0x463e('0x9')],{'host':_0x463e('0xa'),'port':0x18eb});var socket=require(_0x463e('0xb'))(new Redis(config[_0x463e('0x9')]));require('./faxAccount.socket')[_0x463e('0xc')](socket);function respondWithRpcPromise(_0x4e2b59,_0x47d90d,_0x3416e2){return new BPromise(function(_0x21f91d,_0x480a3c){return client[_0x463e('0xd')](_0x4e2b59,_0x3416e2)[_0x463e('0xe')](function(_0x3614ba){logger[_0x463e('0xf')](_0x463e('0x10'),_0x47d90d,_0x463e('0x11'));logger[_0x463e('0x12')](_0x463e('0x13'),_0x47d90d,_0x463e('0x11'),JSON[_0x463e('0x14')](_0x3614ba));if(_0x3614ba[_0x463e('0x15')]){if(_0x3614ba['error'][_0x463e('0x16')]===0x1f4){logger[_0x463e('0x15')](_0x463e('0x10'),_0x47d90d,_0x3614ba['error'][_0x463e('0x17')]);return _0x480a3c(_0x3614ba[_0x463e('0x15')][_0x463e('0x17')]);}logger['error'](_0x463e('0x10'),_0x47d90d,_0x3614ba[_0x463e('0x15')]['message']);return _0x21f91d(_0x3614ba[_0x463e('0x15')]['message']);}else{logger[_0x463e('0xf')](_0x463e('0x10'),_0x47d90d,'request\x20sent');_0x21f91d(_0x3614ba[_0x463e('0x18')][_0x463e('0x17')]);}})[_0x463e('0x19')](function(_0x230149){logger[_0x463e('0x15')](_0x463e('0x10'),_0x47d90d,_0x230149);_0x480a3c(_0x230149);});});}exports[_0x463e('0x1a')]=function(_0x2187b7){var _0x2b469f=this;return new Promise(function(_0x164c49,_0x14ee75){return db['FaxAccount'][_0x463e('0x1b')]({'raw':_0x2187b7[_0x463e('0x1c')]?_0x2187b7[_0x463e('0x1c')][_0x463e('0x1d')]===undefined?!![]:![]:!![],'where':_0x2187b7[_0x463e('0x1c')]?_0x2187b7['options'][_0x463e('0x1e')]||null:null,'attributes':_0x2187b7[_0x463e('0x1c')]?_0x2187b7[_0x463e('0x1c')][_0x463e('0x1f')]||null:null,'limit':_0x2187b7['options']?_0x2187b7[_0x463e('0x1c')][_0x463e('0x20')]||null:null,'include':_0x2187b7[_0x463e('0x1c')]?_0x2187b7[_0x463e('0x1c')]['include']?_[_0x463e('0x21')](_0x2187b7['options'][_0x463e('0x22')],function(_0x16342b){return{'model':db[_0x16342b[_0x463e('0x23')]],'as':_0x16342b['as'],'attributes':_0x16342b['attributes'],'include':_0x16342b[_0x463e('0x22')]?_[_0x463e('0x21')](_0x16342b[_0x463e('0x22')],function(_0x1e17b6){return{'model':db[_0x1e17b6['model']],'as':_0x1e17b6['as'],'attributes':_0x1e17b6[_0x463e('0x1f')],'include':_0x1e17b6['include']?_[_0x463e('0x21')](_0x1e17b6['include'],function(_0x1848cf){return{'model':db[_0x1848cf['model']],'as':_0x1848cf['as'],'attributes':_0x1848cf[_0x463e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x463e('0xe')](function(_0x3e6402){logger[_0x463e('0xf')](_0x463e('0x1a'),_0x2187b7);logger['debug'](_0x463e('0x1a'),_0x2187b7,JSON[_0x463e('0x14')](_0x3e6402));_0x164c49(_0x3e6402);})['catch'](function(_0x38d09f){logger['error'](_0x463e('0x1a'),_0x38d09f[_0x463e('0x17')],_0x2187b7);_0x14ee75(_0x2b469f['error'](0x1f4,_0x38d09f[_0x463e('0x17')]));});});};exports[_0x463e('0x24')]=function(_0x4685ae,_0x26fec6,_0x436a85){var _0x50fd5a=this;return new Promise(function(_0x257b2f,_0x4ce8c1){var _0x31f4c2={'body':_0x4685ae['body'],'channel':_0x463e('0x25')};var _0x29f35e=[];var _0xf0e873=[];var _0x28823e={};return db[_0x463e('0x26')]['describe']()[_0x463e('0xe')](function(_0x48e21a){if(!_0x48e21a){throw new db[(_0x463e('0x27'))][(_0x463e('0x28'))](_0x463e('0x29'));}_0x29f35e=_[_0x463e('0x2a')](_[_0x463e('0x2b')](_0x48e21a),[_0x463e('0x2c'),'updatedAt']);_0xf0e873=_[_0x463e('0x2a')](_[_0x463e('0x2b')](_0x48e21a),[_0x463e('0x2c'),'updatedAt',_0x463e('0x2d'),_0x463e('0x2e')]);if(_0x4685ae[_0x463e('0x2f')]['id']){delete _0x4685ae[_0x463e('0x2f')]['id'];}if(_[_0x463e('0x30')](_0x4685ae['body']['from'])){throw new db[(_0x463e('0x27'))][(_0x463e('0x28'))](_0x463e('0x31'));}if(_['isNil'](_0x4685ae[_0x463e('0x2f')][_0x463e('0x2f')])||_0x4685ae[_0x463e('0x2f')][_0x463e('0x2f')]===''){throw new db[(_0x463e('0x27'))][(_0x463e('0x28'))](_0x463e('0x32'));}if(_['isNil'](_0x4685ae[_0x463e('0x2f')][_0x463e('0x33')])){throw new db['Sequelize'][(_0x463e('0x28'))](_0x463e('0x34')+_0xf0e873);}if(!_[_0x463e('0x35')](_0xf0e873,_0x4685ae[_0x463e('0x2f')][_0x463e('0x33')])){throw new db[(_0x463e('0x27'))]['ValidationError'](_0x463e('0x36')+_0xf0e873);}_0x28823e[_0x4685ae[_0x463e('0x2f')][_0x463e('0x33')]]=_0x4685ae[_0x463e('0x2f')][_0x463e('0x37')];})[_0x463e('0xe')](function(){return db['FaxAccount'][_0x463e('0x38')]({'where':{'id':_0x4685ae['account']['id']},'include':[{'model':db[_0x463e('0x39')],'as':_0x463e('0x3a'),'include':[{'model':db[_0x463e('0x26')],'as':_0x463e('0x3b'),'where':_0x28823e,'limit':0x1,'order':[[_0x463e('0x3c'),_0x463e('0x3d')]]}]},{'model':db['FaxApplication'],'as':_0x463e('0x3e')}]});})['then'](function(_0x3abd38){if(_0x3abd38&&_0x3abd38[_0x463e('0x3a')]){var _0x52c9df=_0x3abd38[_0x463e('0x3f')]({'plain':!![]});_0x31f4c2['account']=_0x52c9df;_0x31f4c2[_0x463e('0x40')]=_0x52c9df[_0x463e('0x3e')];_0x31f4c2[_0x463e('0x41')]=_0x52c9df[_0x463e('0x3a')];_0x31f4c2['applications']=_[_0x463e('0x42')](_0x31f4c2[_0x463e('0x40')],['priority'],[_0x463e('0x43')]);if(_0x31f4c2[_0x463e('0x44')]['Applications']){delete _0x31f4c2[_0x463e('0x44')][_0x463e('0x3e')];}if(_0x31f4c2[_0x463e('0x44')][_0x463e('0x3a')]&&_0x31f4c2['account'][_0x463e('0x3a')][_0x463e('0x3b')][_0x463e('0x45')]){return _0x31f4c2[_0x463e('0x44')][_0x463e('0x3a')][_0x463e('0x3b')][0x0];}var _0x558ed9=_['defaults'](_0x4685ae[_0x463e('0x2f')],{'firstName':_0x4685ae[_0x463e('0x2f')][_0x463e('0x37')],'ListId':_0x52c9df['ListId']});_0x558ed9[_0x4685ae[_0x463e('0x2f')][_0x463e('0x33')]]=_0x4685ae[_0x463e('0x2f')][_0x463e('0x37')];return db[_0x463e('0x26')][_0x463e('0x46')](_0x558ed9,{'fields':_0x29f35e,'raw':!![]});}})[_0x463e('0xe')](function(_0xbed0c7){_0x31f4c2[_0x463e('0x47')]=_0xbed0c7;if(_0xbed0c7){var _0x3d251e={'ContactId':_0xbed0c7['id'],'FaxAccountId':_0x4685ae[_0x463e('0x44')]['id'],'fax':_0xbed0c7[_0x463e('0x25')]};return db[_0x463e('0x48')][_0x463e('0x38')]({'where':{'ContactId':_0xbed0c7['id'],'closed':![],'FaxAccountId':_0x4685ae[_0x463e('0x44')]['id']}})[_0x463e('0xe')](function(_0x44e9a2){if(_0x44e9a2){return[_0x44e9a2,![]];}return db[_0x463e('0x48')][_0x463e('0x46')](_0x3d251e)[_0x463e('0xe')](function(_0x18f672){return[_0x18f672,!![]];});});}else{throw new Error(_0x463e('0x49'));}})['spread'](function(_0x5cc6d3,_0x2af6ea){var _0x48e2e4=_0x5cc6d3[_0x463e('0x3f')]({'plain':!![]});if(_0x2af6ea){if(_0x31f4c2[_0x463e('0x44')][_0x463e('0x4a')]){_0x31f4c2[_0x463e('0x40')][_0x463e('0x4b')]({'id':0x0,'priority':_0x31f4c2[_0x463e('0x40')][_0x463e('0x45')]+0x1,'app':_0x463e('0x4c'),'appdata':'unmanaged','interval':_0x463e('0x4d')});}_0x48e2e4['created']=!![];}else{_0x48e2e4[_0x463e('0x4e')]=![];}_0x31f4c2[_0x463e('0x4f')]=_0x48e2e4;return db[_0x463e('0x50')]['create']({'body':_0x4685ae['body'][_0x463e('0x2f')],'FaxAccountId':_0x4685ae['account']['id'],'FaxInteractionId':_0x5cc6d3['id'],'direction':'in','ContactId':_0x5cc6d3['ContactId'],'AttachmentId':_0x4685ae['body'][_0x463e('0x51')]});})['then'](function(_0x4c6702){_0x31f4c2[_0x463e('0x17')]=_0x4c6702;if(_0x31f4c2['interaction'][_0x463e('0x52')]){return db[_0x463e('0x53')][_0x463e('0x38')]({'attributes':['id',_0x463e('0x54')],'where':{'id':_0x31f4c2['interaction'][_0x463e('0x52')]}})[_0x463e('0xe')](function(_0x3817b1){if(_0x3817b1){_0x31f4c2['applications'][_0x463e('0x55')]({'id':0x0,'priority':0x0,'app':_0x463e('0x56'),'appdata':_0x3817b1['name']+','+(_0x31f4c2['account'][_0x463e('0x57')]||0xa),'interval':_0x463e('0x4d')});}return respondWithRpcPromise(_0x463e('0x58'),_0x463e('0x59'),_0x31f4c2);});}return respondWithRpcPromise(_0x463e('0x58'),_0x463e('0x59'),_0x31f4c2);})[_0x463e('0xe')](function(_0x51efcb){_0x257b2f(_0x51efcb);})[_0x463e('0x19')](function(_0x1bf4f9){_0x4ce8c1(_0x50fd5a[_0x463e('0x15')](0x1f4,_0x1bf4f9[_0x463e('0x17')]));});});};
\ No newline at end of file
+var _0x9418=['stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where','attributes','limit','include','map','model','NotifyFaxAccount','fax','describe','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','keys','CompanyId','ListId','body','from','ValidationError','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','CmContact','Contacts','DESC','FaxApplication','account','Applications','applications','orderBy','priority','asc','length','FaxInteraction','create','Contact\x20not\x20found','get','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','User','name','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./faxAccount.socket','register','then','info','request\x20sent','debug'];(function(_0x495b3d,_0x4d3da4){var _0x4cb329=function(_0xdef9f0){while(--_0xdef9f0){_0x495b3d['push'](_0x495b3d['shift']());}};_0x4cb329(++_0x4d3da4);}(_0x9418,0xa1));var _0x8941=function(_0x3b660f,_0x45c3db){_0x3b660f=_0x3b660f-0x0;var _0x187a29=_0x9418[_0x3b660f];return _0x187a29;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8941('0x0'));var BPromise=require(_0x8941('0x1'));var rs=require(_0x8941('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8941('0x3'))['db'];var utils=require(_0x8941('0x4'));var logger=require('../../config/logger')(_0x8941('0x5'));var config=require(_0x8941('0x6'));var jayson=require(_0x8941('0x7'));var client=jayson['client']['http']({'port':0x232c});config[_0x8941('0x8')]=_[_0x8941('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8941('0xa'))(new Redis(config['redis']));require(_0x8941('0xb'))[_0x8941('0xc')](socket);function respondWithRpcPromise(_0x162c72,_0x555ece,_0x50960c){return new BPromise(function(_0x226522,_0x288698){return client['request'](_0x162c72,_0x50960c)[_0x8941('0xd')](function(_0xc97222){logger[_0x8941('0xe')]('FaxAccount,\x20%s,\x20%s',_0x555ece,_0x8941('0xf'));logger[_0x8941('0x10')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x555ece,_0x8941('0xf'),JSON[_0x8941('0x11')](_0xc97222));if(_0xc97222['error']){if(_0xc97222[_0x8941('0x12')][_0x8941('0x13')]===0x1f4){logger[_0x8941('0x12')](_0x8941('0x14'),_0x555ece,_0xc97222[_0x8941('0x12')]['message']);return _0x288698(_0xc97222[_0x8941('0x12')]['message']);}logger[_0x8941('0x12')]('FaxAccount,\x20%s,\x20%s',_0x555ece,_0xc97222['error'][_0x8941('0x15')]);return _0x226522(_0xc97222[_0x8941('0x12')]['message']);}else{logger[_0x8941('0xe')]('FaxAccount,\x20%s,\x20%s',_0x555ece,_0x8941('0xf'));_0x226522(_0xc97222[_0x8941('0x16')][_0x8941('0x15')]);}})[_0x8941('0x17')](function(_0x8e119d){logger['error']('FaxAccount,\x20%s,\x20%s',_0x555ece,_0x8e119d);_0x288698(_0x8e119d);});});}exports[_0x8941('0x18')]=function(_0x5984f7){var _0x3ef76d=this;return new Promise(function(_0xa62ea5,_0x9e0f62){return db[_0x8941('0x19')]['findAll']({'raw':_0x5984f7['options']?_0x5984f7[_0x8941('0x1a')][_0x8941('0x1b')]===undefined?!![]:![]:!![],'where':_0x5984f7[_0x8941('0x1a')]?_0x5984f7[_0x8941('0x1a')][_0x8941('0x1c')]||null:null,'attributes':_0x5984f7['options']?_0x5984f7[_0x8941('0x1a')][_0x8941('0x1d')]||null:null,'limit':_0x5984f7[_0x8941('0x1a')]?_0x5984f7['options'][_0x8941('0x1e')]||null:null,'include':_0x5984f7[_0x8941('0x1a')]?_0x5984f7[_0x8941('0x1a')][_0x8941('0x1f')]?_[_0x8941('0x20')](_0x5984f7['options'][_0x8941('0x1f')],function(_0x596956){return{'model':db[_0x596956[_0x8941('0x21')]],'as':_0x596956['as'],'attributes':_0x596956[_0x8941('0x1d')],'include':_0x596956[_0x8941('0x1f')]?_[_0x8941('0x20')](_0x596956[_0x8941('0x1f')],function(_0x1b5961){return{'model':db[_0x1b5961[_0x8941('0x21')]],'as':_0x1b5961['as'],'attributes':_0x1b5961[_0x8941('0x1d')],'include':_0x1b5961[_0x8941('0x1f')]?_['map'](_0x1b5961[_0x8941('0x1f')],function(_0x45f4ed){return{'model':db[_0x45f4ed[_0x8941('0x21')]],'as':_0x45f4ed['as'],'attributes':_0x45f4ed[_0x8941('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8941('0xd')](function(_0x3ad0e1){logger[_0x8941('0xe')]('GetFaxAccount',_0x5984f7);logger[_0x8941('0x10')]('GetFaxAccount',_0x5984f7,JSON[_0x8941('0x11')](_0x3ad0e1));_0xa62ea5(_0x3ad0e1);})['catch'](function(_0x226395){logger['error']('GetFaxAccount',_0x226395[_0x8941('0x15')],_0x5984f7);_0x9e0f62(_0x3ef76d[_0x8941('0x12')](0x1f4,_0x226395['message']));});});};exports[_0x8941('0x22')]=function(_0x4b82d1,_0x4dce57,_0x33af36){var _0x5110bc=this;return new Promise(function(_0x5f1e69,_0x1aa76a){var _0x52912e={'body':_0x4b82d1['body'],'channel':_0x8941('0x23')};var _0x298113=[];var _0xed3af0=[];var _0x230137={};return db['CmContact'][_0x8941('0x24')]()['then'](function(_0x41994c){if(!_0x41994c){throw new db[(_0x8941('0x25'))]['ValidationError'](_0x8941('0x26'));}_0x298113=_['difference'](_['keys'](_0x41994c),[_0x8941('0x27'),_0x8941('0x28')]);_0xed3af0=_[_0x8941('0x29')](_[_0x8941('0x2a')](_0x41994c),[_0x8941('0x27'),_0x8941('0x28'),_0x8941('0x2b'),_0x8941('0x2c')]);if(_0x4b82d1[_0x8941('0x2d')]['id']){delete _0x4b82d1[_0x8941('0x2d')]['id'];}if(_['isNil'](_0x4b82d1[_0x8941('0x2d')][_0x8941('0x2e')])){throw new db['Sequelize'][(_0x8941('0x2f'))]('from\x20is\x20mandatory');}if(_[_0x8941('0x30')](_0x4b82d1[_0x8941('0x2d')][_0x8941('0x2d')])||_0x4b82d1['body'][_0x8941('0x2d')]===''){throw new db[(_0x8941('0x25'))][(_0x8941('0x2f'))](_0x8941('0x31'));}if(_['isNil'](_0x4b82d1['body']['mapKey'])){throw new db[(_0x8941('0x25'))][(_0x8941('0x2f'))](_0x8941('0x32')+_0xed3af0);}if(!_[_0x8941('0x33')](_0xed3af0,_0x4b82d1[_0x8941('0x2d')][_0x8941('0x34')])){throw new db['Sequelize'][(_0x8941('0x2f'))](_0x8941('0x35')+_0xed3af0);}_0x230137[_0x4b82d1[_0x8941('0x2d')][_0x8941('0x34')]]=_0x4b82d1['body'][_0x8941('0x2e')];})[_0x8941('0xd')](function(){return db[_0x8941('0x19')][_0x8941('0x36')]({'where':{'id':_0x4b82d1['account']['id']},'include':[{'model':db[_0x8941('0x37')],'as':_0x8941('0x38'),'include':[{'model':db[_0x8941('0x39')],'as':_0x8941('0x3a'),'where':_0x230137,'limit':0x1,'order':[[_0x8941('0x28'),_0x8941('0x3b')]]}]},{'model':db[_0x8941('0x3c')],'as':'Applications'}]});})[_0x8941('0xd')](function(_0xf62817){if(_0xf62817&&_0xf62817[_0x8941('0x38')]){var _0x2cf8cc=_0xf62817['get']({'plain':!![]});_0x52912e[_0x8941('0x3d')]=_0x2cf8cc;_0x52912e['applications']=_0x2cf8cc[_0x8941('0x3e')];_0x52912e['list']=_0x2cf8cc[_0x8941('0x38')];_0x52912e[_0x8941('0x3f')]=_[_0x8941('0x40')](_0x52912e[_0x8941('0x3f')],[_0x8941('0x41')],[_0x8941('0x42')]);if(_0x52912e[_0x8941('0x3d')]['Applications']){delete _0x52912e[_0x8941('0x3d')][_0x8941('0x3e')];}if(_0x52912e['account']['List']&&_0x52912e[_0x8941('0x3d')]['List'][_0x8941('0x3a')][_0x8941('0x43')]){return _0x52912e[_0x8941('0x3d')][_0x8941('0x38')][_0x8941('0x3a')][0x0];}var _0x7b0c6d=_[_0x8941('0x9')](_0x4b82d1[_0x8941('0x2d')],{'firstName':_0x4b82d1[_0x8941('0x2d')][_0x8941('0x2e')],'ListId':_0x2cf8cc[_0x8941('0x2c')]});_0x7b0c6d[_0x4b82d1[_0x8941('0x2d')][_0x8941('0x34')]]=_0x4b82d1['body']['from'];return db[_0x8941('0x39')]['create'](_0x7b0c6d,{'fields':_0x298113,'raw':!![]});}})[_0x8941('0xd')](function(_0x5b8545){_0x52912e['contact']=_0x5b8545;if(_0x5b8545){var _0x5dc51f={'ContactId':_0x5b8545['id'],'FaxAccountId':_0x4b82d1['account']['id'],'fax':_0x5b8545[_0x8941('0x23')]};return db['FaxInteraction'][_0x8941('0x36')]({'where':{'ContactId':_0x5b8545['id'],'closed':![],'FaxAccountId':_0x4b82d1[_0x8941('0x3d')]['id']}})[_0x8941('0xd')](function(_0x265176){if(_0x265176){return[_0x265176,![]];}return db[_0x8941('0x44')][_0x8941('0x45')](_0x5dc51f)[_0x8941('0xd')](function(_0x3564d7){return[_0x3564d7,!![]];});});}else{throw new Error(_0x8941('0x46'));}})['spread'](function(_0x65f1e4,_0x18a4a8){var _0x86b00c=_0x65f1e4[_0x8941('0x47')]({'plain':!![]});if(_0x18a4a8){if(_0x52912e[_0x8941('0x3d')][_0x8941('0x48')]){_0x52912e[_0x8941('0x3f')][_0x8941('0x49')]({'id':0x0,'priority':_0x52912e[_0x8941('0x3f')][_0x8941('0x43')]+0x1,'app':_0x8941('0x4a'),'appdata':_0x8941('0x4b'),'interval':_0x8941('0x4c')});}_0x86b00c[_0x8941('0x4d')]=!![];}else{_0x86b00c['created']=![];}_0x52912e[_0x8941('0x4e')]=_0x86b00c;return db[_0x8941('0x4f')][_0x8941('0x45')]({'body':_0x4b82d1['body'][_0x8941('0x2d')],'FaxAccountId':_0x4b82d1[_0x8941('0x3d')]['id'],'FaxInteractionId':_0x65f1e4['id'],'direction':'in','ContactId':_0x65f1e4['ContactId'],'AttachmentId':_0x4b82d1[_0x8941('0x2d')][_0x8941('0x50')]});})[_0x8941('0xd')](function(_0x4bdf4a){_0x52912e[_0x8941('0x15')]=_0x4bdf4a;if(_0x52912e['interaction']['UserId']){return db[_0x8941('0x51')][_0x8941('0x36')]({'attributes':['id',_0x8941('0x52')],'where':{'id':_0x52912e[_0x8941('0x4e')][_0x8941('0x53')]}})[_0x8941('0xd')](function(_0x243406){if(_0x243406){_0x52912e[_0x8941('0x3f')][_0x8941('0x54')]({'id':0x0,'priority':0x0,'app':_0x8941('0x55'),'appdata':_0x243406['name']+','+(_0x52912e[_0x8941('0x3d')][_0x8941('0x56')]||0xa),'interval':_0x8941('0x4c')});}return respondWithRpcPromise('Start',_0x8941('0x57'),_0x52912e);});}return respondWithRpcPromise(_0x8941('0x58'),'startRouting',_0x52912e);})[_0x8941('0xd')](function(_0x289e76){_0x5f1e69(_0x289e76);})[_0x8941('0x17')](function(_0x577331){_0x1aa76a(_0x5110bc['error'](0x1f4,_0x577331[_0x8941('0x15')]));});});};
\ No newline at end of file
index 641d42d..0658de4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebbe=['register','length','./faxAccount.events','save','remove','update','emit','removeListener'];(function(_0x404f08,_0x46c8b0){var _0x5aca3a=function(_0x85cd3){while(--_0x85cd3){_0x404f08['push'](_0x404f08['shift']());}};_0x5aca3a(++_0x46c8b0);}(_0xebbe,0x9a));var _0xeebb=function(_0x30640e,_0x4b658f){_0x30640e=_0x30640e-0x0;var _0x2e510b=_0xebbe[_0x30640e];return _0x2e510b;};'use strict';var FaxAccountEvents=require(_0xeebb('0x0'));var events=[_0xeebb('0x1'),_0xeebb('0x2'),_0xeebb('0x3')];function createListener(_0x294d86,_0x40f63e){return function(_0x38af2e){_0x40f63e[_0xeebb('0x4')](_0x294d86,_0x38af2e);};}function removeListener(_0x1df84a,_0x309bfa){return function(){FaxAccountEvents[_0xeebb('0x5')](_0x1df84a,_0x309bfa);};}exports[_0xeebb('0x6')]=function(_0x2e24d6){for(var _0x50a8c9=0x0,_0x541a3d=events[_0xeebb('0x7')];_0x50a8c9<_0x541a3d;_0x50a8c9++){var _0x54fdd9=events[_0x50a8c9];var _0x5c9d95=createListener('faxAccount:'+_0x54fdd9,_0x2e24d6);FaxAccountEvents['on'](_0x54fdd9,_0x5c9d95);}};
\ No newline at end of file
+var _0x8aa3=['faxAccount:','./faxAccount.events','save','update','emit','removeListener','register','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8aa3,0xf1));var _0x38aa=function(_0x27123d,_0x2b134d){_0x27123d=_0x27123d-0x0;var _0x33bf21=_0x8aa3[_0x27123d];return _0x33bf21;};'use strict';var FaxAccountEvents=require(_0x38aa('0x0'));var events=[_0x38aa('0x1'),'remove',_0x38aa('0x2')];function createListener(_0x92c0e0,_0x2cabef){return function(_0x5dc441){_0x2cabef[_0x38aa('0x3')](_0x92c0e0,_0x5dc441);};}function removeListener(_0x50eafb,_0x1eae84){return function(){FaxAccountEvents[_0x38aa('0x4')](_0x50eafb,_0x1eae84);};}exports[_0x38aa('0x5')]=function(_0xf06672){for(var _0x142e15=0x0,_0x29f282=events[_0x38aa('0x6')];_0x142e15<_0x29f282;_0x142e15++){var _0x49ed46=events[_0x142e15];var _0x2319f8=createListener(_0x38aa('0x7')+_0x49ed46,_0xf06672);FaxAccountEvents['on'](_0x49ed46,_0x2319f8);}};
\ No newline at end of file
index f7e853f..50b479e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x42f423,_0x3249f5){var _0x167993=function(_0x29b835){while(--_0x29b835){_0x42f423['push'](_0x42f423['shift']());}};_0x167993(++_0x3249f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x58ff4c,_0x320115){var _0x2a49df=function(_0x55796f){while(--_0x55796f){_0x58ff4c['push'](_0x58ff4c['shift']());}};_0x2a49df(++_0x320115);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router;
\ No newline at end of file
index a359b8e..6a6744d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38ed=['INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x38ed,0x1d3));var _0xd38e=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x38ed[_0x334841];return _0x5beb4b;};'use strict';var Sequelize=require(_0xd38e('0x0'));module[_0xd38e('0x1')]={'priority':{'type':Sequelize[_0xd38e('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd38e('0x3')},'appdata':{'type':Sequelize[_0xd38e('0x4')]()},'description':{'type':Sequelize[_0xd38e('0x5')]},'interval':{'type':Sequelize[_0xd38e('0x5')],'defaultValue':_0xd38e('0x6')}};
\ No newline at end of file
+var _0xca1d=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x250e8c,_0x45b256){var _0x44d0b5=function(_0x52d0a0){while(--_0x52d0a0){_0x250e8c['push'](_0x250e8c['shift']());}};_0x44d0b5(++_0x45b256);}(_0xca1d,0xe0));var _0xdca1=function(_0x4e1392,_0x4e1947){_0x4e1392=_0x4e1392-0x0;var _0x9b8c3f=_0xca1d[_0x4e1392];return _0x9b8c3f;};'use strict';var Sequelize=require(_0xdca1('0x0'));module[_0xdca1('0x1')]={'priority':{'type':Sequelize[_0xdca1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xdca1('0x3')],'allowNull':![],'defaultValue':_0xdca1('0x4')},'appdata':{'type':Sequelize[_0xdca1('0x5')]()},'description':{'type':Sequelize[_0xdca1('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xdca1('0x6')}};
\ No newline at end of file
index 945336d..3b42c3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd841=['status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','includeAll','include','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x492221,_0x9e2521){var _0x398bf9=function(_0x303c5b){while(--_0x303c5b){_0x492221['push'](_0x492221['shift']());}};_0x398bf9(++_0x9e2521);}(_0xd841,0x19d));var _0x1d84=function(_0x510f44,_0x1a0bd8){_0x510f44=_0x510f44-0x0;var _0x55dbb7=_0xd841[_0x510f44];return _0x55dbb7;};'use strict';var emlformat=require(_0x1d84('0x0'));var rimraf=require(_0x1d84('0x1'));var zipdir=require(_0x1d84('0x2'));var jsonpatch=require(_0x1d84('0x3'));var rp=require('request-promise');var moment=require(_0x1d84('0x4'));var BPromise=require(_0x1d84('0x5'));var Mustache=require(_0x1d84('0x6'));var util=require(_0x1d84('0x7'));var path=require(_0x1d84('0x8'));var sox=require(_0x1d84('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d84('0xa'));var _=require(_0x1d84('0xb'));var squel=require('squel');var crypto=require(_0x1d84('0xc'));var jsforce=require(_0x1d84('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1d84('0xe'));var querystring=require(_0x1d84('0xf'));var Papa=require(_0x1d84('0x10'));var Redis=require(_0x1d84('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1d84('0x12'));var hardwareService=require(_0x1d84('0x13'));var logger=require(_0x1d84('0x14'))(_0x1d84('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1d84('0x16'));var db=require(_0x1d84('0x17'))['db'];function respondWithStatusCode(_0x36b6e7,_0x1241c2){_0x1241c2=_0x1241c2||0xcc;return function(_0x48dfb1){if(_0x48dfb1){return _0x36b6e7[_0x1d84('0x18')](_0x1241c2);}return _0x36b6e7[_0x1d84('0x19')](_0x1241c2)['end']();};}function respondWithResult(_0x2da308,_0x1ca2f0){_0x1ca2f0=_0x1ca2f0||0xc8;return function(_0x96ec62){if(_0x96ec62){return _0x2da308[_0x1d84('0x19')](_0x1ca2f0)[_0x1d84('0x1a')](_0x96ec62);}};}function respondWithFilteredResult(_0x390445,_0xa1f1b3){return function(_0xbc9fad){if(_0xbc9fad){var _0x4e3a75=typeof _0xa1f1b3[_0x1d84('0x1b')]===_0x1d84('0x1c')&&typeof _0xa1f1b3[_0x1d84('0x1d')]===_0x1d84('0x1c');var _0x2080b2=_0xbc9fad[_0x1d84('0x1e')];var _0x2924cf=_0x4e3a75?0x0:_0xa1f1b3[_0x1d84('0x1b')];var _0x22e23e=_0x4e3a75?_0xbc9fad[_0x1d84('0x1e')]:_0xa1f1b3[_0x1d84('0x1b')]+_0xa1f1b3[_0x1d84('0x1d')];var _0x201816;if(_0x22e23e>=_0x2080b2){_0x22e23e=_0x2080b2;_0x201816=0xc8;}else{_0x201816=0xce;}_0x390445[_0x1d84('0x19')](_0x201816);return _0x390445[_0x1d84('0x1f')](_0x1d84('0x20'),_0x2924cf+'-'+_0x22e23e+'/'+_0x2080b2)[_0x1d84('0x1a')](_0xbc9fad);}return null;};}function patchUpdates(_0x2d9082){return function(_0x49b293){try{jsonpatch[_0x1d84('0x21')](_0x49b293,_0x2d9082,!![]);}catch(_0x46ffaf){return BPromise['reject'](_0x46ffaf);}return _0x49b293[_0x1d84('0x22')]();};}function saveUpdates(_0x28d8f4,_0x515f01){return function(_0x38a99d){if(_0x38a99d){return _0x38a99d[_0x1d84('0x23')](_0x28d8f4)[_0x1d84('0x24')](function(_0x499abf){return _0x499abf;});}return null;};}function removeEntity(_0x2dead4,_0x341c67){return function(_0x3ae9d1){if(_0x3ae9d1){return _0x3ae9d1[_0x1d84('0x25')]()['then'](function(){_0x2dead4[_0x1d84('0x19')](0xcc)[_0x1d84('0x26')]();});}};}function handleEntityNotFound(_0x16d501,_0xb83b5a){return function(_0x1291d4){if(!_0x1291d4){_0x16d501[_0x1d84('0x18')](0x194);}return _0x1291d4;};}function handleError(_0x34aee1,_0x1462be){_0x1462be=_0x1462be||0x1f4;return function(_0x561c31){logger[_0x1d84('0x27')](_0x561c31[_0x1d84('0x28')]);if(_0x561c31['name']){delete _0x561c31[_0x1d84('0x29')];}_0x34aee1['status'](_0x1462be)[_0x1d84('0x2a')](_0x561c31);};}exports[_0x1d84('0x2b')]=function(_0x22ffb8,_0x4f2347){var _0x3734c6={},_0x5e73ae={},_0x5f3aa1={'count':0x0,'rows':[]};var _0x301b8c=_[_0x1d84('0x2c')](db[_0x1d84('0x2d')][_0x1d84('0x2e')],function(_0x33f758){return{'name':_0x33f758[_0x1d84('0x2f')],'type':_0x33f758[_0x1d84('0x30')][_0x1d84('0x31')]};});_0x5e73ae[_0x1d84('0x32')]=_[_0x1d84('0x2c')](_0x301b8c,_0x1d84('0x29'));_0x5e73ae[_0x1d84('0x33')]=_[_0x1d84('0x34')](_0x22ffb8[_0x1d84('0x33')]);_0x5e73ae[_0x1d84('0x35')]=_[_0x1d84('0x36')](_0x5e73ae[_0x1d84('0x32')],_0x5e73ae[_0x1d84('0x33')]);_0x3734c6['attributes']=_[_0x1d84('0x36')](_0x5e73ae[_0x1d84('0x32')],qs[_0x1d84('0x37')](_0x22ffb8['query'][_0x1d84('0x37')]));_0x3734c6[_0x1d84('0x38')]=_0x3734c6[_0x1d84('0x38')][_0x1d84('0x39')]?_0x3734c6[_0x1d84('0x38')]:_0x5e73ae[_0x1d84('0x32')];if(!_0x22ffb8[_0x1d84('0x33')]['hasOwnProperty'](_0x1d84('0x3a'))){_0x3734c6[_0x1d84('0x1d')]=qs[_0x1d84('0x1d')](_0x22ffb8[_0x1d84('0x33')]['limit']);_0x3734c6[_0x1d84('0x1b')]=qs[_0x1d84('0x1b')](_0x22ffb8[_0x1d84('0x33')][_0x1d84('0x1b')]);}_0x3734c6[_0x1d84('0x3b')]=qs[_0x1d84('0x3c')](_0x22ffb8[_0x1d84('0x33')][_0x1d84('0x3c')]);_0x3734c6[_0x1d84('0x3d')]=qs[_0x1d84('0x35')](_['pick'](_0x22ffb8['query'],_0x5e73ae[_0x1d84('0x35')]),_0x301b8c);if(_0x22ffb8['query'][_0x1d84('0x3e')]){_0x3734c6[_0x1d84('0x3d')]=_[_0x1d84('0x3f')](_0x3734c6['where'],{'$or':_['map'](_0x301b8c,function(_0x52a918){if(_0x52a918[_0x1d84('0x30')]!=='VIRTUAL'){var _0xd2ff65={};_0xd2ff65[_0x52a918[_0x1d84('0x29')]]={'$like':'%'+_0x22ffb8[_0x1d84('0x33')][_0x1d84('0x3e')]+'%'};return _0xd2ff65;}})});}_0x3734c6=_[_0x1d84('0x3f')]({},_0x3734c6,_0x22ffb8['options']);var _0x21b242={'where':_0x3734c6[_0x1d84('0x3d')]};return db['FaxApplication'][_0x1d84('0x1e')](_0x21b242)[_0x1d84('0x24')](function(_0x1182f3){_0x5f3aa1[_0x1d84('0x1e')]=_0x1182f3;if(_0x22ffb8[_0x1d84('0x33')][_0x1d84('0x40')]){_0x3734c6[_0x1d84('0x41')]=[{'all':!![]}];}return db[_0x1d84('0x2d')]['findAll'](_0x3734c6);})[_0x1d84('0x24')](function(_0x5971e7){_0x5f3aa1[_0x1d84('0x42')]=_0x5971e7;return _0x5f3aa1;})[_0x1d84('0x24')](respondWithFilteredResult(_0x4f2347,_0x3734c6))[_0x1d84('0x43')](handleError(_0x4f2347,null));};exports[_0x1d84('0x44')]=function(_0x11614f,_0x4cd96b){var _0x5a828e={'raw':!![],'where':{'id':_0x11614f[_0x1d84('0x45')]['id']}},_0xdf5109={};_0xdf5109[_0x1d84('0x32')]=_[_0x1d84('0x34')](db[_0x1d84('0x2d')][_0x1d84('0x2e')]);_0xdf5109[_0x1d84('0x33')]=_[_0x1d84('0x34')](_0x11614f['query']);_0xdf5109[_0x1d84('0x35')]=_[_0x1d84('0x36')](_0xdf5109[_0x1d84('0x32')],_0xdf5109['query']);_0x5a828e[_0x1d84('0x38')]=_[_0x1d84('0x36')](_0xdf5109[_0x1d84('0x32')],qs[_0x1d84('0x37')](_0x11614f['query']['fields']));_0x5a828e[_0x1d84('0x38')]=_0x5a828e[_0x1d84('0x38')][_0x1d84('0x39')]?_0x5a828e[_0x1d84('0x38')]:_0xdf5109[_0x1d84('0x32')];if(_0x11614f[_0x1d84('0x33')][_0x1d84('0x40')]){_0x5a828e[_0x1d84('0x41')]=[{'all':!![]}];}_0x5a828e=_[_0x1d84('0x3f')]({},_0x5a828e,_0x11614f['options']);return db['FaxApplication']['find'](_0x5a828e)['then'](handleEntityNotFound(_0x4cd96b,null))[_0x1d84('0x24')](respondWithResult(_0x4cd96b,null))[_0x1d84('0x43')](handleError(_0x4cd96b,null));};exports['create']=function(_0x2353c1,_0x380359){return db[_0x1d84('0x2d')][_0x1d84('0x46')](_0x2353c1['body'],{})['then'](respondWithResult(_0x380359,0xc9))[_0x1d84('0x43')](handleError(_0x380359,null));};exports['update']=function(_0x3619b1,_0x71104a){if(_0x3619b1[_0x1d84('0x47')]['id']){delete _0x3619b1[_0x1d84('0x47')]['id'];}return db[_0x1d84('0x2d')][_0x1d84('0x48')]({'where':{'id':_0x3619b1[_0x1d84('0x45')]['id']}})[_0x1d84('0x24')](handleEntityNotFound(_0x71104a,null))[_0x1d84('0x24')](saveUpdates(_0x3619b1[_0x1d84('0x47')],null))['then'](respondWithResult(_0x71104a,null))[_0x1d84('0x43')](handleError(_0x71104a,null));};exports['destroy']=function(_0x1a738e,_0x594fa5){return db[_0x1d84('0x2d')][_0x1d84('0x48')]({'where':{'id':_0x1a738e[_0x1d84('0x45')]['id']}})['then'](handleEntityNotFound(_0x594fa5,null))[_0x1d84('0x24')](removeEntity(_0x594fa5,null))[_0x1d84('0x43')](handleError(_0x594fa5,null));};
\ No newline at end of file
+var _0x870f=['status','end','json','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','FaxApplication','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','fields','create','body','params','destroy','find','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x358e83,_0x357d96){var _0x28252f=function(_0x26cf1d){while(--_0x26cf1d){_0x358e83['push'](_0x358e83['shift']());}};_0x28252f(++_0x357d96);}(_0x870f,0x78));var _0xf870=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x870f[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xf870('0x0'));var rimraf=require(_0xf870('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf870('0x2'));var moment=require(_0xf870('0x3'));var BPromise=require(_0xf870('0x4'));var Mustache=require(_0xf870('0x5'));var util=require(_0xf870('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf870('0x7'));var ejs=require(_0xf870('0x8'));var fs=require('fs');var fs_extra=require(_0xf870('0x9'));var _=require(_0xf870('0xa'));var squel=require('squel');var crypto=require(_0xf870('0xb'));var jsforce=require(_0xf870('0xc'));var deskjs=require(_0xf870('0xd'));var toCsv=require(_0xf870('0x7'));var querystring=require(_0xf870('0xe'));var Papa=require('papaparse');var Redis=require(_0xf870('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf870('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf870('0x11'));var logger=require('../../config/logger')(_0xf870('0x12'));var utils=require('../../config/utils');var config=require(_0xf870('0x13'));var licenseUtil=require(_0xf870('0x14'));var db=require(_0xf870('0x15'))['db'];function respondWithStatusCode(_0x485358,_0x589ccc){_0x589ccc=_0x589ccc||0xcc;return function(_0x41e39f){if(_0x41e39f){return _0x485358['sendStatus'](_0x589ccc);}return _0x485358[_0xf870('0x16')](_0x589ccc)[_0xf870('0x17')]();};}function respondWithResult(_0x104209,_0x40347f){_0x40347f=_0x40347f||0xc8;return function(_0x14799a){if(_0x14799a){return _0x104209['status'](_0x40347f)[_0xf870('0x18')](_0x14799a);}};}function respondWithFilteredResult(_0xd8f0a9,_0x505d54){return function(_0x473d13){if(_0x473d13){var _0x303dfd=typeof _0x505d54['offset']===_0xf870('0x19')&&typeof _0x505d54[_0xf870('0x1a')]===_0xf870('0x19');var _0x56e272=_0x473d13[_0xf870('0x1b')];var _0x33ea94=_0x303dfd?0x0:_0x505d54['offset'];var _0x21f759=_0x303dfd?_0x473d13['count']:_0x505d54['offset']+_0x505d54[_0xf870('0x1a')];var _0x2d6db1;if(_0x21f759>=_0x56e272){_0x21f759=_0x56e272;_0x2d6db1=0xc8;}else{_0x2d6db1=0xce;}_0xd8f0a9[_0xf870('0x16')](_0x2d6db1);return _0xd8f0a9[_0xf870('0x1c')]('Content-Range',_0x33ea94+'-'+_0x21f759+'/'+_0x56e272)['json'](_0x473d13);}return null;};}function patchUpdates(_0x3fd286){return function(_0x9af9e1){try{jsonpatch[_0xf870('0x1d')](_0x9af9e1,_0x3fd286,!![]);}catch(_0x43a256){return BPromise[_0xf870('0x1e')](_0x43a256);}return _0x9af9e1[_0xf870('0x1f')]();};}function saveUpdates(_0x5210bf,_0x2d781a){return function(_0x291ca2){if(_0x291ca2){return _0x291ca2[_0xf870('0x20')](_0x5210bf)['then'](function(_0x50e91e){return _0x50e91e;});}return null;};}function removeEntity(_0x36e3d3,_0x2424e9){return function(_0x4b109a){if(_0x4b109a){return _0x4b109a['destroy']()[_0xf870('0x21')](function(){_0x36e3d3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x321d21,_0xe29c){return function(_0x1af5ff){if(!_0x1af5ff){_0x321d21['sendStatus'](0x194);}return _0x1af5ff;};}function handleError(_0x5b1c0a,_0x44b30d){_0x44b30d=_0x44b30d||0x1f4;return function(_0x1ecdff){logger[_0xf870('0x22')](_0x1ecdff[_0xf870('0x23')]);if(_0x1ecdff[_0xf870('0x24')]){delete _0x1ecdff['name'];}_0x5b1c0a[_0xf870('0x16')](_0x44b30d)[_0xf870('0x25')](_0x1ecdff);};}exports[_0xf870('0x26')]=function(_0x2adfb4,_0x2b6d86){var _0x3158e4={},_0x1f2091={},_0x2d8a3d={'count':0x0,'rows':[]};var _0x193639=_[_0xf870('0x27')](db[_0xf870('0x28')]['rawAttributes'],function(_0x5398cb){return{'name':_0x5398cb['fieldName'],'type':_0x5398cb[_0xf870('0x29')][_0xf870('0x2a')]};});_0x1f2091['model']=_[_0xf870('0x27')](_0x193639,_0xf870('0x24'));_0x1f2091[_0xf870('0x2b')]=_[_0xf870('0x2c')](_0x2adfb4[_0xf870('0x2b')]);_0x1f2091[_0xf870('0x2d')]=_[_0xf870('0x2e')](_0x1f2091[_0xf870('0x2f')],_0x1f2091[_0xf870('0x2b')]);_0x3158e4['attributes']=_[_0xf870('0x2e')](_0x1f2091['model'],qs['fields'](_0x2adfb4[_0xf870('0x2b')]['fields']));_0x3158e4[_0xf870('0x30')]=_0x3158e4['attributes'][_0xf870('0x31')]?_0x3158e4[_0xf870('0x30')]:_0x1f2091[_0xf870('0x2f')];if(!_0x2adfb4[_0xf870('0x2b')][_0xf870('0x32')](_0xf870('0x33'))){_0x3158e4['limit']=qs['limit'](_0x2adfb4[_0xf870('0x2b')][_0xf870('0x1a')]);_0x3158e4[_0xf870('0x34')]=qs[_0xf870('0x34')](_0x2adfb4['query'][_0xf870('0x34')]);}_0x3158e4[_0xf870('0x35')]=qs['sort'](_0x2adfb4[_0xf870('0x2b')][_0xf870('0x36')]);_0x3158e4[_0xf870('0x37')]=qs['filters'](_[_0xf870('0x38')](_0x2adfb4[_0xf870('0x2b')],_0x1f2091[_0xf870('0x2d')]),_0x193639);if(_0x2adfb4[_0xf870('0x2b')][_0xf870('0x39')]){_0x3158e4[_0xf870('0x37')]=_[_0xf870('0x3a')](_0x3158e4[_0xf870('0x37')],{'$or':_['map'](_0x193639,function(_0x3a144e){if(_0x3a144e[_0xf870('0x29')]!==_0xf870('0x3b')){var _0x3b53f3={};_0x3b53f3[_0x3a144e[_0xf870('0x24')]]={'$like':'%'+_0x2adfb4[_0xf870('0x2b')][_0xf870('0x39')]+'%'};return _0x3b53f3;}})});}_0x3158e4=_[_0xf870('0x3a')]({},_0x3158e4,_0x2adfb4[_0xf870('0x3c')]);var _0x40bccc={'where':_0x3158e4['where']};return db[_0xf870('0x28')][_0xf870('0x1b')](_0x40bccc)[_0xf870('0x21')](function(_0x5b1781){_0x2d8a3d[_0xf870('0x1b')]=_0x5b1781;if(_0x2adfb4['query'][_0xf870('0x3d')]){_0x3158e4[_0xf870('0x3e')]=[{'all':!![]}];}return db[_0xf870('0x28')]['findAll'](_0x3158e4);})[_0xf870('0x21')](function(_0x5044d4){_0x2d8a3d['rows']=_0x5044d4;return _0x2d8a3d;})[_0xf870('0x21')](respondWithFilteredResult(_0x2b6d86,_0x3158e4))[_0xf870('0x3f')](handleError(_0x2b6d86,null));};exports[_0xf870('0x40')]=function(_0x523f3a,_0x598ef2){var _0x3b3bed={'raw':!![],'where':{'id':_0x523f3a['params']['id']}},_0x3dadda={};_0x3dadda['model']=_['keys'](db[_0xf870('0x28')]['rawAttributes']);_0x3dadda[_0xf870('0x2b')]=_['keys'](_0x523f3a['query']);_0x3dadda['filters']=_['intersection'](_0x3dadda['model'],_0x3dadda[_0xf870('0x2b')]);_0x3b3bed[_0xf870('0x30')]=_[_0xf870('0x2e')](_0x3dadda[_0xf870('0x2f')],qs[_0xf870('0x41')](_0x523f3a['query'][_0xf870('0x41')]));_0x3b3bed[_0xf870('0x30')]=_0x3b3bed['attributes'][_0xf870('0x31')]?_0x3b3bed[_0xf870('0x30')]:_0x3dadda[_0xf870('0x2f')];if(_0x523f3a[_0xf870('0x2b')][_0xf870('0x3d')]){_0x3b3bed['include']=[{'all':!![]}];}_0x3b3bed=_[_0xf870('0x3a')]({},_0x3b3bed,_0x523f3a[_0xf870('0x3c')]);return db[_0xf870('0x28')]['find'](_0x3b3bed)[_0xf870('0x21')](handleEntityNotFound(_0x598ef2,null))[_0xf870('0x21')](respondWithResult(_0x598ef2,null))['catch'](handleError(_0x598ef2,null));};exports['create']=function(_0x2cc1cd,_0x4e20b4){return db[_0xf870('0x28')][_0xf870('0x42')](_0x2cc1cd[_0xf870('0x43')],{})[_0xf870('0x21')](respondWithResult(_0x4e20b4,0xc9))[_0xf870('0x3f')](handleError(_0x4e20b4,null));};exports[_0xf870('0x20')]=function(_0x4f4e6b,_0x34462f){if(_0x4f4e6b[_0xf870('0x43')]['id']){delete _0x4f4e6b[_0xf870('0x43')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x4f4e6b[_0xf870('0x44')]['id']}})[_0xf870('0x21')](handleEntityNotFound(_0x34462f,null))[_0xf870('0x21')](saveUpdates(_0x4f4e6b[_0xf870('0x43')],null))['then'](respondWithResult(_0x34462f,null))[_0xf870('0x3f')](handleError(_0x34462f,null));};exports[_0xf870('0x45')]=function(_0x5539c7,_0x3cd255){return db[_0xf870('0x28')][_0xf870('0x46')]({'where':{'id':_0x5539c7[_0xf870('0x44')]['id']}})[_0xf870('0x21')](handleEntityNotFound(_0x3cd255,null))['then'](removeEntity(_0x3cd255,null))['catch'](handleError(_0x3cd255,null));};
\ No newline at end of file
index da66b3d..632f921 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7b3=['../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x2445e2,_0xc4a747){var _0x1e5736=function(_0x4a6509){while(--_0x4a6509){_0x2445e2['push'](_0x2445e2['shift']());}};_0x1e5736(++_0xc4a747);}(_0xe7b3,0x134));var _0x3e7b=function(_0x457e7d,_0x5406c2){_0x457e7d=_0x457e7d-0x0;var _0x2d26a2=_0xe7b3[_0x457e7d];return _0x2d26a2;};'use strict';var _=require('lodash');var util=require(_0x3e7b('0x0'));var logger=require(_0x3e7b('0x1'))('api');var moment=require(_0x3e7b('0x2'));var BPromise=require(_0x3e7b('0x3'));var rp=require(_0x3e7b('0x4'));var fs=require('fs');var path=require(_0x3e7b('0x5'));var rimraf=require(_0x3e7b('0x6'));var config=require(_0x3e7b('0x7'));var attributes=require(_0x3e7b('0x8'));module[_0x3e7b('0x9')]=function(_0x2187ec,_0x59dae7){return _0x2187ec[_0x3e7b('0xa')](_0x3e7b('0xb'),attributes,{'tableName':_0x3e7b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3e7b('0xd'),'collate':_0x3e7b('0xe')});};
\ No newline at end of file
+var _0xc9f3=['FaxApplication','fax_applications','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxApplication.attributes','exports'];(function(_0x5ef3b3,_0x54dae8){var _0x2bcba9=function(_0x2d8e26){while(--_0x2d8e26){_0x5ef3b3['push'](_0x5ef3b3['shift']());}};_0x2bcba9(++_0x54dae8);}(_0xc9f3,0xf3));var _0x3c9f=function(_0x1b4d49,_0x47792f){_0x1b4d49=_0x1b4d49-0x0;var _0x240274=_0xc9f3[_0x1b4d49];return _0x240274;};'use strict';var _=require(_0x3c9f('0x0'));var util=require('util');var logger=require(_0x3c9f('0x1'))('api');var moment=require(_0x3c9f('0x2'));var BPromise=require(_0x3c9f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3c9f('0x4'));var rimraf=require(_0x3c9f('0x5'));var config=require(_0x3c9f('0x6'));var attributes=require(_0x3c9f('0x7'));module[_0x3c9f('0x8')]=function(_0x3a26d5,_0x8ade9b){return _0x3a26d5['define'](_0x3c9f('0x9'),attributes,{'tableName':_0x3c9f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3c9f('0xb')});};
\ No newline at end of file
index dcdfb27..a242550 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb2b=['error','code','message','info','result','UpdateFaxApplication','update','body','options','where','attributes','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2d0714,_0x55704a){var _0x412b45=function(_0x370313){while(--_0x370313){_0x2d0714['push'](_0x2d0714['shift']());}};_0x412b45(++_0x55704a);}(_0xcb2b,0x156));var _0xbcb2=function(_0x5a9867,_0x4ed3ca){_0x5a9867=_0x5a9867-0x0;var _0x1aec4c=_0xcb2b[_0x5a9867];return _0x1aec4c;};'use strict';var _=require(_0xbcb2('0x0'));var util=require(_0xbcb2('0x1'));var moment=require(_0xbcb2('0x2'));var BPromise=require(_0xbcb2('0x3'));var rs=require(_0xbcb2('0x4'));var fs=require('fs');var Redis=require(_0xbcb2('0x5'));var db=require(_0xbcb2('0x6'))['db'];var utils=require(_0xbcb2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xbcb2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbcb2('0x9')][_0xbcb2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21b271,_0x2b3c10,_0x12a25c){return new BPromise(function(_0x40b729,_0x3c620a){return client[_0xbcb2('0xb')](_0x21b271,_0x12a25c)[_0xbcb2('0xc')](function(_0x7a3f2c){logger['info'](_0xbcb2('0xd'),_0x2b3c10,_0xbcb2('0xe'));logger[_0xbcb2('0xf')](_0xbcb2('0x10'),_0x2b3c10,'request\x20sent',JSON[_0xbcb2('0x11')](_0x7a3f2c));if(_0x7a3f2c[_0xbcb2('0x12')]){if(_0x7a3f2c[_0xbcb2('0x12')][_0xbcb2('0x13')]===0x1f4){logger['error'](_0xbcb2('0xd'),_0x2b3c10,_0x7a3f2c[_0xbcb2('0x12')][_0xbcb2('0x14')]);return _0x3c620a(_0x7a3f2c[_0xbcb2('0x12')][_0xbcb2('0x14')]);}logger['error'](_0xbcb2('0xd'),_0x2b3c10,_0x7a3f2c['error'][_0xbcb2('0x14')]);return _0x40b729(_0x7a3f2c[_0xbcb2('0x12')][_0xbcb2('0x14')]);}else{logger[_0xbcb2('0x15')](_0xbcb2('0xd'),_0x2b3c10,_0xbcb2('0xe'));_0x40b729(_0x7a3f2c[_0xbcb2('0x16')][_0xbcb2('0x14')]);}})['catch'](function(_0x3f273f){logger[_0xbcb2('0x12')](_0xbcb2('0xd'),_0x2b3c10,_0x3f273f);_0x3c620a(_0x3f273f);});});}exports[_0xbcb2('0x17')]=function(_0xbbbffb){var _0x1eaecf=this;return new Promise(function(_0x2f20f4,_0x571e04){return db['FaxApplication'][_0xbcb2('0x18')](_0xbbbffb[_0xbcb2('0x19')],{'raw':_0xbbbffb[_0xbcb2('0x1a')]?_0xbbbffb[_0xbcb2('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbbbffb[_0xbcb2('0x1a')]?_0xbbbffb[_0xbcb2('0x1a')][_0xbcb2('0x1b')]||null:null,'attributes':_0xbbbffb[_0xbcb2('0x1a')]?_0xbbbffb[_0xbcb2('0x1a')][_0xbcb2('0x1c')]||null:null,'limit':_0xbbbffb['options']?_0xbbbffb[_0xbcb2('0x1a')]['limit']||null:null})[_0xbcb2('0xc')](function(_0x47d0b5){logger[_0xbcb2('0x15')](_0xbcb2('0x17'),_0xbbbffb);logger[_0xbcb2('0xf')](_0xbcb2('0x17'),_0xbbbffb,JSON[_0xbcb2('0x11')](_0x47d0b5));_0x2f20f4(_0x47d0b5);})[_0xbcb2('0x1d')](function(_0x4c64d2){logger['error'](_0xbcb2('0x17'),_0x4c64d2[_0xbcb2('0x14')],_0xbbbffb);_0x571e04(_0x1eaecf['error'](0x1f4,_0x4c64d2[_0xbcb2('0x14')]));});});};
\ No newline at end of file
+var _0xbdfd=['info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','then'];(function(_0x5971c3,_0x59e6d8){var _0x54ac86=function(_0x38c061){while(--_0x38c061){_0x5971c3['push'](_0x5971c3['shift']());}};_0x54ac86(++_0x59e6d8);}(_0xbdfd,0x135));var _0xdbdf=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xbdfd[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xdbdf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdbdf('0x1'));var rs=require(_0xdbdf('0x2'));var fs=require('fs');var Redis=require(_0xdbdf('0x3'));var db=require(_0xdbdf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdbdf('0x5'))(_0xdbdf('0x6'));var config=require('../../config/environment');var jayson=require(_0xdbdf('0x7'));var client=jayson[_0xdbdf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40096b,_0x116557,_0x121a56){return new BPromise(function(_0x272b5b,_0x39c0c6){return client['request'](_0x40096b,_0x121a56)[_0xdbdf('0x9')](function(_0x2fd118){logger[_0xdbdf('0xa')](_0xdbdf('0xb'),_0x116557,_0xdbdf('0xc'));logger[_0xdbdf('0xd')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x116557,'request\x20sent',JSON[_0xdbdf('0xe')](_0x2fd118));if(_0x2fd118[_0xdbdf('0xf')]){if(_0x2fd118[_0xdbdf('0xf')][_0xdbdf('0x10')]===0x1f4){logger[_0xdbdf('0xf')](_0xdbdf('0xb'),_0x116557,_0x2fd118['error'][_0xdbdf('0x11')]);return _0x39c0c6(_0x2fd118[_0xdbdf('0xf')][_0xdbdf('0x11')]);}logger[_0xdbdf('0xf')](_0xdbdf('0xb'),_0x116557,_0x2fd118[_0xdbdf('0xf')][_0xdbdf('0x11')]);return _0x272b5b(_0x2fd118['error'][_0xdbdf('0x11')]);}else{logger[_0xdbdf('0xa')](_0xdbdf('0xb'),_0x116557,_0xdbdf('0xc'));_0x272b5b(_0x2fd118[_0xdbdf('0x12')]['message']);}})[_0xdbdf('0x13')](function(_0x34c928){logger[_0xdbdf('0xf')](_0xdbdf('0xb'),_0x116557,_0x34c928);_0x39c0c6(_0x34c928);});});}exports[_0xdbdf('0x14')]=function(_0x439f87){var _0x34cbc0=this;return new Promise(function(_0x195c66,_0x378d2b){return db[_0xdbdf('0x15')][_0xdbdf('0x16')](_0x439f87[_0xdbdf('0x17')],{'raw':_0x439f87['options']?_0x439f87[_0xdbdf('0x18')][_0xdbdf('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x439f87[_0xdbdf('0x18')]?_0x439f87[_0xdbdf('0x18')][_0xdbdf('0x1a')]||null:null,'attributes':_0x439f87[_0xdbdf('0x18')]?_0x439f87[_0xdbdf('0x18')][_0xdbdf('0x1b')]||null:null,'limit':_0x439f87['options']?_0x439f87[_0xdbdf('0x18')][_0xdbdf('0x1c')]||null:null})[_0xdbdf('0x9')](function(_0xe629d2){logger['info'](_0xdbdf('0x14'),_0x439f87);logger[_0xdbdf('0xd')](_0xdbdf('0x14'),_0x439f87,JSON[_0xdbdf('0xe')](_0xe629d2));_0x195c66(_0xe629d2);})[_0xdbdf('0x13')](function(_0xf5c8a6){logger[_0xdbdf('0xf')](_0xdbdf('0x14'),_0xf5c8a6['message'],_0x439f87);_0x378d2b(_0x34cbc0[_0xdbdf('0xf')](0x1f4,_0xf5c8a6[_0xdbdf('0x11')]));});});};
\ No newline at end of file
index 07c17cf..9240934 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14a0=['get','isAuthenticated','/:id','show','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxApplication.controller'];(function(_0x5c7798,_0x5327af){var _0x154a57=function(_0x548970){while(--_0x548970){_0x5c7798['push'](_0x5c7798['shift']());}};_0x154a57(++_0x5327af);}(_0x14a0,0x8e));var _0x014a=function(_0x3cf701,_0x1ef7e8){_0x3cf701=_0x3cf701-0x0;var _0x4eef00=_0x14a0[_0x3cf701];return _0x4eef00;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x014a('0xd')]('/:id',auth[_0x014a('0x9')](),controller[_0x014a('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x7708=['multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','put','delete','destroy'];(function(_0x31c383,_0x49f621){var _0x37140c=function(_0xaba657){while(--_0xaba657){_0x31c383['push'](_0x31c383['shift']());}};_0x37140c(++_0x49f621);}(_0x7708,0x188));var _0x8770=function(_0x496333,_0x1c47d6){_0x496333=_0x496333-0x0;var _0x44256e=_0x7708[_0x496333];return _0x44256e;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./faxApplication.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0xa')]('/',auth[_0x8770('0x8')](),controller['create']);router[_0x8770('0xb')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller['update']);router[_0x8770('0xc')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0xd')]);module['exports']=router;
\ No newline at end of file
index d4d1939..94aeb07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b13=['exports','BOOLEAN','DATE','STRING','out','sequelize'];(function(_0x135624,_0xc72ac8){var _0x29d23c=function(_0x395a40){while(--_0x395a40){_0x135624['push'](_0x135624['shift']());}};_0x29d23c(++_0xc72ac8);}(_0x9b13,0x1af));var _0x39b1=function(_0x328b26,_0x574cb2){_0x328b26=_0x328b26-0x0;var _0x2a2bb3=_0x9b13[_0x328b26];return _0x2a2bb3;};'use strict';var Sequelize=require(_0x39b1('0x0'));module[_0x39b1('0x1')]={'closed':{'type':Sequelize[_0x39b1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x39b1('0x3')]},'disposition':{'type':Sequelize[_0x39b1('0x4')]},'secondDisposition':{'type':Sequelize[_0x39b1('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x39b1('0x3')]},'fax':{'type':Sequelize[_0x39b1('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x39b1('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x39b1('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x39b1('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0x2642=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x3ca072,_0x12d4d1){var _0x416061=function(_0xc5bd1c){while(--_0xc5bd1c){_0x3ca072['push'](_0x3ca072['shift']());}};_0x416061(++_0x12d4d1);}(_0x2642,0x15b));var _0x2264=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2642[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x2264('0x0'));module[_0x2264('0x1')]={'closed':{'type':Sequelize[_0x2264('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2264('0x3')]},'disposition':{'type':Sequelize[_0x2264('0x4')]},'secondDisposition':{'type':Sequelize[_0x2264('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2264('0x4')]},'note':{'type':Sequelize[_0x2264('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x2264('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x2264('0x5')]('in',_0x2264('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2264('0x5')]('in',_0x2264('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 2b889f4..5cabbc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3969=['where','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','isEmpty','resolve','user','role','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','agent','sequelize','toString','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','all','rows','show','params','includeAll','include','merge','options','create','describe','addMessage','FaxMessage','omit','ids','getMessages','findOne','hasOwnProperty','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','findAll','faxInteractionTags:save','removeTags','download','unix','join','root','server','tmp','attachments','transcript-%d-%s.zip','Messages','get','mkdirSync','Attachment','basename','createWriteStream','unlinkSync','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','talking','unmanaged','total','UserId','closed','answered','FaxInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','users','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','o.id\x20=\x20i.UserId','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','body','compact','FaxAccountId'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0x3969,0x13e));var _0x9396=function(_0x2824c1,_0x1213ef){_0x2824c1=_0x2824c1-0x0;var _0x1079a7=_0x3969[_0x2824c1];return _0x1079a7;};'use strict';var emlformat=require(_0x9396('0x0'));var rimraf=require(_0x9396('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9396('0x2'));var rp=require('request-promise');var moment=require(_0x9396('0x3'));var BPromise=require(_0x9396('0x4'));var Mustache=require('mustache');var util=require(_0x9396('0x5'));var path=require(_0x9396('0x6'));var sox=require(_0x9396('0x7'));var csv=require('to-csv');var ejs=require(_0x9396('0x8'));var fs=require('fs');var fs_extra=require(_0x9396('0x9'));var _=require(_0x9396('0xa'));var squel=require('squel');var crypto=require(_0x9396('0xb'));var jsforce=require(_0x9396('0xc'));var deskjs=require(_0x9396('0xd'));var toCsv=require(_0x9396('0xe'));var querystring=require(_0x9396('0xf'));var Papa=require(_0x9396('0x10'));var Redis=require(_0x9396('0x11'));var authService=require(_0x9396('0x12'));var qs=require(_0x9396('0x13'));var as=require(_0x9396('0x14'));var hardwareService=require(_0x9396('0x15'));var logger=require(_0x9396('0x16'))(_0x9396('0x17'));var utils=require('../../config/utils');var config=require(_0x9396('0x18'));var licenseUtil=require(_0x9396('0x19'));var db=require(_0x9396('0x1a'))['db'];config[_0x9396('0x1b')]=_['defaults'](config[_0x9396('0x1b')],{'host':_0x9396('0x1c'),'port':0x18eb});var socket=require(_0x9396('0x1d'))(new Redis(config[_0x9396('0x1b')]));require(_0x9396('0x1e'))[_0x9396('0x1f')](socket);function respondWithStatusCode(_0xcd02a5,_0x9126ca){_0x9126ca=_0x9126ca||0xcc;return function(_0x4c076e){if(_0x4c076e){return _0xcd02a5[_0x9396('0x20')](_0x9126ca);}return _0xcd02a5[_0x9396('0x21')](_0x9126ca)[_0x9396('0x22')]();};}function respondWithResult(_0x5a2c41,_0x154614){_0x154614=_0x154614||0xc8;return function(_0xf9d9b7){if(_0xf9d9b7){return _0x5a2c41[_0x9396('0x21')](_0x154614)[_0x9396('0x23')](_0xf9d9b7);}};}function respondWithFilteredResult(_0x61c470,_0x49beac){return function(_0x198bc4){if(_0x198bc4){var _0x430122=typeof _0x49beac[_0x9396('0x24')]===_0x9396('0x25')&&typeof _0x49beac[_0x9396('0x26')]==='undefined';var _0x4870cb=_0x198bc4[_0x9396('0x27')];var _0x1d88a8=_0x430122?0x0:_0x49beac[_0x9396('0x24')];var _0x3bbfc8=_0x430122?_0x198bc4[_0x9396('0x27')]:_0x49beac[_0x9396('0x24')]+_0x49beac[_0x9396('0x26')];var _0x3ffd58;if(_0x3bbfc8>=_0x4870cb){_0x3bbfc8=_0x4870cb;_0x3ffd58=0xc8;}else{_0x3ffd58=0xce;}_0x61c470[_0x9396('0x21')](_0x3ffd58);return _0x61c470[_0x9396('0x28')](_0x9396('0x29'),_0x1d88a8+'-'+_0x3bbfc8+'/'+_0x4870cb)[_0x9396('0x23')](_0x198bc4);}return null;};}function patchUpdates(_0x4bc85f){return function(_0x4b82e8){try{jsonpatch['apply'](_0x4b82e8,_0x4bc85f,!![]);}catch(_0x40e672){return BPromise[_0x9396('0x2a')](_0x40e672);}return _0x4b82e8[_0x9396('0x2b')]();};}function saveUpdates(_0x7907ba,_0x5e9d70){return function(_0x354518){if(_0x354518){return _0x354518[_0x9396('0x2c')](_0x7907ba)[_0x9396('0x2d')](function(_0x4aeab2){return _0x4aeab2;});}return null;};}function removeEntity(_0x55208c,_0x25ff9e){return function(_0x8be34e){if(_0x8be34e){return _0x8be34e[_0x9396('0x2e')]()[_0x9396('0x2d')](function(){_0x55208c[_0x9396('0x21')](0xcc)[_0x9396('0x22')]();});}};}function handleEntityNotFound(_0x102505,_0x16a439){return function(_0x5a0f56){if(!_0x5a0f56){_0x102505[_0x9396('0x20')](0x194);}return _0x5a0f56;};}function handleError(_0x1e2c45,_0x1f5aef){_0x1f5aef=_0x1f5aef||0x1f4;return function(_0x5600fb){logger[_0x9396('0x2f')](_0x5600fb['stack']);if(_0x5600fb[_0x9396('0x30')]){delete _0x5600fb[_0x9396('0x30')];}_0x1e2c45['status'](_0x1f5aef)[_0x9396('0x31')](_0x5600fb);};}function getInteractionUsers(_0x1fb32f,_0x5c2617){return new BPromise(function(_0x406b38,_0x9f8216){try{if(_0x5c2617[_0x1fb32f['id']]){_0x1fb32f[_0x9396('0x32')]=_[_0x9396('0x33')](_0x5c2617[_0x1fb32f['id']],function(_0xe98b4){return{'id':_0xe98b4['id'],'fullname':_0xe98b4[_0x9396('0x34')]};});}}catch(_0x1e5cb9){_0x9f8216(_0x1e5cb9);}_0x406b38(_0x1fb32f);});}function getInteractionTags(_0x4c0ac3,_0x867b1e){return new BPromise(function(_0x3caa46,_0x5f1f40){try{if(_0x4c0ac3[_0x9396('0x35')]){_0x4c0ac3[_0x9396('0x36')]=[];_0x4c0ac3[_0x9396('0x35')][_0x9396('0x37')](',')[_0x9396('0x38')](function(_0x39b354){_0x4c0ac3[_0x9396('0x36')][_0x9396('0x39')](_0x867b1e[_0x39b354]);});}delete _0x4c0ac3[_0x9396('0x35')];}catch(_0x58caf1){_0x5f1f40(_0x58caf1);}_0x3caa46(_0x4c0ac3);});}function updateFaxInteraction(_0x321918,_0xa3de43,_0x792177){return new BPromise(function(_0x390427,_0xd3e84f){return getInteractionUsers(_0x321918,_0x792177)[_0x9396('0x2d')](function(_0x299340){return getInteractionTags(_0x299340,_0xa3de43);})[_0x9396('0x2d')](function(_0x877c59){return getStateInteraction(_0x877c59);})['then'](function(_0x1520af){_0x390427(_0x1520af);})[_0x9396('0x3a')](function(_0x5746e7){_0xd3e84f(_0x5746e7);});});}function getStateInteraction(_0x188167){return new BPromise(function(_0x1a4c7e){_0x188167[_0x9396('0x3b')]=0x0;_0x188167[_0x9396('0x3c')]=0x0;_0x188167['answered']=0x0;_0x188167[_0x9396('0x3d')]=0x0;_0x188167[_0x9396('0x3e')]=0x0;if(!_0x188167['closed']&&!_0x188167[_0x9396('0x3f')]){_0x188167[_0x9396('0x3b')]+=0x1;}if(!_0x188167[_0x9396('0x40')]&&_0x188167['UserId']){_0x188167[_0x9396('0x3c')]+=0x1;if(_0x188167[_0x9396('0x3b')]){_0x188167[_0x9396('0x3b')]-=0x1;}}if(_0x188167[_0x9396('0x40')]&&_0x188167[_0x9396('0x3f')]){_0x188167[_0x9396('0x41')]+=0x1;if(_0x188167['talking']){_0x188167[_0x9396('0x3c')]-=0x1;}}if(_0x188167[_0x9396('0x40')]&&!_0x188167['UserId']){_0x188167[_0x9396('0x3d')]+=0x1;if(_0x188167[_0x9396('0x3b')]){_0x188167['waiting']-=0x1;}}_0x188167['total']+=0x1;_0x1a4c7e(_0x188167);});}exports['index']=function(_0x33f178,_0x5a8c16){var _0x114e2f={},_0x36db65={},_0x375574={'count':0x0,'rows':[]};var _0x2e3435=_[_0x9396('0x33')](db[_0x9396('0x42')][_0x9396('0x43')],function(_0xba4588){return{'name':_0xba4588[_0x9396('0x44')],'type':_0xba4588[_0x9396('0x45')][_0x9396('0x46')]};});_0x36db65['model']=_['map'](_0x2e3435,'name');_0x36db65[_0x9396('0x47')]=_[_0x9396('0x48')](_0x33f178[_0x9396('0x47')]);_0x36db65[_0x9396('0x49')]=_[_0x9396('0x4a')](_0x36db65[_0x9396('0x4b')],_0x36db65[_0x9396('0x47')]);_0x114e2f['attributes']=_[_0x9396('0x4a')](_0x36db65[_0x9396('0x4b')],qs[_0x9396('0x4c')](_0x33f178[_0x9396('0x47')][_0x9396('0x4c')]));_0x114e2f['attributes']=_0x114e2f[_0x9396('0x4d')][_0x9396('0x4e')]?_0x114e2f['attributes']:_0x36db65['model'];if(!_0x33f178[_0x9396('0x47')]['hasOwnProperty'](_0x9396('0x4f'))){_0x114e2f[_0x9396('0x26')]=qs[_0x9396('0x26')](_0x33f178[_0x9396('0x47')][_0x9396('0x26')]);_0x114e2f[_0x9396('0x24')]=qs[_0x9396('0x24')](_0x33f178[_0x9396('0x47')][_0x9396('0x24')]);}_0x114e2f[_0x9396('0x50')]=qs[_0x9396('0x51')](_0x33f178[_0x9396('0x47')][_0x9396('0x51')]);_0x114e2f['where']=qs[_0x9396('0x49')](_[_0x9396('0x52')](_0x33f178[_0x9396('0x47')],_0x36db65[_0x9396('0x49')]),_0x2e3435);var _0x4b1e40=[];var _0x58aaa1=squel[_0x9396('0x53')]()[_0x9396('0x54')]('id')[_0x9396('0x54')](_0x9396('0x30'))['field'](_0x9396('0x55'))[_0x9396('0x56')](_0x9396('0x57'));var _0x4b2b55=squel['select']()[_0x9396('0x54')](_0x9396('0x58'))[_0x9396('0x54')](_0x9396('0x59'))['field'](_0x9396('0x5a'))[_0x9396('0x56')](_0x9396('0x5b'),'ui')['left_join'](_0x9396('0x5c'),'u','u.id\x20=\x20ui.UserId');var _0x334b13=squel[_0x9396('0x53')]()[_0x9396('0x56')](_0x9396('0x5d'),'i')['left_join'](_0x9396('0x5e'),'c',_0x9396('0x5f'))[_0x9396('0x60')](_0x9396('0x5c'),'o',_0x9396('0x61'))[_0x9396('0x60')](_0x9396('0x62'),'a','a.id\x20=\x20i.FaxAccountId')[_0x9396('0x60')](_0x9396('0x63'),'me',_0x9396('0x64'))[_0x9396('0x60')](_0x9396('0x65'),'it',_0x9396('0x66'))[_0x9396('0x60')](_0x9396('0x57'),'t','t.id\x20=\x20it.TagId');var _0x385c30=squel[_0x9396('0x67')]();var _0xaf7ccb=[];var _0x510ae0=squel[_0x9396('0x67')]();var _0x479ff1;if(_0x33f178[_0x9396('0x47')][_0x9396('0x68')]){_0x479ff1=as[_0x9396('0x69')](_0x33f178['query']['search']);var _0x5213e5=_0x479ff1[_0x9396('0x6a')];for(var _0x107236=0x0;_0x107236<_0x479ff1['conditions'][_0x9396('0x4e')];_0x107236++){var _0x44638f=_0x479ff1[_0x9396('0x6b')][_0x107236];var _0x4d35ee='i';var _0x17f638=_[_0x9396('0x6c')](_0x2e3435,['name',_0x44638f[_0x9396('0x54')]]);if(!_0x17f638){switch(_0x44638f['field']){case _0x9396('0x6d'):if(_0x44638f[_0x9396('0x6e')]==0x1){_0x334b13['having']('`'+_0x44638f['field']+'`\x20=\x200');}else{_0x334b13[_0x9396('0x6f')]('`'+_0x44638f[_0x9396('0x54')]+_0x9396('0x70'));}break;case'Contact':if(_0x44638f[_0x9396('0x71')]===_0x9396('0x72')){if(_0x44638f[_0x9396('0x6e')]['split']('\x20')[_0x9396('0x4e')]>0x1){_0x385c30[_0x5213e5](_0x9396('0x73'),qs[_0x9396('0x74')](_0x44638f[_0x9396('0x6e')]),null);}else{var _0x44d260='%'+_0x44638f[_0x9396('0x6e')]+'%';_0x385c30[_0x5213e5](_0x9396('0x75'),_0x44d260,_0x44d260,_0x44d260);}}else{_0x17f638=_['find'](_0x2e3435,[_0x9396('0x30'),_0x9396('0x76')]);_0x44638f[_0x9396('0x54')]=_0x9396('0x76');_0x1118fa=as['buildExpression'](_0x4d35ee,_0x17f638[_0x9396('0x45')],_0x44638f);_0x385c30[_0x5213e5](_0x1118fa[_0x9396('0x77')],_0x1118fa[_0x9396('0x6e')][_0x9396('0x78')],_0x1118fa[_0x9396('0x6e')][_0x9396('0x22')]);}break;case _0x9396('0x79'):var _0x2ecf86=_0x44638f['value'][_0x9396('0x37')](',')[_0x9396('0x33')](function(_0x3ecafb){return Number(_0x3ecafb);});_0x2ecf86[_0x9396('0x38')](function(_0x3723d9){_0x510ae0['or'](_0x9396('0x7a'),'%,'+_0x3723d9+',%');});_0xaf7ccb=_[_0x9396('0x7b')](_0xaf7ccb,_0x2ecf86);break;case _0x9396('0x7c'):if(_0x44638f['operator']===_0x9396('0x72')){_0x385c30[_0x5213e5](_0x9396('0x7d'),'%'+_0x44638f[_0x9396('0x6e')]+'%',null);}else{_0x17f638=_[_0x9396('0x6c')](_0x2e3435,['name','UserId']);_0x44638f['field']=_0x9396('0x3f');_0x1118fa=as[_0x9396('0x7e')](_0x4d35ee,_0x17f638[_0x9396('0x45')],_0x44638f);_0x385c30[_0x5213e5](_0x1118fa[_0x9396('0x77')],_0x1118fa[_0x9396('0x6e')]['start'],_0x1118fa['value'][_0x9396('0x22')]);}break;case _0x9396('0x7f'):_0x1118fa=as['buildExpression']('me',null,_0x44638f);_0x385c30[_0x5213e5](_0x1118fa[_0x9396('0x77')],_0x1118fa['value'][_0x9396('0x78')],_0x1118fa[_0x9396('0x6e')][_0x9396('0x22')]);break;}}else{var _0x1118fa=as[_0x9396('0x7e')](_0x4d35ee,_0x17f638[_0x9396('0x45')],_0x44638f);_0x385c30[_0x5213e5](_0x1118fa[_0x9396('0x77')],_0x1118fa[_0x9396('0x6e')][_0x9396('0x78')],_0x1118fa[_0x9396('0x6e')][_0x9396('0x22')]);}}}else{var _0x1b175a=_(_0x33f178[_0x9396('0x47')])['keys']()[_0x9396('0x33')](function(_0x5ba724){return _['some'](_0x2e3435,['name',_0x5ba724])?_0x5ba724:undefined;})[_0x9396('0x80')]()['value']();if(!_['isEmpty'](_0x1b175a)){_0x1b175a[_0x9396('0x38')](function(_0x444e53){if(_0x444e53===_0x9396('0x81')){_0x334b13[_0x9396('0x82')](_0x9396('0x83'),[][_0x9396('0x84')](_0x33f178[_0x9396('0x47')][_0x444e53]));}else if(_0x444e53===_0x9396('0x85')){var _0xc024d4=JSON[_0x9396('0x86')](_0x33f178['query'][_0x444e53])['$gte'];var _0x31dc88=JSON[_0x9396('0x86')](_0x33f178['query'][_0x444e53])[_0x9396('0x87')];_0x334b13['where'](_0x9396('0x88'),_0xc024d4,_0x31dc88);}else{if(_0x33f178[_0x9396('0x47')][_0x444e53]===_0x9396('0x89')){_0x334b13[_0x9396('0x82')]('i.'+_0x444e53+'\x20IS\x20NULL');}else{_0x334b13[_0x9396('0x82')]('i.'+_0x444e53+_0x9396('0x8a'),_0x33f178[_0x9396('0x47')][_0x444e53]);}}});}if(_0x33f178[_0x9396('0x47')][_0x9396('0x8b')]){if(_0x33f178[_0x9396('0x47')]['read']==0x1){_0x334b13[_0x9396('0x6f')](_0x9396('0x8c'));}else{_0x334b13['having'](_0x9396('0x8d'));}}if(_0x33f178['query'][_0x9396('0x8e')]){_0xaf7ccb=_['isArray'](_0x33f178[_0x9396('0x47')][_0x9396('0x8e')])?_0x33f178[_0x9396('0x47')][_0x9396('0x8e')]:new Array(_0x33f178[_0x9396('0x47')]['tag']);_0xaf7ccb['forEach'](function(_0x5ac2da){_0x510ae0['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5ac2da+',%');});}if(_0x33f178[_0x9396('0x47')]['filter']){var _0x57312f=_0x33f178[_0x9396('0x47')][_0x9396('0x8f')]['replace']('\x5c','\x5c\x5c')[_0x9396('0x90')](/'/g,'\x27\x27');if(qs[_0x9396('0x91')](_0x57312f)){_0x385c30['or'](_0x9396('0x92'),_0x57312f+'%')['or']('i.fax\x20LIKE\x20?',_0x57312f+'%');}_0x385c30['or'](_0x9396('0x93'),_0x57312f+'%');}}_0x334b13[_0x9396('0x82')](_0x385c30);_0x334b13[_0x9396('0x94')]('i.id');var _0x351e06={'type':db['Sequelize'][_0x9396('0x95')]['SELECT'],'raw':!![]};var _0x1baf12=_0x334b13[_0x9396('0x96')]();_0x1baf12[_0x9396('0x54')](_0x9396('0x97'));_0x1baf12[_0x9396('0x54')](_0x9396('0x98'),'unreadMessages');if(_0x114e2f['order']){_0x114e2f[_0x9396('0x50')][_0x9396('0x38')](function(_0x5b7ad6){var _0x46bf2e=_0x5b7ad6[0x0]===_0x9396('0x99')?_0x5b7ad6[0x0]:'i.'+_0x5b7ad6[0x0];_0x334b13[_0x9396('0x50')](_0x46bf2e,_0x5b7ad6[0x1]==='DESC'?![]:!![]);});}if(!_[_0x9396('0x9a')](_0xaf7ccb)){_0x334b13[_0x9396('0x6f')](_0x510ae0);_0x1baf12[_0x9396('0x82')]('t.id\x20IN\x20?',_0xaf7ccb);}BPromise[_0x9396('0x9b')]()[_0x9396('0x2d')](function(){if(!_0x479ff1){if(_0x33f178[_0x9396('0x47')][_0x9396('0x81')])return;_0x1baf12[_0x9396('0x82')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x334b13['where']('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x33f178[_0x9396('0x9c')][_0x9396('0x9d')]!=='agent')return;return _0x33f178['user'][_0x9396('0x9e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x86bb1f){if(_[_0x9396('0x9a')](_0x86bb1f)){_0x1baf12[_0x9396('0x82')](_0x9396('0x9f'));_0x334b13['where'](_0x9396('0x9f'));}else{_0x1baf12[_0x9396('0x82')](_0x9396('0x83'),_['map'](_0x86bb1f,'id'));_0x334b13[_0x9396('0x82')]('i.FaxAccountId\x20IN\x20?',_[_0x9396('0x33')](_0x86bb1f,'id'));}});})[_0x9396('0x2d')](function(){if(_0x33f178[_0x9396('0x9c')][_0x9396('0x9d')]===_0x9396('0xa0')&&!_0x479ff1&&!_0x33f178[_0x9396('0x47')][_0x9396('0x81')])return[];return db[_0x9396('0xa1')][_0x9396('0x47')](_0x1baf12[_0x9396('0xa2')](),_0x351e06);})[_0x9396('0x2d')](function(_0x42ccf8){_0x375574[_0x9396('0x27')]=_0x42ccf8['length'];if(_0x375574[_0x9396('0x27')]===0x0)return[];return db[_0x9396('0xa1')][_0x9396('0x47')](_0x58aaa1[_0x9396('0xa2')](),_0x351e06)['then'](function(_0x462e27){_0x4b1e40=_['keyBy'](_0x462e27,'id');_0x351e06=_['merge'](_0x351e06,{'model':db[_0x9396('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x33f178['query'][_0x9396('0x4c')]){_0x114e2f[_0x9396('0x4d')]['forEach'](function(_0x1747ed){_0x334b13['field']('i.'+_0x1747ed);});}else{_0x334b13[_0x9396('0x54')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9396('0x6d'));_0x334b13[_0x9396('0x54')](_0x9396('0xa3'),_0x9396('0xa4'));_0x334b13[_0x9396('0x54')](_0x9396('0xa5'),'Account.mandatoryDisposition');_0x334b13[_0x9396('0x54')](_0x9396('0xa6'),_0x9396('0x99'));_0x334b13[_0x9396('0x54')](_0x9396('0xa7'));_0x334b13[_0x9396('0x54')](_0x9396('0xa8'),_0x9396('0xa9'));_0x334b13[_0x9396('0x54')](_0x9396('0xaa'),_0x9396('0xab'));_0x334b13['field'](_0x9396('0xac'),_0x9396('0xad'));_0x334b13['field']('c.phone','Contact.phone');_0x334b13[_0x9396('0x54')](_0x9396('0xae'),_0x9396('0xaf'));_0x334b13[_0x9396('0x54')](_0x9396('0xb0'),_0x9396('0xb1'));_0x334b13[_0x9396('0x54')](_0x9396('0xb2'),_0x9396('0xb3'));_0x334b13['field'](_0x9396('0xb4'),'Owner.internal');_0x334b13['field'](_0x9396('0xb5'),_0x9396('0x35'));}if(_0x114e2f[_0x9396('0x26')])_0x334b13[_0x9396('0x26')](_0x114e2f[_0x9396('0x26')]);if(_0x114e2f['offset'])_0x334b13[_0x9396('0x24')](_0x114e2f[_0x9396('0x24')]);return db['sequelize']['query'](_0x334b13[_0x9396('0xa2')](),_0x351e06);})[_0x9396('0x2d')](function(_0xd50da8){if(_0xd50da8[_0x9396('0x4e')]>0x0)_0x4b2b55[_0x9396('0x82')](_0x9396('0xb6'),_[_0x9396('0x33')](_0xd50da8,'id'));return db[_0x9396('0xa1')][_0x9396('0x47')](_0x4b2b55['toString'](),_0x351e06)[_0x9396('0x2d')](function(_0x4c9a37){var _0x1d2151=_['groupBy'](_0x4c9a37,'FaxInteractionId');var _0x2d9734=[];_0xd50da8[_0x9396('0x38')](function(_0x1104e4){_0x2d9734[_0x9396('0x39')](updateFaxInteraction(_0x1104e4,_0x4b1e40,_0x1d2151));});return BPromise[_0x9396('0xb7')](_0x2d9734);});});})[_0x9396('0x2d')](function(_0x350807){_0x375574[_0x9396('0xb8')]=_0x350807;return _0x375574;})[_0x9396('0x2d')](respondWithFilteredResult(_0x5a8c16,_0x114e2f))[_0x9396('0x3a')](handleError(_0x5a8c16,null));};exports[_0x9396('0xb9')]=function(_0x2bf93a,_0x4aeb7d){var _0x1c284c={'raw':![],'where':{'id':_0x2bf93a[_0x9396('0xba')]['id']}},_0x4cafc8={};_0x4cafc8[_0x9396('0x4b')]=_[_0x9396('0x48')](db['FaxInteraction'][_0x9396('0x43')]);_0x4cafc8[_0x9396('0x47')]=_[_0x9396('0x48')](_0x2bf93a[_0x9396('0x47')]);_0x4cafc8[_0x9396('0x49')]=_[_0x9396('0x4a')](_0x4cafc8[_0x9396('0x4b')],_0x4cafc8['query']);_0x1c284c['attributes']=_['intersection'](_0x4cafc8[_0x9396('0x4b')],qs[_0x9396('0x4c')](_0x2bf93a[_0x9396('0x47')][_0x9396('0x4c')]));_0x1c284c[_0x9396('0x4d')]=_0x1c284c[_0x9396('0x4d')]['length']?_0x1c284c[_0x9396('0x4d')]:_0x4cafc8[_0x9396('0x4b')];if(_0x2bf93a[_0x9396('0x47')][_0x9396('0xbb')]){_0x1c284c[_0x9396('0xbc')]=[{'all':!![]}];}_0x1c284c=_[_0x9396('0xbd')]({},_0x1c284c,_0x2bf93a[_0x9396('0xbe')]);return db[_0x9396('0x42')][_0x9396('0x6c')](_0x1c284c)[_0x9396('0x2d')](handleEntityNotFound(_0x4aeb7d,null))[_0x9396('0x2d')](respondWithResult(_0x4aeb7d,null))[_0x9396('0x3a')](handleError(_0x4aeb7d,null));};exports[_0x9396('0xbf')]=function(_0xd8ec4e,_0x138187){return db[_0x9396('0x42')][_0x9396('0xbf')](_0xd8ec4e['body'],{})[_0x9396('0x2d')](respondWithResult(_0x138187,0xc9))[_0x9396('0x3a')](handleError(_0x138187,null));};exports['update']=function(_0x1305d0,_0xf22999){if(_0x1305d0[_0x9396('0x7f')]['id']){delete _0x1305d0[_0x9396('0x7f')]['id'];}return db[_0x9396('0x42')][_0x9396('0x6c')]({'where':{'id':_0x1305d0[_0x9396('0xba')]['id']}})[_0x9396('0x2d')](handleEntityNotFound(_0xf22999,null))[_0x9396('0x2d')](saveUpdates(_0x1305d0[_0x9396('0x7f')],null))[_0x9396('0x2d')](respondWithResult(_0xf22999,null))[_0x9396('0x3a')](handleError(_0xf22999,null));};exports[_0x9396('0x2e')]=function(_0x4ff7da,_0xd91371){return db['FaxInteraction'][_0x9396('0x6c')]({'where':{'id':_0x4ff7da[_0x9396('0xba')]['id']}})[_0x9396('0x2d')](handleEntityNotFound(_0xd91371,null))['then'](removeEntity(_0xd91371,null))[_0x9396('0x3a')](handleError(_0xd91371,null));};exports[_0x9396('0xc0')]=function(_0xcb9ca6,_0x22f318){return db['FaxInteraction']['describe']()[_0x9396('0x2d')](respondWithResult(_0x22f318,null))[_0x9396('0x3a')](handleError(_0x22f318,null));};exports[_0x9396('0xc1')]=function(_0x3fcb09,_0x32c704,_0x54bda9){return db[_0x9396('0xc2')][_0x9396('0x6c')]({'where':{'id':_0x3fcb09[_0x9396('0xba')]['id']}})[_0x9396('0x2d')](handleEntityNotFound(_0x32c704,null))[_0x9396('0x2d')](function(_0x3d30c){if(_0x3d30c){return _0x3d30c[_0x9396('0xc1')](_0x3fcb09['body']['ids'],_[_0x9396('0xc3')](_0x3fcb09['body'],[_0x9396('0xc4'),'id'])||{});}})['then'](respondWithResult(_0x32c704,null))[_0x9396('0x3a')](handleError(_0x32c704,null));};exports[_0x9396('0xc5')]=function(_0x5455d8,_0x46e168,_0x56cf61){var _0x175a6c={'raw':![],'where':{}};var _0xad65d4={};var _0x12d1ff={'count':0x0,'rows':[]};return db[_0x9396('0x42')][_0x9396('0xc6')]({'where':{'id':_0x5455d8[_0x9396('0xba')]['id']}})['then'](handleEntityNotFound(_0x46e168,null))[_0x9396('0x2d')](function(_0x2ff04f){if(_0x2ff04f){_0xad65d4[_0x9396('0x4b')]=_[_0x9396('0x48')](db[_0x9396('0xc2')][_0x9396('0x43')]);_0xad65d4[_0x9396('0x47')]=_[_0x9396('0x48')](_0x5455d8['query']);_0xad65d4[_0x9396('0x49')]=_[_0x9396('0x4a')](_0xad65d4[_0x9396('0x4b')],_0xad65d4[_0x9396('0x47')]);_0x175a6c['attributes']=_[_0x9396('0x4a')](_0xad65d4[_0x9396('0x4b')],qs[_0x9396('0x4c')](_0x5455d8[_0x9396('0x47')]['fields']));_0x175a6c[_0x9396('0x4d')]=_0x175a6c[_0x9396('0x4d')][_0x9396('0x4e')]?_0x175a6c[_0x9396('0x4d')]:_0xad65d4[_0x9396('0x4b')];if(!_0x5455d8[_0x9396('0x47')][_0x9396('0xc7')](_0x9396('0x4f'))){_0x175a6c[_0x9396('0x26')]=qs[_0x9396('0x26')](_0x5455d8[_0x9396('0x47')][_0x9396('0x26')]);_0x175a6c[_0x9396('0x24')]=qs[_0x9396('0x24')](_0x5455d8[_0x9396('0x47')][_0x9396('0x24')]);}_0x175a6c['order']=qs[_0x9396('0x51')](_0x5455d8[_0x9396('0x47')][_0x9396('0x51')]);_0x175a6c[_0x9396('0x82')]=qs[_0x9396('0x49')](_[_0x9396('0x52')](_0x5455d8[_0x9396('0x47')],_0xad65d4[_0x9396('0x49')]));_0x175a6c[_0x9396('0x82')]['FaxInteractionId']=_0x2ff04f['id'];if(_0x5455d8[_0x9396('0x47')]['filter']){_0x175a6c['where']=_['merge'](_0x175a6c[_0x9396('0x82')],{'$or':_['map'](_0x175a6c[_0x9396('0x4d')],function(_0x2ff79d){var _0x4aa776={};_0x4aa776[_0x2ff79d]={'$like':'%'+_0x5455d8[_0x9396('0x47')][_0x9396('0x8f')]+'%'};return _0x4aa776;})});}if(_0x5455d8[_0x9396('0x47')]['$gte']){var _0x350101=_0x5455d8[_0x9396('0x47')][_0x9396('0xc8')][_0x9396('0x37')](',');var _0x581ac5={};_0x581ac5[_0x350101[0x0]]={'$gte':moment(_0x350101[0x1])[_0x9396('0xc9')](_0x9396('0xca'))};_0x175a6c['where']=_[_0x9396('0xbd')](_0x175a6c[_0x9396('0x82')],_0x581ac5);}_0x175a6c=_[_0x9396('0xbd')]({},_0x175a6c,_0x5455d8[_0x9396('0xbe')]);return db[_0x9396('0xc2')]['count']({'where':_0x175a6c[_0x9396('0x82')]})[_0x9396('0x2d')](function(_0x47ec94){_0x12d1ff['count']=_0x47ec94;if(_0x5455d8[_0x9396('0x47')][_0x9396('0xbb')]){_0x175a6c[_0x9396('0xbc')]=[{'all':!![]}];}return db[_0x9396('0xc2')]['findAll'](_0x175a6c);})[_0x9396('0x2d')](function(_0xed8c46){_0x12d1ff[_0x9396('0xb8')]=_0xed8c46;return _0x12d1ff;});}})[_0x9396('0x2d')](respondWithFilteredResult(_0x46e168,_0x175a6c))[_0x9396('0x3a')](handleError(_0x46e168,null));};exports[_0x9396('0xcb')]=function(_0x21d772,_0x4a7759,_0x4951e8){return db[_0x9396('0x42')][_0x9396('0x6c')]({'where':{'id':_0x21d772[_0x9396('0xba')]['id']}})['then'](handleEntityNotFound(_0x4a7759,null))[_0x9396('0x2d')](function(_0x276a7d){if(_0x276a7d){return _0x276a7d[_0x9396('0xcc')](_0x21d772[_0x9396('0x7f')]['ids'],_['omit'](_0x21d772[_0x9396('0x7f')],['ids','id'])||{})[_0x9396('0xcd')](function(){return db['Tag'][_0x9396('0xce')]({'attributes':['id',_0x9396('0x30'),_0x9396('0x55')],'where':{'id':_0x21d772['body'][_0x9396('0xc4')]}});})[_0x9396('0x2d')](function(_0x4df6ea){socket['emit'](_0x9396('0xcf'),{'id':Number(_0x21d772[_0x9396('0xba')]['id']),'tags':_0x4df6ea||[]});return{'id':Number(_0x21d772[_0x9396('0xba')]['id']),'tags':_0x4df6ea||[]};});}})[_0x9396('0x2d')](respondWithResult(_0x4a7759,null))[_0x9396('0x3a')](handleError(_0x4a7759,null));};exports[_0x9396('0xd0')]=function(_0x599e62,_0x2a3e8a,_0xb42601){return db[_0x9396('0x42')]['find']({'where':{'id':_0x599e62[_0x9396('0xba')]['id']}})[_0x9396('0x2d')](handleEntityNotFound(_0x2a3e8a,null))[_0x9396('0x2d')](function(_0x245f2c){if(_0x245f2c){return _0x245f2c[_0x9396('0xd0')](_0x599e62[_0x9396('0x47')][_0x9396('0xc4')]);}})[_0x9396('0x2d')](respondWithStatusCode(_0x2a3e8a,null))[_0x9396('0x3a')](handleError(_0x2a3e8a,null));};exports[_0x9396('0xd1')]=function(_0x2f375f,_0x34fcc7){var _0x4e3271=moment()[_0x9396('0xd2')]()['toString']();var _0x169e0a=path[_0x9396('0xd3')](config[_0x9396('0xd4')],_0x9396('0xd5'),'files',_0x9396('0xd6'));var _0x4aa5e1=path[_0x9396('0xd3')](config['root'],_0x9396('0xd5'),'files',_0x9396('0xd7'));var _0x4566f4=path[_0x9396('0xd3')](_0x169e0a,_0x4e3271);var _0x2e34dd=util[_0x9396('0xc9')](_0x9396('0xd8'),_0x2f375f[_0x9396('0xba')]['id'],_0x4e3271);var _0x5becb4=path['join'](_0x169e0a,_0x2e34dd);var _0x1f9cd9=[];_0x1f9cd9[_0x9396('0x39')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});var _0x1fe879=[{'model':db[_0x9396('0xc2')],'as':_0x9396('0xd9'),'attributes':['id',_0x9396('0x7f'),_0x9396('0x85')],'include':_0x1f9cd9}];return db[_0x9396('0x42')][_0x9396('0x6c')]({'where':{'id':_0x2f375f[_0x9396('0xba')]['id']},'include':_0x1fe879})['then'](handleEntityNotFound(_0x34fcc7,null))[_0x9396('0x2d')](function(_0xe2e0ab){if(_0xe2e0ab&&_0xe2e0ab['Messages']){var _0x211ac2=_0xe2e0ab[_0x9396('0xda')]({'plain':!![]});fs[_0x9396('0xdb')](_0x4566f4);for(var _0x2e1e42=0x0;_0x2e1e42<_0x211ac2[_0x9396('0xd9')]['length'];_0x2e1e42++){var _0x315e7e=_0x211ac2['Messages'][_0x2e1e42][_0x9396('0xdc')];if(_0x315e7e){var _0x8669a7=path[_0x9396('0xd3')](_0x4aa5e1,_0x315e7e[_0x9396('0xdd')]);if(fs['existsSync'](_0x8669a7)){fs['createReadStream'](_0x8669a7)['pipe'](fs[_0x9396('0xde')](path[_0x9396('0xd3')](_0x4566f4,_0x315e7e[_0x9396('0xdd')])));}}}return BPromise[_0x9396('0x9b')]()[_0x9396('0x2d')](function(){return new BPromise(function(_0x5178bf,_0x8d5230){zipdir(_0x4566f4,{'saveTo':_0x5becb4},function(_0xb3e57e,_0x370e1a){if(_0xb3e57e)return _0x8d5230(_0xb3e57e);return _0x5178bf(_0x370e1a);});})[_0x9396('0x2d')](function(){return new BPromise(function(_0xee5e1a,_0x45f691){rimraf(_0x4566f4,function(_0x5b87be){if(_0x5b87be)_0x45f691(_0x5b87be);return _0xee5e1a();});});})[_0x9396('0x2d')](function(){return _0x34fcc7[_0x9396('0xd1')](_0x5becb4,_0x2e34dd,function(_0x46b6a2){if(_0x46b6a2){console['log']('err',_0x46b6a2);}else{fs[_0x9396('0xdf')](_0x5becb4);}});});});}else{return _0x34fcc7[_0x9396('0x20')](0xc8);}})[_0x9396('0x3a')](handleError(_0x34fcc7,null));};
\ No newline at end of file
+var _0x9434=['sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','type','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','start','body','keys','some','compact','isEmpty','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','createdAt','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','group','i.id','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','resolve','role','agent','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','rows','show','params','includeAll','options','create','describe','addMessage','FaxMessage','ids','omit','findOne','$gte','format','addTags','setTags','spread','findAll','emit','faxInteractionTags:save','removeTags','download','unix','root','server','tmp','join','files','attachments','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','log','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','Users','map','fullname','Tags','TagIds','split','forEach','push','catch','waiting','talking','answered','unmanaged','total','closed','UserId','FaxInteraction','rawAttributes','fieldName','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search'];(function(_0xa676f4,_0x363eac){var _0x5716d7=function(_0x35f12a){while(--_0x35f12a){_0xa676f4['push'](_0xa676f4['shift']());}};_0x5716d7(++_0x363eac);}(_0x9434,0x7d));var _0x4943=function(_0x478bb8,_0xe2520d){_0x478bb8=_0x478bb8-0x0;var _0x1da9d4=_0x9434[_0x478bb8];return _0x1da9d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4943('0x0'));var zipdir=require(_0x4943('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4943('0x2'));var moment=require(_0x4943('0x3'));var BPromise=require(_0x4943('0x4'));var Mustache=require(_0x4943('0x5'));var util=require(_0x4943('0x6'));var path=require('path');var sox=require(_0x4943('0x7'));var csv=require(_0x4943('0x8'));var ejs=require(_0x4943('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4943('0xa'));var crypto=require(_0x4943('0xb'));var jsforce=require(_0x4943('0xc'));var deskjs=require(_0x4943('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4943('0xe'));var Redis=require('ioredis');var authService=require(_0x4943('0xf'));var qs=require(_0x4943('0x10'));var as=require(_0x4943('0x11'));var hardwareService=require(_0x4943('0x12'));var logger=require(_0x4943('0x13'))('api');var utils=require(_0x4943('0x14'));var config=require(_0x4943('0x15'));var licenseUtil=require(_0x4943('0x16'));var db=require(_0x4943('0x17'))['db'];config['redis']=_[_0x4943('0x18')](config[_0x4943('0x19')],{'host':_0x4943('0x1a'),'port':0x18eb});var socket=require(_0x4943('0x1b'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0x4943('0x1c')](socket);function respondWithStatusCode(_0x4fb2a1,_0x27e9a1){_0x27e9a1=_0x27e9a1||0xcc;return function(_0x13abdd){if(_0x13abdd){return _0x4fb2a1[_0x4943('0x1d')](_0x27e9a1);}return _0x4fb2a1[_0x4943('0x1e')](_0x27e9a1)[_0x4943('0x1f')]();};}function respondWithResult(_0x46b0fe,_0x159237){_0x159237=_0x159237||0xc8;return function(_0x1b9597){if(_0x1b9597){return _0x46b0fe[_0x4943('0x1e')](_0x159237)[_0x4943('0x20')](_0x1b9597);}};}function respondWithFilteredResult(_0x2bba09,_0xc52bb7){return function(_0x10f4e6){if(_0x10f4e6){var _0x239b6b=typeof _0xc52bb7['offset']===_0x4943('0x21')&&typeof _0xc52bb7[_0x4943('0x22')]===_0x4943('0x21');var _0x451493=_0x10f4e6[_0x4943('0x23')];var _0xa3d4a9=_0x239b6b?0x0:_0xc52bb7[_0x4943('0x24')];var _0x53ebc0=_0x239b6b?_0x10f4e6[_0x4943('0x23')]:_0xc52bb7[_0x4943('0x24')]+_0xc52bb7[_0x4943('0x22')];var _0x58877e;if(_0x53ebc0>=_0x451493){_0x53ebc0=_0x451493;_0x58877e=0xc8;}else{_0x58877e=0xce;}_0x2bba09['status'](_0x58877e);return _0x2bba09[_0x4943('0x25')](_0x4943('0x26'),_0xa3d4a9+'-'+_0x53ebc0+'/'+_0x451493)['json'](_0x10f4e6);}return null;};}function patchUpdates(_0x3ed458){return function(_0x24236d){try{jsonpatch['apply'](_0x24236d,_0x3ed458,!![]);}catch(_0x481b3a){return BPromise[_0x4943('0x27')](_0x481b3a);}return _0x24236d[_0x4943('0x28')]();};}function saveUpdates(_0x37c313,_0x3f4fa5){return function(_0x4db9f2){if(_0x4db9f2){return _0x4db9f2[_0x4943('0x29')](_0x37c313)[_0x4943('0x2a')](function(_0x52fc94){return _0x52fc94;});}return null;};}function removeEntity(_0x5e5a18,_0x3fcb64){return function(_0x528dbb){if(_0x528dbb){return _0x528dbb[_0x4943('0x2b')]()['then'](function(){_0x5e5a18['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x528ae7,_0x84fa4c){return function(_0x101d0b){if(!_0x101d0b){_0x528ae7[_0x4943('0x1d')](0x194);}return _0x101d0b;};}function handleError(_0x386d2d,_0x52e915){_0x52e915=_0x52e915||0x1f4;return function(_0x56f527){logger[_0x4943('0x2c')](_0x56f527[_0x4943('0x2d')]);if(_0x56f527[_0x4943('0x2e')]){delete _0x56f527['name'];}_0x386d2d[_0x4943('0x1e')](_0x52e915)[_0x4943('0x2f')](_0x56f527);};}function getInteractionUsers(_0xdd7d7,_0x314dbc){return new BPromise(function(_0x5a9f96,_0x2c3278){try{if(_0x314dbc[_0xdd7d7['id']]){_0xdd7d7[_0x4943('0x30')]=_[_0x4943('0x31')](_0x314dbc[_0xdd7d7['id']],function(_0x839650){return{'id':_0x839650['id'],'fullname':_0x839650[_0x4943('0x32')]};});}}catch(_0x2897bc){_0x2c3278(_0x2897bc);}_0x5a9f96(_0xdd7d7);});}function getInteractionTags(_0x2cfd94,_0x4b5ed2){return new BPromise(function(_0x1d13de,_0x52e9f3){try{if(_0x2cfd94['TagIds']){_0x2cfd94[_0x4943('0x33')]=[];_0x2cfd94[_0x4943('0x34')][_0x4943('0x35')](',')[_0x4943('0x36')](function(_0x551aa2){_0x2cfd94[_0x4943('0x33')][_0x4943('0x37')](_0x4b5ed2[_0x551aa2]);});}delete _0x2cfd94[_0x4943('0x34')];}catch(_0x26a87c){_0x52e9f3(_0x26a87c);}_0x1d13de(_0x2cfd94);});}function updateFaxInteraction(_0x42f503,_0x12dd7c,_0x58cf25){return new BPromise(function(_0x3a9a42,_0x1a7415){return getInteractionUsers(_0x42f503,_0x58cf25)[_0x4943('0x2a')](function(_0x4cdf11){return getInteractionTags(_0x4cdf11,_0x12dd7c);})['then'](function(_0x4c5f7b){return getStateInteraction(_0x4c5f7b);})[_0x4943('0x2a')](function(_0x3d3df3){_0x3a9a42(_0x3d3df3);})[_0x4943('0x38')](function(_0x265475){_0x1a7415(_0x265475);});});}function getStateInteraction(_0xed0d4c){return new BPromise(function(_0x21592f){_0xed0d4c[_0x4943('0x39')]=0x0;_0xed0d4c[_0x4943('0x3a')]=0x0;_0xed0d4c[_0x4943('0x3b')]=0x0;_0xed0d4c[_0x4943('0x3c')]=0x0;_0xed0d4c[_0x4943('0x3d')]=0x0;if(!_0xed0d4c[_0x4943('0x3e')]&&!_0xed0d4c[_0x4943('0x3f')]){_0xed0d4c[_0x4943('0x39')]+=0x1;}if(!_0xed0d4c[_0x4943('0x3e')]&&_0xed0d4c[_0x4943('0x3f')]){_0xed0d4c[_0x4943('0x3a')]+=0x1;if(_0xed0d4c['waiting']){_0xed0d4c[_0x4943('0x39')]-=0x1;}}if(_0xed0d4c[_0x4943('0x3e')]&&_0xed0d4c[_0x4943('0x3f')]){_0xed0d4c[_0x4943('0x3b')]+=0x1;if(_0xed0d4c[_0x4943('0x3a')]){_0xed0d4c[_0x4943('0x3a')]-=0x1;}}if(_0xed0d4c['closed']&&!_0xed0d4c[_0x4943('0x3f')]){_0xed0d4c[_0x4943('0x3c')]+=0x1;if(_0xed0d4c[_0x4943('0x39')]){_0xed0d4c[_0x4943('0x39')]-=0x1;}}_0xed0d4c[_0x4943('0x3d')]+=0x1;_0x21592f(_0xed0d4c);});}exports['index']=function(_0x354447,_0x13dc4f){var _0x51f21e={},_0x349e11={},_0x22df68={'count':0x0,'rows':[]};var _0x5f3e95=_[_0x4943('0x31')](db[_0x4943('0x40')][_0x4943('0x41')],function(_0x203c4c){return{'name':_0x203c4c[_0x4943('0x42')],'type':_0x203c4c['type'][_0x4943('0x43')]};});_0x349e11['model']=_[_0x4943('0x31')](_0x5f3e95,_0x4943('0x2e'));_0x349e11[_0x4943('0x44')]=_['keys'](_0x354447[_0x4943('0x44')]);_0x349e11['filters']=_[_0x4943('0x45')](_0x349e11[_0x4943('0x46')],_0x349e11['query']);_0x51f21e[_0x4943('0x47')]=_[_0x4943('0x45')](_0x349e11[_0x4943('0x46')],qs[_0x4943('0x48')](_0x354447[_0x4943('0x44')]['fields']));_0x51f21e[_0x4943('0x47')]=_0x51f21e[_0x4943('0x47')][_0x4943('0x49')]?_0x51f21e[_0x4943('0x47')]:_0x349e11[_0x4943('0x46')];if(!_0x354447[_0x4943('0x44')][_0x4943('0x4a')](_0x4943('0x4b'))){_0x51f21e[_0x4943('0x22')]=qs[_0x4943('0x22')](_0x354447[_0x4943('0x44')][_0x4943('0x22')]);_0x51f21e[_0x4943('0x24')]=qs[_0x4943('0x24')](_0x354447[_0x4943('0x44')][_0x4943('0x24')]);}_0x51f21e['order']=qs['sort'](_0x354447[_0x4943('0x44')][_0x4943('0x4c')]);_0x51f21e['where']=qs[_0x4943('0x4d')](_[_0x4943('0x4e')](_0x354447[_0x4943('0x44')],_0x349e11[_0x4943('0x4d')]),_0x5f3e95);var _0x490559=[];var _0x434039=squel[_0x4943('0x4f')]()[_0x4943('0x50')]('id')[_0x4943('0x50')](_0x4943('0x2e'))[_0x4943('0x50')](_0x4943('0x51'))[_0x4943('0x52')](_0x4943('0x53'));var _0x44c5eb=squel[_0x4943('0x4f')]()['field'](_0x4943('0x54'))[_0x4943('0x50')](_0x4943('0x55'))['field'](_0x4943('0x56'))[_0x4943('0x52')](_0x4943('0x57'),'ui')[_0x4943('0x58')]('users','u',_0x4943('0x59'));var _0x1dcba6=squel[_0x4943('0x4f')]()[_0x4943('0x52')](_0x4943('0x5a'),'i')[_0x4943('0x58')](_0x4943('0x5b'),'c',_0x4943('0x5c'))[_0x4943('0x58')](_0x4943('0x5d'),'o',_0x4943('0x5e'))[_0x4943('0x58')](_0x4943('0x5f'),'a',_0x4943('0x60'))[_0x4943('0x58')](_0x4943('0x61'),'me',_0x4943('0x62'))[_0x4943('0x58')](_0x4943('0x63'),'it',_0x4943('0x64'))[_0x4943('0x58')](_0x4943('0x53'),'t',_0x4943('0x65'));var _0x1e7b02=squel['expr']();var _0x3e6661=[];var _0x3a70fc=squel[_0x4943('0x66')]();var _0x324ccc;if(_0x354447[_0x4943('0x44')][_0x4943('0x67')]){_0x324ccc=as['parseSearch'](_0x354447[_0x4943('0x44')][_0x4943('0x67')]);var _0x4b2409=_0x324ccc[_0x4943('0x68')];for(var _0x163e87=0x0;_0x163e87<_0x324ccc['conditions'][_0x4943('0x49')];_0x163e87++){var _0x5dc9d2=_0x324ccc[_0x4943('0x69')][_0x163e87];var _0x33fcfa='i';var _0x2771ee=_['find'](_0x5f3e95,[_0x4943('0x2e'),_0x5dc9d2[_0x4943('0x50')]]);if(!_0x2771ee){switch(_0x5dc9d2['field']){case _0x4943('0x6a'):if(_0x5dc9d2[_0x4943('0x6b')]==0x1){_0x1dcba6[_0x4943('0x6c')]('`'+_0x5dc9d2['field']+_0x4943('0x6d'));}else{_0x1dcba6[_0x4943('0x6c')]('`'+_0x5dc9d2[_0x4943('0x50')]+_0x4943('0x6e'));}break;case'Contact':if(_0x5dc9d2[_0x4943('0x6f')]===_0x4943('0x70')){if(_0x5dc9d2['value'][_0x4943('0x35')]('\x20')[_0x4943('0x49')]>0x1){_0x1e7b02[_0x4b2409](_0x4943('0x71'),qs['getFullTextValue'](_0x5dc9d2[_0x4943('0x6b')]),null);}else{var _0xc169c2='%'+_0x5dc9d2[_0x4943('0x6b')]+'%';_0x1e7b02[_0x4b2409](_0x4943('0x72'),_0xc169c2,_0xc169c2,_0xc169c2);}}else{_0x2771ee=_[_0x4943('0x73')](_0x5f3e95,[_0x4943('0x2e'),_0x4943('0x74')]);_0x5dc9d2[_0x4943('0x50')]=_0x4943('0x74');_0x365edf=as[_0x4943('0x75')](_0x33fcfa,_0x2771ee[_0x4943('0x76')],_0x5dc9d2);_0x1e7b02[_0x4b2409](_0x365edf['text'],_0x365edf['value']['start'],_0x365edf[_0x4943('0x6b')][_0x4943('0x1f')]);}break;case _0x4943('0x77'):var _0x3a6fcb=_0x5dc9d2[_0x4943('0x6b')][_0x4943('0x35')](',')[_0x4943('0x31')](function(_0x453d0d){return Number(_0x453d0d);});_0x3a6fcb['forEach'](function(_0xdb4c8a){_0x3a70fc['or'](_0x4943('0x78'),'%,'+_0xdb4c8a+',%');});_0x3e6661=_['union'](_0x3e6661,_0x3a6fcb);break;case _0x4943('0x79'):if(_0x5dc9d2['operator']==='$substring'){_0x1e7b02[_0x4b2409](_0x4943('0x7a'),'%'+_0x5dc9d2[_0x4943('0x6b')]+'%',null);}else{_0x2771ee=_[_0x4943('0x73')](_0x5f3e95,[_0x4943('0x2e'),_0x4943('0x3f')]);_0x5dc9d2['field']=_0x4943('0x3f');_0x365edf=as['buildExpression'](_0x33fcfa,_0x2771ee[_0x4943('0x76')],_0x5dc9d2);_0x1e7b02[_0x4b2409](_0x365edf[_0x4943('0x7b')],_0x365edf[_0x4943('0x6b')][_0x4943('0x7c')],_0x365edf[_0x4943('0x6b')][_0x4943('0x1f')]);}break;case _0x4943('0x7d'):_0x365edf=as['buildExpression']('me',null,_0x5dc9d2);_0x1e7b02[_0x4b2409](_0x365edf[_0x4943('0x7b')],_0x365edf[_0x4943('0x6b')][_0x4943('0x7c')],_0x365edf[_0x4943('0x6b')][_0x4943('0x1f')]);break;}}else{var _0x365edf=as['buildExpression'](_0x33fcfa,_0x2771ee[_0x4943('0x76')],_0x5dc9d2);_0x1e7b02[_0x4b2409](_0x365edf[_0x4943('0x7b')],_0x365edf[_0x4943('0x6b')][_0x4943('0x7c')],_0x365edf[_0x4943('0x6b')][_0x4943('0x1f')]);}}}else{var _0x59fe9b=_(_0x354447[_0x4943('0x44')])[_0x4943('0x7e')]()[_0x4943('0x31')](function(_0x4b0932){return _[_0x4943('0x7f')](_0x5f3e95,[_0x4943('0x2e'),_0x4b0932])?_0x4b0932:undefined;})[_0x4943('0x80')]()['value']();if(!_[_0x4943('0x81')](_0x59fe9b)){_0x59fe9b[_0x4943('0x36')](function(_0x5d693a){if(_0x5d693a===_0x4943('0x82')){_0x1dcba6[_0x4943('0x83')](_0x4943('0x84'),[]['concat'](_0x354447[_0x4943('0x44')][_0x5d693a]));}else if(_0x5d693a===_0x4943('0x85')){var _0x1b1647=JSON['parse'](_0x354447[_0x4943('0x44')][_0x5d693a])['$gte'];var _0x5415c9=JSON['parse'](_0x354447[_0x4943('0x44')][_0x5d693a])[_0x4943('0x86')];_0x1dcba6[_0x4943('0x83')](_0x4943('0x87'),_0x1b1647,_0x5415c9);}else{if(_0x354447['query'][_0x5d693a]===_0x4943('0x88')){_0x1dcba6[_0x4943('0x83')]('i.'+_0x5d693a+_0x4943('0x89'));}else{_0x1dcba6['where']('i.'+_0x5d693a+_0x4943('0x8a'),_0x354447[_0x4943('0x44')][_0x5d693a]);}}});}if(_0x354447['query'][_0x4943('0x8b')]){if(_0x354447[_0x4943('0x44')][_0x4943('0x8b')]==0x1){_0x1dcba6[_0x4943('0x6c')](_0x4943('0x8c'));}else{_0x1dcba6[_0x4943('0x6c')](_0x4943('0x8d'));}}if(_0x354447[_0x4943('0x44')][_0x4943('0x8e')]){_0x3e6661=_[_0x4943('0x8f')](_0x354447[_0x4943('0x44')][_0x4943('0x8e')])?_0x354447[_0x4943('0x44')]['tag']:new Array(_0x354447[_0x4943('0x44')][_0x4943('0x8e')]);_0x3e6661[_0x4943('0x36')](function(_0x5b7ced){_0x3a70fc['or'](_0x4943('0x78'),'%,'+_0x5b7ced+',%');});}if(_0x354447['query'][_0x4943('0x90')]){var _0x5a588e=_0x354447[_0x4943('0x44')][_0x4943('0x90')][_0x4943('0x91')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x5a588e)){_0x1e7b02['or'](_0x4943('0x92'),_0x5a588e+'%')['or']('i.fax\x20LIKE\x20?',_0x5a588e+'%');}_0x1e7b02['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5a588e+'%');}}_0x1dcba6[_0x4943('0x83')](_0x1e7b02);_0x1dcba6[_0x4943('0x93')](_0x4943('0x94'));var _0x557514={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x3688da=_0x1dcba6[_0x4943('0x95')]();_0x3688da[_0x4943('0x50')]('i.id');_0x3688da[_0x4943('0x50')](_0x4943('0x96'),_0x4943('0x6a'));if(_0x51f21e[_0x4943('0x97')]){_0x51f21e['order'][_0x4943('0x36')](function(_0x9e1de4){var _0x30cd53=_0x9e1de4[0x0]==='contactName'?_0x9e1de4[0x0]:'i.'+_0x9e1de4[0x0];_0x1dcba6[_0x4943('0x97')](_0x30cd53,_0x9e1de4[0x1]===_0x4943('0x98')?![]:!![]);});}if(!_['isEmpty'](_0x3e6661)){_0x1dcba6['having'](_0x3a70fc);_0x3688da[_0x4943('0x83')](_0x4943('0x99'),_0x3e6661);}BPromise[_0x4943('0x9a')]()[_0x4943('0x2a')](function(){if(!_0x324ccc){if(_0x354447['query'][_0x4943('0x82')])return;_0x3688da[_0x4943('0x83')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x1dcba6[_0x4943('0x83')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x354447['user'][_0x4943('0x9b')]!==_0x4943('0x9c'))return;return _0x354447[_0x4943('0x9d')][_0x4943('0x9e')]({'attributes':['id'],'raw':!![]})[_0x4943('0x2a')](function(_0x389b34){if(_[_0x4943('0x81')](_0x389b34)){_0x3688da[_0x4943('0x83')](_0x4943('0x9f'));_0x1dcba6['where'](_0x4943('0x9f'));}else{_0x3688da['where'](_0x4943('0x84'),_[_0x4943('0x31')](_0x389b34,'id'));_0x1dcba6['where'](_0x4943('0x84'),_[_0x4943('0x31')](_0x389b34,'id'));}});})[_0x4943('0x2a')](function(){if(_0x354447[_0x4943('0x9d')][_0x4943('0x9b')]===_0x4943('0x9c')&&!_0x324ccc&&!_0x354447[_0x4943('0x44')][_0x4943('0x82')])return[];return db[_0x4943('0xa0')][_0x4943('0x44')](_0x3688da[_0x4943('0xa1')](),_0x557514);})[_0x4943('0x2a')](function(_0x4896f0){_0x22df68[_0x4943('0x23')]=_0x4896f0[_0x4943('0x49')];if(_0x22df68['count']===0x0)return[];return db['sequelize'][_0x4943('0x44')](_0x434039['toString'](),_0x557514)[_0x4943('0x2a')](function(_0x50b5e8){_0x490559=_['keyBy'](_0x50b5e8,'id');_0x557514=_[_0x4943('0xa2')](_0x557514,{'model':db[_0x4943('0x40')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x354447[_0x4943('0x44')]['fields']){_0x51f21e[_0x4943('0x47')]['forEach'](function(_0x1043e6){_0x1dcba6[_0x4943('0x50')]('i.'+_0x1043e6);});}else{_0x1dcba6[_0x4943('0x50')](_0x4943('0x96'),_0x4943('0x6a'));_0x1dcba6[_0x4943('0x50')](_0x4943('0xa3'),_0x4943('0xa4'));_0x1dcba6['field'](_0x4943('0xa5'),_0x4943('0xa6'));_0x1dcba6[_0x4943('0x50')](_0x4943('0xa7'),_0x4943('0xa8'));_0x1dcba6[_0x4943('0x50')](_0x4943('0xa9'));_0x1dcba6[_0x4943('0x50')](_0x4943('0xaa'),'Contact.firstName');_0x1dcba6[_0x4943('0x50')](_0x4943('0xab'),_0x4943('0xac'));_0x1dcba6[_0x4943('0x50')](_0x4943('0xad'),_0x4943('0xae'));_0x1dcba6['field'](_0x4943('0xaf'),_0x4943('0xb0'));_0x1dcba6[_0x4943('0x50')](_0x4943('0xb1'),_0x4943('0xb2'));_0x1dcba6[_0x4943('0x50')]('c.fax',_0x4943('0xb3'));_0x1dcba6[_0x4943('0x50')](_0x4943('0xb4'),_0x4943('0xb5'));_0x1dcba6[_0x4943('0x50')](_0x4943('0xb6'),_0x4943('0xb7'));_0x1dcba6['field'](_0x4943('0xb8'),_0x4943('0x34'));}if(_0x51f21e[_0x4943('0x22')])_0x1dcba6[_0x4943('0x22')](_0x51f21e['limit']);if(_0x51f21e[_0x4943('0x24')])_0x1dcba6[_0x4943('0x24')](_0x51f21e[_0x4943('0x24')]);return db['sequelize'][_0x4943('0x44')](_0x1dcba6[_0x4943('0xa1')](),_0x557514);})['then'](function(_0x4a0505){if(_0x4a0505[_0x4943('0x49')]>0x0)_0x44c5eb[_0x4943('0x83')](_0x4943('0xb9'),_['map'](_0x4a0505,'id'));return db[_0x4943('0xa0')]['query'](_0x44c5eb[_0x4943('0xa1')](),_0x557514)[_0x4943('0x2a')](function(_0x52d3ef){var _0x25261d=_[_0x4943('0xba')](_0x52d3ef,_0x4943('0xbb'));var _0x3e3fc1=[];_0x4a0505['forEach'](function(_0x1a80e9){_0x3e3fc1[_0x4943('0x37')](updateFaxInteraction(_0x1a80e9,_0x490559,_0x25261d));});return BPromise[_0x4943('0xbc')](_0x3e3fc1);});});})[_0x4943('0x2a')](function(_0x8264ca){_0x22df68[_0x4943('0xbd')]=_0x8264ca;return _0x22df68;})['then'](respondWithFilteredResult(_0x13dc4f,_0x51f21e))[_0x4943('0x38')](handleError(_0x13dc4f,null));};exports[_0x4943('0xbe')]=function(_0x364cd8,_0x31b369){var _0x2e5ac0={'raw':![],'where':{'id':_0x364cd8[_0x4943('0xbf')]['id']}},_0x5144cf={};_0x5144cf['model']=_[_0x4943('0x7e')](db[_0x4943('0x40')][_0x4943('0x41')]);_0x5144cf[_0x4943('0x44')]=_[_0x4943('0x7e')](_0x364cd8[_0x4943('0x44')]);_0x5144cf['filters']=_[_0x4943('0x45')](_0x5144cf['model'],_0x5144cf[_0x4943('0x44')]);_0x2e5ac0[_0x4943('0x47')]=_[_0x4943('0x45')](_0x5144cf[_0x4943('0x46')],qs[_0x4943('0x48')](_0x364cd8[_0x4943('0x44')]['fields']));_0x2e5ac0['attributes']=_0x2e5ac0[_0x4943('0x47')][_0x4943('0x49')]?_0x2e5ac0[_0x4943('0x47')]:_0x5144cf['model'];if(_0x364cd8[_0x4943('0x44')][_0x4943('0xc0')]){_0x2e5ac0['include']=[{'all':!![]}];}_0x2e5ac0=_[_0x4943('0xa2')]({},_0x2e5ac0,_0x364cd8[_0x4943('0xc1')]);return db['FaxInteraction'][_0x4943('0x73')](_0x2e5ac0)['then'](handleEntityNotFound(_0x31b369,null))['then'](respondWithResult(_0x31b369,null))[_0x4943('0x38')](handleError(_0x31b369,null));};exports[_0x4943('0xc2')]=function(_0xb660da,_0x159e9c){return db[_0x4943('0x40')]['create'](_0xb660da[_0x4943('0x7d')],{})[_0x4943('0x2a')](respondWithResult(_0x159e9c,0xc9))[_0x4943('0x38')](handleError(_0x159e9c,null));};exports[_0x4943('0x29')]=function(_0x5982ce,_0x3d09da){if(_0x5982ce['body']['id']){delete _0x5982ce[_0x4943('0x7d')]['id'];}return db[_0x4943('0x40')][_0x4943('0x73')]({'where':{'id':_0x5982ce[_0x4943('0xbf')]['id']}})[_0x4943('0x2a')](handleEntityNotFound(_0x3d09da,null))[_0x4943('0x2a')](saveUpdates(_0x5982ce[_0x4943('0x7d')],null))[_0x4943('0x2a')](respondWithResult(_0x3d09da,null))['catch'](handleError(_0x3d09da,null));};exports[_0x4943('0x2b')]=function(_0x414123,_0x35c6a3){return db[_0x4943('0x40')]['find']({'where':{'id':_0x414123[_0x4943('0xbf')]['id']}})[_0x4943('0x2a')](handleEntityNotFound(_0x35c6a3,null))[_0x4943('0x2a')](removeEntity(_0x35c6a3,null))[_0x4943('0x38')](handleError(_0x35c6a3,null));};exports[_0x4943('0xc3')]=function(_0x279f20,_0x3b6a30){return db[_0x4943('0x40')][_0x4943('0xc3')]()[_0x4943('0x2a')](respondWithResult(_0x3b6a30,null))['catch'](handleError(_0x3b6a30,null));};exports[_0x4943('0xc4')]=function(_0x909a42,_0x2481c0,_0x346e2e){return db[_0x4943('0xc5')]['find']({'where':{'id':_0x909a42[_0x4943('0xbf')]['id']}})['then'](handleEntityNotFound(_0x2481c0,null))['then'](function(_0x490489){if(_0x490489){return _0x490489[_0x4943('0xc4')](_0x909a42[_0x4943('0x7d')][_0x4943('0xc6')],_[_0x4943('0xc7')](_0x909a42[_0x4943('0x7d')],[_0x4943('0xc6'),'id'])||{});}})['then'](respondWithResult(_0x2481c0,null))[_0x4943('0x38')](handleError(_0x2481c0,null));};exports['getMessages']=function(_0xa345e8,_0x3c23f6,_0x2424df){var _0x21de6e={'raw':![],'where':{}};var _0x23cd70={};var _0x42d7f5={'count':0x0,'rows':[]};return db[_0x4943('0x40')][_0x4943('0xc8')]({'where':{'id':_0xa345e8[_0x4943('0xbf')]['id']}})[_0x4943('0x2a')](handleEntityNotFound(_0x3c23f6,null))[_0x4943('0x2a')](function(_0x48df08){if(_0x48df08){_0x23cd70[_0x4943('0x46')]=_[_0x4943('0x7e')](db[_0x4943('0xc5')][_0x4943('0x41')]);_0x23cd70['query']=_['keys'](_0xa345e8[_0x4943('0x44')]);_0x23cd70[_0x4943('0x4d')]=_[_0x4943('0x45')](_0x23cd70[_0x4943('0x46')],_0x23cd70[_0x4943('0x44')]);_0x21de6e['attributes']=_[_0x4943('0x45')](_0x23cd70[_0x4943('0x46')],qs[_0x4943('0x48')](_0xa345e8[_0x4943('0x44')][_0x4943('0x48')]));_0x21de6e['attributes']=_0x21de6e['attributes'][_0x4943('0x49')]?_0x21de6e[_0x4943('0x47')]:_0x23cd70[_0x4943('0x46')];if(!_0xa345e8['query']['hasOwnProperty'](_0x4943('0x4b'))){_0x21de6e[_0x4943('0x22')]=qs[_0x4943('0x22')](_0xa345e8[_0x4943('0x44')]['limit']);_0x21de6e[_0x4943('0x24')]=qs[_0x4943('0x24')](_0xa345e8[_0x4943('0x44')][_0x4943('0x24')]);}_0x21de6e[_0x4943('0x97')]=qs[_0x4943('0x4c')](_0xa345e8[_0x4943('0x44')][_0x4943('0x4c')]);_0x21de6e[_0x4943('0x83')]=qs[_0x4943('0x4d')](_[_0x4943('0x4e')](_0xa345e8[_0x4943('0x44')],_0x23cd70[_0x4943('0x4d')]));_0x21de6e['where'][_0x4943('0xbb')]=_0x48df08['id'];if(_0xa345e8[_0x4943('0x44')]['filter']){_0x21de6e[_0x4943('0x83')]=_[_0x4943('0xa2')](_0x21de6e['where'],{'$or':_['map'](_0x21de6e['attributes'],function(_0x10271d){var _0x37e7af={};_0x37e7af[_0x10271d]={'$like':'%'+_0xa345e8[_0x4943('0x44')][_0x4943('0x90')]+'%'};return _0x37e7af;})});}if(_0xa345e8[_0x4943('0x44')][_0x4943('0xc9')]){var _0x5eb48d=_0xa345e8[_0x4943('0x44')][_0x4943('0xc9')]['split'](',');var _0x53f99e={};_0x53f99e[_0x5eb48d[0x0]]={'$gte':moment(_0x5eb48d[0x1])[_0x4943('0xca')]('YYYY-MM-DD\x20HH:mm:ss')};_0x21de6e['where']=_['merge'](_0x21de6e[_0x4943('0x83')],_0x53f99e);}_0x21de6e=_[_0x4943('0xa2')]({},_0x21de6e,_0xa345e8[_0x4943('0xc1')]);return db[_0x4943('0xc5')][_0x4943('0x23')]({'where':_0x21de6e[_0x4943('0x83')]})[_0x4943('0x2a')](function(_0x3670ae){_0x42d7f5['count']=_0x3670ae;if(_0xa345e8['query']['includeAll']){_0x21de6e['include']=[{'all':!![]}];}return db[_0x4943('0xc5')]['findAll'](_0x21de6e);})['then'](function(_0x5f5bb3){_0x42d7f5['rows']=_0x5f5bb3;return _0x42d7f5;});}})['then'](respondWithFilteredResult(_0x3c23f6,_0x21de6e))['catch'](handleError(_0x3c23f6,null));};exports[_0x4943('0xcb')]=function(_0x32c136,_0x225c36,_0x5dff71){return db[_0x4943('0x40')][_0x4943('0x73')]({'where':{'id':_0x32c136[_0x4943('0xbf')]['id']}})['then'](handleEntityNotFound(_0x225c36,null))[_0x4943('0x2a')](function(_0x21c86f){if(_0x21c86f){return _0x21c86f[_0x4943('0xcc')](_0x32c136[_0x4943('0x7d')][_0x4943('0xc6')],_[_0x4943('0xc7')](_0x32c136[_0x4943('0x7d')],[_0x4943('0xc6'),'id'])||{})[_0x4943('0xcd')](function(){return db[_0x4943('0x77')][_0x4943('0xce')]({'attributes':['id',_0x4943('0x2e'),_0x4943('0x51')],'where':{'id':_0x32c136['body'][_0x4943('0xc6')]}});})[_0x4943('0x2a')](function(_0x51e743){socket[_0x4943('0xcf')](_0x4943('0xd0'),{'id':Number(_0x32c136[_0x4943('0xbf')]['id']),'tags':_0x51e743||[]});return{'id':Number(_0x32c136[_0x4943('0xbf')]['id']),'tags':_0x51e743||[]};});}})['then'](respondWithResult(_0x225c36,null))['catch'](handleError(_0x225c36,null));};exports[_0x4943('0xd1')]=function(_0x454275,_0x341826,_0x5bf49e){return db[_0x4943('0x40')]['find']({'where':{'id':_0x454275[_0x4943('0xbf')]['id']}})[_0x4943('0x2a')](handleEntityNotFound(_0x341826,null))[_0x4943('0x2a')](function(_0x82cd83){if(_0x82cd83){return _0x82cd83[_0x4943('0xd1')](_0x454275[_0x4943('0x44')][_0x4943('0xc6')]);}})[_0x4943('0x2a')](respondWithStatusCode(_0x341826,null))[_0x4943('0x38')](handleError(_0x341826,null));};exports[_0x4943('0xd2')]=function(_0x7a7427,_0x5e8b74){var _0x5969a4=moment()[_0x4943('0xd3')]()['toString']();var _0x3d48b9=path['join'](config[_0x4943('0xd4')],_0x4943('0xd5'),'files',_0x4943('0xd6'));var _0x2bbaca=path[_0x4943('0xd7')](config[_0x4943('0xd4')],_0x4943('0xd5'),_0x4943('0xd8'),_0x4943('0xd9'));var _0x849264=path[_0x4943('0xd7')](_0x3d48b9,_0x5969a4);var _0x4efcc8=util[_0x4943('0xca')](_0x4943('0xda'),_0x7a7427[_0x4943('0xbf')]['id'],_0x5969a4);var _0x14579b=path[_0x4943('0xd7')](_0x3d48b9,_0x4efcc8);var _0x1d7b35=[];_0x1d7b35[_0x4943('0x37')]({'model':db[_0x4943('0xdb')],'as':_0x4943('0xdb'),'raw':!![]});var _0x12961c=[{'model':db['FaxMessage'],'as':_0x4943('0xdc'),'attributes':['id',_0x4943('0x7d'),'createdAt'],'include':_0x1d7b35}];return db[_0x4943('0x40')][_0x4943('0x73')]({'where':{'id':_0x7a7427['params']['id']},'include':_0x12961c})[_0x4943('0x2a')](handleEntityNotFound(_0x5e8b74,null))['then'](function(_0x4cdb16){if(_0x4cdb16&&_0x4cdb16[_0x4943('0xdc')]){var _0x31bf6c=_0x4cdb16['get']({'plain':!![]});fs[_0x4943('0xdd')](_0x849264);for(var _0x14ac4d=0x0;_0x14ac4d<_0x31bf6c['Messages']['length'];_0x14ac4d++){var _0x4d92b1=_0x31bf6c[_0x4943('0xdc')][_0x14ac4d]['Attachment'];if(_0x4d92b1){var _0x14b840=path[_0x4943('0xd7')](_0x2bbaca,_0x4d92b1[_0x4943('0xde')]);if(fs[_0x4943('0xdf')](_0x14b840)){fs[_0x4943('0xe0')](_0x14b840)[_0x4943('0xe1')](fs[_0x4943('0xe2')](path[_0x4943('0xd7')](_0x849264,_0x4d92b1['basename'])));}}}return BPromise['resolve']()[_0x4943('0x2a')](function(){return new BPromise(function(_0x2700aa,_0x2bc5ba){zipdir(_0x849264,{'saveTo':_0x14579b},function(_0xbd3d71,_0x7a5297){if(_0xbd3d71)return _0x2bc5ba(_0xbd3d71);return _0x2700aa(_0x7a5297);});})[_0x4943('0x2a')](function(){return new BPromise(function(_0x18514f,_0x43ffc5){rimraf(_0x849264,function(_0x111b69){if(_0x111b69)_0x43ffc5(_0x111b69);return _0x18514f();});});})[_0x4943('0x2a')](function(){return _0x5e8b74[_0x4943('0xd2')](_0x14579b,_0x4efcc8,function(_0x340725){if(_0x340725){console[_0x4943('0xe3')]('err',_0x340725);}else{fs[_0x4943('0xe4')](_0x14579b);}});});});}else{return _0x5e8b74[_0x4943('0x1d')](0xc8);}})[_0x4943('0x38')](handleError(_0x5e8b74,null));};
\ No newline at end of file
index 22d7fc2..7100633 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafd7=['remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hook','exports','../../mysqldb','FaxMessage','setMaxListeners','save'];(function(_0x7fce72,_0x499c16){var _0x35c042=function(_0x2c627f){while(--_0x2c627f){_0x7fce72['push'](_0x7fce72['shift']());}};_0x35c042(++_0x499c16);}(_0xafd7,0x1cc));var _0x7afd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xafd7[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x7afd('0x0'))['db']['FaxInteraction'];var FaxMessage=require(_0x7afd('0x0'))['db'][_0x7afd('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x7afd('0x2')](0x0);var events={'afterCreate':_0x7afd('0x3'),'afterUpdate':'update','afterDestroy':_0x7afd('0x4')};function emitEvent(_0x24995c){return function(_0x514c37,_0x4250e2,_0x2c8e4c){_0x514c37[_0x7afd('0x5')]({'attributes':['id'],'raw':!![]})[_0x7afd('0x6')](function(_0x531a47){_0x514c37[_0x7afd('0x7')](_0x7afd('0x8'),_0x531a47[_0x7afd('0x9')](function(_0x3c6327){return{'id':_0x3c6327['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x514c37['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7afd('0x6')](function(_0x4fca39){_0x514c37[_0x7afd('0x7')](_0x7afd('0xa'),_0x4fca39[_0x7afd('0xb')]);FaxInteractionEvents['emit'](_0x24995c+':'+_0x514c37['id'],_0x514c37);FaxInteractionEvents[_0x7afd('0xc')](_0x24995c,_0x514c37);_0x2c8e4c(null);})[_0x7afd('0xd')](_0x2c8e4c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x7afd('0xe')](e,emitEvent(event));}}module[_0x7afd('0xf')]=FaxInteractionEvents;
\ No newline at end of file
+var _0xae70=['getUsers','then','Users','unreadMessages','length','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','remove'];(function(_0x2b44d6,_0x2473f6){var _0x51842d=function(_0x44c476){while(--_0x44c476){_0x2b44d6['push'](_0x2b44d6['shift']());}};_0x51842d(++_0x2473f6);}(_0xae70,0xa4));var _0x0ae7=function(_0xee3038,_0x2afbc9){_0xee3038=_0xee3038-0x0;var _0x2d676f=_0xae70[_0xee3038];return _0x2d676f;};'use strict';var EventEmitter=require(_0x0ae7('0x0'));var FaxInteraction=require(_0x0ae7('0x1'))['db'][_0x0ae7('0x2')];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0ae7('0x3')};function emitEvent(_0x3cd2db){return function(_0x5c585b,_0x4723cb,_0x519507){_0x5c585b[_0x0ae7('0x4')]({'attributes':['id'],'raw':!![]})[_0x0ae7('0x5')](function(_0x1923eb){_0x5c585b['setDataValue'](_0x0ae7('0x6'),_0x1923eb['map'](function(_0x28f517){return{'id':_0x28f517['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x5c585b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0ae7('0x5')](function(_0x53be75){_0x5c585b['setDataValue'](_0x0ae7('0x7'),_0x53be75[_0x0ae7('0x8')]);FaxInteractionEvents['emit'](_0x3cd2db+':'+_0x5c585b['id'],_0x5c585b);FaxInteractionEvents['emit'](_0x3cd2db,_0x5c585b);_0x519507(null);})[_0x0ae7('0x9')](_0x519507(null));};}for(var e in events){if(events[_0x0ae7('0xa')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x0ae7('0xb')]=FaxInteractionEvents;
\ No newline at end of file
index e3e2b5a..e1ae39c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a05=['api','moment','bluebird','request-promise','path','rimraf','./faxInteraction.attributes','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x263dfe,_0x1c717e){var _0x115507=function(_0x11bdd4){while(--_0x11bdd4){_0x263dfe['push'](_0x263dfe['shift']());}};_0x115507(++_0x1c717e);}(_0x9a05,0x14e));var _0x59a0=function(_0x10ea6a,_0x48d10d){_0x10ea6a=_0x10ea6a-0x0;var _0x5ce221=_0x9a05[_0x10ea6a];return _0x5ce221;};'use strict';var _=require(_0x59a0('0x0'));var util=require(_0x59a0('0x1'));var logger=require('../../config/logger')(_0x59a0('0x2'));var moment=require(_0x59a0('0x3'));var BPromise=require(_0x59a0('0x4'));var rp=require(_0x59a0('0x5'));var fs=require('fs');var path=require(_0x59a0('0x6'));var rimraf=require(_0x59a0('0x7'));var config=require('../../config/environment');var attributes=require(_0x59a0('0x8'));module['exports']=function(_0x4c69a7,_0x5bb80d){return _0x4c69a7['define']('FaxInteraction',attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x345bc7,_0x4b67e1,_0x11a427){if(_0x345bc7[_0x59a0('0x9')](_0x59a0('0xa'))){_0x345bc7['closedAt']=moment()['format'](_0x59a0('0xb'));}_0x11a427(null,_0x345bc7);}}});};
\ No newline at end of file
+var _0x9c84=['closed','closedAt','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed'];(function(_0x5dda05,_0x1b70f6){var _0x4e7866=function(_0x54578b){while(--_0x54578b){_0x5dda05['push'](_0x5dda05['shift']());}};_0x4e7866(++_0x1b70f6);}(_0x9c84,0x192));var _0x49c8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9c84[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x49c8('0x0'));var logger=require('../../config/logger')(_0x49c8('0x1'));var moment=require(_0x49c8('0x2'));var BPromise=require(_0x49c8('0x3'));var rp=require(_0x49c8('0x4'));var fs=require('fs');var path=require(_0x49c8('0x5'));var rimraf=require(_0x49c8('0x6'));var config=require(_0x49c8('0x7'));var attributes=require(_0x49c8('0x8'));module[_0x49c8('0x9')]=function(_0x4b1ac1,_0x52e29c){return _0x4b1ac1[_0x49c8('0xa')](_0x49c8('0xb'),attributes,{'tableName':_0x49c8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2b343a,_0x51333b,_0x2f7752){if(_0x2b343a[_0x49c8('0xd')](_0x49c8('0xe'))){_0x2b343a[_0x49c8('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x2f7752(null,_0x2b343a);}}});};
\ No newline at end of file
index 38d9fb8..033a37b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc99c=['attributes','debug','AddTagsToFaxInteraction','find','addTags','ids','body','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','options','where'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc99c,0x170));var _0xcc99=function(_0x4859c8,_0x1e0dd8){_0x4859c8=_0x4859c8-0x0;var _0x1c54bd=_0xc99c[_0x4859c8];return _0x1c54bd;};'use strict';var _=require('lodash');var util=require(_0xcc99('0x0'));var moment=require(_0xcc99('0x1'));var BPromise=require(_0xcc99('0x2'));var rs=require(_0xcc99('0x3'));var fs=require('fs');var Redis=require(_0xcc99('0x4'));var db=require(_0xcc99('0x5'))['db'];var utils=require(_0xcc99('0x6'));var logger=require(_0xcc99('0x7'))(_0xcc99('0x8'));var config=require(_0xcc99('0x9'));var jayson=require(_0xcc99('0xa'));var client=jayson[_0xcc99('0xb')][_0xcc99('0xc')]({'port':0x232a});config['redis']=_[_0xcc99('0xd')](config['redis'],{'host':_0xcc99('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcc99('0xf'))[_0xcc99('0x10')](socket);function respondWithRpcPromise(_0x1f54b5,_0x12d2d4,_0x1ab800){return new BPromise(function(_0x7d21b2,_0x57d66c){return client['request'](_0x1f54b5,_0x1ab800)[_0xcc99('0x11')](function(_0x347e96){logger[_0xcc99('0x12')](_0xcc99('0x13'),_0x12d2d4,_0xcc99('0x14'));logger['debug'](_0xcc99('0x15'),_0x12d2d4,_0xcc99('0x14'),JSON[_0xcc99('0x16')](_0x347e96));if(_0x347e96['error']){if(_0x347e96[_0xcc99('0x17')][_0xcc99('0x18')]===0x1f4){logger[_0xcc99('0x17')](_0xcc99('0x13'),_0x12d2d4,_0x347e96[_0xcc99('0x17')][_0xcc99('0x19')]);return _0x57d66c(_0x347e96[_0xcc99('0x17')][_0xcc99('0x19')]);}logger[_0xcc99('0x17')](_0xcc99('0x13'),_0x12d2d4,_0x347e96[_0xcc99('0x17')][_0xcc99('0x19')]);return _0x7d21b2(_0x347e96[_0xcc99('0x17')][_0xcc99('0x19')]);}else{logger[_0xcc99('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x12d2d4,_0xcc99('0x14'));_0x7d21b2(_0x347e96[_0xcc99('0x1a')][_0xcc99('0x19')]);}})[_0xcc99('0x1b')](function(_0x39a14f){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x12d2d4,_0x39a14f);_0x57d66c(_0x39a14f);});});}exports[_0xcc99('0x1c')]=function(_0x4991b9){var _0x3f1e84=this;return new Promise(function(_0x4d13c2,_0x4a50c9){return db[_0xcc99('0x1d')]['update'](_0x4991b9['body'],{'raw':_0x4991b9[_0xcc99('0x1e')]?_0x4991b9['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4991b9[_0xcc99('0x1e')]?_0x4991b9[_0xcc99('0x1e')][_0xcc99('0x1f')]||null:null,'attributes':_0x4991b9[_0xcc99('0x1e')]?_0x4991b9['options'][_0xcc99('0x20')]||null:null,'limit':_0x4991b9['options']?_0x4991b9[_0xcc99('0x1e')]['limit']||null:null})[_0xcc99('0x11')](function(_0x5cd0e9){logger['info'](_0xcc99('0x1c'),_0x4991b9);logger[_0xcc99('0x21')](_0xcc99('0x1c'),_0x4991b9,JSON[_0xcc99('0x16')](_0x5cd0e9));_0x4d13c2(_0x5cd0e9);})[_0xcc99('0x1b')](function(_0x224af6){logger['error']('UpdateFaxInteraction',_0x224af6['message'],_0x4991b9);_0x4a50c9(_0x3f1e84['error'](0x1f4,_0x224af6[_0xcc99('0x19')]));});});};exports[_0xcc99('0x22')]=function(_0x3719cf){return new Promise(function(_0x38ffd5,_0x158e62){return db['FaxInteraction'][_0xcc99('0x23')]({'where':_0x3719cf[_0xcc99('0x1e')]?_0x3719cf[_0xcc99('0x1e')][_0xcc99('0x1f')]||null:null})[_0xcc99('0x11')](function(_0x1485e8){if(_0x1485e8){return _0x1485e8[_0xcc99('0x24')](_0x3719cf['body'][_0xcc99('0x25')],_['omit'](_0x3719cf[_0xcc99('0x26')],['ids','id'])||{});}})['spread'](function(_0x2d0811){logger[_0xcc99('0x12')](_0xcc99('0x27'),_0x3719cf);logger[_0xcc99('0x21')](_0xcc99('0x27'),_0x3719cf,JSON[_0xcc99('0x16')](_0x2d0811));_0x38ffd5(_0x2d0811);})[_0xcc99('0x1b')](function(_0x13e592){logger[_0xcc99('0x17')](_0xcc99('0x27'),_0x13e592[_0xcc99('0x19')],_0x3719cf);_0x158e62(_this[_0xcc99('0x17')](0x1f4,_0x13e592['message']));});});};
\ No newline at end of file
+var _0x1b20=['debug','request\x20sent','stringify','error','code','message','UpdateFaxInteraction','FaxInteraction','body','options','raw','where','attributes','limit','then','AddTagsToFaxInteraction','find','addTags','ids','spread','AddTags','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x1b20,0xad));var _0x01b2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1b20[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x01b2('0x0'));var BPromise=require(_0x01b2('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01b2('0x2'))['db'];var utils=require(_0x01b2('0x3'));var logger=require(_0x01b2('0x4'))(_0x01b2('0x5'));var config=require(_0x01b2('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x01b2('0x7')]({'port':0x232a});config[_0x01b2('0x8')]=_[_0x01b2('0x9')](config[_0x01b2('0x8')],{'host':_0x01b2('0xa'),'port':0x18eb});var socket=require(_0x01b2('0xb'))(new Redis(config[_0x01b2('0x8')]));require(_0x01b2('0xc'))[_0x01b2('0xd')](socket);function respondWithRpcPromise(_0x3537b1,_0x136970,_0x2a57e5){return new BPromise(function(_0x587ee4,_0xb3a2a3){return client[_0x01b2('0xe')](_0x3537b1,_0x2a57e5)['then'](function(_0x52c8f4){logger[_0x01b2('0xf')](_0x01b2('0x10'),_0x136970,'request\x20sent');logger[_0x01b2('0x11')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x136970,_0x01b2('0x12'),JSON[_0x01b2('0x13')](_0x52c8f4));if(_0x52c8f4[_0x01b2('0x14')]){if(_0x52c8f4['error'][_0x01b2('0x15')]===0x1f4){logger[_0x01b2('0x14')](_0x01b2('0x10'),_0x136970,_0x52c8f4[_0x01b2('0x14')][_0x01b2('0x16')]);return _0xb3a2a3(_0x52c8f4['error'][_0x01b2('0x16')]);}logger[_0x01b2('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x136970,_0x52c8f4[_0x01b2('0x14')]['message']);return _0x587ee4(_0x52c8f4[_0x01b2('0x14')][_0x01b2('0x16')]);}else{logger[_0x01b2('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x136970,_0x01b2('0x12'));_0x587ee4(_0x52c8f4['result']['message']);}})['catch'](function(_0x5d7dd6){logger['error'](_0x01b2('0x10'),_0x136970,_0x5d7dd6);_0xb3a2a3(_0x5d7dd6);});});}exports[_0x01b2('0x17')]=function(_0x3ea535){var _0xc7e4f8=this;return new Promise(function(_0x3a6617,_0x551535){return db[_0x01b2('0x18')]['update'](_0x3ea535[_0x01b2('0x19')],{'raw':_0x3ea535[_0x01b2('0x1a')]?_0x3ea535[_0x01b2('0x1a')][_0x01b2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ea535['options']?_0x3ea535[_0x01b2('0x1a')][_0x01b2('0x1c')]||null:null,'attributes':_0x3ea535['options']?_0x3ea535[_0x01b2('0x1a')][_0x01b2('0x1d')]||null:null,'limit':_0x3ea535[_0x01b2('0x1a')]?_0x3ea535[_0x01b2('0x1a')][_0x01b2('0x1e')]||null:null})[_0x01b2('0x1f')](function(_0x10894){logger[_0x01b2('0xf')]('UpdateFaxInteraction',_0x3ea535);logger[_0x01b2('0x11')](_0x01b2('0x17'),_0x3ea535,JSON['stringify'](_0x10894));_0x3a6617(_0x10894);})['catch'](function(_0x599aa1){logger[_0x01b2('0x14')](_0x01b2('0x17'),_0x599aa1['message'],_0x3ea535);_0x551535(_0xc7e4f8[_0x01b2('0x14')](0x1f4,_0x599aa1[_0x01b2('0x16')]));});});};exports[_0x01b2('0x20')]=function(_0x3b22fe){return new Promise(function(_0x148eff,_0xc3ba7d){return db[_0x01b2('0x18')][_0x01b2('0x21')]({'where':_0x3b22fe[_0x01b2('0x1a')]?_0x3b22fe[_0x01b2('0x1a')][_0x01b2('0x1c')]||null:null})[_0x01b2('0x1f')](function(_0x2fe6e0){if(_0x2fe6e0){return _0x2fe6e0[_0x01b2('0x22')](_0x3b22fe['body'][_0x01b2('0x23')],_['omit'](_0x3b22fe[_0x01b2('0x19')],[_0x01b2('0x23'),'id'])||{});}})[_0x01b2('0x24')](function(_0x251a8d){logger[_0x01b2('0xf')]('AddTags',_0x3b22fe);logger[_0x01b2('0x11')]('AddTags',_0x3b22fe,JSON[_0x01b2('0x13')](_0x251a8d));_0x148eff(_0x251a8d);})['catch'](function(_0x4c8f4a){logger[_0x01b2('0x14')](_0x01b2('0x25'),_0x4c8f4a[_0x01b2('0x16')],_0x3b22fe);_0xc3ba7d(_this['error'](0x1f4,_0x4c8f4a[_0x01b2('0x16')]));});});};
\ No newline at end of file
index 7612f29..6afed37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2361=['length','faxInteraction:','save','remove','update','emit','register'];(function(_0x2280cb,_0x2caa3f){var _0x12ee0d=function(_0x3f57c0){while(--_0x3f57c0){_0x2280cb['push'](_0x2280cb['shift']());}};_0x12ee0d(++_0x2caa3f);}(_0x2361,0x1d0));var _0x1236=function(_0x4a463b,_0x317df8){_0x4a463b=_0x4a463b-0x0;var _0x826dab=_0x2361[_0x4a463b];return _0x826dab;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x1236('0x0'),_0x1236('0x1'),_0x1236('0x2')];function createListener(_0x185061,_0x20421a){return function(_0x1fa39f){_0x20421a[_0x1236('0x3')](_0x185061,_0x1fa39f);};}function removeListener(_0x14b928,_0x19e113){return function(){FaxInteractionEvents['removeListener'](_0x14b928,_0x19e113);};}exports[_0x1236('0x4')]=function(_0x46c76b){for(var _0x2db952=0x0,_0x1386bc=events[_0x1236('0x5')];_0x2db952<_0x1386bc;_0x2db952++){var _0x2e3598=events[_0x2db952];var _0x1d1449=createListener(_0x1236('0x6')+_0x2e3598,_0x46c76b);FaxInteractionEvents['on'](_0x2e3598,_0x1d1449);}};
\ No newline at end of file
+var _0x789c=['remove','emit','register','faxInteraction:'];(function(_0x507c81,_0x3e1b56){var _0x368a25=function(_0x1e7519){while(--_0x1e7519){_0x507c81['push'](_0x507c81['shift']());}};_0x368a25(++_0x3e1b56);}(_0x789c,0x12c));var _0xc789=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x789c[_0x3dd15e];return _0x231fd0;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save',_0xc789('0x0'),'update'];function createListener(_0x2b6fbe,_0x596bd4){return function(_0x2ddfae){_0x596bd4[_0xc789('0x1')](_0x2b6fbe,_0x2ddfae);};}function removeListener(_0x5142c4,_0x2f6cec){return function(){FaxInteractionEvents['removeListener'](_0x5142c4,_0x2f6cec);};}exports[_0xc789('0x2')]=function(_0x2c981c){for(var _0x18135b=0x0,_0x3b3651=events['length'];_0x18135b<_0x3b3651;_0x18135b++){var _0x577d45=events[_0x18135b];var _0x3b92e0=createListener(_0xc789('0x3')+_0x577d45,_0x2c981c);FaxInteractionEvents['on'](_0x577d45,_0x3b92e0);}};
\ No newline at end of file
index 63f5d65..11ec061 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0f5=['removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./faxInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','fax','addTags','faxinteraction:update','update','delete','faxinteraction:destroy'];(function(_0xbfd9e0,_0x4a6972){var _0x404416=function(_0x3e9c9e){while(--_0x3e9c9e){_0xbfd9e0['push'](_0xbfd9e0['shift']());}};_0x404416(++_0x4a6972);}(_0xd0f5,0xb6));var _0x5d0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0f5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5d0f('0x0'));var util=require(_0x5d0f('0x1'));var path=require(_0x5d0f('0x2'));var timeout=require(_0x5d0f('0x3'));var express=require('express');var router=express[_0x5d0f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5d0f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5d0f('0x6'));var controller=require(_0x5d0f('0x7'));router['get']('/',auth[_0x5d0f('0x8')](),controller['index']);router[_0x5d0f('0x9')](_0x5d0f('0xa'),auth[_0x5d0f('0x8')](),controller[_0x5d0f('0xb')]);router[_0x5d0f('0x9')](_0x5d0f('0xc'),auth[_0x5d0f('0x8')](),controller[_0x5d0f('0xd')]);router['get'](_0x5d0f('0xe'),auth[_0x5d0f('0x8')](),controller[_0x5d0f('0xf')]);router[_0x5d0f('0x9')]('/:id/download',auth[_0x5d0f('0x8')](),controller[_0x5d0f('0x10')]);router[_0x5d0f('0x11')]('/',auth[_0x5d0f('0x8')](),controller[_0x5d0f('0x12')]);router[_0x5d0f('0x11')]('/:id/messages',auth['isAuthenticated'](),controller[_0x5d0f('0x13')]);router[_0x5d0f('0x11')](_0x5d0f('0x14'),auth[_0x5d0f('0x8')](),interaction[_0x5d0f('0x15')](_0x5d0f('0x16'),'faxinteraction:addtags'),controller[_0x5d0f('0x17')]);router['put'](_0x5d0f('0xc'),auth[_0x5d0f('0x8')](),interaction['tracked'](_0x5d0f('0x16'),_0x5d0f('0x18')),controller[_0x5d0f('0x19')]);router[_0x5d0f('0x1a')](_0x5d0f('0xc'),auth[_0x5d0f('0x8')](),interaction[_0x5d0f('0x15')](_0x5d0f('0x16'),_0x5d0f('0x1b')),controller['destroy']);router[_0x5d0f('0x1a')](_0x5d0f('0x14'),auth[_0x5d0f('0x8')](),controller[_0x5d0f('0x1c')]);module[_0x5d0f('0x1d')]=router;
\ No newline at end of file
+var _0x9a22=['create','/:id/messages','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:update','update','delete','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','getMessages','/:id/download','download','post'];(function(_0xe4bb3d,_0x21e87e){var _0xd9e51=function(_0x1f732b){while(--_0x1f732b){_0xe4bb3d['push'](_0xe4bb3d['shift']());}};_0xd9e51(++_0x21e87e);}(_0x9a22,0x75));var _0x29a2=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x9a22[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x29a2('0x0'));var util=require(_0x29a2('0x1'));var path=require(_0x29a2('0x2'));var timeout=require(_0x29a2('0x3'));var express=require(_0x29a2('0x4'));var router=express[_0x29a2('0x5')]();var fs_extra=require(_0x29a2('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x29a2('0x7'));var controller=require(_0x29a2('0x8'));router[_0x29a2('0x9')]('/',auth[_0x29a2('0xa')](),controller[_0x29a2('0xb')]);router[_0x29a2('0x9')](_0x29a2('0xc'),auth[_0x29a2('0xa')](),controller['describe']);router[_0x29a2('0x9')](_0x29a2('0xd'),auth['isAuthenticated'](),controller[_0x29a2('0xe')]);router[_0x29a2('0x9')]('/:id/messages',auth[_0x29a2('0xa')](),controller[_0x29a2('0xf')]);router['get'](_0x29a2('0x10'),auth[_0x29a2('0xa')](),controller[_0x29a2('0x11')]);router[_0x29a2('0x12')]('/',auth[_0x29a2('0xa')](),controller[_0x29a2('0x13')]);router['post'](_0x29a2('0x14'),auth[_0x29a2('0xa')](),controller[_0x29a2('0x15')]);router[_0x29a2('0x12')](_0x29a2('0x16'),auth[_0x29a2('0xa')](),interaction[_0x29a2('0x17')]('fax',_0x29a2('0x18')),controller[_0x29a2('0x19')]);router[_0x29a2('0x1a')](_0x29a2('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x29a2('0x1b'),_0x29a2('0x1c')),controller[_0x29a2('0x1d')]);router[_0x29a2('0x1e')](_0x29a2('0xd'),auth['isAuthenticated'](),interaction[_0x29a2('0x17')](_0x29a2('0x1b'),'faxinteraction:destroy'),controller[_0x29a2('0x1f')]);router['delete'](_0x29a2('0x16'),auth[_0x29a2('0xa')](),controller[_0x29a2('0x20')]);module[_0x29a2('0x21')]=router;
\ No newline at end of file
index 9adef06..829a2ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cc=['ENUM','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x2d44c3,_0x4ce66a){var _0x54cf65=function(_0x110af3){while(--_0x110af3){_0x2d44c3['push'](_0x2d44c3['shift']());}};_0x54cf65(++_0x4ce66a);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x48a928,_0x430727){_0x48a928=_0x48a928-0x0;var _0x11c1e9=_0xf3cc[_0x48a928];return _0x11c1e9;};'use strict';var Sequelize=require(_0xcf3c('0x0'));module[_0xcf3c('0x1')]={'body':{'type':Sequelize[_0xcf3c('0x2')](_0xcf3c('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xcf3c('0x4')]('in',_0xcf3c('0x5')),'defaultValue':_0xcf3c('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xcf3c('0x6')]}};
\ No newline at end of file
+var _0x12c9=['out','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x2a31b7,_0x39001f){var _0x5ec713=function(_0x2f70a1){while(--_0x2f70a1){_0x2a31b7['push'](_0x2a31b7['shift']());}};_0x5ec713(++_0x39001f);}(_0x12c9,0x1c9));var _0x912c=function(_0x48c6fd,_0x5813c3){_0x48c6fd=_0x48c6fd-0x0;var _0x50b91a=_0x12c9[_0x48c6fd];return _0x50b91a;};'use strict';var Sequelize=require(_0x912c('0x0'));module[_0x912c('0x1')]={'body':{'type':Sequelize[_0x912c('0x2')](_0x912c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x912c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x912c('0x5')),'defaultValue':_0x912c('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x912c('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x912c('0x6')]}};
\ No newline at end of file
index b205529..f732d8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11da=['server','files','Attachment','join','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','FaxMessage','rows','show','params','keys','find','body','describe','fax-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','AcceptMessage','acceptMessage','sequelize','Sequelize','SELECT','contact','fullname','internal','manual','channel','event','EventManager','acceptmessage','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','User','email','interface','SIP/%s','motionChannel','rejectmessage','create','CmContact','findOne','AttachmentId','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','root'];(function(_0x118139,_0x7ce965){var _0x2fece9=function(_0xd145a4){while(--_0xd145a4){_0x118139['push'](_0x118139['shift']());}};_0x2fece9(++_0x7ce965);}(_0x11da,0x12e));var _0xa11d=function(_0x223184,_0x29e5f7){_0x223184=_0x223184-0x0;var _0x4be235=_0x11da[_0x223184];return _0x4be235;};'use strict';var emlformat=require(_0xa11d('0x0'));var rimraf=require(_0xa11d('0x1'));var zipdir=require(_0xa11d('0x2'));var jsonpatch=require(_0xa11d('0x3'));var rp=require('request-promise');var moment=require(_0xa11d('0x4'));var BPromise=require(_0xa11d('0x5'));var Mustache=require(_0xa11d('0x6'));var util=require(_0xa11d('0x7'));var path=require(_0xa11d('0x8'));var sox=require(_0xa11d('0x9'));var csv=require(_0xa11d('0xa'));var ejs=require(_0xa11d('0xb'));var fs=require('fs');var fs_extra=require(_0xa11d('0xc'));var _=require(_0xa11d('0xd'));var squel=require(_0xa11d('0xe'));var crypto=require(_0xa11d('0xf'));var jsforce=require(_0xa11d('0x10'));var deskjs=require(_0xa11d('0x11'));var toCsv=require(_0xa11d('0xa'));var querystring=require(_0xa11d('0x12'));var Papa=require('papaparse');var Redis=require(_0xa11d('0x13'));var authService=require(_0xa11d('0x14'));var qs=require(_0xa11d('0x15'));var as=require(_0xa11d('0x16'));var hardwareService=require(_0xa11d('0x17'));var logger=require(_0xa11d('0x18'))('api');var utils=require(_0xa11d('0x19'));var config=require(_0xa11d('0x1a'));var licenseUtil=require(_0xa11d('0x1b'));var db=require(_0xa11d('0x1c'))['db'];config['redis']=_[_0xa11d('0x1d')](config['redis'],{'host':_0xa11d('0x1e'),'port':0x18eb});var socket=require(_0xa11d('0x1f'))(new Redis(config['redis']));require(_0xa11d('0x20'))['register'](socket);var jayson=require(_0xa11d('0x21'));var client=jayson[_0xa11d('0x22')]['http']({'port':0x232c});var client9002=jayson[_0xa11d('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21b7f6,_0x4d503d,_0xa6cb8e,_0x4ca308){return new BPromise(function(_0x2994fe,_0x5b258b){var _0x4267c4=_0x4ca308||client;return _0x4267c4['request'](_0x21b7f6,_0xa6cb8e)[_0xa11d('0x23')](function(_0x847173){logger[_0xa11d('0x24')](_0xa11d('0x25'),_0x4d503d,_0xa11d('0x26'));logger[_0xa11d('0x27')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x4d503d,_0xa11d('0x26'),JSON['stringify'](_0x847173));if(_0x847173[_0xa11d('0x28')]){if(_0x847173[_0xa11d('0x28')][_0xa11d('0x29')]===0x1f4){logger[_0xa11d('0x28')](_0xa11d('0x25'),_0x4d503d,_0x847173[_0xa11d('0x28')][_0xa11d('0x2a')]);return _0x5b258b(_0x847173[_0xa11d('0x28')][_0xa11d('0x2a')]);}logger[_0xa11d('0x28')](_0xa11d('0x25'),_0x4d503d,_0x847173[_0xa11d('0x28')]['message']);return _0x2994fe(_0x847173['error'][_0xa11d('0x2a')]);}else{logger[_0xa11d('0x24')](_0xa11d('0x25'),_0x4d503d,_0xa11d('0x26'));_0x2994fe(_0x847173[_0xa11d('0x2b')][_0xa11d('0x2a')]);}})[_0xa11d('0x2c')](function(_0x1d7aab){logger[_0xa11d('0x28')](_0xa11d('0x25'),_0x4d503d,_0x1d7aab);_0x5b258b(_0x1d7aab);});});}function respondWithStatusCode(_0x1ae222,_0x10a48e){_0x10a48e=_0x10a48e||0xcc;return function(_0x4e6742){if(_0x4e6742){return _0x1ae222['sendStatus'](_0x10a48e);}return _0x1ae222[_0xa11d('0x2d')](_0x10a48e)[_0xa11d('0x2e')]();};}function respondWithResult(_0x2d846a,_0x58f38a){_0x58f38a=_0x58f38a||0xc8;return function(_0x14f881){if(_0x14f881){return _0x2d846a['status'](_0x58f38a)[_0xa11d('0x2f')](_0x14f881);}};}function respondWithFilteredResult(_0x1ef51f,_0x241107){return function(_0x5591d2){if(_0x5591d2){var _0x3a2286=typeof _0x241107[_0xa11d('0x30')]===_0xa11d('0x31')&&typeof _0x241107[_0xa11d('0x32')]==='undefined';var _0x125798=_0x5591d2[_0xa11d('0x33')];var _0xfa9194=_0x3a2286?0x0:_0x241107[_0xa11d('0x30')];var _0xa600ec=_0x3a2286?_0x5591d2[_0xa11d('0x33')]:_0x241107['offset']+_0x241107[_0xa11d('0x32')];var _0x3fc52a;if(_0xa600ec>=_0x125798){_0xa600ec=_0x125798;_0x3fc52a=0xc8;}else{_0x3fc52a=0xce;}_0x1ef51f[_0xa11d('0x2d')](_0x3fc52a);return _0x1ef51f['set']('Content-Range',_0xfa9194+'-'+_0xa600ec+'/'+_0x125798)[_0xa11d('0x2f')](_0x5591d2);}return null;};}function patchUpdates(_0x19f56e){return function(_0x4d9911){try{jsonpatch[_0xa11d('0x34')](_0x4d9911,_0x19f56e,!![]);}catch(_0x4681ce){return BPromise[_0xa11d('0x35')](_0x4681ce);}return _0x4d9911[_0xa11d('0x36')]();};}function saveUpdates(_0xcd3268,_0x440998){return function(_0x54d968){if(_0x54d968){return _0x54d968[_0xa11d('0x37')](_0xcd3268)['then'](function(_0x114d75){return _0x114d75;});}return null;};}function removeEntity(_0x3d4e4e,_0x48549b){return function(_0x2cccc3){if(_0x2cccc3){return _0x2cccc3[_0xa11d('0x38')]()['then'](function(){_0x3d4e4e['status'](0xcc)[_0xa11d('0x2e')]();});}};}function handleEntityNotFound(_0x5492fd,_0x42f922){return function(_0x1f3fba){if(!_0x1f3fba){_0x5492fd[_0xa11d('0x39')](0x194);}return _0x1f3fba;};}function handleError(_0x54e74a,_0x201e26){_0x201e26=_0x201e26||0x1f4;return function(_0xf54f44){logger[_0xa11d('0x28')](_0xf54f44[_0xa11d('0x3a')]);if(_0xf54f44[_0xa11d('0x3b')]){delete _0xf54f44[_0xa11d('0x3b')];}_0x54e74a[_0xa11d('0x2d')](_0x201e26)[_0xa11d('0x3c')](_0xf54f44);};}exports[_0xa11d('0x3d')]=function(_0x5ea151,_0x40732d){var _0x48c310={},_0x2b6d51={},_0x8b5d2a={'count':0x0,'rows':[]};var _0xb463d5=_[_0xa11d('0x3e')](db['FaxMessage'][_0xa11d('0x3f')],function(_0x58a522){return{'name':_0x58a522[_0xa11d('0x40')],'type':_0x58a522[_0xa11d('0x41')][_0xa11d('0x42')]};});_0x2b6d51['model']=_[_0xa11d('0x3e')](_0xb463d5,_0xa11d('0x3b'));_0x2b6d51['query']=_['keys'](_0x5ea151[_0xa11d('0x43')]);_0x2b6d51['filters']=_[_0xa11d('0x44')](_0x2b6d51[_0xa11d('0x45')],_0x2b6d51[_0xa11d('0x43')]);_0x48c310[_0xa11d('0x46')]=_[_0xa11d('0x44')](_0x2b6d51[_0xa11d('0x45')],qs[_0xa11d('0x47')](_0x5ea151[_0xa11d('0x43')][_0xa11d('0x47')]));_0x48c310[_0xa11d('0x46')]=_0x48c310[_0xa11d('0x46')][_0xa11d('0x48')]?_0x48c310['attributes']:_0x2b6d51['model'];if(!_0x5ea151[_0xa11d('0x43')][_0xa11d('0x49')](_0xa11d('0x4a'))){_0x48c310['limit']=qs['limit'](_0x5ea151['query'][_0xa11d('0x32')]);_0x48c310[_0xa11d('0x30')]=qs[_0xa11d('0x30')](_0x5ea151['query']['offset']);}_0x48c310[_0xa11d('0x4b')]=qs[_0xa11d('0x4c')](_0x5ea151[_0xa11d('0x43')][_0xa11d('0x4c')]);_0x48c310[_0xa11d('0x4d')]=qs[_0xa11d('0x4e')](_[_0xa11d('0x4f')](_0x5ea151[_0xa11d('0x43')],_0x2b6d51['filters']),_0xb463d5);if(_0x5ea151[_0xa11d('0x43')][_0xa11d('0x50')]){_0x48c310[_0xa11d('0x4d')]=_[_0xa11d('0x51')](_0x48c310[_0xa11d('0x4d')],{'$or':_['map'](_0xb463d5,function(_0x49e7e3){if(_0x49e7e3['type']!=='VIRTUAL'){var _0x12d803={};_0x12d803[_0x49e7e3[_0xa11d('0x3b')]]={'$like':'%'+_0x5ea151[_0xa11d('0x43')]['filter']+'%'};return _0x12d803;}})});}_0x48c310=_['merge']({},_0x48c310,_0x5ea151[_0xa11d('0x52')]);var _0x2a12e7={'where':_0x48c310[_0xa11d('0x4d')]};return db['FaxMessage'][_0xa11d('0x33')](_0x2a12e7)[_0xa11d('0x23')](function(_0x33ed1a){_0x8b5d2a[_0xa11d('0x33')]=_0x33ed1a;if(_0x5ea151[_0xa11d('0x43')][_0xa11d('0x53')]){_0x48c310[_0xa11d('0x54')]=[{'all':!![]}];}return db[_0xa11d('0x55')]['findAll'](_0x48c310);})[_0xa11d('0x23')](function(_0x584560){_0x8b5d2a[_0xa11d('0x56')]=_0x584560;return _0x8b5d2a;})[_0xa11d('0x23')](respondWithFilteredResult(_0x40732d,_0x48c310))[_0xa11d('0x2c')](handleError(_0x40732d,null));};exports[_0xa11d('0x57')]=function(_0x1feb3c,_0x295652){var _0x3a1605={'raw':!![],'where':{'id':_0x1feb3c[_0xa11d('0x58')]['id']}},_0x9f1b06={};_0x9f1b06[_0xa11d('0x45')]=_[_0xa11d('0x59')](db[_0xa11d('0x55')][_0xa11d('0x3f')]);_0x9f1b06[_0xa11d('0x43')]=_['keys'](_0x1feb3c[_0xa11d('0x43')]);_0x9f1b06[_0xa11d('0x4e')]=_[_0xa11d('0x44')](_0x9f1b06['model'],_0x9f1b06[_0xa11d('0x43')]);_0x3a1605['attributes']=_['intersection'](_0x9f1b06['model'],qs[_0xa11d('0x47')](_0x1feb3c[_0xa11d('0x43')]['fields']));_0x3a1605[_0xa11d('0x46')]=_0x3a1605[_0xa11d('0x46')][_0xa11d('0x48')]?_0x3a1605[_0xa11d('0x46')]:_0x9f1b06[_0xa11d('0x45')];if(_0x1feb3c['query'][_0xa11d('0x53')]){_0x3a1605['include']=[{'all':!![]}];}_0x3a1605=_[_0xa11d('0x51')]({},_0x3a1605,_0x1feb3c['options']);return db[_0xa11d('0x55')][_0xa11d('0x5a')](_0x3a1605)[_0xa11d('0x23')](handleEntityNotFound(_0x295652,null))['then'](respondWithResult(_0x295652,null))[_0xa11d('0x2c')](handleError(_0x295652,null));};exports[_0xa11d('0x37')]=function(_0x245c24,_0x85d89b){if(_0x245c24[_0xa11d('0x5b')]['id']){delete _0x245c24['body']['id'];}return db['FaxMessage'][_0xa11d('0x5a')]({'where':{'id':_0x245c24[_0xa11d('0x58')]['id']}})[_0xa11d('0x23')](handleEntityNotFound(_0x85d89b,null))[_0xa11d('0x23')](saveUpdates(_0x245c24[_0xa11d('0x5b')],null))[_0xa11d('0x23')](respondWithResult(_0x85d89b,null))[_0xa11d('0x2c')](handleError(_0x85d89b,null));};exports[_0xa11d('0x38')]=function(_0x3fa64b,_0x44d707){return db['FaxMessage'][_0xa11d('0x5a')]({'where':{'id':_0x3fa64b[_0xa11d('0x58')]['id']}})[_0xa11d('0x23')](handleEntityNotFound(_0x44d707,null))[_0xa11d('0x23')](removeEntity(_0x44d707,null))[_0xa11d('0x2c')](handleError(_0x44d707,null));};exports[_0xa11d('0x5c')]=function(_0x53ecbc,_0x499f0a){return db['FaxMessage'][_0xa11d('0x5c')]()['then'](respondWithResult(_0x499f0a,null))['catch'](handleError(_0x499f0a,null));};var interaction_log=require(_0xa11d('0x18'))(_0xa11d('0x5d'));exports[_0xa11d('0x5e')]=function(_0x230604,_0x31f014,_0x4e767e){var _0x214e59={'agent':{},'channel':'fax'};if(_0x230604[_0xa11d('0x5b')]['id']){delete _0x230604[_0xa11d('0x5b')]['id'];}_0x230604['body']['read']=!![];_0x230604[_0xa11d('0x5b')][_0xa11d('0x5f')]=moment()[_0xa11d('0x60')](_0xa11d('0x61'));_0x230604['body'][_0xa11d('0x62')]=_0x230604[_0xa11d('0x5b')][_0xa11d('0x62')]||_0x230604['user']['id'];_0x214e59[_0xa11d('0x63')]['id']=_0x230604['body'][_0xa11d('0x62')];return db['FaxMessage'][_0xa11d('0x5a')]({'where':{'id':_0x230604['params']['id'],'UserId':null}})[_0xa11d('0x23')](handleEntityNotFound(_0x31f014,null))[_0xa11d('0x23')](saveUpdates(_0x230604['body'],null))[_0xa11d('0x23')](function(_0x2ced48){if(_0x2ced48){_0x214e59['message']=_0x2ced48[_0xa11d('0x64')]({'plain':!![]});return db[_0xa11d('0x65')][_0xa11d('0x5a')]({'where':{'id':_0x2ced48[_0xa11d('0x66')]}});}return null;})[_0xa11d('0x23')](handleEntityNotFound(_0x31f014,null))['then'](function(_0x106db2){if(_0x106db2){return _0x106db2['update']({'UserId':_0x230604[_0xa11d('0x5b')]['UserId'],'read1stAt':_[_0xa11d('0x67')](_0x106db2[_0xa11d('0x68')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xa11d('0x23')](function(_0x49d1c2){if(_0x49d1c2){_0x214e59[_0xa11d('0x69')]=_0x49d1c2[_0xa11d('0x64')]({'plain':!![]});interaction_log[_0xa11d('0x24')](_0xa11d('0x6a'),_0x230604[_0xa11d('0x6b')]['id'],_0x230604[_0xa11d('0x6b')]['name'],_0x230604[_0xa11d('0x6b')][_0xa11d('0x6c')],_0x214e59[_0xa11d('0x69')]['id'],_0x230604['body']?JSON[_0xa11d('0x6d')](_0x230604[_0xa11d('0x5b')]):'null');return respondWithRpcPromise(_0xa11d('0x6e'),_0xa11d('0x6f'),_0x214e59);}return null;})[_0xa11d('0x23')](function(_0x2879a8){var _0xfd3e15='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2879a8[_0xa11d('0x2a')]['ContactId'];return db[_0xa11d('0x70')][_0xa11d('0x43')](_0xfd3e15,{'type':db[_0xa11d('0x71')]['QueryTypes'][_0xa11d('0x72')],'raw':!![]})[_0xa11d('0x23')](function(_0x4606f4){return _0x4606f4;});})[_0xa11d('0x23')](function(_0x16801a){if(_0x16801a){_0x214e59['message'][_0xa11d('0x73')]=_0x16801a[0x0];if(!_0x230604[_0xa11d('0x5b')][_0xa11d('0x62')])return;return db['User']['find']({'where':{'id':_0x230604[_0xa11d('0x5b')][_0xa11d('0x62')],'role':_0xa11d('0x63')},'attributes':['id',_0xa11d('0x3b'),_0xa11d('0x74'),'email',_0xa11d('0x75')],'raw':!![]});}return null;})[_0xa11d('0x23')](function(_0x452899){if(!_0x452899)return null;_0x214e59[_0xa11d('0x2a')][_0xa11d('0x63')]=_0x452899;return _0x214e59;})[_0xa11d('0x23')](function(_0xd8cb75){if(_0xd8cb75){if(_0x230604['body'][_0xa11d('0x76')]){_0x214e59[_0xa11d('0x2a')]['interface']=util[_0xa11d('0x60')]('SIP/%s',_0x230604[_0xa11d('0x6b')][_0xa11d('0x3b')]);_0x214e59[_0xa11d('0x2a')][_0xa11d('0x77')]=_0x214e59[_0xa11d('0x77')];_0x214e59[_0xa11d('0x2a')]['motionChannel']=_0x214e59[_0xa11d('0x77')];_0x214e59[_0xa11d('0x2a')][_0xa11d('0x78')]='accept';return respondWithRpcPromise(_0xa11d('0x79'),'EventManager',{'event':_0xa11d('0x7a'),'message':_0x214e59[_0xa11d('0x2a')]},client9002)['then'](function(){return _0x214e59;});}return _0x214e59;}return null;})['then'](respondWithResult(_0x31f014,null))[_0xa11d('0x2c')](handleError(_0x31f014,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0xa11d('0x35')]=function(_0x4d044d,_0x2c9290,_0x5c9b4a){var _0x42926a={'agent':{},'channel':_0xa11d('0x7b')};if(_0x4d044d[_0xa11d('0x5b')]['id']){delete _0x4d044d[_0xa11d('0x5b')]['id'];}_0x4d044d[_0xa11d('0x5b')][_0xa11d('0x62')]=_0x4d044d[_0xa11d('0x5b')][_0xa11d('0x62')]||_0x4d044d[_0xa11d('0x6b')]['id'];_0x42926a[_0xa11d('0x63')]['id']=_0x4d044d[_0xa11d('0x5b')]['UserId'];return db[_0xa11d('0x55')][_0xa11d('0x5a')]({'where':{'id':_0x4d044d[_0xa11d('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2c9290,null))[_0xa11d('0x23')](function(_0x5aee7e){if(_0x5aee7e){_0x42926a[_0xa11d('0x2a')]=_0x5aee7e[_0xa11d('0x64')]({'plain':!![]});return db[_0xa11d('0x65')][_0xa11d('0x5a')]({'where':{'id':_0x5aee7e[_0xa11d('0x66')]}});}return null;})[_0xa11d('0x23')](handleEntityNotFound(_0x2c9290,null))['then'](function(_0xe60e47){if(_0xe60e47){_0x42926a[_0xa11d('0x69')]=_0xe60e47[_0xa11d('0x64')]({'plain':!![]});interaction_log['info'](_0xa11d('0x7c'),_0x4d044d['user']['id'],_0x4d044d[_0xa11d('0x6b')][_0xa11d('0x3b')],_0x4d044d[_0xa11d('0x6b')]['role'],_0x42926a[_0xa11d('0x69')]['id'],_0x4d044d[_0xa11d('0x5b')]?JSON[_0xa11d('0x6d')](_0x4d044d['body']):'null');return respondWithRpcPromise(_0xa11d('0x7d'),_0xa11d('0x7e'),_0x42926a);}return null;})[_0xa11d('0x23')](function(_0x128a53){var _0x4119af=_0xa11d('0x7f')+_0x128a53['message'][_0xa11d('0x80')];return db[_0xa11d('0x70')][_0xa11d('0x43')](_0x4119af,{'type':db[_0xa11d('0x71')][_0xa11d('0x81')][_0xa11d('0x72')],'raw':!![]})[_0xa11d('0x23')](function(_0x5bc967){return _0x5bc967;});})[_0xa11d('0x23')](function(_0x5d55c9){if(_0x5d55c9){_0x42926a[_0xa11d('0x2a')]['contact']=_0x5d55c9[0x0];if(!_0x4d044d['body'][_0xa11d('0x62')])return;return db[_0xa11d('0x82')]['find']({'where':{'id':_0x4d044d['body'][_0xa11d('0x62')],'role':_0xa11d('0x63')},'attributes':['id',_0xa11d('0x3b'),'fullname',_0xa11d('0x83'),_0xa11d('0x75')],'raw':!![]});}return null;})['then'](function(_0x56d027){if(!_0x56d027)return null;_0x42926a[_0xa11d('0x2a')][_0xa11d('0x63')]=_0x56d027;return _0x42926a;})[_0xa11d('0x23')](function(_0x2f12a6){if(_0x2f12a6){_0x2f12a6[_0xa11d('0x2a')][_0xa11d('0x84')]=util[_0xa11d('0x60')](_0xa11d('0x85'),_0x4d044d[_0xa11d('0x6b')][_0xa11d('0x3b')]);_0x2f12a6[_0xa11d('0x2a')]['channel']=_0x42926a[_0xa11d('0x77')];_0x2f12a6[_0xa11d('0x2a')][_0xa11d('0x86')]=_0x42926a['channel'];_0x2f12a6['message'][_0xa11d('0x78')]=_0xa11d('0x35');respondWithRpcPromise(_0xa11d('0x79'),_0xa11d('0x79'),{'event':_0xa11d('0x87'),'message':_0x2f12a6[_0xa11d('0x2a')]},client9002);return _0x42926a;}return null;})[_0xa11d('0x23')](respondWithResult(_0x2c9290,null))[_0xa11d('0x2c')](handleError(_0x2c9290,null));};exports[_0xa11d('0x88')]=function(_0x4df7cb,_0x287873){var _0x4cabd9;return db[_0xa11d('0x55')]['create'](_0x4df7cb['body'],{})['then'](function(_0x4fb436){_0x4cabd9=_0x4fb436;return db[_0xa11d('0x89')][_0xa11d('0x8a')]({'where':{'id':_0x4cabd9[_0xa11d('0x80')]}});})['then'](function(_0x279ca7){if(_[_0xa11d('0x67')](_0x279ca7)){return;}else{_0x4cabd9[_0xa11d('0x7b')]=_0x279ca7[_0xa11d('0x7b')];return db['Attachment'][_0xa11d('0x8a')]({'where':{'id':_0x4cabd9[_0xa11d('0x8b')]}});}})['then'](function(_0xcb63d0){return respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_['isNil'](_0x4df7cb[_0xa11d('0x5b')])?undefined:_0x4df7cb['body'][_0xa11d('0x8c')],'path':_[_0xa11d('0x67')](_0xcb63d0)?undefined:util[_0xa11d('0x60')](_0xa11d('0x8d'),_0xcb63d0[_0xa11d('0x8e')]),'fax':_['isNil'](_0x4cabd9['fax'])?undefined:_0x4cabd9[_0xa11d('0x7b')],'AttachmentId':_0x4cabd9['AttachmentId']},client9002);})[_0xa11d('0x23')](respondWithResult(_0x287873,0xc9))['catch'](handleError(_0x287873,null));};exports[_0xa11d('0x8f')]=function(_0x2c14a8,_0x511023){var _0x1f8303=path['join'](config[_0xa11d('0x90')],_0xa11d('0x91'),_0xa11d('0x92'),'attachments');return db[_0xa11d('0x55')][_0xa11d('0x5a')]({'where':{'id':_0x2c14a8[_0xa11d('0x58')]['id']},'include':[{'model':db[_0xa11d('0x93')],'as':'Attachment'}]})[_0xa11d('0x23')](handleEntityNotFound(_0x511023,null))[_0xa11d('0x23')](function(_0x5ba08b){if(_0x5ba08b){return _0x511023[_0xa11d('0x8f')](path[_0xa11d('0x94')](_0x1f8303,_0x5ba08b[_0xa11d('0x93')]['basename']));}})[_0xa11d('0x2c')](handleError(_0x511023,null));};
\ No newline at end of file
+var _0x6ac0=['QueryTypes','contact','User','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','fullname','email','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','server','files','attachments','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','FaxMessage,\x20%s,\x20%s','message','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','end','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','FaxMessage','findAll','rows','show','params','length','options','find','body','destroy','describe','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','format','interaction','user','role','stringify','AcceptMessage','ContactId','sequelize','Sequelize'];(function(_0x1c72ac,_0x380a0e){var _0x274e46=function(_0x1bbadf){while(--_0x1bbadf){_0x1c72ac['push'](_0x1c72ac['shift']());}};_0x274e46(++_0x380a0e);}(_0x6ac0,0x14c));var _0x06ac=function(_0x1dbb65,_0x1b4730){_0x1dbb65=_0x1dbb65-0x0;var _0x30af6e=_0x6ac0[_0x1dbb65];return _0x30af6e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x06ac('0x0'));var zipdir=require(_0x06ac('0x1'));var jsonpatch=require(_0x06ac('0x2'));var rp=require(_0x06ac('0x3'));var moment=require(_0x06ac('0x4'));var BPromise=require(_0x06ac('0x5'));var Mustache=require(_0x06ac('0x6'));var util=require(_0x06ac('0x7'));var path=require(_0x06ac('0x8'));var sox=require('sox');var csv=require(_0x06ac('0x9'));var ejs=require(_0x06ac('0xa'));var fs=require('fs');var fs_extra=require(_0x06ac('0xb'));var _=require(_0x06ac('0xc'));var squel=require('squel');var crypto=require(_0x06ac('0xd'));var jsforce=require(_0x06ac('0xe'));var deskjs=require(_0x06ac('0xf'));var toCsv=require(_0x06ac('0x9'));var querystring=require('querystring');var Papa=require(_0x06ac('0x10'));var Redis=require(_0x06ac('0x11'));var authService=require(_0x06ac('0x12'));var qs=require(_0x06ac('0x13'));var as=require(_0x06ac('0x14'));var hardwareService=require(_0x06ac('0x15'));var logger=require(_0x06ac('0x16'))(_0x06ac('0x17'));var utils=require(_0x06ac('0x18'));var config=require(_0x06ac('0x19'));var licenseUtil=require(_0x06ac('0x1a'));var db=require(_0x06ac('0x1b'))['db'];config[_0x06ac('0x1c')]=_[_0x06ac('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x06ac('0x1e'))(new Redis(config[_0x06ac('0x1c')]));require(_0x06ac('0x1f'))[_0x06ac('0x20')](socket);var jayson=require(_0x06ac('0x21'));var client=jayson[_0x06ac('0x22')]['http']({'port':0x232c});var client9002=jayson[_0x06ac('0x22')][_0x06ac('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x555fae,_0x150a65,_0x118afa,_0x533c0a){return new BPromise(function(_0x5c5df7,_0x264bb2){var _0x38eeed=_0x533c0a||client;return _0x38eeed[_0x06ac('0x24')](_0x555fae,_0x118afa)[_0x06ac('0x25')](function(_0x49bfb6){logger[_0x06ac('0x26')]('FaxMessage,\x20%s,\x20%s',_0x150a65,_0x06ac('0x27'));logger['debug'](_0x06ac('0x28'),_0x150a65,_0x06ac('0x27'),JSON['stringify'](_0x49bfb6));if(_0x49bfb6[_0x06ac('0x29')]){if(_0x49bfb6['error'][_0x06ac('0x2a')]===0x1f4){logger[_0x06ac('0x29')](_0x06ac('0x2b'),_0x150a65,_0x49bfb6[_0x06ac('0x29')][_0x06ac('0x2c')]);return _0x264bb2(_0x49bfb6[_0x06ac('0x29')][_0x06ac('0x2c')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x150a65,_0x49bfb6[_0x06ac('0x29')][_0x06ac('0x2c')]);return _0x5c5df7(_0x49bfb6[_0x06ac('0x29')]['message']);}else{logger['info'](_0x06ac('0x2b'),_0x150a65,_0x06ac('0x27'));_0x5c5df7(_0x49bfb6['result'][_0x06ac('0x2c')]);}})[_0x06ac('0x2d')](function(_0x369de6){logger[_0x06ac('0x29')](_0x06ac('0x2b'),_0x150a65,_0x369de6);_0x264bb2(_0x369de6);});});}function respondWithStatusCode(_0x2ffa15,_0x28f4ae){_0x28f4ae=_0x28f4ae||0xcc;return function(_0xa19c6){if(_0xa19c6){return _0x2ffa15[_0x06ac('0x2e')](_0x28f4ae);}return _0x2ffa15[_0x06ac('0x2f')](_0x28f4ae)['end']();};}function respondWithResult(_0x435278,_0x3cb679){_0x3cb679=_0x3cb679||0xc8;return function(_0x5a3116){if(_0x5a3116){return _0x435278[_0x06ac('0x2f')](_0x3cb679)['json'](_0x5a3116);}};}function respondWithFilteredResult(_0x410d19,_0x239a5e){return function(_0x3a907c){if(_0x3a907c){var _0x2b2b4c=typeof _0x239a5e['offset']===_0x06ac('0x30')&&typeof _0x239a5e[_0x06ac('0x31')]===_0x06ac('0x30');var _0x9cbcf4=_0x3a907c[_0x06ac('0x32')];var _0x4589e8=_0x2b2b4c?0x0:_0x239a5e[_0x06ac('0x33')];var _0x1604d2=_0x2b2b4c?_0x3a907c[_0x06ac('0x32')]:_0x239a5e[_0x06ac('0x33')]+_0x239a5e['limit'];var _0x1b9d4a;if(_0x1604d2>=_0x9cbcf4){_0x1604d2=_0x9cbcf4;_0x1b9d4a=0xc8;}else{_0x1b9d4a=0xce;}_0x410d19['status'](_0x1b9d4a);return _0x410d19[_0x06ac('0x34')](_0x06ac('0x35'),_0x4589e8+'-'+_0x1604d2+'/'+_0x9cbcf4)[_0x06ac('0x36')](_0x3a907c);}return null;};}function patchUpdates(_0xb4cbd6){return function(_0x2f13a0){try{jsonpatch['apply'](_0x2f13a0,_0xb4cbd6,!![]);}catch(_0x4160ed){return BPromise[_0x06ac('0x37')](_0x4160ed);}return _0x2f13a0[_0x06ac('0x38')]();};}function saveUpdates(_0x2fa1df,_0x232ff4){return function(_0x1c3b2f){if(_0x1c3b2f){return _0x1c3b2f[_0x06ac('0x39')](_0x2fa1df)[_0x06ac('0x25')](function(_0x431087){return _0x431087;});}return null;};}function removeEntity(_0x23780c,_0xcf4468){return function(_0x1c9184){if(_0x1c9184){return _0x1c9184['destroy']()[_0x06ac('0x25')](function(){_0x23780c[_0x06ac('0x2f')](0xcc)[_0x06ac('0x3a')]();});}};}function handleEntityNotFound(_0x1a9c47,_0x5083f9){return function(_0x23f200){if(!_0x23f200){_0x1a9c47[_0x06ac('0x2e')](0x194);}return _0x23f200;};}function handleError(_0x3ddcbe,_0x559b8d){_0x559b8d=_0x559b8d||0x1f4;return function(_0x357ada){logger[_0x06ac('0x29')](_0x357ada['stack']);if(_0x357ada['name']){delete _0x357ada[_0x06ac('0x3b')];}_0x3ddcbe[_0x06ac('0x2f')](_0x559b8d)[_0x06ac('0x3c')](_0x357ada);};}exports[_0x06ac('0x3d')]=function(_0x593785,_0x3010f2){var _0x85dbcc={},_0x77da1b={},_0x524632={'count':0x0,'rows':[]};var _0x206df6=_['map'](db['FaxMessage'][_0x06ac('0x3e')],function(_0x342254){return{'name':_0x342254[_0x06ac('0x3f')],'type':_0x342254[_0x06ac('0x40')][_0x06ac('0x41')]};});_0x77da1b[_0x06ac('0x42')]=_[_0x06ac('0x43')](_0x206df6,_0x06ac('0x3b'));_0x77da1b[_0x06ac('0x44')]=_[_0x06ac('0x45')](_0x593785[_0x06ac('0x44')]);_0x77da1b['filters']=_[_0x06ac('0x46')](_0x77da1b[_0x06ac('0x42')],_0x77da1b[_0x06ac('0x44')]);_0x85dbcc[_0x06ac('0x47')]=_[_0x06ac('0x46')](_0x77da1b[_0x06ac('0x42')],qs['fields'](_0x593785[_0x06ac('0x44')][_0x06ac('0x48')]));_0x85dbcc['attributes']=_0x85dbcc[_0x06ac('0x47')]['length']?_0x85dbcc['attributes']:_0x77da1b[_0x06ac('0x42')];if(!_0x593785[_0x06ac('0x44')][_0x06ac('0x49')](_0x06ac('0x4a'))){_0x85dbcc[_0x06ac('0x31')]=qs['limit'](_0x593785[_0x06ac('0x44')][_0x06ac('0x31')]);_0x85dbcc[_0x06ac('0x33')]=qs['offset'](_0x593785[_0x06ac('0x44')][_0x06ac('0x33')]);}_0x85dbcc['order']=qs[_0x06ac('0x4b')](_0x593785[_0x06ac('0x44')]['sort']);_0x85dbcc[_0x06ac('0x4c')]=qs['filters'](_[_0x06ac('0x4d')](_0x593785['query'],_0x77da1b[_0x06ac('0x4e')]),_0x206df6);if(_0x593785[_0x06ac('0x44')][_0x06ac('0x4f')]){_0x85dbcc['where']=_[_0x06ac('0x50')](_0x85dbcc[_0x06ac('0x4c')],{'$or':_[_0x06ac('0x43')](_0x206df6,function(_0x1739fb){if(_0x1739fb[_0x06ac('0x40')]!==_0x06ac('0x51')){var _0x1f83ca={};_0x1f83ca[_0x1739fb[_0x06ac('0x3b')]]={'$like':'%'+_0x593785[_0x06ac('0x44')][_0x06ac('0x4f')]+'%'};return _0x1f83ca;}})});}_0x85dbcc=_[_0x06ac('0x50')]({},_0x85dbcc,_0x593785['options']);var _0x16bc82={'where':_0x85dbcc[_0x06ac('0x4c')]};return db['FaxMessage'][_0x06ac('0x32')](_0x16bc82)[_0x06ac('0x25')](function(_0x263b38){_0x524632[_0x06ac('0x32')]=_0x263b38;if(_0x593785[_0x06ac('0x44')][_0x06ac('0x52')]){_0x85dbcc[_0x06ac('0x53')]=[{'all':!![]}];}return db[_0x06ac('0x54')][_0x06ac('0x55')](_0x85dbcc);})[_0x06ac('0x25')](function(_0x4a7f8a){_0x524632[_0x06ac('0x56')]=_0x4a7f8a;return _0x524632;})[_0x06ac('0x25')](respondWithFilteredResult(_0x3010f2,_0x85dbcc))['catch'](handleError(_0x3010f2,null));};exports[_0x06ac('0x57')]=function(_0x2f94ea,_0x2475ce){var _0x404025={'raw':!![],'where':{'id':_0x2f94ea[_0x06ac('0x58')]['id']}},_0x221e0b={};_0x221e0b[_0x06ac('0x42')]=_['keys'](db[_0x06ac('0x54')][_0x06ac('0x3e')]);_0x221e0b[_0x06ac('0x44')]=_[_0x06ac('0x45')](_0x2f94ea[_0x06ac('0x44')]);_0x221e0b['filters']=_[_0x06ac('0x46')](_0x221e0b[_0x06ac('0x42')],_0x221e0b[_0x06ac('0x44')]);_0x404025['attributes']=_[_0x06ac('0x46')](_0x221e0b[_0x06ac('0x42')],qs['fields'](_0x2f94ea['query'][_0x06ac('0x48')]));_0x404025['attributes']=_0x404025['attributes'][_0x06ac('0x59')]?_0x404025[_0x06ac('0x47')]:_0x221e0b[_0x06ac('0x42')];if(_0x2f94ea['query'][_0x06ac('0x52')]){_0x404025[_0x06ac('0x53')]=[{'all':!![]}];}_0x404025=_[_0x06ac('0x50')]({},_0x404025,_0x2f94ea[_0x06ac('0x5a')]);return db[_0x06ac('0x54')][_0x06ac('0x5b')](_0x404025)[_0x06ac('0x25')](handleEntityNotFound(_0x2475ce,null))['then'](respondWithResult(_0x2475ce,null))['catch'](handleError(_0x2475ce,null));};exports[_0x06ac('0x39')]=function(_0x154dbb,_0xa2d5f3){if(_0x154dbb[_0x06ac('0x5c')]['id']){delete _0x154dbb['body']['id'];}return db[_0x06ac('0x54')][_0x06ac('0x5b')]({'where':{'id':_0x154dbb['params']['id']}})['then'](handleEntityNotFound(_0xa2d5f3,null))[_0x06ac('0x25')](saveUpdates(_0x154dbb[_0x06ac('0x5c')],null))['then'](respondWithResult(_0xa2d5f3,null))['catch'](handleError(_0xa2d5f3,null));};exports[_0x06ac('0x5d')]=function(_0x54c896,_0x322118){return db[_0x06ac('0x54')][_0x06ac('0x5b')]({'where':{'id':_0x54c896['params']['id']}})[_0x06ac('0x25')](handleEntityNotFound(_0x322118,null))[_0x06ac('0x25')](removeEntity(_0x322118,null))[_0x06ac('0x2d')](handleError(_0x322118,null));};exports['describe']=function(_0x805188,_0x3c9309){return db[_0x06ac('0x54')][_0x06ac('0x5e')]()[_0x06ac('0x25')](respondWithResult(_0x3c9309,null))[_0x06ac('0x2d')](handleError(_0x3c9309,null));};var interaction_log=require(_0x06ac('0x16'))('fax-interactions');exports[_0x06ac('0x5f')]=function(_0x5987fc,_0x5778a1,_0x4b5bbc){var _0x519d8e={'agent':{},'channel':_0x06ac('0x60')};if(_0x5987fc['body']['id']){delete _0x5987fc[_0x06ac('0x5c')]['id'];}_0x5987fc[_0x06ac('0x5c')]['read']=!![];_0x5987fc['body'][_0x06ac('0x61')]=moment()['format'](_0x06ac('0x62'));_0x5987fc[_0x06ac('0x5c')]['UserId']=_0x5987fc[_0x06ac('0x5c')][_0x06ac('0x63')]||_0x5987fc['user']['id'];_0x519d8e[_0x06ac('0x64')]['id']=_0x5987fc[_0x06ac('0x5c')][_0x06ac('0x63')];return db[_0x06ac('0x54')][_0x06ac('0x5b')]({'where':{'id':_0x5987fc['params']['id'],'UserId':null}})[_0x06ac('0x25')](handleEntityNotFound(_0x5778a1,null))[_0x06ac('0x25')](saveUpdates(_0x5987fc[_0x06ac('0x5c')],null))[_0x06ac('0x25')](function(_0x52206e){if(_0x52206e){_0x519d8e[_0x06ac('0x2c')]=_0x52206e[_0x06ac('0x65')]({'plain':!![]});return db[_0x06ac('0x66')][_0x06ac('0x5b')]({'where':{'id':_0x52206e[_0x06ac('0x67')]}});}return null;})[_0x06ac('0x25')](handleEntityNotFound(_0x5778a1,null))[_0x06ac('0x25')](function(_0x5c5788){if(_0x5c5788){return _0x5c5788[_0x06ac('0x39')]({'UserId':_0x5987fc['body'][_0x06ac('0x63')],'read1stAt':_[_0x06ac('0x68')](_0x5c5788[_0x06ac('0x69')])?moment()[_0x06ac('0x6a')](_0x06ac('0x62')):undefined});}return null;})[_0x06ac('0x25')](function(_0x1af812){if(_0x1af812){_0x519d8e[_0x06ac('0x6b')]=_0x1af812[_0x06ac('0x65')]({'plain':!![]});interaction_log[_0x06ac('0x26')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5987fc[_0x06ac('0x6c')]['id'],_0x5987fc[_0x06ac('0x6c')][_0x06ac('0x3b')],_0x5987fc[_0x06ac('0x6c')][_0x06ac('0x6d')],_0x519d8e['interaction']['id'],_0x5987fc[_0x06ac('0x5c')]?JSON[_0x06ac('0x6e')](_0x5987fc[_0x06ac('0x5c')]):'null');return respondWithRpcPromise(_0x06ac('0x6f'),'acceptMessage',_0x519d8e);}return null;})[_0x06ac('0x25')](function(_0x455fd9){var _0x59b074='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x455fd9[_0x06ac('0x2c')][_0x06ac('0x70')];return db[_0x06ac('0x71')][_0x06ac('0x44')](_0x59b074,{'type':db[_0x06ac('0x72')][_0x06ac('0x73')]['SELECT'],'raw':!![]})[_0x06ac('0x25')](function(_0x30860d){return _0x30860d;});})['then'](function(_0x2b779d){if(_0x2b779d){_0x519d8e[_0x06ac('0x2c')][_0x06ac('0x74')]=_0x2b779d[0x0];if(!_0x5987fc['body'][_0x06ac('0x63')])return;return db[_0x06ac('0x75')][_0x06ac('0x5b')]({'where':{'id':_0x5987fc[_0x06ac('0x5c')][_0x06ac('0x63')],'role':_0x06ac('0x64')},'attributes':['id','name','fullname','email',_0x06ac('0x76')],'raw':!![]});}return null;})[_0x06ac('0x25')](function(_0x3d2046){if(!_0x3d2046)return null;_0x519d8e[_0x06ac('0x2c')][_0x06ac('0x64')]=_0x3d2046;return _0x519d8e;})[_0x06ac('0x25')](function(_0x1d917d){if(_0x1d917d){if(_0x5987fc['body']['manual']){_0x519d8e['message'][_0x06ac('0x77')]=util[_0x06ac('0x6a')](_0x06ac('0x78'),_0x5987fc[_0x06ac('0x6c')][_0x06ac('0x3b')]);_0x519d8e[_0x06ac('0x2c')][_0x06ac('0x79')]=_0x519d8e['channel'];_0x519d8e[_0x06ac('0x2c')][_0x06ac('0x7a')]=_0x519d8e['channel'];_0x519d8e[_0x06ac('0x2c')][_0x06ac('0x7b')]=_0x06ac('0x5f');return respondWithRpcPromise(_0x06ac('0x7c'),_0x06ac('0x7c'),{'event':_0x06ac('0x7d'),'message':_0x519d8e[_0x06ac('0x2c')]},client9002)[_0x06ac('0x25')](function(){return _0x519d8e;});}return _0x519d8e;}return null;})[_0x06ac('0x25')](respondWithResult(_0x5778a1,null))[_0x06ac('0x2d')](handleError(_0x5778a1,null));};var interaction_log=require('../../config/logger')(_0x06ac('0x7e'));exports[_0x06ac('0x37')]=function(_0x239667,_0x4a95e8,_0x33248b){var _0xa32b32={'agent':{},'channel':'fax'};if(_0x239667[_0x06ac('0x5c')]['id']){delete _0x239667[_0x06ac('0x5c')]['id'];}_0x239667[_0x06ac('0x5c')][_0x06ac('0x63')]=_0x239667[_0x06ac('0x5c')]['UserId']||_0x239667['user']['id'];_0xa32b32['agent']['id']=_0x239667[_0x06ac('0x5c')][_0x06ac('0x63')];return db[_0x06ac('0x54')][_0x06ac('0x5b')]({'where':{'id':_0x239667[_0x06ac('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4a95e8,null))[_0x06ac('0x25')](function(_0x300644){if(_0x300644){_0xa32b32[_0x06ac('0x2c')]=_0x300644[_0x06ac('0x65')]({'plain':!![]});return db[_0x06ac('0x66')][_0x06ac('0x5b')]({'where':{'id':_0x300644['FaxInteractionId']}});}return null;})[_0x06ac('0x25')](handleEntityNotFound(_0x4a95e8,null))[_0x06ac('0x25')](function(_0x5099de){if(_0x5099de){_0xa32b32[_0x06ac('0x6b')]=_0x5099de[_0x06ac('0x65')]({'plain':!![]});interaction_log[_0x06ac('0x26')](_0x06ac('0x7f'),_0x239667[_0x06ac('0x6c')]['id'],_0x239667['user'][_0x06ac('0x3b')],_0x239667[_0x06ac('0x6c')][_0x06ac('0x6d')],_0xa32b32[_0x06ac('0x6b')]['id'],_0x239667[_0x06ac('0x5c')]?JSON[_0x06ac('0x6e')](_0x239667[_0x06ac('0x5c')]):_0x06ac('0x80'));return respondWithRpcPromise(_0x06ac('0x81'),_0x06ac('0x82'),_0xa32b32);}return null;})[_0x06ac('0x25')](function(_0x233e4b){var _0x4dc88b=_0x06ac('0x83')+_0x233e4b[_0x06ac('0x2c')][_0x06ac('0x70')];return db[_0x06ac('0x71')][_0x06ac('0x44')](_0x4dc88b,{'type':db[_0x06ac('0x72')][_0x06ac('0x73')]['SELECT'],'raw':!![]})[_0x06ac('0x25')](function(_0x58662a){return _0x58662a;});})[_0x06ac('0x25')](function(_0x3d0411){if(_0x3d0411){_0xa32b32[_0x06ac('0x2c')][_0x06ac('0x74')]=_0x3d0411[0x0];if(!_0x239667['body'][_0x06ac('0x63')])return;return db['User']['find']({'where':{'id':_0x239667['body'][_0x06ac('0x63')],'role':'agent'},'attributes':['id','name',_0x06ac('0x84'),_0x06ac('0x85'),_0x06ac('0x76')],'raw':!![]});}return null;})[_0x06ac('0x25')](function(_0x212035){if(!_0x212035)return null;_0xa32b32[_0x06ac('0x2c')]['agent']=_0x212035;return _0xa32b32;})[_0x06ac('0x25')](function(_0xce6f9d){if(_0xce6f9d){_0xce6f9d[_0x06ac('0x2c')][_0x06ac('0x77')]=util['format']('SIP/%s',_0x239667[_0x06ac('0x6c')]['name']);_0xce6f9d[_0x06ac('0x2c')][_0x06ac('0x79')]=_0xa32b32[_0x06ac('0x79')];_0xce6f9d[_0x06ac('0x2c')][_0x06ac('0x7a')]=_0xa32b32[_0x06ac('0x79')];_0xce6f9d[_0x06ac('0x2c')][_0x06ac('0x7b')]='reject';respondWithRpcPromise(_0x06ac('0x7c'),'EventManager',{'event':_0x06ac('0x86'),'message':_0xce6f9d['message']},client9002);return _0xa32b32;}return null;})['then'](respondWithResult(_0x4a95e8,null))[_0x06ac('0x2d')](handleError(_0x4a95e8,null));};exports[_0x06ac('0x87')]=function(_0x41c512,_0x47db76){var _0x10b2bc;return db[_0x06ac('0x54')][_0x06ac('0x87')](_0x41c512[_0x06ac('0x5c')],{})[_0x06ac('0x25')](function(_0x35830b){_0x10b2bc=_0x35830b;return db[_0x06ac('0x88')][_0x06ac('0x89')]({'where':{'id':_0x10b2bc[_0x06ac('0x70')]}});})[_0x06ac('0x25')](function(_0x4e3692){if(_[_0x06ac('0x68')](_0x4e3692)){return;}else{_0x10b2bc[_0x06ac('0x60')]=_0x4e3692['fax'];return db[_0x06ac('0x8a')]['findOne']({'where':{'id':_0x10b2bc[_0x06ac('0x8b')]}});}})[_0x06ac('0x25')](function(_0x27fe7f){return respondWithRpcPromise('SendFax',_0x06ac('0x8c'),{'FaxAccountId':_[_0x06ac('0x68')](_0x41c512['body'])?undefined:_0x41c512[_0x06ac('0x5c')][_0x06ac('0x8d')],'path':_['isNil'](_0x27fe7f)?undefined:util[_0x06ac('0x6a')](_0x06ac('0x8e'),_0x27fe7f[_0x06ac('0x8f')]),'fax':_['isNil'](_0x10b2bc[_0x06ac('0x60')])?undefined:_0x10b2bc[_0x06ac('0x60')],'AttachmentId':_0x10b2bc[_0x06ac('0x8b')]},client9002);})[_0x06ac('0x25')](respondWithResult(_0x47db76,0xc9))[_0x06ac('0x2d')](handleError(_0x47db76,null));};exports[_0x06ac('0x90')]=function(_0xb1c2fd,_0x3cd929){var _0x2c87aa=path[_0x06ac('0x91')](config['root'],_0x06ac('0x92'),_0x06ac('0x93'),_0x06ac('0x94'));return db[_0x06ac('0x54')]['find']({'where':{'id':_0xb1c2fd[_0x06ac('0x58')]['id']},'include':[{'model':db[_0x06ac('0x8a')],'as':_0x06ac('0x8a')}]})[_0x06ac('0x25')](handleEntityNotFound(_0x3cd929,null))[_0x06ac('0x25')](function(_0x2bde0e){if(_0x2bde0e){return _0x3cd929['download'](path[_0x06ac('0x91')](_0x2c87aa,_0x2bde0e[_0x06ac('0x8a')][_0x06ac('0x8f')]));}})[_0x06ac('0x2d')](handleError(_0x3cd929,null));};
\ No newline at end of file
index 642224f..9da6673 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb931=['remove','emit','hasOwnProperty','hook','exports','FaxMessage','update'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xb931,0x155));var _0x1b93=function(_0x2f1ec3,_0x2620e3){_0x2f1ec3=_0x2f1ec3-0x0;var _0x53dfbc=_0xb931[_0x2f1ec3];return _0x53dfbc;};'use strict';var EventEmitter=require('events');var FaxMessage=require('../../mysqldb')['db'][_0x1b93('0x0')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1b93('0x1'),'afterDestroy':_0x1b93('0x2')};function emitEvent(_0x2d11a5){return function(_0x42a943,_0x1c8b77,_0xa36141){FaxMessageEvents[_0x1b93('0x3')](_0x2d11a5+':'+_0x42a943['id'],_0x42a943);FaxMessageEvents[_0x1b93('0x3')](_0x2d11a5,_0x42a943);_0xa36141(null);};}for(var e in events){if(events[_0x1b93('0x4')](e)){var event=events[e];FaxMessage[_0x1b93('0x5')](e,emitEvent(event));}}module[_0x1b93('0x6')]=FaxMessageEvents;
\ No newline at end of file
+var _0xdcfa=['hook','exports','events','FaxMessage','save','update','remove','emit','hasOwnProperty'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xdcfa,0xad));var _0xadcf=function(_0x57d53b,_0x4b0c2f){_0x57d53b=_0x57d53b-0x0;var _0x13a2df=_0xdcfa[_0x57d53b];return _0x13a2df;};'use strict';var EventEmitter=require(_0xadcf('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0xadcf('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xadcf('0x2'),'afterUpdate':_0xadcf('0x3'),'afterDestroy':_0xadcf('0x4')};function emitEvent(_0x3ef7a3){return function(_0x2575ce,_0x2f0c66,_0x3081a5){FaxMessageEvents[_0xadcf('0x5')](_0x3ef7a3+':'+_0x2575ce['id'],_0x2575ce);FaxMessageEvents[_0xadcf('0x5')](_0x3ef7a3,_0x2575ce);_0x3081a5(null);};}for(var e in events){if(events[_0xadcf('0x6')](e)){var event=events[e];FaxMessage[_0xadcf('0x7')](e,emitEvent(event));}}module[_0xadcf('0x8')]=FaxMessageEvents;
\ No newline at end of file
index d9e1716..8bc56f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00a7=['../../config/environment','./faxMessage.attributes','FaxMessage','fax_messages','FULLTEXT','direction','toLowerCase','out','secret','UserId','FaxInteraction','findOne','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x4d0662,_0x145963){var _0x6eea6d=function(_0x2def06){while(--_0x2def06){_0x4d0662['push'](_0x4d0662['shift']());}};_0x6eea6d(++_0x145963);}(_0x00a7,0x8e));var _0x700a=function(_0xade8f0,_0x133c0e){_0xade8f0=_0xade8f0-0x0;var _0x14280c=_0x00a7[_0xade8f0];return _0x14280c;};'use strict';var _=require(_0x700a('0x0'));var util=require(_0x700a('0x1'));var logger=require(_0x700a('0x2'))(_0x700a('0x3'));var moment=require(_0x700a('0x4'));var BPromise=require(_0x700a('0x5'));var rp=require(_0x700a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x700a('0x7'));var config=require(_0x700a('0x8'));var attributes=require(_0x700a('0x9'));module['exports']=function(_0x1f72e5,_0x4c88a0){return _0x1f72e5['define'](_0x700a('0xa'),attributes,{'tableName':_0x700a('0xb'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':['body'],'type':_0x700a('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x403cf7,_0x21d65,_0x5903a1){var _0x46b896=_0x1f72e5['models'];var _0x186dd4=_0x403cf7['get']({'plain':!![]});if(_0x186dd4[_0x700a('0xd')][_0x700a('0xe')]()==='in'||_0x186dd4[_0x700a('0xd')]['toLowerCase']()===_0x700a('0xf')&&!_0x186dd4[_0x700a('0x10')]&&!_['isNil'](_0x186dd4[_0x700a('0x11')])){_0x46b896[_0x700a('0x12')][_0x700a('0x13')]({'where':{'id':_0x186dd4['FaxInteractionId']}})['then'](function(_0x405803){if(_0x405803){_0x405803[_0x700a('0x14')]({'lastMsgAt':_0x186dd4[_0x700a('0x15')],'lastMsgDirection':_0x186dd4['direction'][_0x700a('0xe')]()});}})['catch'](function(_0x127c84){console[_0x700a('0x16')](_0x127c84);});}_0x5903a1();}},'charset':_0x700a('0x17'),'collate':_0x700a('0x18')});};
\ No newline at end of file
+var _0xd41b=['update','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','toLowerCase','direction','out','secret','isNil','FaxInteraction'];(function(_0x480ff9,_0x51b350){var _0x251d16=function(_0x579e6f){while(--_0x579e6f){_0x480ff9['push'](_0x480ff9['shift']());}};_0x251d16(++_0x51b350);}(_0xd41b,0xba));var _0xbd41=function(_0x500b52,_0x33446f){_0x500b52=_0x500b52-0x0;var _0x41ca48=_0xd41b[_0x500b52];return _0x41ca48;};'use strict';var _=require(_0xbd41('0x0'));var util=require(_0xbd41('0x1'));var logger=require(_0xbd41('0x2'))(_0xbd41('0x3'));var moment=require('moment');var BPromise=require(_0xbd41('0x4'));var rp=require(_0xbd41('0x5'));var fs=require('fs');var path=require(_0xbd41('0x6'));var rimraf=require(_0xbd41('0x7'));var config=require(_0xbd41('0x8'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x17f701,_0x5abd05){return _0x17f701[_0xbd41('0x9')](_0xbd41('0xa'),attributes,{'tableName':_0xbd41('0xb'),'paranoid':![],'indexes':[{'name':_0xbd41('0xc'),'fields':[_0xbd41('0xd')],'type':_0xbd41('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5dd160,_0x110a21,_0x2380bf){var _0xa3d087=_0x17f701[_0xbd41('0xf')];var _0x441c44=_0x5dd160['get']({'plain':!![]});if(_0x441c44['direction'][_0xbd41('0x10')]()==='in'||_0x441c44[_0xbd41('0x11')][_0xbd41('0x10')]()===_0xbd41('0x12')&&!_0x441c44[_0xbd41('0x13')]&&!_[_0xbd41('0x14')](_0x441c44['UserId'])){_0xa3d087[_0xbd41('0x15')]['findOne']({'where':{'id':_0x441c44['FaxInteractionId']}})['then'](function(_0x586348){if(_0x586348){_0x586348[_0xbd41('0x16')]({'lastMsgAt':_0x441c44['createdAt'],'lastMsgDirection':_0x441c44[_0xbd41('0x11')][_0xbd41('0x10')]()});}})['catch'](function(_0x546551){console[_0xbd41('0x17')](_0x546551);});}_0x2380bf();}},'charset':_0xbd41('0x18'),'collate':_0xbd41('0x19')});};
\ No newline at end of file
index a05c13d..3bb736f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x207c=['result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','attributes','limit','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','redis','defaults','localhost','socket.io-emitter','register','info','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message'];(function(_0xa77c1b,_0x473a68){var _0x3b2b36=function(_0x33dbbe){while(--_0x33dbbe){_0xa77c1b['push'](_0xa77c1b['shift']());}};_0x3b2b36(++_0x473a68);}(_0x207c,0x1e8));var _0xc207=function(_0x4e0026,_0x2b52b6){_0x4e0026=_0x4e0026-0x0;var _0x3f8ee7=_0x207c[_0x4e0026];return _0x3f8ee7;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var moment=require(_0xc207('0x1'));var BPromise=require(_0xc207('0x2'));var rs=require(_0xc207('0x3'));var fs=require('fs');var Redis=require(_0xc207('0x4'));var db=require(_0xc207('0x5'))['db'];var utils=require(_0xc207('0x6'));var logger=require('../../config/logger')(_0xc207('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc207('0x8')]({'port':0x232a});config[_0xc207('0x9')]=_[_0xc207('0xa')](config['redis'],{'host':_0xc207('0xb'),'port':0x18eb});var socket=require(_0xc207('0xc'))(new Redis(config[_0xc207('0x9')]));require('./faxMessage.socket')[_0xc207('0xd')](socket);function respondWithRpcPromise(_0x817576,_0x216e14,_0x13ec41){return new BPromise(function(_0x201162,_0x347549){return client['request'](_0x817576,_0x13ec41)['then'](function(_0x5b556f){logger[_0xc207('0xe')]('FaxMessage,\x20%s,\x20%s',_0x216e14,_0xc207('0xf'));logger[_0xc207('0x10')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x216e14,_0xc207('0xf'),JSON[_0xc207('0x11')](_0x5b556f));if(_0x5b556f[_0xc207('0x12')]){if(_0x5b556f[_0xc207('0x12')][_0xc207('0x13')]===0x1f4){logger['error'](_0xc207('0x14'),_0x216e14,_0x5b556f[_0xc207('0x12')][_0xc207('0x15')]);return _0x347549(_0x5b556f[_0xc207('0x12')]['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x216e14,_0x5b556f[_0xc207('0x12')][_0xc207('0x15')]);return _0x201162(_0x5b556f[_0xc207('0x12')][_0xc207('0x15')]);}else{logger['info'](_0xc207('0x14'),_0x216e14,_0xc207('0xf'));_0x201162(_0x5b556f[_0xc207('0x16')]['message']);}})[_0xc207('0x17')](function(_0x488cc0){logger[_0xc207('0x12')](_0xc207('0x14'),_0x216e14,_0x488cc0);_0x347549(_0x488cc0);});});}exports[_0xc207('0x18')]=function(_0x461f6a){var _0xce0770=this;return new Promise(function(_0x2caec5,_0x35c0b0){return db[_0xc207('0x19')][_0xc207('0x1a')](_0x461f6a[_0xc207('0x1b')],{'raw':_0x461f6a[_0xc207('0x1c')]?_0x461f6a[_0xc207('0x1c')][_0xc207('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x163b36){logger['info'](_0xc207('0x18'),_0x461f6a);logger[_0xc207('0x10')](_0xc207('0x18'),_0x461f6a,JSON[_0xc207('0x11')](_0x163b36));_0x2caec5(_0x163b36);})[_0xc207('0x17')](function(_0xd209ac){logger[_0xc207('0x12')](_0xc207('0x18'),_0xd209ac[_0xc207('0x15')],_0x461f6a);_0x35c0b0(_0xce0770[_0xc207('0x12')](0x1f4,_0xd209ac[_0xc207('0x15')]));});});};exports[_0xc207('0x1e')]=function(_0x3f738e){var _0x138970=this;return new Promise(function(_0x1445d3,_0x56a066){return db[_0xc207('0x19')]['update'](_0x3f738e['body'],{'raw':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')][_0xc207('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')]['where']||null:null,'attributes':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')][_0xc207('0x1f')]||null:null,'limit':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')][_0xc207('0x20')]||null:null})[_0xc207('0x21')](function(_0x27bc72){logger[_0xc207('0xe')](_0xc207('0x1e'),_0x3f738e);logger[_0xc207('0x10')](_0xc207('0x1e'),_0x3f738e,JSON[_0xc207('0x11')](_0x27bc72));_0x1445d3(_0x27bc72);})['catch'](function(_0x1cc799){logger[_0xc207('0x12')](_0xc207('0x1e'),_0x1cc799[_0xc207('0x15')],_0x3f738e);_0x56a066(_0x138970[_0xc207('0x12')](0x1f4,_0x1cc799[_0xc207('0x15')]));});});};
\ No newline at end of file
+var _0x00bb=['redis','defaults','localhost','socket.io-emitter','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','FaxMessage,\x20%s,\x20%s','CreateFaxMessage','FaxMessage','create','body','options','raw','catch','update','attributes','UpdateFaxMessage','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x2a4c25,_0x3f3047){var _0x1288e2=function(_0x1b34ed){while(--_0x1b34ed){_0x2a4c25['push'](_0x2a4c25['shift']());}};_0x1288e2(++_0x3f3047);}(_0x00bb,0x1d8));var _0xb00b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x00bb[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xb00b('0x8')]=_[_0xb00b('0x9')](config[_0xb00b('0x8')],{'host':_0xb00b('0xa'),'port':0x18eb});var socket=require(_0xb00b('0xb'))(new Redis(config[_0xb00b('0x8')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x5154d9,_0x1e9b7b,_0x5851d4){return new BPromise(function(_0x46a25c,_0x28d3cc){return client['request'](_0x5154d9,_0x5851d4)[_0xb00b('0xc')](function(_0x5a63ed){logger['info']('FaxMessage,\x20%s,\x20%s',_0x1e9b7b,_0xb00b('0xd'));logger[_0xb00b('0xe')](_0xb00b('0xf'),_0x1e9b7b,_0xb00b('0xd'),JSON[_0xb00b('0x10')](_0x5a63ed));if(_0x5a63ed[_0xb00b('0x11')]){if(_0x5a63ed['error'][_0xb00b('0x12')]===0x1f4){logger[_0xb00b('0x11')]('FaxMessage,\x20%s,\x20%s',_0x1e9b7b,_0x5a63ed[_0xb00b('0x11')][_0xb00b('0x13')]);return _0x28d3cc(_0x5a63ed['error']['message']);}logger[_0xb00b('0x11')]('FaxMessage,\x20%s,\x20%s',_0x1e9b7b,_0x5a63ed['error'][_0xb00b('0x13')]);return _0x46a25c(_0x5a63ed[_0xb00b('0x11')][_0xb00b('0x13')]);}else{logger[_0xb00b('0x14')]('FaxMessage,\x20%s,\x20%s',_0x1e9b7b,_0xb00b('0xd'));_0x46a25c(_0x5a63ed['result'][_0xb00b('0x13')]);}})['catch'](function(_0x25d7a0){logger['error'](_0xb00b('0x15'),_0x1e9b7b,_0x25d7a0);_0x28d3cc(_0x25d7a0);});});}exports[_0xb00b('0x16')]=function(_0x53ee68){var _0x55770c=this;return new Promise(function(_0x2b0da1,_0x4a334b){return db[_0xb00b('0x17')][_0xb00b('0x18')](_0x53ee68[_0xb00b('0x19')],{'raw':_0x53ee68[_0xb00b('0x1a')]?_0x53ee68['options'][_0xb00b('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x25a973){logger[_0xb00b('0x14')]('CreateFaxMessage',_0x53ee68);logger[_0xb00b('0xe')](_0xb00b('0x16'),_0x53ee68,JSON['stringify'](_0x25a973));_0x2b0da1(_0x25a973);})[_0xb00b('0x1c')](function(_0x1f04d3){logger['error'](_0xb00b('0x16'),_0x1f04d3[_0xb00b('0x13')],_0x53ee68);_0x4a334b(_0x55770c[_0xb00b('0x11')](0x1f4,_0x1f04d3[_0xb00b('0x13')]));});});};exports['UpdateFaxMessage']=function(_0x50be6c){var _0x3785e9=this;return new Promise(function(_0x490380,_0x550587){return db['FaxMessage'][_0xb00b('0x1d')](_0x50be6c[_0xb00b('0x19')],{'raw':_0x50be6c[_0xb00b('0x1a')]?_0x50be6c[_0xb00b('0x1a')][_0xb00b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50be6c[_0xb00b('0x1a')]?_0x50be6c[_0xb00b('0x1a')]['where']||null:null,'attributes':_0x50be6c[_0xb00b('0x1a')]?_0x50be6c['options'][_0xb00b('0x1e')]||null:null,'limit':_0x50be6c[_0xb00b('0x1a')]?_0x50be6c[_0xb00b('0x1a')]['limit']||null:null})[_0xb00b('0xc')](function(_0x280ed3){logger[_0xb00b('0x14')](_0xb00b('0x1f'),_0x50be6c);logger[_0xb00b('0xe')](_0xb00b('0x1f'),_0x50be6c,JSON[_0xb00b('0x10')](_0x280ed3));_0x490380(_0x280ed3);})[_0xb00b('0x1c')](function(_0x149c1a){logger['error'](_0xb00b('0x1f'),_0x149c1a[_0xb00b('0x13')],_0x50be6c);_0x550587(_0x3785e9['error'](0x1f4,_0x149c1a[_0xb00b('0x13')]));});});};
\ No newline at end of file
index eba5a4b..1d95c0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed20=['faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x120868,_0x14f1f5){var _0x3885cb=function(_0x7e3c50){while(--_0x7e3c50){_0x120868['push'](_0x120868['shift']());}};_0x3885cb(++_0x14f1f5);}(_0xed20,0x172));var _0x0ed2=function(_0x26c930,_0x409029){_0x26c930=_0x26c930-0x0;var _0x223f96=_0xed20[_0x26c930];return _0x223f96;};'use strict';var FaxMessageEvents=require(_0x0ed2('0x0'));var events=[_0x0ed2('0x1'),_0x0ed2('0x2'),_0x0ed2('0x3')];function createListener(_0x58b6f0,_0x5a333a){return function(_0x18d67c){_0x5a333a[_0x0ed2('0x4')](_0x58b6f0,_0x18d67c);};}function removeListener(_0x5b22c8,_0x4c88d3){return function(){FaxMessageEvents[_0x0ed2('0x5')](_0x5b22c8,_0x4c88d3);};}exports[_0x0ed2('0x6')]=function(_0x564b99){for(var _0x46b5e1=0x0,_0x1793c0=events[_0x0ed2('0x7')];_0x46b5e1<_0x1793c0;_0x46b5e1++){var _0xba87be=events[_0x46b5e1];var _0x48b355=createListener(_0x0ed2('0x8')+_0xba87be,_0x564b99);FaxMessageEvents['on'](_0xba87be,_0x48b355);}};
\ No newline at end of file
+var _0xc9d1=['./faxMessage.events','remove','update','emit','register','length','faxMessage:'];(function(_0x4b5c73,_0x3c942e){var _0x315f6b=function(_0x3ca55a){while(--_0x3ca55a){_0x4b5c73['push'](_0x4b5c73['shift']());}};_0x315f6b(++_0x3c942e);}(_0xc9d1,0x18f));var _0x1c9d=function(_0x1cb84c,_0x576b00){_0x1cb84c=_0x1cb84c-0x0;var _0x1ff4ed=_0xc9d1[_0x1cb84c];return _0x1ff4ed;};'use strict';var FaxMessageEvents=require(_0x1c9d('0x0'));var events=['save',_0x1c9d('0x1'),_0x1c9d('0x2')];function createListener(_0x1698b2,_0x1a0745){return function(_0xf0bd76){_0x1a0745[_0x1c9d('0x3')](_0x1698b2,_0xf0bd76);};}function removeListener(_0x55eba9,_0x4fdf31){return function(){FaxMessageEvents['removeListener'](_0x55eba9,_0x4fdf31);};}exports[_0x1c9d('0x4')]=function(_0x1d314f){for(var _0x5280eb=0x0,_0x3a45a4=events[_0x1c9d('0x5')];_0x5280eb<_0x3a45a4;_0x5280eb++){var _0x28dd30=events[_0x5280eb];var _0x265d44=createListener(_0x1c9d('0x6')+_0x28dd30,_0x1d314f);FaxMessageEvents['on'](_0x28dd30,_0x265d44);}};
\ No newline at end of file
index 7be2fb3..d12baf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb49a=['put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','show','download','post','tracked','fax','create'];(function(_0x1ea421,_0x599692){var _0x55afa3=function(_0x89f622){while(--_0x89f622){_0x1ea421['push'](_0x1ea421['shift']());}};_0x55afa3(++_0x599692);}(_0xb49a,0xfb));var _0xab49=function(_0x3ee9b1,_0xbc78c7){_0x3ee9b1=_0x3ee9b1-0x0;var _0x583028=_0xb49a[_0x3ee9b1];return _0x583028;};'use strict';var multer=require(_0xab49('0x0'));var util=require(_0xab49('0x1'));var path=require(_0xab49('0x2'));var timeout=require(_0xab49('0x3'));var express=require(_0xab49('0x4'));var router=express['Router']();var fs_extra=require(_0xab49('0x5'));var auth=require(_0xab49('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xab49('0x7'));router[_0xab49('0x8')]('/',auth[_0xab49('0x9')](),controller[_0xab49('0xa')]);router[_0xab49('0x8')](_0xab49('0xb'),auth[_0xab49('0x9')](),controller['describe']);router[_0xab49('0x8')](_0xab49('0xc'),auth[_0xab49('0x9')](),controller[_0xab49('0xd')]);router[_0xab49('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xab49('0xe')]);router[_0xab49('0xf')]('/',auth[_0xab49('0x9')](),interaction[_0xab49('0x10')](_0xab49('0x11'),'faxmessage:create'),controller[_0xab49('0x12')]);router[_0xab49('0x13')](_0xab49('0xc'),auth[_0xab49('0x9')](),controller[_0xab49('0x14')]);router[_0xab49('0x13')](_0xab49('0x15'),auth[_0xab49('0x9')](),controller[_0xab49('0x16')]);router[_0xab49('0x13')](_0xab49('0x17'),auth['isAuthenticated'](),controller[_0xab49('0x18')]);router[_0xab49('0x19')](_0xab49('0xc'),auth[_0xab49('0x9')](),controller[_0xab49('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0xa74f=['/describe','isAuthenticated','describe','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','/:id','update','put','accept','/:id/reject','delete','destroy','exports','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','index','get'];(function(_0x5838df,_0x276316){var _0x5a4b8c=function(_0x2020f8){while(--_0x2020f8){_0x5838df['push'](_0x5838df['shift']());}};_0x5a4b8c(++_0x276316);}(_0xa74f,0x9a));var _0xfa74=function(_0x13137e,_0x29c0f3){_0x13137e=_0x13137e-0x0;var _0x346261=_0xa74f[_0x13137e];return _0x346261;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfa74('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfa74('0x1')]();var fs_extra=require(_0xfa74('0x2'));var auth=require(_0xfa74('0x3'));var interaction=require(_0xfa74('0x4'));var config=require('../../config/environment');var controller=require(_0xfa74('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xfa74('0x6')]);router[_0xfa74('0x7')](_0xfa74('0x8'),auth[_0xfa74('0x9')](),controller[_0xfa74('0xa')]);router[_0xfa74('0x7')]('/:id',auth[_0xfa74('0x9')](),controller[_0xfa74('0xb')]);router[_0xfa74('0x7')](_0xfa74('0xc'),auth['isAuthenticated'](),controller[_0xfa74('0xd')]);router[_0xfa74('0xe')]('/',auth['isAuthenticated'](),interaction[_0xfa74('0xf')](_0xfa74('0x10'),_0xfa74('0x11')),controller[_0xfa74('0x12')]);router['put'](_0xfa74('0x13'),auth[_0xfa74('0x9')](),controller[_0xfa74('0x14')]);router[_0xfa74('0x15')]('/:id/accept',auth[_0xfa74('0x9')](),controller[_0xfa74('0x16')]);router[_0xfa74('0x15')](_0xfa74('0x17'),auth[_0xfa74('0x9')](),controller['reject']);router[_0xfa74('0x18')](_0xfa74('0x13'),auth[_0xfa74('0x9')](),controller[_0xfa74('0x19')]);module[_0xfa74('0x1a')]=router;
\ No newline at end of file
index ac86db7..b33609d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10bf=['STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports'];(function(_0x37a9d7,_0x2b6fde){var _0x1343d3=function(_0x3bde45){while(--_0x3bde45){_0x37a9d7['push'](_0x37a9d7['shift']());}};_0x1343d3(++_0x2b6fde);}(_0x10bf,0xf3));var _0xf10b=function(_0x36b444,_0x505b35){_0x36b444=_0x36b444-0x0;var _0x786323=_0x10bf[_0x36b444];return _0x786323;};'use strict';var Sequelize=require(_0xf10b('0x0'));module[_0xf10b('0x1')]={'name':{'type':Sequelize[_0xf10b('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf10b('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf10b('0x4')](_0xf10b('0x5'),'beepall',_0xf10b('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xf10b('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xc1db=['roundrobin','sequelize','STRING','name','INTEGER','ENUM','beepall'];(function(_0x16920b,_0x24cc7f){var _0x34b8bd=function(_0xbad468){while(--_0xbad468){_0x16920b['push'](_0x16920b['shift']());}};_0x34b8bd(++_0x24cc7f);}(_0xc1db,0x120));var _0xbc1d=function(_0x23f150,_0x38025a){_0x23f150=_0x23f150-0x0;var _0x52b549=_0xc1db[_0x23f150];return _0x52b549;};'use strict';var Sequelize=require(_0xbc1d('0x0'));module['exports']={'name':{'type':Sequelize[_0xbc1d('0x1')],'unique':_0xbc1d('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbc1d('0x1')]},'timeout':{'type':Sequelize[_0xbc1d('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbc1d('0x4')]('rrmemory',_0xbc1d('0x5'),_0xbc1d('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xbc1d('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 44bfea2..e47b807 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9dc=['tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','get','FaxQueues','UserProfileResource','destroy','then','stack','send','index','map','FaxQueue','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','nolimit','order','filters','pick','filter','where','merge','type','VIRTUAL','name','includeAll','include','rows','catch','fields','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','params','describe','findOne','UserFaxQueue','length','hasOwnProperty','sort','FaxQueueId','findAll','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userFaxQueue:save','removeTeams','select','field'];(function(_0x4f4069,_0x22dd5f){var _0x35bf80=function(_0x4abb0d){while(--_0x4abb0d){_0x4f4069['push'](_0x4f4069['shift']());}};_0x35bf80(++_0x22dd5f);}(_0xc9dc,0xad));var _0xcc9d=function(_0x5658a4,_0x3d6ab4){_0x5658a4=_0x5658a4-0x0;var _0x212478=_0xc9dc[_0x5658a4];return _0x212478;};'use strict';var emlformat=require(_0xcc9d('0x0'));var rimraf=require(_0xcc9d('0x1'));var zipdir=require(_0xcc9d('0x2'));var jsonpatch=require(_0xcc9d('0x3'));var rp=require(_0xcc9d('0x4'));var moment=require(_0xcc9d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xcc9d('0x6'));var util=require(_0xcc9d('0x7'));var path=require(_0xcc9d('0x8'));var sox=require(_0xcc9d('0x9'));var csv=require(_0xcc9d('0xa'));var ejs=require(_0xcc9d('0xb'));var fs=require('fs');var fs_extra=require(_0xcc9d('0xc'));var _=require(_0xcc9d('0xd'));var squel=require(_0xcc9d('0xe'));var crypto=require('crypto');var jsforce=require(_0xcc9d('0xf'));var deskjs=require(_0xcc9d('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcc9d('0x11'));var Redis=require(_0xcc9d('0x12'));var authService=require(_0xcc9d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xcc9d('0x14'));var hardwareService=require(_0xcc9d('0x15'));var logger=require(_0xcc9d('0x16'))(_0xcc9d('0x17'));var utils=require(_0xcc9d('0x18'));var config=require(_0xcc9d('0x19'));var licenseUtil=require(_0xcc9d('0x1a'));var db=require(_0xcc9d('0x1b'))['db'];config[_0xcc9d('0x1c')]=_[_0xcc9d('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcc9d('0x1e'))(new Redis(config[_0xcc9d('0x1c')]));require(_0xcc9d('0x1f'))[_0xcc9d('0x20')](socket);function respondWithStatusCode(_0x12268e,_0x2f1633){_0x2f1633=_0x2f1633||0xcc;return function(_0x311062){if(_0x311062){return _0x12268e[_0xcc9d('0x21')](_0x2f1633);}return _0x12268e[_0xcc9d('0x22')](_0x2f1633)[_0xcc9d('0x23')]();};}function respondWithResult(_0x4e4e68,_0x2eed2f){_0x2eed2f=_0x2eed2f||0xc8;return function(_0x455dc7){if(_0x455dc7){return _0x4e4e68['status'](_0x2eed2f)[_0xcc9d('0x24')](_0x455dc7);}};}function respondWithFilteredResult(_0x56fad5,_0x2bea0e){return function(_0x46b2a2){if(_0x46b2a2){var _0x344e11=typeof _0x2bea0e[_0xcc9d('0x25')]===_0xcc9d('0x26')&&typeof _0x2bea0e[_0xcc9d('0x27')]==='undefined';var _0xa5ef98=_0x46b2a2[_0xcc9d('0x28')];var _0x44fc77=_0x344e11?0x0:_0x2bea0e[_0xcc9d('0x25')];var _0x2b1a0e=_0x344e11?_0x46b2a2['count']:_0x2bea0e['offset']+_0x2bea0e['limit'];var _0x258257;if(_0x2b1a0e>=_0xa5ef98){_0x2b1a0e=_0xa5ef98;_0x258257=0xc8;}else{_0x258257=0xce;}_0x56fad5[_0xcc9d('0x22')](_0x258257);return _0x56fad5['set'](_0xcc9d('0x29'),_0x44fc77+'-'+_0x2b1a0e+'/'+_0xa5ef98)[_0xcc9d('0x24')](_0x46b2a2);}return null;};}function patchUpdates(_0x466958){return function(_0xe4f9bf){try{jsonpatch[_0xcc9d('0x2a')](_0xe4f9bf,_0x466958,!![]);}catch(_0x1648e2){return BPromise[_0xcc9d('0x2b')](_0x1648e2);}return _0xe4f9bf[_0xcc9d('0x2c')]();};}function saveUpdates(_0x54a9ea,_0x31a3b8){return function(_0x20bd2e){if(_0x20bd2e){return _0x20bd2e[_0xcc9d('0x2d')](_0x54a9ea)['then'](function(_0x2fd13c){return _0x2fd13c;});}return null;};}function removeEntity(_0x2f2bfc,_0x178326){return function(_0x287623){if(_0x287623){return _0x287623['destroy']()['then'](function(){var _0x57ca3a=_0x287623[_0xcc9d('0x2e')]({'plain':!![]});var _0x2a1664=_0xcc9d('0x2f');return db[_0xcc9d('0x30')][_0xcc9d('0x31')]({'where':{'type':_0x2a1664,'resourceId':_0x57ca3a['id']}})[_0xcc9d('0x32')](function(){return _0x287623;});})[_0xcc9d('0x32')](function(){_0x2f2bfc[_0xcc9d('0x22')](0xcc)[_0xcc9d('0x23')]();});}};}function handleEntityNotFound(_0x25039c,_0x1b0625){return function(_0x444d51){if(!_0x444d51){_0x25039c[_0xcc9d('0x21')](0x194);}return _0x444d51;};}function handleError(_0x547295,_0x37d817){_0x37d817=_0x37d817||0x1f4;return function(_0x3e89ad){logger['error'](_0x3e89ad[_0xcc9d('0x33')]);if(_0x3e89ad['name']){delete _0x3e89ad['name'];}_0x547295[_0xcc9d('0x22')](_0x37d817)[_0xcc9d('0x34')](_0x3e89ad);};}exports[_0xcc9d('0x35')]=function(_0x1dca16,_0x5db7d0){var _0x3db4f={},_0xc4053={},_0x32a126={'count':0x0,'rows':[]};var _0x279f90=_[_0xcc9d('0x36')](db[_0xcc9d('0x37')][_0xcc9d('0x38')],function(_0x2e3381){return{'name':_0x2e3381[_0xcc9d('0x39')],'type':_0x2e3381['type'][_0xcc9d('0x3a')]};});_0xc4053['model']=_[_0xcc9d('0x36')](_0x279f90,'name');_0xc4053[_0xcc9d('0x3b')]=_[_0xcc9d('0x3c')](_0x1dca16[_0xcc9d('0x3b')]);_0xc4053['filters']=_[_0xcc9d('0x3d')](_0xc4053[_0xcc9d('0x3e')],_0xc4053[_0xcc9d('0x3b')]);_0x3db4f[_0xcc9d('0x3f')]=_[_0xcc9d('0x3d')](_0xc4053['model'],qs['fields'](_0x1dca16[_0xcc9d('0x3b')]['fields']));_0x3db4f['attributes']=_0x3db4f[_0xcc9d('0x3f')]['length']?_0x3db4f['attributes']:_0xc4053[_0xcc9d('0x3e')];if(!_0x1dca16['query']['hasOwnProperty'](_0xcc9d('0x40'))){_0x3db4f[_0xcc9d('0x27')]=qs[_0xcc9d('0x27')](_0x1dca16['query'][_0xcc9d('0x27')]);_0x3db4f[_0xcc9d('0x25')]=qs[_0xcc9d('0x25')](_0x1dca16[_0xcc9d('0x3b')][_0xcc9d('0x25')]);}_0x3db4f[_0xcc9d('0x41')]=qs['sort'](_0x1dca16[_0xcc9d('0x3b')]['sort']);_0x3db4f['where']=qs[_0xcc9d('0x42')](_[_0xcc9d('0x43')](_0x1dca16[_0xcc9d('0x3b')],_0xc4053[_0xcc9d('0x42')]),_0x279f90);if(_0x1dca16['query'][_0xcc9d('0x44')]){_0x3db4f[_0xcc9d('0x45')]=_[_0xcc9d('0x46')](_0x3db4f[_0xcc9d('0x45')],{'$or':_['map'](_0x279f90,function(_0x547ac7){if(_0x547ac7[_0xcc9d('0x47')]!==_0xcc9d('0x48')){var _0x2e8561={};_0x2e8561[_0x547ac7[_0xcc9d('0x49')]]={'$like':'%'+_0x1dca16[_0xcc9d('0x3b')]['filter']+'%'};return _0x2e8561;}})});}_0x3db4f=_[_0xcc9d('0x46')]({},_0x3db4f,_0x1dca16['options']);var _0x2e74c8={'where':_0x3db4f[_0xcc9d('0x45')]};return db[_0xcc9d('0x37')]['count'](_0x2e74c8)[_0xcc9d('0x32')](function(_0x5618ab){_0x32a126['count']=_0x5618ab;if(_0x1dca16[_0xcc9d('0x3b')][_0xcc9d('0x4a')]){_0x3db4f[_0xcc9d('0x4b')]=[{'all':!![]}];}return db[_0xcc9d('0x37')]['findAll'](_0x3db4f);})[_0xcc9d('0x32')](function(_0x550a5b){_0x32a126[_0xcc9d('0x4c')]=_0x550a5b;return _0x32a126;})['then'](respondWithFilteredResult(_0x5db7d0,_0x3db4f))[_0xcc9d('0x4d')](handleError(_0x5db7d0,null));};exports['show']=function(_0x3e3f40,_0x125e88){var _0x4dba9e={'raw':!![],'where':{'id':_0x3e3f40['params']['id']}},_0x2975d1={};_0x2975d1[_0xcc9d('0x3e')]=_[_0xcc9d('0x3c')](db[_0xcc9d('0x37')][_0xcc9d('0x38')]);_0x2975d1[_0xcc9d('0x3b')]=_[_0xcc9d('0x3c')](_0x3e3f40['query']);_0x2975d1[_0xcc9d('0x42')]=_[_0xcc9d('0x3d')](_0x2975d1[_0xcc9d('0x3e')],_0x2975d1[_0xcc9d('0x3b')]);_0x4dba9e['attributes']=_['intersection'](_0x2975d1[_0xcc9d('0x3e')],qs[_0xcc9d('0x4e')](_0x3e3f40[_0xcc9d('0x3b')][_0xcc9d('0x4e')]));_0x4dba9e['attributes']=_0x4dba9e[_0xcc9d('0x3f')]['length']?_0x4dba9e[_0xcc9d('0x3f')]:_0x2975d1[_0xcc9d('0x3e')];if(_0x3e3f40['query'][_0xcc9d('0x4a')]){_0x4dba9e['include']=[{'all':!![]}];}_0x4dba9e=_['merge']({},_0x4dba9e,_0x3e3f40[_0xcc9d('0x4f')]);return db[_0xcc9d('0x37')][_0xcc9d('0x50')](_0x4dba9e)[_0xcc9d('0x32')](handleEntityNotFound(_0x125e88,null))[_0xcc9d('0x32')](respondWithResult(_0x125e88,null))['catch'](handleError(_0x125e88,null));};exports['create']=function(_0x88475f,_0xc5f829){return db[_0xcc9d('0x37')][_0xcc9d('0x51')](_0x88475f[_0xcc9d('0x52')],{})[_0xcc9d('0x32')](function(_0x11f302){var _0x17b3c9=_0x88475f[_0xcc9d('0x53')][_0xcc9d('0x2e')]({'plain':!![]});if(!_0x17b3c9)throw new Error(_0xcc9d('0x54'));if(_0x17b3c9[_0xcc9d('0x55')]===_0xcc9d('0x53')){var _0x35601d=_0x11f302[_0xcc9d('0x2e')]({'plain':!![]});var _0x3837b8=_0xcc9d('0x2f');return db[_0xcc9d('0x56')][_0xcc9d('0x50')]({'where':{'name':_0x3837b8,'userProfileId':_0x17b3c9['userProfileId']},'raw':!![]})['then'](function(_0x1d0199){if(_0x1d0199&&_0x1d0199[_0xcc9d('0x57')]===0x0){return db[_0xcc9d('0x30')][_0xcc9d('0x51')]({'name':_0x35601d[_0xcc9d('0x49')],'resourceId':_0x35601d['id'],'type':_0x1d0199[_0xcc9d('0x49')],'sectionId':_0x1d0199['id']},{})[_0xcc9d('0x32')](function(){return _0x11f302;});}else{return _0x11f302;}})['catch'](function(_0x109590){logger[_0xcc9d('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x109590);throw _0x109590;});}return _0x11f302;})[_0xcc9d('0x32')](respondWithResult(_0xc5f829,0xc9))['catch'](handleError(_0xc5f829,null));};exports[_0xcc9d('0x2d')]=function(_0x16d22b,_0x119daa){if(_0x16d22b[_0xcc9d('0x52')]['id']){delete _0x16d22b[_0xcc9d('0x52')]['id'];}return db['FaxQueue'][_0xcc9d('0x50')]({'where':{'id':_0x16d22b['params']['id']}})[_0xcc9d('0x32')](handleEntityNotFound(_0x119daa,null))[_0xcc9d('0x32')](saveUpdates(_0x16d22b[_0xcc9d('0x52')],null))['then'](respondWithResult(_0x119daa,null))[_0xcc9d('0x4d')](handleError(_0x119daa,null));};exports[_0xcc9d('0x31')]=function(_0x4b8895,_0x3a40ff){return db['FaxQueue'][_0xcc9d('0x50')]({'where':{'id':_0x4b8895[_0xcc9d('0x59')]['id']}})[_0xcc9d('0x32')](handleEntityNotFound(_0x3a40ff,null))[_0xcc9d('0x32')](removeEntity(_0x3a40ff,null))[_0xcc9d('0x4d')](handleError(_0x3a40ff,null));};exports[_0xcc9d('0x5a')]=function(_0x3211c4,_0x5f4826){return db[_0xcc9d('0x37')][_0xcc9d('0x5a')]()[_0xcc9d('0x32')](respondWithResult(_0x5f4826,null))[_0xcc9d('0x4d')](handleError(_0x5f4826,null));};exports['getMembers']=function(_0x320312,_0x13e9bc,_0x5ebb8c){var _0x417c74={'raw':!![],'where':{}},_0x337043={},_0x1618d7;return db[_0xcc9d('0x37')][_0xcc9d('0x5b')]({'where':{'id':_0x320312[_0xcc9d('0x59')]['id']}})[_0xcc9d('0x32')](handleEntityNotFound(_0x13e9bc,null))[_0xcc9d('0x32')](function(_0x28a20a){if(_0x28a20a){_0x1618d7=_0x28a20a[_0xcc9d('0x2e')]({'plain':!![]});_0x337043[_0xcc9d('0x3e')]=_[_0xcc9d('0x3c')](db[_0xcc9d('0x5c')][_0xcc9d('0x38')]);_0x337043['query']=_[_0xcc9d('0x3c')](_0x320312[_0xcc9d('0x3b')]);_0x337043[_0xcc9d('0x42')]=_[_0xcc9d('0x3d')](_0x337043[_0xcc9d('0x3e')],_0x337043['query']);_0x417c74[_0xcc9d('0x3f')]=_[_0xcc9d('0x3d')](_0x337043[_0xcc9d('0x3e')],qs['fields'](_0x320312['query'][_0xcc9d('0x4e')]));_0x417c74[_0xcc9d('0x3f')]=_0x417c74[_0xcc9d('0x3f')][_0xcc9d('0x5d')]?_0x417c74[_0xcc9d('0x3f')]:_0x337043[_0xcc9d('0x3e')];if(!_0x320312[_0xcc9d('0x3b')][_0xcc9d('0x5e')](_0xcc9d('0x40'))){_0x417c74[_0xcc9d('0x27')]=qs['limit'](_0x320312['query'][_0xcc9d('0x27')]);_0x417c74[_0xcc9d('0x25')]=qs[_0xcc9d('0x25')](_0x320312['query'][_0xcc9d('0x25')]);}_0x417c74['order']=qs[_0xcc9d('0x5f')](_0x320312['query']['sort']);_0x417c74[_0xcc9d('0x45')]=qs[_0xcc9d('0x42')](_[_0xcc9d('0x43')](_0x320312['query'],_0x337043[_0xcc9d('0x42')]));_0x417c74['where'][_0xcc9d('0x60')]=_0x28a20a['id'];if(_0x320312[_0xcc9d('0x3b')][_0xcc9d('0x44')]){_0x417c74[_0xcc9d('0x45')]=_[_0xcc9d('0x46')](_0x417c74[_0xcc9d('0x45')],{'$or':_[_0xcc9d('0x36')](_0x417c74['attributes'],function(_0x22f735){var _0x2ba877={};_0x2ba877[_0x22f735]={'$like':'%'+_0x320312[_0xcc9d('0x3b')][_0xcc9d('0x44')]+'%'};return _0x2ba877;})});}_0x417c74=_['merge']({},_0x417c74,_0x320312['options']);return db[_0xcc9d('0x5c')][_0xcc9d('0x61')](_0x417c74);}})['then'](function(_0x35b964){if(_0x35b964){return db[_0xcc9d('0x62')][_0xcc9d('0x63')]({'where':{'id':_[_0xcc9d('0x36')](_0x35b964,_0xcc9d('0x64')),'role':_0xcc9d('0x65')},'attributes':['id','name',_0xcc9d('0x66'),_0xcc9d('0x67'),_0xcc9d('0x68')]});}})['then'](function(_0x3f9e62){if(_0x3f9e62){return{'count':_0x3f9e62['count'],'rows':_[_0xcc9d('0x36')](_0x3f9e62['rows'],function(_0x48e50c){return{'membername':_0x48e50c[_0xcc9d('0x49')],'UserId':_0x48e50c['id'],'queue_name':_0x1618d7['name'],'FaxQueueId':_0x1618d7['id'],'interface':util[_0xcc9d('0x69')](_0xcc9d('0x6a'),_0xcc9d('0x6b'),_0x48e50c[_0xcc9d('0x49')]),'penalty':0x0,'paused':_0x48e50c[_0xcc9d('0x66')],'createdAt':_0x48e50c[_0xcc9d('0x68')],'updatedAt':_0x48e50c[_0xcc9d('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xcc9d('0x32')](respondWithFilteredResult(_0x13e9bc,_0x417c74))['catch'](handleError(_0x13e9bc,null));};exports[_0xcc9d('0x6c')]=function(_0x36ee26,_0x19fa0d,_0x2d6e21){var _0x2d3dda={};var _0x190743={};var _0x2fc1a2;var _0x5df5c1;return db[_0xcc9d('0x37')][_0xcc9d('0x5b')]({'where':{'id':_0x36ee26[_0xcc9d('0x59')]['id']}})[_0xcc9d('0x32')](handleEntityNotFound(_0x19fa0d,null))['then'](function(_0x147d8b){if(_0x147d8b){_0x2fc1a2=_0x147d8b;_0x190743['model']=_[_0xcc9d('0x3c')](db['Team']['rawAttributes']);_0x190743[_0xcc9d('0x3b')]=_[_0xcc9d('0x3c')](_0x36ee26['query']);_0x190743['filters']=_[_0xcc9d('0x3d')](_0x190743[_0xcc9d('0x3e')],_0x190743[_0xcc9d('0x3b')]);_0x2d3dda['attributes']=_[_0xcc9d('0x3d')](_0x190743[_0xcc9d('0x3e')],qs[_0xcc9d('0x4e')](_0x36ee26['query'][_0xcc9d('0x4e')]));_0x2d3dda['attributes']=_0x2d3dda[_0xcc9d('0x3f')][_0xcc9d('0x5d')]?_0x2d3dda[_0xcc9d('0x3f')]:_0x190743[_0xcc9d('0x3e')];_0x2d3dda['order']=qs[_0xcc9d('0x5f')](_0x36ee26[_0xcc9d('0x3b')]['sort']);_0x2d3dda[_0xcc9d('0x45')]=qs['filters'](_[_0xcc9d('0x43')](_0x36ee26[_0xcc9d('0x3b')],_0x190743[_0xcc9d('0x42')]));if(_0x36ee26['query'][_0xcc9d('0x44')]){_0x2d3dda[_0xcc9d('0x45')]=_[_0xcc9d('0x46')](_0x2d3dda[_0xcc9d('0x45')],{'$or':_[_0xcc9d('0x36')](_0x2d3dda['attributes'],function(_0x2d59ae){var _0x5a9496={};_0x5a9496[_0x2d59ae]={'$like':'%'+_0x36ee26['query'][_0xcc9d('0x44')]+'%'};return _0x5a9496;})});}_0x2d3dda=_[_0xcc9d('0x46')]({},_0x2d3dda,_0x36ee26[_0xcc9d('0x4f')]);return _0x2fc1a2[_0xcc9d('0x6c')](_0x2d3dda);}})['then'](function(_0x29da0e){if(_0x29da0e){_0x5df5c1=_0x29da0e[_0xcc9d('0x5d')];if(!_0x36ee26[_0xcc9d('0x3b')][_0xcc9d('0x5e')](_0xcc9d('0x40'))){_0x2d3dda[_0xcc9d('0x27')]=qs[_0xcc9d('0x27')](_0x36ee26[_0xcc9d('0x3b')][_0xcc9d('0x27')]);_0x2d3dda[_0xcc9d('0x25')]=qs[_0xcc9d('0x25')](_0x36ee26[_0xcc9d('0x3b')][_0xcc9d('0x25')]);}return _0x2fc1a2[_0xcc9d('0x6c')](_0x2d3dda);}})[_0xcc9d('0x32')](function(_0x2048cc){if(_0x2048cc){return _0x2048cc?{'count':_0x5df5c1,'rows':_0x2048cc}:null;}})[_0xcc9d('0x32')](respondWithResult(_0x19fa0d,null))[_0xcc9d('0x4d')](handleError(_0x19fa0d,null));};exports[_0xcc9d('0x6d')]=function(_0x123268,_0x4b38e9,_0xde6fc5){var _0x47a617=_0x123268[_0xcc9d('0x52')][_0xcc9d('0x6e')];return db[_0xcc9d('0x6f')][_0xcc9d('0x61')]({'where':{'id':_0x47a617},'attributes':['id'],'include':[{'model':db[_0xcc9d('0x62')],'as':_0xcc9d('0x70'),'attributes':['id',_0xcc9d('0x49'),'online',_0xcc9d('0x71'),_0xcc9d('0x72')],'raw':!![]}]})[_0xcc9d('0x32')](function(_0x4cde22){if(_0x4cde22){var _0x218f92=_[_0xcc9d('0x73')](_0x4cde22,function(_0x1de89a){var _0xece00d=_0x1de89a['get']({'plain':!![]});return _0xece00d['Agents'];});return db[_0xcc9d('0x37')]['find']({'where':{'id':_0x123268[_0xcc9d('0x59')]['id']}})['then'](function(_0x48fabb){return db[_0xcc9d('0x74')][_0xcc9d('0x75')](function(_0x12939b){return _0x48fabb[_0xcc9d('0x6d')](_0x47a617,{'transaction':_0x12939b})[_0xcc9d('0x32')](function(){return BPromise[_0xcc9d('0x76')](_0x218f92,function(_0x444e65){return db[_0xcc9d('0x5c')]['findOrCreate']({'where':{'UserId':_0x444e65['id'],'FaxQueueId':_0x123268[_0xcc9d('0x59')]['id']},'transaction':_0x12939b});});})[_0xcc9d('0x32')](function(){_0x218f92[_0xcc9d('0x77')](function(_0x309718){socket[_0xcc9d('0x78')](_0xcc9d('0x79'),{'UserId':_0x309718['id'],'FaxQueueId':_0x48fabb['id']});});});});});}})['then'](respondWithStatusCode(_0x4b38e9,null))[_0xcc9d('0x4d')](handleError(_0x4b38e9,null));};exports[_0xcc9d('0x7a')]=function(_0x49a601,_0x4fa4da,_0x166279){return db[_0xcc9d('0x6f')][_0xcc9d('0x61')]({'where':{'id':_0x49a601[_0xcc9d('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0xcc9d('0x62')],'as':_0xcc9d('0x70'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4fa4da,null))['then'](function(_0x31770e){var _0x4f69c7=_['map'](_0x31770e,'id');var _0x4b8abf=[];var _0x283e34=[];var _0x66db3c=squel[_0xcc9d('0x7b')]();_0x66db3c[_0xcc9d('0x7c')](_0xcc9d('0x7d'))[_0xcc9d('0x7e')]('team_has_fax_queues','tq')[_0xcc9d('0x7f')]('user_has_teams','ut',_0xcc9d('0x80'))[_0xcc9d('0x45')](_0xcc9d('0x81'),_0x49a601[_0xcc9d('0x59')]['id']);for(var _0x1a13de=0x0;_0x1a13de<_0x31770e['length'];_0x1a13de+=0x1){let _0x280c56=_0x31770e[_0x1a13de];for(var _0x4d7b49=0x0;_0x4d7b49<_0x280c56[_0xcc9d('0x70')][_0xcc9d('0x5d')];_0x4d7b49+=0x1){let _0x110f38=_0x280c56[_0xcc9d('0x70')][_0x4d7b49];var _0x29dacd=_0x66db3c[_0xcc9d('0x82')]();_0x29dacd[_0xcc9d('0x45')](_0xcc9d('0x83'),_0x110f38['id']);_0x283e34[_0xcc9d('0x84')](db['sequelize'][_0xcc9d('0x3b')](_0x29dacd[_0xcc9d('0x85')](),{'type':db[_0xcc9d('0x74')][_0xcc9d('0x86')]['SELECT']})[_0xcc9d('0x32')](function(_0x16821f){if(_0x16821f[_0xcc9d('0x5d')]===0x1){return _0x110f38['id'];}else{var _0x2473bb=_[_0xcc9d('0x87')](_[_0xcc9d('0x36')](_0x16821f,_0xcc9d('0x88')),function(_0x48a492){return _[_0xcc9d('0x89')](_0x4f69c7,_0x48a492);});if(_0x2473bb){return _0x110f38['id'];}}}));}}return BPromise[_0xcc9d('0x8a')](_0x283e34)[_0xcc9d('0x32')](function(_0x1081af){_0x4b8abf=_(_0x4b8abf)[_0xcc9d('0x8b')](_0x1081af)[_0xcc9d('0x8c')]()[_0xcc9d('0x8d')]();return db['FaxQueue'][_0xcc9d('0x50')]({'where':{'id':_0x49a601[_0xcc9d('0x59')]['id']}})[_0xcc9d('0x32')](function(_0x3d7df2){return db[_0xcc9d('0x74')][_0xcc9d('0x75')](function(_0x54f93c){return _0x3d7df2[_0xcc9d('0x7a')](_0x49a601[_0xcc9d('0x3b')]['ids'],{'transaction':_0x54f93c})[_0xcc9d('0x32')](function(){if(!_['isEmpty'](_0x4b8abf)){return _0x3d7df2['removeAgents'](_0x4b8abf,{'transaction':_0x54f93c});}})[_0xcc9d('0x32')](function(){_0x4b8abf[_0xcc9d('0x77')](function(_0x24b935){socket[_0xcc9d('0x78')](_0xcc9d('0x8e'),{'UserId':_0x24b935,'FaxQueueId':_0x3d7df2['id']});});});});});});})['then'](respondWithStatusCode(_0x4fa4da,null))['catch'](handleError(_0x4fa4da,null));};exports[_0xcc9d('0x8f')]=function(_0x2991f4,_0x1783f5,_0x32c046){return db[_0xcc9d('0x37')][_0xcc9d('0x50')]({'where':{'id':_0x2991f4[_0xcc9d('0x59')]['id']}})['then'](handleEntityNotFound(_0x1783f5,null))[_0xcc9d('0x32')](function(_0x2f0837){if(_0x2f0837){return _0x2f0837[_0xcc9d('0x8f')](_0x2991f4[_0xcc9d('0x52')][_0xcc9d('0x6e')],_[_0xcc9d('0x90')](_0x2991f4['body'],[_0xcc9d('0x6e'),'id'])||{})[_0xcc9d('0x91')](function(_0x3fc609){for(var _0x30b17e=0x0;_0x30b17e<_0x2991f4['body'][_0xcc9d('0x6e')]['length'];_0x30b17e+=0x1){socket[_0xcc9d('0x78')](_0xcc9d('0x79'),{'UserId':Number(_0x2991f4[_0xcc9d('0x52')][_0xcc9d('0x6e')][_0x30b17e]),'FaxQueueId':Number(_0x2991f4[_0xcc9d('0x59')]['id'])});}return _0x3fc609;});}})[_0xcc9d('0x32')](respondWithResult(_0x1783f5,null))[_0xcc9d('0x4d')](handleError(_0x1783f5,null));};exports[_0xcc9d('0x92')]=function(_0x4c5add,_0x558906,_0x5b721e){return db['FaxQueue']['find']({'where':{'id':_0x4c5add[_0xcc9d('0x59')]['id']}})[_0xcc9d('0x32')](handleEntityNotFound(_0x558906,null))[_0xcc9d('0x32')](function(_0x575b51){if(_0x575b51){return _0x575b51[_0xcc9d('0x92')](_0x4c5add[_0xcc9d('0x3b')][_0xcc9d('0x6e')])[_0xcc9d('0x32')](function(){if(_[_0xcc9d('0x93')](_0x4c5add['query'][_0xcc9d('0x6e')])){for(var _0x13174e=0x0;_0x13174e<_0x4c5add['query'][_0xcc9d('0x6e')]['length'];_0x13174e+=0x1){socket[_0xcc9d('0x78')](_0xcc9d('0x8e'),{'UserId':Number(_0x4c5add[_0xcc9d('0x3b')][_0xcc9d('0x6e')][_0x13174e]),'FaxQueueId':Number(_0x4c5add[_0xcc9d('0x59')]['id'])});}}else{socket[_0xcc9d('0x78')](_0xcc9d('0x8e'),{'UserId':Number(_0x4c5add['query'][_0xcc9d('0x6e')]),'FaxQueueId':Number(_0x4c5add['params']['id'])});}});}})[_0xcc9d('0x32')](respondWithStatusCode(_0x558906,null))['catch'](handleError(_0x558906,null));};exports[_0xcc9d('0x94')]=function(_0x59f96f,_0x1589b6,_0xd304ee){var _0x4d7b46={};var _0x499237={};var _0x19e9b5;var _0x4efc85;return db[_0xcc9d('0x37')][_0xcc9d('0x5b')]({'where':{'id':_0x59f96f[_0xcc9d('0x59')]['id']}})[_0xcc9d('0x32')](handleEntityNotFound(_0x1589b6,null))[_0xcc9d('0x32')](function(_0x1548b4){if(_0x1548b4){_0x19e9b5=_0x1548b4;_0x499237[_0xcc9d('0x3e')]=_[_0xcc9d('0x3c')](db[_0xcc9d('0x62')][_0xcc9d('0x38')]);_0x499237[_0xcc9d('0x3b')]=_['keys'](_0x59f96f[_0xcc9d('0x3b')]);_0x499237[_0xcc9d('0x42')]=_[_0xcc9d('0x3d')](_0x499237[_0xcc9d('0x3e')],_0x499237[_0xcc9d('0x3b')]);_0x4d7b46[_0xcc9d('0x3f')]=_[_0xcc9d('0x3d')](_0x499237[_0xcc9d('0x3e')],qs[_0xcc9d('0x4e')](_0x59f96f['query'][_0xcc9d('0x4e')]));_0x4d7b46[_0xcc9d('0x3f')]=_0x4d7b46['attributes'][_0xcc9d('0x5d')]?_0x4d7b46[_0xcc9d('0x3f')]:_0x499237['model'];_0x4d7b46[_0xcc9d('0x41')]=qs['sort'](_0x59f96f[_0xcc9d('0x3b')][_0xcc9d('0x5f')]);_0x4d7b46['where']=qs[_0xcc9d('0x42')](_['pick'](_0x59f96f[_0xcc9d('0x3b')],_0x499237[_0xcc9d('0x42')]));if(_0x59f96f[_0xcc9d('0x3b')][_0xcc9d('0x44')]){_0x4d7b46[_0xcc9d('0x45')]=_['merge'](_0x4d7b46['where'],{'$or':_[_0xcc9d('0x36')](_0x4d7b46[_0xcc9d('0x3f')],function(_0x34b7d1){var _0x24e116={};_0x24e116[_0x34b7d1]={'$like':'%'+_0x59f96f[_0xcc9d('0x3b')][_0xcc9d('0x44')]+'%'};return _0x24e116;})});}_0x4d7b46=_[_0xcc9d('0x46')]({},_0x4d7b46,_0x59f96f[_0xcc9d('0x4f')]);return _0x19e9b5[_0xcc9d('0x94')](_0x4d7b46);}})[_0xcc9d('0x32')](function(_0x42dee8){if(_0x42dee8){_0x4efc85=_0x42dee8[_0xcc9d('0x5d')];if(!_0x59f96f[_0xcc9d('0x3b')][_0xcc9d('0x5e')](_0xcc9d('0x40'))){_0x4d7b46['limit']=qs['limit'](_0x59f96f[_0xcc9d('0x3b')][_0xcc9d('0x27')]);_0x4d7b46[_0xcc9d('0x25')]=qs['offset'](_0x59f96f[_0xcc9d('0x3b')][_0xcc9d('0x25')]);}return _0x19e9b5[_0xcc9d('0x94')](_0x4d7b46);}})[_0xcc9d('0x32')](function(_0x32d6a8){if(_0x32d6a8){return _0x32d6a8?{'count':_0x4efc85,'rows':_0x32d6a8}:null;}})[_0xcc9d('0x32')](respondWithResult(_0x1589b6,null))[_0xcc9d('0x4d')](handleError(_0x1589b6,null));};
\ No newline at end of file
+var _0xbcf8=['../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','FaxQueues','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','catch','params','create','body','user','role','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','nolimit','FaxQueueId','findAll','User','UserId','agent','updatedAt','createdAt','rows','%s/%s','SIP','faxPause','getTeams','Team','ids','Agents','online','voicePause','flatMap','sequelize','transaction','addTeams','each','findOrCreate','emit','removeTeams','select','field','from','team_has_fax_queues','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','forEach','addAgents','omit','spread','userFaxQueue:save','removeAgents','userFaxQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','jsforce','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x5c4a63,_0x5b167f){var _0x218083=function(_0x45dc82){while(--_0x45dc82){_0x5c4a63['push'](_0x5c4a63['shift']());}};_0x218083(++_0x5b167f);}(_0xbcf8,0x185));var _0x8bcf=function(_0x5b2504,_0x14534c){_0x5b2504=_0x5b2504-0x0;var _0x27d1cc=_0xbcf8[_0x5b2504];return _0x27d1cc;};'use strict';var emlformat=require(_0x8bcf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8bcf('0x1'));var jsonpatch=require(_0x8bcf('0x2'));var rp=require(_0x8bcf('0x3'));var moment=require('moment');var BPromise=require(_0x8bcf('0x4'));var Mustache=require(_0x8bcf('0x5'));var util=require(_0x8bcf('0x6'));var path=require(_0x8bcf('0x7'));var sox=require('sox');var csv=require(_0x8bcf('0x8'));var ejs=require(_0x8bcf('0x9'));var fs=require('fs');var fs_extra=require(_0x8bcf('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8bcf('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8bcf('0xc'));var as=require(_0x8bcf('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8bcf('0xe'))(_0x8bcf('0xf'));var utils=require(_0x8bcf('0x10'));var config=require(_0x8bcf('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x8bcf('0x12'))['db'];config[_0x8bcf('0x13')]=_['defaults'](config['redis'],{'host':_0x8bcf('0x14'),'port':0x18eb});var socket=require(_0x8bcf('0x15'))(new Redis(config[_0x8bcf('0x13')]));require(_0x8bcf('0x16'))['register'](socket);function respondWithStatusCode(_0x53fe84,_0x5e5fb8){_0x5e5fb8=_0x5e5fb8||0xcc;return function(_0x4bab74){if(_0x4bab74){return _0x53fe84[_0x8bcf('0x17')](_0x5e5fb8);}return _0x53fe84['status'](_0x5e5fb8)[_0x8bcf('0x18')]();};}function respondWithResult(_0x13bcc2,_0x3aa6c2){_0x3aa6c2=_0x3aa6c2||0xc8;return function(_0x5c8945){if(_0x5c8945){return _0x13bcc2[_0x8bcf('0x19')](_0x3aa6c2)[_0x8bcf('0x1a')](_0x5c8945);}};}function respondWithFilteredResult(_0x25eae1,_0x13ade8){return function(_0x3c6a2d){if(_0x3c6a2d){var _0x3c4b46=typeof _0x13ade8[_0x8bcf('0x1b')]===_0x8bcf('0x1c')&&typeof _0x13ade8[_0x8bcf('0x1d')]==='undefined';var _0x1fee10=_0x3c6a2d['count'];var _0x5c2ce6=_0x3c4b46?0x0:_0x13ade8[_0x8bcf('0x1b')];var _0x21dc21=_0x3c4b46?_0x3c6a2d[_0x8bcf('0x1e')]:_0x13ade8[_0x8bcf('0x1b')]+_0x13ade8[_0x8bcf('0x1d')];var _0x3fd835;if(_0x21dc21>=_0x1fee10){_0x21dc21=_0x1fee10;_0x3fd835=0xc8;}else{_0x3fd835=0xce;}_0x25eae1['status'](_0x3fd835);return _0x25eae1[_0x8bcf('0x1f')](_0x8bcf('0x20'),_0x5c2ce6+'-'+_0x21dc21+'/'+_0x1fee10)[_0x8bcf('0x1a')](_0x3c6a2d);}return null;};}function patchUpdates(_0x5350d8){return function(_0x4d787c){try{jsonpatch[_0x8bcf('0x21')](_0x4d787c,_0x5350d8,!![]);}catch(_0x333983){return BPromise[_0x8bcf('0x22')](_0x333983);}return _0x4d787c[_0x8bcf('0x23')]();};}function saveUpdates(_0x380438,_0x158771){return function(_0x3aef8a){if(_0x3aef8a){return _0x3aef8a[_0x8bcf('0x24')](_0x380438)[_0x8bcf('0x25')](function(_0x4c2df1){return _0x4c2df1;});}return null;};}function removeEntity(_0x597e1e,_0x1d7e30){return function(_0x465d46){if(_0x465d46){return _0x465d46[_0x8bcf('0x26')]()[_0x8bcf('0x25')](function(){var _0x594025=_0x465d46[_0x8bcf('0x27')]({'plain':!![]});var _0x313515=_0x8bcf('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x313515,'resourceId':_0x594025['id']}})[_0x8bcf('0x25')](function(){return _0x465d46;});})[_0x8bcf('0x25')](function(){_0x597e1e[_0x8bcf('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25089a,_0x3541ea){return function(_0x20ceca){if(!_0x20ceca){_0x25089a[_0x8bcf('0x17')](0x194);}return _0x20ceca;};}function handleError(_0x21e27a,_0x3846ac){_0x3846ac=_0x3846ac||0x1f4;return function(_0x20bc22){logger['error'](_0x20bc22[_0x8bcf('0x29')]);if(_0x20bc22[_0x8bcf('0x2a')]){delete _0x20bc22[_0x8bcf('0x2a')];}_0x21e27a['status'](_0x3846ac)[_0x8bcf('0x2b')](_0x20bc22);};}exports[_0x8bcf('0x2c')]=function(_0x124a3a,_0xb59895){var _0x207cb3={},_0xae7c9f={},_0x21fbf4={'count':0x0,'rows':[]};var _0x43b473=_[_0x8bcf('0x2d')](db[_0x8bcf('0x2e')][_0x8bcf('0x2f')],function(_0x235cf0){return{'name':_0x235cf0[_0x8bcf('0x30')],'type':_0x235cf0[_0x8bcf('0x31')][_0x8bcf('0x32')]};});_0xae7c9f[_0x8bcf('0x33')]=_[_0x8bcf('0x2d')](_0x43b473,'name');_0xae7c9f[_0x8bcf('0x34')]=_[_0x8bcf('0x35')](_0x124a3a[_0x8bcf('0x34')]);_0xae7c9f[_0x8bcf('0x36')]=_[_0x8bcf('0x37')](_0xae7c9f['model'],_0xae7c9f[_0x8bcf('0x34')]);_0x207cb3[_0x8bcf('0x38')]=_[_0x8bcf('0x37')](_0xae7c9f[_0x8bcf('0x33')],qs[_0x8bcf('0x39')](_0x124a3a[_0x8bcf('0x34')][_0x8bcf('0x39')]));_0x207cb3['attributes']=_0x207cb3['attributes'][_0x8bcf('0x3a')]?_0x207cb3['attributes']:_0xae7c9f[_0x8bcf('0x33')];if(!_0x124a3a['query'][_0x8bcf('0x3b')]('nolimit')){_0x207cb3[_0x8bcf('0x1d')]=qs[_0x8bcf('0x1d')](_0x124a3a[_0x8bcf('0x34')][_0x8bcf('0x1d')]);_0x207cb3[_0x8bcf('0x1b')]=qs[_0x8bcf('0x1b')](_0x124a3a[_0x8bcf('0x34')]['offset']);}_0x207cb3[_0x8bcf('0x3c')]=qs['sort'](_0x124a3a[_0x8bcf('0x34')][_0x8bcf('0x3d')]);_0x207cb3[_0x8bcf('0x3e')]=qs[_0x8bcf('0x36')](_[_0x8bcf('0x3f')](_0x124a3a['query'],_0xae7c9f[_0x8bcf('0x36')]),_0x43b473);if(_0x124a3a['query'][_0x8bcf('0x40')]){_0x207cb3[_0x8bcf('0x3e')]=_[_0x8bcf('0x41')](_0x207cb3[_0x8bcf('0x3e')],{'$or':_['map'](_0x43b473,function(_0x58aea7){if(_0x58aea7[_0x8bcf('0x31')]!==_0x8bcf('0x42')){var _0x55f760={};_0x55f760[_0x58aea7['name']]={'$like':'%'+_0x124a3a[_0x8bcf('0x34')]['filter']+'%'};return _0x55f760;}})});}_0x207cb3=_[_0x8bcf('0x41')]({},_0x207cb3,_0x124a3a[_0x8bcf('0x43')]);var _0x5481b3={'where':_0x207cb3['where']};return db[_0x8bcf('0x2e')]['count'](_0x5481b3)[_0x8bcf('0x25')](function(_0x37f2f6){_0x21fbf4[_0x8bcf('0x1e')]=_0x37f2f6;if(_0x124a3a['query']['includeAll']){_0x207cb3['include']=[{'all':!![]}];}return db[_0x8bcf('0x2e')]['findAll'](_0x207cb3);})[_0x8bcf('0x25')](function(_0x4bf0bc){_0x21fbf4['rows']=_0x4bf0bc;return _0x21fbf4;})[_0x8bcf('0x25')](respondWithFilteredResult(_0xb59895,_0x207cb3))[_0x8bcf('0x44')](handleError(_0xb59895,null));};exports['show']=function(_0x30af99,_0x518b0b){var _0x744fcf={'raw':!![],'where':{'id':_0x30af99[_0x8bcf('0x45')]['id']}},_0x50f129={};_0x50f129[_0x8bcf('0x33')]=_['keys'](db[_0x8bcf('0x2e')][_0x8bcf('0x2f')]);_0x50f129[_0x8bcf('0x34')]=_[_0x8bcf('0x35')](_0x30af99[_0x8bcf('0x34')]);_0x50f129['filters']=_[_0x8bcf('0x37')](_0x50f129[_0x8bcf('0x33')],_0x50f129[_0x8bcf('0x34')]);_0x744fcf[_0x8bcf('0x38')]=_[_0x8bcf('0x37')](_0x50f129[_0x8bcf('0x33')],qs[_0x8bcf('0x39')](_0x30af99[_0x8bcf('0x34')][_0x8bcf('0x39')]));_0x744fcf[_0x8bcf('0x38')]=_0x744fcf[_0x8bcf('0x38')][_0x8bcf('0x3a')]?_0x744fcf[_0x8bcf('0x38')]:_0x50f129[_0x8bcf('0x33')];if(_0x30af99[_0x8bcf('0x34')]['includeAll']){_0x744fcf['include']=[{'all':!![]}];}_0x744fcf=_['merge']({},_0x744fcf,_0x30af99['options']);return db[_0x8bcf('0x2e')]['find'](_0x744fcf)[_0x8bcf('0x25')](handleEntityNotFound(_0x518b0b,null))[_0x8bcf('0x25')](respondWithResult(_0x518b0b,null))[_0x8bcf('0x44')](handleError(_0x518b0b,null));};exports[_0x8bcf('0x46')]=function(_0x2950ea,_0x453ca9){return db[_0x8bcf('0x2e')][_0x8bcf('0x46')](_0x2950ea[_0x8bcf('0x47')],{})[_0x8bcf('0x25')](function(_0x13f3fb){var _0x38573b=_0x2950ea[_0x8bcf('0x48')]['get']({'plain':!![]});if(!_0x38573b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x38573b[_0x8bcf('0x49')]===_0x8bcf('0x48')){var _0x61127a=_0x13f3fb[_0x8bcf('0x27')]({'plain':!![]});var _0x5e2ea0=_0x8bcf('0x28');return db['UserProfileSection'][_0x8bcf('0x4a')]({'where':{'name':_0x5e2ea0,'userProfileId':_0x38573b[_0x8bcf('0x4b')]},'raw':!![]})[_0x8bcf('0x25')](function(_0x55ed3e){if(_0x55ed3e&&_0x55ed3e[_0x8bcf('0x4c')]===0x0){return db[_0x8bcf('0x4d')][_0x8bcf('0x46')]({'name':_0x61127a[_0x8bcf('0x2a')],'resourceId':_0x61127a['id'],'type':_0x55ed3e[_0x8bcf('0x2a')],'sectionId':_0x55ed3e['id']},{})['then'](function(){return _0x13f3fb;});}else{return _0x13f3fb;}})[_0x8bcf('0x44')](function(_0x5dee9f){logger[_0x8bcf('0x4e')](_0x8bcf('0x4f'),_0x5dee9f);throw _0x5dee9f;});}return _0x13f3fb;})[_0x8bcf('0x25')](respondWithResult(_0x453ca9,0xc9))[_0x8bcf('0x44')](handleError(_0x453ca9,null));};exports['update']=function(_0x5b55c5,_0x31995d){if(_0x5b55c5[_0x8bcf('0x47')]['id']){delete _0x5b55c5[_0x8bcf('0x47')]['id'];}return db[_0x8bcf('0x2e')][_0x8bcf('0x4a')]({'where':{'id':_0x5b55c5[_0x8bcf('0x45')]['id']}})[_0x8bcf('0x25')](handleEntityNotFound(_0x31995d,null))['then'](saveUpdates(_0x5b55c5['body'],null))['then'](respondWithResult(_0x31995d,null))[_0x8bcf('0x44')](handleError(_0x31995d,null));};exports[_0x8bcf('0x26')]=function(_0x410dd3,_0x26f597){return db[_0x8bcf('0x2e')][_0x8bcf('0x4a')]({'where':{'id':_0x410dd3['params']['id']}})['then'](handleEntityNotFound(_0x26f597,null))[_0x8bcf('0x25')](removeEntity(_0x26f597,null))[_0x8bcf('0x44')](handleError(_0x26f597,null));};exports[_0x8bcf('0x50')]=function(_0x43e03d,_0x3e6962){return db['FaxQueue'][_0x8bcf('0x50')]()[_0x8bcf('0x25')](respondWithResult(_0x3e6962,null))['catch'](handleError(_0x3e6962,null));};exports[_0x8bcf('0x51')]=function(_0x303b31,_0x453588,_0x5da8e4){var _0x52dcdb={'raw':!![],'where':{}},_0x369d9b={},_0xd393c4;return db[_0x8bcf('0x2e')][_0x8bcf('0x52')]({'where':{'id':_0x303b31[_0x8bcf('0x45')]['id']}})[_0x8bcf('0x25')](handleEntityNotFound(_0x453588,null))[_0x8bcf('0x25')](function(_0x5eb2ac){if(_0x5eb2ac){_0xd393c4=_0x5eb2ac[_0x8bcf('0x27')]({'plain':!![]});_0x369d9b['model']=_['keys'](db[_0x8bcf('0x53')][_0x8bcf('0x2f')]);_0x369d9b[_0x8bcf('0x34')]=_[_0x8bcf('0x35')](_0x303b31[_0x8bcf('0x34')]);_0x369d9b[_0x8bcf('0x36')]=_[_0x8bcf('0x37')](_0x369d9b[_0x8bcf('0x33')],_0x369d9b[_0x8bcf('0x34')]);_0x52dcdb[_0x8bcf('0x38')]=_[_0x8bcf('0x37')](_0x369d9b['model'],qs[_0x8bcf('0x39')](_0x303b31['query']['fields']));_0x52dcdb['attributes']=_0x52dcdb[_0x8bcf('0x38')][_0x8bcf('0x3a')]?_0x52dcdb[_0x8bcf('0x38')]:_0x369d9b['model'];if(!_0x303b31[_0x8bcf('0x34')][_0x8bcf('0x3b')](_0x8bcf('0x54'))){_0x52dcdb[_0x8bcf('0x1d')]=qs[_0x8bcf('0x1d')](_0x303b31['query'][_0x8bcf('0x1d')]);_0x52dcdb[_0x8bcf('0x1b')]=qs[_0x8bcf('0x1b')](_0x303b31[_0x8bcf('0x34')][_0x8bcf('0x1b')]);}_0x52dcdb['order']=qs[_0x8bcf('0x3d')](_0x303b31[_0x8bcf('0x34')][_0x8bcf('0x3d')]);_0x52dcdb[_0x8bcf('0x3e')]=qs['filters'](_[_0x8bcf('0x3f')](_0x303b31['query'],_0x369d9b[_0x8bcf('0x36')]));_0x52dcdb[_0x8bcf('0x3e')][_0x8bcf('0x55')]=_0x5eb2ac['id'];if(_0x303b31[_0x8bcf('0x34')][_0x8bcf('0x40')]){_0x52dcdb[_0x8bcf('0x3e')]=_[_0x8bcf('0x41')](_0x52dcdb[_0x8bcf('0x3e')],{'$or':_[_0x8bcf('0x2d')](_0x52dcdb[_0x8bcf('0x38')],function(_0x5a5165){var _0x1cdcf6={};_0x1cdcf6[_0x5a5165]={'$like':'%'+_0x303b31[_0x8bcf('0x34')][_0x8bcf('0x40')]+'%'};return _0x1cdcf6;})});}_0x52dcdb=_[_0x8bcf('0x41')]({},_0x52dcdb,_0x303b31[_0x8bcf('0x43')]);return db['UserFaxQueue'][_0x8bcf('0x56')](_0x52dcdb);}})[_0x8bcf('0x25')](function(_0x32408f){if(_0x32408f){return db[_0x8bcf('0x57')]['findAndCountAll']({'where':{'id':_['map'](_0x32408f,_0x8bcf('0x58')),'role':_0x8bcf('0x59')},'attributes':['id',_0x8bcf('0x2a'),'faxPause',_0x8bcf('0x5a'),_0x8bcf('0x5b')]});}})['then'](function(_0x547b94){if(_0x547b94){return{'count':_0x547b94[_0x8bcf('0x1e')],'rows':_[_0x8bcf('0x2d')](_0x547b94[_0x8bcf('0x5c')],function(_0x5821d0){return{'membername':_0x5821d0[_0x8bcf('0x2a')],'UserId':_0x5821d0['id'],'queue_name':_0xd393c4[_0x8bcf('0x2a')],'FaxQueueId':_0xd393c4['id'],'interface':util['format'](_0x8bcf('0x5d'),_0x8bcf('0x5e'),_0x5821d0['name']),'penalty':0x0,'paused':_0x5821d0[_0x8bcf('0x5f')],'createdAt':_0x5821d0[_0x8bcf('0x5b')],'updatedAt':_0x5821d0['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8bcf('0x25')](respondWithFilteredResult(_0x453588,_0x52dcdb))[_0x8bcf('0x44')](handleError(_0x453588,null));};exports[_0x8bcf('0x60')]=function(_0x283150,_0x3ac072,_0x26f83a){var _0x15f3c7={};var _0x239ee1={};var _0x98d320;var _0x4ce46f;return db['FaxQueue'][_0x8bcf('0x52')]({'where':{'id':_0x283150['params']['id']}})[_0x8bcf('0x25')](handleEntityNotFound(_0x3ac072,null))['then'](function(_0x5c4810){if(_0x5c4810){_0x98d320=_0x5c4810;_0x239ee1[_0x8bcf('0x33')]=_[_0x8bcf('0x35')](db[_0x8bcf('0x61')][_0x8bcf('0x2f')]);_0x239ee1[_0x8bcf('0x34')]=_[_0x8bcf('0x35')](_0x283150[_0x8bcf('0x34')]);_0x239ee1[_0x8bcf('0x36')]=_[_0x8bcf('0x37')](_0x239ee1[_0x8bcf('0x33')],_0x239ee1['query']);_0x15f3c7[_0x8bcf('0x38')]=_[_0x8bcf('0x37')](_0x239ee1[_0x8bcf('0x33')],qs[_0x8bcf('0x39')](_0x283150[_0x8bcf('0x34')][_0x8bcf('0x39')]));_0x15f3c7[_0x8bcf('0x38')]=_0x15f3c7[_0x8bcf('0x38')][_0x8bcf('0x3a')]?_0x15f3c7[_0x8bcf('0x38')]:_0x239ee1[_0x8bcf('0x33')];_0x15f3c7[_0x8bcf('0x3c')]=qs[_0x8bcf('0x3d')](_0x283150[_0x8bcf('0x34')][_0x8bcf('0x3d')]);_0x15f3c7['where']=qs['filters'](_[_0x8bcf('0x3f')](_0x283150[_0x8bcf('0x34')],_0x239ee1[_0x8bcf('0x36')]));if(_0x283150[_0x8bcf('0x34')][_0x8bcf('0x40')]){_0x15f3c7[_0x8bcf('0x3e')]=_[_0x8bcf('0x41')](_0x15f3c7[_0x8bcf('0x3e')],{'$or':_[_0x8bcf('0x2d')](_0x15f3c7['attributes'],function(_0x3b5772){var _0x1b9e56={};_0x1b9e56[_0x3b5772]={'$like':'%'+_0x283150[_0x8bcf('0x34')][_0x8bcf('0x40')]+'%'};return _0x1b9e56;})});}_0x15f3c7=_[_0x8bcf('0x41')]({},_0x15f3c7,_0x283150[_0x8bcf('0x43')]);return _0x98d320['getTeams'](_0x15f3c7);}})[_0x8bcf('0x25')](function(_0x4aff3e){if(_0x4aff3e){_0x4ce46f=_0x4aff3e[_0x8bcf('0x3a')];if(!_0x283150[_0x8bcf('0x34')][_0x8bcf('0x3b')](_0x8bcf('0x54'))){_0x15f3c7[_0x8bcf('0x1d')]=qs[_0x8bcf('0x1d')](_0x283150[_0x8bcf('0x34')]['limit']);_0x15f3c7[_0x8bcf('0x1b')]=qs[_0x8bcf('0x1b')](_0x283150[_0x8bcf('0x34')]['offset']);}return _0x98d320[_0x8bcf('0x60')](_0x15f3c7);}})['then'](function(_0x144ea3){if(_0x144ea3){return _0x144ea3?{'count':_0x4ce46f,'rows':_0x144ea3}:null;}})[_0x8bcf('0x25')](respondWithResult(_0x3ac072,null))[_0x8bcf('0x44')](handleError(_0x3ac072,null));};exports['addTeams']=function(_0x1df91a,_0x5719c4,_0x59c6e1){var _0x4b587f=_0x1df91a['body'][_0x8bcf('0x62')];return db['Team']['findAll']({'where':{'id':_0x4b587f},'attributes':['id'],'include':[{'model':db[_0x8bcf('0x57')],'as':_0x8bcf('0x63'),'attributes':['id',_0x8bcf('0x2a'),_0x8bcf('0x64'),_0x8bcf('0x65'),'interface'],'raw':!![]}]})[_0x8bcf('0x25')](function(_0x18d0a9){if(_0x18d0a9){var _0x45329c=_[_0x8bcf('0x66')](_0x18d0a9,function(_0x29b4eb){var _0x5de124=_0x29b4eb[_0x8bcf('0x27')]({'plain':!![]});return _0x5de124['Agents'];});return db['FaxQueue'][_0x8bcf('0x4a')]({'where':{'id':_0x1df91a[_0x8bcf('0x45')]['id']}})[_0x8bcf('0x25')](function(_0x16b85){return db[_0x8bcf('0x67')][_0x8bcf('0x68')](function(_0x309eb5){return _0x16b85[_0x8bcf('0x69')](_0x4b587f,{'transaction':_0x309eb5})['then'](function(){return BPromise[_0x8bcf('0x6a')](_0x45329c,function(_0x2b18fd){return db[_0x8bcf('0x53')][_0x8bcf('0x6b')]({'where':{'UserId':_0x2b18fd['id'],'FaxQueueId':_0x1df91a[_0x8bcf('0x45')]['id']},'transaction':_0x309eb5});});})[_0x8bcf('0x25')](function(){_0x45329c['forEach'](function(_0x3b80e9){socket[_0x8bcf('0x6c')]('userFaxQueue:save',{'UserId':_0x3b80e9['id'],'FaxQueueId':_0x16b85['id']});});});});});}})[_0x8bcf('0x25')](respondWithStatusCode(_0x5719c4,null))[_0x8bcf('0x44')](handleError(_0x5719c4,null));};exports[_0x8bcf('0x6d')]=function(_0x2253e6,_0x4d83b7,_0x25d70c){return db[_0x8bcf('0x61')][_0x8bcf('0x56')]({'where':{'id':_0x2253e6['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x8bcf('0x57')],'as':_0x8bcf('0x63'),'attributes':['id'],'raw':!![]}]})[_0x8bcf('0x25')](handleEntityNotFound(_0x4d83b7,null))[_0x8bcf('0x25')](function(_0x5f3e88){var _0x297b0a=_[_0x8bcf('0x2d')](_0x5f3e88,'id');var _0x2ef313=[];var _0x560552=[];var _0x45cf84=squel[_0x8bcf('0x6e')]();_0x45cf84[_0x8bcf('0x6f')]('tq.TeamId')[_0x8bcf('0x70')](_0x8bcf('0x71'),'tq')['join']('user_has_teams','ut',_0x8bcf('0x72'))[_0x8bcf('0x3e')](_0x8bcf('0x73'),_0x2253e6[_0x8bcf('0x45')]['id']);for(var _0x3f7d87=0x0;_0x3f7d87<_0x5f3e88['length'];_0x3f7d87+=0x1){let _0x2b954e=_0x5f3e88[_0x3f7d87];for(var _0x4c5600=0x0;_0x4c5600<_0x2b954e[_0x8bcf('0x63')][_0x8bcf('0x3a')];_0x4c5600+=0x1){let _0x47a130=_0x2b954e[_0x8bcf('0x63')][_0x4c5600];var _0x5a0357=_0x45cf84[_0x8bcf('0x74')]();_0x5a0357[_0x8bcf('0x3e')]('ut.UserId\x20=\x20?',_0x47a130['id']);_0x560552['push'](db['sequelize'][_0x8bcf('0x34')](_0x5a0357[_0x8bcf('0x75')](),{'type':db[_0x8bcf('0x67')][_0x8bcf('0x76')][_0x8bcf('0x77')]})['then'](function(_0x525bbb){if(_0x525bbb[_0x8bcf('0x3a')]===0x1){return _0x47a130['id'];}else{var _0x3741c7=_[_0x8bcf('0x78')](_[_0x8bcf('0x2d')](_0x525bbb,_0x8bcf('0x79')),function(_0x111f16){return _[_0x8bcf('0x7a')](_0x297b0a,_0x111f16);});if(_0x3741c7){return _0x47a130['id'];}}}));}}return BPromise[_0x8bcf('0x7b')](_0x560552)['then'](function(_0x5ac6b7){_0x2ef313=_(_0x2ef313)[_0x8bcf('0x7c')](_0x5ac6b7)[_0x8bcf('0x7d')]()['value']();return db[_0x8bcf('0x2e')][_0x8bcf('0x4a')]({'where':{'id':_0x2253e6[_0x8bcf('0x45')]['id']}})[_0x8bcf('0x25')](function(_0x5a7637){return db['sequelize']['transaction'](function(_0x3ee905){return _0x5a7637[_0x8bcf('0x6d')](_0x2253e6[_0x8bcf('0x34')][_0x8bcf('0x62')],{'transaction':_0x3ee905})[_0x8bcf('0x25')](function(){if(!_[_0x8bcf('0x7e')](_0x2ef313)){return _0x5a7637['removeAgents'](_0x2ef313,{'transaction':_0x3ee905});}})[_0x8bcf('0x25')](function(){_0x2ef313[_0x8bcf('0x7f')](function(_0x31aa66){socket['emit']('userFaxQueue:remove',{'UserId':_0x31aa66,'FaxQueueId':_0x5a7637['id']});});});});});});})[_0x8bcf('0x25')](respondWithStatusCode(_0x4d83b7,null))[_0x8bcf('0x44')](handleError(_0x4d83b7,null));};exports[_0x8bcf('0x80')]=function(_0x1f2b11,_0x4388e7,_0x331e37){return db[_0x8bcf('0x2e')]['find']({'where':{'id':_0x1f2b11[_0x8bcf('0x45')]['id']}})['then'](handleEntityNotFound(_0x4388e7,null))[_0x8bcf('0x25')](function(_0x310ad9){if(_0x310ad9){return _0x310ad9[_0x8bcf('0x80')](_0x1f2b11[_0x8bcf('0x47')]['ids'],_[_0x8bcf('0x81')](_0x1f2b11[_0x8bcf('0x47')],['ids','id'])||{})[_0x8bcf('0x82')](function(_0x53694a){for(var _0x32ce72=0x0;_0x32ce72<_0x1f2b11[_0x8bcf('0x47')][_0x8bcf('0x62')][_0x8bcf('0x3a')];_0x32ce72+=0x1){socket[_0x8bcf('0x6c')](_0x8bcf('0x83'),{'UserId':Number(_0x1f2b11[_0x8bcf('0x47')][_0x8bcf('0x62')][_0x32ce72]),'FaxQueueId':Number(_0x1f2b11['params']['id'])});}return _0x53694a;});}})[_0x8bcf('0x25')](respondWithResult(_0x4388e7,null))[_0x8bcf('0x44')](handleError(_0x4388e7,null));};exports[_0x8bcf('0x84')]=function(_0x35ebcd,_0x4bd7aa,_0x412c06){return db[_0x8bcf('0x2e')]['find']({'where':{'id':_0x35ebcd[_0x8bcf('0x45')]['id']}})[_0x8bcf('0x25')](handleEntityNotFound(_0x4bd7aa,null))[_0x8bcf('0x25')](function(_0x16ae75){if(_0x16ae75){return _0x16ae75[_0x8bcf('0x84')](_0x35ebcd[_0x8bcf('0x34')]['ids'])[_0x8bcf('0x25')](function(){if(_['isArray'](_0x35ebcd['query'][_0x8bcf('0x62')])){for(var _0x8e96a6=0x0;_0x8e96a6<_0x35ebcd[_0x8bcf('0x34')]['ids'][_0x8bcf('0x3a')];_0x8e96a6+=0x1){socket[_0x8bcf('0x6c')](_0x8bcf('0x85'),{'UserId':Number(_0x35ebcd[_0x8bcf('0x34')]['ids'][_0x8e96a6]),'FaxQueueId':Number(_0x35ebcd[_0x8bcf('0x45')]['id'])});}}else{socket[_0x8bcf('0x6c')]('userFaxQueue:remove',{'UserId':Number(_0x35ebcd[_0x8bcf('0x34')][_0x8bcf('0x62')]),'FaxQueueId':Number(_0x35ebcd[_0x8bcf('0x45')]['id'])});}});}})[_0x8bcf('0x25')](respondWithStatusCode(_0x4bd7aa,null))[_0x8bcf('0x44')](handleError(_0x4bd7aa,null));};exports['getAgents']=function(_0xc51e18,_0x51c664,_0x347895){var _0x407f7c={};var _0x434695={};var _0x4a708c;var _0x4ccfe6;return db['FaxQueue']['findOne']({'where':{'id':_0xc51e18[_0x8bcf('0x45')]['id']}})[_0x8bcf('0x25')](handleEntityNotFound(_0x51c664,null))[_0x8bcf('0x25')](function(_0xcbf805){if(_0xcbf805){_0x4a708c=_0xcbf805;_0x434695[_0x8bcf('0x33')]=_[_0x8bcf('0x35')](db['User']['rawAttributes']);_0x434695['query']=_['keys'](_0xc51e18[_0x8bcf('0x34')]);_0x434695[_0x8bcf('0x36')]=_[_0x8bcf('0x37')](_0x434695[_0x8bcf('0x33')],_0x434695['query']);_0x407f7c[_0x8bcf('0x38')]=_['intersection'](_0x434695[_0x8bcf('0x33')],qs[_0x8bcf('0x39')](_0xc51e18[_0x8bcf('0x34')][_0x8bcf('0x39')]));_0x407f7c[_0x8bcf('0x38')]=_0x407f7c[_0x8bcf('0x38')][_0x8bcf('0x3a')]?_0x407f7c[_0x8bcf('0x38')]:_0x434695[_0x8bcf('0x33')];_0x407f7c[_0x8bcf('0x3c')]=qs[_0x8bcf('0x3d')](_0xc51e18['query'][_0x8bcf('0x3d')]);_0x407f7c[_0x8bcf('0x3e')]=qs[_0x8bcf('0x36')](_['pick'](_0xc51e18['query'],_0x434695[_0x8bcf('0x36')]));if(_0xc51e18[_0x8bcf('0x34')][_0x8bcf('0x40')]){_0x407f7c['where']=_[_0x8bcf('0x41')](_0x407f7c[_0x8bcf('0x3e')],{'$or':_[_0x8bcf('0x2d')](_0x407f7c['attributes'],function(_0x5501fd){var _0x3a5457={};_0x3a5457[_0x5501fd]={'$like':'%'+_0xc51e18[_0x8bcf('0x34')]['filter']+'%'};return _0x3a5457;})});}_0x407f7c=_[_0x8bcf('0x41')]({},_0x407f7c,_0xc51e18[_0x8bcf('0x43')]);return _0x4a708c[_0x8bcf('0x86')](_0x407f7c);}})[_0x8bcf('0x25')](function(_0x5ecaff){if(_0x5ecaff){_0x4ccfe6=_0x5ecaff[_0x8bcf('0x3a')];if(!_0xc51e18[_0x8bcf('0x34')][_0x8bcf('0x3b')](_0x8bcf('0x54'))){_0x407f7c[_0x8bcf('0x1d')]=qs['limit'](_0xc51e18[_0x8bcf('0x34')][_0x8bcf('0x1d')]);_0x407f7c[_0x8bcf('0x1b')]=qs[_0x8bcf('0x1b')](_0xc51e18[_0x8bcf('0x34')][_0x8bcf('0x1b')]);}return _0x4a708c[_0x8bcf('0x86')](_0x407f7c);}})['then'](function(_0x1de4d7){if(_0x1de4d7){return _0x1de4d7?{'count':_0x4ccfe6,'rows':_0x1de4d7}:null;}})['then'](respondWithResult(_0x51c664,null))[_0x8bcf('0x44')](handleError(_0x51c664,null));};
\ No newline at end of file
index ff102d9..1d60104 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4e3=['emit','hasOwnProperty','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove'];(function(_0x6e0605,_0x7c35a5){var _0x273e24=function(_0x4150da){while(--_0x4150da){_0x6e0605['push'](_0x6e0605['shift']());}};_0x273e24(++_0x7c35a5);}(_0xb4e3,0x71));var _0x3b4e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xb4e3[_0x2d8fc2];return _0x3a9e53;};'use strict';var EventEmitter=require(_0x3b4e('0x0'));var FaxQueue=require(_0x3b4e('0x1'))['db'][_0x3b4e('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x3b4e('0x3')](0x0);var events={'afterCreate':_0x3b4e('0x4'),'afterUpdate':_0x3b4e('0x5'),'afterDestroy':_0x3b4e('0x6')};function emitEvent(_0x13b1e1){return function(_0x3e8a7c,_0x30ef9b,_0x15e014){FaxQueueEvents[_0x3b4e('0x7')](_0x13b1e1+':'+_0x3e8a7c['id'],_0x3e8a7c);FaxQueueEvents[_0x3b4e('0x7')](_0x13b1e1,_0x3e8a7c);_0x15e014(null);};}for(var e in events){if(events[_0x3b4e('0x8')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x3b4e('0x9')]=FaxQueueEvents;
\ No newline at end of file
+var _0xf508=['FaxQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x4ddf68,_0x56deb8){var _0x4f17eb=function(_0xb07f56){while(--_0xb07f56){_0x4ddf68['push'](_0x4ddf68['shift']());}};_0x4f17eb(++_0x56deb8);}(_0xf508,0x179));var _0x8f50=function(_0x5afc84,_0x50c8b6){_0x5afc84=_0x5afc84-0x0;var _0x1b1085=_0xf508[_0x5afc84];return _0x1b1085;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x8f50('0x0'))['db'][_0x8f50('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x8f50('0x2')](0x0);var events={'afterCreate':_0x8f50('0x3'),'afterUpdate':'update','afterDestroy':_0x8f50('0x4')};function emitEvent(_0x19d9e7){return function(_0x3ce794,_0x2e1364,_0x1501f1){FaxQueueEvents['emit'](_0x19d9e7+':'+_0x3ce794['id'],_0x3ce794);FaxQueueEvents[_0x8f50('0x5')](_0x19d9e7,_0x3ce794);_0x1501f1(null);};}for(var e in events){if(events[_0x8f50('0x6')](e)){var event=events[e];FaxQueue[_0x8f50('0x7')](e,emitEvent(event));}}module[_0x8f50('0x8')]=FaxQueueEvents;
\ No newline at end of file
index b12e4eb..9091e59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdee=['../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','util','api','bluebird','request-promise','path'];(function(_0x979a15,_0x3f49e8){var _0xc2a301=function(_0x37bfa7){while(--_0x37bfa7){_0x979a15['push'](_0x979a15['shift']());}};_0xc2a301(++_0x3f49e8);}(_0xcdee,0xe2));var _0xecde=function(_0x1da581,_0xa96fef){_0x1da581=_0x1da581-0x0;var _0x190938=_0xcdee[_0x1da581];return _0x190938;};'use strict';var _=require('lodash');var util=require(_0xecde('0x0'));var logger=require('../../config/logger')(_0xecde('0x1'));var moment=require('moment');var BPromise=require(_0xecde('0x2'));var rp=require(_0xecde('0x3'));var fs=require('fs');var path=require(_0xecde('0x4'));var rimraf=require('rimraf');var config=require(_0xecde('0x5'));var attributes=require(_0xecde('0x6'));module[_0xecde('0x7')]=function(_0x3da5bd,_0x9c5bf0){return _0x3da5bd[_0xecde('0x8')](_0xecde('0x9'),attributes,{'tableName':_0xecde('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a2d=['fax_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4a2d,0x14b));var _0xd4a2=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x4a2d[_0x4c440b];return _0x2d48cf;};'use strict';var _=require(_0xd4a2('0x0'));var util=require(_0xd4a2('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd4a2('0x2'));var rp=require(_0xd4a2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd4a2('0x4'));var config=require(_0xd4a2('0x5'));var attributes=require(_0xd4a2('0x6'));module[_0xd4a2('0x7')]=function(_0x14a27d,_0x2bcf50){return _0x14a27d[_0xd4a2('0x8')](_0xd4a2('0x9'),attributes,{'tableName':_0xd4a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 428aed7..56610c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8e1=['defaults','localhost','./faxQueue.socket','register','info','FaxQueue,\x20%s,\x20%s','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetFaxQueue','findAll','options','where','attributes','map','include','model','then','ShowFaxQueue','find','raw','debug','stringify','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0xf8e1,0x10b));var _0x1f8e=function(_0x41e47a,_0xd8d57d){_0x41e47a=_0x41e47a-0x0;var _0x4463d4=_0xf8e1[_0x41e47a];return _0x4463d4;};'use strict';var _=require('lodash');var util=require(_0x1f8e('0x0'));var moment=require(_0x1f8e('0x1'));var BPromise=require(_0x1f8e('0x2'));var rs=require(_0x1f8e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f8e('0x4'))['db'];var utils=require(_0x1f8e('0x5'));var logger=require(_0x1f8e('0x6'))(_0x1f8e('0x7'));var config=require(_0x1f8e('0x8'));var jayson=require(_0x1f8e('0x9'));var client=jayson[_0x1f8e('0xa')][_0x1f8e('0xb')]({'port':0x232a});config[_0x1f8e('0xc')]=_[_0x1f8e('0xd')](config[_0x1f8e('0xc')],{'host':_0x1f8e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1f8e('0xf'))[_0x1f8e('0x10')](socket);function respondWithRpcPromise(_0x3f8830,_0x36ac77,_0x378fb9){return new BPromise(function(_0x8a35b5,_0x4dc8d2){return client['request'](_0x3f8830,_0x378fb9)['then'](function(_0x35e68f){logger[_0x1f8e('0x11')](_0x1f8e('0x12'),_0x36ac77,'request\x20sent');logger['debug'](_0x1f8e('0x13'),_0x36ac77,_0x1f8e('0x14'),JSON['stringify'](_0x35e68f));if(_0x35e68f[_0x1f8e('0x15')]){if(_0x35e68f[_0x1f8e('0x15')][_0x1f8e('0x16')]===0x1f4){logger[_0x1f8e('0x15')](_0x1f8e('0x12'),_0x36ac77,_0x35e68f[_0x1f8e('0x15')][_0x1f8e('0x17')]);return _0x4dc8d2(_0x35e68f[_0x1f8e('0x15')]['message']);}logger['error'](_0x1f8e('0x12'),_0x36ac77,_0x35e68f[_0x1f8e('0x15')]['message']);return _0x8a35b5(_0x35e68f['error']['message']);}else{logger[_0x1f8e('0x11')](_0x1f8e('0x12'),_0x36ac77,_0x1f8e('0x14'));_0x8a35b5(_0x35e68f[_0x1f8e('0x18')][_0x1f8e('0x17')]);}})[_0x1f8e('0x19')](function(_0x366d7c){logger[_0x1f8e('0x15')](_0x1f8e('0x12'),_0x36ac77,_0x366d7c);_0x4dc8d2(_0x366d7c);});});}exports[_0x1f8e('0x1a')]=function(_0x417eca){var _0x4a89cc=this;return new Promise(function(_0x5ea87f,_0x21733e){return db['FaxQueue'][_0x1f8e('0x1b')]({'raw':_0x417eca[_0x1f8e('0x1c')]?_0x417eca[_0x1f8e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x417eca['options']?_0x417eca['options'][_0x1f8e('0x1d')]||null:null,'attributes':_0x417eca['options']?_0x417eca['options'][_0x1f8e('0x1e')]||null:null,'limit':_0x417eca['options']?_0x417eca['options']['limit']||null:null,'include':_0x417eca[_0x1f8e('0x1c')]?_0x417eca[_0x1f8e('0x1c')]['include']?_[_0x1f8e('0x1f')](_0x417eca[_0x1f8e('0x1c')][_0x1f8e('0x20')],function(_0x28edfe){return{'model':db[_0x28edfe[_0x1f8e('0x21')]],'as':_0x28edfe['as'],'attributes':_0x28edfe[_0x1f8e('0x1e')],'include':_0x28edfe[_0x1f8e('0x20')]?_[_0x1f8e('0x1f')](_0x28edfe[_0x1f8e('0x20')],function(_0x3c4dac){return{'model':db[_0x3c4dac[_0x1f8e('0x21')]],'as':_0x3c4dac['as'],'attributes':_0x3c4dac[_0x1f8e('0x1e')],'include':_0x3c4dac[_0x1f8e('0x20')]?_['map'](_0x3c4dac[_0x1f8e('0x20')],function(_0x4f5037){return{'model':db[_0x4f5037[_0x1f8e('0x21')]],'as':_0x4f5037['as'],'attributes':_0x4f5037[_0x1f8e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1f8e('0x22')](function(_0x1ad162){logger[_0x1f8e('0x11')](_0x1f8e('0x1a'),_0x417eca);logger['debug'](_0x1f8e('0x1a'),_0x417eca,JSON['stringify'](_0x1ad162));_0x5ea87f(_0x1ad162);})['catch'](function(_0x457128){logger[_0x1f8e('0x15')]('GetFaxQueue',_0x457128['message'],_0x417eca);_0x21733e(_0x4a89cc['error'](0x1f4,_0x457128['message']));});});};exports[_0x1f8e('0x23')]=function(_0x5d06f9){var _0x2ea8c4=this;return new Promise(function(_0x1f525e,_0x1fd1ae){return db['FaxQueue'][_0x1f8e('0x24')]({'raw':_0x5d06f9[_0x1f8e('0x1c')]?_0x5d06f9[_0x1f8e('0x1c')][_0x1f8e('0x25')]===undefined?!![]:![]:!![],'where':_0x5d06f9[_0x1f8e('0x1c')]?_0x5d06f9[_0x1f8e('0x1c')][_0x1f8e('0x1d')]||null:null,'attributes':_0x5d06f9[_0x1f8e('0x1c')]?_0x5d06f9[_0x1f8e('0x1c')][_0x1f8e('0x1e')]||null:null,'include':_0x5d06f9[_0x1f8e('0x1c')]?_0x5d06f9[_0x1f8e('0x1c')][_0x1f8e('0x20')]?_[_0x1f8e('0x1f')](_0x5d06f9[_0x1f8e('0x1c')][_0x1f8e('0x20')],function(_0x51e149){return{'model':db[_0x51e149[_0x1f8e('0x21')]],'as':_0x51e149['as'],'attributes':_0x51e149[_0x1f8e('0x1e')],'include':_0x51e149[_0x1f8e('0x20')]?_[_0x1f8e('0x1f')](_0x51e149[_0x1f8e('0x20')],function(_0x183a01){return{'model':db[_0x183a01[_0x1f8e('0x21')]],'as':_0x183a01['as'],'attributes':_0x183a01[_0x1f8e('0x1e')],'include':_0x183a01[_0x1f8e('0x20')]?_[_0x1f8e('0x1f')](_0x183a01[_0x1f8e('0x20')],function(_0x419509){return{'model':db[_0x419509[_0x1f8e('0x21')]],'as':_0x419509['as'],'attributes':_0x419509[_0x1f8e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x1f8e('0x22')](function(_0x179b07){logger['info'](_0x1f8e('0x23'),_0x5d06f9);logger[_0x1f8e('0x26')](_0x1f8e('0x23'),_0x5d06f9,JSON[_0x1f8e('0x27')](_0x179b07));_0x1f525e(_0x179b07);})[_0x1f8e('0x19')](function(_0xd6104b){logger[_0x1f8e('0x15')](_0x1f8e('0x23'),_0xd6104b[_0x1f8e('0x17')],_0x5d06f9);_0x1fd1ae(_0x2ea8c4[_0x1f8e('0x15')](0x1f4,_0xd6104b[_0x1f8e('0x17')]));});});};
\ No newline at end of file
+var _0xf348=['redis','defaults','socket.io-emitter','register','request','info','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','FaxQueue,\x20%s,\x20%s','message','GetFaxQueue','findAll','options','raw','attributes','limit','include','model','map','then','debug','stringify','catch','ShowFaxQueue','FaxQueue','find','where','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http'];(function(_0xe5ffed,_0x31d553){var _0x2cb308=function(_0x13ba53){while(--_0x13ba53){_0xe5ffed['push'](_0xe5ffed['shift']());}};_0x2cb308(++_0x31d553);}(_0xf348,0x101));var _0x8f34=function(_0x340f8c,_0x41269f){_0x340f8c=_0x340f8c-0x0;var _0x6c4a36=_0xf348[_0x340f8c];return _0x6c4a36;};'use strict';var _=require(_0x8f34('0x0'));var util=require('util');var moment=require(_0x8f34('0x1'));var BPromise=require(_0x8f34('0x2'));var rs=require(_0x8f34('0x3'));var fs=require('fs');var Redis=require(_0x8f34('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f34('0x5'));var logger=require(_0x8f34('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8f34('0x7'));var client=jayson['client'][_0x8f34('0x8')]({'port':0x232a});config[_0x8f34('0x9')]=_[_0x8f34('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8f34('0xb'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x8f34('0xc')](socket);function respondWithRpcPromise(_0x3c2ba1,_0x22583d,_0x1aa6d9){return new BPromise(function(_0x2dea86,_0x2fd608){return client[_0x8f34('0xd')](_0x3c2ba1,_0x1aa6d9)['then'](function(_0x4a6717){logger[_0x8f34('0xe')]('FaxQueue,\x20%s,\x20%s',_0x22583d,_0x8f34('0xf'));logger['debug'](_0x8f34('0x10'),_0x22583d,_0x8f34('0xf'),JSON['stringify'](_0x4a6717));if(_0x4a6717[_0x8f34('0x11')]){if(_0x4a6717[_0x8f34('0x11')][_0x8f34('0x12')]===0x1f4){logger[_0x8f34('0x11')](_0x8f34('0x13'),_0x22583d,_0x4a6717[_0x8f34('0x11')][_0x8f34('0x14')]);return _0x2fd608(_0x4a6717['error'][_0x8f34('0x14')]);}logger[_0x8f34('0x11')](_0x8f34('0x13'),_0x22583d,_0x4a6717[_0x8f34('0x11')]['message']);return _0x2dea86(_0x4a6717[_0x8f34('0x11')]['message']);}else{logger[_0x8f34('0xe')](_0x8f34('0x13'),_0x22583d,_0x8f34('0xf'));_0x2dea86(_0x4a6717['result'][_0x8f34('0x14')]);}})['catch'](function(_0x4f4770){logger[_0x8f34('0x11')](_0x8f34('0x13'),_0x22583d,_0x4f4770);_0x2fd608(_0x4f4770);});});}exports[_0x8f34('0x15')]=function(_0x5c8a4c){var _0x578fba=this;return new Promise(function(_0x266748,_0x294707){return db['FaxQueue'][_0x8f34('0x16')]({'raw':_0x5c8a4c['options']?_0x5c8a4c[_0x8f34('0x17')][_0x8f34('0x18')]===undefined?!![]:![]:!![],'where':_0x5c8a4c['options']?_0x5c8a4c['options']['where']||null:null,'attributes':_0x5c8a4c[_0x8f34('0x17')]?_0x5c8a4c['options'][_0x8f34('0x19')]||null:null,'limit':_0x5c8a4c['options']?_0x5c8a4c[_0x8f34('0x17')][_0x8f34('0x1a')]||null:null,'include':_0x5c8a4c[_0x8f34('0x17')]?_0x5c8a4c['options'][_0x8f34('0x1b')]?_['map'](_0x5c8a4c[_0x8f34('0x17')][_0x8f34('0x1b')],function(_0x377dad){return{'model':db[_0x377dad[_0x8f34('0x1c')]],'as':_0x377dad['as'],'attributes':_0x377dad[_0x8f34('0x19')],'include':_0x377dad[_0x8f34('0x1b')]?_[_0x8f34('0x1d')](_0x377dad[_0x8f34('0x1b')],function(_0x32f80a){return{'model':db[_0x32f80a[_0x8f34('0x1c')]],'as':_0x32f80a['as'],'attributes':_0x32f80a[_0x8f34('0x19')],'include':_0x32f80a[_0x8f34('0x1b')]?_[_0x8f34('0x1d')](_0x32f80a[_0x8f34('0x1b')],function(_0xa4fd95){return{'model':db[_0xa4fd95[_0x8f34('0x1c')]],'as':_0xa4fd95['as'],'attributes':_0xa4fd95['attributes']};}):[]};}):[]};}):[]:[]})[_0x8f34('0x1e')](function(_0x1bf0ad){logger['info'](_0x8f34('0x15'),_0x5c8a4c);logger[_0x8f34('0x1f')](_0x8f34('0x15'),_0x5c8a4c,JSON[_0x8f34('0x20')](_0x1bf0ad));_0x266748(_0x1bf0ad);})[_0x8f34('0x21')](function(_0xef4889){logger[_0x8f34('0x11')]('GetFaxQueue',_0xef4889[_0x8f34('0x14')],_0x5c8a4c);_0x294707(_0x578fba['error'](0x1f4,_0xef4889[_0x8f34('0x14')]));});});};exports[_0x8f34('0x22')]=function(_0x2ebfc7){var _0x268ab8=this;return new Promise(function(_0x496fcb,_0x2d5d91){return db[_0x8f34('0x23')][_0x8f34('0x24')]({'raw':_0x2ebfc7[_0x8f34('0x17')]?_0x2ebfc7[_0x8f34('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2ebfc7['options']?_0x2ebfc7['options'][_0x8f34('0x25')]||null:null,'attributes':_0x2ebfc7['options']?_0x2ebfc7['options']['attributes']||null:null,'include':_0x2ebfc7[_0x8f34('0x17')]?_0x2ebfc7[_0x8f34('0x17')][_0x8f34('0x1b')]?_['map'](_0x2ebfc7['options'][_0x8f34('0x1b')],function(_0x24412f){return{'model':db[_0x24412f['model']],'as':_0x24412f['as'],'attributes':_0x24412f[_0x8f34('0x19')],'include':_0x24412f[_0x8f34('0x1b')]?_['map'](_0x24412f['include'],function(_0x7749d8){return{'model':db[_0x7749d8[_0x8f34('0x1c')]],'as':_0x7749d8['as'],'attributes':_0x7749d8[_0x8f34('0x19')],'include':_0x7749d8[_0x8f34('0x1b')]?_[_0x8f34('0x1d')](_0x7749d8['include'],function(_0x1390de){return{'model':db[_0x1390de[_0x8f34('0x1c')]],'as':_0x1390de['as'],'attributes':_0x1390de['attributes']};}):[]};}):[]};}):[]:[]})[_0x8f34('0x1e')](function(_0x540d72){logger['info'](_0x8f34('0x22'),_0x2ebfc7);logger[_0x8f34('0x1f')]('ShowFaxQueue',_0x2ebfc7,JSON['stringify'](_0x540d72));_0x496fcb(_0x540d72);})[_0x8f34('0x21')](function(_0x2f812a){logger[_0x8f34('0x11')]('ShowFaxQueue',_0x2f812a['message'],_0x2ebfc7);_0x2d5d91(_0x268ab8['error'](0x1f4,_0x2f812a[_0x8f34('0x14')]));});});};
\ No newline at end of file
index 3049a27..a01192a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e6f=['remove','emit','removeListener','register','faxQueue:'];(function(_0x217123,_0x2097a8){var _0x48763e=function(_0x333965){while(--_0x333965){_0x217123['push'](_0x217123['shift']());}};_0x48763e(++_0x2097a8);}(_0x0e6f,0x159));var _0xf0e6=function(_0x1c5f32,_0x1ac260){_0x1c5f32=_0x1c5f32-0x0;var _0x3bd1e8=_0x0e6f[_0x1c5f32];return _0x3bd1e8;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save',_0xf0e6('0x0'),'update'];function createListener(_0x8663a1,_0x2f3095){return function(_0x4a12b5){_0x2f3095[_0xf0e6('0x1')](_0x8663a1,_0x4a12b5);};}function removeListener(_0x3880fd,_0x5eda56){return function(){FaxQueueEvents[_0xf0e6('0x2')](_0x3880fd,_0x5eda56);};}exports[_0xf0e6('0x3')]=function(_0x18c38a){for(var _0x48c140=0x0,_0x296217=events['length'];_0x48c140<_0x296217;_0x48c140++){var _0x249645=events[_0x48c140];var _0x3ca910=createListener(_0xf0e6('0x4')+_0x249645,_0x18c38a);FaxQueueEvents['on'](_0x249645,_0x3ca910);}};
\ No newline at end of file
+var _0x1da9=['faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x517021,_0x1a98ad){var _0x577e19=function(_0x2333b9){while(--_0x2333b9){_0x517021['push'](_0x517021['shift']());}};_0x577e19(++_0x1a98ad);}(_0x1da9,0x141));var _0x91da=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1da9[_0x14add3];return _0x4a174f;};'use strict';var FaxQueueEvents=require(_0x91da('0x0'));var events=[_0x91da('0x1'),_0x91da('0x2'),_0x91da('0x3')];function createListener(_0x18bb47,_0x3bb4f8){return function(_0x2526ae){_0x3bb4f8[_0x91da('0x4')](_0x18bb47,_0x2526ae);};}function removeListener(_0x2f6adf,_0x3bfd6d){return function(){FaxQueueEvents[_0x91da('0x5')](_0x2f6adf,_0x3bfd6d);};}exports[_0x91da('0x6')]=function(_0x396335){for(var _0x23a881=0x0,_0x463ad9=events['length'];_0x23a881<_0x463ad9;_0x23a881++){var _0x5e8bab=events[_0x23a881];var _0x1fd3b9=createListener(_0x91da('0x7')+_0x5e8bab,_0x396335);FaxQueueEvents['on'](_0x5e8bab,_0x1fd3b9);}};
\ No newline at end of file
index 884959b..1113acf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef17=['removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','isAuthenticated','get','describe','show','/:id/members','getMembers','getTeams','getAgents','create','post','/:id/teams','addTeams','/:id/users','put','update','destroy'];(function(_0x3f09a9,_0x2a1758){var _0x854a6d=function(_0x3eff89){while(--_0x3eff89){_0x3f09a9['push'](_0x3f09a9['shift']());}};_0x854a6d(++_0x2a1758);}(_0xef17,0x136));var _0x7ef1=function(_0x38aca6,_0x12dfcf){_0x38aca6=_0x38aca6-0x0;var _0x551d04=_0xef17[_0x38aca6];return _0x551d04;};'use strict';var multer=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var path=require(_0x7ef1('0x2'));var timeout=require(_0x7ef1('0x3'));var express=require(_0x7ef1('0x4'));var router=express[_0x7ef1('0x5')]();var fs_extra=require(_0x7ef1('0x6'));var auth=require(_0x7ef1('0x7'));var interaction=require(_0x7ef1('0x8'));var config=require('../../config/environment');var controller=require(_0x7ef1('0x9'));router['get']('/',auth[_0x7ef1('0xa')](),controller['index']);router[_0x7ef1('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x7ef1('0xc')]);router[_0x7ef1('0xb')]('/:id',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0xd')]);router[_0x7ef1('0xb')](_0x7ef1('0xe'),auth[_0x7ef1('0xa')](),controller[_0x7ef1('0xf')]);router[_0x7ef1('0xb')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7ef1('0x10')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x7ef1('0x11')]);router['post']('/',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x12')]);router[_0x7ef1('0x13')](_0x7ef1('0x14'),auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x15')]);router[_0x7ef1('0x13')](_0x7ef1('0x16'),auth['isAuthenticated'](),controller['addAgents']);router[_0x7ef1('0x17')]('/:id',auth[_0x7ef1('0xa')](),controller[_0x7ef1('0x18')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7ef1('0x19')]);router['delete'](_0x7ef1('0x14'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0x7ef1('0x16'),auth['isAuthenticated'](),controller[_0x7ef1('0x1a')]);module[_0x7ef1('0x1b')]=router;
\ No newline at end of file
+var _0xf61e=['update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','isAuthenticated','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id'];(function(_0x1adf7b,_0x3309c7){var _0x1dc12b=function(_0x570ec9){while(--_0x570ec9){_0x1adf7b['push'](_0x1adf7b['shift']());}};_0x1dc12b(++_0x3309c7);}(_0xf61e,0x191));var _0xef61=function(_0xfce83f,_0x4d8b46){_0xfce83f=_0xfce83f-0x0;var _0x21a19e=_0xf61e[_0xfce83f];return _0x21a19e;};'use strict';var multer=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var path=require(_0xef61('0x2'));var timeout=require(_0xef61('0x3'));var express=require(_0xef61('0x4'));var router=express[_0xef61('0x5')]();var fs_extra=require(_0xef61('0x6'));var auth=require(_0xef61('0x7'));var interaction=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var controller=require(_0xef61('0xa'));router[_0xef61('0xb')]('/',auth['isAuthenticated'](),controller[_0xef61('0xc')]);router[_0xef61('0xb')]('/describe',auth[_0xef61('0xd')](),controller[_0xef61('0xe')]);router[_0xef61('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xef61('0xf')]);router[_0xef61('0xb')](_0xef61('0x10'),auth[_0xef61('0xd')](),controller[_0xef61('0x11')]);router[_0xef61('0xb')](_0xef61('0x12'),auth[_0xef61('0xd')](),controller[_0xef61('0x13')]);router[_0xef61('0xb')](_0xef61('0x14'),auth[_0xef61('0xd')](),controller[_0xef61('0x15')]);router[_0xef61('0x16')]('/',auth['isAuthenticated'](),controller[_0xef61('0x17')]);router['post'](_0xef61('0x12'),auth[_0xef61('0xd')](),controller[_0xef61('0x18')]);router[_0xef61('0x16')]('/:id/users',auth[_0xef61('0xd')](),controller[_0xef61('0x19')]);router[_0xef61('0x1a')](_0xef61('0x1b'),auth['isAuthenticated'](),controller[_0xef61('0x1c')]);router[_0xef61('0x1d')]('/:id',auth[_0xef61('0xd')](),controller[_0xef61('0x1e')]);router[_0xef61('0x1d')](_0xef61('0x12'),auth[_0xef61('0xd')](),controller[_0xef61('0x1f')]);router[_0xef61('0x1d')]('/:id/users',auth[_0xef61('0xd')](),controller[_0xef61('0x20')]);module['exports']=router;
\ No newline at end of file
index dc5bb3f..d1b641a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b4b=['DATE','sequelize','exports','STRING'];(function(_0x5cbb32,_0x233ace){var _0x49363c=function(_0x4649d1){while(--_0x4649d1){_0x5cbb32['push'](_0x5cbb32['shift']());}};_0x49363c(++_0x233ace);}(_0x6b4b,0x9d));var _0xb6b4=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x6b4b[_0x3fba9f];return _0x192cf1;};'use strict';var moment=require('moment');var Sequelize=require(_0xb6b4('0x0'));module[_0xb6b4('0x1')]={'uniqueid':{'type':Sequelize[_0xb6b4('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xb6b4('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb6b4('0x3')]},'exitAt':{'type':Sequelize[_0xb6b4('0x3')]},'reason':{'type':Sequelize[_0xb6b4('0x2')]}};
\ No newline at end of file
+var _0x1eb0=['DATE','moment','sequelize','exports','STRING'];(function(_0x128ee7,_0xbfbe00){var _0x38450a=function(_0x570931){while(--_0x570931){_0x128ee7['push'](_0x128ee7['shift']());}};_0x38450a(++_0xbfbe00);}(_0x1eb0,0x13c));var _0x01eb=function(_0x491941,_0x1ceff4){_0x491941=_0x491941-0x0;var _0x21e874=_0x1eb0[_0x491941];return _0x21e874;};'use strict';var moment=require(_0x01eb('0x0'));var Sequelize=require(_0x01eb('0x1'));module[_0x01eb('0x2')]={'uniqueid':{'type':Sequelize[_0x01eb('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x01eb('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x01eb('0x4')]},'reason':{'type':Sequelize[_0x01eb('0x3')]}};
\ No newline at end of file
index f3653b5..5614235 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89c4=['../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','FaxQueueReport','includeAll','include','findAll','catch','show','params','length','body','find','destroy','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1c6cf0,_0x82aa9e){var _0x1b3813=function(_0x14ad11){while(--_0x14ad11){_0x1c6cf0['push'](_0x1c6cf0['shift']());}};_0x1b3813(++_0x82aa9e);}(_0x89c4,0x82));var _0x489c=function(_0x15e235,_0x5da8df){_0x15e235=_0x15e235-0x0;var _0x3cb7e4=_0x89c4[_0x15e235];return _0x3cb7e4;};'use strict';var emlformat=require(_0x489c('0x0'));var rimraf=require(_0x489c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x489c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x489c('0x3'));var Mustache=require(_0x489c('0x4'));var util=require(_0x489c('0x5'));var path=require(_0x489c('0x6'));var sox=require(_0x489c('0x7'));var csv=require(_0x489c('0x8'));var ejs=require(_0x489c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x489c('0xa'));var squel=require(_0x489c('0xb'));var crypto=require(_0x489c('0xc'));var jsforce=require(_0x489c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x489c('0xe'));var Papa=require('papaparse');var Redis=require(_0x489c('0xf'));var authService=require(_0x489c('0x10'));var qs=require(_0x489c('0x11'));var as=require(_0x489c('0x12'));var hardwareService=require(_0x489c('0x13'));var logger=require(_0x489c('0x14'))(_0x489c('0x15'));var utils=require(_0x489c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x489c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfdfbcb,_0x4a9f45){_0x4a9f45=_0x4a9f45||0xcc;return function(_0x5340ce){if(_0x5340ce){return _0xfdfbcb[_0x489c('0x18')](_0x4a9f45);}return _0xfdfbcb['status'](_0x4a9f45)[_0x489c('0x19')]();};}function respondWithResult(_0x5d1b10,_0x305e40){_0x305e40=_0x305e40||0xc8;return function(_0x45983e){if(_0x45983e){return _0x5d1b10['status'](_0x305e40)[_0x489c('0x1a')](_0x45983e);}};}function respondWithFilteredResult(_0x39725a,_0x4861e2){return function(_0x4f37c3){if(_0x4f37c3){var _0x1bb98a=typeof _0x4861e2['offset']===_0x489c('0x1b')&&typeof _0x4861e2[_0x489c('0x1c')]===_0x489c('0x1b');var _0x39f9a9=_0x4f37c3[_0x489c('0x1d')];var _0x4519ce=_0x1bb98a?0x0:_0x4861e2[_0x489c('0x1e')];var _0x431782=_0x1bb98a?_0x4f37c3[_0x489c('0x1d')]:_0x4861e2[_0x489c('0x1e')]+_0x4861e2[_0x489c('0x1c')];var _0x19fb45;if(_0x431782>=_0x39f9a9){_0x431782=_0x39f9a9;_0x19fb45=0xc8;}else{_0x19fb45=0xce;}_0x39725a[_0x489c('0x1f')](_0x19fb45);return _0x39725a[_0x489c('0x20')](_0x489c('0x21'),_0x4519ce+'-'+_0x431782+'/'+_0x39f9a9)[_0x489c('0x1a')](_0x4f37c3);}return null;};}function patchUpdates(_0x14677b){return function(_0x381b56){try{jsonpatch['apply'](_0x381b56,_0x14677b,!![]);}catch(_0x4d0e03){return BPromise[_0x489c('0x22')](_0x4d0e03);}return _0x381b56[_0x489c('0x23')]();};}function saveUpdates(_0x1a1b68,_0x18cf8b){return function(_0x5b6ea3){if(_0x5b6ea3){return _0x5b6ea3[_0x489c('0x24')](_0x1a1b68)[_0x489c('0x25')](function(_0x37a59b){return _0x37a59b;});}return null;};}function removeEntity(_0x552384,_0x2a6d5c){return function(_0x1de4bf){if(_0x1de4bf){return _0x1de4bf['destroy']()[_0x489c('0x25')](function(){_0x552384[_0x489c('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35db69,_0x4cb1ae){return function(_0x3aab5b){if(!_0x3aab5b){_0x35db69[_0x489c('0x18')](0x194);}return _0x3aab5b;};}function handleError(_0x57e82f,_0x20cf09){_0x20cf09=_0x20cf09||0x1f4;return function(_0x1119bd){logger[_0x489c('0x26')](_0x1119bd[_0x489c('0x27')]);if(_0x1119bd['name']){delete _0x1119bd[_0x489c('0x28')];}_0x57e82f['status'](_0x20cf09)[_0x489c('0x29')](_0x1119bd);};}exports[_0x489c('0x2a')]=function(_0x3b8f79,_0x2fdb69){var _0x36d812={},_0x31986e={},_0x521e31={'count':0x0,'rows':[]};var _0x79b260=_[_0x489c('0x2b')](db['FaxQueueReport'][_0x489c('0x2c')],function(_0x299fcf){return{'name':_0x299fcf['fieldName'],'type':_0x299fcf[_0x489c('0x2d')][_0x489c('0x2e')]};});_0x31986e[_0x489c('0x2f')]=_[_0x489c('0x2b')](_0x79b260,'name');_0x31986e[_0x489c('0x30')]=_[_0x489c('0x31')](_0x3b8f79['query']);_0x31986e[_0x489c('0x32')]=_[_0x489c('0x33')](_0x31986e[_0x489c('0x2f')],_0x31986e['query']);_0x36d812[_0x489c('0x34')]=_[_0x489c('0x33')](_0x31986e[_0x489c('0x2f')],qs[_0x489c('0x35')](_0x3b8f79[_0x489c('0x30')][_0x489c('0x35')]));_0x36d812[_0x489c('0x34')]=_0x36d812[_0x489c('0x34')]['length']?_0x36d812[_0x489c('0x34')]:_0x31986e[_0x489c('0x2f')];if(!_0x3b8f79[_0x489c('0x30')][_0x489c('0x36')](_0x489c('0x37'))){_0x36d812[_0x489c('0x1c')]=qs[_0x489c('0x1c')](_0x3b8f79[_0x489c('0x30')][_0x489c('0x1c')]);_0x36d812[_0x489c('0x1e')]=qs['offset'](_0x3b8f79[_0x489c('0x30')]['offset']);}_0x36d812[_0x489c('0x38')]=qs[_0x489c('0x39')](_0x3b8f79[_0x489c('0x30')][_0x489c('0x39')]);_0x36d812['where']=qs[_0x489c('0x32')](_[_0x489c('0x3a')](_0x3b8f79[_0x489c('0x30')],_0x31986e[_0x489c('0x32')]),_0x79b260);if(_0x3b8f79[_0x489c('0x30')][_0x489c('0x3b')]){_0x36d812[_0x489c('0x3c')]=_['merge'](_0x36d812[_0x489c('0x3c')],{'$or':_[_0x489c('0x2b')](_0x79b260,function(_0x290043){if(_0x290043[_0x489c('0x2d')]!==_0x489c('0x3d')){var _0x5b508c={};_0x5b508c[_0x290043[_0x489c('0x28')]]={'$like':'%'+_0x3b8f79['query'][_0x489c('0x3b')]+'%'};return _0x5b508c;}})});}_0x36d812=_['merge']({},_0x36d812,_0x3b8f79[_0x489c('0x3e')]);var _0x22699d={'where':_0x36d812[_0x489c('0x3c')]};return db[_0x489c('0x3f')][_0x489c('0x1d')](_0x22699d)[_0x489c('0x25')](function(_0x4677b8){_0x521e31[_0x489c('0x1d')]=_0x4677b8;if(_0x3b8f79[_0x489c('0x30')][_0x489c('0x40')]){_0x36d812[_0x489c('0x41')]=[{'all':!![]}];}return db[_0x489c('0x3f')][_0x489c('0x42')](_0x36d812);})[_0x489c('0x25')](function(_0x3cccca){_0x521e31['rows']=_0x3cccca;return _0x521e31;})['then'](respondWithFilteredResult(_0x2fdb69,_0x36d812))[_0x489c('0x43')](handleError(_0x2fdb69,null));};exports[_0x489c('0x44')]=function(_0x31b58a,_0x2f879a){var _0x583c85={'raw':!![],'where':{'id':_0x31b58a[_0x489c('0x45')]['id']}},_0xea1236={};_0xea1236['model']=_[_0x489c('0x31')](db['FaxQueueReport'][_0x489c('0x2c')]);_0xea1236['query']=_[_0x489c('0x31')](_0x31b58a[_0x489c('0x30')]);_0xea1236[_0x489c('0x32')]=_[_0x489c('0x33')](_0xea1236[_0x489c('0x2f')],_0xea1236[_0x489c('0x30')]);_0x583c85[_0x489c('0x34')]=_[_0x489c('0x33')](_0xea1236[_0x489c('0x2f')],qs[_0x489c('0x35')](_0x31b58a[_0x489c('0x30')][_0x489c('0x35')]));_0x583c85[_0x489c('0x34')]=_0x583c85[_0x489c('0x34')][_0x489c('0x46')]?_0x583c85[_0x489c('0x34')]:_0xea1236[_0x489c('0x2f')];if(_0x31b58a[_0x489c('0x30')]['includeAll']){_0x583c85[_0x489c('0x41')]=[{'all':!![]}];}_0x583c85=_['merge']({},_0x583c85,_0x31b58a[_0x489c('0x3e')]);return db[_0x489c('0x3f')]['find'](_0x583c85)[_0x489c('0x25')](handleEntityNotFound(_0x2f879a,null))[_0x489c('0x25')](respondWithResult(_0x2f879a,null))[_0x489c('0x43')](handleError(_0x2f879a,null));};exports['create']=function(_0x58b3c1,_0x9adabe){return db[_0x489c('0x3f')]['create'](_0x58b3c1[_0x489c('0x47')],{})[_0x489c('0x25')](respondWithResult(_0x9adabe,0xc9))[_0x489c('0x43')](handleError(_0x9adabe,null));};exports[_0x489c('0x24')]=function(_0x1d4466,_0x81bc95){if(_0x1d4466[_0x489c('0x47')]['id']){delete _0x1d4466[_0x489c('0x47')]['id'];}return db[_0x489c('0x3f')][_0x489c('0x48')]({'where':{'id':_0x1d4466[_0x489c('0x45')]['id']}})[_0x489c('0x25')](handleEntityNotFound(_0x81bc95,null))[_0x489c('0x25')](saveUpdates(_0x1d4466[_0x489c('0x47')],null))[_0x489c('0x25')](respondWithResult(_0x81bc95,null))[_0x489c('0x43')](handleError(_0x81bc95,null));};exports[_0x489c('0x49')]=function(_0x547926,_0x252bf7){return db[_0x489c('0x3f')][_0x489c('0x48')]({'where':{'id':_0x547926['params']['id']}})[_0x489c('0x25')](handleEntityNotFound(_0x252bf7,null))[_0x489c('0x25')](removeEntity(_0x252bf7,null))[_0x489c('0x43')](handleError(_0x252bf7,null));};exports['describe']=function(_0x4d2351,_0x2327fb){return db[_0x489c('0x3f')][_0x489c('0x4a')]()[_0x489c('0x25')](respondWithResult(_0x2327fb,null))['catch'](handleError(_0x2327fb,null));};
\ No newline at end of file
+var _0xff96=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','then','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xff96,0x179));var _0x6ff9=function(_0x1d8b9c,_0xc2cdd3){_0x1d8b9c=_0x1d8b9c-0x0;var _0x459bf4=_0xff96[_0x1d8b9c];return _0x459bf4;};'use strict';var emlformat=require(_0x6ff9('0x0'));var rimraf=require(_0x6ff9('0x1'));var zipdir=require(_0x6ff9('0x2'));var jsonpatch=require(_0x6ff9('0x3'));var rp=require(_0x6ff9('0x4'));var moment=require(_0x6ff9('0x5'));var BPromise=require(_0x6ff9('0x6'));var Mustache=require(_0x6ff9('0x7'));var util=require(_0x6ff9('0x8'));var path=require(_0x6ff9('0x9'));var sox=require(_0x6ff9('0xa'));var csv=require(_0x6ff9('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6ff9('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6ff9('0xd'));var deskjs=require(_0x6ff9('0xe'));var toCsv=require(_0x6ff9('0xb'));var querystring=require(_0x6ff9('0xf'));var Papa=require(_0x6ff9('0x10'));var Redis=require(_0x6ff9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6ff9('0x12'));var as=require(_0x6ff9('0x13'));var hardwareService=require(_0x6ff9('0x14'));var logger=require(_0x6ff9('0x15'))(_0x6ff9('0x16'));var utils=require(_0x6ff9('0x17'));var config=require(_0x6ff9('0x18'));var licenseUtil=require(_0x6ff9('0x19'));var db=require(_0x6ff9('0x1a'))['db'];function respondWithStatusCode(_0x4c5baf,_0x4a1aad){_0x4a1aad=_0x4a1aad||0xcc;return function(_0x3a1120){if(_0x3a1120){return _0x4c5baf['sendStatus'](_0x4a1aad);}return _0x4c5baf[_0x6ff9('0x1b')](_0x4a1aad)[_0x6ff9('0x1c')]();};}function respondWithResult(_0x1857d2,_0x58022a){_0x58022a=_0x58022a||0xc8;return function(_0x5b56c3){if(_0x5b56c3){return _0x1857d2[_0x6ff9('0x1b')](_0x58022a)[_0x6ff9('0x1d')](_0x5b56c3);}};}function respondWithFilteredResult(_0x2d0475,_0xc3a8aa){return function(_0x4d3655){if(_0x4d3655){var _0x5a9a52=typeof _0xc3a8aa[_0x6ff9('0x1e')]===_0x6ff9('0x1f')&&typeof _0xc3a8aa[_0x6ff9('0x20')]===_0x6ff9('0x1f');var _0x3109b5=_0x4d3655['count'];var _0xc00da6=_0x5a9a52?0x0:_0xc3a8aa[_0x6ff9('0x1e')];var _0xc7724f=_0x5a9a52?_0x4d3655['count']:_0xc3a8aa['offset']+_0xc3a8aa['limit'];var _0x3b5934;if(_0xc7724f>=_0x3109b5){_0xc7724f=_0x3109b5;_0x3b5934=0xc8;}else{_0x3b5934=0xce;}_0x2d0475[_0x6ff9('0x1b')](_0x3b5934);return _0x2d0475[_0x6ff9('0x21')](_0x6ff9('0x22'),_0xc00da6+'-'+_0xc7724f+'/'+_0x3109b5)[_0x6ff9('0x1d')](_0x4d3655);}return null;};}function patchUpdates(_0x4e926e){return function(_0x1356fa){try{jsonpatch[_0x6ff9('0x23')](_0x1356fa,_0x4e926e,!![]);}catch(_0x1971de){return BPromise[_0x6ff9('0x24')](_0x1971de);}return _0x1356fa[_0x6ff9('0x25')]();};}function saveUpdates(_0x85835a,_0x50f207){return function(_0x647ce3){if(_0x647ce3){return _0x647ce3[_0x6ff9('0x26')](_0x85835a)['then'](function(_0x19fd1d){return _0x19fd1d;});}return null;};}function removeEntity(_0xfc1c6b,_0x4521b2){return function(_0x5777f5){if(_0x5777f5){return _0x5777f5['destroy']()['then'](function(){_0xfc1c6b[_0x6ff9('0x1b')](0xcc)[_0x6ff9('0x1c')]();});}};}function handleEntityNotFound(_0x4b755c,_0x4f6b0f){return function(_0x12cbd8){if(!_0x12cbd8){_0x4b755c['sendStatus'](0x194);}return _0x12cbd8;};}function handleError(_0x4cd175,_0x41e511){_0x41e511=_0x41e511||0x1f4;return function(_0x4033e9){logger[_0x6ff9('0x27')](_0x4033e9[_0x6ff9('0x28')]);if(_0x4033e9[_0x6ff9('0x29')]){delete _0x4033e9[_0x6ff9('0x29')];}_0x4cd175[_0x6ff9('0x1b')](_0x41e511)[_0x6ff9('0x2a')](_0x4033e9);};}exports[_0x6ff9('0x2b')]=function(_0x154a2e,_0x380b15){var _0x40b5cb={},_0x41a281={},_0x861a5f={'count':0x0,'rows':[]};var _0x1fc695=_[_0x6ff9('0x2c')](db[_0x6ff9('0x2d')][_0x6ff9('0x2e')],function(_0x1d7fc0){return{'name':_0x1d7fc0[_0x6ff9('0x2f')],'type':_0x1d7fc0[_0x6ff9('0x30')][_0x6ff9('0x31')]};});_0x41a281['model']=_[_0x6ff9('0x2c')](_0x1fc695,_0x6ff9('0x29'));_0x41a281[_0x6ff9('0x32')]=_[_0x6ff9('0x33')](_0x154a2e['query']);_0x41a281[_0x6ff9('0x34')]=_[_0x6ff9('0x35')](_0x41a281[_0x6ff9('0x36')],_0x41a281[_0x6ff9('0x32')]);_0x40b5cb[_0x6ff9('0x37')]=_[_0x6ff9('0x35')](_0x41a281[_0x6ff9('0x36')],qs[_0x6ff9('0x38')](_0x154a2e[_0x6ff9('0x32')]['fields']));_0x40b5cb[_0x6ff9('0x37')]=_0x40b5cb[_0x6ff9('0x37')][_0x6ff9('0x39')]?_0x40b5cb[_0x6ff9('0x37')]:_0x41a281[_0x6ff9('0x36')];if(!_0x154a2e[_0x6ff9('0x32')]['hasOwnProperty'](_0x6ff9('0x3a'))){_0x40b5cb['limit']=qs[_0x6ff9('0x20')](_0x154a2e['query'][_0x6ff9('0x20')]);_0x40b5cb[_0x6ff9('0x1e')]=qs[_0x6ff9('0x1e')](_0x154a2e[_0x6ff9('0x32')][_0x6ff9('0x1e')]);}_0x40b5cb[_0x6ff9('0x3b')]=qs['sort'](_0x154a2e[_0x6ff9('0x32')][_0x6ff9('0x3c')]);_0x40b5cb[_0x6ff9('0x3d')]=qs[_0x6ff9('0x34')](_[_0x6ff9('0x3e')](_0x154a2e['query'],_0x41a281[_0x6ff9('0x34')]),_0x1fc695);if(_0x154a2e[_0x6ff9('0x32')]['filter']){_0x40b5cb['where']=_['merge'](_0x40b5cb['where'],{'$or':_['map'](_0x1fc695,function(_0x3ef087){if(_0x3ef087['type']!=='VIRTUAL'){var _0x4e5bf1={};_0x4e5bf1[_0x3ef087[_0x6ff9('0x29')]]={'$like':'%'+_0x154a2e[_0x6ff9('0x32')][_0x6ff9('0x3f')]+'%'};return _0x4e5bf1;}})});}_0x40b5cb=_[_0x6ff9('0x40')]({},_0x40b5cb,_0x154a2e[_0x6ff9('0x41')]);var _0x53f64b={'where':_0x40b5cb[_0x6ff9('0x3d')]};return db['FaxQueueReport']['count'](_0x53f64b)[_0x6ff9('0x42')](function(_0x57747e){_0x861a5f['count']=_0x57747e;if(_0x154a2e[_0x6ff9('0x32')]['includeAll']){_0x40b5cb[_0x6ff9('0x43')]=[{'all':!![]}];}return db[_0x6ff9('0x2d')][_0x6ff9('0x44')](_0x40b5cb);})[_0x6ff9('0x42')](function(_0x504a8b){_0x861a5f[_0x6ff9('0x45')]=_0x504a8b;return _0x861a5f;})[_0x6ff9('0x42')](respondWithFilteredResult(_0x380b15,_0x40b5cb))[_0x6ff9('0x46')](handleError(_0x380b15,null));};exports[_0x6ff9('0x47')]=function(_0x5d04a1,_0x3e8b04){var _0x4a4222={'raw':!![],'where':{'id':_0x5d04a1[_0x6ff9('0x48')]['id']}},_0xfaa623={};_0xfaa623[_0x6ff9('0x36')]=_[_0x6ff9('0x33')](db[_0x6ff9('0x2d')]['rawAttributes']);_0xfaa623[_0x6ff9('0x32')]=_[_0x6ff9('0x33')](_0x5d04a1['query']);_0xfaa623[_0x6ff9('0x34')]=_[_0x6ff9('0x35')](_0xfaa623[_0x6ff9('0x36')],_0xfaa623[_0x6ff9('0x32')]);_0x4a4222[_0x6ff9('0x37')]=_[_0x6ff9('0x35')](_0xfaa623[_0x6ff9('0x36')],qs[_0x6ff9('0x38')](_0x5d04a1[_0x6ff9('0x32')][_0x6ff9('0x38')]));_0x4a4222[_0x6ff9('0x37')]=_0x4a4222[_0x6ff9('0x37')][_0x6ff9('0x39')]?_0x4a4222[_0x6ff9('0x37')]:_0xfaa623[_0x6ff9('0x36')];if(_0x5d04a1['query'][_0x6ff9('0x49')]){_0x4a4222[_0x6ff9('0x43')]=[{'all':!![]}];}_0x4a4222=_[_0x6ff9('0x40')]({},_0x4a4222,_0x5d04a1['options']);return db[_0x6ff9('0x2d')][_0x6ff9('0x4a')](_0x4a4222)['then'](handleEntityNotFound(_0x3e8b04,null))[_0x6ff9('0x42')](respondWithResult(_0x3e8b04,null))['catch'](handleError(_0x3e8b04,null));};exports[_0x6ff9('0x4b')]=function(_0x1bd394,_0x3c80b6){return db[_0x6ff9('0x2d')][_0x6ff9('0x4b')](_0x1bd394[_0x6ff9('0x4c')],{})[_0x6ff9('0x42')](respondWithResult(_0x3c80b6,0xc9))[_0x6ff9('0x46')](handleError(_0x3c80b6,null));};exports['update']=function(_0x34ffe9,_0x223532){if(_0x34ffe9[_0x6ff9('0x4c')]['id']){delete _0x34ffe9[_0x6ff9('0x4c')]['id'];}return db[_0x6ff9('0x2d')][_0x6ff9('0x4a')]({'where':{'id':_0x34ffe9[_0x6ff9('0x48')]['id']}})[_0x6ff9('0x42')](handleEntityNotFound(_0x223532,null))[_0x6ff9('0x42')](saveUpdates(_0x34ffe9[_0x6ff9('0x4c')],null))[_0x6ff9('0x42')](respondWithResult(_0x223532,null))[_0x6ff9('0x46')](handleError(_0x223532,null));};exports[_0x6ff9('0x4d')]=function(_0x7d4251,_0x213c77){return db['FaxQueueReport']['find']({'where':{'id':_0x7d4251[_0x6ff9('0x48')]['id']}})[_0x6ff9('0x42')](handleEntityNotFound(_0x213c77,null))[_0x6ff9('0x42')](removeEntity(_0x213c77,null))[_0x6ff9('0x46')](handleError(_0x213c77,null));};exports[_0x6ff9('0x4e')]=function(_0x527f92,_0x1b49ab){return db['FaxQueueReport'][_0x6ff9('0x4e')]()[_0x6ff9('0x42')](respondWithResult(_0x1b49ab,null))['catch'](handleError(_0x1b49ab,null));};
\ No newline at end of file
index d609610..0e7a1b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x188595,_0x2e2147){var _0x478795=function(_0x314a39){while(--_0x314a39){_0x188595['push'](_0x188595['shift']());}};_0x478795(++_0x2e2147);}(_0x326f,0xd1));var _0xf326=function(_0x3205ba,_0x69781a){_0x3205ba=_0x3205ba-0x0;var _0x394f5a=_0x326f[_0x3205ba];return _0x394f5a;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x49ee4a,_0x5d5b90){var _0x55f694=function(_0x3d07e2){while(--_0x3d07e2){_0x49ee4a['push'](_0x49ee4a['shift']());}};_0x55f694(++_0x5d5b90);}(_0x7a54,0x106));var _0x47a5=function(_0x2fbad0,_0x5422a4){_0x2fbad0=_0x2fbad0-0x0;var _0xa3d479=_0x7a54[_0x2fbad0];return _0xa3d479;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 6e562ae..a086547 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66fd=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','FaxQueueReport','create','body','options','raw','then','CreateFaxQueueReport','update','where','attributes','limit','UpdateFaxQueueReport','lodash','util','bluebird'];(function(_0x1f1813,_0x221dd9){var _0x40d6f4=function(_0x4eec7d){while(--_0x4eec7d){_0x1f1813['push'](_0x1f1813['shift']());}};_0x40d6f4(++_0x221dd9);}(_0x66fd,0x11d));var _0xd66f=function(_0x4800c4,_0x13b31e){_0x4800c4=_0x4800c4-0x0;var _0x5bd103=_0x66fd[_0x4800c4];return _0x5bd103;};'use strict';var _=require(_0xd66f('0x0'));var util=require(_0xd66f('0x1'));var moment=require('moment');var BPromise=require(_0xd66f('0x2'));var rs=require(_0xd66f('0x3'));var fs=require('fs');var Redis=require(_0xd66f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd66f('0x5'))(_0xd66f('0x6'));var config=require(_0xd66f('0x7'));var jayson=require(_0xd66f('0x8'));var client=jayson[_0xd66f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x373539,_0xf6e98a,_0x14e43e){return new BPromise(function(_0x2834b7,_0x21e618){return client[_0xd66f('0xa')](_0x373539,_0x14e43e)['then'](function(_0x2143c7){logger['info'](_0xd66f('0xb'),_0xf6e98a,_0xd66f('0xc'));logger[_0xd66f('0xd')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0xf6e98a,'request\x20sent',JSON[_0xd66f('0xe')](_0x2143c7));if(_0x2143c7['error']){if(_0x2143c7[_0xd66f('0xf')]['code']===0x1f4){logger[_0xd66f('0xf')](_0xd66f('0xb'),_0xf6e98a,_0x2143c7[_0xd66f('0xf')][_0xd66f('0x10')]);return _0x21e618(_0x2143c7[_0xd66f('0xf')][_0xd66f('0x10')]);}logger[_0xd66f('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0xf6e98a,_0x2143c7['error'][_0xd66f('0x10')]);return _0x2834b7(_0x2143c7['error'][_0xd66f('0x10')]);}else{logger[_0xd66f('0x11')](_0xd66f('0xb'),_0xf6e98a,_0xd66f('0xc'));_0x2834b7(_0x2143c7[_0xd66f('0x12')][_0xd66f('0x10')]);}})[_0xd66f('0x13')](function(_0x2fcb9c){logger[_0xd66f('0xf')](_0xd66f('0xb'),_0xf6e98a,_0x2fcb9c);_0x21e618(_0x2fcb9c);});});}exports['CreateFaxQueueReport']=function(_0x2c2f6a){var _0x25f92a=this;return new Promise(function(_0x3379b3,_0xbc2500){return db[_0xd66f('0x14')][_0xd66f('0x15')](_0x2c2f6a[_0xd66f('0x16')],{'raw':_0x2c2f6a[_0xd66f('0x17')]?_0x2c2f6a[_0xd66f('0x17')][_0xd66f('0x18')]===undefined?!![]:![]:!![]})[_0xd66f('0x19')](function(_0x1c06d9){logger[_0xd66f('0x11')](_0xd66f('0x1a'),_0x2c2f6a);logger[_0xd66f('0xd')](_0xd66f('0x1a'),_0x2c2f6a,JSON['stringify'](_0x1c06d9));_0x3379b3(_0x1c06d9);})[_0xd66f('0x13')](function(_0x4b9896){logger[_0xd66f('0xf')](_0xd66f('0x1a'),_0x4b9896[_0xd66f('0x10')],_0x2c2f6a);_0xbc2500(_0x25f92a[_0xd66f('0xf')](0x1f4,_0x4b9896[_0xd66f('0x10')]));});});};exports['UpdateFaxQueueReport']=function(_0x388938){var _0x27aca4=this;return new Promise(function(_0x3acde3,_0x721c95){return db[_0xd66f('0x14')][_0xd66f('0x1b')](_0x388938['body'],{'raw':_0x388938[_0xd66f('0x17')]?_0x388938[_0xd66f('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x388938['options']?_0x388938[_0xd66f('0x17')][_0xd66f('0x1c')]||null:null,'attributes':_0x388938[_0xd66f('0x17')]?_0x388938[_0xd66f('0x17')][_0xd66f('0x1d')]||null:null,'limit':_0x388938[_0xd66f('0x17')]?_0x388938[_0xd66f('0x17')][_0xd66f('0x1e')]||null:null})[_0xd66f('0x19')](function(_0x65bcd2){logger['info'](_0xd66f('0x1f'),_0x388938);logger[_0xd66f('0xd')]('UpdateFaxQueueReport',_0x388938,JSON[_0xd66f('0xe')](_0x65bcd2));_0x3acde3(_0x65bcd2);})[_0xd66f('0x13')](function(_0x42cea9){logger[_0xd66f('0xf')](_0xd66f('0x1f'),_0x42cea9[_0xd66f('0x10')],_0x388938);_0x721c95(_0x27aca4[_0xd66f('0xf')](0x1f4,_0x42cea9[_0xd66f('0x10')]));});});};
\ No newline at end of file
+var _0x320f=['options','UpdateFaxQueueReport','update','raw','attributes','limit','then','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body'];(function(_0x187279,_0x26d152){var _0x3da59d=function(_0x41c808){while(--_0x41c808){_0x187279['push'](_0x187279['shift']());}};_0x3da59d(++_0x26d152);}(_0x320f,0xef));var _0xf320=function(_0xd21550,_0x31c67d){_0xd21550=_0xd21550-0x0;var _0x5bca0b=_0x320f[_0xd21550];return _0x5bca0b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xf320('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf320('0x1'));var db=require(_0xf320('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf320('0x3'));var config=require('../../config/environment');var jayson=require(_0xf320('0x4'));var client=jayson[_0xf320('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3900a4,_0x5c9bf0,_0x4c8d00){return new BPromise(function(_0x5d11fb,_0x523546){return client[_0xf320('0x6')](_0x3900a4,_0x4c8d00)['then'](function(_0x127cf2){logger[_0xf320('0x7')](_0xf320('0x8'),_0x5c9bf0,_0xf320('0x9'));logger[_0xf320('0xa')](_0xf320('0xb'),_0x5c9bf0,'request\x20sent',JSON[_0xf320('0xc')](_0x127cf2));if(_0x127cf2['error']){if(_0x127cf2['error'][_0xf320('0xd')]===0x1f4){logger[_0xf320('0xe')](_0xf320('0x8'),_0x5c9bf0,_0x127cf2[_0xf320('0xe')][_0xf320('0xf')]);return _0x523546(_0x127cf2[_0xf320('0xe')]['message']);}logger[_0xf320('0xe')](_0xf320('0x8'),_0x5c9bf0,_0x127cf2[_0xf320('0xe')][_0xf320('0xf')]);return _0x5d11fb(_0x127cf2[_0xf320('0xe')][_0xf320('0xf')]);}else{logger[_0xf320('0x7')](_0xf320('0x8'),_0x5c9bf0,_0xf320('0x9'));_0x5d11fb(_0x127cf2[_0xf320('0x10')][_0xf320('0xf')]);}})[_0xf320('0x11')](function(_0x18f0a2){logger[_0xf320('0xe')](_0xf320('0x8'),_0x5c9bf0,_0x18f0a2);_0x523546(_0x18f0a2);});});}exports[_0xf320('0x12')]=function(_0x4ef591){var _0x3895eb=this;return new Promise(function(_0x37734a,_0x52c42a){return db[_0xf320('0x13')][_0xf320('0x14')](_0x4ef591[_0xf320('0x15')],{'raw':_0x4ef591[_0xf320('0x16')]?_0x4ef591[_0xf320('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x421b17){logger[_0xf320('0x7')](_0xf320('0x12'),_0x4ef591);logger[_0xf320('0xa')]('CreateFaxQueueReport',_0x4ef591,JSON[_0xf320('0xc')](_0x421b17));_0x37734a(_0x421b17);})[_0xf320('0x11')](function(_0x135338){logger[_0xf320('0xe')](_0xf320('0x12'),_0x135338[_0xf320('0xf')],_0x4ef591);_0x52c42a(_0x3895eb[_0xf320('0xe')](0x1f4,_0x135338[_0xf320('0xf')]));});});};exports[_0xf320('0x17')]=function(_0x37879c){var _0x22a80f=this;return new Promise(function(_0x2c6c68,_0x33a63b){return db[_0xf320('0x13')][_0xf320('0x18')](_0x37879c[_0xf320('0x15')],{'raw':_0x37879c['options']?_0x37879c['options'][_0xf320('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x37879c['options']?_0x37879c[_0xf320('0x16')]['where']||null:null,'attributes':_0x37879c[_0xf320('0x16')]?_0x37879c['options'][_0xf320('0x1a')]||null:null,'limit':_0x37879c[_0xf320('0x16')]?_0x37879c[_0xf320('0x16')][_0xf320('0x1b')]||null:null})[_0xf320('0x1c')](function(_0x5165f9){logger[_0xf320('0x7')]('UpdateFaxQueueReport',_0x37879c);logger[_0xf320('0xa')]('UpdateFaxQueueReport',_0x37879c,JSON[_0xf320('0xc')](_0x5165f9));_0x2c6c68(_0x5165f9);})['catch'](function(_0x3059f6){logger[_0xf320('0xe')](_0xf320('0x17'),_0x3059f6[_0xf320('0xf')],_0x37879c);_0x33a63b(_0x22a80f[_0xf320('0xe')](0x1f4,_0x3059f6[_0xf320('0xf')]));});});};
\ No newline at end of file
index 3f7cc83..f48bced 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x760a=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','describe','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','util','path','express','fs-extra'];(function(_0x9a36ec,_0x7afd44){var _0x397955=function(_0x16e50e){while(--_0x16e50e){_0x9a36ec['push'](_0x9a36ec['shift']());}};_0x397955(++_0x7afd44);}(_0x760a,0x73));var _0xa760=function(_0x486f88,_0x2986c1){_0x486f88=_0x486f88-0x0;var _0x38e755=_0x760a[_0x486f88];return _0x38e755;};'use strict';var multer=require(_0xa760('0x0'));var util=require(_0xa760('0x1'));var path=require(_0xa760('0x2'));var timeout=require('connect-timeout');var express=require(_0xa760('0x3'));var router=express['Router']();var fs_extra=require(_0xa760('0x4'));var auth=require(_0xa760('0x5'));var interaction=require(_0xa760('0x6'));var config=require(_0xa760('0x7'));var controller=require('./faxQueueReport.controller');router[_0xa760('0x8')]('/',auth['isAuthenticated'](),controller[_0xa760('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xa760('0xa')]);router['get'](_0xa760('0xb'),auth[_0xa760('0xc')](),controller[_0xa760('0xd')]);router[_0xa760('0xe')]('/',auth['isAuthenticated'](),controller[_0xa760('0xf')]);router[_0xa760('0x10')]('/:id',auth[_0xa760('0xc')](),controller[_0xa760('0x11')]);router[_0xa760('0x12')](_0xa760('0xb'),auth[_0xa760('0xc')](),controller['destroy']);module[_0xa760('0x13')]=router;
\ No newline at end of file
+var _0x4b9c=['create','put','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x191c34,_0x1fa270){var _0x43433b=function(_0x3dd0ab){while(--_0x3dd0ab){_0x191c34['push'](_0x191c34['shift']());}};_0x43433b(++_0x1fa270);}(_0x4b9c,0x76));var _0xc4b9=function(_0x1973ff,_0x1c427e){_0x1973ff=_0x1973ff-0x0;var _0x240e16=_0x4b9c[_0x1973ff];return _0x240e16;};'use strict';var multer=require(_0xc4b9('0x0'));var util=require(_0xc4b9('0x1'));var path=require(_0xc4b9('0x2'));var timeout=require('connect-timeout');var express=require(_0xc4b9('0x3'));var router=express['Router']();var fs_extra=require(_0xc4b9('0x4'));var auth=require(_0xc4b9('0x5'));var interaction=require(_0xc4b9('0x6'));var config=require(_0xc4b9('0x7'));var controller=require('./faxQueueReport.controller');router[_0xc4b9('0x8')]('/',auth[_0xc4b9('0x9')](),controller[_0xc4b9('0xa')]);router[_0xc4b9('0x8')](_0xc4b9('0xb'),auth['isAuthenticated'](),controller[_0xc4b9('0xc')]);router[_0xc4b9('0x8')](_0xc4b9('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xc4b9('0xe')]('/',auth['isAuthenticated'](),controller[_0xc4b9('0xf')]);router[_0xc4b9('0x10')](_0xc4b9('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xc4b9('0x11')](_0xc4b9('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xc4b9('0x12')]=router;
\ No newline at end of file
index bccb332..01b40ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x51bf91,_0x5340e0){var _0x200627=function(_0x2b4836){while(--_0x2b4836){_0x51bf91['push'](_0x51bf91['shift']());}};_0x200627(++_0x5340e0);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x00bb[_0x3ff085];return _0x2b68c3;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x36211b,_0xbdf4bc){var _0x3bec71=function(_0x36f571){while(--_0x36f571){_0x36211b['push'](_0x36211b['shift']());}};_0x3bec71(++_0xbdf4bc);}(_0x70e0,0x17b));var _0x070e=function(_0x1af6ed,_0x5cef66){_0x1af6ed=_0x1af6ed-0x0;var _0x1b94ca=_0x70e0[_0x1af6ed];return _0x1b94ca;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
index 482b31c..23aed78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8631=['describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','end','error','stack','index','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','name','FaxTransferReport','then','includeAll','include','findAll','rows','catch','show','params','options','create','body','find'];(function(_0x282ee6,_0x2afd08){var _0x147f4f=function(_0x3b49b0){while(--_0x3b49b0){_0x282ee6['push'](_0x282ee6['shift']());}};_0x147f4f(++_0x2afd08);}(_0x8631,0x1e1));var _0x1863=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x8631[_0x2b4411];return _0x8e41ef;};'use strict';var emlformat=require(_0x1863('0x0'));var rimraf=require(_0x1863('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1863('0x2'));var rp=require(_0x1863('0x3'));var moment=require(_0x1863('0x4'));var BPromise=require(_0x1863('0x5'));var Mustache=require(_0x1863('0x6'));var util=require(_0x1863('0x7'));var path=require(_0x1863('0x8'));var sox=require(_0x1863('0x9'));var csv=require('to-csv');var ejs=require(_0x1863('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1863('0xb'));var squel=require(_0x1863('0xc'));var crypto=require(_0x1863('0xd'));var jsforce=require(_0x1863('0xe'));var deskjs=require(_0x1863('0xf'));var toCsv=require(_0x1863('0x10'));var querystring=require(_0x1863('0x11'));var Papa=require(_0x1863('0x12'));var Redis=require(_0x1863('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1863('0x14'));var as=require(_0x1863('0x15'));var hardwareService=require(_0x1863('0x16'));var logger=require(_0x1863('0x17'))(_0x1863('0x18'));var utils=require(_0x1863('0x19'));var config=require(_0x1863('0x1a'));var licenseUtil=require(_0x1863('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xec7b7a,_0x337412){_0x337412=_0x337412||0xcc;return function(_0x3d3303){if(_0x3d3303){return _0xec7b7a[_0x1863('0x1c')](_0x337412);}return _0xec7b7a[_0x1863('0x1d')](_0x337412)['end']();};}function respondWithResult(_0x39d7a3,_0x3c92bf){_0x3c92bf=_0x3c92bf||0xc8;return function(_0x5486ea){if(_0x5486ea){return _0x39d7a3[_0x1863('0x1d')](_0x3c92bf)[_0x1863('0x1e')](_0x5486ea);}};}function respondWithFilteredResult(_0x1f775f,_0x5a0fa7){return function(_0x2fd019){if(_0x2fd019){var _0x28d68b=typeof _0x5a0fa7[_0x1863('0x1f')]==='undefined'&&typeof _0x5a0fa7[_0x1863('0x20')]===_0x1863('0x21');var _0x1d3ff1=_0x2fd019[_0x1863('0x22')];var _0x2684be=_0x28d68b?0x0:_0x5a0fa7[_0x1863('0x1f')];var _0x2d63dc=_0x28d68b?_0x2fd019['count']:_0x5a0fa7[_0x1863('0x1f')]+_0x5a0fa7[_0x1863('0x20')];var _0x3c644b;if(_0x2d63dc>=_0x1d3ff1){_0x2d63dc=_0x1d3ff1;_0x3c644b=0xc8;}else{_0x3c644b=0xce;}_0x1f775f[_0x1863('0x1d')](_0x3c644b);return _0x1f775f[_0x1863('0x23')](_0x1863('0x24'),_0x2684be+'-'+_0x2d63dc+'/'+_0x1d3ff1)[_0x1863('0x1e')](_0x2fd019);}return null;};}function patchUpdates(_0xfa29bc){return function(_0x42e0d0){try{jsonpatch['apply'](_0x42e0d0,_0xfa29bc,!![]);}catch(_0x255b7c){return BPromise[_0x1863('0x25')](_0x255b7c);}return _0x42e0d0[_0x1863('0x26')]();};}function saveUpdates(_0x10fd38,_0xe547cf){return function(_0x783542){if(_0x783542){return _0x783542[_0x1863('0x27')](_0x10fd38)['then'](function(_0x41e3bc){return _0x41e3bc;});}return null;};}function removeEntity(_0x58d449,_0x548a36){return function(_0x4eec6e){if(_0x4eec6e){return _0x4eec6e[_0x1863('0x28')]()['then'](function(){_0x58d449[_0x1863('0x1d')](0xcc)[_0x1863('0x29')]();});}};}function handleEntityNotFound(_0x5e848a,_0x130c70){return function(_0x530ff6){if(!_0x530ff6){_0x5e848a['sendStatus'](0x194);}return _0x530ff6;};}function handleError(_0x300b74,_0x5a8ca8){_0x5a8ca8=_0x5a8ca8||0x1f4;return function(_0xfcef11){logger[_0x1863('0x2a')](_0xfcef11[_0x1863('0x2b')]);if(_0xfcef11['name']){delete _0xfcef11['name'];}_0x300b74['status'](_0x5a8ca8)['send'](_0xfcef11);};}exports[_0x1863('0x2c')]=function(_0x35eea5,_0x19d76c){var _0x2a64a0={},_0x5483f0={},_0x46437d={'count':0x0,'rows':[]};var _0x19db5e=_['map'](db['FaxTransferReport'][_0x1863('0x2d')],function(_0x2753e8){return{'name':_0x2753e8['fieldName'],'type':_0x2753e8[_0x1863('0x2e')]['key']};});_0x5483f0[_0x1863('0x2f')]=_['map'](_0x19db5e,'name');_0x5483f0[_0x1863('0x30')]=_[_0x1863('0x31')](_0x35eea5[_0x1863('0x30')]);_0x5483f0[_0x1863('0x32')]=_[_0x1863('0x33')](_0x5483f0[_0x1863('0x2f')],_0x5483f0[_0x1863('0x30')]);_0x2a64a0['attributes']=_[_0x1863('0x33')](_0x5483f0[_0x1863('0x2f')],qs[_0x1863('0x34')](_0x35eea5['query'][_0x1863('0x34')]));_0x2a64a0[_0x1863('0x35')]=_0x2a64a0[_0x1863('0x35')][_0x1863('0x36')]?_0x2a64a0[_0x1863('0x35')]:_0x5483f0[_0x1863('0x2f')];if(!_0x35eea5[_0x1863('0x30')][_0x1863('0x37')](_0x1863('0x38'))){_0x2a64a0['limit']=qs['limit'](_0x35eea5[_0x1863('0x30')][_0x1863('0x20')]);_0x2a64a0[_0x1863('0x1f')]=qs[_0x1863('0x1f')](_0x35eea5[_0x1863('0x30')][_0x1863('0x1f')]);}_0x2a64a0[_0x1863('0x39')]=qs[_0x1863('0x3a')](_0x35eea5[_0x1863('0x30')][_0x1863('0x3a')]);_0x2a64a0[_0x1863('0x3b')]=qs['filters'](_[_0x1863('0x3c')](_0x35eea5[_0x1863('0x30')],_0x5483f0[_0x1863('0x32')]),_0x19db5e);if(_0x35eea5[_0x1863('0x30')][_0x1863('0x3d')]){_0x2a64a0['where']=_[_0x1863('0x3e')](_0x2a64a0[_0x1863('0x3b')],{'$or':_[_0x1863('0x3f')](_0x19db5e,function(_0x2ef22b){if(_0x2ef22b[_0x1863('0x2e')]!==_0x1863('0x40')){var _0x4684dd={};_0x4684dd[_0x2ef22b[_0x1863('0x41')]]={'$like':'%'+_0x35eea5[_0x1863('0x30')][_0x1863('0x3d')]+'%'};return _0x4684dd;}})});}_0x2a64a0=_[_0x1863('0x3e')]({},_0x2a64a0,_0x35eea5['options']);var _0x5c1fd0={'where':_0x2a64a0['where']};return db[_0x1863('0x42')][_0x1863('0x22')](_0x5c1fd0)[_0x1863('0x43')](function(_0x358ffc){_0x46437d[_0x1863('0x22')]=_0x358ffc;if(_0x35eea5[_0x1863('0x30')][_0x1863('0x44')]){_0x2a64a0[_0x1863('0x45')]=[{'all':!![]}];}return db[_0x1863('0x42')][_0x1863('0x46')](_0x2a64a0);})[_0x1863('0x43')](function(_0x577098){_0x46437d[_0x1863('0x47')]=_0x577098;return _0x46437d;})[_0x1863('0x43')](respondWithFilteredResult(_0x19d76c,_0x2a64a0))[_0x1863('0x48')](handleError(_0x19d76c,null));};exports[_0x1863('0x49')]=function(_0x5e65f9,_0x13e1cb){var _0x110f05={'raw':!![],'where':{'id':_0x5e65f9[_0x1863('0x4a')]['id']}},_0x385374={};_0x385374[_0x1863('0x2f')]=_[_0x1863('0x31')](db['FaxTransferReport']['rawAttributes']);_0x385374['query']=_[_0x1863('0x31')](_0x5e65f9['query']);_0x385374['filters']=_['intersection'](_0x385374[_0x1863('0x2f')],_0x385374['query']);_0x110f05[_0x1863('0x35')]=_['intersection'](_0x385374['model'],qs['fields'](_0x5e65f9['query'][_0x1863('0x34')]));_0x110f05[_0x1863('0x35')]=_0x110f05['attributes'][_0x1863('0x36')]?_0x110f05[_0x1863('0x35')]:_0x385374[_0x1863('0x2f')];if(_0x5e65f9[_0x1863('0x30')][_0x1863('0x44')]){_0x110f05[_0x1863('0x45')]=[{'all':!![]}];}_0x110f05=_[_0x1863('0x3e')]({},_0x110f05,_0x5e65f9[_0x1863('0x4b')]);return db['FaxTransferReport']['find'](_0x110f05)['then'](handleEntityNotFound(_0x13e1cb,null))[_0x1863('0x43')](respondWithResult(_0x13e1cb,null))['catch'](handleError(_0x13e1cb,null));};exports['create']=function(_0x2b5ffe,_0x58c926){return db[_0x1863('0x42')][_0x1863('0x4c')](_0x2b5ffe[_0x1863('0x4d')],{})[_0x1863('0x43')](respondWithResult(_0x58c926,0xc9))[_0x1863('0x48')](handleError(_0x58c926,null));};exports[_0x1863('0x27')]=function(_0x18575a,_0xfc0e71){if(_0x18575a['body']['id']){delete _0x18575a[_0x1863('0x4d')]['id'];}return db[_0x1863('0x42')][_0x1863('0x4e')]({'where':{'id':_0x18575a[_0x1863('0x4a')]['id']}})[_0x1863('0x43')](handleEntityNotFound(_0xfc0e71,null))[_0x1863('0x43')](saveUpdates(_0x18575a[_0x1863('0x4d')],null))[_0x1863('0x43')](respondWithResult(_0xfc0e71,null))['catch'](handleError(_0xfc0e71,null));};exports['destroy']=function(_0x55ca4c,_0x501bfa){return db[_0x1863('0x42')]['find']({'where':{'id':_0x55ca4c[_0x1863('0x4a')]['id']}})[_0x1863('0x43')](handleEntityNotFound(_0x501bfa,null))[_0x1863('0x43')](removeEntity(_0x501bfa,null))[_0x1863('0x48')](handleError(_0x501bfa,null));};exports[_0x1863('0x4f')]=function(_0x359ee2,_0x3e1efa){return db[_0x1863('0x42')][_0x1863('0x4f')]()[_0x1863('0x43')](respondWithResult(_0x3e1efa,null))[_0x1863('0x48')](handleError(_0x3e1efa,null));};
\ No newline at end of file
+var _0xe2f1=['body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','sendStatus','stack','name','send','index','rawAttributes','type','key','map','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','FaxTransferReport','includeAll','findAll','catch','show','params','keys','include','options','find','create'];(function(_0x170b0b,_0x4aa600){var _0x33cd22=function(_0x35263c){while(--_0x35263c){_0x170b0b['push'](_0x170b0b['shift']());}};_0x33cd22(++_0x4aa600);}(_0xe2f1,0x1d1));var _0x1e2f=function(_0x7b5cdd,_0x8c88d8){_0x7b5cdd=_0x7b5cdd-0x0;var _0x3a29ae=_0xe2f1[_0x7b5cdd];return _0x3a29ae;};'use strict';var emlformat=require(_0x1e2f('0x0'));var rimraf=require(_0x1e2f('0x1'));var zipdir=require(_0x1e2f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1e2f('0x3'));var moment=require(_0x1e2f('0x4'));var BPromise=require(_0x1e2f('0x5'));var Mustache=require('mustache');var util=require(_0x1e2f('0x6'));var path=require(_0x1e2f('0x7'));var sox=require(_0x1e2f('0x8'));var csv=require(_0x1e2f('0x9'));var ejs=require(_0x1e2f('0xa'));var fs=require('fs');var fs_extra=require(_0x1e2f('0xb'));var _=require(_0x1e2f('0xc'));var squel=require(_0x1e2f('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1e2f('0xe'));var Papa=require(_0x1e2f('0xf'));var Redis=require('ioredis');var authService=require(_0x1e2f('0x10'));var qs=require(_0x1e2f('0x11'));var as=require(_0x1e2f('0x12'));var hardwareService=require(_0x1e2f('0x13'));var logger=require(_0x1e2f('0x14'))(_0x1e2f('0x15'));var utils=require(_0x1e2f('0x16'));var config=require(_0x1e2f('0x17'));var licenseUtil=require(_0x1e2f('0x18'));var db=require(_0x1e2f('0x19'))['db'];function respondWithStatusCode(_0x6618aa,_0x971ba7){_0x971ba7=_0x971ba7||0xcc;return function(_0x1f0fc2){if(_0x1f0fc2){return _0x6618aa['sendStatus'](_0x971ba7);}return _0x6618aa[_0x1e2f('0x1a')](_0x971ba7)[_0x1e2f('0x1b')]();};}function respondWithResult(_0xbc6a19,_0x1a6fcb){_0x1a6fcb=_0x1a6fcb||0xc8;return function(_0x206633){if(_0x206633){return _0xbc6a19[_0x1e2f('0x1a')](_0x1a6fcb)[_0x1e2f('0x1c')](_0x206633);}};}function respondWithFilteredResult(_0x3301fe,_0x1f1a0c){return function(_0x455974){if(_0x455974){var _0x2855a4=typeof _0x1f1a0c['offset']===_0x1e2f('0x1d')&&typeof _0x1f1a0c[_0x1e2f('0x1e')]===_0x1e2f('0x1d');var _0x191e8d=_0x455974[_0x1e2f('0x1f')];var _0x17577d=_0x2855a4?0x0:_0x1f1a0c[_0x1e2f('0x20')];var _0x20489d=_0x2855a4?_0x455974[_0x1e2f('0x1f')]:_0x1f1a0c[_0x1e2f('0x20')]+_0x1f1a0c['limit'];var _0x59b4b9;if(_0x20489d>=_0x191e8d){_0x20489d=_0x191e8d;_0x59b4b9=0xc8;}else{_0x59b4b9=0xce;}_0x3301fe[_0x1e2f('0x1a')](_0x59b4b9);return _0x3301fe['set'](_0x1e2f('0x21'),_0x17577d+'-'+_0x20489d+'/'+_0x191e8d)['json'](_0x455974);}return null;};}function patchUpdates(_0x34f3bc){return function(_0x4704e4){try{jsonpatch[_0x1e2f('0x22')](_0x4704e4,_0x34f3bc,!![]);}catch(_0x23c2e5){return BPromise['reject'](_0x23c2e5);}return _0x4704e4[_0x1e2f('0x23')]();};}function saveUpdates(_0x12eac3,_0x26d954){return function(_0x345f10){if(_0x345f10){return _0x345f10[_0x1e2f('0x24')](_0x12eac3)[_0x1e2f('0x25')](function(_0x36bbd7){return _0x36bbd7;});}return null;};}function removeEntity(_0x2d7338,_0x5f45a5){return function(_0x336dd0){if(_0x336dd0){return _0x336dd0['destroy']()[_0x1e2f('0x25')](function(){_0x2d7338[_0x1e2f('0x1a')](0xcc)[_0x1e2f('0x1b')]();});}};}function handleEntityNotFound(_0x501b7a,_0x4dbcf4){return function(_0x5b318f){if(!_0x5b318f){_0x501b7a[_0x1e2f('0x26')](0x194);}return _0x5b318f;};}function handleError(_0x16c3ae,_0x588725){_0x588725=_0x588725||0x1f4;return function(_0x100334){logger['error'](_0x100334[_0x1e2f('0x27')]);if(_0x100334[_0x1e2f('0x28')]){delete _0x100334[_0x1e2f('0x28')];}_0x16c3ae[_0x1e2f('0x1a')](_0x588725)[_0x1e2f('0x29')](_0x100334);};}exports[_0x1e2f('0x2a')]=function(_0x43b89c,_0x9cd638){var _0x560985={},_0x55ac7d={},_0x50aa05={'count':0x0,'rows':[]};var _0x12e69d=_['map'](db['FaxTransferReport'][_0x1e2f('0x2b')],function(_0x279318){return{'name':_0x279318['fieldName'],'type':_0x279318[_0x1e2f('0x2c')][_0x1e2f('0x2d')]};});_0x55ac7d['model']=_[_0x1e2f('0x2e')](_0x12e69d,_0x1e2f('0x28'));_0x55ac7d[_0x1e2f('0x2f')]=_['keys'](_0x43b89c['query']);_0x55ac7d['filters']=_[_0x1e2f('0x30')](_0x55ac7d[_0x1e2f('0x31')],_0x55ac7d['query']);_0x560985['attributes']=_[_0x1e2f('0x30')](_0x55ac7d[_0x1e2f('0x31')],qs[_0x1e2f('0x32')](_0x43b89c[_0x1e2f('0x2f')][_0x1e2f('0x32')]));_0x560985[_0x1e2f('0x33')]=_0x560985[_0x1e2f('0x33')][_0x1e2f('0x34')]?_0x560985[_0x1e2f('0x33')]:_0x55ac7d['model'];if(!_0x43b89c[_0x1e2f('0x2f')][_0x1e2f('0x35')](_0x1e2f('0x36'))){_0x560985[_0x1e2f('0x1e')]=qs[_0x1e2f('0x1e')](_0x43b89c[_0x1e2f('0x2f')][_0x1e2f('0x1e')]);_0x560985[_0x1e2f('0x20')]=qs[_0x1e2f('0x20')](_0x43b89c[_0x1e2f('0x2f')]['offset']);}_0x560985[_0x1e2f('0x37')]=qs[_0x1e2f('0x38')](_0x43b89c[_0x1e2f('0x2f')]['sort']);_0x560985[_0x1e2f('0x39')]=qs[_0x1e2f('0x3a')](_[_0x1e2f('0x3b')](_0x43b89c[_0x1e2f('0x2f')],_0x55ac7d[_0x1e2f('0x3a')]),_0x12e69d);if(_0x43b89c[_0x1e2f('0x2f')][_0x1e2f('0x3c')]){_0x560985[_0x1e2f('0x39')]=_[_0x1e2f('0x3d')](_0x560985[_0x1e2f('0x39')],{'$or':_[_0x1e2f('0x2e')](_0x12e69d,function(_0x3b3199){if(_0x3b3199[_0x1e2f('0x2c')]!==_0x1e2f('0x3e')){var _0x4775ba={};_0x4775ba[_0x3b3199['name']]={'$like':'%'+_0x43b89c[_0x1e2f('0x2f')]['filter']+'%'};return _0x4775ba;}})});}_0x560985=_[_0x1e2f('0x3d')]({},_0x560985,_0x43b89c['options']);var _0x12098f={'where':_0x560985[_0x1e2f('0x39')]};return db[_0x1e2f('0x3f')][_0x1e2f('0x1f')](_0x12098f)[_0x1e2f('0x25')](function(_0x133c92){_0x50aa05[_0x1e2f('0x1f')]=_0x133c92;if(_0x43b89c[_0x1e2f('0x2f')][_0x1e2f('0x40')]){_0x560985['include']=[{'all':!![]}];}return db[_0x1e2f('0x3f')][_0x1e2f('0x41')](_0x560985);})[_0x1e2f('0x25')](function(_0x134245){_0x50aa05['rows']=_0x134245;return _0x50aa05;})[_0x1e2f('0x25')](respondWithFilteredResult(_0x9cd638,_0x560985))[_0x1e2f('0x42')](handleError(_0x9cd638,null));};exports[_0x1e2f('0x43')]=function(_0x390a9b,_0x3541b5){var _0x49b4e8={'raw':!![],'where':{'id':_0x390a9b[_0x1e2f('0x44')]['id']}},_0x3e9dc2={};_0x3e9dc2[_0x1e2f('0x31')]=_[_0x1e2f('0x45')](db[_0x1e2f('0x3f')][_0x1e2f('0x2b')]);_0x3e9dc2[_0x1e2f('0x2f')]=_[_0x1e2f('0x45')](_0x390a9b[_0x1e2f('0x2f')]);_0x3e9dc2[_0x1e2f('0x3a')]=_[_0x1e2f('0x30')](_0x3e9dc2['model'],_0x3e9dc2[_0x1e2f('0x2f')]);_0x49b4e8[_0x1e2f('0x33')]=_[_0x1e2f('0x30')](_0x3e9dc2[_0x1e2f('0x31')],qs[_0x1e2f('0x32')](_0x390a9b[_0x1e2f('0x2f')][_0x1e2f('0x32')]));_0x49b4e8[_0x1e2f('0x33')]=_0x49b4e8[_0x1e2f('0x33')][_0x1e2f('0x34')]?_0x49b4e8[_0x1e2f('0x33')]:_0x3e9dc2['model'];if(_0x390a9b[_0x1e2f('0x2f')][_0x1e2f('0x40')]){_0x49b4e8[_0x1e2f('0x46')]=[{'all':!![]}];}_0x49b4e8=_[_0x1e2f('0x3d')]({},_0x49b4e8,_0x390a9b[_0x1e2f('0x47')]);return db[_0x1e2f('0x3f')][_0x1e2f('0x48')](_0x49b4e8)[_0x1e2f('0x25')](handleEntityNotFound(_0x3541b5,null))['then'](respondWithResult(_0x3541b5,null))[_0x1e2f('0x42')](handleError(_0x3541b5,null));};exports['create']=function(_0x5c7c25,_0x11968c){return db['FaxTransferReport'][_0x1e2f('0x49')](_0x5c7c25[_0x1e2f('0x4a')],{})[_0x1e2f('0x25')](respondWithResult(_0x11968c,0xc9))['catch'](handleError(_0x11968c,null));};exports[_0x1e2f('0x24')]=function(_0x34f2f9,_0x670e2a){if(_0x34f2f9[_0x1e2f('0x4a')]['id']){delete _0x34f2f9[_0x1e2f('0x4a')]['id'];}return db[_0x1e2f('0x3f')]['find']({'where':{'id':_0x34f2f9['params']['id']}})[_0x1e2f('0x25')](handleEntityNotFound(_0x670e2a,null))['then'](saveUpdates(_0x34f2f9[_0x1e2f('0x4a')],null))['then'](respondWithResult(_0x670e2a,null))[_0x1e2f('0x42')](handleError(_0x670e2a,null));};exports[_0x1e2f('0x4b')]=function(_0x56731f,_0x180c3a){return db[_0x1e2f('0x3f')]['find']({'where':{'id':_0x56731f[_0x1e2f('0x44')]['id']}})[_0x1e2f('0x25')](handleEntityNotFound(_0x180c3a,null))[_0x1e2f('0x25')](removeEntity(_0x180c3a,null))[_0x1e2f('0x42')](handleError(_0x180c3a,null));};exports[_0x1e2f('0x4c')]=function(_0x493ac0,_0x46a069){return db[_0x1e2f('0x3f')][_0x1e2f('0x4c')]()[_0x1e2f('0x25')](respondWithResult(_0x46a069,null))[_0x1e2f('0x42')](handleError(_0x46a069,null));};
\ No newline at end of file
index 83a84ed..495375d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e70=['bluebird','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','report_fax_transfer','uniqueid','util','../../config/logger','api','moment'];(function(_0xd9c50c,_0x40619b){var _0x15e89c=function(_0x182241){while(--_0x182241){_0xd9c50c['push'](_0xd9c50c['shift']());}};_0x15e89c(++_0x40619b);}(_0x7e70,0x98));var _0x07e7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e70[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x07e7('0x0'));var logger=require(_0x07e7('0x1'))(_0x07e7('0x2'));var moment=require(_0x07e7('0x3'));var BPromise=require(_0x07e7('0x4'));var rp=require(_0x07e7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x07e7('0x6'));var config=require(_0x07e7('0x7'));var attributes=require(_0x07e7('0x8'));module[_0x07e7('0x9')]=function(_0x4e19a7,_0x30cb04){return _0x4e19a7['define']('FaxTransferReport',attributes,{'tableName':_0x07e7('0xa'),'paranoid':![],'indexes':[{'name':_0x07e7('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x779d=['path','rimraf','exports','define','report_fax_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2e71ba,_0x4e04f4){var _0x4715d4=function(_0x33c8be){while(--_0x33c8be){_0x2e71ba['push'](_0x2e71ba['shift']());}};_0x4715d4(++_0x4e04f4);}(_0x779d,0x1c2));var _0xd779=function(_0x4df7cd,_0x53be6b){_0x4df7cd=_0x4df7cd-0x0;var _0x289431=_0x779d[_0x4df7cd];return _0x289431;};'use strict';var _=require(_0xd779('0x0'));var util=require('util');var logger=require(_0xd779('0x1'))(_0xd779('0x2'));var moment=require(_0xd779('0x3'));var BPromise=require(_0xd779('0x4'));var rp=require(_0xd779('0x5'));var fs=require('fs');var path=require(_0xd779('0x6'));var rimraf=require(_0xd779('0x7'));var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module[_0xd779('0x8')]=function(_0x414079,_0x5deb55){return _0x414079[_0xd779('0x9')]('FaxTransferReport',attributes,{'tableName':_0xd779('0xa'),'paranoid':![],'indexes':[{'name':_0xd779('0xb'),'fields':[_0xd779('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index cb02b35..5a63f8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9536=['lodash','util','moment','bluebird','../../config/utils','../../config/logger','jayson/promise','client','http','request','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x2181fc,_0x7283aa){var _0x315da1=function(_0x1df7ca){while(--_0x1df7ca){_0x2181fc['push'](_0x2181fc['shift']());}};_0x315da1(++_0x7283aa);}(_0x9536,0x1f4));var _0x6953=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x9536[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var moment=require(_0x6953('0x2'));var BPromise=require(_0x6953('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6953('0x4'));var logger=require(_0x6953('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6953('0x6'));var client=jayson[_0x6953('0x7')][_0x6953('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51cce8,_0x271145,_0x48ccd8){return new BPromise(function(_0x1a1c50,_0xc6334b){return client[_0x6953('0x9')](_0x51cce8,_0x48ccd8)['then'](function(_0x5bde41){logger['info'](_0x6953('0xa'),_0x271145,'request\x20sent');logger[_0x6953('0xb')](_0x6953('0xc'),_0x271145,_0x6953('0xd'),JSON[_0x6953('0xe')](_0x5bde41));if(_0x5bde41[_0x6953('0xf')]){if(_0x5bde41[_0x6953('0xf')][_0x6953('0x10')]===0x1f4){logger[_0x6953('0xf')](_0x6953('0xa'),_0x271145,_0x5bde41[_0x6953('0xf')][_0x6953('0x11')]);return _0xc6334b(_0x5bde41[_0x6953('0xf')][_0x6953('0x11')]);}logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x271145,_0x5bde41[_0x6953('0xf')][_0x6953('0x11')]);return _0x1a1c50(_0x5bde41[_0x6953('0xf')][_0x6953('0x11')]);}else{logger['info'](_0x6953('0xa'),_0x271145,_0x6953('0xd'));_0x1a1c50(_0x5bde41[_0x6953('0x12')][_0x6953('0x11')]);}})[_0x6953('0x13')](function(_0x3dd902){logger[_0x6953('0xf')](_0x6953('0xa'),_0x271145,_0x3dd902);_0xc6334b(_0x3dd902);});});}
\ No newline at end of file
+var _0xea6a=['request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0xea6a,0x108));var _0xaea6=function(_0x3ce0bf,_0x5c4f8d){_0x3ce0bf=_0x3ce0bf-0x0;var _0x487f52=_0xea6a[_0x3ce0bf];return _0x487f52;};'use strict';var _=require(_0xaea6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaea6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaea6('0x2'));var db=require(_0xaea6('0x3'))['db'];var utils=require(_0xaea6('0x4'));var logger=require(_0xaea6('0x5'))(_0xaea6('0x6'));var config=require(_0xaea6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xaea6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x476e3a,_0x14c2fd,_0x274cc2){return new BPromise(function(_0x2ef0af,_0xf97ede){return client[_0xaea6('0x9')](_0x476e3a,_0x274cc2)[_0xaea6('0xa')](function(_0x3cbfb8){logger[_0xaea6('0xb')](_0xaea6('0xc'),_0x14c2fd,_0xaea6('0xd'));logger[_0xaea6('0xe')](_0xaea6('0xf'),_0x14c2fd,_0xaea6('0xd'),JSON[_0xaea6('0x10')](_0x3cbfb8));if(_0x3cbfb8[_0xaea6('0x11')]){if(_0x3cbfb8['error'][_0xaea6('0x12')]===0x1f4){logger[_0xaea6('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x14c2fd,_0x3cbfb8[_0xaea6('0x11')][_0xaea6('0x13')]);return _0xf97ede(_0x3cbfb8[_0xaea6('0x11')][_0xaea6('0x13')]);}logger[_0xaea6('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x14c2fd,_0x3cbfb8['error'][_0xaea6('0x13')]);return _0x2ef0af(_0x3cbfb8[_0xaea6('0x11')][_0xaea6('0x13')]);}else{logger[_0xaea6('0xb')](_0xaea6('0xc'),_0x14c2fd,_0xaea6('0xd'));_0x2ef0af(_0x3cbfb8[_0xaea6('0x14')][_0xaea6('0x13')]);}})['catch'](function(_0x5a44bd){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x14c2fd,_0x5a44bd);_0xf97ede(_0x5a44bd);});});}
\ No newline at end of file
index d4bd3a3..ae79108 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d11=['../../config/environment','index','get','/describe','isAuthenticated','describe','/:id','show','post','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x9d11,0xc0));var _0x19d1=function(_0x2fd160,_0x53c0d6){_0x2fd160=_0x2fd160-0x0;var _0x5c2031=_0x9d11[_0x2fd160];return _0x5c2031;};'use strict';var multer=require(_0x19d1('0x0'));var util=require(_0x19d1('0x1'));var path=require('path');var timeout=require(_0x19d1('0x2'));var express=require(_0x19d1('0x3'));var router=express[_0x19d1('0x4')]();var fs_extra=require(_0x19d1('0x5'));var auth=require(_0x19d1('0x6'));var interaction=require(_0x19d1('0x7'));var config=require(_0x19d1('0x8'));var controller=require('./faxTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x19d1('0x9')]);router[_0x19d1('0xa')](_0x19d1('0xb'),auth[_0x19d1('0xc')](),controller[_0x19d1('0xd')]);router['get'](_0x19d1('0xe'),auth[_0x19d1('0xc')](),controller[_0x19d1('0xf')]);router[_0x19d1('0x10')]('/',auth[_0x19d1('0xc')](),controller['create']);router[_0x19d1('0x11')]('/:id',auth[_0x19d1('0xc')](),controller['update']);router['delete'](_0x19d1('0xe'),auth[_0x19d1('0xc')](),controller[_0x19d1('0x12')]);module[_0x19d1('0x13')]=router;
\ No newline at end of file
+var _0x5e75=['../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','create','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x10f161,_0x3e1ed3){var _0x2ad61b=function(_0x339ee5){while(--_0x339ee5){_0x10f161['push'](_0x10f161['shift']());}};_0x2ad61b(++_0x3e1ed3);}(_0x5e75,0x1cd));var _0x55e7=function(_0x1edd14,_0x2eb290){_0x1edd14=_0x1edd14-0x0;var _0x1bc3ff=_0x5e75[_0x1edd14];return _0x1bc3ff;};'use strict';var multer=require(_0x55e7('0x0'));var util=require(_0x55e7('0x1'));var path=require(_0x55e7('0x2'));var timeout=require(_0x55e7('0x3'));var express=require(_0x55e7('0x4'));var router=express[_0x55e7('0x5')]();var fs_extra=require(_0x55e7('0x6'));var auth=require(_0x55e7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x55e7('0x8'));var controller=require(_0x55e7('0x9'));router[_0x55e7('0xa')]('/',auth[_0x55e7('0xb')](),controller[_0x55e7('0xc')]);router[_0x55e7('0xa')](_0x55e7('0xd'),auth[_0x55e7('0xb')](),controller['describe']);router[_0x55e7('0xa')]('/:id',auth[_0x55e7('0xb')](),controller['show']);router['post']('/',auth[_0x55e7('0xb')](),controller[_0x55e7('0xe')]);router['put'](_0x55e7('0xf'),auth[_0x55e7('0xb')](),controller[_0x55e7('0x10')]);router['delete'](_0x55e7('0xf'),auth[_0x55e7('0xb')](),controller['destroy']);module[_0x55e7('0x11')]=router;
\ No newline at end of file
index f4e40fa..faf3ee8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4b9=['addConfiguration','put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0xa4b9,0x1a3));var _0x9a4b=function(_0xffd1b5,_0x1ede18){_0xffd1b5=_0xffd1b5-0x0;var _0x3176d6=_0xa4b9[_0xffd1b5];return _0x3176d6;};'use strict';var multer=require('multer');var util=require(_0x9a4b('0x0'));var path=require(_0x9a4b('0x1'));var timeout=require(_0x9a4b('0x2'));var express=require(_0x9a4b('0x3'));var router=express['Router']();var fs_extra=require(_0x9a4b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9a4b('0x5'));var config=require(_0x9a4b('0x6'));var controller=require(_0x9a4b('0x7'));router['get']('/',auth[_0x9a4b('0x8')](),controller[_0x9a4b('0x9')]);router[_0x9a4b('0xa')](_0x9a4b('0xb'),auth[_0x9a4b('0x8')](),controller['show']);router['get'](_0x9a4b('0xc'),auth[_0x9a4b('0x8')](),controller[_0x9a4b('0xd')]);router[_0x9a4b('0xa')](_0x9a4b('0xe'),auth[_0x9a4b('0x8')](),controller[_0x9a4b('0xf')]);router['post']('/',auth[_0x9a4b('0x8')](),controller[_0x9a4b('0x10')]);router[_0x9a4b('0x11')](_0x9a4b('0xc'),auth[_0x9a4b('0x8')](),controller[_0x9a4b('0x12')]);router[_0x9a4b('0x13')](_0x9a4b('0xb'),auth['isAuthenticated'](),controller[_0x9a4b('0x14')]);router[_0x9a4b('0x15')]('/:id',auth[_0x9a4b('0x8')](),controller['destroy']);module[_0x9a4b('0x16')]=router;
\ No newline at end of file
+var _0x9e01=['create','/:id/configurations','addConfiguration','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','getConfigurations','/:id/fields','getFields','post'];(function(_0x189dbd,_0x1d3cad){var _0x7861fb=function(_0x1a8738){while(--_0x1a8738){_0x189dbd['push'](_0x189dbd['shift']());}};_0x7861fb(++_0x1d3cad);}(_0x9e01,0x8f));var _0x19e0=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x9e01[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x19e0('0x0'));var util=require(_0x19e0('0x1'));var path=require(_0x19e0('0x2'));var timeout=require('connect-timeout');var express=require(_0x19e0('0x3'));var router=express[_0x19e0('0x4')]();var fs_extra=require(_0x19e0('0x5'));var auth=require(_0x19e0('0x6'));var interaction=require(_0x19e0('0x7'));var config=require(_0x19e0('0x8'));var controller=require(_0x19e0('0x9'));router[_0x19e0('0xa')]('/',auth[_0x19e0('0xb')](),controller[_0x19e0('0xc')]);router['get'](_0x19e0('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x19e0('0xa')]('/:id/configurations',auth[_0x19e0('0xb')](),controller[_0x19e0('0xe')]);router[_0x19e0('0xa')](_0x19e0('0xf'),auth[_0x19e0('0xb')](),controller[_0x19e0('0x10')]);router[_0x19e0('0x11')]('/',auth['isAuthenticated'](),controller[_0x19e0('0x12')]);router[_0x19e0('0x11')](_0x19e0('0x13'),auth[_0x19e0('0xb')](),controller[_0x19e0('0x14')]);router['put'](_0x19e0('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x19e0('0x15')](_0x19e0('0xd'),auth['isAuthenticated'](),controller[_0x19e0('0x16')]);module['exports']=router;
\ No newline at end of file
index b49f00a..bf947c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ace=['ENUM','basic','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x2fd719,_0xa1c429){var _0x3fcc83=function(_0x8e31fa){while(--_0x8e31fa){_0x2fd719['push'](_0x2fd719['shift']());}};_0x3fcc83(++_0xa1c429);}(_0x1ace,0x100));var _0xe1ac=function(_0x2e5418,_0x5b4baa){_0x2e5418=_0x2e5418-0x0;var _0x54ceb4=_0x1ace[_0x2e5418];return _0x54ceb4;};'use strict';var Sequelize=require(_0xe1ac('0x0'));module[_0xe1ac('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe1ac('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xe1ac('0x2')]},'authType':{'type':Sequelize[_0xe1ac('0x3')](_0xe1ac('0x4')),'defaultValue':_0xe1ac('0x4')},'password':{'type':Sequelize[_0xe1ac('0x2')]},'consumerKey':{'type':Sequelize[_0xe1ac('0x2')]},'consumerSecret':{'type':Sequelize[_0xe1ac('0x2')]},'token':{'type':Sequelize[_0xe1ac('0x2')]},'tokenSecret':{'type':Sequelize[_0xe1ac('0x2')]},'serverUrl':{'type':Sequelize[_0xe1ac('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe1ac('0x3')](_0xe1ac('0x5'),_0xe1ac('0x6')),'defaultValue':_0xe1ac('0x5')}};
\ No newline at end of file
+var _0x73c4=['STRING','ENUM','basic','integrationTab','exports'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x73c4,0x1b2));var _0x473c=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x73c4[_0xbb091];return _0x467a04;};'use strict';var Sequelize=require('sequelize');module[_0x473c('0x0')]={'name':{'type':Sequelize[_0x473c('0x1')]},'description':{'type':Sequelize[_0x473c('0x1')]},'username':{'type':Sequelize[_0x473c('0x1')]},'remoteUri':{'type':Sequelize[_0x473c('0x1')]},'authType':{'type':Sequelize[_0x473c('0x2')]('basic'),'defaultValue':_0x473c('0x3')},'password':{'type':Sequelize[_0x473c('0x1')]},'consumerKey':{'type':Sequelize[_0x473c('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x473c('0x1')]},'tokenSecret':{'type':Sequelize[_0x473c('0x1')]},'serverUrl':{'type':Sequelize[_0x473c('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x473c('0x2')]('integrationTab','newTab'),'defaultValue':_0x473c('0x4')}};
\ No newline at end of file
index f9076c4..4443d0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc30d=['to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','error','stack','name','index','map','DeskAccount','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','getConfigurations','findOne','DeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','jsforce','desk.js'];(function(_0x33c102,_0x22faa7){var _0x5921e9=function(_0x49d27c){while(--_0x49d27c){_0x33c102['push'](_0x33c102['shift']());}};_0x5921e9(++_0x22faa7);}(_0xc30d,0x1d4));var _0xdc30=function(_0x3702ba,_0x460951){_0x3702ba=_0x3702ba-0x0;var _0x115695=_0xc30d[_0x3702ba];return _0x115695;};'use strict';var emlformat=require(_0xdc30('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdc30('0x1'));var moment=require(_0xdc30('0x2'));var BPromise=require(_0xdc30('0x3'));var Mustache=require(_0xdc30('0x4'));var util=require(_0xdc30('0x5'));var path=require(_0xdc30('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdc30('0x7'));var fs=require('fs');var fs_extra=require(_0xdc30('0x8'));var _=require('lodash');var squel=require(_0xdc30('0x9'));var crypto=require('crypto');var jsforce=require(_0xdc30('0xa'));var deskjs=require(_0xdc30('0xb'));var toCsv=require(_0xdc30('0xc'));var querystring=require(_0xdc30('0xd'));var Papa=require(_0xdc30('0xe'));var Redis=require('ioredis');var authService=require(_0xdc30('0xf'));var qs=require(_0xdc30('0x10'));var as=require(_0xdc30('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdc30('0x12'))(_0xdc30('0x13'));var utils=require(_0xdc30('0x14'));var config=require(_0xdc30('0x15'));var licenseUtil=require(_0xdc30('0x16'));var db=require(_0xdc30('0x17'))['db'];var integrations=require(_0xdc30('0x18'));function respondWithStatusCode(_0x13446d,_0x2ecf7e){_0x2ecf7e=_0x2ecf7e||0xcc;return function(_0xd95d21){if(_0xd95d21){return _0x13446d[_0xdc30('0x19')](_0x2ecf7e);}return _0x13446d[_0xdc30('0x1a')](_0x2ecf7e)[_0xdc30('0x1b')]();};}function respondWithResult(_0x185b48,_0x132ed9){_0x132ed9=_0x132ed9||0xc8;return function(_0x4b2589){if(_0x4b2589){return _0x185b48[_0xdc30('0x1a')](_0x132ed9)['json'](_0x4b2589);}};}function respondWithFilteredResult(_0x3a4ace,_0xfdc8ed){return function(_0x37786a){if(_0x37786a){var _0x5763f8=typeof _0xfdc8ed[_0xdc30('0x1c')]===_0xdc30('0x1d')&&typeof _0xfdc8ed[_0xdc30('0x1e')]===_0xdc30('0x1d');var _0xeb1de1=_0x37786a['count'];var _0x5892ef=_0x5763f8?0x0:_0xfdc8ed['offset'];var _0x4eeef1=_0x5763f8?_0x37786a[_0xdc30('0x1f')]:_0xfdc8ed[_0xdc30('0x1c')]+_0xfdc8ed['limit'];var _0x1632a0;if(_0x4eeef1>=_0xeb1de1){_0x4eeef1=_0xeb1de1;_0x1632a0=0xc8;}else{_0x1632a0=0xce;}_0x3a4ace[_0xdc30('0x1a')](_0x1632a0);return _0x3a4ace[_0xdc30('0x20')](_0xdc30('0x21'),_0x5892ef+'-'+_0x4eeef1+'/'+_0xeb1de1)[_0xdc30('0x22')](_0x37786a);}return null;};}function patchUpdates(_0x1fd3e0){return function(_0x57a26c){try{jsonpatch[_0xdc30('0x23')](_0x57a26c,_0x1fd3e0,!![]);}catch(_0x9f37d9){return BPromise['reject'](_0x9f37d9);}return _0x57a26c[_0xdc30('0x24')]();};}function saveUpdates(_0xe49fe0,_0x15a457){return function(_0xcddc46){if(_0xcddc46){return _0xcddc46[_0xdc30('0x25')](_0xe49fe0)['then'](function(_0x204192){return _0x204192;});}return null;};}function removeEntity(_0x27d267,_0xd31417){return function(_0x16285c){if(_0x16285c){return _0x16285c['destroy']()[_0xdc30('0x26')](function(){_0x27d267[_0xdc30('0x1a')](0xcc)[_0xdc30('0x1b')]();});}};}function handleEntityNotFound(_0x6b9d42,_0xf41b24){return function(_0x27fbe0){if(!_0x27fbe0){_0x6b9d42[_0xdc30('0x19')](0x194);}return _0x27fbe0;};}function handleError(_0x23198f,_0x7230f0){_0x7230f0=_0x7230f0||0x1f4;return function(_0x1fd05b){logger[_0xdc30('0x27')](_0x1fd05b[_0xdc30('0x28')]);if(_0x1fd05b['name']){delete _0x1fd05b[_0xdc30('0x29')];}_0x23198f[_0xdc30('0x1a')](_0x7230f0)['send'](_0x1fd05b);};}exports[_0xdc30('0x2a')]=function(_0x50258e,_0x3ffe76){var _0xa1b90f={},_0x31e656={},_0x3ce768={'count':0x0,'rows':[]};var _0x166958=_[_0xdc30('0x2b')](db[_0xdc30('0x2c')]['rawAttributes'],function(_0x58b923){return{'name':_0x58b923[_0xdc30('0x2d')],'type':_0x58b923[_0xdc30('0x2e')][_0xdc30('0x2f')]};});_0x31e656['model']=_[_0xdc30('0x2b')](_0x166958,_0xdc30('0x29'));_0x31e656[_0xdc30('0x30')]=_[_0xdc30('0x31')](_0x50258e[_0xdc30('0x30')]);_0x31e656[_0xdc30('0x32')]=_[_0xdc30('0x33')](_0x31e656[_0xdc30('0x34')],_0x31e656['query']);_0xa1b90f[_0xdc30('0x35')]=_['intersection'](_0x31e656['model'],qs[_0xdc30('0x36')](_0x50258e[_0xdc30('0x30')][_0xdc30('0x36')]));_0xa1b90f['attributes']=_0xa1b90f[_0xdc30('0x35')][_0xdc30('0x37')]?_0xa1b90f[_0xdc30('0x35')]:_0x31e656[_0xdc30('0x34')];if(!_0x50258e[_0xdc30('0x30')][_0xdc30('0x38')]('nolimit')){_0xa1b90f['limit']=qs[_0xdc30('0x1e')](_0x50258e[_0xdc30('0x30')]['limit']);_0xa1b90f[_0xdc30('0x1c')]=qs[_0xdc30('0x1c')](_0x50258e[_0xdc30('0x30')][_0xdc30('0x1c')]);}_0xa1b90f[_0xdc30('0x39')]=qs[_0xdc30('0x3a')](_0x50258e[_0xdc30('0x30')][_0xdc30('0x3a')]);_0xa1b90f[_0xdc30('0x3b')]=qs['filters'](_['pick'](_0x50258e[_0xdc30('0x30')],_0x31e656[_0xdc30('0x32')]),_0x166958);if(_0x50258e['query']['filter']){_0xa1b90f[_0xdc30('0x3b')]=_[_0xdc30('0x3c')](_0xa1b90f[_0xdc30('0x3b')],{'$or':_[_0xdc30('0x2b')](_0x166958,function(_0x5befb4){if(_0x5befb4[_0xdc30('0x2e')]!==_0xdc30('0x3d')){var _0x5661ea={};_0x5661ea[_0x5befb4['name']]={'$like':'%'+_0x50258e['query'][_0xdc30('0x3e')]+'%'};return _0x5661ea;}})});}_0xa1b90f=_[_0xdc30('0x3c')]({},_0xa1b90f,_0x50258e[_0xdc30('0x3f')]);var _0x394c4b={'where':_0xa1b90f['where']};return db[_0xdc30('0x2c')][_0xdc30('0x1f')](_0x394c4b)[_0xdc30('0x26')](function(_0x465f93){_0x3ce768['count']=_0x465f93;if(_0x50258e[_0xdc30('0x30')][_0xdc30('0x40')]){_0xa1b90f[_0xdc30('0x41')]=[{'all':!![]}];}return db['DeskAccount'][_0xdc30('0x42')](_0xa1b90f);})['then'](function(_0x20ce3d){_0x3ce768[_0xdc30('0x43')]=_0x20ce3d;return _0x3ce768;})[_0xdc30('0x26')](respondWithFilteredResult(_0x3ffe76,_0xa1b90f))[_0xdc30('0x44')](handleError(_0x3ffe76,null));};exports[_0xdc30('0x45')]=function(_0x4e35e7,_0xb7e965){var _0x5ef666={'raw':![],'where':{'id':_0x4e35e7[_0xdc30('0x46')]['id']}},_0x51f17a={};_0x51f17a[_0xdc30('0x34')]=_[_0xdc30('0x31')](db[_0xdc30('0x2c')][_0xdc30('0x47')]);_0x51f17a[_0xdc30('0x30')]=_[_0xdc30('0x31')](_0x4e35e7[_0xdc30('0x30')]);_0x51f17a[_0xdc30('0x32')]=_[_0xdc30('0x33')](_0x51f17a[_0xdc30('0x34')],_0x51f17a[_0xdc30('0x30')]);_0x5ef666['attributes']=_[_0xdc30('0x33')](_0x51f17a[_0xdc30('0x34')],qs[_0xdc30('0x36')](_0x4e35e7[_0xdc30('0x30')][_0xdc30('0x36')]));_0x5ef666[_0xdc30('0x35')]=_0x5ef666[_0xdc30('0x35')][_0xdc30('0x37')]?_0x5ef666[_0xdc30('0x35')]:_0x51f17a['model'];if(_0x4e35e7[_0xdc30('0x30')][_0xdc30('0x40')]){_0x5ef666[_0xdc30('0x41')]=[{'all':!![]}];}_0x5ef666=_[_0xdc30('0x3c')]({},_0x5ef666,_0x4e35e7[_0xdc30('0x3f')]);return db[_0xdc30('0x2c')][_0xdc30('0x48')](_0x5ef666)[_0xdc30('0x26')](handleEntityNotFound(_0xb7e965,null))[_0xdc30('0x26')](respondWithResult(_0xb7e965,null))[_0xdc30('0x44')](handleError(_0xb7e965,null));};exports[_0xdc30('0x49')]=function(_0x57800a,_0xbc8899){return db[_0xdc30('0x2c')][_0xdc30('0x49')](_0x57800a[_0xdc30('0x4a')],{})[_0xdc30('0x26')](respondWithResult(_0xbc8899,0xc9))['catch'](handleError(_0xbc8899,null));};exports[_0xdc30('0x25')]=function(_0x8ce9a5,_0x362795){if(_0x8ce9a5[_0xdc30('0x4a')]['id']){delete _0x8ce9a5[_0xdc30('0x4a')]['id'];}return db[_0xdc30('0x2c')][_0xdc30('0x48')]({'where':{'id':_0x8ce9a5[_0xdc30('0x46')]['id']}})['then'](handleEntityNotFound(_0x362795,null))[_0xdc30('0x26')](saveUpdates(_0x8ce9a5[_0xdc30('0x4a')],null))['then'](respondWithResult(_0x362795,null))[_0xdc30('0x44')](handleError(_0x362795,null));};exports[_0xdc30('0x4b')]=function(_0x5d05bd,_0x1fb49c){return db[_0xdc30('0x2c')][_0xdc30('0x48')]({'where':{'id':_0x5d05bd['params']['id']}})[_0xdc30('0x26')](handleEntityNotFound(_0x1fb49c,null))[_0xdc30('0x26')](removeEntity(_0x1fb49c,null))['catch'](handleError(_0x1fb49c,null));};exports[_0xdc30('0x4c')]=function(_0x426fb9,_0x94891f,_0x365adc){var _0x5713c4={};var _0x4968c2={};var _0x5ccfb4;var _0x44e60c;return db['DeskAccount'][_0xdc30('0x4d')]({'where':{'id':_0x426fb9[_0xdc30('0x46')]['id']}})[_0xdc30('0x26')](handleEntityNotFound(_0x94891f,null))[_0xdc30('0x26')](function(_0x2e2b85){if(_0x2e2b85){_0x5ccfb4=_0x2e2b85;_0x4968c2[_0xdc30('0x34')]=_[_0xdc30('0x31')](db[_0xdc30('0x4e')][_0xdc30('0x47')]);_0x4968c2[_0xdc30('0x30')]=_[_0xdc30('0x31')](_0x426fb9[_0xdc30('0x30')]);_0x4968c2[_0xdc30('0x32')]=_[_0xdc30('0x33')](_0x4968c2[_0xdc30('0x34')],_0x4968c2[_0xdc30('0x30')]);_0x5713c4[_0xdc30('0x35')]=_[_0xdc30('0x33')](_0x4968c2['model'],qs[_0xdc30('0x36')](_0x426fb9[_0xdc30('0x30')][_0xdc30('0x36')]));_0x5713c4[_0xdc30('0x35')]=_0x5713c4[_0xdc30('0x35')][_0xdc30('0x37')]?_0x5713c4[_0xdc30('0x35')]:_0x4968c2[_0xdc30('0x34')];_0x5713c4['order']=qs['sort'](_0x426fb9[_0xdc30('0x30')][_0xdc30('0x3a')]);_0x5713c4[_0xdc30('0x3b')]=qs[_0xdc30('0x32')](_[_0xdc30('0x4f')](_0x426fb9['query'],_0x4968c2['filters']));if(_0x426fb9[_0xdc30('0x30')][_0xdc30('0x3e')]){_0x5713c4[_0xdc30('0x3b')]=_[_0xdc30('0x3c')](_0x5713c4['where'],{'$or':_['map'](_0x5713c4['attributes'],function(_0x3dc921){var _0x3e7866={};_0x3e7866[_0x3dc921]={'$like':'%'+_0x426fb9[_0xdc30('0x30')][_0xdc30('0x3e')]+'%'};return _0x3e7866;})});}_0x5713c4=_[_0xdc30('0x3c')]({},_0x5713c4,_0x426fb9[_0xdc30('0x3f')]);return _0x5ccfb4[_0xdc30('0x4c')](_0x5713c4);}})['then'](function(_0x12d8af){if(_0x12d8af){_0x44e60c=_0x12d8af[_0xdc30('0x37')];if(!_0x426fb9[_0xdc30('0x30')]['hasOwnProperty']('nolimit')){_0x5713c4['limit']=qs[_0xdc30('0x1e')](_0x426fb9['query'][_0xdc30('0x1e')]);_0x5713c4[_0xdc30('0x1c')]=qs[_0xdc30('0x1c')](_0x426fb9[_0xdc30('0x30')][_0xdc30('0x1c')]);}return _0x5ccfb4[_0xdc30('0x4c')](_0x5713c4);}})[_0xdc30('0x26')](function(_0x28192d){if(_0x28192d){return _0x28192d?{'count':_0x44e60c,'rows':_0x28192d}:null;}})[_0xdc30('0x26')](respondWithResult(_0x94891f,null))[_0xdc30('0x44')](handleError(_0x94891f,null));};exports[_0xdc30('0x50')]=function(_0x353ce8,_0x25ef46,_0x2196a9){if(_0x353ce8[_0xdc30('0x4a')]['id']){delete _0x353ce8[_0xdc30('0x4a')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x353ce8[_0xdc30('0x46')]['id']}})[_0xdc30('0x26')](handleEntityNotFound(_0x25ef46,null))[_0xdc30('0x26')](function(_0x1fd375){if(_0x1fd375){_0x353ce8[_0xdc30('0x4a')][_0xdc30('0x51')]=_0x1fd375['id'];_0x353ce8['body'][_0xdc30('0x52')]=integrations[_0xdc30('0x53')](_0x353ce8[_0xdc30('0x4a')][_0xdc30('0x54')],_0x353ce8[_0xdc30('0x4a')][_0xdc30('0x2e')]);_0x353ce8[_0xdc30('0x4a')][_0xdc30('0x55')]=integrations[_0xdc30('0x56')](_0x353ce8[_0xdc30('0x4a')][_0xdc30('0x54')],_0x353ce8[_0xdc30('0x4a')][_0xdc30('0x2e')]);return db[_0xdc30('0x4e')][_0xdc30('0x49')](_0x353ce8[_0xdc30('0x4a')],{'include':[{'model':db[_0xdc30('0x57')],'as':_0xdc30('0x52')},{'model':db['DeskField'],'as':_0xdc30('0x55')}]});}return null;})[_0xdc30('0x26')](respondWithResult(_0x25ef46,null))['catch'](handleError(_0x25ef46,null));};exports[_0xdc30('0x58')]=function(_0x506c6d,_0x22adf1,_0x298299){var _0x4a88f7=[{'name':_0xdc30('0x59'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x39bd62='';return db['DeskAccount'][_0xdc30('0x4d')]({'where':{'id':_0x506c6d[_0xdc30('0x46')]['id']},'attributes':['id',_0xdc30('0x5a'),_0xdc30('0x5b'),_0xdc30('0x5c'),_0xdc30('0x5d'),_0xdc30('0x5e'),_0xdc30('0x5f'),'token',_0xdc30('0x60')]})[_0xdc30('0x26')](handleEntityNotFound(_0x22adf1,null))[_0xdc30('0x26')](function(_0x44475d){if(_0x44475d){_0x39bd62=_0x44475d[_0xdc30('0x5a')];var _0x40cd25=_0x39bd62[_0xdc30('0x61')](-0x1);if(_0x40cd25==='/'){_0x39bd62=_0x39bd62[_0xdc30('0x62')](0x0,_0x39bd62[_0xdc30('0x63')](_0x40cd25));}var _0x227ee9={'method':_0xdc30('0x64'),'uri':util[_0xdc30('0x65')](_0xdc30('0x66'),_0x39bd62),'headers':{'Content-Type':_0xdc30('0x67'),'Accept':_0xdc30('0x67')},'json':!![]};if(_0x44475d[_0xdc30('0x5b')]===_0xdc30('0x68')){_0x227ee9[_0xdc30('0x69')][_0xdc30('0x6a')]=util[_0xdc30('0x65')](_0xdc30('0x6b'),new Buffer(util[_0xdc30('0x65')](_0xdc30('0x6c'),_0x44475d[_0xdc30('0x5c')],_0x44475d[_0xdc30('0x5d')]))[_0xdc30('0x6d')](_0xdc30('0x6e')));}return rp(_0x227ee9)[_0xdc30('0x26')](function(_0x409ff9){return _0x4a88f7[_0xdc30('0x6f')](_[_0xdc30('0x2b')](_0x409ff9[_0xdc30('0x70')]['entries'],function(_0x3cb26a){return{'id':_0x3cb26a[_0xdc30('0x29')],'name':_0x3cb26a[_0xdc30('0x29')],'type':_0x3cb26a[_0xdc30('0x2e')],'active':_0x3cb26a['active'],'label':_0x3cb26a[_0xdc30('0x71')],'custom':!![]};}));});}})[_0xdc30('0x26')](function(_0x315af1){return{'count':_0x315af1[_0xdc30('0x37')],'rows':_0x315af1};})[_0xdc30('0x26')](respondWithResult(_0x22adf1,null))[_0xdc30('0x44')](function(_0x2f0651){var _0x16d983=_0x506c6d['query'][_0xdc30('0x72')]?0x1f4:_0x2f0651[_0xdc30('0x73')]||0x1f4;logger[_0xdc30('0x27')](_0xdc30('0x74'),_0xdc30('0x58'),_0x16d983,JSON[_0xdc30('0x75')](_0x2f0651));delete _0x2f0651['name'];if(_0x16d983===0x191){_0x16d983=0x190;}_0x22adf1[_0xdc30('0x1a')](_0x16d983)[_0xdc30('0x76')](_0x506c6d['query']['test']?{'message':_0xdc30('0x77'),'statusCode':_0x2f0651[_0xdc30('0x73')]}:_0x2f0651);});};
\ No newline at end of file
+var _0x221b=['tokenSecret','slice','substring','lastIndexOf','GET','%s/custom_fields','application/json','basic','Authorization','format','Basic\x20%s','base64','concat','_embedded','entries','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','error','name','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','DeskAccount','create','find','body','destroy','findOne','DeskConfiguration','getConfigurations','nolimit','addConfiguration','Subjects','getSubjects','channel','getDescriptions','Descriptions','getFields','priority','remoteUri','authType','username','password','consumerKey','token'];(function(_0x3e20b2,_0x4651cd){var _0x3ba2fa=function(_0x32bb69){while(--_0x32bb69){_0x3e20b2['push'](_0x3e20b2['shift']());}};_0x3ba2fa(++_0x4651cd);}(_0x221b,0xf2));var _0xb221=function(_0x42fa5e,_0x367b24){_0x42fa5e=_0x42fa5e-0x0;var _0x45ce3a=_0x221b[_0x42fa5e];return _0x45ce3a;};'use strict';var emlformat=require(_0xb221('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb221('0x1'));var jsonpatch=require(_0xb221('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb221('0x3'));var Mustache=require(_0xb221('0x4'));var util=require(_0xb221('0x5'));var path=require(_0xb221('0x6'));var sox=require(_0xb221('0x7'));var csv=require(_0xb221('0x8'));var ejs=require(_0xb221('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb221('0xa'));var crypto=require('crypto');var jsforce=require(_0xb221('0xb'));var deskjs=require(_0xb221('0xc'));var toCsv=require(_0xb221('0x8'));var querystring=require(_0xb221('0xd'));var Papa=require(_0xb221('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb221('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb221('0x10'));var logger=require(_0xb221('0x11'))(_0xb221('0x12'));var utils=require(_0xb221('0x13'));var config=require(_0xb221('0x14'));var licenseUtil=require(_0xb221('0x15'));var db=require(_0xb221('0x16'))['db'];var integrations=require(_0xb221('0x17'));function respondWithStatusCode(_0x49a0ce,_0x2faff5){_0x2faff5=_0x2faff5||0xcc;return function(_0x526655){if(_0x526655){return _0x49a0ce[_0xb221('0x18')](_0x2faff5);}return _0x49a0ce[_0xb221('0x19')](_0x2faff5)[_0xb221('0x1a')]();};}function respondWithResult(_0x994b09,_0x5744e8){_0x5744e8=_0x5744e8||0xc8;return function(_0x18e100){if(_0x18e100){return _0x994b09[_0xb221('0x19')](_0x5744e8)['json'](_0x18e100);}};}function respondWithFilteredResult(_0xc7de35,_0x5530e2){return function(_0x4b5a11){if(_0x4b5a11){var _0x3ef3b2=typeof _0x5530e2[_0xb221('0x1b')]===_0xb221('0x1c')&&typeof _0x5530e2[_0xb221('0x1d')]==='undefined';var _0x55d884=_0x4b5a11[_0xb221('0x1e')];var _0x27570e=_0x3ef3b2?0x0:_0x5530e2['offset'];var _0x1aaaf4=_0x3ef3b2?_0x4b5a11[_0xb221('0x1e')]:_0x5530e2[_0xb221('0x1b')]+_0x5530e2['limit'];var _0xd2e418;if(_0x1aaaf4>=_0x55d884){_0x1aaaf4=_0x55d884;_0xd2e418=0xc8;}else{_0xd2e418=0xce;}_0xc7de35[_0xb221('0x19')](_0xd2e418);return _0xc7de35['set'](_0xb221('0x1f'),_0x27570e+'-'+_0x1aaaf4+'/'+_0x55d884)[_0xb221('0x20')](_0x4b5a11);}return null;};}function patchUpdates(_0x21e7f1){return function(_0x677aa9){try{jsonpatch['apply'](_0x677aa9,_0x21e7f1,!![]);}catch(_0x2bad30){return BPromise[_0xb221('0x21')](_0x2bad30);}return _0x677aa9[_0xb221('0x22')]();};}function saveUpdates(_0x184c1f,_0x528e6e){return function(_0x37297f){if(_0x37297f){return _0x37297f[_0xb221('0x23')](_0x184c1f)[_0xb221('0x24')](function(_0xc54c67){return _0xc54c67;});}return null;};}function removeEntity(_0x1540c9,_0x24bdd8){return function(_0x15d37f){if(_0x15d37f){return _0x15d37f['destroy']()[_0xb221('0x24')](function(){_0x1540c9[_0xb221('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11dc39,_0x207890){return function(_0x2a23e5){if(!_0x2a23e5){_0x11dc39[_0xb221('0x18')](0x194);}return _0x2a23e5;};}function handleError(_0x2a32d6,_0x325024){_0x325024=_0x325024||0x1f4;return function(_0x405362){logger[_0xb221('0x25')](_0x405362['stack']);if(_0x405362[_0xb221('0x26')]){delete _0x405362[_0xb221('0x26')];}_0x2a32d6[_0xb221('0x19')](_0x325024)['send'](_0x405362);};}exports['index']=function(_0x3c8ce3,_0x338466){var _0x2a25cd={},_0x58bc3d={},_0x43586f={'count':0x0,'rows':[]};var _0x5712f7=_['map'](db['DeskAccount']['rawAttributes'],function(_0x3de7e7){return{'name':_0x3de7e7[_0xb221('0x27')],'type':_0x3de7e7[_0xb221('0x28')]['key']};});_0x58bc3d['model']=_[_0xb221('0x29')](_0x5712f7,_0xb221('0x26'));_0x58bc3d[_0xb221('0x2a')]=_[_0xb221('0x2b')](_0x3c8ce3[_0xb221('0x2a')]);_0x58bc3d[_0xb221('0x2c')]=_[_0xb221('0x2d')](_0x58bc3d[_0xb221('0x2e')],_0x58bc3d['query']);_0x2a25cd[_0xb221('0x2f')]=_[_0xb221('0x2d')](_0x58bc3d[_0xb221('0x2e')],qs[_0xb221('0x30')](_0x3c8ce3[_0xb221('0x2a')][_0xb221('0x30')]));_0x2a25cd['attributes']=_0x2a25cd[_0xb221('0x2f')][_0xb221('0x31')]?_0x2a25cd[_0xb221('0x2f')]:_0x58bc3d['model'];if(!_0x3c8ce3['query'][_0xb221('0x32')]('nolimit')){_0x2a25cd[_0xb221('0x1d')]=qs[_0xb221('0x1d')](_0x3c8ce3[_0xb221('0x2a')][_0xb221('0x1d')]);_0x2a25cd['offset']=qs[_0xb221('0x1b')](_0x3c8ce3[_0xb221('0x2a')][_0xb221('0x1b')]);}_0x2a25cd[_0xb221('0x33')]=qs[_0xb221('0x34')](_0x3c8ce3['query'][_0xb221('0x34')]);_0x2a25cd[_0xb221('0x35')]=qs[_0xb221('0x2c')](_[_0xb221('0x36')](_0x3c8ce3[_0xb221('0x2a')],_0x58bc3d[_0xb221('0x2c')]),_0x5712f7);if(_0x3c8ce3[_0xb221('0x2a')][_0xb221('0x37')]){_0x2a25cd[_0xb221('0x35')]=_[_0xb221('0x38')](_0x2a25cd[_0xb221('0x35')],{'$or':_[_0xb221('0x29')](_0x5712f7,function(_0x271d88){if(_0x271d88['type']!=='VIRTUAL'){var _0x305e53={};_0x305e53[_0x271d88[_0xb221('0x26')]]={'$like':'%'+_0x3c8ce3[_0xb221('0x2a')][_0xb221('0x37')]+'%'};return _0x305e53;}})});}_0x2a25cd=_[_0xb221('0x38')]({},_0x2a25cd,_0x3c8ce3[_0xb221('0x39')]);var _0x58eff8={'where':_0x2a25cd['where']};return db['DeskAccount']['count'](_0x58eff8)['then'](function(_0x23c71f){_0x43586f[_0xb221('0x1e')]=_0x23c71f;if(_0x3c8ce3[_0xb221('0x2a')]['includeAll']){_0x2a25cd[_0xb221('0x3a')]=[{'all':!![]}];}return db['DeskAccount'][_0xb221('0x3b')](_0x2a25cd);})[_0xb221('0x24')](function(_0x2f8c8c){_0x43586f[_0xb221('0x3c')]=_0x2f8c8c;return _0x43586f;})[_0xb221('0x24')](respondWithFilteredResult(_0x338466,_0x2a25cd))[_0xb221('0x3d')](handleError(_0x338466,null));};exports[_0xb221('0x3e')]=function(_0x2c9b0b,_0x1a16c0){var _0xc7e2ed={'raw':![],'where':{'id':_0x2c9b0b[_0xb221('0x3f')]['id']}},_0x20872a={};_0x20872a[_0xb221('0x2e')]=_['keys'](db['DeskAccount'][_0xb221('0x40')]);_0x20872a[_0xb221('0x2a')]=_[_0xb221('0x2b')](_0x2c9b0b[_0xb221('0x2a')]);_0x20872a[_0xb221('0x2c')]=_[_0xb221('0x2d')](_0x20872a['model'],_0x20872a[_0xb221('0x2a')]);_0xc7e2ed['attributes']=_[_0xb221('0x2d')](_0x20872a[_0xb221('0x2e')],qs[_0xb221('0x30')](_0x2c9b0b['query'][_0xb221('0x30')]));_0xc7e2ed[_0xb221('0x2f')]=_0xc7e2ed[_0xb221('0x2f')][_0xb221('0x31')]?_0xc7e2ed[_0xb221('0x2f')]:_0x20872a['model'];if(_0x2c9b0b['query']['includeAll']){_0xc7e2ed['include']=[{'all':!![]}];}_0xc7e2ed=_[_0xb221('0x38')]({},_0xc7e2ed,_0x2c9b0b['options']);return db[_0xb221('0x41')]['find'](_0xc7e2ed)[_0xb221('0x24')](handleEntityNotFound(_0x1a16c0,null))[_0xb221('0x24')](respondWithResult(_0x1a16c0,null))[_0xb221('0x3d')](handleError(_0x1a16c0,null));};exports[_0xb221('0x42')]=function(_0x59758d,_0xc3b66e){return db[_0xb221('0x41')][_0xb221('0x42')](_0x59758d['body'],{})[_0xb221('0x24')](respondWithResult(_0xc3b66e,0xc9))[_0xb221('0x3d')](handleError(_0xc3b66e,null));};exports[_0xb221('0x23')]=function(_0x2f656b,_0x3d7439){if(_0x2f656b['body']['id']){delete _0x2f656b['body']['id'];}return db[_0xb221('0x41')][_0xb221('0x43')]({'where':{'id':_0x2f656b[_0xb221('0x3f')]['id']}})[_0xb221('0x24')](handleEntityNotFound(_0x3d7439,null))['then'](saveUpdates(_0x2f656b[_0xb221('0x44')],null))[_0xb221('0x24')](respondWithResult(_0x3d7439,null))[_0xb221('0x3d')](handleError(_0x3d7439,null));};exports[_0xb221('0x45')]=function(_0x5bde8b,_0x11a342){return db['DeskAccount'][_0xb221('0x43')]({'where':{'id':_0x5bde8b['params']['id']}})[_0xb221('0x24')](handleEntityNotFound(_0x11a342,null))[_0xb221('0x24')](removeEntity(_0x11a342,null))[_0xb221('0x3d')](handleError(_0x11a342,null));};exports['getConfigurations']=function(_0xb6824a,_0x482e9a,_0xa1b0c0){var _0x4b5d12={};var _0x18095d={};var _0x533899;var _0x10d170;return db[_0xb221('0x41')][_0xb221('0x46')]({'where':{'id':_0xb6824a[_0xb221('0x3f')]['id']}})[_0xb221('0x24')](handleEntityNotFound(_0x482e9a,null))[_0xb221('0x24')](function(_0x46acf0){if(_0x46acf0){_0x533899=_0x46acf0;_0x18095d['model']=_[_0xb221('0x2b')](db[_0xb221('0x47')][_0xb221('0x40')]);_0x18095d[_0xb221('0x2a')]=_['keys'](_0xb6824a['query']);_0x18095d[_0xb221('0x2c')]=_[_0xb221('0x2d')](_0x18095d[_0xb221('0x2e')],_0x18095d[_0xb221('0x2a')]);_0x4b5d12['attributes']=_[_0xb221('0x2d')](_0x18095d[_0xb221('0x2e')],qs[_0xb221('0x30')](_0xb6824a[_0xb221('0x2a')][_0xb221('0x30')]));_0x4b5d12[_0xb221('0x2f')]=_0x4b5d12[_0xb221('0x2f')][_0xb221('0x31')]?_0x4b5d12[_0xb221('0x2f')]:_0x18095d['model'];_0x4b5d12[_0xb221('0x33')]=qs['sort'](_0xb6824a[_0xb221('0x2a')][_0xb221('0x34')]);_0x4b5d12[_0xb221('0x35')]=qs[_0xb221('0x2c')](_[_0xb221('0x36')](_0xb6824a[_0xb221('0x2a')],_0x18095d['filters']));if(_0xb6824a['query'][_0xb221('0x37')]){_0x4b5d12[_0xb221('0x35')]=_['merge'](_0x4b5d12[_0xb221('0x35')],{'$or':_[_0xb221('0x29')](_0x4b5d12[_0xb221('0x2f')],function(_0x4a4e54){var _0x33c47c={};_0x33c47c[_0x4a4e54]={'$like':'%'+_0xb6824a[_0xb221('0x2a')][_0xb221('0x37')]+'%'};return _0x33c47c;})});}_0x4b5d12=_[_0xb221('0x38')]({},_0x4b5d12,_0xb6824a['options']);return _0x533899[_0xb221('0x48')](_0x4b5d12);}})[_0xb221('0x24')](function(_0x13c339){if(_0x13c339){_0x10d170=_0x13c339[_0xb221('0x31')];if(!_0xb6824a['query'][_0xb221('0x32')](_0xb221('0x49'))){_0x4b5d12['limit']=qs[_0xb221('0x1d')](_0xb6824a[_0xb221('0x2a')]['limit']);_0x4b5d12[_0xb221('0x1b')]=qs['offset'](_0xb6824a[_0xb221('0x2a')][_0xb221('0x1b')]);}return _0x533899[_0xb221('0x48')](_0x4b5d12);}})[_0xb221('0x24')](function(_0x396fd3){if(_0x396fd3){return _0x396fd3?{'count':_0x10d170,'rows':_0x396fd3}:null;}})[_0xb221('0x24')](respondWithResult(_0x482e9a,null))['catch'](handleError(_0x482e9a,null));};exports[_0xb221('0x4a')]=function(_0x247193,_0x8d3c61,_0xc67bfc){if(_0x247193[_0xb221('0x44')]['id']){delete _0x247193[_0xb221('0x44')]['id'];}return db[_0xb221('0x41')]['findOne']({'where':{'id':_0x247193[_0xb221('0x3f')]['id']}})[_0xb221('0x24')](handleEntityNotFound(_0x8d3c61,null))['then'](function(_0x154459){if(_0x154459){_0x247193[_0xb221('0x44')]['AccountId']=_0x154459['id'];_0x247193[_0xb221('0x44')][_0xb221('0x4b')]=integrations[_0xb221('0x4c')](_0x247193[_0xb221('0x44')][_0xb221('0x4d')],_0x247193[_0xb221('0x44')][_0xb221('0x28')]);_0x247193[_0xb221('0x44')]['Descriptions']=integrations[_0xb221('0x4e')](_0x247193[_0xb221('0x44')]['channel'],_0x247193[_0xb221('0x44')][_0xb221('0x28')]);return db[_0xb221('0x47')][_0xb221('0x42')](_0x247193['body'],{'include':[{'model':db['DeskField'],'as':_0xb221('0x4b')},{'model':db['DeskField'],'as':_0xb221('0x4f')}]});}return null;})['then'](respondWithResult(_0x8d3c61,null))[_0xb221('0x3d')](handleError(_0x8d3c61,null));};exports[_0xb221('0x50')]=function(_0x593305,_0x176688,_0x2662f9){var _0xfffcbb=[{'name':_0xb221('0x51'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x132bcb='';return db[_0xb221('0x41')][_0xb221('0x46')]({'where':{'id':_0x593305[_0xb221('0x3f')]['id']},'attributes':['id',_0xb221('0x52'),_0xb221('0x53'),_0xb221('0x54'),_0xb221('0x55'),_0xb221('0x56'),'consumerSecret',_0xb221('0x57'),_0xb221('0x58')]})[_0xb221('0x24')](handleEntityNotFound(_0x176688,null))[_0xb221('0x24')](function(_0x2ef750){if(_0x2ef750){_0x132bcb=_0x2ef750[_0xb221('0x52')];var _0x1f2cb7=_0x132bcb[_0xb221('0x59')](-0x1);if(_0x1f2cb7==='/'){_0x132bcb=_0x132bcb[_0xb221('0x5a')](0x0,_0x132bcb[_0xb221('0x5b')](_0x1f2cb7));}var _0xc617dc={'method':_0xb221('0x5c'),'uri':util['format'](_0xb221('0x5d'),_0x132bcb),'headers':{'Content-Type':_0xb221('0x5e'),'Accept':_0xb221('0x5e')},'json':!![]};if(_0x2ef750[_0xb221('0x53')]===_0xb221('0x5f')){_0xc617dc['headers'][_0xb221('0x60')]=util[_0xb221('0x61')](_0xb221('0x62'),new Buffer(util[_0xb221('0x61')]('%s:%s',_0x2ef750['username'],_0x2ef750[_0xb221('0x55')]))['toString'](_0xb221('0x63')));}return rp(_0xc617dc)[_0xb221('0x24')](function(_0x3409c3){return _0xfffcbb[_0xb221('0x64')](_['map'](_0x3409c3[_0xb221('0x65')][_0xb221('0x66')],function(_0x20a237){return{'id':_0x20a237['name'],'name':_0x20a237['name'],'type':_0x20a237[_0xb221('0x28')],'active':_0x20a237['active'],'label':_0x20a237[_0xb221('0x67')],'custom':!![]};}));});}})['then'](function(_0x1ffa00){return{'count':_0x1ffa00['length'],'rows':_0x1ffa00};})['then'](respondWithResult(_0x176688,null))[_0xb221('0x3d')](function(_0x380b3c){var _0x53c076=_0x593305[_0xb221('0x2a')][_0xb221('0x68')]?0x1f4:_0x380b3c['statusCode']||0x1f4;logger['error'](_0xb221('0x69'),_0xb221('0x50'),_0x53c076,JSON[_0xb221('0x6a')](_0x380b3c));delete _0x380b3c[_0xb221('0x26')];if(_0x53c076===0x191){_0x53c076=0x190;}_0x176688[_0xb221('0x19')](_0x53c076)[_0xb221('0x6b')](_0x593305[_0xb221('0x2a')][_0xb221('0x68')]?{'message':_0xb221('0x6c'),'statusCode':_0x380b3c[_0xb221('0x6d')]}:_0x380b3c);});};
\ No newline at end of file
index 77ce16b..3eafb66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf890=['request-promise','rimraf','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','moment','bluebird'];(function(_0xaba3e1,_0x330d10){var _0x13507c=function(_0x4f3a89){while(--_0x4f3a89){_0xaba3e1['push'](_0xaba3e1['shift']());}};_0x13507c(++_0x330d10);}(_0xf890,0x97));var _0x0f89=function(_0x492fcc,_0x2abc57){_0x492fcc=_0x492fcc-0x0;var _0x2b2932=_0xf890[_0x492fcc];return _0x2b2932;};'use strict';var _=require(_0x0f89('0x0'));var util=require(_0x0f89('0x1'));var logger=require(_0x0f89('0x2'))('api');var moment=require(_0x0f89('0x3'));var BPromise=require(_0x0f89('0x4'));var rp=require(_0x0f89('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f89('0x6'));var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x0f89('0x7'));module[_0x0f89('0x8')]=function(_0x3f9d22,_0xed9bcf){return _0x3f9d22[_0x0f89('0x9')](_0x0f89('0xa'),attributes,{'tableName':_0x0f89('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x44ca=['../../config/environment','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','util','api','moment','path','rimraf'];(function(_0x9f9453,_0x483fe6){var _0x4b5a34=function(_0x28edba){while(--_0x28edba){_0x9f9453['push'](_0x9f9453['shift']());}};_0x4b5a34(++_0x483fe6);}(_0x44ca,0x9b));var _0xa44c=function(_0x3ed054,_0x4d4f16){_0x3ed054=_0x3ed054-0x0;var _0x16dd95=_0x44ca[_0x3ed054];return _0x16dd95;};'use strict';var _=require('lodash');var util=require(_0xa44c('0x0'));var logger=require('../../config/logger')(_0xa44c('0x1'));var moment=require(_0xa44c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa44c('0x3'));var rimraf=require(_0xa44c('0x4'));var config=require(_0xa44c('0x5'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xa44c('0x6'));module[_0xa44c('0x7')]=function(_0x80338e,_0x1f78e8){return _0x80338e['define'](_0xa44c('0x8'),attributes,{'tableName':_0xa44c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0a8b8bc..ef1717b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb68=['GetDeskAccount','findAll','options','where','attributes','include','map','model','stringify','ShowDeskAccount','DeskAccount','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xbb68,0x109));var _0x8bb6=function(_0x52273a,_0x191dba){_0x52273a=_0x52273a-0x0;var _0x2c7920=_0xbb68[_0x52273a];return _0x2c7920;};'use strict';var _=require(_0x8bb6('0x0'));var util=require('util');var moment=require(_0x8bb6('0x1'));var BPromise=require(_0x8bb6('0x2'));var rs=require(_0x8bb6('0x3'));var fs=require('fs');var Redis=require(_0x8bb6('0x4'));var db=require(_0x8bb6('0x5'))['db'];var utils=require(_0x8bb6('0x6'));var logger=require(_0x8bb6('0x7'))(_0x8bb6('0x8'));var config=require(_0x8bb6('0x9'));var jayson=require(_0x8bb6('0xa'));var client=jayson['client'][_0x8bb6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1012f6,_0x1162d5,_0x1a526c){return new BPromise(function(_0x4d68b2,_0x4ab08f){return client['request'](_0x1012f6,_0x1a526c)[_0x8bb6('0xc')](function(_0xfae98c){logger['info'](_0x8bb6('0xd'),_0x1162d5,_0x8bb6('0xe'));logger[_0x8bb6('0xf')](_0x8bb6('0x10'),_0x1162d5,_0x8bb6('0xe'),JSON['stringify'](_0xfae98c));if(_0xfae98c[_0x8bb6('0x11')]){if(_0xfae98c[_0x8bb6('0x11')][_0x8bb6('0x12')]===0x1f4){logger[_0x8bb6('0x11')](_0x8bb6('0xd'),_0x1162d5,_0xfae98c[_0x8bb6('0x11')][_0x8bb6('0x13')]);return _0x4ab08f(_0xfae98c[_0x8bb6('0x11')][_0x8bb6('0x13')]);}logger[_0x8bb6('0x11')](_0x8bb6('0xd'),_0x1162d5,_0xfae98c[_0x8bb6('0x11')][_0x8bb6('0x13')]);return _0x4d68b2(_0xfae98c[_0x8bb6('0x11')]['message']);}else{logger[_0x8bb6('0x14')](_0x8bb6('0xd'),_0x1162d5,_0x8bb6('0xe'));_0x4d68b2(_0xfae98c[_0x8bb6('0x15')]['message']);}})[_0x8bb6('0x16')](function(_0x52c5c8){logger['error']('DeskAccount,\x20%s,\x20%s',_0x1162d5,_0x52c5c8);_0x4ab08f(_0x52c5c8);});});}exports[_0x8bb6('0x17')]=function(_0x43bcfc){var _0x2f119b=this;return new Promise(function(_0x17a04e,_0x449105){return db['DeskAccount'][_0x8bb6('0x18')]({'raw':_0x43bcfc[_0x8bb6('0x19')]?_0x43bcfc[_0x8bb6('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x43bcfc[_0x8bb6('0x19')]?_0x43bcfc[_0x8bb6('0x19')][_0x8bb6('0x1a')]||null:null,'attributes':_0x43bcfc[_0x8bb6('0x19')]?_0x43bcfc[_0x8bb6('0x19')][_0x8bb6('0x1b')]||null:null,'limit':_0x43bcfc['options']?_0x43bcfc[_0x8bb6('0x19')]['limit']||null:null,'include':_0x43bcfc[_0x8bb6('0x19')]?_0x43bcfc[_0x8bb6('0x19')][_0x8bb6('0x1c')]?_[_0x8bb6('0x1d')](_0x43bcfc['options'][_0x8bb6('0x1c')],function(_0x1b2789){return{'model':db[_0x1b2789['model']],'as':_0x1b2789['as'],'attributes':_0x1b2789[_0x8bb6('0x1b')],'include':_0x1b2789['include']?_[_0x8bb6('0x1d')](_0x1b2789['include'],function(_0xa6cd9f){return{'model':db[_0xa6cd9f['model']],'as':_0xa6cd9f['as'],'attributes':_0xa6cd9f['attributes'],'include':_0xa6cd9f['include']?_[_0x8bb6('0x1d')](_0xa6cd9f[_0x8bb6('0x1c')],function(_0x13e253){return{'model':db[_0x13e253[_0x8bb6('0x1e')]],'as':_0x13e253['as'],'attributes':_0x13e253['attributes']};}):[]};}):[]};}):[]:[]})[_0x8bb6('0xc')](function(_0x201f5c){logger['info'](_0x8bb6('0x17'),_0x43bcfc);logger[_0x8bb6('0xf')]('GetDeskAccount',_0x43bcfc,JSON[_0x8bb6('0x1f')](_0x201f5c));_0x17a04e(_0x201f5c);})[_0x8bb6('0x16')](function(_0x35d78c){logger[_0x8bb6('0x11')](_0x8bb6('0x17'),_0x35d78c['message'],_0x43bcfc);_0x449105(_0x2f119b[_0x8bb6('0x11')](0x1f4,_0x35d78c['message']));});});};exports[_0x8bb6('0x20')]=function(_0x58a13d){var _0x31c8ef=this;return new Promise(function(_0x2db259,_0x239cb8){return db[_0x8bb6('0x21')][_0x8bb6('0x22')]({'raw':_0x58a13d[_0x8bb6('0x19')]?_0x58a13d[_0x8bb6('0x19')][_0x8bb6('0x23')]===undefined?!![]:![]:!![],'where':_0x58a13d['options']?_0x58a13d['options'][_0x8bb6('0x1a')]||null:null,'attributes':_0x58a13d[_0x8bb6('0x19')]?_0x58a13d[_0x8bb6('0x19')][_0x8bb6('0x1b')]||null:null,'include':_0x58a13d[_0x8bb6('0x19')]?_0x58a13d[_0x8bb6('0x19')]['include']?_[_0x8bb6('0x1d')](_0x58a13d[_0x8bb6('0x19')]['include'],function(_0x3b910f){return{'model':db[_0x3b910f[_0x8bb6('0x1e')]],'as':_0x3b910f['as'],'attributes':_0x3b910f['attributes'],'include':_0x3b910f[_0x8bb6('0x1c')]?_['map'](_0x3b910f[_0x8bb6('0x1c')],function(_0x50167a){return{'model':db[_0x50167a['model']],'as':_0x50167a['as'],'attributes':_0x50167a[_0x8bb6('0x1b')],'include':_0x50167a['include']?_[_0x8bb6('0x1d')](_0x50167a[_0x8bb6('0x1c')],function(_0x46f485){return{'model':db[_0x46f485[_0x8bb6('0x1e')]],'as':_0x46f485['as'],'attributes':_0x46f485[_0x8bb6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8bb6('0xc')](function(_0xf2b61a){logger[_0x8bb6('0x14')](_0x8bb6('0x20'),_0x58a13d);logger[_0x8bb6('0xf')](_0x8bb6('0x20'),_0x58a13d,JSON['stringify'](_0xf2b61a));_0x2db259(_0xf2b61a);})[_0x8bb6('0x16')](function(_0xcb7348){logger['error'](_0x8bb6('0x20'),_0xcb7348['message'],_0x58a13d);_0x239cb8(_0x31c8ef[_0x8bb6('0x11')](0x1f4,_0xcb7348[_0x8bb6('0x13')]));});});};
\ No newline at end of file
+var _0x5125=['GetDeskAccount','DeskAccount','findAll','options','raw','include','model','attributes','map','find','where','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0xe345c1,_0x523213){var _0xcd21f=function(_0x4b168a){while(--_0x4b168a){_0xe345c1['push'](_0xe345c1['shift']());}};_0xcd21f(++_0x523213);}(_0x5125,0x1d3));var _0x5512=function(_0x4eff72,_0x103f80){_0x4eff72=_0x4eff72-0x0;var _0x5bd1cf=_0x5125[_0x4eff72];return _0x5bd1cf;};'use strict';var _=require(_0x5512('0x0'));var util=require(_0x5512('0x1'));var moment=require(_0x5512('0x2'));var BPromise=require(_0x5512('0x3'));var rs=require(_0x5512('0x4'));var fs=require('fs');var Redis=require(_0x5512('0x5'));var db=require(_0x5512('0x6'))['db'];var utils=require(_0x5512('0x7'));var logger=require(_0x5512('0x8'))('rpc');var config=require(_0x5512('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5512('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57d070,_0x32d7da,_0x95d392){return new BPromise(function(_0x3c1414,_0x5c064c){return client[_0x5512('0xb')](_0x57d070,_0x95d392)[_0x5512('0xc')](function(_0x39b80a){logger[_0x5512('0xd')](_0x5512('0xe'),_0x32d7da,_0x5512('0xf'));logger[_0x5512('0x10')](_0x5512('0x11'),_0x32d7da,'request\x20sent',JSON[_0x5512('0x12')](_0x39b80a));if(_0x39b80a[_0x5512('0x13')]){if(_0x39b80a[_0x5512('0x13')]['code']===0x1f4){logger[_0x5512('0x13')](_0x5512('0xe'),_0x32d7da,_0x39b80a['error']['message']);return _0x5c064c(_0x39b80a[_0x5512('0x13')][_0x5512('0x14')]);}logger['error']('DeskAccount,\x20%s,\x20%s',_0x32d7da,_0x39b80a[_0x5512('0x13')][_0x5512('0x14')]);return _0x3c1414(_0x39b80a['error'][_0x5512('0x14')]);}else{logger[_0x5512('0xd')](_0x5512('0xe'),_0x32d7da,'request\x20sent');_0x3c1414(_0x39b80a[_0x5512('0x15')][_0x5512('0x14')]);}})[_0x5512('0x16')](function(_0x43a993){logger['error'](_0x5512('0xe'),_0x32d7da,_0x43a993);_0x5c064c(_0x43a993);});});}exports[_0x5512('0x17')]=function(_0x1b2c61){var _0x477331=this;return new Promise(function(_0x421a0f,_0x30faf4){return db[_0x5512('0x18')][_0x5512('0x19')]({'raw':_0x1b2c61[_0x5512('0x1a')]?_0x1b2c61[_0x5512('0x1a')][_0x5512('0x1b')]===undefined?!![]:![]:!![],'where':_0x1b2c61['options']?_0x1b2c61[_0x5512('0x1a')]['where']||null:null,'attributes':_0x1b2c61[_0x5512('0x1a')]?_0x1b2c61['options']['attributes']||null:null,'limit':_0x1b2c61[_0x5512('0x1a')]?_0x1b2c61[_0x5512('0x1a')]['limit']||null:null,'include':_0x1b2c61[_0x5512('0x1a')]?_0x1b2c61[_0x5512('0x1a')]['include']?_['map'](_0x1b2c61['options'][_0x5512('0x1c')],function(_0x410eee){return{'model':db[_0x410eee[_0x5512('0x1d')]],'as':_0x410eee['as'],'attributes':_0x410eee[_0x5512('0x1e')],'include':_0x410eee[_0x5512('0x1c')]?_[_0x5512('0x1f')](_0x410eee[_0x5512('0x1c')],function(_0x7d2c37){return{'model':db[_0x7d2c37[_0x5512('0x1d')]],'as':_0x7d2c37['as'],'attributes':_0x7d2c37[_0x5512('0x1e')],'include':_0x7d2c37[_0x5512('0x1c')]?_[_0x5512('0x1f')](_0x7d2c37[_0x5512('0x1c')],function(_0x5a2402){return{'model':db[_0x5a2402['model']],'as':_0x5a2402['as'],'attributes':_0x5a2402[_0x5512('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x176d4a){logger[_0x5512('0xd')]('GetDeskAccount',_0x1b2c61);logger[_0x5512('0x10')](_0x5512('0x17'),_0x1b2c61,JSON['stringify'](_0x176d4a));_0x421a0f(_0x176d4a);})['catch'](function(_0x39d8cd){logger[_0x5512('0x13')](_0x5512('0x17'),_0x39d8cd[_0x5512('0x14')],_0x1b2c61);_0x30faf4(_0x477331[_0x5512('0x13')](0x1f4,_0x39d8cd[_0x5512('0x14')]));});});};exports['ShowDeskAccount']=function(_0x2ac75e){var _0x561381=this;return new Promise(function(_0x470224,_0x465307){return db[_0x5512('0x18')][_0x5512('0x20')]({'raw':_0x2ac75e['options']?_0x2ac75e[_0x5512('0x1a')][_0x5512('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ac75e['options']?_0x2ac75e['options'][_0x5512('0x21')]||null:null,'attributes':_0x2ac75e[_0x5512('0x1a')]?_0x2ac75e[_0x5512('0x1a')][_0x5512('0x1e')]||null:null,'include':_0x2ac75e[_0x5512('0x1a')]?_0x2ac75e[_0x5512('0x1a')][_0x5512('0x1c')]?_['map'](_0x2ac75e[_0x5512('0x1a')][_0x5512('0x1c')],function(_0x46b9cb){return{'model':db[_0x46b9cb[_0x5512('0x1d')]],'as':_0x46b9cb['as'],'attributes':_0x46b9cb[_0x5512('0x1e')],'include':_0x46b9cb[_0x5512('0x1c')]?_['map'](_0x46b9cb['include'],function(_0x2b175f){return{'model':db[_0x2b175f[_0x5512('0x1d')]],'as':_0x2b175f['as'],'attributes':_0x2b175f[_0x5512('0x1e')],'include':_0x2b175f[_0x5512('0x1c')]?_[_0x5512('0x1f')](_0x2b175f[_0x5512('0x1c')],function(_0x22aa4a){return{'model':db[_0x22aa4a[_0x5512('0x1d')]],'as':_0x22aa4a['as'],'attributes':_0x22aa4a[_0x5512('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5512('0xc')](function(_0x163e7d){logger[_0x5512('0xd')](_0x5512('0x22'),_0x2ac75e);logger[_0x5512('0x10')]('ShowDeskAccount',_0x2ac75e,JSON['stringify'](_0x163e7d));_0x470224(_0x163e7d);})[_0x5512('0x16')](function(_0x46e74e){logger[_0x5512('0x13')](_0x5512('0x22'),_0x46e74e[_0x5512('0x14')],_0x2ac75e);_0x465307(_0x561381[_0x5512('0x13')](0x1f4,_0x46e74e['message']));});});};
\ No newline at end of file
index 4a24243..a68724b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1e6021,_0x121775){var _0x28456e=function(_0x1b6aa8){while(--_0x1b6aa8){_0x1e6021['push'](_0x1e6021['shift']());}};_0x28456e(++_0x121775);}(_0x34e8,0x12c));var _0x834e=function(_0x117337,_0x4774e1){_0x117337=_0x117337-0x0;var _0x21b308=_0x34e8[_0x117337];return _0x21b308;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router;
\ No newline at end of file
+var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x2c6c03,_0x22924c){var _0x3d2d21=function(_0x47637a){while(--_0x47637a){_0x2c6c03['push'](_0x2c6c03['shift']());}};_0x3d2d21(++_0x22924c);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router;
\ No newline at end of file
index a1506b4..a6cd7e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea97=['sequelize','exports','STRING'];(function(_0x267e6c,_0x56a07a){var _0x22bcf0=function(_0x59b4f6){while(--_0x59b4f6){_0x267e6c['push'](_0x267e6c['shift']());}};_0x22bcf0(++_0x56a07a);}(_0xea97,0x7b));var _0x7ea9=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xea97[_0x4a7631];return _0x1a5a6f;};'use strict';var Sequelize=require(_0x7ea9('0x0'));module[_0x7ea9('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7ea9('0x2')]}};
\ No newline at end of file
+var _0xf169=['STRING','sequelize','exports'];(function(_0x5ca0fd,_0x4227a8){var _0x4075cf=function(_0x3ad316){while(--_0x3ad316){_0x5ca0fd['push'](_0x5ca0fd['shift']());}};_0x4075cf(++_0x4227a8);}(_0xf169,0x178));var _0x9f16=function(_0x198531,_0x2150ad){_0x198531=_0x198531-0x0;var _0x2991eb=_0xf169[_0x198531];return _0x2991eb;};'use strict';var Sequelize=require(_0x9f16('0x0'));module[_0x9f16('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9f16('0x2')]}};
\ No newline at end of file
index 897f440..4c69c88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98f7=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','set','Content-Range','apply','save','then','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','count','includeAll','rows','catch','length','create','update','body','find','params','getFields','findOne','DeskField','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce'];(function(_0x358ebb,_0x132b9e){var _0x21e3ff=function(_0x1262d6){while(--_0x1262d6){_0x358ebb['push'](_0x358ebb['shift']());}};_0x21e3ff(++_0x132b9e);}(_0x98f7,0x190));var _0x798f=function(_0x1ccdb7,_0x4841de){_0x1ccdb7=_0x1ccdb7-0x0;var _0x1b9273=_0x98f7[_0x1ccdb7];return _0x1b9273;};'use strict';var emlformat=require(_0x798f('0x0'));var rimraf=require(_0x798f('0x1'));var zipdir=require(_0x798f('0x2'));var jsonpatch=require(_0x798f('0x3'));var rp=require(_0x798f('0x4'));var moment=require('moment');var BPromise=require(_0x798f('0x5'));var Mustache=require(_0x798f('0x6'));var util=require(_0x798f('0x7'));var path=require(_0x798f('0x8'));var sox=require(_0x798f('0x9'));var csv=require(_0x798f('0xa'));var ejs=require(_0x798f('0xb'));var fs=require('fs');var fs_extra=require(_0x798f('0xc'));var _=require('lodash');var squel=require(_0x798f('0xd'));var crypto=require('crypto');var jsforce=require(_0x798f('0xe'));var deskjs=require(_0x798f('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x798f('0x10'));var Redis=require(_0x798f('0x11'));var authService=require(_0x798f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x798f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x798f('0x14'))(_0x798f('0x15'));var utils=require(_0x798f('0x16'));var config=require(_0x798f('0x17'));var licenseUtil=require(_0x798f('0x18'));var db=require(_0x798f('0x19'))['db'];function respondWithStatusCode(_0x1c1be4,_0x24e0a8){_0x24e0a8=_0x24e0a8||0xcc;return function(_0x55d1c5){if(_0x55d1c5){return _0x1c1be4[_0x798f('0x1a')](_0x24e0a8);}return _0x1c1be4['status'](_0x24e0a8)[_0x798f('0x1b')]();};}function respondWithResult(_0x131c9,_0x4ec14){_0x4ec14=_0x4ec14||0xc8;return function(_0x293179){if(_0x293179){return _0x131c9[_0x798f('0x1c')](_0x4ec14)[_0x798f('0x1d')](_0x293179);}};}function respondWithFilteredResult(_0x30202f,_0x5b0f00){return function(_0x54ae3a){if(_0x54ae3a){var _0x34ceb9=typeof _0x5b0f00[_0x798f('0x1e')]==='undefined'&&typeof _0x5b0f00[_0x798f('0x1f')]===_0x798f('0x20');var _0x32e083=_0x54ae3a['count'];var _0x452ce9=_0x34ceb9?0x0:_0x5b0f00['offset'];var _0x142aae=_0x34ceb9?_0x54ae3a['count']:_0x5b0f00[_0x798f('0x1e')]+_0x5b0f00['limit'];var _0x1503f5;if(_0x142aae>=_0x32e083){_0x142aae=_0x32e083;_0x1503f5=0xc8;}else{_0x1503f5=0xce;}_0x30202f[_0x798f('0x1c')](_0x1503f5);return _0x30202f[_0x798f('0x21')](_0x798f('0x22'),_0x452ce9+'-'+_0x142aae+'/'+_0x32e083)[_0x798f('0x1d')](_0x54ae3a);}return null;};}function patchUpdates(_0x54ba41){return function(_0x5ee273){try{jsonpatch[_0x798f('0x23')](_0x5ee273,_0x54ba41,!![]);}catch(_0x5c277a){return BPromise['reject'](_0x5c277a);}return _0x5ee273[_0x798f('0x24')]();};}function saveUpdates(_0x441cc1,_0x1341b2){return function(_0x523efa){if(_0x523efa){return _0x523efa['update'](_0x441cc1)[_0x798f('0x25')](function(_0x3a5eb8){return _0x3a5eb8;});}return null;};}function removeEntity(_0x5bfbdf,_0x7b7295){return function(_0x186921){if(_0x186921){return _0x186921['destroy']()[_0x798f('0x25')](function(){_0x5bfbdf[_0x798f('0x1c')](0xcc)[_0x798f('0x1b')]();});}};}function handleEntityNotFound(_0xd3d004,_0xb2425a){return function(_0x5f3596){if(!_0x5f3596){_0xd3d004[_0x798f('0x1a')](0x194);}return _0x5f3596;};}function handleError(_0x182858,_0xddc9f3){_0xddc9f3=_0xddc9f3||0x1f4;return function(_0xcfc361){logger['error'](_0xcfc361[_0x798f('0x26')]);if(_0xcfc361[_0x798f('0x27')]){delete _0xcfc361['name'];}_0x182858['status'](_0xddc9f3)[_0x798f('0x28')](_0xcfc361);};}exports[_0x798f('0x29')]=function(_0x47ae0f,_0x950206){var _0x3f0dcf={},_0x3a4c8f={},_0x4345e5={'count':0x0,'rows':[]};var _0x3e1920=_[_0x798f('0x2a')](db[_0x798f('0x2b')][_0x798f('0x2c')],function(_0xc0cfb2){return{'name':_0xc0cfb2[_0x798f('0x2d')],'type':_0xc0cfb2[_0x798f('0x2e')][_0x798f('0x2f')]};});_0x3a4c8f[_0x798f('0x30')]=_[_0x798f('0x2a')](_0x3e1920,_0x798f('0x27'));_0x3a4c8f[_0x798f('0x31')]=_[_0x798f('0x32')](_0x47ae0f[_0x798f('0x31')]);_0x3a4c8f[_0x798f('0x33')]=_[_0x798f('0x34')](_0x3a4c8f[_0x798f('0x30')],_0x3a4c8f[_0x798f('0x31')]);_0x3f0dcf[_0x798f('0x35')]=_[_0x798f('0x34')](_0x3a4c8f[_0x798f('0x30')],qs[_0x798f('0x36')](_0x47ae0f[_0x798f('0x31')][_0x798f('0x36')]));_0x3f0dcf[_0x798f('0x35')]=_0x3f0dcf[_0x798f('0x35')]['length']?_0x3f0dcf['attributes']:_0x3a4c8f[_0x798f('0x30')];if(!_0x47ae0f[_0x798f('0x31')][_0x798f('0x37')](_0x798f('0x38'))){_0x3f0dcf['limit']=qs[_0x798f('0x1f')](_0x47ae0f[_0x798f('0x31')][_0x798f('0x1f')]);_0x3f0dcf[_0x798f('0x1e')]=qs['offset'](_0x47ae0f[_0x798f('0x31')][_0x798f('0x1e')]);}_0x3f0dcf[_0x798f('0x39')]=qs[_0x798f('0x3a')](_0x47ae0f[_0x798f('0x31')][_0x798f('0x3a')]);_0x3f0dcf['where']=qs[_0x798f('0x33')](_['pick'](_0x47ae0f[_0x798f('0x31')],_0x3a4c8f[_0x798f('0x33')]),_0x3e1920);if(_0x47ae0f[_0x798f('0x31')][_0x798f('0x3b')]){_0x3f0dcf[_0x798f('0x3c')]=_[_0x798f('0x3d')](_0x3f0dcf[_0x798f('0x3c')],{'$or':_[_0x798f('0x2a')](_0x3e1920,function(_0x523532){if(_0x523532[_0x798f('0x2e')]!=='VIRTUAL'){var _0x17e446={};_0x17e446[_0x523532['name']]={'$like':'%'+_0x47ae0f[_0x798f('0x31')][_0x798f('0x3b')]+'%'};return _0x17e446;}})});}_0x3f0dcf=_[_0x798f('0x3d')]({},_0x3f0dcf,_0x47ae0f[_0x798f('0x3e')]);var _0xe80ac6={'where':_0x3f0dcf[_0x798f('0x3c')]};return db[_0x798f('0x2b')][_0x798f('0x3f')](_0xe80ac6)['then'](function(_0x4e0352){_0x4345e5['count']=_0x4e0352;if(_0x47ae0f['query'][_0x798f('0x40')]){_0x3f0dcf['include']=[{'all':!![]}];}return db[_0x798f('0x2b')]['findAll'](_0x3f0dcf);})['then'](function(_0x30661c){_0x4345e5[_0x798f('0x41')]=_0x30661c;return _0x4345e5;})[_0x798f('0x25')](respondWithFilteredResult(_0x950206,_0x3f0dcf))[_0x798f('0x42')](handleError(_0x950206,null));};exports['show']=function(_0x364fc2,_0x2eaef9){var _0x524b15={'raw':![],'where':{'id':_0x364fc2['params']['id']}},_0x1dc85d={};_0x1dc85d['model']=_['keys'](db[_0x798f('0x2b')][_0x798f('0x2c')]);_0x1dc85d[_0x798f('0x31')]=_['keys'](_0x364fc2[_0x798f('0x31')]);_0x1dc85d[_0x798f('0x33')]=_[_0x798f('0x34')](_0x1dc85d['model'],_0x1dc85d['query']);_0x524b15[_0x798f('0x35')]=_['intersection'](_0x1dc85d['model'],qs[_0x798f('0x36')](_0x364fc2[_0x798f('0x31')][_0x798f('0x36')]));_0x524b15[_0x798f('0x35')]=_0x524b15[_0x798f('0x35')][_0x798f('0x43')]?_0x524b15['attributes']:_0x1dc85d['model'];if(_0x364fc2[_0x798f('0x31')][_0x798f('0x40')]){_0x524b15['include']=[{'all':!![]}];}_0x524b15=_[_0x798f('0x3d')]({},_0x524b15,_0x364fc2[_0x798f('0x3e')]);return db[_0x798f('0x2b')]['find'](_0x524b15)['then'](handleEntityNotFound(_0x2eaef9,null))[_0x798f('0x25')](respondWithResult(_0x2eaef9,null))[_0x798f('0x42')](handleError(_0x2eaef9,null));};exports[_0x798f('0x44')]=function(_0x36fb0c,_0x1296e6){return db[_0x798f('0x2b')][_0x798f('0x44')](_0x36fb0c['body'],{})[_0x798f('0x25')](respondWithResult(_0x1296e6,0xc9))['catch'](handleError(_0x1296e6,null));};exports[_0x798f('0x45')]=function(_0x348e9d,_0x3361ee){if(_0x348e9d[_0x798f('0x46')]['id']){delete _0x348e9d[_0x798f('0x46')]['id'];}return db[_0x798f('0x2b')][_0x798f('0x47')]({'where':{'id':_0x348e9d['params']['id']}})[_0x798f('0x25')](handleEntityNotFound(_0x3361ee,null))['then'](saveUpdates(_0x348e9d[_0x798f('0x46')],null))[_0x798f('0x25')](respondWithResult(_0x3361ee,null))[_0x798f('0x42')](handleError(_0x3361ee,null));};exports['destroy']=function(_0x18b298,_0x5e752c){return db[_0x798f('0x2b')]['find']({'where':{'id':_0x18b298[_0x798f('0x48')]['id']}})[_0x798f('0x25')](handleEntityNotFound(_0x5e752c,null))[_0x798f('0x25')](removeEntity(_0x5e752c,null))[_0x798f('0x42')](handleError(_0x5e752c,null));};exports[_0x798f('0x49')]=function(_0x4b0414,_0x51b02e,_0x104d85){var _0x133209={};var _0x31c424={};var _0x3c352f;var _0x4efd4c;return db[_0x798f('0x2b')][_0x798f('0x4a')]({'where':{'id':_0x4b0414['params']['id']}})[_0x798f('0x25')](handleEntityNotFound(_0x51b02e,null))[_0x798f('0x25')](function(_0xe53423){if(_0xe53423){_0x3c352f=_0xe53423;_0x31c424[_0x798f('0x30')]=_[_0x798f('0x32')](db[_0x798f('0x4b')][_0x798f('0x2c')]);_0x31c424[_0x798f('0x31')]=_[_0x798f('0x32')](_0x4b0414[_0x798f('0x31')]);_0x31c424[_0x798f('0x33')]=_[_0x798f('0x34')](_0x31c424[_0x798f('0x30')],_0x31c424[_0x798f('0x31')]);_0x133209[_0x798f('0x35')]=_[_0x798f('0x34')](_0x31c424[_0x798f('0x30')],qs['fields'](_0x4b0414['query'][_0x798f('0x36')]));_0x133209[_0x798f('0x35')]=_0x133209['attributes']['length']?_0x133209['attributes']:_0x31c424[_0x798f('0x30')];_0x133209['order']=qs['sort'](_0x4b0414['query'][_0x798f('0x3a')]);_0x133209[_0x798f('0x3c')]=qs[_0x798f('0x33')](_[_0x798f('0x4c')](_0x4b0414[_0x798f('0x31')],_0x31c424[_0x798f('0x33')]));if(_0x4b0414['query'][_0x798f('0x3b')]){_0x133209['where']=_[_0x798f('0x3d')](_0x133209['where'],{'$or':_[_0x798f('0x2a')](_0x133209[_0x798f('0x35')],function(_0x11921b){var _0x397ed0={};_0x397ed0[_0x11921b]={'$like':'%'+_0x4b0414[_0x798f('0x31')][_0x798f('0x3b')]+'%'};return _0x397ed0;})});}_0x133209=_['merge']({},_0x133209,_0x4b0414[_0x798f('0x3e')]);return _0x3c352f[_0x798f('0x49')](_0x133209);}})[_0x798f('0x25')](function(_0x5e49ac){if(_0x5e49ac){_0x4efd4c=_0x5e49ac[_0x798f('0x43')];if(!_0x4b0414[_0x798f('0x31')][_0x798f('0x37')](_0x798f('0x38'))){_0x133209[_0x798f('0x1f')]=qs[_0x798f('0x1f')](_0x4b0414['query']['limit']);_0x133209[_0x798f('0x1e')]=qs['offset'](_0x4b0414[_0x798f('0x31')][_0x798f('0x1e')]);}return _0x3c352f[_0x798f('0x49')](_0x133209);}})[_0x798f('0x25')](function(_0x409a5a){if(_0x409a5a){return _0x409a5a?{'count':_0x4efd4c,'rows':_0x409a5a}:null;}})[_0x798f('0x25')](respondWithResult(_0x51b02e,null))['catch'](handleError(_0x51b02e,null));};exports[_0x798f('0x4d')]=function(_0x31c81f,_0x5c806e,_0x415eaa){var _0x199095={};var _0x2f2666={};var _0x8e32d4;var _0x58679e;return db['DeskConfiguration'][_0x798f('0x4a')]({'where':{'id':_0x31c81f[_0x798f('0x48')]['id']}})[_0x798f('0x25')](handleEntityNotFound(_0x5c806e,null))[_0x798f('0x25')](function(_0x12d24c){if(_0x12d24c){_0x8e32d4=_0x12d24c;_0x2f2666['model']=_['keys'](db['DeskField']['rawAttributes']);_0x2f2666[_0x798f('0x31')]=_[_0x798f('0x32')](_0x31c81f[_0x798f('0x31')]);_0x2f2666[_0x798f('0x33')]=_[_0x798f('0x34')](_0x2f2666[_0x798f('0x30')],_0x2f2666[_0x798f('0x31')]);_0x199095['attributes']=_[_0x798f('0x34')](_0x2f2666[_0x798f('0x30')],qs['fields'](_0x31c81f[_0x798f('0x31')][_0x798f('0x36')]));_0x199095['attributes']=_0x199095[_0x798f('0x35')]['length']?_0x199095[_0x798f('0x35')]:_0x2f2666['model'];_0x199095[_0x798f('0x39')]=qs['sort'](_0x31c81f[_0x798f('0x31')][_0x798f('0x3a')]);_0x199095['where']=qs[_0x798f('0x33')](_['pick'](_0x31c81f[_0x798f('0x31')],_0x2f2666[_0x798f('0x33')]));if(_0x31c81f[_0x798f('0x31')][_0x798f('0x3b')]){_0x199095[_0x798f('0x3c')]=_['merge'](_0x199095[_0x798f('0x3c')],{'$or':_[_0x798f('0x2a')](_0x199095[_0x798f('0x35')],function(_0x51a99d){var _0x2a35c8={};_0x2a35c8[_0x51a99d]={'$like':'%'+_0x31c81f[_0x798f('0x31')][_0x798f('0x3b')]+'%'};return _0x2a35c8;})});}_0x199095=_[_0x798f('0x3d')]({},_0x199095,_0x31c81f[_0x798f('0x3e')]);return _0x8e32d4['getSubjects'](_0x199095);}})[_0x798f('0x25')](function(_0xc96dc0){if(_0xc96dc0){_0x58679e=_0xc96dc0['length'];if(!_0x31c81f[_0x798f('0x31')][_0x798f('0x37')](_0x798f('0x38'))){_0x199095[_0x798f('0x1f')]=qs[_0x798f('0x1f')](_0x31c81f[_0x798f('0x31')][_0x798f('0x1f')]);_0x199095['offset']=qs['offset'](_0x31c81f[_0x798f('0x31')][_0x798f('0x1e')]);}return _0x8e32d4[_0x798f('0x4d')](_0x199095);}})[_0x798f('0x25')](function(_0x43d21e){if(_0x43d21e){return _0x43d21e?{'count':_0x58679e,'rows':_0x43d21e}:null;}})['then'](respondWithResult(_0x5c806e,null))[_0x798f('0x42')](handleError(_0x5c806e,null));};exports['getDescriptions']=function(_0x2b01e6,_0x580311,_0x23aed4){var _0x4ba878={};var _0x2fd45b={};var _0x2ff4c3;var _0x12d59d;return db['DeskConfiguration']['findOne']({'where':{'id':_0x2b01e6[_0x798f('0x48')]['id']}})[_0x798f('0x25')](handleEntityNotFound(_0x580311,null))['then'](function(_0x460f98){if(_0x460f98){_0x2ff4c3=_0x460f98;_0x2fd45b[_0x798f('0x30')]=_[_0x798f('0x32')](db['DeskField'][_0x798f('0x2c')]);_0x2fd45b[_0x798f('0x31')]=_['keys'](_0x2b01e6[_0x798f('0x31')]);_0x2fd45b[_0x798f('0x33')]=_[_0x798f('0x34')](_0x2fd45b[_0x798f('0x30')],_0x2fd45b[_0x798f('0x31')]);_0x4ba878['attributes']=_[_0x798f('0x34')](_0x2fd45b[_0x798f('0x30')],qs[_0x798f('0x36')](_0x2b01e6[_0x798f('0x31')]['fields']));_0x4ba878[_0x798f('0x35')]=_0x4ba878['attributes'][_0x798f('0x43')]?_0x4ba878['attributes']:_0x2fd45b[_0x798f('0x30')];_0x4ba878[_0x798f('0x39')]=qs['sort'](_0x2b01e6[_0x798f('0x31')]['sort']);_0x4ba878[_0x798f('0x3c')]=qs[_0x798f('0x33')](_['pick'](_0x2b01e6[_0x798f('0x31')],_0x2fd45b[_0x798f('0x33')]));if(_0x2b01e6[_0x798f('0x31')][_0x798f('0x3b')]){_0x4ba878['where']=_[_0x798f('0x3d')](_0x4ba878[_0x798f('0x3c')],{'$or':_[_0x798f('0x2a')](_0x4ba878[_0x798f('0x35')],function(_0x5240c9){var _0x288765={};_0x288765[_0x5240c9]={'$like':'%'+_0x2b01e6[_0x798f('0x31')][_0x798f('0x3b')]+'%'};return _0x288765;})});}_0x4ba878=_['merge']({},_0x4ba878,_0x2b01e6[_0x798f('0x3e')]);return _0x2ff4c3['getDescriptions'](_0x4ba878);}})[_0x798f('0x25')](function(_0xd9650c){if(_0xd9650c){_0x12d59d=_0xd9650c[_0x798f('0x43')];if(!_0x2b01e6[_0x798f('0x31')][_0x798f('0x37')](_0x798f('0x38'))){_0x4ba878[_0x798f('0x1f')]=qs[_0x798f('0x1f')](_0x2b01e6['query']['limit']);_0x4ba878[_0x798f('0x1e')]=qs[_0x798f('0x1e')](_0x2b01e6[_0x798f('0x31')][_0x798f('0x1e')]);}return _0x2ff4c3[_0x798f('0x4e')](_0x4ba878);}})[_0x798f('0x25')](function(_0x4a024b){if(_0x4a024b){return _0x4a024b?{'count':_0x12d59d,'rows':_0x4a024b}:null;}})[_0x798f('0x25')](respondWithResult(_0x580311,null))[_0x798f('0x42')](handleError(_0x580311,null));};exports[_0x798f('0x4f')]=function(_0x76753f,_0x48121a,_0x12aba5){var _0x1e78aa={};var _0x1098d3={};var _0x5c6e36;var _0x2d9be6;return db[_0x798f('0x2b')]['findOne']({'where':{'id':_0x76753f[_0x798f('0x48')]['id']}})[_0x798f('0x25')](handleEntityNotFound(_0x48121a,null))[_0x798f('0x25')](function(_0x21e8ff){if(_0x21e8ff){_0x5c6e36=_0x21e8ff;_0x1098d3[_0x798f('0x30')]=_['keys'](db[_0x798f('0x50')][_0x798f('0x2c')]);_0x1098d3['query']=_[_0x798f('0x32')](_0x76753f[_0x798f('0x31')]);_0x1098d3[_0x798f('0x33')]=_[_0x798f('0x34')](_0x1098d3[_0x798f('0x30')],_0x1098d3[_0x798f('0x31')]);_0x1e78aa['attributes']=_[_0x798f('0x34')](_0x1098d3[_0x798f('0x30')],qs['fields'](_0x76753f[_0x798f('0x31')][_0x798f('0x36')]));_0x1e78aa[_0x798f('0x35')]=_0x1e78aa[_0x798f('0x35')][_0x798f('0x43')]?_0x1e78aa[_0x798f('0x35')]:_0x1098d3[_0x798f('0x30')];_0x1e78aa[_0x798f('0x39')]=qs[_0x798f('0x3a')](_0x76753f[_0x798f('0x31')][_0x798f('0x3a')]);_0x1e78aa[_0x798f('0x3c')]=qs[_0x798f('0x33')](_[_0x798f('0x4c')](_0x76753f[_0x798f('0x31')],_0x1098d3[_0x798f('0x33')]));if(_0x76753f[_0x798f('0x31')][_0x798f('0x3b')]){_0x1e78aa[_0x798f('0x3c')]=_[_0x798f('0x3d')](_0x1e78aa['where'],{'$or':_[_0x798f('0x2a')](_0x1e78aa['attributes'],function(_0x1ffe03){var _0x22f9f5={};_0x22f9f5[_0x1ffe03]={'$like':'%'+_0x76753f[_0x798f('0x31')][_0x798f('0x3b')]+'%'};return _0x22f9f5;})});}_0x1e78aa=_[_0x798f('0x3d')]({},_0x1e78aa,_0x76753f[_0x798f('0x3e')]);return _0x5c6e36[_0x798f('0x4f')](_0x1e78aa);}})['then'](function(_0x104d5a){if(_0x104d5a){_0x2d9be6=_0x104d5a['length'];if(!_0x76753f[_0x798f('0x31')][_0x798f('0x37')](_0x798f('0x38'))){_0x1e78aa[_0x798f('0x1f')]=qs[_0x798f('0x1f')](_0x76753f[_0x798f('0x31')][_0x798f('0x1f')]);_0x1e78aa[_0x798f('0x1e')]=qs['offset'](_0x76753f[_0x798f('0x31')][_0x798f('0x1e')]);}return _0x5c6e36['getTags'](_0x1e78aa);}})[_0x798f('0x25')](function(_0x116cb6){if(_0x116cb6){return _0x116cb6?{'count':_0x2d9be6,'rows':_0x116cb6}:null;}})['then'](respondWithResult(_0x48121a,null))[_0x798f('0x42')](handleError(_0x48121a,null));};exports['setTags']=function(_0x10f7bc,_0xe6b672,_0x1a5f00){if(_0x10f7bc[_0x798f('0x46')]['id']){delete _0x10f7bc[_0x798f('0x46')]['id'];}return db[_0x798f('0x2b')][_0x798f('0x4a')]({'where':{'id':_0x10f7bc[_0x798f('0x48')]['id']}})[_0x798f('0x25')](handleEntityNotFound(_0xe6b672,null))[_0x798f('0x25')](function(_0x1bd4a6){if(_0x1bd4a6){return _0x1bd4a6[_0x798f('0x51')](_0x10f7bc[_0x798f('0x46')][_0x798f('0x52')]||[]);}return null;})['then'](respondWithResult(_0xe6b672,null))['catch'](handleError(_0xe6b672,null));};
\ No newline at end of file
+var _0xa8c1=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','DeskConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','getFields','findOne','DeskField','pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2a937b,_0x52a43f){var _0x1767f1=function(_0xaaced4){while(--_0xaaced4){_0x2a937b['push'](_0x2a937b['shift']());}};_0x1767f1(++_0x52a43f);}(_0xa8c1,0x19d));var _0x1a8c=function(_0x216428,_0x5d20ea){_0x216428=_0x216428-0x0;var _0x313dd4=_0xa8c1[_0x216428];return _0x313dd4;};'use strict';var emlformat=require(_0x1a8c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1a8c('0x1'));var moment=require(_0x1a8c('0x2'));var BPromise=require(_0x1a8c('0x3'));var Mustache=require('mustache');var util=require(_0x1a8c('0x4'));var path=require(_0x1a8c('0x5'));var sox=require(_0x1a8c('0x6'));var csv=require(_0x1a8c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a8c('0x8'));var _=require(_0x1a8c('0x9'));var squel=require('squel');var crypto=require(_0x1a8c('0xa'));var jsforce=require(_0x1a8c('0xb'));var deskjs=require(_0x1a8c('0xc'));var toCsv=require(_0x1a8c('0x7'));var querystring=require(_0x1a8c('0xd'));var Papa=require(_0x1a8c('0xe'));var Redis=require(_0x1a8c('0xf'));var authService=require(_0x1a8c('0x10'));var qs=require(_0x1a8c('0x11'));var as=require(_0x1a8c('0x12'));var hardwareService=require(_0x1a8c('0x13'));var logger=require(_0x1a8c('0x14'))(_0x1a8c('0x15'));var utils=require('../../config/utils');var config=require(_0x1a8c('0x16'));var licenseUtil=require(_0x1a8c('0x17'));var db=require(_0x1a8c('0x18'))['db'];function respondWithStatusCode(_0x21123a,_0x1f3d94){_0x1f3d94=_0x1f3d94||0xcc;return function(_0x3c68d4){if(_0x3c68d4){return _0x21123a['sendStatus'](_0x1f3d94);}return _0x21123a[_0x1a8c('0x19')](_0x1f3d94)[_0x1a8c('0x1a')]();};}function respondWithResult(_0x498407,_0x4a1e1e){_0x4a1e1e=_0x4a1e1e||0xc8;return function(_0x52c5ae){if(_0x52c5ae){return _0x498407[_0x1a8c('0x19')](_0x4a1e1e)['json'](_0x52c5ae);}};}function respondWithFilteredResult(_0x159643,_0x180e8d){return function(_0x30f27a){if(_0x30f27a){var _0x1611c9=typeof _0x180e8d[_0x1a8c('0x1b')]===_0x1a8c('0x1c')&&typeof _0x180e8d[_0x1a8c('0x1d')]===_0x1a8c('0x1c');var _0x5a4ba7=_0x30f27a['count'];var _0xc809d4=_0x1611c9?0x0:_0x180e8d['offset'];var _0xb1d160=_0x1611c9?_0x30f27a[_0x1a8c('0x1e')]:_0x180e8d['offset']+_0x180e8d[_0x1a8c('0x1d')];var _0x3597b8;if(_0xb1d160>=_0x5a4ba7){_0xb1d160=_0x5a4ba7;_0x3597b8=0xc8;}else{_0x3597b8=0xce;}_0x159643[_0x1a8c('0x19')](_0x3597b8);return _0x159643[_0x1a8c('0x1f')](_0x1a8c('0x20'),_0xc809d4+'-'+_0xb1d160+'/'+_0x5a4ba7)['json'](_0x30f27a);}return null;};}function patchUpdates(_0x320d18){return function(_0x4605e9){try{jsonpatch[_0x1a8c('0x21')](_0x4605e9,_0x320d18,!![]);}catch(_0x527cfe){return BPromise[_0x1a8c('0x22')](_0x527cfe);}return _0x4605e9[_0x1a8c('0x23')]();};}function saveUpdates(_0x138a60,_0x5738a7){return function(_0x51c134){if(_0x51c134){return _0x51c134[_0x1a8c('0x24')](_0x138a60)[_0x1a8c('0x25')](function(_0x4f7f15){return _0x4f7f15;});}return null;};}function removeEntity(_0x32118c,_0x38b9d9){return function(_0xc82567){if(_0xc82567){return _0xc82567[_0x1a8c('0x26')]()[_0x1a8c('0x25')](function(){_0x32118c[_0x1a8c('0x19')](0xcc)[_0x1a8c('0x1a')]();});}};}function handleEntityNotFound(_0x22390f,_0x159d9b){return function(_0xc55348){if(!_0xc55348){_0x22390f[_0x1a8c('0x27')](0x194);}return _0xc55348;};}function handleError(_0x242cf0,_0x463096){_0x463096=_0x463096||0x1f4;return function(_0x121f1a){logger['error'](_0x121f1a[_0x1a8c('0x28')]);if(_0x121f1a[_0x1a8c('0x29')]){delete _0x121f1a[_0x1a8c('0x29')];}_0x242cf0[_0x1a8c('0x19')](_0x463096)[_0x1a8c('0x2a')](_0x121f1a);};}exports['index']=function(_0x4d4980,_0x45cffd){var _0x41be2d={},_0xbbd088={},_0x3c29d3={'count':0x0,'rows':[]};var _0x2b8bc6=_[_0x1a8c('0x2b')](db[_0x1a8c('0x2c')]['rawAttributes'],function(_0x417af9){return{'name':_0x417af9[_0x1a8c('0x2d')],'type':_0x417af9[_0x1a8c('0x2e')][_0x1a8c('0x2f')]};});_0xbbd088[_0x1a8c('0x30')]=_[_0x1a8c('0x2b')](_0x2b8bc6,'name');_0xbbd088[_0x1a8c('0x31')]=_[_0x1a8c('0x32')](_0x4d4980[_0x1a8c('0x31')]);_0xbbd088[_0x1a8c('0x33')]=_[_0x1a8c('0x34')](_0xbbd088[_0x1a8c('0x30')],_0xbbd088[_0x1a8c('0x31')]);_0x41be2d[_0x1a8c('0x35')]=_[_0x1a8c('0x34')](_0xbbd088[_0x1a8c('0x30')],qs['fields'](_0x4d4980[_0x1a8c('0x31')][_0x1a8c('0x36')]));_0x41be2d[_0x1a8c('0x35')]=_0x41be2d[_0x1a8c('0x35')][_0x1a8c('0x37')]?_0x41be2d['attributes']:_0xbbd088[_0x1a8c('0x30')];if(!_0x4d4980[_0x1a8c('0x31')][_0x1a8c('0x38')](_0x1a8c('0x39'))){_0x41be2d['limit']=qs[_0x1a8c('0x1d')](_0x4d4980[_0x1a8c('0x31')][_0x1a8c('0x1d')]);_0x41be2d[_0x1a8c('0x1b')]=qs[_0x1a8c('0x1b')](_0x4d4980['query'][_0x1a8c('0x1b')]);}_0x41be2d[_0x1a8c('0x3a')]=qs[_0x1a8c('0x3b')](_0x4d4980[_0x1a8c('0x31')][_0x1a8c('0x3b')]);_0x41be2d['where']=qs[_0x1a8c('0x33')](_['pick'](_0x4d4980[_0x1a8c('0x31')],_0xbbd088[_0x1a8c('0x33')]),_0x2b8bc6);if(_0x4d4980[_0x1a8c('0x31')][_0x1a8c('0x3c')]){_0x41be2d[_0x1a8c('0x3d')]=_[_0x1a8c('0x3e')](_0x41be2d[_0x1a8c('0x3d')],{'$or':_[_0x1a8c('0x2b')](_0x2b8bc6,function(_0x256a5b){if(_0x256a5b[_0x1a8c('0x2e')]!==_0x1a8c('0x3f')){var _0x47d8f8={};_0x47d8f8[_0x256a5b[_0x1a8c('0x29')]]={'$like':'%'+_0x4d4980[_0x1a8c('0x31')][_0x1a8c('0x3c')]+'%'};return _0x47d8f8;}})});}_0x41be2d=_['merge']({},_0x41be2d,_0x4d4980[_0x1a8c('0x40')]);var _0x5ccc38={'where':_0x41be2d['where']};return db[_0x1a8c('0x2c')][_0x1a8c('0x1e')](_0x5ccc38)[_0x1a8c('0x25')](function(_0x22eeca){_0x3c29d3[_0x1a8c('0x1e')]=_0x22eeca;if(_0x4d4980['query'][_0x1a8c('0x41')]){_0x41be2d[_0x1a8c('0x42')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x1a8c('0x43')](_0x41be2d);})[_0x1a8c('0x25')](function(_0x237c78){_0x3c29d3[_0x1a8c('0x44')]=_0x237c78;return _0x3c29d3;})[_0x1a8c('0x25')](respondWithFilteredResult(_0x45cffd,_0x41be2d))[_0x1a8c('0x45')](handleError(_0x45cffd,null));};exports[_0x1a8c('0x46')]=function(_0x22cdc8,_0x25c39b){var _0x77e1ab={'raw':![],'where':{'id':_0x22cdc8[_0x1a8c('0x47')]['id']}},_0x4da75c={};_0x4da75c[_0x1a8c('0x30')]=_[_0x1a8c('0x32')](db[_0x1a8c('0x2c')][_0x1a8c('0x48')]);_0x4da75c['query']=_[_0x1a8c('0x32')](_0x22cdc8[_0x1a8c('0x31')]);_0x4da75c['filters']=_[_0x1a8c('0x34')](_0x4da75c[_0x1a8c('0x30')],_0x4da75c[_0x1a8c('0x31')]);_0x77e1ab['attributes']=_['intersection'](_0x4da75c[_0x1a8c('0x30')],qs['fields'](_0x22cdc8[_0x1a8c('0x31')][_0x1a8c('0x36')]));_0x77e1ab[_0x1a8c('0x35')]=_0x77e1ab[_0x1a8c('0x35')][_0x1a8c('0x37')]?_0x77e1ab[_0x1a8c('0x35')]:_0x4da75c[_0x1a8c('0x30')];if(_0x22cdc8[_0x1a8c('0x31')]['includeAll']){_0x77e1ab[_0x1a8c('0x42')]=[{'all':!![]}];}_0x77e1ab=_['merge']({},_0x77e1ab,_0x22cdc8[_0x1a8c('0x40')]);return db[_0x1a8c('0x2c')][_0x1a8c('0x49')](_0x77e1ab)[_0x1a8c('0x25')](handleEntityNotFound(_0x25c39b,null))[_0x1a8c('0x25')](respondWithResult(_0x25c39b,null))['catch'](handleError(_0x25c39b,null));};exports[_0x1a8c('0x4a')]=function(_0x4831d4,_0x5fb7f2){return db[_0x1a8c('0x2c')][_0x1a8c('0x4a')](_0x4831d4[_0x1a8c('0x4b')],{})[_0x1a8c('0x25')](respondWithResult(_0x5fb7f2,0xc9))['catch'](handleError(_0x5fb7f2,null));};exports[_0x1a8c('0x24')]=function(_0x5ef6a7,_0x584378){if(_0x5ef6a7[_0x1a8c('0x4b')]['id']){delete _0x5ef6a7[_0x1a8c('0x4b')]['id'];}return db['DeskConfiguration'][_0x1a8c('0x49')]({'where':{'id':_0x5ef6a7['params']['id']}})['then'](handleEntityNotFound(_0x584378,null))[_0x1a8c('0x25')](saveUpdates(_0x5ef6a7[_0x1a8c('0x4b')],null))['then'](respondWithResult(_0x584378,null))[_0x1a8c('0x45')](handleError(_0x584378,null));};exports['destroy']=function(_0x3a95ad,_0x19fd15){return db[_0x1a8c('0x2c')]['find']({'where':{'id':_0x3a95ad[_0x1a8c('0x47')]['id']}})[_0x1a8c('0x25')](handleEntityNotFound(_0x19fd15,null))[_0x1a8c('0x25')](removeEntity(_0x19fd15,null))[_0x1a8c('0x45')](handleError(_0x19fd15,null));};exports[_0x1a8c('0x4c')]=function(_0x1df226,_0x2864ca,_0x46d43a){var _0x447b7c={};var _0x5e99b3={};var _0xacd96d;var _0x7957ec;return db[_0x1a8c('0x2c')][_0x1a8c('0x4d')]({'where':{'id':_0x1df226['params']['id']}})[_0x1a8c('0x25')](handleEntityNotFound(_0x2864ca,null))[_0x1a8c('0x25')](function(_0x1e2759){if(_0x1e2759){_0xacd96d=_0x1e2759;_0x5e99b3['model']=_[_0x1a8c('0x32')](db[_0x1a8c('0x4e')][_0x1a8c('0x48')]);_0x5e99b3['query']=_[_0x1a8c('0x32')](_0x1df226[_0x1a8c('0x31')]);_0x5e99b3[_0x1a8c('0x33')]=_['intersection'](_0x5e99b3[_0x1a8c('0x30')],_0x5e99b3[_0x1a8c('0x31')]);_0x447b7c[_0x1a8c('0x35')]=_[_0x1a8c('0x34')](_0x5e99b3[_0x1a8c('0x30')],qs['fields'](_0x1df226[_0x1a8c('0x31')][_0x1a8c('0x36')]));_0x447b7c[_0x1a8c('0x35')]=_0x447b7c[_0x1a8c('0x35')]['length']?_0x447b7c['attributes']:_0x5e99b3[_0x1a8c('0x30')];_0x447b7c[_0x1a8c('0x3a')]=qs[_0x1a8c('0x3b')](_0x1df226[_0x1a8c('0x31')]['sort']);_0x447b7c[_0x1a8c('0x3d')]=qs[_0x1a8c('0x33')](_[_0x1a8c('0x4f')](_0x1df226['query'],_0x5e99b3[_0x1a8c('0x33')]));if(_0x1df226[_0x1a8c('0x31')]['filter']){_0x447b7c['where']=_[_0x1a8c('0x3e')](_0x447b7c[_0x1a8c('0x3d')],{'$or':_[_0x1a8c('0x2b')](_0x447b7c[_0x1a8c('0x35')],function(_0x19cbdc){var _0x3b15d3={};_0x3b15d3[_0x19cbdc]={'$like':'%'+_0x1df226['query'][_0x1a8c('0x3c')]+'%'};return _0x3b15d3;})});}_0x447b7c=_[_0x1a8c('0x3e')]({},_0x447b7c,_0x1df226[_0x1a8c('0x40')]);return _0xacd96d['getFields'](_0x447b7c);}})[_0x1a8c('0x25')](function(_0x1d257b){if(_0x1d257b){_0x7957ec=_0x1d257b[_0x1a8c('0x37')];if(!_0x1df226['query']['hasOwnProperty'](_0x1a8c('0x39'))){_0x447b7c[_0x1a8c('0x1d')]=qs['limit'](_0x1df226['query'][_0x1a8c('0x1d')]);_0x447b7c['offset']=qs[_0x1a8c('0x1b')](_0x1df226[_0x1a8c('0x31')]['offset']);}return _0xacd96d['getFields'](_0x447b7c);}})['then'](function(_0x4d0fa0){if(_0x4d0fa0){return _0x4d0fa0?{'count':_0x7957ec,'rows':_0x4d0fa0}:null;}})[_0x1a8c('0x25')](respondWithResult(_0x2864ca,null))[_0x1a8c('0x45')](handleError(_0x2864ca,null));};exports[_0x1a8c('0x50')]=function(_0x2139f1,_0xc84436,_0x1a079c){var _0x3508d2={};var _0x3d0993={};var _0x337c4f;var _0x5511b0;return db['DeskConfiguration'][_0x1a8c('0x4d')]({'where':{'id':_0x2139f1[_0x1a8c('0x47')]['id']}})['then'](handleEntityNotFound(_0xc84436,null))[_0x1a8c('0x25')](function(_0xc3df8f){if(_0xc3df8f){_0x337c4f=_0xc3df8f;_0x3d0993[_0x1a8c('0x30')]=_[_0x1a8c('0x32')](db[_0x1a8c('0x4e')][_0x1a8c('0x48')]);_0x3d0993[_0x1a8c('0x31')]=_[_0x1a8c('0x32')](_0x2139f1[_0x1a8c('0x31')]);_0x3d0993['filters']=_[_0x1a8c('0x34')](_0x3d0993[_0x1a8c('0x30')],_0x3d0993[_0x1a8c('0x31')]);_0x3508d2['attributes']=_[_0x1a8c('0x34')](_0x3d0993[_0x1a8c('0x30')],qs[_0x1a8c('0x36')](_0x2139f1[_0x1a8c('0x31')][_0x1a8c('0x36')]));_0x3508d2[_0x1a8c('0x35')]=_0x3508d2[_0x1a8c('0x35')][_0x1a8c('0x37')]?_0x3508d2[_0x1a8c('0x35')]:_0x3d0993['model'];_0x3508d2[_0x1a8c('0x3a')]=qs[_0x1a8c('0x3b')](_0x2139f1[_0x1a8c('0x31')]['sort']);_0x3508d2[_0x1a8c('0x3d')]=qs['filters'](_['pick'](_0x2139f1[_0x1a8c('0x31')],_0x3d0993[_0x1a8c('0x33')]));if(_0x2139f1[_0x1a8c('0x31')][_0x1a8c('0x3c')]){_0x3508d2[_0x1a8c('0x3d')]=_['merge'](_0x3508d2['where'],{'$or':_[_0x1a8c('0x2b')](_0x3508d2[_0x1a8c('0x35')],function(_0x45ca3d){var _0x4ef8e4={};_0x4ef8e4[_0x45ca3d]={'$like':'%'+_0x2139f1[_0x1a8c('0x31')]['filter']+'%'};return _0x4ef8e4;})});}_0x3508d2=_[_0x1a8c('0x3e')]({},_0x3508d2,_0x2139f1[_0x1a8c('0x40')]);return _0x337c4f['getSubjects'](_0x3508d2);}})[_0x1a8c('0x25')](function(_0x500959){if(_0x500959){_0x5511b0=_0x500959[_0x1a8c('0x37')];if(!_0x2139f1[_0x1a8c('0x31')]['hasOwnProperty'](_0x1a8c('0x39'))){_0x3508d2['limit']=qs['limit'](_0x2139f1['query'][_0x1a8c('0x1d')]);_0x3508d2[_0x1a8c('0x1b')]=qs['offset'](_0x2139f1['query']['offset']);}return _0x337c4f['getSubjects'](_0x3508d2);}})[_0x1a8c('0x25')](function(_0x9b2bdc){if(_0x9b2bdc){return _0x9b2bdc?{'count':_0x5511b0,'rows':_0x9b2bdc}:null;}})[_0x1a8c('0x25')](respondWithResult(_0xc84436,null))['catch'](handleError(_0xc84436,null));};exports[_0x1a8c('0x51')]=function(_0x302442,_0x8f9e06,_0x2b1b7a){var _0x26948a={};var _0x64f7c1={};var _0x39ad47;var _0x120045;return db[_0x1a8c('0x2c')][_0x1a8c('0x4d')]({'where':{'id':_0x302442[_0x1a8c('0x47')]['id']}})[_0x1a8c('0x25')](handleEntityNotFound(_0x8f9e06,null))[_0x1a8c('0x25')](function(_0x20fce0){if(_0x20fce0){_0x39ad47=_0x20fce0;_0x64f7c1['model']=_[_0x1a8c('0x32')](db[_0x1a8c('0x4e')][_0x1a8c('0x48')]);_0x64f7c1[_0x1a8c('0x31')]=_[_0x1a8c('0x32')](_0x302442[_0x1a8c('0x31')]);_0x64f7c1[_0x1a8c('0x33')]=_[_0x1a8c('0x34')](_0x64f7c1[_0x1a8c('0x30')],_0x64f7c1[_0x1a8c('0x31')]);_0x26948a[_0x1a8c('0x35')]=_[_0x1a8c('0x34')](_0x64f7c1[_0x1a8c('0x30')],qs[_0x1a8c('0x36')](_0x302442['query'][_0x1a8c('0x36')]));_0x26948a[_0x1a8c('0x35')]=_0x26948a[_0x1a8c('0x35')][_0x1a8c('0x37')]?_0x26948a[_0x1a8c('0x35')]:_0x64f7c1['model'];_0x26948a[_0x1a8c('0x3a')]=qs[_0x1a8c('0x3b')](_0x302442[_0x1a8c('0x31')]['sort']);_0x26948a[_0x1a8c('0x3d')]=qs['filters'](_[_0x1a8c('0x4f')](_0x302442[_0x1a8c('0x31')],_0x64f7c1['filters']));if(_0x302442[_0x1a8c('0x31')]['filter']){_0x26948a['where']=_['merge'](_0x26948a[_0x1a8c('0x3d')],{'$or':_[_0x1a8c('0x2b')](_0x26948a[_0x1a8c('0x35')],function(_0x1caa0d){var _0x5031e7={};_0x5031e7[_0x1caa0d]={'$like':'%'+_0x302442['query'][_0x1a8c('0x3c')]+'%'};return _0x5031e7;})});}_0x26948a=_[_0x1a8c('0x3e')]({},_0x26948a,_0x302442['options']);return _0x39ad47[_0x1a8c('0x51')](_0x26948a);}})['then'](function(_0x130dda){if(_0x130dda){_0x120045=_0x130dda[_0x1a8c('0x37')];if(!_0x302442['query'][_0x1a8c('0x38')](_0x1a8c('0x39'))){_0x26948a[_0x1a8c('0x1d')]=qs[_0x1a8c('0x1d')](_0x302442['query'][_0x1a8c('0x1d')]);_0x26948a[_0x1a8c('0x1b')]=qs[_0x1a8c('0x1b')](_0x302442[_0x1a8c('0x31')][_0x1a8c('0x1b')]);}return _0x39ad47[_0x1a8c('0x51')](_0x26948a);}})[_0x1a8c('0x25')](function(_0x8ad1a3){if(_0x8ad1a3){return _0x8ad1a3?{'count':_0x120045,'rows':_0x8ad1a3}:null;}})[_0x1a8c('0x25')](respondWithResult(_0x8f9e06,null))['catch'](handleError(_0x8f9e06,null));};exports[_0x1a8c('0x52')]=function(_0x55d851,_0x239465,_0x450cb8){var _0x5d42e6={};var _0x35c7b3={};var _0x2f908e;var _0x21f9dd;return db['DeskConfiguration']['findOne']({'where':{'id':_0x55d851['params']['id']}})[_0x1a8c('0x25')](handleEntityNotFound(_0x239465,null))[_0x1a8c('0x25')](function(_0x1d10e0){if(_0x1d10e0){_0x2f908e=_0x1d10e0;_0x35c7b3[_0x1a8c('0x30')]=_[_0x1a8c('0x32')](db[_0x1a8c('0x53')]['rawAttributes']);_0x35c7b3[_0x1a8c('0x31')]=_['keys'](_0x55d851[_0x1a8c('0x31')]);_0x35c7b3[_0x1a8c('0x33')]=_[_0x1a8c('0x34')](_0x35c7b3[_0x1a8c('0x30')],_0x35c7b3[_0x1a8c('0x31')]);_0x5d42e6['attributes']=_[_0x1a8c('0x34')](_0x35c7b3[_0x1a8c('0x30')],qs[_0x1a8c('0x36')](_0x55d851[_0x1a8c('0x31')][_0x1a8c('0x36')]));_0x5d42e6[_0x1a8c('0x35')]=_0x5d42e6['attributes'][_0x1a8c('0x37')]?_0x5d42e6[_0x1a8c('0x35')]:_0x35c7b3[_0x1a8c('0x30')];_0x5d42e6['order']=qs[_0x1a8c('0x3b')](_0x55d851[_0x1a8c('0x31')][_0x1a8c('0x3b')]);_0x5d42e6[_0x1a8c('0x3d')]=qs[_0x1a8c('0x33')](_[_0x1a8c('0x4f')](_0x55d851[_0x1a8c('0x31')],_0x35c7b3[_0x1a8c('0x33')]));if(_0x55d851['query'][_0x1a8c('0x3c')]){_0x5d42e6['where']=_[_0x1a8c('0x3e')](_0x5d42e6[_0x1a8c('0x3d')],{'$or':_['map'](_0x5d42e6[_0x1a8c('0x35')],function(_0x1dd546){var _0xfceb50={};_0xfceb50[_0x1dd546]={'$like':'%'+_0x55d851[_0x1a8c('0x31')]['filter']+'%'};return _0xfceb50;})});}_0x5d42e6=_[_0x1a8c('0x3e')]({},_0x5d42e6,_0x55d851['options']);return _0x2f908e[_0x1a8c('0x52')](_0x5d42e6);}})[_0x1a8c('0x25')](function(_0x2ef5ff){if(_0x2ef5ff){_0x21f9dd=_0x2ef5ff['length'];if(!_0x55d851[_0x1a8c('0x31')][_0x1a8c('0x38')]('nolimit')){_0x5d42e6[_0x1a8c('0x1d')]=qs['limit'](_0x55d851[_0x1a8c('0x31')][_0x1a8c('0x1d')]);_0x5d42e6[_0x1a8c('0x1b')]=qs[_0x1a8c('0x1b')](_0x55d851['query'][_0x1a8c('0x1b')]);}return _0x2f908e[_0x1a8c('0x52')](_0x5d42e6);}})[_0x1a8c('0x25')](function(_0x2ad711){if(_0x2ad711){return _0x2ad711?{'count':_0x21f9dd,'rows':_0x2ad711}:null;}})[_0x1a8c('0x25')](respondWithResult(_0x239465,null))[_0x1a8c('0x45')](handleError(_0x239465,null));};exports[_0x1a8c('0x54')]=function(_0x4d072e,_0x4dcee7,_0x52bccb){if(_0x4d072e[_0x1a8c('0x4b')]['id']){delete _0x4d072e[_0x1a8c('0x4b')]['id'];}return db[_0x1a8c('0x2c')][_0x1a8c('0x4d')]({'where':{'id':_0x4d072e[_0x1a8c('0x47')]['id']}})[_0x1a8c('0x25')](handleEntityNotFound(_0x4dcee7,null))['then'](function(_0x5e6949){if(_0x5e6949){return _0x5e6949[_0x1a8c('0x54')](_0x4d072e['body'][_0x1a8c('0x55')]||[]);}return null;})[_0x1a8c('0x25')](respondWithResult(_0x4dcee7,null))[_0x1a8c('0x45')](handleError(_0x4dcee7,null));};
\ No newline at end of file
index 0190fe7..ee3c953 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36a7=['request-promise','path','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','moment'];(function(_0x258e49,_0x198787){var _0x1a7d37=function(_0x2c9b95){while(--_0x2c9b95){_0x258e49['push'](_0x258e49['shift']());}};_0x1a7d37(++_0x198787);}(_0x36a7,0x1c0));var _0x736a=function(_0x7909eb,_0x26746e){_0x7909eb=_0x7909eb-0x0;var _0x221b75=_0x36a7[_0x7909eb];return _0x221b75;};'use strict';var _=require(_0x736a('0x0'));var util=require(_0x736a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x736a('0x2'));var BPromise=require('bluebird');var rp=require(_0x736a('0x3'));var fs=require('fs');var path=require(_0x736a('0x4'));var rimraf=require('rimraf');var config=require(_0x736a('0x5'));var attributes=require(_0x736a('0x6'));module[_0x736a('0x7')]=function(_0x573475,_0x4825d3){return _0x573475[_0x736a('0x8')](_0x736a('0x9'),attributes,{'tableName':_0x736a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4021=['DeskConfiguration','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define'];(function(_0x4ec9e3,_0x15fbf4){var _0x2883ce=function(_0x3e9998){while(--_0x3e9998){_0x4ec9e3['push'](_0x4ec9e3['shift']());}};_0x2883ce(++_0x15fbf4);}(_0x4021,0x79));var _0x1402=function(_0x442f02,_0x47d845){_0x442f02=_0x442f02-0x0;var _0xab6ef1=_0x4021[_0x442f02];return _0xab6ef1;};'use strict';var _=require(_0x1402('0x0'));var util=require(_0x1402('0x1'));var logger=require('../../config/logger')(_0x1402('0x2'));var moment=require(_0x1402('0x3'));var BPromise=require(_0x1402('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1402('0x5'));var rimraf=require(_0x1402('0x6'));var config=require(_0x1402('0x7'));var attributes=require(_0x1402('0x8'));module[_0x1402('0x9')]=function(_0xfd4a7d,_0x145113){return _0xfd4a7d[_0x1402('0xa')](_0x1402('0xb'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c56459a..8d81685 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a25=['../../config/utils','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error','code','message','DeskConfiguration,\x20%s,\x20%s','info','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x46031c,_0x3cf8fe){var _0x1c26e1=function(_0xf24179){while(--_0xf24179){_0x46031c['push'](_0x46031c['shift']());}};_0x1c26e1(++_0x3cf8fe);}(_0x8a25,0xb7));var _0x58a2=function(_0xf2ecfd,_0x2c823f){_0xf2ecfd=_0xf2ecfd-0x0;var _0x10f449=_0x8a25[_0xf2ecfd];return _0x10f449;};'use strict';var _=require(_0x58a2('0x0'));var util=require(_0x58a2('0x1'));var moment=require(_0x58a2('0x2'));var BPromise=require(_0x58a2('0x3'));var rs=require(_0x58a2('0x4'));var fs=require('fs');var Redis=require(_0x58a2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x58a2('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x58a2('0x7'));var jayson=require(_0x58a2('0x8'));var client=jayson[_0x58a2('0x9')][_0x58a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1fe895,_0x2b6bf0,_0x38712c){return new BPromise(function(_0x4ecc5b,_0x31c4c0){return client[_0x58a2('0xb')](_0x1fe895,_0x38712c)[_0x58a2('0xc')](function(_0x2c17d9){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x2b6bf0,_0x58a2('0xd'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2b6bf0,_0x58a2('0xd'),JSON[_0x58a2('0xe')](_0x2c17d9));if(_0x2c17d9[_0x58a2('0xf')]){if(_0x2c17d9[_0x58a2('0xf')][_0x58a2('0x10')]===0x1f4){logger[_0x58a2('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x2b6bf0,_0x2c17d9['error'][_0x58a2('0x11')]);return _0x31c4c0(_0x2c17d9[_0x58a2('0xf')][_0x58a2('0x11')]);}logger[_0x58a2('0xf')](_0x58a2('0x12'),_0x2b6bf0,_0x2c17d9[_0x58a2('0xf')][_0x58a2('0x11')]);return _0x4ecc5b(_0x2c17d9[_0x58a2('0xf')][_0x58a2('0x11')]);}else{logger[_0x58a2('0x13')](_0x58a2('0x12'),_0x2b6bf0,_0x58a2('0xd'));_0x4ecc5b(_0x2c17d9['result']['message']);}})[_0x58a2('0x14')](function(_0x5a138e){logger[_0x58a2('0xf')](_0x58a2('0x12'),_0x2b6bf0,_0x5a138e);_0x31c4c0(_0x5a138e);});});}
\ No newline at end of file
+var _0x8237=['../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis'];(function(_0x2273af,_0x4972c4){var _0x5dddc0=function(_0x500619){while(--_0x500619){_0x2273af['push'](_0x2273af['shift']());}};_0x5dddc0(++_0x4972c4);}(_0x8237,0x96));var _0x7823=function(_0xfa4ac8,_0x497455){_0xfa4ac8=_0xfa4ac8-0x0;var _0x32be45=_0x8237[_0xfa4ac8];return _0x32be45;};'use strict';var _=require(_0x7823('0x0'));var util=require(_0x7823('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7823('0x2'));var fs=require('fs');var Redis=require(_0x7823('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7823('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x7823('0x5'));var jayson=require(_0x7823('0x6'));var client=jayson[_0x7823('0x7')][_0x7823('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e3841,_0x404dd8,_0x476ff5){return new BPromise(function(_0x1e5260,_0x52e175){return client[_0x7823('0x9')](_0x4e3841,_0x476ff5)[_0x7823('0xa')](function(_0x4eb36f){logger[_0x7823('0xb')](_0x7823('0xc'),_0x404dd8,_0x7823('0xd'));logger[_0x7823('0xe')](_0x7823('0xf'),_0x404dd8,_0x7823('0xd'),JSON[_0x7823('0x10')](_0x4eb36f));if(_0x4eb36f[_0x7823('0x11')]){if(_0x4eb36f[_0x7823('0x11')][_0x7823('0x12')]===0x1f4){logger[_0x7823('0x11')](_0x7823('0xc'),_0x404dd8,_0x4eb36f[_0x7823('0x11')][_0x7823('0x13')]);return _0x52e175(_0x4eb36f[_0x7823('0x11')][_0x7823('0x13')]);}logger[_0x7823('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x404dd8,_0x4eb36f[_0x7823('0x11')][_0x7823('0x13')]);return _0x1e5260(_0x4eb36f[_0x7823('0x11')][_0x7823('0x13')]);}else{logger[_0x7823('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0x404dd8,'request\x20sent');_0x1e5260(_0x4eb36f[_0x7823('0x14')]['message']);}})[_0x7823('0x15')](function(_0x3ee68c){logger[_0x7823('0x11')](_0x7823('0xc'),_0x404dd8,_0x3ee68c);_0x52e175(_0x3ee68c);});});}
\ No newline at end of file
index 6ca1f44..d6656f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5943=['fs-extra','../../components/auth/service','./intDeskField.controller','isAuthenticated','index','get','/:id','show','post','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1e1a40,_0x120381){var _0x233c8e=function(_0x134c29){while(--_0x134c29){_0x1e1a40['push'](_0x1e1a40['shift']());}};_0x233c8e(++_0x120381);}(_0x5943,0x1f2));var _0x3594=function(_0x2ddfe3,_0x570c27){_0x2ddfe3=_0x2ddfe3-0x0;var _0x4efa06=_0x5943[_0x2ddfe3];return _0x4efa06;};'use strict';var multer=require(_0x3594('0x0'));var util=require(_0x3594('0x1'));var path=require(_0x3594('0x2'));var timeout=require(_0x3594('0x3'));var express=require(_0x3594('0x4'));var router=express[_0x3594('0x5')]();var fs_extra=require(_0x3594('0x6'));var auth=require(_0x3594('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3594('0x8'));router['get']('/',auth[_0x3594('0x9')](),controller[_0x3594('0xa')]);router[_0x3594('0xb')](_0x3594('0xc'),auth[_0x3594('0x9')](),controller[_0x3594('0xd')]);router[_0x3594('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x3594('0xc'),auth[_0x3594('0x9')](),controller['update']);router[_0x3594('0xf')](_0x3594('0xc'),auth[_0x3594('0x9')](),controller[_0x3594('0x10')]);module[_0x3594('0x11')]=router;
\ No newline at end of file
+var _0xe785=['get','isAuthenticated','/:id','show','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskField.controller'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xe785,0x128));var _0x5e78=function(_0x40b43c,_0x269319){_0x40b43c=_0x40b43c-0x0;var _0x1d31b7=_0xe785[_0x40b43c];return _0x1d31b7;};'use strict';var multer=require(_0x5e78('0x0'));var util=require(_0x5e78('0x1'));var path=require('path');var timeout=require(_0x5e78('0x2'));var express=require(_0x5e78('0x3'));var router=express[_0x5e78('0x4')]();var fs_extra=require(_0x5e78('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5e78('0x6'));var controller=require(_0x5e78('0x7'));router[_0x5e78('0x8')]('/',auth[_0x5e78('0x9')](),controller['index']);router['get'](_0x5e78('0xa'),auth[_0x5e78('0x9')](),controller[_0x5e78('0xb')]);router['post']('/',auth[_0x5e78('0x9')](),controller['create']);router[_0x5e78('0xc')]('/:id',auth[_0x5e78('0x9')](),controller[_0x5e78('0xd')]);router['delete'](_0x5e78('0xa'),auth[_0x5e78('0x9')](),controller[_0x5e78('0xe')]);module[_0x5e78('0xf')]=router;
\ No newline at end of file
index fd3dbc4..fc20c73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85cc=['keyValue','picklist','string','STRING','BOOLEAN','sequelize','variable','customVariable'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x85cc,0xad));var _0xc85c=function(_0x23b1ee,_0x270e5d){_0x23b1ee=_0x23b1ee-0x0;var _0x169921=_0x85cc[_0x23b1ee];return _0x169921;};'use strict';var Sequelize=require(_0xc85c('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xc85c('0x1'),_0xc85c('0x2'),_0xc85c('0x3'),_0xc85c('0x4')),'defaultValue':_0xc85c('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xc85c('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xc85c('0x5'),'variable',_0xc85c('0x2'))},'keyContent':{'type':Sequelize[_0xc85c('0x6')]},'idField':{'type':Sequelize[_0xc85c('0x6')]},'nameField':{'type':Sequelize[_0xc85c('0x6')]},'customField':{'type':Sequelize[_0xc85c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc85c('0x6')]}};
\ No newline at end of file
+var _0xe9d4=['variable','keyValue','picklist','STRING','ENUM','customVariable','BOOLEAN','sequelize','exports','string'];(function(_0x23b895,_0x58a854){var _0x88a9a7=function(_0x473cea){while(--_0x473cea){_0x23b895['push'](_0x23b895['shift']());}};_0x88a9a7(++_0x58a854);}(_0xe9d4,0x147));var _0x4e9d=function(_0x1eda65,_0x13d2d7){_0x1eda65=_0x1eda65-0x0;var _0x57d5ad=_0xe9d4[_0x1eda65];return _0x57d5ad;};'use strict';var Sequelize=require(_0x4e9d('0x0'));module[_0x4e9d('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4e9d('0x2'),_0x4e9d('0x3'),'customVariable',_0x4e9d('0x4'),_0x4e9d('0x5')),'defaultValue':_0x4e9d('0x2')},'content':{'type':Sequelize[_0x4e9d('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4e9d('0x7')](_0x4e9d('0x2'),_0x4e9d('0x3'),_0x4e9d('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4e9d('0x6')]},'nameField':{'type':Sequelize[_0x4e9d('0x6')]},'customField':{'type':Sequelize[_0x4e9d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index f658487..a3a405e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d0c=['filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','query'];(function(_0x41962a,_0xc768fe){var _0x5f3d89=function(_0x204728){while(--_0x204728){_0x41962a['push'](_0x41962a['shift']());}};_0x5f3d89(++_0xc768fe);}(_0x9d0c,0xb9));var _0xc9d0=function(_0x2803ab,_0x1c33f2){_0x2803ab=_0x2803ab-0x0;var _0x3d6e8e=_0x9d0c[_0x2803ab];return _0x3d6e8e;};'use strict';var emlformat=require(_0xc9d0('0x0'));var rimraf=require(_0xc9d0('0x1'));var zipdir=require(_0xc9d0('0x2'));var jsonpatch=require(_0xc9d0('0x3'));var rp=require('request-promise');var moment=require(_0xc9d0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc9d0('0x5'));var util=require(_0xc9d0('0x6'));var path=require(_0xc9d0('0x7'));var sox=require(_0xc9d0('0x8'));var csv=require(_0xc9d0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9d0('0xa'));var _=require(_0xc9d0('0xb'));var squel=require(_0xc9d0('0xc'));var crypto=require(_0xc9d0('0xd'));var jsforce=require(_0xc9d0('0xe'));var deskjs=require(_0xc9d0('0xf'));var toCsv=require(_0xc9d0('0x9'));var querystring=require(_0xc9d0('0x10'));var Papa=require(_0xc9d0('0x11'));var Redis=require(_0xc9d0('0x12'));var authService=require(_0xc9d0('0x13'));var qs=require(_0xc9d0('0x14'));var as=require(_0xc9d0('0x15'));var hardwareService=require(_0xc9d0('0x16'));var logger=require(_0xc9d0('0x17'))(_0xc9d0('0x18'));var utils=require(_0xc9d0('0x19'));var config=require(_0xc9d0('0x1a'));var licenseUtil=require(_0xc9d0('0x1b'));var db=require(_0xc9d0('0x1c'))['db'];function respondWithStatusCode(_0x3df90d,_0x9a8a55){_0x9a8a55=_0x9a8a55||0xcc;return function(_0x1c147a){if(_0x1c147a){return _0x3df90d['sendStatus'](_0x9a8a55);}return _0x3df90d['status'](_0x9a8a55)[_0xc9d0('0x1d')]();};}function respondWithResult(_0x1ff817,_0x1d01c6){_0x1d01c6=_0x1d01c6||0xc8;return function(_0xf11e57){if(_0xf11e57){return _0x1ff817[_0xc9d0('0x1e')](_0x1d01c6)[_0xc9d0('0x1f')](_0xf11e57);}};}function respondWithFilteredResult(_0x3df995,_0x2ea05e){return function(_0x18eb1e){if(_0x18eb1e){var _0x31f48f=typeof _0x2ea05e[_0xc9d0('0x20')]===_0xc9d0('0x21')&&typeof _0x2ea05e[_0xc9d0('0x22')]===_0xc9d0('0x21');var _0x539744=_0x18eb1e[_0xc9d0('0x23')];var _0x5c1d84=_0x31f48f?0x0:_0x2ea05e['offset'];var _0x20aa19=_0x31f48f?_0x18eb1e[_0xc9d0('0x23')]:_0x2ea05e['offset']+_0x2ea05e[_0xc9d0('0x22')];var _0x247fb2;if(_0x20aa19>=_0x539744){_0x20aa19=_0x539744;_0x247fb2=0xc8;}else{_0x247fb2=0xce;}_0x3df995[_0xc9d0('0x1e')](_0x247fb2);return _0x3df995[_0xc9d0('0x24')](_0xc9d0('0x25'),_0x5c1d84+'-'+_0x20aa19+'/'+_0x539744)[_0xc9d0('0x1f')](_0x18eb1e);}return null;};}function patchUpdates(_0x526b62){return function(_0x380802){try{jsonpatch[_0xc9d0('0x26')](_0x380802,_0x526b62,!![]);}catch(_0x4fd61a){return BPromise['reject'](_0x4fd61a);}return _0x380802['save']();};}function saveUpdates(_0x5b489a,_0x48caa0){return function(_0x4112f3){if(_0x4112f3){return _0x4112f3[_0xc9d0('0x27')](_0x5b489a)[_0xc9d0('0x28')](function(_0x40bfdf){return _0x40bfdf;});}return null;};}function removeEntity(_0x4d0cd8,_0x73159f){return function(_0x5bb2fc){if(_0x5bb2fc){return _0x5bb2fc[_0xc9d0('0x29')]()[_0xc9d0('0x28')](function(){_0x4d0cd8['status'](0xcc)[_0xc9d0('0x1d')]();});}};}function handleEntityNotFound(_0xda2fd5,_0x5a69a9){return function(_0x339914){if(!_0x339914){_0xda2fd5[_0xc9d0('0x2a')](0x194);}return _0x339914;};}function handleError(_0x11d833,_0x1321a7){_0x1321a7=_0x1321a7||0x1f4;return function(_0x11bc03){logger[_0xc9d0('0x2b')](_0x11bc03[_0xc9d0('0x2c')]);if(_0x11bc03['name']){delete _0x11bc03[_0xc9d0('0x2d')];}_0x11d833[_0xc9d0('0x1e')](_0x1321a7)[_0xc9d0('0x2e')](_0x11bc03);};}exports[_0xc9d0('0x2f')]=function(_0x3fe4ad,_0x132d66){var _0x3d4b80={},_0x11f3ea={},_0x430329={'count':0x0,'rows':[]};var _0x4260cd=_[_0xc9d0('0x30')](db[_0xc9d0('0x31')][_0xc9d0('0x32')],function(_0x4bcc09){return{'name':_0x4bcc09[_0xc9d0('0x33')],'type':_0x4bcc09[_0xc9d0('0x34')][_0xc9d0('0x35')]};});_0x11f3ea['model']=_[_0xc9d0('0x30')](_0x4260cd,'name');_0x11f3ea['query']=_['keys'](_0x3fe4ad[_0xc9d0('0x36')]);_0x11f3ea[_0xc9d0('0x37')]=_[_0xc9d0('0x38')](_0x11f3ea['model'],_0x11f3ea[_0xc9d0('0x36')]);_0x3d4b80[_0xc9d0('0x39')]=_[_0xc9d0('0x38')](_0x11f3ea[_0xc9d0('0x3a')],qs[_0xc9d0('0x3b')](_0x3fe4ad[_0xc9d0('0x36')][_0xc9d0('0x3b')]));_0x3d4b80[_0xc9d0('0x39')]=_0x3d4b80[_0xc9d0('0x39')]['length']?_0x3d4b80['attributes']:_0x11f3ea['model'];if(!_0x3fe4ad['query'][_0xc9d0('0x3c')](_0xc9d0('0x3d'))){_0x3d4b80[_0xc9d0('0x22')]=qs['limit'](_0x3fe4ad[_0xc9d0('0x36')]['limit']);_0x3d4b80[_0xc9d0('0x20')]=qs['offset'](_0x3fe4ad['query'][_0xc9d0('0x20')]);}_0x3d4b80[_0xc9d0('0x3e')]=qs['sort'](_0x3fe4ad['query'][_0xc9d0('0x3f')]);_0x3d4b80[_0xc9d0('0x40')]=qs['filters'](_[_0xc9d0('0x41')](_0x3fe4ad['query'],_0x11f3ea[_0xc9d0('0x37')]),_0x4260cd);if(_0x3fe4ad[_0xc9d0('0x36')]['filter']){_0x3d4b80['where']=_[_0xc9d0('0x42')](_0x3d4b80[_0xc9d0('0x40')],{'$or':_[_0xc9d0('0x30')](_0x4260cd,function(_0x36c711){if(_0x36c711[_0xc9d0('0x34')]!==_0xc9d0('0x43')){var _0x344782={};_0x344782[_0x36c711[_0xc9d0('0x2d')]]={'$like':'%'+_0x3fe4ad['query']['filter']+'%'};return _0x344782;}})});}_0x3d4b80=_['merge']({},_0x3d4b80,_0x3fe4ad[_0xc9d0('0x44')]);var _0x57f3e2={'where':_0x3d4b80['where']};return db[_0xc9d0('0x31')][_0xc9d0('0x23')](_0x57f3e2)['then'](function(_0x43eadc){_0x430329[_0xc9d0('0x23')]=_0x43eadc;if(_0x3fe4ad[_0xc9d0('0x36')][_0xc9d0('0x45')]){_0x3d4b80[_0xc9d0('0x46')]=[{'all':!![]}];}return db[_0xc9d0('0x31')][_0xc9d0('0x47')](_0x3d4b80);})[_0xc9d0('0x28')](function(_0x24dfe7){_0x430329[_0xc9d0('0x48')]=_0x24dfe7;return _0x430329;})[_0xc9d0('0x28')](respondWithFilteredResult(_0x132d66,_0x3d4b80))['catch'](handleError(_0x132d66,null));};exports['show']=function(_0x442444,_0x5030ce){var _0x54cc08={'raw':!![],'where':{'id':_0x442444[_0xc9d0('0x49')]['id']}},_0x2cc699={};_0x2cc699['model']=_[_0xc9d0('0x4a')](db[_0xc9d0('0x31')][_0xc9d0('0x32')]);_0x2cc699[_0xc9d0('0x36')]=_[_0xc9d0('0x4a')](_0x442444[_0xc9d0('0x36')]);_0x2cc699[_0xc9d0('0x37')]=_['intersection'](_0x2cc699[_0xc9d0('0x3a')],_0x2cc699[_0xc9d0('0x36')]);_0x54cc08[_0xc9d0('0x39')]=_[_0xc9d0('0x38')](_0x2cc699[_0xc9d0('0x3a')],qs[_0xc9d0('0x3b')](_0x442444[_0xc9d0('0x36')][_0xc9d0('0x3b')]));_0x54cc08[_0xc9d0('0x39')]=_0x54cc08[_0xc9d0('0x39')][_0xc9d0('0x4b')]?_0x54cc08[_0xc9d0('0x39')]:_0x2cc699[_0xc9d0('0x3a')];if(_0x442444['query'][_0xc9d0('0x45')]){_0x54cc08['include']=[{'all':!![]}];}_0x54cc08=_['merge']({},_0x54cc08,_0x442444[_0xc9d0('0x44')]);return db[_0xc9d0('0x31')][_0xc9d0('0x4c')](_0x54cc08)[_0xc9d0('0x28')](handleEntityNotFound(_0x5030ce,null))[_0xc9d0('0x28')](respondWithResult(_0x5030ce,null))[_0xc9d0('0x4d')](handleError(_0x5030ce,null));};exports[_0xc9d0('0x4e')]=function(_0x5c2532,_0x216498){return db[_0xc9d0('0x31')][_0xc9d0('0x4e')](_0x5c2532[_0xc9d0('0x4f')],{})[_0xc9d0('0x28')](respondWithResult(_0x216498,0xc9))[_0xc9d0('0x4d')](handleError(_0x216498,null));};exports[_0xc9d0('0x27')]=function(_0x27b5e5,_0x3fa59f){if(_0x27b5e5['body']['id']){delete _0x27b5e5[_0xc9d0('0x4f')]['id'];}return db[_0xc9d0('0x31')][_0xc9d0('0x4c')]({'where':{'id':_0x27b5e5['params']['id']}})[_0xc9d0('0x28')](handleEntityNotFound(_0x3fa59f,null))[_0xc9d0('0x28')](saveUpdates(_0x27b5e5['body'],null))[_0xc9d0('0x28')](respondWithResult(_0x3fa59f,null))[_0xc9d0('0x4d')](handleError(_0x3fa59f,null));};exports[_0xc9d0('0x29')]=function(_0x2f532f,_0x1c03a8){return db[_0xc9d0('0x31')][_0xc9d0('0x4c')]({'where':{'id':_0x2f532f[_0xc9d0('0x49')]['id']}})['then'](handleEntityNotFound(_0x1c03a8,null))[_0xc9d0('0x28')](removeEntity(_0x1c03a8,null))[_0xc9d0('0x4d')](handleError(_0x1c03a8,null));};
\ No newline at end of file
+var _0xa613=['to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','limit','offset','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x3456f0,_0x42beb5){var _0x27bd70=function(_0xf4cc07){while(--_0xf4cc07){_0x3456f0['push'](_0x3456f0['shift']());}};_0x27bd70(++_0x42beb5);}(_0xa613,0x8a));var _0x3a61=function(_0x4b91fb,_0xe92b69){_0x4b91fb=_0x4b91fb-0x0;var _0x5eca8e=_0xa613[_0x4b91fb];return _0x5eca8e;};'use strict';var emlformat=require(_0x3a61('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3a61('0x1'));var jsonpatch=require(_0x3a61('0x2'));var rp=require(_0x3a61('0x3'));var moment=require(_0x3a61('0x4'));var BPromise=require(_0x3a61('0x5'));var Mustache=require(_0x3a61('0x6'));var util=require(_0x3a61('0x7'));var path=require(_0x3a61('0x8'));var sox=require(_0x3a61('0x9'));var csv=require(_0x3a61('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3a61('0xb'));var _=require(_0x3a61('0xc'));var squel=require('squel');var crypto=require(_0x3a61('0xd'));var jsforce=require(_0x3a61('0xe'));var deskjs=require(_0x3a61('0xf'));var toCsv=require(_0x3a61('0xa'));var querystring=require(_0x3a61('0x10'));var Papa=require('papaparse');var Redis=require(_0x3a61('0x11'));var authService=require(_0x3a61('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a61('0x13'))(_0x3a61('0x14'));var utils=require('../../config/utils');var config=require(_0x3a61('0x15'));var licenseUtil=require(_0x3a61('0x16'));var db=require(_0x3a61('0x17'))['db'];function respondWithStatusCode(_0xb3983d,_0x3d8742){_0x3d8742=_0x3d8742||0xcc;return function(_0x1323eb){if(_0x1323eb){return _0xb3983d['sendStatus'](_0x3d8742);}return _0xb3983d['status'](_0x3d8742)[_0x3a61('0x18')]();};}function respondWithResult(_0x17f875,_0x224f4f){_0x224f4f=_0x224f4f||0xc8;return function(_0x35d881){if(_0x35d881){return _0x17f875[_0x3a61('0x19')](_0x224f4f)['json'](_0x35d881);}};}function respondWithFilteredResult(_0x4ca1a3,_0x134d5f){return function(_0x56c846){if(_0x56c846){var _0x98fd1b=typeof _0x134d5f['offset']===_0x3a61('0x1a')&&typeof _0x134d5f[_0x3a61('0x1b')]==='undefined';var _0x238c82=_0x56c846['count'];var _0x24e4e6=_0x98fd1b?0x0:_0x134d5f['offset'];var _0x94bdcb=_0x98fd1b?_0x56c846['count']:_0x134d5f[_0x3a61('0x1c')]+_0x134d5f[_0x3a61('0x1b')];var _0x1ae21d;if(_0x94bdcb>=_0x238c82){_0x94bdcb=_0x238c82;_0x1ae21d=0xc8;}else{_0x1ae21d=0xce;}_0x4ca1a3[_0x3a61('0x19')](_0x1ae21d);return _0x4ca1a3[_0x3a61('0x1d')](_0x3a61('0x1e'),_0x24e4e6+'-'+_0x94bdcb+'/'+_0x238c82)[_0x3a61('0x1f')](_0x56c846);}return null;};}function patchUpdates(_0x2186c7){return function(_0x301f95){try{jsonpatch[_0x3a61('0x20')](_0x301f95,_0x2186c7,!![]);}catch(_0x17f611){return BPromise[_0x3a61('0x21')](_0x17f611);}return _0x301f95[_0x3a61('0x22')]();};}function saveUpdates(_0x188aaa,_0x4485ed){return function(_0x55c0a7){if(_0x55c0a7){return _0x55c0a7[_0x3a61('0x23')](_0x188aaa)[_0x3a61('0x24')](function(_0x4582e2){return _0x4582e2;});}return null;};}function removeEntity(_0x1d649a,_0x5aaf73){return function(_0x57df5b){if(_0x57df5b){return _0x57df5b['destroy']()[_0x3a61('0x24')](function(){_0x1d649a[_0x3a61('0x19')](0xcc)[_0x3a61('0x18')]();});}};}function handleEntityNotFound(_0x378ea7,_0x31d2fd){return function(_0xf3dde6){if(!_0xf3dde6){_0x378ea7[_0x3a61('0x25')](0x194);}return _0xf3dde6;};}function handleError(_0x36ad58,_0x2b4885){_0x2b4885=_0x2b4885||0x1f4;return function(_0x1e33f3){logger[_0x3a61('0x26')](_0x1e33f3[_0x3a61('0x27')]);if(_0x1e33f3[_0x3a61('0x28')]){delete _0x1e33f3[_0x3a61('0x28')];}_0x36ad58[_0x3a61('0x19')](_0x2b4885)[_0x3a61('0x29')](_0x1e33f3);};}exports[_0x3a61('0x2a')]=function(_0x13e7c1,_0x3f00b8){var _0x30c21b={},_0x4d572a={},_0x4b02df={'count':0x0,'rows':[]};var _0x46cffa=_[_0x3a61('0x2b')](db[_0x3a61('0x2c')][_0x3a61('0x2d')],function(_0x42499f){return{'name':_0x42499f[_0x3a61('0x2e')],'type':_0x42499f[_0x3a61('0x2f')][_0x3a61('0x30')]};});_0x4d572a[_0x3a61('0x31')]=_[_0x3a61('0x2b')](_0x46cffa,_0x3a61('0x28'));_0x4d572a['query']=_[_0x3a61('0x32')](_0x13e7c1[_0x3a61('0x33')]);_0x4d572a[_0x3a61('0x34')]=_[_0x3a61('0x35')](_0x4d572a[_0x3a61('0x31')],_0x4d572a['query']);_0x30c21b[_0x3a61('0x36')]=_['intersection'](_0x4d572a[_0x3a61('0x31')],qs[_0x3a61('0x37')](_0x13e7c1[_0x3a61('0x33')][_0x3a61('0x37')]));_0x30c21b[_0x3a61('0x36')]=_0x30c21b['attributes'][_0x3a61('0x38')]?_0x30c21b['attributes']:_0x4d572a[_0x3a61('0x31')];if(!_0x13e7c1[_0x3a61('0x33')]['hasOwnProperty'](_0x3a61('0x39'))){_0x30c21b[_0x3a61('0x1b')]=qs[_0x3a61('0x1b')](_0x13e7c1['query'][_0x3a61('0x1b')]);_0x30c21b[_0x3a61('0x1c')]=qs[_0x3a61('0x1c')](_0x13e7c1[_0x3a61('0x33')][_0x3a61('0x1c')]);}_0x30c21b[_0x3a61('0x3a')]=qs[_0x3a61('0x3b')](_0x13e7c1[_0x3a61('0x33')][_0x3a61('0x3b')]);_0x30c21b[_0x3a61('0x3c')]=qs[_0x3a61('0x34')](_['pick'](_0x13e7c1[_0x3a61('0x33')],_0x4d572a[_0x3a61('0x34')]),_0x46cffa);if(_0x13e7c1['query'][_0x3a61('0x3d')]){_0x30c21b['where']=_[_0x3a61('0x3e')](_0x30c21b[_0x3a61('0x3c')],{'$or':_[_0x3a61('0x2b')](_0x46cffa,function(_0x299848){if(_0x299848[_0x3a61('0x2f')]!==_0x3a61('0x3f')){var _0x2d3593={};_0x2d3593[_0x299848[_0x3a61('0x28')]]={'$like':'%'+_0x13e7c1[_0x3a61('0x33')]['filter']+'%'};return _0x2d3593;}})});}_0x30c21b=_['merge']({},_0x30c21b,_0x13e7c1['options']);var _0x1e2e3f={'where':_0x30c21b[_0x3a61('0x3c')]};return db[_0x3a61('0x2c')][_0x3a61('0x40')](_0x1e2e3f)[_0x3a61('0x24')](function(_0x4d3480){_0x4b02df[_0x3a61('0x40')]=_0x4d3480;if(_0x13e7c1[_0x3a61('0x33')][_0x3a61('0x41')]){_0x30c21b[_0x3a61('0x42')]=[{'all':!![]}];}return db[_0x3a61('0x2c')][_0x3a61('0x43')](_0x30c21b);})[_0x3a61('0x24')](function(_0x393d90){_0x4b02df[_0x3a61('0x44')]=_0x393d90;return _0x4b02df;})['then'](respondWithFilteredResult(_0x3f00b8,_0x30c21b))[_0x3a61('0x45')](handleError(_0x3f00b8,null));};exports['show']=function(_0x331603,_0x51fcda){var _0x40d30f={'raw':!![],'where':{'id':_0x331603[_0x3a61('0x46')]['id']}},_0xb0419c={};_0xb0419c[_0x3a61('0x31')]=_[_0x3a61('0x32')](db[_0x3a61('0x2c')][_0x3a61('0x2d')]);_0xb0419c['query']=_[_0x3a61('0x32')](_0x331603[_0x3a61('0x33')]);_0xb0419c['filters']=_[_0x3a61('0x35')](_0xb0419c['model'],_0xb0419c[_0x3a61('0x33')]);_0x40d30f['attributes']=_[_0x3a61('0x35')](_0xb0419c[_0x3a61('0x31')],qs[_0x3a61('0x37')](_0x331603[_0x3a61('0x33')][_0x3a61('0x37')]));_0x40d30f['attributes']=_0x40d30f['attributes'][_0x3a61('0x38')]?_0x40d30f['attributes']:_0xb0419c[_0x3a61('0x31')];if(_0x331603[_0x3a61('0x33')][_0x3a61('0x41')]){_0x40d30f[_0x3a61('0x42')]=[{'all':!![]}];}_0x40d30f=_[_0x3a61('0x3e')]({},_0x40d30f,_0x331603['options']);return db[_0x3a61('0x2c')][_0x3a61('0x47')](_0x40d30f)[_0x3a61('0x24')](handleEntityNotFound(_0x51fcda,null))[_0x3a61('0x24')](respondWithResult(_0x51fcda,null))[_0x3a61('0x45')](handleError(_0x51fcda,null));};exports[_0x3a61('0x48')]=function(_0x27fbe2,_0x8a98ba){return db[_0x3a61('0x2c')]['create'](_0x27fbe2[_0x3a61('0x49')],{})[_0x3a61('0x24')](respondWithResult(_0x8a98ba,0xc9))[_0x3a61('0x45')](handleError(_0x8a98ba,null));};exports['update']=function(_0x50e091,_0x5f1860){if(_0x50e091['body']['id']){delete _0x50e091['body']['id'];}return db[_0x3a61('0x2c')][_0x3a61('0x47')]({'where':{'id':_0x50e091[_0x3a61('0x46')]['id']}})[_0x3a61('0x24')](handleEntityNotFound(_0x5f1860,null))[_0x3a61('0x24')](saveUpdates(_0x50e091[_0x3a61('0x49')],null))[_0x3a61('0x24')](respondWithResult(_0x5f1860,null))[_0x3a61('0x45')](handleError(_0x5f1860,null));};exports['destroy']=function(_0x158468,_0x10fde6){return db[_0x3a61('0x2c')][_0x3a61('0x47')]({'where':{'id':_0x158468[_0x3a61('0x46')]['id']}})['then'](handleEntityNotFound(_0x10fde6,null))[_0x3a61('0x24')](removeEntity(_0x10fde6,null))['catch'](handleError(_0x10fde6,null));};
\ No newline at end of file
index 4c9b7f0..af4312c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43bd=['rimraf','../../config/environment','./intDeskField.attributes','exports','DeskField','int_desk_fields','idField','FieldId','lodash','moment','bluebird','request-promise','path'];(function(_0x128079,_0x1b6407){var _0x20d856=function(_0x286efe){while(--_0x286efe){_0x128079['push'](_0x128079['shift']());}};_0x20d856(++_0x1b6407);}(_0x43bd,0x181));var _0xd43b=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x43bd[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xd43b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd43b('0x1'));var BPromise=require(_0xd43b('0x2'));var rp=require(_0xd43b('0x3'));var fs=require('fs');var path=require(_0xd43b('0x4'));var rimraf=require(_0xd43b('0x5'));var config=require(_0xd43b('0x6'));var attributes=require(_0xd43b('0x7'));module[_0xd43b('0x8')]=function(_0x226bd1,_0x515adc){return _0x226bd1['define'](_0xd43b('0x9'),attributes,{'tableName':_0xd43b('0xa'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xd43b('0xb'),_0xd43b('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x404e=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash'];(function(_0xd0bef3,_0x530cc1){var _0x3cf549=function(_0x5ddb95){while(--_0x5ddb95){_0xd0bef3['push'](_0xd0bef3['shift']());}};_0x3cf549(++_0x530cc1);}(_0x404e,0xfe));var _0xe404=function(_0x195c21,_0x332612){_0x195c21=_0x195c21-0x0;var _0x3576a8=_0x404e[_0x195c21];return _0x3576a8;};'use strict';var _=require(_0xe404('0x0'));var util=require(_0xe404('0x1'));var logger=require('../../config/logger')(_0xe404('0x2'));var moment=require(_0xe404('0x3'));var BPromise=require(_0xe404('0x4'));var rp=require(_0xe404('0x5'));var fs=require('fs');var path=require(_0xe404('0x6'));var rimraf=require(_0xe404('0x7'));var config=require(_0xe404('0x8'));var attributes=require(_0xe404('0x9'));module[_0xe404('0xa')]=function(_0x590d5d,_0x451809){return _0x590d5d[_0xe404('0xb')](_0xe404('0xc'),attributes,{'tableName':_0xe404('0xd'),'paranoid':![],'indexes':[{'name':_0xe404('0xe'),'fields':[_0xe404('0xf'),_0xe404('0x10')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 44868b5..9576b7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54aa=['../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','DeskField,\x20%s,\x20%s','message','result','catch','util','bluebird','../../mysqldb','../../config/utils','rpc'];(function(_0x299052,_0x930673){var _0x2e491a=function(_0x389c84){while(--_0x389c84){_0x299052['push'](_0x299052['shift']());}};_0x2e491a(++_0x930673);}(_0x54aa,0x73));var _0xa54a=function(_0x518a12,_0x5b4a7a){_0x518a12=_0x518a12-0x0;var _0x5d8f03=_0x54aa[_0x518a12];return _0x5d8f03;};'use strict';var _=require('lodash');var util=require(_0xa54a('0x0'));var moment=require('moment');var BPromise=require(_0xa54a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa54a('0x2'))['db'];var utils=require(_0xa54a('0x3'));var logger=require('../../config/logger')(_0xa54a('0x4'));var config=require(_0xa54a('0x5'));var jayson=require(_0xa54a('0x6'));var client=jayson[_0xa54a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x574862,_0x369022,_0x554836){return new BPromise(function(_0x54b5ee,_0x59ff35){return client[_0xa54a('0x8')](_0x574862,_0x554836)[_0xa54a('0x9')](function(_0x427deb){logger[_0xa54a('0xa')]('DeskField,\x20%s,\x20%s',_0x369022,_0xa54a('0xb'));logger[_0xa54a('0xc')]('DeskField,\x20%s,\x20%s,\x20%s',_0x369022,'request\x20sent',JSON[_0xa54a('0xd')](_0x427deb));if(_0x427deb[_0xa54a('0xe')]){if(_0x427deb['error'][_0xa54a('0xf')]===0x1f4){logger['error'](_0xa54a('0x10'),_0x369022,_0x427deb[_0xa54a('0xe')]['message']);return _0x59ff35(_0x427deb[_0xa54a('0xe')][_0xa54a('0x11')]);}logger[_0xa54a('0xe')](_0xa54a('0x10'),_0x369022,_0x427deb['error'][_0xa54a('0x11')]);return _0x54b5ee(_0x427deb[_0xa54a('0xe')][_0xa54a('0x11')]);}else{logger['info'](_0xa54a('0x10'),_0x369022,_0xa54a('0xb'));_0x54b5ee(_0x427deb[_0xa54a('0x12')][_0xa54a('0x11')]);}})[_0xa54a('0x13')](function(_0x1e2dfc){logger[_0xa54a('0xe')](_0xa54a('0x10'),_0x369022,_0x1e2dfc);_0x59ff35(_0x1e2dfc);});});}
\ No newline at end of file
+var _0x06ee=['stringify','error','code','DeskField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','request\x20sent'];(function(_0x1c3142,_0x3e95a2){var _0x5bac8f=function(_0xc4cb9c){while(--_0xc4cb9c){_0x1c3142['push'](_0x1c3142['shift']());}};_0x5bac8f(++_0x3e95a2);}(_0x06ee,0x11e));var _0xe06e=function(_0x500b21,_0x49b9b2){_0x500b21=_0x500b21-0x0;var _0x5eb516=_0x06ee[_0x500b21];return _0x5eb516;};'use strict';var _=require(_0xe06e('0x0'));var util=require(_0xe06e('0x1'));var moment=require(_0xe06e('0x2'));var BPromise=require(_0xe06e('0x3'));var rs=require(_0xe06e('0x4'));var fs=require('fs');var Redis=require(_0xe06e('0x5'));var db=require(_0xe06e('0x6'))['db'];var utils=require(_0xe06e('0x7'));var logger=require(_0xe06e('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe06e('0x9'));var client=jayson['client'][_0xe06e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e9b79,_0x5a3fec,_0x55f47b){return new BPromise(function(_0x374171,_0x4ce4a7){return client[_0xe06e('0xb')](_0x1e9b79,_0x55f47b)['then'](function(_0x47e905){logger[_0xe06e('0xc')]('DeskField,\x20%s,\x20%s',_0x5a3fec,_0xe06e('0xd'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x5a3fec,_0xe06e('0xd'),JSON[_0xe06e('0xe')](_0x47e905));if(_0x47e905[_0xe06e('0xf')]){if(_0x47e905[_0xe06e('0xf')][_0xe06e('0x10')]===0x1f4){logger[_0xe06e('0xf')](_0xe06e('0x11'),_0x5a3fec,_0x47e905[_0xe06e('0xf')][_0xe06e('0x12')]);return _0x4ce4a7(_0x47e905['error'][_0xe06e('0x12')]);}logger[_0xe06e('0xf')]('DeskField,\x20%s,\x20%s',_0x5a3fec,_0x47e905[_0xe06e('0xf')][_0xe06e('0x12')]);return _0x374171(_0x47e905[_0xe06e('0xf')][_0xe06e('0x12')]);}else{logger[_0xe06e('0xc')](_0xe06e('0x11'),_0x5a3fec,'request\x20sent');_0x374171(_0x47e905[_0xe06e('0x13')][_0xe06e('0x12')]);}})['catch'](function(_0xd9b567){logger[_0xe06e('0xf')]('DeskField,\x20%s,\x20%s',_0x5a3fec,_0xd9b567);_0x4ce4a7(_0xd9b567);});});}
\ No newline at end of file
index 5982409..5baeec2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d16=['fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','index','get','/:id','show','/:id/configurations','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','express','Router'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x8d16,0x101));var _0x68d1=function(_0x560878,_0x5ea318){_0x560878=_0x560878-0x0;var _0x1f43ae=_0x8d16[_0x560878];return _0x1f43ae;};'use strict';var multer=require(_0x68d1('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x68d1('0x1'));var router=express[_0x68d1('0x2')]();var fs_extra=require(_0x68d1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x68d1('0x4'));var config=require(_0x68d1('0x5'));var controller=require(_0x68d1('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x68d1('0x7')]);router[_0x68d1('0x8')](_0x68d1('0x9'),auth['isAuthenticated'](),controller[_0x68d1('0xa')]);router[_0x68d1('0x8')](_0x68d1('0xb'),auth[_0x68d1('0xc')](),controller['getConfigurations']);router[_0x68d1('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x68d1('0xd')]);router['post']('/',auth[_0x68d1('0xc')](),controller['create']);router[_0x68d1('0xe')]('/:id/configurations',auth[_0x68d1('0xc')](),controller[_0x68d1('0xf')]);router[_0x68d1('0x10')](_0x68d1('0x9'),auth[_0x68d1('0xc')](),controller[_0x68d1('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x68d1('0x12')]);module[_0x68d1('0x13')]=router;
\ No newline at end of file
+var _0x0627=['../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x0627,0x98));var _0x7062=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x0627[_0x386c3e];return _0x4b8e13;};'use strict';var multer=require(_0x7062('0x0'));var util=require(_0x7062('0x1'));var path=require(_0x7062('0x2'));var timeout=require(_0x7062('0x3'));var express=require(_0x7062('0x4'));var router=express[_0x7062('0x5')]();var fs_extra=require(_0x7062('0x6'));var auth=require(_0x7062('0x7'));var interaction=require(_0x7062('0x8'));var config=require(_0x7062('0x9'));var controller=require(_0x7062('0xa'));router[_0x7062('0xb')]('/',auth[_0x7062('0xc')](),controller['index']);router[_0x7062('0xb')](_0x7062('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7062('0xe'),auth[_0x7062('0xc')](),controller[_0x7062('0xf')]);router[_0x7062('0xb')](_0x7062('0x10'),auth[_0x7062('0xc')](),controller[_0x7062('0x11')]);router[_0x7062('0x12')]('/',auth[_0x7062('0xc')](),controller[_0x7062('0x13')]);router[_0x7062('0x12')](_0x7062('0xe'),auth['isAuthenticated'](),controller[_0x7062('0x14')]);router['put'](_0x7062('0xd'),auth[_0x7062('0xc')](),controller[_0x7062('0x15')]);router['delete'](_0x7062('0xd'),auth[_0x7062('0xc')](),controller['destroy']);module[_0x7062('0x16')]=router;
\ No newline at end of file
index ca75850..727da76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x576b=['BOOLEAN','STRING'];(function(_0x3c1e2c,_0xf28bb5){var _0x11753e=function(_0x51f4d2){while(--_0x51f4d2){_0x3c1e2c['push'](_0x3c1e2c['shift']());}};_0x11753e(++_0xf28bb5);}(_0x576b,0x1d9));var _0xb576=function(_0x53bf44,_0x56cfdf){_0x53bf44=_0x53bf44-0x0;var _0x524c3c=_0x576b[_0x53bf44];return _0x524c3c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb576('0x0')]},'password':{'type':Sequelize[_0xb576('0x0')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xb576('0x0')]},'clientId':{'type':Sequelize[_0xb576('0x0')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xb576('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xb576('0x0')]},'modernAuthentication':{'type':Sequelize[_0xb576('0x1')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x5db2=['exports','STRING','BOOLEAN','sequelize'];(function(_0xb3477d,_0x48092d){var _0x5dabe1=function(_0x515914){while(--_0x515914){_0xb3477d['push'](_0xb3477d['shift']());}};_0x5dabe1(++_0x48092d);}(_0x5db2,0xf3));var _0x25db=function(_0x54a9a6,_0x51c28e){_0x54a9a6=_0x54a9a6-0x0;var _0x390846=_0x5db2[_0x54a9a6];return _0x390846;};'use strict';var Sequelize=require(_0x25db('0x0'));module[_0x25db('0x1')]={'name':{'type':Sequelize[_0x25db('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x25db('0x2')]},'remoteUri':{'type':Sequelize[_0x25db('0x2')]},'tenantId':{'type':Sequelize[_0x25db('0x2')]},'clientId':{'type':Sequelize[_0x25db('0x2')]},'clientSecret':{'type':Sequelize[_0x25db('0x2')]},'serverUrl':{'type':Sequelize[_0x25db('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x25db('0x2')]},'modernAuthentication':{'type':Sequelize[_0x25db('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index d379e0f..3b649a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9575=['VIRTUAL','merge','options','includeAll','rows','catch','show','params','include','create','body','update','find','getConfigurations','findOne','Dynamics365Configuration','sort','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','Subjects','slice','substring','lastIndexOf','format','getFields','ticketType','incident','title','description','ownerid','phonecall_activity_parties','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyyominame','createdon','createdonbehalfbyname','customeridname','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','importsequencenumber','kbarticleidname','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','access_token','https://login.microsoftonline.com/','/oauth2/token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','GET','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','push','all','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','statusCode','stack','send','test','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption','UserLocalizedLabel','false','LogicalName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','../../components/integrations/configuration','status','json','undefined','count','offset','limit','Content-Range','then','sendStatus','error','name','index','map','Dynamics365Account','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','filter'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9575,0x13f));var _0x5957=function(_0x8dbf2d,_0x1abfa4){_0x8dbf2d=_0x8dbf2d-0x0;var _0x160088=_0x9575[_0x8dbf2d];return _0x160088;};'use strict';var rp=require(_0x5957('0x0'));var util=require(_0x5957('0x1'));var _=require(_0x5957('0x2'));var qs=require(_0x5957('0x3'));var logger=require(_0x5957('0x4'))('api');var db=require('../../mysqldb')['db'];var integrations=require(_0x5957('0x5'));function respondWithResult(_0x2aa3b5,_0x43be62){_0x43be62=_0x43be62||0xc8;return function(_0x343a75){if(_0x343a75){return _0x2aa3b5[_0x5957('0x6')](_0x43be62)[_0x5957('0x7')](_0x343a75);}};}function respondWithFilteredResult(_0x1d0f24,_0x3b0d3e){return function(_0x2c47d8){if(_0x2c47d8){var _0x29c7c0=typeof _0x3b0d3e['offset']===_0x5957('0x8')&&typeof _0x3b0d3e['limit']===_0x5957('0x8');var _0x4609be=_0x2c47d8[_0x5957('0x9')];var _0xc06d10=_0x29c7c0?0x0:_0x3b0d3e[_0x5957('0xa')];var _0x291c11=_0x29c7c0?_0x2c47d8[_0x5957('0x9')]:_0x3b0d3e['offset']+_0x3b0d3e[_0x5957('0xb')];var _0x3a01f6;if(_0x291c11>=_0x4609be){_0x291c11=_0x4609be;_0x3a01f6=0xc8;}else{_0x3a01f6=0xce;}_0x1d0f24[_0x5957('0x6')](_0x3a01f6);return _0x1d0f24['set'](_0x5957('0xc'),_0xc06d10+'-'+_0x291c11+'/'+_0x4609be)[_0x5957('0x7')](_0x2c47d8);}return null;};}function saveUpdates(_0x2e296f){return function(_0x4cc3d0){if(_0x4cc3d0){return _0x4cc3d0['update'](_0x2e296f)[_0x5957('0xd')](function(_0x19193c){return _0x19193c;});}return null;};}function removeEntity(_0x51a8bf){return function(_0x7c754e){if(_0x7c754e){return _0x7c754e['destroy']()['then'](function(){_0x51a8bf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x181e26){return function(_0x303f8d){if(!_0x303f8d){_0x181e26[_0x5957('0xe')](0x194);}return _0x303f8d;};}function handleError(_0x522a9d,_0x3633e0){_0x3633e0=_0x3633e0||0x1f4;return function(_0x4714d6){logger[_0x5957('0xf')](_0x4714d6['stack']);if(_0x4714d6['name']){delete _0x4714d6[_0x5957('0x10')];}_0x522a9d[_0x5957('0x6')](_0x3633e0)['send'](_0x4714d6);};}exports[_0x5957('0x11')]=function(_0x560e71,_0x349c29){var _0x5ad6a5={},_0x290dd9={},_0x5e75fe={'count':0x0,'rows':[]};var _0x56c785=_[_0x5957('0x12')](db[_0x5957('0x13')][_0x5957('0x14')],function(_0x54c45f){return{'name':_0x54c45f[_0x5957('0x15')],'type':_0x54c45f[_0x5957('0x16')]['key']};});_0x290dd9[_0x5957('0x17')]=_[_0x5957('0x12')](_0x56c785,'name');_0x290dd9['query']=_[_0x5957('0x18')](_0x560e71[_0x5957('0x19')]);_0x290dd9[_0x5957('0x1a')]=_[_0x5957('0x1b')](_0x290dd9[_0x5957('0x17')],_0x290dd9[_0x5957('0x19')]);_0x5ad6a5[_0x5957('0x1c')]=_[_0x5957('0x1b')](_0x290dd9[_0x5957('0x17')],qs[_0x5957('0x1d')](_0x560e71[_0x5957('0x19')][_0x5957('0x1d')]));_0x5ad6a5['attributes']=_0x5ad6a5['attributes'][_0x5957('0x1e')]?_0x5ad6a5[_0x5957('0x1c')]:_0x290dd9[_0x5957('0x17')];if(!_0x560e71[_0x5957('0x19')][_0x5957('0x1f')]('nolimit')){_0x5ad6a5[_0x5957('0xb')]=qs[_0x5957('0xb')](_0x560e71['query'][_0x5957('0xb')]);_0x5ad6a5[_0x5957('0xa')]=qs[_0x5957('0xa')](_0x560e71[_0x5957('0x19')][_0x5957('0xa')]);}_0x5ad6a5[_0x5957('0x20')]=qs['sort'](_0x560e71[_0x5957('0x19')]['sort']);_0x5ad6a5[_0x5957('0x21')]=qs[_0x5957('0x1a')](_['pick'](_0x560e71[_0x5957('0x19')],_0x290dd9[_0x5957('0x1a')]),_0x56c785);if(_0x560e71[_0x5957('0x19')][_0x5957('0x22')]){_0x5ad6a5['where']=_['merge'](_0x5ad6a5[_0x5957('0x21')],{'$or':_[_0x5957('0x12')](_0x56c785,function(_0x88c025){if(_0x88c025[_0x5957('0x16')]!==_0x5957('0x23')){var _0x4995c7={};_0x4995c7[_0x88c025[_0x5957('0x10')]]={'$like':'%'+_0x560e71[_0x5957('0x19')]['filter']+'%'};return _0x4995c7;}})});}_0x5ad6a5=_[_0x5957('0x24')]({},_0x5ad6a5,_0x560e71[_0x5957('0x25')]);var _0x52a7da={'where':_0x5ad6a5['where']};return db[_0x5957('0x13')]['count'](_0x52a7da)['then'](function(_0xe09de8){_0x5e75fe[_0x5957('0x9')]=_0xe09de8;if(_0x560e71['query'][_0x5957('0x26')]){_0x5ad6a5['include']=[{'all':!![]}];}return db[_0x5957('0x13')]['findAll'](_0x5ad6a5);})[_0x5957('0xd')](function(_0xe1824f){_0x5e75fe[_0x5957('0x27')]=_0xe1824f;return _0x5e75fe;})['then'](respondWithFilteredResult(_0x349c29,_0x5ad6a5))[_0x5957('0x28')](handleError(_0x349c29,null));};exports[_0x5957('0x29')]=function(_0x334879,_0x2b2eae){var _0x3b8a26={'raw':![],'where':{'id':_0x334879[_0x5957('0x2a')]['id']}},_0x182751={};_0x182751['model']=_[_0x5957('0x18')](db['Dynamics365Account']['rawAttributes']);_0x182751[_0x5957('0x19')]=_[_0x5957('0x18')](_0x334879[_0x5957('0x19')]);_0x182751[_0x5957('0x1a')]=_['intersection'](_0x182751[_0x5957('0x17')],_0x182751['query']);_0x3b8a26[_0x5957('0x1c')]=_['intersection'](_0x182751[_0x5957('0x17')],qs['fields'](_0x334879['query'][_0x5957('0x1d')]));_0x3b8a26['attributes']=_0x3b8a26['attributes'][_0x5957('0x1e')]?_0x3b8a26[_0x5957('0x1c')]:_0x182751[_0x5957('0x17')];if(_0x334879['query']['includeAll']){_0x3b8a26[_0x5957('0x2b')]=[{'all':!![]}];}_0x3b8a26=_[_0x5957('0x24')]({},_0x3b8a26,_0x334879[_0x5957('0x25')]);return db['Dynamics365Account']['find'](_0x3b8a26)[_0x5957('0xd')](handleEntityNotFound(_0x2b2eae,null))[_0x5957('0xd')](respondWithResult(_0x2b2eae,null))['catch'](handleError(_0x2b2eae,null));};exports[_0x5957('0x2c')]=function(_0x3ff543,_0x3e42bf){return db['Dynamics365Account'][_0x5957('0x2c')](_0x3ff543[_0x5957('0x2d')],{})[_0x5957('0xd')](respondWithResult(_0x3e42bf,0xc9))[_0x5957('0x28')](handleError(_0x3e42bf,null));};exports[_0x5957('0x2e')]=function(_0x4e8d8f,_0x3fb067){if(_0x4e8d8f[_0x5957('0x2d')]['id']){delete _0x4e8d8f[_0x5957('0x2d')]['id'];}return db[_0x5957('0x13')][_0x5957('0x2f')]({'where':{'id':_0x4e8d8f[_0x5957('0x2a')]['id']}})[_0x5957('0xd')](handleEntityNotFound(_0x3fb067,null))[_0x5957('0xd')](saveUpdates(_0x4e8d8f[_0x5957('0x2d')],null))[_0x5957('0xd')](respondWithResult(_0x3fb067,null))['catch'](handleError(_0x3fb067,null));};exports['destroy']=function(_0x15ab8b,_0xd84bee){return db[_0x5957('0x13')]['find']({'where':{'id':_0x15ab8b[_0x5957('0x2a')]['id']}})[_0x5957('0xd')](handleEntityNotFound(_0xd84bee,null))['then'](removeEntity(_0xd84bee,null))[_0x5957('0x28')](handleError(_0xd84bee,null));};exports[_0x5957('0x30')]=function(_0x26b427,_0x45fef8){var _0x152d29={};var _0x1f2434={};var _0x2db3ea;var _0x6021a5;return db['Dynamics365Account'][_0x5957('0x31')]({'where':{'id':_0x26b427[_0x5957('0x2a')]['id']}})['then'](handleEntityNotFound(_0x45fef8,null))['then'](function(_0x299bd9){if(_0x299bd9){_0x2db3ea=_0x299bd9;_0x1f2434[_0x5957('0x17')]=_['keys'](db[_0x5957('0x32')][_0x5957('0x14')]);_0x1f2434[_0x5957('0x19')]=_[_0x5957('0x18')](_0x26b427[_0x5957('0x19')]);_0x1f2434[_0x5957('0x1a')]=_[_0x5957('0x1b')](_0x1f2434[_0x5957('0x17')],_0x1f2434['query']);_0x152d29['attributes']=_[_0x5957('0x1b')](_0x1f2434[_0x5957('0x17')],qs[_0x5957('0x1d')](_0x26b427[_0x5957('0x19')][_0x5957('0x1d')]));_0x152d29['attributes']=_0x152d29[_0x5957('0x1c')][_0x5957('0x1e')]?_0x152d29[_0x5957('0x1c')]:_0x1f2434[_0x5957('0x17')];_0x152d29[_0x5957('0x20')]=qs[_0x5957('0x33')](_0x26b427[_0x5957('0x19')][_0x5957('0x33')]);_0x152d29[_0x5957('0x21')]=qs['filters'](_['pick'](_0x26b427[_0x5957('0x19')],_0x1f2434[_0x5957('0x1a')]));if(_0x26b427[_0x5957('0x19')][_0x5957('0x22')]){_0x152d29[_0x5957('0x21')]=_[_0x5957('0x24')](_0x152d29[_0x5957('0x21')],{'$or':_[_0x5957('0x12')](_0x152d29[_0x5957('0x1c')],function(_0xea9a01){var _0x1154a0={};_0x1154a0[_0xea9a01]={'$like':'%'+_0x26b427['query']['filter']+'%'};return _0x1154a0;})});}_0x152d29=_[_0x5957('0x24')]({},_0x152d29,_0x26b427[_0x5957('0x25')]);return _0x2db3ea[_0x5957('0x30')](_0x152d29);}})['then'](function(_0x4faef3){if(_0x4faef3){_0x6021a5=_0x4faef3[_0x5957('0x1e')];if(!_0x26b427['query'][_0x5957('0x1f')](_0x5957('0x34'))){_0x152d29[_0x5957('0xb')]=qs[_0x5957('0xb')](_0x26b427[_0x5957('0x19')][_0x5957('0xb')]);_0x152d29[_0x5957('0xa')]=qs['offset'](_0x26b427[_0x5957('0x19')]['offset']);}return _0x2db3ea[_0x5957('0x30')](_0x152d29);}})[_0x5957('0xd')](function(_0x4cc8bc){if(_0x4cc8bc){return _0x4cc8bc?{'count':_0x6021a5,'rows':_0x4cc8bc}:null;}})[_0x5957('0xd')](respondWithResult(_0x45fef8,null))[_0x5957('0x28')](handleError(_0x45fef8,null));};exports[_0x5957('0x35')]=function(_0x2bbb03,_0x778518){if(_0x2bbb03[_0x5957('0x2d')]['id']){delete _0x2bbb03[_0x5957('0x2d')]['id'];}return db[_0x5957('0x13')][_0x5957('0x31')]({'where':{'id':_0x2bbb03['params']['id']}})[_0x5957('0xd')](handleEntityNotFound(_0x778518,null))['then'](function(_0x16804c){if(_0x16804c){_0x2bbb03[_0x5957('0x2d')][_0x5957('0x36')]=_0x16804c['id'];_0x2bbb03[_0x5957('0x2d')]['Subjects']=integrations[_0x5957('0x37')](_0x2bbb03[_0x5957('0x2d')][_0x5957('0x38')],_0x2bbb03[_0x5957('0x2d')][_0x5957('0x16')]);_0x2bbb03[_0x5957('0x2d')][_0x5957('0x39')]=integrations[_0x5957('0x3a')](_0x2bbb03['body'][_0x5957('0x38')],_0x2bbb03['body'][_0x5957('0x16')]);return db['Dynamics365Configuration'][_0x5957('0x2c')](_0x2bbb03['body'],{'include':[{'model':db[_0x5957('0x3b')],'as':_0x5957('0x3c')},{'model':db[_0x5957('0x3b')],'as':'Descriptions'}]});}return null;})[_0x5957('0xd')](respondWithResult(_0x778518,null))[_0x5957('0x28')](handleError(_0x778518,null));};function sanitizeRemoteUri(_0x3adbda){var _0x1b7c4e=_0x3adbda[_0x5957('0x3d')](-0x1);if(_0x1b7c4e==='/')return _0x3adbda[_0x5957('0x3e')](0x0,_0x3adbda[_0x5957('0x3f')](_0x1b7c4e));return _0x3adbda;}function getWebApiUrl(_0x3f8775){return util[_0x5957('0x40')]('%s/api/data/v9.0/',_0x3f8775);}exports[_0x5957('0x41')]=function(_0x371b2c,_0xb1fcc){var _0x2c72fb=_0x371b2c[_0x5957('0x19')][_0x5957('0x42')];var _0x1eda13=_0x2c72fb===_0x5957('0x43')?'Incident':'PhoneCall';var _0x39dfa7='';var _0x52a360='';var _0x271d46='';var _0x58e63c='';var _0x30d3f0='';var _0x36b2d0='';var _0x36705a='';var _0x48bc3a='';var _0x4d0b55=[_0x5957('0x44'),_0x5957('0x45'),'customerid',_0x5957('0x46'),'caseorigincode','subject','phonenumber','regardingobjectid','directioncode',_0x5957('0x47')];var _0x4cfea6=['accountidname',_0x5957('0x48'),'actualserviceunits',_0x5957('0x49'),_0x5957('0x4a'),_0x5957('0x4b'),_0x5957('0x4c'),_0x5957('0x4d'),_0x5957('0x4e'),'createdbyexternalpartyyominame','createdbyname',_0x5957('0x4f'),_0x5957('0x50'),_0x5957('0x51'),'createdonbehalfbyyominame',_0x5957('0x52'),'customeridtype','customeridyominame',_0x5957('0x53'),_0x5957('0x54'),'entityimage_timestamp',_0x5957('0x55'),_0x5957('0x56'),_0x5957('0x57'),'firstresponsebykpiidname','followupby',_0x5957('0x58'),'influencescore',_0x5957('0x59'),'lastonholdtime',_0x5957('0x5a'),'modifiedbyexternalpartyname',_0x5957('0x5b'),_0x5957('0x5c'),_0x5957('0x5d'),'modifiedon',_0x5957('0x5e'),_0x5957('0x5f'),_0x5957('0x60'),'msdyn_iotalertname',_0x5957('0x61'),'onholdtime',_0x5957('0x62'),_0x5957('0x63'),_0x5957('0x64'),_0x5957('0x65'),_0x5957('0x66'),_0x5957('0x67'),'primarycontactidyominame',_0x5957('0x68'),_0x5957('0x69'),_0x5957('0x6a'),_0x5957('0x6b'),_0x5957('0x6c'),_0x5957('0x6d'),_0x5957('0x6e'),'responsiblecontactidyominame',_0x5957('0x6f'),'slainvokedidname',_0x5957('0x70'),_0x5957('0x71'),_0x5957('0x72'),_0x5957('0x73'),'subjectidname',_0x5957('0x74'),_0x5957('0x75'),_0x5957('0x76'),'traversedpath',_0x5957('0x77'),_0x5957('0x78')];var _0x20c8d0=_0x4d0b55[_0x5957('0x79')](_0x4cfea6);return db[_0x5957('0x13')][_0x5957('0x31')]({'where':{'id':_0x371b2c[_0x5957('0x2a')]['id']},'attributes':['id',_0x5957('0x7a'),_0x5957('0x7b'),_0x5957('0x7c'),_0x5957('0x7d'),_0x5957('0x7e'),_0x5957('0x7f'),_0x5957('0x80')],'include':[{'model':db['CloudProvider'],'as':_0x5957('0x81'),'attributes':['id',_0x5957('0x82'),_0x5957('0x83')]}]})[_0x5957('0xd')](handleEntityNotFound(_0xb1fcc,null))['then'](function(_0x4fd0d7){if(_0x4fd0d7){if(_0x4fd0d7[_0x5957('0x80')]){_0x4fd0d7[_0x5957('0x84')]=_0x4fd0d7[_0x5957('0x81')][_0x5957('0x82')];_0x48bc3a=sanitizeRemoteUri(_0x4fd0d7[_0x5957('0x81')][_0x5957('0x83')]);_0x36705a=getWebApiUrl(_0x48bc3a);return _0x4fd0d7;}_0x48bc3a=sanitizeRemoteUri(_0x4fd0d7[_0x5957('0x7c')]);_0x36705a=getWebApiUrl(_0x48bc3a);var _0x11d768={'method':'POST','uri':_0x5957('0x85')+_0x4fd0d7[_0x5957('0x7d')]+_0x5957('0x86'),'form':{'client_id':_0x4fd0d7[_0x5957('0x7e')],'resource':_0x48bc3a,'username':_0x4fd0d7[_0x5957('0x7a')],'password':_0x4fd0d7[_0x5957('0x7b')],'grant_type':_0x5957('0x7b'),'client_secret':_0x4fd0d7[_0x5957('0x7f')]},'json':!![]};return rp(_0x11d768);}})['then'](function(_0x2e16d5){_0x36b2d0=_0x2e16d5[_0x5957('0x84')];var _0x1d9def={'method':'GET','uri':encodeURI(_0x36705a+_0x5957('0x87')+_0x1eda13+'\x27'),'headers':{'Authorization':_0x5957('0x88')+_0x36b2d0,'If-None-Match':null,'OData-Version':_0x5957('0x89')},'json':!![]};return rp(_0x1d9def);})[_0x5957('0xd')](function(_0x3b9aae){var _0x31a210=_0x3b9aae['value'][0x0];var _0xb71056=_0x31a210[_0x5957('0x8a')];var _0x26bdd1={'method':_0x5957('0x8b'),'uri':_0x36705a+'EntityDefinitions('+_0xb71056+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0x5957('0x88')+_0x36b2d0,'If-None-Match':null,'OData-Version':_0x5957('0x89')},'json':!![]};return rp(_0x26bdd1);})[_0x5957('0xd')](function(_0x54756f){_0x39dfa7=_0x54756f;_0x52a360=_0x39dfa7[_0x5957('0x8c')];_0x52a360=_[_0x5957('0x8d')](_0x52a360,function(_0x44cbb8){return!_0x20c8d0[_0x5957('0x8e')](_0x44cbb8['LogicalName']);});var _0xaed6b3=[];var _0x18aa32=[];_0x52a360[_0x5957('0x8f')](function(_0x392f8c){if(_0x392f8c['@odata.type']){var _0x1f8e45=_0x392f8c[_0x5957('0x90')][_0x5957('0x3e')](_0x392f8c[_0x5957('0x90')]['lastIndexOf']('.')+0x1);if(_0x1f8e45===_0x5957('0x91')){_0xaed6b3[_0x5957('0x92')](getSelectList(_0x36705a,_0x2c72fb,_0x18aa32,_0x39dfa7['MetadataId'],_0x392f8c[_0x5957('0x8a')],_0x36b2d0));}}});return Promise[_0x5957('0x93')](_0xaed6b3);})[_0x5957('0xd')](function(_0x3a5b0d){_0x271d46=_0x3a5b0d[0x0];var _0x2da004=[];var _0x14ba7a=[];_0x52a360['forEach'](function(_0x1aedc4){if(!_['isNil'](_0x1aedc4[_0x5957('0x90')])){var _0x53b3a0=_0x1aedc4['@odata.type']['substring'](_0x1aedc4['@odata.type'][_0x5957('0x3f')]('.')+0x1);if(_0x53b3a0===_0x5957('0x94')){_0x2da004['push'](getBooleanList(_0x36705a,_0x2c72fb,_0x14ba7a,_0x39dfa7[_0x5957('0x8a')],_0x1aedc4[_0x5957('0x8a')],_0x36b2d0));}}});return Promise[_0x5957('0x93')](_0x2da004);})[_0x5957('0xd')](function(_0x460294){_0x58e63c=_0x460294[0x0];var _0x204f28=[];var _0x49c8ba=[];_0x52a360[_0x5957('0x8f')](function(_0x15959e){if(_0x15959e['@odata.type']){var _0x5d3fa1=_0x15959e['@odata.type'][_0x5957('0x3e')](_0x15959e[_0x5957('0x90')][_0x5957('0x3f')]('.')+0x1);if(_0x5d3fa1===_0x5957('0x95')||_0x5d3fa1===_0x5957('0x96')||_0x5d3fa1===_0x5957('0x97')||_0x5d3fa1===_0x5957('0x98')||_0x5d3fa1===_0x5957('0x99')||_0x5d3fa1===_0x5957('0x9a')||_0x5d3fa1==='StatusAttributeMetadata'||_0x5d3fa1===_0x5957('0x9b')||_0x5d3fa1==='StateAttributeMetadata'||_0x5d3fa1==='DecimalAttributeMetadata'){_0x204f28[_0x5957('0x92')](getInputList(_0x36705a,_0x2c72fb,_0x5d3fa1,_0x49c8ba,_0x39dfa7[_0x5957('0x8a')],_0x15959e[_0x5957('0x8a')],_0x36b2d0));}}});return Promise['all'](_0x204f28);})[_0x5957('0xd')](function(_0x25d5a1){_0x30d3f0=_0x25d5a1[0x0];var _0x4d97f8=_0x271d46[_0x5957('0x79')](_0x58e63c)[_0x5957('0x79')](_0x30d3f0);var _0x4db00f={'count':_0x4d97f8['length'],'rows':_0x4d97f8};return _0x4db00f;})[_0x5957('0xd')](respondWithResult(_0xb1fcc,null))['catch'](function(_0x37f496){var _0x26a4a0=_0x371b2c[_0x5957('0x19')]['test']?0x1f4:_0x37f496[_0x5957('0x9c')]||0x1f4;logger[_0x5957('0xf')](_0x37f496[_0x5957('0x9d')]);delete _0x37f496[_0x5957('0x10')];if(_0x26a4a0===0x191){_0x26a4a0=0x190;}_0xb1fcc[_0x5957('0x6')](_0x26a4a0)[_0x5957('0x9e')](_0x371b2c['query'][_0x5957('0x9f')]?{'message':'Wrong\x20credentials','statusCode':_0x37f496[_0x5957('0x9c')]}:_0x37f496);});};function getSelectList(_0x24e066,_0x3f3868,_0x36f4fc,_0x4f07b5,_0x118087,_0x162b05){var _0x5377a6={'method':_0x5957('0x8b'),'uri':_0x24e066+_0x5957('0xa0')+_0x4f07b5+_0x5957('0xa1')+_0x118087+_0x5957('0xa2')+_0x5957('0xa3'),'headers':{'Authorization':_0x5957('0x88')+_0x162b05,'If-None-Match':null,'OData-Version':_0x5957('0x89')},'json':!![]};return rp(_0x5377a6)['then'](function(_0x15153c){var _0x16acae=[];var _0x25a7c5=_0x15153c[_0x5957('0xa4')][_0x5957('0xa5')];_0x25a7c5[_0x5957('0x8f')](function(_0x1f5d14){_0x16acae[_0x5957('0x92')]({'name':_0x1f5d14[_0x5957('0xa6')]['UserLocalizedLabel']['Label'],'value':String(_0x1f5d14[_0x5957('0xa7')])});});var _0x411a0c={'id':_0x3f3868+'_'+_0x15153c['LogicalName'],'name':_0x15153c[_0x5957('0xa8')]['UserLocalizedLabel'][_0x5957('0xa6')],'custom':![],'options':_0x16acae};_0x36f4fc[_0x5957('0x92')](_0x411a0c);return _0x36f4fc;});}function getBooleanList(_0x59280d,_0xbc5e6e,_0x57ed19,_0x3d6093,_0xcef101,_0x13ec85){var _0x4e68a8={'method':_0x5957('0x8b'),'uri':_0x59280d+'EntityDefinitions('+_0x3d6093+_0x5957('0xa1')+_0xcef101+_0x5957('0xa9'),'headers':{'Authorization':_0x5957('0x88')+_0x13ec85,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4e68a8)['then'](function(_0x1b29c5){var _0x17068a=[];_0x17068a['push']({'name':_0x1b29c5[_0x5957('0xa4')]['TrueOption'][_0x5957('0xa6')]['UserLocalizedLabel'][_0x5957('0xa6')],'value':_0x5957('0xaa')},{'name':_0x1b29c5[_0x5957('0xa4')][_0x5957('0xab')][_0x5957('0xa6')][_0x5957('0xac')]['Label'],'value':_0x5957('0xad')});var _0x178d91={'id':_0xbc5e6e+'_'+_0x1b29c5[_0x5957('0xae')],'name':_0x1b29c5[_0x5957('0xa8')][_0x5957('0xac')][_0x5957('0xa6')],'custom':![],'options':_0x17068a};_0x57ed19[_0x5957('0x92')](_0x178d91);return _0x57ed19;});}function getInputList(_0x2582e6,_0x388d1f,_0x342d98,_0x51ecc3,_0x3077a0,_0x1b555c,_0x2e8d2b){var _0x485b13={'method':_0x5957('0x8b'),'uri':_0x2582e6+_0x5957('0xa0')+_0x3077a0+_0x5957('0xa1')+_0x1b555c+_0x5957('0xaf')+_0x342d98+_0x5957('0xb0'),'headers':{'Authorization':'Bearer\x20'+_0x2e8d2b,'If-None-Match':null,'OData-Version':_0x5957('0x89')},'json':!![]};return rp(_0x485b13)[_0x5957('0xd')](function(_0x274a30){var _0x1af160={'id':_0x388d1f+'_'+_0x274a30[_0x5957('0xae')],'name':_0x274a30[_0x5957('0xa8')][_0x5957('0xac')]?_0x274a30[_0x5957('0xa8')]['UserLocalizedLabel'][_0x5957('0xa6')]:_0x274a30[_0x5957('0xae')],'custom':![],'options':[]};_0x51ecc3[_0x5957('0x92')](_0x1af160);return _0x51ecc3;});}
\ No newline at end of file
+var _0x76d2=['Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','accountidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdon','createdonbehalfbyyominame','customeridname','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','socialprofileidname','statecode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','password','tenantId','clientId','modernAuthentication','CloudProvider','data5','data7','access_token','remoteUri','POST','https://login.microsoftonline.com/','/oauth2/token','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','MetadataId','Attributes','remove','includes','LogicalName','forEach','@odata.type','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','Wrong\x20credentials','statusCode','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Bearer\x20','OptionSet','Label','UserLocalizedLabel','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false','?$select=DisplayName,LogicalName','util','lodash','../../components/parsers/qs','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','end','error','stack','send','Dynamics365Account','fieldName','type','model','name','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','findAll','rows','show','length','includeAll','include','find','catch','create','body','update','params','getConfigurations','findOne','Dynamics365Configuration','rawAttributes','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','Dynamics365Field','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType'];(function(_0x4d7563,_0x4c3f27){var _0x44946b=function(_0x27798a){while(--_0x27798a){_0x4d7563['push'](_0x4d7563['shift']());}};_0x44946b(++_0x4c3f27);}(_0x76d2,0x6e));var _0x276d=function(_0x75ffda,_0x556b04){_0x75ffda=_0x75ffda-0x0;var _0x3971da=_0x76d2[_0x75ffda];return _0x3971da;};'use strict';var rp=require('request-promise');var util=require(_0x276d('0x0'));var _=require(_0x276d('0x1'));var qs=require(_0x276d('0x2'));var logger=require('../../config/logger')('api');var db=require(_0x276d('0x3'))['db'];var integrations=require(_0x276d('0x4'));function respondWithResult(_0x59fd2f,_0x535202){_0x535202=_0x535202||0xc8;return function(_0x4de732){if(_0x4de732){return _0x59fd2f[_0x276d('0x5')](_0x535202)[_0x276d('0x6')](_0x4de732);}};}function respondWithFilteredResult(_0x54dd31,_0x553d96){return function(_0x5762ec){if(_0x5762ec){var _0xd67f4=typeof _0x553d96[_0x276d('0x7')]===_0x276d('0x8')&&typeof _0x553d96[_0x276d('0x9')]===_0x276d('0x8');var _0x206671=_0x5762ec[_0x276d('0xa')];var _0xe4204d=_0xd67f4?0x0:_0x553d96[_0x276d('0x7')];var _0x1b9782=_0xd67f4?_0x5762ec['count']:_0x553d96['offset']+_0x553d96[_0x276d('0x9')];var _0x26b29c;if(_0x1b9782>=_0x206671){_0x1b9782=_0x206671;_0x26b29c=0xc8;}else{_0x26b29c=0xce;}_0x54dd31[_0x276d('0x5')](_0x26b29c);return _0x54dd31[_0x276d('0xb')](_0x276d('0xc'),_0xe4204d+'-'+_0x1b9782+'/'+_0x206671)['json'](_0x5762ec);}return null;};}function saveUpdates(_0x266d3e){return function(_0x4e0ee8){if(_0x4e0ee8){return _0x4e0ee8['update'](_0x266d3e)[_0x276d('0xd')](function(_0x54c97b){return _0x54c97b;});}return null;};}function removeEntity(_0xb7359){return function(_0x445010){if(_0x445010){return _0x445010[_0x276d('0xe')]()['then'](function(){_0xb7359[_0x276d('0x5')](0xcc)[_0x276d('0xf')]();});}};}function handleEntityNotFound(_0x3149cd){return function(_0x14d9a8){if(!_0x14d9a8){_0x3149cd['sendStatus'](0x194);}return _0x14d9a8;};}function handleError(_0xe7e153,_0x143a77){_0x143a77=_0x143a77||0x1f4;return function(_0x4310f4){logger[_0x276d('0x10')](_0x4310f4[_0x276d('0x11')]);if(_0x4310f4['name']){delete _0x4310f4['name'];}_0xe7e153[_0x276d('0x5')](_0x143a77)[_0x276d('0x12')](_0x4310f4);};}exports['index']=function(_0x192282,_0x3839ce){var _0x5d67cd={},_0x34188f={},_0x115aeb={'count':0x0,'rows':[]};var _0x49dc58=_['map'](db[_0x276d('0x13')]['rawAttributes'],function(_0x17eef8){return{'name':_0x17eef8[_0x276d('0x14')],'type':_0x17eef8[_0x276d('0x15')]['key']};});_0x34188f[_0x276d('0x16')]=_['map'](_0x49dc58,_0x276d('0x17'));_0x34188f['query']=_[_0x276d('0x18')](_0x192282[_0x276d('0x19')]);_0x34188f[_0x276d('0x1a')]=_[_0x276d('0x1b')](_0x34188f[_0x276d('0x16')],_0x34188f['query']);_0x5d67cd[_0x276d('0x1c')]=_[_0x276d('0x1b')](_0x34188f[_0x276d('0x16')],qs[_0x276d('0x1d')](_0x192282[_0x276d('0x19')][_0x276d('0x1d')]));_0x5d67cd[_0x276d('0x1c')]=_0x5d67cd['attributes']['length']?_0x5d67cd[_0x276d('0x1c')]:_0x34188f[_0x276d('0x16')];if(!_0x192282[_0x276d('0x19')][_0x276d('0x1e')](_0x276d('0x1f'))){_0x5d67cd[_0x276d('0x9')]=qs[_0x276d('0x9')](_0x192282['query']['limit']);_0x5d67cd[_0x276d('0x7')]=qs[_0x276d('0x7')](_0x192282[_0x276d('0x19')][_0x276d('0x7')]);}_0x5d67cd[_0x276d('0x20')]=qs[_0x276d('0x21')](_0x192282[_0x276d('0x19')][_0x276d('0x21')]);_0x5d67cd[_0x276d('0x22')]=qs[_0x276d('0x1a')](_[_0x276d('0x23')](_0x192282[_0x276d('0x19')],_0x34188f[_0x276d('0x1a')]),_0x49dc58);if(_0x192282[_0x276d('0x19')][_0x276d('0x24')]){_0x5d67cd[_0x276d('0x22')]=_[_0x276d('0x25')](_0x5d67cd[_0x276d('0x22')],{'$or':_[_0x276d('0x26')](_0x49dc58,function(_0x8eb30c){if(_0x8eb30c[_0x276d('0x15')]!=='VIRTUAL'){var _0x3ed909={};_0x3ed909[_0x8eb30c[_0x276d('0x17')]]={'$like':'%'+_0x192282[_0x276d('0x19')]['filter']+'%'};return _0x3ed909;}})});}_0x5d67cd=_[_0x276d('0x25')]({},_0x5d67cd,_0x192282[_0x276d('0x27')]);var _0x178ada={'where':_0x5d67cd[_0x276d('0x22')]};return db[_0x276d('0x13')]['count'](_0x178ada)[_0x276d('0xd')](function(_0x42432){_0x115aeb['count']=_0x42432;if(_0x192282[_0x276d('0x19')]['includeAll']){_0x5d67cd['include']=[{'all':!![]}];}return db[_0x276d('0x13')][_0x276d('0x28')](_0x5d67cd);})[_0x276d('0xd')](function(_0x25313b){_0x115aeb[_0x276d('0x29')]=_0x25313b;return _0x115aeb;})[_0x276d('0xd')](respondWithFilteredResult(_0x3839ce,_0x5d67cd))['catch'](handleError(_0x3839ce,null));};exports[_0x276d('0x2a')]=function(_0x590685,_0x3f4d75){var _0x543efb={'raw':![],'where':{'id':_0x590685['params']['id']}},_0x60328a={};_0x60328a[_0x276d('0x16')]=_[_0x276d('0x18')](db[_0x276d('0x13')]['rawAttributes']);_0x60328a[_0x276d('0x19')]=_[_0x276d('0x18')](_0x590685[_0x276d('0x19')]);_0x60328a[_0x276d('0x1a')]=_[_0x276d('0x1b')](_0x60328a[_0x276d('0x16')],_0x60328a[_0x276d('0x19')]);_0x543efb[_0x276d('0x1c')]=_['intersection'](_0x60328a[_0x276d('0x16')],qs[_0x276d('0x1d')](_0x590685[_0x276d('0x19')][_0x276d('0x1d')]));_0x543efb[_0x276d('0x1c')]=_0x543efb[_0x276d('0x1c')][_0x276d('0x2b')]?_0x543efb[_0x276d('0x1c')]:_0x60328a['model'];if(_0x590685[_0x276d('0x19')][_0x276d('0x2c')]){_0x543efb[_0x276d('0x2d')]=[{'all':!![]}];}_0x543efb=_[_0x276d('0x25')]({},_0x543efb,_0x590685[_0x276d('0x27')]);return db['Dynamics365Account'][_0x276d('0x2e')](_0x543efb)['then'](handleEntityNotFound(_0x3f4d75,null))[_0x276d('0xd')](respondWithResult(_0x3f4d75,null))[_0x276d('0x2f')](handleError(_0x3f4d75,null));};exports[_0x276d('0x30')]=function(_0x573f08,_0x5e4860){return db[_0x276d('0x13')][_0x276d('0x30')](_0x573f08[_0x276d('0x31')],{})[_0x276d('0xd')](respondWithResult(_0x5e4860,0xc9))[_0x276d('0x2f')](handleError(_0x5e4860,null));};exports[_0x276d('0x32')]=function(_0x46a4ca,_0x47895e){if(_0x46a4ca['body']['id']){delete _0x46a4ca[_0x276d('0x31')]['id'];}return db[_0x276d('0x13')][_0x276d('0x2e')]({'where':{'id':_0x46a4ca['params']['id']}})[_0x276d('0xd')](handleEntityNotFound(_0x47895e,null))['then'](saveUpdates(_0x46a4ca[_0x276d('0x31')],null))[_0x276d('0xd')](respondWithResult(_0x47895e,null))['catch'](handleError(_0x47895e,null));};exports['destroy']=function(_0x4be0ce,_0x191fdb){return db[_0x276d('0x13')][_0x276d('0x2e')]({'where':{'id':_0x4be0ce[_0x276d('0x33')]['id']}})[_0x276d('0xd')](handleEntityNotFound(_0x191fdb,null))['then'](removeEntity(_0x191fdb,null))[_0x276d('0x2f')](handleError(_0x191fdb,null));};exports[_0x276d('0x34')]=function(_0x515557,_0x4d9dfc){var _0x3cab45={};var _0x5200f0={};var _0x4fc001;var _0xf882e4;return db['Dynamics365Account'][_0x276d('0x35')]({'where':{'id':_0x515557[_0x276d('0x33')]['id']}})[_0x276d('0xd')](handleEntityNotFound(_0x4d9dfc,null))[_0x276d('0xd')](function(_0x3b2d6a){if(_0x3b2d6a){_0x4fc001=_0x3b2d6a;_0x5200f0['model']=_[_0x276d('0x18')](db[_0x276d('0x36')][_0x276d('0x37')]);_0x5200f0['query']=_[_0x276d('0x18')](_0x515557[_0x276d('0x19')]);_0x5200f0['filters']=_['intersection'](_0x5200f0[_0x276d('0x16')],_0x5200f0[_0x276d('0x19')]);_0x3cab45['attributes']=_[_0x276d('0x1b')](_0x5200f0[_0x276d('0x16')],qs[_0x276d('0x1d')](_0x515557['query']['fields']));_0x3cab45[_0x276d('0x1c')]=_0x3cab45[_0x276d('0x1c')][_0x276d('0x2b')]?_0x3cab45['attributes']:_0x5200f0[_0x276d('0x16')];_0x3cab45[_0x276d('0x20')]=qs[_0x276d('0x21')](_0x515557['query']['sort']);_0x3cab45[_0x276d('0x22')]=qs[_0x276d('0x1a')](_[_0x276d('0x23')](_0x515557[_0x276d('0x19')],_0x5200f0[_0x276d('0x1a')]));if(_0x515557['query'][_0x276d('0x24')]){_0x3cab45[_0x276d('0x22')]=_[_0x276d('0x25')](_0x3cab45[_0x276d('0x22')],{'$or':_[_0x276d('0x26')](_0x3cab45['attributes'],function(_0xa06c9d){var _0x22db54={};_0x22db54[_0xa06c9d]={'$like':'%'+_0x515557[_0x276d('0x19')][_0x276d('0x24')]+'%'};return _0x22db54;})});}_0x3cab45=_['merge']({},_0x3cab45,_0x515557[_0x276d('0x27')]);return _0x4fc001[_0x276d('0x34')](_0x3cab45);}})['then'](function(_0x4491d7){if(_0x4491d7){_0xf882e4=_0x4491d7['length'];if(!_0x515557[_0x276d('0x19')][_0x276d('0x1e')](_0x276d('0x1f'))){_0x3cab45[_0x276d('0x9')]=qs[_0x276d('0x9')](_0x515557[_0x276d('0x19')][_0x276d('0x9')]);_0x3cab45[_0x276d('0x7')]=qs[_0x276d('0x7')](_0x515557['query'][_0x276d('0x7')]);}return _0x4fc001[_0x276d('0x34')](_0x3cab45);}})[_0x276d('0xd')](function(_0x2a0c7c){if(_0x2a0c7c){return _0x2a0c7c?{'count':_0xf882e4,'rows':_0x2a0c7c}:null;}})['then'](respondWithResult(_0x4d9dfc,null))[_0x276d('0x2f')](handleError(_0x4d9dfc,null));};exports[_0x276d('0x38')]=function(_0x5bf993,_0x2c8ca7){if(_0x5bf993[_0x276d('0x31')]['id']){delete _0x5bf993[_0x276d('0x31')]['id'];}return db[_0x276d('0x13')][_0x276d('0x35')]({'where':{'id':_0x5bf993[_0x276d('0x33')]['id']}})[_0x276d('0xd')](handleEntityNotFound(_0x2c8ca7,null))[_0x276d('0xd')](function(_0x57683a){if(_0x57683a){_0x5bf993['body'][_0x276d('0x39')]=_0x57683a['id'];_0x5bf993[_0x276d('0x31')][_0x276d('0x3a')]=integrations[_0x276d('0x3b')](_0x5bf993[_0x276d('0x31')]['channel'],_0x5bf993['body'][_0x276d('0x15')]);_0x5bf993['body'][_0x276d('0x3c')]=integrations[_0x276d('0x3d')](_0x5bf993[_0x276d('0x31')]['channel'],_0x5bf993[_0x276d('0x31')]['type']);return db[_0x276d('0x36')]['create'](_0x5bf993[_0x276d('0x31')],{'include':[{'model':db[_0x276d('0x3e')],'as':'Subjects'},{'model':db[_0x276d('0x3e')],'as':_0x276d('0x3c')}]});}return null;})[_0x276d('0xd')](respondWithResult(_0x2c8ca7,null))[_0x276d('0x2f')](handleError(_0x2c8ca7,null));};function sanitizeRemoteUri(_0x3731f5){var _0x28cf81=_0x3731f5[_0x276d('0x3f')](-0x1);if(_0x28cf81==='/')return _0x3731f5[_0x276d('0x40')](0x0,_0x3731f5[_0x276d('0x41')](_0x28cf81));return _0x3731f5;}function getWebApiUrl(_0x235563){return util[_0x276d('0x42')](_0x276d('0x43'),_0x235563);}exports[_0x276d('0x44')]=function(_0x53b3fa,_0x463199){var _0x18822e=_0x53b3fa[_0x276d('0x19')][_0x276d('0x45')];var _0x3e002f=_0x18822e==='incident'?_0x276d('0x46'):_0x276d('0x47');var _0x431796='';var _0x6fd64d='';var _0x6303f5='';var _0x125f35='';var _0x262a44='';var _0x442c53='';var _0x3b3859='';var _0x98b2b5='';var _0x15c108=[_0x276d('0x48'),_0x276d('0x49'),_0x276d('0x4a'),_0x276d('0x4b'),_0x276d('0x4c'),'subject',_0x276d('0x4d'),_0x276d('0x4e'),_0x276d('0x4f'),'phonecall_activity_parties'];var _0x3ff3a3=['accountidname',_0x276d('0x50'),'actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname',_0x276d('0x51'),_0x276d('0x52'),_0x276d('0x53'),'createdbyname','createdbyyominame',_0x276d('0x54'),'createdonbehalfbyname',_0x276d('0x55'),_0x276d('0x56'),'customeridtype','customeridyominame',_0x276d('0x57'),_0x276d('0x58'),_0x276d('0x59'),_0x276d('0x5a'),_0x276d('0x5b'),_0x276d('0x5c'),_0x276d('0x5d'),'followupby','importsequencenumber','influencescore',_0x276d('0x5e'),_0x276d('0x5f'),_0x276d('0x60'),'modifiedbyexternalpartyname',_0x276d('0x61'),_0x276d('0x62'),_0x276d('0x63'),_0x276d('0x64'),'modifiedonbehalfbyname','modifiedonbehalfbyyominame',_0x276d('0x65'),_0x276d('0x66'),_0x276d('0x67'),_0x276d('0x68'),_0x276d('0x69'),'owneridname','owneridtype',_0x276d('0x6a'),_0x276d('0x6b'),'primarycontactidname',_0x276d('0x6c'),_0x276d('0x6d'),_0x276d('0x6e'),_0x276d('0x6f'),_0x276d('0x70'),_0x276d('0x71'),_0x276d('0x72'),_0x276d('0x73'),'responsiblecontactidyominame',_0x276d('0x74'),'slainvokedidname','slaname',_0x276d('0x75'),_0x276d('0x76'),'statuscode','subjectidname',_0x276d('0x77'),_0x276d('0x78'),_0x276d('0x79'),_0x276d('0x7a'),_0x276d('0x7b'),'versionnumber'];var _0x28b205=_0x15c108[_0x276d('0x7c')](_0x3ff3a3);return db['Dynamics365Account'][_0x276d('0x35')]({'where':{'id':_0x53b3fa[_0x276d('0x33')]['id']},'attributes':['id',_0x276d('0x7d'),_0x276d('0x7e'),'remoteUri',_0x276d('0x7f'),_0x276d('0x80'),'clientSecret',_0x276d('0x81')],'include':[{'model':db['CloudProvider'],'as':_0x276d('0x82'),'attributes':['id',_0x276d('0x83'),_0x276d('0x84')]}]})[_0x276d('0xd')](handleEntityNotFound(_0x463199,null))[_0x276d('0xd')](function(_0x20c87a){if(_0x20c87a){if(_0x20c87a[_0x276d('0x81')]){_0x20c87a[_0x276d('0x85')]=_0x20c87a['CloudProvider']['data5'];_0x98b2b5=sanitizeRemoteUri(_0x20c87a[_0x276d('0x82')][_0x276d('0x84')]);_0x3b3859=getWebApiUrl(_0x98b2b5);return _0x20c87a;}_0x98b2b5=sanitizeRemoteUri(_0x20c87a[_0x276d('0x86')]);_0x3b3859=getWebApiUrl(_0x98b2b5);var _0x246342={'method':_0x276d('0x87'),'uri':_0x276d('0x88')+_0x20c87a[_0x276d('0x7f')]+_0x276d('0x89'),'form':{'client_id':_0x20c87a[_0x276d('0x80')],'resource':_0x98b2b5,'username':_0x20c87a[_0x276d('0x7d')],'password':_0x20c87a[_0x276d('0x7e')],'grant_type':_0x276d('0x7e'),'client_secret':_0x20c87a[_0x276d('0x8a')]},'json':!![]};return rp(_0x246342);}})[_0x276d('0xd')](function(_0x36dfa4){_0x442c53=_0x36dfa4[_0x276d('0x85')];var _0x4fc194={'method':_0x276d('0x8b'),'uri':encodeURI(_0x3b3859+_0x276d('0x8c')+_0x3e002f+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x442c53,'If-None-Match':null,'OData-Version':_0x276d('0x8d')},'json':!![]};return rp(_0x4fc194);})['then'](function(_0xa89b60){var _0x33f544=_0xa89b60[_0x276d('0x8e')][0x0];var _0x193504=_0x33f544[_0x276d('0x8f')];var _0x12783f={'method':'GET','uri':_0x3b3859+'EntityDefinitions('+_0x193504+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x442c53,'If-None-Match':null,'OData-Version':_0x276d('0x8d')},'json':!![]};return rp(_0x12783f);})[_0x276d('0xd')](function(_0x3cb542){_0x431796=_0x3cb542;_0x6fd64d=_0x431796[_0x276d('0x90')];_0x6fd64d=_[_0x276d('0x91')](_0x6fd64d,function(_0x24043d){return!_0x28b205[_0x276d('0x92')](_0x24043d[_0x276d('0x93')]);});var _0x5aa823=[];var _0x24e13d=[];_0x6fd64d[_0x276d('0x94')](function(_0x2f3671){if(_0x2f3671[_0x276d('0x95')]){var _0x5e6d94=_0x2f3671['@odata.type'][_0x276d('0x40')](_0x2f3671[_0x276d('0x95')][_0x276d('0x41')]('.')+0x1);if(_0x5e6d94==='PicklistAttributeMetadata'){_0x5aa823[_0x276d('0x96')](getSelectList(_0x3b3859,_0x18822e,_0x24e13d,_0x431796[_0x276d('0x8f')],_0x2f3671[_0x276d('0x8f')],_0x442c53));}}});return Promise[_0x276d('0x97')](_0x5aa823);})['then'](function(_0x449046){_0x6303f5=_0x449046[0x0];var _0x37b7ae=[];var _0x5489b=[];_0x6fd64d[_0x276d('0x94')](function(_0x3d639c){if(!_[_0x276d('0x98')](_0x3d639c[_0x276d('0x95')])){var _0x13ddc4=_0x3d639c[_0x276d('0x95')][_0x276d('0x40')](_0x3d639c[_0x276d('0x95')][_0x276d('0x41')]('.')+0x1);if(_0x13ddc4===_0x276d('0x99')){_0x37b7ae[_0x276d('0x96')](getBooleanList(_0x3b3859,_0x18822e,_0x5489b,_0x431796[_0x276d('0x8f')],_0x3d639c['MetadataId'],_0x442c53));}}});return Promise[_0x276d('0x97')](_0x37b7ae);})['then'](function(_0x1fbe6a){_0x125f35=_0x1fbe6a[0x0];var _0x3c3586=[];var _0x101c4f=[];_0x6fd64d[_0x276d('0x94')](function(_0x105f96){if(_0x105f96[_0x276d('0x95')]){var _0x9b8902=_0x105f96[_0x276d('0x95')][_0x276d('0x40')](_0x105f96[_0x276d('0x95')][_0x276d('0x41')]('.')+0x1);if(_0x9b8902===_0x276d('0x9a')||_0x9b8902===_0x276d('0x9b')||_0x9b8902===_0x276d('0x9c')||_0x9b8902===_0x276d('0x9d')||_0x9b8902===_0x276d('0x9e')||_0x9b8902===_0x276d('0x9f')||_0x9b8902==='StatusAttributeMetadata'||_0x9b8902===_0x276d('0xa0')||_0x9b8902==='StateAttributeMetadata'||_0x9b8902===_0x276d('0xa1')){_0x3c3586[_0x276d('0x96')](getInputList(_0x3b3859,_0x18822e,_0x9b8902,_0x101c4f,_0x431796[_0x276d('0x8f')],_0x105f96[_0x276d('0x8f')],_0x442c53));}}});return Promise[_0x276d('0x97')](_0x3c3586);})[_0x276d('0xd')](function(_0x21f3c9){_0x262a44=_0x21f3c9[0x0];var _0x13606e=_0x6303f5['concat'](_0x125f35)[_0x276d('0x7c')](_0x262a44);var _0x4a5468={'count':_0x13606e[_0x276d('0x2b')],'rows':_0x13606e};return _0x4a5468;})[_0x276d('0xd')](respondWithResult(_0x463199,null))[_0x276d('0x2f')](function(_0x50a46b){var _0x437f51=_0x53b3fa[_0x276d('0x19')][_0x276d('0xa2')]?0x1f4:_0x50a46b['statusCode']||0x1f4;logger['error'](_0x50a46b[_0x276d('0x11')]);delete _0x50a46b[_0x276d('0x17')];if(_0x437f51===0x191){_0x437f51=0x190;}_0x463199['status'](_0x437f51)[_0x276d('0x12')](_0x53b3fa[_0x276d('0x19')]['test']?{'message':_0x276d('0xa3'),'statusCode':_0x50a46b[_0x276d('0xa4')]}:_0x50a46b);});};function getSelectList(_0x5b982c,_0x448be5,_0x3efa2d,_0x7d408,_0x361856,_0x1286c7){var _0x1c1179={'method':_0x276d('0x8b'),'uri':_0x5b982c+_0x276d('0xa5')+_0x7d408+_0x276d('0xa6')+_0x361856+_0x276d('0xa7')+_0x276d('0xa8'),'headers':{'Authorization':_0x276d('0xa9')+_0x1286c7,'If-None-Match':null,'OData-Version':_0x276d('0x8d')},'json':!![]};return rp(_0x1c1179)[_0x276d('0xd')](function(_0x361dd3){var _0x51b150=[];var _0x1ffe34=_0x361dd3[_0x276d('0xaa')]['Options'];_0x1ffe34[_0x276d('0x94')](function(_0x3b8365){_0x51b150[_0x276d('0x96')]({'name':_0x3b8365[_0x276d('0xab')][_0x276d('0xac')][_0x276d('0xab')],'value':String(_0x3b8365[_0x276d('0xad')])});});var _0x149978={'id':_0x448be5+'_'+_0x361dd3['LogicalName'],'name':_0x361dd3[_0x276d('0xae')][_0x276d('0xac')][_0x276d('0xab')],'custom':![],'options':_0x51b150};_0x3efa2d['push'](_0x149978);return _0x3efa2d;});}function getBooleanList(_0x2c054d,_0x3dcc9b,_0x798325,_0x266747,_0x70f870,_0xbed40e){var _0x53b27f={'method':'GET','uri':_0x2c054d+_0x276d('0xa5')+_0x266747+_0x276d('0xa6')+_0x70f870+_0x276d('0xaf'),'headers':{'Authorization':_0x276d('0xa9')+_0xbed40e,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x53b27f)[_0x276d('0xd')](function(_0x25f725){var _0x3f49c7=[];_0x3f49c7[_0x276d('0x96')]({'name':_0x25f725[_0x276d('0xaa')][_0x276d('0xb0')][_0x276d('0xab')][_0x276d('0xac')][_0x276d('0xab')],'value':_0x276d('0xb1')},{'name':_0x25f725[_0x276d('0xaa')]['FalseOption'][_0x276d('0xab')][_0x276d('0xac')][_0x276d('0xab')],'value':_0x276d('0xb2')});var _0x56187f={'id':_0x3dcc9b+'_'+_0x25f725[_0x276d('0x93')],'name':_0x25f725[_0x276d('0xae')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x3f49c7};_0x798325[_0x276d('0x96')](_0x56187f);return _0x798325;});}function getInputList(_0x590cf7,_0x378682,_0x47bbe2,_0x9244bf,_0x50ebd9,_0x2e3f00,_0xa110ab){var _0x4d1328={'method':_0x276d('0x8b'),'uri':_0x590cf7+'EntityDefinitions('+_0x50ebd9+_0x276d('0xa6')+_0x2e3f00+')/Microsoft.Dynamics.CRM.'+_0x47bbe2+_0x276d('0xb3'),'headers':{'Authorization':_0x276d('0xa9')+_0xa110ab,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4d1328)[_0x276d('0xd')](function(_0x535636){var _0x2c29e7={'id':_0x378682+'_'+_0x535636[_0x276d('0x93')],'name':_0x535636[_0x276d('0xae')][_0x276d('0xac')]?_0x535636[_0x276d('0xae')][_0x276d('0xac')][_0x276d('0xab')]:_0x535636[_0x276d('0x93')],'custom':![],'options':[]};_0x9244bf[_0x276d('0x96')](_0x2c29e7);return _0x9244bf;});}
\ No newline at end of file
index ddcde63..fba484a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0xadde88,_0x58ad47){var _0x3b8eb6=function(_0x15535a){while(--_0x15535a){_0xadde88['push'](_0xadde88['shift']());}};_0x3b8eb6(++_0x58ad47);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x177f94,_0x5ee70b){var _0x1f3783=function(_0x1d94c4){while(--_0x1d94c4){_0x177f94['push'](_0x177f94['shift']());}};_0x1f3783(++_0x5ee70b);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6517ae2..2cf58e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x091f=['message','catch','Dynamics365Account','findAll','options','raw','where','attributes','include','map','model','then','GetDynamics365Account','find','ShowDynamics365Account','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x3fcf59,_0x3df8f9){var _0x250d7a=function(_0x4194c4){while(--_0x4194c4){_0x3fcf59['push'](_0x3fcf59['shift']());}};_0x250d7a(++_0x3df8f9);}(_0x091f,0x72));var _0xf091=function(_0x25d4b1,_0x4e896d){_0x25d4b1=_0x25d4b1-0x0;var _0x2d51a5=_0x091f[_0x25d4b1];return _0x2d51a5;};'use strict';var _=require(_0xf091('0x0'));var util=require(_0xf091('0x1'));var moment=require(_0xf091('0x2'));var BPromise=require(_0xf091('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf091('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf091('0x5'));var logger=require(_0xf091('0x6'))(_0xf091('0x7'));var config=require('../../config/environment');var jayson=require(_0xf091('0x8'));var client=jayson[_0xf091('0x9')][_0xf091('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe984a5,_0xdd654a,_0x3d8fcb){return new BPromise(function(_0x3666ad,_0x8b07b5){return client['request'](_0xe984a5,_0x3d8fcb)['then'](function(_0x1e48b8){logger[_0xf091('0xb')](_0xf091('0xc'),_0xdd654a,_0xf091('0xd'));logger[_0xf091('0xe')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0xdd654a,_0xf091('0xd'),JSON[_0xf091('0xf')](_0x1e48b8));if(_0x1e48b8[_0xf091('0x10')]){if(_0x1e48b8[_0xf091('0x10')][_0xf091('0x11')]===0x1f4){logger[_0xf091('0x10')](_0xf091('0xc'),_0xdd654a,_0x1e48b8['error'][_0xf091('0x12')]);return _0x8b07b5(_0x1e48b8[_0xf091('0x10')]['message']);}logger[_0xf091('0x10')](_0xf091('0xc'),_0xdd654a,_0x1e48b8[_0xf091('0x10')]['message']);return _0x3666ad(_0x1e48b8['error'][_0xf091('0x12')]);}else{logger['info'](_0xf091('0xc'),_0xdd654a,_0xf091('0xd'));_0x3666ad(_0x1e48b8['result'][_0xf091('0x12')]);}})[_0xf091('0x13')](function(_0x5ec59c){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0xdd654a,_0x5ec59c);_0x8b07b5(_0x5ec59c);});});}exports['GetDynamics365Account']=function(_0x22e9b5){var _0x2eeed5=this;return new Promise(function(_0x381e0d,_0x236462){return db[_0xf091('0x14')][_0xf091('0x15')]({'raw':_0x22e9b5[_0xf091('0x16')]?_0x22e9b5[_0xf091('0x16')][_0xf091('0x17')]===undefined?!![]:![]:!![],'where':_0x22e9b5['options']?_0x22e9b5[_0xf091('0x16')][_0xf091('0x18')]||null:null,'attributes':_0x22e9b5[_0xf091('0x16')]?_0x22e9b5['options'][_0xf091('0x19')]||null:null,'limit':_0x22e9b5['options']?_0x22e9b5[_0xf091('0x16')]['limit']||null:null,'include':_0x22e9b5[_0xf091('0x16')]?_0x22e9b5[_0xf091('0x16')][_0xf091('0x1a')]?_['map'](_0x22e9b5[_0xf091('0x16')][_0xf091('0x1a')],function(_0x219f6d){return{'model':db[_0x219f6d['model']],'as':_0x219f6d['as'],'attributes':_0x219f6d[_0xf091('0x19')],'include':_0x219f6d[_0xf091('0x1a')]?_[_0xf091('0x1b')](_0x219f6d[_0xf091('0x1a')],function(_0x4a8ccc){return{'model':db[_0x4a8ccc[_0xf091('0x1c')]],'as':_0x4a8ccc['as'],'attributes':_0x4a8ccc[_0xf091('0x19')],'include':_0x4a8ccc[_0xf091('0x1a')]?_[_0xf091('0x1b')](_0x4a8ccc['include'],function(_0x4f73ba){return{'model':db[_0x4f73ba[_0xf091('0x1c')]],'as':_0x4f73ba['as'],'attributes':_0x4f73ba[_0xf091('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf091('0x1d')](function(_0x37a24d){logger['info'](_0xf091('0x1e'),_0x22e9b5);logger[_0xf091('0xe')]('GetDynamics365Account',_0x22e9b5,JSON['stringify'](_0x37a24d));_0x381e0d(_0x37a24d);})[_0xf091('0x13')](function(_0x4eb6ac){logger['error'](_0xf091('0x1e'),_0x4eb6ac[_0xf091('0x12')],_0x22e9b5);_0x236462(_0x2eeed5[_0xf091('0x10')](0x1f4,_0x4eb6ac[_0xf091('0x12')]));});});};exports['ShowDynamics365Account']=function(_0x47ead0){var _0x5ab7d2=this;return new Promise(function(_0xbbfe7a,_0xa12fec){return db['Dynamics365Account'][_0xf091('0x1f')]({'raw':_0x47ead0[_0xf091('0x16')]?_0x47ead0[_0xf091('0x16')][_0xf091('0x17')]===undefined?!![]:![]:!![],'where':_0x47ead0[_0xf091('0x16')]?_0x47ead0[_0xf091('0x16')][_0xf091('0x18')]||null:null,'attributes':_0x47ead0[_0xf091('0x16')]?_0x47ead0[_0xf091('0x16')][_0xf091('0x19')]||null:null,'include':_0x47ead0[_0xf091('0x16')]?_0x47ead0['options'][_0xf091('0x1a')]?_[_0xf091('0x1b')](_0x47ead0[_0xf091('0x16')][_0xf091('0x1a')],function(_0x4a044a){return{'model':db[_0x4a044a[_0xf091('0x1c')]],'as':_0x4a044a['as'],'attributes':_0x4a044a[_0xf091('0x19')],'include':_0x4a044a['include']?_['map'](_0x4a044a[_0xf091('0x1a')],function(_0x2d96ac){return{'model':db[_0x2d96ac['model']],'as':_0x2d96ac['as'],'attributes':_0x2d96ac[_0xf091('0x19')],'include':_0x2d96ac['include']?_[_0xf091('0x1b')](_0x2d96ac['include'],function(_0x43d9a4){return{'model':db[_0x43d9a4[_0xf091('0x1c')]],'as':_0x43d9a4['as'],'attributes':_0x43d9a4[_0xf091('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf091('0x1d')](function(_0x2256ea){logger[_0xf091('0xb')](_0xf091('0x20'),_0x47ead0);logger[_0xf091('0xe')](_0xf091('0x20'),_0x47ead0,JSON[_0xf091('0xf')](_0x2256ea));_0xbbfe7a(_0x2256ea);})[_0xf091('0x13')](function(_0x532e5c){logger[_0xf091('0x10')](_0xf091('0x20'),_0x532e5c[_0xf091('0x12')],_0x47ead0);_0xa12fec(_0x5ab7d2['error'](0x1f4,_0x532e5c['message']));});});};
\ No newline at end of file
+var _0x0538=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','options','raw','where','include','map','model','attributes','ShowDynamics365Account','lodash','util','bluebird','randomstring','ioredis'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0x0538,0xe9));var _0x8053=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0x0538[_0x725a4c];return _0x37b2cc;};'use strict';var _=require(_0x8053('0x0'));var util=require(_0x8053('0x1'));var moment=require('moment');var BPromise=require(_0x8053('0x2'));var rs=require(_0x8053('0x3'));var fs=require('fs');var Redis=require(_0x8053('0x4'));var db=require(_0x8053('0x5'))['db'];var utils=require(_0x8053('0x6'));var logger=require(_0x8053('0x7'))('rpc');var config=require(_0x8053('0x8'));var jayson=require(_0x8053('0x9'));var client=jayson[_0x8053('0xa')][_0x8053('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45a4d8,_0x413ff7,_0x5cea34){return new BPromise(function(_0x1763cf,_0x2f0d2b){return client[_0x8053('0xc')](_0x45a4d8,_0x5cea34)[_0x8053('0xd')](function(_0x4224f5){logger[_0x8053('0xe')](_0x8053('0xf'),_0x413ff7,_0x8053('0x10'));logger[_0x8053('0x11')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x413ff7,'request\x20sent',JSON[_0x8053('0x12')](_0x4224f5));if(_0x4224f5['error']){if(_0x4224f5[_0x8053('0x13')][_0x8053('0x14')]===0x1f4){logger[_0x8053('0x13')](_0x8053('0xf'),_0x413ff7,_0x4224f5[_0x8053('0x13')]['message']);return _0x2f0d2b(_0x4224f5[_0x8053('0x13')][_0x8053('0x15')]);}logger[_0x8053('0x13')](_0x8053('0xf'),_0x413ff7,_0x4224f5[_0x8053('0x13')]['message']);return _0x1763cf(_0x4224f5['error'][_0x8053('0x15')]);}else{logger['info'](_0x8053('0xf'),_0x413ff7,'request\x20sent');_0x1763cf(_0x4224f5[_0x8053('0x16')][_0x8053('0x15')]);}})[_0x8053('0x17')](function(_0x486e25){logger[_0x8053('0x13')](_0x8053('0xf'),_0x413ff7,_0x486e25);_0x2f0d2b(_0x486e25);});});}exports[_0x8053('0x18')]=function(_0x423cf4){var _0x1113dc=this;return new Promise(function(_0x522df2,_0x5849ba){return db[_0x8053('0x19')]['findAll']({'raw':_0x423cf4[_0x8053('0x1a')]?_0x423cf4['options'][_0x8053('0x1b')]===undefined?!![]:![]:!![],'where':_0x423cf4[_0x8053('0x1a')]?_0x423cf4['options'][_0x8053('0x1c')]||null:null,'attributes':_0x423cf4['options']?_0x423cf4[_0x8053('0x1a')]['attributes']||null:null,'limit':_0x423cf4[_0x8053('0x1a')]?_0x423cf4[_0x8053('0x1a')]['limit']||null:null,'include':_0x423cf4[_0x8053('0x1a')]?_0x423cf4[_0x8053('0x1a')][_0x8053('0x1d')]?_[_0x8053('0x1e')](_0x423cf4[_0x8053('0x1a')]['include'],function(_0x4d958a){return{'model':db[_0x4d958a[_0x8053('0x1f')]],'as':_0x4d958a['as'],'attributes':_0x4d958a[_0x8053('0x20')],'include':_0x4d958a[_0x8053('0x1d')]?_[_0x8053('0x1e')](_0x4d958a[_0x8053('0x1d')],function(_0x598797){return{'model':db[_0x598797['model']],'as':_0x598797['as'],'attributes':_0x598797['attributes'],'include':_0x598797[_0x8053('0x1d')]?_[_0x8053('0x1e')](_0x598797['include'],function(_0x29837e){return{'model':db[_0x29837e[_0x8053('0x1f')]],'as':_0x29837e['as'],'attributes':_0x29837e[_0x8053('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d6317){logger['info'](_0x8053('0x18'),_0x423cf4);logger[_0x8053('0x11')](_0x8053('0x18'),_0x423cf4,JSON[_0x8053('0x12')](_0x5d6317));_0x522df2(_0x5d6317);})[_0x8053('0x17')](function(_0x576c25){logger[_0x8053('0x13')](_0x8053('0x18'),_0x576c25[_0x8053('0x15')],_0x423cf4);_0x5849ba(_0x1113dc[_0x8053('0x13')](0x1f4,_0x576c25[_0x8053('0x15')]));});});};exports[_0x8053('0x21')]=function(_0x217d9c){var _0x11abb8=this;return new Promise(function(_0x38fecb,_0x50ad72){return db[_0x8053('0x19')]['find']({'raw':_0x217d9c[_0x8053('0x1a')]?_0x217d9c[_0x8053('0x1a')][_0x8053('0x1b')]===undefined?!![]:![]:!![],'where':_0x217d9c['options']?_0x217d9c[_0x8053('0x1a')][_0x8053('0x1c')]||null:null,'attributes':_0x217d9c[_0x8053('0x1a')]?_0x217d9c['options'][_0x8053('0x20')]||null:null,'include':_0x217d9c[_0x8053('0x1a')]?_0x217d9c[_0x8053('0x1a')][_0x8053('0x1d')]?_[_0x8053('0x1e')](_0x217d9c[_0x8053('0x1a')][_0x8053('0x1d')],function(_0x20b390){return{'model':db[_0x20b390[_0x8053('0x1f')]],'as':_0x20b390['as'],'attributes':_0x20b390['attributes'],'include':_0x20b390['include']?_['map'](_0x20b390[_0x8053('0x1d')],function(_0x381bba){return{'model':db[_0x381bba[_0x8053('0x1f')]],'as':_0x381bba['as'],'attributes':_0x381bba[_0x8053('0x20')],'include':_0x381bba[_0x8053('0x1d')]?_[_0x8053('0x1e')](_0x381bba[_0x8053('0x1d')],function(_0x458c5a){return{'model':db[_0x458c5a['model']],'as':_0x458c5a['as'],'attributes':_0x458c5a[_0x8053('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8053('0xd')](function(_0x24b030){logger['info']('ShowDynamics365Account',_0x217d9c);logger[_0x8053('0x11')]('ShowDynamics365Account',_0x217d9c,JSON['stringify'](_0x24b030));_0x38fecb(_0x24b030);})[_0x8053('0x17')](function(_0x8a1587){logger[_0x8053('0x13')](_0x8053('0x21'),_0x8a1587[_0x8053('0x15')],_0x217d9c);_0x50ad72(_0x11abb8[_0x8053('0x13')](0x1f4,_0x8a1587[_0x8053('0x15')]));});});};
\ No newline at end of file
index 3648e51..5a1ebf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77de=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','put'];(function(_0x47adb8,_0x591ccc){var _0x4689a8=function(_0x2ba76f){while(--_0x2ba76f){_0x47adb8['push'](_0x47adb8['shift']());}};_0x4689a8(++_0x591ccc);}(_0x77de,0x1d0));var _0xe77d=function(_0x3ef2d5,_0x423d46){_0x3ef2d5=_0x3ef2d5-0x0;var _0x2fefb2=_0x77de[_0x3ef2d5];return _0x2fefb2;};'use strict';var multer=require(_0xe77d('0x0'));var util=require(_0xe77d('0x1'));var path=require(_0xe77d('0x2'));var timeout=require(_0xe77d('0x3'));var express=require('express');var router=express[_0xe77d('0x4')]();var fs_extra=require(_0xe77d('0x5'));var auth=require(_0xe77d('0x6'));var interaction=require(_0xe77d('0x7'));var config=require(_0xe77d('0x8'));var controller=require('./intDynamics365Configuration.controller');router['get']('/',auth[_0xe77d('0x9')](),controller[_0xe77d('0xa')]);router[_0xe77d('0xb')](_0xe77d('0xc'),auth[_0xe77d('0x9')](),controller[_0xe77d('0xd')]);router[_0xe77d('0xb')](_0xe77d('0xe'),auth[_0xe77d('0x9')](),controller['getFields']);router[_0xe77d('0xb')](_0xe77d('0xf'),auth[_0xe77d('0x9')](),controller[_0xe77d('0x10')]);router[_0xe77d('0xb')](_0xe77d('0x11'),auth[_0xe77d('0x9')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe77d('0x12')](_0xe77d('0xc'),auth[_0xe77d('0x9')](),controller[_0xe77d('0x13')]);router[_0xe77d('0x14')](_0xe77d('0xc'),auth[_0xe77d('0x9')](),controller[_0xe77d('0x15')]);module[_0xe77d('0x16')]=router;
\ No newline at end of file
+var _0x0b2f=['index','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2b4fc1,_0x5c6459){var _0x3512fc=function(_0x3a89c2){while(--_0x3a89c2){_0x2b4fc1['push'](_0x2b4fc1['shift']());}};_0x3512fc(++_0x5c6459);}(_0x0b2f,0x1f2));var _0xf0b2=function(_0x5ce50c,_0x2c022d){_0x5ce50c=_0x5ce50c-0x0;var _0x1489aa=_0x0b2f[_0x5ce50c];return _0x1489aa;};'use strict';var multer=require(_0xf0b2('0x0'));var util=require('util');var path=require(_0xf0b2('0x1'));var timeout=require(_0xf0b2('0x2'));var express=require(_0xf0b2('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf0b2('0x4'));var config=require(_0xf0b2('0x5'));var controller=require('./intDynamics365Configuration.controller');router[_0xf0b2('0x6')]('/',auth[_0xf0b2('0x7')](),controller[_0xf0b2('0x8')]);router[_0xf0b2('0x6')](_0xf0b2('0x9'),auth['isAuthenticated'](),controller[_0xf0b2('0xa')]);router[_0xf0b2('0x6')](_0xf0b2('0xb'),auth['isAuthenticated'](),controller['getFields']);router['get'](_0xf0b2('0xc'),auth['isAuthenticated'](),controller[_0xf0b2('0xd')]);router[_0xf0b2('0x6')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xf0b2('0xe')]);router[_0xf0b2('0xf')]('/',auth[_0xf0b2('0x7')](),controller[_0xf0b2('0x10')]);router[_0xf0b2('0x11')](_0xf0b2('0x9'),auth[_0xf0b2('0x7')](),controller[_0xf0b2('0x12')]);router[_0xf0b2('0x13')](_0xf0b2('0x9'),auth[_0xf0b2('0x7')](),controller[_0xf0b2('0x14')]);module[_0xf0b2('0x15')]=router;
\ No newline at end of file
index e5e33cd..43ed87d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72c9=['STRING','ENUM','incident','phonecall','contact','BOOLEAN'];(function(_0x15f162,_0x21f2a7){var _0x39731e=function(_0x3dad00){while(--_0x3dad00){_0x15f162['push'](_0x15f162['shift']());}};_0x39731e(++_0x21f2a7);}(_0x72c9,0xb4));var _0x972c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72c9[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x972c('0x0')]},'ticketType':{'type':Sequelize[_0x972c('0x1')](_0x972c('0x2'),_0x972c('0x3')),'defaultValue':_0x972c('0x2')},'moduleCreate':{'type':Sequelize[_0x972c('0x1')](_0x972c('0x4'),'nothing'),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x972c('0x5')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x87a9=['incident','contact','nothing','sequelize','exports','STRING','ENUM'];(function(_0x5437a3,_0x21edef){var _0x21ef02=function(_0x592443){while(--_0x592443){_0x5437a3['push'](_0x5437a3['shift']());}};_0x21ef02(++_0x21edef);}(_0x87a9,0xe3));var _0x987a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x87a9[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x987a('0x0'));module[_0x987a('0x1')]={'name':{'type':Sequelize[_0x987a('0x2')]},'description':{'type':Sequelize[_0x987a('0x2')]},'ticketType':{'type':Sequelize[_0x987a('0x3')](_0x987a('0x4'),'phonecall'),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x987a('0x3')](_0x987a('0x5'),_0x987a('0x6')),'defaultValue':_0x987a('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x987a('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 4f9abb5..de98724 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafba=['type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Dynamics365Configuration','then','includeAll','include','findAll','rows','show','params','keys','create','body','catch','find','getFields','findOne','getSubjects','Dynamics365Field','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','error','name','send','index','rawAttributes','fieldName'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xafba,0xce));var _0xaafb=function(_0x5ef655,_0x3d996e){_0x5ef655=_0x5ef655-0x0;var _0x37fba0=_0xafba[_0x5ef655];return _0x37fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaafb('0x0'));var zipdir=require(_0xaafb('0x1'));var jsonpatch=require(_0xaafb('0x2'));var rp=require(_0xaafb('0x3'));var moment=require('moment');var BPromise=require(_0xaafb('0x4'));var Mustache=require(_0xaafb('0x5'));var util=require('util');var path=require(_0xaafb('0x6'));var sox=require(_0xaafb('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaafb('0x8'));var _=require(_0xaafb('0x9'));var squel=require('squel');var crypto=require(_0xaafb('0xa'));var jsforce=require(_0xaafb('0xb'));var deskjs=require(_0xaafb('0xc'));var toCsv=require(_0xaafb('0xd'));var querystring=require(_0xaafb('0xe'));var Papa=require(_0xaafb('0xf'));var Redis=require(_0xaafb('0x10'));var authService=require(_0xaafb('0x11'));var qs=require(_0xaafb('0x12'));var as=require(_0xaafb('0x13'));var hardwareService=require(_0xaafb('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xaafb('0x15'));var config=require(_0xaafb('0x16'));var licenseUtil=require(_0xaafb('0x17'));var db=require(_0xaafb('0x18'))['db'];function respondWithStatusCode(_0x8e71f,_0x1b7486){_0x1b7486=_0x1b7486||0xcc;return function(_0x45e133){if(_0x45e133){return _0x8e71f['sendStatus'](_0x1b7486);}return _0x8e71f['status'](_0x1b7486)[_0xaafb('0x19')]();};}function respondWithResult(_0x44ca0b,_0x1816ee){_0x1816ee=_0x1816ee||0xc8;return function(_0xf14276){if(_0xf14276){return _0x44ca0b[_0xaafb('0x1a')](_0x1816ee)[_0xaafb('0x1b')](_0xf14276);}};}function respondWithFilteredResult(_0x4251ec,_0x2d0976){return function(_0x5e5cee){if(_0x5e5cee){var _0x50e155=typeof _0x2d0976[_0xaafb('0x1c')]===_0xaafb('0x1d')&&typeof _0x2d0976[_0xaafb('0x1e')]===_0xaafb('0x1d');var _0x21a650=_0x5e5cee[_0xaafb('0x1f')];var _0x256a83=_0x50e155?0x0:_0x2d0976[_0xaafb('0x1c')];var _0x7cd251=_0x50e155?_0x5e5cee[_0xaafb('0x1f')]:_0x2d0976[_0xaafb('0x1c')]+_0x2d0976[_0xaafb('0x1e')];var _0x56d39d;if(_0x7cd251>=_0x21a650){_0x7cd251=_0x21a650;_0x56d39d=0xc8;}else{_0x56d39d=0xce;}_0x4251ec[_0xaafb('0x1a')](_0x56d39d);return _0x4251ec[_0xaafb('0x20')](_0xaafb('0x21'),_0x256a83+'-'+_0x7cd251+'/'+_0x21a650)[_0xaafb('0x1b')](_0x5e5cee);}return null;};}function patchUpdates(_0x227519){return function(_0x2a7835){try{jsonpatch[_0xaafb('0x22')](_0x2a7835,_0x227519,!![]);}catch(_0xc1ff53){return BPromise[_0xaafb('0x23')](_0xc1ff53);}return _0x2a7835[_0xaafb('0x24')]();};}function saveUpdates(_0x3b39fd,_0x5b40d8){return function(_0x40b69b){if(_0x40b69b){return _0x40b69b[_0xaafb('0x25')](_0x3b39fd)['then'](function(_0x36f03a){return _0x36f03a;});}return null;};}function removeEntity(_0x5bafd1,_0x32f736){return function(_0x19e630){if(_0x19e630){return _0x19e630[_0xaafb('0x26')]()['then'](function(){_0x5bafd1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x447bb6,_0x2b73b8){return function(_0x27ff5c){if(!_0x27ff5c){_0x447bb6[_0xaafb('0x27')](0x194);}return _0x27ff5c;};}function handleError(_0x4430d7,_0x45c02d){_0x45c02d=_0x45c02d||0x1f4;return function(_0xb1c0c){logger[_0xaafb('0x28')](_0xb1c0c['stack']);if(_0xb1c0c[_0xaafb('0x29')]){delete _0xb1c0c[_0xaafb('0x29')];}_0x4430d7[_0xaafb('0x1a')](_0x45c02d)[_0xaafb('0x2a')](_0xb1c0c);};}exports[_0xaafb('0x2b')]=function(_0x7b645f,_0x5a1e57){var _0x4da90a={},_0x180339={},_0x3a7a07={'count':0x0,'rows':[]};var _0x1de49d=_['map'](db['Dynamics365Configuration'][_0xaafb('0x2c')],function(_0xd3bce3){return{'name':_0xd3bce3[_0xaafb('0x2d')],'type':_0xd3bce3[_0xaafb('0x2e')][_0xaafb('0x2f')]};});_0x180339[_0xaafb('0x30')]=_[_0xaafb('0x31')](_0x1de49d,_0xaafb('0x29'));_0x180339['query']=_['keys'](_0x7b645f[_0xaafb('0x32')]);_0x180339[_0xaafb('0x33')]=_['intersection'](_0x180339[_0xaafb('0x30')],_0x180339[_0xaafb('0x32')]);_0x4da90a[_0xaafb('0x34')]=_[_0xaafb('0x35')](_0x180339['model'],qs[_0xaafb('0x36')](_0x7b645f['query'][_0xaafb('0x36')]));_0x4da90a[_0xaafb('0x34')]=_0x4da90a['attributes'][_0xaafb('0x37')]?_0x4da90a[_0xaafb('0x34')]:_0x180339[_0xaafb('0x30')];if(!_0x7b645f['query'][_0xaafb('0x38')](_0xaafb('0x39'))){_0x4da90a[_0xaafb('0x1e')]=qs['limit'](_0x7b645f[_0xaafb('0x32')]['limit']);_0x4da90a[_0xaafb('0x1c')]=qs[_0xaafb('0x1c')](_0x7b645f[_0xaafb('0x32')]['offset']);}_0x4da90a[_0xaafb('0x3a')]=qs[_0xaafb('0x3b')](_0x7b645f[_0xaafb('0x32')][_0xaafb('0x3b')]);_0x4da90a[_0xaafb('0x3c')]=qs[_0xaafb('0x33')](_[_0xaafb('0x3d')](_0x7b645f[_0xaafb('0x32')],_0x180339[_0xaafb('0x33')]),_0x1de49d);if(_0x7b645f[_0xaafb('0x32')]['filter']){_0x4da90a[_0xaafb('0x3c')]=_[_0xaafb('0x3e')](_0x4da90a[_0xaafb('0x3c')],{'$or':_[_0xaafb('0x31')](_0x1de49d,function(_0x48dfc7){if(_0x48dfc7[_0xaafb('0x2e')]!==_0xaafb('0x3f')){var _0x4c565c={};_0x4c565c[_0x48dfc7[_0xaafb('0x29')]]={'$like':'%'+_0x7b645f['query'][_0xaafb('0x40')]+'%'};return _0x4c565c;}})});}_0x4da90a=_[_0xaafb('0x3e')]({},_0x4da90a,_0x7b645f[_0xaafb('0x41')]);var _0x16d28b={'where':_0x4da90a['where']};return db[_0xaafb('0x42')][_0xaafb('0x1f')](_0x16d28b)[_0xaafb('0x43')](function(_0x20f6ee){_0x3a7a07[_0xaafb('0x1f')]=_0x20f6ee;if(_0x7b645f[_0xaafb('0x32')][_0xaafb('0x44')]){_0x4da90a[_0xaafb('0x45')]=[{'all':!![]}];}return db[_0xaafb('0x42')][_0xaafb('0x46')](_0x4da90a);})[_0xaafb('0x43')](function(_0xae5a3b){_0x3a7a07[_0xaafb('0x47')]=_0xae5a3b;return _0x3a7a07;})[_0xaafb('0x43')](respondWithFilteredResult(_0x5a1e57,_0x4da90a))['catch'](handleError(_0x5a1e57,null));};exports[_0xaafb('0x48')]=function(_0x3af712,_0x2efb74){var _0x40f67a={'raw':![],'where':{'id':_0x3af712[_0xaafb('0x49')]['id']}},_0x49c97d={};_0x49c97d[_0xaafb('0x30')]=_[_0xaafb('0x4a')](db[_0xaafb('0x42')]['rawAttributes']);_0x49c97d[_0xaafb('0x32')]=_[_0xaafb('0x4a')](_0x3af712[_0xaafb('0x32')]);_0x49c97d['filters']=_['intersection'](_0x49c97d[_0xaafb('0x30')],_0x49c97d[_0xaafb('0x32')]);_0x40f67a[_0xaafb('0x34')]=_[_0xaafb('0x35')](_0x49c97d[_0xaafb('0x30')],qs[_0xaafb('0x36')](_0x3af712[_0xaafb('0x32')][_0xaafb('0x36')]));_0x40f67a['attributes']=_0x40f67a[_0xaafb('0x34')][_0xaafb('0x37')]?_0x40f67a[_0xaafb('0x34')]:_0x49c97d[_0xaafb('0x30')];if(_0x3af712[_0xaafb('0x32')]['includeAll']){_0x40f67a['include']=[{'all':!![]}];}_0x40f67a=_[_0xaafb('0x3e')]({},_0x40f67a,_0x3af712[_0xaafb('0x41')]);return db[_0xaafb('0x42')]['find'](_0x40f67a)[_0xaafb('0x43')](handleEntityNotFound(_0x2efb74,null))[_0xaafb('0x43')](respondWithResult(_0x2efb74,null))['catch'](handleError(_0x2efb74,null));};exports['create']=function(_0x4b7d47,_0x4e7303){return db[_0xaafb('0x42')][_0xaafb('0x4b')](_0x4b7d47[_0xaafb('0x4c')],{})[_0xaafb('0x43')](respondWithResult(_0x4e7303,0xc9))[_0xaafb('0x4d')](handleError(_0x4e7303,null));};exports[_0xaafb('0x25')]=function(_0x17a8c1,_0xc4b8da){if(_0x17a8c1[_0xaafb('0x4c')]['id']){delete _0x17a8c1['body']['id'];}return db['Dynamics365Configuration'][_0xaafb('0x4e')]({'where':{'id':_0x17a8c1['params']['id']}})[_0xaafb('0x43')](handleEntityNotFound(_0xc4b8da,null))[_0xaafb('0x43')](saveUpdates(_0x17a8c1['body'],null))[_0xaafb('0x43')](respondWithResult(_0xc4b8da,null))[_0xaafb('0x4d')](handleError(_0xc4b8da,null));};exports[_0xaafb('0x26')]=function(_0x449d1b,_0x2e626b){return db['Dynamics365Configuration'][_0xaafb('0x4e')]({'where':{'id':_0x449d1b[_0xaafb('0x49')]['id']}})[_0xaafb('0x43')](handleEntityNotFound(_0x2e626b,null))[_0xaafb('0x43')](removeEntity(_0x2e626b,null))[_0xaafb('0x4d')](handleError(_0x2e626b,null));};exports[_0xaafb('0x4f')]=function(_0x564907,_0x118633,_0x24af0e){var _0x254ce2={};var _0x22c682={};var _0x6aba2;var _0x4079f4;return db[_0xaafb('0x42')][_0xaafb('0x50')]({'where':{'id':_0x564907[_0xaafb('0x49')]['id']}})['then'](handleEntityNotFound(_0x118633,null))[_0xaafb('0x43')](function(_0x501717){if(_0x501717){_0x6aba2=_0x501717;_0x22c682[_0xaafb('0x30')]=_[_0xaafb('0x4a')](db['Dynamics365Field'][_0xaafb('0x2c')]);_0x22c682[_0xaafb('0x32')]=_['keys'](_0x564907[_0xaafb('0x32')]);_0x22c682[_0xaafb('0x33')]=_[_0xaafb('0x35')](_0x22c682['model'],_0x22c682['query']);_0x254ce2[_0xaafb('0x34')]=_[_0xaafb('0x35')](_0x22c682[_0xaafb('0x30')],qs[_0xaafb('0x36')](_0x564907[_0xaafb('0x32')][_0xaafb('0x36')]));_0x254ce2['attributes']=_0x254ce2[_0xaafb('0x34')][_0xaafb('0x37')]?_0x254ce2[_0xaafb('0x34')]:_0x22c682[_0xaafb('0x30')];_0x254ce2[_0xaafb('0x3a')]=qs[_0xaafb('0x3b')](_0x564907[_0xaafb('0x32')][_0xaafb('0x3b')]);_0x254ce2[_0xaafb('0x3c')]=qs[_0xaafb('0x33')](_[_0xaafb('0x3d')](_0x564907[_0xaafb('0x32')],_0x22c682[_0xaafb('0x33')]));if(_0x564907[_0xaafb('0x32')][_0xaafb('0x40')]){_0x254ce2[_0xaafb('0x3c')]=_['merge'](_0x254ce2[_0xaafb('0x3c')],{'$or':_['map'](_0x254ce2[_0xaafb('0x34')],function(_0x29a84f){var _0x36983b={};_0x36983b[_0x29a84f]={'$like':'%'+_0x564907[_0xaafb('0x32')]['filter']+'%'};return _0x36983b;})});}_0x254ce2=_[_0xaafb('0x3e')]({},_0x254ce2,_0x564907[_0xaafb('0x41')]);return _0x6aba2[_0xaafb('0x4f')](_0x254ce2);}})[_0xaafb('0x43')](function(_0x71a274){if(_0x71a274){_0x4079f4=_0x71a274[_0xaafb('0x37')];if(!_0x564907['query']['hasOwnProperty']('nolimit')){_0x254ce2[_0xaafb('0x1e')]=qs[_0xaafb('0x1e')](_0x564907[_0xaafb('0x32')][_0xaafb('0x1e')]);_0x254ce2[_0xaafb('0x1c')]=qs['offset'](_0x564907[_0xaafb('0x32')][_0xaafb('0x1c')]);}return _0x6aba2[_0xaafb('0x4f')](_0x254ce2);}})[_0xaafb('0x43')](function(_0x235c62){if(_0x235c62){return _0x235c62?{'count':_0x4079f4,'rows':_0x235c62}:null;}})[_0xaafb('0x43')](respondWithResult(_0x118633,null))['catch'](handleError(_0x118633,null));};exports[_0xaafb('0x51')]=function(_0xc9562d,_0x4d7c9a,_0x3de4e5){var _0xa06587={};var _0x29af97={};var _0x70f851;var _0x29295d;return db[_0xaafb('0x42')][_0xaafb('0x50')]({'where':{'id':_0xc9562d[_0xaafb('0x49')]['id']}})[_0xaafb('0x43')](handleEntityNotFound(_0x4d7c9a,null))[_0xaafb('0x43')](function(_0x47158f){if(_0x47158f){_0x70f851=_0x47158f;_0x29af97[_0xaafb('0x30')]=_[_0xaafb('0x4a')](db[_0xaafb('0x52')]['rawAttributes']);_0x29af97[_0xaafb('0x32')]=_[_0xaafb('0x4a')](_0xc9562d[_0xaafb('0x32')]);_0x29af97[_0xaafb('0x33')]=_[_0xaafb('0x35')](_0x29af97[_0xaafb('0x30')],_0x29af97[_0xaafb('0x32')]);_0xa06587[_0xaafb('0x34')]=_['intersection'](_0x29af97[_0xaafb('0x30')],qs[_0xaafb('0x36')](_0xc9562d[_0xaafb('0x32')][_0xaafb('0x36')]));_0xa06587['attributes']=_0xa06587[_0xaafb('0x34')][_0xaafb('0x37')]?_0xa06587['attributes']:_0x29af97[_0xaafb('0x30')];_0xa06587[_0xaafb('0x3a')]=qs[_0xaafb('0x3b')](_0xc9562d[_0xaafb('0x32')][_0xaafb('0x3b')]);_0xa06587[_0xaafb('0x3c')]=qs[_0xaafb('0x33')](_[_0xaafb('0x3d')](_0xc9562d['query'],_0x29af97[_0xaafb('0x33')]));if(_0xc9562d[_0xaafb('0x32')][_0xaafb('0x40')]){_0xa06587[_0xaafb('0x3c')]=_[_0xaafb('0x3e')](_0xa06587[_0xaafb('0x3c')],{'$or':_[_0xaafb('0x31')](_0xa06587[_0xaafb('0x34')],function(_0x13057d){var _0x1f0062={};_0x1f0062[_0x13057d]={'$like':'%'+_0xc9562d[_0xaafb('0x32')]['filter']+'%'};return _0x1f0062;})});}_0xa06587=_[_0xaafb('0x3e')]({},_0xa06587,_0xc9562d[_0xaafb('0x41')]);return _0x70f851[_0xaafb('0x51')](_0xa06587);}})[_0xaafb('0x43')](function(_0x485261){if(_0x485261){_0x29295d=_0x485261[_0xaafb('0x37')];if(!_0xc9562d[_0xaafb('0x32')][_0xaafb('0x38')](_0xaafb('0x39'))){_0xa06587[_0xaafb('0x1e')]=qs[_0xaafb('0x1e')](_0xc9562d[_0xaafb('0x32')][_0xaafb('0x1e')]);_0xa06587[_0xaafb('0x1c')]=qs[_0xaafb('0x1c')](_0xc9562d['query']['offset']);}return _0x70f851[_0xaafb('0x51')](_0xa06587);}})[_0xaafb('0x43')](function(_0x389a4a){if(_0x389a4a){return _0x389a4a?{'count':_0x29295d,'rows':_0x389a4a}:null;}})[_0xaafb('0x43')](respondWithResult(_0x4d7c9a,null))[_0xaafb('0x4d')](handleError(_0x4d7c9a,null));};exports['getDescriptions']=function(_0x54f2b1,_0x13ffbb,_0x476128){var _0x4cb0c4={};var _0x3581b7={};var _0x57e6a7;var _0x4509bb;return db['Dynamics365Configuration'][_0xaafb('0x50')]({'where':{'id':_0x54f2b1['params']['id']}})[_0xaafb('0x43')](handleEntityNotFound(_0x13ffbb,null))['then'](function(_0x53b9d0){if(_0x53b9d0){_0x57e6a7=_0x53b9d0;_0x3581b7[_0xaafb('0x30')]=_['keys'](db[_0xaafb('0x52')][_0xaafb('0x2c')]);_0x3581b7[_0xaafb('0x32')]=_[_0xaafb('0x4a')](_0x54f2b1['query']);_0x3581b7[_0xaafb('0x33')]=_['intersection'](_0x3581b7[_0xaafb('0x30')],_0x3581b7[_0xaafb('0x32')]);_0x4cb0c4['attributes']=_['intersection'](_0x3581b7['model'],qs['fields'](_0x54f2b1[_0xaafb('0x32')][_0xaafb('0x36')]));_0x4cb0c4[_0xaafb('0x34')]=_0x4cb0c4[_0xaafb('0x34')]['length']?_0x4cb0c4[_0xaafb('0x34')]:_0x3581b7[_0xaafb('0x30')];_0x4cb0c4[_0xaafb('0x3a')]=qs[_0xaafb('0x3b')](_0x54f2b1[_0xaafb('0x32')][_0xaafb('0x3b')]);_0x4cb0c4['where']=qs[_0xaafb('0x33')](_[_0xaafb('0x3d')](_0x54f2b1[_0xaafb('0x32')],_0x3581b7[_0xaafb('0x33')]));if(_0x54f2b1[_0xaafb('0x32')]['filter']){_0x4cb0c4[_0xaafb('0x3c')]=_[_0xaafb('0x3e')](_0x4cb0c4[_0xaafb('0x3c')],{'$or':_[_0xaafb('0x31')](_0x4cb0c4[_0xaafb('0x34')],function(_0x30322c){var _0x4d90e5={};_0x4d90e5[_0x30322c]={'$like':'%'+_0x54f2b1['query'][_0xaafb('0x40')]+'%'};return _0x4d90e5;})});}_0x4cb0c4=_[_0xaafb('0x3e')]({},_0x4cb0c4,_0x54f2b1[_0xaafb('0x41')]);return _0x57e6a7[_0xaafb('0x53')](_0x4cb0c4);}})[_0xaafb('0x43')](function(_0x215839){if(_0x215839){_0x4509bb=_0x215839[_0xaafb('0x37')];if(!_0x54f2b1['query'][_0xaafb('0x38')](_0xaafb('0x39'))){_0x4cb0c4[_0xaafb('0x1e')]=qs[_0xaafb('0x1e')](_0x54f2b1['query']['limit']);_0x4cb0c4[_0xaafb('0x1c')]=qs[_0xaafb('0x1c')](_0x54f2b1[_0xaafb('0x32')][_0xaafb('0x1c')]);}return _0x57e6a7[_0xaafb('0x53')](_0x4cb0c4);}})[_0xaafb('0x43')](function(_0x122ee6){if(_0x122ee6){return _0x122ee6?{'count':_0x4509bb,'rows':_0x122ee6}:null;}})[_0xaafb('0x43')](respondWithResult(_0x13ffbb,null))[_0xaafb('0x4d')](handleError(_0x13ffbb,null));};
\ No newline at end of file
+var _0x5d5b=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','set','Content-Range','save','then','destroy','sendStatus','error','stack','name','map','Dynamics365Configuration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','merge','where','VIRTUAL','options','count','includeAll','include','rows','catch','keys','find','create','body','update','params','getFields','nolimit','getSubjects','findOne','Dynamics365Field','getDescriptions','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x39e0db,_0x28946e){var _0x489fd6=function(_0x27ed1e){while(--_0x27ed1e){_0x39e0db['push'](_0x39e0db['shift']());}};_0x489fd6(++_0x28946e);}(_0x5d5b,0x173));var _0xb5d5=function(_0x59531e,_0x399520){_0x59531e=_0x59531e-0x0;var _0x21dbe0=_0x5d5b[_0x59531e];return _0x21dbe0;};'use strict';var emlformat=require(_0xb5d5('0x0'));var rimraf=require(_0xb5d5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5d5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb5d5('0x3'));var Mustache=require(_0xb5d5('0x4'));var util=require('util');var path=require(_0xb5d5('0x5'));var sox=require(_0xb5d5('0x6'));var csv=require(_0xb5d5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb5d5('0x8'));var _=require(_0xb5d5('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb5d5('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb5d5('0x7'));var querystring=require(_0xb5d5('0xb'));var Papa=require(_0xb5d5('0xc'));var Redis=require(_0xb5d5('0xd'));var authService=require(_0xb5d5('0xe'));var qs=require(_0xb5d5('0xf'));var as=require(_0xb5d5('0x10'));var hardwareService=require(_0xb5d5('0x11'));var logger=require(_0xb5d5('0x12'))(_0xb5d5('0x13'));var utils=require(_0xb5d5('0x14'));var config=require(_0xb5d5('0x15'));var licenseUtil=require(_0xb5d5('0x16'));var db=require(_0xb5d5('0x17'))['db'];function respondWithStatusCode(_0xf558f8,_0x591dbf){_0x591dbf=_0x591dbf||0xcc;return function(_0xcd1f64){if(_0xcd1f64){return _0xf558f8['sendStatus'](_0x591dbf);}return _0xf558f8[_0xb5d5('0x18')](_0x591dbf)[_0xb5d5('0x19')]();};}function respondWithResult(_0x9ca73c,_0x58f824){_0x58f824=_0x58f824||0xc8;return function(_0x36a0ac){if(_0x36a0ac){return _0x9ca73c['status'](_0x58f824)[_0xb5d5('0x1a')](_0x36a0ac);}};}function respondWithFilteredResult(_0xd3bdaa,_0x3a2740){return function(_0x109c3f){if(_0x109c3f){var _0x3e0165=typeof _0x3a2740[_0xb5d5('0x1b')]===_0xb5d5('0x1c')&&typeof _0x3a2740['limit']==='undefined';var _0x16d8f9=_0x109c3f['count'];var _0x2f8d7e=_0x3e0165?0x0:_0x3a2740[_0xb5d5('0x1b')];var _0x536dff=_0x3e0165?_0x109c3f['count']:_0x3a2740[_0xb5d5('0x1b')]+_0x3a2740['limit'];var _0x3fa9a4;if(_0x536dff>=_0x16d8f9){_0x536dff=_0x16d8f9;_0x3fa9a4=0xc8;}else{_0x3fa9a4=0xce;}_0xd3bdaa[_0xb5d5('0x18')](_0x3fa9a4);return _0xd3bdaa[_0xb5d5('0x1d')](_0xb5d5('0x1e'),_0x2f8d7e+'-'+_0x536dff+'/'+_0x16d8f9)[_0xb5d5('0x1a')](_0x109c3f);}return null;};}function patchUpdates(_0x30a3a0){return function(_0x3bb4e6){try{jsonpatch['apply'](_0x3bb4e6,_0x30a3a0,!![]);}catch(_0x425050){return BPromise['reject'](_0x425050);}return _0x3bb4e6[_0xb5d5('0x1f')]();};}function saveUpdates(_0x3bfa2e,_0x58e64e){return function(_0x1035da){if(_0x1035da){return _0x1035da['update'](_0x3bfa2e)[_0xb5d5('0x20')](function(_0x414846){return _0x414846;});}return null;};}function removeEntity(_0x243c6d,_0x3e14e3){return function(_0x443b6f){if(_0x443b6f){return _0x443b6f[_0xb5d5('0x21')]()[_0xb5d5('0x20')](function(){_0x243c6d[_0xb5d5('0x18')](0xcc)[_0xb5d5('0x19')]();});}};}function handleEntityNotFound(_0x1446be,_0x486ce0){return function(_0x224761){if(!_0x224761){_0x1446be[_0xb5d5('0x22')](0x194);}return _0x224761;};}function handleError(_0x3c6a68,_0x574e23){_0x574e23=_0x574e23||0x1f4;return function(_0x44074e){logger[_0xb5d5('0x23')](_0x44074e[_0xb5d5('0x24')]);if(_0x44074e['name']){delete _0x44074e[_0xb5d5('0x25')];}_0x3c6a68['status'](_0x574e23)['send'](_0x44074e);};}exports['index']=function(_0x178748,_0x4de56f){var _0x47bc09={},_0x4e9424={},_0x4fcada={'count':0x0,'rows':[]};var _0x5dc46e=_[_0xb5d5('0x26')](db[_0xb5d5('0x27')][_0xb5d5('0x28')],function(_0x286489){return{'name':_0x286489[_0xb5d5('0x29')],'type':_0x286489[_0xb5d5('0x2a')][_0xb5d5('0x2b')]};});_0x4e9424[_0xb5d5('0x2c')]=_[_0xb5d5('0x26')](_0x5dc46e,_0xb5d5('0x25'));_0x4e9424['query']=_['keys'](_0x178748[_0xb5d5('0x2d')]);_0x4e9424[_0xb5d5('0x2e')]=_[_0xb5d5('0x2f')](_0x4e9424[_0xb5d5('0x2c')],_0x4e9424[_0xb5d5('0x2d')]);_0x47bc09[_0xb5d5('0x30')]=_['intersection'](_0x4e9424[_0xb5d5('0x2c')],qs[_0xb5d5('0x31')](_0x178748['query'][_0xb5d5('0x31')]));_0x47bc09[_0xb5d5('0x30')]=_0x47bc09['attributes'][_0xb5d5('0x32')]?_0x47bc09[_0xb5d5('0x30')]:_0x4e9424[_0xb5d5('0x2c')];if(!_0x178748[_0xb5d5('0x2d')][_0xb5d5('0x33')]('nolimit')){_0x47bc09[_0xb5d5('0x34')]=qs[_0xb5d5('0x34')](_0x178748[_0xb5d5('0x2d')]['limit']);_0x47bc09[_0xb5d5('0x1b')]=qs['offset'](_0x178748[_0xb5d5('0x2d')]['offset']);}_0x47bc09[_0xb5d5('0x35')]=qs[_0xb5d5('0x36')](_0x178748[_0xb5d5('0x2d')]['sort']);_0x47bc09['where']=qs[_0xb5d5('0x2e')](_[_0xb5d5('0x37')](_0x178748['query'],_0x4e9424['filters']),_0x5dc46e);if(_0x178748[_0xb5d5('0x2d')][_0xb5d5('0x38')]){_0x47bc09['where']=_[_0xb5d5('0x39')](_0x47bc09[_0xb5d5('0x3a')],{'$or':_[_0xb5d5('0x26')](_0x5dc46e,function(_0xc761ea){if(_0xc761ea['type']!==_0xb5d5('0x3b')){var _0x3fe199={};_0x3fe199[_0xc761ea[_0xb5d5('0x25')]]={'$like':'%'+_0x178748['query'][_0xb5d5('0x38')]+'%'};return _0x3fe199;}})});}_0x47bc09=_[_0xb5d5('0x39')]({},_0x47bc09,_0x178748[_0xb5d5('0x3c')]);var _0x1c688d={'where':_0x47bc09['where']};return db[_0xb5d5('0x27')][_0xb5d5('0x3d')](_0x1c688d)[_0xb5d5('0x20')](function(_0x4e50c6){_0x4fcada[_0xb5d5('0x3d')]=_0x4e50c6;if(_0x178748[_0xb5d5('0x2d')][_0xb5d5('0x3e')]){_0x47bc09[_0xb5d5('0x3f')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x47bc09);})['then'](function(_0x2df226){_0x4fcada[_0xb5d5('0x40')]=_0x2df226;return _0x4fcada;})[_0xb5d5('0x20')](respondWithFilteredResult(_0x4de56f,_0x47bc09))[_0xb5d5('0x41')](handleError(_0x4de56f,null));};exports['show']=function(_0x2cc77c,_0x446602){var _0x16cd87={'raw':![],'where':{'id':_0x2cc77c['params']['id']}},_0x3373ea={};_0x3373ea[_0xb5d5('0x2c')]=_[_0xb5d5('0x42')](db[_0xb5d5('0x27')]['rawAttributes']);_0x3373ea[_0xb5d5('0x2d')]=_[_0xb5d5('0x42')](_0x2cc77c[_0xb5d5('0x2d')]);_0x3373ea['filters']=_['intersection'](_0x3373ea[_0xb5d5('0x2c')],_0x3373ea[_0xb5d5('0x2d')]);_0x16cd87[_0xb5d5('0x30')]=_[_0xb5d5('0x2f')](_0x3373ea['model'],qs[_0xb5d5('0x31')](_0x2cc77c[_0xb5d5('0x2d')][_0xb5d5('0x31')]));_0x16cd87['attributes']=_0x16cd87['attributes'][_0xb5d5('0x32')]?_0x16cd87[_0xb5d5('0x30')]:_0x3373ea['model'];if(_0x2cc77c[_0xb5d5('0x2d')][_0xb5d5('0x3e')]){_0x16cd87[_0xb5d5('0x3f')]=[{'all':!![]}];}_0x16cd87=_[_0xb5d5('0x39')]({},_0x16cd87,_0x2cc77c[_0xb5d5('0x3c')]);return db[_0xb5d5('0x27')][_0xb5d5('0x43')](_0x16cd87)['then'](handleEntityNotFound(_0x446602,null))[_0xb5d5('0x20')](respondWithResult(_0x446602,null))[_0xb5d5('0x41')](handleError(_0x446602,null));};exports[_0xb5d5('0x44')]=function(_0x13d101,_0x32766e){return db[_0xb5d5('0x27')][_0xb5d5('0x44')](_0x13d101[_0xb5d5('0x45')],{})[_0xb5d5('0x20')](respondWithResult(_0x32766e,0xc9))[_0xb5d5('0x41')](handleError(_0x32766e,null));};exports[_0xb5d5('0x46')]=function(_0xfce39a,_0x3e876a){if(_0xfce39a[_0xb5d5('0x45')]['id']){delete _0xfce39a[_0xb5d5('0x45')]['id'];}return db['Dynamics365Configuration'][_0xb5d5('0x43')]({'where':{'id':_0xfce39a[_0xb5d5('0x47')]['id']}})[_0xb5d5('0x20')](handleEntityNotFound(_0x3e876a,null))[_0xb5d5('0x20')](saveUpdates(_0xfce39a[_0xb5d5('0x45')],null))['then'](respondWithResult(_0x3e876a,null))[_0xb5d5('0x41')](handleError(_0x3e876a,null));};exports['destroy']=function(_0x427fee,_0x52d91a){return db[_0xb5d5('0x27')]['find']({'where':{'id':_0x427fee['params']['id']}})[_0xb5d5('0x20')](handleEntityNotFound(_0x52d91a,null))[_0xb5d5('0x20')](removeEntity(_0x52d91a,null))[_0xb5d5('0x41')](handleError(_0x52d91a,null));};exports[_0xb5d5('0x48')]=function(_0x359bbd,_0x50a5e1,_0x347fec){var _0x1b8650={};var _0x46e5b3={};var _0x44ded4;var _0x33ab0b;return db[_0xb5d5('0x27')]['findOne']({'where':{'id':_0x359bbd[_0xb5d5('0x47')]['id']}})['then'](handleEntityNotFound(_0x50a5e1,null))['then'](function(_0x40b738){if(_0x40b738){_0x44ded4=_0x40b738;_0x46e5b3[_0xb5d5('0x2c')]=_[_0xb5d5('0x42')](db['Dynamics365Field']['rawAttributes']);_0x46e5b3[_0xb5d5('0x2d')]=_[_0xb5d5('0x42')](_0x359bbd[_0xb5d5('0x2d')]);_0x46e5b3[_0xb5d5('0x2e')]=_['intersection'](_0x46e5b3[_0xb5d5('0x2c')],_0x46e5b3['query']);_0x1b8650[_0xb5d5('0x30')]=_['intersection'](_0x46e5b3[_0xb5d5('0x2c')],qs['fields'](_0x359bbd[_0xb5d5('0x2d')][_0xb5d5('0x31')]));_0x1b8650[_0xb5d5('0x30')]=_0x1b8650['attributes'][_0xb5d5('0x32')]?_0x1b8650['attributes']:_0x46e5b3[_0xb5d5('0x2c')];_0x1b8650[_0xb5d5('0x35')]=qs[_0xb5d5('0x36')](_0x359bbd[_0xb5d5('0x2d')][_0xb5d5('0x36')]);_0x1b8650['where']=qs[_0xb5d5('0x2e')](_['pick'](_0x359bbd[_0xb5d5('0x2d')],_0x46e5b3[_0xb5d5('0x2e')]));if(_0x359bbd['query'][_0xb5d5('0x38')]){_0x1b8650[_0xb5d5('0x3a')]=_[_0xb5d5('0x39')](_0x1b8650[_0xb5d5('0x3a')],{'$or':_['map'](_0x1b8650['attributes'],function(_0x32b343){var _0xcfd286={};_0xcfd286[_0x32b343]={'$like':'%'+_0x359bbd[_0xb5d5('0x2d')][_0xb5d5('0x38')]+'%'};return _0xcfd286;})});}_0x1b8650=_[_0xb5d5('0x39')]({},_0x1b8650,_0x359bbd['options']);return _0x44ded4[_0xb5d5('0x48')](_0x1b8650);}})['then'](function(_0x49f622){if(_0x49f622){_0x33ab0b=_0x49f622[_0xb5d5('0x32')];if(!_0x359bbd['query'][_0xb5d5('0x33')](_0xb5d5('0x49'))){_0x1b8650['limit']=qs[_0xb5d5('0x34')](_0x359bbd[_0xb5d5('0x2d')][_0xb5d5('0x34')]);_0x1b8650[_0xb5d5('0x1b')]=qs[_0xb5d5('0x1b')](_0x359bbd[_0xb5d5('0x2d')][_0xb5d5('0x1b')]);}return _0x44ded4[_0xb5d5('0x48')](_0x1b8650);}})['then'](function(_0x18b73c){if(_0x18b73c){return _0x18b73c?{'count':_0x33ab0b,'rows':_0x18b73c}:null;}})[_0xb5d5('0x20')](respondWithResult(_0x50a5e1,null))[_0xb5d5('0x41')](handleError(_0x50a5e1,null));};exports[_0xb5d5('0x4a')]=function(_0xeefa65,_0x16f39b,_0x2d25d2){var _0x19b064={};var _0x3c0b56={};var _0x50999b;var _0x18d97d;return db[_0xb5d5('0x27')][_0xb5d5('0x4b')]({'where':{'id':_0xeefa65[_0xb5d5('0x47')]['id']}})[_0xb5d5('0x20')](handleEntityNotFound(_0x16f39b,null))[_0xb5d5('0x20')](function(_0x3c63d2){if(_0x3c63d2){_0x50999b=_0x3c63d2;_0x3c0b56[_0xb5d5('0x2c')]=_[_0xb5d5('0x42')](db[_0xb5d5('0x4c')]['rawAttributes']);_0x3c0b56[_0xb5d5('0x2d')]=_[_0xb5d5('0x42')](_0xeefa65[_0xb5d5('0x2d')]);_0x3c0b56[_0xb5d5('0x2e')]=_[_0xb5d5('0x2f')](_0x3c0b56[_0xb5d5('0x2c')],_0x3c0b56['query']);_0x19b064[_0xb5d5('0x30')]=_[_0xb5d5('0x2f')](_0x3c0b56[_0xb5d5('0x2c')],qs[_0xb5d5('0x31')](_0xeefa65[_0xb5d5('0x2d')]['fields']));_0x19b064['attributes']=_0x19b064[_0xb5d5('0x30')][_0xb5d5('0x32')]?_0x19b064[_0xb5d5('0x30')]:_0x3c0b56[_0xb5d5('0x2c')];_0x19b064[_0xb5d5('0x35')]=qs[_0xb5d5('0x36')](_0xeefa65['query'][_0xb5d5('0x36')]);_0x19b064[_0xb5d5('0x3a')]=qs[_0xb5d5('0x2e')](_[_0xb5d5('0x37')](_0xeefa65[_0xb5d5('0x2d')],_0x3c0b56['filters']));if(_0xeefa65['query'][_0xb5d5('0x38')]){_0x19b064['where']=_[_0xb5d5('0x39')](_0x19b064[_0xb5d5('0x3a')],{'$or':_[_0xb5d5('0x26')](_0x19b064[_0xb5d5('0x30')],function(_0x3e22ea){var _0x136191={};_0x136191[_0x3e22ea]={'$like':'%'+_0xeefa65[_0xb5d5('0x2d')][_0xb5d5('0x38')]+'%'};return _0x136191;})});}_0x19b064=_[_0xb5d5('0x39')]({},_0x19b064,_0xeefa65[_0xb5d5('0x3c')]);return _0x50999b['getSubjects'](_0x19b064);}})[_0xb5d5('0x20')](function(_0x43eb62){if(_0x43eb62){_0x18d97d=_0x43eb62[_0xb5d5('0x32')];if(!_0xeefa65[_0xb5d5('0x2d')][_0xb5d5('0x33')](_0xb5d5('0x49'))){_0x19b064['limit']=qs[_0xb5d5('0x34')](_0xeefa65['query'][_0xb5d5('0x34')]);_0x19b064['offset']=qs[_0xb5d5('0x1b')](_0xeefa65[_0xb5d5('0x2d')][_0xb5d5('0x1b')]);}return _0x50999b[_0xb5d5('0x4a')](_0x19b064);}})[_0xb5d5('0x20')](function(_0x2b906b){if(_0x2b906b){return _0x2b906b?{'count':_0x18d97d,'rows':_0x2b906b}:null;}})[_0xb5d5('0x20')](respondWithResult(_0x16f39b,null))[_0xb5d5('0x41')](handleError(_0x16f39b,null));};exports[_0xb5d5('0x4d')]=function(_0x17d3fe,_0x2b84bb,_0x53a77e){var _0x2e531b={};var _0x2c550c={};var _0x5a3b0d;var _0x230477;return db[_0xb5d5('0x27')][_0xb5d5('0x4b')]({'where':{'id':_0x17d3fe[_0xb5d5('0x47')]['id']}})[_0xb5d5('0x20')](handleEntityNotFound(_0x2b84bb,null))['then'](function(_0x58eafa){if(_0x58eafa){_0x5a3b0d=_0x58eafa;_0x2c550c['model']=_[_0xb5d5('0x42')](db[_0xb5d5('0x4c')][_0xb5d5('0x28')]);_0x2c550c[_0xb5d5('0x2d')]=_[_0xb5d5('0x42')](_0x17d3fe['query']);_0x2c550c[_0xb5d5('0x2e')]=_[_0xb5d5('0x2f')](_0x2c550c[_0xb5d5('0x2c')],_0x2c550c['query']);_0x2e531b[_0xb5d5('0x30')]=_[_0xb5d5('0x2f')](_0x2c550c[_0xb5d5('0x2c')],qs['fields'](_0x17d3fe['query']['fields']));_0x2e531b[_0xb5d5('0x30')]=_0x2e531b[_0xb5d5('0x30')][_0xb5d5('0x32')]?_0x2e531b[_0xb5d5('0x30')]:_0x2c550c[_0xb5d5('0x2c')];_0x2e531b[_0xb5d5('0x35')]=qs[_0xb5d5('0x36')](_0x17d3fe[_0xb5d5('0x2d')][_0xb5d5('0x36')]);_0x2e531b[_0xb5d5('0x3a')]=qs[_0xb5d5('0x2e')](_[_0xb5d5('0x37')](_0x17d3fe[_0xb5d5('0x2d')],_0x2c550c[_0xb5d5('0x2e')]));if(_0x17d3fe[_0xb5d5('0x2d')]['filter']){_0x2e531b['where']=_[_0xb5d5('0x39')](_0x2e531b[_0xb5d5('0x3a')],{'$or':_[_0xb5d5('0x26')](_0x2e531b['attributes'],function(_0x4f37de){var _0x516ddf={};_0x516ddf[_0x4f37de]={'$like':'%'+_0x17d3fe[_0xb5d5('0x2d')]['filter']+'%'};return _0x516ddf;})});}_0x2e531b=_[_0xb5d5('0x39')]({},_0x2e531b,_0x17d3fe[_0xb5d5('0x3c')]);return _0x5a3b0d[_0xb5d5('0x4d')](_0x2e531b);}})['then'](function(_0x2ebf0a){if(_0x2ebf0a){_0x230477=_0x2ebf0a['length'];if(!_0x17d3fe['query']['hasOwnProperty'](_0xb5d5('0x49'))){_0x2e531b[_0xb5d5('0x34')]=qs['limit'](_0x17d3fe[_0xb5d5('0x2d')][_0xb5d5('0x34')]);_0x2e531b[_0xb5d5('0x1b')]=qs[_0xb5d5('0x1b')](_0x17d3fe[_0xb5d5('0x2d')][_0xb5d5('0x1b')]);}return _0x5a3b0d[_0xb5d5('0x4d')](_0x2e531b);}})[_0xb5d5('0x20')](function(_0x4d289c){if(_0x4d289c){return _0x4d289c?{'count':_0x230477,'rows':_0x4d289c}:null;}})[_0xb5d5('0x20')](respondWithResult(_0x2b84bb,null))[_0xb5d5('0x41')](handleError(_0x2b84bb,null));};
\ No newline at end of file
index 6288dcd..2c5594b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00bb=['util','../../config/logger','moment','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x2e7f6a,_0x1901cb){var _0x217fb0=function(_0x50e268){while(--_0x50e268){_0x2e7f6a['push'](_0x2e7f6a['shift']());}};_0x217fb0(++_0x1901cb);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x00bb[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb4e6=['path','rimraf','./intDynamics365Configuration.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1e309a,_0x28afac){var _0x5a3b6a=function(_0x430dfa){while(--_0x430dfa){_0x1e309a['push'](_0x1e309a['shift']());}};_0x5a3b6a(++_0x28afac);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x1cc961,_0x2c42ee){_0x1cc961=_0x1cc961-0x0;var _0x471d86=_0xb4e6[_0x1cc961];return _0x471d86;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a423249..3629111 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae80=['../../config/environment','jayson/promise','client','then','info','Dynamics365Configuration,\x20%s,\x20%s','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2e6791,_0x29f201){var _0x425fe1=function(_0x7099ba){while(--_0x7099ba){_0x2e6791['push'](_0x2e6791['shift']());}};_0x425fe1(++_0x29f201);}(_0xae80,0x150));var _0x0ae8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xae80[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0ae8('0x0'));var util=require(_0x0ae8('0x1'));var moment=require(_0x0ae8('0x2'));var BPromise=require(_0x0ae8('0x3'));var rs=require(_0x0ae8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0ae8('0x5'))['db'];var utils=require(_0x0ae8('0x6'));var logger=require(_0x0ae8('0x7'))(_0x0ae8('0x8'));var config=require(_0x0ae8('0x9'));var jayson=require(_0x0ae8('0xa'));var client=jayson[_0x0ae8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf324a0,_0x4afff7,_0x3e07f6){return new BPromise(function(_0x434d53,_0xba830f){return client['request'](_0xf324a0,_0x3e07f6)[_0x0ae8('0xc')](function(_0x7af177){logger[_0x0ae8('0xd')](_0x0ae8('0xe'),_0x4afff7,'request\x20sent');logger['debug'](_0x0ae8('0xf'),_0x4afff7,_0x0ae8('0x10'),JSON[_0x0ae8('0x11')](_0x7af177));if(_0x7af177[_0x0ae8('0x12')]){if(_0x7af177[_0x0ae8('0x12')][_0x0ae8('0x13')]===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x4afff7,_0x7af177[_0x0ae8('0x12')][_0x0ae8('0x14')]);return _0xba830f(_0x7af177[_0x0ae8('0x12')]['message']);}logger[_0x0ae8('0x12')](_0x0ae8('0xe'),_0x4afff7,_0x7af177['error'][_0x0ae8('0x14')]);return _0x434d53(_0x7af177[_0x0ae8('0x12')][_0x0ae8('0x14')]);}else{logger[_0x0ae8('0xd')](_0x0ae8('0xe'),_0x4afff7,_0x0ae8('0x10'));_0x434d53(_0x7af177[_0x0ae8('0x15')][_0x0ae8('0x14')]);}})[_0x0ae8('0x16')](function(_0x166cb2){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x4afff7,_0x166cb2);_0xba830f(_0x166cb2);});});}
\ No newline at end of file
+var _0x580c=['client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','message','result','catch','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x102692,_0x2611a4){var _0x5935c9=function(_0x4c91fa){while(--_0x4c91fa){_0x102692['push'](_0x102692['shift']());}};_0x5935c9(++_0x2611a4);}(_0x580c,0xf6));var _0xc580=function(_0x1e8090,_0x382318){_0x1e8090=_0x1e8090-0x0;var _0xe5ba14=_0x580c[_0x1e8090];return _0xe5ba14;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc580('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc580('0x1'));var db=require(_0xc580('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xc580('0x3'))('rpc');var config=require(_0xc580('0x4'));var jayson=require(_0xc580('0x5'));var client=jayson[_0xc580('0x6')][_0xc580('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4bd0a3,_0x21443f,_0x1fab2b){return new BPromise(function(_0x218db5,_0x25ff8e){return client['request'](_0x4bd0a3,_0x1fab2b)[_0xc580('0x8')](function(_0x417d89){logger[_0xc580('0x9')](_0xc580('0xa'),_0x21443f,_0xc580('0xb'));logger[_0xc580('0xc')](_0xc580('0xd'),_0x21443f,_0xc580('0xb'),JSON['stringify'](_0x417d89));if(_0x417d89[_0xc580('0xe')]){if(_0x417d89[_0xc580('0xe')]['code']===0x1f4){logger[_0xc580('0xe')](_0xc580('0xa'),_0x21443f,_0x417d89['error'][_0xc580('0xf')]);return _0x25ff8e(_0x417d89['error'][_0xc580('0xf')]);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x21443f,_0x417d89[_0xc580('0xe')][_0xc580('0xf')]);return _0x218db5(_0x417d89['error'][_0xc580('0xf')]);}else{logger[_0xc580('0x9')](_0xc580('0xa'),_0x21443f,'request\x20sent');_0x218db5(_0x417d89[_0xc580('0x10')][_0xc580('0xf')]);}})[_0xc580('0x11')](function(_0x8a2a73){logger[_0xc580('0xe')](_0xc580('0xa'),_0x21443f,_0x8a2a73);_0x25ff8e(_0x8a2a73);});});}
\ No newline at end of file
index 689e10f..0142fe9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6870=['util','path','connect-timeout','Router','../../components/auth/service','get','isAuthenticated','index','post','create','update','delete','/:id','destroy','multer'];(function(_0x3b28bc,_0x5bf27d){var _0x214b3c=function(_0x2ec2ff){while(--_0x2ec2ff){_0x3b28bc['push'](_0x3b28bc['shift']());}};_0x214b3c(++_0x5bf27d);}(_0x6870,0x185));var _0x0687=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x6870[_0x173d7e];return _0x2220d6;};'use strict';var multer=require(_0x0687('0x0'));var util=require(_0x0687('0x1'));var path=require(_0x0687('0x2'));var timeout=require(_0x0687('0x3'));var express=require('express');var router=express[_0x0687('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0687('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0x0687('0x6')]('/',auth[_0x0687('0x7')](),controller[_0x0687('0x8')]);router[_0x0687('0x6')]('/:id',auth[_0x0687('0x7')](),controller['show']);router[_0x0687('0x9')]('/',auth['isAuthenticated'](),controller[_0x0687('0xa')]);router['put']('/:id',auth[_0x0687('0x7')](),controller[_0x0687('0xb')]);router[_0x0687('0xc')](_0x0687('0xd'),auth[_0x0687('0x7')](),controller[_0x0687('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xead6=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','create','update','delete','destroy','exports','multer','util'];(function(_0x20008a,_0x362490){var _0x5d0f1c=function(_0x122ecf){while(--_0x122ecf){_0x20008a['push'](_0x20008a['shift']());}};_0x5d0f1c(++_0x362490);}(_0xead6,0x1d2));var _0x6ead=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xead6[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x6ead('0x0'));var util=require(_0x6ead('0x1'));var path=require(_0x6ead('0x2'));var timeout=require(_0x6ead('0x3'));var express=require(_0x6ead('0x4'));var router=express['Router']();var fs_extra=require(_0x6ead('0x5'));var auth=require(_0x6ead('0x6'));var interaction=require(_0x6ead('0x7'));var config=require(_0x6ead('0x8'));var controller=require('./intDynamics365Field.controller');router[_0x6ead('0x9')]('/',auth[_0x6ead('0xa')](),controller[_0x6ead('0xb')]);router[_0x6ead('0x9')](_0x6ead('0xc'),auth[_0x6ead('0xa')](),controller['show']);router['post']('/',auth[_0x6ead('0xa')](),controller[_0x6ead('0xd')]);router['put'](_0x6ead('0xc'),auth[_0x6ead('0xa')](),controller[_0x6ead('0xe')]);router[_0x6ead('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x6ead('0x10')]);module[_0x6ead('0x11')]=router;
\ No newline at end of file
index cf95ebc..9783390 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4c2=['sequelize','string','keyValue','STRING','ENUM','customVariable','BOOLEAN'];(function(_0x187d80,_0x5b793f){var _0x498a77=function(_0x633dc9){while(--_0x633dc9){_0x187d80['push'](_0x187d80['shift']());}};_0x498a77(++_0x5b793f);}(_0xc4c2,0x1f1));var _0x2c4c=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xc4c2[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require(_0x2c4c('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x2c4c('0x1'),'variable','customVariable',_0x2c4c('0x2'),'picklist'),'defaultValue':_0x2c4c('0x1')},'content':{'type':Sequelize[_0x2c4c('0x3')]},'key':{'type':Sequelize[_0x2c4c('0x3')]},'keyType':{'type':Sequelize[_0x2c4c('0x4')]('string','variable',_0x2c4c('0x5'))},'keyContent':{'type':Sequelize[_0x2c4c('0x3')]},'idField':{'type':Sequelize[_0x2c4c('0x3')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2c4c('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2c4c('0x3')]}};
\ No newline at end of file
+var _0x6968=['exports','ENUM','string','variable','STRING','customVariable','sequelize'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x6968,0x1b1));var _0x8696=function(_0x3ceb73,_0x4829e5){_0x3ceb73=_0x3ceb73-0x0;var _0xf8ff4f=_0x6968[_0x3ceb73];return _0xf8ff4f;};'use strict';var Sequelize=require(_0x8696('0x0'));module[_0x8696('0x1')]={'type':{'type':Sequelize[_0x8696('0x2')](_0x8696('0x3'),_0x8696('0x4'),'customVariable','keyValue','picklist'),'defaultValue':_0x8696('0x3')},'content':{'type':Sequelize[_0x8696('0x5')]},'key':{'type':Sequelize[_0x8696('0x5')]},'keyType':{'type':Sequelize[_0x8696('0x2')](_0x8696('0x3'),_0x8696('0x4'),_0x8696('0x6'))},'keyContent':{'type':Sequelize[_0x8696('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8696('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 792eff0..fddfb8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56e0=['limit','count','apply','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','Dynamics365Field','includeAll','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined'];(function(_0x178856,_0x41f045){var _0x3c7fe7=function(_0x4d9ce4){while(--_0x4d9ce4){_0x178856['push'](_0x178856['shift']());}};_0x3c7fe7(++_0x41f045);}(_0x56e0,0x71));var _0x056e=function(_0x3cb9c1,_0x22670c){_0x3cb9c1=_0x3cb9c1-0x0;var _0xf7003b=_0x56e0[_0x3cb9c1];return _0xf7003b;};'use strict';var emlformat=require(_0x056e('0x0'));var rimraf=require(_0x056e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x056e('0x2'));var rp=require(_0x056e('0x3'));var moment=require(_0x056e('0x4'));var BPromise=require(_0x056e('0x5'));var Mustache=require(_0x056e('0x6'));var util=require(_0x056e('0x7'));var path=require(_0x056e('0x8'));var sox=require(_0x056e('0x9'));var csv=require(_0x056e('0xa'));var ejs=require(_0x056e('0xb'));var fs=require('fs');var fs_extra=require(_0x056e('0xc'));var _=require(_0x056e('0xd'));var squel=require(_0x056e('0xe'));var crypto=require(_0x056e('0xf'));var jsforce=require(_0x056e('0x10'));var deskjs=require(_0x056e('0x11'));var toCsv=require(_0x056e('0xa'));var querystring=require(_0x056e('0x12'));var Papa=require(_0x056e('0x13'));var Redis=require(_0x056e('0x14'));var authService=require(_0x056e('0x15'));var qs=require(_0x056e('0x16'));var as=require(_0x056e('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x056e('0x18'))(_0x056e('0x19'));var utils=require(_0x056e('0x1a'));var config=require(_0x056e('0x1b'));var licenseUtil=require(_0x056e('0x1c'));var db=require(_0x056e('0x1d'))['db'];function respondWithStatusCode(_0x59993f,_0x5b3007){_0x5b3007=_0x5b3007||0xcc;return function(_0x3ec1c1){if(_0x3ec1c1){return _0x59993f[_0x056e('0x1e')](_0x5b3007);}return _0x59993f['status'](_0x5b3007)[_0x056e('0x1f')]();};}function respondWithResult(_0x4b1760,_0x3c4dc4){_0x3c4dc4=_0x3c4dc4||0xc8;return function(_0x4dbb52){if(_0x4dbb52){return _0x4b1760[_0x056e('0x20')](_0x3c4dc4)['json'](_0x4dbb52);}};}function respondWithFilteredResult(_0x5cba96,_0x38a049){return function(_0x115d49){if(_0x115d49){var _0x5bee50=typeof _0x38a049[_0x056e('0x21')]===_0x056e('0x22')&&typeof _0x38a049[_0x056e('0x23')]===_0x056e('0x22');var _0x4b55b2=_0x115d49[_0x056e('0x24')];var _0x1bd56d=_0x5bee50?0x0:_0x38a049['offset'];var _0x2cf7e6=_0x5bee50?_0x115d49[_0x056e('0x24')]:_0x38a049[_0x056e('0x21')]+_0x38a049[_0x056e('0x23')];var _0x554050;if(_0x2cf7e6>=_0x4b55b2){_0x2cf7e6=_0x4b55b2;_0x554050=0xc8;}else{_0x554050=0xce;}_0x5cba96[_0x056e('0x20')](_0x554050);return _0x5cba96['set']('Content-Range',_0x1bd56d+'-'+_0x2cf7e6+'/'+_0x4b55b2)['json'](_0x115d49);}return null;};}function patchUpdates(_0x55f765){return function(_0x27d8ad){try{jsonpatch[_0x056e('0x25')](_0x27d8ad,_0x55f765,!![]);}catch(_0x37d62f){return BPromise['reject'](_0x37d62f);}return _0x27d8ad[_0x056e('0x26')]();};}function saveUpdates(_0x26a8ed,_0x21d2bf){return function(_0x32c539){if(_0x32c539){return _0x32c539[_0x056e('0x27')](_0x26a8ed)['then'](function(_0x10ac5f){return _0x10ac5f;});}return null;};}function removeEntity(_0x5ca41e,_0x209343){return function(_0x5331f4){if(_0x5331f4){return _0x5331f4[_0x056e('0x28')]()[_0x056e('0x29')](function(){_0x5ca41e['status'](0xcc)[_0x056e('0x1f')]();});}};}function handleEntityNotFound(_0x447438,_0x13e54d){return function(_0x1cdb64){if(!_0x1cdb64){_0x447438[_0x056e('0x1e')](0x194);}return _0x1cdb64;};}function handleError(_0x527144,_0x57dc04){_0x57dc04=_0x57dc04||0x1f4;return function(_0x14b6ef){logger[_0x056e('0x2a')](_0x14b6ef[_0x056e('0x2b')]);if(_0x14b6ef[_0x056e('0x2c')]){delete _0x14b6ef[_0x056e('0x2c')];}_0x527144[_0x056e('0x20')](_0x57dc04)[_0x056e('0x2d')](_0x14b6ef);};}exports['index']=function(_0x4f51a4,_0x15bb05){var _0x2e35ab={},_0x4c8c37={},_0x189c9b={'count':0x0,'rows':[]};var _0x1a1cd9=_[_0x056e('0x2e')](db['Dynamics365Field'][_0x056e('0x2f')],function(_0x2746e8){return{'name':_0x2746e8[_0x056e('0x30')],'type':_0x2746e8[_0x056e('0x31')][_0x056e('0x32')]};});_0x4c8c37[_0x056e('0x33')]=_['map'](_0x1a1cd9,'name');_0x4c8c37[_0x056e('0x34')]=_[_0x056e('0x35')](_0x4f51a4[_0x056e('0x34')]);_0x4c8c37[_0x056e('0x36')]=_[_0x056e('0x37')](_0x4c8c37[_0x056e('0x33')],_0x4c8c37['query']);_0x2e35ab[_0x056e('0x38')]=_[_0x056e('0x37')](_0x4c8c37[_0x056e('0x33')],qs[_0x056e('0x39')](_0x4f51a4['query'][_0x056e('0x39')]));_0x2e35ab[_0x056e('0x38')]=_0x2e35ab[_0x056e('0x38')]['length']?_0x2e35ab['attributes']:_0x4c8c37['model'];if(!_0x4f51a4[_0x056e('0x34')][_0x056e('0x3a')](_0x056e('0x3b'))){_0x2e35ab[_0x056e('0x23')]=qs[_0x056e('0x23')](_0x4f51a4[_0x056e('0x34')][_0x056e('0x23')]);_0x2e35ab[_0x056e('0x21')]=qs['offset'](_0x4f51a4[_0x056e('0x34')][_0x056e('0x21')]);}_0x2e35ab['order']=qs[_0x056e('0x3c')](_0x4f51a4['query'][_0x056e('0x3c')]);_0x2e35ab[_0x056e('0x3d')]=qs[_0x056e('0x36')](_[_0x056e('0x3e')](_0x4f51a4['query'],_0x4c8c37[_0x056e('0x36')]),_0x1a1cd9);if(_0x4f51a4[_0x056e('0x34')][_0x056e('0x3f')]){_0x2e35ab[_0x056e('0x3d')]=_['merge'](_0x2e35ab[_0x056e('0x3d')],{'$or':_[_0x056e('0x2e')](_0x1a1cd9,function(_0x1f3120){if(_0x1f3120[_0x056e('0x31')]!=='VIRTUAL'){var _0x29beaa={};_0x29beaa[_0x1f3120[_0x056e('0x2c')]]={'$like':'%'+_0x4f51a4['query'][_0x056e('0x3f')]+'%'};return _0x29beaa;}})});}_0x2e35ab=_[_0x056e('0x40')]({},_0x2e35ab,_0x4f51a4[_0x056e('0x41')]);var _0x47ad9f={'where':_0x2e35ab['where']};return db[_0x056e('0x42')][_0x056e('0x24')](_0x47ad9f)['then'](function(_0x7d803c){_0x189c9b[_0x056e('0x24')]=_0x7d803c;if(_0x4f51a4[_0x056e('0x34')][_0x056e('0x43')]){_0x2e35ab['include']=[{'all':!![]}];}return db[_0x056e('0x42')]['findAll'](_0x2e35ab);})[_0x056e('0x29')](function(_0x401b2e){_0x189c9b['rows']=_0x401b2e;return _0x189c9b;})[_0x056e('0x29')](respondWithFilteredResult(_0x15bb05,_0x2e35ab))[_0x056e('0x44')](handleError(_0x15bb05,null));};exports[_0x056e('0x45')]=function(_0x20917b,_0x159ab3){var _0x31dece={'raw':!![],'where':{'id':_0x20917b[_0x056e('0x46')]['id']}},_0x21a515={};_0x21a515['model']=_[_0x056e('0x35')](db[_0x056e('0x42')][_0x056e('0x2f')]);_0x21a515['query']=_['keys'](_0x20917b['query']);_0x21a515[_0x056e('0x36')]=_[_0x056e('0x37')](_0x21a515[_0x056e('0x33')],_0x21a515[_0x056e('0x34')]);_0x31dece[_0x056e('0x38')]=_[_0x056e('0x37')](_0x21a515[_0x056e('0x33')],qs[_0x056e('0x39')](_0x20917b[_0x056e('0x34')][_0x056e('0x39')]));_0x31dece['attributes']=_0x31dece[_0x056e('0x38')]['length']?_0x31dece[_0x056e('0x38')]:_0x21a515[_0x056e('0x33')];if(_0x20917b[_0x056e('0x34')][_0x056e('0x43')]){_0x31dece['include']=[{'all':!![]}];}_0x31dece=_[_0x056e('0x40')]({},_0x31dece,_0x20917b[_0x056e('0x41')]);return db[_0x056e('0x42')][_0x056e('0x47')](_0x31dece)[_0x056e('0x29')](handleEntityNotFound(_0x159ab3,null))[_0x056e('0x29')](respondWithResult(_0x159ab3,null))[_0x056e('0x44')](handleError(_0x159ab3,null));};exports[_0x056e('0x48')]=function(_0x5548cf,_0x386b57){return db[_0x056e('0x42')][_0x056e('0x48')](_0x5548cf[_0x056e('0x49')],{})[_0x056e('0x29')](respondWithResult(_0x386b57,0xc9))[_0x056e('0x44')](handleError(_0x386b57,null));};exports[_0x056e('0x27')]=function(_0x3f9e4a,_0x56119d){if(_0x3f9e4a[_0x056e('0x49')]['id']){delete _0x3f9e4a['body']['id'];}return db['Dynamics365Field'][_0x056e('0x47')]({'where':{'id':_0x3f9e4a[_0x056e('0x46')]['id']}})[_0x056e('0x29')](handleEntityNotFound(_0x56119d,null))[_0x056e('0x29')](saveUpdates(_0x3f9e4a[_0x056e('0x49')],null))['then'](respondWithResult(_0x56119d,null))[_0x056e('0x44')](handleError(_0x56119d,null));};exports[_0x056e('0x28')]=function(_0xf43b1e,_0x39c89c){return db[_0x056e('0x42')]['find']({'where':{'id':_0xf43b1e['params']['id']}})[_0x056e('0x29')](handleEntityNotFound(_0x39c89c,null))[_0x056e('0x29')](removeEntity(_0x39c89c,null))[_0x056e('0x44')](handleError(_0x39c89c,null));};
\ No newline at end of file
+var _0xef4f=['model','map','query','keys','intersection','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Dynamics365Field','count','includeAll','include','findAll','catch','show','params','rawAttributes','fields','find','create','update','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','apply','reject','save','then','destroy','end','error','stack','name','index','fieldName','type','key'];(function(_0x1a1dc7,_0x50eb7f){var _0x1eb5ac=function(_0x15dfc0){while(--_0x15dfc0){_0x1a1dc7['push'](_0x1a1dc7['shift']());}};_0x1eb5ac(++_0x50eb7f);}(_0xef4f,0x6b));var _0xfef4=function(_0x4aef9f,_0x17a79b){_0x4aef9f=_0x4aef9f-0x0;var _0x1e4d0f=_0xef4f[_0x4aef9f];return _0x1e4d0f;};'use strict';var emlformat=require(_0xfef4('0x0'));var rimraf=require(_0xfef4('0x1'));var zipdir=require(_0xfef4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfef4('0x3'));var BPromise=require(_0xfef4('0x4'));var Mustache=require(_0xfef4('0x5'));var util=require(_0xfef4('0x6'));var path=require(_0xfef4('0x7'));var sox=require('sox');var csv=require(_0xfef4('0x8'));var ejs=require(_0xfef4('0x9'));var fs=require('fs');var fs_extra=require(_0xfef4('0xa'));var _=require(_0xfef4('0xb'));var squel=require(_0xfef4('0xc'));var crypto=require(_0xfef4('0xd'));var jsforce=require(_0xfef4('0xe'));var deskjs=require(_0xfef4('0xf'));var toCsv=require(_0xfef4('0x8'));var querystring=require('querystring');var Papa=require(_0xfef4('0x10'));var Redis=require(_0xfef4('0x11'));var authService=require(_0xfef4('0x12'));var qs=require(_0xfef4('0x13'));var as=require(_0xfef4('0x14'));var hardwareService=require(_0xfef4('0x15'));var logger=require(_0xfef4('0x16'))(_0xfef4('0x17'));var utils=require(_0xfef4('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xfef4('0x19'));var db=require(_0xfef4('0x1a'))['db'];function respondWithStatusCode(_0x4f5125,_0xc381b){_0xc381b=_0xc381b||0xcc;return function(_0x3dcb25){if(_0x3dcb25){return _0x4f5125['sendStatus'](_0xc381b);}return _0x4f5125['status'](_0xc381b)['end']();};}function respondWithResult(_0x525fef,_0x550fbb){_0x550fbb=_0x550fbb||0xc8;return function(_0x2b69ad){if(_0x2b69ad){return _0x525fef[_0xfef4('0x1b')](_0x550fbb)[_0xfef4('0x1c')](_0x2b69ad);}};}function respondWithFilteredResult(_0x449905,_0x1fdbcb){return function(_0x463437){if(_0x463437){var _0x10a15c=typeof _0x1fdbcb[_0xfef4('0x1d')]===_0xfef4('0x1e')&&typeof _0x1fdbcb[_0xfef4('0x1f')]===_0xfef4('0x1e');var _0x2d8ff5=_0x463437['count'];var _0x52b60a=_0x10a15c?0x0:_0x1fdbcb['offset'];var _0x307f35=_0x10a15c?_0x463437['count']:_0x1fdbcb[_0xfef4('0x1d')]+_0x1fdbcb[_0xfef4('0x1f')];var _0x253448;if(_0x307f35>=_0x2d8ff5){_0x307f35=_0x2d8ff5;_0x253448=0xc8;}else{_0x253448=0xce;}_0x449905[_0xfef4('0x1b')](_0x253448);return _0x449905['set']('Content-Range',_0x52b60a+'-'+_0x307f35+'/'+_0x2d8ff5)['json'](_0x463437);}return null;};}function patchUpdates(_0x4f7288){return function(_0xf9f20c){try{jsonpatch[_0xfef4('0x20')](_0xf9f20c,_0x4f7288,!![]);}catch(_0x18effe){return BPromise[_0xfef4('0x21')](_0x18effe);}return _0xf9f20c[_0xfef4('0x22')]();};}function saveUpdates(_0x425a51,_0x301f9d){return function(_0x1f442b){if(_0x1f442b){return _0x1f442b['update'](_0x425a51)[_0xfef4('0x23')](function(_0x28fe87){return _0x28fe87;});}return null;};}function removeEntity(_0x3b14fb,_0x26acd9){return function(_0x84ec33){if(_0x84ec33){return _0x84ec33[_0xfef4('0x24')]()[_0xfef4('0x23')](function(){_0x3b14fb[_0xfef4('0x1b')](0xcc)[_0xfef4('0x25')]();});}};}function handleEntityNotFound(_0x441d8a,_0x2ad206){return function(_0x91c461){if(!_0x91c461){_0x441d8a['sendStatus'](0x194);}return _0x91c461;};}function handleError(_0x1eacb8,_0xae7651){_0xae7651=_0xae7651||0x1f4;return function(_0x2d9746){logger[_0xfef4('0x26')](_0x2d9746[_0xfef4('0x27')]);if(_0x2d9746[_0xfef4('0x28')]){delete _0x2d9746['name'];}_0x1eacb8[_0xfef4('0x1b')](_0xae7651)['send'](_0x2d9746);};}exports[_0xfef4('0x29')]=function(_0x1bed9a,_0x1ca51f){var _0x54d7e2={},_0x40a53e={},_0x463c04={'count':0x0,'rows':[]};var _0xed81b1=_['map'](db['Dynamics365Field']['rawAttributes'],function(_0x28f16a){return{'name':_0x28f16a[_0xfef4('0x2a')],'type':_0x28f16a[_0xfef4('0x2b')][_0xfef4('0x2c')]};});_0x40a53e[_0xfef4('0x2d')]=_[_0xfef4('0x2e')](_0xed81b1,'name');_0x40a53e[_0xfef4('0x2f')]=_[_0xfef4('0x30')](_0x1bed9a[_0xfef4('0x2f')]);_0x40a53e['filters']=_[_0xfef4('0x31')](_0x40a53e[_0xfef4('0x2d')],_0x40a53e[_0xfef4('0x2f')]);_0x54d7e2[_0xfef4('0x32')]=_['intersection'](_0x40a53e[_0xfef4('0x2d')],qs['fields'](_0x1bed9a[_0xfef4('0x2f')]['fields']));_0x54d7e2['attributes']=_0x54d7e2[_0xfef4('0x32')][_0xfef4('0x33')]?_0x54d7e2[_0xfef4('0x32')]:_0x40a53e[_0xfef4('0x2d')];if(!_0x1bed9a['query'][_0xfef4('0x34')]('nolimit')){_0x54d7e2['limit']=qs[_0xfef4('0x1f')](_0x1bed9a[_0xfef4('0x2f')][_0xfef4('0x1f')]);_0x54d7e2[_0xfef4('0x1d')]=qs[_0xfef4('0x1d')](_0x1bed9a[_0xfef4('0x2f')][_0xfef4('0x1d')]);}_0x54d7e2[_0xfef4('0x35')]=qs[_0xfef4('0x36')](_0x1bed9a[_0xfef4('0x2f')][_0xfef4('0x36')]);_0x54d7e2[_0xfef4('0x37')]=qs[_0xfef4('0x38')](_[_0xfef4('0x39')](_0x1bed9a[_0xfef4('0x2f')],_0x40a53e[_0xfef4('0x38')]),_0xed81b1);if(_0x1bed9a[_0xfef4('0x2f')][_0xfef4('0x3a')]){_0x54d7e2[_0xfef4('0x37')]=_[_0xfef4('0x3b')](_0x54d7e2[_0xfef4('0x37')],{'$or':_[_0xfef4('0x2e')](_0xed81b1,function(_0x4e10f6){if(_0x4e10f6[_0xfef4('0x2b')]!==_0xfef4('0x3c')){var _0x58b954={};_0x58b954[_0x4e10f6[_0xfef4('0x28')]]={'$like':'%'+_0x1bed9a[_0xfef4('0x2f')]['filter']+'%'};return _0x58b954;}})});}_0x54d7e2=_[_0xfef4('0x3b')]({},_0x54d7e2,_0x1bed9a[_0xfef4('0x3d')]);var _0x383e82={'where':_0x54d7e2[_0xfef4('0x37')]};return db[_0xfef4('0x3e')][_0xfef4('0x3f')](_0x383e82)['then'](function(_0x3c81d6){_0x463c04[_0xfef4('0x3f')]=_0x3c81d6;if(_0x1bed9a['query'][_0xfef4('0x40')]){_0x54d7e2[_0xfef4('0x41')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xfef4('0x42')](_0x54d7e2);})[_0xfef4('0x23')](function(_0x5dd271){_0x463c04['rows']=_0x5dd271;return _0x463c04;})[_0xfef4('0x23')](respondWithFilteredResult(_0x1ca51f,_0x54d7e2))[_0xfef4('0x43')](handleError(_0x1ca51f,null));};exports[_0xfef4('0x44')]=function(_0x49397b,_0x37d6f7){var _0x3fbfcd={'raw':!![],'where':{'id':_0x49397b[_0xfef4('0x45')]['id']}},_0x5827b1={};_0x5827b1['model']=_['keys'](db[_0xfef4('0x3e')][_0xfef4('0x46')]);_0x5827b1[_0xfef4('0x2f')]=_[_0xfef4('0x30')](_0x49397b[_0xfef4('0x2f')]);_0x5827b1[_0xfef4('0x38')]=_[_0xfef4('0x31')](_0x5827b1[_0xfef4('0x2d')],_0x5827b1[_0xfef4('0x2f')]);_0x3fbfcd[_0xfef4('0x32')]=_['intersection'](_0x5827b1[_0xfef4('0x2d')],qs[_0xfef4('0x47')](_0x49397b[_0xfef4('0x2f')][_0xfef4('0x47')]));_0x3fbfcd['attributes']=_0x3fbfcd[_0xfef4('0x32')][_0xfef4('0x33')]?_0x3fbfcd[_0xfef4('0x32')]:_0x5827b1[_0xfef4('0x2d')];if(_0x49397b[_0xfef4('0x2f')][_0xfef4('0x40')]){_0x3fbfcd[_0xfef4('0x41')]=[{'all':!![]}];}_0x3fbfcd=_[_0xfef4('0x3b')]({},_0x3fbfcd,_0x49397b[_0xfef4('0x3d')]);return db[_0xfef4('0x3e')][_0xfef4('0x48')](_0x3fbfcd)[_0xfef4('0x23')](handleEntityNotFound(_0x37d6f7,null))[_0xfef4('0x23')](respondWithResult(_0x37d6f7,null))[_0xfef4('0x43')](handleError(_0x37d6f7,null));};exports[_0xfef4('0x49')]=function(_0x2add56,_0x5d88cc){return db[_0xfef4('0x3e')]['create'](_0x2add56['body'],{})['then'](respondWithResult(_0x5d88cc,0xc9))[_0xfef4('0x43')](handleError(_0x5d88cc,null));};exports[_0xfef4('0x4a')]=function(_0x24fdbe,_0x658b38){if(_0x24fdbe[_0xfef4('0x4b')]['id']){delete _0x24fdbe[_0xfef4('0x4b')]['id'];}return db[_0xfef4('0x3e')]['find']({'where':{'id':_0x24fdbe[_0xfef4('0x45')]['id']}})['then'](handleEntityNotFound(_0x658b38,null))[_0xfef4('0x23')](saveUpdates(_0x24fdbe[_0xfef4('0x4b')],null))[_0xfef4('0x23')](respondWithResult(_0x658b38,null))['catch'](handleError(_0x658b38,null));};exports[_0xfef4('0x24')]=function(_0x2c9598,_0x4471f4){return db[_0xfef4('0x3e')][_0xfef4('0x48')]({'where':{'id':_0x2c9598[_0xfef4('0x45')]['id']}})[_0xfef4('0x23')](handleEntityNotFound(_0x4471f4,null))['then'](removeEntity(_0x4471f4,null))[_0xfef4('0x43')](handleError(_0x4471f4,null));};
\ No newline at end of file
index 0fdcd03..14ef930 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd790=['define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports'];(function(_0xa266c1,_0x45b007){var _0x2c752b=function(_0x160142){while(--_0x160142){_0xa266c1['push'](_0xa266c1['shift']());}};_0x2c752b(++_0x45b007);}(_0xd790,0xf6));var _0x0d79=function(_0x3b8e51,_0x5eb61a){_0x3b8e51=_0x3b8e51-0x0;var _0x37068f=_0xd790[_0x3b8e51];return _0x37068f;};'use strict';var _=require(_0x0d79('0x0'));var util=require(_0x0d79('0x1'));var logger=require('../../config/logger')(_0x0d79('0x2'));var moment=require(_0x0d79('0x3'));var BPromise=require('bluebird');var rp=require(_0x0d79('0x4'));var fs=require('fs');var path=require(_0x0d79('0x5'));var rimraf=require(_0x0d79('0x6'));var config=require(_0x0d79('0x7'));var attributes=require(_0x0d79('0x8'));module[_0x0d79('0x9')]=function(_0x48cd2a,_0x31b698){return _0x48cd2a[_0x0d79('0xa')](_0x0d79('0xb'),attributes,{'tableName':_0x0d79('0xc'),'paranoid':![],'indexes':[{'name':_0x0d79('0xd'),'fields':[_0x0d79('0xe'),_0x0d79('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c57=['path','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','api','moment','request-promise'];(function(_0x5d117a,_0x2e9fe4){var _0x3925d7=function(_0x5b95d0){while(--_0x5b95d0){_0x5d117a['push'](_0x5d117a['shift']());}};_0x3925d7(++_0x2e9fe4);}(_0x1c57,0x1ea));var _0x71c5=function(_0x4e2b60,_0x3aa0e7){_0x4e2b60=_0x4e2b60-0x0;var _0x41b21e=_0x1c57[_0x4e2b60];return _0x41b21e;};'use strict';var _=require(_0x71c5('0x0'));var util=require(_0x71c5('0x1'));var logger=require('../../config/logger')(_0x71c5('0x2'));var moment=require(_0x71c5('0x3'));var BPromise=require('bluebird');var rp=require(_0x71c5('0x4'));var fs=require('fs');var path=require(_0x71c5('0x5'));var rimraf=require(_0x71c5('0x6'));var config=require(_0x71c5('0x7'));var attributes=require(_0x71c5('0x8'));module['exports']=function(_0x2578d,_0x4241b1){return _0x2578d[_0x71c5('0x9')](_0x71c5('0xa'),attributes,{'tableName':_0x71c5('0xb'),'paranoid':![],'indexes':[{'name':_0x71c5('0xc'),'fields':[_0x71c5('0xd'),_0x71c5('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 0e3c184..bf9ef10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd41=['request','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x5eca50,_0xc1e3f8){var _0x41fb84=function(_0x4ce3f3){while(--_0x4ce3f3){_0x5eca50['push'](_0x5eca50['shift']());}};_0x41fb84(++_0xc1e3f8);}(_0xdd41,0x180));var _0x1dd4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd41[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1dd4('0x0'));var util=require(_0x1dd4('0x1'));var moment=require(_0x1dd4('0x2'));var BPromise=require(_0x1dd4('0x3'));var rs=require(_0x1dd4('0x4'));var fs=require('fs');var Redis=require(_0x1dd4('0x5'));var db=require(_0x1dd4('0x6'))['db'];var utils=require(_0x1dd4('0x7'));var logger=require(_0x1dd4('0x8'))(_0x1dd4('0x9'));var config=require('../../config/environment');var jayson=require(_0x1dd4('0xa'));var client=jayson['client'][_0x1dd4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44afe5,_0x488f5f,_0x52a4cf){return new BPromise(function(_0x433d3f,_0x3cbe4e){return client[_0x1dd4('0xc')](_0x44afe5,_0x52a4cf)['then'](function(_0x3092a6){logger[_0x1dd4('0xd')](_0x1dd4('0xe'),_0x488f5f,'request\x20sent');logger[_0x1dd4('0xf')](_0x1dd4('0x10'),_0x488f5f,'request\x20sent',JSON['stringify'](_0x3092a6));if(_0x3092a6[_0x1dd4('0x11')]){if(_0x3092a6[_0x1dd4('0x11')][_0x1dd4('0x12')]===0x1f4){logger[_0x1dd4('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x488f5f,_0x3092a6[_0x1dd4('0x11')][_0x1dd4('0x13')]);return _0x3cbe4e(_0x3092a6[_0x1dd4('0x11')][_0x1dd4('0x13')]);}logger[_0x1dd4('0x11')](_0x1dd4('0xe'),_0x488f5f,_0x3092a6['error']['message']);return _0x433d3f(_0x3092a6[_0x1dd4('0x11')][_0x1dd4('0x13')]);}else{logger[_0x1dd4('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x488f5f,_0x1dd4('0x14'));_0x433d3f(_0x3092a6[_0x1dd4('0x15')][_0x1dd4('0x13')]);}})['catch'](function(_0x1ce058){logger[_0x1dd4('0x11')](_0x1dd4('0xe'),_0x488f5f,_0x1ce058);_0x3cbe4e(_0x1ce058);});});}
\ No newline at end of file
+var _0xf012=['catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf012,0x19f));var _0x2f01=function(_0xabca41,_0xbfdf4a){_0xabca41=_0xabca41-0x0;var _0x404ccb=_0xf012[_0xabca41];return _0x404ccb;};'use strict';var _=require('lodash');var util=require(_0x2f01('0x0'));var moment=require(_0x2f01('0x1'));var BPromise=require(_0x2f01('0x2'));var rs=require(_0x2f01('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f01('0x4'))['db'];var utils=require(_0x2f01('0x5'));var logger=require(_0x2f01('0x6'))(_0x2f01('0x7'));var config=require('../../config/environment');var jayson=require(_0x2f01('0x8'));var client=jayson[_0x2f01('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f0f66,_0x52cb92,_0x3f6d62){return new BPromise(function(_0x33e568,_0xcbcad2){return client[_0x2f01('0xa')](_0x5f0f66,_0x3f6d62)[_0x2f01('0xb')](function(_0x12cebd){logger[_0x2f01('0xc')](_0x2f01('0xd'),_0x52cb92,'request\x20sent');logger[_0x2f01('0xe')](_0x2f01('0xf'),_0x52cb92,_0x2f01('0x10'),JSON[_0x2f01('0x11')](_0x12cebd));if(_0x12cebd['error']){if(_0x12cebd[_0x2f01('0x12')][_0x2f01('0x13')]===0x1f4){logger[_0x2f01('0x12')](_0x2f01('0xd'),_0x52cb92,_0x12cebd[_0x2f01('0x12')][_0x2f01('0x14')]);return _0xcbcad2(_0x12cebd[_0x2f01('0x12')][_0x2f01('0x14')]);}logger[_0x2f01('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x52cb92,_0x12cebd[_0x2f01('0x12')][_0x2f01('0x14')]);return _0x33e568(_0x12cebd['error']['message']);}else{logger[_0x2f01('0xc')](_0x2f01('0xd'),_0x52cb92,_0x2f01('0x10'));_0x33e568(_0x12cebd[_0x2f01('0x15')]['message']);}})[_0x2f01('0x16')](function(_0x3bc2f2){logger[_0x2f01('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x52cb92,_0x3bc2f2);_0xcbcad2(_0x3bc2f2);});});}
\ No newline at end of file
index c98ef2d..b3a6cac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7b5=['getConfigurations','/:id/fields','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','/:id','isAuthenticated','show'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa7b5,0x1d7));var _0x5a7b=function(_0x155c9e,_0x41622c){_0x155c9e=_0x155c9e-0x0;var _0x572919=_0xa7b5[_0x155c9e];return _0x572919;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5a7b('0x0'));var timeout=require(_0x5a7b('0x1'));var express=require(_0x5a7b('0x2'));var router=express[_0x5a7b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5a7b('0x4'));var interaction=require(_0x5a7b('0x5'));var config=require(_0x5a7b('0x6'));var controller=require(_0x5a7b('0x7'));router[_0x5a7b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5a7b('0x9'),auth[_0x5a7b('0xa')](),controller[_0x5a7b('0xb')]);router[_0x5a7b('0x8')]('/:id/configurations',auth[_0x5a7b('0xa')](),controller[_0x5a7b('0xc')]);router[_0x5a7b('0x8')](_0x5a7b('0xd'),auth[_0x5a7b('0xa')](),controller['getFields']);router[_0x5a7b('0xe')]('/',auth[_0x5a7b('0xa')](),controller[_0x5a7b('0xf')]);router['post']('/:id/configurations',auth[_0x5a7b('0xa')](),controller['addConfiguration']);router[_0x5a7b('0x10')](_0x5a7b('0x9'),auth[_0x5a7b('0xa')](),controller[_0x5a7b('0x11')]);router[_0x5a7b('0x12')](_0x5a7b('0x9'),auth[_0x5a7b('0xa')](),controller[_0x5a7b('0x13')]);module[_0x5a7b('0x14')]=router;
\ No newline at end of file
+var _0x4dd6=['./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','put','update','delete','destroy','exports','multer','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x5daf2e,_0x13f545){var _0x374b9f=function(_0x5c0ab5){while(--_0x5c0ab5){_0x5daf2e['push'](_0x5daf2e['shift']());}};_0x374b9f(++_0x13f545);}(_0x4dd6,0x1c9));var _0x64dd=function(_0xe57ed5,_0x57f49e){_0xe57ed5=_0xe57ed5-0x0;var _0x24aa30=_0x4dd6[_0xe57ed5];return _0x24aa30;};'use strict';var multer=require(_0x64dd('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x64dd('0x1'));var router=express[_0x64dd('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x64dd('0x3'));var config=require(_0x64dd('0x4'));var controller=require(_0x64dd('0x5'));router[_0x64dd('0x6')]('/',auth[_0x64dd('0x7')](),controller[_0x64dd('0x8')]);router['get'](_0x64dd('0x9'),auth['isAuthenticated'](),controller[_0x64dd('0xa')]);router['get'](_0x64dd('0xb'),auth[_0x64dd('0x7')](),controller[_0x64dd('0xc')]);router['get'](_0x64dd('0xd'),auth[_0x64dd('0x7')](),controller['getFields']);router['post']('/',auth[_0x64dd('0x7')](),controller[_0x64dd('0xe')]);router[_0x64dd('0xf')]('/:id/configurations',auth[_0x64dd('0x7')](),controller['addConfiguration']);router[_0x64dd('0x10')](_0x64dd('0x9'),auth[_0x64dd('0x7')](),controller[_0x64dd('0x11')]);router[_0x64dd('0x12')](_0x64dd('0x9'),auth[_0x64dd('0x7')](),controller[_0x64dd('0x13')]);module[_0x64dd('0x14')]=router;
\ No newline at end of file
index d1d5589..aaaf415 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7916=['sequelize','STRING','username','remoteUri'];(function(_0x29ea84,_0x497c04){var _0x1e134e=function(_0x21b127){while(--_0x21b127){_0x29ea84['push'](_0x29ea84['shift']());}};_0x1e134e(++_0x497c04);}(_0x7916,0x128));var _0x6791=function(_0x24fcbc,_0x5108d5){_0x24fcbc=_0x24fcbc-0x0;var _0x5d8757=_0x7916[_0x24fcbc];return _0x5d8757;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'name':{'type':Sequelize[_0x6791('0x1')]},'description':{'type':Sequelize[_0x6791('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x6791('0x2')},'apiKey':{'type':Sequelize[_0x6791('0x1')]},'remoteUri':{'type':Sequelize[_0x6791('0x1')],'unique':_0x6791('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x7916=['sequelize','STRING','username','remoteUri'];(function(_0x240df3,_0x515368){var _0x4a2815=function(_0x5ae814){while(--_0x5ae814){_0x240df3['push'](_0x240df3['shift']());}};_0x4a2815(++_0x515368);}(_0x7916,0x128));var _0x6791=function(_0x38175c,_0x2de69b){_0x38175c=_0x38175c-0x0;var _0x1566ad=_0x7916[_0x38175c];return _0x1566ad;};'use strict';var Sequelize=require(_0x6791('0x0'));module['exports']={'name':{'type':Sequelize[_0x6791('0x1')]},'description':{'type':Sequelize[_0x6791('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x6791('0x2')},'apiKey':{'type':Sequelize[_0x6791('0x1')]},'remoteUri':{'type':Sequelize[_0x6791('0x1')],'unique':_0x6791('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index e5496b6..678df77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa047=['default','custom_text','choices','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','FreshdeskAccount','includeAll','findAll','catch','show','include','find','create','body','params','destroy','FreshdeskConfiguration','getConfigurations','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri','slice','lastIndexOf','GET','%s/%s','format','Basic\x20%s','%s:X','toString','subject','agent','priority','group','ticket_type','company','remove','includes'];(function(_0x3bc441,_0x146bbc){var _0x25a34f=function(_0x2b6c95){while(--_0x2b6c95){_0x3bc441['push'](_0x3bc441['shift']());}};_0x25a34f(++_0x146bbc);}(_0xa047,0x1c5));var _0x7a04=function(_0x2074db,_0x10b81b){_0x2074db=_0x2074db-0x0;var _0x27324c=_0xa047[_0x2074db];return _0x27324c;};'use strict';var emlformat=require(_0x7a04('0x0'));var rimraf=require(_0x7a04('0x1'));var zipdir=require(_0x7a04('0x2'));var jsonpatch=require(_0x7a04('0x3'));var rp=require('request-promise');var moment=require(_0x7a04('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7a04('0x5'));var util=require(_0x7a04('0x6'));var path=require(_0x7a04('0x7'));var sox=require(_0x7a04('0x8'));var csv=require(_0x7a04('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7a04('0xa'));var _=require(_0x7a04('0xb'));var squel=require(_0x7a04('0xc'));var crypto=require('crypto');var jsforce=require(_0x7a04('0xd'));var deskjs=require(_0x7a04('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7a04('0xf'));var Papa=require(_0x7a04('0x10'));var Redis=require('ioredis');var authService=require(_0x7a04('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7a04('0x12'));var logger=require(_0x7a04('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7a04('0x14'));var db=require(_0x7a04('0x15'))['db'];var integrations=require(_0x7a04('0x16'));function respondWithStatusCode(_0x15a002,_0x10931c){_0x10931c=_0x10931c||0xcc;return function(_0x44a0a1){if(_0x44a0a1){return _0x15a002[_0x7a04('0x17')](_0x10931c);}return _0x15a002[_0x7a04('0x18')](_0x10931c)[_0x7a04('0x19')]();};}function respondWithResult(_0x5ae457,_0x3b601d){_0x3b601d=_0x3b601d||0xc8;return function(_0x280398){if(_0x280398){return _0x5ae457[_0x7a04('0x18')](_0x3b601d)[_0x7a04('0x1a')](_0x280398);}};}function respondWithFilteredResult(_0x2bb838,_0x328973){return function(_0x4f434f){if(_0x4f434f){var _0x3542d4=typeof _0x328973[_0x7a04('0x1b')]===_0x7a04('0x1c')&&typeof _0x328973['limit']==='undefined';var _0x3b27b8=_0x4f434f[_0x7a04('0x1d')];var _0x247abd=_0x3542d4?0x0:_0x328973['offset'];var _0x180f01=_0x3542d4?_0x4f434f[_0x7a04('0x1d')]:_0x328973['offset']+_0x328973[_0x7a04('0x1e')];var _0x5a5bf5;if(_0x180f01>=_0x3b27b8){_0x180f01=_0x3b27b8;_0x5a5bf5=0xc8;}else{_0x5a5bf5=0xce;}_0x2bb838[_0x7a04('0x18')](_0x5a5bf5);return _0x2bb838['set'](_0x7a04('0x1f'),_0x247abd+'-'+_0x180f01+'/'+_0x3b27b8)[_0x7a04('0x1a')](_0x4f434f);}return null;};}function patchUpdates(_0x51b13b){return function(_0x37494a){try{jsonpatch[_0x7a04('0x20')](_0x37494a,_0x51b13b,!![]);}catch(_0x594d06){return BPromise[_0x7a04('0x21')](_0x594d06);}return _0x37494a[_0x7a04('0x22')]();};}function saveUpdates(_0x57eaa5,_0x281562){return function(_0x130bc9){if(_0x130bc9){return _0x130bc9[_0x7a04('0x23')](_0x57eaa5)[_0x7a04('0x24')](function(_0x2f8ff6){return _0x2f8ff6;});}return null;};}function removeEntity(_0x21b668,_0x1deb47){return function(_0x32e678){if(_0x32e678){return _0x32e678['destroy']()[_0x7a04('0x24')](function(){_0x21b668['status'](0xcc)[_0x7a04('0x19')]();});}};}function handleEntityNotFound(_0x415d54,_0x2da06b){return function(_0x2cd2e4){if(!_0x2cd2e4){_0x415d54[_0x7a04('0x17')](0x194);}return _0x2cd2e4;};}function handleError(_0x1ff41b,_0x3743b3){_0x3743b3=_0x3743b3||0x1f4;return function(_0x5f9fd1){logger[_0x7a04('0x25')](_0x5f9fd1[_0x7a04('0x26')]);if(_0x5f9fd1[_0x7a04('0x27')]){delete _0x5f9fd1['name'];}_0x1ff41b[_0x7a04('0x18')](_0x3743b3)['send'](_0x5f9fd1);};}exports[_0x7a04('0x28')]=function(_0x246310,_0x1b6eba){var _0x3a9d10={},_0x99b61d={},_0x22a8e6={'count':0x0,'rows':[]};var _0x4ce6f2=_[_0x7a04('0x29')](db['FreshdeskAccount'][_0x7a04('0x2a')],function(_0x444daa){return{'name':_0x444daa['fieldName'],'type':_0x444daa[_0x7a04('0x2b')][_0x7a04('0x2c')]};});_0x99b61d['model']=_['map'](_0x4ce6f2,_0x7a04('0x27'));_0x99b61d[_0x7a04('0x2d')]=_[_0x7a04('0x2e')](_0x246310[_0x7a04('0x2d')]);_0x99b61d[_0x7a04('0x2f')]=_[_0x7a04('0x30')](_0x99b61d[_0x7a04('0x31')],_0x99b61d[_0x7a04('0x2d')]);_0x3a9d10['attributes']=_[_0x7a04('0x30')](_0x99b61d[_0x7a04('0x31')],qs['fields'](_0x246310[_0x7a04('0x2d')][_0x7a04('0x32')]));_0x3a9d10[_0x7a04('0x33')]=_0x3a9d10[_0x7a04('0x33')][_0x7a04('0x34')]?_0x3a9d10[_0x7a04('0x33')]:_0x99b61d[_0x7a04('0x31')];if(!_0x246310['query'][_0x7a04('0x35')](_0x7a04('0x36'))){_0x3a9d10['limit']=qs['limit'](_0x246310[_0x7a04('0x2d')]['limit']);_0x3a9d10[_0x7a04('0x1b')]=qs['offset'](_0x246310[_0x7a04('0x2d')][_0x7a04('0x1b')]);}_0x3a9d10[_0x7a04('0x37')]=qs[_0x7a04('0x38')](_0x246310[_0x7a04('0x2d')][_0x7a04('0x38')]);_0x3a9d10[_0x7a04('0x39')]=qs[_0x7a04('0x2f')](_[_0x7a04('0x3a')](_0x246310['query'],_0x99b61d['filters']),_0x4ce6f2);if(_0x246310['query']['filter']){_0x3a9d10[_0x7a04('0x39')]=_['merge'](_0x3a9d10[_0x7a04('0x39')],{'$or':_[_0x7a04('0x29')](_0x4ce6f2,function(_0x19f7ec){if(_0x19f7ec[_0x7a04('0x2b')]!==_0x7a04('0x3b')){var _0x2fb643={};_0x2fb643[_0x19f7ec[_0x7a04('0x27')]]={'$like':'%'+_0x246310['query'][_0x7a04('0x3c')]+'%'};return _0x2fb643;}})});}_0x3a9d10=_[_0x7a04('0x3d')]({},_0x3a9d10,_0x246310[_0x7a04('0x3e')]);var _0x4fda19={'where':_0x3a9d10[_0x7a04('0x39')]};return db[_0x7a04('0x3f')][_0x7a04('0x1d')](_0x4fda19)[_0x7a04('0x24')](function(_0x2dc001){_0x22a8e6[_0x7a04('0x1d')]=_0x2dc001;if(_0x246310[_0x7a04('0x2d')][_0x7a04('0x40')]){_0x3a9d10['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0x7a04('0x41')](_0x3a9d10);})[_0x7a04('0x24')](function(_0x5c5a69){_0x22a8e6['rows']=_0x5c5a69;return _0x22a8e6;})['then'](respondWithFilteredResult(_0x1b6eba,_0x3a9d10))[_0x7a04('0x42')](handleError(_0x1b6eba,null));};exports[_0x7a04('0x43')]=function(_0x295c5b,_0x2bba60){var _0x4780dd={'raw':![],'where':{'id':_0x295c5b['params']['id']}},_0x2bec59={};_0x2bec59[_0x7a04('0x31')]=_[_0x7a04('0x2e')](db['FreshdeskAccount']['rawAttributes']);_0x2bec59[_0x7a04('0x2d')]=_[_0x7a04('0x2e')](_0x295c5b[_0x7a04('0x2d')]);_0x2bec59[_0x7a04('0x2f')]=_[_0x7a04('0x30')](_0x2bec59[_0x7a04('0x31')],_0x2bec59['query']);_0x4780dd[_0x7a04('0x33')]=_[_0x7a04('0x30')](_0x2bec59[_0x7a04('0x31')],qs[_0x7a04('0x32')](_0x295c5b[_0x7a04('0x2d')][_0x7a04('0x32')]));_0x4780dd[_0x7a04('0x33')]=_0x4780dd['attributes'][_0x7a04('0x34')]?_0x4780dd[_0x7a04('0x33')]:_0x2bec59['model'];if(_0x295c5b['query']['includeAll']){_0x4780dd[_0x7a04('0x44')]=[{'all':!![]}];}_0x4780dd=_[_0x7a04('0x3d')]({},_0x4780dd,_0x295c5b[_0x7a04('0x3e')]);return db[_0x7a04('0x3f')][_0x7a04('0x45')](_0x4780dd)['then'](handleEntityNotFound(_0x2bba60,null))['then'](respondWithResult(_0x2bba60,null))[_0x7a04('0x42')](handleError(_0x2bba60,null));};exports[_0x7a04('0x46')]=function(_0x278f04,_0x14e42e){return db['FreshdeskAccount']['create'](_0x278f04[_0x7a04('0x47')],{})['then'](respondWithResult(_0x14e42e,0xc9))[_0x7a04('0x42')](handleError(_0x14e42e,null));};exports['update']=function(_0x467fcf,_0x143bcf){if(_0x467fcf[_0x7a04('0x47')]['id']){delete _0x467fcf[_0x7a04('0x47')]['id'];}return db[_0x7a04('0x3f')][_0x7a04('0x45')]({'where':{'id':_0x467fcf[_0x7a04('0x48')]['id']}})['then'](handleEntityNotFound(_0x143bcf,null))['then'](saveUpdates(_0x467fcf[_0x7a04('0x47')],null))[_0x7a04('0x24')](respondWithResult(_0x143bcf,null))[_0x7a04('0x42')](handleError(_0x143bcf,null));};exports[_0x7a04('0x49')]=function(_0x132c1d,_0x43e537){return db[_0x7a04('0x3f')][_0x7a04('0x45')]({'where':{'id':_0x132c1d['params']['id']}})['then'](handleEntityNotFound(_0x43e537,null))[_0x7a04('0x24')](removeEntity(_0x43e537,null))[_0x7a04('0x42')](handleError(_0x43e537,null));};exports['getConfigurations']=function(_0x30e0d2,_0x576300,_0x5c28c3){var _0x83a38b={};var _0x5a45bf={};var _0x1d273b;var _0x44b4ba;return db[_0x7a04('0x3f')]['findOne']({'where':{'id':_0x30e0d2[_0x7a04('0x48')]['id']}})[_0x7a04('0x24')](handleEntityNotFound(_0x576300,null))[_0x7a04('0x24')](function(_0x53f355){if(_0x53f355){_0x1d273b=_0x53f355;_0x5a45bf['model']=_[_0x7a04('0x2e')](db[_0x7a04('0x4a')][_0x7a04('0x2a')]);_0x5a45bf[_0x7a04('0x2d')]=_[_0x7a04('0x2e')](_0x30e0d2[_0x7a04('0x2d')]);_0x5a45bf[_0x7a04('0x2f')]=_[_0x7a04('0x30')](_0x5a45bf[_0x7a04('0x31')],_0x5a45bf[_0x7a04('0x2d')]);_0x83a38b[_0x7a04('0x33')]=_[_0x7a04('0x30')](_0x5a45bf[_0x7a04('0x31')],qs['fields'](_0x30e0d2['query']['fields']));_0x83a38b[_0x7a04('0x33')]=_0x83a38b[_0x7a04('0x33')]['length']?_0x83a38b[_0x7a04('0x33')]:_0x5a45bf[_0x7a04('0x31')];_0x83a38b[_0x7a04('0x37')]=qs[_0x7a04('0x38')](_0x30e0d2['query']['sort']);_0x83a38b[_0x7a04('0x39')]=qs[_0x7a04('0x2f')](_['pick'](_0x30e0d2['query'],_0x5a45bf[_0x7a04('0x2f')]));if(_0x30e0d2[_0x7a04('0x2d')][_0x7a04('0x3c')]){_0x83a38b[_0x7a04('0x39')]=_[_0x7a04('0x3d')](_0x83a38b[_0x7a04('0x39')],{'$or':_['map'](_0x83a38b[_0x7a04('0x33')],function(_0x4bc950){var _0x2a5acd={};_0x2a5acd[_0x4bc950]={'$like':'%'+_0x30e0d2['query']['filter']+'%'};return _0x2a5acd;})});}_0x83a38b=_[_0x7a04('0x3d')]({},_0x83a38b,_0x30e0d2['options']);return _0x1d273b[_0x7a04('0x4b')](_0x83a38b);}})[_0x7a04('0x24')](function(_0x4ef0f1){if(_0x4ef0f1){_0x44b4ba=_0x4ef0f1[_0x7a04('0x34')];if(!_0x30e0d2[_0x7a04('0x2d')][_0x7a04('0x35')](_0x7a04('0x36'))){_0x83a38b[_0x7a04('0x1e')]=qs[_0x7a04('0x1e')](_0x30e0d2['query']['limit']);_0x83a38b[_0x7a04('0x1b')]=qs[_0x7a04('0x1b')](_0x30e0d2[_0x7a04('0x2d')]['offset']);}return _0x1d273b[_0x7a04('0x4b')](_0x83a38b);}})[_0x7a04('0x24')](function(_0x4d154b){if(_0x4d154b){return _0x4d154b?{'count':_0x44b4ba,'rows':_0x4d154b}:null;}})[_0x7a04('0x24')](respondWithResult(_0x576300,null))[_0x7a04('0x42')](handleError(_0x576300,null));};exports['addConfiguration']=function(_0x1e0bd5,_0x375e1a,_0x881908){if(_0x1e0bd5[_0x7a04('0x47')]['id']){delete _0x1e0bd5[_0x7a04('0x47')]['id'];}return db[_0x7a04('0x3f')][_0x7a04('0x4c')]({'where':{'id':_0x1e0bd5[_0x7a04('0x48')]['id']}})[_0x7a04('0x24')](handleEntityNotFound(_0x375e1a,null))[_0x7a04('0x24')](function(_0x1d24db){if(_0x1d24db){_0x1e0bd5[_0x7a04('0x47')][_0x7a04('0x4d')]=_0x1d24db['id'];_0x1e0bd5[_0x7a04('0x47')][_0x7a04('0x4e')]=integrations['getSubjects'](_0x1e0bd5[_0x7a04('0x47')][_0x7a04('0x4f')],_0x1e0bd5[_0x7a04('0x47')][_0x7a04('0x2b')]);_0x1e0bd5[_0x7a04('0x47')][_0x7a04('0x50')]=integrations[_0x7a04('0x51')](_0x1e0bd5['body'][_0x7a04('0x4f')],_0x1e0bd5[_0x7a04('0x47')][_0x7a04('0x2b')]);return db[_0x7a04('0x4a')][_0x7a04('0x46')](_0x1e0bd5[_0x7a04('0x47')],{'include':[{'model':db[_0x7a04('0x52')],'as':_0x7a04('0x4e')},{'model':db['FreshdeskField'],'as':_0x7a04('0x50')}]});}return null;})[_0x7a04('0x24')](respondWithResult(_0x375e1a,null))[_0x7a04('0x42')](handleError(_0x375e1a,null));};exports[_0x7a04('0x53')]=function(_0x261b10,_0x2c6970,_0x2bea05){var _0x5e688c='';return db['FreshdeskAccount'][_0x7a04('0x4c')]({'where':{'id':_0x261b10[_0x7a04('0x48')]['id']},'attributes':['id','remoteUri',_0x7a04('0x54')]})['then'](handleEntityNotFound(_0x2c6970,null))[_0x7a04('0x24')](function(_0x2df085){if(_0x2df085){_0x5e688c=_0x2df085[_0x7a04('0x55')];var _0x2c263c=_0x5e688c[_0x7a04('0x56')](-0x1);if(_0x2c263c==='/'){_0x5e688c=_0x5e688c['substring'](0x0,_0x5e688c[_0x7a04('0x57')](_0x2c263c));}return rp({'method':_0x7a04('0x58'),'uri':util['format'](_0x7a04('0x59'),_0x5e688c,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0x7a04('0x5a')](_0x7a04('0x5b'),new Buffer(util[_0x7a04('0x5a')](_0x7a04('0x5c'),_0x2df085[_0x7a04('0x54')]))[_0x7a04('0x5d')]('base64'))},'json':!![]});}})[_0x7a04('0x24')](function(_0x40f6c8){if(_0x40f6c8){var _0x1a698b=['requester',_0x7a04('0x5e'),_0x7a04('0x5f'),'description',_0x7a04('0x18'),_0x7a04('0x60'),_0x7a04('0x61'),'source',_0x7a04('0x62'),'group',_0x7a04('0x63')];_[_0x7a04('0x64')](_0x40f6c8,function(_0x2f2d26){return _0x1a698b[_0x7a04('0x65')](_0x2f2d26[_0x7a04('0x27')])||!_0x2f2d26[_0x7a04('0x66')]&&_0x2f2d26[_0x7a04('0x2b')]!==_0x7a04('0x67')&&_0x2f2d26[_0x7a04('0x2b')]!=='custom_dropdown';});return{'count':_0x40f6c8[_0x7a04('0x34')],'rows':_[_0x7a04('0x29')](_0x40f6c8,function(_0x44eae7){return{'id':_0x44eae7[_0x7a04('0x27')],'name':_0x44eae7['label'],'custom':!_0x44eae7[_0x7a04('0x66')],'options':_0x44eae7['choices']?_['map'](_0x44eae7[_0x7a04('0x68')],function(_0x3b009a){return{'name':_['capitalize'](_0x3b009a),'value':_0x3b009a};}):[]};})};}})['then'](respondWithResult(_0x2c6970,null))['catch'](function(_0x1c0703){var _0x5c75b6=_0x261b10[_0x7a04('0x2d')][_0x7a04('0x69')]?0x1f4:_0x1c0703['statusCode']||0x1f4;logger[_0x7a04('0x25')](_0x7a04('0x6a'),'getFields',_0x5c75b6,JSON[_0x7a04('0x6b')](_0x1c0703));delete _0x1c0703[_0x7a04('0x27')];if(_0x5c75b6===0x191){_0x5c75b6=0x190;}_0x2c6970[_0x7a04('0x18')](_0x5c75b6)[_0x7a04('0x6c')](_0x261b10[_0x7a04('0x2d')]['test']?{'message':_0x7a04('0x6d'),'statusCode':_0x1c0703[_0x7a04('0x6e')]}:_0x1c0703);});};
\ No newline at end of file
+var _0x1ab1=['ticket_type','company','remove','includes','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','reject','then','destroy','sendStatus','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','include','rows','catch','show','params','options','find','create','body','update','getConfigurations','pick','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskConfiguration','FreshdeskField','getFields','remoteUri','apiKey','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','toString','base64','requester','subject','description','priority','group','source'];(function(_0x32f8d5,_0x1a9b26){var _0xed41c0=function(_0xac6e28){while(--_0xac6e28){_0x32f8d5['push'](_0x32f8d5['shift']());}};_0xed41c0(++_0x1a9b26);}(_0x1ab1,0x83));var _0x11ab=function(_0x2c4992,_0xb00a3e){_0x2c4992=_0x2c4992-0x0;var _0x2d4262=_0x1ab1[_0x2c4992];return _0x2d4262;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x11ab('0x0'));var zipdir=require(_0x11ab('0x1'));var jsonpatch=require(_0x11ab('0x2'));var rp=require(_0x11ab('0x3'));var moment=require(_0x11ab('0x4'));var BPromise=require(_0x11ab('0x5'));var Mustache=require(_0x11ab('0x6'));var util=require('util');var path=require(_0x11ab('0x7'));var sox=require(_0x11ab('0x8'));var csv=require(_0x11ab('0x9'));var ejs=require(_0x11ab('0xa'));var fs=require('fs');var fs_extra=require(_0x11ab('0xb'));var _=require('lodash');var squel=require(_0x11ab('0xc'));var crypto=require(_0x11ab('0xd'));var jsforce=require(_0x11ab('0xe'));var deskjs=require(_0x11ab('0xf'));var toCsv=require('to-csv');var querystring=require(_0x11ab('0x10'));var Papa=require(_0x11ab('0x11'));var Redis=require(_0x11ab('0x12'));var authService=require(_0x11ab('0x13'));var qs=require(_0x11ab('0x14'));var as=require(_0x11ab('0x15'));var hardwareService=require(_0x11ab('0x16'));var logger=require('../../config/logger')(_0x11ab('0x17'));var utils=require('../../config/utils');var config=require(_0x11ab('0x18'));var licenseUtil=require(_0x11ab('0x19'));var db=require(_0x11ab('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x536add,_0x8f241f){_0x8f241f=_0x8f241f||0xcc;return function(_0x2a6d84){if(_0x2a6d84){return _0x536add['sendStatus'](_0x8f241f);}return _0x536add[_0x11ab('0x1b')](_0x8f241f)[_0x11ab('0x1c')]();};}function respondWithResult(_0x49d26b,_0x461fc7){_0x461fc7=_0x461fc7||0xc8;return function(_0x5db3a8){if(_0x5db3a8){return _0x49d26b[_0x11ab('0x1b')](_0x461fc7)[_0x11ab('0x1d')](_0x5db3a8);}};}function respondWithFilteredResult(_0x49aa93,_0x51f3f9){return function(_0xf5f02a){if(_0xf5f02a){var _0x100476=typeof _0x51f3f9[_0x11ab('0x1e')]===_0x11ab('0x1f')&&typeof _0x51f3f9[_0x11ab('0x20')]===_0x11ab('0x1f');var _0x46d6d8=_0xf5f02a[_0x11ab('0x21')];var _0x472694=_0x100476?0x0:_0x51f3f9[_0x11ab('0x1e')];var _0x225935=_0x100476?_0xf5f02a[_0x11ab('0x21')]:_0x51f3f9[_0x11ab('0x1e')]+_0x51f3f9['limit'];var _0x43d88a;if(_0x225935>=_0x46d6d8){_0x225935=_0x46d6d8;_0x43d88a=0xc8;}else{_0x43d88a=0xce;}_0x49aa93[_0x11ab('0x1b')](_0x43d88a);return _0x49aa93[_0x11ab('0x22')]('Content-Range',_0x472694+'-'+_0x225935+'/'+_0x46d6d8)['json'](_0xf5f02a);}return null;};}function patchUpdates(_0x6fcc49){return function(_0x4762e0){try{jsonpatch['apply'](_0x4762e0,_0x6fcc49,!![]);}catch(_0x15dbfd){return BPromise[_0x11ab('0x23')](_0x15dbfd);}return _0x4762e0['save']();};}function saveUpdates(_0x14f640,_0x4cb9ba){return function(_0x18b48f){if(_0x18b48f){return _0x18b48f['update'](_0x14f640)[_0x11ab('0x24')](function(_0x309d45){return _0x309d45;});}return null;};}function removeEntity(_0x40f3e4,_0x49a49f){return function(_0x57d08e){if(_0x57d08e){return _0x57d08e[_0x11ab('0x25')]()[_0x11ab('0x24')](function(){_0x40f3e4[_0x11ab('0x1b')](0xcc)[_0x11ab('0x1c')]();});}};}function handleEntityNotFound(_0x35b718,_0x3734ae){return function(_0x51d766){if(!_0x51d766){_0x35b718[_0x11ab('0x26')](0x194);}return _0x51d766;};}function handleError(_0x4da0ac,_0x4ae51a){_0x4ae51a=_0x4ae51a||0x1f4;return function(_0x3f55e0){logger[_0x11ab('0x27')](_0x3f55e0[_0x11ab('0x28')]);if(_0x3f55e0['name']){delete _0x3f55e0[_0x11ab('0x29')];}_0x4da0ac[_0x11ab('0x1b')](_0x4ae51a)[_0x11ab('0x2a')](_0x3f55e0);};}exports[_0x11ab('0x2b')]=function(_0x1caec7,_0x520294){var _0x3b9d8d={},_0x1ab745={},_0x57bf48={'count':0x0,'rows':[]};var _0x241e2f=_[_0x11ab('0x2c')](db[_0x11ab('0x2d')][_0x11ab('0x2e')],function(_0x20c405){return{'name':_0x20c405[_0x11ab('0x2f')],'type':_0x20c405[_0x11ab('0x30')][_0x11ab('0x31')]};});_0x1ab745[_0x11ab('0x32')]=_[_0x11ab('0x2c')](_0x241e2f,_0x11ab('0x29'));_0x1ab745[_0x11ab('0x33')]=_[_0x11ab('0x34')](_0x1caec7[_0x11ab('0x33')]);_0x1ab745[_0x11ab('0x35')]=_['intersection'](_0x1ab745[_0x11ab('0x32')],_0x1ab745[_0x11ab('0x33')]);_0x3b9d8d[_0x11ab('0x36')]=_[_0x11ab('0x37')](_0x1ab745[_0x11ab('0x32')],qs[_0x11ab('0x38')](_0x1caec7['query']['fields']));_0x3b9d8d[_0x11ab('0x36')]=_0x3b9d8d['attributes'][_0x11ab('0x39')]?_0x3b9d8d['attributes']:_0x1ab745[_0x11ab('0x32')];if(!_0x1caec7[_0x11ab('0x33')][_0x11ab('0x3a')]('nolimit')){_0x3b9d8d[_0x11ab('0x20')]=qs['limit'](_0x1caec7[_0x11ab('0x33')][_0x11ab('0x20')]);_0x3b9d8d[_0x11ab('0x1e')]=qs[_0x11ab('0x1e')](_0x1caec7[_0x11ab('0x33')][_0x11ab('0x1e')]);}_0x3b9d8d[_0x11ab('0x3b')]=qs[_0x11ab('0x3c')](_0x1caec7[_0x11ab('0x33')][_0x11ab('0x3c')]);_0x3b9d8d[_0x11ab('0x3d')]=qs[_0x11ab('0x35')](_['pick'](_0x1caec7[_0x11ab('0x33')],_0x1ab745['filters']),_0x241e2f);if(_0x1caec7[_0x11ab('0x33')][_0x11ab('0x3e')]){_0x3b9d8d[_0x11ab('0x3d')]=_['merge'](_0x3b9d8d[_0x11ab('0x3d')],{'$or':_[_0x11ab('0x2c')](_0x241e2f,function(_0x3f70e2){if(_0x3f70e2[_0x11ab('0x30')]!=='VIRTUAL'){var _0x488bcf={};_0x488bcf[_0x3f70e2[_0x11ab('0x29')]]={'$like':'%'+_0x1caec7[_0x11ab('0x33')][_0x11ab('0x3e')]+'%'};return _0x488bcf;}})});}_0x3b9d8d=_[_0x11ab('0x3f')]({},_0x3b9d8d,_0x1caec7['options']);var _0x38ed23={'where':_0x3b9d8d[_0x11ab('0x3d')]};return db[_0x11ab('0x2d')][_0x11ab('0x21')](_0x38ed23)[_0x11ab('0x24')](function(_0x3b910){_0x57bf48['count']=_0x3b910;if(_0x1caec7[_0x11ab('0x33')]['includeAll']){_0x3b9d8d[_0x11ab('0x40')]=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x3b9d8d);})[_0x11ab('0x24')](function(_0x1cb4ce){_0x57bf48[_0x11ab('0x41')]=_0x1cb4ce;return _0x57bf48;})['then'](respondWithFilteredResult(_0x520294,_0x3b9d8d))[_0x11ab('0x42')](handleError(_0x520294,null));};exports[_0x11ab('0x43')]=function(_0x2bea41,_0x43f10c){var _0x2e9f1b={'raw':![],'where':{'id':_0x2bea41[_0x11ab('0x44')]['id']}},_0x146426={};_0x146426[_0x11ab('0x32')]=_[_0x11ab('0x34')](db['FreshdeskAccount']['rawAttributes']);_0x146426['query']=_[_0x11ab('0x34')](_0x2bea41[_0x11ab('0x33')]);_0x146426['filters']=_[_0x11ab('0x37')](_0x146426[_0x11ab('0x32')],_0x146426[_0x11ab('0x33')]);_0x2e9f1b[_0x11ab('0x36')]=_[_0x11ab('0x37')](_0x146426[_0x11ab('0x32')],qs['fields'](_0x2bea41[_0x11ab('0x33')][_0x11ab('0x38')]));_0x2e9f1b['attributes']=_0x2e9f1b['attributes'][_0x11ab('0x39')]?_0x2e9f1b[_0x11ab('0x36')]:_0x146426[_0x11ab('0x32')];if(_0x2bea41['query']['includeAll']){_0x2e9f1b[_0x11ab('0x40')]=[{'all':!![]}];}_0x2e9f1b=_[_0x11ab('0x3f')]({},_0x2e9f1b,_0x2bea41[_0x11ab('0x45')]);return db[_0x11ab('0x2d')][_0x11ab('0x46')](_0x2e9f1b)[_0x11ab('0x24')](handleEntityNotFound(_0x43f10c,null))[_0x11ab('0x24')](respondWithResult(_0x43f10c,null))[_0x11ab('0x42')](handleError(_0x43f10c,null));};exports[_0x11ab('0x47')]=function(_0x55d36f,_0x5415bd){return db[_0x11ab('0x2d')][_0x11ab('0x47')](_0x55d36f[_0x11ab('0x48')],{})['then'](respondWithResult(_0x5415bd,0xc9))[_0x11ab('0x42')](handleError(_0x5415bd,null));};exports[_0x11ab('0x49')]=function(_0xf3a28e,_0x26198b){if(_0xf3a28e[_0x11ab('0x48')]['id']){delete _0xf3a28e[_0x11ab('0x48')]['id'];}return db[_0x11ab('0x2d')][_0x11ab('0x46')]({'where':{'id':_0xf3a28e[_0x11ab('0x44')]['id']}})[_0x11ab('0x24')](handleEntityNotFound(_0x26198b,null))[_0x11ab('0x24')](saveUpdates(_0xf3a28e[_0x11ab('0x48')],null))[_0x11ab('0x24')](respondWithResult(_0x26198b,null))['catch'](handleError(_0x26198b,null));};exports[_0x11ab('0x25')]=function(_0x31ef0d,_0x43b64e){return db['FreshdeskAccount']['find']({'where':{'id':_0x31ef0d['params']['id']}})[_0x11ab('0x24')](handleEntityNotFound(_0x43b64e,null))['then'](removeEntity(_0x43b64e,null))[_0x11ab('0x42')](handleError(_0x43b64e,null));};exports[_0x11ab('0x4a')]=function(_0x44f5b5,_0x707acb,_0xef426c){var _0x4aebbf={};var _0x10519b={};var _0x349c3c;var _0x293036;return db[_0x11ab('0x2d')]['findOne']({'where':{'id':_0x44f5b5[_0x11ab('0x44')]['id']}})[_0x11ab('0x24')](handleEntityNotFound(_0x707acb,null))[_0x11ab('0x24')](function(_0x29f23b){if(_0x29f23b){_0x349c3c=_0x29f23b;_0x10519b[_0x11ab('0x32')]=_[_0x11ab('0x34')](db['FreshdeskConfiguration']['rawAttributes']);_0x10519b[_0x11ab('0x33')]=_[_0x11ab('0x34')](_0x44f5b5['query']);_0x10519b[_0x11ab('0x35')]=_['intersection'](_0x10519b['model'],_0x10519b[_0x11ab('0x33')]);_0x4aebbf[_0x11ab('0x36')]=_[_0x11ab('0x37')](_0x10519b[_0x11ab('0x32')],qs[_0x11ab('0x38')](_0x44f5b5[_0x11ab('0x33')][_0x11ab('0x38')]));_0x4aebbf[_0x11ab('0x36')]=_0x4aebbf[_0x11ab('0x36')][_0x11ab('0x39')]?_0x4aebbf[_0x11ab('0x36')]:_0x10519b[_0x11ab('0x32')];_0x4aebbf[_0x11ab('0x3b')]=qs[_0x11ab('0x3c')](_0x44f5b5[_0x11ab('0x33')][_0x11ab('0x3c')]);_0x4aebbf[_0x11ab('0x3d')]=qs['filters'](_[_0x11ab('0x4b')](_0x44f5b5[_0x11ab('0x33')],_0x10519b[_0x11ab('0x35')]));if(_0x44f5b5[_0x11ab('0x33')][_0x11ab('0x3e')]){_0x4aebbf['where']=_['merge'](_0x4aebbf[_0x11ab('0x3d')],{'$or':_[_0x11ab('0x2c')](_0x4aebbf[_0x11ab('0x36')],function(_0x4c695f){var _0x43e70f={};_0x43e70f[_0x4c695f]={'$like':'%'+_0x44f5b5[_0x11ab('0x33')][_0x11ab('0x3e')]+'%'};return _0x43e70f;})});}_0x4aebbf=_[_0x11ab('0x3f')]({},_0x4aebbf,_0x44f5b5['options']);return _0x349c3c[_0x11ab('0x4a')](_0x4aebbf);}})[_0x11ab('0x24')](function(_0x486e6c){if(_0x486e6c){_0x293036=_0x486e6c[_0x11ab('0x39')];if(!_0x44f5b5['query'][_0x11ab('0x3a')](_0x11ab('0x4c'))){_0x4aebbf[_0x11ab('0x20')]=qs[_0x11ab('0x20')](_0x44f5b5['query'][_0x11ab('0x20')]);_0x4aebbf[_0x11ab('0x1e')]=qs['offset'](_0x44f5b5[_0x11ab('0x33')]['offset']);}return _0x349c3c[_0x11ab('0x4a')](_0x4aebbf);}})[_0x11ab('0x24')](function(_0x2ed93a){if(_0x2ed93a){return _0x2ed93a?{'count':_0x293036,'rows':_0x2ed93a}:null;}})[_0x11ab('0x24')](respondWithResult(_0x707acb,null))[_0x11ab('0x42')](handleError(_0x707acb,null));};exports[_0x11ab('0x4d')]=function(_0x2e9cde,_0x4638cc,_0x5e511a){if(_0x2e9cde[_0x11ab('0x48')]['id']){delete _0x2e9cde[_0x11ab('0x48')]['id'];}return db[_0x11ab('0x2d')][_0x11ab('0x4e')]({'where':{'id':_0x2e9cde[_0x11ab('0x44')]['id']}})['then'](handleEntityNotFound(_0x4638cc,null))['then'](function(_0x1ee6ff){if(_0x1ee6ff){_0x2e9cde[_0x11ab('0x48')][_0x11ab('0x4f')]=_0x1ee6ff['id'];_0x2e9cde[_0x11ab('0x48')][_0x11ab('0x50')]=integrations[_0x11ab('0x51')](_0x2e9cde[_0x11ab('0x48')][_0x11ab('0x52')],_0x2e9cde[_0x11ab('0x48')]['type']);_0x2e9cde['body'][_0x11ab('0x53')]=integrations['getDescriptions'](_0x2e9cde[_0x11ab('0x48')][_0x11ab('0x52')],_0x2e9cde['body'][_0x11ab('0x30')]);return db[_0x11ab('0x54')][_0x11ab('0x47')](_0x2e9cde[_0x11ab('0x48')],{'include':[{'model':db[_0x11ab('0x55')],'as':_0x11ab('0x50')},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0x11ab('0x24')](respondWithResult(_0x4638cc,null))[_0x11ab('0x42')](handleError(_0x4638cc,null));};exports[_0x11ab('0x56')]=function(_0x29f787,_0x3238cd,_0x224be2){var _0x35a0f5='';return db[_0x11ab('0x2d')][_0x11ab('0x4e')]({'where':{'id':_0x29f787[_0x11ab('0x44')]['id']},'attributes':['id',_0x11ab('0x57'),_0x11ab('0x58')]})[_0x11ab('0x24')](handleEntityNotFound(_0x3238cd,null))['then'](function(_0x53402f){if(_0x53402f){_0x35a0f5=_0x53402f[_0x11ab('0x57')];var _0x346084=_0x35a0f5['slice'](-0x1);if(_0x346084==='/'){_0x35a0f5=_0x35a0f5['substring'](0x0,_0x35a0f5[_0x11ab('0x59')](_0x346084));}return rp({'method':_0x11ab('0x5a'),'uri':util[_0x11ab('0x5b')](_0x11ab('0x5c'),_0x35a0f5,_0x11ab('0x5d')),'headers':{'Authorization':util[_0x11ab('0x5b')](_0x11ab('0x5e'),new Buffer(util[_0x11ab('0x5b')]('%s:X',_0x53402f[_0x11ab('0x58')]))[_0x11ab('0x5f')](_0x11ab('0x60')))},'json':!![]});}})[_0x11ab('0x24')](function(_0x56485e){if(_0x56485e){var _0x45c5bf=[_0x11ab('0x61'),_0x11ab('0x62'),'agent',_0x11ab('0x63'),_0x11ab('0x1b'),_0x11ab('0x64'),_0x11ab('0x65'),_0x11ab('0x66'),_0x11ab('0x67'),'group',_0x11ab('0x68')];_[_0x11ab('0x69')](_0x56485e,function(_0x33ec9b){return _0x45c5bf[_0x11ab('0x6a')](_0x33ec9b[_0x11ab('0x29')])||!_0x33ec9b[_0x11ab('0x6b')]&&_0x33ec9b['type']!==_0x11ab('0x6c')&&_0x33ec9b[_0x11ab('0x30')]!==_0x11ab('0x6d');});return{'count':_0x56485e[_0x11ab('0x39')],'rows':_[_0x11ab('0x2c')](_0x56485e,function(_0x457df2){return{'id':_0x457df2[_0x11ab('0x29')],'name':_0x457df2['label'],'custom':!_0x457df2[_0x11ab('0x6b')],'options':_0x457df2[_0x11ab('0x6e')]?_['map'](_0x457df2[_0x11ab('0x6e')],function(_0x246ffc){return{'name':_[_0x11ab('0x6f')](_0x246ffc),'value':_0x246ffc};}):[]};})};}})[_0x11ab('0x24')](respondWithResult(_0x3238cd,null))[_0x11ab('0x42')](function(_0x9b10a7){var _0x1a4dbd=_0x29f787[_0x11ab('0x33')][_0x11ab('0x70')]?0x1f4:_0x9b10a7[_0x11ab('0x71')]||0x1f4;logger[_0x11ab('0x27')](_0x11ab('0x72'),_0x11ab('0x56'),_0x1a4dbd,JSON[_0x11ab('0x73')](_0x9b10a7));delete _0x9b10a7[_0x11ab('0x29')];if(_0x1a4dbd===0x191){_0x1a4dbd=0x190;}_0x3238cd[_0x11ab('0x1b')](_0x1a4dbd)[_0x11ab('0x2a')](_0x29f787[_0x11ab('0x33')][_0x11ab('0x70')]?{'message':_0x11ab('0x74'),'statusCode':_0x9b10a7[_0x11ab('0x71')]}:_0x9b10a7);});};
\ No newline at end of file
index 3b9e969..8504155 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9942=['../../config/environment','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','api','moment','path','rimraf'];(function(_0xc13040,_0x27a5bb){var _0x456f31=function(_0x224b69){while(--_0x224b69){_0xc13040['push'](_0xc13040['shift']());}};_0x456f31(++_0x27a5bb);}(_0x9942,0x19e));var _0x2994=function(_0x486b00,_0x501df5){_0x486b00=_0x486b00-0x0;var _0x47ea82=_0x9942[_0x486b00];return _0x47ea82;};'use strict';var _=require(_0x2994('0x0'));var util=require(_0x2994('0x1'));var logger=require('../../config/logger')(_0x2994('0x2'));var moment=require(_0x2994('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2994('0x4'));var rimraf=require(_0x2994('0x5'));var config=require(_0x2994('0x6'));var attributes=require(_0x2994('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x2994('0x8')]=function(_0x36897c,_0x3fb970){return _0x36897c[_0x2994('0x9')](_0x2994('0xa'),attributes,{'tableName':_0x2994('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8eeb=['path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x8eeb,0xf8));var _0xb8ee=function(_0x553fd0,_0x585535){_0x553fd0=_0x553fd0-0x0;var _0x5c3b9b=_0x8eeb[_0x553fd0];return _0x5c3b9b;};'use strict';var _=require(_0xb8ee('0x0'));var util=require(_0xb8ee('0x1'));var logger=require(_0xb8ee('0x2'))(_0xb8ee('0x3'));var moment=require(_0xb8ee('0x4'));var BPromise=require(_0xb8ee('0x5'));var rp=require(_0xb8ee('0x6'));var fs=require('fs');var path=require(_0xb8ee('0x7'));var rimraf=require(_0xb8ee('0x8'));var config=require(_0xb8ee('0x9'));var attributes=require(_0xb8ee('0xa'));var integrations=require('../../components/integrations/configuration');module[_0xb8ee('0xb')]=function(_0x125f08,_0x9ed29b){return _0x125f08[_0xb8ee('0xc')](_0xb8ee('0xd'),attributes,{'tableName':_0xb8ee('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ce00691..7ddac9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa671=['GetFreshdeskAccount','FreshdeskAccount','options','raw','where','attributes','limit','include','model','map','ShowFreshdeskAccount','find','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x50303e,_0x52b504){var _0xe70dbb=function(_0x5632e9){while(--_0x5632e9){_0x50303e['push'](_0x50303e['shift']());}};_0xe70dbb(++_0x52b504);}(_0xa671,0x1a4));var _0x1a67=function(_0x2a9dc6,_0x577bd6){_0x2a9dc6=_0x2a9dc6-0x0;var _0x4283d3=_0xa671[_0x2a9dc6];return _0x4283d3;};'use strict';var _=require('lodash');var util=require(_0x1a67('0x0'));var moment=require(_0x1a67('0x1'));var BPromise=require(_0x1a67('0x2'));var rs=require(_0x1a67('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1a67('0x4'));var logger=require('../../config/logger')(_0x1a67('0x5'));var config=require(_0x1a67('0x6'));var jayson=require(_0x1a67('0x7'));var client=jayson[_0x1a67('0x8')][_0x1a67('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a5821,_0x3f6181,_0x87e7b2){return new BPromise(function(_0x13acaa,_0x2c907d){return client[_0x1a67('0xa')](_0x5a5821,_0x87e7b2)[_0x1a67('0xb')](function(_0x3a93a0){logger[_0x1a67('0xc')](_0x1a67('0xd'),_0x3f6181,_0x1a67('0xe'));logger[_0x1a67('0xf')](_0x1a67('0x10'),_0x3f6181,_0x1a67('0xe'),JSON[_0x1a67('0x11')](_0x3a93a0));if(_0x3a93a0['error']){if(_0x3a93a0[_0x1a67('0x12')][_0x1a67('0x13')]===0x1f4){logger[_0x1a67('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x3f6181,_0x3a93a0['error'][_0x1a67('0x14')]);return _0x2c907d(_0x3a93a0['error'][_0x1a67('0x14')]);}logger['error'](_0x1a67('0xd'),_0x3f6181,_0x3a93a0['error'][_0x1a67('0x14')]);return _0x13acaa(_0x3a93a0['error'][_0x1a67('0x14')]);}else{logger[_0x1a67('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x3f6181,'request\x20sent');_0x13acaa(_0x3a93a0['result'][_0x1a67('0x14')]);}})[_0x1a67('0x15')](function(_0x10b25f){logger[_0x1a67('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x3f6181,_0x10b25f);_0x2c907d(_0x10b25f);});});}exports[_0x1a67('0x16')]=function(_0x58d74e){var _0x5eaeec=this;return new Promise(function(_0x1f6c56,_0x3f5aa7){return db[_0x1a67('0x17')]['findAll']({'raw':_0x58d74e['options']?_0x58d74e[_0x1a67('0x18')][_0x1a67('0x19')]===undefined?!![]:![]:!![],'where':_0x58d74e[_0x1a67('0x18')]?_0x58d74e[_0x1a67('0x18')][_0x1a67('0x1a')]||null:null,'attributes':_0x58d74e[_0x1a67('0x18')]?_0x58d74e[_0x1a67('0x18')][_0x1a67('0x1b')]||null:null,'limit':_0x58d74e[_0x1a67('0x18')]?_0x58d74e[_0x1a67('0x18')][_0x1a67('0x1c')]||null:null,'include':_0x58d74e['options']?_0x58d74e[_0x1a67('0x18')][_0x1a67('0x1d')]?_['map'](_0x58d74e[_0x1a67('0x18')][_0x1a67('0x1d')],function(_0x4d04dd){return{'model':db[_0x4d04dd[_0x1a67('0x1e')]],'as':_0x4d04dd['as'],'attributes':_0x4d04dd[_0x1a67('0x1b')],'include':_0x4d04dd[_0x1a67('0x1d')]?_[_0x1a67('0x1f')](_0x4d04dd['include'],function(_0x501a28){return{'model':db[_0x501a28[_0x1a67('0x1e')]],'as':_0x501a28['as'],'attributes':_0x501a28[_0x1a67('0x1b')],'include':_0x501a28[_0x1a67('0x1d')]?_[_0x1a67('0x1f')](_0x501a28['include'],function(_0x44b19d){return{'model':db[_0x44b19d[_0x1a67('0x1e')]],'as':_0x44b19d['as'],'attributes':_0x44b19d['attributes']};}):[]};}):[]};}):[]:[]})[_0x1a67('0xb')](function(_0x163b58){logger[_0x1a67('0xc')](_0x1a67('0x16'),_0x58d74e);logger[_0x1a67('0xf')](_0x1a67('0x16'),_0x58d74e,JSON['stringify'](_0x163b58));_0x1f6c56(_0x163b58);})[_0x1a67('0x15')](function(_0x5b613e){logger['error'](_0x1a67('0x16'),_0x5b613e[_0x1a67('0x14')],_0x58d74e);_0x3f5aa7(_0x5eaeec[_0x1a67('0x12')](0x1f4,_0x5b613e[_0x1a67('0x14')]));});});};exports[_0x1a67('0x20')]=function(_0x5d48a8){var _0x5bb462=this;return new Promise(function(_0x18ba79,_0x1c9428){return db['FreshdeskAccount'][_0x1a67('0x21')]({'raw':_0x5d48a8[_0x1a67('0x18')]?_0x5d48a8['options'][_0x1a67('0x19')]===undefined?!![]:![]:!![],'where':_0x5d48a8[_0x1a67('0x18')]?_0x5d48a8[_0x1a67('0x18')][_0x1a67('0x1a')]||null:null,'attributes':_0x5d48a8[_0x1a67('0x18')]?_0x5d48a8['options'][_0x1a67('0x1b')]||null:null,'include':_0x5d48a8['options']?_0x5d48a8[_0x1a67('0x18')][_0x1a67('0x1d')]?_[_0x1a67('0x1f')](_0x5d48a8[_0x1a67('0x18')][_0x1a67('0x1d')],function(_0xd75949){return{'model':db[_0xd75949[_0x1a67('0x1e')]],'as':_0xd75949['as'],'attributes':_0xd75949['attributes'],'include':_0xd75949[_0x1a67('0x1d')]?_[_0x1a67('0x1f')](_0xd75949['include'],function(_0x476f16){return{'model':db[_0x476f16[_0x1a67('0x1e')]],'as':_0x476f16['as'],'attributes':_0x476f16[_0x1a67('0x1b')],'include':_0x476f16['include']?_['map'](_0x476f16[_0x1a67('0x1d')],function(_0x541502){return{'model':db[_0x541502[_0x1a67('0x1e')]],'as':_0x541502['as'],'attributes':_0x541502['attributes']};}):[]};}):[]};}):[]:[]})[_0x1a67('0xb')](function(_0x12c512){logger[_0x1a67('0xc')](_0x1a67('0x20'),_0x5d48a8);logger[_0x1a67('0xf')]('ShowFreshdeskAccount',_0x5d48a8,JSON[_0x1a67('0x11')](_0x12c512));_0x18ba79(_0x12c512);})[_0x1a67('0x15')](function(_0x5f70b){logger['error']('ShowFreshdeskAccount',_0x5f70b[_0x1a67('0x14')],_0x5d48a8);_0x1c9428(_0x5bb462[_0x1a67('0x12')](0x1f4,_0x5f70b['message']));});});};
\ No newline at end of file
+var _0x3f11=['options','where','attributes','limit','include','map','model','stringify','catch','ShowFreshdeskAccount','FreshdeskAccount','find','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','error','code','message','FreshdeskAccount,\x20%s,\x20%s','result','GetFreshdeskAccount'];(function(_0x23975,_0x48b66d){var _0x3bf49a=function(_0x3ac2c3){while(--_0x3ac2c3){_0x23975['push'](_0x23975['shift']());}};_0x3bf49a(++_0x48b66d);}(_0x3f11,0x1a5));var _0x13f1=function(_0x30b6d3,_0xd02c1e){_0x30b6d3=_0x30b6d3-0x0;var _0x5c487b=_0x3f11[_0x30b6d3];return _0x5c487b;};'use strict';var _=require(_0x13f1('0x0'));var util=require(_0x13f1('0x1'));var moment=require('moment');var BPromise=require(_0x13f1('0x2'));var rs=require(_0x13f1('0x3'));var fs=require('fs');var Redis=require(_0x13f1('0x4'));var db=require(_0x13f1('0x5'))['db'];var utils=require(_0x13f1('0x6'));var logger=require(_0x13f1('0x7'))('rpc');var config=require(_0x13f1('0x8'));var jayson=require(_0x13f1('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1606c2,_0x19cb86,_0x4d5047){return new BPromise(function(_0x2fd6e8,_0x1e1dde){return client[_0x13f1('0xa')](_0x1606c2,_0x4d5047)[_0x13f1('0xb')](function(_0x31c409){logger[_0x13f1('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x19cb86,_0x13f1('0xd'));logger[_0x13f1('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x19cb86,_0x13f1('0xd'),JSON['stringify'](_0x31c409));if(_0x31c409[_0x13f1('0xf')]){if(_0x31c409[_0x13f1('0xf')][_0x13f1('0x10')]===0x1f4){logger[_0x13f1('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0x19cb86,_0x31c409['error'][_0x13f1('0x11')]);return _0x1e1dde(_0x31c409['error']['message']);}logger['error'](_0x13f1('0x12'),_0x19cb86,_0x31c409[_0x13f1('0xf')][_0x13f1('0x11')]);return _0x2fd6e8(_0x31c409[_0x13f1('0xf')][_0x13f1('0x11')]);}else{logger['info'](_0x13f1('0x12'),_0x19cb86,_0x13f1('0xd'));_0x2fd6e8(_0x31c409[_0x13f1('0x13')][_0x13f1('0x11')]);}})['catch'](function(_0x25dbe7){logger[_0x13f1('0xf')](_0x13f1('0x12'),_0x19cb86,_0x25dbe7);_0x1e1dde(_0x25dbe7);});});}exports[_0x13f1('0x14')]=function(_0x4bb764){var _0x406bf2=this;return new Promise(function(_0x54b686,_0x8dc9e6){return db['FreshdeskAccount']['findAll']({'raw':_0x4bb764['options']?_0x4bb764[_0x13f1('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4bb764[_0x13f1('0x15')]?_0x4bb764[_0x13f1('0x15')][_0x13f1('0x16')]||null:null,'attributes':_0x4bb764[_0x13f1('0x15')]?_0x4bb764[_0x13f1('0x15')][_0x13f1('0x17')]||null:null,'limit':_0x4bb764[_0x13f1('0x15')]?_0x4bb764[_0x13f1('0x15')][_0x13f1('0x18')]||null:null,'include':_0x4bb764[_0x13f1('0x15')]?_0x4bb764[_0x13f1('0x15')][_0x13f1('0x19')]?_[_0x13f1('0x1a')](_0x4bb764[_0x13f1('0x15')][_0x13f1('0x19')],function(_0x42d739){return{'model':db[_0x42d739[_0x13f1('0x1b')]],'as':_0x42d739['as'],'attributes':_0x42d739[_0x13f1('0x17')],'include':_0x42d739[_0x13f1('0x19')]?_[_0x13f1('0x1a')](_0x42d739[_0x13f1('0x19')],function(_0x3d6209){return{'model':db[_0x3d6209[_0x13f1('0x1b')]],'as':_0x3d6209['as'],'attributes':_0x3d6209[_0x13f1('0x17')],'include':_0x3d6209['include']?_['map'](_0x3d6209['include'],function(_0x2807ff){return{'model':db[_0x2807ff[_0x13f1('0x1b')]],'as':_0x2807ff['as'],'attributes':_0x2807ff[_0x13f1('0x17')]};}):[]};}):[]};}):[]:[]})[_0x13f1('0xb')](function(_0x3bd562){logger[_0x13f1('0xc')]('GetFreshdeskAccount',_0x4bb764);logger['debug'](_0x13f1('0x14'),_0x4bb764,JSON[_0x13f1('0x1c')](_0x3bd562));_0x54b686(_0x3bd562);})[_0x13f1('0x1d')](function(_0x586194){logger['error'](_0x13f1('0x14'),_0x586194[_0x13f1('0x11')],_0x4bb764);_0x8dc9e6(_0x406bf2[_0x13f1('0xf')](0x1f4,_0x586194[_0x13f1('0x11')]));});});};exports[_0x13f1('0x1e')]=function(_0x2a4138){var _0x4b7906=this;return new Promise(function(_0x238124,_0x494c0a){return db[_0x13f1('0x1f')][_0x13f1('0x20')]({'raw':_0x2a4138[_0x13f1('0x15')]?_0x2a4138[_0x13f1('0x15')][_0x13f1('0x21')]===undefined?!![]:![]:!![],'where':_0x2a4138[_0x13f1('0x15')]?_0x2a4138[_0x13f1('0x15')][_0x13f1('0x16')]||null:null,'attributes':_0x2a4138[_0x13f1('0x15')]?_0x2a4138['options']['attributes']||null:null,'include':_0x2a4138['options']?_0x2a4138[_0x13f1('0x15')]['include']?_[_0x13f1('0x1a')](_0x2a4138[_0x13f1('0x15')][_0x13f1('0x19')],function(_0x1495be){return{'model':db[_0x1495be[_0x13f1('0x1b')]],'as':_0x1495be['as'],'attributes':_0x1495be[_0x13f1('0x17')],'include':_0x1495be[_0x13f1('0x19')]?_[_0x13f1('0x1a')](_0x1495be[_0x13f1('0x19')],function(_0x10f53b){return{'model':db[_0x10f53b[_0x13f1('0x1b')]],'as':_0x10f53b['as'],'attributes':_0x10f53b[_0x13f1('0x17')],'include':_0x10f53b[_0x13f1('0x19')]?_['map'](_0x10f53b[_0x13f1('0x19')],function(_0x13937f){return{'model':db[_0x13937f[_0x13f1('0x1b')]],'as':_0x13937f['as'],'attributes':_0x13937f[_0x13f1('0x17')]};}):[]};}):[]};}):[]:[]})[_0x13f1('0xb')](function(_0x3f0a6c){logger[_0x13f1('0xc')](_0x13f1('0x1e'),_0x2a4138);logger[_0x13f1('0xe')](_0x13f1('0x1e'),_0x2a4138,JSON['stringify'](_0x3f0a6c));_0x238124(_0x3f0a6c);})[_0x13f1('0x1d')](function(_0x325e57){logger[_0x13f1('0xf')](_0x13f1('0x1e'),_0x325e57[_0x13f1('0x11')],_0x2a4138);_0x494c0a(_0x4b7906[_0x13f1('0xf')](0x1f4,_0x325e57[_0x13f1('0x11')]));});});};
\ No newline at end of file
index a23091b..896a60a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2802=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','update','delete','/:id','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/fields','getFields'];(function(_0x1c32a4,_0x209307){var _0x196f22=function(_0x2dbaa8){while(--_0x2dbaa8){_0x1c32a4['push'](_0x1c32a4['shift']());}};_0x196f22(++_0x209307);}(_0x2802,0xe3));var _0x2280=function(_0x5f6a8a,_0x45f474){_0x5f6a8a=_0x5f6a8a-0x0;var _0x2cce4d=_0x2802[_0x5f6a8a];return _0x2cce4d;};'use strict';var multer=require(_0x2280('0x0'));var util=require(_0x2280('0x1'));var path=require(_0x2280('0x2'));var timeout=require(_0x2280('0x3'));var express=require(_0x2280('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2280('0x5'));var interaction=require(_0x2280('0x6'));var config=require(_0x2280('0x7'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x2280('0x8')]('/',auth[_0x2280('0x9')](),controller['index']);router[_0x2280('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x2280('0xa')]);router[_0x2280('0x8')](_0x2280('0xb'),auth[_0x2280('0x9')](),controller[_0x2280('0xc')]);router[_0x2280('0x8')]('/:id/subjects',auth[_0x2280('0x9')](),controller[_0x2280('0xd')]);router[_0x2280('0x8')](_0x2280('0xe'),auth[_0x2280('0x9')](),controller[_0x2280('0xf')]);router[_0x2280('0x8')]('/:id/tags',auth[_0x2280('0x9')](),controller[_0x2280('0x10')]);router[_0x2280('0x11')]('/',auth[_0x2280('0x9')](),controller[_0x2280('0x12')]);router[_0x2280('0x11')](_0x2280('0x13'),auth[_0x2280('0x9')](),controller['setTags']);router['put']('/:id',auth[_0x2280('0x9')](),controller[_0x2280('0x14')]);router[_0x2280('0x15')](_0x2280('0x16'),auth[_0x2280('0x9')](),controller['destroy']);module[_0x2280('0x17')]=router;
\ No newline at end of file
+var _0x54c8=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','/:id','exports','multer'];(function(_0x515cff,_0x27d4a5){var _0x419c0e=function(_0x4a0ad2){while(--_0x4a0ad2){_0x515cff['push'](_0x515cff['shift']());}};_0x419c0e(++_0x27d4a5);}(_0x54c8,0x128));var _0x854c=function(_0x3cb0d3,_0xd0b120){_0x3cb0d3=_0x3cb0d3-0x0;var _0xa3bcc9=_0x54c8[_0x3cb0d3];return _0xa3bcc9;};'use strict';var multer=require(_0x854c('0x0'));var util=require('util');var path=require(_0x854c('0x1'));var timeout=require('connect-timeout');var express=require(_0x854c('0x2'));var router=express[_0x854c('0x3')]();var fs_extra=require(_0x854c('0x4'));var auth=require(_0x854c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x854c('0x6'));var controller=require(_0x854c('0x7'));router[_0x854c('0x8')]('/',auth[_0x854c('0x9')](),controller[_0x854c('0xa')]);router['get']('/:id',auth[_0x854c('0x9')](),controller[_0x854c('0xb')]);router['get'](_0x854c('0xc'),auth[_0x854c('0x9')](),controller['getFields']);router[_0x854c('0x8')](_0x854c('0xd'),auth[_0x854c('0x9')](),controller[_0x854c('0xe')]);router[_0x854c('0x8')](_0x854c('0xf'),auth[_0x854c('0x9')](),controller[_0x854c('0x10')]);router[_0x854c('0x8')](_0x854c('0x11'),auth[_0x854c('0x9')](),controller[_0x854c('0x12')]);router[_0x854c('0x13')]('/',auth[_0x854c('0x9')](),controller[_0x854c('0x14')]);router[_0x854c('0x13')](_0x854c('0x11'),auth[_0x854c('0x9')](),controller[_0x854c('0x15')]);router[_0x854c('0x16')]('/:id',auth[_0x854c('0x9')](),controller[_0x854c('0x17')]);router[_0x854c('0x18')](_0x854c('0x19'),auth[_0x854c('0x9')](),controller['destroy']);module[_0x854c('0x1a')]=router;
\ No newline at end of file
index d677358..c0eb61f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06a1=['sequelize','exports','STRING'];(function(_0x4b3e7e,_0x391e61){var _0x1e4b09=function(_0x36ef81){while(--_0x36ef81){_0x4b3e7e['push'](_0x4b3e7e['shift']());}};_0x1e4b09(++_0x391e61);}(_0x06a1,0x1ef));var _0x106a=function(_0x93771a,_0x2eb96d){_0x93771a=_0x93771a-0x0;var _0x48a396=_0x06a1[_0x93771a];return _0x48a396;};'use strict';var Sequelize=require(_0x106a('0x0'));module[_0x106a('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x106a('0x2')]}};
\ No newline at end of file
+var _0x10c5=['STRING'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x10c5,0x94));var _0x510c=function(_0x36c773,_0x284f8e){_0x36c773=_0x36c773-0x0;var _0x3881ac=_0x10c5[_0x36c773];return _0x3881ac;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x510c('0x0')]},'description':{'type':Sequelize[_0x510c('0x0')]}};
\ No newline at end of file
index 0f33394..e8b9b99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x743a=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','map','FreshdeskConfiguration','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x2376d1,_0x38eec4){var _0x443759=function(_0x73c733){while(--_0x73c733){_0x2376d1['push'](_0x2376d1['shift']());}};_0x443759(++_0x38eec4);}(_0x743a,0x9a));var _0xa743=function(_0x3905e3,_0x21718d){_0x3905e3=_0x3905e3-0x0;var _0x1fbfad=_0x743a[_0x3905e3];return _0x1fbfad;};'use strict';var emlformat=require(_0xa743('0x0'));var rimraf=require(_0xa743('0x1'));var zipdir=require(_0xa743('0x2'));var jsonpatch=require(_0xa743('0x3'));var rp=require(_0xa743('0x4'));var moment=require('moment');var BPromise=require(_0xa743('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa743('0x6'));var csv=require(_0xa743('0x7'));var ejs=require(_0xa743('0x8'));var fs=require('fs');var fs_extra=require(_0xa743('0x9'));var _=require(_0xa743('0xa'));var squel=require(_0xa743('0xb'));var crypto=require(_0xa743('0xc'));var jsforce=require(_0xa743('0xd'));var deskjs=require(_0xa743('0xe'));var toCsv=require(_0xa743('0x7'));var querystring=require(_0xa743('0xf'));var Papa=require(_0xa743('0x10'));var Redis=require(_0xa743('0x11'));var authService=require(_0xa743('0x12'));var qs=require(_0xa743('0x13'));var as=require(_0xa743('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa743('0x15'));var utils=require('../../config/utils');var config=require(_0xa743('0x16'));var licenseUtil=require(_0xa743('0x17'));var db=require(_0xa743('0x18'))['db'];function respondWithStatusCode(_0x42614d,_0x4bd436){_0x4bd436=_0x4bd436||0xcc;return function(_0x13797f){if(_0x13797f){return _0x42614d[_0xa743('0x19')](_0x4bd436);}return _0x42614d[_0xa743('0x1a')](_0x4bd436)['end']();};}function respondWithResult(_0x43bcaa,_0x3990f5){_0x3990f5=_0x3990f5||0xc8;return function(_0x52d13d){if(_0x52d13d){return _0x43bcaa[_0xa743('0x1a')](_0x3990f5)[_0xa743('0x1b')](_0x52d13d);}};}function respondWithFilteredResult(_0x47b665,_0x38adc2){return function(_0x52d586){if(_0x52d586){var _0x25a848=typeof _0x38adc2[_0xa743('0x1c')]===_0xa743('0x1d')&&typeof _0x38adc2[_0xa743('0x1e')]===_0xa743('0x1d');var _0x1a0d5f=_0x52d586[_0xa743('0x1f')];var _0x35b49a=_0x25a848?0x0:_0x38adc2[_0xa743('0x1c')];var _0x2b48c3=_0x25a848?_0x52d586[_0xa743('0x1f')]:_0x38adc2[_0xa743('0x1c')]+_0x38adc2[_0xa743('0x1e')];var _0x4ca62f;if(_0x2b48c3>=_0x1a0d5f){_0x2b48c3=_0x1a0d5f;_0x4ca62f=0xc8;}else{_0x4ca62f=0xce;}_0x47b665[_0xa743('0x1a')](_0x4ca62f);return _0x47b665[_0xa743('0x20')](_0xa743('0x21'),_0x35b49a+'-'+_0x2b48c3+'/'+_0x1a0d5f)['json'](_0x52d586);}return null;};}function patchUpdates(_0x4bd960){return function(_0x3dc354){try{jsonpatch['apply'](_0x3dc354,_0x4bd960,!![]);}catch(_0x510e99){return BPromise[_0xa743('0x22')](_0x510e99);}return _0x3dc354[_0xa743('0x23')]();};}function saveUpdates(_0x440fc4,_0x47a1ed){return function(_0x52e7e3){if(_0x52e7e3){return _0x52e7e3[_0xa743('0x24')](_0x440fc4)[_0xa743('0x25')](function(_0x3f0d75){return _0x3f0d75;});}return null;};}function removeEntity(_0x1f3387,_0x642ada){return function(_0x15f5e5){if(_0x15f5e5){return _0x15f5e5[_0xa743('0x26')]()[_0xa743('0x25')](function(){_0x1f3387[_0xa743('0x1a')](0xcc)[_0xa743('0x27')]();});}};}function handleEntityNotFound(_0x3f55dc,_0x19bed1){return function(_0x3a45c8){if(!_0x3a45c8){_0x3f55dc[_0xa743('0x19')](0x194);}return _0x3a45c8;};}function handleError(_0x374343,_0x33da69){_0x33da69=_0x33da69||0x1f4;return function(_0x43f732){logger[_0xa743('0x28')](_0x43f732[_0xa743('0x29')]);if(_0x43f732[_0xa743('0x2a')]){delete _0x43f732[_0xa743('0x2a')];}_0x374343[_0xa743('0x1a')](_0x33da69)[_0xa743('0x2b')](_0x43f732);};}exports['index']=function(_0x576cd5,_0x480206){var _0x3442f2={},_0x57a428={},_0x23aeff={'count':0x0,'rows':[]};var _0x156f57=_[_0xa743('0x2c')](db[_0xa743('0x2d')][_0xa743('0x2e')],function(_0xe48620){return{'name':_0xe48620['fieldName'],'type':_0xe48620[_0xa743('0x2f')][_0xa743('0x30')]};});_0x57a428['model']=_[_0xa743('0x2c')](_0x156f57,_0xa743('0x2a'));_0x57a428[_0xa743('0x31')]=_['keys'](_0x576cd5[_0xa743('0x31')]);_0x57a428[_0xa743('0x32')]=_[_0xa743('0x33')](_0x57a428[_0xa743('0x34')],_0x57a428[_0xa743('0x31')]);_0x3442f2[_0xa743('0x35')]=_[_0xa743('0x33')](_0x57a428[_0xa743('0x34')],qs[_0xa743('0x36')](_0x576cd5[_0xa743('0x31')][_0xa743('0x36')]));_0x3442f2[_0xa743('0x35')]=_0x3442f2[_0xa743('0x35')][_0xa743('0x37')]?_0x3442f2[_0xa743('0x35')]:_0x57a428[_0xa743('0x34')];if(!_0x576cd5[_0xa743('0x31')][_0xa743('0x38')](_0xa743('0x39'))){_0x3442f2['limit']=qs[_0xa743('0x1e')](_0x576cd5['query']['limit']);_0x3442f2['offset']=qs[_0xa743('0x1c')](_0x576cd5['query'][_0xa743('0x1c')]);}_0x3442f2[_0xa743('0x3a')]=qs[_0xa743('0x3b')](_0x576cd5[_0xa743('0x31')]['sort']);_0x3442f2[_0xa743('0x3c')]=qs['filters'](_[_0xa743('0x3d')](_0x576cd5[_0xa743('0x31')],_0x57a428['filters']),_0x156f57);if(_0x576cd5['query'][_0xa743('0x3e')]){_0x3442f2[_0xa743('0x3c')]=_[_0xa743('0x3f')](_0x3442f2['where'],{'$or':_[_0xa743('0x2c')](_0x156f57,function(_0x5688f2){if(_0x5688f2[_0xa743('0x2f')]!=='VIRTUAL'){var _0x180968={};_0x180968[_0x5688f2[_0xa743('0x2a')]]={'$like':'%'+_0x576cd5[_0xa743('0x31')]['filter']+'%'};return _0x180968;}})});}_0x3442f2=_[_0xa743('0x3f')]({},_0x3442f2,_0x576cd5[_0xa743('0x40')]);var _0x3ceaa1={'where':_0x3442f2[_0xa743('0x3c')]};return db[_0xa743('0x2d')][_0xa743('0x1f')](_0x3ceaa1)[_0xa743('0x25')](function(_0x35b93b){_0x23aeff[_0xa743('0x1f')]=_0x35b93b;if(_0x576cd5[_0xa743('0x31')][_0xa743('0x41')]){_0x3442f2[_0xa743('0x42')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xa743('0x43')](_0x3442f2);})['then'](function(_0x23706){_0x23aeff[_0xa743('0x44')]=_0x23706;return _0x23aeff;})[_0xa743('0x25')](respondWithFilteredResult(_0x480206,_0x3442f2))[_0xa743('0x45')](handleError(_0x480206,null));};exports[_0xa743('0x46')]=function(_0x1eefff,_0x54a04f){var _0x5a0e81={'raw':![],'where':{'id':_0x1eefff[_0xa743('0x47')]['id']}},_0x1da7d8={};_0x1da7d8[_0xa743('0x34')]=_[_0xa743('0x48')](db[_0xa743('0x2d')]['rawAttributes']);_0x1da7d8['query']=_['keys'](_0x1eefff['query']);_0x1da7d8[_0xa743('0x32')]=_[_0xa743('0x33')](_0x1da7d8[_0xa743('0x34')],_0x1da7d8[_0xa743('0x31')]);_0x5a0e81[_0xa743('0x35')]=_[_0xa743('0x33')](_0x1da7d8[_0xa743('0x34')],qs['fields'](_0x1eefff[_0xa743('0x31')]['fields']));_0x5a0e81['attributes']=_0x5a0e81[_0xa743('0x35')][_0xa743('0x37')]?_0x5a0e81['attributes']:_0x1da7d8[_0xa743('0x34')];if(_0x1eefff[_0xa743('0x31')][_0xa743('0x41')]){_0x5a0e81[_0xa743('0x42')]=[{'all':!![]}];}_0x5a0e81=_['merge']({},_0x5a0e81,_0x1eefff[_0xa743('0x40')]);return db['FreshdeskConfiguration'][_0xa743('0x49')](_0x5a0e81)[_0xa743('0x25')](handleEntityNotFound(_0x54a04f,null))[_0xa743('0x25')](respondWithResult(_0x54a04f,null))[_0xa743('0x45')](handleError(_0x54a04f,null));};exports[_0xa743('0x4a')]=function(_0x44a499,_0x1fa457){return db[_0xa743('0x2d')][_0xa743('0x4a')](_0x44a499[_0xa743('0x4b')],{})[_0xa743('0x25')](respondWithResult(_0x1fa457,0xc9))[_0xa743('0x45')](handleError(_0x1fa457,null));};exports[_0xa743('0x24')]=function(_0x1ba42b,_0x43fa9c){if(_0x1ba42b[_0xa743('0x4b')]['id']){delete _0x1ba42b[_0xa743('0x4b')]['id'];}return db['FreshdeskConfiguration'][_0xa743('0x49')]({'where':{'id':_0x1ba42b[_0xa743('0x47')]['id']}})[_0xa743('0x25')](handleEntityNotFound(_0x43fa9c,null))[_0xa743('0x25')](saveUpdates(_0x1ba42b[_0xa743('0x4b')],null))['then'](respondWithResult(_0x43fa9c,null))[_0xa743('0x45')](handleError(_0x43fa9c,null));};exports[_0xa743('0x26')]=function(_0x5726bd,_0x462951){return db[_0xa743('0x2d')][_0xa743('0x49')]({'where':{'id':_0x5726bd[_0xa743('0x47')]['id']}})[_0xa743('0x25')](handleEntityNotFound(_0x462951,null))[_0xa743('0x25')](removeEntity(_0x462951,null))['catch'](handleError(_0x462951,null));};exports[_0xa743('0x4c')]=function(_0x5c40d4,_0x37bf8f,_0x2d5ff5){var _0x221863={};var _0x10cef5={};var _0x57f125;var _0x5f01ad;return db[_0xa743('0x2d')][_0xa743('0x4d')]({'where':{'id':_0x5c40d4[_0xa743('0x47')]['id']}})[_0xa743('0x25')](handleEntityNotFound(_0x37bf8f,null))[_0xa743('0x25')](function(_0x11fa1a){if(_0x11fa1a){_0x57f125=_0x11fa1a;_0x10cef5[_0xa743('0x34')]=_[_0xa743('0x48')](db[_0xa743('0x4e')][_0xa743('0x2e')]);_0x10cef5[_0xa743('0x31')]=_[_0xa743('0x48')](_0x5c40d4[_0xa743('0x31')]);_0x10cef5[_0xa743('0x32')]=_[_0xa743('0x33')](_0x10cef5[_0xa743('0x34')],_0x10cef5[_0xa743('0x31')]);_0x221863['attributes']=_[_0xa743('0x33')](_0x10cef5[_0xa743('0x34')],qs[_0xa743('0x36')](_0x5c40d4[_0xa743('0x31')][_0xa743('0x36')]));_0x221863[_0xa743('0x35')]=_0x221863['attributes'][_0xa743('0x37')]?_0x221863[_0xa743('0x35')]:_0x10cef5[_0xa743('0x34')];_0x221863[_0xa743('0x3a')]=qs[_0xa743('0x3b')](_0x5c40d4[_0xa743('0x31')]['sort']);_0x221863[_0xa743('0x3c')]=qs['filters'](_[_0xa743('0x3d')](_0x5c40d4['query'],_0x10cef5[_0xa743('0x32')]));if(_0x5c40d4[_0xa743('0x31')][_0xa743('0x3e')]){_0x221863['where']=_['merge'](_0x221863[_0xa743('0x3c')],{'$or':_['map'](_0x221863['attributes'],function(_0x385e59){var _0x34b8c8={};_0x34b8c8[_0x385e59]={'$like':'%'+_0x5c40d4[_0xa743('0x31')][_0xa743('0x3e')]+'%'};return _0x34b8c8;})});}_0x221863=_['merge']({},_0x221863,_0x5c40d4[_0xa743('0x40')]);return _0x57f125[_0xa743('0x4c')](_0x221863);}})[_0xa743('0x25')](function(_0x236409){if(_0x236409){_0x5f01ad=_0x236409['length'];if(!_0x5c40d4[_0xa743('0x31')][_0xa743('0x38')](_0xa743('0x39'))){_0x221863[_0xa743('0x1e')]=qs[_0xa743('0x1e')](_0x5c40d4[_0xa743('0x31')]['limit']);_0x221863[_0xa743('0x1c')]=qs[_0xa743('0x1c')](_0x5c40d4['query']['offset']);}return _0x57f125[_0xa743('0x4c')](_0x221863);}})[_0xa743('0x25')](function(_0xa0d7d6){if(_0xa0d7d6){return _0xa0d7d6?{'count':_0x5f01ad,'rows':_0xa0d7d6}:null;}})[_0xa743('0x25')](respondWithResult(_0x37bf8f,null))[_0xa743('0x45')](handleError(_0x37bf8f,null));};exports['getSubjects']=function(_0x5d0277,_0x23cc0d,_0x4f75a3){var _0x2e0c6c={};var _0x242594={};var _0x50345f;var _0x229414;return db[_0xa743('0x2d')][_0xa743('0x4d')]({'where':{'id':_0x5d0277['params']['id']}})['then'](handleEntityNotFound(_0x23cc0d,null))[_0xa743('0x25')](function(_0x2e7327){if(_0x2e7327){_0x50345f=_0x2e7327;_0x242594[_0xa743('0x34')]=_[_0xa743('0x48')](db[_0xa743('0x4e')][_0xa743('0x2e')]);_0x242594[_0xa743('0x31')]=_[_0xa743('0x48')](_0x5d0277[_0xa743('0x31')]);_0x242594[_0xa743('0x32')]=_[_0xa743('0x33')](_0x242594['model'],_0x242594[_0xa743('0x31')]);_0x2e0c6c[_0xa743('0x35')]=_[_0xa743('0x33')](_0x242594[_0xa743('0x34')],qs[_0xa743('0x36')](_0x5d0277[_0xa743('0x31')][_0xa743('0x36')]));_0x2e0c6c['attributes']=_0x2e0c6c[_0xa743('0x35')][_0xa743('0x37')]?_0x2e0c6c[_0xa743('0x35')]:_0x242594[_0xa743('0x34')];_0x2e0c6c[_0xa743('0x3a')]=qs[_0xa743('0x3b')](_0x5d0277['query'][_0xa743('0x3b')]);_0x2e0c6c[_0xa743('0x3c')]=qs[_0xa743('0x32')](_[_0xa743('0x3d')](_0x5d0277['query'],_0x242594[_0xa743('0x32')]));if(_0x5d0277[_0xa743('0x31')][_0xa743('0x3e')]){_0x2e0c6c['where']=_[_0xa743('0x3f')](_0x2e0c6c['where'],{'$or':_[_0xa743('0x2c')](_0x2e0c6c['attributes'],function(_0x1884c4){var _0xf7e580={};_0xf7e580[_0x1884c4]={'$like':'%'+_0x5d0277[_0xa743('0x31')]['filter']+'%'};return _0xf7e580;})});}_0x2e0c6c=_[_0xa743('0x3f')]({},_0x2e0c6c,_0x5d0277['options']);return _0x50345f['getSubjects'](_0x2e0c6c);}})[_0xa743('0x25')](function(_0x24bf09){if(_0x24bf09){_0x229414=_0x24bf09[_0xa743('0x37')];if(!_0x5d0277['query'][_0xa743('0x38')](_0xa743('0x39'))){_0x2e0c6c['limit']=qs['limit'](_0x5d0277[_0xa743('0x31')][_0xa743('0x1e')]);_0x2e0c6c[_0xa743('0x1c')]=qs[_0xa743('0x1c')](_0x5d0277[_0xa743('0x31')][_0xa743('0x1c')]);}return _0x50345f[_0xa743('0x4f')](_0x2e0c6c);}})['then'](function(_0x110a45){if(_0x110a45){return _0x110a45?{'count':_0x229414,'rows':_0x110a45}:null;}})[_0xa743('0x25')](respondWithResult(_0x23cc0d,null))[_0xa743('0x45')](handleError(_0x23cc0d,null));};exports[_0xa743('0x50')]=function(_0x4e0988,_0x5ceb30,_0x4a2624){var _0x19455f={};var _0x4a6b5b={};var _0x3b7c7c;var _0x2533a3;return db[_0xa743('0x2d')][_0xa743('0x4d')]({'where':{'id':_0x4e0988['params']['id']}})['then'](handleEntityNotFound(_0x5ceb30,null))[_0xa743('0x25')](function(_0x4371e2){if(_0x4371e2){_0x3b7c7c=_0x4371e2;_0x4a6b5b[_0xa743('0x34')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x4a6b5b[_0xa743('0x31')]=_['keys'](_0x4e0988['query']);_0x4a6b5b[_0xa743('0x32')]=_[_0xa743('0x33')](_0x4a6b5b['model'],_0x4a6b5b[_0xa743('0x31')]);_0x19455f[_0xa743('0x35')]=_[_0xa743('0x33')](_0x4a6b5b[_0xa743('0x34')],qs[_0xa743('0x36')](_0x4e0988[_0xa743('0x31')][_0xa743('0x36')]));_0x19455f[_0xa743('0x35')]=_0x19455f[_0xa743('0x35')][_0xa743('0x37')]?_0x19455f[_0xa743('0x35')]:_0x4a6b5b['model'];_0x19455f[_0xa743('0x3a')]=qs[_0xa743('0x3b')](_0x4e0988[_0xa743('0x31')][_0xa743('0x3b')]);_0x19455f['where']=qs[_0xa743('0x32')](_[_0xa743('0x3d')](_0x4e0988['query'],_0x4a6b5b['filters']));if(_0x4e0988['query'][_0xa743('0x3e')]){_0x19455f['where']=_[_0xa743('0x3f')](_0x19455f[_0xa743('0x3c')],{'$or':_['map'](_0x19455f[_0xa743('0x35')],function(_0x43de12){var _0x4da8ff={};_0x4da8ff[_0x43de12]={'$like':'%'+_0x4e0988[_0xa743('0x31')]['filter']+'%'};return _0x4da8ff;})});}_0x19455f=_[_0xa743('0x3f')]({},_0x19455f,_0x4e0988[_0xa743('0x40')]);return _0x3b7c7c[_0xa743('0x50')](_0x19455f);}})[_0xa743('0x25')](function(_0x5d2ce9){if(_0x5d2ce9){_0x2533a3=_0x5d2ce9[_0xa743('0x37')];if(!_0x4e0988['query'][_0xa743('0x38')]('nolimit')){_0x19455f[_0xa743('0x1e')]=qs[_0xa743('0x1e')](_0x4e0988[_0xa743('0x31')][_0xa743('0x1e')]);_0x19455f[_0xa743('0x1c')]=qs['offset'](_0x4e0988[_0xa743('0x31')][_0xa743('0x1c')]);}return _0x3b7c7c[_0xa743('0x50')](_0x19455f);}})[_0xa743('0x25')](function(_0x2b7c9d){if(_0x2b7c9d){return _0x2b7c9d?{'count':_0x2533a3,'rows':_0x2b7c9d}:null;}})[_0xa743('0x25')](respondWithResult(_0x5ceb30,null))[_0xa743('0x45')](handleError(_0x5ceb30,null));};exports[_0xa743('0x51')]=function(_0x43fdaf,_0x8b262f,_0x423e39){var _0x5b2adf={};var _0x4d01d4={};var _0x190d8a;var _0x4fe5c2;return db[_0xa743('0x2d')]['findOne']({'where':{'id':_0x43fdaf[_0xa743('0x47')]['id']}})['then'](handleEntityNotFound(_0x8b262f,null))[_0xa743('0x25')](function(_0x2e3421){if(_0x2e3421){_0x190d8a=_0x2e3421;_0x4d01d4['model']=_[_0xa743('0x48')](db[_0xa743('0x52')][_0xa743('0x2e')]);_0x4d01d4[_0xa743('0x31')]=_[_0xa743('0x48')](_0x43fdaf[_0xa743('0x31')]);_0x4d01d4[_0xa743('0x32')]=_[_0xa743('0x33')](_0x4d01d4[_0xa743('0x34')],_0x4d01d4[_0xa743('0x31')]);_0x5b2adf[_0xa743('0x35')]=_[_0xa743('0x33')](_0x4d01d4[_0xa743('0x34')],qs[_0xa743('0x36')](_0x43fdaf[_0xa743('0x31')][_0xa743('0x36')]));_0x5b2adf[_0xa743('0x35')]=_0x5b2adf[_0xa743('0x35')][_0xa743('0x37')]?_0x5b2adf[_0xa743('0x35')]:_0x4d01d4[_0xa743('0x34')];_0x5b2adf[_0xa743('0x3a')]=qs[_0xa743('0x3b')](_0x43fdaf['query']['sort']);_0x5b2adf['where']=qs['filters'](_[_0xa743('0x3d')](_0x43fdaf[_0xa743('0x31')],_0x4d01d4[_0xa743('0x32')]));if(_0x43fdaf[_0xa743('0x31')][_0xa743('0x3e')]){_0x5b2adf['where']=_[_0xa743('0x3f')](_0x5b2adf[_0xa743('0x3c')],{'$or':_[_0xa743('0x2c')](_0x5b2adf['attributes'],function(_0x4ec1e6){var _0xef15f8={};_0xef15f8[_0x4ec1e6]={'$like':'%'+_0x43fdaf[_0xa743('0x31')][_0xa743('0x3e')]+'%'};return _0xef15f8;})});}_0x5b2adf=_[_0xa743('0x3f')]({},_0x5b2adf,_0x43fdaf[_0xa743('0x40')]);return _0x190d8a[_0xa743('0x51')](_0x5b2adf);}})[_0xa743('0x25')](function(_0x26804e){if(_0x26804e){_0x4fe5c2=_0x26804e[_0xa743('0x37')];if(!_0x43fdaf['query'][_0xa743('0x38')](_0xa743('0x39'))){_0x5b2adf['limit']=qs[_0xa743('0x1e')](_0x43fdaf['query'][_0xa743('0x1e')]);_0x5b2adf[_0xa743('0x1c')]=qs['offset'](_0x43fdaf[_0xa743('0x31')][_0xa743('0x1c')]);}return _0x190d8a[_0xa743('0x51')](_0x5b2adf);}})[_0xa743('0x25')](function(_0x4cef1a){if(_0x4cef1a){return _0x4cef1a?{'count':_0x4fe5c2,'rows':_0x4cef1a}:null;}})['then'](respondWithResult(_0x8b262f,null))[_0xa743('0x45')](handleError(_0x8b262f,null));};exports['setTags']=function(_0x4a2103,_0x3b5d20,_0x7dd09){if(_0x4a2103[_0xa743('0x4b')]['id']){delete _0x4a2103['body']['id'];}return db['FreshdeskConfiguration'][_0xa743('0x4d')]({'where':{'id':_0x4a2103[_0xa743('0x47')]['id']}})[_0xa743('0x25')](handleEntityNotFound(_0x3b5d20,null))[_0xa743('0x25')](function(_0x2b4767){if(_0x2b4767){return _0x2b4767[_0xa743('0x53')](_0x4a2103['body'][_0xa743('0x54')]||[]);}return null;})[_0xa743('0x25')](respondWithResult(_0x3b5d20,null))[_0xa743('0x45')](handleError(_0x3b5d20,null));};
\ No newline at end of file
+var _0xc4b5=['name','map','FreshdeskConfiguration','rawAttributes','fieldName','key','keys','filters','intersection','model','fields','query','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','body','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','set','json','reject','update','destroy','then','error','stack'];(function(_0x5900bb,_0x25ca70){var _0x2e4aeb=function(_0x29a656){while(--_0x29a656){_0x5900bb['push'](_0x5900bb['shift']());}};_0x2e4aeb(++_0x25ca70);}(_0xc4b5,0xcc));var _0x5c4b=function(_0x3219e0,_0x3872f8){_0x3219e0=_0x3219e0-0x0;var _0x1434b9=_0xc4b5[_0x3219e0];return _0x1434b9;};'use strict';var emlformat=require(_0x5c4b('0x0'));var rimraf=require(_0x5c4b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5c4b('0x2'));var moment=require(_0x5c4b('0x3'));var BPromise=require(_0x5c4b('0x4'));var Mustache=require(_0x5c4b('0x5'));var util=require('util');var path=require(_0x5c4b('0x6'));var sox=require(_0x5c4b('0x7'));var csv=require(_0x5c4b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c4b('0x9'));var _=require('lodash');var squel=require(_0x5c4b('0xa'));var crypto=require('crypto');var jsforce=require(_0x5c4b('0xb'));var deskjs=require(_0x5c4b('0xc'));var toCsv=require(_0x5c4b('0x8'));var querystring=require('querystring');var Papa=require(_0x5c4b('0xd'));var Redis=require(_0x5c4b('0xe'));var authService=require(_0x5c4b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5c4b('0x10'));var hardwareService=require(_0x5c4b('0x11'));var logger=require('../../config/logger')(_0x5c4b('0x12'));var utils=require(_0x5c4b('0x13'));var config=require(_0x5c4b('0x14'));var licenseUtil=require(_0x5c4b('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x405aa6,_0x374a62){_0x374a62=_0x374a62||0xcc;return function(_0x1e71aa){if(_0x1e71aa){return _0x405aa6[_0x5c4b('0x16')](_0x374a62);}return _0x405aa6[_0x5c4b('0x17')](_0x374a62)[_0x5c4b('0x18')]();};}function respondWithResult(_0x2d1c6a,_0x2d945b){_0x2d945b=_0x2d945b||0xc8;return function(_0x11197a){if(_0x11197a){return _0x2d1c6a[_0x5c4b('0x17')](_0x2d945b)['json'](_0x11197a);}};}function respondWithFilteredResult(_0x58d713,_0x1e804a){return function(_0x114c91){if(_0x114c91){var _0x222297=typeof _0x1e804a[_0x5c4b('0x19')]===_0x5c4b('0x1a')&&typeof _0x1e804a['limit']==='undefined';var _0x42ebb5=_0x114c91[_0x5c4b('0x1b')];var _0x2d7ee6=_0x222297?0x0:_0x1e804a['offset'];var _0x284be1=_0x222297?_0x114c91[_0x5c4b('0x1b')]:_0x1e804a[_0x5c4b('0x19')]+_0x1e804a['limit'];var _0x1b8db2;if(_0x284be1>=_0x42ebb5){_0x284be1=_0x42ebb5;_0x1b8db2=0xc8;}else{_0x1b8db2=0xce;}_0x58d713['status'](_0x1b8db2);return _0x58d713[_0x5c4b('0x1c')]('Content-Range',_0x2d7ee6+'-'+_0x284be1+'/'+_0x42ebb5)[_0x5c4b('0x1d')](_0x114c91);}return null;};}function patchUpdates(_0x5ca1ee){return function(_0x1b3e80){try{jsonpatch['apply'](_0x1b3e80,_0x5ca1ee,!![]);}catch(_0x4a33ad){return BPromise[_0x5c4b('0x1e')](_0x4a33ad);}return _0x1b3e80['save']();};}function saveUpdates(_0x22ec27,_0x5b398b){return function(_0x2509f5){if(_0x2509f5){return _0x2509f5[_0x5c4b('0x1f')](_0x22ec27)['then'](function(_0x3b5170){return _0x3b5170;});}return null;};}function removeEntity(_0x2738b9,_0x20457b){return function(_0x20ea0e){if(_0x20ea0e){return _0x20ea0e[_0x5c4b('0x20')]()[_0x5c4b('0x21')](function(){_0x2738b9[_0x5c4b('0x17')](0xcc)[_0x5c4b('0x18')]();});}};}function handleEntityNotFound(_0x519823,_0xf1d69a){return function(_0x332851){if(!_0x332851){_0x519823[_0x5c4b('0x16')](0x194);}return _0x332851;};}function handleError(_0x4d7a2d,_0x5821b1){_0x5821b1=_0x5821b1||0x1f4;return function(_0x54e83a){logger[_0x5c4b('0x22')](_0x54e83a[_0x5c4b('0x23')]);if(_0x54e83a[_0x5c4b('0x24')]){delete _0x54e83a[_0x5c4b('0x24')];}_0x4d7a2d[_0x5c4b('0x17')](_0x5821b1)['send'](_0x54e83a);};}exports['index']=function(_0x37efe6,_0x36fd6f){var _0x595dac={},_0x1a9c88={},_0x6aa1c5={'count':0x0,'rows':[]};var _0x443511=_[_0x5c4b('0x25')](db[_0x5c4b('0x26')][_0x5c4b('0x27')],function(_0x2585ff){return{'name':_0x2585ff[_0x5c4b('0x28')],'type':_0x2585ff['type'][_0x5c4b('0x29')]};});_0x1a9c88['model']=_[_0x5c4b('0x25')](_0x443511,_0x5c4b('0x24'));_0x1a9c88['query']=_[_0x5c4b('0x2a')](_0x37efe6['query']);_0x1a9c88[_0x5c4b('0x2b')]=_[_0x5c4b('0x2c')](_0x1a9c88[_0x5c4b('0x2d')],_0x1a9c88['query']);_0x595dac['attributes']=_[_0x5c4b('0x2c')](_0x1a9c88[_0x5c4b('0x2d')],qs[_0x5c4b('0x2e')](_0x37efe6[_0x5c4b('0x2f')][_0x5c4b('0x2e')]));_0x595dac['attributes']=_0x595dac[_0x5c4b('0x30')][_0x5c4b('0x31')]?_0x595dac[_0x5c4b('0x30')]:_0x1a9c88['model'];if(!_0x37efe6['query'][_0x5c4b('0x32')](_0x5c4b('0x33'))){_0x595dac['limit']=qs[_0x5c4b('0x34')](_0x37efe6[_0x5c4b('0x2f')]['limit']);_0x595dac['offset']=qs[_0x5c4b('0x19')](_0x37efe6[_0x5c4b('0x2f')]['offset']);}_0x595dac[_0x5c4b('0x35')]=qs[_0x5c4b('0x36')](_0x37efe6[_0x5c4b('0x2f')][_0x5c4b('0x36')]);_0x595dac[_0x5c4b('0x37')]=qs['filters'](_[_0x5c4b('0x38')](_0x37efe6[_0x5c4b('0x2f')],_0x1a9c88[_0x5c4b('0x2b')]),_0x443511);if(_0x37efe6[_0x5c4b('0x2f')][_0x5c4b('0x39')]){_0x595dac[_0x5c4b('0x37')]=_[_0x5c4b('0x3a')](_0x595dac['where'],{'$or':_['map'](_0x443511,function(_0x363b73){if(_0x363b73[_0x5c4b('0x3b')]!==_0x5c4b('0x3c')){var _0xbb5f1={};_0xbb5f1[_0x363b73[_0x5c4b('0x24')]]={'$like':'%'+_0x37efe6[_0x5c4b('0x2f')][_0x5c4b('0x39')]+'%'};return _0xbb5f1;}})});}_0x595dac=_[_0x5c4b('0x3a')]({},_0x595dac,_0x37efe6[_0x5c4b('0x3d')]);var _0x3430e2={'where':_0x595dac[_0x5c4b('0x37')]};return db[_0x5c4b('0x26')][_0x5c4b('0x1b')](_0x3430e2)[_0x5c4b('0x21')](function(_0x155c23){_0x6aa1c5[_0x5c4b('0x1b')]=_0x155c23;if(_0x37efe6[_0x5c4b('0x2f')][_0x5c4b('0x3e')]){_0x595dac[_0x5c4b('0x3f')]=[{'all':!![]}];}return db[_0x5c4b('0x26')][_0x5c4b('0x40')](_0x595dac);})[_0x5c4b('0x21')](function(_0x5cbb89){_0x6aa1c5['rows']=_0x5cbb89;return _0x6aa1c5;})[_0x5c4b('0x21')](respondWithFilteredResult(_0x36fd6f,_0x595dac))['catch'](handleError(_0x36fd6f,null));};exports[_0x5c4b('0x41')]=function(_0x44953f,_0x4c994){var _0x189b8a={'raw':![],'where':{'id':_0x44953f[_0x5c4b('0x42')]['id']}},_0x2bb6bb={};_0x2bb6bb[_0x5c4b('0x2d')]=_[_0x5c4b('0x2a')](db[_0x5c4b('0x26')]['rawAttributes']);_0x2bb6bb[_0x5c4b('0x2f')]=_[_0x5c4b('0x2a')](_0x44953f[_0x5c4b('0x2f')]);_0x2bb6bb['filters']=_[_0x5c4b('0x2c')](_0x2bb6bb[_0x5c4b('0x2d')],_0x2bb6bb[_0x5c4b('0x2f')]);_0x189b8a['attributes']=_['intersection'](_0x2bb6bb[_0x5c4b('0x2d')],qs[_0x5c4b('0x2e')](_0x44953f[_0x5c4b('0x2f')][_0x5c4b('0x2e')]));_0x189b8a[_0x5c4b('0x30')]=_0x189b8a[_0x5c4b('0x30')]['length']?_0x189b8a['attributes']:_0x2bb6bb['model'];if(_0x44953f[_0x5c4b('0x2f')][_0x5c4b('0x3e')]){_0x189b8a[_0x5c4b('0x3f')]=[{'all':!![]}];}_0x189b8a=_[_0x5c4b('0x3a')]({},_0x189b8a,_0x44953f[_0x5c4b('0x3d')]);return db[_0x5c4b('0x26')][_0x5c4b('0x43')](_0x189b8a)[_0x5c4b('0x21')](handleEntityNotFound(_0x4c994,null))[_0x5c4b('0x21')](respondWithResult(_0x4c994,null))[_0x5c4b('0x44')](handleError(_0x4c994,null));};exports[_0x5c4b('0x45')]=function(_0x3a0063,_0x4cf703){return db[_0x5c4b('0x26')][_0x5c4b('0x45')](_0x3a0063[_0x5c4b('0x46')],{})[_0x5c4b('0x21')](respondWithResult(_0x4cf703,0xc9))[_0x5c4b('0x44')](handleError(_0x4cf703,null));};exports[_0x5c4b('0x1f')]=function(_0x275894,_0x4a2dbd){if(_0x275894[_0x5c4b('0x46')]['id']){delete _0x275894[_0x5c4b('0x46')]['id'];}return db[_0x5c4b('0x26')][_0x5c4b('0x43')]({'where':{'id':_0x275894[_0x5c4b('0x42')]['id']}})[_0x5c4b('0x21')](handleEntityNotFound(_0x4a2dbd,null))['then'](saveUpdates(_0x275894[_0x5c4b('0x46')],null))[_0x5c4b('0x21')](respondWithResult(_0x4a2dbd,null))[_0x5c4b('0x44')](handleError(_0x4a2dbd,null));};exports[_0x5c4b('0x20')]=function(_0x449f12,_0x4d30a0){return db['FreshdeskConfiguration'][_0x5c4b('0x43')]({'where':{'id':_0x449f12['params']['id']}})[_0x5c4b('0x21')](handleEntityNotFound(_0x4d30a0,null))['then'](removeEntity(_0x4d30a0,null))[_0x5c4b('0x44')](handleError(_0x4d30a0,null));};exports[_0x5c4b('0x47')]=function(_0x1ad659,_0x75a0c4,_0x3dc6d0){var _0x20e4bc={};var _0xca6437={};var _0x1b23b6;var _0x4566a9;return db[_0x5c4b('0x26')][_0x5c4b('0x48')]({'where':{'id':_0x1ad659[_0x5c4b('0x42')]['id']}})[_0x5c4b('0x21')](handleEntityNotFound(_0x75a0c4,null))[_0x5c4b('0x21')](function(_0x1c3954){if(_0x1c3954){_0x1b23b6=_0x1c3954;_0xca6437[_0x5c4b('0x2d')]=_['keys'](db[_0x5c4b('0x49')][_0x5c4b('0x27')]);_0xca6437[_0x5c4b('0x2f')]=_[_0x5c4b('0x2a')](_0x1ad659['query']);_0xca6437[_0x5c4b('0x2b')]=_[_0x5c4b('0x2c')](_0xca6437['model'],_0xca6437['query']);_0x20e4bc[_0x5c4b('0x30')]=_[_0x5c4b('0x2c')](_0xca6437[_0x5c4b('0x2d')],qs[_0x5c4b('0x2e')](_0x1ad659[_0x5c4b('0x2f')][_0x5c4b('0x2e')]));_0x20e4bc[_0x5c4b('0x30')]=_0x20e4bc[_0x5c4b('0x30')]['length']?_0x20e4bc['attributes']:_0xca6437[_0x5c4b('0x2d')];_0x20e4bc[_0x5c4b('0x35')]=qs['sort'](_0x1ad659[_0x5c4b('0x2f')][_0x5c4b('0x36')]);_0x20e4bc[_0x5c4b('0x37')]=qs[_0x5c4b('0x2b')](_['pick'](_0x1ad659[_0x5c4b('0x2f')],_0xca6437[_0x5c4b('0x2b')]));if(_0x1ad659[_0x5c4b('0x2f')][_0x5c4b('0x39')]){_0x20e4bc['where']=_[_0x5c4b('0x3a')](_0x20e4bc[_0x5c4b('0x37')],{'$or':_[_0x5c4b('0x25')](_0x20e4bc['attributes'],function(_0x36f5df){var _0x1dc04a={};_0x1dc04a[_0x36f5df]={'$like':'%'+_0x1ad659[_0x5c4b('0x2f')][_0x5c4b('0x39')]+'%'};return _0x1dc04a;})});}_0x20e4bc=_['merge']({},_0x20e4bc,_0x1ad659[_0x5c4b('0x3d')]);return _0x1b23b6['getFields'](_0x20e4bc);}})[_0x5c4b('0x21')](function(_0x2e2bb3){if(_0x2e2bb3){_0x4566a9=_0x2e2bb3[_0x5c4b('0x31')];if(!_0x1ad659[_0x5c4b('0x2f')][_0x5c4b('0x32')](_0x5c4b('0x33'))){_0x20e4bc[_0x5c4b('0x34')]=qs[_0x5c4b('0x34')](_0x1ad659[_0x5c4b('0x2f')][_0x5c4b('0x34')]);_0x20e4bc['offset']=qs['offset'](_0x1ad659[_0x5c4b('0x2f')][_0x5c4b('0x19')]);}return _0x1b23b6[_0x5c4b('0x47')](_0x20e4bc);}})['then'](function(_0x5e8eed){if(_0x5e8eed){return _0x5e8eed?{'count':_0x4566a9,'rows':_0x5e8eed}:null;}})[_0x5c4b('0x21')](respondWithResult(_0x75a0c4,null))[_0x5c4b('0x44')](handleError(_0x75a0c4,null));};exports[_0x5c4b('0x4a')]=function(_0x538b0e,_0x2aadf4,_0x27a33f){var _0x5a4ad6={};var _0x24ea6d={};var _0x2bda23;var _0x150514;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x538b0e[_0x5c4b('0x42')]['id']}})[_0x5c4b('0x21')](handleEntityNotFound(_0x2aadf4,null))[_0x5c4b('0x21')](function(_0x23c31b){if(_0x23c31b){_0x2bda23=_0x23c31b;_0x24ea6d[_0x5c4b('0x2d')]=_['keys'](db['FreshdeskField'][_0x5c4b('0x27')]);_0x24ea6d[_0x5c4b('0x2f')]=_['keys'](_0x538b0e[_0x5c4b('0x2f')]);_0x24ea6d['filters']=_[_0x5c4b('0x2c')](_0x24ea6d['model'],_0x24ea6d[_0x5c4b('0x2f')]);_0x5a4ad6['attributes']=_[_0x5c4b('0x2c')](_0x24ea6d[_0x5c4b('0x2d')],qs['fields'](_0x538b0e['query'][_0x5c4b('0x2e')]));_0x5a4ad6[_0x5c4b('0x30')]=_0x5a4ad6[_0x5c4b('0x30')][_0x5c4b('0x31')]?_0x5a4ad6['attributes']:_0x24ea6d[_0x5c4b('0x2d')];_0x5a4ad6[_0x5c4b('0x35')]=qs[_0x5c4b('0x36')](_0x538b0e[_0x5c4b('0x2f')][_0x5c4b('0x36')]);_0x5a4ad6[_0x5c4b('0x37')]=qs['filters'](_[_0x5c4b('0x38')](_0x538b0e['query'],_0x24ea6d[_0x5c4b('0x2b')]));if(_0x538b0e[_0x5c4b('0x2f')][_0x5c4b('0x39')]){_0x5a4ad6[_0x5c4b('0x37')]=_['merge'](_0x5a4ad6[_0x5c4b('0x37')],{'$or':_[_0x5c4b('0x25')](_0x5a4ad6[_0x5c4b('0x30')],function(_0x3582c3){var _0xc1a79a={};_0xc1a79a[_0x3582c3]={'$like':'%'+_0x538b0e['query']['filter']+'%'};return _0xc1a79a;})});}_0x5a4ad6=_[_0x5c4b('0x3a')]({},_0x5a4ad6,_0x538b0e[_0x5c4b('0x3d')]);return _0x2bda23[_0x5c4b('0x4a')](_0x5a4ad6);}})['then'](function(_0x56f572){if(_0x56f572){_0x150514=_0x56f572[_0x5c4b('0x31')];if(!_0x538b0e[_0x5c4b('0x2f')][_0x5c4b('0x32')]('nolimit')){_0x5a4ad6['limit']=qs['limit'](_0x538b0e['query'][_0x5c4b('0x34')]);_0x5a4ad6[_0x5c4b('0x19')]=qs[_0x5c4b('0x19')](_0x538b0e['query']['offset']);}return _0x2bda23['getSubjects'](_0x5a4ad6);}})[_0x5c4b('0x21')](function(_0x538840){if(_0x538840){return _0x538840?{'count':_0x150514,'rows':_0x538840}:null;}})[_0x5c4b('0x21')](respondWithResult(_0x2aadf4,null))['catch'](handleError(_0x2aadf4,null));};exports['getDescriptions']=function(_0x542574,_0x44ca3a,_0xd9278e){var _0x230a1b={};var _0x283058={};var _0x52e88a;var _0x4f03b5;return db[_0x5c4b('0x26')][_0x5c4b('0x48')]({'where':{'id':_0x542574[_0x5c4b('0x42')]['id']}})[_0x5c4b('0x21')](handleEntityNotFound(_0x44ca3a,null))[_0x5c4b('0x21')](function(_0x2f070e){if(_0x2f070e){_0x52e88a=_0x2f070e;_0x283058[_0x5c4b('0x2d')]=_[_0x5c4b('0x2a')](db[_0x5c4b('0x49')][_0x5c4b('0x27')]);_0x283058[_0x5c4b('0x2f')]=_[_0x5c4b('0x2a')](_0x542574[_0x5c4b('0x2f')]);_0x283058[_0x5c4b('0x2b')]=_['intersection'](_0x283058[_0x5c4b('0x2d')],_0x283058[_0x5c4b('0x2f')]);_0x230a1b['attributes']=_['intersection'](_0x283058[_0x5c4b('0x2d')],qs[_0x5c4b('0x2e')](_0x542574[_0x5c4b('0x2f')][_0x5c4b('0x2e')]));_0x230a1b[_0x5c4b('0x30')]=_0x230a1b[_0x5c4b('0x30')]['length']?_0x230a1b[_0x5c4b('0x30')]:_0x283058[_0x5c4b('0x2d')];_0x230a1b[_0x5c4b('0x35')]=qs[_0x5c4b('0x36')](_0x542574['query'][_0x5c4b('0x36')]);_0x230a1b['where']=qs[_0x5c4b('0x2b')](_[_0x5c4b('0x38')](_0x542574[_0x5c4b('0x2f')],_0x283058[_0x5c4b('0x2b')]));if(_0x542574[_0x5c4b('0x2f')][_0x5c4b('0x39')]){_0x230a1b[_0x5c4b('0x37')]=_[_0x5c4b('0x3a')](_0x230a1b['where'],{'$or':_[_0x5c4b('0x25')](_0x230a1b[_0x5c4b('0x30')],function(_0x57513e){var _0x455884={};_0x455884[_0x57513e]={'$like':'%'+_0x542574[_0x5c4b('0x2f')][_0x5c4b('0x39')]+'%'};return _0x455884;})});}_0x230a1b=_[_0x5c4b('0x3a')]({},_0x230a1b,_0x542574[_0x5c4b('0x3d')]);return _0x52e88a['getDescriptions'](_0x230a1b);}})[_0x5c4b('0x21')](function(_0x5656e7){if(_0x5656e7){_0x4f03b5=_0x5656e7[_0x5c4b('0x31')];if(!_0x542574[_0x5c4b('0x2f')][_0x5c4b('0x32')](_0x5c4b('0x33'))){_0x230a1b[_0x5c4b('0x34')]=qs[_0x5c4b('0x34')](_0x542574['query'][_0x5c4b('0x34')]);_0x230a1b[_0x5c4b('0x19')]=qs[_0x5c4b('0x19')](_0x542574[_0x5c4b('0x2f')][_0x5c4b('0x19')]);}return _0x52e88a[_0x5c4b('0x4b')](_0x230a1b);}})[_0x5c4b('0x21')](function(_0x134d32){if(_0x134d32){return _0x134d32?{'count':_0x4f03b5,'rows':_0x134d32}:null;}})['then'](respondWithResult(_0x44ca3a,null))['catch'](handleError(_0x44ca3a,null));};exports[_0x5c4b('0x4c')]=function(_0x5d8d05,_0x3f509c,_0x4140e8){var _0x21147e={};var _0x20ad1c={};var _0x5372c1;var _0x1fcde5;return db[_0x5c4b('0x26')]['findOne']({'where':{'id':_0x5d8d05[_0x5c4b('0x42')]['id']}})[_0x5c4b('0x21')](handleEntityNotFound(_0x3f509c,null))[_0x5c4b('0x21')](function(_0x8946f1){if(_0x8946f1){_0x5372c1=_0x8946f1;_0x20ad1c[_0x5c4b('0x2d')]=_['keys'](db[_0x5c4b('0x4d')][_0x5c4b('0x27')]);_0x20ad1c[_0x5c4b('0x2f')]=_[_0x5c4b('0x2a')](_0x5d8d05[_0x5c4b('0x2f')]);_0x20ad1c[_0x5c4b('0x2b')]=_[_0x5c4b('0x2c')](_0x20ad1c[_0x5c4b('0x2d')],_0x20ad1c[_0x5c4b('0x2f')]);_0x21147e[_0x5c4b('0x30')]=_[_0x5c4b('0x2c')](_0x20ad1c[_0x5c4b('0x2d')],qs[_0x5c4b('0x2e')](_0x5d8d05[_0x5c4b('0x2f')][_0x5c4b('0x2e')]));_0x21147e[_0x5c4b('0x30')]=_0x21147e[_0x5c4b('0x30')]['length']?_0x21147e['attributes']:_0x20ad1c[_0x5c4b('0x2d')];_0x21147e[_0x5c4b('0x35')]=qs['sort'](_0x5d8d05[_0x5c4b('0x2f')][_0x5c4b('0x36')]);_0x21147e[_0x5c4b('0x37')]=qs[_0x5c4b('0x2b')](_[_0x5c4b('0x38')](_0x5d8d05[_0x5c4b('0x2f')],_0x20ad1c[_0x5c4b('0x2b')]));if(_0x5d8d05[_0x5c4b('0x2f')][_0x5c4b('0x39')]){_0x21147e['where']=_[_0x5c4b('0x3a')](_0x21147e[_0x5c4b('0x37')],{'$or':_[_0x5c4b('0x25')](_0x21147e['attributes'],function(_0x2a37b4){var _0x59ad1d={};_0x59ad1d[_0x2a37b4]={'$like':'%'+_0x5d8d05[_0x5c4b('0x2f')][_0x5c4b('0x39')]+'%'};return _0x59ad1d;})});}_0x21147e=_['merge']({},_0x21147e,_0x5d8d05[_0x5c4b('0x3d')]);return _0x5372c1[_0x5c4b('0x4c')](_0x21147e);}})[_0x5c4b('0x21')](function(_0x41dfef){if(_0x41dfef){_0x1fcde5=_0x41dfef['length'];if(!_0x5d8d05[_0x5c4b('0x2f')]['hasOwnProperty']('nolimit')){_0x21147e[_0x5c4b('0x34')]=qs[_0x5c4b('0x34')](_0x5d8d05['query'][_0x5c4b('0x34')]);_0x21147e[_0x5c4b('0x19')]=qs[_0x5c4b('0x19')](_0x5d8d05['query'][_0x5c4b('0x19')]);}return _0x5372c1[_0x5c4b('0x4c')](_0x21147e);}})['then'](function(_0x1897cc){if(_0x1897cc){return _0x1897cc?{'count':_0x1fcde5,'rows':_0x1897cc}:null;}})[_0x5c4b('0x21')](respondWithResult(_0x3f509c,null))[_0x5c4b('0x44')](handleError(_0x3f509c,null));};exports[_0x5c4b('0x4e')]=function(_0x35ed1c,_0x8667f7,_0x4fbd6e){if(_0x35ed1c[_0x5c4b('0x46')]['id']){delete _0x35ed1c['body']['id'];}return db[_0x5c4b('0x26')][_0x5c4b('0x48')]({'where':{'id':_0x35ed1c[_0x5c4b('0x42')]['id']}})[_0x5c4b('0x21')](handleEntityNotFound(_0x8667f7,null))[_0x5c4b('0x21')](function(_0x43b190){if(_0x43b190){return _0x43b190[_0x5c4b('0x4e')](_0x35ed1c['body'][_0x5c4b('0x4f')]||[]);}return null;})['then'](respondWithResult(_0x8667f7,null))[_0x5c4b('0x44')](handleError(_0x8667f7,null));};
\ No newline at end of file
index 6b073af..4e31a15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd683=['api','bluebird','path','rimraf','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0xd683,0x1e9));var _0x3d68=function(_0x4c6728,_0x517455){_0x4c6728=_0x4c6728-0x0;var _0x741370=_0xd683[_0x4c6728];return _0x741370;};'use strict';var _=require(_0x3d68('0x0'));var util=require(_0x3d68('0x1'));var logger=require(_0x3d68('0x2'))(_0x3d68('0x3'));var moment=require('moment');var BPromise=require(_0x3d68('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d68('0x5'));var rimraf=require(_0x3d68('0x6'));var config=require('../../config/environment');var attributes=require(_0x3d68('0x7'));module[_0x3d68('0x8')]=function(_0x312fd1,_0x3057ba){return _0x312fd1[_0x3d68('0x9')](_0x3d68('0xa'),attributes,{'tableName':_0x3d68('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6f43=['bluebird','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api','moment'];(function(_0x1c570a,_0x5ccf03){var _0x285ad4=function(_0xe40cd6){while(--_0xe40cd6){_0x1c570a['push'](_0x1c570a['shift']());}};_0x285ad4(++_0x5ccf03);}(_0x6f43,0x137));var _0x36f4=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x6f43[_0x25e7cb];return _0x375d92;};'use strict';var _=require('lodash');var util=require(_0x36f4('0x0'));var logger=require(_0x36f4('0x1'))(_0x36f4('0x2'));var moment=require(_0x36f4('0x3'));var BPromise=require(_0x36f4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x36f4('0x5'));module['exports']=function(_0x14ac93,_0x19589c){return _0x14ac93[_0x36f4('0x6')](_0x36f4('0x7'),attributes,{'tableName':_0x36f4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 623f01d..79f744e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x317b=['../../config/environment','client','http','request','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshdeskConfiguration,\x20%s,\x20%s','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x538109,_0x14f9f8){var _0x25076c=function(_0x28ef0b){while(--_0x28ef0b){_0x538109['push'](_0x538109['shift']());}};_0x25076c(++_0x14f9f8);}(_0x317b,0x120));var _0xb317=function(_0x46d78f,_0x89d734){_0x46d78f=_0x46d78f-0x0;var _0x4e5775=_0x317b[_0x46d78f];return _0x4e5775;};'use strict';var _=require('lodash');var util=require(_0xb317('0x0'));var moment=require(_0xb317('0x1'));var BPromise=require(_0xb317('0x2'));var rs=require(_0xb317('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb317('0x4'))['db'];var utils=require(_0xb317('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb317('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb317('0x7')][_0xb317('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c811d,_0x462c9f,_0x2126bf){return new BPromise(function(_0x50abbc,_0x151697){return client[_0xb317('0x9')](_0x3c811d,_0x2126bf)[_0xb317('0xa')](function(_0x567136){logger[_0xb317('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x462c9f,_0xb317('0xc'));logger[_0xb317('0xd')](_0xb317('0xe'),_0x462c9f,_0xb317('0xc'),JSON[_0xb317('0xf')](_0x567136));if(_0x567136[_0xb317('0x10')]){if(_0x567136[_0xb317('0x10')][_0xb317('0x11')]===0x1f4){logger[_0xb317('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x462c9f,_0x567136[_0xb317('0x10')][_0xb317('0x12')]);return _0x151697(_0x567136[_0xb317('0x10')]['message']);}logger[_0xb317('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x462c9f,_0x567136[_0xb317('0x10')]['message']);return _0x50abbc(_0x567136[_0xb317('0x10')][_0xb317('0x12')]);}else{logger[_0xb317('0xb')](_0xb317('0x13'),_0x462c9f,'request\x20sent');_0x50abbc(_0x567136['result']['message']);}})[_0xb317('0x14')](function(_0x1e787a){logger['error'](_0xb317('0x13'),_0x462c9f,_0x1e787a);_0x151697(_0x1e787a);});});}
\ No newline at end of file
+var _0x7e2a=['client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','rpc','jayson/promise'];(function(_0x1f88f0,_0x2dc0ac){var _0x3684f5=function(_0x2f5efd){while(--_0x2f5efd){_0x1f88f0['push'](_0x1f88f0['shift']());}};_0x3684f5(++_0x2dc0ac);}(_0x7e2a,0x1ed));var _0xa7e2=function(_0x2be303,_0x1052ba){_0x2be303=_0x2be303-0x0;var _0xc7dd26=_0x7e2a[_0x2be303];return _0xc7dd26;};'use strict';var _=require(_0xa7e2('0x0'));var util=require(_0xa7e2('0x1'));var moment=require(_0xa7e2('0x2'));var BPromise=require(_0xa7e2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa7e2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa7e2('0x5'));var config=require('../../config/environment');var jayson=require(_0xa7e2('0x6'));var client=jayson[_0xa7e2('0x7')][_0xa7e2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x37afe9,_0x4bc8c2,_0x25416f){return new BPromise(function(_0x2f6244,_0x225e2c){return client[_0xa7e2('0x9')](_0x37afe9,_0x25416f)[_0xa7e2('0xa')](function(_0xa61fc4){logger[_0xa7e2('0xb')](_0xa7e2('0xc'),_0x4bc8c2,'request\x20sent');logger['debug'](_0xa7e2('0xd'),_0x4bc8c2,_0xa7e2('0xe'),JSON[_0xa7e2('0xf')](_0xa61fc4));if(_0xa61fc4[_0xa7e2('0x10')]){if(_0xa61fc4[_0xa7e2('0x10')][_0xa7e2('0x11')]===0x1f4){logger[_0xa7e2('0x10')](_0xa7e2('0xc'),_0x4bc8c2,_0xa61fc4[_0xa7e2('0x10')]['message']);return _0x225e2c(_0xa61fc4[_0xa7e2('0x10')][_0xa7e2('0x12')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x4bc8c2,_0xa61fc4[_0xa7e2('0x10')]['message']);return _0x2f6244(_0xa61fc4[_0xa7e2('0x10')][_0xa7e2('0x12')]);}else{logger[_0xa7e2('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x4bc8c2,_0xa7e2('0xe'));_0x2f6244(_0xa61fc4['result'][_0xa7e2('0x12')]);}})[_0xa7e2('0x13')](function(_0x54f89d){logger[_0xa7e2('0x10')](_0xa7e2('0xc'),_0x4bc8c2,_0x54f89d);_0x225e2c(_0x54f89d);});});}
\ No newline at end of file
index b557afa..3d9918f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe352=['../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0xe352,0x188));var _0x2e35=function(_0x5b92cb,_0x57a0cf){_0x5b92cb=_0x5b92cb-0x0;var _0x286882=_0xe352[_0x5b92cb];return _0x286882;};'use strict';var multer=require(_0x2e35('0x0'));var util=require('util');var path=require(_0x2e35('0x1'));var timeout=require(_0x2e35('0x2'));var express=require(_0x2e35('0x3'));var router=express[_0x2e35('0x4')]();var fs_extra=require(_0x2e35('0x5'));var auth=require(_0x2e35('0x6'));var interaction=require(_0x2e35('0x7'));var config=require(_0x2e35('0x8'));var controller=require(_0x2e35('0x9'));router[_0x2e35('0xa')]('/',auth[_0x2e35('0xb')](),controller[_0x2e35('0xc')]);router[_0x2e35('0xa')](_0x2e35('0xd'),auth[_0x2e35('0xb')](),controller['show']);router[_0x2e35('0xe')]('/',auth[_0x2e35('0xb')](),controller[_0x2e35('0xf')]);router[_0x2e35('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x2e35('0x11')]);router[_0x2e35('0x12')](_0x2e35('0xd'),auth['isAuthenticated'](),controller[_0x2e35('0x13')]);module[_0x2e35('0x14')]=router;
\ No newline at end of file
+var _0x9c90=['../../config/environment','./intFreshdeskField.controller','isAuthenticated','get','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5a545d,_0x3730aa){var _0x3814eb=function(_0x1ba9e9){while(--_0x1ba9e9){_0x5a545d['push'](_0x5a545d['shift']());}};_0x3814eb(++_0x3730aa);}(_0x9c90,0x14f));var _0x09c9=function(_0x406e46,_0x5799cb){_0x406e46=_0x406e46-0x0;var _0x4a3742=_0x9c90[_0x406e46];return _0x4a3742;};'use strict';var multer=require(_0x09c9('0x0'));var util=require(_0x09c9('0x1'));var path=require(_0x09c9('0x2'));var timeout=require('connect-timeout');var express=require(_0x09c9('0x3'));var router=express[_0x09c9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x09c9('0x5'));var interaction=require(_0x09c9('0x6'));var config=require(_0x09c9('0x7'));var controller=require(_0x09c9('0x8'));router['get']('/',auth[_0x09c9('0x9')](),controller['index']);router[_0x09c9('0xa')](_0x09c9('0xb'),auth[_0x09c9('0x9')](),controller['show']);router[_0x09c9('0xc')]('/',auth['isAuthenticated'](),controller[_0x09c9('0xd')]);router[_0x09c9('0xe')](_0x09c9('0xb'),auth['isAuthenticated'](),controller[_0x09c9('0xf')]);router[_0x09c9('0x10')](_0x09c9('0xb'),auth['isAuthenticated'](),controller[_0x09c9('0x11')]);module[_0x09c9('0x12')]=router;
\ No newline at end of file
index bcfb234..481a3be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85c9=['sequelize','exports','ENUM','variable','customVariable','picklist','string','STRING'];(function(_0x13131f,_0x190d1e){var _0x337cc0=function(_0x5d75cf){while(--_0x5d75cf){_0x13131f['push'](_0x13131f['shift']());}};_0x337cc0(++_0x190d1e);}(_0x85c9,0xd8));var _0x985c=function(_0x21de89,_0x367053){_0x21de89=_0x21de89-0x0;var _0x290b7e=_0x85c9[_0x21de89];return _0x290b7e;};'use strict';var Sequelize=require(_0x985c('0x0'));module[_0x985c('0x1')]={'type':{'type':Sequelize[_0x985c('0x2')]('string',_0x985c('0x3'),_0x985c('0x4'),'keyValue',_0x985c('0x5')),'defaultValue':_0x985c('0x6')},'content':{'type':Sequelize[_0x985c('0x7')]},'key':{'type':Sequelize[_0x985c('0x7')]},'keyType':{'type':Sequelize[_0x985c('0x2')](_0x985c('0x6'),_0x985c('0x3'),_0x985c('0x4'))},'keyContent':{'type':Sequelize[_0x985c('0x7')]},'idField':{'type':Sequelize[_0x985c('0x7')]},'nameField':{'type':Sequelize[_0x985c('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x985c('0x7')]}};
\ No newline at end of file
+var _0xc53f=['picklist','STRING','ENUM','string','variable','customVariable','keyValue'];(function(_0x12eff8,_0x3ee27a){var _0x257ba4=function(_0x4f0880){while(--_0x4f0880){_0x12eff8['push'](_0x12eff8['shift']());}};_0x257ba4(++_0x3ee27a);}(_0xc53f,0xc7));var _0xfc53=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xc53f[_0x24237f];return _0x48298e;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0xfc53('0x0'),_0xfc53('0x1'),_0xfc53('0x2'),_0xfc53('0x3'),_0xfc53('0x4')),'defaultValue':_0xfc53('0x0')},'content':{'type':Sequelize[_0xfc53('0x5')]},'key':{'type':Sequelize[_0xfc53('0x5')]},'keyType':{'type':Sequelize[_0xfc53('0x6')](_0xfc53('0x0'),_0xfc53('0x1'),_0xfc53('0x2'))},'keyContent':{'type':Sequelize[_0xfc53('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xfc53('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfc53('0x5')]}};
\ No newline at end of file
index 3568af2..2992310 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49e9=['status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','index','FreshdeskField','rawAttributes','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','params','include','options','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x49e9,0x10f));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x949e('0x0'));var rimraf=require(_0x949e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x949e('0x2'));var rp=require(_0x949e('0x3'));var moment=require(_0x949e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x949e('0x5'));var path=require('path');var sox=require(_0x949e('0x6'));var csv=require(_0x949e('0x7'));var ejs=require(_0x949e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x949e('0x9'));var squel=require(_0x949e('0xa'));var crypto=require(_0x949e('0xb'));var jsforce=require(_0x949e('0xc'));var deskjs=require(_0x949e('0xd'));var toCsv=require(_0x949e('0x7'));var querystring=require(_0x949e('0xe'));var Papa=require('papaparse');var Redis=require(_0x949e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x949e('0x10'));var as=require(_0x949e('0x11'));var hardwareService=require(_0x949e('0x12'));var logger=require('../../config/logger')(_0x949e('0x13'));var utils=require(_0x949e('0x14'));var config=require(_0x949e('0x15'));var licenseUtil=require(_0x949e('0x16'));var db=require(_0x949e('0x17'))['db'];function respondWithStatusCode(_0x253d5e,_0x1871a5){_0x1871a5=_0x1871a5||0xcc;return function(_0x17d1f3){if(_0x17d1f3){return _0x253d5e[_0x949e('0x18')](_0x1871a5);}return _0x253d5e[_0x949e('0x19')](_0x1871a5)[_0x949e('0x1a')]();};}function respondWithResult(_0x7a8954,_0x3e0e54){_0x3e0e54=_0x3e0e54||0xc8;return function(_0x7f8be2){if(_0x7f8be2){return _0x7a8954[_0x949e('0x19')](_0x3e0e54)['json'](_0x7f8be2);}};}function respondWithFilteredResult(_0x257981,_0x3d81cd){return function(_0x587bff){if(_0x587bff){var _0xf1f41a=typeof _0x3d81cd['offset']===_0x949e('0x1b')&&typeof _0x3d81cd[_0x949e('0x1c')]==='undefined';var _0x37fd96=_0x587bff[_0x949e('0x1d')];var _0x43498d=_0xf1f41a?0x0:_0x3d81cd[_0x949e('0x1e')];var _0x20333c=_0xf1f41a?_0x587bff['count']:_0x3d81cd[_0x949e('0x1e')]+_0x3d81cd[_0x949e('0x1c')];var _0x476fa8;if(_0x20333c>=_0x37fd96){_0x20333c=_0x37fd96;_0x476fa8=0xc8;}else{_0x476fa8=0xce;}_0x257981[_0x949e('0x19')](_0x476fa8);return _0x257981[_0x949e('0x1f')](_0x949e('0x20'),_0x43498d+'-'+_0x20333c+'/'+_0x37fd96)[_0x949e('0x21')](_0x587bff);}return null;};}function patchUpdates(_0x2f21bd){return function(_0x104740){try{jsonpatch[_0x949e('0x22')](_0x104740,_0x2f21bd,!![]);}catch(_0x23fc20){return BPromise[_0x949e('0x23')](_0x23fc20);}return _0x104740[_0x949e('0x24')]();};}function saveUpdates(_0x1927ab,_0x199d53){return function(_0x2e81f2){if(_0x2e81f2){return _0x2e81f2['update'](_0x1927ab)[_0x949e('0x25')](function(_0x44ffb4){return _0x44ffb4;});}return null;};}function removeEntity(_0x5572ae,_0x48a1d1){return function(_0x23b38e){if(_0x23b38e){return _0x23b38e[_0x949e('0x26')]()[_0x949e('0x25')](function(){_0x5572ae[_0x949e('0x19')](0xcc)[_0x949e('0x1a')]();});}};}function handleEntityNotFound(_0x1185b3,_0x29e07b){return function(_0x255b11){if(!_0x255b11){_0x1185b3[_0x949e('0x18')](0x194);}return _0x255b11;};}function handleError(_0x20258c,_0x5dcc46){_0x5dcc46=_0x5dcc46||0x1f4;return function(_0x212224){logger[_0x949e('0x27')](_0x212224['stack']);if(_0x212224[_0x949e('0x28')]){delete _0x212224[_0x949e('0x28')];}_0x20258c['status'](_0x5dcc46)[_0x949e('0x29')](_0x212224);};}exports[_0x949e('0x2a')]=function(_0x5b9f28,_0x1867d9){var _0x5b2b0b={},_0x5e6e34={},_0x4e169d={'count':0x0,'rows':[]};var _0x54ad5d=_['map'](db[_0x949e('0x2b')][_0x949e('0x2c')],function(_0x3051ec){return{'name':_0x3051ec['fieldName'],'type':_0x3051ec['type']['key']};});_0x5e6e34['model']=_[_0x949e('0x2d')](_0x54ad5d,_0x949e('0x28'));_0x5e6e34[_0x949e('0x2e')]=_[_0x949e('0x2f')](_0x5b9f28['query']);_0x5e6e34[_0x949e('0x30')]=_[_0x949e('0x31')](_0x5e6e34[_0x949e('0x32')],_0x5e6e34['query']);_0x5b2b0b[_0x949e('0x33')]=_[_0x949e('0x31')](_0x5e6e34[_0x949e('0x32')],qs['fields'](_0x5b9f28['query'][_0x949e('0x34')]));_0x5b2b0b[_0x949e('0x33')]=_0x5b2b0b[_0x949e('0x33')][_0x949e('0x35')]?_0x5b2b0b['attributes']:_0x5e6e34[_0x949e('0x32')];if(!_0x5b9f28[_0x949e('0x2e')][_0x949e('0x36')](_0x949e('0x37'))){_0x5b2b0b[_0x949e('0x1c')]=qs[_0x949e('0x1c')](_0x5b9f28[_0x949e('0x2e')][_0x949e('0x1c')]);_0x5b2b0b['offset']=qs['offset'](_0x5b9f28[_0x949e('0x2e')]['offset']);}_0x5b2b0b['order']=qs[_0x949e('0x38')](_0x5b9f28[_0x949e('0x2e')][_0x949e('0x38')]);_0x5b2b0b[_0x949e('0x39')]=qs[_0x949e('0x30')](_[_0x949e('0x3a')](_0x5b9f28[_0x949e('0x2e')],_0x5e6e34[_0x949e('0x30')]),_0x54ad5d);if(_0x5b9f28[_0x949e('0x2e')][_0x949e('0x3b')]){_0x5b2b0b[_0x949e('0x39')]=_[_0x949e('0x3c')](_0x5b2b0b[_0x949e('0x39')],{'$or':_[_0x949e('0x2d')](_0x54ad5d,function(_0x26ad2b){if(_0x26ad2b[_0x949e('0x3d')]!==_0x949e('0x3e')){var _0x498fa3={};_0x498fa3[_0x26ad2b[_0x949e('0x28')]]={'$like':'%'+_0x5b9f28['query'][_0x949e('0x3b')]+'%'};return _0x498fa3;}})});}_0x5b2b0b=_[_0x949e('0x3c')]({},_0x5b2b0b,_0x5b9f28['options']);var _0x5084dc={'where':_0x5b2b0b['where']};return db[_0x949e('0x2b')][_0x949e('0x1d')](_0x5084dc)['then'](function(_0x59c024){_0x4e169d['count']=_0x59c024;if(_0x5b9f28[_0x949e('0x2e')][_0x949e('0x3f')]){_0x5b2b0b['include']=[{'all':!![]}];}return db[_0x949e('0x2b')][_0x949e('0x40')](_0x5b2b0b);})['then'](function(_0x3a1bc7){_0x4e169d[_0x949e('0x41')]=_0x3a1bc7;return _0x4e169d;})[_0x949e('0x25')](respondWithFilteredResult(_0x1867d9,_0x5b2b0b))[_0x949e('0x42')](handleError(_0x1867d9,null));};exports['show']=function(_0x58b34b,_0x2bca69){var _0x590aa7={'raw':!![],'where':{'id':_0x58b34b[_0x949e('0x43')]['id']}},_0x7201da={};_0x7201da[_0x949e('0x32')]=_[_0x949e('0x2f')](db[_0x949e('0x2b')]['rawAttributes']);_0x7201da['query']=_[_0x949e('0x2f')](_0x58b34b['query']);_0x7201da[_0x949e('0x30')]=_[_0x949e('0x31')](_0x7201da[_0x949e('0x32')],_0x7201da[_0x949e('0x2e')]);_0x590aa7[_0x949e('0x33')]=_[_0x949e('0x31')](_0x7201da['model'],qs['fields'](_0x58b34b[_0x949e('0x2e')][_0x949e('0x34')]));_0x590aa7[_0x949e('0x33')]=_0x590aa7[_0x949e('0x33')][_0x949e('0x35')]?_0x590aa7['attributes']:_0x7201da[_0x949e('0x32')];if(_0x58b34b[_0x949e('0x2e')]['includeAll']){_0x590aa7[_0x949e('0x44')]=[{'all':!![]}];}_0x590aa7=_[_0x949e('0x3c')]({},_0x590aa7,_0x58b34b[_0x949e('0x45')]);return db[_0x949e('0x2b')][_0x949e('0x46')](_0x590aa7)[_0x949e('0x25')](handleEntityNotFound(_0x2bca69,null))[_0x949e('0x25')](respondWithResult(_0x2bca69,null))[_0x949e('0x42')](handleError(_0x2bca69,null));};exports[_0x949e('0x47')]=function(_0x4913f5,_0x1599ea){return db['FreshdeskField'][_0x949e('0x47')](_0x4913f5[_0x949e('0x48')],{})['then'](respondWithResult(_0x1599ea,0xc9))[_0x949e('0x42')](handleError(_0x1599ea,null));};exports[_0x949e('0x49')]=function(_0x121355,_0x2e2b6a){if(_0x121355[_0x949e('0x48')]['id']){delete _0x121355[_0x949e('0x48')]['id'];}return db[_0x949e('0x2b')][_0x949e('0x46')]({'where':{'id':_0x121355['params']['id']}})[_0x949e('0x25')](handleEntityNotFound(_0x2e2b6a,null))[_0x949e('0x25')](saveUpdates(_0x121355[_0x949e('0x48')],null))[_0x949e('0x25')](respondWithResult(_0x2e2b6a,null))[_0x949e('0x42')](handleError(_0x2e2b6a,null));};exports['destroy']=function(_0x5f23b2,_0x46a4fe){return db[_0x949e('0x2b')]['find']({'where':{'id':_0x5f23b2[_0x949e('0x43')]['id']}})[_0x949e('0x25')](handleEntityNotFound(_0x46a4fe,null))[_0x949e('0x25')](removeEntity(_0x46a4fe,null))[_0x949e('0x42')](handleError(_0x46a4fe,null));};
\ No newline at end of file
+var _0x74f0=['key','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','catch','show','find','create','body','params','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','FreshdeskField','fieldName','type'];(function(_0x5911e4,_0x218c80){var _0x166e7f=function(_0x223e92){while(--_0x223e92){_0x5911e4['push'](_0x5911e4['shift']());}};_0x166e7f(++_0x218c80);}(_0x74f0,0xf3));var _0x074f=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0x74f0[_0x5806c3];return _0x48ac77;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x074f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x074f('0x1'));var moment=require(_0x074f('0x2'));var BPromise=require(_0x074f('0x3'));var Mustache=require(_0x074f('0x4'));var util=require('util');var path=require('path');var sox=require(_0x074f('0x5'));var csv=require(_0x074f('0x6'));var ejs=require(_0x074f('0x7'));var fs=require('fs');var fs_extra=require(_0x074f('0x8'));var _=require(_0x074f('0x9'));var squel=require(_0x074f('0xa'));var crypto=require(_0x074f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x074f('0xc'));var toCsv=require(_0x074f('0x6'));var querystring=require('querystring');var Papa=require(_0x074f('0xd'));var Redis=require(_0x074f('0xe'));var authService=require(_0x074f('0xf'));var qs=require(_0x074f('0x10'));var as=require(_0x074f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x074f('0x12'));var utils=require(_0x074f('0x13'));var config=require(_0x074f('0x14'));var licenseUtil=require(_0x074f('0x15'));var db=require(_0x074f('0x16'))['db'];function respondWithStatusCode(_0x2416e0,_0x1d3304){_0x1d3304=_0x1d3304||0xcc;return function(_0x46cea0){if(_0x46cea0){return _0x2416e0[_0x074f('0x17')](_0x1d3304);}return _0x2416e0['status'](_0x1d3304)[_0x074f('0x18')]();};}function respondWithResult(_0x59f78a,_0x12ed92){_0x12ed92=_0x12ed92||0xc8;return function(_0x3bf07f){if(_0x3bf07f){return _0x59f78a[_0x074f('0x19')](_0x12ed92)[_0x074f('0x1a')](_0x3bf07f);}};}function respondWithFilteredResult(_0x2d7c55,_0x237960){return function(_0x7e19fe){if(_0x7e19fe){var _0x1edf9c=typeof _0x237960[_0x074f('0x1b')]===_0x074f('0x1c')&&typeof _0x237960[_0x074f('0x1d')]==='undefined';var _0x111e1f=_0x7e19fe[_0x074f('0x1e')];var _0x200e43=_0x1edf9c?0x0:_0x237960[_0x074f('0x1b')];var _0x315e7d=_0x1edf9c?_0x7e19fe[_0x074f('0x1e')]:_0x237960['offset']+_0x237960['limit'];var _0x1d241d;if(_0x315e7d>=_0x111e1f){_0x315e7d=_0x111e1f;_0x1d241d=0xc8;}else{_0x1d241d=0xce;}_0x2d7c55['status'](_0x1d241d);return _0x2d7c55['set'](_0x074f('0x1f'),_0x200e43+'-'+_0x315e7d+'/'+_0x111e1f)[_0x074f('0x1a')](_0x7e19fe);}return null;};}function patchUpdates(_0x1563f3){return function(_0x5feafd){try{jsonpatch[_0x074f('0x20')](_0x5feafd,_0x1563f3,!![]);}catch(_0x210221){return BPromise[_0x074f('0x21')](_0x210221);}return _0x5feafd[_0x074f('0x22')]();};}function saveUpdates(_0x1acf0a,_0x2c3b23){return function(_0x335170){if(_0x335170){return _0x335170[_0x074f('0x23')](_0x1acf0a)[_0x074f('0x24')](function(_0x2fc5b0){return _0x2fc5b0;});}return null;};}function removeEntity(_0x39e502,_0x1bd2c7){return function(_0xdfa2d8){if(_0xdfa2d8){return _0xdfa2d8[_0x074f('0x25')]()[_0x074f('0x24')](function(){_0x39e502[_0x074f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ee6ac,_0x4e35a3){return function(_0x1051ce){if(!_0x1051ce){_0x4ee6ac[_0x074f('0x17')](0x194);}return _0x1051ce;};}function handleError(_0x151977,_0x3eb67d){_0x3eb67d=_0x3eb67d||0x1f4;return function(_0x5aabea){logger[_0x074f('0x26')](_0x5aabea[_0x074f('0x27')]);if(_0x5aabea[_0x074f('0x28')]){delete _0x5aabea[_0x074f('0x28')];}_0x151977[_0x074f('0x19')](_0x3eb67d)[_0x074f('0x29')](_0x5aabea);};}exports['index']=function(_0x1bf574,_0x3246cf){var _0x2b98d7={},_0x53b76d={},_0x1ee652={'count':0x0,'rows':[]};var _0x5d6edd=_['map'](db[_0x074f('0x2a')]['rawAttributes'],function(_0x4aa96f){return{'name':_0x4aa96f[_0x074f('0x2b')],'type':_0x4aa96f[_0x074f('0x2c')][_0x074f('0x2d')]};});_0x53b76d['model']=_[_0x074f('0x2e')](_0x5d6edd,_0x074f('0x28'));_0x53b76d[_0x074f('0x2f')]=_['keys'](_0x1bf574[_0x074f('0x2f')]);_0x53b76d[_0x074f('0x30')]=_[_0x074f('0x31')](_0x53b76d[_0x074f('0x32')],_0x53b76d[_0x074f('0x2f')]);_0x2b98d7['attributes']=_[_0x074f('0x31')](_0x53b76d[_0x074f('0x32')],qs['fields'](_0x1bf574[_0x074f('0x2f')][_0x074f('0x33')]));_0x2b98d7[_0x074f('0x34')]=_0x2b98d7['attributes'][_0x074f('0x35')]?_0x2b98d7[_0x074f('0x34')]:_0x53b76d['model'];if(!_0x1bf574[_0x074f('0x2f')][_0x074f('0x36')](_0x074f('0x37'))){_0x2b98d7[_0x074f('0x1d')]=qs[_0x074f('0x1d')](_0x1bf574[_0x074f('0x2f')][_0x074f('0x1d')]);_0x2b98d7[_0x074f('0x1b')]=qs[_0x074f('0x1b')](_0x1bf574[_0x074f('0x2f')]['offset']);}_0x2b98d7[_0x074f('0x38')]=qs[_0x074f('0x39')](_0x1bf574['query'][_0x074f('0x39')]);_0x2b98d7[_0x074f('0x3a')]=qs[_0x074f('0x30')](_[_0x074f('0x3b')](_0x1bf574[_0x074f('0x2f')],_0x53b76d[_0x074f('0x30')]),_0x5d6edd);if(_0x1bf574[_0x074f('0x2f')]['filter']){_0x2b98d7[_0x074f('0x3a')]=_[_0x074f('0x3c')](_0x2b98d7[_0x074f('0x3a')],{'$or':_[_0x074f('0x2e')](_0x5d6edd,function(_0x363ec0){if(_0x363ec0[_0x074f('0x2c')]!=='VIRTUAL'){var _0x405f4c={};_0x405f4c[_0x363ec0[_0x074f('0x28')]]={'$like':'%'+_0x1bf574['query'][_0x074f('0x3d')]+'%'};return _0x405f4c;}})});}_0x2b98d7=_[_0x074f('0x3c')]({},_0x2b98d7,_0x1bf574[_0x074f('0x3e')]);var _0x4d386e={'where':_0x2b98d7['where']};return db['FreshdeskField'][_0x074f('0x1e')](_0x4d386e)[_0x074f('0x24')](function(_0xdd9c2e){_0x1ee652['count']=_0xdd9c2e;if(_0x1bf574[_0x074f('0x2f')][_0x074f('0x3f')]){_0x2b98d7['include']=[{'all':!![]}];}return db[_0x074f('0x2a')][_0x074f('0x40')](_0x2b98d7);})[_0x074f('0x24')](function(_0x46ca91){_0x1ee652[_0x074f('0x41')]=_0x46ca91;return _0x1ee652;})[_0x074f('0x24')](respondWithFilteredResult(_0x3246cf,_0x2b98d7))[_0x074f('0x42')](handleError(_0x3246cf,null));};exports[_0x074f('0x43')]=function(_0x4b7f50,_0x406d33){var _0x58ff4d={'raw':!![],'where':{'id':_0x4b7f50['params']['id']}},_0x1bee97={};_0x1bee97[_0x074f('0x32')]=_['keys'](db[_0x074f('0x2a')]['rawAttributes']);_0x1bee97[_0x074f('0x2f')]=_['keys'](_0x4b7f50[_0x074f('0x2f')]);_0x1bee97[_0x074f('0x30')]=_[_0x074f('0x31')](_0x1bee97[_0x074f('0x32')],_0x1bee97[_0x074f('0x2f')]);_0x58ff4d[_0x074f('0x34')]=_[_0x074f('0x31')](_0x1bee97['model'],qs[_0x074f('0x33')](_0x4b7f50[_0x074f('0x2f')][_0x074f('0x33')]));_0x58ff4d[_0x074f('0x34')]=_0x58ff4d['attributes'][_0x074f('0x35')]?_0x58ff4d['attributes']:_0x1bee97[_0x074f('0x32')];if(_0x4b7f50[_0x074f('0x2f')][_0x074f('0x3f')]){_0x58ff4d['include']=[{'all':!![]}];}_0x58ff4d=_[_0x074f('0x3c')]({},_0x58ff4d,_0x4b7f50['options']);return db[_0x074f('0x2a')][_0x074f('0x44')](_0x58ff4d)['then'](handleEntityNotFound(_0x406d33,null))[_0x074f('0x24')](respondWithResult(_0x406d33,null))['catch'](handleError(_0x406d33,null));};exports[_0x074f('0x45')]=function(_0x130448,_0x598fee){return db['FreshdeskField']['create'](_0x130448['body'],{})[_0x074f('0x24')](respondWithResult(_0x598fee,0xc9))[_0x074f('0x42')](handleError(_0x598fee,null));};exports[_0x074f('0x23')]=function(_0xdd3709,_0x53b1e5){if(_0xdd3709[_0x074f('0x46')]['id']){delete _0xdd3709[_0x074f('0x46')]['id'];}return db[_0x074f('0x2a')][_0x074f('0x44')]({'where':{'id':_0xdd3709[_0x074f('0x47')]['id']}})[_0x074f('0x24')](handleEntityNotFound(_0x53b1e5,null))[_0x074f('0x24')](saveUpdates(_0xdd3709[_0x074f('0x46')],null))['then'](respondWithResult(_0x53b1e5,null))[_0x074f('0x42')](handleError(_0x53b1e5,null));};exports[_0x074f('0x25')]=function(_0x2ff3ab,_0x306a17){return db['FreshdeskField'][_0x074f('0x44')]({'where':{'id':_0x2ff3ab[_0x074f('0x47')]['id']}})['then'](handleEntityNotFound(_0x306a17,null))['then'](removeEntity(_0x306a17,null))[_0x074f('0x42')](handleError(_0x306a17,null));};
\ No newline at end of file
index 8696cc2..7cb2ae2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3351=['FieldId','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x3351,0x1b4));var _0x1335=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x3351[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0x1335('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1335('0x1'));var moment=require(_0x1335('0x2'));var BPromise=require(_0x1335('0x3'));var rp=require(_0x1335('0x4'));var fs=require('fs');var path=require(_0x1335('0x5'));var rimraf=require(_0x1335('0x6'));var config=require(_0x1335('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0x1335('0x8')]=function(_0x1b951c,_0x2ee73b){return _0x1b951c[_0x1335('0x9')](_0x1335('0xa'),attributes,{'tableName':_0x1335('0xb'),'paranoid':![],'indexes':[{'name':_0x1335('0xc'),'fields':[_0x1335('0xd'),_0x1335('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1e3e=['api','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','FieldId','util','../../config/logger'];(function(_0x12a478,_0x39bfcb){var _0x1f0fdf=function(_0x4b2380){while(--_0x4b2380){_0x12a478['push'](_0x12a478['shift']());}};_0x1f0fdf(++_0x39bfcb);}(_0x1e3e,0xfa));var _0xe1e3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1e3e[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xe1e3('0x0'));var logger=require(_0xe1e3('0x1'))(_0xe1e3('0x2'));var moment=require(_0xe1e3('0x3'));var BPromise=require(_0xe1e3('0x4'));var rp=require(_0xe1e3('0x5'));var fs=require('fs');var path=require(_0xe1e3('0x6'));var rimraf=require('rimraf');var config=require(_0xe1e3('0x7'));var attributes=require(_0xe1e3('0x8'));module[_0xe1e3('0x9')]=function(_0x21f80e,_0x18f17f){return _0x21f80e['define'](_0xe1e3('0xa'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0xe1e3('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index a6ab259..84b6dbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb800=['error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','request','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0xb800,0x17f));var _0x0b80=function(_0x18222c,_0x15909e){_0x18222c=_0x18222c-0x0;var _0x3c908f=_0xb800[_0x18222c];return _0x3c908f;};'use strict';var _=require(_0x0b80('0x0'));var util=require(_0x0b80('0x1'));var moment=require('moment');var BPromise=require(_0x0b80('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0b80('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0b80('0x4'));var config=require(_0x0b80('0x5'));var jayson=require(_0x0b80('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x308ac1,_0x5c3318,_0x500fe9){return new BPromise(function(_0x10ae69,_0x540328){return client[_0x0b80('0x7')](_0x308ac1,_0x500fe9)['then'](function(_0x159eb1){logger[_0x0b80('0x8')](_0x0b80('0x9'),_0x5c3318,_0x0b80('0xa'));logger[_0x0b80('0xb')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x5c3318,'request\x20sent',JSON[_0x0b80('0xc')](_0x159eb1));if(_0x159eb1[_0x0b80('0xd')]){if(_0x159eb1[_0x0b80('0xd')][_0x0b80('0xe')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x5c3318,_0x159eb1['error'][_0x0b80('0xf')]);return _0x540328(_0x159eb1['error']['message']);}logger[_0x0b80('0xd')](_0x0b80('0x9'),_0x5c3318,_0x159eb1[_0x0b80('0xd')]['message']);return _0x10ae69(_0x159eb1['error'][_0x0b80('0xf')]);}else{logger[_0x0b80('0x8')](_0x0b80('0x9'),_0x5c3318,_0x0b80('0xa'));_0x10ae69(_0x159eb1[_0x0b80('0x10')]['message']);}})[_0x0b80('0x11')](function(_0x4daa7f){logger[_0x0b80('0xd')](_0x0b80('0x9'),_0x5c3318,_0x4daa7f);_0x540328(_0x4daa7f);});});}
\ No newline at end of file
+var _0x19ff=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code','FreshdeskField,\x20%s,\x20%s','message','catch'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0x19ff,0xf0));var _0xf19f=function(_0x3a5214,_0x58ad55){_0x3a5214=_0x3a5214-0x0;var _0x5bd563=_0x19ff[_0x3a5214];return _0x5bd563;};'use strict';var _=require(_0xf19f('0x0'));var util=require(_0xf19f('0x1'));var moment=require(_0xf19f('0x2'));var BPromise=require(_0xf19f('0x3'));var rs=require(_0xf19f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf19f('0x5'))['db'];var utils=require(_0xf19f('0x6'));var logger=require(_0xf19f('0x7'))(_0xf19f('0x8'));var config=require('../../config/environment');var jayson=require(_0xf19f('0x9'));var client=jayson[_0xf19f('0xa')][_0xf19f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19d6db,_0x4afee0,_0x4d6d9d){return new BPromise(function(_0x3b19d5,_0x444799){return client['request'](_0x19d6db,_0x4d6d9d)['then'](function(_0x5bbcbb){logger[_0xf19f('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x4afee0,_0xf19f('0xd'));logger['debug'](_0xf19f('0xe'),_0x4afee0,_0xf19f('0xd'),JSON['stringify'](_0x5bbcbb));if(_0x5bbcbb['error']){if(_0x5bbcbb[_0xf19f('0xf')][_0xf19f('0x10')]===0x1f4){logger[_0xf19f('0xf')](_0xf19f('0x11'),_0x4afee0,_0x5bbcbb[_0xf19f('0xf')][_0xf19f('0x12')]);return _0x444799(_0x5bbcbb[_0xf19f('0xf')][_0xf19f('0x12')]);}logger[_0xf19f('0xf')](_0xf19f('0x11'),_0x4afee0,_0x5bbcbb[_0xf19f('0xf')][_0xf19f('0x12')]);return _0x3b19d5(_0x5bbcbb[_0xf19f('0xf')]['message']);}else{logger[_0xf19f('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x4afee0,_0xf19f('0xd'));_0x3b19d5(_0x5bbcbb['result']['message']);}})[_0xf19f('0x13')](function(_0x3bf02c){logger[_0xf19f('0xf')](_0xf19f('0x11'),_0x4afee0,_0x3bf02c);_0x444799(_0x3bf02c);});});}
\ No newline at end of file
index 2978d99..0b60ad0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb74=['getFields','post','/:id/configurations','addConfiguration','put','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','show','getConfigurations','/:id/fields'];(function(_0x4da6f4,_0x2d7ce9){var _0x29d770=function(_0x4eed94){while(--_0x4eed94){_0x4da6f4['push'](_0x4da6f4['shift']());}};_0x29d770(++_0x2d7ce9);}(_0xeb74,0xe3));var _0x4eb7=function(_0x1f74e9,_0x3058cf){_0x1f74e9=_0x1f74e9-0x0;var _0x3733de=_0xeb74[_0x1f74e9];return _0x3733de;};'use strict';var multer=require(_0x4eb7('0x0'));var util=require(_0x4eb7('0x1'));var path=require(_0x4eb7('0x2'));var timeout=require(_0x4eb7('0x3'));var express=require(_0x4eb7('0x4'));var router=express[_0x4eb7('0x5')]();var fs_extra=require(_0x4eb7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4eb7('0x7'));var config=require(_0x4eb7('0x8'));var controller=require(_0x4eb7('0x9'));router[_0x4eb7('0xa')]('/',auth[_0x4eb7('0xb')](),controller['index']);router[_0x4eb7('0xa')]('/:id',auth[_0x4eb7('0xb')](),controller[_0x4eb7('0xc')]);router['get']('/:id/configurations',auth[_0x4eb7('0xb')](),controller[_0x4eb7('0xd')]);router['get'](_0x4eb7('0xe'),auth['isAuthenticated'](),controller[_0x4eb7('0xf')]);router[_0x4eb7('0x10')]('/',auth[_0x4eb7('0xb')](),controller['create']);router[_0x4eb7('0x10')](_0x4eb7('0x11'),auth[_0x4eb7('0xb')](),controller[_0x4eb7('0x12')]);router[_0x4eb7('0x13')](_0x4eb7('0x14'),auth[_0x4eb7('0xb')](),controller['update']);router['delete']('/:id',auth[_0x4eb7('0xb')](),controller['destroy']);module[_0x4eb7('0x15')]=router;
\ No newline at end of file
+var _0x63a5=['destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete'];(function(_0x1a86c6,_0x167212){var _0x16abc6=function(_0x36ee72){while(--_0x36ee72){_0x1a86c6['push'](_0x1a86c6['shift']());}};_0x16abc6(++_0x167212);}(_0x63a5,0x18e));var _0x563a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x63a5[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x563a('0x0'));var util=require(_0x563a('0x1'));var path=require(_0x563a('0x2'));var timeout=require('connect-timeout');var express=require(_0x563a('0x3'));var router=express['Router']();var fs_extra=require(_0x563a('0x4'));var auth=require(_0x563a('0x5'));var interaction=require(_0x563a('0x6'));var config=require(_0x563a('0x7'));var controller=require('./intFreshsalesAccount.controller');router['get']('/',auth[_0x563a('0x8')](),controller['index']);router[_0x563a('0x9')](_0x563a('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x563a('0x9')](_0x563a('0xb'),auth[_0x563a('0x8')](),controller[_0x563a('0xc')]);router[_0x563a('0x9')](_0x563a('0xd'),auth[_0x563a('0x8')](),controller[_0x563a('0xe')]);router[_0x563a('0xf')]('/',auth[_0x563a('0x8')](),controller[_0x563a('0x10')]);router[_0x563a('0xf')](_0x563a('0xb'),auth[_0x563a('0x8')](),controller['addConfiguration']);router[_0x563a('0x11')](_0x563a('0xa'),auth[_0x563a('0x8')](),controller[_0x563a('0x12')]);router[_0x563a('0x13')](_0x563a('0xa'),auth['isAuthenticated'](),controller[_0x563a('0x14')]);module[_0x563a('0x15')]=router;
\ No newline at end of file
index d743cdf..50dea81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77d4=['exports','STRING','username'];(function(_0x533990,_0x21fe8d){var _0x5a5e2a=function(_0x2539c3){while(--_0x2539c3){_0x533990['push'](_0x533990['shift']());}};_0x5a5e2a(++_0x21fe8d);}(_0x77d4,0x108));var _0x477d=function(_0x122dd3,_0x16470d){_0x122dd3=_0x122dd3-0x0;var _0x4fe86c=_0x77d4[_0x122dd3];return _0x4fe86c;};'use strict';var Sequelize=require('sequelize');module[_0x477d('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x477d('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x477d('0x2')},'apiKey':{'type':Sequelize[_0x477d('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x477d('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x1893=['STRING','username','remoteUri'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0x1893,0xa2));var _0x3189=function(_0x2166e1,_0x4a9a63){_0x2166e1=_0x2166e1-0x0;var _0x42ada1=_0x1893[_0x2166e1];return _0x42ada1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3189('0x0')]},'description':{'type':Sequelize[_0x3189('0x0')]},'username':{'type':Sequelize[_0x3189('0x0')],'unique':_0x3189('0x1')},'apiKey':{'type':Sequelize[_0x3189('0x0')]},'remoteUri':{'type':Sequelize[_0x3189('0x0')],'unique':_0x3189('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 531f4fe..42bae11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b01=['merge','VIRTUAL','options','findAll','show','params','rawAttributes','fields','include','catch','create','body','find','findOne','FreshsalesConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','getFields','username','remoteUri','apiKey','slice','lastIndexOf','/api/selector/owners','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','FreshsalesAccount','type','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x1fe559,_0x25fba7){var _0xb5b18c=function(_0x5ca09d){while(--_0x5ca09d){_0x1fe559['push'](_0x1fe559['shift']());}};_0xb5b18c(++_0x25fba7);}(_0x4b01,0x144));var _0x14b0=function(_0x4cfc9e,_0x5878b1){_0x4cfc9e=_0x4cfc9e-0x0;var _0x3f06c0=_0x4b01[_0x4cfc9e];return _0x3f06c0;};'use strict';var emlformat=require(_0x14b0('0x0'));var rimraf=require(_0x14b0('0x1'));var zipdir=require(_0x14b0('0x2'));var jsonpatch=require(_0x14b0('0x3'));var rp=require(_0x14b0('0x4'));var moment=require(_0x14b0('0x5'));var BPromise=require(_0x14b0('0x6'));var Mustache=require('mustache');var util=require(_0x14b0('0x7'));var path=require(_0x14b0('0x8'));var sox=require('sox');var csv=require(_0x14b0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x14b0('0xa'));var _=require('lodash');var squel=require(_0x14b0('0xb'));var crypto=require(_0x14b0('0xc'));var jsforce=require(_0x14b0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x14b0('0x9'));var querystring=require(_0x14b0('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x14b0('0xf'));var as=require(_0x14b0('0x10'));var hardwareService=require(_0x14b0('0x11'));var logger=require(_0x14b0('0x12'))('api');var utils=require(_0x14b0('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x14b0('0x14'));var db=require(_0x14b0('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x16b76d,_0x3b7f43){_0x3b7f43=_0x3b7f43||0xcc;return function(_0x2134e7){if(_0x2134e7){return _0x16b76d[_0x14b0('0x16')](_0x3b7f43);}return _0x16b76d['status'](_0x3b7f43)[_0x14b0('0x17')]();};}function respondWithResult(_0x28c0f8,_0x196663){_0x196663=_0x196663||0xc8;return function(_0xb3ceb4){if(_0xb3ceb4){return _0x28c0f8[_0x14b0('0x18')](_0x196663)[_0x14b0('0x19')](_0xb3ceb4);}};}function respondWithFilteredResult(_0x50a009,_0xb93411){return function(_0x2359f8){if(_0x2359f8){var _0x288bfa=typeof _0xb93411[_0x14b0('0x1a')]===_0x14b0('0x1b')&&typeof _0xb93411[_0x14b0('0x1c')]===_0x14b0('0x1b');var _0x4a4e02=_0x2359f8[_0x14b0('0x1d')];var _0x462132=_0x288bfa?0x0:_0xb93411[_0x14b0('0x1a')];var _0x451f1b=_0x288bfa?_0x2359f8[_0x14b0('0x1d')]:_0xb93411[_0x14b0('0x1a')]+_0xb93411[_0x14b0('0x1c')];var _0x4ec678;if(_0x451f1b>=_0x4a4e02){_0x451f1b=_0x4a4e02;_0x4ec678=0xc8;}else{_0x4ec678=0xce;}_0x50a009['status'](_0x4ec678);return _0x50a009[_0x14b0('0x1e')](_0x14b0('0x1f'),_0x462132+'-'+_0x451f1b+'/'+_0x4a4e02)[_0x14b0('0x19')](_0x2359f8);}return null;};}function patchUpdates(_0x30ad91){return function(_0x36ce83){try{jsonpatch[_0x14b0('0x20')](_0x36ce83,_0x30ad91,!![]);}catch(_0x58d664){return BPromise[_0x14b0('0x21')](_0x58d664);}return _0x36ce83['save']();};}function saveUpdates(_0x4d352f,_0x424f2b){return function(_0x51c2a3){if(_0x51c2a3){return _0x51c2a3[_0x14b0('0x22')](_0x4d352f)[_0x14b0('0x23')](function(_0x5c83ec){return _0x5c83ec;});}return null;};}function removeEntity(_0x56b8ae,_0x3245ff){return function(_0xf6166){if(_0xf6166){return _0xf6166[_0x14b0('0x24')]()[_0x14b0('0x23')](function(){_0x56b8ae[_0x14b0('0x18')](0xcc)[_0x14b0('0x17')]();});}};}function handleEntityNotFound(_0x1c67ab,_0xa89e9d){return function(_0x1fb737){if(!_0x1fb737){_0x1c67ab['sendStatus'](0x194);}return _0x1fb737;};}function handleError(_0x219a07,_0x40be49){_0x40be49=_0x40be49||0x1f4;return function(_0x5cfac5){logger['error'](_0x5cfac5[_0x14b0('0x25')]);if(_0x5cfac5[_0x14b0('0x26')]){delete _0x5cfac5['name'];}_0x219a07['status'](_0x40be49)['send'](_0x5cfac5);};}exports['index']=function(_0x1cfac4,_0x386c86){var _0x1c6cd2={},_0x5a4980={},_0x386ef4={'count':0x0,'rows':[]};var _0x567732=_['map'](db[_0x14b0('0x27')]['rawAttributes'],function(_0x68c82){return{'name':_0x68c82['fieldName'],'type':_0x68c82[_0x14b0('0x28')]['key']};});_0x5a4980[_0x14b0('0x29')]=_[_0x14b0('0x2a')](_0x567732,_0x14b0('0x26'));_0x5a4980[_0x14b0('0x2b')]=_[_0x14b0('0x2c')](_0x1cfac4['query']);_0x5a4980[_0x14b0('0x2d')]=_[_0x14b0('0x2e')](_0x5a4980[_0x14b0('0x29')],_0x5a4980[_0x14b0('0x2b')]);_0x1c6cd2[_0x14b0('0x2f')]=_[_0x14b0('0x2e')](_0x5a4980[_0x14b0('0x29')],qs['fields'](_0x1cfac4[_0x14b0('0x2b')]['fields']));_0x1c6cd2[_0x14b0('0x2f')]=_0x1c6cd2['attributes'][_0x14b0('0x30')]?_0x1c6cd2[_0x14b0('0x2f')]:_0x5a4980[_0x14b0('0x29')];if(!_0x1cfac4['query'][_0x14b0('0x31')](_0x14b0('0x32'))){_0x1c6cd2[_0x14b0('0x1c')]=qs[_0x14b0('0x1c')](_0x1cfac4[_0x14b0('0x2b')]['limit']);_0x1c6cd2[_0x14b0('0x1a')]=qs[_0x14b0('0x1a')](_0x1cfac4['query']['offset']);}_0x1c6cd2[_0x14b0('0x33')]=qs['sort'](_0x1cfac4['query'][_0x14b0('0x34')]);_0x1c6cd2[_0x14b0('0x35')]=qs[_0x14b0('0x2d')](_[_0x14b0('0x36')](_0x1cfac4['query'],_0x5a4980['filters']),_0x567732);if(_0x1cfac4['query'][_0x14b0('0x37')]){_0x1c6cd2[_0x14b0('0x35')]=_[_0x14b0('0x38')](_0x1c6cd2[_0x14b0('0x35')],{'$or':_['map'](_0x567732,function(_0x2215cb){if(_0x2215cb[_0x14b0('0x28')]!==_0x14b0('0x39')){var _0x495b6c={};_0x495b6c[_0x2215cb['name']]={'$like':'%'+_0x1cfac4['query'][_0x14b0('0x37')]+'%'};return _0x495b6c;}})});}_0x1c6cd2=_[_0x14b0('0x38')]({},_0x1c6cd2,_0x1cfac4[_0x14b0('0x3a')]);var _0x50f1fd={'where':_0x1c6cd2[_0x14b0('0x35')]};return db['FreshsalesAccount'][_0x14b0('0x1d')](_0x50f1fd)['then'](function(_0x35afca){_0x386ef4['count']=_0x35afca;if(_0x1cfac4['query']['includeAll']){_0x1c6cd2['include']=[{'all':!![]}];}return db[_0x14b0('0x27')][_0x14b0('0x3b')](_0x1c6cd2);})[_0x14b0('0x23')](function(_0x1cbb49){_0x386ef4['rows']=_0x1cbb49;return _0x386ef4;})['then'](respondWithFilteredResult(_0x386c86,_0x1c6cd2))['catch'](handleError(_0x386c86,null));};exports[_0x14b0('0x3c')]=function(_0x423c0f,_0x3d0735){var _0x246d62={'raw':![],'where':{'id':_0x423c0f[_0x14b0('0x3d')]['id']}},_0x43407a={};_0x43407a[_0x14b0('0x29')]=_[_0x14b0('0x2c')](db[_0x14b0('0x27')][_0x14b0('0x3e')]);_0x43407a[_0x14b0('0x2b')]=_[_0x14b0('0x2c')](_0x423c0f[_0x14b0('0x2b')]);_0x43407a[_0x14b0('0x2d')]=_[_0x14b0('0x2e')](_0x43407a['model'],_0x43407a['query']);_0x246d62[_0x14b0('0x2f')]=_[_0x14b0('0x2e')](_0x43407a[_0x14b0('0x29')],qs[_0x14b0('0x3f')](_0x423c0f[_0x14b0('0x2b')][_0x14b0('0x3f')]));_0x246d62['attributes']=_0x246d62[_0x14b0('0x2f')][_0x14b0('0x30')]?_0x246d62['attributes']:_0x43407a[_0x14b0('0x29')];if(_0x423c0f[_0x14b0('0x2b')]['includeAll']){_0x246d62[_0x14b0('0x40')]=[{'all':!![]}];}_0x246d62=_[_0x14b0('0x38')]({},_0x246d62,_0x423c0f[_0x14b0('0x3a')]);return db[_0x14b0('0x27')]['find'](_0x246d62)[_0x14b0('0x23')](handleEntityNotFound(_0x3d0735,null))[_0x14b0('0x23')](respondWithResult(_0x3d0735,null))[_0x14b0('0x41')](handleError(_0x3d0735,null));};exports['create']=function(_0x25c442,_0x4fec5d){return db[_0x14b0('0x27')][_0x14b0('0x42')](_0x25c442['body'],{})[_0x14b0('0x23')](respondWithResult(_0x4fec5d,0xc9))[_0x14b0('0x41')](handleError(_0x4fec5d,null));};exports[_0x14b0('0x22')]=function(_0x52adfa,_0x4e4d4c){if(_0x52adfa[_0x14b0('0x43')]['id']){delete _0x52adfa['body']['id'];}return db['FreshsalesAccount'][_0x14b0('0x44')]({'where':{'id':_0x52adfa['params']['id']}})[_0x14b0('0x23')](handleEntityNotFound(_0x4e4d4c,null))[_0x14b0('0x23')](saveUpdates(_0x52adfa[_0x14b0('0x43')],null))[_0x14b0('0x23')](respondWithResult(_0x4e4d4c,null))[_0x14b0('0x41')](handleError(_0x4e4d4c,null));};exports[_0x14b0('0x24')]=function(_0xd11f4b,_0x37bccb){return db[_0x14b0('0x27')][_0x14b0('0x44')]({'where':{'id':_0xd11f4b[_0x14b0('0x3d')]['id']}})['then'](handleEntityNotFound(_0x37bccb,null))[_0x14b0('0x23')](removeEntity(_0x37bccb,null))['catch'](handleError(_0x37bccb,null));};exports['getConfigurations']=function(_0x37dd8e,_0xdcd7d8,_0x2c63c5){var _0x483658={};var _0x5e85ed={};var _0x5aabe1;var _0x30cb6a;return db[_0x14b0('0x27')][_0x14b0('0x45')]({'where':{'id':_0x37dd8e[_0x14b0('0x3d')]['id']}})[_0x14b0('0x23')](handleEntityNotFound(_0xdcd7d8,null))[_0x14b0('0x23')](function(_0x48429c){if(_0x48429c){_0x5aabe1=_0x48429c;_0x5e85ed[_0x14b0('0x29')]=_[_0x14b0('0x2c')](db[_0x14b0('0x46')][_0x14b0('0x3e')]);_0x5e85ed[_0x14b0('0x2b')]=_[_0x14b0('0x2c')](_0x37dd8e[_0x14b0('0x2b')]);_0x5e85ed[_0x14b0('0x2d')]=_['intersection'](_0x5e85ed[_0x14b0('0x29')],_0x5e85ed[_0x14b0('0x2b')]);_0x483658[_0x14b0('0x2f')]=_['intersection'](_0x5e85ed[_0x14b0('0x29')],qs['fields'](_0x37dd8e[_0x14b0('0x2b')][_0x14b0('0x3f')]));_0x483658['attributes']=_0x483658[_0x14b0('0x2f')][_0x14b0('0x30')]?_0x483658[_0x14b0('0x2f')]:_0x5e85ed[_0x14b0('0x29')];_0x483658[_0x14b0('0x33')]=qs[_0x14b0('0x34')](_0x37dd8e[_0x14b0('0x2b')]['sort']);_0x483658[_0x14b0('0x35')]=qs[_0x14b0('0x2d')](_[_0x14b0('0x36')](_0x37dd8e[_0x14b0('0x2b')],_0x5e85ed['filters']));if(_0x37dd8e['query'][_0x14b0('0x37')]){_0x483658['where']=_[_0x14b0('0x38')](_0x483658['where'],{'$or':_[_0x14b0('0x2a')](_0x483658[_0x14b0('0x2f')],function(_0x302c4d){var _0x4faf07={};_0x4faf07[_0x302c4d]={'$like':'%'+_0x37dd8e[_0x14b0('0x2b')][_0x14b0('0x37')]+'%'};return _0x4faf07;})});}_0x483658=_['merge']({},_0x483658,_0x37dd8e[_0x14b0('0x3a')]);return _0x5aabe1[_0x14b0('0x47')](_0x483658);}})['then'](function(_0x2c41d8){if(_0x2c41d8){_0x30cb6a=_0x2c41d8[_0x14b0('0x30')];if(!_0x37dd8e[_0x14b0('0x2b')][_0x14b0('0x31')](_0x14b0('0x32'))){_0x483658[_0x14b0('0x1c')]=qs[_0x14b0('0x1c')](_0x37dd8e[_0x14b0('0x2b')][_0x14b0('0x1c')]);_0x483658[_0x14b0('0x1a')]=qs[_0x14b0('0x1a')](_0x37dd8e[_0x14b0('0x2b')][_0x14b0('0x1a')]);}return _0x5aabe1[_0x14b0('0x47')](_0x483658);}})[_0x14b0('0x23')](function(_0x91491d){if(_0x91491d){return _0x91491d?{'count':_0x30cb6a,'rows':_0x91491d}:null;}})[_0x14b0('0x23')](respondWithResult(_0xdcd7d8,null))[_0x14b0('0x41')](handleError(_0xdcd7d8,null));};exports[_0x14b0('0x48')]=function(_0x3c4b6f,_0x4c3648,_0x5017c6){if(_0x3c4b6f['body']['id']){delete _0x3c4b6f['body']['id'];}return db[_0x14b0('0x27')][_0x14b0('0x45')]({'where':{'id':_0x3c4b6f[_0x14b0('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4c3648,null))[_0x14b0('0x23')](function(_0x21cde7){if(_0x21cde7){_0x3c4b6f[_0x14b0('0x43')][_0x14b0('0x49')]=_0x21cde7['id'];_0x3c4b6f[_0x14b0('0x43')][_0x14b0('0x4a')]=integrations[_0x14b0('0x4b')](_0x3c4b6f[_0x14b0('0x43')]['channel'],_0x3c4b6f['body'][_0x14b0('0x28')]);_0x3c4b6f[_0x14b0('0x43')][_0x14b0('0x4c')]=integrations[_0x14b0('0x4d')](_0x3c4b6f['body'][_0x14b0('0x4e')],_0x3c4b6f[_0x14b0('0x43')][_0x14b0('0x28')]);return db['FreshsalesConfiguration'][_0x14b0('0x42')](_0x3c4b6f[_0x14b0('0x43')],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db[_0x14b0('0x4f')],'as':_0x14b0('0x4c')}]});}return null;})[_0x14b0('0x23')](respondWithResult(_0x4c3648,null))[_0x14b0('0x41')](handleError(_0x4c3648,null));};exports[_0x14b0('0x50')]=function(_0x515021,_0x1a10f2,_0x529ad4){var _0x5d2b13='';var _0x3b4f34='';return db[_0x14b0('0x27')][_0x14b0('0x45')]({'where':{'id':_0x515021[_0x14b0('0x3d')]['id']},'attributes':['id',_0x14b0('0x51'),_0x14b0('0x52'),_0x14b0('0x53')]})[_0x14b0('0x23')](handleEntityNotFound(_0x1a10f2,null))[_0x14b0('0x23')](function(_0x373b98){if(_0x373b98){_0x3b4f34=_0x373b98['username'];_0x5d2b13=_0x373b98[_0x14b0('0x52')];var _0x5d02fc=_0x373b98['remoteUri'][_0x14b0('0x54')](-0x1);if(_0x5d02fc==='/'){_0x5d2b13=_0x5d2b13['substring'](0x0,_0x5d2b13[_0x14b0('0x55')](_0x5d02fc));}return rp({'method':'GET','uri':util['format']('%s%s',_0x5d2b13,_0x14b0('0x56')),'headers':{'Authorization':'Token\x20token='+_0x373b98[_0x14b0('0x53')]},'json':!![]});}})['then'](function(_0x130935){if(_0x130935){var _0x2de954=_0x130935[_0x14b0('0x57')];var _0x4900b8=![];var _0x45b0d8=null;for(_0x45b0d8=0x0;_0x45b0d8<_0x2de954[_0x14b0('0x30')];_0x45b0d8++){if(_0x2de954[_0x45b0d8][_0x14b0('0x58')]===_0x3b4f34){_0x4900b8=!![];}}if(_0x4900b8){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x14b0('0x59')});}}})[_0x14b0('0x23')](respondWithResult(_0x1a10f2,null))[_0x14b0('0x41')](function(_0x5c8746){var _0x4aa47f=_0x515021[_0x14b0('0x2b')][_0x14b0('0x5a')]?0x1f4:_0x5c8746[_0x14b0('0x5b')]||0x1f4;logger['error'](_0x14b0('0x5c'),'getFields',_0x4aa47f,JSON[_0x14b0('0x5d')](_0x5c8746));delete _0x5c8746[_0x14b0('0x26')];if(_0x4aa47f===0x191){_0x4aa47f=0x190;}_0x1a10f2['status'](_0x4aa47f)[_0x14b0('0x5e')](_0x515021['query'][_0x14b0('0x5a')]?{'message':'Wrong\x20credentials','statusCode':_0x5c8746[_0x14b0('0x5b')]}:_0x5c8746);});};
\ No newline at end of file
+var _0xf4e3=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','options','findAll','catch','params','includeAll','include','find','body','getConfigurations','findOne','order','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','create','FreshsalesField','getFields','username','remoteUri','apiKey','substring','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x43c8b8,_0x5e8934){var _0x413be3=function(_0x23969c){while(--_0x23969c){_0x43c8b8['push'](_0x43c8b8['shift']());}};_0x413be3(++_0x5e8934);}(_0xf4e3,0x12e));var _0x3f4e=function(_0x117821,_0xaa1933){_0x117821=_0x117821-0x0;var _0x4ae9ff=_0xf4e3[_0x117821];return _0x4ae9ff;};'use strict';var emlformat=require(_0x3f4e('0x0'));var rimraf=require(_0x3f4e('0x1'));var zipdir=require(_0x3f4e('0x2'));var jsonpatch=require(_0x3f4e('0x3'));var rp=require(_0x3f4e('0x4'));var moment=require(_0x3f4e('0x5'));var BPromise=require(_0x3f4e('0x6'));var Mustache=require(_0x3f4e('0x7'));var util=require(_0x3f4e('0x8'));var path=require(_0x3f4e('0x9'));var sox=require(_0x3f4e('0xa'));var csv=require(_0x3f4e('0xb'));var ejs=require(_0x3f4e('0xc'));var fs=require('fs');var fs_extra=require(_0x3f4e('0xd'));var _=require(_0x3f4e('0xe'));var squel=require(_0x3f4e('0xf'));var crypto=require(_0x3f4e('0x10'));var jsforce=require(_0x3f4e('0x11'));var deskjs=require(_0x3f4e('0x12'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3f4e('0x13'));var Redis=require(_0x3f4e('0x14'));var authService=require(_0x3f4e('0x15'));var qs=require(_0x3f4e('0x16'));var as=require(_0x3f4e('0x17'));var hardwareService=require(_0x3f4e('0x18'));var logger=require(_0x3f4e('0x19'))(_0x3f4e('0x1a'));var utils=require(_0x3f4e('0x1b'));var config=require(_0x3f4e('0x1c'));var licenseUtil=require(_0x3f4e('0x1d'));var db=require(_0x3f4e('0x1e'))['db'];var integrations=require(_0x3f4e('0x1f'));function respondWithStatusCode(_0x2fe22a,_0x5c11f4){_0x5c11f4=_0x5c11f4||0xcc;return function(_0x19e37b){if(_0x19e37b){return _0x2fe22a[_0x3f4e('0x20')](_0x5c11f4);}return _0x2fe22a['status'](_0x5c11f4)[_0x3f4e('0x21')]();};}function respondWithResult(_0x30d313,_0xfa7cc){_0xfa7cc=_0xfa7cc||0xc8;return function(_0x11fa21){if(_0x11fa21){return _0x30d313[_0x3f4e('0x22')](_0xfa7cc)[_0x3f4e('0x23')](_0x11fa21);}};}function respondWithFilteredResult(_0x2ea0c1,_0x46fa5a){return function(_0x59eadd){if(_0x59eadd){var _0x26b9ca=typeof _0x46fa5a[_0x3f4e('0x24')]===_0x3f4e('0x25')&&typeof _0x46fa5a[_0x3f4e('0x26')]===_0x3f4e('0x25');var _0x282ff7=_0x59eadd[_0x3f4e('0x27')];var _0x1b4288=_0x26b9ca?0x0:_0x46fa5a[_0x3f4e('0x24')];var _0x240120=_0x26b9ca?_0x59eadd['count']:_0x46fa5a['offset']+_0x46fa5a[_0x3f4e('0x26')];var _0x14406d;if(_0x240120>=_0x282ff7){_0x240120=_0x282ff7;_0x14406d=0xc8;}else{_0x14406d=0xce;}_0x2ea0c1[_0x3f4e('0x22')](_0x14406d);return _0x2ea0c1[_0x3f4e('0x28')](_0x3f4e('0x29'),_0x1b4288+'-'+_0x240120+'/'+_0x282ff7)[_0x3f4e('0x23')](_0x59eadd);}return null;};}function patchUpdates(_0x5ea1d7){return function(_0x4d907c){try{jsonpatch[_0x3f4e('0x2a')](_0x4d907c,_0x5ea1d7,!![]);}catch(_0x54a59a){return BPromise['reject'](_0x54a59a);}return _0x4d907c['save']();};}function saveUpdates(_0x167634,_0x163797){return function(_0x5613b4){if(_0x5613b4){return _0x5613b4[_0x3f4e('0x2b')](_0x167634)[_0x3f4e('0x2c')](function(_0x5cd0a9){return _0x5cd0a9;});}return null;};}function removeEntity(_0x53bc58,_0x4bcdf2){return function(_0x3099ac){if(_0x3099ac){return _0x3099ac[_0x3f4e('0x2d')]()[_0x3f4e('0x2c')](function(){_0x53bc58['status'](0xcc)[_0x3f4e('0x21')]();});}};}function handleEntityNotFound(_0x4e44a3,_0x564b06){return function(_0x1e75aa){if(!_0x1e75aa){_0x4e44a3[_0x3f4e('0x20')](0x194);}return _0x1e75aa;};}function handleError(_0x5ca58b,_0x44e334){_0x44e334=_0x44e334||0x1f4;return function(_0x5dbee1){logger[_0x3f4e('0x2e')](_0x5dbee1[_0x3f4e('0x2f')]);if(_0x5dbee1['name']){delete _0x5dbee1[_0x3f4e('0x30')];}_0x5ca58b[_0x3f4e('0x22')](_0x44e334)[_0x3f4e('0x31')](_0x5dbee1);};}exports[_0x3f4e('0x32')]=function(_0xcaf552,_0x5ef0d7){var _0x42aa83={},_0x44f94c={},_0x107e56={'count':0x0,'rows':[]};var _0x5998cb=_[_0x3f4e('0x33')](db[_0x3f4e('0x34')][_0x3f4e('0x35')],function(_0x2f392){return{'name':_0x2f392[_0x3f4e('0x36')],'type':_0x2f392[_0x3f4e('0x37')]['key']};});_0x44f94c[_0x3f4e('0x38')]=_[_0x3f4e('0x33')](_0x5998cb,_0x3f4e('0x30'));_0x44f94c[_0x3f4e('0x39')]=_[_0x3f4e('0x3a')](_0xcaf552[_0x3f4e('0x39')]);_0x44f94c[_0x3f4e('0x3b')]=_[_0x3f4e('0x3c')](_0x44f94c[_0x3f4e('0x38')],_0x44f94c['query']);_0x42aa83[_0x3f4e('0x3d')]=_[_0x3f4e('0x3c')](_0x44f94c['model'],qs[_0x3f4e('0x3e')](_0xcaf552[_0x3f4e('0x39')][_0x3f4e('0x3e')]));_0x42aa83[_0x3f4e('0x3d')]=_0x42aa83[_0x3f4e('0x3d')][_0x3f4e('0x3f')]?_0x42aa83['attributes']:_0x44f94c[_0x3f4e('0x38')];if(!_0xcaf552[_0x3f4e('0x39')][_0x3f4e('0x40')]('nolimit')){_0x42aa83[_0x3f4e('0x26')]=qs[_0x3f4e('0x26')](_0xcaf552['query'][_0x3f4e('0x26')]);_0x42aa83[_0x3f4e('0x24')]=qs[_0x3f4e('0x24')](_0xcaf552[_0x3f4e('0x39')][_0x3f4e('0x24')]);}_0x42aa83['order']=qs[_0x3f4e('0x41')](_0xcaf552['query'][_0x3f4e('0x41')]);_0x42aa83[_0x3f4e('0x42')]=qs[_0x3f4e('0x3b')](_[_0x3f4e('0x43')](_0xcaf552[_0x3f4e('0x39')],_0x44f94c[_0x3f4e('0x3b')]),_0x5998cb);if(_0xcaf552['query'][_0x3f4e('0x44')]){_0x42aa83[_0x3f4e('0x42')]=_['merge'](_0x42aa83[_0x3f4e('0x42')],{'$or':_[_0x3f4e('0x33')](_0x5998cb,function(_0x4809b7){if(_0x4809b7[_0x3f4e('0x37')]!==_0x3f4e('0x45')){var _0x8ff045={};_0x8ff045[_0x4809b7[_0x3f4e('0x30')]]={'$like':'%'+_0xcaf552['query'][_0x3f4e('0x44')]+'%'};return _0x8ff045;}})});}_0x42aa83=_[_0x3f4e('0x46')]({},_0x42aa83,_0xcaf552[_0x3f4e('0x47')]);var _0x4b47ec={'where':_0x42aa83[_0x3f4e('0x42')]};return db[_0x3f4e('0x34')][_0x3f4e('0x27')](_0x4b47ec)[_0x3f4e('0x2c')](function(_0x4e11f8){_0x107e56['count']=_0x4e11f8;if(_0xcaf552[_0x3f4e('0x39')]['includeAll']){_0x42aa83['include']=[{'all':!![]}];}return db[_0x3f4e('0x34')][_0x3f4e('0x48')](_0x42aa83);})[_0x3f4e('0x2c')](function(_0x531813){_0x107e56['rows']=_0x531813;return _0x107e56;})['then'](respondWithFilteredResult(_0x5ef0d7,_0x42aa83))[_0x3f4e('0x49')](handleError(_0x5ef0d7,null));};exports['show']=function(_0x32bd37,_0x56975b){var _0xdf0f7={'raw':![],'where':{'id':_0x32bd37[_0x3f4e('0x4a')]['id']}},_0x4cc5e2={};_0x4cc5e2[_0x3f4e('0x38')]=_['keys'](db['FreshsalesAccount'][_0x3f4e('0x35')]);_0x4cc5e2[_0x3f4e('0x39')]=_[_0x3f4e('0x3a')](_0x32bd37[_0x3f4e('0x39')]);_0x4cc5e2[_0x3f4e('0x3b')]=_['intersection'](_0x4cc5e2['model'],_0x4cc5e2[_0x3f4e('0x39')]);_0xdf0f7[_0x3f4e('0x3d')]=_['intersection'](_0x4cc5e2[_0x3f4e('0x38')],qs[_0x3f4e('0x3e')](_0x32bd37[_0x3f4e('0x39')][_0x3f4e('0x3e')]));_0xdf0f7[_0x3f4e('0x3d')]=_0xdf0f7[_0x3f4e('0x3d')][_0x3f4e('0x3f')]?_0xdf0f7[_0x3f4e('0x3d')]:_0x4cc5e2[_0x3f4e('0x38')];if(_0x32bd37[_0x3f4e('0x39')][_0x3f4e('0x4b')]){_0xdf0f7[_0x3f4e('0x4c')]=[{'all':!![]}];}_0xdf0f7=_[_0x3f4e('0x46')]({},_0xdf0f7,_0x32bd37['options']);return db[_0x3f4e('0x34')][_0x3f4e('0x4d')](_0xdf0f7)[_0x3f4e('0x2c')](handleEntityNotFound(_0x56975b,null))['then'](respondWithResult(_0x56975b,null))[_0x3f4e('0x49')](handleError(_0x56975b,null));};exports['create']=function(_0x250245,_0x3b820f){return db[_0x3f4e('0x34')]['create'](_0x250245['body'],{})['then'](respondWithResult(_0x3b820f,0xc9))[_0x3f4e('0x49')](handleError(_0x3b820f,null));};exports[_0x3f4e('0x2b')]=function(_0x14e343,_0x486436){if(_0x14e343['body']['id']){delete _0x14e343[_0x3f4e('0x4e')]['id'];}return db[_0x3f4e('0x34')][_0x3f4e('0x4d')]({'where':{'id':_0x14e343[_0x3f4e('0x4a')]['id']}})[_0x3f4e('0x2c')](handleEntityNotFound(_0x486436,null))[_0x3f4e('0x2c')](saveUpdates(_0x14e343[_0x3f4e('0x4e')],null))[_0x3f4e('0x2c')](respondWithResult(_0x486436,null))[_0x3f4e('0x49')](handleError(_0x486436,null));};exports['destroy']=function(_0x1400e3,_0x747a86){return db['FreshsalesAccount'][_0x3f4e('0x4d')]({'where':{'id':_0x1400e3[_0x3f4e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x747a86,null))[_0x3f4e('0x2c')](removeEntity(_0x747a86,null))[_0x3f4e('0x49')](handleError(_0x747a86,null));};exports[_0x3f4e('0x4f')]=function(_0xd85604,_0x33c146,_0xbe90a6){var _0x567679={};var _0x19c46c={};var _0x53212d;var _0x551c0a;return db[_0x3f4e('0x34')][_0x3f4e('0x50')]({'where':{'id':_0xd85604[_0x3f4e('0x4a')]['id']}})[_0x3f4e('0x2c')](handleEntityNotFound(_0x33c146,null))[_0x3f4e('0x2c')](function(_0x2ae9ec){if(_0x2ae9ec){_0x53212d=_0x2ae9ec;_0x19c46c['model']=_[_0x3f4e('0x3a')](db['FreshsalesConfiguration'][_0x3f4e('0x35')]);_0x19c46c['query']=_[_0x3f4e('0x3a')](_0xd85604[_0x3f4e('0x39')]);_0x19c46c[_0x3f4e('0x3b')]=_[_0x3f4e('0x3c')](_0x19c46c[_0x3f4e('0x38')],_0x19c46c['query']);_0x567679['attributes']=_[_0x3f4e('0x3c')](_0x19c46c[_0x3f4e('0x38')],qs[_0x3f4e('0x3e')](_0xd85604['query']['fields']));_0x567679[_0x3f4e('0x3d')]=_0x567679[_0x3f4e('0x3d')][_0x3f4e('0x3f')]?_0x567679['attributes']:_0x19c46c[_0x3f4e('0x38')];_0x567679[_0x3f4e('0x51')]=qs['sort'](_0xd85604[_0x3f4e('0x39')]['sort']);_0x567679['where']=qs[_0x3f4e('0x3b')](_[_0x3f4e('0x43')](_0xd85604['query'],_0x19c46c[_0x3f4e('0x3b')]));if(_0xd85604[_0x3f4e('0x39')][_0x3f4e('0x44')]){_0x567679[_0x3f4e('0x42')]=_['merge'](_0x567679[_0x3f4e('0x42')],{'$or':_['map'](_0x567679[_0x3f4e('0x3d')],function(_0xb63350){var _0x19d2f1={};_0x19d2f1[_0xb63350]={'$like':'%'+_0xd85604['query'][_0x3f4e('0x44')]+'%'};return _0x19d2f1;})});}_0x567679=_[_0x3f4e('0x46')]({},_0x567679,_0xd85604[_0x3f4e('0x47')]);return _0x53212d[_0x3f4e('0x4f')](_0x567679);}})[_0x3f4e('0x2c')](function(_0x4fb685){if(_0x4fb685){_0x551c0a=_0x4fb685[_0x3f4e('0x3f')];if(!_0xd85604[_0x3f4e('0x39')][_0x3f4e('0x40')](_0x3f4e('0x52'))){_0x567679[_0x3f4e('0x26')]=qs[_0x3f4e('0x26')](_0xd85604[_0x3f4e('0x39')][_0x3f4e('0x26')]);_0x567679[_0x3f4e('0x24')]=qs[_0x3f4e('0x24')](_0xd85604[_0x3f4e('0x39')][_0x3f4e('0x24')]);}return _0x53212d[_0x3f4e('0x4f')](_0x567679);}})[_0x3f4e('0x2c')](function(_0x37c867){if(_0x37c867){return _0x37c867?{'count':_0x551c0a,'rows':_0x37c867}:null;}})[_0x3f4e('0x2c')](respondWithResult(_0x33c146,null))[_0x3f4e('0x49')](handleError(_0x33c146,null));};exports['addConfiguration']=function(_0x4404d3,_0x35b18e,_0x2c8836){if(_0x4404d3[_0x3f4e('0x4e')]['id']){delete _0x4404d3[_0x3f4e('0x4e')]['id'];}return db[_0x3f4e('0x34')]['findOne']({'where':{'id':_0x4404d3[_0x3f4e('0x4a')]['id']}})[_0x3f4e('0x2c')](handleEntityNotFound(_0x35b18e,null))[_0x3f4e('0x2c')](function(_0x21ef44){if(_0x21ef44){_0x4404d3[_0x3f4e('0x4e')][_0x3f4e('0x53')]=_0x21ef44['id'];_0x4404d3['body'][_0x3f4e('0x54')]=integrations[_0x3f4e('0x55')](_0x4404d3[_0x3f4e('0x4e')][_0x3f4e('0x56')],_0x4404d3[_0x3f4e('0x4e')][_0x3f4e('0x37')]);_0x4404d3['body'][_0x3f4e('0x57')]=integrations[_0x3f4e('0x58')](_0x4404d3[_0x3f4e('0x4e')][_0x3f4e('0x56')],_0x4404d3[_0x3f4e('0x4e')][_0x3f4e('0x37')]);return db[_0x3f4e('0x59')][_0x3f4e('0x5a')](_0x4404d3[_0x3f4e('0x4e')],{'include':[{'model':db[_0x3f4e('0x5b')],'as':'Subjects'},{'model':db[_0x3f4e('0x5b')],'as':_0x3f4e('0x57')}]});}return null;})[_0x3f4e('0x2c')](respondWithResult(_0x35b18e,null))[_0x3f4e('0x49')](handleError(_0x35b18e,null));};exports[_0x3f4e('0x5c')]=function(_0xc7c988,_0x254a46,_0x5bf59c){var _0xa09af='';var _0x3a61b4='';return db[_0x3f4e('0x34')][_0x3f4e('0x50')]({'where':{'id':_0xc7c988['params']['id']},'attributes':['id',_0x3f4e('0x5d'),_0x3f4e('0x5e'),_0x3f4e('0x5f')]})['then'](handleEntityNotFound(_0x254a46,null))[_0x3f4e('0x2c')](function(_0x4549b0){if(_0x4549b0){_0x3a61b4=_0x4549b0[_0x3f4e('0x5d')];_0xa09af=_0x4549b0[_0x3f4e('0x5e')];var _0x347c08=_0x4549b0[_0x3f4e('0x5e')]['slice'](-0x1);if(_0x347c08==='/'){_0xa09af=_0xa09af[_0x3f4e('0x60')](0x0,_0xa09af['lastIndexOf'](_0x347c08));}return rp({'method':'GET','uri':util[_0x3f4e('0x61')](_0x3f4e('0x62'),_0xa09af,_0x3f4e('0x63')),'headers':{'Authorization':_0x3f4e('0x64')+_0x4549b0[_0x3f4e('0x5f')]},'json':!![]});}})[_0x3f4e('0x2c')](function(_0x47a5f9){if(_0x47a5f9){var _0x3fd595=_0x47a5f9[_0x3f4e('0x65')];var _0x1be926=![];var _0x5c5583=null;for(_0x5c5583=0x0;_0x5c5583<_0x3fd595[_0x3f4e('0x3f')];_0x5c5583++){if(_0x3fd595[_0x5c5583][_0x3f4e('0x66')]===_0x3a61b4){_0x1be926=!![];}}if(_0x1be926){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x3f4e('0x67')});}}})['then'](respondWithResult(_0x254a46,null))[_0x3f4e('0x49')](function(_0x513ba6){var _0x57234a=_0xc7c988[_0x3f4e('0x39')][_0x3f4e('0x68')]?0x1f4:_0x513ba6[_0x3f4e('0x69')]||0x1f4;logger[_0x3f4e('0x2e')](_0x3f4e('0x6a'),'getFields',_0x57234a,JSON[_0x3f4e('0x6b')](_0x513ba6));delete _0x513ba6['name'];if(_0x57234a===0x191){_0x57234a=0x190;}_0x254a46[_0x3f4e('0x22')](_0x57234a)[_0x3f4e('0x31')](_0xc7c988[_0x3f4e('0x39')][_0x3f4e('0x68')]?{'message':_0x3f4e('0x6c'),'statusCode':_0x513ba6['statusCode']}:_0x513ba6);});};
\ No newline at end of file
index 7e377d2..b262bef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77d4=['../../components/integrations/configuration','exports','int_freshsales_accounts','util','api','bluebird','request-promise','../../config/environment','./intFreshsalesAccount.attributes'];(function(_0x2965ac,_0x1e475e){var _0x103874=function(_0x458056){while(--_0x458056){_0x2965ac['push'](_0x2965ac['shift']());}};_0x103874(++_0x1e475e);}(_0x77d4,0x108));var _0x477d=function(_0x8bf294,_0x1ca4ae){_0x8bf294=_0x8bf294-0x0;var _0x596021=_0x77d4[_0x8bf294];return _0x596021;};'use strict';var _=require('lodash');var util=require(_0x477d('0x0'));var logger=require('../../config/logger')(_0x477d('0x1'));var moment=require('moment');var BPromise=require(_0x477d('0x2'));var rp=require(_0x477d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x477d('0x4'));var attributes=require(_0x477d('0x5'));var integrations=require(_0x477d('0x6'));module[_0x477d('0x7')]=function(_0x2545e5,_0x45ca2d){return _0x2545e5['define']('FreshsalesAccount',attributes,{'tableName':_0x477d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0424=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','../../config/logger','api','moment','bluebird','path'];(function(_0xbf9129,_0x38b52d){var _0x16663e=function(_0x343df7){while(--_0x343df7){_0xbf9129['push'](_0xbf9129['shift']());}};_0x16663e(++_0x38b52d);}(_0x0424,0x159));var _0x4042=function(_0x4f6610,_0x11d9ae){_0x4f6610=_0x4f6610-0x0;var _0x44e7d3=_0x0424[_0x4f6610];return _0x44e7d3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4042('0x0'))(_0x4042('0x1'));var moment=require(_0x4042('0x2'));var BPromise=require(_0x4042('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4042('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4042('0x5'));var integrations=require(_0x4042('0x6'));module[_0x4042('0x7')]=function(_0xc0fba0,_0x3abaf1){return _0xc0fba0[_0x4042('0x8')](_0x4042('0x9'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3f65581..fbf5372 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e3f=['FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','limit','include','model','attributes','map','stringify','ShowFreshsalesAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4bec28,_0x3138a9){var _0x36cd6e=function(_0x2d5659){while(--_0x2d5659){_0x4bec28['push'](_0x4bec28['shift']());}};_0x36cd6e(++_0x3138a9);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8e3f[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var moment=require(_0xf8e3('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8e3('0x3'));var fs=require('fs');var Redis=require(_0xf8e3('0x4'));var db=require(_0xf8e3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf8e3('0x6'))(_0xf8e3('0x7'));var config=require('../../config/environment');var jayson=require(_0xf8e3('0x8'));var client=jayson[_0xf8e3('0x9')][_0xf8e3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ee9f3,_0x4e9e57,_0x4504dd){return new BPromise(function(_0x2e39b7,_0x17f56c){return client[_0xf8e3('0xb')](_0x1ee9f3,_0x4504dd)[_0xf8e3('0xc')](function(_0x4055e2){logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));logger[_0xf8e3('0x10')](_0xf8e3('0x11'),_0x4e9e57,_0xf8e3('0xf'),JSON['stringify'](_0x4055e2));if(_0x4055e2[_0xf8e3('0x12')]){if(_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x13')]===0x1f4){logger['error'](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')][_0xf8e3('0x14')]);return _0x17f56c(_0x4055e2[_0xf8e3('0x12')]['message']);}logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x4055e2[_0xf8e3('0x12')]['message']);return _0x2e39b7(_0x4055e2[_0xf8e3('0x12')]['message']);}else{logger[_0xf8e3('0xd')](_0xf8e3('0xe'),_0x4e9e57,_0xf8e3('0xf'));_0x2e39b7(_0x4055e2['result']['message']);}})[_0xf8e3('0x15')](function(_0x385dde){logger[_0xf8e3('0x12')](_0xf8e3('0xe'),_0x4e9e57,_0x385dde);_0x17f56c(_0x385dde);});});}exports[_0xf8e3('0x16')]=function(_0x11d4cc){var _0x7a81c3=this;return new Promise(function(_0x2e27e3,_0x1337ae){return db[_0xf8e3('0x17')]['findAll']({'raw':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x19')]===undefined?!![]:![]:!![],'where':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x1a')]||null:null,'attributes':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')]['attributes']||null:null,'limit':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x1b')]||null:null,'include':_0x11d4cc[_0xf8e3('0x18')]?_0x11d4cc['options'][_0xf8e3('0x1c')]?_['map'](_0x11d4cc[_0xf8e3('0x18')][_0xf8e3('0x1c')],function(_0x33d526){return{'model':db[_0x33d526[_0xf8e3('0x1d')]],'as':_0x33d526['as'],'attributes':_0x33d526[_0xf8e3('0x1e')],'include':_0x33d526[_0xf8e3('0x1c')]?_['map'](_0x33d526[_0xf8e3('0x1c')],function(_0x2fc674){return{'model':db[_0x2fc674[_0xf8e3('0x1d')]],'as':_0x2fc674['as'],'attributes':_0x2fc674[_0xf8e3('0x1e')],'include':_0x2fc674[_0xf8e3('0x1c')]?_[_0xf8e3('0x1f')](_0x2fc674[_0xf8e3('0x1c')],function(_0x157a2d){return{'model':db[_0x157a2d['model']],'as':_0x157a2d['as'],'attributes':_0x157a2d[_0xf8e3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf8e3('0xc')](function(_0x12ebd2){logger[_0xf8e3('0xd')](_0xf8e3('0x16'),_0x11d4cc);logger[_0xf8e3('0x10')](_0xf8e3('0x16'),_0x11d4cc,JSON[_0xf8e3('0x20')](_0x12ebd2));_0x2e27e3(_0x12ebd2);})['catch'](function(_0x21e1c0){logger[_0xf8e3('0x12')](_0xf8e3('0x16'),_0x21e1c0[_0xf8e3('0x14')],_0x11d4cc);_0x1337ae(_0x7a81c3['error'](0x1f4,_0x21e1c0[_0xf8e3('0x14')]));});});};exports[_0xf8e3('0x21')]=function(_0x40f64d){var _0x45df49=this;return new Promise(function(_0x33f208,_0x46c85d){return db[_0xf8e3('0x17')][_0xf8e3('0x22')]({'raw':_0x40f64d['options']?_0x40f64d[_0xf8e3('0x18')][_0xf8e3('0x19')]===undefined?!![]:![]:!![],'where':_0x40f64d['options']?_0x40f64d['options']['where']||null:null,'attributes':_0x40f64d[_0xf8e3('0x18')]?_0x40f64d['options'][_0xf8e3('0x1e')]||null:null,'include':_0x40f64d[_0xf8e3('0x18')]?_0x40f64d[_0xf8e3('0x18')][_0xf8e3('0x1c')]?_['map'](_0x40f64d['options'][_0xf8e3('0x1c')],function(_0x2f87d8){return{'model':db[_0x2f87d8[_0xf8e3('0x1d')]],'as':_0x2f87d8['as'],'attributes':_0x2f87d8[_0xf8e3('0x1e')],'include':_0x2f87d8[_0xf8e3('0x1c')]?_[_0xf8e3('0x1f')](_0x2f87d8['include'],function(_0x1afead){return{'model':db[_0x1afead['model']],'as':_0x1afead['as'],'attributes':_0x1afead['attributes'],'include':_0x1afead[_0xf8e3('0x1c')]?_[_0xf8e3('0x1f')](_0x1afead[_0xf8e3('0x1c')],function(_0x1b7af2){return{'model':db[_0x1b7af2['model']],'as':_0x1b7af2['as'],'attributes':_0x1b7af2['attributes']};}):[]};}):[]};}):[]:[]})[_0xf8e3('0xc')](function(_0x215183){logger['info'](_0xf8e3('0x21'),_0x40f64d);logger[_0xf8e3('0x10')](_0xf8e3('0x21'),_0x40f64d,JSON[_0xf8e3('0x20')](_0x215183));_0x33f208(_0x215183);})['catch'](function(_0x53cfea){logger['error'](_0xf8e3('0x21'),_0x53cfea[_0xf8e3('0x14')],_0x40f64d);_0x46c85d(_0x45df49[_0xf8e3('0x12')](0x1f4,_0x53cfea[_0xf8e3('0x14')]));});});};
\ No newline at end of file
+var _0xa46e=['model','attributes','GetFreshsalesAccount','ShowFreshsalesAccount','find','where','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','message','FreshsalesAccount,\x20%s,\x20%s','info','result','catch','FreshsalesAccount','findAll','options','raw','include','map'];(function(_0x572350,_0xebffcb){var _0x476598=function(_0x161e88){while(--_0x161e88){_0x572350['push'](_0x572350['shift']());}};_0x476598(++_0xebffcb);}(_0xa46e,0x8a));var _0xea46=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0xa46e[_0x1406ae];return _0x23a076;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var moment=require('moment');var BPromise=require(_0xea46('0x2'));var rs=require(_0xea46('0x3'));var fs=require('fs');var Redis=require(_0xea46('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xea46('0x5'));var logger=require('../../config/logger')(_0xea46('0x6'));var config=require('../../config/environment');var jayson=require(_0xea46('0x7'));var client=jayson['client'][_0xea46('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dc26f,_0x5f1cd1,_0x2d1b30){return new BPromise(function(_0x42771a,_0xe7d428){return client[_0xea46('0x9')](_0x3dc26f,_0x2d1b30)[_0xea46('0xa')](function(_0x4cf206){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'));logger[_0xea46('0xc')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'),JSON[_0xea46('0xd')](_0x4cf206));if(_0x4cf206[_0xea46('0xe')]){if(_0x4cf206['error'][_0xea46('0xf')]===0x1f4){logger[_0xea46('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0xe7d428(_0x4cf206['error'][_0xea46('0x10')]);}logger['error'](_0xea46('0x11'),_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0x42771a(_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);}else{logger[_0xea46('0x12')](_0xea46('0x11'),_0x5f1cd1,_0xea46('0xb'));_0x42771a(_0x4cf206[_0xea46('0x13')]['message']);}})[_0xea46('0x14')](function(_0xbf225e){logger[_0xea46('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x5f1cd1,_0xbf225e);_0xe7d428(_0xbf225e);});});}exports['GetFreshsalesAccount']=function(_0x19d5c1){var _0x3f463d=this;return new Promise(function(_0x5cf5dd,_0x4b6745){return db[_0xea46('0x15')][_0xea46('0x16')]({'raw':_0x19d5c1['options']?_0x19d5c1[_0xea46('0x17')][_0xea46('0x18')]===undefined?!![]:![]:!![],'where':_0x19d5c1[_0xea46('0x17')]?_0x19d5c1[_0xea46('0x17')]['where']||null:null,'attributes':_0x19d5c1[_0xea46('0x17')]?_0x19d5c1['options']['attributes']||null:null,'limit':_0x19d5c1[_0xea46('0x17')]?_0x19d5c1['options']['limit']||null:null,'include':_0x19d5c1['options']?_0x19d5c1[_0xea46('0x17')][_0xea46('0x19')]?_[_0xea46('0x1a')](_0x19d5c1['options'][_0xea46('0x19')],function(_0x59b10d){return{'model':db[_0x59b10d[_0xea46('0x1b')]],'as':_0x59b10d['as'],'attributes':_0x59b10d[_0xea46('0x1c')],'include':_0x59b10d['include']?_[_0xea46('0x1a')](_0x59b10d['include'],function(_0x2b3a8f){return{'model':db[_0x2b3a8f[_0xea46('0x1b')]],'as':_0x2b3a8f['as'],'attributes':_0x2b3a8f[_0xea46('0x1c')],'include':_0x2b3a8f['include']?_['map'](_0x2b3a8f[_0xea46('0x19')],function(_0x38ac07){return{'model':db[_0x38ac07['model']],'as':_0x38ac07['as'],'attributes':_0x38ac07[_0xea46('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11129d){logger['info'](_0xea46('0x1d'),_0x19d5c1);logger[_0xea46('0xc')](_0xea46('0x1d'),_0x19d5c1,JSON[_0xea46('0xd')](_0x11129d));_0x5cf5dd(_0x11129d);})[_0xea46('0x14')](function(_0x174345){logger['error'](_0xea46('0x1d'),_0x174345[_0xea46('0x10')],_0x19d5c1);_0x4b6745(_0x3f463d[_0xea46('0xe')](0x1f4,_0x174345['message']));});});};exports[_0xea46('0x1e')]=function(_0x3cdf96){var _0x38d631=this;return new Promise(function(_0x5a0fc0,_0x4a0635){return db['FreshsalesAccount'][_0xea46('0x1f')]({'raw':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96[_0xea46('0x17')][_0xea46('0x18')]===undefined?!![]:![]:!![],'where':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96[_0xea46('0x17')][_0xea46('0x20')]||null:null,'attributes':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96[_0xea46('0x17')][_0xea46('0x1c')]||null:null,'include':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96['options'][_0xea46('0x19')]?_[_0xea46('0x1a')](_0x3cdf96[_0xea46('0x17')][_0xea46('0x19')],function(_0x1472c0){return{'model':db[_0x1472c0[_0xea46('0x1b')]],'as':_0x1472c0['as'],'attributes':_0x1472c0[_0xea46('0x1c')],'include':_0x1472c0['include']?_[_0xea46('0x1a')](_0x1472c0[_0xea46('0x19')],function(_0x388449){return{'model':db[_0x388449[_0xea46('0x1b')]],'as':_0x388449['as'],'attributes':_0x388449[_0xea46('0x1c')],'include':_0x388449['include']?_['map'](_0x388449[_0xea46('0x19')],function(_0x343499){return{'model':db[_0x343499['model']],'as':_0x343499['as'],'attributes':_0x343499[_0xea46('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xea46('0xa')](function(_0x123aae){logger[_0xea46('0x12')]('ShowFreshsalesAccount',_0x3cdf96);logger['debug'](_0xea46('0x1e'),_0x3cdf96,JSON['stringify'](_0x123aae));_0x5a0fc0(_0x123aae);})[_0xea46('0x14')](function(_0xdec374){logger['error'](_0xea46('0x1e'),_0xdec374[_0xea46('0x10')],_0x3cdf96);_0x4a0635(_0x38d631['error'](0x1f4,_0xdec374[_0xea46('0x10')]));});});};
\ No newline at end of file
index 608f020..cdc5d1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6711=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','getSubjects','/:id/fields','post','create','put','delete','destroy','exports','util','path','express','Router','fs-extra'];(function(_0x5519a9,_0x1c5147){var _0x32f2cc=function(_0x52ed58){while(--_0x52ed58){_0x5519a9['push'](_0x5519a9['shift']());}};_0x32f2cc(++_0x1c5147);}(_0x6711,0x1df));var _0x1671=function(_0x513986,_0x31bc65){_0x513986=_0x513986-0x0;var _0x282e99=_0x6711[_0x513986];return _0x282e99;};'use strict';var multer=require('multer');var util=require(_0x1671('0x0'));var path=require(_0x1671('0x1'));var timeout=require('connect-timeout');var express=require(_0x1671('0x2'));var router=express[_0x1671('0x3')]();var fs_extra=require(_0x1671('0x4'));var auth=require(_0x1671('0x5'));var interaction=require(_0x1671('0x6'));var config=require(_0x1671('0x7'));var controller=require(_0x1671('0x8'));router[_0x1671('0x9')]('/',auth[_0x1671('0xa')](),controller[_0x1671('0xb')]);router[_0x1671('0x9')](_0x1671('0xc'),auth[_0x1671('0xa')](),controller['show']);router[_0x1671('0x9')](_0x1671('0xd'),auth[_0x1671('0xa')](),controller[_0x1671('0xe')]);router[_0x1671('0x9')]('/:id/descriptions',auth[_0x1671('0xa')](),controller['getDescriptions']);router[_0x1671('0x9')](_0x1671('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0x1671('0x10')]('/',auth['isAuthenticated'](),controller[_0x1671('0x11')]);router[_0x1671('0x12')](_0x1671('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x1671('0x13')](_0x1671('0xc'),auth[_0x1671('0xa')](),controller[_0x1671('0x14')]);module[_0x1671('0x15')]=router;
\ No newline at end of file
+var _0xe40e=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2c1841,_0x505204){var _0x28d148=function(_0x5be79f){while(--_0x5be79f){_0x2c1841['push'](_0x2c1841['shift']());}};_0x28d148(++_0x505204);}(_0xe40e,0x1d4));var _0xee40=function(_0x195c9d,_0x59bfe4){_0x195c9d=_0x195c9d-0x0;var _0x43b8a8=_0xe40e[_0x195c9d];return _0x43b8a8;};'use strict';var multer=require(_0xee40('0x0'));var util=require(_0xee40('0x1'));var path=require(_0xee40('0x2'));var timeout=require(_0xee40('0x3'));var express=require(_0xee40('0x4'));var router=express[_0xee40('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xee40('0x6'));var interaction=require(_0xee40('0x7'));var config=require(_0xee40('0x8'));var controller=require('./intFreshsalesConfiguration.controller');router[_0xee40('0x9')]('/',auth[_0xee40('0xa')](),controller[_0xee40('0xb')]);router['get'](_0xee40('0xc'),auth[_0xee40('0xa')](),controller[_0xee40('0xd')]);router[_0xee40('0x9')]('/:id/subjects',auth[_0xee40('0xa')](),controller[_0xee40('0xe')]);router[_0xee40('0x9')](_0xee40('0xf'),auth[_0xee40('0xa')](),controller[_0xee40('0x10')]);router[_0xee40('0x9')](_0xee40('0x11'),auth[_0xee40('0xa')](),controller[_0xee40('0x12')]);router[_0xee40('0x13')]('/',auth['isAuthenticated'](),controller[_0xee40('0x14')]);router['put'](_0xee40('0xc'),auth[_0xee40('0xa')](),controller[_0xee40('0x15')]);router[_0xee40('0x16')]('/:id',auth[_0xee40('0xa')](),controller[_0xee40('0x17')]);module[_0xee40('0x18')]=router;
\ No newline at end of file
index 677c0e1..8651b70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa86d=['STRING','exports'];(function(_0x1ba0c8,_0x32cda9){var _0x3f7906=function(_0x34272b){while(--_0x34272b){_0x1ba0c8['push'](_0x1ba0c8['shift']());}};_0x3f7906(++_0x32cda9);}(_0xa86d,0x1bf));var _0xda86=function(_0x36443d,_0x1a0880){_0x36443d=_0x36443d-0x0;var _0x2d9c76=_0xa86d[_0x36443d];return _0x2d9c76;};'use strict';var Sequelize=require('sequelize');module[_0xda86('0x0')]={'name':{'type':Sequelize[_0xda86('0x1')]},'description':{'type':Sequelize[_0xda86('0x1')]}};
\ No newline at end of file
+var _0xb104=['sequelize','exports','STRING'];(function(_0x1a78eb,_0x405dfe){var _0x5ac03e=function(_0x1a0670){while(--_0x1a0670){_0x1a78eb['push'](_0x1a78eb['shift']());}};_0x5ac03e(++_0x405dfe);}(_0xb104,0xab));var _0x4b10=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb104[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x4b10('0x0'));module[_0x4b10('0x1')]={'name':{'type':Sequelize[_0x4b10('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 92c05f2..9d84a43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd4f=['filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','create','body','getSubjects','findOne','FreshsalesField','length','options','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','error','stack','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys'];(function(_0x3b3210,_0x25e8ed){var _0x5b5484=function(_0x417858){while(--_0x417858){_0x3b3210['push'](_0x3b3210['shift']());}};_0x5b5484(++_0x25e8ed);}(_0xcd4f,0xc1));var _0xfcd4=function(_0x581ab7,_0x24d129){_0x581ab7=_0x581ab7-0x0;var _0x5cf9b7=_0xcd4f[_0x581ab7];return _0x5cf9b7;};'use strict';var emlformat=require(_0xfcd4('0x0'));var rimraf=require(_0xfcd4('0x1'));var zipdir=require(_0xfcd4('0x2'));var jsonpatch=require(_0xfcd4('0x3'));var rp=require(_0xfcd4('0x4'));var moment=require(_0xfcd4('0x5'));var BPromise=require(_0xfcd4('0x6'));var Mustache=require('mustache');var util=require(_0xfcd4('0x7'));var path=require(_0xfcd4('0x8'));var sox=require(_0xfcd4('0x9'));var csv=require(_0xfcd4('0xa'));var ejs=require(_0xfcd4('0xb'));var fs=require('fs');var fs_extra=require(_0xfcd4('0xc'));var _=require(_0xfcd4('0xd'));var squel=require(_0xfcd4('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfcd4('0xf'));var toCsv=require(_0xfcd4('0xa'));var querystring=require('querystring');var Papa=require(_0xfcd4('0x10'));var Redis=require(_0xfcd4('0x11'));var authService=require(_0xfcd4('0x12'));var qs=require(_0xfcd4('0x13'));var as=require(_0xfcd4('0x14'));var hardwareService=require(_0xfcd4('0x15'));var logger=require(_0xfcd4('0x16'))(_0xfcd4('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfcd4('0x18'));var db=require(_0xfcd4('0x19'))['db'];function respondWithStatusCode(_0x28ed4d,_0x22057c){_0x22057c=_0x22057c||0xcc;return function(_0x2bd7cc){if(_0x2bd7cc){return _0x28ed4d[_0xfcd4('0x1a')](_0x22057c);}return _0x28ed4d[_0xfcd4('0x1b')](_0x22057c)[_0xfcd4('0x1c')]();};}function respondWithResult(_0x3fb04f,_0x3ab0be){_0x3ab0be=_0x3ab0be||0xc8;return function(_0x3d4025){if(_0x3d4025){return _0x3fb04f[_0xfcd4('0x1b')](_0x3ab0be)[_0xfcd4('0x1d')](_0x3d4025);}};}function respondWithFilteredResult(_0x3a6e08,_0x1b3985){return function(_0x4da910){if(_0x4da910){var _0x2173b6=typeof _0x1b3985[_0xfcd4('0x1e')]===_0xfcd4('0x1f')&&typeof _0x1b3985[_0xfcd4('0x20')]==='undefined';var _0x2416f1=_0x4da910[_0xfcd4('0x21')];var _0x499e6d=_0x2173b6?0x0:_0x1b3985[_0xfcd4('0x1e')];var _0x3acf44=_0x2173b6?_0x4da910['count']:_0x1b3985[_0xfcd4('0x1e')]+_0x1b3985[_0xfcd4('0x20')];var _0x18434b;if(_0x3acf44>=_0x2416f1){_0x3acf44=_0x2416f1;_0x18434b=0xc8;}else{_0x18434b=0xce;}_0x3a6e08[_0xfcd4('0x1b')](_0x18434b);return _0x3a6e08[_0xfcd4('0x22')]('Content-Range',_0x499e6d+'-'+_0x3acf44+'/'+_0x2416f1)[_0xfcd4('0x1d')](_0x4da910);}return null;};}function patchUpdates(_0x47313d){return function(_0x70cf5){try{jsonpatch['apply'](_0x70cf5,_0x47313d,!![]);}catch(_0x2de7fc){return BPromise[_0xfcd4('0x23')](_0x2de7fc);}return _0x70cf5['save']();};}function saveUpdates(_0x5bc2fe,_0x59b369){return function(_0x47bc1e){if(_0x47bc1e){return _0x47bc1e[_0xfcd4('0x24')](_0x5bc2fe)[_0xfcd4('0x25')](function(_0x5a657c){return _0x5a657c;});}return null;};}function removeEntity(_0x4615a4,_0x41554c){return function(_0x48a9a7){if(_0x48a9a7){return _0x48a9a7[_0xfcd4('0x26')]()[_0xfcd4('0x25')](function(){_0x4615a4[_0xfcd4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x178326,_0x127e27){return function(_0x48535f){if(!_0x48535f){_0x178326[_0xfcd4('0x1a')](0x194);}return _0x48535f;};}function handleError(_0x59bfa3,_0x5f5214){_0x5f5214=_0x5f5214||0x1f4;return function(_0x60390e){logger[_0xfcd4('0x27')](_0x60390e[_0xfcd4('0x28')]);if(_0x60390e[_0xfcd4('0x29')]){delete _0x60390e[_0xfcd4('0x29')];}_0x59bfa3[_0xfcd4('0x1b')](_0x5f5214)[_0xfcd4('0x2a')](_0x60390e);};}exports[_0xfcd4('0x2b')]=function(_0xaf2a36,_0x13f33a){var _0x881887={},_0x31b78f={},_0x356b67={'count':0x0,'rows':[]};var _0x424956=_['map'](db[_0xfcd4('0x2c')][_0xfcd4('0x2d')],function(_0x21aa07){return{'name':_0x21aa07[_0xfcd4('0x2e')],'type':_0x21aa07[_0xfcd4('0x2f')][_0xfcd4('0x30')]};});_0x31b78f[_0xfcd4('0x31')]=_[_0xfcd4('0x32')](_0x424956,_0xfcd4('0x29'));_0x31b78f[_0xfcd4('0x33')]=_[_0xfcd4('0x34')](_0xaf2a36[_0xfcd4('0x33')]);_0x31b78f[_0xfcd4('0x35')]=_[_0xfcd4('0x36')](_0x31b78f[_0xfcd4('0x31')],_0x31b78f[_0xfcd4('0x33')]);_0x881887[_0xfcd4('0x37')]=_[_0xfcd4('0x36')](_0x31b78f[_0xfcd4('0x31')],qs[_0xfcd4('0x38')](_0xaf2a36['query'][_0xfcd4('0x38')]));_0x881887[_0xfcd4('0x37')]=_0x881887[_0xfcd4('0x37')]['length']?_0x881887[_0xfcd4('0x37')]:_0x31b78f[_0xfcd4('0x31')];if(!_0xaf2a36[_0xfcd4('0x33')][_0xfcd4('0x39')](_0xfcd4('0x3a'))){_0x881887[_0xfcd4('0x20')]=qs[_0xfcd4('0x20')](_0xaf2a36[_0xfcd4('0x33')][_0xfcd4('0x20')]);_0x881887[_0xfcd4('0x1e')]=qs['offset'](_0xaf2a36['query'][_0xfcd4('0x1e')]);}_0x881887[_0xfcd4('0x3b')]=qs['sort'](_0xaf2a36['query'][_0xfcd4('0x3c')]);_0x881887['where']=qs[_0xfcd4('0x35')](_[_0xfcd4('0x3d')](_0xaf2a36[_0xfcd4('0x33')],_0x31b78f[_0xfcd4('0x35')]),_0x424956);if(_0xaf2a36['query'][_0xfcd4('0x3e')]){_0x881887[_0xfcd4('0x3f')]=_[_0xfcd4('0x40')](_0x881887[_0xfcd4('0x3f')],{'$or':_[_0xfcd4('0x32')](_0x424956,function(_0x5ae564){if(_0x5ae564[_0xfcd4('0x2f')]!==_0xfcd4('0x41')){var _0x549854={};_0x549854[_0x5ae564[_0xfcd4('0x29')]]={'$like':'%'+_0xaf2a36['query'][_0xfcd4('0x3e')]+'%'};return _0x549854;}})});}_0x881887=_['merge']({},_0x881887,_0xaf2a36['options']);var _0x33e92e={'where':_0x881887[_0xfcd4('0x3f')]};return db[_0xfcd4('0x2c')][_0xfcd4('0x21')](_0x33e92e)[_0xfcd4('0x25')](function(_0x137705){_0x356b67[_0xfcd4('0x21')]=_0x137705;if(_0xaf2a36['query'][_0xfcd4('0x42')]){_0x881887[_0xfcd4('0x43')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0xfcd4('0x44')](_0x881887);})['then'](function(_0x48e75c){_0x356b67[_0xfcd4('0x45')]=_0x48e75c;return _0x356b67;})[_0xfcd4('0x25')](respondWithFilteredResult(_0x13f33a,_0x881887))[_0xfcd4('0x46')](handleError(_0x13f33a,null));};exports['show']=function(_0x1c30e2,_0x7fcd83){var _0x566adb={'raw':![],'where':{'id':_0x1c30e2[_0xfcd4('0x47')]['id']}},_0x58f52a={};_0x58f52a['model']=_[_0xfcd4('0x34')](db[_0xfcd4('0x2c')][_0xfcd4('0x2d')]);_0x58f52a[_0xfcd4('0x33')]=_[_0xfcd4('0x34')](_0x1c30e2[_0xfcd4('0x33')]);_0x58f52a[_0xfcd4('0x35')]=_[_0xfcd4('0x36')](_0x58f52a[_0xfcd4('0x31')],_0x58f52a[_0xfcd4('0x33')]);_0x566adb['attributes']=_[_0xfcd4('0x36')](_0x58f52a[_0xfcd4('0x31')],qs['fields'](_0x1c30e2[_0xfcd4('0x33')]['fields']));_0x566adb[_0xfcd4('0x37')]=_0x566adb[_0xfcd4('0x37')]['length']?_0x566adb[_0xfcd4('0x37')]:_0x58f52a[_0xfcd4('0x31')];if(_0x1c30e2[_0xfcd4('0x33')]['includeAll']){_0x566adb['include']=[{'all':!![]}];}_0x566adb=_[_0xfcd4('0x40')]({},_0x566adb,_0x1c30e2['options']);return db[_0xfcd4('0x2c')][_0xfcd4('0x48')](_0x566adb)['then'](handleEntityNotFound(_0x7fcd83,null))['then'](respondWithResult(_0x7fcd83,null))[_0xfcd4('0x46')](handleError(_0x7fcd83,null));};exports['create']=function(_0x37aeec,_0x3993ad){return db[_0xfcd4('0x2c')][_0xfcd4('0x49')](_0x37aeec['body'],{})[_0xfcd4('0x25')](respondWithResult(_0x3993ad,0xc9))[_0xfcd4('0x46')](handleError(_0x3993ad,null));};exports['update']=function(_0x407b35,_0x1c57f2){if(_0x407b35[_0xfcd4('0x4a')]['id']){delete _0x407b35[_0xfcd4('0x4a')]['id'];}return db[_0xfcd4('0x2c')][_0xfcd4('0x48')]({'where':{'id':_0x407b35['params']['id']}})['then'](handleEntityNotFound(_0x1c57f2,null))[_0xfcd4('0x25')](saveUpdates(_0x407b35['body'],null))['then'](respondWithResult(_0x1c57f2,null))[_0xfcd4('0x46')](handleError(_0x1c57f2,null));};exports['destroy']=function(_0x33af53,_0xb1b972){return db[_0xfcd4('0x2c')]['find']({'where':{'id':_0x33af53[_0xfcd4('0x47')]['id']}})[_0xfcd4('0x25')](handleEntityNotFound(_0xb1b972,null))['then'](removeEntity(_0xb1b972,null))[_0xfcd4('0x46')](handleError(_0xb1b972,null));};exports[_0xfcd4('0x4b')]=function(_0x283280,_0x5dbbfd,_0x405e5a){var _0x238615={};var _0x2d5261={};var _0x3c2ba8;var _0xc5574a;return db[_0xfcd4('0x2c')][_0xfcd4('0x4c')]({'where':{'id':_0x283280[_0xfcd4('0x47')]['id']}})['then'](handleEntityNotFound(_0x5dbbfd,null))[_0xfcd4('0x25')](function(_0x4eb4ab){if(_0x4eb4ab){_0x3c2ba8=_0x4eb4ab;_0x2d5261[_0xfcd4('0x31')]=_[_0xfcd4('0x34')](db[_0xfcd4('0x4d')][_0xfcd4('0x2d')]);_0x2d5261[_0xfcd4('0x33')]=_[_0xfcd4('0x34')](_0x283280[_0xfcd4('0x33')]);_0x2d5261[_0xfcd4('0x35')]=_[_0xfcd4('0x36')](_0x2d5261[_0xfcd4('0x31')],_0x2d5261[_0xfcd4('0x33')]);_0x238615[_0xfcd4('0x37')]=_[_0xfcd4('0x36')](_0x2d5261[_0xfcd4('0x31')],qs[_0xfcd4('0x38')](_0x283280[_0xfcd4('0x33')][_0xfcd4('0x38')]));_0x238615[_0xfcd4('0x37')]=_0x238615[_0xfcd4('0x37')][_0xfcd4('0x4e')]?_0x238615['attributes']:_0x2d5261[_0xfcd4('0x31')];_0x238615[_0xfcd4('0x3b')]=qs['sort'](_0x283280[_0xfcd4('0x33')]['sort']);_0x238615[_0xfcd4('0x3f')]=qs[_0xfcd4('0x35')](_[_0xfcd4('0x3d')](_0x283280[_0xfcd4('0x33')],_0x2d5261[_0xfcd4('0x35')]));if(_0x283280['query'][_0xfcd4('0x3e')]){_0x238615[_0xfcd4('0x3f')]=_[_0xfcd4('0x40')](_0x238615[_0xfcd4('0x3f')],{'$or':_[_0xfcd4('0x32')](_0x238615[_0xfcd4('0x37')],function(_0x11110c){var _0x18a672={};_0x18a672[_0x11110c]={'$like':'%'+_0x283280[_0xfcd4('0x33')][_0xfcd4('0x3e')]+'%'};return _0x18a672;})});}_0x238615=_[_0xfcd4('0x40')]({},_0x238615,_0x283280['options']);return _0x3c2ba8[_0xfcd4('0x4b')](_0x238615);}})[_0xfcd4('0x25')](function(_0x3e5172){if(_0x3e5172){_0xc5574a=_0x3e5172[_0xfcd4('0x4e')];if(!_0x283280[_0xfcd4('0x33')][_0xfcd4('0x39')](_0xfcd4('0x3a'))){_0x238615[_0xfcd4('0x20')]=qs[_0xfcd4('0x20')](_0x283280[_0xfcd4('0x33')]['limit']);_0x238615[_0xfcd4('0x1e')]=qs[_0xfcd4('0x1e')](_0x283280['query'][_0xfcd4('0x1e')]);}return _0x3c2ba8[_0xfcd4('0x4b')](_0x238615);}})[_0xfcd4('0x25')](function(_0x3bad1a){if(_0x3bad1a){return _0x3bad1a?{'count':_0xc5574a,'rows':_0x3bad1a}:null;}})['then'](respondWithResult(_0x5dbbfd,null))['catch'](handleError(_0x5dbbfd,null));};exports['getDescriptions']=function(_0xc2cc7c,_0x5e8c32,_0x41e2ab){var _0x466e10={};var _0x2549cb={};var _0x556128;var _0x14b2f5;return db[_0xfcd4('0x2c')][_0xfcd4('0x4c')]({'where':{'id':_0xc2cc7c['params']['id']}})[_0xfcd4('0x25')](handleEntityNotFound(_0x5e8c32,null))[_0xfcd4('0x25')](function(_0xecc939){if(_0xecc939){_0x556128=_0xecc939;_0x2549cb[_0xfcd4('0x31')]=_[_0xfcd4('0x34')](db[_0xfcd4('0x4d')][_0xfcd4('0x2d')]);_0x2549cb['query']=_[_0xfcd4('0x34')](_0xc2cc7c[_0xfcd4('0x33')]);_0x2549cb[_0xfcd4('0x35')]=_[_0xfcd4('0x36')](_0x2549cb[_0xfcd4('0x31')],_0x2549cb[_0xfcd4('0x33')]);_0x466e10['attributes']=_[_0xfcd4('0x36')](_0x2549cb[_0xfcd4('0x31')],qs[_0xfcd4('0x38')](_0xc2cc7c[_0xfcd4('0x33')]['fields']));_0x466e10[_0xfcd4('0x37')]=_0x466e10[_0xfcd4('0x37')][_0xfcd4('0x4e')]?_0x466e10[_0xfcd4('0x37')]:_0x2549cb[_0xfcd4('0x31')];_0x466e10[_0xfcd4('0x3b')]=qs[_0xfcd4('0x3c')](_0xc2cc7c[_0xfcd4('0x33')][_0xfcd4('0x3c')]);_0x466e10[_0xfcd4('0x3f')]=qs[_0xfcd4('0x35')](_[_0xfcd4('0x3d')](_0xc2cc7c[_0xfcd4('0x33')],_0x2549cb[_0xfcd4('0x35')]));if(_0xc2cc7c['query'][_0xfcd4('0x3e')]){_0x466e10['where']=_[_0xfcd4('0x40')](_0x466e10[_0xfcd4('0x3f')],{'$or':_['map'](_0x466e10[_0xfcd4('0x37')],function(_0x5e75fd){var _0xe8b8a9={};_0xe8b8a9[_0x5e75fd]={'$like':'%'+_0xc2cc7c[_0xfcd4('0x33')]['filter']+'%'};return _0xe8b8a9;})});}_0x466e10=_[_0xfcd4('0x40')]({},_0x466e10,_0xc2cc7c[_0xfcd4('0x4f')]);return _0x556128['getDescriptions'](_0x466e10);}})[_0xfcd4('0x25')](function(_0x5c49a9){if(_0x5c49a9){_0x14b2f5=_0x5c49a9[_0xfcd4('0x4e')];if(!_0xc2cc7c[_0xfcd4('0x33')][_0xfcd4('0x39')](_0xfcd4('0x3a'))){_0x466e10['limit']=qs[_0xfcd4('0x20')](_0xc2cc7c[_0xfcd4('0x33')]['limit']);_0x466e10[_0xfcd4('0x1e')]=qs['offset'](_0xc2cc7c['query']['offset']);}return _0x556128[_0xfcd4('0x50')](_0x466e10);}})[_0xfcd4('0x25')](function(_0x20c933){if(_0x20c933){return _0x20c933?{'count':_0x14b2f5,'rows':_0x20c933}:null;}})[_0xfcd4('0x25')](respondWithResult(_0x5e8c32,null))[_0xfcd4('0x46')](handleError(_0x5e8c32,null));};exports[_0xfcd4('0x51')]=function(_0x35302b,_0x544302,_0x40c782){var _0x27c8f5={};var _0x32f050={};var _0x58482a;var _0x3c13c5;return db['FreshsalesConfiguration'][_0xfcd4('0x4c')]({'where':{'id':_0x35302b[_0xfcd4('0x47')]['id']}})[_0xfcd4('0x25')](handleEntityNotFound(_0x544302,null))[_0xfcd4('0x25')](function(_0x3fc557){if(_0x3fc557){_0x58482a=_0x3fc557;_0x32f050['model']=_['keys'](db[_0xfcd4('0x4d')]['rawAttributes']);_0x32f050['query']=_[_0xfcd4('0x34')](_0x35302b[_0xfcd4('0x33')]);_0x32f050[_0xfcd4('0x35')]=_['intersection'](_0x32f050[_0xfcd4('0x31')],_0x32f050['query']);_0x27c8f5[_0xfcd4('0x37')]=_[_0xfcd4('0x36')](_0x32f050[_0xfcd4('0x31')],qs['fields'](_0x35302b[_0xfcd4('0x33')]['fields']));_0x27c8f5['attributes']=_0x27c8f5['attributes']['length']?_0x27c8f5[_0xfcd4('0x37')]:_0x32f050['model'];_0x27c8f5[_0xfcd4('0x3b')]=qs[_0xfcd4('0x3c')](_0x35302b['query'][_0xfcd4('0x3c')]);_0x27c8f5[_0xfcd4('0x3f')]=qs['filters'](_[_0xfcd4('0x3d')](_0x35302b['query'],_0x32f050[_0xfcd4('0x35')]));if(_0x35302b[_0xfcd4('0x33')][_0xfcd4('0x3e')]){_0x27c8f5[_0xfcd4('0x3f')]=_['merge'](_0x27c8f5['where'],{'$or':_[_0xfcd4('0x32')](_0x27c8f5[_0xfcd4('0x37')],function(_0x5753dc){var _0x1182dd={};_0x1182dd[_0x5753dc]={'$like':'%'+_0x35302b['query'][_0xfcd4('0x3e')]+'%'};return _0x1182dd;})});}_0x27c8f5=_[_0xfcd4('0x40')]({},_0x27c8f5,_0x35302b[_0xfcd4('0x4f')]);return _0x58482a[_0xfcd4('0x51')](_0x27c8f5);}})[_0xfcd4('0x25')](function(_0x3d1d9b){if(_0x3d1d9b){_0x3c13c5=_0x3d1d9b[_0xfcd4('0x4e')];if(!_0x35302b[_0xfcd4('0x33')]['hasOwnProperty']('nolimit')){_0x27c8f5[_0xfcd4('0x20')]=qs[_0xfcd4('0x20')](_0x35302b[_0xfcd4('0x33')]['limit']);_0x27c8f5[_0xfcd4('0x1e')]=qs[_0xfcd4('0x1e')](_0x35302b[_0xfcd4('0x33')][_0xfcd4('0x1e')]);}return _0x58482a['getFields'](_0x27c8f5);}})[_0xfcd4('0x25')](function(_0x449cee){if(_0x449cee){return _0x449cee?{'count':_0x3c13c5,'rows':_0x449cee}:null;}})[_0xfcd4('0x25')](respondWithResult(_0x544302,null))[_0xfcd4('0x46')](handleError(_0x544302,null));};
\ No newline at end of file
+var _0x5994=['find','getSubjects','findOne','FreshsalesField','rawAttributes','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','name','send','map','FreshsalesConfiguration','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','include','options','create','body'];(function(_0x5c9aa5,_0x192572){var _0x419d67=function(_0x46b0e9){while(--_0x46b0e9){_0x5c9aa5['push'](_0x5c9aa5['shift']());}};_0x419d67(++_0x192572);}(_0x5994,0x157));var _0x4599=function(_0x15653b,_0x3a8af9){_0x15653b=_0x15653b-0x0;var _0xb18aed=_0x5994[_0x15653b];return _0xb18aed;};'use strict';var emlformat=require(_0x4599('0x0'));var rimraf=require(_0x4599('0x1'));var zipdir=require(_0x4599('0x2'));var jsonpatch=require(_0x4599('0x3'));var rp=require(_0x4599('0x4'));var moment=require('moment');var BPromise=require(_0x4599('0x5'));var Mustache=require(_0x4599('0x6'));var util=require(_0x4599('0x7'));var path=require(_0x4599('0x8'));var sox=require(_0x4599('0x9'));var csv=require(_0x4599('0xa'));var ejs=require(_0x4599('0xb'));var fs=require('fs');var fs_extra=require(_0x4599('0xc'));var _=require(_0x4599('0xd'));var squel=require(_0x4599('0xe'));var crypto=require(_0x4599('0xf'));var jsforce=require(_0x4599('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x4599('0xa'));var querystring=require(_0x4599('0x11'));var Papa=require(_0x4599('0x12'));var Redis=require(_0x4599('0x13'));var authService=require(_0x4599('0x14'));var qs=require(_0x4599('0x15'));var as=require(_0x4599('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4599('0x17'))(_0x4599('0x18'));var utils=require('../../config/utils');var config=require(_0x4599('0x19'));var licenseUtil=require(_0x4599('0x1a'));var db=require(_0x4599('0x1b'))['db'];function respondWithStatusCode(_0x3afdb7,_0x2f5398){_0x2f5398=_0x2f5398||0xcc;return function(_0x4c83cd){if(_0x4c83cd){return _0x3afdb7[_0x4599('0x1c')](_0x2f5398);}return _0x3afdb7[_0x4599('0x1d')](_0x2f5398)[_0x4599('0x1e')]();};}function respondWithResult(_0x1ac5e4,_0x5a27b1){_0x5a27b1=_0x5a27b1||0xc8;return function(_0x183491){if(_0x183491){return _0x1ac5e4[_0x4599('0x1d')](_0x5a27b1)[_0x4599('0x1f')](_0x183491);}};}function respondWithFilteredResult(_0x5ef37b,_0x346cfa){return function(_0x4de9a2){if(_0x4de9a2){var _0x16826a=typeof _0x346cfa[_0x4599('0x20')]===_0x4599('0x21')&&typeof _0x346cfa[_0x4599('0x22')]===_0x4599('0x21');var _0xaf391b=_0x4de9a2[_0x4599('0x23')];var _0x35f64f=_0x16826a?0x0:_0x346cfa[_0x4599('0x20')];var _0x3e311b=_0x16826a?_0x4de9a2['count']:_0x346cfa[_0x4599('0x20')]+_0x346cfa['limit'];var _0xb79d41;if(_0x3e311b>=_0xaf391b){_0x3e311b=_0xaf391b;_0xb79d41=0xc8;}else{_0xb79d41=0xce;}_0x5ef37b[_0x4599('0x1d')](_0xb79d41);return _0x5ef37b[_0x4599('0x24')](_0x4599('0x25'),_0x35f64f+'-'+_0x3e311b+'/'+_0xaf391b)[_0x4599('0x1f')](_0x4de9a2);}return null;};}function patchUpdates(_0x2a0358){return function(_0x411784){try{jsonpatch['apply'](_0x411784,_0x2a0358,!![]);}catch(_0x1726e0){return BPromise[_0x4599('0x26')](_0x1726e0);}return _0x411784[_0x4599('0x27')]();};}function saveUpdates(_0x1048db,_0x3af2eb){return function(_0x5523a7){if(_0x5523a7){return _0x5523a7[_0x4599('0x28')](_0x1048db)[_0x4599('0x29')](function(_0x1283b4){return _0x1283b4;});}return null;};}function removeEntity(_0x257d87,_0x4a1873){return function(_0x39273d){if(_0x39273d){return _0x39273d['destroy']()['then'](function(){_0x257d87[_0x4599('0x1d')](0xcc)[_0x4599('0x1e')]();});}};}function handleEntityNotFound(_0x49319b,_0x40edc3){return function(_0x3ddb3a){if(!_0x3ddb3a){_0x49319b[_0x4599('0x1c')](0x194);}return _0x3ddb3a;};}function handleError(_0x8c0238,_0x931fd4){_0x931fd4=_0x931fd4||0x1f4;return function(_0x2c45ce){logger[_0x4599('0x2a')](_0x2c45ce['stack']);if(_0x2c45ce[_0x4599('0x2b')]){delete _0x2c45ce[_0x4599('0x2b')];}_0x8c0238[_0x4599('0x1d')](_0x931fd4)[_0x4599('0x2c')](_0x2c45ce);};}exports['index']=function(_0x13324e,_0x97df17){var _0x451625={},_0x1072c1={},_0x1db992={'count':0x0,'rows':[]};var _0x277834=_[_0x4599('0x2d')](db[_0x4599('0x2e')]['rawAttributes'],function(_0x5aec6c){return{'name':_0x5aec6c[_0x4599('0x2f')],'type':_0x5aec6c['type'][_0x4599('0x30')]};});_0x1072c1[_0x4599('0x31')]=_['map'](_0x277834,_0x4599('0x2b'));_0x1072c1[_0x4599('0x32')]=_[_0x4599('0x33')](_0x13324e[_0x4599('0x32')]);_0x1072c1[_0x4599('0x34')]=_[_0x4599('0x35')](_0x1072c1[_0x4599('0x31')],_0x1072c1['query']);_0x451625[_0x4599('0x36')]=_[_0x4599('0x35')](_0x1072c1['model'],qs[_0x4599('0x37')](_0x13324e[_0x4599('0x32')][_0x4599('0x37')]));_0x451625[_0x4599('0x36')]=_0x451625[_0x4599('0x36')][_0x4599('0x38')]?_0x451625[_0x4599('0x36')]:_0x1072c1['model'];if(!_0x13324e[_0x4599('0x32')][_0x4599('0x39')](_0x4599('0x3a'))){_0x451625['limit']=qs[_0x4599('0x22')](_0x13324e[_0x4599('0x32')][_0x4599('0x22')]);_0x451625[_0x4599('0x20')]=qs[_0x4599('0x20')](_0x13324e['query'][_0x4599('0x20')]);}_0x451625[_0x4599('0x3b')]=qs[_0x4599('0x3c')](_0x13324e[_0x4599('0x32')][_0x4599('0x3c')]);_0x451625['where']=qs[_0x4599('0x34')](_[_0x4599('0x3d')](_0x13324e['query'],_0x1072c1[_0x4599('0x34')]),_0x277834);if(_0x13324e[_0x4599('0x32')][_0x4599('0x3e')]){_0x451625[_0x4599('0x3f')]=_['merge'](_0x451625[_0x4599('0x3f')],{'$or':_[_0x4599('0x2d')](_0x277834,function(_0x4184bd){if(_0x4184bd[_0x4599('0x40')]!==_0x4599('0x41')){var _0x17c2b8={};_0x17c2b8[_0x4184bd[_0x4599('0x2b')]]={'$like':'%'+_0x13324e[_0x4599('0x32')][_0x4599('0x3e')]+'%'};return _0x17c2b8;}})});}_0x451625=_[_0x4599('0x42')]({},_0x451625,_0x13324e['options']);var _0x36dfc1={'where':_0x451625[_0x4599('0x3f')]};return db[_0x4599('0x2e')]['count'](_0x36dfc1)[_0x4599('0x29')](function(_0x2f939b){_0x1db992['count']=_0x2f939b;if(_0x13324e[_0x4599('0x32')][_0x4599('0x43')]){_0x451625['include']=[{'all':!![]}];}return db[_0x4599('0x2e')][_0x4599('0x44')](_0x451625);})['then'](function(_0x17241d){_0x1db992[_0x4599('0x45')]=_0x17241d;return _0x1db992;})['then'](respondWithFilteredResult(_0x97df17,_0x451625))[_0x4599('0x46')](handleError(_0x97df17,null));};exports[_0x4599('0x47')]=function(_0x4d9c51,_0x4155ab){var _0x453855={'raw':![],'where':{'id':_0x4d9c51[_0x4599('0x48')]['id']}},_0x2fbefe={};_0x2fbefe[_0x4599('0x31')]=_['keys'](db[_0x4599('0x2e')]['rawAttributes']);_0x2fbefe[_0x4599('0x32')]=_[_0x4599('0x33')](_0x4d9c51[_0x4599('0x32')]);_0x2fbefe[_0x4599('0x34')]=_['intersection'](_0x2fbefe[_0x4599('0x31')],_0x2fbefe[_0x4599('0x32')]);_0x453855[_0x4599('0x36')]=_[_0x4599('0x35')](_0x2fbefe[_0x4599('0x31')],qs[_0x4599('0x37')](_0x4d9c51[_0x4599('0x32')][_0x4599('0x37')]));_0x453855[_0x4599('0x36')]=_0x453855['attributes']['length']?_0x453855[_0x4599('0x36')]:_0x2fbefe['model'];if(_0x4d9c51[_0x4599('0x32')][_0x4599('0x43')]){_0x453855[_0x4599('0x49')]=[{'all':!![]}];}_0x453855=_[_0x4599('0x42')]({},_0x453855,_0x4d9c51[_0x4599('0x4a')]);return db[_0x4599('0x2e')]['find'](_0x453855)[_0x4599('0x29')](handleEntityNotFound(_0x4155ab,null))[_0x4599('0x29')](respondWithResult(_0x4155ab,null))[_0x4599('0x46')](handleError(_0x4155ab,null));};exports[_0x4599('0x4b')]=function(_0x574332,_0x44d0fb){return db[_0x4599('0x2e')][_0x4599('0x4b')](_0x574332[_0x4599('0x4c')],{})[_0x4599('0x29')](respondWithResult(_0x44d0fb,0xc9))[_0x4599('0x46')](handleError(_0x44d0fb,null));};exports[_0x4599('0x28')]=function(_0x116481,_0x5a3c94){if(_0x116481['body']['id']){delete _0x116481[_0x4599('0x4c')]['id'];}return db['FreshsalesConfiguration'][_0x4599('0x4d')]({'where':{'id':_0x116481[_0x4599('0x48')]['id']}})[_0x4599('0x29')](handleEntityNotFound(_0x5a3c94,null))['then'](saveUpdates(_0x116481[_0x4599('0x4c')],null))[_0x4599('0x29')](respondWithResult(_0x5a3c94,null))[_0x4599('0x46')](handleError(_0x5a3c94,null));};exports['destroy']=function(_0x50a37e,_0x1bdd4b){return db[_0x4599('0x2e')]['find']({'where':{'id':_0x50a37e[_0x4599('0x48')]['id']}})[_0x4599('0x29')](handleEntityNotFound(_0x1bdd4b,null))[_0x4599('0x29')](removeEntity(_0x1bdd4b,null))[_0x4599('0x46')](handleError(_0x1bdd4b,null));};exports[_0x4599('0x4e')]=function(_0x29e19a,_0x4808ea,_0x127f48){var _0x2f7a10={};var _0x3bdba9={};var _0x481e80;var _0x330218;return db['FreshsalesConfiguration'][_0x4599('0x4f')]({'where':{'id':_0x29e19a[_0x4599('0x48')]['id']}})[_0x4599('0x29')](handleEntityNotFound(_0x4808ea,null))[_0x4599('0x29')](function(_0x2222b3){if(_0x2222b3){_0x481e80=_0x2222b3;_0x3bdba9['model']=_[_0x4599('0x33')](db[_0x4599('0x50')][_0x4599('0x51')]);_0x3bdba9[_0x4599('0x32')]=_[_0x4599('0x33')](_0x29e19a[_0x4599('0x32')]);_0x3bdba9[_0x4599('0x34')]=_[_0x4599('0x35')](_0x3bdba9['model'],_0x3bdba9['query']);_0x2f7a10[_0x4599('0x36')]=_[_0x4599('0x35')](_0x3bdba9[_0x4599('0x31')],qs[_0x4599('0x37')](_0x29e19a[_0x4599('0x32')][_0x4599('0x37')]));_0x2f7a10[_0x4599('0x36')]=_0x2f7a10[_0x4599('0x36')][_0x4599('0x38')]?_0x2f7a10[_0x4599('0x36')]:_0x3bdba9[_0x4599('0x31')];_0x2f7a10['order']=qs[_0x4599('0x3c')](_0x29e19a[_0x4599('0x32')][_0x4599('0x3c')]);_0x2f7a10['where']=qs[_0x4599('0x34')](_[_0x4599('0x3d')](_0x29e19a['query'],_0x3bdba9[_0x4599('0x34')]));if(_0x29e19a[_0x4599('0x32')][_0x4599('0x3e')]){_0x2f7a10[_0x4599('0x3f')]=_[_0x4599('0x42')](_0x2f7a10[_0x4599('0x3f')],{'$or':_[_0x4599('0x2d')](_0x2f7a10[_0x4599('0x36')],function(_0x52d98b){var _0x12b47e={};_0x12b47e[_0x52d98b]={'$like':'%'+_0x29e19a['query'][_0x4599('0x3e')]+'%'};return _0x12b47e;})});}_0x2f7a10=_[_0x4599('0x42')]({},_0x2f7a10,_0x29e19a[_0x4599('0x4a')]);return _0x481e80[_0x4599('0x4e')](_0x2f7a10);}})[_0x4599('0x29')](function(_0x563728){if(_0x563728){_0x330218=_0x563728[_0x4599('0x38')];if(!_0x29e19a[_0x4599('0x32')][_0x4599('0x39')](_0x4599('0x3a'))){_0x2f7a10[_0x4599('0x22')]=qs[_0x4599('0x22')](_0x29e19a[_0x4599('0x32')]['limit']);_0x2f7a10['offset']=qs[_0x4599('0x20')](_0x29e19a[_0x4599('0x32')][_0x4599('0x20')]);}return _0x481e80[_0x4599('0x4e')](_0x2f7a10);}})[_0x4599('0x29')](function(_0x5a98d5){if(_0x5a98d5){return _0x5a98d5?{'count':_0x330218,'rows':_0x5a98d5}:null;}})[_0x4599('0x29')](respondWithResult(_0x4808ea,null))['catch'](handleError(_0x4808ea,null));};exports[_0x4599('0x52')]=function(_0xcfbbc2,_0x255f58,_0x597dfb){var _0x51a48b={};var _0x36e1b2={};var _0x4b016b;var _0x28ea53;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0xcfbbc2[_0x4599('0x48')]['id']}})[_0x4599('0x29')](handleEntityNotFound(_0x255f58,null))[_0x4599('0x29')](function(_0x514edc){if(_0x514edc){_0x4b016b=_0x514edc;_0x36e1b2[_0x4599('0x31')]=_[_0x4599('0x33')](db[_0x4599('0x50')][_0x4599('0x51')]);_0x36e1b2['query']=_[_0x4599('0x33')](_0xcfbbc2['query']);_0x36e1b2[_0x4599('0x34')]=_[_0x4599('0x35')](_0x36e1b2[_0x4599('0x31')],_0x36e1b2[_0x4599('0x32')]);_0x51a48b[_0x4599('0x36')]=_[_0x4599('0x35')](_0x36e1b2[_0x4599('0x31')],qs['fields'](_0xcfbbc2['query']['fields']));_0x51a48b[_0x4599('0x36')]=_0x51a48b[_0x4599('0x36')][_0x4599('0x38')]?_0x51a48b[_0x4599('0x36')]:_0x36e1b2['model'];_0x51a48b['order']=qs[_0x4599('0x3c')](_0xcfbbc2[_0x4599('0x32')]['sort']);_0x51a48b[_0x4599('0x3f')]=qs['filters'](_[_0x4599('0x3d')](_0xcfbbc2[_0x4599('0x32')],_0x36e1b2[_0x4599('0x34')]));if(_0xcfbbc2[_0x4599('0x32')][_0x4599('0x3e')]){_0x51a48b[_0x4599('0x3f')]=_[_0x4599('0x42')](_0x51a48b[_0x4599('0x3f')],{'$or':_[_0x4599('0x2d')](_0x51a48b[_0x4599('0x36')],function(_0x556408){var _0x4eebc2={};_0x4eebc2[_0x556408]={'$like':'%'+_0xcfbbc2['query'][_0x4599('0x3e')]+'%'};return _0x4eebc2;})});}_0x51a48b=_[_0x4599('0x42')]({},_0x51a48b,_0xcfbbc2[_0x4599('0x4a')]);return _0x4b016b[_0x4599('0x52')](_0x51a48b);}})[_0x4599('0x29')](function(_0x338591){if(_0x338591){_0x28ea53=_0x338591[_0x4599('0x38')];if(!_0xcfbbc2[_0x4599('0x32')][_0x4599('0x39')](_0x4599('0x3a'))){_0x51a48b[_0x4599('0x22')]=qs[_0x4599('0x22')](_0xcfbbc2['query'][_0x4599('0x22')]);_0x51a48b[_0x4599('0x20')]=qs['offset'](_0xcfbbc2[_0x4599('0x32')][_0x4599('0x20')]);}return _0x4b016b[_0x4599('0x52')](_0x51a48b);}})['then'](function(_0x3b745e){if(_0x3b745e){return _0x3b745e?{'count':_0x28ea53,'rows':_0x3b745e}:null;}})['then'](respondWithResult(_0x255f58,null))['catch'](handleError(_0x255f58,null));};exports[_0x4599('0x53')]=function(_0x3bdbb9,_0x3fb546,_0x5f01f6){var _0x2ad034={};var _0x597cbe={};var _0x5748bc;var _0x37f5f5;return db[_0x4599('0x2e')][_0x4599('0x4f')]({'where':{'id':_0x3bdbb9[_0x4599('0x48')]['id']}})[_0x4599('0x29')](handleEntityNotFound(_0x3fb546,null))[_0x4599('0x29')](function(_0x54353d){if(_0x54353d){_0x5748bc=_0x54353d;_0x597cbe[_0x4599('0x31')]=_[_0x4599('0x33')](db[_0x4599('0x50')]['rawAttributes']);_0x597cbe[_0x4599('0x32')]=_[_0x4599('0x33')](_0x3bdbb9[_0x4599('0x32')]);_0x597cbe[_0x4599('0x34')]=_['intersection'](_0x597cbe[_0x4599('0x31')],_0x597cbe['query']);_0x2ad034[_0x4599('0x36')]=_[_0x4599('0x35')](_0x597cbe[_0x4599('0x31')],qs[_0x4599('0x37')](_0x3bdbb9['query']['fields']));_0x2ad034['attributes']=_0x2ad034[_0x4599('0x36')][_0x4599('0x38')]?_0x2ad034[_0x4599('0x36')]:_0x597cbe['model'];_0x2ad034['order']=qs[_0x4599('0x3c')](_0x3bdbb9[_0x4599('0x32')][_0x4599('0x3c')]);_0x2ad034[_0x4599('0x3f')]=qs[_0x4599('0x34')](_['pick'](_0x3bdbb9[_0x4599('0x32')],_0x597cbe['filters']));if(_0x3bdbb9[_0x4599('0x32')][_0x4599('0x3e')]){_0x2ad034[_0x4599('0x3f')]=_[_0x4599('0x42')](_0x2ad034[_0x4599('0x3f')],{'$or':_[_0x4599('0x2d')](_0x2ad034['attributes'],function(_0x17339d){var _0x1fd8f6={};_0x1fd8f6[_0x17339d]={'$like':'%'+_0x3bdbb9[_0x4599('0x32')][_0x4599('0x3e')]+'%'};return _0x1fd8f6;})});}_0x2ad034=_[_0x4599('0x42')]({},_0x2ad034,_0x3bdbb9[_0x4599('0x4a')]);return _0x5748bc[_0x4599('0x53')](_0x2ad034);}})[_0x4599('0x29')](function(_0x58a7e7){if(_0x58a7e7){_0x37f5f5=_0x58a7e7[_0x4599('0x38')];if(!_0x3bdbb9['query'][_0x4599('0x39')](_0x4599('0x3a'))){_0x2ad034[_0x4599('0x22')]=qs['limit'](_0x3bdbb9[_0x4599('0x32')]['limit']);_0x2ad034[_0x4599('0x20')]=qs['offset'](_0x3bdbb9['query']['offset']);}return _0x5748bc['getFields'](_0x2ad034);}})[_0x4599('0x29')](function(_0x3aee78){if(_0x3aee78){return _0x3aee78?{'count':_0x37f5f5,'rows':_0x3aee78}:null;}})['then'](respondWithResult(_0x3fb546,null))[_0x4599('0x46')](handleError(_0x3fb546,null));};
\ No newline at end of file
index d852543..6e88a9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf162=['bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','FreshsalesConfiguration','lodash','../../config/logger','moment'];(function(_0x384185,_0x4b0a83){var _0x166333=function(_0x2fc2b3){while(--_0x2fc2b3){_0x384185['push'](_0x384185['shift']());}};_0x166333(++_0x4b0a83);}(_0xf162,0x1ad));var _0x2f16=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf162[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x2f16('0x0'));var util=require('util');var logger=require(_0x2f16('0x1'))('api');var moment=require(_0x2f16('0x2'));var BPromise=require(_0x2f16('0x3'));var rp=require(_0x2f16('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2f16('0x5'));var config=require(_0x2f16('0x6'));var attributes=require(_0x2f16('0x7'));module['exports']=function(_0x422c9a,_0x9ee841){return _0x422c9a['define'](_0x2f16('0x8'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xca9d=['bluebird','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','api'];(function(_0x3f152b,_0x435cdf){var _0x49dc6e=function(_0x59a0b8){while(--_0x59a0b8){_0x3f152b['push'](_0x3f152b['shift']());}};_0x49dc6e(++_0x435cdf);}(_0xca9d,0x1dd));var _0xdca9=function(_0x87b4d6,_0x31accc){_0x87b4d6=_0x87b4d6-0x0;var _0x4150ad=_0xca9d[_0x87b4d6];return _0x4150ad;};'use strict';var _=require(_0xdca9('0x0'));var util=require('util');var logger=require(_0xdca9('0x1'))(_0xdca9('0x2'));var moment=require('moment');var BPromise=require(_0xdca9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdca9('0x4'));var rimraf=require(_0xdca9('0x5'));var config=require(_0xdca9('0x6'));var attributes=require(_0xdca9('0x7'));module[_0xdca9('0x8')]=function(_0x54a3be,_0x560d30){return _0x54a3be[_0xdca9('0x9')](_0xdca9('0xa'),attributes,{'tableName':_0xdca9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 677500c..3d247a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5b8=['../../config/environment','jayson/promise','client','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x40d2ec,_0x4c3149){var _0x14055a=function(_0x1d223b){while(--_0x1d223b){_0x40d2ec['push'](_0x40d2ec['shift']());}};_0x14055a(++_0x4c3149);}(_0xb5b8,0xa1));var _0x8b5b=function(_0x2e4bb5,_0x2f8f3a){_0x2e4bb5=_0x2e4bb5-0x0;var _0x5f1bf5=_0xb5b8[_0x2e4bb5];return _0x5f1bf5;};'use strict';var _=require(_0x8b5b('0x0'));var util=require(_0x8b5b('0x1'));var moment=require(_0x8b5b('0x2'));var BPromise=require('bluebird');var rs=require(_0x8b5b('0x3'));var fs=require('fs');var Redis=require(_0x8b5b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8b5b('0x5'));var logger=require(_0x8b5b('0x6'))('rpc');var config=require(_0x8b5b('0x7'));var jayson=require(_0x8b5b('0x8'));var client=jayson[_0x8b5b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x415ec7,_0x577e57,_0x47d97d){return new BPromise(function(_0x2c0589,_0xd2d45f){return client['request'](_0x415ec7,_0x47d97d)[_0x8b5b('0xa')](function(_0x294027){logger[_0x8b5b('0xb')](_0x8b5b('0xc'),_0x577e57,_0x8b5b('0xd'));logger[_0x8b5b('0xe')](_0x8b5b('0xf'),_0x577e57,_0x8b5b('0xd'),JSON[_0x8b5b('0x10')](_0x294027));if(_0x294027[_0x8b5b('0x11')]){if(_0x294027[_0x8b5b('0x11')][_0x8b5b('0x12')]===0x1f4){logger[_0x8b5b('0x11')](_0x8b5b('0xc'),_0x577e57,_0x294027[_0x8b5b('0x11')][_0x8b5b('0x13')]);return _0xd2d45f(_0x294027[_0x8b5b('0x11')][_0x8b5b('0x13')]);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x577e57,_0x294027['error'][_0x8b5b('0x13')]);return _0x2c0589(_0x294027['error']['message']);}else{logger[_0x8b5b('0xb')](_0x8b5b('0xc'),_0x577e57,_0x8b5b('0xd'));_0x2c0589(_0x294027['result'][_0x8b5b('0x13')]);}})[_0x8b5b('0x14')](function(_0x311fd9){logger[_0x8b5b('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x577e57,_0x311fd9);_0xd2d45f(_0x311fd9);});});}
\ No newline at end of file
+var _0xdf3f=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis'];(function(_0xd89bde,_0x1c1c03){var _0x62986f=function(_0x5c006e){while(--_0x5c006e){_0xd89bde['push'](_0xd89bde['shift']());}};_0x62986f(++_0x1c1c03);}(_0xdf3f,0x1ef));var _0xfdf3=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0xdf3f[_0x52666e];return _0x515330;};'use strict';var _=require(_0xfdf3('0x0'));var util=require(_0xfdf3('0x1'));var moment=require('moment');var BPromise=require(_0xfdf3('0x2'));var rs=require(_0xfdf3('0x3'));var fs=require('fs');var Redis=require(_0xfdf3('0x4'));var db=require(_0xfdf3('0x5'))['db'];var utils=require(_0xfdf3('0x6'));var logger=require(_0xfdf3('0x7'))('rpc');var config=require(_0xfdf3('0x8'));var jayson=require(_0xfdf3('0x9'));var client=jayson['client'][_0xfdf3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ea33d,_0x17e489,_0x157cc1){return new BPromise(function(_0x3f5c22,_0x2e8888){return client['request'](_0x2ea33d,_0x157cc1)[_0xfdf3('0xb')](function(_0x6c940a){logger[_0xfdf3('0xc')](_0xfdf3('0xd'),_0x17e489,'request\x20sent');logger['debug'](_0xfdf3('0xe'),_0x17e489,_0xfdf3('0xf'),JSON[_0xfdf3('0x10')](_0x6c940a));if(_0x6c940a['error']){if(_0x6c940a[_0xfdf3('0x11')][_0xfdf3('0x12')]===0x1f4){logger[_0xfdf3('0x11')](_0xfdf3('0xd'),_0x17e489,_0x6c940a[_0xfdf3('0x11')][_0xfdf3('0x13')]);return _0x2e8888(_0x6c940a[_0xfdf3('0x11')][_0xfdf3('0x13')]);}logger['error'](_0xfdf3('0xd'),_0x17e489,_0x6c940a[_0xfdf3('0x11')][_0xfdf3('0x13')]);return _0x3f5c22(_0x6c940a[_0xfdf3('0x11')][_0xfdf3('0x13')]);}else{logger[_0xfdf3('0xc')](_0xfdf3('0xd'),_0x17e489,_0xfdf3('0xf'));_0x3f5c22(_0x6c940a['result'][_0xfdf3('0x13')]);}})['catch'](function(_0x1b6944){logger[_0xfdf3('0x11')](_0xfdf3('0xd'),_0x17e489,_0x1b6944);_0x2e8888(_0x1b6944);});});}
\ No newline at end of file
index db47241..85dd970 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x032a=['delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','put','/:id','update'];(function(_0x4b4452,_0x3bed53){var _0x2d35d2=function(_0x2a5b84){while(--_0x2a5b84){_0x4b4452['push'](_0x4b4452['shift']());}};_0x2d35d2(++_0x3bed53);}(_0x032a,0xf0));var _0xa032=function(_0x590b63,_0x14debb){_0x590b63=_0x590b63-0x0;var _0x3c9380=_0x032a[_0x590b63];return _0x3c9380;};'use strict';var multer=require('multer');var util=require(_0xa032('0x0'));var path=require('path');var timeout=require(_0xa032('0x1'));var express=require(_0xa032('0x2'));var router=express[_0xa032('0x3')]();var fs_extra=require(_0xa032('0x4'));var auth=require(_0xa032('0x5'));var interaction=require(_0xa032('0x6'));var config=require(_0xa032('0x7'));var controller=require(_0xa032('0x8'));router[_0xa032('0x9')]('/',auth[_0xa032('0xa')](),controller[_0xa032('0xb')]);router[_0xa032('0x9')]('/:id',auth[_0xa032('0xa')](),controller['show']);router['post']('/',auth[_0xa032('0xa')](),controller['create']);router[_0xa032('0xc')](_0xa032('0xd'),auth[_0xa032('0xa')](),controller[_0xa032('0xe')]);router[_0xa032('0xf')]('/:id',auth[_0xa032('0xa')](),controller[_0xa032('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x4fef=['create','put','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','post'];(function(_0x31e49c,_0x40dca0){var _0x517f53=function(_0x12e587){while(--_0x12e587){_0x31e49c['push'](_0x31e49c['shift']());}};_0x517f53(++_0x40dca0);}(_0x4fef,0x10f));var _0xf4fe=function(_0x55efee,_0x4c0a25){_0x55efee=_0x55efee-0x0;var _0x1bae86=_0x4fef[_0x55efee];return _0x1bae86;};'use strict';var multer=require(_0xf4fe('0x0'));var util=require(_0xf4fe('0x1'));var path=require('path');var timeout=require(_0xf4fe('0x2'));var express=require('express');var router=express[_0xf4fe('0x3')]();var fs_extra=require(_0xf4fe('0x4'));var auth=require(_0xf4fe('0x5'));var interaction=require(_0xf4fe('0x6'));var config=require(_0xf4fe('0x7'));var controller=require(_0xf4fe('0x8'));router[_0xf4fe('0x9')]('/',auth[_0xf4fe('0xa')](),controller['index']);router[_0xf4fe('0x9')](_0xf4fe('0xb'),auth['isAuthenticated'](),controller[_0xf4fe('0xc')]);router[_0xf4fe('0xd')]('/',auth[_0xf4fe('0xa')](),controller[_0xf4fe('0xe')]);router[_0xf4fe('0xf')](_0xf4fe('0xb'),auth[_0xf4fe('0xa')](),controller[_0xf4fe('0x10')]);router['delete'](_0xf4fe('0xb'),auth['isAuthenticated'](),controller[_0xf4fe('0x11')]);module[_0xf4fe('0x12')]=router;
\ No newline at end of file
index 14176e6..40b8965 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf175=['customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x4e029c,_0x15806b){var _0x57021b=function(_0x42b0cb){while(--_0x42b0cb){_0x4e029c['push'](_0x4e029c['shift']());}};_0x57021b(++_0x15806b);}(_0xf175,0x1ea));var _0x5f17=function(_0x3ac0de,_0x1fedd2){_0x3ac0de=_0x3ac0de-0x0;var _0x2aa61f=_0xf175[_0x3ac0de];return _0x2aa61f;};'use strict';var Sequelize=require(_0x5f17('0x0'));module[_0x5f17('0x1')]={'type':{'type':Sequelize[_0x5f17('0x2')](_0x5f17('0x3'),_0x5f17('0x4'),_0x5f17('0x5'),_0x5f17('0x6'),'picklist'),'defaultValue':_0x5f17('0x3')},'content':{'type':Sequelize[_0x5f17('0x7')]},'key':{'type':Sequelize[_0x5f17('0x7')]},'keyType':{'type':Sequelize[_0x5f17('0x2')](_0x5f17('0x3'),_0x5f17('0x4'),_0x5f17('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5f17('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5f17('0x7')]}};
\ No newline at end of file
+var _0xc241=['string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue','picklist'];(function(_0x4685b3,_0x2ba1f6){var _0x5db309=function(_0x55437f){while(--_0x55437f){_0x4685b3['push'](_0x4685b3['shift']());}};_0x5db309(++_0x2ba1f6);}(_0xc241,0x108));var _0x1c24=function(_0x2a123a,_0x1982ef){_0x2a123a=_0x2a123a-0x0;var _0x3ee4f0=_0xc241[_0x2a123a];return _0x3ee4f0;};'use strict';var Sequelize=require(_0x1c24('0x0'));module[_0x1c24('0x1')]={'type':{'type':Sequelize[_0x1c24('0x2')]('string',_0x1c24('0x3'),'customVariable',_0x1c24('0x4'),_0x1c24('0x5')),'defaultValue':_0x1c24('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1c24('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x1c24('0x3'),_0x1c24('0x8'))},'keyContent':{'type':Sequelize[_0x1c24('0x7')]},'idField':{'type':Sequelize[_0x1c24('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1c24('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 020e7e2..af33339 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34ad=['options','FreshsalesField','includeAll','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','where','merge','type'];(function(_0x14f4bb,_0x32c8b2){var _0x15c019=function(_0x5d780d){while(--_0x5d780d){_0x14f4bb['push'](_0x14f4bb['shift']());}};_0x15c019(++_0x32c8b2);}(_0x34ad,0x13f));var _0xd34a=function(_0x1b33ec,_0x4c5bb3){_0x1b33ec=_0x1b33ec-0x0;var _0x36c0a4=_0x34ad[_0x1b33ec];return _0x36c0a4;};'use strict';var emlformat=require(_0xd34a('0x0'));var rimraf=require(_0xd34a('0x1'));var zipdir=require(_0xd34a('0x2'));var jsonpatch=require(_0xd34a('0x3'));var rp=require(_0xd34a('0x4'));var moment=require(_0xd34a('0x5'));var BPromise=require(_0xd34a('0x6'));var Mustache=require(_0xd34a('0x7'));var util=require(_0xd34a('0x8'));var path=require('path');var sox=require(_0xd34a('0x9'));var csv=require('to-csv');var ejs=require(_0xd34a('0xa'));var fs=require('fs');var fs_extra=require(_0xd34a('0xb'));var _=require(_0xd34a('0xc'));var squel=require(_0xd34a('0xd'));var crypto=require(_0xd34a('0xe'));var jsforce=require(_0xd34a('0xf'));var deskjs=require(_0xd34a('0x10'));var toCsv=require('to-csv');var querystring=require(_0xd34a('0x11'));var Papa=require(_0xd34a('0x12'));var Redis=require(_0xd34a('0x13'));var authService=require(_0xd34a('0x14'));var qs=require(_0xd34a('0x15'));var as=require(_0xd34a('0x16'));var hardwareService=require(_0xd34a('0x17'));var logger=require('../../config/logger')(_0xd34a('0x18'));var utils=require('../../config/utils');var config=require(_0xd34a('0x19'));var licenseUtil=require(_0xd34a('0x1a'));var db=require(_0xd34a('0x1b'))['db'];function respondWithStatusCode(_0x4a2cad,_0x24a63a){_0x24a63a=_0x24a63a||0xcc;return function(_0x11f195){if(_0x11f195){return _0x4a2cad['sendStatus'](_0x24a63a);}return _0x4a2cad['status'](_0x24a63a)[_0xd34a('0x1c')]();};}function respondWithResult(_0x3a7866,_0x17c562){_0x17c562=_0x17c562||0xc8;return function(_0x1b2fb8){if(_0x1b2fb8){return _0x3a7866['status'](_0x17c562)[_0xd34a('0x1d')](_0x1b2fb8);}};}function respondWithFilteredResult(_0x575e8e,_0x59ba70){return function(_0xca4888){if(_0xca4888){var _0x106dff=typeof _0x59ba70[_0xd34a('0x1e')]===_0xd34a('0x1f')&&typeof _0x59ba70[_0xd34a('0x20')]===_0xd34a('0x1f');var _0x1ea836=_0xca4888['count'];var _0x256490=_0x106dff?0x0:_0x59ba70[_0xd34a('0x1e')];var _0x1c546e=_0x106dff?_0xca4888[_0xd34a('0x21')]:_0x59ba70[_0xd34a('0x1e')]+_0x59ba70[_0xd34a('0x20')];var _0x5c906b;if(_0x1c546e>=_0x1ea836){_0x1c546e=_0x1ea836;_0x5c906b=0xc8;}else{_0x5c906b=0xce;}_0x575e8e[_0xd34a('0x22')](_0x5c906b);return _0x575e8e[_0xd34a('0x23')](_0xd34a('0x24'),_0x256490+'-'+_0x1c546e+'/'+_0x1ea836)[_0xd34a('0x1d')](_0xca4888);}return null;};}function patchUpdates(_0x1b8146){return function(_0x52c62b){try{jsonpatch[_0xd34a('0x25')](_0x52c62b,_0x1b8146,!![]);}catch(_0x45c00b){return BPromise[_0xd34a('0x26')](_0x45c00b);}return _0x52c62b[_0xd34a('0x27')]();};}function saveUpdates(_0x2ba58c,_0x4b7e55){return function(_0x374779){if(_0x374779){return _0x374779[_0xd34a('0x28')](_0x2ba58c)[_0xd34a('0x29')](function(_0x54b708){return _0x54b708;});}return null;};}function removeEntity(_0x441687,_0x23944b){return function(_0x447434){if(_0x447434){return _0x447434[_0xd34a('0x2a')]()[_0xd34a('0x29')](function(){_0x441687[_0xd34a('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ed77d,_0x475bf0){return function(_0x36a5b2){if(!_0x36a5b2){_0x4ed77d[_0xd34a('0x2b')](0x194);}return _0x36a5b2;};}function handleError(_0x3a17b9,_0x2ea0cd){_0x2ea0cd=_0x2ea0cd||0x1f4;return function(_0x92d0bb){logger[_0xd34a('0x2c')](_0x92d0bb[_0xd34a('0x2d')]);if(_0x92d0bb['name']){delete _0x92d0bb[_0xd34a('0x2e')];}_0x3a17b9['status'](_0x2ea0cd)[_0xd34a('0x2f')](_0x92d0bb);};}exports['index']=function(_0x21a888,_0x1ae242){var _0x567d33={},_0x5c69b3={},_0x34a049={'count':0x0,'rows':[]};var _0x582696=_[_0xd34a('0x30')](db['FreshsalesField'][_0xd34a('0x31')],function(_0x4eb702){return{'name':_0x4eb702[_0xd34a('0x32')],'type':_0x4eb702['type']['key']};});_0x5c69b3[_0xd34a('0x33')]=_['map'](_0x582696,'name');_0x5c69b3[_0xd34a('0x34')]=_[_0xd34a('0x35')](_0x21a888[_0xd34a('0x34')]);_0x5c69b3[_0xd34a('0x36')]=_[_0xd34a('0x37')](_0x5c69b3[_0xd34a('0x33')],_0x5c69b3['query']);_0x567d33[_0xd34a('0x38')]=_[_0xd34a('0x37')](_0x5c69b3[_0xd34a('0x33')],qs[_0xd34a('0x39')](_0x21a888[_0xd34a('0x34')][_0xd34a('0x39')]));_0x567d33[_0xd34a('0x38')]=_0x567d33[_0xd34a('0x38')][_0xd34a('0x3a')]?_0x567d33['attributes']:_0x5c69b3[_0xd34a('0x33')];if(!_0x21a888[_0xd34a('0x34')]['hasOwnProperty'](_0xd34a('0x3b'))){_0x567d33['limit']=qs[_0xd34a('0x20')](_0x21a888['query'][_0xd34a('0x20')]);_0x567d33['offset']=qs['offset'](_0x21a888[_0xd34a('0x34')]['offset']);}_0x567d33['order']=qs[_0xd34a('0x3c')](_0x21a888[_0xd34a('0x34')][_0xd34a('0x3c')]);_0x567d33['where']=qs[_0xd34a('0x36')](_[_0xd34a('0x3d')](_0x21a888['query'],_0x5c69b3[_0xd34a('0x36')]),_0x582696);if(_0x21a888[_0xd34a('0x34')][_0xd34a('0x3e')]){_0x567d33[_0xd34a('0x3f')]=_[_0xd34a('0x40')](_0x567d33[_0xd34a('0x3f')],{'$or':_[_0xd34a('0x30')](_0x582696,function(_0x3ddb8b){if(_0x3ddb8b[_0xd34a('0x41')]!=='VIRTUAL'){var _0x24b772={};_0x24b772[_0x3ddb8b[_0xd34a('0x2e')]]={'$like':'%'+_0x21a888['query'][_0xd34a('0x3e')]+'%'};return _0x24b772;}})});}_0x567d33=_[_0xd34a('0x40')]({},_0x567d33,_0x21a888[_0xd34a('0x42')]);var _0x2a04f1={'where':_0x567d33['where']};return db[_0xd34a('0x43')][_0xd34a('0x21')](_0x2a04f1)[_0xd34a('0x29')](function(_0x57dc46){_0x34a049[_0xd34a('0x21')]=_0x57dc46;if(_0x21a888[_0xd34a('0x34')][_0xd34a('0x44')]){_0x567d33['include']=[{'all':!![]}];}return db[_0xd34a('0x43')][_0xd34a('0x45')](_0x567d33);})[_0xd34a('0x29')](function(_0x49a953){_0x34a049[_0xd34a('0x46')]=_0x49a953;return _0x34a049;})['then'](respondWithFilteredResult(_0x1ae242,_0x567d33))['catch'](handleError(_0x1ae242,null));};exports[_0xd34a('0x47')]=function(_0x2ff377,_0x4eb566){var _0x59e33c={'raw':!![],'where':{'id':_0x2ff377[_0xd34a('0x48')]['id']}},_0x48bbf7={};_0x48bbf7[_0xd34a('0x33')]=_['keys'](db[_0xd34a('0x43')][_0xd34a('0x31')]);_0x48bbf7['query']=_[_0xd34a('0x35')](_0x2ff377[_0xd34a('0x34')]);_0x48bbf7['filters']=_['intersection'](_0x48bbf7['model'],_0x48bbf7[_0xd34a('0x34')]);_0x59e33c[_0xd34a('0x38')]=_[_0xd34a('0x37')](_0x48bbf7[_0xd34a('0x33')],qs[_0xd34a('0x39')](_0x2ff377[_0xd34a('0x34')][_0xd34a('0x39')]));_0x59e33c[_0xd34a('0x38')]=_0x59e33c['attributes'][_0xd34a('0x3a')]?_0x59e33c[_0xd34a('0x38')]:_0x48bbf7[_0xd34a('0x33')];if(_0x2ff377['query'][_0xd34a('0x44')]){_0x59e33c['include']=[{'all':!![]}];}_0x59e33c=_['merge']({},_0x59e33c,_0x2ff377['options']);return db[_0xd34a('0x43')][_0xd34a('0x49')](_0x59e33c)[_0xd34a('0x29')](handleEntityNotFound(_0x4eb566,null))[_0xd34a('0x29')](respondWithResult(_0x4eb566,null))[_0xd34a('0x4a')](handleError(_0x4eb566,null));};exports[_0xd34a('0x4b')]=function(_0x301282,_0x347c18){return db[_0xd34a('0x43')][_0xd34a('0x4b')](_0x301282['body'],{})[_0xd34a('0x29')](respondWithResult(_0x347c18,0xc9))[_0xd34a('0x4a')](handleError(_0x347c18,null));};exports['update']=function(_0x42362b,_0x596dc2){if(_0x42362b[_0xd34a('0x4c')]['id']){delete _0x42362b[_0xd34a('0x4c')]['id'];}return db[_0xd34a('0x43')][_0xd34a('0x49')]({'where':{'id':_0x42362b[_0xd34a('0x48')]['id']}})[_0xd34a('0x29')](handleEntityNotFound(_0x596dc2,null))[_0xd34a('0x29')](saveUpdates(_0x42362b[_0xd34a('0x4c')],null))[_0xd34a('0x29')](respondWithResult(_0x596dc2,null))['catch'](handleError(_0x596dc2,null));};exports[_0xd34a('0x2a')]=function(_0x5d4ff8,_0x46dea7){return db[_0xd34a('0x43')][_0xd34a('0x49')]({'where':{'id':_0x5d4ff8['params']['id']}})[_0xd34a('0x29')](handleEntityNotFound(_0x46dea7,null))[_0xd34a('0x29')](removeEntity(_0x46dea7,null))[_0xd34a('0x4a')](handleError(_0x46dea7,null));};
\ No newline at end of file
+var _0x0072=['Content-Range','reject','save','update','then','destroy','stack','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','find','create','catch','body','params','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x511b76,_0x4727fa){var _0x5424ff=function(_0x24b7c0){while(--_0x24b7c0){_0x511b76['push'](_0x511b76['shift']());}};_0x5424ff(++_0x4727fa);}(_0x0072,0xfc));var _0x2007=function(_0x5c4b6a,_0x3e4163){_0x5c4b6a=_0x5c4b6a-0x0;var _0x2dec05=_0x0072[_0x5c4b6a];return _0x2dec05;};'use strict';var emlformat=require(_0x2007('0x0'));var rimraf=require(_0x2007('0x1'));var zipdir=require(_0x2007('0x2'));var jsonpatch=require(_0x2007('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2007('0x4'));var util=require(_0x2007('0x5'));var path=require(_0x2007('0x6'));var sox=require('sox');var csv=require(_0x2007('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2007('0x8'));var _=require(_0x2007('0x9'));var squel=require(_0x2007('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2007('0xb'));var toCsv=require(_0x2007('0x7'));var querystring=require(_0x2007('0xc'));var Papa=require('papaparse');var Redis=require(_0x2007('0xd'));var authService=require(_0x2007('0xe'));var qs=require(_0x2007('0xf'));var as=require(_0x2007('0x10'));var hardwareService=require(_0x2007('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2007('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x2007('0x13'))['db'];function respondWithStatusCode(_0x469ac0,_0x53a661){_0x53a661=_0x53a661||0xcc;return function(_0x9e0d3d){if(_0x9e0d3d){return _0x469ac0[_0x2007('0x14')](_0x53a661);}return _0x469ac0[_0x2007('0x15')](_0x53a661)['end']();};}function respondWithResult(_0x56b722,_0x400db9){_0x400db9=_0x400db9||0xc8;return function(_0x3680b5){if(_0x3680b5){return _0x56b722[_0x2007('0x15')](_0x400db9)[_0x2007('0x16')](_0x3680b5);}};}function respondWithFilteredResult(_0x3ccd6d,_0x266a37){return function(_0x3a8e16){if(_0x3a8e16){var _0x506e12=typeof _0x266a37[_0x2007('0x17')]===_0x2007('0x18')&&typeof _0x266a37[_0x2007('0x19')]===_0x2007('0x18');var _0x37c97e=_0x3a8e16[_0x2007('0x1a')];var _0x46d261=_0x506e12?0x0:_0x266a37[_0x2007('0x17')];var _0x39a779=_0x506e12?_0x3a8e16['count']:_0x266a37[_0x2007('0x17')]+_0x266a37['limit'];var _0x577575;if(_0x39a779>=_0x37c97e){_0x39a779=_0x37c97e;_0x577575=0xc8;}else{_0x577575=0xce;}_0x3ccd6d[_0x2007('0x15')](_0x577575);return _0x3ccd6d[_0x2007('0x1b')](_0x2007('0x1c'),_0x46d261+'-'+_0x39a779+'/'+_0x37c97e)[_0x2007('0x16')](_0x3a8e16);}return null;};}function patchUpdates(_0xe6eaa7){return function(_0x22a4e1){try{jsonpatch['apply'](_0x22a4e1,_0xe6eaa7,!![]);}catch(_0x280fa2){return BPromise[_0x2007('0x1d')](_0x280fa2);}return _0x22a4e1[_0x2007('0x1e')]();};}function saveUpdates(_0x1a0a35,_0x29b932){return function(_0x5c6b35){if(_0x5c6b35){return _0x5c6b35[_0x2007('0x1f')](_0x1a0a35)[_0x2007('0x20')](function(_0x121284){return _0x121284;});}return null;};}function removeEntity(_0x21ddc6,_0x5f1004){return function(_0xc8efba){if(_0xc8efba){return _0xc8efba[_0x2007('0x21')]()[_0x2007('0x20')](function(){_0x21ddc6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f3413,_0x42bd00){return function(_0x1e71cb){if(!_0x1e71cb){_0x3f3413[_0x2007('0x14')](0x194);}return _0x1e71cb;};}function handleError(_0x1a02c6,_0x17307e){_0x17307e=_0x17307e||0x1f4;return function(_0x5f028e){logger['error'](_0x5f028e[_0x2007('0x22')]);if(_0x5f028e['name']){delete _0x5f028e['name'];}_0x1a02c6[_0x2007('0x15')](_0x17307e)[_0x2007('0x23')](_0x5f028e);};}exports[_0x2007('0x24')]=function(_0x51b999,_0x23fba9){var _0x1a1af6={},_0xebdd00={},_0x575c6e={'count':0x0,'rows':[]};var _0x3d5e55=_[_0x2007('0x25')](db[_0x2007('0x26')][_0x2007('0x27')],function(_0x1ac56d){return{'name':_0x1ac56d[_0x2007('0x28')],'type':_0x1ac56d[_0x2007('0x29')][_0x2007('0x2a')]};});_0xebdd00[_0x2007('0x2b')]=_[_0x2007('0x25')](_0x3d5e55,'name');_0xebdd00[_0x2007('0x2c')]=_[_0x2007('0x2d')](_0x51b999[_0x2007('0x2c')]);_0xebdd00['filters']=_[_0x2007('0x2e')](_0xebdd00[_0x2007('0x2b')],_0xebdd00[_0x2007('0x2c')]);_0x1a1af6[_0x2007('0x2f')]=_[_0x2007('0x2e')](_0xebdd00[_0x2007('0x2b')],qs[_0x2007('0x30')](_0x51b999['query'][_0x2007('0x30')]));_0x1a1af6[_0x2007('0x2f')]=_0x1a1af6[_0x2007('0x2f')][_0x2007('0x31')]?_0x1a1af6['attributes']:_0xebdd00['model'];if(!_0x51b999['query'][_0x2007('0x32')](_0x2007('0x33'))){_0x1a1af6[_0x2007('0x19')]=qs[_0x2007('0x19')](_0x51b999[_0x2007('0x2c')]['limit']);_0x1a1af6[_0x2007('0x17')]=qs['offset'](_0x51b999['query'][_0x2007('0x17')]);}_0x1a1af6[_0x2007('0x34')]=qs[_0x2007('0x35')](_0x51b999['query'][_0x2007('0x35')]);_0x1a1af6[_0x2007('0x36')]=qs[_0x2007('0x37')](_[_0x2007('0x38')](_0x51b999['query'],_0xebdd00[_0x2007('0x37')]),_0x3d5e55);if(_0x51b999[_0x2007('0x2c')][_0x2007('0x39')]){_0x1a1af6[_0x2007('0x36')]=_[_0x2007('0x3a')](_0x1a1af6[_0x2007('0x36')],{'$or':_['map'](_0x3d5e55,function(_0x444734){if(_0x444734[_0x2007('0x29')]!==_0x2007('0x3b')){var _0x57d6b9={};_0x57d6b9[_0x444734['name']]={'$like':'%'+_0x51b999[_0x2007('0x2c')][_0x2007('0x39')]+'%'};return _0x57d6b9;}})});}_0x1a1af6=_[_0x2007('0x3a')]({},_0x1a1af6,_0x51b999[_0x2007('0x3c')]);var _0x4fa31e={'where':_0x1a1af6[_0x2007('0x36')]};return db[_0x2007('0x26')][_0x2007('0x1a')](_0x4fa31e)[_0x2007('0x20')](function(_0x387aff){_0x575c6e[_0x2007('0x1a')]=_0x387aff;if(_0x51b999['query'][_0x2007('0x3d')]){_0x1a1af6[_0x2007('0x3e')]=[{'all':!![]}];}return db[_0x2007('0x26')][_0x2007('0x3f')](_0x1a1af6);})[_0x2007('0x20')](function(_0x338af1){_0x575c6e['rows']=_0x338af1;return _0x575c6e;})[_0x2007('0x20')](respondWithFilteredResult(_0x23fba9,_0x1a1af6))['catch'](handleError(_0x23fba9,null));};exports[_0x2007('0x40')]=function(_0x4e6d61,_0x5327a4){var _0x93fa50={'raw':!![],'where':{'id':_0x4e6d61['params']['id']}},_0x53c1c9={};_0x53c1c9[_0x2007('0x2b')]=_['keys'](db[_0x2007('0x26')][_0x2007('0x27')]);_0x53c1c9[_0x2007('0x2c')]=_['keys'](_0x4e6d61[_0x2007('0x2c')]);_0x53c1c9['filters']=_[_0x2007('0x2e')](_0x53c1c9['model'],_0x53c1c9['query']);_0x93fa50['attributes']=_[_0x2007('0x2e')](_0x53c1c9[_0x2007('0x2b')],qs[_0x2007('0x30')](_0x4e6d61['query'][_0x2007('0x30')]));_0x93fa50['attributes']=_0x93fa50['attributes'][_0x2007('0x31')]?_0x93fa50['attributes']:_0x53c1c9['model'];if(_0x4e6d61[_0x2007('0x2c')][_0x2007('0x3d')]){_0x93fa50[_0x2007('0x3e')]=[{'all':!![]}];}_0x93fa50=_[_0x2007('0x3a')]({},_0x93fa50,_0x4e6d61[_0x2007('0x3c')]);return db[_0x2007('0x26')][_0x2007('0x41')](_0x93fa50)[_0x2007('0x20')](handleEntityNotFound(_0x5327a4,null))[_0x2007('0x20')](respondWithResult(_0x5327a4,null))['catch'](handleError(_0x5327a4,null));};exports[_0x2007('0x42')]=function(_0x53d2de,_0x2c1cb7){return db[_0x2007('0x26')][_0x2007('0x42')](_0x53d2de['body'],{})['then'](respondWithResult(_0x2c1cb7,0xc9))[_0x2007('0x43')](handleError(_0x2c1cb7,null));};exports[_0x2007('0x1f')]=function(_0x22b0d2,_0x341718){if(_0x22b0d2[_0x2007('0x44')]['id']){delete _0x22b0d2[_0x2007('0x44')]['id'];}return db[_0x2007('0x26')]['find']({'where':{'id':_0x22b0d2['params']['id']}})[_0x2007('0x20')](handleEntityNotFound(_0x341718,null))[_0x2007('0x20')](saveUpdates(_0x22b0d2[_0x2007('0x44')],null))[_0x2007('0x20')](respondWithResult(_0x341718,null))['catch'](handleError(_0x341718,null));};exports[_0x2007('0x21')]=function(_0x5c3de7,_0x17630){return db[_0x2007('0x26')][_0x2007('0x41')]({'where':{'id':_0x5c3de7[_0x2007('0x45')]['id']}})['then'](handleEntityNotFound(_0x17630,null))[_0x2007('0x20')](removeEntity(_0x17630,null))[_0x2007('0x43')](handleError(_0x17630,null));};
\ No newline at end of file
index 77d1353..eb734f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae24=['./intFreshsalesField.attributes','exports','define','FreshsalesField','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xf021d9,_0x5f51a9){var _0xcbc18=function(_0x427d6f){while(--_0x427d6f){_0xf021d9['push'](_0xf021d9['shift']());}};_0xcbc18(++_0x5f51a9);}(_0xae24,0x180));var _0x4ae2=function(_0x5d4690,_0x1b5906){_0x5d4690=_0x5d4690-0x0;var _0x20560a=_0xae24[_0x5d4690];return _0x20560a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4ae2('0x0'))(_0x4ae2('0x1'));var moment=require(_0x4ae2('0x2'));var BPromise=require(_0x4ae2('0x3'));var rp=require(_0x4ae2('0x4'));var fs=require('fs');var path=require(_0x4ae2('0x5'));var rimraf=require(_0x4ae2('0x6'));var config=require(_0x4ae2('0x7'));var attributes=require(_0x4ae2('0x8'));module[_0x4ae2('0x9')]=function(_0x526b01,_0x497634){return _0x526b01[_0x4ae2('0xa')](_0x4ae2('0xb'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x4ae2('0xc'),_0x4ae2('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa057=['define','FreshsalesField','freshsales_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','path','rimraf','./intFreshsalesField.attributes'];(function(_0xb7a459,_0xc13228){var _0x104ab5=function(_0x186a0e){while(--_0x186a0e){_0xb7a459['push'](_0xb7a459['shift']());}};_0x104ab5(++_0xc13228);}(_0xa057,0x123));var _0x7a05=function(_0x337a0e,_0x506395){_0x337a0e=_0x337a0e-0x0;var _0x4baf24=_0xa057[_0x337a0e];return _0x4baf24;};'use strict';var _=require(_0x7a05('0x0'));var util=require(_0x7a05('0x1'));var logger=require('../../config/logger')(_0x7a05('0x2'));var moment=require(_0x7a05('0x3'));var BPromise=require(_0x7a05('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7a05('0x5'));var rimraf=require(_0x7a05('0x6'));var config=require('../../config/environment');var attributes=require(_0x7a05('0x7'));module['exports']=function(_0x599a35,_0x1f3b61){return _0x599a35[_0x7a05('0x8')](_0x7a05('0x9'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x7a05('0xa'),'fields':[_0x7a05('0xb'),_0x7a05('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index ba5d826..187148d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdbd=['info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then'];(function(_0x422319,_0xb0e1b5){var _0x31433c=function(_0x340b6d){while(--_0x340b6d){_0x422319['push'](_0x422319['shift']());}};_0x31433c(++_0xb0e1b5);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x5c12f2,_0x5de043){_0x5c12f2=_0x5c12f2-0x0;var _0x5e8344=_0xfdbd[_0x5c12f2];return _0x5e8344;};'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 Redis=require(_0xdfdb('0x5'));var db=require(_0xdfdb('0x6'))['db'];var utils=require(_0xdfdb('0x7'));var logger=require(_0xdfdb('0x8'))('rpc');var config=require(_0xdfdb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdfdb('0xa')][_0xdfdb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x489f19,_0x556dc0,_0x590b5d){return new BPromise(function(_0x188508,_0xf72a24){return client['request'](_0x489f19,_0x590b5d)[_0xdfdb('0xc')](function(_0x444c19){logger[_0xdfdb('0xd')](_0xdfdb('0xe'),_0x556dc0,_0xdfdb('0xf'));logger[_0xdfdb('0x10')](_0xdfdb('0x11'),_0x556dc0,'request\x20sent',JSON[_0xdfdb('0x12')](_0x444c19));if(_0x444c19[_0xdfdb('0x13')]){if(_0x444c19['error'][_0xdfdb('0x14')]===0x1f4){logger[_0xdfdb('0x13')](_0xdfdb('0xe'),_0x556dc0,_0x444c19[_0xdfdb('0x13')][_0xdfdb('0x15')]);return _0xf72a24(_0x444c19[_0xdfdb('0x13')][_0xdfdb('0x15')]);}logger[_0xdfdb('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x556dc0,_0x444c19['error'][_0xdfdb('0x15')]);return _0x188508(_0x444c19['error'][_0xdfdb('0x15')]);}else{logger[_0xdfdb('0xd')](_0xdfdb('0xe'),_0x556dc0,_0xdfdb('0xf'));_0x188508(_0x444c19[_0xdfdb('0x16')][_0xdfdb('0x15')]);}})['catch'](function(_0x4fd3d5){logger[_0xdfdb('0x13')](_0xdfdb('0xe'),_0x556dc0,_0x4fd3d5);_0xf72a24(_0x4fd3d5);});});}
\ No newline at end of file
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x4715b7,_0x4dedec){var _0x11d72a=function(_0x393699){while(--_0x393699){_0x4715b7['push'](_0x4715b7['shift']());}};_0x11d72a(++_0x4dedec);}(_0x2ef3,0xba));var _0x32ef=function(_0x23ec49,_0x23dcd3){_0x23ec49=_0x23ec49-0x0;var _0x13be68=_0x2ef3[_0x23ec49];return _0x13be68;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
index 142253e..7eea47e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1379ee,_0x176af0){var _0x135dc3=function(_0x9340bb){while(--_0x9340bb){_0x1379ee['push'](_0x1379ee['shift']());}};_0x135dc3(++_0x176af0);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x2f754a,_0x11103a){var _0xb30e78=function(_0x384132){while(--_0x384132){_0x2f754a['push'](_0x2f754a['shift']());}};_0xb30e78(++_0x11103a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
index 84ba347..0bbff18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4b6=['newTab','exports','STRING','username','integrationTab'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0xb4b6,0x7e));var _0x6b4b=function(_0x5ebba7,_0x10cb52){_0x5ebba7=_0x5ebba7-0x0;var _0x254bf4=_0xb4b6[_0x5ebba7];return _0x254bf4;};'use strict';var Sequelize=require('sequelize');module[_0x6b4b('0x0')]={'name':{'type':Sequelize[_0x6b4b('0x1')]},'description':{'type':Sequelize[_0x6b4b('0x1')]},'username':{'type':Sequelize[_0x6b4b('0x1')],'unique':_0x6b4b('0x2')},'remoteUri':{'type':Sequelize[_0x6b4b('0x1')]},'password':{'type':Sequelize[_0x6b4b('0x1')]},'clientId':{'type':Sequelize[_0x6b4b('0x1')]},'clientSecret':{'type':Sequelize[_0x6b4b('0x1')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x6b4b('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6b4b('0x3'),_0x6b4b('0x4')),'defaultValue':_0x6b4b('0x3')}};
\ No newline at end of file
+var _0x53aa=['exports','STRING','ENUM','newTab','integrationTab','sequelize'];(function(_0x137bcf,_0x5d9120){var _0x3ffe78=function(_0x420140){while(--_0x420140){_0x137bcf['push'](_0x137bcf['shift']());}};_0x3ffe78(++_0x5d9120);}(_0x53aa,0x167));var _0xa53a=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x53aa[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0xa53a('0x0'));module[_0xa53a('0x1')]={'name':{'type':Sequelize[_0xa53a('0x2')]},'description':{'type':Sequelize[_0xa53a('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0xa53a('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xa53a('0x2')]},'clientSecret':{'type':Sequelize[_0xa53a('0x2')]},'securityToken':{'type':Sequelize[_0xa53a('0x2')]},'serverUrl':{'type':Sequelize[_0xa53a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa53a('0x3')]('integrationTab',_0xa53a('0x4')),'defaultValue':_0xa53a('0x5')}};
\ No newline at end of file
index ea0b965..d86e628 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eb0=['update','getConfigurations','SalesforceConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','SalesforceField','Task','findOne','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','ticketType','OwnerId','IsReminderSet','Description','string','picklist','email','textarea','phone','includes','custom','picklistValues','label','value','boolean','true','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','test','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','map','SalesforceAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','pick','where','merge','filter','options','includeAll','include','findAll','rows','params','find','catch','create','body'];(function(_0xce8bbf,_0x2092b2){var _0x24baae=function(_0x2f8eb4){while(--_0x2f8eb4){_0xce8bbf['push'](_0xce8bbf['shift']());}};_0x24baae(++_0x2092b2);}(_0x3eb0,0x119));var _0x03eb=function(_0x1a6a89,_0x325e45){_0x1a6a89=_0x1a6a89-0x0;var _0x5cd09e=_0x3eb0[_0x1a6a89];return _0x5cd09e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x03eb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x03eb('0x1'));var rp=require(_0x03eb('0x2'));var moment=require(_0x03eb('0x3'));var BPromise=require(_0x03eb('0x4'));var Mustache=require(_0x03eb('0x5'));var util=require(_0x03eb('0x6'));var path=require(_0x03eb('0x7'));var sox=require(_0x03eb('0x8'));var csv=require(_0x03eb('0x9'));var ejs=require(_0x03eb('0xa'));var fs=require('fs');var fs_extra=require(_0x03eb('0xb'));var _=require(_0x03eb('0xc'));var squel=require(_0x03eb('0xd'));var crypto=require(_0x03eb('0xe'));var jsforce=require(_0x03eb('0xf'));var deskjs=require(_0x03eb('0x10'));var toCsv=require(_0x03eb('0x9'));var querystring=require(_0x03eb('0x11'));var Papa=require(_0x03eb('0x12'));var Redis=require(_0x03eb('0x13'));var authService=require(_0x03eb('0x14'));var qs=require(_0x03eb('0x15'));var as=require(_0x03eb('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x03eb('0x17'))('api');var utils=require(_0x03eb('0x18'));var config=require(_0x03eb('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x03eb('0x1a'));function respondWithStatusCode(_0xdd5fcc,_0x36659c){_0x36659c=_0x36659c||0xcc;return function(_0x4ebc34){if(_0x4ebc34){return _0xdd5fcc[_0x03eb('0x1b')](_0x36659c);}return _0xdd5fcc[_0x03eb('0x1c')](_0x36659c)[_0x03eb('0x1d')]();};}function respondWithResult(_0x2a00fe,_0xf14678){_0xf14678=_0xf14678||0xc8;return function(_0x4a14d4){if(_0x4a14d4){return _0x2a00fe[_0x03eb('0x1c')](_0xf14678)[_0x03eb('0x1e')](_0x4a14d4);}};}function respondWithFilteredResult(_0x112a81,_0x2b8533){return function(_0x598ecb){if(_0x598ecb){var _0x11422e=typeof _0x2b8533[_0x03eb('0x1f')]===_0x03eb('0x20')&&typeof _0x2b8533[_0x03eb('0x21')]===_0x03eb('0x20');var _0x31fc4a=_0x598ecb[_0x03eb('0x22')];var _0x3f67e1=_0x11422e?0x0:_0x2b8533[_0x03eb('0x1f')];var _0x8fc50a=_0x11422e?_0x598ecb['count']:_0x2b8533[_0x03eb('0x1f')]+_0x2b8533[_0x03eb('0x21')];var _0x4a5e70;if(_0x8fc50a>=_0x31fc4a){_0x8fc50a=_0x31fc4a;_0x4a5e70=0xc8;}else{_0x4a5e70=0xce;}_0x112a81[_0x03eb('0x1c')](_0x4a5e70);return _0x112a81[_0x03eb('0x23')](_0x03eb('0x24'),_0x3f67e1+'-'+_0x8fc50a+'/'+_0x31fc4a)['json'](_0x598ecb);}return null;};}function patchUpdates(_0x10b17c){return function(_0x35ecc1){try{jsonpatch['apply'](_0x35ecc1,_0x10b17c,!![]);}catch(_0x39215a){return BPromise[_0x03eb('0x25')](_0x39215a);}return _0x35ecc1[_0x03eb('0x26')]();};}function saveUpdates(_0x2661d8,_0x587cc8){return function(_0x2ae26d){if(_0x2ae26d){return _0x2ae26d['update'](_0x2661d8)[_0x03eb('0x27')](function(_0x2eaa03){return _0x2eaa03;});}return null;};}function removeEntity(_0x4fb0a5,_0x4288d8){return function(_0x4cd56f){if(_0x4cd56f){return _0x4cd56f[_0x03eb('0x28')]()[_0x03eb('0x27')](function(){_0x4fb0a5[_0x03eb('0x1c')](0xcc)[_0x03eb('0x1d')]();});}};}function handleEntityNotFound(_0x198bac,_0x1e1a25){return function(_0x4bad91){if(!_0x4bad91){_0x198bac[_0x03eb('0x1b')](0x194);}return _0x4bad91;};}function handleError(_0x33869c,_0x4c99f6){_0x4c99f6=_0x4c99f6||0x1f4;return function(_0x355816){logger[_0x03eb('0x29')](_0x355816[_0x03eb('0x2a')]);if(_0x355816[_0x03eb('0x2b')]){delete _0x355816['name'];}_0x33869c['status'](_0x4c99f6)['send'](_0x355816);};}exports['index']=function(_0x316b61,_0x337d06){var _0x306bd6={},_0x10742a={},_0x369c58={'count':0x0,'rows':[]};var _0x37f24c=_[_0x03eb('0x2c')](db[_0x03eb('0x2d')][_0x03eb('0x2e')],function(_0x296837){return{'name':_0x296837[_0x03eb('0x2f')],'type':_0x296837['type'][_0x03eb('0x30')]};});_0x10742a[_0x03eb('0x31')]=_['map'](_0x37f24c,_0x03eb('0x2b'));_0x10742a[_0x03eb('0x32')]=_[_0x03eb('0x33')](_0x316b61[_0x03eb('0x32')]);_0x10742a[_0x03eb('0x34')]=_[_0x03eb('0x35')](_0x10742a[_0x03eb('0x31')],_0x10742a[_0x03eb('0x32')]);_0x306bd6['attributes']=_['intersection'](_0x10742a[_0x03eb('0x31')],qs[_0x03eb('0x36')](_0x316b61['query']['fields']));_0x306bd6['attributes']=_0x306bd6[_0x03eb('0x37')][_0x03eb('0x38')]?_0x306bd6[_0x03eb('0x37')]:_0x10742a[_0x03eb('0x31')];if(!_0x316b61[_0x03eb('0x32')]['hasOwnProperty'](_0x03eb('0x39'))){_0x306bd6[_0x03eb('0x21')]=qs[_0x03eb('0x21')](_0x316b61[_0x03eb('0x32')][_0x03eb('0x21')]);_0x306bd6[_0x03eb('0x1f')]=qs[_0x03eb('0x1f')](_0x316b61[_0x03eb('0x32')][_0x03eb('0x1f')]);}_0x306bd6['order']=qs[_0x03eb('0x3a')](_0x316b61[_0x03eb('0x32')]['sort']);_0x306bd6['where']=qs[_0x03eb('0x34')](_[_0x03eb('0x3b')](_0x316b61['query'],_0x10742a[_0x03eb('0x34')]),_0x37f24c);if(_0x316b61['query']['filter']){_0x306bd6[_0x03eb('0x3c')]=_[_0x03eb('0x3d')](_0x306bd6[_0x03eb('0x3c')],{'$or':_[_0x03eb('0x2c')](_0x37f24c,function(_0x54fe40){if(_0x54fe40['type']!=='VIRTUAL'){var _0x3c4fda={};_0x3c4fda[_0x54fe40[_0x03eb('0x2b')]]={'$like':'%'+_0x316b61['query'][_0x03eb('0x3e')]+'%'};return _0x3c4fda;}})});}_0x306bd6=_[_0x03eb('0x3d')]({},_0x306bd6,_0x316b61[_0x03eb('0x3f')]);var _0x3bfa9a={'where':_0x306bd6[_0x03eb('0x3c')]};return db[_0x03eb('0x2d')][_0x03eb('0x22')](_0x3bfa9a)[_0x03eb('0x27')](function(_0x20a87d){_0x369c58[_0x03eb('0x22')]=_0x20a87d;if(_0x316b61['query'][_0x03eb('0x40')]){_0x306bd6[_0x03eb('0x41')]=[{'all':!![]}];}return db['SalesforceAccount'][_0x03eb('0x42')](_0x306bd6);})['then'](function(_0x82bf57){_0x369c58[_0x03eb('0x43')]=_0x82bf57;return _0x369c58;})[_0x03eb('0x27')](respondWithFilteredResult(_0x337d06,_0x306bd6))['catch'](handleError(_0x337d06,null));};exports['show']=function(_0xf83f0d,_0x5a8e02){var _0x5bd196={'raw':![],'where':{'id':_0xf83f0d[_0x03eb('0x44')]['id']}},_0x290999={};_0x290999[_0x03eb('0x31')]=_[_0x03eb('0x33')](db[_0x03eb('0x2d')][_0x03eb('0x2e')]);_0x290999[_0x03eb('0x32')]=_[_0x03eb('0x33')](_0xf83f0d[_0x03eb('0x32')]);_0x290999[_0x03eb('0x34')]=_['intersection'](_0x290999[_0x03eb('0x31')],_0x290999[_0x03eb('0x32')]);_0x5bd196[_0x03eb('0x37')]=_[_0x03eb('0x35')](_0x290999[_0x03eb('0x31')],qs[_0x03eb('0x36')](_0xf83f0d['query'][_0x03eb('0x36')]));_0x5bd196[_0x03eb('0x37')]=_0x5bd196[_0x03eb('0x37')][_0x03eb('0x38')]?_0x5bd196[_0x03eb('0x37')]:_0x290999[_0x03eb('0x31')];if(_0xf83f0d[_0x03eb('0x32')][_0x03eb('0x40')]){_0x5bd196['include']=[{'all':!![]}];}_0x5bd196=_['merge']({},_0x5bd196,_0xf83f0d[_0x03eb('0x3f')]);return db[_0x03eb('0x2d')][_0x03eb('0x45')](_0x5bd196)[_0x03eb('0x27')](handleEntityNotFound(_0x5a8e02,null))[_0x03eb('0x27')](respondWithResult(_0x5a8e02,null))[_0x03eb('0x46')](handleError(_0x5a8e02,null));};exports['create']=function(_0xdf8af1,_0x2e949f){return db['SalesforceAccount'][_0x03eb('0x47')](_0xdf8af1[_0x03eb('0x48')],{})[_0x03eb('0x27')](respondWithResult(_0x2e949f,0xc9))[_0x03eb('0x46')](handleError(_0x2e949f,null));};exports[_0x03eb('0x49')]=function(_0x56877b,_0x5e932b){if(_0x56877b[_0x03eb('0x48')]['id']){delete _0x56877b[_0x03eb('0x48')]['id'];}return db[_0x03eb('0x2d')][_0x03eb('0x45')]({'where':{'id':_0x56877b['params']['id']}})[_0x03eb('0x27')](handleEntityNotFound(_0x5e932b,null))[_0x03eb('0x27')](saveUpdates(_0x56877b[_0x03eb('0x48')],null))[_0x03eb('0x27')](respondWithResult(_0x5e932b,null))['catch'](handleError(_0x5e932b,null));};exports['destroy']=function(_0x148b65,_0x188099){return db[_0x03eb('0x2d')][_0x03eb('0x45')]({'where':{'id':_0x148b65['params']['id']}})[_0x03eb('0x27')](handleEntityNotFound(_0x188099,null))[_0x03eb('0x27')](removeEntity(_0x188099,null))['catch'](handleError(_0x188099,null));};exports[_0x03eb('0x4a')]=function(_0x5d718a,_0x295028,_0x3a1c9a){var _0x2868f1={};var _0x5164b9={};var _0x44a17e;var _0x453c18;return db[_0x03eb('0x2d')]['findOne']({'where':{'id':_0x5d718a['params']['id']}})[_0x03eb('0x27')](handleEntityNotFound(_0x295028,null))['then'](function(_0x152d5c){if(_0x152d5c){_0x44a17e=_0x152d5c;_0x5164b9[_0x03eb('0x31')]=_[_0x03eb('0x33')](db[_0x03eb('0x4b')][_0x03eb('0x2e')]);_0x5164b9['query']=_['keys'](_0x5d718a['query']);_0x5164b9[_0x03eb('0x34')]=_[_0x03eb('0x35')](_0x5164b9['model'],_0x5164b9[_0x03eb('0x32')]);_0x2868f1['attributes']=_[_0x03eb('0x35')](_0x5164b9[_0x03eb('0x31')],qs[_0x03eb('0x36')](_0x5d718a[_0x03eb('0x32')][_0x03eb('0x36')]));_0x2868f1[_0x03eb('0x37')]=_0x2868f1[_0x03eb('0x37')]['length']?_0x2868f1[_0x03eb('0x37')]:_0x5164b9[_0x03eb('0x31')];_0x2868f1['order']=qs[_0x03eb('0x3a')](_0x5d718a[_0x03eb('0x32')][_0x03eb('0x3a')]);_0x2868f1['where']=qs[_0x03eb('0x34')](_['pick'](_0x5d718a[_0x03eb('0x32')],_0x5164b9['filters']));if(_0x5d718a['query'][_0x03eb('0x3e')]){_0x2868f1[_0x03eb('0x3c')]=_[_0x03eb('0x3d')](_0x2868f1[_0x03eb('0x3c')],{'$or':_[_0x03eb('0x2c')](_0x2868f1[_0x03eb('0x37')],function(_0x5ed3fa){var _0x1fc165={};_0x1fc165[_0x5ed3fa]={'$like':'%'+_0x5d718a[_0x03eb('0x32')][_0x03eb('0x3e')]+'%'};return _0x1fc165;})});}_0x2868f1=_[_0x03eb('0x3d')]({},_0x2868f1,_0x5d718a[_0x03eb('0x3f')]);return _0x44a17e['getConfigurations'](_0x2868f1);}})[_0x03eb('0x27')](function(_0x281b3c){if(_0x281b3c){_0x453c18=_0x281b3c[_0x03eb('0x38')];if(!_0x5d718a['query'][_0x03eb('0x4c')](_0x03eb('0x39'))){_0x2868f1[_0x03eb('0x21')]=qs[_0x03eb('0x21')](_0x5d718a[_0x03eb('0x32')]['limit']);_0x2868f1[_0x03eb('0x1f')]=qs[_0x03eb('0x1f')](_0x5d718a['query']['offset']);}return _0x44a17e[_0x03eb('0x4a')](_0x2868f1);}})[_0x03eb('0x27')](function(_0x24156e){if(_0x24156e){return _0x24156e?{'count':_0x453c18,'rows':_0x24156e}:null;}})[_0x03eb('0x27')](respondWithResult(_0x295028,null))[_0x03eb('0x46')](handleError(_0x295028,null));};exports[_0x03eb('0x4d')]=function(_0x4fb854,_0x541b1c,_0x35b44f){if(_0x4fb854[_0x03eb('0x48')]['id']){delete _0x4fb854[_0x03eb('0x48')]['id'];}return db['SalesforceAccount']['findOne']({'where':{'id':_0x4fb854[_0x03eb('0x44')]['id']}})[_0x03eb('0x27')](handleEntityNotFound(_0x541b1c,null))['then'](function(_0x6e51b4){if(_0x6e51b4){_0x4fb854['body'][_0x03eb('0x4e')]=_0x6e51b4['id'];_0x4fb854[_0x03eb('0x48')][_0x03eb('0x4f')]=integrations[_0x03eb('0x50')](_0x4fb854['body'][_0x03eb('0x51')],_0x4fb854[_0x03eb('0x48')][_0x03eb('0x52')]);_0x4fb854[_0x03eb('0x48')][_0x03eb('0x53')]=integrations[_0x03eb('0x54')](_0x4fb854[_0x03eb('0x48')][_0x03eb('0x51')],_0x4fb854['body'][_0x03eb('0x52')]);return db['SalesforceConfiguration'][_0x03eb('0x47')](_0x4fb854[_0x03eb('0x48')],{'include':[{'model':db[_0x03eb('0x55')],'as':_0x03eb('0x4f')},{'model':db[_0x03eb('0x55')],'as':_0x03eb('0x53')}]});}return null;})[_0x03eb('0x27')](respondWithResult(_0x541b1c,null))[_0x03eb('0x46')](handleError(_0x541b1c,null));};exports['getFields']=function(_0x10f6e3,_0x4b5f8f,_0x2cb6e5){var _0x223852;var _0x7c1d46='';var _0x4f4306=_0x03eb('0x56');return db[_0x03eb('0x2d')][_0x03eb('0x57')]({'where':{'id':_0x10f6e3[_0x03eb('0x44')]['id']},'attributes':['id',_0x03eb('0x58'),_0x03eb('0x59'),_0x03eb('0x5a'),_0x03eb('0x5b'),_0x03eb('0x5c'),_0x03eb('0x5d')]})['then'](handleEntityNotFound(_0x4b5f8f,null))[_0x03eb('0x27')](function(_0x4b11bc){if(_0x4b11bc){_0x7c1d46=_0x4b11bc[_0x03eb('0x58')];var _0x7c09d6=_0x7c1d46[_0x03eb('0x5e')](-0x1);if(_0x7c09d6==='/'){_0x7c1d46=_0x7c1d46[_0x03eb('0x5f')](0x0,_0x7c1d46['lastIndexOf'](_0x7c09d6));}_0x223852=new jsforce['Connection']({'oauth2':{'loginUrl':_0x7c1d46,'clientId':_0x4b11bc[_0x03eb('0x59')],'clientSecret':_0x4b11bc[_0x03eb('0x5a')]}});return _0x223852['login'](_0x4b11bc[_0x03eb('0x5b')],_0x4b11bc[_0x03eb('0x5c')]['concat'](_0x4b11bc[_0x03eb('0x5d')]));}})['then'](function(_0x31a54c){if(_0x31a54c){if(!_['isNil'](_0x10f6e3[_0x03eb('0x32')][_0x03eb('0x60')])){_0x4f4306=_0x10f6e3[_0x03eb('0x32')][_0x03eb('0x60')];}return _0x223852['sobject'](_0x4f4306)['describe']();}})[_0x03eb('0x27')](function(_0x24f7b3){var _0x1fc682=[_0x03eb('0x61'),'ActivityDate',_0x03eb('0x62'),'IsRecurrence','Subject',_0x03eb('0x63')];var _0x359cb0=[_0x03eb('0x64'),'int',_0x03eb('0x65'),'boolean',_0x03eb('0x66'),_0x03eb('0x67'),_0x03eb('0x68')];if(_0x24f7b3){_['remove'](_0x24f7b3[_0x03eb('0x36')],function(_0x21efea){return _0x1fc682[_0x03eb('0x69')](_0x21efea[_0x03eb('0x2b')])||!_0x359cb0[_0x03eb('0x69')](_0x21efea[_0x03eb('0x52')]);});return{'count':_0x24f7b3[_0x03eb('0x36')][_0x03eb('0x38')],'rows':_[_0x03eb('0x2c')](_0x24f7b3[_0x03eb('0x36')],function(_0x50afe9){return{'id':_0x50afe9[_0x03eb('0x2b')],'name':_0x50afe9['label'],'custom':_0x50afe9[_0x03eb('0x6a')],'options':_0x50afe9[_0x03eb('0x6b')][_0x03eb('0x38')]>0x0?_['map'](_0x50afe9['picklistValues'],function(_0x2720a7){return{'name':_0x2720a7[_0x03eb('0x6c')],'value':_0x2720a7[_0x03eb('0x6d')]};}):_0x50afe9['type']==_0x03eb('0x6e')?[{'name':'True','value':_0x03eb('0x6f')},{'name':'False','value':_0x03eb('0x70')}]:[]};})};}})[_0x03eb('0x27')](respondWithResult(_0x4b5f8f,null))['catch'](function(_0x4803cd){var _0x9238ad=_0x10f6e3['query']['test']?0x1f4:_0x4803cd[_0x03eb('0x71')]||0x1f4;logger[_0x03eb('0x29')](_0x03eb('0x72'),_0x03eb('0x73'),_0x9238ad,JSON[_0x03eb('0x74')](_0x4803cd));delete _0x4803cd[_0x03eb('0x2b')];if(_0x9238ad===0x191){_0x9238ad=0x190;}_0x4b5f8f[_0x03eb('0x1c')](_0x9238ad)['send'](_0x10f6e3[_0x03eb('0x32')][_0x03eb('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0x4803cd[_0x03eb('0x71')]}:_0x4803cd);});};
\ No newline at end of file
+var _0x3cdb=['../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','error','name','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','params','find','create','catch','body','getConfigurations','SalesforceConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Task','username','password','remoteUri','substring','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','picklist','boolean','textarea','phone','remove','includes','label','picklistValues','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x48440c,_0x37f181){var _0x504b61=function(_0x28f6e4){while(--_0x28f6e4){_0x48440c['push'](_0x48440c['shift']());}};_0x504b61(++_0x37f181);}(_0x3cdb,0x69));var _0xb3cd=function(_0x7275e9,_0x321fa5){_0x7275e9=_0x7275e9-0x0;var _0x17b99d=_0x3cdb[_0x7275e9];return _0x17b99d;};'use strict';var emlformat=require(_0xb3cd('0x0'));var rimraf=require(_0xb3cd('0x1'));var zipdir=require(_0xb3cd('0x2'));var jsonpatch=require(_0xb3cd('0x3'));var rp=require(_0xb3cd('0x4'));var moment=require('moment');var BPromise=require(_0xb3cd('0x5'));var Mustache=require(_0xb3cd('0x6'));var util=require(_0xb3cd('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb3cd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb3cd('0x9'));var crypto=require(_0xb3cd('0xa'));var jsforce=require(_0xb3cd('0xb'));var deskjs=require(_0xb3cd('0xc'));var toCsv=require(_0xb3cd('0x8'));var querystring=require('querystring');var Papa=require(_0xb3cd('0xd'));var Redis=require(_0xb3cd('0xe'));var authService=require(_0xb3cd('0xf'));var qs=require(_0xb3cd('0x10'));var as=require(_0xb3cd('0x11'));var hardwareService=require(_0xb3cd('0x12'));var logger=require('../../config/logger')(_0xb3cd('0x13'));var utils=require('../../config/utils');var config=require(_0xb3cd('0x14'));var licenseUtil=require(_0xb3cd('0x15'));var db=require(_0xb3cd('0x16'))['db'];var integrations=require(_0xb3cd('0x17'));function respondWithStatusCode(_0x558f3e,_0x222b0e){_0x222b0e=_0x222b0e||0xcc;return function(_0xf05d4a){if(_0xf05d4a){return _0x558f3e[_0xb3cd('0x18')](_0x222b0e);}return _0x558f3e['status'](_0x222b0e)[_0xb3cd('0x19')]();};}function respondWithResult(_0xdcdc01,_0x5a9cbf){_0x5a9cbf=_0x5a9cbf||0xc8;return function(_0x1e0f7a){if(_0x1e0f7a){return _0xdcdc01[_0xb3cd('0x1a')](_0x5a9cbf)[_0xb3cd('0x1b')](_0x1e0f7a);}};}function respondWithFilteredResult(_0x1ee250,_0x5a820c){return function(_0x3b7015){if(_0x3b7015){var _0x3ceffc=typeof _0x5a820c['offset']===_0xb3cd('0x1c')&&typeof _0x5a820c['limit']===_0xb3cd('0x1c');var _0x3f894b=_0x3b7015[_0xb3cd('0x1d')];var _0x916d60=_0x3ceffc?0x0:_0x5a820c[_0xb3cd('0x1e')];var _0x4fb11d=_0x3ceffc?_0x3b7015['count']:_0x5a820c[_0xb3cd('0x1e')]+_0x5a820c['limit'];var _0x54f5a2;if(_0x4fb11d>=_0x3f894b){_0x4fb11d=_0x3f894b;_0x54f5a2=0xc8;}else{_0x54f5a2=0xce;}_0x1ee250['status'](_0x54f5a2);return _0x1ee250[_0xb3cd('0x1f')](_0xb3cd('0x20'),_0x916d60+'-'+_0x4fb11d+'/'+_0x3f894b)[_0xb3cd('0x1b')](_0x3b7015);}return null;};}function patchUpdates(_0x3b27ea){return function(_0x57190b){try{jsonpatch['apply'](_0x57190b,_0x3b27ea,!![]);}catch(_0x42325c){return BPromise[_0xb3cd('0x21')](_0x42325c);}return _0x57190b[_0xb3cd('0x22')]();};}function saveUpdates(_0x482a96,_0x3c7dc5){return function(_0x582251){if(_0x582251){return _0x582251[_0xb3cd('0x23')](_0x482a96)[_0xb3cd('0x24')](function(_0x411078){return _0x411078;});}return null;};}function removeEntity(_0x350639,_0x35f4a6){return function(_0x4ff6b9){if(_0x4ff6b9){return _0x4ff6b9[_0xb3cd('0x25')]()[_0xb3cd('0x24')](function(){_0x350639['status'](0xcc)[_0xb3cd('0x19')]();});}};}function handleEntityNotFound(_0x196b23,_0x51bd3e){return function(_0x5dfa9f){if(!_0x5dfa9f){_0x196b23['sendStatus'](0x194);}return _0x5dfa9f;};}function handleError(_0x1a5f08,_0x5c623e){_0x5c623e=_0x5c623e||0x1f4;return function(_0x5c5143){logger[_0xb3cd('0x26')](_0x5c5143['stack']);if(_0x5c5143[_0xb3cd('0x27')]){delete _0x5c5143[_0xb3cd('0x27')];}_0x1a5f08['status'](_0x5c623e)['send'](_0x5c5143);};}exports[_0xb3cd('0x28')]=function(_0x31ef38,_0x1ea9be){var _0x25920b={},_0x5162e9={},_0x2a58b3={'count':0x0,'rows':[]};var _0x35f069=_[_0xb3cd('0x29')](db[_0xb3cd('0x2a')][_0xb3cd('0x2b')],function(_0x53ce9f){return{'name':_0x53ce9f[_0xb3cd('0x2c')],'type':_0x53ce9f[_0xb3cd('0x2d')][_0xb3cd('0x2e')]};});_0x5162e9['model']=_['map'](_0x35f069,'name');_0x5162e9['query']=_[_0xb3cd('0x2f')](_0x31ef38[_0xb3cd('0x30')]);_0x5162e9[_0xb3cd('0x31')]=_[_0xb3cd('0x32')](_0x5162e9[_0xb3cd('0x33')],_0x5162e9[_0xb3cd('0x30')]);_0x25920b[_0xb3cd('0x34')]=_[_0xb3cd('0x32')](_0x5162e9['model'],qs['fields'](_0x31ef38[_0xb3cd('0x30')][_0xb3cd('0x35')]));_0x25920b[_0xb3cd('0x34')]=_0x25920b[_0xb3cd('0x34')][_0xb3cd('0x36')]?_0x25920b[_0xb3cd('0x34')]:_0x5162e9[_0xb3cd('0x33')];if(!_0x31ef38[_0xb3cd('0x30')]['hasOwnProperty'](_0xb3cd('0x37'))){_0x25920b[_0xb3cd('0x38')]=qs['limit'](_0x31ef38[_0xb3cd('0x30')][_0xb3cd('0x38')]);_0x25920b['offset']=qs[_0xb3cd('0x1e')](_0x31ef38[_0xb3cd('0x30')]['offset']);}_0x25920b[_0xb3cd('0x39')]=qs[_0xb3cd('0x3a')](_0x31ef38[_0xb3cd('0x30')]['sort']);_0x25920b[_0xb3cd('0x3b')]=qs[_0xb3cd('0x31')](_[_0xb3cd('0x3c')](_0x31ef38[_0xb3cd('0x30')],_0x5162e9[_0xb3cd('0x31')]),_0x35f069);if(_0x31ef38[_0xb3cd('0x30')][_0xb3cd('0x3d')]){_0x25920b['where']=_[_0xb3cd('0x3e')](_0x25920b[_0xb3cd('0x3b')],{'$or':_['map'](_0x35f069,function(_0x20a5a5){if(_0x20a5a5[_0xb3cd('0x2d')]!=='VIRTUAL'){var _0x13fe3a={};_0x13fe3a[_0x20a5a5[_0xb3cd('0x27')]]={'$like':'%'+_0x31ef38[_0xb3cd('0x30')][_0xb3cd('0x3d')]+'%'};return _0x13fe3a;}})});}_0x25920b=_['merge']({},_0x25920b,_0x31ef38[_0xb3cd('0x3f')]);var _0x3f56a6={'where':_0x25920b[_0xb3cd('0x3b')]};return db[_0xb3cd('0x2a')][_0xb3cd('0x1d')](_0x3f56a6)[_0xb3cd('0x24')](function(_0x391f47){_0x2a58b3['count']=_0x391f47;if(_0x31ef38[_0xb3cd('0x30')][_0xb3cd('0x40')]){_0x25920b[_0xb3cd('0x41')]=[{'all':!![]}];}return db[_0xb3cd('0x2a')]['findAll'](_0x25920b);})[_0xb3cd('0x24')](function(_0x448f4e){_0x2a58b3[_0xb3cd('0x42')]=_0x448f4e;return _0x2a58b3;})[_0xb3cd('0x24')](respondWithFilteredResult(_0x1ea9be,_0x25920b))['catch'](handleError(_0x1ea9be,null));};exports['show']=function(_0x333358,_0xcd4dc7){var _0x5bd5a7={'raw':![],'where':{'id':_0x333358[_0xb3cd('0x43')]['id']}},_0x3f601a={};_0x3f601a[_0xb3cd('0x33')]=_[_0xb3cd('0x2f')](db['SalesforceAccount']['rawAttributes']);_0x3f601a['query']=_[_0xb3cd('0x2f')](_0x333358['query']);_0x3f601a[_0xb3cd('0x31')]=_[_0xb3cd('0x32')](_0x3f601a[_0xb3cd('0x33')],_0x3f601a[_0xb3cd('0x30')]);_0x5bd5a7[_0xb3cd('0x34')]=_[_0xb3cd('0x32')](_0x3f601a[_0xb3cd('0x33')],qs[_0xb3cd('0x35')](_0x333358['query']['fields']));_0x5bd5a7[_0xb3cd('0x34')]=_0x5bd5a7[_0xb3cd('0x34')][_0xb3cd('0x36')]?_0x5bd5a7['attributes']:_0x3f601a[_0xb3cd('0x33')];if(_0x333358[_0xb3cd('0x30')]['includeAll']){_0x5bd5a7['include']=[{'all':!![]}];}_0x5bd5a7=_['merge']({},_0x5bd5a7,_0x333358['options']);return db['SalesforceAccount'][_0xb3cd('0x44')](_0x5bd5a7)[_0xb3cd('0x24')](handleEntityNotFound(_0xcd4dc7,null))[_0xb3cd('0x24')](respondWithResult(_0xcd4dc7,null))['catch'](handleError(_0xcd4dc7,null));};exports[_0xb3cd('0x45')]=function(_0x3bb6cf,_0xc27da4){return db[_0xb3cd('0x2a')][_0xb3cd('0x45')](_0x3bb6cf['body'],{})['then'](respondWithResult(_0xc27da4,0xc9))[_0xb3cd('0x46')](handleError(_0xc27da4,null));};exports['update']=function(_0x6e0635,_0x300d26){if(_0x6e0635[_0xb3cd('0x47')]['id']){delete _0x6e0635[_0xb3cd('0x47')]['id'];}return db['SalesforceAccount'][_0xb3cd('0x44')]({'where':{'id':_0x6e0635['params']['id']}})['then'](handleEntityNotFound(_0x300d26,null))[_0xb3cd('0x24')](saveUpdates(_0x6e0635[_0xb3cd('0x47')],null))[_0xb3cd('0x24')](respondWithResult(_0x300d26,null))[_0xb3cd('0x46')](handleError(_0x300d26,null));};exports[_0xb3cd('0x25')]=function(_0x3825b4,_0x48663c){return db['SalesforceAccount'][_0xb3cd('0x44')]({'where':{'id':_0x3825b4[_0xb3cd('0x43')]['id']}})['then'](handleEntityNotFound(_0x48663c,null))[_0xb3cd('0x24')](removeEntity(_0x48663c,null))[_0xb3cd('0x46')](handleError(_0x48663c,null));};exports[_0xb3cd('0x48')]=function(_0x7366f3,_0xcf35cd,_0x2e3e8d){var _0x52db4d={};var _0x5395ad={};var _0x2ae594;var _0x477738;return db[_0xb3cd('0x2a')]['findOne']({'where':{'id':_0x7366f3['params']['id']}})['then'](handleEntityNotFound(_0xcf35cd,null))[_0xb3cd('0x24')](function(_0x229de2){if(_0x229de2){_0x2ae594=_0x229de2;_0x5395ad[_0xb3cd('0x33')]=_[_0xb3cd('0x2f')](db[_0xb3cd('0x49')][_0xb3cd('0x2b')]);_0x5395ad[_0xb3cd('0x30')]=_[_0xb3cd('0x2f')](_0x7366f3[_0xb3cd('0x30')]);_0x5395ad[_0xb3cd('0x31')]=_[_0xb3cd('0x32')](_0x5395ad[_0xb3cd('0x33')],_0x5395ad[_0xb3cd('0x30')]);_0x52db4d['attributes']=_['intersection'](_0x5395ad[_0xb3cd('0x33')],qs[_0xb3cd('0x35')](_0x7366f3['query']['fields']));_0x52db4d[_0xb3cd('0x34')]=_0x52db4d[_0xb3cd('0x34')][_0xb3cd('0x36')]?_0x52db4d['attributes']:_0x5395ad[_0xb3cd('0x33')];_0x52db4d['order']=qs['sort'](_0x7366f3['query']['sort']);_0x52db4d['where']=qs[_0xb3cd('0x31')](_[_0xb3cd('0x3c')](_0x7366f3['query'],_0x5395ad[_0xb3cd('0x31')]));if(_0x7366f3[_0xb3cd('0x30')][_0xb3cd('0x3d')]){_0x52db4d['where']=_['merge'](_0x52db4d[_0xb3cd('0x3b')],{'$or':_[_0xb3cd('0x29')](_0x52db4d[_0xb3cd('0x34')],function(_0x4d4641){var _0x207473={};_0x207473[_0x4d4641]={'$like':'%'+_0x7366f3[_0xb3cd('0x30')][_0xb3cd('0x3d')]+'%'};return _0x207473;})});}_0x52db4d=_['merge']({},_0x52db4d,_0x7366f3[_0xb3cd('0x3f')]);return _0x2ae594[_0xb3cd('0x48')](_0x52db4d);}})[_0xb3cd('0x24')](function(_0x5a4747){if(_0x5a4747){_0x477738=_0x5a4747[_0xb3cd('0x36')];if(!_0x7366f3[_0xb3cd('0x30')]['hasOwnProperty'](_0xb3cd('0x37'))){_0x52db4d['limit']=qs[_0xb3cd('0x38')](_0x7366f3[_0xb3cd('0x30')][_0xb3cd('0x38')]);_0x52db4d[_0xb3cd('0x1e')]=qs[_0xb3cd('0x1e')](_0x7366f3[_0xb3cd('0x30')][_0xb3cd('0x1e')]);}return _0x2ae594['getConfigurations'](_0x52db4d);}})[_0xb3cd('0x24')](function(_0x25132b){if(_0x25132b){return _0x25132b?{'count':_0x477738,'rows':_0x25132b}:null;}})['then'](respondWithResult(_0xcf35cd,null))[_0xb3cd('0x46')](handleError(_0xcf35cd,null));};exports[_0xb3cd('0x4a')]=function(_0x6c5ad3,_0x413e43,_0x3ffafa){if(_0x6c5ad3[_0xb3cd('0x47')]['id']){delete _0x6c5ad3[_0xb3cd('0x47')]['id'];}return db[_0xb3cd('0x2a')][_0xb3cd('0x4b')]({'where':{'id':_0x6c5ad3['params']['id']}})['then'](handleEntityNotFound(_0x413e43,null))['then'](function(_0xfa137){if(_0xfa137){_0x6c5ad3[_0xb3cd('0x47')][_0xb3cd('0x4c')]=_0xfa137['id'];_0x6c5ad3[_0xb3cd('0x47')][_0xb3cd('0x4d')]=integrations[_0xb3cd('0x4e')](_0x6c5ad3['body'][_0xb3cd('0x4f')],_0x6c5ad3[_0xb3cd('0x47')][_0xb3cd('0x2d')]);_0x6c5ad3[_0xb3cd('0x47')][_0xb3cd('0x50')]=integrations[_0xb3cd('0x51')](_0x6c5ad3[_0xb3cd('0x47')][_0xb3cd('0x4f')],_0x6c5ad3[_0xb3cd('0x47')][_0xb3cd('0x2d')]);return db[_0xb3cd('0x49')][_0xb3cd('0x45')](_0x6c5ad3[_0xb3cd('0x47')],{'include':[{'model':db[_0xb3cd('0x52')],'as':_0xb3cd('0x4d')},{'model':db[_0xb3cd('0x52')],'as':_0xb3cd('0x50')}]});}return null;})[_0xb3cd('0x24')](respondWithResult(_0x413e43,null))['catch'](handleError(_0x413e43,null));};exports['getFields']=function(_0x49db55,_0x3c3ab4,_0x521ec7){var _0x496442;var _0x49f979='';var _0x3c56ed=_0xb3cd('0x53');return db['SalesforceAccount']['findOne']({'where':{'id':_0x49db55['params']['id']},'attributes':['id','remoteUri','clientId','clientSecret',_0xb3cd('0x54'),_0xb3cd('0x55'),'securityToken']})[_0xb3cd('0x24')](handleEntityNotFound(_0x3c3ab4,null))[_0xb3cd('0x24')](function(_0x110731){if(_0x110731){_0x49f979=_0x110731[_0xb3cd('0x56')];var _0x58d4dc=_0x49f979['slice'](-0x1);if(_0x58d4dc==='/'){_0x49f979=_0x49f979[_0xb3cd('0x57')](0x0,_0x49f979[_0xb3cd('0x58')](_0x58d4dc));}_0x496442=new jsforce[(_0xb3cd('0x59'))]({'oauth2':{'loginUrl':_0x49f979,'clientId':_0x110731['clientId'],'clientSecret':_0x110731['clientSecret']}});return _0x496442[_0xb3cd('0x5a')](_0x110731[_0xb3cd('0x54')],_0x110731[_0xb3cd('0x55')][_0xb3cd('0x5b')](_0x110731['securityToken']));}})[_0xb3cd('0x24')](function(_0x19ca36){if(_0x19ca36){if(!_[_0xb3cd('0x5c')](_0x49db55[_0xb3cd('0x30')][_0xb3cd('0x5d')])){_0x3c56ed=_0x49db55['query']['ticketType'];}return _0x496442[_0xb3cd('0x5e')](_0x3c56ed)[_0xb3cd('0x5f')]();}})[_0xb3cd('0x24')](function(_0x4b50e6){var _0x5629bd=[_0xb3cd('0x60'),_0xb3cd('0x61'),_0xb3cd('0x62'),_0xb3cd('0x63'),_0xb3cd('0x64'),_0xb3cd('0x65')];var _0x40c8e9=[_0xb3cd('0x66'),'int',_0xb3cd('0x67'),_0xb3cd('0x68'),'email',_0xb3cd('0x69'),_0xb3cd('0x6a')];if(_0x4b50e6){_[_0xb3cd('0x6b')](_0x4b50e6[_0xb3cd('0x35')],function(_0x38b205){return _0x5629bd[_0xb3cd('0x6c')](_0x38b205[_0xb3cd('0x27')])||!_0x40c8e9['includes'](_0x38b205[_0xb3cd('0x2d')]);});return{'count':_0x4b50e6[_0xb3cd('0x35')]['length'],'rows':_['map'](_0x4b50e6[_0xb3cd('0x35')],function(_0x5ca9e7){return{'id':_0x5ca9e7['name'],'name':_0x5ca9e7[_0xb3cd('0x6d')],'custom':_0x5ca9e7['custom'],'options':_0x5ca9e7[_0xb3cd('0x6e')][_0xb3cd('0x36')]>0x0?_[_0xb3cd('0x29')](_0x5ca9e7[_0xb3cd('0x6e')],function(_0x3d6ff1){return{'name':_0x3d6ff1[_0xb3cd('0x6d')],'value':_0x3d6ff1[_0xb3cd('0x6f')]};}):_0x5ca9e7[_0xb3cd('0x2d')]=='boolean'?[{'name':_0xb3cd('0x70'),'value':_0xb3cd('0x71')},{'name':_0xb3cd('0x72'),'value':_0xb3cd('0x73')}]:[]};})};}})[_0xb3cd('0x24')](respondWithResult(_0x3c3ab4,null))[_0xb3cd('0x46')](function(_0x33bfc1){var _0x5abb32=_0x49db55[_0xb3cd('0x30')][_0xb3cd('0x74')]?0x1f4:_0x33bfc1[_0xb3cd('0x75')]||0x1f4;logger[_0xb3cd('0x26')](_0xb3cd('0x76'),_0xb3cd('0x77'),_0x5abb32,JSON[_0xb3cd('0x78')](_0x33bfc1));delete _0x33bfc1[_0xb3cd('0x27')];if(_0x5abb32===0x191){_0x5abb32=0x190;}_0x3c3ab4[_0xb3cd('0x1a')](_0x5abb32)[_0xb3cd('0x79')](_0x49db55[_0xb3cd('0x30')]['test']?{'message':_0xb3cd('0x7a'),'statusCode':_0x33bfc1[_0xb3cd('0x75')]}:_0x33bfc1);});};
\ No newline at end of file
index 4d21073..daa5c3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64e9=['lodash','../../config/logger','moment','request-promise','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount'];(function(_0x3d0feb,_0x679606){var _0x58b05b=function(_0x2ef1b4){while(--_0x2ef1b4){_0x3d0feb['push'](_0x3d0feb['shift']());}};_0x58b05b(++_0x679606);}(_0x64e9,0x136));var _0x964e=function(_0x37b022,_0x742861){_0x37b022=_0x37b022-0x0;var _0x3b6c68=_0x64e9[_0x37b022];return _0x3b6c68;};'use strict';var _=require(_0x964e('0x0'));var util=require('util');var logger=require(_0x964e('0x1'))('api');var moment=require(_0x964e('0x2'));var BPromise=require('bluebird');var rp=require(_0x964e('0x3'));var fs=require('fs');var path=require(_0x964e('0x4'));var rimraf=require(_0x964e('0x5'));var config=require('../../config/environment');var attributes=require(_0x964e('0x6'));var integrations=require(_0x964e('0x7'));module[_0x964e('0x8')]=function(_0x224264,_0x48db74){return _0x224264['define'](_0x964e('0x9'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x33a1=['../../components/integrations/configuration','exports','define','SalesforceAccount','lodash','util','request-promise','path','rimraf','./intSalesforceAccount.attributes'];(function(_0x2b0e5c,_0x31ddb2){var _0x1e0b3d=function(_0x3a6e4f){while(--_0x3a6e4f){_0x2b0e5c['push'](_0x2b0e5c['shift']());}};_0x1e0b3d(++_0x31ddb2);}(_0x33a1,0x7c));var _0x133a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x33a1[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x133a('0x0'));var util=require(_0x133a('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x133a('0x2'));var fs=require('fs');var path=require(_0x133a('0x3'));var rimraf=require(_0x133a('0x4'));var config=require('../../config/environment');var attributes=require(_0x133a('0x5'));var integrations=require(_0x133a('0x6'));module[_0x133a('0x7')]=function(_0x557b93,_0x13fe1d){return _0x557b93[_0x133a('0x8')](_0x133a('0x9'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 394ba58..2060043 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c3b=['model','GetSalesforceAccount','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','SalesforceAccount,\x20%s,\x20%s','catch','SalesforceAccount','options','raw','where','attributes','limit','include','map'];(function(_0x136857,_0x370fae){var _0xe9094c=function(_0x17a6e0){while(--_0x17a6e0){_0x136857['push'](_0x136857['shift']());}};_0xe9094c(++_0x370fae);}(_0x9c3b,0x1f2));var _0xb9c3=function(_0x575a56,_0x5a5f09){_0x575a56=_0x575a56-0x0;var _0x34b558=_0x9c3b[_0x575a56];return _0x34b558;};'use strict';var _=require(_0xb9c3('0x0'));var util=require(_0xb9c3('0x1'));var moment=require(_0xb9c3('0x2'));var BPromise=require(_0xb9c3('0x3'));var rs=require(_0xb9c3('0x4'));var fs=require('fs');var Redis=require(_0xb9c3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb9c3('0x6'))(_0xb9c3('0x7'));var config=require(_0xb9c3('0x8'));var jayson=require(_0xb9c3('0x9'));var client=jayson[_0xb9c3('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4984b3,_0x2f9eea,_0x5ddd52){return new BPromise(function(_0x52e92d,_0x5e8c72){return client[_0xb9c3('0xb')](_0x4984b3,_0x5ddd52)[_0xb9c3('0xc')](function(_0x30e33d){logger[_0xb9c3('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x2f9eea,_0xb9c3('0xe'));logger[_0xb9c3('0xf')](_0xb9c3('0x10'),_0x2f9eea,_0xb9c3('0xe'),JSON[_0xb9c3('0x11')](_0x30e33d));if(_0x30e33d[_0xb9c3('0x12')]){if(_0x30e33d['error']['code']===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x2f9eea,_0x30e33d[_0xb9c3('0x12')][_0xb9c3('0x13')]);return _0x5e8c72(_0x30e33d[_0xb9c3('0x12')][_0xb9c3('0x13')]);}logger[_0xb9c3('0x12')](_0xb9c3('0x14'),_0x2f9eea,_0x30e33d[_0xb9c3('0x12')][_0xb9c3('0x13')]);return _0x52e92d(_0x30e33d[_0xb9c3('0x12')][_0xb9c3('0x13')]);}else{logger[_0xb9c3('0xd')](_0xb9c3('0x14'),_0x2f9eea,_0xb9c3('0xe'));_0x52e92d(_0x30e33d['result'][_0xb9c3('0x13')]);}})[_0xb9c3('0x15')](function(_0xc09479){logger[_0xb9c3('0x12')](_0xb9c3('0x14'),_0x2f9eea,_0xc09479);_0x5e8c72(_0xc09479);});});}exports['GetSalesforceAccount']=function(_0x117929){var _0x23b801=this;return new Promise(function(_0x23b493,_0x2a2f13){return db[_0xb9c3('0x16')]['findAll']({'raw':_0x117929[_0xb9c3('0x17')]?_0x117929[_0xb9c3('0x17')][_0xb9c3('0x18')]===undefined?!![]:![]:!![],'where':_0x117929[_0xb9c3('0x17')]?_0x117929['options'][_0xb9c3('0x19')]||null:null,'attributes':_0x117929['options']?_0x117929['options'][_0xb9c3('0x1a')]||null:null,'limit':_0x117929[_0xb9c3('0x17')]?_0x117929[_0xb9c3('0x17')][_0xb9c3('0x1b')]||null:null,'include':_0x117929['options']?_0x117929[_0xb9c3('0x17')][_0xb9c3('0x1c')]?_[_0xb9c3('0x1d')](_0x117929[_0xb9c3('0x17')]['include'],function(_0xd49d47){return{'model':db[_0xd49d47[_0xb9c3('0x1e')]],'as':_0xd49d47['as'],'attributes':_0xd49d47['attributes'],'include':_0xd49d47['include']?_[_0xb9c3('0x1d')](_0xd49d47['include'],function(_0xa9eaff){return{'model':db[_0xa9eaff[_0xb9c3('0x1e')]],'as':_0xa9eaff['as'],'attributes':_0xa9eaff['attributes'],'include':_0xa9eaff[_0xb9c3('0x1c')]?_['map'](_0xa9eaff[_0xb9c3('0x1c')],function(_0x1b68e3){return{'model':db[_0x1b68e3[_0xb9c3('0x1e')]],'as':_0x1b68e3['as'],'attributes':_0x1b68e3[_0xb9c3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb9c3('0xc')](function(_0x1e5659){logger['info'](_0xb9c3('0x1f'),_0x117929);logger[_0xb9c3('0xf')](_0xb9c3('0x1f'),_0x117929,JSON[_0xb9c3('0x11')](_0x1e5659));_0x23b493(_0x1e5659);})[_0xb9c3('0x15')](function(_0x402a20){logger[_0xb9c3('0x12')](_0xb9c3('0x1f'),_0x402a20[_0xb9c3('0x13')],_0x117929);_0x2a2f13(_0x23b801[_0xb9c3('0x12')](0x1f4,_0x402a20[_0xb9c3('0x13')]));});});};exports[_0xb9c3('0x20')]=function(_0x518370){var _0x41b3c7=this;return new Promise(function(_0x229852,_0x40e9b2){return db[_0xb9c3('0x16')]['find']({'raw':_0x518370['options']?_0x518370[_0xb9c3('0x17')][_0xb9c3('0x18')]===undefined?!![]:![]:!![],'where':_0x518370[_0xb9c3('0x17')]?_0x518370[_0xb9c3('0x17')][_0xb9c3('0x19')]||null:null,'attributes':_0x518370[_0xb9c3('0x17')]?_0x518370[_0xb9c3('0x17')][_0xb9c3('0x1a')]||null:null,'include':_0x518370[_0xb9c3('0x17')]?_0x518370[_0xb9c3('0x17')][_0xb9c3('0x1c')]?_[_0xb9c3('0x1d')](_0x518370[_0xb9c3('0x17')]['include'],function(_0x131454){return{'model':db[_0x131454[_0xb9c3('0x1e')]],'as':_0x131454['as'],'attributes':_0x131454[_0xb9c3('0x1a')],'include':_0x131454[_0xb9c3('0x1c')]?_[_0xb9c3('0x1d')](_0x131454[_0xb9c3('0x1c')],function(_0x3ca8c8){return{'model':db[_0x3ca8c8[_0xb9c3('0x1e')]],'as':_0x3ca8c8['as'],'attributes':_0x3ca8c8[_0xb9c3('0x1a')],'include':_0x3ca8c8[_0xb9c3('0x1c')]?_[_0xb9c3('0x1d')](_0x3ca8c8[_0xb9c3('0x1c')],function(_0xa9e7f6){return{'model':db[_0xa9e7f6['model']],'as':_0xa9e7f6['as'],'attributes':_0xa9e7f6['attributes']};}):[]};}):[]};}):[]:[]})[_0xb9c3('0xc')](function(_0x45d342){logger['info'](_0xb9c3('0x20'),_0x518370);logger[_0xb9c3('0xf')](_0xb9c3('0x20'),_0x518370,JSON[_0xb9c3('0x11')](_0x45d342));_0x229852(_0x45d342);})['catch'](function(_0x3ceccb){logger[_0xb9c3('0x12')]('ShowSalesforceAccount',_0x3ceccb[_0xb9c3('0x13')],_0x518370);_0x40e9b2(_0x41b3c7[_0xb9c3('0x12')](0x1f4,_0x3ceccb['message']));});});};
\ No newline at end of file
+var _0xd23f=['request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetSalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowSalesforceAccount','SalesforceAccount','find','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0xddc063,_0x29ef7d){var _0x4cde0c=function(_0x1ba3e9){while(--_0x1ba3e9){_0xddc063['push'](_0xddc063['shift']());}};_0x4cde0c(++_0x29ef7d);}(_0xd23f,0x83));var _0xfd23=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xd23f[_0x164eca];return _0x2ce562;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfd23('0x0'));var BPromise=require(_0xfd23('0x1'));var rs=require(_0xfd23('0x2'));var fs=require('fs');var Redis=require(_0xfd23('0x3'));var db=require(_0xfd23('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfd23('0x5'))(_0xfd23('0x6'));var config=require(_0xfd23('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfd23('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3bc2eb,_0x324fca,_0x526591){return new BPromise(function(_0xb51f46,_0x4a8eef){return client[_0xfd23('0x9')](_0x3bc2eb,_0x526591)['then'](function(_0x190a28){logger[_0xfd23('0xa')](_0xfd23('0xb'),_0x324fca,_0xfd23('0xc'));logger[_0xfd23('0xd')](_0xfd23('0xe'),_0x324fca,_0xfd23('0xc'),JSON['stringify'](_0x190a28));if(_0x190a28[_0xfd23('0xf')]){if(_0x190a28[_0xfd23('0xf')][_0xfd23('0x10')]===0x1f4){logger[_0xfd23('0xf')](_0xfd23('0xb'),_0x324fca,_0x190a28[_0xfd23('0xf')]['message']);return _0x4a8eef(_0x190a28[_0xfd23('0xf')]['message']);}logger['error'](_0xfd23('0xb'),_0x324fca,_0x190a28[_0xfd23('0xf')][_0xfd23('0x11')]);return _0xb51f46(_0x190a28[_0xfd23('0xf')][_0xfd23('0x11')]);}else{logger[_0xfd23('0xa')](_0xfd23('0xb'),_0x324fca,_0xfd23('0xc'));_0xb51f46(_0x190a28[_0xfd23('0x12')]['message']);}})[_0xfd23('0x13')](function(_0x33c5b0){logger[_0xfd23('0xf')](_0xfd23('0xb'),_0x324fca,_0x33c5b0);_0x4a8eef(_0x33c5b0);});});}exports[_0xfd23('0x14')]=function(_0x40dd05){var _0x51ec30=this;return new Promise(function(_0x4aaf4c,_0x4f971d){return db['SalesforceAccount'][_0xfd23('0x15')]({'raw':_0x40dd05[_0xfd23('0x16')]?_0x40dd05[_0xfd23('0x16')][_0xfd23('0x17')]===undefined?!![]:![]:!![],'where':_0x40dd05[_0xfd23('0x16')]?_0x40dd05[_0xfd23('0x16')][_0xfd23('0x18')]||null:null,'attributes':_0x40dd05[_0xfd23('0x16')]?_0x40dd05[_0xfd23('0x16')][_0xfd23('0x19')]||null:null,'limit':_0x40dd05[_0xfd23('0x16')]?_0x40dd05[_0xfd23('0x16')][_0xfd23('0x1a')]||null:null,'include':_0x40dd05[_0xfd23('0x16')]?_0x40dd05[_0xfd23('0x16')][_0xfd23('0x1b')]?_[_0xfd23('0x1c')](_0x40dd05[_0xfd23('0x16')][_0xfd23('0x1b')],function(_0x440f55){return{'model':db[_0x440f55[_0xfd23('0x1d')]],'as':_0x440f55['as'],'attributes':_0x440f55['attributes'],'include':_0x440f55[_0xfd23('0x1b')]?_[_0xfd23('0x1c')](_0x440f55['include'],function(_0x53e476){return{'model':db[_0x53e476[_0xfd23('0x1d')]],'as':_0x53e476['as'],'attributes':_0x53e476[_0xfd23('0x19')],'include':_0x53e476[_0xfd23('0x1b')]?_['map'](_0x53e476['include'],function(_0x43b16f){return{'model':db[_0x43b16f[_0xfd23('0x1d')]],'as':_0x43b16f['as'],'attributes':_0x43b16f[_0xfd23('0x19')]};}):[]};}):[]};}):[]:[]})[_0xfd23('0x1e')](function(_0x23cdd4){logger[_0xfd23('0xa')](_0xfd23('0x14'),_0x40dd05);logger[_0xfd23('0xd')](_0xfd23('0x14'),_0x40dd05,JSON['stringify'](_0x23cdd4));_0x4aaf4c(_0x23cdd4);})[_0xfd23('0x13')](function(_0x11cfd6){logger[_0xfd23('0xf')](_0xfd23('0x14'),_0x11cfd6[_0xfd23('0x11')],_0x40dd05);_0x4f971d(_0x51ec30['error'](0x1f4,_0x11cfd6[_0xfd23('0x11')]));});});};exports[_0xfd23('0x1f')]=function(_0x16f081){var _0x169fcd=this;return new Promise(function(_0x57058c,_0x223e1a){return db[_0xfd23('0x20')][_0xfd23('0x21')]({'raw':_0x16f081['options']?_0x16f081[_0xfd23('0x16')][_0xfd23('0x17')]===undefined?!![]:![]:!![],'where':_0x16f081[_0xfd23('0x16')]?_0x16f081[_0xfd23('0x16')]['where']||null:null,'attributes':_0x16f081['options']?_0x16f081[_0xfd23('0x16')][_0xfd23('0x19')]||null:null,'include':_0x16f081[_0xfd23('0x16')]?_0x16f081[_0xfd23('0x16')][_0xfd23('0x1b')]?_['map'](_0x16f081[_0xfd23('0x16')]['include'],function(_0x2169b9){return{'model':db[_0x2169b9[_0xfd23('0x1d')]],'as':_0x2169b9['as'],'attributes':_0x2169b9[_0xfd23('0x19')],'include':_0x2169b9[_0xfd23('0x1b')]?_['map'](_0x2169b9[_0xfd23('0x1b')],function(_0x4f1528){return{'model':db[_0x4f1528[_0xfd23('0x1d')]],'as':_0x4f1528['as'],'attributes':_0x4f1528[_0xfd23('0x19')],'include':_0x4f1528[_0xfd23('0x1b')]?_['map'](_0x4f1528['include'],function(_0x52c681){return{'model':db[_0x52c681[_0xfd23('0x1d')]],'as':_0x52c681['as'],'attributes':_0x52c681['attributes']};}):[]};}):[]};}):[]:[]})[_0xfd23('0x1e')](function(_0x3e81ef){logger[_0xfd23('0xa')]('ShowSalesforceAccount',_0x16f081);logger[_0xfd23('0xd')](_0xfd23('0x1f'),_0x16f081,JSON[_0xfd23('0x22')](_0x3e81ef));_0x57058c(_0x3e81ef);})['catch'](function(_0x19c483){logger[_0xfd23('0xf')]('ShowSalesforceAccount',_0x19c483[_0xfd23('0x11')],_0x16f081);_0x223e1a(_0x169fcd[_0xfd23('0xf')](0x1f4,_0x19c483['message']));});});};
\ No newline at end of file
index f929607..1b4b1a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x3ebaf4,_0xed7285){var _0x5bec44=function(_0x3b9be5){while(--_0x3b9be5){_0x3ebaf4['push'](_0x3ebaf4['shift']());}};_0x5bec44(++_0xed7285);}(_0x7a54,0x106));var _0x47a5=function(_0x1c3022,_0x144e98){_0x1c3022=_0x1c3022-0x0;var _0x14bf91=_0x7a54[_0x1c3022];return _0x14bf91;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router;
\ No newline at end of file
+var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0xddc9f1,_0x175257){var _0x19ad55=function(_0x20e80e){while(--_0x20e80e){_0xddc9f1['push'](_0xddc9f1['shift']());}};_0x19ad55(++_0x175257);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router;
\ No newline at end of file
index 94d00a8..50f1df4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83d6=['STRING','ENUM','Task','contact_lead','contact','lead','account_contact_lead','account','sequelize'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0x83d6,0xe9));var _0x683d=function(_0x3f79e9,_0x4c48e4){_0x3f79e9=_0x3f79e9-0x0;var _0x24b6a5=_0x83d6[_0x3f79e9];return _0x24b6a5;};'use strict';var Sequelize=require(_0x683d('0x0'));module['exports']={'name':{'type':Sequelize[_0x683d('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x683d('0x2')](_0x683d('0x3'),'Case'),'defaultValue':_0x683d('0x3')},'moduleSearch':{'type':Sequelize[_0x683d('0x2')](_0x683d('0x4'),_0x683d('0x5'),_0x683d('0x6'),_0x683d('0x7'),_0x683d('0x8')),'defaultValue':_0x683d('0x4')},'moduleCreate':{'type':Sequelize['ENUM']('nothing',_0x683d('0x5'),'lead',_0x683d('0x8')),'defaultValue':_0x683d('0x6')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0x683d('0x1')]}};
\ No newline at end of file
+var _0xf207=['account_contact_lead','account','contact_lead','nothing','sequelize','exports','STRING','Task','Case','ENUM','contact','lead'];(function(_0x5c56ac,_0x22aa46){var _0x5c737b=function(_0x18ae46){while(--_0x18ae46){_0x5c56ac['push'](_0x5c56ac['shift']());}};_0x5c737b(++_0x22aa46);}(_0xf207,0x1c0));var _0x7f20=function(_0x545b71,_0x4f44eb){_0x545b71=_0x545b71-0x0;var _0x26e587=_0xf207[_0x545b71];return _0x26e587;};'use strict';var Sequelize=require(_0x7f20('0x0'));module[_0x7f20('0x1')]={'name':{'type':Sequelize[_0x7f20('0x2')]},'description':{'type':Sequelize[_0x7f20('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x7f20('0x3'),_0x7f20('0x4')),'defaultValue':_0x7f20('0x3')},'moduleSearch':{'type':Sequelize[_0x7f20('0x5')]('contact_lead',_0x7f20('0x6'),_0x7f20('0x7'),_0x7f20('0x8'),_0x7f20('0x9')),'defaultValue':_0x7f20('0xa')},'moduleCreate':{'type':Sequelize[_0x7f20('0x5')](_0x7f20('0xb'),_0x7f20('0x6'),_0x7f20('0x7'),_0x7f20('0x9')),'defaultValue':_0x7f20('0x7')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x7f20('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x7f20('0x2')]}};
\ No newline at end of file
index e8e4849..8794049 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf555=['lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','length','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','params','find','create','body','getFields','SalesforceField','hasOwnProperty','getSubjects','findOne','order','filter','nolimit','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x33a90e,_0x4f70f8){var _0x162ffd=function(_0x4a28c9){while(--_0x4a28c9){_0x33a90e['push'](_0x33a90e['shift']());}};_0x162ffd(++_0x4f70f8);}(_0xf555,0x92));var _0x5f55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf555[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5f55('0x0'));var rimraf=require(_0x5f55('0x1'));var zipdir=require(_0x5f55('0x2'));var jsonpatch=require(_0x5f55('0x3'));var rp=require(_0x5f55('0x4'));var moment=require(_0x5f55('0x5'));var BPromise=require(_0x5f55('0x6'));var Mustache=require(_0x5f55('0x7'));var util=require('util');var path=require(_0x5f55('0x8'));var sox=require(_0x5f55('0x9'));var csv=require(_0x5f55('0xa'));var ejs=require(_0x5f55('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f55('0xc'));var squel=require('squel');var crypto=require(_0x5f55('0xd'));var jsforce=require(_0x5f55('0xe'));var deskjs=require(_0x5f55('0xf'));var toCsv=require(_0x5f55('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5f55('0x10'));var authService=require(_0x5f55('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5f55('0x12'));var hardwareService=require(_0x5f55('0x13'));var logger=require(_0x5f55('0x14'))('api');var utils=require(_0x5f55('0x15'));var config=require(_0x5f55('0x16'));var licenseUtil=require(_0x5f55('0x17'));var db=require(_0x5f55('0x18'))['db'];function respondWithStatusCode(_0x1451f5,_0x58e3d2){_0x58e3d2=_0x58e3d2||0xcc;return function(_0x5b4cab){if(_0x5b4cab){return _0x1451f5[_0x5f55('0x19')](_0x58e3d2);}return _0x1451f5[_0x5f55('0x1a')](_0x58e3d2)[_0x5f55('0x1b')]();};}function respondWithResult(_0x315f95,_0x583ffa){_0x583ffa=_0x583ffa||0xc8;return function(_0x2d9cab){if(_0x2d9cab){return _0x315f95[_0x5f55('0x1a')](_0x583ffa)[_0x5f55('0x1c')](_0x2d9cab);}};}function respondWithFilteredResult(_0x1050cb,_0x3b06b1){return function(_0x5c37e4){if(_0x5c37e4){var _0x34878c=typeof _0x3b06b1[_0x5f55('0x1d')]===_0x5f55('0x1e')&&typeof _0x3b06b1['limit']===_0x5f55('0x1e');var _0x52bb7b=_0x5c37e4[_0x5f55('0x1f')];var _0x3d9eba=_0x34878c?0x0:_0x3b06b1[_0x5f55('0x1d')];var _0x49120f=_0x34878c?_0x5c37e4['count']:_0x3b06b1['offset']+_0x3b06b1[_0x5f55('0x20')];var _0x5c4649;if(_0x49120f>=_0x52bb7b){_0x49120f=_0x52bb7b;_0x5c4649=0xc8;}else{_0x5c4649=0xce;}_0x1050cb[_0x5f55('0x1a')](_0x5c4649);return _0x1050cb[_0x5f55('0x21')]('Content-Range',_0x3d9eba+'-'+_0x49120f+'/'+_0x52bb7b)[_0x5f55('0x1c')](_0x5c37e4);}return null;};}function patchUpdates(_0x3f7556){return function(_0x27c104){try{jsonpatch[_0x5f55('0x22')](_0x27c104,_0x3f7556,!![]);}catch(_0x5973da){return BPromise[_0x5f55('0x23')](_0x5973da);}return _0x27c104[_0x5f55('0x24')]();};}function saveUpdates(_0x2ed744,_0xa3caca){return function(_0x1eb313){if(_0x1eb313){return _0x1eb313['update'](_0x2ed744)['then'](function(_0x4c8ade){return _0x4c8ade;});}return null;};}function removeEntity(_0x24fff3,_0x433e76){return function(_0x5dd026){if(_0x5dd026){return _0x5dd026['destroy']()[_0x5f55('0x25')](function(){_0x24fff3[_0x5f55('0x1a')](0xcc)[_0x5f55('0x1b')]();});}};}function handleEntityNotFound(_0x24aa29,_0x4b65d6){return function(_0x11d761){if(!_0x11d761){_0x24aa29[_0x5f55('0x19')](0x194);}return _0x11d761;};}function handleError(_0x562524,_0x4899d3){_0x4899d3=_0x4899d3||0x1f4;return function(_0x46c841){logger[_0x5f55('0x26')](_0x46c841[_0x5f55('0x27')]);if(_0x46c841[_0x5f55('0x28')]){delete _0x46c841['name'];}_0x562524[_0x5f55('0x1a')](_0x4899d3)[_0x5f55('0x29')](_0x46c841);};}exports[_0x5f55('0x2a')]=function(_0x11c48a,_0x10ddbc){var _0x31a765={},_0x55f41c={},_0x488537={'count':0x0,'rows':[]};var _0x23306b=_[_0x5f55('0x2b')](db[_0x5f55('0x2c')][_0x5f55('0x2d')],function(_0xb135ba){return{'name':_0xb135ba['fieldName'],'type':_0xb135ba[_0x5f55('0x2e')][_0x5f55('0x2f')]};});_0x55f41c['model']=_[_0x5f55('0x2b')](_0x23306b,_0x5f55('0x28'));_0x55f41c[_0x5f55('0x30')]=_[_0x5f55('0x31')](_0x11c48a[_0x5f55('0x30')]);_0x55f41c[_0x5f55('0x32')]=_[_0x5f55('0x33')](_0x55f41c['model'],_0x55f41c[_0x5f55('0x30')]);_0x31a765[_0x5f55('0x34')]=_[_0x5f55('0x33')](_0x55f41c[_0x5f55('0x35')],qs['fields'](_0x11c48a[_0x5f55('0x30')][_0x5f55('0x36')]));_0x31a765[_0x5f55('0x34')]=_0x31a765[_0x5f55('0x34')][_0x5f55('0x37')]?_0x31a765[_0x5f55('0x34')]:_0x55f41c[_0x5f55('0x35')];if(!_0x11c48a['query']['hasOwnProperty']('nolimit')){_0x31a765[_0x5f55('0x20')]=qs[_0x5f55('0x20')](_0x11c48a[_0x5f55('0x30')]['limit']);_0x31a765['offset']=qs[_0x5f55('0x1d')](_0x11c48a[_0x5f55('0x30')][_0x5f55('0x1d')]);}_0x31a765['order']=qs[_0x5f55('0x38')](_0x11c48a[_0x5f55('0x30')][_0x5f55('0x38')]);_0x31a765[_0x5f55('0x39')]=qs[_0x5f55('0x32')](_[_0x5f55('0x3a')](_0x11c48a['query'],_0x55f41c[_0x5f55('0x32')]),_0x23306b);if(_0x11c48a[_0x5f55('0x30')]['filter']){_0x31a765[_0x5f55('0x39')]=_[_0x5f55('0x3b')](_0x31a765[_0x5f55('0x39')],{'$or':_['map'](_0x23306b,function(_0x37daa5){if(_0x37daa5[_0x5f55('0x2e')]!==_0x5f55('0x3c')){var _0x54ffd4={};_0x54ffd4[_0x37daa5[_0x5f55('0x28')]]={'$like':'%'+_0x11c48a[_0x5f55('0x30')]['filter']+'%'};return _0x54ffd4;}})});}_0x31a765=_[_0x5f55('0x3b')]({},_0x31a765,_0x11c48a[_0x5f55('0x3d')]);var _0x59490e={'where':_0x31a765['where']};return db['SalesforceConfiguration']['count'](_0x59490e)['then'](function(_0x580272){_0x488537[_0x5f55('0x1f')]=_0x580272;if(_0x11c48a[_0x5f55('0x30')][_0x5f55('0x3e')]){_0x31a765[_0x5f55('0x3f')]=[{'all':!![]}];}return db[_0x5f55('0x2c')]['findAll'](_0x31a765);})['then'](function(_0x7192b1){_0x488537[_0x5f55('0x40')]=_0x7192b1;return _0x488537;})[_0x5f55('0x25')](respondWithFilteredResult(_0x10ddbc,_0x31a765))[_0x5f55('0x41')](handleError(_0x10ddbc,null));};exports['show']=function(_0x1ad079,_0x3aa520){var _0x2979ca={'raw':![],'where':{'id':_0x1ad079[_0x5f55('0x42')]['id']}},_0x5c08d9={};_0x5c08d9[_0x5f55('0x35')]=_[_0x5f55('0x31')](db[_0x5f55('0x2c')][_0x5f55('0x2d')]);_0x5c08d9[_0x5f55('0x30')]=_[_0x5f55('0x31')](_0x1ad079[_0x5f55('0x30')]);_0x5c08d9[_0x5f55('0x32')]=_['intersection'](_0x5c08d9['model'],_0x5c08d9['query']);_0x2979ca['attributes']=_[_0x5f55('0x33')](_0x5c08d9[_0x5f55('0x35')],qs[_0x5f55('0x36')](_0x1ad079[_0x5f55('0x30')][_0x5f55('0x36')]));_0x2979ca['attributes']=_0x2979ca[_0x5f55('0x34')][_0x5f55('0x37')]?_0x2979ca['attributes']:_0x5c08d9['model'];if(_0x1ad079[_0x5f55('0x30')][_0x5f55('0x3e')]){_0x2979ca[_0x5f55('0x3f')]=[{'all':!![]}];}_0x2979ca=_[_0x5f55('0x3b')]({},_0x2979ca,_0x1ad079['options']);return db[_0x5f55('0x2c')][_0x5f55('0x43')](_0x2979ca)[_0x5f55('0x25')](handleEntityNotFound(_0x3aa520,null))[_0x5f55('0x25')](respondWithResult(_0x3aa520,null))[_0x5f55('0x41')](handleError(_0x3aa520,null));};exports['create']=function(_0x2ca983,_0x142ecf){return db[_0x5f55('0x2c')][_0x5f55('0x44')](_0x2ca983[_0x5f55('0x45')],{})[_0x5f55('0x25')](respondWithResult(_0x142ecf,0xc9))[_0x5f55('0x41')](handleError(_0x142ecf,null));};exports['update']=function(_0x4df1f8,_0x3e20f9){if(_0x4df1f8[_0x5f55('0x45')]['id']){delete _0x4df1f8[_0x5f55('0x45')]['id'];}return db['SalesforceConfiguration']['find']({'where':{'id':_0x4df1f8[_0x5f55('0x42')]['id']}})[_0x5f55('0x25')](handleEntityNotFound(_0x3e20f9,null))[_0x5f55('0x25')](saveUpdates(_0x4df1f8[_0x5f55('0x45')],null))['then'](respondWithResult(_0x3e20f9,null))[_0x5f55('0x41')](handleError(_0x3e20f9,null));};exports['destroy']=function(_0x2f6fbf,_0x28fafd){return db['SalesforceConfiguration'][_0x5f55('0x43')]({'where':{'id':_0x2f6fbf[_0x5f55('0x42')]['id']}})[_0x5f55('0x25')](handleEntityNotFound(_0x28fafd,null))['then'](removeEntity(_0x28fafd,null))[_0x5f55('0x41')](handleError(_0x28fafd,null));};exports[_0x5f55('0x46')]=function(_0x460390,_0x4b5779,_0x264a5d){var _0xeead36={};var _0x55009f={};var _0x516ad4;var _0x508c39;return db[_0x5f55('0x2c')]['findOne']({'where':{'id':_0x460390[_0x5f55('0x42')]['id']}})[_0x5f55('0x25')](handleEntityNotFound(_0x4b5779,null))[_0x5f55('0x25')](function(_0x1bbb89){if(_0x1bbb89){_0x516ad4=_0x1bbb89;_0x55009f['model']=_[_0x5f55('0x31')](db[_0x5f55('0x47')]['rawAttributes']);_0x55009f['query']=_[_0x5f55('0x31')](_0x460390[_0x5f55('0x30')]);_0x55009f[_0x5f55('0x32')]=_[_0x5f55('0x33')](_0x55009f[_0x5f55('0x35')],_0x55009f['query']);_0xeead36[_0x5f55('0x34')]=_[_0x5f55('0x33')](_0x55009f['model'],qs[_0x5f55('0x36')](_0x460390[_0x5f55('0x30')][_0x5f55('0x36')]));_0xeead36[_0x5f55('0x34')]=_0xeead36[_0x5f55('0x34')][_0x5f55('0x37')]?_0xeead36[_0x5f55('0x34')]:_0x55009f[_0x5f55('0x35')];_0xeead36['order']=qs[_0x5f55('0x38')](_0x460390[_0x5f55('0x30')][_0x5f55('0x38')]);_0xeead36[_0x5f55('0x39')]=qs[_0x5f55('0x32')](_[_0x5f55('0x3a')](_0x460390[_0x5f55('0x30')],_0x55009f[_0x5f55('0x32')]));if(_0x460390[_0x5f55('0x30')]['filter']){_0xeead36[_0x5f55('0x39')]=_[_0x5f55('0x3b')](_0xeead36['where'],{'$or':_[_0x5f55('0x2b')](_0xeead36[_0x5f55('0x34')],function(_0x4ef0eb){var _0x4350f4={};_0x4350f4[_0x4ef0eb]={'$like':'%'+_0x460390[_0x5f55('0x30')]['filter']+'%'};return _0x4350f4;})});}_0xeead36=_['merge']({},_0xeead36,_0x460390[_0x5f55('0x3d')]);return _0x516ad4[_0x5f55('0x46')](_0xeead36);}})['then'](function(_0x397f7c){if(_0x397f7c){_0x508c39=_0x397f7c['length'];if(!_0x460390['query'][_0x5f55('0x48')]('nolimit')){_0xeead36[_0x5f55('0x20')]=qs[_0x5f55('0x20')](_0x460390[_0x5f55('0x30')][_0x5f55('0x20')]);_0xeead36[_0x5f55('0x1d')]=qs['offset'](_0x460390[_0x5f55('0x30')][_0x5f55('0x1d')]);}return _0x516ad4[_0x5f55('0x46')](_0xeead36);}})[_0x5f55('0x25')](function(_0xf58026){if(_0xf58026){return _0xf58026?{'count':_0x508c39,'rows':_0xf58026}:null;}})['then'](respondWithResult(_0x4b5779,null))[_0x5f55('0x41')](handleError(_0x4b5779,null));};exports[_0x5f55('0x49')]=function(_0xe9e99,_0x370cbd,_0x3ae187){var _0x47d6cd={};var _0x26daf7={};var _0x46648d;var _0x286d75;return db[_0x5f55('0x2c')][_0x5f55('0x4a')]({'where':{'id':_0xe9e99[_0x5f55('0x42')]['id']}})[_0x5f55('0x25')](handleEntityNotFound(_0x370cbd,null))[_0x5f55('0x25')](function(_0x54d108){if(_0x54d108){_0x46648d=_0x54d108;_0x26daf7[_0x5f55('0x35')]=_[_0x5f55('0x31')](db[_0x5f55('0x47')][_0x5f55('0x2d')]);_0x26daf7['query']=_[_0x5f55('0x31')](_0xe9e99[_0x5f55('0x30')]);_0x26daf7[_0x5f55('0x32')]=_['intersection'](_0x26daf7[_0x5f55('0x35')],_0x26daf7[_0x5f55('0x30')]);_0x47d6cd[_0x5f55('0x34')]=_['intersection'](_0x26daf7[_0x5f55('0x35')],qs[_0x5f55('0x36')](_0xe9e99[_0x5f55('0x30')]['fields']));_0x47d6cd[_0x5f55('0x34')]=_0x47d6cd[_0x5f55('0x34')][_0x5f55('0x37')]?_0x47d6cd[_0x5f55('0x34')]:_0x26daf7[_0x5f55('0x35')];_0x47d6cd[_0x5f55('0x4b')]=qs[_0x5f55('0x38')](_0xe9e99[_0x5f55('0x30')][_0x5f55('0x38')]);_0x47d6cd[_0x5f55('0x39')]=qs[_0x5f55('0x32')](_[_0x5f55('0x3a')](_0xe9e99[_0x5f55('0x30')],_0x26daf7['filters']));if(_0xe9e99[_0x5f55('0x30')]['filter']){_0x47d6cd['where']=_[_0x5f55('0x3b')](_0x47d6cd[_0x5f55('0x39')],{'$or':_[_0x5f55('0x2b')](_0x47d6cd[_0x5f55('0x34')],function(_0x24d2ac){var _0x3db73e={};_0x3db73e[_0x24d2ac]={'$like':'%'+_0xe9e99['query'][_0x5f55('0x4c')]+'%'};return _0x3db73e;})});}_0x47d6cd=_[_0x5f55('0x3b')]({},_0x47d6cd,_0xe9e99['options']);return _0x46648d[_0x5f55('0x49')](_0x47d6cd);}})[_0x5f55('0x25')](function(_0x450644){if(_0x450644){_0x286d75=_0x450644['length'];if(!_0xe9e99[_0x5f55('0x30')][_0x5f55('0x48')](_0x5f55('0x4d'))){_0x47d6cd[_0x5f55('0x20')]=qs[_0x5f55('0x20')](_0xe9e99[_0x5f55('0x30')][_0x5f55('0x20')]);_0x47d6cd[_0x5f55('0x1d')]=qs[_0x5f55('0x1d')](_0xe9e99['query']['offset']);}return _0x46648d['getSubjects'](_0x47d6cd);}})[_0x5f55('0x25')](function(_0x2bfd68){if(_0x2bfd68){return _0x2bfd68?{'count':_0x286d75,'rows':_0x2bfd68}:null;}})['then'](respondWithResult(_0x370cbd,null))[_0x5f55('0x41')](handleError(_0x370cbd,null));};exports[_0x5f55('0x4e')]=function(_0xba748f,_0x55e945,_0x5b5f6e){var _0x470bec={};var _0x1cd1a3={};var _0x391a87;var _0x4dc051;return db['SalesforceConfiguration'][_0x5f55('0x4a')]({'where':{'id':_0xba748f[_0x5f55('0x42')]['id']}})['then'](handleEntityNotFound(_0x55e945,null))[_0x5f55('0x25')](function(_0xd229a1){if(_0xd229a1){_0x391a87=_0xd229a1;_0x1cd1a3[_0x5f55('0x35')]=_[_0x5f55('0x31')](db[_0x5f55('0x47')]['rawAttributes']);_0x1cd1a3[_0x5f55('0x30')]=_[_0x5f55('0x31')](_0xba748f[_0x5f55('0x30')]);_0x1cd1a3[_0x5f55('0x32')]=_['intersection'](_0x1cd1a3[_0x5f55('0x35')],_0x1cd1a3[_0x5f55('0x30')]);_0x470bec[_0x5f55('0x34')]=_['intersection'](_0x1cd1a3[_0x5f55('0x35')],qs[_0x5f55('0x36')](_0xba748f['query']['fields']));_0x470bec[_0x5f55('0x34')]=_0x470bec[_0x5f55('0x34')][_0x5f55('0x37')]?_0x470bec[_0x5f55('0x34')]:_0x1cd1a3[_0x5f55('0x35')];_0x470bec['order']=qs[_0x5f55('0x38')](_0xba748f[_0x5f55('0x30')][_0x5f55('0x38')]);_0x470bec[_0x5f55('0x39')]=qs[_0x5f55('0x32')](_['pick'](_0xba748f[_0x5f55('0x30')],_0x1cd1a3[_0x5f55('0x32')]));if(_0xba748f[_0x5f55('0x30')][_0x5f55('0x4c')]){_0x470bec[_0x5f55('0x39')]=_[_0x5f55('0x3b')](_0x470bec[_0x5f55('0x39')],{'$or':_[_0x5f55('0x2b')](_0x470bec[_0x5f55('0x34')],function(_0x2cb48b){var _0x5dd86d={};_0x5dd86d[_0x2cb48b]={'$like':'%'+_0xba748f[_0x5f55('0x30')][_0x5f55('0x4c')]+'%'};return _0x5dd86d;})});}_0x470bec=_[_0x5f55('0x3b')]({},_0x470bec,_0xba748f[_0x5f55('0x3d')]);return _0x391a87['getDescriptions'](_0x470bec);}})[_0x5f55('0x25')](function(_0x613289){if(_0x613289){_0x4dc051=_0x613289[_0x5f55('0x37')];if(!_0xba748f[_0x5f55('0x30')][_0x5f55('0x48')](_0x5f55('0x4d'))){_0x470bec[_0x5f55('0x20')]=qs[_0x5f55('0x20')](_0xba748f[_0x5f55('0x30')][_0x5f55('0x20')]);_0x470bec[_0x5f55('0x1d')]=qs[_0x5f55('0x1d')](_0xba748f[_0x5f55('0x30')][_0x5f55('0x1d')]);}return _0x391a87['getDescriptions'](_0x470bec);}})[_0x5f55('0x25')](function(_0xd53d7c){if(_0xd53d7c){return _0xd53d7c?{'count':_0x4dc051,'rows':_0xd53d7c}:null;}})['then'](respondWithResult(_0x55e945,null))[_0x5f55('0x41')](handleError(_0x55e945,null));};
\ No newline at end of file
+var _0x9f8b=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','json','apply','update','then','destroy','end','error','stack','name','send','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','SalesforceField','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox'];(function(_0x50250b,_0x2815e3){var _0x45f5eb=function(_0x37c2){while(--_0x37c2){_0x50250b['push'](_0x50250b['shift']());}};_0x45f5eb(++_0x2815e3);}(_0x9f8b,0x9a));var _0xb9f8=function(_0x4528f5,_0x4caa39){_0x4528f5=_0x4528f5-0x0;var _0x28b6d2=_0x9f8b[_0x4528f5];return _0x28b6d2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb9f8('0x0'));var zipdir=require(_0xb9f8('0x1'));var jsonpatch=require(_0xb9f8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb9f8('0x3'));var Mustache=require(_0xb9f8('0x4'));var util=require(_0xb9f8('0x5'));var path=require(_0xb9f8('0x6'));var sox=require(_0xb9f8('0x7'));var csv=require(_0xb9f8('0x8'));var ejs=require(_0xb9f8('0x9'));var fs=require('fs');var fs_extra=require(_0xb9f8('0xa'));var _=require(_0xb9f8('0xb'));var squel=require(_0xb9f8('0xc'));var crypto=require(_0xb9f8('0xd'));var jsforce=require(_0xb9f8('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb9f8('0x8'));var querystring=require('querystring');var Papa=require(_0xb9f8('0xf'));var Redis=require(_0xb9f8('0x10'));var authService=require(_0xb9f8('0x11'));var qs=require(_0xb9f8('0x12'));var as=require(_0xb9f8('0x13'));var hardwareService=require(_0xb9f8('0x14'));var logger=require(_0xb9f8('0x15'))(_0xb9f8('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb9f8('0x17'));var db=require(_0xb9f8('0x18'))['db'];function respondWithStatusCode(_0xebbe5,_0x452eb4){_0x452eb4=_0x452eb4||0xcc;return function(_0x59a7c4){if(_0x59a7c4){return _0xebbe5[_0xb9f8('0x19')](_0x452eb4);}return _0xebbe5[_0xb9f8('0x1a')](_0x452eb4)['end']();};}function respondWithResult(_0x12d515,_0x58eff6){_0x58eff6=_0x58eff6||0xc8;return function(_0xc9e2cf){if(_0xc9e2cf){return _0x12d515[_0xb9f8('0x1a')](_0x58eff6)['json'](_0xc9e2cf);}};}function respondWithFilteredResult(_0x13fe36,_0x551411){return function(_0x175b30){if(_0x175b30){var _0x1c40ef=typeof _0x551411['offset']===_0xb9f8('0x1b')&&typeof _0x551411[_0xb9f8('0x1c')]===_0xb9f8('0x1b');var _0x5b8df7=_0x175b30[_0xb9f8('0x1d')];var _0x15226c=_0x1c40ef?0x0:_0x551411[_0xb9f8('0x1e')];var _0x37c688=_0x1c40ef?_0x175b30[_0xb9f8('0x1d')]:_0x551411['offset']+_0x551411[_0xb9f8('0x1c')];var _0x472871;if(_0x37c688>=_0x5b8df7){_0x37c688=_0x5b8df7;_0x472871=0xc8;}else{_0x472871=0xce;}_0x13fe36[_0xb9f8('0x1a')](_0x472871);return _0x13fe36[_0xb9f8('0x1f')]('Content-Range',_0x15226c+'-'+_0x37c688+'/'+_0x5b8df7)[_0xb9f8('0x20')](_0x175b30);}return null;};}function patchUpdates(_0x539afc){return function(_0x4d224c){try{jsonpatch[_0xb9f8('0x21')](_0x4d224c,_0x539afc,!![]);}catch(_0x25a32d){return BPromise['reject'](_0x25a32d);}return _0x4d224c['save']();};}function saveUpdates(_0x264294,_0x543253){return function(_0x31fb6e){if(_0x31fb6e){return _0x31fb6e[_0xb9f8('0x22')](_0x264294)[_0xb9f8('0x23')](function(_0x5ed7b8){return _0x5ed7b8;});}return null;};}function removeEntity(_0x4a3028,_0x14bb0d){return function(_0x29915f){if(_0x29915f){return _0x29915f[_0xb9f8('0x24')]()[_0xb9f8('0x23')](function(){_0x4a3028[_0xb9f8('0x1a')](0xcc)[_0xb9f8('0x25')]();});}};}function handleEntityNotFound(_0x1f19b3,_0x32bed9){return function(_0x11b4f8){if(!_0x11b4f8){_0x1f19b3[_0xb9f8('0x19')](0x194);}return _0x11b4f8;};}function handleError(_0x2645e1,_0x105c95){_0x105c95=_0x105c95||0x1f4;return function(_0x5e8b66){logger[_0xb9f8('0x26')](_0x5e8b66[_0xb9f8('0x27')]);if(_0x5e8b66[_0xb9f8('0x28')]){delete _0x5e8b66[_0xb9f8('0x28')];}_0x2645e1[_0xb9f8('0x1a')](_0x105c95)[_0xb9f8('0x29')](_0x5e8b66);};}exports['index']=function(_0x2bd99d,_0x19c7ec){var _0x237e63={},_0x20a02c={},_0x2fa2b4={'count':0x0,'rows':[]};var _0x580550=_[_0xb9f8('0x2a')](db[_0xb9f8('0x2b')][_0xb9f8('0x2c')],function(_0x3c1244){return{'name':_0x3c1244[_0xb9f8('0x2d')],'type':_0x3c1244[_0xb9f8('0x2e')][_0xb9f8('0x2f')]};});_0x20a02c['model']=_[_0xb9f8('0x2a')](_0x580550,_0xb9f8('0x28'));_0x20a02c[_0xb9f8('0x30')]=_[_0xb9f8('0x31')](_0x2bd99d[_0xb9f8('0x30')]);_0x20a02c[_0xb9f8('0x32')]=_[_0xb9f8('0x33')](_0x20a02c[_0xb9f8('0x34')],_0x20a02c[_0xb9f8('0x30')]);_0x237e63[_0xb9f8('0x35')]=_[_0xb9f8('0x33')](_0x20a02c[_0xb9f8('0x34')],qs[_0xb9f8('0x36')](_0x2bd99d[_0xb9f8('0x30')][_0xb9f8('0x36')]));_0x237e63['attributes']=_0x237e63[_0xb9f8('0x35')][_0xb9f8('0x37')]?_0x237e63['attributes']:_0x20a02c[_0xb9f8('0x34')];if(!_0x2bd99d[_0xb9f8('0x30')][_0xb9f8('0x38')](_0xb9f8('0x39'))){_0x237e63[_0xb9f8('0x1c')]=qs[_0xb9f8('0x1c')](_0x2bd99d['query'][_0xb9f8('0x1c')]);_0x237e63[_0xb9f8('0x1e')]=qs[_0xb9f8('0x1e')](_0x2bd99d[_0xb9f8('0x30')][_0xb9f8('0x1e')]);}_0x237e63[_0xb9f8('0x3a')]=qs[_0xb9f8('0x3b')](_0x2bd99d[_0xb9f8('0x30')]['sort']);_0x237e63[_0xb9f8('0x3c')]=qs[_0xb9f8('0x32')](_[_0xb9f8('0x3d')](_0x2bd99d[_0xb9f8('0x30')],_0x20a02c['filters']),_0x580550);if(_0x2bd99d[_0xb9f8('0x30')]['filter']){_0x237e63[_0xb9f8('0x3c')]=_[_0xb9f8('0x3e')](_0x237e63[_0xb9f8('0x3c')],{'$or':_[_0xb9f8('0x2a')](_0x580550,function(_0x1c3352){if(_0x1c3352[_0xb9f8('0x2e')]!==_0xb9f8('0x3f')){var _0x54661b={};_0x54661b[_0x1c3352['name']]={'$like':'%'+_0x2bd99d['query'][_0xb9f8('0x40')]+'%'};return _0x54661b;}})});}_0x237e63=_['merge']({},_0x237e63,_0x2bd99d[_0xb9f8('0x41')]);var _0x3025e9={'where':_0x237e63[_0xb9f8('0x3c')]};return db[_0xb9f8('0x2b')][_0xb9f8('0x1d')](_0x3025e9)[_0xb9f8('0x23')](function(_0x8e9336){_0x2fa2b4[_0xb9f8('0x1d')]=_0x8e9336;if(_0x2bd99d[_0xb9f8('0x30')][_0xb9f8('0x42')]){_0x237e63[_0xb9f8('0x43')]=[{'all':!![]}];}return db[_0xb9f8('0x2b')][_0xb9f8('0x44')](_0x237e63);})['then'](function(_0x188ce7){_0x2fa2b4[_0xb9f8('0x45')]=_0x188ce7;return _0x2fa2b4;})['then'](respondWithFilteredResult(_0x19c7ec,_0x237e63))[_0xb9f8('0x46')](handleError(_0x19c7ec,null));};exports[_0xb9f8('0x47')]=function(_0x4bb3e3,_0x45f97f){var _0x28f85f={'raw':![],'where':{'id':_0x4bb3e3[_0xb9f8('0x48')]['id']}},_0x47514e={};_0x47514e['model']=_[_0xb9f8('0x31')](db['SalesforceConfiguration'][_0xb9f8('0x2c')]);_0x47514e[_0xb9f8('0x30')]=_[_0xb9f8('0x31')](_0x4bb3e3[_0xb9f8('0x30')]);_0x47514e[_0xb9f8('0x32')]=_['intersection'](_0x47514e['model'],_0x47514e['query']);_0x28f85f[_0xb9f8('0x35')]=_[_0xb9f8('0x33')](_0x47514e[_0xb9f8('0x34')],qs['fields'](_0x4bb3e3[_0xb9f8('0x30')]['fields']));_0x28f85f[_0xb9f8('0x35')]=_0x28f85f['attributes'][_0xb9f8('0x37')]?_0x28f85f[_0xb9f8('0x35')]:_0x47514e[_0xb9f8('0x34')];if(_0x4bb3e3[_0xb9f8('0x30')][_0xb9f8('0x42')]){_0x28f85f[_0xb9f8('0x43')]=[{'all':!![]}];}_0x28f85f=_[_0xb9f8('0x3e')]({},_0x28f85f,_0x4bb3e3[_0xb9f8('0x41')]);return db[_0xb9f8('0x2b')][_0xb9f8('0x49')](_0x28f85f)['then'](handleEntityNotFound(_0x45f97f,null))['then'](respondWithResult(_0x45f97f,null))[_0xb9f8('0x46')](handleError(_0x45f97f,null));};exports[_0xb9f8('0x4a')]=function(_0x3aba11,_0x49d777){return db[_0xb9f8('0x2b')]['create'](_0x3aba11[_0xb9f8('0x4b')],{})['then'](respondWithResult(_0x49d777,0xc9))[_0xb9f8('0x46')](handleError(_0x49d777,null));};exports[_0xb9f8('0x22')]=function(_0xe86e56,_0xd279ed){if(_0xe86e56[_0xb9f8('0x4b')]['id']){delete _0xe86e56[_0xb9f8('0x4b')]['id'];}return db['SalesforceConfiguration'][_0xb9f8('0x49')]({'where':{'id':_0xe86e56[_0xb9f8('0x48')]['id']}})['then'](handleEntityNotFound(_0xd279ed,null))[_0xb9f8('0x23')](saveUpdates(_0xe86e56[_0xb9f8('0x4b')],null))[_0xb9f8('0x23')](respondWithResult(_0xd279ed,null))[_0xb9f8('0x46')](handleError(_0xd279ed,null));};exports[_0xb9f8('0x24')]=function(_0x222816,_0x40f3f2){return db[_0xb9f8('0x2b')]['find']({'where':{'id':_0x222816[_0xb9f8('0x48')]['id']}})[_0xb9f8('0x23')](handleEntityNotFound(_0x40f3f2,null))['then'](removeEntity(_0x40f3f2,null))[_0xb9f8('0x46')](handleError(_0x40f3f2,null));};exports[_0xb9f8('0x4c')]=function(_0x27184d,_0x28912a,_0x4bc403){var _0x5bdf8e={};var _0x13925d={};var _0x207806;var _0x27a43f;return db[_0xb9f8('0x2b')][_0xb9f8('0x4d')]({'where':{'id':_0x27184d[_0xb9f8('0x48')]['id']}})[_0xb9f8('0x23')](handleEntityNotFound(_0x28912a,null))[_0xb9f8('0x23')](function(_0x1cb27e){if(_0x1cb27e){_0x207806=_0x1cb27e;_0x13925d['model']=_[_0xb9f8('0x31')](db[_0xb9f8('0x4e')]['rawAttributes']);_0x13925d['query']=_[_0xb9f8('0x31')](_0x27184d[_0xb9f8('0x30')]);_0x13925d['filters']=_[_0xb9f8('0x33')](_0x13925d[_0xb9f8('0x34')],_0x13925d[_0xb9f8('0x30')]);_0x5bdf8e[_0xb9f8('0x35')]=_[_0xb9f8('0x33')](_0x13925d[_0xb9f8('0x34')],qs[_0xb9f8('0x36')](_0x27184d['query'][_0xb9f8('0x36')]));_0x5bdf8e[_0xb9f8('0x35')]=_0x5bdf8e[_0xb9f8('0x35')][_0xb9f8('0x37')]?_0x5bdf8e[_0xb9f8('0x35')]:_0x13925d['model'];_0x5bdf8e['order']=qs[_0xb9f8('0x3b')](_0x27184d['query'][_0xb9f8('0x3b')]);_0x5bdf8e[_0xb9f8('0x3c')]=qs[_0xb9f8('0x32')](_[_0xb9f8('0x3d')](_0x27184d[_0xb9f8('0x30')],_0x13925d[_0xb9f8('0x32')]));if(_0x27184d[_0xb9f8('0x30')][_0xb9f8('0x40')]){_0x5bdf8e[_0xb9f8('0x3c')]=_[_0xb9f8('0x3e')](_0x5bdf8e[_0xb9f8('0x3c')],{'$or':_[_0xb9f8('0x2a')](_0x5bdf8e['attributes'],function(_0x3c7701){var _0x37fc7d={};_0x37fc7d[_0x3c7701]={'$like':'%'+_0x27184d['query']['filter']+'%'};return _0x37fc7d;})});}_0x5bdf8e=_[_0xb9f8('0x3e')]({},_0x5bdf8e,_0x27184d['options']);return _0x207806[_0xb9f8('0x4c')](_0x5bdf8e);}})['then'](function(_0x5d9260){if(_0x5d9260){_0x27a43f=_0x5d9260[_0xb9f8('0x37')];if(!_0x27184d['query']['hasOwnProperty'](_0xb9f8('0x39'))){_0x5bdf8e['limit']=qs[_0xb9f8('0x1c')](_0x27184d[_0xb9f8('0x30')][_0xb9f8('0x1c')]);_0x5bdf8e[_0xb9f8('0x1e')]=qs['offset'](_0x27184d[_0xb9f8('0x30')][_0xb9f8('0x1e')]);}return _0x207806[_0xb9f8('0x4c')](_0x5bdf8e);}})[_0xb9f8('0x23')](function(_0x5d26d4){if(_0x5d26d4){return _0x5d26d4?{'count':_0x27a43f,'rows':_0x5d26d4}:null;}})[_0xb9f8('0x23')](respondWithResult(_0x28912a,null))[_0xb9f8('0x46')](handleError(_0x28912a,null));};exports[_0xb9f8('0x4f')]=function(_0x2a5255,_0x445ed8,_0x3d5c86){var _0x303903={};var _0x1bb2ed={};var _0x3bd3f9;var _0x42abdf;return db[_0xb9f8('0x2b')][_0xb9f8('0x4d')]({'where':{'id':_0x2a5255['params']['id']}})[_0xb9f8('0x23')](handleEntityNotFound(_0x445ed8,null))[_0xb9f8('0x23')](function(_0x24485c){if(_0x24485c){_0x3bd3f9=_0x24485c;_0x1bb2ed[_0xb9f8('0x34')]=_['keys'](db[_0xb9f8('0x4e')]['rawAttributes']);_0x1bb2ed['query']=_['keys'](_0x2a5255[_0xb9f8('0x30')]);_0x1bb2ed[_0xb9f8('0x32')]=_[_0xb9f8('0x33')](_0x1bb2ed['model'],_0x1bb2ed[_0xb9f8('0x30')]);_0x303903['attributes']=_[_0xb9f8('0x33')](_0x1bb2ed[_0xb9f8('0x34')],qs[_0xb9f8('0x36')](_0x2a5255['query'][_0xb9f8('0x36')]));_0x303903[_0xb9f8('0x35')]=_0x303903[_0xb9f8('0x35')]['length']?_0x303903['attributes']:_0x1bb2ed[_0xb9f8('0x34')];_0x303903[_0xb9f8('0x3a')]=qs[_0xb9f8('0x3b')](_0x2a5255[_0xb9f8('0x30')]['sort']);_0x303903[_0xb9f8('0x3c')]=qs[_0xb9f8('0x32')](_[_0xb9f8('0x3d')](_0x2a5255[_0xb9f8('0x30')],_0x1bb2ed[_0xb9f8('0x32')]));if(_0x2a5255['query'][_0xb9f8('0x40')]){_0x303903[_0xb9f8('0x3c')]=_[_0xb9f8('0x3e')](_0x303903['where'],{'$or':_[_0xb9f8('0x2a')](_0x303903[_0xb9f8('0x35')],function(_0x3a907a){var _0xe783d={};_0xe783d[_0x3a907a]={'$like':'%'+_0x2a5255[_0xb9f8('0x30')]['filter']+'%'};return _0xe783d;})});}_0x303903=_[_0xb9f8('0x3e')]({},_0x303903,_0x2a5255['options']);return _0x3bd3f9[_0xb9f8('0x4f')](_0x303903);}})['then'](function(_0x12bd74){if(_0x12bd74){_0x42abdf=_0x12bd74[_0xb9f8('0x37')];if(!_0x2a5255['query'][_0xb9f8('0x38')]('nolimit')){_0x303903[_0xb9f8('0x1c')]=qs[_0xb9f8('0x1c')](_0x2a5255['query'][_0xb9f8('0x1c')]);_0x303903[_0xb9f8('0x1e')]=qs['offset'](_0x2a5255[_0xb9f8('0x30')]['offset']);}return _0x3bd3f9[_0xb9f8('0x4f')](_0x303903);}})[_0xb9f8('0x23')](function(_0x5bc2a3){if(_0x5bc2a3){return _0x5bc2a3?{'count':_0x42abdf,'rows':_0x5bc2a3}:null;}})[_0xb9f8('0x23')](respondWithResult(_0x445ed8,null))[_0xb9f8('0x46')](handleError(_0x445ed8,null));};exports[_0xb9f8('0x50')]=function(_0x5a16ed,_0x115c75,_0x5f4543){var _0x3ab5e7={};var _0x3a87ba={};var _0x233c81;var _0x2b9b41;return db[_0xb9f8('0x2b')][_0xb9f8('0x4d')]({'where':{'id':_0x5a16ed[_0xb9f8('0x48')]['id']}})['then'](handleEntityNotFound(_0x115c75,null))[_0xb9f8('0x23')](function(_0x33c33d){if(_0x33c33d){_0x233c81=_0x33c33d;_0x3a87ba[_0xb9f8('0x34')]=_[_0xb9f8('0x31')](db[_0xb9f8('0x4e')][_0xb9f8('0x2c')]);_0x3a87ba[_0xb9f8('0x30')]=_['keys'](_0x5a16ed['query']);_0x3a87ba[_0xb9f8('0x32')]=_[_0xb9f8('0x33')](_0x3a87ba[_0xb9f8('0x34')],_0x3a87ba[_0xb9f8('0x30')]);_0x3ab5e7[_0xb9f8('0x35')]=_[_0xb9f8('0x33')](_0x3a87ba[_0xb9f8('0x34')],qs[_0xb9f8('0x36')](_0x5a16ed['query'][_0xb9f8('0x36')]));_0x3ab5e7[_0xb9f8('0x35')]=_0x3ab5e7[_0xb9f8('0x35')][_0xb9f8('0x37')]?_0x3ab5e7['attributes']:_0x3a87ba[_0xb9f8('0x34')];_0x3ab5e7[_0xb9f8('0x3a')]=qs[_0xb9f8('0x3b')](_0x5a16ed[_0xb9f8('0x30')][_0xb9f8('0x3b')]);_0x3ab5e7[_0xb9f8('0x3c')]=qs[_0xb9f8('0x32')](_[_0xb9f8('0x3d')](_0x5a16ed[_0xb9f8('0x30')],_0x3a87ba[_0xb9f8('0x32')]));if(_0x5a16ed[_0xb9f8('0x30')][_0xb9f8('0x40')]){_0x3ab5e7[_0xb9f8('0x3c')]=_[_0xb9f8('0x3e')](_0x3ab5e7[_0xb9f8('0x3c')],{'$or':_[_0xb9f8('0x2a')](_0x3ab5e7[_0xb9f8('0x35')],function(_0x43fe59){var _0x2dfb95={};_0x2dfb95[_0x43fe59]={'$like':'%'+_0x5a16ed[_0xb9f8('0x30')]['filter']+'%'};return _0x2dfb95;})});}_0x3ab5e7=_[_0xb9f8('0x3e')]({},_0x3ab5e7,_0x5a16ed[_0xb9f8('0x41')]);return _0x233c81[_0xb9f8('0x50')](_0x3ab5e7);}})[_0xb9f8('0x23')](function(_0x2b1e52){if(_0x2b1e52){_0x2b9b41=_0x2b1e52[_0xb9f8('0x37')];if(!_0x5a16ed[_0xb9f8('0x30')][_0xb9f8('0x38')]('nolimit')){_0x3ab5e7[_0xb9f8('0x1c')]=qs[_0xb9f8('0x1c')](_0x5a16ed[_0xb9f8('0x30')][_0xb9f8('0x1c')]);_0x3ab5e7[_0xb9f8('0x1e')]=qs[_0xb9f8('0x1e')](_0x5a16ed[_0xb9f8('0x30')][_0xb9f8('0x1e')]);}return _0x233c81[_0xb9f8('0x50')](_0x3ab5e7);}})['then'](function(_0x5376cd){if(_0x5376cd){return _0x5376cd?{'count':_0x2b9b41,'rows':_0x5376cd}:null;}})[_0xb9f8('0x23')](respondWithResult(_0x115c75,null))[_0xb9f8('0x46')](handleError(_0x115c75,null));};
\ No newline at end of file
index dbf3313..ef28ebf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33a9=['int_salesforce_configurations','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x33a9,0x76));var _0x933a=function(_0x5e0bfe,_0x747312){_0x5e0bfe=_0x5e0bfe-0x0;var _0x6468b8=_0x33a9[_0x5e0bfe];return _0x6468b8;};'use strict';var _=require(_0x933a('0x0'));var util=require(_0x933a('0x1'));var logger=require(_0x933a('0x2'))(_0x933a('0x3'));var moment=require('moment');var BPromise=require(_0x933a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x933a('0x5'));var rimraf=require(_0x933a('0x6'));var config=require(_0x933a('0x7'));var attributes=require(_0x933a('0x8'));module[_0x933a('0x9')]=function(_0x38b748,_0x52f436){return _0x38b748[_0x933a('0xa')](_0x933a('0xb'),attributes,{'tableName':_0x933a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x78ff=['SalesforceConfiguration','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x78ff,0x191));var _0xf78f=function(_0x40130d,_0x26895b){_0x40130d=_0x40130d-0x0;var _0x418b98=_0x78ff[_0x40130d];return _0x418b98;};'use strict';var _=require(_0xf78f('0x0'));var util=require('util');var logger=require(_0xf78f('0x1'))(_0xf78f('0x2'));var moment=require(_0xf78f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf78f('0x4'));var rimraf=require(_0xf78f('0x5'));var config=require(_0xf78f('0x6'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xf78f('0x7')]=function(_0x5ed315,_0x5dde47){return _0x5ed315[_0xf78f('0x8')](_0xf78f('0x9'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 814f486..68079a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1572=['rpc','client','http','request','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x5412b8,_0x467f34){var _0x377de6=function(_0x25c8f4){while(--_0x25c8f4){_0x5412b8['push'](_0x5412b8['shift']());}};_0x377de6(++_0x467f34);}(_0x1572,0x150));var _0x2157=function(_0xb29034,_0x1d28df){_0xb29034=_0xb29034-0x0;var _0x35e522=_0x1572[_0xb29034];return _0x35e522;};'use strict';var _=require(_0x2157('0x0'));var util=require(_0x2157('0x1'));var moment=require('moment');var BPromise=require(_0x2157('0x2'));var rs=require(_0x2157('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2157('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2157('0x5'))(_0x2157('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2157('0x7')][_0x2157('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x150a07,_0x57f943,_0x30441f){return new BPromise(function(_0x2d0be3,_0x445192){return client[_0x2157('0x9')](_0x150a07,_0x30441f)['then'](function(_0x4d5ff9){logger['info'](_0x2157('0xa'),_0x57f943,_0x2157('0xb'));logger['debug'](_0x2157('0xc'),_0x57f943,_0x2157('0xb'),JSON[_0x2157('0xd')](_0x4d5ff9));if(_0x4d5ff9['error']){if(_0x4d5ff9['error'][_0x2157('0xe')]===0x1f4){logger['error'](_0x2157('0xa'),_0x57f943,_0x4d5ff9['error'][_0x2157('0xf')]);return _0x445192(_0x4d5ff9[_0x2157('0x10')][_0x2157('0xf')]);}logger[_0x2157('0x10')](_0x2157('0xa'),_0x57f943,_0x4d5ff9['error'][_0x2157('0xf')]);return _0x2d0be3(_0x4d5ff9[_0x2157('0x10')][_0x2157('0xf')]);}else{logger['info'](_0x2157('0xa'),_0x57f943,_0x2157('0xb'));_0x2d0be3(_0x4d5ff9[_0x2157('0x11')][_0x2157('0xf')]);}})[_0x2157('0x12')](function(_0x44eb3c){logger[_0x2157('0x10')](_0x2157('0xa'),_0x57f943,_0x44eb3c);_0x445192(_0x44eb3c);});});}
\ No newline at end of file
+var _0x45b7=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x1f51c0,_0x1db084){var _0xa15b21=function(_0x191751){while(--_0x191751){_0x1f51c0['push'](_0x1f51c0['shift']());}};_0xa15b21(++_0x1db084);}(_0x45b7,0x17f));var _0x745b=function(_0x5bd94d,_0x5701b2){_0x5bd94d=_0x5bd94d-0x0;var _0x40aa18=_0x45b7[_0x5bd94d];return _0x40aa18;};'use strict';var _=require(_0x745b('0x0'));var util=require(_0x745b('0x1'));var moment=require(_0x745b('0x2'));var BPromise=require(_0x745b('0x3'));var rs=require(_0x745b('0x4'));var fs=require('fs');var Redis=require(_0x745b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x745b('0x6'));var logger=require(_0x745b('0x7'))(_0x745b('0x8'));var config=require(_0x745b('0x9'));var jayson=require(_0x745b('0xa'));var client=jayson[_0x745b('0xb')][_0x745b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38ecf3,_0x57fee1,_0x299993){return new BPromise(function(_0x52097d,_0x378db1){return client[_0x745b('0xd')](_0x38ecf3,_0x299993)['then'](function(_0x488c06){logger[_0x745b('0xe')](_0x745b('0xf'),_0x57fee1,_0x745b('0x10'));logger[_0x745b('0x11')](_0x745b('0x12'),_0x57fee1,'request\x20sent',JSON['stringify'](_0x488c06));if(_0x488c06[_0x745b('0x13')]){if(_0x488c06['error'][_0x745b('0x14')]===0x1f4){logger['error'](_0x745b('0xf'),_0x57fee1,_0x488c06[_0x745b('0x13')][_0x745b('0x15')]);return _0x378db1(_0x488c06[_0x745b('0x13')][_0x745b('0x15')]);}logger['error'](_0x745b('0xf'),_0x57fee1,_0x488c06[_0x745b('0x13')][_0x745b('0x15')]);return _0x52097d(_0x488c06[_0x745b('0x13')][_0x745b('0x15')]);}else{logger['info'](_0x745b('0xf'),_0x57fee1,_0x745b('0x10'));_0x52097d(_0x488c06[_0x745b('0x16')][_0x745b('0x15')]);}})[_0x745b('0x17')](function(_0x126484){logger[_0x745b('0x13')](_0x745b('0xf'),_0x57fee1,_0x126484);_0x378db1(_0x126484);});});}
\ No newline at end of file
index 886d26f..a85ffb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fc3=['/:id','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','show','post','create','update','delete'];(function(_0xa80c0c,_0x28a9bc){var _0x4a3bf3=function(_0x3d02f9){while(--_0x3d02f9){_0xa80c0c['push'](_0xa80c0c['shift']());}};_0x4a3bf3(++_0x28a9bc);}(_0x7fc3,0x1b2));var _0x37fc=function(_0x2c592d,_0x73482d){_0x2c592d=_0x2c592d-0x0;var _0x13bf03=_0x7fc3[_0x2c592d];return _0x13bf03;};'use strict';var multer=require(_0x37fc('0x0'));var util=require(_0x37fc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x37fc('0x2'));var router=express[_0x37fc('0x3')]();var fs_extra=require(_0x37fc('0x4'));var auth=require(_0x37fc('0x5'));var interaction=require(_0x37fc('0x6'));var config=require(_0x37fc('0x7'));var controller=require(_0x37fc('0x8'));router[_0x37fc('0x9')]('/',auth[_0x37fc('0xa')](),controller['index']);router[_0x37fc('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x37fc('0xb')]);router[_0x37fc('0xc')]('/',auth[_0x37fc('0xa')](),controller[_0x37fc('0xd')]);router['put']('/:id',auth[_0x37fc('0xa')](),controller[_0x37fc('0xe')]);router[_0x37fc('0xf')](_0x37fc('0x10'),auth[_0x37fc('0xa')](),controller[_0x37fc('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xdfb1=['create','put','update','destroy','multer','util','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xdfb1,0xd6));var _0x1dfb=function(_0x4703bf,_0x5858e7){_0x4703bf=_0x4703bf-0x0;var _0x20759b=_0xdfb1[_0x4703bf];return _0x20759b;};'use strict';var multer=require(_0x1dfb('0x0'));var util=require(_0x1dfb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1dfb('0x2'));var router=express[_0x1dfb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1dfb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1dfb('0x5'));var controller=require('./intSalesforceField.controller');router[_0x1dfb('0x6')]('/',auth[_0x1dfb('0x7')](),controller[_0x1dfb('0x8')]);router[_0x1dfb('0x6')](_0x1dfb('0x9'),auth[_0x1dfb('0x7')](),controller[_0x1dfb('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1dfb('0xb')]);router[_0x1dfb('0xc')](_0x1dfb('0x9'),auth[_0x1dfb('0x7')](),controller[_0x1dfb('0xd')]);router['delete'](_0x1dfb('0x9'),auth[_0x1dfb('0x7')](),controller[_0x1dfb('0xe')]);module['exports']=router;
\ No newline at end of file
index 34783f4..2d870c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67c8=['STRING','customVariable','sequelize','exports','ENUM','variable','keyValue','string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x67c8,0x18a));var _0x867c=function(_0x38ebf3,_0x50cb16){_0x38ebf3=_0x38ebf3-0x0;var _0x29d6de=_0x67c8[_0x38ebf3];return _0x29d6de;};'use strict';var Sequelize=require(_0x867c('0x0'));module[_0x867c('0x1')]={'type':{'type':Sequelize[_0x867c('0x2')]('string',_0x867c('0x3'),'customVariable',_0x867c('0x4'),'picklist'),'defaultValue':_0x867c('0x5')},'content':{'type':Sequelize[_0x867c('0x6')]},'key':{'type':Sequelize[_0x867c('0x6')]},'keyType':{'type':Sequelize[_0x867c('0x2')]('string',_0x867c('0x3'),_0x867c('0x7'))},'keyContent':{'type':Sequelize[_0x867c('0x6')]},'idField':{'type':Sequelize[_0x867c('0x6')]},'variableName':{'type':Sequelize[_0x867c('0x6')]}};
\ No newline at end of file
+var _0xe6ce=['picklist','STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x1d75d5,_0x24eac7){var _0x526648=function(_0x4e33ea){while(--_0x4e33ea){_0x1d75d5['push'](_0x1d75d5['shift']());}};_0x526648(++_0x24eac7);}(_0xe6ce,0x18e));var _0xee6c=function(_0x28732e,_0x14ac0a){_0x28732e=_0x28732e-0x0;var _0x8208fa=_0xe6ce[_0x28732e];return _0x8208fa;};'use strict';var Sequelize=require(_0xee6c('0x0'));module[_0xee6c('0x1')]={'type':{'type':Sequelize[_0xee6c('0x2')](_0xee6c('0x3'),_0xee6c('0x4'),_0xee6c('0x5'),_0xee6c('0x6'),_0xee6c('0x7')),'defaultValue':_0xee6c('0x3')},'content':{'type':Sequelize[_0xee6c('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xee6c('0x2')](_0xee6c('0x3'),_0xee6c('0x4'),_0xee6c('0x5'))},'keyContent':{'type':Sequelize[_0xee6c('0x8')]},'idField':{'type':Sequelize[_0xee6c('0x8')]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 434dacb..4a2e0f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7ce=['fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','options','includeAll','include','findAll','catch','show','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','index','SalesforceField','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x7f816c,_0x25f12e){var _0x9106ca=function(_0x9958b3){while(--_0x9958b3){_0x7f816c['push'](_0x7f816c['shift']());}};_0x9106ca(++_0x25f12e);}(_0xa7ce,0xaa));var _0xea7c=function(_0xbb3b7b,_0x3c7008){_0xbb3b7b=_0xbb3b7b-0x0;var _0x511a54=_0xa7ce[_0xbb3b7b];return _0x511a54;};'use strict';var emlformat=require(_0xea7c('0x0'));var rimraf=require(_0xea7c('0x1'));var zipdir=require(_0xea7c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea7c('0x3'));var moment=require(_0xea7c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xea7c('0x5'));var util=require(_0xea7c('0x6'));var path=require(_0xea7c('0x7'));var sox=require(_0xea7c('0x8'));var csv=require(_0xea7c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xea7c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xea7c('0xb'));var jsforce=require(_0xea7c('0xc'));var deskjs=require(_0xea7c('0xd'));var toCsv=require(_0xea7c('0x9'));var querystring=require('querystring');var Papa=require(_0xea7c('0xe'));var Redis=require(_0xea7c('0xf'));var authService=require(_0xea7c('0x10'));var qs=require(_0xea7c('0x11'));var as=require(_0xea7c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea7c('0x13'))(_0xea7c('0x14'));var utils=require(_0xea7c('0x15'));var config=require(_0xea7c('0x16'));var licenseUtil=require(_0xea7c('0x17'));var db=require(_0xea7c('0x18'))['db'];function respondWithStatusCode(_0x307c5e,_0xae68bf){_0xae68bf=_0xae68bf||0xcc;return function(_0x24219c){if(_0x24219c){return _0x307c5e[_0xea7c('0x19')](_0xae68bf);}return _0x307c5e[_0xea7c('0x1a')](_0xae68bf)[_0xea7c('0x1b')]();};}function respondWithResult(_0x5339df,_0x2cea00){_0x2cea00=_0x2cea00||0xc8;return function(_0x17d39e){if(_0x17d39e){return _0x5339df[_0xea7c('0x1a')](_0x2cea00)['json'](_0x17d39e);}};}function respondWithFilteredResult(_0x1125ef,_0x153f89){return function(_0x13b5a3){if(_0x13b5a3){var _0x2795aa=typeof _0x153f89[_0xea7c('0x1c')]===_0xea7c('0x1d')&&typeof _0x153f89[_0xea7c('0x1e')]==='undefined';var _0x4483ec=_0x13b5a3[_0xea7c('0x1f')];var _0x1b28f4=_0x2795aa?0x0:_0x153f89['offset'];var _0x154f4b=_0x2795aa?_0x13b5a3[_0xea7c('0x1f')]:_0x153f89[_0xea7c('0x1c')]+_0x153f89[_0xea7c('0x1e')];var _0x9107e4;if(_0x154f4b>=_0x4483ec){_0x154f4b=_0x4483ec;_0x9107e4=0xc8;}else{_0x9107e4=0xce;}_0x1125ef[_0xea7c('0x1a')](_0x9107e4);return _0x1125ef['set'](_0xea7c('0x20'),_0x1b28f4+'-'+_0x154f4b+'/'+_0x4483ec)[_0xea7c('0x21')](_0x13b5a3);}return null;};}function patchUpdates(_0x5b4254){return function(_0x2d823d){try{jsonpatch[_0xea7c('0x22')](_0x2d823d,_0x5b4254,!![]);}catch(_0x46733f){return BPromise[_0xea7c('0x23')](_0x46733f);}return _0x2d823d[_0xea7c('0x24')]();};}function saveUpdates(_0x339001,_0x1607d7){return function(_0x51d20e){if(_0x51d20e){return _0x51d20e[_0xea7c('0x25')](_0x339001)['then'](function(_0x5976cd){return _0x5976cd;});}return null;};}function removeEntity(_0x58070b,_0x411baa){return function(_0x2b97ab){if(_0x2b97ab){return _0x2b97ab[_0xea7c('0x26')]()[_0xea7c('0x27')](function(){_0x58070b['status'](0xcc)[_0xea7c('0x1b')]();});}};}function handleEntityNotFound(_0x3d7286,_0x283115){return function(_0xe6fde5){if(!_0xe6fde5){_0x3d7286['sendStatus'](0x194);}return _0xe6fde5;};}function handleError(_0x248291,_0x2089de){_0x2089de=_0x2089de||0x1f4;return function(_0x1922c8){logger[_0xea7c('0x28')](_0x1922c8[_0xea7c('0x29')]);if(_0x1922c8[_0xea7c('0x2a')]){delete _0x1922c8[_0xea7c('0x2a')];}_0x248291[_0xea7c('0x1a')](_0x2089de)[_0xea7c('0x2b')](_0x1922c8);};}exports[_0xea7c('0x2c')]=function(_0x33415b,_0x5e4a1d){var _0x529fb8={},_0x5cd35b={},_0x5b69c6={'count':0x0,'rows':[]};var _0x55b9fd=_['map'](db[_0xea7c('0x2d')]['rawAttributes'],function(_0x1b9fc4){return{'name':_0x1b9fc4[_0xea7c('0x2e')],'type':_0x1b9fc4[_0xea7c('0x2f')][_0xea7c('0x30')]};});_0x5cd35b[_0xea7c('0x31')]=_['map'](_0x55b9fd,_0xea7c('0x2a'));_0x5cd35b[_0xea7c('0x32')]=_[_0xea7c('0x33')](_0x33415b[_0xea7c('0x32')]);_0x5cd35b[_0xea7c('0x34')]=_[_0xea7c('0x35')](_0x5cd35b[_0xea7c('0x31')],_0x5cd35b['query']);_0x529fb8[_0xea7c('0x36')]=_[_0xea7c('0x35')](_0x5cd35b['model'],qs[_0xea7c('0x37')](_0x33415b[_0xea7c('0x32')][_0xea7c('0x37')]));_0x529fb8['attributes']=_0x529fb8[_0xea7c('0x36')][_0xea7c('0x38')]?_0x529fb8[_0xea7c('0x36')]:_0x5cd35b[_0xea7c('0x31')];if(!_0x33415b[_0xea7c('0x32')][_0xea7c('0x39')](_0xea7c('0x3a'))){_0x529fb8['limit']=qs[_0xea7c('0x1e')](_0x33415b['query'][_0xea7c('0x1e')]);_0x529fb8['offset']=qs[_0xea7c('0x1c')](_0x33415b[_0xea7c('0x32')][_0xea7c('0x1c')]);}_0x529fb8[_0xea7c('0x3b')]=qs[_0xea7c('0x3c')](_0x33415b[_0xea7c('0x32')][_0xea7c('0x3c')]);_0x529fb8[_0xea7c('0x3d')]=qs[_0xea7c('0x34')](_['pick'](_0x33415b[_0xea7c('0x32')],_0x5cd35b[_0xea7c('0x34')]),_0x55b9fd);if(_0x33415b[_0xea7c('0x32')][_0xea7c('0x3e')]){_0x529fb8[_0xea7c('0x3d')]=_[_0xea7c('0x3f')](_0x529fb8['where'],{'$or':_[_0xea7c('0x40')](_0x55b9fd,function(_0x9d726e){if(_0x9d726e[_0xea7c('0x2f')]!=='VIRTUAL'){var _0x27c071={};_0x27c071[_0x9d726e[_0xea7c('0x2a')]]={'$like':'%'+_0x33415b[_0xea7c('0x32')][_0xea7c('0x3e')]+'%'};return _0x27c071;}})});}_0x529fb8=_['merge']({},_0x529fb8,_0x33415b[_0xea7c('0x41')]);var _0x44cbff={'where':_0x529fb8['where']};return db['SalesforceField'][_0xea7c('0x1f')](_0x44cbff)[_0xea7c('0x27')](function(_0x2657f6){_0x5b69c6[_0xea7c('0x1f')]=_0x2657f6;if(_0x33415b[_0xea7c('0x32')][_0xea7c('0x42')]){_0x529fb8[_0xea7c('0x43')]=[{'all':!![]}];}return db[_0xea7c('0x2d')][_0xea7c('0x44')](_0x529fb8);})[_0xea7c('0x27')](function(_0x1d822a){_0x5b69c6['rows']=_0x1d822a;return _0x5b69c6;})[_0xea7c('0x27')](respondWithFilteredResult(_0x5e4a1d,_0x529fb8))[_0xea7c('0x45')](handleError(_0x5e4a1d,null));};exports[_0xea7c('0x46')]=function(_0x27adae,_0x3969b4){var _0x33eb52={'raw':!![],'where':{'id':_0x27adae['params']['id']}},_0x196a86={};_0x196a86[_0xea7c('0x31')]=_['keys'](db['SalesforceField'][_0xea7c('0x47')]);_0x196a86[_0xea7c('0x32')]=_[_0xea7c('0x33')](_0x27adae[_0xea7c('0x32')]);_0x196a86[_0xea7c('0x34')]=_[_0xea7c('0x35')](_0x196a86['model'],_0x196a86[_0xea7c('0x32')]);_0x33eb52[_0xea7c('0x36')]=_[_0xea7c('0x35')](_0x196a86[_0xea7c('0x31')],qs[_0xea7c('0x37')](_0x27adae['query']['fields']));_0x33eb52['attributes']=_0x33eb52['attributes'][_0xea7c('0x38')]?_0x33eb52['attributes']:_0x196a86[_0xea7c('0x31')];if(_0x27adae[_0xea7c('0x32')][_0xea7c('0x42')]){_0x33eb52['include']=[{'all':!![]}];}_0x33eb52=_[_0xea7c('0x3f')]({},_0x33eb52,_0x27adae[_0xea7c('0x41')]);return db[_0xea7c('0x2d')][_0xea7c('0x48')](_0x33eb52)[_0xea7c('0x27')](handleEntityNotFound(_0x3969b4,null))[_0xea7c('0x27')](respondWithResult(_0x3969b4,null))[_0xea7c('0x45')](handleError(_0x3969b4,null));};exports[_0xea7c('0x49')]=function(_0xd78a5,_0x470de5){return db['SalesforceField'][_0xea7c('0x49')](_0xd78a5[_0xea7c('0x4a')],{})[_0xea7c('0x27')](respondWithResult(_0x470de5,0xc9))[_0xea7c('0x45')](handleError(_0x470de5,null));};exports[_0xea7c('0x25')]=function(_0x12e0de,_0x5bcfcb){if(_0x12e0de[_0xea7c('0x4a')]['id']){delete _0x12e0de[_0xea7c('0x4a')]['id'];}return db[_0xea7c('0x2d')]['find']({'where':{'id':_0x12e0de['params']['id']}})[_0xea7c('0x27')](handleEntityNotFound(_0x5bcfcb,null))['then'](saveUpdates(_0x12e0de['body'],null))[_0xea7c('0x27')](respondWithResult(_0x5bcfcb,null))[_0xea7c('0x45')](handleError(_0x5bcfcb,null));};exports['destroy']=function(_0x384c9f,_0x57263){return db[_0xea7c('0x2d')][_0xea7c('0x48')]({'where':{'id':_0x384c9f['params']['id']}})['then'](handleEntityNotFound(_0x57263,null))[_0xea7c('0x27')](removeEntity(_0x57263,null))[_0xea7c('0x45')](handleError(_0x57263,null));};
\ No newline at end of file
+var _0xccac=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','stack','name','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','include','rows','catch','params','create','body','find','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis'];(function(_0x34a736,_0xe2ccaa){var _0x5269bf=function(_0x2fadd1){while(--_0x2fadd1){_0x34a736['push'](_0x34a736['shift']());}};_0x5269bf(++_0xe2ccaa);}(_0xccac,0x109));var _0xccca=function(_0x216dbf,_0x1e7940){_0x216dbf=_0x216dbf-0x0;var _0x33552e=_0xccac[_0x216dbf];return _0x33552e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xccca('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xccca('0x1'));var moment=require('moment');var BPromise=require(_0xccca('0x2'));var Mustache=require(_0xccca('0x3'));var util=require(_0xccca('0x4'));var path=require(_0xccca('0x5'));var sox=require(_0xccca('0x6'));var csv=require(_0xccca('0x7'));var ejs=require(_0xccca('0x8'));var fs=require('fs');var fs_extra=require(_0xccca('0x9'));var _=require(_0xccca('0xa'));var squel=require(_0xccca('0xb'));var crypto=require(_0xccca('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xccca('0xd'));var Redis=require(_0xccca('0xe'));var authService=require(_0xccca('0xf'));var qs=require(_0xccca('0x10'));var as=require(_0xccca('0x11'));var hardwareService=require(_0xccca('0x12'));var logger=require(_0xccca('0x13'))(_0xccca('0x14'));var utils=require('../../config/utils');var config=require(_0xccca('0x15'));var licenseUtil=require(_0xccca('0x16'));var db=require(_0xccca('0x17'))['db'];function respondWithStatusCode(_0x19a115,_0xaaaba0){_0xaaaba0=_0xaaaba0||0xcc;return function(_0x179080){if(_0x179080){return _0x19a115[_0xccca('0x18')](_0xaaaba0);}return _0x19a115[_0xccca('0x19')](_0xaaaba0)[_0xccca('0x1a')]();};}function respondWithResult(_0x35e5c6,_0x5475e8){_0x5475e8=_0x5475e8||0xc8;return function(_0x55850c){if(_0x55850c){return _0x35e5c6[_0xccca('0x19')](_0x5475e8)[_0xccca('0x1b')](_0x55850c);}};}function respondWithFilteredResult(_0x327ae8,_0x20bd1b){return function(_0x4dfc0f){if(_0x4dfc0f){var _0x26446c=typeof _0x20bd1b[_0xccca('0x1c')]===_0xccca('0x1d')&&typeof _0x20bd1b[_0xccca('0x1e')]===_0xccca('0x1d');var _0x12fce3=_0x4dfc0f[_0xccca('0x1f')];var _0x446cd9=_0x26446c?0x0:_0x20bd1b[_0xccca('0x1c')];var _0xbacd13=_0x26446c?_0x4dfc0f[_0xccca('0x1f')]:_0x20bd1b[_0xccca('0x1c')]+_0x20bd1b[_0xccca('0x1e')];var _0x773c25;if(_0xbacd13>=_0x12fce3){_0xbacd13=_0x12fce3;_0x773c25=0xc8;}else{_0x773c25=0xce;}_0x327ae8[_0xccca('0x19')](_0x773c25);return _0x327ae8[_0xccca('0x20')](_0xccca('0x21'),_0x446cd9+'-'+_0xbacd13+'/'+_0x12fce3)[_0xccca('0x1b')](_0x4dfc0f);}return null;};}function patchUpdates(_0x2d6184){return function(_0x139978){try{jsonpatch['apply'](_0x139978,_0x2d6184,!![]);}catch(_0x4a83b2){return BPromise[_0xccca('0x22')](_0x4a83b2);}return _0x139978['save']();};}function saveUpdates(_0x1f2d8c,_0x4165da){return function(_0x900b43){if(_0x900b43){return _0x900b43['update'](_0x1f2d8c)[_0xccca('0x23')](function(_0x327258){return _0x327258;});}return null;};}function removeEntity(_0x598733,_0x5697ce){return function(_0x57f1b7){if(_0x57f1b7){return _0x57f1b7[_0xccca('0x24')]()['then'](function(){_0x598733[_0xccca('0x19')](0xcc)[_0xccca('0x1a')]();});}};}function handleEntityNotFound(_0x2dbe31,_0x5e01c9){return function(_0x565909){if(!_0x565909){_0x2dbe31[_0xccca('0x18')](0x194);}return _0x565909;};}function handleError(_0xb6cab2,_0x5cc785){_0x5cc785=_0x5cc785||0x1f4;return function(_0x38113e){logger['error'](_0x38113e[_0xccca('0x25')]);if(_0x38113e[_0xccca('0x26')]){delete _0x38113e[_0xccca('0x26')];}_0xb6cab2[_0xccca('0x19')](_0x5cc785)['send'](_0x38113e);};}exports[_0xccca('0x27')]=function(_0x157621,_0x14c590){var _0x5dbde7={},_0x96e56f={},_0x4c1ab2={'count':0x0,'rows':[]};var _0x31e390=_[_0xccca('0x28')](db[_0xccca('0x29')][_0xccca('0x2a')],function(_0x102a56){return{'name':_0x102a56[_0xccca('0x2b')],'type':_0x102a56[_0xccca('0x2c')][_0xccca('0x2d')]};});_0x96e56f[_0xccca('0x2e')]=_[_0xccca('0x28')](_0x31e390,'name');_0x96e56f[_0xccca('0x2f')]=_[_0xccca('0x30')](_0x157621[_0xccca('0x2f')]);_0x96e56f[_0xccca('0x31')]=_[_0xccca('0x32')](_0x96e56f[_0xccca('0x2e')],_0x96e56f[_0xccca('0x2f')]);_0x5dbde7[_0xccca('0x33')]=_[_0xccca('0x32')](_0x96e56f[_0xccca('0x2e')],qs['fields'](_0x157621[_0xccca('0x2f')][_0xccca('0x34')]));_0x5dbde7[_0xccca('0x33')]=_0x5dbde7[_0xccca('0x33')][_0xccca('0x35')]?_0x5dbde7[_0xccca('0x33')]:_0x96e56f[_0xccca('0x2e')];if(!_0x157621[_0xccca('0x2f')][_0xccca('0x36')](_0xccca('0x37'))){_0x5dbde7[_0xccca('0x1e')]=qs[_0xccca('0x1e')](_0x157621[_0xccca('0x2f')][_0xccca('0x1e')]);_0x5dbde7[_0xccca('0x1c')]=qs[_0xccca('0x1c')](_0x157621['query'][_0xccca('0x1c')]);}_0x5dbde7[_0xccca('0x38')]=qs[_0xccca('0x39')](_0x157621[_0xccca('0x2f')][_0xccca('0x39')]);_0x5dbde7['where']=qs[_0xccca('0x31')](_['pick'](_0x157621[_0xccca('0x2f')],_0x96e56f['filters']),_0x31e390);if(_0x157621[_0xccca('0x2f')][_0xccca('0x3a')]){_0x5dbde7[_0xccca('0x3b')]=_['merge'](_0x5dbde7[_0xccca('0x3b')],{'$or':_[_0xccca('0x28')](_0x31e390,function(_0x427bc2){if(_0x427bc2['type']!==_0xccca('0x3c')){var _0x47224e={};_0x47224e[_0x427bc2[_0xccca('0x26')]]={'$like':'%'+_0x157621[_0xccca('0x2f')][_0xccca('0x3a')]+'%'};return _0x47224e;}})});}_0x5dbde7=_[_0xccca('0x3d')]({},_0x5dbde7,_0x157621[_0xccca('0x3e')]);var _0x408f13={'where':_0x5dbde7[_0xccca('0x3b')]};return db[_0xccca('0x29')][_0xccca('0x1f')](_0x408f13)[_0xccca('0x23')](function(_0x194414){_0x4c1ab2[_0xccca('0x1f')]=_0x194414;if(_0x157621[_0xccca('0x2f')]['includeAll']){_0x5dbde7[_0xccca('0x3f')]=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x5dbde7);})[_0xccca('0x23')](function(_0x3c17f1){_0x4c1ab2[_0xccca('0x40')]=_0x3c17f1;return _0x4c1ab2;})['then'](respondWithFilteredResult(_0x14c590,_0x5dbde7))[_0xccca('0x41')](handleError(_0x14c590,null));};exports['show']=function(_0x44bb19,_0x1891b3){var _0xc42154={'raw':!![],'where':{'id':_0x44bb19[_0xccca('0x42')]['id']}},_0x2cc431={};_0x2cc431['model']=_[_0xccca('0x30')](db['SalesforceField'][_0xccca('0x2a')]);_0x2cc431['query']=_['keys'](_0x44bb19[_0xccca('0x2f')]);_0x2cc431['filters']=_[_0xccca('0x32')](_0x2cc431[_0xccca('0x2e')],_0x2cc431[_0xccca('0x2f')]);_0xc42154[_0xccca('0x33')]=_['intersection'](_0x2cc431[_0xccca('0x2e')],qs['fields'](_0x44bb19['query'][_0xccca('0x34')]));_0xc42154[_0xccca('0x33')]=_0xc42154[_0xccca('0x33')][_0xccca('0x35')]?_0xc42154['attributes']:_0x2cc431[_0xccca('0x2e')];if(_0x44bb19[_0xccca('0x2f')]['includeAll']){_0xc42154['include']=[{'all':!![]}];}_0xc42154=_[_0xccca('0x3d')]({},_0xc42154,_0x44bb19['options']);return db['SalesforceField']['find'](_0xc42154)[_0xccca('0x23')](handleEntityNotFound(_0x1891b3,null))[_0xccca('0x23')](respondWithResult(_0x1891b3,null))[_0xccca('0x41')](handleError(_0x1891b3,null));};exports[_0xccca('0x43')]=function(_0x5d00a5,_0x22bd74){return db[_0xccca('0x29')][_0xccca('0x43')](_0x5d00a5[_0xccca('0x44')],{})[_0xccca('0x23')](respondWithResult(_0x22bd74,0xc9))['catch'](handleError(_0x22bd74,null));};exports['update']=function(_0x250b8f,_0xf2f282){if(_0x250b8f['body']['id']){delete _0x250b8f['body']['id'];}return db[_0xccca('0x29')][_0xccca('0x45')]({'where':{'id':_0x250b8f[_0xccca('0x42')]['id']}})[_0xccca('0x23')](handleEntityNotFound(_0xf2f282,null))['then'](saveUpdates(_0x250b8f['body'],null))[_0xccca('0x23')](respondWithResult(_0xf2f282,null))[_0xccca('0x41')](handleError(_0xf2f282,null));};exports[_0xccca('0x24')]=function(_0x2ff101,_0x5215fd){return db['SalesforceField'][_0xccca('0x45')]({'where':{'id':_0x2ff101[_0xccca('0x42')]['id']}})[_0xccca('0x23')](handleEntityNotFound(_0x5215fd,null))[_0xccca('0x23')](removeEntity(_0x5215fd,null))['catch'](handleError(_0x5215fd,null));};
\ No newline at end of file
index 83228a0..ac0e0dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc0f=['exports','SalesforceField','salesforce_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceField.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc0f,0x147));var _0xfdc0=function(_0x4d0bca,_0x4711aa){_0x4d0bca=_0x4d0bca-0x0;var _0x3a1dbd=_0xdc0f[_0x4d0bca];return _0x3a1dbd;};'use strict';var _=require(_0xfdc0('0x0'));var util=require('util');var logger=require(_0xfdc0('0x1'))(_0xfdc0('0x2'));var moment=require(_0xfdc0('0x3'));var BPromise=require(_0xfdc0('0x4'));var rp=require(_0xfdc0('0x5'));var fs=require('fs');var path=require(_0xfdc0('0x6'));var rimraf=require('rimraf');var config=require(_0xfdc0('0x7'));var attributes=require(_0xfdc0('0x8'));module[_0xfdc0('0x9')]=function(_0x1fafc8,_0xef3962){return _0x1fafc8['define'](_0xfdc0('0xa'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0xfdc0('0xb'),'fields':[_0xfdc0('0xc'),_0xfdc0('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8126=['moment','request-promise','path','SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId','lodash','../../config/logger','api'];(function(_0x448dd9,_0xa912e0){var _0x52ce42=function(_0x257af4){while(--_0x257af4){_0x448dd9['push'](_0x448dd9['shift']());}};_0x52ce42(++_0xa912e0);}(_0x8126,0x75));var _0x6812=function(_0x477491,_0x5ca700){_0x477491=_0x477491-0x0;var _0xac6aec=_0x8126[_0x477491];return _0xac6aec;};'use strict';var _=require(_0x6812('0x0'));var util=require('util');var logger=require(_0x6812('0x1'))(_0x6812('0x2'));var moment=require(_0x6812('0x3'));var BPromise=require('bluebird');var rp=require(_0x6812('0x4'));var fs=require('fs');var path=require(_0x6812('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x5c4a51,_0x3d89d3){return _0x5c4a51['define'](_0x6812('0x6'),attributes,{'tableName':_0x6812('0x7'),'paranoid':![],'indexes':[{'name':_0x6812('0x8'),'fields':['idField',_0x6812('0x9')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index c98aa9c..e1f5d28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9dce=['rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','code','error','SalesforceField,\x20%s,\x20%s','message','result','util','moment','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9dce,0x175));var _0xe9dc=function(_0x124581,_0x3d7679){_0x124581=_0x124581-0x0;var _0x5432d0=_0x9dce[_0x124581];return _0x5432d0;};'use strict';var _=require('lodash');var util=require(_0xe9dc('0x0'));var moment=require(_0xe9dc('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9dc('0x2'))['db'];var utils=require(_0xe9dc('0x3'));var logger=require(_0xe9dc('0x4'))(_0xe9dc('0x5'));var config=require(_0xe9dc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe9dc('0x7')][_0xe9dc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b4b93,_0x9a5b86,_0x3384fa){return new BPromise(function(_0x964754,_0x595305){return client[_0xe9dc('0x9')](_0x1b4b93,_0x3384fa)[_0xe9dc('0xa')](function(_0xd037c9){logger[_0xe9dc('0xb')]('SalesforceField,\x20%s,\x20%s',_0x9a5b86,_0xe9dc('0xc'));logger[_0xe9dc('0xd')](_0xe9dc('0xe'),_0x9a5b86,_0xe9dc('0xc'),JSON[_0xe9dc('0xf')](_0xd037c9));if(_0xd037c9['error']){if(_0xd037c9['error'][_0xe9dc('0x10')]===0x1f4){logger[_0xe9dc('0x11')](_0xe9dc('0x12'),_0x9a5b86,_0xd037c9[_0xe9dc('0x11')][_0xe9dc('0x13')]);return _0x595305(_0xd037c9[_0xe9dc('0x11')]['message']);}logger[_0xe9dc('0x11')](_0xe9dc('0x12'),_0x9a5b86,_0xd037c9[_0xe9dc('0x11')][_0xe9dc('0x13')]);return _0x964754(_0xd037c9['error'][_0xe9dc('0x13')]);}else{logger['info'](_0xe9dc('0x12'),_0x9a5b86,'request\x20sent');_0x964754(_0xd037c9[_0xe9dc('0x14')]['message']);}})['catch'](function(_0x1bc4ce){logger['error'](_0xe9dc('0x12'),_0x9a5b86,_0x1bc4ce);_0x595305(_0x1bc4ce);});});}
\ No newline at end of file
+var _0x6416=['then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x3311ae,_0x362cee){var _0x107949=function(_0x2082a3){while(--_0x2082a3){_0x3311ae['push'](_0x3311ae['shift']());}};_0x107949(++_0x362cee);}(_0x6416,0xbb));var _0x6641=function(_0x33d9f0,_0x33ca57){_0x33d9f0=_0x33d9f0-0x0;var _0x4dabd5=_0x6416[_0x33d9f0];return _0x4dabd5;};'use strict';var _=require(_0x6641('0x0'));var util=require('util');var moment=require(_0x6641('0x1'));var BPromise=require(_0x6641('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6641('0x3'));var db=require(_0x6641('0x4'))['db'];var utils=require(_0x6641('0x5'));var logger=require(_0x6641('0x6'))(_0x6641('0x7'));var config=require('../../config/environment');var jayson=require(_0x6641('0x8'));var client=jayson['client'][_0x6641('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa6761b,_0x35a310,_0xd174f8){return new BPromise(function(_0x47d62e,_0x56b647){return client[_0x6641('0xa')](_0xa6761b,_0xd174f8)[_0x6641('0xb')](function(_0x7ff75b){logger[_0x6641('0xc')](_0x6641('0xd'),_0x35a310,_0x6641('0xe'));logger[_0x6641('0xf')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x35a310,'request\x20sent',JSON[_0x6641('0x10')](_0x7ff75b));if(_0x7ff75b[_0x6641('0x11')]){if(_0x7ff75b[_0x6641('0x11')][_0x6641('0x12')]===0x1f4){logger['error'](_0x6641('0xd'),_0x35a310,_0x7ff75b[_0x6641('0x11')][_0x6641('0x13')]);return _0x56b647(_0x7ff75b[_0x6641('0x11')]['message']);}logger[_0x6641('0x11')](_0x6641('0xd'),_0x35a310,_0x7ff75b[_0x6641('0x11')][_0x6641('0x13')]);return _0x47d62e(_0x7ff75b[_0x6641('0x11')][_0x6641('0x13')]);}else{logger['info'](_0x6641('0xd'),_0x35a310,_0x6641('0xe'));_0x47d62e(_0x7ff75b[_0x6641('0x14')][_0x6641('0x13')]);}})[_0x6641('0x15')](function(_0x54a06d){logger['error'](_0x6641('0xd'),_0x35a310,_0x54a06d);_0x56b647(_0x54a06d);});});}
\ No newline at end of file
index b866903..23719ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00d6=['create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post'];(function(_0x5eb133,_0x458e78){var _0x580c08=function(_0x274e6f){while(--_0x274e6f){_0x5eb133['push'](_0x5eb133['shift']());}};_0x580c08(++_0x458e78);}(_0x00d6,0x1e5));var _0x600d=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x00d6[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0x600d('0x0'));var util=require(_0x600d('0x1'));var path=require(_0x600d('0x2'));var timeout=require(_0x600d('0x3'));var express=require(_0x600d('0x4'));var router=express[_0x600d('0x5')]();var fs_extra=require(_0x600d('0x6'));var auth=require(_0x600d('0x7'));var interaction=require(_0x600d('0x8'));var config=require(_0x600d('0x9'));var controller=require(_0x600d('0xa'));router[_0x600d('0xb')]('/',auth[_0x600d('0xc')](),controller['index']);router['get'](_0x600d('0xd'),auth['isAuthenticated'](),controller[_0x600d('0xe')]);router[_0x600d('0xb')](_0x600d('0xf'),auth[_0x600d('0xc')](),controller[_0x600d('0x10')]);router[_0x600d('0xb')](_0x600d('0x11'),auth[_0x600d('0xc')](),controller['getFields']);router[_0x600d('0x12')]('/',auth[_0x600d('0xc')](),controller[_0x600d('0x13')]);router[_0x600d('0x12')](_0x600d('0xf'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x600d('0x14')](_0x600d('0xd'),auth[_0x600d('0xc')](),controller[_0x600d('0x15')]);router[_0x600d('0x16')](_0x600d('0xd'),auth[_0x600d('0xc')](),controller[_0x600d('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x6f33=['fs-extra','../../config/environment','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','/:id','destroy','exports','multer','util','path','Router'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0x6f33,0x7a));var _0x36f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f33[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x36f3('0x0'));var util=require(_0x36f3('0x1'));var path=require(_0x36f3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x36f3('0x3')]();var fs_extra=require(_0x36f3('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x36f3('0x5'));var controller=require('./intServicenowAccount.controller');router[_0x36f3('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x36f3('0x6')]('/:id',auth[_0x36f3('0x7')](),controller[_0x36f3('0x8')]);router[_0x36f3('0x6')](_0x36f3('0x9'),auth['isAuthenticated'](),controller[_0x36f3('0xa')]);router[_0x36f3('0x6')](_0x36f3('0xb'),auth[_0x36f3('0x7')](),controller[_0x36f3('0xc')]);router[_0x36f3('0xd')]('/',auth[_0x36f3('0x7')](),controller[_0x36f3('0xe')]);router[_0x36f3('0xd')](_0x36f3('0x9'),auth['isAuthenticated'](),controller[_0x36f3('0xf')]);router[_0x36f3('0x10')]('/:id',auth[_0x36f3('0x7')](),controller['update']);router[_0x36f3('0x11')](_0x36f3('0x12'),auth[_0x36f3('0x7')](),controller[_0x36f3('0x13')]);module[_0x36f3('0x14')]=router;
\ No newline at end of file
index bbe0eef..2ee5755 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8360=['remoteUri','exports','STRING'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x8360,0x1cc));var _0x0836=function(_0x27c1ba,_0x265c01){_0x27c1ba=_0x27c1ba-0x0;var _0x1422ab=_0x8360[_0x27c1ba];return _0x1422ab;};'use strict';var Sequelize=require('sequelize');module[_0x0836('0x0')]={'name':{'type':Sequelize[_0x0836('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x0836('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x0836('0x1')]},'email':{'type':Sequelize[_0x0836('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x0836('0x2')},'serverUrl':{'type':Sequelize[_0x0836('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xd8c1=['username','remoteUri','sequelize','exports','STRING'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0xd8c1,0x89));var _0x1d8c=function(_0x4ec645,_0x1009b5){_0x4ec645=_0x4ec645-0x0;var _0x1a3772=_0xd8c1[_0x4ec645];return _0x1a3772;};'use strict';var Sequelize=require(_0x1d8c('0x0'));module[_0x1d8c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1d8c('0x2')]},'username':{'type':Sequelize[_0x1d8c('0x2')],'unique':_0x1d8c('0x3')},'password':{'type':Sequelize[_0x1d8c('0x2')]},'email':{'type':Sequelize[_0x1d8c('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x1d8c('0x4')},'serverUrl':{'type':Sequelize[_0x1d8c('0x2')],'allowNull':![]}};
\ No newline at end of file
index bd22689..7046932 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38d9=['child_incidents','hold_reason','approval_history','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','time_worked','expected_start','business_duration','group_list','work_end','resolved_at','caller_id','approval_set','subcategory','short_description','correlation_display','delivery_task','work_start','assignment_group','description','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','problem_id','company','activity_due','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','location','username','password','remoteUri','serverUrl','slice','substring','%s/api/now/doc/table/schema/','format','%s/api/now/table/','incident?sysparm_display_value=all','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','false','GET','sys_choice?sysparm_query=name=incident^element=','result','inactive','value','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','squel','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','ServicenowAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','pick','merge','where','VIRTUAL','filter','options','includeAll','findAll','rows','catch','include','create','body','find','params','findOne','ServicenowConfiguration','order','nolimit','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','knowledge','close_code','notify','severity','category','parent','upon_reject','sys_updated_on'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x38d9,0x109));var _0x938d=function(_0x2c97fa,_0x1a6fa3){_0x2c97fa=_0x2c97fa-0x0;var _0x28ca3b=_0x38d9[_0x2c97fa];return _0x28ca3b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x938d('0x0'));var jsonpatch=require(_0x938d('0x1'));var rp=require(_0x938d('0x2'));var moment=require(_0x938d('0x3'));var BPromise=require(_0x938d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x938d('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x938d('0x6'));var crypto=require('crypto');var jsforce=require(_0x938d('0x7'));var deskjs=require('desk.js');var toCsv=require(_0x938d('0x5'));var querystring=require(_0x938d('0x8'));var Papa=require(_0x938d('0x9'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x938d('0xa'));var as=require(_0x938d('0xb'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x938d('0xc'))(_0x938d('0xd'));var utils=require(_0x938d('0xe'));var config=require('../../config/environment');var licenseUtil=require(_0x938d('0xf'));var db=require(_0x938d('0x10'))['db'];var integrations=require(_0x938d('0x11'));function respondWithStatusCode(_0xb7f37,_0x567eed){_0x567eed=_0x567eed||0xcc;return function(_0x28469f){if(_0x28469f){return _0xb7f37[_0x938d('0x12')](_0x567eed);}return _0xb7f37['status'](_0x567eed)[_0x938d('0x13')]();};}function respondWithResult(_0x3aebd5,_0x22668f){_0x22668f=_0x22668f||0xc8;return function(_0x28813f){if(_0x28813f){return _0x3aebd5[_0x938d('0x14')](_0x22668f)[_0x938d('0x15')](_0x28813f);}};}function respondWithFilteredResult(_0x1e74a2,_0x531a78){return function(_0x3e18df){if(_0x3e18df){var _0x371532=typeof _0x531a78[_0x938d('0x16')]===_0x938d('0x17')&&typeof _0x531a78[_0x938d('0x18')]==='undefined';var _0x364085=_0x3e18df[_0x938d('0x19')];var _0x445201=_0x371532?0x0:_0x531a78['offset'];var _0x95650d=_0x371532?_0x3e18df[_0x938d('0x19')]:_0x531a78[_0x938d('0x16')]+_0x531a78['limit'];var _0x28419f;if(_0x95650d>=_0x364085){_0x95650d=_0x364085;_0x28419f=0xc8;}else{_0x28419f=0xce;}_0x1e74a2[_0x938d('0x14')](_0x28419f);return _0x1e74a2[_0x938d('0x1a')](_0x938d('0x1b'),_0x445201+'-'+_0x95650d+'/'+_0x364085)[_0x938d('0x15')](_0x3e18df);}return null;};}function patchUpdates(_0x2e553f){return function(_0x1d57b6){try{jsonpatch[_0x938d('0x1c')](_0x1d57b6,_0x2e553f,!![]);}catch(_0x25430e){return BPromise[_0x938d('0x1d')](_0x25430e);}return _0x1d57b6[_0x938d('0x1e')]();};}function saveUpdates(_0x42b222,_0x260b6f){return function(_0xd9ce07){if(_0xd9ce07){return _0xd9ce07[_0x938d('0x1f')](_0x42b222)[_0x938d('0x20')](function(_0x2dfc42){return _0x2dfc42;});}return null;};}function removeEntity(_0x3da92d,_0xdbe41a){return function(_0x2a835b){if(_0x2a835b){return _0x2a835b[_0x938d('0x21')]()[_0x938d('0x20')](function(){_0x3da92d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2002ae,_0x3125b2){return function(_0x56e7c7){if(!_0x56e7c7){_0x2002ae[_0x938d('0x12')](0x194);}return _0x56e7c7;};}function handleError(_0x1546b2,_0x3330a9){_0x3330a9=_0x3330a9||0x1f4;return function(_0x3fae19){logger[_0x938d('0x22')](_0x3fae19[_0x938d('0x23')]);if(_0x3fae19[_0x938d('0x24')]){delete _0x3fae19[_0x938d('0x24')];}_0x1546b2[_0x938d('0x14')](_0x3330a9)[_0x938d('0x25')](_0x3fae19);};}exports['index']=function(_0x590478,_0x4df7e5){var _0x21d61c={},_0x5854b6={},_0x338420={'count':0x0,'rows':[]};var _0x10a35d=_['map'](db[_0x938d('0x26')][_0x938d('0x27')],function(_0x45994c){return{'name':_0x45994c[_0x938d('0x28')],'type':_0x45994c[_0x938d('0x29')][_0x938d('0x2a')]};});_0x5854b6[_0x938d('0x2b')]=_[_0x938d('0x2c')](_0x10a35d,_0x938d('0x24'));_0x5854b6[_0x938d('0x2d')]=_[_0x938d('0x2e')](_0x590478[_0x938d('0x2d')]);_0x5854b6[_0x938d('0x2f')]=_['intersection'](_0x5854b6[_0x938d('0x2b')],_0x5854b6[_0x938d('0x2d')]);_0x21d61c[_0x938d('0x30')]=_[_0x938d('0x31')](_0x5854b6[_0x938d('0x2b')],qs['fields'](_0x590478['query'][_0x938d('0x32')]));_0x21d61c[_0x938d('0x30')]=_0x21d61c[_0x938d('0x30')][_0x938d('0x33')]?_0x21d61c[_0x938d('0x30')]:_0x5854b6['model'];if(!_0x590478['query'][_0x938d('0x34')]('nolimit')){_0x21d61c[_0x938d('0x18')]=qs[_0x938d('0x18')](_0x590478[_0x938d('0x2d')][_0x938d('0x18')]);_0x21d61c[_0x938d('0x16')]=qs['offset'](_0x590478[_0x938d('0x2d')][_0x938d('0x16')]);}_0x21d61c['order']=qs['sort'](_0x590478[_0x938d('0x2d')][_0x938d('0x35')]);_0x21d61c['where']=qs[_0x938d('0x2f')](_[_0x938d('0x36')](_0x590478[_0x938d('0x2d')],_0x5854b6[_0x938d('0x2f')]),_0x10a35d);if(_0x590478['query']['filter']){_0x21d61c['where']=_[_0x938d('0x37')](_0x21d61c[_0x938d('0x38')],{'$or':_[_0x938d('0x2c')](_0x10a35d,function(_0x2bebb6){if(_0x2bebb6[_0x938d('0x29')]!==_0x938d('0x39')){var _0x4bb052={};_0x4bb052[_0x2bebb6[_0x938d('0x24')]]={'$like':'%'+_0x590478[_0x938d('0x2d')][_0x938d('0x3a')]+'%'};return _0x4bb052;}})});}_0x21d61c=_['merge']({},_0x21d61c,_0x590478[_0x938d('0x3b')]);var _0x8f9e4e={'where':_0x21d61c[_0x938d('0x38')]};return db[_0x938d('0x26')][_0x938d('0x19')](_0x8f9e4e)['then'](function(_0x42ad12){_0x338420[_0x938d('0x19')]=_0x42ad12;if(_0x590478[_0x938d('0x2d')][_0x938d('0x3c')]){_0x21d61c['include']=[{'all':!![]}];}return db[_0x938d('0x26')][_0x938d('0x3d')](_0x21d61c);})['then'](function(_0x302634){_0x338420[_0x938d('0x3e')]=_0x302634;return _0x338420;})[_0x938d('0x20')](respondWithFilteredResult(_0x4df7e5,_0x21d61c))[_0x938d('0x3f')](handleError(_0x4df7e5,null));};exports['show']=function(_0x5bc0d1,_0xe956d5){var _0x469b08={'raw':![],'where':{'id':_0x5bc0d1['params']['id']}},_0x4f4c2e={};_0x4f4c2e[_0x938d('0x2b')]=_[_0x938d('0x2e')](db['ServicenowAccount']['rawAttributes']);_0x4f4c2e[_0x938d('0x2d')]=_[_0x938d('0x2e')](_0x5bc0d1[_0x938d('0x2d')]);_0x4f4c2e[_0x938d('0x2f')]=_[_0x938d('0x31')](_0x4f4c2e[_0x938d('0x2b')],_0x4f4c2e[_0x938d('0x2d')]);_0x469b08[_0x938d('0x30')]=_[_0x938d('0x31')](_0x4f4c2e[_0x938d('0x2b')],qs[_0x938d('0x32')](_0x5bc0d1[_0x938d('0x2d')][_0x938d('0x32')]));_0x469b08[_0x938d('0x30')]=_0x469b08[_0x938d('0x30')][_0x938d('0x33')]?_0x469b08['attributes']:_0x4f4c2e[_0x938d('0x2b')];if(_0x5bc0d1[_0x938d('0x2d')]['includeAll']){_0x469b08[_0x938d('0x40')]=[{'all':!![]}];}_0x469b08=_['merge']({},_0x469b08,_0x5bc0d1['options']);return db[_0x938d('0x26')]['find'](_0x469b08)[_0x938d('0x20')](handleEntityNotFound(_0xe956d5,null))[_0x938d('0x20')](respondWithResult(_0xe956d5,null))[_0x938d('0x3f')](handleError(_0xe956d5,null));};exports[_0x938d('0x41')]=function(_0x7c6587,_0x156b5f){return db[_0x938d('0x26')][_0x938d('0x41')](_0x7c6587[_0x938d('0x42')],{})[_0x938d('0x20')](respondWithResult(_0x156b5f,0xc9))[_0x938d('0x3f')](handleError(_0x156b5f,null));};exports[_0x938d('0x1f')]=function(_0x2f863e,_0x226ba0){if(_0x2f863e[_0x938d('0x42')]['id']){delete _0x2f863e[_0x938d('0x42')]['id'];}return db['ServicenowAccount'][_0x938d('0x43')]({'where':{'id':_0x2f863e[_0x938d('0x44')]['id']}})[_0x938d('0x20')](handleEntityNotFound(_0x226ba0,null))[_0x938d('0x20')](saveUpdates(_0x2f863e[_0x938d('0x42')],null))[_0x938d('0x20')](respondWithResult(_0x226ba0,null))[_0x938d('0x3f')](handleError(_0x226ba0,null));};exports[_0x938d('0x21')]=function(_0x2363ab,_0x2b92c7){return db[_0x938d('0x26')][_0x938d('0x43')]({'where':{'id':_0x2363ab[_0x938d('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b92c7,null))[_0x938d('0x20')](removeEntity(_0x2b92c7,null))[_0x938d('0x3f')](handleError(_0x2b92c7,null));};exports['getConfigurations']=function(_0x38fdcf,_0x30eec0,_0x596a44){var _0x57829f={};var _0x53ad38={};var _0x4453a2;var _0xcd0e0;return db['ServicenowAccount'][_0x938d('0x45')]({'where':{'id':_0x38fdcf[_0x938d('0x44')]['id']}})[_0x938d('0x20')](handleEntityNotFound(_0x30eec0,null))[_0x938d('0x20')](function(_0x2e090d){if(_0x2e090d){_0x4453a2=_0x2e090d;_0x53ad38[_0x938d('0x2b')]=_['keys'](db[_0x938d('0x46')][_0x938d('0x27')]);_0x53ad38[_0x938d('0x2d')]=_[_0x938d('0x2e')](_0x38fdcf[_0x938d('0x2d')]);_0x53ad38['filters']=_[_0x938d('0x31')](_0x53ad38[_0x938d('0x2b')],_0x53ad38[_0x938d('0x2d')]);_0x57829f[_0x938d('0x30')]=_['intersection'](_0x53ad38[_0x938d('0x2b')],qs[_0x938d('0x32')](_0x38fdcf[_0x938d('0x2d')][_0x938d('0x32')]));_0x57829f['attributes']=_0x57829f[_0x938d('0x30')]['length']?_0x57829f[_0x938d('0x30')]:_0x53ad38[_0x938d('0x2b')];_0x57829f[_0x938d('0x47')]=qs[_0x938d('0x35')](_0x38fdcf[_0x938d('0x2d')]['sort']);_0x57829f[_0x938d('0x38')]=qs[_0x938d('0x2f')](_[_0x938d('0x36')](_0x38fdcf[_0x938d('0x2d')],_0x53ad38[_0x938d('0x2f')]));if(_0x38fdcf['query'][_0x938d('0x3a')]){_0x57829f['where']=_['merge'](_0x57829f[_0x938d('0x38')],{'$or':_[_0x938d('0x2c')](_0x57829f[_0x938d('0x30')],function(_0xeebba8){var _0xb35a16={};_0xb35a16[_0xeebba8]={'$like':'%'+_0x38fdcf[_0x938d('0x2d')][_0x938d('0x3a')]+'%'};return _0xb35a16;})});}_0x57829f=_[_0x938d('0x37')]({},_0x57829f,_0x38fdcf['options']);return _0x4453a2['getConfigurations'](_0x57829f);}})[_0x938d('0x20')](function(_0xf5167f){if(_0xf5167f){_0xcd0e0=_0xf5167f[_0x938d('0x33')];if(!_0x38fdcf[_0x938d('0x2d')]['hasOwnProperty'](_0x938d('0x48'))){_0x57829f['limit']=qs[_0x938d('0x18')](_0x38fdcf['query'][_0x938d('0x18')]);_0x57829f['offset']=qs['offset'](_0x38fdcf[_0x938d('0x2d')][_0x938d('0x16')]);}return _0x4453a2[_0x938d('0x49')](_0x57829f);}})[_0x938d('0x20')](function(_0x3d1e6f){if(_0x3d1e6f){return _0x3d1e6f?{'count':_0xcd0e0,'rows':_0x3d1e6f}:null;}})['then'](respondWithResult(_0x30eec0,null))[_0x938d('0x3f')](handleError(_0x30eec0,null));};exports[_0x938d('0x4a')]=function(_0x5ef24f,_0x1b3aee,_0x52d984){if(_0x5ef24f['body']['id']){delete _0x5ef24f[_0x938d('0x42')]['id'];}return db[_0x938d('0x26')][_0x938d('0x45')]({'where':{'id':_0x5ef24f[_0x938d('0x44')]['id']}})[_0x938d('0x20')](handleEntityNotFound(_0x1b3aee,null))[_0x938d('0x20')](function(_0x3d13fd){if(_0x3d13fd){_0x5ef24f['body'][_0x938d('0x4b')]=_0x3d13fd['id'];_0x5ef24f['body'][_0x938d('0x4c')]=integrations[_0x938d('0x4d')](_0x5ef24f['body'][_0x938d('0x4e')],_0x5ef24f['body'][_0x938d('0x29')]);_0x5ef24f['body'][_0x938d('0x4f')]=integrations[_0x938d('0x50')](_0x5ef24f[_0x938d('0x42')][_0x938d('0x4e')],_0x5ef24f['body'][_0x938d('0x29')]);return db[_0x938d('0x46')]['create'](_0x5ef24f[_0x938d('0x42')],{'include':[{'model':db[_0x938d('0x51')],'as':_0x938d('0x4c')},{'model':db[_0x938d('0x51')],'as':_0x938d('0x4f')}]});}return null;})[_0x938d('0x20')](respondWithResult(_0x1b3aee,null))[_0x938d('0x3f')](handleError(_0x1b3aee,null));};exports[_0x938d('0x52')]=function(_0x336078,_0x21ef3e,_0x4f158d){var _0x1c109c=['made_sla','hold_reason',_0x938d('0x53'),'subcategory',_0x938d('0x54'),_0x938d('0x55'),'incident_state',_0x938d('0x56'),_0x938d('0x57')];var _0x390db5=[_0x938d('0x58'),'made_sla','caused_by','watch_list',_0x938d('0x59'),_0x938d('0x5a'),_0x938d('0x5b'),_0x938d('0x5c'),_0x938d('0x5d'),'number',_0x938d('0x5e'),'sys_updated_by',_0x938d('0x5f'),_0x938d('0x60'),_0x938d('0x61'),_0x938d('0x62'),_0x938d('0x63'),_0x938d('0x64'),_0x938d('0x53'),'order',_0x938d('0x65'),'closed_at',_0x938d('0x66'),_0x938d('0x67'),_0x938d('0x68'),_0x938d('0x69'),_0x938d('0x6a'),'business_service',_0x938d('0x6b'),'sys_domain_path','rfc',_0x938d('0x6c'),_0x938d('0x6d'),'opened_at',_0x938d('0x6e'),_0x938d('0x6f'),_0x938d('0x70'),'reopened_time',_0x938d('0x71'),_0x938d('0x72'),_0x938d('0x73'),_0x938d('0x74'),'work_notes',_0x938d('0x75'),'close_code',_0x938d('0x76'),_0x938d('0x77'),_0x938d('0x78'),_0x938d('0x79'),'business_stc','additional_assignee_list',_0x938d('0x7a'),'calendar_duration',_0x938d('0x55'),_0x938d('0x7b'),_0x938d('0x7c'),_0x938d('0x7d'),_0x938d('0x7e'),_0x938d('0x7f'),_0x938d('0x80'),_0x938d('0x81'),_0x938d('0x82'),'incident_state','urgency',_0x938d('0x83'),_0x938d('0x84'),'reassignment_count',_0x938d('0x85'),'assigned_to','severity',_0x938d('0x86'),_0x938d('0x87'),_0x938d('0x88'),_0x938d('0x89'),_0x938d('0x8a'),_0x938d('0x8b'),'reopen_count',_0x938d('0x8c'),_0x938d('0x8d'),'upon_approval','correlation_id',_0x938d('0x8e'),_0x938d('0x57')];var _0x1ffb6c='';var _0x480de5='';var _0x25998d=[];var _0x4d418d='';var _0x10c950='';var _0x474740=[];var _0x32a9ee='';var _0x10987a='';var _0x551307={};var _0x205fc3='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x336078[_0x938d('0x44')]['id']},'attributes':['id',_0x938d('0x8f'),_0x938d('0x90'),'email',_0x938d('0x91'),_0x938d('0x92')]})[_0x938d('0x20')](handleEntityNotFound(_0x21ef3e,null))[_0x938d('0x20')](function(_0x232606){if(_0x232606){_0x205fc3=_0x232606['remoteUri'];var _0x3b6e13=_0x205fc3[_0x938d('0x93')](-0x1);if(_0x3b6e13==='/'){_0x205fc3=_0x205fc3[_0x938d('0x94')](0x0,_0x205fc3['lastIndexOf'](_0x3b6e13));}_0x10987a=util['format'](_0x938d('0x95'),_0x205fc3);_0x32a9ee=util[_0x938d('0x96')](_0x938d('0x97'),_0x205fc3);_0x551307={'user':_0x232606['username'],'pass':_0x232606[_0x938d('0x90')]};var _0xe62917={'method':'GET','uri':_0x10987a+_0x938d('0x98'),'auth':_0x551307,'json':!![]};return rp(_0xe62917);}})[_0x938d('0x20')](function(_0x22a2b6){if(_0x22a2b6['result'][_0x938d('0x33')]>0x0){_0x1ffb6c=_0x22a2b6['result'];}console[_0x938d('0x99')](_0x938d('0x9a'),_0x1ffb6c);_0x474740=[];_0x480de5=Object[_0x938d('0x9b')]([],_0x1ffb6c);_[_0x938d('0x9c')](_0x480de5,function(_0x4f7825){return!_0x1c109c[_0x938d('0x9d')](_0x4f7825[_0x938d('0x24')]);});_0x480de5[_0x938d('0x9e')](function(_0x4d3fa8){var _0x5be0c8=createFieldObject(_0x32a9ee,_0x551307,_0x4d3fa8[_0x938d('0x9f')],_0x4d3fa8[_0x938d('0x24')],_0x4d3fa8[_0x938d('0xa0')],![]);_0x474740[_0x938d('0xa1')](_0x5be0c8);});return Promise[_0x938d('0xa2')](_0x474740);})[_0x938d('0x20')](function(_0x4b9a3a){_0x25998d=_0x4b9a3a;_0x4d418d=Object['assign']([],_0x1ffb6c);console[_0x938d('0x99')](_0x938d('0xa3'),_0x1ffb6c);_[_0x938d('0x9c')](_0x4d418d,function(_0x17e345){return _0x390db5[_0x938d('0x9d')](_0x17e345[_0x938d('0x24')]);});console[_0x938d('0x99')](_0x938d('0xa4'),_0x4d418d);_0x474740=[];_0x4d418d['forEach'](function(_0x1dd352){var _0x3c2c64=createFieldObject(_0x32a9ee,_0x551307,_0x1dd352['internalType'],_0x1dd352[_0x938d('0x24')],_0x1dd352[_0x938d('0xa0')],!![]);_0x474740[_0x938d('0xa1')](_0x3c2c64);});return Promise[_0x938d('0xa2')](_0x474740);})['then'](function(_0x179131){_0x10c950=_0x179131;var _0x152f0a=_0x25998d['concat'](_0x10c950);return{'count':_0x152f0a[_0x938d('0x33')],'rows':_0x152f0a};})[_0x938d('0x20')](respondWithResult(_0x21ef3e,null))['catch'](function(_0x37c987){console[_0x938d('0x99')](_0x938d('0xa5')+_0x37c987);var _0x22dfff=_0x336078[_0x938d('0x2d')][_0x938d('0xa6')]?0x1f4:_0x37c987[_0x938d('0xa7')]||0x1f4;logger[_0x938d('0x22')](_0x37c987[_0x938d('0x23')]);delete _0x37c987[_0x938d('0x24')];if(_0x22dfff===0x191){_0x22dfff=0x190;}_0x21ef3e[_0x938d('0x14')](_0x22dfff)[_0x938d('0x25')](_0x336078[_0x938d('0x2d')]['test']?{'message':_0x938d('0xa8'),'statusCode':_0x37c987[_0x938d('0xa7')]}:_0x37c987);});};function createFieldObject(_0x1bfb35,_0x581534,_0x554582,_0x2bdbbb,_0x4341f2,_0xda62fc){return new Promise(function(_0x214418,_0x1daf34){var _0x2fa846={'id':_0x2bdbbb,'name':_0x4341f2,'custom':_0xda62fc};if(_0x554582===_0x938d('0xa9')){_0x2fa846[_0x938d('0x3b')]=[{'name':_0x938d('0xaa'),'value':_0x938d('0xab')},{'name':'False','value':_0x938d('0xac')}];_0x214418(_0x2fa846);}else{var _0x511bf4={'method':_0x938d('0xad'),'uri':_0x1bfb35+_0x938d('0xae')+_0x2bdbbb,'auth':_0x581534,'json':!![]};return rp(_0x511bf4)[_0x938d('0x20')](function(_0x1de36e){var _0x37dae6=[];if(_0x1de36e[_0x938d('0xaf')]['length']>0x0){_0x1de36e['result']['forEach'](function(_0x3afe51){if(_0x3afe51[_0x938d('0xb0')]===_0x938d('0xac')){var _0x544c49={'name':_0x3afe51[_0x938d('0xa0')],'value':_0x3afe51[_0x938d('0xb1')]};_0x37dae6['push'](_0x544c49);}});}_0x2fa846['options']=_0x37dae6;if(_0x2fa846[_0x938d('0x3b')][_0x938d('0x33')]>0x0){_0x214418(_0x2fa846);}else{if(_0xda62fc==![]){_0x214418();}else{_0x214418(_0x2fa846);}}});}});}
\ No newline at end of file
+var _0xd9d6=['user_input','sys_domain','state','sys_created_by','knowledge','calendar_stc','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','description','calendar_duration','sys_class_name','close_notes','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','severity','sla_due','approval','due_date','reopen_count','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','remove','includes','forEach','internalType','assign','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','ServiceNow\x20error:\x20','test','statusCode','boolean','true','false','inactive','value','push','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','offset','count','set','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','ServicenowAccount','rawAttributes','key','model','query','filters','fields','attributes','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','options','include','findAll','catch','show','params','keys','length','includeAll','find','create','body','getConfigurations','intersection','pick','nolimit','addConfiguration','findOne','Subjects','channel','Descriptions','ServicenowConfiguration','ServicenowField','getFields','made_sla','subcategory','close_code','incident_state','category','parent','upon_reject','sys_updated_on','number','sys_updated_by','opened_by'];(function(_0x1b9693,_0x3e52fd){var _0x34ef1f=function(_0x3d21e3){while(--_0x3d21e3){_0x1b9693['push'](_0x1b9693['shift']());}};_0x34ef1f(++_0x3e52fd);}(_0xd9d6,0x107));var _0x6d9d=function(_0x5e9665,_0x439465){_0x5e9665=_0x5e9665-0x0;var _0x5bf400=_0xd9d6[_0x5e9665];return _0x5bf400;};'use strict';var emlformat=require(_0x6d9d('0x0'));var rimraf=require(_0x6d9d('0x1'));var zipdir=require(_0x6d9d('0x2'));var jsonpatch=require(_0x6d9d('0x3'));var rp=require(_0x6d9d('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6d9d('0x5'));var util=require(_0x6d9d('0x6'));var path=require(_0x6d9d('0x7'));var sox=require(_0x6d9d('0x8'));var csv=require(_0x6d9d('0x9'));var ejs=require(_0x6d9d('0xa'));var fs=require('fs');var fs_extra=require(_0x6d9d('0xb'));var _=require('lodash');var squel=require(_0x6d9d('0xc'));var crypto=require(_0x6d9d('0xd'));var jsforce=require(_0x6d9d('0xe'));var deskjs=require(_0x6d9d('0xf'));var toCsv=require(_0x6d9d('0x9'));var querystring=require('querystring');var Papa=require(_0x6d9d('0x10'));var Redis=require(_0x6d9d('0x11'));var authService=require(_0x6d9d('0x12'));var qs=require(_0x6d9d('0x13'));var as=require(_0x6d9d('0x14'));var hardwareService=require(_0x6d9d('0x15'));var logger=require(_0x6d9d('0x16'))(_0x6d9d('0x17'));var utils=require('../../config/utils');var config=require(_0x6d9d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d9d('0x19'))['db'];var integrations=require(_0x6d9d('0x1a'));function respondWithStatusCode(_0x36a874,_0x59f4ed){_0x59f4ed=_0x59f4ed||0xcc;return function(_0x59f1ca){if(_0x59f1ca){return _0x36a874['sendStatus'](_0x59f4ed);}return _0x36a874[_0x6d9d('0x1b')](_0x59f4ed)[_0x6d9d('0x1c')]();};}function respondWithResult(_0x573722,_0x336b86){_0x336b86=_0x336b86||0xc8;return function(_0x374bc1){if(_0x374bc1){return _0x573722[_0x6d9d('0x1b')](_0x336b86)[_0x6d9d('0x1d')](_0x374bc1);}};}function respondWithFilteredResult(_0x46d9b3,_0xc4ab54){return function(_0x2a2791){if(_0x2a2791){var _0x3f39d5=typeof _0xc4ab54['offset']===_0x6d9d('0x1e')&&typeof _0xc4ab54[_0x6d9d('0x1f')]===_0x6d9d('0x1e');var _0x5766ef=_0x2a2791['count'];var _0x4dd4ef=_0x3f39d5?0x0:_0xc4ab54[_0x6d9d('0x20')];var _0x4fd310=_0x3f39d5?_0x2a2791[_0x6d9d('0x21')]:_0xc4ab54[_0x6d9d('0x20')]+_0xc4ab54['limit'];var _0xd2e83d;if(_0x4fd310>=_0x5766ef){_0x4fd310=_0x5766ef;_0xd2e83d=0xc8;}else{_0xd2e83d=0xce;}_0x46d9b3[_0x6d9d('0x1b')](_0xd2e83d);return _0x46d9b3[_0x6d9d('0x22')]('Content-Range',_0x4dd4ef+'-'+_0x4fd310+'/'+_0x5766ef)[_0x6d9d('0x1d')](_0x2a2791);}return null;};}function patchUpdates(_0x38a66c){return function(_0x209795){try{jsonpatch[_0x6d9d('0x23')](_0x209795,_0x38a66c,!![]);}catch(_0x56d07c){return BPromise['reject'](_0x56d07c);}return _0x209795[_0x6d9d('0x24')]();};}function saveUpdates(_0x16eb46,_0x451c97){return function(_0x570c0f){if(_0x570c0f){return _0x570c0f[_0x6d9d('0x25')](_0x16eb46)[_0x6d9d('0x26')](function(_0x276f7b){return _0x276f7b;});}return null;};}function removeEntity(_0x3308d1,_0xf60a98){return function(_0x3a326e){if(_0x3a326e){return _0x3a326e[_0x6d9d('0x27')]()['then'](function(){_0x3308d1[_0x6d9d('0x1b')](0xcc)[_0x6d9d('0x1c')]();});}};}function handleEntityNotFound(_0x4c7b5c,_0x5c3a06){return function(_0x421a9d){if(!_0x421a9d){_0x4c7b5c[_0x6d9d('0x28')](0x194);}return _0x421a9d;};}function handleError(_0x1ba33b,_0x406f6e){_0x406f6e=_0x406f6e||0x1f4;return function(_0x499536){logger[_0x6d9d('0x29')](_0x499536[_0x6d9d('0x2a')]);if(_0x499536[_0x6d9d('0x2b')]){delete _0x499536['name'];}_0x1ba33b['status'](_0x406f6e)[_0x6d9d('0x2c')](_0x499536);};}exports['index']=function(_0x3fdd73,_0x235fd1){var _0xaabeb7={},_0x17bd30={},_0x28d635={'count':0x0,'rows':[]};var _0x473427=_[_0x6d9d('0x2d')](db[_0x6d9d('0x2e')][_0x6d9d('0x2f')],function(_0x25d790){return{'name':_0x25d790['fieldName'],'type':_0x25d790['type'][_0x6d9d('0x30')]};});_0x17bd30[_0x6d9d('0x31')]=_['map'](_0x473427,'name');_0x17bd30[_0x6d9d('0x32')]=_['keys'](_0x3fdd73['query']);_0x17bd30[_0x6d9d('0x33')]=_['intersection'](_0x17bd30[_0x6d9d('0x31')],_0x17bd30[_0x6d9d('0x32')]);_0xaabeb7['attributes']=_['intersection'](_0x17bd30['model'],qs[_0x6d9d('0x34')](_0x3fdd73[_0x6d9d('0x32')][_0x6d9d('0x34')]));_0xaabeb7[_0x6d9d('0x35')]=_0xaabeb7['attributes']['length']?_0xaabeb7[_0x6d9d('0x35')]:_0x17bd30['model'];if(!_0x3fdd73['query'][_0x6d9d('0x36')]('nolimit')){_0xaabeb7['limit']=qs[_0x6d9d('0x1f')](_0x3fdd73['query']['limit']);_0xaabeb7[_0x6d9d('0x20')]=qs[_0x6d9d('0x20')](_0x3fdd73[_0x6d9d('0x32')][_0x6d9d('0x20')]);}_0xaabeb7[_0x6d9d('0x37')]=qs[_0x6d9d('0x38')](_0x3fdd73[_0x6d9d('0x32')]['sort']);_0xaabeb7[_0x6d9d('0x39')]=qs['filters'](_['pick'](_0x3fdd73[_0x6d9d('0x32')],_0x17bd30[_0x6d9d('0x33')]),_0x473427);if(_0x3fdd73[_0x6d9d('0x32')]['filter']){_0xaabeb7['where']=_[_0x6d9d('0x3a')](_0xaabeb7[_0x6d9d('0x39')],{'$or':_[_0x6d9d('0x2d')](_0x473427,function(_0x7e36ff){if(_0x7e36ff[_0x6d9d('0x3b')]!==_0x6d9d('0x3c')){var _0x1f2633={};_0x1f2633[_0x7e36ff['name']]={'$like':'%'+_0x3fdd73[_0x6d9d('0x32')][_0x6d9d('0x3d')]+'%'};return _0x1f2633;}})});}_0xaabeb7=_[_0x6d9d('0x3a')]({},_0xaabeb7,_0x3fdd73[_0x6d9d('0x3e')]);var _0x38cab8={'where':_0xaabeb7[_0x6d9d('0x39')]};return db[_0x6d9d('0x2e')][_0x6d9d('0x21')](_0x38cab8)[_0x6d9d('0x26')](function(_0x475e9b){_0x28d635[_0x6d9d('0x21')]=_0x475e9b;if(_0x3fdd73[_0x6d9d('0x32')]['includeAll']){_0xaabeb7[_0x6d9d('0x3f')]=[{'all':!![]}];}return db['ServicenowAccount'][_0x6d9d('0x40')](_0xaabeb7);})[_0x6d9d('0x26')](function(_0x4de167){_0x28d635['rows']=_0x4de167;return _0x28d635;})[_0x6d9d('0x26')](respondWithFilteredResult(_0x235fd1,_0xaabeb7))[_0x6d9d('0x41')](handleError(_0x235fd1,null));};exports[_0x6d9d('0x42')]=function(_0x512bf6,_0x516fd3){var _0x35cfe6={'raw':![],'where':{'id':_0x512bf6[_0x6d9d('0x43')]['id']}},_0x9d8a1f={};_0x9d8a1f[_0x6d9d('0x31')]=_[_0x6d9d('0x44')](db[_0x6d9d('0x2e')][_0x6d9d('0x2f')]);_0x9d8a1f[_0x6d9d('0x32')]=_['keys'](_0x512bf6['query']);_0x9d8a1f[_0x6d9d('0x33')]=_['intersection'](_0x9d8a1f[_0x6d9d('0x31')],_0x9d8a1f[_0x6d9d('0x32')]);_0x35cfe6[_0x6d9d('0x35')]=_['intersection'](_0x9d8a1f[_0x6d9d('0x31')],qs[_0x6d9d('0x34')](_0x512bf6[_0x6d9d('0x32')][_0x6d9d('0x34')]));_0x35cfe6[_0x6d9d('0x35')]=_0x35cfe6[_0x6d9d('0x35')][_0x6d9d('0x45')]?_0x35cfe6[_0x6d9d('0x35')]:_0x9d8a1f[_0x6d9d('0x31')];if(_0x512bf6[_0x6d9d('0x32')][_0x6d9d('0x46')]){_0x35cfe6[_0x6d9d('0x3f')]=[{'all':!![]}];}_0x35cfe6=_['merge']({},_0x35cfe6,_0x512bf6[_0x6d9d('0x3e')]);return db[_0x6d9d('0x2e')][_0x6d9d('0x47')](_0x35cfe6)[_0x6d9d('0x26')](handleEntityNotFound(_0x516fd3,null))['then'](respondWithResult(_0x516fd3,null))[_0x6d9d('0x41')](handleError(_0x516fd3,null));};exports[_0x6d9d('0x48')]=function(_0x92ce3c,_0x2bed8a){return db[_0x6d9d('0x2e')][_0x6d9d('0x48')](_0x92ce3c[_0x6d9d('0x49')],{})[_0x6d9d('0x26')](respondWithResult(_0x2bed8a,0xc9))['catch'](handleError(_0x2bed8a,null));};exports[_0x6d9d('0x25')]=function(_0x346ea6,_0x5b92e4){if(_0x346ea6[_0x6d9d('0x49')]['id']){delete _0x346ea6[_0x6d9d('0x49')]['id'];}return db[_0x6d9d('0x2e')][_0x6d9d('0x47')]({'where':{'id':_0x346ea6['params']['id']}})[_0x6d9d('0x26')](handleEntityNotFound(_0x5b92e4,null))[_0x6d9d('0x26')](saveUpdates(_0x346ea6[_0x6d9d('0x49')],null))[_0x6d9d('0x26')](respondWithResult(_0x5b92e4,null))[_0x6d9d('0x41')](handleError(_0x5b92e4,null));};exports['destroy']=function(_0x1d5651,_0x82e0fb){return db[_0x6d9d('0x2e')][_0x6d9d('0x47')]({'where':{'id':_0x1d5651['params']['id']}})[_0x6d9d('0x26')](handleEntityNotFound(_0x82e0fb,null))[_0x6d9d('0x26')](removeEntity(_0x82e0fb,null))[_0x6d9d('0x41')](handleError(_0x82e0fb,null));};exports[_0x6d9d('0x4a')]=function(_0xfff2d0,_0x5e9174,_0x1e2e1d){var _0x1db194={};var _0x4f36db={};var _0x46cb22;var _0x3ac390;return db[_0x6d9d('0x2e')]['findOne']({'where':{'id':_0xfff2d0[_0x6d9d('0x43')]['id']}})[_0x6d9d('0x26')](handleEntityNotFound(_0x5e9174,null))[_0x6d9d('0x26')](function(_0x409be6){if(_0x409be6){_0x46cb22=_0x409be6;_0x4f36db[_0x6d9d('0x31')]=_[_0x6d9d('0x44')](db['ServicenowConfiguration'][_0x6d9d('0x2f')]);_0x4f36db[_0x6d9d('0x32')]=_[_0x6d9d('0x44')](_0xfff2d0[_0x6d9d('0x32')]);_0x4f36db[_0x6d9d('0x33')]=_['intersection'](_0x4f36db['model'],_0x4f36db['query']);_0x1db194['attributes']=_[_0x6d9d('0x4b')](_0x4f36db[_0x6d9d('0x31')],qs[_0x6d9d('0x34')](_0xfff2d0['query']['fields']));_0x1db194[_0x6d9d('0x35')]=_0x1db194[_0x6d9d('0x35')][_0x6d9d('0x45')]?_0x1db194[_0x6d9d('0x35')]:_0x4f36db[_0x6d9d('0x31')];_0x1db194[_0x6d9d('0x37')]=qs[_0x6d9d('0x38')](_0xfff2d0[_0x6d9d('0x32')][_0x6d9d('0x38')]);_0x1db194[_0x6d9d('0x39')]=qs[_0x6d9d('0x33')](_[_0x6d9d('0x4c')](_0xfff2d0['query'],_0x4f36db[_0x6d9d('0x33')]));if(_0xfff2d0[_0x6d9d('0x32')]['filter']){_0x1db194['where']=_['merge'](_0x1db194[_0x6d9d('0x39')],{'$or':_['map'](_0x1db194[_0x6d9d('0x35')],function(_0xdcc70){var _0x64ac4f={};_0x64ac4f[_0xdcc70]={'$like':'%'+_0xfff2d0[_0x6d9d('0x32')]['filter']+'%'};return _0x64ac4f;})});}_0x1db194=_[_0x6d9d('0x3a')]({},_0x1db194,_0xfff2d0[_0x6d9d('0x3e')]);return _0x46cb22[_0x6d9d('0x4a')](_0x1db194);}})[_0x6d9d('0x26')](function(_0xa47dd5){if(_0xa47dd5){_0x3ac390=_0xa47dd5[_0x6d9d('0x45')];if(!_0xfff2d0[_0x6d9d('0x32')]['hasOwnProperty'](_0x6d9d('0x4d'))){_0x1db194[_0x6d9d('0x1f')]=qs['limit'](_0xfff2d0['query']['limit']);_0x1db194['offset']=qs[_0x6d9d('0x20')](_0xfff2d0[_0x6d9d('0x32')][_0x6d9d('0x20')]);}return _0x46cb22['getConfigurations'](_0x1db194);}})[_0x6d9d('0x26')](function(_0x3f4c45){if(_0x3f4c45){return _0x3f4c45?{'count':_0x3ac390,'rows':_0x3f4c45}:null;}})['then'](respondWithResult(_0x5e9174,null))[_0x6d9d('0x41')](handleError(_0x5e9174,null));};exports[_0x6d9d('0x4e')]=function(_0x33fadb,_0xab517f,_0x28075b){if(_0x33fadb[_0x6d9d('0x49')]['id']){delete _0x33fadb[_0x6d9d('0x49')]['id'];}return db[_0x6d9d('0x2e')][_0x6d9d('0x4f')]({'where':{'id':_0x33fadb[_0x6d9d('0x43')]['id']}})[_0x6d9d('0x26')](handleEntityNotFound(_0xab517f,null))[_0x6d9d('0x26')](function(_0xbb0e1e){if(_0xbb0e1e){_0x33fadb[_0x6d9d('0x49')]['AccountId']=_0xbb0e1e['id'];_0x33fadb['body'][_0x6d9d('0x50')]=integrations['getSubjects'](_0x33fadb[_0x6d9d('0x49')][_0x6d9d('0x51')],_0x33fadb['body'][_0x6d9d('0x3b')]);_0x33fadb[_0x6d9d('0x49')][_0x6d9d('0x52')]=integrations['getDescriptions'](_0x33fadb[_0x6d9d('0x49')][_0x6d9d('0x51')],_0x33fadb[_0x6d9d('0x49')][_0x6d9d('0x3b')]);return db[_0x6d9d('0x53')]['create'](_0x33fadb[_0x6d9d('0x49')],{'include':[{'model':db[_0x6d9d('0x54')],'as':_0x6d9d('0x50')},{'model':db[_0x6d9d('0x54')],'as':_0x6d9d('0x52')}]});}return null;})[_0x6d9d('0x26')](respondWithResult(_0xab517f,null))[_0x6d9d('0x41')](handleError(_0xab517f,null));};exports[_0x6d9d('0x55')]=function(_0x5569da,_0x517542,_0x56a882){var _0x216fd7=[_0x6d9d('0x56'),'hold_reason','knowledge',_0x6d9d('0x57'),_0x6d9d('0x58'),'notify',_0x6d9d('0x59'),'severity',_0x6d9d('0x5a')];var _0x3808e2=[_0x6d9d('0x5b'),_0x6d9d('0x56'),'caused_by','watch_list',_0x6d9d('0x5c'),_0x6d9d('0x5d'),'child_incidents','hold_reason','approval_history',_0x6d9d('0x5e'),'resolved_by',_0x6d9d('0x5f'),_0x6d9d('0x60'),_0x6d9d('0x61'),'sys_created_on',_0x6d9d('0x62'),_0x6d9d('0x63'),_0x6d9d('0x64'),_0x6d9d('0x65'),_0x6d9d('0x37'),_0x6d9d('0x66'),'closed_at',_0x6d9d('0x67'),_0x6d9d('0x68'),_0x6d9d('0x69'),_0x6d9d('0x6a'),_0x6d9d('0x6b'),_0x6d9d('0x6c'),_0x6d9d('0x6d'),_0x6d9d('0x6e'),_0x6d9d('0x6f'),_0x6d9d('0x70'),_0x6d9d('0x71'),_0x6d9d('0x72'),_0x6d9d('0x73'),_0x6d9d('0x74'),_0x6d9d('0x75'),_0x6d9d('0x76'),_0x6d9d('0x77'),_0x6d9d('0x78'),_0x6d9d('0x79'),'subcategory','work_notes',_0x6d9d('0x7a'),_0x6d9d('0x58'),_0x6d9d('0x7b'),_0x6d9d('0x7c'),_0x6d9d('0x7d'),'assignment_group','business_stc','additional_assignee_list',_0x6d9d('0x7e'),_0x6d9d('0x7f'),'notify',_0x6d9d('0x80'),_0x6d9d('0x81'),'closed_by','follow_up',_0x6d9d('0x82'),_0x6d9d('0x83'),_0x6d9d('0x84'),_0x6d9d('0x85'),_0x6d9d('0x59'),_0x6d9d('0x86'),_0x6d9d('0x87'),_0x6d9d('0x88'),_0x6d9d('0x89'),_0x6d9d('0x8a'),_0x6d9d('0x8b'),_0x6d9d('0x8c'),'comments',_0x6d9d('0x8d'),_0x6d9d('0x8e'),'comments_and_work_notes',_0x6d9d('0x8f'),'sys_mod_count',_0x6d9d('0x90'),'sys_tags',_0x6d9d('0x91'),_0x6d9d('0x92'),_0x6d9d('0x93'),_0x6d9d('0x94'),_0x6d9d('0x5a')];var _0x54a57a='';var _0xeed8f5='';var _0xa4b717=[];var _0x550ab4='';var _0x68a2b='';var _0x38ee46=[];var _0x45efb9='';var _0x1e180d='';var _0x4ea186={};var _0x25cb82='';return db[_0x6d9d('0x2e')][_0x6d9d('0x4f')]({'where':{'id':_0x5569da[_0x6d9d('0x43')]['id']},'attributes':['id',_0x6d9d('0x95'),_0x6d9d('0x96'),_0x6d9d('0x97'),_0x6d9d('0x98'),'serverUrl']})[_0x6d9d('0x26')](handleEntityNotFound(_0x517542,null))[_0x6d9d('0x26')](function(_0x5c9af4){if(_0x5c9af4){_0x25cb82=_0x5c9af4[_0x6d9d('0x98')];var _0x4ee4b1=_0x25cb82[_0x6d9d('0x99')](-0x1);if(_0x4ee4b1==='/'){_0x25cb82=_0x25cb82[_0x6d9d('0x9a')](0x0,_0x25cb82[_0x6d9d('0x9b')](_0x4ee4b1));}_0x1e180d=util[_0x6d9d('0x9c')]('%s/api/now/doc/table/schema/',_0x25cb82);_0x45efb9=util[_0x6d9d('0x9c')](_0x6d9d('0x9d'),_0x25cb82);_0x4ea186={'user':_0x5c9af4[_0x6d9d('0x95')],'pass':_0x5c9af4[_0x6d9d('0x96')]};var _0x1ae9cd={'method':_0x6d9d('0x9e'),'uri':_0x1e180d+_0x6d9d('0x9f'),'auth':_0x4ea186,'json':!![]};return rp(_0x1ae9cd);}})[_0x6d9d('0x26')](function(_0x2ae017){if(_0x2ae017[_0x6d9d('0xa0')][_0x6d9d('0x45')]>0x0){_0x54a57a=_0x2ae017[_0x6d9d('0xa0')];}console[_0x6d9d('0xa1')](_0x6d9d('0xa2'),_0x54a57a);_0x38ee46=[];_0xeed8f5=Object['assign']([],_0x54a57a);_[_0x6d9d('0xa3')](_0xeed8f5,function(_0x5ee6f4){return!_0x216fd7[_0x6d9d('0xa4')](_0x5ee6f4[_0x6d9d('0x2b')]);});_0xeed8f5[_0x6d9d('0xa5')](function(_0x275075){var _0x180d1f=createFieldObject(_0x45efb9,_0x4ea186,_0x275075[_0x6d9d('0xa6')],_0x275075[_0x6d9d('0x2b')],_0x275075['label'],![]);_0x38ee46['push'](_0x180d1f);});return Promise['all'](_0x38ee46);})[_0x6d9d('0x26')](function(_0x29c35d){_0xa4b717=_0x29c35d;_0x550ab4=Object[_0x6d9d('0xa7')]([],_0x54a57a);console[_0x6d9d('0xa1')](_0x6d9d('0xa8'),_0x54a57a);_[_0x6d9d('0xa3')](_0x550ab4,function(_0x59bead){return _0x3808e2['includes'](_0x59bead[_0x6d9d('0x2b')]);});console[_0x6d9d('0xa1')](_0x6d9d('0xa9'),_0x550ab4);_0x38ee46=[];_0x550ab4[_0x6d9d('0xa5')](function(_0x4e8790){var _0xb8c2bb=createFieldObject(_0x45efb9,_0x4ea186,_0x4e8790[_0x6d9d('0xa6')],_0x4e8790['name'],_0x4e8790[_0x6d9d('0xaa')],!![]);_0x38ee46['push'](_0xb8c2bb);});return Promise['all'](_0x38ee46);})['then'](function(_0x52550d){_0x68a2b=_0x52550d;var _0x2c53df=_0xa4b717['concat'](_0x68a2b);return{'count':_0x2c53df[_0x6d9d('0x45')],'rows':_0x2c53df};})[_0x6d9d('0x26')](respondWithResult(_0x517542,null))[_0x6d9d('0x41')](function(_0x28e805){console['log'](_0x6d9d('0xab')+_0x28e805);var _0xd81172=_0x5569da[_0x6d9d('0x32')][_0x6d9d('0xac')]?0x1f4:_0x28e805[_0x6d9d('0xad')]||0x1f4;logger[_0x6d9d('0x29')](_0x28e805['stack']);delete _0x28e805[_0x6d9d('0x2b')];if(_0xd81172===0x191){_0xd81172=0x190;}_0x517542[_0x6d9d('0x1b')](_0xd81172)[_0x6d9d('0x2c')](_0x5569da['query'][_0x6d9d('0xac')]?{'message':'Wrong\x20credentials','statusCode':_0x28e805[_0x6d9d('0xad')]}:_0x28e805);});};function createFieldObject(_0x1f2d90,_0x560c72,_0x528ea0,_0x310aa2,_0x5b1c55,_0x47a3f8){return new Promise(function(_0xf98df0,_0xfd01ed){var _0x218d75={'id':_0x310aa2,'name':_0x5b1c55,'custom':_0x47a3f8};if(_0x528ea0===_0x6d9d('0xae')){_0x218d75[_0x6d9d('0x3e')]=[{'name':'True','value':_0x6d9d('0xaf')},{'name':'False','value':_0x6d9d('0xb0')}];_0xf98df0(_0x218d75);}else{var _0x44576a={'method':'GET','uri':_0x1f2d90+'sys_choice?sysparm_query=name=incident^element='+_0x310aa2,'auth':_0x560c72,'json':!![]};return rp(_0x44576a)[_0x6d9d('0x26')](function(_0x2b8e70){var _0x2ff600=[];if(_0x2b8e70['result']['length']>0x0){_0x2b8e70[_0x6d9d('0xa0')]['forEach'](function(_0x532660){if(_0x532660[_0x6d9d('0xb1')]===_0x6d9d('0xb0')){var _0x3c14b6={'name':_0x532660['label'],'value':_0x532660[_0x6d9d('0xb2')]};_0x2ff600[_0x6d9d('0xb3')](_0x3c14b6);}});}_0x218d75['options']=_0x2ff600;if(_0x218d75[_0x6d9d('0x3e')][_0x6d9d('0x45')]>0x0){_0xf98df0(_0x218d75);}else{if(_0x47a3f8==![]){_0xf98df0();}else{_0xf98df0(_0x218d75);}}});}});}
\ No newline at end of file
index 12c67db..54f9a85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','../../config/logger','api'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1cd4d5,_0x40bd09){_0x1cd4d5=_0x1cd4d5-0x0;var _0x348028=_0x7fbe[_0x1cd4d5];return _0x348028;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));var integrations=require(_0xe7fb('0x9'));module[_0xe7fb('0xa')]=function(_0x12d1b0,_0x24cd67){return _0x12d1b0[_0xe7fb('0xb')]('ServicenowAccount',attributes,{'tableName':_0xe7fb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fab=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts'];(function(_0x37e21b,_0x50b31e){var _0x411f61=function(_0x1dd731){while(--_0x1dd731){_0x37e21b['push'](_0x37e21b['shift']());}};_0x411f61(++_0x50b31e);}(_0x5fab,0x177));var _0xb5fa=function(_0x21f9c2,_0x2b3d2a){_0x21f9c2=_0x21f9c2-0x0;var _0x3da17f=_0x5fab[_0x21f9c2];return _0x3da17f;};'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 fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));var integrations=require(_0xb5fa('0xa'));module[_0xb5fa('0xb')]=function(_0x4a0249,_0x5d70f6){return _0x4a0249[_0xb5fa('0xc')](_0xb5fa('0xd'),attributes,{'tableName':_0xb5fa('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 12d17f8..25e268d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43de=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','request\x20sent','debug','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','info','result','catch','GetServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowServicenowAccount','ServicenowAccount','lodash','util'];(function(_0x5b11c6,_0x794061){var _0x4f314f=function(_0x4a69c0){while(--_0x4a69c0){_0x5b11c6['push'](_0x5b11c6['shift']());}};_0x4f314f(++_0x794061);}(_0x43de,0xad));var _0xe43d=function(_0x1a8580,_0x4e4557){_0x1a8580=_0x1a8580-0x0;var _0x421ca4=_0x43de[_0x1a8580];return _0x421ca4;};'use strict';var _=require(_0xe43d('0x0'));var util=require(_0xe43d('0x1'));var moment=require(_0xe43d('0x2'));var BPromise=require('bluebird');var rs=require(_0xe43d('0x3'));var fs=require('fs');var Redis=require(_0xe43d('0x4'));var db=require(_0xe43d('0x5'))['db'];var utils=require(_0xe43d('0x6'));var logger=require(_0xe43d('0x7'))(_0xe43d('0x8'));var config=require(_0xe43d('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe43d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x380c08,_0x3bdfc5,_0x2400d6){return new BPromise(function(_0x14fe0d,_0x5ee359){return client[_0xe43d('0xb')](_0x380c08,_0x2400d6)[_0xe43d('0xc')](function(_0x280c13){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x3bdfc5,_0xe43d('0xd'));logger[_0xe43d('0xe')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x3bdfc5,_0xe43d('0xd'),JSON[_0xe43d('0xf')](_0x280c13));if(_0x280c13['error']){if(_0x280c13[_0xe43d('0x10')][_0xe43d('0x11')]===0x1f4){logger['error'](_0xe43d('0x12'),_0x3bdfc5,_0x280c13[_0xe43d('0x10')][_0xe43d('0x13')]);return _0x5ee359(_0x280c13['error'][_0xe43d('0x13')]);}logger[_0xe43d('0x10')](_0xe43d('0x12'),_0x3bdfc5,_0x280c13[_0xe43d('0x10')][_0xe43d('0x13')]);return _0x14fe0d(_0x280c13[_0xe43d('0x10')][_0xe43d('0x13')]);}else{logger[_0xe43d('0x14')](_0xe43d('0x12'),_0x3bdfc5,'request\x20sent');_0x14fe0d(_0x280c13[_0xe43d('0x15')][_0xe43d('0x13')]);}})[_0xe43d('0x16')](function(_0x32825c){logger[_0xe43d('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x3bdfc5,_0x32825c);_0x5ee359(_0x32825c);});});}exports[_0xe43d('0x17')]=function(_0x132598){var _0x2dd891=this;return new Promise(function(_0x299e00,_0x58fc37){return db['ServicenowAccount'][_0xe43d('0x18')]({'raw':_0x132598[_0xe43d('0x19')]?_0x132598['options'][_0xe43d('0x1a')]===undefined?!![]:![]:!![],'where':_0x132598[_0xe43d('0x19')]?_0x132598['options'][_0xe43d('0x1b')]||null:null,'attributes':_0x132598[_0xe43d('0x19')]?_0x132598[_0xe43d('0x19')][_0xe43d('0x1c')]||null:null,'limit':_0x132598[_0xe43d('0x19')]?_0x132598['options'][_0xe43d('0x1d')]||null:null,'include':_0x132598[_0xe43d('0x19')]?_0x132598[_0xe43d('0x19')][_0xe43d('0x1e')]?_[_0xe43d('0x1f')](_0x132598['options']['include'],function(_0xd35298){return{'model':db[_0xd35298[_0xe43d('0x20')]],'as':_0xd35298['as'],'attributes':_0xd35298[_0xe43d('0x1c')],'include':_0xd35298[_0xe43d('0x1e')]?_[_0xe43d('0x1f')](_0xd35298[_0xe43d('0x1e')],function(_0x4f6240){return{'model':db[_0x4f6240[_0xe43d('0x20')]],'as':_0x4f6240['as'],'attributes':_0x4f6240[_0xe43d('0x1c')],'include':_0x4f6240[_0xe43d('0x1e')]?_[_0xe43d('0x1f')](_0x4f6240[_0xe43d('0x1e')],function(_0x4598fd){return{'model':db[_0x4598fd[_0xe43d('0x20')]],'as':_0x4598fd['as'],'attributes':_0x4598fd[_0xe43d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe43d('0xc')](function(_0x51525e){logger[_0xe43d('0x14')](_0xe43d('0x17'),_0x132598);logger[_0xe43d('0xe')](_0xe43d('0x17'),_0x132598,JSON[_0xe43d('0xf')](_0x51525e));_0x299e00(_0x51525e);})['catch'](function(_0x4e1528){logger[_0xe43d('0x10')]('GetServicenowAccount',_0x4e1528[_0xe43d('0x13')],_0x132598);_0x58fc37(_0x2dd891['error'](0x1f4,_0x4e1528[_0xe43d('0x13')]));});});};exports[_0xe43d('0x21')]=function(_0x3920d6){var _0x30e954=this;return new Promise(function(_0x2399ba,_0x705776){return db[_0xe43d('0x22')]['find']({'raw':_0x3920d6[_0xe43d('0x19')]?_0x3920d6['options'][_0xe43d('0x1a')]===undefined?!![]:![]:!![],'where':_0x3920d6[_0xe43d('0x19')]?_0x3920d6[_0xe43d('0x19')][_0xe43d('0x1b')]||null:null,'attributes':_0x3920d6[_0xe43d('0x19')]?_0x3920d6[_0xe43d('0x19')][_0xe43d('0x1c')]||null:null,'include':_0x3920d6[_0xe43d('0x19')]?_0x3920d6[_0xe43d('0x19')]['include']?_[_0xe43d('0x1f')](_0x3920d6[_0xe43d('0x19')][_0xe43d('0x1e')],function(_0x59e20d){return{'model':db[_0x59e20d[_0xe43d('0x20')]],'as':_0x59e20d['as'],'attributes':_0x59e20d[_0xe43d('0x1c')],'include':_0x59e20d[_0xe43d('0x1e')]?_[_0xe43d('0x1f')](_0x59e20d['include'],function(_0x27c0d6){return{'model':db[_0x27c0d6['model']],'as':_0x27c0d6['as'],'attributes':_0x27c0d6[_0xe43d('0x1c')],'include':_0x27c0d6[_0xe43d('0x1e')]?_[_0xe43d('0x1f')](_0x27c0d6[_0xe43d('0x1e')],function(_0x116769){return{'model':db[_0x116769[_0xe43d('0x20')]],'as':_0x116769['as'],'attributes':_0x116769[_0xe43d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xe43d('0xc')](function(_0x22c2cb){logger[_0xe43d('0x14')]('ShowServicenowAccount',_0x3920d6);logger[_0xe43d('0xe')](_0xe43d('0x21'),_0x3920d6,JSON[_0xe43d('0xf')](_0x22c2cb));_0x2399ba(_0x22c2cb);})['catch'](function(_0x4b6792){logger[_0xe43d('0x10')]('ShowServicenowAccount',_0x4b6792[_0xe43d('0x13')],_0x3920d6);_0x705776(_0x30e954[_0xe43d('0x10')](0x1f4,_0x4b6792[_0xe43d('0x13')]));});});};
\ No newline at end of file
+var _0x230b=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','ServicenowAccount,\x20%s,\x20%s','message','info','result','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','map','include','model','stringify','ShowServicenowAccount','find','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x3f7246,_0x34e4cc){var _0x3cc967=function(_0x2feb51){while(--_0x2feb51){_0x3f7246['push'](_0x3f7246['shift']());}};_0x3cc967(++_0x34e4cc);}(_0x230b,0xcd));var _0xb230=function(_0x149072,_0x5353ed){_0x149072=_0x149072-0x0;var _0xbe1310=_0x230b[_0x149072];return _0xbe1310;};'use strict';var _=require(_0xb230('0x0'));var util=require(_0xb230('0x1'));var moment=require('moment');var BPromise=require(_0xb230('0x2'));var rs=require(_0xb230('0x3'));var fs=require('fs');var Redis=require(_0xb230('0x4'));var db=require(_0xb230('0x5'))['db'];var utils=require(_0xb230('0x6'));var logger=require(_0xb230('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xb230('0x8'));var client=jayson[_0xb230('0x9')][_0xb230('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58af66,_0x1d43d6,_0x28d6a9){return new BPromise(function(_0x37d7fa,_0x5746ea){return client[_0xb230('0xb')](_0x58af66,_0x28d6a9)[_0xb230('0xc')](function(_0x50dc0d){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x1d43d6,_0xb230('0xd'));logger[_0xb230('0xe')](_0xb230('0xf'),_0x1d43d6,'request\x20sent',JSON['stringify'](_0x50dc0d));if(_0x50dc0d[_0xb230('0x10')]){if(_0x50dc0d['error'][_0xb230('0x11')]===0x1f4){logger[_0xb230('0x10')](_0xb230('0x12'),_0x1d43d6,_0x50dc0d[_0xb230('0x10')][_0xb230('0x13')]);return _0x5746ea(_0x50dc0d['error']['message']);}logger[_0xb230('0x10')](_0xb230('0x12'),_0x1d43d6,_0x50dc0d[_0xb230('0x10')][_0xb230('0x13')]);return _0x37d7fa(_0x50dc0d[_0xb230('0x10')][_0xb230('0x13')]);}else{logger[_0xb230('0x14')](_0xb230('0x12'),_0x1d43d6,_0xb230('0xd'));_0x37d7fa(_0x50dc0d[_0xb230('0x15')][_0xb230('0x13')]);}})['catch'](function(_0x4c4fcd){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x1d43d6,_0x4c4fcd);_0x5746ea(_0x4c4fcd);});});}exports[_0xb230('0x16')]=function(_0x53c7d6){var _0x6a944=this;return new Promise(function(_0x355238,_0x58b836){return db[_0xb230('0x17')][_0xb230('0x18')]({'raw':_0x53c7d6['options']?_0x53c7d6[_0xb230('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x53c7d6[_0xb230('0x19')]?_0x53c7d6[_0xb230('0x19')][_0xb230('0x1a')]||null:null,'attributes':_0x53c7d6['options']?_0x53c7d6[_0xb230('0x19')][_0xb230('0x1b')]||null:null,'limit':_0x53c7d6[_0xb230('0x19')]?_0x53c7d6[_0xb230('0x19')]['limit']||null:null,'include':_0x53c7d6['options']?_0x53c7d6[_0xb230('0x19')]['include']?_[_0xb230('0x1c')](_0x53c7d6['options'][_0xb230('0x1d')],function(_0x5d217d){return{'model':db[_0x5d217d[_0xb230('0x1e')]],'as':_0x5d217d['as'],'attributes':_0x5d217d['attributes'],'include':_0x5d217d['include']?_['map'](_0x5d217d['include'],function(_0x42a404){return{'model':db[_0x42a404[_0xb230('0x1e')]],'as':_0x42a404['as'],'attributes':_0x42a404[_0xb230('0x1b')],'include':_0x42a404[_0xb230('0x1d')]?_[_0xb230('0x1c')](_0x42a404[_0xb230('0x1d')],function(_0x34b2b2){return{'model':db[_0x34b2b2[_0xb230('0x1e')]],'as':_0x34b2b2['as'],'attributes':_0x34b2b2[_0xb230('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb230('0xc')](function(_0x3c6ef5){logger[_0xb230('0x14')](_0xb230('0x16'),_0x53c7d6);logger[_0xb230('0xe')](_0xb230('0x16'),_0x53c7d6,JSON[_0xb230('0x1f')](_0x3c6ef5));_0x355238(_0x3c6ef5);})['catch'](function(_0xdb703b){logger[_0xb230('0x10')](_0xb230('0x16'),_0xdb703b[_0xb230('0x13')],_0x53c7d6);_0x58b836(_0x6a944['error'](0x1f4,_0xdb703b[_0xb230('0x13')]));});});};exports[_0xb230('0x20')]=function(_0x2352ca){var _0x182bf7=this;return new Promise(function(_0x3adfd3,_0x3fc2b8){return db[_0xb230('0x17')][_0xb230('0x21')]({'raw':_0x2352ca['options']?_0x2352ca[_0xb230('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2352ca['options']?_0x2352ca['options']['where']||null:null,'attributes':_0x2352ca[_0xb230('0x19')]?_0x2352ca[_0xb230('0x19')]['attributes']||null:null,'include':_0x2352ca[_0xb230('0x19')]?_0x2352ca[_0xb230('0x19')][_0xb230('0x1d')]?_['map'](_0x2352ca[_0xb230('0x19')][_0xb230('0x1d')],function(_0x4a0abf){return{'model':db[_0x4a0abf['model']],'as':_0x4a0abf['as'],'attributes':_0x4a0abf['attributes'],'include':_0x4a0abf['include']?_[_0xb230('0x1c')](_0x4a0abf['include'],function(_0x302117){return{'model':db[_0x302117[_0xb230('0x1e')]],'as':_0x302117['as'],'attributes':_0x302117[_0xb230('0x1b')],'include':_0x302117[_0xb230('0x1d')]?_[_0xb230('0x1c')](_0x302117[_0xb230('0x1d')],function(_0x3d0f09){return{'model':db[_0x3d0f09[_0xb230('0x1e')]],'as':_0x3d0f09['as'],'attributes':_0x3d0f09[_0xb230('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb230('0xc')](function(_0x2093a1){logger['info']('ShowServicenowAccount',_0x2352ca);logger[_0xb230('0xe')](_0xb230('0x20'),_0x2352ca,JSON[_0xb230('0x1f')](_0x2093a1));_0x3adfd3(_0x2093a1);})[_0xb230('0x22')](function(_0x52eb1e){logger[_0xb230('0x10')]('ShowServicenowAccount',_0x52eb1e[_0xb230('0x13')],_0x2352ca);_0x3fc2b8(_0x182bf7[_0xb230('0x10')](0x1f4,_0x52eb1e[_0xb230('0x13')]));});});};
\ No newline at end of file
index 3ecacd0..2d2c85f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56f7=['get','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index'];(function(_0x27e2a7,_0x37c256){var _0x5699be=function(_0x32d493){while(--_0x32d493){_0x27e2a7['push'](_0x27e2a7['shift']());}};_0x5699be(++_0x37c256);}(_0x56f7,0x161));var _0x756f=function(_0x3219e9,_0x31aa4e){_0x3219e9=_0x3219e9-0x0;var _0x1fbe22=_0x56f7[_0x3219e9];return _0x1fbe22;};'use strict';var multer=require(_0x756f('0x0'));var util=require(_0x756f('0x1'));var path=require(_0x756f('0x2'));var timeout=require(_0x756f('0x3'));var express=require('express');var router=express[_0x756f('0x4')]();var fs_extra=require(_0x756f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x756f('0x6'));var config=require(_0x756f('0x7'));var controller=require(_0x756f('0x8'));router['get']('/',auth[_0x756f('0x9')](),controller[_0x756f('0xa')]);router[_0x756f('0xb')](_0x756f('0xc'),auth[_0x756f('0x9')](),controller[_0x756f('0xd')]);router[_0x756f('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x756f('0xe')]);router[_0x756f('0xb')](_0x756f('0xf'),auth[_0x756f('0x9')](),controller[_0x756f('0x10')]);router[_0x756f('0xb')](_0x756f('0x11'),auth[_0x756f('0x9')](),controller[_0x756f('0x12')]);router[_0x756f('0x13')]('/',auth[_0x756f('0x9')](),controller[_0x756f('0x14')]);router[_0x756f('0x15')]('/:id',auth[_0x756f('0x9')](),controller[_0x756f('0x16')]);router[_0x756f('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x756f('0x18')]);module[_0x756f('0x19')]=router;
\ No newline at end of file
+var _0x2b1a=['./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x45dda8,_0x261820){var _0x19a8f8=function(_0x15e6bb){while(--_0x15e6bb){_0x45dda8['push'](_0x45dda8['shift']());}};_0x19a8f8(++_0x261820);}(_0x2b1a,0x1eb));var _0xa2b1=function(_0x575c38,_0x1a43c4){_0x575c38=_0x575c38-0x0;var _0x348ce7=_0x2b1a[_0x575c38];return _0x348ce7;};'use strict';var multer=require(_0xa2b1('0x0'));var util=require(_0xa2b1('0x1'));var path=require(_0xa2b1('0x2'));var timeout=require(_0xa2b1('0x3'));var express=require(_0xa2b1('0x4'));var router=express[_0xa2b1('0x5')]();var fs_extra=require(_0xa2b1('0x6'));var auth=require(_0xa2b1('0x7'));var interaction=require(_0xa2b1('0x8'));var config=require('../../config/environment');var controller=require(_0xa2b1('0x9'));router[_0xa2b1('0xa')]('/',auth[_0xa2b1('0xb')](),controller[_0xa2b1('0xc')]);router[_0xa2b1('0xa')](_0xa2b1('0xd'),auth[_0xa2b1('0xb')](),controller[_0xa2b1('0xe')]);router[_0xa2b1('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xa2b1('0xf')]);router[_0xa2b1('0xa')](_0xa2b1('0x10'),auth[_0xa2b1('0xb')](),controller[_0xa2b1('0x11')]);router[_0xa2b1('0xa')](_0xa2b1('0x12'),auth['isAuthenticated'](),controller[_0xa2b1('0x13')]);router[_0xa2b1('0x14')]('/',auth[_0xa2b1('0xb')](),controller['create']);router[_0xa2b1('0x15')](_0xa2b1('0xd'),auth[_0xa2b1('0xb')](),controller['update']);router[_0xa2b1('0x16')](_0xa2b1('0xd'),auth[_0xa2b1('0xb')](),controller[_0xa2b1('0x17')]);module[_0xa2b1('0x18')]=router;
\ No newline at end of file
index d7552be..9cda149 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x018e=['STRING','sequelize','exports'];(function(_0x22a91c,_0x5ce13f){var _0x733c2f=function(_0x1ef119){while(--_0x1ef119){_0x22a91c['push'](_0x22a91c['shift']());}};_0x733c2f(++_0x5ce13f);}(_0x018e,0xf4));var _0xe018=function(_0x39bfb6,_0x4272c8){_0x39bfb6=_0x39bfb6-0x0;var _0x23fef9=_0x018e[_0x39bfb6];return _0x23fef9;};'use strict';var Sequelize=require(_0xe018('0x0'));module[_0xe018('0x1')]={'name':{'type':Sequelize[_0xe018('0x2')]},'description':{'type':Sequelize[_0xe018('0x2')]}};
\ No newline at end of file
+var _0x8bf9=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8bf9,0xf7));var _0x98bf=function(_0x2ba1b2,_0x1d4370){_0x2ba1b2=_0x2ba1b2-0x0;var _0x23345e=_0x8bf9[_0x2ba1b2];return _0x23345e;};'use strict';var Sequelize=require(_0x98bf('0x0'));module[_0x98bf('0x1')]={'name':{'type':Sequelize[_0x98bf('0x2')]},'description':{'type':Sequelize[_0x98bf('0x2')]}};
\ No newline at end of file
index 2b52a7b..cb6eda3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7bd=['count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','catch','findOne','ServicenowField','filter','getFields','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x2c7192,_0x133f6b){var _0x5117d0=function(_0x29a5a1){while(--_0x29a5a1){_0x2c7192['push'](_0x2c7192['shift']());}};_0x5117d0(++_0x133f6b);}(_0xc7bd,0x86));var _0xdc7b=function(_0x478e1c,_0x40f3e5){_0x478e1c=_0x478e1c-0x0;var _0x526734=_0xc7bd[_0x478e1c];return _0x526734;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdc7b('0x0'));var zipdir=require(_0xdc7b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdc7b('0x2'));var moment=require('moment');var BPromise=require(_0xdc7b('0x3'));var Mustache=require('mustache');var util=require(_0xdc7b('0x4'));var path=require(_0xdc7b('0x5'));var sox=require(_0xdc7b('0x6'));var csv=require(_0xdc7b('0x7'));var ejs=require(_0xdc7b('0x8'));var fs=require('fs');var fs_extra=require(_0xdc7b('0x9'));var _=require(_0xdc7b('0xa'));var squel=require('squel');var crypto=require(_0xdc7b('0xb'));var jsforce=require(_0xdc7b('0xc'));var deskjs=require(_0xdc7b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdc7b('0xe'));var Redis=require(_0xdc7b('0xf'));var authService=require(_0xdc7b('0x10'));var qs=require(_0xdc7b('0x11'));var as=require(_0xdc7b('0x12'));var hardwareService=require(_0xdc7b('0x13'));var logger=require('../../config/logger')(_0xdc7b('0x14'));var utils=require(_0xdc7b('0x15'));var config=require(_0xdc7b('0x16'));var licenseUtil=require(_0xdc7b('0x17'));var db=require(_0xdc7b('0x18'))['db'];function respondWithStatusCode(_0x159e5a,_0x5eacf3){_0x5eacf3=_0x5eacf3||0xcc;return function(_0x297af0){if(_0x297af0){return _0x159e5a[_0xdc7b('0x19')](_0x5eacf3);}return _0x159e5a['status'](_0x5eacf3)[_0xdc7b('0x1a')]();};}function respondWithResult(_0x5eb8d9,_0x2407e7){_0x2407e7=_0x2407e7||0xc8;return function(_0x23d458){if(_0x23d458){return _0x5eb8d9[_0xdc7b('0x1b')](_0x2407e7)[_0xdc7b('0x1c')](_0x23d458);}};}function respondWithFilteredResult(_0x5afa1e,_0x152ec8){return function(_0x2088f1){if(_0x2088f1){var _0x5e0281=typeof _0x152ec8[_0xdc7b('0x1d')]===_0xdc7b('0x1e')&&typeof _0x152ec8[_0xdc7b('0x1f')]===_0xdc7b('0x1e');var _0x19b289=_0x2088f1[_0xdc7b('0x20')];var _0x39cb1c=_0x5e0281?0x0:_0x152ec8[_0xdc7b('0x1d')];var _0x5e95fb=_0x5e0281?_0x2088f1[_0xdc7b('0x20')]:_0x152ec8['offset']+_0x152ec8[_0xdc7b('0x1f')];var _0x5bcc30;if(_0x5e95fb>=_0x19b289){_0x5e95fb=_0x19b289;_0x5bcc30=0xc8;}else{_0x5bcc30=0xce;}_0x5afa1e[_0xdc7b('0x1b')](_0x5bcc30);return _0x5afa1e[_0xdc7b('0x21')](_0xdc7b('0x22'),_0x39cb1c+'-'+_0x5e95fb+'/'+_0x19b289)[_0xdc7b('0x1c')](_0x2088f1);}return null;};}function patchUpdates(_0x1f516d){return function(_0x4c39db){try{jsonpatch['apply'](_0x4c39db,_0x1f516d,!![]);}catch(_0x500458){return BPromise[_0xdc7b('0x23')](_0x500458);}return _0x4c39db[_0xdc7b('0x24')]();};}function saveUpdates(_0x4c3231,_0x2665cb){return function(_0x25ec2e){if(_0x25ec2e){return _0x25ec2e[_0xdc7b('0x25')](_0x4c3231)['then'](function(_0x3c1783){return _0x3c1783;});}return null;};}function removeEntity(_0x4c6d14,_0x3b3d3d){return function(_0x2a1fca){if(_0x2a1fca){return _0x2a1fca[_0xdc7b('0x26')]()[_0xdc7b('0x27')](function(){_0x4c6d14[_0xdc7b('0x1b')](0xcc)[_0xdc7b('0x1a')]();});}};}function handleEntityNotFound(_0x10c260,_0x626ed6){return function(_0x4e97c9){if(!_0x4e97c9){_0x10c260['sendStatus'](0x194);}return _0x4e97c9;};}function handleError(_0x1c1eaf,_0x48189d){_0x48189d=_0x48189d||0x1f4;return function(_0x21d40b){logger[_0xdc7b('0x28')](_0x21d40b['stack']);if(_0x21d40b[_0xdc7b('0x29')]){delete _0x21d40b['name'];}_0x1c1eaf[_0xdc7b('0x1b')](_0x48189d)[_0xdc7b('0x2a')](_0x21d40b);};}exports[_0xdc7b('0x2b')]=function(_0x5bbe04,_0x2eb566){var _0x102288={},_0x2cfd85={},_0x1eefbb={'count':0x0,'rows':[]};var _0x3c84ed=_['map'](db[_0xdc7b('0x2c')][_0xdc7b('0x2d')],function(_0x1b8bb1){return{'name':_0x1b8bb1[_0xdc7b('0x2e')],'type':_0x1b8bb1['type'][_0xdc7b('0x2f')]};});_0x2cfd85[_0xdc7b('0x30')]=_[_0xdc7b('0x31')](_0x3c84ed,_0xdc7b('0x29'));_0x2cfd85['query']=_[_0xdc7b('0x32')](_0x5bbe04[_0xdc7b('0x33')]);_0x2cfd85[_0xdc7b('0x34')]=_[_0xdc7b('0x35')](_0x2cfd85[_0xdc7b('0x30')],_0x2cfd85['query']);_0x102288[_0xdc7b('0x36')]=_['intersection'](_0x2cfd85[_0xdc7b('0x30')],qs[_0xdc7b('0x37')](_0x5bbe04[_0xdc7b('0x33')]['fields']));_0x102288[_0xdc7b('0x36')]=_0x102288[_0xdc7b('0x36')][_0xdc7b('0x38')]?_0x102288['attributes']:_0x2cfd85[_0xdc7b('0x30')];if(!_0x5bbe04[_0xdc7b('0x33')]['hasOwnProperty'](_0xdc7b('0x39'))){_0x102288['limit']=qs[_0xdc7b('0x1f')](_0x5bbe04[_0xdc7b('0x33')]['limit']);_0x102288[_0xdc7b('0x1d')]=qs[_0xdc7b('0x1d')](_0x5bbe04[_0xdc7b('0x33')][_0xdc7b('0x1d')]);}_0x102288[_0xdc7b('0x3a')]=qs[_0xdc7b('0x3b')](_0x5bbe04[_0xdc7b('0x33')][_0xdc7b('0x3b')]);_0x102288['where']=qs[_0xdc7b('0x34')](_[_0xdc7b('0x3c')](_0x5bbe04[_0xdc7b('0x33')],_0x2cfd85['filters']),_0x3c84ed);if(_0x5bbe04['query']['filter']){_0x102288[_0xdc7b('0x3d')]=_[_0xdc7b('0x3e')](_0x102288[_0xdc7b('0x3d')],{'$or':_[_0xdc7b('0x31')](_0x3c84ed,function(_0x30328b){if(_0x30328b[_0xdc7b('0x3f')]!==_0xdc7b('0x40')){var _0x239ffe={};_0x239ffe[_0x30328b[_0xdc7b('0x29')]]={'$like':'%'+_0x5bbe04[_0xdc7b('0x33')]['filter']+'%'};return _0x239ffe;}})});}_0x102288=_[_0xdc7b('0x3e')]({},_0x102288,_0x5bbe04[_0xdc7b('0x41')]);var _0x49edcd={'where':_0x102288['where']};return db[_0xdc7b('0x2c')][_0xdc7b('0x20')](_0x49edcd)[_0xdc7b('0x27')](function(_0xeb2479){_0x1eefbb[_0xdc7b('0x20')]=_0xeb2479;if(_0x5bbe04[_0xdc7b('0x33')][_0xdc7b('0x42')]){_0x102288[_0xdc7b('0x43')]=[{'all':!![]}];}return db[_0xdc7b('0x2c')][_0xdc7b('0x44')](_0x102288);})['then'](function(_0x3005ac){_0x1eefbb[_0xdc7b('0x45')]=_0x3005ac;return _0x1eefbb;})[_0xdc7b('0x27')](respondWithFilteredResult(_0x2eb566,_0x102288))['catch'](handleError(_0x2eb566,null));};exports[_0xdc7b('0x46')]=function(_0x1aa3fe,_0x321208){var _0x155bf4={'raw':![],'where':{'id':_0x1aa3fe[_0xdc7b('0x47')]['id']}},_0x398133={};_0x398133[_0xdc7b('0x30')]=_[_0xdc7b('0x32')](db[_0xdc7b('0x2c')][_0xdc7b('0x2d')]);_0x398133['query']=_[_0xdc7b('0x32')](_0x1aa3fe[_0xdc7b('0x33')]);_0x398133[_0xdc7b('0x34')]=_[_0xdc7b('0x35')](_0x398133[_0xdc7b('0x30')],_0x398133['query']);_0x155bf4[_0xdc7b('0x36')]=_[_0xdc7b('0x35')](_0x398133[_0xdc7b('0x30')],qs['fields'](_0x1aa3fe[_0xdc7b('0x33')][_0xdc7b('0x37')]));_0x155bf4[_0xdc7b('0x36')]=_0x155bf4[_0xdc7b('0x36')]['length']?_0x155bf4['attributes']:_0x398133[_0xdc7b('0x30')];if(_0x1aa3fe['query']['includeAll']){_0x155bf4[_0xdc7b('0x43')]=[{'all':!![]}];}_0x155bf4=_[_0xdc7b('0x3e')]({},_0x155bf4,_0x1aa3fe[_0xdc7b('0x41')]);return db[_0xdc7b('0x2c')][_0xdc7b('0x48')](_0x155bf4)[_0xdc7b('0x27')](handleEntityNotFound(_0x321208,null))['then'](respondWithResult(_0x321208,null))['catch'](handleError(_0x321208,null));};exports[_0xdc7b('0x49')]=function(_0x2ede8c,_0x33a068){return db[_0xdc7b('0x2c')][_0xdc7b('0x49')](_0x2ede8c[_0xdc7b('0x4a')],{})[_0xdc7b('0x27')](respondWithResult(_0x33a068,0xc9))[_0xdc7b('0x4b')](handleError(_0x33a068,null));};exports[_0xdc7b('0x25')]=function(_0x22a2fa,_0x3a5785){if(_0x22a2fa['body']['id']){delete _0x22a2fa[_0xdc7b('0x4a')]['id'];}return db[_0xdc7b('0x2c')]['find']({'where':{'id':_0x22a2fa['params']['id']}})[_0xdc7b('0x27')](handleEntityNotFound(_0x3a5785,null))[_0xdc7b('0x27')](saveUpdates(_0x22a2fa[_0xdc7b('0x4a')],null))[_0xdc7b('0x27')](respondWithResult(_0x3a5785,null))[_0xdc7b('0x4b')](handleError(_0x3a5785,null));};exports[_0xdc7b('0x26')]=function(_0x2e3d98,_0x36ef7e){return db['ServicenowConfiguration']['find']({'where':{'id':_0x2e3d98[_0xdc7b('0x47')]['id']}})[_0xdc7b('0x27')](handleEntityNotFound(_0x36ef7e,null))[_0xdc7b('0x27')](removeEntity(_0x36ef7e,null))['catch'](handleError(_0x36ef7e,null));};exports['getFields']=function(_0x2dd0ba,_0x1ecaf0,_0x5accad){var _0xc7ed00={};var _0x1c7749={};var _0x4b455c;var _0x2a2383;return db[_0xdc7b('0x2c')][_0xdc7b('0x4c')]({'where':{'id':_0x2dd0ba[_0xdc7b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1ecaf0,null))[_0xdc7b('0x27')](function(_0x8ca17c){if(_0x8ca17c){_0x4b455c=_0x8ca17c;_0x1c7749[_0xdc7b('0x30')]=_[_0xdc7b('0x32')](db[_0xdc7b('0x4d')][_0xdc7b('0x2d')]);_0x1c7749[_0xdc7b('0x33')]=_[_0xdc7b('0x32')](_0x2dd0ba['query']);_0x1c7749[_0xdc7b('0x34')]=_[_0xdc7b('0x35')](_0x1c7749[_0xdc7b('0x30')],_0x1c7749[_0xdc7b('0x33')]);_0xc7ed00[_0xdc7b('0x36')]=_['intersection'](_0x1c7749[_0xdc7b('0x30')],qs[_0xdc7b('0x37')](_0x2dd0ba[_0xdc7b('0x33')][_0xdc7b('0x37')]));_0xc7ed00[_0xdc7b('0x36')]=_0xc7ed00[_0xdc7b('0x36')][_0xdc7b('0x38')]?_0xc7ed00[_0xdc7b('0x36')]:_0x1c7749['model'];_0xc7ed00[_0xdc7b('0x3a')]=qs[_0xdc7b('0x3b')](_0x2dd0ba[_0xdc7b('0x33')][_0xdc7b('0x3b')]);_0xc7ed00[_0xdc7b('0x3d')]=qs[_0xdc7b('0x34')](_[_0xdc7b('0x3c')](_0x2dd0ba[_0xdc7b('0x33')],_0x1c7749[_0xdc7b('0x34')]));if(_0x2dd0ba[_0xdc7b('0x33')][_0xdc7b('0x4e')]){_0xc7ed00[_0xdc7b('0x3d')]=_['merge'](_0xc7ed00[_0xdc7b('0x3d')],{'$or':_['map'](_0xc7ed00[_0xdc7b('0x36')],function(_0x475708){var _0x5ef37d={};_0x5ef37d[_0x475708]={'$like':'%'+_0x2dd0ba[_0xdc7b('0x33')][_0xdc7b('0x4e')]+'%'};return _0x5ef37d;})});}_0xc7ed00=_[_0xdc7b('0x3e')]({},_0xc7ed00,_0x2dd0ba[_0xdc7b('0x41')]);return _0x4b455c[_0xdc7b('0x4f')](_0xc7ed00);}})[_0xdc7b('0x27')](function(_0x2c2021){if(_0x2c2021){_0x2a2383=_0x2c2021[_0xdc7b('0x38')];if(!_0x2dd0ba[_0xdc7b('0x33')][_0xdc7b('0x50')](_0xdc7b('0x39'))){_0xc7ed00[_0xdc7b('0x1f')]=qs['limit'](_0x2dd0ba['query'][_0xdc7b('0x1f')]);_0xc7ed00[_0xdc7b('0x1d')]=qs['offset'](_0x2dd0ba['query']['offset']);}return _0x4b455c[_0xdc7b('0x4f')](_0xc7ed00);}})[_0xdc7b('0x27')](function(_0x5867da){if(_0x5867da){return _0x5867da?{'count':_0x2a2383,'rows':_0x5867da}:null;}})[_0xdc7b('0x27')](respondWithResult(_0x1ecaf0,null))[_0xdc7b('0x4b')](handleError(_0x1ecaf0,null));};exports[_0xdc7b('0x51')]=function(_0x11803e,_0x2b83d1,_0x3e5aad){var _0x42c7e2={};var _0x105149={};var _0x35680f;var _0x38459d;return db[_0xdc7b('0x2c')]['findOne']({'where':{'id':_0x11803e['params']['id']}})[_0xdc7b('0x27')](handleEntityNotFound(_0x2b83d1,null))['then'](function(_0x207428){if(_0x207428){_0x35680f=_0x207428;_0x105149[_0xdc7b('0x30')]=_['keys'](db[_0xdc7b('0x4d')]['rawAttributes']);_0x105149[_0xdc7b('0x33')]=_[_0xdc7b('0x32')](_0x11803e['query']);_0x105149[_0xdc7b('0x34')]=_[_0xdc7b('0x35')](_0x105149[_0xdc7b('0x30')],_0x105149[_0xdc7b('0x33')]);_0x42c7e2[_0xdc7b('0x36')]=_[_0xdc7b('0x35')](_0x105149[_0xdc7b('0x30')],qs['fields'](_0x11803e[_0xdc7b('0x33')][_0xdc7b('0x37')]));_0x42c7e2['attributes']=_0x42c7e2[_0xdc7b('0x36')][_0xdc7b('0x38')]?_0x42c7e2['attributes']:_0x105149[_0xdc7b('0x30')];_0x42c7e2[_0xdc7b('0x3a')]=qs['sort'](_0x11803e[_0xdc7b('0x33')]['sort']);_0x42c7e2['where']=qs[_0xdc7b('0x34')](_[_0xdc7b('0x3c')](_0x11803e[_0xdc7b('0x33')],_0x105149[_0xdc7b('0x34')]));if(_0x11803e[_0xdc7b('0x33')]['filter']){_0x42c7e2[_0xdc7b('0x3d')]=_['merge'](_0x42c7e2['where'],{'$or':_[_0xdc7b('0x31')](_0x42c7e2[_0xdc7b('0x36')],function(_0x2a4311){var _0x38247f={};_0x38247f[_0x2a4311]={'$like':'%'+_0x11803e[_0xdc7b('0x33')][_0xdc7b('0x4e')]+'%'};return _0x38247f;})});}_0x42c7e2=_[_0xdc7b('0x3e')]({},_0x42c7e2,_0x11803e[_0xdc7b('0x41')]);return _0x35680f[_0xdc7b('0x51')](_0x42c7e2);}})[_0xdc7b('0x27')](function(_0x45ee01){if(_0x45ee01){_0x38459d=_0x45ee01[_0xdc7b('0x38')];if(!_0x11803e[_0xdc7b('0x33')]['hasOwnProperty']('nolimit')){_0x42c7e2[_0xdc7b('0x1f')]=qs[_0xdc7b('0x1f')](_0x11803e['query'][_0xdc7b('0x1f')]);_0x42c7e2['offset']=qs[_0xdc7b('0x1d')](_0x11803e[_0xdc7b('0x33')][_0xdc7b('0x1d')]);}return _0x35680f[_0xdc7b('0x51')](_0x42c7e2);}})[_0xdc7b('0x27')](function(_0x4130bb){if(_0x4130bb){return _0x4130bb?{'count':_0x38459d,'rows':_0x4130bb}:null;}})[_0xdc7b('0x27')](respondWithResult(_0x2b83d1,null))[_0xdc7b('0x4b')](handleError(_0x2b83d1,null));};exports[_0xdc7b('0x52')]=function(_0x2958d8,_0x5b8574,_0x24639e){var _0x484be7={};var _0x127b48={};var _0x19dab6;var _0x1432e0;return db[_0xdc7b('0x2c')][_0xdc7b('0x4c')]({'where':{'id':_0x2958d8['params']['id']}})[_0xdc7b('0x27')](handleEntityNotFound(_0x5b8574,null))['then'](function(_0x2ddfc7){if(_0x2ddfc7){_0x19dab6=_0x2ddfc7;_0x127b48[_0xdc7b('0x30')]=_['keys'](db[_0xdc7b('0x4d')][_0xdc7b('0x2d')]);_0x127b48['query']=_[_0xdc7b('0x32')](_0x2958d8['query']);_0x127b48[_0xdc7b('0x34')]=_['intersection'](_0x127b48[_0xdc7b('0x30')],_0x127b48[_0xdc7b('0x33')]);_0x484be7[_0xdc7b('0x36')]=_[_0xdc7b('0x35')](_0x127b48['model'],qs[_0xdc7b('0x37')](_0x2958d8[_0xdc7b('0x33')][_0xdc7b('0x37')]));_0x484be7[_0xdc7b('0x36')]=_0x484be7['attributes'][_0xdc7b('0x38')]?_0x484be7[_0xdc7b('0x36')]:_0x127b48['model'];_0x484be7[_0xdc7b('0x3a')]=qs[_0xdc7b('0x3b')](_0x2958d8['query'][_0xdc7b('0x3b')]);_0x484be7[_0xdc7b('0x3d')]=qs[_0xdc7b('0x34')](_['pick'](_0x2958d8[_0xdc7b('0x33')],_0x127b48['filters']));if(_0x2958d8[_0xdc7b('0x33')]['filter']){_0x484be7['where']=_[_0xdc7b('0x3e')](_0x484be7['where'],{'$or':_['map'](_0x484be7[_0xdc7b('0x36')],function(_0x5c51d8){var _0x369d32={};_0x369d32[_0x5c51d8]={'$like':'%'+_0x2958d8[_0xdc7b('0x33')][_0xdc7b('0x4e')]+'%'};return _0x369d32;})});}_0x484be7=_[_0xdc7b('0x3e')]({},_0x484be7,_0x2958d8['options']);return _0x19dab6[_0xdc7b('0x52')](_0x484be7);}})[_0xdc7b('0x27')](function(_0x26fd23){if(_0x26fd23){_0x1432e0=_0x26fd23[_0xdc7b('0x38')];if(!_0x2958d8['query'][_0xdc7b('0x50')]('nolimit')){_0x484be7['limit']=qs['limit'](_0x2958d8[_0xdc7b('0x33')][_0xdc7b('0x1f')]);_0x484be7[_0xdc7b('0x1d')]=qs['offset'](_0x2958d8[_0xdc7b('0x33')][_0xdc7b('0x1d')]);}return _0x19dab6[_0xdc7b('0x52')](_0x484be7);}})['then'](function(_0x448e2b){if(_0x448e2b){return _0x448e2b?{'count':_0x1432e0,'rows':_0x448e2b}:null;}})[_0xdc7b('0x27')](respondWithResult(_0x5b8574,null))['catch'](handleError(_0x5b8574,null));};
\ No newline at end of file
+var _0x6feb=['findAll','rows','catch','params','includeAll','create','body','find','getFields','findOne','ServicenowField','order','pick','getSubjects','rawAttributes','getDescriptions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','ServicenowConfiguration','fieldName','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','type','VIRTUAL','filter','options','include'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0x6feb,0x158));var _0xb6fe=function(_0x1c4cec,_0x46a62b){_0x1c4cec=_0x1c4cec-0x0;var _0x2fa621=_0x6feb[_0x1c4cec];return _0x2fa621;};'use strict';var emlformat=require(_0xb6fe('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb6fe('0x1'));var rp=require(_0xb6fe('0x2'));var moment=require(_0xb6fe('0x3'));var BPromise=require(_0xb6fe('0x4'));var Mustache=require(_0xb6fe('0x5'));var util=require(_0xb6fe('0x6'));var path=require(_0xb6fe('0x7'));var sox=require(_0xb6fe('0x8'));var csv=require(_0xb6fe('0x9'));var ejs=require(_0xb6fe('0xa'));var fs=require('fs');var fs_extra=require(_0xb6fe('0xb'));var _=require(_0xb6fe('0xc'));var squel=require(_0xb6fe('0xd'));var crypto=require(_0xb6fe('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb6fe('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb6fe('0x10'));var Papa=require(_0xb6fe('0x11'));var Redis=require(_0xb6fe('0x12'));var authService=require(_0xb6fe('0x13'));var qs=require(_0xb6fe('0x14'));var as=require(_0xb6fe('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6fe('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xb6fe('0x17'));var licenseUtil=require(_0xb6fe('0x18'));var db=require(_0xb6fe('0x19'))['db'];function respondWithStatusCode(_0x13ecf5,_0x253ae0){_0x253ae0=_0x253ae0||0xcc;return function(_0x2423aa){if(_0x2423aa){return _0x13ecf5[_0xb6fe('0x1a')](_0x253ae0);}return _0x13ecf5[_0xb6fe('0x1b')](_0x253ae0)[_0xb6fe('0x1c')]();};}function respondWithResult(_0x3422b4,_0x21320a){_0x21320a=_0x21320a||0xc8;return function(_0x249665){if(_0x249665){return _0x3422b4[_0xb6fe('0x1b')](_0x21320a)['json'](_0x249665);}};}function respondWithFilteredResult(_0x28f740,_0x2eb3c4){return function(_0x4b4207){if(_0x4b4207){var _0x2e9921=typeof _0x2eb3c4['offset']===_0xb6fe('0x1d')&&typeof _0x2eb3c4[_0xb6fe('0x1e')]==='undefined';var _0x4cc9e5=_0x4b4207[_0xb6fe('0x1f')];var _0x128adb=_0x2e9921?0x0:_0x2eb3c4[_0xb6fe('0x20')];var _0x46cff8=_0x2e9921?_0x4b4207[_0xb6fe('0x1f')]:_0x2eb3c4[_0xb6fe('0x20')]+_0x2eb3c4['limit'];var _0x27bfec;if(_0x46cff8>=_0x4cc9e5){_0x46cff8=_0x4cc9e5;_0x27bfec=0xc8;}else{_0x27bfec=0xce;}_0x28f740['status'](_0x27bfec);return _0x28f740['set'](_0xb6fe('0x21'),_0x128adb+'-'+_0x46cff8+'/'+_0x4cc9e5)[_0xb6fe('0x22')](_0x4b4207);}return null;};}function patchUpdates(_0x166f60){return function(_0x24c152){try{jsonpatch[_0xb6fe('0x23')](_0x24c152,_0x166f60,!![]);}catch(_0x67ca6b){return BPromise['reject'](_0x67ca6b);}return _0x24c152[_0xb6fe('0x24')]();};}function saveUpdates(_0x3463c0,_0x15c31c){return function(_0x55818c){if(_0x55818c){return _0x55818c[_0xb6fe('0x25')](_0x3463c0)[_0xb6fe('0x26')](function(_0x189281){return _0x189281;});}return null;};}function removeEntity(_0x454557,_0x2c5d3f){return function(_0x1e38bc){if(_0x1e38bc){return _0x1e38bc[_0xb6fe('0x27')]()[_0xb6fe('0x26')](function(){_0x454557[_0xb6fe('0x1b')](0xcc)[_0xb6fe('0x1c')]();});}};}function handleEntityNotFound(_0x1ed2e7,_0xea4294){return function(_0x5c8e7e){if(!_0x5c8e7e){_0x1ed2e7[_0xb6fe('0x1a')](0x194);}return _0x5c8e7e;};}function handleError(_0x4e6726,_0x116208){_0x116208=_0x116208||0x1f4;return function(_0x233fa6){logger[_0xb6fe('0x28')](_0x233fa6[_0xb6fe('0x29')]);if(_0x233fa6[_0xb6fe('0x2a')]){delete _0x233fa6[_0xb6fe('0x2a')];}_0x4e6726[_0xb6fe('0x1b')](_0x116208)[_0xb6fe('0x2b')](_0x233fa6);};}exports[_0xb6fe('0x2c')]=function(_0x2baad4,_0x35ff0f){var _0x14c7f3={},_0x33e32d={},_0x5e0aae={'count':0x0,'rows':[]};var _0xe3951c=_[_0xb6fe('0x2d')](db[_0xb6fe('0x2e')]['rawAttributes'],function(_0x21c787){return{'name':_0x21c787[_0xb6fe('0x2f')],'type':_0x21c787['type']['key']};});_0x33e32d['model']=_['map'](_0xe3951c,'name');_0x33e32d[_0xb6fe('0x30')]=_[_0xb6fe('0x31')](_0x2baad4[_0xb6fe('0x30')]);_0x33e32d['filters']=_[_0xb6fe('0x32')](_0x33e32d[_0xb6fe('0x33')],_0x33e32d['query']);_0x14c7f3[_0xb6fe('0x34')]=_[_0xb6fe('0x32')](_0x33e32d[_0xb6fe('0x33')],qs['fields'](_0x2baad4[_0xb6fe('0x30')][_0xb6fe('0x35')]));_0x14c7f3[_0xb6fe('0x34')]=_0x14c7f3[_0xb6fe('0x34')][_0xb6fe('0x36')]?_0x14c7f3['attributes']:_0x33e32d[_0xb6fe('0x33')];if(!_0x2baad4[_0xb6fe('0x30')][_0xb6fe('0x37')](_0xb6fe('0x38'))){_0x14c7f3[_0xb6fe('0x1e')]=qs[_0xb6fe('0x1e')](_0x2baad4['query'][_0xb6fe('0x1e')]);_0x14c7f3['offset']=qs['offset'](_0x2baad4['query'][_0xb6fe('0x20')]);}_0x14c7f3['order']=qs['sort'](_0x2baad4[_0xb6fe('0x30')][_0xb6fe('0x39')]);_0x14c7f3[_0xb6fe('0x3a')]=qs['filters'](_['pick'](_0x2baad4[_0xb6fe('0x30')],_0x33e32d[_0xb6fe('0x3b')]),_0xe3951c);if(_0x2baad4[_0xb6fe('0x30')]['filter']){_0x14c7f3[_0xb6fe('0x3a')]=_[_0xb6fe('0x3c')](_0x14c7f3[_0xb6fe('0x3a')],{'$or':_[_0xb6fe('0x2d')](_0xe3951c,function(_0x467ab2){if(_0x467ab2[_0xb6fe('0x3d')]!==_0xb6fe('0x3e')){var _0x3c85f0={};_0x3c85f0[_0x467ab2[_0xb6fe('0x2a')]]={'$like':'%'+_0x2baad4[_0xb6fe('0x30')][_0xb6fe('0x3f')]+'%'};return _0x3c85f0;}})});}_0x14c7f3=_['merge']({},_0x14c7f3,_0x2baad4[_0xb6fe('0x40')]);var _0x51c239={'where':_0x14c7f3[_0xb6fe('0x3a')]};return db['ServicenowConfiguration'][_0xb6fe('0x1f')](_0x51c239)[_0xb6fe('0x26')](function(_0x457a78){_0x5e0aae[_0xb6fe('0x1f')]=_0x457a78;if(_0x2baad4[_0xb6fe('0x30')]['includeAll']){_0x14c7f3[_0xb6fe('0x41')]=[{'all':!![]}];}return db[_0xb6fe('0x2e')][_0xb6fe('0x42')](_0x14c7f3);})[_0xb6fe('0x26')](function(_0x4b1dcf){_0x5e0aae[_0xb6fe('0x43')]=_0x4b1dcf;return _0x5e0aae;})[_0xb6fe('0x26')](respondWithFilteredResult(_0x35ff0f,_0x14c7f3))[_0xb6fe('0x44')](handleError(_0x35ff0f,null));};exports['show']=function(_0x270600,_0x40b193){var _0xc75dea={'raw':![],'where':{'id':_0x270600[_0xb6fe('0x45')]['id']}},_0xb75e3f={};_0xb75e3f[_0xb6fe('0x33')]=_[_0xb6fe('0x31')](db['ServicenowConfiguration']['rawAttributes']);_0xb75e3f[_0xb6fe('0x30')]=_['keys'](_0x270600['query']);_0xb75e3f[_0xb6fe('0x3b')]=_[_0xb6fe('0x32')](_0xb75e3f['model'],_0xb75e3f[_0xb6fe('0x30')]);_0xc75dea[_0xb6fe('0x34')]=_['intersection'](_0xb75e3f[_0xb6fe('0x33')],qs[_0xb6fe('0x35')](_0x270600[_0xb6fe('0x30')][_0xb6fe('0x35')]));_0xc75dea[_0xb6fe('0x34')]=_0xc75dea[_0xb6fe('0x34')][_0xb6fe('0x36')]?_0xc75dea[_0xb6fe('0x34')]:_0xb75e3f[_0xb6fe('0x33')];if(_0x270600[_0xb6fe('0x30')][_0xb6fe('0x46')]){_0xc75dea['include']=[{'all':!![]}];}_0xc75dea=_[_0xb6fe('0x3c')]({},_0xc75dea,_0x270600[_0xb6fe('0x40')]);return db['ServicenowConfiguration']['find'](_0xc75dea)['then'](handleEntityNotFound(_0x40b193,null))['then'](respondWithResult(_0x40b193,null))['catch'](handleError(_0x40b193,null));};exports['create']=function(_0x5a5373,_0x48947c){return db['ServicenowConfiguration'][_0xb6fe('0x47')](_0x5a5373[_0xb6fe('0x48')],{})[_0xb6fe('0x26')](respondWithResult(_0x48947c,0xc9))[_0xb6fe('0x44')](handleError(_0x48947c,null));};exports[_0xb6fe('0x25')]=function(_0x375aa5,_0x3073fa){if(_0x375aa5[_0xb6fe('0x48')]['id']){delete _0x375aa5[_0xb6fe('0x48')]['id'];}return db[_0xb6fe('0x2e')][_0xb6fe('0x49')]({'where':{'id':_0x375aa5[_0xb6fe('0x45')]['id']}})[_0xb6fe('0x26')](handleEntityNotFound(_0x3073fa,null))[_0xb6fe('0x26')](saveUpdates(_0x375aa5['body'],null))[_0xb6fe('0x26')](respondWithResult(_0x3073fa,null))[_0xb6fe('0x44')](handleError(_0x3073fa,null));};exports[_0xb6fe('0x27')]=function(_0x1b5fca,_0x3227a1){return db[_0xb6fe('0x2e')]['find']({'where':{'id':_0x1b5fca['params']['id']}})['then'](handleEntityNotFound(_0x3227a1,null))[_0xb6fe('0x26')](removeEntity(_0x3227a1,null))['catch'](handleError(_0x3227a1,null));};exports[_0xb6fe('0x4a')]=function(_0x3c151c,_0x5f43f7,_0x235346){var _0x4f6861={};var _0x17dad2={};var _0x321714;var _0x343531;return db[_0xb6fe('0x2e')][_0xb6fe('0x4b')]({'where':{'id':_0x3c151c[_0xb6fe('0x45')]['id']}})[_0xb6fe('0x26')](handleEntityNotFound(_0x5f43f7,null))[_0xb6fe('0x26')](function(_0x5766d6){if(_0x5766d6){_0x321714=_0x5766d6;_0x17dad2[_0xb6fe('0x33')]=_[_0xb6fe('0x31')](db[_0xb6fe('0x4c')]['rawAttributes']);_0x17dad2[_0xb6fe('0x30')]=_[_0xb6fe('0x31')](_0x3c151c[_0xb6fe('0x30')]);_0x17dad2[_0xb6fe('0x3b')]=_[_0xb6fe('0x32')](_0x17dad2[_0xb6fe('0x33')],_0x17dad2['query']);_0x4f6861[_0xb6fe('0x34')]=_[_0xb6fe('0x32')](_0x17dad2[_0xb6fe('0x33')],qs['fields'](_0x3c151c[_0xb6fe('0x30')]['fields']));_0x4f6861[_0xb6fe('0x34')]=_0x4f6861['attributes'][_0xb6fe('0x36')]?_0x4f6861[_0xb6fe('0x34')]:_0x17dad2[_0xb6fe('0x33')];_0x4f6861[_0xb6fe('0x4d')]=qs[_0xb6fe('0x39')](_0x3c151c[_0xb6fe('0x30')][_0xb6fe('0x39')]);_0x4f6861[_0xb6fe('0x3a')]=qs[_0xb6fe('0x3b')](_[_0xb6fe('0x4e')](_0x3c151c[_0xb6fe('0x30')],_0x17dad2[_0xb6fe('0x3b')]));if(_0x3c151c[_0xb6fe('0x30')][_0xb6fe('0x3f')]){_0x4f6861['where']=_['merge'](_0x4f6861[_0xb6fe('0x3a')],{'$or':_[_0xb6fe('0x2d')](_0x4f6861[_0xb6fe('0x34')],function(_0x4a7515){var _0x535790={};_0x535790[_0x4a7515]={'$like':'%'+_0x3c151c['query']['filter']+'%'};return _0x535790;})});}_0x4f6861=_[_0xb6fe('0x3c')]({},_0x4f6861,_0x3c151c[_0xb6fe('0x40')]);return _0x321714[_0xb6fe('0x4a')](_0x4f6861);}})[_0xb6fe('0x26')](function(_0x45f4bf){if(_0x45f4bf){_0x343531=_0x45f4bf[_0xb6fe('0x36')];if(!_0x3c151c['query'][_0xb6fe('0x37')]('nolimit')){_0x4f6861[_0xb6fe('0x1e')]=qs['limit'](_0x3c151c[_0xb6fe('0x30')][_0xb6fe('0x1e')]);_0x4f6861['offset']=qs['offset'](_0x3c151c[_0xb6fe('0x30')][_0xb6fe('0x20')]);}return _0x321714[_0xb6fe('0x4a')](_0x4f6861);}})[_0xb6fe('0x26')](function(_0x22c39a){if(_0x22c39a){return _0x22c39a?{'count':_0x343531,'rows':_0x22c39a}:null;}})[_0xb6fe('0x26')](respondWithResult(_0x5f43f7,null))['catch'](handleError(_0x5f43f7,null));};exports[_0xb6fe('0x4f')]=function(_0x557a86,_0x546fd5,_0x4e4761){var _0x2a17b8={};var _0x3e439f={};var _0x340261;var _0x3cac59;return db[_0xb6fe('0x2e')][_0xb6fe('0x4b')]({'where':{'id':_0x557a86[_0xb6fe('0x45')]['id']}})[_0xb6fe('0x26')](handleEntityNotFound(_0x546fd5,null))['then'](function(_0x3b4ace){if(_0x3b4ace){_0x340261=_0x3b4ace;_0x3e439f[_0xb6fe('0x33')]=_['keys'](db['ServicenowField'][_0xb6fe('0x50')]);_0x3e439f[_0xb6fe('0x30')]=_[_0xb6fe('0x31')](_0x557a86[_0xb6fe('0x30')]);_0x3e439f[_0xb6fe('0x3b')]=_[_0xb6fe('0x32')](_0x3e439f[_0xb6fe('0x33')],_0x3e439f['query']);_0x2a17b8['attributes']=_[_0xb6fe('0x32')](_0x3e439f[_0xb6fe('0x33')],qs[_0xb6fe('0x35')](_0x557a86['query']['fields']));_0x2a17b8[_0xb6fe('0x34')]=_0x2a17b8[_0xb6fe('0x34')]['length']?_0x2a17b8[_0xb6fe('0x34')]:_0x3e439f[_0xb6fe('0x33')];_0x2a17b8[_0xb6fe('0x4d')]=qs[_0xb6fe('0x39')](_0x557a86['query']['sort']);_0x2a17b8[_0xb6fe('0x3a')]=qs['filters'](_['pick'](_0x557a86[_0xb6fe('0x30')],_0x3e439f[_0xb6fe('0x3b')]));if(_0x557a86['query'][_0xb6fe('0x3f')]){_0x2a17b8['where']=_['merge'](_0x2a17b8[_0xb6fe('0x3a')],{'$or':_[_0xb6fe('0x2d')](_0x2a17b8[_0xb6fe('0x34')],function(_0x33f36f){var _0x3c0c53={};_0x3c0c53[_0x33f36f]={'$like':'%'+_0x557a86[_0xb6fe('0x30')][_0xb6fe('0x3f')]+'%'};return _0x3c0c53;})});}_0x2a17b8=_[_0xb6fe('0x3c')]({},_0x2a17b8,_0x557a86['options']);return _0x340261[_0xb6fe('0x4f')](_0x2a17b8);}})[_0xb6fe('0x26')](function(_0xbed993){if(_0xbed993){_0x3cac59=_0xbed993[_0xb6fe('0x36')];if(!_0x557a86[_0xb6fe('0x30')]['hasOwnProperty'](_0xb6fe('0x38'))){_0x2a17b8['limit']=qs['limit'](_0x557a86['query'][_0xb6fe('0x1e')]);_0x2a17b8[_0xb6fe('0x20')]=qs[_0xb6fe('0x20')](_0x557a86[_0xb6fe('0x30')][_0xb6fe('0x20')]);}return _0x340261[_0xb6fe('0x4f')](_0x2a17b8);}})[_0xb6fe('0x26')](function(_0x2a151a){if(_0x2a151a){return _0x2a151a?{'count':_0x3cac59,'rows':_0x2a151a}:null;}})['then'](respondWithResult(_0x546fd5,null))[_0xb6fe('0x44')](handleError(_0x546fd5,null));};exports['getDescriptions']=function(_0x1465f1,_0x13b713,_0x12b97b){var _0x5f2729={};var _0x1b995b={};var _0x271bff;var _0x5a852a;return db['ServicenowConfiguration'][_0xb6fe('0x4b')]({'where':{'id':_0x1465f1[_0xb6fe('0x45')]['id']}})[_0xb6fe('0x26')](handleEntityNotFound(_0x13b713,null))['then'](function(_0xb8e944){if(_0xb8e944){_0x271bff=_0xb8e944;_0x1b995b[_0xb6fe('0x33')]=_[_0xb6fe('0x31')](db[_0xb6fe('0x4c')]['rawAttributes']);_0x1b995b['query']=_[_0xb6fe('0x31')](_0x1465f1[_0xb6fe('0x30')]);_0x1b995b['filters']=_[_0xb6fe('0x32')](_0x1b995b[_0xb6fe('0x33')],_0x1b995b['query']);_0x5f2729[_0xb6fe('0x34')]=_[_0xb6fe('0x32')](_0x1b995b['model'],qs[_0xb6fe('0x35')](_0x1465f1[_0xb6fe('0x30')][_0xb6fe('0x35')]));_0x5f2729[_0xb6fe('0x34')]=_0x5f2729[_0xb6fe('0x34')][_0xb6fe('0x36')]?_0x5f2729['attributes']:_0x1b995b[_0xb6fe('0x33')];_0x5f2729[_0xb6fe('0x4d')]=qs[_0xb6fe('0x39')](_0x1465f1[_0xb6fe('0x30')][_0xb6fe('0x39')]);_0x5f2729[_0xb6fe('0x3a')]=qs[_0xb6fe('0x3b')](_[_0xb6fe('0x4e')](_0x1465f1[_0xb6fe('0x30')],_0x1b995b[_0xb6fe('0x3b')]));if(_0x1465f1[_0xb6fe('0x30')][_0xb6fe('0x3f')]){_0x5f2729[_0xb6fe('0x3a')]=_['merge'](_0x5f2729[_0xb6fe('0x3a')],{'$or':_['map'](_0x5f2729[_0xb6fe('0x34')],function(_0x37ddd2){var _0x21ab07={};_0x21ab07[_0x37ddd2]={'$like':'%'+_0x1465f1[_0xb6fe('0x30')][_0xb6fe('0x3f')]+'%'};return _0x21ab07;})});}_0x5f2729=_[_0xb6fe('0x3c')]({},_0x5f2729,_0x1465f1['options']);return _0x271bff['getDescriptions'](_0x5f2729);}})['then'](function(_0x5bc13d){if(_0x5bc13d){_0x5a852a=_0x5bc13d[_0xb6fe('0x36')];if(!_0x1465f1[_0xb6fe('0x30')][_0xb6fe('0x37')](_0xb6fe('0x38'))){_0x5f2729['limit']=qs[_0xb6fe('0x1e')](_0x1465f1[_0xb6fe('0x30')][_0xb6fe('0x1e')]);_0x5f2729[_0xb6fe('0x20')]=qs[_0xb6fe('0x20')](_0x1465f1['query'][_0xb6fe('0x20')]);}return _0x271bff[_0xb6fe('0x51')](_0x5f2729);}})[_0xb6fe('0x26')](function(_0x58f45c){if(_0x58f45c){return _0x58f45c?{'count':_0x5a852a,'rows':_0x58f45c}:null;}})[_0xb6fe('0x26')](respondWithResult(_0x13b713,null))[_0xb6fe('0x44')](handleError(_0x13b713,null));};
\ No newline at end of file
index 7ffdc0d..9747b96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e5c=['../../config/logger','moment','bluebird','request-promise','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash'];(function(_0x3cffb3,_0x284b2d){var _0x57a846=function(_0x32a354){while(--_0x32a354){_0x3cffb3['push'](_0x3cffb3['shift']());}};_0x57a846(++_0x284b2d);}(_0x4e5c,0x149));var _0xc4e5=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x4e5c[_0x409353];return _0x4f4b59;};'use strict';var _=require(_0xc4e5('0x0'));var util=require('util');var logger=require(_0xc4e5('0x1'))('api');var moment=require(_0xc4e5('0x2'));var BPromise=require(_0xc4e5('0x3'));var rp=require(_0xc4e5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc4e5('0x5'));module[_0xc4e5('0x6')]=function(_0x3b4b2c,_0x81444b){return _0x3b4b2c[_0xc4e5('0x7')](_0xc4e5('0x8'),attributes,{'tableName':_0xc4e5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd7d1=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0xb2ea6b,_0x9b2a42){_0xb2ea6b=_0xb2ea6b-0x0;var _0x35972c=_0xd7d1[_0xb2ea6b];return _0x35972c;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var logger=require(_0x1d7d('0x2'))(_0x1d7d('0x3'));var moment=require(_0x1d7d('0x4'));var BPromise=require(_0x1d7d('0x5'));var rp=require(_0x1d7d('0x6'));var fs=require('fs');var path=require(_0x1d7d('0x7'));var rimraf=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var attributes=require(_0x1d7d('0xa'));module[_0x1d7d('0xb')]=function(_0x14b2b9,_0x5a8cf3){return _0x14b2b9[_0x1d7d('0xc')](_0x1d7d('0xd'),attributes,{'tableName':_0x1d7d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e167a9a..75f7e73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x786b=['request','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x510379,_0x466d1a){var _0x2833c2=function(_0x259b05){while(--_0x259b05){_0x510379['push'](_0x510379['shift']());}};_0x2833c2(++_0x466d1a);}(_0x786b,0x164));var _0xb786=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0x786b[_0x4e7d25];return _0x526fe6;};'use strict';var _=require(_0xb786('0x0'));var util=require(_0xb786('0x1'));var moment=require(_0xb786('0x2'));var BPromise=require(_0xb786('0x3'));var rs=require(_0xb786('0x4'));var fs=require('fs');var Redis=require(_0xb786('0x5'));var db=require(_0xb786('0x6'))['db'];var utils=require(_0xb786('0x7'));var logger=require(_0xb786('0x8'))(_0xb786('0x9'));var config=require(_0xb786('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb786('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d6464,_0x4ef7d3,_0x51f244){return new BPromise(function(_0x35901c,_0x935d4e){return client[_0xb786('0xc')](_0x5d6464,_0x51f244)['then'](function(_0x580e62){logger['info'](_0xb786('0xd'),_0x4ef7d3,_0xb786('0xe'));logger[_0xb786('0xf')](_0xb786('0x10'),_0x4ef7d3,'request\x20sent',JSON[_0xb786('0x11')](_0x580e62));if(_0x580e62[_0xb786('0x12')]){if(_0x580e62[_0xb786('0x12')][_0xb786('0x13')]===0x1f4){logger[_0xb786('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4ef7d3,_0x580e62[_0xb786('0x12')][_0xb786('0x14')]);return _0x935d4e(_0x580e62[_0xb786('0x12')][_0xb786('0x14')]);}logger[_0xb786('0x12')](_0xb786('0xd'),_0x4ef7d3,_0x580e62[_0xb786('0x12')][_0xb786('0x14')]);return _0x35901c(_0x580e62[_0xb786('0x12')][_0xb786('0x14')]);}else{logger['info'](_0xb786('0xd'),_0x4ef7d3,_0xb786('0xe'));_0x35901c(_0x580e62[_0xb786('0x15')]['message']);}})[_0xb786('0x16')](function(_0x223bed){logger[_0xb786('0x12')](_0xb786('0xd'),_0x4ef7d3,_0x223bed);_0x935d4e(_0x223bed);});});}
\ No newline at end of file
+var _0x7d2b=['ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','debug'];(function(_0xe779b0,_0x1196b3){var _0x2e0a29=function(_0x32591f){while(--_0x32591f){_0xe779b0['push'](_0xe779b0['shift']());}};_0x2e0a29(++_0x1196b3);}(_0x7d2b,0x1aa));var _0xb7d2=function(_0x117700,_0x2eb42e){_0x117700=_0x117700-0x0;var _0x22f28f=_0x7d2b[_0x117700];return _0x22f28f;};'use strict';var _=require(_0xb7d2('0x0'));var util=require(_0xb7d2('0x1'));var moment=require(_0xb7d2('0x2'));var BPromise=require(_0xb7d2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb7d2('0x4'))['db'];var utils=require(_0xb7d2('0x5'));var logger=require('../../config/logger')(_0xb7d2('0x6'));var config=require(_0xb7d2('0x7'));var jayson=require(_0xb7d2('0x8'));var client=jayson[_0xb7d2('0x9')][_0xb7d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17ef67,_0x4d9c6a,_0x39e7bf){return new BPromise(function(_0x5b3e67,_0x3862c5){return client['request'](_0x17ef67,_0x39e7bf)[_0xb7d2('0xb')](function(_0x327c33){logger[_0xb7d2('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4d9c6a,'request\x20sent');logger[_0xb7d2('0xd')](_0xb7d2('0xe'),_0x4d9c6a,_0xb7d2('0xf'),JSON[_0xb7d2('0x10')](_0x327c33));if(_0x327c33[_0xb7d2('0x11')]){if(_0x327c33[_0xb7d2('0x11')][_0xb7d2('0x12')]===0x1f4){logger[_0xb7d2('0x11')](_0xb7d2('0x13'),_0x4d9c6a,_0x327c33[_0xb7d2('0x11')]['message']);return _0x3862c5(_0x327c33[_0xb7d2('0x11')]['message']);}logger[_0xb7d2('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4d9c6a,_0x327c33[_0xb7d2('0x11')]['message']);return _0x5b3e67(_0x327c33['error'][_0xb7d2('0x14')]);}else{logger['info'](_0xb7d2('0x13'),_0x4d9c6a,_0xb7d2('0xf'));_0x5b3e67(_0x327c33['result'][_0xb7d2('0x14')]);}})[_0xb7d2('0x15')](function(_0xb3e1b7){logger[_0xb7d2('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4d9c6a,_0xb3e1b7);_0x3862c5(_0xb3e1b7);});});}
\ No newline at end of file
index a00ae43..29a3729 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x938f=['fs-extra','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','create','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x938f,0x1c2));var _0xf938=function(_0x243cca,_0x514c2d){_0x243cca=_0x243cca-0x0;var _0xf94771=_0x938f[_0x243cca];return _0xf94771;};'use strict';var multer=require(_0xf938('0x0'));var util=require(_0xf938('0x1'));var path=require(_0xf938('0x2'));var timeout=require(_0xf938('0x3'));var express=require(_0xf938('0x4'));var router=express[_0xf938('0x5')]();var fs_extra=require(_0xf938('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf938('0x7'));var config=require(_0xf938('0x8'));var controller=require(_0xf938('0x9'));router[_0xf938('0xa')]('/',auth[_0xf938('0xb')](),controller[_0xf938('0xc')]);router[_0xf938('0xa')](_0xf938('0xd'),auth[_0xf938('0xb')](),controller[_0xf938('0xe')]);router['post']('/',auth[_0xf938('0xb')](),controller[_0xf938('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf938('0x10')]);router[_0xf938('0x11')](_0xf938('0xd'),auth[_0xf938('0xb')](),controller['destroy']);module[_0xf938('0x12')]=router;
\ No newline at end of file
+var _0x8572=['destroy','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete'];(function(_0x2596af,_0x41be65){var _0x15e806=function(_0x333a47){while(--_0x333a47){_0x2596af['push'](_0x2596af['shift']());}};_0x15e806(++_0x41be65);}(_0x8572,0x1b1));var _0x2857=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x8572[_0x2df507];return _0x1f7167;};'use strict';var multer=require('multer');var util=require(_0x2857('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2857('0x1')]();var fs_extra=require(_0x2857('0x2'));var auth=require(_0x2857('0x3'));var interaction=require(_0x2857('0x4'));var config=require(_0x2857('0x5'));var controller=require('./intServicenowField.controller');router[_0x2857('0x6')]('/',auth[_0x2857('0x7')](),controller['index']);router['get'](_0x2857('0x8'),auth[_0x2857('0x7')](),controller[_0x2857('0x9')]);router[_0x2857('0xa')]('/',auth[_0x2857('0x7')](),controller[_0x2857('0xb')]);router[_0x2857('0xc')](_0x2857('0x8'),auth['isAuthenticated'](),controller[_0x2857('0xd')]);router[_0x2857('0xe')]('/:id',auth[_0x2857('0x7')](),controller[_0x2857('0xf')]);module['exports']=router;
\ No newline at end of file
index a3e9a9f..7cefba2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d4e=['exports','string','variable','customVariable','picklist','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x0d4e,0x116));var _0xe0d4=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x0d4e[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xe0d4('0x0'));module[_0xe0d4('0x1')]={'type':{'type':Sequelize['ENUM'](_0xe0d4('0x2'),_0xe0d4('0x3'),_0xe0d4('0x4'),'keyValue',_0xe0d4('0x5')),'defaultValue':_0xe0d4('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xe0d4('0x6')]},'keyType':{'type':Sequelize[_0xe0d4('0x7')](_0xe0d4('0x2'),_0xe0d4('0x3'),_0xe0d4('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe0d4('0x6')]},'nameField':{'type':Sequelize[_0xe0d4('0x6')]},'customField':{'type':Sequelize[_0xe0d4('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe0d4('0x6')]}};
\ No newline at end of file
+var _0xb7ec=['variable','keyValue','picklist','STRING','ENUM','customVariable','BOOLEAN','string'];(function(_0x18524e,_0x3cc3c5){var _0x590fcd=function(_0x4a4ec2){while(--_0x4a4ec2){_0x18524e['push'](_0x18524e['shift']());}};_0x590fcd(++_0x3cc3c5);}(_0xb7ec,0x13f));var _0xcb7e=function(_0x11f598,_0x5a2990){_0x11f598=_0x11f598-0x0;var _0x2a37dc=_0xb7ec[_0x11f598];return _0x2a37dc;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0xcb7e('0x0'),_0xcb7e('0x1'),'customVariable',_0xcb7e('0x2'),_0xcb7e('0x3')),'defaultValue':_0xcb7e('0x0')},'content':{'type':Sequelize[_0xcb7e('0x4')]},'key':{'type':Sequelize[_0xcb7e('0x4')]},'keyType':{'type':Sequelize[_0xcb7e('0x5')]('string',_0xcb7e('0x1'),_0xcb7e('0x6'))},'keyContent':{'type':Sequelize[_0xcb7e('0x4')]},'idField':{'type':Sequelize[_0xcb7e('0x4')]},'nameField':{'type':Sequelize[_0xcb7e('0x4')]},'customField':{'type':Sequelize[_0xcb7e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xcb7e('0x4')]}};
\ No newline at end of file
index a50e3eb..406e172 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13bc=['api','../../config/environment','status','json','offset','limit','count','set','Content-Range','apply','save','update','then','destroy','name','send','index','map','rawAttributes','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ServicenowField','includeAll','include','rows','catch','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x3a909d,_0x5630f8){var _0x25e95a=function(_0x3743a4){while(--_0x3743a4){_0x3a909d['push'](_0x3a909d['shift']());}};_0x25e95a(++_0x5630f8);}(_0x13bc,0xba));var _0xc13b=function(_0x2efded,_0x17b4b6){_0x2efded=_0x2efded-0x0;var _0x55c8c6=_0x13bc[_0x2efded];return _0x55c8c6;};'use strict';var emlformat=require(_0xc13b('0x0'));var rimraf=require(_0xc13b('0x1'));var zipdir=require(_0xc13b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc13b('0x3'));var moment=require('moment');var BPromise=require(_0xc13b('0x4'));var Mustache=require(_0xc13b('0x5'));var util=require(_0xc13b('0x6'));var path=require(_0xc13b('0x7'));var sox=require(_0xc13b('0x8'));var csv=require('to-csv');var ejs=require(_0xc13b('0x9'));var fs=require('fs');var fs_extra=require(_0xc13b('0xa'));var _=require(_0xc13b('0xb'));var squel=require(_0xc13b('0xc'));var crypto=require(_0xc13b('0xd'));var jsforce=require(_0xc13b('0xe'));var deskjs=require(_0xc13b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc13b('0x10'));var authService=require(_0xc13b('0x11'));var qs=require(_0xc13b('0x12'));var as=require(_0xc13b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc13b('0x14'))(_0xc13b('0x15'));var utils=require('../../config/utils');var config=require(_0xc13b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c0aa8,_0x3c216e){_0x3c216e=_0x3c216e||0xcc;return function(_0x244e98){if(_0x244e98){return _0x5c0aa8['sendStatus'](_0x3c216e);}return _0x5c0aa8[_0xc13b('0x17')](_0x3c216e)['end']();};}function respondWithResult(_0x2a2145,_0x2d4faf){_0x2d4faf=_0x2d4faf||0xc8;return function(_0x44d3f8){if(_0x44d3f8){return _0x2a2145[_0xc13b('0x17')](_0x2d4faf)[_0xc13b('0x18')](_0x44d3f8);}};}function respondWithFilteredResult(_0x376ba0,_0x1006ce){return function(_0x11cb34){if(_0x11cb34){var _0x242b13=typeof _0x1006ce[_0xc13b('0x19')]==='undefined'&&typeof _0x1006ce[_0xc13b('0x1a')]==='undefined';var _0x3e5a8f=_0x11cb34[_0xc13b('0x1b')];var _0x34812d=_0x242b13?0x0:_0x1006ce[_0xc13b('0x19')];var _0x416357=_0x242b13?_0x11cb34[_0xc13b('0x1b')]:_0x1006ce[_0xc13b('0x19')]+_0x1006ce['limit'];var _0xa36ca7;if(_0x416357>=_0x3e5a8f){_0x416357=_0x3e5a8f;_0xa36ca7=0xc8;}else{_0xa36ca7=0xce;}_0x376ba0['status'](_0xa36ca7);return _0x376ba0[_0xc13b('0x1c')](_0xc13b('0x1d'),_0x34812d+'-'+_0x416357+'/'+_0x3e5a8f)['json'](_0x11cb34);}return null;};}function patchUpdates(_0x5f352d){return function(_0x414895){try{jsonpatch[_0xc13b('0x1e')](_0x414895,_0x5f352d,!![]);}catch(_0xd6fa2c){return BPromise['reject'](_0xd6fa2c);}return _0x414895[_0xc13b('0x1f')]();};}function saveUpdates(_0x10dd58,_0x42b801){return function(_0x1590cd){if(_0x1590cd){return _0x1590cd[_0xc13b('0x20')](_0x10dd58)[_0xc13b('0x21')](function(_0x3fe02d){return _0x3fe02d;});}return null;};}function removeEntity(_0x4c37e5,_0x379ab1){return function(_0x4de392){if(_0x4de392){return _0x4de392[_0xc13b('0x22')]()[_0xc13b('0x21')](function(){_0x4c37e5[_0xc13b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x140f71,_0x3370b1){return function(_0x51c112){if(!_0x51c112){_0x140f71['sendStatus'](0x194);}return _0x51c112;};}function handleError(_0x5ce400,_0x4c2436){_0x4c2436=_0x4c2436||0x1f4;return function(_0x15baf0){logger['error'](_0x15baf0['stack']);if(_0x15baf0[_0xc13b('0x23')]){delete _0x15baf0[_0xc13b('0x23')];}_0x5ce400[_0xc13b('0x17')](_0x4c2436)[_0xc13b('0x24')](_0x15baf0);};}exports[_0xc13b('0x25')]=function(_0x2bcc6d,_0x939d33){var _0x5f24d0={},_0x31f0e9={},_0x1eff0a={'count':0x0,'rows':[]};var _0x268812=_[_0xc13b('0x26')](db['ServicenowField'][_0xc13b('0x27')],function(_0x394be9){return{'name':_0x394be9['fieldName'],'type':_0x394be9[_0xc13b('0x28')][_0xc13b('0x29')]};});_0x31f0e9[_0xc13b('0x2a')]=_[_0xc13b('0x26')](_0x268812,'name');_0x31f0e9['query']=_[_0xc13b('0x2b')](_0x2bcc6d['query']);_0x31f0e9[_0xc13b('0x2c')]=_[_0xc13b('0x2d')](_0x31f0e9[_0xc13b('0x2a')],_0x31f0e9[_0xc13b('0x2e')]);_0x5f24d0['attributes']=_[_0xc13b('0x2d')](_0x31f0e9['model'],qs['fields'](_0x2bcc6d[_0xc13b('0x2e')][_0xc13b('0x2f')]));_0x5f24d0['attributes']=_0x5f24d0[_0xc13b('0x30')][_0xc13b('0x31')]?_0x5f24d0['attributes']:_0x31f0e9['model'];if(!_0x2bcc6d[_0xc13b('0x2e')][_0xc13b('0x32')](_0xc13b('0x33'))){_0x5f24d0[_0xc13b('0x1a')]=qs[_0xc13b('0x1a')](_0x2bcc6d[_0xc13b('0x2e')][_0xc13b('0x1a')]);_0x5f24d0[_0xc13b('0x19')]=qs['offset'](_0x2bcc6d[_0xc13b('0x2e')][_0xc13b('0x19')]);}_0x5f24d0[_0xc13b('0x34')]=qs[_0xc13b('0x35')](_0x2bcc6d[_0xc13b('0x2e')][_0xc13b('0x35')]);_0x5f24d0[_0xc13b('0x36')]=qs['filters'](_[_0xc13b('0x37')](_0x2bcc6d[_0xc13b('0x2e')],_0x31f0e9['filters']),_0x268812);if(_0x2bcc6d[_0xc13b('0x2e')][_0xc13b('0x38')]){_0x5f24d0[_0xc13b('0x36')]=_[_0xc13b('0x39')](_0x5f24d0[_0xc13b('0x36')],{'$or':_[_0xc13b('0x26')](_0x268812,function(_0x5efed3){if(_0x5efed3[_0xc13b('0x28')]!==_0xc13b('0x3a')){var _0x225dfa={};_0x225dfa[_0x5efed3[_0xc13b('0x23')]]={'$like':'%'+_0x2bcc6d['query']['filter']+'%'};return _0x225dfa;}})});}_0x5f24d0=_[_0xc13b('0x39')]({},_0x5f24d0,_0x2bcc6d[_0xc13b('0x3b')]);var _0x310401={'where':_0x5f24d0[_0xc13b('0x36')]};return db[_0xc13b('0x3c')][_0xc13b('0x1b')](_0x310401)[_0xc13b('0x21')](function(_0x392691){_0x1eff0a[_0xc13b('0x1b')]=_0x392691;if(_0x2bcc6d[_0xc13b('0x2e')][_0xc13b('0x3d')]){_0x5f24d0[_0xc13b('0x3e')]=[{'all':!![]}];}return db[_0xc13b('0x3c')]['findAll'](_0x5f24d0);})['then'](function(_0x1098cb){_0x1eff0a[_0xc13b('0x3f')]=_0x1098cb;return _0x1eff0a;})[_0xc13b('0x21')](respondWithFilteredResult(_0x939d33,_0x5f24d0))[_0xc13b('0x40')](handleError(_0x939d33,null));};exports['show']=function(_0x3d64ad,_0x48cd30){var _0x504622={'raw':!![],'where':{'id':_0x3d64ad['params']['id']}},_0x88213b={};_0x88213b[_0xc13b('0x2a')]=_['keys'](db[_0xc13b('0x3c')][_0xc13b('0x27')]);_0x88213b[_0xc13b('0x2e')]=_['keys'](_0x3d64ad[_0xc13b('0x2e')]);_0x88213b[_0xc13b('0x2c')]=_[_0xc13b('0x2d')](_0x88213b[_0xc13b('0x2a')],_0x88213b['query']);_0x504622[_0xc13b('0x30')]=_[_0xc13b('0x2d')](_0x88213b['model'],qs[_0xc13b('0x2f')](_0x3d64ad[_0xc13b('0x2e')][_0xc13b('0x2f')]));_0x504622[_0xc13b('0x30')]=_0x504622[_0xc13b('0x30')][_0xc13b('0x31')]?_0x504622[_0xc13b('0x30')]:_0x88213b[_0xc13b('0x2a')];if(_0x3d64ad[_0xc13b('0x2e')][_0xc13b('0x3d')]){_0x504622[_0xc13b('0x3e')]=[{'all':!![]}];}_0x504622=_[_0xc13b('0x39')]({},_0x504622,_0x3d64ad[_0xc13b('0x3b')]);return db['ServicenowField'][_0xc13b('0x41')](_0x504622)[_0xc13b('0x21')](handleEntityNotFound(_0x48cd30,null))['then'](respondWithResult(_0x48cd30,null))['catch'](handleError(_0x48cd30,null));};exports[_0xc13b('0x42')]=function(_0x340f83,_0x4d6515){return db['ServicenowField']['create'](_0x340f83[_0xc13b('0x43')],{})['then'](respondWithResult(_0x4d6515,0xc9))['catch'](handleError(_0x4d6515,null));};exports['update']=function(_0x359605,_0x380a5c){if(_0x359605['body']['id']){delete _0x359605[_0xc13b('0x43')]['id'];}return db[_0xc13b('0x3c')][_0xc13b('0x41')]({'where':{'id':_0x359605[_0xc13b('0x44')]['id']}})[_0xc13b('0x21')](handleEntityNotFound(_0x380a5c,null))[_0xc13b('0x21')](saveUpdates(_0x359605[_0xc13b('0x43')],null))[_0xc13b('0x21')](respondWithResult(_0x380a5c,null))[_0xc13b('0x40')](handleError(_0x380a5c,null));};exports[_0xc13b('0x22')]=function(_0x2eb642,_0x52eda5){return db[_0xc13b('0x3c')][_0xc13b('0x41')]({'where':{'id':_0x2eb642[_0xc13b('0x44')]['id']}})[_0xc13b('0x21')](handleEntityNotFound(_0x52eda5,null))[_0xc13b('0x21')](removeEntity(_0x52eda5,null))[_0xc13b('0x40')](handleError(_0x52eda5,null));};
\ No newline at end of file
+var _0x74f6=['order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','rawAttributes','intersection','length','options','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ServicenowField','fieldName','key','model','query','keys','filters','fields','attributes'];(function(_0x3e5a64,_0x59ff65){var _0x4d05ab=function(_0x418ac4){while(--_0x418ac4){_0x3e5a64['push'](_0x3e5a64['shift']());}};_0x4d05ab(++_0x59ff65);}(_0x74f6,0x135));var _0x674f=function(_0x5d8e26,_0x211fe7){_0x5d8e26=_0x5d8e26-0x0;var _0x46bbf0=_0x74f6[_0x5d8e26];return _0x46bbf0;};'use strict';var emlformat=require(_0x674f('0x0'));var rimraf=require(_0x674f('0x1'));var zipdir=require(_0x674f('0x2'));var jsonpatch=require(_0x674f('0x3'));var rp=require(_0x674f('0x4'));var moment=require(_0x674f('0x5'));var BPromise=require(_0x674f('0x6'));var Mustache=require(_0x674f('0x7'));var util=require(_0x674f('0x8'));var path=require(_0x674f('0x9'));var sox=require('sox');var csv=require(_0x674f('0xa'));var ejs=require(_0x674f('0xb'));var fs=require('fs');var fs_extra=require(_0x674f('0xc'));var _=require(_0x674f('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x674f('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x674f('0xf'));var Redis=require(_0x674f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x674f('0x11'));var as=require(_0x674f('0x12'));var hardwareService=require(_0x674f('0x13'));var logger=require(_0x674f('0x14'))('api');var utils=require(_0x674f('0x15'));var config=require(_0x674f('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bedbd,_0x18f787){_0x18f787=_0x18f787||0xcc;return function(_0x481c57){if(_0x481c57){return _0x5bedbd['sendStatus'](_0x18f787);}return _0x5bedbd[_0x674f('0x17')](_0x18f787)[_0x674f('0x18')]();};}function respondWithResult(_0x195ee6,_0x3ac69d){_0x3ac69d=_0x3ac69d||0xc8;return function(_0xb9dce7){if(_0xb9dce7){return _0x195ee6[_0x674f('0x17')](_0x3ac69d)[_0x674f('0x19')](_0xb9dce7);}};}function respondWithFilteredResult(_0x3b15f1,_0x4d5cb3){return function(_0x32ebc8){if(_0x32ebc8){var _0x52da83=typeof _0x4d5cb3['offset']===_0x674f('0x1a')&&typeof _0x4d5cb3[_0x674f('0x1b')]==='undefined';var _0x53ed4f=_0x32ebc8[_0x674f('0x1c')];var _0x227bc1=_0x52da83?0x0:_0x4d5cb3['offset'];var _0x47f4da=_0x52da83?_0x32ebc8[_0x674f('0x1c')]:_0x4d5cb3[_0x674f('0x1d')]+_0x4d5cb3[_0x674f('0x1b')];var _0x4fcba8;if(_0x47f4da>=_0x53ed4f){_0x47f4da=_0x53ed4f;_0x4fcba8=0xc8;}else{_0x4fcba8=0xce;}_0x3b15f1[_0x674f('0x17')](_0x4fcba8);return _0x3b15f1[_0x674f('0x1e')](_0x674f('0x1f'),_0x227bc1+'-'+_0x47f4da+'/'+_0x53ed4f)[_0x674f('0x19')](_0x32ebc8);}return null;};}function patchUpdates(_0x2fa952){return function(_0x4bc158){try{jsonpatch[_0x674f('0x20')](_0x4bc158,_0x2fa952,!![]);}catch(_0x568b8d){return BPromise['reject'](_0x568b8d);}return _0x4bc158[_0x674f('0x21')]();};}function saveUpdates(_0x57ee01,_0x1a0470){return function(_0x198ed7){if(_0x198ed7){return _0x198ed7[_0x674f('0x22')](_0x57ee01)[_0x674f('0x23')](function(_0x1dd551){return _0x1dd551;});}return null;};}function removeEntity(_0x368e7f,_0x23700c){return function(_0x1e7544){if(_0x1e7544){return _0x1e7544[_0x674f('0x24')]()['then'](function(){_0x368e7f[_0x674f('0x17')](0xcc)[_0x674f('0x18')]();});}};}function handleEntityNotFound(_0x2b4a0c,_0x46dba5){return function(_0x51ced3){if(!_0x51ced3){_0x2b4a0c['sendStatus'](0x194);}return _0x51ced3;};}function handleError(_0x88ce61,_0x1ba996){_0x1ba996=_0x1ba996||0x1f4;return function(_0x3a5711){logger['error'](_0x3a5711[_0x674f('0x25')]);if(_0x3a5711[_0x674f('0x26')]){delete _0x3a5711['name'];}_0x88ce61[_0x674f('0x17')](_0x1ba996)[_0x674f('0x27')](_0x3a5711);};}exports[_0x674f('0x28')]=function(_0xd9cf74,_0x324960){var _0xb4cc95={},_0x56ca40={},_0x165a24={'count':0x0,'rows':[]};var _0x80a0d7=_[_0x674f('0x29')](db[_0x674f('0x2a')]['rawAttributes'],function(_0x413710){return{'name':_0x413710[_0x674f('0x2b')],'type':_0x413710['type'][_0x674f('0x2c')]};});_0x56ca40[_0x674f('0x2d')]=_[_0x674f('0x29')](_0x80a0d7,'name');_0x56ca40[_0x674f('0x2e')]=_[_0x674f('0x2f')](_0xd9cf74[_0x674f('0x2e')]);_0x56ca40[_0x674f('0x30')]=_['intersection'](_0x56ca40[_0x674f('0x2d')],_0x56ca40[_0x674f('0x2e')]);_0xb4cc95['attributes']=_['intersection'](_0x56ca40[_0x674f('0x2d')],qs[_0x674f('0x31')](_0xd9cf74[_0x674f('0x2e')][_0x674f('0x31')]));_0xb4cc95[_0x674f('0x32')]=_0xb4cc95['attributes']['length']?_0xb4cc95[_0x674f('0x32')]:_0x56ca40[_0x674f('0x2d')];if(!_0xd9cf74['query']['hasOwnProperty']('nolimit')){_0xb4cc95['limit']=qs[_0x674f('0x1b')](_0xd9cf74[_0x674f('0x2e')][_0x674f('0x1b')]);_0xb4cc95[_0x674f('0x1d')]=qs[_0x674f('0x1d')](_0xd9cf74[_0x674f('0x2e')]['offset']);}_0xb4cc95[_0x674f('0x33')]=qs[_0x674f('0x34')](_0xd9cf74[_0x674f('0x2e')][_0x674f('0x34')]);_0xb4cc95[_0x674f('0x35')]=qs[_0x674f('0x30')](_[_0x674f('0x36')](_0xd9cf74['query'],_0x56ca40['filters']),_0x80a0d7);if(_0xd9cf74[_0x674f('0x2e')][_0x674f('0x37')]){_0xb4cc95['where']=_[_0x674f('0x38')](_0xb4cc95[_0x674f('0x35')],{'$or':_['map'](_0x80a0d7,function(_0x4f0363){if(_0x4f0363[_0x674f('0x39')]!==_0x674f('0x3a')){var _0x4ee025={};_0x4ee025[_0x4f0363['name']]={'$like':'%'+_0xd9cf74[_0x674f('0x2e')]['filter']+'%'};return _0x4ee025;}})});}_0xb4cc95=_[_0x674f('0x38')]({},_0xb4cc95,_0xd9cf74['options']);var _0x2d0bbd={'where':_0xb4cc95['where']};return db['ServicenowField'][_0x674f('0x1c')](_0x2d0bbd)[_0x674f('0x23')](function(_0x3437e1){_0x165a24[_0x674f('0x1c')]=_0x3437e1;if(_0xd9cf74[_0x674f('0x2e')][_0x674f('0x3b')]){_0xb4cc95[_0x674f('0x3c')]=[{'all':!![]}];}return db['ServicenowField'][_0x674f('0x3d')](_0xb4cc95);})['then'](function(_0x1ccf25){_0x165a24[_0x674f('0x3e')]=_0x1ccf25;return _0x165a24;})[_0x674f('0x23')](respondWithFilteredResult(_0x324960,_0xb4cc95))[_0x674f('0x3f')](handleError(_0x324960,null));};exports['show']=function(_0x4084fb,_0x5b150f){var _0xeba34f={'raw':!![],'where':{'id':_0x4084fb['params']['id']}},_0x4fa1dc={};_0x4fa1dc[_0x674f('0x2d')]=_[_0x674f('0x2f')](db['ServicenowField'][_0x674f('0x40')]);_0x4fa1dc['query']=_[_0x674f('0x2f')](_0x4084fb[_0x674f('0x2e')]);_0x4fa1dc[_0x674f('0x30')]=_[_0x674f('0x41')](_0x4fa1dc[_0x674f('0x2d')],_0x4fa1dc[_0x674f('0x2e')]);_0xeba34f[_0x674f('0x32')]=_[_0x674f('0x41')](_0x4fa1dc[_0x674f('0x2d')],qs[_0x674f('0x31')](_0x4084fb['query'][_0x674f('0x31')]));_0xeba34f[_0x674f('0x32')]=_0xeba34f['attributes'][_0x674f('0x42')]?_0xeba34f['attributes']:_0x4fa1dc[_0x674f('0x2d')];if(_0x4084fb[_0x674f('0x2e')][_0x674f('0x3b')]){_0xeba34f[_0x674f('0x3c')]=[{'all':!![]}];}_0xeba34f=_[_0x674f('0x38')]({},_0xeba34f,_0x4084fb[_0x674f('0x43')]);return db[_0x674f('0x2a')]['find'](_0xeba34f)[_0x674f('0x23')](handleEntityNotFound(_0x5b150f,null))[_0x674f('0x23')](respondWithResult(_0x5b150f,null))[_0x674f('0x3f')](handleError(_0x5b150f,null));};exports[_0x674f('0x44')]=function(_0x34817a,_0x539e9d){return db['ServicenowField'][_0x674f('0x44')](_0x34817a[_0x674f('0x45')],{})[_0x674f('0x23')](respondWithResult(_0x539e9d,0xc9))[_0x674f('0x3f')](handleError(_0x539e9d,null));};exports['update']=function(_0x3ba7bb,_0x5f2526){if(_0x3ba7bb[_0x674f('0x45')]['id']){delete _0x3ba7bb[_0x674f('0x45')]['id'];}return db['ServicenowField'][_0x674f('0x46')]({'where':{'id':_0x3ba7bb[_0x674f('0x47')]['id']}})[_0x674f('0x23')](handleEntityNotFound(_0x5f2526,null))[_0x674f('0x23')](saveUpdates(_0x3ba7bb[_0x674f('0x45')],null))[_0x674f('0x23')](respondWithResult(_0x5f2526,null))[_0x674f('0x3f')](handleError(_0x5f2526,null));};exports[_0x674f('0x24')]=function(_0x1c6746,_0x48c466){return db[_0x674f('0x2a')]['find']({'where':{'id':_0x1c6746['params']['id']}})[_0x674f('0x23')](handleEntityNotFound(_0x48c466,null))[_0x674f('0x23')](removeEntity(_0x48c466,null))['catch'](handleError(_0x48c466,null));};
\ No newline at end of file
index fed974b..f625b16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30ef=['moment','request-promise','path','rimraf','exports','define','int_servicenow_fields','servicenow_unique_index','FieldId','lodash','util','../../config/logger'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0x30ef,0x129));var _0xf30e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x30ef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf30e('0x0'));var util=require(_0xf30e('0x1'));var logger=require(_0xf30e('0x2'))('api');var moment=require(_0xf30e('0x3'));var BPromise=require('bluebird');var rp=require(_0xf30e('0x4'));var fs=require('fs');var path=require(_0xf30e('0x5'));var rimraf=require(_0xf30e('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0xf30e('0x7')]=function(_0x4419fd,_0x2e97c3){return _0x4419fd[_0xf30e('0x8')]('ServicenowField',attributes,{'tableName':_0xf30e('0x9'),'paranoid':![],'indexes':[{'name':_0xf30e('0xa'),'fields':['idField',_0xf30e('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xec8b=['path','rimraf','../../config/environment','./intServicenowField.attributes','exports','FieldId','lodash','util','../../config/logger','api','request-promise'];(function(_0x22727f,_0x31453e){var _0x16d8a4=function(_0x4778da){while(--_0x4778da){_0x22727f['push'](_0x22727f['shift']());}};_0x16d8a4(++_0x31453e);}(_0xec8b,0xc1));var _0xbec8=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xec8b[_0x5783f4];return _0x28e380;};'use strict';var _=require(_0xbec8('0x0'));var util=require(_0xbec8('0x1'));var logger=require(_0xbec8('0x2'))(_0xbec8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbec8('0x4'));var fs=require('fs');var path=require(_0xbec8('0x5'));var rimraf=require(_0xbec8('0x6'));var config=require(_0xbec8('0x7'));var attributes=require(_0xbec8('0x8'));module[_0xbec8('0x9')]=function(_0x2666e9,_0x4f584c){return _0x2666e9['define']('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':['idField',_0xbec8('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index cd0c596..2b4f39f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3f=['rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x55c1f0,_0x4f574f){var _0x1530fa=function(_0x631542){while(--_0x631542){_0x55c1f0['push'](_0x55c1f0['shift']());}};_0x1530fa(++_0x4f574f);}(_0xda3f,0xec));var _0xfda3=function(_0x5efbdf,_0x36021b){_0x5efbdf=_0x5efbdf-0x0;var _0x140d84=_0xda3f[_0x5efbdf];return _0x140d84;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});}
\ No newline at end of file
+var _0xbdb7=['request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','ServicenowField,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x483102,_0x54e93d){_0x483102=_0x483102-0x0;var _0x5cc885=_0xbdb7[_0x483102];return _0x5cc885;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});}
\ No newline at end of file
index bbef4bf..bafa211 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x112e77,_0x58f917){var _0x2f6382=function(_0x20ed4c){while(--_0x20ed4c){_0x112e77['push'](_0x112e77['shift']());}};_0x2f6382(++_0x58f917);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x6ce650,_0x53cc09){var _0x4eed4c=function(_0x1e0133){while(--_0x1e0133){_0x6ce650['push'](_0x6ce650['shift']());}};_0x4eed4c(++_0x53cc09);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
index 26caa3e..143b5ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x111e0a,_0x4a09cc){var _0x3282db=function(_0x4851bd){while(--_0x4851bd){_0x111e0a['push'](_0x111e0a['shift']());}};_0x3282db(++_0x4a09cc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x16c476,_0x136730){var _0x49db61=function(_0x3b3119){while(--_0x3b3119){_0x16c476['push'](_0x16c476['shift']());}};_0x49db61(++_0x136730);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}};
\ No newline at end of file
index 4a8f9e1..9333b59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe21b=['username','password','remoteUri','substring','POST','%s%s','/service/v4_1/rest.php','login','JSON','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','get_module_fields','stringify','Calls','values','module_fields','remove','includes','label','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','offset','limit','undefined','count','set','apply','reject','update','destroy','then','sendStatus','error','name','send','index','SugarcrmAccount','rawAttributes','key','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','order','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','create','body','getConfigurations','sort','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','findOne'];(function(_0x361257,_0x51900d){var _0x166c1f=function(_0x1d9b76){while(--_0x1d9b76){_0x361257['push'](_0x361257['shift']());}};_0x166c1f(++_0x51900d);}(_0xe21b,0x93));var _0xbe21=function(_0x378169,_0x51201f){_0x378169=_0x378169-0x0;var _0x278274=_0xe21b[_0x378169];return _0x278274;};'use strict';var emlformat=require(_0xbe21('0x0'));var rimraf=require(_0xbe21('0x1'));var zipdir=require(_0xbe21('0x2'));var jsonpatch=require(_0xbe21('0x3'));var rp=require(_0xbe21('0x4'));var moment=require('moment');var BPromise=require(_0xbe21('0x5'));var Mustache=require(_0xbe21('0x6'));var util=require(_0xbe21('0x7'));var path=require('path');var sox=require(_0xbe21('0x8'));var csv=require(_0xbe21('0x9'));var ejs=require(_0xbe21('0xa'));var fs=require('fs');var fs_extra=require(_0xbe21('0xb'));var _=require('lodash');var squel=require(_0xbe21('0xc'));var crypto=require(_0xbe21('0xd'));var jsforce=require(_0xbe21('0xe'));var deskjs=require(_0xbe21('0xf'));var toCsv=require(_0xbe21('0x9'));var querystring=require(_0xbe21('0x10'));var Papa=require(_0xbe21('0x11'));var Redis=require(_0xbe21('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbe21('0x13'));var as=require(_0xbe21('0x14'));var hardwareService=require(_0xbe21('0x15'));var logger=require(_0xbe21('0x16'))(_0xbe21('0x17'));var utils=require(_0xbe21('0x18'));var config=require(_0xbe21('0x19'));var licenseUtil=require(_0xbe21('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbe21('0x1b'));function respondWithStatusCode(_0x190894,_0x226968){_0x226968=_0x226968||0xcc;return function(_0x4b9470){if(_0x4b9470){return _0x190894['sendStatus'](_0x226968);}return _0x190894[_0xbe21('0x1c')](_0x226968)[_0xbe21('0x1d')]();};}function respondWithResult(_0x9c5ae0,_0x173780){_0x173780=_0x173780||0xc8;return function(_0x419f1e){if(_0x419f1e){return _0x9c5ae0['status'](_0x173780)['json'](_0x419f1e);}};}function respondWithFilteredResult(_0x5b0202,_0x1740ba){return function(_0x4c7f8b){if(_0x4c7f8b){var _0x4ff0aa=typeof _0x1740ba[_0xbe21('0x1e')]==='undefined'&&typeof _0x1740ba[_0xbe21('0x1f')]===_0xbe21('0x20');var _0x26ae62=_0x4c7f8b['count'];var _0x29d0ec=_0x4ff0aa?0x0:_0x1740ba[_0xbe21('0x1e')];var _0xe94225=_0x4ff0aa?_0x4c7f8b[_0xbe21('0x21')]:_0x1740ba[_0xbe21('0x1e')]+_0x1740ba[_0xbe21('0x1f')];var _0x18d702;if(_0xe94225>=_0x26ae62){_0xe94225=_0x26ae62;_0x18d702=0xc8;}else{_0x18d702=0xce;}_0x5b0202[_0xbe21('0x1c')](_0x18d702);return _0x5b0202[_0xbe21('0x22')]('Content-Range',_0x29d0ec+'-'+_0xe94225+'/'+_0x26ae62)['json'](_0x4c7f8b);}return null;};}function patchUpdates(_0x1b8611){return function(_0x56d661){try{jsonpatch[_0xbe21('0x23')](_0x56d661,_0x1b8611,!![]);}catch(_0x4d2e44){return BPromise[_0xbe21('0x24')](_0x4d2e44);}return _0x56d661['save']();};}function saveUpdates(_0x118698,_0x1a6ca2){return function(_0x52c510){if(_0x52c510){return _0x52c510[_0xbe21('0x25')](_0x118698)['then'](function(_0x1973f9){return _0x1973f9;});}return null;};}function removeEntity(_0x5a8d4d,_0x538cfc){return function(_0x4e2aa9){if(_0x4e2aa9){return _0x4e2aa9[_0xbe21('0x26')]()[_0xbe21('0x27')](function(){_0x5a8d4d['status'](0xcc)[_0xbe21('0x1d')]();});}};}function handleEntityNotFound(_0x3218a3,_0xb0312e){return function(_0x34afdf){if(!_0x34afdf){_0x3218a3[_0xbe21('0x28')](0x194);}return _0x34afdf;};}function handleError(_0x1742da,_0xc37b3c){_0xc37b3c=_0xc37b3c||0x1f4;return function(_0x34511b){logger[_0xbe21('0x29')](_0x34511b['stack']);if(_0x34511b[_0xbe21('0x2a')]){delete _0x34511b[_0xbe21('0x2a')];}_0x1742da['status'](_0xc37b3c)[_0xbe21('0x2b')](_0x34511b);};}exports[_0xbe21('0x2c')]=function(_0x477ab2,_0x22db59){var _0x448b66={},_0x11e52d={},_0x43f7a8={'count':0x0,'rows':[]};var _0x237f78=_['map'](db[_0xbe21('0x2d')][_0xbe21('0x2e')],function(_0x2a5036){return{'name':_0x2a5036['fieldName'],'type':_0x2a5036['type'][_0xbe21('0x2f')]};});_0x11e52d[_0xbe21('0x30')]=_[_0xbe21('0x31')](_0x237f78,_0xbe21('0x2a'));_0x11e52d[_0xbe21('0x32')]=_[_0xbe21('0x33')](_0x477ab2[_0xbe21('0x32')]);_0x11e52d['filters']=_['intersection'](_0x11e52d['model'],_0x11e52d['query']);_0x448b66[_0xbe21('0x34')]=_[_0xbe21('0x35')](_0x11e52d[_0xbe21('0x30')],qs[_0xbe21('0x36')](_0x477ab2[_0xbe21('0x32')]['fields']));_0x448b66[_0xbe21('0x34')]=_0x448b66[_0xbe21('0x34')]['length']?_0x448b66[_0xbe21('0x34')]:_0x11e52d['model'];if(!_0x477ab2['query'][_0xbe21('0x37')]('nolimit')){_0x448b66[_0xbe21('0x1f')]=qs[_0xbe21('0x1f')](_0x477ab2[_0xbe21('0x32')]['limit']);_0x448b66[_0xbe21('0x1e')]=qs['offset'](_0x477ab2[_0xbe21('0x32')][_0xbe21('0x1e')]);}_0x448b66[_0xbe21('0x38')]=qs['sort'](_0x477ab2[_0xbe21('0x32')]['sort']);_0x448b66['where']=qs[_0xbe21('0x39')](_[_0xbe21('0x3a')](_0x477ab2[_0xbe21('0x32')],_0x11e52d[_0xbe21('0x39')]),_0x237f78);if(_0x477ab2['query'][_0xbe21('0x3b')]){_0x448b66[_0xbe21('0x3c')]=_[_0xbe21('0x3d')](_0x448b66[_0xbe21('0x3c')],{'$or':_['map'](_0x237f78,function(_0x2cb718){if(_0x2cb718[_0xbe21('0x3e')]!==_0xbe21('0x3f')){var _0x106f9f={};_0x106f9f[_0x2cb718[_0xbe21('0x2a')]]={'$like':'%'+_0x477ab2[_0xbe21('0x32')]['filter']+'%'};return _0x106f9f;}})});}_0x448b66=_[_0xbe21('0x3d')]({},_0x448b66,_0x477ab2[_0xbe21('0x40')]);var _0x189edf={'where':_0x448b66[_0xbe21('0x3c')]};return db[_0xbe21('0x2d')][_0xbe21('0x21')](_0x189edf)[_0xbe21('0x27')](function(_0x1ad450){_0x43f7a8['count']=_0x1ad450;if(_0x477ab2[_0xbe21('0x32')][_0xbe21('0x41')]){_0x448b66[_0xbe21('0x42')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xbe21('0x43')](_0x448b66);})[_0xbe21('0x27')](function(_0x5249b8){_0x43f7a8['rows']=_0x5249b8;return _0x43f7a8;})[_0xbe21('0x27')](respondWithFilteredResult(_0x22db59,_0x448b66))[_0xbe21('0x44')](handleError(_0x22db59,null));};exports[_0xbe21('0x45')]=function(_0x58bff9,_0x1de831){var _0x50db99={'raw':![],'where':{'id':_0x58bff9[_0xbe21('0x46')]['id']}},_0xa65ffe={};_0xa65ffe[_0xbe21('0x30')]=_[_0xbe21('0x33')](db[_0xbe21('0x2d')][_0xbe21('0x2e')]);_0xa65ffe[_0xbe21('0x32')]=_[_0xbe21('0x33')](_0x58bff9[_0xbe21('0x32')]);_0xa65ffe[_0xbe21('0x39')]=_['intersection'](_0xa65ffe[_0xbe21('0x30')],_0xa65ffe[_0xbe21('0x32')]);_0x50db99['attributes']=_[_0xbe21('0x35')](_0xa65ffe[_0xbe21('0x30')],qs[_0xbe21('0x36')](_0x58bff9[_0xbe21('0x32')][_0xbe21('0x36')]));_0x50db99['attributes']=_0x50db99[_0xbe21('0x34')][_0xbe21('0x47')]?_0x50db99['attributes']:_0xa65ffe[_0xbe21('0x30')];if(_0x58bff9[_0xbe21('0x32')][_0xbe21('0x41')]){_0x50db99[_0xbe21('0x42')]=[{'all':!![]}];}_0x50db99=_['merge']({},_0x50db99,_0x58bff9[_0xbe21('0x40')]);return db[_0xbe21('0x2d')][_0xbe21('0x48')](_0x50db99)[_0xbe21('0x27')](handleEntityNotFound(_0x1de831,null))[_0xbe21('0x27')](respondWithResult(_0x1de831,null))[_0xbe21('0x44')](handleError(_0x1de831,null));};exports[_0xbe21('0x49')]=function(_0x3e854b,_0xe1a46f){return db[_0xbe21('0x2d')]['create'](_0x3e854b[_0xbe21('0x4a')],{})[_0xbe21('0x27')](respondWithResult(_0xe1a46f,0xc9))[_0xbe21('0x44')](handleError(_0xe1a46f,null));};exports['update']=function(_0x366635,_0x5e5f92){if(_0x366635[_0xbe21('0x4a')]['id']){delete _0x366635[_0xbe21('0x4a')]['id'];}return db[_0xbe21('0x2d')]['find']({'where':{'id':_0x366635[_0xbe21('0x46')]['id']}})['then'](handleEntityNotFound(_0x5e5f92,null))['then'](saveUpdates(_0x366635['body'],null))[_0xbe21('0x27')](respondWithResult(_0x5e5f92,null))[_0xbe21('0x44')](handleError(_0x5e5f92,null));};exports['destroy']=function(_0xf6f559,_0x43013e){return db[_0xbe21('0x2d')][_0xbe21('0x48')]({'where':{'id':_0xf6f559[_0xbe21('0x46')]['id']}})[_0xbe21('0x27')](handleEntityNotFound(_0x43013e,null))[_0xbe21('0x27')](removeEntity(_0x43013e,null))[_0xbe21('0x44')](handleError(_0x43013e,null));};exports[_0xbe21('0x4b')]=function(_0x42f822,_0x5a61b2,_0x40f8cf){var _0x4cec1e={};var _0x1035a2={};var _0x5def34;var _0x13b60c;return db[_0xbe21('0x2d')]['findOne']({'where':{'id':_0x42f822[_0xbe21('0x46')]['id']}})['then'](handleEntityNotFound(_0x5a61b2,null))['then'](function(_0x2b12a9){if(_0x2b12a9){_0x5def34=_0x2b12a9;_0x1035a2[_0xbe21('0x30')]=_[_0xbe21('0x33')](db['SugarcrmConfiguration'][_0xbe21('0x2e')]);_0x1035a2['query']=_[_0xbe21('0x33')](_0x42f822[_0xbe21('0x32')]);_0x1035a2[_0xbe21('0x39')]=_['intersection'](_0x1035a2[_0xbe21('0x30')],_0x1035a2[_0xbe21('0x32')]);_0x4cec1e[_0xbe21('0x34')]=_[_0xbe21('0x35')](_0x1035a2[_0xbe21('0x30')],qs[_0xbe21('0x36')](_0x42f822[_0xbe21('0x32')][_0xbe21('0x36')]));_0x4cec1e[_0xbe21('0x34')]=_0x4cec1e[_0xbe21('0x34')][_0xbe21('0x47')]?_0x4cec1e[_0xbe21('0x34')]:_0x1035a2[_0xbe21('0x30')];_0x4cec1e[_0xbe21('0x38')]=qs[_0xbe21('0x4c')](_0x42f822[_0xbe21('0x32')][_0xbe21('0x4c')]);_0x4cec1e[_0xbe21('0x3c')]=qs[_0xbe21('0x39')](_[_0xbe21('0x3a')](_0x42f822['query'],_0x1035a2['filters']));if(_0x42f822['query'][_0xbe21('0x3b')]){_0x4cec1e[_0xbe21('0x3c')]=_['merge'](_0x4cec1e[_0xbe21('0x3c')],{'$or':_[_0xbe21('0x31')](_0x4cec1e[_0xbe21('0x34')],function(_0x5c30e1){var _0x3930b4={};_0x3930b4[_0x5c30e1]={'$like':'%'+_0x42f822[_0xbe21('0x32')][_0xbe21('0x3b')]+'%'};return _0x3930b4;})});}_0x4cec1e=_[_0xbe21('0x3d')]({},_0x4cec1e,_0x42f822[_0xbe21('0x40')]);return _0x5def34['getConfigurations'](_0x4cec1e);}})[_0xbe21('0x27')](function(_0x5907e2){if(_0x5907e2){_0x13b60c=_0x5907e2[_0xbe21('0x47')];if(!_0x42f822[_0xbe21('0x32')]['hasOwnProperty']('nolimit')){_0x4cec1e[_0xbe21('0x1f')]=qs[_0xbe21('0x1f')](_0x42f822[_0xbe21('0x32')][_0xbe21('0x1f')]);_0x4cec1e['offset']=qs[_0xbe21('0x1e')](_0x42f822[_0xbe21('0x32')]['offset']);}return _0x5def34[_0xbe21('0x4b')](_0x4cec1e);}})['then'](function(_0x23f8f4){if(_0x23f8f4){return _0x23f8f4?{'count':_0x13b60c,'rows':_0x23f8f4}:null;}})[_0xbe21('0x27')](respondWithResult(_0x5a61b2,null))[_0xbe21('0x44')](handleError(_0x5a61b2,null));};exports[_0xbe21('0x4d')]=function(_0x447a2d,_0x86049a,_0x5719eb){if(_0x447a2d[_0xbe21('0x4a')]['id']){delete _0x447a2d[_0xbe21('0x4a')]['id'];}return db[_0xbe21('0x2d')]['findOne']({'where':{'id':_0x447a2d['params']['id']}})['then'](handleEntityNotFound(_0x86049a,null))['then'](function(_0x8e70c8){if(_0x8e70c8){_0x447a2d[_0xbe21('0x4a')][_0xbe21('0x4e')]=_0x8e70c8['id'];_0x447a2d[_0xbe21('0x4a')][_0xbe21('0x4f')]=integrations[_0xbe21('0x50')](_0x447a2d[_0xbe21('0x4a')][_0xbe21('0x51')],_0x447a2d['body'][_0xbe21('0x3e')]);_0x447a2d[_0xbe21('0x4a')][_0xbe21('0x52')]=integrations[_0xbe21('0x53')](_0x447a2d[_0xbe21('0x4a')][_0xbe21('0x51')],_0x447a2d[_0xbe21('0x4a')][_0xbe21('0x3e')]);return db['SugarcrmConfiguration'][_0xbe21('0x49')](_0x447a2d[_0xbe21('0x4a')],{'include':[{'model':db[_0xbe21('0x54')],'as':_0xbe21('0x4f')},{'model':db[_0xbe21('0x54')],'as':_0xbe21('0x52')}]});}return null;})['then'](respondWithResult(_0x86049a,null))['catch'](handleError(_0x86049a,null));};exports[_0xbe21('0x55')]=function(_0x2dcdc7,_0x4c4101,_0x396bd6){var _0x41455d='';var _0x26158d=['id',_0xbe21('0x2a'),_0xbe21('0x56'),'created_by','description',_0xbe21('0x57'),_0xbe21('0x58'),_0xbe21('0x59'),_0xbe21('0x5a'),_0xbe21('0x5b'),_0xbe21('0x5c'),_0xbe21('0x5d')];return db[_0xbe21('0x2d')][_0xbe21('0x5e')]({'where':{'id':_0x2dcdc7['params']['id']},'attributes':['id',_0xbe21('0x5f'),_0xbe21('0x60'),_0xbe21('0x61')]})['then'](handleEntityNotFound(_0x4c4101,null))['then'](function(_0x2c56cf){if(_0x2c56cf){_0x41455d=_0x2c56cf[_0xbe21('0x61')];var _0xea6459=_0x41455d['slice'](-0x1);if(_0xea6459==='/'){_0x41455d=_0x41455d[_0xbe21('0x62')](0x0,_0x41455d['lastIndexOf'](_0xea6459));}return rp({'method':_0xbe21('0x63'),'uri':util['format'](_0xbe21('0x64'),_0x41455d,_0xbe21('0x65')),'json':!![],'form':{'method':_0xbe21('0x66'),'input_type':_0xbe21('0x67'),'response_type':_0xbe21('0x67'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2c56cf[_0xbe21('0x5f')],'password':_0x2c56cf['password'],'encryption':'PLAIN'},'application':_0xbe21('0x68')})}});}})[_0xbe21('0x27')](function(_0x2ea090){if(_0x2ea090&&_0x2ea090[_0xbe21('0x2a')]!==_0xbe21('0x69')&&_0x2ea090[_0xbe21('0x2a')]!==_0xbe21('0x6a')){return rp({'method':_0xbe21('0x63'),'uri':util[_0xbe21('0x6b')]('%s%s',_0x41455d,_0xbe21('0x65')),'json':!![],'form':{'method':_0xbe21('0x6c'),'input_type':_0xbe21('0x67'),'response_type':_0xbe21('0x67'),'rest_data':JSON[_0xbe21('0x6d')]({'session':_0x2ea090['id'],'module_name':_0xbe21('0x6e')})}})['then'](function(_0x596a8b){if(_0x596a8b){var _0x4c1b7d=_[_0xbe21('0x6f')](_0x596a8b[_0xbe21('0x70')]);_[_0xbe21('0x71')](_0x4c1b7d,function(_0x1fbc3b){return _0x26158d[_0xbe21('0x72')](_0x1fbc3b[_0xbe21('0x2a')]);});return{'count':_0x4c1b7d['length'],'rows':_[_0xbe21('0x31')](_0x4c1b7d,function(_0x5c647c){return{'id':_0x5c647c[_0xbe21('0x2a')],'name':_0x5c647c[_0xbe21('0x73')],'custom':_[_0xbe21('0x74')](_0x5c647c[_0xbe21('0x2a')],'_c')?!![]:![],'options':_0x5c647c[_0xbe21('0x40')]?_[_0xbe21('0x31')](_[_0xbe21('0x6f')](_0x5c647c[_0xbe21('0x40')]),function(_0x3c4be1){return{'name':_0x3c4be1[_0xbe21('0x75')],'value':_0x3c4be1['name']};}):[]};})};}})['then'](respondWithResult(_0x4c4101,null))[_0xbe21('0x44')](function(_0x254900){var _0x1b6249=_0x2dcdc7['query'][_0xbe21('0x76')]?0x1f4:_0x254900['statusCode']||0x1f4;logger[_0xbe21('0x29')](_0xbe21('0x77'),'getFields',_0x1b6249,JSON['stringify'](_0x254900));delete _0x254900['name'];if(_0x1b6249===0x191){_0x1b6249=0x190;}_0x4c4101[_0xbe21('0x1c')](_0x1b6249)['send'](_0x2dcdc7[_0xbe21('0x32')][_0xbe21('0x76')]?{'message':_0xbe21('0x78'),'statusCode':_0x254900['statusCode']}:_0x254900);});}else{var _0x269bf5=0x1f4;_0x4c4101[_0xbe21('0x1c')](_0x269bf5)[_0xbe21('0x2b')]({'message':'Wrong\x20credentials','statusCode':0x190});}});};
\ No newline at end of file
+var _0x01e0=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','send','index','map','SugarcrmAccount','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','getConfigurations','rawAttributes','addConfiguration','findOne','Subjects','getSubjects','channel','getDescriptions','SugarcrmConfiguration','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','sox'];(function(_0x1b7679,_0x1b4d16){var _0x53e1d1=function(_0x30f435){while(--_0x30f435){_0x1b7679['push'](_0x1b7679['shift']());}};_0x53e1d1(++_0x1b4d16);}(_0x01e0,0x72));var _0x001e=function(_0x599be2,_0x452992){_0x599be2=_0x599be2-0x0;var _0x9a9f96=_0x01e0[_0x599be2];return _0x9a9f96;};'use strict';var emlformat=require(_0x001e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x001e('0x1'));var jsonpatch=require(_0x001e('0x2'));var rp=require('request-promise');var moment=require(_0x001e('0x3'));var BPromise=require(_0x001e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x001e('0x5'));var csv=require('to-csv');var ejs=require(_0x001e('0x6'));var fs=require('fs');var fs_extra=require(_0x001e('0x7'));var _=require(_0x001e('0x8'));var squel=require(_0x001e('0x9'));var crypto=require(_0x001e('0xa'));var jsforce=require(_0x001e('0xb'));var deskjs=require(_0x001e('0xc'));var toCsv=require(_0x001e('0xd'));var querystring=require('querystring');var Papa=require(_0x001e('0xe'));var Redis=require('ioredis');var authService=require(_0x001e('0xf'));var qs=require(_0x001e('0x10'));var as=require(_0x001e('0x11'));var hardwareService=require(_0x001e('0x12'));var logger=require(_0x001e('0x13'))('api');var utils=require(_0x001e('0x14'));var config=require(_0x001e('0x15'));var licenseUtil=require(_0x001e('0x16'));var db=require(_0x001e('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x55c4ac,_0x5a4b05){_0x5a4b05=_0x5a4b05||0xcc;return function(_0x241f5e){if(_0x241f5e){return _0x55c4ac['sendStatus'](_0x5a4b05);}return _0x55c4ac[_0x001e('0x18')](_0x5a4b05)[_0x001e('0x19')]();};}function respondWithResult(_0xe17d43,_0x130ae0){_0x130ae0=_0x130ae0||0xc8;return function(_0x1a5758){if(_0x1a5758){return _0xe17d43[_0x001e('0x18')](_0x130ae0)['json'](_0x1a5758);}};}function respondWithFilteredResult(_0x2c2fde,_0x8fe3ff){return function(_0x401987){if(_0x401987){var _0x23f4d6=typeof _0x8fe3ff[_0x001e('0x1a')]===_0x001e('0x1b')&&typeof _0x8fe3ff['limit']===_0x001e('0x1b');var _0x8019ff=_0x401987[_0x001e('0x1c')];var _0x390a9e=_0x23f4d6?0x0:_0x8fe3ff['offset'];var _0x3809b3=_0x23f4d6?_0x401987[_0x001e('0x1c')]:_0x8fe3ff[_0x001e('0x1a')]+_0x8fe3ff['limit'];var _0x1f0d1c;if(_0x3809b3>=_0x8019ff){_0x3809b3=_0x8019ff;_0x1f0d1c=0xc8;}else{_0x1f0d1c=0xce;}_0x2c2fde[_0x001e('0x18')](_0x1f0d1c);return _0x2c2fde[_0x001e('0x1d')](_0x001e('0x1e'),_0x390a9e+'-'+_0x3809b3+'/'+_0x8019ff)[_0x001e('0x1f')](_0x401987);}return null;};}function patchUpdates(_0x52d622){return function(_0x3ff529){try{jsonpatch[_0x001e('0x20')](_0x3ff529,_0x52d622,!![]);}catch(_0x5297b3){return BPromise[_0x001e('0x21')](_0x5297b3);}return _0x3ff529[_0x001e('0x22')]();};}function saveUpdates(_0x9e6ff5,_0x22f81d){return function(_0x28f4d4){if(_0x28f4d4){return _0x28f4d4[_0x001e('0x23')](_0x9e6ff5)['then'](function(_0x12788a){return _0x12788a;});}return null;};}function removeEntity(_0x4a63c1,_0x45bd08){return function(_0x50262a){if(_0x50262a){return _0x50262a[_0x001e('0x24')]()[_0x001e('0x25')](function(){_0x4a63c1[_0x001e('0x18')](0xcc)[_0x001e('0x19')]();});}};}function handleEntityNotFound(_0x3191cd,_0x56eeb0){return function(_0xf45549){if(!_0xf45549){_0x3191cd['sendStatus'](0x194);}return _0xf45549;};}function handleError(_0x31d9fa,_0x20c6be){_0x20c6be=_0x20c6be||0x1f4;return function(_0x1e825b){logger['error'](_0x1e825b[_0x001e('0x26')]);if(_0x1e825b['name']){delete _0x1e825b['name'];}_0x31d9fa['status'](_0x20c6be)[_0x001e('0x27')](_0x1e825b);};}exports[_0x001e('0x28')]=function(_0x4ea620,_0x2bc9db){var _0x113651={},_0x1b5156={},_0xe9cf16={'count':0x0,'rows':[]};var _0x4681f9=_[_0x001e('0x29')](db[_0x001e('0x2a')]['rawAttributes'],function(_0x1098b4){return{'name':_0x1098b4[_0x001e('0x2b')],'type':_0x1098b4[_0x001e('0x2c')][_0x001e('0x2d')]};});_0x1b5156[_0x001e('0x2e')]=_[_0x001e('0x29')](_0x4681f9,_0x001e('0x2f'));_0x1b5156[_0x001e('0x30')]=_[_0x001e('0x31')](_0x4ea620[_0x001e('0x30')]);_0x1b5156[_0x001e('0x32')]=_[_0x001e('0x33')](_0x1b5156[_0x001e('0x2e')],_0x1b5156[_0x001e('0x30')]);_0x113651[_0x001e('0x34')]=_['intersection'](_0x1b5156[_0x001e('0x2e')],qs[_0x001e('0x35')](_0x4ea620[_0x001e('0x30')]['fields']));_0x113651[_0x001e('0x34')]=_0x113651[_0x001e('0x34')][_0x001e('0x36')]?_0x113651[_0x001e('0x34')]:_0x1b5156['model'];if(!_0x4ea620[_0x001e('0x30')][_0x001e('0x37')](_0x001e('0x38'))){_0x113651[_0x001e('0x39')]=qs[_0x001e('0x39')](_0x4ea620['query'][_0x001e('0x39')]);_0x113651['offset']=qs['offset'](_0x4ea620[_0x001e('0x30')]['offset']);}_0x113651['order']=qs[_0x001e('0x3a')](_0x4ea620[_0x001e('0x30')][_0x001e('0x3a')]);_0x113651[_0x001e('0x3b')]=qs[_0x001e('0x32')](_[_0x001e('0x3c')](_0x4ea620[_0x001e('0x30')],_0x1b5156[_0x001e('0x32')]),_0x4681f9);if(_0x4ea620[_0x001e('0x30')][_0x001e('0x3d')]){_0x113651[_0x001e('0x3b')]=_['merge'](_0x113651[_0x001e('0x3b')],{'$or':_[_0x001e('0x29')](_0x4681f9,function(_0x2cf65b){if(_0x2cf65b[_0x001e('0x2c')]!=='VIRTUAL'){var _0x514996={};_0x514996[_0x2cf65b[_0x001e('0x2f')]]={'$like':'%'+_0x4ea620[_0x001e('0x30')]['filter']+'%'};return _0x514996;}})});}_0x113651=_[_0x001e('0x3e')]({},_0x113651,_0x4ea620[_0x001e('0x3f')]);var _0x110beb={'where':_0x113651[_0x001e('0x3b')]};return db['SugarcrmAccount'][_0x001e('0x1c')](_0x110beb)[_0x001e('0x25')](function(_0x13209a){_0xe9cf16[_0x001e('0x1c')]=_0x13209a;if(_0x4ea620[_0x001e('0x30')][_0x001e('0x40')]){_0x113651[_0x001e('0x41')]=[{'all':!![]}];}return db[_0x001e('0x2a')][_0x001e('0x42')](_0x113651);})[_0x001e('0x25')](function(_0x17a56e){_0xe9cf16[_0x001e('0x43')]=_0x17a56e;return _0xe9cf16;})['then'](respondWithFilteredResult(_0x2bc9db,_0x113651))[_0x001e('0x44')](handleError(_0x2bc9db,null));};exports['show']=function(_0x28483b,_0x52e017){var _0x3b0583={'raw':![],'where':{'id':_0x28483b[_0x001e('0x45')]['id']}},_0xb16af9={};_0xb16af9['model']=_['keys'](db['SugarcrmAccount']['rawAttributes']);_0xb16af9[_0x001e('0x30')]=_['keys'](_0x28483b['query']);_0xb16af9['filters']=_['intersection'](_0xb16af9['model'],_0xb16af9[_0x001e('0x30')]);_0x3b0583[_0x001e('0x34')]=_['intersection'](_0xb16af9[_0x001e('0x2e')],qs['fields'](_0x28483b[_0x001e('0x30')][_0x001e('0x35')]));_0x3b0583['attributes']=_0x3b0583[_0x001e('0x34')][_0x001e('0x36')]?_0x3b0583[_0x001e('0x34')]:_0xb16af9[_0x001e('0x2e')];if(_0x28483b['query']['includeAll']){_0x3b0583[_0x001e('0x41')]=[{'all':!![]}];}_0x3b0583=_[_0x001e('0x3e')]({},_0x3b0583,_0x28483b[_0x001e('0x3f')]);return db['SugarcrmAccount'][_0x001e('0x46')](_0x3b0583)[_0x001e('0x25')](handleEntityNotFound(_0x52e017,null))['then'](respondWithResult(_0x52e017,null))[_0x001e('0x44')](handleError(_0x52e017,null));};exports[_0x001e('0x47')]=function(_0x17fa1e,_0x4525ad){return db[_0x001e('0x2a')][_0x001e('0x47')](_0x17fa1e[_0x001e('0x48')],{})[_0x001e('0x25')](respondWithResult(_0x4525ad,0xc9))[_0x001e('0x44')](handleError(_0x4525ad,null));};exports['update']=function(_0x2c27ae,_0xe8fbf3){if(_0x2c27ae[_0x001e('0x48')]['id']){delete _0x2c27ae[_0x001e('0x48')]['id'];}return db[_0x001e('0x2a')]['find']({'where':{'id':_0x2c27ae[_0x001e('0x45')]['id']}})[_0x001e('0x25')](handleEntityNotFound(_0xe8fbf3,null))[_0x001e('0x25')](saveUpdates(_0x2c27ae[_0x001e('0x48')],null))[_0x001e('0x25')](respondWithResult(_0xe8fbf3,null))[_0x001e('0x44')](handleError(_0xe8fbf3,null));};exports[_0x001e('0x24')]=function(_0x5415d6,_0x2f5b81){return db[_0x001e('0x2a')][_0x001e('0x46')]({'where':{'id':_0x5415d6[_0x001e('0x45')]['id']}})[_0x001e('0x25')](handleEntityNotFound(_0x2f5b81,null))['then'](removeEntity(_0x2f5b81,null))[_0x001e('0x44')](handleError(_0x2f5b81,null));};exports[_0x001e('0x49')]=function(_0x553f28,_0x182918,_0x3d2766){var _0x3c740c={};var _0x2bbacd={};var _0x277fe9;var _0x2074d0;return db[_0x001e('0x2a')]['findOne']({'where':{'id':_0x553f28['params']['id']}})['then'](handleEntityNotFound(_0x182918,null))[_0x001e('0x25')](function(_0x3a0633){if(_0x3a0633){_0x277fe9=_0x3a0633;_0x2bbacd[_0x001e('0x2e')]=_[_0x001e('0x31')](db['SugarcrmConfiguration'][_0x001e('0x4a')]);_0x2bbacd[_0x001e('0x30')]=_[_0x001e('0x31')](_0x553f28[_0x001e('0x30')]);_0x2bbacd['filters']=_[_0x001e('0x33')](_0x2bbacd[_0x001e('0x2e')],_0x2bbacd[_0x001e('0x30')]);_0x3c740c[_0x001e('0x34')]=_[_0x001e('0x33')](_0x2bbacd[_0x001e('0x2e')],qs[_0x001e('0x35')](_0x553f28['query'][_0x001e('0x35')]));_0x3c740c[_0x001e('0x34')]=_0x3c740c['attributes'][_0x001e('0x36')]?_0x3c740c['attributes']:_0x2bbacd['model'];_0x3c740c['order']=qs[_0x001e('0x3a')](_0x553f28[_0x001e('0x30')][_0x001e('0x3a')]);_0x3c740c[_0x001e('0x3b')]=qs[_0x001e('0x32')](_[_0x001e('0x3c')](_0x553f28[_0x001e('0x30')],_0x2bbacd['filters']));if(_0x553f28[_0x001e('0x30')]['filter']){_0x3c740c[_0x001e('0x3b')]=_['merge'](_0x3c740c[_0x001e('0x3b')],{'$or':_[_0x001e('0x29')](_0x3c740c[_0x001e('0x34')],function(_0x32526e){var _0x486a8c={};_0x486a8c[_0x32526e]={'$like':'%'+_0x553f28[_0x001e('0x30')][_0x001e('0x3d')]+'%'};return _0x486a8c;})});}_0x3c740c=_['merge']({},_0x3c740c,_0x553f28[_0x001e('0x3f')]);return _0x277fe9[_0x001e('0x49')](_0x3c740c);}})[_0x001e('0x25')](function(_0x398c2f){if(_0x398c2f){_0x2074d0=_0x398c2f[_0x001e('0x36')];if(!_0x553f28[_0x001e('0x30')][_0x001e('0x37')]('nolimit')){_0x3c740c[_0x001e('0x39')]=qs['limit'](_0x553f28['query'][_0x001e('0x39')]);_0x3c740c[_0x001e('0x1a')]=qs[_0x001e('0x1a')](_0x553f28['query'][_0x001e('0x1a')]);}return _0x277fe9[_0x001e('0x49')](_0x3c740c);}})['then'](function(_0x23d92c){if(_0x23d92c){return _0x23d92c?{'count':_0x2074d0,'rows':_0x23d92c}:null;}})[_0x001e('0x25')](respondWithResult(_0x182918,null))[_0x001e('0x44')](handleError(_0x182918,null));};exports[_0x001e('0x4b')]=function(_0xd885a7,_0x7b1cdb,_0x7a4daa){if(_0xd885a7[_0x001e('0x48')]['id']){delete _0xd885a7['body']['id'];}return db[_0x001e('0x2a')][_0x001e('0x4c')]({'where':{'id':_0xd885a7[_0x001e('0x45')]['id']}})[_0x001e('0x25')](handleEntityNotFound(_0x7b1cdb,null))[_0x001e('0x25')](function(_0x2c1fab){if(_0x2c1fab){_0xd885a7[_0x001e('0x48')]['AccountId']=_0x2c1fab['id'];_0xd885a7[_0x001e('0x48')][_0x001e('0x4d')]=integrations[_0x001e('0x4e')](_0xd885a7[_0x001e('0x48')][_0x001e('0x4f')],_0xd885a7[_0x001e('0x48')][_0x001e('0x2c')]);_0xd885a7[_0x001e('0x48')]['Descriptions']=integrations[_0x001e('0x50')](_0xd885a7[_0x001e('0x48')][_0x001e('0x4f')],_0xd885a7[_0x001e('0x48')][_0x001e('0x2c')]);return db[_0x001e('0x51')][_0x001e('0x47')](_0xd885a7[_0x001e('0x48')],{'include':[{'model':db[_0x001e('0x52')],'as':'Subjects'},{'model':db[_0x001e('0x52')],'as':_0x001e('0x53')}]});}return null;})[_0x001e('0x25')](respondWithResult(_0x7b1cdb,null))[_0x001e('0x44')](handleError(_0x7b1cdb,null));};exports[_0x001e('0x54')]=function(_0x12ffe7,_0x527105,_0x56be5d){var _0x4c2c25='';var _0x128f04=['id',_0x001e('0x2f'),_0x001e('0x55'),_0x001e('0x56'),_0x001e('0x57'),_0x001e('0x58'),_0x001e('0x59'),_0x001e('0x5a'),_0x001e('0x5b'),_0x001e('0x5c'),_0x001e('0x5d'),_0x001e('0x5e')];return db[_0x001e('0x2a')]['findOne']({'where':{'id':_0x12ffe7['params']['id']},'attributes':['id',_0x001e('0x5f'),_0x001e('0x60'),_0x001e('0x61')]})[_0x001e('0x25')](handleEntityNotFound(_0x527105,null))[_0x001e('0x25')](function(_0x553632){if(_0x553632){_0x4c2c25=_0x553632[_0x001e('0x61')];var _0x2983d0=_0x4c2c25[_0x001e('0x62')](-0x1);if(_0x2983d0==='/'){_0x4c2c25=_0x4c2c25[_0x001e('0x63')](0x0,_0x4c2c25[_0x001e('0x64')](_0x2983d0));}return rp({'method':_0x001e('0x65'),'uri':util[_0x001e('0x66')](_0x001e('0x67'),_0x4c2c25,_0x001e('0x68')),'json':!![],'form':{'method':'login','input_type':_0x001e('0x69'),'response_type':'JSON','rest_data':JSON[_0x001e('0x6a')]({'user_auth':{'user_name':_0x553632[_0x001e('0x5f')],'password':_0x553632['password'],'encryption':_0x001e('0x6b')},'application':_0x001e('0x6c')})}});}})['then'](function(_0x19de53){if(_0x19de53&&_0x19de53['name']!=='Invalid\x20Login'&&_0x19de53['name']!=='Password\x20Expired'){return rp({'method':_0x001e('0x65'),'uri':util[_0x001e('0x66')](_0x001e('0x67'),_0x4c2c25,_0x001e('0x68')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x001e('0x69'),'response_type':'JSON','rest_data':JSON[_0x001e('0x6a')]({'session':_0x19de53['id'],'module_name':'Calls'})}})[_0x001e('0x25')](function(_0x9ca540){if(_0x9ca540){var _0x3ae3d0=_[_0x001e('0x6d')](_0x9ca540[_0x001e('0x6e')]);_[_0x001e('0x6f')](_0x3ae3d0,function(_0x5a9fc2){return _0x128f04[_0x001e('0x70')](_0x5a9fc2[_0x001e('0x2f')]);});return{'count':_0x3ae3d0['length'],'rows':_['map'](_0x3ae3d0,function(_0x56d9cc){return{'id':_0x56d9cc[_0x001e('0x2f')],'name':_0x56d9cc[_0x001e('0x71')],'custom':_[_0x001e('0x72')](_0x56d9cc[_0x001e('0x2f')],'_c')?!![]:![],'options':_0x56d9cc[_0x001e('0x3f')]?_[_0x001e('0x29')](_['values'](_0x56d9cc['options']),function(_0xa94e74){return{'name':_0xa94e74[_0x001e('0x73')],'value':_0xa94e74['name']};}):[]};})};}})[_0x001e('0x25')](respondWithResult(_0x527105,null))[_0x001e('0x44')](function(_0x449dd3){var _0x114b88=_0x12ffe7['query'][_0x001e('0x74')]?0x1f4:_0x449dd3[_0x001e('0x75')]||0x1f4;logger[_0x001e('0x76')](_0x001e('0x77'),'getFields',_0x114b88,JSON[_0x001e('0x6a')](_0x449dd3));delete _0x449dd3[_0x001e('0x2f')];if(_0x114b88===0x191){_0x114b88=0x190;}_0x527105[_0x001e('0x18')](_0x114b88)['send'](_0x12ffe7[_0x001e('0x30')][_0x001e('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0x449dd3[_0x001e('0x75')]}:_0x449dd3);});}else{var _0x405c22=0x1f4;_0x527105[_0x001e('0x18')](_0x405c22)[_0x001e('0x27')]({'message':'Wrong\x20credentials','statusCode':0x190});}});};
\ No newline at end of file
index f288b22..207f67e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc997=['moment','bluebird','request-promise','path','../../config/environment','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api'];(function(_0x3cfd69,_0x301b85){var _0x4de9b2=function(_0x42c2e9){while(--_0x42c2e9){_0x3cfd69['push'](_0x3cfd69['shift']());}};_0x4de9b2(++_0x301b85);}(_0xc997,0x1a1));var _0x7c99=function(_0x30d096,_0x3aa8fe){_0x30d096=_0x30d096-0x0;var _0x133d46=_0xc997[_0x30d096];return _0x133d46;};'use strict';var _=require(_0x7c99('0x0'));var util=require(_0x7c99('0x1'));var logger=require('../../config/logger')(_0x7c99('0x2'));var moment=require(_0x7c99('0x3'));var BPromise=require(_0x7c99('0x4'));var rp=require(_0x7c99('0x5'));var fs=require('fs');var path=require(_0x7c99('0x6'));var rimraf=require('rimraf');var config=require(_0x7c99('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x7c99('0x8'));module['exports']=function(_0x4880a1,_0x46a3dd){return _0x4880a1[_0x7c99('0x9')](_0x7c99('0xa'),attributes,{'tableName':_0x7c99('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x70f0=['../../config/logger','api','moment','bluebird','request-promise','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util'];(function(_0x4d89f8,_0x43180a){var _0x388fbd=function(_0x530a4b){while(--_0x530a4b){_0x4d89f8['push'](_0x4d89f8['shift']());}};_0x388fbd(++_0x43180a);}(_0x70f0,0x80));var _0x070f=function(_0x11ba83,_0xd5611a){_0x11ba83=_0x11ba83-0x0;var _0x3f3925=_0x70f0[_0x11ba83];return _0x3f3925;};'use strict';var _=require(_0x070f('0x0'));var util=require(_0x070f('0x1'));var logger=require(_0x070f('0x2'))(_0x070f('0x3'));var moment=require(_0x070f('0x4'));var BPromise=require(_0x070f('0x5'));var rp=require(_0x070f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x070f('0x7'));var integrations=require(_0x070f('0x8'));module[_0x070f('0x9')]=function(_0x3014cc,_0x135e98){return _0x3014cc[_0x070f('0xa')](_0x070f('0xb'),attributes,{'tableName':_0x070f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index befbd6b..49acfd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6644=['options','raw','where','attributes','limit','include','map','model','then','GetSugarcrmAccount','ShowSugarcrmAccount','SugarcrmAccount','find','lodash','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','findAll'];(function(_0x3b9fb0,_0x4e6b64){var _0x27c938=function(_0x4136ac){while(--_0x4136ac){_0x3b9fb0['push'](_0x3b9fb0['shift']());}};_0x27c938(++_0x4e6b64);}(_0x6644,0xbc));var _0x4664=function(_0x15ea1a,_0x3f59fd){_0x15ea1a=_0x15ea1a-0x0;var _0x93b0f4=_0x6644[_0x15ea1a];return _0x93b0f4;};'use strict';var _=require(_0x4664('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4664('0x1'));var fs=require('fs');var Redis=require(_0x4664('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4664('0x3'));var logger=require(_0x4664('0x4'))(_0x4664('0x5'));var config=require(_0x4664('0x6'));var jayson=require(_0x4664('0x7'));var client=jayson[_0x4664('0x8')][_0x4664('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a4526,_0x18acae,_0x12ecd7){return new BPromise(function(_0x217372,_0x17168c){return client[_0x4664('0xa')](_0x5a4526,_0x12ecd7)['then'](function(_0x3f6b9d){logger['info'](_0x4664('0xb'),_0x18acae,_0x4664('0xc'));logger[_0x4664('0xd')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x18acae,'request\x20sent',JSON[_0x4664('0xe')](_0x3f6b9d));if(_0x3f6b9d[_0x4664('0xf')]){if(_0x3f6b9d[_0x4664('0xf')][_0x4664('0x10')]===0x1f4){logger['error'](_0x4664('0xb'),_0x18acae,_0x3f6b9d['error'][_0x4664('0x11')]);return _0x17168c(_0x3f6b9d[_0x4664('0xf')]['message']);}logger['error'](_0x4664('0xb'),_0x18acae,_0x3f6b9d['error'][_0x4664('0x11')]);return _0x217372(_0x3f6b9d[_0x4664('0xf')][_0x4664('0x11')]);}else{logger[_0x4664('0x12')](_0x4664('0xb'),_0x18acae,_0x4664('0xc'));_0x217372(_0x3f6b9d[_0x4664('0x13')]['message']);}})[_0x4664('0x14')](function(_0x1f0797){logger[_0x4664('0xf')](_0x4664('0xb'),_0x18acae,_0x1f0797);_0x17168c(_0x1f0797);});});}exports['GetSugarcrmAccount']=function(_0x2e64e1){var _0x6dc014=this;return new Promise(function(_0x4ecc3f,_0x5a404a){return db['SugarcrmAccount'][_0x4664('0x15')]({'raw':_0x2e64e1[_0x4664('0x16')]?_0x2e64e1[_0x4664('0x16')][_0x4664('0x17')]===undefined?!![]:![]:!![],'where':_0x2e64e1[_0x4664('0x16')]?_0x2e64e1['options'][_0x4664('0x18')]||null:null,'attributes':_0x2e64e1[_0x4664('0x16')]?_0x2e64e1[_0x4664('0x16')][_0x4664('0x19')]||null:null,'limit':_0x2e64e1[_0x4664('0x16')]?_0x2e64e1[_0x4664('0x16')][_0x4664('0x1a')]||null:null,'include':_0x2e64e1[_0x4664('0x16')]?_0x2e64e1[_0x4664('0x16')][_0x4664('0x1b')]?_['map'](_0x2e64e1['options']['include'],function(_0x39ce6e){return{'model':db[_0x39ce6e['model']],'as':_0x39ce6e['as'],'attributes':_0x39ce6e[_0x4664('0x19')],'include':_0x39ce6e[_0x4664('0x1b')]?_[_0x4664('0x1c')](_0x39ce6e[_0x4664('0x1b')],function(_0x2ea49d){return{'model':db[_0x2ea49d[_0x4664('0x1d')]],'as':_0x2ea49d['as'],'attributes':_0x2ea49d[_0x4664('0x19')],'include':_0x2ea49d['include']?_[_0x4664('0x1c')](_0x2ea49d[_0x4664('0x1b')],function(_0x45ad7a){return{'model':db[_0x45ad7a[_0x4664('0x1d')]],'as':_0x45ad7a['as'],'attributes':_0x45ad7a[_0x4664('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4664('0x1e')](function(_0x40f5e3){logger[_0x4664('0x12')](_0x4664('0x1f'),_0x2e64e1);logger[_0x4664('0xd')](_0x4664('0x1f'),_0x2e64e1,JSON['stringify'](_0x40f5e3));_0x4ecc3f(_0x40f5e3);})[_0x4664('0x14')](function(_0x1029df){logger[_0x4664('0xf')](_0x4664('0x1f'),_0x1029df[_0x4664('0x11')],_0x2e64e1);_0x5a404a(_0x6dc014[_0x4664('0xf')](0x1f4,_0x1029df['message']));});});};exports[_0x4664('0x20')]=function(_0xd44c3c){var _0x27a92a=this;return new Promise(function(_0x3bf2d4,_0x3b7c60){return db[_0x4664('0x21')][_0x4664('0x22')]({'raw':_0xd44c3c[_0x4664('0x16')]?_0xd44c3c[_0x4664('0x16')][_0x4664('0x17')]===undefined?!![]:![]:!![],'where':_0xd44c3c[_0x4664('0x16')]?_0xd44c3c[_0x4664('0x16')][_0x4664('0x18')]||null:null,'attributes':_0xd44c3c[_0x4664('0x16')]?_0xd44c3c['options']['attributes']||null:null,'include':_0xd44c3c[_0x4664('0x16')]?_0xd44c3c[_0x4664('0x16')][_0x4664('0x1b')]?_['map'](_0xd44c3c['options'][_0x4664('0x1b')],function(_0x36e861){return{'model':db[_0x36e861[_0x4664('0x1d')]],'as':_0x36e861['as'],'attributes':_0x36e861[_0x4664('0x19')],'include':_0x36e861[_0x4664('0x1b')]?_[_0x4664('0x1c')](_0x36e861[_0x4664('0x1b')],function(_0x41d7a6){return{'model':db[_0x41d7a6[_0x4664('0x1d')]],'as':_0x41d7a6['as'],'attributes':_0x41d7a6['attributes'],'include':_0x41d7a6[_0x4664('0x1b')]?_[_0x4664('0x1c')](_0x41d7a6[_0x4664('0x1b')],function(_0x2f467f){return{'model':db[_0x2f467f[_0x4664('0x1d')]],'as':_0x2f467f['as'],'attributes':_0x2f467f[_0x4664('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49c18b){logger[_0x4664('0x12')]('ShowSugarcrmAccount',_0xd44c3c);logger[_0x4664('0xd')](_0x4664('0x20'),_0xd44c3c,JSON[_0x4664('0xe')](_0x49c18b));_0x3bf2d4(_0x49c18b);})[_0x4664('0x14')](function(_0x321442){logger['error']('ShowSugarcrmAccount',_0x321442[_0x4664('0x11')],_0xd44c3c);_0x3b7c60(_0x27a92a[_0x4664('0xf')](0x1f4,_0x321442[_0x4664('0x11')]));});});};
\ No newline at end of file
+var _0xfe1c=['../../config/environment','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetSugarcrmAccount','options','raw','attributes','limit','include','model','map','stringify','ShowSugarcrmAccount','SugarcrmAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2dacca,_0x3b55a5){var _0x4e8745=function(_0x4c4515){while(--_0x4c4515){_0x2dacca['push'](_0x2dacca['shift']());}};_0x4e8745(++_0x3b55a5);}(_0xfe1c,0x1a4));var _0xcfe1=function(_0x174bd5,_0xffd194){_0x174bd5=_0x174bd5-0x0;var _0x218719=_0xfe1c[_0x174bd5];return _0x218719;};'use strict';var _=require(_0xcfe1('0x0'));var util=require(_0xcfe1('0x1'));var moment=require(_0xcfe1('0x2'));var BPromise=require('bluebird');var rs=require(_0xcfe1('0x3'));var fs=require('fs');var Redis=require(_0xcfe1('0x4'));var db=require(_0xcfe1('0x5'))['db'];var utils=require(_0xcfe1('0x6'));var logger=require(_0xcfe1('0x7'))(_0xcfe1('0x8'));var config=require(_0xcfe1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcfe1('0xa')][_0xcfe1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x224b5a,_0x1f648f,_0x2d13c6){return new BPromise(function(_0x45ff53,_0x3e49f8){return client[_0xcfe1('0xc')](_0x224b5a,_0x2d13c6)[_0xcfe1('0xd')](function(_0x1910fe){logger[_0xcfe1('0xe')](_0xcfe1('0xf'),_0x1f648f,_0xcfe1('0x10'));logger[_0xcfe1('0x11')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x1f648f,_0xcfe1('0x10'),JSON['stringify'](_0x1910fe));if(_0x1910fe[_0xcfe1('0x12')]){if(_0x1910fe['error']['code']===0x1f4){logger['error'](_0xcfe1('0xf'),_0x1f648f,_0x1910fe['error'][_0xcfe1('0x13')]);return _0x3e49f8(_0x1910fe['error'][_0xcfe1('0x13')]);}logger[_0xcfe1('0x12')](_0xcfe1('0xf'),_0x1f648f,_0x1910fe[_0xcfe1('0x12')][_0xcfe1('0x13')]);return _0x45ff53(_0x1910fe[_0xcfe1('0x12')][_0xcfe1('0x13')]);}else{logger[_0xcfe1('0xe')](_0xcfe1('0xf'),_0x1f648f,_0xcfe1('0x10'));_0x45ff53(_0x1910fe[_0xcfe1('0x14')][_0xcfe1('0x13')]);}})[_0xcfe1('0x15')](function(_0x575c8b){logger[_0xcfe1('0x12')](_0xcfe1('0xf'),_0x1f648f,_0x575c8b);_0x3e49f8(_0x575c8b);});});}exports[_0xcfe1('0x16')]=function(_0x59b9d7){var _0x5593d4=this;return new Promise(function(_0x432208,_0x4f8677){return db['SugarcrmAccount']['findAll']({'raw':_0x59b9d7[_0xcfe1('0x17')]?_0x59b9d7[_0xcfe1('0x17')][_0xcfe1('0x18')]===undefined?!![]:![]:!![],'where':_0x59b9d7['options']?_0x59b9d7[_0xcfe1('0x17')]['where']||null:null,'attributes':_0x59b9d7[_0xcfe1('0x17')]?_0x59b9d7[_0xcfe1('0x17')][_0xcfe1('0x19')]||null:null,'limit':_0x59b9d7[_0xcfe1('0x17')]?_0x59b9d7[_0xcfe1('0x17')][_0xcfe1('0x1a')]||null:null,'include':_0x59b9d7[_0xcfe1('0x17')]?_0x59b9d7[_0xcfe1('0x17')]['include']?_['map'](_0x59b9d7[_0xcfe1('0x17')][_0xcfe1('0x1b')],function(_0x43aa0){return{'model':db[_0x43aa0[_0xcfe1('0x1c')]],'as':_0x43aa0['as'],'attributes':_0x43aa0['attributes'],'include':_0x43aa0[_0xcfe1('0x1b')]?_[_0xcfe1('0x1d')](_0x43aa0[_0xcfe1('0x1b')],function(_0x316e75){return{'model':db[_0x316e75[_0xcfe1('0x1c')]],'as':_0x316e75['as'],'attributes':_0x316e75[_0xcfe1('0x19')],'include':_0x316e75[_0xcfe1('0x1b')]?_[_0xcfe1('0x1d')](_0x316e75['include'],function(_0x10c833){return{'model':db[_0x10c833[_0xcfe1('0x1c')]],'as':_0x10c833['as'],'attributes':_0x10c833[_0xcfe1('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ebe1c){logger[_0xcfe1('0xe')](_0xcfe1('0x16'),_0x59b9d7);logger[_0xcfe1('0x11')](_0xcfe1('0x16'),_0x59b9d7,JSON[_0xcfe1('0x1e')](_0x5ebe1c));_0x432208(_0x5ebe1c);})[_0xcfe1('0x15')](function(_0x58ecaa){logger[_0xcfe1('0x12')](_0xcfe1('0x16'),_0x58ecaa[_0xcfe1('0x13')],_0x59b9d7);_0x4f8677(_0x5593d4[_0xcfe1('0x12')](0x1f4,_0x58ecaa[_0xcfe1('0x13')]));});});};exports[_0xcfe1('0x1f')]=function(_0x1b9ffb){var _0x5cecc0=this;return new Promise(function(_0x41c553,_0x5e8e8e){return db[_0xcfe1('0x20')]['find']({'raw':_0x1b9ffb[_0xcfe1('0x17')]?_0x1b9ffb[_0xcfe1('0x17')][_0xcfe1('0x18')]===undefined?!![]:![]:!![],'where':_0x1b9ffb[_0xcfe1('0x17')]?_0x1b9ffb[_0xcfe1('0x17')]['where']||null:null,'attributes':_0x1b9ffb[_0xcfe1('0x17')]?_0x1b9ffb[_0xcfe1('0x17')][_0xcfe1('0x19')]||null:null,'include':_0x1b9ffb['options']?_0x1b9ffb['options']['include']?_['map'](_0x1b9ffb[_0xcfe1('0x17')][_0xcfe1('0x1b')],function(_0x78fe1d){return{'model':db[_0x78fe1d[_0xcfe1('0x1c')]],'as':_0x78fe1d['as'],'attributes':_0x78fe1d['attributes'],'include':_0x78fe1d[_0xcfe1('0x1b')]?_['map'](_0x78fe1d[_0xcfe1('0x1b')],function(_0x35695c){return{'model':db[_0x35695c[_0xcfe1('0x1c')]],'as':_0x35695c['as'],'attributes':_0x35695c[_0xcfe1('0x19')],'include':_0x35695c[_0xcfe1('0x1b')]?_[_0xcfe1('0x1d')](_0x35695c[_0xcfe1('0x1b')],function(_0x1a4bc0){return{'model':db[_0x1a4bc0['model']],'as':_0x1a4bc0['as'],'attributes':_0x1a4bc0[_0xcfe1('0x19')]};}):[]};}):[]};}):[]:[]})[_0xcfe1('0xd')](function(_0x14e557){logger['info'](_0xcfe1('0x1f'),_0x1b9ffb);logger[_0xcfe1('0x11')](_0xcfe1('0x1f'),_0x1b9ffb,JSON[_0xcfe1('0x1e')](_0x14e557));_0x41c553(_0x14e557);})['catch'](function(_0x46973f){logger['error'](_0xcfe1('0x1f'),_0x46973f['message'],_0x1b9ffb);_0x5e8e8e(_0x5cecc0[_0xcfe1('0x12')](0x1f4,_0x46973f[_0xcfe1('0x13')]));});});};
\ No newline at end of file
index 24bb614..9f61a6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x022e=['../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x1625db,_0x58dc81){var _0x45d1ab=function(_0x31d81f){while(--_0x31d81f){_0x1625db['push'](_0x1625db['shift']());}};_0x45d1ab(++_0x58dc81);}(_0x022e,0x11a));var _0xe022=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x022e[_0x3c8e9a];return _0x2d4c57;};'use strict';var multer=require(_0xe022('0x0'));var util=require(_0xe022('0x1'));var path=require(_0xe022('0x2'));var timeout=require(_0xe022('0x3'));var express=require('express');var router=express[_0xe022('0x4')]();var fs_extra=require(_0xe022('0x5'));var auth=require(_0xe022('0x6'));var interaction=require(_0xe022('0x7'));var config=require('../../config/environment');var controller=require(_0xe022('0x8'));router[_0xe022('0x9')]('/',auth[_0xe022('0xa')](),controller[_0xe022('0xb')]);router[_0xe022('0x9')](_0xe022('0xc'),auth[_0xe022('0xa')](),controller[_0xe022('0xd')]);router[_0xe022('0x9')](_0xe022('0xe'),auth[_0xe022('0xa')](),controller[_0xe022('0xf')]);router[_0xe022('0x9')](_0xe022('0x10'),auth['isAuthenticated'](),controller[_0xe022('0x11')]);router[_0xe022('0x9')](_0xe022('0x12'),auth[_0xe022('0xa')](),controller[_0xe022('0x13')]);router[_0xe022('0x14')]('/',auth[_0xe022('0xa')](),controller[_0xe022('0x15')]);router['put'](_0xe022('0xc'),auth[_0xe022('0xa')](),controller[_0xe022('0x16')]);router['delete'](_0xe022('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xe022('0x17')]=router;
\ No newline at end of file
+var _0xa996=['../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x47d5f0,_0x576696){var _0x4fc171=function(_0x1a6081){while(--_0x1a6081){_0x47d5f0['push'](_0x47d5f0['shift']());}};_0x4fc171(++_0x576696);}(_0xa996,0x13e));var _0x6a99=function(_0x4a164a,_0x4db420){_0x4a164a=_0x4a164a-0x0;var _0x402a1f=_0xa996[_0x4a164a];return _0x402a1f;};'use strict';var multer=require(_0x6a99('0x0'));var util=require(_0x6a99('0x1'));var path=require(_0x6a99('0x2'));var timeout=require(_0x6a99('0x3'));var express=require(_0x6a99('0x4'));var router=express['Router']();var fs_extra=require(_0x6a99('0x5'));var auth=require(_0x6a99('0x6'));var interaction=require(_0x6a99('0x7'));var config=require(_0x6a99('0x8'));var controller=require(_0x6a99('0x9'));router['get']('/',auth[_0x6a99('0xa')](),controller[_0x6a99('0xb')]);router[_0x6a99('0xc')](_0x6a99('0xd'),auth[_0x6a99('0xa')](),controller['show']);router[_0x6a99('0xc')](_0x6a99('0xe'),auth[_0x6a99('0xa')](),controller[_0x6a99('0xf')]);router[_0x6a99('0xc')](_0x6a99('0x10'),auth[_0x6a99('0xa')](),controller[_0x6a99('0x11')]);router[_0x6a99('0xc')](_0x6a99('0x12'),auth[_0x6a99('0xa')](),controller[_0x6a99('0x13')]);router[_0x6a99('0x14')]('/',auth[_0x6a99('0xa')](),controller[_0x6a99('0x15')]);router[_0x6a99('0x16')]('/:id',auth[_0x6a99('0xa')](),controller['update']);router['delete']('/:id',auth[_0x6a99('0xa')](),controller[_0x6a99('0x17')]);module[_0x6a99('0x18')]=router;
\ No newline at end of file
index 70fa1cc..e590cfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43d7=['STRING','exports'];(function(_0x636cce,_0x46a848){var _0x52c8d1=function(_0x49bad6){while(--_0x49bad6){_0x636cce['push'](_0x636cce['shift']());}};_0x52c8d1(++_0x46a848);}(_0x43d7,0x1ef));var _0x743d=function(_0x4f45e5,_0x3646c0){_0x4f45e5=_0x4f45e5-0x0;var _0x3d5a78=_0x43d7[_0x4f45e5];return _0x3d5a78;};'use strict';var Sequelize=require('sequelize');module[_0x743d('0x0')]={'name':{'type':Sequelize[_0x743d('0x1')]},'description':{'type':Sequelize[_0x743d('0x1')]}};
\ No newline at end of file
+var _0x9655=['STRING','exports'];(function(_0x161863,_0x7256e3){var _0x5bf184=function(_0x46af55){while(--_0x46af55){_0x161863['push'](_0x161863['shift']());}};_0x5bf184(++_0x7256e3);}(_0x9655,0x1db));var _0x5965=function(_0x593a13,_0x4203c9){_0x593a13=_0x593a13-0x0;var _0x14b05a=_0x9655[_0x593a13];return _0x14b05a;};'use strict';var Sequelize=require('sequelize');module[_0x5965('0x0')]={'name':{'type':Sequelize[_0x5965('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index fee291b..acc45cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55e6=['json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmConfiguration','fieldName','type','key','keys','query','intersection','model','attributes','hasOwnProperty','nolimit','sort','filters','pick','where','options','includeAll','findAll','rows','catch','show','params','fields','length','include','merge','find','body','getFields','findOne','SugarcrmField','order','filter','rawAttributes','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x5f0501,_0x19196e){var _0x3c2c45=function(_0x107fe6){while(--_0x107fe6){_0x5f0501['push'](_0x5f0501['shift']());}};_0x3c2c45(++_0x19196e);}(_0x55e6,0x129));var _0x655e=function(_0x35882b,_0x2778ed){_0x35882b=_0x35882b-0x0;var _0x3d434b=_0x55e6[_0x35882b];return _0x3d434b;};'use strict';var emlformat=require(_0x655e('0x0'));var rimraf=require(_0x655e('0x1'));var zipdir=require(_0x655e('0x2'));var jsonpatch=require(_0x655e('0x3'));var rp=require(_0x655e('0x4'));var moment=require(_0x655e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x655e('0x6'));var util=require(_0x655e('0x7'));var path=require(_0x655e('0x8'));var sox=require(_0x655e('0x9'));var csv=require(_0x655e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x655e('0xb'));var squel=require(_0x655e('0xc'));var crypto=require('crypto');var jsforce=require(_0x655e('0xd'));var deskjs=require(_0x655e('0xe'));var toCsv=require(_0x655e('0xa'));var querystring=require(_0x655e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x655e('0x10'));var qs=require(_0x655e('0x11'));var as=require(_0x655e('0x12'));var hardwareService=require(_0x655e('0x13'));var logger=require(_0x655e('0x14'))('api');var utils=require(_0x655e('0x15'));var config=require(_0x655e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x655e('0x17'))['db'];function respondWithStatusCode(_0x32810e,_0x29b2cd){_0x29b2cd=_0x29b2cd||0xcc;return function(_0x13b419){if(_0x13b419){return _0x32810e[_0x655e('0x18')](_0x29b2cd);}return _0x32810e[_0x655e('0x19')](_0x29b2cd)[_0x655e('0x1a')]();};}function respondWithResult(_0x42b4be,_0x509897){_0x509897=_0x509897||0xc8;return function(_0x130b03){if(_0x130b03){return _0x42b4be['status'](_0x509897)[_0x655e('0x1b')](_0x130b03);}};}function respondWithFilteredResult(_0x21e765,_0x42cd17){return function(_0x38054a){if(_0x38054a){var _0x4fe0c6=typeof _0x42cd17[_0x655e('0x1c')]==='undefined'&&typeof _0x42cd17[_0x655e('0x1d')]===_0x655e('0x1e');var _0x27fc26=_0x38054a[_0x655e('0x1f')];var _0x3c90ad=_0x4fe0c6?0x0:_0x42cd17[_0x655e('0x1c')];var _0x502671=_0x4fe0c6?_0x38054a['count']:_0x42cd17[_0x655e('0x1c')]+_0x42cd17[_0x655e('0x1d')];var _0x127e3d;if(_0x502671>=_0x27fc26){_0x502671=_0x27fc26;_0x127e3d=0xc8;}else{_0x127e3d=0xce;}_0x21e765[_0x655e('0x19')](_0x127e3d);return _0x21e765[_0x655e('0x20')](_0x655e('0x21'),_0x3c90ad+'-'+_0x502671+'/'+_0x27fc26)[_0x655e('0x1b')](_0x38054a);}return null;};}function patchUpdates(_0x5b0343){return function(_0x118e59){try{jsonpatch['apply'](_0x118e59,_0x5b0343,!![]);}catch(_0x143ee7){return BPromise[_0x655e('0x22')](_0x143ee7);}return _0x118e59[_0x655e('0x23')]();};}function saveUpdates(_0x1c6c9d,_0x2cfa37){return function(_0x2602b3){if(_0x2602b3){return _0x2602b3[_0x655e('0x24')](_0x1c6c9d)[_0x655e('0x25')](function(_0x44bab1){return _0x44bab1;});}return null;};}function removeEntity(_0x1be12d,_0x56fb4a){return function(_0x3d5b29){if(_0x3d5b29){return _0x3d5b29[_0x655e('0x26')]()[_0x655e('0x25')](function(){_0x1be12d[_0x655e('0x19')](0xcc)[_0x655e('0x1a')]();});}};}function handleEntityNotFound(_0x46b843,_0x254b4f){return function(_0x2c42bc){if(!_0x2c42bc){_0x46b843[_0x655e('0x18')](0x194);}return _0x2c42bc;};}function handleError(_0x210659,_0x30b08c){_0x30b08c=_0x30b08c||0x1f4;return function(_0x4e2252){logger[_0x655e('0x27')](_0x4e2252[_0x655e('0x28')]);if(_0x4e2252[_0x655e('0x29')]){delete _0x4e2252[_0x655e('0x29')];}_0x210659[_0x655e('0x19')](_0x30b08c)[_0x655e('0x2a')](_0x4e2252);};}exports[_0x655e('0x2b')]=function(_0x5bc4d8,_0x46c346){var _0x517a44={},_0x18675b={},_0x3f4558={'count':0x0,'rows':[]};var _0x4933a3=_[_0x655e('0x2c')](db[_0x655e('0x2d')]['rawAttributes'],function(_0x3fb85f){return{'name':_0x3fb85f[_0x655e('0x2e')],'type':_0x3fb85f[_0x655e('0x2f')][_0x655e('0x30')]};});_0x18675b['model']=_[_0x655e('0x2c')](_0x4933a3,'name');_0x18675b['query']=_[_0x655e('0x31')](_0x5bc4d8[_0x655e('0x32')]);_0x18675b['filters']=_[_0x655e('0x33')](_0x18675b[_0x655e('0x34')],_0x18675b[_0x655e('0x32')]);_0x517a44['attributes']=_[_0x655e('0x33')](_0x18675b[_0x655e('0x34')],qs['fields'](_0x5bc4d8['query']['fields']));_0x517a44[_0x655e('0x35')]=_0x517a44[_0x655e('0x35')]['length']?_0x517a44['attributes']:_0x18675b[_0x655e('0x34')];if(!_0x5bc4d8['query'][_0x655e('0x36')](_0x655e('0x37'))){_0x517a44[_0x655e('0x1d')]=qs[_0x655e('0x1d')](_0x5bc4d8[_0x655e('0x32')][_0x655e('0x1d')]);_0x517a44[_0x655e('0x1c')]=qs[_0x655e('0x1c')](_0x5bc4d8[_0x655e('0x32')][_0x655e('0x1c')]);}_0x517a44['order']=qs[_0x655e('0x38')](_0x5bc4d8[_0x655e('0x32')]['sort']);_0x517a44['where']=qs[_0x655e('0x39')](_[_0x655e('0x3a')](_0x5bc4d8[_0x655e('0x32')],_0x18675b[_0x655e('0x39')]),_0x4933a3);if(_0x5bc4d8[_0x655e('0x32')]['filter']){_0x517a44[_0x655e('0x3b')]=_['merge'](_0x517a44['where'],{'$or':_[_0x655e('0x2c')](_0x4933a3,function(_0x14ae5a){if(_0x14ae5a[_0x655e('0x2f')]!=='VIRTUAL'){var _0x20b41f={};_0x20b41f[_0x14ae5a['name']]={'$like':'%'+_0x5bc4d8['query']['filter']+'%'};return _0x20b41f;}})});}_0x517a44=_['merge']({},_0x517a44,_0x5bc4d8[_0x655e('0x3c')]);var _0x43a851={'where':_0x517a44[_0x655e('0x3b')]};return db[_0x655e('0x2d')][_0x655e('0x1f')](_0x43a851)[_0x655e('0x25')](function(_0x287080){_0x3f4558[_0x655e('0x1f')]=_0x287080;if(_0x5bc4d8['query'][_0x655e('0x3d')]){_0x517a44['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x655e('0x3e')](_0x517a44);})['then'](function(_0x5a3d64){_0x3f4558[_0x655e('0x3f')]=_0x5a3d64;return _0x3f4558;})[_0x655e('0x25')](respondWithFilteredResult(_0x46c346,_0x517a44))[_0x655e('0x40')](handleError(_0x46c346,null));};exports[_0x655e('0x41')]=function(_0x3a40af,_0x4d2af6){var _0x2ff3e9={'raw':![],'where':{'id':_0x3a40af[_0x655e('0x42')]['id']}},_0x54f50c={};_0x54f50c[_0x655e('0x34')]=_[_0x655e('0x31')](db['SugarcrmConfiguration']['rawAttributes']);_0x54f50c['query']=_[_0x655e('0x31')](_0x3a40af['query']);_0x54f50c[_0x655e('0x39')]=_['intersection'](_0x54f50c[_0x655e('0x34')],_0x54f50c[_0x655e('0x32')]);_0x2ff3e9[_0x655e('0x35')]=_['intersection'](_0x54f50c[_0x655e('0x34')],qs[_0x655e('0x43')](_0x3a40af['query'][_0x655e('0x43')]));_0x2ff3e9[_0x655e('0x35')]=_0x2ff3e9[_0x655e('0x35')][_0x655e('0x44')]?_0x2ff3e9[_0x655e('0x35')]:_0x54f50c[_0x655e('0x34')];if(_0x3a40af['query'][_0x655e('0x3d')]){_0x2ff3e9[_0x655e('0x45')]=[{'all':!![]}];}_0x2ff3e9=_[_0x655e('0x46')]({},_0x2ff3e9,_0x3a40af['options']);return db['SugarcrmConfiguration'][_0x655e('0x47')](_0x2ff3e9)[_0x655e('0x25')](handleEntityNotFound(_0x4d2af6,null))['then'](respondWithResult(_0x4d2af6,null))['catch'](handleError(_0x4d2af6,null));};exports['create']=function(_0x1dbca0,_0x500309){return db[_0x655e('0x2d')]['create'](_0x1dbca0[_0x655e('0x48')],{})[_0x655e('0x25')](respondWithResult(_0x500309,0xc9))['catch'](handleError(_0x500309,null));};exports['update']=function(_0x4c41e6,_0x12c709){if(_0x4c41e6[_0x655e('0x48')]['id']){delete _0x4c41e6['body']['id'];}return db[_0x655e('0x2d')][_0x655e('0x47')]({'where':{'id':_0x4c41e6[_0x655e('0x42')]['id']}})[_0x655e('0x25')](handleEntityNotFound(_0x12c709,null))[_0x655e('0x25')](saveUpdates(_0x4c41e6[_0x655e('0x48')],null))['then'](respondWithResult(_0x12c709,null))[_0x655e('0x40')](handleError(_0x12c709,null));};exports[_0x655e('0x26')]=function(_0xdac897,_0x7aa158){return db[_0x655e('0x2d')][_0x655e('0x47')]({'where':{'id':_0xdac897[_0x655e('0x42')]['id']}})[_0x655e('0x25')](handleEntityNotFound(_0x7aa158,null))['then'](removeEntity(_0x7aa158,null))[_0x655e('0x40')](handleError(_0x7aa158,null));};exports[_0x655e('0x49')]=function(_0x11f5d7,_0x1a95fc,_0x145556){var _0x163294={};var _0x5dbbc0={};var _0x5cfe84;var _0x19154c;return db[_0x655e('0x2d')][_0x655e('0x4a')]({'where':{'id':_0x11f5d7[_0x655e('0x42')]['id']}})[_0x655e('0x25')](handleEntityNotFound(_0x1a95fc,null))[_0x655e('0x25')](function(_0x33d7e6){if(_0x33d7e6){_0x5cfe84=_0x33d7e6;_0x5dbbc0[_0x655e('0x34')]=_[_0x655e('0x31')](db[_0x655e('0x4b')]['rawAttributes']);_0x5dbbc0[_0x655e('0x32')]=_[_0x655e('0x31')](_0x11f5d7[_0x655e('0x32')]);_0x5dbbc0[_0x655e('0x39')]=_[_0x655e('0x33')](_0x5dbbc0[_0x655e('0x34')],_0x5dbbc0[_0x655e('0x32')]);_0x163294[_0x655e('0x35')]=_[_0x655e('0x33')](_0x5dbbc0[_0x655e('0x34')],qs['fields'](_0x11f5d7[_0x655e('0x32')][_0x655e('0x43')]));_0x163294[_0x655e('0x35')]=_0x163294[_0x655e('0x35')][_0x655e('0x44')]?_0x163294[_0x655e('0x35')]:_0x5dbbc0['model'];_0x163294[_0x655e('0x4c')]=qs[_0x655e('0x38')](_0x11f5d7['query'][_0x655e('0x38')]);_0x163294['where']=qs['filters'](_[_0x655e('0x3a')](_0x11f5d7[_0x655e('0x32')],_0x5dbbc0[_0x655e('0x39')]));if(_0x11f5d7[_0x655e('0x32')][_0x655e('0x4d')]){_0x163294[_0x655e('0x3b')]=_[_0x655e('0x46')](_0x163294[_0x655e('0x3b')],{'$or':_[_0x655e('0x2c')](_0x163294[_0x655e('0x35')],function(_0x4a66b6){var _0x5b017f={};_0x5b017f[_0x4a66b6]={'$like':'%'+_0x11f5d7[_0x655e('0x32')][_0x655e('0x4d')]+'%'};return _0x5b017f;})});}_0x163294=_[_0x655e('0x46')]({},_0x163294,_0x11f5d7[_0x655e('0x3c')]);return _0x5cfe84[_0x655e('0x49')](_0x163294);}})[_0x655e('0x25')](function(_0x2e389e){if(_0x2e389e){_0x19154c=_0x2e389e[_0x655e('0x44')];if(!_0x11f5d7[_0x655e('0x32')]['hasOwnProperty'](_0x655e('0x37'))){_0x163294[_0x655e('0x1d')]=qs[_0x655e('0x1d')](_0x11f5d7['query'][_0x655e('0x1d')]);_0x163294[_0x655e('0x1c')]=qs[_0x655e('0x1c')](_0x11f5d7[_0x655e('0x32')]['offset']);}return _0x5cfe84[_0x655e('0x49')](_0x163294);}})[_0x655e('0x25')](function(_0x4e6b13){if(_0x4e6b13){return _0x4e6b13?{'count':_0x19154c,'rows':_0x4e6b13}:null;}})['then'](respondWithResult(_0x1a95fc,null))['catch'](handleError(_0x1a95fc,null));};exports['getSubjects']=function(_0x49f22e,_0x4766cc,_0x3e80c4){var _0x4b77af={};var _0x576518={};var _0x53f053;var _0x2e645c;return db[_0x655e('0x2d')][_0x655e('0x4a')]({'where':{'id':_0x49f22e['params']['id']}})[_0x655e('0x25')](handleEntityNotFound(_0x4766cc,null))['then'](function(_0x564b15){if(_0x564b15){_0x53f053=_0x564b15;_0x576518[_0x655e('0x34')]=_[_0x655e('0x31')](db[_0x655e('0x4b')][_0x655e('0x4e')]);_0x576518[_0x655e('0x32')]=_[_0x655e('0x31')](_0x49f22e['query']);_0x576518['filters']=_[_0x655e('0x33')](_0x576518['model'],_0x576518[_0x655e('0x32')]);_0x4b77af[_0x655e('0x35')]=_[_0x655e('0x33')](_0x576518[_0x655e('0x34')],qs['fields'](_0x49f22e['query'][_0x655e('0x43')]));_0x4b77af['attributes']=_0x4b77af[_0x655e('0x35')][_0x655e('0x44')]?_0x4b77af['attributes']:_0x576518['model'];_0x4b77af[_0x655e('0x4c')]=qs[_0x655e('0x38')](_0x49f22e['query']['sort']);_0x4b77af[_0x655e('0x3b')]=qs[_0x655e('0x39')](_[_0x655e('0x3a')](_0x49f22e[_0x655e('0x32')],_0x576518[_0x655e('0x39')]));if(_0x49f22e[_0x655e('0x32')][_0x655e('0x4d')]){_0x4b77af['where']=_[_0x655e('0x46')](_0x4b77af['where'],{'$or':_['map'](_0x4b77af['attributes'],function(_0x25f8dd){var _0x334b39={};_0x334b39[_0x25f8dd]={'$like':'%'+_0x49f22e[_0x655e('0x32')][_0x655e('0x4d')]+'%'};return _0x334b39;})});}_0x4b77af=_[_0x655e('0x46')]({},_0x4b77af,_0x49f22e[_0x655e('0x3c')]);return _0x53f053[_0x655e('0x4f')](_0x4b77af);}})[_0x655e('0x25')](function(_0x22bacb){if(_0x22bacb){_0x2e645c=_0x22bacb[_0x655e('0x44')];if(!_0x49f22e['query'][_0x655e('0x36')](_0x655e('0x37'))){_0x4b77af['limit']=qs[_0x655e('0x1d')](_0x49f22e[_0x655e('0x32')]['limit']);_0x4b77af['offset']=qs[_0x655e('0x1c')](_0x49f22e[_0x655e('0x32')]['offset']);}return _0x53f053['getSubjects'](_0x4b77af);}})['then'](function(_0x3735fa){if(_0x3735fa){return _0x3735fa?{'count':_0x2e645c,'rows':_0x3735fa}:null;}})['then'](respondWithResult(_0x4766cc,null))['catch'](handleError(_0x4766cc,null));};exports[_0x655e('0x50')]=function(_0x363ca3,_0x15b93b,_0x45b989){var _0x56d6b5={};var _0x5adfd6={};var _0x4d816a;var _0x3b3338;return db[_0x655e('0x2d')][_0x655e('0x4a')]({'where':{'id':_0x363ca3['params']['id']}})['then'](handleEntityNotFound(_0x15b93b,null))['then'](function(_0x4e3890){if(_0x4e3890){_0x4d816a=_0x4e3890;_0x5adfd6[_0x655e('0x34')]=_['keys'](db[_0x655e('0x4b')][_0x655e('0x4e')]);_0x5adfd6[_0x655e('0x32')]=_['keys'](_0x363ca3[_0x655e('0x32')]);_0x5adfd6['filters']=_[_0x655e('0x33')](_0x5adfd6['model'],_0x5adfd6[_0x655e('0x32')]);_0x56d6b5['attributes']=_[_0x655e('0x33')](_0x5adfd6[_0x655e('0x34')],qs['fields'](_0x363ca3[_0x655e('0x32')][_0x655e('0x43')]));_0x56d6b5[_0x655e('0x35')]=_0x56d6b5['attributes']['length']?_0x56d6b5[_0x655e('0x35')]:_0x5adfd6[_0x655e('0x34')];_0x56d6b5[_0x655e('0x4c')]=qs[_0x655e('0x38')](_0x363ca3[_0x655e('0x32')][_0x655e('0x38')]);_0x56d6b5[_0x655e('0x3b')]=qs[_0x655e('0x39')](_[_0x655e('0x3a')](_0x363ca3[_0x655e('0x32')],_0x5adfd6['filters']));if(_0x363ca3['query'][_0x655e('0x4d')]){_0x56d6b5[_0x655e('0x3b')]=_[_0x655e('0x46')](_0x56d6b5[_0x655e('0x3b')],{'$or':_[_0x655e('0x2c')](_0x56d6b5['attributes'],function(_0x47533a){var _0x319fce={};_0x319fce[_0x47533a]={'$like':'%'+_0x363ca3[_0x655e('0x32')]['filter']+'%'};return _0x319fce;})});}_0x56d6b5=_[_0x655e('0x46')]({},_0x56d6b5,_0x363ca3[_0x655e('0x3c')]);return _0x4d816a['getDescriptions'](_0x56d6b5);}})[_0x655e('0x25')](function(_0x3ad98e){if(_0x3ad98e){_0x3b3338=_0x3ad98e[_0x655e('0x44')];if(!_0x363ca3[_0x655e('0x32')]['hasOwnProperty'](_0x655e('0x37'))){_0x56d6b5[_0x655e('0x1d')]=qs[_0x655e('0x1d')](_0x363ca3[_0x655e('0x32')]['limit']);_0x56d6b5[_0x655e('0x1c')]=qs[_0x655e('0x1c')](_0x363ca3[_0x655e('0x32')][_0x655e('0x1c')]);}return _0x4d816a['getDescriptions'](_0x56d6b5);}})['then'](function(_0x4bdcc4){if(_0x4bdcc4){return _0x4bdcc4?{'count':_0x3b3338,'rows':_0x4bdcc4}:null;}})['then'](respondWithResult(_0x15b93b,null))['catch'](handleError(_0x15b93b,null));};
\ No newline at end of file
+var _0x6615=['destroy','error','stack','name','send','SugarcrmConfiguration','rawAttributes','type','model','map','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','include','findAll','rows','show','params','keys','fields','length','includeAll','options','find','create','body','catch','update','getFields','SugarcrmField','filter','getSubjects','getDescriptions','findOne','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','then'];(function(_0x38167a,_0x398a65){var _0xfcffae=function(_0x5659c3){while(--_0x5659c3){_0x38167a['push'](_0x38167a['shift']());}};_0xfcffae(++_0x398a65);}(_0x6615,0xc0));var _0x5661=function(_0x5a7cbc,_0x573d85){_0x5a7cbc=_0x5a7cbc-0x0;var _0x44d2cc=_0x6615[_0x5a7cbc];return _0x44d2cc;};'use strict';var emlformat=require(_0x5661('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5661('0x1'));var jsonpatch=require(_0x5661('0x2'));var rp=require(_0x5661('0x3'));var moment=require('moment');var BPromise=require(_0x5661('0x4'));var Mustache=require(_0x5661('0x5'));var util=require('util');var path=require(_0x5661('0x6'));var sox=require(_0x5661('0x7'));var csv=require(_0x5661('0x8'));var ejs=require(_0x5661('0x9'));var fs=require('fs');var fs_extra=require(_0x5661('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5661('0xb'));var deskjs=require(_0x5661('0xc'));var toCsv=require(_0x5661('0x8'));var querystring=require(_0x5661('0xd'));var Papa=require('papaparse');var Redis=require(_0x5661('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5661('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5661('0x10'));var logger=require(_0x5661('0x11'))(_0x5661('0x12'));var utils=require(_0x5661('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5661('0x14'));var db=require(_0x5661('0x15'))['db'];function respondWithStatusCode(_0x2d6d26,_0x206955){_0x206955=_0x206955||0xcc;return function(_0x40cf78){if(_0x40cf78){return _0x2d6d26[_0x5661('0x16')](_0x206955);}return _0x2d6d26[_0x5661('0x17')](_0x206955)['end']();};}function respondWithResult(_0x52d296,_0x4efbd0){_0x4efbd0=_0x4efbd0||0xc8;return function(_0x2486d4){if(_0x2486d4){return _0x52d296[_0x5661('0x17')](_0x4efbd0)[_0x5661('0x18')](_0x2486d4);}};}function respondWithFilteredResult(_0x48abe2,_0x361e49){return function(_0x547003){if(_0x547003){var _0xadcc8b=typeof _0x361e49[_0x5661('0x19')]==='undefined'&&typeof _0x361e49['limit']===_0x5661('0x1a');var _0x45d003=_0x547003[_0x5661('0x1b')];var _0xc80307=_0xadcc8b?0x0:_0x361e49[_0x5661('0x19')];var _0x440b3b=_0xadcc8b?_0x547003[_0x5661('0x1b')]:_0x361e49[_0x5661('0x19')]+_0x361e49[_0x5661('0x1c')];var _0x22f0fc;if(_0x440b3b>=_0x45d003){_0x440b3b=_0x45d003;_0x22f0fc=0xc8;}else{_0x22f0fc=0xce;}_0x48abe2[_0x5661('0x17')](_0x22f0fc);return _0x48abe2[_0x5661('0x1d')](_0x5661('0x1e'),_0xc80307+'-'+_0x440b3b+'/'+_0x45d003)[_0x5661('0x18')](_0x547003);}return null;};}function patchUpdates(_0x34b823){return function(_0x9b4c6f){try{jsonpatch[_0x5661('0x1f')](_0x9b4c6f,_0x34b823,!![]);}catch(_0x1b266a){return BPromise['reject'](_0x1b266a);}return _0x9b4c6f['save']();};}function saveUpdates(_0x1c34c4,_0x1076bd){return function(_0x4b2757){if(_0x4b2757){return _0x4b2757['update'](_0x1c34c4)[_0x5661('0x20')](function(_0x4c2ada){return _0x4c2ada;});}return null;};}function removeEntity(_0x1e2ce2,_0x45fd63){return function(_0x352b53){if(_0x352b53){return _0x352b53[_0x5661('0x21')]()[_0x5661('0x20')](function(){_0x1e2ce2[_0x5661('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8ed347,_0x2ccfff){return function(_0x21d6f5){if(!_0x21d6f5){_0x8ed347['sendStatus'](0x194);}return _0x21d6f5;};}function handleError(_0x173936,_0x35aa32){_0x35aa32=_0x35aa32||0x1f4;return function(_0x246b86){logger[_0x5661('0x22')](_0x246b86[_0x5661('0x23')]);if(_0x246b86['name']){delete _0x246b86[_0x5661('0x24')];}_0x173936[_0x5661('0x17')](_0x35aa32)[_0x5661('0x25')](_0x246b86);};}exports['index']=function(_0x8cd2a6,_0x328a51){var _0x5baed1={},_0x37ec67={},_0x4da6d0={'count':0x0,'rows':[]};var _0x39fbd4=_['map'](db[_0x5661('0x26')][_0x5661('0x27')],function(_0x1d99fb){return{'name':_0x1d99fb['fieldName'],'type':_0x1d99fb[_0x5661('0x28')]['key']};});_0x37ec67[_0x5661('0x29')]=_[_0x5661('0x2a')](_0x39fbd4,_0x5661('0x24'));_0x37ec67['query']=_['keys'](_0x8cd2a6[_0x5661('0x2b')]);_0x37ec67[_0x5661('0x2c')]=_[_0x5661('0x2d')](_0x37ec67['model'],_0x37ec67[_0x5661('0x2b')]);_0x5baed1[_0x5661('0x2e')]=_['intersection'](_0x37ec67[_0x5661('0x29')],qs['fields'](_0x8cd2a6['query']['fields']));_0x5baed1['attributes']=_0x5baed1[_0x5661('0x2e')]['length']?_0x5baed1['attributes']:_0x37ec67['model'];if(!_0x8cd2a6[_0x5661('0x2b')][_0x5661('0x2f')](_0x5661('0x30'))){_0x5baed1['limit']=qs[_0x5661('0x1c')](_0x8cd2a6['query']['limit']);_0x5baed1[_0x5661('0x19')]=qs[_0x5661('0x19')](_0x8cd2a6['query']['offset']);}_0x5baed1[_0x5661('0x31')]=qs['sort'](_0x8cd2a6[_0x5661('0x2b')][_0x5661('0x32')]);_0x5baed1[_0x5661('0x33')]=qs[_0x5661('0x2c')](_[_0x5661('0x34')](_0x8cd2a6[_0x5661('0x2b')],_0x37ec67[_0x5661('0x2c')]),_0x39fbd4);if(_0x8cd2a6[_0x5661('0x2b')]['filter']){_0x5baed1[_0x5661('0x33')]=_[_0x5661('0x35')](_0x5baed1[_0x5661('0x33')],{'$or':_['map'](_0x39fbd4,function(_0x51e730){if(_0x51e730['type']!=='VIRTUAL'){var _0x5b7679={};_0x5b7679[_0x51e730[_0x5661('0x24')]]={'$like':'%'+_0x8cd2a6[_0x5661('0x2b')]['filter']+'%'};return _0x5b7679;}})});}_0x5baed1=_[_0x5661('0x35')]({},_0x5baed1,_0x8cd2a6['options']);var _0x4243b3={'where':_0x5baed1[_0x5661('0x33')]};return db['SugarcrmConfiguration'][_0x5661('0x1b')](_0x4243b3)[_0x5661('0x20')](function(_0xd9cd43){_0x4da6d0[_0x5661('0x1b')]=_0xd9cd43;if(_0x8cd2a6[_0x5661('0x2b')]['includeAll']){_0x5baed1[_0x5661('0x36')]=[{'all':!![]}];}return db[_0x5661('0x26')][_0x5661('0x37')](_0x5baed1);})[_0x5661('0x20')](function(_0x4d31e0){_0x4da6d0[_0x5661('0x38')]=_0x4d31e0;return _0x4da6d0;})[_0x5661('0x20')](respondWithFilteredResult(_0x328a51,_0x5baed1))['catch'](handleError(_0x328a51,null));};exports[_0x5661('0x39')]=function(_0x4ca7dd,_0x39e768){var _0xd6f449={'raw':![],'where':{'id':_0x4ca7dd[_0x5661('0x3a')]['id']}},_0x233f4d={};_0x233f4d[_0x5661('0x29')]=_[_0x5661('0x3b')](db['SugarcrmConfiguration'][_0x5661('0x27')]);_0x233f4d['query']=_[_0x5661('0x3b')](_0x4ca7dd[_0x5661('0x2b')]);_0x233f4d[_0x5661('0x2c')]=_[_0x5661('0x2d')](_0x233f4d['model'],_0x233f4d[_0x5661('0x2b')]);_0xd6f449[_0x5661('0x2e')]=_[_0x5661('0x2d')](_0x233f4d['model'],qs[_0x5661('0x3c')](_0x4ca7dd['query'][_0x5661('0x3c')]));_0xd6f449['attributes']=_0xd6f449['attributes'][_0x5661('0x3d')]?_0xd6f449[_0x5661('0x2e')]:_0x233f4d[_0x5661('0x29')];if(_0x4ca7dd[_0x5661('0x2b')][_0x5661('0x3e')]){_0xd6f449[_0x5661('0x36')]=[{'all':!![]}];}_0xd6f449=_[_0x5661('0x35')]({},_0xd6f449,_0x4ca7dd[_0x5661('0x3f')]);return db['SugarcrmConfiguration'][_0x5661('0x40')](_0xd6f449)[_0x5661('0x20')](handleEntityNotFound(_0x39e768,null))[_0x5661('0x20')](respondWithResult(_0x39e768,null))['catch'](handleError(_0x39e768,null));};exports[_0x5661('0x41')]=function(_0x2ec065,_0x17ac26){return db['SugarcrmConfiguration'][_0x5661('0x41')](_0x2ec065[_0x5661('0x42')],{})[_0x5661('0x20')](respondWithResult(_0x17ac26,0xc9))[_0x5661('0x43')](handleError(_0x17ac26,null));};exports[_0x5661('0x44')]=function(_0x3ba445,_0x157b72){if(_0x3ba445['body']['id']){delete _0x3ba445[_0x5661('0x42')]['id'];}return db[_0x5661('0x26')][_0x5661('0x40')]({'where':{'id':_0x3ba445[_0x5661('0x3a')]['id']}})[_0x5661('0x20')](handleEntityNotFound(_0x157b72,null))[_0x5661('0x20')](saveUpdates(_0x3ba445[_0x5661('0x42')],null))[_0x5661('0x20')](respondWithResult(_0x157b72,null))[_0x5661('0x43')](handleError(_0x157b72,null));};exports[_0x5661('0x21')]=function(_0x206a92,_0xa07bf5){return db['SugarcrmConfiguration'][_0x5661('0x40')]({'where':{'id':_0x206a92['params']['id']}})[_0x5661('0x20')](handleEntityNotFound(_0xa07bf5,null))[_0x5661('0x20')](removeEntity(_0xa07bf5,null))[_0x5661('0x43')](handleError(_0xa07bf5,null));};exports[_0x5661('0x45')]=function(_0x5df848,_0x3e5573,_0x523e42){var _0x1dc768={};var _0x1c731e={};var _0x47ac15;var _0x5448cc;return db[_0x5661('0x26')]['findOne']({'where':{'id':_0x5df848[_0x5661('0x3a')]['id']}})[_0x5661('0x20')](handleEntityNotFound(_0x3e5573,null))['then'](function(_0x5cc81b){if(_0x5cc81b){_0x47ac15=_0x5cc81b;_0x1c731e[_0x5661('0x29')]=_['keys'](db[_0x5661('0x46')]['rawAttributes']);_0x1c731e['query']=_[_0x5661('0x3b')](_0x5df848['query']);_0x1c731e['filters']=_[_0x5661('0x2d')](_0x1c731e[_0x5661('0x29')],_0x1c731e[_0x5661('0x2b')]);_0x1dc768['attributes']=_[_0x5661('0x2d')](_0x1c731e[_0x5661('0x29')],qs[_0x5661('0x3c')](_0x5df848['query'][_0x5661('0x3c')]));_0x1dc768['attributes']=_0x1dc768[_0x5661('0x2e')][_0x5661('0x3d')]?_0x1dc768['attributes']:_0x1c731e[_0x5661('0x29')];_0x1dc768[_0x5661('0x31')]=qs[_0x5661('0x32')](_0x5df848[_0x5661('0x2b')][_0x5661('0x32')]);_0x1dc768[_0x5661('0x33')]=qs[_0x5661('0x2c')](_[_0x5661('0x34')](_0x5df848[_0x5661('0x2b')],_0x1c731e[_0x5661('0x2c')]));if(_0x5df848['query'][_0x5661('0x47')]){_0x1dc768['where']=_[_0x5661('0x35')](_0x1dc768[_0x5661('0x33')],{'$or':_['map'](_0x1dc768[_0x5661('0x2e')],function(_0x55ffc7){var _0x291dcb={};_0x291dcb[_0x55ffc7]={'$like':'%'+_0x5df848[_0x5661('0x2b')][_0x5661('0x47')]+'%'};return _0x291dcb;})});}_0x1dc768=_[_0x5661('0x35')]({},_0x1dc768,_0x5df848[_0x5661('0x3f')]);return _0x47ac15[_0x5661('0x45')](_0x1dc768);}})[_0x5661('0x20')](function(_0x7671ed){if(_0x7671ed){_0x5448cc=_0x7671ed[_0x5661('0x3d')];if(!_0x5df848['query']['hasOwnProperty']('nolimit')){_0x1dc768[_0x5661('0x1c')]=qs['limit'](_0x5df848[_0x5661('0x2b')]['limit']);_0x1dc768[_0x5661('0x19')]=qs['offset'](_0x5df848[_0x5661('0x2b')][_0x5661('0x19')]);}return _0x47ac15[_0x5661('0x45')](_0x1dc768);}})[_0x5661('0x20')](function(_0x3d3a45){if(_0x3d3a45){return _0x3d3a45?{'count':_0x5448cc,'rows':_0x3d3a45}:null;}})[_0x5661('0x20')](respondWithResult(_0x3e5573,null))[_0x5661('0x43')](handleError(_0x3e5573,null));};exports['getSubjects']=function(_0x278e1c,_0x2235dc,_0x485a58){var _0x159c98={};var _0x49d868={};var _0x534909;var _0x430c87;return db[_0x5661('0x26')]['findOne']({'where':{'id':_0x278e1c[_0x5661('0x3a')]['id']}})[_0x5661('0x20')](handleEntityNotFound(_0x2235dc,null))[_0x5661('0x20')](function(_0x5c552c){if(_0x5c552c){_0x534909=_0x5c552c;_0x49d868[_0x5661('0x29')]=_[_0x5661('0x3b')](db[_0x5661('0x46')][_0x5661('0x27')]);_0x49d868[_0x5661('0x2b')]=_[_0x5661('0x3b')](_0x278e1c[_0x5661('0x2b')]);_0x49d868[_0x5661('0x2c')]=_[_0x5661('0x2d')](_0x49d868[_0x5661('0x29')],_0x49d868['query']);_0x159c98[_0x5661('0x2e')]=_[_0x5661('0x2d')](_0x49d868['model'],qs[_0x5661('0x3c')](_0x278e1c[_0x5661('0x2b')]['fields']));_0x159c98[_0x5661('0x2e')]=_0x159c98[_0x5661('0x2e')][_0x5661('0x3d')]?_0x159c98[_0x5661('0x2e')]:_0x49d868[_0x5661('0x29')];_0x159c98['order']=qs[_0x5661('0x32')](_0x278e1c['query']['sort']);_0x159c98[_0x5661('0x33')]=qs[_0x5661('0x2c')](_[_0x5661('0x34')](_0x278e1c[_0x5661('0x2b')],_0x49d868[_0x5661('0x2c')]));if(_0x278e1c[_0x5661('0x2b')]['filter']){_0x159c98[_0x5661('0x33')]=_['merge'](_0x159c98[_0x5661('0x33')],{'$or':_[_0x5661('0x2a')](_0x159c98[_0x5661('0x2e')],function(_0x2764c9){var _0x1eb8e0={};_0x1eb8e0[_0x2764c9]={'$like':'%'+_0x278e1c[_0x5661('0x2b')]['filter']+'%'};return _0x1eb8e0;})});}_0x159c98=_[_0x5661('0x35')]({},_0x159c98,_0x278e1c['options']);return _0x534909[_0x5661('0x48')](_0x159c98);}})['then'](function(_0x5caf5e){if(_0x5caf5e){_0x430c87=_0x5caf5e[_0x5661('0x3d')];if(!_0x278e1c['query'][_0x5661('0x2f')](_0x5661('0x30'))){_0x159c98['limit']=qs[_0x5661('0x1c')](_0x278e1c[_0x5661('0x2b')][_0x5661('0x1c')]);_0x159c98[_0x5661('0x19')]=qs[_0x5661('0x19')](_0x278e1c[_0x5661('0x2b')]['offset']);}return _0x534909[_0x5661('0x48')](_0x159c98);}})[_0x5661('0x20')](function(_0xa736db){if(_0xa736db){return _0xa736db?{'count':_0x430c87,'rows':_0xa736db}:null;}})[_0x5661('0x20')](respondWithResult(_0x2235dc,null))[_0x5661('0x43')](handleError(_0x2235dc,null));};exports[_0x5661('0x49')]=function(_0x1b253a,_0x432aa2,_0x1cc404){var _0x47a65e={};var _0x434e34={};var _0x3713f8;var _0x53bb31;return db[_0x5661('0x26')][_0x5661('0x4a')]({'where':{'id':_0x1b253a[_0x5661('0x3a')]['id']}})[_0x5661('0x20')](handleEntityNotFound(_0x432aa2,null))[_0x5661('0x20')](function(_0xc85c77){if(_0xc85c77){_0x3713f8=_0xc85c77;_0x434e34[_0x5661('0x29')]=_[_0x5661('0x3b')](db[_0x5661('0x46')][_0x5661('0x27')]);_0x434e34[_0x5661('0x2b')]=_['keys'](_0x1b253a['query']);_0x434e34[_0x5661('0x2c')]=_['intersection'](_0x434e34[_0x5661('0x29')],_0x434e34[_0x5661('0x2b')]);_0x47a65e[_0x5661('0x2e')]=_[_0x5661('0x2d')](_0x434e34[_0x5661('0x29')],qs[_0x5661('0x3c')](_0x1b253a[_0x5661('0x2b')][_0x5661('0x3c')]));_0x47a65e[_0x5661('0x2e')]=_0x47a65e[_0x5661('0x2e')]['length']?_0x47a65e[_0x5661('0x2e')]:_0x434e34[_0x5661('0x29')];_0x47a65e[_0x5661('0x31')]=qs[_0x5661('0x32')](_0x1b253a[_0x5661('0x2b')][_0x5661('0x32')]);_0x47a65e[_0x5661('0x33')]=qs[_0x5661('0x2c')](_[_0x5661('0x34')](_0x1b253a['query'],_0x434e34[_0x5661('0x2c')]));if(_0x1b253a[_0x5661('0x2b')]['filter']){_0x47a65e['where']=_[_0x5661('0x35')](_0x47a65e[_0x5661('0x33')],{'$or':_['map'](_0x47a65e[_0x5661('0x2e')],function(_0x30fc7b){var _0x3d263f={};_0x3d263f[_0x30fc7b]={'$like':'%'+_0x1b253a[_0x5661('0x2b')][_0x5661('0x47')]+'%'};return _0x3d263f;})});}_0x47a65e=_[_0x5661('0x35')]({},_0x47a65e,_0x1b253a[_0x5661('0x3f')]);return _0x3713f8[_0x5661('0x49')](_0x47a65e);}})[_0x5661('0x20')](function(_0x5e3a86){if(_0x5e3a86){_0x53bb31=_0x5e3a86[_0x5661('0x3d')];if(!_0x1b253a[_0x5661('0x2b')][_0x5661('0x2f')]('nolimit')){_0x47a65e['limit']=qs[_0x5661('0x1c')](_0x1b253a[_0x5661('0x2b')][_0x5661('0x1c')]);_0x47a65e['offset']=qs[_0x5661('0x19')](_0x1b253a[_0x5661('0x2b')][_0x5661('0x19')]);}return _0x3713f8['getDescriptions'](_0x47a65e);}})[_0x5661('0x20')](function(_0x289505){if(_0x289505){return _0x289505?{'count':_0x53bb31,'rows':_0x289505}:null;}})[_0x5661('0x20')](respondWithResult(_0x432aa2,null))['catch'](handleError(_0x432aa2,null));};
\ No newline at end of file
index ed5ca64..a1962b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4066=['exports','define','int_sugarcrm_configurations','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes'];(function(_0x59e690,_0x27bad7){var _0x38835a=function(_0x223f76){while(--_0x223f76){_0x59e690['push'](_0x59e690['shift']());}};_0x38835a(++_0x27bad7);}(_0x4066,0xd4));var _0x6406=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4066[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x6406('0x0'));var util=require('util');var logger=require(_0x6406('0x1'))(_0x6406('0x2'));var moment=require(_0x6406('0x3'));var BPromise=require('bluebird');var rp=require(_0x6406('0x4'));var fs=require('fs');var path=require(_0x6406('0x5'));var rimraf=require('rimraf');var config=require(_0x6406('0x6'));var attributes=require(_0x6406('0x7'));module[_0x6406('0x8')]=function(_0x3c18ed,_0x3f6a4d){return _0x3c18ed[_0x6406('0x9')]('SugarcrmConfiguration',attributes,{'tableName':_0x6406('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6e66=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','int_sugarcrm_configurations','lodash','util'];(function(_0x227408,_0x55fca){var _0x1a67e2=function(_0x12e2d8){while(--_0x12e2d8){_0x227408['push'](_0x227408['shift']());}};_0x1a67e2(++_0x55fca);}(_0x6e66,0x184));var _0x66e6=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x6e66[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require(_0x66e6('0x0'));var util=require(_0x66e6('0x1'));var logger=require(_0x66e6('0x2'))(_0x66e6('0x3'));var moment=require('moment');var BPromise=require(_0x66e6('0x4'));var rp=require(_0x66e6('0x5'));var fs=require('fs');var path=require(_0x66e6('0x6'));var rimraf=require(_0x66e6('0x7'));var config=require(_0x66e6('0x8'));var attributes=require(_0x66e6('0x9'));module[_0x66e6('0xa')]=function(_0x40fd90,_0x9c9507){return _0x40fd90[_0x66e6('0xb')]('SugarcrmConfiguration',attributes,{'tableName':_0x66e6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5300baf..48a098f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb379=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x155eef,_0x394e3d){var _0xd9afcd=function(_0x5b52bc){while(--_0x5b52bc){_0x155eef['push'](_0x155eef['shift']());}};_0xd9afcd(++_0x394e3d);}(_0xb379,0x1e7));var _0x9b37=function(_0x2fb309,_0x52e4eb){_0x2fb309=_0x2fb309-0x0;var _0x58e532=_0xb379[_0x2fb309];return _0x58e532;};'use strict';var _=require(_0x9b37('0x0'));var util=require(_0x9b37('0x1'));var moment=require(_0x9b37('0x2'));var BPromise=require('bluebird');var rs=require(_0x9b37('0x3'));var fs=require('fs');var Redis=require(_0x9b37('0x4'));var db=require(_0x9b37('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b37('0x6'))(_0x9b37('0x7'));var config=require(_0x9b37('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9b37('0x9')][_0x9b37('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ebff5,_0x11f052,_0x3fe11d){return new BPromise(function(_0x51024f,_0x22c574){return client[_0x9b37('0xb')](_0x3ebff5,_0x3fe11d)[_0x9b37('0xc')](function(_0x18091c){logger[_0x9b37('0xd')](_0x9b37('0xe'),_0x11f052,_0x9b37('0xf'));logger[_0x9b37('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x11f052,_0x9b37('0xf'),JSON['stringify'](_0x18091c));if(_0x18091c['error']){if(_0x18091c[_0x9b37('0x11')][_0x9b37('0x12')]===0x1f4){logger[_0x9b37('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x11f052,_0x18091c[_0x9b37('0x11')][_0x9b37('0x13')]);return _0x22c574(_0x18091c[_0x9b37('0x11')][_0x9b37('0x13')]);}logger[_0x9b37('0x11')](_0x9b37('0xe'),_0x11f052,_0x18091c[_0x9b37('0x11')]['message']);return _0x51024f(_0x18091c[_0x9b37('0x11')][_0x9b37('0x13')]);}else{logger['info'](_0x9b37('0xe'),_0x11f052,_0x9b37('0xf'));_0x51024f(_0x18091c[_0x9b37('0x14')][_0x9b37('0x13')]);}})[_0x9b37('0x15')](function(_0x1846eb){logger[_0x9b37('0x11')](_0x9b37('0xe'),_0x11f052,_0x1846eb);_0x22c574(_0x1846eb);});});}
\ No newline at end of file
+var _0x9d2c=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch'];(function(_0x3bab6e,_0x42ded4){var _0x2e393a=function(_0x39ef5b){while(--_0x39ef5b){_0x3bab6e['push'](_0x3bab6e['shift']());}};_0x2e393a(++_0x42ded4);}(_0x9d2c,0xb0));var _0xc9d2=function(_0x285b8d,_0x3541df){_0x285b8d=_0x285b8d-0x0;var _0x5ee662=_0x9d2c[_0x285b8d];return _0x5ee662;};'use strict';var _=require(_0xc9d2('0x0'));var util=require(_0xc9d2('0x1'));var moment=require(_0xc9d2('0x2'));var BPromise=require(_0xc9d2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc9d2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9d2('0x5'));var logger=require(_0xc9d2('0x6'))('rpc');var config=require(_0xc9d2('0x7'));var jayson=require(_0xc9d2('0x8'));var client=jayson[_0xc9d2('0x9')][_0xc9d2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x168d4a,_0x3f23a0,_0x16a604){return new BPromise(function(_0x233115,_0x161791){return client['request'](_0x168d4a,_0x16a604)[_0xc9d2('0xb')](function(_0x377d8f){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x3f23a0,'request\x20sent');logger[_0xc9d2('0xc')](_0xc9d2('0xd'),_0x3f23a0,_0xc9d2('0xe'),JSON[_0xc9d2('0xf')](_0x377d8f));if(_0x377d8f[_0xc9d2('0x10')]){if(_0x377d8f['error'][_0xc9d2('0x11')]===0x1f4){logger[_0xc9d2('0x10')](_0xc9d2('0x12'),_0x3f23a0,_0x377d8f[_0xc9d2('0x10')][_0xc9d2('0x13')]);return _0x161791(_0x377d8f[_0xc9d2('0x10')][_0xc9d2('0x13')]);}logger[_0xc9d2('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x3f23a0,_0x377d8f[_0xc9d2('0x10')][_0xc9d2('0x13')]);return _0x233115(_0x377d8f[_0xc9d2('0x10')]['message']);}else{logger['info'](_0xc9d2('0x12'),_0x3f23a0,'request\x20sent');_0x233115(_0x377d8f[_0xc9d2('0x14')][_0xc9d2('0x13')]);}})[_0xc9d2('0x15')](function(_0x4bc5bb){logger[_0xc9d2('0x10')](_0xc9d2('0x12'),_0x3f23a0,_0x4bc5bb);_0x161791(_0x4bc5bb);});});}
\ No newline at end of file
index ed33800..3ce40d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ded=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0xb842e9,_0x4fd69c){var _0x4fd6a4=function(_0x209ced){while(--_0x209ced){_0xb842e9['push'](_0xb842e9['shift']());}};_0x4fd6a4(++_0x4fd69c);}(_0x6ded,0x13a));var _0xd6de=function(_0x326198,_0x29bda7){_0x326198=_0x326198-0x0;var _0x589a08=_0x6ded[_0x326198];return _0x589a08;};'use strict';var multer=require(_0xd6de('0x0'));var util=require(_0xd6de('0x1'));var path=require(_0xd6de('0x2'));var timeout=require(_0xd6de('0x3'));var express=require(_0xd6de('0x4'));var router=express[_0xd6de('0x5')]();var fs_extra=require(_0xd6de('0x6'));var auth=require(_0xd6de('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd6de('0x8'));var controller=require(_0xd6de('0x9'));router[_0xd6de('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd6de('0xa')](_0xd6de('0xb'),auth[_0xd6de('0xc')](),controller[_0xd6de('0xd')]);router[_0xd6de('0xe')]('/',auth[_0xd6de('0xc')](),controller[_0xd6de('0xf')]);router[_0xd6de('0x10')](_0xd6de('0xb'),auth[_0xd6de('0xc')](),controller[_0xd6de('0x11')]);router[_0xd6de('0x12')](_0xd6de('0xb'),auth[_0xd6de('0xc')](),controller[_0xd6de('0x13')]);module[_0xd6de('0x14')]=router;
\ No newline at end of file
+var _0x4a60=['isAuthenticated','index','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get'];(function(_0x408de5,_0x24fa7b){var _0x2015a1=function(_0x13082c){while(--_0x13082c){_0x408de5['push'](_0x408de5['shift']());}};_0x2015a1(++_0x24fa7b);}(_0x4a60,0x16e));var _0x04a6=function(_0x504e8c,_0x563d11){_0x504e8c=_0x504e8c-0x0;var _0xcae156=_0x4a60[_0x504e8c];return _0xcae156;};'use strict';var multer=require(_0x04a6('0x0'));var util=require(_0x04a6('0x1'));var path=require(_0x04a6('0x2'));var timeout=require(_0x04a6('0x3'));var express=require(_0x04a6('0x4'));var router=express[_0x04a6('0x5')]();var fs_extra=require(_0x04a6('0x6'));var auth=require(_0x04a6('0x7'));var interaction=require(_0x04a6('0x8'));var config=require(_0x04a6('0x9'));var controller=require(_0x04a6('0xa'));router[_0x04a6('0xb')]('/',auth[_0x04a6('0xc')](),controller[_0x04a6('0xd')]);router[_0x04a6('0xb')](_0x04a6('0xe'),auth[_0x04a6('0xc')](),controller[_0x04a6('0xf')]);router[_0x04a6('0x10')]('/',auth[_0x04a6('0xc')](),controller[_0x04a6('0x11')]);router['put'](_0x04a6('0xe'),auth[_0x04a6('0xc')](),controller[_0x04a6('0x12')]);router['delete'](_0x04a6('0xe'),auth[_0x04a6('0xc')](),controller[_0x04a6('0x13')]);module[_0x04a6('0x14')]=router;
\ No newline at end of file
index d417952..690371f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81ae=['customVariable','BOOLEAN','sequelize','ENUM','string','keyValue','picklist','STRING','variable'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0x81ae,0x1df));var _0xe81a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x81ae[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0xe81a('0x0'));module['exports']={'type':{'type':Sequelize[_0xe81a('0x1')](_0xe81a('0x2'),'variable','customVariable',_0xe81a('0x3'),_0xe81a('0x4')),'defaultValue':_0xe81a('0x2')},'content':{'type':Sequelize[_0xe81a('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe81a('0x1')]('string',_0xe81a('0x6'),_0xe81a('0x7'))},'keyContent':{'type':Sequelize[_0xe81a('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe81a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe81a('0x5')]}};
\ No newline at end of file
+var _0x70a3=['ENUM','string','variable','picklist','customVariable','STRING','BOOLEAN','exports'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x70a3,0x1ef));var _0x370a=function(_0x318db4,_0x35c723){_0x318db4=_0x318db4-0x0;var _0x54d2b4=_0x70a3[_0x318db4];return _0x54d2b4;};'use strict';var Sequelize=require('sequelize');module[_0x370a('0x0')]={'type':{'type':Sequelize[_0x370a('0x1')](_0x370a('0x2'),_0x370a('0x3'),'customVariable','keyValue',_0x370a('0x4')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x370a('0x2'),_0x370a('0x3'),_0x370a('0x5'))},'keyContent':{'type':Sequelize[_0x370a('0x6')]},'idField':{'type':Sequelize[_0x370a('0x6')]},'nameField':{'type':Sequelize[_0x370a('0x6')]},'customField':{'type':Sequelize[_0x370a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 012b754..b3ffd60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x907b=['offset','undefined','limit','count','set','Content-Range','apply','then','destroy','error','stack','name','send','map','SugarcrmField','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','type','merge','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','update','body','params','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x3f457f,_0x248ce9){var _0x5a7bc7=function(_0x383985){while(--_0x383985){_0x3f457f['push'](_0x3f457f['shift']());}};_0x5a7bc7(++_0x248ce9);}(_0x907b,0x1ae));var _0xb907=function(_0x5709ea,_0x5c0089){_0x5709ea=_0x5709ea-0x0;var _0x1998b4=_0x907b[_0x5709ea];return _0x1998b4;};'use strict';var emlformat=require(_0xb907('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb907('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb907('0x2'));var moment=require(_0xb907('0x3'));var BPromise=require(_0xb907('0x4'));var Mustache=require(_0xb907('0x5'));var util=require(_0xb907('0x6'));var path=require(_0xb907('0x7'));var sox=require(_0xb907('0x8'));var csv=require(_0xb907('0x9'));var ejs=require(_0xb907('0xa'));var fs=require('fs');var fs_extra=require(_0xb907('0xb'));var _=require(_0xb907('0xc'));var squel=require(_0xb907('0xd'));var crypto=require(_0xb907('0xe'));var jsforce=require(_0xb907('0xf'));var deskjs=require(_0xb907('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb907('0x11'));var Papa=require(_0xb907('0x12'));var Redis=require(_0xb907('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb907('0x14'));var as=require(_0xb907('0x15'));var hardwareService=require(_0xb907('0x16'));var logger=require(_0xb907('0x17'))('api');var utils=require(_0xb907('0x18'));var config=require(_0xb907('0x19'));var licenseUtil=require(_0xb907('0x1a'));var db=require(_0xb907('0x1b'))['db'];function respondWithStatusCode(_0x764cda,_0x5c6d1f){_0x5c6d1f=_0x5c6d1f||0xcc;return function(_0x2ddad9){if(_0x2ddad9){return _0x764cda[_0xb907('0x1c')](_0x5c6d1f);}return _0x764cda[_0xb907('0x1d')](_0x5c6d1f)[_0xb907('0x1e')]();};}function respondWithResult(_0x3cb89d,_0x305d4f){_0x305d4f=_0x305d4f||0xc8;return function(_0x4d1ff5){if(_0x4d1ff5){return _0x3cb89d['status'](_0x305d4f)[_0xb907('0x1f')](_0x4d1ff5);}};}function respondWithFilteredResult(_0x58d7f5,_0x3dc2a4){return function(_0x10ccc6){if(_0x10ccc6){var _0x1815f5=typeof _0x3dc2a4[_0xb907('0x20')]===_0xb907('0x21')&&typeof _0x3dc2a4[_0xb907('0x22')]===_0xb907('0x21');var _0x4431ee=_0x10ccc6['count'];var _0x357a28=_0x1815f5?0x0:_0x3dc2a4['offset'];var _0xe15ae5=_0x1815f5?_0x10ccc6[_0xb907('0x23')]:_0x3dc2a4[_0xb907('0x20')]+_0x3dc2a4[_0xb907('0x22')];var _0x5e2c15;if(_0xe15ae5>=_0x4431ee){_0xe15ae5=_0x4431ee;_0x5e2c15=0xc8;}else{_0x5e2c15=0xce;}_0x58d7f5[_0xb907('0x1d')](_0x5e2c15);return _0x58d7f5[_0xb907('0x24')](_0xb907('0x25'),_0x357a28+'-'+_0xe15ae5+'/'+_0x4431ee)[_0xb907('0x1f')](_0x10ccc6);}return null;};}function patchUpdates(_0x240ce9){return function(_0x22385b){try{jsonpatch[_0xb907('0x26')](_0x22385b,_0x240ce9,!![]);}catch(_0x24f101){return BPromise['reject'](_0x24f101);}return _0x22385b['save']();};}function saveUpdates(_0x301f42,_0x31042c){return function(_0x126e17){if(_0x126e17){return _0x126e17['update'](_0x301f42)[_0xb907('0x27')](function(_0x4cdb4d){return _0x4cdb4d;});}return null;};}function removeEntity(_0x397663,_0x1b5a50){return function(_0x1707dd){if(_0x1707dd){return _0x1707dd[_0xb907('0x28')]()[_0xb907('0x27')](function(){_0x397663[_0xb907('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1722a7,_0x29245e){return function(_0x35dbbe){if(!_0x35dbbe){_0x1722a7['sendStatus'](0x194);}return _0x35dbbe;};}function handleError(_0x133cf7,_0x2c3d22){_0x2c3d22=_0x2c3d22||0x1f4;return function(_0x465174){logger[_0xb907('0x29')](_0x465174[_0xb907('0x2a')]);if(_0x465174[_0xb907('0x2b')]){delete _0x465174[_0xb907('0x2b')];}_0x133cf7[_0xb907('0x1d')](_0x2c3d22)[_0xb907('0x2c')](_0x465174);};}exports['index']=function(_0x5179b8,_0xba03c2){var _0x3c098a={},_0x23542b={},_0x551ea5={'count':0x0,'rows':[]};var _0x325efa=_[_0xb907('0x2d')](db[_0xb907('0x2e')]['rawAttributes'],function(_0x4ba4a8){return{'name':_0x4ba4a8['fieldName'],'type':_0x4ba4a8['type'][_0xb907('0x2f')]};});_0x23542b[_0xb907('0x30')]=_[_0xb907('0x2d')](_0x325efa,_0xb907('0x2b'));_0x23542b[_0xb907('0x31')]=_[_0xb907('0x32')](_0x5179b8[_0xb907('0x31')]);_0x23542b[_0xb907('0x33')]=_[_0xb907('0x34')](_0x23542b[_0xb907('0x30')],_0x23542b[_0xb907('0x31')]);_0x3c098a['attributes']=_[_0xb907('0x34')](_0x23542b['model'],qs[_0xb907('0x35')](_0x5179b8['query']['fields']));_0x3c098a['attributes']=_0x3c098a[_0xb907('0x36')][_0xb907('0x37')]?_0x3c098a[_0xb907('0x36')]:_0x23542b[_0xb907('0x30')];if(!_0x5179b8['query'][_0xb907('0x38')](_0xb907('0x39'))){_0x3c098a[_0xb907('0x22')]=qs[_0xb907('0x22')](_0x5179b8[_0xb907('0x31')][_0xb907('0x22')]);_0x3c098a[_0xb907('0x20')]=qs['offset'](_0x5179b8['query'][_0xb907('0x20')]);}_0x3c098a[_0xb907('0x3a')]=qs['sort'](_0x5179b8['query']['sort']);_0x3c098a[_0xb907('0x3b')]=qs[_0xb907('0x33')](_[_0xb907('0x3c')](_0x5179b8['query'],_0x23542b[_0xb907('0x33')]),_0x325efa);if(_0x5179b8['query'][_0xb907('0x3d')]){_0x3c098a[_0xb907('0x3b')]=_['merge'](_0x3c098a[_0xb907('0x3b')],{'$or':_[_0xb907('0x2d')](_0x325efa,function(_0x1d0bb6){if(_0x1d0bb6[_0xb907('0x3e')]!=='VIRTUAL'){var _0x44164a={};_0x44164a[_0x1d0bb6[_0xb907('0x2b')]]={'$like':'%'+_0x5179b8[_0xb907('0x31')][_0xb907('0x3d')]+'%'};return _0x44164a;}})});}_0x3c098a=_[_0xb907('0x3f')]({},_0x3c098a,_0x5179b8['options']);var _0x4f2279={'where':_0x3c098a[_0xb907('0x3b')]};return db[_0xb907('0x2e')]['count'](_0x4f2279)[_0xb907('0x27')](function(_0xee301d){_0x551ea5['count']=_0xee301d;if(_0x5179b8[_0xb907('0x31')][_0xb907('0x40')]){_0x3c098a[_0xb907('0x41')]=[{'all':!![]}];}return db[_0xb907('0x2e')][_0xb907('0x42')](_0x3c098a);})[_0xb907('0x27')](function(_0x2cc167){_0x551ea5[_0xb907('0x43')]=_0x2cc167;return _0x551ea5;})[_0xb907('0x27')](respondWithFilteredResult(_0xba03c2,_0x3c098a))[_0xb907('0x44')](handleError(_0xba03c2,null));};exports[_0xb907('0x45')]=function(_0x2faeef,_0x2df0b3){var _0x34f33e={'raw':!![],'where':{'id':_0x2faeef['params']['id']}},_0x2688c5={};_0x2688c5[_0xb907('0x30')]=_[_0xb907('0x32')](db['SugarcrmField'][_0xb907('0x46')]);_0x2688c5['query']=_[_0xb907('0x32')](_0x2faeef['query']);_0x2688c5[_0xb907('0x33')]=_[_0xb907('0x34')](_0x2688c5[_0xb907('0x30')],_0x2688c5[_0xb907('0x31')]);_0x34f33e[_0xb907('0x36')]=_[_0xb907('0x34')](_0x2688c5[_0xb907('0x30')],qs[_0xb907('0x35')](_0x2faeef[_0xb907('0x31')]['fields']));_0x34f33e[_0xb907('0x36')]=_0x34f33e[_0xb907('0x36')][_0xb907('0x37')]?_0x34f33e[_0xb907('0x36')]:_0x2688c5[_0xb907('0x30')];if(_0x2faeef[_0xb907('0x31')][_0xb907('0x40')]){_0x34f33e[_0xb907('0x41')]=[{'all':!![]}];}_0x34f33e=_[_0xb907('0x3f')]({},_0x34f33e,_0x2faeef[_0xb907('0x47')]);return db[_0xb907('0x2e')][_0xb907('0x48')](_0x34f33e)[_0xb907('0x27')](handleEntityNotFound(_0x2df0b3,null))[_0xb907('0x27')](respondWithResult(_0x2df0b3,null))[_0xb907('0x44')](handleError(_0x2df0b3,null));};exports[_0xb907('0x49')]=function(_0x4786bf,_0x485c1a){return db[_0xb907('0x2e')][_0xb907('0x49')](_0x4786bf['body'],{})[_0xb907('0x27')](respondWithResult(_0x485c1a,0xc9))[_0xb907('0x44')](handleError(_0x485c1a,null));};exports[_0xb907('0x4a')]=function(_0x3f507a,_0x3e9e17){if(_0x3f507a[_0xb907('0x4b')]['id']){delete _0x3f507a[_0xb907('0x4b')]['id'];}return db[_0xb907('0x2e')][_0xb907('0x48')]({'where':{'id':_0x3f507a[_0xb907('0x4c')]['id']}})[_0xb907('0x27')](handleEntityNotFound(_0x3e9e17,null))['then'](saveUpdates(_0x3f507a[_0xb907('0x4b')],null))['then'](respondWithResult(_0x3e9e17,null))[_0xb907('0x44')](handleError(_0x3e9e17,null));};exports['destroy']=function(_0x232c07,_0x34a33c){return db[_0xb907('0x2e')][_0xb907('0x48')]({'where':{'id':_0x232c07[_0xb907('0x4c')]['id']}})[_0xb907('0x27')](handleEntityNotFound(_0x34a33c,null))[_0xb907('0x27')](removeEntity(_0x34a33c,null))['catch'](handleError(_0x34a33c,null));};
\ No newline at end of file
+var _0x0f30=['apply','reject','save','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','order','sort','where','pick','filter','merge','SugarcrmField','includeAll','include','rows','show','params','intersection','length','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set'];(function(_0x2d1900,_0x44e722){var _0x2bbf0c=function(_0x40a723){while(--_0x40a723){_0x2d1900['push'](_0x2d1900['shift']());}};_0x2bbf0c(++_0x44e722);}(_0x0f30,0xfb));var _0x00f3=function(_0x5482f4,_0x150cac){_0x5482f4=_0x5482f4-0x0;var _0x42d1ec=_0x0f30[_0x5482f4];return _0x42d1ec;};'use strict';var emlformat=require(_0x00f3('0x0'));var rimraf=require(_0x00f3('0x1'));var zipdir=require(_0x00f3('0x2'));var jsonpatch=require(_0x00f3('0x3'));var rp=require('request-promise');var moment=require(_0x00f3('0x4'));var BPromise=require(_0x00f3('0x5'));var Mustache=require(_0x00f3('0x6'));var util=require('util');var path=require(_0x00f3('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x00f3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x00f3('0x9'));var crypto=require(_0x00f3('0xa'));var jsforce=require(_0x00f3('0xb'));var deskjs=require(_0x00f3('0xc'));var toCsv=require(_0x00f3('0xd'));var querystring=require(_0x00f3('0xe'));var Papa=require(_0x00f3('0xf'));var Redis=require(_0x00f3('0x10'));var authService=require(_0x00f3('0x11'));var qs=require(_0x00f3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x00f3('0x13'));var logger=require(_0x00f3('0x14'))(_0x00f3('0x15'));var utils=require(_0x00f3('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x00f3('0x17'))['db'];function respondWithStatusCode(_0x33c28c,_0x5dd6ab){_0x5dd6ab=_0x5dd6ab||0xcc;return function(_0x52b1c6){if(_0x52b1c6){return _0x33c28c[_0x00f3('0x18')](_0x5dd6ab);}return _0x33c28c[_0x00f3('0x19')](_0x5dd6ab)[_0x00f3('0x1a')]();};}function respondWithResult(_0x2f14ba,_0x3821b1){_0x3821b1=_0x3821b1||0xc8;return function(_0x5b4da2){if(_0x5b4da2){return _0x2f14ba[_0x00f3('0x19')](_0x3821b1)[_0x00f3('0x1b')](_0x5b4da2);}};}function respondWithFilteredResult(_0x5b1d47,_0x3a25fc){return function(_0x46df76){if(_0x46df76){var _0x55d98f=typeof _0x3a25fc[_0x00f3('0x1c')]==='undefined'&&typeof _0x3a25fc[_0x00f3('0x1d')]===_0x00f3('0x1e');var _0x4b8042=_0x46df76[_0x00f3('0x1f')];var _0x2df741=_0x55d98f?0x0:_0x3a25fc[_0x00f3('0x1c')];var _0x3f30e0=_0x55d98f?_0x46df76[_0x00f3('0x1f')]:_0x3a25fc[_0x00f3('0x1c')]+_0x3a25fc['limit'];var _0x36fd93;if(_0x3f30e0>=_0x4b8042){_0x3f30e0=_0x4b8042;_0x36fd93=0xc8;}else{_0x36fd93=0xce;}_0x5b1d47['status'](_0x36fd93);return _0x5b1d47[_0x00f3('0x20')]('Content-Range',_0x2df741+'-'+_0x3f30e0+'/'+_0x4b8042)['json'](_0x46df76);}return null;};}function patchUpdates(_0x11db45){return function(_0x41a896){try{jsonpatch[_0x00f3('0x21')](_0x41a896,_0x11db45,!![]);}catch(_0x309e0c){return BPromise[_0x00f3('0x22')](_0x309e0c);}return _0x41a896[_0x00f3('0x23')]();};}function saveUpdates(_0x3b014b,_0x67b41a){return function(_0x666c7e){if(_0x666c7e){return _0x666c7e['update'](_0x3b014b)[_0x00f3('0x24')](function(_0x20c6c9){return _0x20c6c9;});}return null;};}function removeEntity(_0x400cf5,_0x497b7a){return function(_0x159fdf){if(_0x159fdf){return _0x159fdf['destroy']()['then'](function(){_0x400cf5[_0x00f3('0x19')](0xcc)[_0x00f3('0x1a')]();});}};}function handleEntityNotFound(_0x5998c5,_0x5a022e){return function(_0x11d4bb){if(!_0x11d4bb){_0x5998c5[_0x00f3('0x18')](0x194);}return _0x11d4bb;};}function handleError(_0x17da70,_0x3e543f){_0x3e543f=_0x3e543f||0x1f4;return function(_0x5465cc){logger[_0x00f3('0x25')](_0x5465cc['stack']);if(_0x5465cc[_0x00f3('0x26')]){delete _0x5465cc[_0x00f3('0x26')];}_0x17da70[_0x00f3('0x19')](_0x3e543f)[_0x00f3('0x27')](_0x5465cc);};}exports[_0x00f3('0x28')]=function(_0x5de49d,_0x4f1908){var _0x31b4b4={},_0x537fc4={},_0x6cc5f9={'count':0x0,'rows':[]};var _0x1410a7=_[_0x00f3('0x29')](db['SugarcrmField'][_0x00f3('0x2a')],function(_0xa2bc50){return{'name':_0xa2bc50[_0x00f3('0x2b')],'type':_0xa2bc50[_0x00f3('0x2c')][_0x00f3('0x2d')]};});_0x537fc4[_0x00f3('0x2e')]=_[_0x00f3('0x29')](_0x1410a7,_0x00f3('0x26'));_0x537fc4[_0x00f3('0x2f')]=_[_0x00f3('0x30')](_0x5de49d[_0x00f3('0x2f')]);_0x537fc4[_0x00f3('0x31')]=_['intersection'](_0x537fc4[_0x00f3('0x2e')],_0x537fc4[_0x00f3('0x2f')]);_0x31b4b4[_0x00f3('0x32')]=_['intersection'](_0x537fc4[_0x00f3('0x2e')],qs[_0x00f3('0x33')](_0x5de49d[_0x00f3('0x2f')]['fields']));_0x31b4b4['attributes']=_0x31b4b4[_0x00f3('0x32')]['length']?_0x31b4b4[_0x00f3('0x32')]:_0x537fc4['model'];if(!_0x5de49d['query']['hasOwnProperty']('nolimit')){_0x31b4b4['limit']=qs[_0x00f3('0x1d')](_0x5de49d['query'][_0x00f3('0x1d')]);_0x31b4b4[_0x00f3('0x1c')]=qs[_0x00f3('0x1c')](_0x5de49d[_0x00f3('0x2f')][_0x00f3('0x1c')]);}_0x31b4b4[_0x00f3('0x34')]=qs[_0x00f3('0x35')](_0x5de49d[_0x00f3('0x2f')][_0x00f3('0x35')]);_0x31b4b4[_0x00f3('0x36')]=qs[_0x00f3('0x31')](_[_0x00f3('0x37')](_0x5de49d[_0x00f3('0x2f')],_0x537fc4[_0x00f3('0x31')]),_0x1410a7);if(_0x5de49d['query']['filter']){_0x31b4b4[_0x00f3('0x36')]=_['merge'](_0x31b4b4['where'],{'$or':_[_0x00f3('0x29')](_0x1410a7,function(_0x118f57){if(_0x118f57[_0x00f3('0x2c')]!=='VIRTUAL'){var _0x389b1a={};_0x389b1a[_0x118f57['name']]={'$like':'%'+_0x5de49d[_0x00f3('0x2f')][_0x00f3('0x38')]+'%'};return _0x389b1a;}})});}_0x31b4b4=_[_0x00f3('0x39')]({},_0x31b4b4,_0x5de49d['options']);var _0x401cdb={'where':_0x31b4b4[_0x00f3('0x36')]};return db[_0x00f3('0x3a')][_0x00f3('0x1f')](_0x401cdb)[_0x00f3('0x24')](function(_0xbdd3e){_0x6cc5f9[_0x00f3('0x1f')]=_0xbdd3e;if(_0x5de49d[_0x00f3('0x2f')][_0x00f3('0x3b')]){_0x31b4b4[_0x00f3('0x3c')]=[{'all':!![]}];}return db[_0x00f3('0x3a')]['findAll'](_0x31b4b4);})[_0x00f3('0x24')](function(_0x562e50){_0x6cc5f9[_0x00f3('0x3d')]=_0x562e50;return _0x6cc5f9;})['then'](respondWithFilteredResult(_0x4f1908,_0x31b4b4))['catch'](handleError(_0x4f1908,null));};exports[_0x00f3('0x3e')]=function(_0x816b85,_0x2dca82){var _0x1e21c9={'raw':!![],'where':{'id':_0x816b85[_0x00f3('0x3f')]['id']}},_0x3b8ffa={};_0x3b8ffa[_0x00f3('0x2e')]=_[_0x00f3('0x30')](db['SugarcrmField'][_0x00f3('0x2a')]);_0x3b8ffa[_0x00f3('0x2f')]=_['keys'](_0x816b85['query']);_0x3b8ffa[_0x00f3('0x31')]=_[_0x00f3('0x40')](_0x3b8ffa[_0x00f3('0x2e')],_0x3b8ffa['query']);_0x1e21c9[_0x00f3('0x32')]=_[_0x00f3('0x40')](_0x3b8ffa[_0x00f3('0x2e')],qs[_0x00f3('0x33')](_0x816b85['query'][_0x00f3('0x33')]));_0x1e21c9[_0x00f3('0x32')]=_0x1e21c9[_0x00f3('0x32')][_0x00f3('0x41')]?_0x1e21c9['attributes']:_0x3b8ffa[_0x00f3('0x2e')];if(_0x816b85[_0x00f3('0x2f')][_0x00f3('0x3b')]){_0x1e21c9[_0x00f3('0x3c')]=[{'all':!![]}];}_0x1e21c9=_['merge']({},_0x1e21c9,_0x816b85[_0x00f3('0x42')]);return db[_0x00f3('0x3a')][_0x00f3('0x43')](_0x1e21c9)[_0x00f3('0x24')](handleEntityNotFound(_0x2dca82,null))[_0x00f3('0x24')](respondWithResult(_0x2dca82,null))['catch'](handleError(_0x2dca82,null));};exports['create']=function(_0x293383,_0x2a3bbc){return db[_0x00f3('0x3a')][_0x00f3('0x44')](_0x293383[_0x00f3('0x45')],{})[_0x00f3('0x24')](respondWithResult(_0x2a3bbc,0xc9))[_0x00f3('0x46')](handleError(_0x2a3bbc,null));};exports['update']=function(_0x208109,_0x161e1a){if(_0x208109[_0x00f3('0x45')]['id']){delete _0x208109['body']['id'];}return db[_0x00f3('0x3a')][_0x00f3('0x43')]({'where':{'id':_0x208109[_0x00f3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x161e1a,null))[_0x00f3('0x24')](saveUpdates(_0x208109[_0x00f3('0x45')],null))[_0x00f3('0x24')](respondWithResult(_0x161e1a,null))[_0x00f3('0x46')](handleError(_0x161e1a,null));};exports['destroy']=function(_0x3d14af,_0x354f31){return db['SugarcrmField']['find']({'where':{'id':_0x3d14af['params']['id']}})['then'](handleEntityNotFound(_0x354f31,null))[_0x00f3('0x24')](removeEntity(_0x354f31,null))[_0x00f3('0x46')](handleError(_0x354f31,null));};
\ No newline at end of file
index 18cf1de..8ff1c41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7908=['../../config/logger','api','moment','bluebird','path','rimraf','./intSugarcrmField.attributes','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash'];(function(_0x29f80e,_0x9027ff){var _0x5c7eaa=function(_0x48ec7c){while(--_0x48ec7c){_0x29f80e['push'](_0x29f80e['shift']());}};_0x5c7eaa(++_0x9027ff);}(_0x7908,0x14f));var _0x8790=function(_0x140a40,_0x3e4411){_0x140a40=_0x140a40-0x0;var _0x3f81c2=_0x7908[_0x140a40];return _0x3f81c2;};'use strict';var _=require(_0x8790('0x0'));var util=require('util');var logger=require(_0x8790('0x1'))(_0x8790('0x2'));var moment=require(_0x8790('0x3'));var BPromise=require(_0x8790('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8790('0x5'));var rimraf=require(_0x8790('0x6'));var config=require('../../config/environment');var attributes=require(_0x8790('0x7'));module['exports']=function(_0x20878a,_0x30e593){return _0x20878a[_0x8790('0x8')](_0x8790('0x9'),attributes,{'tableName':_0x8790('0xa'),'paranoid':![],'indexes':[{'name':_0x8790('0xb'),'fields':[_0x8790('0xc'),_0x8790('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x747b=['util','../../config/logger','api','bluebird','rimraf','../../config/environment','exports','SugarcrmField','int_sugarcrm_fields','FieldId','lodash'];(function(_0x915426,_0x1a0a05){var _0x1ab376=function(_0x5821ce){while(--_0x5821ce){_0x915426['push'](_0x915426['shift']());}};_0x1ab376(++_0x1a0a05);}(_0x747b,0xaf));var _0xb747=function(_0x335136,_0x131d00){_0x335136=_0x335136-0x0;var _0x234b60=_0x747b[_0x335136];return _0x234b60;};'use strict';var _=require(_0xb747('0x0'));var util=require(_0xb747('0x1'));var logger=require(_0xb747('0x2'))(_0xb747('0x3'));var moment=require('moment');var BPromise=require(_0xb747('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb747('0x5'));var config=require(_0xb747('0x6'));var attributes=require('./intSugarcrmField.attributes');module[_0xb747('0x7')]=function(_0x2f048f,_0x7d36a5){return _0x2f048f['define'](_0xb747('0x8'),attributes,{'tableName':_0xb747('0x9'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0xb747('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index c769b8b..f721247 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd420=['../../config/logger','rpc','../../config/environment','jayson/promise','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xd420,0x159));var _0x0d42=function(_0x275b1b,_0x50b4af){_0x275b1b=_0x275b1b-0x0;var _0x50c8d8=_0xd420[_0x275b1b];return _0x50c8d8;};'use strict';var _=require(_0x0d42('0x0'));var util=require(_0x0d42('0x1'));var moment=require(_0x0d42('0x2'));var BPromise=require(_0x0d42('0x3'));var rs=require(_0x0d42('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d42('0x5'))['db'];var utils=require(_0x0d42('0x6'));var logger=require(_0x0d42('0x7'))(_0x0d42('0x8'));var config=require(_0x0d42('0x9'));var jayson=require(_0x0d42('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x155ebd,_0x3a6af5,_0x2df02c){return new BPromise(function(_0x390bee,_0x1de1d4){return client['request'](_0x155ebd,_0x2df02c)[_0x0d42('0xb')](function(_0x27f362){logger[_0x0d42('0xc')](_0x0d42('0xd'),_0x3a6af5,_0x0d42('0xe'));logger[_0x0d42('0xf')](_0x0d42('0x10'),_0x3a6af5,_0x0d42('0xe'),JSON[_0x0d42('0x11')](_0x27f362));if(_0x27f362[_0x0d42('0x12')]){if(_0x27f362[_0x0d42('0x12')][_0x0d42('0x13')]===0x1f4){logger[_0x0d42('0x12')](_0x0d42('0xd'),_0x3a6af5,_0x27f362[_0x0d42('0x12')][_0x0d42('0x14')]);return _0x1de1d4(_0x27f362[_0x0d42('0x12')][_0x0d42('0x14')]);}logger[_0x0d42('0x12')](_0x0d42('0xd'),_0x3a6af5,_0x27f362['error']['message']);return _0x390bee(_0x27f362[_0x0d42('0x12')][_0x0d42('0x14')]);}else{logger['info'](_0x0d42('0xd'),_0x3a6af5,_0x0d42('0xe'));_0x390bee(_0x27f362[_0x0d42('0x15')][_0x0d42('0x14')]);}})['catch'](function(_0x51dc7c){logger['error'](_0x0d42('0xd'),_0x3a6af5,_0x51dc7c);_0x1de1d4(_0x51dc7c);});});}
\ No newline at end of file
+var _0x9fdc=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9fdc,0x19c));var _0xc9fd=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x9fdc[_0x4c6d6f];return _0x2d4478;};'use strict';var _=require(_0xc9fd('0x0'));var util=require(_0xc9fd('0x1'));var moment=require('moment');var BPromise=require(_0xc9fd('0x2'));var rs=require(_0xc9fd('0x3'));var fs=require('fs');var Redis=require(_0xc9fd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9fd('0x5'));var logger=require(_0xc9fd('0x6'))(_0xc9fd('0x7'));var config=require(_0xc9fd('0x8'));var jayson=require(_0xc9fd('0x9'));var client=jayson['client'][_0xc9fd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f16ce,_0x3059ce,_0x142abc){return new BPromise(function(_0x45369f,_0xf27a12){return client[_0xc9fd('0xb')](_0x1f16ce,_0x142abc)[_0xc9fd('0xc')](function(_0x265bc8){logger[_0xc9fd('0xd')](_0xc9fd('0xe'),_0x3059ce,_0xc9fd('0xf'));logger['debug'](_0xc9fd('0x10'),_0x3059ce,_0xc9fd('0xf'),JSON[_0xc9fd('0x11')](_0x265bc8));if(_0x265bc8[_0xc9fd('0x12')]){if(_0x265bc8[_0xc9fd('0x12')][_0xc9fd('0x13')]===0x1f4){logger[_0xc9fd('0x12')](_0xc9fd('0xe'),_0x3059ce,_0x265bc8['error'][_0xc9fd('0x14')]);return _0xf27a12(_0x265bc8['error']['message']);}logger[_0xc9fd('0x12')](_0xc9fd('0xe'),_0x3059ce,_0x265bc8[_0xc9fd('0x12')][_0xc9fd('0x14')]);return _0x45369f(_0x265bc8[_0xc9fd('0x12')][_0xc9fd('0x14')]);}else{logger[_0xc9fd('0xd')](_0xc9fd('0xe'),_0x3059ce,_0xc9fd('0xf'));_0x45369f(_0x265bc8[_0xc9fd('0x15')][_0xc9fd('0x14')]);}})['catch'](function(_0x4024cd){logger[_0xc9fd('0x12')](_0xc9fd('0xe'),_0x3059ce,_0x4024cd);_0xf27a12(_0x4024cd);});});}
\ No newline at end of file
index 476047f..50cf896 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x668b=['../../config/environment','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x668b,0x8d));var _0xb668=function(_0x208505,_0x241a77){_0x208505=_0x208505-0x0;var _0x1a985f=_0x668b[_0x208505];return _0x1a985f;};'use strict';var multer=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var path=require(_0xb668('0x2'));var timeout=require(_0xb668('0x3'));var express=require(_0xb668('0x4'));var router=express[_0xb668('0x5')]();var fs_extra=require(_0xb668('0x6'));var auth=require(_0xb668('0x7'));var interaction=require(_0xb668('0x8'));var config=require(_0xb668('0x9'));var controller=require('./intVtigerAccount.controller');router[_0xb668('0xa')]('/',auth[_0xb668('0xb')](),controller['index']);router[_0xb668('0xa')]('/:id',auth[_0xb668('0xb')](),controller[_0xb668('0xc')]);router[_0xb668('0xa')](_0xb668('0xd'),auth[_0xb668('0xb')](),controller[_0xb668('0xe')]);router[_0xb668('0xa')](_0xb668('0xf'),auth[_0xb668('0xb')](),controller[_0xb668('0x10')]);router[_0xb668('0x11')]('/',auth[_0xb668('0xb')](),controller[_0xb668('0x12')]);router[_0xb668('0x11')](_0xb668('0xd'),auth[_0xb668('0xb')](),controller['addConfiguration']);router[_0xb668('0x13')](_0xb668('0x14'),auth[_0xb668('0xb')](),controller[_0xb668('0x15')]);router[_0xb668('0x16')](_0xb668('0x14'),auth[_0xb668('0xb')](),controller[_0xb668('0x17')]);module[_0xb668('0x18')]=router;
\ No newline at end of file
+var _0xc095=['index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xc095,0x18c));var _0x5c09=function(_0x43be9a,_0x58c39b){_0x43be9a=_0x43be9a-0x0;var _0x309965=_0xc095[_0x43be9a];return _0x309965;};'use strict';var multer=require(_0x5c09('0x0'));var util=require(_0x5c09('0x1'));var path=require(_0x5c09('0x2'));var timeout=require('connect-timeout');var express=require(_0x5c09('0x3'));var router=express[_0x5c09('0x4')]();var fs_extra=require(_0x5c09('0x5'));var auth=require(_0x5c09('0x6'));var interaction=require(_0x5c09('0x7'));var config=require(_0x5c09('0x8'));var controller=require(_0x5c09('0x9'));router[_0x5c09('0xa')]('/',auth[_0x5c09('0xb')](),controller[_0x5c09('0xc')]);router[_0x5c09('0xa')](_0x5c09('0xd'),auth[_0x5c09('0xb')](),controller['show']);router[_0x5c09('0xa')](_0x5c09('0xe'),auth[_0x5c09('0xb')](),controller[_0x5c09('0xf')]);router['get'](_0x5c09('0x10'),auth[_0x5c09('0xb')](),controller[_0x5c09('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5c09('0x12')]);router[_0x5c09('0x13')]('/:id/configurations',auth[_0x5c09('0xb')](),controller[_0x5c09('0x14')]);router['put'](_0x5c09('0xd'),auth['isAuthenticated'](),controller[_0x5c09('0x15')]);router['delete'](_0x5c09('0xd'),auth[_0x5c09('0xb')](),controller[_0x5c09('0x16')]);module[_0x5c09('0x17')]=router;
\ No newline at end of file
index 1a7e1f6..7f7e534 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97d6=['HelpDesk','exports','STRING'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0x97d6,0xe5));var _0x697d=function(_0x12b2bc,_0x480fd4){_0x12b2bc=_0x12b2bc-0x0;var _0xd99024=_0x97d6[_0x12b2bc];return _0xd99024;};'use strict';var Sequelize=require('sequelize');module[_0x697d('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x697d('0x1')]},'username':{'type':Sequelize[_0x697d('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x697d('0x2')},'remoteUri':{'type':Sequelize[_0x697d('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0x697d('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x558e=['STRING','HelpDesk'];(function(_0x3d78bd,_0x1d8ccc){var _0x32e5ad=function(_0x4ce546){while(--_0x4ce546){_0x3d78bd['push'](_0x3d78bd['shift']());}};_0x32e5ad(++_0x1d8ccc);}(_0x558e,0x11e));var _0xe558=function(_0x531e48,_0x4bb96b){_0x531e48=_0x531e48-0x0;var _0x202971=_0x558e[_0x531e48];return _0x202971;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe558('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe558('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe558('0x0')],'allowNull':![],'defaultValue':_0xe558('0x1')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index b64cd87..de5ec49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b8a=['keys','query','filters','attributes','intersection','fields','hasOwnProperty','sort','where','filter','merge','map','options','VtigerAccount','includeAll','findAll','rows','show','params','include','catch','body','getConfigurations','findOne','VtigerConfiguration','length','order','pick','nolimit','AccountId','Subjects','channel','Descriptions','getDescriptions','create','VtigerField','md5','username','description','moduleName','accessKey','remoteUri','slice','substring','format','%s/webservice.php','success','POST','result','GET','describe','sessionName','reference','owner','remove','includes','editable','false','label','cf_','picklist','picklistValues','value','vTiger\x20error:\x20','test','getFields','Wrong\x20credentials','statusCode','eml-format','zip-dir','bluebird','mustache','util','path','sox','ejs','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model'];(function(_0x26c1bc,_0x2e35b1){var _0x58616f=function(_0x56d00a){while(--_0x56d00a){_0x26c1bc['push'](_0x26c1bc['shift']());}};_0x58616f(++_0x2e35b1);}(_0x7b8a,0xb6));var _0xa7b8=function(_0x3844ab,_0x461e40){_0x3844ab=_0x3844ab-0x0;var _0x2a3276=_0x7b8a[_0x3844ab];return _0x2a3276;};'use strict';var emlformat=require(_0xa7b8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa7b8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa7b8('0x2'));var Mustache=require(_0xa7b8('0x3'));var util=require(_0xa7b8('0x4'));var path=require(_0xa7b8('0x5'));var sox=require(_0xa7b8('0x6'));var csv=require('to-csv');var ejs=require(_0xa7b8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa7b8('0x8'));var deskjs=require(_0xa7b8('0x9'));var toCsv=require(_0xa7b8('0xa'));var querystring=require(_0xa7b8('0xb'));var Papa=require('papaparse');var Redis=require(_0xa7b8('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa7b8('0xd'));var hardwareService=require(_0xa7b8('0xe'));var logger=require(_0xa7b8('0xf'))(_0xa7b8('0x10'));var utils=require(_0xa7b8('0x11'));var config=require(_0xa7b8('0x12'));var licenseUtil=require(_0xa7b8('0x13'));var db=require(_0xa7b8('0x14'))['db'];var integrations=require(_0xa7b8('0x15'));function respondWithStatusCode(_0x127a7d,_0x3e5ca9){_0x3e5ca9=_0x3e5ca9||0xcc;return function(_0x11b462){if(_0x11b462){return _0x127a7d[_0xa7b8('0x16')](_0x3e5ca9);}return _0x127a7d['status'](_0x3e5ca9)[_0xa7b8('0x17')]();};}function respondWithResult(_0x177e4c,_0x13c76a){_0x13c76a=_0x13c76a||0xc8;return function(_0x49b87f){if(_0x49b87f){return _0x177e4c['status'](_0x13c76a)[_0xa7b8('0x18')](_0x49b87f);}};}function respondWithFilteredResult(_0x1aea3f,_0xa596af){return function(_0x5ef16b){if(_0x5ef16b){var _0x47fa4e=typeof _0xa596af[_0xa7b8('0x19')]===_0xa7b8('0x1a')&&typeof _0xa596af['limit']==='undefined';var _0x263117=_0x5ef16b[_0xa7b8('0x1b')];var _0x2f22ee=_0x47fa4e?0x0:_0xa596af[_0xa7b8('0x19')];var _0x1bc711=_0x47fa4e?_0x5ef16b['count']:_0xa596af[_0xa7b8('0x19')]+_0xa596af[_0xa7b8('0x1c')];var _0x240eef;if(_0x1bc711>=_0x263117){_0x1bc711=_0x263117;_0x240eef=0xc8;}else{_0x240eef=0xce;}_0x1aea3f[_0xa7b8('0x1d')](_0x240eef);return _0x1aea3f['set'](_0xa7b8('0x1e'),_0x2f22ee+'-'+_0x1bc711+'/'+_0x263117)[_0xa7b8('0x18')](_0x5ef16b);}return null;};}function patchUpdates(_0x3cd2ed){return function(_0x352366){try{jsonpatch[_0xa7b8('0x1f')](_0x352366,_0x3cd2ed,!![]);}catch(_0x5a9d77){return BPromise[_0xa7b8('0x20')](_0x5a9d77);}return _0x352366['save']();};}function saveUpdates(_0x57b0ae,_0x1f5f2d){return function(_0x17ca3f){if(_0x17ca3f){return _0x17ca3f[_0xa7b8('0x21')](_0x57b0ae)[_0xa7b8('0x22')](function(_0x55c09e){return _0x55c09e;});}return null;};}function removeEntity(_0x5a0520,_0x94952e){return function(_0x1e39b5){if(_0x1e39b5){return _0x1e39b5[_0xa7b8('0x23')]()[_0xa7b8('0x22')](function(){_0x5a0520[_0xa7b8('0x1d')](0xcc)[_0xa7b8('0x17')]();});}};}function handleEntityNotFound(_0x16b6b3,_0x35c42e){return function(_0x300c49){if(!_0x300c49){_0x16b6b3['sendStatus'](0x194);}return _0x300c49;};}function handleError(_0x28c2fb,_0x174087){_0x174087=_0x174087||0x1f4;return function(_0x2c5f3d){logger[_0xa7b8('0x24')](_0x2c5f3d[_0xa7b8('0x25')]);if(_0x2c5f3d[_0xa7b8('0x26')]){delete _0x2c5f3d['name'];}_0x28c2fb[_0xa7b8('0x1d')](_0x174087)[_0xa7b8('0x27')](_0x2c5f3d);};}exports[_0xa7b8('0x28')]=function(_0x4bd0b9,_0x3e8885){var _0x5af93e={},_0x3ff122={},_0x5592a2={'count':0x0,'rows':[]};var _0x14b8e5=_['map'](db['VtigerAccount'][_0xa7b8('0x29')],function(_0x422889){return{'name':_0x422889[_0xa7b8('0x2a')],'type':_0x422889[_0xa7b8('0x2b')][_0xa7b8('0x2c')]};});_0x3ff122[_0xa7b8('0x2d')]=_['map'](_0x14b8e5,'name');_0x3ff122['query']=_[_0xa7b8('0x2e')](_0x4bd0b9[_0xa7b8('0x2f')]);_0x3ff122[_0xa7b8('0x30')]=_['intersection'](_0x3ff122[_0xa7b8('0x2d')],_0x3ff122['query']);_0x5af93e[_0xa7b8('0x31')]=_[_0xa7b8('0x32')](_0x3ff122[_0xa7b8('0x2d')],qs[_0xa7b8('0x33')](_0x4bd0b9[_0xa7b8('0x2f')][_0xa7b8('0x33')]));_0x5af93e[_0xa7b8('0x31')]=_0x5af93e[_0xa7b8('0x31')]['length']?_0x5af93e[_0xa7b8('0x31')]:_0x3ff122[_0xa7b8('0x2d')];if(!_0x4bd0b9['query'][_0xa7b8('0x34')]('nolimit')){_0x5af93e[_0xa7b8('0x1c')]=qs[_0xa7b8('0x1c')](_0x4bd0b9[_0xa7b8('0x2f')][_0xa7b8('0x1c')]);_0x5af93e[_0xa7b8('0x19')]=qs['offset'](_0x4bd0b9['query'][_0xa7b8('0x19')]);}_0x5af93e['order']=qs['sort'](_0x4bd0b9['query'][_0xa7b8('0x35')]);_0x5af93e[_0xa7b8('0x36')]=qs[_0xa7b8('0x30')](_['pick'](_0x4bd0b9[_0xa7b8('0x2f')],_0x3ff122['filters']),_0x14b8e5);if(_0x4bd0b9[_0xa7b8('0x2f')][_0xa7b8('0x37')]){_0x5af93e['where']=_[_0xa7b8('0x38')](_0x5af93e['where'],{'$or':_[_0xa7b8('0x39')](_0x14b8e5,function(_0x11118f){if(_0x11118f[_0xa7b8('0x2b')]!=='VIRTUAL'){var _0x1de3b1={};_0x1de3b1[_0x11118f['name']]={'$like':'%'+_0x4bd0b9['query']['filter']+'%'};return _0x1de3b1;}})});}_0x5af93e=_[_0xa7b8('0x38')]({},_0x5af93e,_0x4bd0b9[_0xa7b8('0x3a')]);var _0x5e3042={'where':_0x5af93e[_0xa7b8('0x36')]};return db[_0xa7b8('0x3b')][_0xa7b8('0x1b')](_0x5e3042)[_0xa7b8('0x22')](function(_0xb8f9ba){_0x5592a2[_0xa7b8('0x1b')]=_0xb8f9ba;if(_0x4bd0b9[_0xa7b8('0x2f')][_0xa7b8('0x3c')]){_0x5af93e['include']=[{'all':!![]}];}return db[_0xa7b8('0x3b')][_0xa7b8('0x3d')](_0x5af93e);})[_0xa7b8('0x22')](function(_0x29e14b){_0x5592a2[_0xa7b8('0x3e')]=_0x29e14b;return _0x5592a2;})[_0xa7b8('0x22')](respondWithFilteredResult(_0x3e8885,_0x5af93e))['catch'](handleError(_0x3e8885,null));};exports[_0xa7b8('0x3f')]=function(_0x160559,_0xbe1022){var _0x498bdf={'raw':![],'where':{'id':_0x160559[_0xa7b8('0x40')]['id']}},_0x3e728a={};_0x3e728a[_0xa7b8('0x2d')]=_[_0xa7b8('0x2e')](db[_0xa7b8('0x3b')]['rawAttributes']);_0x3e728a[_0xa7b8('0x2f')]=_[_0xa7b8('0x2e')](_0x160559[_0xa7b8('0x2f')]);_0x3e728a['filters']=_[_0xa7b8('0x32')](_0x3e728a[_0xa7b8('0x2d')],_0x3e728a[_0xa7b8('0x2f')]);_0x498bdf[_0xa7b8('0x31')]=_[_0xa7b8('0x32')](_0x3e728a[_0xa7b8('0x2d')],qs['fields'](_0x160559[_0xa7b8('0x2f')][_0xa7b8('0x33')]));_0x498bdf[_0xa7b8('0x31')]=_0x498bdf[_0xa7b8('0x31')]['length']?_0x498bdf[_0xa7b8('0x31')]:_0x3e728a[_0xa7b8('0x2d')];if(_0x160559[_0xa7b8('0x2f')][_0xa7b8('0x3c')]){_0x498bdf[_0xa7b8('0x41')]=[{'all':!![]}];}_0x498bdf=_[_0xa7b8('0x38')]({},_0x498bdf,_0x160559[_0xa7b8('0x3a')]);return db[_0xa7b8('0x3b')]['find'](_0x498bdf)[_0xa7b8('0x22')](handleEntityNotFound(_0xbe1022,null))[_0xa7b8('0x22')](respondWithResult(_0xbe1022,null))[_0xa7b8('0x42')](handleError(_0xbe1022,null));};exports['create']=function(_0x474bdf,_0x172cbb){return db['VtigerAccount']['create'](_0x474bdf[_0xa7b8('0x43')],{})[_0xa7b8('0x22')](respondWithResult(_0x172cbb,0xc9))['catch'](handleError(_0x172cbb,null));};exports[_0xa7b8('0x21')]=function(_0x22794b,_0x255874){if(_0x22794b['body']['id']){delete _0x22794b[_0xa7b8('0x43')]['id'];}return db[_0xa7b8('0x3b')]['find']({'where':{'id':_0x22794b[_0xa7b8('0x40')]['id']}})[_0xa7b8('0x22')](handleEntityNotFound(_0x255874,null))[_0xa7b8('0x22')](saveUpdates(_0x22794b[_0xa7b8('0x43')],null))[_0xa7b8('0x22')](respondWithResult(_0x255874,null))['catch'](handleError(_0x255874,null));};exports[_0xa7b8('0x23')]=function(_0x180cb9,_0x414bf3){return db[_0xa7b8('0x3b')]['find']({'where':{'id':_0x180cb9[_0xa7b8('0x40')]['id']}})[_0xa7b8('0x22')](handleEntityNotFound(_0x414bf3,null))['then'](removeEntity(_0x414bf3,null))[_0xa7b8('0x42')](handleError(_0x414bf3,null));};exports[_0xa7b8('0x44')]=function(_0x55f262,_0x4059bf,_0x39f047){var _0x58d553={};var _0x4cc598={};var _0x5af366;var _0x1b5265;return db['VtigerAccount'][_0xa7b8('0x45')]({'where':{'id':_0x55f262['params']['id']}})[_0xa7b8('0x22')](handleEntityNotFound(_0x4059bf,null))[_0xa7b8('0x22')](function(_0x4bd289){if(_0x4bd289){_0x5af366=_0x4bd289;_0x4cc598[_0xa7b8('0x2d')]=_['keys'](db[_0xa7b8('0x46')][_0xa7b8('0x29')]);_0x4cc598[_0xa7b8('0x2f')]=_[_0xa7b8('0x2e')](_0x55f262[_0xa7b8('0x2f')]);_0x4cc598[_0xa7b8('0x30')]=_[_0xa7b8('0x32')](_0x4cc598[_0xa7b8('0x2d')],_0x4cc598['query']);_0x58d553[_0xa7b8('0x31')]=_['intersection'](_0x4cc598[_0xa7b8('0x2d')],qs['fields'](_0x55f262['query'][_0xa7b8('0x33')]));_0x58d553['attributes']=_0x58d553['attributes'][_0xa7b8('0x47')]?_0x58d553[_0xa7b8('0x31')]:_0x4cc598[_0xa7b8('0x2d')];_0x58d553[_0xa7b8('0x48')]=qs[_0xa7b8('0x35')](_0x55f262['query'][_0xa7b8('0x35')]);_0x58d553[_0xa7b8('0x36')]=qs['filters'](_[_0xa7b8('0x49')](_0x55f262[_0xa7b8('0x2f')],_0x4cc598[_0xa7b8('0x30')]));if(_0x55f262[_0xa7b8('0x2f')][_0xa7b8('0x37')]){_0x58d553[_0xa7b8('0x36')]=_[_0xa7b8('0x38')](_0x58d553[_0xa7b8('0x36')],{'$or':_['map'](_0x58d553['attributes'],function(_0x21a922){var _0x5a7290={};_0x5a7290[_0x21a922]={'$like':'%'+_0x55f262[_0xa7b8('0x2f')][_0xa7b8('0x37')]+'%'};return _0x5a7290;})});}_0x58d553=_[_0xa7b8('0x38')]({},_0x58d553,_0x55f262[_0xa7b8('0x3a')]);return _0x5af366[_0xa7b8('0x44')](_0x58d553);}})[_0xa7b8('0x22')](function(_0x48839a){if(_0x48839a){_0x1b5265=_0x48839a[_0xa7b8('0x47')];if(!_0x55f262[_0xa7b8('0x2f')][_0xa7b8('0x34')](_0xa7b8('0x4a'))){_0x58d553['limit']=qs[_0xa7b8('0x1c')](_0x55f262[_0xa7b8('0x2f')][_0xa7b8('0x1c')]);_0x58d553['offset']=qs[_0xa7b8('0x19')](_0x55f262[_0xa7b8('0x2f')][_0xa7b8('0x19')]);}return _0x5af366[_0xa7b8('0x44')](_0x58d553);}})[_0xa7b8('0x22')](function(_0x5047bf){if(_0x5047bf){return _0x5047bf?{'count':_0x1b5265,'rows':_0x5047bf}:null;}})[_0xa7b8('0x22')](respondWithResult(_0x4059bf,null))[_0xa7b8('0x42')](handleError(_0x4059bf,null));};exports['addConfiguration']=function(_0x23cd34,_0x2dc7ca,_0x9eedc9){if(_0x23cd34['body']['id']){delete _0x23cd34[_0xa7b8('0x43')]['id'];}return db[_0xa7b8('0x3b')]['findOne']({'where':{'id':_0x23cd34['params']['id']}})['then'](handleEntityNotFound(_0x2dc7ca,null))[_0xa7b8('0x22')](function(_0x29c3fd){if(_0x29c3fd){_0x23cd34[_0xa7b8('0x43')][_0xa7b8('0x4b')]=_0x29c3fd['id'];_0x23cd34[_0xa7b8('0x43')][_0xa7b8('0x4c')]=integrations['getSubjects'](_0x23cd34[_0xa7b8('0x43')][_0xa7b8('0x4d')],_0x23cd34[_0xa7b8('0x43')]['type']);_0x23cd34[_0xa7b8('0x43')][_0xa7b8('0x4e')]=integrations[_0xa7b8('0x4f')](_0x23cd34['body'][_0xa7b8('0x4d')],_0x23cd34[_0xa7b8('0x43')]['type']);return db[_0xa7b8('0x46')][_0xa7b8('0x50')](_0x23cd34[_0xa7b8('0x43')],{'include':[{'model':db[_0xa7b8('0x51')],'as':_0xa7b8('0x4c')},{'model':db[_0xa7b8('0x51')],'as':'Descriptions'}]});}return null;})[_0xa7b8('0x22')](respondWithResult(_0x2dc7ca,null))['catch'](handleError(_0x2dc7ca,null));};var md5=require(_0xa7b8('0x52'));exports['getFields']=function(_0xfb6804,_0x3aa27b,_0x8985df){var _0xb238e5=null;var _0x4f0387=null;var _0x25e469=null;var _0x438702=null;var _0x385a24='';return db[_0xa7b8('0x3b')][_0xa7b8('0x45')]({'where':{'id':_0xfb6804[_0xa7b8('0x40')]['id']},'attributes':['id',_0xa7b8('0x26'),_0xa7b8('0x53'),_0xa7b8('0x54'),_0xa7b8('0x55'),'remoteUri','serverUrl',_0xa7b8('0x56')]})['then'](handleEntityNotFound(_0x3aa27b,null))['then'](function(_0x761d60){if(_0x761d60){_0xb238e5=_0x761d60[_0xa7b8('0x53')];_0x4f0387=_0x761d60[_0xa7b8('0x56')];_0x25e469=_0x761d60[_0xa7b8('0x55')];_0x385a24=_0x761d60[_0xa7b8('0x57')];var _0x2cbe88=_0x385a24[_0xa7b8('0x58')](-0x1);if(_0x2cbe88==='/'){_0x385a24=_0x385a24[_0xa7b8('0x59')](0x0,_0x385a24['lastIndexOf'](_0x2cbe88));}_0x438702=util[_0xa7b8('0x5a')](_0xa7b8('0x5b'),_0x385a24);var _0x23bb89={'method':'GET','uri':_0x438702,'qs':{'operation':'getchallenge','username':_0x761d60[_0xa7b8('0x53')]},'json':!![]};return rp(_0x23bb89);}})['then'](function(_0x148f3a){if(_0x148f3a[_0xa7b8('0x5c')]){var _0x56e97e={'method':_0xa7b8('0x5d'),'uri':_0x438702,'form':{'operation':'login','username':_0xb238e5,'accessKey':md5(_0x148f3a[_0xa7b8('0x5e')]['token']+_0x4f0387)},'json':!![]};return rp(_0x56e97e);}})[_0xa7b8('0x22')](function(_0x1d9467){if(_0x1d9467[_0xa7b8('0x5c')]){var _0x174733={'method':_0xa7b8('0x5f'),'uri':_0x438702,'qs':{'operation':_0xa7b8('0x60'),'username':_0xb238e5,'sessionName':_0x1d9467['result'][_0xa7b8('0x61')],'elementType':_0x25e469},'json':!![]};return rp(_0x174733);}})['then'](function(_0x5ee0c1){if(_0x5ee0c1[_0xa7b8('0x5c')]){var _0x421ace=['autogenerated',_0xa7b8('0x62'),_0xa7b8('0x63')];_[_0xa7b8('0x64')](_0x5ee0c1[_0xa7b8('0x5e')][_0xa7b8('0x33')],function(_0xb90f5d){return _0x421ace[_0xa7b8('0x65')](_0xb90f5d[_0xa7b8('0x2b')][_0xa7b8('0x26')]);});_['remove'](_0x5ee0c1[_0xa7b8('0x5e')]['fields'],function(_0x189ef6){return _0x189ef6[_0xa7b8('0x66')]===_0xa7b8('0x67');});return{'count':_0x5ee0c1[_0xa7b8('0x5e')][_0xa7b8('0x33')][_0xa7b8('0x47')],'rows':_[_0xa7b8('0x39')](_0x5ee0c1[_0xa7b8('0x5e')][_0xa7b8('0x33')],function(_0x4f3d6e){return{'id':_0x4f3d6e[_0xa7b8('0x26')],'name':_0x4f3d6e[_0xa7b8('0x68')],'custom':_['startsWith'](_0x4f3d6e['name'],_0xa7b8('0x69'))?!![]:![],'options':_0x4f3d6e['type']['name']===_0xa7b8('0x6a')&&_0x4f3d6e['type'][_0xa7b8('0x6b')]['length']>0x0?_['map'](_0x4f3d6e[_0xa7b8('0x2b')][_0xa7b8('0x6b')],function(_0x198f5c){return{'name':_0x198f5c[_0xa7b8('0x68')],'value':_0x198f5c[_0xa7b8('0x6c')]};}):[]};})};}})[_0xa7b8('0x22')](respondWithResult(_0x3aa27b,null))[_0xa7b8('0x42')](function(_0x4da044){console['log'](_0xa7b8('0x6d')+_0x4da044);var _0x52362f=_0xfb6804['query'][_0xa7b8('0x6e')]?0x1f4:_0x4da044['statusCode']||0x1f4;logger[_0xa7b8('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0xa7b8('0x6f'),_0x52362f,JSON['stringify'](_0x4da044));delete _0x4da044[_0xa7b8('0x26')];if(_0x52362f===0x191){_0x52362f=0x190;}_0x3aa27b[_0xa7b8('0x1d')](_0x52362f)[_0xa7b8('0x27')](_0xfb6804[_0xa7b8('0x2f')]['test']?{'message':_0xa7b8('0x70'),'statusCode':_0x4da044[_0xa7b8('0x71')]}:_0x4da044);});};
\ No newline at end of file
+var _0xb83f=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','error','name','map','VtigerAccount','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','destroy','params','getConfigurations','findOne','VtigerConfiguration','pick','filter','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerField','Subjects','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','getchallenge','success','login','result','token','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','label','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','send','Wrong\x20credentials','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x213c40,_0x2f3971){var _0x2bd935=function(_0x4a3641){while(--_0x4a3641){_0x213c40['push'](_0x213c40['shift']());}};_0x2bd935(++_0x2f3971);}(_0xb83f,0xe3));var _0xfb83=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xb83f[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfb83('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb83('0x1'));var rp=require(_0xfb83('0x2'));var moment=require('moment');var BPromise=require(_0xfb83('0x3'));var Mustache=require(_0xfb83('0x4'));var util=require(_0xfb83('0x5'));var path=require(_0xfb83('0x6'));var sox=require('sox');var csv=require(_0xfb83('0x7'));var ejs=require(_0xfb83('0x8'));var fs=require('fs');var fs_extra=require(_0xfb83('0x9'));var _=require(_0xfb83('0xa'));var squel=require(_0xfb83('0xb'));var crypto=require(_0xfb83('0xc'));var jsforce=require(_0xfb83('0xd'));var deskjs=require(_0xfb83('0xe'));var toCsv=require(_0xfb83('0x7'));var querystring=require(_0xfb83('0xf'));var Papa=require('papaparse');var Redis=require(_0xfb83('0x10'));var authService=require(_0xfb83('0x11'));var qs=require(_0xfb83('0x12'));var as=require(_0xfb83('0x13'));var hardwareService=require(_0xfb83('0x14'));var logger=require(_0xfb83('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfb83('0x16'))['db'];var integrations=require(_0xfb83('0x17'));function respondWithStatusCode(_0x23e4d3,_0x24a4ba){_0x24a4ba=_0x24a4ba||0xcc;return function(_0x42f30e){if(_0x42f30e){return _0x23e4d3[_0xfb83('0x18')](_0x24a4ba);}return _0x23e4d3[_0xfb83('0x19')](_0x24a4ba)[_0xfb83('0x1a')]();};}function respondWithResult(_0x4b4e33,_0x526422){_0x526422=_0x526422||0xc8;return function(_0x55b327){if(_0x55b327){return _0x4b4e33[_0xfb83('0x19')](_0x526422)[_0xfb83('0x1b')](_0x55b327);}};}function respondWithFilteredResult(_0x31d81c,_0x4cfc04){return function(_0x3d9a63){if(_0x3d9a63){var _0x11e44f=typeof _0x4cfc04[_0xfb83('0x1c')]===_0xfb83('0x1d')&&typeof _0x4cfc04[_0xfb83('0x1e')]===_0xfb83('0x1d');var _0x328928=_0x3d9a63[_0xfb83('0x1f')];var _0x239539=_0x11e44f?0x0:_0x4cfc04['offset'];var _0x3d5f92=_0x11e44f?_0x3d9a63[_0xfb83('0x1f')]:_0x4cfc04[_0xfb83('0x1c')]+_0x4cfc04[_0xfb83('0x1e')];var _0x2ac962;if(_0x3d5f92>=_0x328928){_0x3d5f92=_0x328928;_0x2ac962=0xc8;}else{_0x2ac962=0xce;}_0x31d81c['status'](_0x2ac962);return _0x31d81c[_0xfb83('0x20')](_0xfb83('0x21'),_0x239539+'-'+_0x3d5f92+'/'+_0x328928)[_0xfb83('0x1b')](_0x3d9a63);}return null;};}function patchUpdates(_0x21820e){return function(_0x22d125){try{jsonpatch[_0xfb83('0x22')](_0x22d125,_0x21820e,!![]);}catch(_0x1a784b){return BPromise['reject'](_0x1a784b);}return _0x22d125[_0xfb83('0x23')]();};}function saveUpdates(_0x23060c,_0x70ea2f){return function(_0x18ab34){if(_0x18ab34){return _0x18ab34[_0xfb83('0x24')](_0x23060c)[_0xfb83('0x25')](function(_0x1d4316){return _0x1d4316;});}return null;};}function removeEntity(_0x1fb745,_0x5d05e1){return function(_0xe5ad16){if(_0xe5ad16){return _0xe5ad16['destroy']()['then'](function(){_0x1fb745['status'](0xcc)[_0xfb83('0x1a')]();});}};}function handleEntityNotFound(_0x2def9d,_0x108959){return function(_0x466fae){if(!_0x466fae){_0x2def9d['sendStatus'](0x194);}return _0x466fae;};}function handleError(_0x21b8ea,_0xc12e48){_0xc12e48=_0xc12e48||0x1f4;return function(_0x3f2cf4){logger[_0xfb83('0x26')](_0x3f2cf4['stack']);if(_0x3f2cf4['name']){delete _0x3f2cf4[_0xfb83('0x27')];}_0x21b8ea[_0xfb83('0x19')](_0xc12e48)['send'](_0x3f2cf4);};}exports['index']=function(_0x3e80f1,_0xcef843){var _0x116940={},_0x149738={},_0x47a4a4={'count':0x0,'rows':[]};var _0xe31e77=_[_0xfb83('0x28')](db[_0xfb83('0x29')][_0xfb83('0x2a')],function(_0x589e75){return{'name':_0x589e75[_0xfb83('0x2b')],'type':_0x589e75[_0xfb83('0x2c')][_0xfb83('0x2d')]};});_0x149738[_0xfb83('0x2e')]=_[_0xfb83('0x28')](_0xe31e77,_0xfb83('0x27'));_0x149738['query']=_[_0xfb83('0x2f')](_0x3e80f1['query']);_0x149738[_0xfb83('0x30')]=_['intersection'](_0x149738[_0xfb83('0x2e')],_0x149738[_0xfb83('0x31')]);_0x116940[_0xfb83('0x32')]=_[_0xfb83('0x33')](_0x149738[_0xfb83('0x2e')],qs[_0xfb83('0x34')](_0x3e80f1[_0xfb83('0x31')]['fields']));_0x116940[_0xfb83('0x32')]=_0x116940[_0xfb83('0x32')][_0xfb83('0x35')]?_0x116940[_0xfb83('0x32')]:_0x149738[_0xfb83('0x2e')];if(!_0x3e80f1[_0xfb83('0x31')][_0xfb83('0x36')](_0xfb83('0x37'))){_0x116940[_0xfb83('0x1e')]=qs[_0xfb83('0x1e')](_0x3e80f1[_0xfb83('0x31')][_0xfb83('0x1e')]);_0x116940[_0xfb83('0x1c')]=qs[_0xfb83('0x1c')](_0x3e80f1[_0xfb83('0x31')]['offset']);}_0x116940[_0xfb83('0x38')]=qs[_0xfb83('0x39')](_0x3e80f1[_0xfb83('0x31')][_0xfb83('0x39')]);_0x116940['where']=qs[_0xfb83('0x30')](_['pick'](_0x3e80f1[_0xfb83('0x31')],_0x149738['filters']),_0xe31e77);if(_0x3e80f1['query']['filter']){_0x116940[_0xfb83('0x3a')]=_[_0xfb83('0x3b')](_0x116940[_0xfb83('0x3a')],{'$or':_['map'](_0xe31e77,function(_0x1fabe3){if(_0x1fabe3[_0xfb83('0x2c')]!==_0xfb83('0x3c')){var _0xc8bbdd={};_0xc8bbdd[_0x1fabe3[_0xfb83('0x27')]]={'$like':'%'+_0x3e80f1[_0xfb83('0x31')]['filter']+'%'};return _0xc8bbdd;}})});}_0x116940=_[_0xfb83('0x3b')]({},_0x116940,_0x3e80f1[_0xfb83('0x3d')]);var _0x546a92={'where':_0x116940['where']};return db['VtigerAccount']['count'](_0x546a92)['then'](function(_0x184a68){_0x47a4a4[_0xfb83('0x1f')]=_0x184a68;if(_0x3e80f1[_0xfb83('0x31')][_0xfb83('0x3e')]){_0x116940[_0xfb83('0x3f')]=[{'all':!![]}];}return db[_0xfb83('0x29')]['findAll'](_0x116940);})[_0xfb83('0x25')](function(_0x3bc268){_0x47a4a4[_0xfb83('0x40')]=_0x3bc268;return _0x47a4a4;})[_0xfb83('0x25')](respondWithFilteredResult(_0xcef843,_0x116940))[_0xfb83('0x41')](handleError(_0xcef843,null));};exports[_0xfb83('0x42')]=function(_0x7a91f6,_0x385409){var _0x13c21f={'raw':![],'where':{'id':_0x7a91f6['params']['id']}},_0x98cf89={};_0x98cf89[_0xfb83('0x2e')]=_['keys'](db[_0xfb83('0x29')][_0xfb83('0x2a')]);_0x98cf89['query']=_[_0xfb83('0x2f')](_0x7a91f6['query']);_0x98cf89[_0xfb83('0x30')]=_['intersection'](_0x98cf89[_0xfb83('0x2e')],_0x98cf89[_0xfb83('0x31')]);_0x13c21f[_0xfb83('0x32')]=_[_0xfb83('0x33')](_0x98cf89[_0xfb83('0x2e')],qs['fields'](_0x7a91f6[_0xfb83('0x31')][_0xfb83('0x34')]));_0x13c21f[_0xfb83('0x32')]=_0x13c21f[_0xfb83('0x32')][_0xfb83('0x35')]?_0x13c21f[_0xfb83('0x32')]:_0x98cf89[_0xfb83('0x2e')];if(_0x7a91f6[_0xfb83('0x31')][_0xfb83('0x3e')]){_0x13c21f[_0xfb83('0x3f')]=[{'all':!![]}];}_0x13c21f=_[_0xfb83('0x3b')]({},_0x13c21f,_0x7a91f6['options']);return db['VtigerAccount'][_0xfb83('0x43')](_0x13c21f)[_0xfb83('0x25')](handleEntityNotFound(_0x385409,null))[_0xfb83('0x25')](respondWithResult(_0x385409,null))[_0xfb83('0x41')](handleError(_0x385409,null));};exports[_0xfb83('0x44')]=function(_0x55af8c,_0x55c895){return db['VtigerAccount'][_0xfb83('0x44')](_0x55af8c[_0xfb83('0x45')],{})['then'](respondWithResult(_0x55c895,0xc9))[_0xfb83('0x41')](handleError(_0x55c895,null));};exports[_0xfb83('0x24')]=function(_0x185758,_0x2bb36a){if(_0x185758[_0xfb83('0x45')]['id']){delete _0x185758[_0xfb83('0x45')]['id'];}return db[_0xfb83('0x29')][_0xfb83('0x43')]({'where':{'id':_0x185758['params']['id']}})[_0xfb83('0x25')](handleEntityNotFound(_0x2bb36a,null))[_0xfb83('0x25')](saveUpdates(_0x185758['body'],null))[_0xfb83('0x25')](respondWithResult(_0x2bb36a,null))[_0xfb83('0x41')](handleError(_0x2bb36a,null));};exports[_0xfb83('0x46')]=function(_0x27c353,_0x9862b4){return db[_0xfb83('0x29')][_0xfb83('0x43')]({'where':{'id':_0x27c353[_0xfb83('0x47')]['id']}})['then'](handleEntityNotFound(_0x9862b4,null))[_0xfb83('0x25')](removeEntity(_0x9862b4,null))[_0xfb83('0x41')](handleError(_0x9862b4,null));};exports[_0xfb83('0x48')]=function(_0x3a9019,_0x1f9e19,_0x798a45){var _0x299ec9={};var _0x483461={};var _0x336a13;var _0x4f8a24;return db[_0xfb83('0x29')][_0xfb83('0x49')]({'where':{'id':_0x3a9019[_0xfb83('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f9e19,null))[_0xfb83('0x25')](function(_0x312e72){if(_0x312e72){_0x336a13=_0x312e72;_0x483461[_0xfb83('0x2e')]=_[_0xfb83('0x2f')](db[_0xfb83('0x4a')][_0xfb83('0x2a')]);_0x483461[_0xfb83('0x31')]=_['keys'](_0x3a9019[_0xfb83('0x31')]);_0x483461[_0xfb83('0x30')]=_[_0xfb83('0x33')](_0x483461[_0xfb83('0x2e')],_0x483461[_0xfb83('0x31')]);_0x299ec9[_0xfb83('0x32')]=_['intersection'](_0x483461[_0xfb83('0x2e')],qs[_0xfb83('0x34')](_0x3a9019[_0xfb83('0x31')][_0xfb83('0x34')]));_0x299ec9['attributes']=_0x299ec9[_0xfb83('0x32')][_0xfb83('0x35')]?_0x299ec9[_0xfb83('0x32')]:_0x483461[_0xfb83('0x2e')];_0x299ec9[_0xfb83('0x38')]=qs['sort'](_0x3a9019['query'][_0xfb83('0x39')]);_0x299ec9[_0xfb83('0x3a')]=qs['filters'](_[_0xfb83('0x4b')](_0x3a9019['query'],_0x483461[_0xfb83('0x30')]));if(_0x3a9019['query']['filter']){_0x299ec9['where']=_[_0xfb83('0x3b')](_0x299ec9[_0xfb83('0x3a')],{'$or':_[_0xfb83('0x28')](_0x299ec9[_0xfb83('0x32')],function(_0x427a45){var _0x588efa={};_0x588efa[_0x427a45]={'$like':'%'+_0x3a9019['query'][_0xfb83('0x4c')]+'%'};return _0x588efa;})});}_0x299ec9=_[_0xfb83('0x3b')]({},_0x299ec9,_0x3a9019['options']);return _0x336a13['getConfigurations'](_0x299ec9);}})[_0xfb83('0x25')](function(_0x2e9788){if(_0x2e9788){_0x4f8a24=_0x2e9788[_0xfb83('0x35')];if(!_0x3a9019['query'][_0xfb83('0x36')](_0xfb83('0x37'))){_0x299ec9[_0xfb83('0x1e')]=qs['limit'](_0x3a9019['query'][_0xfb83('0x1e')]);_0x299ec9[_0xfb83('0x1c')]=qs['offset'](_0x3a9019[_0xfb83('0x31')]['offset']);}return _0x336a13[_0xfb83('0x48')](_0x299ec9);}})[_0xfb83('0x25')](function(_0x9f3d3d){if(_0x9f3d3d){return _0x9f3d3d?{'count':_0x4f8a24,'rows':_0x9f3d3d}:null;}})[_0xfb83('0x25')](respondWithResult(_0x1f9e19,null))['catch'](handleError(_0x1f9e19,null));};exports[_0xfb83('0x4d')]=function(_0x8ab091,_0xbbd394,_0x977137){if(_0x8ab091[_0xfb83('0x45')]['id']){delete _0x8ab091['body']['id'];}return db[_0xfb83('0x29')][_0xfb83('0x49')]({'where':{'id':_0x8ab091[_0xfb83('0x47')]['id']}})[_0xfb83('0x25')](handleEntityNotFound(_0xbbd394,null))[_0xfb83('0x25')](function(_0x181047){if(_0x181047){_0x8ab091['body'][_0xfb83('0x4e')]=_0x181047['id'];_0x8ab091['body']['Subjects']=integrations[_0xfb83('0x4f')](_0x8ab091['body'][_0xfb83('0x50')],_0x8ab091[_0xfb83('0x45')][_0xfb83('0x2c')]);_0x8ab091[_0xfb83('0x45')][_0xfb83('0x51')]=integrations[_0xfb83('0x52')](_0x8ab091[_0xfb83('0x45')][_0xfb83('0x50')],_0x8ab091[_0xfb83('0x45')][_0xfb83('0x2c')]);return db[_0xfb83('0x4a')][_0xfb83('0x44')](_0x8ab091[_0xfb83('0x45')],{'include':[{'model':db[_0xfb83('0x53')],'as':_0xfb83('0x54')},{'model':db[_0xfb83('0x53')],'as':'Descriptions'}]});}return null;})[_0xfb83('0x25')](respondWithResult(_0xbbd394,null))[_0xfb83('0x41')](handleError(_0xbbd394,null));};var md5=require('md5');exports[_0xfb83('0x55')]=function(_0xbd7bd8,_0xec144,_0x4d077a){var _0x416352=null;var _0x555c12=null;var _0x5d2255=null;var _0x69fa93=null;var _0x35f91a='';return db[_0xfb83('0x29')][_0xfb83('0x49')]({'where':{'id':_0xbd7bd8[_0xfb83('0x47')]['id']},'attributes':['id',_0xfb83('0x27'),_0xfb83('0x56'),_0xfb83('0x57'),_0xfb83('0x58'),_0xfb83('0x59'),_0xfb83('0x5a'),_0xfb83('0x5b')]})[_0xfb83('0x25')](handleEntityNotFound(_0xec144,null))[_0xfb83('0x25')](function(_0x444ee0){if(_0x444ee0){_0x416352=_0x444ee0[_0xfb83('0x56')];_0x555c12=_0x444ee0[_0xfb83('0x5b')];_0x5d2255=_0x444ee0[_0xfb83('0x58')];_0x35f91a=_0x444ee0[_0xfb83('0x59')];var _0x4b79ba=_0x35f91a[_0xfb83('0x5c')](-0x1);if(_0x4b79ba==='/'){_0x35f91a=_0x35f91a[_0xfb83('0x5d')](0x0,_0x35f91a[_0xfb83('0x5e')](_0x4b79ba));}_0x69fa93=util['format']('%s/webservice.php',_0x35f91a);var _0xc444eb={'method':'GET','uri':_0x69fa93,'qs':{'operation':_0xfb83('0x5f'),'username':_0x444ee0[_0xfb83('0x56')]},'json':!![]};return rp(_0xc444eb);}})[_0xfb83('0x25')](function(_0x33392b){if(_0x33392b[_0xfb83('0x60')]){var _0x3b2d4c={'method':'POST','uri':_0x69fa93,'form':{'operation':_0xfb83('0x61'),'username':_0x416352,'accessKey':md5(_0x33392b[_0xfb83('0x62')][_0xfb83('0x63')]+_0x555c12)},'json':!![]};return rp(_0x3b2d4c);}})[_0xfb83('0x25')](function(_0xd36584){if(_0xd36584[_0xfb83('0x60')]){var _0xf0d99a={'method':'GET','uri':_0x69fa93,'qs':{'operation':_0xfb83('0x64'),'username':_0x416352,'sessionName':_0xd36584[_0xfb83('0x62')][_0xfb83('0x65')],'elementType':_0x5d2255},'json':!![]};return rp(_0xf0d99a);}})[_0xfb83('0x25')](function(_0x5aa72c){if(_0x5aa72c[_0xfb83('0x60')]){var _0x238742=[_0xfb83('0x66'),_0xfb83('0x67'),_0xfb83('0x68')];_[_0xfb83('0x69')](_0x5aa72c[_0xfb83('0x62')][_0xfb83('0x34')],function(_0x1593ca){return _0x238742[_0xfb83('0x6a')](_0x1593ca[_0xfb83('0x2c')][_0xfb83('0x27')]);});_[_0xfb83('0x69')](_0x5aa72c[_0xfb83('0x62')][_0xfb83('0x34')],function(_0x5b3c51){return _0x5b3c51[_0xfb83('0x6b')]==='false';});return{'count':_0x5aa72c[_0xfb83('0x62')][_0xfb83('0x34')][_0xfb83('0x35')],'rows':_[_0xfb83('0x28')](_0x5aa72c['result'][_0xfb83('0x34')],function(_0x48dfcd){return{'id':_0x48dfcd[_0xfb83('0x27')],'name':_0x48dfcd[_0xfb83('0x6c')],'custom':_[_0xfb83('0x6d')](_0x48dfcd[_0xfb83('0x27')],'cf_')?!![]:![],'options':_0x48dfcd[_0xfb83('0x2c')][_0xfb83('0x27')]===_0xfb83('0x6e')&&_0x48dfcd['type'][_0xfb83('0x6f')]['length']>0x0?_['map'](_0x48dfcd[_0xfb83('0x2c')]['picklistValues'],function(_0x16f70a){return{'name':_0x16f70a[_0xfb83('0x6c')],'value':_0x16f70a[_0xfb83('0x70')]};}):[]};})};}})[_0xfb83('0x25')](respondWithResult(_0xec144,null))[_0xfb83('0x41')](function(_0x20ebd4){console[_0xfb83('0x71')](_0xfb83('0x72')+_0x20ebd4);var _0x569638=_0xbd7bd8[_0xfb83('0x31')][_0xfb83('0x73')]?0x1f4:_0x20ebd4[_0xfb83('0x74')]||0x1f4;logger[_0xfb83('0x26')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x569638,JSON['stringify'](_0x20ebd4));delete _0x20ebd4[_0xfb83('0x27')];if(_0x569638===0x191){_0x569638=0x190;}_0xec144['status'](_0x569638)[_0xfb83('0x75')](_0xbd7bd8[_0xfb83('0x31')][_0xfb83('0x73')]?{'message':_0xfb83('0x76'),'statusCode':_0x20ebd4[_0xfb83('0x74')]}:_0x20ebd4);});};
\ No newline at end of file
index 59d32b7..27de0b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda54=['../../components/integrations/configuration','exports','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x48be81,_0x230c07){var _0x1e544c=function(_0x4c697d){while(--_0x4c697d){_0x48be81['push'](_0x48be81['shift']());}};_0x1e544c(++_0x230c07);}(_0xda54,0xec));var _0x4da5=function(_0xf26c2e,_0x56c3ea){_0xf26c2e=_0xf26c2e-0x0;var _0x46ecb4=_0xda54[_0xf26c2e];return _0x46ecb4;};'use strict';var _=require(_0x4da5('0x0'));var util=require('util');var logger=require(_0x4da5('0x1'))('api');var moment=require(_0x4da5('0x2'));var BPromise=require(_0x4da5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4da5('0x4'));var rimraf=require(_0x4da5('0x5'));var config=require(_0x4da5('0x6'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x4da5('0x7'));module[_0x4da5('0x8')]=function(_0x177d67,_0x2cbb05){return _0x177d67['define']('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc216=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts'];(function(_0x293ea8,_0x6cbd1){var _0x1a5b46=function(_0x311c83){while(--_0x311c83){_0x293ea8['push'](_0x293ea8['shift']());}};_0x1a5b46(++_0x6cbd1);}(_0xc216,0xc4));var _0x6c21=function(_0x2f2360,_0x151089){_0x2f2360=_0x2f2360-0x0;var _0x1cc8d3=_0xc216[_0x2f2360];return _0x1cc8d3;};'use strict';var _=require('lodash');var util=require(_0x6c21('0x0'));var logger=require(_0x6c21('0x1'))(_0x6c21('0x2'));var moment=require(_0x6c21('0x3'));var BPromise=require(_0x6c21('0x4'));var rp=require(_0x6c21('0x5'));var fs=require('fs');var path=require(_0x6c21('0x6'));var rimraf=require(_0x6c21('0x7'));var config=require('../../config/environment');var attributes=require(_0x6c21('0x8'));var integrations=require(_0x6c21('0x9'));module[_0x6c21('0xa')]=function(_0x27921e,_0x1b815c){return _0x27921e[_0x6c21('0xb')](_0x6c21('0xc'),attributes,{'tableName':_0x6c21('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e80b69b..4604d6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['VtigerAccount','findAll','options','where','attributes','limit','map','model','include','find','raw','ShowVtigerAccount','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetVtigerAccount'];(function(_0x50f720,_0x186bb2){var _0x3da012=function(_0x20f21b){while(--_0x20f21b){_0x50f720['push'](_0x50f720['shift']());}};_0x3da012(++_0x186bb2);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1b61b0,_0x5efa0b){_0x1b61b0=_0x1b61b0-0x0;var _0x77a9aa=_0xf4eb[_0x1b61b0];return _0x77a9aa;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});}exports[_0xbf4e('0x13')]=function(_0x577c27){var _0x5db03f=this;return new Promise(function(_0x566ec3,_0x4f8762){return db[_0xbf4e('0x14')][_0xbf4e('0x15')]({'raw':_0x577c27[_0xbf4e('0x16')]?_0x577c27['options']['raw']===undefined?!![]:![]:!![],'where':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')][_0xbf4e('0x17')]||null:null,'attributes':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')][_0xbf4e('0x18')]||null:null,'limit':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')][_0xbf4e('0x19')]||null:null,'include':_0x577c27[_0xbf4e('0x16')]?_0x577c27[_0xbf4e('0x16')]['include']?_[_0xbf4e('0x1a')](_0x577c27[_0xbf4e('0x16')]['include'],function(_0x31e3f5){return{'model':db[_0x31e3f5[_0xbf4e('0x1b')]],'as':_0x31e3f5['as'],'attributes':_0x31e3f5[_0xbf4e('0x18')],'include':_0x31e3f5[_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x31e3f5['include'],function(_0x90635e){return{'model':db[_0x90635e[_0xbf4e('0x1b')]],'as':_0x90635e['as'],'attributes':_0x90635e[_0xbf4e('0x18')],'include':_0x90635e['include']?_[_0xbf4e('0x1a')](_0x90635e['include'],function(_0x5bcf71){return{'model':db[_0x5bcf71[_0xbf4e('0x1b')]],'as':_0x5bcf71['as'],'attributes':_0x5bcf71['attributes']};}):[]};}):[]};}):[]:[]})[_0xbf4e('0x9')](function(_0x315df3){logger[_0xbf4e('0xa')](_0xbf4e('0x13'),_0x577c27);logger['debug'](_0xbf4e('0x13'),_0x577c27,JSON[_0xbf4e('0xe')](_0x315df3));_0x566ec3(_0x315df3);})[_0xbf4e('0x12')](function(_0x4cd4a1){logger[_0xbf4e('0xf')]('GetVtigerAccount',_0x4cd4a1[_0xbf4e('0x11')],_0x577c27);_0x4f8762(_0x5db03f[_0xbf4e('0xf')](0x1f4,_0x4cd4a1[_0xbf4e('0x11')]));});});};exports['ShowVtigerAccount']=function(_0x1d12e2){var _0x362716=this;return new Promise(function(_0x2f3cf8,_0xc7ca87){return db[_0xbf4e('0x14')][_0xbf4e('0x1d')]({'raw':_0x1d12e2['options']?_0x1d12e2[_0xbf4e('0x16')][_0xbf4e('0x1e')]===undefined?!![]:![]:!![],'where':_0x1d12e2['options']?_0x1d12e2[_0xbf4e('0x16')][_0xbf4e('0x17')]||null:null,'attributes':_0x1d12e2['options']?_0x1d12e2[_0xbf4e('0x16')]['attributes']||null:null,'include':_0x1d12e2[_0xbf4e('0x16')]?_0x1d12e2['options'][_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x1d12e2[_0xbf4e('0x16')]['include'],function(_0x2716b7){return{'model':db[_0x2716b7[_0xbf4e('0x1b')]],'as':_0x2716b7['as'],'attributes':_0x2716b7[_0xbf4e('0x18')],'include':_0x2716b7[_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x2716b7[_0xbf4e('0x1c')],function(_0x5b8440){return{'model':db[_0x5b8440[_0xbf4e('0x1b')]],'as':_0x5b8440['as'],'attributes':_0x5b8440[_0xbf4e('0x18')],'include':_0x5b8440[_0xbf4e('0x1c')]?_[_0xbf4e('0x1a')](_0x5b8440[_0xbf4e('0x1c')],function(_0x5b7ea1){return{'model':db[_0x5b7ea1['model']],'as':_0x5b7ea1['as'],'attributes':_0x5b7ea1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x429c07){logger[_0xbf4e('0xa')](_0xbf4e('0x1f'),_0x1d12e2);logger[_0xbf4e('0xd')](_0xbf4e('0x1f'),_0x1d12e2,JSON[_0xbf4e('0xe')](_0x429c07));_0x2f3cf8(_0x429c07);})[_0xbf4e('0x12')](function(_0x467b74){logger[_0xbf4e('0xf')]('ShowVtigerAccount',_0x467b74['message'],_0x1d12e2);_0xc7ca87(_0x362716[_0xbf4e('0xf')](0x1f4,_0x467b74[_0xbf4e('0x11')]));});});};
\ No newline at end of file
+var _0xd4f4=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVtigerAccount','findAll','options','raw','where','attributes','limit','include','model','map','ShowVtigerAccount','VtigerAccount','find','lodash','util','moment','bluebird','randomstring'];(function(_0x226c48,_0x12bd4a){var _0x8f2871=function(_0x4b6ca5){while(--_0x4b6ca5){_0x226c48['push'](_0x226c48['shift']());}};_0x8f2871(++_0x12bd4a);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x45fed9,_0xafa73b){_0x45fed9=_0x45fed9-0x0;var _0xd0182d=_0xd4f4[_0x45fed9];return _0xd0182d;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var moment=require(_0x4d4f('0x2'));var BPromise=require(_0x4d4f('0x3'));var rs=require(_0x4d4f('0x4'));var fs=require('fs');var Redis=require(_0x4d4f('0x5'));var db=require(_0x4d4f('0x6'))['db'];var utils=require(_0x4d4f('0x7'));var logger=require(_0x4d4f('0x8'))(_0x4d4f('0x9'));var config=require(_0x4d4f('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d7aa8,_0xecc103,_0x150bd6){return new BPromise(function(_0xea29b,_0x40be66){return client[_0x4d4f('0xb')](_0x1d7aa8,_0x150bd6)[_0x4d4f('0xc')](function(_0x226837){logger[_0x4d4f('0xd')](_0x4d4f('0xe'),_0xecc103,_0x4d4f('0xf'));logger[_0x4d4f('0x10')](_0x4d4f('0x11'),_0xecc103,_0x4d4f('0xf'),JSON[_0x4d4f('0x12')](_0x226837));if(_0x226837[_0x4d4f('0x13')]){if(_0x226837[_0x4d4f('0x13')][_0x4d4f('0x14')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0xecc103,_0x226837['error'][_0x4d4f('0x15')]);return _0x40be66(_0x226837[_0x4d4f('0x13')]['message']);}logger[_0x4d4f('0x13')](_0x4d4f('0xe'),_0xecc103,_0x226837[_0x4d4f('0x13')]['message']);return _0xea29b(_0x226837[_0x4d4f('0x13')][_0x4d4f('0x15')]);}else{logger[_0x4d4f('0xd')]('VtigerAccount,\x20%s,\x20%s',_0xecc103,_0x4d4f('0xf'));_0xea29b(_0x226837['result'][_0x4d4f('0x15')]);}})[_0x4d4f('0x16')](function(_0x4170ca){logger['error'](_0x4d4f('0xe'),_0xecc103,_0x4170ca);_0x40be66(_0x4170ca);});});}exports[_0x4d4f('0x17')]=function(_0x51dcf1){var _0x5dbbeb=this;return new Promise(function(_0x519501,_0x5a58af){return db['VtigerAccount'][_0x4d4f('0x18')]({'raw':_0x51dcf1[_0x4d4f('0x19')]?_0x51dcf1[_0x4d4f('0x19')][_0x4d4f('0x1a')]===undefined?!![]:![]:!![],'where':_0x51dcf1['options']?_0x51dcf1['options'][_0x4d4f('0x1b')]||null:null,'attributes':_0x51dcf1['options']?_0x51dcf1[_0x4d4f('0x19')][_0x4d4f('0x1c')]||null:null,'limit':_0x51dcf1[_0x4d4f('0x19')]?_0x51dcf1[_0x4d4f('0x19')][_0x4d4f('0x1d')]||null:null,'include':_0x51dcf1['options']?_0x51dcf1['options'][_0x4d4f('0x1e')]?_['map'](_0x51dcf1[_0x4d4f('0x19')][_0x4d4f('0x1e')],function(_0x2d2fb3){return{'model':db[_0x2d2fb3[_0x4d4f('0x1f')]],'as':_0x2d2fb3['as'],'attributes':_0x2d2fb3[_0x4d4f('0x1c')],'include':_0x2d2fb3['include']?_[_0x4d4f('0x20')](_0x2d2fb3[_0x4d4f('0x1e')],function(_0x1cf365){return{'model':db[_0x1cf365[_0x4d4f('0x1f')]],'as':_0x1cf365['as'],'attributes':_0x1cf365['attributes'],'include':_0x1cf365['include']?_[_0x4d4f('0x20')](_0x1cf365[_0x4d4f('0x1e')],function(_0xa2492c){return{'model':db[_0xa2492c[_0x4d4f('0x1f')]],'as':_0xa2492c['as'],'attributes':_0xa2492c['attributes']};}):[]};}):[]};}):[]:[]})[_0x4d4f('0xc')](function(_0x380ebf){logger[_0x4d4f('0xd')](_0x4d4f('0x17'),_0x51dcf1);logger['debug'](_0x4d4f('0x17'),_0x51dcf1,JSON['stringify'](_0x380ebf));_0x519501(_0x380ebf);})[_0x4d4f('0x16')](function(_0x333a40){logger['error'](_0x4d4f('0x17'),_0x333a40[_0x4d4f('0x15')],_0x51dcf1);_0x5a58af(_0x5dbbeb[_0x4d4f('0x13')](0x1f4,_0x333a40[_0x4d4f('0x15')]));});});};exports[_0x4d4f('0x21')]=function(_0x43a704){var _0x4c69cb=this;return new Promise(function(_0x36eede,_0x4578b6){return db[_0x4d4f('0x22')][_0x4d4f('0x23')]({'raw':_0x43a704[_0x4d4f('0x19')]?_0x43a704['options'][_0x4d4f('0x1a')]===undefined?!![]:![]:!![],'where':_0x43a704['options']?_0x43a704[_0x4d4f('0x19')]['where']||null:null,'attributes':_0x43a704['options']?_0x43a704['options'][_0x4d4f('0x1c')]||null:null,'include':_0x43a704['options']?_0x43a704[_0x4d4f('0x19')][_0x4d4f('0x1e')]?_[_0x4d4f('0x20')](_0x43a704['options'][_0x4d4f('0x1e')],function(_0x1ab7c4){return{'model':db[_0x1ab7c4[_0x4d4f('0x1f')]],'as':_0x1ab7c4['as'],'attributes':_0x1ab7c4['attributes'],'include':_0x1ab7c4[_0x4d4f('0x1e')]?_['map'](_0x1ab7c4[_0x4d4f('0x1e')],function(_0x2f18df){return{'model':db[_0x2f18df[_0x4d4f('0x1f')]],'as':_0x2f18df['as'],'attributes':_0x2f18df[_0x4d4f('0x1c')],'include':_0x2f18df[_0x4d4f('0x1e')]?_[_0x4d4f('0x20')](_0x2f18df[_0x4d4f('0x1e')],function(_0x461900){return{'model':db[_0x461900['model']],'as':_0x461900['as'],'attributes':_0x461900['attributes']};}):[]};}):[]};}):[]:[]})[_0x4d4f('0xc')](function(_0x559441){logger['info'](_0x4d4f('0x21'),_0x43a704);logger[_0x4d4f('0x10')](_0x4d4f('0x21'),_0x43a704,JSON[_0x4d4f('0x12')](_0x559441));_0x36eede(_0x559441);})[_0x4d4f('0x16')](function(_0x56eed8){logger[_0x4d4f('0x13')](_0x4d4f('0x21'),_0x56eed8['message'],_0x43a704);_0x4578b6(_0x4c69cb[_0x4d4f('0x13')](0x1f4,_0x56eed8[_0x4d4f('0x15')]));});});};
\ No newline at end of file
index 745c7aa..64f624a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd45=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','getSubjects','create','put','update','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd45,0x1cf));var _0x5fd4=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0xfd45[_0x2555d0];return _0x3bb486;};'use strict';var multer=require(_0x5fd4('0x0'));var util=require(_0x5fd4('0x1'));var path=require('path');var timeout=require(_0x5fd4('0x2'));var express=require(_0x5fd4('0x3'));var router=express[_0x5fd4('0x4')]();var fs_extra=require(_0x5fd4('0x5'));var auth=require(_0x5fd4('0x6'));var interaction=require(_0x5fd4('0x7'));var config=require(_0x5fd4('0x8'));var controller=require(_0x5fd4('0x9'));router[_0x5fd4('0xa')]('/',auth[_0x5fd4('0xb')](),controller['index']);router[_0x5fd4('0xa')](_0x5fd4('0xc'),auth[_0x5fd4('0xb')](),controller[_0x5fd4('0xd')]);router[_0x5fd4('0xa')](_0x5fd4('0xe'),auth['isAuthenticated'](),controller[_0x5fd4('0xf')]);router[_0x5fd4('0xa')]('/:id/subjects',auth[_0x5fd4('0xb')](),controller[_0x5fd4('0x10')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0x5fd4('0xb')](),controller[_0x5fd4('0x11')]);router[_0x5fd4('0x12')](_0x5fd4('0xc'),auth[_0x5fd4('0xb')](),controller[_0x5fd4('0x13')]);router['delete']('/:id',auth[_0x5fd4('0xb')](),controller[_0x5fd4('0x14')]);module[_0x5fd4('0x15')]=router;
\ No newline at end of file
+var _0x93e3=['update','multer','express','Router','fs-extra','../../components/auth/service','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x5ded62,_0x559fa1){var _0x30c6a8=function(_0x2bc43e){while(--_0x2bc43e){_0x5ded62['push'](_0x5ded62['shift']());}};_0x30c6a8(++_0x559fa1);}(_0x93e3,0x79));var _0x393e=function(_0x52e68e,_0x309912){_0x52e68e=_0x52e68e-0x0;var _0x3211a4=_0x93e3[_0x52e68e];return _0x3211a4;};'use strict';var multer=require(_0x393e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x393e('0x1'));var router=express[_0x393e('0x2')]();var fs_extra=require(_0x393e('0x3'));var auth=require(_0x393e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x393e('0x5'));router[_0x393e('0x6')]('/',auth[_0x393e('0x7')](),controller[_0x393e('0x8')]);router['get'](_0x393e('0x9'),auth[_0x393e('0x7')](),controller[_0x393e('0xa')]);router['get']('/:id/fields',auth[_0x393e('0x7')](),controller[_0x393e('0xb')]);router[_0x393e('0x6')](_0x393e('0xc'),auth[_0x393e('0x7')](),controller[_0x393e('0xd')]);router[_0x393e('0x6')](_0x393e('0xe'),auth[_0x393e('0x7')](),controller[_0x393e('0xf')]);router[_0x393e('0x10')]('/',auth[_0x393e('0x7')](),controller[_0x393e('0x11')]);router[_0x393e('0x12')](_0x393e('0x9'),auth[_0x393e('0x7')](),controller[_0x393e('0x13')]);router['delete'](_0x393e('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 9401f2d..ab8e984 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe774=['sequelize','STRING'];(function(_0x2aeac6,_0x15eb45){var _0x13d879=function(_0x58c7a5){while(--_0x58c7a5){_0x2aeac6['push'](_0x2aeac6['shift']());}};_0x13d879(++_0x15eb45);}(_0xe774,0x8a));var _0x4e77=function(_0x3be12f,_0x581c1c){_0x3be12f=_0x3be12f-0x0;var _0x1da930=_0xe774[_0x3be12f];return _0x1da930;};'use strict';var Sequelize=require(_0x4e77('0x0'));module['exports']={'name':{'type':Sequelize[_0x4e77('0x1')]},'description':{'type':Sequelize[_0x4e77('0x1')]}};
\ No newline at end of file
+var _0x73c1=['sequelize','exports','STRING'];(function(_0xb843ae,_0x24bc5b){var _0x579dcb=function(_0x10e517){while(--_0x10e517){_0xb843ae['push'](_0xb843ae['shift']());}};_0x579dcb(++_0x24bc5b);}(_0x73c1,0x96));var _0x173c=function(_0x1bab22,_0x20d504){_0x1bab22=_0x1bab22-0x0;var _0x16e94a=_0x73c1[_0x1bab22];return _0x16e94a;};'use strict';var Sequelize=require(_0x173c('0x0'));module[_0x173c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x173c('0x2')]}};
\ No newline at end of file
index 6185e70..9df6a60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b07=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send','index','map','VtigerConfiguration','fieldName','type','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','keys','length','include','find','catch','create','body','getFields','findOne','rawAttributes','hasOwnProperty','getSubjects','VtigerField','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','jsforce'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4b07,0x1d6));var _0x74b0=function(_0x4a973e,_0x95a32c){_0x4a973e=_0x4a973e-0x0;var _0x30a334=_0x4b07[_0x4a973e];return _0x30a334;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x74b0('0x0'));var zipdir=require(_0x74b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74b0('0x2'));var moment=require(_0x74b0('0x3'));var BPromise=require(_0x74b0('0x4'));var Mustache=require(_0x74b0('0x5'));var util=require('util');var path=require(_0x74b0('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x74b0('0x7'));var _=require(_0x74b0('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x74b0('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x74b0('0xa'));var querystring=require(_0x74b0('0xb'));var Papa=require(_0x74b0('0xc'));var Redis=require(_0x74b0('0xd'));var authService=require(_0x74b0('0xe'));var qs=require(_0x74b0('0xf'));var as=require(_0x74b0('0x10'));var hardwareService=require(_0x74b0('0x11'));var logger=require(_0x74b0('0x12'))(_0x74b0('0x13'));var utils=require(_0x74b0('0x14'));var config=require(_0x74b0('0x15'));var licenseUtil=require(_0x74b0('0x16'));var db=require(_0x74b0('0x17'))['db'];function respondWithStatusCode(_0xf1ec58,_0x200f36){_0x200f36=_0x200f36||0xcc;return function(_0x4e9f47){if(_0x4e9f47){return _0xf1ec58[_0x74b0('0x18')](_0x200f36);}return _0xf1ec58[_0x74b0('0x19')](_0x200f36)['end']();};}function respondWithResult(_0xefd5f7,_0x49f519){_0x49f519=_0x49f519||0xc8;return function(_0x72f633){if(_0x72f633){return _0xefd5f7[_0x74b0('0x19')](_0x49f519)['json'](_0x72f633);}};}function respondWithFilteredResult(_0x4004d7,_0x50aa7d){return function(_0x3b002a){if(_0x3b002a){var _0x539172=typeof _0x50aa7d[_0x74b0('0x1a')]==='undefined'&&typeof _0x50aa7d[_0x74b0('0x1b')]===_0x74b0('0x1c');var _0x397ee4=_0x3b002a[_0x74b0('0x1d')];var _0x26deb1=_0x539172?0x0:_0x50aa7d[_0x74b0('0x1a')];var _0x8425cc=_0x539172?_0x3b002a[_0x74b0('0x1d')]:_0x50aa7d['offset']+_0x50aa7d['limit'];var _0x55ccc1;if(_0x8425cc>=_0x397ee4){_0x8425cc=_0x397ee4;_0x55ccc1=0xc8;}else{_0x55ccc1=0xce;}_0x4004d7[_0x74b0('0x19')](_0x55ccc1);return _0x4004d7['set'](_0x74b0('0x1e'),_0x26deb1+'-'+_0x8425cc+'/'+_0x397ee4)[_0x74b0('0x1f')](_0x3b002a);}return null;};}function patchUpdates(_0xc17e43){return function(_0x28a89e){try{jsonpatch['apply'](_0x28a89e,_0xc17e43,!![]);}catch(_0x18004b){return BPromise[_0x74b0('0x20')](_0x18004b);}return _0x28a89e[_0x74b0('0x21')]();};}function saveUpdates(_0xc6c020,_0x550ff7){return function(_0x44f568){if(_0x44f568){return _0x44f568[_0x74b0('0x22')](_0xc6c020)[_0x74b0('0x23')](function(_0x167dd7){return _0x167dd7;});}return null;};}function removeEntity(_0x3e70d5,_0x1396f3){return function(_0x7259f4){if(_0x7259f4){return _0x7259f4[_0x74b0('0x24')]()[_0x74b0('0x23')](function(){_0x3e70d5['status'](0xcc)[_0x74b0('0x25')]();});}};}function handleEntityNotFound(_0x5b6b58,_0x4e16b6){return function(_0x2166a5){if(!_0x2166a5){_0x5b6b58[_0x74b0('0x18')](0x194);}return _0x2166a5;};}function handleError(_0x3d89a1,_0x4e78e1){_0x4e78e1=_0x4e78e1||0x1f4;return function(_0x4e08a1){logger[_0x74b0('0x26')](_0x4e08a1[_0x74b0('0x27')]);if(_0x4e08a1[_0x74b0('0x28')]){delete _0x4e08a1['name'];}_0x3d89a1[_0x74b0('0x19')](_0x4e78e1)[_0x74b0('0x29')](_0x4e08a1);};}exports[_0x74b0('0x2a')]=function(_0x2163f4,_0x118ba5){var _0x1ab14d={},_0x5e9f98={},_0x2dc537={'count':0x0,'rows':[]};var _0x5be6cb=_[_0x74b0('0x2b')](db[_0x74b0('0x2c')]['rawAttributes'],function(_0x2b93ae){return{'name':_0x2b93ae[_0x74b0('0x2d')],'type':_0x2b93ae[_0x74b0('0x2e')]['key']};});_0x5e9f98['model']=_['map'](_0x5be6cb,_0x74b0('0x28'));_0x5e9f98[_0x74b0('0x2f')]=_['keys'](_0x2163f4[_0x74b0('0x2f')]);_0x5e9f98[_0x74b0('0x30')]=_[_0x74b0('0x31')](_0x5e9f98[_0x74b0('0x32')],_0x5e9f98[_0x74b0('0x2f')]);_0x1ab14d[_0x74b0('0x33')]=_['intersection'](_0x5e9f98[_0x74b0('0x32')],qs[_0x74b0('0x34')](_0x2163f4[_0x74b0('0x2f')]['fields']));_0x1ab14d[_0x74b0('0x33')]=_0x1ab14d[_0x74b0('0x33')]['length']?_0x1ab14d[_0x74b0('0x33')]:_0x5e9f98[_0x74b0('0x32')];if(!_0x2163f4[_0x74b0('0x2f')]['hasOwnProperty'](_0x74b0('0x35'))){_0x1ab14d[_0x74b0('0x1b')]=qs[_0x74b0('0x1b')](_0x2163f4['query']['limit']);_0x1ab14d[_0x74b0('0x1a')]=qs['offset'](_0x2163f4[_0x74b0('0x2f')][_0x74b0('0x1a')]);}_0x1ab14d[_0x74b0('0x36')]=qs[_0x74b0('0x37')](_0x2163f4[_0x74b0('0x2f')][_0x74b0('0x37')]);_0x1ab14d[_0x74b0('0x38')]=qs[_0x74b0('0x30')](_[_0x74b0('0x39')](_0x2163f4[_0x74b0('0x2f')],_0x5e9f98[_0x74b0('0x30')]),_0x5be6cb);if(_0x2163f4[_0x74b0('0x2f')][_0x74b0('0x3a')]){_0x1ab14d[_0x74b0('0x38')]=_[_0x74b0('0x3b')](_0x1ab14d[_0x74b0('0x38')],{'$or':_[_0x74b0('0x2b')](_0x5be6cb,function(_0x2526a5){if(_0x2526a5[_0x74b0('0x2e')]!==_0x74b0('0x3c')){var _0x1812ca={};_0x1812ca[_0x2526a5[_0x74b0('0x28')]]={'$like':'%'+_0x2163f4[_0x74b0('0x2f')][_0x74b0('0x3a')]+'%'};return _0x1812ca;}})});}_0x1ab14d=_['merge']({},_0x1ab14d,_0x2163f4[_0x74b0('0x3d')]);var _0x5c3c66={'where':_0x1ab14d['where']};return db['VtigerConfiguration'][_0x74b0('0x1d')](_0x5c3c66)[_0x74b0('0x23')](function(_0x1f1d81){_0x2dc537[_0x74b0('0x1d')]=_0x1f1d81;if(_0x2163f4[_0x74b0('0x2f')][_0x74b0('0x3e')]){_0x1ab14d['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0x74b0('0x3f')](_0x1ab14d);})[_0x74b0('0x23')](function(_0x409c65){_0x2dc537[_0x74b0('0x40')]=_0x409c65;return _0x2dc537;})[_0x74b0('0x23')](respondWithFilteredResult(_0x118ba5,_0x1ab14d))['catch'](handleError(_0x118ba5,null));};exports['show']=function(_0x4e20ec,_0xfbe12d){var _0x2ce541={'raw':![],'where':{'id':_0x4e20ec[_0x74b0('0x41')]['id']}},_0xffc84={};_0xffc84['model']=_[_0x74b0('0x42')](db[_0x74b0('0x2c')]['rawAttributes']);_0xffc84[_0x74b0('0x2f')]=_[_0x74b0('0x42')](_0x4e20ec['query']);_0xffc84[_0x74b0('0x30')]=_['intersection'](_0xffc84[_0x74b0('0x32')],_0xffc84[_0x74b0('0x2f')]);_0x2ce541[_0x74b0('0x33')]=_['intersection'](_0xffc84['model'],qs[_0x74b0('0x34')](_0x4e20ec['query'][_0x74b0('0x34')]));_0x2ce541['attributes']=_0x2ce541[_0x74b0('0x33')][_0x74b0('0x43')]?_0x2ce541[_0x74b0('0x33')]:_0xffc84[_0x74b0('0x32')];if(_0x4e20ec[_0x74b0('0x2f')][_0x74b0('0x3e')]){_0x2ce541[_0x74b0('0x44')]=[{'all':!![]}];}_0x2ce541=_[_0x74b0('0x3b')]({},_0x2ce541,_0x4e20ec[_0x74b0('0x3d')]);return db[_0x74b0('0x2c')][_0x74b0('0x45')](_0x2ce541)[_0x74b0('0x23')](handleEntityNotFound(_0xfbe12d,null))['then'](respondWithResult(_0xfbe12d,null))[_0x74b0('0x46')](handleError(_0xfbe12d,null));};exports['create']=function(_0x1f9672,_0x389ed){return db[_0x74b0('0x2c')][_0x74b0('0x47')](_0x1f9672[_0x74b0('0x48')],{})[_0x74b0('0x23')](respondWithResult(_0x389ed,0xc9))['catch'](handleError(_0x389ed,null));};exports['update']=function(_0x4edafa,_0x53551f){if(_0x4edafa[_0x74b0('0x48')]['id']){delete _0x4edafa[_0x74b0('0x48')]['id'];}return db['VtigerConfiguration'][_0x74b0('0x45')]({'where':{'id':_0x4edafa[_0x74b0('0x41')]['id']}})[_0x74b0('0x23')](handleEntityNotFound(_0x53551f,null))['then'](saveUpdates(_0x4edafa[_0x74b0('0x48')],null))[_0x74b0('0x23')](respondWithResult(_0x53551f,null))[_0x74b0('0x46')](handleError(_0x53551f,null));};exports[_0x74b0('0x24')]=function(_0x53bfb8,_0x122fbf){return db[_0x74b0('0x2c')][_0x74b0('0x45')]({'where':{'id':_0x53bfb8[_0x74b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x122fbf,null))[_0x74b0('0x23')](removeEntity(_0x122fbf,null))[_0x74b0('0x46')](handleError(_0x122fbf,null));};exports[_0x74b0('0x49')]=function(_0x1ecb14,_0x139e79,_0x492ae9){var _0x4c09ec={};var _0x4b7c26={};var _0x497b96;var _0xe82edf;return db[_0x74b0('0x2c')][_0x74b0('0x4a')]({'where':{'id':_0x1ecb14[_0x74b0('0x41')]['id']}})[_0x74b0('0x23')](handleEntityNotFound(_0x139e79,null))[_0x74b0('0x23')](function(_0x5210a3){if(_0x5210a3){_0x497b96=_0x5210a3;_0x4b7c26['model']=_[_0x74b0('0x42')](db['VtigerField'][_0x74b0('0x4b')]);_0x4b7c26[_0x74b0('0x2f')]=_[_0x74b0('0x42')](_0x1ecb14[_0x74b0('0x2f')]);_0x4b7c26['filters']=_['intersection'](_0x4b7c26[_0x74b0('0x32')],_0x4b7c26[_0x74b0('0x2f')]);_0x4c09ec[_0x74b0('0x33')]=_['intersection'](_0x4b7c26[_0x74b0('0x32')],qs['fields'](_0x1ecb14[_0x74b0('0x2f')][_0x74b0('0x34')]));_0x4c09ec['attributes']=_0x4c09ec['attributes'][_0x74b0('0x43')]?_0x4c09ec[_0x74b0('0x33')]:_0x4b7c26[_0x74b0('0x32')];_0x4c09ec['order']=qs['sort'](_0x1ecb14['query'][_0x74b0('0x37')]);_0x4c09ec[_0x74b0('0x38')]=qs[_0x74b0('0x30')](_[_0x74b0('0x39')](_0x1ecb14[_0x74b0('0x2f')],_0x4b7c26['filters']));if(_0x1ecb14[_0x74b0('0x2f')][_0x74b0('0x3a')]){_0x4c09ec['where']=_[_0x74b0('0x3b')](_0x4c09ec['where'],{'$or':_['map'](_0x4c09ec['attributes'],function(_0x13c6b4){var _0x56bf6c={};_0x56bf6c[_0x13c6b4]={'$like':'%'+_0x1ecb14[_0x74b0('0x2f')][_0x74b0('0x3a')]+'%'};return _0x56bf6c;})});}_0x4c09ec=_[_0x74b0('0x3b')]({},_0x4c09ec,_0x1ecb14['options']);return _0x497b96[_0x74b0('0x49')](_0x4c09ec);}})[_0x74b0('0x23')](function(_0x286428){if(_0x286428){_0xe82edf=_0x286428[_0x74b0('0x43')];if(!_0x1ecb14['query'][_0x74b0('0x4c')]('nolimit')){_0x4c09ec[_0x74b0('0x1b')]=qs['limit'](_0x1ecb14[_0x74b0('0x2f')][_0x74b0('0x1b')]);_0x4c09ec[_0x74b0('0x1a')]=qs[_0x74b0('0x1a')](_0x1ecb14['query'][_0x74b0('0x1a')]);}return _0x497b96[_0x74b0('0x49')](_0x4c09ec);}})[_0x74b0('0x23')](function(_0x187d02){if(_0x187d02){return _0x187d02?{'count':_0xe82edf,'rows':_0x187d02}:null;}})[_0x74b0('0x23')](respondWithResult(_0x139e79,null))[_0x74b0('0x46')](handleError(_0x139e79,null));};exports[_0x74b0('0x4d')]=function(_0x1f6859,_0x5a8dac,_0x560117){var _0x3d40fa={};var _0x2dc687={};var _0x5ad44f;var _0x482a5c;return db[_0x74b0('0x2c')][_0x74b0('0x4a')]({'where':{'id':_0x1f6859[_0x74b0('0x41')]['id']}})[_0x74b0('0x23')](handleEntityNotFound(_0x5a8dac,null))[_0x74b0('0x23')](function(_0x2a39bf){if(_0x2a39bf){_0x5ad44f=_0x2a39bf;_0x2dc687[_0x74b0('0x32')]=_['keys'](db[_0x74b0('0x4e')][_0x74b0('0x4b')]);_0x2dc687['query']=_[_0x74b0('0x42')](_0x1f6859[_0x74b0('0x2f')]);_0x2dc687[_0x74b0('0x30')]=_['intersection'](_0x2dc687[_0x74b0('0x32')],_0x2dc687[_0x74b0('0x2f')]);_0x3d40fa[_0x74b0('0x33')]=_['intersection'](_0x2dc687[_0x74b0('0x32')],qs[_0x74b0('0x34')](_0x1f6859[_0x74b0('0x2f')]['fields']));_0x3d40fa[_0x74b0('0x33')]=_0x3d40fa['attributes'][_0x74b0('0x43')]?_0x3d40fa['attributes']:_0x2dc687[_0x74b0('0x32')];_0x3d40fa[_0x74b0('0x36')]=qs[_0x74b0('0x37')](_0x1f6859['query'][_0x74b0('0x37')]);_0x3d40fa[_0x74b0('0x38')]=qs[_0x74b0('0x30')](_[_0x74b0('0x39')](_0x1f6859[_0x74b0('0x2f')],_0x2dc687[_0x74b0('0x30')]));if(_0x1f6859[_0x74b0('0x2f')][_0x74b0('0x3a')]){_0x3d40fa[_0x74b0('0x38')]=_[_0x74b0('0x3b')](_0x3d40fa[_0x74b0('0x38')],{'$or':_[_0x74b0('0x2b')](_0x3d40fa[_0x74b0('0x33')],function(_0x46089f){var _0x5417a6={};_0x5417a6[_0x46089f]={'$like':'%'+_0x1f6859[_0x74b0('0x2f')][_0x74b0('0x3a')]+'%'};return _0x5417a6;})});}_0x3d40fa=_['merge']({},_0x3d40fa,_0x1f6859['options']);return _0x5ad44f[_0x74b0('0x4d')](_0x3d40fa);}})[_0x74b0('0x23')](function(_0x3d45af){if(_0x3d45af){_0x482a5c=_0x3d45af['length'];if(!_0x1f6859[_0x74b0('0x2f')][_0x74b0('0x4c')](_0x74b0('0x35'))){_0x3d40fa[_0x74b0('0x1b')]=qs[_0x74b0('0x1b')](_0x1f6859[_0x74b0('0x2f')][_0x74b0('0x1b')]);_0x3d40fa[_0x74b0('0x1a')]=qs['offset'](_0x1f6859[_0x74b0('0x2f')][_0x74b0('0x1a')]);}return _0x5ad44f[_0x74b0('0x4d')](_0x3d40fa);}})['then'](function(_0x39f4d3){if(_0x39f4d3){return _0x39f4d3?{'count':_0x482a5c,'rows':_0x39f4d3}:null;}})[_0x74b0('0x23')](respondWithResult(_0x5a8dac,null))[_0x74b0('0x46')](handleError(_0x5a8dac,null));};exports[_0x74b0('0x4f')]=function(_0x45b20d,_0x2a88ae,_0x1b95a1){var _0x22c9f8={};var _0xcf6262={};var _0x2e52d4;var _0xef618e;return db['VtigerConfiguration'][_0x74b0('0x4a')]({'where':{'id':_0x45b20d[_0x74b0('0x41')]['id']}})[_0x74b0('0x23')](handleEntityNotFound(_0x2a88ae,null))['then'](function(_0x2643de){if(_0x2643de){_0x2e52d4=_0x2643de;_0xcf6262[_0x74b0('0x32')]=_['keys'](db[_0x74b0('0x4e')][_0x74b0('0x4b')]);_0xcf6262[_0x74b0('0x2f')]=_[_0x74b0('0x42')](_0x45b20d[_0x74b0('0x2f')]);_0xcf6262[_0x74b0('0x30')]=_['intersection'](_0xcf6262['model'],_0xcf6262[_0x74b0('0x2f')]);_0x22c9f8[_0x74b0('0x33')]=_[_0x74b0('0x31')](_0xcf6262[_0x74b0('0x32')],qs[_0x74b0('0x34')](_0x45b20d['query']['fields']));_0x22c9f8[_0x74b0('0x33')]=_0x22c9f8[_0x74b0('0x33')][_0x74b0('0x43')]?_0x22c9f8['attributes']:_0xcf6262[_0x74b0('0x32')];_0x22c9f8['order']=qs['sort'](_0x45b20d['query'][_0x74b0('0x37')]);_0x22c9f8[_0x74b0('0x38')]=qs[_0x74b0('0x30')](_[_0x74b0('0x39')](_0x45b20d[_0x74b0('0x2f')],_0xcf6262[_0x74b0('0x30')]));if(_0x45b20d['query'][_0x74b0('0x3a')]){_0x22c9f8[_0x74b0('0x38')]=_[_0x74b0('0x3b')](_0x22c9f8['where'],{'$or':_['map'](_0x22c9f8[_0x74b0('0x33')],function(_0x479b1a){var _0x16b216={};_0x16b216[_0x479b1a]={'$like':'%'+_0x45b20d['query'][_0x74b0('0x3a')]+'%'};return _0x16b216;})});}_0x22c9f8=_[_0x74b0('0x3b')]({},_0x22c9f8,_0x45b20d[_0x74b0('0x3d')]);return _0x2e52d4[_0x74b0('0x4f')](_0x22c9f8);}})[_0x74b0('0x23')](function(_0x4c1190){if(_0x4c1190){_0xef618e=_0x4c1190[_0x74b0('0x43')];if(!_0x45b20d[_0x74b0('0x2f')][_0x74b0('0x4c')]('nolimit')){_0x22c9f8['limit']=qs['limit'](_0x45b20d['query'][_0x74b0('0x1b')]);_0x22c9f8['offset']=qs[_0x74b0('0x1a')](_0x45b20d[_0x74b0('0x2f')]['offset']);}return _0x2e52d4[_0x74b0('0x4f')](_0x22c9f8);}})[_0x74b0('0x23')](function(_0x2d9ced){if(_0x2d9ced){return _0x2d9ced?{'count':_0xef618e,'rows':_0x2d9ced}:null;}})['then'](respondWithResult(_0x2a88ae,null))['catch'](handleError(_0x2a88ae,null));};
\ No newline at end of file
+var _0x0693=['hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','getFields','findOne','VtigerField','length','getSubjects','pick','getDescriptions','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','Content-Range','reject','save','update','destroy','then','sendStatus','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0x0693,0xb2));var _0x3069=function(_0x17bfa1,_0x5205a1){_0x17bfa1=_0x17bfa1-0x0;var _0xc2a16e=_0x0693[_0x17bfa1];return _0xc2a16e;};'use strict';var emlformat=require(_0x3069('0x0'));var rimraf=require(_0x3069('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3069('0x2'));var rp=require('request-promise');var moment=require(_0x3069('0x3'));var BPromise=require(_0x3069('0x4'));var Mustache=require(_0x3069('0x5'));var util=require(_0x3069('0x6'));var path=require('path');var sox=require(_0x3069('0x7'));var csv=require(_0x3069('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3069('0x9'));var squel=require(_0x3069('0xa'));var crypto=require(_0x3069('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3069('0xc'));var qs=require(_0x3069('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3069('0xe'));var logger=require(_0x3069('0xf'))('api');var utils=require(_0x3069('0x10'));var config=require(_0x3069('0x11'));var licenseUtil=require(_0x3069('0x12'));var db=require(_0x3069('0x13'))['db'];function respondWithStatusCode(_0x550dce,_0x3aa64d){_0x3aa64d=_0x3aa64d||0xcc;return function(_0x39bcc0){if(_0x39bcc0){return _0x550dce['sendStatus'](_0x3aa64d);}return _0x550dce[_0x3069('0x14')](_0x3aa64d)[_0x3069('0x15')]();};}function respondWithResult(_0xf4e8c2,_0x21922e){_0x21922e=_0x21922e||0xc8;return function(_0x33077f){if(_0x33077f){return _0xf4e8c2[_0x3069('0x14')](_0x21922e)[_0x3069('0x16')](_0x33077f);}};}function respondWithFilteredResult(_0x388204,_0x179834){return function(_0x4b9409){if(_0x4b9409){var _0x39b164=typeof _0x179834[_0x3069('0x17')]===_0x3069('0x18')&&typeof _0x179834['limit']===_0x3069('0x18');var _0x2efcbe=_0x4b9409[_0x3069('0x19')];var _0x9f8946=_0x39b164?0x0:_0x179834[_0x3069('0x17')];var _0x2c3076=_0x39b164?_0x4b9409['count']:_0x179834[_0x3069('0x17')]+_0x179834['limit'];var _0xec6775;if(_0x2c3076>=_0x2efcbe){_0x2c3076=_0x2efcbe;_0xec6775=0xc8;}else{_0xec6775=0xce;}_0x388204[_0x3069('0x14')](_0xec6775);return _0x388204['set'](_0x3069('0x1a'),_0x9f8946+'-'+_0x2c3076+'/'+_0x2efcbe)['json'](_0x4b9409);}return null;};}function patchUpdates(_0xace6d2){return function(_0x316516){try{jsonpatch['apply'](_0x316516,_0xace6d2,!![]);}catch(_0x401a0d){return BPromise[_0x3069('0x1b')](_0x401a0d);}return _0x316516[_0x3069('0x1c')]();};}function saveUpdates(_0x4ab140,_0x55c842){return function(_0x4b9b30){if(_0x4b9b30){return _0x4b9b30[_0x3069('0x1d')](_0x4ab140)['then'](function(_0x45f214){return _0x45f214;});}return null;};}function removeEntity(_0x370c7e,_0x463783){return function(_0x558481){if(_0x558481){return _0x558481[_0x3069('0x1e')]()[_0x3069('0x1f')](function(){_0x370c7e[_0x3069('0x14')](0xcc)[_0x3069('0x15')]();});}};}function handleEntityNotFound(_0x5ea3f4,_0x11538e){return function(_0x57d83e){if(!_0x57d83e){_0x5ea3f4[_0x3069('0x20')](0x194);}return _0x57d83e;};}function handleError(_0x5e8a63,_0x304e52){_0x304e52=_0x304e52||0x1f4;return function(_0xff52a5){logger['error'](_0xff52a5[_0x3069('0x21')]);if(_0xff52a5[_0x3069('0x22')]){delete _0xff52a5['name'];}_0x5e8a63[_0x3069('0x14')](_0x304e52)[_0x3069('0x23')](_0xff52a5);};}exports[_0x3069('0x24')]=function(_0x3b0c54,_0x3de8dd){var _0x53a235={},_0x469973={},_0x3f5b71={'count':0x0,'rows':[]};var _0x11dfc0=_[_0x3069('0x25')](db[_0x3069('0x26')][_0x3069('0x27')],function(_0x74b563){return{'name':_0x74b563[_0x3069('0x28')],'type':_0x74b563[_0x3069('0x29')][_0x3069('0x2a')]};});_0x469973['model']=_[_0x3069('0x25')](_0x11dfc0,_0x3069('0x22'));_0x469973[_0x3069('0x2b')]=_[_0x3069('0x2c')](_0x3b0c54[_0x3069('0x2b')]);_0x469973[_0x3069('0x2d')]=_[_0x3069('0x2e')](_0x469973[_0x3069('0x2f')],_0x469973[_0x3069('0x2b')]);_0x53a235[_0x3069('0x30')]=_[_0x3069('0x2e')](_0x469973[_0x3069('0x2f')],qs[_0x3069('0x31')](_0x3b0c54[_0x3069('0x2b')][_0x3069('0x31')]));_0x53a235['attributes']=_0x53a235[_0x3069('0x30')]['length']?_0x53a235[_0x3069('0x30')]:_0x469973[_0x3069('0x2f')];if(!_0x3b0c54[_0x3069('0x2b')][_0x3069('0x32')](_0x3069('0x33'))){_0x53a235['limit']=qs['limit'](_0x3b0c54[_0x3069('0x2b')][_0x3069('0x34')]);_0x53a235[_0x3069('0x17')]=qs[_0x3069('0x17')](_0x3b0c54[_0x3069('0x2b')][_0x3069('0x17')]);}_0x53a235[_0x3069('0x35')]=qs[_0x3069('0x36')](_0x3b0c54[_0x3069('0x2b')][_0x3069('0x36')]);_0x53a235[_0x3069('0x37')]=qs[_0x3069('0x2d')](_['pick'](_0x3b0c54[_0x3069('0x2b')],_0x469973[_0x3069('0x2d')]),_0x11dfc0);if(_0x3b0c54[_0x3069('0x2b')][_0x3069('0x38')]){_0x53a235[_0x3069('0x37')]=_[_0x3069('0x39')](_0x53a235[_0x3069('0x37')],{'$or':_[_0x3069('0x25')](_0x11dfc0,function(_0x5c9bdf){if(_0x5c9bdf['type']!==_0x3069('0x3a')){var _0x5117b7={};_0x5117b7[_0x5c9bdf[_0x3069('0x22')]]={'$like':'%'+_0x3b0c54['query'][_0x3069('0x38')]+'%'};return _0x5117b7;}})});}_0x53a235=_['merge']({},_0x53a235,_0x3b0c54['options']);var _0x27f368={'where':_0x53a235[_0x3069('0x37')]};return db['VtigerConfiguration'][_0x3069('0x19')](_0x27f368)[_0x3069('0x1f')](function(_0x1341ea){_0x3f5b71[_0x3069('0x19')]=_0x1341ea;if(_0x3b0c54['query'][_0x3069('0x3b')]){_0x53a235[_0x3069('0x3c')]=[{'all':!![]}];}return db[_0x3069('0x26')]['findAll'](_0x53a235);})[_0x3069('0x1f')](function(_0x4e871a){_0x3f5b71[_0x3069('0x3d')]=_0x4e871a;return _0x3f5b71;})[_0x3069('0x1f')](respondWithFilteredResult(_0x3de8dd,_0x53a235))[_0x3069('0x3e')](handleError(_0x3de8dd,null));};exports[_0x3069('0x3f')]=function(_0x59ed0f,_0x13448c){var _0x4c70d5={'raw':![],'where':{'id':_0x59ed0f[_0x3069('0x40')]['id']}},_0x5f2275={};_0x5f2275[_0x3069('0x2f')]=_[_0x3069('0x2c')](db[_0x3069('0x26')]['rawAttributes']);_0x5f2275[_0x3069('0x2b')]=_['keys'](_0x59ed0f['query']);_0x5f2275['filters']=_[_0x3069('0x2e')](_0x5f2275['model'],_0x5f2275['query']);_0x4c70d5[_0x3069('0x30')]=_[_0x3069('0x2e')](_0x5f2275['model'],qs[_0x3069('0x31')](_0x59ed0f[_0x3069('0x2b')][_0x3069('0x31')]));_0x4c70d5[_0x3069('0x30')]=_0x4c70d5[_0x3069('0x30')]['length']?_0x4c70d5['attributes']:_0x5f2275[_0x3069('0x2f')];if(_0x59ed0f['query'][_0x3069('0x3b')]){_0x4c70d5['include']=[{'all':!![]}];}_0x4c70d5=_[_0x3069('0x39')]({},_0x4c70d5,_0x59ed0f[_0x3069('0x41')]);return db[_0x3069('0x26')][_0x3069('0x42')](_0x4c70d5)[_0x3069('0x1f')](handleEntityNotFound(_0x13448c,null))[_0x3069('0x1f')](respondWithResult(_0x13448c,null))['catch'](handleError(_0x13448c,null));};exports[_0x3069('0x43')]=function(_0x47452d,_0x187fc6){return db[_0x3069('0x26')][_0x3069('0x43')](_0x47452d['body'],{})[_0x3069('0x1f')](respondWithResult(_0x187fc6,0xc9))[_0x3069('0x3e')](handleError(_0x187fc6,null));};exports[_0x3069('0x1d')]=function(_0x4c3471,_0x3744f6){if(_0x4c3471[_0x3069('0x44')]['id']){delete _0x4c3471[_0x3069('0x44')]['id'];}return db[_0x3069('0x26')][_0x3069('0x42')]({'where':{'id':_0x4c3471['params']['id']}})[_0x3069('0x1f')](handleEntityNotFound(_0x3744f6,null))['then'](saveUpdates(_0x4c3471[_0x3069('0x44')],null))['then'](respondWithResult(_0x3744f6,null))[_0x3069('0x3e')](handleError(_0x3744f6,null));};exports[_0x3069('0x1e')]=function(_0x5313a1,_0x1ffcad){return db['VtigerConfiguration'][_0x3069('0x42')]({'where':{'id':_0x5313a1['params']['id']}})[_0x3069('0x1f')](handleEntityNotFound(_0x1ffcad,null))['then'](removeEntity(_0x1ffcad,null))[_0x3069('0x3e')](handleError(_0x1ffcad,null));};exports[_0x3069('0x45')]=function(_0xe908cc,_0x11cc21,_0x53bfd2){var _0x522ff5={};var _0x54f07a={};var _0x35dad8;var _0x5984e7;return db[_0x3069('0x26')][_0x3069('0x46')]({'where':{'id':_0xe908cc[_0x3069('0x40')]['id']}})[_0x3069('0x1f')](handleEntityNotFound(_0x11cc21,null))[_0x3069('0x1f')](function(_0x237c25){if(_0x237c25){_0x35dad8=_0x237c25;_0x54f07a[_0x3069('0x2f')]=_[_0x3069('0x2c')](db[_0x3069('0x47')][_0x3069('0x27')]);_0x54f07a[_0x3069('0x2b')]=_[_0x3069('0x2c')](_0xe908cc[_0x3069('0x2b')]);_0x54f07a[_0x3069('0x2d')]=_['intersection'](_0x54f07a[_0x3069('0x2f')],_0x54f07a[_0x3069('0x2b')]);_0x522ff5['attributes']=_[_0x3069('0x2e')](_0x54f07a['model'],qs[_0x3069('0x31')](_0xe908cc[_0x3069('0x2b')]['fields']));_0x522ff5['attributes']=_0x522ff5['attributes']['length']?_0x522ff5['attributes']:_0x54f07a[_0x3069('0x2f')];_0x522ff5[_0x3069('0x35')]=qs[_0x3069('0x36')](_0xe908cc['query']['sort']);_0x522ff5['where']=qs[_0x3069('0x2d')](_['pick'](_0xe908cc[_0x3069('0x2b')],_0x54f07a[_0x3069('0x2d')]));if(_0xe908cc[_0x3069('0x2b')][_0x3069('0x38')]){_0x522ff5[_0x3069('0x37')]=_[_0x3069('0x39')](_0x522ff5[_0x3069('0x37')],{'$or':_['map'](_0x522ff5['attributes'],function(_0x2adb2d){var _0x31b1a6={};_0x31b1a6[_0x2adb2d]={'$like':'%'+_0xe908cc[_0x3069('0x2b')][_0x3069('0x38')]+'%'};return _0x31b1a6;})});}_0x522ff5=_[_0x3069('0x39')]({},_0x522ff5,_0xe908cc[_0x3069('0x41')]);return _0x35dad8[_0x3069('0x45')](_0x522ff5);}})[_0x3069('0x1f')](function(_0x1bd560){if(_0x1bd560){_0x5984e7=_0x1bd560[_0x3069('0x48')];if(!_0xe908cc['query'][_0x3069('0x32')](_0x3069('0x33'))){_0x522ff5[_0x3069('0x34')]=qs[_0x3069('0x34')](_0xe908cc[_0x3069('0x2b')][_0x3069('0x34')]);_0x522ff5['offset']=qs[_0x3069('0x17')](_0xe908cc[_0x3069('0x2b')][_0x3069('0x17')]);}return _0x35dad8[_0x3069('0x45')](_0x522ff5);}})[_0x3069('0x1f')](function(_0x13e016){if(_0x13e016){return _0x13e016?{'count':_0x5984e7,'rows':_0x13e016}:null;}})['then'](respondWithResult(_0x11cc21,null))['catch'](handleError(_0x11cc21,null));};exports[_0x3069('0x49')]=function(_0x21cc58,_0x2cdec2,_0x437304){var _0x3bb3c4={};var _0x2debca={};var _0x1b6771;var _0x1e0a68;return db[_0x3069('0x26')][_0x3069('0x46')]({'where':{'id':_0x21cc58[_0x3069('0x40')]['id']}})[_0x3069('0x1f')](handleEntityNotFound(_0x2cdec2,null))['then'](function(_0x4f3100){if(_0x4f3100){_0x1b6771=_0x4f3100;_0x2debca[_0x3069('0x2f')]=_[_0x3069('0x2c')](db[_0x3069('0x47')][_0x3069('0x27')]);_0x2debca[_0x3069('0x2b')]=_[_0x3069('0x2c')](_0x21cc58[_0x3069('0x2b')]);_0x2debca[_0x3069('0x2d')]=_[_0x3069('0x2e')](_0x2debca['model'],_0x2debca[_0x3069('0x2b')]);_0x3bb3c4['attributes']=_[_0x3069('0x2e')](_0x2debca[_0x3069('0x2f')],qs[_0x3069('0x31')](_0x21cc58['query'][_0x3069('0x31')]));_0x3bb3c4[_0x3069('0x30')]=_0x3bb3c4[_0x3069('0x30')][_0x3069('0x48')]?_0x3bb3c4[_0x3069('0x30')]:_0x2debca[_0x3069('0x2f')];_0x3bb3c4[_0x3069('0x35')]=qs[_0x3069('0x36')](_0x21cc58['query'][_0x3069('0x36')]);_0x3bb3c4['where']=qs['filters'](_[_0x3069('0x4a')](_0x21cc58[_0x3069('0x2b')],_0x2debca['filters']));if(_0x21cc58[_0x3069('0x2b')]['filter']){_0x3bb3c4[_0x3069('0x37')]=_[_0x3069('0x39')](_0x3bb3c4[_0x3069('0x37')],{'$or':_[_0x3069('0x25')](_0x3bb3c4[_0x3069('0x30')],function(_0x547e8c){var _0x5e8c5e={};_0x5e8c5e[_0x547e8c]={'$like':'%'+_0x21cc58[_0x3069('0x2b')][_0x3069('0x38')]+'%'};return _0x5e8c5e;})});}_0x3bb3c4=_[_0x3069('0x39')]({},_0x3bb3c4,_0x21cc58[_0x3069('0x41')]);return _0x1b6771[_0x3069('0x49')](_0x3bb3c4);}})['then'](function(_0x47a92f){if(_0x47a92f){_0x1e0a68=_0x47a92f[_0x3069('0x48')];if(!_0x21cc58[_0x3069('0x2b')][_0x3069('0x32')](_0x3069('0x33'))){_0x3bb3c4[_0x3069('0x34')]=qs[_0x3069('0x34')](_0x21cc58[_0x3069('0x2b')][_0x3069('0x34')]);_0x3bb3c4[_0x3069('0x17')]=qs[_0x3069('0x17')](_0x21cc58[_0x3069('0x2b')][_0x3069('0x17')]);}return _0x1b6771['getSubjects'](_0x3bb3c4);}})[_0x3069('0x1f')](function(_0x4a3d48){if(_0x4a3d48){return _0x4a3d48?{'count':_0x1e0a68,'rows':_0x4a3d48}:null;}})[_0x3069('0x1f')](respondWithResult(_0x2cdec2,null))[_0x3069('0x3e')](handleError(_0x2cdec2,null));};exports['getDescriptions']=function(_0x3ace8d,_0x292eb4,_0x5dd01c){var _0x4c1450={};var _0x15c6d0={};var _0x5534c9;var _0x1d218f;return db[_0x3069('0x26')][_0x3069('0x46')]({'where':{'id':_0x3ace8d[_0x3069('0x40')]['id']}})['then'](handleEntityNotFound(_0x292eb4,null))[_0x3069('0x1f')](function(_0x59376a){if(_0x59376a){_0x5534c9=_0x59376a;_0x15c6d0['model']=_[_0x3069('0x2c')](db['VtigerField'][_0x3069('0x27')]);_0x15c6d0[_0x3069('0x2b')]=_[_0x3069('0x2c')](_0x3ace8d['query']);_0x15c6d0[_0x3069('0x2d')]=_[_0x3069('0x2e')](_0x15c6d0[_0x3069('0x2f')],_0x15c6d0[_0x3069('0x2b')]);_0x4c1450[_0x3069('0x30')]=_[_0x3069('0x2e')](_0x15c6d0[_0x3069('0x2f')],qs[_0x3069('0x31')](_0x3ace8d[_0x3069('0x2b')][_0x3069('0x31')]));_0x4c1450['attributes']=_0x4c1450[_0x3069('0x30')][_0x3069('0x48')]?_0x4c1450[_0x3069('0x30')]:_0x15c6d0[_0x3069('0x2f')];_0x4c1450[_0x3069('0x35')]=qs['sort'](_0x3ace8d[_0x3069('0x2b')][_0x3069('0x36')]);_0x4c1450[_0x3069('0x37')]=qs[_0x3069('0x2d')](_[_0x3069('0x4a')](_0x3ace8d[_0x3069('0x2b')],_0x15c6d0[_0x3069('0x2d')]));if(_0x3ace8d[_0x3069('0x2b')]['filter']){_0x4c1450[_0x3069('0x37')]=_[_0x3069('0x39')](_0x4c1450[_0x3069('0x37')],{'$or':_[_0x3069('0x25')](_0x4c1450[_0x3069('0x30')],function(_0x281f12){var _0x4ab9ca={};_0x4ab9ca[_0x281f12]={'$like':'%'+_0x3ace8d[_0x3069('0x2b')][_0x3069('0x38')]+'%'};return _0x4ab9ca;})});}_0x4c1450=_['merge']({},_0x4c1450,_0x3ace8d[_0x3069('0x41')]);return _0x5534c9[_0x3069('0x4b')](_0x4c1450);}})[_0x3069('0x1f')](function(_0x50e309){if(_0x50e309){_0x1d218f=_0x50e309['length'];if(!_0x3ace8d[_0x3069('0x2b')][_0x3069('0x32')]('nolimit')){_0x4c1450[_0x3069('0x34')]=qs[_0x3069('0x34')](_0x3ace8d[_0x3069('0x2b')][_0x3069('0x34')]);_0x4c1450[_0x3069('0x17')]=qs[_0x3069('0x17')](_0x3ace8d['query']['offset']);}return _0x5534c9[_0x3069('0x4b')](_0x4c1450);}})['then'](function(_0x12ff49){if(_0x12ff49){return _0x12ff49?{'count':_0x1d218f,'rows':_0x12ff49}:null;}})[_0x3069('0x1f')](respondWithResult(_0x292eb4,null))[_0x3069('0x3e')](handleError(_0x292eb4,null));};
\ No newline at end of file
index a6ba71d..973256c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4869=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','api'];(function(_0x5f4cd7,_0x459c44){var _0x47c93f=function(_0x11f384){while(--_0x11f384){_0x5f4cd7['push'](_0x5f4cd7['shift']());}};_0x47c93f(++_0x459c44);}(_0x4869,0xa5));var _0x9486=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x4869[_0x24061a];return _0x82054e;};'use strict';var _=require('lodash');var util=require(_0x9486('0x0'));var logger=require(_0x9486('0x1'))(_0x9486('0x2'));var moment=require(_0x9486('0x3'));var BPromise=require(_0x9486('0x4'));var rp=require(_0x9486('0x5'));var fs=require('fs');var path=require(_0x9486('0x6'));var rimraf=require(_0x9486('0x7'));var config=require(_0x9486('0x8'));var attributes=require(_0x9486('0x9'));module[_0x9486('0xa')]=function(_0x111946,_0x4313e0){return _0x111946[_0x9486('0xb')](_0x9486('0xc'),attributes,{'tableName':_0x9486('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a8d=['lodash','util','../../config/logger','api','bluebird','path','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x7a8d,0x176));var _0xd7a8=function(_0x577aeb,_0x20d298){_0x577aeb=_0x577aeb-0x0;var _0x5bbfe3=_0x7a8d[_0x577aeb];return _0x5bbfe3;};'use strict';var _=require(_0xd7a8('0x0'));var util=require(_0xd7a8('0x1'));var logger=require(_0xd7a8('0x2'))(_0xd7a8('0x3'));var moment=require('moment');var BPromise=require(_0xd7a8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd7a8('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd7a8('0x6'));module[_0xd7a8('0x7')]=function(_0x5d924e,_0x10cc9b){return _0x5d924e[_0xd7a8('0x8')](_0xd7a8('0x9'),attributes,{'tableName':_0xd7a8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0b61be2..d556571 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa33d=['then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa33d,0x11c));var _0xda33=function(_0x46b931,_0x46cc3b){_0x46b931=_0x46b931-0x0;var _0x220d94=_0xa33d[_0x46b931];return _0x220d94;};'use strict';var _=require(_0xda33('0x0'));var util=require(_0xda33('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda33('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xda33('0x3'));var logger=require(_0xda33('0x4'))(_0xda33('0x5'));var config=require(_0xda33('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xda33('0x7')][_0xda33('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2968e2,_0x2a2a53,_0x2fc75d){return new BPromise(function(_0x3f3c2b,_0x425bf8){return client[_0xda33('0x9')](_0x2968e2,_0x2fc75d)[_0xda33('0xa')](function(_0x50991d){logger[_0xda33('0xb')](_0xda33('0xc'),_0x2a2a53,_0xda33('0xd'));logger[_0xda33('0xe')](_0xda33('0xf'),_0x2a2a53,_0xda33('0xd'),JSON[_0xda33('0x10')](_0x50991d));if(_0x50991d[_0xda33('0x11')]){if(_0x50991d[_0xda33('0x11')][_0xda33('0x12')]===0x1f4){logger[_0xda33('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x2a2a53,_0x50991d['error'][_0xda33('0x13')]);return _0x425bf8(_0x50991d[_0xda33('0x11')][_0xda33('0x13')]);}logger[_0xda33('0x11')](_0xda33('0xc'),_0x2a2a53,_0x50991d['error'][_0xda33('0x13')]);return _0x3f3c2b(_0x50991d[_0xda33('0x11')][_0xda33('0x13')]);}else{logger[_0xda33('0xb')](_0xda33('0xc'),_0x2a2a53,_0xda33('0xd'));_0x3f3c2b(_0x50991d[_0xda33('0x14')][_0xda33('0x13')]);}})['catch'](function(_0x209626){logger[_0xda33('0x11')](_0xda33('0xc'),_0x2a2a53,_0x209626);_0x425bf8(_0x209626);});});}
\ No newline at end of file
+var _0xdfc9=['debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdfc9,0x114));var _0x9dfc=function(_0x41075d,_0x112862){_0x41075d=_0x41075d-0x0;var _0x11f102=_0xdfc9[_0x41075d];return _0x11f102;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9dfc('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9dfc('0x1'))['db'];var utils=require(_0x9dfc('0x2'));var logger=require('../../config/logger')(_0x9dfc('0x3'));var config=require(_0x9dfc('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x9dfc('0x5')][_0x9dfc('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x30d270,_0x6a43c8,_0x39bede){return new BPromise(function(_0xfa61c9,_0x5bbe75){return client[_0x9dfc('0x7')](_0x30d270,_0x39bede)[_0x9dfc('0x8')](function(_0x3dd6f4){logger[_0x9dfc('0x9')](_0x9dfc('0xa'),_0x6a43c8,_0x9dfc('0xb'));logger[_0x9dfc('0xc')](_0x9dfc('0xd'),_0x6a43c8,'request\x20sent',JSON[_0x9dfc('0xe')](_0x3dd6f4));if(_0x3dd6f4[_0x9dfc('0xf')]){if(_0x3dd6f4[_0x9dfc('0xf')][_0x9dfc('0x10')]===0x1f4){logger['error'](_0x9dfc('0xa'),_0x6a43c8,_0x3dd6f4['error'][_0x9dfc('0x11')]);return _0x5bbe75(_0x3dd6f4['error'][_0x9dfc('0x11')]);}logger[_0x9dfc('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x6a43c8,_0x3dd6f4[_0x9dfc('0xf')][_0x9dfc('0x11')]);return _0xfa61c9(_0x3dd6f4['error'][_0x9dfc('0x11')]);}else{logger[_0x9dfc('0x9')](_0x9dfc('0xa'),_0x6a43c8,_0x9dfc('0xb'));_0xfa61c9(_0x3dd6f4['result']['message']);}})['catch'](function(_0x12f86d){logger[_0x9dfc('0xf')](_0x9dfc('0xa'),_0x6a43c8,_0x12f86d);_0x5bbe75(_0x12f86d);});});}
\ No newline at end of file
index 0761223..6149609 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6490=['/:id','post','create','delete','exports','multer','util','path','express','Router','fs-extra','./intVtigerField.controller','isAuthenticated','index'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0x6490,0x139));var _0x0649=function(_0x2ef608,_0x53a7b1){_0x2ef608=_0x2ef608-0x0;var _0x56aa07=_0x6490[_0x2ef608];return _0x56aa07;};'use strict';var multer=require(_0x0649('0x0'));var util=require(_0x0649('0x1'));var path=require(_0x0649('0x2'));var timeout=require('connect-timeout');var express=require(_0x0649('0x3'));var router=express[_0x0649('0x4')]();var fs_extra=require(_0x0649('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0649('0x6'));router['get']('/',auth[_0x0649('0x7')](),controller[_0x0649('0x8')]);router['get'](_0x0649('0x9'),auth[_0x0649('0x7')](),controller['show']);router[_0x0649('0xa')]('/',auth[_0x0649('0x7')](),controller[_0x0649('0xb')]);router['put']('/:id',auth[_0x0649('0x7')](),controller['update']);router[_0x0649('0xc')](_0x0649('0x9'),auth[_0x0649('0x7')](),controller['destroy']);module[_0x0649('0xd')]=router;
\ No newline at end of file
+var _0xc9cd=['delete','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','get','show','/:id','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc9cd,0xf0));var _0xdc9c=function(_0x3789b9,_0x5c2f00){_0x3789b9=_0x3789b9-0x0;var _0x4d020d=_0xc9cd[_0x3789b9];return _0x4d020d;};'use strict';var multer=require('multer');var util=require(_0xdc9c('0x0'));var path=require(_0xdc9c('0x1'));var timeout=require('connect-timeout');var express=require(_0xdc9c('0x2'));var router=express[_0xdc9c('0x3')]();var fs_extra=require(_0xdc9c('0x4'));var auth=require(_0xdc9c('0x5'));var interaction=require(_0xdc9c('0x6'));var config=require(_0xdc9c('0x7'));var controller=require(_0xdc9c('0x8'));router['get']('/',auth[_0xdc9c('0x9')](),controller[_0xdc9c('0xa')]);router[_0xdc9c('0xb')]('/:id',auth[_0xdc9c('0x9')](),controller[_0xdc9c('0xc')]);router['post']('/',auth[_0xdc9c('0x9')](),controller['create']);router['put'](_0xdc9c('0xd'),auth[_0xdc9c('0x9')](),controller[_0xdc9c('0xe')]);router[_0xdc9c('0xf')]('/:id',auth[_0xdc9c('0x9')](),controller['destroy']);module[_0xdc9c('0x10')]=router;
\ No newline at end of file
index 5fba320..cc666e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd40=['STRING','customVariable','sequelize','exports','ENUM','string','variable','keyValue','picklist'];(function(_0x41a107,_0x527d15){var _0x129df6=function(_0x91afcc){while(--_0x91afcc){_0x41a107['push'](_0x41a107['shift']());}};_0x129df6(++_0x527d15);}(_0xcd40,0x17c));var _0x0cd4=function(_0x2650de,_0x12c23e){_0x2650de=_0x2650de-0x0;var _0x2db8c0=_0xcd40[_0x2650de];return _0x2db8c0;};'use strict';var Sequelize=require(_0x0cd4('0x0'));module[_0x0cd4('0x1')]={'type':{'type':Sequelize[_0x0cd4('0x2')](_0x0cd4('0x3'),_0x0cd4('0x4'),'customVariable',_0x0cd4('0x5'),_0x0cd4('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0cd4('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0cd4('0x2')](_0x0cd4('0x3'),_0x0cd4('0x4'),_0x0cd4('0x8'))},'keyContent':{'type':Sequelize[_0x0cd4('0x7')]},'idField':{'type':Sequelize[_0x0cd4('0x7')]},'nameField':{'type':Sequelize[_0x0cd4('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0cd4('0x7')]}};
\ No newline at end of file
+var _0x634d=['BOOLEAN','sequelize','exports','string','keyValue','picklist','STRING','variable'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x634d,0xb9));var _0xd634=function(_0xb6eaa3,_0x30b656){_0xb6eaa3=_0xb6eaa3-0x0;var _0x1c2afb=_0x634d[_0xb6eaa3];return _0x1c2afb;};'use strict';var Sequelize=require(_0xd634('0x0'));module[_0xd634('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd634('0x2'),'variable','customVariable',_0xd634('0x3'),_0xd634('0x4')),'defaultValue':_0xd634('0x2')},'content':{'type':Sequelize[_0xd634('0x5')]},'key':{'type':Sequelize[_0xd634('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0xd634('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xd634('0x5')]},'idField':{'type':Sequelize[_0xd634('0x5')]},'nameField':{'type':Sequelize[_0xd634('0x5')]},'customField':{'type':Sequelize[_0xd634('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd634('0x5')]}};
\ No newline at end of file
index 290f2cf..005eedc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5a5=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','then','catch','show','params','options','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','count','json','apply','destroy','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','key','model','query','keys'];(function(_0xb6e2ea,_0x3b26e9){var _0x2a57bb=function(_0x2a1ac9){while(--_0x2a1ac9){_0xb6e2ea['push'](_0xb6e2ea['shift']());}};_0x2a57bb(++_0x3b26e9);}(_0xc5a5,0x18c));var _0x5c5a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc5a5[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x5c5a('0x0'));var rimraf=require(_0x5c5a('0x1'));var zipdir=require(_0x5c5a('0x2'));var jsonpatch=require(_0x5c5a('0x3'));var rp=require(_0x5c5a('0x4'));var moment=require(_0x5c5a('0x5'));var BPromise=require(_0x5c5a('0x6'));var Mustache=require(_0x5c5a('0x7'));var util=require(_0x5c5a('0x8'));var path=require('path');var sox=require(_0x5c5a('0x9'));var csv=require(_0x5c5a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c5a('0xb'));var _=require(_0x5c5a('0xc'));var squel=require(_0x5c5a('0xd'));var crypto=require(_0x5c5a('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5c5a('0xa'));var querystring=require(_0x5c5a('0xf'));var Papa=require(_0x5c5a('0x10'));var Redis=require(_0x5c5a('0x11'));var authService=require(_0x5c5a('0x12'));var qs=require(_0x5c5a('0x13'));var as=require(_0x5c5a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c5a('0x15'))(_0x5c5a('0x16'));var utils=require(_0x5c5a('0x17'));var config=require(_0x5c5a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c5a('0x19'))['db'];function respondWithStatusCode(_0x39cd76,_0x3ae581){_0x3ae581=_0x3ae581||0xcc;return function(_0x2982ef){if(_0x2982ef){return _0x39cd76[_0x5c5a('0x1a')](_0x3ae581);}return _0x39cd76[_0x5c5a('0x1b')](_0x3ae581)[_0x5c5a('0x1c')]();};}function respondWithResult(_0x29c9aa,_0x37d861){_0x37d861=_0x37d861||0xc8;return function(_0x448907){if(_0x448907){return _0x29c9aa[_0x5c5a('0x1b')](_0x37d861)['json'](_0x448907);}};}function respondWithFilteredResult(_0x55b8a8,_0x41625b){return function(_0x2d78af){if(_0x2d78af){var _0x55a1b8=typeof _0x41625b[_0x5c5a('0x1d')]==='undefined'&&typeof _0x41625b[_0x5c5a('0x1e')]==='undefined';var _0x21ee3c=_0x2d78af[_0x5c5a('0x1f')];var _0x52cfc8=_0x55a1b8?0x0:_0x41625b['offset'];var _0x54d4e8=_0x55a1b8?_0x2d78af['count']:_0x41625b[_0x5c5a('0x1d')]+_0x41625b['limit'];var _0xf480fd;if(_0x54d4e8>=_0x21ee3c){_0x54d4e8=_0x21ee3c;_0xf480fd=0xc8;}else{_0xf480fd=0xce;}_0x55b8a8[_0x5c5a('0x1b')](_0xf480fd);return _0x55b8a8['set']('Content-Range',_0x52cfc8+'-'+_0x54d4e8+'/'+_0x21ee3c)[_0x5c5a('0x20')](_0x2d78af);}return null;};}function patchUpdates(_0x19d0af){return function(_0x520082){try{jsonpatch[_0x5c5a('0x21')](_0x520082,_0x19d0af,!![]);}catch(_0x25041e){return BPromise['reject'](_0x25041e);}return _0x520082['save']();};}function saveUpdates(_0x404031,_0x27dd3d){return function(_0x5a33be){if(_0x5a33be){return _0x5a33be['update'](_0x404031)['then'](function(_0x38f5aa){return _0x38f5aa;});}return null;};}function removeEntity(_0xf30fc5,_0x2c4bf8){return function(_0x47c6c9){if(_0x47c6c9){return _0x47c6c9[_0x5c5a('0x22')]()['then'](function(){_0xf30fc5['status'](0xcc)[_0x5c5a('0x1c')]();});}};}function handleEntityNotFound(_0x9df821,_0x497bff){return function(_0x1e82d3){if(!_0x1e82d3){_0x9df821['sendStatus'](0x194);}return _0x1e82d3;};}function handleError(_0x179b15,_0x3898bd){_0x3898bd=_0x3898bd||0x1f4;return function(_0x547ac0){logger[_0x5c5a('0x23')](_0x547ac0[_0x5c5a('0x24')]);if(_0x547ac0[_0x5c5a('0x25')]){delete _0x547ac0[_0x5c5a('0x25')];}_0x179b15['status'](_0x3898bd)[_0x5c5a('0x26')](_0x547ac0);};}exports[_0x5c5a('0x27')]=function(_0xca659,_0x178da0){var _0x520763={},_0x5edb66={},_0x315688={'count':0x0,'rows':[]};var _0x494624=_[_0x5c5a('0x28')](db[_0x5c5a('0x29')][_0x5c5a('0x2a')],function(_0x5e4347){return{'name':_0x5e4347[_0x5c5a('0x2b')],'type':_0x5e4347['type'][_0x5c5a('0x2c')]};});_0x5edb66[_0x5c5a('0x2d')]=_['map'](_0x494624,'name');_0x5edb66[_0x5c5a('0x2e')]=_[_0x5c5a('0x2f')](_0xca659[_0x5c5a('0x2e')]);_0x5edb66[_0x5c5a('0x30')]=_[_0x5c5a('0x31')](_0x5edb66[_0x5c5a('0x2d')],_0x5edb66[_0x5c5a('0x2e')]);_0x520763[_0x5c5a('0x32')]=_[_0x5c5a('0x31')](_0x5edb66[_0x5c5a('0x2d')],qs[_0x5c5a('0x33')](_0xca659[_0x5c5a('0x2e')][_0x5c5a('0x33')]));_0x520763['attributes']=_0x520763['attributes'][_0x5c5a('0x34')]?_0x520763[_0x5c5a('0x32')]:_0x5edb66[_0x5c5a('0x2d')];if(!_0xca659['query'][_0x5c5a('0x35')](_0x5c5a('0x36'))){_0x520763['limit']=qs[_0x5c5a('0x1e')](_0xca659[_0x5c5a('0x2e')][_0x5c5a('0x1e')]);_0x520763[_0x5c5a('0x1d')]=qs['offset'](_0xca659[_0x5c5a('0x2e')][_0x5c5a('0x1d')]);}_0x520763[_0x5c5a('0x37')]=qs[_0x5c5a('0x38')](_0xca659[_0x5c5a('0x2e')]['sort']);_0x520763['where']=qs[_0x5c5a('0x30')](_[_0x5c5a('0x39')](_0xca659[_0x5c5a('0x2e')],_0x5edb66[_0x5c5a('0x30')]),_0x494624);if(_0xca659[_0x5c5a('0x2e')][_0x5c5a('0x3a')]){_0x520763[_0x5c5a('0x3b')]=_[_0x5c5a('0x3c')](_0x520763[_0x5c5a('0x3b')],{'$or':_[_0x5c5a('0x28')](_0x494624,function(_0x255282){if(_0x255282[_0x5c5a('0x3d')]!==_0x5c5a('0x3e')){var _0x448783={};_0x448783[_0x255282[_0x5c5a('0x25')]]={'$like':'%'+_0xca659[_0x5c5a('0x2e')]['filter']+'%'};return _0x448783;}})});}_0x520763=_[_0x5c5a('0x3c')]({},_0x520763,_0xca659['options']);var _0x198e51={'where':_0x520763['where']};return db[_0x5c5a('0x29')][_0x5c5a('0x1f')](_0x198e51)['then'](function(_0x257447){_0x315688[_0x5c5a('0x1f')]=_0x257447;if(_0xca659['query'][_0x5c5a('0x3f')]){_0x520763[_0x5c5a('0x40')]=[{'all':!![]}];}return db[_0x5c5a('0x29')]['findAll'](_0x520763);})[_0x5c5a('0x41')](function(_0x3ce4e9){_0x315688['rows']=_0x3ce4e9;return _0x315688;})[_0x5c5a('0x41')](respondWithFilteredResult(_0x178da0,_0x520763))[_0x5c5a('0x42')](handleError(_0x178da0,null));};exports[_0x5c5a('0x43')]=function(_0x500667,_0x192eb6){var _0x3a3d05={'raw':!![],'where':{'id':_0x500667[_0x5c5a('0x44')]['id']}},_0x877a8={};_0x877a8['model']=_['keys'](db[_0x5c5a('0x29')][_0x5c5a('0x2a')]);_0x877a8[_0x5c5a('0x2e')]=_['keys'](_0x500667['query']);_0x877a8[_0x5c5a('0x30')]=_[_0x5c5a('0x31')](_0x877a8[_0x5c5a('0x2d')],_0x877a8[_0x5c5a('0x2e')]);_0x3a3d05[_0x5c5a('0x32')]=_[_0x5c5a('0x31')](_0x877a8[_0x5c5a('0x2d')],qs[_0x5c5a('0x33')](_0x500667['query'][_0x5c5a('0x33')]));_0x3a3d05['attributes']=_0x3a3d05[_0x5c5a('0x32')][_0x5c5a('0x34')]?_0x3a3d05[_0x5c5a('0x32')]:_0x877a8['model'];if(_0x500667[_0x5c5a('0x2e')]['includeAll']){_0x3a3d05['include']=[{'all':!![]}];}_0x3a3d05=_['merge']({},_0x3a3d05,_0x500667[_0x5c5a('0x45')]);return db[_0x5c5a('0x29')][_0x5c5a('0x46')](_0x3a3d05)['then'](handleEntityNotFound(_0x192eb6,null))[_0x5c5a('0x41')](respondWithResult(_0x192eb6,null))[_0x5c5a('0x42')](handleError(_0x192eb6,null));};exports[_0x5c5a('0x47')]=function(_0x5ee198,_0x89d8b6){return db[_0x5c5a('0x29')][_0x5c5a('0x47')](_0x5ee198[_0x5c5a('0x48')],{})[_0x5c5a('0x41')](respondWithResult(_0x89d8b6,0xc9))[_0x5c5a('0x42')](handleError(_0x89d8b6,null));};exports[_0x5c5a('0x49')]=function(_0x2cc6a2,_0x170dfe){if(_0x2cc6a2[_0x5c5a('0x48')]['id']){delete _0x2cc6a2[_0x5c5a('0x48')]['id'];}return db[_0x5c5a('0x29')][_0x5c5a('0x46')]({'where':{'id':_0x2cc6a2[_0x5c5a('0x44')]['id']}})[_0x5c5a('0x41')](handleEntityNotFound(_0x170dfe,null))[_0x5c5a('0x41')](saveUpdates(_0x2cc6a2[_0x5c5a('0x48')],null))['then'](respondWithResult(_0x170dfe,null))[_0x5c5a('0x42')](handleError(_0x170dfe,null));};exports[_0x5c5a('0x22')]=function(_0x144eb5,_0x337be9){return db[_0x5c5a('0x29')][_0x5c5a('0x46')]({'where':{'id':_0x144eb5[_0x5c5a('0x44')]['id']}})[_0x5c5a('0x41')](handleEntityNotFound(_0x337be9,null))['then'](removeEntity(_0x337be9,null))[_0x5c5a('0x42')](handleError(_0x337be9,null));};
\ No newline at end of file
+var _0x14dc=['apply','reject','save','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','VtigerField','count','includeAll','include','catch','show','intersection','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','status','set','Content-Range'];(function(_0x37af9d,_0x210e31){var _0x258604=function(_0x145c30){while(--_0x145c30){_0x37af9d['push'](_0x37af9d['shift']());}};_0x258604(++_0x210e31);}(_0x14dc,0x1e1));var _0xc14d=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x14dc[_0x3070dc];return _0x431489;};'use strict';var emlformat=require(_0xc14d('0x0'));var rimraf=require(_0xc14d('0x1'));var zipdir=require(_0xc14d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc14d('0x3'));var moment=require('moment');var BPromise=require(_0xc14d('0x4'));var Mustache=require(_0xc14d('0x5'));var util=require(_0xc14d('0x6'));var path=require(_0xc14d('0x7'));var sox=require(_0xc14d('0x8'));var csv=require(_0xc14d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc14d('0xa'));var _=require(_0xc14d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc14d('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc14d('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc14d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc14d('0xf'));var hardwareService=require(_0xc14d('0x10'));var logger=require('../../config/logger')(_0xc14d('0x11'));var utils=require(_0xc14d('0x12'));var config=require(_0xc14d('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc14d('0x14'))['db'];function respondWithStatusCode(_0x2f7928,_0x457b69){_0x457b69=_0x457b69||0xcc;return function(_0x2edbf9){if(_0x2edbf9){return _0x2f7928[_0xc14d('0x15')](_0x457b69);}return _0x2f7928['status'](_0x457b69)[_0xc14d('0x16')]();};}function respondWithResult(_0x5a0628,_0x840bb6){_0x840bb6=_0x840bb6||0xc8;return function(_0x582a0d){if(_0x582a0d){return _0x5a0628['status'](_0x840bb6)[_0xc14d('0x17')](_0x582a0d);}};}function respondWithFilteredResult(_0x2e33cc,_0x469994){return function(_0x1b3456){if(_0x1b3456){var _0xc880eb=typeof _0x469994[_0xc14d('0x18')]===_0xc14d('0x19')&&typeof _0x469994[_0xc14d('0x1a')]===_0xc14d('0x19');var _0x3fbc31=_0x1b3456['count'];var _0x345ebd=_0xc880eb?0x0:_0x469994[_0xc14d('0x18')];var _0x287e03=_0xc880eb?_0x1b3456['count']:_0x469994[_0xc14d('0x18')]+_0x469994['limit'];var _0x56475b;if(_0x287e03>=_0x3fbc31){_0x287e03=_0x3fbc31;_0x56475b=0xc8;}else{_0x56475b=0xce;}_0x2e33cc[_0xc14d('0x1b')](_0x56475b);return _0x2e33cc[_0xc14d('0x1c')](_0xc14d('0x1d'),_0x345ebd+'-'+_0x287e03+'/'+_0x3fbc31)[_0xc14d('0x17')](_0x1b3456);}return null;};}function patchUpdates(_0x55a79c){return function(_0x59b54e){try{jsonpatch[_0xc14d('0x1e')](_0x59b54e,_0x55a79c,!![]);}catch(_0x39003e){return BPromise[_0xc14d('0x1f')](_0x39003e);}return _0x59b54e[_0xc14d('0x20')]();};}function saveUpdates(_0x2a0508,_0x279f8c){return function(_0x536bac){if(_0x536bac){return _0x536bac[_0xc14d('0x21')](_0x2a0508)['then'](function(_0x11af54){return _0x11af54;});}return null;};}function removeEntity(_0x59cf26,_0x52d019){return function(_0x1c0df3){if(_0x1c0df3){return _0x1c0df3[_0xc14d('0x22')]()[_0xc14d('0x23')](function(){_0x59cf26[_0xc14d('0x1b')](0xcc)[_0xc14d('0x16')]();});}};}function handleEntityNotFound(_0x4b799c,_0x41e42a){return function(_0x2efe21){if(!_0x2efe21){_0x4b799c[_0xc14d('0x15')](0x194);}return _0x2efe21;};}function handleError(_0x54af49,_0x4a54c2){_0x4a54c2=_0x4a54c2||0x1f4;return function(_0x279020){logger[_0xc14d('0x24')](_0x279020[_0xc14d('0x25')]);if(_0x279020[_0xc14d('0x26')]){delete _0x279020['name'];}_0x54af49[_0xc14d('0x1b')](_0x4a54c2)[_0xc14d('0x27')](_0x279020);};}exports[_0xc14d('0x28')]=function(_0x5bb666,_0x2bb346){var _0x1649cd={},_0x3dda64={},_0x4a5051={'count':0x0,'rows':[]};var _0x385086=_['map'](db['VtigerField'][_0xc14d('0x29')],function(_0x446489){return{'name':_0x446489[_0xc14d('0x2a')],'type':_0x446489[_0xc14d('0x2b')][_0xc14d('0x2c')]};});_0x3dda64[_0xc14d('0x2d')]=_[_0xc14d('0x2e')](_0x385086,_0xc14d('0x26'));_0x3dda64[_0xc14d('0x2f')]=_[_0xc14d('0x30')](_0x5bb666['query']);_0x3dda64['filters']=_['intersection'](_0x3dda64[_0xc14d('0x2d')],_0x3dda64['query']);_0x1649cd[_0xc14d('0x31')]=_['intersection'](_0x3dda64[_0xc14d('0x2d')],qs[_0xc14d('0x32')](_0x5bb666[_0xc14d('0x2f')][_0xc14d('0x32')]));_0x1649cd[_0xc14d('0x31')]=_0x1649cd['attributes'][_0xc14d('0x33')]?_0x1649cd[_0xc14d('0x31')]:_0x3dda64[_0xc14d('0x2d')];if(!_0x5bb666['query'][_0xc14d('0x34')](_0xc14d('0x35'))){_0x1649cd[_0xc14d('0x1a')]=qs['limit'](_0x5bb666['query'][_0xc14d('0x1a')]);_0x1649cd['offset']=qs[_0xc14d('0x18')](_0x5bb666[_0xc14d('0x2f')]['offset']);}_0x1649cd[_0xc14d('0x36')]=qs['sort'](_0x5bb666['query'][_0xc14d('0x37')]);_0x1649cd[_0xc14d('0x38')]=qs[_0xc14d('0x39')](_[_0xc14d('0x3a')](_0x5bb666[_0xc14d('0x2f')],_0x3dda64[_0xc14d('0x39')]),_0x385086);if(_0x5bb666[_0xc14d('0x2f')][_0xc14d('0x3b')]){_0x1649cd['where']=_[_0xc14d('0x3c')](_0x1649cd['where'],{'$or':_[_0xc14d('0x2e')](_0x385086,function(_0x542e5c){if(_0x542e5c['type']!=='VIRTUAL'){var _0x4f1676={};_0x4f1676[_0x542e5c[_0xc14d('0x26')]]={'$like':'%'+_0x5bb666[_0xc14d('0x2f')][_0xc14d('0x3b')]+'%'};return _0x4f1676;}})});}_0x1649cd=_['merge']({},_0x1649cd,_0x5bb666[_0xc14d('0x3d')]);var _0x433cdb={'where':_0x1649cd[_0xc14d('0x38')]};return db[_0xc14d('0x3e')][_0xc14d('0x3f')](_0x433cdb)['then'](function(_0x318a00){_0x4a5051[_0xc14d('0x3f')]=_0x318a00;if(_0x5bb666['query'][_0xc14d('0x40')]){_0x1649cd[_0xc14d('0x41')]=[{'all':!![]}];}return db[_0xc14d('0x3e')]['findAll'](_0x1649cd);})[_0xc14d('0x23')](function(_0x38fa13){_0x4a5051['rows']=_0x38fa13;return _0x4a5051;})['then'](respondWithFilteredResult(_0x2bb346,_0x1649cd))[_0xc14d('0x42')](handleError(_0x2bb346,null));};exports[_0xc14d('0x43')]=function(_0x20892c,_0x383ea5){var _0x336dba={'raw':!![],'where':{'id':_0x20892c['params']['id']}},_0x843f98={};_0x843f98[_0xc14d('0x2d')]=_[_0xc14d('0x30')](db[_0xc14d('0x3e')][_0xc14d('0x29')]);_0x843f98[_0xc14d('0x2f')]=_['keys'](_0x20892c[_0xc14d('0x2f')]);_0x843f98[_0xc14d('0x39')]=_[_0xc14d('0x44')](_0x843f98[_0xc14d('0x2d')],_0x843f98['query']);_0x336dba[_0xc14d('0x31')]=_[_0xc14d('0x44')](_0x843f98['model'],qs[_0xc14d('0x32')](_0x20892c['query'][_0xc14d('0x32')]));_0x336dba['attributes']=_0x336dba[_0xc14d('0x31')]['length']?_0x336dba[_0xc14d('0x31')]:_0x843f98['model'];if(_0x20892c[_0xc14d('0x2f')]['includeAll']){_0x336dba[_0xc14d('0x41')]=[{'all':!![]}];}_0x336dba=_[_0xc14d('0x3c')]({},_0x336dba,_0x20892c['options']);return db[_0xc14d('0x3e')][_0xc14d('0x45')](_0x336dba)[_0xc14d('0x23')](handleEntityNotFound(_0x383ea5,null))[_0xc14d('0x23')](respondWithResult(_0x383ea5,null))['catch'](handleError(_0x383ea5,null));};exports[_0xc14d('0x46')]=function(_0x4cd63c,_0x3fce49){return db[_0xc14d('0x3e')][_0xc14d('0x46')](_0x4cd63c[_0xc14d('0x47')],{})['then'](respondWithResult(_0x3fce49,0xc9))['catch'](handleError(_0x3fce49,null));};exports[_0xc14d('0x21')]=function(_0x33ed7f,_0x271e15){if(_0x33ed7f[_0xc14d('0x47')]['id']){delete _0x33ed7f[_0xc14d('0x47')]['id'];}return db[_0xc14d('0x3e')][_0xc14d('0x45')]({'where':{'id':_0x33ed7f[_0xc14d('0x48')]['id']}})[_0xc14d('0x23')](handleEntityNotFound(_0x271e15,null))[_0xc14d('0x23')](saveUpdates(_0x33ed7f[_0xc14d('0x47')],null))[_0xc14d('0x23')](respondWithResult(_0x271e15,null))['catch'](handleError(_0x271e15,null));};exports[_0xc14d('0x22')]=function(_0x39e749,_0x28e5c3){return db[_0xc14d('0x3e')][_0xc14d('0x45')]({'where':{'id':_0x39e749[_0xc14d('0x48')]['id']}})[_0xc14d('0x23')](handleEntityNotFound(_0x28e5c3,null))[_0xc14d('0x23')](removeEntity(_0x28e5c3,null))['catch'](handleError(_0x28e5c3,null));};
\ No newline at end of file
index 37aaf0b..222d2b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9b9=['vtiger_unique_index','idField','lodash','util','api','bluebird','request-promise','rimraf','exports','define','VtigerField'];(function(_0x2235a8,_0x168862){var _0x2b21f1=function(_0x3fc490){while(--_0x3fc490){_0x2235a8['push'](_0x2235a8['shift']());}};_0x2b21f1(++_0x168862);}(_0xb9b9,0xd3));var _0x9b9b=function(_0xb3be7,_0x42fb10){_0xb3be7=_0xb3be7-0x0;var _0x5f48db=_0xb9b9[_0xb3be7];return _0x5f48db;};'use strict';var _=require(_0x9b9b('0x0'));var util=require(_0x9b9b('0x1'));var logger=require('../../config/logger')(_0x9b9b('0x2'));var moment=require('moment');var BPromise=require(_0x9b9b('0x3'));var rp=require(_0x9b9b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9b9b('0x5'));var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0x9b9b('0x6')]=function(_0x19b20d,_0x2416b0){return _0x19b20d[_0x9b9b('0x7')](_0x9b9b('0x8'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x9b9b('0x9'),'fields':[_0x9b9b('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3a05=['FieldId','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField'];(function(_0x382168,_0xe03b6a){var _0x3ecf7e=function(_0x17b089){while(--_0x17b089){_0x382168['push'](_0x382168['shift']());}};_0x3ecf7e(++_0xe03b6a);}(_0x3a05,0xde));var _0x53a0=function(_0x4ccd8e,_0x49d05d){_0x4ccd8e=_0x4ccd8e-0x0;var _0x423d7b=_0x3a05[_0x4ccd8e];return _0x423d7b;};'use strict';var _=require(_0x53a0('0x0'));var util=require(_0x53a0('0x1'));var logger=require(_0x53a0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x53a0('0x3'));var rp=require(_0x53a0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x53a0('0x5'));var attributes=require(_0x53a0('0x6'));module['exports']=function(_0x334876,_0x246452){return _0x334876[_0x53a0('0x7')](_0x53a0('0x8'),attributes,{'tableName':_0x53a0('0x9'),'paranoid':![],'indexes':[{'name':_0x53a0('0xa'),'fields':[_0x53a0('0xb'),_0x53a0('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index fc5bfaf..c022c15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b23=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x7b23,0xf1));var _0x37b2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7b23[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x37b2('0x0'));var BPromise=require(_0x37b2('0x1'));var rs=require(_0x37b2('0x2'));var fs=require('fs');var Redis=require(_0x37b2('0x3'));var db=require(_0x37b2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x37b2('0x5'))('rpc');var config=require(_0x37b2('0x6'));var jayson=require(_0x37b2('0x7'));var client=jayson[_0x37b2('0x8')][_0x37b2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x64a25a,_0x3d2bce,_0x33465e){return new BPromise(function(_0x3c5a3a,_0x2c83d2){return client[_0x37b2('0xa')](_0x64a25a,_0x33465e)[_0x37b2('0xb')](function(_0x1043d8){logger['info'](_0x37b2('0xc'),_0x3d2bce,_0x37b2('0xd'));logger['debug'](_0x37b2('0xe'),_0x3d2bce,_0x37b2('0xd'),JSON[_0x37b2('0xf')](_0x1043d8));if(_0x1043d8[_0x37b2('0x10')]){if(_0x1043d8['error'][_0x37b2('0x11')]===0x1f4){logger[_0x37b2('0x10')](_0x37b2('0xc'),_0x3d2bce,_0x1043d8[_0x37b2('0x10')][_0x37b2('0x12')]);return _0x2c83d2(_0x1043d8[_0x37b2('0x10')][_0x37b2('0x12')]);}logger['error']('VtigerField,\x20%s,\x20%s',_0x3d2bce,_0x1043d8[_0x37b2('0x10')]['message']);return _0x3c5a3a(_0x1043d8[_0x37b2('0x10')][_0x37b2('0x12')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x3d2bce,_0x37b2('0xd'));_0x3c5a3a(_0x1043d8['result']['message']);}})[_0x37b2('0x13')](function(_0xa5b780){logger[_0x37b2('0x10')](_0x37b2('0xc'),_0x3d2bce,_0xa5b780);_0x2c83d2(_0xa5b780);});});}
\ No newline at end of file
+var _0xe32a=['info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xe32a,0x14c));var _0xae32=function(_0x254d9f,_0x54ddb5){_0x254d9f=_0x254d9f-0x0;var _0x1eedb9=_0xe32a[_0x254d9f];return _0x1eedb9;};'use strict';var _=require(_0xae32('0x0'));var util=require(_0xae32('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xae32('0x2'));var fs=require('fs');var Redis=require(_0xae32('0x3'));var db=require(_0xae32('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xae32('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xae32('0x6')][_0xae32('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x286099,_0x4edc0f,_0x2389cc){return new BPromise(function(_0x21b94b,_0x549b33){return client[_0xae32('0x8')](_0x286099,_0x2389cc)[_0xae32('0x9')](function(_0x4ff389){logger[_0xae32('0xa')](_0xae32('0xb'),_0x4edc0f,_0xae32('0xc'));logger[_0xae32('0xd')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x4edc0f,_0xae32('0xc'),JSON['stringify'](_0x4ff389));if(_0x4ff389[_0xae32('0xe')]){if(_0x4ff389['error'][_0xae32('0xf')]===0x1f4){logger[_0xae32('0xe')](_0xae32('0xb'),_0x4edc0f,_0x4ff389[_0xae32('0xe')][_0xae32('0x10')]);return _0x549b33(_0x4ff389['error'][_0xae32('0x10')]);}logger[_0xae32('0xe')](_0xae32('0xb'),_0x4edc0f,_0x4ff389[_0xae32('0xe')][_0xae32('0x10')]);return _0x21b94b(_0x4ff389[_0xae32('0xe')][_0xae32('0x10')]);}else{logger[_0xae32('0xa')](_0xae32('0xb'),_0x4edc0f,_0xae32('0xc'));_0x21b94b(_0x4ff389[_0xae32('0x11')][_0xae32('0x10')]);}})['catch'](function(_0x4930ea){logger['error'](_0xae32('0xb'),_0x4edc0f,_0x4930ea);_0x549b33(_0x4930ea);});});}
\ No newline at end of file
index d0c19ba..db8b7c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe85=['getConfigurations','get','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/:id'];(function(_0x2cb033,_0x75b56a){var _0x20df3a=function(_0x5a3371){while(--_0x5a3371){_0x2cb033['push'](_0x2cb033['shift']());}};_0x20df3a(++_0x75b56a);}(_0xbe85,0x197));var _0x5be8=function(_0x1e0724,_0x1fdedc){_0x1e0724=_0x1e0724-0x0;var _0x545e9e=_0xbe85[_0x1e0724];return _0x545e9e;};'use strict';var multer=require(_0x5be8('0x0'));var util=require(_0x5be8('0x1'));var path=require(_0x5be8('0x2'));var timeout=require(_0x5be8('0x3'));var express=require(_0x5be8('0x4'));var router=express['Router']();var fs_extra=require(_0x5be8('0x5'));var auth=require(_0x5be8('0x6'));var interaction=require(_0x5be8('0x7'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0x5be8('0x8')](),controller[_0x5be8('0x9')]);router['get'](_0x5be8('0xa'),auth[_0x5be8('0x8')](),controller['show']);router['get']('/:id/configurations',auth[_0x5be8('0x8')](),controller[_0x5be8('0xb')]);router[_0x5be8('0xc')](_0x5be8('0xd'),auth['isAuthenticated'](),controller[_0x5be8('0xe')]);router[_0x5be8('0xf')]('/',auth[_0x5be8('0x8')](),controller['create']);router['post']('/:id/configurations',auth[_0x5be8('0x8')](),controller[_0x5be8('0x10')]);router[_0x5be8('0x11')](_0x5be8('0xa'),auth[_0x5be8('0x8')](),controller[_0x5be8('0x12')]);router[_0x5be8('0x13')](_0x5be8('0xa'),auth['isAuthenticated'](),controller[_0x5be8('0x14')]);module[_0x5be8('0x15')]=router;
\ No newline at end of file
+var _0x0ee5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','post','create','addConfiguration','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x50fb49,_0x34acb8){var _0x31fff0=function(_0x4f887b){while(--_0x4f887b){_0x50fb49['push'](_0x50fb49['shift']());}};_0x31fff0(++_0x34acb8);}(_0x0ee5,0x12f));var _0x50ee=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0ee5[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x50ee('0x0'));var util=require(_0x50ee('0x1'));var path=require(_0x50ee('0x2'));var timeout=require(_0x50ee('0x3'));var express=require(_0x50ee('0x4'));var router=express[_0x50ee('0x5')]();var fs_extra=require(_0x50ee('0x6'));var auth=require(_0x50ee('0x7'));var interaction=require(_0x50ee('0x8'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0x50ee('0x9')]('/',auth[_0x50ee('0xa')](),controller[_0x50ee('0xb')]);router[_0x50ee('0x9')](_0x50ee('0xc'),auth['isAuthenticated'](),controller[_0x50ee('0xd')]);router[_0x50ee('0x9')](_0x50ee('0xe'),auth[_0x50ee('0xa')](),controller[_0x50ee('0xf')]);router[_0x50ee('0x9')]('/:id/fields',auth[_0x50ee('0xa')](),controller['getFields']);router[_0x50ee('0x10')]('/',auth['isAuthenticated'](),controller[_0x50ee('0x11')]);router[_0x50ee('0x10')]('/:id/configurations',auth[_0x50ee('0xa')](),controller[_0x50ee('0x12')]);router['put'](_0x50ee('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x50ee('0x13')](_0x50ee('0xc'),auth[_0x50ee('0xa')](),controller[_0x50ee('0x14')]);module[_0x50ee('0x15')]=router;
\ No newline at end of file
index bf1f9bc..8ece716 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeca8=['password','integrationTab','newTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xeca8,0x1f2));var _0x8eca=function(_0x1206b3,_0x5390d7){_0x1206b3=_0x1206b3-0x0;var _0x53dfa7=_0xeca8[_0x1206b3];return _0x53dfa7;};'use strict';var Sequelize=require(_0x8eca('0x0'));module[_0x8eca('0x1')]={'name':{'type':Sequelize[_0x8eca('0x2')]},'description':{'type':Sequelize[_0x8eca('0x2')]},'username':{'type':Sequelize[_0x8eca('0x2')],'unique':_0x8eca('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x8eca('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8eca('0x4')},'authType':{'type':Sequelize[_0x8eca('0x5')](_0x8eca('0x6'),'token'),'defaultValue':_0x8eca('0x6')},'serverUrl':{'type':Sequelize[_0x8eca('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8eca('0x5')](_0x8eca('0x7'),_0x8eca('0x8')),'defaultValue':_0x8eca('0x7')}};
\ No newline at end of file
+var _0x2272=['sequelize','exports','STRING','password','token','ENUM','integrationTab','newTab'];(function(_0x5c561f,_0x147ac6){var _0x143ea8=function(_0xa42055){while(--_0xa42055){_0x5c561f['push'](_0x5c561f['shift']());}};_0x143ea8(++_0x147ac6);}(_0x2272,0xd8));var _0x2227=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x2272[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x2227('0x0'));module[_0x2227('0x1')]={'name':{'type':Sequelize[_0x2227('0x2')]},'description':{'type':Sequelize[_0x2227('0x2')]},'username':{'type':Sequelize[_0x2227('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x2227('0x2')]},'token':{'type':Sequelize[_0x2227('0x2')]},'remoteUri':{'type':Sequelize[_0x2227('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM'](_0x2227('0x3'),_0x2227('0x4')),'defaultValue':_0x2227('0x3')},'serverUrl':{'type':Sequelize[_0x2227('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2227('0x5')](_0x2227('0x6'),_0x2227('0x7')),'defaultValue':_0x2227('0x6')}};
\ No newline at end of file
index e383f1f..270123e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['getConfigurations','findOne','ZendeskConfiguration','pick','hasOwnProperty','AccountId','Subjects','getSubjects','Descriptions','channel','ZendeskField','getFields','username','token','authType','remoteUri','slice','substring','GET','format','password','headers','Basic\x20%s','base64','%s/token:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','remove','includes','ticket_fields','title','position','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','json','offset','undefined','limit','status','set','Content-Range','apply','reject','save','update','then','stack','name','send','map','ZendeskAccount','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','findAll','rows','show','includeAll','include','find','create','body','catch','params'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0xe706,0xa3));var _0x6e70=function(_0x31282b,_0xa476db){_0x31282b=_0x31282b-0x0;var _0x19c632=_0xe706[_0x31282b];return _0x19c632;};'use strict';var emlformat=require(_0x6e70('0x0'));var rimraf=require(_0x6e70('0x1'));var zipdir=require(_0x6e70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e70('0x3'));var moment=require(_0x6e70('0x4'));var BPromise=require(_0x6e70('0x5'));var Mustache=require(_0x6e70('0x6'));var util=require(_0x6e70('0x7'));var path=require(_0x6e70('0x8'));var sox=require(_0x6e70('0x9'));var csv=require(_0x6e70('0xa'));var ejs=require(_0x6e70('0xb'));var fs=require('fs');var fs_extra=require(_0x6e70('0xc'));var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xa'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var licenseUtil=require(_0x6e70('0x1b'));var db=require(_0x6e70('0x1c'))['db'];var integrations=require(_0x6e70('0x1d'));function respondWithStatusCode(_0x3b38f3,_0x310eb7){_0x310eb7=_0x310eb7||0xcc;return function(_0xa1eb74){if(_0xa1eb74){return _0x3b38f3[_0x6e70('0x1e')](_0x310eb7);}return _0x3b38f3['status'](_0x310eb7)['end']();};}function respondWithResult(_0x48bc72,_0x257e81){_0x257e81=_0x257e81||0xc8;return function(_0x5a37a6){if(_0x5a37a6){return _0x48bc72['status'](_0x257e81)[_0x6e70('0x1f')](_0x5a37a6);}};}function respondWithFilteredResult(_0x22c50c,_0x5d9263){return function(_0x24f3ac){if(_0x24f3ac){var _0x5c3fe7=typeof _0x5d9263[_0x6e70('0x20')]===_0x6e70('0x21')&&typeof _0x5d9263['limit']==='undefined';var _0x3bd572=_0x24f3ac['count'];var _0x28a21f=_0x5c3fe7?0x0:_0x5d9263[_0x6e70('0x20')];var _0x53acdc=_0x5c3fe7?_0x24f3ac['count']:_0x5d9263[_0x6e70('0x20')]+_0x5d9263[_0x6e70('0x22')];var _0x2368eb;if(_0x53acdc>=_0x3bd572){_0x53acdc=_0x3bd572;_0x2368eb=0xc8;}else{_0x2368eb=0xce;}_0x22c50c[_0x6e70('0x23')](_0x2368eb);return _0x22c50c[_0x6e70('0x24')](_0x6e70('0x25'),_0x28a21f+'-'+_0x53acdc+'/'+_0x3bd572)[_0x6e70('0x1f')](_0x24f3ac);}return null;};}function patchUpdates(_0x44a49f){return function(_0x29326f){try{jsonpatch[_0x6e70('0x26')](_0x29326f,_0x44a49f,!![]);}catch(_0x4a0cfe){return BPromise[_0x6e70('0x27')](_0x4a0cfe);}return _0x29326f[_0x6e70('0x28')]();};}function saveUpdates(_0x27b294,_0x502b2d){return function(_0x3ccd87){if(_0x3ccd87){return _0x3ccd87[_0x6e70('0x29')](_0x27b294)[_0x6e70('0x2a')](function(_0x50da2c){return _0x50da2c;});}return null;};}function removeEntity(_0x10fc91,_0x538b9c){return function(_0x50aec2){if(_0x50aec2){return _0x50aec2['destroy']()[_0x6e70('0x2a')](function(){_0x10fc91[_0x6e70('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ecdf1,_0x1196ed){return function(_0x5f268f){if(!_0x5f268f){_0x3ecdf1[_0x6e70('0x1e')](0x194);}return _0x5f268f;};}function handleError(_0x67fb43,_0x2bb231){_0x2bb231=_0x2bb231||0x1f4;return function(_0x4a67ac){logger['error'](_0x4a67ac[_0x6e70('0x2b')]);if(_0x4a67ac[_0x6e70('0x2c')]){delete _0x4a67ac[_0x6e70('0x2c')];}_0x67fb43[_0x6e70('0x23')](_0x2bb231)[_0x6e70('0x2d')](_0x4a67ac);};}exports['index']=function(_0x1952ea,_0x406f29){var _0xecf336={},_0x2864a0={},_0x396a67={'count':0x0,'rows':[]};var _0x20a225=_[_0x6e70('0x2e')](db[_0x6e70('0x2f')][_0x6e70('0x30')],function(_0x3a5d30){return{'name':_0x3a5d30['fieldName'],'type':_0x3a5d30[_0x6e70('0x31')]['key']};});_0x2864a0[_0x6e70('0x32')]=_['map'](_0x20a225,_0x6e70('0x2c'));_0x2864a0[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x1952ea['query']);_0x2864a0[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x2864a0['model'],_0x2864a0[_0x6e70('0x33')]);_0xecf336[_0x6e70('0x37')]=_['intersection'](_0x2864a0[_0x6e70('0x32')],qs[_0x6e70('0x38')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x38')]));_0xecf336[_0x6e70('0x37')]=_0xecf336[_0x6e70('0x37')][_0x6e70('0x39')]?_0xecf336[_0x6e70('0x37')]:_0x2864a0[_0x6e70('0x32')];if(!_0x1952ea[_0x6e70('0x33')]['hasOwnProperty'](_0x6e70('0x3a'))){_0xecf336['limit']=qs[_0x6e70('0x22')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x22')]);_0xecf336[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x20')]);}_0xecf336[_0x6e70('0x3b')]=qs[_0x6e70('0x3c')](_0x1952ea[_0x6e70('0x33')][_0x6e70('0x3c')]);_0xecf336[_0x6e70('0x3d')]=qs[_0x6e70('0x35')](_['pick'](_0x1952ea['query'],_0x2864a0['filters']),_0x20a225);if(_0x1952ea[_0x6e70('0x33')][_0x6e70('0x3e')]){_0xecf336[_0x6e70('0x3d')]=_[_0x6e70('0x3f')](_0xecf336[_0x6e70('0x3d')],{'$or':_[_0x6e70('0x2e')](_0x20a225,function(_0x572a71){if(_0x572a71[_0x6e70('0x31')]!==_0x6e70('0x40')){var _0x1c5cde={};_0x1c5cde[_0x572a71[_0x6e70('0x2c')]]={'$like':'%'+_0x1952ea[_0x6e70('0x33')][_0x6e70('0x3e')]+'%'};return _0x1c5cde;}})});}_0xecf336=_[_0x6e70('0x3f')]({},_0xecf336,_0x1952ea[_0x6e70('0x41')]);var _0x5be100={'where':_0xecf336[_0x6e70('0x3d')]};return db[_0x6e70('0x2f')][_0x6e70('0x42')](_0x5be100)[_0x6e70('0x2a')](function(_0x201da9){_0x396a67[_0x6e70('0x42')]=_0x201da9;if(_0x1952ea[_0x6e70('0x33')]['includeAll']){_0xecf336['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x6e70('0x43')](_0xecf336);})[_0x6e70('0x2a')](function(_0x83847b){_0x396a67[_0x6e70('0x44')]=_0x83847b;return _0x396a67;})[_0x6e70('0x2a')](respondWithFilteredResult(_0x406f29,_0xecf336))['catch'](handleError(_0x406f29,null));};exports[_0x6e70('0x45')]=function(_0x2a58d7,_0x2a2aca){var _0x52b197={'raw':![],'where':{'id':_0x2a58d7['params']['id']}},_0x544ad0={};_0x544ad0[_0x6e70('0x32')]=_['keys'](db[_0x6e70('0x2f')][_0x6e70('0x30')]);_0x544ad0[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x2a58d7['query']);_0x544ad0[_0x6e70('0x35')]=_['intersection'](_0x544ad0[_0x6e70('0x32')],_0x544ad0[_0x6e70('0x33')]);_0x52b197[_0x6e70('0x37')]=_[_0x6e70('0x36')](_0x544ad0['model'],qs[_0x6e70('0x38')](_0x2a58d7[_0x6e70('0x33')][_0x6e70('0x38')]));_0x52b197[_0x6e70('0x37')]=_0x52b197[_0x6e70('0x37')][_0x6e70('0x39')]?_0x52b197[_0x6e70('0x37')]:_0x544ad0['model'];if(_0x2a58d7[_0x6e70('0x33')][_0x6e70('0x46')]){_0x52b197[_0x6e70('0x47')]=[{'all':!![]}];}_0x52b197=_[_0x6e70('0x3f')]({},_0x52b197,_0x2a58d7[_0x6e70('0x41')]);return db[_0x6e70('0x2f')][_0x6e70('0x48')](_0x52b197)['then'](handleEntityNotFound(_0x2a2aca,null))[_0x6e70('0x2a')](respondWithResult(_0x2a2aca,null))['catch'](handleError(_0x2a2aca,null));};exports[_0x6e70('0x49')]=function(_0x3836e4,_0x4b351e){return db['ZendeskAccount'][_0x6e70('0x49')](_0x3836e4[_0x6e70('0x4a')],{})[_0x6e70('0x2a')](respondWithResult(_0x4b351e,0xc9))['catch'](handleError(_0x4b351e,null));};exports['update']=function(_0x238ebb,_0x11ac3d){if(_0x238ebb[_0x6e70('0x4a')]['id']){delete _0x238ebb[_0x6e70('0x4a')]['id'];}return db[_0x6e70('0x2f')][_0x6e70('0x48')]({'where':{'id':_0x238ebb['params']['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x11ac3d,null))[_0x6e70('0x2a')](saveUpdates(_0x238ebb[_0x6e70('0x4a')],null))[_0x6e70('0x2a')](respondWithResult(_0x11ac3d,null))[_0x6e70('0x4b')](handleError(_0x11ac3d,null));};exports['destroy']=function(_0x4ae901,_0x2c5538){return db[_0x6e70('0x2f')][_0x6e70('0x48')]({'where':{'id':_0x4ae901[_0x6e70('0x4c')]['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x2c5538,null))['then'](removeEntity(_0x2c5538,null))[_0x6e70('0x4b')](handleError(_0x2c5538,null));};exports[_0x6e70('0x4d')]=function(_0x1fa320,_0x23ebfb,_0x3aba34){var _0x4a111a={};var _0x1142cd={};var _0x1dd242;var _0x2c20d3;return db[_0x6e70('0x2f')][_0x6e70('0x4e')]({'where':{'id':_0x1fa320[_0x6e70('0x4c')]['id']}})['then'](handleEntityNotFound(_0x23ebfb,null))[_0x6e70('0x2a')](function(_0x8d425d){if(_0x8d425d){_0x1dd242=_0x8d425d;_0x1142cd['model']=_[_0x6e70('0x34')](db[_0x6e70('0x4f')]['rawAttributes']);_0x1142cd[_0x6e70('0x33')]=_[_0x6e70('0x34')](_0x1fa320[_0x6e70('0x33')]);_0x1142cd[_0x6e70('0x35')]=_[_0x6e70('0x36')](_0x1142cd['model'],_0x1142cd[_0x6e70('0x33')]);_0x4a111a[_0x6e70('0x37')]=_[_0x6e70('0x36')](_0x1142cd[_0x6e70('0x32')],qs[_0x6e70('0x38')](_0x1fa320[_0x6e70('0x33')][_0x6e70('0x38')]));_0x4a111a[_0x6e70('0x37')]=_0x4a111a[_0x6e70('0x37')][_0x6e70('0x39')]?_0x4a111a[_0x6e70('0x37')]:_0x1142cd[_0x6e70('0x32')];_0x4a111a[_0x6e70('0x3b')]=qs[_0x6e70('0x3c')](_0x1fa320[_0x6e70('0x33')][_0x6e70('0x3c')]);_0x4a111a[_0x6e70('0x3d')]=qs[_0x6e70('0x35')](_[_0x6e70('0x50')](_0x1fa320[_0x6e70('0x33')],_0x1142cd['filters']));if(_0x1fa320[_0x6e70('0x33')][_0x6e70('0x3e')]){_0x4a111a[_0x6e70('0x3d')]=_[_0x6e70('0x3f')](_0x4a111a[_0x6e70('0x3d')],{'$or':_[_0x6e70('0x2e')](_0x4a111a['attributes'],function(_0x42bd85){var _0x6cabf0={};_0x6cabf0[_0x42bd85]={'$like':'%'+_0x1fa320['query'][_0x6e70('0x3e')]+'%'};return _0x6cabf0;})});}_0x4a111a=_[_0x6e70('0x3f')]({},_0x4a111a,_0x1fa320[_0x6e70('0x41')]);return _0x1dd242['getConfigurations'](_0x4a111a);}})['then'](function(_0x2f9be4){if(_0x2f9be4){_0x2c20d3=_0x2f9be4[_0x6e70('0x39')];if(!_0x1fa320[_0x6e70('0x33')][_0x6e70('0x51')](_0x6e70('0x3a'))){_0x4a111a[_0x6e70('0x22')]=qs[_0x6e70('0x22')](_0x1fa320['query']['limit']);_0x4a111a[_0x6e70('0x20')]=qs[_0x6e70('0x20')](_0x1fa320[_0x6e70('0x33')][_0x6e70('0x20')]);}return _0x1dd242['getConfigurations'](_0x4a111a);}})['then'](function(_0x2e972b){if(_0x2e972b){return _0x2e972b?{'count':_0x2c20d3,'rows':_0x2e972b}:null;}})[_0x6e70('0x2a')](respondWithResult(_0x23ebfb,null))['catch'](handleError(_0x23ebfb,null));};exports['addConfiguration']=function(_0x355708,_0x47fbed,_0x2a8fb7){if(_0x355708[_0x6e70('0x4a')]['id']){delete _0x355708[_0x6e70('0x4a')]['id'];}return db[_0x6e70('0x2f')][_0x6e70('0x4e')]({'where':{'id':_0x355708[_0x6e70('0x4c')]['id']}})[_0x6e70('0x2a')](handleEntityNotFound(_0x47fbed,null))[_0x6e70('0x2a')](function(_0x570115){if(_0x570115){_0x355708[_0x6e70('0x4a')][_0x6e70('0x52')]=_0x570115['id'];_0x355708[_0x6e70('0x4a')][_0x6e70('0x53')]=integrations[_0x6e70('0x54')](_0x355708['body']['channel'],_0x355708['body'][_0x6e70('0x31')]);_0x355708[_0x6e70('0x4a')][_0x6e70('0x55')]=integrations['getDescriptions'](_0x355708['body'][_0x6e70('0x56')],_0x355708[_0x6e70('0x4a')][_0x6e70('0x31')]);return db[_0x6e70('0x4f')][_0x6e70('0x49')](_0x355708[_0x6e70('0x4a')],{'include':[{'model':db['ZendeskField'],'as':_0x6e70('0x53')},{'model':db[_0x6e70('0x57')],'as':_0x6e70('0x55')}]});}return null;})[_0x6e70('0x2a')](respondWithResult(_0x47fbed,null))['catch'](handleError(_0x47fbed,null));};exports[_0x6e70('0x58')]=function(_0x531097,_0x5b4046,_0x30487b){var _0x3249a5='';return db[_0x6e70('0x2f')][_0x6e70('0x4e')]({'where':{'id':_0x531097[_0x6e70('0x4c')]['id']},'attributes':['id',_0x6e70('0x59'),'password',_0x6e70('0x5a'),_0x6e70('0x5b'),_0x6e70('0x5c')]})[_0x6e70('0x2a')](handleEntityNotFound(_0x5b4046,null))[_0x6e70('0x2a')](function(_0x13c092){if(_0x13c092){_0x3249a5=_0x13c092[_0x6e70('0x5c')];var _0xd9b4a9=_0x3249a5[_0x6e70('0x5d')](-0x1);if(_0xd9b4a9==='/'){_0x3249a5=_0x3249a5[_0x6e70('0x5e')](0x0,_0x3249a5['lastIndexOf'](_0xd9b4a9));}var _0x44c877={'method':_0x6e70('0x5f'),'uri':util[_0x6e70('0x60')]('%s/%s',_0x3249a5,'ticket_fields'),'json':!![]};switch(_0x13c092[_0x6e70('0x5b')]){case _0x6e70('0x61'):_0x44c877[_0x6e70('0x62')]={'Authorization':util[_0x6e70('0x60')](_0x6e70('0x63'),new Buffer(util['format']('%s:%s',_0x13c092[_0x6e70('0x59')],_0x13c092[_0x6e70('0x61')]))['toString'](_0x6e70('0x64')))};break;case _0x6e70('0x5a'):_0x44c877[_0x6e70('0x62')]={'Authorization':util[_0x6e70('0x60')](_0x6e70('0x63'),new Buffer(util[_0x6e70('0x60')](_0x6e70('0x65'),_0x13c092[_0x6e70('0x59')],_0x13c092[_0x6e70('0x5a')]))[_0x6e70('0x66')](_0x6e70('0x64')))};break;default:throw new db[(_0x6e70('0x67'))][(_0x6e70('0x68'))](_0x6e70('0x69'));}return rp(_0x44c877);}})['then'](function(_0x5b3cb0){if(_0x5b3cb0){var _0x39ed95=['subject',_0x6e70('0x6a'),'group','assignee'];_[_0x6e70('0x6b')](_0x5b3cb0['ticket_fields'],function(_0x576069){return _0x39ed95[_0x6e70('0x6c')](_0x576069[_0x6e70('0x31')]);});return{'count':_0x5b3cb0[_0x6e70('0x6d')]['length'],'rows':_['map'](_0x5b3cb0['ticket_fields'],function(_0x3e7be7){return{'id':_0x3e7be7['id'],'name':_0x3e7be7['position']>0x7?_0x3e7be7[_0x6e70('0x6e')]:_0x3e7be7[_0x6e70('0x31')],'custom':_0x3e7be7[_0x6e70('0x6f')]>0x7?!![]:![],'options':_0x3e7be7[_0x6e70('0x70')]?_0x3e7be7[_0x6e70('0x70')]:_0x3e7be7[_0x6e70('0x71')]?_0x3e7be7[_0x6e70('0x71')]:[]};})};}})['then'](respondWithResult(_0x5b4046,null))[_0x6e70('0x4b')](function(_0x2493b0){var _0xb649a6=_0x531097['query'][_0x6e70('0x72')]?0x1f4:_0x2493b0[_0x6e70('0x73')]||0x1f4;logger[_0x6e70('0x74')](_0x6e70('0x75'),_0x6e70('0x58'),_0xb649a6,JSON[_0x6e70('0x76')](_0x2493b0));delete _0x2493b0[_0x6e70('0x2c')];if(_0xb649a6===0x191){_0xb649a6=0x190;}_0x5b4046[_0x6e70('0x23')](_0xb649a6)[_0x6e70('0x2d')](_0x531097['query'][_0x6e70('0x72')]?{'message':_0x6e70('0x77'),'statusCode':_0x2493b0['statusCode']}:_0x2493b0);});};
\ No newline at end of file
+var _0x0bb5=['offset','limit','undefined','count','set','json','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','ZendeskAccount','include','findAll','rows','catch','show','params','includeAll','create','body','find','destroy','getConfigurations','findOne','ZendeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','username','password','authType','remoteUri','substring','GET','%s/%s','ticket_fields','headers','format','Basic\x20%s','token','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status'];(function(_0x3727dd,_0x4364f7){var _0x53276f=function(_0x3fc9ae){while(--_0x3fc9ae){_0x3727dd['push'](_0x3727dd['shift']());}};_0x53276f(++_0x4364f7);}(_0x0bb5,0x148));var _0x50bb=function(_0x223aed,_0x357bfc){_0x223aed=_0x223aed-0x0;var _0x14972c=_0x0bb5[_0x223aed];return _0x14972c;};'use strict';var emlformat=require(_0x50bb('0x0'));var rimraf=require(_0x50bb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x50bb('0x2'));var moment=require(_0x50bb('0x3'));var BPromise=require(_0x50bb('0x4'));var Mustache=require(_0x50bb('0x5'));var util=require(_0x50bb('0x6'));var path=require(_0x50bb('0x7'));var sox=require(_0x50bb('0x8'));var csv=require(_0x50bb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x50bb('0xa'));var squel=require(_0x50bb('0xb'));var crypto=require(_0x50bb('0xc'));var jsforce=require(_0x50bb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50bb('0xe'));var Papa=require(_0x50bb('0xf'));var Redis=require(_0x50bb('0x10'));var authService=require(_0x50bb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x50bb('0x12'));var hardwareService=require(_0x50bb('0x13'));var logger=require(_0x50bb('0x14'))(_0x50bb('0x15'));var utils=require(_0x50bb('0x16'));var config=require(_0x50bb('0x17'));var licenseUtil=require(_0x50bb('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x50bb('0x19'));function respondWithStatusCode(_0x58837d,_0x283f04){_0x283f04=_0x283f04||0xcc;return function(_0xd8ab27){if(_0xd8ab27){return _0x58837d[_0x50bb('0x1a')](_0x283f04);}return _0x58837d['status'](_0x283f04)[_0x50bb('0x1b')]();};}function respondWithResult(_0x309986,_0x3094f2){_0x3094f2=_0x3094f2||0xc8;return function(_0x5244b0){if(_0x5244b0){return _0x309986[_0x50bb('0x1c')](_0x3094f2)['json'](_0x5244b0);}};}function respondWithFilteredResult(_0x21befa,_0x3e1a51){return function(_0x253073){if(_0x253073){var _0x42ffab=typeof _0x3e1a51[_0x50bb('0x1d')]==='undefined'&&typeof _0x3e1a51[_0x50bb('0x1e')]===_0x50bb('0x1f');var _0x4b1f5f=_0x253073[_0x50bb('0x20')];var _0x4796ec=_0x42ffab?0x0:_0x3e1a51[_0x50bb('0x1d')];var _0x431ed4=_0x42ffab?_0x253073['count']:_0x3e1a51['offset']+_0x3e1a51[_0x50bb('0x1e')];var _0x1499dc;if(_0x431ed4>=_0x4b1f5f){_0x431ed4=_0x4b1f5f;_0x1499dc=0xc8;}else{_0x1499dc=0xce;}_0x21befa[_0x50bb('0x1c')](_0x1499dc);return _0x21befa[_0x50bb('0x21')]('Content-Range',_0x4796ec+'-'+_0x431ed4+'/'+_0x4b1f5f)[_0x50bb('0x22')](_0x253073);}return null;};}function patchUpdates(_0x32bfc3){return function(_0x4020a0){try{jsonpatch['apply'](_0x4020a0,_0x32bfc3,!![]);}catch(_0x3104c8){return BPromise[_0x50bb('0x23')](_0x3104c8);}return _0x4020a0[_0x50bb('0x24')]();};}function saveUpdates(_0x4825f8,_0x1dbba2){return function(_0x4cc7f9){if(_0x4cc7f9){return _0x4cc7f9[_0x50bb('0x25')](_0x4825f8)[_0x50bb('0x26')](function(_0x1a2a0b){return _0x1a2a0b;});}return null;};}function removeEntity(_0x2ee87a,_0x846311){return function(_0x342078){if(_0x342078){return _0x342078['destroy']()[_0x50bb('0x26')](function(){_0x2ee87a[_0x50bb('0x1c')](0xcc)[_0x50bb('0x1b')]();});}};}function handleEntityNotFound(_0x3462c1,_0x5234d7){return function(_0x75fea6){if(!_0x75fea6){_0x3462c1['sendStatus'](0x194);}return _0x75fea6;};}function handleError(_0x55e87b,_0x2befd9){_0x2befd9=_0x2befd9||0x1f4;return function(_0x491632){logger['error'](_0x491632[_0x50bb('0x27')]);if(_0x491632[_0x50bb('0x28')]){delete _0x491632[_0x50bb('0x28')];}_0x55e87b[_0x50bb('0x1c')](_0x2befd9)[_0x50bb('0x29')](_0x491632);};}exports[_0x50bb('0x2a')]=function(_0x41a8ad,_0x41d479){var _0x4f7514={},_0x44ce86={},_0x461cf3={'count':0x0,'rows':[]};var _0x15ee2e=_[_0x50bb('0x2b')](db['ZendeskAccount'][_0x50bb('0x2c')],function(_0x1a62fb){return{'name':_0x1a62fb[_0x50bb('0x2d')],'type':_0x1a62fb[_0x50bb('0x2e')][_0x50bb('0x2f')]};});_0x44ce86[_0x50bb('0x30')]=_[_0x50bb('0x2b')](_0x15ee2e,_0x50bb('0x28'));_0x44ce86[_0x50bb('0x31')]=_[_0x50bb('0x32')](_0x41a8ad[_0x50bb('0x31')]);_0x44ce86[_0x50bb('0x33')]=_['intersection'](_0x44ce86[_0x50bb('0x30')],_0x44ce86[_0x50bb('0x31')]);_0x4f7514[_0x50bb('0x34')]=_[_0x50bb('0x35')](_0x44ce86[_0x50bb('0x30')],qs[_0x50bb('0x36')](_0x41a8ad[_0x50bb('0x31')][_0x50bb('0x36')]));_0x4f7514[_0x50bb('0x34')]=_0x4f7514[_0x50bb('0x34')][_0x50bb('0x37')]?_0x4f7514['attributes']:_0x44ce86[_0x50bb('0x30')];if(!_0x41a8ad[_0x50bb('0x31')][_0x50bb('0x38')](_0x50bb('0x39'))){_0x4f7514[_0x50bb('0x1e')]=qs[_0x50bb('0x1e')](_0x41a8ad['query']['limit']);_0x4f7514[_0x50bb('0x1d')]=qs['offset'](_0x41a8ad[_0x50bb('0x31')][_0x50bb('0x1d')]);}_0x4f7514[_0x50bb('0x3a')]=qs[_0x50bb('0x3b')](_0x41a8ad[_0x50bb('0x31')]['sort']);_0x4f7514[_0x50bb('0x3c')]=qs['filters'](_[_0x50bb('0x3d')](_0x41a8ad[_0x50bb('0x31')],_0x44ce86[_0x50bb('0x33')]),_0x15ee2e);if(_0x41a8ad['query']['filter']){_0x4f7514[_0x50bb('0x3c')]=_[_0x50bb('0x3e')](_0x4f7514[_0x50bb('0x3c')],{'$or':_[_0x50bb('0x2b')](_0x15ee2e,function(_0x51750b){if(_0x51750b[_0x50bb('0x2e')]!=='VIRTUAL'){var _0x52059b={};_0x52059b[_0x51750b[_0x50bb('0x28')]]={'$like':'%'+_0x41a8ad['query'][_0x50bb('0x3f')]+'%'};return _0x52059b;}})});}_0x4f7514=_[_0x50bb('0x3e')]({},_0x4f7514,_0x41a8ad[_0x50bb('0x40')]);var _0x1f156e={'where':_0x4f7514[_0x50bb('0x3c')]};return db[_0x50bb('0x41')][_0x50bb('0x20')](_0x1f156e)[_0x50bb('0x26')](function(_0x46039a){_0x461cf3[_0x50bb('0x20')]=_0x46039a;if(_0x41a8ad['query']['includeAll']){_0x4f7514[_0x50bb('0x42')]=[{'all':!![]}];}return db[_0x50bb('0x41')][_0x50bb('0x43')](_0x4f7514);})[_0x50bb('0x26')](function(_0x5e8085){_0x461cf3[_0x50bb('0x44')]=_0x5e8085;return _0x461cf3;})['then'](respondWithFilteredResult(_0x41d479,_0x4f7514))[_0x50bb('0x45')](handleError(_0x41d479,null));};exports[_0x50bb('0x46')]=function(_0x379944,_0x40748d){var _0x1c438b={'raw':![],'where':{'id':_0x379944[_0x50bb('0x47')]['id']}},_0x355726={};_0x355726[_0x50bb('0x30')]=_[_0x50bb('0x32')](db[_0x50bb('0x41')][_0x50bb('0x2c')]);_0x355726[_0x50bb('0x31')]=_[_0x50bb('0x32')](_0x379944[_0x50bb('0x31')]);_0x355726[_0x50bb('0x33')]=_[_0x50bb('0x35')](_0x355726['model'],_0x355726[_0x50bb('0x31')]);_0x1c438b['attributes']=_[_0x50bb('0x35')](_0x355726[_0x50bb('0x30')],qs[_0x50bb('0x36')](_0x379944[_0x50bb('0x31')][_0x50bb('0x36')]));_0x1c438b[_0x50bb('0x34')]=_0x1c438b[_0x50bb('0x34')][_0x50bb('0x37')]?_0x1c438b[_0x50bb('0x34')]:_0x355726[_0x50bb('0x30')];if(_0x379944[_0x50bb('0x31')][_0x50bb('0x48')]){_0x1c438b[_0x50bb('0x42')]=[{'all':!![]}];}_0x1c438b=_[_0x50bb('0x3e')]({},_0x1c438b,_0x379944['options']);return db[_0x50bb('0x41')]['find'](_0x1c438b)[_0x50bb('0x26')](handleEntityNotFound(_0x40748d,null))[_0x50bb('0x26')](respondWithResult(_0x40748d,null))[_0x50bb('0x45')](handleError(_0x40748d,null));};exports[_0x50bb('0x49')]=function(_0x650e91,_0x39ac1a){return db[_0x50bb('0x41')][_0x50bb('0x49')](_0x650e91['body'],{})[_0x50bb('0x26')](respondWithResult(_0x39ac1a,0xc9))[_0x50bb('0x45')](handleError(_0x39ac1a,null));};exports[_0x50bb('0x25')]=function(_0x13afe2,_0x3659c4){if(_0x13afe2['body']['id']){delete _0x13afe2[_0x50bb('0x4a')]['id'];}return db[_0x50bb('0x41')][_0x50bb('0x4b')]({'where':{'id':_0x13afe2[_0x50bb('0x47')]['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x3659c4,null))['then'](saveUpdates(_0x13afe2['body'],null))[_0x50bb('0x26')](respondWithResult(_0x3659c4,null))['catch'](handleError(_0x3659c4,null));};exports[_0x50bb('0x4c')]=function(_0x57ee0e,_0x4316e4){return db[_0x50bb('0x41')][_0x50bb('0x4b')]({'where':{'id':_0x57ee0e['params']['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x4316e4,null))[_0x50bb('0x26')](removeEntity(_0x4316e4,null))['catch'](handleError(_0x4316e4,null));};exports[_0x50bb('0x4d')]=function(_0x1dff6a,_0x8d62af,_0x3c525c){var _0x55a4a6={};var _0x33e71f={};var _0x46b51e;var _0x2e0032;return db[_0x50bb('0x41')][_0x50bb('0x4e')]({'where':{'id':_0x1dff6a['params']['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x8d62af,null))['then'](function(_0x38a775){if(_0x38a775){_0x46b51e=_0x38a775;_0x33e71f['model']=_['keys'](db[_0x50bb('0x4f')]['rawAttributes']);_0x33e71f['query']=_[_0x50bb('0x32')](_0x1dff6a[_0x50bb('0x31')]);_0x33e71f[_0x50bb('0x33')]=_[_0x50bb('0x35')](_0x33e71f[_0x50bb('0x30')],_0x33e71f[_0x50bb('0x31')]);_0x55a4a6[_0x50bb('0x34')]=_[_0x50bb('0x35')](_0x33e71f['model'],qs['fields'](_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x36')]));_0x55a4a6[_0x50bb('0x34')]=_0x55a4a6[_0x50bb('0x34')][_0x50bb('0x37')]?_0x55a4a6[_0x50bb('0x34')]:_0x33e71f[_0x50bb('0x30')];_0x55a4a6['order']=qs[_0x50bb('0x3b')](_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x3b')]);_0x55a4a6[_0x50bb('0x3c')]=qs[_0x50bb('0x33')](_['pick'](_0x1dff6a[_0x50bb('0x31')],_0x33e71f[_0x50bb('0x33')]));if(_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x3f')]){_0x55a4a6[_0x50bb('0x3c')]=_['merge'](_0x55a4a6[_0x50bb('0x3c')],{'$or':_['map'](_0x55a4a6['attributes'],function(_0x170761){var _0x3057f2={};_0x3057f2[_0x170761]={'$like':'%'+_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x3f')]+'%'};return _0x3057f2;})});}_0x55a4a6=_[_0x50bb('0x3e')]({},_0x55a4a6,_0x1dff6a[_0x50bb('0x40')]);return _0x46b51e[_0x50bb('0x4d')](_0x55a4a6);}})[_0x50bb('0x26')](function(_0x330299){if(_0x330299){_0x2e0032=_0x330299[_0x50bb('0x37')];if(!_0x1dff6a[_0x50bb('0x31')]['hasOwnProperty'](_0x50bb('0x39'))){_0x55a4a6['limit']=qs[_0x50bb('0x1e')](_0x1dff6a[_0x50bb('0x31')]['limit']);_0x55a4a6[_0x50bb('0x1d')]=qs[_0x50bb('0x1d')](_0x1dff6a[_0x50bb('0x31')][_0x50bb('0x1d')]);}return _0x46b51e[_0x50bb('0x4d')](_0x55a4a6);}})[_0x50bb('0x26')](function(_0x2b7df6){if(_0x2b7df6){return _0x2b7df6?{'count':_0x2e0032,'rows':_0x2b7df6}:null;}})[_0x50bb('0x26')](respondWithResult(_0x8d62af,null))['catch'](handleError(_0x8d62af,null));};exports[_0x50bb('0x50')]=function(_0x2dc832,_0x3b17c8,_0x4a226d){if(_0x2dc832[_0x50bb('0x4a')]['id']){delete _0x2dc832[_0x50bb('0x4a')]['id'];}return db[_0x50bb('0x41')][_0x50bb('0x4e')]({'where':{'id':_0x2dc832[_0x50bb('0x47')]['id']}})[_0x50bb('0x26')](handleEntityNotFound(_0x3b17c8,null))['then'](function(_0xf47641){if(_0xf47641){_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x51')]=_0xf47641['id'];_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x52')]=integrations[_0x50bb('0x53')](_0x2dc832['body'][_0x50bb('0x54')],_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x2e')]);_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x55')]=integrations[_0x50bb('0x56')](_0x2dc832[_0x50bb('0x4a')][_0x50bb('0x54')],_0x2dc832[_0x50bb('0x4a')]['type']);return db[_0x50bb('0x4f')][_0x50bb('0x49')](_0x2dc832[_0x50bb('0x4a')],{'include':[{'model':db[_0x50bb('0x57')],'as':_0x50bb('0x52')},{'model':db[_0x50bb('0x57')],'as':_0x50bb('0x55')}]});}return null;})[_0x50bb('0x26')](respondWithResult(_0x3b17c8,null))[_0x50bb('0x45')](handleError(_0x3b17c8,null));};exports['getFields']=function(_0x58ad41,_0x5babbc,_0x4159ad){var _0x5ba597='';return db['ZendeskAccount'][_0x50bb('0x4e')]({'where':{'id':_0x58ad41[_0x50bb('0x47')]['id']},'attributes':['id',_0x50bb('0x58'),_0x50bb('0x59'),'token',_0x50bb('0x5a'),_0x50bb('0x5b')]})['then'](handleEntityNotFound(_0x5babbc,null))[_0x50bb('0x26')](function(_0x51e64f){if(_0x51e64f){_0x5ba597=_0x51e64f[_0x50bb('0x5b')];var _0x239a82=_0x5ba597['slice'](-0x1);if(_0x239a82==='/'){_0x5ba597=_0x5ba597[_0x50bb('0x5c')](0x0,_0x5ba597['lastIndexOf'](_0x239a82));}var _0x8f5df6={'method':_0x50bb('0x5d'),'uri':util['format'](_0x50bb('0x5e'),_0x5ba597,_0x50bb('0x5f')),'json':!![]};switch(_0x51e64f[_0x50bb('0x5a')]){case'password':_0x8f5df6[_0x50bb('0x60')]={'Authorization':util[_0x50bb('0x61')](_0x50bb('0x62'),new Buffer(util[_0x50bb('0x61')]('%s:%s',_0x51e64f[_0x50bb('0x58')],_0x51e64f[_0x50bb('0x59')]))['toString']('base64'))};break;case _0x50bb('0x63'):_0x8f5df6[_0x50bb('0x60')]={'Authorization':util['format'](_0x50bb('0x62'),new Buffer(util[_0x50bb('0x61')](_0x50bb('0x64'),_0x51e64f[_0x50bb('0x58')],_0x51e64f[_0x50bb('0x63')]))['toString']('base64'))};break;default:throw new db[(_0x50bb('0x65'))][(_0x50bb('0x66'))](_0x50bb('0x67'));}return rp(_0x8f5df6);}})[_0x50bb('0x26')](function(_0x4b51d4){if(_0x4b51d4){var _0x1975f7=['subject',_0x50bb('0x68'),_0x50bb('0x69'),_0x50bb('0x6a')];_[_0x50bb('0x6b')](_0x4b51d4[_0x50bb('0x5f')],function(_0x217170){return _0x1975f7[_0x50bb('0x6c')](_0x217170['type']);});return{'count':_0x4b51d4[_0x50bb('0x5f')][_0x50bb('0x37')],'rows':_[_0x50bb('0x2b')](_0x4b51d4[_0x50bb('0x5f')],function(_0x5d2dc4){return{'id':_0x5d2dc4['id'],'name':_0x5d2dc4[_0x50bb('0x6d')]>0x7?_0x5d2dc4[_0x50bb('0x6e')]:_0x5d2dc4['type'],'custom':_0x5d2dc4[_0x50bb('0x6d')]>0x7?!![]:![],'options':_0x5d2dc4[_0x50bb('0x6f')]?_0x5d2dc4[_0x50bb('0x6f')]:_0x5d2dc4[_0x50bb('0x70')]?_0x5d2dc4[_0x50bb('0x70')]:[]};})};}})['then'](respondWithResult(_0x5babbc,null))['catch'](function(_0x145cf8){var _0x47e80f=_0x58ad41[_0x50bb('0x31')][_0x50bb('0x71')]?0x1f4:_0x145cf8['statusCode']||0x1f4;logger['error'](_0x50bb('0x72'),_0x50bb('0x73'),_0x47e80f,JSON[_0x50bb('0x74')](_0x145cf8));delete _0x145cf8['name'];if(_0x47e80f===0x191){_0x47e80f=0x190;}_0x5babbc[_0x50bb('0x1c')](_0x47e80f)[_0x50bb('0x29')](_0x58ad41[_0x50bb('0x31')][_0x50bb('0x71')]?{'message':_0x50bb('0x75'),'statusCode':_0x145cf8[_0x50bb('0x76')]}:_0x145cf8);});};
\ No newline at end of file
index 60749aa..fd76f55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc97=['ZendeskAccount','lodash','moment','bluebird','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','define'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xdc97,0x1d5));var _0x7dc9=function(_0x3a5fc7,_0x3e0a2b){_0x3a5fc7=_0x3a5fc7-0x0;var _0xc7387f=_0xdc97[_0x3a5fc7];return _0xc7387f;};'use strict';var _=require(_0x7dc9('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7dc9('0x1'));var BPromise=require(_0x7dc9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7dc9('0x3'));var config=require(_0x7dc9('0x4'));var attributes=require(_0x7dc9('0x5'));var integrations=require('../../components/integrations/configuration');module[_0x7dc9('0x6')]=function(_0x127e2c,_0x4958fe){return _0x127e2c[_0x7dc9('0x7')](_0x7dc9('0x8'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe81b=['../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe81b,0xe4));var _0xbe81=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xe81b[_0x1b6186];return _0x186121;};'use strict';var _=require(_0xbe81('0x0'));var util=require(_0xbe81('0x1'));var logger=require(_0xbe81('0x2'))(_0xbe81('0x3'));var moment=require(_0xbe81('0x4'));var BPromise=require(_0xbe81('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbe81('0x6'));var attributes=require(_0xbe81('0x7'));var integrations=require(_0xbe81('0x8'));module[_0xbe81('0x9')]=function(_0x1c937a,_0x36d6bb){return _0x1c937a[_0xbe81('0xa')](_0xbe81('0xb'),attributes,{'tableName':_0xbe81('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 378c1b3..ae40495 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbe4=['request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','limit','include','map','model','attributes','ShowZendeskAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http'];(function(_0x4e82ff,_0x3cbf4b){var _0x495205=function(_0x21bc88){while(--_0x21bc88){_0x4e82ff['push'](_0x4e82ff['shift']());}};_0x495205(++_0x3cbf4b);}(_0xfbe4,0x153));var _0x4fbe=function(_0x403d0a,_0x42de13){_0x403d0a=_0x403d0a-0x0;var _0x2ae1af=_0xfbe4[_0x403d0a];return _0x2ae1af;};'use strict';var _=require(_0x4fbe('0x0'));var util=require(_0x4fbe('0x1'));var moment=require(_0x4fbe('0x2'));var BPromise=require(_0x4fbe('0x3'));var rs=require(_0x4fbe('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4fbe('0x5'))['db'];var utils=require(_0x4fbe('0x6'));var logger=require(_0x4fbe('0x7'))('rpc');var config=require(_0x4fbe('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4fbe('0x9')][_0x4fbe('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19a165,_0x4f0f41,_0x1f997b){return new BPromise(function(_0xeef67c,_0xaf771b){return client[_0x4fbe('0xb')](_0x19a165,_0x1f997b)[_0x4fbe('0xc')](function(_0x16518b){logger[_0x4fbe('0xd')](_0x4fbe('0xe'),_0x4f0f41,_0x4fbe('0xf'));logger[_0x4fbe('0x10')](_0x4fbe('0x11'),_0x4f0f41,_0x4fbe('0xf'),JSON[_0x4fbe('0x12')](_0x16518b));if(_0x16518b[_0x4fbe('0x13')]){if(_0x16518b[_0x4fbe('0x13')]['code']===0x1f4){logger[_0x4fbe('0x13')](_0x4fbe('0xe'),_0x4f0f41,_0x16518b[_0x4fbe('0x13')][_0x4fbe('0x14')]);return _0xaf771b(_0x16518b[_0x4fbe('0x13')][_0x4fbe('0x14')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x4f0f41,_0x16518b[_0x4fbe('0x13')]['message']);return _0xeef67c(_0x16518b[_0x4fbe('0x13')]['message']);}else{logger[_0x4fbe('0xd')](_0x4fbe('0xe'),_0x4f0f41,'request\x20sent');_0xeef67c(_0x16518b['result'][_0x4fbe('0x14')]);}})[_0x4fbe('0x15')](function(_0x2db23a){logger[_0x4fbe('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x4f0f41,_0x2db23a);_0xaf771b(_0x2db23a);});});}exports[_0x4fbe('0x16')]=function(_0x149dca){var _0x3f1374=this;return new Promise(function(_0xa18aac,_0x5689a1){return db[_0x4fbe('0x17')][_0x4fbe('0x18')]({'raw':_0x149dca[_0x4fbe('0x19')]?_0x149dca[_0x4fbe('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x149dca[_0x4fbe('0x19')]?_0x149dca[_0x4fbe('0x19')][_0x4fbe('0x1a')]||null:null,'attributes':_0x149dca['options']?_0x149dca[_0x4fbe('0x19')]['attributes']||null:null,'limit':_0x149dca[_0x4fbe('0x19')]?_0x149dca[_0x4fbe('0x19')][_0x4fbe('0x1b')]||null:null,'include':_0x149dca['options']?_0x149dca[_0x4fbe('0x19')][_0x4fbe('0x1c')]?_[_0x4fbe('0x1d')](_0x149dca['options'][_0x4fbe('0x1c')],function(_0x12687f){return{'model':db[_0x12687f[_0x4fbe('0x1e')]],'as':_0x12687f['as'],'attributes':_0x12687f[_0x4fbe('0x1f')],'include':_0x12687f[_0x4fbe('0x1c')]?_[_0x4fbe('0x1d')](_0x12687f[_0x4fbe('0x1c')],function(_0x536b5a){return{'model':db[_0x536b5a[_0x4fbe('0x1e')]],'as':_0x536b5a['as'],'attributes':_0x536b5a[_0x4fbe('0x1f')],'include':_0x536b5a[_0x4fbe('0x1c')]?_[_0x4fbe('0x1d')](_0x536b5a[_0x4fbe('0x1c')],function(_0x4f658e){return{'model':db[_0x4f658e[_0x4fbe('0x1e')]],'as':_0x4f658e['as'],'attributes':_0x4f658e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5ab8c5){logger[_0x4fbe('0xd')](_0x4fbe('0x16'),_0x149dca);logger[_0x4fbe('0x10')](_0x4fbe('0x16'),_0x149dca,JSON[_0x4fbe('0x12')](_0x5ab8c5));_0xa18aac(_0x5ab8c5);})['catch'](function(_0x369a6f){logger[_0x4fbe('0x13')](_0x4fbe('0x16'),_0x369a6f['message'],_0x149dca);_0x5689a1(_0x3f1374[_0x4fbe('0x13')](0x1f4,_0x369a6f[_0x4fbe('0x14')]));});});};exports[_0x4fbe('0x20')]=function(_0x291ae8){var _0xe4fa96=this;return new Promise(function(_0x3d5a7e,_0x36620e){return db['ZendeskAccount'][_0x4fbe('0x21')]({'raw':_0x291ae8[_0x4fbe('0x19')]?_0x291ae8['options'][_0x4fbe('0x22')]===undefined?!![]:![]:!![],'where':_0x291ae8[_0x4fbe('0x19')]?_0x291ae8[_0x4fbe('0x19')]['where']||null:null,'attributes':_0x291ae8[_0x4fbe('0x19')]?_0x291ae8['options'][_0x4fbe('0x1f')]||null:null,'include':_0x291ae8['options']?_0x291ae8[_0x4fbe('0x19')]['include']?_[_0x4fbe('0x1d')](_0x291ae8[_0x4fbe('0x19')][_0x4fbe('0x1c')],function(_0x77b58f){return{'model':db[_0x77b58f[_0x4fbe('0x1e')]],'as':_0x77b58f['as'],'attributes':_0x77b58f[_0x4fbe('0x1f')],'include':_0x77b58f[_0x4fbe('0x1c')]?_[_0x4fbe('0x1d')](_0x77b58f['include'],function(_0x24228d){return{'model':db[_0x24228d[_0x4fbe('0x1e')]],'as':_0x24228d['as'],'attributes':_0x24228d[_0x4fbe('0x1f')],'include':_0x24228d['include']?_[_0x4fbe('0x1d')](_0x24228d[_0x4fbe('0x1c')],function(_0x2b3c47){return{'model':db[_0x2b3c47[_0x4fbe('0x1e')]],'as':_0x2b3c47['as'],'attributes':_0x2b3c47[_0x4fbe('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4fbe('0xc')](function(_0x3102ee){logger[_0x4fbe('0xd')](_0x4fbe('0x20'),_0x291ae8);logger['debug'](_0x4fbe('0x20'),_0x291ae8,JSON[_0x4fbe('0x12')](_0x3102ee));_0x3d5a7e(_0x3102ee);})[_0x4fbe('0x15')](function(_0x8f46c0){logger['error'](_0x4fbe('0x20'),_0x8f46c0[_0x4fbe('0x14')],_0x291ae8);_0x36620e(_0xe4fa96[_0x4fbe('0x13')](0x1f4,_0x8f46c0['message']));});});};
\ No newline at end of file
+var _0x5824=['request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetZendeskAccount','findAll','options','raw','attributes','limit','include','map','model','ShowZendeskAccount','ZendeskAccount','where','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s'];(function(_0x944789,_0x123ec1){var _0x5b2b7e=function(_0x5dd439){while(--_0x5dd439){_0x944789['push'](_0x944789['shift']());}};_0x5b2b7e(++_0x123ec1);}(_0x5824,0xb9));var _0x4582=function(_0x40f0df,_0x149a66){_0x40f0df=_0x40f0df-0x0;var _0x53dc94=_0x5824[_0x40f0df];return _0x53dc94;};'use strict';var _=require(_0x4582('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4582('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4582('0x2'))['db'];var utils=require(_0x4582('0x3'));var logger=require(_0x4582('0x4'))(_0x4582('0x5'));var config=require(_0x4582('0x6'));var jayson=require(_0x4582('0x7'));var client=jayson[_0x4582('0x8')][_0x4582('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2dcc4b,_0x2dae5a,_0x4c25b2){return new BPromise(function(_0x5b32e4,_0x37a386){return client['request'](_0x2dcc4b,_0x4c25b2)[_0x4582('0xa')](function(_0x2ac8fe){logger[_0x4582('0xb')](_0x4582('0xc'),_0x2dae5a,_0x4582('0xd'));logger[_0x4582('0xe')](_0x4582('0xf'),_0x2dae5a,'request\x20sent',JSON[_0x4582('0x10')](_0x2ac8fe));if(_0x2ac8fe[_0x4582('0x11')]){if(_0x2ac8fe['error']['code']===0x1f4){logger['error'](_0x4582('0xc'),_0x2dae5a,_0x2ac8fe[_0x4582('0x11')]['message']);return _0x37a386(_0x2ac8fe[_0x4582('0x11')]['message']);}logger[_0x4582('0x11')](_0x4582('0xc'),_0x2dae5a,_0x2ac8fe[_0x4582('0x11')][_0x4582('0x12')]);return _0x5b32e4(_0x2ac8fe[_0x4582('0x11')][_0x4582('0x12')]);}else{logger[_0x4582('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x2dae5a,_0x4582('0xd'));_0x5b32e4(_0x2ac8fe[_0x4582('0x13')]['message']);}})[_0x4582('0x14')](function(_0x4be115){logger[_0x4582('0x11')](_0x4582('0xc'),_0x2dae5a,_0x4be115);_0x37a386(_0x4be115);});});}exports[_0x4582('0x15')]=function(_0x1ba6a8){var _0x42ac46=this;return new Promise(function(_0x41d478,_0xfb0a63){return db['ZendeskAccount'][_0x4582('0x16')]({'raw':_0x1ba6a8[_0x4582('0x17')]?_0x1ba6a8[_0x4582('0x17')][_0x4582('0x18')]===undefined?!![]:![]:!![],'where':_0x1ba6a8[_0x4582('0x17')]?_0x1ba6a8[_0x4582('0x17')]['where']||null:null,'attributes':_0x1ba6a8['options']?_0x1ba6a8['options'][_0x4582('0x19')]||null:null,'limit':_0x1ba6a8['options']?_0x1ba6a8['options'][_0x4582('0x1a')]||null:null,'include':_0x1ba6a8['options']?_0x1ba6a8['options'][_0x4582('0x1b')]?_[_0x4582('0x1c')](_0x1ba6a8[_0x4582('0x17')][_0x4582('0x1b')],function(_0x543523){return{'model':db[_0x543523['model']],'as':_0x543523['as'],'attributes':_0x543523[_0x4582('0x19')],'include':_0x543523[_0x4582('0x1b')]?_[_0x4582('0x1c')](_0x543523[_0x4582('0x1b')],function(_0x34eb44){return{'model':db[_0x34eb44['model']],'as':_0x34eb44['as'],'attributes':_0x34eb44['attributes'],'include':_0x34eb44[_0x4582('0x1b')]?_['map'](_0x34eb44[_0x4582('0x1b')],function(_0x2925c3){return{'model':db[_0x2925c3[_0x4582('0x1d')]],'as':_0x2925c3['as'],'attributes':_0x2925c3[_0x4582('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x6ba408){logger[_0x4582('0xb')](_0x4582('0x15'),_0x1ba6a8);logger[_0x4582('0xe')]('GetZendeskAccount',_0x1ba6a8,JSON[_0x4582('0x10')](_0x6ba408));_0x41d478(_0x6ba408);})[_0x4582('0x14')](function(_0x1b2280){logger['error'](_0x4582('0x15'),_0x1b2280['message'],_0x1ba6a8);_0xfb0a63(_0x42ac46[_0x4582('0x11')](0x1f4,_0x1b2280['message']));});});};exports[_0x4582('0x1e')]=function(_0x1d7d06){var _0x24ebdd=this;return new Promise(function(_0x2e06e2,_0x1e2c1c){return db[_0x4582('0x1f')]['find']({'raw':_0x1d7d06[_0x4582('0x17')]?_0x1d7d06['options'][_0x4582('0x18')]===undefined?!![]:![]:!![],'where':_0x1d7d06['options']?_0x1d7d06[_0x4582('0x17')][_0x4582('0x20')]||null:null,'attributes':_0x1d7d06['options']?_0x1d7d06[_0x4582('0x17')][_0x4582('0x19')]||null:null,'include':_0x1d7d06[_0x4582('0x17')]?_0x1d7d06[_0x4582('0x17')][_0x4582('0x1b')]?_[_0x4582('0x1c')](_0x1d7d06[_0x4582('0x17')][_0x4582('0x1b')],function(_0x16291d){return{'model':db[_0x16291d['model']],'as':_0x16291d['as'],'attributes':_0x16291d['attributes'],'include':_0x16291d['include']?_[_0x4582('0x1c')](_0x16291d[_0x4582('0x1b')],function(_0xeb1897){return{'model':db[_0xeb1897['model']],'as':_0xeb1897['as'],'attributes':_0xeb1897[_0x4582('0x19')],'include':_0xeb1897[_0x4582('0x1b')]?_[_0x4582('0x1c')](_0xeb1897[_0x4582('0x1b')],function(_0x19234a){return{'model':db[_0x19234a['model']],'as':_0x19234a['as'],'attributes':_0x19234a[_0x4582('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4582('0xa')](function(_0x9ce773){logger[_0x4582('0xb')](_0x4582('0x1e'),_0x1d7d06);logger[_0x4582('0xe')](_0x4582('0x1e'),_0x1d7d06,JSON['stringify'](_0x9ce773));_0x2e06e2(_0x9ce773);})[_0x4582('0x14')](function(_0x39339a){logger[_0x4582('0x11')](_0x4582('0x1e'),_0x39339a[_0x4582('0x12')],_0x1d7d06);_0x1e2c1c(_0x24ebdd[_0x4582('0x11')](0x1f4,_0x39339a[_0x4582('0x12')]));});});};
\ No newline at end of file
index 461edb9..3440f98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['put','update','delete','/:id','destroy','exports','multer','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','create','post','setTags'];(function(_0x4d571a,_0x19caec){var _0xba9f93=function(_0x38b6b4){while(--_0x38b6b4){_0x4d571a['push'](_0x4d571a['shift']());}};_0xba9f93(++_0x19caec);}(_0xf4eb,0xec));var _0xbf4e=function(_0xc97894,_0x57021e){_0xc97894=_0xc97894-0x0;var _0x38d58c=_0xf4eb[_0xc97894];return _0x38d58c;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/:id',auth[_0xbf4e('0x6')](),controller['show']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['get']('/:id/descriptions',auth[_0xbf4e('0x6')](),controller['getDescriptions']);router[_0xbf4e('0x5')](_0xbf4e('0xc'),auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbf4e('0xe')]);router[_0xbf4e('0xf')](_0xbf4e('0xc'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x10')]);router[_0xbf4e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0x12')]);router[_0xbf4e('0x13')](_0xbf4e('0x14'),auth['isAuthenticated'](),controller[_0xbf4e('0x15')]);module[_0xbf4e('0x16')]=router;
\ No newline at end of file
+var _0x750a=['getTags','post','setTags','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','getSubjects','/:id/tags'];(function(_0x37534f,_0x47dfc3){var _0x3bc1b1=function(_0x20eebd){while(--_0x20eebd){_0x37534f['push'](_0x37534f['shift']());}};_0x3bc1b1(++_0x47dfc3);}(_0x750a,0x140));var _0xa750=function(_0x152196,_0x4d4dfe){_0x152196=_0x152196-0x0;var _0xf894d1=_0x750a[_0x152196];return _0xf894d1;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['show']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0x8')]('/:id/subjects',auth[_0xa750('0x9')](),controller[_0xa750('0xe')]);router['get']('/:id/descriptions',auth[_0xa750('0x9')](),controller['getDescriptions']);router[_0xa750('0x8')](_0xa750('0xf'),auth['isAuthenticated'](),controller[_0xa750('0x10')]);router[_0xa750('0x11')]('/',auth[_0xa750('0x9')](),controller['create']);router[_0xa750('0x11')](_0xa750('0xf'),auth[_0xa750('0x9')](),controller[_0xa750('0x12')]);router[_0xa750('0x13')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x14')]);router[_0xa750('0x15')](_0xa750('0xb'),auth['isAuthenticated'](),controller[_0xa750('0x16')]);module[_0xa750('0x17')]=router;
\ No newline at end of file
index 65eaf94..d7cae28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc01=['STRING','sequelize','exports'];(function(_0x33d73b,_0x5e26c0){var _0x3e628b=function(_0x67cb46){while(--_0x67cb46){_0x33d73b['push'](_0x33d73b['shift']());}};_0x3e628b(++_0x5e26c0);}(_0xfc01,0x10c));var _0x1fc0=function(_0x52f9b3,_0x543e02){_0x52f9b3=_0x52f9b3-0x0;var _0x194078=_0xfc01[_0x52f9b3];return _0x194078;};'use strict';var Sequelize=require(_0x1fc0('0x0'));module[_0x1fc0('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1fc0('0x2')]}};
\ No newline at end of file
+var _0x5434=['exports','STRING','sequelize'];(function(_0x26133f,_0x51633d){var _0x39392a=function(_0x351c38){while(--_0x351c38){_0x26133f['push'](_0x26133f['shift']());}};_0x39392a(++_0x51633d);}(_0x5434,0x9e));var _0x4543=function(_0x4bbd8b,_0x594a89){_0x4bbd8b=_0x4bbd8b-0x0;var _0x38f60d=_0x5434[_0x4bbd8b];return _0x38f60d;};'use strict';var Sequelize=require(_0x4543('0x0'));module[_0x4543('0x1')]={'name':{'type':Sequelize[_0x4543('0x2')]},'description':{'type':Sequelize[_0x4543('0x2')]}};
\ No newline at end of file
index af7d083..77f6871 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb35=['save','update','then','destroy','end','error','stack','name','index','map','ZendeskConfiguration','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','findOne','ZendeskField','length','order','pick','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','sendStatus','status','offset','undefined','count','limit','json','reject'];(function(_0x32db9e,_0x59ebf6){var _0x4aa1d5=function(_0x2f4213){while(--_0x2f4213){_0x32db9e['push'](_0x32db9e['shift']());}};_0x4aa1d5(++_0x59ebf6);}(_0xdb35,0x83));var _0x5db3=function(_0x19d920,_0x4300b4){_0x19d920=_0x19d920-0x0;var _0x7ad1d5=_0xdb35[_0x19d920];return _0x7ad1d5;};'use strict';var emlformat=require(_0x5db3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5db3('0x1'));var jsonpatch=require(_0x5db3('0x2'));var rp=require(_0x5db3('0x3'));var moment=require('moment');var BPromise=require(_0x5db3('0x4'));var Mustache=require(_0x5db3('0x5'));var util=require(_0x5db3('0x6'));var path=require(_0x5db3('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5db3('0x8'));var fs=require('fs');var fs_extra=require(_0x5db3('0x9'));var _=require('lodash');var squel=require(_0x5db3('0xa'));var crypto=require('crypto');var jsforce=require(_0x5db3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5db3('0xc'));var querystring=require(_0x5db3('0xd'));var Papa=require(_0x5db3('0xe'));var Redis=require(_0x5db3('0xf'));var authService=require(_0x5db3('0x10'));var qs=require(_0x5db3('0x11'));var as=require(_0x5db3('0x12'));var hardwareService=require(_0x5db3('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5db3('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1dd3b2,_0x42ff5f){_0x42ff5f=_0x42ff5f||0xcc;return function(_0x4171f1){if(_0x4171f1){return _0x1dd3b2[_0x5db3('0x15')](_0x42ff5f);}return _0x1dd3b2[_0x5db3('0x16')](_0x42ff5f)['end']();};}function respondWithResult(_0x3cd22c,_0x52b89d){_0x52b89d=_0x52b89d||0xc8;return function(_0x3864cb){if(_0x3864cb){return _0x3cd22c[_0x5db3('0x16')](_0x52b89d)['json'](_0x3864cb);}};}function respondWithFilteredResult(_0xfd273e,_0x14a370){return function(_0x5209a6){if(_0x5209a6){var _0x445db5=typeof _0x14a370[_0x5db3('0x17')]==='undefined'&&typeof _0x14a370['limit']===_0x5db3('0x18');var _0x1483c8=_0x5209a6[_0x5db3('0x19')];var _0x151a93=_0x445db5?0x0:_0x14a370['offset'];var _0x1256f3=_0x445db5?_0x5209a6[_0x5db3('0x19')]:_0x14a370[_0x5db3('0x17')]+_0x14a370[_0x5db3('0x1a')];var _0x2dff46;if(_0x1256f3>=_0x1483c8){_0x1256f3=_0x1483c8;_0x2dff46=0xc8;}else{_0x2dff46=0xce;}_0xfd273e[_0x5db3('0x16')](_0x2dff46);return _0xfd273e['set']('Content-Range',_0x151a93+'-'+_0x1256f3+'/'+_0x1483c8)[_0x5db3('0x1b')](_0x5209a6);}return null;};}function patchUpdates(_0x500b1c){return function(_0x563e51){try{jsonpatch['apply'](_0x563e51,_0x500b1c,!![]);}catch(_0x1ea3c3){return BPromise[_0x5db3('0x1c')](_0x1ea3c3);}return _0x563e51[_0x5db3('0x1d')]();};}function saveUpdates(_0x38cb5f,_0xd84142){return function(_0x5a1d12){if(_0x5a1d12){return _0x5a1d12[_0x5db3('0x1e')](_0x38cb5f)[_0x5db3('0x1f')](function(_0x430fae){return _0x430fae;});}return null;};}function removeEntity(_0x2dfb1b,_0x3acd56){return function(_0x1ffffa){if(_0x1ffffa){return _0x1ffffa[_0x5db3('0x20')]()[_0x5db3('0x1f')](function(){_0x2dfb1b[_0x5db3('0x16')](0xcc)[_0x5db3('0x21')]();});}};}function handleEntityNotFound(_0x45df31,_0x5e47e2){return function(_0xd68ba){if(!_0xd68ba){_0x45df31['sendStatus'](0x194);}return _0xd68ba;};}function handleError(_0x132591,_0x37e65b){_0x37e65b=_0x37e65b||0x1f4;return function(_0xb2b5a9){logger[_0x5db3('0x22')](_0xb2b5a9[_0x5db3('0x23')]);if(_0xb2b5a9['name']){delete _0xb2b5a9[_0x5db3('0x24')];}_0x132591['status'](_0x37e65b)['send'](_0xb2b5a9);};}exports[_0x5db3('0x25')]=function(_0x8c549a,_0x283fa4){var _0x87f5ec={},_0x54d795={},_0x4ba1b7={'count':0x0,'rows':[]};var _0x29a3c0=_[_0x5db3('0x26')](db[_0x5db3('0x27')][_0x5db3('0x28')],function(_0x1471c5){return{'name':_0x1471c5['fieldName'],'type':_0x1471c5[_0x5db3('0x29')][_0x5db3('0x2a')]};});_0x54d795['model']=_[_0x5db3('0x26')](_0x29a3c0,'name');_0x54d795[_0x5db3('0x2b')]=_[_0x5db3('0x2c')](_0x8c549a[_0x5db3('0x2b')]);_0x54d795[_0x5db3('0x2d')]=_[_0x5db3('0x2e')](_0x54d795[_0x5db3('0x2f')],_0x54d795[_0x5db3('0x2b')]);_0x87f5ec['attributes']=_[_0x5db3('0x2e')](_0x54d795[_0x5db3('0x2f')],qs[_0x5db3('0x30')](_0x8c549a[_0x5db3('0x2b')][_0x5db3('0x30')]));_0x87f5ec[_0x5db3('0x31')]=_0x87f5ec[_0x5db3('0x31')]['length']?_0x87f5ec[_0x5db3('0x31')]:_0x54d795['model'];if(!_0x8c549a[_0x5db3('0x2b')][_0x5db3('0x32')](_0x5db3('0x33'))){_0x87f5ec[_0x5db3('0x1a')]=qs['limit'](_0x8c549a['query']['limit']);_0x87f5ec['offset']=qs[_0x5db3('0x17')](_0x8c549a['query'][_0x5db3('0x17')]);}_0x87f5ec['order']=qs[_0x5db3('0x34')](_0x8c549a['query'][_0x5db3('0x34')]);_0x87f5ec[_0x5db3('0x35')]=qs[_0x5db3('0x2d')](_['pick'](_0x8c549a[_0x5db3('0x2b')],_0x54d795[_0x5db3('0x2d')]),_0x29a3c0);if(_0x8c549a['query'][_0x5db3('0x36')]){_0x87f5ec[_0x5db3('0x35')]=_[_0x5db3('0x37')](_0x87f5ec[_0x5db3('0x35')],{'$or':_[_0x5db3('0x26')](_0x29a3c0,function(_0x115b42){if(_0x115b42['type']!==_0x5db3('0x38')){var _0x55215d={};_0x55215d[_0x115b42[_0x5db3('0x24')]]={'$like':'%'+_0x8c549a[_0x5db3('0x2b')][_0x5db3('0x36')]+'%'};return _0x55215d;}})});}_0x87f5ec=_[_0x5db3('0x37')]({},_0x87f5ec,_0x8c549a[_0x5db3('0x39')]);var _0x4a467d={'where':_0x87f5ec['where']};return db['ZendeskConfiguration']['count'](_0x4a467d)[_0x5db3('0x1f')](function(_0x52010a){_0x4ba1b7['count']=_0x52010a;if(_0x8c549a[_0x5db3('0x2b')]['includeAll']){_0x87f5ec[_0x5db3('0x3a')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0x5db3('0x3b')](_0x87f5ec);})['then'](function(_0x32f140){_0x4ba1b7[_0x5db3('0x3c')]=_0x32f140;return _0x4ba1b7;})[_0x5db3('0x1f')](respondWithFilteredResult(_0x283fa4,_0x87f5ec))[_0x5db3('0x3d')](handleError(_0x283fa4,null));};exports[_0x5db3('0x3e')]=function(_0x4d6715,_0xbd6704){var _0x1237c8={'raw':![],'where':{'id':_0x4d6715[_0x5db3('0x3f')]['id']}},_0x42d5b7={};_0x42d5b7[_0x5db3('0x2f')]=_[_0x5db3('0x2c')](db[_0x5db3('0x27')][_0x5db3('0x28')]);_0x42d5b7[_0x5db3('0x2b')]=_[_0x5db3('0x2c')](_0x4d6715['query']);_0x42d5b7[_0x5db3('0x2d')]=_[_0x5db3('0x2e')](_0x42d5b7[_0x5db3('0x2f')],_0x42d5b7['query']);_0x1237c8[_0x5db3('0x31')]=_['intersection'](_0x42d5b7[_0x5db3('0x2f')],qs[_0x5db3('0x30')](_0x4d6715[_0x5db3('0x2b')][_0x5db3('0x30')]));_0x1237c8['attributes']=_0x1237c8['attributes']['length']?_0x1237c8[_0x5db3('0x31')]:_0x42d5b7[_0x5db3('0x2f')];if(_0x4d6715[_0x5db3('0x2b')][_0x5db3('0x40')]){_0x1237c8[_0x5db3('0x3a')]=[{'all':!![]}];}_0x1237c8=_['merge']({},_0x1237c8,_0x4d6715[_0x5db3('0x39')]);return db[_0x5db3('0x27')][_0x5db3('0x41')](_0x1237c8)[_0x5db3('0x1f')](handleEntityNotFound(_0xbd6704,null))[_0x5db3('0x1f')](respondWithResult(_0xbd6704,null))[_0x5db3('0x3d')](handleError(_0xbd6704,null));};exports[_0x5db3('0x42')]=function(_0xb7d2e7,_0x3d034b){return db[_0x5db3('0x27')][_0x5db3('0x42')](_0xb7d2e7['body'],{})[_0x5db3('0x1f')](respondWithResult(_0x3d034b,0xc9))[_0x5db3('0x3d')](handleError(_0x3d034b,null));};exports[_0x5db3('0x1e')]=function(_0x15494b,_0x4a3a04){if(_0x15494b['body']['id']){delete _0x15494b[_0x5db3('0x43')]['id'];}return db[_0x5db3('0x27')]['find']({'where':{'id':_0x15494b[_0x5db3('0x3f')]['id']}})[_0x5db3('0x1f')](handleEntityNotFound(_0x4a3a04,null))[_0x5db3('0x1f')](saveUpdates(_0x15494b[_0x5db3('0x43')],null))[_0x5db3('0x1f')](respondWithResult(_0x4a3a04,null))[_0x5db3('0x3d')](handleError(_0x4a3a04,null));};exports[_0x5db3('0x20')]=function(_0x1e731b,_0x432ad8){return db['ZendeskConfiguration'][_0x5db3('0x41')]({'where':{'id':_0x1e731b['params']['id']}})[_0x5db3('0x1f')](handleEntityNotFound(_0x432ad8,null))[_0x5db3('0x1f')](removeEntity(_0x432ad8,null))[_0x5db3('0x3d')](handleError(_0x432ad8,null));};exports['getFields']=function(_0x1755a9,_0x400a35,_0x28b2fd){var _0x3fc5cb={};var _0xf9098f={};var _0x39e227;var _0x32ecfe;return db[_0x5db3('0x27')][_0x5db3('0x44')]({'where':{'id':_0x1755a9[_0x5db3('0x3f')]['id']}})[_0x5db3('0x1f')](handleEntityNotFound(_0x400a35,null))[_0x5db3('0x1f')](function(_0x8bbe00){if(_0x8bbe00){_0x39e227=_0x8bbe00;_0xf9098f['model']=_[_0x5db3('0x2c')](db[_0x5db3('0x45')][_0x5db3('0x28')]);_0xf9098f[_0x5db3('0x2b')]=_[_0x5db3('0x2c')](_0x1755a9[_0x5db3('0x2b')]);_0xf9098f['filters']=_[_0x5db3('0x2e')](_0xf9098f[_0x5db3('0x2f')],_0xf9098f[_0x5db3('0x2b')]);_0x3fc5cb[_0x5db3('0x31')]=_[_0x5db3('0x2e')](_0xf9098f[_0x5db3('0x2f')],qs[_0x5db3('0x30')](_0x1755a9['query'][_0x5db3('0x30')]));_0x3fc5cb[_0x5db3('0x31')]=_0x3fc5cb['attributes'][_0x5db3('0x46')]?_0x3fc5cb[_0x5db3('0x31')]:_0xf9098f[_0x5db3('0x2f')];_0x3fc5cb[_0x5db3('0x47')]=qs[_0x5db3('0x34')](_0x1755a9[_0x5db3('0x2b')]['sort']);_0x3fc5cb['where']=qs[_0x5db3('0x2d')](_[_0x5db3('0x48')](_0x1755a9[_0x5db3('0x2b')],_0xf9098f[_0x5db3('0x2d')]));if(_0x1755a9[_0x5db3('0x2b')][_0x5db3('0x36')]){_0x3fc5cb['where']=_[_0x5db3('0x37')](_0x3fc5cb[_0x5db3('0x35')],{'$or':_[_0x5db3('0x26')](_0x3fc5cb[_0x5db3('0x31')],function(_0x2fba1e){var _0x7d95a0={};_0x7d95a0[_0x2fba1e]={'$like':'%'+_0x1755a9[_0x5db3('0x2b')][_0x5db3('0x36')]+'%'};return _0x7d95a0;})});}_0x3fc5cb=_[_0x5db3('0x37')]({},_0x3fc5cb,_0x1755a9[_0x5db3('0x39')]);return _0x39e227[_0x5db3('0x49')](_0x3fc5cb);}})[_0x5db3('0x1f')](function(_0x26b416){if(_0x26b416){_0x32ecfe=_0x26b416['length'];if(!_0x1755a9[_0x5db3('0x2b')]['hasOwnProperty']('nolimit')){_0x3fc5cb[_0x5db3('0x1a')]=qs[_0x5db3('0x1a')](_0x1755a9['query'][_0x5db3('0x1a')]);_0x3fc5cb[_0x5db3('0x17')]=qs[_0x5db3('0x17')](_0x1755a9[_0x5db3('0x2b')][_0x5db3('0x17')]);}return _0x39e227['getFields'](_0x3fc5cb);}})[_0x5db3('0x1f')](function(_0x50e907){if(_0x50e907){return _0x50e907?{'count':_0x32ecfe,'rows':_0x50e907}:null;}})[_0x5db3('0x1f')](respondWithResult(_0x400a35,null))[_0x5db3('0x3d')](handleError(_0x400a35,null));};exports['getSubjects']=function(_0x17e8f6,_0x3572f9,_0xa6c8d6){var _0x292bb4={};var _0x309aeb={};var _0x27ef2a;var _0x51b88e;return db['ZendeskConfiguration'][_0x5db3('0x44')]({'where':{'id':_0x17e8f6['params']['id']}})[_0x5db3('0x1f')](handleEntityNotFound(_0x3572f9,null))[_0x5db3('0x1f')](function(_0xfa03fd){if(_0xfa03fd){_0x27ef2a=_0xfa03fd;_0x309aeb[_0x5db3('0x2f')]=_[_0x5db3('0x2c')](db[_0x5db3('0x45')][_0x5db3('0x28')]);_0x309aeb[_0x5db3('0x2b')]=_[_0x5db3('0x2c')](_0x17e8f6[_0x5db3('0x2b')]);_0x309aeb[_0x5db3('0x2d')]=_[_0x5db3('0x2e')](_0x309aeb[_0x5db3('0x2f')],_0x309aeb[_0x5db3('0x2b')]);_0x292bb4[_0x5db3('0x31')]=_[_0x5db3('0x2e')](_0x309aeb[_0x5db3('0x2f')],qs[_0x5db3('0x30')](_0x17e8f6[_0x5db3('0x2b')][_0x5db3('0x30')]));_0x292bb4[_0x5db3('0x31')]=_0x292bb4[_0x5db3('0x31')]['length']?_0x292bb4['attributes']:_0x309aeb[_0x5db3('0x2f')];_0x292bb4[_0x5db3('0x47')]=qs['sort'](_0x17e8f6['query'][_0x5db3('0x34')]);_0x292bb4[_0x5db3('0x35')]=qs[_0x5db3('0x2d')](_[_0x5db3('0x48')](_0x17e8f6[_0x5db3('0x2b')],_0x309aeb[_0x5db3('0x2d')]));if(_0x17e8f6[_0x5db3('0x2b')][_0x5db3('0x36')]){_0x292bb4['where']=_['merge'](_0x292bb4['where'],{'$or':_[_0x5db3('0x26')](_0x292bb4['attributes'],function(_0xf7b122){var _0x15df57={};_0x15df57[_0xf7b122]={'$like':'%'+_0x17e8f6['query'][_0x5db3('0x36')]+'%'};return _0x15df57;})});}_0x292bb4=_[_0x5db3('0x37')]({},_0x292bb4,_0x17e8f6[_0x5db3('0x39')]);return _0x27ef2a['getSubjects'](_0x292bb4);}})[_0x5db3('0x1f')](function(_0x37e765){if(_0x37e765){_0x51b88e=_0x37e765['length'];if(!_0x17e8f6['query']['hasOwnProperty'](_0x5db3('0x33'))){_0x292bb4[_0x5db3('0x1a')]=qs[_0x5db3('0x1a')](_0x17e8f6[_0x5db3('0x2b')]['limit']);_0x292bb4['offset']=qs[_0x5db3('0x17')](_0x17e8f6[_0x5db3('0x2b')][_0x5db3('0x17')]);}return _0x27ef2a[_0x5db3('0x4a')](_0x292bb4);}})[_0x5db3('0x1f')](function(_0x43da46){if(_0x43da46){return _0x43da46?{'count':_0x51b88e,'rows':_0x43da46}:null;}})[_0x5db3('0x1f')](respondWithResult(_0x3572f9,null))['catch'](handleError(_0x3572f9,null));};exports[_0x5db3('0x4b')]=function(_0x964315,_0x113932,_0x18a77e){var _0x5b6292={};var _0x2bd31a={};var _0x69743c;var _0x41477f;return db[_0x5db3('0x27')][_0x5db3('0x44')]({'where':{'id':_0x964315[_0x5db3('0x3f')]['id']}})[_0x5db3('0x1f')](handleEntityNotFound(_0x113932,null))[_0x5db3('0x1f')](function(_0x282a18){if(_0x282a18){_0x69743c=_0x282a18;_0x2bd31a[_0x5db3('0x2f')]=_['keys'](db[_0x5db3('0x45')][_0x5db3('0x28')]);_0x2bd31a[_0x5db3('0x2b')]=_[_0x5db3('0x2c')](_0x964315['query']);_0x2bd31a[_0x5db3('0x2d')]=_['intersection'](_0x2bd31a[_0x5db3('0x2f')],_0x2bd31a['query']);_0x5b6292[_0x5db3('0x31')]=_['intersection'](_0x2bd31a[_0x5db3('0x2f')],qs[_0x5db3('0x30')](_0x964315[_0x5db3('0x2b')]['fields']));_0x5b6292[_0x5db3('0x31')]=_0x5b6292['attributes'][_0x5db3('0x46')]?_0x5b6292[_0x5db3('0x31')]:_0x2bd31a['model'];_0x5b6292['order']=qs[_0x5db3('0x34')](_0x964315[_0x5db3('0x2b')][_0x5db3('0x34')]);_0x5b6292[_0x5db3('0x35')]=qs[_0x5db3('0x2d')](_[_0x5db3('0x48')](_0x964315[_0x5db3('0x2b')],_0x2bd31a[_0x5db3('0x2d')]));if(_0x964315[_0x5db3('0x2b')][_0x5db3('0x36')]){_0x5b6292[_0x5db3('0x35')]=_[_0x5db3('0x37')](_0x5b6292[_0x5db3('0x35')],{'$or':_[_0x5db3('0x26')](_0x5b6292[_0x5db3('0x31')],function(_0x59fe5b){var _0x713442={};_0x713442[_0x59fe5b]={'$like':'%'+_0x964315[_0x5db3('0x2b')][_0x5db3('0x36')]+'%'};return _0x713442;})});}_0x5b6292=_['merge']({},_0x5b6292,_0x964315[_0x5db3('0x39')]);return _0x69743c['getDescriptions'](_0x5b6292);}})[_0x5db3('0x1f')](function(_0x1f491c){if(_0x1f491c){_0x41477f=_0x1f491c[_0x5db3('0x46')];if(!_0x964315[_0x5db3('0x2b')][_0x5db3('0x32')](_0x5db3('0x33'))){_0x5b6292[_0x5db3('0x1a')]=qs['limit'](_0x964315['query']['limit']);_0x5b6292['offset']=qs[_0x5db3('0x17')](_0x964315[_0x5db3('0x2b')][_0x5db3('0x17')]);}return _0x69743c[_0x5db3('0x4b')](_0x5b6292);}})['then'](function(_0x132815){if(_0x132815){return _0x132815?{'count':_0x41477f,'rows':_0x132815}:null;}})['then'](respondWithResult(_0x113932,null))['catch'](handleError(_0x113932,null));};exports[_0x5db3('0x4c')]=function(_0x5cfe9b,_0x7dc784,_0x319545){var _0x3a9966={};var _0x2168ce={};var _0x40e0d3;var _0x536af8;return db['ZendeskConfiguration'][_0x5db3('0x44')]({'where':{'id':_0x5cfe9b['params']['id']}})['then'](handleEntityNotFound(_0x7dc784,null))['then'](function(_0x328013){if(_0x328013){_0x40e0d3=_0x328013;_0x2168ce[_0x5db3('0x2f')]=_['keys'](db[_0x5db3('0x4d')]['rawAttributes']);_0x2168ce[_0x5db3('0x2b')]=_[_0x5db3('0x2c')](_0x5cfe9b['query']);_0x2168ce[_0x5db3('0x2d')]=_[_0x5db3('0x2e')](_0x2168ce[_0x5db3('0x2f')],_0x2168ce['query']);_0x3a9966[_0x5db3('0x31')]=_[_0x5db3('0x2e')](_0x2168ce['model'],qs[_0x5db3('0x30')](_0x5cfe9b['query']['fields']));_0x3a9966[_0x5db3('0x31')]=_0x3a9966[_0x5db3('0x31')][_0x5db3('0x46')]?_0x3a9966[_0x5db3('0x31')]:_0x2168ce['model'];_0x3a9966[_0x5db3('0x47')]=qs['sort'](_0x5cfe9b[_0x5db3('0x2b')]['sort']);_0x3a9966[_0x5db3('0x35')]=qs[_0x5db3('0x2d')](_[_0x5db3('0x48')](_0x5cfe9b[_0x5db3('0x2b')],_0x2168ce[_0x5db3('0x2d')]));if(_0x5cfe9b[_0x5db3('0x2b')][_0x5db3('0x36')]){_0x3a9966[_0x5db3('0x35')]=_['merge'](_0x3a9966[_0x5db3('0x35')],{'$or':_[_0x5db3('0x26')](_0x3a9966[_0x5db3('0x31')],function(_0x15c2fc){var _0x4119ed={};_0x4119ed[_0x15c2fc]={'$like':'%'+_0x5cfe9b[_0x5db3('0x2b')]['filter']+'%'};return _0x4119ed;})});}_0x3a9966=_[_0x5db3('0x37')]({},_0x3a9966,_0x5cfe9b[_0x5db3('0x39')]);return _0x40e0d3[_0x5db3('0x4c')](_0x3a9966);}})['then'](function(_0x3da140){if(_0x3da140){_0x536af8=_0x3da140[_0x5db3('0x46')];if(!_0x5cfe9b[_0x5db3('0x2b')][_0x5db3('0x32')](_0x5db3('0x33'))){_0x3a9966[_0x5db3('0x1a')]=qs['limit'](_0x5cfe9b['query']['limit']);_0x3a9966[_0x5db3('0x17')]=qs[_0x5db3('0x17')](_0x5cfe9b['query'][_0x5db3('0x17')]);}return _0x40e0d3['getTags'](_0x3a9966);}})[_0x5db3('0x1f')](function(_0x2df24c){if(_0x2df24c){return _0x2df24c?{'count':_0x536af8,'rows':_0x2df24c}:null;}})[_0x5db3('0x1f')](respondWithResult(_0x7dc784,null))['catch'](handleError(_0x7dc784,null));};exports[_0x5db3('0x4e')]=function(_0xe14b9c,_0x51ce30,_0x2d98a1){if(_0xe14b9c[_0x5db3('0x43')]['id']){delete _0xe14b9c[_0x5db3('0x43')]['id'];}return db[_0x5db3('0x27')][_0x5db3('0x44')]({'where':{'id':_0xe14b9c[_0x5db3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x51ce30,null))[_0x5db3('0x1f')](function(_0x229730){if(_0x229730){return _0x229730[_0x5db3('0x4e')](_0xe14b9c[_0x5db3('0x43')][_0x5db3('0x4f')]||[]);}return null;})[_0x5db3('0x1f')](respondWithResult(_0x51ce30,null))[_0x5db3('0x3d')](handleError(_0x51ce30,null));};
\ No newline at end of file
+var _0xc47c=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','name','send','map','ZendeskConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','rawAttributes','includeAll','catch','create','body','find','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring'];(function(_0x119e6f,_0x431293){var _0x1fd629=function(_0x2eca7b){while(--_0x2eca7b){_0x119e6f['push'](_0x119e6f['shift']());}};_0x1fd629(++_0x431293);}(_0xc47c,0x99));var _0xcc47=function(_0x511e9a,_0x5e355b){_0x511e9a=_0x511e9a-0x0;var _0x23ad78=_0xc47c[_0x511e9a];return _0x23ad78;};'use strict';var emlformat=require(_0xcc47('0x0'));var rimraf=require(_0xcc47('0x1'));var zipdir=require(_0xcc47('0x2'));var jsonpatch=require(_0xcc47('0x3'));var rp=require(_0xcc47('0x4'));var moment=require('moment');var BPromise=require(_0xcc47('0x5'));var Mustache=require('mustache');var util=require(_0xcc47('0x6'));var path=require(_0xcc47('0x7'));var sox=require(_0xcc47('0x8'));var csv=require('to-csv');var ejs=require(_0xcc47('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc47('0xa'));var squel=require(_0xcc47('0xb'));var crypto=require('crypto');var jsforce=require(_0xcc47('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcc47('0xd'));var querystring=require(_0xcc47('0xe'));var Papa=require(_0xcc47('0xf'));var Redis=require(_0xcc47('0x10'));var authService=require(_0xcc47('0x11'));var qs=require(_0xcc47('0x12'));var as=require(_0xcc47('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc47('0x14'))(_0xcc47('0x15'));var utils=require(_0xcc47('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xcc47('0x17'));var db=require(_0xcc47('0x18'))['db'];function respondWithStatusCode(_0x30d4fe,_0x4a62da){_0x4a62da=_0x4a62da||0xcc;return function(_0xbed5cb){if(_0xbed5cb){return _0x30d4fe[_0xcc47('0x19')](_0x4a62da);}return _0x30d4fe[_0xcc47('0x1a')](_0x4a62da)[_0xcc47('0x1b')]();};}function respondWithResult(_0x184f0c,_0x20b7b9){_0x20b7b9=_0x20b7b9||0xc8;return function(_0x12ebb9){if(_0x12ebb9){return _0x184f0c[_0xcc47('0x1a')](_0x20b7b9)['json'](_0x12ebb9);}};}function respondWithFilteredResult(_0x1ebe3b,_0x8324dc){return function(_0x5b158a){if(_0x5b158a){var _0x436222=typeof _0x8324dc[_0xcc47('0x1c')]===_0xcc47('0x1d')&&typeof _0x8324dc[_0xcc47('0x1e')]===_0xcc47('0x1d');var _0x364b09=_0x5b158a['count'];var _0x81a545=_0x436222?0x0:_0x8324dc[_0xcc47('0x1c')];var _0x1062c7=_0x436222?_0x5b158a[_0xcc47('0x1f')]:_0x8324dc['offset']+_0x8324dc[_0xcc47('0x1e')];var _0x47c318;if(_0x1062c7>=_0x364b09){_0x1062c7=_0x364b09;_0x47c318=0xc8;}else{_0x47c318=0xce;}_0x1ebe3b[_0xcc47('0x1a')](_0x47c318);return _0x1ebe3b[_0xcc47('0x20')](_0xcc47('0x21'),_0x81a545+'-'+_0x1062c7+'/'+_0x364b09)['json'](_0x5b158a);}return null;};}function patchUpdates(_0x329e29){return function(_0x35b601){try{jsonpatch['apply'](_0x35b601,_0x329e29,!![]);}catch(_0x14752b){return BPromise[_0xcc47('0x22')](_0x14752b);}return _0x35b601[_0xcc47('0x23')]();};}function saveUpdates(_0x400c60,_0x23bbb4){return function(_0xd64e22){if(_0xd64e22){return _0xd64e22[_0xcc47('0x24')](_0x400c60)[_0xcc47('0x25')](function(_0x2bdc27){return _0x2bdc27;});}return null;};}function removeEntity(_0x5a10b6,_0x4736b4){return function(_0x241e83){if(_0x241e83){return _0x241e83[_0xcc47('0x26')]()[_0xcc47('0x25')](function(){_0x5a10b6[_0xcc47('0x1a')](0xcc)[_0xcc47('0x1b')]();});}};}function handleEntityNotFound(_0x5137f9,_0x4e6de1){return function(_0x1f7413){if(!_0x1f7413){_0x5137f9[_0xcc47('0x19')](0x194);}return _0x1f7413;};}function handleError(_0x5bace3,_0x5c5b39){_0x5c5b39=_0x5c5b39||0x1f4;return function(_0x2602d2){logger['error'](_0x2602d2['stack']);if(_0x2602d2[_0xcc47('0x27')]){delete _0x2602d2[_0xcc47('0x27')];}_0x5bace3['status'](_0x5c5b39)[_0xcc47('0x28')](_0x2602d2);};}exports['index']=function(_0x530cf3,_0x5eb871){var _0x2199ef={},_0x3d9327={},_0x1b3237={'count':0x0,'rows':[]};var _0x57aac5=_[_0xcc47('0x29')](db[_0xcc47('0x2a')]['rawAttributes'],function(_0x482ccf){return{'name':_0x482ccf[_0xcc47('0x2b')],'type':_0x482ccf[_0xcc47('0x2c')][_0xcc47('0x2d')]};});_0x3d9327[_0xcc47('0x2e')]=_[_0xcc47('0x29')](_0x57aac5,'name');_0x3d9327[_0xcc47('0x2f')]=_[_0xcc47('0x30')](_0x530cf3[_0xcc47('0x2f')]);_0x3d9327[_0xcc47('0x31')]=_[_0xcc47('0x32')](_0x3d9327['model'],_0x3d9327['query']);_0x2199ef[_0xcc47('0x33')]=_[_0xcc47('0x32')](_0x3d9327[_0xcc47('0x2e')],qs[_0xcc47('0x34')](_0x530cf3[_0xcc47('0x2f')]['fields']));_0x2199ef[_0xcc47('0x33')]=_0x2199ef[_0xcc47('0x33')][_0xcc47('0x35')]?_0x2199ef[_0xcc47('0x33')]:_0x3d9327[_0xcc47('0x2e')];if(!_0x530cf3[_0xcc47('0x2f')][_0xcc47('0x36')](_0xcc47('0x37'))){_0x2199ef[_0xcc47('0x1e')]=qs[_0xcc47('0x1e')](_0x530cf3[_0xcc47('0x2f')][_0xcc47('0x1e')]);_0x2199ef[_0xcc47('0x1c')]=qs[_0xcc47('0x1c')](_0x530cf3[_0xcc47('0x2f')][_0xcc47('0x1c')]);}_0x2199ef[_0xcc47('0x38')]=qs[_0xcc47('0x39')](_0x530cf3[_0xcc47('0x2f')][_0xcc47('0x39')]);_0x2199ef[_0xcc47('0x3a')]=qs[_0xcc47('0x31')](_[_0xcc47('0x3b')](_0x530cf3[_0xcc47('0x2f')],_0x3d9327['filters']),_0x57aac5);if(_0x530cf3[_0xcc47('0x2f')]['filter']){_0x2199ef[_0xcc47('0x3a')]=_[_0xcc47('0x3c')](_0x2199ef[_0xcc47('0x3a')],{'$or':_['map'](_0x57aac5,function(_0x7698f2){if(_0x7698f2[_0xcc47('0x2c')]!==_0xcc47('0x3d')){var _0x3e166a={};_0x3e166a[_0x7698f2['name']]={'$like':'%'+_0x530cf3[_0xcc47('0x2f')][_0xcc47('0x3e')]+'%'};return _0x3e166a;}})});}_0x2199ef=_[_0xcc47('0x3c')]({},_0x2199ef,_0x530cf3[_0xcc47('0x3f')]);var _0x49ea46={'where':_0x2199ef[_0xcc47('0x3a')]};return db[_0xcc47('0x2a')][_0xcc47('0x1f')](_0x49ea46)[_0xcc47('0x25')](function(_0x567f75){_0x1b3237[_0xcc47('0x1f')]=_0x567f75;if(_0x530cf3[_0xcc47('0x2f')]['includeAll']){_0x2199ef[_0xcc47('0x40')]=[{'all':!![]}];}return db[_0xcc47('0x2a')][_0xcc47('0x41')](_0x2199ef);})['then'](function(_0x2363ec){_0x1b3237[_0xcc47('0x42')]=_0x2363ec;return _0x1b3237;})[_0xcc47('0x25')](respondWithFilteredResult(_0x5eb871,_0x2199ef))['catch'](handleError(_0x5eb871,null));};exports[_0xcc47('0x43')]=function(_0x55f7d1,_0x4032e3){var _0x52a056={'raw':![],'where':{'id':_0x55f7d1[_0xcc47('0x44')]['id']}},_0x5a7f92={};_0x5a7f92['model']=_[_0xcc47('0x30')](db[_0xcc47('0x2a')][_0xcc47('0x45')]);_0x5a7f92[_0xcc47('0x2f')]=_[_0xcc47('0x30')](_0x55f7d1[_0xcc47('0x2f')]);_0x5a7f92[_0xcc47('0x31')]=_[_0xcc47('0x32')](_0x5a7f92['model'],_0x5a7f92['query']);_0x52a056[_0xcc47('0x33')]=_['intersection'](_0x5a7f92['model'],qs[_0xcc47('0x34')](_0x55f7d1[_0xcc47('0x2f')][_0xcc47('0x34')]));_0x52a056['attributes']=_0x52a056[_0xcc47('0x33')][_0xcc47('0x35')]?_0x52a056['attributes']:_0x5a7f92[_0xcc47('0x2e')];if(_0x55f7d1['query'][_0xcc47('0x46')]){_0x52a056[_0xcc47('0x40')]=[{'all':!![]}];}_0x52a056=_[_0xcc47('0x3c')]({},_0x52a056,_0x55f7d1[_0xcc47('0x3f')]);return db[_0xcc47('0x2a')]['find'](_0x52a056)[_0xcc47('0x25')](handleEntityNotFound(_0x4032e3,null))[_0xcc47('0x25')](respondWithResult(_0x4032e3,null))[_0xcc47('0x47')](handleError(_0x4032e3,null));};exports[_0xcc47('0x48')]=function(_0x5386a0,_0x116d53){return db[_0xcc47('0x2a')][_0xcc47('0x48')](_0x5386a0['body'],{})[_0xcc47('0x25')](respondWithResult(_0x116d53,0xc9))[_0xcc47('0x47')](handleError(_0x116d53,null));};exports[_0xcc47('0x24')]=function(_0x5c8a5a,_0x38cd52){if(_0x5c8a5a[_0xcc47('0x49')]['id']){delete _0x5c8a5a[_0xcc47('0x49')]['id'];}return db[_0xcc47('0x2a')][_0xcc47('0x4a')]({'where':{'id':_0x5c8a5a[_0xcc47('0x44')]['id']}})[_0xcc47('0x25')](handleEntityNotFound(_0x38cd52,null))[_0xcc47('0x25')](saveUpdates(_0x5c8a5a[_0xcc47('0x49')],null))[_0xcc47('0x25')](respondWithResult(_0x38cd52,null))[_0xcc47('0x47')](handleError(_0x38cd52,null));};exports[_0xcc47('0x26')]=function(_0x2915e4,_0x39d356){return db[_0xcc47('0x2a')][_0xcc47('0x4a')]({'where':{'id':_0x2915e4[_0xcc47('0x44')]['id']}})[_0xcc47('0x25')](handleEntityNotFound(_0x39d356,null))[_0xcc47('0x25')](removeEntity(_0x39d356,null))[_0xcc47('0x47')](handleError(_0x39d356,null));};exports[_0xcc47('0x4b')]=function(_0x26e1aa,_0x407fdb,_0xbaacb){var _0x48b9bb={};var _0x398a56={};var _0x314fdb;var _0x553471;return db['ZendeskConfiguration'][_0xcc47('0x4c')]({'where':{'id':_0x26e1aa[_0xcc47('0x44')]['id']}})[_0xcc47('0x25')](handleEntityNotFound(_0x407fdb,null))[_0xcc47('0x25')](function(_0x3a383d){if(_0x3a383d){_0x314fdb=_0x3a383d;_0x398a56[_0xcc47('0x2e')]=_['keys'](db[_0xcc47('0x4d')][_0xcc47('0x45')]);_0x398a56[_0xcc47('0x2f')]=_[_0xcc47('0x30')](_0x26e1aa[_0xcc47('0x2f')]);_0x398a56[_0xcc47('0x31')]=_[_0xcc47('0x32')](_0x398a56['model'],_0x398a56['query']);_0x48b9bb['attributes']=_[_0xcc47('0x32')](_0x398a56[_0xcc47('0x2e')],qs[_0xcc47('0x34')](_0x26e1aa[_0xcc47('0x2f')][_0xcc47('0x34')]));_0x48b9bb[_0xcc47('0x33')]=_0x48b9bb['attributes'][_0xcc47('0x35')]?_0x48b9bb['attributes']:_0x398a56[_0xcc47('0x2e')];_0x48b9bb['order']=qs[_0xcc47('0x39')](_0x26e1aa['query'][_0xcc47('0x39')]);_0x48b9bb[_0xcc47('0x3a')]=qs[_0xcc47('0x31')](_[_0xcc47('0x3b')](_0x26e1aa[_0xcc47('0x2f')],_0x398a56[_0xcc47('0x31')]));if(_0x26e1aa[_0xcc47('0x2f')][_0xcc47('0x3e')]){_0x48b9bb[_0xcc47('0x3a')]=_['merge'](_0x48b9bb['where'],{'$or':_[_0xcc47('0x29')](_0x48b9bb['attributes'],function(_0x34d16a){var _0x2c4089={};_0x2c4089[_0x34d16a]={'$like':'%'+_0x26e1aa[_0xcc47('0x2f')][_0xcc47('0x3e')]+'%'};return _0x2c4089;})});}_0x48b9bb=_[_0xcc47('0x3c')]({},_0x48b9bb,_0x26e1aa[_0xcc47('0x3f')]);return _0x314fdb[_0xcc47('0x4b')](_0x48b9bb);}})['then'](function(_0x1dc18f){if(_0x1dc18f){_0x553471=_0x1dc18f[_0xcc47('0x35')];if(!_0x26e1aa['query'][_0xcc47('0x36')](_0xcc47('0x37'))){_0x48b9bb[_0xcc47('0x1e')]=qs[_0xcc47('0x1e')](_0x26e1aa[_0xcc47('0x2f')][_0xcc47('0x1e')]);_0x48b9bb['offset']=qs[_0xcc47('0x1c')](_0x26e1aa['query'][_0xcc47('0x1c')]);}return _0x314fdb[_0xcc47('0x4b')](_0x48b9bb);}})[_0xcc47('0x25')](function(_0x5a053c){if(_0x5a053c){return _0x5a053c?{'count':_0x553471,'rows':_0x5a053c}:null;}})[_0xcc47('0x25')](respondWithResult(_0x407fdb,null))[_0xcc47('0x47')](handleError(_0x407fdb,null));};exports['getSubjects']=function(_0x5e923f,_0x24033d,_0xb2688c){var _0x342257={};var _0x47dabe={};var _0x237024;var _0xbe92ff;return db[_0xcc47('0x2a')][_0xcc47('0x4c')]({'where':{'id':_0x5e923f['params']['id']}})['then'](handleEntityNotFound(_0x24033d,null))[_0xcc47('0x25')](function(_0x3da94b){if(_0x3da94b){_0x237024=_0x3da94b;_0x47dabe['model']=_[_0xcc47('0x30')](db[_0xcc47('0x4d')][_0xcc47('0x45')]);_0x47dabe['query']=_['keys'](_0x5e923f[_0xcc47('0x2f')]);_0x47dabe[_0xcc47('0x31')]=_[_0xcc47('0x32')](_0x47dabe['model'],_0x47dabe['query']);_0x342257[_0xcc47('0x33')]=_[_0xcc47('0x32')](_0x47dabe['model'],qs[_0xcc47('0x34')](_0x5e923f[_0xcc47('0x2f')][_0xcc47('0x34')]));_0x342257[_0xcc47('0x33')]=_0x342257[_0xcc47('0x33')][_0xcc47('0x35')]?_0x342257['attributes']:_0x47dabe['model'];_0x342257[_0xcc47('0x38')]=qs[_0xcc47('0x39')](_0x5e923f['query'][_0xcc47('0x39')]);_0x342257[_0xcc47('0x3a')]=qs[_0xcc47('0x31')](_[_0xcc47('0x3b')](_0x5e923f['query'],_0x47dabe['filters']));if(_0x5e923f[_0xcc47('0x2f')][_0xcc47('0x3e')]){_0x342257['where']=_[_0xcc47('0x3c')](_0x342257[_0xcc47('0x3a')],{'$or':_['map'](_0x342257[_0xcc47('0x33')],function(_0x4c1317){var _0x360d8e={};_0x360d8e[_0x4c1317]={'$like':'%'+_0x5e923f[_0xcc47('0x2f')][_0xcc47('0x3e')]+'%'};return _0x360d8e;})});}_0x342257=_[_0xcc47('0x3c')]({},_0x342257,_0x5e923f[_0xcc47('0x3f')]);return _0x237024[_0xcc47('0x4e')](_0x342257);}})['then'](function(_0x57f138){if(_0x57f138){_0xbe92ff=_0x57f138[_0xcc47('0x35')];if(!_0x5e923f['query'][_0xcc47('0x36')](_0xcc47('0x37'))){_0x342257[_0xcc47('0x1e')]=qs[_0xcc47('0x1e')](_0x5e923f['query']['limit']);_0x342257[_0xcc47('0x1c')]=qs[_0xcc47('0x1c')](_0x5e923f[_0xcc47('0x2f')][_0xcc47('0x1c')]);}return _0x237024['getSubjects'](_0x342257);}})['then'](function(_0x4a1e52){if(_0x4a1e52){return _0x4a1e52?{'count':_0xbe92ff,'rows':_0x4a1e52}:null;}})['then'](respondWithResult(_0x24033d,null))[_0xcc47('0x47')](handleError(_0x24033d,null));};exports[_0xcc47('0x4f')]=function(_0x406c7f,_0x344ebc,_0x396c50){var _0x20abb5={};var _0x1f5f4a={};var _0xeac5da;var _0x3be925;return db['ZendeskConfiguration'][_0xcc47('0x4c')]({'where':{'id':_0x406c7f['params']['id']}})[_0xcc47('0x25')](handleEntityNotFound(_0x344ebc,null))['then'](function(_0xa0e431){if(_0xa0e431){_0xeac5da=_0xa0e431;_0x1f5f4a[_0xcc47('0x2e')]=_[_0xcc47('0x30')](db[_0xcc47('0x4d')][_0xcc47('0x45')]);_0x1f5f4a[_0xcc47('0x2f')]=_[_0xcc47('0x30')](_0x406c7f[_0xcc47('0x2f')]);_0x1f5f4a[_0xcc47('0x31')]=_[_0xcc47('0x32')](_0x1f5f4a[_0xcc47('0x2e')],_0x1f5f4a[_0xcc47('0x2f')]);_0x20abb5[_0xcc47('0x33')]=_['intersection'](_0x1f5f4a[_0xcc47('0x2e')],qs[_0xcc47('0x34')](_0x406c7f[_0xcc47('0x2f')][_0xcc47('0x34')]));_0x20abb5[_0xcc47('0x33')]=_0x20abb5[_0xcc47('0x33')][_0xcc47('0x35')]?_0x20abb5[_0xcc47('0x33')]:_0x1f5f4a[_0xcc47('0x2e')];_0x20abb5[_0xcc47('0x38')]=qs[_0xcc47('0x39')](_0x406c7f[_0xcc47('0x2f')][_0xcc47('0x39')]);_0x20abb5[_0xcc47('0x3a')]=qs[_0xcc47('0x31')](_[_0xcc47('0x3b')](_0x406c7f[_0xcc47('0x2f')],_0x1f5f4a[_0xcc47('0x31')]));if(_0x406c7f[_0xcc47('0x2f')][_0xcc47('0x3e')]){_0x20abb5[_0xcc47('0x3a')]=_[_0xcc47('0x3c')](_0x20abb5[_0xcc47('0x3a')],{'$or':_[_0xcc47('0x29')](_0x20abb5[_0xcc47('0x33')],function(_0x42faa3){var _0x345ef7={};_0x345ef7[_0x42faa3]={'$like':'%'+_0x406c7f[_0xcc47('0x2f')][_0xcc47('0x3e')]+'%'};return _0x345ef7;})});}_0x20abb5=_[_0xcc47('0x3c')]({},_0x20abb5,_0x406c7f[_0xcc47('0x3f')]);return _0xeac5da['getDescriptions'](_0x20abb5);}})[_0xcc47('0x25')](function(_0x20e379){if(_0x20e379){_0x3be925=_0x20e379[_0xcc47('0x35')];if(!_0x406c7f[_0xcc47('0x2f')][_0xcc47('0x36')](_0xcc47('0x37'))){_0x20abb5[_0xcc47('0x1e')]=qs['limit'](_0x406c7f[_0xcc47('0x2f')][_0xcc47('0x1e')]);_0x20abb5[_0xcc47('0x1c')]=qs[_0xcc47('0x1c')](_0x406c7f['query'][_0xcc47('0x1c')]);}return _0xeac5da['getDescriptions'](_0x20abb5);}})[_0xcc47('0x25')](function(_0x1617c3){if(_0x1617c3){return _0x1617c3?{'count':_0x3be925,'rows':_0x1617c3}:null;}})[_0xcc47('0x25')](respondWithResult(_0x344ebc,null))[_0xcc47('0x47')](handleError(_0x344ebc,null));};exports[_0xcc47('0x50')]=function(_0x31c637,_0x41a382,_0x32f382){var _0x1d20bf={};var _0x1400df={};var _0x55d54b;var _0x2e05ce;return db[_0xcc47('0x2a')][_0xcc47('0x4c')]({'where':{'id':_0x31c637['params']['id']}})[_0xcc47('0x25')](handleEntityNotFound(_0x41a382,null))[_0xcc47('0x25')](function(_0x365668){if(_0x365668){_0x55d54b=_0x365668;_0x1400df[_0xcc47('0x2e')]=_[_0xcc47('0x30')](db[_0xcc47('0x51')]['rawAttributes']);_0x1400df[_0xcc47('0x2f')]=_[_0xcc47('0x30')](_0x31c637[_0xcc47('0x2f')]);_0x1400df[_0xcc47('0x31')]=_[_0xcc47('0x32')](_0x1400df[_0xcc47('0x2e')],_0x1400df['query']);_0x1d20bf[_0xcc47('0x33')]=_[_0xcc47('0x32')](_0x1400df[_0xcc47('0x2e')],qs[_0xcc47('0x34')](_0x31c637['query'][_0xcc47('0x34')]));_0x1d20bf[_0xcc47('0x33')]=_0x1d20bf[_0xcc47('0x33')][_0xcc47('0x35')]?_0x1d20bf[_0xcc47('0x33')]:_0x1400df[_0xcc47('0x2e')];_0x1d20bf['order']=qs['sort'](_0x31c637['query'][_0xcc47('0x39')]);_0x1d20bf[_0xcc47('0x3a')]=qs[_0xcc47('0x31')](_[_0xcc47('0x3b')](_0x31c637['query'],_0x1400df[_0xcc47('0x31')]));if(_0x31c637[_0xcc47('0x2f')][_0xcc47('0x3e')]){_0x1d20bf[_0xcc47('0x3a')]=_[_0xcc47('0x3c')](_0x1d20bf[_0xcc47('0x3a')],{'$or':_['map'](_0x1d20bf[_0xcc47('0x33')],function(_0x11f8db){var _0x31397c={};_0x31397c[_0x11f8db]={'$like':'%'+_0x31c637[_0xcc47('0x2f')][_0xcc47('0x3e')]+'%'};return _0x31397c;})});}_0x1d20bf=_[_0xcc47('0x3c')]({},_0x1d20bf,_0x31c637[_0xcc47('0x3f')]);return _0x55d54b['getTags'](_0x1d20bf);}})[_0xcc47('0x25')](function(_0x410ec4){if(_0x410ec4){_0x2e05ce=_0x410ec4[_0xcc47('0x35')];if(!_0x31c637['query'][_0xcc47('0x36')](_0xcc47('0x37'))){_0x1d20bf[_0xcc47('0x1e')]=qs[_0xcc47('0x1e')](_0x31c637[_0xcc47('0x2f')][_0xcc47('0x1e')]);_0x1d20bf[_0xcc47('0x1c')]=qs[_0xcc47('0x1c')](_0x31c637['query']['offset']);}return _0x55d54b['getTags'](_0x1d20bf);}})['then'](function(_0x13f144){if(_0x13f144){return _0x13f144?{'count':_0x2e05ce,'rows':_0x13f144}:null;}})[_0xcc47('0x25')](respondWithResult(_0x41a382,null))[_0xcc47('0x47')](handleError(_0x41a382,null));};exports[_0xcc47('0x52')]=function(_0x8f6d5e,_0x475de0,_0x3fada0){if(_0x8f6d5e[_0xcc47('0x49')]['id']){delete _0x8f6d5e[_0xcc47('0x49')]['id'];}return db[_0xcc47('0x2a')]['findOne']({'where':{'id':_0x8f6d5e[_0xcc47('0x44')]['id']}})[_0xcc47('0x25')](handleEntityNotFound(_0x475de0,null))[_0xcc47('0x25')](function(_0x22a85e){if(_0x22a85e){return _0x22a85e[_0xcc47('0x52')](_0x8f6d5e['body'][_0xcc47('0x53')]||[]);}return null;})['then'](respondWithResult(_0x475de0,null))[_0xcc47('0x47')](handleError(_0x475de0,null));};
\ No newline at end of file
index 8e5718d..c3df2cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf66=['exports','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment'];(function(_0xff7141,_0xc0d716){var _0x535b99=function(_0x2ce2a0){while(--_0x2ce2a0){_0xff7141['push'](_0xff7141['shift']());}};_0x535b99(++_0xc0d716);}(_0xcf66,0x71));var _0x6cf6=function(_0xc59c0e,_0x2d0ea4){_0xc59c0e=_0xc59c0e-0x0;var _0x585a8d=_0xcf66[_0xc59c0e];return _0x585a8d;};'use strict';var _=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var logger=require(_0x6cf6('0x2'))('api');var moment=require(_0x6cf6('0x3'));var BPromise=require(_0x6cf6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6cf6('0x5'));var config=require(_0x6cf6('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x6cf6('0x7')]=function(_0x1fbedd,_0x2a573e){return _0x1fbedd['define'](_0x6cf6('0x8'),attributes,{'tableName':_0x6cf6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x69d3=['../../config/logger','moment','bluebird','rimraf','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x69d3,0xda));var _0x369d=function(_0xf36bb1,_0x309d0b){_0xf36bb1=_0xf36bb1-0x0;var _0x349b1e=_0x69d3[_0xf36bb1];return _0x349b1e;};'use strict';var _=require(_0x369d('0x0'));var util=require(_0x369d('0x1'));var logger=require(_0x369d('0x2'))('api');var moment=require(_0x369d('0x3'));var BPromise=require(_0x369d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x369d('0x5'));var config=require('../../config/environment');var attributes=require('./intZendeskConfiguration.attributes');module[_0x369d('0x6')]=function(_0x2f2a53,_0x18c9f1){return _0x2f2a53[_0x369d('0x7')](_0x369d('0x8'),attributes,{'tableName':_0x369d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c9200c8..f105138 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd35=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x287c5c,_0x481b7d){var _0x140dba=function(_0x4bddf9){while(--_0x4bddf9){_0x287c5c['push'](_0x287c5c['shift']());}};_0x140dba(++_0x481b7d);}(_0xcd35,0xd2));var _0x5cd3=function(_0x18fb56,_0xa04350){_0x18fb56=_0x18fb56-0x0;var _0x4bb81c=_0xcd35[_0x18fb56];return _0x4bb81c;};'use strict';var _=require(_0x5cd3('0x0'));var util=require(_0x5cd3('0x1'));var moment=require(_0x5cd3('0x2'));var BPromise=require(_0x5cd3('0x3'));var rs=require(_0x5cd3('0x4'));var fs=require('fs');var Redis=require(_0x5cd3('0x5'));var db=require(_0x5cd3('0x6'))['db'];var utils=require(_0x5cd3('0x7'));var logger=require(_0x5cd3('0x8'))(_0x5cd3('0x9'));var config=require(_0x5cd3('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x5cd3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d4f94,_0x498cc3,_0x4f732c){return new BPromise(function(_0x4d09ee,_0x553d62){return client['request'](_0x5d4f94,_0x4f732c)[_0x5cd3('0xc')](function(_0x1bb926){logger[_0x5cd3('0xd')](_0x5cd3('0xe'),_0x498cc3,_0x5cd3('0xf'));logger[_0x5cd3('0x10')](_0x5cd3('0x11'),_0x498cc3,_0x5cd3('0xf'),JSON[_0x5cd3('0x12')](_0x1bb926));if(_0x1bb926['error']){if(_0x1bb926['error'][_0x5cd3('0x13')]===0x1f4){logger[_0x5cd3('0x14')]('ZendeskConfiguration,\x20%s,\x20%s',_0x498cc3,_0x1bb926['error'][_0x5cd3('0x15')]);return _0x553d62(_0x1bb926['error']['message']);}logger[_0x5cd3('0x14')]('ZendeskConfiguration,\x20%s,\x20%s',_0x498cc3,_0x1bb926[_0x5cd3('0x14')][_0x5cd3('0x15')]);return _0x4d09ee(_0x1bb926[_0x5cd3('0x14')][_0x5cd3('0x15')]);}else{logger[_0x5cd3('0xd')](_0x5cd3('0xe'),_0x498cc3,_0x5cd3('0xf'));_0x4d09ee(_0x1bb926[_0x5cd3('0x16')]['message']);}})[_0x5cd3('0x17')](function(_0x1ad583){logger[_0x5cd3('0x14')](_0x5cd3('0xe'),_0x498cc3,_0x1ad583);_0x553d62(_0x1ad583);});});}
\ No newline at end of file
+var _0xb964=['debug','stringify','error','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x7b5cdd,_0x8c88d8){var _0x3a29ae=function(_0x17859a){while(--_0x17859a){_0x7b5cdd['push'](_0x7b5cdd['shift']());}};_0x3a29ae(++_0x8c88d8);}(_0xb964,0x95));var _0x4b96=function(_0x12aad8,_0x35ee2b){_0x12aad8=_0x12aad8-0x0;var _0x772e65=_0xb964[_0x12aad8];return _0x772e65;};'use strict';var _=require(_0x4b96('0x0'));var util=require(_0x4b96('0x1'));var moment=require(_0x4b96('0x2'));var BPromise=require(_0x4b96('0x3'));var rs=require(_0x4b96('0x4'));var fs=require('fs');var Redis=require(_0x4b96('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4b96('0x6'));var logger=require('../../config/logger')(_0x4b96('0x7'));var config=require('../../config/environment');var jayson=require(_0x4b96('0x8'));var client=jayson[_0x4b96('0x9')][_0x4b96('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36ab2f,_0x4b5a5a,_0x4c94ec){return new BPromise(function(_0x5ba350,_0x4857e5){return client['request'](_0x36ab2f,_0x4c94ec)['then'](function(_0x24fb52){logger['info'](_0x4b96('0xb'),_0x4b5a5a,_0x4b96('0xc'));logger[_0x4b96('0xd')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x4b5a5a,_0x4b96('0xc'),JSON[_0x4b96('0xe')](_0x24fb52));if(_0x24fb52[_0x4b96('0xf')]){if(_0x24fb52[_0x4b96('0xf')]['code']===0x1f4){logger[_0x4b96('0xf')](_0x4b96('0xb'),_0x4b5a5a,_0x24fb52[_0x4b96('0xf')][_0x4b96('0x10')]);return _0x4857e5(_0x24fb52[_0x4b96('0xf')]['message']);}logger[_0x4b96('0xf')](_0x4b96('0xb'),_0x4b5a5a,_0x24fb52['error'][_0x4b96('0x10')]);return _0x5ba350(_0x24fb52[_0x4b96('0xf')]['message']);}else{logger[_0x4b96('0x11')](_0x4b96('0xb'),_0x4b5a5a,_0x4b96('0xc'));_0x5ba350(_0x24fb52['result'][_0x4b96('0x10')]);}})['catch'](function(_0x4278bd){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x4b5a5a,_0x4278bd);_0x4857e5(_0x4278bd);});});}
\ No newline at end of file
index 12de82c..7b929b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0038=['/:id','post','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated'];(function(_0xfb30a8,_0xe209b7){var _0x494e87=function(_0x23f096){while(--_0x23f096){_0xfb30a8['push'](_0xfb30a8['shift']());}};_0x494e87(++_0xe209b7);}(_0x0038,0x16d));var _0x8003=function(_0x510c02,_0x833acb){_0x510c02=_0x510c02-0x0;var _0x150e7f=_0x0038[_0x510c02];return _0x150e7f;};'use strict';var multer=require(_0x8003('0x0'));var util=require(_0x8003('0x1'));var path=require(_0x8003('0x2'));var timeout=require(_0x8003('0x3'));var express=require(_0x8003('0x4'));var router=express['Router']();var fs_extra=require(_0x8003('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8003('0x6'));var config=require('../../config/environment');var controller=require(_0x8003('0x7'));router[_0x8003('0x8')]('/',auth[_0x8003('0x9')](),controller['index']);router['get'](_0x8003('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x8003('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x8003('0x9')](),controller[_0x8003('0xc')]);router['delete'](_0x8003('0xa'),auth[_0x8003('0x9')](),controller[_0x8003('0xd')]);module[_0x8003('0xe')]=router;
\ No newline at end of file
+var _0x7d40=['/:id','show','post','create','put','delete','destroy','exports','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x19abc7,_0x5aadb6){var _0xc24f10=function(_0x16dd95){while(--_0x16dd95){_0x19abc7['push'](_0x19abc7['shift']());}};_0xc24f10(++_0x5aadb6);}(_0x7d40,0x68));var _0x07d4=function(_0x332316,_0x1033f4){_0x332316=_0x332316-0x0;var _0x2d816a=_0x7d40[_0x332316];return _0x2d816a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x07d4('0x0')]();var fs_extra=require(_0x07d4('0x1'));var auth=require(_0x07d4('0x2'));var interaction=require(_0x07d4('0x3'));var config=require(_0x07d4('0x4'));var controller=require('./intZendeskField.controller');router[_0x07d4('0x5')]('/',auth[_0x07d4('0x6')](),controller[_0x07d4('0x7')]);router[_0x07d4('0x5')](_0x07d4('0x8'),auth[_0x07d4('0x6')](),controller[_0x07d4('0x9')]);router[_0x07d4('0xa')]('/',auth[_0x07d4('0x6')](),controller[_0x07d4('0xb')]);router[_0x07d4('0xc')]('/:id',auth[_0x07d4('0x6')](),controller['update']);router[_0x07d4('0xd')](_0x07d4('0x8'),auth[_0x07d4('0x6')](),controller[_0x07d4('0xe')]);module[_0x07d4('0xf')]=router;
\ No newline at end of file
index 7e69f1b..9a09175 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5740=['picklist','STRING','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x2bc1fe,_0x45da98){var _0x1a47a5=function(_0x2e5053){while(--_0x2e5053){_0x2bc1fe['push'](_0x2bc1fe['shift']());}};_0x1a47a5(++_0x45da98);}(_0x5740,0x1c2));var _0x0574=function(_0x2aefac,_0x162095){_0x2aefac=_0x2aefac-0x0;var _0xdcb8dd=_0x5740[_0x2aefac];return _0xdcb8dd;};'use strict';var Sequelize=require('sequelize');module[_0x0574('0x0')]={'type':{'type':Sequelize[_0x0574('0x1')](_0x0574('0x2'),_0x0574('0x3'),_0x0574('0x4'),_0x0574('0x5'),_0x0574('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0574('0x7')]},'key':{'type':Sequelize[_0x0574('0x7')]},'keyType':{'type':Sequelize[_0x0574('0x1')](_0x0574('0x2'),'variable',_0x0574('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0574('0x7')]},'nameField':{'type':Sequelize[_0x0574('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0574('0x7')]}};
\ No newline at end of file
+var _0x614f=['keyValue','string','STRING','customVariable','sequelize','exports','ENUM','variable'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x614f,0x8c));var _0xf614=function(_0x423e98,_0x2398fd){_0x423e98=_0x423e98-0x0;var _0x20350b=_0x614f[_0x423e98];return _0x20350b;};'use strict';var Sequelize=require(_0xf614('0x0'));module[_0xf614('0x1')]={'type':{'type':Sequelize[_0xf614('0x2')]('string',_0xf614('0x3'),'customVariable',_0xf614('0x4'),'picklist'),'defaultValue':_0xf614('0x5')},'content':{'type':Sequelize[_0xf614('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf614('0x2')](_0xf614('0x5'),_0xf614('0x3'),_0xf614('0x7'))},'keyContent':{'type':Sequelize[_0xf614('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf614('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf614('0x6')]}};
\ No newline at end of file
index 5dccf62..f510c5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc072=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','params','ZendeskField','create','body','find','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xc072,0x14e));var _0x2c07=function(_0x3ad067,_0x29421e){_0x3ad067=_0x3ad067-0x0;var _0x2e112f=_0xc072[_0x3ad067];return _0x2e112f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2c07('0x0'));var jsonpatch=require(_0x2c07('0x1'));var rp=require(_0x2c07('0x2'));var moment=require('moment');var BPromise=require(_0x2c07('0x3'));var Mustache=require(_0x2c07('0x4'));var util=require('util');var path=require(_0x2c07('0x5'));var sox=require(_0x2c07('0x6'));var csv=require(_0x2c07('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c07('0x8'));var _=require('lodash');var squel=require(_0x2c07('0x9'));var crypto=require(_0x2c07('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2c07('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2c07('0xc'));var Papa=require(_0x2c07('0xd'));var Redis=require(_0x2c07('0xe'));var authService=require(_0x2c07('0xf'));var qs=require(_0x2c07('0x10'));var as=require(_0x2c07('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c07('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2c07('0x13'));var db=require(_0x2c07('0x14'))['db'];function respondWithStatusCode(_0x559ae7,_0x3a87a4){_0x3a87a4=_0x3a87a4||0xcc;return function(_0x2a9a8a){if(_0x2a9a8a){return _0x559ae7['sendStatus'](_0x3a87a4);}return _0x559ae7['status'](_0x3a87a4)['end']();};}function respondWithResult(_0xe6e9d,_0x48b5ca){_0x48b5ca=_0x48b5ca||0xc8;return function(_0x1f323e){if(_0x1f323e){return _0xe6e9d[_0x2c07('0x15')](_0x48b5ca)[_0x2c07('0x16')](_0x1f323e);}};}function respondWithFilteredResult(_0x3acb2a,_0x183cb4){return function(_0x146d74){if(_0x146d74){var _0xd6b472=typeof _0x183cb4[_0x2c07('0x17')]===_0x2c07('0x18')&&typeof _0x183cb4[_0x2c07('0x19')]===_0x2c07('0x18');var _0x2327e2=_0x146d74[_0x2c07('0x1a')];var _0x1de11c=_0xd6b472?0x0:_0x183cb4[_0x2c07('0x17')];var _0x59f9c3=_0xd6b472?_0x146d74[_0x2c07('0x1a')]:_0x183cb4[_0x2c07('0x17')]+_0x183cb4[_0x2c07('0x19')];var _0x39e598;if(_0x59f9c3>=_0x2327e2){_0x59f9c3=_0x2327e2;_0x39e598=0xc8;}else{_0x39e598=0xce;}_0x3acb2a[_0x2c07('0x15')](_0x39e598);return _0x3acb2a[_0x2c07('0x1b')](_0x2c07('0x1c'),_0x1de11c+'-'+_0x59f9c3+'/'+_0x2327e2)[_0x2c07('0x16')](_0x146d74);}return null;};}function patchUpdates(_0xe01103){return function(_0x1b2264){try{jsonpatch[_0x2c07('0x1d')](_0x1b2264,_0xe01103,!![]);}catch(_0x1f7db1){return BPromise[_0x2c07('0x1e')](_0x1f7db1);}return _0x1b2264[_0x2c07('0x1f')]();};}function saveUpdates(_0x6f5d6d,_0xa9159e){return function(_0x529307){if(_0x529307){return _0x529307[_0x2c07('0x20')](_0x6f5d6d)[_0x2c07('0x21')](function(_0x24409c){return _0x24409c;});}return null;};}function removeEntity(_0x5e77ca,_0x587188){return function(_0x57e0bc){if(_0x57e0bc){return _0x57e0bc[_0x2c07('0x22')]()[_0x2c07('0x21')](function(){_0x5e77ca[_0x2c07('0x15')](0xcc)[_0x2c07('0x23')]();});}};}function handleEntityNotFound(_0x4537c7,_0x4738c4){return function(_0x376a6e){if(!_0x376a6e){_0x4537c7[_0x2c07('0x24')](0x194);}return _0x376a6e;};}function handleError(_0x184863,_0x53460a){_0x53460a=_0x53460a||0x1f4;return function(_0x1d2f77){logger[_0x2c07('0x25')](_0x1d2f77['stack']);if(_0x1d2f77[_0x2c07('0x26')]){delete _0x1d2f77[_0x2c07('0x26')];}_0x184863[_0x2c07('0x15')](_0x53460a)['send'](_0x1d2f77);};}exports[_0x2c07('0x27')]=function(_0x11cb39,_0x2abd24){var _0x2507cc={},_0x403e51={},_0x3e9328={'count':0x0,'rows':[]};var _0x527878=_[_0x2c07('0x28')](db['ZendeskField'][_0x2c07('0x29')],function(_0xbcdbe3){return{'name':_0xbcdbe3[_0x2c07('0x2a')],'type':_0xbcdbe3[_0x2c07('0x2b')][_0x2c07('0x2c')]};});_0x403e51['model']=_[_0x2c07('0x28')](_0x527878,_0x2c07('0x26'));_0x403e51[_0x2c07('0x2d')]=_[_0x2c07('0x2e')](_0x11cb39[_0x2c07('0x2d')]);_0x403e51[_0x2c07('0x2f')]=_['intersection'](_0x403e51[_0x2c07('0x30')],_0x403e51['query']);_0x2507cc[_0x2c07('0x31')]=_['intersection'](_0x403e51['model'],qs[_0x2c07('0x32')](_0x11cb39[_0x2c07('0x2d')][_0x2c07('0x32')]));_0x2507cc[_0x2c07('0x31')]=_0x2507cc[_0x2c07('0x31')][_0x2c07('0x33')]?_0x2507cc[_0x2c07('0x31')]:_0x403e51['model'];if(!_0x11cb39['query'][_0x2c07('0x34')](_0x2c07('0x35'))){_0x2507cc[_0x2c07('0x19')]=qs[_0x2c07('0x19')](_0x11cb39['query'][_0x2c07('0x19')]);_0x2507cc[_0x2c07('0x17')]=qs[_0x2c07('0x17')](_0x11cb39['query'][_0x2c07('0x17')]);}_0x2507cc[_0x2c07('0x36')]=qs['sort'](_0x11cb39['query'][_0x2c07('0x37')]);_0x2507cc[_0x2c07('0x38')]=qs[_0x2c07('0x2f')](_[_0x2c07('0x39')](_0x11cb39[_0x2c07('0x2d')],_0x403e51[_0x2c07('0x2f')]),_0x527878);if(_0x11cb39['query'][_0x2c07('0x3a')]){_0x2507cc[_0x2c07('0x38')]=_['merge'](_0x2507cc[_0x2c07('0x38')],{'$or':_[_0x2c07('0x28')](_0x527878,function(_0x4b1d61){if(_0x4b1d61[_0x2c07('0x2b')]!=='VIRTUAL'){var _0x592d2a={};_0x592d2a[_0x4b1d61[_0x2c07('0x26')]]={'$like':'%'+_0x11cb39[_0x2c07('0x2d')]['filter']+'%'};return _0x592d2a;}})});}_0x2507cc=_[_0x2c07('0x3b')]({},_0x2507cc,_0x11cb39[_0x2c07('0x3c')]);var _0x2e7f27={'where':_0x2507cc[_0x2c07('0x38')]};return db['ZendeskField'][_0x2c07('0x1a')](_0x2e7f27)[_0x2c07('0x21')](function(_0xac217d){_0x3e9328[_0x2c07('0x1a')]=_0xac217d;if(_0x11cb39[_0x2c07('0x2d')][_0x2c07('0x3d')]){_0x2507cc['include']=[{'all':!![]}];}return db['ZendeskField'][_0x2c07('0x3e')](_0x2507cc);})[_0x2c07('0x21')](function(_0x372b52){_0x3e9328['rows']=_0x372b52;return _0x3e9328;})[_0x2c07('0x21')](respondWithFilteredResult(_0x2abd24,_0x2507cc))[_0x2c07('0x3f')](handleError(_0x2abd24,null));};exports['show']=function(_0x28fb75,_0x26e312){var _0x27a178={'raw':!![],'where':{'id':_0x28fb75[_0x2c07('0x40')]['id']}},_0x1d5c61={};_0x1d5c61[_0x2c07('0x30')]=_[_0x2c07('0x2e')](db[_0x2c07('0x41')][_0x2c07('0x29')]);_0x1d5c61[_0x2c07('0x2d')]=_[_0x2c07('0x2e')](_0x28fb75['query']);_0x1d5c61[_0x2c07('0x2f')]=_['intersection'](_0x1d5c61[_0x2c07('0x30')],_0x1d5c61[_0x2c07('0x2d')]);_0x27a178[_0x2c07('0x31')]=_['intersection'](_0x1d5c61[_0x2c07('0x30')],qs[_0x2c07('0x32')](_0x28fb75[_0x2c07('0x2d')][_0x2c07('0x32')]));_0x27a178['attributes']=_0x27a178[_0x2c07('0x31')][_0x2c07('0x33')]?_0x27a178[_0x2c07('0x31')]:_0x1d5c61['model'];if(_0x28fb75[_0x2c07('0x2d')][_0x2c07('0x3d')]){_0x27a178['include']=[{'all':!![]}];}_0x27a178=_[_0x2c07('0x3b')]({},_0x27a178,_0x28fb75[_0x2c07('0x3c')]);return db[_0x2c07('0x41')]['find'](_0x27a178)[_0x2c07('0x21')](handleEntityNotFound(_0x26e312,null))['then'](respondWithResult(_0x26e312,null))[_0x2c07('0x3f')](handleError(_0x26e312,null));};exports[_0x2c07('0x42')]=function(_0x5bd2ba,_0x11841b){return db[_0x2c07('0x41')][_0x2c07('0x42')](_0x5bd2ba[_0x2c07('0x43')],{})['then'](respondWithResult(_0x11841b,0xc9))[_0x2c07('0x3f')](handleError(_0x11841b,null));};exports['update']=function(_0x168d45,_0x353e8f){if(_0x168d45[_0x2c07('0x43')]['id']){delete _0x168d45['body']['id'];}return db[_0x2c07('0x41')]['find']({'where':{'id':_0x168d45[_0x2c07('0x40')]['id']}})[_0x2c07('0x21')](handleEntityNotFound(_0x353e8f,null))[_0x2c07('0x21')](saveUpdates(_0x168d45['body'],null))[_0x2c07('0x21')](respondWithResult(_0x353e8f,null))[_0x2c07('0x3f')](handleError(_0x353e8f,null));};exports[_0x2c07('0x22')]=function(_0x2734be,_0x8d8515){return db[_0x2c07('0x41')][_0x2c07('0x44')]({'where':{'id':_0x2734be['params']['id']}})[_0x2c07('0x21')](handleEntityNotFound(_0x8d8515,null))[_0x2c07('0x21')](removeEntity(_0x8d8515,null))[_0x2c07('0x3f')](handleError(_0x8d8515,null));};
\ No newline at end of file
+var _0x3533=['sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','apply','save','update','then','destroy','sendStatus','error','name','send','index','ZendeskField','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path'];(function(_0x31ef68,_0x324ee6){var _0x329816=function(_0x2be530){while(--_0x2be530){_0x31ef68['push'](_0x31ef68['shift']());}};_0x329816(++_0x324ee6);}(_0x3533,0x198));var _0x3353=function(_0x5b6e09,_0x14af8d){_0x5b6e09=_0x5b6e09-0x0;var _0x35b55d=_0x3533[_0x5b6e09];return _0x35b55d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3353('0x0'));var zipdir=require(_0x3353('0x1'));var jsonpatch=require(_0x3353('0x2'));var rp=require(_0x3353('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3353('0x4'));var util=require('util');var path=require(_0x3353('0x5'));var sox=require(_0x3353('0x6'));var csv=require(_0x3353('0x7'));var ejs=require(_0x3353('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3353('0x9'));var crypto=require(_0x3353('0xa'));var jsforce=require(_0x3353('0xb'));var deskjs=require(_0x3353('0xc'));var toCsv=require(_0x3353('0x7'));var querystring=require('querystring');var Papa=require(_0x3353('0xd'));var Redis=require(_0x3353('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3353('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3353('0x10'))('api');var utils=require(_0x3353('0x11'));var config=require(_0x3353('0x12'));var licenseUtil=require(_0x3353('0x13'));var db=require(_0x3353('0x14'))['db'];function respondWithStatusCode(_0x2f27d6,_0x3f36a5){_0x3f36a5=_0x3f36a5||0xcc;return function(_0x2dfc9d){if(_0x2dfc9d){return _0x2f27d6['sendStatus'](_0x3f36a5);}return _0x2f27d6[_0x3353('0x15')](_0x3f36a5)[_0x3353('0x16')]();};}function respondWithResult(_0x357b85,_0x5acb35){_0x5acb35=_0x5acb35||0xc8;return function(_0x192e70){if(_0x192e70){return _0x357b85['status'](_0x5acb35)[_0x3353('0x17')](_0x192e70);}};}function respondWithFilteredResult(_0x4afd56,_0x57d931){return function(_0x252b7b){if(_0x252b7b){var _0x520543=typeof _0x57d931[_0x3353('0x18')]==='undefined'&&typeof _0x57d931[_0x3353('0x19')]===_0x3353('0x1a');var _0x2f2420=_0x252b7b[_0x3353('0x1b')];var _0x521d0d=_0x520543?0x0:_0x57d931[_0x3353('0x18')];var _0x5ee265=_0x520543?_0x252b7b['count']:_0x57d931[_0x3353('0x18')]+_0x57d931[_0x3353('0x19')];var _0x160e55;if(_0x5ee265>=_0x2f2420){_0x5ee265=_0x2f2420;_0x160e55=0xc8;}else{_0x160e55=0xce;}_0x4afd56[_0x3353('0x15')](_0x160e55);return _0x4afd56['set']('Content-Range',_0x521d0d+'-'+_0x5ee265+'/'+_0x2f2420)[_0x3353('0x17')](_0x252b7b);}return null;};}function patchUpdates(_0x18c717){return function(_0x1b738d){try{jsonpatch[_0x3353('0x1c')](_0x1b738d,_0x18c717,!![]);}catch(_0x444e52){return BPromise['reject'](_0x444e52);}return _0x1b738d[_0x3353('0x1d')]();};}function saveUpdates(_0x3d61ec,_0x496d52){return function(_0x3a2324){if(_0x3a2324){return _0x3a2324[_0x3353('0x1e')](_0x3d61ec)[_0x3353('0x1f')](function(_0x33aac0){return _0x33aac0;});}return null;};}function removeEntity(_0x326626,_0x72e543){return function(_0x3d611d){if(_0x3d611d){return _0x3d611d[_0x3353('0x20')]()[_0x3353('0x1f')](function(){_0x326626[_0x3353('0x15')](0xcc)[_0x3353('0x16')]();});}};}function handleEntityNotFound(_0x417aa7,_0x501936){return function(_0x1ff0ef){if(!_0x1ff0ef){_0x417aa7[_0x3353('0x21')](0x194);}return _0x1ff0ef;};}function handleError(_0x5271c5,_0x544af2){_0x544af2=_0x544af2||0x1f4;return function(_0x416d6d){logger[_0x3353('0x22')](_0x416d6d['stack']);if(_0x416d6d['name']){delete _0x416d6d[_0x3353('0x23')];}_0x5271c5['status'](_0x544af2)[_0x3353('0x24')](_0x416d6d);};}exports[_0x3353('0x25')]=function(_0x5032cd,_0x435f4f){var _0x1bc401={},_0x54e812={},_0x382f1d={'count':0x0,'rows':[]};var _0x43dacc=_['map'](db[_0x3353('0x26')]['rawAttributes'],function(_0x53be52){return{'name':_0x53be52[_0x3353('0x27')],'type':_0x53be52[_0x3353('0x28')][_0x3353('0x29')]};});_0x54e812['model']=_[_0x3353('0x2a')](_0x43dacc,_0x3353('0x23'));_0x54e812[_0x3353('0x2b')]=_[_0x3353('0x2c')](_0x5032cd[_0x3353('0x2b')]);_0x54e812[_0x3353('0x2d')]=_[_0x3353('0x2e')](_0x54e812[_0x3353('0x2f')],_0x54e812['query']);_0x1bc401['attributes']=_[_0x3353('0x2e')](_0x54e812[_0x3353('0x2f')],qs[_0x3353('0x30')](_0x5032cd[_0x3353('0x2b')][_0x3353('0x30')]));_0x1bc401[_0x3353('0x31')]=_0x1bc401[_0x3353('0x31')][_0x3353('0x32')]?_0x1bc401[_0x3353('0x31')]:_0x54e812['model'];if(!_0x5032cd[_0x3353('0x2b')]['hasOwnProperty'](_0x3353('0x33'))){_0x1bc401[_0x3353('0x19')]=qs[_0x3353('0x19')](_0x5032cd[_0x3353('0x2b')][_0x3353('0x19')]);_0x1bc401[_0x3353('0x18')]=qs[_0x3353('0x18')](_0x5032cd[_0x3353('0x2b')][_0x3353('0x18')]);}_0x1bc401[_0x3353('0x34')]=qs[_0x3353('0x35')](_0x5032cd[_0x3353('0x2b')]['sort']);_0x1bc401['where']=qs[_0x3353('0x2d')](_[_0x3353('0x36')](_0x5032cd[_0x3353('0x2b')],_0x54e812[_0x3353('0x2d')]),_0x43dacc);if(_0x5032cd[_0x3353('0x2b')][_0x3353('0x37')]){_0x1bc401[_0x3353('0x38')]=_[_0x3353('0x39')](_0x1bc401[_0x3353('0x38')],{'$or':_[_0x3353('0x2a')](_0x43dacc,function(_0x12ea03){if(_0x12ea03[_0x3353('0x28')]!==_0x3353('0x3a')){var _0x481b66={};_0x481b66[_0x12ea03['name']]={'$like':'%'+_0x5032cd[_0x3353('0x2b')][_0x3353('0x37')]+'%'};return _0x481b66;}})});}_0x1bc401=_[_0x3353('0x39')]({},_0x1bc401,_0x5032cd['options']);var _0x38401b={'where':_0x1bc401[_0x3353('0x38')]};return db[_0x3353('0x26')][_0x3353('0x1b')](_0x38401b)[_0x3353('0x1f')](function(_0x3958a1){_0x382f1d[_0x3353('0x1b')]=_0x3958a1;if(_0x5032cd[_0x3353('0x2b')]['includeAll']){_0x1bc401[_0x3353('0x3b')]=[{'all':!![]}];}return db['ZendeskField'][_0x3353('0x3c')](_0x1bc401);})[_0x3353('0x1f')](function(_0x1f4e27){_0x382f1d['rows']=_0x1f4e27;return _0x382f1d;})[_0x3353('0x1f')](respondWithFilteredResult(_0x435f4f,_0x1bc401))[_0x3353('0x3d')](handleError(_0x435f4f,null));};exports[_0x3353('0x3e')]=function(_0x18e9bb,_0x393a7d){var _0x2728ea={'raw':!![],'where':{'id':_0x18e9bb[_0x3353('0x3f')]['id']}},_0x1a6633={};_0x1a6633[_0x3353('0x2f')]=_[_0x3353('0x2c')](db[_0x3353('0x26')][_0x3353('0x40')]);_0x1a6633[_0x3353('0x2b')]=_[_0x3353('0x2c')](_0x18e9bb['query']);_0x1a6633['filters']=_['intersection'](_0x1a6633[_0x3353('0x2f')],_0x1a6633['query']);_0x2728ea[_0x3353('0x31')]=_[_0x3353('0x2e')](_0x1a6633['model'],qs['fields'](_0x18e9bb[_0x3353('0x2b')][_0x3353('0x30')]));_0x2728ea[_0x3353('0x31')]=_0x2728ea['attributes']['length']?_0x2728ea[_0x3353('0x31')]:_0x1a6633[_0x3353('0x2f')];if(_0x18e9bb[_0x3353('0x2b')][_0x3353('0x41')]){_0x2728ea['include']=[{'all':!![]}];}_0x2728ea=_[_0x3353('0x39')]({},_0x2728ea,_0x18e9bb['options']);return db['ZendeskField'][_0x3353('0x42')](_0x2728ea)['then'](handleEntityNotFound(_0x393a7d,null))['then'](respondWithResult(_0x393a7d,null))[_0x3353('0x3d')](handleError(_0x393a7d,null));};exports[_0x3353('0x43')]=function(_0x36062a,_0x346a7e){return db[_0x3353('0x26')][_0x3353('0x43')](_0x36062a['body'],{})[_0x3353('0x1f')](respondWithResult(_0x346a7e,0xc9))[_0x3353('0x3d')](handleError(_0x346a7e,null));};exports[_0x3353('0x1e')]=function(_0xa8e492,_0x3bfc4b){if(_0xa8e492[_0x3353('0x44')]['id']){delete _0xa8e492[_0x3353('0x44')]['id'];}return db[_0x3353('0x26')][_0x3353('0x42')]({'where':{'id':_0xa8e492[_0x3353('0x3f')]['id']}})[_0x3353('0x1f')](handleEntityNotFound(_0x3bfc4b,null))[_0x3353('0x1f')](saveUpdates(_0xa8e492[_0x3353('0x44')],null))[_0x3353('0x1f')](respondWithResult(_0x3bfc4b,null))[_0x3353('0x3d')](handleError(_0x3bfc4b,null));};exports['destroy']=function(_0x1a8660,_0x107ed2){return db[_0x3353('0x26')][_0x3353('0x42')]({'where':{'id':_0x1a8660['params']['id']}})[_0x3353('0x1f')](handleEntityNotFound(_0x107ed2,null))[_0x3353('0x1f')](removeEntity(_0x107ed2,null))['catch'](handleError(_0x107ed2,null));};
\ No newline at end of file
index 4be75d5..ac9987e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9571=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','lodash'];(function(_0x543a05,_0xd480a7){var _0x47d17e=function(_0x2a1853){while(--_0x2a1853){_0x543a05['push'](_0x543a05['shift']());}};_0x47d17e(++_0xd480a7);}(_0x9571,0x1bf));var _0x1957=function(_0x35f5a5,_0x3f8a65){_0x35f5a5=_0x35f5a5-0x0;var _0x143dce=_0x9571[_0x35f5a5];return _0x143dce;};'use strict';var _=require(_0x1957('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1957('0x1'));var BPromise=require(_0x1957('0x2'));var rp=require(_0x1957('0x3'));var fs=require('fs');var path=require(_0x1957('0x4'));var rimraf=require(_0x1957('0x5'));var config=require(_0x1957('0x6'));var attributes=require(_0x1957('0x7'));module[_0x1957('0x8')]=function(_0x431be2,_0x5a0619){return _0x431be2[_0x1957('0x9')](_0x1957('0xa'),attributes,{'tableName':_0x1957('0xb'),'paranoid':![],'indexes':[{'name':_0x1957('0xc'),'fields':['idField',_0x1957('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1334=['moment','request-promise','rimraf','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','lodash','util','../../config/logger'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1334,0x1eb));var _0x4133=function(_0x3df871,_0xda2e11){_0x3df871=_0x3df871-0x0;var _0x570f7b=_0x1334[_0x3df871];return _0x570f7b;};'use strict';var _=require(_0x4133('0x0'));var util=require(_0x4133('0x1'));var logger=require(_0x4133('0x2'))('api');var moment=require(_0x4133('0x3'));var BPromise=require('bluebird');var rp=require(_0x4133('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4133('0x5'));var config=require('../../config/environment');var attributes=require(_0x4133('0x6'));module[_0x4133('0x7')]=function(_0x73ef78,_0x38201b){return _0x73ef78[_0x4133('0x8')](_0x4133('0x9'),attributes,{'tableName':_0x4133('0xa'),'paranoid':![],'indexes':[{'name':_0x4133('0xb'),'fields':[_0x4133('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 50c593d..3cddf65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6eb=['rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/logger'];(function(_0x28d7b5,_0x1305a4){var _0x1ed035=function(_0x57e1f6){while(--_0x57e1f6){_0x28d7b5['push'](_0x28d7b5['shift']());}};_0x1ed035(++_0x1305a4);}(_0xc6eb,0x125));var _0xbc6e=function(_0x14e2dc,_0x5f3535){_0x14e2dc=_0x14e2dc-0x0;var _0x1843c3=_0xc6eb[_0x14e2dc];return _0x1843c3;};'use strict';var _=require(_0xbc6e('0x0'));var util=require(_0xbc6e('0x1'));var moment=require(_0xbc6e('0x2'));var BPromise=require('bluebird');var rs=require(_0xbc6e('0x3'));var fs=require('fs');var Redis=require(_0xbc6e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbc6e('0x5'))(_0xbc6e('0x6'));var config=require(_0xbc6e('0x7'));var jayson=require(_0xbc6e('0x8'));var client=jayson['client'][_0xbc6e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x504a57,_0x3e103e,_0x196dea){return new BPromise(function(_0x418de2,_0x569416){return client[_0xbc6e('0xa')](_0x504a57,_0x196dea)[_0xbc6e('0xb')](function(_0x5d65c7){logger[_0xbc6e('0xc')]('ZendeskField,\x20%s,\x20%s',_0x3e103e,_0xbc6e('0xd'));logger[_0xbc6e('0xe')](_0xbc6e('0xf'),_0x3e103e,'request\x20sent',JSON[_0xbc6e('0x10')](_0x5d65c7));if(_0x5d65c7[_0xbc6e('0x11')]){if(_0x5d65c7[_0xbc6e('0x11')][_0xbc6e('0x12')]===0x1f4){logger[_0xbc6e('0x11')](_0xbc6e('0x13'),_0x3e103e,_0x5d65c7[_0xbc6e('0x11')][_0xbc6e('0x14')]);return _0x569416(_0x5d65c7[_0xbc6e('0x11')][_0xbc6e('0x14')]);}logger[_0xbc6e('0x11')](_0xbc6e('0x13'),_0x3e103e,_0x5d65c7[_0xbc6e('0x11')][_0xbc6e('0x14')]);return _0x418de2(_0x5d65c7[_0xbc6e('0x11')]['message']);}else{logger['info'](_0xbc6e('0x13'),_0x3e103e,_0xbc6e('0xd'));_0x418de2(_0x5d65c7[_0xbc6e('0x15')][_0xbc6e('0x14')]);}})[_0xbc6e('0x16')](function(_0x1b1880){logger[_0xbc6e('0x11')](_0xbc6e('0x13'),_0x3e103e,_0x1b1880);_0x569416(_0x1b1880);});});}
\ No newline at end of file
+var _0x1cf8=['code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x1691e2,_0x1d56c7){var _0x8b32ec=function(_0x26292c){while(--_0x26292c){_0x1691e2['push'](_0x1691e2['shift']());}};_0x8b32ec(++_0x1d56c7);}(_0x1cf8,0xd2));var _0x81cf=function(_0x56f151,_0x281759){_0x56f151=_0x56f151-0x0;var _0x52c1e3=_0x1cf8[_0x56f151];return _0x52c1e3;};'use strict';var _=require(_0x81cf('0x0'));var util=require(_0x81cf('0x1'));var moment=require(_0x81cf('0x2'));var BPromise=require(_0x81cf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x81cf('0x4'));var db=require(_0x81cf('0x5'))['db'];var utils=require(_0x81cf('0x6'));var logger=require(_0x81cf('0x7'))(_0x81cf('0x8'));var config=require(_0x81cf('0x9'));var jayson=require(_0x81cf('0xa'));var client=jayson[_0x81cf('0xb')][_0x81cf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x39289c,_0x117726,_0x141c47){return new BPromise(function(_0x16b954,_0x1356fe){return client[_0x81cf('0xd')](_0x39289c,_0x141c47)['then'](function(_0x1ec3b9){logger[_0x81cf('0xe')](_0x81cf('0xf'),_0x117726,'request\x20sent');logger[_0x81cf('0x10')](_0x81cf('0x11'),_0x117726,_0x81cf('0x12'),JSON['stringify'](_0x1ec3b9));if(_0x1ec3b9[_0x81cf('0x13')]){if(_0x1ec3b9[_0x81cf('0x13')][_0x81cf('0x14')]===0x1f4){logger[_0x81cf('0x13')](_0x81cf('0xf'),_0x117726,_0x1ec3b9['error'][_0x81cf('0x15')]);return _0x1356fe(_0x1ec3b9[_0x81cf('0x13')]['message']);}logger[_0x81cf('0x13')]('ZendeskField,\x20%s,\x20%s',_0x117726,_0x1ec3b9['error'][_0x81cf('0x15')]);return _0x16b954(_0x1ec3b9[_0x81cf('0x13')]['message']);}else{logger[_0x81cf('0xe')]('ZendeskField,\x20%s,\x20%s',_0x117726,_0x81cf('0x12'));_0x16b954(_0x1ec3b9[_0x81cf('0x16')][_0x81cf('0x15')]);}})['catch'](function(_0x22e71d){logger[_0x81cf('0x13')]('ZendeskField,\x20%s,\x20%s',_0x117726,_0x22e71d);_0x1356fe(_0x22e71d);});});}
\ No newline at end of file
index 180c661..cf903cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6666=['multer','util','path','connect-timeout','fs-extra','../../components/auth/service','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','put','update','delete'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x6666,0x10a));var _0x6666=function(_0x3a2e49,_0x21ebea){_0x3a2e49=_0x3a2e49-0x0;var _0x257140=_0x6666[_0x3a2e49];return _0x257140;};'use strict';var multer=require(_0x6666('0x0'));var util=require(_0x6666('0x1'));var path=require(_0x6666('0x2'));var timeout=require(_0x6666('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6666('0x4'));var auth=require(_0x6666('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0x6666('0x6')]('/',auth[_0x6666('0x7')](),controller['index']);router['get'](_0x6666('0x8'),auth[_0x6666('0x7')](),controller[_0x6666('0x9')]);router['get'](_0x6666('0xa'),auth['isAuthenticated'](),controller[_0x6666('0xb')]);router[_0x6666('0x6')](_0x6666('0xc'),auth[_0x6666('0x7')](),controller['getFields']);router['post']('/',auth[_0x6666('0x7')](),controller[_0x6666('0xd')]);router[_0x6666('0xe')](_0x6666('0xa'),auth[_0x6666('0x7')](),controller[_0x6666('0xf')]);router[_0x6666('0x10')](_0x6666('0x8'),auth[_0x6666('0x7')](),controller[_0x6666('0x11')]);router[_0x6666('0x12')]('/:id',auth[_0x6666('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x4512=['/:id','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','post','addConfiguration','put','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get'];(function(_0x545fe3,_0x3b191f){var _0x480702=function(_0x21c970){while(--_0x21c970){_0x545fe3['push'](_0x545fe3['shift']());}};_0x480702(++_0x3b191f);}(_0x4512,0xa2));var _0x2451=function(_0x471448,_0x1c0e9e){_0x471448=_0x471448-0x0;var _0x38190b=_0x4512[_0x471448];return _0x38190b;};'use strict';var multer=require('multer');var util=require(_0x2451('0x0'));var path=require(_0x2451('0x1'));var timeout=require('connect-timeout');var express=require(_0x2451('0x2'));var router=express['Router']();var fs_extra=require(_0x2451('0x3'));var auth=require(_0x2451('0x4'));var interaction=require(_0x2451('0x5'));var config=require(_0x2451('0x6'));var controller=require(_0x2451('0x7'));router[_0x2451('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2451('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0x2451('0xa'),auth[_0x2451('0xb')](),controller[_0x2451('0xc')]);router[_0x2451('0x8')](_0x2451('0xd'),auth[_0x2451('0xb')](),controller['getFields']);router[_0x2451('0xe')]('/',auth[_0x2451('0xb')](),controller['create']);router['post'](_0x2451('0xa'),auth[_0x2451('0xb')](),controller[_0x2451('0xf')]);router[_0x2451('0x10')](_0x2451('0x9'),auth[_0x2451('0xb')](),controller['update']);router['delete']('/:id',auth[_0x2451('0xb')](),controller[_0x2451('0x11')]);module[_0x2451('0x12')]=router;
\ No newline at end of file
index 030335f..145ac23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['exports','STRING'];(function(_0x218625,_0x4d3f3a){var _0x3da6c1=function(_0x11b281){while(--_0x11b281){_0x218625['push'](_0x218625['shift']());}};_0x3da6c1(++_0x4d3f3a);}(_0xedd9,0xfc));var _0x9edd=function(_0x163b80,_0x5e63e5){_0x163b80=_0x163b80-0x0;var _0x10d631=_0xedd9[_0x163b80];return _0x10d631;};'use strict';var Sequelize=require('sequelize');module[_0x9edd('0x0')]={'name':{'type':Sequelize[_0x9edd('0x1')]},'description':{'type':Sequelize[_0x9edd('0x1')]},'host':{'type':Sequelize[_0x9edd('0x1')]},'zone':{'type':Sequelize[_0x9edd('0x1')]},'clientId':{'type':Sequelize[_0x9edd('0x1')]},'clientSecret':{'type':Sequelize[_0x9edd('0x1')]},'serverUrl':{'type':Sequelize[_0x9edd('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x9edd('0x1')]}};
\ No newline at end of file
+var _0x153f=['exports','STRING','sequelize'];(function(_0x2cc711,_0x300328){var _0x31a52e=function(_0x588378){while(--_0x588378){_0x2cc711['push'](_0x2cc711['shift']());}};_0x31a52e(++_0x300328);}(_0x153f,0x15b));var _0xf153=function(_0x801551,_0x40cd62){_0x801551=_0x801551-0x0;var _0x1a2218=_0x153f[_0x801551];return _0x1a2218;};'use strict';var Sequelize=require(_0xf153('0x0'));module[_0xf153('0x1')]={'name':{'type':Sequelize[_0xf153('0x2')]},'description':{'type':Sequelize[_0xf153('0x2')]},'host':{'type':Sequelize[_0xf153('0x2')]},'zone':{'type':Sequelize[_0xf153('0x2')]},'clientId':{'type':Sequelize[_0xf153('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xf153('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xf153('0x2')]}};
\ No newline at end of file
index e7731fb..315fa1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e82=['error','stack','name','send','index','ZohoAccount','rawAttributes','fieldName','model','map','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','include','then','rows','show','params','intersection','includeAll','catch','create','body','find','getConfigurations','options','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','clientSecret','serverUrl','code','host','zoho.eu','com','slice','substring','lastIndexOf','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','display_label','data_type','picklist','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','limit','count','set','json','apply','save','update','destroy'];(function(_0x5afe08,_0x50d834){var _0x11107e=function(_0x12c77a){while(--_0x12c77a){_0x5afe08['push'](_0x5afe08['shift']());}};_0x11107e(++_0x50d834);}(_0x9e82,0x1e7));var _0x29e8=function(_0x1b75b4,_0x5841b7){_0x1b75b4=_0x1b75b4-0x0;var _0x437b5e=_0x9e82[_0x1b75b4];return _0x437b5e;};'use strict';var emlformat=require(_0x29e8('0x0'));var rimraf=require(_0x29e8('0x1'));var zipdir=require(_0x29e8('0x2'));var jsonpatch=require(_0x29e8('0x3'));var rp=require(_0x29e8('0x4'));var moment=require(_0x29e8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x29e8('0x6'));var util=require(_0x29e8('0x7'));var path=require('path');var sox=require(_0x29e8('0x8'));var csv=require(_0x29e8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x29e8('0xa'));var _=require(_0x29e8('0xb'));var squel=require(_0x29e8('0xc'));var crypto=require(_0x29e8('0xd'));var jsforce=require(_0x29e8('0xe'));var deskjs=require(_0x29e8('0xf'));var toCsv=require(_0x29e8('0x9'));var querystring=require(_0x29e8('0x10'));var Papa=require(_0x29e8('0x11'));var Redis=require('ioredis');var authService=require(_0x29e8('0x12'));var qs=require(_0x29e8('0x13'));var as=require(_0x29e8('0x14'));var hardwareService=require(_0x29e8('0x15'));var logger=require(_0x29e8('0x16'))(_0x29e8('0x17'));var utils=require(_0x29e8('0x18'));var config=require(_0x29e8('0x19'));var licenseUtil=require(_0x29e8('0x1a'));var db=require(_0x29e8('0x1b'))['db'];var integrations=require(_0x29e8('0x1c'));function respondWithStatusCode(_0x133216,_0x19e5ca){_0x19e5ca=_0x19e5ca||0xcc;return function(_0xcac9f2){if(_0xcac9f2){return _0x133216[_0x29e8('0x1d')](_0x19e5ca);}return _0x133216[_0x29e8('0x1e')](_0x19e5ca)[_0x29e8('0x1f')]();};}function respondWithResult(_0x3fb6c5,_0x55a344){_0x55a344=_0x55a344||0xc8;return function(_0x5a8659){if(_0x5a8659){return _0x3fb6c5['status'](_0x55a344)['json'](_0x5a8659);}};}function respondWithFilteredResult(_0x46bcf2,_0x2ab5e6){return function(_0x228da4){if(_0x228da4){var _0x1ac224=typeof _0x2ab5e6[_0x29e8('0x20')]==='undefined'&&typeof _0x2ab5e6[_0x29e8('0x21')]==='undefined';var _0x17a288=_0x228da4[_0x29e8('0x22')];var _0x3d2cc3=_0x1ac224?0x0:_0x2ab5e6[_0x29e8('0x20')];var _0x2b300d=_0x1ac224?_0x228da4[_0x29e8('0x22')]:_0x2ab5e6[_0x29e8('0x20')]+_0x2ab5e6['limit'];var _0x178136;if(_0x2b300d>=_0x17a288){_0x2b300d=_0x17a288;_0x178136=0xc8;}else{_0x178136=0xce;}_0x46bcf2[_0x29e8('0x1e')](_0x178136);return _0x46bcf2[_0x29e8('0x23')]('Content-Range',_0x3d2cc3+'-'+_0x2b300d+'/'+_0x17a288)[_0x29e8('0x24')](_0x228da4);}return null;};}function patchUpdates(_0x461695){return function(_0xa11cc0){try{jsonpatch[_0x29e8('0x25')](_0xa11cc0,_0x461695,!![]);}catch(_0x36029f){return BPromise['reject'](_0x36029f);}return _0xa11cc0[_0x29e8('0x26')]();};}function saveUpdates(_0x5b1d71,_0x10a09d){return function(_0x400860){if(_0x400860){return _0x400860[_0x29e8('0x27')](_0x5b1d71)['then'](function(_0x670c93){return _0x670c93;});}return null;};}function removeEntity(_0x4ce502,_0x41be4d){return function(_0x3cf632){if(_0x3cf632){return _0x3cf632[_0x29e8('0x28')]()['then'](function(){_0x4ce502['status'](0xcc)[_0x29e8('0x1f')]();});}};}function handleEntityNotFound(_0x4f5127,_0x15952a){return function(_0x4bdc3e){if(!_0x4bdc3e){_0x4f5127[_0x29e8('0x1d')](0x194);}return _0x4bdc3e;};}function handleError(_0x31a607,_0x510205){_0x510205=_0x510205||0x1f4;return function(_0x2de0dd){logger[_0x29e8('0x29')](_0x2de0dd[_0x29e8('0x2a')]);if(_0x2de0dd[_0x29e8('0x2b')]){delete _0x2de0dd[_0x29e8('0x2b')];}_0x31a607['status'](_0x510205)[_0x29e8('0x2c')](_0x2de0dd);};}exports[_0x29e8('0x2d')]=function(_0x42faca,_0x3ac719){var _0x27d9a={},_0x3c8a16={},_0x3e280c={'count':0x0,'rows':[]};var _0x4af68f=_['map'](db[_0x29e8('0x2e')][_0x29e8('0x2f')],function(_0x3495a9){return{'name':_0x3495a9[_0x29e8('0x30')],'type':_0x3495a9['type']['key']};});_0x3c8a16[_0x29e8('0x31')]=_[_0x29e8('0x32')](_0x4af68f,_0x29e8('0x2b'));_0x3c8a16['query']=_[_0x29e8('0x33')](_0x42faca['query']);_0x3c8a16[_0x29e8('0x34')]=_['intersection'](_0x3c8a16[_0x29e8('0x31')],_0x3c8a16[_0x29e8('0x35')]);_0x27d9a[_0x29e8('0x36')]=_['intersection'](_0x3c8a16[_0x29e8('0x31')],qs[_0x29e8('0x37')](_0x42faca[_0x29e8('0x35')][_0x29e8('0x37')]));_0x27d9a[_0x29e8('0x36')]=_0x27d9a[_0x29e8('0x36')][_0x29e8('0x38')]?_0x27d9a[_0x29e8('0x36')]:_0x3c8a16[_0x29e8('0x31')];if(!_0x42faca[_0x29e8('0x35')][_0x29e8('0x39')](_0x29e8('0x3a'))){_0x27d9a['limit']=qs['limit'](_0x42faca[_0x29e8('0x35')][_0x29e8('0x21')]);_0x27d9a[_0x29e8('0x20')]=qs[_0x29e8('0x20')](_0x42faca[_0x29e8('0x35')][_0x29e8('0x20')]);}_0x27d9a[_0x29e8('0x3b')]=qs['sort'](_0x42faca[_0x29e8('0x35')][_0x29e8('0x3c')]);_0x27d9a[_0x29e8('0x3d')]=qs[_0x29e8('0x34')](_[_0x29e8('0x3e')](_0x42faca[_0x29e8('0x35')],_0x3c8a16[_0x29e8('0x34')]),_0x4af68f);if(_0x42faca[_0x29e8('0x35')][_0x29e8('0x3f')]){_0x27d9a['where']=_[_0x29e8('0x40')](_0x27d9a[_0x29e8('0x3d')],{'$or':_[_0x29e8('0x32')](_0x4af68f,function(_0xa677e9){if(_0xa677e9[_0x29e8('0x41')]!=='VIRTUAL'){var _0x16a2b8={};_0x16a2b8[_0xa677e9[_0x29e8('0x2b')]]={'$like':'%'+_0x42faca['query']['filter']+'%'};return _0x16a2b8;}})});}_0x27d9a=_[_0x29e8('0x40')]({},_0x27d9a,_0x42faca['options']);var _0x2ae2ea={'where':_0x27d9a[_0x29e8('0x3d')]};return db['ZohoAccount'][_0x29e8('0x22')](_0x2ae2ea)['then'](function(_0x400d54){_0x3e280c[_0x29e8('0x22')]=_0x400d54;if(_0x42faca[_0x29e8('0x35')]['includeAll']){_0x27d9a[_0x29e8('0x42')]=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x27d9a);})[_0x29e8('0x43')](function(_0x5df7dc){_0x3e280c[_0x29e8('0x44')]=_0x5df7dc;return _0x3e280c;})[_0x29e8('0x43')](respondWithFilteredResult(_0x3ac719,_0x27d9a))['catch'](handleError(_0x3ac719,null));};exports[_0x29e8('0x45')]=function(_0x42683c,_0x3b1f49){var _0x5d45e6={'raw':![],'where':{'id':_0x42683c[_0x29e8('0x46')]['id']}},_0x2c21e4={};_0x2c21e4[_0x29e8('0x31')]=_[_0x29e8('0x33')](db[_0x29e8('0x2e')][_0x29e8('0x2f')]);_0x2c21e4[_0x29e8('0x35')]=_[_0x29e8('0x33')](_0x42683c[_0x29e8('0x35')]);_0x2c21e4[_0x29e8('0x34')]=_[_0x29e8('0x47')](_0x2c21e4[_0x29e8('0x31')],_0x2c21e4[_0x29e8('0x35')]);_0x5d45e6[_0x29e8('0x36')]=_[_0x29e8('0x47')](_0x2c21e4[_0x29e8('0x31')],qs[_0x29e8('0x37')](_0x42683c[_0x29e8('0x35')][_0x29e8('0x37')]));_0x5d45e6[_0x29e8('0x36')]=_0x5d45e6[_0x29e8('0x36')][_0x29e8('0x38')]?_0x5d45e6[_0x29e8('0x36')]:_0x2c21e4[_0x29e8('0x31')];if(_0x42683c[_0x29e8('0x35')][_0x29e8('0x48')]){_0x5d45e6['include']=[{'all':!![]}];}_0x5d45e6=_[_0x29e8('0x40')]({},_0x5d45e6,_0x42683c['options']);return db['ZohoAccount']['find'](_0x5d45e6)[_0x29e8('0x43')](handleEntityNotFound(_0x3b1f49,null))['then'](respondWithResult(_0x3b1f49,null))[_0x29e8('0x49')](handleError(_0x3b1f49,null));};exports[_0x29e8('0x4a')]=function(_0x5782b8,_0x77082e){return db[_0x29e8('0x2e')][_0x29e8('0x4a')](_0x5782b8['body'],{})['then'](respondWithResult(_0x77082e,0xc9))[_0x29e8('0x49')](handleError(_0x77082e,null));};exports['update']=function(_0x48702d,_0x4233d3){if(_0x48702d[_0x29e8('0x4b')]['id']){delete _0x48702d['body']['id'];}return db[_0x29e8('0x2e')][_0x29e8('0x4c')]({'where':{'id':_0x48702d[_0x29e8('0x46')]['id']}})['then'](handleEntityNotFound(_0x4233d3,null))[_0x29e8('0x43')](saveUpdates(_0x48702d[_0x29e8('0x4b')],null))[_0x29e8('0x43')](respondWithResult(_0x4233d3,null))['catch'](handleError(_0x4233d3,null));};exports['destroy']=function(_0x1354a7,_0x25b880){return db['ZohoAccount']['find']({'where':{'id':_0x1354a7['params']['id']}})['then'](handleEntityNotFound(_0x25b880,null))[_0x29e8('0x43')](removeEntity(_0x25b880,null))['catch'](handleError(_0x25b880,null));};exports[_0x29e8('0x4d')]=function(_0x4472de,_0x219e04,_0x4f789a){var _0xc0f74a={};var _0x54f75a={};var _0x2d1d9c;var _0x1eee45;return db['ZohoAccount']['findOne']({'where':{'id':_0x4472de[_0x29e8('0x46')]['id']}})[_0x29e8('0x43')](handleEntityNotFound(_0x219e04,null))['then'](function(_0x438bfb){if(_0x438bfb){_0x2d1d9c=_0x438bfb;_0x54f75a[_0x29e8('0x31')]=_[_0x29e8('0x33')](db['ZohoConfiguration'][_0x29e8('0x2f')]);_0x54f75a[_0x29e8('0x35')]=_[_0x29e8('0x33')](_0x4472de[_0x29e8('0x35')]);_0x54f75a[_0x29e8('0x34')]=_[_0x29e8('0x47')](_0x54f75a['model'],_0x54f75a[_0x29e8('0x35')]);_0xc0f74a['attributes']=_[_0x29e8('0x47')](_0x54f75a[_0x29e8('0x31')],qs[_0x29e8('0x37')](_0x4472de[_0x29e8('0x35')]['fields']));_0xc0f74a['attributes']=_0xc0f74a[_0x29e8('0x36')]['length']?_0xc0f74a[_0x29e8('0x36')]:_0x54f75a[_0x29e8('0x31')];_0xc0f74a[_0x29e8('0x3b')]=qs[_0x29e8('0x3c')](_0x4472de['query'][_0x29e8('0x3c')]);_0xc0f74a[_0x29e8('0x3d')]=qs[_0x29e8('0x34')](_['pick'](_0x4472de[_0x29e8('0x35')],_0x54f75a[_0x29e8('0x34')]));if(_0x4472de[_0x29e8('0x35')][_0x29e8('0x3f')]){_0xc0f74a[_0x29e8('0x3d')]=_[_0x29e8('0x40')](_0xc0f74a[_0x29e8('0x3d')],{'$or':_[_0x29e8('0x32')](_0xc0f74a[_0x29e8('0x36')],function(_0x109543){var _0x3fd3fe={};_0x3fd3fe[_0x109543]={'$like':'%'+_0x4472de[_0x29e8('0x35')]['filter']+'%'};return _0x3fd3fe;})});}_0xc0f74a=_[_0x29e8('0x40')]({},_0xc0f74a,_0x4472de[_0x29e8('0x4e')]);return _0x2d1d9c[_0x29e8('0x4d')](_0xc0f74a);}})['then'](function(_0x1f12fc){if(_0x1f12fc){_0x1eee45=_0x1f12fc['length'];if(!_0x4472de[_0x29e8('0x35')]['hasOwnProperty'](_0x29e8('0x3a'))){_0xc0f74a[_0x29e8('0x21')]=qs[_0x29e8('0x21')](_0x4472de[_0x29e8('0x35')]['limit']);_0xc0f74a[_0x29e8('0x20')]=qs[_0x29e8('0x20')](_0x4472de[_0x29e8('0x35')][_0x29e8('0x20')]);}return _0x2d1d9c['getConfigurations'](_0xc0f74a);}})['then'](function(_0x48d823){if(_0x48d823){return _0x48d823?{'count':_0x1eee45,'rows':_0x48d823}:null;}})[_0x29e8('0x43')](respondWithResult(_0x219e04,null))[_0x29e8('0x49')](handleError(_0x219e04,null));};exports[_0x29e8('0x4f')]=function(_0x337c51,_0x2b7a97,_0x5486f9){if(_0x337c51[_0x29e8('0x4b')]['id']){delete _0x337c51[_0x29e8('0x4b')]['id'];}return db[_0x29e8('0x2e')][_0x29e8('0x50')]({'where':{'id':_0x337c51['params']['id']}})['then'](handleEntityNotFound(_0x2b7a97,null))[_0x29e8('0x43')](function(_0xe2a330){if(_0xe2a330){_0x337c51[_0x29e8('0x4b')]['AccountId']=_0xe2a330['id'];_0x337c51[_0x29e8('0x4b')][_0x29e8('0x51')]=integrations[_0x29e8('0x52')](_0x337c51['body'][_0x29e8('0x53')],_0x337c51['body'][_0x29e8('0x41')]);_0x337c51['body'][_0x29e8('0x54')]=integrations[_0x29e8('0x55')](_0x337c51['body'][_0x29e8('0x53')],_0x337c51[_0x29e8('0x4b')][_0x29e8('0x41')]);return db['ZohoConfiguration'][_0x29e8('0x4a')](_0x337c51[_0x29e8('0x4b')],{'include':[{'model':db[_0x29e8('0x56')],'as':_0x29e8('0x51')},{'model':db[_0x29e8('0x56')],'as':'Descriptions'}]});}return null;})[_0x29e8('0x43')](respondWithResult(_0x2b7a97,null))['catch'](handleError(_0x2b7a97,null));};function getAccessToken(_0x1bf7f4){return new Promise(function(_0x5f1170,_0x2a24da){var _0x3524e6;switch(_0x1bf7f4[_0x29e8('0x57')]){case'US':_0x3524e6=_0x29e8('0x58');break;case'AU':_0x3524e6=_0x29e8('0x59');break;case'EU':_0x3524e6='https://accounts.zoho.eu';break;case'IN':_0x3524e6=_0x29e8('0x5a');break;case'CN':_0x3524e6=_0x29e8('0x5b');break;default:_0x3524e6=_0x29e8('0x5c');break;}var _0x513753={'method':'POST','uri':_0x3524e6+_0x29e8('0x5d'),'qs':{'refresh_token':_0x1bf7f4[_0x29e8('0x5e')],'client_id':_0x1bf7f4[_0x29e8('0x5f')],'client_secret':_0x1bf7f4['clientSecret'],'grant_type':_0x29e8('0x60')},'json':!![]};return rp(_0x513753)[_0x29e8('0x43')](function(_0x560a5c){if(_0x560a5c[_0x29e8('0x61')]){_0x5f1170(_0x560a5c[_0x29e8('0x61')]);}else{_0x2a24da(_0x29e8('0x62'));}})['catch'](function(_0x4ffa04){_0x2a24da(_0x4ffa04);});});}exports[_0x29e8('0x63')]=function(_0x4609f3,_0x4e8aaa,_0x426f81){var _0x744e72,_0x5b74e5,_0x555562,_0x92d867,_0x1571bf;return db['ZohoAccount'][_0x29e8('0x50')]({'where':{'id':_0x4609f3['params']['id']},'attributes':['id','host',_0x29e8('0x57'),_0x29e8('0x5f'),_0x29e8('0x64'),_0x29e8('0x65'),_0x29e8('0x66'),_0x29e8('0x5e')]})['then'](handleEntityNotFound(_0x4e8aaa,null))[_0x29e8('0x43')](function(_0x46a93f){_0x1571bf=_0x46a93f;_0x744e72=_0x1571bf[_0x29e8('0x67')];_0x5b74e5=_0x744e72===_0x29e8('0x68')?'eu':_0x29e8('0x69');_0x555562=_0x1571bf[_0x29e8('0x65')];var _0x1bdb74=_0x555562[_0x29e8('0x6a')](-0x1);if(_0x1bdb74==='/'||_0x1bdb74==='\x5c'||_0x1bdb74===':'){_0x555562=_0x555562[_0x29e8('0x6b')](0x0,_0x555562[_0x29e8('0x6c')](_0x1bdb74));}if(!_0x1571bf[_0x29e8('0x5e')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x1571bf);})[_0x29e8('0x43')](function(_0x153180){if(_0x153180){return rp({'method':_0x29e8('0x6d'),'uri':util['format'](_0x29e8('0x6e'),_0x5b74e5),'qs':{'module':_0x29e8('0x6f')},'headers':{'Authorization':_0x29e8('0x70')+_0x153180},'json':!![]});}})[_0x29e8('0x43')](function(_0x23ca1c){if(_0x23ca1c){if(_0x23ca1c[_0x29e8('0x71')]&&_0x23ca1c[_0x29e8('0x71')][_0x29e8('0x29')]){throw new Error(_0x23ca1c['response']['error'][_0x29e8('0x72')]);}var _0x2b1ba8=[];var _0x49b526=[];var _0x2bd95c=[_0x29e8('0x73'),'Subject','Description',_0x29e8('0x74'),_0x29e8('0x75'),_0x29e8('0x76'),_0x29e8('0x77'),_0x29e8('0x78')];_0x49b526=_[_0x29e8('0x79')](_0x23ca1c[_0x29e8('0x37')],function(_0x1f4ce6){return _0x2bd95c[_0x29e8('0x7a')](_0x1f4ce6[_0x29e8('0x7b')]);});for(var _0x30abc7=0x0;_0x30abc7<_0x49b526[_0x29e8('0x38')];_0x30abc7++){if(_0x49b526[_0x30abc7][_0x29e8('0x7c')]===![]){_0x2b1ba8['push']({'id':_0x49b526[_0x30abc7]['id'],'name':_0x49b526[_0x30abc7][_0x29e8('0x7d')],'custom':_0x49b526[_0x30abc7]['custom_field'],'options':_0x49b526[_0x30abc7][_0x29e8('0x7e')]===_0x29e8('0x7f')&&_0x49b526[_0x30abc7]['pick_list_values'][_0x29e8('0x38')]>-0x1?_['map'](_0x49b526[_0x30abc7]['pick_list_values'],function(_0x21a8e2){return{'name':_0x21a8e2,'value':_0x21a8e2};}):[]});}}return{'count':_0x2b1ba8[_0x29e8('0x38')],'rows':_0x2b1ba8};}else{return{'count':0x0,'rows':[]};}})[_0x29e8('0x43')](respondWithResult(_0x4e8aaa,null))[_0x29e8('0x49')](function(_0x5dd574){var _0x50b9da=_0x4609f3[_0x29e8('0x35')]['test']?0x1f4:_0x5dd574[_0x29e8('0x80')]||0x1f4;logger[_0x29e8('0x29')](_0x29e8('0x81'),_0x29e8('0x63'),_0x50b9da,JSON[_0x29e8('0x82')](_0x5dd574));delete _0x5dd574[_0x29e8('0x2b')];if(_0x50b9da===0x191){_0x50b9da=0x190;}_0x4e8aaa[_0x29e8('0x1e')](_0x50b9da)['send'](_0x4609f3[_0x29e8('0x35')][_0x29e8('0x83')]?{'message':'Wrong\x20credentials','statusCode':_0x5dd574[_0x29e8('0x80')]}:_0x5dd574);});};
\ No newline at end of file
+var _0x9b50=['Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','system_mandatory','push','custom_field','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','save','update','then','error','stack','name','index','map','ZohoAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','find','create','body','params','catch','getConfigurations','findOne','ZohoConfiguration','order','addConfiguration','AccountId','channel','type','Descriptions','getDescriptions','ZohoField','Subjects','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','zoho.eu','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner'];(function(_0x541ea6,_0x51cab6){var _0x3c3e84=function(_0xc06bed){while(--_0xc06bed){_0x541ea6['push'](_0x541ea6['shift']());}};_0x3c3e84(++_0x51cab6);}(_0x9b50,0x11b));var _0x09b5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9b50[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x09b5('0x0'));var rimraf=require(_0x09b5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x09b5('0x2'));var rp=require('request-promise');var moment=require(_0x09b5('0x3'));var BPromise=require(_0x09b5('0x4'));var Mustache=require(_0x09b5('0x5'));var util=require(_0x09b5('0x6'));var path=require(_0x09b5('0x7'));var sox=require(_0x09b5('0x8'));var csv=require(_0x09b5('0x9'));var ejs=require(_0x09b5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x09b5('0xb'));var crypto=require('crypto');var jsforce=require(_0x09b5('0xc'));var deskjs=require(_0x09b5('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09b5('0xe'));var Papa=require('papaparse');var Redis=require(_0x09b5('0xf'));var authService=require(_0x09b5('0x10'));var qs=require(_0x09b5('0x11'));var as=require(_0x09b5('0x12'));var hardwareService=require(_0x09b5('0x13'));var logger=require(_0x09b5('0x14'))(_0x09b5('0x15'));var utils=require(_0x09b5('0x16'));var config=require(_0x09b5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x09b5('0x18'))['db'];var integrations=require(_0x09b5('0x19'));function respondWithStatusCode(_0x1401fd,_0x32a06e){_0x32a06e=_0x32a06e||0xcc;return function(_0x19851d){if(_0x19851d){return _0x1401fd[_0x09b5('0x1a')](_0x32a06e);}return _0x1401fd[_0x09b5('0x1b')](_0x32a06e)[_0x09b5('0x1c')]();};}function respondWithResult(_0x586f00,_0x25d878){_0x25d878=_0x25d878||0xc8;return function(_0x644734){if(_0x644734){return _0x586f00[_0x09b5('0x1b')](_0x25d878)[_0x09b5('0x1d')](_0x644734);}};}function respondWithFilteredResult(_0x1ea09c,_0x4c916c){return function(_0xb00b9b){if(_0xb00b9b){var _0xd7d55b=typeof _0x4c916c[_0x09b5('0x1e')]==='undefined'&&typeof _0x4c916c[_0x09b5('0x1f')]===_0x09b5('0x20');var _0x216d7f=_0xb00b9b[_0x09b5('0x21')];var _0x1ce390=_0xd7d55b?0x0:_0x4c916c[_0x09b5('0x1e')];var _0x462e44=_0xd7d55b?_0xb00b9b[_0x09b5('0x21')]:_0x4c916c[_0x09b5('0x1e')]+_0x4c916c[_0x09b5('0x1f')];var _0x4ad20c;if(_0x462e44>=_0x216d7f){_0x462e44=_0x216d7f;_0x4ad20c=0xc8;}else{_0x4ad20c=0xce;}_0x1ea09c[_0x09b5('0x1b')](_0x4ad20c);return _0x1ea09c[_0x09b5('0x22')]('Content-Range',_0x1ce390+'-'+_0x462e44+'/'+_0x216d7f)['json'](_0xb00b9b);}return null;};}function patchUpdates(_0xfa67b3){return function(_0x5ed07e){try{jsonpatch['apply'](_0x5ed07e,_0xfa67b3,!![]);}catch(_0x1c5625){return BPromise['reject'](_0x1c5625);}return _0x5ed07e[_0x09b5('0x23')]();};}function saveUpdates(_0x2bf0cb,_0x3b6b53){return function(_0x1c79e3){if(_0x1c79e3){return _0x1c79e3[_0x09b5('0x24')](_0x2bf0cb)[_0x09b5('0x25')](function(_0x49db1d){return _0x49db1d;});}return null;};}function removeEntity(_0x5945dc,_0x373352){return function(_0xe26ae6){if(_0xe26ae6){return _0xe26ae6['destroy']()[_0x09b5('0x25')](function(){_0x5945dc['status'](0xcc)[_0x09b5('0x1c')]();});}};}function handleEntityNotFound(_0x4be1c9,_0x3cf02b){return function(_0x55d51f){if(!_0x55d51f){_0x4be1c9[_0x09b5('0x1a')](0x194);}return _0x55d51f;};}function handleError(_0x23ddcc,_0x2e7d7f){_0x2e7d7f=_0x2e7d7f||0x1f4;return function(_0x289018){logger[_0x09b5('0x26')](_0x289018[_0x09b5('0x27')]);if(_0x289018[_0x09b5('0x28')]){delete _0x289018[_0x09b5('0x28')];}_0x23ddcc[_0x09b5('0x1b')](_0x2e7d7f)['send'](_0x289018);};}exports[_0x09b5('0x29')]=function(_0x2bedd9,_0x5976bc){var _0x2b62a0={},_0x49b2f0={},_0x435102={'count':0x0,'rows':[]};var _0x27ab33=_[_0x09b5('0x2a')](db[_0x09b5('0x2b')][_0x09b5('0x2c')],function(_0x5e9721){return{'name':_0x5e9721[_0x09b5('0x2d')],'type':_0x5e9721['type'][_0x09b5('0x2e')]};});_0x49b2f0[_0x09b5('0x2f')]=_[_0x09b5('0x2a')](_0x27ab33,'name');_0x49b2f0[_0x09b5('0x30')]=_[_0x09b5('0x31')](_0x2bedd9[_0x09b5('0x30')]);_0x49b2f0[_0x09b5('0x32')]=_[_0x09b5('0x33')](_0x49b2f0['model'],_0x49b2f0[_0x09b5('0x30')]);_0x2b62a0[_0x09b5('0x34')]=_['intersection'](_0x49b2f0[_0x09b5('0x2f')],qs['fields'](_0x2bedd9[_0x09b5('0x30')][_0x09b5('0x35')]));_0x2b62a0[_0x09b5('0x34')]=_0x2b62a0[_0x09b5('0x34')][_0x09b5('0x36')]?_0x2b62a0[_0x09b5('0x34')]:_0x49b2f0[_0x09b5('0x2f')];if(!_0x2bedd9['query'][_0x09b5('0x37')](_0x09b5('0x38'))){_0x2b62a0[_0x09b5('0x1f')]=qs[_0x09b5('0x1f')](_0x2bedd9['query'][_0x09b5('0x1f')]);_0x2b62a0[_0x09b5('0x1e')]=qs[_0x09b5('0x1e')](_0x2bedd9[_0x09b5('0x30')][_0x09b5('0x1e')]);}_0x2b62a0['order']=qs[_0x09b5('0x39')](_0x2bedd9[_0x09b5('0x30')][_0x09b5('0x39')]);_0x2b62a0[_0x09b5('0x3a')]=qs[_0x09b5('0x32')](_[_0x09b5('0x3b')](_0x2bedd9[_0x09b5('0x30')],_0x49b2f0[_0x09b5('0x32')]),_0x27ab33);if(_0x2bedd9[_0x09b5('0x30')]['filter']){_0x2b62a0['where']=_[_0x09b5('0x3c')](_0x2b62a0[_0x09b5('0x3a')],{'$or':_[_0x09b5('0x2a')](_0x27ab33,function(_0x402668){if(_0x402668['type']!==_0x09b5('0x3d')){var _0x1ac8c7={};_0x1ac8c7[_0x402668[_0x09b5('0x28')]]={'$like':'%'+_0x2bedd9[_0x09b5('0x30')][_0x09b5('0x3e')]+'%'};return _0x1ac8c7;}})});}_0x2b62a0=_[_0x09b5('0x3c')]({},_0x2b62a0,_0x2bedd9[_0x09b5('0x3f')]);var _0x5def6d={'where':_0x2b62a0[_0x09b5('0x3a')]};return db['ZohoAccount'][_0x09b5('0x21')](_0x5def6d)[_0x09b5('0x25')](function(_0x14feb5){_0x435102[_0x09b5('0x21')]=_0x14feb5;if(_0x2bedd9[_0x09b5('0x30')][_0x09b5('0x40')]){_0x2b62a0[_0x09b5('0x41')]=[{'all':!![]}];}return db[_0x09b5('0x2b')]['findAll'](_0x2b62a0);})[_0x09b5('0x25')](function(_0xc01a8c){_0x435102[_0x09b5('0x42')]=_0xc01a8c;return _0x435102;})['then'](respondWithFilteredResult(_0x5976bc,_0x2b62a0))['catch'](handleError(_0x5976bc,null));};exports[_0x09b5('0x43')]=function(_0x39e246,_0x27f4eb){var _0x44e1f8={'raw':![],'where':{'id':_0x39e246['params']['id']}},_0x1542cf={};_0x1542cf[_0x09b5('0x2f')]=_[_0x09b5('0x31')](db[_0x09b5('0x2b')][_0x09b5('0x2c')]);_0x1542cf['query']=_['keys'](_0x39e246[_0x09b5('0x30')]);_0x1542cf['filters']=_[_0x09b5('0x33')](_0x1542cf[_0x09b5('0x2f')],_0x1542cf[_0x09b5('0x30')]);_0x44e1f8[_0x09b5('0x34')]=_[_0x09b5('0x33')](_0x1542cf[_0x09b5('0x2f')],qs[_0x09b5('0x35')](_0x39e246['query'][_0x09b5('0x35')]));_0x44e1f8[_0x09b5('0x34')]=_0x44e1f8['attributes'][_0x09b5('0x36')]?_0x44e1f8[_0x09b5('0x34')]:_0x1542cf[_0x09b5('0x2f')];if(_0x39e246[_0x09b5('0x30')][_0x09b5('0x40')]){_0x44e1f8['include']=[{'all':!![]}];}_0x44e1f8=_[_0x09b5('0x3c')]({},_0x44e1f8,_0x39e246[_0x09b5('0x3f')]);return db['ZohoAccount'][_0x09b5('0x44')](_0x44e1f8)[_0x09b5('0x25')](handleEntityNotFound(_0x27f4eb,null))['then'](respondWithResult(_0x27f4eb,null))['catch'](handleError(_0x27f4eb,null));};exports[_0x09b5('0x45')]=function(_0x2bde24,_0x106ef5){return db[_0x09b5('0x2b')]['create'](_0x2bde24[_0x09b5('0x46')],{})[_0x09b5('0x25')](respondWithResult(_0x106ef5,0xc9))['catch'](handleError(_0x106ef5,null));};exports[_0x09b5('0x24')]=function(_0xb89f24,_0x19150e){if(_0xb89f24[_0x09b5('0x46')]['id']){delete _0xb89f24[_0x09b5('0x46')]['id'];}return db['ZohoAccount'][_0x09b5('0x44')]({'where':{'id':_0xb89f24[_0x09b5('0x47')]['id']}})[_0x09b5('0x25')](handleEntityNotFound(_0x19150e,null))['then'](saveUpdates(_0xb89f24[_0x09b5('0x46')],null))[_0x09b5('0x25')](respondWithResult(_0x19150e,null))[_0x09b5('0x48')](handleError(_0x19150e,null));};exports['destroy']=function(_0x2ad693,_0x29567e){return db[_0x09b5('0x2b')][_0x09b5('0x44')]({'where':{'id':_0x2ad693['params']['id']}})[_0x09b5('0x25')](handleEntityNotFound(_0x29567e,null))[_0x09b5('0x25')](removeEntity(_0x29567e,null))[_0x09b5('0x48')](handleError(_0x29567e,null));};exports[_0x09b5('0x49')]=function(_0x2b428a,_0x886c36,_0x5cc65a){var _0x233717={};var _0x7bb75c={};var _0x46afef;var _0x323c26;return db[_0x09b5('0x2b')][_0x09b5('0x4a')]({'where':{'id':_0x2b428a[_0x09b5('0x47')]['id']}})[_0x09b5('0x25')](handleEntityNotFound(_0x886c36,null))[_0x09b5('0x25')](function(_0x148b66){if(_0x148b66){_0x46afef=_0x148b66;_0x7bb75c[_0x09b5('0x2f')]=_[_0x09b5('0x31')](db[_0x09b5('0x4b')]['rawAttributes']);_0x7bb75c['query']=_[_0x09b5('0x31')](_0x2b428a[_0x09b5('0x30')]);_0x7bb75c[_0x09b5('0x32')]=_[_0x09b5('0x33')](_0x7bb75c['model'],_0x7bb75c[_0x09b5('0x30')]);_0x233717['attributes']=_['intersection'](_0x7bb75c['model'],qs[_0x09b5('0x35')](_0x2b428a[_0x09b5('0x30')][_0x09b5('0x35')]));_0x233717[_0x09b5('0x34')]=_0x233717['attributes'][_0x09b5('0x36')]?_0x233717[_0x09b5('0x34')]:_0x7bb75c['model'];_0x233717[_0x09b5('0x4c')]=qs['sort'](_0x2b428a[_0x09b5('0x30')][_0x09b5('0x39')]);_0x233717[_0x09b5('0x3a')]=qs[_0x09b5('0x32')](_[_0x09b5('0x3b')](_0x2b428a[_0x09b5('0x30')],_0x7bb75c['filters']));if(_0x2b428a[_0x09b5('0x30')][_0x09b5('0x3e')]){_0x233717['where']=_[_0x09b5('0x3c')](_0x233717[_0x09b5('0x3a')],{'$or':_[_0x09b5('0x2a')](_0x233717[_0x09b5('0x34')],function(_0x4e0ea5){var _0x3f4abb={};_0x3f4abb[_0x4e0ea5]={'$like':'%'+_0x2b428a[_0x09b5('0x30')][_0x09b5('0x3e')]+'%'};return _0x3f4abb;})});}_0x233717=_[_0x09b5('0x3c')]({},_0x233717,_0x2b428a['options']);return _0x46afef[_0x09b5('0x49')](_0x233717);}})[_0x09b5('0x25')](function(_0x8e99e1){if(_0x8e99e1){_0x323c26=_0x8e99e1[_0x09b5('0x36')];if(!_0x2b428a[_0x09b5('0x30')][_0x09b5('0x37')](_0x09b5('0x38'))){_0x233717[_0x09b5('0x1f')]=qs[_0x09b5('0x1f')](_0x2b428a[_0x09b5('0x30')][_0x09b5('0x1f')]);_0x233717['offset']=qs['offset'](_0x2b428a[_0x09b5('0x30')][_0x09b5('0x1e')]);}return _0x46afef[_0x09b5('0x49')](_0x233717);}})[_0x09b5('0x25')](function(_0x58a04d){if(_0x58a04d){return _0x58a04d?{'count':_0x323c26,'rows':_0x58a04d}:null;}})['then'](respondWithResult(_0x886c36,null))['catch'](handleError(_0x886c36,null));};exports[_0x09b5('0x4d')]=function(_0x8f656f,_0x5e752a,_0x1e6319){if(_0x8f656f[_0x09b5('0x46')]['id']){delete _0x8f656f['body']['id'];}return db[_0x09b5('0x2b')][_0x09b5('0x4a')]({'where':{'id':_0x8f656f[_0x09b5('0x47')]['id']}})[_0x09b5('0x25')](handleEntityNotFound(_0x5e752a,null))[_0x09b5('0x25')](function(_0x1a02f3){if(_0x1a02f3){_0x8f656f[_0x09b5('0x46')][_0x09b5('0x4e')]=_0x1a02f3['id'];_0x8f656f[_0x09b5('0x46')]['Subjects']=integrations['getSubjects'](_0x8f656f[_0x09b5('0x46')][_0x09b5('0x4f')],_0x8f656f[_0x09b5('0x46')][_0x09b5('0x50')]);_0x8f656f['body'][_0x09b5('0x51')]=integrations[_0x09b5('0x52')](_0x8f656f[_0x09b5('0x46')]['channel'],_0x8f656f[_0x09b5('0x46')][_0x09b5('0x50')]);return db['ZohoConfiguration'][_0x09b5('0x45')](_0x8f656f[_0x09b5('0x46')],{'include':[{'model':db[_0x09b5('0x53')],'as':_0x09b5('0x54')},{'model':db[_0x09b5('0x53')],'as':'Descriptions'}]});}return null;})[_0x09b5('0x25')](respondWithResult(_0x5e752a,null))[_0x09b5('0x48')](handleError(_0x5e752a,null));};function getAccessToken(_0x103690){return new Promise(function(_0x246941,_0x56e687){var _0xb3bcd8;switch(_0x103690[_0x09b5('0x55')]){case'US':_0xb3bcd8='https://accounts.zoho.com';break;case'AU':_0xb3bcd8=_0x09b5('0x56');break;case'EU':_0xb3bcd8=_0x09b5('0x57');break;case'IN':_0xb3bcd8=_0x09b5('0x58');break;case'CN':_0xb3bcd8='https://accounts.zoho.com.cn';break;default:_0xb3bcd8=_0x09b5('0x57');break;}var _0x565c3b={'method':_0x09b5('0x59'),'uri':_0xb3bcd8+_0x09b5('0x5a'),'qs':{'refresh_token':_0x103690[_0x09b5('0x5b')],'client_id':_0x103690[_0x09b5('0x5c')],'client_secret':_0x103690[_0x09b5('0x5d')],'grant_type':_0x09b5('0x5e')},'json':!![]};return rp(_0x565c3b)[_0x09b5('0x25')](function(_0x480d93){if(_0x480d93[_0x09b5('0x5f')]){_0x246941(_0x480d93['access_token']);}else{_0x56e687(_0x09b5('0x60'));}})[_0x09b5('0x48')](function(_0x3161d0){_0x56e687(_0x3161d0);});});}exports['getFields']=function(_0x196d6a,_0x45d4af,_0x6231a5){var _0x3bb861,_0x39d7ac,_0x2f8d27,_0xad353b,_0x5dbb65;return db[_0x09b5('0x2b')][_0x09b5('0x4a')]({'where':{'id':_0x196d6a[_0x09b5('0x47')]['id']},'attributes':['id',_0x09b5('0x61'),_0x09b5('0x55'),_0x09b5('0x5c'),'clientSecret',_0x09b5('0x62'),_0x09b5('0x63'),'refreshToken']})[_0x09b5('0x25')](handleEntityNotFound(_0x45d4af,null))[_0x09b5('0x25')](function(_0xa334b5){_0x5dbb65=_0xa334b5;_0x3bb861=_0x5dbb65['host'];_0x39d7ac=_0x3bb861===_0x09b5('0x64')?'eu':_0x09b5('0x65');_0x2f8d27=_0x5dbb65['serverUrl'];var _0x2998ac=_0x2f8d27['slice'](-0x1);if(_0x2998ac==='/'||_0x2998ac==='\x5c'||_0x2998ac===':'){_0x2f8d27=_0x2f8d27[_0x09b5('0x66')](0x0,_0x2f8d27[_0x09b5('0x67')](_0x2998ac));}if(!_0x5dbb65[_0x09b5('0x5b')]){throw new Error(_0x09b5('0x68'));}return getAccessToken(_0x5dbb65);})[_0x09b5('0x25')](function(_0x152b25){if(_0x152b25){return rp({'method':_0x09b5('0x69'),'uri':util[_0x09b5('0x6a')](_0x09b5('0x6b'),_0x39d7ac),'qs':{'module':_0x09b5('0x6c')},'headers':{'Authorization':_0x09b5('0x6d')+_0x152b25},'json':!![]});}})[_0x09b5('0x25')](function(_0x465eed){if(_0x465eed){if(_0x465eed[_0x09b5('0x6e')]&&_0x465eed[_0x09b5('0x6e')][_0x09b5('0x26')]){throw new Error(_0x465eed[_0x09b5('0x6e')]['error'][_0x09b5('0x6f')]);}var _0x564358=[];var _0x32f2e5=[];var _0x26ef7d=[_0x09b5('0x70'),_0x09b5('0x71'),_0x09b5('0x72'),_0x09b5('0x73'),_0x09b5('0x74'),_0x09b5('0x75'),_0x09b5('0x76'),'Call_Type'];_0x32f2e5=_[_0x09b5('0x77')](_0x465eed[_0x09b5('0x35')],function(_0x4349bb){return _0x26ef7d['includes'](_0x4349bb['api_name']);});for(var _0x4b8f40=0x0;_0x4b8f40<_0x32f2e5[_0x09b5('0x36')];_0x4b8f40++){if(_0x32f2e5[_0x4b8f40][_0x09b5('0x78')]===![]){_0x564358[_0x09b5('0x79')]({'id':_0x32f2e5[_0x4b8f40]['id'],'name':_0x32f2e5[_0x4b8f40]['display_label'],'custom':_0x32f2e5[_0x4b8f40][_0x09b5('0x7a')],'options':_0x32f2e5[_0x4b8f40][_0x09b5('0x7b')]===_0x09b5('0x7c')&&_0x32f2e5[_0x4b8f40]['pick_list_values']['length']>-0x1?_[_0x09b5('0x2a')](_0x32f2e5[_0x4b8f40][_0x09b5('0x7d')],function(_0x51e0c5){return{'name':_0x51e0c5,'value':_0x51e0c5};}):[]});}}return{'count':_0x564358['length'],'rows':_0x564358};}else{return{'count':0x0,'rows':[]};}})[_0x09b5('0x25')](respondWithResult(_0x45d4af,null))[_0x09b5('0x48')](function(_0x67e759){var _0x5e4f1c=_0x196d6a[_0x09b5('0x30')][_0x09b5('0x7e')]?0x1f4:_0x67e759['statusCode']||0x1f4;logger[_0x09b5('0x26')](_0x09b5('0x7f'),_0x09b5('0x80'),_0x5e4f1c,JSON[_0x09b5('0x81')](_0x67e759));delete _0x67e759['name'];if(_0x5e4f1c===0x191){_0x5e4f1c=0x190;}_0x45d4af['status'](_0x5e4f1c)[_0x09b5('0x82')](_0x196d6a[_0x09b5('0x30')][_0x09b5('0x7e')]?{'message':_0x09b5('0x83'),'statusCode':_0x67e759['statusCode']}:_0x67e759);});};
\ No newline at end of file
index 30c967d..d2395b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd17b=['ZohoAccount','changed','zone','serverUrl','clientId','clientSecret','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','code','then','parse','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','exports','define'];(function(_0x19609b,_0x164cb2){var _0xb6e95e=function(_0x21f904){while(--_0x21f904){_0x19609b['push'](_0x19609b['shift']());}};_0xb6e95e(++_0x164cb2);}(_0xd17b,0x19a));var _0xbd17=function(_0x53f0db,_0x35c67c){_0x53f0db=_0x53f0db-0x0;var _0xae0a5c=_0xd17b[_0x53f0db];return _0xae0a5c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbd17('0x0'))(_0xbd17('0x1'));var moment=require(_0xbd17('0x2'));var BPromise=require(_0xbd17('0x3'));var rp=require(_0xbd17('0x4'));var fs=require('fs');var path=require(_0xbd17('0x5'));var rimraf=require('rimraf');var config=require(_0xbd17('0x6'));var attributes=require(_0xbd17('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xbd17('0x8')]=function(_0x525fb9,_0x39ed87){return _0x525fb9[_0xbd17('0x9')](_0xbd17('0xa'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4e861a,_0x5503e8,_0x421ded){if(_0x4e861a[_0xbd17('0xb')](_0xbd17('0xc'))||_0x4e861a[_0xbd17('0xb')](_0xbd17('0xd'))||_0x4e861a[_0xbd17('0xb')](_0xbd17('0xe'))||_0x4e861a[_0xbd17('0xb')](_0xbd17('0xf'))||_0x4e861a[_0xbd17('0xb')]('code')||_0x4e861a[_0xbd17('0xb')](_0xbd17('0x10'))){var _0x10a1cf,_0x44277a;_0x10a1cf=_0x4e861a['serverUrl'];var _0x53f34f=_0x10a1cf[_0xbd17('0x11')](-0x1);if(_0x53f34f==='/'||_0x53f34f==='\x5c'||_0x53f34f===':'){_0x10a1cf=_0x10a1cf[_0xbd17('0x12')](0x0,_0x10a1cf[_0xbd17('0x13')](_0x53f34f));}switch(_0x4e861a[_0xbd17('0xc')]){case'US':_0x44277a=_0xbd17('0x14');break;case'AU':_0x44277a=_0xbd17('0x15');break;case'IN':_0x44277a=_0xbd17('0x16');break;case'CN':_0x44277a=_0xbd17('0x17');break;default:_0x44277a=_0xbd17('0x18');break;}var _0x3aa428={'method':_0xbd17('0x19'),'uri':_0x44277a+_0xbd17('0x1a'),'form':{'grant_type':_0xbd17('0x1b'),'client_id':_0x4e861a['clientId'],'client_secret':_0x4e861a[_0xbd17('0xf')],'redirect_uri':_0x4e861a[_0xbd17('0xd')],'code':_0x4e861a['code']},'headers':{'Content-Type':_0xbd17('0x1c')}};return rp(_0x3aa428)['then'](function(_0x19e5b2){var _0x403154=JSON['parse'](_0x19e5b2);if(_0x403154[_0xbd17('0x1d')]){_0x4e861a[_0xbd17('0x1e')]=_0x403154[_0xbd17('0x1d')];logger[_0xbd17('0x1f')](util[_0xbd17('0x20')](_0xbd17('0x21'),_0x4e861a[_0xbd17('0x22')],_0x4e861a['id']));}else{logger[_0xbd17('0x23')](util[_0xbd17('0x20')](_0xbd17('0x24'),_0x4e861a[_0xbd17('0x22')],_0x4e861a['id']),util[_0xbd17('0x25')](_0x403154,{'showHidden':![],'depth':null}));}return _0x421ded(null,_0x5503e8);})[_0xbd17('0x26')](function(_0x56883e){logger[_0xbd17('0x23')](util[_0xbd17('0x20')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4e861a[_0xbd17('0x22')],_0x4e861a['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x421ded(_0x56883e);});}else{return _0x421ded(null,_0x5503e8);}},'beforeUpdate':function(_0x2dd7d0,_0x367f05,_0x95004f){if(_0x2dd7d0[_0xbd17('0xb')](_0xbd17('0xc'))||_0x2dd7d0[_0xbd17('0xb')](_0xbd17('0xd'))||_0x2dd7d0[_0xbd17('0xb')]('clientId')||_0x2dd7d0[_0xbd17('0xb')](_0xbd17('0xf'))||_0x2dd7d0['changed']('code')||_0x2dd7d0[_0xbd17('0xb')](_0xbd17('0x10'))){var _0x4806b1,_0x1bd4f6;_0x4806b1=_0x2dd7d0['serverUrl'];var _0x284727=_0x4806b1[_0xbd17('0x11')](-0x1);if(_0x284727==='/'||_0x284727==='\x5c'||_0x284727===':'){_0x4806b1=_0x4806b1[_0xbd17('0x12')](0x0,_0x4806b1[_0xbd17('0x13')](_0x284727));}switch(_0x2dd7d0[_0xbd17('0xc')]){case'US':_0x1bd4f6='https://accounts.zoho.com';break;case'AU':_0x1bd4f6='https://accounts.zoho.com.au';break;case'IN':_0x1bd4f6=_0xbd17('0x16');break;case'CN':_0x1bd4f6=_0xbd17('0x17');break;default:_0x1bd4f6=_0xbd17('0x18');break;}var _0x1e4b2e={'method':_0xbd17('0x19'),'uri':_0x1bd4f6+_0xbd17('0x1a'),'form':{'grant_type':'authorization_code','client_id':_0x2dd7d0['clientId'],'client_secret':_0x2dd7d0[_0xbd17('0xf')],'redirect_uri':_0x2dd7d0[_0xbd17('0xd')],'code':_0x2dd7d0[_0xbd17('0x27')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x1e4b2e)[_0xbd17('0x28')](function(_0x4ba9f7){var _0x4174e9=JSON[_0xbd17('0x29')](_0x4ba9f7);if(_0x4174e9[_0xbd17('0x1d')]){_0x2dd7d0[_0xbd17('0x1e')]=_0x4174e9[_0xbd17('0x1d')];logger[_0xbd17('0x1f')](util['format'](_0xbd17('0x21'),_0x2dd7d0[_0xbd17('0x22')],_0x2dd7d0['id']));}else{logger['error'](util[_0xbd17('0x20')](_0xbd17('0x24'),_0x2dd7d0[_0xbd17('0x22')],_0x2dd7d0['id']),util[_0xbd17('0x25')](_0x4174e9,{'showHidden':![],'depth':null}));}return _0x95004f(null,_0x367f05);})['catch'](function(_0xfc291d){logger['error'](util['format'](_0xbd17('0x24'),_0x2dd7d0[_0xbd17('0x22')],_0x2dd7d0['id']),util[_0xbd17('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x95004f(_0xfc291d);});}else{return _0x95004f(null,_0x367f05);}}}});};
\ No newline at end of file
+var _0x0d72=['substring','lastIndexOf','zone','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','inspect','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','code','slice'];(function(_0x2be5b0,_0xa6650){var _0xa2d01d=function(_0x3eaa24){while(--_0x3eaa24){_0x2be5b0['push'](_0x2be5b0['shift']());}};_0xa2d01d(++_0xa6650);}(_0x0d72,0x1ba));var _0x20d7=function(_0x1f4b2e,_0x5892a4){_0x1f4b2e=_0x1f4b2e-0x0;var _0x371558=_0x0d72[_0x1f4b2e];return _0x371558;};'use strict';var _=require(_0x20d7('0x0'));var util=require(_0x20d7('0x1'));var logger=require(_0x20d7('0x2'))(_0x20d7('0x3'));var moment=require(_0x20d7('0x4'));var BPromise=require(_0x20d7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x20d7('0x6'));var rimraf=require('rimraf');var config=require(_0x20d7('0x7'));var attributes=require(_0x20d7('0x8'));var integrations=require(_0x20d7('0x9'));module[_0x20d7('0xa')]=function(_0x587509,_0xc1ce40){return _0x587509[_0x20d7('0xb')](_0x20d7('0xc'),attributes,{'tableName':_0x20d7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1f89e4,_0x7404af,_0x2d9bdf){if(_0x1f89e4['changed']('zone')||_0x1f89e4[_0x20d7('0xe')](_0x20d7('0xf'))||_0x1f89e4[_0x20d7('0xe')](_0x20d7('0x10'))||_0x1f89e4[_0x20d7('0xe')](_0x20d7('0x11'))||_0x1f89e4[_0x20d7('0xe')](_0x20d7('0x12'))||_0x1f89e4['changed']('host')){var _0x626659,_0x369999;_0x626659=_0x1f89e4[_0x20d7('0xf')];var _0x33bb7e=_0x626659[_0x20d7('0x13')](-0x1);if(_0x33bb7e==='/'||_0x33bb7e==='\x5c'||_0x33bb7e===':'){_0x626659=_0x626659[_0x20d7('0x14')](0x0,_0x626659[_0x20d7('0x15')](_0x33bb7e));}switch(_0x1f89e4[_0x20d7('0x16')]){case'US':_0x369999='https://accounts.zoho.com';break;case'AU':_0x369999='https://accounts.zoho.com.au';break;case'IN':_0x369999='https://accounts.zoho.in';break;case'CN':_0x369999='https://accounts.zoho.com.cn';break;default:_0x369999=_0x20d7('0x17');break;}var _0x227c65={'method':_0x20d7('0x18'),'uri':_0x369999+_0x20d7('0x19'),'form':{'grant_type':_0x20d7('0x1a'),'client_id':_0x1f89e4[_0x20d7('0x10')],'client_secret':_0x1f89e4[_0x20d7('0x11')],'redirect_uri':_0x1f89e4[_0x20d7('0xf')],'code':_0x1f89e4[_0x20d7('0x12')]},'headers':{'Content-Type':_0x20d7('0x1b')}};return rp(_0x227c65)[_0x20d7('0x1c')](function(_0x4f64d3){var _0x5e2b40=JSON[_0x20d7('0x1d')](_0x4f64d3);if(_0x5e2b40[_0x20d7('0x1e')]){_0x1f89e4[_0x20d7('0x1f')]=_0x5e2b40['refresh_token'];logger[_0x20d7('0x20')](util[_0x20d7('0x21')](_0x20d7('0x22'),_0x1f89e4[_0x20d7('0x23')],_0x1f89e4['id']));}else{logger[_0x20d7('0x24')](util[_0x20d7('0x21')](_0x20d7('0x25'),_0x1f89e4[_0x20d7('0x23')],_0x1f89e4['id']),util['inspect'](_0x5e2b40,{'showHidden':![],'depth':null}));}return _0x2d9bdf(null,_0x7404af);})[_0x20d7('0x26')](function(_0x25a930){logger[_0x20d7('0x24')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1f89e4['name'],_0x1f89e4['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x2d9bdf(_0x25a930);});}else{return _0x2d9bdf(null,_0x7404af);}},'beforeUpdate':function(_0xf44dda,_0x20acf5,_0x572bd7){if(_0xf44dda[_0x20d7('0xe')](_0x20d7('0x16'))||_0xf44dda[_0x20d7('0xe')](_0x20d7('0xf'))||_0xf44dda[_0x20d7('0xe')](_0x20d7('0x10'))||_0xf44dda['changed'](_0x20d7('0x11'))||_0xf44dda[_0x20d7('0xe')](_0x20d7('0x12'))||_0xf44dda[_0x20d7('0xe')]('host')){var _0x8ba88f,_0x35bc96;_0x8ba88f=_0xf44dda[_0x20d7('0xf')];var _0x507f08=_0x8ba88f[_0x20d7('0x13')](-0x1);if(_0x507f08==='/'||_0x507f08==='\x5c'||_0x507f08===':'){_0x8ba88f=_0x8ba88f[_0x20d7('0x14')](0x0,_0x8ba88f[_0x20d7('0x15')](_0x507f08));}switch(_0xf44dda[_0x20d7('0x16')]){case'US':_0x35bc96='https://accounts.zoho.com';break;case'AU':_0x35bc96=_0x20d7('0x27');break;case'IN':_0x35bc96='https://accounts.zoho.in';break;case'CN':_0x35bc96=_0x20d7('0x28');break;default:_0x35bc96='https://accounts.zoho.eu';break;}var _0x3daa9d={'method':_0x20d7('0x18'),'uri':_0x35bc96+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0xf44dda[_0x20d7('0x10')],'client_secret':_0xf44dda[_0x20d7('0x11')],'redirect_uri':_0xf44dda['serverUrl'],'code':_0xf44dda[_0x20d7('0x12')]},'headers':{'Content-Type':_0x20d7('0x1b')}};return rp(_0x3daa9d)[_0x20d7('0x1c')](function(_0x4d9888){var _0x312ed9=JSON[_0x20d7('0x1d')](_0x4d9888);if(_0x312ed9[_0x20d7('0x1e')]){_0xf44dda[_0x20d7('0x1f')]=_0x312ed9[_0x20d7('0x1e')];logger[_0x20d7('0x20')](util[_0x20d7('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0xf44dda['name'],_0xf44dda['id']));}else{logger[_0x20d7('0x24')](util[_0x20d7('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0xf44dda[_0x20d7('0x23')],_0xf44dda['id']),util[_0x20d7('0x29')](_0x312ed9,{'showHidden':![],'depth':null}));}return _0x572bd7(null,_0x20acf5);})[_0x20d7('0x26')](function(_0x21c495){logger[_0x20d7('0x24')](util[_0x20d7('0x21')](_0x20d7('0x25'),_0xf44dda[_0x20d7('0x23')],_0xf44dda['id']),util[_0x20d7('0x29')](parsedResult,{'showHidden':![],'depth':null}));return _0x572bd7(_0x21c495);});}else{return _0x572bd7(null,_0x20acf5);}}}});};
\ No newline at end of file
index e1c3a2a..f57deaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1f1=['where','include','map','model','attributes','GetZohoAccount','find','ShowZohoAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','ZohoAccount,\x20%s,\x20%s','result','catch','ZohoAccount','raw','options'];(function(_0x454e6d,_0x1e1f38){var _0x4bc294=function(_0x2c803a){while(--_0x2c803a){_0x454e6d['push'](_0x454e6d['shift']());}};_0x4bc294(++_0x1e1f38);}(_0xd1f1,0xbc));var _0x1d1f=function(_0x4d3681,_0x136f19){_0x4d3681=_0x4d3681-0x0;var _0x22c7ac=_0xd1f1[_0x4d3681];return _0x22c7ac;};'use strict';var _=require(_0x1d1f('0x0'));var util=require(_0x1d1f('0x1'));var moment=require('moment');var BPromise=require(_0x1d1f('0x2'));var rs=require(_0x1d1f('0x3'));var fs=require('fs');var Redis=require(_0x1d1f('0x4'));var db=require(_0x1d1f('0x5'))['db'];var utils=require(_0x1d1f('0x6'));var logger=require(_0x1d1f('0x7'))(_0x1d1f('0x8'));var config=require('../../config/environment');var jayson=require(_0x1d1f('0x9'));var client=jayson[_0x1d1f('0xa')][_0x1d1f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x188cc3,_0x30a1f2,_0x5228f4){return new BPromise(function(_0x4836b3,_0x4d9d5e){return client[_0x1d1f('0xc')](_0x188cc3,_0x5228f4)[_0x1d1f('0xd')](function(_0xfae470){logger[_0x1d1f('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x30a1f2,_0x1d1f('0xf'));logger[_0x1d1f('0x10')](_0x1d1f('0x11'),_0x30a1f2,_0x1d1f('0xf'),JSON[_0x1d1f('0x12')](_0xfae470));if(_0xfae470['error']){if(_0xfae470['error'][_0x1d1f('0x13')]===0x1f4){logger[_0x1d1f('0x14')]('ZohoAccount,\x20%s,\x20%s',_0x30a1f2,_0xfae470[_0x1d1f('0x14')][_0x1d1f('0x15')]);return _0x4d9d5e(_0xfae470[_0x1d1f('0x14')][_0x1d1f('0x15')]);}logger['error'](_0x1d1f('0x16'),_0x30a1f2,_0xfae470[_0x1d1f('0x14')][_0x1d1f('0x15')]);return _0x4836b3(_0xfae470[_0x1d1f('0x14')][_0x1d1f('0x15')]);}else{logger[_0x1d1f('0xe')](_0x1d1f('0x16'),_0x30a1f2,_0x1d1f('0xf'));_0x4836b3(_0xfae470[_0x1d1f('0x17')][_0x1d1f('0x15')]);}})[_0x1d1f('0x18')](function(_0xf9fb3c){logger[_0x1d1f('0x14')](_0x1d1f('0x16'),_0x30a1f2,_0xf9fb3c);_0x4d9d5e(_0xf9fb3c);});});}exports['GetZohoAccount']=function(_0x53ff5f){var _0x498fd0=this;return new Promise(function(_0x2a5507,_0x5d37c9){return db[_0x1d1f('0x19')]['findAll']({'raw':_0x53ff5f['options']?_0x53ff5f['options'][_0x1d1f('0x1a')]===undefined?!![]:![]:!![],'where':_0x53ff5f['options']?_0x53ff5f[_0x1d1f('0x1b')][_0x1d1f('0x1c')]||null:null,'attributes':_0x53ff5f[_0x1d1f('0x1b')]?_0x53ff5f[_0x1d1f('0x1b')]['attributes']||null:null,'limit':_0x53ff5f['options']?_0x53ff5f[_0x1d1f('0x1b')]['limit']||null:null,'include':_0x53ff5f[_0x1d1f('0x1b')]?_0x53ff5f[_0x1d1f('0x1b')][_0x1d1f('0x1d')]?_[_0x1d1f('0x1e')](_0x53ff5f[_0x1d1f('0x1b')][_0x1d1f('0x1d')],function(_0x4d406c){return{'model':db[_0x4d406c[_0x1d1f('0x1f')]],'as':_0x4d406c['as'],'attributes':_0x4d406c[_0x1d1f('0x20')],'include':_0x4d406c['include']?_[_0x1d1f('0x1e')](_0x4d406c[_0x1d1f('0x1d')],function(_0x2aabc7){return{'model':db[_0x2aabc7['model']],'as':_0x2aabc7['as'],'attributes':_0x2aabc7[_0x1d1f('0x20')],'include':_0x2aabc7[_0x1d1f('0x1d')]?_[_0x1d1f('0x1e')](_0x2aabc7['include'],function(_0x238db7){return{'model':db[_0x238db7[_0x1d1f('0x1f')]],'as':_0x238db7['as'],'attributes':_0x238db7[_0x1d1f('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x20f673){logger[_0x1d1f('0xe')](_0x1d1f('0x21'),_0x53ff5f);logger[_0x1d1f('0x10')](_0x1d1f('0x21'),_0x53ff5f,JSON['stringify'](_0x20f673));_0x2a5507(_0x20f673);})['catch'](function(_0x2cc444){logger[_0x1d1f('0x14')](_0x1d1f('0x21'),_0x2cc444['message'],_0x53ff5f);_0x5d37c9(_0x498fd0[_0x1d1f('0x14')](0x1f4,_0x2cc444[_0x1d1f('0x15')]));});});};exports['ShowZohoAccount']=function(_0xf52cb8){var _0x320eb8=this;return new Promise(function(_0x522679,_0x964df1){return db[_0x1d1f('0x19')][_0x1d1f('0x22')]({'raw':_0xf52cb8[_0x1d1f('0x1b')]?_0xf52cb8[_0x1d1f('0x1b')][_0x1d1f('0x1a')]===undefined?!![]:![]:!![],'where':_0xf52cb8[_0x1d1f('0x1b')]?_0xf52cb8[_0x1d1f('0x1b')][_0x1d1f('0x1c')]||null:null,'attributes':_0xf52cb8['options']?_0xf52cb8[_0x1d1f('0x1b')]['attributes']||null:null,'include':_0xf52cb8[_0x1d1f('0x1b')]?_0xf52cb8['options']['include']?_['map'](_0xf52cb8[_0x1d1f('0x1b')][_0x1d1f('0x1d')],function(_0xc5bdc1){return{'model':db[_0xc5bdc1[_0x1d1f('0x1f')]],'as':_0xc5bdc1['as'],'attributes':_0xc5bdc1[_0x1d1f('0x20')],'include':_0xc5bdc1['include']?_[_0x1d1f('0x1e')](_0xc5bdc1[_0x1d1f('0x1d')],function(_0x22ba63){return{'model':db[_0x22ba63[_0x1d1f('0x1f')]],'as':_0x22ba63['as'],'attributes':_0x22ba63[_0x1d1f('0x20')],'include':_0x22ba63[_0x1d1f('0x1d')]?_[_0x1d1f('0x1e')](_0x22ba63[_0x1d1f('0x1d')],function(_0x20d704){return{'model':db[_0x20d704['model']],'as':_0x20d704['as'],'attributes':_0x20d704[_0x1d1f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1d1f('0xd')](function(_0x2859db){logger[_0x1d1f('0xe')]('ShowZohoAccount',_0xf52cb8);logger[_0x1d1f('0x10')](_0x1d1f('0x23'),_0xf52cb8,JSON[_0x1d1f('0x12')](_0x2859db));_0x522679(_0x2859db);})[_0x1d1f('0x18')](function(_0xe1609){logger['error']('ShowZohoAccount',_0xe1609[_0x1d1f('0x15')],_0xf52cb8);_0x964df1(_0x320eb8[_0x1d1f('0x14')](0x1f4,_0xe1609[_0x1d1f('0x15')]));});});};
\ No newline at end of file
+var _0x5d4e=['jayson/promise','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','attributes','limit','include','map','model','where','ShowZohoAccount','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x25389b,_0x3197de){var _0x38b504=function(_0x6aba03){while(--_0x6aba03){_0x25389b['push'](_0x25389b['shift']());}};_0x38b504(++_0x3197de);}(_0x5d4e,0x138));var _0xe5d4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5d4e[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xe5d4('0x0'));var moment=require(_0xe5d4('0x1'));var BPromise=require(_0xe5d4('0x2'));var rs=require(_0xe5d4('0x3'));var fs=require('fs');var Redis=require(_0xe5d4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe5d4('0x5'));var logger=require(_0xe5d4('0x6'))(_0xe5d4('0x7'));var config=require('../../config/environment');var jayson=require(_0xe5d4('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ecca3,_0x304a0b,_0x262b90){return new BPromise(function(_0x2d416d,_0x1b332f){return client[_0xe5d4('0x9')](_0x5ecca3,_0x262b90)[_0xe5d4('0xa')](function(_0xf7fa11){logger[_0xe5d4('0xb')](_0xe5d4('0xc'),_0x304a0b,_0xe5d4('0xd'));logger[_0xe5d4('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x304a0b,'request\x20sent',JSON[_0xe5d4('0xf')](_0xf7fa11));if(_0xf7fa11[_0xe5d4('0x10')]){if(_0xf7fa11[_0xe5d4('0x10')][_0xe5d4('0x11')]===0x1f4){logger[_0xe5d4('0x10')](_0xe5d4('0xc'),_0x304a0b,_0xf7fa11[_0xe5d4('0x10')][_0xe5d4('0x12')]);return _0x1b332f(_0xf7fa11[_0xe5d4('0x10')]['message']);}logger['error'](_0xe5d4('0xc'),_0x304a0b,_0xf7fa11[_0xe5d4('0x10')]['message']);return _0x2d416d(_0xf7fa11[_0xe5d4('0x10')][_0xe5d4('0x12')]);}else{logger[_0xe5d4('0xb')](_0xe5d4('0xc'),_0x304a0b,_0xe5d4('0xd'));_0x2d416d(_0xf7fa11[_0xe5d4('0x13')][_0xe5d4('0x12')]);}})[_0xe5d4('0x14')](function(_0x274b83){logger[_0xe5d4('0x10')](_0xe5d4('0xc'),_0x304a0b,_0x274b83);_0x1b332f(_0x274b83);});});}exports[_0xe5d4('0x15')]=function(_0x915fb7){var _0x3a926a=this;return new Promise(function(_0x435782,_0xde81d2){return db[_0xe5d4('0x16')][_0xe5d4('0x17')]({'raw':_0x915fb7[_0xe5d4('0x18')]?_0x915fb7[_0xe5d4('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x915fb7[_0xe5d4('0x18')]?_0x915fb7[_0xe5d4('0x18')]['where']||null:null,'attributes':_0x915fb7[_0xe5d4('0x18')]?_0x915fb7[_0xe5d4('0x18')][_0xe5d4('0x19')]||null:null,'limit':_0x915fb7[_0xe5d4('0x18')]?_0x915fb7[_0xe5d4('0x18')][_0xe5d4('0x1a')]||null:null,'include':_0x915fb7['options']?_0x915fb7['options'][_0xe5d4('0x1b')]?_[_0xe5d4('0x1c')](_0x915fb7['options'][_0xe5d4('0x1b')],function(_0x357161){return{'model':db[_0x357161['model']],'as':_0x357161['as'],'attributes':_0x357161['attributes'],'include':_0x357161[_0xe5d4('0x1b')]?_[_0xe5d4('0x1c')](_0x357161[_0xe5d4('0x1b')],function(_0xb79648){return{'model':db[_0xb79648[_0xe5d4('0x1d')]],'as':_0xb79648['as'],'attributes':_0xb79648[_0xe5d4('0x19')],'include':_0xb79648[_0xe5d4('0x1b')]?_[_0xe5d4('0x1c')](_0xb79648['include'],function(_0x436d08){return{'model':db[_0x436d08[_0xe5d4('0x1d')]],'as':_0x436d08['as'],'attributes':_0x436d08[_0xe5d4('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf48273){logger[_0xe5d4('0xb')](_0xe5d4('0x15'),_0x915fb7);logger[_0xe5d4('0xe')](_0xe5d4('0x15'),_0x915fb7,JSON[_0xe5d4('0xf')](_0xf48273));_0x435782(_0xf48273);})['catch'](function(_0x15965d){logger[_0xe5d4('0x10')](_0xe5d4('0x15'),_0x15965d[_0xe5d4('0x12')],_0x915fb7);_0xde81d2(_0x3a926a[_0xe5d4('0x10')](0x1f4,_0x15965d[_0xe5d4('0x12')]));});});};exports['ShowZohoAccount']=function(_0x45663b){var _0xbcf569=this;return new Promise(function(_0xe546c9,_0x4fc639){return db[_0xe5d4('0x16')]['find']({'raw':_0x45663b['options']?_0x45663b['options']['raw']===undefined?!![]:![]:!![],'where':_0x45663b[_0xe5d4('0x18')]?_0x45663b[_0xe5d4('0x18')][_0xe5d4('0x1e')]||null:null,'attributes':_0x45663b[_0xe5d4('0x18')]?_0x45663b[_0xe5d4('0x18')][_0xe5d4('0x19')]||null:null,'include':_0x45663b['options']?_0x45663b['options']['include']?_['map'](_0x45663b[_0xe5d4('0x18')][_0xe5d4('0x1b')],function(_0x412872){return{'model':db[_0x412872[_0xe5d4('0x1d')]],'as':_0x412872['as'],'attributes':_0x412872['attributes'],'include':_0x412872[_0xe5d4('0x1b')]?_[_0xe5d4('0x1c')](_0x412872[_0xe5d4('0x1b')],function(_0x5dbc05){return{'model':db[_0x5dbc05[_0xe5d4('0x1d')]],'as':_0x5dbc05['as'],'attributes':_0x5dbc05[_0xe5d4('0x19')],'include':_0x5dbc05[_0xe5d4('0x1b')]?_[_0xe5d4('0x1c')](_0x5dbc05[_0xe5d4('0x1b')],function(_0x278484){return{'model':db[_0x278484[_0xe5d4('0x1d')]],'as':_0x278484['as'],'attributes':_0x278484[_0xe5d4('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe5d4('0xa')](function(_0x5d9e7b){logger[_0xe5d4('0xb')](_0xe5d4('0x1f'),_0x45663b);logger[_0xe5d4('0xe')](_0xe5d4('0x1f'),_0x45663b,JSON['stringify'](_0x5d9e7b));_0xe546c9(_0x5d9e7b);})[_0xe5d4('0x14')](function(_0x101be3){logger[_0xe5d4('0x10')](_0xe5d4('0x1f'),_0x101be3[_0xe5d4('0x12')],_0x45663b);_0x4fc639(_0xbcf569['error'](0x1f4,_0x101be3['message']));});});};
\ No newline at end of file
index b05e5c8..0521c06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80ee=['exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','create','update','delete'];(function(_0x57975f,_0x388556){var _0x4793b8=function(_0x652c05){while(--_0x652c05){_0x57975f['push'](_0x57975f['shift']());}};_0x4793b8(++_0x388556);}(_0x80ee,0x85));var _0xe80e=function(_0x292f35,_0x72e859){_0x292f35=_0x292f35-0x0;var _0x288e75=_0x80ee[_0x292f35];return _0x288e75;};'use strict';var multer=require(_0xe80e('0x0'));var util=require('util');var path=require(_0xe80e('0x1'));var timeout=require(_0xe80e('0x2'));var express=require('express');var router=express[_0xe80e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe80e('0x4'));var interaction=require(_0xe80e('0x5'));var config=require(_0xe80e('0x6'));var controller=require(_0xe80e('0x7'));router[_0xe80e('0x8')]('/',auth[_0xe80e('0x9')](),controller[_0xe80e('0xa')]);router[_0xe80e('0x8')](_0xe80e('0xb'),auth[_0xe80e('0x9')](),controller[_0xe80e('0xc')]);router[_0xe80e('0x8')](_0xe80e('0xd'),auth[_0xe80e('0x9')](),controller[_0xe80e('0xe')]);router[_0xe80e('0x8')]('/:id/subjects',auth[_0xe80e('0x9')](),controller[_0xe80e('0xf')]);router[_0xe80e('0x8')](_0xe80e('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xe80e('0x11')]('/',auth['isAuthenticated'](),controller[_0xe80e('0x12')]);router['put'](_0xe80e('0xb'),auth[_0xe80e('0x9')](),controller[_0xe80e('0x13')]);router[_0xe80e('0x14')]('/:id',auth[_0xe80e('0x9')](),controller['destroy']);module[_0xe80e('0x15')]=router;
\ No newline at end of file
+var _0x7086=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7086,0x129));var _0x6708=function(_0x49b718,_0x21bb2c){_0x49b718=_0x49b718-0x0;var _0x279e6b=_0x7086[_0x49b718];return _0x279e6b;};'use strict';var multer=require(_0x6708('0x0'));var util=require('util');var path=require(_0x6708('0x1'));var timeout=require(_0x6708('0x2'));var express=require(_0x6708('0x3'));var router=express[_0x6708('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6708('0x5'));var interaction=require(_0x6708('0x6'));var config=require(_0x6708('0x7'));var controller=require(_0x6708('0x8'));router[_0x6708('0x9')]('/',auth[_0x6708('0xa')](),controller[_0x6708('0xb')]);router[_0x6708('0x9')](_0x6708('0xc'),auth['isAuthenticated'](),controller[_0x6708('0xd')]);router[_0x6708('0x9')](_0x6708('0xe'),auth[_0x6708('0xa')](),controller[_0x6708('0xf')]);router[_0x6708('0x9')](_0x6708('0x10'),auth[_0x6708('0xa')](),controller['getSubjects']);router[_0x6708('0x9')](_0x6708('0x11'),auth['isAuthenticated'](),controller[_0x6708('0x12')]);router['post']('/',auth[_0x6708('0xa')](),controller[_0x6708('0x13')]);router[_0x6708('0x14')](_0x6708('0xc'),auth[_0x6708('0xa')](),controller[_0x6708('0x15')]);router[_0x6708('0x16')]('/:id',auth[_0x6708('0xa')](),controller[_0x6708('0x17')]);module[_0x6708('0x18')]=router;
\ No newline at end of file
index b4991f0..70c855d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf9d=['contact','nothing','contact_lead','sequelize','STRING','ENUM','lead'];(function(_0x996bc8,_0x291e01){var _0x20b0ea=function(_0x5ba992){while(--_0x5ba992){_0x996bc8['push'](_0x996bc8['shift']());}};_0x20b0ea(++_0x291e01);}(_0xbf9d,0xf1));var _0xdbf9=function(_0x3c54d1,_0x430499){_0x3c54d1=_0x3c54d1-0x0;var _0x127c02=_0xbf9d[_0x3c54d1];return _0x127c02;};'use strict';var Sequelize=require(_0xdbf9('0x0'));module['exports']={'name':{'type':Sequelize[_0xdbf9('0x1')]},'moduleCreate':{'type':Sequelize[_0xdbf9('0x2')](_0xdbf9('0x3'),_0xdbf9('0x4'),_0xdbf9('0x5')),'defaultValue':_0xdbf9('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0xdbf9('0x6'),_0xdbf9('0x4'),'lead'),'defaultValue':_0xdbf9('0x6')},'description':{'type':Sequelize[_0xdbf9('0x1')]}};
\ No newline at end of file
+var _0x52fa=['STRING','contact','nothing','contact_lead','sequelize','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x52fa,0x82));var _0xa52f=function(_0x4690c0,_0x5b454b){_0x4690c0=_0x4690c0-0x0;var _0x2d96c3=_0x52fa[_0x4690c0];return _0x2d96c3;};'use strict';var Sequelize=require(_0xa52f('0x0'));module[_0xa52f('0x1')]={'name':{'type':Sequelize[_0xa52f('0x2')]},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0xa52f('0x3'),_0xa52f('0x4')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize['ENUM'](_0xa52f('0x5'),_0xa52f('0x3'),'lead'),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xa52f('0x2')]}};
\ No newline at end of file
index f51530f..4d4a138 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3921=['create','body','update','destroy','getFields','filter','getSubjects','findOne','ZohoField','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','json','offset','undefined','limit','count','status','set','apply','reject','save','then','end','sendStatus','error','name','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','include','rows','catch','show','params','includeAll','find'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3921,0x186));var _0x1392=function(_0x1ede29,_0xad1ca1){_0x1ede29=_0x1ede29-0x0;var _0xb5285e=_0x3921[_0x1ede29];return _0xb5285e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1392('0x0'));var zipdir=require(_0x1392('0x1'));var jsonpatch=require(_0x1392('0x2'));var rp=require('request-promise');var moment=require(_0x1392('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1392('0x4'));var path=require(_0x1392('0x5'));var sox=require(_0x1392('0x6'));var csv=require(_0x1392('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1392('0x8'));var _=require(_0x1392('0x9'));var squel=require(_0x1392('0xa'));var crypto=require(_0x1392('0xb'));var jsforce=require(_0x1392('0xc'));var deskjs=require(_0x1392('0xd'));var toCsv=require(_0x1392('0x7'));var querystring=require(_0x1392('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1392('0xf'));var hardwareService=require(_0x1392('0x10'));var logger=require('../../config/logger')(_0x1392('0x11'));var utils=require(_0x1392('0x12'));var config=require(_0x1392('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x145b15,_0x3a91b9){_0x3a91b9=_0x3a91b9||0xcc;return function(_0x351416){if(_0x351416){return _0x145b15['sendStatus'](_0x3a91b9);}return _0x145b15['status'](_0x3a91b9)['end']();};}function respondWithResult(_0x1202e0,_0x51d170){_0x51d170=_0x51d170||0xc8;return function(_0x18e2d9){if(_0x18e2d9){return _0x1202e0['status'](_0x51d170)[_0x1392('0x14')](_0x18e2d9);}};}function respondWithFilteredResult(_0x930844,_0x1e61c7){return function(_0x3907d3){if(_0x3907d3){var _0x34b634=typeof _0x1e61c7[_0x1392('0x15')]===_0x1392('0x16')&&typeof _0x1e61c7[_0x1392('0x17')]===_0x1392('0x16');var _0x4d3538=_0x3907d3['count'];var _0x26acd5=_0x34b634?0x0:_0x1e61c7[_0x1392('0x15')];var _0x6a6876=_0x34b634?_0x3907d3[_0x1392('0x18')]:_0x1e61c7[_0x1392('0x15')]+_0x1e61c7[_0x1392('0x17')];var _0x2ef125;if(_0x6a6876>=_0x4d3538){_0x6a6876=_0x4d3538;_0x2ef125=0xc8;}else{_0x2ef125=0xce;}_0x930844[_0x1392('0x19')](_0x2ef125);return _0x930844[_0x1392('0x1a')]('Content-Range',_0x26acd5+'-'+_0x6a6876+'/'+_0x4d3538)[_0x1392('0x14')](_0x3907d3);}return null;};}function patchUpdates(_0x249333){return function(_0x28d522){try{jsonpatch[_0x1392('0x1b')](_0x28d522,_0x249333,!![]);}catch(_0x543e6d){return BPromise[_0x1392('0x1c')](_0x543e6d);}return _0x28d522[_0x1392('0x1d')]();};}function saveUpdates(_0x3007c9,_0x437511){return function(_0x50f999){if(_0x50f999){return _0x50f999['update'](_0x3007c9)[_0x1392('0x1e')](function(_0x2676af){return _0x2676af;});}return null;};}function removeEntity(_0x15fd3b,_0x106d88){return function(_0x166e4b){if(_0x166e4b){return _0x166e4b['destroy']()['then'](function(){_0x15fd3b['status'](0xcc)[_0x1392('0x1f')]();});}};}function handleEntityNotFound(_0x441802,_0x1a1cbe){return function(_0x22a7bc){if(!_0x22a7bc){_0x441802[_0x1392('0x20')](0x194);}return _0x22a7bc;};}function handleError(_0x1850be,_0x37cd18){_0x37cd18=_0x37cd18||0x1f4;return function(_0x3fe54a){logger[_0x1392('0x21')](_0x3fe54a['stack']);if(_0x3fe54a['name']){delete _0x3fe54a[_0x1392('0x22')];}_0x1850be['status'](_0x37cd18)['send'](_0x3fe54a);};}exports[_0x1392('0x23')]=function(_0x323391,_0x4bbd70){var _0xff974d={},_0x5013b7={},_0x80f675={'count':0x0,'rows':[]};var _0x1d403b=_[_0x1392('0x24')](db[_0x1392('0x25')][_0x1392('0x26')],function(_0x1d669c){return{'name':_0x1d669c[_0x1392('0x27')],'type':_0x1d669c[_0x1392('0x28')][_0x1392('0x29')]};});_0x5013b7[_0x1392('0x2a')]=_['map'](_0x1d403b,_0x1392('0x22'));_0x5013b7[_0x1392('0x2b')]=_[_0x1392('0x2c')](_0x323391[_0x1392('0x2b')]);_0x5013b7[_0x1392('0x2d')]=_['intersection'](_0x5013b7['model'],_0x5013b7[_0x1392('0x2b')]);_0xff974d['attributes']=_[_0x1392('0x2e')](_0x5013b7['model'],qs['fields'](_0x323391[_0x1392('0x2b')][_0x1392('0x2f')]));_0xff974d['attributes']=_0xff974d['attributes'][_0x1392('0x30')]?_0xff974d[_0x1392('0x31')]:_0x5013b7['model'];if(!_0x323391[_0x1392('0x2b')][_0x1392('0x32')](_0x1392('0x33'))){_0xff974d['limit']=qs[_0x1392('0x17')](_0x323391[_0x1392('0x2b')][_0x1392('0x17')]);_0xff974d[_0x1392('0x15')]=qs[_0x1392('0x15')](_0x323391[_0x1392('0x2b')]['offset']);}_0xff974d[_0x1392('0x34')]=qs[_0x1392('0x35')](_0x323391['query'][_0x1392('0x35')]);_0xff974d[_0x1392('0x36')]=qs['filters'](_[_0x1392('0x37')](_0x323391[_0x1392('0x2b')],_0x5013b7['filters']),_0x1d403b);if(_0x323391['query']['filter']){_0xff974d[_0x1392('0x36')]=_['merge'](_0xff974d['where'],{'$or':_['map'](_0x1d403b,function(_0x29a079){if(_0x29a079[_0x1392('0x28')]!==_0x1392('0x38')){var _0x1528bf={};_0x1528bf[_0x29a079['name']]={'$like':'%'+_0x323391[_0x1392('0x2b')]['filter']+'%'};return _0x1528bf;}})});}_0xff974d=_[_0x1392('0x39')]({},_0xff974d,_0x323391[_0x1392('0x3a')]);var _0x17e851={'where':_0xff974d[_0x1392('0x36')]};return db['ZohoConfiguration']['count'](_0x17e851)['then'](function(_0xe39d39){_0x80f675['count']=_0xe39d39;if(_0x323391[_0x1392('0x2b')]['includeAll']){_0xff974d[_0x1392('0x3b')]=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0xff974d);})[_0x1392('0x1e')](function(_0x474cbd){_0x80f675[_0x1392('0x3c')]=_0x474cbd;return _0x80f675;})[_0x1392('0x1e')](respondWithFilteredResult(_0x4bbd70,_0xff974d))[_0x1392('0x3d')](handleError(_0x4bbd70,null));};exports[_0x1392('0x3e')]=function(_0x36752a,_0xe669b9){var _0x46d4be={'raw':![],'where':{'id':_0x36752a[_0x1392('0x3f')]['id']}},_0x5b87be={};_0x5b87be[_0x1392('0x2a')]=_[_0x1392('0x2c')](db[_0x1392('0x25')][_0x1392('0x26')]);_0x5b87be[_0x1392('0x2b')]=_[_0x1392('0x2c')](_0x36752a[_0x1392('0x2b')]);_0x5b87be[_0x1392('0x2d')]=_[_0x1392('0x2e')](_0x5b87be['model'],_0x5b87be[_0x1392('0x2b')]);_0x46d4be['attributes']=_['intersection'](_0x5b87be[_0x1392('0x2a')],qs[_0x1392('0x2f')](_0x36752a[_0x1392('0x2b')][_0x1392('0x2f')]));_0x46d4be[_0x1392('0x31')]=_0x46d4be[_0x1392('0x31')][_0x1392('0x30')]?_0x46d4be['attributes']:_0x5b87be['model'];if(_0x36752a[_0x1392('0x2b')][_0x1392('0x40')]){_0x46d4be['include']=[{'all':!![]}];}_0x46d4be=_['merge']({},_0x46d4be,_0x36752a['options']);return db[_0x1392('0x25')][_0x1392('0x41')](_0x46d4be)[_0x1392('0x1e')](handleEntityNotFound(_0xe669b9,null))[_0x1392('0x1e')](respondWithResult(_0xe669b9,null))['catch'](handleError(_0xe669b9,null));};exports['create']=function(_0x4242e4,_0x5192eb){return db[_0x1392('0x25')][_0x1392('0x42')](_0x4242e4[_0x1392('0x43')],{})['then'](respondWithResult(_0x5192eb,0xc9))[_0x1392('0x3d')](handleError(_0x5192eb,null));};exports[_0x1392('0x44')]=function(_0x16b292,_0x24e52f){if(_0x16b292['body']['id']){delete _0x16b292[_0x1392('0x43')]['id'];}return db['ZohoConfiguration'][_0x1392('0x41')]({'where':{'id':_0x16b292[_0x1392('0x3f')]['id']}})[_0x1392('0x1e')](handleEntityNotFound(_0x24e52f,null))[_0x1392('0x1e')](saveUpdates(_0x16b292[_0x1392('0x43')],null))[_0x1392('0x1e')](respondWithResult(_0x24e52f,null))[_0x1392('0x3d')](handleError(_0x24e52f,null));};exports[_0x1392('0x45')]=function(_0x3cdc02,_0x4ad71e){return db[_0x1392('0x25')][_0x1392('0x41')]({'where':{'id':_0x3cdc02[_0x1392('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4ad71e,null))[_0x1392('0x1e')](removeEntity(_0x4ad71e,null))['catch'](handleError(_0x4ad71e,null));};exports[_0x1392('0x46')]=function(_0x5c94e8,_0x2931ae,_0x17fbf5){var _0x2e1c0d={};var _0x53aca8={};var _0x5a7373;var _0x2b41b1;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x5c94e8['params']['id']}})['then'](handleEntityNotFound(_0x2931ae,null))[_0x1392('0x1e')](function(_0x4e3132){if(_0x4e3132){_0x5a7373=_0x4e3132;_0x53aca8['model']=_[_0x1392('0x2c')](db['ZohoField'][_0x1392('0x26')]);_0x53aca8[_0x1392('0x2b')]=_[_0x1392('0x2c')](_0x5c94e8[_0x1392('0x2b')]);_0x53aca8[_0x1392('0x2d')]=_[_0x1392('0x2e')](_0x53aca8[_0x1392('0x2a')],_0x53aca8[_0x1392('0x2b')]);_0x2e1c0d['attributes']=_[_0x1392('0x2e')](_0x53aca8[_0x1392('0x2a')],qs[_0x1392('0x2f')](_0x5c94e8['query'][_0x1392('0x2f')]));_0x2e1c0d['attributes']=_0x2e1c0d[_0x1392('0x31')][_0x1392('0x30')]?_0x2e1c0d[_0x1392('0x31')]:_0x53aca8[_0x1392('0x2a')];_0x2e1c0d[_0x1392('0x34')]=qs[_0x1392('0x35')](_0x5c94e8[_0x1392('0x2b')][_0x1392('0x35')]);_0x2e1c0d['where']=qs[_0x1392('0x2d')](_['pick'](_0x5c94e8[_0x1392('0x2b')],_0x53aca8[_0x1392('0x2d')]));if(_0x5c94e8[_0x1392('0x2b')]['filter']){_0x2e1c0d[_0x1392('0x36')]=_['merge'](_0x2e1c0d[_0x1392('0x36')],{'$or':_['map'](_0x2e1c0d[_0x1392('0x31')],function(_0x1d34d1){var _0x1d2ae5={};_0x1d2ae5[_0x1d34d1]={'$like':'%'+_0x5c94e8[_0x1392('0x2b')][_0x1392('0x47')]+'%'};return _0x1d2ae5;})});}_0x2e1c0d=_[_0x1392('0x39')]({},_0x2e1c0d,_0x5c94e8[_0x1392('0x3a')]);return _0x5a7373[_0x1392('0x46')](_0x2e1c0d);}})['then'](function(_0x116759){if(_0x116759){_0x2b41b1=_0x116759[_0x1392('0x30')];if(!_0x5c94e8['query'][_0x1392('0x32')]('nolimit')){_0x2e1c0d[_0x1392('0x17')]=qs[_0x1392('0x17')](_0x5c94e8[_0x1392('0x2b')][_0x1392('0x17')]);_0x2e1c0d['offset']=qs['offset'](_0x5c94e8[_0x1392('0x2b')]['offset']);}return _0x5a7373[_0x1392('0x46')](_0x2e1c0d);}})['then'](function(_0x2419a0){if(_0x2419a0){return _0x2419a0?{'count':_0x2b41b1,'rows':_0x2419a0}:null;}})[_0x1392('0x1e')](respondWithResult(_0x2931ae,null))[_0x1392('0x3d')](handleError(_0x2931ae,null));};exports[_0x1392('0x48')]=function(_0x4dfe07,_0x14bbad,_0x7849c3){var _0x41499c={};var _0x1a9eb4={};var _0x33bcd1;var _0x1b6e60;return db[_0x1392('0x25')][_0x1392('0x49')]({'where':{'id':_0x4dfe07[_0x1392('0x3f')]['id']}})[_0x1392('0x1e')](handleEntityNotFound(_0x14bbad,null))[_0x1392('0x1e')](function(_0x15d0d1){if(_0x15d0d1){_0x33bcd1=_0x15d0d1;_0x1a9eb4[_0x1392('0x2a')]=_['keys'](db[_0x1392('0x4a')]['rawAttributes']);_0x1a9eb4[_0x1392('0x2b')]=_[_0x1392('0x2c')](_0x4dfe07['query']);_0x1a9eb4['filters']=_[_0x1392('0x2e')](_0x1a9eb4[_0x1392('0x2a')],_0x1a9eb4['query']);_0x41499c[_0x1392('0x31')]=_[_0x1392('0x2e')](_0x1a9eb4[_0x1392('0x2a')],qs[_0x1392('0x2f')](_0x4dfe07[_0x1392('0x2b')]['fields']));_0x41499c[_0x1392('0x31')]=_0x41499c[_0x1392('0x31')][_0x1392('0x30')]?_0x41499c['attributes']:_0x1a9eb4[_0x1392('0x2a')];_0x41499c[_0x1392('0x34')]=qs[_0x1392('0x35')](_0x4dfe07[_0x1392('0x2b')][_0x1392('0x35')]);_0x41499c[_0x1392('0x36')]=qs[_0x1392('0x2d')](_[_0x1392('0x37')](_0x4dfe07[_0x1392('0x2b')],_0x1a9eb4[_0x1392('0x2d')]));if(_0x4dfe07['query'][_0x1392('0x47')]){_0x41499c[_0x1392('0x36')]=_[_0x1392('0x39')](_0x41499c[_0x1392('0x36')],{'$or':_[_0x1392('0x24')](_0x41499c['attributes'],function(_0x4fed6f){var _0x382918={};_0x382918[_0x4fed6f]={'$like':'%'+_0x4dfe07[_0x1392('0x2b')][_0x1392('0x47')]+'%'};return _0x382918;})});}_0x41499c=_['merge']({},_0x41499c,_0x4dfe07[_0x1392('0x3a')]);return _0x33bcd1['getSubjects'](_0x41499c);}})[_0x1392('0x1e')](function(_0x3b6d7c){if(_0x3b6d7c){_0x1b6e60=_0x3b6d7c[_0x1392('0x30')];if(!_0x4dfe07[_0x1392('0x2b')][_0x1392('0x32')](_0x1392('0x33'))){_0x41499c[_0x1392('0x17')]=qs[_0x1392('0x17')](_0x4dfe07['query'][_0x1392('0x17')]);_0x41499c[_0x1392('0x15')]=qs[_0x1392('0x15')](_0x4dfe07[_0x1392('0x2b')]['offset']);}return _0x33bcd1[_0x1392('0x48')](_0x41499c);}})[_0x1392('0x1e')](function(_0x256c29){if(_0x256c29){return _0x256c29?{'count':_0x1b6e60,'rows':_0x256c29}:null;}})[_0x1392('0x1e')](respondWithResult(_0x14bbad,null))[_0x1392('0x3d')](handleError(_0x14bbad,null));};exports['getDescriptions']=function(_0x3552ee,_0x36a35f,_0x1904ef){var _0xf0a279={};var _0x4b98bb={};var _0xa42fd5;var _0x4738fb;return db[_0x1392('0x25')][_0x1392('0x49')]({'where':{'id':_0x3552ee[_0x1392('0x3f')]['id']}})[_0x1392('0x1e')](handleEntityNotFound(_0x36a35f,null))[_0x1392('0x1e')](function(_0x5839d2){if(_0x5839d2){_0xa42fd5=_0x5839d2;_0x4b98bb[_0x1392('0x2a')]=_['keys'](db[_0x1392('0x4a')][_0x1392('0x26')]);_0x4b98bb[_0x1392('0x2b')]=_[_0x1392('0x2c')](_0x3552ee[_0x1392('0x2b')]);_0x4b98bb[_0x1392('0x2d')]=_[_0x1392('0x2e')](_0x4b98bb[_0x1392('0x2a')],_0x4b98bb['query']);_0xf0a279['attributes']=_[_0x1392('0x2e')](_0x4b98bb[_0x1392('0x2a')],qs[_0x1392('0x2f')](_0x3552ee[_0x1392('0x2b')][_0x1392('0x2f')]));_0xf0a279[_0x1392('0x31')]=_0xf0a279[_0x1392('0x31')][_0x1392('0x30')]?_0xf0a279['attributes']:_0x4b98bb[_0x1392('0x2a')];_0xf0a279[_0x1392('0x34')]=qs[_0x1392('0x35')](_0x3552ee[_0x1392('0x2b')]['sort']);_0xf0a279[_0x1392('0x36')]=qs[_0x1392('0x2d')](_[_0x1392('0x37')](_0x3552ee['query'],_0x4b98bb[_0x1392('0x2d')]));if(_0x3552ee[_0x1392('0x2b')][_0x1392('0x47')]){_0xf0a279[_0x1392('0x36')]=_['merge'](_0xf0a279[_0x1392('0x36')],{'$or':_[_0x1392('0x24')](_0xf0a279['attributes'],function(_0x472c6a){var _0x521cf5={};_0x521cf5[_0x472c6a]={'$like':'%'+_0x3552ee[_0x1392('0x2b')]['filter']+'%'};return _0x521cf5;})});}_0xf0a279=_[_0x1392('0x39')]({},_0xf0a279,_0x3552ee['options']);return _0xa42fd5[_0x1392('0x4b')](_0xf0a279);}})[_0x1392('0x1e')](function(_0x2d4ff4){if(_0x2d4ff4){_0x4738fb=_0x2d4ff4[_0x1392('0x30')];if(!_0x3552ee[_0x1392('0x2b')][_0x1392('0x32')]('nolimit')){_0xf0a279['limit']=qs['limit'](_0x3552ee[_0x1392('0x2b')][_0x1392('0x17')]);_0xf0a279[_0x1392('0x15')]=qs[_0x1392('0x15')](_0x3552ee[_0x1392('0x2b')][_0x1392('0x15')]);}return _0xa42fd5[_0x1392('0x4b')](_0xf0a279);}})[_0x1392('0x1e')](function(_0xa1112b){if(_0xa1112b){return _0xa1112b?{'count':_0x4738fb,'rows':_0xa1112b}:null;}})['then'](respondWithResult(_0x36a35f,null))[_0x1392('0x3d')](handleError(_0x36a35f,null));};
\ No newline at end of file
+var _0x2d9b=['zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','undefined','count','limit','Content-Range','json','apply','reject','update','then','sendStatus','error','stack','name','index','map','ZohoConfiguration','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','getFields','getSubjects','findOne','ZohoField','rawAttributes','nolimit','getDescriptions'];(function(_0x3c6389,_0x4cae7a){var _0x3dcfff=function(_0x38d551){while(--_0x38d551){_0x3c6389['push'](_0x3c6389['shift']());}};_0x3dcfff(++_0x4cae7a);}(_0x2d9b,0x1d4));var _0xb2d9=function(_0x1c179f,_0x5d2dfe){_0x1c179f=_0x1c179f-0x0;var _0x16fb86=_0x2d9b[_0x1c179f];return _0x16fb86;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb2d9('0x0'));var jsonpatch=require(_0xb2d9('0x1'));var rp=require(_0xb2d9('0x2'));var moment=require(_0xb2d9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb2d9('0x4'));var util=require('util');var path=require('path');var sox=require(_0xb2d9('0x5'));var csv=require(_0xb2d9('0x6'));var ejs=require(_0xb2d9('0x7'));var fs=require('fs');var fs_extra=require(_0xb2d9('0x8'));var _=require(_0xb2d9('0x9'));var squel=require(_0xb2d9('0xa'));var crypto=require(_0xb2d9('0xb'));var jsforce=require(_0xb2d9('0xc'));var deskjs=require(_0xb2d9('0xd'));var toCsv=require(_0xb2d9('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb2d9('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb2d9('0xf'));var as=require(_0xb2d9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb2d9('0x11'));var utils=require(_0xb2d9('0x12'));var config=require(_0xb2d9('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xb2d9('0x14'))['db'];function respondWithStatusCode(_0x3b2e48,_0x5d8a3b){_0x5d8a3b=_0x5d8a3b||0xcc;return function(_0x5132bd){if(_0x5132bd){return _0x3b2e48['sendStatus'](_0x5d8a3b);}return _0x3b2e48['status'](_0x5d8a3b)[_0xb2d9('0x15')]();};}function respondWithResult(_0x5e9fc8,_0x357d94){_0x357d94=_0x357d94||0xc8;return function(_0x74e36){if(_0x74e36){return _0x5e9fc8[_0xb2d9('0x16')](_0x357d94)['json'](_0x74e36);}};}function respondWithFilteredResult(_0x4b1655,_0x3b5408){return function(_0x3d7c29){if(_0x3d7c29){var _0x86dc6=typeof _0x3b5408[_0xb2d9('0x17')]===_0xb2d9('0x18')&&typeof _0x3b5408['limit']==='undefined';var _0x1d6216=_0x3d7c29[_0xb2d9('0x19')];var _0x4c86bf=_0x86dc6?0x0:_0x3b5408['offset'];var _0x43cbbd=_0x86dc6?_0x3d7c29['count']:_0x3b5408[_0xb2d9('0x17')]+_0x3b5408[_0xb2d9('0x1a')];var _0xbc4b66;if(_0x43cbbd>=_0x1d6216){_0x43cbbd=_0x1d6216;_0xbc4b66=0xc8;}else{_0xbc4b66=0xce;}_0x4b1655['status'](_0xbc4b66);return _0x4b1655['set'](_0xb2d9('0x1b'),_0x4c86bf+'-'+_0x43cbbd+'/'+_0x1d6216)[_0xb2d9('0x1c')](_0x3d7c29);}return null;};}function patchUpdates(_0x3243b4){return function(_0x4c911c){try{jsonpatch[_0xb2d9('0x1d')](_0x4c911c,_0x3243b4,!![]);}catch(_0x1a5a2a){return BPromise[_0xb2d9('0x1e')](_0x1a5a2a);}return _0x4c911c['save']();};}function saveUpdates(_0x15d569,_0x4ae2f6){return function(_0x4bb791){if(_0x4bb791){return _0x4bb791[_0xb2d9('0x1f')](_0x15d569)['then'](function(_0x4194fa){return _0x4194fa;});}return null;};}function removeEntity(_0x51e7fb,_0x1db51c){return function(_0x165dbb){if(_0x165dbb){return _0x165dbb['destroy']()[_0xb2d9('0x20')](function(){_0x51e7fb[_0xb2d9('0x16')](0xcc)[_0xb2d9('0x15')]();});}};}function handleEntityNotFound(_0x16df8a,_0x150e45){return function(_0x4ef2c3){if(!_0x4ef2c3){_0x16df8a[_0xb2d9('0x21')](0x194);}return _0x4ef2c3;};}function handleError(_0x5cd5a9,_0x420ee1){_0x420ee1=_0x420ee1||0x1f4;return function(_0x6204f9){logger[_0xb2d9('0x22')](_0x6204f9[_0xb2d9('0x23')]);if(_0x6204f9[_0xb2d9('0x24')]){delete _0x6204f9[_0xb2d9('0x24')];}_0x5cd5a9[_0xb2d9('0x16')](_0x420ee1)['send'](_0x6204f9);};}exports[_0xb2d9('0x25')]=function(_0x449506,_0x3cf227){var _0x37f557={},_0x274415={},_0x2b9dcb={'count':0x0,'rows':[]};var _0x131b43=_[_0xb2d9('0x26')](db[_0xb2d9('0x27')]['rawAttributes'],function(_0x581d69){return{'name':_0x581d69[_0xb2d9('0x28')],'type':_0x581d69[_0xb2d9('0x29')][_0xb2d9('0x2a')]};});_0x274415[_0xb2d9('0x2b')]=_[_0xb2d9('0x26')](_0x131b43,_0xb2d9('0x24'));_0x274415[_0xb2d9('0x2c')]=_[_0xb2d9('0x2d')](_0x449506[_0xb2d9('0x2c')]);_0x274415[_0xb2d9('0x2e')]=_[_0xb2d9('0x2f')](_0x274415[_0xb2d9('0x2b')],_0x274415[_0xb2d9('0x2c')]);_0x37f557['attributes']=_[_0xb2d9('0x2f')](_0x274415['model'],qs[_0xb2d9('0x30')](_0x449506[_0xb2d9('0x2c')]['fields']));_0x37f557[_0xb2d9('0x31')]=_0x37f557[_0xb2d9('0x31')]['length']?_0x37f557[_0xb2d9('0x31')]:_0x274415[_0xb2d9('0x2b')];if(!_0x449506[_0xb2d9('0x2c')][_0xb2d9('0x32')]('nolimit')){_0x37f557[_0xb2d9('0x1a')]=qs[_0xb2d9('0x1a')](_0x449506[_0xb2d9('0x2c')][_0xb2d9('0x1a')]);_0x37f557['offset']=qs[_0xb2d9('0x17')](_0x449506[_0xb2d9('0x2c')][_0xb2d9('0x17')]);}_0x37f557[_0xb2d9('0x33')]=qs[_0xb2d9('0x34')](_0x449506[_0xb2d9('0x2c')][_0xb2d9('0x34')]);_0x37f557[_0xb2d9('0x35')]=qs[_0xb2d9('0x2e')](_[_0xb2d9('0x36')](_0x449506[_0xb2d9('0x2c')],_0x274415[_0xb2d9('0x2e')]),_0x131b43);if(_0x449506[_0xb2d9('0x2c')]['filter']){_0x37f557[_0xb2d9('0x35')]=_[_0xb2d9('0x37')](_0x37f557[_0xb2d9('0x35')],{'$or':_['map'](_0x131b43,function(_0x283b04){if(_0x283b04[_0xb2d9('0x29')]!==_0xb2d9('0x38')){var _0x2a31ab={};_0x2a31ab[_0x283b04[_0xb2d9('0x24')]]={'$like':'%'+_0x449506[_0xb2d9('0x2c')][_0xb2d9('0x39')]+'%'};return _0x2a31ab;}})});}_0x37f557=_['merge']({},_0x37f557,_0x449506[_0xb2d9('0x3a')]);var _0x1d4886={'where':_0x37f557[_0xb2d9('0x35')]};return db[_0xb2d9('0x27')]['count'](_0x1d4886)['then'](function(_0xa22241){_0x2b9dcb[_0xb2d9('0x19')]=_0xa22241;if(_0x449506[_0xb2d9('0x2c')][_0xb2d9('0x3b')]){_0x37f557[_0xb2d9('0x3c')]=[{'all':!![]}];}return db[_0xb2d9('0x27')][_0xb2d9('0x3d')](_0x37f557);})[_0xb2d9('0x20')](function(_0x4c8067){_0x2b9dcb[_0xb2d9('0x3e')]=_0x4c8067;return _0x2b9dcb;})['then'](respondWithFilteredResult(_0x3cf227,_0x37f557))[_0xb2d9('0x3f')](handleError(_0x3cf227,null));};exports[_0xb2d9('0x40')]=function(_0x570ef7,_0x3a6dd9){var _0x2a218c={'raw':![],'where':{'id':_0x570ef7[_0xb2d9('0x41')]['id']}},_0x2f521d={};_0x2f521d[_0xb2d9('0x2b')]=_[_0xb2d9('0x2d')](db[_0xb2d9('0x27')]['rawAttributes']);_0x2f521d['query']=_[_0xb2d9('0x2d')](_0x570ef7[_0xb2d9('0x2c')]);_0x2f521d[_0xb2d9('0x2e')]=_[_0xb2d9('0x2f')](_0x2f521d[_0xb2d9('0x2b')],_0x2f521d[_0xb2d9('0x2c')]);_0x2a218c[_0xb2d9('0x31')]=_[_0xb2d9('0x2f')](_0x2f521d['model'],qs['fields'](_0x570ef7[_0xb2d9('0x2c')][_0xb2d9('0x30')]));_0x2a218c[_0xb2d9('0x31')]=_0x2a218c['attributes'][_0xb2d9('0x42')]?_0x2a218c[_0xb2d9('0x31')]:_0x2f521d[_0xb2d9('0x2b')];if(_0x570ef7['query']['includeAll']){_0x2a218c['include']=[{'all':!![]}];}_0x2a218c=_['merge']({},_0x2a218c,_0x570ef7[_0xb2d9('0x3a')]);return db[_0xb2d9('0x27')][_0xb2d9('0x43')](_0x2a218c)[_0xb2d9('0x20')](handleEntityNotFound(_0x3a6dd9,null))[_0xb2d9('0x20')](respondWithResult(_0x3a6dd9,null))[_0xb2d9('0x3f')](handleError(_0x3a6dd9,null));};exports[_0xb2d9('0x44')]=function(_0x50c4fd,_0x29363f){return db['ZohoConfiguration'][_0xb2d9('0x44')](_0x50c4fd[_0xb2d9('0x45')],{})[_0xb2d9('0x20')](respondWithResult(_0x29363f,0xc9))['catch'](handleError(_0x29363f,null));};exports['update']=function(_0x256e8b,_0x109e0a){if(_0x256e8b[_0xb2d9('0x45')]['id']){delete _0x256e8b['body']['id'];}return db[_0xb2d9('0x27')][_0xb2d9('0x43')]({'where':{'id':_0x256e8b[_0xb2d9('0x41')]['id']}})[_0xb2d9('0x20')](handleEntityNotFound(_0x109e0a,null))[_0xb2d9('0x20')](saveUpdates(_0x256e8b[_0xb2d9('0x45')],null))[_0xb2d9('0x20')](respondWithResult(_0x109e0a,null))[_0xb2d9('0x3f')](handleError(_0x109e0a,null));};exports[_0xb2d9('0x46')]=function(_0x1c46cf,_0x2ba107){return db['ZohoConfiguration'][_0xb2d9('0x43')]({'where':{'id':_0x1c46cf[_0xb2d9('0x41')]['id']}})[_0xb2d9('0x20')](handleEntityNotFound(_0x2ba107,null))[_0xb2d9('0x20')](removeEntity(_0x2ba107,null))[_0xb2d9('0x3f')](handleError(_0x2ba107,null));};exports[_0xb2d9('0x47')]=function(_0x26c454,_0x1e4418,_0x2dc4b1){var _0x3f7671={};var _0x6c1b0d={};var _0x31b8dc;var _0x59bdc5;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x26c454[_0xb2d9('0x41')]['id']}})[_0xb2d9('0x20')](handleEntityNotFound(_0x1e4418,null))['then'](function(_0x1e86a9){if(_0x1e86a9){_0x31b8dc=_0x1e86a9;_0x6c1b0d['model']=_['keys'](db['ZohoField']['rawAttributes']);_0x6c1b0d['query']=_[_0xb2d9('0x2d')](_0x26c454[_0xb2d9('0x2c')]);_0x6c1b0d[_0xb2d9('0x2e')]=_['intersection'](_0x6c1b0d[_0xb2d9('0x2b')],_0x6c1b0d['query']);_0x3f7671[_0xb2d9('0x31')]=_[_0xb2d9('0x2f')](_0x6c1b0d[_0xb2d9('0x2b')],qs[_0xb2d9('0x30')](_0x26c454[_0xb2d9('0x2c')]['fields']));_0x3f7671[_0xb2d9('0x31')]=_0x3f7671[_0xb2d9('0x31')]['length']?_0x3f7671['attributes']:_0x6c1b0d[_0xb2d9('0x2b')];_0x3f7671[_0xb2d9('0x33')]=qs['sort'](_0x26c454[_0xb2d9('0x2c')]['sort']);_0x3f7671[_0xb2d9('0x35')]=qs[_0xb2d9('0x2e')](_[_0xb2d9('0x36')](_0x26c454[_0xb2d9('0x2c')],_0x6c1b0d[_0xb2d9('0x2e')]));if(_0x26c454[_0xb2d9('0x2c')][_0xb2d9('0x39')]){_0x3f7671[_0xb2d9('0x35')]=_[_0xb2d9('0x37')](_0x3f7671[_0xb2d9('0x35')],{'$or':_['map'](_0x3f7671[_0xb2d9('0x31')],function(_0x4a1ae6){var _0x2c2cbb={};_0x2c2cbb[_0x4a1ae6]={'$like':'%'+_0x26c454[_0xb2d9('0x2c')]['filter']+'%'};return _0x2c2cbb;})});}_0x3f7671=_['merge']({},_0x3f7671,_0x26c454['options']);return _0x31b8dc[_0xb2d9('0x47')](_0x3f7671);}})[_0xb2d9('0x20')](function(_0x143f18){if(_0x143f18){_0x59bdc5=_0x143f18[_0xb2d9('0x42')];if(!_0x26c454[_0xb2d9('0x2c')]['hasOwnProperty']('nolimit')){_0x3f7671[_0xb2d9('0x1a')]=qs[_0xb2d9('0x1a')](_0x26c454[_0xb2d9('0x2c')]['limit']);_0x3f7671[_0xb2d9('0x17')]=qs[_0xb2d9('0x17')](_0x26c454[_0xb2d9('0x2c')][_0xb2d9('0x17')]);}return _0x31b8dc[_0xb2d9('0x47')](_0x3f7671);}})[_0xb2d9('0x20')](function(_0x389617){if(_0x389617){return _0x389617?{'count':_0x59bdc5,'rows':_0x389617}:null;}})[_0xb2d9('0x20')](respondWithResult(_0x1e4418,null))[_0xb2d9('0x3f')](handleError(_0x1e4418,null));};exports[_0xb2d9('0x48')]=function(_0x976446,_0x2ac006,_0x47a2ae){var _0x37beb1={};var _0x1bf130={};var _0x52c503;var _0x345ffc;return db[_0xb2d9('0x27')][_0xb2d9('0x49')]({'where':{'id':_0x976446[_0xb2d9('0x41')]['id']}})[_0xb2d9('0x20')](handleEntityNotFound(_0x2ac006,null))['then'](function(_0x12d59a){if(_0x12d59a){_0x52c503=_0x12d59a;_0x1bf130[_0xb2d9('0x2b')]=_[_0xb2d9('0x2d')](db[_0xb2d9('0x4a')][_0xb2d9('0x4b')]);_0x1bf130['query']=_['keys'](_0x976446[_0xb2d9('0x2c')]);_0x1bf130['filters']=_['intersection'](_0x1bf130['model'],_0x1bf130[_0xb2d9('0x2c')]);_0x37beb1[_0xb2d9('0x31')]=_[_0xb2d9('0x2f')](_0x1bf130[_0xb2d9('0x2b')],qs[_0xb2d9('0x30')](_0x976446[_0xb2d9('0x2c')][_0xb2d9('0x30')]));_0x37beb1['attributes']=_0x37beb1[_0xb2d9('0x31')][_0xb2d9('0x42')]?_0x37beb1['attributes']:_0x1bf130['model'];_0x37beb1[_0xb2d9('0x33')]=qs[_0xb2d9('0x34')](_0x976446[_0xb2d9('0x2c')]['sort']);_0x37beb1[_0xb2d9('0x35')]=qs['filters'](_[_0xb2d9('0x36')](_0x976446[_0xb2d9('0x2c')],_0x1bf130[_0xb2d9('0x2e')]));if(_0x976446[_0xb2d9('0x2c')][_0xb2d9('0x39')]){_0x37beb1[_0xb2d9('0x35')]=_[_0xb2d9('0x37')](_0x37beb1['where'],{'$or':_[_0xb2d9('0x26')](_0x37beb1[_0xb2d9('0x31')],function(_0x5db800){var _0x54b114={};_0x54b114[_0x5db800]={'$like':'%'+_0x976446[_0xb2d9('0x2c')][_0xb2d9('0x39')]+'%'};return _0x54b114;})});}_0x37beb1=_[_0xb2d9('0x37')]({},_0x37beb1,_0x976446[_0xb2d9('0x3a')]);return _0x52c503['getSubjects'](_0x37beb1);}})['then'](function(_0x28c63a){if(_0x28c63a){_0x345ffc=_0x28c63a[_0xb2d9('0x42')];if(!_0x976446['query'][_0xb2d9('0x32')](_0xb2d9('0x4c'))){_0x37beb1[_0xb2d9('0x1a')]=qs[_0xb2d9('0x1a')](_0x976446['query'][_0xb2d9('0x1a')]);_0x37beb1[_0xb2d9('0x17')]=qs[_0xb2d9('0x17')](_0x976446[_0xb2d9('0x2c')][_0xb2d9('0x17')]);}return _0x52c503['getSubjects'](_0x37beb1);}})[_0xb2d9('0x20')](function(_0x197f6a){if(_0x197f6a){return _0x197f6a?{'count':_0x345ffc,'rows':_0x197f6a}:null;}})[_0xb2d9('0x20')](respondWithResult(_0x2ac006,null))[_0xb2d9('0x3f')](handleError(_0x2ac006,null));};exports[_0xb2d9('0x4d')]=function(_0x1aa9cb,_0x321c66,_0x1765e9){var _0x22c850={};var _0xd9877f={};var _0x5199d8;var _0x5a9d06;return db['ZohoConfiguration'][_0xb2d9('0x49')]({'where':{'id':_0x1aa9cb[_0xb2d9('0x41')]['id']}})[_0xb2d9('0x20')](handleEntityNotFound(_0x321c66,null))['then'](function(_0x1f0c9f){if(_0x1f0c9f){_0x5199d8=_0x1f0c9f;_0xd9877f[_0xb2d9('0x2b')]=_[_0xb2d9('0x2d')](db['ZohoField'][_0xb2d9('0x4b')]);_0xd9877f['query']=_['keys'](_0x1aa9cb[_0xb2d9('0x2c')]);_0xd9877f[_0xb2d9('0x2e')]=_[_0xb2d9('0x2f')](_0xd9877f[_0xb2d9('0x2b')],_0xd9877f[_0xb2d9('0x2c')]);_0x22c850[_0xb2d9('0x31')]=_[_0xb2d9('0x2f')](_0xd9877f[_0xb2d9('0x2b')],qs[_0xb2d9('0x30')](_0x1aa9cb[_0xb2d9('0x2c')][_0xb2d9('0x30')]));_0x22c850[_0xb2d9('0x31')]=_0x22c850[_0xb2d9('0x31')][_0xb2d9('0x42')]?_0x22c850[_0xb2d9('0x31')]:_0xd9877f[_0xb2d9('0x2b')];_0x22c850[_0xb2d9('0x33')]=qs[_0xb2d9('0x34')](_0x1aa9cb[_0xb2d9('0x2c')][_0xb2d9('0x34')]);_0x22c850[_0xb2d9('0x35')]=qs[_0xb2d9('0x2e')](_['pick'](_0x1aa9cb[_0xb2d9('0x2c')],_0xd9877f[_0xb2d9('0x2e')]));if(_0x1aa9cb[_0xb2d9('0x2c')]['filter']){_0x22c850[_0xb2d9('0x35')]=_[_0xb2d9('0x37')](_0x22c850[_0xb2d9('0x35')],{'$or':_[_0xb2d9('0x26')](_0x22c850[_0xb2d9('0x31')],function(_0x2d1ad1){var _0x27366d={};_0x27366d[_0x2d1ad1]={'$like':'%'+_0x1aa9cb[_0xb2d9('0x2c')]['filter']+'%'};return _0x27366d;})});}_0x22c850=_['merge']({},_0x22c850,_0x1aa9cb[_0xb2d9('0x3a')]);return _0x5199d8[_0xb2d9('0x4d')](_0x22c850);}})[_0xb2d9('0x20')](function(_0xf9f77f){if(_0xf9f77f){_0x5a9d06=_0xf9f77f['length'];if(!_0x1aa9cb[_0xb2d9('0x2c')]['hasOwnProperty'](_0xb2d9('0x4c'))){_0x22c850['limit']=qs[_0xb2d9('0x1a')](_0x1aa9cb[_0xb2d9('0x2c')]['limit']);_0x22c850[_0xb2d9('0x17')]=qs['offset'](_0x1aa9cb[_0xb2d9('0x2c')][_0xb2d9('0x17')]);}return _0x5199d8[_0xb2d9('0x4d')](_0x22c850);}})[_0xb2d9('0x20')](function(_0x21120e){if(_0x21120e){return _0x21120e?{'count':_0x5a9d06,'rows':_0x21120e}:null;}})[_0xb2d9('0x20')](respondWithResult(_0x321c66,null))[_0xb2d9('0x3f')](handleError(_0x321c66,null));};
\ No newline at end of file
index 85a1f01..a21e8fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbe1=['./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x22dfc2,_0x267422){var _0x498a71=function(_0x257191){while(--_0x257191){_0x22dfc2['push'](_0x22dfc2['shift']());}};_0x498a71(++_0x267422);}(_0xfbe1,0x1d3));var _0x1fbe=function(_0x2220af,_0x48129f){_0x2220af=_0x2220af-0x0;var _0x415d41=_0xfbe1[_0x2220af];return _0x415d41;};'use strict';var _=require(_0x1fbe('0x0'));var util=require(_0x1fbe('0x1'));var logger=require(_0x1fbe('0x2'))(_0x1fbe('0x3'));var moment=require(_0x1fbe('0x4'));var BPromise=require(_0x1fbe('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1fbe('0x6'));var rimraf=require(_0x1fbe('0x7'));var config=require(_0x1fbe('0x8'));var attributes=require(_0x1fbe('0x9'));module[_0x1fbe('0xa')]=function(_0x4f1233,_0x2d0803){return _0x4f1233[_0x1fbe('0xb')](_0x1fbe('0xc'),attributes,{'tableName':_0x1fbe('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc6a0=['moment','bluebird','request-promise','path','rimraf','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash','util','../../config/logger'];(function(_0x15d9c9,_0x33ea68){var _0xd8ef55=function(_0xcbc418){while(--_0xcbc418){_0x15d9c9['push'](_0x15d9c9['shift']());}};_0xd8ef55(++_0x33ea68);}(_0xc6a0,0xb1));var _0x0c6a=function(_0x1ea53c,_0x211565){_0x1ea53c=_0x1ea53c-0x0;var _0x58e34c=_0xc6a0[_0x1ea53c];return _0x58e34c;};'use strict';var _=require(_0x0c6a('0x0'));var util=require(_0x0c6a('0x1'));var logger=require(_0x0c6a('0x2'))('api');var moment=require(_0x0c6a('0x3'));var BPromise=require(_0x0c6a('0x4'));var rp=require(_0x0c6a('0x5'));var fs=require('fs');var path=require(_0x0c6a('0x6'));var rimraf=require(_0x0c6a('0x7'));var config=require('../../config/environment');var attributes=require(_0x0c6a('0x8'));module[_0x0c6a('0x9')]=function(_0x1129fd,_0x2a27ce){return _0x1129fd[_0x0c6a('0xa')](_0x0c6a('0xb'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d741efd..7a789dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b25=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','info','result','catch','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug'];(function(_0x36f5fc,_0x2e8df2){var _0x589a4a=function(_0x496891){while(--_0x496891){_0x36f5fc['push'](_0x36f5fc['shift']());}};_0x589a4a(++_0x2e8df2);}(_0x3b25,0x1ec));var _0x53b2=function(_0x5d9347,_0x4fc132){_0x5d9347=_0x5d9347-0x0;var _0x54b83f=_0x3b25[_0x5d9347];return _0x54b83f;};'use strict';var _=require('lodash');var util=require(_0x53b2('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x53b2('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53b2('0x2'))['db'];var utils=require(_0x53b2('0x3'));var logger=require(_0x53b2('0x4'))(_0x53b2('0x5'));var config=require(_0x53b2('0x6'));var jayson=require(_0x53b2('0x7'));var client=jayson[_0x53b2('0x8')][_0x53b2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f152b,_0x329317,_0x4a9fd2){return new BPromise(function(_0x41cbda,_0x22d85d){return client[_0x53b2('0xa')](_0x2f152b,_0x4a9fd2)[_0x53b2('0xb')](function(_0xfe1745){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x329317,_0x53b2('0xc'));logger[_0x53b2('0xd')](_0x53b2('0xe'),_0x329317,'request\x20sent',JSON[_0x53b2('0xf')](_0xfe1745));if(_0xfe1745[_0x53b2('0x10')]){if(_0xfe1745[_0x53b2('0x10')][_0x53b2('0x11')]===0x1f4){logger[_0x53b2('0x10')](_0x53b2('0x12'),_0x329317,_0xfe1745[_0x53b2('0x10')]['message']);return _0x22d85d(_0xfe1745[_0x53b2('0x10')][_0x53b2('0x13')]);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x329317,_0xfe1745['error'][_0x53b2('0x13')]);return _0x41cbda(_0xfe1745['error'][_0x53b2('0x13')]);}else{logger[_0x53b2('0x14')]('ZohoConfiguration,\x20%s,\x20%s',_0x329317,_0x53b2('0xc'));_0x41cbda(_0xfe1745[_0x53b2('0x15')][_0x53b2('0x13')]);}})[_0x53b2('0x16')](function(_0x498444){logger[_0x53b2('0x10')](_0x53b2('0x12'),_0x329317,_0x498444);_0x22d85d(_0x498444);});});}
\ No newline at end of file
+var _0x052c=['../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x052c,0xd6));var _0xc052=function(_0x2c9eff,_0xc52a55){_0x2c9eff=_0x2c9eff-0x0;var _0x57b05b=_0x052c[_0x2c9eff];return _0x57b05b;};'use strict';var _=require(_0xc052('0x0'));var util=require(_0xc052('0x1'));var moment=require(_0xc052('0x2'));var BPromise=require(_0xc052('0x3'));var rs=require(_0xc052('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc052('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc052('0x6'))('rpc');var config=require(_0xc052('0x7'));var jayson=require(_0xc052('0x8'));var client=jayson['client'][_0xc052('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24646c,_0x6b037f,_0x505711){return new BPromise(function(_0x28eda7,_0x1a3186){return client[_0xc052('0xa')](_0x24646c,_0x505711)[_0xc052('0xb')](function(_0x344bef){logger[_0xc052('0xc')](_0xc052('0xd'),_0x6b037f,_0xc052('0xe'));logger[_0xc052('0xf')](_0xc052('0x10'),_0x6b037f,_0xc052('0xe'),JSON['stringify'](_0x344bef));if(_0x344bef[_0xc052('0x11')]){if(_0x344bef[_0xc052('0x11')][_0xc052('0x12')]===0x1f4){logger[_0xc052('0x11')](_0xc052('0xd'),_0x6b037f,_0x344bef[_0xc052('0x11')]['message']);return _0x1a3186(_0x344bef[_0xc052('0x11')][_0xc052('0x13')]);}logger[_0xc052('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x6b037f,_0x344bef['error'][_0xc052('0x13')]);return _0x28eda7(_0x344bef[_0xc052('0x11')]['message']);}else{logger[_0xc052('0xc')](_0xc052('0xd'),_0x6b037f,_0xc052('0xe'));_0x28eda7(_0x344bef[_0xc052('0x14')][_0xc052('0x13')]);}})[_0xc052('0x15')](function(_0x2a15b4){logger['error'](_0xc052('0xd'),_0x6b037f,_0x2a15b4);_0x1a3186(_0x2a15b4);});});}
\ No newline at end of file
index 006239e..8ea6f2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x654a=['show','post','create','update','delete','destroy','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id'];(function(_0x3449bb,_0x554271){var _0x38e188=function(_0x2f354b){while(--_0x2f354b){_0x3449bb['push'](_0x3449bb['shift']());}};_0x38e188(++_0x554271);}(_0x654a,0x1e6));var _0xa654=function(_0x5f49c0,_0x27a1b4){_0x5f49c0=_0x5f49c0-0x0;var _0x5ab653=_0x654a[_0x5f49c0];return _0x5ab653;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa654('0x0'));var router=express[_0xa654('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xa654('0x2'));var interaction=require(_0xa654('0x3'));var config=require(_0xa654('0x4'));var controller=require(_0xa654('0x5'));router[_0xa654('0x6')]('/',auth[_0xa654('0x7')](),controller['index']);router[_0xa654('0x6')](_0xa654('0x8'),auth[_0xa654('0x7')](),controller[_0xa654('0x9')]);router[_0xa654('0xa')]('/',auth[_0xa654('0x7')](),controller[_0xa654('0xb')]);router['put'](_0xa654('0x8'),auth['isAuthenticated'](),controller[_0xa654('0xc')]);router[_0xa654('0xd')](_0xa654('0x8'),auth[_0xa654('0x7')](),controller[_0xa654('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x9b04=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index','get','show','post','create','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1838e1,_0x791615){var _0x49a5bb=function(_0x27a669){while(--_0x27a669){_0x1838e1['push'](_0x1838e1['shift']());}};_0x49a5bb(++_0x791615);}(_0x9b04,0x8c));var _0x49b0=function(_0x37ca5f,_0x7b93d4){_0x37ca5f=_0x37ca5f-0x0;var _0x4b0676=_0x9b04[_0x37ca5f];return _0x4b0676;};'use strict';var multer=require(_0x49b0('0x0'));var util=require(_0x49b0('0x1'));var path=require(_0x49b0('0x2'));var timeout=require(_0x49b0('0x3'));var express=require(_0x49b0('0x4'));var router=express[_0x49b0('0x5')]();var fs_extra=require(_0x49b0('0x6'));var auth=require(_0x49b0('0x7'));var interaction=require(_0x49b0('0x8'));var config=require(_0x49b0('0x9'));var controller=require(_0x49b0('0xa'));router['get']('/',auth[_0x49b0('0xb')](),controller[_0x49b0('0xc')]);router[_0x49b0('0xd')]('/:id',auth[_0x49b0('0xb')](),controller[_0x49b0('0xe')]);router[_0x49b0('0xf')]('/',auth[_0x49b0('0xb')](),controller[_0x49b0('0x10')]);router['put']('/:id',auth[_0x49b0('0xb')](),controller['update']);router[_0x49b0('0x11')](_0x49b0('0x12'),auth['isAuthenticated'](),controller[_0x49b0('0x13')]);module[_0x49b0('0x14')]=router;
\ No newline at end of file
index 11d4d2c..83666e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc40d=['ENUM','string','variable','customVariable','picklist','STRING','sequelize','exports'];(function(_0x516190,_0xa2a75d){var _0x2bdbf9=function(_0x1609a8){while(--_0x1609a8){_0x516190['push'](_0x516190['shift']());}};_0x2bdbf9(++_0xa2a75d);}(_0xc40d,0x1ce));var _0xdc40=function(_0x17158c,_0x117c0){_0x17158c=_0x17158c-0x0;var _0x35a62e=_0xc40d[_0x17158c];return _0x35a62e;};'use strict';var Sequelize=require(_0xdc40('0x0'));module[_0xdc40('0x1')]={'type':{'type':Sequelize[_0xdc40('0x2')](_0xdc40('0x3'),_0xdc40('0x4'),_0xdc40('0x5'),'keyValue',_0xdc40('0x6')),'defaultValue':_0xdc40('0x3')},'content':{'type':Sequelize[_0xdc40('0x7')]},'key':{'type':Sequelize[_0xdc40('0x7')]},'keyType':{'type':Sequelize[_0xdc40('0x2')](_0xdc40('0x3'),_0xdc40('0x4'),_0xdc40('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xdc40('0x7')]},'nameField':{'type':Sequelize[_0xdc40('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdc40('0x7')]}};
\ No newline at end of file
+var _0xcefd=['picklist','string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','variable','keyValue'];(function(_0x43332f,_0x2257a5){var _0x392c87=function(_0x55a8b1){while(--_0x55a8b1){_0x43332f['push'](_0x43332f['shift']());}};_0x392c87(++_0x2257a5);}(_0xcefd,0xeb));var _0xdcef=function(_0x43776a,_0x4eb74c){_0x43776a=_0x43776a-0x0;var _0x18eb8f=_0xcefd[_0x43776a];return _0x18eb8f;};'use strict';var Sequelize=require(_0xdcef('0x0'));module[_0xdcef('0x1')]={'type':{'type':Sequelize[_0xdcef('0x2')]('string',_0xdcef('0x3'),'customVariable',_0xdcef('0x4'),_0xdcef('0x5')),'defaultValue':_0xdcef('0x6')},'content':{'type':Sequelize[_0xdcef('0x7')]},'key':{'type':Sequelize[_0xdcef('0x7')]},'keyType':{'type':Sequelize[_0xdcef('0x2')](_0xdcef('0x6'),_0xdcef('0x3'),_0xdcef('0x8'))},'keyContent':{'type':Sequelize[_0xdcef('0x7')]},'idField':{'type':Sequelize[_0xdcef('0x7')]},'nameField':{'type':Sequelize[_0xdcef('0x7')]},'customField':{'type':Sequelize[_0xdcef('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdcef('0x7')]}};
\ No newline at end of file
index 5f74087..1b31e09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8165=['rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','error','stack','name','send','index','map','ZohoField','fieldName','type','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x9a3e0f,_0x2f796d){var _0x3d2a9a=function(_0x3aeb03){while(--_0x3aeb03){_0x9a3e0f['push'](_0x9a3e0f['shift']());}};_0x3d2a9a(++_0x2f796d);}(_0x8165,0x96));var _0x5816=function(_0x39def5,_0x277d82){_0x39def5=_0x39def5-0x0;var _0xfa0567=_0x8165[_0x39def5];return _0xfa0567;};'use strict';var emlformat=require(_0x5816('0x0'));var rimraf=require(_0x5816('0x1'));var zipdir=require(_0x5816('0x2'));var jsonpatch=require(_0x5816('0x3'));var rp=require(_0x5816('0x4'));var moment=require(_0x5816('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5816('0x6'));var util=require(_0x5816('0x7'));var path=require(_0x5816('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5816('0x9'));var squel=require(_0x5816('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5816('0xb'));var querystring=require(_0x5816('0xc'));var Papa=require(_0x5816('0xd'));var Redis=require(_0x5816('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5816('0xf'));var as=require(_0x5816('0x10'));var hardwareService=require(_0x5816('0x11'));var logger=require(_0x5816('0x12'))(_0x5816('0x13'));var utils=require('../../config/utils');var config=require(_0x5816('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5816('0x15'))['db'];function respondWithStatusCode(_0x47f892,_0x4c9366){_0x4c9366=_0x4c9366||0xcc;return function(_0x265fb6){if(_0x265fb6){return _0x47f892[_0x5816('0x16')](_0x4c9366);}return _0x47f892['status'](_0x4c9366)[_0x5816('0x17')]();};}function respondWithResult(_0x69a76,_0x2f9e9e){_0x2f9e9e=_0x2f9e9e||0xc8;return function(_0x368c74){if(_0x368c74){return _0x69a76[_0x5816('0x18')](_0x2f9e9e)['json'](_0x368c74);}};}function respondWithFilteredResult(_0x5d82a4,_0x2bbf2d){return function(_0x3cf406){if(_0x3cf406){var _0x51d30a=typeof _0x2bbf2d[_0x5816('0x19')]===_0x5816('0x1a')&&typeof _0x2bbf2d[_0x5816('0x1b')]===_0x5816('0x1a');var _0x6ac919=_0x3cf406[_0x5816('0x1c')];var _0x3fff0c=_0x51d30a?0x0:_0x2bbf2d['offset'];var _0x483b03=_0x51d30a?_0x3cf406[_0x5816('0x1c')]:_0x2bbf2d[_0x5816('0x19')]+_0x2bbf2d[_0x5816('0x1b')];var _0x114b03;if(_0x483b03>=_0x6ac919){_0x483b03=_0x6ac919;_0x114b03=0xc8;}else{_0x114b03=0xce;}_0x5d82a4[_0x5816('0x18')](_0x114b03);return _0x5d82a4[_0x5816('0x1d')](_0x5816('0x1e'),_0x3fff0c+'-'+_0x483b03+'/'+_0x6ac919)[_0x5816('0x1f')](_0x3cf406);}return null;};}function patchUpdates(_0x1ff6c5){return function(_0x184977){try{jsonpatch['apply'](_0x184977,_0x1ff6c5,!![]);}catch(_0xc8eb12){return BPromise[_0x5816('0x20')](_0xc8eb12);}return _0x184977['save']();};}function saveUpdates(_0x35090,_0x20eede){return function(_0x148d1b){if(_0x148d1b){return _0x148d1b[_0x5816('0x21')](_0x35090)[_0x5816('0x22')](function(_0x107ac6){return _0x107ac6;});}return null;};}function removeEntity(_0x19417e,_0x404cfb){return function(_0x87bb1c){if(_0x87bb1c){return _0x87bb1c[_0x5816('0x23')]()['then'](function(){_0x19417e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52d892,_0x3d57dd){return function(_0x223d7b){if(!_0x223d7b){_0x52d892[_0x5816('0x16')](0x194);}return _0x223d7b;};}function handleError(_0x3068fd,_0x3e19af){_0x3e19af=_0x3e19af||0x1f4;return function(_0x2cdf6f){logger[_0x5816('0x24')](_0x2cdf6f[_0x5816('0x25')]);if(_0x2cdf6f[_0x5816('0x26')]){delete _0x2cdf6f[_0x5816('0x26')];}_0x3068fd['status'](_0x3e19af)[_0x5816('0x27')](_0x2cdf6f);};}exports[_0x5816('0x28')]=function(_0x7ad03e,_0x2f3000){var _0x12fe5c={},_0x2783fb={},_0x498f25={'count':0x0,'rows':[]};var _0x17a9b9=_[_0x5816('0x29')](db[_0x5816('0x2a')]['rawAttributes'],function(_0x4d002b){return{'name':_0x4d002b[_0x5816('0x2b')],'type':_0x4d002b[_0x5816('0x2c')]['key']};});_0x2783fb[_0x5816('0x2d')]=_[_0x5816('0x29')](_0x17a9b9,_0x5816('0x26'));_0x2783fb['query']=_[_0x5816('0x2e')](_0x7ad03e[_0x5816('0x2f')]);_0x2783fb['filters']=_[_0x5816('0x30')](_0x2783fb[_0x5816('0x2d')],_0x2783fb['query']);_0x12fe5c[_0x5816('0x31')]=_[_0x5816('0x30')](_0x2783fb[_0x5816('0x2d')],qs[_0x5816('0x32')](_0x7ad03e[_0x5816('0x2f')]['fields']));_0x12fe5c[_0x5816('0x31')]=_0x12fe5c['attributes'][_0x5816('0x33')]?_0x12fe5c[_0x5816('0x31')]:_0x2783fb[_0x5816('0x2d')];if(!_0x7ad03e[_0x5816('0x2f')]['hasOwnProperty'](_0x5816('0x34'))){_0x12fe5c[_0x5816('0x1b')]=qs[_0x5816('0x1b')](_0x7ad03e[_0x5816('0x2f')]['limit']);_0x12fe5c['offset']=qs[_0x5816('0x19')](_0x7ad03e[_0x5816('0x2f')][_0x5816('0x19')]);}_0x12fe5c[_0x5816('0x35')]=qs[_0x5816('0x36')](_0x7ad03e[_0x5816('0x2f')][_0x5816('0x36')]);_0x12fe5c[_0x5816('0x37')]=qs['filters'](_[_0x5816('0x38')](_0x7ad03e['query'],_0x2783fb[_0x5816('0x39')]),_0x17a9b9);if(_0x7ad03e['query'][_0x5816('0x3a')]){_0x12fe5c[_0x5816('0x37')]=_['merge'](_0x12fe5c[_0x5816('0x37')],{'$or':_[_0x5816('0x29')](_0x17a9b9,function(_0x530eea){if(_0x530eea[_0x5816('0x2c')]!==_0x5816('0x3b')){var _0x552cd7={};_0x552cd7[_0x530eea['name']]={'$like':'%'+_0x7ad03e['query'][_0x5816('0x3a')]+'%'};return _0x552cd7;}})});}_0x12fe5c=_[_0x5816('0x3c')]({},_0x12fe5c,_0x7ad03e[_0x5816('0x3d')]);var _0x46aca0={'where':_0x12fe5c[_0x5816('0x37')]};return db['ZohoField'][_0x5816('0x1c')](_0x46aca0)[_0x5816('0x22')](function(_0x585de5){_0x498f25[_0x5816('0x1c')]=_0x585de5;if(_0x7ad03e[_0x5816('0x2f')][_0x5816('0x3e')]){_0x12fe5c[_0x5816('0x3f')]=[{'all':!![]}];}return db[_0x5816('0x2a')][_0x5816('0x40')](_0x12fe5c);})['then'](function(_0xf70f84){_0x498f25[_0x5816('0x41')]=_0xf70f84;return _0x498f25;})[_0x5816('0x22')](respondWithFilteredResult(_0x2f3000,_0x12fe5c))[_0x5816('0x42')](handleError(_0x2f3000,null));};exports[_0x5816('0x43')]=function(_0x3564e2,_0x53ba56){var _0x1878f4={'raw':!![],'where':{'id':_0x3564e2[_0x5816('0x44')]['id']}},_0x27b2fb={};_0x27b2fb[_0x5816('0x2d')]=_[_0x5816('0x2e')](db[_0x5816('0x2a')][_0x5816('0x45')]);_0x27b2fb['query']=_['keys'](_0x3564e2[_0x5816('0x2f')]);_0x27b2fb[_0x5816('0x39')]=_['intersection'](_0x27b2fb[_0x5816('0x2d')],_0x27b2fb['query']);_0x1878f4[_0x5816('0x31')]=_[_0x5816('0x30')](_0x27b2fb[_0x5816('0x2d')],qs[_0x5816('0x32')](_0x3564e2['query']['fields']));_0x1878f4[_0x5816('0x31')]=_0x1878f4[_0x5816('0x31')]['length']?_0x1878f4[_0x5816('0x31')]:_0x27b2fb[_0x5816('0x2d')];if(_0x3564e2[_0x5816('0x2f')][_0x5816('0x3e')]){_0x1878f4[_0x5816('0x3f')]=[{'all':!![]}];}_0x1878f4=_['merge']({},_0x1878f4,_0x3564e2[_0x5816('0x3d')]);return db[_0x5816('0x2a')][_0x5816('0x46')](_0x1878f4)[_0x5816('0x22')](handleEntityNotFound(_0x53ba56,null))[_0x5816('0x22')](respondWithResult(_0x53ba56,null))[_0x5816('0x42')](handleError(_0x53ba56,null));};exports[_0x5816('0x47')]=function(_0x1dcfdf,_0x135bdd){return db[_0x5816('0x2a')][_0x5816('0x47')](_0x1dcfdf[_0x5816('0x48')],{})[_0x5816('0x22')](respondWithResult(_0x135bdd,0xc9))[_0x5816('0x42')](handleError(_0x135bdd,null));};exports[_0x5816('0x21')]=function(_0xf9a7cc,_0xa6fd1d){if(_0xf9a7cc[_0x5816('0x48')]['id']){delete _0xf9a7cc[_0x5816('0x48')]['id'];}return db['ZohoField'][_0x5816('0x46')]({'where':{'id':_0xf9a7cc[_0x5816('0x44')]['id']}})[_0x5816('0x22')](handleEntityNotFound(_0xa6fd1d,null))[_0x5816('0x22')](saveUpdates(_0xf9a7cc[_0x5816('0x48')],null))[_0x5816('0x22')](respondWithResult(_0xa6fd1d,null))['catch'](handleError(_0xa6fd1d,null));};exports['destroy']=function(_0x381092,_0x33ae57){return db[_0x5816('0x2a')][_0x5816('0x46')]({'where':{'id':_0x381092[_0x5816('0x44')]['id']}})[_0x5816('0x22')](handleEntityNotFound(_0x33ae57,null))['then'](removeEntity(_0x33ae57,null))[_0x5816('0x42')](handleError(_0x33ae57,null));};
\ No newline at end of file
+var _0x5341=['apply','update','then','error','name','send','index','map','ZohoField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','ejs','squel','desk.js','to-csv','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','Content-Range'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x5341,0xb3));var _0x1534=function(_0x508962,_0xf5e561){_0x508962=_0x508962-0x0;var _0x4cd620=_0x5341[_0x508962];return _0x4cd620;};'use strict';var emlformat=require(_0x1534('0x0'));var rimraf=require(_0x1534('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1534('0x2'));var rp=require('request-promise');var moment=require(_0x1534('0x3'));var BPromise=require(_0x1534('0x4'));var Mustache=require(_0x1534('0x5'));var util=require('util');var path=require(_0x1534('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1534('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1534('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1534('0x9'));var toCsv=require(_0x1534('0xa'));var querystring=require('querystring');var Papa=require(_0x1534('0xb'));var Redis=require('ioredis');var authService=require(_0x1534('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1534('0xd'));var logger=require(_0x1534('0xe'))(_0x1534('0xf'));var utils=require(_0x1534('0x10'));var config=require(_0x1534('0x11'));var licenseUtil=require(_0x1534('0x12'));var db=require(_0x1534('0x13'))['db'];function respondWithStatusCode(_0x290e7e,_0x49b9e9){_0x49b9e9=_0x49b9e9||0xcc;return function(_0x15f6d7){if(_0x15f6d7){return _0x290e7e['sendStatus'](_0x49b9e9);}return _0x290e7e['status'](_0x49b9e9)[_0x1534('0x14')]();};}function respondWithResult(_0x38e020,_0x2eae12){_0x2eae12=_0x2eae12||0xc8;return function(_0x5e58d5){if(_0x5e58d5){return _0x38e020[_0x1534('0x15')](_0x2eae12)[_0x1534('0x16')](_0x5e58d5);}};}function respondWithFilteredResult(_0xa3ab2d,_0xad0a51){return function(_0x3687b3){if(_0x3687b3){var _0x43e0e2=typeof _0xad0a51['offset']===_0x1534('0x17')&&typeof _0xad0a51[_0x1534('0x18')]===_0x1534('0x17');var _0x5bda68=_0x3687b3[_0x1534('0x19')];var _0x2cd25e=_0x43e0e2?0x0:_0xad0a51[_0x1534('0x1a')];var _0x29015b=_0x43e0e2?_0x3687b3[_0x1534('0x19')]:_0xad0a51[_0x1534('0x1a')]+_0xad0a51['limit'];var _0x1ff83b;if(_0x29015b>=_0x5bda68){_0x29015b=_0x5bda68;_0x1ff83b=0xc8;}else{_0x1ff83b=0xce;}_0xa3ab2d[_0x1534('0x15')](_0x1ff83b);return _0xa3ab2d['set'](_0x1534('0x1b'),_0x2cd25e+'-'+_0x29015b+'/'+_0x5bda68)['json'](_0x3687b3);}return null;};}function patchUpdates(_0x2760ef){return function(_0x1aa49e){try{jsonpatch[_0x1534('0x1c')](_0x1aa49e,_0x2760ef,!![]);}catch(_0x451c2f){return BPromise['reject'](_0x451c2f);}return _0x1aa49e['save']();};}function saveUpdates(_0x2784c7,_0x1d5b4d){return function(_0x3dbe6a){if(_0x3dbe6a){return _0x3dbe6a[_0x1534('0x1d')](_0x2784c7)[_0x1534('0x1e')](function(_0x412682){return _0x412682;});}return null;};}function removeEntity(_0x688334,_0x43423f){return function(_0x5b607b){if(_0x5b607b){return _0x5b607b['destroy']()[_0x1534('0x1e')](function(){_0x688334['status'](0xcc)[_0x1534('0x14')]();});}};}function handleEntityNotFound(_0x30a438,_0x32d23e){return function(_0x1f87b7){if(!_0x1f87b7){_0x30a438['sendStatus'](0x194);}return _0x1f87b7;};}function handleError(_0x1d9355,_0x42532e){_0x42532e=_0x42532e||0x1f4;return function(_0x32f82d){logger[_0x1534('0x1f')](_0x32f82d['stack']);if(_0x32f82d['name']){delete _0x32f82d[_0x1534('0x20')];}_0x1d9355[_0x1534('0x15')](_0x42532e)[_0x1534('0x21')](_0x32f82d);};}exports[_0x1534('0x22')]=function(_0x51eaec,_0x2ba391){var _0x23e834={},_0x50dc23={},_0x5400ec={'count':0x0,'rows':[]};var _0xe0af2=_[_0x1534('0x23')](db[_0x1534('0x24')][_0x1534('0x25')],function(_0x5a8abb){return{'name':_0x5a8abb[_0x1534('0x26')],'type':_0x5a8abb['type'][_0x1534('0x27')]};});_0x50dc23[_0x1534('0x28')]=_[_0x1534('0x23')](_0xe0af2,_0x1534('0x20'));_0x50dc23[_0x1534('0x29')]=_[_0x1534('0x2a')](_0x51eaec[_0x1534('0x29')]);_0x50dc23[_0x1534('0x2b')]=_[_0x1534('0x2c')](_0x50dc23[_0x1534('0x28')],_0x50dc23['query']);_0x23e834[_0x1534('0x2d')]=_[_0x1534('0x2c')](_0x50dc23[_0x1534('0x28')],qs[_0x1534('0x2e')](_0x51eaec[_0x1534('0x29')][_0x1534('0x2e')]));_0x23e834['attributes']=_0x23e834[_0x1534('0x2d')][_0x1534('0x2f')]?_0x23e834['attributes']:_0x50dc23[_0x1534('0x28')];if(!_0x51eaec['query'][_0x1534('0x30')](_0x1534('0x31'))){_0x23e834[_0x1534('0x18')]=qs[_0x1534('0x18')](_0x51eaec[_0x1534('0x29')][_0x1534('0x18')]);_0x23e834[_0x1534('0x1a')]=qs[_0x1534('0x1a')](_0x51eaec[_0x1534('0x29')][_0x1534('0x1a')]);}_0x23e834['order']=qs[_0x1534('0x32')](_0x51eaec[_0x1534('0x29')][_0x1534('0x32')]);_0x23e834[_0x1534('0x33')]=qs['filters'](_[_0x1534('0x34')](_0x51eaec[_0x1534('0x29')],_0x50dc23['filters']),_0xe0af2);if(_0x51eaec[_0x1534('0x29')][_0x1534('0x35')]){_0x23e834[_0x1534('0x33')]=_[_0x1534('0x36')](_0x23e834[_0x1534('0x33')],{'$or':_[_0x1534('0x23')](_0xe0af2,function(_0x46202d){if(_0x46202d[_0x1534('0x37')]!==_0x1534('0x38')){var _0x924d92={};_0x924d92[_0x46202d['name']]={'$like':'%'+_0x51eaec['query'][_0x1534('0x35')]+'%'};return _0x924d92;}})});}_0x23e834=_['merge']({},_0x23e834,_0x51eaec['options']);var _0x4fa74b={'where':_0x23e834[_0x1534('0x33')]};return db['ZohoField'][_0x1534('0x19')](_0x4fa74b)[_0x1534('0x1e')](function(_0x335599){_0x5400ec[_0x1534('0x19')]=_0x335599;if(_0x51eaec['query'][_0x1534('0x39')]){_0x23e834[_0x1534('0x3a')]=[{'all':!![]}];}return db['ZohoField'][_0x1534('0x3b')](_0x23e834);})['then'](function(_0x1875ff){_0x5400ec[_0x1534('0x3c')]=_0x1875ff;return _0x5400ec;})[_0x1534('0x1e')](respondWithFilteredResult(_0x2ba391,_0x23e834))[_0x1534('0x3d')](handleError(_0x2ba391,null));};exports[_0x1534('0x3e')]=function(_0x5b85cf,_0x3dcfdb){var _0x20f3d4={'raw':!![],'where':{'id':_0x5b85cf[_0x1534('0x3f')]['id']}},_0x232a56={};_0x232a56[_0x1534('0x28')]=_[_0x1534('0x2a')](db[_0x1534('0x24')][_0x1534('0x25')]);_0x232a56[_0x1534('0x29')]=_[_0x1534('0x2a')](_0x5b85cf['query']);_0x232a56[_0x1534('0x2b')]=_['intersection'](_0x232a56[_0x1534('0x28')],_0x232a56[_0x1534('0x29')]);_0x20f3d4[_0x1534('0x2d')]=_[_0x1534('0x2c')](_0x232a56[_0x1534('0x28')],qs['fields'](_0x5b85cf[_0x1534('0x29')][_0x1534('0x2e')]));_0x20f3d4[_0x1534('0x2d')]=_0x20f3d4[_0x1534('0x2d')][_0x1534('0x2f')]?_0x20f3d4['attributes']:_0x232a56['model'];if(_0x5b85cf['query'][_0x1534('0x39')]){_0x20f3d4[_0x1534('0x3a')]=[{'all':!![]}];}_0x20f3d4=_[_0x1534('0x36')]({},_0x20f3d4,_0x5b85cf[_0x1534('0x40')]);return db['ZohoField'][_0x1534('0x41')](_0x20f3d4)[_0x1534('0x1e')](handleEntityNotFound(_0x3dcfdb,null))[_0x1534('0x1e')](respondWithResult(_0x3dcfdb,null))[_0x1534('0x3d')](handleError(_0x3dcfdb,null));};exports[_0x1534('0x42')]=function(_0x2a2f15,_0x1a9b43){return db[_0x1534('0x24')][_0x1534('0x42')](_0x2a2f15[_0x1534('0x43')],{})[_0x1534('0x1e')](respondWithResult(_0x1a9b43,0xc9))[_0x1534('0x3d')](handleError(_0x1a9b43,null));};exports[_0x1534('0x1d')]=function(_0x5822b2,_0x9988ed){if(_0x5822b2[_0x1534('0x43')]['id']){delete _0x5822b2[_0x1534('0x43')]['id'];}return db['ZohoField'][_0x1534('0x41')]({'where':{'id':_0x5822b2['params']['id']}})[_0x1534('0x1e')](handleEntityNotFound(_0x9988ed,null))[_0x1534('0x1e')](saveUpdates(_0x5822b2[_0x1534('0x43')],null))['then'](respondWithResult(_0x9988ed,null))['catch'](handleError(_0x9988ed,null));};exports[_0x1534('0x44')]=function(_0x4a7536,_0x14727a){return db[_0x1534('0x24')][_0x1534('0x41')]({'where':{'id':_0x4a7536[_0x1534('0x3f')]['id']}})[_0x1534('0x1e')](handleEntityNotFound(_0x14727a,null))[_0x1534('0x1e')](removeEntity(_0x14727a,null))[_0x1534('0x3d')](handleError(_0x14727a,null));};
\ No newline at end of file
index 9b69978..edcf5ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ca=['moment','bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','util','../../config/logger'];(function(_0x13c7d7,_0x1ebe68){var _0x30d2e8=function(_0x2e752f){while(--_0x2e752f){_0x13c7d7['push'](_0x13c7d7['shift']());}};_0x30d2e8(++_0x1ebe68);}(_0x57ca,0x108));var _0xa57c=function(_0xfbddcb,_0xca93ee){_0xfbddcb=_0xfbddcb-0x0;var _0x1ef2e9=_0x57ca[_0xfbddcb];return _0x1ef2e9;};'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 fs=require('fs');var path=require(_0xa57c('0x5'));var rimraf=require(_0xa57c('0x6'));var config=require('../../config/environment');var attributes=require(_0xa57c('0x7'));module[_0xa57c('0x8')]=function(_0x113dcf,_0x19473f){return _0x113dcf[_0xa57c('0x9')](_0xa57c('0xa'),attributes,{'tableName':_0xa57c('0xb'),'paranoid':![],'indexes':[{'name':_0xa57c('0xc'),'fields':['idField',_0xa57c('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7880=['define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoField.attributes','exports'];(function(_0x3d32bf,_0x16005a){var _0x3f303d=function(_0x5b118b){while(--_0x5b118b){_0x3d32bf['push'](_0x3d32bf['shift']());}};_0x3f303d(++_0x16005a);}(_0x7880,0x1f4));var _0x0788=function(_0x58d5d4,_0x4f05a3){_0x58d5d4=_0x58d5d4-0x0;var _0x596a07=_0x7880[_0x58d5d4];return _0x596a07;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var logger=require(_0x0788('0x1'))(_0x0788('0x2'));var moment=require(_0x0788('0x3'));var BPromise=require(_0x0788('0x4'));var rp=require(_0x0788('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var attributes=require(_0x0788('0x8'));module[_0x0788('0x9')]=function(_0x262f5c,_0x775629){return _0x262f5c[_0x0788('0xa')](_0x0788('0xb'),attributes,{'tableName':_0x0788('0xc'),'paranoid':![],'indexes':[{'name':_0x0788('0xd'),'fields':['idField',_0x0788('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 8e2d246..0bbd4f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08ab=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x172ced,_0x16e422){var _0x220b96=function(_0x5725d0){while(--_0x5725d0){_0x172ced['push'](_0x172ced['shift']());}};_0x220b96(++_0x16e422);}(_0x08ab,0x1b2));var _0xb08a=function(_0x2a259e,_0xfe0140){_0x2a259e=_0x2a259e-0x0;var _0x29e220=_0x08ab[_0x2a259e];return _0x29e220;};'use strict';var _=require(_0xb08a('0x0'));var util=require(_0xb08a('0x1'));var moment=require(_0xb08a('0x2'));var BPromise=require(_0xb08a('0x3'));var rs=require(_0xb08a('0x4'));var fs=require('fs');var Redis=require(_0xb08a('0x5'));var db=require(_0xb08a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb08a('0x7'))(_0xb08a('0x8'));var config=require(_0xb08a('0x9'));var jayson=require(_0xb08a('0xa'));var client=jayson[_0xb08a('0xb')][_0xb08a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x30cba3,_0x4e0e9b,_0x292aa0){return new BPromise(function(_0x4899b7,_0x4b7da7){return client[_0xb08a('0xd')](_0x30cba3,_0x292aa0)[_0xb08a('0xe')](function(_0x16b77e){logger[_0xb08a('0xf')](_0xb08a('0x10'),_0x4e0e9b,_0xb08a('0x11'));logger['debug'](_0xb08a('0x12'),_0x4e0e9b,'request\x20sent',JSON[_0xb08a('0x13')](_0x16b77e));if(_0x16b77e[_0xb08a('0x14')]){if(_0x16b77e[_0xb08a('0x14')][_0xb08a('0x15')]===0x1f4){logger[_0xb08a('0x14')](_0xb08a('0x10'),_0x4e0e9b,_0x16b77e[_0xb08a('0x14')][_0xb08a('0x16')]);return _0x4b7da7(_0x16b77e['error'][_0xb08a('0x16')]);}logger[_0xb08a('0x14')]('ZohoField,\x20%s,\x20%s',_0x4e0e9b,_0x16b77e[_0xb08a('0x14')][_0xb08a('0x16')]);return _0x4899b7(_0x16b77e[_0xb08a('0x14')]['message']);}else{logger['info'](_0xb08a('0x10'),_0x4e0e9b,_0xb08a('0x11'));_0x4899b7(_0x16b77e['result']['message']);}})[_0xb08a('0x17')](function(_0x4370f0){logger[_0xb08a('0x14')](_0xb08a('0x10'),_0x4e0e9b,_0x4370f0);_0x4b7da7(_0x4370f0);});});}
\ No newline at end of file
+var _0x39e8=['../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x39e8,0xa2));var _0x839e=function(_0x7fd18a,_0x476392){_0x7fd18a=_0x7fd18a-0x0;var _0x2f1f01=_0x39e8[_0x7fd18a];return _0x2f1f01;};'use strict';var _=require(_0x839e('0x0'));var util=require(_0x839e('0x1'));var moment=require(_0x839e('0x2'));var BPromise=require(_0x839e('0x3'));var rs=require(_0x839e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x839e('0x5'))['db'];var utils=require(_0x839e('0x6'));var logger=require('../../config/logger')(_0x839e('0x7'));var config=require('../../config/environment');var jayson=require(_0x839e('0x8'));var client=jayson[_0x839e('0x9')][_0x839e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e8c98,_0x577f93,_0x3e334e){return new BPromise(function(_0x4f5d69,_0x116bfa){return client[_0x839e('0xb')](_0x1e8c98,_0x3e334e)[_0x839e('0xc')](function(_0x439dae){logger[_0x839e('0xd')]('ZohoField,\x20%s,\x20%s',_0x577f93,_0x839e('0xe'));logger[_0x839e('0xf')](_0x839e('0x10'),_0x577f93,'request\x20sent',JSON[_0x839e('0x11')](_0x439dae));if(_0x439dae[_0x839e('0x12')]){if(_0x439dae[_0x839e('0x12')][_0x839e('0x13')]===0x1f4){logger[_0x839e('0x12')](_0x839e('0x14'),_0x577f93,_0x439dae['error'][_0x839e('0x15')]);return _0x116bfa(_0x439dae['error'][_0x839e('0x15')]);}logger[_0x839e('0x12')]('ZohoField,\x20%s,\x20%s',_0x577f93,_0x439dae[_0x839e('0x12')][_0x839e('0x15')]);return _0x4f5d69(_0x439dae[_0x839e('0x12')][_0x839e('0x15')]);}else{logger[_0x839e('0xd')](_0x839e('0x14'),_0x577f93,_0x839e('0xe'));_0x4f5d69(_0x439dae[_0x839e('0x16')][_0x839e('0x15')]);}})[_0x839e('0x17')](function(_0x47c4c7){logger[_0x839e('0x12')](_0x839e('0x14'),_0x577f93,_0x47c4c7);_0x116bfa(_0x47c4c7);});});}
\ No newline at end of file
index 31f5713..50dd730 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x47242d,_0x13f993){var _0x30273a=function(_0x322cd2){while(--_0x322cd2){_0x47242d['push'](_0x47242d['shift']());}};_0x30273a(++_0x13f993);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1c8e1d,_0x5a5904){var _0x20bd5a=function(_0x553152){while(--_0x553152){_0x1c8e1d['push'](_0x1c8e1d['shift']());}};_0x20bd5a(++_0x5a5904);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index a6f5926..91a2013 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c50=['exports','STRING','unique_name_and_version','app.js','state'];(function(_0x5a3202,_0x4a9c0d){var _0xb4cf2=function(_0x169a51){while(--_0x169a51){_0x5a3202['push'](_0x5a3202['shift']());}};_0xb4cf2(++_0x4a9c0d);}(_0x8c50,0xcd));var _0x08c5=function(_0x3f533b,_0x2fbf4a){_0x3f533b=_0x3f533b-0x0;var _0x5875e4=_0x8c50[_0x3f533b];return _0x5875e4;};'use strict';var Sequelize=require('sequelize');module[_0x08c5('0x0')]={'name':{'type':Sequelize[_0x08c5('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x08c5('0x1')],'allowNull':![],'unique':_0x08c5('0x2')},'main':{'type':Sequelize[_0x08c5('0x1')],'defaultValue':_0x08c5('0x3')},'filename':{'type':Sequelize[_0x08c5('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x08c5('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x08c5('0x1')]},'logo':{'type':Sequelize[_0x08c5('0x1')]},'state':{'type':Sequelize['STRING'],'unique':_0x08c5('0x4')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x08c5('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x08c5('0x1')],'defaultValue':'#'}};
\ No newline at end of file
+var _0x98b7=['unique_name_and_version','app.js','INTEGER','state','sequelize','exports','STRING'];(function(_0x2bae1f,_0x5b3a8b){var _0x125974=function(_0x3e3c84){while(--_0x3e3c84){_0x2bae1f['push'](_0x2bae1f['shift']());}};_0x125974(++_0x5b3a8b);}(_0x98b7,0xc1));var _0x798b=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x98b7[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0x798b('0x0'));module[_0x798b('0x1')]={'name':{'type':Sequelize[_0x798b('0x2')],'allowNull':![],'unique':_0x798b('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':_0x798b('0x4')},'filename':{'type':Sequelize[_0x798b('0x2')]},'path':{'type':Sequelize[_0x798b('0x2')]},'type':{'type':Sequelize[_0x798b('0x2')]},'size':{'type':Sequelize[_0x798b('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x798b('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x798b('0x2')],'unique':_0x798b('0x6')},'description':{'type':Sequelize[_0x798b('0x2')]},'title':{'type':Sequelize[_0x798b('0x2')]},'remoteUri':{'type':Sequelize[_0x798b('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}};
\ No newline at end of file
index 3309141..bec50d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4819=['bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','map','Integration','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','catch','show','keys','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4819,0xcd));var _0x9481=function(_0x529a72,_0x3a841b){_0x529a72=_0x529a72-0x0;var _0x5f0d01=_0x4819[_0x529a72];return _0x5f0d01;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];function respondWithStatusCode(_0xed8e9,_0x499b87){_0x499b87=_0x499b87||0xcc;return function(_0x5aac02){if(_0x5aac02){return _0xed8e9[_0x9481('0x1a')](_0x499b87);}return _0xed8e9[_0x9481('0x1b')](_0x499b87)[_0x9481('0x1c')]();};}function respondWithResult(_0x28fcb6,_0x3d23c2){_0x3d23c2=_0x3d23c2||0xc8;return function(_0xc7a0b5){if(_0xc7a0b5){return _0x28fcb6[_0x9481('0x1b')](_0x3d23c2)['json'](_0xc7a0b5);}};}function respondWithFilteredResult(_0x4220f1,_0x7a7ee){return function(_0x5b1fe6){if(_0x5b1fe6){var _0x2266d5=typeof _0x7a7ee['offset']===_0x9481('0x1d')&&typeof _0x7a7ee[_0x9481('0x1e')]===_0x9481('0x1d');var _0x2bb2a4=_0x5b1fe6['count'];var _0x5eda66=_0x2266d5?0x0:_0x7a7ee[_0x9481('0x1f')];var _0x50a559=_0x2266d5?_0x5b1fe6['count']:_0x7a7ee[_0x9481('0x1f')]+_0x7a7ee[_0x9481('0x1e')];var _0x18c6f5;if(_0x50a559>=_0x2bb2a4){_0x50a559=_0x2bb2a4;_0x18c6f5=0xc8;}else{_0x18c6f5=0xce;}_0x4220f1[_0x9481('0x1b')](_0x18c6f5);return _0x4220f1[_0x9481('0x20')](_0x9481('0x21'),_0x5eda66+'-'+_0x50a559+'/'+_0x2bb2a4)['json'](_0x5b1fe6);}return null;};}function patchUpdates(_0x2cf1aa){return function(_0x272a84){try{jsonpatch[_0x9481('0x22')](_0x272a84,_0x2cf1aa,!![]);}catch(_0x615e02){return BPromise[_0x9481('0x23')](_0x615e02);}return _0x272a84['save']();};}function saveUpdates(_0x215dd7,_0x294908){return function(_0x572599){if(_0x572599){return _0x572599[_0x9481('0x24')](_0x215dd7)[_0x9481('0x25')](function(_0x352b3a){return _0x352b3a;});}return null;};}function removeEntity(_0x1809d2,_0x2dc02e){return function(_0x49ecfa){if(_0x49ecfa){return _0x49ecfa[_0x9481('0x26')]()[_0x9481('0x25')](function(){_0x1809d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12b0c3,_0x299e28){return function(_0x550fce){if(!_0x550fce){_0x12b0c3[_0x9481('0x1a')](0x194);}return _0x550fce;};}function handleError(_0x20ff9a,_0xeff0a5){_0xeff0a5=_0xeff0a5||0x1f4;return function(_0x28ae1b){logger['error'](_0x28ae1b[_0x9481('0x27')]);if(_0x28ae1b[_0x9481('0x28')]){delete _0x28ae1b[_0x9481('0x28')];}_0x20ff9a['status'](_0xeff0a5)[_0x9481('0x29')](_0x28ae1b);};}exports['index']=function(_0x2e1eff,_0xe153ab){var _0x22ab26={},_0x13ef93={},_0x2e5e63={'count':0x0,'rows':[]};var _0x53560d=_[_0x9481('0x2a')](db[_0x9481('0x2b')][_0x9481('0x2c')],function(_0x4895a0){return{'name':_0x4895a0['fieldName'],'type':_0x4895a0[_0x9481('0x2d')][_0x9481('0x2e')]};});_0x13ef93[_0x9481('0x2f')]=_[_0x9481('0x2a')](_0x53560d,'name');_0x13ef93['query']=_['keys'](_0x2e1eff[_0x9481('0x30')]);_0x13ef93['filters']=_[_0x9481('0x31')](_0x13ef93['model'],_0x13ef93[_0x9481('0x30')]);_0x22ab26[_0x9481('0x32')]=_[_0x9481('0x31')](_0x13ef93[_0x9481('0x2f')],qs[_0x9481('0x33')](_0x2e1eff['query'][_0x9481('0x33')]));_0x22ab26[_0x9481('0x32')]=_0x22ab26[_0x9481('0x32')]['length']?_0x22ab26[_0x9481('0x32')]:_0x13ef93[_0x9481('0x2f')];if(!_0x2e1eff[_0x9481('0x30')][_0x9481('0x34')](_0x9481('0x35'))){_0x22ab26[_0x9481('0x1e')]=qs['limit'](_0x2e1eff[_0x9481('0x30')]['limit']);_0x22ab26[_0x9481('0x1f')]=qs[_0x9481('0x1f')](_0x2e1eff[_0x9481('0x30')][_0x9481('0x1f')]);}_0x22ab26[_0x9481('0x36')]=qs[_0x9481('0x37')](_0x2e1eff['query'][_0x9481('0x37')]);_0x22ab26[_0x9481('0x38')]=qs['filters'](_['pick'](_0x2e1eff[_0x9481('0x30')],_0x13ef93['filters']),_0x53560d);if(_0x2e1eff[_0x9481('0x30')][_0x9481('0x39')]){_0x22ab26[_0x9481('0x38')]=_[_0x9481('0x3a')](_0x22ab26['where'],{'$or':_[_0x9481('0x2a')](_0x53560d,function(_0x590d50){if(_0x590d50[_0x9481('0x2d')]!=='VIRTUAL'){var _0x2ce972={};_0x2ce972[_0x590d50['name']]={'$like':'%'+_0x2e1eff[_0x9481('0x30')][_0x9481('0x39')]+'%'};return _0x2ce972;}})});}_0x22ab26=_[_0x9481('0x3a')]({},_0x22ab26,_0x2e1eff[_0x9481('0x3b')]);var _0x97dc3e={'where':_0x22ab26[_0x9481('0x38')]};return db[_0x9481('0x2b')]['count'](_0x97dc3e)[_0x9481('0x25')](function(_0x3857e8){_0x2e5e63[_0x9481('0x3c')]=_0x3857e8;if(_0x2e1eff[_0x9481('0x30')][_0x9481('0x3d')]){_0x22ab26[_0x9481('0x3e')]=[{'all':!![]}];}return db[_0x9481('0x2b')]['findAll'](_0x22ab26);})[_0x9481('0x25')](function(_0x1872ff){_0x2e5e63['rows']=_0x1872ff;return _0x2e5e63;})[_0x9481('0x25')](respondWithFilteredResult(_0xe153ab,_0x22ab26))[_0x9481('0x3f')](handleError(_0xe153ab,null));};exports[_0x9481('0x40')]=function(_0x3eb9ee,_0x29a8e9){var _0x5a8ffd={'raw':![],'where':{'id':_0x3eb9ee['params']['id']}},_0x304791={};_0x304791[_0x9481('0x2f')]=_[_0x9481('0x41')](db['Integration']['rawAttributes']);_0x304791[_0x9481('0x30')]=_[_0x9481('0x41')](_0x3eb9ee[_0x9481('0x30')]);_0x304791['filters']=_[_0x9481('0x31')](_0x304791[_0x9481('0x2f')],_0x304791['query']);_0x5a8ffd['attributes']=_[_0x9481('0x31')](_0x304791['model'],qs[_0x9481('0x33')](_0x3eb9ee[_0x9481('0x30')][_0x9481('0x33')]));_0x5a8ffd[_0x9481('0x32')]=_0x5a8ffd[_0x9481('0x32')]['length']?_0x5a8ffd[_0x9481('0x32')]:_0x304791[_0x9481('0x2f')];if(_0x3eb9ee['query'][_0x9481('0x3d')]){_0x5a8ffd[_0x9481('0x3e')]=[{'all':!![]}];}_0x5a8ffd=_[_0x9481('0x3a')]({},_0x5a8ffd,_0x3eb9ee[_0x9481('0x3b')]);return db[_0x9481('0x2b')][_0x9481('0x42')](_0x5a8ffd)[_0x9481('0x25')](handleEntityNotFound(_0x29a8e9,null))[_0x9481('0x25')](respondWithResult(_0x29a8e9,null))[_0x9481('0x3f')](handleError(_0x29a8e9,null));};exports['create']=function(_0xd36133,_0x5d3a06){return db['Integration'][_0x9481('0x43')](_0xd36133['body'],{})[_0x9481('0x25')](respondWithResult(_0x5d3a06,0xc9))[_0x9481('0x3f')](handleError(_0x5d3a06,null));};exports['update']=function(_0x277e2a,_0x1044a2){if(_0x277e2a[_0x9481('0x44')]['id']){delete _0x277e2a[_0x9481('0x44')]['id'];}return db[_0x9481('0x2b')][_0x9481('0x42')]({'where':{'id':_0x277e2a['params']['id']}})['then'](handleEntityNotFound(_0x1044a2,null))[_0x9481('0x25')](saveUpdates(_0x277e2a[_0x9481('0x44')],null))[_0x9481('0x25')](respondWithResult(_0x1044a2,null))[_0x9481('0x3f')](handleError(_0x1044a2,null));};exports[_0x9481('0x26')]=function(_0x353aab,_0x1c070c){return db[_0x9481('0x2b')]['find']({'where':{'id':_0x353aab[_0x9481('0x45')]['id']}})[_0x9481('0x25')](handleEntityNotFound(_0x1c070c,null))[_0x9481('0x25')](removeEntity(_0x1c070c,null))[_0x9481('0x3f')](handleError(_0x1c070c,null));};
\ No newline at end of file
+var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','Integration','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x55bb93,_0x3f0ef7){var _0x340625=function(_0x59e35f){while(--_0x59e35f){_0x55bb93['push'](_0x55bb93['shift']());}};_0x340625(++_0x3f0ef7);}(_0x7a54,0x106));var _0x47a5=function(_0x99c5e3,_0x37d804){_0x99c5e3=_0x99c5e3-0x0;var _0x40c997=_0x7a54[_0x99c5e3];return _0x40c997;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['Integration'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['Integration']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['Integration']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};
\ No newline at end of file
index dddface..bb34038 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ba2=['moment','bluebird','request-promise','path','rimraf','./integration.attributes','exports','define','Integration','integrations','lodash','../../config/logger'];(function(_0x2d9535,_0x4bc592){var _0xb4e710=function(_0x50b9a9){while(--_0x50b9a9){_0x2d9535['push'](_0x2d9535['shift']());}};_0xb4e710(++_0x4bc592);}(_0x8ba2,0x18a));var _0x28ba=function(_0x510806,_0x40816d){_0x510806=_0x510806-0x0;var _0x533527=_0x8ba2[_0x510806];return _0x533527;};'use strict';var _=require(_0x28ba('0x0'));var util=require('util');var logger=require(_0x28ba('0x1'))('api');var moment=require(_0x28ba('0x2'));var BPromise=require(_0x28ba('0x3'));var rp=require(_0x28ba('0x4'));var fs=require('fs');var path=require(_0x28ba('0x5'));var rimraf=require(_0x28ba('0x6'));var config=require('../../config/environment');var attributes=require(_0x28ba('0x7'));module[_0x28ba('0x8')]=function(_0x150919,_0xa80179){return _0x150919[_0x28ba('0x9')](_0x28ba('0xa'),attributes,{'tableName':_0x28ba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xebd8=['exports','util','../../config/logger','api','moment','request-promise','path','./integration.attributes'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xebd8,0x1c9));var _0x8ebd=function(_0x168150,_0x219b18){_0x168150=_0x168150-0x0;var _0x3f3518=_0xebd8[_0x168150];return _0x3f3518;};'use strict';var _=require('lodash');var util=require(_0x8ebd('0x0'));var logger=require(_0x8ebd('0x1'))(_0x8ebd('0x2'));var moment=require(_0x8ebd('0x3'));var BPromise=require('bluebird');var rp=require(_0x8ebd('0x4'));var fs=require('fs');var path=require(_0x8ebd('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8ebd('0x6'));module[_0x8ebd('0x7')]=function(_0x47bd83,_0x5a98c0){return _0x47bd83['define']('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1fb7f64..49c468e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd943=['info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x2f64a6,_0x501f2){var _0x524a92=function(_0x3d6d91){while(--_0x3d6d91){_0x2f64a6['push'](_0x2f64a6['shift']());}};_0x524a92(++_0x501f2);}(_0xd943,0x15d));var _0x3d94=function(_0x225b2c,_0x4925db){_0x225b2c=_0x225b2c-0x0;var _0xd0751=_0xd943[_0x225b2c];return _0xd0751;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('Integration,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});}
\ No newline at end of file
+var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x4975,0x86));var _0x5497=function(_0xee4c68,_0x5ddacf){_0xee4c68=_0xee4c68-0x0;var _0x44be43=_0x4975[_0xee4c68];return _0x44be43;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Integration,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
index 6002e0c..b8a5cff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a85=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x49cfb6,_0x5ccff2){var _0x1ba905=function(_0x441f93){while(--_0x441f93){_0x49cfb6['push'](_0x49cfb6['shift']());}};_0x1ba905(++_0x5ccff2);}(_0x1a85,0x178));var _0x51a8=function(_0x3e2ce6,_0x1e055c){_0x3e2ce6=_0x3e2ce6-0x0;var _0x4ccc1b=_0x1a85[_0x3e2ce6];return _0x4ccc1b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x51a8('0x3'));var interaction=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var controller=require('./integrationReport.controller');router[_0x51a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x51a8('0x7')]);router['get'](_0x51a8('0x8'),auth[_0x51a8('0x9')](),controller['describe']);router[_0x51a8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x51a8('0xa')]);router[_0x51a8('0xb')]('/',auth[_0x51a8('0x9')](),controller[_0x51a8('0xc')]);router[_0x51a8('0xd')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xf')]);router[_0x51a8('0x10')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x11')]);module[_0x51a8('0x12')]=router;
\ No newline at end of file
+var _0x0295=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x0295,0x1f0));var _0x5029=function(_0x350465,_0x18ed5d){_0x350465=_0x350465-0x0;var _0x4ae53d=_0x0295[_0x350465];return _0x4ae53d;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5029('0x7')]('/:id',auth[_0x5029('0x8')](),controller['show']);router[_0x5029('0xa')]('/',auth['isAuthenticated'](),controller[_0x5029('0xb')]);router[_0x5029('0xc')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0x10')]);module[_0x5029('0x11')]=router;
\ No newline at end of file
index cdd5d15..4f2c09e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6dd=['TEXT','ENUM','SENT','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xa6dd,0x7e));var _0xda6d=function(_0x5edafc,_0x22002c){_0x5edafc=_0x5edafc-0x0;var _0x1fa600=_0xa6dd[_0x5edafc];return _0x1fa600;};'use strict';var Sequelize=require(_0xda6d('0x0'));module[_0xda6d('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xda6d('0x2')]},'exitStatus':{'type':Sequelize[_0xda6d('0x2')]},'ticketId':{'type':Sequelize[_0xda6d('0x2')]},'integrationId':{'type':Sequelize[_0xda6d('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xda6d('0x2')]},'calleridnum':{'type':Sequelize[_0xda6d('0x2')]},'calleridname':{'type':Sequelize[_0xda6d('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xda6d('0x2')]},'membername':{'type':Sequelize[_0xda6d('0x2')]},'agentcalledAt':{'type':Sequelize[_0xda6d('0x4')]},'agentconnectAt':{'type':Sequelize[_0xda6d('0x4')]},'holdtime':{'type':Sequelize[_0xda6d('0x3')]},'agentcomplete':{'type':Sequelize[_0xda6d('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xda6d('0x4')]},'talktime':{'type':Sequelize[_0xda6d('0x3')]},'agentacw':{'type':Sequelize[_0xda6d('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xda6d('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xda6d('0x4')]},'agentdump':{'type':Sequelize[_0xda6d('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xda6d('0x4')]},'lastevent':{'type':Sequelize[_0xda6d('0x2')]},'channel':{'type':Sequelize[_0xda6d('0x2')]},'channelstate':{'type':Sequelize[_0xda6d('0x3')]},'channelstatedesc':{'type':Sequelize[_0xda6d('0x2')]},'connectedlinenum':{'type':Sequelize[_0xda6d('0x2')]},'connectedlinename':{'type':Sequelize[_0xda6d('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xda6d('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xda6d('0x2')]},'destchannel':{'type':Sequelize[_0xda6d('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xda6d('0x2')]},'destcalleridnum':{'type':Sequelize[_0xda6d('0x2')]},'destcalleridname':{'type':Sequelize[_0xda6d('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xda6d('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xda6d('0x2')]},'destlanguage':{'type':Sequelize[_0xda6d('0x2')]},'destaccountcode':{'type':Sequelize[_0xda6d('0x2')]},'destcontext':{'type':Sequelize[_0xda6d('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xda6d('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xda6d('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xda6d('0x2')]},'to':{'type':Sequelize[_0xda6d('0x2')]},'cc':{'type':Sequelize[_0xda6d('0x2')]},'attachment':{'type':Sequelize[_0xda6d('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xda6d('0x6')]},'status':{'type':Sequelize[_0xda6d('0x7')](_0xda6d('0x8'),'SENDING',_0xda6d('0x9'),_0xda6d('0xa'))},'url':{'type':Sequelize[_0xda6d('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xda6d('0x2')]},'projectId':{'type':Sequelize[_0xda6d('0x3')]}};
\ No newline at end of file
+var _0x46ff=['SENT','SENDING','RECEIVED','FAILED','sequelize','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0x2eb35d,_0x4a7a45){var _0x1f9854=function(_0x5eb6f9){while(--_0x5eb6f9){_0x2eb35d['push'](_0x2eb35d['shift']());}};_0x1f9854(++_0x4a7a45);}(_0x46ff,0x9a));var _0xf46f=function(_0x1469b5,_0x454875){_0x1469b5=_0x1469b5-0x0;var _0x543a97=_0x46ff[_0x1469b5];return _0x543a97;};'use strict';var Sequelize=require(_0xf46f('0x0'));module['exports']={'integration':{'type':Sequelize[_0xf46f('0x1')]},'eventChannel':{'type':Sequelize[_0xf46f('0x1')]},'exitStatus':{'type':Sequelize[_0xf46f('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xf46f('0x2')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xf46f('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xf46f('0x1')]},'queue':{'type':Sequelize[_0xf46f('0x1')]},'interface':{'type':Sequelize[_0xf46f('0x1')]},'membername':{'type':Sequelize[_0xf46f('0x1')]},'agentcalledAt':{'type':Sequelize[_0xf46f('0x3')]},'agentconnectAt':{'type':Sequelize[_0xf46f('0x3')]},'holdtime':{'type':Sequelize[_0xf46f('0x2')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xf46f('0x3')]},'talktime':{'type':Sequelize[_0xf46f('0x2')]},'agentacw':{'type':Sequelize[_0xf46f('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf46f('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xf46f('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xf46f('0x3')]},'agentdump':{'type':Sequelize[_0xf46f('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xf46f('0x3')]},'lastevent':{'type':Sequelize[_0xf46f('0x1')]},'channel':{'type':Sequelize[_0xf46f('0x1')]},'channelstate':{'type':Sequelize[_0xf46f('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xf46f('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xf46f('0x1')]},'accountcode':{'type':Sequelize[_0xf46f('0x1')]},'context':{'type':Sequelize[_0xf46f('0x1')]},'exten':{'type':Sequelize[_0xf46f('0x1')]},'priority':{'type':Sequelize[_0xf46f('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xf46f('0x1')]},'destcalleridnum':{'type':Sequelize[_0xf46f('0x1')]},'destcalleridname':{'type':Sequelize[_0xf46f('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xf46f('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xf46f('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xf46f('0x1')]},'destpriority':{'type':Sequelize[_0xf46f('0x1')]},'destuniqueid':{'type':Sequelize[_0xf46f('0x1')]},'messageId':{'type':Sequelize[_0xf46f('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xf46f('0x1')]},'from':{'type':Sequelize[_0xf46f('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xf46f('0x1')]},'attachment':{'type':Sequelize[_0xf46f('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xf46f('0x5')]},'status':{'type':Sequelize['ENUM'](_0xf46f('0x6'),_0xf46f('0x7'),_0xf46f('0x8'),_0xf46f('0x9'))},'url':{'type':Sequelize[_0xf46f('0x1')]},'app':{'type':Sequelize[_0xf46f('0x1')]},'appdata':{'type':Sequelize[_0xf46f('0x1')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 9aa7172..8d317d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57db=['mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','status','error','stack','name','map','IntegrationReport','rawAttributes','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','findAll','rows','catch','params','includeAll','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x4e8ac9,_0x35122b){var _0x49ecce=function(_0x462657){while(--_0x462657){_0x4e8ac9['push'](_0x4e8ac9['shift']());}};_0x49ecce(++_0x35122b);}(_0x57db,0xe3));var _0xb57d=function(_0x37b713,_0x35372e){_0x37b713=_0x37b713-0x0;var _0x477881=_0x57db[_0x37b713];return _0x477881;};'use strict';var emlformat=require(_0xb57d('0x0'));var rimraf=require(_0xb57d('0x1'));var zipdir=require(_0xb57d('0x2'));var jsonpatch=require(_0xb57d('0x3'));var rp=require(_0xb57d('0x4'));var moment=require(_0xb57d('0x5'));var BPromise=require(_0xb57d('0x6'));var Mustache=require(_0xb57d('0x7'));var util=require(_0xb57d('0x8'));var path=require('path');var sox=require(_0xb57d('0x9'));var csv=require(_0xb57d('0xa'));var ejs=require(_0xb57d('0xb'));var fs=require('fs');var fs_extra=require(_0xb57d('0xc'));var _=require(_0xb57d('0xd'));var squel=require(_0xb57d('0xe'));var crypto=require('crypto');var jsforce=require(_0xb57d('0xf'));var deskjs=require(_0xb57d('0x10'));var toCsv=require(_0xb57d('0xa'));var querystring=require(_0xb57d('0x11'));var Papa=require(_0xb57d('0x12'));var Redis=require(_0xb57d('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb57d('0x14'));var hardwareService=require(_0xb57d('0x15'));var logger=require(_0xb57d('0x16'))('api');var utils=require(_0xb57d('0x17'));var config=require(_0xb57d('0x18'));var licenseUtil=require(_0xb57d('0x19'));var db=require(_0xb57d('0x1a'))['db'];function respondWithStatusCode(_0x4a6488,_0x3e8a95){_0x3e8a95=_0x3e8a95||0xcc;return function(_0x31f538){if(_0x31f538){return _0x4a6488[_0xb57d('0x1b')](_0x3e8a95);}return _0x4a6488['status'](_0x3e8a95)[_0xb57d('0x1c')]();};}function respondWithResult(_0x5a147a,_0x3e4b7c){_0x3e4b7c=_0x3e4b7c||0xc8;return function(_0xd901eb){if(_0xd901eb){return _0x5a147a['status'](_0x3e4b7c)['json'](_0xd901eb);}};}function respondWithFilteredResult(_0x337b82,_0x41ec3d){return function(_0x442722){if(_0x442722){var _0x1374f6=typeof _0x41ec3d[_0xb57d('0x1d')]==='undefined'&&typeof _0x41ec3d[_0xb57d('0x1e')]==='undefined';var _0xb52502=_0x442722['count'];var _0x2585d2=_0x1374f6?0x0:_0x41ec3d[_0xb57d('0x1d')];var _0x79ebdb=_0x1374f6?_0x442722[_0xb57d('0x1f')]:_0x41ec3d[_0xb57d('0x1d')]+_0x41ec3d[_0xb57d('0x1e')];var _0x129191;if(_0x79ebdb>=_0xb52502){_0x79ebdb=_0xb52502;_0x129191=0xc8;}else{_0x129191=0xce;}_0x337b82['status'](_0x129191);return _0x337b82[_0xb57d('0x20')](_0xb57d('0x21'),_0x2585d2+'-'+_0x79ebdb+'/'+_0xb52502)[_0xb57d('0x22')](_0x442722);}return null;};}function patchUpdates(_0x508e69){return function(_0x284f83){try{jsonpatch[_0xb57d('0x23')](_0x284f83,_0x508e69,!![]);}catch(_0x438111){return BPromise[_0xb57d('0x24')](_0x438111);}return _0x284f83[_0xb57d('0x25')]();};}function saveUpdates(_0x292d6d,_0xe77513){return function(_0xba3e5e){if(_0xba3e5e){return _0xba3e5e[_0xb57d('0x26')](_0x292d6d)[_0xb57d('0x27')](function(_0x2cab7d){return _0x2cab7d;});}return null;};}function removeEntity(_0x25de20,_0x2ada80){return function(_0x598c79){if(_0x598c79){return _0x598c79[_0xb57d('0x28')]()['then'](function(){_0x25de20[_0xb57d('0x29')](0xcc)[_0xb57d('0x1c')]();});}};}function handleEntityNotFound(_0x38584c,_0x12935e){return function(_0xcade47){if(!_0xcade47){_0x38584c[_0xb57d('0x1b')](0x194);}return _0xcade47;};}function handleError(_0x82c5a4,_0x3d436a){_0x3d436a=_0x3d436a||0x1f4;return function(_0x26c34b){logger[_0xb57d('0x2a')](_0x26c34b[_0xb57d('0x2b')]);if(_0x26c34b[_0xb57d('0x2c')]){delete _0x26c34b[_0xb57d('0x2c')];}_0x82c5a4[_0xb57d('0x29')](_0x3d436a)['send'](_0x26c34b);};}exports['index']=function(_0x1fe55c,_0x67527a){var _0x177404={},_0x2b88f9={},_0x3d3d3a={'count':0x0,'rows':[]};var _0x384382=_[_0xb57d('0x2d')](db[_0xb57d('0x2e')][_0xb57d('0x2f')],function(_0x55dcb2){return{'name':_0x55dcb2['fieldName'],'type':_0x55dcb2['type'][_0xb57d('0x30')]};});_0x2b88f9['model']=_[_0xb57d('0x2d')](_0x384382,'name');_0x2b88f9[_0xb57d('0x31')]=_[_0xb57d('0x32')](_0x1fe55c[_0xb57d('0x31')]);_0x2b88f9[_0xb57d('0x33')]=_[_0xb57d('0x34')](_0x2b88f9[_0xb57d('0x35')],_0x2b88f9[_0xb57d('0x31')]);_0x177404['attributes']=_[_0xb57d('0x34')](_0x2b88f9['model'],qs[_0xb57d('0x36')](_0x1fe55c[_0xb57d('0x31')][_0xb57d('0x36')]));_0x177404[_0xb57d('0x37')]=_0x177404[_0xb57d('0x37')][_0xb57d('0x38')]?_0x177404[_0xb57d('0x37')]:_0x2b88f9[_0xb57d('0x35')];if(!_0x1fe55c[_0xb57d('0x31')][_0xb57d('0x39')](_0xb57d('0x3a'))){_0x177404[_0xb57d('0x1e')]=qs[_0xb57d('0x1e')](_0x1fe55c[_0xb57d('0x31')][_0xb57d('0x1e')]);_0x177404[_0xb57d('0x1d')]=qs[_0xb57d('0x1d')](_0x1fe55c['query'][_0xb57d('0x1d')]);}_0x177404[_0xb57d('0x3b')]=qs[_0xb57d('0x3c')](_0x1fe55c['query']['sort']);_0x177404[_0xb57d('0x3d')]=qs[_0xb57d('0x33')](_[_0xb57d('0x3e')](_0x1fe55c[_0xb57d('0x31')],_0x2b88f9[_0xb57d('0x33')]),_0x384382);if(_0x1fe55c[_0xb57d('0x31')][_0xb57d('0x3f')]){_0x177404[_0xb57d('0x3d')]=_[_0xb57d('0x40')](_0x177404[_0xb57d('0x3d')],{'$or':_[_0xb57d('0x2d')](_0x384382,function(_0x1b8792){if(_0x1b8792[_0xb57d('0x41')]!==_0xb57d('0x42')){var _0x80d1b={};_0x80d1b[_0x1b8792[_0xb57d('0x2c')]]={'$like':'%'+_0x1fe55c['query']['filter']+'%'};return _0x80d1b;}})});}_0x177404=_[_0xb57d('0x40')]({},_0x177404,_0x1fe55c['options']);var _0x52c516={'where':_0x177404[_0xb57d('0x3d')]};return db['IntegrationReport'][_0xb57d('0x1f')](_0x52c516)[_0xb57d('0x27')](function(_0x32970a){_0x3d3d3a[_0xb57d('0x1f')]=_0x32970a;if(_0x1fe55c[_0xb57d('0x31')]['includeAll']){_0x177404['include']=[{'all':!![]}];}return db[_0xb57d('0x2e')][_0xb57d('0x43')](_0x177404);})[_0xb57d('0x27')](function(_0x7c172a){_0x3d3d3a[_0xb57d('0x44')]=_0x7c172a;return _0x3d3d3a;})['then'](respondWithFilteredResult(_0x67527a,_0x177404))[_0xb57d('0x45')](handleError(_0x67527a,null));};exports['show']=function(_0x34c47e,_0x2203f1){var _0x5e0ab0={'raw':![],'where':{'id':_0x34c47e[_0xb57d('0x46')]['id']}},_0x5ea474={};_0x5ea474[_0xb57d('0x35')]=_[_0xb57d('0x32')](db[_0xb57d('0x2e')][_0xb57d('0x2f')]);_0x5ea474[_0xb57d('0x31')]=_[_0xb57d('0x32')](_0x34c47e['query']);_0x5ea474[_0xb57d('0x33')]=_[_0xb57d('0x34')](_0x5ea474['model'],_0x5ea474[_0xb57d('0x31')]);_0x5e0ab0[_0xb57d('0x37')]=_[_0xb57d('0x34')](_0x5ea474[_0xb57d('0x35')],qs['fields'](_0x34c47e[_0xb57d('0x31')]['fields']));_0x5e0ab0[_0xb57d('0x37')]=_0x5e0ab0[_0xb57d('0x37')][_0xb57d('0x38')]?_0x5e0ab0[_0xb57d('0x37')]:_0x5ea474[_0xb57d('0x35')];if(_0x34c47e[_0xb57d('0x31')][_0xb57d('0x47')]){_0x5e0ab0[_0xb57d('0x48')]=[{'all':!![]}];}_0x5e0ab0=_['merge']({},_0x5e0ab0,_0x34c47e[_0xb57d('0x49')]);return db[_0xb57d('0x2e')][_0xb57d('0x4a')](_0x5e0ab0)[_0xb57d('0x27')](handleEntityNotFound(_0x2203f1,null))[_0xb57d('0x27')](respondWithResult(_0x2203f1,null))['catch'](handleError(_0x2203f1,null));};exports[_0xb57d('0x4b')]=function(_0x239923,_0x1df49f){return db[_0xb57d('0x2e')][_0xb57d('0x4b')](_0x239923[_0xb57d('0x4c')],{})[_0xb57d('0x27')](respondWithResult(_0x1df49f,0xc9))[_0xb57d('0x45')](handleError(_0x1df49f,null));};exports[_0xb57d('0x26')]=function(_0x13413e,_0x443cc3){if(_0x13413e['body']['id']){delete _0x13413e['body']['id'];}return db['IntegrationReport'][_0xb57d('0x4a')]({'where':{'id':_0x13413e[_0xb57d('0x46')]['id']}})[_0xb57d('0x27')](handleEntityNotFound(_0x443cc3,null))[_0xb57d('0x27')](saveUpdates(_0x13413e[_0xb57d('0x4c')],null))[_0xb57d('0x27')](respondWithResult(_0x443cc3,null))[_0xb57d('0x45')](handleError(_0x443cc3,null));};exports[_0xb57d('0x28')]=function(_0x52ba2c,_0x1ca063){return db[_0xb57d('0x2e')][_0xb57d('0x4a')]({'where':{'id':_0x52ba2c['params']['id']}})[_0xb57d('0x27')](handleEntityNotFound(_0x1ca063,null))[_0xb57d('0x27')](removeEntity(_0x1ca063,null))[_0xb57d('0x45')](handleError(_0x1ca063,null));};exports[_0xb57d('0x4d')]=function(_0x39f2cf,_0x54f9b3){return db[_0xb57d('0x2e')][_0xb57d('0x4d')]()[_0xb57d('0x27')](respondWithResult(_0x54f9b3,null))[_0xb57d('0x45')](handleError(_0x54f9b3,null));};
\ No newline at end of file
+var _0xfe21=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','filter','merge','options','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','IntegrationReport'];(function(_0x4c1c70,_0x4e68f5){var _0x1c3740=function(_0x3f62ce){while(--_0x3f62ce){_0x4c1c70['push'](_0x4c1c70['shift']());}};_0x1c3740(++_0x4e68f5);}(_0xfe21,0x1ee));var _0x1fe2=function(_0x154b83,_0x3cad49){_0x154b83=_0x154b83-0x0;var _0x4a4afd=_0xfe21[_0x154b83];return _0x4a4afd;};'use strict';var emlformat=require(_0x1fe2('0x0'));var rimraf=require(_0x1fe2('0x1'));var zipdir=require(_0x1fe2('0x2'));var jsonpatch=require(_0x1fe2('0x3'));var rp=require(_0x1fe2('0x4'));var moment=require(_0x1fe2('0x5'));var BPromise=require(_0x1fe2('0x6'));var Mustache=require(_0x1fe2('0x7'));var util=require('util');var path=require(_0x1fe2('0x8'));var sox=require(_0x1fe2('0x9'));var csv=require(_0x1fe2('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1fe2('0xb'));var squel=require(_0x1fe2('0xc'));var crypto=require('crypto');var jsforce=require(_0x1fe2('0xd'));var deskjs=require(_0x1fe2('0xe'));var toCsv=require(_0x1fe2('0xa'));var querystring=require(_0x1fe2('0xf'));var Papa=require(_0x1fe2('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1fe2('0x11'));var as=require(_0x1fe2('0x12'));var hardwareService=require(_0x1fe2('0x13'));var logger=require('../../config/logger')(_0x1fe2('0x14'));var utils=require('../../config/utils');var config=require(_0x1fe2('0x15'));var licenseUtil=require(_0x1fe2('0x16'));var db=require(_0x1fe2('0x17'))['db'];function respondWithStatusCode(_0x4198ec,_0x2b603d){_0x2b603d=_0x2b603d||0xcc;return function(_0x1f843c){if(_0x1f843c){return _0x4198ec[_0x1fe2('0x18')](_0x2b603d);}return _0x4198ec[_0x1fe2('0x19')](_0x2b603d)[_0x1fe2('0x1a')]();};}function respondWithResult(_0x2c1a93,_0x4f403d){_0x4f403d=_0x4f403d||0xc8;return function(_0x25d1bb){if(_0x25d1bb){return _0x2c1a93[_0x1fe2('0x19')](_0x4f403d)[_0x1fe2('0x1b')](_0x25d1bb);}};}function respondWithFilteredResult(_0x41248e,_0x17b9a5){return function(_0x381136){if(_0x381136){var _0x27843c=typeof _0x17b9a5[_0x1fe2('0x1c')]===_0x1fe2('0x1d')&&typeof _0x17b9a5[_0x1fe2('0x1e')]===_0x1fe2('0x1d');var _0x2da127=_0x381136['count'];var _0x162367=_0x27843c?0x0:_0x17b9a5['offset'];var _0x4b70e6=_0x27843c?_0x381136[_0x1fe2('0x1f')]:_0x17b9a5[_0x1fe2('0x1c')]+_0x17b9a5[_0x1fe2('0x1e')];var _0x2e18d6;if(_0x4b70e6>=_0x2da127){_0x4b70e6=_0x2da127;_0x2e18d6=0xc8;}else{_0x2e18d6=0xce;}_0x41248e[_0x1fe2('0x19')](_0x2e18d6);return _0x41248e[_0x1fe2('0x20')](_0x1fe2('0x21'),_0x162367+'-'+_0x4b70e6+'/'+_0x2da127)[_0x1fe2('0x1b')](_0x381136);}return null;};}function patchUpdates(_0x525c0e){return function(_0x963d61){try{jsonpatch[_0x1fe2('0x22')](_0x963d61,_0x525c0e,!![]);}catch(_0x44c752){return BPromise[_0x1fe2('0x23')](_0x44c752);}return _0x963d61[_0x1fe2('0x24')]();};}function saveUpdates(_0x4651b0,_0x4bf740){return function(_0x109f26){if(_0x109f26){return _0x109f26[_0x1fe2('0x25')](_0x4651b0)[_0x1fe2('0x26')](function(_0x117285){return _0x117285;});}return null;};}function removeEntity(_0x171163,_0x557af1){return function(_0x83609a){if(_0x83609a){return _0x83609a['destroy']()[_0x1fe2('0x26')](function(){_0x171163[_0x1fe2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c220e,_0x1bc323){return function(_0x462f00){if(!_0x462f00){_0x3c220e[_0x1fe2('0x18')](0x194);}return _0x462f00;};}function handleError(_0x2faacd,_0x5327fd){_0x5327fd=_0x5327fd||0x1f4;return function(_0x56dab1){logger['error'](_0x56dab1[_0x1fe2('0x27')]);if(_0x56dab1[_0x1fe2('0x28')]){delete _0x56dab1[_0x1fe2('0x28')];}_0x2faacd['status'](_0x5327fd)[_0x1fe2('0x29')](_0x56dab1);};}exports[_0x1fe2('0x2a')]=function(_0x311e5d,_0x1f4cd9){var _0x168210={},_0x685046={},_0xcebaf8={'count':0x0,'rows':[]};var _0x523bec=_[_0x1fe2('0x2b')](db[_0x1fe2('0x2c')]['rawAttributes'],function(_0x3d99c0){return{'name':_0x3d99c0['fieldName'],'type':_0x3d99c0['type'][_0x1fe2('0x2d')]};});_0x685046[_0x1fe2('0x2e')]=_[_0x1fe2('0x2b')](_0x523bec,_0x1fe2('0x28'));_0x685046[_0x1fe2('0x2f')]=_[_0x1fe2('0x30')](_0x311e5d[_0x1fe2('0x2f')]);_0x685046[_0x1fe2('0x31')]=_[_0x1fe2('0x32')](_0x685046['model'],_0x685046[_0x1fe2('0x2f')]);_0x168210[_0x1fe2('0x33')]=_[_0x1fe2('0x32')](_0x685046[_0x1fe2('0x2e')],qs[_0x1fe2('0x34')](_0x311e5d[_0x1fe2('0x2f')]['fields']));_0x168210['attributes']=_0x168210['attributes'][_0x1fe2('0x35')]?_0x168210[_0x1fe2('0x33')]:_0x685046['model'];if(!_0x311e5d[_0x1fe2('0x2f')][_0x1fe2('0x36')](_0x1fe2('0x37'))){_0x168210[_0x1fe2('0x1e')]=qs[_0x1fe2('0x1e')](_0x311e5d[_0x1fe2('0x2f')]['limit']);_0x168210[_0x1fe2('0x1c')]=qs[_0x1fe2('0x1c')](_0x311e5d['query'][_0x1fe2('0x1c')]);}_0x168210[_0x1fe2('0x38')]=qs[_0x1fe2('0x39')](_0x311e5d[_0x1fe2('0x2f')][_0x1fe2('0x39')]);_0x168210['where']=qs[_0x1fe2('0x31')](_[_0x1fe2('0x3a')](_0x311e5d[_0x1fe2('0x2f')],_0x685046['filters']),_0x523bec);if(_0x311e5d['query']['filter']){_0x168210[_0x1fe2('0x3b')]=_['merge'](_0x168210['where'],{'$or':_[_0x1fe2('0x2b')](_0x523bec,function(_0x30385c){if(_0x30385c[_0x1fe2('0x3c')]!==_0x1fe2('0x3d')){var _0x15188e={};_0x15188e[_0x30385c['name']]={'$like':'%'+_0x311e5d[_0x1fe2('0x2f')][_0x1fe2('0x3e')]+'%'};return _0x15188e;}})});}_0x168210=_[_0x1fe2('0x3f')]({},_0x168210,_0x311e5d[_0x1fe2('0x40')]);var _0x44d887={'where':_0x168210['where']};return db[_0x1fe2('0x2c')][_0x1fe2('0x1f')](_0x44d887)['then'](function(_0x4ed83e){_0xcebaf8[_0x1fe2('0x1f')]=_0x4ed83e;if(_0x311e5d[_0x1fe2('0x2f')][_0x1fe2('0x41')]){_0x168210[_0x1fe2('0x42')]=[{'all':!![]}];}return db[_0x1fe2('0x2c')]['findAll'](_0x168210);})[_0x1fe2('0x26')](function(_0x483754){_0xcebaf8[_0x1fe2('0x43')]=_0x483754;return _0xcebaf8;})[_0x1fe2('0x26')](respondWithFilteredResult(_0x1f4cd9,_0x168210))['catch'](handleError(_0x1f4cd9,null));};exports[_0x1fe2('0x44')]=function(_0x209959,_0x13e3a7){var _0x38c715={'raw':![],'where':{'id':_0x209959[_0x1fe2('0x45')]['id']}},_0x5a8a18={};_0x5a8a18[_0x1fe2('0x2e')]=_[_0x1fe2('0x30')](db[_0x1fe2('0x2c')][_0x1fe2('0x46')]);_0x5a8a18[_0x1fe2('0x2f')]=_[_0x1fe2('0x30')](_0x209959[_0x1fe2('0x2f')]);_0x5a8a18[_0x1fe2('0x31')]=_[_0x1fe2('0x32')](_0x5a8a18[_0x1fe2('0x2e')],_0x5a8a18[_0x1fe2('0x2f')]);_0x38c715[_0x1fe2('0x33')]=_['intersection'](_0x5a8a18[_0x1fe2('0x2e')],qs['fields'](_0x209959[_0x1fe2('0x2f')][_0x1fe2('0x34')]));_0x38c715[_0x1fe2('0x33')]=_0x38c715[_0x1fe2('0x33')]['length']?_0x38c715[_0x1fe2('0x33')]:_0x5a8a18[_0x1fe2('0x2e')];if(_0x209959[_0x1fe2('0x2f')][_0x1fe2('0x41')]){_0x38c715[_0x1fe2('0x42')]=[{'all':!![]}];}_0x38c715=_['merge']({},_0x38c715,_0x209959['options']);return db['IntegrationReport'][_0x1fe2('0x47')](_0x38c715)[_0x1fe2('0x26')](handleEntityNotFound(_0x13e3a7,null))[_0x1fe2('0x26')](respondWithResult(_0x13e3a7,null))[_0x1fe2('0x48')](handleError(_0x13e3a7,null));};exports[_0x1fe2('0x49')]=function(_0x46e154,_0x9dced1){return db[_0x1fe2('0x2c')]['create'](_0x46e154[_0x1fe2('0x4a')],{})[_0x1fe2('0x26')](respondWithResult(_0x9dced1,0xc9))[_0x1fe2('0x48')](handleError(_0x9dced1,null));};exports[_0x1fe2('0x25')]=function(_0xab0210,_0x5061af){if(_0xab0210[_0x1fe2('0x4a')]['id']){delete _0xab0210[_0x1fe2('0x4a')]['id'];}return db[_0x1fe2('0x2c')][_0x1fe2('0x47')]({'where':{'id':_0xab0210['params']['id']}})[_0x1fe2('0x26')](handleEntityNotFound(_0x5061af,null))[_0x1fe2('0x26')](saveUpdates(_0xab0210['body'],null))['then'](respondWithResult(_0x5061af,null))['catch'](handleError(_0x5061af,null));};exports[_0x1fe2('0x4b')]=function(_0x2d4fe6,_0x500fc6){return db[_0x1fe2('0x2c')][_0x1fe2('0x47')]({'where':{'id':_0x2d4fe6['params']['id']}})[_0x1fe2('0x26')](handleEntityNotFound(_0x500fc6,null))['then'](removeEntity(_0x500fc6,null))['catch'](handleError(_0x500fc6,null));};exports[_0x1fe2('0x4c')]=function(_0x11e19f,_0x2d4233){return db[_0x1fe2('0x2c')]['describe']()['then'](respondWithResult(_0x2d4233,null))[_0x1fe2('0x48')](handleError(_0x2d4233,null));};
\ No newline at end of file
index 6628966..bb7351e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d51=['path','rimraf','exports','define','IntegrationReport','report_integration','util','../../config/logger','api'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x4d51,0x9f));var _0x14d5=function(_0x36bee2,_0x57b028){_0x36bee2=_0x36bee2-0x0;var _0x40bec2=_0x4d51[_0x36bee2];return _0x40bec2;};'use strict';var _=require('lodash');var util=require(_0x14d5('0x0'));var logger=require(_0x14d5('0x1'))(_0x14d5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x14d5('0x3'));var rimraf=require(_0x14d5('0x4'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0x14d5('0x5')]=function(_0x51a1db,_0x201f50){return _0x51a1db[_0x14d5('0x6')](_0x14d5('0x7'),attributes,{'tableName':_0x14d5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x38c6=['path','rimraf','../../config/environment','./integrationReport.attributes','exports','IntegrationReport','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x38c6,0x126));var _0x638c=function(_0x260478,_0x2040a1){_0x260478=_0x260478-0x0;var _0x4048fb=_0x38c6[_0x260478];return _0x4048fb;};'use strict';var _=require(_0x638c('0x0'));var util=require(_0x638c('0x1'));var logger=require(_0x638c('0x2'))(_0x638c('0x3'));var moment=require(_0x638c('0x4'));var BPromise=require(_0x638c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x638c('0x6'));var rimraf=require(_0x638c('0x7'));var config=require(_0x638c('0x8'));var attributes=require(_0x638c('0x9'));module[_0x638c('0xa')]=function(_0x2f4e76,_0x18d746){return _0x2f4e76['define'](_0x638c('0xb'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 75e26a3..b67573c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2fe=['then','info','IntegrationReport,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0xd2b185,_0x2519a5){var _0x2f4347=function(_0x15ca0e){while(--_0x15ca0e){_0xd2b185['push'](_0xd2b185['shift']());}};_0x2f4347(++_0x2519a5);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee2f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee2f('0x2'));var db=require(_0xee2f('0x3'))['db'];var utils=require(_0xee2f('0x4'));var logger=require(_0xee2f('0x5'))(_0xee2f('0x6'));var config=require('../../config/environment');var jayson=require(_0xee2f('0x7'));var client=jayson[_0xee2f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533a0,_0x2e1c8c,_0x5a7975){return new BPromise(function(_0x3c4095,_0x5ea796){return client[_0xee2f('0x9')](_0x1533a0,_0x5a7975)[_0xee2f('0xa')](function(_0x53f7dd){logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,'request\x20sent');logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2e1c8c,'request\x20sent',JSON[_0xee2f('0xd')](_0x53f7dd));if(_0x53f7dd['error']){if(_0x53f7dd['error']['code']===0x1f4){logger[_0xee2f('0xe')](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);return _0x5ea796(_0x53f7dd[_0xee2f('0xe')][_0xee2f('0xf')]);}logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x53f7dd['error'][_0xee2f('0xf')]);return _0x3c4095(_0x53f7dd[_0xee2f('0xe')]['message']);}else{logger[_0xee2f('0xb')](_0xee2f('0xc'),_0x2e1c8c,_0xee2f('0x10'));_0x3c4095(_0x53f7dd[_0xee2f('0x11')][_0xee2f('0xf')]);}})['catch'](function(_0x3f6372){logger['error'](_0xee2f('0xc'),_0x2e1c8c,_0x3f6372);_0x5ea796(_0x3f6372);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x528bb5,_0x119c5b){var _0x58e8ca=function(_0x5a8077){while(--_0x5a8077){_0x528bb5['push'](_0x528bb5['shift']());}};_0x58e8ca(++_0x119c5b);}(_0xadb5,0xad));var _0x5adb=function(_0x544559,_0x17cdb9){_0x544559=_0x544559-0x0;var _0x4b6bc0=_0xadb5[_0x544559];return _0x4b6bc0;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('IntegrationReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
index c69e33a..866a51f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06f4=['put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./interval.controller','get','isAuthenticated','show','post','/:id/sub_intervals/create_many','addIntervals'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x06f4,0x136));var _0x406f=function(_0x4ba2fe,_0x1a0190){_0x4ba2fe=_0x4ba2fe-0x0;var _0x9759b7=_0x06f4[_0x4ba2fe];return _0x9759b7;};'use strict';var multer=require(_0x406f('0x0'));var util=require(_0x406f('0x1'));var path=require('path');var timeout=require(_0x406f('0x2'));var express=require(_0x406f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x406f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x406f('0x5'));var controller=require(_0x406f('0x6'));router[_0x406f('0x7')]('/',auth[_0x406f('0x8')](),controller['index']);router[_0x406f('0x7')]('/:id',auth[_0x406f('0x8')](),controller[_0x406f('0x9')]);router[_0x406f('0x7')]('/:id/sub_intervals',auth[_0x406f('0x8')](),controller['getIntervals']);router['post']('/',auth[_0x406f('0x8')](),controller['create']);router[_0x406f('0xa')]('/:id/sub_intervals',auth[_0x406f('0x8')](),controller['addInterval']);router[_0x406f('0xa')](_0x406f('0xb'),auth['isAuthenticated'](),controller[_0x406f('0xc')]);router[_0x406f('0xd')](_0x406f('0xe'),auth[_0x406f('0x8')](),controller[_0x406f('0xf')]);router[_0x406f('0x10')](_0x406f('0xe'),auth[_0x406f('0x8')](),controller[_0x406f('0x11')]);module[_0x406f('0x12')]=router;
\ No newline at end of file
+var _0x3b61=['Router','fs-extra','../../components/auth/service','../../config/environment','./interval.controller','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x309251,_0x59a3d3){var _0x3c6e84=function(_0x2c535){while(--_0x2c535){_0x309251['push'](_0x309251['shift']());}};_0x3c6e84(++_0x59a3d3);}(_0x3b61,0x67));var _0x13b6=function(_0xf26c2e,_0x3d264d){_0xf26c2e=_0xf26c2e-0x0;var _0x44fa63=_0x3b61[_0xf26c2e];return _0x44fa63;};'use strict';var multer=require(_0x13b6('0x0'));var util=require(_0x13b6('0x1'));var path=require(_0x13b6('0x2'));var timeout=require(_0x13b6('0x3'));var express=require(_0x13b6('0x4'));var router=express[_0x13b6('0x5')]();var fs_extra=require(_0x13b6('0x6'));var auth=require(_0x13b6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x13b6('0x8'));var controller=require(_0x13b6('0x9'));router[_0x13b6('0xa')]('/',auth['isAuthenticated'](),controller[_0x13b6('0xb')]);router[_0x13b6('0xa')](_0x13b6('0xc'),auth[_0x13b6('0xd')](),controller[_0x13b6('0xe')]);router['get'](_0x13b6('0xf'),auth[_0x13b6('0xd')](),controller[_0x13b6('0x10')]);router[_0x13b6('0x11')]('/',auth[_0x13b6('0xd')](),controller[_0x13b6('0x12')]);router[_0x13b6('0x11')](_0x13b6('0xf'),auth[_0x13b6('0xd')](),controller[_0x13b6('0x13')]);router[_0x13b6('0x11')](_0x13b6('0x14'),auth[_0x13b6('0xd')](),controller[_0x13b6('0x15')]);router[_0x13b6('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x13b6('0x17')]);router[_0x13b6('0x18')](_0x13b6('0xc'),auth[_0x13b6('0xd')](),controller[_0x13b6('0x19')]);module[_0x13b6('0x1a')]=router;
\ No newline at end of file
index cf20450..43170eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92d4=['sequelize','exports','STRING'];(function(_0x183892,_0x39dc70){var _0x3dc309=function(_0x4b6058){while(--_0x4b6058){_0x183892['push'](_0x183892['shift']());}};_0x3dc309(++_0x39dc70);}(_0x92d4,0x168));var _0x492d=function(_0x5f50f0,_0x55a453){_0x5f50f0=_0x5f50f0-0x0;var _0x4c3888=_0x92d4[_0x5f50f0];return _0x4c3888;};'use strict';var Sequelize=require(_0x492d('0x0'));module[_0x492d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x492d('0x2')]},'interval':{'type':Sequelize[_0x492d('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0xf330=['sequelize','exports','STRING'];(function(_0x35a470,_0x1820a1){var _0x7349ff=function(_0x2680bb){while(--_0x2680bb){_0x35a470['push'](_0x35a470['shift']());}};_0x7349ff(++_0x1820a1);}(_0xf330,0x81));var _0x0f33=function(_0xda4c04,_0x2022ee){_0xda4c04=_0xda4c04-0x0;var _0x4d47cf=_0xf330[_0xda4c04];return _0x4d47cf;};'use strict';var Sequelize=require(_0x0f33('0x0'));module[_0x0f33('0x1')]={'name':{'type':Sequelize[_0x0f33('0x2')]},'description':{'type':Sequelize[_0x0f33('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index 817e1b4..730ce25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a63=['find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','pick','options','addIntervals','transaction','bulkCreate','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','offset','undefined','count','Content-Range','apply','reject','save','update','then','get','Intervals','UserProfileResource','destroy','end','stack','name','map','Interval','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params'];(function(_0xddfe05,_0x57b987){var _0x42b95e=function(_0x30699b){while(--_0x30699b){_0xddfe05['push'](_0xddfe05['shift']());}};_0x42b95e(++_0x57b987);}(_0x6a63,0x68));var _0x36a6=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x6a63[_0xc4001c];return _0x49f7bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x36a6('0x0'));var zipdir=require(_0x36a6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x36a6('0x2'));var moment=require(_0x36a6('0x3'));var BPromise=require(_0x36a6('0x4'));var Mustache=require('mustache');var util=require(_0x36a6('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x36a6('0x6'));var ejs=require(_0x36a6('0x7'));var fs=require('fs');var fs_extra=require(_0x36a6('0x8'));var _=require(_0x36a6('0x9'));var squel=require(_0x36a6('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x36a6('0xb'));var toCsv=require(_0x36a6('0x6'));var querystring=require(_0x36a6('0xc'));var Papa=require('papaparse');var Redis=require(_0x36a6('0xd'));var authService=require(_0x36a6('0xe'));var qs=require(_0x36a6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x36a6('0x10'))(_0x36a6('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x36a6('0x12'));var db=require(_0x36a6('0x13'))['db'];var extensions=require(_0x36a6('0x14'));function respondWithStatusCode(_0x47ff44,_0x5a2f06){_0x5a2f06=_0x5a2f06||0xcc;return function(_0x5aa747){if(_0x5aa747){return _0x47ff44[_0x36a6('0x15')](_0x5a2f06);}return _0x47ff44[_0x36a6('0x16')](_0x5a2f06)['end']();};}function respondWithResult(_0x113286,_0x210232){_0x210232=_0x210232||0xc8;return function(_0x1533b2){if(_0x1533b2){return _0x113286['status'](_0x210232)['json'](_0x1533b2);}};}function respondWithFilteredResult(_0x526ce5,_0x4d3b9b){return function(_0x13b824){if(_0x13b824){var _0x28c927=typeof _0x4d3b9b[_0x36a6('0x17')]===_0x36a6('0x18')&&typeof _0x4d3b9b['limit']===_0x36a6('0x18');var _0x377d11=_0x13b824[_0x36a6('0x19')];var _0x1a0142=_0x28c927?0x0:_0x4d3b9b[_0x36a6('0x17')];var _0x27dce1=_0x28c927?_0x13b824[_0x36a6('0x19')]:_0x4d3b9b[_0x36a6('0x17')]+_0x4d3b9b['limit'];var _0x10d0a5;if(_0x27dce1>=_0x377d11){_0x27dce1=_0x377d11;_0x10d0a5=0xc8;}else{_0x10d0a5=0xce;}_0x526ce5['status'](_0x10d0a5);return _0x526ce5['set'](_0x36a6('0x1a'),_0x1a0142+'-'+_0x27dce1+'/'+_0x377d11)['json'](_0x13b824);}return null;};}function patchUpdates(_0x364b81){return function(_0x313a72){try{jsonpatch[_0x36a6('0x1b')](_0x313a72,_0x364b81,!![]);}catch(_0xa7d38c){return BPromise[_0x36a6('0x1c')](_0xa7d38c);}return _0x313a72[_0x36a6('0x1d')]();};}function saveUpdates(_0x1510b1,_0x9bd5e6){return function(_0x1435ed){if(_0x1435ed){return _0x1435ed[_0x36a6('0x1e')](_0x1510b1)[_0x36a6('0x1f')](function(_0x31b5e4){return _0x31b5e4;});}return null;};}function removeEntity(_0x530854,_0x5ad33e){return function(_0x3785b0){if(_0x3785b0){return _0x3785b0['destroy']()[_0x36a6('0x1f')](function(){var _0x389442=_0x3785b0[_0x36a6('0x20')]({'plain':!![]});var _0x2c56df=_0x36a6('0x21');return db[_0x36a6('0x22')][_0x36a6('0x23')]({'where':{'type':_0x2c56df,'resourceId':_0x389442['id']}})[_0x36a6('0x1f')](function(){return _0x3785b0;});})['then'](function(){_0x530854[_0x36a6('0x16')](0xcc)[_0x36a6('0x24')]();});}};}function handleEntityNotFound(_0xf882dd,_0x188828){return function(_0xed0049){if(!_0xed0049){_0xf882dd[_0x36a6('0x15')](0x194);}return _0xed0049;};}function handleError(_0x28dc26,_0x14a093){_0x14a093=_0x14a093||0x1f4;return function(_0x3a1d14){logger['error'](_0x3a1d14[_0x36a6('0x25')]);if(_0x3a1d14[_0x36a6('0x26')]){delete _0x3a1d14[_0x36a6('0x26')];}_0x28dc26[_0x36a6('0x16')](_0x14a093)['send'](_0x3a1d14);};}exports['index']=function(_0xe950c4,_0x482196){var _0x1f1a7d={},_0x57ed16={},_0x3a816f={'count':0x0,'rows':[]};var _0x436071=_[_0x36a6('0x27')](db[_0x36a6('0x28')][_0x36a6('0x29')],function(_0x2eaa1c){return{'name':_0x2eaa1c['fieldName'],'type':_0x2eaa1c[_0x36a6('0x2a')]['key']};});_0x57ed16[_0x36a6('0x2b')]=_[_0x36a6('0x27')](_0x436071,_0x36a6('0x26'));_0x57ed16[_0x36a6('0x2c')]=_[_0x36a6('0x2d')](_0xe950c4['query']);_0x57ed16['filters']=_['intersection'](_0x57ed16[_0x36a6('0x2b')],_0x57ed16['query']);_0x1f1a7d['attributes']=_[_0x36a6('0x2e')](_0x57ed16[_0x36a6('0x2b')],qs['fields'](_0xe950c4['query'][_0x36a6('0x2f')]));_0x1f1a7d[_0x36a6('0x30')]=_0x1f1a7d[_0x36a6('0x30')][_0x36a6('0x31')]?_0x1f1a7d['attributes']:_0x57ed16['model'];if(!_0xe950c4[_0x36a6('0x2c')][_0x36a6('0x32')](_0x36a6('0x33'))){_0x1f1a7d['limit']=qs[_0x36a6('0x34')](_0xe950c4[_0x36a6('0x2c')][_0x36a6('0x34')]);_0x1f1a7d[_0x36a6('0x17')]=qs[_0x36a6('0x17')](_0xe950c4[_0x36a6('0x2c')][_0x36a6('0x17')]);}_0x1f1a7d[_0x36a6('0x35')]=qs['sort'](_0xe950c4[_0x36a6('0x2c')][_0x36a6('0x36')]);_0x1f1a7d[_0x36a6('0x37')]=qs['filters'](_['pick'](_0xe950c4[_0x36a6('0x2c')],_0x57ed16[_0x36a6('0x38')]),_0x436071);if(_0xe950c4['query'][_0x36a6('0x39')]){_0x1f1a7d[_0x36a6('0x37')]=_[_0x36a6('0x3a')](_0x1f1a7d['where'],{'$or':_[_0x36a6('0x27')](_0x436071,function(_0x50a9c0){if(_0x50a9c0[_0x36a6('0x2a')]!==_0x36a6('0x3b')){var _0xeaad42={};_0xeaad42[_0x50a9c0[_0x36a6('0x26')]]={'$like':'%'+_0xe950c4[_0x36a6('0x2c')][_0x36a6('0x39')]+'%'};return _0xeaad42;}})});}_0x1f1a7d=_['merge']({},_0x1f1a7d,_0xe950c4['options']);var _0x3d846d={'where':_0x1f1a7d[_0x36a6('0x37')]};return db[_0x36a6('0x28')][_0x36a6('0x19')](_0x3d846d)[_0x36a6('0x1f')](function(_0x3154a5){_0x3a816f[_0x36a6('0x19')]=_0x3154a5;if(_0xe950c4['query'][_0x36a6('0x3c')]){_0x1f1a7d[_0x36a6('0x3d')]=[{'all':!![]}];}return db[_0x36a6('0x28')][_0x36a6('0x3e')](_0x1f1a7d);})[_0x36a6('0x1f')](function(_0x39ba56){_0x3a816f[_0x36a6('0x3f')]=_0x39ba56;return _0x3a816f;})[_0x36a6('0x1f')](respondWithFilteredResult(_0x482196,_0x1f1a7d))['catch'](handleError(_0x482196,null));};exports[_0x36a6('0x40')]=function(_0x5da432,_0x5273d6){var _0x492eb2={'raw':!![],'where':{'id':_0x5da432[_0x36a6('0x41')]['id']}},_0x372b56={};_0x372b56[_0x36a6('0x2b')]=_[_0x36a6('0x2d')](db[_0x36a6('0x28')][_0x36a6('0x29')]);_0x372b56['query']=_[_0x36a6('0x2d')](_0x5da432['query']);_0x372b56['filters']=_[_0x36a6('0x2e')](_0x372b56[_0x36a6('0x2b')],_0x372b56[_0x36a6('0x2c')]);_0x492eb2[_0x36a6('0x30')]=_[_0x36a6('0x2e')](_0x372b56[_0x36a6('0x2b')],qs[_0x36a6('0x2f')](_0x5da432[_0x36a6('0x2c')][_0x36a6('0x2f')]));_0x492eb2[_0x36a6('0x30')]=_0x492eb2['attributes']['length']?_0x492eb2[_0x36a6('0x30')]:_0x372b56[_0x36a6('0x2b')];if(_0x5da432['query'][_0x36a6('0x3c')]){_0x492eb2[_0x36a6('0x3d')]=[{'all':!![]}];}_0x492eb2=_[_0x36a6('0x3a')]({},_0x492eb2,_0x5da432['options']);return db[_0x36a6('0x28')][_0x36a6('0x42')](_0x492eb2)[_0x36a6('0x1f')](handleEntityNotFound(_0x5273d6,null))[_0x36a6('0x1f')](respondWithResult(_0x5273d6,null))[_0x36a6('0x43')](handleError(_0x5273d6,null));};exports[_0x36a6('0x44')]=function(_0x3cb09e,_0x5b6cc1){return db['Interval'][_0x36a6('0x44')](_0x3cb09e[_0x36a6('0x45')],{})[_0x36a6('0x1f')](function(_0x3d0ffa){var _0x4f9692=_0x3cb09e[_0x36a6('0x46')][_0x36a6('0x20')]({'plain':!![]});if(!_0x4f9692)throw new Error(_0x36a6('0x47'));if(_0x4f9692['role']===_0x36a6('0x46')){var _0x24babe=_0x3d0ffa[_0x36a6('0x20')]({'plain':!![]});var _0x5fcbe='Intervals';return db['UserProfileSection'][_0x36a6('0x42')]({'where':{'name':_0x5fcbe,'userProfileId':_0x4f9692[_0x36a6('0x48')]},'raw':!![]})['then'](function(_0x3f3f55){if(_0x3f3f55&&_0x3f3f55[_0x36a6('0x49')]===0x0){return db[_0x36a6('0x22')][_0x36a6('0x44')]({'name':_0x24babe[_0x36a6('0x26')],'resourceId':_0x24babe['id'],'type':_0x3f3f55['name'],'sectionId':_0x3f3f55['id']},{})[_0x36a6('0x1f')](function(){return _0x3d0ffa;});}else{return _0x3d0ffa;}})[_0x36a6('0x43')](function(_0x369f13){logger[_0x36a6('0x4a')](_0x36a6('0x4b'),_0x369f13);throw _0x369f13;});}return _0x3d0ffa;})[_0x36a6('0x1f')](respondWithResult(_0x5b6cc1,0xc9))['catch'](handleError(_0x5b6cc1,null));};exports[_0x36a6('0x1e')]=function(_0x403c5f,_0x8c1ec5){if(_0x403c5f[_0x36a6('0x45')]['id']){delete _0x403c5f[_0x36a6('0x45')]['id'];}return db[_0x36a6('0x28')][_0x36a6('0x42')]({'where':{'id':_0x403c5f[_0x36a6('0x41')]['id']}})[_0x36a6('0x1f')](handleEntityNotFound(_0x8c1ec5,null))[_0x36a6('0x1f')](saveUpdates(_0x403c5f[_0x36a6('0x45')],null))[_0x36a6('0x1f')](respondWithResult(_0x8c1ec5,null))[_0x36a6('0x43')](handleError(_0x8c1ec5,null));};exports['destroy']=function(_0x50de2d,_0x49b0c9){return db[_0x36a6('0x28')][_0x36a6('0x42')]({'where':{'id':_0x50de2d['params']['id']}})[_0x36a6('0x1f')](handleEntityNotFound(_0x49b0c9,null))[_0x36a6('0x1f')](removeEntity(_0x49b0c9,null))[_0x36a6('0x43')](handleError(_0x49b0c9,null));};exports[_0x36a6('0x4c')]=function(_0x10508e,_0x13edc2,_0x18464e){if(_0x10508e['body']['id']){delete _0x10508e[_0x36a6('0x45')]['id'];}return db[_0x36a6('0x28')]['find']({'where':{'id':_0x10508e['params']['id']}})[_0x36a6('0x1f')](handleEntityNotFound(_0x13edc2,null))['then'](function(_0x24e6e6){if(_0x24e6e6){_0x10508e[_0x36a6('0x45')][_0x36a6('0x4d')]=_0x24e6e6['id'];return db[_0x36a6('0x28')][_0x36a6('0x44')](_0x10508e[_0x36a6('0x45')]);}})[_0x36a6('0x1f')](respondWithResult(_0x13edc2,null))[_0x36a6('0x43')](handleError(_0x13edc2,null));};exports[_0x36a6('0x4e')]=function(_0x353aa7,_0x35b60e,_0x5c0eae){var _0x50bd43={};var _0x5427a6={};var _0x27dca8;var _0x51ec1b;return db[_0x36a6('0x28')][_0x36a6('0x4f')]({'where':{'id':_0x353aa7['params']['id']}})[_0x36a6('0x1f')](handleEntityNotFound(_0x35b60e,null))[_0x36a6('0x1f')](function(_0x1d012c){if(_0x1d012c){_0x27dca8=_0x1d012c;_0x5427a6[_0x36a6('0x2b')]=_[_0x36a6('0x2d')](db[_0x36a6('0x28')][_0x36a6('0x29')]);_0x5427a6['query']=_[_0x36a6('0x2d')](_0x353aa7[_0x36a6('0x2c')]);_0x5427a6['filters']=_[_0x36a6('0x2e')](_0x5427a6[_0x36a6('0x2b')],_0x5427a6[_0x36a6('0x2c')]);_0x50bd43[_0x36a6('0x30')]=_[_0x36a6('0x2e')](_0x5427a6['model'],qs[_0x36a6('0x2f')](_0x353aa7[_0x36a6('0x2c')]['fields']));_0x50bd43[_0x36a6('0x30')]=_0x50bd43[_0x36a6('0x30')]['length']?_0x50bd43[_0x36a6('0x30')]:_0x5427a6[_0x36a6('0x2b')];_0x50bd43[_0x36a6('0x35')]=qs[_0x36a6('0x36')](_0x353aa7[_0x36a6('0x2c')]['sort']);_0x50bd43[_0x36a6('0x37')]=qs[_0x36a6('0x38')](_[_0x36a6('0x50')](_0x353aa7[_0x36a6('0x2c')],_0x5427a6[_0x36a6('0x38')]));if(_0x353aa7[_0x36a6('0x2c')][_0x36a6('0x39')]){_0x50bd43[_0x36a6('0x37')]=_[_0x36a6('0x3a')](_0x50bd43[_0x36a6('0x37')],{'$or':_[_0x36a6('0x27')](_0x50bd43[_0x36a6('0x30')],function(_0x430b9a){var _0x3d748c={};_0x3d748c[_0x430b9a]={'$like':'%'+_0x353aa7[_0x36a6('0x2c')][_0x36a6('0x39')]+'%'};return _0x3d748c;})});}_0x50bd43=_[_0x36a6('0x3a')]({},_0x50bd43,_0x353aa7[_0x36a6('0x51')]);return _0x27dca8[_0x36a6('0x4e')](_0x50bd43);}})[_0x36a6('0x1f')](function(_0x1b0d16){if(_0x1b0d16){_0x51ec1b=_0x1b0d16[_0x36a6('0x31')];if(!_0x353aa7[_0x36a6('0x2c')][_0x36a6('0x32')](_0x36a6('0x33'))){_0x50bd43[_0x36a6('0x34')]=qs[_0x36a6('0x34')](_0x353aa7[_0x36a6('0x2c')]['limit']);_0x50bd43['offset']=qs[_0x36a6('0x17')](_0x353aa7[_0x36a6('0x2c')][_0x36a6('0x17')]);}return _0x27dca8['getIntervals'](_0x50bd43);}})[_0x36a6('0x1f')](function(_0x32488e){if(_0x32488e){return _0x32488e?{'count':_0x51ec1b,'rows':_0x32488e}:null;}})[_0x36a6('0x1f')](respondWithResult(_0x35b60e,null))['catch'](handleError(_0x35b60e,null));};exports[_0x36a6('0x52')]=function(_0x51824d,_0x303505,_0x1fe358){return db[_0x36a6('0x28')][_0x36a6('0x4f')]({'where':{'id':_0x51824d[_0x36a6('0x41')]['id']}})[_0x36a6('0x1f')](handleEntityNotFound(_0x303505,null))[_0x36a6('0x1f')](function(_0x3a74a1){if(_0x3a74a1){return db['sequelize'][_0x36a6('0x53')](function(_0x36a6e8){return db['Interval'][_0x36a6('0x23')]({'where':{'IntervalId':_0x51824d[_0x36a6('0x41')]['id']},'transaction':_0x36a6e8})[_0x36a6('0x1f')](function(_0x1052dc){var _0x2a7eea=_[_0x36a6('0x27')](_0x51824d[_0x36a6('0x45')],function(_0x24d253){delete _0x24d253['id'];_0x24d253['IntervalId']=_0x51824d['params']['id'];return _0x24d253;});return db[_0x36a6('0x28')][_0x36a6('0x54')](_0x2a7eea,{'transaction':_0x36a6e8});});})[_0x36a6('0x1f')](function(){return db['Interval'][_0x36a6('0x3e')]({'where':{'IntervalId':_0x51824d[_0x36a6('0x41')]['id']}});});}})[_0x36a6('0x1f')](respondWithResult(_0x303505,null))['catch'](handleError(_0x303505,null));};
\ No newline at end of file
+var _0x7752=['where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','params','addInterval','IntervalId','getIntervals','findOne','sort','hasOwnProperty','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','Intervals','UserProfileResource','error','stack','name','send','map','Interval','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order'];(function(_0x431aec,_0x461820){var _0x123441=function(_0x22003a){while(--_0x22003a){_0x431aec['push'](_0x431aec['shift']());}};_0x123441(++_0x461820);}(_0x7752,0x7e));var _0x2775=function(_0x34e2b5,_0x2fd945){_0x34e2b5=_0x34e2b5-0x0;var _0xbee40b=_0x7752[_0x34e2b5];return _0xbee40b;};'use strict';var emlformat=require(_0x2775('0x0'));var rimraf=require(_0x2775('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2775('0x2'));var rp=require('request-promise');var moment=require(_0x2775('0x3'));var BPromise=require(_0x2775('0x4'));var Mustache=require(_0x2775('0x5'));var util=require(_0x2775('0x6'));var path=require(_0x2775('0x7'));var sox=require(_0x2775('0x8'));var csv=require(_0x2775('0x9'));var ejs=require(_0x2775('0xa'));var fs=require('fs');var fs_extra=require(_0x2775('0xb'));var _=require('lodash');var squel=require(_0x2775('0xc'));var crypto=require(_0x2775('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2775('0xe'));var toCsv=require(_0x2775('0x9'));var querystring=require(_0x2775('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2775('0x10'));var qs=require(_0x2775('0x11'));var as=require(_0x2775('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2775('0x13'))(_0x2775('0x14'));var utils=require(_0x2775('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2775('0x16'));var db=require(_0x2775('0x17'))['db'];var extensions=require(_0x2775('0x18'));function respondWithStatusCode(_0xce075e,_0x5155df){_0x5155df=_0x5155df||0xcc;return function(_0x31921e){if(_0x31921e){return _0xce075e[_0x2775('0x19')](_0x5155df);}return _0xce075e[_0x2775('0x1a')](_0x5155df)[_0x2775('0x1b')]();};}function respondWithResult(_0x1f2d6d,_0x138fe7){_0x138fe7=_0x138fe7||0xc8;return function(_0x155561){if(_0x155561){return _0x1f2d6d[_0x2775('0x1a')](_0x138fe7)[_0x2775('0x1c')](_0x155561);}};}function respondWithFilteredResult(_0x13ca3c,_0x2a6d48){return function(_0x473d56){if(_0x473d56){var _0x19acfe=typeof _0x2a6d48[_0x2775('0x1d')]===_0x2775('0x1e')&&typeof _0x2a6d48[_0x2775('0x1f')]===_0x2775('0x1e');var _0x2a02d3=_0x473d56['count'];var _0x344bda=_0x19acfe?0x0:_0x2a6d48[_0x2775('0x1d')];var _0x3b61f2=_0x19acfe?_0x473d56[_0x2775('0x20')]:_0x2a6d48['offset']+_0x2a6d48['limit'];var _0x422451;if(_0x3b61f2>=_0x2a02d3){_0x3b61f2=_0x2a02d3;_0x422451=0xc8;}else{_0x422451=0xce;}_0x13ca3c[_0x2775('0x1a')](_0x422451);return _0x13ca3c[_0x2775('0x21')](_0x2775('0x22'),_0x344bda+'-'+_0x3b61f2+'/'+_0x2a02d3)[_0x2775('0x1c')](_0x473d56);}return null;};}function patchUpdates(_0x4a593e){return function(_0x47884d){try{jsonpatch[_0x2775('0x23')](_0x47884d,_0x4a593e,!![]);}catch(_0x583d78){return BPromise[_0x2775('0x24')](_0x583d78);}return _0x47884d['save']();};}function saveUpdates(_0x853582,_0x55ad08){return function(_0x341abe){if(_0x341abe){return _0x341abe[_0x2775('0x25')](_0x853582)['then'](function(_0xcb5bf5){return _0xcb5bf5;});}return null;};}function removeEntity(_0x3a154e,_0x2842fd){return function(_0x83a8fd){if(_0x83a8fd){return _0x83a8fd[_0x2775('0x26')]()[_0x2775('0x27')](function(){var _0x318f27=_0x83a8fd[_0x2775('0x28')]({'plain':!![]});var _0x527b94=_0x2775('0x29');return db[_0x2775('0x2a')]['destroy']({'where':{'type':_0x527b94,'resourceId':_0x318f27['id']}})[_0x2775('0x27')](function(){return _0x83a8fd;});})[_0x2775('0x27')](function(){_0x3a154e['status'](0xcc)[_0x2775('0x1b')]();});}};}function handleEntityNotFound(_0x317f03,_0x1130b7){return function(_0x1f4769){if(!_0x1f4769){_0x317f03[_0x2775('0x19')](0x194);}return _0x1f4769;};}function handleError(_0x2f45d3,_0xf08638){_0xf08638=_0xf08638||0x1f4;return function(_0x5ba0f4){logger[_0x2775('0x2b')](_0x5ba0f4[_0x2775('0x2c')]);if(_0x5ba0f4[_0x2775('0x2d')]){delete _0x5ba0f4['name'];}_0x2f45d3[_0x2775('0x1a')](_0xf08638)[_0x2775('0x2e')](_0x5ba0f4);};}exports['index']=function(_0x3ef378,_0x16f4c8){var _0x336bd7={},_0x47477c={},_0x1addcb={'count':0x0,'rows':[]};var _0x1e2631=_[_0x2775('0x2f')](db[_0x2775('0x30')][_0x2775('0x31')],function(_0x4894ca){return{'name':_0x4894ca['fieldName'],'type':_0x4894ca[_0x2775('0x32')][_0x2775('0x33')]};});_0x47477c[_0x2775('0x34')]=_[_0x2775('0x2f')](_0x1e2631,'name');_0x47477c[_0x2775('0x35')]=_[_0x2775('0x36')](_0x3ef378[_0x2775('0x35')]);_0x47477c[_0x2775('0x37')]=_['intersection'](_0x47477c[_0x2775('0x34')],_0x47477c[_0x2775('0x35')]);_0x336bd7[_0x2775('0x38')]=_[_0x2775('0x39')](_0x47477c[_0x2775('0x34')],qs[_0x2775('0x3a')](_0x3ef378['query'][_0x2775('0x3a')]));_0x336bd7[_0x2775('0x38')]=_0x336bd7[_0x2775('0x38')][_0x2775('0x3b')]?_0x336bd7[_0x2775('0x38')]:_0x47477c[_0x2775('0x34')];if(!_0x3ef378[_0x2775('0x35')]['hasOwnProperty'](_0x2775('0x3c'))){_0x336bd7['limit']=qs[_0x2775('0x1f')](_0x3ef378['query']['limit']);_0x336bd7[_0x2775('0x1d')]=qs[_0x2775('0x1d')](_0x3ef378[_0x2775('0x35')][_0x2775('0x1d')]);}_0x336bd7[_0x2775('0x3d')]=qs['sort'](_0x3ef378[_0x2775('0x35')]['sort']);_0x336bd7[_0x2775('0x3e')]=qs[_0x2775('0x37')](_[_0x2775('0x3f')](_0x3ef378[_0x2775('0x35')],_0x47477c['filters']),_0x1e2631);if(_0x3ef378[_0x2775('0x35')][_0x2775('0x40')]){_0x336bd7[_0x2775('0x3e')]=_['merge'](_0x336bd7[_0x2775('0x3e')],{'$or':_[_0x2775('0x2f')](_0x1e2631,function(_0x472252){if(_0x472252['type']!==_0x2775('0x41')){var _0x57c226={};_0x57c226[_0x472252[_0x2775('0x2d')]]={'$like':'%'+_0x3ef378[_0x2775('0x35')][_0x2775('0x40')]+'%'};return _0x57c226;}})});}_0x336bd7=_['merge']({},_0x336bd7,_0x3ef378[_0x2775('0x42')]);var _0x5508a2={'where':_0x336bd7[_0x2775('0x3e')]};return db[_0x2775('0x30')][_0x2775('0x20')](_0x5508a2)[_0x2775('0x27')](function(_0x2118fc){_0x1addcb[_0x2775('0x20')]=_0x2118fc;if(_0x3ef378['query'][_0x2775('0x43')]){_0x336bd7[_0x2775('0x44')]=[{'all':!![]}];}return db[_0x2775('0x30')][_0x2775('0x45')](_0x336bd7);})[_0x2775('0x27')](function(_0x478812){_0x1addcb[_0x2775('0x46')]=_0x478812;return _0x1addcb;})[_0x2775('0x27')](respondWithFilteredResult(_0x16f4c8,_0x336bd7))['catch'](handleError(_0x16f4c8,null));};exports[_0x2775('0x47')]=function(_0x27d552,_0x4ed900){var _0x491507={'raw':!![],'where':{'id':_0x27d552['params']['id']}},_0x1c59d4={};_0x1c59d4[_0x2775('0x34')]=_[_0x2775('0x36')](db['Interval'][_0x2775('0x31')]);_0x1c59d4['query']=_['keys'](_0x27d552['query']);_0x1c59d4[_0x2775('0x37')]=_[_0x2775('0x39')](_0x1c59d4[_0x2775('0x34')],_0x1c59d4[_0x2775('0x35')]);_0x491507[_0x2775('0x38')]=_[_0x2775('0x39')](_0x1c59d4[_0x2775('0x34')],qs[_0x2775('0x3a')](_0x27d552[_0x2775('0x35')][_0x2775('0x3a')]));_0x491507[_0x2775('0x38')]=_0x491507['attributes'][_0x2775('0x3b')]?_0x491507[_0x2775('0x38')]:_0x1c59d4['model'];if(_0x27d552['query'][_0x2775('0x43')]){_0x491507[_0x2775('0x44')]=[{'all':!![]}];}_0x491507=_[_0x2775('0x48')]({},_0x491507,_0x27d552['options']);return db['Interval'][_0x2775('0x49')](_0x491507)['then'](handleEntityNotFound(_0x4ed900,null))[_0x2775('0x27')](respondWithResult(_0x4ed900,null))['catch'](handleError(_0x4ed900,null));};exports[_0x2775('0x4a')]=function(_0x3885a7,_0xedadb3){return db[_0x2775('0x30')]['create'](_0x3885a7[_0x2775('0x4b')],{})[_0x2775('0x27')](function(_0x4e9a4a){var _0x4ec67c=_0x3885a7[_0x2775('0x4c')]['get']({'plain':!![]});if(!_0x4ec67c)throw new Error(_0x2775('0x4d'));if(_0x4ec67c[_0x2775('0x4e')]===_0x2775('0x4c')){var _0x47e42a=_0x4e9a4a[_0x2775('0x28')]({'plain':!![]});var _0x5d92e6=_0x2775('0x29');return db[_0x2775('0x4f')][_0x2775('0x49')]({'where':{'name':_0x5d92e6,'userProfileId':_0x4ec67c[_0x2775('0x50')]},'raw':!![]})['then'](function(_0x2c71db){if(_0x2c71db&&_0x2c71db['autoAssociation']===0x0){return db[_0x2775('0x2a')][_0x2775('0x4a')]({'name':_0x47e42a[_0x2775('0x2d')],'resourceId':_0x47e42a['id'],'type':_0x2c71db[_0x2775('0x2d')],'sectionId':_0x2c71db['id']},{})['then'](function(){return _0x4e9a4a;});}else{return _0x4e9a4a;}})['catch'](function(_0x5be149){logger[_0x2775('0x2b')](_0x2775('0x51'),_0x5be149);throw _0x5be149;});}return _0x4e9a4a;})[_0x2775('0x27')](respondWithResult(_0xedadb3,0xc9))[_0x2775('0x52')](handleError(_0xedadb3,null));};exports[_0x2775('0x25')]=function(_0x2e28d6,_0x3405f1){if(_0x2e28d6[_0x2775('0x4b')]['id']){delete _0x2e28d6[_0x2775('0x4b')]['id'];}return db[_0x2775('0x30')][_0x2775('0x49')]({'where':{'id':_0x2e28d6[_0x2775('0x53')]['id']}})['then'](handleEntityNotFound(_0x3405f1,null))[_0x2775('0x27')](saveUpdates(_0x2e28d6['body'],null))[_0x2775('0x27')](respondWithResult(_0x3405f1,null))[_0x2775('0x52')](handleError(_0x3405f1,null));};exports[_0x2775('0x26')]=function(_0x42fb1a,_0x12c545){return db[_0x2775('0x30')][_0x2775('0x49')]({'where':{'id':_0x42fb1a[_0x2775('0x53')]['id']}})[_0x2775('0x27')](handleEntityNotFound(_0x12c545,null))[_0x2775('0x27')](removeEntity(_0x12c545,null))['catch'](handleError(_0x12c545,null));};exports[_0x2775('0x54')]=function(_0x1d9ac4,_0xf3aea5,_0x18426d){if(_0x1d9ac4['body']['id']){delete _0x1d9ac4[_0x2775('0x4b')]['id'];}return db[_0x2775('0x30')]['find']({'where':{'id':_0x1d9ac4[_0x2775('0x53')]['id']}})[_0x2775('0x27')](handleEntityNotFound(_0xf3aea5,null))['then'](function(_0x366393){if(_0x366393){_0x1d9ac4['body'][_0x2775('0x55')]=_0x366393['id'];return db[_0x2775('0x30')][_0x2775('0x4a')](_0x1d9ac4[_0x2775('0x4b')]);}})[_0x2775('0x27')](respondWithResult(_0xf3aea5,null))['catch'](handleError(_0xf3aea5,null));};exports[_0x2775('0x56')]=function(_0x22605b,_0x3a3ac5,_0x53b9d6){var _0x1aaf2a={};var _0x4cd3d8={};var _0x14d73c;var _0x410edf;return db['Interval'][_0x2775('0x57')]({'where':{'id':_0x22605b[_0x2775('0x53')]['id']}})[_0x2775('0x27')](handleEntityNotFound(_0x3a3ac5,null))[_0x2775('0x27')](function(_0x784157){if(_0x784157){_0x14d73c=_0x784157;_0x4cd3d8[_0x2775('0x34')]=_['keys'](db[_0x2775('0x30')][_0x2775('0x31')]);_0x4cd3d8['query']=_[_0x2775('0x36')](_0x22605b['query']);_0x4cd3d8[_0x2775('0x37')]=_['intersection'](_0x4cd3d8[_0x2775('0x34')],_0x4cd3d8[_0x2775('0x35')]);_0x1aaf2a['attributes']=_[_0x2775('0x39')](_0x4cd3d8[_0x2775('0x34')],qs[_0x2775('0x3a')](_0x22605b[_0x2775('0x35')]['fields']));_0x1aaf2a[_0x2775('0x38')]=_0x1aaf2a[_0x2775('0x38')]['length']?_0x1aaf2a['attributes']:_0x4cd3d8[_0x2775('0x34')];_0x1aaf2a[_0x2775('0x3d')]=qs[_0x2775('0x58')](_0x22605b[_0x2775('0x35')][_0x2775('0x58')]);_0x1aaf2a[_0x2775('0x3e')]=qs['filters'](_[_0x2775('0x3f')](_0x22605b['query'],_0x4cd3d8[_0x2775('0x37')]));if(_0x22605b[_0x2775('0x35')][_0x2775('0x40')]){_0x1aaf2a[_0x2775('0x3e')]=_[_0x2775('0x48')](_0x1aaf2a[_0x2775('0x3e')],{'$or':_[_0x2775('0x2f')](_0x1aaf2a[_0x2775('0x38')],function(_0x72e862){var _0x10d30b={};_0x10d30b[_0x72e862]={'$like':'%'+_0x22605b['query'][_0x2775('0x40')]+'%'};return _0x10d30b;})});}_0x1aaf2a=_[_0x2775('0x48')]({},_0x1aaf2a,_0x22605b[_0x2775('0x42')]);return _0x14d73c['getIntervals'](_0x1aaf2a);}})[_0x2775('0x27')](function(_0x440970){if(_0x440970){_0x410edf=_0x440970['length'];if(!_0x22605b[_0x2775('0x35')][_0x2775('0x59')](_0x2775('0x3c'))){_0x1aaf2a[_0x2775('0x1f')]=qs[_0x2775('0x1f')](_0x22605b[_0x2775('0x35')][_0x2775('0x1f')]);_0x1aaf2a['offset']=qs[_0x2775('0x1d')](_0x22605b[_0x2775('0x35')][_0x2775('0x1d')]);}return _0x14d73c[_0x2775('0x56')](_0x1aaf2a);}})[_0x2775('0x27')](function(_0x4832bd){if(_0x4832bd){return _0x4832bd?{'count':_0x410edf,'rows':_0x4832bd}:null;}})[_0x2775('0x27')](respondWithResult(_0x3a3ac5,null))[_0x2775('0x52')](handleError(_0x3a3ac5,null));};exports[_0x2775('0x5a')]=function(_0x532639,_0x121345,_0x5daf86){return db[_0x2775('0x30')]['findOne']({'where':{'id':_0x532639['params']['id']}})['then'](handleEntityNotFound(_0x121345,null))[_0x2775('0x27')](function(_0x527598){if(_0x527598){return db[_0x2775('0x5b')][_0x2775('0x5c')](function(_0x145c0a){return db[_0x2775('0x30')][_0x2775('0x26')]({'where':{'IntervalId':_0x532639[_0x2775('0x53')]['id']},'transaction':_0x145c0a})[_0x2775('0x27')](function(_0x287bd9){var _0x2cfc44=_[_0x2775('0x2f')](_0x532639[_0x2775('0x4b')],function(_0x2eb115){delete _0x2eb115['id'];_0x2eb115['IntervalId']=_0x532639[_0x2775('0x53')]['id'];return _0x2eb115;});return db['Interval'][_0x2775('0x5d')](_0x2cfc44,{'transaction':_0x145c0a});});})[_0x2775('0x27')](function(){return db['Interval'][_0x2775('0x45')]({'where':{'IntervalId':_0x532639[_0x2775('0x53')]['id']}});});}})[_0x2775('0x27')](respondWithResult(_0x121345,null))['catch'](handleError(_0x121345,null));};
\ No newline at end of file
index 2df01bb..39262e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf29d=['rewrite','lodash','util','api','moment','bluebird','request-promise','path','../../components/extensions/rewrite','exports','define','Interval','tools_intervals'];(function(_0x178842,_0x59ad1c){var _0x3941db=function(_0xe32092){while(--_0xe32092){_0x178842['push'](_0x178842['shift']());}};_0x3941db(++_0x59ad1c);}(_0xf29d,0xc4));var _0xdf29=function(_0x7c1bb7,_0x341b81){_0x7c1bb7=_0x7c1bb7-0x0;var _0x5dffdf=_0xf29d[_0x7c1bb7];return _0x5dffdf;};'use strict';var _=require(_0xdf29('0x0'));var util=require(_0xdf29('0x1'));var logger=require('../../config/logger')(_0xdf29('0x2'));var moment=require(_0xdf29('0x3'));var BPromise=require(_0xdf29('0x4'));var rp=require(_0xdf29('0x5'));var fs=require('fs');var path=require(_0xdf29('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./interval.attributes');var extensions=require(_0xdf29('0x7'));module[_0xdf29('0x8')]=function(_0x340cbd,_0x4b648e){return _0x340cbd[_0xdf29('0x9')](_0xdf29('0xa'),attributes,{'tableName':_0xdf29('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x54d108,_0x3c4597){extensions[_0xdf29('0xc')](_0x340cbd,_0x54d108);},'afterBulkCreate':function(_0x1fb3f1,_0x298dbb,_0x517d89){_0x517d89();extensions['rewrite'](_0x340cbd,_0x1fb3f1[0x0]);},'afterUpdate':function(_0x3e1865,_0x14b4ec){extensions['rewrite'](_0x340cbd,_0x3e1865);},'afterDestroy':function(_0x3f2853,_0x26b212){extensions[_0xdf29('0xc')](_0x340cbd,_0x3f2853);}}});};
\ No newline at end of file
+var _0x4b38=['tools_intervals','rewrite','lodash','../../config/logger','moment','bluebird','path','rimraf','./interval.attributes','../../components/extensions/rewrite','define'];(function(_0x4c962f,_0x2063a1){var _0x354a7b=function(_0x565469){while(--_0x565469){_0x4c962f['push'](_0x4c962f['shift']());}};_0x354a7b(++_0x2063a1);}(_0x4b38,0x157));var _0x84b3=function(_0x247493,_0x439314){_0x247493=_0x247493-0x0;var _0x392a1b=_0x4b38[_0x247493];return _0x392a1b;};'use strict';var _=require(_0x84b3('0x0'));var util=require('util');var logger=require(_0x84b3('0x1'))('api');var moment=require(_0x84b3('0x2'));var BPromise=require(_0x84b3('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x84b3('0x4'));var rimraf=require(_0x84b3('0x5'));var config=require('../../config/environment');var attributes=require(_0x84b3('0x6'));var extensions=require(_0x84b3('0x7'));module['exports']=function(_0x352cd1,_0x4887ac){return _0x352cd1[_0x84b3('0x8')]('Interval',attributes,{'tableName':_0x84b3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1084b0,_0x560c37){extensions['rewrite'](_0x352cd1,_0x1084b0);},'afterBulkCreate':function(_0xd18247,_0x24ad24,_0x14138f){_0x14138f();extensions[_0x84b3('0xa')](_0x352cd1,_0xd18247[0x0]);},'afterUpdate':function(_0x513a25,_0x14e697){extensions[_0x84b3('0xa')](_0x352cd1,_0x513a25);},'afterDestroy':function(_0x147e12,_0x12d2f9){extensions['rewrite'](_0x352cd1,_0x147e12);}}});};
\ No newline at end of file
index edc926f..ea2798f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0xf2662b,_0x4d8f41){var _0x257dc7=function(_0x46b1d1){while(--_0x46b1d1){_0xf2662b['push'](_0xf2662b['shift']());}};_0x257dc7(++_0x4d8f41);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});};
\ No newline at end of file
+var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});};
\ No newline at end of file
index 1c4cf0c..1f8c205 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x1ea150,_0x2299de){var _0x4d1e73=function(_0x4abec1){while(--_0x4abec1){_0x1ea150['push'](_0x1ea150['shift']());}};_0x4d1e73(++_0x2299de);}(_0xdb28,0x106));var _0x8db2=function(_0xdb1175,_0xaafaac){_0xdb1175=_0xdb1175-0x0;var _0xaee86e=_0xdb28[_0xdb1175];return _0xaee86e;};'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
+var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x24eb46,_0x568a50){var _0x5b3d1=function(_0x2a025f){while(--_0x2a025f){_0x24eb46['push'](_0x24eb46['shift']());}};_0x5b3d1(++_0x568a50);}(_0xdb28,0x106));var _0x8db2=function(_0xa4bcd4,_0x566e83){_0xa4bcd4=_0xa4bcd4-0x0;var _0x11019c=_0xdb28[_0xa4bcd4];return _0x11019c;};'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 99b985d..4ce3a6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd49d=['customfield_11503','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','base64','request','utf8','status','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','openIssue','send','body','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','summary','\x20from\x20','description','stringify','Bug','email','fields','customfield_11501','oldToken','customfield_11502','newToken'];(function(_0x499d15,_0x5376c1){var _0x189291=function(_0x52884f){while(--_0x52884f){_0x499d15['push'](_0x499d15['shift']());}};_0x189291(++_0x5376c1);}(_0xd49d,0x6a));var _0xdd49=function(_0x125207,_0x208280){_0x125207=_0x125207-0x0;var _0x54ca9a=_0xd49d[_0x125207];return _0x54ca9a;};'use strict';var BPromise=require(_0xdd49('0x0'));var https=require(_0xdd49('0x1'));var logger=require(_0xdd49('0x2'))(_0xdd49('0x3'));var USERNAME=_0xdd49('0x4');var PASSWORD=_0xdd49('0x5');function openIssue(_0x416661,_0x201c67){var _0x4c5ffe={'fields':{'project':{'key':_0x416661['key']||'MOTGUI'},'summary':(_0x416661[_0xdd49('0x6')]||'Report')+_0xdd49('0x7')+_0x416661['ip'],'description':_0x416661[_0xdd49('0x8')]||JSON[_0xdd49('0x9')](_0x416661),'issuetype':{'name':_0x416661['issuetype']||_0xdd49('0xa')}}};_0x4c5ffe['fields']['customfield_11500']=_0x416661[_0xdd49('0xb')];_0x4c5ffe[_0xdd49('0xc')][_0xdd49('0xd')]=_0x416661[_0xdd49('0xe')];_0x4c5ffe[_0xdd49('0xc')][_0xdd49('0xf')]=_0x416661[_0xdd49('0x10')];_0x4c5ffe[_0xdd49('0xc')][_0xdd49('0x11')]=_0x416661['name'];_0x4c5ffe[_0xdd49('0xc')][_0xdd49('0x12')]=_0x416661[_0xdd49('0x13')];_0x4c5ffe[_0xdd49('0xc')][_0xdd49('0x14')]=_0x416661['ip'];var _0x4807de={'host':_0xdd49('0x15'),'port':0x1bb,'path':_0xdd49('0x16'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xdd49('0x17'),'Authorization':_0xdd49('0x18')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xdd49('0x19'))}};var _0x5c1e57=JSON[_0xdd49('0x9')](_0x4c5ffe);var _0x698748=https[_0xdd49('0x1a')](_0x4807de,function(_0x40fe17){_0x40fe17['setEncoding'](_0xdd49('0x1b'));var _0x1897a1='';_0x40fe17['on']('data',function(_0xee207b){_0x1897a1+=_0xee207b;});_0x40fe17['on']('end',function(){if(_0x201c67){return _0x201c67[_0xdd49('0x1c')](_0x40fe17['statusCode'])['json'](JSON['parse'](_0x1897a1));}});});_0x698748['on'](_0xdd49('0x1d'),function(_0x5681ca){if(_0x201c67){return _0x201c67[_0xdd49('0x1c')](0x1f4)['json']({'errors':[{'message':_0xdd49('0x1e'),'type':_0xdd49('0x1f')}]});}});_0x698748[_0xdd49('0x20')](_0x5c1e57);_0x698748[_0xdd49('0x21')]();}exports[_0xdd49('0x22')]=openIssue;exports[_0xdd49('0x23')]=function(_0xf91347,_0x3ff128){_0xf91347[_0xdd49('0x24')]['ip']=_0xf91347['headers'][_0xdd49('0x25')]||_0xf91347[_0xdd49('0x26')][_0xdd49('0x27')]||_0xf91347['socket']['remoteAddress']||_0xf91347[_0xdd49('0x26')][_0xdd49('0x28')]['remoteAddress'];return openIssue(_0xf91347[_0xdd49('0x24')],_0x3ff128);};
\ No newline at end of file
+var _0xc395=['statusCode','parse','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','fields','customfield_11500','customfield_11501','oldToken','newToken','customfield_11504','reason','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status'];(function(_0x291f54,_0x547492){var _0x27f9dd=function(_0x446824){while(--_0x446824){_0x291f54['push'](_0x291f54['shift']());}};_0x27f9dd(++_0x547492);}(_0xc395,0xf9));var _0x5c39=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0xc395[_0x454165];return _0x56db53;};'use strict';var BPromise=require(_0x5c39('0x0'));var https=require(_0x5c39('0x1'));var logger=require(_0x5c39('0x2'))(_0x5c39('0x3'));var USERNAME='support';var PASSWORD=_0x5c39('0x4');function openIssue(_0x3f65ac,_0x5f0a1a){var _0x4dd042={'fields':{'project':{'key':_0x3f65ac[_0x5c39('0x5')]||_0x5c39('0x6')},'summary':(_0x3f65ac[_0x5c39('0x7')]||_0x5c39('0x8'))+_0x5c39('0x9')+_0x3f65ac['ip'],'description':_0x3f65ac[_0x5c39('0xa')]||JSON[_0x5c39('0xb')](_0x3f65ac),'issuetype':{'name':_0x3f65ac[_0x5c39('0xc')]||'Bug'}}};_0x4dd042[_0x5c39('0xd')][_0x5c39('0xe')]=_0x3f65ac['email'];_0x4dd042[_0x5c39('0xd')][_0x5c39('0xf')]=_0x3f65ac[_0x5c39('0x10')];_0x4dd042['fields']['customfield_11502']=_0x3f65ac[_0x5c39('0x11')];_0x4dd042[_0x5c39('0xd')]['customfield_11503']=_0x3f65ac['name'];_0x4dd042[_0x5c39('0xd')][_0x5c39('0x12')]=_0x3f65ac[_0x5c39('0x13')];_0x4dd042[_0x5c39('0xd')][_0x5c39('0x14')]=_0x3f65ac['ip'];var _0x35c145={'host':_0x5c39('0x15'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x5c39('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0x5c39('0x17'),'Authorization':_0x5c39('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0x5c39('0x19')](_0x5c39('0x1a'))}};var _0x53fa78=JSON[_0x5c39('0xb')](_0x4dd042);var _0xa55a4b=https[_0x5c39('0x1b')](_0x35c145,function(_0x1c40d3){_0x1c40d3[_0x5c39('0x1c')](_0x5c39('0x1d'));var _0x568f21='';_0x1c40d3['on'](_0x5c39('0x1e'),function(_0x338e95){_0x568f21+=_0x338e95;});_0x1c40d3['on'](_0x5c39('0x1f'),function(){if(_0x5f0a1a){return _0x5f0a1a[_0x5c39('0x20')](_0x1c40d3[_0x5c39('0x21')])['json'](JSON[_0x5c39('0x22')](_0x568f21));}});});_0xa55a4b['on']('error',function(_0x4ce2d4){if(_0x5f0a1a){return _0x5f0a1a[_0x5c39('0x20')](0x1f4)[_0x5c39('0x23')]({'errors':[{'message':_0x5c39('0x24'),'type':_0x5c39('0x25')}]});}});_0xa55a4b[_0x5c39('0x26')](_0x53fa78);_0xa55a4b[_0x5c39('0x1f')]();}exports[_0x5c39('0x27')]=openIssue;exports[_0x5c39('0x28')]=function(_0x11c4be,_0x132c42){_0x11c4be[_0x5c39('0x29')]['ip']=_0x11c4be[_0x5c39('0x2a')][_0x5c39('0x2b')]||_0x11c4be[_0x5c39('0x2c')][_0x5c39('0x2d')]||_0x11c4be[_0x5c39('0x2e')][_0x5c39('0x2d')]||_0x11c4be['connection']['socket']['remoteAddress'];return openIssue(_0x11c4be[_0x5c39('0x29')],_0x132c42);};
\ No newline at end of file
index 6909a03..d21ab01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91a7=['Router','../../components/auth/service','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x23902e,_0x2bcb4e){var _0x28f007=function(_0x4005e9){while(--_0x4005e9){_0x23902e['push'](_0x23902e['shift']());}};_0x28f007(++_0x2bcb4e);}(_0x91a7,0xe7));var _0x791a=function(_0x3cbbf1,_0x3d9a88){_0x3cbbf1=_0x3cbbf1-0x0;var _0x15a4e5=_0x91a7[_0x3cbbf1];return _0x15a4e5;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['describe']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0xc')]('/',auth['isAuthenticated'](),controller[_0x791a('0xd')]);router[_0x791a('0xe')]('/:id',auth[_0x791a('0x9')](),controller[_0x791a('0xf')]);router[_0x791a('0x10')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x3c81=['index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated'];(function(_0x59d546,_0x107f05){var _0x41fbdb=function(_0x413e68){while(--_0x413e68){_0x59d546['push'](_0x59d546['shift']());}};_0x41fbdb(++_0x107f05);}(_0x3c81,0x102));var _0x13c8=function(_0x52a471,_0x26ead7){_0x52a471=_0x52a471-0x0;var _0x233378=_0x3c81[_0x52a471];return _0x233378;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13c8('0x4'));var controller=require(_0x13c8('0x5'));router[_0x13c8('0x6')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x6')](_0x13c8('0x9'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['get'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xc')]);router[_0x13c8('0xd')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0xe')]);router[_0x13c8('0xf')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x10')]);router[_0x13c8('0x11')](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x12')]);module['exports']=router;
\ No newline at end of file
index 0bf3209..c856bb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a54,0x106));var _0x47a5=function(_0x456d87,_0x5c553d){_0x456d87=_0x456d87-0x0;var _0x5e4fcc=_0x7a54[_0x456d87];return _0x5e4fcc;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x7a54,0x106));var _0x47a5=function(_0x4c6d1c,_0x5ea77a){_0x4c6d1c=_0x4c6d1c-0x0;var _0x5d5480=_0x7a54[_0x4c6d1c];return _0x5d5480;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
index abfa81d..29db7c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ab0=['length','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x13cdda,_0x4a0cd1){var _0x324b40=function(_0x40efb6){while(--_0x40efb6){_0x13cdda['push'](_0x13cdda['shift']());}};_0x324b40(++_0x4a0cd1);}(_0x9ab0,0x195));var _0x09ab=function(_0x27a0f4,_0xd9ab47){_0x27a0f4=_0x27a0f4-0x0;var _0x4b14b5=_0x9ab0[_0x27a0f4];return _0x4b14b5;};'use strict';var emlformat=require(_0x09ab('0x0'));var rimraf=require(_0x09ab('0x1'));var zipdir=require(_0x09ab('0x2'));var jsonpatch=require(_0x09ab('0x3'));var rp=require(_0x09ab('0x4'));var moment=require(_0x09ab('0x5'));var BPromise=require(_0x09ab('0x6'));var Mustache=require(_0x09ab('0x7'));var util=require(_0x09ab('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x09ab('0x9'));var fs=require('fs');var fs_extra=require(_0x09ab('0xa'));var _=require(_0x09ab('0xb'));var squel=require(_0x09ab('0xc'));var crypto=require(_0x09ab('0xd'));var jsforce=require(_0x09ab('0xe'));var deskjs=require(_0x09ab('0xf'));var toCsv=require(_0x09ab('0x10'));var querystring=require(_0x09ab('0x11'));var Papa=require('papaparse');var Redis=require(_0x09ab('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x09ab('0x13'));var as=require(_0x09ab('0x14'));var hardwareService=require(_0x09ab('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x09ab('0x16'));var config=require(_0x09ab('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3cd3d7,_0x1a667a){_0x1a667a=_0x1a667a||0xcc;return function(_0x367bc4){if(_0x367bc4){return _0x3cd3d7[_0x09ab('0x18')](_0x1a667a);}return _0x3cd3d7[_0x09ab('0x19')](_0x1a667a)[_0x09ab('0x1a')]();};}function respondWithResult(_0x18ecda,_0x25bb6b){_0x25bb6b=_0x25bb6b||0xc8;return function(_0x10971){if(_0x10971){return _0x18ecda[_0x09ab('0x19')](_0x25bb6b)[_0x09ab('0x1b')](_0x10971);}};}function respondWithFilteredResult(_0x27cf42,_0x5ac9da){return function(_0x24db01){if(_0x24db01){var _0x3ff3b2=typeof _0x5ac9da[_0x09ab('0x1c')]==='undefined'&&typeof _0x5ac9da[_0x09ab('0x1d')]===_0x09ab('0x1e');var _0x2f75a8=_0x24db01['count'];var _0x3d77d6=_0x3ff3b2?0x0:_0x5ac9da[_0x09ab('0x1c')];var _0x88f781=_0x3ff3b2?_0x24db01[_0x09ab('0x1f')]:_0x5ac9da[_0x09ab('0x1c')]+_0x5ac9da[_0x09ab('0x1d')];var _0x5c053b;if(_0x88f781>=_0x2f75a8){_0x88f781=_0x2f75a8;_0x5c053b=0xc8;}else{_0x5c053b=0xce;}_0x27cf42[_0x09ab('0x19')](_0x5c053b);return _0x27cf42[_0x09ab('0x20')]('Content-Range',_0x3d77d6+'-'+_0x88f781+'/'+_0x2f75a8)[_0x09ab('0x1b')](_0x24db01);}return null;};}function patchUpdates(_0x6a3b15){return function(_0x1be6af){try{jsonpatch[_0x09ab('0x21')](_0x1be6af,_0x6a3b15,!![]);}catch(_0x403d30){return BPromise[_0x09ab('0x22')](_0x403d30);}return _0x1be6af[_0x09ab('0x23')]();};}function saveUpdates(_0x1bde95,_0x48d46c){return function(_0x30304f){if(_0x30304f){return _0x30304f[_0x09ab('0x24')](_0x1bde95)[_0x09ab('0x25')](function(_0x33e2d8){return _0x33e2d8;});}return null;};}function removeEntity(_0x3314b8,_0x35ea70){return function(_0x597beb){if(_0x597beb){return _0x597beb[_0x09ab('0x26')]()[_0x09ab('0x25')](function(){_0x3314b8[_0x09ab('0x19')](0xcc)[_0x09ab('0x1a')]();});}};}function handleEntityNotFound(_0x293e54,_0x4c776b){return function(_0x50a95b){if(!_0x50a95b){_0x293e54[_0x09ab('0x18')](0x194);}return _0x50a95b;};}function handleError(_0x40932c,_0x5138d4){_0x5138d4=_0x5138d4||0x1f4;return function(_0x429b1b){logger[_0x09ab('0x27')](_0x429b1b[_0x09ab('0x28')]);if(_0x429b1b[_0x09ab('0x29')]){delete _0x429b1b[_0x09ab('0x29')];}_0x40932c[_0x09ab('0x19')](_0x5138d4)[_0x09ab('0x2a')](_0x429b1b);};}exports[_0x09ab('0x2b')]=function(_0x55c5f0,_0x1f4eed){var _0x2d4028={},_0x300e2a={},_0x333684={'count':0x0,'rows':[]};var _0x177069=_[_0x09ab('0x2c')](db[_0x09ab('0x2d')][_0x09ab('0x2e')],function(_0x222892){return{'name':_0x222892[_0x09ab('0x2f')],'type':_0x222892[_0x09ab('0x30')][_0x09ab('0x31')]};});_0x300e2a[_0x09ab('0x32')]=_['map'](_0x177069,_0x09ab('0x29'));_0x300e2a[_0x09ab('0x33')]=_[_0x09ab('0x34')](_0x55c5f0[_0x09ab('0x33')]);_0x300e2a[_0x09ab('0x35')]=_[_0x09ab('0x36')](_0x300e2a[_0x09ab('0x32')],_0x300e2a[_0x09ab('0x33')]);_0x2d4028[_0x09ab('0x37')]=_['intersection'](_0x300e2a['model'],qs[_0x09ab('0x38')](_0x55c5f0[_0x09ab('0x33')]['fields']));_0x2d4028[_0x09ab('0x37')]=_0x2d4028[_0x09ab('0x37')][_0x09ab('0x39')]?_0x2d4028['attributes']:_0x300e2a[_0x09ab('0x32')];if(!_0x55c5f0[_0x09ab('0x33')][_0x09ab('0x3a')]('nolimit')){_0x2d4028['limit']=qs[_0x09ab('0x1d')](_0x55c5f0[_0x09ab('0x33')][_0x09ab('0x1d')]);_0x2d4028[_0x09ab('0x1c')]=qs[_0x09ab('0x1c')](_0x55c5f0['query'][_0x09ab('0x1c')]);}_0x2d4028[_0x09ab('0x3b')]=qs['sort'](_0x55c5f0[_0x09ab('0x33')][_0x09ab('0x3c')]);_0x2d4028['where']=qs['filters'](_['pick'](_0x55c5f0['query'],_0x300e2a[_0x09ab('0x35')]),_0x177069);if(_0x55c5f0[_0x09ab('0x33')]['filter']){_0x2d4028[_0x09ab('0x3d')]=_[_0x09ab('0x3e')](_0x2d4028[_0x09ab('0x3d')],{'$or':_[_0x09ab('0x2c')](_0x177069,function(_0x5e2597){if(_0x5e2597[_0x09ab('0x30')]!==_0x09ab('0x3f')){var _0x3f8011={};_0x3f8011[_0x5e2597[_0x09ab('0x29')]]={'$like':'%'+_0x55c5f0[_0x09ab('0x33')][_0x09ab('0x40')]+'%'};return _0x3f8011;}})});}_0x2d4028=_[_0x09ab('0x3e')]({},_0x2d4028,_0x55c5f0[_0x09ab('0x41')]);var _0x3d8a67={'where':_0x2d4028[_0x09ab('0x3d')]};return db[_0x09ab('0x2d')][_0x09ab('0x1f')](_0x3d8a67)['then'](function(_0x24a7c6){_0x333684[_0x09ab('0x1f')]=_0x24a7c6;if(_0x55c5f0[_0x09ab('0x33')][_0x09ab('0x42')]){_0x2d4028[_0x09ab('0x43')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x09ab('0x44')](_0x2d4028);})['then'](function(_0x12f859){_0x333684[_0x09ab('0x45')]=_0x12f859;return _0x333684;})[_0x09ab('0x25')](respondWithFilteredResult(_0x1f4eed,_0x2d4028))[_0x09ab('0x46')](handleError(_0x1f4eed,null));};exports[_0x09ab('0x47')]=function(_0x5ded5d,_0x171383){var _0x277ea6={'raw':!![],'where':{'id':_0x5ded5d[_0x09ab('0x48')]['id']}},_0x4430f2={};_0x4430f2[_0x09ab('0x32')]=_[_0x09ab('0x34')](db[_0x09ab('0x2d')][_0x09ab('0x2e')]);_0x4430f2[_0x09ab('0x33')]=_[_0x09ab('0x34')](_0x5ded5d[_0x09ab('0x33')]);_0x4430f2[_0x09ab('0x35')]=_[_0x09ab('0x36')](_0x4430f2[_0x09ab('0x32')],_0x4430f2[_0x09ab('0x33')]);_0x277ea6[_0x09ab('0x37')]=_[_0x09ab('0x36')](_0x4430f2[_0x09ab('0x32')],qs[_0x09ab('0x38')](_0x5ded5d['query']['fields']));_0x277ea6[_0x09ab('0x37')]=_0x277ea6[_0x09ab('0x37')]['length']?_0x277ea6[_0x09ab('0x37')]:_0x4430f2[_0x09ab('0x32')];if(_0x5ded5d['query'][_0x09ab('0x42')]){_0x277ea6[_0x09ab('0x43')]=[{'all':!![]}];}_0x277ea6=_['merge']({},_0x277ea6,_0x5ded5d[_0x09ab('0x41')]);return db[_0x09ab('0x2d')][_0x09ab('0x49')](_0x277ea6)[_0x09ab('0x25')](handleEntityNotFound(_0x171383,null))[_0x09ab('0x25')](respondWithResult(_0x171383,null))[_0x09ab('0x46')](handleError(_0x171383,null));};exports[_0x09ab('0x4a')]=function(_0x361424,_0x4a582c){return db[_0x09ab('0x2d')][_0x09ab('0x4a')](_0x361424[_0x09ab('0x4b')],{})['then'](respondWithResult(_0x4a582c,0xc9))[_0x09ab('0x46')](handleError(_0x4a582c,null));};exports[_0x09ab('0x24')]=function(_0x3e45a1,_0xc2a33b){if(_0x3e45a1['body']['id']){delete _0x3e45a1['body']['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x3e45a1[_0x09ab('0x48')]['id']}})[_0x09ab('0x25')](handleEntityNotFound(_0xc2a33b,null))[_0x09ab('0x25')](saveUpdates(_0x3e45a1['body'],null))[_0x09ab('0x25')](respondWithResult(_0xc2a33b,null))[_0x09ab('0x46')](handleError(_0xc2a33b,null));};exports['destroy']=function(_0x21b10c,_0xee2f7b){return db[_0x09ab('0x2d')][_0x09ab('0x49')]({'where':{'id':_0x21b10c['params']['id']}})[_0x09ab('0x25')](handleEntityNotFound(_0xee2f7b,null))[_0x09ab('0x25')](removeEntity(_0xee2f7b,null))[_0x09ab('0x46')](handleError(_0xee2f7b,null));};exports[_0x09ab('0x4c')]=function(_0x2002c2,_0x55fd92){return db[_0x09ab('0x2d')][_0x09ab('0x4c')]()[_0x09ab('0x25')](respondWithResult(_0x55fd92,null))[_0x09ab('0x46')](handleError(_0x55fd92,null));};
\ No newline at end of file
+var _0x6c32=['offset','limit','undefined','count','set','apply','update','then','destroy','error','send','index','map','fieldName','type','name','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','JscriptyAnswerReport','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json'];(function(_0x3a6a70,_0x3a1172){var _0x22f3b5=function(_0x309fe8){while(--_0x309fe8){_0x3a6a70['push'](_0x3a6a70['shift']());}};_0x22f3b5(++_0x3a1172);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x26c3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26c3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x26c3('0x2'));var moment=require('moment');var BPromise=require(_0x26c3('0x3'));var Mustache=require(_0x26c3('0x4'));var util=require('util');var path=require('path');var sox=require(_0x26c3('0x5'));var csv=require(_0x26c3('0x6'));var ejs=require(_0x26c3('0x7'));var fs=require('fs');var fs_extra=require(_0x26c3('0x8'));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('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x26c3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x26c3('0xf'));var as=require(_0x26c3('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26c3('0x11'))(_0x26c3('0x12'));var utils=require(_0x26c3('0x13'));var config=require(_0x26c3('0x14'));var licenseUtil=require(_0x26c3('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41a6c2,_0x3be1d4){_0x3be1d4=_0x3be1d4||0xcc;return function(_0x3e00f4){if(_0x3e00f4){return _0x41a6c2[_0x26c3('0x16')](_0x3be1d4);}return _0x41a6c2[_0x26c3('0x17')](_0x3be1d4)[_0x26c3('0x18')]();};}function respondWithResult(_0x1a8ea5,_0x278214){_0x278214=_0x278214||0xc8;return function(_0x5443cd){if(_0x5443cd){return _0x1a8ea5['status'](_0x278214)[_0x26c3('0x19')](_0x5443cd);}};}function respondWithFilteredResult(_0xd612e7,_0xd2f9a7){return function(_0x2e8f6b){if(_0x2e8f6b){var _0xad4e1e=typeof _0xd2f9a7[_0x26c3('0x1a')]==='undefined'&&typeof _0xd2f9a7[_0x26c3('0x1b')]===_0x26c3('0x1c');var _0x4db301=_0x2e8f6b[_0x26c3('0x1d')];var _0x4de336=_0xad4e1e?0x0:_0xd2f9a7[_0x26c3('0x1a')];var _0x570b03=_0xad4e1e?_0x2e8f6b[_0x26c3('0x1d')]:_0xd2f9a7[_0x26c3('0x1a')]+_0xd2f9a7[_0x26c3('0x1b')];var _0x26ae49;if(_0x570b03>=_0x4db301){_0x570b03=_0x4db301;_0x26ae49=0xc8;}else{_0x26ae49=0xce;}_0xd612e7['status'](_0x26ae49);return _0xd612e7[_0x26c3('0x1e')]('Content-Range',_0x4de336+'-'+_0x570b03+'/'+_0x4db301)[_0x26c3('0x19')](_0x2e8f6b);}return null;};}function patchUpdates(_0x48ea4a){return function(_0x1c77e6){try{jsonpatch[_0x26c3('0x1f')](_0x1c77e6,_0x48ea4a,!![]);}catch(_0x8819f2){return BPromise['reject'](_0x8819f2);}return _0x1c77e6['save']();};}function saveUpdates(_0x524ac1,_0x25f771){return function(_0xba4076){if(_0xba4076){return _0xba4076[_0x26c3('0x20')](_0x524ac1)[_0x26c3('0x21')](function(_0x3db905){return _0x3db905;});}return null;};}function removeEntity(_0x582b5e,_0x39c6fb){return function(_0x4a5220){if(_0x4a5220){return _0x4a5220[_0x26c3('0x22')]()[_0x26c3('0x21')](function(){_0x582b5e[_0x26c3('0x17')](0xcc)[_0x26c3('0x18')]();});}};}function handleEntityNotFound(_0x3aa515,_0x37373c){return function(_0xf8aee0){if(!_0xf8aee0){_0x3aa515[_0x26c3('0x16')](0x194);}return _0xf8aee0;};}function handleError(_0xd14177,_0x3ab3d6){_0x3ab3d6=_0x3ab3d6||0x1f4;return function(_0x15380c){logger[_0x26c3('0x23')](_0x15380c['stack']);if(_0x15380c['name']){delete _0x15380c['name'];}_0xd14177[_0x26c3('0x17')](_0x3ab3d6)[_0x26c3('0x24')](_0x15380c);};}exports[_0x26c3('0x25')]=function(_0xa1cf3d,_0x31d3f4){var _0x48f0dd={},_0x3aa957={},_0x3ef628={'count':0x0,'rows':[]};var _0x150d1c=_[_0x26c3('0x26')](db['JscriptyAnswerReport']['rawAttributes'],function(_0xc900d2){return{'name':_0xc900d2[_0x26c3('0x27')],'type':_0xc900d2[_0x26c3('0x28')]['key']};});_0x3aa957['model']=_[_0x26c3('0x26')](_0x150d1c,_0x26c3('0x29'));_0x3aa957[_0x26c3('0x2a')]=_['keys'](_0xa1cf3d[_0x26c3('0x2a')]);_0x3aa957['filters']=_[_0x26c3('0x2b')](_0x3aa957['model'],_0x3aa957[_0x26c3('0x2a')]);_0x48f0dd['attributes']=_['intersection'](_0x3aa957[_0x26c3('0x2c')],qs[_0x26c3('0x2d')](_0xa1cf3d[_0x26c3('0x2a')][_0x26c3('0x2d')]));_0x48f0dd[_0x26c3('0x2e')]=_0x48f0dd[_0x26c3('0x2e')][_0x26c3('0x2f')]?_0x48f0dd['attributes']:_0x3aa957['model'];if(!_0xa1cf3d[_0x26c3('0x2a')][_0x26c3('0x30')]('nolimit')){_0x48f0dd[_0x26c3('0x1b')]=qs[_0x26c3('0x1b')](_0xa1cf3d[_0x26c3('0x2a')][_0x26c3('0x1b')]);_0x48f0dd['offset']=qs['offset'](_0xa1cf3d['query'][_0x26c3('0x1a')]);}_0x48f0dd[_0x26c3('0x31')]=qs[_0x26c3('0x32')](_0xa1cf3d[_0x26c3('0x2a')][_0x26c3('0x32')]);_0x48f0dd[_0x26c3('0x33')]=qs[_0x26c3('0x34')](_[_0x26c3('0x35')](_0xa1cf3d[_0x26c3('0x2a')],_0x3aa957[_0x26c3('0x34')]),_0x150d1c);if(_0xa1cf3d[_0x26c3('0x2a')][_0x26c3('0x36')]){_0x48f0dd[_0x26c3('0x33')]=_[_0x26c3('0x37')](_0x48f0dd[_0x26c3('0x33')],{'$or':_[_0x26c3('0x26')](_0x150d1c,function(_0x3de84e){if(_0x3de84e['type']!==_0x26c3('0x38')){var _0x304766={};_0x304766[_0x3de84e[_0x26c3('0x29')]]={'$like':'%'+_0xa1cf3d[_0x26c3('0x2a')]['filter']+'%'};return _0x304766;}})});}_0x48f0dd=_[_0x26c3('0x37')]({},_0x48f0dd,_0xa1cf3d[_0x26c3('0x39')]);var _0x36e291={'where':_0x48f0dd[_0x26c3('0x33')]};return db[_0x26c3('0x3a')][_0x26c3('0x1d')](_0x36e291)[_0x26c3('0x21')](function(_0x1f2a3d){_0x3ef628[_0x26c3('0x1d')]=_0x1f2a3d;if(_0xa1cf3d['query'][_0x26c3('0x3b')]){_0x48f0dd[_0x26c3('0x3c')]=[{'all':!![]}];}return db[_0x26c3('0x3a')][_0x26c3('0x3d')](_0x48f0dd);})[_0x26c3('0x21')](function(_0x5e5b7f){_0x3ef628[_0x26c3('0x3e')]=_0x5e5b7f;return _0x3ef628;})['then'](respondWithFilteredResult(_0x31d3f4,_0x48f0dd))[_0x26c3('0x3f')](handleError(_0x31d3f4,null));};exports['show']=function(_0x25f5ed,_0x2d69ac){var _0x26d8cf={'raw':!![],'where':{'id':_0x25f5ed[_0x26c3('0x40')]['id']}},_0x46f552={};_0x46f552[_0x26c3('0x2c')]=_['keys'](db['JscriptyAnswerReport']['rawAttributes']);_0x46f552[_0x26c3('0x2a')]=_['keys'](_0x25f5ed[_0x26c3('0x2a')]);_0x46f552['filters']=_[_0x26c3('0x2b')](_0x46f552[_0x26c3('0x2c')],_0x46f552[_0x26c3('0x2a')]);_0x26d8cf['attributes']=_[_0x26c3('0x2b')](_0x46f552['model'],qs[_0x26c3('0x2d')](_0x25f5ed[_0x26c3('0x2a')][_0x26c3('0x2d')]));_0x26d8cf[_0x26c3('0x2e')]=_0x26d8cf[_0x26c3('0x2e')][_0x26c3('0x2f')]?_0x26d8cf[_0x26c3('0x2e')]:_0x46f552[_0x26c3('0x2c')];if(_0x25f5ed[_0x26c3('0x2a')][_0x26c3('0x3b')]){_0x26d8cf[_0x26c3('0x3c')]=[{'all':!![]}];}_0x26d8cf=_[_0x26c3('0x37')]({},_0x26d8cf,_0x25f5ed[_0x26c3('0x39')]);return db[_0x26c3('0x3a')][_0x26c3('0x41')](_0x26d8cf)[_0x26c3('0x21')](handleEntityNotFound(_0x2d69ac,null))[_0x26c3('0x21')](respondWithResult(_0x2d69ac,null))[_0x26c3('0x3f')](handleError(_0x2d69ac,null));};exports[_0x26c3('0x42')]=function(_0x1bb4ac,_0x41ba28){return db[_0x26c3('0x3a')][_0x26c3('0x42')](_0x1bb4ac[_0x26c3('0x43')],{})[_0x26c3('0x21')](respondWithResult(_0x41ba28,0xc9))[_0x26c3('0x3f')](handleError(_0x41ba28,null));};exports[_0x26c3('0x20')]=function(_0x18349e,_0x22e31a){if(_0x18349e[_0x26c3('0x43')]['id']){delete _0x18349e[_0x26c3('0x43')]['id'];}return db[_0x26c3('0x3a')][_0x26c3('0x41')]({'where':{'id':_0x18349e['params']['id']}})[_0x26c3('0x21')](handleEntityNotFound(_0x22e31a,null))[_0x26c3('0x21')](saveUpdates(_0x18349e[_0x26c3('0x43')],null))['then'](respondWithResult(_0x22e31a,null))[_0x26c3('0x3f')](handleError(_0x22e31a,null));};exports[_0x26c3('0x22')]=function(_0x4262be,_0x6f844){return db['JscriptyAnswerReport'][_0x26c3('0x41')]({'where':{'id':_0x4262be[_0x26c3('0x40')]['id']}})[_0x26c3('0x21')](handleEntityNotFound(_0x6f844,null))[_0x26c3('0x21')](removeEntity(_0x6f844,null))[_0x26c3('0x3f')](handleError(_0x6f844,null));};exports[_0x26c3('0x44')]=function(_0x15a716,_0x4d6865){return db['JscriptyAnswerReport'][_0x26c3('0x44')]()[_0x26c3('0x21')](respondWithResult(_0x4d6865,null))['catch'](handleError(_0x4d6865,null));};
\ No newline at end of file
index 79d8de0..86deb76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x535f=['util','../../config/logger','api','request-promise','path','rimraf','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers'];(function(_0x38c301,_0x3eb158){var _0x3b3e8a=function(_0x1ae559){while(--_0x1ae559){_0x38c301['push'](_0x38c301['shift']());}};_0x3b3e8a(++_0x3eb158);}(_0x535f,0x134));var _0xf535=function(_0x26738b,_0x54f231){_0x26738b=_0x26738b-0x0;var _0x2851c8=_0x535f[_0x26738b];return _0x2851c8;};'use strict';var _=require('lodash');var util=require(_0xf535('0x0'));var logger=require(_0xf535('0x1'))(_0xf535('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf535('0x3'));var fs=require('fs');var path=require(_0xf535('0x4'));var rimraf=require(_0xf535('0x5'));var config=require('../../config/environment');var attributes=require(_0xf535('0x6'));module[_0xf535('0x7')]=function(_0x33b43d,_0x3e4039){return _0x33b43d[_0xf535('0x8')](_0xf535('0x9'),attributes,{'tableName':_0xf535('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbe43=['define','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xbe43,0x15e));var _0x3be4=function(_0x27f531,_0x45f1d1){_0x27f531=_0x27f531-0x0;var _0x3b1bf5=_0xbe43[_0x27f531];return _0x3b1bf5;};'use strict';var _=require(_0x3be4('0x0'));var util=require(_0x3be4('0x1'));var logger=require(_0x3be4('0x2'))(_0x3be4('0x3'));var moment=require(_0x3be4('0x4'));var BPromise=require(_0x3be4('0x5'));var rp=require(_0x3be4('0x6'));var fs=require('fs');var path=require(_0x3be4('0x7'));var rimraf=require(_0x3be4('0x8'));var config=require(_0x3be4('0x9'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x2d0c5a,_0x494f87){return _0x2d0c5a[_0x3be4('0xa')]('JscriptyAnswerReport',attributes,{'tableName':_0x3be4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d991994..e0916af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c35=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb'];(function(_0x58cbde,_0x4b0f62){var _0x5799f3=function(_0x326eca){while(--_0x326eca){_0x58cbde['push'](_0x58cbde['shift']());}};_0x5799f3(++_0x4b0f62);}(_0x4c35,0x86));var _0x54c3=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x4c35[_0x1b7368];return _0x25d54c;};'use strict';var _=require('lodash');var util=require(_0x54c3('0x0'));var moment=require('moment');var BPromise=require(_0x54c3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x54c3('0x2'));var db=require(_0x54c3('0x3'))['db'];var utils=require(_0x54c3('0x4'));var logger=require(_0x54c3('0x5'))(_0x54c3('0x6'));var config=require(_0x54c3('0x7'));var jayson=require(_0x54c3('0x8'));var client=jayson[_0x54c3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4363be,_0x51e258,_0x449673){return new BPromise(function(_0x35cb41,_0x290947){return client[_0x54c3('0xa')](_0x4363be,_0x449673)[_0x54c3('0xb')](function(_0x5582b1){logger[_0x54c3('0xc')](_0x54c3('0xd'),_0x51e258,_0x54c3('0xe'));logger[_0x54c3('0xf')](_0x54c3('0x10'),_0x51e258,_0x54c3('0xe'),JSON[_0x54c3('0x11')](_0x5582b1));if(_0x5582b1['error']){if(_0x5582b1[_0x54c3('0x12')][_0x54c3('0x13')]===0x1f4){logger[_0x54c3('0x12')](_0x54c3('0xd'),_0x51e258,_0x5582b1[_0x54c3('0x12')][_0x54c3('0x14')]);return _0x290947(_0x5582b1[_0x54c3('0x12')][_0x54c3('0x14')]);}logger[_0x54c3('0x12')](_0x54c3('0xd'),_0x51e258,_0x5582b1['error'][_0x54c3('0x14')]);return _0x35cb41(_0x5582b1[_0x54c3('0x12')]['message']);}else{logger[_0x54c3('0xc')](_0x54c3('0xd'),_0x51e258,_0x54c3('0xe'));_0x35cb41(_0x5582b1[_0x54c3('0x15')][_0x54c3('0x14')]);}})[_0x54c3('0x16')](function(_0x1ee2c6){logger[_0x54c3('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x51e258,_0x1ee2c6);_0x290947(_0x1ee2c6);});});}
\ No newline at end of file
+var _0x0c39=['code','JscriptyAnswerReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','http','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x58aef6,_0x447deb){var _0x2d4f50=function(_0x53791a){while(--_0x53791a){_0x58aef6['push'](_0x58aef6['shift']());}};_0x2d4f50(++_0x447deb);}(_0x0c39,0xb1));var _0x90c3=function(_0x104bfa,_0x2b78c2){_0x104bfa=_0x104bfa-0x0;var _0x581cde=_0x0c39[_0x104bfa];return _0x581cde;};'use strict';var _=require(_0x90c3('0x0'));var util=require(_0x90c3('0x1'));var moment=require('moment');var BPromise=require(_0x90c3('0x2'));var rs=require(_0x90c3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x90c3('0x4'));var logger=require('../../config/logger')(_0x90c3('0x5'));var config=require(_0x90c3('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x90c3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4e518b,_0x165d4e,_0x163dda){return new BPromise(function(_0xa7a2fe,_0x78cd9b){return client['request'](_0x4e518b,_0x163dda)['then'](function(_0x28401b){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x165d4e,_0x90c3('0x8'));logger[_0x90c3('0x9')](_0x90c3('0xa'),_0x165d4e,_0x90c3('0x8'),JSON[_0x90c3('0xb')](_0x28401b));if(_0x28401b[_0x90c3('0xc')]){if(_0x28401b[_0x90c3('0xc')][_0x90c3('0xd')]===0x1f4){logger[_0x90c3('0xc')](_0x90c3('0xe'),_0x165d4e,_0x28401b['error'][_0x90c3('0xf')]);return _0x78cd9b(_0x28401b[_0x90c3('0xc')][_0x90c3('0xf')]);}logger[_0x90c3('0xc')](_0x90c3('0xe'),_0x165d4e,_0x28401b['error'][_0x90c3('0xf')]);return _0xa7a2fe(_0x28401b[_0x90c3('0xc')][_0x90c3('0xf')]);}else{logger[_0x90c3('0x10')](_0x90c3('0xe'),_0x165d4e,_0x90c3('0x8'));_0xa7a2fe(_0x28401b[_0x90c3('0x11')]['message']);}})[_0x90c3('0x12')](function(_0x268c3c){logger[_0x90c3('0xc')](_0x90c3('0xe'),_0x165d4e,_0x268c3c);_0x78cd9b(_0x268c3c);});});}
\ No newline at end of file
index d8ead8b..1e18c11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4eb4=['index','/:id','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','create','post','/:id/clone','clone','update','delete','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get'];(function(_0x172942,_0x4a3091){var _0x25feb4=function(_0xf6f637){while(--_0xf6f637){_0x172942['push'](_0x172942['shift']());}};_0x25feb4(++_0x4a3091);}(_0x4eb4,0x13d));var _0x44eb=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0x4eb4[_0x16de68];return _0x1c277e;};'use strict';var multer=require('multer');var util=require(_0x44eb('0x0'));var path=require(_0x44eb('0x1'));var timeout=require(_0x44eb('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x44eb('0x3'));var interaction=require(_0x44eb('0x4'));var config=require(_0x44eb('0x5'));var controller=require(_0x44eb('0x6'));router[_0x44eb('0x7')]('/',auth['isAuthenticated'](),controller[_0x44eb('0x8')]);router[_0x44eb('0x7')](_0x44eb('0x9'),auth[_0x44eb('0xa')](),controller[_0x44eb('0xb')]);router[_0x44eb('0x7')](_0x44eb('0xc'),auth[_0x44eb('0xa')](),controller[_0x44eb('0xd')]);router[_0x44eb('0x7')](_0x44eb('0xe'),auth[_0x44eb('0xa')](),controller[_0x44eb('0xf')]);router['get'](_0x44eb('0x10'),auth['isAuthenticated'](),timeout('30s'),controller[_0x44eb('0x11')]);router['post']('/',auth[_0x44eb('0xa')](),controller[_0x44eb('0x12')]);router[_0x44eb('0x13')](_0x44eb('0x14'),auth['isAuthenticated'](),controller[_0x44eb('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x44eb('0x16')]);router[_0x44eb('0x17')](_0x44eb('0x9'),auth[_0x44eb('0xa')](),controller['destroy']);module[_0x44eb('0x18')]=router;
\ No newline at end of file
+var _0x7a4a=['30s','getSummary','create','/:id/clone','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','/:id','isAuthenticated','show'];(function(_0x23895f,_0x43e4a9){var _0x39cfc9=function(_0x72a423){while(--_0x72a423){_0x23895f['push'](_0x23895f['shift']());}};_0x39cfc9(++_0x43e4a9);}(_0x7a4a,0xa9));var _0xa7a4=function(_0x465e1c,_0xdff365){_0x465e1c=_0x465e1c-0x0;var _0xb35dda=_0x7a4a[_0x465e1c];return _0xb35dda;};'use strict';var multer=require(_0xa7a4('0x0'));var util=require(_0xa7a4('0x1'));var path=require(_0xa7a4('0x2'));var timeout=require(_0xa7a4('0x3'));var express=require(_0xa7a4('0x4'));var router=express[_0xa7a4('0x5')]();var fs_extra=require(_0xa7a4('0x6'));var auth=require(_0xa7a4('0x7'));var interaction=require(_0xa7a4('0x8'));var config=require(_0xa7a4('0x9'));var controller=require(_0xa7a4('0xa'));router[_0xa7a4('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa7a4('0xb')](_0xa7a4('0xc'),auth[_0xa7a4('0xd')](),controller[_0xa7a4('0xe')]);router[_0xa7a4('0xb')]('/:id/sessions',auth[_0xa7a4('0xd')](),controller['getSessions']);router[_0xa7a4('0xb')]('/:id/answers',auth[_0xa7a4('0xd')](),controller['getAnswers']);router[_0xa7a4('0xb')]('/:id/summary',auth[_0xa7a4('0xd')](),timeout(_0xa7a4('0xf')),controller[_0xa7a4('0x10')]);router['post']('/',auth[_0xa7a4('0xd')](),controller[_0xa7a4('0x11')]);router['post'](_0xa7a4('0x12'),auth[_0xa7a4('0xd')](),controller['clone']);router[_0xa7a4('0x13')](_0xa7a4('0xc'),auth[_0xa7a4('0xd')](),controller[_0xa7a4('0x14')]);router[_0xa7a4('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa7a4('0x16')]=router;
\ No newline at end of file
index 542a314..3d050fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0122=['format','getDataValue','description','BOOLEAN','exports','STRING','name','TEXT','long','setDataValue','formData','stringify','isString'];(function(_0x2cecca,_0x303e5c){var _0x432c2b=function(_0x38f5ad){while(--_0x38f5ad){_0x2cecca['push'](_0x2cecca['shift']());}};_0x432c2b(++_0x303e5c);}(_0x0122,0xee));var _0x2012=function(_0x4e477b,_0x15ed82){_0x4e477b=_0x4e477b-0x0;var _0x73942f=_0x0122[_0x4e477b];return _0x73942f;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require('util');module[_0x2012('0x0')]={'name':{'type':Sequelize[_0x2012('0x1')],'unique':_0x2012('0x2')},'description':{'type':Sequelize[_0x2012('0x1')]},'formData':{'type':Sequelize[_0x2012('0x3')](_0x2012('0x4')),'set':function(_0x40925d){if(_['isObjectLike'](_0x40925d)){this[_0x2012('0x5')](_0x2012('0x6'),JSON[_0x2012('0x7')](_0x40925d));}else if(_[_0x2012('0x8')](_0x40925d)){this[_0x2012('0x5')](_0x2012('0x6'),_0x40925d);}else{this[_0x2012('0x5')](_0x2012('0x6'),util[_0x2012('0x9')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x2012('0xa')]('name')||'',this['getDataValue'](_0x2012('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x2012('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x3e03=['long','isObjectLike','setDataValue','stringify','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name'];(function(_0x334992,_0x4c8dd8){var _0x7b25b1=function(_0x36e6ae){while(--_0x36e6ae){_0x334992['push'](_0x334992['shift']());}};_0x7b25b1(++_0x4c8dd8);}(_0x3e03,0xd7));var _0x33e0=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0x3e03[_0x39f34f];return _0x59fee1;};'use strict';var Sequelize=require(_0x33e0('0x0'));var _=require(_0x33e0('0x1'));var util=require(_0x33e0('0x2'));module[_0x33e0('0x3')]={'name':{'type':Sequelize[_0x33e0('0x4')],'unique':_0x33e0('0x5')},'description':{'type':Sequelize[_0x33e0('0x4')]},'formData':{'type':Sequelize['TEXT'](_0x33e0('0x6')),'set':function(_0x2fa130){if(_[_0x33e0('0x7')](_0x2fa130)){this[_0x33e0('0x8')]('formData',JSON[_0x33e0('0x9')](_0x2fa130));}else if(_[_0x33e0('0xa')](_0x2fa130)){this['setDataValue']('formData',_0x2fa130);}else{this[_0x33e0('0x8')](_0x33e0('0xb'),util[_0x33e0('0xc')](_0x33e0('0xd'),this[_0x33e0('0xe')](_0x33e0('0x5'))||'',this['getDataValue'](_0x33e0('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x33e0('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x33e0('0x10')],'defaultValue':![]}};
\ No newline at end of file
index 2025b54..8e6dbfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x464b=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','end','status','json','offset','undefined','limit','Content-Range','apply','reject','then','get','UserProfileResource','destroy','sendStatus','error','send','index','map','JscriptyProject','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','type','filter','options','count','includeAll','include','rows','show','params','rawAttributes','merge','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','catch','clone','omit','createdAt','updatedAt','Projects','update','findOne','JscriptySessionReport','order','ProjectId','getAnswers','pick','JscriptyAnswerReport','findAll','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Content-type','text/csv','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x464b,0x161));var _0xb464=function(_0x3d0052,_0x540f4b){_0x3d0052=_0x3d0052-0x0;var _0x4053ff=_0x464b[_0x3d0052];return _0x4053ff;};'use strict';var emlformat=require(_0xb464('0x0'));var rimraf=require(_0xb464('0x1'));var zipdir=require(_0xb464('0x2'));var jsonpatch=require(_0xb464('0x3'));var rp=require(_0xb464('0x4'));var moment=require(_0xb464('0x5'));var BPromise=require(_0xb464('0x6'));var Mustache=require(_0xb464('0x7'));var util=require(_0xb464('0x8'));var path=require(_0xb464('0x9'));var sox=require(_0xb464('0xa'));var csv=require(_0xb464('0xb'));var ejs=require(_0xb464('0xc'));var fs=require('fs');var fs_extra=require(_0xb464('0xd'));var _=require(_0xb464('0xe'));var squel=require('squel');var crypto=require(_0xb464('0xf'));var jsforce=require(_0xb464('0x10'));var deskjs=require(_0xb464('0x11'));var toCsv=require(_0xb464('0xb'));var querystring=require(_0xb464('0x12'));var Papa=require(_0xb464('0x13'));var Redis=require(_0xb464('0x14'));var authService=require(_0xb464('0x15'));var qs=require(_0xb464('0x16'));var as=require(_0xb464('0x17'));var hardwareService=require(_0xb464('0x18'));var logger=require(_0xb464('0x19'))(_0xb464('0x1a'));var utils=require(_0xb464('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0xb464('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bf2ca,_0x3576d9){_0x3576d9=_0x3576d9||0xcc;return function(_0x3af139){if(_0x3af139){return _0x4bf2ca['sendStatus'](_0x3576d9);}return _0x4bf2ca['status'](_0x3576d9)[_0xb464('0x1d')]();};}function respondWithResult(_0x24ab1f,_0x29e98e){_0x29e98e=_0x29e98e||0xc8;return function(_0x495302){if(_0x495302){return _0x24ab1f[_0xb464('0x1e')](_0x29e98e)[_0xb464('0x1f')](_0x495302);}};}function respondWithFilteredResult(_0x10fea9,_0x2a30f6){return function(_0x364326){if(_0x364326){var _0x314ed9=typeof _0x2a30f6[_0xb464('0x20')]===_0xb464('0x21')&&typeof _0x2a30f6['limit']==='undefined';var _0x4bd221=_0x364326['count'];var _0x2ce8a0=_0x314ed9?0x0:_0x2a30f6[_0xb464('0x20')];var _0x6b21e2=_0x314ed9?_0x364326['count']:_0x2a30f6[_0xb464('0x20')]+_0x2a30f6[_0xb464('0x22')];var _0x3e9485;if(_0x6b21e2>=_0x4bd221){_0x6b21e2=_0x4bd221;_0x3e9485=0xc8;}else{_0x3e9485=0xce;}_0x10fea9['status'](_0x3e9485);return _0x10fea9['set'](_0xb464('0x23'),_0x2ce8a0+'-'+_0x6b21e2+'/'+_0x4bd221)[_0xb464('0x1f')](_0x364326);}return null;};}function patchUpdates(_0xc0ec2){return function(_0x32f278){try{jsonpatch[_0xb464('0x24')](_0x32f278,_0xc0ec2,!![]);}catch(_0xbeb87c){return BPromise[_0xb464('0x25')](_0xbeb87c);}return _0x32f278['save']();};}function saveUpdates(_0x3ae75b,_0x2641dc){return function(_0x11c61e){if(_0x11c61e){return _0x11c61e['update'](_0x3ae75b)['then'](function(_0x461ad4){return _0x461ad4;});}return null;};}function removeEntity(_0x2b24e2,_0x573fb8){return function(_0x70fbfc){if(_0x70fbfc){return _0x70fbfc['destroy']()[_0xb464('0x26')](function(){var _0x15ece6=_0x70fbfc[_0xb464('0x27')]({'plain':!![]});var _0xf29cef='Projects';return db[_0xb464('0x28')][_0xb464('0x29')]({'where':{'type':_0xf29cef,'resourceId':_0x15ece6['id']}})[_0xb464('0x26')](function(){return _0x70fbfc;});})['then'](function(){_0x2b24e2[_0xb464('0x1e')](0xcc)[_0xb464('0x1d')]();});}};}function handleEntityNotFound(_0x5e782f,_0x43c46e){return function(_0x4b3d97){if(!_0x4b3d97){_0x5e782f[_0xb464('0x2a')](0x194);}return _0x4b3d97;};}function handleError(_0x1d9216,_0x9c1ca7){_0x9c1ca7=_0x9c1ca7||0x1f4;return function(_0x3e4501){logger[_0xb464('0x2b')](_0x3e4501['stack']);if(_0x3e4501['name']){delete _0x3e4501['name'];}_0x1d9216['status'](_0x9c1ca7)[_0xb464('0x2c')](_0x3e4501);};}exports[_0xb464('0x2d')]=function(_0x307198,_0x33953a){var _0x21aa0e={},_0x46eba6={},_0x47fe9a={'count':0x0,'rows':[]};var _0x1d82fe=_[_0xb464('0x2e')](db[_0xb464('0x2f')]['rawAttributes'],function(_0x26c5dc){return{'name':_0x26c5dc[_0xb464('0x30')],'type':_0x26c5dc['type'][_0xb464('0x31')]};});_0x46eba6[_0xb464('0x32')]=_['map'](_0x1d82fe,_0xb464('0x33'));_0x46eba6[_0xb464('0x34')]=_[_0xb464('0x35')](_0x307198[_0xb464('0x34')]);_0x46eba6[_0xb464('0x36')]=_[_0xb464('0x37')](_0x46eba6['model'],_0x46eba6[_0xb464('0x34')]);_0x21aa0e[_0xb464('0x38')]=_[_0xb464('0x37')](_0x46eba6[_0xb464('0x32')],qs['fields'](_0x307198[_0xb464('0x34')][_0xb464('0x39')]));_0x21aa0e['attributes']=_0x21aa0e[_0xb464('0x38')][_0xb464('0x3a')]?_0x21aa0e[_0xb464('0x38')]:_0x46eba6[_0xb464('0x32')];if(!_0x307198['query'][_0xb464('0x3b')](_0xb464('0x3c'))){_0x21aa0e[_0xb464('0x22')]=qs[_0xb464('0x22')](_0x307198[_0xb464('0x34')][_0xb464('0x22')]);_0x21aa0e[_0xb464('0x20')]=qs[_0xb464('0x20')](_0x307198[_0xb464('0x34')][_0xb464('0x20')]);}_0x21aa0e['order']=qs[_0xb464('0x3d')](_0x307198['query'][_0xb464('0x3d')]);_0x21aa0e[_0xb464('0x3e')]=qs['filters'](_['pick'](_0x307198[_0xb464('0x34')],_0x46eba6[_0xb464('0x36')]),_0x1d82fe);if(_0x307198[_0xb464('0x34')]['filter']){_0x21aa0e['where']=_['merge'](_0x21aa0e['where'],{'$or':_[_0xb464('0x2e')](_0x1d82fe,function(_0xf43b88){if(_0xf43b88[_0xb464('0x3f')]!=='VIRTUAL'){var _0x34370e={};_0x34370e[_0xf43b88[_0xb464('0x33')]]={'$like':'%'+_0x307198[_0xb464('0x34')][_0xb464('0x40')]+'%'};return _0x34370e;}})});}_0x21aa0e=_['merge']({},_0x21aa0e,_0x307198[_0xb464('0x41')]);var _0x2b9ec3={'where':_0x21aa0e[_0xb464('0x3e')]};return db[_0xb464('0x2f')][_0xb464('0x42')](_0x2b9ec3)[_0xb464('0x26')](function(_0x4bb696){_0x47fe9a[_0xb464('0x42')]=_0x4bb696;if(_0x307198[_0xb464('0x34')][_0xb464('0x43')]){_0x21aa0e[_0xb464('0x44')]=[{'all':!![]}];}return db[_0xb464('0x2f')]['findAll'](_0x21aa0e);})[_0xb464('0x26')](function(_0x536d73){_0x47fe9a[_0xb464('0x45')]=_0x536d73;return _0x47fe9a;})[_0xb464('0x26')](respondWithFilteredResult(_0x33953a,_0x21aa0e))['catch'](handleError(_0x33953a,null));};exports[_0xb464('0x46')]=function(_0x452e3e,_0x39c0fd){var _0x39aee1={'raw':![],'where':{'id':_0x452e3e[_0xb464('0x47')]['id']}},_0xd1c9cc={};_0xd1c9cc['model']=_['keys'](db[_0xb464('0x2f')][_0xb464('0x48')]);_0xd1c9cc[_0xb464('0x34')]=_[_0xb464('0x35')](_0x452e3e[_0xb464('0x34')]);_0xd1c9cc[_0xb464('0x36')]=_[_0xb464('0x37')](_0xd1c9cc['model'],_0xd1c9cc[_0xb464('0x34')]);_0x39aee1[_0xb464('0x38')]=_['intersection'](_0xd1c9cc[_0xb464('0x32')],qs['fields'](_0x452e3e[_0xb464('0x34')][_0xb464('0x39')]));_0x39aee1[_0xb464('0x38')]=_0x39aee1[_0xb464('0x38')][_0xb464('0x3a')]?_0x39aee1[_0xb464('0x38')]:_0xd1c9cc['model'];if(_0x452e3e[_0xb464('0x34')][_0xb464('0x43')]){_0x39aee1[_0xb464('0x44')]=[{'all':!![]}];}_0x39aee1=_[_0xb464('0x49')]({},_0x39aee1,_0x452e3e[_0xb464('0x41')]);return db[_0xb464('0x2f')][_0xb464('0x4a')](_0x39aee1)['then'](handleEntityNotFound(_0x39c0fd,null))[_0xb464('0x26')](respondWithResult(_0x39c0fd,null))['catch'](handleError(_0x39c0fd,null));};exports['create']=function(_0x40e9f1,_0x1852b9){return db[_0xb464('0x2f')][_0xb464('0x4b')](_0x40e9f1[_0xb464('0x4c')],{})[_0xb464('0x26')](function(_0x8a932d){var _0x8c3a8c=_0x40e9f1['user'][_0xb464('0x27')]({'plain':!![]});if(!_0x8c3a8c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x8c3a8c[_0xb464('0x4d')]===_0xb464('0x4e')){var _0x2c7535=_0x8a932d[_0xb464('0x27')]({'plain':!![]});var _0x3a8a22='Projects';return db[_0xb464('0x4f')][_0xb464('0x4a')]({'where':{'name':_0x3a8a22,'userProfileId':_0x8c3a8c[_0xb464('0x50')]},'raw':!![]})[_0xb464('0x26')](function(_0x3c1f7a){if(_0x3c1f7a&&_0x3c1f7a[_0xb464('0x51')]===0x0){return db[_0xb464('0x28')][_0xb464('0x4b')]({'name':_0x2c7535[_0xb464('0x33')],'resourceId':_0x2c7535['id'],'type':_0x3c1f7a[_0xb464('0x33')],'sectionId':_0x3c1f7a['id']},{})[_0xb464('0x26')](function(){return _0x8a932d;});}else{return _0x8a932d;}})[_0xb464('0x52')](function(_0x215ca6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x215ca6);throw _0x215ca6;});}return _0x8a932d;})['then'](respondWithResult(_0x1852b9,0xc9))[_0xb464('0x52')](handleError(_0x1852b9,null));};exports[_0xb464('0x53')]=function(_0x1ed3ba,_0xb5adec){var _0x19a4ce={'where':{'id':_0x1ed3ba['params']['id']}},_0x9e343e={};_0x9e343e[_0xb464('0x32')]=_['keys'](db['JscriptyProject']['rawAttributes']);_0x19a4ce[_0xb464('0x38')]=_[_0xb464('0x37')](_0x9e343e[_0xb464('0x32')],qs[_0xb464('0x39')](_0x1ed3ba[_0xb464('0x34')][_0xb464('0x39')]));_0x19a4ce['attributes']=_0x19a4ce[_0xb464('0x38')][_0xb464('0x3a')]?_0x19a4ce[_0xb464('0x38')]:_0x9e343e[_0xb464('0x32')];if(_0x1ed3ba[_0xb464('0x34')][_0xb464('0x43')]){_0x19a4ce[_0xb464('0x44')]=[{'all':!![]}];}_0x19a4ce=_[_0xb464('0x49')]({},_0x19a4ce,_0x1ed3ba[_0xb464('0x41')]);return db[_0xb464('0x2f')][_0xb464('0x4a')](_0x19a4ce)[_0xb464('0x26')](handleEntityNotFound(_0xb5adec,null))[_0xb464('0x26')](function(_0x2151b7){if(_0x2151b7){var _0x40cf23=_0x2151b7[_0xb464('0x27')]({'plain':!![]});_0x40cf23=qs[_0xb464('0x54')](_0x40cf23,['id',_0xb464('0x55'),_0xb464('0x56')]);_0x1ed3ba[_0xb464('0x4c')]=_[_0xb464('0x54')](_0x1ed3ba[_0xb464('0x4c')],['id','createdAt','updatedAt']);return db[_0xb464('0x2f')][_0xb464('0x4b')](_[_0xb464('0x49')](_0x40cf23,_0x1ed3ba[_0xb464('0x4c')]),{'include':_0x1ed3ba[_0xb464('0x34')][_0xb464('0x43')]?[{'all':!![]}]:undefined})[_0xb464('0x26')](function(_0x296880){var _0x20d2f3=_0x1ed3ba['user']['get']({'plain':!![]});if(!_0x20d2f3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20d2f3[_0xb464('0x4d')]===_0xb464('0x4e')){var _0x442083=_0x296880[_0xb464('0x27')]({'plain':!![]});var _0x1e4851=_0xb464('0x57');return db['UserProfileSection'][_0xb464('0x4a')]({'where':{'name':_0x1e4851,'userProfileId':_0x20d2f3[_0xb464('0x50')]},'raw':!![]})[_0xb464('0x26')](function(_0x4b3642){if(_0x4b3642&&_0x4b3642[_0xb464('0x51')]===0x0){return db[_0xb464('0x28')]['create']({'name':_0x442083[_0xb464('0x33')],'resourceId':_0x442083['id'],'type':_0x4b3642['name'],'sectionId':_0x4b3642['id']},{})[_0xb464('0x26')](function(){return _0x296880;});}else{return _0x296880;}})[_0xb464('0x52')](function(_0x5abfe8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5abfe8);throw _0x5abfe8;});}return _0x296880;});}})['then'](respondWithResult(_0xb5adec,0xc9))[_0xb464('0x52')](handleError(_0xb5adec,null));};exports[_0xb464('0x58')]=function(_0x2b37f1,_0x2d0025){if(_0x2b37f1[_0xb464('0x4c')]['id']){delete _0x2b37f1[_0xb464('0x4c')]['id'];}return db[_0xb464('0x2f')][_0xb464('0x4a')]({'where':{'id':_0x2b37f1['params']['id']}})[_0xb464('0x26')](handleEntityNotFound(_0x2d0025,null))[_0xb464('0x26')](saveUpdates(_0x2b37f1[_0xb464('0x4c')],null))[_0xb464('0x26')](respondWithResult(_0x2d0025,null))[_0xb464('0x52')](handleError(_0x2d0025,null));};exports[_0xb464('0x29')]=function(_0x10f5a8,_0x2528f6){return db[_0xb464('0x2f')][_0xb464('0x4a')]({'where':{'id':_0x10f5a8['params']['id']}})[_0xb464('0x26')](handleEntityNotFound(_0x2528f6,null))['then'](removeEntity(_0x2528f6,null))[_0xb464('0x52')](handleError(_0x2528f6,null));};exports['getSessions']=function(_0x31d603,_0x1347b0,_0x2be33f){var _0x38637b={'raw':!![],'where':{}};var _0x36ade7={};var _0x28c6db={'count':0x0,'rows':[]};return db[_0xb464('0x2f')][_0xb464('0x59')]({'where':{'id':_0x31d603[_0xb464('0x47')]['id']}})[_0xb464('0x26')](handleEntityNotFound(_0x1347b0,null))['then'](function(_0x5494f9){if(_0x5494f9){_0x36ade7[_0xb464('0x32')]=_['keys'](db[_0xb464('0x5a')][_0xb464('0x48')]);_0x36ade7[_0xb464('0x34')]=_['keys'](_0x31d603['query']);_0x36ade7['filters']=_[_0xb464('0x37')](_0x36ade7[_0xb464('0x32')],_0x36ade7['query']);_0x38637b[_0xb464('0x38')]=_[_0xb464('0x37')](_0x36ade7[_0xb464('0x32')],qs[_0xb464('0x39')](_0x31d603[_0xb464('0x34')][_0xb464('0x39')]));_0x38637b[_0xb464('0x38')]=_0x38637b[_0xb464('0x38')][_0xb464('0x3a')]?_0x38637b[_0xb464('0x38')]:_0x36ade7[_0xb464('0x32')];if(!_0x31d603[_0xb464('0x34')][_0xb464('0x3b')](_0xb464('0x3c'))){_0x38637b[_0xb464('0x22')]=qs['limit'](_0x31d603[_0xb464('0x34')][_0xb464('0x22')]);_0x38637b[_0xb464('0x20')]=qs[_0xb464('0x20')](_0x31d603[_0xb464('0x34')][_0xb464('0x20')]);}_0x38637b[_0xb464('0x5b')]=qs[_0xb464('0x3d')](_0x31d603[_0xb464('0x34')][_0xb464('0x3d')]);_0x38637b[_0xb464('0x3e')]=qs['filters'](_['pick'](_0x31d603[_0xb464('0x34')],_0x36ade7[_0xb464('0x36')]));_0x38637b[_0xb464('0x3e')][_0xb464('0x5c')]=_0x5494f9['id'];if(_0x31d603[_0xb464('0x34')][_0xb464('0x40')]){_0x38637b[_0xb464('0x3e')]=_[_0xb464('0x49')](_0x38637b[_0xb464('0x3e')],{'$or':_[_0xb464('0x2e')](_0x38637b[_0xb464('0x38')],function(_0x38bfab){var _0x50160c={};_0x50160c[_0x38bfab]={'$like':'%'+_0x31d603[_0xb464('0x34')][_0xb464('0x40')]+'%'};return _0x50160c;})});}_0x38637b=_[_0xb464('0x49')]({},_0x38637b,_0x31d603[_0xb464('0x41')]);return db[_0xb464('0x5a')][_0xb464('0x42')]({'where':_0x38637b[_0xb464('0x3e')]})[_0xb464('0x26')](function(_0x1a4d64){_0x28c6db[_0xb464('0x42')]=_0x1a4d64;if(_0x31d603[_0xb464('0x34')][_0xb464('0x43')]){_0x38637b[_0xb464('0x44')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x38637b);})[_0xb464('0x26')](function(_0x661707){_0x28c6db['rows']=_0x661707;return _0x28c6db;});}})[_0xb464('0x26')](respondWithFilteredResult(_0x1347b0,_0x38637b))[_0xb464('0x52')](handleError(_0x1347b0,null));};exports[_0xb464('0x5d')]=function(_0x769738,_0x293fd1,_0x22de79){var _0x1255af={'raw':!![],'where':{}};var _0x8362ca={};var _0xaeb42b={'count':0x0,'rows':[]};return db[_0xb464('0x2f')][_0xb464('0x59')]({'where':{'id':_0x769738[_0xb464('0x47')]['id']}})[_0xb464('0x26')](handleEntityNotFound(_0x293fd1,null))[_0xb464('0x26')](function(_0x6b393f){if(_0x6b393f){_0x8362ca[_0xb464('0x32')]=_[_0xb464('0x35')](db['JscriptyAnswerReport']['rawAttributes']);_0x8362ca[_0xb464('0x34')]=_['keys'](_0x769738[_0xb464('0x34')]);_0x8362ca['filters']=_[_0xb464('0x37')](_0x8362ca[_0xb464('0x32')],_0x8362ca[_0xb464('0x34')]);_0x1255af[_0xb464('0x38')]=_[_0xb464('0x37')](_0x8362ca[_0xb464('0x32')],qs[_0xb464('0x39')](_0x769738[_0xb464('0x34')][_0xb464('0x39')]));_0x1255af[_0xb464('0x38')]=_0x1255af[_0xb464('0x38')][_0xb464('0x3a')]?_0x1255af[_0xb464('0x38')]:_0x8362ca[_0xb464('0x32')];if(!_0x769738[_0xb464('0x34')][_0xb464('0x3b')](_0xb464('0x3c'))){_0x1255af[_0xb464('0x22')]=qs['limit'](_0x769738[_0xb464('0x34')][_0xb464('0x22')]);_0x1255af[_0xb464('0x20')]=qs[_0xb464('0x20')](_0x769738[_0xb464('0x34')][_0xb464('0x20')]);}_0x1255af[_0xb464('0x5b')]=qs[_0xb464('0x3d')](_0x769738[_0xb464('0x34')][_0xb464('0x3d')]);_0x1255af['where']=qs[_0xb464('0x36')](_[_0xb464('0x5e')](_0x769738['query'],_0x8362ca[_0xb464('0x36')]));_0x1255af['where']['ProjectId']=_0x6b393f['id'];if(_0x769738['query'][_0xb464('0x40')]){_0x1255af[_0xb464('0x3e')]=_[_0xb464('0x49')](_0x1255af[_0xb464('0x3e')],{'$or':_[_0xb464('0x2e')](_0x1255af['attributes'],function(_0x33195f){var _0x2526f4={};_0x2526f4[_0x33195f]={'$like':'%'+_0x769738[_0xb464('0x34')][_0xb464('0x40')]+'%'};return _0x2526f4;})});}_0x1255af=_[_0xb464('0x49')]({},_0x1255af,_0x769738[_0xb464('0x41')]);return db[_0xb464('0x5f')][_0xb464('0x42')]({'where':_0x1255af[_0xb464('0x3e')]})['then'](function(_0x3b7f2d){_0xaeb42b[_0xb464('0x42')]=_0x3b7f2d;if(_0x769738[_0xb464('0x34')][_0xb464('0x43')]){_0x1255af[_0xb464('0x44')]=[{'all':!![]}];}return db[_0xb464('0x5f')][_0xb464('0x60')](_0x1255af);})[_0xb464('0x26')](function(_0x4fbe35){_0xaeb42b[_0xb464('0x45')]=_0x4fbe35;return _0xaeb42b;});}})[_0xb464('0x26')](respondWithFilteredResult(_0x293fd1,_0x1255af))[_0xb464('0x52')](handleError(_0x293fd1,null));};function char(_0x472b03){return _0xb464('0x61')===typeof _0x472b03?String[_0xb464('0x62')]['apply'](null,arguments):_0x472b03;}function needsEncapsulation(_0x5e2c79){return!!_0x5e2c79&&(_0x5e2c79[_0xb464('0x63')]()[_0xb464('0x64')](char(0xd))>=0x0||_0x5e2c79[_0xb464('0x63')]()['indexOf'](char(0xa))>=0x0||_0x5e2c79[_0xb464('0x63')]()['indexOf'](char(0x2c))>=0x0||_0x5e2c79['toString']()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x5bf8fd){var _0x4a7f22=char(0x22),_0x5877ac='\x5c'+char(0x22),_0x238ec9=_0x5bf8fd[_0xb464('0x63')]()[_0xb464('0x65')](new RegExp(_0x4a7f22,'g'),_0x5877ac);return _0x4a7f22+_0x238ec9+_0x4a7f22;}exports[_0xb464('0x66')]=function(_0x1d6208,_0x4101bf,_0x55a9c8){var _0x3c4d50,_0x184ef7;var _0x35de3f={'where':{'ProjectId':_0x1d6208[_0xb464('0x47')]['id']}};if(_0x1d6208[_0xb464('0x34')][_0xb464('0x67')]){_0x35de3f[_0xb464('0x3e')][_0xb464('0x68')]=JSON[_0xb464('0x69')](_0x1d6208[_0xb464('0x34')]['startTime']);}return db[_0xb464('0x5a')][_0xb464('0x60')](_0x35de3f)[_0xb464('0x26')](handleEntityNotFound(_0x4101bf,null))[_0xb464('0x26')](function(_0x5f05fa){if(_0x5f05fa){_0x3c4d50=_0x5f05fa;return db['JscriptyQuestionReport'][_0xb464('0x60')]({'where':{'SessionId':{'$in':_[_0xb464('0x2e')](_0x3c4d50,'id')},'ProjectId':_0x1d6208[_0xb464('0x47')]['id']},'order':_0xb464('0x6a')});}})['then'](handleEntityNotFound(_0x4101bf,null))[_0xb464('0x26')](function(_0x5668c9){if(_0x5668c9){_0x184ef7=_0x5668c9;var _0x288e0b={};for(var _0x8cc877=0x0,_0x3d3451=_0x184ef7['length'];_0x8cc877<_0x3d3451;_0x8cc877++){if(!_0x288e0b[_0xb464('0x3b')](_0x184ef7[_0x8cc877][_0xb464('0x6b')])){_0x288e0b[_0x184ef7[_0x8cc877][_0xb464('0x6b')]]=needsEncapsulation(_0x184ef7[_0x8cc877][_0xb464('0x6c')])?encapsulate(_0x184ef7[_0x8cc877][_0xb464('0x6c')]):_0x184ef7[_0x8cc877][_0xb464('0x6c')];}}var _0x15ede8=[],_0x2f267a={};for(var _0x1cfd6f=0x0,_0x2e9d9a=_0x3c4d50[_0xb464('0x3a')];_0x1cfd6f<_0x2e9d9a;_0x1cfd6f++){_0x2f267a={'ProjectId':_0x1d6208[_0xb464('0x47')]['id'],'SessionId':_0x3c4d50[_0x1cfd6f]['id'],'StartTime':moment(_0x3c4d50[_0x1cfd6f][_0xb464('0x68')])[_0xb464('0x6d')](_0xb464('0x6e'))};for(var _0x59af8e=0x0,_0xec5d91=_0x184ef7[_0xb464('0x3a')];_0x59af8e<_0xec5d91;_0x59af8e++){if(_0x184ef7[_0x59af8e][_0xb464('0x6f')]==_0x3c4d50[_0x1cfd6f]['id']&&_0x288e0b[_0xb464('0x3b')](_0x184ef7[_0x59af8e][_0xb464('0x6b')])){_0x2f267a[_0x288e0b[_0x184ef7[_0x59af8e]['questionId']]]=_0x184ef7[_0x59af8e]['answer'];}}for(var _0x4cb0c5 in _0x288e0b){if(!_0x2f267a[_0xb464('0x3b')](_0x288e0b[_0x4cb0c5])){_0x2f267a[_0x288e0b[_0x4cb0c5]]=null;}}_0x15ede8[_0xb464('0x70')](_0x2f267a);}return _0x15ede8;}})['then'](function(_0x26e266){if(!_['isEmpty'](_0x26e266)){var _0x33675e=toCsv(_0x26e266);var _0x2fd903=Date[_0xb464('0x71')]();fs[_0xb464('0x72')](util[_0xb464('0x6d')](_0xb464('0x73'),_0x1d6208['params']['id'],_0x2fd903),_0x33675e);_0x4101bf[_0xb464('0x74')]('Content-disposition',_0xb464('0x75')+util[_0xb464('0x6d')]('Jscripty_Project_%d_Summary_%s.csv',_0x1d6208[_0xb464('0x47')]['id'],_0x2fd903));_0x4101bf[_0xb464('0x74')](_0xb464('0x76'),_0xb464('0x77'));return _0x4101bf['download'](util[_0xb464('0x6d')](_0xb464('0x73'),_0x1d6208[_0xb464('0x47')]['id'],_0x2fd903));}else{return _0x4101bf['sendStatus'](0xcc);}})[_0xb464('0x52')](handleError(_0x4101bf,null));};
\ No newline at end of file
+var _0x9c32=['squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','end','error','name','send','map','JscriptyProject','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Projects','UserProfileSection','autoAssociation','UserProfileResource','clone','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','update','getSessions','JscriptySessionReport','ProjectId','getAnswers','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','ejs'];(function(_0x168ad0,_0x45e98b){var _0x3596fc=function(_0x388510){while(--_0x388510){_0x168ad0['push'](_0x168ad0['shift']());}};_0x3596fc(++_0x45e98b);}(_0x9c32,0x15d));var _0x29c3=function(_0x348fd7,_0x4fb1f6){_0x348fd7=_0x348fd7-0x0;var _0x2978f1=_0x9c32[_0x348fd7];return _0x2978f1;};'use strict';var emlformat=require(_0x29c3('0x0'));var rimraf=require(_0x29c3('0x1'));var zipdir=require(_0x29c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29c3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x29c3('0x4'));var util=require(_0x29c3('0x5'));var path=require('path');var sox=require(_0x29c3('0x6'));var csv=require('to-csv');var ejs=require(_0x29c3('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x29c3('0x8'));var crypto=require(_0x29c3('0x9'));var jsforce=require(_0x29c3('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x29c3('0xb'));var Redis=require(_0x29c3('0xc'));var authService=require(_0x29c3('0xd'));var qs=require(_0x29c3('0xe'));var as=require(_0x29c3('0xf'));var hardwareService=require(_0x29c3('0x10'));var logger=require(_0x29c3('0x11'))(_0x29c3('0x12'));var utils=require(_0x29c3('0x13'));var config=require(_0x29c3('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x29c3('0x15'))['db'];function respondWithStatusCode(_0xfffa07,_0x237e6e){_0x237e6e=_0x237e6e||0xcc;return function(_0x17eaae){if(_0x17eaae){return _0xfffa07[_0x29c3('0x16')](_0x237e6e);}return _0xfffa07['status'](_0x237e6e)['end']();};}function respondWithResult(_0x49453d,_0x1e8dac){_0x1e8dac=_0x1e8dac||0xc8;return function(_0x4f1da4){if(_0x4f1da4){return _0x49453d[_0x29c3('0x17')](_0x1e8dac)[_0x29c3('0x18')](_0x4f1da4);}};}function respondWithFilteredResult(_0x31a438,_0x407168){return function(_0x4314a){if(_0x4314a){var _0x1ba961=typeof _0x407168[_0x29c3('0x19')]===_0x29c3('0x1a')&&typeof _0x407168[_0x29c3('0x1b')]==='undefined';var _0x2eaa9f=_0x4314a[_0x29c3('0x1c')];var _0x5570dd=_0x1ba961?0x0:_0x407168[_0x29c3('0x19')];var _0x4e3a6f=_0x1ba961?_0x4314a[_0x29c3('0x1c')]:_0x407168['offset']+_0x407168[_0x29c3('0x1b')];var _0x1a5ae6;if(_0x4e3a6f>=_0x2eaa9f){_0x4e3a6f=_0x2eaa9f;_0x1a5ae6=0xc8;}else{_0x1a5ae6=0xce;}_0x31a438['status'](_0x1a5ae6);return _0x31a438[_0x29c3('0x1d')](_0x29c3('0x1e'),_0x5570dd+'-'+_0x4e3a6f+'/'+_0x2eaa9f)[_0x29c3('0x18')](_0x4314a);}return null;};}function patchUpdates(_0x2bbe49){return function(_0x50e34a){try{jsonpatch[_0x29c3('0x1f')](_0x50e34a,_0x2bbe49,!![]);}catch(_0x5843da){return BPromise[_0x29c3('0x20')](_0x5843da);}return _0x50e34a[_0x29c3('0x21')]();};}function saveUpdates(_0x25ae6a,_0x1e4ae9){return function(_0x56b7d9){if(_0x56b7d9){return _0x56b7d9['update'](_0x25ae6a)[_0x29c3('0x22')](function(_0x220059){return _0x220059;});}return null;};}function removeEntity(_0xf6a2d7,_0x2aa7d2){return function(_0x4016ff){if(_0x4016ff){return _0x4016ff[_0x29c3('0x23')]()[_0x29c3('0x22')](function(){var _0x4d048f=_0x4016ff[_0x29c3('0x24')]({'plain':!![]});var _0x2d49e4='Projects';return db['UserProfileResource']['destroy']({'where':{'type':_0x2d49e4,'resourceId':_0x4d048f['id']}})['then'](function(){return _0x4016ff;});})[_0x29c3('0x22')](function(){_0xf6a2d7[_0x29c3('0x17')](0xcc)[_0x29c3('0x25')]();});}};}function handleEntityNotFound(_0x368b3e,_0x2736c9){return function(_0x25fed2){if(!_0x25fed2){_0x368b3e[_0x29c3('0x16')](0x194);}return _0x25fed2;};}function handleError(_0x663ed6,_0x1bc5aa){_0x1bc5aa=_0x1bc5aa||0x1f4;return function(_0x17d3bd){logger[_0x29c3('0x26')](_0x17d3bd['stack']);if(_0x17d3bd['name']){delete _0x17d3bd[_0x29c3('0x27')];}_0x663ed6['status'](_0x1bc5aa)[_0x29c3('0x28')](_0x17d3bd);};}exports['index']=function(_0x277d7c,_0x4baad6){var _0x3d9fdb={},_0x2aed3a={},_0xbe6f82={'count':0x0,'rows':[]};var _0x3e0ef4=_[_0x29c3('0x29')](db[_0x29c3('0x2a')][_0x29c3('0x2b')],function(_0x570f3a){return{'name':_0x570f3a[_0x29c3('0x2c')],'type':_0x570f3a[_0x29c3('0x2d')][_0x29c3('0x2e')]};});_0x2aed3a['model']=_[_0x29c3('0x29')](_0x3e0ef4,_0x29c3('0x27'));_0x2aed3a[_0x29c3('0x2f')]=_[_0x29c3('0x30')](_0x277d7c[_0x29c3('0x2f')]);_0x2aed3a[_0x29c3('0x31')]=_['intersection'](_0x2aed3a[_0x29c3('0x32')],_0x2aed3a[_0x29c3('0x2f')]);_0x3d9fdb['attributes']=_[_0x29c3('0x33')](_0x2aed3a['model'],qs['fields'](_0x277d7c[_0x29c3('0x2f')][_0x29c3('0x34')]));_0x3d9fdb[_0x29c3('0x35')]=_0x3d9fdb[_0x29c3('0x35')][_0x29c3('0x36')]?_0x3d9fdb['attributes']:_0x2aed3a['model'];if(!_0x277d7c['query'][_0x29c3('0x37')](_0x29c3('0x38'))){_0x3d9fdb['limit']=qs[_0x29c3('0x1b')](_0x277d7c[_0x29c3('0x2f')]['limit']);_0x3d9fdb[_0x29c3('0x19')]=qs[_0x29c3('0x19')](_0x277d7c[_0x29c3('0x2f')][_0x29c3('0x19')]);}_0x3d9fdb[_0x29c3('0x39')]=qs[_0x29c3('0x3a')](_0x277d7c[_0x29c3('0x2f')][_0x29c3('0x3a')]);_0x3d9fdb[_0x29c3('0x3b')]=qs[_0x29c3('0x31')](_[_0x29c3('0x3c')](_0x277d7c[_0x29c3('0x2f')],_0x2aed3a[_0x29c3('0x31')]),_0x3e0ef4);if(_0x277d7c[_0x29c3('0x2f')][_0x29c3('0x3d')]){_0x3d9fdb['where']=_['merge'](_0x3d9fdb['where'],{'$or':_[_0x29c3('0x29')](_0x3e0ef4,function(_0x389817){if(_0x389817['type']!=='VIRTUAL'){var _0xff5466={};_0xff5466[_0x389817[_0x29c3('0x27')]]={'$like':'%'+_0x277d7c['query']['filter']+'%'};return _0xff5466;}})});}_0x3d9fdb=_[_0x29c3('0x3e')]({},_0x3d9fdb,_0x277d7c[_0x29c3('0x3f')]);var _0x43beb4={'where':_0x3d9fdb[_0x29c3('0x3b')]};return db[_0x29c3('0x2a')]['count'](_0x43beb4)['then'](function(_0x2d7e77){_0xbe6f82['count']=_0x2d7e77;if(_0x277d7c[_0x29c3('0x2f')][_0x29c3('0x40')]){_0x3d9fdb[_0x29c3('0x41')]=[{'all':!![]}];}return db[_0x29c3('0x2a')][_0x29c3('0x42')](_0x3d9fdb);})[_0x29c3('0x22')](function(_0x482ee1){_0xbe6f82[_0x29c3('0x43')]=_0x482ee1;return _0xbe6f82;})['then'](respondWithFilteredResult(_0x4baad6,_0x3d9fdb))[_0x29c3('0x44')](handleError(_0x4baad6,null));};exports[_0x29c3('0x45')]=function(_0x3c1f5f,_0x52e1cf){var _0x1f74ee={'raw':![],'where':{'id':_0x3c1f5f[_0x29c3('0x46')]['id']}},_0x18a8ac={};_0x18a8ac['model']=_[_0x29c3('0x30')](db[_0x29c3('0x2a')]['rawAttributes']);_0x18a8ac['query']=_[_0x29c3('0x30')](_0x3c1f5f['query']);_0x18a8ac[_0x29c3('0x31')]=_['intersection'](_0x18a8ac[_0x29c3('0x32')],_0x18a8ac[_0x29c3('0x2f')]);_0x1f74ee[_0x29c3('0x35')]=_[_0x29c3('0x33')](_0x18a8ac[_0x29c3('0x32')],qs[_0x29c3('0x34')](_0x3c1f5f[_0x29c3('0x2f')][_0x29c3('0x34')]));_0x1f74ee[_0x29c3('0x35')]=_0x1f74ee[_0x29c3('0x35')][_0x29c3('0x36')]?_0x1f74ee[_0x29c3('0x35')]:_0x18a8ac[_0x29c3('0x32')];if(_0x3c1f5f[_0x29c3('0x2f')][_0x29c3('0x40')]){_0x1f74ee[_0x29c3('0x41')]=[{'all':!![]}];}_0x1f74ee=_['merge']({},_0x1f74ee,_0x3c1f5f[_0x29c3('0x3f')]);return db[_0x29c3('0x2a')][_0x29c3('0x47')](_0x1f74ee)[_0x29c3('0x22')](handleEntityNotFound(_0x52e1cf,null))[_0x29c3('0x22')](respondWithResult(_0x52e1cf,null))[_0x29c3('0x44')](handleError(_0x52e1cf,null));};exports[_0x29c3('0x48')]=function(_0x2b6b71,_0x20a925){return db[_0x29c3('0x2a')][_0x29c3('0x48')](_0x2b6b71['body'],{})['then'](function(_0x116f1f){var _0x28d09f=_0x2b6b71[_0x29c3('0x49')][_0x29c3('0x24')]({'plain':!![]});if(!_0x28d09f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x28d09f['role']===_0x29c3('0x49')){var _0x1ce501=_0x116f1f[_0x29c3('0x24')]({'plain':!![]});var _0x222b3d=_0x29c3('0x4a');return db[_0x29c3('0x4b')][_0x29c3('0x47')]({'where':{'name':_0x222b3d,'userProfileId':_0x28d09f['userProfileId']},'raw':!![]})[_0x29c3('0x22')](function(_0x174850){if(_0x174850&&_0x174850[_0x29c3('0x4c')]===0x0){return db[_0x29c3('0x4d')][_0x29c3('0x48')]({'name':_0x1ce501[_0x29c3('0x27')],'resourceId':_0x1ce501['id'],'type':_0x174850[_0x29c3('0x27')],'sectionId':_0x174850['id']},{})[_0x29c3('0x22')](function(){return _0x116f1f;});}else{return _0x116f1f;}})['catch'](function(_0x51e82c){logger[_0x29c3('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x51e82c);throw _0x51e82c;});}return _0x116f1f;})[_0x29c3('0x22')](respondWithResult(_0x20a925,0xc9))['catch'](handleError(_0x20a925,null));};exports[_0x29c3('0x4e')]=function(_0x438063,_0x4a75c2){var _0x3417fd={'where':{'id':_0x438063[_0x29c3('0x46')]['id']}},_0x20d9d0={};_0x20d9d0[_0x29c3('0x32')]=_['keys'](db['JscriptyProject'][_0x29c3('0x2b')]);_0x3417fd['attributes']=_['intersection'](_0x20d9d0['model'],qs[_0x29c3('0x34')](_0x438063[_0x29c3('0x2f')][_0x29c3('0x34')]));_0x3417fd['attributes']=_0x3417fd[_0x29c3('0x35')]['length']?_0x3417fd[_0x29c3('0x35')]:_0x20d9d0[_0x29c3('0x32')];if(_0x438063['query']['includeAll']){_0x3417fd[_0x29c3('0x41')]=[{'all':!![]}];}_0x3417fd=_[_0x29c3('0x3e')]({},_0x3417fd,_0x438063[_0x29c3('0x3f')]);return db[_0x29c3('0x2a')][_0x29c3('0x47')](_0x3417fd)[_0x29c3('0x22')](handleEntityNotFound(_0x4a75c2,null))[_0x29c3('0x22')](function(_0x20ef59){if(_0x20ef59){var _0x599f68=_0x20ef59[_0x29c3('0x24')]({'plain':!![]});_0x599f68=qs[_0x29c3('0x4f')](_0x599f68,['id',_0x29c3('0x50'),_0x29c3('0x51')]);_0x438063[_0x29c3('0x52')]=_['omit'](_0x438063['body'],['id',_0x29c3('0x50'),_0x29c3('0x51')]);return db[_0x29c3('0x2a')][_0x29c3('0x48')](_['merge'](_0x599f68,_0x438063[_0x29c3('0x52')]),{'include':_0x438063[_0x29c3('0x2f')][_0x29c3('0x40')]?[{'all':!![]}]:undefined})[_0x29c3('0x22')](function(_0x4cd620){var _0x333eb2=_0x438063[_0x29c3('0x49')][_0x29c3('0x24')]({'plain':!![]});if(!_0x333eb2)throw new Error(_0x29c3('0x53'));if(_0x333eb2['role']==='user'){var _0x32f4b1=_0x4cd620[_0x29c3('0x24')]({'plain':!![]});var _0x2351c9='Projects';return db[_0x29c3('0x4b')]['find']({'where':{'name':_0x2351c9,'userProfileId':_0x333eb2[_0x29c3('0x54')]},'raw':!![]})[_0x29c3('0x22')](function(_0x18fd95){if(_0x18fd95&&_0x18fd95[_0x29c3('0x4c')]===0x0){return db['UserProfileResource'][_0x29c3('0x48')]({'name':_0x32f4b1['name'],'resourceId':_0x32f4b1['id'],'type':_0x18fd95[_0x29c3('0x27')],'sectionId':_0x18fd95['id']},{})['then'](function(){return _0x4cd620;});}else{return _0x4cd620;}})[_0x29c3('0x44')](function(_0x276c7f){logger[_0x29c3('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x276c7f);throw _0x276c7f;});}return _0x4cd620;});}})[_0x29c3('0x22')](respondWithResult(_0x4a75c2,0xc9))[_0x29c3('0x44')](handleError(_0x4a75c2,null));};exports[_0x29c3('0x55')]=function(_0x4a0db5,_0x4d8913){if(_0x4a0db5[_0x29c3('0x52')]['id']){delete _0x4a0db5[_0x29c3('0x52')]['id'];}return db[_0x29c3('0x2a')]['find']({'where':{'id':_0x4a0db5[_0x29c3('0x46')]['id']}})[_0x29c3('0x22')](handleEntityNotFound(_0x4d8913,null))['then'](saveUpdates(_0x4a0db5[_0x29c3('0x52')],null))[_0x29c3('0x22')](respondWithResult(_0x4d8913,null))[_0x29c3('0x44')](handleError(_0x4d8913,null));};exports[_0x29c3('0x23')]=function(_0x49950a,_0x4fb0af){return db[_0x29c3('0x2a')][_0x29c3('0x47')]({'where':{'id':_0x49950a[_0x29c3('0x46')]['id']}})[_0x29c3('0x22')](handleEntityNotFound(_0x4fb0af,null))['then'](removeEntity(_0x4fb0af,null))['catch'](handleError(_0x4fb0af,null));};exports[_0x29c3('0x56')]=function(_0x11dc82,_0x259646,_0x5469a8){var _0x299dea={'raw':!![],'where':{}};var _0x404476={};var _0x7a538={'count':0x0,'rows':[]};return db[_0x29c3('0x2a')]['findOne']({'where':{'id':_0x11dc82[_0x29c3('0x46')]['id']}})[_0x29c3('0x22')](handleEntityNotFound(_0x259646,null))[_0x29c3('0x22')](function(_0x14ed4f){if(_0x14ed4f){_0x404476['model']=_[_0x29c3('0x30')](db[_0x29c3('0x57')][_0x29c3('0x2b')]);_0x404476['query']=_[_0x29c3('0x30')](_0x11dc82[_0x29c3('0x2f')]);_0x404476['filters']=_['intersection'](_0x404476[_0x29c3('0x32')],_0x404476[_0x29c3('0x2f')]);_0x299dea[_0x29c3('0x35')]=_[_0x29c3('0x33')](_0x404476[_0x29c3('0x32')],qs['fields'](_0x11dc82[_0x29c3('0x2f')][_0x29c3('0x34')]));_0x299dea[_0x29c3('0x35')]=_0x299dea['attributes'][_0x29c3('0x36')]?_0x299dea[_0x29c3('0x35')]:_0x404476[_0x29c3('0x32')];if(!_0x11dc82['query'][_0x29c3('0x37')]('nolimit')){_0x299dea[_0x29c3('0x1b')]=qs[_0x29c3('0x1b')](_0x11dc82[_0x29c3('0x2f')][_0x29c3('0x1b')]);_0x299dea[_0x29c3('0x19')]=qs[_0x29c3('0x19')](_0x11dc82[_0x29c3('0x2f')][_0x29c3('0x19')]);}_0x299dea[_0x29c3('0x39')]=qs[_0x29c3('0x3a')](_0x11dc82[_0x29c3('0x2f')]['sort']);_0x299dea[_0x29c3('0x3b')]=qs[_0x29c3('0x31')](_[_0x29c3('0x3c')](_0x11dc82[_0x29c3('0x2f')],_0x404476['filters']));_0x299dea['where'][_0x29c3('0x58')]=_0x14ed4f['id'];if(_0x11dc82['query'][_0x29c3('0x3d')]){_0x299dea[_0x29c3('0x3b')]=_[_0x29c3('0x3e')](_0x299dea[_0x29c3('0x3b')],{'$or':_[_0x29c3('0x29')](_0x299dea['attributes'],function(_0x3bd90f){var _0x19ce50={};_0x19ce50[_0x3bd90f]={'$like':'%'+_0x11dc82[_0x29c3('0x2f')]['filter']+'%'};return _0x19ce50;})});}_0x299dea=_[_0x29c3('0x3e')]({},_0x299dea,_0x11dc82[_0x29c3('0x3f')]);return db['JscriptySessionReport'][_0x29c3('0x1c')]({'where':_0x299dea[_0x29c3('0x3b')]})[_0x29c3('0x22')](function(_0x2fa942){_0x7a538[_0x29c3('0x1c')]=_0x2fa942;if(_0x11dc82[_0x29c3('0x2f')]['includeAll']){_0x299dea[_0x29c3('0x41')]=[{'all':!![]}];}return db[_0x29c3('0x57')]['findAll'](_0x299dea);})[_0x29c3('0x22')](function(_0x16cb3d){_0x7a538[_0x29c3('0x43')]=_0x16cb3d;return _0x7a538;});}})[_0x29c3('0x22')](respondWithFilteredResult(_0x259646,_0x299dea))[_0x29c3('0x44')](handleError(_0x259646,null));};exports[_0x29c3('0x59')]=function(_0x156172,_0x331abf,_0x20a005){var _0xe826fb={'raw':!![],'where':{}};var _0xeefd22={};var _0x467cf4={'count':0x0,'rows':[]};return db[_0x29c3('0x2a')][_0x29c3('0x5a')]({'where':{'id':_0x156172[_0x29c3('0x46')]['id']}})['then'](handleEntityNotFound(_0x331abf,null))[_0x29c3('0x22')](function(_0x3a5817){if(_0x3a5817){_0xeefd22[_0x29c3('0x32')]=_[_0x29c3('0x30')](db[_0x29c3('0x5b')][_0x29c3('0x2b')]);_0xeefd22[_0x29c3('0x2f')]=_[_0x29c3('0x30')](_0x156172[_0x29c3('0x2f')]);_0xeefd22[_0x29c3('0x31')]=_[_0x29c3('0x33')](_0xeefd22[_0x29c3('0x32')],_0xeefd22[_0x29c3('0x2f')]);_0xe826fb[_0x29c3('0x35')]=_[_0x29c3('0x33')](_0xeefd22[_0x29c3('0x32')],qs['fields'](_0x156172[_0x29c3('0x2f')][_0x29c3('0x34')]));_0xe826fb[_0x29c3('0x35')]=_0xe826fb[_0x29c3('0x35')][_0x29c3('0x36')]?_0xe826fb[_0x29c3('0x35')]:_0xeefd22[_0x29c3('0x32')];if(!_0x156172[_0x29c3('0x2f')][_0x29c3('0x37')](_0x29c3('0x38'))){_0xe826fb[_0x29c3('0x1b')]=qs[_0x29c3('0x1b')](_0x156172[_0x29c3('0x2f')][_0x29c3('0x1b')]);_0xe826fb['offset']=qs[_0x29c3('0x19')](_0x156172[_0x29c3('0x2f')][_0x29c3('0x19')]);}_0xe826fb[_0x29c3('0x39')]=qs['sort'](_0x156172[_0x29c3('0x2f')][_0x29c3('0x3a')]);_0xe826fb[_0x29c3('0x3b')]=qs['filters'](_['pick'](_0x156172[_0x29c3('0x2f')],_0xeefd22[_0x29c3('0x31')]));_0xe826fb[_0x29c3('0x3b')]['ProjectId']=_0x3a5817['id'];if(_0x156172['query']['filter']){_0xe826fb[_0x29c3('0x3b')]=_[_0x29c3('0x3e')](_0xe826fb[_0x29c3('0x3b')],{'$or':_[_0x29c3('0x29')](_0xe826fb['attributes'],function(_0x5278bb){var _0x1c72e4={};_0x1c72e4[_0x5278bb]={'$like':'%'+_0x156172[_0x29c3('0x2f')][_0x29c3('0x3d')]+'%'};return _0x1c72e4;})});}_0xe826fb=_[_0x29c3('0x3e')]({},_0xe826fb,_0x156172[_0x29c3('0x3f')]);return db[_0x29c3('0x5b')]['count']({'where':_0xe826fb[_0x29c3('0x3b')]})['then'](function(_0x547456){_0x467cf4[_0x29c3('0x1c')]=_0x547456;if(_0x156172[_0x29c3('0x2f')][_0x29c3('0x40')]){_0xe826fb[_0x29c3('0x41')]=[{'all':!![]}];}return db[_0x29c3('0x5b')][_0x29c3('0x42')](_0xe826fb);})[_0x29c3('0x22')](function(_0x1a989e){_0x467cf4[_0x29c3('0x43')]=_0x1a989e;return _0x467cf4;});}})['then'](respondWithFilteredResult(_0x331abf,_0xe826fb))['catch'](handleError(_0x331abf,null));};function char(_0x887d3d){return _0x29c3('0x5c')===typeof _0x887d3d?String[_0x29c3('0x5d')][_0x29c3('0x1f')](null,arguments):_0x887d3d;}function needsEncapsulation(_0x3fb493){return!!_0x3fb493&&(_0x3fb493[_0x29c3('0x5e')]()[_0x29c3('0x5f')](char(0xd))>=0x0||_0x3fb493[_0x29c3('0x5e')]()[_0x29c3('0x5f')](char(0xa))>=0x0||_0x3fb493[_0x29c3('0x5e')]()[_0x29c3('0x5f')](char(0x2c))>=0x0||_0x3fb493[_0x29c3('0x5e')]()[_0x29c3('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x10545f){var _0x570f33=char(0x22),_0x1d2d71='\x5c'+char(0x22),_0x5cdeb5=_0x10545f[_0x29c3('0x5e')]()[_0x29c3('0x60')](new RegExp(_0x570f33,'g'),_0x1d2d71);return _0x570f33+_0x5cdeb5+_0x570f33;}exports[_0x29c3('0x61')]=function(_0x15daf9,_0x21ddd9,_0x4978b7){var _0x202dc1,_0x41281c;var _0x43b5fc={'where':{'ProjectId':_0x15daf9['params']['id']}};if(_0x15daf9[_0x29c3('0x2f')][_0x29c3('0x62')]){_0x43b5fc[_0x29c3('0x3b')]['starttime']=JSON[_0x29c3('0x63')](_0x15daf9[_0x29c3('0x2f')][_0x29c3('0x62')]);}return db[_0x29c3('0x57')]['findAll'](_0x43b5fc)[_0x29c3('0x22')](handleEntityNotFound(_0x21ddd9,null))[_0x29c3('0x22')](function(_0x50e69f){if(_0x50e69f){_0x202dc1=_0x50e69f;return db[_0x29c3('0x64')][_0x29c3('0x42')]({'where':{'SessionId':{'$in':_[_0x29c3('0x29')](_0x202dc1,'id')},'ProjectId':_0x15daf9[_0x29c3('0x46')]['id']},'order':_0x29c3('0x65')});}})[_0x29c3('0x22')](handleEntityNotFound(_0x21ddd9,null))['then'](function(_0x4f2f97){if(_0x4f2f97){_0x41281c=_0x4f2f97;var _0x2af260={};for(var _0x182c6f=0x0,_0x2f8d69=_0x41281c[_0x29c3('0x36')];_0x182c6f<_0x2f8d69;_0x182c6f++){if(!_0x2af260[_0x29c3('0x37')](_0x41281c[_0x182c6f][_0x29c3('0x66')])){_0x2af260[_0x41281c[_0x182c6f][_0x29c3('0x66')]]=needsEncapsulation(_0x41281c[_0x182c6f][_0x29c3('0x67')])?encapsulate(_0x41281c[_0x182c6f][_0x29c3('0x67')]):_0x41281c[_0x182c6f]['question'];}}var _0x2ddd40=[],_0x275d71={};for(var _0x5f4b69=0x0,_0x175910=_0x202dc1['length'];_0x5f4b69<_0x175910;_0x5f4b69++){_0x275d71={'ProjectId':_0x15daf9[_0x29c3('0x46')]['id'],'SessionId':_0x202dc1[_0x5f4b69]['id'],'StartTime':moment(_0x202dc1[_0x5f4b69]['starttime'])[_0x29c3('0x68')](_0x29c3('0x69'))};for(var _0x2895de=0x0,_0x32e1e5=_0x41281c[_0x29c3('0x36')];_0x2895de<_0x32e1e5;_0x2895de++){if(_0x41281c[_0x2895de][_0x29c3('0x6a')]==_0x202dc1[_0x5f4b69]['id']&&_0x2af260[_0x29c3('0x37')](_0x41281c[_0x2895de]['questionId'])){_0x275d71[_0x2af260[_0x41281c[_0x2895de][_0x29c3('0x66')]]]=_0x41281c[_0x2895de][_0x29c3('0x6b')];}}for(var _0x6717e0 in _0x2af260){if(!_0x275d71[_0x29c3('0x37')](_0x2af260[_0x6717e0])){_0x275d71[_0x2af260[_0x6717e0]]=null;}}_0x2ddd40[_0x29c3('0x6c')](_0x275d71);}return _0x2ddd40;}})[_0x29c3('0x22')](function(_0x5d2c73){if(!_['isEmpty'](_0x5d2c73)){var _0x257caf=toCsv(_0x5d2c73);var _0x4ebe83=Date[_0x29c3('0x6d')]();fs[_0x29c3('0x6e')](util[_0x29c3('0x68')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x15daf9[_0x29c3('0x46')]['id'],_0x4ebe83),_0x257caf);_0x21ddd9['setHeader'](_0x29c3('0x6f'),_0x29c3('0x70')+util[_0x29c3('0x68')](_0x29c3('0x71'),_0x15daf9['params']['id'],_0x4ebe83));_0x21ddd9[_0x29c3('0x72')](_0x29c3('0x73'),_0x29c3('0x74'));return _0x21ddd9[_0x29c3('0x75')](util[_0x29c3('0x68')](_0x29c3('0x76'),_0x15daf9[_0x29c3('0x46')]['id'],_0x4ebe83));}else{return _0x21ddd9[_0x29c3('0x16')](0xcc);}})[_0x29c3('0x44')](handleError(_0x21ddd9,null));};
\ No newline at end of file
index 885ee65..b0c6536 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3074=['moment','request-promise','rimraf','../../config/environment','exports','JscriptyProject','jscripty_projects','lodash','../../config/logger','api'];(function(_0x4b21e5,_0x52bae8){var _0x455840=function(_0x52474e){while(--_0x52474e){_0x4b21e5['push'](_0x4b21e5['shift']());}};_0x455840(++_0x52bae8);}(_0x3074,0x1dd));var _0x4307=function(_0x461bcc,_0x4b7e52){_0x461bcc=_0x461bcc-0x0;var _0x55f885=_0x3074[_0x461bcc];return _0x55f885;};'use strict';var _=require(_0x4307('0x0'));var util=require('util');var logger=require(_0x4307('0x1'))(_0x4307('0x2'));var moment=require(_0x4307('0x3'));var BPromise=require('bluebird');var rp=require(_0x4307('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4307('0x5'));var config=require(_0x4307('0x6'));var attributes=require('./jscriptyProject.attributes');module[_0x4307('0x7')]=function(_0x2c94ac,_0xf59e6f){return _0x2c94ac['define'](_0x4307('0x8'),attributes,{'tableName':_0x4307('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xea89=['JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./jscriptyProject.attributes','exports','define'];(function(_0x31ecfe,_0x56b468){var _0x24788e=function(_0x126c32){while(--_0x126c32){_0x31ecfe['push'](_0x31ecfe['shift']());}};_0x24788e(++_0x56b468);}(_0xea89,0x1e2));var _0x9ea8=function(_0x10f891,_0x253e70){_0x10f891=_0x10f891-0x0;var _0x198927=_0xea89[_0x10f891];return _0x198927;};'use strict';var _=require(_0x9ea8('0x0'));var util=require(_0x9ea8('0x1'));var logger=require(_0x9ea8('0x2'))(_0x9ea8('0x3'));var moment=require(_0x9ea8('0x4'));var BPromise=require('bluebird');var rp=require(_0x9ea8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ea8('0x6'));var config=require('../../config/environment');var attributes=require(_0x9ea8('0x7'));module[_0x9ea8('0x8')]=function(_0x2c6e50,_0x184f38){return _0x2c6e50[_0x9ea8('0x9')](_0x9ea8('0xa'),attributes,{'tableName':_0x9ea8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5b4a501..a21ec72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xac4a,0x13f));var _0xaac4=function(_0x48f107,_0x4da415){_0x48f107=_0x48f107-0x0;var _0x5338bf=_0xac4a[_0x48f107];return _0x5338bf;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});}
\ No newline at end of file
+var _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5a6dc5,_0x5ad87a){var _0xe3e84e=function(_0x327a70){while(--_0x327a70){_0x5a6dc5['push'](_0x5a6dc5['shift']());}};_0xe3e84e(++_0x5ad87a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}
\ No newline at end of file
index 576cc98..f73055a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8343=['../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x134827,_0x21f6ed){var _0x366671=function(_0x4dc8d4){while(--_0x4dc8d4){_0x134827['push'](_0x134827['shift']());}};_0x366671(++_0x21f6ed);}(_0x8343,0x82));var _0x3834=function(_0x27ac94,_0x56dbd6){_0x27ac94=_0x27ac94-0x0;var _0x5d892b=_0x8343[_0x27ac94];return _0x5d892b;};'use strict';var multer=require(_0x3834('0x0'));var util=require(_0x3834('0x1'));var path=require(_0x3834('0x2'));var timeout=require(_0x3834('0x3'));var express=require(_0x3834('0x4'));var router=express[_0x3834('0x5')]();var fs_extra=require(_0x3834('0x6'));var auth=require(_0x3834('0x7'));var interaction=require(_0x3834('0x8'));var config=require(_0x3834('0x9'));var controller=require(_0x3834('0xa'));router['get']('/',auth[_0x3834('0xb')](),controller[_0x3834('0xc')]);router[_0x3834('0xd')](_0x3834('0xe'),auth[_0x3834('0xb')](),controller[_0x3834('0xf')]);router[_0x3834('0xd')](_0x3834('0x10'),auth[_0x3834('0xb')](),controller[_0x3834('0x11')]);router[_0x3834('0x12')]('/',auth[_0x3834('0xb')](),controller['create']);router[_0x3834('0x13')]('/:id',auth[_0x3834('0xb')](),controller[_0x3834('0x14')]);router[_0x3834('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x3834('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x5a6d=['delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','isAuthenticated','/:id','create'];(function(_0x4d7b5f,_0x2cbc9c){var _0x4d69ad=function(_0x484324){while(--_0x484324){_0x4d7b5f['push'](_0x4d7b5f['shift']());}};_0x4d69ad(++_0x2cbc9c);}(_0x5a6d,0x163));var _0xd5a6=function(_0x31600c,_0x6fb335){_0x31600c=_0x31600c-0x0;var _0x570d91=_0x5a6d[_0x31600c];return _0x570d91;};'use strict';var multer=require(_0xd5a6('0x0'));var util=require(_0xd5a6('0x1'));var path=require(_0xd5a6('0x2'));var timeout=require('connect-timeout');var express=require(_0xd5a6('0x3'));var router=express['Router']();var fs_extra=require(_0xd5a6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd5a6('0x5'));var config=require(_0xd5a6('0x6'));var controller=require(_0xd5a6('0x7'));router[_0xd5a6('0x8')]('/',auth['isAuthenticated'](),controller[_0xd5a6('0x9')]);router['get']('/describe',auth[_0xd5a6('0xa')](),controller['describe']);router[_0xd5a6('0x8')](_0xd5a6('0xb'),auth[_0xd5a6('0xa')](),controller['show']);router['post']('/',auth[_0xd5a6('0xa')](),controller[_0xd5a6('0xc')]);router['put'](_0xd5a6('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xd5a6('0xd')]('/:id',auth[_0xd5a6('0xa')](),controller[_0xd5a6('0xe')]);module[_0xd5a6('0xf')]=router;
\ No newline at end of file
index ba856ac..d973f1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x7a54,0x106));var _0x47a5=function(_0x350d78,_0x1bc991){_0x350d78=_0x350d78-0x0;var _0x1198cf=_0x7a54[_0x350d78];return _0x1198cf;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x7a54,0x106));var _0x47a5=function(_0x249d39,_0x7ce09f){_0x249d39=_0x249d39-0x0;var _0x46077b=_0x7a54[_0x249d39];return _0x46077b;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
index 6380850..bfd7e28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60d7=['lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','options','findAll','rows','show','includeAll','include','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x13635d,_0x14d83e){var _0x3505b9=function(_0x514839){while(--_0x514839){_0x13635d['push'](_0x13635d['shift']());}};_0x3505b9(++_0x14d83e);}(_0x60d7,0x17e));var _0x760d=function(_0x5a9556,_0x1a7f11){_0x5a9556=_0x5a9556-0x0;var _0x1012c2=_0x60d7[_0x5a9556];return _0x1012c2;};'use strict';var emlformat=require(_0x760d('0x0'));var rimraf=require(_0x760d('0x1'));var zipdir=require(_0x760d('0x2'));var jsonpatch=require(_0x760d('0x3'));var rp=require(_0x760d('0x4'));var moment=require(_0x760d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x760d('0x6'));var util=require(_0x760d('0x7'));var path=require(_0x760d('0x8'));var sox=require(_0x760d('0x9'));var csv=require(_0x760d('0xa'));var ejs=require(_0x760d('0xb'));var fs=require('fs');var fs_extra=require(_0x760d('0xc'));var _=require(_0x760d('0xd'));var squel=require('squel');var crypto=require(_0x760d('0xe'));var jsforce=require(_0x760d('0xf'));var deskjs=require(_0x760d('0x10'));var toCsv=require(_0x760d('0xa'));var querystring=require(_0x760d('0x11'));var Papa=require(_0x760d('0x12'));var Redis=require(_0x760d('0x13'));var authService=require(_0x760d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x760d('0x15'));var hardwareService=require(_0x760d('0x16'));var logger=require(_0x760d('0x17'))(_0x760d('0x18'));var utils=require('../../config/utils');var config=require(_0x760d('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x760d('0x1a'))['db'];function respondWithStatusCode(_0x227faf,_0x382da4){_0x382da4=_0x382da4||0xcc;return function(_0x305556){if(_0x305556){return _0x227faf['sendStatus'](_0x382da4);}return _0x227faf[_0x760d('0x1b')](_0x382da4)['end']();};}function respondWithResult(_0x2a99b7,_0x1b744e){_0x1b744e=_0x1b744e||0xc8;return function(_0x43baef){if(_0x43baef){return _0x2a99b7[_0x760d('0x1b')](_0x1b744e)[_0x760d('0x1c')](_0x43baef);}};}function respondWithFilteredResult(_0x2a8171,_0x42be11){return function(_0x2a0ef5){if(_0x2a0ef5){var _0x4cdb45=typeof _0x42be11[_0x760d('0x1d')]===_0x760d('0x1e')&&typeof _0x42be11[_0x760d('0x1f')]===_0x760d('0x1e');var _0x45a743=_0x2a0ef5[_0x760d('0x20')];var _0x5e887e=_0x4cdb45?0x0:_0x42be11[_0x760d('0x1d')];var _0x433e99=_0x4cdb45?_0x2a0ef5['count']:_0x42be11[_0x760d('0x1d')]+_0x42be11[_0x760d('0x1f')];var _0x1dbecc;if(_0x433e99>=_0x45a743){_0x433e99=_0x45a743;_0x1dbecc=0xc8;}else{_0x1dbecc=0xce;}_0x2a8171[_0x760d('0x1b')](_0x1dbecc);return _0x2a8171[_0x760d('0x21')](_0x760d('0x22'),_0x5e887e+'-'+_0x433e99+'/'+_0x45a743)[_0x760d('0x1c')](_0x2a0ef5);}return null;};}function patchUpdates(_0x86f9d1){return function(_0x27dfac){try{jsonpatch[_0x760d('0x23')](_0x27dfac,_0x86f9d1,!![]);}catch(_0x348f0c){return BPromise[_0x760d('0x24')](_0x348f0c);}return _0x27dfac[_0x760d('0x25')]();};}function saveUpdates(_0x1c9ecb,_0x44aa42){return function(_0x4cc441){if(_0x4cc441){return _0x4cc441[_0x760d('0x26')](_0x1c9ecb)[_0x760d('0x27')](function(_0x18c47d){return _0x18c47d;});}return null;};}function removeEntity(_0x403fb7,_0x1db6af){return function(_0x26d779){if(_0x26d779){return _0x26d779[_0x760d('0x28')]()[_0x760d('0x27')](function(){_0x403fb7[_0x760d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ec66b,_0x605462){return function(_0x508418){if(!_0x508418){_0x4ec66b[_0x760d('0x29')](0x194);}return _0x508418;};}function handleError(_0x5719b8,_0x3e8859){_0x3e8859=_0x3e8859||0x1f4;return function(_0x3a8174){logger['error'](_0x3a8174[_0x760d('0x2a')]);if(_0x3a8174[_0x760d('0x2b')]){delete _0x3a8174['name'];}_0x5719b8[_0x760d('0x1b')](_0x3e8859)[_0x760d('0x2c')](_0x3a8174);};}exports[_0x760d('0x2d')]=function(_0x1236c8,_0x49045a){var _0x41d018={},_0x43b134={},_0x1c8a8a={'count':0x0,'rows':[]};var _0x456963=_[_0x760d('0x2e')](db[_0x760d('0x2f')][_0x760d('0x30')],function(_0x468430){return{'name':_0x468430[_0x760d('0x31')],'type':_0x468430[_0x760d('0x32')][_0x760d('0x33')]};});_0x43b134[_0x760d('0x34')]=_[_0x760d('0x2e')](_0x456963,_0x760d('0x2b'));_0x43b134[_0x760d('0x35')]=_[_0x760d('0x36')](_0x1236c8[_0x760d('0x35')]);_0x43b134['filters']=_[_0x760d('0x37')](_0x43b134[_0x760d('0x34')],_0x43b134[_0x760d('0x35')]);_0x41d018[_0x760d('0x38')]=_[_0x760d('0x37')](_0x43b134['model'],qs[_0x760d('0x39')](_0x1236c8[_0x760d('0x35')]['fields']));_0x41d018['attributes']=_0x41d018[_0x760d('0x38')][_0x760d('0x3a')]?_0x41d018[_0x760d('0x38')]:_0x43b134[_0x760d('0x34')];if(!_0x1236c8['query'][_0x760d('0x3b')](_0x760d('0x3c'))){_0x41d018[_0x760d('0x1f')]=qs[_0x760d('0x1f')](_0x1236c8[_0x760d('0x35')][_0x760d('0x1f')]);_0x41d018[_0x760d('0x1d')]=qs['offset'](_0x1236c8[_0x760d('0x35')][_0x760d('0x1d')]);}_0x41d018[_0x760d('0x3d')]=qs[_0x760d('0x3e')](_0x1236c8['query']['sort']);_0x41d018['where']=qs[_0x760d('0x3f')](_['pick'](_0x1236c8[_0x760d('0x35')],_0x43b134['filters']),_0x456963);if(_0x1236c8[_0x760d('0x35')][_0x760d('0x40')]){_0x41d018[_0x760d('0x41')]=_[_0x760d('0x42')](_0x41d018[_0x760d('0x41')],{'$or':_[_0x760d('0x2e')](_0x456963,function(_0x1daa51){if(_0x1daa51[_0x760d('0x32')]!=='VIRTUAL'){var _0x3d35e3={};_0x3d35e3[_0x1daa51[_0x760d('0x2b')]]={'$like':'%'+_0x1236c8[_0x760d('0x35')][_0x760d('0x40')]+'%'};return _0x3d35e3;}})});}_0x41d018=_['merge']({},_0x41d018,_0x1236c8[_0x760d('0x43')]);var _0x3913e4={'where':_0x41d018[_0x760d('0x41')]};return db[_0x760d('0x2f')]['count'](_0x3913e4)[_0x760d('0x27')](function(_0x570e46){_0x1c8a8a['count']=_0x570e46;if(_0x1236c8[_0x760d('0x35')]['includeAll']){_0x41d018['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x760d('0x44')](_0x41d018);})[_0x760d('0x27')](function(_0x2a0362){_0x1c8a8a[_0x760d('0x45')]=_0x2a0362;return _0x1c8a8a;})[_0x760d('0x27')](respondWithFilteredResult(_0x49045a,_0x41d018))['catch'](handleError(_0x49045a,null));};exports[_0x760d('0x46')]=function(_0x4f7fe1,_0x22f175){var _0x3ebd53={'raw':!![],'where':{'id':_0x4f7fe1['params']['id']}},_0x163773={};_0x163773[_0x760d('0x34')]=_[_0x760d('0x36')](db[_0x760d('0x2f')]['rawAttributes']);_0x163773[_0x760d('0x35')]=_[_0x760d('0x36')](_0x4f7fe1[_0x760d('0x35')]);_0x163773[_0x760d('0x3f')]=_[_0x760d('0x37')](_0x163773['model'],_0x163773[_0x760d('0x35')]);_0x3ebd53['attributes']=_['intersection'](_0x163773[_0x760d('0x34')],qs['fields'](_0x4f7fe1[_0x760d('0x35')][_0x760d('0x39')]));_0x3ebd53[_0x760d('0x38')]=_0x3ebd53[_0x760d('0x38')][_0x760d('0x3a')]?_0x3ebd53[_0x760d('0x38')]:_0x163773[_0x760d('0x34')];if(_0x4f7fe1['query'][_0x760d('0x47')]){_0x3ebd53[_0x760d('0x48')]=[{'all':!![]}];}_0x3ebd53=_[_0x760d('0x42')]({},_0x3ebd53,_0x4f7fe1[_0x760d('0x43')]);return db[_0x760d('0x2f')]['find'](_0x3ebd53)[_0x760d('0x27')](handleEntityNotFound(_0x22f175,null))[_0x760d('0x27')](respondWithResult(_0x22f175,null))[_0x760d('0x49')](handleError(_0x22f175,null));};exports[_0x760d('0x4a')]=function(_0x403ad2,_0xe63390){return db[_0x760d('0x2f')][_0x760d('0x4a')](_0x403ad2['body'],{})[_0x760d('0x27')](respondWithResult(_0xe63390,0xc9))['catch'](handleError(_0xe63390,null));};exports['update']=function(_0x359155,_0x2125d7){if(_0x359155[_0x760d('0x4b')]['id']){delete _0x359155[_0x760d('0x4b')]['id'];}return db['JscriptyQuestionReport'][_0x760d('0x4c')]({'where':{'id':_0x359155['params']['id']}})[_0x760d('0x27')](handleEntityNotFound(_0x2125d7,null))[_0x760d('0x27')](saveUpdates(_0x359155['body'],null))[_0x760d('0x27')](respondWithResult(_0x2125d7,null))[_0x760d('0x49')](handleError(_0x2125d7,null));};exports[_0x760d('0x28')]=function(_0x1ddf5e,_0x51503d){return db[_0x760d('0x2f')]['find']({'where':{'id':_0x1ddf5e[_0x760d('0x4d')]['id']}})[_0x760d('0x27')](handleEntityNotFound(_0x51503d,null))['then'](removeEntity(_0x51503d,null))['catch'](handleError(_0x51503d,null));};exports[_0x760d('0x4e')]=function(_0x209e25,_0x1d87f4){return db[_0x760d('0x2f')][_0x760d('0x4e')]()[_0x760d('0x27')](respondWithResult(_0x1d87f4,null))['catch'](handleError(_0x1d87f4,null));};
\ No newline at end of file
+var _0x28fd=['filters','pick','filter','merge','options','includeAll','findAll','then','rows','catch','show','params','keys','fields','include','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','update','destroy','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4c7b20,_0x361515){var _0x4872bd=function(_0x358e19){while(--_0x358e19){_0x4c7b20['push'](_0x4c7b20['shift']());}};_0x4872bd(++_0x361515);}(_0x28fd,0xf7));var _0xd28f=function(_0x3015f9,_0x6eeb0d){_0x3015f9=_0x3015f9-0x0;var _0x3390b6=_0x28fd[_0x3015f9];return _0x3390b6;};'use strict';var emlformat=require(_0xd28f('0x0'));var rimraf=require(_0xd28f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd28f('0x2'));var moment=require(_0xd28f('0x3'));var BPromise=require(_0xd28f('0x4'));var Mustache=require('mustache');var util=require(_0xd28f('0x5'));var path=require(_0xd28f('0x6'));var sox=require(_0xd28f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd28f('0x8'));var _=require('lodash');var squel=require(_0xd28f('0x9'));var crypto=require(_0xd28f('0xa'));var jsforce=require(_0xd28f('0xb'));var deskjs=require(_0xd28f('0xc'));var toCsv=require(_0xd28f('0xd'));var querystring=require(_0xd28f('0xe'));var Papa=require(_0xd28f('0xf'));var Redis=require('ioredis');var authService=require(_0xd28f('0x10'));var qs=require(_0xd28f('0x11'));var as=require(_0xd28f('0x12'));var hardwareService=require(_0xd28f('0x13'));var logger=require(_0xd28f('0x14'))(_0xd28f('0x15'));var utils=require(_0xd28f('0x16'));var config=require(_0xd28f('0x17'));var licenseUtil=require(_0xd28f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf12df2,_0x1e39c5){_0x1e39c5=_0x1e39c5||0xcc;return function(_0x273089){if(_0x273089){return _0xf12df2[_0xd28f('0x19')](_0x1e39c5);}return _0xf12df2['status'](_0x1e39c5)[_0xd28f('0x1a')]();};}function respondWithResult(_0x4b59f5,_0x158b8b){_0x158b8b=_0x158b8b||0xc8;return function(_0x4d20c1){if(_0x4d20c1){return _0x4b59f5[_0xd28f('0x1b')](_0x158b8b)[_0xd28f('0x1c')](_0x4d20c1);}};}function respondWithFilteredResult(_0x21fb3a,_0x4cd7dc){return function(_0x2421b5){if(_0x2421b5){var _0x17ebc1=typeof _0x4cd7dc[_0xd28f('0x1d')]===_0xd28f('0x1e')&&typeof _0x4cd7dc[_0xd28f('0x1f')]===_0xd28f('0x1e');var _0x27e89d=_0x2421b5[_0xd28f('0x20')];var _0x5c6517=_0x17ebc1?0x0:_0x4cd7dc[_0xd28f('0x1d')];var _0x4b1470=_0x17ebc1?_0x2421b5[_0xd28f('0x20')]:_0x4cd7dc['offset']+_0x4cd7dc[_0xd28f('0x1f')];var _0x4b15d7;if(_0x4b1470>=_0x27e89d){_0x4b1470=_0x27e89d;_0x4b15d7=0xc8;}else{_0x4b15d7=0xce;}_0x21fb3a[_0xd28f('0x1b')](_0x4b15d7);return _0x21fb3a[_0xd28f('0x21')]('Content-Range',_0x5c6517+'-'+_0x4b1470+'/'+_0x27e89d)[_0xd28f('0x1c')](_0x2421b5);}return null;};}function patchUpdates(_0x54be2a){return function(_0xcfde78){try{jsonpatch['apply'](_0xcfde78,_0x54be2a,!![]);}catch(_0x5790a5){return BPromise[_0xd28f('0x22')](_0x5790a5);}return _0xcfde78['save']();};}function saveUpdates(_0x2f870d,_0x563466){return function(_0x335eb6){if(_0x335eb6){return _0x335eb6[_0xd28f('0x23')](_0x2f870d)['then'](function(_0x272719){return _0x272719;});}return null;};}function removeEntity(_0x289969,_0x3f34f9){return function(_0x5cd971){if(_0x5cd971){return _0x5cd971[_0xd28f('0x24')]()['then'](function(){_0x289969[_0xd28f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f3211,_0x396f3f){return function(_0x35dd96){if(!_0x35dd96){_0x1f3211['sendStatus'](0x194);}return _0x35dd96;};}function handleError(_0x24b6f3,_0x585d1b){_0x585d1b=_0x585d1b||0x1f4;return function(_0x2a5e48){logger[_0xd28f('0x25')](_0x2a5e48[_0xd28f('0x26')]);if(_0x2a5e48[_0xd28f('0x27')]){delete _0x2a5e48[_0xd28f('0x27')];}_0x24b6f3['status'](_0x585d1b)['send'](_0x2a5e48);};}exports[_0xd28f('0x28')]=function(_0x19f40f,_0x47eaeb){var _0x3577c7={},_0x3eb6b5={},_0x2808e0={'count':0x0,'rows':[]};var _0x35a5d1=_[_0xd28f('0x29')](db[_0xd28f('0x2a')][_0xd28f('0x2b')],function(_0x5dcadf){return{'name':_0x5dcadf[_0xd28f('0x2c')],'type':_0x5dcadf[_0xd28f('0x2d')][_0xd28f('0x2e')]};});_0x3eb6b5[_0xd28f('0x2f')]=_['map'](_0x35a5d1,'name');_0x3eb6b5['query']=_['keys'](_0x19f40f['query']);_0x3eb6b5['filters']=_['intersection'](_0x3eb6b5['model'],_0x3eb6b5[_0xd28f('0x30')]);_0x3577c7[_0xd28f('0x31')]=_[_0xd28f('0x32')](_0x3eb6b5[_0xd28f('0x2f')],qs['fields'](_0x19f40f[_0xd28f('0x30')]['fields']));_0x3577c7[_0xd28f('0x31')]=_0x3577c7[_0xd28f('0x31')][_0xd28f('0x33')]?_0x3577c7[_0xd28f('0x31')]:_0x3eb6b5['model'];if(!_0x19f40f[_0xd28f('0x30')][_0xd28f('0x34')](_0xd28f('0x35'))){_0x3577c7[_0xd28f('0x1f')]=qs[_0xd28f('0x1f')](_0x19f40f[_0xd28f('0x30')]['limit']);_0x3577c7[_0xd28f('0x1d')]=qs[_0xd28f('0x1d')](_0x19f40f[_0xd28f('0x30')][_0xd28f('0x1d')]);}_0x3577c7[_0xd28f('0x36')]=qs[_0xd28f('0x37')](_0x19f40f[_0xd28f('0x30')][_0xd28f('0x37')]);_0x3577c7[_0xd28f('0x38')]=qs[_0xd28f('0x39')](_[_0xd28f('0x3a')](_0x19f40f[_0xd28f('0x30')],_0x3eb6b5[_0xd28f('0x39')]),_0x35a5d1);if(_0x19f40f[_0xd28f('0x30')]['filter']){_0x3577c7[_0xd28f('0x38')]=_['merge'](_0x3577c7[_0xd28f('0x38')],{'$or':_['map'](_0x35a5d1,function(_0x5a4f3d){if(_0x5a4f3d['type']!=='VIRTUAL'){var _0x4234ff={};_0x4234ff[_0x5a4f3d['name']]={'$like':'%'+_0x19f40f[_0xd28f('0x30')][_0xd28f('0x3b')]+'%'};return _0x4234ff;}})});}_0x3577c7=_[_0xd28f('0x3c')]({},_0x3577c7,_0x19f40f[_0xd28f('0x3d')]);var _0x54f32e={'where':_0x3577c7[_0xd28f('0x38')]};return db['JscriptyQuestionReport'][_0xd28f('0x20')](_0x54f32e)['then'](function(_0x447ad5){_0x2808e0[_0xd28f('0x20')]=_0x447ad5;if(_0x19f40f['query'][_0xd28f('0x3e')]){_0x3577c7['include']=[{'all':!![]}];}return db[_0xd28f('0x2a')][_0xd28f('0x3f')](_0x3577c7);})[_0xd28f('0x40')](function(_0x4a557f){_0x2808e0[_0xd28f('0x41')]=_0x4a557f;return _0x2808e0;})['then'](respondWithFilteredResult(_0x47eaeb,_0x3577c7))[_0xd28f('0x42')](handleError(_0x47eaeb,null));};exports[_0xd28f('0x43')]=function(_0x17acba,_0x70f623){var _0x3b1f5b={'raw':!![],'where':{'id':_0x17acba[_0xd28f('0x44')]['id']}},_0x4dfedd={};_0x4dfedd[_0xd28f('0x2f')]=_[_0xd28f('0x45')](db[_0xd28f('0x2a')][_0xd28f('0x2b')]);_0x4dfedd[_0xd28f('0x30')]=_[_0xd28f('0x45')](_0x17acba['query']);_0x4dfedd[_0xd28f('0x39')]=_[_0xd28f('0x32')](_0x4dfedd[_0xd28f('0x2f')],_0x4dfedd['query']);_0x3b1f5b[_0xd28f('0x31')]=_[_0xd28f('0x32')](_0x4dfedd[_0xd28f('0x2f')],qs[_0xd28f('0x46')](_0x17acba[_0xd28f('0x30')]['fields']));_0x3b1f5b[_0xd28f('0x31')]=_0x3b1f5b[_0xd28f('0x31')][_0xd28f('0x33')]?_0x3b1f5b[_0xd28f('0x31')]:_0x4dfedd[_0xd28f('0x2f')];if(_0x17acba['query'][_0xd28f('0x3e')]){_0x3b1f5b[_0xd28f('0x47')]=[{'all':!![]}];}_0x3b1f5b=_['merge']({},_0x3b1f5b,_0x17acba[_0xd28f('0x3d')]);return db[_0xd28f('0x2a')][_0xd28f('0x48')](_0x3b1f5b)[_0xd28f('0x40')](handleEntityNotFound(_0x70f623,null))[_0xd28f('0x40')](respondWithResult(_0x70f623,null))[_0xd28f('0x42')](handleError(_0x70f623,null));};exports['create']=function(_0xcee812,_0x59e747){return db[_0xd28f('0x2a')][_0xd28f('0x49')](_0xcee812[_0xd28f('0x4a')],{})[_0xd28f('0x40')](respondWithResult(_0x59e747,0xc9))[_0xd28f('0x42')](handleError(_0x59e747,null));};exports[_0xd28f('0x23')]=function(_0x4d2c7a,_0x1cc1c6){if(_0x4d2c7a[_0xd28f('0x4a')]['id']){delete _0x4d2c7a[_0xd28f('0x4a')]['id'];}return db[_0xd28f('0x2a')]['find']({'where':{'id':_0x4d2c7a[_0xd28f('0x44')]['id']}})['then'](handleEntityNotFound(_0x1cc1c6,null))['then'](saveUpdates(_0x4d2c7a[_0xd28f('0x4a')],null))['then'](respondWithResult(_0x1cc1c6,null))['catch'](handleError(_0x1cc1c6,null));};exports['destroy']=function(_0x48132a,_0x1418e6){return db[_0xd28f('0x2a')][_0xd28f('0x48')]({'where':{'id':_0x48132a[_0xd28f('0x44')]['id']}})[_0xd28f('0x40')](handleEntityNotFound(_0x1418e6,null))[_0xd28f('0x40')](removeEntity(_0x1418e6,null))[_0xd28f('0x42')](handleError(_0x1418e6,null));};exports[_0xd28f('0x4b')]=function(_0x3595ff,_0x14f767){return db['JscriptyQuestionReport'][_0xd28f('0x4b')]()[_0xd28f('0x40')](respondWithResult(_0x14f767,null))['catch'](handleError(_0x14f767,null));};
\ No newline at end of file
index 94a7c40..9a02f7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x458d=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x458d,0x104));var _0xd458=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x458d[_0x40220a];return _0x3903cc;};'use strict';var _=require('lodash');var util=require(_0xd458('0x0'));var logger=require(_0xd458('0x1'))(_0xd458('0x2'));var moment=require(_0xd458('0x3'));var BPromise=require(_0xd458('0x4'));var rp=require(_0xd458('0x5'));var fs=require('fs');var path=require(_0xd458('0x6'));var rimraf=require(_0xd458('0x7'));var config=require('../../config/environment');var attributes=require(_0xd458('0x8'));module[_0xd458('0x9')]=function(_0x26c1f7,_0x4d7eae){return _0x26c1f7[_0xd458('0xa')](_0xd458('0xb'),attributes,{'tableName':_0xd458('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0094=['request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','api','moment','bluebird'];(function(_0x391d46,_0x2fb716){var _0x19e413=function(_0x1a0a9){while(--_0x1a0a9){_0x391d46['push'](_0x391d46['shift']());}};_0x19e413(++_0x2fb716);}(_0x0094,0x1c2));var _0x4009=function(_0x54b5ed,_0x533c95){_0x54b5ed=_0x54b5ed-0x0;var _0xb9b206=_0x0094[_0x54b5ed];return _0xb9b206;};'use strict';var _=require(_0x4009('0x0'));var util=require(_0x4009('0x1'));var logger=require('../../config/logger')(_0x4009('0x2'));var moment=require(_0x4009('0x3'));var BPromise=require(_0x4009('0x4'));var rp=require(_0x4009('0x5'));var fs=require('fs');var path=require(_0x4009('0x6'));var rimraf=require(_0x4009('0x7'));var config=require(_0x4009('0x8'));var attributes=require(_0x4009('0x9'));module['exports']=function(_0xda7c3d,_0x18e74d){return _0xda7c3d[_0x4009('0xa')](_0x4009('0xb'),attributes,{'tableName':_0x4009('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 545751a..a1f16da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfed7=['info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xfed7,0x87));var _0x7fed=function(_0x4c3ffe,_0x457374){_0x4c3ffe=_0x4c3ffe-0x0;var _0x28d3eb=_0xfed7[_0x4c3ffe];return _0x28d3eb;};'use strict';var _=require(_0x7fed('0x0'));var util=require('util');var moment=require(_0x7fed('0x1'));var BPromise=require(_0x7fed('0x2'));var rs=require(_0x7fed('0x3'));var fs=require('fs');var Redis=require(_0x7fed('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7fed('0x5'));var config=require(_0x7fed('0x6'));var jayson=require(_0x7fed('0x7'));var client=jayson[_0x7fed('0x8')][_0x7fed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57a6e3,_0xa68363,_0x2a2b6a){return new BPromise(function(_0x1c057b,_0x1b9292){return client[_0x7fed('0xa')](_0x57a6e3,_0x2a2b6a)[_0x7fed('0xb')](function(_0x2c9b8c){logger[_0x7fed('0xc')](_0x7fed('0xd'),_0xa68363,_0x7fed('0xe'));logger['debug'](_0x7fed('0xf'),_0xa68363,_0x7fed('0xe'),JSON[_0x7fed('0x10')](_0x2c9b8c));if(_0x2c9b8c[_0x7fed('0x11')]){if(_0x2c9b8c[_0x7fed('0x11')][_0x7fed('0x12')]===0x1f4){logger['error'](_0x7fed('0xd'),_0xa68363,_0x2c9b8c[_0x7fed('0x11')][_0x7fed('0x13')]);return _0x1b9292(_0x2c9b8c[_0x7fed('0x11')][_0x7fed('0x13')]);}logger['error'](_0x7fed('0xd'),_0xa68363,_0x2c9b8c[_0x7fed('0x11')][_0x7fed('0x13')]);return _0x1c057b(_0x2c9b8c['error'][_0x7fed('0x13')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0xa68363,_0x7fed('0xe'));_0x1c057b(_0x2c9b8c[_0x7fed('0x14')][_0x7fed('0x13')]);}})['catch'](function(_0xaf9d9e){logger[_0x7fed('0x11')](_0x7fed('0xd'),_0xa68363,_0xaf9d9e);_0x1b9292(_0xaf9d9e);});});}
\ No newline at end of file
+var _0x9e0d=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch'];(function(_0x295b4a,_0x169076){var _0x4db036=function(_0x5ea0d3){while(--_0x5ea0d3){_0x295b4a['push'](_0x295b4a['shift']());}};_0x4db036(++_0x169076);}(_0x9e0d,0x19e));var _0xd9e0=function(_0x3be9cf,_0x16fe65){_0x3be9cf=_0x3be9cf-0x0;var _0x294f0c=_0x9e0d[_0x3be9cf];return _0x294f0c;};'use strict';var _=require(_0xd9e0('0x0'));var util=require(_0xd9e0('0x1'));var moment=require(_0xd9e0('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9e0('0x3'));var fs=require('fs');var Redis=require(_0xd9e0('0x4'));var db=require(_0xd9e0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd9e0('0x6'))(_0xd9e0('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd9e0('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x215087,_0x567dbb,_0x166bcc){return new BPromise(function(_0x66abcf,_0x2c7df0){return client[_0xd9e0('0x9')](_0x215087,_0x166bcc)['then'](function(_0x257bca){logger['info'](_0xd9e0('0xa'),_0x567dbb,_0xd9e0('0xb'));logger[_0xd9e0('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x567dbb,_0xd9e0('0xb'),JSON[_0xd9e0('0xd')](_0x257bca));if(_0x257bca[_0xd9e0('0xe')]){if(_0x257bca[_0xd9e0('0xe')][_0xd9e0('0xf')]===0x1f4){logger[_0xd9e0('0xe')](_0xd9e0('0xa'),_0x567dbb,_0x257bca[_0xd9e0('0xe')]['message']);return _0x2c7df0(_0x257bca[_0xd9e0('0xe')]['message']);}logger[_0xd9e0('0xe')](_0xd9e0('0xa'),_0x567dbb,_0x257bca[_0xd9e0('0xe')]['message']);return _0x66abcf(_0x257bca[_0xd9e0('0xe')][_0xd9e0('0x10')]);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x567dbb,_0xd9e0('0xb'));_0x66abcf(_0x257bca['result'][_0xd9e0('0x10')]);}})[_0xd9e0('0x11')](function(_0x42f841){logger[_0xd9e0('0xe')](_0xd9e0('0xa'),_0x567dbb,_0x42f841);_0x2c7df0(_0x42f841);});});}
\ No newline at end of file
index 614d1db..e6695b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a93=['getQuestions','create','put','update','/:id','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','describe','show','/:id/questions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4a93,0x1a8));var _0x34a9=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x4a93[_0x725b8e];return _0x43ac45;};'use strict';var multer=require(_0x34a9('0x0'));var util=require(_0x34a9('0x1'));var path=require('path');var timeout=require(_0x34a9('0x2'));var express=require(_0x34a9('0x3'));var router=express[_0x34a9('0x4')]();var fs_extra=require(_0x34a9('0x5'));var auth=require(_0x34a9('0x6'));var interaction=require(_0x34a9('0x7'));var config=require(_0x34a9('0x8'));var controller=require(_0x34a9('0x9'));router[_0x34a9('0xa')]('/',auth[_0x34a9('0xb')](),controller[_0x34a9('0xc')]);router[_0x34a9('0xa')]('/describe',auth[_0x34a9('0xb')](),controller[_0x34a9('0xd')]);router['get']('/:id',auth[_0x34a9('0xb')](),controller[_0x34a9('0xe')]);router['get'](_0x34a9('0xf'),auth['isAuthenticated'](),controller[_0x34a9('0x10')]);router['post']('/',auth[_0x34a9('0xb')](),controller[_0x34a9('0x11')]);router[_0x34a9('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x34a9('0x13')]);router['delete'](_0x34a9('0x14'),auth[_0x34a9('0xb')](),controller['destroy']);module[_0x34a9('0x15')]=router;
\ No newline at end of file
+var _0xfef3=['delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./jscriptySessionReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/questions','getQuestions','post','create','put','update'];(function(_0x4601ae,_0x6b3f66){var _0x244351=function(_0x2cb353){while(--_0x2cb353){_0x4601ae['push'](_0x4601ae['shift']());}};_0x244351(++_0x6b3f66);}(_0xfef3,0xbb));var _0x3fef=function(_0x132399,_0x1c4b0f){_0x132399=_0x132399-0x0;var _0x2a27e9=_0xfef3[_0x132399];return _0x2a27e9;};'use strict';var multer=require(_0x3fef('0x0'));var util=require(_0x3fef('0x1'));var path=require(_0x3fef('0x2'));var timeout=require(_0x3fef('0x3'));var express=require('express');var router=express[_0x3fef('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3fef('0x5'));var config=require('../../config/environment');var controller=require(_0x3fef('0x6'));router[_0x3fef('0x7')]('/',auth['isAuthenticated'](),controller[_0x3fef('0x8')]);router[_0x3fef('0x7')](_0x3fef('0x9'),auth[_0x3fef('0xa')](),controller[_0x3fef('0xb')]);router[_0x3fef('0x7')](_0x3fef('0xc'),auth[_0x3fef('0xa')](),controller[_0x3fef('0xd')]);router[_0x3fef('0x7')](_0x3fef('0xe'),auth[_0x3fef('0xa')](),controller[_0x3fef('0xf')]);router[_0x3fef('0x10')]('/',auth[_0x3fef('0xa')](),controller[_0x3fef('0x11')]);router[_0x3fef('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x3fef('0x13')]);router[_0x3fef('0x14')]('/:id',auth[_0x3fef('0xa')](),controller[_0x3fef('0x15')]);module[_0x3fef('0x16')]=router;
\ No newline at end of file
index 818b8bf..01f57d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b8f=['starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE','setDataValue'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x9b8f,0x69));var _0xf9b8=function(_0x42462f,_0xbb3a9a){_0x42462f=_0x42462f-0x0;var _0x30aec5=_0x9b8f[_0x42462f];return _0x30aec5;};'use strict';var moment=require(_0xf9b8('0x0'));var Sequelize=require(_0xf9b8('0x1'));module[_0xf9b8('0x2')]={'starttime':{'type':Sequelize[_0xf9b8('0x3')],'set':function(_0x448387){this[_0xf9b8('0x4')](_0xf9b8('0x5'),_0x448387);this[_0xf9b8('0x4')](_0xf9b8('0x6'),moment()[_0xf9b8('0x7')](_0xf9b8('0x8')));}},'endtime':{'type':Sequelize[_0xf9b8('0x3')]},'membername':{'type':Sequelize[_0xf9b8('0x9')]},'projectname':{'type':Sequelize[_0xf9b8('0x9')]},'queue':{'type':Sequelize[_0xf9b8('0x9')]},'uniqueid':{'type':Sequelize[_0xf9b8('0x9')]},'calleridname':{'type':Sequelize[_0xf9b8('0x9')]},'calleridnum':{'type':Sequelize[_0xf9b8('0x9')]},'completed':{'type':Sequelize[_0xf9b8('0xa')],'defaultValue':![]}};
\ No newline at end of file
+var _0x9514=['setDataValue','starttime','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','exports','DATE'];(function(_0xe5dbba,_0x5637db){var _0x25d2e6=function(_0x80d002){while(--_0x80d002){_0xe5dbba['push'](_0xe5dbba['shift']());}};_0x25d2e6(++_0x5637db);}(_0x9514,0x1da));var _0x4951=function(_0x163592,_0x516195){_0x163592=_0x163592-0x0;var _0x32a7db=_0x9514[_0x163592];return _0x32a7db;};'use strict';var moment=require(_0x4951('0x0'));var Sequelize=require('sequelize');module[_0x4951('0x1')]={'starttime':{'type':Sequelize[_0x4951('0x2')],'set':function(_0x2b142f){this[_0x4951('0x3')](_0x4951('0x4'),_0x2b142f);this[_0x4951('0x3')](_0x4951('0x5'),moment()['format'](_0x4951('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x4951('0x7')]},'projectname':{'type':Sequelize[_0x4951('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4951('0x7')]},'calleridname':{'type':Sequelize[_0x4951('0x7')]},'calleridnum':{'type':Sequelize[_0x4951('0x7')]},'completed':{'type':Sequelize[_0x4951('0x8')],'defaultValue':![]}};
\ No newline at end of file
index b931074..f379093 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29fd=['then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','JscriptySessionReport','rows','catch','show','keys','includeAll','options','find','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','findAll','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','update'];(function(_0x17fb63,_0x11f0bb){var _0x4e50b5=function(_0x4437cd){while(--_0x4437cd){_0x17fb63['push'](_0x17fb63['shift']());}};_0x4e50b5(++_0x11f0bb);}(_0x29fd,0x11e));var _0xd29f=function(_0x106c6d,_0x37255d){_0x106c6d=_0x106c6d-0x0;var _0xdc8a5d=_0x29fd[_0x106c6d];return _0xdc8a5d;};'use strict';var emlformat=require(_0xd29f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd29f('0x1'));var rp=require(_0xd29f('0x2'));var moment=require(_0xd29f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd29f('0x4'));var util=require(_0xd29f('0x5'));var path=require(_0xd29f('0x6'));var sox=require(_0xd29f('0x7'));var csv=require(_0xd29f('0x8'));var ejs=require(_0xd29f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd29f('0xa'));var crypto=require(_0xd29f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd29f('0xc'));var toCsv=require(_0xd29f('0x8'));var querystring=require(_0xd29f('0xd'));var Papa=require(_0xd29f('0xe'));var Redis=require('ioredis');var authService=require(_0xd29f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd29f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd29f('0x11'))(_0xd29f('0x12'));var utils=require(_0xd29f('0x13'));var config=require(_0xd29f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xd29f('0x15'))['db'];function respondWithStatusCode(_0x2d6ff7,_0x4ff6aa){_0x4ff6aa=_0x4ff6aa||0xcc;return function(_0x4c48b8){if(_0x4c48b8){return _0x2d6ff7[_0xd29f('0x16')](_0x4ff6aa);}return _0x2d6ff7['status'](_0x4ff6aa)[_0xd29f('0x17')]();};}function respondWithResult(_0x2f6744,_0x50aa36){_0x50aa36=_0x50aa36||0xc8;return function(_0x1a23bc){if(_0x1a23bc){return _0x2f6744['status'](_0x50aa36)[_0xd29f('0x18')](_0x1a23bc);}};}function respondWithFilteredResult(_0x5375aa,_0x4e4ff3){return function(_0x30001f){if(_0x30001f){var _0x46604b=typeof _0x4e4ff3[_0xd29f('0x19')]===_0xd29f('0x1a')&&typeof _0x4e4ff3[_0xd29f('0x1b')]==='undefined';var _0x29122b=_0x30001f[_0xd29f('0x1c')];var _0x18bff1=_0x46604b?0x0:_0x4e4ff3[_0xd29f('0x19')];var _0x775803=_0x46604b?_0x30001f['count']:_0x4e4ff3[_0xd29f('0x19')]+_0x4e4ff3[_0xd29f('0x1b')];var _0x586065;if(_0x775803>=_0x29122b){_0x775803=_0x29122b;_0x586065=0xc8;}else{_0x586065=0xce;}_0x5375aa[_0xd29f('0x1d')](_0x586065);return _0x5375aa[_0xd29f('0x1e')](_0xd29f('0x1f'),_0x18bff1+'-'+_0x775803+'/'+_0x29122b)['json'](_0x30001f);}return null;};}function patchUpdates(_0x197c54){return function(_0x21610e){try{jsonpatch['apply'](_0x21610e,_0x197c54,!![]);}catch(_0x39a6c0){return BPromise[_0xd29f('0x20')](_0x39a6c0);}return _0x21610e['save']();};}function saveUpdates(_0x30f25e,_0x226d60){return function(_0x427342){if(_0x427342){return _0x427342[_0xd29f('0x21')](_0x30f25e)[_0xd29f('0x22')](function(_0x31d52f){return _0x31d52f;});}return null;};}function removeEntity(_0x5d64f3,_0x539f3d){return function(_0x507b7d){if(_0x507b7d){return _0x507b7d[_0xd29f('0x23')]()['then'](function(){_0x5d64f3[_0xd29f('0x1d')](0xcc)[_0xd29f('0x17')]();});}};}function handleEntityNotFound(_0x203086,_0x2c9ed3){return function(_0x18b563){if(!_0x18b563){_0x203086[_0xd29f('0x16')](0x194);}return _0x18b563;};}function handleError(_0x5d8433,_0x2275bc){_0x2275bc=_0x2275bc||0x1f4;return function(_0x17b378){logger[_0xd29f('0x24')](_0x17b378[_0xd29f('0x25')]);if(_0x17b378[_0xd29f('0x26')]){delete _0x17b378[_0xd29f('0x26')];}_0x5d8433[_0xd29f('0x1d')](_0x2275bc)[_0xd29f('0x27')](_0x17b378);};}exports[_0xd29f('0x28')]=function(_0x60c1c,_0x336e4c){var _0x202cab={},_0x145880={},_0x1d48f1={'count':0x0,'rows':[]};var _0x2dcf97=_[_0xd29f('0x29')](db['JscriptySessionReport'][_0xd29f('0x2a')],function(_0x4fdbbd){return{'name':_0x4fdbbd[_0xd29f('0x2b')],'type':_0x4fdbbd[_0xd29f('0x2c')][_0xd29f('0x2d')]};});_0x145880[_0xd29f('0x2e')]=_[_0xd29f('0x29')](_0x2dcf97,_0xd29f('0x26'));_0x145880['query']=_['keys'](_0x60c1c[_0xd29f('0x2f')]);_0x145880[_0xd29f('0x30')]=_['intersection'](_0x145880['model'],_0x145880[_0xd29f('0x2f')]);_0x202cab[_0xd29f('0x31')]=_[_0xd29f('0x32')](_0x145880['model'],qs[_0xd29f('0x33')](_0x60c1c['query'][_0xd29f('0x33')]));_0x202cab[_0xd29f('0x31')]=_0x202cab[_0xd29f('0x31')][_0xd29f('0x34')]?_0x202cab['attributes']:_0x145880[_0xd29f('0x2e')];if(!_0x60c1c[_0xd29f('0x2f')][_0xd29f('0x35')](_0xd29f('0x36'))){_0x202cab['limit']=qs['limit'](_0x60c1c['query']['limit']);_0x202cab['offset']=qs[_0xd29f('0x19')](_0x60c1c[_0xd29f('0x2f')][_0xd29f('0x19')]);}_0x202cab[_0xd29f('0x37')]=qs[_0xd29f('0x38')](_0x60c1c[_0xd29f('0x2f')]['sort']);_0x202cab[_0xd29f('0x39')]=qs[_0xd29f('0x30')](_[_0xd29f('0x3a')](_0x60c1c[_0xd29f('0x2f')],_0x145880[_0xd29f('0x30')]),_0x2dcf97);if(_0x60c1c[_0xd29f('0x2f')][_0xd29f('0x3b')]){_0x202cab[_0xd29f('0x39')]=_[_0xd29f('0x3c')](_0x202cab[_0xd29f('0x39')],{'$or':_[_0xd29f('0x29')](_0x2dcf97,function(_0x55cb42){if(_0x55cb42[_0xd29f('0x2c')]!==_0xd29f('0x3d')){var _0x49ccf6={};_0x49ccf6[_0x55cb42['name']]={'$like':'%'+_0x60c1c['query'][_0xd29f('0x3b')]+'%'};return _0x49ccf6;}})});}_0x202cab=_[_0xd29f('0x3c')]({},_0x202cab,_0x60c1c['options']);var _0x403722={'where':_0x202cab[_0xd29f('0x39')]};return db['JscriptySessionReport'][_0xd29f('0x1c')](_0x403722)[_0xd29f('0x22')](function(_0x5b3106){_0x1d48f1[_0xd29f('0x1c')]=_0x5b3106;if(_0x60c1c[_0xd29f('0x2f')]['includeAll']){_0x202cab[_0xd29f('0x3e')]=[{'all':!![]}];}return db[_0xd29f('0x3f')]['findAll'](_0x202cab);})[_0xd29f('0x22')](function(_0x4c42fd){_0x1d48f1[_0xd29f('0x40')]=_0x4c42fd;return _0x1d48f1;})[_0xd29f('0x22')](respondWithFilteredResult(_0x336e4c,_0x202cab))[_0xd29f('0x41')](handleError(_0x336e4c,null));};exports[_0xd29f('0x42')]=function(_0x4adb68,_0x449bb3){var _0x48a90a={'raw':!![],'where':{'id':_0x4adb68['params']['id']}},_0x17d106={};_0x17d106[_0xd29f('0x2e')]=_[_0xd29f('0x43')](db['JscriptySessionReport'][_0xd29f('0x2a')]);_0x17d106[_0xd29f('0x2f')]=_['keys'](_0x4adb68['query']);_0x17d106['filters']=_[_0xd29f('0x32')](_0x17d106[_0xd29f('0x2e')],_0x17d106[_0xd29f('0x2f')]);_0x48a90a[_0xd29f('0x31')]=_['intersection'](_0x17d106[_0xd29f('0x2e')],qs[_0xd29f('0x33')](_0x4adb68[_0xd29f('0x2f')][_0xd29f('0x33')]));_0x48a90a[_0xd29f('0x31')]=_0x48a90a[_0xd29f('0x31')][_0xd29f('0x34')]?_0x48a90a['attributes']:_0x17d106['model'];if(_0x4adb68[_0xd29f('0x2f')][_0xd29f('0x44')]){_0x48a90a[_0xd29f('0x3e')]=[{'all':!![]}];}_0x48a90a=_[_0xd29f('0x3c')]({},_0x48a90a,_0x4adb68[_0xd29f('0x45')]);return db[_0xd29f('0x3f')][_0xd29f('0x46')](_0x48a90a)[_0xd29f('0x22')](handleEntityNotFound(_0x449bb3,null))['then'](respondWithResult(_0x449bb3,null))['catch'](handleError(_0x449bb3,null));};exports['create']=function(_0x4227f7,_0x4a634b){return db[_0xd29f('0x3f')][_0xd29f('0x47')](_0x4227f7[_0xd29f('0x48')],{})['then'](respondWithResult(_0x4a634b,0xc9))[_0xd29f('0x41')](handleError(_0x4a634b,null));};exports['update']=function(_0x3c165b,_0x139056){if(_0x3c165b[_0xd29f('0x48')]['id']){delete _0x3c165b[_0xd29f('0x48')]['id'];}return db['JscriptySessionReport'][_0xd29f('0x46')]({'where':{'id':_0x3c165b[_0xd29f('0x49')]['id']}})[_0xd29f('0x22')](handleEntityNotFound(_0x139056,null))[_0xd29f('0x22')](saveUpdates(_0x3c165b[_0xd29f('0x48')],null))[_0xd29f('0x22')](respondWithResult(_0x139056,null))[_0xd29f('0x41')](handleError(_0x139056,null));};exports[_0xd29f('0x23')]=function(_0x2e029f,_0x15e8ce){return db[_0xd29f('0x3f')][_0xd29f('0x46')]({'where':{'id':_0x2e029f[_0xd29f('0x49')]['id']}})[_0xd29f('0x22')](handleEntityNotFound(_0x15e8ce,null))[_0xd29f('0x22')](removeEntity(_0x15e8ce,null))[_0xd29f('0x41')](handleError(_0x15e8ce,null));};exports[_0xd29f('0x4a')]=function(_0x5abb9b,_0x57ed94){return db[_0xd29f('0x3f')][_0xd29f('0x4a')]()[_0xd29f('0x22')](respondWithResult(_0x57ed94,null))[_0xd29f('0x41')](handleError(_0x57ed94,null));};exports[_0xd29f('0x4b')]=function(_0x41c37a,_0x405be9,_0x3b3b6f){var _0x2c3b6d={'raw':!![],'where':{}};var _0x324dd3={};var _0x33a972={'count':0x0,'rows':[]};return db[_0xd29f('0x3f')][_0xd29f('0x4c')]({'where':{'id':_0x41c37a[_0xd29f('0x49')]['id']}})['then'](handleEntityNotFound(_0x405be9,null))[_0xd29f('0x22')](function(_0x527818){if(_0x527818){_0x324dd3[_0xd29f('0x2e')]=_[_0xd29f('0x43')](db[_0xd29f('0x4d')][_0xd29f('0x2a')]);_0x324dd3[_0xd29f('0x2f')]=_[_0xd29f('0x43')](_0x41c37a['query']);_0x324dd3[_0xd29f('0x30')]=_[_0xd29f('0x32')](_0x324dd3[_0xd29f('0x2e')],_0x324dd3[_0xd29f('0x2f')]);_0x2c3b6d['attributes']=_[_0xd29f('0x32')](_0x324dd3[_0xd29f('0x2e')],qs['fields'](_0x41c37a[_0xd29f('0x2f')][_0xd29f('0x33')]));_0x2c3b6d[_0xd29f('0x31')]=_0x2c3b6d['attributes'][_0xd29f('0x34')]?_0x2c3b6d['attributes']:_0x324dd3[_0xd29f('0x2e')];if(!_0x41c37a[_0xd29f('0x2f')][_0xd29f('0x35')](_0xd29f('0x36'))){_0x2c3b6d['limit']=qs['limit'](_0x41c37a[_0xd29f('0x2f')]['limit']);_0x2c3b6d[_0xd29f('0x19')]=qs[_0xd29f('0x19')](_0x41c37a[_0xd29f('0x2f')][_0xd29f('0x19')]);}_0x2c3b6d[_0xd29f('0x37')]=qs['sort'](_0x41c37a[_0xd29f('0x2f')][_0xd29f('0x38')]);_0x2c3b6d[_0xd29f('0x39')]=qs[_0xd29f('0x30')](_[_0xd29f('0x3a')](_0x41c37a['query'],_0x324dd3[_0xd29f('0x30')]));_0x2c3b6d['where'][_0xd29f('0x4e')]=_0x527818['id'];if(_0x41c37a[_0xd29f('0x2f')][_0xd29f('0x3b')]){_0x2c3b6d[_0xd29f('0x39')]=_[_0xd29f('0x3c')](_0x2c3b6d['where'],{'$or':_[_0xd29f('0x29')](_0x2c3b6d['attributes'],function(_0x374ea0){var _0x1187da={};_0x1187da[_0x374ea0]={'$like':'%'+_0x41c37a[_0xd29f('0x2f')][_0xd29f('0x3b')]+'%'};return _0x1187da;})});}_0x2c3b6d=_['merge']({},_0x2c3b6d,_0x41c37a[_0xd29f('0x45')]);return db[_0xd29f('0x4d')][_0xd29f('0x1c')]({'where':_0x2c3b6d[_0xd29f('0x39')]})[_0xd29f('0x22')](function(_0x329010){_0x33a972[_0xd29f('0x1c')]=_0x329010;if(_0x41c37a[_0xd29f('0x2f')][_0xd29f('0x44')]){_0x2c3b6d[_0xd29f('0x3e')]=[{'all':!![]}];}return db[_0xd29f('0x4d')][_0xd29f('0x4f')](_0x2c3b6d);})[_0xd29f('0x22')](function(_0x2574fe){_0x33a972[_0xd29f('0x40')]=_0x2574fe;return _0x33a972;});}})[_0xd29f('0x22')](respondWithFilteredResult(_0x405be9,_0x2c3b6d))['catch'](handleError(_0x405be9,null));};
\ No newline at end of file
+var _0x3b50=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','JscriptySessionReport','fieldName','type','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','include','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x3b50,0x88));var _0x03b5=function(_0x25662e,_0x4cec68){_0x25662e=_0x25662e-0x0;var _0x59b7bc=_0x3b50[_0x25662e];return _0x59b7bc;};'use strict';var emlformat=require(_0x03b5('0x0'));var rimraf=require(_0x03b5('0x1'));var zipdir=require(_0x03b5('0x2'));var jsonpatch=require(_0x03b5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x03b5('0x4'));var Mustache=require(_0x03b5('0x5'));var util=require(_0x03b5('0x6'));var path=require(_0x03b5('0x7'));var sox=require(_0x03b5('0x8'));var csv=require(_0x03b5('0x9'));var ejs=require(_0x03b5('0xa'));var fs=require('fs');var fs_extra=require(_0x03b5('0xb'));var _=require(_0x03b5('0xc'));var squel=require(_0x03b5('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x03b5('0xe'));var toCsv=require(_0x03b5('0x9'));var querystring=require('querystring');var Papa=require(_0x03b5('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x03b5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x03b5('0x11'))(_0x03b5('0x12'));var utils=require(_0x03b5('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x03b5('0x14'));var db=require(_0x03b5('0x15'))['db'];function respondWithStatusCode(_0x5c3231,_0x28e73a){_0x28e73a=_0x28e73a||0xcc;return function(_0x410226){if(_0x410226){return _0x5c3231[_0x03b5('0x16')](_0x28e73a);}return _0x5c3231[_0x03b5('0x17')](_0x28e73a)[_0x03b5('0x18')]();};}function respondWithResult(_0x4cef6f,_0x670599){_0x670599=_0x670599||0xc8;return function(_0x47cce9){if(_0x47cce9){return _0x4cef6f['status'](_0x670599)[_0x03b5('0x19')](_0x47cce9);}};}function respondWithFilteredResult(_0x3ff16a,_0x20c314){return function(_0x5a8aa3){if(_0x5a8aa3){var _0x3ea559=typeof _0x20c314[_0x03b5('0x1a')]===_0x03b5('0x1b')&&typeof _0x20c314[_0x03b5('0x1c')]===_0x03b5('0x1b');var _0x4ace41=_0x5a8aa3[_0x03b5('0x1d')];var _0x13ee7e=_0x3ea559?0x0:_0x20c314[_0x03b5('0x1a')];var _0x14581d=_0x3ea559?_0x5a8aa3[_0x03b5('0x1d')]:_0x20c314[_0x03b5('0x1a')]+_0x20c314[_0x03b5('0x1c')];var _0x2e5a9e;if(_0x14581d>=_0x4ace41){_0x14581d=_0x4ace41;_0x2e5a9e=0xc8;}else{_0x2e5a9e=0xce;}_0x3ff16a[_0x03b5('0x17')](_0x2e5a9e);return _0x3ff16a[_0x03b5('0x1e')](_0x03b5('0x1f'),_0x13ee7e+'-'+_0x14581d+'/'+_0x4ace41)[_0x03b5('0x19')](_0x5a8aa3);}return null;};}function patchUpdates(_0x5de9d6){return function(_0x48b216){try{jsonpatch[_0x03b5('0x20')](_0x48b216,_0x5de9d6,!![]);}catch(_0x32ff5e){return BPromise[_0x03b5('0x21')](_0x32ff5e);}return _0x48b216[_0x03b5('0x22')]();};}function saveUpdates(_0x5c1961,_0x3877a4){return function(_0x778bd3){if(_0x778bd3){return _0x778bd3[_0x03b5('0x23')](_0x5c1961)[_0x03b5('0x24')](function(_0x24c370){return _0x24c370;});}return null;};}function removeEntity(_0x4399a0,_0x43779d){return function(_0x33ccb1){if(_0x33ccb1){return _0x33ccb1[_0x03b5('0x25')]()['then'](function(){_0x4399a0[_0x03b5('0x17')](0xcc)[_0x03b5('0x18')]();});}};}function handleEntityNotFound(_0x351743,_0x55a41e){return function(_0x262700){if(!_0x262700){_0x351743[_0x03b5('0x16')](0x194);}return _0x262700;};}function handleError(_0x210ad2,_0x50cf78){_0x50cf78=_0x50cf78||0x1f4;return function(_0x57acbc){logger[_0x03b5('0x26')](_0x57acbc[_0x03b5('0x27')]);if(_0x57acbc[_0x03b5('0x28')]){delete _0x57acbc[_0x03b5('0x28')];}_0x210ad2[_0x03b5('0x17')](_0x50cf78)[_0x03b5('0x29')](_0x57acbc);};}exports[_0x03b5('0x2a')]=function(_0x453f4a,_0x4bad67){var _0x523388={},_0x38b35b={},_0x134f2a={'count':0x0,'rows':[]};var _0x187a1b=_['map'](db[_0x03b5('0x2b')]['rawAttributes'],function(_0x2ff7ca){return{'name':_0x2ff7ca[_0x03b5('0x2c')],'type':_0x2ff7ca[_0x03b5('0x2d')]['key']};});_0x38b35b[_0x03b5('0x2e')]=_[_0x03b5('0x2f')](_0x187a1b,_0x03b5('0x28'));_0x38b35b[_0x03b5('0x30')]=_['keys'](_0x453f4a[_0x03b5('0x30')]);_0x38b35b['filters']=_[_0x03b5('0x31')](_0x38b35b[_0x03b5('0x2e')],_0x38b35b[_0x03b5('0x30')]);_0x523388[_0x03b5('0x32')]=_[_0x03b5('0x31')](_0x38b35b[_0x03b5('0x2e')],qs[_0x03b5('0x33')](_0x453f4a[_0x03b5('0x30')][_0x03b5('0x33')]));_0x523388[_0x03b5('0x32')]=_0x523388[_0x03b5('0x32')][_0x03b5('0x34')]?_0x523388[_0x03b5('0x32')]:_0x38b35b[_0x03b5('0x2e')];if(!_0x453f4a[_0x03b5('0x30')][_0x03b5('0x35')](_0x03b5('0x36'))){_0x523388[_0x03b5('0x1c')]=qs['limit'](_0x453f4a[_0x03b5('0x30')][_0x03b5('0x1c')]);_0x523388[_0x03b5('0x1a')]=qs[_0x03b5('0x1a')](_0x453f4a[_0x03b5('0x30')][_0x03b5('0x1a')]);}_0x523388[_0x03b5('0x37')]=qs['sort'](_0x453f4a[_0x03b5('0x30')][_0x03b5('0x38')]);_0x523388[_0x03b5('0x39')]=qs[_0x03b5('0x3a')](_[_0x03b5('0x3b')](_0x453f4a[_0x03b5('0x30')],_0x38b35b['filters']),_0x187a1b);if(_0x453f4a[_0x03b5('0x30')][_0x03b5('0x3c')]){_0x523388[_0x03b5('0x39')]=_[_0x03b5('0x3d')](_0x523388['where'],{'$or':_['map'](_0x187a1b,function(_0x10e0e7){if(_0x10e0e7['type']!==_0x03b5('0x3e')){var _0x49b8de={};_0x49b8de[_0x10e0e7[_0x03b5('0x28')]]={'$like':'%'+_0x453f4a[_0x03b5('0x30')][_0x03b5('0x3c')]+'%'};return _0x49b8de;}})});}_0x523388=_[_0x03b5('0x3d')]({},_0x523388,_0x453f4a[_0x03b5('0x3f')]);var _0x1b5316={'where':_0x523388[_0x03b5('0x39')]};return db[_0x03b5('0x2b')]['count'](_0x1b5316)[_0x03b5('0x24')](function(_0x5cf7ef){_0x134f2a[_0x03b5('0x1d')]=_0x5cf7ef;if(_0x453f4a[_0x03b5('0x30')][_0x03b5('0x40')]){_0x523388['include']=[{'all':!![]}];}return db[_0x03b5('0x2b')][_0x03b5('0x41')](_0x523388);})['then'](function(_0x46926a){_0x134f2a[_0x03b5('0x42')]=_0x46926a;return _0x134f2a;})[_0x03b5('0x24')](respondWithFilteredResult(_0x4bad67,_0x523388))[_0x03b5('0x43')](handleError(_0x4bad67,null));};exports[_0x03b5('0x44')]=function(_0x2bffdf,_0x2c0b7e){var _0x568fbd={'raw':!![],'where':{'id':_0x2bffdf[_0x03b5('0x45')]['id']}},_0x1b7cfd={};_0x1b7cfd['model']=_[_0x03b5('0x46')](db[_0x03b5('0x2b')][_0x03b5('0x47')]);_0x1b7cfd[_0x03b5('0x30')]=_[_0x03b5('0x46')](_0x2bffdf['query']);_0x1b7cfd[_0x03b5('0x3a')]=_['intersection'](_0x1b7cfd[_0x03b5('0x2e')],_0x1b7cfd[_0x03b5('0x30')]);_0x568fbd[_0x03b5('0x32')]=_['intersection'](_0x1b7cfd[_0x03b5('0x2e')],qs[_0x03b5('0x33')](_0x2bffdf[_0x03b5('0x30')]['fields']));_0x568fbd['attributes']=_0x568fbd[_0x03b5('0x32')][_0x03b5('0x34')]?_0x568fbd[_0x03b5('0x32')]:_0x1b7cfd[_0x03b5('0x2e')];if(_0x2bffdf[_0x03b5('0x30')][_0x03b5('0x40')]){_0x568fbd['include']=[{'all':!![]}];}_0x568fbd=_[_0x03b5('0x3d')]({},_0x568fbd,_0x2bffdf[_0x03b5('0x3f')]);return db[_0x03b5('0x2b')][_0x03b5('0x48')](_0x568fbd)['then'](handleEntityNotFound(_0x2c0b7e,null))[_0x03b5('0x24')](respondWithResult(_0x2c0b7e,null))['catch'](handleError(_0x2c0b7e,null));};exports[_0x03b5('0x49')]=function(_0x3c5118,_0x23e549){return db[_0x03b5('0x2b')][_0x03b5('0x49')](_0x3c5118[_0x03b5('0x4a')],{})[_0x03b5('0x24')](respondWithResult(_0x23e549,0xc9))[_0x03b5('0x43')](handleError(_0x23e549,null));};exports[_0x03b5('0x23')]=function(_0x5693b3,_0x3524bf){if(_0x5693b3[_0x03b5('0x4a')]['id']){delete _0x5693b3[_0x03b5('0x4a')]['id'];}return db[_0x03b5('0x2b')]['find']({'where':{'id':_0x5693b3[_0x03b5('0x45')]['id']}})['then'](handleEntityNotFound(_0x3524bf,null))[_0x03b5('0x24')](saveUpdates(_0x5693b3[_0x03b5('0x4a')],null))['then'](respondWithResult(_0x3524bf,null))[_0x03b5('0x43')](handleError(_0x3524bf,null));};exports[_0x03b5('0x25')]=function(_0x47a978,_0x1a4c7d){return db[_0x03b5('0x2b')][_0x03b5('0x48')]({'where':{'id':_0x47a978[_0x03b5('0x45')]['id']}})[_0x03b5('0x24')](handleEntityNotFound(_0x1a4c7d,null))[_0x03b5('0x24')](removeEntity(_0x1a4c7d,null))[_0x03b5('0x43')](handleError(_0x1a4c7d,null));};exports[_0x03b5('0x4b')]=function(_0x22fd24,_0xf0b36){return db['JscriptySessionReport'][_0x03b5('0x4b')]()[_0x03b5('0x24')](respondWithResult(_0xf0b36,null))[_0x03b5('0x43')](handleError(_0xf0b36,null));};exports[_0x03b5('0x4c')]=function(_0x513e9d,_0x24c2a9,_0x7b6962){var _0x14a2ac={'raw':!![],'where':{}};var _0x578312={};var _0x39b55e={'count':0x0,'rows':[]};return db[_0x03b5('0x2b')][_0x03b5('0x4d')]({'where':{'id':_0x513e9d['params']['id']}})['then'](handleEntityNotFound(_0x24c2a9,null))[_0x03b5('0x24')](function(_0x3658a7){if(_0x3658a7){_0x578312[_0x03b5('0x2e')]=_[_0x03b5('0x46')](db[_0x03b5('0x4e')][_0x03b5('0x47')]);_0x578312[_0x03b5('0x30')]=_['keys'](_0x513e9d[_0x03b5('0x30')]);_0x578312['filters']=_[_0x03b5('0x31')](_0x578312[_0x03b5('0x2e')],_0x578312[_0x03b5('0x30')]);_0x14a2ac[_0x03b5('0x32')]=_['intersection'](_0x578312[_0x03b5('0x2e')],qs[_0x03b5('0x33')](_0x513e9d[_0x03b5('0x30')][_0x03b5('0x33')]));_0x14a2ac[_0x03b5('0x32')]=_0x14a2ac['attributes'][_0x03b5('0x34')]?_0x14a2ac[_0x03b5('0x32')]:_0x578312[_0x03b5('0x2e')];if(!_0x513e9d[_0x03b5('0x30')]['hasOwnProperty'](_0x03b5('0x36'))){_0x14a2ac['limit']=qs[_0x03b5('0x1c')](_0x513e9d[_0x03b5('0x30')][_0x03b5('0x1c')]);_0x14a2ac['offset']=qs[_0x03b5('0x1a')](_0x513e9d[_0x03b5('0x30')][_0x03b5('0x1a')]);}_0x14a2ac[_0x03b5('0x37')]=qs['sort'](_0x513e9d[_0x03b5('0x30')]['sort']);_0x14a2ac[_0x03b5('0x39')]=qs['filters'](_[_0x03b5('0x3b')](_0x513e9d[_0x03b5('0x30')],_0x578312[_0x03b5('0x3a')]));_0x14a2ac['where'][_0x03b5('0x4f')]=_0x3658a7['id'];if(_0x513e9d['query'][_0x03b5('0x3c')]){_0x14a2ac['where']=_[_0x03b5('0x3d')](_0x14a2ac[_0x03b5('0x39')],{'$or':_['map'](_0x14a2ac[_0x03b5('0x32')],function(_0x2456fe){var _0x4bec0b={};_0x4bec0b[_0x2456fe]={'$like':'%'+_0x513e9d[_0x03b5('0x30')][_0x03b5('0x3c')]+'%'};return _0x4bec0b;})});}_0x14a2ac=_[_0x03b5('0x3d')]({},_0x14a2ac,_0x513e9d[_0x03b5('0x3f')]);return db[_0x03b5('0x4e')][_0x03b5('0x1d')]({'where':_0x14a2ac['where']})[_0x03b5('0x24')](function(_0x341089){_0x39b55e[_0x03b5('0x1d')]=_0x341089;if(_0x513e9d[_0x03b5('0x30')][_0x03b5('0x40')]){_0x14a2ac[_0x03b5('0x50')]=[{'all':!![]}];}return db[_0x03b5('0x4e')][_0x03b5('0x41')](_0x14a2ac);})[_0x03b5('0x24')](function(_0x4e7016){_0x39b55e['rows']=_0x4e7016;return _0x39b55e;});}})[_0x03b5('0x24')](respondWithFilteredResult(_0x24c2a9,_0x14a2ac))[_0x03b5('0x43')](handleError(_0x24c2a9,null));};
\ No newline at end of file
index 08a3cce..2c3faec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ee1=['report_jscripty_sessions','lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define'];(function(_0x250bf8,_0xf486a9){var _0x347aae=function(_0x4f5b63){while(--_0x4f5b63){_0x250bf8['push'](_0x250bf8['shift']());}};_0x347aae(++_0xf486a9);}(_0x7ee1,0x8d));var _0x17ee=function(_0x1730fb,_0x3ed65b){_0x1730fb=_0x1730fb-0x0;var _0x12482c=_0x7ee1[_0x1730fb];return _0x12482c;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x17ee('0x1'));var BPromise=require(_0x17ee('0x2'));var rp=require(_0x17ee('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x17ee('0x4'));var config=require(_0x17ee('0x5'));var attributes=require(_0x17ee('0x6'));module[_0x17ee('0x7')]=function(_0x5c0617,_0x52b1db){return _0x5c0617[_0x17ee('0x8')]('JscriptySessionReport',attributes,{'tableName':_0x17ee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0f4d=['api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x0f4d,0x12c));var _0xd0f4=function(_0x3d90c4,_0x1b1d43){_0x3d90c4=_0x3d90c4-0x0;var _0x648921=_0x0f4d[_0x3d90c4];return _0x648921;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd0f4('0x0'));var moment=require('moment');var BPromise=require(_0xd0f4('0x1'));var rp=require(_0xd0f4('0x2'));var fs=require('fs');var path=require(_0xd0f4('0x3'));var rimraf=require(_0xd0f4('0x4'));var config=require(_0xd0f4('0x5'));var attributes=require(_0xd0f4('0x6'));module[_0xd0f4('0x7')]=function(_0x1d9a9d,_0x531f85){return _0x1d9a9d[_0xd0f4('0x8')](_0xd0f4('0x9'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 029e709..e6f6b31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba34=['../../config/environment','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0x149e47,_0x120e68){var _0x50cc7e=function(_0x5468cb){while(--_0x5468cb){_0x149e47['push'](_0x149e47['shift']());}};_0x50cc7e(++_0x120e68);}(_0xba34,0x119));var _0x4ba3=function(_0x44c09a,_0xba05e9){_0x44c09a=_0x44c09a-0x0;var _0x5ddf54=_0xba34[_0x44c09a];return _0x5ddf54;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});}
\ No newline at end of file
+var _0x1a37=['rpc','jayson/promise','http','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x64157d,_0x197599){var _0xcae4e3=function(_0x5713c4){while(--_0x5713c4){_0x64157d['push'](_0x64157d['shift']());}};_0xcae4e3(++_0x197599);}(_0x1a37,0xb4));var _0x71a3=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x1a37[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var moment=require(_0x71a3('0x2'));var BPromise=require(_0x71a3('0x3'));var rs=require(_0x71a3('0x4'));var fs=require('fs');var Redis=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];var utils=require(_0x71a3('0x7'));var logger=require(_0x71a3('0x8'))(_0x71a3('0x9'));var config=require('../../config/environment');var jayson=require(_0x71a3('0xa'));var client=jayson['client'][_0x71a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45050a,_0x231ea7,_0x2bb6a2){return new BPromise(function(_0x4a9ab2,_0x53b893){return client['request'](_0x45050a,_0x2bb6a2)['then'](function(_0x89da86){logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,_0x71a3('0xe'));logger[_0x71a3('0xf')](_0x71a3('0x10'),_0x231ea7,_0x71a3('0xe'),JSON[_0x71a3('0x11')](_0x89da86));if(_0x89da86['error']){if(_0x89da86['error']['code']===0x1f4){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x53b893(_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);}logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x4a9ab2(_0x89da86[_0x71a3('0x12')]['message']);}else{logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,'request\x20sent');_0x4a9ab2(_0x89da86['result'][_0x71a3('0x13')]);}})[_0x71a3('0x14')](function(_0xee797f){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0xee797f);_0x53b893(_0xee797f);});});}
\ No newline at end of file
index 47a21ab..5e425a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa380=['../../config/environment','./license.controller','get','put','/:id','isAuthenticated','update','downloadLogFile','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x2e12b3,_0x3ef9d5){var _0x21bb70=function(_0x481fbc){while(--_0x481fbc){_0x2e12b3['push'](_0x2e12b3['shift']());}};_0x21bb70(++_0x3ef9d5);}(_0xa380,0x153));var _0x0a38=function(_0x1427bc,_0x151423){_0x1427bc=_0x1427bc-0x0;var _0x1b116d=_0xa380[_0x1427bc];return _0x1b116d;};'use strict';var multer=require(_0x0a38('0x0'));var util=require(_0x0a38('0x1'));var path=require(_0x0a38('0x2'));var timeout=require(_0x0a38('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0a38('0x4'));var interaction=require(_0x0a38('0x5'));var config=require(_0x0a38('0x6'));var controller=require(_0x0a38('0x7'));router[_0x0a38('0x8')]('/',controller['index']);router[_0x0a38('0x9')](_0x0a38('0xa'),auth[_0x0a38('0xb')](),controller[_0x0a38('0xc')]);router['get']('/download_log_file',auth[_0x0a38('0xb')](),controller[_0x0a38('0xd')]);module[_0x0a38('0xe')]=router;
\ No newline at end of file
+var _0xf95f=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./license.controller','index','/:id','isAuthenticated','update','get','/download_log_file','downloadLogFile','exports','multer','util'];(function(_0x4f5ec1,_0x1b57c3){var _0x2878d5=function(_0x3babd9){while(--_0x3babd9){_0x4f5ec1['push'](_0x4f5ec1['shift']());}};_0x2878d5(++_0x1b57c3);}(_0xf95f,0x142));var _0xff95=function(_0x37e8e8,_0x1be63e){_0x37e8e8=_0x37e8e8-0x0;var _0x2c3c9e=_0xf95f[_0x37e8e8];return _0x2c3c9e;};'use strict';var multer=require(_0xff95('0x0'));var util=require(_0xff95('0x1'));var path=require(_0xff95('0x2'));var timeout=require(_0xff95('0x3'));var express=require(_0xff95('0x4'));var router=express[_0xff95('0x5')]();var fs_extra=require(_0xff95('0x6'));var auth=require(_0xff95('0x7'));var interaction=require(_0xff95('0x8'));var config=require('../../config/environment');var controller=require(_0xff95('0x9'));router['get']('/',controller[_0xff95('0xa')]);router['put'](_0xff95('0xb'),auth[_0xff95('0xc')](),controller[_0xff95('0xd')]);router[_0xff95('0xe')](_0xff95('0xf'),auth[_0xff95('0xc')](),controller[_0xff95('0x10')]);module[_0xff95('0x11')]=router;
\ No newline at end of file
index 6300630..f4f4454 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60cf=['sequelize','exports','STRING'];(function(_0x41dcb7,_0x28ec8c){var _0x1f0760=function(_0x18d4f3){while(--_0x18d4f3){_0x41dcb7['push'](_0x41dcb7['shift']());}};_0x1f0760(++_0x28ec8c);}(_0x60cf,0xae));var _0xf60c=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0x60cf[_0x5eb22e];return _0x27fed5;};'use strict';var Sequelize=require(_0xf60c('0x0'));module[_0xf60c('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xf60c('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xcd2b=['sequelize','exports','TEXT','STRING'];(function(_0x4b3bfc,_0x277c76){var _0xf76a7c=function(_0x2d05aa){while(--_0x2d05aa){_0x4b3bfc['push'](_0x4b3bfc['shift']());}};_0xf76a7c(++_0x277c76);}(_0xcd2b,0x138));var _0xbcd2=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xcd2b[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require(_0xbcd2('0x0'));module[_0xbcd2('0x1')]={'license':{'type':Sequelize[_0xbcd2('0x2')]},'data1':{'type':Sequelize[_0xbcd2('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index e1bda25..e4ea95d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa951=['find','params','get','key','downloadLogFile','license-info.log','join','/var','log','xcally','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','keys','License','rawAttributes','query','filters','intersection','model','fields','attributes','merge','options','getLicense','catch','body'];(function(_0x2f9963,_0x432fcc){var _0x4eb8d9=function(_0x5a2d98){while(--_0x5a2d98){_0x2f9963['push'](_0x2f9963['shift']());}};_0x4eb8d9(++_0x432fcc);}(_0xa951,0xf2));var _0x1a95=function(_0x2cb133,_0x591e34){_0x2cb133=_0x2cb133-0x0;var _0x4c040a=_0xa951[_0x2cb133];return _0x4c040a;};'use strict';var emlformat=require(_0x1a95('0x0'));var rimraf=require(_0x1a95('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a95('0x2'));var rp=require('request-promise');var moment=require(_0x1a95('0x3'));var BPromise=require(_0x1a95('0x4'));var Mustache=require(_0x1a95('0x5'));var util=require(_0x1a95('0x6'));var path=require(_0x1a95('0x7'));var sox=require(_0x1a95('0x8'));var csv=require(_0x1a95('0x9'));var ejs=require(_0x1a95('0xa'));var fs=require('fs');var fs_extra=require(_0x1a95('0xb'));var _=require(_0x1a95('0xc'));var squel=require(_0x1a95('0xd'));var crypto=require('crypto');var jsforce=require(_0x1a95('0xe'));var deskjs=require(_0x1a95('0xf'));var toCsv=require(_0x1a95('0x9'));var querystring=require(_0x1a95('0x10'));var Papa=require(_0x1a95('0x11'));var Redis=require(_0x1a95('0x12'));var authService=require(_0x1a95('0x13'));var qs=require(_0x1a95('0x14'));var as=require(_0x1a95('0x15'));var hardwareService=require(_0x1a95('0x16'));var logger=require(_0x1a95('0x17'))(_0x1a95('0x18'));var utils=require(_0x1a95('0x19'));var config=require(_0x1a95('0x1a'));var licenseUtil=require(_0x1a95('0x1b'));var db=require(_0x1a95('0x1c'))['db'];function respondWithStatusCode(_0x294431,_0x4ba6d8){_0x4ba6d8=_0x4ba6d8||0xcc;return function(_0x1a5824){if(_0x1a5824){return _0x294431[_0x1a95('0x1d')](_0x4ba6d8);}return _0x294431[_0x1a95('0x1e')](_0x4ba6d8)[_0x1a95('0x1f')]();};}function respondWithResult(_0x12d67a,_0x4f4444){_0x4f4444=_0x4f4444||0xc8;return function(_0x18d600){if(_0x18d600){return _0x12d67a[_0x1a95('0x1e')](_0x4f4444)[_0x1a95('0x20')](_0x18d600);}};}function respondWithFilteredResult(_0x543193,_0x1941ed){return function(_0x25007c){if(_0x25007c){var _0x5a6c51=typeof _0x1941ed[_0x1a95('0x21')]==='undefined'&&typeof _0x1941ed[_0x1a95('0x22')]===_0x1a95('0x23');var _0x452141=_0x25007c[_0x1a95('0x24')];var _0x1aaf7a=_0x5a6c51?0x0:_0x1941ed[_0x1a95('0x21')];var _0x5a37ba=_0x5a6c51?_0x25007c['count']:_0x1941ed[_0x1a95('0x21')]+_0x1941ed[_0x1a95('0x22')];var _0x490661;if(_0x5a37ba>=_0x452141){_0x5a37ba=_0x452141;_0x490661=0xc8;}else{_0x490661=0xce;}_0x543193[_0x1a95('0x1e')](_0x490661);return _0x543193[_0x1a95('0x25')](_0x1a95('0x26'),_0x1aaf7a+'-'+_0x5a37ba+'/'+_0x452141)[_0x1a95('0x20')](_0x25007c);}return null;};}function patchUpdates(_0x14ddf8){return function(_0xee70a2){try{jsonpatch[_0x1a95('0x27')](_0xee70a2,_0x14ddf8,!![]);}catch(_0x442962){return BPromise[_0x1a95('0x28')](_0x442962);}return _0xee70a2[_0x1a95('0x29')]();};}function saveUpdates(_0x30668d,_0xdea6ce){return function(_0x6e9c5a){if(_0x6e9c5a){return _0x6e9c5a[_0x1a95('0x2a')](_0x30668d)['then'](function(_0x5b36cd){return _0x5b36cd;});}return null;};}function removeEntity(_0x3a5196,_0xe88d28){return function(_0x1a2af1){if(_0x1a2af1){return _0x1a2af1['destroy']()[_0x1a95('0x2b')](function(){_0x3a5196[_0x1a95('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x595c71,_0x26e355){return function(_0x2114a4){if(!_0x2114a4){_0x595c71[_0x1a95('0x1d')](0x194);}return _0x2114a4;};}function handleError(_0x34b431,_0x30e652){_0x30e652=_0x30e652||0x1f4;return function(_0x6cdc68){logger['error'](_0x6cdc68[_0x1a95('0x2c')]);if(_0x6cdc68[_0x1a95('0x2d')]){delete _0x6cdc68[_0x1a95('0x2d')];}_0x34b431['status'](_0x30e652)[_0x1a95('0x2e')](_0x6cdc68);};}var utilLicense=require(_0x1a95('0x1b'));exports[_0x1a95('0x2f')]=function(_0x5e9523,_0x49cc06){var _0x2e7880={'raw':!![],'where':{'id':0x1}},_0x518be4={};_0x518be4['model']=_[_0x1a95('0x30')](db[_0x1a95('0x31')][_0x1a95('0x32')]);_0x518be4[_0x1a95('0x33')]=_[_0x1a95('0x30')](_0x5e9523['query']);_0x518be4[_0x1a95('0x34')]=_[_0x1a95('0x35')](_0x518be4[_0x1a95('0x36')],_0x518be4['query']);_0x2e7880['attributes']=_[_0x1a95('0x35')](_0x518be4[_0x1a95('0x36')],qs[_0x1a95('0x37')](_0x5e9523['query'][_0x1a95('0x37')]));_0x2e7880[_0x1a95('0x38')]=_0x2e7880[_0x1a95('0x38')]['length']?_0x2e7880[_0x1a95('0x38')]:_0x518be4[_0x1a95('0x36')];_0x2e7880=_[_0x1a95('0x39')]({},_0x2e7880,_0x5e9523[_0x1a95('0x3a')]);return utilLicense[_0x1a95('0x3b')](_0x2e7880)['then'](respondWithResult(_0x49cc06,null))[_0x1a95('0x3c')](handleError(_0x49cc06,null));};exports[_0x1a95('0x2a')]=function(_0x417df1,_0x1dd743){if(_0x417df1['body']['id']){delete _0x417df1[_0x1a95('0x3d')]['id'];}return db[_0x1a95('0x31')][_0x1a95('0x3e')]({'where':{'id':_0x417df1[_0x1a95('0x3f')]['id']}})[_0x1a95('0x2b')](handleEntityNotFound(_0x1dd743,null))[_0x1a95('0x2b')](function(_0x550a44){var _0x40b27c=_0x550a44[_0x1a95('0x40')]({'plain':!![]});return utilLicense['checkLicense'](_0x40b27c,_0x417df1[_0x1a95('0x3d')][_0x1a95('0x41')]);})[_0x1a95('0x2b')](function(_0x5c4c44){if(!_0x5c4c44['demo']){return saveUpdates(_0x417df1[_0x1a95('0x3d')],null);}return _0x5c4c44;})[_0x1a95('0x2b')](respondWithResult(_0x1dd743,null))[_0x1a95('0x3c')](handleError(_0x1dd743,null));};exports[_0x1a95('0x42')]=function(_0x562c98,_0x2376c8){var _0x3ee6a2=_0x1a95('0x43');var _0x25d89d=path[_0x1a95('0x44')](_0x1a95('0x45'),_0x1a95('0x46'),_0x1a95('0x47'),_0x3ee6a2);_0x2376c8['setHeader'](_0x1a95('0x48'),_0x1a95('0x49')+_0x3ee6a2);_0x2376c8['set'](_0x1a95('0x4a'),_0x1a95('0x4b'));_0x2376c8['download'](_0x25d89d);};
\ No newline at end of file
+var _0x200b=['join','/var','xcally','setHeader','Content-disposition','attachment;\x20filename=','set','text/plain','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','stack','model','License','query','keys','attributes','fields','length','merge','getLicense','catch','body','find','params','checkLicense','key','demo'];(function(_0x29b353,_0x3dd656){var _0xbb506e=function(_0x9f4958){while(--_0x9f4958){_0x29b353['push'](_0x29b353['shift']());}};_0xbb506e(++_0x3dd656);}(_0x200b,0x88));var _0xb200=function(_0x10497f,_0x83332a){_0x10497f=_0x10497f-0x0;var _0x381690=_0x200b[_0x10497f];return _0x381690;};'use strict';var emlformat=require(_0xb200('0x0'));var rimraf=require(_0xb200('0x1'));var zipdir=require(_0xb200('0x2'));var jsonpatch=require(_0xb200('0x3'));var rp=require(_0xb200('0x4'));var moment=require(_0xb200('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb200('0x6'));var path=require('path');var sox=require(_0xb200('0x7'));var csv=require(_0xb200('0x8'));var ejs=require(_0xb200('0x9'));var fs=require('fs');var fs_extra=require(_0xb200('0xa'));var _=require('lodash');var squel=require(_0xb200('0xb'));var crypto=require(_0xb200('0xc'));var jsforce=require(_0xb200('0xd'));var deskjs=require(_0xb200('0xe'));var toCsv=require(_0xb200('0x8'));var querystring=require(_0xb200('0xf'));var Papa=require('papaparse');var Redis=require(_0xb200('0x10'));var authService=require(_0xb200('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb200('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb200('0x13'))('api');var utils=require(_0xb200('0x14'));var config=require(_0xb200('0x15'));var licenseUtil=require(_0xb200('0x16'));var db=require(_0xb200('0x17'))['db'];function respondWithStatusCode(_0x41a51a,_0x511b38){_0x511b38=_0x511b38||0xcc;return function(_0x491e6b){if(_0x491e6b){return _0x41a51a[_0xb200('0x18')](_0x511b38);}return _0x41a51a[_0xb200('0x19')](_0x511b38)[_0xb200('0x1a')]();};}function respondWithResult(_0x3fcc4f,_0x4ca512){_0x4ca512=_0x4ca512||0xc8;return function(_0x44cd73){if(_0x44cd73){return _0x3fcc4f[_0xb200('0x19')](_0x4ca512)['json'](_0x44cd73);}};}function respondWithFilteredResult(_0x40b34b,_0x234b36){return function(_0x4569d2){if(_0x4569d2){var _0x54a544=typeof _0x234b36[_0xb200('0x1b')]===_0xb200('0x1c')&&typeof _0x234b36[_0xb200('0x1d')]===_0xb200('0x1c');var _0x115ceb=_0x4569d2[_0xb200('0x1e')];var _0x4ef81f=_0x54a544?0x0:_0x234b36[_0xb200('0x1b')];var _0x3f01a6=_0x54a544?_0x4569d2[_0xb200('0x1e')]:_0x234b36[_0xb200('0x1b')]+_0x234b36['limit'];var _0x1a0543;if(_0x3f01a6>=_0x115ceb){_0x3f01a6=_0x115ceb;_0x1a0543=0xc8;}else{_0x1a0543=0xce;}_0x40b34b[_0xb200('0x19')](_0x1a0543);return _0x40b34b['set'](_0xb200('0x1f'),_0x4ef81f+'-'+_0x3f01a6+'/'+_0x115ceb)[_0xb200('0x20')](_0x4569d2);}return null;};}function patchUpdates(_0xbe0b06){return function(_0x43c340){try{jsonpatch[_0xb200('0x21')](_0x43c340,_0xbe0b06,!![]);}catch(_0x2c4395){return BPromise[_0xb200('0x22')](_0x2c4395);}return _0x43c340[_0xb200('0x23')]();};}function saveUpdates(_0x36593b,_0x13c610){return function(_0xe77bc5){if(_0xe77bc5){return _0xe77bc5[_0xb200('0x24')](_0x36593b)[_0xb200('0x25')](function(_0x38d00e){return _0x38d00e;});}return null;};}function removeEntity(_0x21ff4c,_0xf935b1){return function(_0x105942){if(_0x105942){return _0x105942[_0xb200('0x26')]()[_0xb200('0x25')](function(){_0x21ff4c[_0xb200('0x19')](0xcc)[_0xb200('0x1a')]();});}};}function handleEntityNotFound(_0x22e1a8,_0x2136f4){return function(_0x5f93e5){if(!_0x5f93e5){_0x22e1a8[_0xb200('0x18')](0x194);}return _0x5f93e5;};}function handleError(_0x59acbf,_0x107e27){_0x107e27=_0x107e27||0x1f4;return function(_0x37096e){logger['error'](_0x37096e[_0xb200('0x27')]);if(_0x37096e['name']){delete _0x37096e['name'];}_0x59acbf[_0xb200('0x19')](_0x107e27)['send'](_0x37096e);};}var utilLicense=require(_0xb200('0x16'));exports['index']=function(_0x18d4ad,_0x496aba){var _0x20e46f={'raw':!![],'where':{'id':0x1}},_0x2f5e9d={};_0x2f5e9d[_0xb200('0x28')]=_['keys'](db[_0xb200('0x29')]['rawAttributes']);_0x2f5e9d[_0xb200('0x2a')]=_[_0xb200('0x2b')](_0x18d4ad[_0xb200('0x2a')]);_0x2f5e9d['filters']=_['intersection'](_0x2f5e9d[_0xb200('0x28')],_0x2f5e9d[_0xb200('0x2a')]);_0x20e46f[_0xb200('0x2c')]=_['intersection'](_0x2f5e9d[_0xb200('0x28')],qs[_0xb200('0x2d')](_0x18d4ad[_0xb200('0x2a')]['fields']));_0x20e46f[_0xb200('0x2c')]=_0x20e46f[_0xb200('0x2c')][_0xb200('0x2e')]?_0x20e46f[_0xb200('0x2c')]:_0x2f5e9d[_0xb200('0x28')];_0x20e46f=_[_0xb200('0x2f')]({},_0x20e46f,_0x18d4ad['options']);return utilLicense[_0xb200('0x30')](_0x20e46f)[_0xb200('0x25')](respondWithResult(_0x496aba,null))[_0xb200('0x31')](handleError(_0x496aba,null));};exports[_0xb200('0x24')]=function(_0x375891,_0x12acda){if(_0x375891[_0xb200('0x32')]['id']){delete _0x375891[_0xb200('0x32')]['id'];}return db['License'][_0xb200('0x33')]({'where':{'id':_0x375891[_0xb200('0x34')]['id']}})[_0xb200('0x25')](handleEntityNotFound(_0x12acda,null))[_0xb200('0x25')](function(_0x3fa19c){var _0x318e37=_0x3fa19c['get']({'plain':!![]});return utilLicense[_0xb200('0x35')](_0x318e37,_0x375891[_0xb200('0x32')][_0xb200('0x36')]);})['then'](function(_0x313045){if(!_0x313045[_0xb200('0x37')]){return saveUpdates(_0x375891[_0xb200('0x32')],null);}return _0x313045;})[_0xb200('0x25')](respondWithResult(_0x12acda,null))[_0xb200('0x31')](handleError(_0x12acda,null));};exports['downloadLogFile']=function(_0x7ad526,_0x5aaaaf){var _0x19284a='license-info.log';var _0x524f6a=path[_0xb200('0x38')](_0xb200('0x39'),'log',_0xb200('0x3a'),_0x19284a);_0x5aaaaf[_0xb200('0x3b')](_0xb200('0x3c'),_0xb200('0x3d')+_0x19284a);_0x5aaaaf[_0xb200('0x3e')]('Content-Type',_0xb200('0x3f'));_0x5aaaaf['download'](_0x524f6a);};
\ No newline at end of file
index 570eb8a..461438c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4718=['define','License','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4718,0x70));var _0x8471=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0x4718[_0x519756];return _0x37047e;};'use strict';var _=require(_0x8471('0x0'));var util=require(_0x8471('0x1'));var logger=require(_0x8471('0x2'))(_0x8471('0x3'));var moment=require('moment');var BPromise=require(_0x8471('0x4'));var rp=require(_0x8471('0x5'));var fs=require('fs');var path=require(_0x8471('0x6'));var rimraf=require(_0x8471('0x7'));var config=require('../../config/environment');var attributes=require('./license.attributes');module['exports']=function(_0x2708f8,_0x48381d){return _0x2708f8[_0x8471('0x8')](_0x8471('0x9'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6c99=['license','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x9e1f5,_0x4863ed){var _0x249642=function(_0x1bd206){while(--_0x1bd206){_0x9e1f5['push'](_0x9e1f5['shift']());}};_0x249642(++_0x4863ed);}(_0x6c99,0xc9));var _0x96c9=function(_0x466e57,_0x21b819){_0x466e57=_0x466e57-0x0;var _0x34df42=_0x6c99[_0x466e57];return _0x34df42;};'use strict';var _=require(_0x96c9('0x0'));var util=require('util');var logger=require(_0x96c9('0x1'))('api');var moment=require(_0x96c9('0x2'));var BPromise=require('bluebird');var rp=require(_0x96c9('0x3'));var fs=require('fs');var path=require(_0x96c9('0x4'));var rimraf=require(_0x96c9('0x5'));var config=require(_0x96c9('0x6'));var attributes=require('./license.attributes');module[_0x96c9('0x7')]=function(_0x492227,_0xe2ca21){return _0x492227[_0x96c9('0x8')]('License',attributes,{'tableName':_0x96c9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 922b1a2..49a5c08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb6c=['request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xbb6c,0xa7));var _0xcbb6=function(_0x3c25d7,_0x50ebd0){_0x3c25d7=_0x3c25d7-0x0;var _0xd8d3a6=_0xbb6c[_0x3c25d7];return _0xd8d3a6;};'use strict';var _=require(_0xcbb6('0x0'));var util=require(_0xcbb6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcbb6('0x2'))['db'];var utils=require(_0xcbb6('0x3'));var logger=require(_0xcbb6('0x4'))(_0xcbb6('0x5'));var config=require(_0xcbb6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcbb6('0x7')][_0xcbb6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe83601,_0x5d8526,_0x19eb59){return new BPromise(function(_0x3ee241,_0x58b119){return client[_0xcbb6('0x9')](_0xe83601,_0x19eb59)[_0xcbb6('0xa')](function(_0x3321df){logger[_0xcbb6('0xb')](_0xcbb6('0xc'),_0x5d8526,_0xcbb6('0xd'));logger[_0xcbb6('0xe')](_0xcbb6('0xf'),_0x5d8526,_0xcbb6('0xd'),JSON[_0xcbb6('0x10')](_0x3321df));if(_0x3321df[_0xcbb6('0x11')]){if(_0x3321df[_0xcbb6('0x11')][_0xcbb6('0x12')]===0x1f4){logger[_0xcbb6('0x11')]('License,\x20%s,\x20%s',_0x5d8526,_0x3321df[_0xcbb6('0x11')][_0xcbb6('0x13')]);return _0x58b119(_0x3321df[_0xcbb6('0x11')][_0xcbb6('0x13')]);}logger[_0xcbb6('0x11')](_0xcbb6('0xc'),_0x5d8526,_0x3321df[_0xcbb6('0x11')][_0xcbb6('0x13')]);return _0x3ee241(_0x3321df[_0xcbb6('0x11')][_0xcbb6('0x13')]);}else{logger['info'](_0xcbb6('0xc'),_0x5d8526,_0xcbb6('0xd'));_0x3ee241(_0x3321df[_0xcbb6('0x14')]['message']);}})[_0xcbb6('0x15')](function(_0x4b8bc4){logger[_0xcbb6('0x11')](_0xcbb6('0xc'),_0x5d8526,_0x4b8bc4);_0x58b119(_0x4b8bc4);});});}
\ No newline at end of file
+var _0xe9f2=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','message','License,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1ce6a7,_0xeaa892){var _0x3095a7=function(_0x4a80df){while(--_0x4a80df){_0x1ce6a7['push'](_0x1ce6a7['shift']());}};_0x3095a7(++_0xeaa892);}(_0xe9f2,0x101));var _0x2e9f=function(_0x1a8f86,_0x5eb928){_0x1a8f86=_0x1a8f86-0x0;var _0x21a3b1=_0xe9f2[_0x1a8f86];return _0x21a3b1;};'use strict';var _=require(_0x2e9f('0x0'));var util=require(_0x2e9f('0x1'));var moment=require(_0x2e9f('0x2'));var BPromise=require('bluebird');var rs=require(_0x2e9f('0x3'));var fs=require('fs');var Redis=require(_0x2e9f('0x4'));var db=require(_0x2e9f('0x5'))['db'];var utils=require(_0x2e9f('0x6'));var logger=require(_0x2e9f('0x7'))(_0x2e9f('0x8'));var config=require(_0x2e9f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2e9f('0xa')][_0x2e9f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48a88a,_0x444569,_0x555af7){return new BPromise(function(_0x3199a7,_0x2371b3){return client[_0x2e9f('0xc')](_0x48a88a,_0x555af7)[_0x2e9f('0xd')](function(_0x575625){logger[_0x2e9f('0xe')]('License,\x20%s,\x20%s',_0x444569,_0x2e9f('0xf'));logger['debug'](_0x2e9f('0x10'),_0x444569,_0x2e9f('0xf'),JSON[_0x2e9f('0x11')](_0x575625));if(_0x575625[_0x2e9f('0x12')]){if(_0x575625[_0x2e9f('0x12')]['code']===0x1f4){logger[_0x2e9f('0x12')]('License,\x20%s,\x20%s',_0x444569,_0x575625[_0x2e9f('0x12')][_0x2e9f('0x13')]);return _0x2371b3(_0x575625[_0x2e9f('0x12')]['message']);}logger[_0x2e9f('0x12')](_0x2e9f('0x14'),_0x444569,_0x575625[_0x2e9f('0x12')][_0x2e9f('0x13')]);return _0x3199a7(_0x575625[_0x2e9f('0x12')][_0x2e9f('0x13')]);}else{logger[_0x2e9f('0xe')](_0x2e9f('0x14'),_0x444569,_0x2e9f('0xf'));_0x3199a7(_0x575625['result']['message']);}})[_0x2e9f('0x15')](function(_0x2cd7bf){logger[_0x2e9f('0x12')]('License,\x20%s,\x20%s',_0x444569,_0x2cd7bf);_0x2371b3(_0x2cd7bf);});});}
\ No newline at end of file
index 30de8c8..e06b661 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0582=['./mailAccount.controller','get','index','describe','show','/:id/dispositions','isAuthenticated','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','/:id','update','removeDispositions','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x305edb,_0x53c474){var _0x1e791d=function(_0x243afd){while(--_0x243afd){_0x305edb['push'](_0x305edb['shift']());}};_0x1e791d(++_0x53c474);}(_0x0582,0x156));var _0x2058=function(_0x5b8444,_0x32c805){_0x5b8444=_0x5b8444-0x0;var _0x500c73=_0x0582[_0x5b8444];return _0x500c73;};'use strict';var multer=require(_0x2058('0x0'));var util=require('util');var path=require(_0x2058('0x1'));var timeout=require('connect-timeout');var express=require(_0x2058('0x2'));var router=express[_0x2058('0x3')]();var fs_extra=require(_0x2058('0x4'));var auth=require(_0x2058('0x5'));var interaction=require(_0x2058('0x6'));var config=require(_0x2058('0x7'));var controller=require(_0x2058('0x8'));router[_0x2058('0x9')]('/',auth['isAuthenticated'](),controller[_0x2058('0xa')]);router[_0x2058('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x2058('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2058('0xc')]);router[_0x2058('0x9')](_0x2058('0xd'),auth[_0x2058('0xe')](),controller[_0x2058('0xf')]);router[_0x2058('0x9')]('/:id/canned_answers',auth[_0x2058('0xe')](),controller[_0x2058('0x10')]);router[_0x2058('0x9')](_0x2058('0x11'),auth[_0x2058('0xe')](),controller[_0x2058('0x12')]);router['get'](_0x2058('0x13'),auth['isAuthenticated'](),controller[_0x2058('0x14')]);router[_0x2058('0x9')](_0x2058('0x15'),auth[_0x2058('0xe')](),controller[_0x2058('0x16')]);router[_0x2058('0x9')](_0x2058('0x17'),auth[_0x2058('0xe')](),controller['getApplications']);router[_0x2058('0x9')]('/:id/messages',auth[_0x2058('0xe')](),controller[_0x2058('0x18')]);router[_0x2058('0x9')](_0x2058('0x19'),auth['isAuthenticated'](),controller[_0x2058('0x1a')]);router[_0x2058('0x9')](_0x2058('0x1b'),auth[_0x2058('0xe')](),controller[_0x2058('0x1c')]);router[_0x2058('0x1d')](_0x2058('0xd'),auth['isAuthenticated'](),controller[_0x2058('0x1e')]);router[_0x2058('0x1d')](_0x2058('0x1f'),auth['isAuthenticated'](),controller[_0x2058('0x20')]);router['post']('/',auth[_0x2058('0xe')](),controller['create']);router[_0x2058('0x1d')](_0x2058('0x11'),auth[_0x2058('0xe')](),controller[_0x2058('0x21')]);router['post'](_0x2058('0x13'),auth[_0x2058('0xe')](),controller[_0x2058('0x22')]);router[_0x2058('0x1d')](_0x2058('0x15'),auth[_0x2058('0xe')](),controller[_0x2058('0x23')]);router['post'](_0x2058('0x17'),auth[_0x2058('0xe')](),controller[_0x2058('0x24')]);router[_0x2058('0x1d')](_0x2058('0x25'),auth[_0x2058('0xe')](),controller[_0x2058('0x26')]);router[_0x2058('0x1d')](_0x2058('0x1b'),auth[_0x2058('0xe')](),controller[_0x2058('0x27')]);router['put'](_0x2058('0x28'),auth[_0x2058('0xe')](),controller[_0x2058('0x29')]);router['delete']('/:id/dispositions',auth[_0x2058('0xe')](),controller[_0x2058('0x2a')]);router[_0x2058('0x2b')](_0x2058('0x1f'),auth[_0x2058('0xe')](),controller[_0x2058('0x2c')]);router[_0x2058('0x2b')](_0x2058('0x11'),auth[_0x2058('0xe')](),controller[_0x2058('0x2d')]);router[_0x2058('0x2b')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x2058('0x2e')]);router[_0x2058('0x2b')]('/:id',auth[_0x2058('0xe')](),controller[_0x2058('0x2f')]);router[_0x2058('0x2b')](_0x2058('0x1b'),auth[_0x2058('0xe')](),controller[_0x2058('0x30')]);module[_0x2058('0x31')]=router;
\ No newline at end of file
+var _0x4bc5=['/:id/messages','getMessages','verifySmtp','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','addApplications','/:id/send','/:id/users','addAgents','put','/:id','update','delete','removeDispositions','/:id/canned_answers','/:id/in_servers','removeSmtp','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','/describe','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications'];(function(_0x3d055d,_0x32d8fc){var _0x46a441=function(_0x49a8f3){while(--_0x49a8f3){_0x3d055d['push'](_0x3d055d['shift']());}};_0x46a441(++_0x32d8fc);}(_0x4bc5,0xcc));var _0x54bc=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x4bc5[_0x476bf4];return _0x788ffe;};'use strict';var multer=require('multer');var util=require(_0x54bc('0x0'));var path=require(_0x54bc('0x1'));var timeout=require(_0x54bc('0x2'));var express=require('express');var router=express[_0x54bc('0x3')]();var fs_extra=require(_0x54bc('0x4'));var auth=require(_0x54bc('0x5'));var interaction=require(_0x54bc('0x6'));var config=require(_0x54bc('0x7'));var controller=require(_0x54bc('0x8'));router[_0x54bc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x54bc('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x54bc('0x9')]('/:id',auth[_0x54bc('0xb')](),controller['show']);router[_0x54bc('0x9')](_0x54bc('0xc'),auth['isAuthenticated'](),controller[_0x54bc('0xd')]);router[_0x54bc('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x54bc('0xe')]);router[_0x54bc('0x9')]('/:id/in_servers',auth['isAuthenticated'](),controller['getImap']);router[_0x54bc('0x9')](_0x54bc('0xf'),auth['isAuthenticated'](),controller[_0x54bc('0x10')]);router[_0x54bc('0x9')](_0x54bc('0x11'),auth[_0x54bc('0xb')](),controller[_0x54bc('0x12')]);router[_0x54bc('0x9')](_0x54bc('0x13'),auth[_0x54bc('0xb')](),controller[_0x54bc('0x14')]);router['get'](_0x54bc('0x15'),auth['isAuthenticated'](),controller[_0x54bc('0x16')]);router[_0x54bc('0x9')]('/:id/verify',auth[_0x54bc('0xb')](),controller[_0x54bc('0x17')]);router[_0x54bc('0x9')]('/:id/users',auth[_0x54bc('0xb')](),controller[_0x54bc('0x18')]);router[_0x54bc('0x19')](_0x54bc('0xc'),auth[_0x54bc('0xb')](),controller[_0x54bc('0x1a')]);router[_0x54bc('0x19')]('/:id/canned_answers',auth[_0x54bc('0xb')](),controller[_0x54bc('0x1b')]);router[_0x54bc('0x19')]('/',auth[_0x54bc('0xb')](),controller[_0x54bc('0x1c')]);router['post']('/:id/in_servers',auth[_0x54bc('0xb')](),controller[_0x54bc('0x1d')]);router[_0x54bc('0x19')]('/:id/out_servers',auth[_0x54bc('0xb')](),controller[_0x54bc('0x1e')]);router[_0x54bc('0x19')](_0x54bc('0x11'),auth[_0x54bc('0xb')](),controller['addInteraction']);router['post'](_0x54bc('0x13'),auth[_0x54bc('0xb')](),controller[_0x54bc('0x1f')]);router[_0x54bc('0x19')](_0x54bc('0x20'),auth[_0x54bc('0xb')](),controller['send']);router[_0x54bc('0x19')](_0x54bc('0x21'),auth[_0x54bc('0xb')](),controller[_0x54bc('0x22')]);router[_0x54bc('0x23')](_0x54bc('0x24'),auth[_0x54bc('0xb')](),controller[_0x54bc('0x25')]);router[_0x54bc('0x26')](_0x54bc('0xc'),auth[_0x54bc('0xb')](),controller[_0x54bc('0x27')]);router[_0x54bc('0x26')](_0x54bc('0x28'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x54bc('0x29'),auth[_0x54bc('0xb')](),controller['removeImap']);router[_0x54bc('0x26')]('/:id/out_servers',auth[_0x54bc('0xb')](),controller[_0x54bc('0x2a')]);router[_0x54bc('0x26')](_0x54bc('0x24'),auth[_0x54bc('0xb')](),controller[_0x54bc('0x2b')]);router['delete'](_0x54bc('0x21'),auth[_0x54bc('0xb')](),controller['removeAgents']);module[_0x54bc('0x2c')]=router;
\ No newline at end of file
index 16c424d..c8bdb04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa79=['mandatoryDisposition','hotmail','yahoo','outlook365','provider','custom','getDataValue','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x4afac5,_0x1ab4ed){var _0x2404b3=function(_0x5c700b){while(--_0x5c700b){_0x4afac5['push'](_0x4afac5['shift']());}};_0x2404b3(++_0x1ab4ed);}(_0xfa79,0xc7));var _0x9fa7=function(_0x4fcfa6,_0x361690){_0x4fcfa6=_0x4fcfa6-0x0;var _0x3a3c12=_0xfa79[_0x4fcfa6];return _0x3a3c12;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x9fa7('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0x9fa7('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x9fa7('0x0')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x9fa7('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x9fa7('0x0')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x9fa7('0x0')],'allowNull':![],'defaultValue':_0x9fa7('0x2')},'fontSize':{'type':Sequelize[_0x9fa7('0x3')](0x2)[_0x9fa7('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x9fa7('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[_0x9fa7('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9fa7('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9fa7('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9fa7('0x3')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9fa7('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9fa7('0x3')],'allowNull':!![],'defaultValue':null,'comment':_0x9fa7('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x9fa7('0x1')],'defaultValue':![],'comment':_0x9fa7('0x7'),'set':function(_0x43c3e1){if(!_0x43c3e1)this[_0x9fa7('0x8')]('mandatoryDispositionPauseId',null);this[_0x9fa7('0x8')](_0x9fa7('0x9'),_0x43c3e1);}},'provider':{'type':Sequelize['ENUM']('gmail',_0x9fa7('0xa'),_0x9fa7('0xb'),_0x9fa7('0xc')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x9fa7('0xd')))return _0x9fa7('0xe');return this[_0x9fa7('0xf')]('provider');},'set':function(_0x125071){if(_0x125071===_0x9fa7('0xe'))_0x125071=null;return this[_0x9fa7('0x8')](_0x9fa7('0xd'),_0x125071);}}};
\ No newline at end of file
+var _0xa4b8=['INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','ENUM','gmail','hotmail','yahoo','getDataValue','provider','custom','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0xa3a55f,_0x3e01dc){var _0x38e8b7=function(_0x330f51){while(--_0x330f51){_0xa3a55f['push'](_0xa3a55f['shift']());}};_0x38e8b7(++_0x3e01dc);}(_0xa4b8,0x7b));var _0x8a4b=function(_0x48b4a1,_0x3c2bf4){_0x48b4a1=_0x48b4a1-0x0;var _0x2df379=_0xa4b8[_0x48b4a1];return _0x2df379;};'use strict';var Sequelize=require('sequelize');module[_0x8a4b('0x0')]={'description':{'type':Sequelize[_0x8a4b('0x1')]},'name':{'type':Sequelize[_0x8a4b('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x8a4b('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x8a4b('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x8a4b('0x3')]},'markAsUnread':{'type':Sequelize[_0x8a4b('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x8a4b('0x1')],'allowNull':![],'defaultValue':_0x8a4b('0x4')},'fontSize':{'type':Sequelize[_0x8a4b('0x5')](0x2)[_0x8a4b('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8a4b('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8a4b('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8a4b('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x8a4b('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x8a4b('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x8a4b('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x54f718){if(!_0x54f718)this[_0x8a4b('0x8')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x54f718);}},'provider':{'type':Sequelize[_0x8a4b('0x9')](_0x8a4b('0xa'),_0x8a4b('0xb'),_0x8a4b('0xc'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x8a4b('0xd')](_0x8a4b('0xe')))return _0x8a4b('0xf');return this[_0x8a4b('0xd')](_0x8a4b('0xe'));},'set':function(_0x1e01ef){if(_0x1e01ef===_0x8a4b('0xf'))_0x1e01ef=null;return this['setDataValue'](_0x8a4b('0xe'),_0x1e01ef);}}};
\ No newline at end of file
index 6777ff5..24fefc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4995=['then','get','UserProfileResource','destroy','sendStatus','stack','name','send','imap.gmail.com','yahoo','imap-mail.outlook.com','outlook365','smtp.gmail.com','hotmail','smtp-mail.outlook.com','Unknown\x20email\x20service\x20provider','user','password','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','pass','Imap','Smtp','MailServerIn','Pause','map','MailAccount','rawAttributes','fieldName','key','query','attributes','intersection','model','fields','length','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','MailServerOut','mandatoryDispositionPause','keys','include','find','body','provider','custom','Mail\x20Account\x20not\x20found','describe','MailAccountId','Disposition','create','getDispositions','hasOwnProperty','sort','options','removeDispositions','ids','CannedAnswer','removeAnswers','email','ListId','active','description','UserProfileSection','MailAccounts','userProfileId','autoAssociation','getImap','addImap','removeImap','setImap','findOne','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','getInteractions','CmContact','Contact','Owner','internal','Tag','Tags','tag','addApplications','transaction','sequelize','Transaction','MailApplication','bulkCreate','findAndCountAll','finally','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','true','List','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','attachments','root','server/files/attachments','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','Contacts','messageId','attach','out','Interaction','verifySmtp','Sequelize','ValidationError','addAgents','spread','removeAgents','isArray','emit','userMailAccount:remove','getAgents','moment','util','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','offset','undefined','limit','count','set','json','update'];(function(_0x3822aa,_0x4a2f52){var _0x43f60d=function(_0x1e3af5){while(--_0x1e3af5){_0x3822aa['push'](_0x3822aa['shift']());}};_0x43f60d(++_0x4a2f52);}(_0x4995,0x92));var _0x5499=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4995[_0x501510];return _0x1e6ee5;};'use strict';var moment=require(_0x5499('0x0'));var BPromise=require('bluebird');var util=require(_0x5499('0x1'));var path=require('path');var _=require(_0x5499('0x2'));var juice=require(_0x5499('0x3'));var Redis=require(_0x5499('0x4'));var qs=require(_0x5499('0x5'));var logger=require(_0x5499('0x6'))(_0x5499('0x7'));var config=require(_0x5499('0x8'));var db=require(_0x5499('0x9'))['db'];config[_0x5499('0xa')]=_[_0x5499('0xb')](config[_0x5499('0xa')],{'host':_0x5499('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailAccount.socket')[_0x5499('0xd')](socket);var jayson=require(_0x5499('0xe'));var client=jayson[_0x5499('0xf')]['http']({'port':0x232b});function respondWithRpcPromise(_0x547144,_0x35362f,_0x1adf6a,_0x3f1dfa){return new BPromise(function(_0x13a944,_0x996db6){var _0xa23e64=_0x3f1dfa||client;return _0xa23e64[_0x5499('0x10')](_0x547144,_0x1adf6a)['then'](function(_0xd7f55f){logger[_0x5499('0x11')](_0x5499('0x12'),_0x35362f,_0x5499('0x13'));logger[_0x5499('0x14')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x35362f,_0x5499('0x13'),JSON[_0x5499('0x15')](_0xd7f55f));if(_0xd7f55f[_0x5499('0x16')]){if(_0xd7f55f[_0x5499('0x16')][_0x5499('0x17')]===0x1f4){logger[_0x5499('0x16')](_0x5499('0x12'),_0x35362f,_0xd7f55f[_0x5499('0x16')][_0x5499('0x18')]);return _0x996db6(_0xd7f55f[_0x5499('0x16')][_0x5499('0x18')]);}logger['error'](_0x5499('0x12'),_0x35362f,_0xd7f55f[_0x5499('0x16')][_0x5499('0x18')]);return _0x13a944(_0xd7f55f[_0x5499('0x16')]['message']);}else{logger[_0x5499('0x11')]('MailAccount,\x20%s,\x20%s',_0x35362f,'request\x20sent');_0x13a944(_0xd7f55f[_0x5499('0x19')]['message']);}})[_0x5499('0x1a')](function(_0x334d2d){logger[_0x5499('0x16')](_0x5499('0x12'),_0x35362f,_0x334d2d);_0x996db6(_0x334d2d);});});}function respondWithStatusCode(_0x165d38,_0x1f5277){_0x1f5277=_0x1f5277||0xcc;return function(_0x588fe7){if(_0x588fe7){return _0x165d38['sendStatus'](_0x1f5277);}return _0x165d38[_0x5499('0x1b')](_0x1f5277)[_0x5499('0x1c')]();};}function respondWithResult(_0x1c2865,_0x5e662a){_0x5e662a=_0x5e662a||0xc8;return function(_0x4974e4){if(_0x4974e4){return _0x1c2865[_0x5499('0x1b')](_0x5e662a)['json'](_0x4974e4);}};}function respondWithFilteredResult(_0x5e4112,_0x4901eb){return function(_0x23e839){if(_0x23e839){var _0xd5979e=typeof _0x4901eb[_0x5499('0x1d')]===_0x5499('0x1e')&&typeof _0x4901eb[_0x5499('0x1f')]===_0x5499('0x1e');var _0x389f89=_0x23e839[_0x5499('0x20')];var _0x2e4831=_0xd5979e?0x0:_0x4901eb['offset'];var _0x57faed=_0xd5979e?_0x23e839[_0x5499('0x20')]:_0x4901eb[_0x5499('0x1d')]+_0x4901eb['limit'];var _0x20e695;if(_0x57faed>=_0x389f89){_0x57faed=_0x389f89;_0x20e695=0xc8;}else{_0x20e695=0xce;}_0x5e4112[_0x5499('0x1b')](_0x20e695);return _0x5e4112[_0x5499('0x21')]('Content-Range',_0x2e4831+'-'+_0x57faed+'/'+_0x389f89)[_0x5499('0x22')](_0x23e839);}return null;};}function saveUpdates(_0x499337){return function(_0x52a7b9){if(_0x52a7b9){return _0x52a7b9[_0x5499('0x23')](_0x499337)[_0x5499('0x24')](function(_0x1ea8ac){return _0x1ea8ac;});}return null;};}function removeEntity(_0x32bdbb){return function(_0x4830a4){if(_0x4830a4){return _0x4830a4['destroy']()[_0x5499('0x24')](function(){var _0x50ead5=_0x4830a4[_0x5499('0x25')]({'plain':!![]});var _0x2e33cf='MailAccounts';return db[_0x5499('0x26')][_0x5499('0x27')]({'where':{'type':_0x2e33cf,'resourceId':_0x50ead5['id']}})['then'](function(){return _0x4830a4;});})[_0x5499('0x24')](function(){_0x32bdbb['status'](0xcc)[_0x5499('0x1c')]();});}};}function handleEntityNotFound(_0x289570){return function(_0x5a75d7){if(!_0x5a75d7){_0x289570[_0x5499('0x28')](0x194);}return _0x5a75d7;};}function handleError(_0x10d7f0,_0x1f7798){_0x1f7798=_0x1f7798||0x1f4;return function(_0x76d6d8){logger[_0x5499('0x16')](_0x76d6d8[_0x5499('0x29')]);if(_0x76d6d8[_0x5499('0x2a')]){delete _0x76d6d8[_0x5499('0x2a')];}_0x10d7f0[_0x5499('0x1b')](_0x1f7798)[_0x5499('0x2b')](_0x76d6d8);};}function getImapHost(_0xdc9d79){switch(_0xdc9d79){case'gmail':return _0x5499('0x2c');case _0x5499('0x2d'):return'imap.mail.yahoo.com';case'hotmail':return _0x5499('0x2e');case _0x5499('0x2f'):return'outlook.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0xdc9d79);}function getSmtpHost(_0xf4bc38){switch(_0xf4bc38){case'gmail':return _0x5499('0x30');case _0x5499('0x2d'):return'smtp.mail.yahoo.com';case _0x5499('0x31'):return _0x5499('0x32');case _0x5499('0x2f'):return'smtp.office365.com';}throw new Error(_0x5499('0x33'),_0xf4bc38);}function getAuthenticationOptions(_0x2f3c7b,_0x51f0d1){var _0xc31aca={};var _0x44e53b={};if(_0x2f3c7b){_0xc31aca['user']=_0x44e53b[_0x5499('0x34')]=_0x51f0d1['username'];_0xc31aca['password']=_0x44e53b['pass']=_0x51f0d1[_0x5499('0x35')];if(_0x51f0d1[_0x5499('0x36')]){_0xc31aca[_0x5499('0x36')]=_0x44e53b[_0x5499('0x36')]=!![];_0xc31aca[_0x5499('0x37')]=_0x44e53b[_0x5499('0x37')]=_0x51f0d1[_0x5499('0x37')];_0xc31aca[_0x5499('0x35')]=_0x44e53b['pass']=null;}else{_0xc31aca['CloudProviderId']=_0x44e53b[_0x5499('0x37')]=null;}_0xc31aca['host']=getImapHost(_0x2f3c7b);_0xc31aca[_0x5499('0x38')]=0x3e1;_0x44e53b[_0x5499('0x39')]=getSmtpHost(_0x2f3c7b);_0x44e53b[_0x5499('0x38')]=0x24b;_0x44e53b[_0x5499('0x3a')]=![];_0xc31aca[_0x5499('0x3b')]=_0x44e53b[_0x5499('0x3b')]=null;}else{if(_0x51f0d1[_0x5499('0x3c')]){_0xc31aca['user']=_0x44e53b[_0x5499('0x34')]=_0x51f0d1['username'];_0xc31aca[_0x5499('0x35')]=_0x44e53b[_0x5499('0x3d')]=_0x51f0d1['password'];}else{_0xc31aca[_0x5499('0x3c')]=_0x44e53b[_0x5499('0x3c')]=![];_0xc31aca[_0x5499('0x34')]=_0x44e53b[_0x5499('0x34')]=null;_0xc31aca[_0x5499('0x35')]=_0x44e53b['pass']=null;}_0xc31aca['host']=_0x51f0d1[_0x5499('0x3e')]['host'];_0xc31aca[_0x5499('0x38')]=_0x51f0d1[_0x5499('0x3e')][_0x5499('0x38')];_0x44e53b['host']=_0x51f0d1[_0x5499('0x3f')][_0x5499('0x39')];_0x44e53b[_0x5499('0x38')]=_0x51f0d1['Smtp']['port'];}return{'Imap':_0xc31aca,'Smtp':_0x44e53b};}exports['index']=function(_0x362620,_0x3896eb){var _0x4d2fa4={'include':[{'model':db[_0x5499('0x40')],'as':_0x5499('0x3e')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x5499('0x41')],'as':'mandatoryDispositionPause'}]},_0x53a724={},_0x214aea={'count':0x0,'rows':[]};var _0x206146=_[_0x5499('0x42')](db[_0x5499('0x43')][_0x5499('0x44')],function(_0x52d7ae){return{'name':_0x52d7ae[_0x5499('0x45')],'type':_0x52d7ae['type'][_0x5499('0x46')]};});_0x53a724['model']=_[_0x5499('0x42')](_0x206146,_0x5499('0x2a'));_0x53a724['query']=_['keys'](_0x362620[_0x5499('0x47')]);_0x53a724['filters']=_['intersection'](_0x53a724['model'],_0x53a724[_0x5499('0x47')]);_0x4d2fa4[_0x5499('0x48')]=_[_0x5499('0x49')](_0x53a724[_0x5499('0x4a')],qs['fields'](_0x362620[_0x5499('0x47')][_0x5499('0x4b')]));_0x4d2fa4[_0x5499('0x48')]=_0x4d2fa4['attributes'][_0x5499('0x4c')]?_0x4d2fa4['attributes']:_0x53a724[_0x5499('0x4a')];if(!_0x362620[_0x5499('0x47')]['hasOwnProperty'](_0x5499('0x4d'))){_0x4d2fa4[_0x5499('0x1f')]=qs['limit'](_0x362620[_0x5499('0x47')][_0x5499('0x1f')]);_0x4d2fa4[_0x5499('0x1d')]=qs[_0x5499('0x1d')](_0x362620[_0x5499('0x47')][_0x5499('0x1d')]);}_0x4d2fa4[_0x5499('0x4e')]=qs['sort'](_0x362620[_0x5499('0x47')]['sort']);_0x4d2fa4[_0x5499('0x4f')]=qs[_0x5499('0x50')](_[_0x5499('0x51')](_0x362620['query'],_0x53a724[_0x5499('0x50')]),_0x206146);if(_0x362620[_0x5499('0x47')][_0x5499('0x52')]){_0x4d2fa4[_0x5499('0x4f')]=_[_0x5499('0x53')](_0x4d2fa4[_0x5499('0x4f')],{'$or':_['map'](_0x206146,function(_0x538bc4){if(_0x538bc4['type']!==_0x5499('0x54')){var _0x702b3e={};_0x702b3e[_0x538bc4[_0x5499('0x2a')]]={'$like':'%'+_0x362620['query'][_0x5499('0x52')]+'%'};return _0x702b3e;}})});}_0x4d2fa4=_[_0x5499('0x53')]({},_0x4d2fa4,_0x362620['options']);var _0x13f1f7={'where':_0x4d2fa4[_0x5499('0x4f')]};return db[_0x5499('0x43')]['count'](_0x13f1f7)[_0x5499('0x24')](function(_0x18560a){_0x214aea[_0x5499('0x20')]=_0x18560a;if(_0x362620[_0x5499('0x47')][_0x5499('0x55')]){_0x4d2fa4['include']=[{'all':!![]}];}return db[_0x5499('0x43')][_0x5499('0x56')](_0x4d2fa4);})['then'](function(_0x45cc9c){_0x214aea[_0x5499('0x57')]=_0x45cc9c;return _0x214aea;})[_0x5499('0x24')](respondWithFilteredResult(_0x3896eb,_0x4d2fa4))[_0x5499('0x1a')](handleError(_0x3896eb,null));};exports[_0x5499('0x58')]=function(_0x592024,_0x413612){var _0x49cfa4={'raw':![],'where':{'id':_0x592024[_0x5499('0x59')]['id']},'include':[{'model':db[_0x5499('0x40')],'as':'Imap'},{'model':db[_0x5499('0x5a')],'as':_0x5499('0x3f')},{'model':db[_0x5499('0x41')],'as':_0x5499('0x5b')}]},_0x4c8dd4={};_0x4c8dd4['model']=_[_0x5499('0x5c')](db[_0x5499('0x43')]['rawAttributes']);_0x4c8dd4[_0x5499('0x47')]=_[_0x5499('0x5c')](_0x592024[_0x5499('0x47')]);_0x4c8dd4[_0x5499('0x50')]=_['intersection'](_0x4c8dd4[_0x5499('0x4a')],_0x4c8dd4[_0x5499('0x47')]);_0x49cfa4[_0x5499('0x48')]=_[_0x5499('0x49')](_0x4c8dd4[_0x5499('0x4a')],qs[_0x5499('0x4b')](_0x592024[_0x5499('0x47')][_0x5499('0x4b')]));_0x49cfa4['attributes']=_0x49cfa4[_0x5499('0x48')]['length']?_0x49cfa4[_0x5499('0x48')]:_0x4c8dd4[_0x5499('0x4a')];if(_0x592024['query'][_0x5499('0x55')]){_0x49cfa4[_0x5499('0x5d')]=[{'all':!![]}];}_0x49cfa4=_[_0x5499('0x53')]({},_0x49cfa4,_0x592024['options']);return db['MailAccount'][_0x5499('0x5e')](_0x49cfa4)[_0x5499('0x24')](handleEntityNotFound(_0x413612,null))[_0x5499('0x24')](respondWithResult(_0x413612,null))[_0x5499('0x1a')](handleError(_0x413612,null));};exports['update']=function(_0x23f3ee,_0x168c74){if(_0x23f3ee['body']['id']){delete _0x23f3ee[_0x5499('0x5f')]['id'];}var _0x80b9ea=_0x23f3ee[_0x5499('0x5f')][_0x5499('0x60')]===_0x5499('0x61')?null:_0x23f3ee[_0x5499('0x5f')][_0x5499('0x60')];var _0x42eb9e=_0x23f3ee[_0x5499('0x5f')][_0x5499('0x3e')]||{};var _0x26109d=_0x23f3ee['body'][_0x5499('0x3f')]||{};if(_0x80b9ea){_0x42eb9e[_0x5499('0x39')]=getImapHost(_0x80b9ea);_0x42eb9e[_0x5499('0x38')]=0x3e1;_0x26109d[_0x5499('0x39')]=getSmtpHost(_0x80b9ea);_0x26109d[_0x5499('0x38')]=0x24b;_0x26109d[_0x5499('0x3a')]=![];}if(_0x26109d[_0x5499('0x36')]){_0x26109d[_0x5499('0x3a')]=![];}else{_0x26109d[_0x5499('0x37')]=null;}if(!_0x42eb9e[_0x5499('0x36')])_0x42eb9e[_0x5499('0x37')]=null;_0x23f3ee[_0x5499('0x5f')][_0x5499('0x3e')]=_0x42eb9e;_0x23f3ee[_0x5499('0x5f')][_0x5499('0x3f')]=_0x26109d;return db['MailAccount'][_0x5499('0x5e')]({'where':{'id':_0x23f3ee[_0x5499('0x59')]['id']},'include':[{'model':db[_0x5499('0x40')],'as':_0x5499('0x3e')},{'model':db[_0x5499('0x5a')],'as':_0x5499('0x3f')},{'model':db[_0x5499('0x41')],'as':_0x5499('0x5b')}]})['then'](handleEntityNotFound(_0x168c74,null))[_0x5499('0x24')](function(_0x3bc397){if(!_0x3bc397)throw new Error(_0x5499('0x62'));if(_0x3bc397['service'])delete _0x23f3ee[_0x5499('0x5f')][_0x5499('0x3e')];return _0x3bc397;})['then'](saveUpdates(_0x23f3ee[_0x5499('0x5f')],null))[_0x5499('0x24')](function(_0x11e499){if(!_0x23f3ee[_0x5499('0x5f')][_0x5499('0x3e')])return _0x11e499;return db['MailServerIn'][_0x5499('0x23')](_0x23f3ee[_0x5499('0x5f')][_0x5499('0x3e')],{'where':{'MailAccountId':_0x11e499['id']}})['then'](function(){return _0x11e499;});})[_0x5499('0x24')](function(_0x2262c4){if(!_0x23f3ee[_0x5499('0x5f')][_0x5499('0x3f')])return _0x2262c4;return db['MailServerOut'][_0x5499('0x23')](_0x23f3ee[_0x5499('0x5f')][_0x5499('0x3f')],{'where':{'MailAccountId':_0x2262c4['id']}})[_0x5499('0x24')](function(){return _0x2262c4;});})['then'](respondWithResult(_0x168c74,null))[_0x5499('0x1a')](handleError(_0x168c74,null));};exports[_0x5499('0x63')]=function(_0x4624d4,_0x412097){return db[_0x5499('0x43')]['describe']()[_0x5499('0x24')](respondWithResult(_0x412097,null))[_0x5499('0x1a')](handleError(_0x412097,null));};exports['addDisposition']=function(_0x3e527d,_0x11372f){if(_0x3e527d[_0x5499('0x5f')]['id']){delete _0x3e527d['body']['id'];}return db['MailAccount'][_0x5499('0x5e')]({'where':{'id':_0x3e527d[_0x5499('0x59')]['id']}})[_0x5499('0x24')](handleEntityNotFound(_0x11372f,null))[_0x5499('0x24')](function(_0x3d346d){if(_0x3d346d){_0x3e527d[_0x5499('0x5f')][_0x5499('0x64')]=_0x3d346d['id'];return db[_0x5499('0x65')][_0x5499('0x66')](_0x3e527d['body']);}})['then'](respondWithResult(_0x11372f,null))[_0x5499('0x1a')](handleError(_0x11372f,null));};exports[_0x5499('0x67')]=function(_0x5e6c4b,_0x2920b7){var _0x22800e={'raw':![],'where':{}};var _0x5ba9e8={};var _0x11f242={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x5e6c4b[_0x5499('0x59')]['id']}})[_0x5499('0x24')](handleEntityNotFound(_0x2920b7,null))[_0x5499('0x24')](function(_0xe17588){if(_0xe17588){_0x5ba9e8['model']=_[_0x5499('0x5c')](db['Disposition']['rawAttributes']);_0x5ba9e8[_0x5499('0x47')]=_['keys'](_0x5e6c4b[_0x5499('0x47')]);_0x5ba9e8[_0x5499('0x50')]=_[_0x5499('0x49')](_0x5ba9e8[_0x5499('0x4a')],_0x5ba9e8[_0x5499('0x47')]);_0x22800e[_0x5499('0x48')]=_[_0x5499('0x49')](_0x5ba9e8[_0x5499('0x4a')],qs[_0x5499('0x4b')](_0x5e6c4b['query'][_0x5499('0x4b')]));_0x22800e['attributes']=_0x22800e[_0x5499('0x48')][_0x5499('0x4c')]?_0x22800e[_0x5499('0x48')]:_0x5ba9e8[_0x5499('0x4a')];if(!_0x5e6c4b[_0x5499('0x47')][_0x5499('0x68')](_0x5499('0x4d'))){_0x22800e['limit']=qs[_0x5499('0x1f')](_0x5e6c4b[_0x5499('0x47')][_0x5499('0x1f')]);_0x22800e[_0x5499('0x1d')]=qs['offset'](_0x5e6c4b['query']['offset']);}_0x22800e[_0x5499('0x4e')]=qs[_0x5499('0x69')](_0x5e6c4b['query']['sort']);_0x22800e['where']=qs[_0x5499('0x50')](_['pick'](_0x5e6c4b['query'],_0x5ba9e8[_0x5499('0x50')]));_0x22800e['where'][_0x5499('0x64')]=_0xe17588['id'];if(_0x5e6c4b[_0x5499('0x47')]['filter']){_0x22800e[_0x5499('0x4f')]=_['merge'](_0x22800e[_0x5499('0x4f')],{'$or':_['map'](_0x22800e['attributes'],function(_0x1e8236){var _0x578722={};_0x578722[_0x1e8236]={'$like':'%'+_0x5e6c4b[_0x5499('0x47')][_0x5499('0x52')]+'%'};return _0x578722;})});}_0x22800e=_['merge']({},_0x22800e,_0x5e6c4b[_0x5499('0x6a')]);return db[_0x5499('0x65')][_0x5499('0x20')]({'where':_0x22800e[_0x5499('0x4f')]})[_0x5499('0x24')](function(_0x3b3f78){_0x11f242[_0x5499('0x20')]=_0x3b3f78;if(_0x5e6c4b[_0x5499('0x47')][_0x5499('0x55')]){_0x22800e['include']=[{'all':!![]}];}return db[_0x5499('0x65')][_0x5499('0x56')](_0x22800e);})[_0x5499('0x24')](function(_0x10da97){_0x11f242['rows']=_0x10da97;return _0x11f242;});}})[_0x5499('0x24')](respondWithFilteredResult(_0x2920b7,_0x22800e))[_0x5499('0x1a')](handleError(_0x2920b7,null));};exports[_0x5499('0x6b')]=function(_0xfd43d5,_0x322e9c){return db[_0x5499('0x43')][_0x5499('0x5e')]({'where':{'id':_0xfd43d5['params']['id']}})[_0x5499('0x24')](handleEntityNotFound(_0x322e9c,null))[_0x5499('0x24')](function(_0x4b94bb){if(_0x4b94bb){return _0x4b94bb['removeDispositions'](_0xfd43d5[_0x5499('0x47')][_0x5499('0x6c')]);}})[_0x5499('0x24')](respondWithStatusCode(_0x322e9c,null))[_0x5499('0x1a')](handleError(_0x322e9c,null));};exports['addAnswer']=function(_0x52f883,_0x45314a){if(_0x52f883['body']['id']){delete _0x52f883['body']['id'];}return db[_0x5499('0x43')][_0x5499('0x5e')]({'where':{'id':_0x52f883[_0x5499('0x59')]['id']}})[_0x5499('0x24')](handleEntityNotFound(_0x45314a,null))['then'](function(_0x58a090){if(_0x58a090){_0x52f883[_0x5499('0x5f')][_0x5499('0x64')]=_0x58a090['id'];return db['CannedAnswer'][_0x5499('0x66')](_0x52f883[_0x5499('0x5f')]);}})[_0x5499('0x24')](respondWithResult(_0x45314a,null))[_0x5499('0x1a')](handleError(_0x45314a,null));};exports['getAnswers']=function(_0x32f485,_0x56742f){var _0x436132={'raw':![],'where':{}};var _0x12f2cd={};var _0x180ecb={'count':0x0,'rows':[]};return db[_0x5499('0x43')]['findOne']({'where':{'id':_0x32f485[_0x5499('0x59')]['id']}})['then'](handleEntityNotFound(_0x56742f,null))[_0x5499('0x24')](function(_0x15f3d9){if(_0x15f3d9){_0x12f2cd['model']=_[_0x5499('0x5c')](db[_0x5499('0x6d')]['rawAttributes']);_0x12f2cd[_0x5499('0x47')]=_[_0x5499('0x5c')](_0x32f485['query']);_0x12f2cd[_0x5499('0x50')]=_[_0x5499('0x49')](_0x12f2cd['model'],_0x12f2cd[_0x5499('0x47')]);_0x436132['attributes']=_[_0x5499('0x49')](_0x12f2cd['model'],qs[_0x5499('0x4b')](_0x32f485['query'][_0x5499('0x4b')]));_0x436132[_0x5499('0x48')]=_0x436132[_0x5499('0x48')][_0x5499('0x4c')]?_0x436132[_0x5499('0x48')]:_0x12f2cd[_0x5499('0x4a')];if(!_0x32f485[_0x5499('0x47')][_0x5499('0x68')](_0x5499('0x4d'))){_0x436132[_0x5499('0x1f')]=qs[_0x5499('0x1f')](_0x32f485[_0x5499('0x47')][_0x5499('0x1f')]);_0x436132[_0x5499('0x1d')]=qs['offset'](_0x32f485['query'][_0x5499('0x1d')]);}_0x436132[_0x5499('0x4e')]=qs['sort'](_0x32f485['query'][_0x5499('0x69')]);_0x436132[_0x5499('0x4f')]=qs[_0x5499('0x50')](_['pick'](_0x32f485[_0x5499('0x47')],_0x12f2cd[_0x5499('0x50')]));_0x436132['where'][_0x5499('0x64')]=_0x15f3d9['id'];if(_0x32f485[_0x5499('0x47')][_0x5499('0x52')]){_0x436132[_0x5499('0x4f')]=_[_0x5499('0x53')](_0x436132[_0x5499('0x4f')],{'$or':_['map'](_0x436132[_0x5499('0x48')],function(_0x53c0d0){var _0x2ca69b={};_0x2ca69b[_0x53c0d0]={'$like':'%'+_0x32f485[_0x5499('0x47')][_0x5499('0x52')]+'%'};return _0x2ca69b;})});}_0x436132=_[_0x5499('0x53')]({},_0x436132,_0x32f485[_0x5499('0x6a')]);return db[_0x5499('0x6d')][_0x5499('0x20')]({'where':_0x436132[_0x5499('0x4f')]})['then'](function(_0x39bdff){_0x180ecb[_0x5499('0x20')]=_0x39bdff;if(_0x32f485['query'][_0x5499('0x55')]){_0x436132[_0x5499('0x5d')]=[{'all':!![]}];}return db['CannedAnswer'][_0x5499('0x56')](_0x436132);})[_0x5499('0x24')](function(_0x595ac2){_0x180ecb[_0x5499('0x57')]=_0x595ac2;return _0x180ecb;});}})[_0x5499('0x24')](respondWithFilteredResult(_0x56742f,_0x436132))[_0x5499('0x1a')](handleError(_0x56742f,null));};exports[_0x5499('0x6e')]=function(_0x1f526b,_0x1b1571){return db[_0x5499('0x43')][_0x5499('0x5e')]({'where':{'id':_0x1f526b[_0x5499('0x59')]['id']}})['then'](handleEntityNotFound(_0x1b1571,null))[_0x5499('0x24')](function(_0x215dcb){if(_0x215dcb){return _0x215dcb[_0x5499('0x6e')](_0x1f526b[_0x5499('0x47')]['ids']);}})[_0x5499('0x24')](respondWithStatusCode(_0x1b1571,null))[_0x5499('0x1a')](handleError(_0x1b1571,null));};exports[_0x5499('0x66')]=function(_0x5606b6,_0x4c760a){var _0x22d362={'name':_0x5606b6[_0x5499('0x5f')][_0x5499('0x2a')],'key':_0x5606b6[_0x5499('0x5f')][_0x5499('0x46')],'provider':_0x5606b6['body'][_0x5499('0x60')]===_0x5499('0x61')?null:_0x5606b6[_0x5499('0x5f')][_0x5499('0x60')],'email':_0x5606b6[_0x5499('0x5f')][_0x5499('0x6f')],'ListId':_0x5606b6[_0x5499('0x5f')][_0x5499('0x70')],'active':!_['isNil'](_0x5606b6['body'][_0x5499('0x71')])?_0x5606b6['body'][_0x5499('0x71')]:!![],'description':_0x5606b6[_0x5499('0x5f')][_0x5499('0x72')]||null};var _0x292b77=getAuthenticationOptions(_0x22d362['provider'],_0x5606b6['body']);_0x22d362[_0x5499('0x3e')]=_0x292b77[_0x5499('0x3e')];_0x22d362[_0x5499('0x3f')]=_0x292b77['Smtp'];return db[_0x5499('0x43')]['create'](_0x22d362,{'include':[{'model':db['MailServerOut'],'as':_0x5499('0x3f')},{'model':db[_0x5499('0x40')],'as':_0x5499('0x3e')}]})[_0x5499('0x24')](function(_0x19af18){var _0x47b5fe=_0x5606b6[_0x5499('0x34')][_0x5499('0x25')]({'plain':!![]});if(!_0x47b5fe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47b5fe['role']===_0x5499('0x34')){var _0x3952c1=_0x19af18[_0x5499('0x25')]({'plain':!![]});return db[_0x5499('0x73')][_0x5499('0x5e')]({'where':{'name':_0x5499('0x74'),'userProfileId':_0x47b5fe[_0x5499('0x75')]},'raw':!![]})['then'](function(_0x322892){if(_0x322892&&_0x322892[_0x5499('0x76')]===0x0){return db[_0x5499('0x26')][_0x5499('0x66')]({'name':_0x3952c1[_0x5499('0x2a')],'resourceId':_0x3952c1['id'],'type':_0x322892[_0x5499('0x2a')],'sectionId':_0x322892['id']},{})['then'](function(){return _0x19af18;});}else{return _0x19af18;}})['catch'](function(_0x14d256){logger[_0x5499('0x16')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14d256);throw _0x14d256;});}return _0x19af18;})[_0x5499('0x24')](respondWithResult(_0x4c760a,0xc9))[_0x5499('0x1a')](handleError(_0x4c760a,null));};exports[_0x5499('0x77')]=function(_0x1dbca4,_0x3f20f5){return db[_0x5499('0x43')]['findOne']({'where':{'id':_0x1dbca4[_0x5499('0x59')]['id']}})['then'](handleEntityNotFound(_0x3f20f5,null))[_0x5499('0x24')](function(_0x2d6665){if(_0x2d6665){return _0x2d6665[_0x5499('0x77')]();}return null;})[_0x5499('0x24')](respondWithResult(_0x3f20f5,null))[_0x5499('0x1a')](handleError(_0x3f20f5,null));};exports[_0x5499('0x78')]=function(_0x380fc5,_0x372555){if(_0x380fc5[_0x5499('0x5f')]['id']){delete _0x380fc5['body']['id'];}return db[_0x5499('0x43')][_0x5499('0x5e')]({'where':{'id':_0x380fc5[_0x5499('0x59')]['id']}})[_0x5499('0x24')](handleEntityNotFound(_0x372555,null))['then'](function(_0x50c7cf){if(_0x50c7cf){_0x380fc5[_0x5499('0x5f')][_0x5499('0x64')]=_0x50c7cf['id'];return db['MailServerIn'][_0x5499('0x66')](_0x380fc5[_0x5499('0x5f')]);}})[_0x5499('0x24')](respondWithResult(_0x372555,null))[_0x5499('0x1a')](handleError(_0x372555,null));};exports[_0x5499('0x79')]=function(_0x4700e5,_0x4f3ec9){return db[_0x5499('0x43')]['findOne']({'where':{'id':_0x4700e5[_0x5499('0x59')]['id']}})[_0x5499('0x24')](handleEntityNotFound(_0x4f3ec9,null))[_0x5499('0x24')](function(_0x4b2e14){if(_0x4b2e14){return _0x4b2e14[_0x5499('0x7a')](null);}return null;})['then'](respondWithStatusCode(_0x4f3ec9,null))['catch'](handleError(_0x4f3ec9,null));};exports['getSmtp']=function(_0x525f80,_0x50e33b){return db[_0x5499('0x43')][_0x5499('0x7b')]({'where':{'id':_0x525f80[_0x5499('0x59')]['id']}})[_0x5499('0x24')](handleEntityNotFound(_0x50e33b,null))[_0x5499('0x24')](function(_0x378899){if(_0x378899){return _0x378899['getSmtp']();}return null;})[_0x5499('0x24')](respondWithResult(_0x50e33b,null))['catch'](handleError(_0x50e33b,null));};exports['addSmtp']=function(_0x400c9d,_0xb73725){if(_0x400c9d[_0x5499('0x5f')]['id']){delete _0x400c9d['body']['id'];}return db[_0x5499('0x43')][_0x5499('0x5e')]({'where':{'id':_0x400c9d['params']['id']}})[_0x5499('0x24')](handleEntityNotFound(_0xb73725,null))[_0x5499('0x24')](function(_0x46079d){if(_0x46079d){_0x400c9d[_0x5499('0x5f')]['MailAccountId']=_0x46079d['id'];return db[_0x5499('0x5a')][_0x5499('0x66')](_0x400c9d[_0x5499('0x5f')]);}})[_0x5499('0x24')](respondWithResult(_0xb73725,null))[_0x5499('0x1a')](handleError(_0xb73725,null));};exports[_0x5499('0x7c')]=function(_0x221aff,_0x189682){return db[_0x5499('0x43')][_0x5499('0x7b')]({'where':{'id':_0x221aff[_0x5499('0x59')]['id']}})[_0x5499('0x24')](handleEntityNotFound(_0x189682,null))[_0x5499('0x24')](function(_0x3c1848){if(_0x3c1848){return _0x3c1848[_0x5499('0x7d')](null);}return null;})[_0x5499('0x24')](respondWithStatusCode(_0x189682,null))[_0x5499('0x1a')](handleError(_0x189682,null));};exports['addInteraction']=function(_0x3b5cfd,_0x6e0df3){return db[_0x5499('0x7e')]['find']({'where':{'id':_0x3b5cfd[_0x5499('0x59')]['id']}})[_0x5499('0x24')](handleEntityNotFound(_0x6e0df3,null))[_0x5499('0x24')](function(_0x5a89a5){if(_0x5a89a5){return _0x5a89a5[_0x5499('0x7f')](_0x3b5cfd[_0x5499('0x5f')][_0x5499('0x6c')],_[_0x5499('0x80')](_0x3b5cfd[_0x5499('0x5f')],[_0x5499('0x6c'),'id'])||{});}})[_0x5499('0x24')](respondWithResult(_0x6e0df3,null))[_0x5499('0x1a')](handleError(_0x6e0df3,null));};exports[_0x5499('0x81')]=function(_0x272e48,_0x5336a3){var _0x3708f0={'raw':![],'where':{}};var _0x120abd={};var _0x3fab27={'count':0x0,'rows':[]};return db[_0x5499('0x43')]['findOne']({'where':{'id':_0x272e48['params']['id']}})[_0x5499('0x24')](handleEntityNotFound(_0x5336a3,null))['then'](function(_0xeae848){if(_0xeae848){_0x120abd[_0x5499('0x4a')]=_['keys'](db[_0x5499('0x7e')]['rawAttributes']);_0x120abd['query']=_[_0x5499('0x5c')](_0x272e48[_0x5499('0x47')]);_0x120abd[_0x5499('0x50')]=_[_0x5499('0x49')](_0x120abd[_0x5499('0x4a')],_0x120abd['query']);_0x3708f0[_0x5499('0x48')]=_[_0x5499('0x49')](_0x120abd[_0x5499('0x4a')],qs[_0x5499('0x4b')](_0x272e48[_0x5499('0x47')][_0x5499('0x4b')]));_0x3708f0[_0x5499('0x48')]=_0x3708f0[_0x5499('0x48')][_0x5499('0x4c')]?_0x3708f0[_0x5499('0x48')]:_0x120abd[_0x5499('0x4a')];if(!_0x272e48[_0x5499('0x47')][_0x5499('0x68')](_0x5499('0x4d'))){_0x3708f0[_0x5499('0x1f')]=qs[_0x5499('0x1f')](_0x272e48[_0x5499('0x47')][_0x5499('0x1f')]);_0x3708f0[_0x5499('0x1d')]=qs[_0x5499('0x1d')](_0x272e48[_0x5499('0x47')]['offset']);}_0x3708f0[_0x5499('0x4e')]=qs[_0x5499('0x69')](_0x272e48[_0x5499('0x47')]['sort']);_0x3708f0[_0x5499('0x4f')]=qs[_0x5499('0x50')](_[_0x5499('0x51')](_0x272e48['query'],_0x120abd['filters']));_0x3708f0['where']['MailAccountId']=_0xeae848['id'];if(_0x272e48[_0x5499('0x47')][_0x5499('0x52')]){_0x3708f0['where']=_[_0x5499('0x53')](_0x3708f0[_0x5499('0x4f')],{'$or':_[_0x5499('0x42')](_0x3708f0[_0x5499('0x48')],function(_0x2c45dd){var _0x3ec88e={};_0x3ec88e[_0x2c45dd]={'$like':'%'+_0x272e48[_0x5499('0x47')][_0x5499('0x52')]+'%'};return _0x3ec88e;})});}_0x3708f0=_[_0x5499('0x53')]({},_0x3708f0,_0x272e48[_0x5499('0x6a')]);return db['MailInteraction'][_0x5499('0x20')]({'where':_0x3708f0['where']})[_0x5499('0x24')](function(_0x4eb5e5){_0x3fab27[_0x5499('0x20')]=_0x4eb5e5;if(_0x272e48[_0x5499('0x47')]['includeAll']){_0x3708f0[_0x5499('0x5d')]=[{'model':db[_0x5499('0x82')],'as':_0x5499('0x83'),'required':![]},{'model':db['User'],'as':_0x5499('0x84'),'attributes':['name','fullname',_0x5499('0x85')],'required':![]},{'model':db[_0x5499('0x86')],'as':_0x5499('0x87'),'attributes':['id',_0x5499('0x2a'),'color'],'where':_0x272e48[_0x5499('0x47')][_0x5499('0x88')]?{'id':_0x272e48[_0x5499('0x47')][_0x5499('0x88')]}:undefined,'required':_0x272e48[_0x5499('0x47')][_0x5499('0x88')]?!![]:![]}];}return db[_0x5499('0x7e')][_0x5499('0x56')](_0x3708f0);})['then'](function(_0x5c4ed6){_0x3fab27[_0x5499('0x57')]=_0x5c4ed6;return _0x3fab27;});}})['then'](respondWithFilteredResult(_0x5336a3,_0x3708f0))[_0x5499('0x1a')](handleError(_0x5336a3,null));};exports[_0x5499('0x89')]=function addApplications(_0x3779cc,_0xc9757e){var _0x1fa558=_0x3779cc[_0x5499('0x59')]['id'];var _0x218456=_0x3779cc[_0x5499('0x5f')];var _0x39718f=0xc8;var _0x249db6=null;return db['sequelize'][_0x5499('0x8a')]({'isolationLevel':db[_0x5499('0x8b')][_0x5499('0x8c')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x56d944){return db[_0x5499('0x43')][_0x5499('0x7b')]({'where':{'id':_0x1fa558},'transaction':_0x56d944})[_0x5499('0x24')](function(_0x516e26){if(_0x516e26){return db[_0x5499('0x8d')][_0x5499('0x27')]({'where':{'MailAccountId':_0x1fa558},'transaction':_0x56d944})[_0x5499('0x24')](function(){var _0x53270b=_[_0x5499('0x42')](_0x218456,function(_0x581116){_0x581116[_0x5499('0x64')]=_0x1fa558;return _0x581116;});return db[_0x5499('0x8d')][_0x5499('0x8e')](_0x53270b,{'transaction':_0x56d944});});}else{_0x39718f=0x194;_0x249db6=[];}});})['then'](function(){if(_0x39718f!==0x194){return db[_0x5499('0x8d')][_0x5499('0x8f')]({'where':{'MailAccountId':_0x1fa558},'order':'priority'})[_0x5499('0x24')](function(_0x16ac31){_0x249db6=_0x16ac31;});}})['catch'](function(_0x22c986){_0x39718f=0x1f4;logger[_0x5499('0x16')](_0x22c986[_0x5499('0x29')]);if(_0x22c986[_0x5499('0x2a')]){delete _0x22c986[_0x5499('0x2a')];}_0x249db6=_0x22c986;})[_0x5499('0x90')](function(){if(_0x249db6===null){_0xc9757e[_0x5499('0x28')](_0x39718f);}else{if(_0x39718f===0x1f4){_0xc9757e[_0x5499('0x1b')](_0x39718f)['send'](_0x249db6);}else{_0xc9757e['status'](_0x39718f)[_0x5499('0x22')](_0x249db6);}}});};exports[_0x5499('0x91')]=function(_0x30d096,_0x4cce33){var _0x27fa33={};var _0x4dbc02={};var _0x153c36;var _0x426a46;return db[_0x5499('0x43')][_0x5499('0x7b')]({'where':{'id':_0x30d096['params']['id']}})[_0x5499('0x24')](handleEntityNotFound(_0x4cce33,null))[_0x5499('0x24')](function(_0x4d45d5){if(_0x4d45d5){_0x153c36=_0x4d45d5;_0x4dbc02['model']=_[_0x5499('0x5c')](db['MailApplication'][_0x5499('0x44')]);_0x4dbc02[_0x5499('0x47')]=_[_0x5499('0x5c')](_0x30d096[_0x5499('0x47')]);_0x4dbc02[_0x5499('0x50')]=_[_0x5499('0x49')](_0x4dbc02[_0x5499('0x4a')],_0x4dbc02[_0x5499('0x47')]);_0x27fa33[_0x5499('0x48')]=_['intersection'](_0x4dbc02['model'],qs['fields'](_0x30d096[_0x5499('0x47')][_0x5499('0x4b')]));_0x27fa33[_0x5499('0x48')]=_0x27fa33[_0x5499('0x48')][_0x5499('0x4c')]?_0x27fa33[_0x5499('0x48')]:_0x4dbc02[_0x5499('0x4a')];_0x27fa33[_0x5499('0x4e')]=qs[_0x5499('0x69')](_0x30d096[_0x5499('0x47')][_0x5499('0x69')]);_0x27fa33[_0x5499('0x4f')]=qs[_0x5499('0x50')](_[_0x5499('0x51')](_0x30d096[_0x5499('0x47')],_0x4dbc02['filters']));if(_0x30d096[_0x5499('0x47')][_0x5499('0x52')]){_0x27fa33[_0x5499('0x4f')]=_[_0x5499('0x53')](_0x27fa33[_0x5499('0x4f')],{'$or':_[_0x5499('0x42')](_0x27fa33['attributes'],function(_0x249ab0){var _0x54c719={};_0x54c719[_0x249ab0]={'$like':'%'+_0x30d096[_0x5499('0x47')][_0x5499('0x52')]+'%'};return _0x54c719;})});}_0x27fa33=_[_0x5499('0x53')]({},_0x27fa33,_0x30d096['options']);return _0x153c36[_0x5499('0x91')](_0x27fa33);}})[_0x5499('0x24')](function(_0x2eb83e){if(_0x2eb83e){_0x426a46=_0x2eb83e[_0x5499('0x4c')];if(!_0x30d096[_0x5499('0x47')][_0x5499('0x68')](_0x5499('0x4d'))){_0x27fa33[_0x5499('0x1f')]=qs[_0x5499('0x1f')](_0x30d096['query'][_0x5499('0x1f')]);_0x27fa33[_0x5499('0x1d')]=qs['offset'](_0x30d096['query'][_0x5499('0x1d')]);}return _0x153c36['getApplications'](_0x27fa33);}})[_0x5499('0x24')](function(_0x20ecbd){if(_0x20ecbd){return _0x20ecbd?{'count':_0x426a46,'rows':_0x20ecbd}:null;}})[_0x5499('0x24')](respondWithResult(_0x4cce33,null))[_0x5499('0x1a')](handleError(_0x4cce33,null));};exports[_0x5499('0x92')]=function(_0x38a8b9,_0x2cd2ef){var _0xe4ffec={'raw':!![],'where':{}};var _0x5a2f11={};var _0x58483d={'count':0x0,'rows':[]};return db[_0x5499('0x43')]['findOne']({'where':{'id':_0x38a8b9[_0x5499('0x59')]['id']}})[_0x5499('0x24')](handleEntityNotFound(_0x2cd2ef,null))[_0x5499('0x24')](function(_0x4423a1){if(_0x4423a1){_0x5a2f11['model']=_['keys'](db[_0x5499('0x93')]['rawAttributes']);_0x5a2f11[_0x5499('0x47')]=_['keys'](_0x38a8b9[_0x5499('0x47')]);_0x5a2f11['filters']=_[_0x5499('0x49')](_0x5a2f11[_0x5499('0x4a')],_0x5a2f11[_0x5499('0x47')]);_0xe4ffec[_0x5499('0x48')]=_[_0x5499('0x49')](_0x5a2f11[_0x5499('0x4a')],qs['fields'](_0x38a8b9['query'][_0x5499('0x4b')]));_0xe4ffec[_0x5499('0x48')]=_0xe4ffec['attributes'][_0x5499('0x4c')]?_0xe4ffec[_0x5499('0x48')]:_0x5a2f11[_0x5499('0x4a')];if(!_0x38a8b9['query']['hasOwnProperty'](_0x5499('0x4d'))){_0xe4ffec[_0x5499('0x1f')]=qs[_0x5499('0x1f')](_0x38a8b9[_0x5499('0x47')][_0x5499('0x1f')]);_0xe4ffec[_0x5499('0x1d')]=qs[_0x5499('0x1d')](_0x38a8b9['query']['offset']);}_0xe4ffec[_0x5499('0x4e')]=qs[_0x5499('0x69')](_0x38a8b9[_0x5499('0x47')][_0x5499('0x69')]);_0xe4ffec[_0x5499('0x4f')]=qs[_0x5499('0x50')](_['pick'](_0x38a8b9['query'],_0x5a2f11[_0x5499('0x50')]));_0xe4ffec[_0x5499('0x4f')][_0x5499('0x64')]=_0x4423a1['id'];if(_0x38a8b9[_0x5499('0x47')][_0x5499('0x52')]){_0xe4ffec[_0x5499('0x4f')]=_['merge'](_0xe4ffec[_0x5499('0x4f')],{'$or':_[_0x5499('0x42')](_0xe4ffec[_0x5499('0x48')],function(_0x317bd1){var _0x32a642={};_0x32a642[_0x317bd1]={'$like':'%'+_0x38a8b9[_0x5499('0x47')]['filter']+'%'};return _0x32a642;})});}if(_0x38a8b9[_0x5499('0x47')][_0x5499('0x94')]){var _0x49252c=_0x38a8b9[_0x5499('0x47')][_0x5499('0x94')][_0x5499('0x95')](',');var _0x153317={};_0x153317[_0x49252c[0x0]]={'$gte':moment(_0x49252c[0x1])[_0x5499('0x96')](_0x5499('0x97'))};_0xe4ffec[_0x5499('0x4f')]=_[_0x5499('0x53')](_0xe4ffec[_0x5499('0x4f')],_0x153317);}_0xe4ffec=_['merge']({},_0xe4ffec,_0x38a8b9[_0x5499('0x6a')]);return db[_0x5499('0x93')][_0x5499('0x20')]({'where':_0xe4ffec[_0x5499('0x4f')]})['then'](function(_0x111292){_0x58483d['count']=_0x111292;if(_0x38a8b9[_0x5499('0x47')]['includeAll']){_0xe4ffec['include']=[{'all':!![]}];}return db[_0x5499('0x93')][_0x5499('0x56')](_0xe4ffec);})[_0x5499('0x24')](function(_0x5d55ec){if(_0x38a8b9[_0x5499('0x47')]['inlineCss']===_0x5499('0x98')){for(var _0x5c1db6=0x0;_0x5c1db6<_0x5d55ec['length'];_0x5c1db6++){_0x5d55ec[_0x5c1db6][_0x5499('0x5f')]=juice(_0x5d55ec[_0x5c1db6][_0x5499('0x5f')]);}}_0x58483d['rows']=_0x5d55ec;return _0x58483d;});}})[_0x5499('0x24')](respondWithFilteredResult(_0x2cd2ef,_0xe4ffec))[_0x5499('0x1a')](handleError(_0x2cd2ef,null));};exports[_0x5499('0x2b')]=function(_0x600f73,_0x4f00e4){var _0x4d28ba,_0x47758a={},_0x2afa5c;if(_0x600f73[_0x5499('0x5f')]['to']){_0x2afa5c=_0x600f73[_0x5499('0x5f')]['to'][_0x5499('0x95')](',')[0x0];}return db['MailAccount'][_0x5499('0x5e')]({'where':{'id':_0x600f73['params']['id']},'include':[{'model':db['CmList'],'as':_0x5499('0x99'),'include':[{'model':db[_0x5499('0x82')],'as':'Contacts','where':{'email':_0x2afa5c},'limit':0x1,'order':[[_0x5499('0x9a'),_0x5499('0x9b')]]}]},{'model':db[_0x5499('0x5a')],'as':_0x5499('0x3f'),'raw':!![],'include':[{'model':db[_0x5499('0x9c')],'as':_0x5499('0x9c'),'raw':!![]}]}]})[_0x5499('0x24')](handleEntityNotFound(_0x4f00e4,null))[_0x5499('0x24')](function(_0x3078e8){if(!_0x3078e8)return;_0x4d28ba=_0x3078e8;if(!_0x3078e8[_0x5499('0x3f')])throw new Error(_0x5499('0x9d'));if(_[_0x5499('0x9e')](_0x600f73[_0x5499('0x5f')][_0x5499('0x9f')])){_0x600f73[_0x5499('0x5f')][_0x5499('0x9f')]=util[_0x5499('0x96')]('%s\x20<%s>',_0x3078e8[_0x5499('0x2a')],_0x3078e8[_0x5499('0x6f')]||_0x3078e8[_0x5499('0x3f')][_0x5499('0x34')]);}if(_0x600f73[_0x5499('0x5f')][_0x5499('0xa0')]&&_0x600f73['body'][_0x5499('0xa0')]['length']){for(var _0x3e399a=0x0;_0x3e399a<_0x600f73[_0x5499('0x5f')]['attachments'][_0x5499('0x4c')];_0x3e399a+=0x1){_0x600f73[_0x5499('0x5f')][_0x5499('0xa0')][_0x3e399a]={'filename':_0x600f73[_0x5499('0x5f')]['attachments'][_0x3e399a]['name'],'path':path['join'](config[_0x5499('0xa1')],_0x5499('0xa2'),_0x600f73['body'][_0x5499('0xa0')][_0x3e399a]['basename'])};}}var _0x2c80e6=_0x3078e8[_0x5499('0xa3')]();return respondWithRpcPromise(_0x5499('0xa4'),_0x5499('0xa5'),{'account':_0x2c80e6,'message':_0x600f73['body']});})[_0x5499('0x24')](function(_0x57fb10){if(!_0x57fb10)return;_0x47758a=_0x57fb10;if(!_0x4d28ba['List'])throw new Error(_0x5499('0xa6'));if(_0x4d28ba[_0x5499('0x99')][_0x5499('0xa7')][_0x5499('0x4c')])return _0x4d28ba[_0x5499('0x99')][_0x5499('0xa7')][0x0];return db[_0x5499('0x82')][_0x5499('0x66')](_[_0x5499('0xb')](_0x600f73[_0x5499('0x5f')],{'firstName':_0x600f73[_0x5499('0x5f')]['to'],'email':_0x600f73[_0x5499('0x5f')]['to'],'phone':_0x600f73['body']['to'],'ListId':_0x4d28ba[_0x5499('0x70')]}));})[_0x5499('0x24')](function(_0x120758){if(!_0x120758)return;var _0x1f61e2={'UserId':_0x600f73['user']['id'],'ContactId':_0x120758['id'],'MailAccountId':_0x4d28ba['id'],'inReplyTo':_0x47758a[_0x5499('0xa8')],'to':_0x600f73[_0x5499('0x5f')][_0x5499('0x9f')],'cc':_0x600f73[_0x5499('0x5f')]['cc'],'subject':_0x600f73[_0x5499('0x5f')]['subject'],'attach':_0x600f73[_0x5499('0x5f')][_0x5499('0xa9')],'firstMsgDirection':'out','lastMsgAt':moment()['format'](_0x5499('0x97')),'lastMsgDirection':_0x5499('0xaa'),'Messages':[_[_0x5499('0x53')](_0x600f73['body'],{'messageId':_0x47758a[_0x5499('0xa8')],'sentAt':moment()[_0x5499('0x96')](_0x5499('0x97')),'read':!![],'MailAccountId':_0x4d28ba['id'],'UserId':_0x600f73[_0x5499('0x34')]['id'],'ContactId':_0x120758['id']})]};if(_0x600f73[_0x5499('0x5f')][_0x5499('0xab')]){_0x1f61e2=_['merge'](_0x1f61e2,_0x600f73[_0x5499('0x5f')][_0x5499('0xab')]);}return db[_0x5499('0x7e')][_0x5499('0x66')](_0x1f61e2,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});})[_0x5499('0x24')](respondWithResult(_0x4f00e4,null))[_0x5499('0x1a')](handleError(_0x4f00e4,null));};exports[_0x5499('0xac')]=function(_0x286424,_0x51f000){return db[_0x5499('0x43')][_0x5499('0x5e')]({'where':{'id':_0x286424[_0x5499('0x59')]['id']},'include':[{'model':db[_0x5499('0x5a')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x5499('0x9c')],'as':_0x5499('0x9c'),'raw':!![]}]}]})[_0x5499('0x24')](handleEntityNotFound(_0x51f000,null))['then'](function(_0xecbbc8){if(!_0xecbbc8[_0x5499('0x3f')])return;var _0x1bbe2e=_0xecbbc8['getSmtpOptions']();return respondWithRpcPromise('VerifySmtp',_0x5499('0xac'),{'account':_0x1bbe2e});})[_0x5499('0x24')](respondWithResult(_0x51f000,null))[_0x5499('0x1a')](handleError(_0x51f000,null));};exports[_0x5499('0x27')]=function(_0x466c50,_0x220682){return db[_0x5499('0x43')][_0x5499('0x5e')]({'where':{'id':_0x466c50[_0x5499('0x59')]['id']}})[_0x5499('0x24')](handleEntityNotFound(_0x220682,null))[_0x5499('0x24')](function(_0x4186cc){if(_0x4186cc&&_0x4186cc[_0x5499('0x3b')]){throw new db[(_0x5499('0xad'))][(_0x5499('0xae'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x4186cc;})[_0x5499('0x24')](removeEntity(_0x220682,null))[_0x5499('0x1a')](handleError(_0x220682,null));};exports[_0x5499('0xaf')]=function(_0x3e00e6,_0x3bf624){return db[_0x5499('0x43')][_0x5499('0x5e')]({'where':{'id':_0x3e00e6[_0x5499('0x59')]['id']}})[_0x5499('0x24')](handleEntityNotFound(_0x3bf624,null))['then'](function(_0xc0a602){if(_0xc0a602){return _0xc0a602['addAgents'](_0x3e00e6[_0x5499('0x5f')][_0x5499('0x6c')],_[_0x5499('0x80')](_0x3e00e6[_0x5499('0x5f')],[_0x5499('0x6c'),'id'])||{})[_0x5499('0xb0')](function(_0x179e26){for(var _0x372155=0x0;_0x372155<_0x3e00e6[_0x5499('0x5f')][_0x5499('0x6c')][_0x5499('0x4c')];_0x372155+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0x3e00e6[_0x5499('0x5f')]['ids'][_0x372155]),'MailAccountId':Number(_0x3e00e6['params']['id'])});}return _0x179e26;});}})[_0x5499('0x24')](respondWithResult(_0x3bf624,null))[_0x5499('0x1a')](handleError(_0x3bf624,null));};exports[_0x5499('0xb1')]=function(_0xaf0676,_0xc347f3){return db[_0x5499('0x43')][_0x5499('0x5e')]({'where':{'id':_0xaf0676[_0x5499('0x59')]['id']}})[_0x5499('0x24')](handleEntityNotFound(_0xc347f3,null))[_0x5499('0x24')](function(_0x11292a){if(_0x11292a){return _0x11292a[_0x5499('0xb1')](_0xaf0676[_0x5499('0x47')][_0x5499('0x6c')])[_0x5499('0x24')](function(){if(_[_0x5499('0xb2')](_0xaf0676['query']['ids'])){for(var _0x17078e=0x0;_0x17078e<_0xaf0676[_0x5499('0x47')]['ids']['length'];_0x17078e+=0x1){socket[_0x5499('0xb3')](_0x5499('0xb4'),{'UserId':Number(_0xaf0676[_0x5499('0x47')][_0x5499('0x6c')][_0x17078e]),'MailAccountId':Number(_0xaf0676[_0x5499('0x59')]['id'])});}}else{socket[_0x5499('0xb3')]('userMailAccount:remove',{'UserId':Number(_0xaf0676[_0x5499('0x47')][_0x5499('0x6c')]),'MailAccountId':Number(_0xaf0676['params']['id'])});}});}})[_0x5499('0x24')](respondWithStatusCode(_0xc347f3,null))[_0x5499('0x1a')](handleError(_0xc347f3,null));};exports['getAgents']=function(_0x17920b,_0x15f80b){var _0x3d2f95={};var _0x1eba5e={};var _0x3989ac;var _0x12d868;return db[_0x5499('0x43')][_0x5499('0x7b')]({'where':{'id':_0x17920b['params']['id']}})['then'](handleEntityNotFound(_0x15f80b,null))[_0x5499('0x24')](function(_0x1c566a){if(_0x1c566a){_0x3989ac=_0x1c566a;_0x1eba5e[_0x5499('0x4a')]=_[_0x5499('0x5c')](db['User'][_0x5499('0x44')]);_0x1eba5e[_0x5499('0x47')]=_[_0x5499('0x5c')](_0x17920b[_0x5499('0x47')]);_0x1eba5e[_0x5499('0x50')]=_[_0x5499('0x49')](_0x1eba5e[_0x5499('0x4a')],_0x1eba5e[_0x5499('0x47')]);_0x3d2f95[_0x5499('0x48')]=_[_0x5499('0x49')](_0x1eba5e[_0x5499('0x4a')],qs[_0x5499('0x4b')](_0x17920b[_0x5499('0x47')][_0x5499('0x4b')]));_0x3d2f95[_0x5499('0x48')]=_0x3d2f95['attributes'][_0x5499('0x4c')]?_0x3d2f95['attributes']:_0x1eba5e[_0x5499('0x4a')];_0x3d2f95[_0x5499('0x4e')]=qs[_0x5499('0x69')](_0x17920b['query'][_0x5499('0x69')]);_0x3d2f95[_0x5499('0x4f')]=qs['filters'](_[_0x5499('0x51')](_0x17920b['query'],_0x1eba5e[_0x5499('0x50')]));if(_0x17920b[_0x5499('0x47')][_0x5499('0x52')]){_0x3d2f95[_0x5499('0x4f')]=_[_0x5499('0x53')](_0x3d2f95['where'],{'$or':_[_0x5499('0x42')](_0x3d2f95['attributes'],function(_0x4806e7){var _0x1a7072={};_0x1a7072[_0x4806e7]={'$like':'%'+_0x17920b['query']['filter']+'%'};return _0x1a7072;})});}_0x3d2f95=_[_0x5499('0x53')]({},_0x3d2f95,_0x17920b['options']);return _0x3989ac[_0x5499('0xb5')](_0x3d2f95);}})[_0x5499('0x24')](function(_0x3ff999){if(_0x3ff999){_0x12d868=_0x3ff999[_0x5499('0x4c')];if(!_0x17920b[_0x5499('0x47')][_0x5499('0x68')](_0x5499('0x4d'))){_0x3d2f95[_0x5499('0x1f')]=qs[_0x5499('0x1f')](_0x17920b[_0x5499('0x47')]['limit']);_0x3d2f95[_0x5499('0x1d')]=qs[_0x5499('0x1d')](_0x17920b[_0x5499('0x47')][_0x5499('0x1d')]);}return _0x3989ac['getAgents'](_0x3d2f95);}})['then'](function(_0x4ca65f){if(_0x4ca65f){return _0x4ca65f?{'count':_0x12d868,'rows':_0x4ca65f}:null;}})['then'](respondWithResult(_0x15f80b,null))[_0x5499('0x1a')](handleError(_0x15f80b,null));};
\ No newline at end of file
+var _0x92c4=['username','password','pass','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','Imap','Smtp','index','MailServerIn','MailServerOut','Pause','MailAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','findAll','rows','params','mandatoryDispositionPause','includeAll','find','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','create','getDispositions','findOne','Disposition','MailAccountId','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','pick','removeAnswers','ListId','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','User','internal','Tag','Tags','color','tag','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','MailMessage','$gte','format','inlineCss','split','CmList','List','CmContact','updatedAt','DESC','CloudProvider','isNil','%s\x20<%s>','email','attachments','join','root','server/files/attachments','basename','Contacts','from','subject','out','YYYY-MM-DD\x20HH:mm:ss','messageId','Interaction','Messages','VerifySmtp','verifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','moment','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','update','destroy','then','get','MailAccounts','UserProfileResource','name','send','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','smtp.office365.com','user'];(function(_0x355a0d,_0x312bb2){var _0x2e83da=function(_0x4beffd){while(--_0x4beffd){_0x355a0d['push'](_0x355a0d['shift']());}};_0x2e83da(++_0x312bb2);}(_0x92c4,0x14c));var _0x492c=function(_0x274fe1,_0x2d1a47){_0x274fe1=_0x274fe1-0x0;var _0xb3456d=_0x92c4[_0x274fe1];return _0xb3456d;};'use strict';var moment=require(_0x492c('0x0'));var BPromise=require(_0x492c('0x1'));var util=require(_0x492c('0x2'));var path=require(_0x492c('0x3'));var _=require(_0x492c('0x4'));var juice=require('juice');var Redis=require(_0x492c('0x5'));var qs=require(_0x492c('0x6'));var logger=require(_0x492c('0x7'))(_0x492c('0x8'));var config=require(_0x492c('0x9'));var db=require(_0x492c('0xa'))['db'];config[_0x492c('0xb')]=_[_0x492c('0xc')](config[_0x492c('0xb')],{'host':_0x492c('0xd'),'port':0x18eb});var socket=require(_0x492c('0xe'))(new Redis(config['redis']));require(_0x492c('0xf'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x492c('0x10')][_0x492c('0x11')]({'port':0x232b});function respondWithRpcPromise(_0x1b461a,_0x3a34bf,_0x429f8c,_0x447b01){return new BPromise(function(_0x29a769,_0x3817c8){var _0x1a73aa=_0x447b01||client;return _0x1a73aa[_0x492c('0x12')](_0x1b461a,_0x429f8c)['then'](function(_0x28a95a){logger[_0x492c('0x13')](_0x492c('0x14'),_0x3a34bf,_0x492c('0x15'));logger['debug'](_0x492c('0x16'),_0x3a34bf,'request\x20sent',JSON[_0x492c('0x17')](_0x28a95a));if(_0x28a95a['error']){if(_0x28a95a['error'][_0x492c('0x18')]===0x1f4){logger[_0x492c('0x19')](_0x492c('0x14'),_0x3a34bf,_0x28a95a[_0x492c('0x19')][_0x492c('0x1a')]);return _0x3817c8(_0x28a95a[_0x492c('0x19')][_0x492c('0x1a')]);}logger['error'](_0x492c('0x14'),_0x3a34bf,_0x28a95a['error']['message']);return _0x29a769(_0x28a95a['error'][_0x492c('0x1a')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x3a34bf,'request\x20sent');_0x29a769(_0x28a95a[_0x492c('0x1b')]['message']);}})[_0x492c('0x1c')](function(_0x2943d5){logger[_0x492c('0x19')]('MailAccount,\x20%s,\x20%s',_0x3a34bf,_0x2943d5);_0x3817c8(_0x2943d5);});});}function respondWithStatusCode(_0x2dd32d,_0x5e64fc){_0x5e64fc=_0x5e64fc||0xcc;return function(_0x10284a){if(_0x10284a){return _0x2dd32d[_0x492c('0x1d')](_0x5e64fc);}return _0x2dd32d['status'](_0x5e64fc)[_0x492c('0x1e')]();};}function respondWithResult(_0x999a9e,_0x1febce){_0x1febce=_0x1febce||0xc8;return function(_0x4a04bc){if(_0x4a04bc){return _0x999a9e['status'](_0x1febce)['json'](_0x4a04bc);}};}function respondWithFilteredResult(_0x9ba0fb,_0x3f6657){return function(_0x1d6fb0){if(_0x1d6fb0){var _0x25d4d1=typeof _0x3f6657[_0x492c('0x1f')]===_0x492c('0x20')&&typeof _0x3f6657[_0x492c('0x21')]===_0x492c('0x20');var _0x16828e=_0x1d6fb0[_0x492c('0x22')];var _0xa61525=_0x25d4d1?0x0:_0x3f6657['offset'];var _0x5e8637=_0x25d4d1?_0x1d6fb0['count']:_0x3f6657[_0x492c('0x1f')]+_0x3f6657[_0x492c('0x21')];var _0x173800;if(_0x5e8637>=_0x16828e){_0x5e8637=_0x16828e;_0x173800=0xc8;}else{_0x173800=0xce;}_0x9ba0fb[_0x492c('0x23')](_0x173800);return _0x9ba0fb[_0x492c('0x24')](_0x492c('0x25'),_0xa61525+'-'+_0x5e8637+'/'+_0x16828e)[_0x492c('0x26')](_0x1d6fb0);}return null;};}function saveUpdates(_0xb9dfa7){return function(_0x386bb0){if(_0x386bb0){return _0x386bb0[_0x492c('0x27')](_0xb9dfa7)['then'](function(_0x17fa40){return _0x17fa40;});}return null;};}function removeEntity(_0x5b469e){return function(_0x23bf59){if(_0x23bf59){return _0x23bf59[_0x492c('0x28')]()[_0x492c('0x29')](function(){var _0x50c404=_0x23bf59[_0x492c('0x2a')]({'plain':!![]});var _0x1e0b01=_0x492c('0x2b');return db[_0x492c('0x2c')][_0x492c('0x28')]({'where':{'type':_0x1e0b01,'resourceId':_0x50c404['id']}})[_0x492c('0x29')](function(){return _0x23bf59;});})[_0x492c('0x29')](function(){_0x5b469e['status'](0xcc)[_0x492c('0x1e')]();});}};}function handleEntityNotFound(_0x7f254e){return function(_0x5ca703){if(!_0x5ca703){_0x7f254e['sendStatus'](0x194);}return _0x5ca703;};}function handleError(_0x155a67,_0x530f10){_0x530f10=_0x530f10||0x1f4;return function(_0x4b9d28){logger[_0x492c('0x19')](_0x4b9d28['stack']);if(_0x4b9d28[_0x492c('0x2d')]){delete _0x4b9d28[_0x492c('0x2d')];}_0x155a67[_0x492c('0x23')](_0x530f10)[_0x492c('0x2e')](_0x4b9d28);};}function getImapHost(_0x41582d){switch(_0x41582d){case _0x492c('0x2f'):return'imap.gmail.com';case _0x492c('0x30'):return _0x492c('0x31');case _0x492c('0x32'):return _0x492c('0x33');case'outlook365':return'outlook.office365.com';}throw new Error(_0x492c('0x34'),_0x41582d);}function getSmtpHost(_0x609f41){switch(_0x609f41){case _0x492c('0x2f'):return'smtp.gmail.com';case _0x492c('0x30'):return _0x492c('0x35');case _0x492c('0x32'):return _0x492c('0x36');case _0x492c('0x37'):return _0x492c('0x38');}throw new Error(_0x492c('0x34'),_0x609f41);}function getAuthenticationOptions(_0x16c882,_0x5041b7){var _0x9d8dfd={};var _0x58b981={};if(_0x16c882){_0x9d8dfd[_0x492c('0x39')]=_0x58b981[_0x492c('0x39')]=_0x5041b7[_0x492c('0x3a')];_0x9d8dfd[_0x492c('0x3b')]=_0x58b981[_0x492c('0x3c')]=_0x5041b7[_0x492c('0x3b')];if(_0x5041b7[_0x492c('0x3d')]){_0x9d8dfd[_0x492c('0x3d')]=_0x58b981['modernAuthentication']=!![];_0x9d8dfd[_0x492c('0x3e')]=_0x58b981[_0x492c('0x3e')]=_0x5041b7[_0x492c('0x3e')];_0x9d8dfd[_0x492c('0x3b')]=_0x58b981[_0x492c('0x3c')]=null;}else{_0x9d8dfd[_0x492c('0x3e')]=_0x58b981[_0x492c('0x3e')]=null;}_0x9d8dfd['host']=getImapHost(_0x16c882);_0x9d8dfd[_0x492c('0x3f')]=0x3e1;_0x58b981[_0x492c('0x40')]=getSmtpHost(_0x16c882);_0x58b981[_0x492c('0x3f')]=0x24b;_0x58b981[_0x492c('0x41')]=![];_0x9d8dfd[_0x492c('0x42')]=_0x58b981[_0x492c('0x42')]=null;}else{if(_0x5041b7[_0x492c('0x43')]){_0x9d8dfd[_0x492c('0x39')]=_0x58b981[_0x492c('0x39')]=_0x5041b7[_0x492c('0x3a')];_0x9d8dfd[_0x492c('0x3b')]=_0x58b981[_0x492c('0x3c')]=_0x5041b7[_0x492c('0x3b')];}else{_0x9d8dfd[_0x492c('0x43')]=_0x58b981[_0x492c('0x43')]=![];_0x9d8dfd[_0x492c('0x39')]=_0x58b981['user']=null;_0x9d8dfd[_0x492c('0x3b')]=_0x58b981['pass']=null;}_0x9d8dfd['host']=_0x5041b7[_0x492c('0x44')][_0x492c('0x40')];_0x9d8dfd['port']=_0x5041b7[_0x492c('0x44')][_0x492c('0x3f')];_0x58b981[_0x492c('0x40')]=_0x5041b7[_0x492c('0x45')][_0x492c('0x40')];_0x58b981[_0x492c('0x3f')]=_0x5041b7[_0x492c('0x45')][_0x492c('0x3f')];}return{'Imap':_0x9d8dfd,'Smtp':_0x58b981};}exports[_0x492c('0x46')]=function(_0x17fab5,_0x2d312a){var _0x51876b={'include':[{'model':db[_0x492c('0x47')],'as':_0x492c('0x44')},{'model':db[_0x492c('0x48')],'as':'Smtp'},{'model':db[_0x492c('0x49')],'as':'mandatoryDispositionPause'}]},_0xd22baf={},_0x4b462f={'count':0x0,'rows':[]};var _0x1a87f2=_['map'](db[_0x492c('0x4a')][_0x492c('0x4b')],function(_0x4acb5e){return{'name':_0x4acb5e['fieldName'],'type':_0x4acb5e[_0x492c('0x4c')][_0x492c('0x4d')]};});_0xd22baf[_0x492c('0x4e')]=_[_0x492c('0x4f')](_0x1a87f2,_0x492c('0x2d'));_0xd22baf[_0x492c('0x50')]=_[_0x492c('0x51')](_0x17fab5[_0x492c('0x50')]);_0xd22baf[_0x492c('0x52')]=_[_0x492c('0x53')](_0xd22baf[_0x492c('0x4e')],_0xd22baf[_0x492c('0x50')]);_0x51876b[_0x492c('0x54')]=_[_0x492c('0x53')](_0xd22baf[_0x492c('0x4e')],qs[_0x492c('0x55')](_0x17fab5[_0x492c('0x50')][_0x492c('0x55')]));_0x51876b['attributes']=_0x51876b[_0x492c('0x54')][_0x492c('0x56')]?_0x51876b['attributes']:_0xd22baf['model'];if(!_0x17fab5[_0x492c('0x50')]['hasOwnProperty'](_0x492c('0x57'))){_0x51876b['limit']=qs['limit'](_0x17fab5[_0x492c('0x50')][_0x492c('0x21')]);_0x51876b[_0x492c('0x1f')]=qs[_0x492c('0x1f')](_0x17fab5[_0x492c('0x50')][_0x492c('0x1f')]);}_0x51876b[_0x492c('0x58')]=qs['sort'](_0x17fab5[_0x492c('0x50')][_0x492c('0x59')]);_0x51876b[_0x492c('0x5a')]=qs[_0x492c('0x52')](_['pick'](_0x17fab5[_0x492c('0x50')],_0xd22baf[_0x492c('0x52')]),_0x1a87f2);if(_0x17fab5[_0x492c('0x50')][_0x492c('0x5b')]){_0x51876b[_0x492c('0x5a')]=_[_0x492c('0x5c')](_0x51876b['where'],{'$or':_[_0x492c('0x4f')](_0x1a87f2,function(_0x27700b){if(_0x27700b[_0x492c('0x4c')]!=='VIRTUAL'){var _0x23eb58={};_0x23eb58[_0x27700b[_0x492c('0x2d')]]={'$like':'%'+_0x17fab5[_0x492c('0x50')][_0x492c('0x5b')]+'%'};return _0x23eb58;}})});}_0x51876b=_[_0x492c('0x5c')]({},_0x51876b,_0x17fab5[_0x492c('0x5d')]);var _0x438385={'where':_0x51876b[_0x492c('0x5a')]};return db[_0x492c('0x4a')]['count'](_0x438385)[_0x492c('0x29')](function(_0x34ee88){_0x4b462f['count']=_0x34ee88;if(_0x17fab5[_0x492c('0x50')]['includeAll']){_0x51876b['include']=[{'all':!![]}];}return db[_0x492c('0x4a')][_0x492c('0x5e')](_0x51876b);})[_0x492c('0x29')](function(_0x25ce51){_0x4b462f[_0x492c('0x5f')]=_0x25ce51;return _0x4b462f;})[_0x492c('0x29')](respondWithFilteredResult(_0x2d312a,_0x51876b))[_0x492c('0x1c')](handleError(_0x2d312a,null));};exports['show']=function(_0x35e369,_0x5e4e3a){var _0x496aad={'raw':![],'where':{'id':_0x35e369[_0x492c('0x60')]['id']},'include':[{'model':db[_0x492c('0x47')],'as':_0x492c('0x44')},{'model':db[_0x492c('0x48')],'as':_0x492c('0x45')},{'model':db['Pause'],'as':_0x492c('0x61')}]},_0xd33e4f={};_0xd33e4f[_0x492c('0x4e')]=_[_0x492c('0x51')](db[_0x492c('0x4a')][_0x492c('0x4b')]);_0xd33e4f[_0x492c('0x50')]=_['keys'](_0x35e369['query']);_0xd33e4f[_0x492c('0x52')]=_[_0x492c('0x53')](_0xd33e4f[_0x492c('0x4e')],_0xd33e4f['query']);_0x496aad['attributes']=_['intersection'](_0xd33e4f[_0x492c('0x4e')],qs[_0x492c('0x55')](_0x35e369[_0x492c('0x50')][_0x492c('0x55')]));_0x496aad[_0x492c('0x54')]=_0x496aad['attributes'][_0x492c('0x56')]?_0x496aad[_0x492c('0x54')]:_0xd33e4f['model'];if(_0x35e369['query'][_0x492c('0x62')]){_0x496aad['include']=[{'all':!![]}];}_0x496aad=_[_0x492c('0x5c')]({},_0x496aad,_0x35e369[_0x492c('0x5d')]);return db[_0x492c('0x4a')][_0x492c('0x63')](_0x496aad)[_0x492c('0x29')](handleEntityNotFound(_0x5e4e3a,null))[_0x492c('0x29')](respondWithResult(_0x5e4e3a,null))[_0x492c('0x1c')](handleError(_0x5e4e3a,null));};exports[_0x492c('0x27')]=function(_0x86484e,_0x4e0fa2){if(_0x86484e[_0x492c('0x64')]['id']){delete _0x86484e[_0x492c('0x64')]['id'];}var _0x4e1fd6=_0x86484e['body'][_0x492c('0x65')]===_0x492c('0x66')?null:_0x86484e[_0x492c('0x64')][_0x492c('0x65')];var _0x87a181=_0x86484e['body']['Imap']||{};var _0x2b53a0=_0x86484e[_0x492c('0x64')]['Smtp']||{};if(_0x4e1fd6){_0x87a181[_0x492c('0x40')]=getImapHost(_0x4e1fd6);_0x87a181[_0x492c('0x3f')]=0x3e1;_0x2b53a0[_0x492c('0x40')]=getSmtpHost(_0x4e1fd6);_0x2b53a0[_0x492c('0x3f')]=0x24b;_0x2b53a0[_0x492c('0x41')]=![];}if(_0x2b53a0['modernAuthentication']){_0x2b53a0[_0x492c('0x41')]=![];}else{_0x2b53a0['CloudProviderId']=null;}if(!_0x87a181[_0x492c('0x3d')])_0x87a181[_0x492c('0x3e')]=null;_0x86484e[_0x492c('0x64')]['Imap']=_0x87a181;_0x86484e[_0x492c('0x64')][_0x492c('0x45')]=_0x2b53a0;return db['MailAccount'][_0x492c('0x63')]({'where':{'id':_0x86484e[_0x492c('0x60')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x492c('0x45')},{'model':db[_0x492c('0x49')],'as':_0x492c('0x61')}]})[_0x492c('0x29')](handleEntityNotFound(_0x4e0fa2,null))[_0x492c('0x29')](function(_0x1748d0){if(!_0x1748d0)throw new Error(_0x492c('0x67'));if(_0x1748d0['service'])delete _0x86484e['body'][_0x492c('0x44')];return _0x1748d0;})[_0x492c('0x29')](saveUpdates(_0x86484e['body'],null))[_0x492c('0x29')](function(_0x361b0e){if(!_0x86484e[_0x492c('0x64')][_0x492c('0x44')])return _0x361b0e;return db[_0x492c('0x47')][_0x492c('0x27')](_0x86484e[_0x492c('0x64')][_0x492c('0x44')],{'where':{'MailAccountId':_0x361b0e['id']}})[_0x492c('0x29')](function(){return _0x361b0e;});})['then'](function(_0x6a4cdf){if(!_0x86484e[_0x492c('0x64')][_0x492c('0x45')])return _0x6a4cdf;return db[_0x492c('0x48')]['update'](_0x86484e[_0x492c('0x64')]['Smtp'],{'where':{'MailAccountId':_0x6a4cdf['id']}})[_0x492c('0x29')](function(){return _0x6a4cdf;});})[_0x492c('0x29')](respondWithResult(_0x4e0fa2,null))[_0x492c('0x1c')](handleError(_0x4e0fa2,null));};exports[_0x492c('0x68')]=function(_0x446ecd,_0x1e43b7){return db[_0x492c('0x4a')][_0x492c('0x68')]()[_0x492c('0x29')](respondWithResult(_0x1e43b7,null))[_0x492c('0x1c')](handleError(_0x1e43b7,null));};exports[_0x492c('0x69')]=function(_0x41d440,_0xba5120){if(_0x41d440[_0x492c('0x64')]['id']){delete _0x41d440[_0x492c('0x64')]['id'];}return db[_0x492c('0x4a')][_0x492c('0x63')]({'where':{'id':_0x41d440['params']['id']}})[_0x492c('0x29')](handleEntityNotFound(_0xba5120,null))[_0x492c('0x29')](function(_0x354193){if(_0x354193){_0x41d440[_0x492c('0x64')]['MailAccountId']=_0x354193['id'];return db['Disposition'][_0x492c('0x6a')](_0x41d440[_0x492c('0x64')]);}})[_0x492c('0x29')](respondWithResult(_0xba5120,null))[_0x492c('0x1c')](handleError(_0xba5120,null));};exports[_0x492c('0x6b')]=function(_0x476431,_0x3be15d){var _0x58ee77={'raw':![],'where':{}};var _0x5264c6={};var _0x5ad286={'count':0x0,'rows':[]};return db['MailAccount'][_0x492c('0x6c')]({'where':{'id':_0x476431['params']['id']}})[_0x492c('0x29')](handleEntityNotFound(_0x3be15d,null))[_0x492c('0x29')](function(_0x5eadd7){if(_0x5eadd7){_0x5264c6[_0x492c('0x4e')]=_[_0x492c('0x51')](db[_0x492c('0x6d')][_0x492c('0x4b')]);_0x5264c6[_0x492c('0x50')]=_[_0x492c('0x51')](_0x476431['query']);_0x5264c6[_0x492c('0x52')]=_[_0x492c('0x53')](_0x5264c6['model'],_0x5264c6[_0x492c('0x50')]);_0x58ee77[_0x492c('0x54')]=_[_0x492c('0x53')](_0x5264c6['model'],qs[_0x492c('0x55')](_0x476431['query'][_0x492c('0x55')]));_0x58ee77[_0x492c('0x54')]=_0x58ee77[_0x492c('0x54')][_0x492c('0x56')]?_0x58ee77[_0x492c('0x54')]:_0x5264c6[_0x492c('0x4e')];if(!_0x476431[_0x492c('0x50')]['hasOwnProperty'](_0x492c('0x57'))){_0x58ee77[_0x492c('0x21')]=qs[_0x492c('0x21')](_0x476431[_0x492c('0x50')]['limit']);_0x58ee77[_0x492c('0x1f')]=qs['offset'](_0x476431['query'][_0x492c('0x1f')]);}_0x58ee77[_0x492c('0x58')]=qs['sort'](_0x476431['query']['sort']);_0x58ee77[_0x492c('0x5a')]=qs[_0x492c('0x52')](_['pick'](_0x476431[_0x492c('0x50')],_0x5264c6[_0x492c('0x52')]));_0x58ee77[_0x492c('0x5a')][_0x492c('0x6e')]=_0x5eadd7['id'];if(_0x476431[_0x492c('0x50')][_0x492c('0x5b')]){_0x58ee77[_0x492c('0x5a')]=_['merge'](_0x58ee77[_0x492c('0x5a')],{'$or':_[_0x492c('0x4f')](_0x58ee77['attributes'],function(_0x108e8f){var _0x286f7a={};_0x286f7a[_0x108e8f]={'$like':'%'+_0x476431[_0x492c('0x50')]['filter']+'%'};return _0x286f7a;})});}_0x58ee77=_[_0x492c('0x5c')]({},_0x58ee77,_0x476431['options']);return db[_0x492c('0x6d')][_0x492c('0x22')]({'where':_0x58ee77[_0x492c('0x5a')]})['then'](function(_0x25f1f1){_0x5ad286[_0x492c('0x22')]=_0x25f1f1;if(_0x476431['query'][_0x492c('0x62')]){_0x58ee77[_0x492c('0x6f')]=[{'all':!![]}];}return db[_0x492c('0x6d')][_0x492c('0x5e')](_0x58ee77);})[_0x492c('0x29')](function(_0x457afd){_0x5ad286[_0x492c('0x5f')]=_0x457afd;return _0x5ad286;});}})['then'](respondWithFilteredResult(_0x3be15d,_0x58ee77))[_0x492c('0x1c')](handleError(_0x3be15d,null));};exports[_0x492c('0x70')]=function(_0x1b72ed,_0xe0a528){return db[_0x492c('0x4a')][_0x492c('0x63')]({'where':{'id':_0x1b72ed[_0x492c('0x60')]['id']}})[_0x492c('0x29')](handleEntityNotFound(_0xe0a528,null))[_0x492c('0x29')](function(_0x384adb){if(_0x384adb){return _0x384adb['removeDispositions'](_0x1b72ed[_0x492c('0x50')][_0x492c('0x71')]);}})[_0x492c('0x29')](respondWithStatusCode(_0xe0a528,null))['catch'](handleError(_0xe0a528,null));};exports[_0x492c('0x72')]=function(_0x1d366c,_0x53f7d5){if(_0x1d366c['body']['id']){delete _0x1d366c[_0x492c('0x64')]['id'];}return db['MailAccount'][_0x492c('0x63')]({'where':{'id':_0x1d366c[_0x492c('0x60')]['id']}})[_0x492c('0x29')](handleEntityNotFound(_0x53f7d5,null))['then'](function(_0x3855ed){if(_0x3855ed){_0x1d366c[_0x492c('0x64')]['MailAccountId']=_0x3855ed['id'];return db[_0x492c('0x73')]['create'](_0x1d366c['body']);}})['then'](respondWithResult(_0x53f7d5,null))[_0x492c('0x1c')](handleError(_0x53f7d5,null));};exports[_0x492c('0x74')]=function(_0x54da3b,_0x5b00cd){var _0x75c57d={'raw':![],'where':{}};var _0x175713={};var _0x57fb27={'count':0x0,'rows':[]};return db[_0x492c('0x4a')][_0x492c('0x6c')]({'where':{'id':_0x54da3b[_0x492c('0x60')]['id']}})[_0x492c('0x29')](handleEntityNotFound(_0x5b00cd,null))['then'](function(_0x1ea2b2){if(_0x1ea2b2){_0x175713[_0x492c('0x4e')]=_[_0x492c('0x51')](db[_0x492c('0x73')][_0x492c('0x4b')]);_0x175713[_0x492c('0x50')]=_['keys'](_0x54da3b[_0x492c('0x50')]);_0x175713[_0x492c('0x52')]=_[_0x492c('0x53')](_0x175713['model'],_0x175713['query']);_0x75c57d[_0x492c('0x54')]=_[_0x492c('0x53')](_0x175713[_0x492c('0x4e')],qs[_0x492c('0x55')](_0x54da3b[_0x492c('0x50')][_0x492c('0x55')]));_0x75c57d[_0x492c('0x54')]=_0x75c57d[_0x492c('0x54')][_0x492c('0x56')]?_0x75c57d[_0x492c('0x54')]:_0x175713['model'];if(!_0x54da3b[_0x492c('0x50')][_0x492c('0x75')](_0x492c('0x57'))){_0x75c57d['limit']=qs['limit'](_0x54da3b[_0x492c('0x50')][_0x492c('0x21')]);_0x75c57d[_0x492c('0x1f')]=qs[_0x492c('0x1f')](_0x54da3b[_0x492c('0x50')]['offset']);}_0x75c57d['order']=qs[_0x492c('0x59')](_0x54da3b[_0x492c('0x50')][_0x492c('0x59')]);_0x75c57d[_0x492c('0x5a')]=qs[_0x492c('0x52')](_[_0x492c('0x76')](_0x54da3b[_0x492c('0x50')],_0x175713[_0x492c('0x52')]));_0x75c57d[_0x492c('0x5a')]['MailAccountId']=_0x1ea2b2['id'];if(_0x54da3b[_0x492c('0x50')][_0x492c('0x5b')]){_0x75c57d[_0x492c('0x5a')]=_[_0x492c('0x5c')](_0x75c57d[_0x492c('0x5a')],{'$or':_[_0x492c('0x4f')](_0x75c57d[_0x492c('0x54')],function(_0x12fedf){var _0x816a91={};_0x816a91[_0x12fedf]={'$like':'%'+_0x54da3b[_0x492c('0x50')][_0x492c('0x5b')]+'%'};return _0x816a91;})});}_0x75c57d=_[_0x492c('0x5c')]({},_0x75c57d,_0x54da3b['options']);return db['CannedAnswer'][_0x492c('0x22')]({'where':_0x75c57d[_0x492c('0x5a')]})['then'](function(_0x2ad53c){_0x57fb27['count']=_0x2ad53c;if(_0x54da3b[_0x492c('0x50')]['includeAll']){_0x75c57d[_0x492c('0x6f')]=[{'all':!![]}];}return db[_0x492c('0x73')][_0x492c('0x5e')](_0x75c57d);})[_0x492c('0x29')](function(_0x5a5e17){_0x57fb27[_0x492c('0x5f')]=_0x5a5e17;return _0x57fb27;});}})['then'](respondWithFilteredResult(_0x5b00cd,_0x75c57d))[_0x492c('0x1c')](handleError(_0x5b00cd,null));};exports[_0x492c('0x77')]=function(_0x290cec,_0x46c970){return db['MailAccount'][_0x492c('0x63')]({'where':{'id':_0x290cec['params']['id']}})[_0x492c('0x29')](handleEntityNotFound(_0x46c970,null))[_0x492c('0x29')](function(_0x35964f){if(_0x35964f){return _0x35964f[_0x492c('0x77')](_0x290cec['query'][_0x492c('0x71')]);}})[_0x492c('0x29')](respondWithStatusCode(_0x46c970,null))['catch'](handleError(_0x46c970,null));};exports[_0x492c('0x6a')]=function(_0x16246c,_0x557c74){var _0x315b03={'name':_0x16246c[_0x492c('0x64')][_0x492c('0x2d')],'key':_0x16246c[_0x492c('0x64')][_0x492c('0x4d')],'provider':_0x16246c[_0x492c('0x64')][_0x492c('0x65')]==='custom'?null:_0x16246c[_0x492c('0x64')]['provider'],'email':_0x16246c['body']['email'],'ListId':_0x16246c[_0x492c('0x64')][_0x492c('0x78')],'active':!_['isNil'](_0x16246c[_0x492c('0x64')][_0x492c('0x79')])?_0x16246c[_0x492c('0x64')][_0x492c('0x79')]:!![],'description':_0x16246c['body'][_0x492c('0x7a')]||null};var _0x1cf9a7=getAuthenticationOptions(_0x315b03[_0x492c('0x65')],_0x16246c[_0x492c('0x64')]);_0x315b03[_0x492c('0x44')]=_0x1cf9a7[_0x492c('0x44')];_0x315b03[_0x492c('0x45')]=_0x1cf9a7['Smtp'];return db[_0x492c('0x4a')][_0x492c('0x6a')](_0x315b03,{'include':[{'model':db[_0x492c('0x48')],'as':'Smtp'},{'model':db[_0x492c('0x47')],'as':'Imap'}]})[_0x492c('0x29')](function(_0x56f7c5){var _0x64b14b=_0x16246c['user'][_0x492c('0x2a')]({'plain':!![]});if(!_0x64b14b)throw new Error(_0x492c('0x7b'));if(_0x64b14b[_0x492c('0x7c')]===_0x492c('0x39')){var _0x443c3d=_0x56f7c5[_0x492c('0x2a')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'MailAccounts','userProfileId':_0x64b14b[_0x492c('0x7d')]},'raw':!![]})[_0x492c('0x29')](function(_0x59dad6){if(_0x59dad6&&_0x59dad6['autoAssociation']===0x0){return db[_0x492c('0x2c')][_0x492c('0x6a')]({'name':_0x443c3d[_0x492c('0x2d')],'resourceId':_0x443c3d['id'],'type':_0x59dad6[_0x492c('0x2d')],'sectionId':_0x59dad6['id']},{})[_0x492c('0x29')](function(){return _0x56f7c5;});}else{return _0x56f7c5;}})[_0x492c('0x1c')](function(_0x5142ac){logger[_0x492c('0x19')](_0x492c('0x7e'),_0x5142ac);throw _0x5142ac;});}return _0x56f7c5;})['then'](respondWithResult(_0x557c74,0xc9))[_0x492c('0x1c')](handleError(_0x557c74,null));};exports[_0x492c('0x7f')]=function(_0xbac4e1,_0x56e0e2){return db['MailAccount'][_0x492c('0x6c')]({'where':{'id':_0xbac4e1[_0x492c('0x60')]['id']}})[_0x492c('0x29')](handleEntityNotFound(_0x56e0e2,null))[_0x492c('0x29')](function(_0xadbebd){if(_0xadbebd){return _0xadbebd[_0x492c('0x7f')]();}return null;})['then'](respondWithResult(_0x56e0e2,null))['catch'](handleError(_0x56e0e2,null));};exports[_0x492c('0x80')]=function(_0x4f1431,_0xd7cedd){if(_0x4f1431[_0x492c('0x64')]['id']){delete _0x4f1431[_0x492c('0x64')]['id'];}return db[_0x492c('0x4a')][_0x492c('0x63')]({'where':{'id':_0x4f1431[_0x492c('0x60')]['id']}})[_0x492c('0x29')](handleEntityNotFound(_0xd7cedd,null))['then'](function(_0x4efe14){if(_0x4efe14){_0x4f1431['body']['MailAccountId']=_0x4efe14['id'];return db[_0x492c('0x47')][_0x492c('0x6a')](_0x4f1431[_0x492c('0x64')]);}})[_0x492c('0x29')](respondWithResult(_0xd7cedd,null))[_0x492c('0x1c')](handleError(_0xd7cedd,null));};exports[_0x492c('0x81')]=function(_0x232e07,_0x232812){return db[_0x492c('0x4a')]['findOne']({'where':{'id':_0x232e07[_0x492c('0x60')]['id']}})[_0x492c('0x29')](handleEntityNotFound(_0x232812,null))[_0x492c('0x29')](function(_0x129db7){if(_0x129db7){return _0x129db7['setImap'](null);}return null;})[_0x492c('0x29')](respondWithStatusCode(_0x232812,null))[_0x492c('0x1c')](handleError(_0x232812,null));};exports[_0x492c('0x82')]=function(_0x100078,_0x10b871){return db[_0x492c('0x4a')][_0x492c('0x6c')]({'where':{'id':_0x100078[_0x492c('0x60')]['id']}})[_0x492c('0x29')](handleEntityNotFound(_0x10b871,null))[_0x492c('0x29')](function(_0x59ed01){if(_0x59ed01){return _0x59ed01[_0x492c('0x82')]();}return null;})['then'](respondWithResult(_0x10b871,null))['catch'](handleError(_0x10b871,null));};exports[_0x492c('0x83')]=function(_0x4fec50,_0x53da40){if(_0x4fec50[_0x492c('0x64')]['id']){delete _0x4fec50[_0x492c('0x64')]['id'];}return db[_0x492c('0x4a')][_0x492c('0x63')]({'where':{'id':_0x4fec50[_0x492c('0x60')]['id']}})[_0x492c('0x29')](handleEntityNotFound(_0x53da40,null))['then'](function(_0x19a765){if(_0x19a765){_0x4fec50[_0x492c('0x64')][_0x492c('0x6e')]=_0x19a765['id'];return db[_0x492c('0x48')][_0x492c('0x6a')](_0x4fec50['body']);}})[_0x492c('0x29')](respondWithResult(_0x53da40,null))[_0x492c('0x1c')](handleError(_0x53da40,null));};exports[_0x492c('0x84')]=function(_0x2a2d6d,_0x2f390e){return db[_0x492c('0x4a')][_0x492c('0x6c')]({'where':{'id':_0x2a2d6d['params']['id']}})[_0x492c('0x29')](handleEntityNotFound(_0x2f390e,null))['then'](function(_0x16d3a9){if(_0x16d3a9){return _0x16d3a9[_0x492c('0x85')](null);}return null;})[_0x492c('0x29')](respondWithStatusCode(_0x2f390e,null))[_0x492c('0x1c')](handleError(_0x2f390e,null));};exports[_0x492c('0x86')]=function(_0x346ba6,_0x111cfd){return db[_0x492c('0x87')][_0x492c('0x63')]({'where':{'id':_0x346ba6[_0x492c('0x60')]['id']}})[_0x492c('0x29')](handleEntityNotFound(_0x111cfd,null))['then'](function(_0xefe1c5){if(_0xefe1c5){return _0xefe1c5[_0x492c('0x86')](_0x346ba6[_0x492c('0x64')]['ids'],_[_0x492c('0x88')](_0x346ba6[_0x492c('0x64')],[_0x492c('0x71'),'id'])||{});}})[_0x492c('0x29')](respondWithResult(_0x111cfd,null))['catch'](handleError(_0x111cfd,null));};exports[_0x492c('0x89')]=function(_0x2e3277,_0x475d0b){var _0x2a0f42={'raw':![],'where':{}};var _0x3be7a1={};var _0x4c8ada={'count':0x0,'rows':[]};return db['MailAccount'][_0x492c('0x6c')]({'where':{'id':_0x2e3277[_0x492c('0x60')]['id']}})[_0x492c('0x29')](handleEntityNotFound(_0x475d0b,null))['then'](function(_0x3c9845){if(_0x3c9845){_0x3be7a1[_0x492c('0x4e')]=_['keys'](db['MailInteraction'][_0x492c('0x4b')]);_0x3be7a1[_0x492c('0x50')]=_['keys'](_0x2e3277[_0x492c('0x50')]);_0x3be7a1[_0x492c('0x52')]=_[_0x492c('0x53')](_0x3be7a1[_0x492c('0x4e')],_0x3be7a1[_0x492c('0x50')]);_0x2a0f42[_0x492c('0x54')]=_['intersection'](_0x3be7a1[_0x492c('0x4e')],qs[_0x492c('0x55')](_0x2e3277[_0x492c('0x50')]['fields']));_0x2a0f42[_0x492c('0x54')]=_0x2a0f42[_0x492c('0x54')][_0x492c('0x56')]?_0x2a0f42['attributes']:_0x3be7a1[_0x492c('0x4e')];if(!_0x2e3277[_0x492c('0x50')][_0x492c('0x75')](_0x492c('0x57'))){_0x2a0f42[_0x492c('0x21')]=qs[_0x492c('0x21')](_0x2e3277[_0x492c('0x50')][_0x492c('0x21')]);_0x2a0f42['offset']=qs[_0x492c('0x1f')](_0x2e3277[_0x492c('0x50')][_0x492c('0x1f')]);}_0x2a0f42[_0x492c('0x58')]=qs['sort'](_0x2e3277[_0x492c('0x50')][_0x492c('0x59')]);_0x2a0f42[_0x492c('0x5a')]=qs['filters'](_[_0x492c('0x76')](_0x2e3277[_0x492c('0x50')],_0x3be7a1[_0x492c('0x52')]));_0x2a0f42[_0x492c('0x5a')][_0x492c('0x6e')]=_0x3c9845['id'];if(_0x2e3277[_0x492c('0x50')]['filter']){_0x2a0f42[_0x492c('0x5a')]=_[_0x492c('0x5c')](_0x2a0f42[_0x492c('0x5a')],{'$or':_[_0x492c('0x4f')](_0x2a0f42['attributes'],function(_0x3bdb8c){var _0x3f6ae8={};_0x3f6ae8[_0x3bdb8c]={'$like':'%'+_0x2e3277[_0x492c('0x50')]['filter']+'%'};return _0x3f6ae8;})});}_0x2a0f42=_[_0x492c('0x5c')]({},_0x2a0f42,_0x2e3277[_0x492c('0x5d')]);return db[_0x492c('0x87')][_0x492c('0x22')]({'where':_0x2a0f42[_0x492c('0x5a')]})[_0x492c('0x29')](function(_0x274346){_0x4c8ada[_0x492c('0x22')]=_0x274346;if(_0x2e3277['query']['includeAll']){_0x2a0f42[_0x492c('0x6f')]=[{'model':db['CmContact'],'as':_0x492c('0x8a'),'required':![]},{'model':db[_0x492c('0x8b')],'as':'Owner','attributes':[_0x492c('0x2d'),'fullname',_0x492c('0x8c')],'required':![]},{'model':db[_0x492c('0x8d')],'as':_0x492c('0x8e'),'attributes':['id','name',_0x492c('0x8f')],'where':_0x2e3277['query']['tag']?{'id':_0x2e3277[_0x492c('0x50')][_0x492c('0x90')]}:undefined,'required':_0x2e3277['query']['tag']?!![]:![]}];}return db['MailInteraction']['findAll'](_0x2a0f42);})[_0x492c('0x29')](function(_0x4b43e0){_0x4c8ada[_0x492c('0x5f')]=_0x4b43e0;return _0x4c8ada;});}})['then'](respondWithFilteredResult(_0x475d0b,_0x2a0f42))[_0x492c('0x1c')](handleError(_0x475d0b,null));};exports[_0x492c('0x91')]=function addApplications(_0x3a3f74,_0x14ddfc){var _0x4f0581=_0x3a3f74['params']['id'];var _0x2e213f=_0x3a3f74[_0x492c('0x64')];var _0x30b126=0xc8;var _0x4590de=null;return db[_0x492c('0x92')]['transaction']({'isolationLevel':db[_0x492c('0x92')][_0x492c('0x93')][_0x492c('0x94')][_0x492c('0x95')]},function(_0x2f7a9b){return db['MailAccount']['findOne']({'where':{'id':_0x4f0581},'transaction':_0x2f7a9b})['then'](function(_0x4a9390){if(_0x4a9390){return db[_0x492c('0x96')][_0x492c('0x28')]({'where':{'MailAccountId':_0x4f0581},'transaction':_0x2f7a9b})[_0x492c('0x29')](function(){var _0x2b497a=_['map'](_0x2e213f,function(_0x3c36f5){_0x3c36f5[_0x492c('0x6e')]=_0x4f0581;return _0x3c36f5;});return db[_0x492c('0x96')][_0x492c('0x97')](_0x2b497a,{'transaction':_0x2f7a9b});});}else{_0x30b126=0x194;_0x4590de=[];}});})['then'](function(){if(_0x30b126!==0x194){return db[_0x492c('0x96')][_0x492c('0x98')]({'where':{'MailAccountId':_0x4f0581},'order':_0x492c('0x99')})['then'](function(_0xbcb3b8){_0x4590de=_0xbcb3b8;});}})[_0x492c('0x1c')](function(_0x31c4ca){_0x30b126=0x1f4;logger[_0x492c('0x19')](_0x31c4ca[_0x492c('0x9a')]);if(_0x31c4ca[_0x492c('0x2d')]){delete _0x31c4ca[_0x492c('0x2d')];}_0x4590de=_0x31c4ca;})[_0x492c('0x9b')](function(){if(_0x4590de===null){_0x14ddfc['sendStatus'](_0x30b126);}else{if(_0x30b126===0x1f4){_0x14ddfc[_0x492c('0x23')](_0x30b126)[_0x492c('0x2e')](_0x4590de);}else{_0x14ddfc[_0x492c('0x23')](_0x30b126)[_0x492c('0x26')](_0x4590de);}}});};exports['getApplications']=function(_0x50edec,_0x22e413){var _0x2f8722={};var _0x59fa3c={};var _0x258fc0;var _0x268825;return db['MailAccount'][_0x492c('0x6c')]({'where':{'id':_0x50edec[_0x492c('0x60')]['id']}})[_0x492c('0x29')](handleEntityNotFound(_0x22e413,null))[_0x492c('0x29')](function(_0x37a5ca){if(_0x37a5ca){_0x258fc0=_0x37a5ca;_0x59fa3c['model']=_[_0x492c('0x51')](db['MailApplication'][_0x492c('0x4b')]);_0x59fa3c[_0x492c('0x50')]=_[_0x492c('0x51')](_0x50edec['query']);_0x59fa3c['filters']=_[_0x492c('0x53')](_0x59fa3c[_0x492c('0x4e')],_0x59fa3c['query']);_0x2f8722[_0x492c('0x54')]=_[_0x492c('0x53')](_0x59fa3c[_0x492c('0x4e')],qs['fields'](_0x50edec['query'][_0x492c('0x55')]));_0x2f8722[_0x492c('0x54')]=_0x2f8722['attributes'][_0x492c('0x56')]?_0x2f8722[_0x492c('0x54')]:_0x59fa3c['model'];_0x2f8722[_0x492c('0x58')]=qs[_0x492c('0x59')](_0x50edec[_0x492c('0x50')][_0x492c('0x59')]);_0x2f8722[_0x492c('0x5a')]=qs[_0x492c('0x52')](_['pick'](_0x50edec[_0x492c('0x50')],_0x59fa3c[_0x492c('0x52')]));if(_0x50edec[_0x492c('0x50')]['filter']){_0x2f8722['where']=_[_0x492c('0x5c')](_0x2f8722[_0x492c('0x5a')],{'$or':_['map'](_0x2f8722[_0x492c('0x54')],function(_0x254762){var _0x513b87={};_0x513b87[_0x254762]={'$like':'%'+_0x50edec['query'][_0x492c('0x5b')]+'%'};return _0x513b87;})});}_0x2f8722=_['merge']({},_0x2f8722,_0x50edec[_0x492c('0x5d')]);return _0x258fc0['getApplications'](_0x2f8722);}})[_0x492c('0x29')](function(_0x420b5b){if(_0x420b5b){_0x268825=_0x420b5b['length'];if(!_0x50edec[_0x492c('0x50')][_0x492c('0x75')](_0x492c('0x57'))){_0x2f8722['limit']=qs[_0x492c('0x21')](_0x50edec[_0x492c('0x50')][_0x492c('0x21')]);_0x2f8722[_0x492c('0x1f')]=qs['offset'](_0x50edec['query'][_0x492c('0x1f')]);}return _0x258fc0[_0x492c('0x9c')](_0x2f8722);}})[_0x492c('0x29')](function(_0x4cf513){if(_0x4cf513){return _0x4cf513?{'count':_0x268825,'rows':_0x4cf513}:null;}})['then'](respondWithResult(_0x22e413,null))['catch'](handleError(_0x22e413,null));};exports['getMessages']=function(_0x3fd742,_0x284646){var _0x107380={'raw':!![],'where':{}};var _0x53c2ac={};var _0x2175c6={'count':0x0,'rows':[]};return db[_0x492c('0x4a')]['findOne']({'where':{'id':_0x3fd742['params']['id']}})[_0x492c('0x29')](handleEntityNotFound(_0x284646,null))[_0x492c('0x29')](function(_0x55476e){if(_0x55476e){_0x53c2ac['model']=_[_0x492c('0x51')](db[_0x492c('0x9d')][_0x492c('0x4b')]);_0x53c2ac['query']=_['keys'](_0x3fd742[_0x492c('0x50')]);_0x53c2ac[_0x492c('0x52')]=_[_0x492c('0x53')](_0x53c2ac[_0x492c('0x4e')],_0x53c2ac[_0x492c('0x50')]);_0x107380[_0x492c('0x54')]=_[_0x492c('0x53')](_0x53c2ac['model'],qs[_0x492c('0x55')](_0x3fd742[_0x492c('0x50')][_0x492c('0x55')]));_0x107380[_0x492c('0x54')]=_0x107380[_0x492c('0x54')]['length']?_0x107380['attributes']:_0x53c2ac[_0x492c('0x4e')];if(!_0x3fd742[_0x492c('0x50')][_0x492c('0x75')]('nolimit')){_0x107380[_0x492c('0x21')]=qs[_0x492c('0x21')](_0x3fd742[_0x492c('0x50')][_0x492c('0x21')]);_0x107380['offset']=qs[_0x492c('0x1f')](_0x3fd742[_0x492c('0x50')][_0x492c('0x1f')]);}_0x107380['order']=qs['sort'](_0x3fd742[_0x492c('0x50')]['sort']);_0x107380[_0x492c('0x5a')]=qs[_0x492c('0x52')](_['pick'](_0x3fd742[_0x492c('0x50')],_0x53c2ac[_0x492c('0x52')]));_0x107380[_0x492c('0x5a')][_0x492c('0x6e')]=_0x55476e['id'];if(_0x3fd742['query'][_0x492c('0x5b')]){_0x107380[_0x492c('0x5a')]=_[_0x492c('0x5c')](_0x107380['where'],{'$or':_[_0x492c('0x4f')](_0x107380['attributes'],function(_0x249310){var _0x254453={};_0x254453[_0x249310]={'$like':'%'+_0x3fd742[_0x492c('0x50')][_0x492c('0x5b')]+'%'};return _0x254453;})});}if(_0x3fd742[_0x492c('0x50')][_0x492c('0x9e')]){var _0xb13c5e=_0x3fd742[_0x492c('0x50')][_0x492c('0x9e')]['split'](',');var _0x13670d={};_0x13670d[_0xb13c5e[0x0]]={'$gte':moment(_0xb13c5e[0x1])[_0x492c('0x9f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x107380['where']=_['merge'](_0x107380[_0x492c('0x5a')],_0x13670d);}_0x107380=_[_0x492c('0x5c')]({},_0x107380,_0x3fd742[_0x492c('0x5d')]);return db['MailMessage'][_0x492c('0x22')]({'where':_0x107380['where']})['then'](function(_0x168cf0){_0x2175c6[_0x492c('0x22')]=_0x168cf0;if(_0x3fd742[_0x492c('0x50')]['includeAll']){_0x107380[_0x492c('0x6f')]=[{'all':!![]}];}return db['MailMessage'][_0x492c('0x5e')](_0x107380);})[_0x492c('0x29')](function(_0x315513){if(_0x3fd742[_0x492c('0x50')][_0x492c('0xa0')]==='true'){for(var _0x4e367c=0x0;_0x4e367c<_0x315513[_0x492c('0x56')];_0x4e367c++){_0x315513[_0x4e367c][_0x492c('0x64')]=juice(_0x315513[_0x4e367c][_0x492c('0x64')]);}}_0x2175c6[_0x492c('0x5f')]=_0x315513;return _0x2175c6;});}})[_0x492c('0x29')](respondWithFilteredResult(_0x284646,_0x107380))[_0x492c('0x1c')](handleError(_0x284646,null));};exports[_0x492c('0x2e')]=function(_0x4a804a,_0x14a33a){var _0x3528b9,_0x4a920e={},_0x201a97;if(_0x4a804a[_0x492c('0x64')]['to']){_0x201a97=_0x4a804a[_0x492c('0x64')]['to'][_0x492c('0xa1')](',')[0x0];}return db[_0x492c('0x4a')]['find']({'where':{'id':_0x4a804a['params']['id']},'include':[{'model':db[_0x492c('0xa2')],'as':_0x492c('0xa3'),'include':[{'model':db[_0x492c('0xa4')],'as':'Contacts','where':{'email':_0x201a97},'limit':0x1,'order':[[_0x492c('0xa5'),_0x492c('0xa6')]]}]},{'model':db['MailServerOut'],'as':_0x492c('0x45'),'raw':!![],'include':[{'model':db[_0x492c('0xa7')],'as':'CloudProvider','raw':!![]}]}]})['then'](handleEntityNotFound(_0x14a33a,null))[_0x492c('0x29')](function(_0x4dc424){if(!_0x4dc424)return;_0x3528b9=_0x4dc424;if(!_0x4dc424[_0x492c('0x45')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x492c('0xa8')](_0x4a804a[_0x492c('0x64')]['from'])){_0x4a804a[_0x492c('0x64')]['from']=util[_0x492c('0x9f')](_0x492c('0xa9'),_0x4dc424['name'],_0x4dc424[_0x492c('0xaa')]||_0x4dc424[_0x492c('0x45')][_0x492c('0x39')]);}if(_0x4a804a[_0x492c('0x64')][_0x492c('0xab')]&&_0x4a804a[_0x492c('0x64')][_0x492c('0xab')][_0x492c('0x56')]){for(var _0x2d7f57=0x0;_0x2d7f57<_0x4a804a[_0x492c('0x64')][_0x492c('0xab')][_0x492c('0x56')];_0x2d7f57+=0x1){_0x4a804a[_0x492c('0x64')][_0x492c('0xab')][_0x2d7f57]={'filename':_0x4a804a[_0x492c('0x64')][_0x492c('0xab')][_0x2d7f57]['name'],'path':path[_0x492c('0xac')](config[_0x492c('0xad')],_0x492c('0xae'),_0x4a804a['body'][_0x492c('0xab')][_0x2d7f57][_0x492c('0xaf')])};}}var _0x3be181=_0x4dc424['getSmtpOptions']();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x3be181,'message':_0x4a804a[_0x492c('0x64')]});})[_0x492c('0x29')](function(_0x48c9ca){if(!_0x48c9ca)return;_0x4a920e=_0x48c9ca;if(!_0x3528b9[_0x492c('0xa3')])throw new Error('List\x20not\x20found');if(_0x3528b9[_0x492c('0xa3')][_0x492c('0xb0')]['length'])return _0x3528b9[_0x492c('0xa3')]['Contacts'][0x0];return db['CmContact'][_0x492c('0x6a')](_[_0x492c('0xc')](_0x4a804a[_0x492c('0x64')],{'firstName':_0x4a804a[_0x492c('0x64')]['to'],'email':_0x4a804a[_0x492c('0x64')]['to'],'phone':_0x4a804a[_0x492c('0x64')]['to'],'ListId':_0x3528b9['ListId']}));})[_0x492c('0x29')](function(_0x318ede){if(!_0x318ede)return;var _0x5613ff={'UserId':_0x4a804a[_0x492c('0x39')]['id'],'ContactId':_0x318ede['id'],'MailAccountId':_0x3528b9['id'],'inReplyTo':_0x4a920e['messageId'],'to':_0x4a804a[_0x492c('0x64')][_0x492c('0xb1')],'cc':_0x4a804a['body']['cc'],'subject':_0x4a804a['body'][_0x492c('0xb2')],'attach':_0x4a804a[_0x492c('0x64')]['attach'],'firstMsgDirection':_0x492c('0xb3'),'lastMsgAt':moment()[_0x492c('0x9f')](_0x492c('0xb4')),'lastMsgDirection':_0x492c('0xb3'),'Messages':[_[_0x492c('0x5c')](_0x4a804a['body'],{'messageId':_0x4a920e[_0x492c('0xb5')],'sentAt':moment()['format'](_0x492c('0xb4')),'read':!![],'MailAccountId':_0x3528b9['id'],'UserId':_0x4a804a[_0x492c('0x39')]['id'],'ContactId':_0x318ede['id']})]};if(_0x4a804a[_0x492c('0x64')][_0x492c('0xb6')]){_0x5613ff=_[_0x492c('0x5c')](_0x5613ff,_0x4a804a[_0x492c('0x64')][_0x492c('0xb6')]);}return db[_0x492c('0x87')]['create'](_0x5613ff,{'include':[{'model':db[_0x492c('0x9d')],'as':_0x492c('0xb7')}]});})[_0x492c('0x29')](respondWithResult(_0x14a33a,null))[_0x492c('0x1c')](handleError(_0x14a33a,null));};exports['verifySmtp']=function(_0x44de13,_0xfcade1){return db[_0x492c('0x4a')][_0x492c('0x63')]({'where':{'id':_0x44de13[_0x492c('0x60')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x492c('0x45'),'raw':!![],'include':[{'model':db[_0x492c('0xa7')],'as':_0x492c('0xa7'),'raw':!![]}]}]})[_0x492c('0x29')](handleEntityNotFound(_0xfcade1,null))[_0x492c('0x29')](function(_0x4753f5){if(!_0x4753f5[_0x492c('0x45')])return;var _0x1fc63a=_0x4753f5['getSmtpOptions']();return respondWithRpcPromise(_0x492c('0xb8'),_0x492c('0xb9'),{'account':_0x1fc63a});})[_0x492c('0x29')](respondWithResult(_0xfcade1,null))[_0x492c('0x1c')](handleError(_0xfcade1,null));};exports[_0x492c('0x28')]=function(_0x166140,_0x2ad7da){return db[_0x492c('0x4a')][_0x492c('0x63')]({'where':{'id':_0x166140['params']['id']}})[_0x492c('0x29')](handleEntityNotFound(_0x2ad7da,null))[_0x492c('0x29')](function(_0x9cc901){if(_0x9cc901&&_0x9cc901[_0x492c('0x42')]){throw new db['Sequelize'][(_0x492c('0xba'))](_0x492c('0xbb'));}return _0x9cc901;})[_0x492c('0x29')](removeEntity(_0x2ad7da,null))[_0x492c('0x1c')](handleError(_0x2ad7da,null));};exports[_0x492c('0xbc')]=function(_0xc400c5,_0x5dbc62){return db[_0x492c('0x4a')]['find']({'where':{'id':_0xc400c5[_0x492c('0x60')]['id']}})[_0x492c('0x29')](handleEntityNotFound(_0x5dbc62,null))[_0x492c('0x29')](function(_0x10c5e4){if(_0x10c5e4){return _0x10c5e4[_0x492c('0xbc')](_0xc400c5[_0x492c('0x64')]['ids'],_[_0x492c('0x88')](_0xc400c5[_0x492c('0x64')],[_0x492c('0x71'),'id'])||{})[_0x492c('0xbd')](function(_0x282d4b){for(var _0x5a93ba=0x0;_0x5a93ba<_0xc400c5[_0x492c('0x64')][_0x492c('0x71')][_0x492c('0x56')];_0x5a93ba+=0x1){socket[_0x492c('0xbe')](_0x492c('0xbf'),{'UserId':Number(_0xc400c5[_0x492c('0x64')][_0x492c('0x71')][_0x5a93ba]),'MailAccountId':Number(_0xc400c5[_0x492c('0x60')]['id'])});}return _0x282d4b;});}})[_0x492c('0x29')](respondWithResult(_0x5dbc62,null))[_0x492c('0x1c')](handleError(_0x5dbc62,null));};exports[_0x492c('0xc0')]=function(_0x5a5efc,_0x52b416){return db[_0x492c('0x4a')][_0x492c('0x63')]({'where':{'id':_0x5a5efc[_0x492c('0x60')]['id']}})[_0x492c('0x29')](handleEntityNotFound(_0x52b416,null))[_0x492c('0x29')](function(_0x125df8){if(_0x125df8){return _0x125df8[_0x492c('0xc0')](_0x5a5efc['query'][_0x492c('0x71')])[_0x492c('0x29')](function(){if(_['isArray'](_0x5a5efc['query'][_0x492c('0x71')])){for(var _0x472ad0=0x0;_0x472ad0<_0x5a5efc['query'][_0x492c('0x71')][_0x492c('0x56')];_0x472ad0+=0x1){socket[_0x492c('0xbe')](_0x492c('0xc1'),{'UserId':Number(_0x5a5efc['query']['ids'][_0x472ad0]),'MailAccountId':Number(_0x5a5efc[_0x492c('0x60')]['id'])});}}else{socket['emit'](_0x492c('0xc1'),{'UserId':Number(_0x5a5efc['query'][_0x492c('0x71')]),'MailAccountId':Number(_0x5a5efc[_0x492c('0x60')]['id'])});}});}})['then'](respondWithStatusCode(_0x52b416,null))[_0x492c('0x1c')](handleError(_0x52b416,null));};exports[_0x492c('0xc2')]=function(_0x14b78b,_0x2b4875){var _0x2d8b75={};var _0x4dd127={};var _0x5e3ac2;var _0x25a941;return db[_0x492c('0x4a')][_0x492c('0x6c')]({'where':{'id':_0x14b78b[_0x492c('0x60')]['id']}})[_0x492c('0x29')](handleEntityNotFound(_0x2b4875,null))[_0x492c('0x29')](function(_0xbcb99d){if(_0xbcb99d){_0x5e3ac2=_0xbcb99d;_0x4dd127[_0x492c('0x4e')]=_[_0x492c('0x51')](db[_0x492c('0x8b')]['rawAttributes']);_0x4dd127[_0x492c('0x50')]=_[_0x492c('0x51')](_0x14b78b[_0x492c('0x50')]);_0x4dd127[_0x492c('0x52')]=_[_0x492c('0x53')](_0x4dd127[_0x492c('0x4e')],_0x4dd127[_0x492c('0x50')]);_0x2d8b75['attributes']=_[_0x492c('0x53')](_0x4dd127['model'],qs[_0x492c('0x55')](_0x14b78b['query'][_0x492c('0x55')]));_0x2d8b75[_0x492c('0x54')]=_0x2d8b75[_0x492c('0x54')][_0x492c('0x56')]?_0x2d8b75['attributes']:_0x4dd127[_0x492c('0x4e')];_0x2d8b75[_0x492c('0x58')]=qs[_0x492c('0x59')](_0x14b78b['query'][_0x492c('0x59')]);_0x2d8b75[_0x492c('0x5a')]=qs['filters'](_[_0x492c('0x76')](_0x14b78b[_0x492c('0x50')],_0x4dd127['filters']));if(_0x14b78b[_0x492c('0x50')]['filter']){_0x2d8b75[_0x492c('0x5a')]=_[_0x492c('0x5c')](_0x2d8b75['where'],{'$or':_[_0x492c('0x4f')](_0x2d8b75[_0x492c('0x54')],function(_0x557ba5){var _0x218f2c={};_0x218f2c[_0x557ba5]={'$like':'%'+_0x14b78b['query']['filter']+'%'};return _0x218f2c;})});}_0x2d8b75=_[_0x492c('0x5c')]({},_0x2d8b75,_0x14b78b['options']);return _0x5e3ac2['getAgents'](_0x2d8b75);}})[_0x492c('0x29')](function(_0x560418){if(_0x560418){_0x25a941=_0x560418[_0x492c('0x56')];if(!_0x14b78b[_0x492c('0x50')][_0x492c('0x75')](_0x492c('0x57'))){_0x2d8b75[_0x492c('0x21')]=qs[_0x492c('0x21')](_0x14b78b[_0x492c('0x50')][_0x492c('0x21')]);_0x2d8b75[_0x492c('0x1f')]=qs[_0x492c('0x1f')](_0x14b78b['query'][_0x492c('0x1f')]);}return _0x5e3ac2['getAgents'](_0x2d8b75);}})[_0x492c('0x29')](function(_0x462e18){if(_0x462e18){return _0x462e18?{'count':_0x25a941,'rows':_0x462e18}:null;}})[_0x492c('0x29')](respondWithResult(_0x2b4875,null))['catch'](handleError(_0x2b4875,null));};
\ No newline at end of file
index ff855b2..38dd38f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc274=['exports','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3c700f,_0x2ad2c8){var _0x1bf773=function(_0x205d1f){while(--_0x205d1f){_0x3c700f['push'](_0x3c700f['shift']());}};_0x1bf773(++_0x2ad2c8);}(_0xc274,0x151));var _0x4c27=function(_0x39836a,_0x16f7b7){_0x39836a=_0x39836a-0x0;var _0x41e9d2=_0xc274[_0x39836a];return _0x41e9d2;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x4c27('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4c27('0x1'),'afterUpdate':_0x4c27('0x2'),'afterDestroy':_0x4c27('0x3')};function emitEvent(_0x15133d){return function(_0x2771df,_0x17970c,_0x534d34){MailAccountEvents[_0x4c27('0x4')](_0x15133d+':'+_0x2771df['id'],_0x2771df);MailAccountEvents['emit'](_0x15133d,_0x2771df);_0x534d34(null);};}for(var e in events){if(events[_0x4c27('0x5')](e)){var event=events[e];MailAccount[_0x4c27('0x6')](e,emitEvent(event));}}module[_0x4c27('0x7')]=MailAccountEvents;
\ No newline at end of file
+var _0x3c03=['remove','emit','hasOwnProperty','hook','exports','events','save','update'];(function(_0x2fa4e9,_0x6e8e30){var _0x43d78d=function(_0xcfb09e){while(--_0xcfb09e){_0x2fa4e9['push'](_0x2fa4e9['shift']());}};_0x43d78d(++_0x6e8e30);}(_0x3c03,0x16d));var _0x33c0=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x3c03[_0x2555d0];return _0x3bb486;};'use strict';var EventEmitter=require(_0x33c0('0x0'));var MailAccount=require('../../mysqldb')['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x33c0('0x1'),'afterUpdate':_0x33c0('0x2'),'afterDestroy':_0x33c0('0x3')};function emitEvent(_0x7ebf0f){return function(_0x4d9482,_0x37ecd5,_0x7b54d7){MailAccountEvents[_0x33c0('0x4')](_0x7ebf0f+':'+_0x4d9482['id'],_0x4d9482);MailAccountEvents[_0x33c0('0x4')](_0x7ebf0f,_0x4d9482);_0x7b54d7(null);};}for(var e in events){if(events[_0x33c0('0x5')](e)){var event=events[e];MailAccount[_0x33c0('0x6')](e,emitEvent(event));}}module[_0x33c0('0x7')]=MailAccountEvents;
\ No newline at end of file
index 0b8ca79..af03a55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cc7=['MailAccount','mail_accounts','provider','custom','service','host','port','Smtp','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','CloudProvider','data5','pass','./mailAccount.attributes','exports','define'];(function(_0x51244e,_0x24c7e6){var _0x58d71c=function(_0x3a8ea5){while(--_0x3a8ea5){_0x51244e['push'](_0x51244e['shift']());}};_0x58d71c(++_0x24c7e6);}(_0x7cc7,0x19f));var _0x77cc=function(_0x270c06,_0x3a1e11){_0x270c06=_0x270c06-0x0;var _0x5aa474=_0x7cc7[_0x270c06];return _0x5aa474;};'use strict';var attributes=require(_0x77cc('0x0'));module[_0x77cc('0x1')]=function(_0x3cd558){return _0x3cd558[_0x77cc('0x2')](_0x77cc('0x3'),attributes,{'tableName':_0x77cc('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x12ff95=this;var _0x199d41={'id':_0x12ff95['id'],'tls':{'rejectUnauthorized':![]}};if(_0x12ff95[_0x77cc('0x5')]!==_0x77cc('0x6')){_0x199d41[_0x77cc('0x7')]=_0x12ff95[_0x77cc('0x5')];}else{_0x199d41[_0x77cc('0x8')]=_0x12ff95['Smtp'][_0x77cc('0x8')];_0x199d41['port']=_0x12ff95['Smtp'][_0x77cc('0x9')];_0x199d41['secure']=_0x12ff95[_0x77cc('0xa')]['secure'];}if(_0x12ff95[_0x77cc('0xa')][_0x77cc('0xb')]){if(_0x12ff95[_0x77cc('0xa')][_0x77cc('0xc')]){if(!_0x12ff95[_0x77cc('0xa')]['CloudProvider'])throw new Error(_0x77cc('0xd'));_0x199d41[_0x77cc('0xe')]={'type':_0x77cc('0xf'),'user':_0x12ff95[_0x77cc('0xa')]['user'],'accessToken':_0x12ff95[_0x77cc('0xa')][_0x77cc('0x10')][_0x77cc('0x11')]};}else{_0x199d41[_0x77cc('0xe')]={'user':_0x12ff95[_0x77cc('0xa')]['user'],'pass':_0x12ff95[_0x77cc('0xa')][_0x77cc('0x12')]};}}return _0x199d41;}}});};
\ No newline at end of file
+var _0x4d3c=['CloudProvider','auth','data5','user','./mailAccount.attributes','exports','mail_accounts','provider','custom','service','Smtp','host','port','secure','modernAuthentication'];(function(_0x648163,_0x241576){var _0x199d4d=function(_0x23055d){while(--_0x23055d){_0x648163['push'](_0x648163['shift']());}};_0x199d4d(++_0x241576);}(_0x4d3c,0x1f3));var _0xc4d3=function(_0xba306c,_0x35546e){_0xba306c=_0xba306c-0x0;var _0x1a21ee=_0x4d3c[_0xba306c];return _0x1a21ee;};'use strict';var attributes=require(_0xc4d3('0x0'));module[_0xc4d3('0x1')]=function(_0x1be215){return _0x1be215['define']('MailAccount',attributes,{'tableName':_0xc4d3('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x43de35=this;var _0x17cf39={'id':_0x43de35['id'],'tls':{'rejectUnauthorized':![]}};if(_0x43de35[_0xc4d3('0x3')]!==_0xc4d3('0x4')){_0x17cf39[_0xc4d3('0x5')]=_0x43de35['provider'];}else{_0x17cf39['host']=_0x43de35[_0xc4d3('0x6')][_0xc4d3('0x7')];_0x17cf39[_0xc4d3('0x8')]=_0x43de35[_0xc4d3('0x6')][_0xc4d3('0x8')];_0x17cf39[_0xc4d3('0x9')]=_0x43de35[_0xc4d3('0x6')][_0xc4d3('0x9')];}if(_0x43de35[_0xc4d3('0x6')]['authentication']){if(_0x43de35['Smtp'][_0xc4d3('0xa')]){if(!_0x43de35[_0xc4d3('0x6')][_0xc4d3('0xb')])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x17cf39[_0xc4d3('0xc')]={'type':'OAuth2','user':_0x43de35['Smtp']['user'],'accessToken':_0x43de35[_0xc4d3('0x6')][_0xc4d3('0xb')][_0xc4d3('0xd')]};}else{_0x17cf39[_0xc4d3('0xc')]={'user':_0x43de35[_0xc4d3('0x6')][_0xc4d3('0xe')],'pass':_0x43de35['Smtp']['pass']};}}return _0x17cf39;}}});};
\ No newline at end of file
index 8236ba9..40b77ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x524e=['ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','model','map','catch','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','stringify','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','updatedAt','CompanyId','ListId','from','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','account','CmList','List','Contacts','DESC','MailApplication','MailServerOut','CloudProvider','get','Applications','applications','orderBy','priority','asc','autoclose','push','length','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','update','interaction','created','MailMessage','attachments','originTo','originCc','bcc'];(function(_0x91d019,_0x5223c4){var _0x19de1f=function(_0x3e1311){while(--_0x3e1311){_0x91d019['push'](_0x91d019['shift']());}};_0x19de1f(++_0x5223c4);}(_0x524e,0x15e));var _0xe524=function(_0x32fdb9,_0x156fcd){_0x32fdb9=_0x32fdb9-0x0;var _0x2d8be2=_0x524e[_0x32fdb9];return _0x2d8be2;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0xe524('0x0'));var rs=require(_0xe524('0x1'));var Redis=require(_0xe524('0x2'));var db=require(_0xe524('0x3'))['db'];var logger=require(_0xe524('0x4'))(_0xe524('0x5'));var config=require(_0xe524('0x6'));var jayson=require(_0xe524('0x7'));var client=jayson[_0xe524('0x8')][_0xe524('0x9')]({'port':0x232c});config['redis']=_[_0xe524('0xa')](config[_0xe524('0xb')],{'host':_0xe524('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe524('0xb')]));require(_0xe524('0xd'))[_0xe524('0xe')](socket);function respondWithRpcPromise(_0x1f36e5,_0x991924,_0x4082b1){return new BPromise(function(_0x1a08e2,_0xb3eb9f){return client[_0xe524('0xf')](_0x1f36e5,_0x4082b1)[_0xe524('0x10')](function(_0x1e4459){logger[_0xe524('0x11')](_0xe524('0x12'),_0x991924,_0xe524('0x13'));logger[_0xe524('0x14')](_0xe524('0x15'),_0x991924,'request\x20sent',JSON['stringify'](_0x1e4459));if(_0x1e4459[_0xe524('0x16')]){if(_0x1e4459[_0xe524('0x16')][_0xe524('0x17')]===0x1f4){logger[_0xe524('0x16')](_0xe524('0x12'),_0x991924,_0x1e4459['error'][_0xe524('0x18')]);return _0xb3eb9f(_0x1e4459['error'][_0xe524('0x18')]);}logger[_0xe524('0x16')]('MailAccount,\x20%s,\x20%s',_0x991924,_0x1e4459[_0xe524('0x16')]['message']);return _0x1a08e2(_0x1e4459[_0xe524('0x16')]['message']);}else{logger[_0xe524('0x11')]('MailAccount,\x20%s,\x20%s',_0x991924,'request\x20sent');_0x1a08e2(_0x1e4459['result'][_0xe524('0x18')]);}})['catch'](function(_0x11b2a1){logger[_0xe524('0x16')](_0xe524('0x12'),_0x991924,_0x11b2a1);_0xb3eb9f(_0x11b2a1);});});}exports[_0xe524('0x19')]=function(_0x5d7b17){var _0x1fd93a=this;return new Promise(function(_0x3ccb3f,_0x49d104){return db[_0xe524('0x1a')][_0xe524('0x1b')]({'raw':_0x5d7b17[_0xe524('0x1c')]?_0x5d7b17[_0xe524('0x1c')][_0xe524('0x1d')]===undefined?!![]:![]:!![],'where':_0x5d7b17[_0xe524('0x1c')]?_0x5d7b17[_0xe524('0x1c')][_0xe524('0x1e')]||null:null,'attributes':_0x5d7b17[_0xe524('0x1c')]?_0x5d7b17['options'][_0xe524('0x1f')]||null:null,'limit':_0x5d7b17['options']?_0x5d7b17['options'][_0xe524('0x20')]||null:null,'include':_0x5d7b17[_0xe524('0x1c')]?_0x5d7b17[_0xe524('0x1c')][_0xe524('0x21')]?_['map'](_0x5d7b17[_0xe524('0x1c')]['include'],function(_0x17e245){return{'model':db[_0x17e245[_0xe524('0x22')]],'as':_0x17e245['as'],'attributes':_0x17e245[_0xe524('0x1f')],'include':_0x17e245[_0xe524('0x21')]?_[_0xe524('0x23')](_0x17e245[_0xe524('0x21')],function(_0x2141db){return{'model':db[_0x2141db['model']],'as':_0x2141db['as'],'attributes':_0x2141db['attributes'],'include':_0x2141db[_0xe524('0x21')]?_[_0xe524('0x23')](_0x2141db[_0xe524('0x21')],function(_0x109a96){return{'model':db[_0x109a96[_0xe524('0x22')]],'as':_0x109a96['as'],'attributes':_0x109a96['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b1ff){logger[_0xe524('0x11')](_0xe524('0x19'),_0x5d7b17);logger[_0xe524('0x14')](_0xe524('0x19'),_0x5d7b17,JSON['stringify'](_0x4b1ff));_0x3ccb3f(_0x4b1ff);})[_0xe524('0x24')](function(_0x9a7e98){logger['error']('GetMailAccount',_0x9a7e98[_0xe524('0x18')],_0x5d7b17);_0x49d104(_0x1fd93a[_0xe524('0x16')](0x1f4,_0x9a7e98['message']));});});};exports[_0xe524('0x25')]=function(_0x535354){var _0x3fec06=this;return new Promise(function(_0x54af2a,_0x315e56){return db[_0xe524('0x1a')][_0xe524('0x26')]({'raw':_0x535354['options']?_0x535354[_0xe524('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x535354[_0xe524('0x1c')]?_0x535354[_0xe524('0x1c')][_0xe524('0x1e')]||null:null,'attributes':_0x535354['options']?_0x535354[_0xe524('0x1c')][_0xe524('0x1f')]||null:null,'include':_0x535354['options']?_0x535354[_0xe524('0x1c')][_0xe524('0x21')]?_[_0xe524('0x23')](_0x535354[_0xe524('0x1c')]['include'],function(_0x415450){return{'model':db[_0x415450[_0xe524('0x22')]],'as':_0x415450['as'],'attributes':_0x415450[_0xe524('0x1f')],'include':_0x415450[_0xe524('0x21')]?_[_0xe524('0x23')](_0x415450[_0xe524('0x21')],function(_0x2741e8){return{'model':db[_0x2741e8[_0xe524('0x22')]],'as':_0x2741e8['as'],'attributes':_0x2741e8['attributes'],'include':_0x2741e8[_0xe524('0x21')]?_['map'](_0x2741e8[_0xe524('0x21')],function(_0x53eeee){return{'model':db[_0x53eeee['model']],'as':_0x53eeee['as'],'attributes':_0x53eeee[_0xe524('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c3aae){if(_0x535354[_0xe524('0x1c')][_0xe524('0x27')]===!![])_0x1c3aae[_0xe524('0x28')](_0xe524('0x29'),_0x1c3aae[_0xe524('0x2a')]());logger[_0xe524('0x11')](_0xe524('0x25'),_0x535354);logger['debug'](_0xe524('0x25'),_0x535354,JSON[_0xe524('0x2b')](_0x1c3aae));_0x54af2a(_0x1c3aae);})[_0xe524('0x24')](function(_0x3fd023){logger[_0xe524('0x16')](_0xe524('0x25'),_0x3fd023[_0xe524('0x18')],_0x535354);_0x315e56(_0x3fec06[_0xe524('0x16')](0x1f4,_0x3fd023['message']));});});};exports[_0xe524('0x2c')]=function(_0x849307){var _0x2e4a13=this;return new Promise(function(_0x59781b,_0x238673){var _0x5213ed={'body':_0x849307[_0xe524('0x2d')],'channel':_0xe524('0x2e')};var _0x43c314=_[_0xe524('0x2f')](_[_0xe524('0x30')](db[_0xe524('0x31')][_0xe524('0x32')]),['createdAt',_0xe524('0x33'),_0xe524('0x34'),_0xe524('0x35')]);var _0x376505=![];if(_0x849307[_0xe524('0x2d')]['id']){delete _0x849307[_0xe524('0x2d')]['id'];}if(_['isNil'](_0x849307[_0xe524('0x2d')][_0xe524('0x36')])){return _0x238673(_0x2e4a13[_0xe524('0x16')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xe524('0x37')](_0x849307['body']['body'])||_0x849307[_0xe524('0x2d')][_0xe524('0x2d')]===''){return _0x238673(_0x2e4a13['error'](0x1f4,_0xe524('0x38')));}if(_[_0xe524('0x37')](_0x849307[_0xe524('0x2d')][_0xe524('0x39')])){return _0x238673(_0x2e4a13['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x43c314));}if(!_[_0xe524('0x3a')](_0x43c314,_0x849307[_0xe524('0x2d')]['mapKey'])){return _0x238673(_0x2e4a13[_0xe524('0x16')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x43c314));}var _0x472519={};_0x472519[_0x849307[_0xe524('0x2d')][_0xe524('0x39')]]=_0x849307[_0xe524('0x2d')][_0xe524('0x36')];return db[_0xe524('0x1a')][_0xe524('0x26')]({'where':{'id':_0x849307[_0xe524('0x3b')]['id']},'include':[{'model':db[_0xe524('0x3c')],'as':_0xe524('0x3d'),'include':[{'model':db[_0xe524('0x31')],'as':_0xe524('0x3e'),'where':_0x472519,'limit':0x1,'order':[[_0xe524('0x33'),_0xe524('0x3f')]]}]},{'model':db[_0xe524('0x40')],'as':'Applications'},{'model':db[_0xe524('0x41')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0xe524('0x42')}]}]})['then'](function(_0x232cf0){if(_0x232cf0&&_0x232cf0[_0xe524('0x3d')]){var _0x561107=_0x232cf0[_0xe524('0x43')]({'plain':!![]});_0x5213ed['account']=_['omit'](_0x561107,[_0xe524('0x44'),_0xe524('0x3d')]);_0x5213ed[_0xe524('0x3b')]['smtpOptions']=_0x232cf0['getSmtpOptions']();_0x5213ed['applications']=_0x561107['Applications'];_0x5213ed['list']=_0x561107['List'];_0x5213ed[_0xe524('0x45')]=_[_0xe524('0x46')](_0x5213ed['applications'],[_0xe524('0x47')],[_0xe524('0x48')]);if(_0x5213ed[_0xe524('0x3b')]&&_0x5213ed[_0xe524('0x3b')][_0xe524('0x49')]){_0x5213ed['applications'][_0xe524('0x4a')]({'id':0x0,'priority':_0x5213ed[_0xe524('0x45')][_0xe524('0x4b')]+0x1,'app':'close','appdata':_0xe524('0x49'),'interval':'*,*,*,*'});}if(_0x5213ed[_0xe524('0x3b')][_0xe524('0x44')]){delete _0x5213ed[_0xe524('0x3b')][_0xe524('0x44')];}if(_0x5213ed[_0xe524('0x3b')][_0xe524('0x3d')]){delete _0x5213ed[_0xe524('0x3b')][_0xe524('0x3d')];}if(_0x561107[_0xe524('0x3d')][_0xe524('0x3e')][_0xe524('0x4b')]){return _0x561107[_0xe524('0x3d')]['Contacts'][0x0];}var _0x4dac0f=_['defaults'](_0x849307[_0xe524('0x2d')],{'firstName':_0x849307[_0xe524('0x2d')][_0xe524('0x36')],'ListId':_0x561107[_0xe524('0x35')]});_0x4dac0f[_0x849307[_0xe524('0x2d')][_0xe524('0x39')]]=_0x849307[_0xe524('0x2d')][_0xe524('0x36')];return db[_0xe524('0x31')][_0xe524('0x4c')](_0x4dac0f);}else{throw new Error(_0xe524('0x4d'));}})['then'](function(_0x5012fc){_0x5213ed[_0xe524('0x4e')]=_0x5012fc;if(_0x5012fc){if(!_0x849307['body']['message']['messageId']){_0x849307['body'][_0xe524('0x18')][_0xe524('0x4f')]=rs[_0xe524('0x50')]()+'\x20'+_0x849307[_0xe524('0x2d')]['message'][_0xe524('0x36')];}var _0x244f08={'ContactId':_0x5012fc['id'],'MailAccountId':_0x849307[_0xe524('0x3b')]['id'],'inReplyTo':_0x849307[_0xe524('0x2d')]['message']['messageId'],'to':_0x849307['body'][_0xe524('0x18')]['from'],'cc':_0x849307[_0xe524('0x2d')][_0xe524('0x18')]['cc'],'subject':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x51')],'attach':_0x849307['body']['message'][_0xe524('0x52')],'lastMsgAt':moment()[_0xe524('0x53')](_0xe524('0x54')),'lastMsgDirection':'in'};return db[_0xe524('0x55')][_0xe524('0x26')]({'where':{'closed':![],'MailAccountId':_0x849307[_0xe524('0x3b')]['id']},'include':[{'model':db['MailMessage'],'as':_0xe524('0x56'),'attributes':[_0xe524('0x4f')],'where':{'messageId':_0x849307[_0xe524('0x2d')]['message'][_0xe524('0x57')]}}]})[_0xe524('0x10')](function(_0x3bd9f9){if(_0x3bd9f9){return[_0x3bd9f9,![]];}return db['MailInteraction']['create'](_0x244f08)[_0xe524('0x10')](function(_0x35cbe9){return[_0x35cbe9,!![]];});});}else{throw new Error(_0xe524('0x58'));}})[_0xe524('0x59')](function(_0x139a0a,_0x4c6869){if(_0x139a0a){_0x376505=_0x4c6869;if(!_0x4c6869){return _0x139a0a[_0xe524('0x5a')]({'inReplyTo':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x4f')],'to':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x36')],'cc':_0x849307[_0xe524('0x2d')][_0xe524('0x18')]['cc'],'subject':_0x849307[_0xe524('0x2d')][_0xe524('0x18')]['subject'],'attach':_0x139a0a[_0xe524('0x52')]?_0x139a0a[_0xe524('0x52')]:_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x52')],'substatus':null,'substatusAt':moment()['format'](_0xe524('0x54')),'lastMsgAt':moment()[_0xe524('0x53')](_0xe524('0x54')),'lastMsgDirection':'in'});}else{return _0x139a0a;}}})[_0xe524('0x10')](function(_0x387c4b){_0x5213ed[_0xe524('0x5b')]=_0x387c4b[_0xe524('0x43')]({'plain':!![]});_0x5213ed['interaction'][_0xe524('0x5c')]=_0x376505;return db[_0xe524('0x5d')][_0xe524('0x4c')]({'body':_0x849307[_0xe524('0x2d')]['body'],'MailAccountId':_0x849307[_0xe524('0x3b')]['id'],'MailInteractionId':_0x387c4b['id'],'direction':'in','ContactId':_0x5213ed['contact']['id'],'messageId':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x4f')],'from':_0x849307['body'][_0xe524('0x18')][_0xe524('0x36')],'to':_0x849307[_0xe524('0x2d')][_0xe524('0x18')]['to'],'cc':_0x849307[_0xe524('0x2d')]['message']['cc'],'subject':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x51')],'attach':_0x849307[_0xe524('0x2d')][_0xe524('0x18')]['attach'],'Attachments':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x5e')],'originTo':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x5f')],'originCc':_0x849307['body'][_0xe524('0x18')][_0xe524('0x60')],'bcc':_0x849307[_0xe524('0x2d')]['message'][_0xe524('0x61')],'ChatWebsiteId':_0x849307[_0xe524('0x2d')]['message'][_0xe524('0x62')]||null,'originChannel':_0x849307[_0xe524('0x2d')][_0xe524('0x18')][_0xe524('0x63')]||_0xe524('0x64'),'ChatOfflineMessageId':_0x849307[_0xe524('0x2d')]['message'][_0xe524('0x65')]||null},{'include':[{'model':db[_0xe524('0x66')],'as':_0xe524('0x67')}]});})[_0xe524('0x10')](function(_0x19b28a){_0x5213ed[_0xe524('0x18')]=_0x19b28a;if(_0x5213ed[_0xe524('0x5b')][_0xe524('0x68')]){return db[_0xe524('0x69')][_0xe524('0x26')]({'attributes':['id',_0xe524('0x6a')],'where':{'id':_0x5213ed[_0xe524('0x5b')][_0xe524('0x68')]}})[_0xe524('0x10')](function(_0x23425c){if(_0x23425c){_0x5213ed['applications'][_0xe524('0x6b')]({'id':0x0,'priority':0x0,'app':_0xe524('0x6c'),'appdata':_0x23425c[_0xe524('0x6a')]+','+(_0x5213ed['account'][_0xe524('0x6d')]||0xa),'interval':_0xe524('0x6e')});}return respondWithRpcPromise('Start','startRouting',_0x5213ed);});}return respondWithRpcPromise(_0xe524('0x6f'),'startRouting',_0x5213ed);})[_0xe524('0x10')](function(_0x5a6a07){_0x59781b(_0x5a6a07);})[_0xe524('0x24')](function(_0x1ed60b){_0x238673(_0x2e4a13[_0xe524('0x16')](0x1f4,_0x1ed60b[_0xe524('0x18')]));});});};
\ No newline at end of file
+var _0xba34=['MailApplication','MailServerOut','Smtp','CloudProvider','get','omit','Applications','getSmtpOptions','list','applications','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','Contacts','from','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','MailInteraction','MailMessage','Messages','inReplyTo','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','GetMailAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowMailAccount','MailAccount','find','setDataValue','smtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','DESC'];(function(_0x1ad6c9,_0x5b31e1){var _0x181127=function(_0x1a462a){while(--_0x1a462a){_0x1ad6c9['push'](_0x1ad6c9['shift']());}};_0x181127(++_0x5b31e1);}(_0xba34,0x119));var _0x4ba3=function(_0x19f467,_0x512426){_0x19f467=_0x19f467-0x0;var _0x533e67=_0xba34[_0x19f467];return _0x533e67;};'use strict';var _=require(_0x4ba3('0x0'));var moment=require(_0x4ba3('0x1'));var BPromise=require(_0x4ba3('0x2'));var rs=require(_0x4ba3('0x3'));var Redis=require(_0x4ba3('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')('rpc');var config=require(_0x4ba3('0x5'));var jayson=require(_0x4ba3('0x6'));var client=jayson[_0x4ba3('0x7')][_0x4ba3('0x8')]({'port':0x232c});config[_0x4ba3('0x9')]=_[_0x4ba3('0xa')](config[_0x4ba3('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x4ba3('0xb'))(new Redis(config[_0x4ba3('0x9')]));require(_0x4ba3('0xc'))[_0x4ba3('0xd')](socket);function respondWithRpcPromise(_0x380d60,_0xcf1ec3,_0x292f58){return new BPromise(function(_0x3f653c,_0x2ed106){return client[_0x4ba3('0xe')](_0x380d60,_0x292f58)[_0x4ba3('0xf')](function(_0x51edab){logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0xcf1ec3,'request\x20sent');logger[_0x4ba3('0x12')]('MailAccount,\x20%s,\x20%s,\x20%s',_0xcf1ec3,_0x4ba3('0x13'),JSON['stringify'](_0x51edab));if(_0x51edab[_0x4ba3('0x14')]){if(_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x15')]===0x1f4){logger[_0x4ba3('0x14')](_0x4ba3('0x11'),_0xcf1ec3,_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x16')]);return _0x2ed106(_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x16')]);}logger[_0x4ba3('0x14')](_0x4ba3('0x11'),_0xcf1ec3,_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x16')]);return _0x3f653c(_0x51edab[_0x4ba3('0x14')][_0x4ba3('0x16')]);}else{logger[_0x4ba3('0x10')]('MailAccount,\x20%s,\x20%s',_0xcf1ec3,_0x4ba3('0x13'));_0x3f653c(_0x51edab[_0x4ba3('0x17')][_0x4ba3('0x16')]);}})[_0x4ba3('0x18')](function(_0x556290){logger[_0x4ba3('0x14')](_0x4ba3('0x11'),_0xcf1ec3,_0x556290);_0x2ed106(_0x556290);});});}exports[_0x4ba3('0x19')]=function(_0x1e2ce5){var _0x184332=this;return new Promise(function(_0x125944,_0x4b2791){return db['MailAccount'][_0x4ba3('0x1a')]({'raw':_0x1e2ce5['options']?_0x1e2ce5[_0x4ba3('0x1b')][_0x4ba3('0x1c')]===undefined?!![]:![]:!![],'where':_0x1e2ce5[_0x4ba3('0x1b')]?_0x1e2ce5[_0x4ba3('0x1b')][_0x4ba3('0x1d')]||null:null,'attributes':_0x1e2ce5[_0x4ba3('0x1b')]?_0x1e2ce5['options'][_0x4ba3('0x1e')]||null:null,'limit':_0x1e2ce5[_0x4ba3('0x1b')]?_0x1e2ce5['options'][_0x4ba3('0x1f')]||null:null,'include':_0x1e2ce5['options']?_0x1e2ce5[_0x4ba3('0x1b')][_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0x1e2ce5[_0x4ba3('0x1b')][_0x4ba3('0x20')],function(_0xe29a49){return{'model':db[_0xe29a49[_0x4ba3('0x22')]],'as':_0xe29a49['as'],'attributes':_0xe29a49[_0x4ba3('0x1e')],'include':_0xe29a49[_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0xe29a49['include'],function(_0x252f37){return{'model':db[_0x252f37[_0x4ba3('0x22')]],'as':_0x252f37['as'],'attributes':_0x252f37[_0x4ba3('0x1e')],'include':_0x252f37['include']?_[_0x4ba3('0x21')](_0x252f37[_0x4ba3('0x20')],function(_0x44d78c){return{'model':db[_0x44d78c['model']],'as':_0x44d78c['as'],'attributes':_0x44d78c[_0x4ba3('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4ba3('0xf')](function(_0x34ecb4){logger[_0x4ba3('0x10')]('GetMailAccount',_0x1e2ce5);logger['debug'](_0x4ba3('0x19'),_0x1e2ce5,JSON[_0x4ba3('0x23')](_0x34ecb4));_0x125944(_0x34ecb4);})[_0x4ba3('0x18')](function(_0x19f039){logger[_0x4ba3('0x14')](_0x4ba3('0x19'),_0x19f039['message'],_0x1e2ce5);_0x4b2791(_0x184332[_0x4ba3('0x14')](0x1f4,_0x19f039[_0x4ba3('0x16')]));});});};exports[_0x4ba3('0x24')]=function(_0xbf95b3){var _0x2a6757=this;return new Promise(function(_0x1a7a2c,_0x457236){return db[_0x4ba3('0x25')][_0x4ba3('0x26')]({'raw':_0xbf95b3[_0x4ba3('0x1b')]?_0xbf95b3['options']['raw']===undefined?!![]:![]:!![],'where':_0xbf95b3['options']?_0xbf95b3[_0x4ba3('0x1b')][_0x4ba3('0x1d')]||null:null,'attributes':_0xbf95b3[_0x4ba3('0x1b')]?_0xbf95b3[_0x4ba3('0x1b')][_0x4ba3('0x1e')]||null:null,'include':_0xbf95b3[_0x4ba3('0x1b')]?_0xbf95b3[_0x4ba3('0x1b')][_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0xbf95b3[_0x4ba3('0x1b')][_0x4ba3('0x20')],function(_0x3439cb){return{'model':db[_0x3439cb['model']],'as':_0x3439cb['as'],'attributes':_0x3439cb[_0x4ba3('0x1e')],'include':_0x3439cb[_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0x3439cb['include'],function(_0x188f8c){return{'model':db[_0x188f8c['model']],'as':_0x188f8c['as'],'attributes':_0x188f8c[_0x4ba3('0x1e')],'include':_0x188f8c[_0x4ba3('0x20')]?_[_0x4ba3('0x21')](_0x188f8c[_0x4ba3('0x20')],function(_0xf892e1){return{'model':db[_0xf892e1[_0x4ba3('0x22')]],'as':_0xf892e1['as'],'attributes':_0xf892e1['attributes']};}):[]};}):[]};}):[]:[]})[_0x4ba3('0xf')](function(_0x3cf56c){if(_0xbf95b3[_0x4ba3('0x1b')]['smtp']===!![])_0x3cf56c[_0x4ba3('0x27')](_0x4ba3('0x28'),_0x3cf56c['getSmtpOptions']());logger[_0x4ba3('0x10')]('ShowMailAccount',_0xbf95b3);logger['debug'](_0x4ba3('0x24'),_0xbf95b3,JSON[_0x4ba3('0x23')](_0x3cf56c));_0x1a7a2c(_0x3cf56c);})[_0x4ba3('0x18')](function(_0x2b14e1){logger[_0x4ba3('0x14')]('ShowMailAccount',_0x2b14e1[_0x4ba3('0x16')],_0xbf95b3);_0x457236(_0x2a6757[_0x4ba3('0x14')](0x1f4,_0x2b14e1[_0x4ba3('0x16')]));});});};exports[_0x4ba3('0x29')]=function(_0xab7983){var _0x2acc92=this;return new Promise(function(_0x349af4,_0x2577be){var _0x553475={'body':_0xab7983[_0x4ba3('0x2a')],'channel':_0x4ba3('0x2b')};var _0x3cb07f=_[_0x4ba3('0x2c')](_[_0x4ba3('0x2d')](db[_0x4ba3('0x2e')][_0x4ba3('0x2f')]),[_0x4ba3('0x30'),_0x4ba3('0x31'),_0x4ba3('0x32'),_0x4ba3('0x33')]);var _0x1c58d2=![];if(_0xab7983[_0x4ba3('0x2a')]['id']){delete _0xab7983[_0x4ba3('0x2a')]['id'];}if(_['isNil'](_0xab7983['body']['from'])){return _0x2577be(_0x2acc92['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x4ba3('0x34')](_0xab7983['body'][_0x4ba3('0x2a')])||_0xab7983['body'][_0x4ba3('0x2a')]===''){return _0x2577be(_0x2acc92[_0x4ba3('0x14')](0x1f4,_0x4ba3('0x35')));}if(_[_0x4ba3('0x34')](_0xab7983[_0x4ba3('0x2a')]['mapKey'])){return _0x2577be(_0x2acc92[_0x4ba3('0x14')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3cb07f));}if(!_[_0x4ba3('0x36')](_0x3cb07f,_0xab7983['body'][_0x4ba3('0x37')])){return _0x2577be(_0x2acc92[_0x4ba3('0x14')](0x1f4,_0x4ba3('0x38')+_0x3cb07f));}var _0x261a5e={};_0x261a5e[_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x37')]]=_0xab7983[_0x4ba3('0x2a')]['from'];return db[_0x4ba3('0x25')][_0x4ba3('0x26')]({'where':{'id':_0xab7983[_0x4ba3('0x39')]['id']},'include':[{'model':db[_0x4ba3('0x3a')],'as':_0x4ba3('0x3b'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x261a5e,'limit':0x1,'order':[[_0x4ba3('0x31'),_0x4ba3('0x3c')]]}]},{'model':db[_0x4ba3('0x3d')],'as':'Applications'},{'model':db[_0x4ba3('0x3e')],'as':_0x4ba3('0x3f'),'include':[{'model':db[_0x4ba3('0x40')],'as':'CloudProvider'}]}]})['then'](function(_0x34dc04){if(_0x34dc04&&_0x34dc04['List']){var _0x439acf=_0x34dc04[_0x4ba3('0x41')]({'plain':!![]});_0x553475[_0x4ba3('0x39')]=_[_0x4ba3('0x42')](_0x439acf,[_0x4ba3('0x43'),_0x4ba3('0x3b')]);_0x553475['account'][_0x4ba3('0x28')]=_0x34dc04[_0x4ba3('0x44')]();_0x553475['applications']=_0x439acf[_0x4ba3('0x43')];_0x553475[_0x4ba3('0x45')]=_0x439acf[_0x4ba3('0x3b')];_0x553475[_0x4ba3('0x46')]=_[_0x4ba3('0x47')](_0x553475['applications'],[_0x4ba3('0x48')],[_0x4ba3('0x49')]);if(_0x553475['account']&&_0x553475[_0x4ba3('0x39')][_0x4ba3('0x4a')]){_0x553475[_0x4ba3('0x46')][_0x4ba3('0x4b')]({'id':0x0,'priority':_0x553475[_0x4ba3('0x46')][_0x4ba3('0x4c')]+0x1,'app':_0x4ba3('0x4d'),'appdata':_0x4ba3('0x4a'),'interval':_0x4ba3('0x4e')});}if(_0x553475[_0x4ba3('0x39')][_0x4ba3('0x43')]){delete _0x553475[_0x4ba3('0x39')][_0x4ba3('0x43')];}if(_0x553475[_0x4ba3('0x39')][_0x4ba3('0x3b')]){delete _0x553475['account']['List'];}if(_0x439acf['List'][_0x4ba3('0x4f')][_0x4ba3('0x4c')]){return _0x439acf[_0x4ba3('0x3b')][_0x4ba3('0x4f')][0x0];}var _0x40af1d=_['defaults'](_0xab7983[_0x4ba3('0x2a')],{'firstName':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x50')],'ListId':_0x439acf[_0x4ba3('0x33')]});_0x40af1d[_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x37')]]=_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x50')];return db[_0x4ba3('0x2e')][_0x4ba3('0x51')](_0x40af1d);}else{throw new Error(_0x4ba3('0x52'));}})[_0x4ba3('0xf')](function(_0x317b9f){_0x553475[_0x4ba3('0x53')]=_0x317b9f;if(_0x317b9f){if(!_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x54')]){_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x54')]=rs[_0x4ba3('0x55')]()+'\x20'+_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['from'];}var _0x8ea419={'ContactId':_0x317b9f['id'],'MailAccountId':_0xab7983[_0x4ba3('0x39')]['id'],'inReplyTo':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x54')],'to':_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x50')],'cc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['cc'],'subject':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x56')],'attach':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x57')],'lastMsgAt':moment()[_0x4ba3('0x58')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x4ba3('0x59')][_0x4ba3('0x26')]({'where':{'closed':![],'MailAccountId':_0xab7983[_0x4ba3('0x39')]['id']},'include':[{'model':db[_0x4ba3('0x5a')],'as':_0x4ba3('0x5b'),'attributes':[_0x4ba3('0x54')],'where':{'messageId':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x5c')]}}]})[_0x4ba3('0xf')](function(_0x1afc5e){if(_0x1afc5e){return[_0x1afc5e,![]];}return db['MailInteraction'][_0x4ba3('0x51')](_0x8ea419)[_0x4ba3('0xf')](function(_0x55c03c){return[_0x55c03c,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x4ba3('0x5d')](function(_0x296bf6,_0x5c7c2f){if(_0x296bf6){_0x1c58d2=_0x5c7c2f;if(!_0x5c7c2f){return _0x296bf6[_0x4ba3('0x5e')]({'inReplyTo':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['messageId'],'to':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x50')],'cc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['cc'],'subject':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x56')],'attach':_0x296bf6[_0x4ba3('0x57')]?_0x296bf6[_0x4ba3('0x57')]:_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x57')],'substatus':null,'substatusAt':moment()[_0x4ba3('0x58')](_0x4ba3('0x5f')),'lastMsgAt':moment()[_0x4ba3('0x58')](_0x4ba3('0x5f')),'lastMsgDirection':'in'});}else{return _0x296bf6;}}})[_0x4ba3('0xf')](function(_0x424477){_0x553475['interaction']=_0x424477['get']({'plain':!![]});_0x553475[_0x4ba3('0x60')]['created']=_0x1c58d2;return db[_0x4ba3('0x5a')][_0x4ba3('0x51')]({'body':_0xab7983[_0x4ba3('0x2a')]['body'],'MailAccountId':_0xab7983[_0x4ba3('0x39')]['id'],'MailInteractionId':_0x424477['id'],'direction':'in','ContactId':_0x553475[_0x4ba3('0x53')]['id'],'messageId':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x54')],'from':_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x50')],'to':_0xab7983['body'][_0x4ba3('0x16')]['to'],'cc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')]['cc'],'subject':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x56')],'attach':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x57')],'Attachments':_0xab7983['body'][_0x4ba3('0x16')][_0x4ba3('0x61')],'originTo':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x62')],'originCc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x63')],'bcc':_0xab7983[_0x4ba3('0x2a')][_0x4ba3('0x16')][_0x4ba3('0x64')],'ChatWebsiteId':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x65')]||null,'originChannel':_0xab7983[_0x4ba3('0x2a')]['message'][_0x4ba3('0x66')]||_0x4ba3('0x67'),'ChatOfflineMessageId':_0xab7983['body']['message'][_0x4ba3('0x68')]||null},{'include':[{'model':db[_0x4ba3('0x69')],'as':_0x4ba3('0x6a')}]});})[_0x4ba3('0xf')](function(_0x37b966){_0x553475[_0x4ba3('0x16')]=_0x37b966;if(_0x553475[_0x4ba3('0x60')][_0x4ba3('0x6b')]){return db['User'][_0x4ba3('0x26')]({'attributes':['id','name'],'where':{'id':_0x553475[_0x4ba3('0x60')][_0x4ba3('0x6b')]}})[_0x4ba3('0xf')](function(_0x3c3638){if(_0x3c3638){_0x553475[_0x4ba3('0x46')][_0x4ba3('0x6c')]({'id':0x0,'priority':0x0,'app':_0x4ba3('0x6d'),'appdata':_0x3c3638[_0x4ba3('0x6e')]+','+(_0x553475['account'][_0x4ba3('0x6f')]||0xa),'interval':_0x4ba3('0x4e')});}return respondWithRpcPromise(_0x4ba3('0x70'),'startRouting',_0x553475);});}return respondWithRpcPromise(_0x4ba3('0x70'),_0x4ba3('0x71'),_0x553475);})[_0x4ba3('0xf')](function(_0x39d428){_0x349af4(_0x39d428);})[_0x4ba3('0x18')](function(_0x2569bc){_0x2577be(_0x2acc92[_0x4ba3('0x14')](0x1f4,_0x2569bc['message']));});});};
\ No newline at end of file
index 825d7a2..9041ff5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1349=['emit','removeListener','./mailAccount.events','save','remove','update'];(function(_0x440afd,_0xa12aa2){var _0xd42d98=function(_0x4b33a4){while(--_0x4b33a4){_0x440afd['push'](_0x440afd['shift']());}};_0xd42d98(++_0xa12aa2);}(_0x1349,0x1ac));var _0x9134=function(_0x1a10ed,_0x41da4e){_0x1a10ed=_0x1a10ed-0x0;var _0x258462=_0x1349[_0x1a10ed];return _0x258462;};'use strict';var MailAccountEvents=require(_0x9134('0x0'));var events=[_0x9134('0x1'),_0x9134('0x2'),_0x9134('0x3')];function createListener(_0x35d01f,_0x2ac8ca){return function(_0x45124a){_0x2ac8ca[_0x9134('0x4')](_0x35d01f,_0x45124a);};}function removeListener(_0x276239,_0x5e7f95){return function(){MailAccountEvents[_0x9134('0x5')](_0x276239,_0x5e7f95);};}exports['register']=function(_0x147fb6){for(var _0x16b31e=0x0,_0x23eb8e=events['length'];_0x16b31e<_0x23eb8e;_0x16b31e++){var _0x54ff29=events[_0x16b31e];var _0x17608f=createListener('mailAccount:'+_0x54ff29,_0x147fb6);MailAccountEvents['on'](_0x54ff29,_0x17608f);}};
\ No newline at end of file
+var _0xf452=['remove','emit','length','mailAccount:','save'];(function(_0x25f54e,_0x5dada8){var _0x3f3816=function(_0x3649a4){while(--_0x3649a4){_0x25f54e['push'](_0x25f54e['shift']());}};_0x3f3816(++_0x5dada8);}(_0xf452,0x144));var _0x2f45=function(_0x181df0,_0xdb4f2){_0x181df0=_0x181df0-0x0;var _0x4c375d=_0xf452[_0x181df0];return _0x4c375d;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x2f45('0x0'),_0x2f45('0x1'),'update'];function createListener(_0x38a4c7,_0x4f3dbc){return function(_0x32aba1){_0x4f3dbc[_0x2f45('0x2')](_0x38a4c7,_0x32aba1);};}function removeListener(_0x6534b6,_0x2ff5c6){return function(){MailAccountEvents['removeListener'](_0x6534b6,_0x2ff5c6);};}exports['register']=function(_0x22709e){for(var _0x318248=0x0,_0x6e7307=events[_0x2f45('0x3')];_0x318248<_0x6e7307;_0x318248++){var _0x1c6169=events[_0x318248];var _0xf97870=createListener(_0x2f45('0x4')+_0x1c6169,_0x22709e);MailAccountEvents['on'](_0x1c6169,_0xf97870);}};
\ No newline at end of file
index 7d89d5b..23272b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0a3=['show','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','./mailApplication.controller','get','/:id','isAuthenticated'];(function(_0x1c9326,_0x4f65bd){var _0x33e2e4=function(_0x34bceb){while(--_0x34bceb){_0x1c9326['push'](_0x1c9326['shift']());}};_0x33e2e4(++_0x4f65bd);}(_0xa0a3,0x15f));var _0x3a0a=function(_0x510e2b,_0xd83075){_0x510e2b=_0x510e2b-0x0;var _0x544b1d=_0xa0a3[_0x510e2b];return _0x544b1d;};'use strict';var multer=require(_0x3a0a('0x0'));var util=require(_0x3a0a('0x1'));var path=require('path');var timeout=require(_0x3a0a('0x2'));var express=require('express');var router=express[_0x3a0a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3a0a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3a0a('0x5'));router[_0x3a0a('0x6')](_0x3a0a('0x7'),auth[_0x3a0a('0x8')](),controller[_0x3a0a('0x9')]);router[_0x3a0a('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x3a0a('0xb')]);router[_0x3a0a('0xc')](_0x3a0a('0x7'),auth[_0x3a0a('0x8')](),controller[_0x3a0a('0xd')]);module[_0x3a0a('0xe')]=router;
\ No newline at end of file
+var _0x8a69=['/:id','isAuthenticated','show','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x8a69,0x15d));var _0x98a6=function(_0xf5f79a,_0x50eccd){_0xf5f79a=_0xf5f79a-0x0;var _0x17f98f=_0x8a69[_0xf5f79a];return _0x17f98f;};'use strict';var multer=require(_0x98a6('0x0'));var util=require(_0x98a6('0x1'));var path=require(_0x98a6('0x2'));var timeout=require(_0x98a6('0x3'));var express=require(_0x98a6('0x4'));var router=express[_0x98a6('0x5')]();var fs_extra=require(_0x98a6('0x6'));var auth=require(_0x98a6('0x7'));var interaction=require(_0x98a6('0x8'));var config=require(_0x98a6('0x9'));var controller=require(_0x98a6('0xa'));router[_0x98a6('0xb')](_0x98a6('0xc'),auth[_0x98a6('0xd')](),controller[_0x98a6('0xe')]);router[_0x98a6('0xf')](_0x98a6('0xc'),auth[_0x98a6('0xd')](),controller['update']);router[_0x98a6('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x98a6('0x11')]);module[_0x98a6('0x12')]=router;
\ No newline at end of file
index b1e7039..b9b3439 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fa1=['noop','sequelize','exports','STRING'];(function(_0x4a8452,_0x14ecdf){var _0x4e9139=function(_0x151ece){while(--_0x151ece){_0x4a8452['push'](_0x4a8452['shift']());}};_0x4e9139(++_0x14ecdf);}(_0x9fa1,0x1cd));var _0x19fa=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x9fa1[_0x18cd5b];return _0x5eaa52;};'use strict';var Sequelize=require(_0x19fa('0x0'));module[_0x19fa('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x19fa('0x2')],'allowNull':![],'defaultValue':_0x19fa('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x19fa('0x2')]},'interval':{'type':Sequelize[_0x19fa('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x1a77=['noop','TEXT','*,*,*,*','sequelize','STRING'];(function(_0x14a0df,_0x1c5607){var _0x453d0e=function(_0x137775){while(--_0x137775){_0x14a0df['push'](_0x14a0df['shift']());}};_0x453d0e(++_0x1c5607);}(_0x1a77,0x193));var _0x71a7=function(_0x203b5d,_0x43b9e9){_0x203b5d=_0x203b5d-0x0;var _0x1f71c4=_0x1a77[_0x203b5d];return _0x1f71c4;};'use strict';var Sequelize=require(_0x71a7('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x71a7('0x1')],'allowNull':![],'defaultValue':_0x71a7('0x2')},'appdata':{'type':Sequelize[_0x71a7('0x3')]()},'description':{'type':Sequelize[_0x71a7('0x1')]},'interval':{'type':Sequelize[_0x71a7('0x1')],'defaultValue':_0x71a7('0x4')}};
\ No newline at end of file
index eb034c6..4215504 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x188360,_0x3d93f8){var _0x1fbe6d=function(_0x3d9d32){while(--_0x3d9d32){_0x188360['push'](_0x188360['shift']());}};_0x1fbe6d(++_0x3d93f8);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={'raw':!![],'where':{'id':_0x5987ae[_0x49c4('0x29')]['id']}},_0x46e04d={};_0x46e04d[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](db[_0x49c4('0x2c')][_0x49c4('0x2d')]);_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2b')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d['filters']=_['intersection'](_0x46e04d['model'],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x46e04d[_0x49c4('0x2a')],qs[_0x49c4('0x31')](_0x5987ae['query'][_0x49c4('0x31')]));_0x2b2793[_0x49c4('0x2f')]=_0x2b2793[_0x49c4('0x2f')][_0x49c4('0x32')]?_0x2b2793['attributes']:_0x46e04d['model'];if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x33')]){_0x2b2793[_0x49c4('0x34')]=[{'all':!![]}];}_0x2b2793=_[_0x49c4('0x35')]({},_0x2b2793,_0x5987ae[_0x49c4('0x36')]);return db['MailApplication'][_0x49c4('0x37')](_0x2b2793)[_0x49c4('0x38')](handleEntityNotFound(_0x889909,null))[_0x49c4('0x38')](respondWithResult(_0x889909,null))['catch'](handleError(_0x889909,null));};exports['update']=function(_0x85dce2,_0x1991e9){if(_0x85dce2[_0x49c4('0x39')]['id']){delete _0x85dce2[_0x49c4('0x39')]['id'];}return db[_0x49c4('0x2c')][_0x49c4('0x37')]({'where':{'id':_0x85dce2[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x1991e9,null))[_0x49c4('0x38')](saveUpdates(_0x85dce2['body'],null))[_0x49c4('0x38')](respondWithResult(_0x1991e9,null))['catch'](handleError(_0x1991e9,null));};exports[_0x49c4('0x23')]=function(_0x349791,_0x2625a6){return db[_0x49c4('0x2c')]['find']({'where':{'id':_0x349791[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x2625a6,null))[_0x49c4('0x38')](removeEntity(_0x2625a6,null))['catch'](handleError(_0x2625a6,null));};
\ No newline at end of file
+var _0xa9e0=['includeAll','merge','options','find','catch','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x490e13,_0x1cfeb8){var _0x229e43=function(_0xb57ba4){while(--_0xb57ba4){_0x490e13['push'](_0x490e13['shift']());}};_0x229e43(++_0x1cfeb8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));};
\ No newline at end of file
index cb79d76..5aff6ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2399=['MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define'];(function(_0x92c11,_0x398b38){var _0x2e390c=function(_0xb77dc6){while(--_0xb77dc6){_0x92c11['push'](_0x92c11['shift']());}};_0x2e390c(++_0x398b38);}(_0x2399,0xae));var _0x9239=function(_0x26c112,_0x41e2fd){_0x26c112=_0x26c112-0x0;var _0x4933d8=_0x2399[_0x26c112];return _0x4933d8;};'use strict';var _=require(_0x9239('0x0'));var util=require(_0x9239('0x1'));var logger=require(_0x9239('0x2'))(_0x9239('0x3'));var moment=require(_0x9239('0x4'));var BPromise=require(_0x9239('0x5'));var rp=require(_0x9239('0x6'));var fs=require('fs');var path=require(_0x9239('0x7'));var rimraf=require(_0x9239('0x8'));var config=require(_0x9239('0x9'));var attributes=require(_0x9239('0xa'));module[_0x9239('0xb')]=function(_0x107677,_0x57a969){return _0x107677[_0x9239('0xc')](_0x9239('0xd'),attributes,{'tableName':_0x9239('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9239('0xf'),'collate':_0x9239('0x10')});};
\ No newline at end of file
+var _0xc46b=['request-promise','rimraf','../../config/environment','./mailApplication.attributes','exports','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0xe01c24,_0x508d50){var _0x18c6fe=function(_0x5b2f67){while(--_0x5b2f67){_0xe01c24['push'](_0xe01c24['shift']());}};_0x18c6fe(++_0x508d50);}(_0xc46b,0x19f));var _0xbc46=function(_0x422b19,_0x504527){_0x422b19=_0x422b19-0x0;var _0x42ce4c=_0xc46b[_0x422b19];return _0x42ce4c;};'use strict';var _=require(_0xbc46('0x0'));var util=require('util');var logger=require(_0xbc46('0x1'))(_0xbc46('0x2'));var moment=require(_0xbc46('0x3'));var BPromise=require(_0xbc46('0x4'));var rp=require(_0xbc46('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbc46('0x6'));var config=require(_0xbc46('0x7'));var attributes=require(_0xbc46('0x8'));module[_0xbc46('0x9')]=function(_0x3cd0b9,_0x422763){return _0x3cd0b9['define'](_0xbc46('0xa'),attributes,{'tableName':_0xbc46('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbc46('0xc'),'collate':_0xbc46('0xd')});};
\ No newline at end of file
index 3da4f9a..1656119 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c96=['MailApplication','update','body','options','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','UpdateMailApplication'];(function(_0x15fa27,_0x58995b){var _0x5effef=function(_0x1ec0ea){while(--_0x1ec0ea){_0x15fa27['push'](_0x15fa27['shift']());}};_0x5effef(++_0x58995b);}(_0x4c96,0xbb));var _0x64c9=function(_0x4585bb,_0x22baaf){_0x4585bb=_0x4585bb-0x0;var _0x515d9e=_0x4c96[_0x4585bb];return _0x515d9e;};'use strict';var _=require(_0x64c9('0x0'));var util=require(_0x64c9('0x1'));var moment=require(_0x64c9('0x2'));var BPromise=require(_0x64c9('0x3'));var rs=require(_0x64c9('0x4'));var fs=require('fs');var Redis=require(_0x64c9('0x5'));var db=require(_0x64c9('0x6'))['db'];var utils=require(_0x64c9('0x7'));var logger=require('../../config/logger')(_0x64c9('0x8'));var config=require(_0x64c9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x64c9('0xa')][_0x64c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3150d8,_0xb5f443,_0x5830f4){return new BPromise(function(_0x1345aa,_0x330e4e){return client['request'](_0x3150d8,_0x5830f4)[_0x64c9('0xc')](function(_0x43676a){logger[_0x64c9('0xd')](_0x64c9('0xe'),_0xb5f443,_0x64c9('0xf'));logger[_0x64c9('0x10')]('MailApplication,\x20%s,\x20%s,\x20%s',_0xb5f443,_0x64c9('0xf'),JSON[_0x64c9('0x11')](_0x43676a));if(_0x43676a[_0x64c9('0x12')]){if(_0x43676a[_0x64c9('0x12')][_0x64c9('0x13')]===0x1f4){logger[_0x64c9('0x12')]('MailApplication,\x20%s,\x20%s',_0xb5f443,_0x43676a['error'][_0x64c9('0x14')]);return _0x330e4e(_0x43676a['error'][_0x64c9('0x14')]);}logger[_0x64c9('0x12')](_0x64c9('0xe'),_0xb5f443,_0x43676a[_0x64c9('0x12')]['message']);return _0x1345aa(_0x43676a[_0x64c9('0x12')]['message']);}else{logger[_0x64c9('0xd')](_0x64c9('0xe'),_0xb5f443,_0x64c9('0xf'));_0x1345aa(_0x43676a['result'][_0x64c9('0x14')]);}})[_0x64c9('0x15')](function(_0x1bc8da){logger[_0x64c9('0x12')](_0x64c9('0xe'),_0xb5f443,_0x1bc8da);_0x330e4e(_0x1bc8da);});});}exports[_0x64c9('0x16')]=function(_0x482777){var _0x56d766=this;return new Promise(function(_0x402c70,_0x4b6249){return db[_0x64c9('0x17')][_0x64c9('0x18')](_0x482777[_0x64c9('0x19')],{'raw':_0x482777[_0x64c9('0x1a')]?_0x482777['options'][_0x64c9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x482777[_0x64c9('0x1a')]?_0x482777[_0x64c9('0x1a')][_0x64c9('0x1c')]||null:null,'attributes':_0x482777['options']?_0x482777['options'][_0x64c9('0x1d')]||null:null,'limit':_0x482777['options']?_0x482777[_0x64c9('0x1a')]['limit']||null:null})[_0x64c9('0xc')](function(_0xe7b9a6){logger['info'](_0x64c9('0x16'),_0x482777);logger[_0x64c9('0x10')]('UpdateMailApplication',_0x482777,JSON[_0x64c9('0x11')](_0xe7b9a6));_0x402c70(_0xe7b9a6);})[_0x64c9('0x15')](function(_0x49bf7a){logger['error'](_0x64c9('0x16'),_0x49bf7a[_0x64c9('0x14')],_0x482777);_0x4b6249(_0x56d766[_0x64c9('0x12')](0x1f4,_0x49bf7a['message']));});});};
\ No newline at end of file
+var _0x1643=['then','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailApplication','update','body','options','raw','where','attributes','limit','UpdateMailApplication','debug','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request'];(function(_0x2d1ed2,_0x1b6c6f){var _0x5906e5=function(_0x278269){while(--_0x278269){_0x2d1ed2['push'](_0x2d1ed2['shift']());}};_0x5906e5(++_0x1b6c6f);}(_0x1643,0xc9));var _0x3164=function(_0x375aaa,_0x3bf6b5){_0x375aaa=_0x375aaa-0x0;var _0x485f93=_0x1643[_0x375aaa];return _0x485f93;};'use strict';var _=require('lodash');var util=require(_0x3164('0x0'));var moment=require('moment');var BPromise=require(_0x3164('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3164('0x2'));var db=require(_0x3164('0x3'))['db'];var utils=require(_0x3164('0x4'));var logger=require('../../config/logger')(_0x3164('0x5'));var config=require('../../config/environment');var jayson=require(_0x3164('0x6'));var client=jayson['client'][_0x3164('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x44bc2a,_0x418cd3,_0x36bdc4){return new BPromise(function(_0x2db651,_0x41a012){return client[_0x3164('0x8')](_0x44bc2a,_0x36bdc4)[_0x3164('0x9')](function(_0x1f9db4){logger[_0x3164('0xa')](_0x3164('0xb'),_0x418cd3,_0x3164('0xc'));logger['debug'](_0x3164('0xd'),_0x418cd3,'request\x20sent',JSON[_0x3164('0xe')](_0x1f9db4));if(_0x1f9db4[_0x3164('0xf')]){if(_0x1f9db4['error'][_0x3164('0x10')]===0x1f4){logger['error'](_0x3164('0xb'),_0x418cd3,_0x1f9db4['error']['message']);return _0x41a012(_0x1f9db4[_0x3164('0xf')][_0x3164('0x11')]);}logger[_0x3164('0xf')]('MailApplication,\x20%s,\x20%s',_0x418cd3,_0x1f9db4['error']['message']);return _0x2db651(_0x1f9db4[_0x3164('0xf')][_0x3164('0x11')]);}else{logger[_0x3164('0xa')]('MailApplication,\x20%s,\x20%s',_0x418cd3,_0x3164('0xc'));_0x2db651(_0x1f9db4[_0x3164('0x12')]['message']);}})[_0x3164('0x13')](function(_0x497025){logger[_0x3164('0xf')](_0x3164('0xb'),_0x418cd3,_0x497025);_0x41a012(_0x497025);});});}exports['UpdateMailApplication']=function(_0x10d0f7){var _0x18d5d6=this;return new Promise(function(_0x1d8c8e,_0x3123ef){return db[_0x3164('0x14')][_0x3164('0x15')](_0x10d0f7[_0x3164('0x16')],{'raw':_0x10d0f7['options']?_0x10d0f7[_0x3164('0x17')][_0x3164('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10d0f7[_0x3164('0x17')]?_0x10d0f7[_0x3164('0x17')][_0x3164('0x19')]||null:null,'attributes':_0x10d0f7[_0x3164('0x17')]?_0x10d0f7[_0x3164('0x17')][_0x3164('0x1a')]||null:null,'limit':_0x10d0f7[_0x3164('0x17')]?_0x10d0f7[_0x3164('0x17')][_0x3164('0x1b')]||null:null})[_0x3164('0x9')](function(_0x5b0d6c){logger['info'](_0x3164('0x1c'),_0x10d0f7);logger[_0x3164('0x1d')](_0x3164('0x1c'),_0x10d0f7,JSON[_0x3164('0xe')](_0x5b0d6c));_0x1d8c8e(_0x5b0d6c);})[_0x3164('0x13')](function(_0x41cd2c){logger['error'](_0x3164('0x1c'),_0x41cd2c[_0x3164('0x11')],_0x10d0f7);_0x3123ef(_0x18d5d6[_0x3164('0xf')](0x1f4,_0x41cd2c[_0x3164('0x11')]));});});};
\ No newline at end of file
index 2efc466..be63fe6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86c1=['addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','update','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','download','post'];(function(_0x52d924,_0x35b7d2){var _0x3a0c74=function(_0x4768f6){while(--_0x4768f6){_0x52d924['push'](_0x52d924['shift']());}};_0x3a0c74(++_0x35b7d2);}(_0x86c1,0x1ea));var _0x186c=function(_0x2316d7,_0x4e35ea){_0x2316d7=_0x2316d7-0x0;var _0x3d6504=_0x86c1[_0x2316d7];return _0x3d6504;};'use strict';var express=require(_0x186c('0x0'));var router=express[_0x186c('0x1')]();var auth=require(_0x186c('0x2'));var interaction=require(_0x186c('0x3'));var controller=require('./mailInteraction.controller');router[_0x186c('0x4')]('/',auth[_0x186c('0x5')](),controller[_0x186c('0x6')]);router[_0x186c('0x4')](_0x186c('0x7'),auth[_0x186c('0x5')](),controller['describe']);router['get'](_0x186c('0x8'),auth[_0x186c('0x5')](),controller[_0x186c('0x9')]);router['get'](_0x186c('0xa'),auth[_0x186c('0x5')](),controller[_0x186c('0xb')]);router[_0x186c('0x4')]('/:id/download',auth[_0x186c('0x5')](),controller[_0x186c('0xc')]);router[_0x186c('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x186c('0xd')]('/:id/messages',auth[_0x186c('0x5')](),controller[_0x186c('0xe')]);router['post'](_0x186c('0xf'),auth[_0x186c('0x5')](),interaction[_0x186c('0x10')](_0x186c('0x11'),_0x186c('0x12')),controller[_0x186c('0x13')]);router[_0x186c('0x14')](_0x186c('0x8'),auth[_0x186c('0x5')](),interaction['tracked'](_0x186c('0x11'),'mailinteraction:update'),controller[_0x186c('0x15')]);router['delete']('/:id',auth[_0x186c('0x5')](),interaction[_0x186c('0x10')](_0x186c('0x11'),'mailinteraction:destroy'),controller['destroy']);router['delete'](_0x186c('0xf'),auth['isAuthenticated'](),controller[_0x186c('0x16')]);module[_0x186c('0x17')]=router;
\ No newline at end of file
+var _0x8e45=['delete','removeTags','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','update'];(function(_0x59eb04,_0x3c5357){var _0x22cbf8=function(_0x2a7b86){while(--_0x2a7b86){_0x59eb04['push'](_0x59eb04['shift']());}};_0x22cbf8(++_0x3c5357);}(_0x8e45,0x10a));var _0x58e4=function(_0x1b071a,_0x4a2792){_0x1b071a=_0x1b071a-0x0;var _0x18f5d9=_0x8e45[_0x1b071a];return _0x18f5d9;};'use strict';var express=require('express');var router=express[_0x58e4('0x0')]();var auth=require('../../components/auth/service');var interaction=require(_0x58e4('0x1'));var controller=require(_0x58e4('0x2'));router[_0x58e4('0x3')]('/',auth[_0x58e4('0x4')](),controller['index']);router[_0x58e4('0x3')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x58e4('0x5'),auth['isAuthenticated'](),controller[_0x58e4('0x6')]);router[_0x58e4('0x3')]('/:id/messages',auth[_0x58e4('0x4')](),controller['getMessages']);router[_0x58e4('0x3')](_0x58e4('0x7'),auth[_0x58e4('0x4')](),controller[_0x58e4('0x8')]);router[_0x58e4('0x9')]('/',auth[_0x58e4('0x4')](),controller[_0x58e4('0xa')]);router[_0x58e4('0x9')](_0x58e4('0xb'),auth['isAuthenticated'](),controller[_0x58e4('0xc')]);router['post'](_0x58e4('0xd'),auth[_0x58e4('0x4')](),interaction[_0x58e4('0xe')](_0x58e4('0xf'),_0x58e4('0x10')),controller[_0x58e4('0x11')]);router[_0x58e4('0x12')](_0x58e4('0x5'),auth[_0x58e4('0x4')](),interaction[_0x58e4('0xe')](_0x58e4('0xf'),'mailinteraction:update'),controller[_0x58e4('0x13')]);router[_0x58e4('0x14')](_0x58e4('0x5'),auth[_0x58e4('0x4')](),interaction[_0x58e4('0xe')](_0x58e4('0xf'),'mailinteraction:destroy'),controller['destroy']);router[_0x58e4('0x14')](_0x58e4('0xd'),auth[_0x58e4('0x4')](),controller[_0x58e4('0x15')]);module['exports']=router;
\ No newline at end of file
index 5e8b7b4..4bd140c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacda=['long','DATE','ENUM','out','sequelize','iconv','exports','BOOLEAN','STRING','TEXT'];(function(_0x2c0697,_0x15c276){var _0x4068d5=function(_0x19d47e){while(--_0x19d47e){_0x2c0697['push'](_0x2c0697['shift']());}};_0x4068d5(++_0x15c276);}(_0xacda,0x7c));var _0xaacd=function(_0x338b58,_0x4cc1f5){_0x338b58=_0x338b58-0x0;var _0x196efa=_0xacda[_0x338b58];return _0x196efa;};'use strict';var Sequelize=require(_0xaacd('0x0'));var iconv=require(_0xaacd('0x1'));module[_0xaacd('0x2')]={'closed':{'type':Sequelize[_0xaacd('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xaacd('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xaacd('0x4')]},'inReplyTo':{'type':Sequelize[_0xaacd('0x4')](0x1fe)},'to':{'type':Sequelize[_0xaacd('0x4')]},'cc':{'type':Sequelize[_0xaacd('0x5')](_0xaacd('0x6'))},'subject':{'type':Sequelize[_0xaacd('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xaacd('0x7')]},'substatus':{'type':Sequelize[_0xaacd('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xaacd('0x7')]},'firstMsgDirection':{'type':Sequelize[_0xaacd('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xaacd('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xaacd('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x6e45=['long','TEXT','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE','STRING'];(function(_0x5d0609,_0x127562){var _0xaa3fd1=function(_0x47f457){while(--_0x47f457){_0x5d0609['push'](_0x5d0609['shift']());}};_0xaa3fd1(++_0x127562);}(_0x6e45,0x7c));var _0x56e4=function(_0x36a94c,_0x2b5544){_0x36a94c=_0x36a94c-0x0;var _0x4f5604=_0x6e45[_0x36a94c];return _0x4f5604;};'use strict';var Sequelize=require(_0x56e4('0x0'));var iconv=require(_0x56e4('0x1'));module[_0x56e4('0x2')]={'closed':{'type':Sequelize[_0x56e4('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x56e4('0x4')]},'disposition':{'type':Sequelize[_0x56e4('0x5')]},'secondDisposition':{'type':Sequelize[_0x56e4('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x56e4('0x5')]},'inReplyTo':{'type':Sequelize[_0x56e4('0x5')](0x1fe)},'to':{'type':Sequelize[_0x56e4('0x5')]},'cc':{'type':Sequelize['TEXT'](_0x56e4('0x6'))},'subject':{'type':Sequelize[_0x56e4('0x7')]()},'attach':{'type':Sequelize[_0x56e4('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x56e4('0x4')]},'substatus':{'type':Sequelize[_0x56e4('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x56e4('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x56e4('0x8')]('in',_0x56e4('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x56e4('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x56e4('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x56e4('0x3')],'defaultValue':![]}};
\ No newline at end of file
index b4064f6..d109fac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6acc=['pick','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','addTags','setTags','ids','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','bcc','subject','mkdirSync','decode','headers','Attachments','basename','readFileSync','writeFileSync','message%d.eml','unlinkSync','sendStatus','rimraf','zip-dir','moment','bluebird','util','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','defaults','redis','socket.io-emitter','status','json','offset','undefined','limit','Content-Range','update','then','destroy','end','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','out','plainBody','-id','lastMsgText','catch','waiting','talking','answered','total','closed','UserId','index','MailInteraction','rawAttributes','type','key','model','keys','query','intersection','fields','attributes','length','nolimit','sort','field','color','from','select','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','users','u.id\x20=\x20ui.UserId','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','start','text','some','compact','isEmpty','MailAccountId','where','i.MailAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','agent','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','role','sequelize','toString','count','keyBy','merge','Account.key','a.mandatoryDisposition','a.email','Account.email','i.createdAt','i.updatedAt','i.closedAt','i.attach','i.subject','i.disposition','i.secondDisposition','i.substatus','i.to','i.ContactId','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','findOne','enableEmailPreview','all','show','params','filters','include','options','create','body','describe','addMessage','MailMessage','omit','getMessages','hasOwnProperty'];(function(_0x506d47,_0x426063){var _0x10d992=function(_0x212c4e){while(--_0x212c4e){_0x506d47['push'](_0x506d47['shift']());}};_0x10d992(++_0x426063);}(_0x6acc,0x1f3));var _0xc6ac=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x6acc[_0x39c734];return _0xb2a2f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc6ac('0x0'));var zipdir=require(_0xc6ac('0x1'));var moment=require(_0xc6ac('0x2'));var BPromise=require(_0xc6ac('0x3'));var util=require(_0xc6ac('0x4'));var path=require(_0xc6ac('0x5'));var fs=require('fs');var _=require(_0xc6ac('0x6'));var squel=require(_0xc6ac('0x7'));var juice=require(_0xc6ac('0x8'));var Redis=require(_0xc6ac('0x9'));var qs=require(_0xc6ac('0xa'));var as=require(_0xc6ac('0xb'));var logger=require('../../config/logger')(_0xc6ac('0xc'));var config=require(_0xc6ac('0xd'));var db=require('../../mysqldb')['db'];var htmlEntities=require('html-entities');config['redis']=_[_0xc6ac('0xe')](config[_0xc6ac('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0xc6ac('0x10'))(new Redis(config['redis']));require('./mailInteraction.socket')['register'](socket);function respondWithStatusCode(_0x31005a,_0x3f1a29){_0x3f1a29=_0x3f1a29||0xcc;return function(_0x1838b1){if(_0x1838b1){return _0x31005a['sendStatus'](_0x3f1a29);}return _0x31005a['status'](_0x3f1a29)['end']();};}function respondWithResult(_0x352608,_0x43a98e){_0x43a98e=_0x43a98e||0xc8;return function(_0x57dd18){if(_0x57dd18){return _0x352608[_0xc6ac('0x11')](_0x43a98e)[_0xc6ac('0x12')](_0x57dd18);}};}function respondWithFilteredResult(_0xa4ddf0,_0x567911){return function(_0x5a3fcb){if(_0x5a3fcb){var _0x51f84b=typeof _0x567911[_0xc6ac('0x13')]===_0xc6ac('0x14')&&typeof _0x567911[_0xc6ac('0x15')]==='undefined';var _0x445054=_0x5a3fcb['count'];var _0x51c704=_0x51f84b?0x0:_0x567911['offset'];var _0x429f66=_0x51f84b?_0x5a3fcb['count']:_0x567911[_0xc6ac('0x13')]+_0x567911[_0xc6ac('0x15')];var _0x2841cf;if(_0x429f66>=_0x445054){_0x429f66=_0x445054;_0x2841cf=0xc8;}else{_0x2841cf=0xce;}_0xa4ddf0[_0xc6ac('0x11')](_0x2841cf);return _0xa4ddf0['set'](_0xc6ac('0x16'),_0x51c704+'-'+_0x429f66+'/'+_0x445054)[_0xc6ac('0x12')](_0x5a3fcb);}return null;};}function saveUpdates(_0x5c6933){return function(_0x595532){if(_0x595532){return _0x595532[_0xc6ac('0x17')](_0x5c6933)[_0xc6ac('0x18')](function(_0x42d225){return _0x42d225;});}return null;};}function removeEntity(_0x2f4878){return function(_0x57f7e7){if(_0x57f7e7){return _0x57f7e7[_0xc6ac('0x19')]()['then'](function(){_0x2f4878[_0xc6ac('0x11')](0xcc)[_0xc6ac('0x1a')]();});}};}function handleEntityNotFound(_0x21770d){return function(_0x646cf){if(!_0x646cf){_0x21770d['sendStatus'](0x194);}return _0x646cf;};}function handleError(_0x547f2b,_0x42f1d7){_0x42f1d7=_0x42f1d7||0x1f4;return function(_0x4b2614){logger['error'](_0x4b2614['stack']);if(_0x4b2614['name']){delete _0x4b2614[_0xc6ac('0x1b')];}_0x547f2b[_0xc6ac('0x11')](_0x42f1d7)[_0xc6ac('0x1c')](_0x4b2614);};}function getInteractionUsers(_0x6ece83,_0x5827d2){return new BPromise(function(_0x2c34b8,_0x2a861f){try{if(_0x5827d2[_0x6ece83['id']]){_0x6ece83[_0xc6ac('0x1d')]=_[_0xc6ac('0x1e')](_0x5827d2[_0x6ece83['id']],function(_0x8e4853){return{'id':_0x8e4853['id'],'fullname':_0x8e4853[_0xc6ac('0x1f')]};});}}catch(_0xa6f44f){_0x2a861f(_0xa6f44f);}_0x2c34b8(_0x6ece83);});}function getInteractionTags(_0x4a1485,_0xbdd40){return new BPromise(function(_0x1b33b0,_0x5aa2bf){try{if(_0x4a1485[_0xc6ac('0x20')]){_0x4a1485['Tags']=[];_0x4a1485[_0xc6ac('0x20')][_0xc6ac('0x21')](',')[_0xc6ac('0x22')](function(_0xe4a91){_0x4a1485[_0xc6ac('0x23')][_0xc6ac('0x24')](_0xbdd40[_0xe4a91]);});}delete _0x4a1485['TagIds'];}catch(_0x1eb54f){_0x5aa2bf(_0x1eb54f);}_0x1b33b0(_0x4a1485);});}function getLastMessageText(_0x437b84){return new BPromise(function(_0x2426f0,_0x2f861b){return db['MailMessage']['findOne']({'where':{'$and':[{'MailInteractionId':_0x437b84['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xc6ac('0x25')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xc6ac('0x26')],'order':_0xc6ac('0x27'),'raw':!![]})[_0xc6ac('0x18')](function(_0x3b3217){if(_0x3b3217&&_0x3b3217['plainBody']){_0x437b84[_0xc6ac('0x28')]=_['trimStart'](_0x3b3217[_0xc6ac('0x26')]);}_0x2426f0(_0x437b84);})[_0xc6ac('0x29')](function(_0x5398ae){_0x2f861b(_0x5398ae);});});}function updateMailInteraction(_0x346b6c,_0x2e8cd2,_0x192a2f,_0x43e486){return new BPromise(function(_0x4d3363,_0xb371a3){return getInteractionUsers(_0x346b6c,_0x192a2f)['then'](function(_0x5bdc40){return getInteractionTags(_0x5bdc40,_0x2e8cd2);})[_0xc6ac('0x18')](function(_0x5c4c1d){return getStateInteraction(_0x5c4c1d);})['then'](function(_0x1e661b){if(_0x43e486){_0x4d3363(getLastMessageText(_0x1e661b));}else{_0x4d3363(_0x1e661b);}})[_0xc6ac('0x29')](function(_0x3be82b){_0xb371a3(_0x3be82b);});});}function getStateInteraction(_0x5d65ab){return new BPromise(function(_0x8e378){_0x5d65ab[_0xc6ac('0x2a')]=0x0;_0x5d65ab[_0xc6ac('0x2b')]=0x0;_0x5d65ab[_0xc6ac('0x2c')]=0x0;_0x5d65ab['unmanaged']=0x0;_0x5d65ab[_0xc6ac('0x2d')]=0x0;if(!_0x5d65ab[_0xc6ac('0x2e')]&&!_0x5d65ab[_0xc6ac('0x2f')]){_0x5d65ab[_0xc6ac('0x2a')]+=0x1;}if(!_0x5d65ab[_0xc6ac('0x2e')]&&_0x5d65ab[_0xc6ac('0x2f')]){_0x5d65ab[_0xc6ac('0x2b')]+=0x1;if(_0x5d65ab[_0xc6ac('0x2a')]){_0x5d65ab['waiting']-=0x1;}}if(_0x5d65ab[_0xc6ac('0x2e')]&&_0x5d65ab['UserId']){_0x5d65ab[_0xc6ac('0x2c')]+=0x1;if(_0x5d65ab['talking']){_0x5d65ab[_0xc6ac('0x2b')]-=0x1;}}if(_0x5d65ab[_0xc6ac('0x2e')]&&!_0x5d65ab[_0xc6ac('0x2f')]){_0x5d65ab['unmanaged']+=0x1;if(_0x5d65ab[_0xc6ac('0x2a')]){_0x5d65ab[_0xc6ac('0x2a')]-=0x1;}}_0x5d65ab['total']+=0x1;_0x8e378(_0x5d65ab);});}exports[_0xc6ac('0x30')]=function(_0x37a2ab,_0x20d7ff){var _0x5baf9b={},_0x216e42={},_0x27e417={'count':0x0,'rows':[]};var _0x2cbbd8=_[_0xc6ac('0x1e')](db[_0xc6ac('0x31')][_0xc6ac('0x32')],function(_0x22cdb5){return{'name':_0x22cdb5['fieldName'],'type':_0x22cdb5[_0xc6ac('0x33')][_0xc6ac('0x34')]};});_0x216e42[_0xc6ac('0x35')]=_['map'](_0x2cbbd8,_0xc6ac('0x1b'));_0x216e42['query']=_[_0xc6ac('0x36')](_0x37a2ab[_0xc6ac('0x37')]);_0x216e42['filters']=_[_0xc6ac('0x38')](_0x216e42[_0xc6ac('0x35')],_0x216e42[_0xc6ac('0x37')]);_0x5baf9b['attributes']=_[_0xc6ac('0x38')](_0x216e42[_0xc6ac('0x35')],qs['fields'](_0x37a2ab[_0xc6ac('0x37')][_0xc6ac('0x39')]));_0x5baf9b[_0xc6ac('0x3a')]=_0x5baf9b[_0xc6ac('0x3a')][_0xc6ac('0x3b')]?_0x5baf9b['attributes']:_0x216e42[_0xc6ac('0x35')];if(!_0x37a2ab[_0xc6ac('0x37')]['hasOwnProperty'](_0xc6ac('0x3c'))){_0x5baf9b[_0xc6ac('0x15')]=qs[_0xc6ac('0x15')](_0x37a2ab[_0xc6ac('0x37')][_0xc6ac('0x15')]);_0x5baf9b[_0xc6ac('0x13')]=qs[_0xc6ac('0x13')](_0x37a2ab[_0xc6ac('0x37')]['offset']);}_0x5baf9b['order']=qs[_0xc6ac('0x3d')](_0x37a2ab[_0xc6ac('0x37')][_0xc6ac('0x3d')]);_0x5baf9b['where']=qs['filters'](_['pick'](_0x37a2ab[_0xc6ac('0x37')],_0x216e42['filters']),_0x2cbbd8);var _0x29523e=[];var _0x35d498=squel['select']()['field']('id')['field'](_0xc6ac('0x1b'))[_0xc6ac('0x3e')](_0xc6ac('0x3f'))[_0xc6ac('0x40')]('tools_tags');var _0x27a4d7=squel[_0xc6ac('0x41')]()[_0xc6ac('0x3e')](_0xc6ac('0x42'))['field'](_0xc6ac('0x43'))['field'](_0xc6ac('0x44'))[_0xc6ac('0x40')](_0xc6ac('0x45'),'ui')['left_join'](_0xc6ac('0x46'),'u',_0xc6ac('0x47'));var _0x4ecded=squel[_0xc6ac('0x41')]()[_0xc6ac('0x40')]('mail_interactions','i')[_0xc6ac('0x48')]('cm_contacts','c',_0xc6ac('0x49'))['left_join'](_0xc6ac('0x46'),'o',_0xc6ac('0x4a'))[_0xc6ac('0x48')](_0xc6ac('0x4b'),'a',_0xc6ac('0x4c'))[_0xc6ac('0x48')](_0xc6ac('0x4d'),'me','me.MailInteractionId\x20=\x20i.id')[_0xc6ac('0x48')](_0xc6ac('0x4e'),'it',_0xc6ac('0x4f'))['left_join'](_0xc6ac('0x50'),'t',_0xc6ac('0x51'));var _0x825888=squel[_0xc6ac('0x52')]();var _0x3a327a=[];var _0x39718b=squel[_0xc6ac('0x52')]();var _0xb30ada;if(_0x37a2ab[_0xc6ac('0x37')]['search']){_0xb30ada=as[_0xc6ac('0x53')](_0x37a2ab[_0xc6ac('0x37')][_0xc6ac('0x54')]);var _0x4ae2f8=_0xb30ada['sqlOperator'];for(var _0xd849eb=0x0;_0xd849eb<_0xb30ada[_0xc6ac('0x55')]['length'];_0xd849eb++){var _0x5e20f3=_0xb30ada[_0xc6ac('0x55')][_0xd849eb];var _0x3e2480='i';var _0x500612=_['find'](_0x2cbbd8,[_0xc6ac('0x1b'),_0x5e20f3[_0xc6ac('0x3e')]]);if(!_0x500612){switch(_0x5e20f3[_0xc6ac('0x3e')]){case _0xc6ac('0x56'):if(_0x5e20f3[_0xc6ac('0x57')]==0x1){_0x4ecded[_0xc6ac('0x58')]('`'+_0x5e20f3['field']+_0xc6ac('0x59'));}else{_0x4ecded[_0xc6ac('0x58')]('`'+_0x5e20f3[_0xc6ac('0x3e')]+_0xc6ac('0x5a'));}break;case _0xc6ac('0x5b'):if(_0x5e20f3[_0xc6ac('0x5c')]===_0xc6ac('0x5d')){if(_0x5e20f3[_0xc6ac('0x57')][_0xc6ac('0x21')]('\x20')['length']>0x1){_0x825888[_0x4ae2f8](_0xc6ac('0x5e'),qs[_0xc6ac('0x5f')](_0x5e20f3[_0xc6ac('0x57')]),null);}else{var _0x440a8b='%'+_0x5e20f3[_0xc6ac('0x57')]+'%';_0x825888[_0x4ae2f8](_0xc6ac('0x60'),_0x440a8b,_0x440a8b,_0x440a8b);}}else{_0x500612=_[_0xc6ac('0x61')](_0x2cbbd8,[_0xc6ac('0x1b'),_0xc6ac('0x62')]);_0x5e20f3[_0xc6ac('0x3e')]=_0xc6ac('0x62');_0x10a10c=as[_0xc6ac('0x63')](_0x3e2480,_0x500612['type'],_0x5e20f3);_0x825888[_0x4ae2f8](_0x10a10c['text'],_0x10a10c[_0xc6ac('0x57')]['start'],_0x10a10c[_0xc6ac('0x57')][_0xc6ac('0x1a')]);}break;case _0xc6ac('0x64'):var _0x2f507d=_0x5e20f3[_0xc6ac('0x57')][_0xc6ac('0x21')](',')[_0xc6ac('0x1e')](function(_0x2dbbe7){return Number(_0x2dbbe7);});_0x2f507d[_0xc6ac('0x22')](function(_0x23fd6b){_0x39718b['or'](_0xc6ac('0x65'),'%,'+_0x23fd6b+',%');});_0x3a327a=_[_0xc6ac('0x66')](_0x3a327a,_0x2f507d);break;case _0xc6ac('0x67'):if(_0x5e20f3[_0xc6ac('0x5c')]===_0xc6ac('0x5d')){_0x825888[_0x4ae2f8](_0xc6ac('0x68'),'%'+_0x5e20f3['value']+'%',null);}else{_0x500612=_[_0xc6ac('0x61')](_0x2cbbd8,[_0xc6ac('0x1b'),_0xc6ac('0x2f')]);_0x5e20f3[_0xc6ac('0x3e')]=_0xc6ac('0x2f');_0x10a10c=as[_0xc6ac('0x63')](_0x3e2480,_0x500612[_0xc6ac('0x33')],_0x5e20f3);_0x825888[_0x4ae2f8](_0x10a10c['text'],_0x10a10c[_0xc6ac('0x57')][_0xc6ac('0x69')],_0x10a10c[_0xc6ac('0x57')][_0xc6ac('0x1a')]);}break;case _0xc6ac('0x26'):_0x10a10c=as['buildExpression']('me',null,_0x5e20f3);_0x825888[_0x4ae2f8](_0x10a10c[_0xc6ac('0x6a')],_0x10a10c[_0xc6ac('0x57')][_0xc6ac('0x69')],_0x10a10c[_0xc6ac('0x57')]['end']);break;}}else{var _0x10a10c=as[_0xc6ac('0x63')](_0x3e2480,_0x500612[_0xc6ac('0x33')],_0x5e20f3);_0x825888[_0x4ae2f8](_0x10a10c[_0xc6ac('0x6a')],_0x10a10c[_0xc6ac('0x57')][_0xc6ac('0x69')],_0x10a10c[_0xc6ac('0x57')][_0xc6ac('0x1a')]);}}}else{var _0x4fc419=_(_0x37a2ab[_0xc6ac('0x37')])[_0xc6ac('0x36')]()['map'](function(_0x2c83f4){return _[_0xc6ac('0x6b')](_0x2cbbd8,[_0xc6ac('0x1b'),_0x2c83f4])?_0x2c83f4:undefined;})[_0xc6ac('0x6c')]()[_0xc6ac('0x57')]();if(!_[_0xc6ac('0x6d')](_0x4fc419)){_0x4fc419['forEach'](function(_0x43e2ec){if(_0x43e2ec===_0xc6ac('0x6e')){_0x4ecded[_0xc6ac('0x6f')](_0xc6ac('0x70'),[]['concat'](_0x37a2ab[_0xc6ac('0x37')][_0x43e2ec]));}else if(_0x43e2ec===_0xc6ac('0x71')){var _0x403c25=JSON[_0xc6ac('0x72')](_0x37a2ab[_0xc6ac('0x37')][_0x43e2ec])[_0xc6ac('0x73')];var _0x38f8d6=JSON[_0xc6ac('0x72')](_0x37a2ab[_0xc6ac('0x37')][_0x43e2ec])[_0xc6ac('0x74')];_0x4ecded[_0xc6ac('0x6f')](_0xc6ac('0x75'),_0x403c25,_0x38f8d6);}else{if(_0x37a2ab[_0xc6ac('0x37')][_0x43e2ec]===_0xc6ac('0x76')){_0x4ecded[_0xc6ac('0x6f')]('i.'+_0x43e2ec+'\x20IS\x20NULL');}else{_0x4ecded[_0xc6ac('0x6f')]('i.'+_0x43e2ec+_0xc6ac('0x77'),_0x37a2ab[_0xc6ac('0x37')][_0x43e2ec]);}}});}if(_0x37a2ab[_0xc6ac('0x37')][_0xc6ac('0x78')]){if(_0x37a2ab[_0xc6ac('0x37')][_0xc6ac('0x78')]==0x1){_0x4ecded[_0xc6ac('0x58')](_0xc6ac('0x79'));}else{_0x4ecded[_0xc6ac('0x58')](_0xc6ac('0x7a'));}}if(_0x37a2ab[_0xc6ac('0x37')][_0xc6ac('0x7b')]){_0x3a327a=_[_0xc6ac('0x7c')](_0x37a2ab[_0xc6ac('0x37')][_0xc6ac('0x7b')])?_0x37a2ab['query']['tag']:new Array(_0x37a2ab[_0xc6ac('0x37')][_0xc6ac('0x7b')]);_0x3a327a[_0xc6ac('0x22')](function(_0x5dce13){_0x39718b['or'](_0xc6ac('0x65'),'%,'+_0x5dce13+',%');});}if(_0x37a2ab[_0xc6ac('0x37')][_0xc6ac('0x7d')]){var _0x2d7118=_0x37a2ab[_0xc6ac('0x37')][_0xc6ac('0x7d')][_0xc6ac('0x7e')]('\x5c','\x5c\x5c')[_0xc6ac('0x7e')](/'/g,'\x27\x27');if(qs[_0xc6ac('0x7f')](_0x2d7118)){_0x825888['or']('i.id\x20LIKE\x20?',_0x2d7118+'%');}else if(qs[_0xc6ac('0x80')](_0x2d7118)){_0x825888['or']('c.email\x20LIKE\x20?',_0x2d7118+'%');}else{_0x825888['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc6ac('0x5f')](_0x2d7118))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc6ac('0x5f')](_0x2d7118));}}}_0x4ecded[_0xc6ac('0x6f')](_0x825888);_0x4ecded['group'](_0xc6ac('0x81'));var _0x2f92a0={'type':db['Sequelize'][_0xc6ac('0x82')][_0xc6ac('0x83')],'raw':!![]};var _0x59785a=_0x4ecded[_0xc6ac('0x84')]();_0x59785a[_0xc6ac('0x3e')]('i.id');_0x59785a[_0xc6ac('0x3e')](_0xc6ac('0x85'),'unreadMessages');if(_0x5baf9b[_0xc6ac('0x86')]){_0x5baf9b[_0xc6ac('0x86')][_0xc6ac('0x22')](function(_0x58805a){var _0x16abf3=_0x58805a[0x0]===_0xc6ac('0x87')?_0x58805a[0x0]:'i.'+_0x58805a[0x0];_0x4ecded['order'](_0x16abf3,_0x58805a[0x1]===_0xc6ac('0x88')?![]:!![]);});}if(!_[_0xc6ac('0x6d')](_0x3a327a)){_0x4ecded[_0xc6ac('0x58')](_0x39718b);_0x59785a['where'](_0xc6ac('0x89'),_0x3a327a);}BPromise[_0xc6ac('0x8a')]()['then'](function(){if(!_0xb30ada){if(_0x37a2ab[_0xc6ac('0x37')]['MailAccountId'])return;_0x59785a[_0xc6ac('0x6f')]('i.MailAccountId\x20IS\x20NOT\x20NULL');_0x4ecded[_0xc6ac('0x6f')](_0xc6ac('0x8b'));return;}if(_0x37a2ab['user']['role']!==_0xc6ac('0x8c'))return;return _0x37a2ab[_0xc6ac('0x8d')][_0xc6ac('0x8e')]({'attributes':['id'],'raw':!![]})[_0xc6ac('0x18')](function(_0x4b9212){if(_[_0xc6ac('0x6d')](_0x4b9212)){_0x59785a[_0xc6ac('0x6f')](_0xc6ac('0x8f'));_0x4ecded[_0xc6ac('0x6f')](_0xc6ac('0x8f'));}else{_0x59785a[_0xc6ac('0x6f')](_0xc6ac('0x70'),_['map'](_0x4b9212,'id'));_0x4ecded[_0xc6ac('0x6f')](_0xc6ac('0x70'),_[_0xc6ac('0x1e')](_0x4b9212,'id'));}});})['then'](function(){if(_0x37a2ab[_0xc6ac('0x8d')][_0xc6ac('0x90')]===_0xc6ac('0x8c')&&!_0xb30ada&&!_0x37a2ab[_0xc6ac('0x37')][_0xc6ac('0x6e')])return[];return db[_0xc6ac('0x91')]['query'](_0x59785a[_0xc6ac('0x92')](),_0x2f92a0);})['then'](function(_0x3da062){_0x27e417[_0xc6ac('0x93')]=_0x3da062[_0xc6ac('0x3b')];if(_0x27e417[_0xc6ac('0x93')]===0x0)return[];return db[_0xc6ac('0x91')][_0xc6ac('0x37')](_0x35d498[_0xc6ac('0x92')](),_0x2f92a0)[_0xc6ac('0x18')](function(_0x7eebed){_0x29523e=_[_0xc6ac('0x94')](_0x7eebed,'id');_0x2f92a0=_[_0xc6ac('0x95')](_0x2f92a0,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x37a2ab['query']['fields']){_0x5baf9b['attributes'][_0xc6ac('0x22')](function(_0x43febf){_0x4ecded[_0xc6ac('0x3e')]('i.'+_0x43febf);});}else{_0x4ecded[_0xc6ac('0x3e')](_0xc6ac('0x85'),_0xc6ac('0x56'));_0x4ecded[_0xc6ac('0x3e')]('a.key',_0xc6ac('0x96'));_0x4ecded['field'](_0xc6ac('0x97'),'Account.mandatoryDisposition');_0x4ecded[_0xc6ac('0x3e')](_0xc6ac('0x98'),_0xc6ac('0x99'));_0x4ecded[_0xc6ac('0x3e')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xc6ac('0x87'));_0x4ecded[_0xc6ac('0x3e')](_0xc6ac('0x81'));_0x4ecded[_0xc6ac('0x3e')](_0xc6ac('0x9a'));_0x4ecded[_0xc6ac('0x3e')](_0xc6ac('0x9b'));_0x4ecded[_0xc6ac('0x3e')]('i.closed');_0x4ecded['field'](_0xc6ac('0x9c'));_0x4ecded[_0xc6ac('0x3e')](_0xc6ac('0x9d'));_0x4ecded[_0xc6ac('0x3e')]('i.lastMsgAt');_0x4ecded[_0xc6ac('0x3e')]('i.lastMsgDirection');_0x4ecded[_0xc6ac('0x3e')](_0xc6ac('0x9e'));_0x4ecded[_0xc6ac('0x3e')](_0xc6ac('0x9f'));_0x4ecded[_0xc6ac('0x3e')](_0xc6ac('0xa0'));_0x4ecded['field']('i.thirdDisposition');_0x4ecded[_0xc6ac('0x3e')](_0xc6ac('0xa1'));_0x4ecded[_0xc6ac('0x3e')](_0xc6ac('0xa2'));_0x4ecded['field'](_0xc6ac('0xa3'));_0x4ecded[_0xc6ac('0x3e')]('i.MailAccountId');_0x4ecded[_0xc6ac('0x3e')]('i.UserId');_0x4ecded['field']('c.firstName',_0xc6ac('0xa4'));_0x4ecded[_0xc6ac('0x3e')](_0xc6ac('0xa5'),_0xc6ac('0xa6'));_0x4ecded['field']('c.email','Contact.email');_0x4ecded[_0xc6ac('0x3e')](_0xc6ac('0xa7'),_0xc6ac('0xa8'));_0x4ecded[_0xc6ac('0x3e')](_0xc6ac('0xa9'),_0xc6ac('0xaa'));_0x4ecded[_0xc6ac('0x3e')](_0xc6ac('0xab'),_0xc6ac('0xac'));_0x4ecded[_0xc6ac('0x3e')](_0xc6ac('0xad'),_0xc6ac('0xae'));_0x4ecded['field'](_0xc6ac('0xaf'),_0xc6ac('0xb0'));_0x4ecded[_0xc6ac('0x3e')](_0xc6ac('0xb1'),_0xc6ac('0x20'));}if(_0x5baf9b[_0xc6ac('0x15')])_0x4ecded[_0xc6ac('0x15')](_0x5baf9b['limit']);if(_0x5baf9b[_0xc6ac('0x13')])_0x4ecded['offset'](_0x5baf9b[_0xc6ac('0x13')]);return db[_0xc6ac('0x91')]['query'](_0x4ecded[_0xc6ac('0x92')](),_0x2f92a0);})[_0xc6ac('0x18')](function(_0x494a54){if(_0x494a54[_0xc6ac('0x3b')]>0x0)_0x27a4d7[_0xc6ac('0x6f')](_0xc6ac('0xb2'),_[_0xc6ac('0x1e')](_0x494a54,'id'));return db[_0xc6ac('0x91')]['query'](_0x27a4d7[_0xc6ac('0x92')](),_0x2f92a0)['then'](function(_0x2b6932){var _0x1713f5=_[_0xc6ac('0xb3')](_0x2b6932,_0xc6ac('0xb4'));var _0x388dc5=[];return db['Setting'][_0xc6ac('0xb5')]({'attributes':[_0xc6ac('0xb6')],'raw':!![]})[_0xc6ac('0x18')](function(_0x302269){var _0x101dfb=_0x302269[_0xc6ac('0xb6')];_0x494a54[_0xc6ac('0x22')](function(_0x224e95){_0x388dc5[_0xc6ac('0x24')](updateMailInteraction(_0x224e95,_0x29523e,_0x1713f5,_0x101dfb));});return BPromise[_0xc6ac('0xb7')](_0x388dc5);});});});})[_0xc6ac('0x18')](function(_0x154f68){_0x27e417['rows']=_0x154f68;return _0x27e417;})['then'](respondWithFilteredResult(_0x20d7ff,_0x5baf9b))[_0xc6ac('0x29')](handleError(_0x20d7ff,null));};exports[_0xc6ac('0xb8')]=function(_0x313c9b,_0x51a9b2){var _0x455d25={'raw':![],'where':{'id':_0x313c9b[_0xc6ac('0xb9')]['id']}},_0x1b82da={};_0x1b82da[_0xc6ac('0x35')]=_[_0xc6ac('0x36')](db[_0xc6ac('0x31')][_0xc6ac('0x32')]);_0x1b82da[_0xc6ac('0x37')]=_[_0xc6ac('0x36')](_0x313c9b[_0xc6ac('0x37')]);_0x1b82da[_0xc6ac('0xba')]=_['intersection'](_0x1b82da[_0xc6ac('0x35')],_0x1b82da[_0xc6ac('0x37')]);_0x455d25[_0xc6ac('0x3a')]=_['intersection'](_0x1b82da['model'],qs[_0xc6ac('0x39')](_0x313c9b[_0xc6ac('0x37')]['fields']));_0x455d25[_0xc6ac('0x3a')]=_0x455d25[_0xc6ac('0x3a')][_0xc6ac('0x3b')]?_0x455d25[_0xc6ac('0x3a')]:_0x1b82da[_0xc6ac('0x35')];if(_0x313c9b[_0xc6ac('0x37')]['includeAll']){_0x455d25[_0xc6ac('0xbb')]=[{'all':!![]}];}_0x455d25=_['merge']({},_0x455d25,_0x313c9b[_0xc6ac('0xbc')]);return db[_0xc6ac('0x31')][_0xc6ac('0x61')](_0x455d25)[_0xc6ac('0x18')](handleEntityNotFound(_0x51a9b2,null))['then'](respondWithResult(_0x51a9b2,null))[_0xc6ac('0x29')](handleError(_0x51a9b2,null));};exports[_0xc6ac('0xbd')]=function(_0x1c3639,_0x21d6b4){return db[_0xc6ac('0x31')][_0xc6ac('0xbd')](_0x1c3639[_0xc6ac('0xbe')],{})[_0xc6ac('0x18')](respondWithResult(_0x21d6b4,0xc9))[_0xc6ac('0x29')](handleError(_0x21d6b4,null));};exports['update']=function(_0x2bafb3,_0x12d28b){if(_0x2bafb3[_0xc6ac('0xbe')]['id']){delete _0x2bafb3[_0xc6ac('0xbe')]['id'];}return db[_0xc6ac('0x31')][_0xc6ac('0x61')]({'where':{'id':_0x2bafb3['params']['id']}})[_0xc6ac('0x18')](handleEntityNotFound(_0x12d28b,null))[_0xc6ac('0x18')](saveUpdates(_0x2bafb3[_0xc6ac('0xbe')],null))[_0xc6ac('0x18')](respondWithResult(_0x12d28b,null))[_0xc6ac('0x29')](handleError(_0x12d28b,null));};exports[_0xc6ac('0x19')]=function(_0x75c333,_0x2de2b3){return db['MailInteraction'][_0xc6ac('0x61')]({'where':{'id':_0x75c333[_0xc6ac('0xb9')]['id']}})[_0xc6ac('0x18')](handleEntityNotFound(_0x2de2b3,null))['then'](removeEntity(_0x2de2b3,null))[_0xc6ac('0x29')](handleError(_0x2de2b3,null));};exports['describe']=function(_0x30845d,_0x25d40f){return db[_0xc6ac('0x31')][_0xc6ac('0xbf')]()[_0xc6ac('0x18')](respondWithResult(_0x25d40f,null))[_0xc6ac('0x29')](handleError(_0x25d40f,null));};exports[_0xc6ac('0xc0')]=function(_0x4d0d78,_0x3c2b68){return db[_0xc6ac('0xc1')]['find']({'where':{'id':_0x4d0d78[_0xc6ac('0xb9')]['id']}})[_0xc6ac('0x18')](handleEntityNotFound(_0x3c2b68,null))[_0xc6ac('0x18')](function(_0x201b14){if(_0x201b14){return _0x201b14['addMessage'](_0x4d0d78[_0xc6ac('0xbe')]['ids'],_[_0xc6ac('0xc2')](_0x4d0d78[_0xc6ac('0xbe')],['ids','id'])||{});}})[_0xc6ac('0x18')](respondWithResult(_0x3c2b68,null))[_0xc6ac('0x29')](handleError(_0x3c2b68,null));};exports[_0xc6ac('0xc3')]=function(_0x1c11b0,_0x5efea2){var _0x29fdc2={'raw':![],'where':{}};var _0x5f1083={};var _0x31fc2a={'count':0x0,'rows':[]};return db['MailInteraction'][_0xc6ac('0xb5')]({'where':{'id':_0x1c11b0[_0xc6ac('0xb9')]['id']}})[_0xc6ac('0x18')](handleEntityNotFound(_0x5efea2,null))[_0xc6ac('0x18')](function(_0x39663b){if(_0x39663b){_0x5f1083[_0xc6ac('0x35')]=_[_0xc6ac('0x36')](db[_0xc6ac('0xc1')][_0xc6ac('0x32')]);_0x5f1083[_0xc6ac('0x37')]=_['keys'](_0x1c11b0[_0xc6ac('0x37')]);_0x5f1083[_0xc6ac('0xba')]=_[_0xc6ac('0x38')](_0x5f1083['model'],_0x5f1083['query']);_0x29fdc2['attributes']=_[_0xc6ac('0x38')](_0x5f1083[_0xc6ac('0x35')],qs[_0xc6ac('0x39')](_0x1c11b0['query'][_0xc6ac('0x39')]));_0x29fdc2[_0xc6ac('0x3a')]=_0x29fdc2[_0xc6ac('0x3a')]['length']?_0x29fdc2[_0xc6ac('0x3a')]:_0x5f1083[_0xc6ac('0x35')];if(!_0x1c11b0['query'][_0xc6ac('0xc4')](_0xc6ac('0x3c'))){_0x29fdc2[_0xc6ac('0x15')]=qs[_0xc6ac('0x15')](_0x1c11b0[_0xc6ac('0x37')][_0xc6ac('0x15')]);_0x29fdc2[_0xc6ac('0x13')]=qs[_0xc6ac('0x13')](_0x1c11b0[_0xc6ac('0x37')]['offset']);}_0x29fdc2[_0xc6ac('0x86')]=qs[_0xc6ac('0x3d')](_0x1c11b0[_0xc6ac('0x37')][_0xc6ac('0x3d')]);_0x29fdc2[_0xc6ac('0x6f')]=qs['filters'](_[_0xc6ac('0xc5')](_0x1c11b0['query'],_0x5f1083[_0xc6ac('0xba')]));_0x29fdc2[_0xc6ac('0x6f')][_0xc6ac('0xb4')]=_0x39663b['id'];if(_0x1c11b0['query'][_0xc6ac('0x7d')]){_0x29fdc2[_0xc6ac('0x6f')]=_[_0xc6ac('0x95')](_0x29fdc2[_0xc6ac('0x6f')],{'$or':_[_0xc6ac('0x1e')](_0x29fdc2[_0xc6ac('0x3a')],function(_0x3f7c23){var _0x2f1b5e={};_0x2f1b5e[_0x3f7c23]={'$like':'%'+_0x1c11b0['query']['filter']+'%'};return _0x2f1b5e;})});}if(_0x1c11b0[_0xc6ac('0x37')][_0xc6ac('0x73')]){var _0x210ccb=_0x1c11b0[_0xc6ac('0x37')][_0xc6ac('0x73')][_0xc6ac('0x21')](',');var _0x349399={};_0x349399[_0x210ccb[0x0]]={'$gte':moment(_0x210ccb[0x1])[_0xc6ac('0xc6')](_0xc6ac('0xc7'))};_0x29fdc2['where']=_[_0xc6ac('0x95')](_0x29fdc2['where'],_0x349399);}_0x29fdc2=_[_0xc6ac('0x95')]({},_0x29fdc2,_0x1c11b0[_0xc6ac('0xbc')]);return db[_0xc6ac('0xc1')][_0xc6ac('0x93')]({'where':_0x29fdc2[_0xc6ac('0x6f')]})[_0xc6ac('0x18')](function(_0x1d8eee){_0x31fc2a['count']=_0x1d8eee;if(_0x1c11b0[_0xc6ac('0x37')]['includeAll']){_0x29fdc2[_0xc6ac('0xbb')]=[{'all':!![]}];}return db['MailMessage'][_0xc6ac('0xc8')](_0x29fdc2);})[_0xc6ac('0x18')](function(_0x53fc3c){if(_0x1c11b0[_0xc6ac('0x37')][_0xc6ac('0xc9')]==='true'){for(var _0xb79e01=0x0;_0xb79e01<_0x53fc3c[_0xc6ac('0x3b')];_0xb79e01++){_0x53fc3c[_0xb79e01][_0xc6ac('0xbe')]=juice(_0x53fc3c[_0xb79e01]['body']);}}_0x31fc2a[_0xc6ac('0xca')]=_0x53fc3c;return _0x31fc2a;});}})[_0xc6ac('0x18')](respondWithFilteredResult(_0x5efea2,_0x29fdc2))['catch'](handleError(_0x5efea2,null));};exports[_0xc6ac('0xcb')]=function(_0x1f9269,_0x5e3215){return db['MailInteraction']['find']({'where':{'id':_0x1f9269[_0xc6ac('0xb9')]['id']}})[_0xc6ac('0x18')](handleEntityNotFound(_0x5e3215,null))[_0xc6ac('0x18')](function(_0x5585f0){if(_0x5585f0){return _0x5585f0[_0xc6ac('0xcc')](_0x1f9269[_0xc6ac('0xbe')][_0xc6ac('0xcd')],_[_0xc6ac('0xc2')](_0x1f9269[_0xc6ac('0xbe')],[_0xc6ac('0xcd'),'id'])||{})['spread'](function(){return db[_0xc6ac('0x64')]['findAll']({'attributes':['id',_0xc6ac('0x1b'),_0xc6ac('0x3f')],'where':{'id':_0x1f9269[_0xc6ac('0xbe')]['ids']}});})[_0xc6ac('0x18')](function(_0x35d90b){socket[_0xc6ac('0xce')](_0xc6ac('0xcf'),{'id':Number(_0x1f9269['params']['id']),'tags':_0x35d90b||[]});return{'id':Number(_0x1f9269['params']['id']),'tags':_0x35d90b||[]};});}})[_0xc6ac('0x18')](respondWithResult(_0x5e3215,null))[_0xc6ac('0x29')](handleError(_0x5e3215,null));};exports[_0xc6ac('0xd0')]=function(_0x45c158,_0x443e8e){return db['MailInteraction']['find']({'where':{'id':_0x45c158[_0xc6ac('0xb9')]['id']}})[_0xc6ac('0x18')](handleEntityNotFound(_0x443e8e,null))[_0xc6ac('0x18')](function(_0x24014b){if(_0x24014b){return _0x24014b[_0xc6ac('0xd0')](_0x45c158[_0xc6ac('0x37')][_0xc6ac('0xcd')]);}})[_0xc6ac('0x18')](respondWithStatusCode(_0x443e8e,null))['catch'](handleError(_0x443e8e,null));};exports[_0xc6ac('0xd1')]=function(_0x450539,_0x177956){var _0x58ae53=moment()[_0xc6ac('0xd2')]()[_0xc6ac('0x92')]();var _0x59c29f=path[_0xc6ac('0xd3')](config[_0xc6ac('0xd4')],_0xc6ac('0xd5'),_0xc6ac('0xd6'),_0xc6ac('0xd7'));var _0x3598c8=path[_0xc6ac('0xd3')](config[_0xc6ac('0xd4')],'server',_0xc6ac('0xd6'),_0xc6ac('0xd8'));var _0xdeab4c=path[_0xc6ac('0xd3')](_0x59c29f,_0x58ae53);var _0x444019=util[_0xc6ac('0xc6')](_0xc6ac('0xd9'),_0x450539[_0xc6ac('0xb9')]['id'],_0x58ae53);var _0x3ff1f3=path[_0xc6ac('0xd3')](_0x59c29f,_0x444019);var _0x4239e6=[];if(_0x450539[_0xc6ac('0x37')][_0xc6ac('0xd8')]){_0x4239e6[_0xc6ac('0x24')]({'model':db[_0xc6ac('0xda')],'as':'Attachments','raw':!![]});}var _0x1ea27c=[{'model':db['MailMessage'],'as':_0xc6ac('0xdb'),'attributes':['id',_0xc6ac('0xbe'),'from','to','cc',_0xc6ac('0xdc'),_0xc6ac('0xdd'),'createdAt'],'where':{'secret':![]},'order':qs[_0xc6ac('0x3d')]('id'),'include':_0x4239e6}];return db['MailInteraction'][_0xc6ac('0x61')]({'where':{'id':_0x450539['params']['id']},'include':_0x1ea27c})[_0xc6ac('0x18')](handleEntityNotFound(_0x177956,null))['then'](function(_0x4e57cc){if(_0x4e57cc&&_0x4e57cc[_0xc6ac('0xdb')]){var _0x266702=_0x4e57cc['get']({'plain':!![]});fs[_0xc6ac('0xde')](_0xdeab4c);return BPromise['each'](_0x266702['Messages'],function(_0x5c9588,_0x1a0339){var _0x47c4bf={'from':_0x5c9588[_0xc6ac('0x40')],'to':_0x5c9588['to'],'subject':_0x5c9588[_0xc6ac('0xdd')],'html':htmlEntities[_0xc6ac('0xdf')](_0x5c9588[_0xc6ac('0xbe')]),'headers':{'Date':moment(_0x5c9588[_0xc6ac('0x71')])[_0xc6ac('0xc6')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x5c9588['cc']){_0x47c4bf[_0xc6ac('0xe0')]['Cc']=_0x5c9588['cc'];}if(_0x5c9588[_0xc6ac('0xdc')]){_0x47c4bf[_0xc6ac('0xe0')]['Bcc']=_0x5c9588[_0xc6ac('0xdc')];}return new BPromise(function(_0x1c6016,_0x2b940c){if(_0x5c9588[_0xc6ac('0xe1')]){for(var _0x3e07d1=0x0;_0x3e07d1<_0x5c9588[_0xc6ac('0xe1')][_0xc6ac('0x3b')];_0x3e07d1++){var _0x5eaef1=_0x5c9588[_0xc6ac('0xe1')][_0x3e07d1];var _0x40fa1f=path[_0xc6ac('0xd3')](_0x3598c8,_0x5eaef1[_0xc6ac('0xe2')]);if(fs['existsSync'](_0x40fa1f)){_0x47c4bf[_0xc6ac('0xd8')][_0xc6ac('0x24')]({'name':_0x5eaef1[_0xc6ac('0x1b')],'contentType':_0x5eaef1['type'],'data':fs[_0xc6ac('0xe3')](_0x40fa1f)});}}}emlformat['build'](_0x47c4bf,function(_0x47840b,_0x777b7f){if(_0x47840b)return _0x2b940c(_0x47840b);fs[_0xc6ac('0xe4')](path[_0xc6ac('0xd3')](_0xdeab4c,util[_0xc6ac('0xc6')](_0xc6ac('0xe5'),_0x1a0339)),_0x777b7f);return _0x1c6016(_0x777b7f);});});})[_0xc6ac('0x18')](function(){return new BPromise(function(_0x4cf340,_0x55932f){zipdir(_0xdeab4c,{'saveTo':_0x3ff1f3},function(_0x12712a,_0x2e1322){if(_0x12712a)return _0x55932f(_0x12712a);return _0x4cf340(_0x2e1322);});})['then'](function(){return new BPromise(function(_0x1e3f61,_0x34daf1){rimraf(_0xdeab4c,function(_0x3844fc){if(_0x3844fc)_0x34daf1(_0x3844fc);return _0x1e3f61();});});})[_0xc6ac('0x18')](function(){return _0x177956[_0xc6ac('0xd1')](_0x3ff1f3,_0x444019,function(_0x3d5e2f){if(!_0x3d5e2f)fs[_0xc6ac('0xe6')](_0x3ff1f3);});});});}else{return _0x177956[_0xc6ac('0xe7')](0xc8);}})[_0xc6ac('0x29')](handleError(_0x177956,null));};
\ No newline at end of file
+var _0x38c1=['i.MailAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','DESC','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','agent','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','role','sequelize','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','Contact.lastName','c.email','c.phone','Contact.mobile','c.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.MailInteractionId\x20IN\x20?','MailInteractionId','Setting','enableEmailPreview','rows','show','params','rawAttributes','includeAll','include','merge','create','body','describe','addMessage','ids','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','inlineCss','true','addTags','setTags','omit','spread','mailInteractionTags:save','removeTags','unix','root','server','tmp','join','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','createdAt','mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','download','unlinkSync','rimraf','zip-dir','moment','bluebird','lodash','squel','juice','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','html-entities','redis','defaults','localhost','./mailInteraction.socket','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','update','then','destroy','error','name','send','Users','map','fullname','TagIds','Tags','split','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','waiting','talking','answered','unmanaged','total','closed','UserId','MailInteraction','fieldName','type','key','model','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','field','color','from','tools_tags','select','user_has_mail_interactions','left_join','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','end','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','some','isEmpty','MailAccountId','where'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x38c1,0x77));var _0x138c=function(_0x1b2cf0,_0x3e1559){_0x1b2cf0=_0x1b2cf0-0x0;var _0x566935=_0x38c1[_0x1b2cf0];return _0x566935;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x138c('0x0'));var zipdir=require(_0x138c('0x1'));var moment=require(_0x138c('0x2'));var BPromise=require(_0x138c('0x3'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x138c('0x4'));var squel=require(_0x138c('0x5'));var juice=require(_0x138c('0x6'));var Redis=require('ioredis');var qs=require(_0x138c('0x7'));var as=require(_0x138c('0x8'));var logger=require(_0x138c('0x9'))(_0x138c('0xa'));var config=require(_0x138c('0xb'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x138c('0xc'));config[_0x138c('0xd')]=_[_0x138c('0xe')](config[_0x138c('0xd')],{'host':_0x138c('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x138c('0x10'))['register'](socket);function respondWithStatusCode(_0x410a3a,_0x44dba4){_0x44dba4=_0x44dba4||0xcc;return function(_0x21a40f){if(_0x21a40f){return _0x410a3a[_0x138c('0x11')](_0x44dba4);}return _0x410a3a['status'](_0x44dba4)['end']();};}function respondWithResult(_0x97a2fc,_0x1c0667){_0x1c0667=_0x1c0667||0xc8;return function(_0x2a9732){if(_0x2a9732){return _0x97a2fc['status'](_0x1c0667)[_0x138c('0x12')](_0x2a9732);}};}function respondWithFilteredResult(_0x15f268,_0x4984ab){return function(_0x2df2c0){if(_0x2df2c0){var _0x838489=typeof _0x4984ab[_0x138c('0x13')]===_0x138c('0x14')&&typeof _0x4984ab[_0x138c('0x15')]===_0x138c('0x14');var _0x49dffa=_0x2df2c0[_0x138c('0x16')];var _0xd2edd5=_0x838489?0x0:_0x4984ab['offset'];var _0x32cb3f=_0x838489?_0x2df2c0['count']:_0x4984ab[_0x138c('0x13')]+_0x4984ab[_0x138c('0x15')];var _0x31b92f;if(_0x32cb3f>=_0x49dffa){_0x32cb3f=_0x49dffa;_0x31b92f=0xc8;}else{_0x31b92f=0xce;}_0x15f268[_0x138c('0x17')](_0x31b92f);return _0x15f268[_0x138c('0x18')](_0x138c('0x19'),_0xd2edd5+'-'+_0x32cb3f+'/'+_0x49dffa)[_0x138c('0x12')](_0x2df2c0);}return null;};}function saveUpdates(_0x7ecb93){return function(_0x493a22){if(_0x493a22){return _0x493a22[_0x138c('0x1a')](_0x7ecb93)[_0x138c('0x1b')](function(_0x1cfdac){return _0x1cfdac;});}return null;};}function removeEntity(_0x1adc55){return function(_0x3c2658){if(_0x3c2658){return _0x3c2658[_0x138c('0x1c')]()[_0x138c('0x1b')](function(){_0x1adc55[_0x138c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35ec35){return function(_0x4068a4){if(!_0x4068a4){_0x35ec35[_0x138c('0x11')](0x194);}return _0x4068a4;};}function handleError(_0x1a790a,_0x16f694){_0x16f694=_0x16f694||0x1f4;return function(_0x4344e1){logger[_0x138c('0x1d')](_0x4344e1['stack']);if(_0x4344e1[_0x138c('0x1e')]){delete _0x4344e1[_0x138c('0x1e')];}_0x1a790a[_0x138c('0x17')](_0x16f694)[_0x138c('0x1f')](_0x4344e1);};}function getInteractionUsers(_0xdeb684,_0x3e0426){return new BPromise(function(_0x30dcd2,_0x2a5beb){try{if(_0x3e0426[_0xdeb684['id']]){_0xdeb684[_0x138c('0x20')]=_[_0x138c('0x21')](_0x3e0426[_0xdeb684['id']],function(_0x23684e){return{'id':_0x23684e['id'],'fullname':_0x23684e[_0x138c('0x22')]};});}}catch(_0x3fe2ba){_0x2a5beb(_0x3fe2ba);}_0x30dcd2(_0xdeb684);});}function getInteractionTags(_0x42d63a,_0x855db3){return new BPromise(function(_0xcdda74,_0x26c3db){try{if(_0x42d63a[_0x138c('0x23')]){_0x42d63a[_0x138c('0x24')]=[];_0x42d63a['TagIds'][_0x138c('0x25')](',')['forEach'](function(_0x4181e2){_0x42d63a[_0x138c('0x24')][_0x138c('0x26')](_0x855db3[_0x4181e2]);});}delete _0x42d63a[_0x138c('0x23')];}catch(_0x5ab934){_0x26c3db(_0x5ab934);}_0xcdda74(_0x42d63a);});}function getLastMessageText(_0x3723de){return new BPromise(function(_0x5b95a2,_0x1b0c30){return db[_0x138c('0x27')][_0x138c('0x28')]({'where':{'$and':[{'MailInteractionId':_0x3723de['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x138c('0x29')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x138c('0x2a')],'order':_0x138c('0x2b'),'raw':!![]})[_0x138c('0x1b')](function(_0x5193c0){if(_0x5193c0&&_0x5193c0[_0x138c('0x2a')]){_0x3723de[_0x138c('0x2c')]=_[_0x138c('0x2d')](_0x5193c0[_0x138c('0x2a')]);}_0x5b95a2(_0x3723de);})[_0x138c('0x2e')](function(_0x2f3afe){_0x1b0c30(_0x2f3afe);});});}function updateMailInteraction(_0x5d3c0a,_0x4646d7,_0x2575a5,_0x4743b1){return new BPromise(function(_0x11105f,_0x14791c){return getInteractionUsers(_0x5d3c0a,_0x2575a5)[_0x138c('0x1b')](function(_0xffcce3){return getInteractionTags(_0xffcce3,_0x4646d7);})[_0x138c('0x1b')](function(_0x13ccc4){return getStateInteraction(_0x13ccc4);})[_0x138c('0x1b')](function(_0x191817){if(_0x4743b1){_0x11105f(getLastMessageText(_0x191817));}else{_0x11105f(_0x191817);}})['catch'](function(_0x15063a){_0x14791c(_0x15063a);});});}function getStateInteraction(_0x587121){return new BPromise(function(_0x1574d8){_0x587121[_0x138c('0x2f')]=0x0;_0x587121[_0x138c('0x30')]=0x0;_0x587121[_0x138c('0x31')]=0x0;_0x587121[_0x138c('0x32')]=0x0;_0x587121[_0x138c('0x33')]=0x0;if(!_0x587121[_0x138c('0x34')]&&!_0x587121[_0x138c('0x35')]){_0x587121[_0x138c('0x2f')]+=0x1;}if(!_0x587121[_0x138c('0x34')]&&_0x587121['UserId']){_0x587121['talking']+=0x1;if(_0x587121[_0x138c('0x2f')]){_0x587121[_0x138c('0x2f')]-=0x1;}}if(_0x587121[_0x138c('0x34')]&&_0x587121[_0x138c('0x35')]){_0x587121['answered']+=0x1;if(_0x587121[_0x138c('0x30')]){_0x587121[_0x138c('0x30')]-=0x1;}}if(_0x587121[_0x138c('0x34')]&&!_0x587121['UserId']){_0x587121['unmanaged']+=0x1;if(_0x587121[_0x138c('0x2f')]){_0x587121[_0x138c('0x2f')]-=0x1;}}_0x587121[_0x138c('0x33')]+=0x1;_0x1574d8(_0x587121);});}exports['index']=function(_0x3d418d,_0x2a93e4){var _0x34180f={},_0x52a197={},_0x3ef780={'count':0x0,'rows':[]};var _0x173aec=_[_0x138c('0x21')](db[_0x138c('0x36')]['rawAttributes'],function(_0x1933d9){return{'name':_0x1933d9[_0x138c('0x37')],'type':_0x1933d9[_0x138c('0x38')][_0x138c('0x39')]};});_0x52a197[_0x138c('0x3a')]=_[_0x138c('0x21')](_0x173aec,'name');_0x52a197['query']=_[_0x138c('0x3b')](_0x3d418d['query']);_0x52a197['filters']=_[_0x138c('0x3c')](_0x52a197['model'],_0x52a197[_0x138c('0x3d')]);_0x34180f[_0x138c('0x3e')]=_['intersection'](_0x52a197['model'],qs[_0x138c('0x3f')](_0x3d418d['query'][_0x138c('0x3f')]));_0x34180f[_0x138c('0x3e')]=_0x34180f['attributes']['length']?_0x34180f[_0x138c('0x3e')]:_0x52a197[_0x138c('0x3a')];if(!_0x3d418d['query'][_0x138c('0x40')](_0x138c('0x41'))){_0x34180f['limit']=qs[_0x138c('0x15')](_0x3d418d[_0x138c('0x3d')][_0x138c('0x15')]);_0x34180f[_0x138c('0x13')]=qs['offset'](_0x3d418d['query'][_0x138c('0x13')]);}_0x34180f[_0x138c('0x42')]=qs['sort'](_0x3d418d[_0x138c('0x3d')][_0x138c('0x43')]);_0x34180f['where']=qs[_0x138c('0x44')](_[_0x138c('0x45')](_0x3d418d[_0x138c('0x3d')],_0x52a197['filters']),_0x173aec);var _0x21a337=[];var _0x1f72ef=squel['select']()[_0x138c('0x46')]('id')[_0x138c('0x46')](_0x138c('0x1e'))[_0x138c('0x46')](_0x138c('0x47'))[_0x138c('0x48')](_0x138c('0x49'));var _0x4b5c20=squel[_0x138c('0x4a')]()[_0x138c('0x46')]('u.id')[_0x138c('0x46')]('u.fullname')[_0x138c('0x46')]('ui.MailInteractionId')['from'](_0x138c('0x4b'),'ui')[_0x138c('0x4c')]('users','u',_0x138c('0x4d'));var _0x2d690d=squel[_0x138c('0x4a')]()[_0x138c('0x48')](_0x138c('0x4e'),'i')[_0x138c('0x4c')](_0x138c('0x4f'),'c',_0x138c('0x50'))[_0x138c('0x4c')](_0x138c('0x51'),'o',_0x138c('0x52'))[_0x138c('0x4c')]('mail_accounts','a','a.id\x20=\x20i.MailAccountId')['left_join'](_0x138c('0x53'),'me',_0x138c('0x54'))['left_join'](_0x138c('0x55'),'it','it.MailInteractionId\x20=\x20i.id')[_0x138c('0x4c')](_0x138c('0x49'),'t',_0x138c('0x56'));var _0x46cc97=squel[_0x138c('0x57')]();var _0x5dd5a0=[];var _0x189eb2=squel['expr']();var _0x33be2d;if(_0x3d418d['query'][_0x138c('0x58')]){_0x33be2d=as[_0x138c('0x59')](_0x3d418d['query'][_0x138c('0x58')]);var _0x19209f=_0x33be2d[_0x138c('0x5a')];for(var _0x118bfb=0x0;_0x118bfb<_0x33be2d[_0x138c('0x5b')]['length'];_0x118bfb++){var _0x4ae286=_0x33be2d[_0x138c('0x5b')][_0x118bfb];var _0x2927d5='i';var _0x5553c2=_['find'](_0x173aec,[_0x138c('0x1e'),_0x4ae286[_0x138c('0x46')]]);if(!_0x5553c2){switch(_0x4ae286['field']){case _0x138c('0x5c'):if(_0x4ae286[_0x138c('0x5d')]==0x1){_0x2d690d[_0x138c('0x5e')]('`'+_0x4ae286[_0x138c('0x46')]+_0x138c('0x5f'));}else{_0x2d690d[_0x138c('0x5e')]('`'+_0x4ae286[_0x138c('0x46')]+_0x138c('0x60'));}break;case _0x138c('0x61'):if(_0x4ae286[_0x138c('0x62')]===_0x138c('0x63')){if(_0x4ae286[_0x138c('0x5d')][_0x138c('0x25')]('\x20')[_0x138c('0x64')]>0x1){_0x46cc97[_0x19209f](_0x138c('0x65'),qs[_0x138c('0x66')](_0x4ae286[_0x138c('0x5d')]),null);}else{var _0x4db776='%'+_0x4ae286[_0x138c('0x5d')]+'%';_0x46cc97[_0x19209f](_0x138c('0x67'),_0x4db776,_0x4db776,_0x4db776);}}else{_0x5553c2=_[_0x138c('0x68')](_0x173aec,[_0x138c('0x1e'),'ContactId']);_0x4ae286[_0x138c('0x46')]=_0x138c('0x69');_0x30c8dd=as[_0x138c('0x6a')](_0x2927d5,_0x5553c2[_0x138c('0x38')],_0x4ae286);_0x46cc97[_0x19209f](_0x30c8dd[_0x138c('0x6b')],_0x30c8dd['value'][_0x138c('0x6c')],_0x30c8dd[_0x138c('0x5d')][_0x138c('0x6d')]);}break;case'Tag':var _0x24c396=_0x4ae286[_0x138c('0x5d')][_0x138c('0x25')](',')[_0x138c('0x21')](function(_0x341f8e){return Number(_0x341f8e);});_0x24c396[_0x138c('0x6e')](function(_0x3c9d7e){_0x189eb2['or'](_0x138c('0x6f'),'%,'+_0x3c9d7e+',%');});_0x5dd5a0=_[_0x138c('0x70')](_0x5dd5a0,_0x24c396);break;case _0x138c('0x71'):if(_0x4ae286[_0x138c('0x62')]==='$substring'){_0x46cc97[_0x19209f]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4ae286[_0x138c('0x5d')]+'%',null);}else{_0x5553c2=_[_0x138c('0x68')](_0x173aec,[_0x138c('0x1e'),_0x138c('0x35')]);_0x4ae286['field']=_0x138c('0x35');_0x30c8dd=as[_0x138c('0x6a')](_0x2927d5,_0x5553c2[_0x138c('0x38')],_0x4ae286);_0x46cc97[_0x19209f](_0x30c8dd[_0x138c('0x6b')],_0x30c8dd[_0x138c('0x5d')]['start'],_0x30c8dd[_0x138c('0x5d')][_0x138c('0x6d')]);}break;case'plainBody':_0x30c8dd=as[_0x138c('0x6a')]('me',null,_0x4ae286);_0x46cc97[_0x19209f](_0x30c8dd['text'],_0x30c8dd[_0x138c('0x5d')][_0x138c('0x6c')],_0x30c8dd[_0x138c('0x5d')][_0x138c('0x6d')]);break;}}else{var _0x30c8dd=as['buildExpression'](_0x2927d5,_0x5553c2[_0x138c('0x38')],_0x4ae286);_0x46cc97[_0x19209f](_0x30c8dd[_0x138c('0x6b')],_0x30c8dd[_0x138c('0x5d')][_0x138c('0x6c')],_0x30c8dd[_0x138c('0x5d')][_0x138c('0x6d')]);}}}else{var _0x32af9d=_(_0x3d418d[_0x138c('0x3d')])[_0x138c('0x3b')]()[_0x138c('0x21')](function(_0x27315b){return _[_0x138c('0x72')](_0x173aec,[_0x138c('0x1e'),_0x27315b])?_0x27315b:undefined;})['compact']()[_0x138c('0x5d')]();if(!_[_0x138c('0x73')](_0x32af9d)){_0x32af9d['forEach'](function(_0x1ae3dc){if(_0x1ae3dc===_0x138c('0x74')){_0x2d690d[_0x138c('0x75')](_0x138c('0x76'),[][_0x138c('0x77')](_0x3d418d[_0x138c('0x3d')][_0x1ae3dc]));}else if(_0x1ae3dc==='createdAt'){var _0xa43ce9=JSON[_0x138c('0x78')](_0x3d418d['query'][_0x1ae3dc])[_0x138c('0x79')];var _0x2abc72=JSON[_0x138c('0x78')](_0x3d418d['query'][_0x1ae3dc])[_0x138c('0x7a')];_0x2d690d[_0x138c('0x75')](_0x138c('0x7b'),_0xa43ce9,_0x2abc72);}else{if(_0x3d418d[_0x138c('0x3d')][_0x1ae3dc]==='null'){_0x2d690d[_0x138c('0x75')]('i.'+_0x1ae3dc+'\x20IS\x20NULL');}else{_0x2d690d[_0x138c('0x75')]('i.'+_0x1ae3dc+_0x138c('0x7c'),_0x3d418d['query'][_0x1ae3dc]);}}});}if(_0x3d418d['query']['read']){if(_0x3d418d[_0x138c('0x3d')][_0x138c('0x7d')]==0x1){_0x2d690d['having'](_0x138c('0x7e'));}else{_0x2d690d['having'](_0x138c('0x7f'));}}if(_0x3d418d['query'][_0x138c('0x80')]){_0x5dd5a0=_[_0x138c('0x81')](_0x3d418d[_0x138c('0x3d')][_0x138c('0x80')])?_0x3d418d[_0x138c('0x3d')][_0x138c('0x80')]:new Array(_0x3d418d[_0x138c('0x3d')][_0x138c('0x80')]);_0x5dd5a0[_0x138c('0x6e')](function(_0x11e42b){_0x189eb2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x11e42b+',%');});}if(_0x3d418d['query'][_0x138c('0x82')]){var _0x3f8e87=_0x3d418d[_0x138c('0x3d')][_0x138c('0x82')]['replace']('\x5c','\x5c\x5c')[_0x138c('0x83')](/'/g,'\x27\x27');if(qs[_0x138c('0x84')](_0x3f8e87)){_0x46cc97['or'](_0x138c('0x85'),_0x3f8e87+'%');}else if(qs[_0x138c('0x86')](_0x3f8e87)){_0x46cc97['or']('c.email\x20LIKE\x20?',_0x3f8e87+'%');}else{_0x46cc97['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x138c('0x66')](_0x3f8e87))['or'](_0x138c('0x87'),qs[_0x138c('0x66')](_0x3f8e87));}}}_0x2d690d[_0x138c('0x75')](_0x46cc97);_0x2d690d[_0x138c('0x88')](_0x138c('0x89'));var _0x55e130={'type':db[_0x138c('0x8a')]['QueryTypes']['SELECT'],'raw':!![]};var _0x2ae6b9=_0x2d690d['clone']();_0x2ae6b9[_0x138c('0x46')](_0x138c('0x89'));_0x2ae6b9[_0x138c('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x138c('0x5c'));if(_0x34180f[_0x138c('0x42')]){_0x34180f[_0x138c('0x42')]['forEach'](function(_0x1c8667){var _0x46a105=_0x1c8667[0x0]==='contactName'?_0x1c8667[0x0]:'i.'+_0x1c8667[0x0];_0x2d690d[_0x138c('0x42')](_0x46a105,_0x1c8667[0x1]===_0x138c('0x8b')?![]:!![]);});}if(!_[_0x138c('0x73')](_0x5dd5a0)){_0x2d690d[_0x138c('0x5e')](_0x189eb2);_0x2ae6b9[_0x138c('0x75')]('t.id\x20IN\x20?',_0x5dd5a0);}BPromise[_0x138c('0x8c')]()[_0x138c('0x1b')](function(){if(!_0x33be2d){if(_0x3d418d['query']['MailAccountId'])return;_0x2ae6b9[_0x138c('0x75')](_0x138c('0x8d'));_0x2d690d['where'](_0x138c('0x8d'));return;}if(_0x3d418d['user']['role']!==_0x138c('0x8e'))return;return _0x3d418d[_0x138c('0x8f')][_0x138c('0x90')]({'attributes':['id'],'raw':!![]})[_0x138c('0x1b')](function(_0x46e09b){if(_[_0x138c('0x73')](_0x46e09b)){_0x2ae6b9['where'](_0x138c('0x91'));_0x2d690d['where']('i.MailAccountId\x20IS\x20NULL');}else{_0x2ae6b9[_0x138c('0x75')](_0x138c('0x76'),_[_0x138c('0x21')](_0x46e09b,'id'));_0x2d690d[_0x138c('0x75')]('i.MailAccountId\x20IN\x20?',_[_0x138c('0x21')](_0x46e09b,'id'));}});})[_0x138c('0x1b')](function(){if(_0x3d418d[_0x138c('0x8f')][_0x138c('0x92')]==='agent'&&!_0x33be2d&&!_0x3d418d[_0x138c('0x3d')]['MailAccountId'])return[];return db[_0x138c('0x93')][_0x138c('0x3d')](_0x2ae6b9['toString'](),_0x55e130);})[_0x138c('0x1b')](function(_0x374fb5){_0x3ef780['count']=_0x374fb5[_0x138c('0x64')];if(_0x3ef780[_0x138c('0x16')]===0x0)return[];return db['sequelize']['query'](_0x1f72ef['toString'](),_0x55e130)[_0x138c('0x1b')](function(_0xd0179b){_0x21a337=_['keyBy'](_0xd0179b,'id');_0x55e130=_['merge'](_0x55e130,{'model':db[_0x138c('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d418d['query'][_0x138c('0x3f')]){_0x34180f[_0x138c('0x3e')][_0x138c('0x6e')](function(_0x537e2c){_0x2d690d[_0x138c('0x46')]('i.'+_0x537e2c);});}else{_0x2d690d['field'](_0x138c('0x94'),_0x138c('0x5c'));_0x2d690d[_0x138c('0x46')](_0x138c('0x95'),_0x138c('0x96'));_0x2d690d[_0x138c('0x46')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x2d690d[_0x138c('0x46')](_0x138c('0x97'),_0x138c('0x98'));_0x2d690d[_0x138c('0x46')](_0x138c('0x99'),'contactName');_0x2d690d['field']('i.id');_0x2d690d['field']('i.createdAt');_0x2d690d[_0x138c('0x46')](_0x138c('0x9a'));_0x2d690d[_0x138c('0x46')](_0x138c('0x9b'));_0x2d690d[_0x138c('0x46')](_0x138c('0x9c'));_0x2d690d[_0x138c('0x46')](_0x138c('0x9d'));_0x2d690d[_0x138c('0x46')](_0x138c('0x9e'));_0x2d690d[_0x138c('0x46')](_0x138c('0x9f'));_0x2d690d[_0x138c('0x46')](_0x138c('0xa0'));_0x2d690d[_0x138c('0x46')](_0x138c('0xa1'));_0x2d690d['field'](_0x138c('0xa2'));_0x2d690d[_0x138c('0x46')](_0x138c('0xa3'));_0x2d690d[_0x138c('0x46')](_0x138c('0xa4'));_0x2d690d[_0x138c('0x46')]('i.to');_0x2d690d[_0x138c('0x46')](_0x138c('0xa5'));_0x2d690d[_0x138c('0x46')](_0x138c('0xa6'));_0x2d690d[_0x138c('0x46')](_0x138c('0xa7'));_0x2d690d[_0x138c('0x46')](_0x138c('0xa8'),_0x138c('0xa9'));_0x2d690d[_0x138c('0x46')]('c.lastName',_0x138c('0xaa'));_0x2d690d[_0x138c('0x46')](_0x138c('0xab'),'Contact.email');_0x2d690d[_0x138c('0x46')](_0x138c('0xac'),'Contact.phone');_0x2d690d['field']('c.mobile',_0x138c('0xad'));_0x2d690d[_0x138c('0x46')](_0x138c('0xae'),'Contact.fax');_0x2d690d[_0x138c('0x46')](_0x138c('0xaf'),'Owner.fullname');_0x2d690d[_0x138c('0x46')](_0x138c('0xb0'),_0x138c('0xb1'));_0x2d690d[_0x138c('0x46')](_0x138c('0xb2'),_0x138c('0x23'));}if(_0x34180f[_0x138c('0x15')])_0x2d690d[_0x138c('0x15')](_0x34180f[_0x138c('0x15')]);if(_0x34180f[_0x138c('0x13')])_0x2d690d[_0x138c('0x13')](_0x34180f[_0x138c('0x13')]);return db['sequelize'][_0x138c('0x3d')](_0x2d690d[_0x138c('0xb3')](),_0x55e130);})[_0x138c('0x1b')](function(_0x3a583d){if(_0x3a583d[_0x138c('0x64')]>0x0)_0x4b5c20[_0x138c('0x75')](_0x138c('0xb4'),_[_0x138c('0x21')](_0x3a583d,'id'));return db[_0x138c('0x93')]['query'](_0x4b5c20['toString'](),_0x55e130)[_0x138c('0x1b')](function(_0x4ca58c){var _0x26999d=_['groupBy'](_0x4ca58c,_0x138c('0xb5'));var _0x4b6c08=[];return db[_0x138c('0xb6')]['findOne']({'attributes':[_0x138c('0xb7')],'raw':!![]})['then'](function(_0x23efc6){var _0x59f04f=_0x23efc6[_0x138c('0xb7')];_0x3a583d[_0x138c('0x6e')](function(_0x462f9f){_0x4b6c08[_0x138c('0x26')](updateMailInteraction(_0x462f9f,_0x21a337,_0x26999d,_0x59f04f));});return BPromise['all'](_0x4b6c08);});});});})[_0x138c('0x1b')](function(_0x195890){_0x3ef780[_0x138c('0xb8')]=_0x195890;return _0x3ef780;})[_0x138c('0x1b')](respondWithFilteredResult(_0x2a93e4,_0x34180f))[_0x138c('0x2e')](handleError(_0x2a93e4,null));};exports[_0x138c('0xb9')]=function(_0x425b6d,_0x5b050e){var _0x1eca4b={'raw':![],'where':{'id':_0x425b6d[_0x138c('0xba')]['id']}},_0x1141dc={};_0x1141dc[_0x138c('0x3a')]=_[_0x138c('0x3b')](db[_0x138c('0x36')][_0x138c('0xbb')]);_0x1141dc[_0x138c('0x3d')]=_['keys'](_0x425b6d[_0x138c('0x3d')]);_0x1141dc['filters']=_[_0x138c('0x3c')](_0x1141dc[_0x138c('0x3a')],_0x1141dc[_0x138c('0x3d')]);_0x1eca4b['attributes']=_['intersection'](_0x1141dc[_0x138c('0x3a')],qs[_0x138c('0x3f')](_0x425b6d['query'][_0x138c('0x3f')]));_0x1eca4b[_0x138c('0x3e')]=_0x1eca4b[_0x138c('0x3e')][_0x138c('0x64')]?_0x1eca4b[_0x138c('0x3e')]:_0x1141dc[_0x138c('0x3a')];if(_0x425b6d[_0x138c('0x3d')][_0x138c('0xbc')]){_0x1eca4b[_0x138c('0xbd')]=[{'all':!![]}];}_0x1eca4b=_[_0x138c('0xbe')]({},_0x1eca4b,_0x425b6d['options']);return db[_0x138c('0x36')]['find'](_0x1eca4b)[_0x138c('0x1b')](handleEntityNotFound(_0x5b050e,null))[_0x138c('0x1b')](respondWithResult(_0x5b050e,null))[_0x138c('0x2e')](handleError(_0x5b050e,null));};exports['create']=function(_0x4af750,_0x5e0859){return db['MailInteraction'][_0x138c('0xbf')](_0x4af750[_0x138c('0xc0')],{})['then'](respondWithResult(_0x5e0859,0xc9))[_0x138c('0x2e')](handleError(_0x5e0859,null));};exports[_0x138c('0x1a')]=function(_0x392185,_0x3c8a9f){if(_0x392185['body']['id']){delete _0x392185[_0x138c('0xc0')]['id'];}return db[_0x138c('0x36')][_0x138c('0x68')]({'where':{'id':_0x392185['params']['id']}})[_0x138c('0x1b')](handleEntityNotFound(_0x3c8a9f,null))[_0x138c('0x1b')](saveUpdates(_0x392185['body'],null))[_0x138c('0x1b')](respondWithResult(_0x3c8a9f,null))[_0x138c('0x2e')](handleError(_0x3c8a9f,null));};exports[_0x138c('0x1c')]=function(_0x52c8b8,_0x967712){return db[_0x138c('0x36')][_0x138c('0x68')]({'where':{'id':_0x52c8b8[_0x138c('0xba')]['id']}})[_0x138c('0x1b')](handleEntityNotFound(_0x967712,null))['then'](removeEntity(_0x967712,null))[_0x138c('0x2e')](handleError(_0x967712,null));};exports[_0x138c('0xc1')]=function(_0x420d75,_0x4990c3){return db['MailInteraction'][_0x138c('0xc1')]()[_0x138c('0x1b')](respondWithResult(_0x4990c3,null))[_0x138c('0x2e')](handleError(_0x4990c3,null));};exports[_0x138c('0xc2')]=function(_0x4ae51a,_0x3b8c78){return db[_0x138c('0x27')][_0x138c('0x68')]({'where':{'id':_0x4ae51a['params']['id']}})[_0x138c('0x1b')](handleEntityNotFound(_0x3b8c78,null))[_0x138c('0x1b')](function(_0x3a5dfb){if(_0x3a5dfb){return _0x3a5dfb[_0x138c('0xc2')](_0x4ae51a[_0x138c('0xc0')][_0x138c('0xc3')],_['omit'](_0x4ae51a[_0x138c('0xc0')],['ids','id'])||{});}})[_0x138c('0x1b')](respondWithResult(_0x3b8c78,null))[_0x138c('0x2e')](handleError(_0x3b8c78,null));};exports[_0x138c('0xc4')]=function(_0x2e0f52,_0x15fba9){var _0x5a2878={'raw':![],'where':{}};var _0x46c26d={};var _0x536902={'count':0x0,'rows':[]};return db[_0x138c('0x36')]['findOne']({'where':{'id':_0x2e0f52[_0x138c('0xba')]['id']}})[_0x138c('0x1b')](handleEntityNotFound(_0x15fba9,null))['then'](function(_0x234763){if(_0x234763){_0x46c26d[_0x138c('0x3a')]=_[_0x138c('0x3b')](db[_0x138c('0x27')][_0x138c('0xbb')]);_0x46c26d[_0x138c('0x3d')]=_[_0x138c('0x3b')](_0x2e0f52['query']);_0x46c26d[_0x138c('0x44')]=_[_0x138c('0x3c')](_0x46c26d['model'],_0x46c26d['query']);_0x5a2878[_0x138c('0x3e')]=_[_0x138c('0x3c')](_0x46c26d[_0x138c('0x3a')],qs[_0x138c('0x3f')](_0x2e0f52['query']['fields']));_0x5a2878[_0x138c('0x3e')]=_0x5a2878[_0x138c('0x3e')][_0x138c('0x64')]?_0x5a2878[_0x138c('0x3e')]:_0x46c26d['model'];if(!_0x2e0f52[_0x138c('0x3d')][_0x138c('0x40')]('nolimit')){_0x5a2878['limit']=qs[_0x138c('0x15')](_0x2e0f52[_0x138c('0x3d')][_0x138c('0x15')]);_0x5a2878[_0x138c('0x13')]=qs['offset'](_0x2e0f52['query'][_0x138c('0x13')]);}_0x5a2878[_0x138c('0x42')]=qs[_0x138c('0x43')](_0x2e0f52['query'][_0x138c('0x43')]);_0x5a2878[_0x138c('0x75')]=qs['filters'](_[_0x138c('0x45')](_0x2e0f52['query'],_0x46c26d[_0x138c('0x44')]));_0x5a2878[_0x138c('0x75')][_0x138c('0xb5')]=_0x234763['id'];if(_0x2e0f52[_0x138c('0x3d')][_0x138c('0x82')]){_0x5a2878['where']=_[_0x138c('0xbe')](_0x5a2878[_0x138c('0x75')],{'$or':_['map'](_0x5a2878[_0x138c('0x3e')],function(_0x56e3d8){var _0x1c3601={};_0x1c3601[_0x56e3d8]={'$like':'%'+_0x2e0f52[_0x138c('0x3d')][_0x138c('0x82')]+'%'};return _0x1c3601;})});}if(_0x2e0f52[_0x138c('0x3d')][_0x138c('0x79')]){var _0x141f96=_0x2e0f52[_0x138c('0x3d')][_0x138c('0x79')][_0x138c('0x25')](',');var _0x4538f9={};_0x4538f9[_0x141f96[0x0]]={'$gte':moment(_0x141f96[0x1])[_0x138c('0xc5')](_0x138c('0xc6'))};_0x5a2878[_0x138c('0x75')]=_[_0x138c('0xbe')](_0x5a2878[_0x138c('0x75')],_0x4538f9);}_0x5a2878=_[_0x138c('0xbe')]({},_0x5a2878,_0x2e0f52[_0x138c('0xc7')]);return db[_0x138c('0x27')]['count']({'where':_0x5a2878['where']})[_0x138c('0x1b')](function(_0x36aff7){_0x536902[_0x138c('0x16')]=_0x36aff7;if(_0x2e0f52[_0x138c('0x3d')]['includeAll']){_0x5a2878[_0x138c('0xbd')]=[{'all':!![]}];}return db[_0x138c('0x27')][_0x138c('0xc8')](_0x5a2878);})[_0x138c('0x1b')](function(_0x548606){if(_0x2e0f52[_0x138c('0x3d')][_0x138c('0xc9')]===_0x138c('0xca')){for(var _0x1b9e49=0x0;_0x1b9e49<_0x548606[_0x138c('0x64')];_0x1b9e49++){_0x548606[_0x1b9e49][_0x138c('0xc0')]=juice(_0x548606[_0x1b9e49]['body']);}}_0x536902['rows']=_0x548606;return _0x536902;});}})[_0x138c('0x1b')](respondWithFilteredResult(_0x15fba9,_0x5a2878))[_0x138c('0x2e')](handleError(_0x15fba9,null));};exports[_0x138c('0xcb')]=function(_0x7a46c,_0x3d4ab0){return db['MailInteraction'][_0x138c('0x68')]({'where':{'id':_0x7a46c['params']['id']}})[_0x138c('0x1b')](handleEntityNotFound(_0x3d4ab0,null))['then'](function(_0x4eb2ca){if(_0x4eb2ca){return _0x4eb2ca[_0x138c('0xcc')](_0x7a46c[_0x138c('0xc0')][_0x138c('0xc3')],_[_0x138c('0xcd')](_0x7a46c[_0x138c('0xc0')],['ids','id'])||{})[_0x138c('0xce')](function(){return db['Tag'][_0x138c('0xc8')]({'attributes':['id',_0x138c('0x1e'),_0x138c('0x47')],'where':{'id':_0x7a46c[_0x138c('0xc0')][_0x138c('0xc3')]}});})['then'](function(_0x4ea6da){socket['emit'](_0x138c('0xcf'),{'id':Number(_0x7a46c[_0x138c('0xba')]['id']),'tags':_0x4ea6da||[]});return{'id':Number(_0x7a46c[_0x138c('0xba')]['id']),'tags':_0x4ea6da||[]};});}})['then'](respondWithResult(_0x3d4ab0,null))[_0x138c('0x2e')](handleError(_0x3d4ab0,null));};exports[_0x138c('0xd0')]=function(_0x389190,_0x18c45e){return db[_0x138c('0x36')][_0x138c('0x68')]({'where':{'id':_0x389190[_0x138c('0xba')]['id']}})['then'](handleEntityNotFound(_0x18c45e,null))['then'](function(_0x5ba017){if(_0x5ba017){return _0x5ba017[_0x138c('0xd0')](_0x389190[_0x138c('0x3d')][_0x138c('0xc3')]);}})[_0x138c('0x1b')](respondWithStatusCode(_0x18c45e,null))['catch'](handleError(_0x18c45e,null));};exports['download']=function(_0x4ca709,_0x40a533){var _0x3716f0=moment()[_0x138c('0xd1')]()['toString']();var _0x1dc577=path['join'](config[_0x138c('0xd2')],_0x138c('0xd3'),'files',_0x138c('0xd4'));var _0x8e6bed=path[_0x138c('0xd5')](config[_0x138c('0xd2')],_0x138c('0xd3'),_0x138c('0xd6'),_0x138c('0xd7'));var _0x1b6696=path[_0x138c('0xd5')](_0x1dc577,_0x3716f0);var _0x4b4157=util[_0x138c('0xc5')](_0x138c('0xd8'),_0x4ca709[_0x138c('0xba')]['id'],_0x3716f0);var _0x2e0dfb=path['join'](_0x1dc577,_0x4b4157);var _0x5c149a=[];if(_0x4ca709['query'][_0x138c('0xd7')]){_0x5c149a['push']({'model':db[_0x138c('0xd9')],'as':_0x138c('0xda'),'raw':!![]});}var _0x4e1223=[{'model':db[_0x138c('0x27')],'as':_0x138c('0xdb'),'attributes':['id','body',_0x138c('0x48'),'to','cc',_0x138c('0xdc'),_0x138c('0xdd'),_0x138c('0xde')],'where':{'secret':![]},'order':qs[_0x138c('0x43')]('id'),'include':_0x5c149a}];return db[_0x138c('0x36')]['find']({'where':{'id':_0x4ca709['params']['id']},'include':_0x4e1223})[_0x138c('0x1b')](handleEntityNotFound(_0x40a533,null))[_0x138c('0x1b')](function(_0x239f16){if(_0x239f16&&_0x239f16[_0x138c('0xdb')]){var _0x3673ae=_0x239f16['get']({'plain':!![]});fs[_0x138c('0xdf')](_0x1b6696);return BPromise[_0x138c('0xe0')](_0x3673ae[_0x138c('0xdb')],function(_0x3e8a9a,_0x1ce8a5){var _0x5ee38e={'from':_0x3e8a9a[_0x138c('0x48')],'to':_0x3e8a9a['to'],'subject':_0x3e8a9a['subject'],'html':htmlEntities[_0x138c('0xe1')](_0x3e8a9a[_0x138c('0xc0')]),'headers':{'Date':moment(_0x3e8a9a['createdAt'])[_0x138c('0xc5')](_0x138c('0xe2'))},'attachments':[]};if(_0x3e8a9a['cc']){_0x5ee38e[_0x138c('0xe3')]['Cc']=_0x3e8a9a['cc'];}if(_0x3e8a9a['bcc']){_0x5ee38e[_0x138c('0xe3')][_0x138c('0xe4')]=_0x3e8a9a[_0x138c('0xdc')];}return new BPromise(function(_0x25490c,_0x3c6083){if(_0x3e8a9a[_0x138c('0xda')]){for(var _0x1da7cb=0x0;_0x1da7cb<_0x3e8a9a['Attachments'][_0x138c('0x64')];_0x1da7cb++){var _0x3d45dc=_0x3e8a9a['Attachments'][_0x1da7cb];var _0x206b3c=path['join'](_0x8e6bed,_0x3d45dc[_0x138c('0xe5')]);if(fs[_0x138c('0xe6')](_0x206b3c)){_0x5ee38e[_0x138c('0xd7')][_0x138c('0x26')]({'name':_0x3d45dc[_0x138c('0x1e')],'contentType':_0x3d45dc[_0x138c('0x38')],'data':fs[_0x138c('0xe7')](_0x206b3c)});}}}emlformat[_0x138c('0xe8')](_0x5ee38e,function(_0x30a9fa,_0x245409){if(_0x30a9fa)return _0x3c6083(_0x30a9fa);fs[_0x138c('0xe9')](path['join'](_0x1b6696,util['format'](_0x138c('0xea'),_0x1ce8a5)),_0x245409);return _0x25490c(_0x245409);});});})[_0x138c('0x1b')](function(){return new BPromise(function(_0x423c94,_0x510f21){zipdir(_0x1b6696,{'saveTo':_0x2e0dfb},function(_0x39a15b,_0x4e9860){if(_0x39a15b)return _0x510f21(_0x39a15b);return _0x423c94(_0x4e9860);});})['then'](function(){return new BPromise(function(_0x23a8fb,_0x318119){rimraf(_0x1b6696,function(_0x466181){if(_0x466181)_0x318119(_0x466181);return _0x23a8fb();});});})[_0x138c('0x1b')](function(){return _0x40a533[_0x138c('0xeb')](_0x2e0dfb,_0x4b4157,function(_0x465dff){if(!_0x465dff)fs[_0x138c('0xec')](_0x2e0dfb);});});});}else{return _0x40a533[_0x138c('0x11')](0xc8);}})[_0x138c('0x2e')](handleError(_0x40a533,null));};
\ No newline at end of file
index 000c9e9..e26477d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8826=['map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','MailInteraction','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x2e50a2,_0x27f31e){var _0x47e5de=function(_0x4e1f70){while(--_0x4e1f70){_0x2e50a2['push'](_0x2e50a2['shift']());}};_0x47e5de(++_0x27f31e);}(_0x8826,0x139));var _0x6882=function(_0x16a491,_0x17ca2c){_0x16a491=_0x16a491-0x0;var _0x2d7679=_0x8826[_0x16a491];return _0x2d7679;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0x6882('0x0')];var MailMessage=require(_0x6882('0x1'))['db'][_0x6882('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x6882('0x3')](0x0);var events={'afterCreate':_0x6882('0x4'),'afterUpdate':_0x6882('0x5'),'afterDestroy':_0x6882('0x6')};function emitEvent(_0x49af3d){return function(_0x19e52e,_0x30d9f8,_0x5779a8){_0x19e52e[_0x6882('0x7')]({'attributes':['id'],'raw':!![]})[_0x6882('0x8')](function(_0x462b16){_0x19e52e[_0x6882('0x9')](_0x6882('0xa'),_0x462b16[_0x6882('0xb')](function(_0x53f8e5){return{'id':_0x53f8e5['id']};}));return MailMessage[_0x6882('0xc')]({'where':{'MailInteractionId':_0x19e52e['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x7fc4d4){_0x19e52e[_0x6882('0x9')](_0x6882('0xd'),_0x7fc4d4[_0x6882('0xe')]);MailInteractionEvents[_0x6882('0xf')](_0x49af3d+':'+_0x19e52e['id'],_0x19e52e);MailInteractionEvents[_0x6882('0xf')](_0x49af3d,_0x19e52e);_0x5779a8(null);})[_0x6882('0x10')](_0x5779a8(null));};}for(var e in events){if(events[_0x6882('0x11')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents;
\ No newline at end of file
+var _0x6c8b=['events','../../mysqldb','MailInteraction','setMaxListeners','update','remove','getUsers','findAll','setDataValue','length','emit','catch','hasOwnProperty'];(function(_0x4cf2b7,_0x358ed2){var _0x11b5b9=function(_0x523f8e){while(--_0x523f8e){_0x4cf2b7['push'](_0x4cf2b7['shift']());}};_0x11b5b9(++_0x358ed2);}(_0x6c8b,0xa9));var _0xb6c8=function(_0x3ce074,_0xbfd516){_0x3ce074=_0x3ce074-0x0;var _0x536a68=_0x6c8b[_0x3ce074];return _0x536a68;};'use strict';var EventEmitter=require(_0xb6c8('0x0'));var MailInteraction=require(_0xb6c8('0x1'))['db'][_0xb6c8('0x2')];var MailMessage=require(_0xb6c8('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xb6c8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb6c8('0x4'),'afterDestroy':_0xb6c8('0x5')};function emitEvent(_0x88c675){return function(_0x23532c,_0x52a316,_0x115024){_0x23532c[_0xb6c8('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x55db34){_0x23532c['setDataValue']('Users',_0x55db34['map'](function(_0x724317){return{'id':_0x724317['id']};}));return MailMessage[_0xb6c8('0x7')]({'where':{'MailInteractionId':_0x23532c['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x29ad03){_0x23532c[_0xb6c8('0x8')]('unreadMessages',_0x29ad03[_0xb6c8('0x9')]);MailInteractionEvents[_0xb6c8('0xa')](_0x88c675+':'+_0x23532c['id'],_0x23532c);MailInteractionEvents[_0xb6c8('0xa')](_0x88c675,_0x23532c);_0x115024(null);})[_0xb6c8('0xb')](_0x115024(null));};}for(var e in events){if(events[_0xb6c8('0xc')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents;
\ No newline at end of file
index d4c503c..6167540 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd963=['changed','get','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x81e39d,_0x4c3934){var _0x548fbb=function(_0x1adda5){while(--_0x1adda5){_0x81e39d['push'](_0x81e39d['shift']());}};_0x548fbb(++_0x4c3934);}(_0xd963,0xd2));var _0x3d96=function(_0x56e0e8,_0x16ef91){_0x56e0e8=_0x56e0e8-0x0;var _0x2dab50=_0xd963[_0x56e0e8];return _0x2dab50;};'use strict';var _=require(_0x3d96('0x0'));var util=require(_0x3d96('0x1'));var logger=require(_0x3d96('0x2'))('api');var moment=require(_0x3d96('0x3'));var BPromise=require(_0x3d96('0x4'));var rp=require(_0x3d96('0x5'));var fs=require('fs');var path=require(_0x3d96('0x6'));var rimraf=require(_0x3d96('0x7'));var config=require(_0x3d96('0x8'));var attributes=require(_0x3d96('0x9'));module[_0x3d96('0xa')]=function(_0x4dcad1,_0xd47338){return _0x4dcad1[_0x3d96('0xb')]('MailInteraction',attributes,{'tableName':_0x3d96('0xc'),'paranoid':![],'indexes':[{'name':_0x3d96('0xd'),'fields':[_0x3d96('0xe'),'to'],'type':_0x3d96('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5425be,_0x2c797c,_0x28df91){if(_0x5425be[_0x3d96('0x10')]){_0x5425be[_0x3d96('0x11')]=moment()[_0x3d96('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5425be[_0x3d96('0x13')]){_0x5425be[_0x3d96('0x14')]=moment()[_0x3d96('0x12')](_0x3d96('0x15'));}_0x28df91(null,_0x2c797c);},'beforeUpdate':function(_0x38cbaf,_0x32c847,_0x22229c){if(_0x38cbaf[_0x3d96('0x16')](_0x3d96('0x10'))){_0x38cbaf[_0x3d96('0x11')]=_0x38cbaf[_0x3d96('0x10')]?moment()[_0x3d96('0x12')](_0x3d96('0x15')):null;}if(_0x38cbaf['changed'](_0x3d96('0x13'))){_0x38cbaf[_0x3d96('0x14')]=moment()[_0x3d96('0x12')](_0x3d96('0x15'));_0x38cbaf[_0x3d96('0x10')]=null;_0x38cbaf['substatusAt']=null;}_0x22229c(null,_0x38cbaf);},'afterUpdate':function(_0xc363a9,_0x41821e,_0xfd0789){var _0x30122d=_0x4dcad1['models'];var _0x5befbb=_0xc363a9[_0x3d96('0x17')]({'plain':!![]});if(_0x5befbb['closed']){return _0x30122d['MailMessage'][_0x3d96('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x5befbb['id']}})[_0x3d96('0x19')](function(){_0xfd0789();})[_0x3d96('0x1a')](function(_0xd0aed2){_0xfd0789(_0xd0aed2);});}else{_0xfd0789();}}},'charset':_0x3d96('0x1b'),'collate':_0x3d96('0x1c')});};
\ No newline at end of file
+var _0x4e4b=['closedAt','changed','models','get','MailMessage','update','then','catch','utf8mb4_unicode_ci','lodash','util','moment','request-promise','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x4e4b,0x75));var _0xb4e4=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0x4e4b[_0x42bdad];return _0x122626;};'use strict';var _=require(_0xb4e4('0x0'));var util=require(_0xb4e4('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb4e4('0x2'));var BPromise=require('bluebird');var rp=require(_0xb4e4('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb4e4('0x4'));var config=require('../../config/environment');var attributes=require(_0xb4e4('0x5'));module[_0xb4e4('0x6')]=function(_0x1ebed7,_0x49215c){return _0x1ebed7[_0xb4e4('0x7')](_0xb4e4('0x8'),attributes,{'tableName':_0xb4e4('0x9'),'paranoid':![],'indexes':[{'name':_0xb4e4('0xa'),'fields':[_0xb4e4('0xb'),'to'],'type':_0xb4e4('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1281e6,_0x4986f4,_0x369ce9){if(_0x1281e6[_0xb4e4('0xd')]){_0x1281e6[_0xb4e4('0xe')]=moment()[_0xb4e4('0xf')](_0xb4e4('0x10'));}if(_0x1281e6[_0xb4e4('0x11')]){_0x1281e6[_0xb4e4('0x12')]=moment()[_0xb4e4('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x369ce9(null,_0x4986f4);},'beforeUpdate':function(_0x3de8c1,_0x2d14c9,_0x4f5d53){if(_0x3de8c1['changed'](_0xb4e4('0xd'))){_0x3de8c1['substatusAt']=_0x3de8c1[_0xb4e4('0xd')]?moment()[_0xb4e4('0xf')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x3de8c1[_0xb4e4('0x13')](_0xb4e4('0x11'))){_0x3de8c1['closedAt']=moment()[_0xb4e4('0xf')](_0xb4e4('0x10'));_0x3de8c1['substatus']=null;_0x3de8c1[_0xb4e4('0xe')]=null;}_0x4f5d53(null,_0x3de8c1);},'afterUpdate':function(_0x21be9c,_0x48e7f1,_0x3b84a9){var _0x42071b=_0x1ebed7[_0xb4e4('0x14')];var _0xe23e70=_0x21be9c[_0xb4e4('0x15')]({'plain':!![]});if(_0xe23e70[_0xb4e4('0x11')]){return _0x42071b[_0xb4e4('0x16')][_0xb4e4('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0xe23e70['id']}})[_0xb4e4('0x18')](function(){_0x3b84a9();})[_0xb4e4('0x19')](function(_0x129f77){_0x3b84a9(_0x129f77);});}else{_0x3b84a9();}}},'charset':'utf8mb4','collate':_0xb4e4('0x1a')});};
\ No newline at end of file
index 2efcc20..64f3a78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe66c=['socket.io-emitter','redis','then','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateMailInteraction','body','options','raw','where','limit','AddTagsToMailInteraction','MailInteraction','find','addTags','ids','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','localhost'];(function(_0xd0f591,_0x51302d){var _0x6a79bd=function(_0x605e6a){while(--_0x605e6a){_0xd0f591['push'](_0xd0f591['shift']());}};_0x6a79bd(++_0x51302d);}(_0xe66c,0x105));var _0xce66=function(_0x58462e,_0xb87e05){_0x58462e=_0x58462e-0x0;var _0x4685c8=_0xe66c[_0x58462e];return _0x4685c8;};'use strict';var _=require(_0xce66('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xce66('0x1'));var rs=require(_0xce66('0x2'));var fs=require('fs');var Redis=require(_0xce66('0x3'));var db=require(_0xce66('0x4'))['db'];var utils=require(_0xce66('0x5'));var logger=require(_0xce66('0x6'))(_0xce66('0x7'));var config=require(_0xce66('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xce66('0x9')][_0xce66('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xce66('0xb'),'port':0x18eb});var socket=require(_0xce66('0xc'))(new Redis(config[_0xce66('0xd')]));require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x50fd30,_0x9427ec,_0x2dd143){return new BPromise(function(_0x43607b,_0x2c5635){return client['request'](_0x50fd30,_0x2dd143)[_0xce66('0xe')](function(_0x449925){logger['info']('MailInteraction,\x20%s,\x20%s',_0x9427ec,_0xce66('0xf'));logger[_0xce66('0x10')](_0xce66('0x11'),_0x9427ec,_0xce66('0xf'),JSON[_0xce66('0x12')](_0x449925));if(_0x449925[_0xce66('0x13')]){if(_0x449925[_0xce66('0x13')][_0xce66('0x14')]===0x1f4){logger['error'](_0xce66('0x15'),_0x9427ec,_0x449925[_0xce66('0x13')][_0xce66('0x16')]);return _0x2c5635(_0x449925[_0xce66('0x13')][_0xce66('0x16')]);}logger[_0xce66('0x13')](_0xce66('0x15'),_0x9427ec,_0x449925[_0xce66('0x13')]['message']);return _0x43607b(_0x449925[_0xce66('0x13')][_0xce66('0x16')]);}else{logger[_0xce66('0x17')]('MailInteraction,\x20%s,\x20%s',_0x9427ec,_0xce66('0xf'));_0x43607b(_0x449925[_0xce66('0x18')]['message']);}})[_0xce66('0x19')](function(_0x2da36b){logger['error']('MailInteraction,\x20%s,\x20%s',_0x9427ec,_0x2da36b);_0x2c5635(_0x2da36b);});});}exports[_0xce66('0x1a')]=function(_0x41c368){var _0x46122b=this;return new Promise(function(_0x6ca85a,_0x1d7ec8){return db['MailInteraction']['update'](_0x41c368[_0xce66('0x1b')],{'raw':_0x41c368[_0xce66('0x1c')]?_0x41c368[_0xce66('0x1c')][_0xce66('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41c368[_0xce66('0x1c')]?_0x41c368['options'][_0xce66('0x1e')]||null:null,'attributes':_0x41c368[_0xce66('0x1c')]?_0x41c368[_0xce66('0x1c')]['attributes']||null:null,'limit':_0x41c368[_0xce66('0x1c')]?_0x41c368[_0xce66('0x1c')][_0xce66('0x1f')]||null:null})[_0xce66('0xe')](function(_0x532d80){logger[_0xce66('0x17')]('UpdateMailInteraction',_0x41c368);logger[_0xce66('0x10')](_0xce66('0x1a'),_0x41c368,JSON[_0xce66('0x12')](_0x532d80));_0x6ca85a(_0x532d80);})[_0xce66('0x19')](function(_0x2f6cc7){logger['error']('UpdateMailInteraction',_0x2f6cc7[_0xce66('0x16')],_0x41c368);_0x1d7ec8(_0x46122b[_0xce66('0x13')](0x1f4,_0x2f6cc7[_0xce66('0x16')]));});});};exports[_0xce66('0x20')]=function(_0xe4efeb){return new Promise(function(_0x2ff3c7,_0x57d9f7){return db[_0xce66('0x21')][_0xce66('0x22')]({'where':_0xe4efeb[_0xce66('0x1c')]?_0xe4efeb[_0xce66('0x1c')][_0xce66('0x1e')]||null:null})['then'](function(_0x34bc21){if(_0x34bc21){return _0x34bc21[_0xce66('0x23')](_0xe4efeb[_0xce66('0x1b')][_0xce66('0x24')],_['omit'](_0xe4efeb[_0xce66('0x1b')],[_0xce66('0x24'),'id'])||{});}})[_0xce66('0x25')](function(_0x11ad66){logger['info'](_0xce66('0x26'),_0xe4efeb);logger[_0xce66('0x10')](_0xce66('0x26'),_0xe4efeb,JSON[_0xce66('0x12')](_0x11ad66));_0x2ff3c7(_0x11ad66);})[_0xce66('0x19')](function(_0x3e5d11){logger[_0xce66('0x13')]('AddTags',_0x3e5d11['message'],_0xe4efeb);_0x57d9f7(_this[_0xce66('0x13')](0x1f4,_0x3e5d11[_0xce66('0x16')]));});});};
\ No newline at end of file
+var _0x4af3=['catch','UpdateMailInteraction','MailInteraction','update','body','options','where','attributes','limit','AddTagsToMailInteraction','omit','ids','spread','AddTags','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0xfbf89d,_0x47cb78){var _0x3da7c5=function(_0x1d659f){while(--_0x1d659f){_0xfbf89d['push'](_0xfbf89d['shift']());}};_0x3da7c5(++_0x47cb78);}(_0x4af3,0x118));var _0x34af=function(_0x33be73,_0x59d750){_0x33be73=_0x33be73-0x0;var _0x2d1f91=_0x4af3[_0x33be73];return _0x2d1f91;};'use strict';var _=require('lodash');var util=require(_0x34af('0x0'));var moment=require(_0x34af('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34af('0x2'))['db'];var utils=require(_0x34af('0x3'));var logger=require(_0x34af('0x4'))(_0x34af('0x5'));var config=require(_0x34af('0x6'));var jayson=require(_0x34af('0x7'));var client=jayson[_0x34af('0x8')]['http']({'port':0x232a});config[_0x34af('0x9')]=_[_0x34af('0xa')](config[_0x34af('0x9')],{'host':_0x34af('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x34af('0x9')]));require(_0x34af('0xc'))[_0x34af('0xd')](socket);function respondWithRpcPromise(_0x5c1767,_0x590ab0,_0x31754d){return new BPromise(function(_0x38a09d,_0x20477d){return client['request'](_0x5c1767,_0x31754d)[_0x34af('0xe')](function(_0x1ae071){logger[_0x34af('0xf')](_0x34af('0x10'),_0x590ab0,_0x34af('0x11'));logger[_0x34af('0x12')](_0x34af('0x13'),_0x590ab0,'request\x20sent',JSON[_0x34af('0x14')](_0x1ae071));if(_0x1ae071[_0x34af('0x15')]){if(_0x1ae071['error']['code']===0x1f4){logger[_0x34af('0x15')](_0x34af('0x10'),_0x590ab0,_0x1ae071[_0x34af('0x15')]['message']);return _0x20477d(_0x1ae071[_0x34af('0x15')][_0x34af('0x16')]);}logger[_0x34af('0x15')](_0x34af('0x10'),_0x590ab0,_0x1ae071['error'][_0x34af('0x16')]);return _0x38a09d(_0x1ae071[_0x34af('0x15')]['message']);}else{logger[_0x34af('0xf')]('MailInteraction,\x20%s,\x20%s',_0x590ab0,_0x34af('0x11'));_0x38a09d(_0x1ae071[_0x34af('0x17')]['message']);}})[_0x34af('0x18')](function(_0x3fe4e1){logger[_0x34af('0x15')](_0x34af('0x10'),_0x590ab0,_0x3fe4e1);_0x20477d(_0x3fe4e1);});});}exports[_0x34af('0x19')]=function(_0x238283){var _0x2afaca=this;return new Promise(function(_0x2580da,_0x3c8f40){return db[_0x34af('0x1a')][_0x34af('0x1b')](_0x238283[_0x34af('0x1c')],{'raw':_0x238283[_0x34af('0x1d')]?_0x238283[_0x34af('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x238283[_0x34af('0x1d')]?_0x238283[_0x34af('0x1d')][_0x34af('0x1e')]||null:null,'attributes':_0x238283['options']?_0x238283[_0x34af('0x1d')][_0x34af('0x1f')]||null:null,'limit':_0x238283[_0x34af('0x1d')]?_0x238283[_0x34af('0x1d')][_0x34af('0x20')]||null:null})[_0x34af('0xe')](function(_0x2fd2f1){logger[_0x34af('0xf')](_0x34af('0x19'),_0x238283);logger['debug']('UpdateMailInteraction',_0x238283,JSON['stringify'](_0x2fd2f1));_0x2580da(_0x2fd2f1);})['catch'](function(_0x8b2a6){logger[_0x34af('0x15')](_0x34af('0x19'),_0x8b2a6[_0x34af('0x16')],_0x238283);_0x3c8f40(_0x2afaca[_0x34af('0x15')](0x1f4,_0x8b2a6[_0x34af('0x16')]));});});};exports[_0x34af('0x21')]=function(_0x49f701){return new Promise(function(_0x2509fd,_0x53bbe1){return db['MailInteraction']['find']({'where':_0x49f701[_0x34af('0x1d')]?_0x49f701[_0x34af('0x1d')][_0x34af('0x1e')]||null:null})[_0x34af('0xe')](function(_0x9e230b){if(_0x9e230b){return _0x9e230b['addTags'](_0x49f701['body']['ids'],_[_0x34af('0x22')](_0x49f701[_0x34af('0x1c')],[_0x34af('0x23'),'id'])||{});}})[_0x34af('0x24')](function(_0x23c5e4){logger[_0x34af('0xf')]('AddTags',_0x49f701);logger['debug'](_0x34af('0x25'),_0x49f701,JSON['stringify'](_0x23c5e4));_0x2509fd(_0x23c5e4);})['catch'](function(_0x1f6469){logger[_0x34af('0x15')](_0x34af('0x25'),_0x1f6469[_0x34af('0x16')],_0x49f701);_0x53bbe1(_this[_0x34af('0x15')](0x1f4,_0x1f6469[_0x34af('0x16')]));});});};
\ No newline at end of file
index faa26b0..7341494 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc01f=['remove','emit','removeListener','length','mailInteraction:','./mailInteraction.events','save'];(function(_0x145064,_0x37be64){var _0x1b99a2=function(_0x157d81){while(--_0x157d81){_0x145064['push'](_0x145064['shift']());}};_0x1b99a2(++_0x37be64);}(_0xc01f,0x12b));var _0xfc01=function(_0x48b6ba,_0x284f0c){_0x48b6ba=_0x48b6ba-0x0;var _0x3bca2b=_0xc01f[_0x48b6ba];return _0x3bca2b;};'use strict';var MailInteractionEvents=require(_0xfc01('0x0'));var events=[_0xfc01('0x1'),_0xfc01('0x2'),'update'];function createListener(_0x2ad02d,_0x7c9e8b){return function(_0x398293){_0x7c9e8b[_0xfc01('0x3')](_0x2ad02d,_0x398293);};}function removeListener(_0x45e9e3,_0x5c349a){return function(){MailInteractionEvents[_0xfc01('0x4')](_0x45e9e3,_0x5c349a);};}exports['register']=function(_0x31993a){for(var _0x1bdd72=0x0,_0x139620=events[_0xfc01('0x5')];_0x1bdd72<_0x139620;_0x1bdd72++){var _0x44c79c=events[_0x1bdd72];var _0x494497=createListener(_0xfc01('0x6')+_0x44c79c,_0x31993a);MailInteractionEvents['on'](_0x44c79c,_0x494497);}};
\ No newline at end of file
+var _0x3f1c=['save','remove','update','emit','removeListener','register','length','./mailInteraction.events'];(function(_0x40c03b,_0x3de4fa){var _0x1e5319=function(_0x8a0f0){while(--_0x8a0f0){_0x40c03b['push'](_0x40c03b['shift']());}};_0x1e5319(++_0x3de4fa);}(_0x3f1c,0x137));var _0xc3f1=function(_0x11f2ec,_0x1c6718){_0x11f2ec=_0x11f2ec-0x0;var _0x1681a1=_0x3f1c[_0x11f2ec];return _0x1681a1;};'use strict';var MailInteractionEvents=require(_0xc3f1('0x0'));var events=[_0xc3f1('0x1'),_0xc3f1('0x2'),_0xc3f1('0x3')];function createListener(_0x2d4055,_0x3619c2){return function(_0x417190){_0x3619c2[_0xc3f1('0x4')](_0x2d4055,_0x417190);};}function removeListener(_0x3c3e1c,_0xbf5713){return function(){MailInteractionEvents[_0xc3f1('0x5')](_0x3c3e1c,_0xbf5713);};}exports[_0xc3f1('0x6')]=function(_0x248ae1){for(var _0x54cfd6=0x0,_0x77995a=events[_0xc3f1('0x7')];_0x54cfd6<_0x77995a;_0x54cfd6++){var _0x2c446f=events[_0x54cfd6];var _0x2b6736=createListener('mailInteraction:'+_0x2c446f,_0x248ae1);MailInteractionEvents['on'](_0x2c446f,_0x2b6736);}};
\ No newline at end of file
index fb5366a..6c96407 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf96=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','/describe','/:id','download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x729a18,_0x2c01b4){var _0x55550a=function(_0x5500c6){while(--_0x5500c6){_0x729a18['push'](_0x729a18['shift']());}};_0x55550a(++_0x2c01b4);}(_0xdf96,0xfc));var _0x6df9=function(_0x587722,_0x382c3e){_0x587722=_0x587722-0x0;var _0x230468=_0xdf96[_0x587722];return _0x230468;};'use strict';var multer=require(_0x6df9('0x0'));var util=require(_0x6df9('0x1'));var path=require('path');var timeout=require(_0x6df9('0x2'));var express=require(_0x6df9('0x3'));var router=express['Router']();var fs_extra=require(_0x6df9('0x4'));var auth=require(_0x6df9('0x5'));var interaction=require(_0x6df9('0x6'));var config=require('../../config/environment');var controller=require(_0x6df9('0x7'));router[_0x6df9('0x8')]('/',auth[_0x6df9('0x9')](),controller[_0x6df9('0xa')]);router['get'](_0x6df9('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x6df9('0x8')](_0x6df9('0xc'),auth[_0x6df9('0x9')](),controller['show']);router[_0x6df9('0x8')]('/:id/download',auth[_0x6df9('0x9')](),controller[_0x6df9('0xd')]);router[_0x6df9('0xe')]('/',auth[_0x6df9('0x9')](),interaction[_0x6df9('0xf')](_0x6df9('0x10'),_0x6df9('0x11')),controller[_0x6df9('0x12')]);router[_0x6df9('0x13')]('/:id',auth[_0x6df9('0x9')](),controller[_0x6df9('0x14')]);router[_0x6df9('0x13')](_0x6df9('0x15'),auth[_0x6df9('0x9')](),controller[_0x6df9('0x16')]);router[_0x6df9('0x13')](_0x6df9('0x17'),auth[_0x6df9('0x9')](),controller[_0x6df9('0x18')]);router[_0x6df9('0x19')]('/:id',auth[_0x6df9('0x9')](),controller[_0x6df9('0x1a')]);module[_0x6df9('0x1b')]=router;
\ No newline at end of file
+var _0x038d=['isAuthenticated','show','/:id/download','post','mail','mailmessage:create','create','/:id','update','/:id/accept','accept','reject','delete','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','/describe','describe'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x038d,0xae));var _0xd038=function(_0x37ec88,_0x12de25){_0x37ec88=_0x37ec88-0x0;var _0x25407c=_0x038d[_0x37ec88];return _0x25407c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd038('0x0'));var timeout=require(_0xd038('0x1'));var express=require(_0xd038('0x2'));var router=express[_0xd038('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd038('0x4'));var config=require(_0xd038('0x5'));var controller=require(_0xd038('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xd038('0x7')](_0xd038('0x8'),auth['isAuthenticated'](),controller[_0xd038('0x9')]);router[_0xd038('0x7')]('/:id',auth[_0xd038('0xa')](),controller[_0xd038('0xb')]);router[_0xd038('0x7')](_0xd038('0xc'),auth['isAuthenticated'](),controller['download']);router[_0xd038('0xd')]('/',auth[_0xd038('0xa')](),interaction['tracked'](_0xd038('0xe'),_0xd038('0xf')),controller[_0xd038('0x10')]);router['put'](_0xd038('0x11'),auth[_0xd038('0xa')](),controller[_0xd038('0x12')]);router['put'](_0xd038('0x13'),auth[_0xd038('0xa')](),controller[_0xd038('0x14')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0xd038('0x15')]);router[_0xd038('0x16')]('/:id',auth[_0xd038('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 7f356d6..a82272d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb435=['DATE','INTEGER','long','ENUM','Email','sequelize','lodash','exports','TEXT','BOOLEAN','out','STRING'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xb435,0x1d9));var _0x5b43=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb435[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x5b43('0x0'));var _=require(_0x5b43('0x1'));module[_0x5b43('0x2')]={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5b43('0x3')]('medium')},'read':{'type':Sequelize[_0x5b43('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5b43('0x5')),'defaultValue':_0x5b43('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5b43('0x6')](0x1fe)},'from':{'type':Sequelize[_0x5b43('0x6')]},'to':{'type':Sequelize[_0x5b43('0x3')]('long')},'cc':{'type':Sequelize[_0x5b43('0x3')]('long')},'bcc':{'type':Sequelize[_0x5b43('0x3')]('long')},'subject':{'type':Sequelize[_0x5b43('0x3')]},'sentAt':{'type':Sequelize[_0x5b43('0x7')]},'attach':{'type':Sequelize[_0x5b43('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x5b43('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x5b43('0x3')](_0x5b43('0x9'))},'originCc':{'type':Sequelize[_0x5b43('0x3')](_0x5b43('0x9'))},'originChannel':{'type':Sequelize[_0x5b43('0xa')](_0x5b43('0xb'),'Chat'),'defaultValue':_0x5b43('0xb'),'allowNull':![]}};
\ No newline at end of file
+var _0x8c7d=['INTEGER','DATE','Email','Chat','sequelize','exports','long','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x545f6d,_0x5e71f6){var _0x129f0c=function(_0x4663aa){while(--_0x4663aa){_0x545f6d['push'](_0x545f6d['shift']());}};_0x129f0c(++_0x5e71f6);}(_0x8c7d,0xe1));var _0xd8c7=function(_0x384f8c,_0x1a3c03){_0x384f8c=_0x384f8c-0x0;var _0x4475f0=_0x8c7d[_0x384f8c];return _0x4475f0;};'use strict';var Sequelize=require(_0xd8c7('0x0'));var _=require('lodash');module[_0xd8c7('0x1')]={'body':{'type':Sequelize['TEXT'](_0xd8c7('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xd8c7('0x3')](_0xd8c7('0x4'))},'read':{'type':Sequelize[_0xd8c7('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd8c7('0x6')]('in',_0xd8c7('0x7')),'defaultValue':_0xd8c7('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0xd8c7('0x8')](0x1fe)},'from':{'type':Sequelize[_0xd8c7('0x8')]},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize[_0xd8c7('0x3')](_0xd8c7('0x2'))},'bcc':{'type':Sequelize['TEXT'](_0xd8c7('0x2'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0xd8c7('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xd8c7('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xd8c7('0xa')]},'originTo':{'type':Sequelize[_0xd8c7('0x3')]('long')},'originCc':{'type':Sequelize[_0xd8c7('0x3')]('long')},'originChannel':{'type':Sequelize[_0xd8c7('0x6')](_0xd8c7('0xb'),_0xd8c7('0xc')),'defaultValue':'Email','allowNull':![]}};
\ No newline at end of file
index 43cf96c..cbc7195 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40a3=['find','update','body','destroy','create','secret','findOne','CmList','List','CmContact','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','length','join','root','server/files/attachments','basename','Contacts','ListId','List\x20not\x20found','sendMail','messageId','accept','mail','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','MailInteraction','MailInteractionId','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','User','agent','email','manual','interface','SIP/%s','channel','motionChannel','fromString','EventManager','acceptmessage','reject','rejectMessage','ContactId','QueryTypes','fullname','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','bcc','subject','createdAt','Attachment','Attachments','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','existsSync','push','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','html-entities','./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','status','json','offset','undefined','limit','count','set','Content-Range','end','stack','name','send','index','map','MailMessage','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','options','includeAll','include','findAll','params','merge'];(function(_0x4e7b37,_0x33b1fa){var _0x20b707=function(_0x1fb9ff){while(--_0x1fb9ff){_0x4e7b37['push'](_0x4e7b37['shift']());}};_0x20b707(++_0x33b1fa);}(_0x40a3,0xed));var _0x340a=function(_0x37ea17,_0x58c122){_0x37ea17=_0x37ea17-0x0;var _0x4c6387=_0x40a3[_0x37ea17];return _0x4c6387;};'use strict';var emlformat=require(_0x340a('0x0'));var moment=require(_0x340a('0x1'));var BPromise=require(_0x340a('0x2'));var util=require(_0x340a('0x3'));var path=require(_0x340a('0x4'));var fs=require('fs');var _=require(_0x340a('0x5'));var Redis=require(_0x340a('0x6'));var htmlToText=require(_0x340a('0x7'));var qs=require(_0x340a('0x8'));var logger=require(_0x340a('0x9'))(_0x340a('0xa'));var interaction_log=require('../../config/logger')('mail-interactions');var config=require(_0x340a('0xb'));var db=require(_0x340a('0xc'))['db'];config[_0x340a('0xd')]=_[_0x340a('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x340a('0xf'))(new Redis(config[_0x340a('0xd')]));var htmlEntities=require(_0x340a('0x10'));require(_0x340a('0x11'))[_0x340a('0x12')](socket);var jayson=require(_0x340a('0x13'));var client=jayson[_0x340a('0x14')][_0x340a('0x15')]({'port':0x232c});var client9003=jayson[_0x340a('0x14')][_0x340a('0x15')]({'port':0x232b});var client9002=jayson[_0x340a('0x14')][_0x340a('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x3932df,_0x1bac40,_0x5137fd,_0x59e9b0){return new BPromise(function(_0x2cd908,_0x5abdc1){var _0x5308ab=_0x59e9b0||client;return _0x5308ab['request'](_0x3932df,_0x5137fd)[_0x340a('0x16')](function(_0x1b3981){logger[_0x340a('0x17')](_0x340a('0x18'),_0x1bac40,_0x340a('0x19'));logger[_0x340a('0x1a')](_0x340a('0x1b'),_0x1bac40,_0x340a('0x19'),JSON[_0x340a('0x1c')](_0x1b3981));if(_0x1b3981[_0x340a('0x1d')]){if(_0x1b3981[_0x340a('0x1d')]['code']===0x1f4){logger[_0x340a('0x1d')](_0x340a('0x18'),_0x1bac40,_0x1b3981[_0x340a('0x1d')][_0x340a('0x1e')]);return _0x5abdc1(_0x1b3981['error'][_0x340a('0x1e')]);}logger[_0x340a('0x1d')](_0x340a('0x18'),_0x1bac40,_0x1b3981['error'][_0x340a('0x1e')]);return _0x2cd908(_0x1b3981[_0x340a('0x1d')][_0x340a('0x1e')]);}else{logger[_0x340a('0x17')]('MailMessage,\x20%s,\x20%s',_0x1bac40,_0x340a('0x19'));_0x2cd908(_0x1b3981[_0x340a('0x1f')]['message']);}})[_0x340a('0x20')](function(_0x4384ea){logger[_0x340a('0x1d')](_0x340a('0x18'),_0x1bac40,_0x4384ea);_0x5abdc1(_0x4384ea);});});}function respondWithResult(_0x457a94,_0x256a8c){_0x256a8c=_0x256a8c||0xc8;return function(_0x4687aa){if(_0x4687aa){return _0x457a94[_0x340a('0x21')](_0x256a8c)[_0x340a('0x22')](_0x4687aa);}};}function respondWithFilteredResult(_0x34fca7,_0x566460){return function(_0xe46630){if(_0xe46630){var _0x3cf70b=typeof _0x566460[_0x340a('0x23')]===_0x340a('0x24')&&typeof _0x566460[_0x340a('0x25')]===_0x340a('0x24');var _0x4867c0=_0xe46630[_0x340a('0x26')];var _0xa05ee5=_0x3cf70b?0x0:_0x566460['offset'];var _0x92b959=_0x3cf70b?_0xe46630['count']:_0x566460[_0x340a('0x23')]+_0x566460[_0x340a('0x25')];var _0x40fa6f;if(_0x92b959>=_0x4867c0){_0x92b959=_0x4867c0;_0x40fa6f=0xc8;}else{_0x40fa6f=0xce;}_0x34fca7[_0x340a('0x21')](_0x40fa6f);return _0x34fca7[_0x340a('0x27')](_0x340a('0x28'),_0xa05ee5+'-'+_0x92b959+'/'+_0x4867c0)[_0x340a('0x22')](_0xe46630);}return null;};}function saveUpdates(_0x39e67a){return function(_0x48ced8){if(_0x48ced8){return _0x48ced8['update'](_0x39e67a)['then'](function(_0x1340b3){return _0x1340b3;});}return null;};}function removeEntity(_0x42007e){return function(_0x21b057){if(_0x21b057){return _0x21b057['destroy']()['then'](function(){_0x42007e[_0x340a('0x21')](0xcc)[_0x340a('0x29')]();});}};}function handleEntityNotFound(_0x3a9119){return function(_0x4a0da5){if(!_0x4a0da5){_0x3a9119['sendStatus'](0x194);}return _0x4a0da5;};}function handleError(_0x3cee27,_0x50f969){_0x50f969=_0x50f969||0x1f4;return function(_0x23f0f2){logger[_0x340a('0x1d')](_0x23f0f2[_0x340a('0x2a')]);if(_0x23f0f2[_0x340a('0x2b')]){delete _0x23f0f2[_0x340a('0x2b')];}_0x3cee27[_0x340a('0x21')](_0x50f969)[_0x340a('0x2c')](_0x23f0f2);};}exports[_0x340a('0x2d')]=function(_0x573f28,_0x425baf){var _0x29c2ca={},_0x21a37e={},_0x195dca={'count':0x0,'rows':[]};var _0x202d24=_[_0x340a('0x2e')](db[_0x340a('0x2f')][_0x340a('0x30')],function(_0x52c4e8){return{'name':_0x52c4e8['fieldName'],'type':_0x52c4e8[_0x340a('0x31')][_0x340a('0x32')]};});_0x21a37e[_0x340a('0x33')]=_[_0x340a('0x2e')](_0x202d24,_0x340a('0x2b'));_0x21a37e[_0x340a('0x34')]=_[_0x340a('0x35')](_0x573f28[_0x340a('0x34')]);_0x21a37e[_0x340a('0x36')]=_[_0x340a('0x37')](_0x21a37e[_0x340a('0x33')],_0x21a37e[_0x340a('0x34')]);_0x29c2ca['attributes']=_[_0x340a('0x37')](_0x21a37e['model'],qs[_0x340a('0x38')](_0x573f28[_0x340a('0x34')]['fields']));_0x29c2ca['attributes']=_0x29c2ca['attributes']['length']?_0x29c2ca[_0x340a('0x39')]:_0x21a37e[_0x340a('0x33')];if(!_0x573f28[_0x340a('0x34')][_0x340a('0x3a')](_0x340a('0x3b'))){_0x29c2ca[_0x340a('0x25')]=qs[_0x340a('0x25')](_0x573f28['query'][_0x340a('0x25')]);_0x29c2ca[_0x340a('0x23')]=qs[_0x340a('0x23')](_0x573f28[_0x340a('0x34')][_0x340a('0x23')]);}_0x29c2ca['order']=qs['sort'](_0x573f28[_0x340a('0x34')][_0x340a('0x3c')]);_0x29c2ca[_0x340a('0x3d')]=qs[_0x340a('0x36')](_['pick'](_0x573f28[_0x340a('0x34')],_0x21a37e[_0x340a('0x36')]),_0x202d24);if(_0x573f28[_0x340a('0x34')][_0x340a('0x3e')]){_0x29c2ca[_0x340a('0x3d')]=_['merge'](_0x29c2ca['where'],{'$or':_[_0x340a('0x2e')](_0x202d24,function(_0x337801){if(_0x337801[_0x340a('0x31')]!=='VIRTUAL'){var _0x46b6da={};_0x46b6da[_0x337801[_0x340a('0x2b')]]={'$like':'%'+_0x573f28[_0x340a('0x34')][_0x340a('0x3e')]+'%'};return _0x46b6da;}})});}_0x29c2ca=_['merge']({},_0x29c2ca,_0x573f28[_0x340a('0x3f')]);var _0x42c464={'where':_0x29c2ca[_0x340a('0x3d')]};return db[_0x340a('0x2f')][_0x340a('0x26')](_0x42c464)['then'](function(_0x63606c){_0x195dca[_0x340a('0x26')]=_0x63606c;if(_0x573f28[_0x340a('0x34')][_0x340a('0x40')]){_0x29c2ca[_0x340a('0x41')]=[{'all':!![]}];}return db['MailMessage'][_0x340a('0x42')](_0x29c2ca);})[_0x340a('0x16')](function(_0x49ed06){_0x195dca['rows']=_0x49ed06;return _0x195dca;})['then'](respondWithFilteredResult(_0x425baf,_0x29c2ca))[_0x340a('0x20')](handleError(_0x425baf,null));};exports['show']=function(_0xde03a1,_0x324546){var _0x3bf6df={'raw':!![],'where':{'id':_0xde03a1[_0x340a('0x43')]['id']}},_0x56f0bb={};_0x56f0bb[_0x340a('0x33')]=_[_0x340a('0x35')](db['MailMessage'][_0x340a('0x30')]);_0x56f0bb[_0x340a('0x34')]=_[_0x340a('0x35')](_0xde03a1[_0x340a('0x34')]);_0x56f0bb[_0x340a('0x36')]=_[_0x340a('0x37')](_0x56f0bb['model'],_0x56f0bb[_0x340a('0x34')]);_0x3bf6df[_0x340a('0x39')]=_[_0x340a('0x37')](_0x56f0bb[_0x340a('0x33')],qs[_0x340a('0x38')](_0xde03a1[_0x340a('0x34')][_0x340a('0x38')]));_0x3bf6df[_0x340a('0x39')]=_0x3bf6df['attributes']['length']?_0x3bf6df['attributes']:_0x56f0bb[_0x340a('0x33')];if(_0xde03a1['query'][_0x340a('0x40')]){_0x3bf6df['include']=[{'all':!![]}];}_0x3bf6df=_[_0x340a('0x44')]({},_0x3bf6df,_0xde03a1[_0x340a('0x3f')]);return db['MailMessage'][_0x340a('0x45')](_0x3bf6df)[_0x340a('0x16')](handleEntityNotFound(_0x324546,null))[_0x340a('0x16')](respondWithResult(_0x324546,null))['catch'](handleError(_0x324546,null));};exports[_0x340a('0x46')]=function(_0x58546b,_0x2224ef){if(_0x58546b['body']['id']){delete _0x58546b[_0x340a('0x47')]['id'];}return db[_0x340a('0x2f')][_0x340a('0x45')]({'where':{'id':_0x58546b['params']['id']}})['then'](handleEntityNotFound(_0x2224ef,null))['then'](saveUpdates(_0x58546b['body'],null))[_0x340a('0x16')](respondWithResult(_0x2224ef,null))['catch'](handleError(_0x2224ef,null));};exports[_0x340a('0x48')]=function(_0x164afd,_0x5bd318){return db[_0x340a('0x2f')]['find']({'where':{'id':_0x164afd[_0x340a('0x43')]['id']}})['then'](handleEntityNotFound(_0x5bd318,null))[_0x340a('0x16')](removeEntity(_0x5bd318,null))[_0x340a('0x20')](handleError(_0x5bd318,null));};exports['describe']=function(_0x40e6aa,_0x558b17){return db['MailMessage']['describe']()[_0x340a('0x16')](respondWithResult(_0x558b17,null))[_0x340a('0x20')](handleError(_0x558b17,null));};exports['create']=function(_0x42b02c,_0x508441){return db['MailMessage'][_0x340a('0x49')](_0x42b02c[_0x340a('0x47')])[_0x340a('0x16')](function(_0x6a0b77){if(_0x6a0b77){if(_0x6a0b77['direction']==='out'&&!_0x6a0b77[_0x340a('0x4a')]){var _0x528e97,_0x8f1319,_0x2daa53;if(_0x42b02c[_0x340a('0x47')]['to']){_0x8f1319=_0x42b02c[_0x340a('0x47')]['to']['split'](',')[0x0];}return db['MailAccount'][_0x340a('0x4b')]({'where':{'id':_0x6a0b77['MailAccountId']},'include':[{'model':db[_0x340a('0x4c')],'as':_0x340a('0x4d'),'include':[{'model':db[_0x340a('0x4e')],'as':'Contacts','where':{'email':_0x8f1319},'limit':0x1,'order':[['updatedAt',_0x340a('0x4f')]]}]},{'model':db[_0x340a('0x50')],'as':_0x340a('0x51'),'raw':!![],'include':[{'model':db[_0x340a('0x52')],'as':_0x340a('0x52'),'raw':!![]}]}]})[_0x340a('0x16')](function(_0x31d0a3){_0x528e97=_0x31d0a3;if(!_0x528e97||!_0x528e97[_0x340a('0x51')])return;var _0x31cd9f=_0x528e97[_0x340a('0x53')]();if(_0x42b02c[_0x340a('0x47')][_0x340a('0x54')]&&_0x42b02c[_0x340a('0x47')]['attachments'][_0x340a('0x55')]){for(var _0x45656c=0x0;_0x45656c<_0x42b02c[_0x340a('0x47')][_0x340a('0x54')][_0x340a('0x55')];_0x45656c+=0x1){_0x42b02c[_0x340a('0x47')][_0x340a('0x54')][_0x45656c]={'filename':_0x42b02c[_0x340a('0x47')][_0x340a('0x54')][_0x45656c][_0x340a('0x2b')],'path':path[_0x340a('0x56')](config[_0x340a('0x57')],_0x340a('0x58'),_0x42b02c[_0x340a('0x47')]['attachments'][_0x45656c][_0x340a('0x59')])};}}_0x2daa53={'account':_0x31cd9f,'message':_0x42b02c['body']};return;})[_0x340a('0x16')](function(){if(_0x528e97[_0x340a('0x4d')]){if(_0x528e97[_0x340a('0x4d')][_0x340a('0x5a')]['length']){return _0x528e97[_0x340a('0x4d')][_0x340a('0x5a')][0x0];}else{return db['CmContact'][_0x340a('0x49')](_['defaults'](_0x42b02c[_0x340a('0x47')],{'firstName':_0x42b02c[_0x340a('0x47')]['to'],'email':_0x42b02c['body']['to'],'phone':_0x42b02c['body']['to'],'ListId':_0x528e97[_0x340a('0x5b')]}));}}else{throw new Error(_0x340a('0x5c'));}})[_0x340a('0x16')](function(){if(_0x2daa53){return respondWithRpcPromise('SendMail',_0x340a('0x5d'),_0x2daa53,client9003)[_0x340a('0x16')](function(_0x2fcc70){return _0x6a0b77[_0x340a('0x46')]({'read':!![],'messageId':_0x2fcc70[_0x340a('0x5e')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x340a('0x20')](function(_0x796772){logger[_0x340a('0x1d')]('%s',JSON[_0x340a('0x1c')](_0x796772));return _0x6a0b77;});}return _0x6a0b77;});}return _0x6a0b77;}})[_0x340a('0x16')](respondWithResult(_0x508441,0xc9))[_0x340a('0x20')](handleError(_0x508441,null));};exports[_0x340a('0x5f')]=function(_0x118f57,_0x926052){var _0x5144d5={'agent':{},'channel':_0x340a('0x60')};if(_0x118f57[_0x340a('0x47')]['id']){delete _0x118f57['body']['id'];}_0x118f57[_0x340a('0x47')]['read']=!![];_0x118f57['body'][_0x340a('0x61')]=moment()[_0x340a('0x62')](_0x340a('0x63'));_0x118f57[_0x340a('0x47')][_0x340a('0x64')]=_0x118f57[_0x340a('0x47')][_0x340a('0x64')]||_0x118f57[_0x340a('0x65')]['id'];_0x5144d5['agent']['id']=_0x118f57[_0x340a('0x47')][_0x340a('0x64')];return db[_0x340a('0x2f')][_0x340a('0x45')]({'where':{'id':_0x118f57[_0x340a('0x43')]['id'],'UserId':null}})[_0x340a('0x16')](handleEntityNotFound(_0x926052,null))[_0x340a('0x16')](saveUpdates(_0x118f57[_0x340a('0x47')],null))['then'](function(_0x503b6b){if(_0x503b6b){_0x5144d5['message']=_0x503b6b['get']({'plain':!![]});return db[_0x340a('0x66')][_0x340a('0x45')]({'where':{'id':_0x503b6b[_0x340a('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x926052,null))[_0x340a('0x16')](function(_0x51a7a4){if(_0x51a7a4){return _0x51a7a4[_0x340a('0x46')]({'UserId':_0x118f57[_0x340a('0x47')]['UserId'],'read1stAt':_['isNil'](_0x51a7a4['read1stAt'])?moment()[_0x340a('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x340a('0x16')](function(_0x23def0){if(_0x23def0){_0x5144d5[_0x340a('0x68')]=_0x23def0[_0x340a('0x69')]({'plain':!![]});interaction_log[_0x340a('0x17')](_0x340a('0x6a'),_0x118f57['user']['id'],_0x118f57[_0x340a('0x65')][_0x340a('0x2b')],_0x118f57[_0x340a('0x65')][_0x340a('0x6b')],_0x5144d5[_0x340a('0x68')]['id'],_0x118f57[_0x340a('0x47')]?JSON['stringify'](_0x118f57[_0x340a('0x47')]):_0x340a('0x6c'));return respondWithRpcPromise(_0x340a('0x6d'),_0x340a('0x6e'),_0x5144d5);}return null;})['then'](function(_0x10de44){var _0x10ae69=_0x340a('0x6f')+_0x10de44[_0x340a('0x1e')]['ContactId'];return db[_0x340a('0x70')][_0x340a('0x34')](_0x10ae69,{'type':db[_0x340a('0x71')]['QueryTypes'][_0x340a('0x72')],'raw':!![]})[_0x340a('0x16')](function(_0x5d2162){return _0x5d2162;});})['then'](function(_0xd208a8){if(_0xd208a8){_0x5144d5[_0x340a('0x1e')]['contact']=_0xd208a8[0x0];if(!_0x118f57[_0x340a('0x47')][_0x340a('0x64')])return;return db[_0x340a('0x73')][_0x340a('0x45')]({'where':{'id':_0x118f57['body'][_0x340a('0x64')],'role':_0x340a('0x74')},'attributes':['id',_0x340a('0x2b'),'fullname',_0x340a('0x75'),'internal'],'raw':!![]});}return null;})[_0x340a('0x16')](function(_0x29b10e){if(!_0x29b10e)return null;_0x5144d5[_0x340a('0x1e')][_0x340a('0x74')]=_0x29b10e;return _0x5144d5;})['then'](function(_0x5e77d7){if(_0x5e77d7){if(_0x118f57['body'][_0x340a('0x76')]){_0x5144d5['message'][_0x340a('0x77')]=util['format'](_0x340a('0x78'),_0x118f57[_0x340a('0x65')][_0x340a('0x2b')]);_0x5144d5['message'][_0x340a('0x79')]=_0x5144d5['channel'];_0x5144d5['message'][_0x340a('0x7a')]=_0x5144d5['channel'];_0x5144d5[_0x340a('0x1e')]['event']='accept';_0x5144d5[_0x340a('0x1e')][_0x340a('0x47')]=htmlToText[_0x340a('0x7b')](_0x5144d5[_0x340a('0x1e')][_0x340a('0x47')]);return respondWithRpcPromise(_0x340a('0x7c'),_0x340a('0x7c'),{'event':_0x340a('0x7d'),'message':_0x5144d5[_0x340a('0x1e')]},client9002)[_0x340a('0x16')](function(){return _0x5144d5;});}return _0x5144d5;}return null;})[_0x340a('0x16')](respondWithResult(_0x926052,null))[_0x340a('0x20')](handleError(_0x926052,null));};exports[_0x340a('0x7e')]=function(_0x17eca7,_0x2852b4){var _0x36d959={'agent':{},'channel':_0x340a('0x60')};if(_0x17eca7[_0x340a('0x47')]['id']){delete _0x17eca7[_0x340a('0x47')]['id'];}_0x17eca7['body'][_0x340a('0x64')]=_0x17eca7[_0x340a('0x47')][_0x340a('0x64')]||_0x17eca7[_0x340a('0x65')]['id'];_0x36d959[_0x340a('0x74')]['id']=_0x17eca7[_0x340a('0x47')][_0x340a('0x64')];return db['MailMessage'][_0x340a('0x45')]({'where':{'id':_0x17eca7['params']['id'],'UserId':null}})[_0x340a('0x16')](handleEntityNotFound(_0x2852b4,null))['then'](function(_0x120bb6){if(_0x120bb6){_0x36d959[_0x340a('0x1e')]=_0x120bb6['get']({'plain':!![]});return db[_0x340a('0x66')][_0x340a('0x45')]({'where':{'id':_0x120bb6[_0x340a('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x2852b4,null))[_0x340a('0x16')](function(_0xd2229f){if(_0xd2229f){_0x36d959[_0x340a('0x68')]=_0xd2229f[_0x340a('0x69')]({'plain':!![]});interaction_log[_0x340a('0x17')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x17eca7[_0x340a('0x65')]['id'],_0x17eca7['user'][_0x340a('0x2b')],_0x17eca7['user'][_0x340a('0x6b')],_0x36d959[_0x340a('0x68')]['id'],_0x17eca7[_0x340a('0x47')]?JSON[_0x340a('0x1c')](_0x17eca7[_0x340a('0x47')]):_0x340a('0x6c'));return respondWithRpcPromise('RejectMessage',_0x340a('0x7f'),_0x36d959);}return null;})[_0x340a('0x16')](function(_0x500374){var _0x26a30a=_0x340a('0x6f')+_0x500374[_0x340a('0x1e')][_0x340a('0x80')];return db[_0x340a('0x70')][_0x340a('0x34')](_0x26a30a,{'type':db[_0x340a('0x71')][_0x340a('0x81')][_0x340a('0x72')],'raw':!![]})[_0x340a('0x16')](function(_0x4b414a){return _0x4b414a;});})[_0x340a('0x16')](function(_0x38edb7){if(_0x38edb7){_0x36d959[_0x340a('0x1e')]['contact']=_0x38edb7[0x0];if(!_0x17eca7['body'][_0x340a('0x64')])return;return db[_0x340a('0x73')][_0x340a('0x45')]({'where':{'id':_0x17eca7[_0x340a('0x47')][_0x340a('0x64')],'role':'agent'},'attributes':['id','name',_0x340a('0x82'),_0x340a('0x75'),'internal'],'raw':!![]});}return null;})[_0x340a('0x16')](function(_0x33ddeb){if(!_0x33ddeb)return null;_0x36d959[_0x340a('0x1e')][_0x340a('0x74')]=_0x33ddeb;return _0x36d959;})['then'](function(_0x3504bb){if(_0x3504bb){_0x3504bb[_0x340a('0x1e')]['interface']=util[_0x340a('0x62')](_0x340a('0x78'),_0x17eca7[_0x340a('0x65')][_0x340a('0x2b')]);_0x3504bb[_0x340a('0x1e')][_0x340a('0x79')]=_0x36d959[_0x340a('0x79')];_0x3504bb[_0x340a('0x1e')]['motionChannel']=_0x36d959[_0x340a('0x79')];_0x3504bb[_0x340a('0x1e')]['event']=_0x340a('0x7e');_0x3504bb[_0x340a('0x1e')]['body']=htmlToText[_0x340a('0x7b')](_0x36d959['message'][_0x340a('0x47')]);respondWithRpcPromise(_0x340a('0x7c'),'EventManager',{'event':_0x340a('0x83'),'message':_0x3504bb[_0x340a('0x1e')]},client9002);return _0x36d959;}return null;})[_0x340a('0x16')](respondWithResult(_0x2852b4,null))[_0x340a('0x20')](handleError(_0x2852b4,null));};exports[_0x340a('0x84')]=function(_0x12450e,_0x2eac5f){var _0x25e96b=moment()[_0x340a('0x85')]()[_0x340a('0x86')]();var _0x44052e=path[_0x340a('0x56')](config['root'],_0x340a('0x87'),_0x340a('0x88'),_0x340a('0x89'));var _0x364607=path['join'](config[_0x340a('0x57')],_0x340a('0x87'),_0x340a('0x88'),_0x340a('0x54'));var _0x53d2a5=util[_0x340a('0x62')](_0x340a('0x8a'),_0x25e96b);return db['MailMessage'][_0x340a('0x45')]({'where':{'id':_0x12450e[_0x340a('0x43')]['id']},'attributes':['id',_0x340a('0x47'),'from','to','cc',_0x340a('0x8b'),_0x340a('0x8c'),_0x340a('0x8d')],'include':_0x12450e[_0x340a('0x34')]['attachments']?[{'model':db[_0x340a('0x8e')],'as':_0x340a('0x8f')}]:undefined})['then'](handleEntityNotFound(_0x2eac5f,null))['then'](function(_0x3fb54a){if(_0x3fb54a){var _0x45bda9=_0x3fb54a;var _0x5c7664={'from':_0x45bda9[_0x340a('0x90')],'to':_0x45bda9['to'],'subject':_0x45bda9['subject'],'html':htmlEntities[_0x340a('0x91')](_0x45bda9['body']),'headers':{'Date':moment(_0x45bda9[_0x340a('0x8d')])[_0x340a('0x62')](_0x340a('0x92'))},'attachments':[]};if(_0x3fb54a['cc']){_0x5c7664[_0x340a('0x93')]['Cc']=_0x3fb54a['cc'];}if(_0x3fb54a[_0x340a('0x8b')]){_0x5c7664[_0x340a('0x93')]['Bcc']=_0x3fb54a[_0x340a('0x8b')];}return new BPromise(function(_0x4991f1,_0x2debc4){if(_0x3fb54a[_0x340a('0x8f')]){for(var _0x447d1a=0x0;_0x447d1a<_0x3fb54a['Attachments'][_0x340a('0x55')];_0x447d1a++){var _0x4ff6b1=_0x3fb54a[_0x340a('0x8f')][_0x447d1a];var _0x32a649=path[_0x340a('0x56')](_0x364607,_0x4ff6b1[_0x340a('0x59')]);if(fs[_0x340a('0x94')](_0x32a649)){_0x5c7664[_0x340a('0x54')][_0x340a('0x95')]({'name':_0x4ff6b1[_0x340a('0x2b')],'contentType':_0x4ff6b1[_0x340a('0x31')],'data':fs['readFileSync'](_0x32a649)});}}}emlformat[_0x340a('0x96')](_0x5c7664,function(_0x4c639d,_0x550e61){if(_0x4c639d)return _0x2debc4(_0x4c639d);fs[_0x340a('0x97')](path[_0x340a('0x56')](_0x44052e,_0x53d2a5),_0x550e61);return _0x4991f1(_0x550e61);});});}})[_0x340a('0x16')](function(_0x38259b){if(_0x38259b){return _0x2eac5f[_0x340a('0x84')](path[_0x340a('0x56')](_0x44052e,_0x53d2a5),_0x53d2a5,function(_0xecf0fb){if(!_0xecf0fb)fs[_0x340a('0x98')](path[_0x340a('0x56')](_0x44052e,_0x53d2a5));});}})['catch'](handleError(_0x2eac5f,null));};
\ No newline at end of file
+var _0x99db=['split','MailAccount','findOne','MailAccountId','CmList','CmContact','Contacts','updatedAt','MailServerOut','Smtp','getSmtpOptions','attachments','join','root','server/files/attachments','basename','List','ListId','List\x20not\x20found','SendMail','messageId','format','accept','mail','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','MailInteractionId','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','email','internal','interface','channel','motionChannel','event','EventManager','acceptmessage','reject','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','fullname','SIP/%s','fromString','download','unix','toString','server','files','bcc','Attachment','Attachments','from','subject','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','writeFileSync','eml-format','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','api','mail-interactions','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','html-entities','register','jayson/promise','http','client','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','status','json','offset','undefined','limit','count','set','update','destroy','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','merge','filter','options','includeAll','include','findAll','rows','show','find','body','params','describe','create','direction','secret'];(function(_0x446d57,_0x4c2cc4){var _0x2578b3=function(_0x4c233e){while(--_0x4c233e){_0x446d57['push'](_0x446d57['shift']());}};_0x2578b3(++_0x4c2cc4);}(_0x99db,0x18f));var _0xb99d=function(_0x31a37b,_0x826249){_0x31a37b=_0x31a37b-0x0;var _0x49ae16=_0x99db[_0x31a37b];return _0x49ae16;};'use strict';var emlformat=require(_0xb99d('0x0'));var moment=require('moment');var BPromise=require(_0xb99d('0x1'));var util=require('util');var path=require(_0xb99d('0x2'));var fs=require('fs');var _=require(_0xb99d('0x3'));var Redis=require(_0xb99d('0x4'));var htmlToText=require(_0xb99d('0x5'));var qs=require(_0xb99d('0x6'));var logger=require('../../config/logger')(_0xb99d('0x7'));var interaction_log=require('../../config/logger')(_0xb99d('0x8'));var config=require(_0xb99d('0x9'));var db=require(_0xb99d('0xa'))['db'];config['redis']=_[_0xb99d('0xb')](config['redis'],{'host':_0xb99d('0xc'),'port':0x18eb});var socket=require(_0xb99d('0xd'))(new Redis(config['redis']));var htmlEntities=require(_0xb99d('0xe'));require('./mailMessage.socket')[_0xb99d('0xf')](socket);var jayson=require(_0xb99d('0x10'));var client=jayson['client'][_0xb99d('0x11')]({'port':0x232c});var client9003=jayson[_0xb99d('0x12')][_0xb99d('0x11')]({'port':0x232b});var client9002=jayson[_0xb99d('0x12')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c6aef,_0x2a0870,_0x3e5e91,_0x369682){return new BPromise(function(_0x449cdd,_0x47bede){var _0xc07abb=_0x369682||client;return _0xc07abb['request'](_0x1c6aef,_0x3e5e91)[_0xb99d('0x13')](function(_0x491fe0){logger[_0xb99d('0x14')]('MailMessage,\x20%s,\x20%s',_0x2a0870,_0xb99d('0x15'));logger[_0xb99d('0x16')](_0xb99d('0x17'),_0x2a0870,_0xb99d('0x15'),JSON[_0xb99d('0x18')](_0x491fe0));if(_0x491fe0[_0xb99d('0x19')]){if(_0x491fe0[_0xb99d('0x19')][_0xb99d('0x1a')]===0x1f4){logger[_0xb99d('0x19')](_0xb99d('0x1b'),_0x2a0870,_0x491fe0['error'][_0xb99d('0x1c')]);return _0x47bede(_0x491fe0[_0xb99d('0x19')][_0xb99d('0x1c')]);}logger[_0xb99d('0x19')](_0xb99d('0x1b'),_0x2a0870,_0x491fe0[_0xb99d('0x19')][_0xb99d('0x1c')]);return _0x449cdd(_0x491fe0[_0xb99d('0x19')][_0xb99d('0x1c')]);}else{logger[_0xb99d('0x14')](_0xb99d('0x1b'),_0x2a0870,_0xb99d('0x15'));_0x449cdd(_0x491fe0[_0xb99d('0x1d')][_0xb99d('0x1c')]);}})[_0xb99d('0x1e')](function(_0x1a3184){logger[_0xb99d('0x19')]('MailMessage,\x20%s,\x20%s',_0x2a0870,_0x1a3184);_0x47bede(_0x1a3184);});});}function respondWithResult(_0x335e1a,_0x1e692a){_0x1e692a=_0x1e692a||0xc8;return function(_0x31eaf9){if(_0x31eaf9){return _0x335e1a[_0xb99d('0x1f')](_0x1e692a)[_0xb99d('0x20')](_0x31eaf9);}};}function respondWithFilteredResult(_0xd886bf,_0x28320c){return function(_0x5a0ce7){if(_0x5a0ce7){var _0x1556ce=typeof _0x28320c[_0xb99d('0x21')]===_0xb99d('0x22')&&typeof _0x28320c[_0xb99d('0x23')]===_0xb99d('0x22');var _0x59d43e=_0x5a0ce7[_0xb99d('0x24')];var _0x337f5d=_0x1556ce?0x0:_0x28320c[_0xb99d('0x21')];var _0x3cf941=_0x1556ce?_0x5a0ce7[_0xb99d('0x24')]:_0x28320c[_0xb99d('0x21')]+_0x28320c['limit'];var _0x3c5231;if(_0x3cf941>=_0x59d43e){_0x3cf941=_0x59d43e;_0x3c5231=0xc8;}else{_0x3c5231=0xce;}_0xd886bf[_0xb99d('0x1f')](_0x3c5231);return _0xd886bf[_0xb99d('0x25')]('Content-Range',_0x337f5d+'-'+_0x3cf941+'/'+_0x59d43e)[_0xb99d('0x20')](_0x5a0ce7);}return null;};}function saveUpdates(_0xb26613){return function(_0x594bc4){if(_0x594bc4){return _0x594bc4[_0xb99d('0x26')](_0xb26613)['then'](function(_0x418be9){return _0x418be9;});}return null;};}function removeEntity(_0x37fe5e){return function(_0x2b6034){if(_0x2b6034){return _0x2b6034[_0xb99d('0x27')]()[_0xb99d('0x13')](function(){_0x37fe5e[_0xb99d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c0503){return function(_0x26acfd){if(!_0x26acfd){_0x1c0503[_0xb99d('0x28')](0x194);}return _0x26acfd;};}function handleError(_0x128f15,_0x416234){_0x416234=_0x416234||0x1f4;return function(_0x24ebf4){logger[_0xb99d('0x19')](_0x24ebf4[_0xb99d('0x29')]);if(_0x24ebf4[_0xb99d('0x2a')]){delete _0x24ebf4['name'];}_0x128f15[_0xb99d('0x1f')](_0x416234)[_0xb99d('0x2b')](_0x24ebf4);};}exports[_0xb99d('0x2c')]=function(_0x540bc3,_0x1b1494){var _0x42ae33={},_0x4ed677={},_0xb6b6db={'count':0x0,'rows':[]};var _0xdcb836=_[_0xb99d('0x2d')](db[_0xb99d('0x2e')][_0xb99d('0x2f')],function(_0x443cea){return{'name':_0x443cea[_0xb99d('0x30')],'type':_0x443cea[_0xb99d('0x31')][_0xb99d('0x32')]};});_0x4ed677['model']=_['map'](_0xdcb836,'name');_0x4ed677[_0xb99d('0x33')]=_[_0xb99d('0x34')](_0x540bc3[_0xb99d('0x33')]);_0x4ed677['filters']=_[_0xb99d('0x35')](_0x4ed677[_0xb99d('0x36')],_0x4ed677[_0xb99d('0x33')]);_0x42ae33['attributes']=_[_0xb99d('0x35')](_0x4ed677['model'],qs[_0xb99d('0x37')](_0x540bc3[_0xb99d('0x33')][_0xb99d('0x37')]));_0x42ae33[_0xb99d('0x38')]=_0x42ae33[_0xb99d('0x38')][_0xb99d('0x39')]?_0x42ae33[_0xb99d('0x38')]:_0x4ed677['model'];if(!_0x540bc3[_0xb99d('0x33')][_0xb99d('0x3a')](_0xb99d('0x3b'))){_0x42ae33[_0xb99d('0x23')]=qs['limit'](_0x540bc3['query'][_0xb99d('0x23')]);_0x42ae33['offset']=qs[_0xb99d('0x21')](_0x540bc3[_0xb99d('0x33')][_0xb99d('0x21')]);}_0x42ae33['order']=qs[_0xb99d('0x3c')](_0x540bc3['query'][_0xb99d('0x3c')]);_0x42ae33[_0xb99d('0x3d')]=qs[_0xb99d('0x3e')](_['pick'](_0x540bc3[_0xb99d('0x33')],_0x4ed677[_0xb99d('0x3e')]),_0xdcb836);if(_0x540bc3[_0xb99d('0x33')]['filter']){_0x42ae33[_0xb99d('0x3d')]=_[_0xb99d('0x3f')](_0x42ae33[_0xb99d('0x3d')],{'$or':_[_0xb99d('0x2d')](_0xdcb836,function(_0x3610e4){if(_0x3610e4[_0xb99d('0x31')]!=='VIRTUAL'){var _0x3f9215={};_0x3f9215[_0x3610e4[_0xb99d('0x2a')]]={'$like':'%'+_0x540bc3['query'][_0xb99d('0x40')]+'%'};return _0x3f9215;}})});}_0x42ae33=_[_0xb99d('0x3f')]({},_0x42ae33,_0x540bc3[_0xb99d('0x41')]);var _0x4cb189={'where':_0x42ae33[_0xb99d('0x3d')]};return db[_0xb99d('0x2e')][_0xb99d('0x24')](_0x4cb189)['then'](function(_0x5b0d4c){_0xb6b6db[_0xb99d('0x24')]=_0x5b0d4c;if(_0x540bc3[_0xb99d('0x33')][_0xb99d('0x42')]){_0x42ae33[_0xb99d('0x43')]=[{'all':!![]}];}return db[_0xb99d('0x2e')][_0xb99d('0x44')](_0x42ae33);})[_0xb99d('0x13')](function(_0x530cd3){_0xb6b6db[_0xb99d('0x45')]=_0x530cd3;return _0xb6b6db;})[_0xb99d('0x13')](respondWithFilteredResult(_0x1b1494,_0x42ae33))[_0xb99d('0x1e')](handleError(_0x1b1494,null));};exports[_0xb99d('0x46')]=function(_0x269ed1,_0x4771d9){var _0x2fed86={'raw':!![],'where':{'id':_0x269ed1['params']['id']}},_0x5edfe8={};_0x5edfe8[_0xb99d('0x36')]=_[_0xb99d('0x34')](db[_0xb99d('0x2e')][_0xb99d('0x2f')]);_0x5edfe8['query']=_[_0xb99d('0x34')](_0x269ed1['query']);_0x5edfe8[_0xb99d('0x3e')]=_[_0xb99d('0x35')](_0x5edfe8[_0xb99d('0x36')],_0x5edfe8[_0xb99d('0x33')]);_0x2fed86[_0xb99d('0x38')]=_[_0xb99d('0x35')](_0x5edfe8[_0xb99d('0x36')],qs[_0xb99d('0x37')](_0x269ed1[_0xb99d('0x33')][_0xb99d('0x37')]));_0x2fed86[_0xb99d('0x38')]=_0x2fed86['attributes'][_0xb99d('0x39')]?_0x2fed86[_0xb99d('0x38')]:_0x5edfe8[_0xb99d('0x36')];if(_0x269ed1[_0xb99d('0x33')][_0xb99d('0x42')]){_0x2fed86[_0xb99d('0x43')]=[{'all':!![]}];}_0x2fed86=_[_0xb99d('0x3f')]({},_0x2fed86,_0x269ed1[_0xb99d('0x41')]);return db['MailMessage'][_0xb99d('0x47')](_0x2fed86)['then'](handleEntityNotFound(_0x4771d9,null))[_0xb99d('0x13')](respondWithResult(_0x4771d9,null))[_0xb99d('0x1e')](handleError(_0x4771d9,null));};exports['update']=function(_0x29f8b9,_0x3e9c21){if(_0x29f8b9[_0xb99d('0x48')]['id']){delete _0x29f8b9['body']['id'];}return db[_0xb99d('0x2e')]['find']({'where':{'id':_0x29f8b9[_0xb99d('0x49')]['id']}})[_0xb99d('0x13')](handleEntityNotFound(_0x3e9c21,null))['then'](saveUpdates(_0x29f8b9[_0xb99d('0x48')],null))[_0xb99d('0x13')](respondWithResult(_0x3e9c21,null))[_0xb99d('0x1e')](handleError(_0x3e9c21,null));};exports['destroy']=function(_0x250b40,_0x38d226){return db[_0xb99d('0x2e')]['find']({'where':{'id':_0x250b40[_0xb99d('0x49')]['id']}})['then'](handleEntityNotFound(_0x38d226,null))[_0xb99d('0x13')](removeEntity(_0x38d226,null))[_0xb99d('0x1e')](handleError(_0x38d226,null));};exports[_0xb99d('0x4a')]=function(_0x4b54d3,_0x373fd4){return db[_0xb99d('0x2e')]['describe']()[_0xb99d('0x13')](respondWithResult(_0x373fd4,null))[_0xb99d('0x1e')](handleError(_0x373fd4,null));};exports['create']=function(_0x55155b,_0x185314){return db[_0xb99d('0x2e')][_0xb99d('0x4b')](_0x55155b[_0xb99d('0x48')])[_0xb99d('0x13')](function(_0x506db4){if(_0x506db4){if(_0x506db4[_0xb99d('0x4c')]==='out'&&!_0x506db4[_0xb99d('0x4d')]){var _0x1bd025,_0x2e77e1,_0x4c4072;if(_0x55155b['body']['to']){_0x2e77e1=_0x55155b['body']['to'][_0xb99d('0x4e')](',')[0x0];}return db[_0xb99d('0x4f')][_0xb99d('0x50')]({'where':{'id':_0x506db4[_0xb99d('0x51')]},'include':[{'model':db[_0xb99d('0x52')],'as':'List','include':[{'model':db[_0xb99d('0x53')],'as':_0xb99d('0x54'),'where':{'email':_0x2e77e1},'limit':0x1,'order':[[_0xb99d('0x55'),'DESC']]}]},{'model':db[_0xb99d('0x56')],'as':_0xb99d('0x57'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})['then'](function(_0x91a08f){_0x1bd025=_0x91a08f;if(!_0x1bd025||!_0x1bd025['Smtp'])return;var _0x1db4db=_0x1bd025[_0xb99d('0x58')]();if(_0x55155b['body'][_0xb99d('0x59')]&&_0x55155b[_0xb99d('0x48')][_0xb99d('0x59')][_0xb99d('0x39')]){for(var _0x3f16fd=0x0;_0x3f16fd<_0x55155b[_0xb99d('0x48')][_0xb99d('0x59')][_0xb99d('0x39')];_0x3f16fd+=0x1){_0x55155b[_0xb99d('0x48')][_0xb99d('0x59')][_0x3f16fd]={'filename':_0x55155b[_0xb99d('0x48')][_0xb99d('0x59')][_0x3f16fd]['name'],'path':path[_0xb99d('0x5a')](config[_0xb99d('0x5b')],_0xb99d('0x5c'),_0x55155b[_0xb99d('0x48')][_0xb99d('0x59')][_0x3f16fd][_0xb99d('0x5d')])};}}_0x4c4072={'account':_0x1db4db,'message':_0x55155b[_0xb99d('0x48')]};return;})[_0xb99d('0x13')](function(){if(_0x1bd025['List']){if(_0x1bd025[_0xb99d('0x5e')]['Contacts'][_0xb99d('0x39')]){return _0x1bd025[_0xb99d('0x5e')][_0xb99d('0x54')][0x0];}else{return db[_0xb99d('0x53')][_0xb99d('0x4b')](_['defaults'](_0x55155b[_0xb99d('0x48')],{'firstName':_0x55155b[_0xb99d('0x48')]['to'],'email':_0x55155b[_0xb99d('0x48')]['to'],'phone':_0x55155b['body']['to'],'ListId':_0x1bd025[_0xb99d('0x5f')]}));}}else{throw new Error(_0xb99d('0x60'));}})[_0xb99d('0x13')](function(){if(_0x4c4072){return respondWithRpcPromise(_0xb99d('0x61'),'sendMail',_0x4c4072,client9003)[_0xb99d('0x13')](function(_0x3027c3){return _0x506db4[_0xb99d('0x26')]({'read':!![],'messageId':_0x3027c3[_0xb99d('0x62')],'sentAt':moment()[_0xb99d('0x63')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x1ee6d0){logger[_0xb99d('0x19')]('%s',JSON['stringify'](_0x1ee6d0));return _0x506db4;});}return _0x506db4;});}return _0x506db4;}})[_0xb99d('0x13')](respondWithResult(_0x185314,0xc9))[_0xb99d('0x1e')](handleError(_0x185314,null));};exports[_0xb99d('0x64')]=function(_0x58e4f3,_0x2c6e66){var _0x506ce3={'agent':{},'channel':_0xb99d('0x65')};if(_0x58e4f3[_0xb99d('0x48')]['id']){delete _0x58e4f3['body']['id'];}_0x58e4f3[_0xb99d('0x48')]['read']=!![];_0x58e4f3[_0xb99d('0x48')][_0xb99d('0x66')]=moment()[_0xb99d('0x63')](_0xb99d('0x67'));_0x58e4f3[_0xb99d('0x48')][_0xb99d('0x68')]=_0x58e4f3[_0xb99d('0x48')][_0xb99d('0x68')]||_0x58e4f3[_0xb99d('0x69')]['id'];_0x506ce3[_0xb99d('0x6a')]['id']=_0x58e4f3[_0xb99d('0x48')]['UserId'];return db[_0xb99d('0x2e')][_0xb99d('0x47')]({'where':{'id':_0x58e4f3[_0xb99d('0x49')]['id'],'UserId':null}})[_0xb99d('0x13')](handleEntityNotFound(_0x2c6e66,null))['then'](saveUpdates(_0x58e4f3[_0xb99d('0x48')],null))['then'](function(_0x1e547e){if(_0x1e547e){_0x506ce3['message']=_0x1e547e['get']({'plain':!![]});return db['MailInteraction'][_0xb99d('0x47')]({'where':{'id':_0x1e547e[_0xb99d('0x6b')]}});}return null;})['then'](handleEntityNotFound(_0x2c6e66,null))[_0xb99d('0x13')](function(_0x26b852){if(_0x26b852){return _0x26b852[_0xb99d('0x26')]({'UserId':_0x58e4f3['body']['UserId'],'read1stAt':_['isNil'](_0x26b852[_0xb99d('0x6c')])?moment()[_0xb99d('0x63')](_0xb99d('0x67')):undefined});}return null;})['then'](function(_0x40a305){if(_0x40a305){_0x506ce3[_0xb99d('0x6d')]=_0x40a305[_0xb99d('0x6e')]({'plain':!![]});interaction_log[_0xb99d('0x14')](_0xb99d('0x6f'),_0x58e4f3['user']['id'],_0x58e4f3[_0xb99d('0x69')][_0xb99d('0x2a')],_0x58e4f3[_0xb99d('0x69')][_0xb99d('0x70')],_0x506ce3[_0xb99d('0x6d')]['id'],_0x58e4f3[_0xb99d('0x48')]?JSON[_0xb99d('0x18')](_0x58e4f3['body']):_0xb99d('0x71'));return respondWithRpcPromise(_0xb99d('0x72'),'acceptMessage',_0x506ce3);}return null;})[_0xb99d('0x13')](function(_0x3f7633){var _0x5ee48c=_0xb99d('0x73')+_0x3f7633['message'][_0xb99d('0x74')];return db[_0xb99d('0x75')][_0xb99d('0x33')](_0x5ee48c,{'type':db[_0xb99d('0x76')][_0xb99d('0x77')][_0xb99d('0x78')],'raw':!![]})[_0xb99d('0x13')](function(_0x556455){return _0x556455;});})[_0xb99d('0x13')](function(_0x12e763){if(_0x12e763){_0x506ce3[_0xb99d('0x1c')][_0xb99d('0x79')]=_0x12e763[0x0];if(!_0x58e4f3[_0xb99d('0x48')][_0xb99d('0x68')])return;return db['User']['find']({'where':{'id':_0x58e4f3['body'][_0xb99d('0x68')],'role':_0xb99d('0x6a')},'attributes':['id','name','fullname',_0xb99d('0x7a'),_0xb99d('0x7b')],'raw':!![]});}return null;})['then'](function(_0x131289){if(!_0x131289)return null;_0x506ce3[_0xb99d('0x1c')][_0xb99d('0x6a')]=_0x131289;return _0x506ce3;})[_0xb99d('0x13')](function(_0x4c5a6a){if(_0x4c5a6a){if(_0x58e4f3['body']['manual']){_0x506ce3['message'][_0xb99d('0x7c')]=util[_0xb99d('0x63')]('SIP/%s',_0x58e4f3[_0xb99d('0x69')]['name']);_0x506ce3[_0xb99d('0x1c')]['channel']=_0x506ce3[_0xb99d('0x7d')];_0x506ce3['message'][_0xb99d('0x7e')]=_0x506ce3[_0xb99d('0x7d')];_0x506ce3[_0xb99d('0x1c')][_0xb99d('0x7f')]=_0xb99d('0x64');_0x506ce3[_0xb99d('0x1c')]['body']=htmlToText['fromString'](_0x506ce3[_0xb99d('0x1c')][_0xb99d('0x48')]);return respondWithRpcPromise(_0xb99d('0x80'),'EventManager',{'event':_0xb99d('0x81'),'message':_0x506ce3[_0xb99d('0x1c')]},client9002)[_0xb99d('0x13')](function(){return _0x506ce3;});}return _0x506ce3;}return null;})[_0xb99d('0x13')](respondWithResult(_0x2c6e66,null))[_0xb99d('0x1e')](handleError(_0x2c6e66,null));};exports[_0xb99d('0x82')]=function(_0x5c49db,_0x32ab5a){var _0x361be8={'agent':{},'channel':'mail'};if(_0x5c49db['body']['id']){delete _0x5c49db[_0xb99d('0x48')]['id'];}_0x5c49db[_0xb99d('0x48')][_0xb99d('0x68')]=_0x5c49db[_0xb99d('0x48')]['UserId']||_0x5c49db['user']['id'];_0x361be8[_0xb99d('0x6a')]['id']=_0x5c49db[_0xb99d('0x48')][_0xb99d('0x68')];return db['MailMessage'][_0xb99d('0x47')]({'where':{'id':_0x5c49db[_0xb99d('0x49')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x32ab5a,null))[_0xb99d('0x13')](function(_0x5e7498){if(_0x5e7498){_0x361be8['message']=_0x5e7498[_0xb99d('0x6e')]({'plain':!![]});return db[_0xb99d('0x83')]['find']({'where':{'id':_0x5e7498[_0xb99d('0x6b')]}});}return null;})[_0xb99d('0x13')](handleEntityNotFound(_0x32ab5a,null))[_0xb99d('0x13')](function(_0x50be37){if(_0x50be37){_0x361be8['interaction']=_0x50be37['get']({'plain':!![]});interaction_log[_0xb99d('0x14')](_0xb99d('0x84'),_0x5c49db[_0xb99d('0x69')]['id'],_0x5c49db[_0xb99d('0x69')][_0xb99d('0x2a')],_0x5c49db[_0xb99d('0x69')][_0xb99d('0x70')],_0x361be8[_0xb99d('0x6d')]['id'],_0x5c49db[_0xb99d('0x48')]?JSON[_0xb99d('0x18')](_0x5c49db[_0xb99d('0x48')]):_0xb99d('0x71'));return respondWithRpcPromise(_0xb99d('0x85'),_0xb99d('0x86'),_0x361be8);}return null;})[_0xb99d('0x13')](function(_0x197678){var _0x19bbec=_0xb99d('0x73')+_0x197678['message']['ContactId'];return db[_0xb99d('0x75')][_0xb99d('0x33')](_0x19bbec,{'type':db[_0xb99d('0x76')]['QueryTypes'][_0xb99d('0x78')],'raw':!![]})[_0xb99d('0x13')](function(_0x1aee73){return _0x1aee73;});})[_0xb99d('0x13')](function(_0x2796b6){if(_0x2796b6){_0x361be8[_0xb99d('0x1c')]['contact']=_0x2796b6[0x0];if(!_0x5c49db[_0xb99d('0x48')][_0xb99d('0x68')])return;return db[_0xb99d('0x87')][_0xb99d('0x47')]({'where':{'id':_0x5c49db[_0xb99d('0x48')][_0xb99d('0x68')],'role':_0xb99d('0x6a')},'attributes':['id',_0xb99d('0x2a'),_0xb99d('0x88'),'email',_0xb99d('0x7b')],'raw':!![]});}return null;})[_0xb99d('0x13')](function(_0x422db5){if(!_0x422db5)return null;_0x361be8[_0xb99d('0x1c')][_0xb99d('0x6a')]=_0x422db5;return _0x361be8;})['then'](function(_0x3f7926){if(_0x3f7926){_0x3f7926[_0xb99d('0x1c')]['interface']=util[_0xb99d('0x63')](_0xb99d('0x89'),_0x5c49db[_0xb99d('0x69')][_0xb99d('0x2a')]);_0x3f7926[_0xb99d('0x1c')][_0xb99d('0x7d')]=_0x361be8[_0xb99d('0x7d')];_0x3f7926[_0xb99d('0x1c')][_0xb99d('0x7e')]=_0x361be8[_0xb99d('0x7d')];_0x3f7926[_0xb99d('0x1c')][_0xb99d('0x7f')]=_0xb99d('0x82');_0x3f7926[_0xb99d('0x1c')][_0xb99d('0x48')]=htmlToText[_0xb99d('0x8a')](_0x361be8['message']['body']);respondWithRpcPromise('EventManager',_0xb99d('0x80'),{'event':'rejectmessage','message':_0x3f7926[_0xb99d('0x1c')]},client9002);return _0x361be8;}return null;})[_0xb99d('0x13')](respondWithResult(_0x32ab5a,null))[_0xb99d('0x1e')](handleError(_0x32ab5a,null));};exports[_0xb99d('0x8b')]=function(_0x14bc88,_0x4b8967){var _0x46789c=moment()[_0xb99d('0x8c')]()[_0xb99d('0x8d')]();var _0x4f0845=path[_0xb99d('0x5a')](config['root'],_0xb99d('0x8e'),_0xb99d('0x8f'),'tmp');var _0xc3a9e7=path[_0xb99d('0x5a')](config[_0xb99d('0x5b')],_0xb99d('0x8e'),_0xb99d('0x8f'),_0xb99d('0x59'));var _0x3102e9=util[_0xb99d('0x63')]('message-%s.eml',_0x46789c);return db[_0xb99d('0x2e')][_0xb99d('0x47')]({'where':{'id':_0x14bc88[_0xb99d('0x49')]['id']},'attributes':['id','body','from','to','cc',_0xb99d('0x90'),'subject','createdAt'],'include':_0x14bc88[_0xb99d('0x33')][_0xb99d('0x59')]?[{'model':db[_0xb99d('0x91')],'as':_0xb99d('0x92')}]:undefined})[_0xb99d('0x13')](handleEntityNotFound(_0x4b8967,null))[_0xb99d('0x13')](function(_0x33a80f){if(_0x33a80f){var _0x2aee96=_0x33a80f;var _0x1272a7={'from':_0x2aee96[_0xb99d('0x93')],'to':_0x2aee96['to'],'subject':_0x2aee96[_0xb99d('0x94')],'html':htmlEntities[_0xb99d('0x95')](_0x2aee96['body']),'headers':{'Date':moment(_0x2aee96[_0xb99d('0x96')])[_0xb99d('0x63')](_0xb99d('0x97'))},'attachments':[]};if(_0x33a80f['cc']){_0x1272a7[_0xb99d('0x98')]['Cc']=_0x33a80f['cc'];}if(_0x33a80f[_0xb99d('0x90')]){_0x1272a7[_0xb99d('0x98')][_0xb99d('0x99')]=_0x33a80f['bcc'];}return new BPromise(function(_0x4536e7,_0xb8a99){if(_0x33a80f[_0xb99d('0x92')]){for(var _0x4f504b=0x0;_0x4f504b<_0x33a80f[_0xb99d('0x92')][_0xb99d('0x39')];_0x4f504b++){var _0x27f521=_0x33a80f[_0xb99d('0x92')][_0x4f504b];var _0x50e474=path[_0xb99d('0x5a')](_0xc3a9e7,_0x27f521[_0xb99d('0x5d')]);if(fs[_0xb99d('0x9a')](_0x50e474)){_0x1272a7[_0xb99d('0x59')][_0xb99d('0x9b')]({'name':_0x27f521[_0xb99d('0x2a')],'contentType':_0x27f521[_0xb99d('0x31')],'data':fs[_0xb99d('0x9c')](_0x50e474)});}}}emlformat[_0xb99d('0x9d')](_0x1272a7,function(_0x3f0b4f,_0x5b0a2f){if(_0x3f0b4f)return _0xb8a99(_0x3f0b4f);fs[_0xb99d('0x9e')](path[_0xb99d('0x5a')](_0x4f0845,_0x3102e9),_0x5b0a2f);return _0x4536e7(_0x5b0a2f);});});}})['then'](function(_0x551400){if(_0x551400){return _0x4b8967['download'](path['join'](_0x4f0845,_0x3102e9),_0x3102e9,function(_0x2aa224){if(!_0x2aa224)fs['unlinkSync'](path[_0xb99d('0x5a')](_0x4f0845,_0x3102e9));});}})['catch'](handleError(_0x4b8967,null));};
\ No newline at end of file
index 35226b3..46e7c61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008b=['hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','save','update','emit'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x008b,0x81));var _0xb008=function(_0x1c89e1,_0x4e4f6e){_0x1c89e1=_0x1c89e1-0x0;var _0x4df70d=_0x008b[_0x1c89e1];return _0x4df70d;};'use strict';var EventEmitter=require(_0xb008('0x0'));var MailMessage=require(_0xb008('0x1'))['db'][_0xb008('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb008('0x3'),'afterUpdate':_0xb008('0x4'),'afterDestroy':'remove'};function emitEvent(_0xd7a8af){return function(_0x1f2e80,_0x5db3a0,_0x3d3372){MailMessageEvents[_0xb008('0x5')](_0xd7a8af+':'+_0x1f2e80['id'],_0x1f2e80);MailMessageEvents[_0xb008('0x5')](_0xd7a8af,_0x1f2e80);_0x3d3372(null);};}for(var e in events){if(events[_0xb008('0x6')](e)){var event=events[e];MailMessage[_0xb008('0x7')](e,emitEvent(event));}}module[_0xb008('0x8')]=MailMessageEvents;
\ No newline at end of file
+var _0x0244=['setMaxListeners','save','remove','emit','hasOwnProperty','MailMessage'];(function(_0xca87ac,_0x403b52){var _0x313192=function(_0x1655b5){while(--_0x1655b5){_0xca87ac['push'](_0xca87ac['shift']());}};_0x313192(++_0x403b52);}(_0x0244,0x1bb));var _0x4024=function(_0x2833fd,_0x28c021){_0x2833fd=_0x2833fd-0x0;var _0x3331a0=_0x0244[_0x2833fd];return _0x3331a0;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0x4024('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x4024('0x1')](0x0);var events={'afterCreate':_0x4024('0x2'),'afterUpdate':'update','afterDestroy':_0x4024('0x3')};function emitEvent(_0x1d1f18){return function(_0x5a59fc,_0x4db3f7,_0x545f69){MailMessageEvents[_0x4024('0x4')](_0x1d1f18+':'+_0x5a59fc['id'],_0x5a59fc);MailMessageEvents[_0x4024('0x4')](_0x1d1f18,_0x5a59fc);_0x545f69(null);};}for(var e in events){if(events[_0x4024('0x5')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
index 040d351..ec00631 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0939=['MailInteractionId','catch','error','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x0939,0x11a));var _0x9093=function(_0x5c4a03,_0x2069a8){_0x5c4a03=_0x5c4a03-0x0;var _0x12200b=_0x0939[_0x5c4a03];return _0x12200b;};'use strict';var _=require(_0x9093('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9093('0x1'));var moment=require(_0x9093('0x2'));var BPromise=require(_0x9093('0x3'));var rp=require(_0x9093('0x4'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x9093('0x5'));var rimraf=require(_0x9093('0x6'));var config=require(_0x9093('0x7'));var attributes=require(_0x9093('0x8'));module[_0x9093('0x9')]=function(_0x5b205d,_0x2d34f3){return _0x5b205d[_0x9093('0xa')]('MailMessage',attributes,{'tableName':_0x9093('0xb'),'paranoid':![],'indexes':[{'name':_0x9093('0xc'),'fields':['messageId']},{'name':_0x9093('0xd'),'fields':[_0x9093('0xe'),_0x9093('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x152b65,_0x349604,_0x346788){if(_0x152b65[_0x9093('0x10')]){_0x152b65[_0x9093('0xe')]=htmlToText[_0x9093('0x11')](_0x152b65[_0x9093('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x346788(null,_0x349604);},'afterCreate':function(_0xec4c47,_0x502f5d,_0x4fe373){var _0x538b0b=_0x5b205d[_0x9093('0x12')];var _0x50fd4c=_0xec4c47[_0x9093('0x13')]({'plain':!![]});if(_0x50fd4c[_0x9093('0x14')][_0x9093('0x15')]()==='in'||_0x50fd4c[_0x9093('0x14')]['toLowerCase']()===_0x9093('0x16')&&!_0x50fd4c[_0x9093('0x17')]&&!_[_0x9093('0x18')](_0x50fd4c[_0x9093('0x19')])){_0x538b0b[_0x9093('0x1a')][_0x9093('0x1b')]({'where':{'id':_0x50fd4c[_0x9093('0x1c')]}})['then'](function(_0x3c984f){if(_0x3c984f){_0x3c984f['update']({'lastMsgAt':_0x50fd4c['createdAt'],'lastMsgDirection':_0x50fd4c['direction']['toLowerCase']()});}})[_0x9093('0x1d')](function(_0x3d86e1){console[_0x9093('0x1e')](_0x3d86e1);});}_0x4fe373();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xfb1c=['FULLTEXT','body','models','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','./mailMessage.attributes','exports','define','mail_messages','messageId','fti_mail_messages'];(function(_0x53de97,_0x29090e){var _0xbafcae=function(_0x725289){while(--_0x725289){_0x53de97['push'](_0x53de97['shift']());}};_0xbafcae(++_0x29090e);}(_0xfb1c,0x132));var _0xcfb1=function(_0x1b7dfc,_0x50210c){_0x1b7dfc=_0x1b7dfc-0x0;var _0x134c30=_0xfb1c[_0x1b7dfc];return _0x134c30;};'use strict';var _=require('lodash');var util=require(_0xcfb1('0x0'));var logger=require(_0xcfb1('0x1'))(_0xcfb1('0x2'));var moment=require(_0xcfb1('0x3'));var BPromise=require(_0xcfb1('0x4'));var rp=require(_0xcfb1('0x5'));var htmlToText=require(_0xcfb1('0x6'));var fs=require('fs');var path=require(_0xcfb1('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcfb1('0x8'));module[_0xcfb1('0x9')]=function(_0x3f239a,_0x537ae7){return _0x3f239a[_0xcfb1('0xa')]('MailMessage',attributes,{'tableName':_0xcfb1('0xb'),'paranoid':![],'indexes':[{'name':_0xcfb1('0xc'),'fields':[_0xcfb1('0xc')]},{'name':_0xcfb1('0xd'),'fields':['plainBody','subject'],'type':_0xcfb1('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x40fad8,_0x7d49b1,_0x354276){if(_0x40fad8['body']){_0x40fad8['plainBody']=htmlToText['fromString'](_0x40fad8[_0xcfb1('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x354276(null,_0x7d49b1);},'afterCreate':function(_0x411719,_0x3480d3,_0x2c143e){var _0x415e46=_0x3f239a[_0xcfb1('0x10')];var _0x6a2980=_0x411719['get']({'plain':!![]});if(_0x6a2980[_0xcfb1('0x11')][_0xcfb1('0x12')]()==='in'||_0x6a2980[_0xcfb1('0x11')][_0xcfb1('0x12')]()===_0xcfb1('0x13')&&!_0x6a2980[_0xcfb1('0x14')]&&!_[_0xcfb1('0x15')](_0x6a2980[_0xcfb1('0x16')])){_0x415e46[_0xcfb1('0x17')][_0xcfb1('0x18')]({'where':{'id':_0x6a2980[_0xcfb1('0x19')]}})[_0xcfb1('0x1a')](function(_0x3870bb){if(_0x3870bb){_0x3870bb[_0xcfb1('0x1b')]({'lastMsgAt':_0x6a2980[_0xcfb1('0x1c')],'lastMsgDirection':_0x6a2980[_0xcfb1('0x11')][_0xcfb1('0x12')]()});}})[_0xcfb1('0x1d')](function(_0xc9fc1a){console[_0xcfb1('0x1e')](_0xc9fc1a);});}_0x2c143e();}},'charset':_0xcfb1('0x1f'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index d496b6b..dfa640b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x958a=['./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateMailMessage','MailMessage','create','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x367b4d,_0x210450){var _0x58c462=function(_0x5732f2){while(--_0x5732f2){_0x367b4d['push'](_0x367b4d['shift']());}};_0x58c462(++_0x210450);}(_0x958a,0x128));var _0xa958=function(_0x2f641d,_0x2ce454){_0x2f641d=_0x2f641d-0x0;var _0x2ae4fb=_0x958a[_0x2f641d];return _0x2ae4fb;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var moment=require('moment');var BPromise=require(_0xa958('0x2'));var rs=require(_0xa958('0x3'));var fs=require('fs');var Redis=require(_0xa958('0x4'));var db=require(_0xa958('0x5'))['db'];var utils=require(_0xa958('0x6'));var logger=require('../../config/logger')(_0xa958('0x7'));var config=require('../../config/environment');var jayson=require(_0xa958('0x8'));var client=jayson[_0xa958('0x9')][_0xa958('0xa')]({'port':0x232a});config[_0xa958('0xb')]=_[_0xa958('0xc')](config[_0xa958('0xb')],{'host':_0xa958('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa958('0xe'))[_0xa958('0xf')](socket);function respondWithRpcPromise(_0x11f090,_0x44b66e,_0x37afa0){return new BPromise(function(_0x94caac,_0xebb1c6){return client[_0xa958('0x10')](_0x11f090,_0x37afa0)[_0xa958('0x11')](function(_0x250999){logger[_0xa958('0x12')](_0xa958('0x13'),_0x44b66e,_0xa958('0x14'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x44b66e,'request\x20sent',JSON[_0xa958('0x15')](_0x250999));if(_0x250999[_0xa958('0x16')]){if(_0x250999[_0xa958('0x16')]['code']===0x1f4){logger[_0xa958('0x16')]('MailMessage,\x20%s,\x20%s',_0x44b66e,_0x250999['error']['message']);return _0xebb1c6(_0x250999[_0xa958('0x16')][_0xa958('0x17')]);}logger[_0xa958('0x16')](_0xa958('0x13'),_0x44b66e,_0x250999[_0xa958('0x16')][_0xa958('0x17')]);return _0x94caac(_0x250999[_0xa958('0x16')][_0xa958('0x17')]);}else{logger['info'](_0xa958('0x13'),_0x44b66e,'request\x20sent');_0x94caac(_0x250999[_0xa958('0x18')][_0xa958('0x17')]);}})['catch'](function(_0xe4129a){logger[_0xa958('0x16')](_0xa958('0x13'),_0x44b66e,_0xe4129a);_0xebb1c6(_0xe4129a);});});}exports[_0xa958('0x19')]=function(_0x2759ad){var _0x1f82aa=this;return new Promise(function(_0x56314b,_0x4a90c2){return db[_0xa958('0x1a')][_0xa958('0x1b')](_0x2759ad[_0xa958('0x1c')],{'raw':_0x2759ad['options']?_0x2759ad[_0xa958('0x1d')][_0xa958('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x28cf12){logger[_0xa958('0x12')]('CreateMailMessage',_0x2759ad);logger['debug'](_0xa958('0x19'),_0x2759ad,JSON[_0xa958('0x15')](_0x28cf12));_0x56314b(_0x28cf12);})['catch'](function(_0x25f461){logger[_0xa958('0x16')](_0xa958('0x19'),_0x25f461[_0xa958('0x17')],_0x2759ad);_0x4a90c2(_0x1f82aa[_0xa958('0x16')](0x1f4,_0x25f461[_0xa958('0x17')]));});});};
\ No newline at end of file
+var _0x84a0=['lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./mailMessage.socket','register','request','then','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','result','catch','CreateMailMessage','MailMessage','create','body','options','raw'];(function(_0x3b430b,_0x4dd730){var _0xbd3b7=function(_0x51b83e){while(--_0x51b83e){_0x3b430b['push'](_0x3b430b['shift']());}};_0xbd3b7(++_0x4dd730);}(_0x84a0,0x66));var _0x084a=function(_0x2b336e,_0x56a33c){_0x2b336e=_0x2b336e-0x0;var _0x31ee83=_0x84a0[_0x2b336e];return _0x31ee83;};'use strict';var _=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var moment=require(_0x084a('0x2'));var BPromise=require(_0x084a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x084a('0x4'));var db=require(_0x084a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x084a('0x6'));var config=require(_0x084a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x084a('0x8')][_0x084a('0x9')]({'port':0x232a});config[_0x084a('0xa')]=_[_0x084a('0xb')](config[_0x084a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x084a('0xc'))(new Redis(config[_0x084a('0xa')]));require(_0x084a('0xd'))[_0x084a('0xe')](socket);function respondWithRpcPromise(_0x142127,_0x4c1e29,_0x4dd423){return new BPromise(function(_0x3d9dc6,_0x853df){return client[_0x084a('0xf')](_0x142127,_0x4dd423)[_0x084a('0x10')](function(_0x2d7c90){logger['info']('MailMessage,\x20%s,\x20%s',_0x4c1e29,_0x084a('0x11'));logger[_0x084a('0x12')](_0x084a('0x13'),_0x4c1e29,_0x084a('0x11'),JSON[_0x084a('0x14')](_0x2d7c90));if(_0x2d7c90[_0x084a('0x15')]){if(_0x2d7c90[_0x084a('0x15')][_0x084a('0x16')]===0x1f4){logger['error'](_0x084a('0x17'),_0x4c1e29,_0x2d7c90['error'][_0x084a('0x18')]);return _0x853df(_0x2d7c90[_0x084a('0x15')][_0x084a('0x18')]);}logger[_0x084a('0x15')](_0x084a('0x17'),_0x4c1e29,_0x2d7c90['error'][_0x084a('0x18')]);return _0x3d9dc6(_0x2d7c90['error'][_0x084a('0x18')]);}else{logger[_0x084a('0x19')]('MailMessage,\x20%s,\x20%s',_0x4c1e29,_0x084a('0x11'));_0x3d9dc6(_0x2d7c90[_0x084a('0x1a')][_0x084a('0x18')]);}})[_0x084a('0x1b')](function(_0x33d3a6){logger[_0x084a('0x15')](_0x084a('0x17'),_0x4c1e29,_0x33d3a6);_0x853df(_0x33d3a6);});});}exports[_0x084a('0x1c')]=function(_0x3f60cf){var _0xcb5356=this;return new Promise(function(_0x3c7fd6,_0x279e25){return db[_0x084a('0x1d')][_0x084a('0x1e')](_0x3f60cf[_0x084a('0x1f')],{'raw':_0x3f60cf['options']?_0x3f60cf[_0x084a('0x20')][_0x084a('0x21')]===undefined?!![]:![]:!![]})[_0x084a('0x10')](function(_0x2d62bf){logger[_0x084a('0x19')]('CreateMailMessage',_0x3f60cf);logger[_0x084a('0x12')](_0x084a('0x1c'),_0x3f60cf,JSON[_0x084a('0x14')](_0x2d62bf));_0x3c7fd6(_0x2d62bf);})[_0x084a('0x1b')](function(_0x18b43d){logger[_0x084a('0x15')]('CreateMailMessage',_0x18b43d[_0x084a('0x18')],_0x3f60cf);_0x279e25(_0xcb5356[_0x084a('0x15')](0x1f4,_0x18b43d[_0x084a('0x18')]));});});};
\ No newline at end of file
index dca86bf..ab36b9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d8c=['emit','register','length','mailMessage:','./mailMessage.events','remove','update'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x9d8c,0x162));var _0xc9d8=function(_0x1cc7f2,_0x14085e){_0x1cc7f2=_0x1cc7f2-0x0;var _0x5aca71=_0x9d8c[_0x1cc7f2];return _0x5aca71;};'use strict';var MailMessageEvents=require(_0xc9d8('0x0'));var events=['save',_0xc9d8('0x1'),_0xc9d8('0x2')];function createListener(_0x394a3d,_0x4b6c91){return function(_0x445339){_0x4b6c91[_0xc9d8('0x3')](_0x394a3d,_0x445339);};}function removeListener(_0x503150,_0x3bd2a7){return function(){MailMessageEvents['removeListener'](_0x503150,_0x3bd2a7);};}exports[_0xc9d8('0x4')]=function(_0x40855){for(var _0x5adfb2=0x0,_0x113655=events[_0xc9d8('0x5')];_0x5adfb2<_0x113655;_0x5adfb2++){var _0x23e049=events[_0x5adfb2];var _0x32945e=createListener(_0xc9d8('0x6')+_0x23e049,_0x40855);MailMessageEvents['on'](_0x23e049,_0x32945e);}};
\ No newline at end of file
+var _0x332d=['emit','removeListener','length','mailMessage:','./mailMessage.events','save','update'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x332d,0x1c4));var _0xd332=function(_0x301880,_0x4d7ccf){_0x301880=_0x301880-0x0;var _0x13513b=_0x332d[_0x301880];return _0x13513b;};'use strict';var MailMessageEvents=require(_0xd332('0x0'));var events=[_0xd332('0x1'),'remove',_0xd332('0x2')];function createListener(_0x4fb8e6,_0x562a60){return function(_0x6c4a24){_0x562a60[_0xd332('0x3')](_0x4fb8e6,_0x6c4a24);};}function removeListener(_0x1422d6,_0x425bc8){return function(){MailMessageEvents[_0xd332('0x4')](_0x1422d6,_0x425bc8);};}exports['register']=function(_0x2b58e0){for(var _0x1fa274=0x0,_0x27058d=events[_0xd332('0x5')];_0x1fa274<_0x27058d;_0x1fa274++){var _0x3ed9ba=events[_0x1fa274];var _0x55a0b0=createListener(_0xd332('0x6')+_0x3ed9ba,_0x2b58e0);MailMessageEvents['on'](_0x3ed9ba,_0x55a0b0);}};
\ No newline at end of file
index c2d22a0..f8e995b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d34=['index','/describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','removeTeams','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated'];(function(_0x24eb2a,_0x43c18e){var _0x4afb2b=function(_0x4550e9){while(--_0x4550e9){_0x24eb2a['push'](_0x24eb2a['shift']());}};_0x4afb2b(++_0x43c18e);}(_0x4d34,0x10d));var _0x44d3=function(_0xf5330d,_0x13fceb){_0xf5330d=_0xf5330d-0x0;var _0x4f1af3=_0x4d34[_0xf5330d];return _0x4f1af3;};'use strict';var multer=require(_0x44d3('0x0'));var util=require(_0x44d3('0x1'));var path=require(_0x44d3('0x2'));var timeout=require(_0x44d3('0x3'));var express=require('express');var router=express[_0x44d3('0x4')]();var fs_extra=require(_0x44d3('0x5'));var auth=require(_0x44d3('0x6'));var interaction=require(_0x44d3('0x7'));var config=require('../../config/environment');var controller=require(_0x44d3('0x8'));router[_0x44d3('0x9')]('/',auth[_0x44d3('0xa')](),controller[_0x44d3('0xb')]);router[_0x44d3('0x9')](_0x44d3('0xc'),auth[_0x44d3('0xa')](),controller['describe']);router[_0x44d3('0x9')](_0x44d3('0xd'),auth[_0x44d3('0xa')](),controller['show']);router[_0x44d3('0x9')](_0x44d3('0xe'),auth[_0x44d3('0xa')](),controller[_0x44d3('0xf')]);router[_0x44d3('0x9')](_0x44d3('0x10'),auth[_0x44d3('0xa')](),controller[_0x44d3('0x11')]);router[_0x44d3('0x9')](_0x44d3('0x12'),auth[_0x44d3('0xa')](),controller[_0x44d3('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x44d3('0x14')](_0x44d3('0x10'),auth[_0x44d3('0xa')](),controller[_0x44d3('0x15')]);router[_0x44d3('0x14')](_0x44d3('0x12'),auth[_0x44d3('0xa')](),controller[_0x44d3('0x16')]);router[_0x44d3('0x17')](_0x44d3('0xd'),auth[_0x44d3('0xa')](),controller[_0x44d3('0x18')]);router['delete'](_0x44d3('0xd'),auth[_0x44d3('0xa')](),controller['destroy']);router[_0x44d3('0x19')]('/:id/teams',auth[_0x44d3('0xa')](),controller[_0x44d3('0x1a')]);router[_0x44d3('0x19')](_0x44d3('0x12'),auth[_0x44d3('0xa')](),controller['removeAgents']);module[_0x44d3('0x1b')]=router;
\ No newline at end of file
+var _0xe197=['./mailQueue.controller','index','get','/describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addAgents','/:id','delete','destroy','removeTeams','removeAgents','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x48f1c2,_0x59105f){var _0x4c7e92=function(_0x1794d7){while(--_0x1794d7){_0x48f1c2['push'](_0x48f1c2['shift']());}};_0x4c7e92(++_0x59105f);}(_0xe197,0xd2));var _0x7e19=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe197[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x7e19('0x0'));var path=require(_0x7e19('0x1'));var timeout=require(_0x7e19('0x2'));var express=require('express');var router=express[_0x7e19('0x3')]();var fs_extra=require(_0x7e19('0x4'));var auth=require(_0x7e19('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7e19('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7e19('0x7')]);router[_0x7e19('0x8')](_0x7e19('0x9'),auth[_0x7e19('0xa')](),controller['describe']);router[_0x7e19('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x7e19('0xb')]);router[_0x7e19('0x8')](_0x7e19('0xc'),auth['isAuthenticated'](),controller[_0x7e19('0xd')]);router[_0x7e19('0x8')](_0x7e19('0xe'),auth['isAuthenticated'](),controller[_0x7e19('0xf')]);router[_0x7e19('0x8')](_0x7e19('0x10'),auth[_0x7e19('0xa')](),controller['getAgents']);router['post']('/',auth[_0x7e19('0xa')](),controller['create']);router[_0x7e19('0x11')](_0x7e19('0xe'),auth[_0x7e19('0xa')](),controller['addTeams']);router[_0x7e19('0x11')](_0x7e19('0x10'),auth[_0x7e19('0xa')](),controller[_0x7e19('0x12')]);router['put'](_0x7e19('0x13'),auth[_0x7e19('0xa')](),controller['update']);router[_0x7e19('0x14')](_0x7e19('0x13'),auth['isAuthenticated'](),controller[_0x7e19('0x15')]);router[_0x7e19('0x14')](_0x7e19('0xe'),auth[_0x7e19('0xa')](),controller[_0x7e19('0x16')]);router['delete'](_0x7e19('0x10'),auth['isAuthenticated'](),controller[_0x7e19('0x17')]);module['exports']=router;
\ No newline at end of file
index 6d06782..ef38c64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c9a=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','INTEGER'];(function(_0x5041d5,_0x34b5ab){var _0x606270=function(_0xf2e834){while(--_0xf2e834){_0x5041d5['push'](_0x5041d5['shift']());}};_0x606270(++_0x34b5ab);}(_0x4c9a,0x146));var _0xa4c9=function(_0x464992,_0x50cc33){_0x464992=_0x464992-0x0;var _0x4363f9=_0x4c9a[_0x464992];return _0x4363f9;};'use strict';var Sequelize=require('sequelize');module[_0xa4c9('0x0')]={'name':{'type':Sequelize[_0xa4c9('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa4c9('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa4c9('0x3')](_0xa4c9('0x4'),_0xa4c9('0x5'),_0xa4c9('0x6'))}};
\ No newline at end of file
+var _0xfba5=['name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x365565,_0x9e067){var _0x30614d=function(_0xc6d78e){while(--_0xc6d78e){_0x365565['push'](_0x365565['shift']());}};_0x30614d(++_0x9e067);}(_0xfba5,0xf0));var _0x5fba=function(_0x2eb000,_0x24dd5e){_0x2eb000=_0x2eb000-0x0;var _0x4b6e17=_0xfba5[_0x2eb000];return _0x4b6e17;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x5fba('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5fba('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5fba('0x2')](_0x5fba('0x3'),'beepall',_0x5fba('0x4'))}};
\ No newline at end of file
index 1b20b7a..ceafd44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05c6=['MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userMailQueue:remove','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','status','undefined','count','offset','limit','json','update','then','get','MailQueues','UserProfileResource','destroy','end','sendStatus','error','name','send','index','MailQueue','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','rows','catch','params','includeAll','include','find','create','body','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','pick','MailQueueId','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','%s/%s','Team','getTeams','findAll','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userMailQueue:save','ids','select','field','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId'];(function(_0x1e888e,_0xaecce){var _0x59d7ad=function(_0x28443e){while(--_0x28443e){_0x1e888e['push'](_0x1e888e['shift']());}};_0x59d7ad(++_0xaecce);}(_0x05c6,0x125));var _0x605c=function(_0x2a4aa4,_0x6eae79){_0x2a4aa4=_0x2a4aa4-0x0;var _0x424a45=_0x05c6[_0x2a4aa4];return _0x424a45;};'use strict';var emlformat=require(_0x605c('0x0'));var rimraf=require(_0x605c('0x1'));var zipdir=require(_0x605c('0x2'));var jsonpatch=require(_0x605c('0x3'));var rp=require(_0x605c('0x4'));var moment=require(_0x605c('0x5'));var BPromise=require(_0x605c('0x6'));var Mustache=require(_0x605c('0x7'));var util=require(_0x605c('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x605c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x605c('0xa'));var _=require(_0x605c('0xb'));var squel=require(_0x605c('0xc'));var crypto=require(_0x605c('0xd'));var jsforce=require(_0x605c('0xe'));var deskjs=require(_0x605c('0xf'));var toCsv=require(_0x605c('0x9'));var querystring=require(_0x605c('0x10'));var Papa=require(_0x605c('0x11'));var Redis=require(_0x605c('0x12'));var authService=require(_0x605c('0x13'));var qs=require(_0x605c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x605c('0x15'));var logger=require(_0x605c('0x16'))('api');var utils=require(_0x605c('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x605c('0x18'))['db'];config[_0x605c('0x19')]=_['defaults'](config[_0x605c('0x19')],{'host':_0x605c('0x1a'),'port':0x18eb});var socket=require(_0x605c('0x1b'))(new Redis(config[_0x605c('0x19')]));require('./mailQueue.socket')[_0x605c('0x1c')](socket);function respondWithStatusCode(_0x4e9761,_0x109d7a){_0x109d7a=_0x109d7a||0xcc;return function(_0x4b4ad6){if(_0x4b4ad6){return _0x4e9761['sendStatus'](_0x109d7a);}return _0x4e9761[_0x605c('0x1d')](_0x109d7a)['end']();};}function respondWithResult(_0x183dbd,_0xe8b0a9){_0xe8b0a9=_0xe8b0a9||0xc8;return function(_0x570ef9){if(_0x570ef9){return _0x183dbd[_0x605c('0x1d')](_0xe8b0a9)['json'](_0x570ef9);}};}function respondWithFilteredResult(_0x33af6e,_0x1a34b8){return function(_0x209aab){if(_0x209aab){var _0x1a7cdc=typeof _0x1a34b8['offset']===_0x605c('0x1e')&&typeof _0x1a34b8['limit']===_0x605c('0x1e');var _0x3f662a=_0x209aab[_0x605c('0x1f')];var _0x23ff7c=_0x1a7cdc?0x0:_0x1a34b8[_0x605c('0x20')];var _0x4d6a81=_0x1a7cdc?_0x209aab[_0x605c('0x1f')]:_0x1a34b8[_0x605c('0x20')]+_0x1a34b8[_0x605c('0x21')];var _0x13f9cc;if(_0x4d6a81>=_0x3f662a){_0x4d6a81=_0x3f662a;_0x13f9cc=0xc8;}else{_0x13f9cc=0xce;}_0x33af6e[_0x605c('0x1d')](_0x13f9cc);return _0x33af6e['set']('Content-Range',_0x23ff7c+'-'+_0x4d6a81+'/'+_0x3f662a)[_0x605c('0x22')](_0x209aab);}return null;};}function patchUpdates(_0x2e8674){return function(_0x1a3755){try{jsonpatch['apply'](_0x1a3755,_0x2e8674,!![]);}catch(_0x494342){return BPromise['reject'](_0x494342);}return _0x1a3755['save']();};}function saveUpdates(_0x1ae034,_0x2d15bd){return function(_0x31ecd8){if(_0x31ecd8){return _0x31ecd8[_0x605c('0x23')](_0x1ae034)[_0x605c('0x24')](function(_0x5bcd7a){return _0x5bcd7a;});}return null;};}function removeEntity(_0x2cf7e0,_0x285f88){return function(_0x2bd16b){if(_0x2bd16b){return _0x2bd16b['destroy']()['then'](function(){var _0x904aca=_0x2bd16b[_0x605c('0x25')]({'plain':!![]});var _0xf9b0c5=_0x605c('0x26');return db[_0x605c('0x27')][_0x605c('0x28')]({'where':{'type':_0xf9b0c5,'resourceId':_0x904aca['id']}})[_0x605c('0x24')](function(){return _0x2bd16b;});})['then'](function(){_0x2cf7e0[_0x605c('0x1d')](0xcc)[_0x605c('0x29')]();});}};}function handleEntityNotFound(_0x1a911d,_0x167970){return function(_0xf2197){if(!_0xf2197){_0x1a911d[_0x605c('0x2a')](0x194);}return _0xf2197;};}function handleError(_0x8f0836,_0x129fd9){_0x129fd9=_0x129fd9||0x1f4;return function(_0x3fbc94){logger[_0x605c('0x2b')](_0x3fbc94['stack']);if(_0x3fbc94['name']){delete _0x3fbc94[_0x605c('0x2c')];}_0x8f0836[_0x605c('0x1d')](_0x129fd9)[_0x605c('0x2d')](_0x3fbc94);};}exports[_0x605c('0x2e')]=function(_0xa97d67,_0x535083){var _0x5b733e={},_0xb9c30b={},_0x2771c4={'count':0x0,'rows':[]};var _0x915228=_['map'](db[_0x605c('0x2f')][_0x605c('0x30')],function(_0x4a3d5a){return{'name':_0x4a3d5a[_0x605c('0x31')],'type':_0x4a3d5a[_0x605c('0x32')][_0x605c('0x33')]};});_0xb9c30b['model']=_[_0x605c('0x34')](_0x915228,'name');_0xb9c30b[_0x605c('0x35')]=_[_0x605c('0x36')](_0xa97d67[_0x605c('0x35')]);_0xb9c30b[_0x605c('0x37')]=_[_0x605c('0x38')](_0xb9c30b[_0x605c('0x39')],_0xb9c30b[_0x605c('0x35')]);_0x5b733e['attributes']=_[_0x605c('0x38')](_0xb9c30b[_0x605c('0x39')],qs[_0x605c('0x3a')](_0xa97d67[_0x605c('0x35')][_0x605c('0x3a')]));_0x5b733e[_0x605c('0x3b')]=_0x5b733e[_0x605c('0x3b')][_0x605c('0x3c')]?_0x5b733e['attributes']:_0xb9c30b[_0x605c('0x39')];if(!_0xa97d67[_0x605c('0x35')][_0x605c('0x3d')](_0x605c('0x3e'))){_0x5b733e[_0x605c('0x21')]=qs[_0x605c('0x21')](_0xa97d67[_0x605c('0x35')][_0x605c('0x21')]);_0x5b733e['offset']=qs[_0x605c('0x20')](_0xa97d67[_0x605c('0x35')][_0x605c('0x20')]);}_0x5b733e[_0x605c('0x3f')]=qs['sort'](_0xa97d67[_0x605c('0x35')][_0x605c('0x40')]);_0x5b733e['where']=qs[_0x605c('0x37')](_['pick'](_0xa97d67['query'],_0xb9c30b[_0x605c('0x37')]),_0x915228);if(_0xa97d67[_0x605c('0x35')][_0x605c('0x41')]){_0x5b733e[_0x605c('0x42')]=_[_0x605c('0x43')](_0x5b733e[_0x605c('0x42')],{'$or':_[_0x605c('0x34')](_0x915228,function(_0x564c07){if(_0x564c07[_0x605c('0x32')]!=='VIRTUAL'){var _0x57d01d={};_0x57d01d[_0x564c07[_0x605c('0x2c')]]={'$like':'%'+_0xa97d67[_0x605c('0x35')][_0x605c('0x41')]+'%'};return _0x57d01d;}})});}_0x5b733e=_[_0x605c('0x43')]({},_0x5b733e,_0xa97d67[_0x605c('0x44')]);var _0x210f0b={'where':_0x5b733e['where']};return db['MailQueue']['count'](_0x210f0b)[_0x605c('0x24')](function(_0x2ea8c7){_0x2771c4[_0x605c('0x1f')]=_0x2ea8c7;if(_0xa97d67[_0x605c('0x35')]['includeAll']){_0x5b733e['include']=[{'all':!![]}];}return db[_0x605c('0x2f')]['findAll'](_0x5b733e);})['then'](function(_0x4fd40a){_0x2771c4[_0x605c('0x45')]=_0x4fd40a;return _0x2771c4;})[_0x605c('0x24')](respondWithFilteredResult(_0x535083,_0x5b733e))[_0x605c('0x46')](handleError(_0x535083,null));};exports['show']=function(_0x5b9a3d,_0x1baf56){var _0x2fbe2d={'raw':!![],'where':{'id':_0x5b9a3d[_0x605c('0x47')]['id']}},_0x1a5152={};_0x1a5152['model']=_[_0x605c('0x36')](db[_0x605c('0x2f')][_0x605c('0x30')]);_0x1a5152[_0x605c('0x35')]=_[_0x605c('0x36')](_0x5b9a3d['query']);_0x1a5152[_0x605c('0x37')]=_[_0x605c('0x38')](_0x1a5152[_0x605c('0x39')],_0x1a5152[_0x605c('0x35')]);_0x2fbe2d[_0x605c('0x3b')]=_[_0x605c('0x38')](_0x1a5152[_0x605c('0x39')],qs[_0x605c('0x3a')](_0x5b9a3d[_0x605c('0x35')][_0x605c('0x3a')]));_0x2fbe2d['attributes']=_0x2fbe2d[_0x605c('0x3b')][_0x605c('0x3c')]?_0x2fbe2d[_0x605c('0x3b')]:_0x1a5152[_0x605c('0x39')];if(_0x5b9a3d[_0x605c('0x35')][_0x605c('0x48')]){_0x2fbe2d[_0x605c('0x49')]=[{'all':!![]}];}_0x2fbe2d=_[_0x605c('0x43')]({},_0x2fbe2d,_0x5b9a3d[_0x605c('0x44')]);return db[_0x605c('0x2f')][_0x605c('0x4a')](_0x2fbe2d)['then'](handleEntityNotFound(_0x1baf56,null))[_0x605c('0x24')](respondWithResult(_0x1baf56,null))[_0x605c('0x46')](handleError(_0x1baf56,null));};exports[_0x605c('0x4b')]=function(_0x4ef462,_0x3528b5){return db[_0x605c('0x2f')][_0x605c('0x4b')](_0x4ef462[_0x605c('0x4c')],{})[_0x605c('0x24')](function(_0x4f04ca){var _0x305073=_0x4ef462['user'][_0x605c('0x25')]({'plain':!![]});if(!_0x305073)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x305073[_0x605c('0x4d')]===_0x605c('0x4e')){var _0xdb3fa6=_0x4f04ca[_0x605c('0x25')]({'plain':!![]});var _0x12fd1e=_0x605c('0x26');return db[_0x605c('0x4f')]['find']({'where':{'name':_0x12fd1e,'userProfileId':_0x305073[_0x605c('0x50')]},'raw':!![]})['then'](function(_0x5c9e12){if(_0x5c9e12&&_0x5c9e12['autoAssociation']===0x0){return db[_0x605c('0x27')][_0x605c('0x4b')]({'name':_0xdb3fa6[_0x605c('0x2c')],'resourceId':_0xdb3fa6['id'],'type':_0x5c9e12[_0x605c('0x2c')],'sectionId':_0x5c9e12['id']},{})[_0x605c('0x24')](function(){return _0x4f04ca;});}else{return _0x4f04ca;}})[_0x605c('0x46')](function(_0x4d6104){logger[_0x605c('0x2b')](_0x605c('0x51'),_0x4d6104);throw _0x4d6104;});}return _0x4f04ca;})[_0x605c('0x24')](respondWithResult(_0x3528b5,0xc9))['catch'](handleError(_0x3528b5,null));};exports[_0x605c('0x23')]=function(_0x2fe604,_0x479bf1){if(_0x2fe604['body']['id']){delete _0x2fe604[_0x605c('0x4c')]['id'];}return db[_0x605c('0x2f')][_0x605c('0x4a')]({'where':{'id':_0x2fe604[_0x605c('0x47')]['id']}})[_0x605c('0x24')](handleEntityNotFound(_0x479bf1,null))[_0x605c('0x24')](saveUpdates(_0x2fe604['body'],null))[_0x605c('0x24')](respondWithResult(_0x479bf1,null))[_0x605c('0x46')](handleError(_0x479bf1,null));};exports[_0x605c('0x28')]=function(_0x4c0c3d,_0x457891){return db[_0x605c('0x2f')]['find']({'where':{'id':_0x4c0c3d[_0x605c('0x47')]['id']}})[_0x605c('0x24')](handleEntityNotFound(_0x457891,null))[_0x605c('0x24')](removeEntity(_0x457891,null))['catch'](handleError(_0x457891,null));};exports[_0x605c('0x52')]=function(_0x11aa55,_0x25da6f){return db['MailQueue'][_0x605c('0x52')]()[_0x605c('0x24')](respondWithResult(_0x25da6f,null))[_0x605c('0x46')](handleError(_0x25da6f,null));};exports[_0x605c('0x53')]=function(_0x2af1c8,_0x57bfe3,_0xc5a521){var _0x553d91={'raw':!![],'where':{}},_0x35af80={},_0x51ba6c;return db[_0x605c('0x2f')][_0x605c('0x54')]({'where':{'id':_0x2af1c8[_0x605c('0x47')]['id']}})[_0x605c('0x24')](handleEntityNotFound(_0x57bfe3,null))[_0x605c('0x24')](function(_0x2f5e06){if(_0x2f5e06){_0x51ba6c=_0x2f5e06[_0x605c('0x25')]({'plain':!![]});_0x35af80[_0x605c('0x39')]=_[_0x605c('0x36')](db[_0x605c('0x55')][_0x605c('0x30')]);_0x35af80['query']=_[_0x605c('0x36')](_0x2af1c8[_0x605c('0x35')]);_0x35af80[_0x605c('0x37')]=_[_0x605c('0x38')](_0x35af80[_0x605c('0x39')],_0x35af80[_0x605c('0x35')]);_0x553d91[_0x605c('0x3b')]=_[_0x605c('0x38')](_0x35af80[_0x605c('0x39')],qs[_0x605c('0x3a')](_0x2af1c8['query']['fields']));_0x553d91[_0x605c('0x3b')]=_0x553d91['attributes'][_0x605c('0x3c')]?_0x553d91[_0x605c('0x3b')]:_0x35af80[_0x605c('0x39')];if(!_0x2af1c8[_0x605c('0x35')]['hasOwnProperty'](_0x605c('0x3e'))){_0x553d91[_0x605c('0x21')]=qs['limit'](_0x2af1c8['query'][_0x605c('0x21')]);_0x553d91[_0x605c('0x20')]=qs[_0x605c('0x20')](_0x2af1c8['query']['offset']);}_0x553d91['order']=qs[_0x605c('0x40')](_0x2af1c8[_0x605c('0x35')][_0x605c('0x40')]);_0x553d91[_0x605c('0x42')]=qs['filters'](_[_0x605c('0x56')](_0x2af1c8[_0x605c('0x35')],_0x35af80[_0x605c('0x37')]));_0x553d91[_0x605c('0x42')][_0x605c('0x57')]=_0x2f5e06['id'];if(_0x2af1c8[_0x605c('0x35')][_0x605c('0x41')]){_0x553d91['where']=_['merge'](_0x553d91['where'],{'$or':_[_0x605c('0x34')](_0x553d91[_0x605c('0x3b')],function(_0x5d0629){var _0x462f04={};_0x462f04[_0x5d0629]={'$like':'%'+_0x2af1c8[_0x605c('0x35')][_0x605c('0x41')]+'%'};return _0x462f04;})});}_0x553d91=_[_0x605c('0x43')]({},_0x553d91,_0x2af1c8[_0x605c('0x44')]);return db['UserMailQueue']['findAll'](_0x553d91);}})[_0x605c('0x24')](function(_0x15970c){if(_0x15970c){return db[_0x605c('0x58')][_0x605c('0x59')]({'where':{'id':_[_0x605c('0x34')](_0x15970c,_0x605c('0x5a')),'role':_0x605c('0x5b')},'attributes':['id',_0x605c('0x2c'),_0x605c('0x5c'),_0x605c('0x5d'),_0x605c('0x5e')]});}})[_0x605c('0x24')](function(_0x238bba){if(_0x238bba){return{'count':_0x238bba['count'],'rows':_[_0x605c('0x34')](_0x238bba[_0x605c('0x45')],function(_0x2dae3e){return{'membername':_0x2dae3e[_0x605c('0x2c')],'UserId':_0x2dae3e['id'],'queue_name':_0x51ba6c['name'],'MailQueueId':_0x51ba6c['id'],'interface':util['format'](_0x605c('0x5f'),'SIP',_0x2dae3e['name']),'penalty':0x0,'paused':_0x2dae3e['mailPause'],'createdAt':_0x2dae3e[_0x605c('0x5e')],'updatedAt':_0x2dae3e[_0x605c('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x57bfe3,_0x553d91))['catch'](handleError(_0x57bfe3,null));};exports['getTeams']=function(_0x4391e1,_0x4b84c6,_0xd044c5){var _0x3575d4={};var _0x2e93df={};var _0x41055e;var _0x1a7b63;return db[_0x605c('0x2f')][_0x605c('0x54')]({'where':{'id':_0x4391e1[_0x605c('0x47')]['id']}})[_0x605c('0x24')](handleEntityNotFound(_0x4b84c6,null))['then'](function(_0x2c47ec){if(_0x2c47ec){_0x41055e=_0x2c47ec;_0x2e93df['model']=_[_0x605c('0x36')](db[_0x605c('0x60')]['rawAttributes']);_0x2e93df[_0x605c('0x35')]=_[_0x605c('0x36')](_0x4391e1[_0x605c('0x35')]);_0x2e93df[_0x605c('0x37')]=_[_0x605c('0x38')](_0x2e93df[_0x605c('0x39')],_0x2e93df[_0x605c('0x35')]);_0x3575d4[_0x605c('0x3b')]=_['intersection'](_0x2e93df[_0x605c('0x39')],qs[_0x605c('0x3a')](_0x4391e1[_0x605c('0x35')][_0x605c('0x3a')]));_0x3575d4[_0x605c('0x3b')]=_0x3575d4[_0x605c('0x3b')][_0x605c('0x3c')]?_0x3575d4[_0x605c('0x3b')]:_0x2e93df[_0x605c('0x39')];_0x3575d4['order']=qs[_0x605c('0x40')](_0x4391e1['query'][_0x605c('0x40')]);_0x3575d4[_0x605c('0x42')]=qs['filters'](_[_0x605c('0x56')](_0x4391e1['query'],_0x2e93df[_0x605c('0x37')]));if(_0x4391e1[_0x605c('0x35')][_0x605c('0x41')]){_0x3575d4[_0x605c('0x42')]=_[_0x605c('0x43')](_0x3575d4[_0x605c('0x42')],{'$or':_[_0x605c('0x34')](_0x3575d4['attributes'],function(_0x379e43){var _0x52191d={};_0x52191d[_0x379e43]={'$like':'%'+_0x4391e1[_0x605c('0x35')][_0x605c('0x41')]+'%'};return _0x52191d;})});}_0x3575d4=_[_0x605c('0x43')]({},_0x3575d4,_0x4391e1[_0x605c('0x44')]);return _0x41055e[_0x605c('0x61')](_0x3575d4);}})[_0x605c('0x24')](function(_0x3828cb){if(_0x3828cb){_0x1a7b63=_0x3828cb[_0x605c('0x3c')];if(!_0x4391e1[_0x605c('0x35')][_0x605c('0x3d')](_0x605c('0x3e'))){_0x3575d4[_0x605c('0x21')]=qs[_0x605c('0x21')](_0x4391e1[_0x605c('0x35')]['limit']);_0x3575d4['offset']=qs['offset'](_0x4391e1['query']['offset']);}return _0x41055e[_0x605c('0x61')](_0x3575d4);}})[_0x605c('0x24')](function(_0x44638d){if(_0x44638d){return _0x44638d?{'count':_0x1a7b63,'rows':_0x44638d}:null;}})[_0x605c('0x24')](respondWithResult(_0x4b84c6,null))[_0x605c('0x46')](handleError(_0x4b84c6,null));};exports['addTeams']=function(_0x257b7d,_0x5b3094,_0x434d58){var _0x321a0c=_0x257b7d[_0x605c('0x4c')]['ids'];return db['Team'][_0x605c('0x62')]({'where':{'id':_0x321a0c},'attributes':['id'],'include':[{'model':db[_0x605c('0x58')],'as':_0x605c('0x63'),'attributes':['id',_0x605c('0x2c'),_0x605c('0x64'),_0x605c('0x65'),_0x605c('0x66')],'raw':!![]}]})[_0x605c('0x24')](function(_0x4b2595){if(_0x4b2595){var _0x52aee3=_['flatMap'](_0x4b2595,function(_0x2d34b6){var _0x32c948=_0x2d34b6[_0x605c('0x25')]({'plain':!![]});return _0x32c948[_0x605c('0x63')];});return db[_0x605c('0x2f')][_0x605c('0x4a')]({'where':{'id':_0x257b7d[_0x605c('0x47')]['id']}})[_0x605c('0x24')](function(_0x1a658b){return db[_0x605c('0x67')][_0x605c('0x68')](function(_0x240aa5){return _0x1a658b[_0x605c('0x69')](_0x321a0c,{'transaction':_0x240aa5})[_0x605c('0x24')](function(){return BPromise[_0x605c('0x6a')](_0x52aee3,function(_0x4be74e){return db[_0x605c('0x55')][_0x605c('0x6b')]({'where':{'UserId':_0x4be74e['id'],'MailQueueId':_0x257b7d[_0x605c('0x47')]['id']},'transaction':_0x240aa5});});})[_0x605c('0x24')](function(){_0x52aee3[_0x605c('0x6c')](function(_0x36b0e2){socket[_0x605c('0x6d')](_0x605c('0x6e'),{'UserId':_0x36b0e2['id'],'MailQueueId':_0x1a658b['id']});});});});});}})[_0x605c('0x24')](respondWithStatusCode(_0x5b3094,null))[_0x605c('0x46')](handleError(_0x5b3094,null));};exports['removeTeams']=function(_0x5b3726,_0x5540a3,_0x340079){return db[_0x605c('0x60')][_0x605c('0x62')]({'where':{'id':_0x5b3726['query'][_0x605c('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x605c('0x58')],'as':_0x605c('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5540a3,null))[_0x605c('0x24')](function(_0x18bcab){var _0x1e6c33=_[_0x605c('0x34')](_0x18bcab,'id');var _0x33b941=[];var _0x1b595c=[];var _0xc04217=squel[_0x605c('0x70')]();_0xc04217[_0x605c('0x71')]('tq.TeamId')[_0x605c('0x72')](_0x605c('0x73'),'tq')['join'](_0x605c('0x74'),'ut',_0x605c('0x75'))[_0x605c('0x42')](_0x605c('0x76'),_0x5b3726[_0x605c('0x47')]['id']);for(var _0x3cd4c4=0x0;_0x3cd4c4<_0x18bcab[_0x605c('0x3c')];_0x3cd4c4+=0x1){let _0x46f4c4=_0x18bcab[_0x3cd4c4];for(var _0x59793d=0x0;_0x59793d<_0x46f4c4[_0x605c('0x63')]['length'];_0x59793d+=0x1){let _0x34850c=_0x46f4c4[_0x605c('0x63')][_0x59793d];var _0x3ef055=_0xc04217[_0x605c('0x77')]();_0x3ef055[_0x605c('0x42')](_0x605c('0x78'),_0x34850c['id']);_0x1b595c[_0x605c('0x79')](db[_0x605c('0x67')][_0x605c('0x35')](_0x3ef055[_0x605c('0x7a')](),{'type':db[_0x605c('0x67')][_0x605c('0x7b')][_0x605c('0x7c')]})[_0x605c('0x24')](function(_0x5addff){if(_0x5addff[_0x605c('0x3c')]===0x1){return _0x34850c['id'];}else{var _0x360d0e=_[_0x605c('0x7d')](_['map'](_0x5addff,'TeamId'),function(_0xcec918){return _[_0x605c('0x7e')](_0x1e6c33,_0xcec918);});if(_0x360d0e){return _0x34850c['id'];}}}));}}return BPromise[_0x605c('0x7f')](_0x1b595c)[_0x605c('0x24')](function(_0x3b30d3){_0x33b941=_(_0x33b941)[_0x605c('0x80')](_0x3b30d3)[_0x605c('0x81')]()[_0x605c('0x82')]();return db[_0x605c('0x2f')][_0x605c('0x4a')]({'where':{'id':_0x5b3726['params']['id']}})['then'](function(_0xfed491){return db[_0x605c('0x67')][_0x605c('0x68')](function(_0x53c8d5){return _0xfed491[_0x605c('0x83')](_0x5b3726[_0x605c('0x35')][_0x605c('0x6f')],{'transaction':_0x53c8d5})[_0x605c('0x24')](function(){if(!_[_0x605c('0x84')](_0x33b941)){return _0xfed491[_0x605c('0x85')](_0x33b941,{'transaction':_0x53c8d5});}})[_0x605c('0x24')](function(){_0x33b941[_0x605c('0x6c')](function(_0x4bee0c){socket['emit'](_0x605c('0x86'),{'UserId':_0x4bee0c,'MailQueueId':_0xfed491['id']});});});});});});})[_0x605c('0x24')](respondWithStatusCode(_0x5540a3,null))['catch'](handleError(_0x5540a3,null));};exports['addAgents']=function(_0x44d25c,_0x5d72dd,_0xe9a11b){return db[_0x605c('0x2f')][_0x605c('0x4a')]({'where':{'id':_0x44d25c[_0x605c('0x47')]['id']}})[_0x605c('0x24')](handleEntityNotFound(_0x5d72dd,null))[_0x605c('0x24')](function(_0x2e7d33){if(_0x2e7d33){return _0x2e7d33['addAgents'](_0x44d25c[_0x605c('0x4c')]['ids'],_['omit'](_0x44d25c[_0x605c('0x4c')],[_0x605c('0x6f'),'id'])||{})['spread'](function(_0x1794fa){for(var _0x14197e=0x0;_0x14197e<_0x44d25c[_0x605c('0x4c')]['ids'][_0x605c('0x3c')];_0x14197e+=0x1){socket[_0x605c('0x6d')](_0x605c('0x6e'),{'UserId':Number(_0x44d25c[_0x605c('0x4c')][_0x605c('0x6f')][_0x14197e]),'MailQueueId':Number(_0x44d25c[_0x605c('0x47')]['id'])});}return _0x1794fa;});}})[_0x605c('0x24')](respondWithResult(_0x5d72dd,null))[_0x605c('0x46')](handleError(_0x5d72dd,null));};exports[_0x605c('0x85')]=function(_0x49538c,_0xb3a7cc,_0x531d95){return db[_0x605c('0x2f')][_0x605c('0x4a')]({'where':{'id':_0x49538c['params']['id']}})[_0x605c('0x24')](handleEntityNotFound(_0xb3a7cc,null))['then'](function(_0x383f67){if(_0x383f67){return _0x383f67['removeAgents'](_0x49538c[_0x605c('0x35')][_0x605c('0x6f')])[_0x605c('0x24')](function(){if(_[_0x605c('0x87')](_0x49538c[_0x605c('0x35')][_0x605c('0x6f')])){for(var _0x5a21ab=0x0;_0x5a21ab<_0x49538c[_0x605c('0x35')][_0x605c('0x6f')][_0x605c('0x3c')];_0x5a21ab+=0x1){socket[_0x605c('0x6d')](_0x605c('0x86'),{'UserId':Number(_0x49538c[_0x605c('0x35')][_0x605c('0x6f')][_0x5a21ab]),'MailQueueId':Number(_0x49538c['params']['id'])});}}else{socket[_0x605c('0x6d')]('userMailQueue:remove',{'UserId':Number(_0x49538c[_0x605c('0x35')][_0x605c('0x6f')]),'MailQueueId':Number(_0x49538c[_0x605c('0x47')]['id'])});}});}})[_0x605c('0x24')](respondWithStatusCode(_0xb3a7cc,null))[_0x605c('0x46')](handleError(_0xb3a7cc,null));};exports[_0x605c('0x88')]=function(_0x37f7b2,_0x30a4fe,_0x5083d6){var _0x14b11b={};var _0x34c6d9={};var _0x390129;var _0x179240;return db[_0x605c('0x2f')][_0x605c('0x54')]({'where':{'id':_0x37f7b2[_0x605c('0x47')]['id']}})[_0x605c('0x24')](handleEntityNotFound(_0x30a4fe,null))[_0x605c('0x24')](function(_0x37a184){if(_0x37a184){_0x390129=_0x37a184;_0x34c6d9[_0x605c('0x39')]=_['keys'](db[_0x605c('0x58')][_0x605c('0x30')]);_0x34c6d9['query']=_[_0x605c('0x36')](_0x37f7b2[_0x605c('0x35')]);_0x34c6d9[_0x605c('0x37')]=_['intersection'](_0x34c6d9[_0x605c('0x39')],_0x34c6d9[_0x605c('0x35')]);_0x14b11b[_0x605c('0x3b')]=_[_0x605c('0x38')](_0x34c6d9[_0x605c('0x39')],qs[_0x605c('0x3a')](_0x37f7b2['query'][_0x605c('0x3a')]));_0x14b11b[_0x605c('0x3b')]=_0x14b11b[_0x605c('0x3b')]['length']?_0x14b11b[_0x605c('0x3b')]:_0x34c6d9[_0x605c('0x39')];_0x14b11b['order']=qs[_0x605c('0x40')](_0x37f7b2[_0x605c('0x35')][_0x605c('0x40')]);_0x14b11b[_0x605c('0x42')]=qs[_0x605c('0x37')](_[_0x605c('0x56')](_0x37f7b2[_0x605c('0x35')],_0x34c6d9[_0x605c('0x37')]));if(_0x37f7b2[_0x605c('0x35')][_0x605c('0x41')]){_0x14b11b['where']=_[_0x605c('0x43')](_0x14b11b['where'],{'$or':_['map'](_0x14b11b['attributes'],function(_0x5a2cfd){var _0xa1537e={};_0xa1537e[_0x5a2cfd]={'$like':'%'+_0x37f7b2[_0x605c('0x35')]['filter']+'%'};return _0xa1537e;})});}_0x14b11b=_['merge']({},_0x14b11b,_0x37f7b2['options']);return _0x390129['getAgents'](_0x14b11b);}})[_0x605c('0x24')](function(_0x2a494a){if(_0x2a494a){_0x179240=_0x2a494a['length'];if(!_0x37f7b2[_0x605c('0x35')]['hasOwnProperty'](_0x605c('0x3e'))){_0x14b11b[_0x605c('0x21')]=qs[_0x605c('0x21')](_0x37f7b2[_0x605c('0x35')][_0x605c('0x21')]);_0x14b11b[_0x605c('0x20')]=qs[_0x605c('0x20')](_0x37f7b2[_0x605c('0x35')][_0x605c('0x20')]);}return _0x390129['getAgents'](_0x14b11b);}})['then'](function(_0x6cabcc){if(_0x6cabcc){return _0x6cabcc?{'count':_0x179240,'rows':_0x6cabcc}:null;}})[_0x605c('0x24')](respondWithResult(_0x30a4fe,null))[_0x605c('0x46')](handleError(_0x30a4fe,null));};
\ No newline at end of file
+var _0xfd8e=['user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','ids','isEmpty','removeAgents','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','get','MailQueues','destroy','stack','name','send','index','MailQueue','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','describe','findOne','UserMailQueue','hasOwnProperty','pick','MailQueueId','findAll','User','findAndCountAll','agent','mailPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','voicePause','interface','Agents','sequelize','transaction','each','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','team_has_mail_queues'];(function(_0x6cb6f7,_0x19dbba){var _0x272438=function(_0x2f42c0){while(--_0x2f42c0){_0x6cb6f7['push'](_0x6cb6f7['shift']());}};_0x272438(++_0x19dbba);}(_0xfd8e,0xa4));var _0xefd8=function(_0x3d62d9,_0x273e7b){_0x3d62d9=_0x3d62d9-0x0;var _0x37dc04=_0xfd8e[_0x3d62d9];return _0x37dc04;};'use strict';var emlformat=require(_0xefd8('0x0'));var rimraf=require(_0xefd8('0x1'));var zipdir=require(_0xefd8('0x2'));var jsonpatch=require(_0xefd8('0x3'));var rp=require(_0xefd8('0x4'));var moment=require(_0xefd8('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xefd8('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xefd8('0x7'));var _=require(_0xefd8('0x8'));var squel=require(_0xefd8('0x9'));var crypto=require(_0xefd8('0xa'));var jsforce=require(_0xefd8('0xb'));var deskjs=require(_0xefd8('0xc'));var toCsv=require(_0xefd8('0xd'));var querystring=require(_0xefd8('0xe'));var Papa=require(_0xefd8('0xf'));var Redis=require(_0xefd8('0x10'));var authService=require(_0xefd8('0x11'));var qs=require(_0xefd8('0x12'));var as=require(_0xefd8('0x13'));var hardwareService=require(_0xefd8('0x14'));var logger=require(_0xefd8('0x15'))(_0xefd8('0x16'));var utils=require(_0xefd8('0x17'));var config=require(_0xefd8('0x18'));var licenseUtil=require(_0xefd8('0x19'));var db=require('../../mysqldb')['db'];config[_0xefd8('0x1a')]=_[_0xefd8('0x1b')](config['redis'],{'host':_0xefd8('0x1c'),'port':0x18eb});var socket=require(_0xefd8('0x1d'))(new Redis(config[_0xefd8('0x1a')]));require('./mailQueue.socket')['register'](socket);function respondWithStatusCode(_0x4eaed2,_0x3b9ce9){_0x3b9ce9=_0x3b9ce9||0xcc;return function(_0x3bb664){if(_0x3bb664){return _0x4eaed2[_0xefd8('0x1e')](_0x3b9ce9);}return _0x4eaed2[_0xefd8('0x1f')](_0x3b9ce9)[_0xefd8('0x20')]();};}function respondWithResult(_0x809809,_0x182cb6){_0x182cb6=_0x182cb6||0xc8;return function(_0x6b7cd1){if(_0x6b7cd1){return _0x809809[_0xefd8('0x1f')](_0x182cb6)['json'](_0x6b7cd1);}};}function respondWithFilteredResult(_0x46f2dd,_0x5bc341){return function(_0x34ff92){if(_0x34ff92){var _0x3dec90=typeof _0x5bc341[_0xefd8('0x21')]===_0xefd8('0x22')&&typeof _0x5bc341[_0xefd8('0x23')]==='undefined';var _0x350fe5=_0x34ff92[_0xefd8('0x24')];var _0x23ef4a=_0x3dec90?0x0:_0x5bc341['offset'];var _0x88f9f=_0x3dec90?_0x34ff92[_0xefd8('0x24')]:_0x5bc341[_0xefd8('0x21')]+_0x5bc341[_0xefd8('0x23')];var _0x28c271;if(_0x88f9f>=_0x350fe5){_0x88f9f=_0x350fe5;_0x28c271=0xc8;}else{_0x28c271=0xce;}_0x46f2dd[_0xefd8('0x1f')](_0x28c271);return _0x46f2dd[_0xefd8('0x25')](_0xefd8('0x26'),_0x23ef4a+'-'+_0x88f9f+'/'+_0x350fe5)[_0xefd8('0x27')](_0x34ff92);}return null;};}function patchUpdates(_0x33e8c2){return function(_0x4aaca1){try{jsonpatch[_0xefd8('0x28')](_0x4aaca1,_0x33e8c2,!![]);}catch(_0x3f4e16){return BPromise[_0xefd8('0x29')](_0x3f4e16);}return _0x4aaca1[_0xefd8('0x2a')]();};}function saveUpdates(_0x3c480a,_0x4c7f21){return function(_0x269bdd){if(_0x269bdd){return _0x269bdd['update'](_0x3c480a)[_0xefd8('0x2b')](function(_0xae7593){return _0xae7593;});}return null;};}function removeEntity(_0x1a200e,_0x315738){return function(_0x30ef67){if(_0x30ef67){return _0x30ef67['destroy']()[_0xefd8('0x2b')](function(){var _0x2cd4d5=_0x30ef67[_0xefd8('0x2c')]({'plain':!![]});var _0x254555=_0xefd8('0x2d');return db['UserProfileResource'][_0xefd8('0x2e')]({'where':{'type':_0x254555,'resourceId':_0x2cd4d5['id']}})[_0xefd8('0x2b')](function(){return _0x30ef67;});})['then'](function(){_0x1a200e[_0xefd8('0x1f')](0xcc)[_0xefd8('0x20')]();});}};}function handleEntityNotFound(_0x2f1f38,_0x235875){return function(_0x42dfca){if(!_0x42dfca){_0x2f1f38['sendStatus'](0x194);}return _0x42dfca;};}function handleError(_0x8a35bb,_0x14345c){_0x14345c=_0x14345c||0x1f4;return function(_0x1ffbaf){logger['error'](_0x1ffbaf[_0xefd8('0x2f')]);if(_0x1ffbaf[_0xefd8('0x30')]){delete _0x1ffbaf[_0xefd8('0x30')];}_0x8a35bb[_0xefd8('0x1f')](_0x14345c)[_0xefd8('0x31')](_0x1ffbaf);};}exports[_0xefd8('0x32')]=function(_0xaeb1f6,_0x37c53b){var _0xd01ea7={},_0x21e9d4={},_0x458cae={'count':0x0,'rows':[]};var _0x3e6a07=_['map'](db[_0xefd8('0x33')][_0xefd8('0x34')],function(_0x2cba6f){return{'name':_0x2cba6f[_0xefd8('0x35')],'type':_0x2cba6f[_0xefd8('0x36')][_0xefd8('0x37')]};});_0x21e9d4['model']=_[_0xefd8('0x38')](_0x3e6a07,_0xefd8('0x30'));_0x21e9d4[_0xefd8('0x39')]=_[_0xefd8('0x3a')](_0xaeb1f6[_0xefd8('0x39')]);_0x21e9d4[_0xefd8('0x3b')]=_['intersection'](_0x21e9d4[_0xefd8('0x3c')],_0x21e9d4[_0xefd8('0x39')]);_0xd01ea7[_0xefd8('0x3d')]=_[_0xefd8('0x3e')](_0x21e9d4[_0xefd8('0x3c')],qs[_0xefd8('0x3f')](_0xaeb1f6[_0xefd8('0x39')][_0xefd8('0x3f')]));_0xd01ea7[_0xefd8('0x3d')]=_0xd01ea7[_0xefd8('0x3d')][_0xefd8('0x40')]?_0xd01ea7[_0xefd8('0x3d')]:_0x21e9d4['model'];if(!_0xaeb1f6[_0xefd8('0x39')]['hasOwnProperty'](_0xefd8('0x41'))){_0xd01ea7[_0xefd8('0x23')]=qs[_0xefd8('0x23')](_0xaeb1f6[_0xefd8('0x39')][_0xefd8('0x23')]);_0xd01ea7['offset']=qs[_0xefd8('0x21')](_0xaeb1f6[_0xefd8('0x39')][_0xefd8('0x21')]);}_0xd01ea7[_0xefd8('0x42')]=qs[_0xefd8('0x43')](_0xaeb1f6[_0xefd8('0x39')]['sort']);_0xd01ea7[_0xefd8('0x44')]=qs[_0xefd8('0x3b')](_['pick'](_0xaeb1f6[_0xefd8('0x39')],_0x21e9d4[_0xefd8('0x3b')]),_0x3e6a07);if(_0xaeb1f6[_0xefd8('0x39')][_0xefd8('0x45')]){_0xd01ea7[_0xefd8('0x44')]=_[_0xefd8('0x46')](_0xd01ea7[_0xefd8('0x44')],{'$or':_[_0xefd8('0x38')](_0x3e6a07,function(_0x3db69e){if(_0x3db69e[_0xefd8('0x36')]!==_0xefd8('0x47')){var _0x2d5f7a={};_0x2d5f7a[_0x3db69e[_0xefd8('0x30')]]={'$like':'%'+_0xaeb1f6[_0xefd8('0x39')][_0xefd8('0x45')]+'%'};return _0x2d5f7a;}})});}_0xd01ea7=_['merge']({},_0xd01ea7,_0xaeb1f6[_0xefd8('0x48')]);var _0x109025={'where':_0xd01ea7['where']};return db[_0xefd8('0x33')][_0xefd8('0x24')](_0x109025)[_0xefd8('0x2b')](function(_0x1754e4){_0x458cae[_0xefd8('0x24')]=_0x1754e4;if(_0xaeb1f6[_0xefd8('0x39')][_0xefd8('0x49')]){_0xd01ea7[_0xefd8('0x4a')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0xd01ea7);})[_0xefd8('0x2b')](function(_0x159b88){_0x458cae[_0xefd8('0x4b')]=_0x159b88;return _0x458cae;})[_0xefd8('0x2b')](respondWithFilteredResult(_0x37c53b,_0xd01ea7))[_0xefd8('0x4c')](handleError(_0x37c53b,null));};exports[_0xefd8('0x4d')]=function(_0x233079,_0x453c98){var _0x28c95d={'raw':!![],'where':{'id':_0x233079[_0xefd8('0x4e')]['id']}},_0x146f57={};_0x146f57['model']=_['keys'](db[_0xefd8('0x33')][_0xefd8('0x34')]);_0x146f57[_0xefd8('0x39')]=_[_0xefd8('0x3a')](_0x233079['query']);_0x146f57[_0xefd8('0x3b')]=_[_0xefd8('0x3e')](_0x146f57[_0xefd8('0x3c')],_0x146f57['query']);_0x28c95d['attributes']=_[_0xefd8('0x3e')](_0x146f57[_0xefd8('0x3c')],qs[_0xefd8('0x3f')](_0x233079[_0xefd8('0x39')][_0xefd8('0x3f')]));_0x28c95d[_0xefd8('0x3d')]=_0x28c95d[_0xefd8('0x3d')][_0xefd8('0x40')]?_0x28c95d[_0xefd8('0x3d')]:_0x146f57[_0xefd8('0x3c')];if(_0x233079[_0xefd8('0x39')][_0xefd8('0x49')]){_0x28c95d['include']=[{'all':!![]}];}_0x28c95d=_[_0xefd8('0x46')]({},_0x28c95d,_0x233079[_0xefd8('0x48')]);return db['MailQueue']['find'](_0x28c95d)[_0xefd8('0x2b')](handleEntityNotFound(_0x453c98,null))[_0xefd8('0x2b')](respondWithResult(_0x453c98,null))[_0xefd8('0x4c')](handleError(_0x453c98,null));};exports[_0xefd8('0x4f')]=function(_0x28dc2c,_0x2b2df2){return db[_0xefd8('0x33')][_0xefd8('0x4f')](_0x28dc2c[_0xefd8('0x50')],{})[_0xefd8('0x2b')](function(_0x374661){var _0x316f8f=_0x28dc2c[_0xefd8('0x51')][_0xefd8('0x2c')]({'plain':!![]});if(!_0x316f8f)throw new Error(_0xefd8('0x52'));if(_0x316f8f[_0xefd8('0x53')]===_0xefd8('0x51')){var _0x1c626c=_0x374661[_0xefd8('0x2c')]({'plain':!![]});var _0x668f24=_0xefd8('0x2d');return db['UserProfileSection']['find']({'where':{'name':_0x668f24,'userProfileId':_0x316f8f[_0xefd8('0x54')]},'raw':!![]})[_0xefd8('0x2b')](function(_0x191860){if(_0x191860&&_0x191860['autoAssociation']===0x0){return db[_0xefd8('0x55')][_0xefd8('0x4f')]({'name':_0x1c626c[_0xefd8('0x30')],'resourceId':_0x1c626c['id'],'type':_0x191860['name'],'sectionId':_0x191860['id']},{})['then'](function(){return _0x374661;});}else{return _0x374661;}})[_0xefd8('0x4c')](function(_0x264fcf){logger[_0xefd8('0x56')](_0xefd8('0x57'),_0x264fcf);throw _0x264fcf;});}return _0x374661;})['then'](respondWithResult(_0x2b2df2,0xc9))[_0xefd8('0x4c')](handleError(_0x2b2df2,null));};exports[_0xefd8('0x58')]=function(_0x5ac7fb,_0x509de5){if(_0x5ac7fb[_0xefd8('0x50')]['id']){delete _0x5ac7fb['body']['id'];}return db['MailQueue']['find']({'where':{'id':_0x5ac7fb[_0xefd8('0x4e')]['id']}})[_0xefd8('0x2b')](handleEntityNotFound(_0x509de5,null))[_0xefd8('0x2b')](saveUpdates(_0x5ac7fb[_0xefd8('0x50')],null))['then'](respondWithResult(_0x509de5,null))[_0xefd8('0x4c')](handleError(_0x509de5,null));};exports['destroy']=function(_0x271c9f,_0x3591d5){return db[_0xefd8('0x33')][_0xefd8('0x59')]({'where':{'id':_0x271c9f['params']['id']}})[_0xefd8('0x2b')](handleEntityNotFound(_0x3591d5,null))[_0xefd8('0x2b')](removeEntity(_0x3591d5,null))[_0xefd8('0x4c')](handleError(_0x3591d5,null));};exports[_0xefd8('0x5a')]=function(_0x4deb5e,_0x301bae){return db[_0xefd8('0x33')][_0xefd8('0x5a')]()['then'](respondWithResult(_0x301bae,null))[_0xefd8('0x4c')](handleError(_0x301bae,null));};exports['getMembers']=function(_0xd807c9,_0x48c847,_0x5e4985){var _0xc560ef={'raw':!![],'where':{}},_0x328088={},_0x2bd13e;return db[_0xefd8('0x33')][_0xefd8('0x5b')]({'where':{'id':_0xd807c9[_0xefd8('0x4e')]['id']}})[_0xefd8('0x2b')](handleEntityNotFound(_0x48c847,null))[_0xefd8('0x2b')](function(_0x40a7c9){if(_0x40a7c9){_0x2bd13e=_0x40a7c9['get']({'plain':!![]});_0x328088[_0xefd8('0x3c')]=_[_0xefd8('0x3a')](db[_0xefd8('0x5c')][_0xefd8('0x34')]);_0x328088[_0xefd8('0x39')]=_[_0xefd8('0x3a')](_0xd807c9[_0xefd8('0x39')]);_0x328088['filters']=_[_0xefd8('0x3e')](_0x328088[_0xefd8('0x3c')],_0x328088[_0xefd8('0x39')]);_0xc560ef[_0xefd8('0x3d')]=_[_0xefd8('0x3e')](_0x328088[_0xefd8('0x3c')],qs[_0xefd8('0x3f')](_0xd807c9[_0xefd8('0x39')]['fields']));_0xc560ef[_0xefd8('0x3d')]=_0xc560ef[_0xefd8('0x3d')][_0xefd8('0x40')]?_0xc560ef['attributes']:_0x328088['model'];if(!_0xd807c9[_0xefd8('0x39')][_0xefd8('0x5d')](_0xefd8('0x41'))){_0xc560ef[_0xefd8('0x23')]=qs['limit'](_0xd807c9[_0xefd8('0x39')][_0xefd8('0x23')]);_0xc560ef['offset']=qs[_0xefd8('0x21')](_0xd807c9['query'][_0xefd8('0x21')]);}_0xc560ef['order']=qs[_0xefd8('0x43')](_0xd807c9[_0xefd8('0x39')][_0xefd8('0x43')]);_0xc560ef[_0xefd8('0x44')]=qs[_0xefd8('0x3b')](_[_0xefd8('0x5e')](_0xd807c9['query'],_0x328088[_0xefd8('0x3b')]));_0xc560ef[_0xefd8('0x44')][_0xefd8('0x5f')]=_0x40a7c9['id'];if(_0xd807c9[_0xefd8('0x39')]['filter']){_0xc560ef[_0xefd8('0x44')]=_[_0xefd8('0x46')](_0xc560ef['where'],{'$or':_[_0xefd8('0x38')](_0xc560ef[_0xefd8('0x3d')],function(_0x5759e7){var _0x4d60e8={};_0x4d60e8[_0x5759e7]={'$like':'%'+_0xd807c9[_0xefd8('0x39')][_0xefd8('0x45')]+'%'};return _0x4d60e8;})});}_0xc560ef=_[_0xefd8('0x46')]({},_0xc560ef,_0xd807c9[_0xefd8('0x48')]);return db[_0xefd8('0x5c')][_0xefd8('0x60')](_0xc560ef);}})['then'](function(_0x1d1081){if(_0x1d1081){return db[_0xefd8('0x61')][_0xefd8('0x62')]({'where':{'id':_[_0xefd8('0x38')](_0x1d1081,'UserId'),'role':_0xefd8('0x63')},'attributes':['id',_0xefd8('0x30'),_0xefd8('0x64'),'updatedAt',_0xefd8('0x65')]});}})['then'](function(_0x524dd9){if(_0x524dd9){return{'count':_0x524dd9[_0xefd8('0x24')],'rows':_['map'](_0x524dd9[_0xefd8('0x4b')],function(_0x334a0e){return{'membername':_0x334a0e[_0xefd8('0x30')],'UserId':_0x334a0e['id'],'queue_name':_0x2bd13e['name'],'MailQueueId':_0x2bd13e['id'],'interface':util[_0xefd8('0x66')](_0xefd8('0x67'),_0xefd8('0x68'),_0x334a0e['name']),'penalty':0x0,'paused':_0x334a0e['mailPause'],'createdAt':_0x334a0e[_0xefd8('0x65')],'updatedAt':_0x334a0e[_0xefd8('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x48c847,_0xc560ef))[_0xefd8('0x4c')](handleError(_0x48c847,null));};exports['getTeams']=function(_0x307cd2,_0x52fca1,_0x8c8c65){var _0x3e4cea={};var _0x2650b7={};var _0xadf78d;var _0x532bde;return db[_0xefd8('0x33')][_0xefd8('0x5b')]({'where':{'id':_0x307cd2[_0xefd8('0x4e')]['id']}})[_0xefd8('0x2b')](handleEntityNotFound(_0x52fca1,null))[_0xefd8('0x2b')](function(_0x3ba40f){if(_0x3ba40f){_0xadf78d=_0x3ba40f;_0x2650b7[_0xefd8('0x3c')]=_[_0xefd8('0x3a')](db[_0xefd8('0x6a')][_0xefd8('0x34')]);_0x2650b7[_0xefd8('0x39')]=_[_0xefd8('0x3a')](_0x307cd2[_0xefd8('0x39')]);_0x2650b7[_0xefd8('0x3b')]=_[_0xefd8('0x3e')](_0x2650b7[_0xefd8('0x3c')],_0x2650b7['query']);_0x3e4cea['attributes']=_['intersection'](_0x2650b7['model'],qs['fields'](_0x307cd2[_0xefd8('0x39')][_0xefd8('0x3f')]));_0x3e4cea[_0xefd8('0x3d')]=_0x3e4cea[_0xefd8('0x3d')][_0xefd8('0x40')]?_0x3e4cea[_0xefd8('0x3d')]:_0x2650b7[_0xefd8('0x3c')];_0x3e4cea[_0xefd8('0x42')]=qs[_0xefd8('0x43')](_0x307cd2[_0xefd8('0x39')]['sort']);_0x3e4cea['where']=qs[_0xefd8('0x3b')](_[_0xefd8('0x5e')](_0x307cd2[_0xefd8('0x39')],_0x2650b7['filters']));if(_0x307cd2[_0xefd8('0x39')]['filter']){_0x3e4cea[_0xefd8('0x44')]=_['merge'](_0x3e4cea[_0xefd8('0x44')],{'$or':_['map'](_0x3e4cea[_0xefd8('0x3d')],function(_0x20a296){var _0x2742a8={};_0x2742a8[_0x20a296]={'$like':'%'+_0x307cd2[_0xefd8('0x39')]['filter']+'%'};return _0x2742a8;})});}_0x3e4cea=_[_0xefd8('0x46')]({},_0x3e4cea,_0x307cd2[_0xefd8('0x48')]);return _0xadf78d[_0xefd8('0x6b')](_0x3e4cea);}})['then'](function(_0x240220){if(_0x240220){_0x532bde=_0x240220[_0xefd8('0x40')];if(!_0x307cd2[_0xefd8('0x39')][_0xefd8('0x5d')]('nolimit')){_0x3e4cea[_0xefd8('0x23')]=qs[_0xefd8('0x23')](_0x307cd2[_0xefd8('0x39')][_0xefd8('0x23')]);_0x3e4cea[_0xefd8('0x21')]=qs['offset'](_0x307cd2[_0xefd8('0x39')][_0xefd8('0x21')]);}return _0xadf78d[_0xefd8('0x6b')](_0x3e4cea);}})[_0xefd8('0x2b')](function(_0x14e2f5){if(_0x14e2f5){return _0x14e2f5?{'count':_0x532bde,'rows':_0x14e2f5}:null;}})[_0xefd8('0x2b')](respondWithResult(_0x52fca1,null))[_0xefd8('0x4c')](handleError(_0x52fca1,null));};exports[_0xefd8('0x6c')]=function(_0x30ce13,_0x5e49ff,_0x5ebf90){var _0x5b3438=_0x30ce13[_0xefd8('0x50')]['ids'];return db['Team']['findAll']({'where':{'id':_0x5b3438},'attributes':['id'],'include':[{'model':db[_0xefd8('0x61')],'as':'Agents','attributes':['id',_0xefd8('0x30'),'online',_0xefd8('0x6d'),_0xefd8('0x6e')],'raw':!![]}]})[_0xefd8('0x2b')](function(_0x4c8d61){if(_0x4c8d61){var _0x2484a5=_['flatMap'](_0x4c8d61,function(_0x22590a){var _0x1fb367=_0x22590a['get']({'plain':!![]});return _0x1fb367[_0xefd8('0x6f')];});return db['MailQueue'][_0xefd8('0x59')]({'where':{'id':_0x30ce13[_0xefd8('0x4e')]['id']}})['then'](function(_0x7172a9){return db[_0xefd8('0x70')][_0xefd8('0x71')](function(_0x3b6c7d){return _0x7172a9[_0xefd8('0x6c')](_0x5b3438,{'transaction':_0x3b6c7d})[_0xefd8('0x2b')](function(){return BPromise[_0xefd8('0x72')](_0x2484a5,function(_0x115810){return db[_0xefd8('0x5c')]['findOrCreate']({'where':{'UserId':_0x115810['id'],'MailQueueId':_0x30ce13[_0xefd8('0x4e')]['id']},'transaction':_0x3b6c7d});});})[_0xefd8('0x2b')](function(){_0x2484a5['forEach'](function(_0x28fe25){socket[_0xefd8('0x73')](_0xefd8('0x74'),{'UserId':_0x28fe25['id'],'MailQueueId':_0x7172a9['id']});});});});});}})[_0xefd8('0x2b')](respondWithStatusCode(_0x5e49ff,null))[_0xefd8('0x4c')](handleError(_0x5e49ff,null));};exports[_0xefd8('0x75')]=function(_0x4e5041,_0xc21ea4,_0x10697d){return db[_0xefd8('0x6a')][_0xefd8('0x60')]({'where':{'id':_0x4e5041[_0xefd8('0x39')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xefd8('0x2b')](handleEntityNotFound(_0xc21ea4,null))[_0xefd8('0x2b')](function(_0x1696a7){var _0x4108c2=_[_0xefd8('0x38')](_0x1696a7,'id');var _0x149a01=[];var _0x17667c=[];var _0x4a782a=squel[_0xefd8('0x76')]();_0x4a782a[_0xefd8('0x77')](_0xefd8('0x78'))['from'](_0xefd8('0x79'),'tq')['join'](_0xefd8('0x7a'),'ut',_0xefd8('0x7b'))[_0xefd8('0x44')](_0xefd8('0x7c'),_0x4e5041[_0xefd8('0x4e')]['id']);for(var _0x165ab1=0x0;_0x165ab1<_0x1696a7[_0xefd8('0x40')];_0x165ab1+=0x1){let _0x5b2b27=_0x1696a7[_0x165ab1];for(var _0x4e3a5b=0x0;_0x4e3a5b<_0x5b2b27[_0xefd8('0x6f')]['length'];_0x4e3a5b+=0x1){let _0x284614=_0x5b2b27[_0xefd8('0x6f')][_0x4e3a5b];var _0x318c8d=_0x4a782a[_0xefd8('0x7d')]();_0x318c8d[_0xefd8('0x44')]('ut.UserId\x20=\x20?',_0x284614['id']);_0x17667c['push'](db[_0xefd8('0x70')][_0xefd8('0x39')](_0x318c8d[_0xefd8('0x7e')](),{'type':db[_0xefd8('0x70')][_0xefd8('0x7f')][_0xefd8('0x80')]})[_0xefd8('0x2b')](function(_0x27bf7a){if(_0x27bf7a['length']===0x1){return _0x284614['id'];}else{var _0x971233=_[_0xefd8('0x81')](_[_0xefd8('0x38')](_0x27bf7a,_0xefd8('0x82')),function(_0x25a99b){return _[_0xefd8('0x83')](_0x4108c2,_0x25a99b);});if(_0x971233){return _0x284614['id'];}}}));}}return BPromise['all'](_0x17667c)[_0xefd8('0x2b')](function(_0x30def5){_0x149a01=_(_0x149a01)[_0xefd8('0x84')](_0x30def5)['compact']()[_0xefd8('0x85')]();return db[_0xefd8('0x33')][_0xefd8('0x59')]({'where':{'id':_0x4e5041[_0xefd8('0x4e')]['id']}})[_0xefd8('0x2b')](function(_0x103fe2){return db[_0xefd8('0x70')]['transaction'](function(_0x33e2b2){return _0x103fe2['removeTeams'](_0x4e5041[_0xefd8('0x39')][_0xefd8('0x86')],{'transaction':_0x33e2b2})[_0xefd8('0x2b')](function(){if(!_[_0xefd8('0x87')](_0x149a01)){return _0x103fe2[_0xefd8('0x88')](_0x149a01,{'transaction':_0x33e2b2});}})[_0xefd8('0x2b')](function(){_0x149a01['forEach'](function(_0x9e8883){socket['emit']('userMailQueue:remove',{'UserId':_0x9e8883,'MailQueueId':_0x103fe2['id']});});});});});});})['then'](respondWithStatusCode(_0xc21ea4,null))[_0xefd8('0x4c')](handleError(_0xc21ea4,null));};exports['addAgents']=function(_0x1f313d,_0x46718b,_0x51ed63){return db[_0xefd8('0x33')]['find']({'where':{'id':_0x1f313d[_0xefd8('0x4e')]['id']}})['then'](handleEntityNotFound(_0x46718b,null))['then'](function(_0x1c2a2f){if(_0x1c2a2f){return _0x1c2a2f[_0xefd8('0x89')](_0x1f313d[_0xefd8('0x50')][_0xefd8('0x86')],_[_0xefd8('0x8a')](_0x1f313d[_0xefd8('0x50')],['ids','id'])||{})[_0xefd8('0x8b')](function(_0x56ed42){for(var _0x2ebcb0=0x0;_0x2ebcb0<_0x1f313d[_0xefd8('0x50')]['ids'][_0xefd8('0x40')];_0x2ebcb0+=0x1){socket[_0xefd8('0x73')](_0xefd8('0x74'),{'UserId':Number(_0x1f313d[_0xefd8('0x50')][_0xefd8('0x86')][_0x2ebcb0]),'MailQueueId':Number(_0x1f313d[_0xefd8('0x4e')]['id'])});}return _0x56ed42;});}})[_0xefd8('0x2b')](respondWithResult(_0x46718b,null))['catch'](handleError(_0x46718b,null));};exports[_0xefd8('0x88')]=function(_0x5e3b8e,_0x2f572b,_0x2ec083){return db[_0xefd8('0x33')][_0xefd8('0x59')]({'where':{'id':_0x5e3b8e[_0xefd8('0x4e')]['id']}})[_0xefd8('0x2b')](handleEntityNotFound(_0x2f572b,null))[_0xefd8('0x2b')](function(_0x18909b){if(_0x18909b){return _0x18909b[_0xefd8('0x88')](_0x5e3b8e[_0xefd8('0x39')][_0xefd8('0x86')])[_0xefd8('0x2b')](function(){if(_[_0xefd8('0x8c')](_0x5e3b8e[_0xefd8('0x39')]['ids'])){for(var _0x3c4bbc=0x0;_0x3c4bbc<_0x5e3b8e[_0xefd8('0x39')][_0xefd8('0x86')]['length'];_0x3c4bbc+=0x1){socket[_0xefd8('0x73')](_0xefd8('0x8d'),{'UserId':Number(_0x5e3b8e[_0xefd8('0x39')][_0xefd8('0x86')][_0x3c4bbc]),'MailQueueId':Number(_0x5e3b8e[_0xefd8('0x4e')]['id'])});}}else{socket[_0xefd8('0x73')](_0xefd8('0x8d'),{'UserId':Number(_0x5e3b8e[_0xefd8('0x39')][_0xefd8('0x86')]),'MailQueueId':Number(_0x5e3b8e['params']['id'])});}});}})[_0xefd8('0x2b')](respondWithStatusCode(_0x2f572b,null))['catch'](handleError(_0x2f572b,null));};exports['getAgents']=function(_0x4a55c6,_0x1c7549,_0x1d4111){var _0x46b9ed={};var _0x50d8e9={};var _0x3cafa3;var _0x55b610;return db[_0xefd8('0x33')][_0xefd8('0x5b')]({'where':{'id':_0x4a55c6[_0xefd8('0x4e')]['id']}})[_0xefd8('0x2b')](handleEntityNotFound(_0x1c7549,null))[_0xefd8('0x2b')](function(_0xaac8c5){if(_0xaac8c5){_0x3cafa3=_0xaac8c5;_0x50d8e9['model']=_[_0xefd8('0x3a')](db[_0xefd8('0x61')][_0xefd8('0x34')]);_0x50d8e9[_0xefd8('0x39')]=_['keys'](_0x4a55c6[_0xefd8('0x39')]);_0x50d8e9[_0xefd8('0x3b')]=_[_0xefd8('0x3e')](_0x50d8e9['model'],_0x50d8e9[_0xefd8('0x39')]);_0x46b9ed[_0xefd8('0x3d')]=_['intersection'](_0x50d8e9['model'],qs[_0xefd8('0x3f')](_0x4a55c6[_0xefd8('0x39')]['fields']));_0x46b9ed[_0xefd8('0x3d')]=_0x46b9ed['attributes']['length']?_0x46b9ed['attributes']:_0x50d8e9[_0xefd8('0x3c')];_0x46b9ed[_0xefd8('0x42')]=qs[_0xefd8('0x43')](_0x4a55c6[_0xefd8('0x39')][_0xefd8('0x43')]);_0x46b9ed[_0xefd8('0x44')]=qs[_0xefd8('0x3b')](_[_0xefd8('0x5e')](_0x4a55c6['query'],_0x50d8e9[_0xefd8('0x3b')]));if(_0x4a55c6[_0xefd8('0x39')][_0xefd8('0x45')]){_0x46b9ed['where']=_['merge'](_0x46b9ed[_0xefd8('0x44')],{'$or':_[_0xefd8('0x38')](_0x46b9ed[_0xefd8('0x3d')],function(_0x5090ae){var _0x3caca6={};_0x3caca6[_0x5090ae]={'$like':'%'+_0x4a55c6['query'][_0xefd8('0x45')]+'%'};return _0x3caca6;})});}_0x46b9ed=_[_0xefd8('0x46')]({},_0x46b9ed,_0x4a55c6[_0xefd8('0x48')]);return _0x3cafa3[_0xefd8('0x8e')](_0x46b9ed);}})[_0xefd8('0x2b')](function(_0x5f00cb){if(_0x5f00cb){_0x55b610=_0x5f00cb[_0xefd8('0x40')];if(!_0x4a55c6['query'][_0xefd8('0x5d')](_0xefd8('0x41'))){_0x46b9ed[_0xefd8('0x23')]=qs[_0xefd8('0x23')](_0x4a55c6[_0xefd8('0x39')]['limit']);_0x46b9ed['offset']=qs[_0xefd8('0x21')](_0x4a55c6[_0xefd8('0x39')][_0xefd8('0x21')]);}return _0x3cafa3[_0xefd8('0x8e')](_0x46b9ed);}})['then'](function(_0x4d7359){if(_0x4d7359){return _0x4d7359?{'count':_0x55b610,'rows':_0x4d7359}:null;}})[_0xefd8('0x2b')](respondWithResult(_0x1c7549,null))['catch'](handleError(_0x1c7549,null));};
\ No newline at end of file
index 6dd7faf..56d3236 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89f7=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','save','update','remove'];(function(_0x49226a,_0x35a205){var _0x335689=function(_0xcbae1e){while(--_0xcbae1e){_0x49226a['push'](_0x49226a['shift']());}};_0x335689(++_0x35a205);}(_0x89f7,0xa4));var _0x789f=function(_0x18c4a8,_0x96c52e){_0x18c4a8=_0x18c4a8-0x0;var _0x189ff1=_0x89f7[_0x18c4a8];return _0x189ff1;};'use strict';var EventEmitter=require(_0x789f('0x0'));var MailQueue=require(_0x789f('0x1'))['db'][_0x789f('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x789f('0x3'),'afterUpdate':_0x789f('0x4'),'afterDestroy':_0x789f('0x5')};function emitEvent(_0x523b69){return function(_0x24e6e9,_0x56ec57,_0x3608af){MailQueueEvents[_0x789f('0x6')](_0x523b69+':'+_0x24e6e9['id'],_0x24e6e9);MailQueueEvents[_0x789f('0x6')](_0x523b69,_0x24e6e9);_0x3608af(null);};}for(var e in events){if(events[_0x789f('0x7')](e)){var event=events[e];MailQueue[_0x789f('0x8')](e,emitEvent(event));}}module[_0x789f('0x9')]=MailQueueEvents;
\ No newline at end of file
+var _0x4086=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners'];(function(_0x261b79,_0x455eb2){var _0x57b634=function(_0x20662b){while(--_0x20662b){_0x261b79['push'](_0x261b79['shift']());}};_0x57b634(++_0x455eb2);}(_0x4086,0xc2));var _0x6408=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4086[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require(_0x6408('0x0'));var MailQueue=require(_0x6408('0x1'))['db'][_0x6408('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x6408('0x3')](0x0);var events={'afterCreate':_0x6408('0x4'),'afterUpdate':_0x6408('0x5'),'afterDestroy':_0x6408('0x6')};function emitEvent(_0x42d8b7){return function(_0x6cdf30,_0x379935,_0x23097b){MailQueueEvents[_0x6408('0x7')](_0x42d8b7+':'+_0x6cdf30['id'],_0x6cdf30);MailQueueEvents[_0x6408('0x7')](_0x42d8b7,_0x6cdf30);_0x23097b(null);};}for(var e in events){if(events[_0x6408('0x8')](e)){var event=events[e];MailQueue[_0x6408('0x9')](e,emitEvent(event));}}module[_0x6408('0xa')]=MailQueueEvents;
\ No newline at end of file
index 65fe7a8..ea76835 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef8=['util','api','bluebird','request-promise','rimraf','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash'];(function(_0x185a5a,_0x19442b){var _0x39bd2d=function(_0xfe0213){while(--_0xfe0213){_0x185a5a['push'](_0x185a5a['shift']());}};_0x39bd2d(++_0x19442b);}(_0x2ef8,0x1e3));var _0x82ef=function(_0x2b714d,_0x4ba449){_0x2b714d=_0x2b714d-0x0;var _0x452bd1=_0x2ef8[_0x2b714d];return _0x452bd1;};'use strict';var _=require(_0x82ef('0x0'));var util=require(_0x82ef('0x1'));var logger=require('../../config/logger')(_0x82ef('0x2'));var moment=require('moment');var BPromise=require(_0x82ef('0x3'));var rp=require(_0x82ef('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x82ef('0x5'));var config=require('../../config/environment');var attributes=require(_0x82ef('0x6'));module[_0x82ef('0x7')]=function(_0x60a1cd,_0x3fefa7){return _0x60a1cd[_0x82ef('0x8')](_0x82ef('0x9'),attributes,{'tableName':_0x82ef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x296d=['define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailQueue.attributes'];(function(_0x55b556,_0x4d3a94){var _0x2a5046=function(_0x4558d7){while(--_0x4558d7){_0x55b556['push'](_0x55b556['shift']());}};_0x2a5046(++_0x4d3a94);}(_0x296d,0x196));var _0xd296=function(_0x569fef,_0x49c37a){_0x569fef=_0x569fef-0x0;var _0x11f20b=_0x296d[_0x569fef];return _0x11f20b;};'use strict';var _=require(_0xd296('0x0'));var util=require(_0xd296('0x1'));var logger=require(_0xd296('0x2'))(_0xd296('0x3'));var moment=require(_0xd296('0x4'));var BPromise=require(_0xd296('0x5'));var rp=require(_0xd296('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd296('0x7'));var config=require(_0xd296('0x8'));var attributes=require(_0xd296('0x9'));module['exports']=function(_0x5d59e6,_0x2cee17){return _0x5d59e6[_0xd296('0xa')](_0xd296('0xb'),attributes,{'tableName':_0xd296('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8dfd566..4f78094 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b07=['register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','map','model','include','find','ShowMailQueue','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','redis','localhost','./mailQueue.socket'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b07,0x1d6));var _0x74b0=function(_0x246890,_0x46b964){_0x246890=_0x246890-0x0;var _0x2b2a5a=_0x4b07[_0x246890];return _0x2b2a5a;};'use strict';var _=require('lodash');var util=require(_0x74b0('0x0'));var moment=require(_0x74b0('0x1'));var BPromise=require('bluebird');var rs=require(_0x74b0('0x2'));var fs=require('fs');var Redis=require(_0x74b0('0x3'));var db=require(_0x74b0('0x4'))['db'];var utils=require(_0x74b0('0x5'));var logger=require('../../config/logger')(_0x74b0('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x74b0('0x7')]({'port':0x232a});config[_0x74b0('0x8')]=_['defaults'](config['redis'],{'host':_0x74b0('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x74b0('0x8')]));require(_0x74b0('0xa'))[_0x74b0('0xb')](socket);function respondWithRpcPromise(_0x419fab,_0x3a516c,_0x462a84){return new BPromise(function(_0x2382cd,_0x1c1af8){return client[_0x74b0('0xc')](_0x419fab,_0x462a84)[_0x74b0('0xd')](function(_0x2907a8){logger[_0x74b0('0xe')](_0x74b0('0xf'),_0x3a516c,_0x74b0('0x10'));logger[_0x74b0('0x11')](_0x74b0('0x12'),_0x3a516c,'request\x20sent',JSON[_0x74b0('0x13')](_0x2907a8));if(_0x2907a8[_0x74b0('0x14')]){if(_0x2907a8['error'][_0x74b0('0x15')]===0x1f4){logger['error'](_0x74b0('0xf'),_0x3a516c,_0x2907a8[_0x74b0('0x14')]['message']);return _0x1c1af8(_0x2907a8[_0x74b0('0x14')]['message']);}logger[_0x74b0('0x14')]('MailQueue,\x20%s,\x20%s',_0x3a516c,_0x2907a8[_0x74b0('0x14')]['message']);return _0x2382cd(_0x2907a8[_0x74b0('0x14')][_0x74b0('0x16')]);}else{logger[_0x74b0('0xe')](_0x74b0('0xf'),_0x3a516c,_0x74b0('0x10'));_0x2382cd(_0x2907a8[_0x74b0('0x17')][_0x74b0('0x16')]);}})[_0x74b0('0x18')](function(_0x4a2c60){logger['error']('MailQueue,\x20%s,\x20%s',_0x3a516c,_0x4a2c60);_0x1c1af8(_0x4a2c60);});});}exports[_0x74b0('0x19')]=function(_0x4b8893){var _0xf313bc=this;return new Promise(function(_0x41f602,_0xc17e43){return db[_0x74b0('0x1a')]['findAll']({'raw':_0x4b8893[_0x74b0('0x1b')]?_0x4b8893[_0x74b0('0x1b')][_0x74b0('0x1c')]===undefined?!![]:![]:!![],'where':_0x4b8893[_0x74b0('0x1b')]?_0x4b8893['options'][_0x74b0('0x1d')]||null:null,'attributes':_0x4b8893[_0x74b0('0x1b')]?_0x4b8893[_0x74b0('0x1b')][_0x74b0('0x1e')]||null:null,'limit':_0x4b8893[_0x74b0('0x1b')]?_0x4b8893[_0x74b0('0x1b')][_0x74b0('0x1f')]||null:null,'include':_0x4b8893[_0x74b0('0x1b')]?_0x4b8893[_0x74b0('0x1b')]['include']?_[_0x74b0('0x20')](_0x4b8893['options']['include'],function(_0x2166a5){return{'model':db[_0x2166a5[_0x74b0('0x21')]],'as':_0x2166a5['as'],'attributes':_0x2166a5[_0x74b0('0x1e')],'include':_0x2166a5['include']?_[_0x74b0('0x20')](_0x2166a5[_0x74b0('0x22')],function(_0x1f8b2a){return{'model':db[_0x1f8b2a[_0x74b0('0x21')]],'as':_0x1f8b2a['as'],'attributes':_0x1f8b2a['attributes'],'include':_0x1f8b2a[_0x74b0('0x22')]?_[_0x74b0('0x20')](_0x1f8b2a[_0x74b0('0x22')],function(_0x2163f4){return{'model':db[_0x2163f4[_0x74b0('0x21')]],'as':_0x2163f4['as'],'attributes':_0x2163f4[_0x74b0('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dc537){logger['info'](_0x74b0('0x19'),_0x4b8893);logger[_0x74b0('0x11')]('GetMailQueue',_0x4b8893,JSON[_0x74b0('0x13')](_0x2dc537));_0x41f602(_0x2dc537);})[_0x74b0('0x18')](function(_0x143093){logger['error']('GetMailQueue',_0x143093['message'],_0x4b8893);_0xc17e43(_0xf313bc[_0x74b0('0x14')](0x1f4,_0x143093[_0x74b0('0x16')]));});});};exports['ShowMailQueue']=function(_0x198de5){var _0x40c4f3=this;return new Promise(function(_0x3a77a4,_0x388786){return db[_0x74b0('0x1a')][_0x74b0('0x23')]({'raw':_0x198de5['options']?_0x198de5[_0x74b0('0x1b')][_0x74b0('0x1c')]===undefined?!![]:![]:!![],'where':_0x198de5[_0x74b0('0x1b')]?_0x198de5['options'][_0x74b0('0x1d')]||null:null,'attributes':_0x198de5[_0x74b0('0x1b')]?_0x198de5['options'][_0x74b0('0x1e')]||null:null,'include':_0x198de5[_0x74b0('0x1b')]?_0x198de5[_0x74b0('0x1b')]['include']?_[_0x74b0('0x20')](_0x198de5[_0x74b0('0x1b')][_0x74b0('0x22')],function(_0x4c4bf8){return{'model':db[_0x4c4bf8['model']],'as':_0x4c4bf8['as'],'attributes':_0x4c4bf8[_0x74b0('0x1e')],'include':_0x4c4bf8['include']?_[_0x74b0('0x20')](_0x4c4bf8[_0x74b0('0x22')],function(_0x1c8e59){return{'model':db[_0x1c8e59[_0x74b0('0x21')]],'as':_0x1c8e59['as'],'attributes':_0x1c8e59[_0x74b0('0x1e')],'include':_0x1c8e59[_0x74b0('0x22')]?_[_0x74b0('0x20')](_0x1c8e59[_0x74b0('0x22')],function(_0x1cc750){return{'model':db[_0x1cc750[_0x74b0('0x21')]],'as':_0x1cc750['as'],'attributes':_0x1cc750[_0x74b0('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x74b0('0xd')](function(_0xd08f82){logger[_0x74b0('0xe')](_0x74b0('0x24'),_0x198de5);logger[_0x74b0('0x11')](_0x74b0('0x24'),_0x198de5,JSON[_0x74b0('0x13')](_0xd08f82));_0x3a77a4(_0xd08f82);})[_0x74b0('0x18')](function(_0x7ee0ca){logger[_0x74b0('0x14')](_0x74b0('0x24'),_0x7ee0ca[_0x74b0('0x16')],_0x198de5);_0x388786(_0x40c4f3[_0x74b0('0x14')](0x1f4,_0x7ee0ca['message']));});});};
\ No newline at end of file
+var _0x0a88=['GetMailQueue','MailQueue','options','raw','limit','include','map','model','attributes','debug','stringify','ShowMailQueue','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','request','then','info','MailQueue,\x20%s,\x20%s','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch'];(function(_0x3a5c2e,_0x586ed0){var _0x140d07=function(_0x57a6a3){while(--_0x57a6a3){_0x3a5c2e['push'](_0x3a5c2e['shift']());}};_0x140d07(++_0x586ed0);}(_0x0a88,0xac));var _0x80a8=function(_0x1b6311,_0x42ec20){_0x1b6311=_0x1b6311-0x0;var _0x25aab6=_0x0a88[_0x1b6311];return _0x25aab6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x80a8('0x0'));var BPromise=require(_0x80a8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x80a8('0x2'))['db'];var utils=require(_0x80a8('0x3'));var logger=require(_0x80a8('0x4'))(_0x80a8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x80a8('0x6')][_0x80a8('0x7')]({'port':0x232a});config[_0x80a8('0x8')]=_[_0x80a8('0x9')](config[_0x80a8('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2a7b8d,_0x176885,_0x3cfa05){return new BPromise(function(_0x36895f,_0x4019af){return client[_0x80a8('0xa')](_0x2a7b8d,_0x3cfa05)[_0x80a8('0xb')](function(_0x52d787){logger[_0x80a8('0xc')](_0x80a8('0xd'),_0x176885,'request\x20sent');logger['debug'](_0x80a8('0xe'),_0x176885,_0x80a8('0xf'),JSON['stringify'](_0x52d787));if(_0x52d787[_0x80a8('0x10')]){if(_0x52d787[_0x80a8('0x10')]['code']===0x1f4){logger[_0x80a8('0x10')](_0x80a8('0xd'),_0x176885,_0x52d787['error'][_0x80a8('0x11')]);return _0x4019af(_0x52d787[_0x80a8('0x10')]['message']);}logger['error']('MailQueue,\x20%s,\x20%s',_0x176885,_0x52d787[_0x80a8('0x10')][_0x80a8('0x11')]);return _0x36895f(_0x52d787[_0x80a8('0x10')][_0x80a8('0x11')]);}else{logger[_0x80a8('0xc')](_0x80a8('0xd'),_0x176885,_0x80a8('0xf'));_0x36895f(_0x52d787[_0x80a8('0x12')][_0x80a8('0x11')]);}})[_0x80a8('0x13')](function(_0x1d22f3){logger[_0x80a8('0x10')](_0x80a8('0xd'),_0x176885,_0x1d22f3);_0x4019af(_0x1d22f3);});});}exports[_0x80a8('0x14')]=function(_0x503067){var _0x2fd1d3=this;return new Promise(function(_0x572c81,_0x570708){return db[_0x80a8('0x15')]['findAll']({'raw':_0x503067[_0x80a8('0x16')]?_0x503067[_0x80a8('0x16')][_0x80a8('0x17')]===undefined?!![]:![]:!![],'where':_0x503067['options']?_0x503067['options']['where']||null:null,'attributes':_0x503067[_0x80a8('0x16')]?_0x503067[_0x80a8('0x16')]['attributes']||null:null,'limit':_0x503067[_0x80a8('0x16')]?_0x503067[_0x80a8('0x16')][_0x80a8('0x18')]||null:null,'include':_0x503067['options']?_0x503067[_0x80a8('0x16')][_0x80a8('0x19')]?_[_0x80a8('0x1a')](_0x503067[_0x80a8('0x16')]['include'],function(_0xc0a8bb){return{'model':db[_0xc0a8bb[_0x80a8('0x1b')]],'as':_0xc0a8bb['as'],'attributes':_0xc0a8bb['attributes'],'include':_0xc0a8bb[_0x80a8('0x19')]?_[_0x80a8('0x1a')](_0xc0a8bb[_0x80a8('0x19')],function(_0x5c0cc2){return{'model':db[_0x5c0cc2[_0x80a8('0x1b')]],'as':_0x5c0cc2['as'],'attributes':_0x5c0cc2[_0x80a8('0x1c')],'include':_0x5c0cc2['include']?_[_0x80a8('0x1a')](_0x5c0cc2[_0x80a8('0x19')],function(_0x44948e){return{'model':db[_0x44948e[_0x80a8('0x1b')]],'as':_0x44948e['as'],'attributes':_0x44948e[_0x80a8('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x552c6f){logger[_0x80a8('0xc')](_0x80a8('0x14'),_0x503067);logger[_0x80a8('0x1d')]('GetMailQueue',_0x503067,JSON[_0x80a8('0x1e')](_0x552c6f));_0x572c81(_0x552c6f);})['catch'](function(_0x5e7f56){logger[_0x80a8('0x10')](_0x80a8('0x14'),_0x5e7f56[_0x80a8('0x11')],_0x503067);_0x570708(_0x2fd1d3['error'](0x1f4,_0x5e7f56[_0x80a8('0x11')]));});});};exports[_0x80a8('0x1f')]=function(_0x202907){var _0x29fb46=this;return new Promise(function(_0x314577,_0x493cd4){return db[_0x80a8('0x15')]['find']({'raw':_0x202907[_0x80a8('0x16')]?_0x202907[_0x80a8('0x16')][_0x80a8('0x17')]===undefined?!![]:![]:!![],'where':_0x202907[_0x80a8('0x16')]?_0x202907[_0x80a8('0x16')]['where']||null:null,'attributes':_0x202907['options']?_0x202907['options'][_0x80a8('0x1c')]||null:null,'include':_0x202907[_0x80a8('0x16')]?_0x202907[_0x80a8('0x16')][_0x80a8('0x19')]?_[_0x80a8('0x1a')](_0x202907[_0x80a8('0x16')]['include'],function(_0x54e630){return{'model':db[_0x54e630[_0x80a8('0x1b')]],'as':_0x54e630['as'],'attributes':_0x54e630[_0x80a8('0x1c')],'include':_0x54e630[_0x80a8('0x19')]?_[_0x80a8('0x1a')](_0x54e630[_0x80a8('0x19')],function(_0x53a98d){return{'model':db[_0x53a98d[_0x80a8('0x1b')]],'as':_0x53a98d['as'],'attributes':_0x53a98d[_0x80a8('0x1c')],'include':_0x53a98d[_0x80a8('0x19')]?_['map'](_0x53a98d[_0x80a8('0x19')],function(_0x29218f){return{'model':db[_0x29218f[_0x80a8('0x1b')]],'as':_0x29218f['as'],'attributes':_0x29218f[_0x80a8('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc310fc){logger['info'](_0x80a8('0x1f'),_0x202907);logger[_0x80a8('0x1d')](_0x80a8('0x1f'),_0x202907,JSON[_0x80a8('0x1e')](_0xc310fc));_0x314577(_0xc310fc);})['catch'](function(_0x38c23e){logger[_0x80a8('0x10')](_0x80a8('0x1f'),_0x38c23e[_0x80a8('0x11')],_0x202907);_0x493cd4(_0x29fb46[_0x80a8('0x10')](0x1f4,_0x38c23e['message']));});});};
\ No newline at end of file
index a78b49b..0847288 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7014=['length','mailQueue:','./mailQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x525276,_0xd269da){var _0x49d8e2=function(_0x4725b0){while(--_0x4725b0){_0x525276['push'](_0x525276['shift']());}};_0x49d8e2(++_0xd269da);}(_0x7014,0xec));var _0x4701=function(_0x579d20,_0x285e55){_0x579d20=_0x579d20-0x0;var _0x222c9d=_0x7014[_0x579d20];return _0x222c9d;};'use strict';var MailQueueEvents=require(_0x4701('0x0'));var events=[_0x4701('0x1'),_0x4701('0x2'),_0x4701('0x3')];function createListener(_0x4c41f0,_0x2ee24d){return function(_0x3f0459){_0x2ee24d[_0x4701('0x4')](_0x4c41f0,_0x3f0459);};}function removeListener(_0x47a0d3,_0xe9e88c){return function(){MailQueueEvents[_0x4701('0x5')](_0x47a0d3,_0xe9e88c);};}exports[_0x4701('0x6')]=function(_0x511352){for(var _0x49836a=0x0,_0x201bb9=events[_0x4701('0x7')];_0x49836a<_0x201bb9;_0x49836a++){var _0x325551=events[_0x49836a];var _0x4acc10=createListener(_0x4701('0x8')+_0x325551,_0x511352);MailQueueEvents['on'](_0x325551,_0x4acc10);}};
\ No newline at end of file
+var _0x4c7a=['update','emit','removeListener','register','length','./mailQueue.events','save','remove'];(function(_0x1f7b45,_0x4c15c2){var _0x2438f4=function(_0x1b2ffa){while(--_0x1b2ffa){_0x1f7b45['push'](_0x1f7b45['shift']());}};_0x2438f4(++_0x4c15c2);}(_0x4c7a,0x125));var _0xa4c7=function(_0x318d0e,_0x5e1c97){_0x318d0e=_0x318d0e-0x0;var _0x391085=_0x4c7a[_0x318d0e];return _0x391085;};'use strict';var MailQueueEvents=require(_0xa4c7('0x0'));var events=[_0xa4c7('0x1'),_0xa4c7('0x2'),_0xa4c7('0x3')];function createListener(_0x9c0342,_0x3c00e7){return function(_0x2ccd72){_0x3c00e7[_0xa4c7('0x4')](_0x9c0342,_0x2ccd72);};}function removeListener(_0x4e4a11,_0x35b6f5){return function(){MailQueueEvents[_0xa4c7('0x5')](_0x4e4a11,_0x35b6f5);};}exports[_0xa4c7('0x6')]=function(_0x5ded7d){for(var _0x450e60=0x0,_0x27501f=events[_0xa4c7('0x7')];_0x450e60<_0x27501f;_0x450e60++){var _0x45aa64=events[_0x450e60];var _0x207b0d=createListener('mailQueue:'+_0x45aa64,_0x5ded7d);MailQueueEvents['on'](_0x45aa64,_0x207b0d);}};
\ No newline at end of file
index d029e09..12390c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1175=['describe','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x5c16ad,_0x24312a){var _0xf9d36e=function(_0x4517cc){while(--_0x4517cc){_0x5c16ad['push'](_0x5c16ad['shift']());}};_0xf9d36e(++_0x24312a);}(_0x1175,0x1eb));var _0x5117=function(_0x30e24f,_0x3c5a19){_0x30e24f=_0x30e24f-0x0;var _0x27c7eb=_0x1175[_0x30e24f];return _0x27c7eb;};'use strict';var multer=require(_0x5117('0x0'));var util=require(_0x5117('0x1'));var path=require(_0x5117('0x2'));var timeout=require(_0x5117('0x3'));var express=require(_0x5117('0x4'));var router=express[_0x5117('0x5')]();var fs_extra=require(_0x5117('0x6'));var auth=require(_0x5117('0x7'));var interaction=require(_0x5117('0x8'));var config=require(_0x5117('0x9'));var controller=require(_0x5117('0xa'));router[_0x5117('0xb')]('/',auth[_0x5117('0xc')](),controller[_0x5117('0xd')]);router[_0x5117('0xb')](_0x5117('0xe'),auth[_0x5117('0xc')](),controller[_0x5117('0xf')]);router[_0x5117('0xb')](_0x5117('0x10'),auth[_0x5117('0xc')](),controller['show']);router[_0x5117('0x11')]('/',auth[_0x5117('0xc')](),controller[_0x5117('0x12')]);router[_0x5117('0x13')](_0x5117('0x10'),auth['isAuthenticated'](),controller[_0x5117('0x14')]);router['delete'](_0x5117('0x10'),auth[_0x5117('0xc')](),controller[_0x5117('0x15')]);module[_0x5117('0x16')]=router;
\ No newline at end of file
+var _0x8fab=['./mailQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x50fe18,_0x1c9947){var _0x35e195=function(_0x589f82){while(--_0x589f82){_0x50fe18['push'](_0x50fe18['shift']());}};_0x35e195(++_0x1c9947);}(_0x8fab,0x187));var _0xb8fa=function(_0x471f71,_0x528039){_0x471f71=_0x471f71-0x0;var _0x24bc47=_0x8fab[_0x471f71];return _0x24bc47;};'use strict';var multer=require('multer');var util=require(_0xb8fa('0x0'));var path=require('path');var timeout=require(_0xb8fa('0x1'));var express=require(_0xb8fa('0x2'));var router=express[_0xb8fa('0x3')]();var fs_extra=require(_0xb8fa('0x4'));var auth=require(_0xb8fa('0x5'));var interaction=require(_0xb8fa('0x6'));var config=require(_0xb8fa('0x7'));var controller=require(_0xb8fa('0x8'));router['get']('/',auth[_0xb8fa('0x9')](),controller[_0xb8fa('0xa')]);router[_0xb8fa('0xb')](_0xb8fa('0xc'),auth[_0xb8fa('0x9')](),controller['describe']);router[_0xb8fa('0xb')](_0xb8fa('0xd'),auth[_0xb8fa('0x9')](),controller[_0xb8fa('0xe')]);router[_0xb8fa('0xf')]('/',auth[_0xb8fa('0x9')](),controller[_0xb8fa('0x10')]);router['put'](_0xb8fa('0xd'),auth['isAuthenticated'](),controller[_0xb8fa('0x11')]);router[_0xb8fa('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xb8fa('0x13')]);module[_0xb8fa('0x14')]=router;
\ No newline at end of file
index 833f9e4..6248e46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1f=['DATE','moment','sequelize','exports','STRING'];(function(_0x5caf82,_0x9591f7){var _0x5cf782=function(_0x1346ee){while(--_0x1346ee){_0x5caf82['push'](_0x5caf82['shift']());}};_0x5cf782(++_0x9591f7);}(_0xed1f,0x6a));var _0xfed1=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xed1f[_0x220f3f];return _0x1f170e;};'use strict';var moment=require(_0xfed1('0x0'));var Sequelize=require(_0xfed1('0x1'));module[_0xfed1('0x2')]={'uniqueid':{'type':Sequelize[_0xfed1('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xfed1('0x3')]},'joinAt':{'type':Sequelize[_0xfed1('0x4')]},'leaveAt':{'type':Sequelize[_0xfed1('0x4')]},'acceptAt':{'type':Sequelize[_0xfed1('0x4')]},'exitAt':{'type':Sequelize[_0xfed1('0x4')]},'reason':{'type':Sequelize[_0xfed1('0x3')]}};
\ No newline at end of file
+var _0xdbf5=['sequelize','STRING','DATE'];(function(_0x108376,_0x110238){var _0x3cc424=function(_0x47b614){while(--_0x47b614){_0x108376['push'](_0x108376['shift']());}};_0x3cc424(++_0x110238);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x568a6f,_0x299549){_0x568a6f=_0x568a6f-0x0;var _0x48936e=_0xdbf5[_0x568a6f];return _0x48936e;};'use strict';var moment=require('moment');var Sequelize=require(_0x5dbf('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x5dbf('0x1')]},'joinAt':{'type':Sequelize[_0x5dbf('0x2')]},'leaveAt':{'type':Sequelize[_0x5dbf('0x2')]},'acceptAt':{'type':Sequelize[_0x5dbf('0x2')]},'exitAt':{'type':Sequelize[_0x5dbf('0x2')]},'reason':{'type':Sequelize[_0x5dbf('0x1')]}};
\ No newline at end of file
index d2a5778..02e74d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8952=['filter','VIRTUAL','merge','options','findAll','rows','show','params','keys','includeAll','include','catch','create','body','destroy','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','end','stack','name','map','MailQueueReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x8952,0x17e));var _0x2895=function(_0x28bced,_0x3c0653){_0x28bced=_0x28bced-0x0;var _0x3fc3f9=_0x8952[_0x28bced];return _0x3fc3f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2895('0x0'));var zipdir=require(_0x2895('0x1'));var jsonpatch=require(_0x2895('0x2'));var rp=require(_0x2895('0x3'));var moment=require(_0x2895('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2895('0x5'));var util=require(_0x2895('0x6'));var path=require(_0x2895('0x7'));var sox=require('sox');var csv=require(_0x2895('0x8'));var ejs=require(_0x2895('0x9'));var fs=require('fs');var fs_extra=require(_0x2895('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2895('0xb'));var jsforce=require(_0x2895('0xc'));var deskjs=require(_0x2895('0xd'));var toCsv=require(_0x2895('0x8'));var querystring=require(_0x2895('0xe'));var Papa=require('papaparse');var Redis=require(_0x2895('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2895('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2895('0x11'));var utils=require(_0x2895('0x12'));var config=require(_0x2895('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2895('0x14'))['db'];function respondWithStatusCode(_0x3924be,_0x4b1342){_0x4b1342=_0x4b1342||0xcc;return function(_0x32574c){if(_0x32574c){return _0x3924be[_0x2895('0x15')](_0x4b1342);}return _0x3924be['status'](_0x4b1342)['end']();};}function respondWithResult(_0x1d1493,_0x2ca2ac){_0x2ca2ac=_0x2ca2ac||0xc8;return function(_0x5777a0){if(_0x5777a0){return _0x1d1493[_0x2895('0x16')](_0x2ca2ac)[_0x2895('0x17')](_0x5777a0);}};}function respondWithFilteredResult(_0x27b50e,_0x1ae013){return function(_0x1d3659){if(_0x1d3659){var _0x2627e6=typeof _0x1ae013[_0x2895('0x18')]===_0x2895('0x19')&&typeof _0x1ae013[_0x2895('0x1a')]===_0x2895('0x19');var _0x10a1bf=_0x1d3659[_0x2895('0x1b')];var _0xbf8b63=_0x2627e6?0x0:_0x1ae013[_0x2895('0x18')];var _0x155124=_0x2627e6?_0x1d3659[_0x2895('0x1b')]:_0x1ae013[_0x2895('0x18')]+_0x1ae013[_0x2895('0x1a')];var _0x5a8eab;if(_0x155124>=_0x10a1bf){_0x155124=_0x10a1bf;_0x5a8eab=0xc8;}else{_0x5a8eab=0xce;}_0x27b50e['status'](_0x5a8eab);return _0x27b50e['set'](_0x2895('0x1c'),_0xbf8b63+'-'+_0x155124+'/'+_0x10a1bf)[_0x2895('0x17')](_0x1d3659);}return null;};}function patchUpdates(_0x3ec4da){return function(_0x593e47){try{jsonpatch[_0x2895('0x1d')](_0x593e47,_0x3ec4da,!![]);}catch(_0x190b79){return BPromise[_0x2895('0x1e')](_0x190b79);}return _0x593e47[_0x2895('0x1f')]();};}function saveUpdates(_0x8b75e0,_0x5dbbfe){return function(_0x30c6c3){if(_0x30c6c3){return _0x30c6c3[_0x2895('0x20')](_0x8b75e0)['then'](function(_0x142e58){return _0x142e58;});}return null;};}function removeEntity(_0x384357,_0x6f8ad4){return function(_0x511286){if(_0x511286){return _0x511286['destroy']()[_0x2895('0x21')](function(){_0x384357[_0x2895('0x16')](0xcc)[_0x2895('0x22')]();});}};}function handleEntityNotFound(_0x4a21cf,_0x3d3320){return function(_0x3690ce){if(!_0x3690ce){_0x4a21cf['sendStatus'](0x194);}return _0x3690ce;};}function handleError(_0x293ad3,_0x127540){_0x127540=_0x127540||0x1f4;return function(_0x2cd4df){logger['error'](_0x2cd4df[_0x2895('0x23')]);if(_0x2cd4df[_0x2895('0x24')]){delete _0x2cd4df['name'];}_0x293ad3[_0x2895('0x16')](_0x127540)['send'](_0x2cd4df);};}exports['index']=function(_0x18a935,_0x4ee2cc){var _0xfa4f85={},_0x381538={},_0x4fdd94={'count':0x0,'rows':[]};var _0x5574bf=_[_0x2895('0x25')](db[_0x2895('0x26')][_0x2895('0x27')],function(_0x14e343){return{'name':_0x14e343[_0x2895('0x28')],'type':_0x14e343[_0x2895('0x29')][_0x2895('0x2a')]};});_0x381538['model']=_[_0x2895('0x25')](_0x5574bf,_0x2895('0x24'));_0x381538[_0x2895('0x2b')]=_['keys'](_0x18a935[_0x2895('0x2b')]);_0x381538[_0x2895('0x2c')]=_[_0x2895('0x2d')](_0x381538[_0x2895('0x2e')],_0x381538['query']);_0xfa4f85[_0x2895('0x2f')]=_[_0x2895('0x2d')](_0x381538[_0x2895('0x2e')],qs[_0x2895('0x30')](_0x18a935[_0x2895('0x2b')]['fields']));_0xfa4f85['attributes']=_0xfa4f85[_0x2895('0x2f')][_0x2895('0x31')]?_0xfa4f85['attributes']:_0x381538[_0x2895('0x2e')];if(!_0x18a935['query'][_0x2895('0x32')](_0x2895('0x33'))){_0xfa4f85['limit']=qs[_0x2895('0x1a')](_0x18a935['query'][_0x2895('0x1a')]);_0xfa4f85['offset']=qs['offset'](_0x18a935[_0x2895('0x2b')][_0x2895('0x18')]);}_0xfa4f85[_0x2895('0x34')]=qs['sort'](_0x18a935[_0x2895('0x2b')][_0x2895('0x35')]);_0xfa4f85[_0x2895('0x36')]=qs[_0x2895('0x2c')](_[_0x2895('0x37')](_0x18a935[_0x2895('0x2b')],_0x381538[_0x2895('0x2c')]),_0x5574bf);if(_0x18a935[_0x2895('0x2b')][_0x2895('0x38')]){_0xfa4f85[_0x2895('0x36')]=_['merge'](_0xfa4f85[_0x2895('0x36')],{'$or':_[_0x2895('0x25')](_0x5574bf,function(_0x47413d){if(_0x47413d[_0x2895('0x29')]!==_0x2895('0x39')){var _0x12d7d8={};_0x12d7d8[_0x47413d[_0x2895('0x24')]]={'$like':'%'+_0x18a935['query']['filter']+'%'};return _0x12d7d8;}})});}_0xfa4f85=_[_0x2895('0x3a')]({},_0xfa4f85,_0x18a935[_0x2895('0x3b')]);var _0x24b9e0={'where':_0xfa4f85[_0x2895('0x36')]};return db[_0x2895('0x26')][_0x2895('0x1b')](_0x24b9e0)['then'](function(_0x5d18ef){_0x4fdd94[_0x2895('0x1b')]=_0x5d18ef;if(_0x18a935[_0x2895('0x2b')]['includeAll']){_0xfa4f85['include']=[{'all':!![]}];}return db[_0x2895('0x26')][_0x2895('0x3c')](_0xfa4f85);})[_0x2895('0x21')](function(_0x28967f){_0x4fdd94[_0x2895('0x3d')]=_0x28967f;return _0x4fdd94;})[_0x2895('0x21')](respondWithFilteredResult(_0x4ee2cc,_0xfa4f85))['catch'](handleError(_0x4ee2cc,null));};exports[_0x2895('0x3e')]=function(_0x2cfb24,_0x18ca24){var _0x1537fd={'raw':!![],'where':{'id':_0x2cfb24[_0x2895('0x3f')]['id']}},_0x4af6d6={};_0x4af6d6[_0x2895('0x2e')]=_[_0x2895('0x40')](db[_0x2895('0x26')]['rawAttributes']);_0x4af6d6['query']=_[_0x2895('0x40')](_0x2cfb24[_0x2895('0x2b')]);_0x4af6d6[_0x2895('0x2c')]=_[_0x2895('0x2d')](_0x4af6d6[_0x2895('0x2e')],_0x4af6d6['query']);_0x1537fd['attributes']=_[_0x2895('0x2d')](_0x4af6d6[_0x2895('0x2e')],qs[_0x2895('0x30')](_0x2cfb24[_0x2895('0x2b')][_0x2895('0x30')]));_0x1537fd[_0x2895('0x2f')]=_0x1537fd[_0x2895('0x2f')]['length']?_0x1537fd[_0x2895('0x2f')]:_0x4af6d6[_0x2895('0x2e')];if(_0x2cfb24[_0x2895('0x2b')][_0x2895('0x41')]){_0x1537fd[_0x2895('0x42')]=[{'all':!![]}];}_0x1537fd=_[_0x2895('0x3a')]({},_0x1537fd,_0x2cfb24[_0x2895('0x3b')]);return db[_0x2895('0x26')]['find'](_0x1537fd)[_0x2895('0x21')](handleEntityNotFound(_0x18ca24,null))[_0x2895('0x21')](respondWithResult(_0x18ca24,null))[_0x2895('0x43')](handleError(_0x18ca24,null));};exports['create']=function(_0xc85aa1,_0x5307a9){return db['MailQueueReport'][_0x2895('0x44')](_0xc85aa1[_0x2895('0x45')],{})[_0x2895('0x21')](respondWithResult(_0x5307a9,0xc9))[_0x2895('0x43')](handleError(_0x5307a9,null));};exports[_0x2895('0x20')]=function(_0x3cc331,_0x11e53a){if(_0x3cc331['body']['id']){delete _0x3cc331[_0x2895('0x45')]['id'];}return db[_0x2895('0x26')]['find']({'where':{'id':_0x3cc331['params']['id']}})['then'](handleEntityNotFound(_0x11e53a,null))[_0x2895('0x21')](saveUpdates(_0x3cc331[_0x2895('0x45')],null))[_0x2895('0x21')](respondWithResult(_0x11e53a,null))[_0x2895('0x43')](handleError(_0x11e53a,null));};exports[_0x2895('0x46')]=function(_0x3c5261,_0xaca46c){return db[_0x2895('0x26')][_0x2895('0x47')]({'where':{'id':_0x3c5261[_0x2895('0x3f')]['id']}})[_0x2895('0x21')](handleEntityNotFound(_0xaca46c,null))[_0x2895('0x21')](removeEntity(_0xaca46c,null))[_0x2895('0x43')](handleError(_0xaca46c,null));};exports[_0x2895('0x48')]=function(_0x356d35,_0x3c1135){return db[_0x2895('0x26')][_0x2895('0x48')]()[_0x2895('0x21')](respondWithResult(_0x3c1135,null))[_0x2895('0x43')](handleError(_0x3c1135,null));};
\ No newline at end of file
+var _0x4975=['to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','MailQueueReport','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x25dcdf,_0x3b4e85){var _0x11a42c=function(_0x3e3836){while(--_0x3e3836){_0x25dcdf['push'](_0x25dcdf['shift']());}};_0x11a42c(++_0x3b4e85);}(_0x4975,0x86));var _0x5497=function(_0x230867,_0x969cd8){_0x230867=_0x230867-0x0;var _0x2b81f0=_0x4975[_0x230867];return _0x2b81f0;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['MailQueueReport']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':!![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['MailQueueReport'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['create'](_0xc78abe[_0x5497('0x46')],{})[_0x5497('0x24')](respondWithResult(_0x466287,0xc9))[_0x5497('0x40')](handleError(_0x466287,null));};exports['update']=function(_0x3e4da2,_0x530475){if(_0x3e4da2[_0x5497('0x46')]['id']){delete _0x3e4da2[_0x5497('0x46')]['id'];}return db[_0x5497('0x3b')]['find']({'where':{'id':_0x3e4da2[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x530475,null))['then'](saveUpdates(_0x3e4da2[_0x5497('0x46')],null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x40')](handleError(_0x530475,null));};exports['destroy']=function(_0x416f76,_0x400860){return db[_0x5497('0x3b')][_0x5497('0x44')]({'where':{'id':_0x416f76[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x400860,null))[_0x5497('0x24')](removeEntity(_0x400860,null))[_0x5497('0x40')](handleError(_0x400860,null));};exports['describe']=function(_0x1f73eb,_0x5b2c22){return db['MailQueueReport'][_0x5497('0x47')]()[_0x5497('0x24')](respondWithResult(_0x5b2c22,null))['catch'](handleError(_0x5b2c22,null));};
\ No newline at end of file
index 424dcea..90e5ed9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cb5=['define','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x2998db,_0x3424f1){var _0x115fea=function(_0x3b493c){while(--_0x3b493c){_0x2998db['push'](_0x2998db['shift']());}};_0x115fea(++_0x3424f1);}(_0x4cb5,0x8f));var _0x54cb=function(_0x287d08,_0x55ab1e){_0x287d08=_0x287d08-0x0;var _0x3e7834=_0x4cb5[_0x287d08];return _0x3e7834;};'use strict';var _=require(_0x54cb('0x0'));var util=require(_0x54cb('0x1'));var logger=require(_0x54cb('0x2'))(_0x54cb('0x3'));var moment=require('moment');var BPromise=require(_0x54cb('0x4'));var rp=require(_0x54cb('0x5'));var fs=require('fs');var path=require(_0x54cb('0x6'));var rimraf=require(_0x54cb('0x7'));var config=require(_0x54cb('0x8'));var attributes=require(_0x54cb('0x9'));module[_0x54cb('0xa')]=function(_0x48aed1,_0x44f36d){return _0x48aed1[_0x54cb('0xb')]('MailQueueReport',attributes,{'tableName':_0x54cb('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x54cb('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3068=['lodash','util','api','request-promise','path','rimraf','../../config/environment','exports','define','MailQueueReport','uniqueid'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x3068,0xe7));var _0x8306=function(_0x4c2343,_0xa2bf8d){_0x4c2343=_0x4c2343-0x0;var _0x79cd38=_0x3068[_0x4c2343];return _0x79cd38;};'use strict';var _=require(_0x8306('0x0'));var util=require(_0x8306('0x1'));var logger=require('../../config/logger')(_0x8306('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8306('0x3'));var fs=require('fs');var path=require(_0x8306('0x4'));var rimraf=require(_0x8306('0x5'));var config=require(_0x8306('0x6'));var attributes=require('./mailQueueReport.attributes');module[_0x8306('0x7')]=function(_0x4a35af,_0x4a3598){return _0x4a35af[_0x8306('0x8')](_0x8306('0x9'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x8306('0xa'),'fields':[_0x8306('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 18b1d7f..d721208 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2bc812,_0x7de020){var _0x20ca00=function(_0x294955){while(--_0x294955){_0x2bc812['push'](_0x2bc812['shift']());}};_0x20ca00(++_0x7de020);}(_0x326f,0xd1));var _0xf326=function(_0x1ff162,_0x574b38){_0x1ff162=_0x1ff162-0x0;var _0x9d0d7e=_0x326f[_0x1ff162];return _0x9d0d7e;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});};
\ No newline at end of file
+var _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x3eeba4,_0x4558bb){var _0x247792=function(_0x18cbc7){while(--_0x18cbc7){_0x3eeba4['push'](_0x3eeba4['shift']());}};_0x247792(++_0x4558bb);}(_0xadb5,0xad));var _0x5adb=function(_0x7dab12,_0x209878){_0x7dab12=_0x7dab12-0x0;var _0x139c59=_0xadb5[_0x7dab12];return _0x139c59;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});};
\ No newline at end of file
index c2a6d92..27d2b73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x59ac53,_0x189d73){var _0x2a4785=function(_0x40d71c){while(--_0x40d71c){_0x59ac53['push'](_0x59ac53['shift']());}};_0x2a4785(++_0x189d73);}(_0x70e0,0x17b));var _0x070e=function(_0x402b7f,_0x2f0cea){_0x402b7f=_0x402b7f-0x0;var _0x10a2fb=_0x70e0[_0x402b7f];return _0x10a2fb;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x450a51,_0x59ebd6){var _0x3a4ebc=function(_0x415959){while(--_0x415959){_0x450a51['push'](_0x450a51['shift']());}};_0x3a4ebc(++_0x59ebd6);}(_0xe706,0xa3));var _0x6e70=function(_0x4b3358,_0x126389){_0x4b3358=_0x4b3358-0x0;var _0x58af89=_0xe706[_0x4b3358];return _0x58af89;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
index 155ff2c..5ed45c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x527b=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x527b,0xac));var _0xb527=function(_0x171fdc,_0x16ae91){_0x171fdc=_0x171fdc-0x0;var _0x3782ea=_0x527b[_0x171fdc];return _0x3782ea;};'use strict';var Sequelize=require(_0xb527('0x0'));module[_0xb527('0x1')]={'description':{'type':Sequelize[_0xb527('0x2')]},'host':{'type':Sequelize[_0xb527('0x2')]},'authentication':{'type':Sequelize[_0xb527('0x3')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xb527('0x4')]},'tls':{'type':Sequelize[_0xb527('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xb527('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xb527('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xd3ab=['exports','STRING','BOOLEAN','INTEGER','INBOX','sequelize'];(function(_0x2ea176,_0x5638bf){var _0x1bb107=function(_0x42a8ef){while(--_0x42a8ef){_0x2ea176['push'](_0x2ea176['shift']());}};_0x1bb107(++_0x5638bf);}(_0xd3ab,0x149));var _0xbd3a=function(_0x276406,_0x3346c1){_0x276406=_0x276406-0x0;var _0xd0b9a2=_0xd3ab[_0x276406];return _0xd0b9a2;};'use strict';var Sequelize=require(_0xbd3a('0x0'));module[_0xbd3a('0x1')]={'description':{'type':Sequelize[_0xbd3a('0x2')]},'host':{'type':Sequelize[_0xbd3a('0x2')]},'authentication':{'type':Sequelize[_0xbd3a('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xbd3a('0x2')]},'password':{'type':Sequelize[_0xbd3a('0x2')]},'port':{'type':Sequelize[_0xbd3a('0x4')]},'tls':{'type':Sequelize[_0xbd3a('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xbd3a('0x2')],'defaultValue':_0xbd3a('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xbd3a('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xbd3a('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 49f5b7e..9a3688c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c5b=['bluebird','request-promise','rimraf','../../config/environment','./mailServerIn.attributes','exports','define','mail_servers_in','lodash','../../config/logger','api','moment'];(function(_0xc898bb,_0x51b13a){var _0x2b8ca6=function(_0x5b3ecf){while(--_0x5b3ecf){_0xc898bb['push'](_0xc898bb['shift']());}};_0x2b8ca6(++_0x51b13a);}(_0x3c5b,0xa4));var _0xb3c5=function(_0x161bee,_0x5d7b8c){_0x161bee=_0x161bee-0x0;var _0x114891=_0x3c5b[_0x161bee];return _0x114891;};'use strict';var _=require(_0xb3c5('0x0'));var util=require('util');var logger=require(_0xb3c5('0x1'))(_0xb3c5('0x2'));var moment=require(_0xb3c5('0x3'));var BPromise=require(_0xb3c5('0x4'));var rp=require(_0xb3c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb3c5('0x6'));var config=require(_0xb3c5('0x7'));var attributes=require(_0xb3c5('0x8'));module[_0xb3c5('0x9')]=function(_0x58bee2,_0x21be01){return _0x58bee2[_0xb3c5('0xa')]('MailServerIn',attributes,{'tableName':_0xb3c5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbb7a=['./mailServerIn.attributes','exports','MailServerIn','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x34298b,_0x3e5e07){var _0x28a747=function(_0x4b7124){while(--_0x4b7124){_0x34298b['push'](_0x34298b['shift']());}};_0x28a747(++_0x3e5e07);}(_0xbb7a,0x1cb));var _0xabb7=function(_0x339bb4,_0x573f12){_0x339bb4=_0x339bb4-0x0;var _0x15b2c2=_0xbb7a[_0x339bb4];return _0x15b2c2;};'use strict';var _=require(_0xabb7('0x0'));var util=require(_0xabb7('0x1'));var logger=require(_0xabb7('0x2'))(_0xabb7('0x3'));var moment=require(_0xabb7('0x4'));var BPromise=require(_0xabb7('0x5'));var rp=require(_0xabb7('0x6'));var fs=require('fs');var path=require(_0xabb7('0x7'));var rimraf=require(_0xabb7('0x8'));var config=require('../../config/environment');var attributes=require(_0xabb7('0x9'));module[_0xabb7('0xa')]=function(_0x3cc3cc,_0x131898){return _0x3cc3cc['define'](_0xabb7('0xb'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 07451e5..f3a8685 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35d4=['stringify','error','message','MailServerIn','options','attributes','include','map','model','GetMailServerIn','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s'];(function(_0x29fefa,_0x3c9ba0){var _0x530b05=function(_0xc21842){while(--_0xc21842){_0x29fefa['push'](_0x29fefa['shift']());}};_0x530b05(++_0x3c9ba0);}(_0x35d4,0x1e7));var _0x435d=function(_0x259fb1,_0x4dd874){_0x259fb1=_0x259fb1-0x0;var _0x4b4a93=_0x35d4[_0x259fb1];return _0x4b4a93;};'use strict';var _=require(_0x435d('0x0'));var util=require('util');var moment=require(_0x435d('0x1'));var BPromise=require(_0x435d('0x2'));var rs=require(_0x435d('0x3'));var fs=require('fs');var Redis=require(_0x435d('0x4'));var db=require(_0x435d('0x5'))['db'];var utils=require(_0x435d('0x6'));var logger=require(_0x435d('0x7'))('rpc');var config=require(_0x435d('0x8'));var jayson=require(_0x435d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2b1cc7,_0x55b365,_0x5f39e1){return new BPromise(function(_0xfbcabe,_0x594ae1){return client[_0x435d('0xa')](_0x2b1cc7,_0x5f39e1)[_0x435d('0xb')](function(_0x40b818){logger[_0x435d('0xc')](_0x435d('0xd'),_0x55b365,_0x435d('0xe'));logger[_0x435d('0xf')](_0x435d('0x10'),_0x55b365,'request\x20sent',JSON[_0x435d('0x11')](_0x40b818));if(_0x40b818[_0x435d('0x12')]){if(_0x40b818[_0x435d('0x12')]['code']===0x1f4){logger[_0x435d('0x12')](_0x435d('0xd'),_0x55b365,_0x40b818[_0x435d('0x12')][_0x435d('0x13')]);return _0x594ae1(_0x40b818['error'][_0x435d('0x13')]);}logger['error'](_0x435d('0xd'),_0x55b365,_0x40b818[_0x435d('0x12')]['message']);return _0xfbcabe(_0x40b818[_0x435d('0x12')][_0x435d('0x13')]);}else{logger[_0x435d('0xc')]('MailServerIn,\x20%s,\x20%s',_0x55b365,'request\x20sent');_0xfbcabe(_0x40b818['result'][_0x435d('0x13')]);}})['catch'](function(_0x39eba7){logger[_0x435d('0x12')]('MailServerIn,\x20%s,\x20%s',_0x55b365,_0x39eba7);_0x594ae1(_0x39eba7);});});}exports['GetMailServerIn']=function(_0x7871b4){var _0x3f653a=this;return new Promise(function(_0x44dbbd,_0x583315){return db[_0x435d('0x14')]['findAll']({'raw':_0x7871b4[_0x435d('0x15')]?_0x7871b4[_0x435d('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x7871b4['options']?_0x7871b4[_0x435d('0x15')]['where']||null:null,'attributes':_0x7871b4[_0x435d('0x15')]?_0x7871b4[_0x435d('0x15')][_0x435d('0x16')]||null:null,'limit':_0x7871b4['options']?_0x7871b4[_0x435d('0x15')]['limit']||null:null,'include':_0x7871b4[_0x435d('0x15')]?_0x7871b4['options'][_0x435d('0x17')]?_[_0x435d('0x18')](_0x7871b4[_0x435d('0x15')][_0x435d('0x17')],function(_0x41d91){return{'model':db[_0x41d91[_0x435d('0x19')]],'as':_0x41d91['as'],'attributes':_0x41d91[_0x435d('0x16')],'include':_0x41d91[_0x435d('0x17')]?_['map'](_0x41d91[_0x435d('0x17')],function(_0x2be3b8){return{'model':db[_0x2be3b8[_0x435d('0x19')]],'as':_0x2be3b8['as'],'attributes':_0x2be3b8[_0x435d('0x16')],'include':_0x2be3b8[_0x435d('0x17')]?_[_0x435d('0x18')](_0x2be3b8['include'],function(_0x165a47){return{'model':db[_0x165a47['model']],'as':_0x165a47['as'],'attributes':_0x165a47['attributes']};}):[]};}):[]};}):[]:[]})[_0x435d('0xb')](function(_0x219f59){logger[_0x435d('0xc')]('GetMailServerIn',_0x7871b4);logger['debug'](_0x435d('0x1a'),_0x7871b4,JSON[_0x435d('0x11')](_0x219f59));_0x44dbbd(_0x219f59);})[_0x435d('0x1b')](function(_0x112830){logger['error'](_0x435d('0x1a'),_0x112830[_0x435d('0x13')],_0x7871b4);_0x583315(_0x3f653a[_0x435d('0x12')](0x1f4,_0x112830[_0x435d('0x13')]));});});};
\ No newline at end of file
+var _0x3e1d=['request\x20sent','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','where','attributes','limit','include','model','map','debug','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerIn,\x20%s,\x20%s'];(function(_0x96509d,_0x28d383){var _0x5d2e6f=function(_0x35ed74){while(--_0x35ed74){_0x96509d['push'](_0x96509d['shift']());}};_0x5d2e6f(++_0x28d383);}(_0x3e1d,0xad));var _0xd3e1=function(_0x3df1c2,_0x1d32db){_0x3df1c2=_0x3df1c2-0x0;var _0x70d3e8=_0x3e1d[_0x3df1c2];return _0x70d3e8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd3e1('0x0'));var BPromise=require(_0xd3e1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3e1('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd3e1('0x3'));var logger=require(_0xd3e1('0x4'))(_0xd3e1('0x5'));var config=require('../../config/environment');var jayson=require(_0xd3e1('0x6'));var client=jayson[_0xd3e1('0x7')][_0xd3e1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40dab3,_0x1d7951,_0x35af20){return new BPromise(function(_0x217f96,_0x2a7a7a){return client[_0xd3e1('0x9')](_0x40dab3,_0x35af20)[_0xd3e1('0xa')](function(_0x1ef91b){logger[_0xd3e1('0xb')](_0xd3e1('0xc'),_0x1d7951,_0xd3e1('0xd'));logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x1d7951,_0xd3e1('0xd'),JSON[_0xd3e1('0xe')](_0x1ef91b));if(_0x1ef91b[_0xd3e1('0xf')]){if(_0x1ef91b[_0xd3e1('0xf')][_0xd3e1('0x10')]===0x1f4){logger[_0xd3e1('0xf')]('MailServerIn,\x20%s,\x20%s',_0x1d7951,_0x1ef91b['error'][_0xd3e1('0x11')]);return _0x2a7a7a(_0x1ef91b['error'][_0xd3e1('0x11')]);}logger[_0xd3e1('0xf')](_0xd3e1('0xc'),_0x1d7951,_0x1ef91b[_0xd3e1('0xf')][_0xd3e1('0x11')]);return _0x217f96(_0x1ef91b[_0xd3e1('0xf')][_0xd3e1('0x11')]);}else{logger[_0xd3e1('0xb')]('MailServerIn,\x20%s,\x20%s',_0x1d7951,_0xd3e1('0xd'));_0x217f96(_0x1ef91b[_0xd3e1('0x12')]['message']);}})[_0xd3e1('0x13')](function(_0x5c276e){logger[_0xd3e1('0xf')](_0xd3e1('0xc'),_0x1d7951,_0x5c276e);_0x2a7a7a(_0x5c276e);});});}exports[_0xd3e1('0x14')]=function(_0x348e41){var _0x5e50eb=this;return new Promise(function(_0x4f2710,_0x1f3fad){return db[_0xd3e1('0x15')][_0xd3e1('0x16')]({'raw':_0x348e41[_0xd3e1('0x17')]?_0x348e41[_0xd3e1('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x348e41[_0xd3e1('0x17')]?_0x348e41[_0xd3e1('0x17')][_0xd3e1('0x18')]||null:null,'attributes':_0x348e41['options']?_0x348e41[_0xd3e1('0x17')][_0xd3e1('0x19')]||null:null,'limit':_0x348e41[_0xd3e1('0x17')]?_0x348e41['options'][_0xd3e1('0x1a')]||null:null,'include':_0x348e41['options']?_0x348e41['options'][_0xd3e1('0x1b')]?_['map'](_0x348e41['options']['include'],function(_0x41de21){return{'model':db[_0x41de21[_0xd3e1('0x1c')]],'as':_0x41de21['as'],'attributes':_0x41de21[_0xd3e1('0x19')],'include':_0x41de21[_0xd3e1('0x1b')]?_[_0xd3e1('0x1d')](_0x41de21[_0xd3e1('0x1b')],function(_0x28c066){return{'model':db[_0x28c066[_0xd3e1('0x1c')]],'as':_0x28c066['as'],'attributes':_0x28c066[_0xd3e1('0x19')],'include':_0x28c066['include']?_[_0xd3e1('0x1d')](_0x28c066['include'],function(_0x4ecc70){return{'model':db[_0x4ecc70[_0xd3e1('0x1c')]],'as':_0x4ecc70['as'],'attributes':_0x4ecc70[_0xd3e1('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5660cc){logger[_0xd3e1('0xb')](_0xd3e1('0x14'),_0x348e41);logger[_0xd3e1('0x1e')]('GetMailServerIn',_0x348e41,JSON[_0xd3e1('0xe')](_0x5660cc));_0x4f2710(_0x5660cc);})['catch'](function(_0x54ba9d){logger[_0xd3e1('0xf')](_0xd3e1('0x14'),_0x54ba9d[_0xd3e1('0x11')],_0x348e41);_0x1f3fad(_0x5e50eb['error'](0x1f4,_0x54ba9d[_0xd3e1('0x11')]));});});};
\ No newline at end of file
index 20d076c..5dc55b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x7a54,0x106));var _0x47a5=function(_0x37e50c,_0x5d2dc4){_0x37e50c=_0x37e50c-0x0;var _0x5a8bf9=_0x7a54[_0x37e50c];return _0x5a8bf9;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router;
\ No newline at end of file
+var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router;
\ No newline at end of file
index 99f486c..2c02518 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd4f=['sequelize','STRING','BOOLEAN'];(function(_0x56879f,_0x424635){var _0x33d9ee=function(_0x237dc6){while(--_0x237dc6){_0x56879f['push'](_0x56879f['shift']());}};_0x33d9ee(++_0x424635);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x2fd08e,_0x15cf8b){_0x2fd08e=_0x2fd08e-0x0;var _0x3272ce=_0xdd4f[_0x2fd08e];return _0x3272ce;};'use strict';var Sequelize=require(_0xfdd4('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xfdd4('0x1')]},'pass':{'type':Sequelize[_0xfdd4('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0xfdd4('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0xfdd4('0x1')]},'authentication':{'type':Sequelize[_0xfdd4('0x2')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xb7e7=['BOOLEAN','sequelize','STRING','INTEGER'];(function(_0x4e41dc,_0x3bda2c){var _0x5d9274=function(_0x133c32){while(--_0x133c32){_0x4e41dc['push'](_0x4e41dc['shift']());}};_0x5d9274(++_0x3bda2c);}(_0xb7e7,0x121));var _0x7b7e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xb7e7[_0x43d11d];return _0x38cd08;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'description':{'type':Sequelize[_0x7b7e('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x7b7e('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x7b7e('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x7b7e('0x1')]},'authentication':{'type':Sequelize[_0x7b7e('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x7b7e('0x3')],'defaultValue':![]}};
\ No newline at end of file
index e927b98..4ce8fa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd721=['key','name','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','map','VIRTUAL','merge','options','MailServerOut','includeAll','include','findAll','rows','params','length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','send','index','fieldName','type'];(function(_0x2d2258,_0x2ce510){var _0x18e155=function(_0x11949e){while(--_0x11949e){_0x2d2258['push'](_0x2d2258['shift']());}};_0x18e155(++_0x2ce510);}(_0xd721,0x177));var _0x1d72=function(_0x5720ab,_0x1a9dff){_0x5720ab=_0x5720ab-0x0;var _0x404f3e=_0xd721[_0x5720ab];return _0x404f3e;};'use strict';var emlformat=require(_0x1d72('0x0'));var rimraf=require(_0x1d72('0x1'));var zipdir=require(_0x1d72('0x2'));var jsonpatch=require(_0x1d72('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1d72('0x4'));var util=require(_0x1d72('0x5'));var path=require('path');var sox=require(_0x1d72('0x6'));var csv=require(_0x1d72('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d72('0x8'));var _=require('lodash');var squel=require(_0x1d72('0x9'));var crypto=require(_0x1d72('0xa'));var jsforce=require(_0x1d72('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1d72('0xc'));var Papa=require(_0x1d72('0xd'));var Redis=require('ioredis');var authService=require(_0x1d72('0xe'));var qs=require(_0x1d72('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d72('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x1d72('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x1d72('0x12'))['db'];function respondWithStatusCode(_0x4c0727,_0x3f41c7){_0x3f41c7=_0x3f41c7||0xcc;return function(_0x1ad516){if(_0x1ad516){return _0x4c0727[_0x1d72('0x13')](_0x3f41c7);}return _0x4c0727[_0x1d72('0x14')](_0x3f41c7)[_0x1d72('0x15')]();};}function respondWithResult(_0x8411da,_0x4348d2){_0x4348d2=_0x4348d2||0xc8;return function(_0x59ec1f){if(_0x59ec1f){return _0x8411da[_0x1d72('0x14')](_0x4348d2)[_0x1d72('0x16')](_0x59ec1f);}};}function respondWithFilteredResult(_0x3d3c0e,_0x19ad84){return function(_0x35b351){if(_0x35b351){var _0x4dd095=typeof _0x19ad84[_0x1d72('0x17')]===_0x1d72('0x18')&&typeof _0x19ad84[_0x1d72('0x19')]==='undefined';var _0x3dee89=_0x35b351[_0x1d72('0x1a')];var _0x2b6fd5=_0x4dd095?0x0:_0x19ad84[_0x1d72('0x17')];var _0x1060c5=_0x4dd095?_0x35b351[_0x1d72('0x1a')]:_0x19ad84[_0x1d72('0x17')]+_0x19ad84[_0x1d72('0x19')];var _0x592f0b;if(_0x1060c5>=_0x3dee89){_0x1060c5=_0x3dee89;_0x592f0b=0xc8;}else{_0x592f0b=0xce;}_0x3d3c0e[_0x1d72('0x14')](_0x592f0b);return _0x3d3c0e[_0x1d72('0x1b')](_0x1d72('0x1c'),_0x2b6fd5+'-'+_0x1060c5+'/'+_0x3dee89)['json'](_0x35b351);}return null;};}function patchUpdates(_0x68d8af){return function(_0x299e5c){try{jsonpatch[_0x1d72('0x1d')](_0x299e5c,_0x68d8af,!![]);}catch(_0x5aed54){return BPromise['reject'](_0x5aed54);}return _0x299e5c[_0x1d72('0x1e')]();};}function saveUpdates(_0x2dcb2d,_0xd659b1){return function(_0x1c61f0){if(_0x1c61f0){return _0x1c61f0[_0x1d72('0x1f')](_0x2dcb2d)[_0x1d72('0x20')](function(_0x2c91cb){return _0x2c91cb;});}return null;};}function removeEntity(_0x6538d1,_0x4f6975){return function(_0x185871){if(_0x185871){return _0x185871[_0x1d72('0x21')]()[_0x1d72('0x20')](function(){_0x6538d1[_0x1d72('0x14')](0xcc)[_0x1d72('0x15')]();});}};}function handleEntityNotFound(_0x3ba119,_0x4a49e1){return function(_0x5b9e27){if(!_0x5b9e27){_0x3ba119[_0x1d72('0x13')](0x194);}return _0x5b9e27;};}function handleError(_0x575011,_0x5ebc6e){_0x5ebc6e=_0x5ebc6e||0x1f4;return function(_0x1d66cf){logger['error'](_0x1d66cf[_0x1d72('0x22')]);if(_0x1d66cf['name']){delete _0x1d66cf['name'];}_0x575011['status'](_0x5ebc6e)[_0x1d72('0x23')](_0x1d66cf);};}exports[_0x1d72('0x24')]=function(_0x2d317e,_0x4587a4){var _0x1987e4={},_0x2ba2ec={},_0x5a39c1={'count':0x0,'rows':[]};var _0x555710=_['map'](db['MailServerOut']['rawAttributes'],function(_0x42d5b0){return{'name':_0x42d5b0[_0x1d72('0x25')],'type':_0x42d5b0[_0x1d72('0x26')][_0x1d72('0x27')]};});_0x2ba2ec['model']=_['map'](_0x555710,_0x1d72('0x28'));_0x2ba2ec[_0x1d72('0x29')]=_[_0x1d72('0x2a')](_0x2d317e[_0x1d72('0x29')]);_0x2ba2ec[_0x1d72('0x2b')]=_[_0x1d72('0x2c')](_0x2ba2ec[_0x1d72('0x2d')],_0x2ba2ec[_0x1d72('0x29')]);_0x1987e4[_0x1d72('0x2e')]=_['intersection'](_0x2ba2ec[_0x1d72('0x2d')],qs[_0x1d72('0x2f')](_0x2d317e[_0x1d72('0x29')][_0x1d72('0x2f')]));_0x1987e4[_0x1d72('0x2e')]=_0x1987e4['attributes']['length']?_0x1987e4[_0x1d72('0x2e')]:_0x2ba2ec[_0x1d72('0x2d')];if(!_0x2d317e['query'][_0x1d72('0x30')]('nolimit')){_0x1987e4[_0x1d72('0x19')]=qs[_0x1d72('0x19')](_0x2d317e[_0x1d72('0x29')]['limit']);_0x1987e4[_0x1d72('0x17')]=qs[_0x1d72('0x17')](_0x2d317e[_0x1d72('0x29')][_0x1d72('0x17')]);}_0x1987e4[_0x1d72('0x31')]=qs[_0x1d72('0x32')](_0x2d317e[_0x1d72('0x29')][_0x1d72('0x32')]);_0x1987e4['where']=qs[_0x1d72('0x2b')](_[_0x1d72('0x33')](_0x2d317e['query'],_0x2ba2ec[_0x1d72('0x2b')]),_0x555710);if(_0x2d317e[_0x1d72('0x29')][_0x1d72('0x34')]){_0x1987e4[_0x1d72('0x35')]=_['merge'](_0x1987e4[_0x1d72('0x35')],{'$or':_[_0x1d72('0x36')](_0x555710,function(_0x525ba4){if(_0x525ba4[_0x1d72('0x26')]!==_0x1d72('0x37')){var _0x360387={};_0x360387[_0x525ba4[_0x1d72('0x28')]]={'$like':'%'+_0x2d317e[_0x1d72('0x29')][_0x1d72('0x34')]+'%'};return _0x360387;}})});}_0x1987e4=_[_0x1d72('0x38')]({},_0x1987e4,_0x2d317e[_0x1d72('0x39')]);var _0x9846de={'where':_0x1987e4[_0x1d72('0x35')]};return db[_0x1d72('0x3a')][_0x1d72('0x1a')](_0x9846de)[_0x1d72('0x20')](function(_0x17c014){_0x5a39c1['count']=_0x17c014;if(_0x2d317e[_0x1d72('0x29')][_0x1d72('0x3b')]){_0x1987e4[_0x1d72('0x3c')]=[{'all':!![]}];}return db[_0x1d72('0x3a')][_0x1d72('0x3d')](_0x1987e4);})['then'](function(_0x17c22d){_0x5a39c1[_0x1d72('0x3e')]=_0x17c22d;return _0x5a39c1;})[_0x1d72('0x20')](respondWithFilteredResult(_0x4587a4,_0x1987e4))['catch'](handleError(_0x4587a4,null));};exports['show']=function(_0x4f387b,_0x186aea){var _0xcd496e={'raw':!![],'where':{'id':_0x4f387b[_0x1d72('0x3f')]['id']}},_0x5cf9c5={};_0x5cf9c5['model']=_[_0x1d72('0x2a')](db[_0x1d72('0x3a')]['rawAttributes']);_0x5cf9c5[_0x1d72('0x29')]=_[_0x1d72('0x2a')](_0x4f387b[_0x1d72('0x29')]);_0x5cf9c5[_0x1d72('0x2b')]=_[_0x1d72('0x2c')](_0x5cf9c5['model'],_0x5cf9c5[_0x1d72('0x29')]);_0xcd496e['attributes']=_[_0x1d72('0x2c')](_0x5cf9c5['model'],qs[_0x1d72('0x2f')](_0x4f387b['query'][_0x1d72('0x2f')]));_0xcd496e['attributes']=_0xcd496e[_0x1d72('0x2e')][_0x1d72('0x40')]?_0xcd496e[_0x1d72('0x2e')]:_0x5cf9c5['model'];if(_0x4f387b[_0x1d72('0x29')]['includeAll']){_0xcd496e['include']=[{'all':!![]}];}_0xcd496e=_[_0x1d72('0x38')]({},_0xcd496e,_0x4f387b['options']);return db[_0x1d72('0x3a')][_0x1d72('0x41')](_0xcd496e)[_0x1d72('0x20')](handleEntityNotFound(_0x186aea,null))[_0x1d72('0x20')](respondWithResult(_0x186aea,null))[_0x1d72('0x42')](handleError(_0x186aea,null));};exports['create']=function(_0x5e5b40,_0x2c77a5){return db[_0x1d72('0x3a')][_0x1d72('0x43')](_0x5e5b40[_0x1d72('0x44')],{})[_0x1d72('0x20')](respondWithResult(_0x2c77a5,0xc9))[_0x1d72('0x42')](handleError(_0x2c77a5,null));};exports['update']=function(_0x222889,_0x2aeac0){if(_0x222889[_0x1d72('0x44')]['id']){delete _0x222889['body']['id'];}return db[_0x1d72('0x3a')][_0x1d72('0x41')]({'where':{'id':_0x222889[_0x1d72('0x3f')]['id']}})[_0x1d72('0x20')](handleEntityNotFound(_0x2aeac0,null))[_0x1d72('0x20')](saveUpdates(_0x222889['body'],null))[_0x1d72('0x20')](respondWithResult(_0x2aeac0,null))['catch'](handleError(_0x2aeac0,null));};exports[_0x1d72('0x21')]=function(_0xca5b41,_0x29786e){return db['MailServerOut'][_0x1d72('0x41')]({'where':{'id':_0xca5b41[_0x1d72('0x3f')]['id']}})[_0x1d72('0x20')](handleEntityNotFound(_0x29786e,null))[_0x1d72('0x20')](removeEntity(_0x29786e,null))[_0x1d72('0x42')](handleError(_0x29786e,null));};
\ No newline at end of file
+var _0xebe2=['sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','destroy','then','error','stack','name','map','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','options','MailServerOut','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path'];(function(_0x3255b7,_0x3a9263){var _0x47a3ca=function(_0x51a0cf){while(--_0x51a0cf){_0x3255b7['push'](_0x3255b7['shift']());}};_0x47a3ca(++_0x3a9263);}(_0xebe2,0x1ae));var _0x2ebe=function(_0x520e16,_0x545cb6){_0x520e16=_0x520e16-0x0;var _0x4771b5=_0xebe2[_0x520e16];return _0x4771b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2ebe('0x0'));var zipdir=require(_0x2ebe('0x1'));var jsonpatch=require(_0x2ebe('0x2'));var rp=require(_0x2ebe('0x3'));var moment=require(_0x2ebe('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2ebe('0x5'));var util=require(_0x2ebe('0x6'));var path=require(_0x2ebe('0x7'));var sox=require(_0x2ebe('0x8'));var csv=require(_0x2ebe('0x9'));var ejs=require(_0x2ebe('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2ebe('0xb'));var squel=require(_0x2ebe('0xc'));var crypto=require(_0x2ebe('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2ebe('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2ebe('0xf'));var Papa=require(_0x2ebe('0x10'));var Redis=require(_0x2ebe('0x11'));var authService=require(_0x2ebe('0x12'));var qs=require(_0x2ebe('0x13'));var as=require(_0x2ebe('0x14'));var hardwareService=require(_0x2ebe('0x15'));var logger=require(_0x2ebe('0x16'))(_0x2ebe('0x17'));var utils=require(_0x2ebe('0x18'));var config=require(_0x2ebe('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ea14e,_0x135a8b){_0x135a8b=_0x135a8b||0xcc;return function(_0x45cf4e){if(_0x45cf4e){return _0x4ea14e[_0x2ebe('0x1a')](_0x135a8b);}return _0x4ea14e[_0x2ebe('0x1b')](_0x135a8b)['end']();};}function respondWithResult(_0x2e8610,_0x30c87f){_0x30c87f=_0x30c87f||0xc8;return function(_0x12a1f3){if(_0x12a1f3){return _0x2e8610[_0x2ebe('0x1b')](_0x30c87f)[_0x2ebe('0x1c')](_0x12a1f3);}};}function respondWithFilteredResult(_0x469c44,_0x2461d3){return function(_0x10126e){if(_0x10126e){var _0x1108a6=typeof _0x2461d3[_0x2ebe('0x1d')]==='undefined'&&typeof _0x2461d3[_0x2ebe('0x1e')]===_0x2ebe('0x1f');var _0x270531=_0x10126e[_0x2ebe('0x20')];var _0x81ac7e=_0x1108a6?0x0:_0x2461d3[_0x2ebe('0x1d')];var _0x15d4de=_0x1108a6?_0x10126e[_0x2ebe('0x20')]:_0x2461d3[_0x2ebe('0x1d')]+_0x2461d3['limit'];var _0x46857e;if(_0x15d4de>=_0x270531){_0x15d4de=_0x270531;_0x46857e=0xc8;}else{_0x46857e=0xce;}_0x469c44[_0x2ebe('0x1b')](_0x46857e);return _0x469c44[_0x2ebe('0x21')](_0x2ebe('0x22'),_0x81ac7e+'-'+_0x15d4de+'/'+_0x270531)[_0x2ebe('0x1c')](_0x10126e);}return null;};}function patchUpdates(_0x111e5e){return function(_0x19ef76){try{jsonpatch[_0x2ebe('0x23')](_0x19ef76,_0x111e5e,!![]);}catch(_0x5c1d25){return BPromise[_0x2ebe('0x24')](_0x5c1d25);}return _0x19ef76['save']();};}function saveUpdates(_0x5ac3ea,_0x34d97a){return function(_0x402276){if(_0x402276){return _0x402276['update'](_0x5ac3ea)['then'](function(_0x4c5176){return _0x4c5176;});}return null;};}function removeEntity(_0x2810bb,_0x5a2a81){return function(_0x204d98){if(_0x204d98){return _0x204d98[_0x2ebe('0x25')]()[_0x2ebe('0x26')](function(){_0x2810bb[_0x2ebe('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43b6a2,_0x3f18bc){return function(_0x249dc8){if(!_0x249dc8){_0x43b6a2[_0x2ebe('0x1a')](0x194);}return _0x249dc8;};}function handleError(_0xdd2248,_0x101e9c){_0x101e9c=_0x101e9c||0x1f4;return function(_0x170e5f){logger[_0x2ebe('0x27')](_0x170e5f[_0x2ebe('0x28')]);if(_0x170e5f[_0x2ebe('0x29')]){delete _0x170e5f[_0x2ebe('0x29')];}_0xdd2248[_0x2ebe('0x1b')](_0x101e9c)['send'](_0x170e5f);};}exports['index']=function(_0x4b7f4e,_0x5c2205){var _0x4bd370={},_0x3dd539={},_0xca7d07={'count':0x0,'rows':[]};var _0x2fdd3f=_[_0x2ebe('0x2a')](db['MailServerOut']['rawAttributes'],function(_0x5e3e42){return{'name':_0x5e3e42['fieldName'],'type':_0x5e3e42['type'][_0x2ebe('0x2b')]};});_0x3dd539[_0x2ebe('0x2c')]=_['map'](_0x2fdd3f,_0x2ebe('0x29'));_0x3dd539[_0x2ebe('0x2d')]=_[_0x2ebe('0x2e')](_0x4b7f4e[_0x2ebe('0x2d')]);_0x3dd539[_0x2ebe('0x2f')]=_['intersection'](_0x3dd539['model'],_0x3dd539[_0x2ebe('0x2d')]);_0x4bd370[_0x2ebe('0x30')]=_[_0x2ebe('0x31')](_0x3dd539[_0x2ebe('0x2c')],qs['fields'](_0x4b7f4e[_0x2ebe('0x2d')][_0x2ebe('0x32')]));_0x4bd370[_0x2ebe('0x30')]=_0x4bd370[_0x2ebe('0x30')][_0x2ebe('0x33')]?_0x4bd370[_0x2ebe('0x30')]:_0x3dd539['model'];if(!_0x4b7f4e[_0x2ebe('0x2d')][_0x2ebe('0x34')](_0x2ebe('0x35'))){_0x4bd370[_0x2ebe('0x1e')]=qs[_0x2ebe('0x1e')](_0x4b7f4e[_0x2ebe('0x2d')][_0x2ebe('0x1e')]);_0x4bd370['offset']=qs[_0x2ebe('0x1d')](_0x4b7f4e[_0x2ebe('0x2d')][_0x2ebe('0x1d')]);}_0x4bd370['order']=qs[_0x2ebe('0x36')](_0x4b7f4e[_0x2ebe('0x2d')][_0x2ebe('0x36')]);_0x4bd370['where']=qs[_0x2ebe('0x2f')](_[_0x2ebe('0x37')](_0x4b7f4e[_0x2ebe('0x2d')],_0x3dd539[_0x2ebe('0x2f')]),_0x2fdd3f);if(_0x4b7f4e[_0x2ebe('0x2d')][_0x2ebe('0x38')]){_0x4bd370[_0x2ebe('0x39')]=_[_0x2ebe('0x3a')](_0x4bd370[_0x2ebe('0x39')],{'$or':_[_0x2ebe('0x2a')](_0x2fdd3f,function(_0x2cda2c){if(_0x2cda2c[_0x2ebe('0x3b')]!=='VIRTUAL'){var _0x4ebac7={};_0x4ebac7[_0x2cda2c[_0x2ebe('0x29')]]={'$like':'%'+_0x4b7f4e[_0x2ebe('0x2d')][_0x2ebe('0x38')]+'%'};return _0x4ebac7;}})});}_0x4bd370=_['merge']({},_0x4bd370,_0x4b7f4e[_0x2ebe('0x3c')]);var _0x187de9={'where':_0x4bd370[_0x2ebe('0x39')]};return db[_0x2ebe('0x3d')][_0x2ebe('0x20')](_0x187de9)[_0x2ebe('0x26')](function(_0x17df09){_0xca7d07[_0x2ebe('0x20')]=_0x17df09;if(_0x4b7f4e[_0x2ebe('0x2d')][_0x2ebe('0x3e')]){_0x4bd370[_0x2ebe('0x3f')]=[{'all':!![]}];}return db[_0x2ebe('0x3d')][_0x2ebe('0x40')](_0x4bd370);})[_0x2ebe('0x26')](function(_0x1da379){_0xca7d07[_0x2ebe('0x41')]=_0x1da379;return _0xca7d07;})[_0x2ebe('0x26')](respondWithFilteredResult(_0x5c2205,_0x4bd370))[_0x2ebe('0x42')](handleError(_0x5c2205,null));};exports[_0x2ebe('0x43')]=function(_0x45f3a8,_0x2dc841){var _0x5987dc={'raw':!![],'where':{'id':_0x45f3a8[_0x2ebe('0x44')]['id']}},_0x41fb16={};_0x41fb16[_0x2ebe('0x2c')]=_[_0x2ebe('0x2e')](db[_0x2ebe('0x3d')]['rawAttributes']);_0x41fb16[_0x2ebe('0x2d')]=_[_0x2ebe('0x2e')](_0x45f3a8['query']);_0x41fb16['filters']=_[_0x2ebe('0x31')](_0x41fb16[_0x2ebe('0x2c')],_0x41fb16[_0x2ebe('0x2d')]);_0x5987dc[_0x2ebe('0x30')]=_[_0x2ebe('0x31')](_0x41fb16[_0x2ebe('0x2c')],qs[_0x2ebe('0x32')](_0x45f3a8[_0x2ebe('0x2d')]['fields']));_0x5987dc[_0x2ebe('0x30')]=_0x5987dc['attributes'][_0x2ebe('0x33')]?_0x5987dc['attributes']:_0x41fb16[_0x2ebe('0x2c')];if(_0x45f3a8[_0x2ebe('0x2d')][_0x2ebe('0x3e')]){_0x5987dc['include']=[{'all':!![]}];}_0x5987dc=_[_0x2ebe('0x3a')]({},_0x5987dc,_0x45f3a8[_0x2ebe('0x3c')]);return db['MailServerOut'][_0x2ebe('0x45')](_0x5987dc)[_0x2ebe('0x26')](handleEntityNotFound(_0x2dc841,null))[_0x2ebe('0x26')](respondWithResult(_0x2dc841,null))['catch'](handleError(_0x2dc841,null));};exports[_0x2ebe('0x46')]=function(_0x12ed85,_0x184a2d){return db[_0x2ebe('0x3d')][_0x2ebe('0x46')](_0x12ed85[_0x2ebe('0x47')],{})[_0x2ebe('0x26')](respondWithResult(_0x184a2d,0xc9))['catch'](handleError(_0x184a2d,null));};exports[_0x2ebe('0x48')]=function(_0x508da0,_0x2d872a){if(_0x508da0[_0x2ebe('0x47')]['id']){delete _0x508da0['body']['id'];}return db[_0x2ebe('0x3d')]['find']({'where':{'id':_0x508da0['params']['id']}})['then'](handleEntityNotFound(_0x2d872a,null))[_0x2ebe('0x26')](saveUpdates(_0x508da0[_0x2ebe('0x47')],null))[_0x2ebe('0x26')](respondWithResult(_0x2d872a,null))[_0x2ebe('0x42')](handleError(_0x2d872a,null));};exports[_0x2ebe('0x25')]=function(_0x4211b4,_0x97f720){return db['MailServerOut'][_0x2ebe('0x45')]({'where':{'id':_0x4211b4[_0x2ebe('0x44')]['id']}})[_0x2ebe('0x26')](handleEntityNotFound(_0x97f720,null))[_0x2ebe('0x26')](removeEntity(_0x97f720,null))[_0x2ebe('0x42')](handleError(_0x97f720,null));};
\ No newline at end of file
index 1ae049a..b52fe4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9743=['define','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes'];(function(_0x4920f2,_0xa4bfbf){var _0x1f27cf=function(_0x4d94ad){while(--_0x4d94ad){_0x4920f2['push'](_0x4920f2['shift']());}};_0x1f27cf(++_0xa4bfbf);}(_0x9743,0xa6));var _0x3974=function(_0x3b63d2,_0x2fb17a){_0x3b63d2=_0x3b63d2-0x0;var _0x1d1da4=_0x9743[_0x3b63d2];return _0x1d1da4;};'use strict';var _=require('lodash');var util=require(_0x3974('0x0'));var logger=require(_0x3974('0x1'))(_0x3974('0x2'));var moment=require(_0x3974('0x3'));var BPromise=require(_0x3974('0x4'));var rp=require(_0x3974('0x5'));var fs=require('fs');var path=require(_0x3974('0x6'));var rimraf=require(_0x3974('0x7'));var config=require(_0x3974('0x8'));var attributes=require(_0x3974('0x9'));module['exports']=function(_0x3bdea2,_0x1f9885){return _0x3bdea2[_0x3974('0xa')]('MailServerOut',attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8db0=['../../config/environment','exports','MailServerOut','mail_servers_out','lodash','moment','bluebird','request-promise'];(function(_0x2dec55,_0x32895c){var _0x1f6cf4=function(_0x517480){while(--_0x517480){_0x2dec55['push'](_0x2dec55['shift']());}};_0x1f6cf4(++_0x32895c);}(_0x8db0,0x1ac));var _0x08db=function(_0x58eec7,_0x2353db){_0x58eec7=_0x58eec7-0x0;var _0x25c5d3=_0x8db0[_0x58eec7];return _0x25c5d3;};'use strict';var _=require(_0x08db('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x08db('0x1'));var BPromise=require(_0x08db('0x2'));var rp=require(_0x08db('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x08db('0x4'));var attributes=require('./mailServerOut.attributes');module[_0x08db('0x5')]=function(_0x3b8e0c,_0x199282){return _0x3b8e0c['define'](_0x08db('0x6'),attributes,{'tableName':_0x08db('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c30bfe9..a585980 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0xee0467,_0x164441){var _0x227735=function(_0xeab6cf){while(--_0xeab6cf){_0xee0467['push'](_0xee0467['shift']());}};_0x227735(++_0x164441);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc4aa[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0xe5b4c4,_0x17999c){var _0xb16d16=function(_0x523a97){while(--_0x523a97){_0xe5b4c4['push'](_0xe5b4c4['shift']());}};_0xb16d16(++_0x17999c);}(_0x2ef3,0xba));var _0x32ef=function(_0x15ce34,_0x6574c3){_0x15ce34=_0x15ce34-0x0;var _0x5e33ac=_0x2ef3[_0x15ce34];return _0x5e33ac;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
index f37e00e..97668c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86c4=['isAuthenticated','describe','post','create','put','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','index','/describe'];(function(_0x1922e8,_0x32b394){var _0xdfb02c=function(_0x199ea9){while(--_0x199ea9){_0x1922e8['push'](_0x1922e8['shift']());}};_0xdfb02c(++_0x32b394);}(_0x86c4,0xb1));var _0x486c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x86c4[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x486c('0x0'));var path=require(_0x486c('0x1'));var timeout=require(_0x486c('0x2'));var express=require(_0x486c('0x3'));var router=express[_0x486c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x486c('0x5'));var interaction=require(_0x486c('0x6'));var config=require(_0x486c('0x7'));var controller=require(_0x486c('0x8'));router[_0x486c('0x9')]('/',auth['isAuthenticated'](),controller[_0x486c('0xa')]);router['get'](_0x486c('0xb'),auth[_0x486c('0xc')](),controller[_0x486c('0xd')]);router[_0x486c('0x9')]('/:id',auth[_0x486c('0xc')](),controller['show']);router[_0x486c('0xe')]('/',auth[_0x486c('0xc')](),controller[_0x486c('0xf')]);router[_0x486c('0x10')](_0x486c('0x11'),auth[_0x486c('0xc')](),controller['update']);router[_0x486c('0x12')]('/:id',auth[_0x486c('0xc')](),controller[_0x486c('0x13')]);module[_0x486c('0x14')]=router;
\ No newline at end of file
+var _0xc994=['/describe','describe','/:id','put','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','index'];(function(_0x5bb0d2,_0x4ea415){var _0x51234e=function(_0x443d0e){while(--_0x443d0e){_0x5bb0d2['push'](_0x5bb0d2['shift']());}};_0x51234e(++_0x4ea415);}(_0xc994,0xa6));var _0x4c99=function(_0x391e71,_0x42ad45){_0x391e71=_0x391e71-0x0;var _0x29091e=_0xc994[_0x391e71];return _0x29091e;};'use strict';var multer=require(_0x4c99('0x0'));var util=require(_0x4c99('0x1'));var path=require('path');var timeout=require(_0x4c99('0x2'));var express=require('express');var router=express[_0x4c99('0x3')]();var fs_extra=require(_0x4c99('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4c99('0x5'));var config=require('../../config/environment');var controller=require(_0x4c99('0x6'));router[_0x4c99('0x7')]('/',auth[_0x4c99('0x8')](),controller[_0x4c99('0x9')]);router[_0x4c99('0x7')](_0x4c99('0xa'),auth[_0x4c99('0x8')](),controller[_0x4c99('0xb')]);router[_0x4c99('0x7')](_0x4c99('0xc'),auth[_0x4c99('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4c99('0xd')](_0x4c99('0xc'),auth[_0x4c99('0x8')](),controller['update']);router['delete'](_0x4c99('0xc'),auth[_0x4c99('0x8')](),controller[_0x4c99('0xe')]);module[_0x4c99('0xf')]=router;
\ No newline at end of file
index f4aff0c..ddc4740 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4c7=['STRING','name','sequelize','exports'];(function(_0x323500,_0x18dddf){var _0x5448d7=function(_0x555a56){while(--_0x555a56){_0x323500['push'](_0x323500['shift']());}};_0x5448d7(++_0x18dddf);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x18dc41,_0x210ea9){_0x18dc41=_0x18dc41-0x0;var _0x7a0ed5=_0xb4c7[_0x18dc41];return _0x7a0ed5;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'name':{'type':Sequelize[_0x7b4c('0x2')],'unique':_0x7b4c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7b4c('0x2')]}};
\ No newline at end of file
+var _0xfc17=['sequelize','exports','STRING','name'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x1fdd59,_0x3ed561){_0x1fdd59=_0x1fdd59-0x0;var _0x4636d0=_0xfc17[_0x1fdd59];return _0x4636d0;};'use strict';var Sequelize=require(_0x7fc1('0x0'));module[_0x7fc1('0x1')]={'name':{'type':Sequelize[_0x7fc1('0x2')],'unique':_0x7fc1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 574214d..7f9935a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38df=['hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','keys','rawAttributes','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','MailSubstatus','fieldName','type','model','query','filters','intersection','fields','attributes'];(function(_0x2e80e1,_0x2290db){var _0x464687=function(_0x46144b){while(--_0x46144b){_0x2e80e1['push'](_0x2e80e1['shift']());}};_0x464687(++_0x2290db);}(_0x38df,0xad));var _0xf38d=function(_0x196004,_0x31a6fc){_0x196004=_0x196004-0x0;var _0xec74b6=_0x38df[_0x196004];return _0xec74b6;};'use strict';var emlformat=require(_0xf38d('0x0'));var rimraf=require(_0xf38d('0x1'));var zipdir=require(_0xf38d('0x2'));var jsonpatch=require(_0xf38d('0x3'));var rp=require(_0xf38d('0x4'));var moment=require(_0xf38d('0x5'));var BPromise=require(_0xf38d('0x6'));var Mustache=require(_0xf38d('0x7'));var util=require(_0xf38d('0x8'));var path=require(_0xf38d('0x9'));var sox=require(_0xf38d('0xa'));var csv=require(_0xf38d('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf38d('0xc'));var jsforce=require(_0xf38d('0xd'));var deskjs=require(_0xf38d('0xe'));var toCsv=require(_0xf38d('0xb'));var querystring=require('querystring');var Papa=require(_0xf38d('0xf'));var Redis=require(_0xf38d('0x10'));var authService=require(_0xf38d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf38d('0x12'));var hardwareService=require(_0xf38d('0x13'));var logger=require('../../config/logger')(_0xf38d('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf38d('0x15'))['db'];function respondWithStatusCode(_0x571e44,_0x45b5a8){_0x45b5a8=_0x45b5a8||0xcc;return function(_0xd769c6){if(_0xd769c6){return _0x571e44[_0xf38d('0x16')](_0x45b5a8);}return _0x571e44[_0xf38d('0x17')](_0x45b5a8)[_0xf38d('0x18')]();};}function respondWithResult(_0x448365,_0x487a68){_0x487a68=_0x487a68||0xc8;return function(_0x284600){if(_0x284600){return _0x448365[_0xf38d('0x17')](_0x487a68)[_0xf38d('0x19')](_0x284600);}};}function respondWithFilteredResult(_0x148200,_0x3455ff){return function(_0x1d8ee5){if(_0x1d8ee5){var _0x5e29ed=typeof _0x3455ff[_0xf38d('0x1a')]==='undefined'&&typeof _0x3455ff[_0xf38d('0x1b')]===_0xf38d('0x1c');var _0x5f3058=_0x1d8ee5[_0xf38d('0x1d')];var _0x3401a1=_0x5e29ed?0x0:_0x3455ff[_0xf38d('0x1a')];var _0x8e505f=_0x5e29ed?_0x1d8ee5[_0xf38d('0x1d')]:_0x3455ff[_0xf38d('0x1a')]+_0x3455ff[_0xf38d('0x1b')];var _0x2e64a6;if(_0x8e505f>=_0x5f3058){_0x8e505f=_0x5f3058;_0x2e64a6=0xc8;}else{_0x2e64a6=0xce;}_0x148200['status'](_0x2e64a6);return _0x148200[_0xf38d('0x1e')](_0xf38d('0x1f'),_0x3401a1+'-'+_0x8e505f+'/'+_0x5f3058)[_0xf38d('0x19')](_0x1d8ee5);}return null;};}function patchUpdates(_0x22be16){return function(_0x3cd3da){try{jsonpatch[_0xf38d('0x20')](_0x3cd3da,_0x22be16,!![]);}catch(_0x4bac5b){return BPromise['reject'](_0x4bac5b);}return _0x3cd3da[_0xf38d('0x21')]();};}function saveUpdates(_0x49517f,_0x3921f1){return function(_0x37240c){if(_0x37240c){return _0x37240c[_0xf38d('0x22')](_0x49517f)[_0xf38d('0x23')](function(_0x2c7c9f){return _0x2c7c9f;});}return null;};}function removeEntity(_0x129644,_0x164035){return function(_0x354ca8){if(_0x354ca8){return _0x354ca8[_0xf38d('0x24')]()[_0xf38d('0x23')](function(){_0x129644[_0xf38d('0x17')](0xcc)[_0xf38d('0x18')]();});}};}function handleEntityNotFound(_0x1519aa,_0xcc26da){return function(_0xfdce50){if(!_0xfdce50){_0x1519aa[_0xf38d('0x16')](0x194);}return _0xfdce50;};}function handleError(_0x53b47e,_0x568b1f){_0x568b1f=_0x568b1f||0x1f4;return function(_0xe1602){logger[_0xf38d('0x25')](_0xe1602[_0xf38d('0x26')]);if(_0xe1602[_0xf38d('0x27')]){delete _0xe1602[_0xf38d('0x27')];}_0x53b47e[_0xf38d('0x17')](_0x568b1f)[_0xf38d('0x28')](_0xe1602);};}exports[_0xf38d('0x29')]=function(_0x4e5527,_0x2c5325){var _0x331f11={},_0x3000ed={},_0x38eaa0={'count':0x0,'rows':[]};var _0x379552=_[_0xf38d('0x2a')](db[_0xf38d('0x2b')]['rawAttributes'],function(_0x56c796){return{'name':_0x56c796[_0xf38d('0x2c')],'type':_0x56c796[_0xf38d('0x2d')]['key']};});_0x3000ed[_0xf38d('0x2e')]=_['map'](_0x379552,'name');_0x3000ed[_0xf38d('0x2f')]=_['keys'](_0x4e5527[_0xf38d('0x2f')]);_0x3000ed[_0xf38d('0x30')]=_[_0xf38d('0x31')](_0x3000ed['model'],_0x3000ed['query']);_0x331f11['attributes']=_[_0xf38d('0x31')](_0x3000ed[_0xf38d('0x2e')],qs[_0xf38d('0x32')](_0x4e5527['query']['fields']));_0x331f11[_0xf38d('0x33')]=_0x331f11[_0xf38d('0x33')]['length']?_0x331f11[_0xf38d('0x33')]:_0x3000ed[_0xf38d('0x2e')];if(!_0x4e5527[_0xf38d('0x2f')][_0xf38d('0x34')](_0xf38d('0x35'))){_0x331f11['limit']=qs['limit'](_0x4e5527[_0xf38d('0x2f')][_0xf38d('0x1b')]);_0x331f11['offset']=qs[_0xf38d('0x1a')](_0x4e5527[_0xf38d('0x2f')]['offset']);}_0x331f11[_0xf38d('0x36')]=qs[_0xf38d('0x37')](_0x4e5527[_0xf38d('0x2f')][_0xf38d('0x37')]);_0x331f11[_0xf38d('0x38')]=qs[_0xf38d('0x30')](_[_0xf38d('0x39')](_0x4e5527[_0xf38d('0x2f')],_0x3000ed[_0xf38d('0x30')]),_0x379552);if(_0x4e5527[_0xf38d('0x2f')]['filter']){_0x331f11[_0xf38d('0x38')]=_[_0xf38d('0x3a')](_0x331f11[_0xf38d('0x38')],{'$or':_[_0xf38d('0x2a')](_0x379552,function(_0x1396fd){if(_0x1396fd[_0xf38d('0x2d')]!==_0xf38d('0x3b')){var _0x3daaec={};_0x3daaec[_0x1396fd[_0xf38d('0x27')]]={'$like':'%'+_0x4e5527[_0xf38d('0x2f')][_0xf38d('0x3c')]+'%'};return _0x3daaec;}})});}_0x331f11=_[_0xf38d('0x3a')]({},_0x331f11,_0x4e5527[_0xf38d('0x3d')]);var _0x3cac45={'where':_0x331f11[_0xf38d('0x38')]};return db[_0xf38d('0x2b')][_0xf38d('0x1d')](_0x3cac45)[_0xf38d('0x23')](function(_0x312a5a){_0x38eaa0[_0xf38d('0x1d')]=_0x312a5a;if(_0x4e5527[_0xf38d('0x2f')][_0xf38d('0x3e')]){_0x331f11['include']=[{'all':!![]}];}return db[_0xf38d('0x2b')]['findAll'](_0x331f11);})[_0xf38d('0x23')](function(_0x1440e1){_0x38eaa0[_0xf38d('0x3f')]=_0x1440e1;return _0x38eaa0;})[_0xf38d('0x23')](respondWithFilteredResult(_0x2c5325,_0x331f11))[_0xf38d('0x40')](handleError(_0x2c5325,null));};exports[_0xf38d('0x41')]=function(_0x129a4,_0x61778a){var _0x187289={'raw':!![],'where':{'id':_0x129a4[_0xf38d('0x42')]['id']}},_0x237f50={};_0x237f50[_0xf38d('0x2e')]=_[_0xf38d('0x43')](db[_0xf38d('0x2b')][_0xf38d('0x44')]);_0x237f50[_0xf38d('0x2f')]=_['keys'](_0x129a4['query']);_0x237f50[_0xf38d('0x30')]=_[_0xf38d('0x31')](_0x237f50[_0xf38d('0x2e')],_0x237f50[_0xf38d('0x2f')]);_0x187289[_0xf38d('0x33')]=_[_0xf38d('0x31')](_0x237f50['model'],qs[_0xf38d('0x32')](_0x129a4[_0xf38d('0x2f')][_0xf38d('0x32')]));_0x187289[_0xf38d('0x33')]=_0x187289[_0xf38d('0x33')][_0xf38d('0x45')]?_0x187289[_0xf38d('0x33')]:_0x237f50[_0xf38d('0x2e')];if(_0x129a4[_0xf38d('0x2f')][_0xf38d('0x3e')]){_0x187289[_0xf38d('0x46')]=[{'all':!![]}];}_0x187289=_[_0xf38d('0x3a')]({},_0x187289,_0x129a4['options']);return db['MailSubstatus'][_0xf38d('0x47')](_0x187289)[_0xf38d('0x23')](handleEntityNotFound(_0x61778a,null))[_0xf38d('0x23')](respondWithResult(_0x61778a,null))['catch'](handleError(_0x61778a,null));};exports[_0xf38d('0x48')]=function(_0x179790,_0x501fa8){return db['MailSubstatus'][_0xf38d('0x48')](_0x179790['body'],{})[_0xf38d('0x23')](respondWithResult(_0x501fa8,0xc9))[_0xf38d('0x40')](handleError(_0x501fa8,null));};exports[_0xf38d('0x22')]=function(_0x5b8fd1,_0xa6b5fc){if(_0x5b8fd1[_0xf38d('0x49')]['id']){delete _0x5b8fd1[_0xf38d('0x49')]['id'];}return db[_0xf38d('0x2b')][_0xf38d('0x47')]({'where':{'id':_0x5b8fd1[_0xf38d('0x42')]['id']}})[_0xf38d('0x23')](handleEntityNotFound(_0xa6b5fc,null))['then'](saveUpdates(_0x5b8fd1['body'],null))[_0xf38d('0x23')](respondWithResult(_0xa6b5fc,null))[_0xf38d('0x40')](handleError(_0xa6b5fc,null));};exports[_0xf38d('0x24')]=function(_0x548b90,_0x3915f8){return db[_0xf38d('0x2b')][_0xf38d('0x47')]({'where':{'id':_0x548b90['params']['id']}})[_0xf38d('0x23')](handleEntityNotFound(_0x3915f8,null))[_0xf38d('0x23')](removeEntity(_0x3915f8,null))['catch'](handleError(_0x3915f8,null));};exports[_0xf38d('0x4a')]=function(_0x3d4bc3,_0x38652d){return db[_0xf38d('0x2b')][_0xf38d('0x4a')]()[_0xf38d('0x23')](respondWithResult(_0x38652d,null))['catch'](handleError(_0x38652d,null));};
\ No newline at end of file
+var _0x08ce=['intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','includeAll','include','rows','catch','show','params','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','map','MailSubstatus','rawAttributes','fieldName','type','key','model','keys','query','filters'];(function(_0x35ee4c,_0x44ee31){var _0x11882c=function(_0x509c22){while(--_0x509c22){_0x35ee4c['push'](_0x35ee4c['shift']());}};_0x11882c(++_0x44ee31);}(_0x08ce,0xb1));var _0xe08c=function(_0x1af07b,_0x1aa449){_0x1af07b=_0x1af07b-0x0;var _0x300ad6=_0x08ce[_0x1af07b];return _0x300ad6;};'use strict';var emlformat=require(_0xe08c('0x0'));var rimraf=require(_0xe08c('0x1'));var zipdir=require(_0xe08c('0x2'));var jsonpatch=require(_0xe08c('0x3'));var rp=require(_0xe08c('0x4'));var moment=require(_0xe08c('0x5'));var BPromise=require(_0xe08c('0x6'));var Mustache=require('mustache');var util=require(_0xe08c('0x7'));var path=require(_0xe08c('0x8'));var sox=require(_0xe08c('0x9'));var csv=require(_0xe08c('0xa'));var ejs=require(_0xe08c('0xb'));var fs=require('fs');var fs_extra=require(_0xe08c('0xc'));var _=require('lodash');var squel=require(_0xe08c('0xd'));var crypto=require(_0xe08c('0xe'));var jsforce=require(_0xe08c('0xf'));var deskjs=require(_0xe08c('0x10'));var toCsv=require(_0xe08c('0xa'));var querystring=require(_0xe08c('0x11'));var Papa=require('papaparse');var Redis=require(_0xe08c('0x12'));var authService=require(_0xe08c('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe08c('0x14'));var hardwareService=require(_0xe08c('0x15'));var logger=require(_0xe08c('0x16'))('api');var utils=require(_0xe08c('0x17'));var config=require(_0xe08c('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x319605,_0x4dc4e7){_0x4dc4e7=_0x4dc4e7||0xcc;return function(_0x4d140c){if(_0x4d140c){return _0x319605['sendStatus'](_0x4dc4e7);}return _0x319605[_0xe08c('0x19')](_0x4dc4e7)[_0xe08c('0x1a')]();};}function respondWithResult(_0x588abc,_0x3d715e){_0x3d715e=_0x3d715e||0xc8;return function(_0x380836){if(_0x380836){return _0x588abc[_0xe08c('0x19')](_0x3d715e)[_0xe08c('0x1b')](_0x380836);}};}function respondWithFilteredResult(_0x179a73,_0x464ab2){return function(_0xb826f0){if(_0xb826f0){var _0x3b225b=typeof _0x464ab2['offset']===_0xe08c('0x1c')&&typeof _0x464ab2[_0xe08c('0x1d')]===_0xe08c('0x1c');var _0x3ffca7=_0xb826f0[_0xe08c('0x1e')];var _0x3bff4d=_0x3b225b?0x0:_0x464ab2[_0xe08c('0x1f')];var _0x311ca4=_0x3b225b?_0xb826f0[_0xe08c('0x1e')]:_0x464ab2['offset']+_0x464ab2[_0xe08c('0x1d')];var _0x263bf5;if(_0x311ca4>=_0x3ffca7){_0x311ca4=_0x3ffca7;_0x263bf5=0xc8;}else{_0x263bf5=0xce;}_0x179a73[_0xe08c('0x19')](_0x263bf5);return _0x179a73[_0xe08c('0x20')](_0xe08c('0x21'),_0x3bff4d+'-'+_0x311ca4+'/'+_0x3ffca7)[_0xe08c('0x1b')](_0xb826f0);}return null;};}function patchUpdates(_0x446c10){return function(_0x1749e3){try{jsonpatch[_0xe08c('0x22')](_0x1749e3,_0x446c10,!![]);}catch(_0x3640fd){return BPromise[_0xe08c('0x23')](_0x3640fd);}return _0x1749e3[_0xe08c('0x24')]();};}function saveUpdates(_0x24932d,_0x3d3897){return function(_0xdf58c4){if(_0xdf58c4){return _0xdf58c4['update'](_0x24932d)[_0xe08c('0x25')](function(_0x93300e){return _0x93300e;});}return null;};}function removeEntity(_0x40a60d,_0x20fbcf){return function(_0x525878){if(_0x525878){return _0x525878[_0xe08c('0x26')]()[_0xe08c('0x25')](function(){_0x40a60d[_0xe08c('0x19')](0xcc)[_0xe08c('0x1a')]();});}};}function handleEntityNotFound(_0x54b8d3,_0x2ec3da){return function(_0x2972ba){if(!_0x2972ba){_0x54b8d3[_0xe08c('0x27')](0x194);}return _0x2972ba;};}function handleError(_0x31f047,_0x4bba01){_0x4bba01=_0x4bba01||0x1f4;return function(_0x56e3b9){logger[_0xe08c('0x28')](_0x56e3b9[_0xe08c('0x29')]);if(_0x56e3b9[_0xe08c('0x2a')]){delete _0x56e3b9[_0xe08c('0x2a')];}_0x31f047['status'](_0x4bba01)[_0xe08c('0x2b')](_0x56e3b9);};}exports['index']=function(_0x6a1c2,_0xf51334){var _0x2b14da={},_0x55c748={},_0x777e15={'count':0x0,'rows':[]};var _0xfcd769=_[_0xe08c('0x2c')](db[_0xe08c('0x2d')][_0xe08c('0x2e')],function(_0x5b5713){return{'name':_0x5b5713[_0xe08c('0x2f')],'type':_0x5b5713[_0xe08c('0x30')][_0xe08c('0x31')]};});_0x55c748[_0xe08c('0x32')]=_[_0xe08c('0x2c')](_0xfcd769,_0xe08c('0x2a'));_0x55c748['query']=_[_0xe08c('0x33')](_0x6a1c2[_0xe08c('0x34')]);_0x55c748[_0xe08c('0x35')]=_[_0xe08c('0x36')](_0x55c748[_0xe08c('0x32')],_0x55c748[_0xe08c('0x34')]);_0x2b14da['attributes']=_[_0xe08c('0x36')](_0x55c748['model'],qs['fields'](_0x6a1c2['query'][_0xe08c('0x37')]));_0x2b14da[_0xe08c('0x38')]=_0x2b14da[_0xe08c('0x38')][_0xe08c('0x39')]?_0x2b14da[_0xe08c('0x38')]:_0x55c748['model'];if(!_0x6a1c2[_0xe08c('0x34')][_0xe08c('0x3a')](_0xe08c('0x3b'))){_0x2b14da[_0xe08c('0x1d')]=qs[_0xe08c('0x1d')](_0x6a1c2['query'][_0xe08c('0x1d')]);_0x2b14da[_0xe08c('0x1f')]=qs[_0xe08c('0x1f')](_0x6a1c2['query']['offset']);}_0x2b14da[_0xe08c('0x3c')]=qs[_0xe08c('0x3d')](_0x6a1c2[_0xe08c('0x34')][_0xe08c('0x3d')]);_0x2b14da['where']=qs[_0xe08c('0x35')](_[_0xe08c('0x3e')](_0x6a1c2[_0xe08c('0x34')],_0x55c748[_0xe08c('0x35')]),_0xfcd769);if(_0x6a1c2[_0xe08c('0x34')][_0xe08c('0x3f')]){_0x2b14da[_0xe08c('0x40')]=_['merge'](_0x2b14da['where'],{'$or':_[_0xe08c('0x2c')](_0xfcd769,function(_0x35acb9){if(_0x35acb9[_0xe08c('0x30')]!==_0xe08c('0x41')){var _0x720dde={};_0x720dde[_0x35acb9[_0xe08c('0x2a')]]={'$like':'%'+_0x6a1c2[_0xe08c('0x34')][_0xe08c('0x3f')]+'%'};return _0x720dde;}})});}_0x2b14da=_['merge']({},_0x2b14da,_0x6a1c2['options']);var _0x3563cb={'where':_0x2b14da[_0xe08c('0x40')]};return db[_0xe08c('0x2d')][_0xe08c('0x1e')](_0x3563cb)[_0xe08c('0x25')](function(_0x53fe60){_0x777e15[_0xe08c('0x1e')]=_0x53fe60;if(_0x6a1c2[_0xe08c('0x34')][_0xe08c('0x42')]){_0x2b14da[_0xe08c('0x43')]=[{'all':!![]}];}return db[_0xe08c('0x2d')]['findAll'](_0x2b14da);})[_0xe08c('0x25')](function(_0x213fa9){_0x777e15[_0xe08c('0x44')]=_0x213fa9;return _0x777e15;})[_0xe08c('0x25')](respondWithFilteredResult(_0xf51334,_0x2b14da))[_0xe08c('0x45')](handleError(_0xf51334,null));};exports[_0xe08c('0x46')]=function(_0x565aeb,_0x5640a2){var _0x19b0c8={'raw':!![],'where':{'id':_0x565aeb[_0xe08c('0x47')]['id']}},_0x14179c={};_0x14179c[_0xe08c('0x32')]=_[_0xe08c('0x33')](db['MailSubstatus']['rawAttributes']);_0x14179c['query']=_['keys'](_0x565aeb[_0xe08c('0x34')]);_0x14179c[_0xe08c('0x35')]=_['intersection'](_0x14179c[_0xe08c('0x32')],_0x14179c[_0xe08c('0x34')]);_0x19b0c8[_0xe08c('0x38')]=_['intersection'](_0x14179c[_0xe08c('0x32')],qs[_0xe08c('0x37')](_0x565aeb[_0xe08c('0x34')]['fields']));_0x19b0c8['attributes']=_0x19b0c8[_0xe08c('0x38')][_0xe08c('0x39')]?_0x19b0c8['attributes']:_0x14179c[_0xe08c('0x32')];if(_0x565aeb['query'][_0xe08c('0x42')]){_0x19b0c8['include']=[{'all':!![]}];}_0x19b0c8=_['merge']({},_0x19b0c8,_0x565aeb['options']);return db[_0xe08c('0x2d')]['find'](_0x19b0c8)[_0xe08c('0x25')](handleEntityNotFound(_0x5640a2,null))['then'](respondWithResult(_0x5640a2,null))[_0xe08c('0x45')](handleError(_0x5640a2,null));};exports[_0xe08c('0x48')]=function(_0x4208f1,_0x4772bc){return db[_0xe08c('0x2d')][_0xe08c('0x48')](_0x4208f1[_0xe08c('0x49')],{})[_0xe08c('0x25')](respondWithResult(_0x4772bc,0xc9))['catch'](handleError(_0x4772bc,null));};exports[_0xe08c('0x4a')]=function(_0xf295b5,_0x2d545b){if(_0xf295b5[_0xe08c('0x49')]['id']){delete _0xf295b5['body']['id'];}return db[_0xe08c('0x2d')][_0xe08c('0x4b')]({'where':{'id':_0xf295b5[_0xe08c('0x47')]['id']}})['then'](handleEntityNotFound(_0x2d545b,null))['then'](saveUpdates(_0xf295b5[_0xe08c('0x49')],null))[_0xe08c('0x25')](respondWithResult(_0x2d545b,null))['catch'](handleError(_0x2d545b,null));};exports['destroy']=function(_0x25d543,_0x370c88){return db['MailSubstatus'][_0xe08c('0x4b')]({'where':{'id':_0x25d543[_0xe08c('0x47')]['id']}})['then'](handleEntityNotFound(_0x370c88,null))[_0xe08c('0x25')](removeEntity(_0x370c88,null))[_0xe08c('0x45')](handleError(_0x370c88,null));};exports[_0xe08c('0x4c')]=function(_0x1c8e8e,_0x29e424){return db['MailSubstatus'][_0xe08c('0x4c')]()[_0xe08c('0x25')](respondWithResult(_0x29e424,null))[_0xe08c('0x45')](handleError(_0x29e424,null));};
\ No newline at end of file
index a5c4d81..bd38f7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebfc=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailSubstatus','setMaxListeners'];(function(_0x14a64f,_0x319ac6){var _0x1b0fc9=function(_0x78c95b){while(--_0x78c95b){_0x14a64f['push'](_0x14a64f['shift']());}};_0x1b0fc9(++_0x319ac6);}(_0xebfc,0x140));var _0xcebf=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0xebfc[_0x65c50e];return _0x4573e7;};'use strict';var EventEmitter=require(_0xcebf('0x0'));var MailSubstatus=require(_0xcebf('0x1'))['db'][_0xcebf('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xcebf('0x3')](0x0);var events={'afterUpdate':_0xcebf('0x4')};function emitEvent(_0x3d4657){return function(_0x4321b1,_0x193f03,_0x286d84){MailSubstatusEvents[_0xcebf('0x5')](_0x3d4657+':'+_0x4321b1['id'],_0x4321b1);MailSubstatusEvents[_0xcebf('0x5')](_0x3d4657,_0x4321b1);_0x286d84(null);};}for(var e in events){if(events[_0xcebf('0x6')](e)){var event=events[e];MailSubstatus[_0xcebf('0x7')](e,emitEvent(event));}}module[_0xcebf('0x8')]=MailSubstatusEvents;
\ No newline at end of file
+var _0xb16f=['MailSubstatus','setMaxListeners','emit','hasOwnProperty','hook','exports','events'];(function(_0x1b999d,_0x2bd07){var _0x47b8e9=function(_0x3febbc){while(--_0x3febbc){_0x1b999d['push'](_0x1b999d['shift']());}};_0x47b8e9(++_0x2bd07);}(_0xb16f,0x14f));var _0xfb16=function(_0x34a8c8,_0x31e259){_0x34a8c8=_0x34a8c8-0x0;var _0x1fe6e5=_0xb16f[_0x34a8c8];return _0x1fe6e5;};'use strict';var EventEmitter=require(_0xfb16('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0xfb16('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xfb16('0x2')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0xd1c3de){return function(_0x20dd52,_0x583205,_0x45f974){MailSubstatusEvents[_0xfb16('0x3')](_0xd1c3de+':'+_0x20dd52['id'],_0x20dd52);MailSubstatusEvents[_0xfb16('0x3')](_0xd1c3de,_0x20dd52);_0x45f974(null);};}for(var e in events){if(events[_0xfb16('0x4')](e)){var event=events[e];MailSubstatus[_0xfb16('0x5')](e,emitEvent(event));}}module[_0xfb16('0x6')]=MailSubstatusEvents;
\ No newline at end of file
index 78bb098..9c02d21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x498e=['then','catch','./mailSubstatus.attributes','models','define','MailSubstatus','mail_substatuses','update','name','mailSubstatus','_previousDataValues'];(function(_0x1973a3,_0x53bee8){var _0x229ecf=function(_0x4aa302){while(--_0x4aa302){_0x1973a3['push'](_0x1973a3['shift']());}};_0x229ecf(++_0x53bee8);}(_0x498e,0x178));var _0xe498=function(_0x5d6f17,_0x5a5a1f){_0x5d6f17=_0x5d6f17-0x0;var _0x578e37=_0x498e[_0x5d6f17];return _0x578e37;};'use strict';var attributes=require(_0xe498('0x0'));module['exports']=function(_0x58c062){var _0x13234b=_0x58c062[_0xe498('0x1')];return _0x58c062[_0xe498('0x2')](_0xe498('0x3'),attributes,{'tableName':_0xe498('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x591682,_0x96a849,_0x75f9bd){return _0x13234b['Condition'][_0xe498('0x5')]({'value':_0x591682[_0xe498('0x6')]},{'where':{'field':_0xe498('0x7'),'value':_0x591682[_0xe498('0x8')][_0xe498('0x6')]}})[_0xe498('0x9')](function(){_0x75f9bd();})[_0xe498('0xa')](function(_0x49e4c6){_0x75f9bd(_0x49e4c6);});}}});};
\ No newline at end of file
+var _0x9a49=['define','MailSubstatus','Condition','update','mailSubstatus','name','catch','./mailSubstatus.attributes','models'];(function(_0x57d370,_0x3ed0f6){var _0x550fd2=function(_0x59634f){while(--_0x59634f){_0x57d370['push'](_0x57d370['shift']());}};_0x550fd2(++_0x3ed0f6);}(_0x9a49,0x19c));var _0x99a4=function(_0x542954,_0x56a73b){_0x542954=_0x542954-0x0;var _0x2d594d=_0x9a49[_0x542954];return _0x2d594d;};'use strict';var attributes=require(_0x99a4('0x0'));module['exports']=function(_0x13158a){var _0xfd31cc=_0x13158a[_0x99a4('0x1')];return _0x13158a[_0x99a4('0x2')](_0x99a4('0x3'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1d6aa4,_0x2c1912,_0x59366c){return _0xfd31cc[_0x99a4('0x4')][_0x99a4('0x5')]({'value':_0x1d6aa4['name']},{'where':{'field':_0x99a4('0x6'),'value':_0x1d6aa4['_previousDataValues'][_0x99a4('0x7')]}})['then'](function(){_0x59366c();})[_0x99a4('0x8')](function(_0x1e90c2){_0x59366c(_0x1e90c2);});}}});};
\ No newline at end of file
index 21bbebf..9985905 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc0f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','util','moment'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xbc0f,0x1a0));var _0xfbc0=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xbc0f[_0x1969a7];return _0x3d665f;};'use strict';var _=require('lodash');var util=require(_0xfbc0('0x0'));var moment=require(_0xfbc0('0x1'));var BPromise=require(_0xfbc0('0x2'));var rs=require(_0xfbc0('0x3'));var fs=require('fs');var Redis=require(_0xfbc0('0x4'));var db=require(_0xfbc0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfbc0('0x6'))(_0xfbc0('0x7'));var config=require(_0xfbc0('0x8'));var jayson=require(_0xfbc0('0x9'));var client=jayson[_0xfbc0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa3c324,_0x17a839,_0x1366dc){return new BPromise(function(_0x504eb9,_0xda0ded){return client[_0xfbc0('0xb')](_0xa3c324,_0x1366dc)[_0xfbc0('0xc')](function(_0x460c6d){logger['info'](_0xfbc0('0xd'),_0x17a839,_0xfbc0('0xe'));logger[_0xfbc0('0xf')](_0xfbc0('0x10'),_0x17a839,'request\x20sent',JSON[_0xfbc0('0x11')](_0x460c6d));if(_0x460c6d[_0xfbc0('0x12')]){if(_0x460c6d[_0xfbc0('0x12')]['code']===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x17a839,_0x460c6d[_0xfbc0('0x12')][_0xfbc0('0x13')]);return _0xda0ded(_0x460c6d[_0xfbc0('0x12')][_0xfbc0('0x13')]);}logger[_0xfbc0('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x17a839,_0x460c6d[_0xfbc0('0x12')]['message']);return _0x504eb9(_0x460c6d[_0xfbc0('0x12')][_0xfbc0('0x13')]);}else{logger[_0xfbc0('0x14')](_0xfbc0('0xd'),_0x17a839,_0xfbc0('0xe'));_0x504eb9(_0x460c6d['result'][_0xfbc0('0x13')]);}})[_0xfbc0('0x15')](function(_0x50ff22){logger[_0xfbc0('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x17a839,_0x50ff22);_0xda0ded(_0x50ff22);});});}
\ No newline at end of file
+var _0x0927=['client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0x0927,0x18d));var _0x7092=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0927[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7092('0x0'));var util=require('util');var moment=require(_0x7092('0x1'));var BPromise=require(_0x7092('0x2'));var rs=require(_0x7092('0x3'));var fs=require('fs');var Redis=require(_0x7092('0x4'));var db=require(_0x7092('0x5'))['db'];var utils=require(_0x7092('0x6'));var logger=require(_0x7092('0x7'))(_0x7092('0x8'));var config=require(_0x7092('0x9'));var jayson=require(_0x7092('0xa'));var client=jayson[_0x7092('0xb')][_0x7092('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1e76ef,_0x15d5ea,_0x57506e){return new BPromise(function(_0xa6803f,_0x81e9d7){return client[_0x7092('0xd')](_0x1e76ef,_0x57506e)[_0x7092('0xe')](function(_0x363aad){logger[_0x7092('0xf')](_0x7092('0x10'),_0x15d5ea,'request\x20sent');logger[_0x7092('0x11')](_0x7092('0x12'),_0x15d5ea,_0x7092('0x13'),JSON[_0x7092('0x14')](_0x363aad));if(_0x363aad['error']){if(_0x363aad['error'][_0x7092('0x15')]===0x1f4){logger[_0x7092('0x16')](_0x7092('0x10'),_0x15d5ea,_0x363aad[_0x7092('0x16')][_0x7092('0x17')]);return _0x81e9d7(_0x363aad[_0x7092('0x16')][_0x7092('0x17')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x15d5ea,_0x363aad['error'][_0x7092('0x17')]);return _0xa6803f(_0x363aad['error'][_0x7092('0x17')]);}else{logger['info'](_0x7092('0x10'),_0x15d5ea,'request\x20sent');_0xa6803f(_0x363aad['result']['message']);}})['catch'](function(_0x51c3bf){logger[_0x7092('0x16')](_0x7092('0x10'),_0x15d5ea,_0x51c3bf);_0x81e9d7(_0x51c3bf);});});}
\ No newline at end of file
index 23c4c1b..10b6325 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e2e=['../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','show','create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x50bace,_0x16f8b7){var _0x25dc5e=function(_0x52340c){while(--_0x52340c){_0x50bace['push'](_0x50bace['shift']());}};_0x25dc5e(++_0x16f8b7);}(_0x3e2e,0xa5));var _0xe3e2=function(_0x5bbb18,_0x24ce9a){_0x5bbb18=_0x5bbb18-0x0;var _0x5a3142=_0x3e2e[_0x5bbb18];return _0x5a3142;};'use strict';var multer=require('multer');var util=require(_0xe3e2('0x0'));var path=require(_0xe3e2('0x1'));var timeout=require(_0xe3e2('0x2'));var express=require(_0xe3e2('0x3'));var router=express[_0xe3e2('0x4')]();var fs_extra=require(_0xe3e2('0x5'));var auth=require(_0xe3e2('0x6'));var interaction=require(_0xe3e2('0x7'));var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0xe3e2('0x8')](),controller[_0xe3e2('0x9')]);router[_0xe3e2('0xa')](_0xe3e2('0xb'),auth[_0xe3e2('0x8')](),controller[_0xe3e2('0xc')]);router[_0xe3e2('0xa')](_0xe3e2('0xd'),auth[_0xe3e2('0x8')](),controller[_0xe3e2('0xe')]);router['post']('/',auth[_0xe3e2('0x8')](),controller[_0xe3e2('0xf')]);router['put']('/:id',auth[_0xe3e2('0x8')](),controller['update']);router[_0xe3e2('0x10')](_0xe3e2('0xd'),auth[_0xe3e2('0x8')](),controller[_0xe3e2('0x11')]);module[_0xe3e2('0x12')]=router;
\ No newline at end of file
+var _0xcb6d=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','delete','destroy','exports','multer'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcb6d,0xef));var _0xdcb6=function(_0x5117d1,_0x224c53){_0x5117d1=_0x5117d1-0x0;var _0x137ce0=_0xcb6d[_0x5117d1];return _0x137ce0;};'use strict';var multer=require(_0xdcb6('0x0'));var util=require('util');var path=require(_0xdcb6('0x1'));var timeout=require(_0xdcb6('0x2'));var express=require(_0xdcb6('0x3'));var router=express[_0xdcb6('0x4')]();var fs_extra=require(_0xdcb6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdcb6('0x6'));var config=require(_0xdcb6('0x7'));var controller=require('./mailTransferReport.controller');router[_0xdcb6('0x8')]('/',auth[_0xdcb6('0x9')](),controller[_0xdcb6('0xa')]);router['get'](_0xdcb6('0xb'),auth[_0xdcb6('0x9')](),controller[_0xdcb6('0xc')]);router[_0xdcb6('0x8')]('/:id',auth[_0xdcb6('0x9')](),controller[_0xdcb6('0xd')]);router['post']('/',auth[_0xdcb6('0x9')](),controller[_0xdcb6('0xe')]);router[_0xdcb6('0xf')](_0xdcb6('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xdcb6('0x11')]('/:id',auth[_0xdcb6('0x9')](),controller[_0xdcb6('0x12')]);module[_0xdcb6('0x13')]=router;
\ No newline at end of file
index 262c3b2..df783c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x13105b,_0x2d5a10){var _0x385ea9=function(_0x791c7d){while(--_0x791c7d){_0x13105b['push'](_0x13105b['shift']());}};_0x385ea9(++_0x2d5a10);}(_0x70e0,0x17b));var _0x070e=function(_0x1f3367,_0x41d607){_0x1f3367=_0x1f3367-0x0;var _0x583e77=_0x70e0[_0x1f3367];return _0x583e77;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
+var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x31be09,_0x1b22ad){var _0x248d31=function(_0x39ccb5){while(--_0x39ccb5){_0x31be09['push'](_0x31be09['shift']());}};_0x248d31(++_0x1b22ad);}(_0x00bb,0x1d8));var _0xb00b=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x00bb[_0xc6be3a];return _0x56a310;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
index 559d112..180d99c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x107e=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','save','update','destroy','then','end','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','show','keys','options','find','catch','create','body','params','describe','eml-format','rimraf'];(function(_0x1640c1,_0x4d6e1c){var _0x436883=function(_0x4ae471){while(--_0x4ae471){_0x1640c1['push'](_0x1640c1['shift']());}};_0x436883(++_0x4d6e1c);}(_0x107e,0x9a));var _0xe107=function(_0x552304,_0x3b5947){_0x552304=_0x552304-0x0;var _0x49a901=_0x107e[_0x552304];return _0x49a901;};'use strict';var emlformat=require(_0xe107('0x0'));var rimraf=require(_0xe107('0x1'));var zipdir=require(_0xe107('0x2'));var jsonpatch=require(_0xe107('0x3'));var rp=require(_0xe107('0x4'));var moment=require('moment');var BPromise=require(_0xe107('0x5'));var Mustache=require(_0xe107('0x6'));var util=require(_0xe107('0x7'));var path=require(_0xe107('0x8'));var sox=require(_0xe107('0x9'));var csv=require(_0xe107('0xa'));var ejs=require(_0xe107('0xb'));var fs=require('fs');var fs_extra=require(_0xe107('0xc'));var _=require(_0xe107('0xd'));var squel=require(_0xe107('0xe'));var crypto=require(_0xe107('0xf'));var jsforce=require(_0xe107('0x10'));var deskjs=require(_0xe107('0x11'));var toCsv=require(_0xe107('0xa'));var querystring=require(_0xe107('0x12'));var Papa=require('papaparse');var Redis=require(_0xe107('0x13'));var authService=require(_0xe107('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe107('0x15'));var hardwareService=require(_0xe107('0x16'));var logger=require(_0xe107('0x17'))(_0xe107('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe107('0x19'))['db'];function respondWithStatusCode(_0x913cd6,_0x2d5fdb){_0x2d5fdb=_0x2d5fdb||0xcc;return function(_0x122e40){if(_0x122e40){return _0x913cd6[_0xe107('0x1a')](_0x2d5fdb);}return _0x913cd6[_0xe107('0x1b')](_0x2d5fdb)['end']();};}function respondWithResult(_0xc9b866,_0x19377){_0x19377=_0x19377||0xc8;return function(_0x164d6f){if(_0x164d6f){return _0xc9b866[_0xe107('0x1b')](_0x19377)[_0xe107('0x1c')](_0x164d6f);}};}function respondWithFilteredResult(_0x5395eb,_0x553756){return function(_0x51b3f8){if(_0x51b3f8){var _0x4d9428=typeof _0x553756[_0xe107('0x1d')]===_0xe107('0x1e')&&typeof _0x553756['limit']==='undefined';var _0x2d5cf7=_0x51b3f8[_0xe107('0x1f')];var _0xbf11f8=_0x4d9428?0x0:_0x553756[_0xe107('0x1d')];var _0x43646d=_0x4d9428?_0x51b3f8[_0xe107('0x1f')]:_0x553756[_0xe107('0x1d')]+_0x553756[_0xe107('0x20')];var _0x272967;if(_0x43646d>=_0x2d5cf7){_0x43646d=_0x2d5cf7;_0x272967=0xc8;}else{_0x272967=0xce;}_0x5395eb[_0xe107('0x1b')](_0x272967);return _0x5395eb[_0xe107('0x21')](_0xe107('0x22'),_0xbf11f8+'-'+_0x43646d+'/'+_0x2d5cf7)[_0xe107('0x1c')](_0x51b3f8);}return null;};}function patchUpdates(_0x31ab1b){return function(_0x3636a9){try{jsonpatch['apply'](_0x3636a9,_0x31ab1b,!![]);}catch(_0x141cb4){return BPromise['reject'](_0x141cb4);}return _0x3636a9[_0xe107('0x23')]();};}function saveUpdates(_0x88cffc,_0x23a5e9){return function(_0x33e04){if(_0x33e04){return _0x33e04[_0xe107('0x24')](_0x88cffc)['then'](function(_0x45f14a){return _0x45f14a;});}return null;};}function removeEntity(_0x3f63da,_0x3be3bb){return function(_0x1b215a){if(_0x1b215a){return _0x1b215a[_0xe107('0x25')]()[_0xe107('0x26')](function(){_0x3f63da[_0xe107('0x1b')](0xcc)[_0xe107('0x27')]();});}};}function handleEntityNotFound(_0x147b28,_0x4dd232){return function(_0x39e859){if(!_0x39e859){_0x147b28[_0xe107('0x1a')](0x194);}return _0x39e859;};}function handleError(_0x43bbdb,_0x54f9fa){_0x54f9fa=_0x54f9fa||0x1f4;return function(_0x121a2d){logger[_0xe107('0x28')](_0x121a2d[_0xe107('0x29')]);if(_0x121a2d[_0xe107('0x2a')]){delete _0x121a2d[_0xe107('0x2a')];}_0x43bbdb[_0xe107('0x1b')](_0x54f9fa)[_0xe107('0x2b')](_0x121a2d);};}exports[_0xe107('0x2c')]=function(_0x2b54b6,_0x52571f){var _0x7387e1={},_0x1b3b59={},_0x19f686={'count':0x0,'rows':[]};var _0x417b0c=_[_0xe107('0x2d')](db[_0xe107('0x2e')][_0xe107('0x2f')],function(_0x55f9cd){return{'name':_0x55f9cd[_0xe107('0x30')],'type':_0x55f9cd['type'][_0xe107('0x31')]};});_0x1b3b59[_0xe107('0x32')]=_[_0xe107('0x2d')](_0x417b0c,'name');_0x1b3b59['query']=_['keys'](_0x2b54b6[_0xe107('0x33')]);_0x1b3b59[_0xe107('0x34')]=_[_0xe107('0x35')](_0x1b3b59[_0xe107('0x32')],_0x1b3b59['query']);_0x7387e1[_0xe107('0x36')]=_[_0xe107('0x35')](_0x1b3b59[_0xe107('0x32')],qs[_0xe107('0x37')](_0x2b54b6[_0xe107('0x33')][_0xe107('0x37')]));_0x7387e1[_0xe107('0x36')]=_0x7387e1[_0xe107('0x36')][_0xe107('0x38')]?_0x7387e1[_0xe107('0x36')]:_0x1b3b59[_0xe107('0x32')];if(!_0x2b54b6['query'][_0xe107('0x39')]('nolimit')){_0x7387e1[_0xe107('0x20')]=qs[_0xe107('0x20')](_0x2b54b6[_0xe107('0x33')]['limit']);_0x7387e1[_0xe107('0x1d')]=qs[_0xe107('0x1d')](_0x2b54b6[_0xe107('0x33')][_0xe107('0x1d')]);}_0x7387e1[_0xe107('0x3a')]=qs['sort'](_0x2b54b6[_0xe107('0x33')][_0xe107('0x3b')]);_0x7387e1[_0xe107('0x3c')]=qs[_0xe107('0x34')](_[_0xe107('0x3d')](_0x2b54b6[_0xe107('0x33')],_0x1b3b59[_0xe107('0x34')]),_0x417b0c);if(_0x2b54b6[_0xe107('0x33')][_0xe107('0x3e')]){_0x7387e1['where']=_[_0xe107('0x3f')](_0x7387e1[_0xe107('0x3c')],{'$or':_[_0xe107('0x2d')](_0x417b0c,function(_0xb2e273){if(_0xb2e273[_0xe107('0x40')]!=='VIRTUAL'){var _0x5ccee6={};_0x5ccee6[_0xb2e273[_0xe107('0x2a')]]={'$like':'%'+_0x2b54b6[_0xe107('0x33')][_0xe107('0x3e')]+'%'};return _0x5ccee6;}})});}_0x7387e1=_[_0xe107('0x3f')]({},_0x7387e1,_0x2b54b6['options']);var _0x52268e={'where':_0x7387e1['where']};return db[_0xe107('0x2e')][_0xe107('0x1f')](_0x52268e)['then'](function(_0x26bb41){_0x19f686[_0xe107('0x1f')]=_0x26bb41;if(_0x2b54b6[_0xe107('0x33')][_0xe107('0x41')]){_0x7387e1[_0xe107('0x42')]=[{'all':!![]}];}return db[_0xe107('0x2e')][_0xe107('0x43')](_0x7387e1);})[_0xe107('0x26')](function(_0x16a44f){_0x19f686[_0xe107('0x44')]=_0x16a44f;return _0x19f686;})[_0xe107('0x26')](respondWithFilteredResult(_0x52571f,_0x7387e1))['catch'](handleError(_0x52571f,null));};exports[_0xe107('0x45')]=function(_0x264569,_0x59ccde){var _0x487df5={'raw':!![],'where':{'id':_0x264569['params']['id']}},_0x27887e={};_0x27887e[_0xe107('0x32')]=_[_0xe107('0x46')](db[_0xe107('0x2e')][_0xe107('0x2f')]);_0x27887e['query']=_[_0xe107('0x46')](_0x264569['query']);_0x27887e[_0xe107('0x34')]=_[_0xe107('0x35')](_0x27887e[_0xe107('0x32')],_0x27887e['query']);_0x487df5[_0xe107('0x36')]=_[_0xe107('0x35')](_0x27887e[_0xe107('0x32')],qs['fields'](_0x264569[_0xe107('0x33')]['fields']));_0x487df5['attributes']=_0x487df5[_0xe107('0x36')][_0xe107('0x38')]?_0x487df5[_0xe107('0x36')]:_0x27887e['model'];if(_0x264569[_0xe107('0x33')][_0xe107('0x41')]){_0x487df5[_0xe107('0x42')]=[{'all':!![]}];}_0x487df5=_[_0xe107('0x3f')]({},_0x487df5,_0x264569[_0xe107('0x47')]);return db['MailTransferReport'][_0xe107('0x48')](_0x487df5)['then'](handleEntityNotFound(_0x59ccde,null))[_0xe107('0x26')](respondWithResult(_0x59ccde,null))[_0xe107('0x49')](handleError(_0x59ccde,null));};exports[_0xe107('0x4a')]=function(_0x194ec8,_0x2850a2){return db[_0xe107('0x2e')]['create'](_0x194ec8[_0xe107('0x4b')],{})[_0xe107('0x26')](respondWithResult(_0x2850a2,0xc9))[_0xe107('0x49')](handleError(_0x2850a2,null));};exports[_0xe107('0x24')]=function(_0x497efa,_0x5901f9){if(_0x497efa[_0xe107('0x4b')]['id']){delete _0x497efa[_0xe107('0x4b')]['id'];}return db[_0xe107('0x2e')][_0xe107('0x48')]({'where':{'id':_0x497efa[_0xe107('0x4c')]['id']}})[_0xe107('0x26')](handleEntityNotFound(_0x5901f9,null))[_0xe107('0x26')](saveUpdates(_0x497efa[_0xe107('0x4b')],null))[_0xe107('0x26')](respondWithResult(_0x5901f9,null))['catch'](handleError(_0x5901f9,null));};exports['destroy']=function(_0x532bd9,_0x5dd4b6){return db[_0xe107('0x2e')][_0xe107('0x48')]({'where':{'id':_0x532bd9[_0xe107('0x4c')]['id']}})[_0xe107('0x26')](handleEntityNotFound(_0x5dd4b6,null))[_0xe107('0x26')](removeEntity(_0x5dd4b6,null))['catch'](handleError(_0x5dd4b6,null));};exports[_0xe107('0x4d')]=function(_0x27f9db,_0x2c18af){return db[_0xe107('0x2e')]['describe']()[_0xe107('0x26')](respondWithResult(_0x2c18af,null))[_0xe107('0x49')](handleError(_0x2c18af,null));};
\ No newline at end of file
+var _0x3b24=['apply','reject','save','destroy','then','stack','name','send','index','map','MailTransferReport','rawAttributes','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','include','find','catch','create','body','update','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x46277b,_0x3c33e3){var _0x432a73=function(_0x32ab7e){while(--_0x32ab7e){_0x46277b['push'](_0x46277b['shift']());}};_0x432a73(++_0x3c33e3);}(_0x3b24,0x10c));var _0x43b2=function(_0xfd8991,_0x23b412){_0xfd8991=_0xfd8991-0x0;var _0x21dbf2=_0x3b24[_0xfd8991];return _0x21dbf2;};'use strict';var emlformat=require(_0x43b2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43b2('0x1'));var jsonpatch=require(_0x43b2('0x2'));var rp=require('request-promise');var moment=require(_0x43b2('0x3'));var BPromise=require(_0x43b2('0x4'));var Mustache=require(_0x43b2('0x5'));var util=require(_0x43b2('0x6'));var path=require('path');var sox=require(_0x43b2('0x7'));var csv=require('to-csv');var ejs=require(_0x43b2('0x8'));var fs=require('fs');var fs_extra=require(_0x43b2('0x9'));var _=require(_0x43b2('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x43b2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x43b2('0xc'));var querystring=require(_0x43b2('0xd'));var Papa=require(_0x43b2('0xe'));var Redis=require(_0x43b2('0xf'));var authService=require(_0x43b2('0x10'));var qs=require(_0x43b2('0x11'));var as=require(_0x43b2('0x12'));var hardwareService=require(_0x43b2('0x13'));var logger=require(_0x43b2('0x14'))(_0x43b2('0x15'));var utils=require(_0x43b2('0x16'));var config=require(_0x43b2('0x17'));var licenseUtil=require(_0x43b2('0x18'));var db=require(_0x43b2('0x19'))['db'];function respondWithStatusCode(_0x225cd2,_0x342961){_0x342961=_0x342961||0xcc;return function(_0x4ec3eb){if(_0x4ec3eb){return _0x225cd2[_0x43b2('0x1a')](_0x342961);}return _0x225cd2[_0x43b2('0x1b')](_0x342961)[_0x43b2('0x1c')]();};}function respondWithResult(_0x23eec4,_0x58e0d8){_0x58e0d8=_0x58e0d8||0xc8;return function(_0xc3d8ed){if(_0xc3d8ed){return _0x23eec4[_0x43b2('0x1b')](_0x58e0d8)[_0x43b2('0x1d')](_0xc3d8ed);}};}function respondWithFilteredResult(_0x46ac28,_0x95ee99){return function(_0xfd633e){if(_0xfd633e){var _0xedb7cc=typeof _0x95ee99[_0x43b2('0x1e')]===_0x43b2('0x1f')&&typeof _0x95ee99[_0x43b2('0x20')]===_0x43b2('0x1f');var _0x187f48=_0xfd633e[_0x43b2('0x21')];var _0x2b4cab=_0xedb7cc?0x0:_0x95ee99['offset'];var _0x15a5d8=_0xedb7cc?_0xfd633e[_0x43b2('0x21')]:_0x95ee99['offset']+_0x95ee99[_0x43b2('0x20')];var _0x2e0895;if(_0x15a5d8>=_0x187f48){_0x15a5d8=_0x187f48;_0x2e0895=0xc8;}else{_0x2e0895=0xce;}_0x46ac28[_0x43b2('0x1b')](_0x2e0895);return _0x46ac28[_0x43b2('0x22')](_0x43b2('0x23'),_0x2b4cab+'-'+_0x15a5d8+'/'+_0x187f48)['json'](_0xfd633e);}return null;};}function patchUpdates(_0x274d4a){return function(_0x45d1b3){try{jsonpatch[_0x43b2('0x24')](_0x45d1b3,_0x274d4a,!![]);}catch(_0x4758ad){return BPromise[_0x43b2('0x25')](_0x4758ad);}return _0x45d1b3[_0x43b2('0x26')]();};}function saveUpdates(_0x2f7ad1,_0x37ba4e){return function(_0x3517ea){if(_0x3517ea){return _0x3517ea['update'](_0x2f7ad1)['then'](function(_0x3ff59b){return _0x3ff59b;});}return null;};}function removeEntity(_0x48d60f,_0x2181fa){return function(_0x5b56c5){if(_0x5b56c5){return _0x5b56c5[_0x43b2('0x27')]()[_0x43b2('0x28')](function(){_0x48d60f[_0x43b2('0x1b')](0xcc)[_0x43b2('0x1c')]();});}};}function handleEntityNotFound(_0x2d53dc,_0x454bf6){return function(_0x1a2e22){if(!_0x1a2e22){_0x2d53dc[_0x43b2('0x1a')](0x194);}return _0x1a2e22;};}function handleError(_0x4fff86,_0x26e27d){_0x26e27d=_0x26e27d||0x1f4;return function(_0x194433){logger['error'](_0x194433[_0x43b2('0x29')]);if(_0x194433[_0x43b2('0x2a')]){delete _0x194433['name'];}_0x4fff86['status'](_0x26e27d)[_0x43b2('0x2b')](_0x194433);};}exports[_0x43b2('0x2c')]=function(_0x40708f,_0x57ae33){var _0x339671={},_0x21108f={},_0x18383a={'count':0x0,'rows':[]};var _0x5d40f3=_[_0x43b2('0x2d')](db[_0x43b2('0x2e')][_0x43b2('0x2f')],function(_0x4e9871){return{'name':_0x4e9871['fieldName'],'type':_0x4e9871['type'][_0x43b2('0x30')]};});_0x21108f[_0x43b2('0x31')]=_[_0x43b2('0x2d')](_0x5d40f3,'name');_0x21108f[_0x43b2('0x32')]=_['keys'](_0x40708f[_0x43b2('0x32')]);_0x21108f[_0x43b2('0x33')]=_['intersection'](_0x21108f[_0x43b2('0x31')],_0x21108f[_0x43b2('0x32')]);_0x339671[_0x43b2('0x34')]=_[_0x43b2('0x35')](_0x21108f['model'],qs[_0x43b2('0x36')](_0x40708f['query']['fields']));_0x339671[_0x43b2('0x34')]=_0x339671['attributes'][_0x43b2('0x37')]?_0x339671[_0x43b2('0x34')]:_0x21108f[_0x43b2('0x31')];if(!_0x40708f['query'][_0x43b2('0x38')]('nolimit')){_0x339671[_0x43b2('0x20')]=qs[_0x43b2('0x20')](_0x40708f[_0x43b2('0x32')][_0x43b2('0x20')]);_0x339671['offset']=qs[_0x43b2('0x1e')](_0x40708f[_0x43b2('0x32')][_0x43b2('0x1e')]);}_0x339671['order']=qs[_0x43b2('0x39')](_0x40708f[_0x43b2('0x32')][_0x43b2('0x39')]);_0x339671[_0x43b2('0x3a')]=qs[_0x43b2('0x33')](_[_0x43b2('0x3b')](_0x40708f['query'],_0x21108f[_0x43b2('0x33')]),_0x5d40f3);if(_0x40708f[_0x43b2('0x32')][_0x43b2('0x3c')]){_0x339671[_0x43b2('0x3a')]=_[_0x43b2('0x3d')](_0x339671[_0x43b2('0x3a')],{'$or':_[_0x43b2('0x2d')](_0x5d40f3,function(_0x487f71){if(_0x487f71['type']!==_0x43b2('0x3e')){var _0x349d91={};_0x349d91[_0x487f71[_0x43b2('0x2a')]]={'$like':'%'+_0x40708f['query'][_0x43b2('0x3c')]+'%'};return _0x349d91;}})});}_0x339671=_[_0x43b2('0x3d')]({},_0x339671,_0x40708f[_0x43b2('0x3f')]);var _0x3321ea={'where':_0x339671[_0x43b2('0x3a')]};return db[_0x43b2('0x2e')][_0x43b2('0x21')](_0x3321ea)[_0x43b2('0x28')](function(_0x305007){_0x18383a['count']=_0x305007;if(_0x40708f[_0x43b2('0x32')][_0x43b2('0x40')]){_0x339671['include']=[{'all':!![]}];}return db['MailTransferReport'][_0x43b2('0x41')](_0x339671);})[_0x43b2('0x28')](function(_0xf0cebd){_0x18383a[_0x43b2('0x42')]=_0xf0cebd;return _0x18383a;})['then'](respondWithFilteredResult(_0x57ae33,_0x339671))['catch'](handleError(_0x57ae33,null));};exports[_0x43b2('0x43')]=function(_0x569120,_0x5d8be5){var _0x2fb409={'raw':!![],'where':{'id':_0x569120['params']['id']}},_0x267d48={};_0x267d48['model']=_['keys'](db['MailTransferReport']['rawAttributes']);_0x267d48[_0x43b2('0x32')]=_['keys'](_0x569120[_0x43b2('0x32')]);_0x267d48[_0x43b2('0x33')]=_[_0x43b2('0x35')](_0x267d48[_0x43b2('0x31')],_0x267d48[_0x43b2('0x32')]);_0x2fb409[_0x43b2('0x34')]=_[_0x43b2('0x35')](_0x267d48['model'],qs[_0x43b2('0x36')](_0x569120[_0x43b2('0x32')]['fields']));_0x2fb409[_0x43b2('0x34')]=_0x2fb409[_0x43b2('0x34')][_0x43b2('0x37')]?_0x2fb409[_0x43b2('0x34')]:_0x267d48[_0x43b2('0x31')];if(_0x569120[_0x43b2('0x32')][_0x43b2('0x40')]){_0x2fb409[_0x43b2('0x44')]=[{'all':!![]}];}_0x2fb409=_[_0x43b2('0x3d')]({},_0x2fb409,_0x569120[_0x43b2('0x3f')]);return db[_0x43b2('0x2e')][_0x43b2('0x45')](_0x2fb409)[_0x43b2('0x28')](handleEntityNotFound(_0x5d8be5,null))[_0x43b2('0x28')](respondWithResult(_0x5d8be5,null))[_0x43b2('0x46')](handleError(_0x5d8be5,null));};exports[_0x43b2('0x47')]=function(_0x183780,_0x53408a){return db[_0x43b2('0x2e')]['create'](_0x183780[_0x43b2('0x48')],{})['then'](respondWithResult(_0x53408a,0xc9))['catch'](handleError(_0x53408a,null));};exports[_0x43b2('0x49')]=function(_0x374ca5,_0x2b5d42){if(_0x374ca5[_0x43b2('0x48')]['id']){delete _0x374ca5[_0x43b2('0x48')]['id'];}return db[_0x43b2('0x2e')][_0x43b2('0x45')]({'where':{'id':_0x374ca5[_0x43b2('0x4a')]['id']}})[_0x43b2('0x28')](handleEntityNotFound(_0x2b5d42,null))[_0x43b2('0x28')](saveUpdates(_0x374ca5[_0x43b2('0x48')],null))['then'](respondWithResult(_0x2b5d42,null))[_0x43b2('0x46')](handleError(_0x2b5d42,null));};exports[_0x43b2('0x27')]=function(_0x4d0939,_0x276374){return db[_0x43b2('0x2e')][_0x43b2('0x45')]({'where':{'id':_0x4d0939[_0x43b2('0x4a')]['id']}})[_0x43b2('0x28')](handleEntityNotFound(_0x276374,null))[_0x43b2('0x28')](removeEntity(_0x276374,null))[_0x43b2('0x46')](handleError(_0x276374,null));};exports[_0x43b2('0x4b')]=function(_0x464622,_0x151b9f){return db[_0x43b2('0x2e')][_0x43b2('0x4b')]()['then'](respondWithResult(_0x151b9f,null))[_0x43b2('0x46')](handleError(_0x151b9f,null));};
\ No newline at end of file
index a3e4d04..2a10cdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28a2=['moment','bluebird','request-promise','rimraf','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0x28a2,0x141));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x228a('0x0'));var util=require(_0x228a('0x1'));var logger=require(_0x228a('0x2'))(_0x228a('0x3'));var moment=require(_0x228a('0x4'));var BPromise=require(_0x228a('0x5'));var rp=require(_0x228a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x228a('0x7'));var config=require('../../config/environment');var attributes=require(_0x228a('0x8'));module[_0x228a('0x9')]=function(_0x17727b,_0xf86d1d){return _0x17727b[_0x228a('0xa')]('MailTransferReport',attributes,{'tableName':_0x228a('0xb'),'paranoid':![],'indexes':[{'name':_0x228a('0xc'),'fields':[_0x228a('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7ec7=['report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define'];(function(_0x25eabe,_0x56df90){var _0x47f2b3=function(_0x1adce5){while(--_0x1adce5){_0x25eabe['push'](_0x25eabe['shift']());}};_0x47f2b3(++_0x56df90);}(_0x7ec7,0x1a2));var _0x77ec=function(_0x38203c,_0x2c9638){_0x38203c=_0x38203c-0x0;var _0x4acca3=_0x7ec7[_0x38203c];return _0x4acca3;};'use strict';var _=require(_0x77ec('0x0'));var util=require(_0x77ec('0x1'));var logger=require(_0x77ec('0x2'))(_0x77ec('0x3'));var moment=require('moment');var BPromise=require(_0x77ec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x77ec('0x5'));var rimraf=require(_0x77ec('0x6'));var config=require(_0x77ec('0x7'));var attributes=require(_0x77ec('0x8'));module[_0x77ec('0x9')]=function(_0x3c03e5,_0x54f6f0){return _0x3c03e5[_0x77ec('0xa')]('MailTransferReport',attributes,{'tableName':_0x77ec('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x77ec('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index e6eed16..d6f2d42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed4e=['info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request'];(function(_0x247583,_0x1c9c28){var _0x4af33e=function(_0x38cd0b){while(--_0x38cd0b){_0x247583['push'](_0x247583['shift']());}};_0x4af33e(++_0x1c9c28);}(_0xed4e,0xf1));var _0xeed4=function(_0x40e9a3,_0x2dfaa8){_0x40e9a3=_0x40e9a3-0x0;var _0x477e71=_0xed4e[_0x40e9a3];return _0x477e71;};'use strict';var _=require(_0xeed4('0x0'));var util=require(_0xeed4('0x1'));var moment=require(_0xeed4('0x2'));var BPromise=require(_0xeed4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeed4('0x4'));var db=require(_0xeed4('0x5'))['db'];var utils=require(_0xeed4('0x6'));var logger=require(_0xeed4('0x7'))('rpc');var config=require(_0xeed4('0x8'));var jayson=require(_0xeed4('0x9'));var client=jayson['client'][_0xeed4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a39f5,_0x407805,_0x5c3d2b){return new BPromise(function(_0x2ac6ef,_0x5ef118){return client[_0xeed4('0xb')](_0x3a39f5,_0x5c3d2b)['then'](function(_0x389807){logger[_0xeed4('0xc')](_0xeed4('0xd'),_0x407805,_0xeed4('0xe'));logger[_0xeed4('0xf')](_0xeed4('0x10'),_0x407805,_0xeed4('0xe'),JSON[_0xeed4('0x11')](_0x389807));if(_0x389807['error']){if(_0x389807[_0xeed4('0x12')][_0xeed4('0x13')]===0x1f4){logger['error'](_0xeed4('0xd'),_0x407805,_0x389807['error'][_0xeed4('0x14')]);return _0x5ef118(_0x389807[_0xeed4('0x12')]['message']);}logger[_0xeed4('0x12')](_0xeed4('0xd'),_0x407805,_0x389807['error'][_0xeed4('0x14')]);return _0x2ac6ef(_0x389807[_0xeed4('0x12')][_0xeed4('0x14')]);}else{logger[_0xeed4('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x407805,_0xeed4('0xe'));_0x2ac6ef(_0x389807[_0xeed4('0x15')][_0xeed4('0x14')]);}})[_0xeed4('0x16')](function(_0x990348){logger[_0xeed4('0x12')](_0xeed4('0xd'),_0x407805,_0x990348);_0x5ef118(_0x990348);});});}
\ No newline at end of file
+var _0x23e2=['debug','code','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x18b1ee,_0x2e7f70){var _0x48d725=function(_0x4932ea){while(--_0x4932ea){_0x18b1ee['push'](_0x18b1ee['shift']());}};_0x48d725(++_0x2e7f70);}(_0x23e2,0x17b));var _0x223e=function(_0x395b12,_0x3a396b){_0x395b12=_0x395b12-0x0;var _0x5cddfb=_0x23e2[_0x395b12];return _0x5cddfb;};'use strict';var _=require(_0x223e('0x0'));var util=require(_0x223e('0x1'));var moment=require(_0x223e('0x2'));var BPromise=require(_0x223e('0x3'));var rs=require(_0x223e('0x4'));var fs=require('fs');var Redis=require(_0x223e('0x5'));var db=require(_0x223e('0x6'))['db'];var utils=require(_0x223e('0x7'));var logger=require(_0x223e('0x8'))(_0x223e('0x9'));var config=require(_0x223e('0xa'));var jayson=require(_0x223e('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xa9e599,_0x4e71f8,_0x2c0942){return new BPromise(function(_0x3dce88,_0x160d14){return client[_0x223e('0xc')](_0xa9e599,_0x2c0942)[_0x223e('0xd')](function(_0x28a79c){logger[_0x223e('0xe')](_0x223e('0xf'),_0x4e71f8,_0x223e('0x10'));logger[_0x223e('0x11')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x4e71f8,_0x223e('0x10'),JSON['stringify'](_0x28a79c));if(_0x28a79c['error']){if(_0x28a79c['error'][_0x223e('0x12')]===0x1f4){logger[_0x223e('0x13')](_0x223e('0xf'),_0x4e71f8,_0x28a79c[_0x223e('0x13')][_0x223e('0x14')]);return _0x160d14(_0x28a79c[_0x223e('0x13')]['message']);}logger[_0x223e('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x4e71f8,_0x28a79c[_0x223e('0x13')][_0x223e('0x14')]);return _0x3dce88(_0x28a79c[_0x223e('0x13')][_0x223e('0x14')]);}else{logger[_0x223e('0xe')](_0x223e('0xf'),_0x4e71f8,'request\x20sent');_0x3dce88(_0x28a79c['result'][_0x223e('0x14')]);}})[_0x223e('0x15')](function(_0x53c09c){logger[_0x223e('0x13')](_0x223e('0xf'),_0x4e71f8,_0x53c09c);_0x160d14(_0x53c09c);});});}
\ No newline at end of file
index 2a1c134..307cf36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fed=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated','index','get','/describe'];(function(_0x12337f,_0x280b83){var _0x21f717=function(_0x53598b){while(--_0x53598b){_0x12337f['push'](_0x12337f['shift']());}};_0x21f717(++_0x280b83);}(_0x6fed,0x82));var _0xd6fe=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6fed[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0xd6fe('0x0'));var util=require(_0xd6fe('0x1'));var path=require('path');var timeout=require(_0xd6fe('0x2'));var express=require(_0xd6fe('0x3'));var router=express[_0xd6fe('0x4')]();var fs_extra=require(_0xd6fe('0x5'));var auth=require(_0xd6fe('0x6'));var interaction=require(_0xd6fe('0x7'));var config=require(_0xd6fe('0x8'));var controller=require(_0xd6fe('0x9'));router['get']('/',auth[_0xd6fe('0xa')](),controller[_0xd6fe('0xb')]);router[_0xd6fe('0xc')](_0xd6fe('0xd'),auth['isAuthenticated'](),controller[_0xd6fe('0xe')]);router['get'](_0xd6fe('0xf'),auth[_0xd6fe('0xa')](),controller[_0xd6fe('0x10')]);router[_0xd6fe('0x11')]('/',auth['isAuthenticated'](),controller[_0xd6fe('0x12')]);router[_0xd6fe('0x13')]('/:id',auth[_0xd6fe('0xa')](),controller[_0xd6fe('0x14')]);router[_0xd6fe('0x15')](_0xd6fe('0xf'),auth['isAuthenticated'](),controller[_0xd6fe('0x16')]);module[_0xd6fe('0x17')]=router;
\ No newline at end of file
+var _0x6a7c=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','describe','post','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x4f11cb,_0x14e174){var _0x491488=function(_0x2904a9){while(--_0x2904a9){_0x4f11cb['push'](_0x4f11cb['shift']());}};_0x491488(++_0x14e174);}(_0x6a7c,0x18e));var _0xc6a7=function(_0x39036f,_0x253d62){_0x39036f=_0x39036f-0x0;var _0x3a1228=_0x6a7c[_0x39036f];return _0x3a1228;};'use strict';var multer=require(_0xc6a7('0x0'));var util=require(_0xc6a7('0x1'));var path=require('path');var timeout=require(_0xc6a7('0x2'));var express=require(_0xc6a7('0x3'));var router=express[_0xc6a7('0x4')]();var fs_extra=require(_0xc6a7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc6a7('0x6'));var config=require(_0xc6a7('0x7'));var controller=require('./memberReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc6a7('0x8')]);router[_0xc6a7('0x9')](_0xc6a7('0xa'),auth[_0xc6a7('0xb')](),controller[_0xc6a7('0xc')]);router[_0xc6a7('0x9')]('/:id',auth[_0xc6a7('0xb')](),controller['show']);router[_0xc6a7('0xd')]('/',auth[_0xc6a7('0xb')](),controller[_0xc6a7('0xe')]);router[_0xc6a7('0xf')](_0xc6a7('0x10'),auth[_0xc6a7('0xb')](),controller[_0xc6a7('0x11')]);router[_0xc6a7('0x12')](_0xc6a7('0x10'),auth['isAuthenticated'](),controller[_0xc6a7('0x13')]);module['exports']=router;
\ No newline at end of file
index c24c919..c853a4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d96=['DATE','getDataValue','enterAt','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER'];(function(_0x310428,_0x1d211e){var _0xfe8f0f=function(_0x3c607c){while(--_0x3c607c){_0x310428['push'](_0x310428['shift']());}};_0xfe8f0f(++_0x1d211e);}(_0x4d96,0xaa));var _0x64d9=function(_0x5aa95b,_0x1cf77a){_0x5aa95b=_0x5aa95b-0x0;var _0x53c820=_0x4d96[_0x5aa95b];return _0x53c820;};'use strict';var Sequelize=require(_0x64d9('0x0'));var moment=require(_0x64d9('0x1'));module[_0x64d9('0x2')]={'channel':{'type':Sequelize[_0x64d9('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x64d9('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x64d9('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x64d9('0x5')]},'enterAt':{'type':Sequelize[_0x64d9('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0xe91eb6){var _0x54ae03=moment(_0xe91eb6);var _0x1b83dd=moment(this[_0x64d9('0x7')](_0x64d9('0x8')));var _0xd7458=_0x54ae03['diff'](_0x1b83dd,_0x64d9('0x9'));this[_0x64d9('0xa')](_0x64d9('0xb'),_0xe91eb6);this['setDataValue'](_0x64d9('0xc'),_0xd7458>=0x0?_0xd7458:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x64d9('0xd')},'data2':{'type':Sequelize[_0x64d9('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x64d9('0x3')],'comment':_0x64d9('0xe')},'data4':{'type':Sequelize[_0x64d9('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x64d9('0x3')],'comment':_0x64d9('0xf')},'role':{'type':Sequelize[_0x64d9('0x3')]},'internal':{'type':Sequelize[_0x64d9('0x5')]},'uniqueid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc1c7=['LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','diff','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE'];(function(_0x2b5f44,_0x4c58c2){var _0xd3fab2=function(_0x4e87ba){while(--_0x4e87ba){_0x2b5f44['push'](_0x2b5f44['shift']());}};_0xd3fab2(++_0x4c58c2);}(_0xc1c7,0x16c));var _0x7c1c=function(_0x4eca07,_0x5c4285){_0x4eca07=_0x4eca07-0x0;var _0x4297f0=_0xc1c7[_0x4eca07];return _0x4297f0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7c1c('0x0'));module[_0x7c1c('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x7c1c('0x2')]},'interface':{'type':Sequelize[_0x7c1c('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x7c1c('0x3'),'comment':_0x7c1c('0x4')},'duration':{'type':Sequelize[_0x7c1c('0x5')]},'enterAt':{'type':Sequelize[_0x7c1c('0x6')]},'exitAt':{'type':Sequelize[_0x7c1c('0x6')],'set':function(_0x4ccd1a){var _0x3a6af0=moment(_0x4ccd1a);var _0x38b231=moment(this[_0x7c1c('0x7')]('enterAt'));var _0x40f2a4=_0x3a6af0[_0x7c1c('0x8')](_0x38b231,'seconds');this[_0x7c1c('0x9')](_0x7c1c('0xa'),_0x4ccd1a);this['setDataValue']('duration',_0x40f2a4>=0x0?_0x40f2a4:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x7c1c('0xb')},'data2':{'type':Sequelize[_0x7c1c('0x2')],'comment':_0x7c1c('0xc')},'data3':{'type':Sequelize['STRING'],'comment':_0x7c1c('0xd')},'data4':{'type':Sequelize[_0x7c1c('0x2')],'comment':_0x7c1c('0xe')},'data5':{'type':Sequelize[_0x7c1c('0x2')],'comment':_0x7c1c('0xf')},'role':{'type':Sequelize[_0x7c1c('0x2')]},'internal':{'type':Sequelize[_0x7c1c('0x5')]},'uniqueid':{'type':Sequelize[_0x7c1c('0x2')]}};
\ No newline at end of file
index fc28cbc..0de99a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x55ca,0x126));var _0xa55c=function(_0x454e6d,_0x1e1f38){_0x454e6d=_0x454e6d-0x0;var _0x4bc294=_0x55ca[_0x454e6d];return _0x4bc294;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));};
\ No newline at end of file
+var _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xedd9,0xfc));var _0x9edd=function(_0x37ab4a,_0x158850){_0x37ab4a=_0x37ab4a-0x0;var _0x39c270=_0xedd9[_0x37ab4a];return _0x39c270;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));};
\ No newline at end of file
index ac8ec87..69b5a16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x995a=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername_interface','interface','lodash'];(function(_0x374429,_0x18c2de){var _0x3d434e=function(_0x585459){while(--_0x585459){_0x374429['push'](_0x374429['shift']());}};_0x3d434e(++_0x18c2de);}(_0x995a,0x176));var _0xa995=function(_0xd04860,_0x12631b){_0xd04860=_0xd04860-0x0;var _0x18d806=_0x995a[_0xd04860];return _0x18d806;};'use strict';var _=require(_0xa995('0x0'));var util=require(_0xa995('0x1'));var logger=require(_0xa995('0x2'))(_0xa995('0x3'));var moment=require(_0xa995('0x4'));var BPromise=require(_0xa995('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa995('0x6'));var rimraf=require(_0xa995('0x7'));var config=require(_0xa995('0x8'));var attributes=require(_0xa995('0x9'));module['exports']=function(_0xce80f,_0x364123){return _0xce80f[_0xa995('0xa')](_0xa995('0xb'),attributes,{'tableName':_0xa995('0xc'),'paranoid':![],'indexes':[{'name':_0xa995('0xd'),'fields':['membername',_0xa995('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xea05=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','report_member','membername_interface','membername','interface'];(function(_0x44f375,_0x27dcb3){var _0xc0e6c1=function(_0xe43130){while(--_0xe43130){_0x44f375['push'](_0x44f375['shift']());}};_0xc0e6c1(++_0x27dcb3);}(_0xea05,0x126));var _0x5ea0=function(_0x23006e,_0x25e733){_0x23006e=_0x23006e-0x0;var _0x571d64=_0xea05[_0x23006e];return _0x571d64;};'use strict';var _=require(_0x5ea0('0x0'));var util=require(_0x5ea0('0x1'));var logger=require(_0x5ea0('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5ea0('0x3'));var fs=require('fs');var path=require(_0x5ea0('0x4'));var rimraf=require(_0x5ea0('0x5'));var config=require(_0x5ea0('0x6'));var attributes=require(_0x5ea0('0x7'));module[_0x5ea0('0x8')]=function(_0x1209d2,_0x14b397){return _0x1209d2[_0x5ea0('0x9')]('MemberReport',attributes,{'tableName':_0x5ea0('0xa'),'paranoid':![],'indexes':[{'name':_0x5ea0('0xb'),'fields':[_0x5ea0('0xc'),_0x5ea0('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 3113796..517abb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbbd=['MemberReport','findAll','options','raw','where','limit','include','attributes','map','debug','CreateMemberReport','create','UpdateMemberReport','body','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport'];(function(_0x42f3b9,_0x6c247d){var _0x5c60a0=function(_0x2c4670){while(--_0x2c4670){_0x42f3b9['push'](_0x42f3b9['shift']());}};_0x5c60a0(++_0x6c247d);}(_0xbbbd,0x86));var _0xdbbb=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xbbbd[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xdbbb('0x0'));var util=require(_0xdbbb('0x1'));var moment=require(_0xdbbb('0x2'));var BPromise=require(_0xdbbb('0x3'));var rs=require(_0xdbbb('0x4'));var fs=require('fs');var Redis=require(_0xdbbb('0x5'));var db=require(_0xdbbb('0x6'))['db'];var utils=require(_0xdbbb('0x7'));var logger=require(_0xdbbb('0x8'))(_0xdbbb('0x9'));var config=require(_0xdbbb('0xa'));var jayson=require(_0xdbbb('0xb'));var client=jayson['client'][_0xdbbb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42ea38,_0x197916,_0x478756){return new BPromise(function(_0x463ea6,_0x28a1fd){return client[_0xdbbb('0xd')](_0x42ea38,_0x478756)[_0xdbbb('0xe')](function(_0x2def2e){logger[_0xdbbb('0xf')]('MemberReport,\x20%s,\x20%s',_0x197916,_0xdbbb('0x10'));logger['debug'](_0xdbbb('0x11'),_0x197916,'request\x20sent',JSON[_0xdbbb('0x12')](_0x2def2e));if(_0x2def2e[_0xdbbb('0x13')]){if(_0x2def2e[_0xdbbb('0x13')][_0xdbbb('0x14')]===0x1f4){logger[_0xdbbb('0x13')](_0xdbbb('0x15'),_0x197916,_0x2def2e[_0xdbbb('0x13')][_0xdbbb('0x16')]);return _0x28a1fd(_0x2def2e[_0xdbbb('0x13')]['message']);}logger[_0xdbbb('0x13')](_0xdbbb('0x15'),_0x197916,_0x2def2e[_0xdbbb('0x13')][_0xdbbb('0x16')]);return _0x463ea6(_0x2def2e[_0xdbbb('0x13')][_0xdbbb('0x16')]);}else{logger[_0xdbbb('0xf')](_0xdbbb('0x15'),_0x197916,_0xdbbb('0x10'));_0x463ea6(_0x2def2e[_0xdbbb('0x17')][_0xdbbb('0x16')]);}})[_0xdbbb('0x18')](function(_0x203feb){logger[_0xdbbb('0x13')]('MemberReport,\x20%s,\x20%s',_0x197916,_0x203feb);_0x28a1fd(_0x203feb);});});}exports[_0xdbbb('0x19')]=function(_0xbbf0b4){var _0x50c9ec=this;return new Promise(function(_0x5c4b3d,_0x50ede3){return db[_0xdbbb('0x1a')][_0xdbbb('0x1b')]({'raw':_0xbbf0b4['options']?_0xbbf0b4[_0xdbbb('0x1c')][_0xdbbb('0x1d')]===undefined?!![]:![]:!![],'where':_0xbbf0b4['options']?_0xbbf0b4[_0xdbbb('0x1c')][_0xdbbb('0x1e')]||null:null,'attributes':_0xbbf0b4[_0xdbbb('0x1c')]?_0xbbf0b4[_0xdbbb('0x1c')]['attributes']||null:null,'limit':_0xbbf0b4[_0xdbbb('0x1c')]?_0xbbf0b4[_0xdbbb('0x1c')][_0xdbbb('0x1f')]||null:null,'include':_0xbbf0b4[_0xdbbb('0x1c')]?_0xbbf0b4[_0xdbbb('0x1c')][_0xdbbb('0x20')]?_['map'](_0xbbf0b4[_0xdbbb('0x1c')][_0xdbbb('0x20')],function(_0x537086){return{'model':db[_0x537086['model']],'as':_0x537086['as'],'attributes':_0x537086[_0xdbbb('0x21')],'include':_0x537086[_0xdbbb('0x20')]?_[_0xdbbb('0x22')](_0x537086['include'],function(_0x371c0b){return{'model':db[_0x371c0b['model']],'as':_0x371c0b['as'],'attributes':_0x371c0b[_0xdbbb('0x21')],'include':_0x371c0b[_0xdbbb('0x20')]?_['map'](_0x371c0b['include'],function(_0x180f55){return{'model':db[_0x180f55['model']],'as':_0x180f55['as'],'attributes':_0x180f55['attributes']};}):[]};}):[]};}):[]:[]})[_0xdbbb('0xe')](function(_0x3daf66){logger[_0xdbbb('0xf')](_0xdbbb('0x19'),_0xbbf0b4);logger[_0xdbbb('0x23')](_0xdbbb('0x19'),_0xbbf0b4,JSON[_0xdbbb('0x12')](_0x3daf66));_0x5c4b3d(_0x3daf66);})[_0xdbbb('0x18')](function(_0x4ee8f9){logger[_0xdbbb('0x13')](_0xdbbb('0x19'),_0x4ee8f9[_0xdbbb('0x16')],_0xbbf0b4);_0x50ede3(_0x50c9ec['error'](0x1f4,_0x4ee8f9[_0xdbbb('0x16')]));});});};exports[_0xdbbb('0x24')]=function(_0xcb4a46){var _0x24f86a=this;return new Promise(function(_0x5e0b4b,_0x2a98f9){return db['MemberReport'][_0xdbbb('0x25')](_0xcb4a46['body'],{'raw':_0xcb4a46[_0xdbbb('0x1c')]?_0xcb4a46[_0xdbbb('0x1c')][_0xdbbb('0x1d')]===undefined?!![]:![]:!![]})[_0xdbbb('0xe')](function(_0x31001e){logger[_0xdbbb('0xf')](_0xdbbb('0x24'),_0xcb4a46);logger[_0xdbbb('0x23')](_0xdbbb('0x24'),_0xcb4a46,JSON[_0xdbbb('0x12')](_0x31001e));_0x5e0b4b(_0x31001e);})[_0xdbbb('0x18')](function(_0xaa4e6){logger[_0xdbbb('0x13')](_0xdbbb('0x24'),_0xaa4e6[_0xdbbb('0x16')],_0xcb4a46);_0x2a98f9(_0x24f86a[_0xdbbb('0x13')](0x1f4,_0xaa4e6[_0xdbbb('0x16')]));});});};exports[_0xdbbb('0x26')]=function(_0x4f992b){var _0x374e79=this;return new Promise(function(_0x4ae945,_0x140a2e){return db[_0xdbbb('0x1a')]['update'](_0x4f992b[_0xdbbb('0x27')],{'raw':_0x4f992b[_0xdbbb('0x1c')]?_0x4f992b[_0xdbbb('0x1c')][_0xdbbb('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f992b[_0xdbbb('0x1c')]?_0x4f992b['options'][_0xdbbb('0x1e')]||null:null,'attributes':_0x4f992b[_0xdbbb('0x1c')]?_0x4f992b['options'][_0xdbbb('0x21')]||null:null,'limit':_0x4f992b[_0xdbbb('0x1c')]?_0x4f992b[_0xdbbb('0x1c')][_0xdbbb('0x1f')]||null:null})[_0xdbbb('0xe')](function(_0x409c89){logger['info'](_0xdbbb('0x26'),_0x4f992b);logger[_0xdbbb('0x23')](_0xdbbb('0x26'),_0x4f992b,JSON[_0xdbbb('0x12')](_0x409c89));_0x4ae945(_0x409c89);})[_0xdbbb('0x18')](function(_0x12683f){logger['error'](_0xdbbb('0x26'),_0x12683f[_0xdbbb('0x16')],_0x4f992b);_0x140a2e(_0x374e79[_0xdbbb('0x13')](0x1f4,_0x12683f[_0xdbbb('0x16')]));});});};
\ No newline at end of file
+var _0x1561=['raw','where','attributes','limit','include','map','model','then','info','stringify','body','CreateMemberReport','UpdateMemberReport','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','debug','error','code','message','result','catch','MemberReport,\x20%s,\x20%s','GetMemberReport','MemberReport','findAll','options'];(function(_0xb2f640,_0x183e17){var _0x5289b8=function(_0x3dbcb3){while(--_0x3dbcb3){_0xb2f640['push'](_0xb2f640['shift']());}};_0x5289b8(++_0x183e17);}(_0x1561,0x1bd));var _0x1156=function(_0x58b5dc,_0x1b365e){_0x58b5dc=_0x58b5dc-0x0;var _0x1369dd=_0x1561[_0x58b5dc];return _0x1369dd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1156('0x0'));var BPromise=require(_0x1156('0x1'));var rs=require(_0x1156('0x2'));var fs=require('fs');var Redis=require(_0x1156('0x3'));var db=require(_0x1156('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1156('0x5'))(_0x1156('0x6'));var config=require(_0x1156('0x7'));var jayson=require(_0x1156('0x8'));var client=jayson['client'][_0x1156('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a7048,_0x372fe0,_0x6c3476){return new BPromise(function(_0x273b53,_0x2a7693){return client[_0x1156('0xa')](_0x4a7048,_0x6c3476)['then'](function(_0x2a5914){logger['info']('MemberReport,\x20%s,\x20%s',_0x372fe0,_0x1156('0xb'));logger[_0x1156('0xc')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x372fe0,_0x1156('0xb'),JSON['stringify'](_0x2a5914));if(_0x2a5914[_0x1156('0xd')]){if(_0x2a5914['error'][_0x1156('0xe')]===0x1f4){logger[_0x1156('0xd')]('MemberReport,\x20%s,\x20%s',_0x372fe0,_0x2a5914['error'][_0x1156('0xf')]);return _0x2a7693(_0x2a5914['error'][_0x1156('0xf')]);}logger[_0x1156('0xd')]('MemberReport,\x20%s,\x20%s',_0x372fe0,_0x2a5914['error'][_0x1156('0xf')]);return _0x273b53(_0x2a5914[_0x1156('0xd')][_0x1156('0xf')]);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x372fe0,_0x1156('0xb'));_0x273b53(_0x2a5914[_0x1156('0x10')][_0x1156('0xf')]);}})[_0x1156('0x11')](function(_0x6889c9){logger[_0x1156('0xd')](_0x1156('0x12'),_0x372fe0,_0x6889c9);_0x2a7693(_0x6889c9);});});}exports[_0x1156('0x13')]=function(_0x2d820d){var _0x211e6b=this;return new Promise(function(_0x2582cb,_0x4ab172){return db[_0x1156('0x14')][_0x1156('0x15')]({'raw':_0x2d820d[_0x1156('0x16')]?_0x2d820d['options'][_0x1156('0x17')]===undefined?!![]:![]:!![],'where':_0x2d820d[_0x1156('0x16')]?_0x2d820d[_0x1156('0x16')][_0x1156('0x18')]||null:null,'attributes':_0x2d820d[_0x1156('0x16')]?_0x2d820d[_0x1156('0x16')][_0x1156('0x19')]||null:null,'limit':_0x2d820d[_0x1156('0x16')]?_0x2d820d['options'][_0x1156('0x1a')]||null:null,'include':_0x2d820d['options']?_0x2d820d[_0x1156('0x16')][_0x1156('0x1b')]?_[_0x1156('0x1c')](_0x2d820d['options'][_0x1156('0x1b')],function(_0x3af43f){return{'model':db[_0x3af43f[_0x1156('0x1d')]],'as':_0x3af43f['as'],'attributes':_0x3af43f[_0x1156('0x19')],'include':_0x3af43f[_0x1156('0x1b')]?_[_0x1156('0x1c')](_0x3af43f['include'],function(_0xa5ffd7){return{'model':db[_0xa5ffd7[_0x1156('0x1d')]],'as':_0xa5ffd7['as'],'attributes':_0xa5ffd7[_0x1156('0x19')],'include':_0xa5ffd7[_0x1156('0x1b')]?_[_0x1156('0x1c')](_0xa5ffd7[_0x1156('0x1b')],function(_0x1b66f9){return{'model':db[_0x1b66f9[_0x1156('0x1d')]],'as':_0x1b66f9['as'],'attributes':_0x1b66f9[_0x1156('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1156('0x1e')](function(_0x225502){logger[_0x1156('0x1f')](_0x1156('0x13'),_0x2d820d);logger[_0x1156('0xc')]('GetMemberReport',_0x2d820d,JSON[_0x1156('0x20')](_0x225502));_0x2582cb(_0x225502);})[_0x1156('0x11')](function(_0x4c44b3){logger[_0x1156('0xd')](_0x1156('0x13'),_0x4c44b3['message'],_0x2d820d);_0x4ab172(_0x211e6b[_0x1156('0xd')](0x1f4,_0x4c44b3[_0x1156('0xf')]));});});};exports['CreateMemberReport']=function(_0x12a68e){var _0x265406=this;return new Promise(function(_0x577957,_0x2c5759){return db[_0x1156('0x14')]['create'](_0x12a68e[_0x1156('0x21')],{'raw':_0x12a68e[_0x1156('0x16')]?_0x12a68e['options'][_0x1156('0x17')]===undefined?!![]:![]:!![]})[_0x1156('0x1e')](function(_0x1e7558){logger[_0x1156('0x1f')]('CreateMemberReport',_0x12a68e);logger['debug'](_0x1156('0x22'),_0x12a68e,JSON[_0x1156('0x20')](_0x1e7558));_0x577957(_0x1e7558);})[_0x1156('0x11')](function(_0x26a0bf){logger[_0x1156('0xd')](_0x1156('0x22'),_0x26a0bf[_0x1156('0xf')],_0x12a68e);_0x2c5759(_0x265406[_0x1156('0xd')](0x1f4,_0x26a0bf[_0x1156('0xf')]));});});};exports['UpdateMemberReport']=function(_0x592ae3){var _0x1d1c44=this;return new Promise(function(_0x48a527,_0x7918f1){return db[_0x1156('0x14')]['update'](_0x592ae3[_0x1156('0x21')],{'raw':_0x592ae3[_0x1156('0x16')]?_0x592ae3[_0x1156('0x16')][_0x1156('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x592ae3['options']?_0x592ae3[_0x1156('0x16')][_0x1156('0x18')]||null:null,'attributes':_0x592ae3['options']?_0x592ae3[_0x1156('0x16')][_0x1156('0x19')]||null:null,'limit':_0x592ae3[_0x1156('0x16')]?_0x592ae3[_0x1156('0x16')]['limit']||null:null})[_0x1156('0x1e')](function(_0x538d1b){logger['info'](_0x1156('0x23'),_0x592ae3);logger['debug'](_0x1156('0x23'),_0x592ae3,JSON['stringify'](_0x538d1b));_0x48a527(_0x538d1b);})['catch'](function(_0x405afb){logger[_0x1156('0xd')](_0x1156('0x23'),_0x405afb[_0x1156('0xf')],_0x592ae3);_0x7918f1(_0x1d1c44[_0x1156('0xd')](0x1f4,_0x405afb[_0x1156('0xf')]));});});};
\ No newline at end of file
index 52a97bb..87e6cf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x989c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','util','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x989c,0x14d));var _0xc989=function(_0x4e6f17,_0x4544f9){_0x4e6f17=_0x4e6f17-0x0;var _0x357d79=_0x989c[_0x4e6f17];return _0x357d79;};'use strict';var multer=require(_0xc989('0x0'));var util=require(_0xc989('0x1'));var path=require('path');var timeout=require(_0xc989('0x2'));var express=require('express');var router=express[_0xc989('0x3')]();var fs_extra=require(_0xc989('0x4'));var auth=require(_0xc989('0x5'));var interaction=require(_0xc989('0x6'));var config=require(_0xc989('0x7'));var controller=require(_0xc989('0x8'));router[_0xc989('0x9')]('/',controller[_0xc989('0xa')]);module[_0xc989('0xb')]=router;
\ No newline at end of file
+var _0xa245=['Router','fs-extra','../../components/auth/service','index','exports','multer','util','express'];(function(_0x12ace3,_0x52912e){var _0x158384=function(_0x27ed83){while(--_0x27ed83){_0x12ace3['push'](_0x12ace3['shift']());}};_0x158384(++_0x52912e);}(_0xa245,0x195));var _0x5a24=function(_0x509c36,_0x3eea24){_0x509c36=_0x509c36-0x0;var _0x46b784=_0xa245[_0x509c36];return _0x46b784;};'use strict';var multer=require(_0x5a24('0x0'));var util=require(_0x5a24('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5a24('0x2'));var router=express[_0x5a24('0x3')]();var fs_extra=require(_0x5a24('0x4'));var auth=require(_0x5a24('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./migration.controller');router['get']('/',controller[_0x5a24('0x6')]);module[_0x5a24('0x7')]=router;
\ No newline at end of file
index 773b167..45a0a90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe959=['sequelize','version'];(function(_0x47a7e3,_0x281ce3){var _0x3e92d6=function(_0x3b100c){while(--_0x3b100c){_0x47a7e3['push'](_0x47a7e3['shift']());}};_0x3e92d6(++_0x281ce3);}(_0xe959,0xa2));var _0x9e95=function(_0x115ea5,_0x16c790){_0x115ea5=_0x115ea5-0x0;var _0xb01bc3=_0xe959[_0x115ea5];return _0xb01bc3;};'use strict';var Sequelize=require(_0x9e95('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0x9e95('0x1')}};
\ No newline at end of file
+var _0x5b50=['exports','STRING','version'];(function(_0x3def3c,_0x1d66d2){var _0x9cc736=function(_0x304f9b){while(--_0x304f9b){_0x3def3c['push'](_0x3def3c['shift']());}};_0x9cc736(++_0x1d66d2);}(_0x5b50,0x12c));var _0x05b5=function(_0x10a9dc,_0x280585){_0x10a9dc=_0x10a9dc-0x0;var _0x9ccb5e=_0x5b50[_0x10a9dc];return _0x9ccb5e;};'use strict';var Sequelize=require('sequelize');module[_0x05b5('0x0')]={'version':{'type':Sequelize[_0x05b5('0x1')],'unique':_0x05b5('0x2')}};
\ No newline at end of file
index 5f08401..0e2a12b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbde=['nolimit','order','sort','where','filter','merge','options','Migration','includeAll','include','findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length'];(function(_0x5ba0a7,_0x56354d){var _0x4faf62=function(_0x47680e){while(--_0x47680e){_0x5ba0a7['push'](_0x5ba0a7['shift']());}};_0x4faf62(++_0x56354d);}(_0xdbde,0xd8));var _0xedbd=function(_0x161090,_0x4d2127){_0x161090=_0x161090-0x0;var _0xa7703=_0xdbde[_0x161090];return _0xa7703;};'use strict';var emlformat=require(_0xedbd('0x0'));var rimraf=require(_0xedbd('0x1'));var zipdir=require(_0xedbd('0x2'));var jsonpatch=require(_0xedbd('0x3'));var rp=require(_0xedbd('0x4'));var moment=require(_0xedbd('0x5'));var BPromise=require(_0xedbd('0x6'));var Mustache=require(_0xedbd('0x7'));var util=require(_0xedbd('0x8'));var path=require(_0xedbd('0x9'));var sox=require(_0xedbd('0xa'));var csv=require(_0xedbd('0xb'));var ejs=require(_0xedbd('0xc'));var fs=require('fs');var fs_extra=require(_0xedbd('0xd'));var _=require(_0xedbd('0xe'));var squel=require(_0xedbd('0xf'));var crypto=require(_0xedbd('0x10'));var jsforce=require(_0xedbd('0x11'));var deskjs=require(_0xedbd('0x12'));var toCsv=require(_0xedbd('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xedbd('0x13'));var authService=require(_0xedbd('0x14'));var qs=require(_0xedbd('0x15'));var as=require(_0xedbd('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xedbd('0x17'));var utils=require('../../config/utils');var config=require(_0xedbd('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xedbd('0x19'))['db'];function respondWithStatusCode(_0x2d44bb,_0x36d7f4){_0x36d7f4=_0x36d7f4||0xcc;return function(_0x28606e){if(_0x28606e){return _0x2d44bb['sendStatus'](_0x36d7f4);}return _0x2d44bb[_0xedbd('0x1a')](_0x36d7f4)[_0xedbd('0x1b')]();};}function respondWithResult(_0xff9435,_0x335dd1){_0x335dd1=_0x335dd1||0xc8;return function(_0x351202){if(_0x351202){return _0xff9435[_0xedbd('0x1a')](_0x335dd1)['json'](_0x351202);}};}function respondWithFilteredResult(_0x1bc4ad,_0x1be118){return function(_0x1d7b31){if(_0x1d7b31){var _0xc67f00=typeof _0x1be118[_0xedbd('0x1c')]===_0xedbd('0x1d')&&typeof _0x1be118[_0xedbd('0x1e')]===_0xedbd('0x1d');var _0x257914=_0x1d7b31[_0xedbd('0x1f')];var _0x46904d=_0xc67f00?0x0:_0x1be118[_0xedbd('0x1c')];var _0x514da8=_0xc67f00?_0x1d7b31[_0xedbd('0x1f')]:_0x1be118[_0xedbd('0x1c')]+_0x1be118['limit'];var _0x4f9cfb;if(_0x514da8>=_0x257914){_0x514da8=_0x257914;_0x4f9cfb=0xc8;}else{_0x4f9cfb=0xce;}_0x1bc4ad[_0xedbd('0x1a')](_0x4f9cfb);return _0x1bc4ad[_0xedbd('0x20')](_0xedbd('0x21'),_0x46904d+'-'+_0x514da8+'/'+_0x257914)['json'](_0x1d7b31);}return null;};}function patchUpdates(_0x426a93){return function(_0x22c427){try{jsonpatch[_0xedbd('0x22')](_0x22c427,_0x426a93,!![]);}catch(_0x52b9f6){return BPromise[_0xedbd('0x23')](_0x52b9f6);}return _0x22c427[_0xedbd('0x24')]();};}function saveUpdates(_0x1e8bba,_0x35c8b1){return function(_0x5c26b8){if(_0x5c26b8){return _0x5c26b8['update'](_0x1e8bba)[_0xedbd('0x25')](function(_0x34b505){return _0x34b505;});}return null;};}function removeEntity(_0x4c3f37,_0x2ea853){return function(_0x5c39ab){if(_0x5c39ab){return _0x5c39ab[_0xedbd('0x26')]()['then'](function(){_0x4c3f37[_0xedbd('0x1a')](0xcc)[_0xedbd('0x1b')]();});}};}function handleEntityNotFound(_0x189abe,_0x414525){return function(_0x5df900){if(!_0x5df900){_0x189abe[_0xedbd('0x27')](0x194);}return _0x5df900;};}function handleError(_0x226314,_0x47cdcc){_0x47cdcc=_0x47cdcc||0x1f4;return function(_0x4fa55e){logger[_0xedbd('0x28')](_0x4fa55e[_0xedbd('0x29')]);if(_0x4fa55e[_0xedbd('0x2a')]){delete _0x4fa55e[_0xedbd('0x2a')];}_0x226314[_0xedbd('0x1a')](_0x47cdcc)[_0xedbd('0x2b')](_0x4fa55e);};}exports[_0xedbd('0x2c')]=function(_0x368327,_0x5a19df){var _0xfea8a9={},_0x5534ae={},_0x1a1fa1={'count':0x0,'rows':[]};var _0xee2d16=_[_0xedbd('0x2d')](db['Migration'][_0xedbd('0x2e')],function(_0x345d5c){return{'name':_0x345d5c[_0xedbd('0x2f')],'type':_0x345d5c['type']['key']};});_0x5534ae[_0xedbd('0x30')]=_[_0xedbd('0x2d')](_0xee2d16,_0xedbd('0x2a'));_0x5534ae[_0xedbd('0x31')]=_[_0xedbd('0x32')](_0x368327['query']);_0x5534ae[_0xedbd('0x33')]=_['intersection'](_0x5534ae[_0xedbd('0x30')],_0x5534ae[_0xedbd('0x31')]);_0xfea8a9[_0xedbd('0x34')]=_[_0xedbd('0x35')](_0x5534ae[_0xedbd('0x30')],qs[_0xedbd('0x36')](_0x368327['query']['fields']));_0xfea8a9['attributes']=_0xfea8a9[_0xedbd('0x34')][_0xedbd('0x37')]?_0xfea8a9[_0xedbd('0x34')]:_0x5534ae[_0xedbd('0x30')];if(!_0x368327['query']['hasOwnProperty'](_0xedbd('0x38'))){_0xfea8a9[_0xedbd('0x1e')]=qs[_0xedbd('0x1e')](_0x368327[_0xedbd('0x31')][_0xedbd('0x1e')]);_0xfea8a9[_0xedbd('0x1c')]=qs[_0xedbd('0x1c')](_0x368327[_0xedbd('0x31')]['offset']);}_0xfea8a9[_0xedbd('0x39')]=qs[_0xedbd('0x3a')](_0x368327['query'][_0xedbd('0x3a')]);_0xfea8a9[_0xedbd('0x3b')]=qs[_0xedbd('0x33')](_['pick'](_0x368327[_0xedbd('0x31')],_0x5534ae[_0xedbd('0x33')]),_0xee2d16);if(_0x368327[_0xedbd('0x31')][_0xedbd('0x3c')]){_0xfea8a9[_0xedbd('0x3b')]=_[_0xedbd('0x3d')](_0xfea8a9[_0xedbd('0x3b')],{'$or':_[_0xedbd('0x2d')](_0xee2d16,function(_0x27d856){if(_0x27d856['type']!=='VIRTUAL'){var _0x1dd7bb={};_0x1dd7bb[_0x27d856[_0xedbd('0x2a')]]={'$like':'%'+_0x368327[_0xedbd('0x31')]['filter']+'%'};return _0x1dd7bb;}})});}_0xfea8a9=_[_0xedbd('0x3d')]({},_0xfea8a9,_0x368327[_0xedbd('0x3e')]);var _0x339e57={'where':_0xfea8a9[_0xedbd('0x3b')]};return db[_0xedbd('0x3f')][_0xedbd('0x1f')](_0x339e57)['then'](function(_0x5a0ff1){_0x1a1fa1['count']=_0x5a0ff1;if(_0x368327[_0xedbd('0x31')][_0xedbd('0x40')]){_0xfea8a9[_0xedbd('0x41')]=[{'all':!![]}];}return db[_0xedbd('0x3f')][_0xedbd('0x42')](_0xfea8a9);})[_0xedbd('0x25')](function(_0x4c8bad){_0x1a1fa1[_0xedbd('0x43')]=_0x4c8bad;return _0x1a1fa1;})[_0xedbd('0x25')](respondWithFilteredResult(_0x5a19df,_0xfea8a9))['catch'](handleError(_0x5a19df,null));};
\ No newline at end of file
+var _0xb660=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','send','map','Migration','rawAttributes','key','name','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','type','includeAll','include','findAll','rows','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status'];(function(_0x4b7634,_0x12aca7){var _0x236d79=function(_0x5c83ce){while(--_0x5c83ce){_0x4b7634['push'](_0x4b7634['shift']());}};_0x236d79(++_0x12aca7);}(_0xb660,0x179));var _0x0b66=function(_0x3f5801,_0x3a1c33){_0x3f5801=_0x3f5801-0x0;var _0x2a354e=_0xb660[_0x3f5801];return _0x2a354e;};'use strict';var emlformat=require(_0x0b66('0x0'));var rimraf=require(_0x0b66('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0b66('0x2'));var rp=require(_0x0b66('0x3'));var moment=require('moment');var BPromise=require(_0x0b66('0x4'));var Mustache=require(_0x0b66('0x5'));var util=require(_0x0b66('0x6'));var path=require('path');var sox=require(_0x0b66('0x7'));var csv=require(_0x0b66('0x8'));var ejs=require(_0x0b66('0x9'));var fs=require('fs');var fs_extra=require(_0x0b66('0xa'));var _=require(_0x0b66('0xb'));var squel=require('squel');var crypto=require(_0x0b66('0xc'));var jsforce=require(_0x0b66('0xd'));var deskjs=require(_0x0b66('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0b66('0xf'));var Papa=require('papaparse');var Redis=require(_0x0b66('0x10'));var authService=require(_0x0b66('0x11'));var qs=require(_0x0b66('0x12'));var as=require(_0x0b66('0x13'));var hardwareService=require(_0x0b66('0x14'));var logger=require(_0x0b66('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x0b66('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0b66('0x17'))['db'];function respondWithStatusCode(_0xd963da,_0x2968fa){_0x2968fa=_0x2968fa||0xcc;return function(_0x33124a){if(_0x33124a){return _0xd963da['sendStatus'](_0x2968fa);}return _0xd963da[_0x0b66('0x18')](_0x2968fa)['end']();};}function respondWithResult(_0x2ed993,_0x43ad8e){_0x43ad8e=_0x43ad8e||0xc8;return function(_0xa00cff){if(_0xa00cff){return _0x2ed993[_0x0b66('0x18')](_0x43ad8e)[_0x0b66('0x19')](_0xa00cff);}};}function respondWithFilteredResult(_0x84ae98,_0x17e95b){return function(_0x361e35){if(_0x361e35){var _0x4c8fa3=typeof _0x17e95b[_0x0b66('0x1a')]===_0x0b66('0x1b')&&typeof _0x17e95b[_0x0b66('0x1c')]===_0x0b66('0x1b');var _0x68b878=_0x361e35['count'];var _0xb12c05=_0x4c8fa3?0x0:_0x17e95b['offset'];var _0x365ee2=_0x4c8fa3?_0x361e35[_0x0b66('0x1d')]:_0x17e95b[_0x0b66('0x1a')]+_0x17e95b[_0x0b66('0x1c')];var _0x511620;if(_0x365ee2>=_0x68b878){_0x365ee2=_0x68b878;_0x511620=0xc8;}else{_0x511620=0xce;}_0x84ae98[_0x0b66('0x18')](_0x511620);return _0x84ae98[_0x0b66('0x1e')](_0x0b66('0x1f'),_0xb12c05+'-'+_0x365ee2+'/'+_0x68b878)['json'](_0x361e35);}return null;};}function patchUpdates(_0x4c6be8){return function(_0x488a35){try{jsonpatch[_0x0b66('0x20')](_0x488a35,_0x4c6be8,!![]);}catch(_0x580c48){return BPromise[_0x0b66('0x21')](_0x580c48);}return _0x488a35['save']();};}function saveUpdates(_0x31f099,_0x31866c){return function(_0x239adf){if(_0x239adf){return _0x239adf[_0x0b66('0x22')](_0x31f099)[_0x0b66('0x23')](function(_0x3b14eb){return _0x3b14eb;});}return null;};}function removeEntity(_0x241485,_0x2d0a76){return function(_0x17f27c){if(_0x17f27c){return _0x17f27c[_0x0b66('0x24')]()[_0x0b66('0x23')](function(){_0x241485['status'](0xcc)[_0x0b66('0x25')]();});}};}function handleEntityNotFound(_0x137768,_0x558157){return function(_0x23a3f5){if(!_0x23a3f5){_0x137768[_0x0b66('0x26')](0x194);}return _0x23a3f5;};}function handleError(_0x1a1cab,_0x353445){_0x353445=_0x353445||0x1f4;return function(_0x478391){logger[_0x0b66('0x27')](_0x478391[_0x0b66('0x28')]);if(_0x478391['name']){delete _0x478391['name'];}_0x1a1cab['status'](_0x353445)[_0x0b66('0x29')](_0x478391);};}exports['index']=function(_0x5bb164,_0xad2422){var _0x21c26a={},_0x47671e={},_0x4725cf={'count':0x0,'rows':[]};var _0x34b426=_[_0x0b66('0x2a')](db[_0x0b66('0x2b')][_0x0b66('0x2c')],function(_0x37a636){return{'name':_0x37a636['fieldName'],'type':_0x37a636['type'][_0x0b66('0x2d')]};});_0x47671e['model']=_[_0x0b66('0x2a')](_0x34b426,_0x0b66('0x2e'));_0x47671e[_0x0b66('0x2f')]=_[_0x0b66('0x30')](_0x5bb164[_0x0b66('0x2f')]);_0x47671e[_0x0b66('0x31')]=_[_0x0b66('0x32')](_0x47671e[_0x0b66('0x33')],_0x47671e['query']);_0x21c26a[_0x0b66('0x34')]=_[_0x0b66('0x32')](_0x47671e[_0x0b66('0x33')],qs[_0x0b66('0x35')](_0x5bb164[_0x0b66('0x2f')][_0x0b66('0x35')]));_0x21c26a['attributes']=_0x21c26a[_0x0b66('0x34')][_0x0b66('0x36')]?_0x21c26a[_0x0b66('0x34')]:_0x47671e[_0x0b66('0x33')];if(!_0x5bb164['query']['hasOwnProperty'](_0x0b66('0x37'))){_0x21c26a[_0x0b66('0x1c')]=qs[_0x0b66('0x1c')](_0x5bb164['query'][_0x0b66('0x1c')]);_0x21c26a['offset']=qs['offset'](_0x5bb164[_0x0b66('0x2f')][_0x0b66('0x1a')]);}_0x21c26a[_0x0b66('0x38')]=qs[_0x0b66('0x39')](_0x5bb164['query'][_0x0b66('0x39')]);_0x21c26a['where']=qs[_0x0b66('0x31')](_[_0x0b66('0x3a')](_0x5bb164[_0x0b66('0x2f')],_0x47671e[_0x0b66('0x31')]),_0x34b426);if(_0x5bb164[_0x0b66('0x2f')][_0x0b66('0x3b')]){_0x21c26a['where']=_[_0x0b66('0x3c')](_0x21c26a[_0x0b66('0x3d')],{'$or':_['map'](_0x34b426,function(_0x13bb84){if(_0x13bb84[_0x0b66('0x3e')]!=='VIRTUAL'){var _0x1d37d6={};_0x1d37d6[_0x13bb84['name']]={'$like':'%'+_0x5bb164[_0x0b66('0x2f')][_0x0b66('0x3b')]+'%'};return _0x1d37d6;}})});}_0x21c26a=_['merge']({},_0x21c26a,_0x5bb164['options']);var _0x5843b2={'where':_0x21c26a[_0x0b66('0x3d')]};return db[_0x0b66('0x2b')]['count'](_0x5843b2)[_0x0b66('0x23')](function(_0x23c8e3){_0x4725cf[_0x0b66('0x1d')]=_0x23c8e3;if(_0x5bb164[_0x0b66('0x2f')][_0x0b66('0x3f')]){_0x21c26a[_0x0b66('0x40')]=[{'all':!![]}];}return db['Migration'][_0x0b66('0x41')](_0x21c26a);})[_0x0b66('0x23')](function(_0x4c6536){_0x4725cf[_0x0b66('0x42')]=_0x4c6536;return _0x4725cf;})[_0x0b66('0x23')](respondWithFilteredResult(_0xad2422,_0x21c26a))['catch'](handleError(_0xad2422,null));};
\ No newline at end of file
index 81b4c20..965ee83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9afb=['bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','../../config/logger','api','moment'];(function(_0x5402b3,_0x3ec1e9){var _0x3cff9a=function(_0x33f1f6){while(--_0x33f1f6){_0x5402b3['push'](_0x5402b3['shift']());}};_0x3cff9a(++_0x3ec1e9);}(_0x9afb,0xcd));var _0xb9af=function(_0x132d9e,_0x4a0839){_0x132d9e=_0x132d9e-0x0;var _0x40b733=_0x9afb[_0x132d9e];return _0x40b733;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb9af('0x0'))(_0xb9af('0x1'));var moment=require(_0xb9af('0x2'));var BPromise=require(_0xb9af('0x3'));var rp=require(_0xb9af('0x4'));var fs=require('fs');var path=require(_0xb9af('0x5'));var rimraf=require(_0xb9af('0x6'));var config=require(_0xb9af('0x7'));var attributes=require(_0xb9af('0x8'));module[_0xb9af('0x9')]=function(_0x127437,_0x478a4c){return _0x127437[_0xb9af('0xa')](_0xb9af('0xb'),attributes,{'tableName':_0xb9af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdfd7=['rimraf','../../config/environment','./migration.attributes','define','Migration','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x2f63b1,_0x12a69f){var _0x19cfc6=function(_0x1f72c9){while(--_0x1f72c9){_0x2f63b1['push'](_0x2f63b1['shift']());}};_0x19cfc6(++_0x12a69f);}(_0xdfd7,0x73));var _0x7dfd=function(_0x35e18d,_0x2102a1){_0x35e18d=_0x35e18d-0x0;var _0x2289c5=_0xdfd7[_0x35e18d];return _0x2289c5;};'use strict';var _=require(_0x7dfd('0x0'));var util=require(_0x7dfd('0x1'));var logger=require(_0x7dfd('0x2'))('api');var moment=require(_0x7dfd('0x3'));var BPromise=require(_0x7dfd('0x4'));var rp=require(_0x7dfd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7dfd('0x6'));var config=require(_0x7dfd('0x7'));var attributes=require(_0x7dfd('0x8'));module['exports']=function(_0x3aff28,_0x50d619){return _0x3aff28[_0x7dfd('0x9')](_0x7dfd('0xa'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2b220a9..f5eef36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6b8=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Migration,\x20%s,\x20%s','message','result','catch','util'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xb6b8,0xc5));var _0x8b6b=function(_0x3da8c4,_0x50167c){_0x3da8c4=_0x3da8c4-0x0;var _0x3d962d=_0xb6b8[_0x3da8c4];return _0x3d962d;};'use strict';var _=require('lodash');var util=require(_0x8b6b('0x0'));var moment=require(_0x8b6b('0x1'));var BPromise=require(_0x8b6b('0x2'));var rs=require(_0x8b6b('0x3'));var fs=require('fs');var Redis=require(_0x8b6b('0x4'));var db=require(_0x8b6b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b6b('0x6'))(_0x8b6b('0x7'));var config=require(_0x8b6b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8b6b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56da2a,_0x21bbc2,_0x303c21){return new BPromise(function(_0x142239,_0x21c84e){return client[_0x8b6b('0xa')](_0x56da2a,_0x303c21)[_0x8b6b('0xb')](function(_0x1f2c39){logger[_0x8b6b('0xc')]('Migration,\x20%s,\x20%s',_0x21bbc2,'request\x20sent');logger['debug'](_0x8b6b('0xd'),_0x21bbc2,_0x8b6b('0xe'),JSON[_0x8b6b('0xf')](_0x1f2c39));if(_0x1f2c39['error']){if(_0x1f2c39[_0x8b6b('0x10')][_0x8b6b('0x11')]===0x1f4){logger['error'](_0x8b6b('0x12'),_0x21bbc2,_0x1f2c39['error'][_0x8b6b('0x13')]);return _0x21c84e(_0x1f2c39[_0x8b6b('0x10')]['message']);}logger['error'](_0x8b6b('0x12'),_0x21bbc2,_0x1f2c39['error'][_0x8b6b('0x13')]);return _0x142239(_0x1f2c39[_0x8b6b('0x10')][_0x8b6b('0x13')]);}else{logger[_0x8b6b('0xc')](_0x8b6b('0x12'),_0x21bbc2,'request\x20sent');_0x142239(_0x1f2c39[_0x8b6b('0x14')][_0x8b6b('0x13')]);}})[_0x8b6b('0x15')](function(_0x2d16c7){logger[_0x8b6b('0x10')](_0x8b6b('0x12'),_0x21bbc2,_0x2d16c7);_0x21c84e(_0x2d16c7);});});}
\ No newline at end of file
+var _0x5f6a=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0xa937fa,_0x466b15){var _0x21dcbb=function(_0x554e0b){while(--_0x554e0b){_0xa937fa['push'](_0xa937fa['shift']());}};_0x21dcbb(++_0x466b15);}(_0x5f6a,0xc4));var _0xa5f6=function(_0x20f91e,_0x1e6300){_0x20f91e=_0x20f91e-0x0;var _0x42108f=_0x5f6a[_0x20f91e];return _0x42108f;};'use strict';var _=require(_0xa5f6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa5f6('0x1'));var rs=require(_0xa5f6('0x2'));var fs=require('fs');var Redis=require(_0xa5f6('0x3'));var db=require(_0xa5f6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa5f6('0x5'))(_0xa5f6('0x6'));var config=require(_0xa5f6('0x7'));var jayson=require(_0xa5f6('0x8'));var client=jayson[_0xa5f6('0x9')][_0xa5f6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19ac7d,_0x1cd83e,_0x2505d7){return new BPromise(function(_0x135782,_0x5cfc62){return client['request'](_0x19ac7d,_0x2505d7)['then'](function(_0x832065){logger[_0xa5f6('0xb')](_0xa5f6('0xc'),_0x1cd83e,_0xa5f6('0xd'));logger[_0xa5f6('0xe')]('Migration,\x20%s,\x20%s,\x20%s',_0x1cd83e,_0xa5f6('0xd'),JSON[_0xa5f6('0xf')](_0x832065));if(_0x832065['error']){if(_0x832065[_0xa5f6('0x10')]['code']===0x1f4){logger[_0xa5f6('0x10')]('Migration,\x20%s,\x20%s',_0x1cd83e,_0x832065[_0xa5f6('0x10')][_0xa5f6('0x11')]);return _0x5cfc62(_0x832065['error'][_0xa5f6('0x11')]);}logger[_0xa5f6('0x10')](_0xa5f6('0xc'),_0x1cd83e,_0x832065[_0xa5f6('0x10')]['message']);return _0x135782(_0x832065[_0xa5f6('0x10')][_0xa5f6('0x11')]);}else{logger[_0xa5f6('0xb')]('Migration,\x20%s,\x20%s',_0x1cd83e,_0xa5f6('0xd'));_0x135782(_0x832065[_0xa5f6('0x12')][_0xa5f6('0x11')]);}})[_0xa5f6('0x13')](function(_0x407845){logger['error'](_0xa5f6('0xc'),_0x1cd83e,_0x407845);_0x5cfc62(_0x407845);});});}
\ No newline at end of file
index c341023..681132a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf79=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xaf79,0xe4));var _0x9af7=function(_0x1fdce4,_0x1cdc47){_0x1fdce4=_0x1fdce4-0x0;var _0x573709=_0xaf79[_0x1fdce4];return _0x573709;};'use strict';var multer=require(_0x9af7('0x0'));var util=require(_0x9af7('0x1'));var path=require(_0x9af7('0x2'));var timeout=require(_0x9af7('0x3'));var express=require(_0x9af7('0x4'));var router=express[_0x9af7('0x5')]();var fs_extra=require(_0x9af7('0x6'));var auth=require(_0x9af7('0x7'));var interaction=require(_0x9af7('0x8'));var config=require(_0x9af7('0x9'));var controller=require('./network.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9af7('0xa')]);router[_0x9af7('0xb')](_0x9af7('0xc'),auth[_0x9af7('0xd')](),controller[_0x9af7('0xe')]);router[_0x9af7('0xf')]('/',auth[_0x9af7('0xd')](),controller[_0x9af7('0x10')]);router[_0x9af7('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x9af7('0x12')]);router['delete'](_0x9af7('0xc'),auth[_0x9af7('0xd')](),controller[_0x9af7('0x13')]);module[_0x9af7('0x14')]=router;
\ No newline at end of file
+var _0x2706=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','post','create','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0x204e5c,_0x38c5cd){var _0x19f2eb=function(_0x50f2c2){while(--_0x50f2c2){_0x204e5c['push'](_0x204e5c['shift']());}};_0x19f2eb(++_0x38c5cd);}(_0x2706,0x107));var _0x6270=function(_0x5e99a5,_0xe24ef0){_0x5e99a5=_0x5e99a5-0x0;var _0x3916cb=_0x2706[_0x5e99a5];return _0x3916cb;};'use strict';var multer=require('multer');var util=require(_0x6270('0x0'));var path=require(_0x6270('0x1'));var timeout=require(_0x6270('0x2'));var express=require(_0x6270('0x3'));var router=express['Router']();var fs_extra=require(_0x6270('0x4'));var auth=require(_0x6270('0x5'));var interaction=require(_0x6270('0x6'));var config=require(_0x6270('0x7'));var controller=require(_0x6270('0x8'));router[_0x6270('0x9')]('/',auth[_0x6270('0xa')](),controller[_0x6270('0xb')]);router['get'](_0x6270('0xc'),auth[_0x6270('0xa')](),controller['show']);router[_0x6270('0xd')]('/',auth[_0x6270('0xa')](),controller[_0x6270('0xe')]);router[_0x6270('0xf')](_0x6270('0xc'),auth[_0x6270('0xa')](),controller['update']);router[_0x6270('0x10')](_0x6270('0xc'),auth[_0x6270('0xa')](),controller[_0x6270('0x11')]);module[_0x6270('0x12')]=router;
\ No newline at end of file
index 0d1fa65..5a08cef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x016d=['STRING','sequelize','exports','localnet','externip','stun','turn'];(function(_0x373db7,_0x1777d2){var _0x47a084=function(_0x145a88){while(--_0x145a88){_0x373db7['push'](_0x373db7['shift']());}};_0x47a084(++_0x1777d2);}(_0x016d,0x1ac));var _0xd016=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x016d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xd016('0x0'));module[_0xd016('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd016('0x2'),_0xd016('0x3'),_0xd016('0x4'),_0xd016('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd016('0x6')]},'password':{'type':Sequelize[_0xd016('0x6')]}};
\ No newline at end of file
+var _0xd345=['stun','turn','STRING','sequelize','exports','ENUM','localnet','externip'];(function(_0x3150ab,_0x2bc06e){var _0x244414=function(_0x41096a){while(--_0x41096a){_0x3150ab['push'](_0x3150ab['shift']());}};_0x244414(++_0x2bc06e);}(_0xd345,0x1eb));var _0x5d34=function(_0x28a873,_0x14687c){_0x28a873=_0x28a873-0x0;var _0x3fe608=_0xd345[_0x28a873];return _0x3fe608;};'use strict';var Sequelize=require(_0x5d34('0x0'));module[_0x5d34('0x1')]={'type':{'type':Sequelize[_0x5d34('0x2')](_0x5d34('0x3'),_0x5d34('0x4'),_0x5d34('0x5'),_0x5d34('0x6'))},'value':{'type':Sequelize[_0x5d34('0x7')]},'username':{'type':Sequelize[_0x5d34('0x7')]},'password':{'type':Sequelize[_0x5d34('0x7')]}};
\ No newline at end of file
index 5b51b35..5c0112c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8299=['code','Network,\x20%s,\x20%s','message','result','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','end','stack','name','index','map','Network','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','fields','merge','find','catch','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','TURN','server/files/templates/turn_multiple.ejs','utf8','/etc/asterisk/turn_xcally.conf','create','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','Reload','chan_sip.so','update','toLowerCase','path','ejs','lodash','../../config/logger','api','../../config/environment','../../mysqldb','client','http','request','info','request\x20sent','debug','stringify','error'];(function(_0x1627ae,_0x2aaa24){var _0x34b38f=function(_0x5c4332){while(--_0x5c4332){_0x1627ae['push'](_0x1627ae['shift']());}};_0x34b38f(++_0x2aaa24);}(_0x8299,0x151));var _0x9829=function(_0x18218f,_0x1f6e2d){_0x18218f=_0x18218f-0x0;var _0x2b9c94=_0x8299[_0x18218f];return _0x2b9c94;};'use strict';var util=require('util');var path=require(_0x9829('0x0'));var ejs=require(_0x9829('0x1'));var fs=require('fs');var _=require(_0x9829('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x9829('0x3'))(_0x9829('0x4'));var config=require(_0x9829('0x5'));var db=require(_0x9829('0x6'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x9829('0x7')][_0x9829('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b5391,_0x11b1a0,_0x5b8868,_0xf1f2cb){return new Promise(function(_0x3e5ea3,_0x3c8ed4){var _0x459dc4=_0xf1f2cb||client;return _0x459dc4[_0x9829('0x9')](_0x4b5391,_0x5b8868)['then'](function(_0x570a17){logger[_0x9829('0xa')]('Network,\x20%s,\x20%s',_0x11b1a0,_0x9829('0xb'));logger[_0x9829('0xc')]('Network,\x20%s,\x20%s,\x20%s',_0x11b1a0,_0x9829('0xb'),JSON[_0x9829('0xd')](_0x570a17));if(_0x570a17[_0x9829('0xe')]){if(_0x570a17[_0x9829('0xe')][_0x9829('0xf')]===0x1f4){logger[_0x9829('0xe')](_0x9829('0x10'),_0x11b1a0,_0x570a17[_0x9829('0xe')][_0x9829('0x11')]);return _0x3c8ed4(_0x570a17[_0x9829('0xe')][_0x9829('0x11')]);}logger[_0x9829('0xe')](_0x9829('0x10'),_0x11b1a0,_0x570a17['error']['message']);return _0x3e5ea3(_0x570a17[_0x9829('0xe')][_0x9829('0x11')]);}else{logger[_0x9829('0xa')](_0x9829('0x10'),_0x11b1a0,_0x9829('0xb'));_0x3e5ea3(_0x570a17[_0x9829('0x12')][_0x9829('0x11')]);}})['catch'](function(_0x42b9d2){logger[_0x9829('0xe')](_0x9829('0x10'),_0x11b1a0,_0x42b9d2);_0x3c8ed4(_0x42b9d2);});});}function respondWithResult(_0x429697,_0x2f2424){_0x2f2424=_0x2f2424||0xc8;return function(_0x591d4c){if(_0x591d4c){return _0x429697[_0x9829('0x13')](_0x2f2424)[_0x9829('0x14')](_0x591d4c);}};}function respondWithFilteredResult(_0x5b3825,_0x378ecd){return function(_0x3407ae){if(_0x3407ae){var _0x5360a9=typeof _0x378ecd[_0x9829('0x15')]===_0x9829('0x16')&&typeof _0x378ecd[_0x9829('0x17')]===_0x9829('0x16');var _0xa4afca=_0x3407ae[_0x9829('0x18')];var _0x174f47=_0x5360a9?0x0:_0x378ecd[_0x9829('0x15')];var _0x1a725e=_0x5360a9?_0x3407ae[_0x9829('0x18')]:_0x378ecd[_0x9829('0x15')]+_0x378ecd[_0x9829('0x17')];var _0x5b2d7f;if(_0x1a725e>=_0xa4afca){_0x1a725e=_0xa4afca;_0x5b2d7f=0xc8;}else{_0x5b2d7f=0xce;}_0x5b3825[_0x9829('0x13')](_0x5b2d7f);return _0x5b3825[_0x9829('0x19')](_0x9829('0x1a'),_0x174f47+'-'+_0x1a725e+'/'+_0xa4afca)['json'](_0x3407ae);}return null;};}function saveUpdates(_0x3a01f6){return function(_0x37523d){if(_0x37523d){return _0x37523d['update'](_0x3a01f6)[_0x9829('0x1b')](function(_0x52d42c){return _0x52d42c;});}return null;};}function removeEntity(_0x2aaeb2){return function(_0x3c0ed0){if(_0x3c0ed0){return _0x3c0ed0[_0x9829('0x1c')]()[_0x9829('0x1b')](function(){_0x2aaeb2[_0x9829('0x13')](0xcc)[_0x9829('0x1d')]();});}};}function handleEntityNotFound(_0x58e931){return function(_0x40e5d0){if(!_0x40e5d0){_0x58e931['sendStatus'](0x194);}return _0x40e5d0;};}function handleError(_0x19c225,_0x42188b){_0x42188b=_0x42188b||0x1f4;return function(_0x26828a){logger[_0x9829('0xe')](_0x26828a[_0x9829('0x1e')]);if(_0x26828a['name']){delete _0x26828a[_0x9829('0x1f')];}_0x19c225[_0x9829('0x13')](_0x42188b)['send'](_0x26828a);};}exports[_0x9829('0x20')]=function(_0xe5b9da,_0xb37371){var _0x5d52a4={},_0x5daccd={},_0x5bd494={'count':0x0,'rows':[]};var _0x17ff0b=_[_0x9829('0x21')](db[_0x9829('0x22')][_0x9829('0x23')],function(_0x3be0d4){return{'name':_0x3be0d4[_0x9829('0x24')],'type':_0x3be0d4[_0x9829('0x25')][_0x9829('0x26')]};});_0x5daccd[_0x9829('0x27')]=_[_0x9829('0x21')](_0x17ff0b,'name');_0x5daccd[_0x9829('0x28')]=_['keys'](_0xe5b9da[_0x9829('0x28')]);_0x5daccd[_0x9829('0x29')]=_[_0x9829('0x2a')](_0x5daccd[_0x9829('0x27')],_0x5daccd[_0x9829('0x28')]);_0x5d52a4[_0x9829('0x2b')]=_[_0x9829('0x2a')](_0x5daccd[_0x9829('0x27')],qs['fields'](_0xe5b9da[_0x9829('0x28')]['fields']));_0x5d52a4[_0x9829('0x2b')]=_0x5d52a4[_0x9829('0x2b')][_0x9829('0x2c')]?_0x5d52a4[_0x9829('0x2b')]:_0x5daccd['model'];if(!_0xe5b9da[_0x9829('0x28')][_0x9829('0x2d')](_0x9829('0x2e'))){_0x5d52a4[_0x9829('0x17')]=qs[_0x9829('0x17')](_0xe5b9da['query'][_0x9829('0x17')]);_0x5d52a4[_0x9829('0x15')]=qs[_0x9829('0x15')](_0xe5b9da['query'][_0x9829('0x15')]);}_0x5d52a4[_0x9829('0x2f')]=qs[_0x9829('0x30')](_0xe5b9da[_0x9829('0x28')][_0x9829('0x30')]);_0x5d52a4[_0x9829('0x31')]=qs[_0x9829('0x29')](_[_0x9829('0x32')](_0xe5b9da[_0x9829('0x28')],_0x5daccd['filters']),_0x17ff0b);if(_0xe5b9da[_0x9829('0x28')][_0x9829('0x33')]){_0x5d52a4['where']=_['merge'](_0x5d52a4[_0x9829('0x31')],{'$or':_[_0x9829('0x21')](_0x17ff0b,function(_0x44629e){if(_0x44629e['type']!==_0x9829('0x34')){var _0x15b941={};_0x15b941[_0x44629e[_0x9829('0x1f')]]={'$like':'%'+_0xe5b9da[_0x9829('0x28')][_0x9829('0x33')]+'%'};return _0x15b941;}})});}_0x5d52a4=_['merge']({},_0x5d52a4,_0xe5b9da[_0x9829('0x35')]);var _0x52821a={'where':_0x5d52a4[_0x9829('0x31')]};return db[_0x9829('0x22')][_0x9829('0x18')](_0x52821a)[_0x9829('0x1b')](function(_0x4b7833){_0x5bd494[_0x9829('0x18')]=_0x4b7833;if(_0xe5b9da['query'][_0x9829('0x36')]){_0x5d52a4[_0x9829('0x37')]=[{'all':!![]}];}return db[_0x9829('0x22')][_0x9829('0x38')](_0x5d52a4);})['then'](function(_0x199acc){_0x5bd494[_0x9829('0x39')]=_0x199acc;return _0x5bd494;})['then'](respondWithFilteredResult(_0xb37371,_0x5d52a4))['catch'](handleError(_0xb37371,null));};exports[_0x9829('0x3a')]=function(_0x78cfa7,_0x283052){var _0x33f99e={'raw':!![],'where':{'id':_0x78cfa7[_0x9829('0x3b')]['id']}},_0x1ef93d={};_0x1ef93d[_0x9829('0x27')]=_[_0x9829('0x3c')](db['Network'][_0x9829('0x23')]);_0x1ef93d[_0x9829('0x28')]=_[_0x9829('0x3c')](_0x78cfa7[_0x9829('0x28')]);_0x1ef93d[_0x9829('0x29')]=_[_0x9829('0x2a')](_0x1ef93d[_0x9829('0x27')],_0x1ef93d[_0x9829('0x28')]);_0x33f99e[_0x9829('0x2b')]=_[_0x9829('0x2a')](_0x1ef93d[_0x9829('0x27')],qs[_0x9829('0x3d')](_0x78cfa7['query'][_0x9829('0x3d')]));_0x33f99e['attributes']=_0x33f99e[_0x9829('0x2b')][_0x9829('0x2c')]?_0x33f99e[_0x9829('0x2b')]:_0x1ef93d[_0x9829('0x27')];if(_0x78cfa7[_0x9829('0x28')]['includeAll']){_0x33f99e[_0x9829('0x37')]=[{'all':!![]}];}_0x33f99e=_[_0x9829('0x3e')]({},_0x33f99e,_0x78cfa7['options']);return db[_0x9829('0x22')][_0x9829('0x3f')](_0x33f99e)[_0x9829('0x1b')](handleEntityNotFound(_0x283052,null))['then'](respondWithResult(_0x283052,null))[_0x9829('0x40')](handleError(_0x283052,null));};exports['create']=function(_0xe5b2ce,_0x5a6515){var _0x3565d8;return db['Network']['create'](_0xe5b2ce[_0x9829('0x41')],{'raw':!![]})[_0x9829('0x1b')](function(_0x301912){_0x3565d8=_0x301912;return db[_0x9829('0x22')]['findAll']({'where':{'type':_0xe5b2ce[_0x9829('0x41')][_0x9829('0x25')]},'raw':!![]});})[_0x9829('0x1b')](function(_0x84345b){if(_0x3565d8[_0x9829('0x25')][_0x9829('0x42')]()==_0x9829('0x43')){var _0x59e57c=fs[_0x9829('0x44')](path[_0x9829('0x45')](config[_0x9829('0x46')],_0x9829('0x47')),'utf8');var _0x3ce15e=ejs[_0x9829('0x48')](_0x59e57c,{'networks':_0x84345b||[]});fs[_0x9829('0x49')](_0x9829('0x4a'),_0x3ce15e);return respondWithRpcPromise('Reload','create',{'module':'res_stun_monitor.so'});}else if(_0x3565d8['type'][_0x9829('0x42')]()==_0x9829('0x4b')){var _0x42f2c9=fs[_0x9829('0x44')](path[_0x9829('0x45')](config['root'],_0x9829('0x4c')),_0x9829('0x4d'));var _0x403b9e=ejs[_0x9829('0x48')](_0x42f2c9,{'networks':_0x84345b||[]});fs[_0x9829('0x49')](_0x9829('0x4e'),_0x403b9e);return respondWithRpcPromise('Reload',_0x9829('0x4f'),{'module':_0x9829('0x50')});}else{var _0x53191a=fs[_0x9829('0x44')](path[_0x9829('0x45')](config[_0x9829('0x46')],_0x9829('0x51')),_0x9829('0x4d'));var _0x501f5f=ejs[_0x9829('0x48')](_0x53191a,{'networks':_0x84345b||[]});fs[_0x9829('0x49')](util[_0x9829('0x52')](_0x9829('0x53'),_0xe5b2ce[_0x9829('0x41')][_0x9829('0x25')]['toLowerCase']()),_0x501f5f);return respondWithRpcPromise(_0x9829('0x54'),_0x9829('0x4f'),{'module':_0x9829('0x55')});}})[_0x9829('0x1b')](function(){return _0x3565d8;})['then'](respondWithResult(_0x5a6515,0xc9))[_0x9829('0x40')](handleError(_0x5a6515,null));};exports[_0x9829('0x56')]=function(_0x2ad479,_0x36ad8b){var _0xb29ca;return db[_0x9829('0x22')]['find']({'where':{'id':_0x2ad479[_0x9829('0x3b')]['id']}})[_0x9829('0x1b')](handleEntityNotFound(_0x36ad8b,null))[_0x9829('0x1b')](saveUpdates(_0x2ad479['body'],null))[_0x9829('0x1b')](function(_0x2d5bda){if(_0x2d5bda){_0xb29ca=_0x2d5bda;return db[_0x9829('0x22')][_0x9829('0x38')]({'where':{'type':_0xb29ca[_0x9829('0x25')]},'raw':!![]});}return null;})[_0x9829('0x1b')](function(_0x3adbd7){if(_0xb29ca['type'][_0x9829('0x42')]()==_0x9829('0x43')){var _0x2979fb=fs[_0x9829('0x44')](path['join'](config[_0x9829('0x46')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x1535ed=ejs[_0x9829('0x48')](_0x2979fb,{'networks':_0x3adbd7||[]});fs[_0x9829('0x49')](_0x9829('0x4a'),_0x1535ed);return respondWithRpcPromise(_0x9829('0x54'),_0x9829('0x56'),{'module':_0x9829('0x50')});}else if(_0xb29ca[_0x9829('0x25')][_0x9829('0x42')]()==_0x9829('0x4b')){var _0x4ab147=fs[_0x9829('0x44')](path[_0x9829('0x45')](config[_0x9829('0x46')],_0x9829('0x4c')),_0x9829('0x4d'));var _0x3b0611=ejs['render'](_0x4ab147,{'networks':_0x3adbd7||[]});fs[_0x9829('0x49')](_0x9829('0x4e'),_0x3b0611);return respondWithRpcPromise('Reload',_0x9829('0x56'),{'module':_0x9829('0x50')});}else{var _0x367757=fs['readFileSync'](path['join'](config[_0x9829('0x46')],'server/files/templates/network.ejs'),'utf8');var _0x437889=ejs[_0x9829('0x48')](_0x367757,{'networks':_0x3adbd7||[]});fs[_0x9829('0x49')](util[_0x9829('0x52')](_0x9829('0x53'),_0x2ad479[_0x9829('0x41')][_0x9829('0x25')][_0x9829('0x57')]()),_0x437889);return respondWithRpcPromise('Reload','update',{'module':_0x9829('0x55')});}})[_0x9829('0x1b')](function(_0x4e8638){if(_0x4e8638){return _0xb29ca;}return null;})[_0x9829('0x1b')](respondWithResult(_0x36ad8b,null))[_0x9829('0x40')](handleError(_0x36ad8b,null));};exports[_0x9829('0x1c')]=function(_0x344741,_0x233b45){var _0x1900a8;return db['Network']['find']({'where':{'id':_0x344741[_0x9829('0x3b')]['id']}})[_0x9829('0x1b')](function(_0x493def){_0x1900a8=_0x493def;return _0x493def;})[_0x9829('0x1b')](handleEntityNotFound(_0x233b45,null))[_0x9829('0x1b')](removeEntity(_0x233b45,null))[_0x9829('0x1b')](function(){if(_0x1900a8){return db[_0x9829('0x22')][_0x9829('0x38')]({'where':{'type':_0x1900a8[_0x9829('0x25')]},'raw':!![]});}})[_0x9829('0x1b')](function(_0xd1d40d){if(_0x1900a8['type'][_0x9829('0x42')]()==_0x9829('0x43')){var _0x11e624=fs[_0x9829('0x44')](path['join'](config['root'],_0x9829('0x47')),_0x9829('0x4d'));var _0xc3884c=ejs[_0x9829('0x48')](_0x11e624,{'networks':_0xd1d40d||[]});fs[_0x9829('0x49')](_0x9829('0x4a'),_0xc3884c);return respondWithRpcPromise(_0x9829('0x54'),_0x9829('0x1c'),{'module':_0x9829('0x50')});}else if(_0x1900a8[_0x9829('0x25')]['toUpperCase']()=='TURN'){var _0x1512c9=fs[_0x9829('0x44')](path[_0x9829('0x45')](config['root'],_0x9829('0x4c')),_0x9829('0x4d'));var _0x5a09c9=ejs[_0x9829('0x48')](_0x1512c9,{'networks':_0xd1d40d||[]});fs[_0x9829('0x49')](_0x9829('0x4e'),_0x5a09c9);return respondWithRpcPromise(_0x9829('0x54'),_0x9829('0x1c'),{'module':_0x9829('0x50')});}else{var _0x5edcd5=fs[_0x9829('0x44')](path[_0x9829('0x45')](config[_0x9829('0x46')],_0x9829('0x51')),_0x9829('0x4d'));var _0x492b97=ejs['render'](_0x5edcd5,{'networks':_0xd1d40d||[]});fs['writeFileSync'](util[_0x9829('0x52')]('/etc/asterisk/sip_xcally_%s.conf',_0x1900a8['type'][_0x9829('0x57')]()),_0x492b97);return respondWithRpcPromise(_0x9829('0x54'),_0x9829('0x1c'),{'module':_0x9829('0x55')});}})[_0x9829('0x40')](handleError(_0x233b45,null));};
\ No newline at end of file
+var _0x2a83=['server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','join','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','format','toLowerCase','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','/etc/asterisk/turn_xcally.conf','util','ejs','lodash','../../components/parsers/qs','../../mysqldb','jayson/promise','client','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','json','offset','undefined','limit','set','Content-Range','update','destroy','sendStatus','name','send','map','Network','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','toUpperCase','STUN','readFileSync','root'];(function(_0x397f37,_0x3cf86d){var _0x31cae6=function(_0x5cddb9){while(--_0x5cddb9){_0x397f37['push'](_0x397f37['shift']());}};_0x31cae6(++_0x3cf86d);}(_0x2a83,0x15c));var _0x32a8=function(_0x412a49,_0x25142a){_0x412a49=_0x412a49-0x0;var _0xa2399=_0x2a83[_0x412a49];return _0xa2399;};'use strict';var util=require(_0x32a8('0x0'));var path=require('path');var ejs=require(_0x32a8('0x1'));var fs=require('fs');var _=require(_0x32a8('0x2'));var qs=require(_0x32a8('0x3'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x32a8('0x4'))['db'];var jayson=require(_0x32a8('0x5'));var client=jayson[_0x32a8('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f6038,_0x141d1a,_0x5efd17,_0x46077d){return new Promise(function(_0x5f4e1b,_0x4e097c){var _0x336803=_0x46077d||client;return _0x336803[_0x32a8('0x7')](_0x3f6038,_0x5efd17)[_0x32a8('0x8')](function(_0x58379f){logger[_0x32a8('0x9')](_0x32a8('0xa'),_0x141d1a,_0x32a8('0xb'));logger[_0x32a8('0xc')](_0x32a8('0xd'),_0x141d1a,'request\x20sent',JSON[_0x32a8('0xe')](_0x58379f));if(_0x58379f[_0x32a8('0xf')]){if(_0x58379f['error'][_0x32a8('0x10')]===0x1f4){logger[_0x32a8('0xf')](_0x32a8('0xa'),_0x141d1a,_0x58379f['error'][_0x32a8('0x11')]);return _0x4e097c(_0x58379f[_0x32a8('0xf')]['message']);}logger[_0x32a8('0xf')](_0x32a8('0xa'),_0x141d1a,_0x58379f[_0x32a8('0xf')][_0x32a8('0x11')]);return _0x5f4e1b(_0x58379f[_0x32a8('0xf')][_0x32a8('0x11')]);}else{logger[_0x32a8('0x9')]('Network,\x20%s,\x20%s',_0x141d1a,'request\x20sent');_0x5f4e1b(_0x58379f['result'][_0x32a8('0x11')]);}})['catch'](function(_0x5556cc){logger[_0x32a8('0xf')](_0x32a8('0xa'),_0x141d1a,_0x5556cc);_0x4e097c(_0x5556cc);});});}function respondWithResult(_0x5fd08a,_0x4ae46a){_0x4ae46a=_0x4ae46a||0xc8;return function(_0x368eb0){if(_0x368eb0){return _0x5fd08a[_0x32a8('0x12')](_0x4ae46a)[_0x32a8('0x13')](_0x368eb0);}};}function respondWithFilteredResult(_0x128ace,_0x28da2d){return function(_0x529358){if(_0x529358){var _0x26d6eb=typeof _0x28da2d[_0x32a8('0x14')]===_0x32a8('0x15')&&typeof _0x28da2d[_0x32a8('0x16')]===_0x32a8('0x15');var _0x3ff5d0=_0x529358['count'];var _0x53686c=_0x26d6eb?0x0:_0x28da2d[_0x32a8('0x14')];var _0x784912=_0x26d6eb?_0x529358['count']:_0x28da2d[_0x32a8('0x14')]+_0x28da2d[_0x32a8('0x16')];var _0x29cff6;if(_0x784912>=_0x3ff5d0){_0x784912=_0x3ff5d0;_0x29cff6=0xc8;}else{_0x29cff6=0xce;}_0x128ace[_0x32a8('0x12')](_0x29cff6);return _0x128ace[_0x32a8('0x17')](_0x32a8('0x18'),_0x53686c+'-'+_0x784912+'/'+_0x3ff5d0)[_0x32a8('0x13')](_0x529358);}return null;};}function saveUpdates(_0x54e085){return function(_0x16f8ee){if(_0x16f8ee){return _0x16f8ee[_0x32a8('0x19')](_0x54e085)['then'](function(_0x4f10e9){return _0x4f10e9;});}return null;};}function removeEntity(_0x5bf927){return function(_0x150afd){if(_0x150afd){return _0x150afd[_0x32a8('0x1a')]()[_0x32a8('0x8')](function(){_0x5bf927[_0x32a8('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4afdbf){return function(_0x4691cc){if(!_0x4691cc){_0x4afdbf[_0x32a8('0x1b')](0x194);}return _0x4691cc;};}function handleError(_0x439adf,_0x5daad9){_0x5daad9=_0x5daad9||0x1f4;return function(_0x5a32a8){logger[_0x32a8('0xf')](_0x5a32a8['stack']);if(_0x5a32a8[_0x32a8('0x1c')]){delete _0x5a32a8[_0x32a8('0x1c')];}_0x439adf[_0x32a8('0x12')](_0x5daad9)[_0x32a8('0x1d')](_0x5a32a8);};}exports['index']=function(_0x302e20,_0x4cce3c){var _0x4c8c6a={},_0x158645={},_0xc17fc9={'count':0x0,'rows':[]};var _0x461439=_[_0x32a8('0x1e')](db[_0x32a8('0x1f')][_0x32a8('0x20')],function(_0x5665c5){return{'name':_0x5665c5[_0x32a8('0x21')],'type':_0x5665c5['type']['key']};});_0x158645[_0x32a8('0x22')]=_[_0x32a8('0x1e')](_0x461439,_0x32a8('0x1c'));_0x158645[_0x32a8('0x23')]=_['keys'](_0x302e20[_0x32a8('0x23')]);_0x158645[_0x32a8('0x24')]=_[_0x32a8('0x25')](_0x158645[_0x32a8('0x22')],_0x158645[_0x32a8('0x23')]);_0x4c8c6a[_0x32a8('0x26')]=_[_0x32a8('0x25')](_0x158645[_0x32a8('0x22')],qs['fields'](_0x302e20[_0x32a8('0x23')][_0x32a8('0x27')]));_0x4c8c6a['attributes']=_0x4c8c6a[_0x32a8('0x26')][_0x32a8('0x28')]?_0x4c8c6a[_0x32a8('0x26')]:_0x158645[_0x32a8('0x22')];if(!_0x302e20[_0x32a8('0x23')]['hasOwnProperty'](_0x32a8('0x29'))){_0x4c8c6a[_0x32a8('0x16')]=qs[_0x32a8('0x16')](_0x302e20[_0x32a8('0x23')][_0x32a8('0x16')]);_0x4c8c6a[_0x32a8('0x14')]=qs['offset'](_0x302e20[_0x32a8('0x23')][_0x32a8('0x14')]);}_0x4c8c6a[_0x32a8('0x2a')]=qs[_0x32a8('0x2b')](_0x302e20['query'][_0x32a8('0x2b')]);_0x4c8c6a[_0x32a8('0x2c')]=qs[_0x32a8('0x24')](_[_0x32a8('0x2d')](_0x302e20[_0x32a8('0x23')],_0x158645[_0x32a8('0x24')]),_0x461439);if(_0x302e20['query'][_0x32a8('0x2e')]){_0x4c8c6a[_0x32a8('0x2c')]=_[_0x32a8('0x2f')](_0x4c8c6a[_0x32a8('0x2c')],{'$or':_[_0x32a8('0x1e')](_0x461439,function(_0x334037){if(_0x334037[_0x32a8('0x30')]!==_0x32a8('0x31')){var _0x119713={};_0x119713[_0x334037[_0x32a8('0x1c')]]={'$like':'%'+_0x302e20[_0x32a8('0x23')][_0x32a8('0x2e')]+'%'};return _0x119713;}})});}_0x4c8c6a=_['merge']({},_0x4c8c6a,_0x302e20[_0x32a8('0x32')]);var _0x4e6399={'where':_0x4c8c6a[_0x32a8('0x2c')]};return db[_0x32a8('0x1f')][_0x32a8('0x33')](_0x4e6399)[_0x32a8('0x8')](function(_0x5353ab){_0xc17fc9['count']=_0x5353ab;if(_0x302e20[_0x32a8('0x23')][_0x32a8('0x34')]){_0x4c8c6a[_0x32a8('0x35')]=[{'all':!![]}];}return db[_0x32a8('0x1f')][_0x32a8('0x36')](_0x4c8c6a);})[_0x32a8('0x8')](function(_0x560cc2){_0xc17fc9[_0x32a8('0x37')]=_0x560cc2;return _0xc17fc9;})[_0x32a8('0x8')](respondWithFilteredResult(_0x4cce3c,_0x4c8c6a))['catch'](handleError(_0x4cce3c,null));};exports[_0x32a8('0x38')]=function(_0x12ff10,_0x510a30){var _0x5bee75={'raw':!![],'where':{'id':_0x12ff10[_0x32a8('0x39')]['id']}},_0x3093b7={};_0x3093b7['model']=_[_0x32a8('0x3a')](db[_0x32a8('0x1f')][_0x32a8('0x20')]);_0x3093b7['query']=_[_0x32a8('0x3a')](_0x12ff10['query']);_0x3093b7[_0x32a8('0x24')]=_[_0x32a8('0x25')](_0x3093b7[_0x32a8('0x22')],_0x3093b7['query']);_0x5bee75['attributes']=_[_0x32a8('0x25')](_0x3093b7[_0x32a8('0x22')],qs[_0x32a8('0x27')](_0x12ff10[_0x32a8('0x23')][_0x32a8('0x27')]));_0x5bee75[_0x32a8('0x26')]=_0x5bee75[_0x32a8('0x26')][_0x32a8('0x28')]?_0x5bee75[_0x32a8('0x26')]:_0x3093b7['model'];if(_0x12ff10[_0x32a8('0x23')][_0x32a8('0x34')]){_0x5bee75[_0x32a8('0x35')]=[{'all':!![]}];}_0x5bee75=_['merge']({},_0x5bee75,_0x12ff10[_0x32a8('0x32')]);return db[_0x32a8('0x1f')][_0x32a8('0x3b')](_0x5bee75)[_0x32a8('0x8')](handleEntityNotFound(_0x510a30,null))[_0x32a8('0x8')](respondWithResult(_0x510a30,null))[_0x32a8('0x3c')](handleError(_0x510a30,null));};exports[_0x32a8('0x3d')]=function(_0x18f8f5,_0xd5caf9){var _0x3ed8fc;return db[_0x32a8('0x1f')]['create'](_0x18f8f5[_0x32a8('0x3e')],{'raw':!![]})[_0x32a8('0x8')](function(_0x1fb133){_0x3ed8fc=_0x1fb133;return db[_0x32a8('0x1f')][_0x32a8('0x36')]({'where':{'type':_0x18f8f5[_0x32a8('0x3e')][_0x32a8('0x30')]},'raw':!![]});})[_0x32a8('0x8')](function(_0x1ac300){if(_0x3ed8fc[_0x32a8('0x30')][_0x32a8('0x3f')]()==_0x32a8('0x40')){var _0x363eeb=fs[_0x32a8('0x41')](path['join'](config[_0x32a8('0x42')],_0x32a8('0x43')),_0x32a8('0x44'));var _0x35feaa=ejs[_0x32a8('0x45')](_0x363eeb,{'networks':_0x1ac300||[]});fs[_0x32a8('0x46')](_0x32a8('0x47'),_0x35feaa);return respondWithRpcPromise(_0x32a8('0x48'),_0x32a8('0x3d'),{'module':_0x32a8('0x49')});}else if(_0x3ed8fc[_0x32a8('0x30')][_0x32a8('0x3f')]()==_0x32a8('0x4a')){var _0x5abaae=fs['readFileSync'](path[_0x32a8('0x4b')](config[_0x32a8('0x42')],_0x32a8('0x4c')),_0x32a8('0x44'));var _0x7c83c9=ejs['render'](_0x5abaae,{'networks':_0x1ac300||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x7c83c9);return respondWithRpcPromise('Reload',_0x32a8('0x3d'),{'module':_0x32a8('0x49')});}else{var _0x46185d=fs[_0x32a8('0x41')](path['join'](config[_0x32a8('0x42')],_0x32a8('0x4d')),_0x32a8('0x44'));var _0x23139c=ejs[_0x32a8('0x45')](_0x46185d,{'networks':_0x1ac300||[]});fs[_0x32a8('0x46')](util[_0x32a8('0x4e')]('/etc/asterisk/sip_xcally_%s.conf',_0x18f8f5[_0x32a8('0x3e')][_0x32a8('0x30')][_0x32a8('0x4f')]()),_0x23139c);return respondWithRpcPromise(_0x32a8('0x48'),_0x32a8('0x3d'),{'module':'chan_sip.so'});}})[_0x32a8('0x8')](function(){return _0x3ed8fc;})[_0x32a8('0x8')](respondWithResult(_0xd5caf9,0xc9))[_0x32a8('0x3c')](handleError(_0xd5caf9,null));};exports[_0x32a8('0x19')]=function(_0xd90ae8,_0x25cf49){var _0x3e049a;return db[_0x32a8('0x1f')][_0x32a8('0x3b')]({'where':{'id':_0xd90ae8['params']['id']}})[_0x32a8('0x8')](handleEntityNotFound(_0x25cf49,null))[_0x32a8('0x8')](saveUpdates(_0xd90ae8[_0x32a8('0x3e')],null))[_0x32a8('0x8')](function(_0x289488){if(_0x289488){_0x3e049a=_0x289488;return db[_0x32a8('0x1f')]['findAll']({'where':{'type':_0x3e049a['type']},'raw':!![]});}return null;})['then'](function(_0xfa6ed1){if(_0x3e049a[_0x32a8('0x30')][_0x32a8('0x3f')]()==_0x32a8('0x40')){var _0x47548d=fs[_0x32a8('0x41')](path['join'](config[_0x32a8('0x42')],_0x32a8('0x43')),_0x32a8('0x44'));var _0x18e8c4=ejs[_0x32a8('0x45')](_0x47548d,{'networks':_0xfa6ed1||[]});fs[_0x32a8('0x46')](_0x32a8('0x47'),_0x18e8c4);return respondWithRpcPromise(_0x32a8('0x48'),_0x32a8('0x19'),{'module':_0x32a8('0x49')});}else if(_0x3e049a[_0x32a8('0x30')][_0x32a8('0x3f')]()==_0x32a8('0x4a')){var _0x57503a=fs[_0x32a8('0x41')](path[_0x32a8('0x4b')](config[_0x32a8('0x42')],_0x32a8('0x4c')),_0x32a8('0x44'));var _0x1b0b0f=ejs['render'](_0x57503a,{'networks':_0xfa6ed1||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x1b0b0f);return respondWithRpcPromise(_0x32a8('0x48'),_0x32a8('0x19'),{'module':_0x32a8('0x49')});}else{var _0x3dbad3=fs[_0x32a8('0x41')](path['join'](config[_0x32a8('0x42')],'server/files/templates/network.ejs'),'utf8');var _0x210255=ejs[_0x32a8('0x45')](_0x3dbad3,{'networks':_0xfa6ed1||[]});fs[_0x32a8('0x46')](util['format'](_0x32a8('0x50'),_0xd90ae8[_0x32a8('0x3e')][_0x32a8('0x30')][_0x32a8('0x4f')]()),_0x210255);return respondWithRpcPromise(_0x32a8('0x48'),'update',{'module':_0x32a8('0x51')});}})['then'](function(_0x166a5a){if(_0x166a5a){return _0x3e049a;}return null;})[_0x32a8('0x8')](respondWithResult(_0x25cf49,null))[_0x32a8('0x3c')](handleError(_0x25cf49,null));};exports[_0x32a8('0x1a')]=function(_0x3c538b,_0x1bb522){var _0x152b38;return db[_0x32a8('0x1f')][_0x32a8('0x3b')]({'where':{'id':_0x3c538b[_0x32a8('0x39')]['id']}})[_0x32a8('0x8')](function(_0x2f0a05){_0x152b38=_0x2f0a05;return _0x2f0a05;})[_0x32a8('0x8')](handleEntityNotFound(_0x1bb522,null))[_0x32a8('0x8')](removeEntity(_0x1bb522,null))[_0x32a8('0x8')](function(){if(_0x152b38){return db[_0x32a8('0x1f')]['findAll']({'where':{'type':_0x152b38['type']},'raw':!![]});}})[_0x32a8('0x8')](function(_0x56fa2d){if(_0x152b38[_0x32a8('0x30')]['toUpperCase']()==_0x32a8('0x40')){var _0x301b90=fs[_0x32a8('0x41')](path[_0x32a8('0x4b')](config[_0x32a8('0x42')],_0x32a8('0x43')),_0x32a8('0x44'));var _0x1a23a6=ejs['render'](_0x301b90,{'networks':_0x56fa2d||[]});fs['writeFileSync'](_0x32a8('0x47'),_0x1a23a6);return respondWithRpcPromise(_0x32a8('0x48'),_0x32a8('0x1a'),{'module':_0x32a8('0x49')});}else if(_0x152b38[_0x32a8('0x30')]['toUpperCase']()==_0x32a8('0x4a')){var _0xcf80d9=fs[_0x32a8('0x41')](path[_0x32a8('0x4b')](config[_0x32a8('0x42')],_0x32a8('0x4c')),_0x32a8('0x44'));var _0x4bf826=ejs[_0x32a8('0x45')](_0xcf80d9,{'networks':_0x56fa2d||[]});fs[_0x32a8('0x46')](_0x32a8('0x52'),_0x4bf826);return respondWithRpcPromise(_0x32a8('0x48'),_0x32a8('0x1a'),{'module':_0x32a8('0x49')});}else{var _0x31473b=fs[_0x32a8('0x41')](path['join'](config['root'],_0x32a8('0x4d')),_0x32a8('0x44'));var _0x44e4c7=ejs[_0x32a8('0x45')](_0x31473b,{'networks':_0x56fa2d||[]});fs[_0x32a8('0x46')](util[_0x32a8('0x4e')]('/etc/asterisk/sip_xcally_%s.conf',_0x152b38[_0x32a8('0x30')][_0x32a8('0x4f')]()),_0x44e4c7);return respondWithRpcPromise(_0x32a8('0x48'),_0x32a8('0x1a'),{'module':_0x32a8('0x51')});}})[_0x32a8('0x3c')](handleError(_0x1bb522,null));};
\ No newline at end of file
index 71384fe..6b00814 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb53=['define','Network','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x16751b,_0xe4ab09){var _0x59e23a=function(_0x5738c7){while(--_0x5738c7){_0x16751b['push'](_0x16751b['shift']());}};_0x59e23a(++_0xe4ab09);}(_0xbb53,0x121));var _0x3bb5=function(_0x446613,_0x325071){_0x446613=_0x446613-0x0;var _0x2d293e=_0xbb53[_0x446613];return _0x2d293e;};'use strict';var _=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var logger=require(_0x3bb5('0x2'))(_0x3bb5('0x3'));var moment=require(_0x3bb5('0x4'));var BPromise=require(_0x3bb5('0x5'));var rp=require(_0x3bb5('0x6'));var fs=require('fs');var path=require(_0x3bb5('0x7'));var rimraf=require(_0x3bb5('0x8'));var config=require(_0x3bb5('0x9'));var attributes=require('./network.attributes');module['exports']=function(_0x23f11e,_0x2460b0){return _0x23f11e[_0x3bb5('0xa')](_0x3bb5('0xb'),attributes,{'tableName':_0x3bb5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc874=['../../config/logger','api','request-promise','path','rimraf','./network.attributes','exports','define','Network','network','lodash'];(function(_0x5c8b01,_0x1102c1){var _0x180b22=function(_0x279299){while(--_0x279299){_0x5c8b01['push'](_0x5c8b01['shift']());}};_0x180b22(++_0x1102c1);}(_0xc874,0x154));var _0x4c87=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0xc874[_0x11a55c];return _0x26c390;};'use strict';var _=require(_0x4c87('0x0'));var util=require('util');var logger=require(_0x4c87('0x1'))(_0x4c87('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4c87('0x3'));var fs=require('fs');var path=require(_0x4c87('0x4'));var rimraf=require(_0x4c87('0x5'));var config=require('../../config/environment');var attributes=require(_0x4c87('0x6'));module[_0x4c87('0x7')]=function(_0x5d63ae,_0x46e0f5){return _0x5d63ae[_0x4c87('0x8')](_0x4c87('0x9'),attributes,{'tableName':_0x4c87('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index df42271..006b789 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2d17da,_0x5c123e){var _0x4cfe32=function(_0x4f84f9){while(--_0x4f84f9){_0x2d17da['push'](_0x2d17da['shift']());}};_0x4cfe32(++_0x5c123e);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}
\ No newline at end of file
+var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x320f94,_0xcb4f29){var _0x2c39c9=function(_0x3bc7dd){while(--_0x3bc7dd){_0x320f94['push'](_0x320f94['shift']());}};_0x2c39c9(++_0xcb4f29);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}
\ No newline at end of file
index bb67d70..081b00d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08c5=['/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','notify','addApplications','addAgents','/:id/send','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','getAnswers','/:id/applications','getApplications','getInteractions'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0x08c5,0x67));var _0x508c=function(_0x5b0eea,_0x505b35){_0x5b0eea=_0x5b0eea-0x0;var _0x1553a9=_0x08c5[_0x5b0eea];return _0x1553a9;};'use strict';var multer=require(_0x508c('0x0'));var util=require(_0x508c('0x1'));var path=require(_0x508c('0x2'));var timeout=require(_0x508c('0x3'));var express=require(_0x508c('0x4'));var router=express[_0x508c('0x5')]();var fs_extra=require(_0x508c('0x6'));var auth=require(_0x508c('0x7'));var interaction=require(_0x508c('0x8'));var config=require(_0x508c('0x9'));var controller=require(_0x508c('0xa'));router[_0x508c('0xb')]('/',auth[_0x508c('0xc')](),controller[_0x508c('0xd')]);router[_0x508c('0xb')](_0x508c('0xe'),auth[_0x508c('0xc')](),controller[_0x508c('0xf')]);router[_0x508c('0xb')](_0x508c('0x10'),auth[_0x508c('0xc')](),controller[_0x508c('0x11')]);router[_0x508c('0xb')]('/:id/dispositions',auth[_0x508c('0xc')](),controller[_0x508c('0x12')]);router[_0x508c('0xb')]('/:id/canned_answers',auth[_0x508c('0xc')](),controller[_0x508c('0x13')]);router[_0x508c('0xb')](_0x508c('0x14'),auth[_0x508c('0xc')](),controller[_0x508c('0x15')]);router[_0x508c('0xb')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x508c('0x16')]);router[_0x508c('0xb')](_0x508c('0x17'),auth[_0x508c('0xc')](),controller[_0x508c('0x18')]);router[_0x508c('0x19')]('/',auth['isAuthenticated'](),controller[_0x508c('0x1a')]);router[_0x508c('0x19')](_0x508c('0x1b'),auth[_0x508c('0xc')](),controller[_0x508c('0x1c')]);router[_0x508c('0x19')](_0x508c('0x1d'),auth[_0x508c('0xc')](),controller[_0x508c('0x1e')]);router[_0x508c('0x19')]('/:id/notify',controller[_0x508c('0x1f')]);router[_0x508c('0x19')](_0x508c('0x14'),auth[_0x508c('0xc')](),controller[_0x508c('0x20')]);router[_0x508c('0x19')]('/:id/users',auth[_0x508c('0xc')](),controller[_0x508c('0x21')]);router['post'](_0x508c('0x22'),auth[_0x508c('0xc')](),controller['send']);router[_0x508c('0x23')](_0x508c('0x10'),auth['isAuthenticated'](),controller[_0x508c('0x24')]);router[_0x508c('0x25')](_0x508c('0x10'),auth[_0x508c('0xc')](),controller[_0x508c('0x26')]);router[_0x508c('0x25')](_0x508c('0x1b'),auth[_0x508c('0xc')](),controller[_0x508c('0x27')]);router[_0x508c('0x25')]('/:id/canned_answers',auth[_0x508c('0xc')](),controller['removeAnswers']);router[_0x508c('0x25')](_0x508c('0x17'),auth[_0x508c('0xc')](),controller[_0x508c('0x28')]);module[_0x508c('0x29')]=router;
\ No newline at end of file
+var _0x53d7=['/:id/send','send','put','update','delete','removeAnswers','/:id/users','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','post','create','addDisposition','addAnswer','/:id/applications','addApplications','addAgents'];(function(_0x4610a1,_0x52c51e){var _0x1fbed7=function(_0x45ef7b){while(--_0x45ef7b){_0x4610a1['push'](_0x4610a1['shift']());}};_0x1fbed7(++_0x52c51e);}(_0x53d7,0x103));var _0x753d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x53d7[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x753d('0x0'));var util=require(_0x753d('0x1'));var path=require(_0x753d('0x2'));var timeout=require(_0x753d('0x3'));var express=require('express');var router=express[_0x753d('0x4')]();var fs_extra=require(_0x753d('0x5'));var auth=require(_0x753d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x753d('0x7'));var controller=require(_0x753d('0x8'));router[_0x753d('0x9')]('/',auth[_0x753d('0xa')](),controller[_0x753d('0xb')]);router[_0x753d('0x9')]('/describe',auth[_0x753d('0xa')](),controller[_0x753d('0xc')]);router[_0x753d('0x9')](_0x753d('0xd'),auth[_0x753d('0xa')](),controller[_0x753d('0xe')]);router[_0x753d('0x9')](_0x753d('0xf'),auth[_0x753d('0xa')](),controller[_0x753d('0x10')]);router[_0x753d('0x9')](_0x753d('0x11'),auth['isAuthenticated'](),controller[_0x753d('0x12')]);router['get']('/:id/applications',auth[_0x753d('0xa')](),controller[_0x753d('0x13')]);router[_0x753d('0x9')](_0x753d('0x14'),auth[_0x753d('0xa')](),controller[_0x753d('0x15')]);router['get']('/:id/users',auth[_0x753d('0xa')](),controller['getAgents']);router[_0x753d('0x16')]('/',auth[_0x753d('0xa')](),controller[_0x753d('0x17')]);router[_0x753d('0x16')](_0x753d('0xf'),auth[_0x753d('0xa')](),controller[_0x753d('0x18')]);router[_0x753d('0x16')](_0x753d('0x11'),auth[_0x753d('0xa')](),controller[_0x753d('0x19')]);router['post']('/:id/notify',controller['notify']);router['post'](_0x753d('0x1a'),auth['isAuthenticated'](),controller[_0x753d('0x1b')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x753d('0x1c')]);router[_0x753d('0x16')](_0x753d('0x1d'),auth[_0x753d('0xa')](),controller[_0x753d('0x1e')]);router[_0x753d('0x1f')](_0x753d('0xd'),auth[_0x753d('0xa')](),controller[_0x753d('0x20')]);router[_0x753d('0x21')]('/:id',auth[_0x753d('0xa')](),controller['destroy']);router[_0x753d('0x21')](_0x753d('0xf'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x753d('0x21')]('/:id/canned_answers',auth[_0x753d('0xa')](),controller[_0x753d('0x22')]);router['delete'](_0x753d('0x23'),auth[_0x753d('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 3de2b84..f1b0ec0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe309=['TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','STRING','name','generate'];(function(_0x3311ae,_0x362cee){var _0x107949=function(_0x2082a3){while(--_0x2082a3){_0x3311ae['push'](_0x3311ae['shift']());}};_0x107949(++_0x362cee);}(_0xe309,0xff));var _0x9e30=function(_0x275602,_0x5c6d8e){_0x275602=_0x275602-0x0;var _0x57a2a3=_0xe309[_0x275602];return _0x57a2a3;};'use strict';var Sequelize=require(_0x9e30('0x0'));var rs=require(_0x9e30('0x1'));module['exports']={'name':{'type':Sequelize[_0x9e30('0x2')],'unique':_0x9e30('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x9e30('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x9e30('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x9e30('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9e30('0x5')],'defaultValue':function(){return _0x9e30('0x6');}},'notificationSound':{'type':Sequelize[_0x9e30('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9e30('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x9e30('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9e30('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9e30('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9e30('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9e30('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x9e30('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9e30('0xa'),'set':function(_0x1fe6be){if(!_0x1fe6be)this[_0x9e30('0xb')](_0x9e30('0xc'),null);this[_0x9e30('0xb')]('mandatoryDisposition',_0x1fe6be);}}};
\ No newline at end of file
+var _0x3f93=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x134b45,_0x1723a0){var _0x43b0dc=function(_0x11b331){while(--_0x11b331){_0x134b45['push'](_0x134b45['shift']());}};_0x43b0dc(++_0x1723a0);}(_0x3f93,0x93));var _0x33f9=function(_0x5ad424,_0x59d69d){_0x5ad424=_0x5ad424-0x0;var _0x21e093=_0x3f93[_0x5ad424];return _0x21e093;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x33f9('0x0')]={'name':{'type':Sequelize[_0x33f9('0x1')],'unique':_0x33f9('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x33f9('0x1')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x33f9('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x33f9('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x33f9('0x4')],'defaultValue':function(){return _0x33f9('0x5');}},'notificationSound':{'type':Sequelize[_0x33f9('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x33f9('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x33f9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x33f9('0x1')]},'queueTransfer':{'type':Sequelize[_0x33f9('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x33f9('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x33f9('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x33f9('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x33f9('0x9'),'set':function(_0x2ffe32){if(!_0x2ffe32)this[_0x33f9('0xa')](_0x33f9('0xb'),null);this[_0x33f9('0xa')](_0x33f9('0xc'),_0x2ffe32);}}};
\ No newline at end of file
index 32b5f5f..b0ff749 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67a2=['OpenchannelApplication','bulkCreate','getApplications','getInteractions','Contact','User','Owner','fullname','Tag','color','tag','addAgents','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','out','dataValues','Messages','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','OpenchannelAccounts','UserProfileResource','name','send','Pause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','show','params','mandatoryDispositionPause','keys','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','from','List','Contacts','DESC','account','Applications','list','applications','priority','asc','contact','firstName','threadId','OpenchannelInteraction','lastName','messageId','interaction','created','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','addApplications','sequelize','transaction','ISOLATION_LEVELS'];(function(_0x2f1380,_0x4b6349){var _0x17447b=function(_0x45f96a){while(--_0x45f96a){_0x2f1380['push'](_0x2f1380['shift']());}};_0x17447b(++_0x4b6349);}(_0x67a2,0xd3));var _0x267a=function(_0x58770f,_0x5f0162){_0x58770f=_0x58770f-0x0;var _0x5c55c5=_0x67a2[_0x58770f];return _0x5c55c5;};'use strict';var emlformat=require(_0x267a('0x0'));var rimraf=require(_0x267a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x267a('0x2'));var rp=require(_0x267a('0x3'));var moment=require(_0x267a('0x4'));var BPromise=require(_0x267a('0x5'));var Mustache=require(_0x267a('0x6'));var util=require(_0x267a('0x7'));var path=require(_0x267a('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x267a('0x9'));var fs=require('fs');var fs_extra=require(_0x267a('0xa'));var _=require(_0x267a('0xb'));var squel=require('squel');var crypto=require(_0x267a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x267a('0xd'));var toCsv=require(_0x267a('0xe'));var querystring=require(_0x267a('0xf'));var Papa=require(_0x267a('0x10'));var Redis=require(_0x267a('0x11'));var authService=require(_0x267a('0x12'));var qs=require(_0x267a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x267a('0x14'));var logger=require(_0x267a('0x15'))(_0x267a('0x16'));var utils=require(_0x267a('0x17'));var config=require(_0x267a('0x18'));var licenseUtil=require(_0x267a('0x19'));var db=require(_0x267a('0x1a'))['db'];config[_0x267a('0x1b')]=_[_0x267a('0x1c')](config[_0x267a('0x1b')],{'host':_0x267a('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x267a('0x1b')]));require('./openchannelAccount.socket')[_0x267a('0x1e')](socket);var jayson=require(_0x267a('0x1f'));var client=jayson[_0x267a('0x20')]['http']({'port':0x232c});var client9002=jayson['client'][_0x267a('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x1bf03b,_0x2dfcb1,_0x5d1a05,_0xa7881){return new BPromise(function(_0x168d29,_0x274666){var _0x33cca9=_0xa7881||client;return _0x33cca9[_0x267a('0x22')](_0x1bf03b,_0x5d1a05)['then'](function(_0x46cb25){logger['info'](_0x267a('0x23'),_0x2dfcb1,_0x267a('0x24'));logger['debug'](_0x267a('0x25'),_0x2dfcb1,'request\x20sent',JSON[_0x267a('0x26')](_0x46cb25));if(_0x46cb25[_0x267a('0x27')]){if(_0x46cb25[_0x267a('0x27')]['code']===0x1f4){logger[_0x267a('0x27')](_0x267a('0x23'),_0x2dfcb1,_0x46cb25[_0x267a('0x27')][_0x267a('0x28')]);return _0x274666(_0x46cb25['error'][_0x267a('0x28')]);}logger[_0x267a('0x27')](_0x267a('0x23'),_0x2dfcb1,_0x46cb25[_0x267a('0x27')][_0x267a('0x28')]);return _0x168d29(_0x46cb25[_0x267a('0x27')][_0x267a('0x28')]);}else{logger[_0x267a('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x2dfcb1,_0x267a('0x24'));_0x168d29(_0x46cb25[_0x267a('0x2a')][_0x267a('0x28')]);}})['catch'](function(_0x4e7531){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x2dfcb1,_0x4e7531);_0x274666(_0x4e7531);});});}function respondWithStatusCode(_0x1cb987,_0x14eee1){_0x14eee1=_0x14eee1||0xcc;return function(_0x2af2b3){if(_0x2af2b3){return _0x1cb987[_0x267a('0x2b')](_0x14eee1);}return _0x1cb987[_0x267a('0x2c')](_0x14eee1)[_0x267a('0x2d')]();};}function respondWithResult(_0x24e29d,_0x4dd1b3){_0x4dd1b3=_0x4dd1b3||0xc8;return function(_0x2f5431){if(_0x2f5431){return _0x24e29d[_0x267a('0x2c')](_0x4dd1b3)[_0x267a('0x2e')](_0x2f5431);}};}function respondWithFilteredResult(_0x5abcde,_0x54b0d9){return function(_0x1660d2){if(_0x1660d2){var _0x5934fc=typeof _0x54b0d9[_0x267a('0x2f')]===_0x267a('0x30')&&typeof _0x54b0d9[_0x267a('0x31')]===_0x267a('0x30');var _0x1d7108=_0x1660d2['count'];var _0x3e890c=_0x5934fc?0x0:_0x54b0d9['offset'];var _0x4466ca=_0x5934fc?_0x1660d2[_0x267a('0x32')]:_0x54b0d9[_0x267a('0x2f')]+_0x54b0d9[_0x267a('0x31')];var _0x54d8dd;if(_0x4466ca>=_0x1d7108){_0x4466ca=_0x1d7108;_0x54d8dd=0xc8;}else{_0x54d8dd=0xce;}_0x5abcde['status'](_0x54d8dd);return _0x5abcde[_0x267a('0x33')](_0x267a('0x34'),_0x3e890c+'-'+_0x4466ca+'/'+_0x1d7108)[_0x267a('0x2e')](_0x1660d2);}return null;};}function patchUpdates(_0x5d216e){return function(_0x58f297){try{jsonpatch[_0x267a('0x35')](_0x58f297,_0x5d216e,!![]);}catch(_0x3a6b13){return BPromise[_0x267a('0x36')](_0x3a6b13);}return _0x58f297[_0x267a('0x37')]();};}function saveUpdates(_0x441f08,_0x63697d){return function(_0x578ed5){if(_0x578ed5){return _0x578ed5[_0x267a('0x38')](_0x441f08)['then'](function(_0x25c5da){return _0x25c5da;});}return null;};}function removeEntity(_0x505efe,_0x408d4c){return function(_0x251848){if(_0x251848){return _0x251848[_0x267a('0x39')]()[_0x267a('0x3a')](function(){var _0x391ca4=_0x251848[_0x267a('0x3b')]({'plain':!![]});var _0x1cae48=_0x267a('0x3c');return db[_0x267a('0x3d')]['destroy']({'where':{'type':_0x1cae48,'resourceId':_0x391ca4['id']}})[_0x267a('0x3a')](function(){return _0x251848;});})[_0x267a('0x3a')](function(){_0x505efe[_0x267a('0x2c')](0xcc)[_0x267a('0x2d')]();});}};}function handleEntityNotFound(_0x57ea01,_0x243c05){return function(_0x382245){if(!_0x382245){_0x57ea01['sendStatus'](0x194);}return _0x382245;};}function handleError(_0x2a9fa1,_0x5da04c){_0x5da04c=_0x5da04c||0x1f4;return function(_0x3e4578){logger[_0x267a('0x27')](_0x3e4578['stack']);if(_0x3e4578[_0x267a('0x3e')]){delete _0x3e4578['name'];}_0x2a9fa1[_0x267a('0x2c')](_0x5da04c)[_0x267a('0x3f')](_0x3e4578);};}exports['index']=function(_0x43e42d,_0x24b03b){var _0x399a6a={'include':[{'model':db[_0x267a('0x40')],'as':'mandatoryDispositionPause'}]},_0xcad5eb={},_0x1d3cc4={'count':0x0,'rows':[]};var _0x2a5bd2=_[_0x267a('0x41')](db[_0x267a('0x42')][_0x267a('0x43')],function(_0x21d957){return{'name':_0x21d957[_0x267a('0x44')],'type':_0x21d957[_0x267a('0x45')][_0x267a('0x46')]};});_0xcad5eb['model']=_[_0x267a('0x41')](_0x2a5bd2,'name');_0xcad5eb[_0x267a('0x47')]=_['keys'](_0x43e42d[_0x267a('0x47')]);_0xcad5eb[_0x267a('0x48')]=_[_0x267a('0x49')](_0xcad5eb[_0x267a('0x4a')],_0xcad5eb[_0x267a('0x47')]);_0x399a6a[_0x267a('0x4b')]=_[_0x267a('0x49')](_0xcad5eb[_0x267a('0x4a')],qs[_0x267a('0x4c')](_0x43e42d[_0x267a('0x47')][_0x267a('0x4c')]));_0x399a6a[_0x267a('0x4b')]=_0x399a6a[_0x267a('0x4b')][_0x267a('0x4d')]?_0x399a6a[_0x267a('0x4b')]:_0xcad5eb['model'];if(!_0x43e42d[_0x267a('0x47')][_0x267a('0x4e')](_0x267a('0x4f'))){_0x399a6a[_0x267a('0x31')]=qs[_0x267a('0x31')](_0x43e42d[_0x267a('0x47')]['limit']);_0x399a6a[_0x267a('0x2f')]=qs['offset'](_0x43e42d[_0x267a('0x47')]['offset']);}_0x399a6a[_0x267a('0x50')]=qs[_0x267a('0x51')](_0x43e42d['query'][_0x267a('0x51')]);_0x399a6a[_0x267a('0x52')]=qs['filters'](_[_0x267a('0x53')](_0x43e42d[_0x267a('0x47')],_0xcad5eb[_0x267a('0x48')]),_0x2a5bd2);if(_0x43e42d[_0x267a('0x47')][_0x267a('0x54')]){_0x399a6a[_0x267a('0x52')]=_[_0x267a('0x55')](_0x399a6a[_0x267a('0x52')],{'$or':_[_0x267a('0x41')](_0x2a5bd2,function(_0x276d9a){if(_0x276d9a['type']!=='VIRTUAL'){var _0x356e8e={};_0x356e8e[_0x276d9a[_0x267a('0x3e')]]={'$like':'%'+_0x43e42d[_0x267a('0x47')][_0x267a('0x54')]+'%'};return _0x356e8e;}})});}_0x399a6a=_[_0x267a('0x55')]({},_0x399a6a,_0x43e42d['options']);var _0x11cfec={'where':_0x399a6a['where']};return db[_0x267a('0x42')][_0x267a('0x32')](_0x11cfec)[_0x267a('0x3a')](function(_0x439dd9){_0x1d3cc4[_0x267a('0x32')]=_0x439dd9;if(_0x43e42d[_0x267a('0x47')][_0x267a('0x56')]){_0x399a6a[_0x267a('0x57')]=[{'all':!![]}];}return db[_0x267a('0x42')]['findAll'](_0x399a6a);})[_0x267a('0x3a')](function(_0x16bdce){_0x1d3cc4[_0x267a('0x58')]=_0x16bdce;return _0x1d3cc4;})[_0x267a('0x3a')](respondWithFilteredResult(_0x24b03b,_0x399a6a))['catch'](handleError(_0x24b03b,null));};exports[_0x267a('0x59')]=function(_0x5076fd,_0xb3909a){var _0x1419e9={'raw':![],'where':{'id':_0x5076fd[_0x267a('0x5a')]['id']},'include':[{'model':db[_0x267a('0x40')],'as':_0x267a('0x5b')}]},_0x2d11d1={};_0x2d11d1[_0x267a('0x4a')]=_[_0x267a('0x5c')](db['OpenchannelAccount']['rawAttributes']);_0x2d11d1[_0x267a('0x47')]=_[_0x267a('0x5c')](_0x5076fd[_0x267a('0x47')]);_0x2d11d1[_0x267a('0x48')]=_[_0x267a('0x49')](_0x2d11d1[_0x267a('0x4a')],_0x2d11d1[_0x267a('0x47')]);_0x1419e9[_0x267a('0x4b')]=_[_0x267a('0x49')](_0x2d11d1[_0x267a('0x4a')],qs['fields'](_0x5076fd[_0x267a('0x47')][_0x267a('0x4c')]));_0x1419e9[_0x267a('0x4b')]=_0x1419e9[_0x267a('0x4b')][_0x267a('0x4d')]?_0x1419e9['attributes']:_0x2d11d1[_0x267a('0x4a')];if(_0x5076fd[_0x267a('0x47')]['includeAll']){_0x1419e9[_0x267a('0x57')]=[{'all':!![]}];}_0x1419e9=_[_0x267a('0x55')]({},_0x1419e9,_0x5076fd[_0x267a('0x5d')]);return db['OpenchannelAccount'][_0x267a('0x5e')](_0x1419e9)[_0x267a('0x3a')](handleEntityNotFound(_0xb3909a,null))[_0x267a('0x3a')](respondWithResult(_0xb3909a,null))[_0x267a('0x5f')](handleError(_0xb3909a,null));};exports[_0x267a('0x60')]=function(_0x5cd3e4,_0x509b6d){return db[_0x267a('0x42')][_0x267a('0x60')](_0x5cd3e4[_0x267a('0x61')],{})[_0x267a('0x3a')](function(_0xb81475){var _0x32e36a=_0x5cd3e4[_0x267a('0x62')][_0x267a('0x3b')]({'plain':!![]});if(!_0x32e36a)throw new Error(_0x267a('0x63'));if(_0x32e36a[_0x267a('0x64')]===_0x267a('0x62')){var _0x37f048=_0xb81475[_0x267a('0x3b')]({'plain':!![]});var _0x586cfb='OpenchannelAccounts';return db[_0x267a('0x65')][_0x267a('0x5e')]({'where':{'name':_0x586cfb,'userProfileId':_0x32e36a[_0x267a('0x66')]},'raw':!![]})[_0x267a('0x3a')](function(_0x5ad647){if(_0x5ad647&&_0x5ad647[_0x267a('0x67')]===0x0){return db[_0x267a('0x3d')][_0x267a('0x60')]({'name':_0x37f048[_0x267a('0x3e')],'resourceId':_0x37f048['id'],'type':_0x5ad647[_0x267a('0x3e')],'sectionId':_0x5ad647['id']},{})[_0x267a('0x3a')](function(){return _0xb81475;});}else{return _0xb81475;}})[_0x267a('0x5f')](function(_0x473de1){logger[_0x267a('0x27')](_0x267a('0x68'),_0x473de1);throw _0x473de1;});}return _0xb81475;})[_0x267a('0x3a')](respondWithResult(_0x509b6d,0xc9))[_0x267a('0x5f')](handleError(_0x509b6d,null));};exports[_0x267a('0x38')]=function(_0x4044fa,_0x8fde7c){if(_0x4044fa[_0x267a('0x61')]['id']){delete _0x4044fa[_0x267a('0x61')]['id'];}return db[_0x267a('0x42')][_0x267a('0x5e')]({'where':{'id':_0x4044fa[_0x267a('0x5a')]['id']},'include':[{'model':db[_0x267a('0x40')],'as':_0x267a('0x5b')}]})['then'](handleEntityNotFound(_0x8fde7c,null))[_0x267a('0x3a')](saveUpdates(_0x4044fa[_0x267a('0x61')],null))[_0x267a('0x3a')](respondWithResult(_0x8fde7c,null))['catch'](handleError(_0x8fde7c,null));};exports[_0x267a('0x39')]=function(_0x26de3a,_0x455259){return db[_0x267a('0x42')][_0x267a('0x5e')]({'where':{'id':_0x26de3a['params']['id']}})['then'](handleEntityNotFound(_0x455259,null))[_0x267a('0x3a')](removeEntity(_0x455259,null))[_0x267a('0x5f')](handleError(_0x455259,null));};exports['describe']=function(_0x333e90,_0x23e9ca){return db['OpenchannelAccount']['describe']()[_0x267a('0x3a')](respondWithResult(_0x23e9ca,null))['catch'](handleError(_0x23e9ca,null));};exports[_0x267a('0x69')]=function(_0x3e4f22,_0x3959fa,_0xd3b7ed){if(_0x3e4f22['body']['id']){delete _0x3e4f22[_0x267a('0x61')]['id'];}return db['OpenchannelAccount'][_0x267a('0x5e')]({'where':{'id':_0x3e4f22[_0x267a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3959fa,null))[_0x267a('0x3a')](function(_0x4b0771){if(_0x4b0771){_0x3e4f22[_0x267a('0x61')][_0x267a('0x6a')]=_0x4b0771['id'];return db[_0x267a('0x6b')][_0x267a('0x60')](_0x3e4f22[_0x267a('0x61')]);}})['then'](respondWithResult(_0x3959fa,null))['catch'](handleError(_0x3959fa,null));};exports[_0x267a('0x6c')]=function(_0x4e494b,_0x5ca9bd,_0x77a5b4){var _0x1a9905={'raw':![],'where':{}};var _0x1cd65c={};var _0x55b942={'count':0x0,'rows':[]};return db[_0x267a('0x42')][_0x267a('0x6d')]({'where':{'id':_0x4e494b[_0x267a('0x5a')]['id']}})[_0x267a('0x3a')](handleEntityNotFound(_0x5ca9bd,null))['then'](function(_0x4f5bec){if(_0x4f5bec){_0x1cd65c[_0x267a('0x4a')]=_[_0x267a('0x5c')](db[_0x267a('0x6b')][_0x267a('0x43')]);_0x1cd65c['query']=_[_0x267a('0x5c')](_0x4e494b[_0x267a('0x47')]);_0x1cd65c[_0x267a('0x48')]=_[_0x267a('0x49')](_0x1cd65c['model'],_0x1cd65c[_0x267a('0x47')]);_0x1a9905[_0x267a('0x4b')]=_[_0x267a('0x49')](_0x1cd65c[_0x267a('0x4a')],qs[_0x267a('0x4c')](_0x4e494b[_0x267a('0x47')][_0x267a('0x4c')]));_0x1a9905[_0x267a('0x4b')]=_0x1a9905[_0x267a('0x4b')][_0x267a('0x4d')]?_0x1a9905[_0x267a('0x4b')]:_0x1cd65c[_0x267a('0x4a')];if(!_0x4e494b['query']['hasOwnProperty'](_0x267a('0x4f'))){_0x1a9905[_0x267a('0x31')]=qs[_0x267a('0x31')](_0x4e494b[_0x267a('0x47')][_0x267a('0x31')]);_0x1a9905[_0x267a('0x2f')]=qs[_0x267a('0x2f')](_0x4e494b[_0x267a('0x47')]['offset']);}_0x1a9905['order']=qs['sort'](_0x4e494b[_0x267a('0x47')][_0x267a('0x51')]);_0x1a9905[_0x267a('0x52')]=qs[_0x267a('0x48')](_['pick'](_0x4e494b['query'],_0x1cd65c[_0x267a('0x48')]));_0x1a9905[_0x267a('0x52')][_0x267a('0x6a')]=_0x4f5bec['id'];if(_0x4e494b['query']['filter']){_0x1a9905[_0x267a('0x52')]=_['merge'](_0x1a9905[_0x267a('0x52')],{'$or':_[_0x267a('0x41')](_0x1a9905[_0x267a('0x4b')],function(_0x36995c){var _0x5deed3={};_0x5deed3[_0x36995c]={'$like':'%'+_0x4e494b[_0x267a('0x47')][_0x267a('0x54')]+'%'};return _0x5deed3;})});}_0x1a9905=_['merge']({},_0x1a9905,_0x4e494b['options']);return db[_0x267a('0x6b')][_0x267a('0x32')]({'where':_0x1a9905[_0x267a('0x52')]})[_0x267a('0x3a')](function(_0x23547a){_0x55b942[_0x267a('0x32')]=_0x23547a;if(_0x4e494b[_0x267a('0x47')][_0x267a('0x56')]){_0x1a9905[_0x267a('0x57')]=[{'all':!![]}];}return db[_0x267a('0x6b')][_0x267a('0x6e')](_0x1a9905);})[_0x267a('0x3a')](function(_0x4b25af){_0x55b942[_0x267a('0x58')]=_0x4b25af;return _0x55b942;});}})['then'](respondWithFilteredResult(_0x5ca9bd,_0x1a9905))[_0x267a('0x5f')](handleError(_0x5ca9bd,null));};exports[_0x267a('0x6f')]=function(_0xfb3de,_0x348d65,_0x4208db){return db['OpenchannelAccount'][_0x267a('0x5e')]({'where':{'id':_0xfb3de[_0x267a('0x5a')]['id']}})[_0x267a('0x3a')](handleEntityNotFound(_0x348d65,null))[_0x267a('0x3a')](function(_0x440785){if(_0x440785){return _0x440785['removeDispositions'](_0xfb3de[_0x267a('0x47')][_0x267a('0x70')]);}})[_0x267a('0x3a')](respondWithStatusCode(_0x348d65,null))['catch'](handleError(_0x348d65,null));};exports[_0x267a('0x71')]=function(_0x5caad7,_0x4dcd02,_0x47c938){if(_0x5caad7['body']['id']){delete _0x5caad7[_0x267a('0x61')]['id'];}return db[_0x267a('0x42')][_0x267a('0x5e')]({'where':{'id':_0x5caad7[_0x267a('0x5a')]['id']}})[_0x267a('0x3a')](handleEntityNotFound(_0x4dcd02,null))[_0x267a('0x3a')](function(_0x5f1475){if(_0x5f1475){_0x5caad7[_0x267a('0x61')][_0x267a('0x6a')]=_0x5f1475['id'];return db[_0x267a('0x72')]['create'](_0x5caad7[_0x267a('0x61')]);}})['then'](respondWithResult(_0x4dcd02,null))[_0x267a('0x5f')](handleError(_0x4dcd02,null));};exports[_0x267a('0x73')]=function(_0x514924,_0x229929,_0x298503){var _0x51c1d1={'raw':![],'where':{}};var _0x560d00={};var _0x48158c={'count':0x0,'rows':[]};return db[_0x267a('0x42')][_0x267a('0x6d')]({'where':{'id':_0x514924[_0x267a('0x5a')]['id']}})['then'](handleEntityNotFound(_0x229929,null))['then'](function(_0x38da82){if(_0x38da82){_0x560d00[_0x267a('0x4a')]=_[_0x267a('0x5c')](db[_0x267a('0x72')]['rawAttributes']);_0x560d00[_0x267a('0x47')]=_[_0x267a('0x5c')](_0x514924[_0x267a('0x47')]);_0x560d00['filters']=_['intersection'](_0x560d00['model'],_0x560d00[_0x267a('0x47')]);_0x51c1d1['attributes']=_[_0x267a('0x49')](_0x560d00[_0x267a('0x4a')],qs['fields'](_0x514924[_0x267a('0x47')][_0x267a('0x4c')]));_0x51c1d1['attributes']=_0x51c1d1['attributes']['length']?_0x51c1d1[_0x267a('0x4b')]:_0x560d00[_0x267a('0x4a')];if(!_0x514924[_0x267a('0x47')]['hasOwnProperty'](_0x267a('0x4f'))){_0x51c1d1['limit']=qs[_0x267a('0x31')](_0x514924[_0x267a('0x47')]['limit']);_0x51c1d1[_0x267a('0x2f')]=qs[_0x267a('0x2f')](_0x514924[_0x267a('0x47')][_0x267a('0x2f')]);}_0x51c1d1[_0x267a('0x50')]=qs['sort'](_0x514924[_0x267a('0x47')][_0x267a('0x51')]);_0x51c1d1[_0x267a('0x52')]=qs[_0x267a('0x48')](_['pick'](_0x514924[_0x267a('0x47')],_0x560d00[_0x267a('0x48')]));_0x51c1d1[_0x267a('0x52')][_0x267a('0x6a')]=_0x38da82['id'];if(_0x514924[_0x267a('0x47')]['filter']){_0x51c1d1['where']=_['merge'](_0x51c1d1[_0x267a('0x52')],{'$or':_[_0x267a('0x41')](_0x51c1d1['attributes'],function(_0x3d70cc){var _0xec28b3={};_0xec28b3[_0x3d70cc]={'$like':'%'+_0x514924[_0x267a('0x47')][_0x267a('0x54')]+'%'};return _0xec28b3;})});}_0x51c1d1=_[_0x267a('0x55')]({},_0x51c1d1,_0x514924['options']);return db[_0x267a('0x72')][_0x267a('0x32')]({'where':_0x51c1d1[_0x267a('0x52')]})['then'](function(_0x67ed83){_0x48158c[_0x267a('0x32')]=_0x67ed83;if(_0x514924[_0x267a('0x47')][_0x267a('0x56')]){_0x51c1d1['include']=[{'all':!![]}];}return db[_0x267a('0x72')]['findAll'](_0x51c1d1);})[_0x267a('0x3a')](function(_0xb16b75){_0x48158c[_0x267a('0x58')]=_0xb16b75;return _0x48158c;});}})[_0x267a('0x3a')](respondWithFilteredResult(_0x229929,_0x51c1d1))[_0x267a('0x5f')](handleError(_0x229929,null));};exports['removeAnswers']=function(_0x595d95,_0x5de172,_0x52556b){return db[_0x267a('0x42')][_0x267a('0x5e')]({'where':{'id':_0x595d95[_0x267a('0x5a')]['id']}})[_0x267a('0x3a')](handleEntityNotFound(_0x5de172,null))['then'](function(_0x52ea0a){if(_0x52ea0a){return _0x52ea0a[_0x267a('0x74')](_0x595d95['query'][_0x267a('0x70')]);}})[_0x267a('0x3a')](respondWithStatusCode(_0x5de172,null))[_0x267a('0x5f')](handleError(_0x5de172,null));};exports[_0x267a('0x75')]=function(_0x36c4f3,_0x594e30,_0x20eed3){var _0x1b1d32={'body':_0x36c4f3['body'],'channel':_0x267a('0x76')};var _0x47e837=[];var _0x11b5e7=[];var _0x1faefa={};var _0x5eacba=![];return db[_0x267a('0x77')]['describe']()[_0x267a('0x3a')](function(_0x411677){if(!_0x411677){throw new db[(_0x267a('0x78'))][(_0x267a('0x79'))]('no\x20available\x20attributes');}_0x47e837=_[_0x267a('0x7a')](_[_0x267a('0x5c')](_0x411677),[_0x267a('0x7b'),_0x267a('0x7c')]);_0x11b5e7=_[_0x267a('0x7a')](_['keys'](_0x411677),[_0x267a('0x7b'),_0x267a('0x7c'),'CompanyId',_0x267a('0x7d')]);if(_0x36c4f3[_0x267a('0x61')]['id']){delete _0x36c4f3[_0x267a('0x61')]['id'];}if(_[_0x267a('0x7e')](_0x36c4f3['body']['from'])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x36c4f3[_0x267a('0x61')][_0x267a('0x61')])||_0x36c4f3[_0x267a('0x61')][_0x267a('0x61')]===''){throw new db[(_0x267a('0x78'))][(_0x267a('0x79'))](_0x267a('0x7f'));}if(_[_0x267a('0x7e')](_0x36c4f3[_0x267a('0x61')]['mapKey'])){throw new db[(_0x267a('0x78'))]['ValidationError'](_0x267a('0x80')+_0x11b5e7);}if(!_[_0x267a('0x81')](_0x11b5e7,_0x36c4f3[_0x267a('0x61')][_0x267a('0x82')])){throw new db[(_0x267a('0x78'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x11b5e7);}_0x1faefa[_0x36c4f3[_0x267a('0x61')]['mapKey']]=_0x36c4f3[_0x267a('0x61')][_0x267a('0x83')];})['then'](function(){return db[_0x267a('0x42')][_0x267a('0x5e')]({'where':{'id':_0x36c4f3[_0x267a('0x5a')]['id']},'include':[{'model':db['CmList'],'as':_0x267a('0x84'),'include':[{'model':db[_0x267a('0x77')],'as':_0x267a('0x85'),'where':_0x1faefa,'limit':0x1,'order':[[_0x267a('0x7c'),_0x267a('0x86')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0x267a('0x3a')](handleEntityNotFound(_0x594e30,null))[_0x267a('0x3a')](function(_0x2e98d5){if(_0x2e98d5&&_0x2e98d5[_0x267a('0x84')]){_0x1b1d32[_0x267a('0x87')]=_0x2e98d5;_0x1b1d32['applications']=_0x2e98d5[_0x267a('0x88')];_0x1b1d32[_0x267a('0x89')]=_0x2e98d5[_0x267a('0x84')];_0x1b1d32['applications']=_['orderBy'](_0x1b1d32[_0x267a('0x8a')],[_0x267a('0x8b')],[_0x267a('0x8c')]);if(_0x1b1d32[_0x267a('0x87')]['Applications']){delete _0x1b1d32['account'][_0x267a('0x88')];}if(_0x1b1d32[_0x267a('0x87')][_0x267a('0x84')]&&_0x1b1d32['account']['List']['Contacts']['length']){return _0x1b1d32[_0x267a('0x87')][_0x267a('0x84')][_0x267a('0x85')][0x0];}var _0x3fb5aa=_[_0x267a('0x1c')](_0x36c4f3[_0x267a('0x61')],{'firstName':_0x36c4f3[_0x267a('0x61')][_0x267a('0x83')],'ListId':_0x2e98d5[_0x267a('0x7d')]});_0x3fb5aa[_0x36c4f3[_0x267a('0x61')][_0x267a('0x82')]]=_0x36c4f3[_0x267a('0x61')][_0x267a('0x83')];return db[_0x267a('0x77')][_0x267a('0x60')](_0x3fb5aa,{'fields':_0x47e837,'raw':!![]});}})[_0x267a('0x3a')](handleEntityNotFound(_0x594e30,null))[_0x267a('0x3a')](function(_0xe57e20){_0x1b1d32[_0x267a('0x8d')]=_0xe57e20;if(_0xe57e20){var _0x26d653={'ContactId':_0xe57e20['id'],'OpenchannelAccountId':_0x36c4f3[_0x267a('0x5a')]['id'],'from':(_0xe57e20[_0x267a('0x8e')]||'')+'\x20'+(_0xe57e20['lastName']||'')};var _0x189214={'OpenchannelAccountId':_0x36c4f3[_0x267a('0x5a')]['id'],'closed':![]};if(_0x36c4f3['body'][_0x267a('0x8f')]){_0x189214['threadId']=_0x36c4f3['body'][_0x267a('0x8f')];return db[_0x267a('0x90')][_0x267a('0x5e')]({'where':_0x189214})[_0x267a('0x3a')](function(_0x1730ed){if(_0x1730ed){return[_0x1730ed,![]];}_0x26d653[_0x267a('0x8f')]=_0x36c4f3[_0x267a('0x61')][_0x267a('0x8f')];_0x26d653['externalUrl']=_0x36c4f3[_0x267a('0x61')]['externalUrl'];return db[_0x267a('0x90')][_0x267a('0x60')](_0x26d653)['then'](function(_0x39e81b){return[_0x39e81b,!![]];});});}else{_0x189214['threadId']=null;}_0x189214['ContactId']=_0xe57e20['id'];return db['OpenchannelInteraction']['find']({'where':_0x189214})[_0x267a('0x3a')](function(_0x56bc2d){if(_0x56bc2d){return[_0x56bc2d,![]];}return db[_0x267a('0x90')][_0x267a('0x60')](_0x26d653)[_0x267a('0x3a')](function(_0x4d2aec){return[_0x4d2aec,!![]];});});}})['spread'](function(_0x687453,_0x47e263){if(_0x687453){_0x5eacba=_0x47e263;if(!_0x47e263){var _0x2795ab={'from':(_0x1b1d32[_0x267a('0x8d')][_0x267a('0x8e')]||'')+'\x20'+(_0x1b1d32[_0x267a('0x8d')][_0x267a('0x91')]||'')};if(_0x36c4f3[_0x267a('0x61')][_0x267a('0x8f')]&&_0x36c4f3[_0x267a('0x61')]['messageId']&&_0x36c4f3[_0x267a('0x61')]['threadId']!=_0x36c4f3['body'][_0x267a('0x92')]){_0x2795ab[_0x267a('0x8f')]=_0x36c4f3[_0x267a('0x61')][_0x267a('0x92')];}return _0x687453[_0x267a('0x38')](_0x2795ab);}else{return _0x687453;}}})['then'](function(_0xf94e3e){_0x1b1d32['interaction']=_0xf94e3e['get']({'plain':!![]});_0x1b1d32[_0x267a('0x93')][_0x267a('0x94')]=_0x5eacba;if(_0x1b1d32[_0x267a('0x93')][_0x267a('0x94')]){if(_0x1b1d32[_0x267a('0x87')]['autoclose']){_0x1b1d32[_0x267a('0x8a')][_0x267a('0x95')]({'id':0x0,'priority':_0x1b1d32[_0x267a('0x8a')]['length']+0x1,'app':_0x267a('0x96'),'appdata':_0x267a('0x97'),'interval':_0x267a('0x98')});}}return db['OpenchannelMessage']['create']({'body':_0x36c4f3['body']['body'],'OpenchannelAccountId':_0x36c4f3[_0x267a('0x5a')]['id'],'OpenchannelInteractionId':_0xf94e3e['id'],'direction':'in','ContactId':_0x1b1d32[_0x267a('0x8d')]['id'],'AttachmentId':_0x36c4f3['body'][_0x267a('0x99')]});})[_0x267a('0x3a')](function(_0xae9e00){_0x1b1d32[_0x267a('0x28')]=_0xae9e00;if(_0x1b1d32['interaction']['UserId']){return db['User'][_0x267a('0x5e')]({'attributes':['id','name'],'where':{'id':_0x1b1d32['interaction'][_0x267a('0x9a')]}})['then'](function(_0x296890){if(_0x296890){_0x1b1d32[_0x267a('0x8a')][_0x267a('0x9b')]({'id':0x0,'priority':0x0,'app':_0x267a('0x9c'),'appdata':_0x296890[_0x267a('0x3e')]+','+(_0x1b1d32[_0x267a('0x87')][_0x267a('0x9d')]||0xa),'interval':_0x267a('0x98')});_0x1b1d32['forcedOwnership']=![];}return respondWithRpcPromise(_0x267a('0x9e'),'startRouting',_0x1b1d32);});}return respondWithRpcPromise('Start',_0x267a('0x9f'),_0x1b1d32);})['then'](function(_0x56d409){respondWithRpcPromise(_0x267a('0xa0'),_0x267a('0xa0'),{'event':_0x267a('0x75'),'message':_0x56d409},client9002);return _0x56d409;})[_0x267a('0x3a')](respondWithResult(_0x594e30,null))[_0x267a('0x5f')](handleError(_0x594e30,null));};exports[_0x267a('0xa1')]=function(_0x595d8f,_0x523aec){var _0x148261=_0x595d8f[_0x267a('0x5a')]['id'];var _0x5171e3=_0x595d8f['body'];var _0x1ce859=0xc8;var _0x2b6bed=null;return db[_0x267a('0xa2')][_0x267a('0xa3')]({'isolationLevel':db[_0x267a('0xa2')]['Transaction'][_0x267a('0xa4')]['READ_COMMITTED']},function(_0x1c3afa){return db['OpenchannelAccount'][_0x267a('0x6d')]({'where':{'id':_0x148261},'transaction':_0x1c3afa})[_0x267a('0x3a')](function(_0x1e07ce){if(_0x1e07ce){return db[_0x267a('0xa5')][_0x267a('0x39')]({'where':{'OpenchannelAccountId':_0x148261},'transaction':_0x1c3afa})[_0x267a('0x3a')](function(){var _0xf7d30c=_[_0x267a('0x41')](_0x5171e3,function(_0x5acff9){_0x5acff9['OpenchannelAccountId']=_0x148261;return _0x5acff9;});return db[_0x267a('0xa5')][_0x267a('0xa6')](_0xf7d30c,{'transaction':_0x1c3afa});});}else{_0x1ce859=0x194;_0x2b6bed=[];}});})[_0x267a('0x3a')](function(){if(_0x1ce859!==0x194){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x148261},'order':'priority'})[_0x267a('0x3a')](function(_0x40a6e1){_0x2b6bed=_0x40a6e1;});}})['catch'](function(_0x40a599){_0x1ce859=0x1f4;logger['error'](_0x40a599['stack']);if(_0x40a599[_0x267a('0x3e')]){delete _0x40a599[_0x267a('0x3e')];}_0x2b6bed=_0x40a599;})['finally'](function(){if(_0x2b6bed===null){_0x523aec[_0x267a('0x2b')](_0x1ce859);}else{if(_0x1ce859===0x1f4){_0x523aec[_0x267a('0x2c')](_0x1ce859)['send'](_0x2b6bed);}else{_0x523aec['status'](_0x1ce859)['json'](_0x2b6bed);}}});};exports['getApplications']=function(_0x57a468,_0xa3141e,_0x10b6b1){var _0x18338a={};var _0x4eff98={};var _0x2c8736;var _0x33c849;return db[_0x267a('0x42')][_0x267a('0x6d')]({'where':{'id':_0x57a468[_0x267a('0x5a')]['id']}})['then'](handleEntityNotFound(_0xa3141e,null))[_0x267a('0x3a')](function(_0x23e190){if(_0x23e190){_0x2c8736=_0x23e190;_0x4eff98[_0x267a('0x4a')]=_[_0x267a('0x5c')](db[_0x267a('0xa5')][_0x267a('0x43')]);_0x4eff98[_0x267a('0x47')]=_[_0x267a('0x5c')](_0x57a468[_0x267a('0x47')]);_0x4eff98[_0x267a('0x48')]=_[_0x267a('0x49')](_0x4eff98[_0x267a('0x4a')],_0x4eff98[_0x267a('0x47')]);_0x18338a[_0x267a('0x4b')]=_['intersection'](_0x4eff98[_0x267a('0x4a')],qs[_0x267a('0x4c')](_0x57a468[_0x267a('0x47')][_0x267a('0x4c')]));_0x18338a[_0x267a('0x4b')]=_0x18338a[_0x267a('0x4b')][_0x267a('0x4d')]?_0x18338a[_0x267a('0x4b')]:_0x4eff98['model'];_0x18338a[_0x267a('0x50')]=qs[_0x267a('0x51')](_0x57a468['query']['sort']);_0x18338a[_0x267a('0x52')]=qs[_0x267a('0x48')](_['pick'](_0x57a468[_0x267a('0x47')],_0x4eff98['filters']));if(_0x57a468[_0x267a('0x47')]['filter']){_0x18338a[_0x267a('0x52')]=_[_0x267a('0x55')](_0x18338a[_0x267a('0x52')],{'$or':_[_0x267a('0x41')](_0x18338a[_0x267a('0x4b')],function(_0x115a18){var _0x531de9={};_0x531de9[_0x115a18]={'$like':'%'+_0x57a468['query'][_0x267a('0x54')]+'%'};return _0x531de9;})});}_0x18338a=_[_0x267a('0x55')]({},_0x18338a,_0x57a468[_0x267a('0x5d')]);return _0x2c8736[_0x267a('0xa7')](_0x18338a);}})[_0x267a('0x3a')](function(_0x2384ce){if(_0x2384ce){_0x33c849=_0x2384ce[_0x267a('0x4d')];if(!_0x57a468[_0x267a('0x47')][_0x267a('0x4e')](_0x267a('0x4f'))){_0x18338a['limit']=qs[_0x267a('0x31')](_0x57a468[_0x267a('0x47')][_0x267a('0x31')]);_0x18338a[_0x267a('0x2f')]=qs[_0x267a('0x2f')](_0x57a468['query'][_0x267a('0x2f')]);}return _0x2c8736[_0x267a('0xa7')](_0x18338a);}})[_0x267a('0x3a')](function(_0x190375){if(_0x190375){return _0x190375?{'count':_0x33c849,'rows':_0x190375}:null;}})[_0x267a('0x3a')](respondWithResult(_0xa3141e,null))[_0x267a('0x5f')](handleError(_0xa3141e,null));};exports[_0x267a('0xa8')]=function(_0x387a35,_0x58fe17,_0x567a53){var _0x65e507={'raw':![],'where':{}};var _0x3f33fd={};var _0x632d80={'count':0x0,'rows':[]};return db[_0x267a('0x42')][_0x267a('0x6d')]({'where':{'id':_0x387a35[_0x267a('0x5a')]['id']}})[_0x267a('0x3a')](handleEntityNotFound(_0x58fe17,null))['then'](function(_0x4dc52c){if(_0x4dc52c){_0x3f33fd[_0x267a('0x4a')]=_[_0x267a('0x5c')](db[_0x267a('0x90')][_0x267a('0x43')]);_0x3f33fd['query']=_['keys'](_0x387a35[_0x267a('0x47')]);_0x3f33fd['filters']=_[_0x267a('0x49')](_0x3f33fd['model'],_0x3f33fd[_0x267a('0x47')]);_0x65e507[_0x267a('0x4b')]=_[_0x267a('0x49')](_0x3f33fd[_0x267a('0x4a')],qs[_0x267a('0x4c')](_0x387a35[_0x267a('0x47')][_0x267a('0x4c')]));_0x65e507[_0x267a('0x4b')]=_0x65e507[_0x267a('0x4b')][_0x267a('0x4d')]?_0x65e507['attributes']:_0x3f33fd[_0x267a('0x4a')];if(!_0x387a35[_0x267a('0x47')][_0x267a('0x4e')](_0x267a('0x4f'))){_0x65e507[_0x267a('0x31')]=qs[_0x267a('0x31')](_0x387a35[_0x267a('0x47')]['limit']);_0x65e507[_0x267a('0x2f')]=qs[_0x267a('0x2f')](_0x387a35[_0x267a('0x47')][_0x267a('0x2f')]);}_0x65e507['order']=qs[_0x267a('0x51')](_0x387a35[_0x267a('0x47')][_0x267a('0x51')]);_0x65e507[_0x267a('0x52')]=qs[_0x267a('0x48')](_['pick'](_0x387a35[_0x267a('0x47')],_0x3f33fd['filters']));_0x65e507['where'][_0x267a('0x6a')]=_0x4dc52c['id'];if(_0x387a35[_0x267a('0x47')][_0x267a('0x54')]){_0x65e507['where']=_['merge'](_0x65e507[_0x267a('0x52')],{'$or':_[_0x267a('0x41')](_0x65e507[_0x267a('0x4b')],function(_0x4ed2ab){var _0x390b7a={};_0x390b7a[_0x4ed2ab]={'$like':'%'+_0x387a35[_0x267a('0x47')][_0x267a('0x54')]+'%'};return _0x390b7a;})});}_0x65e507=_[_0x267a('0x55')]({},_0x65e507,_0x387a35[_0x267a('0x5d')]);return db['OpenchannelInteraction'][_0x267a('0x32')]({'where':_0x65e507['where']})[_0x267a('0x3a')](function(_0x1541c6){_0x632d80[_0x267a('0x32')]=_0x1541c6;if(_0x387a35['query'][_0x267a('0x56')]){_0x65e507[_0x267a('0x57')]=[{'model':db[_0x267a('0x77')],'as':_0x267a('0xa9'),'required':![]},{'model':db[_0x267a('0xaa')],'as':_0x267a('0xab'),'attributes':[_0x267a('0x3e'),_0x267a('0xac'),'internal'],'required':![]},{'model':db[_0x267a('0xad')],'as':'Tags','attributes':['id',_0x267a('0x3e'),_0x267a('0xae')],'where':_0x387a35[_0x267a('0x47')][_0x267a('0xaf')]?{'id':_0x387a35[_0x267a('0x47')]['tag']}:undefined,'required':_0x387a35['query'][_0x267a('0xaf')]?!![]:![]}];}return db[_0x267a('0x90')][_0x267a('0x6e')](_0x65e507);})[_0x267a('0x3a')](function(_0x19b246){_0x632d80[_0x267a('0x58')]=_0x19b246;return _0x632d80;});}})[_0x267a('0x3a')](respondWithFilteredResult(_0x58fe17,_0x65e507))[_0x267a('0x5f')](handleError(_0x58fe17,null));};exports['addAgents']=function(_0x146680,_0x18d516,_0x48d832){return db['OpenchannelAccount']['find']({'where':{'id':_0x146680['params']['id']}})[_0x267a('0x3a')](handleEntityNotFound(_0x18d516,null))[_0x267a('0x3a')](function(_0x488eaa){if(_0x488eaa){return _0x488eaa[_0x267a('0xb0')](_0x146680['body'][_0x267a('0x70')],_['omit'](_0x146680[_0x267a('0x61')],[_0x267a('0x70'),'id'])||{})[_0x267a('0xb1')](function(_0x1e5931){for(var _0x1781d1=0x0;_0x1781d1<_0x146680[_0x267a('0x61')]['ids'][_0x267a('0x4d')];_0x1781d1+=0x1){socket[_0x267a('0xb2')](_0x267a('0xb3'),{'UserId':Number(_0x146680[_0x267a('0x61')][_0x267a('0x70')][_0x1781d1]),'OpenchannelAccountId':Number(_0x146680[_0x267a('0x5a')]['id'])});}return _0x1e5931;});}})[_0x267a('0x3a')](respondWithResult(_0x18d516,null))[_0x267a('0x5f')](handleError(_0x18d516,null));};exports[_0x267a('0xb4')]=function(_0x25f1d0,_0x596509,_0x5bd08a){return db[_0x267a('0x42')][_0x267a('0x5e')]({'where':{'id':_0x25f1d0[_0x267a('0x5a')]['id']}})[_0x267a('0x3a')](handleEntityNotFound(_0x596509,null))[_0x267a('0x3a')](function(_0x29cb5e){if(_0x29cb5e){return _0x29cb5e[_0x267a('0xb4')](_0x25f1d0[_0x267a('0x47')][_0x267a('0x70')])[_0x267a('0x3a')](function(){if(_[_0x267a('0xb5')](_0x25f1d0[_0x267a('0x47')][_0x267a('0x70')])){for(var _0x36dc62=0x0;_0x36dc62<_0x25f1d0['query'][_0x267a('0x70')][_0x267a('0x4d')];_0x36dc62+=0x1){socket['emit'](_0x267a('0xb6'),{'UserId':Number(_0x25f1d0[_0x267a('0x47')][_0x267a('0x70')][_0x36dc62]),'OpenchannelAccountId':Number(_0x25f1d0[_0x267a('0x5a')]['id'])});}}else{socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x25f1d0[_0x267a('0x47')][_0x267a('0x70')]),'OpenchannelAccountId':Number(_0x25f1d0[_0x267a('0x5a')]['id'])});}});}})[_0x267a('0x3a')](respondWithStatusCode(_0x596509,null))['catch'](handleError(_0x596509,null));};exports[_0x267a('0xb7')]=function(_0x30085f,_0x4188e4,_0x3cdbf6){var _0x591a7b={};var _0x420b2c={};var _0x2c18ce;var _0x52bf86;return db[_0x267a('0x42')][_0x267a('0x6d')]({'where':{'id':_0x30085f[_0x267a('0x5a')]['id']}})[_0x267a('0x3a')](handleEntityNotFound(_0x4188e4,null))['then'](function(_0x49a2b4){if(_0x49a2b4){_0x2c18ce=_0x49a2b4;_0x420b2c[_0x267a('0x4a')]=_[_0x267a('0x5c')](db['User']['rawAttributes']);_0x420b2c[_0x267a('0x47')]=_[_0x267a('0x5c')](_0x30085f[_0x267a('0x47')]);_0x420b2c[_0x267a('0x48')]=_[_0x267a('0x49')](_0x420b2c[_0x267a('0x4a')],_0x420b2c[_0x267a('0x47')]);_0x591a7b[_0x267a('0x4b')]=_['intersection'](_0x420b2c[_0x267a('0x4a')],qs['fields'](_0x30085f[_0x267a('0x47')]['fields']));_0x591a7b['attributes']=_0x591a7b[_0x267a('0x4b')]['length']?_0x591a7b['attributes']:_0x420b2c[_0x267a('0x4a')];_0x591a7b['order']=qs[_0x267a('0x51')](_0x30085f[_0x267a('0x47')][_0x267a('0x51')]);_0x591a7b[_0x267a('0x52')]=qs[_0x267a('0x48')](_[_0x267a('0x53')](_0x30085f[_0x267a('0x47')],_0x420b2c[_0x267a('0x48')]));if(_0x30085f[_0x267a('0x47')][_0x267a('0x54')]){_0x591a7b['where']=_[_0x267a('0x55')](_0x591a7b['where'],{'$or':_[_0x267a('0x41')](_0x591a7b['attributes'],function(_0x5273ad){var _0xf4ec26={};_0xf4ec26[_0x5273ad]={'$like':'%'+_0x30085f[_0x267a('0x47')][_0x267a('0x54')]+'%'};return _0xf4ec26;})});}_0x591a7b=_[_0x267a('0x55')]({},_0x591a7b,_0x30085f[_0x267a('0x5d')]);return _0x2c18ce[_0x267a('0xb7')](_0x591a7b);}})[_0x267a('0x3a')](function(_0x51b7cb){if(_0x51b7cb){_0x52bf86=_0x51b7cb['length'];if(!_0x30085f['query'][_0x267a('0x4e')](_0x267a('0x4f'))){_0x591a7b[_0x267a('0x31')]=qs['limit'](_0x30085f[_0x267a('0x47')][_0x267a('0x31')]);_0x591a7b[_0x267a('0x2f')]=qs[_0x267a('0x2f')](_0x30085f['query']['offset']);}return _0x2c18ce[_0x267a('0xb7')](_0x591a7b);}})['then'](function(_0x1291ad){if(_0x1291ad){return _0x1291ad?{'count':_0x52bf86,'rows':_0x1291ad}:null;}})[_0x267a('0x3a')](respondWithResult(_0x4188e4,null))[_0x267a('0x5f')](handleError(_0x4188e4,null));};exports[_0x267a('0x3f')]=function(_0x30383c,_0xb2e50e,_0x393489){var _0x532f35,_0x2788ad,_0x33d7e2;if(_[_0x267a('0x7e')](_0x30383c['body'][_0x267a('0x61')])||_0x30383c['body']['body']===''){throw new db[(_0x267a('0x78'))]['ValidationError'](_0x267a('0x7f'));}if(_[_0x267a('0x7e')](_0x30383c[_0x267a('0x61')]['to'])){}_0x532f35=_0x30383c[_0x267a('0x61')]['to'];return db[_0x267a('0x42')][_0x267a('0x6d')]({'where':{'id':_0x30383c[_0x267a('0x5a')]['id']}})[_0x267a('0x3a')](handleEntityNotFound(_0xb2e50e,null))['then'](function(_0x113d18){if(_0x113d18){return db['OpenchannelAccount'][_0x267a('0x5e')]({'where':{'id':_0x113d18['id']},'include':[{'model':db[_0x267a('0xb8')],'as':'List','include':[{'model':db[_0x267a('0x77')],'as':_0x267a('0x85'),'where':{[_0x113d18[_0x267a('0x82')]]:_0x532f35},'limit':0x1,'order':[[_0x267a('0x7c'),'DESC']]}]}]})['then'](handleEntityNotFound(_0xb2e50e,null))['then'](function(_0x3b0051){if(_0x3b0051&&_0x3b0051[_0x267a('0x84')]){_0x2788ad=_0x3b0051[_0x267a('0x3b')]({'plain':!![]});if(_0x2788ad['List']&&_0x2788ad[_0x267a('0x84')][_0x267a('0x85')][_0x267a('0x4d')]){return _0x2788ad[_0x267a('0x84')][_0x267a('0x85')][0x0];}return db[_0x267a('0x77')][_0x267a('0x60')](_[_0x267a('0x1c')](_0x30383c['body'],{'firstName':_0x532f35,[_0x3b0051[_0x267a('0x82')]]:_0x532f35,'phone':_0x532f35,'ListId':_0x2788ad[_0x267a('0x7d')]}));}})[_0x267a('0x3a')](handleEntityNotFound(_0xb2e50e,null))[_0x267a('0x3a')](function(_0x533818){if(_0x533818){_0x33d7e2=_0x533818;return db[_0x267a('0x90')][_0x267a('0x5e')]({'where':{'ContactId':_0x33d7e2['id'],'closed':![],'OpenchannelAccountId':_0x2788ad['id']}})[_0x267a('0x3a')](function(_0x1430a3){if(_0x1430a3){return[_0x1430a3,![]];}return db[_0x267a('0x90')][_0x267a('0x60')]({'UserId':_0x30383c[_0x267a('0x62')]['id'],'ContactId':_0x33d7e2['id'],'OpenchannelAccountId':_0x2788ad['id'],'lastMsgDirection':'out','firstMsgDirection':_0x267a('0xb9'),'Messages':[_[_0x267a('0x55')](_0x30383c['body'],{'read':![],'body':_0x30383c[_0x267a('0x61')]['body'],'OpenchannelAccountId':_0x2788ad['id'],'UserId':_0x30383c[_0x267a('0x62')]['id'],'ContactId':_0x33d7e2['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})['then'](function(_0x234961){return[_0x234961,!![]];});});}})[_0x267a('0xb1')](function(_0x22df65,_0x16bd5e){if(_0x16bd5e){return _0x22df65;}return db['OpenchannelMessage'][_0x267a('0x60')](_[_0x267a('0x55')](_0x30383c[_0x267a('0x61')],{'read':![],'body':_0x30383c[_0x267a('0x61')][_0x267a('0x61')],'OpenchannelAccountId':_0x2788ad['id'],'OpenchannelInteractionId':_0x22df65['id'],'UserId':_0x30383c[_0x267a('0x62')]['id'],'ContactId':_0x33d7e2['id']}))[_0x267a('0x3a')](function(_0x4963ab){_0x22df65[_0x267a('0xba')][_0x267a('0xbb')]=[];_0x22df65[_0x267a('0xba')][_0x267a('0xbb')][_0x267a('0x95')](_0x4963ab[_0x267a('0xba')]);return _0x22df65;});});}})[_0x267a('0x3a')](respondWithResult(_0xb2e50e,null))[_0x267a('0x5f')](handleError(_0xb2e50e,null));};
\ No newline at end of file
+var _0x359a=['message','result','catch','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','get','OpenchannelAccounts','UserProfileResource','destroy','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','findOne','pick','options','removeDispositions','ids','addAnswer','OpenchannelAccountId','CannedAnswer','nolimit','removeAnswers','notify','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','account','applications','list','orderBy','asc','ListId','lastName','threadId','externalUrl','OpenchannelInteraction','spread','contact','firstName','messageId','interaction','created','push','close','OpenchannelMessage','User','agent','*,*,*,*','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getInteractions','Owner','fullname','Tag','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','client','request','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s'];(function(_0xd40b6b,_0x5005b9){var _0x4dba60=function(_0x3c1539){while(--_0x3c1539){_0xd40b6b['push'](_0xd40b6b['shift']());}};_0x4dba60(++_0x5005b9);}(_0x359a,0x153));var _0xa359=function(_0x1e2144,_0x154db6){_0x1e2144=_0x1e2144-0x0;var _0x5e2e2d=_0x359a[_0x1e2144];return _0x5e2e2d;};'use strict';var emlformat=require(_0xa359('0x0'));var rimraf=require(_0xa359('0x1'));var zipdir=require(_0xa359('0x2'));var jsonpatch=require(_0xa359('0x3'));var rp=require(_0xa359('0x4'));var moment=require('moment');var BPromise=require(_0xa359('0x5'));var Mustache=require(_0xa359('0x6'));var util=require(_0xa359('0x7'));var path=require(_0xa359('0x8'));var sox=require(_0xa359('0x9'));var csv=require(_0xa359('0xa'));var ejs=require(_0xa359('0xb'));var fs=require('fs');var fs_extra=require(_0xa359('0xc'));var _=require(_0xa359('0xd'));var squel=require(_0xa359('0xe'));var crypto=require('crypto');var jsforce=require(_0xa359('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa359('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa359('0x10'));var authService=require(_0xa359('0x11'));var qs=require(_0xa359('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa359('0x13'))(_0xa359('0x14'));var utils=require('../../config/utils');var config=require(_0xa359('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa359('0x16'))['db'];config['redis']=_[_0xa359('0x17')](config[_0xa359('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xa359('0x19'))(new Redis(config['redis']));require(_0xa359('0x1a'))[_0xa359('0x1b')](socket);var jayson=require(_0xa359('0x1c'));var client=jayson['client'][_0xa359('0x1d')]({'port':0x232c});var client9002=jayson[_0xa359('0x1e')][_0xa359('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2fe027,_0x39d69e,_0xb2745f,_0x51a49e){return new BPromise(function(_0x360e12,_0x59204c){var _0x21e5ea=_0x51a49e||client;return _0x21e5ea[_0xa359('0x1f')](_0x2fe027,_0xb2745f)['then'](function(_0x3ad082){logger[_0xa359('0x20')]('OpenchannelAccount,\x20%s,\x20%s',_0x39d69e,_0xa359('0x21'));logger[_0xa359('0x22')](_0xa359('0x23'),_0x39d69e,_0xa359('0x21'),JSON[_0xa359('0x24')](_0x3ad082));if(_0x3ad082[_0xa359('0x25')]){if(_0x3ad082['error']['code']===0x1f4){logger['error'](_0xa359('0x26'),_0x39d69e,_0x3ad082[_0xa359('0x25')][_0xa359('0x27')]);return _0x59204c(_0x3ad082[_0xa359('0x25')][_0xa359('0x27')]);}logger[_0xa359('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x39d69e,_0x3ad082[_0xa359('0x25')][_0xa359('0x27')]);return _0x360e12(_0x3ad082['error']['message']);}else{logger[_0xa359('0x20')](_0xa359('0x26'),_0x39d69e,_0xa359('0x21'));_0x360e12(_0x3ad082[_0xa359('0x28')][_0xa359('0x27')]);}})[_0xa359('0x29')](function(_0x5d428c){logger[_0xa359('0x25')](_0xa359('0x26'),_0x39d69e,_0x5d428c);_0x59204c(_0x5d428c);});});}function respondWithStatusCode(_0x482f8f,_0x5af878){_0x5af878=_0x5af878||0xcc;return function(_0x3a507b){if(_0x3a507b){return _0x482f8f['sendStatus'](_0x5af878);}return _0x482f8f[_0xa359('0x2a')](_0x5af878)[_0xa359('0x2b')]();};}function respondWithResult(_0x501323,_0x461866){_0x461866=_0x461866||0xc8;return function(_0xab7df8){if(_0xab7df8){return _0x501323['status'](_0x461866)['json'](_0xab7df8);}};}function respondWithFilteredResult(_0x296032,_0x2b59c2){return function(_0x1c9dc5){if(_0x1c9dc5){var _0x5f3822=typeof _0x2b59c2[_0xa359('0x2c')]===_0xa359('0x2d')&&typeof _0x2b59c2[_0xa359('0x2e')]===_0xa359('0x2d');var _0x5ef347=_0x1c9dc5[_0xa359('0x2f')];var _0x3745a5=_0x5f3822?0x0:_0x2b59c2['offset'];var _0x43b407=_0x5f3822?_0x1c9dc5['count']:_0x2b59c2[_0xa359('0x2c')]+_0x2b59c2[_0xa359('0x2e')];var _0x52e0ed;if(_0x43b407>=_0x5ef347){_0x43b407=_0x5ef347;_0x52e0ed=0xc8;}else{_0x52e0ed=0xce;}_0x296032[_0xa359('0x2a')](_0x52e0ed);return _0x296032['set'](_0xa359('0x30'),_0x3745a5+'-'+_0x43b407+'/'+_0x5ef347)[_0xa359('0x31')](_0x1c9dc5);}return null;};}function patchUpdates(_0x211856){return function(_0x434be5){try{jsonpatch[_0xa359('0x32')](_0x434be5,_0x211856,!![]);}catch(_0x274efd){return BPromise['reject'](_0x274efd);}return _0x434be5[_0xa359('0x33')]();};}function saveUpdates(_0x4cd566,_0x1fb340){return function(_0x3e16b7){if(_0x3e16b7){return _0x3e16b7[_0xa359('0x34')](_0x4cd566)[_0xa359('0x35')](function(_0x511128){return _0x511128;});}return null;};}function removeEntity(_0x5251dd,_0x2d4b41){return function(_0x284286){if(_0x284286){return _0x284286['destroy']()['then'](function(){var _0x2ca26a=_0x284286[_0xa359('0x36')]({'plain':!![]});var _0x2f6de7=_0xa359('0x37');return db[_0xa359('0x38')][_0xa359('0x39')]({'where':{'type':_0x2f6de7,'resourceId':_0x2ca26a['id']}})[_0xa359('0x35')](function(){return _0x284286;});})[_0xa359('0x35')](function(){_0x5251dd[_0xa359('0x2a')](0xcc)[_0xa359('0x2b')]();});}};}function handleEntityNotFound(_0x3716bd,_0x153df2){return function(_0x900ce9){if(!_0x900ce9){_0x3716bd[_0xa359('0x3a')](0x194);}return _0x900ce9;};}function handleError(_0x187c89,_0x508a50){_0x508a50=_0x508a50||0x1f4;return function(_0x191834){logger[_0xa359('0x25')](_0x191834[_0xa359('0x3b')]);if(_0x191834[_0xa359('0x3c')]){delete _0x191834[_0xa359('0x3c')];}_0x187c89[_0xa359('0x2a')](_0x508a50)[_0xa359('0x3d')](_0x191834);};}exports[_0xa359('0x3e')]=function(_0x297729,_0x584a5b){var _0xc68f71={'include':[{'model':db[_0xa359('0x3f')],'as':_0xa359('0x40')}]},_0x41266e={},_0x295634={'count':0x0,'rows':[]};var _0x457a0d=_[_0xa359('0x41')](db[_0xa359('0x42')][_0xa359('0x43')],function(_0x14f07b){return{'name':_0x14f07b['fieldName'],'type':_0x14f07b[_0xa359('0x44')][_0xa359('0x45')]};});_0x41266e[_0xa359('0x46')]=_['map'](_0x457a0d,_0xa359('0x3c'));_0x41266e[_0xa359('0x47')]=_[_0xa359('0x48')](_0x297729[_0xa359('0x47')]);_0x41266e[_0xa359('0x49')]=_[_0xa359('0x4a')](_0x41266e[_0xa359('0x46')],_0x41266e[_0xa359('0x47')]);_0xc68f71[_0xa359('0x4b')]=_[_0xa359('0x4a')](_0x41266e[_0xa359('0x46')],qs[_0xa359('0x4c')](_0x297729['query']['fields']));_0xc68f71[_0xa359('0x4b')]=_0xc68f71['attributes']['length']?_0xc68f71[_0xa359('0x4b')]:_0x41266e[_0xa359('0x46')];if(!_0x297729[_0xa359('0x47')][_0xa359('0x4d')]('nolimit')){_0xc68f71[_0xa359('0x2e')]=qs['limit'](_0x297729['query']['limit']);_0xc68f71[_0xa359('0x2c')]=qs[_0xa359('0x2c')](_0x297729[_0xa359('0x47')]['offset']);}_0xc68f71[_0xa359('0x4e')]=qs[_0xa359('0x4f')](_0x297729['query']['sort']);_0xc68f71['where']=qs[_0xa359('0x49')](_['pick'](_0x297729['query'],_0x41266e[_0xa359('0x49')]),_0x457a0d);if(_0x297729[_0xa359('0x47')]['filter']){_0xc68f71[_0xa359('0x50')]=_[_0xa359('0x51')](_0xc68f71[_0xa359('0x50')],{'$or':_[_0xa359('0x41')](_0x457a0d,function(_0x54e2b1){if(_0x54e2b1[_0xa359('0x44')]!==_0xa359('0x52')){var _0x5aea15={};_0x5aea15[_0x54e2b1[_0xa359('0x3c')]]={'$like':'%'+_0x297729[_0xa359('0x47')][_0xa359('0x53')]+'%'};return _0x5aea15;}})});}_0xc68f71=_[_0xa359('0x51')]({},_0xc68f71,_0x297729['options']);var _0x35f98c={'where':_0xc68f71[_0xa359('0x50')]};return db[_0xa359('0x42')][_0xa359('0x2f')](_0x35f98c)['then'](function(_0x4caabb){_0x295634[_0xa359('0x2f')]=_0x4caabb;if(_0x297729[_0xa359('0x47')][_0xa359('0x54')]){_0xc68f71[_0xa359('0x55')]=[{'all':!![]}];}return db[_0xa359('0x42')][_0xa359('0x56')](_0xc68f71);})[_0xa359('0x35')](function(_0x3b6435){_0x295634[_0xa359('0x57')]=_0x3b6435;return _0x295634;})[_0xa359('0x35')](respondWithFilteredResult(_0x584a5b,_0xc68f71))[_0xa359('0x29')](handleError(_0x584a5b,null));};exports[_0xa359('0x58')]=function(_0xee462a,_0x136843){var _0x285a56={'raw':![],'where':{'id':_0xee462a[_0xa359('0x59')]['id']},'include':[{'model':db[_0xa359('0x3f')],'as':_0xa359('0x40')}]},_0x10dfce={};_0x10dfce[_0xa359('0x46')]=_['keys'](db[_0xa359('0x42')][_0xa359('0x43')]);_0x10dfce[_0xa359('0x47')]=_[_0xa359('0x48')](_0xee462a['query']);_0x10dfce[_0xa359('0x49')]=_['intersection'](_0x10dfce[_0xa359('0x46')],_0x10dfce[_0xa359('0x47')]);_0x285a56[_0xa359('0x4b')]=_[_0xa359('0x4a')](_0x10dfce[_0xa359('0x46')],qs[_0xa359('0x4c')](_0xee462a['query'][_0xa359('0x4c')]));_0x285a56[_0xa359('0x4b')]=_0x285a56['attributes'][_0xa359('0x5a')]?_0x285a56[_0xa359('0x4b')]:_0x10dfce[_0xa359('0x46')];if(_0xee462a[_0xa359('0x47')][_0xa359('0x54')]){_0x285a56['include']=[{'all':!![]}];}_0x285a56=_[_0xa359('0x51')]({},_0x285a56,_0xee462a['options']);return db[_0xa359('0x42')][_0xa359('0x5b')](_0x285a56)[_0xa359('0x35')](handleEntityNotFound(_0x136843,null))['then'](respondWithResult(_0x136843,null))[_0xa359('0x29')](handleError(_0x136843,null));};exports['create']=function(_0x4a9f0a,_0x142229){return db[_0xa359('0x42')][_0xa359('0x5c')](_0x4a9f0a['body'],{})[_0xa359('0x35')](function(_0x35ef1a){var _0x5c7f0e=_0x4a9f0a[_0xa359('0x5d')][_0xa359('0x36')]({'plain':!![]});if(!_0x5c7f0e)throw new Error(_0xa359('0x5e'));if(_0x5c7f0e[_0xa359('0x5f')]===_0xa359('0x5d')){var _0x2b2071=_0x35ef1a[_0xa359('0x36')]({'plain':!![]});var _0xcc5cdb=_0xa359('0x37');return db[_0xa359('0x60')][_0xa359('0x5b')]({'where':{'name':_0xcc5cdb,'userProfileId':_0x5c7f0e[_0xa359('0x61')]},'raw':!![]})[_0xa359('0x35')](function(_0x4729b3){if(_0x4729b3&&_0x4729b3[_0xa359('0x62')]===0x0){return db[_0xa359('0x38')][_0xa359('0x5c')]({'name':_0x2b2071['name'],'resourceId':_0x2b2071['id'],'type':_0x4729b3[_0xa359('0x3c')],'sectionId':_0x4729b3['id']},{})[_0xa359('0x35')](function(){return _0x35ef1a;});}else{return _0x35ef1a;}})[_0xa359('0x29')](function(_0x480555){logger[_0xa359('0x25')](_0xa359('0x63'),_0x480555);throw _0x480555;});}return _0x35ef1a;})['then'](respondWithResult(_0x142229,0xc9))['catch'](handleError(_0x142229,null));};exports['update']=function(_0x10974b,_0x27e8d6){if(_0x10974b[_0xa359('0x64')]['id']){delete _0x10974b[_0xa359('0x64')]['id'];}return db[_0xa359('0x42')]['find']({'where':{'id':_0x10974b[_0xa359('0x59')]['id']},'include':[{'model':db[_0xa359('0x3f')],'as':_0xa359('0x40')}]})[_0xa359('0x35')](handleEntityNotFound(_0x27e8d6,null))[_0xa359('0x35')](saveUpdates(_0x10974b[_0xa359('0x64')],null))[_0xa359('0x35')](respondWithResult(_0x27e8d6,null))[_0xa359('0x29')](handleError(_0x27e8d6,null));};exports['destroy']=function(_0x44acc0,_0x3a586f){return db['OpenchannelAccount'][_0xa359('0x5b')]({'where':{'id':_0x44acc0[_0xa359('0x59')]['id']}})[_0xa359('0x35')](handleEntityNotFound(_0x3a586f,null))['then'](removeEntity(_0x3a586f,null))[_0xa359('0x29')](handleError(_0x3a586f,null));};exports[_0xa359('0x65')]=function(_0x11d911,_0x477831){return db[_0xa359('0x42')][_0xa359('0x65')]()[_0xa359('0x35')](respondWithResult(_0x477831,null))[_0xa359('0x29')](handleError(_0x477831,null));};exports[_0xa359('0x66')]=function(_0x2c0203,_0x1aee47,_0x1b22d1){if(_0x2c0203[_0xa359('0x64')]['id']){delete _0x2c0203[_0xa359('0x64')]['id'];}return db['OpenchannelAccount'][_0xa359('0x5b')]({'where':{'id':_0x2c0203[_0xa359('0x59')]['id']}})['then'](handleEntityNotFound(_0x1aee47,null))[_0xa359('0x35')](function(_0x383038){if(_0x383038){_0x2c0203[_0xa359('0x64')]['OpenchannelAccountId']=_0x383038['id'];return db[_0xa359('0x67')][_0xa359('0x5c')](_0x2c0203[_0xa359('0x64')]);}})['then'](respondWithResult(_0x1aee47,null))['catch'](handleError(_0x1aee47,null));};exports['getDispositions']=function(_0x242a1a,_0x3fb9bc,_0x44eaf0){var _0x573371={'raw':![],'where':{}};var _0x2611df={};var _0x584c95={'count':0x0,'rows':[]};return db[_0xa359('0x42')][_0xa359('0x68')]({'where':{'id':_0x242a1a['params']['id']}})['then'](handleEntityNotFound(_0x3fb9bc,null))[_0xa359('0x35')](function(_0x3452b7){if(_0x3452b7){_0x2611df[_0xa359('0x46')]=_['keys'](db[_0xa359('0x67')][_0xa359('0x43')]);_0x2611df[_0xa359('0x47')]=_[_0xa359('0x48')](_0x242a1a[_0xa359('0x47')]);_0x2611df['filters']=_[_0xa359('0x4a')](_0x2611df[_0xa359('0x46')],_0x2611df[_0xa359('0x47')]);_0x573371['attributes']=_[_0xa359('0x4a')](_0x2611df[_0xa359('0x46')],qs['fields'](_0x242a1a['query']['fields']));_0x573371['attributes']=_0x573371['attributes'][_0xa359('0x5a')]?_0x573371[_0xa359('0x4b')]:_0x2611df[_0xa359('0x46')];if(!_0x242a1a[_0xa359('0x47')][_0xa359('0x4d')]('nolimit')){_0x573371[_0xa359('0x2e')]=qs[_0xa359('0x2e')](_0x242a1a[_0xa359('0x47')][_0xa359('0x2e')]);_0x573371['offset']=qs['offset'](_0x242a1a['query'][_0xa359('0x2c')]);}_0x573371[_0xa359('0x4e')]=qs['sort'](_0x242a1a[_0xa359('0x47')][_0xa359('0x4f')]);_0x573371[_0xa359('0x50')]=qs[_0xa359('0x49')](_[_0xa359('0x69')](_0x242a1a[_0xa359('0x47')],_0x2611df[_0xa359('0x49')]));_0x573371[_0xa359('0x50')]['OpenchannelAccountId']=_0x3452b7['id'];if(_0x242a1a[_0xa359('0x47')]['filter']){_0x573371[_0xa359('0x50')]=_[_0xa359('0x51')](_0x573371['where'],{'$or':_[_0xa359('0x41')](_0x573371['attributes'],function(_0x54aaa1){var _0x30141d={};_0x30141d[_0x54aaa1]={'$like':'%'+_0x242a1a['query'][_0xa359('0x53')]+'%'};return _0x30141d;})});}_0x573371=_[_0xa359('0x51')]({},_0x573371,_0x242a1a[_0xa359('0x6a')]);return db['Disposition'][_0xa359('0x2f')]({'where':_0x573371[_0xa359('0x50')]})[_0xa359('0x35')](function(_0x13990f){_0x584c95['count']=_0x13990f;if(_0x242a1a[_0xa359('0x47')][_0xa359('0x54')]){_0x573371[_0xa359('0x55')]=[{'all':!![]}];}return db[_0xa359('0x67')][_0xa359('0x56')](_0x573371);})['then'](function(_0x517e74){_0x584c95[_0xa359('0x57')]=_0x517e74;return _0x584c95;});}})[_0xa359('0x35')](respondWithFilteredResult(_0x3fb9bc,_0x573371))[_0xa359('0x29')](handleError(_0x3fb9bc,null));};exports[_0xa359('0x6b')]=function(_0x2ea2c7,_0x347b31,_0x50ba40){return db[_0xa359('0x42')]['find']({'where':{'id':_0x2ea2c7['params']['id']}})[_0xa359('0x35')](handleEntityNotFound(_0x347b31,null))['then'](function(_0x2648b7){if(_0x2648b7){return _0x2648b7[_0xa359('0x6b')](_0x2ea2c7[_0xa359('0x47')][_0xa359('0x6c')]);}})[_0xa359('0x35')](respondWithStatusCode(_0x347b31,null))['catch'](handleError(_0x347b31,null));};exports[_0xa359('0x6d')]=function(_0x438a73,_0x407875,_0x40d4bb){if(_0x438a73['body']['id']){delete _0x438a73[_0xa359('0x64')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x438a73[_0xa359('0x59')]['id']}})[_0xa359('0x35')](handleEntityNotFound(_0x407875,null))[_0xa359('0x35')](function(_0x5c84cb){if(_0x5c84cb){_0x438a73['body'][_0xa359('0x6e')]=_0x5c84cb['id'];return db[_0xa359('0x6f')][_0xa359('0x5c')](_0x438a73[_0xa359('0x64')]);}})[_0xa359('0x35')](respondWithResult(_0x407875,null))[_0xa359('0x29')](handleError(_0x407875,null));};exports['getAnswers']=function(_0x112513,_0x5ef4d2,_0x444989){var _0x359f50={'raw':![],'where':{}};var _0x22423d={};var _0x1538a6={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xa359('0x68')]({'where':{'id':_0x112513[_0xa359('0x59')]['id']}})['then'](handleEntityNotFound(_0x5ef4d2,null))[_0xa359('0x35')](function(_0x3a3113){if(_0x3a3113){_0x22423d[_0xa359('0x46')]=_[_0xa359('0x48')](db[_0xa359('0x6f')][_0xa359('0x43')]);_0x22423d['query']=_[_0xa359('0x48')](_0x112513[_0xa359('0x47')]);_0x22423d[_0xa359('0x49')]=_[_0xa359('0x4a')](_0x22423d[_0xa359('0x46')],_0x22423d[_0xa359('0x47')]);_0x359f50[_0xa359('0x4b')]=_[_0xa359('0x4a')](_0x22423d['model'],qs['fields'](_0x112513[_0xa359('0x47')][_0xa359('0x4c')]));_0x359f50[_0xa359('0x4b')]=_0x359f50['attributes']['length']?_0x359f50[_0xa359('0x4b')]:_0x22423d['model'];if(!_0x112513['query'][_0xa359('0x4d')](_0xa359('0x70'))){_0x359f50[_0xa359('0x2e')]=qs[_0xa359('0x2e')](_0x112513[_0xa359('0x47')][_0xa359('0x2e')]);_0x359f50[_0xa359('0x2c')]=qs[_0xa359('0x2c')](_0x112513[_0xa359('0x47')][_0xa359('0x2c')]);}_0x359f50[_0xa359('0x4e')]=qs['sort'](_0x112513[_0xa359('0x47')][_0xa359('0x4f')]);_0x359f50['where']=qs['filters'](_[_0xa359('0x69')](_0x112513[_0xa359('0x47')],_0x22423d[_0xa359('0x49')]));_0x359f50['where'][_0xa359('0x6e')]=_0x3a3113['id'];if(_0x112513['query'][_0xa359('0x53')]){_0x359f50['where']=_[_0xa359('0x51')](_0x359f50['where'],{'$or':_['map'](_0x359f50[_0xa359('0x4b')],function(_0x1c4a9d){var _0x57e6c5={};_0x57e6c5[_0x1c4a9d]={'$like':'%'+_0x112513['query']['filter']+'%'};return _0x57e6c5;})});}_0x359f50=_['merge']({},_0x359f50,_0x112513[_0xa359('0x6a')]);return db[_0xa359('0x6f')][_0xa359('0x2f')]({'where':_0x359f50[_0xa359('0x50')]})[_0xa359('0x35')](function(_0x3e1a3a){_0x1538a6[_0xa359('0x2f')]=_0x3e1a3a;if(_0x112513[_0xa359('0x47')][_0xa359('0x54')]){_0x359f50[_0xa359('0x55')]=[{'all':!![]}];}return db[_0xa359('0x6f')][_0xa359('0x56')](_0x359f50);})[_0xa359('0x35')](function(_0x315c6b){_0x1538a6[_0xa359('0x57')]=_0x315c6b;return _0x1538a6;});}})[_0xa359('0x35')](respondWithFilteredResult(_0x5ef4d2,_0x359f50))[_0xa359('0x29')](handleError(_0x5ef4d2,null));};exports[_0xa359('0x71')]=function(_0x544454,_0x538676,_0x55727d){return db[_0xa359('0x42')]['find']({'where':{'id':_0x544454['params']['id']}})[_0xa359('0x35')](handleEntityNotFound(_0x538676,null))['then'](function(_0x252629){if(_0x252629){return _0x252629[_0xa359('0x71')](_0x544454[_0xa359('0x47')]['ids']);}})[_0xa359('0x35')](respondWithStatusCode(_0x538676,null))[_0xa359('0x29')](handleError(_0x538676,null));};exports[_0xa359('0x72')]=function(_0x1066e6,_0x528105,_0x44ac32){var _0x957ac2={'body':_0x1066e6[_0xa359('0x64')],'channel':_0xa359('0x73')};var _0x291d55=[];var _0x284bc9=[];var _0x2e2670={};var _0x32fbbe=![];return db[_0xa359('0x74')]['describe']()[_0xa359('0x35')](function(_0x4dc965){if(!_0x4dc965){throw new db[(_0xa359('0x75'))][(_0xa359('0x76'))](_0xa359('0x77'));}_0x291d55=_[_0xa359('0x78')](_[_0xa359('0x48')](_0x4dc965),[_0xa359('0x79'),_0xa359('0x7a')]);_0x284bc9=_[_0xa359('0x78')](_[_0xa359('0x48')](_0x4dc965),['createdAt',_0xa359('0x7a'),_0xa359('0x7b'),'ListId']);if(_0x1066e6['body']['id']){delete _0x1066e6[_0xa359('0x64')]['id'];}if(_[_0xa359('0x7c')](_0x1066e6[_0xa359('0x64')][_0xa359('0x7d')])){throw new db['Sequelize'][(_0xa359('0x76'))](_0xa359('0x7e'));}if(_['isNil'](_0x1066e6[_0xa359('0x64')][_0xa359('0x64')])||_0x1066e6['body'][_0xa359('0x64')]===''){throw new db[(_0xa359('0x75'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa359('0x7c')](_0x1066e6[_0xa359('0x64')][_0xa359('0x7f')])){throw new db[(_0xa359('0x75'))][(_0xa359('0x76'))](_0xa359('0x80')+_0x284bc9);}if(!_[_0xa359('0x81')](_0x284bc9,_0x1066e6[_0xa359('0x64')][_0xa359('0x7f')])){throw new db[(_0xa359('0x75'))][(_0xa359('0x76'))](_0xa359('0x82')+_0x284bc9);}_0x2e2670[_0x1066e6[_0xa359('0x64')][_0xa359('0x7f')]]=_0x1066e6[_0xa359('0x64')][_0xa359('0x7d')];})[_0xa359('0x35')](function(){return db[_0xa359('0x42')][_0xa359('0x5b')]({'where':{'id':_0x1066e6[_0xa359('0x59')]['id']},'include':[{'model':db[_0xa359('0x83')],'as':_0xa359('0x84'),'include':[{'model':db[_0xa359('0x74')],'as':_0xa359('0x85'),'where':_0x2e2670,'limit':0x1,'order':[[_0xa359('0x7a'),_0xa359('0x86')]]}]},{'model':db['OpenchannelApplication'],'as':_0xa359('0x87')}]});})[_0xa359('0x35')](handleEntityNotFound(_0x528105,null))[_0xa359('0x35')](function(_0x5d83db){if(_0x5d83db&&_0x5d83db[_0xa359('0x84')]){_0x957ac2[_0xa359('0x88')]=_0x5d83db;_0x957ac2[_0xa359('0x89')]=_0x5d83db[_0xa359('0x87')];_0x957ac2[_0xa359('0x8a')]=_0x5d83db[_0xa359('0x84')];_0x957ac2['applications']=_[_0xa359('0x8b')](_0x957ac2[_0xa359('0x89')],['priority'],[_0xa359('0x8c')]);if(_0x957ac2[_0xa359('0x88')][_0xa359('0x87')]){delete _0x957ac2['account'][_0xa359('0x87')];}if(_0x957ac2[_0xa359('0x88')][_0xa359('0x84')]&&_0x957ac2[_0xa359('0x88')][_0xa359('0x84')][_0xa359('0x85')]['length']){return _0x957ac2[_0xa359('0x88')][_0xa359('0x84')][_0xa359('0x85')][0x0];}var _0x1616e5=_[_0xa359('0x17')](_0x1066e6[_0xa359('0x64')],{'firstName':_0x1066e6[_0xa359('0x64')][_0xa359('0x7d')],'ListId':_0x5d83db[_0xa359('0x8d')]});_0x1616e5[_0x1066e6[_0xa359('0x64')][_0xa359('0x7f')]]=_0x1066e6[_0xa359('0x64')][_0xa359('0x7d')];return db[_0xa359('0x74')][_0xa359('0x5c')](_0x1616e5,{'fields':_0x291d55,'raw':!![]});}})[_0xa359('0x35')](handleEntityNotFound(_0x528105,null))['then'](function(_0xcf366b){_0x957ac2['contact']=_0xcf366b;if(_0xcf366b){var _0x174e80={'ContactId':_0xcf366b['id'],'OpenchannelAccountId':_0x1066e6[_0xa359('0x59')]['id'],'from':(_0xcf366b['firstName']||'')+'\x20'+(_0xcf366b[_0xa359('0x8e')]||'')};var _0x47f782={'OpenchannelAccountId':_0x1066e6[_0xa359('0x59')]['id'],'closed':![]};if(_0x1066e6[_0xa359('0x64')][_0xa359('0x8f')]){_0x47f782[_0xa359('0x8f')]=_0x1066e6[_0xa359('0x64')][_0xa359('0x8f')];return db['OpenchannelInteraction'][_0xa359('0x5b')]({'where':_0x47f782})[_0xa359('0x35')](function(_0x5885ea){if(_0x5885ea){return[_0x5885ea,![]];}_0x174e80[_0xa359('0x8f')]=_0x1066e6[_0xa359('0x64')][_0xa359('0x8f')];_0x174e80[_0xa359('0x90')]=_0x1066e6[_0xa359('0x64')][_0xa359('0x90')];return db[_0xa359('0x91')][_0xa359('0x5c')](_0x174e80)[_0xa359('0x35')](function(_0x44153a){return[_0x44153a,!![]];});});}else{_0x47f782[_0xa359('0x8f')]=null;}_0x47f782['ContactId']=_0xcf366b['id'];return db['OpenchannelInteraction'][_0xa359('0x5b')]({'where':_0x47f782})[_0xa359('0x35')](function(_0x5260a7){if(_0x5260a7){return[_0x5260a7,![]];}return db[_0xa359('0x91')]['create'](_0x174e80)[_0xa359('0x35')](function(_0x2829d8){return[_0x2829d8,!![]];});});}})[_0xa359('0x92')](function(_0x37aa29,_0x59f7b0){if(_0x37aa29){_0x32fbbe=_0x59f7b0;if(!_0x59f7b0){var _0xa87ba0={'from':(_0x957ac2[_0xa359('0x93')][_0xa359('0x94')]||'')+'\x20'+(_0x957ac2[_0xa359('0x93')]['lastName']||'')};if(_0x1066e6[_0xa359('0x64')][_0xa359('0x8f')]&&_0x1066e6[_0xa359('0x64')][_0xa359('0x95')]&&_0x1066e6[_0xa359('0x64')]['threadId']!=_0x1066e6[_0xa359('0x64')]['messageId']){_0xa87ba0['threadId']=_0x1066e6['body']['messageId'];}return _0x37aa29['update'](_0xa87ba0);}else{return _0x37aa29;}}})[_0xa359('0x35')](function(_0x45e05d){_0x957ac2['interaction']=_0x45e05d[_0xa359('0x36')]({'plain':!![]});_0x957ac2[_0xa359('0x96')][_0xa359('0x97')]=_0x32fbbe;if(_0x957ac2[_0xa359('0x96')]['created']){if(_0x957ac2[_0xa359('0x88')]['autoclose']){_0x957ac2[_0xa359('0x89')][_0xa359('0x98')]({'id':0x0,'priority':_0x957ac2['applications']['length']+0x1,'app':_0xa359('0x99'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0xa359('0x9a')][_0xa359('0x5c')]({'body':_0x1066e6[_0xa359('0x64')][_0xa359('0x64')],'OpenchannelAccountId':_0x1066e6[_0xa359('0x59')]['id'],'OpenchannelInteractionId':_0x45e05d['id'],'direction':'in','ContactId':_0x957ac2[_0xa359('0x93')]['id'],'AttachmentId':_0x1066e6[_0xa359('0x64')]['AttachmentId']});})[_0xa359('0x35')](function(_0x349ffc){_0x957ac2[_0xa359('0x27')]=_0x349ffc;if(_0x957ac2['interaction']['UserId']){return db[_0xa359('0x9b')][_0xa359('0x5b')]({'attributes':['id',_0xa359('0x3c')],'where':{'id':_0x957ac2[_0xa359('0x96')]['UserId']}})[_0xa359('0x35')](function(_0x2508f6){if(_0x2508f6){_0x957ac2[_0xa359('0x89')]['unshift']({'id':0x0,'priority':0x0,'app':_0xa359('0x9c'),'appdata':_0x2508f6[_0xa359('0x3c')]+','+(_0x957ac2['account']['waitForTheAssignedAgent']||0xa),'interval':_0xa359('0x9d')});_0x957ac2['forcedOwnership']=![];}return respondWithRpcPromise(_0xa359('0x9e'),_0xa359('0x9f'),_0x957ac2);});}return respondWithRpcPromise(_0xa359('0x9e'),_0xa359('0x9f'),_0x957ac2);})['then'](function(_0x9373f5){respondWithRpcPromise(_0xa359('0xa0'),'EventManager',{'event':_0xa359('0x72'),'message':_0x9373f5},client9002);return _0x9373f5;})[_0xa359('0x35')](respondWithResult(_0x528105,null))[_0xa359('0x29')](handleError(_0x528105,null));};exports[_0xa359('0xa1')]=function(_0x13e5e5,_0x5f26fe){var _0x43a8b3=_0x13e5e5[_0xa359('0x59')]['id'];var _0x599199=_0x13e5e5[_0xa359('0x64')];var _0x58877a=0xc8;var _0x51aae9=null;return db[_0xa359('0xa2')][_0xa359('0xa3')]({'isolationLevel':db[_0xa359('0xa2')][_0xa359('0xa4')][_0xa359('0xa5')][_0xa359('0xa6')]},function(_0x106dfe){return db[_0xa359('0x42')][_0xa359('0x68')]({'where':{'id':_0x43a8b3},'transaction':_0x106dfe})['then'](function(_0x3f4ec5){if(_0x3f4ec5){return db[_0xa359('0xa7')][_0xa359('0x39')]({'where':{'OpenchannelAccountId':_0x43a8b3},'transaction':_0x106dfe})[_0xa359('0x35')](function(){var _0x58ff31=_[_0xa359('0x41')](_0x599199,function(_0x91a220){_0x91a220[_0xa359('0x6e')]=_0x43a8b3;return _0x91a220;});return db[_0xa359('0xa7')][_0xa359('0xa8')](_0x58ff31,{'transaction':_0x106dfe});});}else{_0x58877a=0x194;_0x51aae9=[];}});})[_0xa359('0x35')](function(){if(_0x58877a!==0x194){return db[_0xa359('0xa7')][_0xa359('0xa9')]({'where':{'OpenchannelAccountId':_0x43a8b3},'order':_0xa359('0xaa')})['then'](function(_0xb3d8f9){_0x51aae9=_0xb3d8f9;});}})[_0xa359('0x29')](function(_0x3cce9f){_0x58877a=0x1f4;logger['error'](_0x3cce9f[_0xa359('0x3b')]);if(_0x3cce9f[_0xa359('0x3c')]){delete _0x3cce9f[_0xa359('0x3c')];}_0x51aae9=_0x3cce9f;})[_0xa359('0xab')](function(){if(_0x51aae9===null){_0x5f26fe['sendStatus'](_0x58877a);}else{if(_0x58877a===0x1f4){_0x5f26fe[_0xa359('0x2a')](_0x58877a)['send'](_0x51aae9);}else{_0x5f26fe[_0xa359('0x2a')](_0x58877a)[_0xa359('0x31')](_0x51aae9);}}});};exports['getApplications']=function(_0x1d964d,_0x35c9a2,_0x3b0f34){var _0x2e4802={};var _0x543fa1={};var _0x4f14b8;var _0xe95819;return db[_0xa359('0x42')][_0xa359('0x68')]({'where':{'id':_0x1d964d['params']['id']}})[_0xa359('0x35')](handleEntityNotFound(_0x35c9a2,null))['then'](function(_0x12e9f5){if(_0x12e9f5){_0x4f14b8=_0x12e9f5;_0x543fa1[_0xa359('0x46')]=_[_0xa359('0x48')](db[_0xa359('0xa7')][_0xa359('0x43')]);_0x543fa1[_0xa359('0x47')]=_[_0xa359('0x48')](_0x1d964d[_0xa359('0x47')]);_0x543fa1[_0xa359('0x49')]=_['intersection'](_0x543fa1[_0xa359('0x46')],_0x543fa1[_0xa359('0x47')]);_0x2e4802[_0xa359('0x4b')]=_[_0xa359('0x4a')](_0x543fa1[_0xa359('0x46')],qs[_0xa359('0x4c')](_0x1d964d[_0xa359('0x47')][_0xa359('0x4c')]));_0x2e4802[_0xa359('0x4b')]=_0x2e4802[_0xa359('0x4b')][_0xa359('0x5a')]?_0x2e4802['attributes']:_0x543fa1[_0xa359('0x46')];_0x2e4802[_0xa359('0x4e')]=qs['sort'](_0x1d964d[_0xa359('0x47')]['sort']);_0x2e4802[_0xa359('0x50')]=qs[_0xa359('0x49')](_[_0xa359('0x69')](_0x1d964d[_0xa359('0x47')],_0x543fa1[_0xa359('0x49')]));if(_0x1d964d[_0xa359('0x47')]['filter']){_0x2e4802[_0xa359('0x50')]=_[_0xa359('0x51')](_0x2e4802[_0xa359('0x50')],{'$or':_['map'](_0x2e4802['attributes'],function(_0x1f8b4a){var _0x94e1e2={};_0x94e1e2[_0x1f8b4a]={'$like':'%'+_0x1d964d[_0xa359('0x47')][_0xa359('0x53')]+'%'};return _0x94e1e2;})});}_0x2e4802=_[_0xa359('0x51')]({},_0x2e4802,_0x1d964d[_0xa359('0x6a')]);return _0x4f14b8['getApplications'](_0x2e4802);}})[_0xa359('0x35')](function(_0x3f65f0){if(_0x3f65f0){_0xe95819=_0x3f65f0[_0xa359('0x5a')];if(!_0x1d964d['query'][_0xa359('0x4d')](_0xa359('0x70'))){_0x2e4802['limit']=qs[_0xa359('0x2e')](_0x1d964d['query']['limit']);_0x2e4802[_0xa359('0x2c')]=qs['offset'](_0x1d964d[_0xa359('0x47')][_0xa359('0x2c')]);}return _0x4f14b8[_0xa359('0xac')](_0x2e4802);}})[_0xa359('0x35')](function(_0x6444f3){if(_0x6444f3){return _0x6444f3?{'count':_0xe95819,'rows':_0x6444f3}:null;}})[_0xa359('0x35')](respondWithResult(_0x35c9a2,null))['catch'](handleError(_0x35c9a2,null));};exports[_0xa359('0xad')]=function(_0x2085b1,_0x5772d2,_0x3055d8){var _0x2360b5={'raw':![],'where':{}};var _0x982ee={};var _0x40fb01={'count':0x0,'rows':[]};return db[_0xa359('0x42')][_0xa359('0x68')]({'where':{'id':_0x2085b1[_0xa359('0x59')]['id']}})[_0xa359('0x35')](handleEntityNotFound(_0x5772d2,null))[_0xa359('0x35')](function(_0xb43c74){if(_0xb43c74){_0x982ee[_0xa359('0x46')]=_[_0xa359('0x48')](db[_0xa359('0x91')][_0xa359('0x43')]);_0x982ee['query']=_['keys'](_0x2085b1[_0xa359('0x47')]);_0x982ee[_0xa359('0x49')]=_['intersection'](_0x982ee[_0xa359('0x46')],_0x982ee[_0xa359('0x47')]);_0x2360b5[_0xa359('0x4b')]=_[_0xa359('0x4a')](_0x982ee['model'],qs[_0xa359('0x4c')](_0x2085b1['query'][_0xa359('0x4c')]));_0x2360b5[_0xa359('0x4b')]=_0x2360b5['attributes'][_0xa359('0x5a')]?_0x2360b5[_0xa359('0x4b')]:_0x982ee['model'];if(!_0x2085b1[_0xa359('0x47')][_0xa359('0x4d')](_0xa359('0x70'))){_0x2360b5[_0xa359('0x2e')]=qs[_0xa359('0x2e')](_0x2085b1[_0xa359('0x47')]['limit']);_0x2360b5[_0xa359('0x2c')]=qs['offset'](_0x2085b1['query'][_0xa359('0x2c')]);}_0x2360b5[_0xa359('0x4e')]=qs[_0xa359('0x4f')](_0x2085b1['query'][_0xa359('0x4f')]);_0x2360b5['where']=qs[_0xa359('0x49')](_[_0xa359('0x69')](_0x2085b1['query'],_0x982ee[_0xa359('0x49')]));_0x2360b5['where']['OpenchannelAccountId']=_0xb43c74['id'];if(_0x2085b1[_0xa359('0x47')]['filter']){_0x2360b5['where']=_[_0xa359('0x51')](_0x2360b5['where'],{'$or':_[_0xa359('0x41')](_0x2360b5[_0xa359('0x4b')],function(_0x184575){var _0x45d6ba={};_0x45d6ba[_0x184575]={'$like':'%'+_0x2085b1[_0xa359('0x47')][_0xa359('0x53')]+'%'};return _0x45d6ba;})});}_0x2360b5=_[_0xa359('0x51')]({},_0x2360b5,_0x2085b1[_0xa359('0x6a')]);return db[_0xa359('0x91')][_0xa359('0x2f')]({'where':_0x2360b5['where']})[_0xa359('0x35')](function(_0x472bd1){_0x40fb01[_0xa359('0x2f')]=_0x472bd1;if(_0x2085b1[_0xa359('0x47')][_0xa359('0x54')]){_0x2360b5[_0xa359('0x55')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db['User'],'as':_0xa359('0xae'),'attributes':[_0xa359('0x3c'),_0xa359('0xaf'),'internal'],'required':![]},{'model':db[_0xa359('0xb0')],'as':'Tags','attributes':['id',_0xa359('0x3c'),_0xa359('0xb1')],'where':_0x2085b1['query'][_0xa359('0xb2')]?{'id':_0x2085b1[_0xa359('0x47')][_0xa359('0xb2')]}:undefined,'required':_0x2085b1[_0xa359('0x47')][_0xa359('0xb2')]?!![]:![]}];}return db[_0xa359('0x91')][_0xa359('0x56')](_0x2360b5);})[_0xa359('0x35')](function(_0x3ea886){_0x40fb01[_0xa359('0x57')]=_0x3ea886;return _0x40fb01;});}})[_0xa359('0x35')](respondWithFilteredResult(_0x5772d2,_0x2360b5))['catch'](handleError(_0x5772d2,null));};exports[_0xa359('0xb3')]=function(_0x539451,_0x4e0442,_0x50b932){return db['OpenchannelAccount'][_0xa359('0x5b')]({'where':{'id':_0x539451[_0xa359('0x59')]['id']}})[_0xa359('0x35')](handleEntityNotFound(_0x4e0442,null))[_0xa359('0x35')](function(_0x30d0f8){if(_0x30d0f8){return _0x30d0f8['addAgents'](_0x539451[_0xa359('0x64')][_0xa359('0x6c')],_[_0xa359('0xb4')](_0x539451['body'],['ids','id'])||{})['spread'](function(_0x1f0b6c){for(var _0x4f23a7=0x0;_0x4f23a7<_0x539451[_0xa359('0x64')][_0xa359('0x6c')][_0xa359('0x5a')];_0x4f23a7+=0x1){socket[_0xa359('0xb5')]('userOpenchannelAccount:save',{'UserId':Number(_0x539451[_0xa359('0x64')]['ids'][_0x4f23a7]),'OpenchannelAccountId':Number(_0x539451[_0xa359('0x59')]['id'])});}return _0x1f0b6c;});}})['then'](respondWithResult(_0x4e0442,null))[_0xa359('0x29')](handleError(_0x4e0442,null));};exports[_0xa359('0xb6')]=function(_0x4f9daf,_0x10c48c,_0x5b236d){return db[_0xa359('0x42')][_0xa359('0x5b')]({'where':{'id':_0x4f9daf[_0xa359('0x59')]['id']}})[_0xa359('0x35')](handleEntityNotFound(_0x10c48c,null))['then'](function(_0x1c0f69){if(_0x1c0f69){return _0x1c0f69[_0xa359('0xb6')](_0x4f9daf[_0xa359('0x47')][_0xa359('0x6c')])[_0xa359('0x35')](function(){if(_[_0xa359('0xb7')](_0x4f9daf['query'][_0xa359('0x6c')])){for(var _0x3b7692=0x0;_0x3b7692<_0x4f9daf['query']['ids'][_0xa359('0x5a')];_0x3b7692+=0x1){socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x4f9daf[_0xa359('0x47')][_0xa359('0x6c')][_0x3b7692]),'OpenchannelAccountId':Number(_0x4f9daf['params']['id'])});}}else{socket[_0xa359('0xb5')](_0xa359('0xb8'),{'UserId':Number(_0x4f9daf[_0xa359('0x47')][_0xa359('0x6c')]),'OpenchannelAccountId':Number(_0x4f9daf[_0xa359('0x59')]['id'])});}});}})[_0xa359('0x35')](respondWithStatusCode(_0x10c48c,null))[_0xa359('0x29')](handleError(_0x10c48c,null));};exports[_0xa359('0xb9')]=function(_0x3ca089,_0x4caf3d,_0x264fd5){var _0x1b3d3c={};var _0x2dabae={};var _0x33c4e4;var _0x8544e6;return db[_0xa359('0x42')]['findOne']({'where':{'id':_0x3ca089['params']['id']}})[_0xa359('0x35')](handleEntityNotFound(_0x4caf3d,null))[_0xa359('0x35')](function(_0x504159){if(_0x504159){_0x33c4e4=_0x504159;_0x2dabae[_0xa359('0x46')]=_[_0xa359('0x48')](db[_0xa359('0x9b')][_0xa359('0x43')]);_0x2dabae['query']=_[_0xa359('0x48')](_0x3ca089[_0xa359('0x47')]);_0x2dabae[_0xa359('0x49')]=_[_0xa359('0x4a')](_0x2dabae[_0xa359('0x46')],_0x2dabae[_0xa359('0x47')]);_0x1b3d3c[_0xa359('0x4b')]=_['intersection'](_0x2dabae[_0xa359('0x46')],qs[_0xa359('0x4c')](_0x3ca089['query'][_0xa359('0x4c')]));_0x1b3d3c[_0xa359('0x4b')]=_0x1b3d3c[_0xa359('0x4b')][_0xa359('0x5a')]?_0x1b3d3c['attributes']:_0x2dabae[_0xa359('0x46')];_0x1b3d3c['order']=qs[_0xa359('0x4f')](_0x3ca089[_0xa359('0x47')]['sort']);_0x1b3d3c['where']=qs[_0xa359('0x49')](_[_0xa359('0x69')](_0x3ca089[_0xa359('0x47')],_0x2dabae[_0xa359('0x49')]));if(_0x3ca089['query'][_0xa359('0x53')]){_0x1b3d3c['where']=_[_0xa359('0x51')](_0x1b3d3c[_0xa359('0x50')],{'$or':_[_0xa359('0x41')](_0x1b3d3c[_0xa359('0x4b')],function(_0x4aa5f8){var _0x210128={};_0x210128[_0x4aa5f8]={'$like':'%'+_0x3ca089[_0xa359('0x47')][_0xa359('0x53')]+'%'};return _0x210128;})});}_0x1b3d3c=_[_0xa359('0x51')]({},_0x1b3d3c,_0x3ca089[_0xa359('0x6a')]);return _0x33c4e4[_0xa359('0xb9')](_0x1b3d3c);}})['then'](function(_0x30a32d){if(_0x30a32d){_0x8544e6=_0x30a32d[_0xa359('0x5a')];if(!_0x3ca089[_0xa359('0x47')][_0xa359('0x4d')](_0xa359('0x70'))){_0x1b3d3c[_0xa359('0x2e')]=qs[_0xa359('0x2e')](_0x3ca089[_0xa359('0x47')][_0xa359('0x2e')]);_0x1b3d3c[_0xa359('0x2c')]=qs['offset'](_0x3ca089[_0xa359('0x47')]['offset']);}return _0x33c4e4[_0xa359('0xb9')](_0x1b3d3c);}})['then'](function(_0x9b7bef){if(_0x9b7bef){return _0x9b7bef?{'count':_0x8544e6,'rows':_0x9b7bef}:null;}})['then'](respondWithResult(_0x4caf3d,null))[_0xa359('0x29')](handleError(_0x4caf3d,null));};exports[_0xa359('0x3d')]=function(_0x34c397,_0x2a8b6f,_0x4a4681){var _0x534e89,_0x12cdf6,_0x19fd08;if(_[_0xa359('0x7c')](_0x34c397[_0xa359('0x64')][_0xa359('0x64')])||_0x34c397[_0xa359('0x64')][_0xa359('0x64')]===''){throw new db[(_0xa359('0x75'))][(_0xa359('0x76'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x34c397[_0xa359('0x64')]['to'])){}_0x534e89=_0x34c397[_0xa359('0x64')]['to'];return db[_0xa359('0x42')][_0xa359('0x68')]({'where':{'id':_0x34c397['params']['id']}})[_0xa359('0x35')](handleEntityNotFound(_0x2a8b6f,null))[_0xa359('0x35')](function(_0x222928){if(_0x222928){return db[_0xa359('0x42')][_0xa359('0x5b')]({'where':{'id':_0x222928['id']},'include':[{'model':db[_0xa359('0x83')],'as':_0xa359('0x84'),'include':[{'model':db[_0xa359('0x74')],'as':_0xa359('0x85'),'where':{[_0x222928[_0xa359('0x7f')]]:_0x534e89},'limit':0x1,'order':[[_0xa359('0x7a'),'DESC']]}]}]})[_0xa359('0x35')](handleEntityNotFound(_0x2a8b6f,null))['then'](function(_0x47aaa8){if(_0x47aaa8&&_0x47aaa8[_0xa359('0x84')]){_0x12cdf6=_0x47aaa8[_0xa359('0x36')]({'plain':!![]});if(_0x12cdf6[_0xa359('0x84')]&&_0x12cdf6[_0xa359('0x84')][_0xa359('0x85')][_0xa359('0x5a')]){return _0x12cdf6[_0xa359('0x84')][_0xa359('0x85')][0x0];}return db[_0xa359('0x74')]['create'](_[_0xa359('0x17')](_0x34c397[_0xa359('0x64')],{'firstName':_0x534e89,[_0x47aaa8[_0xa359('0x7f')]]:_0x534e89,'phone':_0x534e89,'ListId':_0x12cdf6[_0xa359('0x8d')]}));}})[_0xa359('0x35')](handleEntityNotFound(_0x2a8b6f,null))[_0xa359('0x35')](function(_0x41852d){if(_0x41852d){_0x19fd08=_0x41852d;return db[_0xa359('0x91')][_0xa359('0x5b')]({'where':{'ContactId':_0x19fd08['id'],'closed':![],'OpenchannelAccountId':_0x12cdf6['id']}})[_0xa359('0x35')](function(_0x17b168){if(_0x17b168){return[_0x17b168,![]];}return db['OpenchannelInteraction'][_0xa359('0x5c')]({'UserId':_0x34c397[_0xa359('0x5d')]['id'],'ContactId':_0x19fd08['id'],'OpenchannelAccountId':_0x12cdf6['id'],'lastMsgDirection':_0xa359('0xba'),'firstMsgDirection':'out','Messages':[_[_0xa359('0x51')](_0x34c397[_0xa359('0x64')],{'read':![],'body':_0x34c397['body'][_0xa359('0x64')],'OpenchannelAccountId':_0x12cdf6['id'],'UserId':_0x34c397[_0xa359('0x5d')]['id'],'ContactId':_0x19fd08['id']})]},{'include':[{'model':db[_0xa359('0x9a')],'as':_0xa359('0xbb')}]})[_0xa359('0x35')](function(_0x2f65bb){return[_0x2f65bb,!![]];});});}})[_0xa359('0x92')](function(_0x5631c1,_0x143884){if(_0x143884){return _0x5631c1;}return db[_0xa359('0x9a')][_0xa359('0x5c')](_[_0xa359('0x51')](_0x34c397[_0xa359('0x64')],{'read':![],'body':_0x34c397['body']['body'],'OpenchannelAccountId':_0x12cdf6['id'],'OpenchannelInteractionId':_0x5631c1['id'],'UserId':_0x34c397[_0xa359('0x5d')]['id'],'ContactId':_0x19fd08['id']}))[_0xa359('0x35')](function(_0x21cd74){_0x5631c1[_0xa359('0xbc')][_0xa359('0xbb')]=[];_0x5631c1[_0xa359('0xbc')][_0xa359('0xbb')]['push'](_0x21cd74[_0xa359('0xbc')]);return _0x5631c1;});});}})[_0xa359('0x35')](respondWithResult(_0x2a8b6f,null))[_0xa359('0x29')](handleError(_0x2a8b6f,null));};
\ No newline at end of file
index 66a737b..44841bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x153f=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelAccount'];(function(_0x47d070,_0xb91391){var _0x510734=function(_0x5209b0){while(--_0x5209b0){_0x47d070['push'](_0x47d070['shift']());}};_0x510734(++_0xb91391);}(_0x153f,0x15b));var _0xf153=function(_0x28494c,_0xbe5bf){_0x28494c=_0x28494c-0x0;var _0x2b596c=_0x153f[_0x28494c];return _0x2b596c;};'use strict';var EventEmitter=require(_0xf153('0x0'));var OpenchannelAccount=require(_0xf153('0x1'))['db'][_0xf153('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xf153('0x3')](0x0);var events={'afterCreate':_0xf153('0x4'),'afterUpdate':_0xf153('0x5'),'afterDestroy':_0xf153('0x6')};function emitEvent(_0x59757c){return function(_0x364e65,_0x5c49c7,_0x1f9ead){OpenchannelAccountEvents[_0xf153('0x7')](_0x59757c+':'+_0x364e65['id'],_0x364e65);OpenchannelAccountEvents[_0xf153('0x7')](_0x59757c,_0x364e65);_0x1f9ead(null);};}for(var e in events){if(events[_0xf153('0x8')](e)){var event=events[e];OpenchannelAccount[_0xf153('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
+var _0xb58b=['exports','../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','emit','hook'];(function(_0x9cc63e,_0x6f7666){var _0x357bd5=function(_0x54b1d7){while(--_0x54b1d7){_0x9cc63e['push'](_0x9cc63e['shift']());}};_0x357bd5(++_0x6f7666);}(_0xb58b,0x1f1));var _0xbb58=function(_0x2e4eab,_0x5af04e){_0x2e4eab=_0x2e4eab-0x0;var _0x38ea30=_0xb58b[_0x2e4eab];return _0x38ea30;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xbb58('0x0'))['db'][_0xbb58('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbb58('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbb58('0x3'),'afterDestroy':_0xbb58('0x4')};function emitEvent(_0x5c9ec5){return function(_0x226363,_0x546510,_0x2edb10){OpenchannelAccountEvents[_0xbb58('0x5')](_0x5c9ec5+':'+_0x226363['id'],_0x226363);OpenchannelAccountEvents[_0xbb58('0x5')](_0x5c9ec5,_0x226363);_0x2edb10(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xbb58('0x6')](e,emitEvent(event));}}module[_0xbb58('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
index 95a6bd6..8de52f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x839778,_0x466a6a){var _0x3e579c=function(_0x5010fd){while(--_0x5010fd){_0x839778['push'](_0x839778['shift']());}};_0x3e579c(++_0x466a6a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x396b5b,_0x3b31c9){var _0xb0e76a=function(_0x2638ca){while(--_0x2638ca){_0x396b5b['push'](_0x396b5b['shift']());}};_0xb0e76a(++_0x3b31c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5799c5b..ed8322c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa74f=['info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','then'];(function(_0x3f55fd,_0x3edea9){var _0x573576=function(_0x16c91f){while(--_0x16c91f){_0x3f55fd['push'](_0x3f55fd['shift']());}};_0x573576(++_0x3edea9);}(_0xa74f,0x9a));var _0xfa74=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0xa74f[_0x5e6ea3];return _0x4048b5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa74('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa74('0x1'));var db=require(_0xfa74('0x2'))['db'];var utils=require(_0xfa74('0x3'));var logger=require(_0xfa74('0x4'))('rpc');var config=require(_0xfa74('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa74('0x6')]({'port':0x232a});config[_0xfa74('0x7')]=_[_0xfa74('0x8')](config[_0xfa74('0x7')],{'host':_0xfa74('0x9'),'port':0x18eb});var socket=require(_0xfa74('0xa'))(new Redis(config['redis']));require(_0xfa74('0xb'))[_0xfa74('0xc')](socket);function respondWithRpcPromise(_0x355e37,_0x2a405e,_0x4d118c){return new BPromise(function(_0x46117e,_0x4f8891){return client['request'](_0x355e37,_0x4d118c)[_0xfa74('0xd')](function(_0x1d919d){logger[_0xfa74('0xe')](_0xfa74('0xf'),_0x2a405e,'request\x20sent');logger[_0xfa74('0x10')](_0xfa74('0x11'),_0x2a405e,_0xfa74('0x12'),JSON[_0xfa74('0x13')](_0x1d919d));if(_0x1d919d['error']){if(_0x1d919d[_0xfa74('0x14')][_0xfa74('0x15')]===0x1f4){logger[_0xfa74('0x14')](_0xfa74('0xf'),_0x2a405e,_0x1d919d[_0xfa74('0x14')]['message']);return _0x4f8891(_0x1d919d[_0xfa74('0x14')][_0xfa74('0x16')]);}logger[_0xfa74('0x14')](_0xfa74('0xf'),_0x2a405e,_0x1d919d[_0xfa74('0x14')][_0xfa74('0x16')]);return _0x46117e(_0x1d919d[_0xfa74('0x14')]['message']);}else{logger[_0xfa74('0xe')](_0xfa74('0xf'),_0x2a405e,'request\x20sent');_0x46117e(_0x1d919d['result'][_0xfa74('0x16')]);}})[_0xfa74('0x17')](function(_0xb8fe6b){logger['error'](_0xfa74('0xf'),_0x2a405e,_0xb8fe6b);_0x4f8891(_0xb8fe6b);});});}
\ No newline at end of file
+var _0x0bb5=['redis','defaults','localhost','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x583b93,_0x3598a4){var _0x36595e=function(_0x25676f){while(--_0x25676f){_0x583b93['push'](_0x583b93['shift']());}};_0x36595e(++_0x3598a4);}(_0x0bb5,0x148));var _0x50bb=function(_0x72f902,_0x19760e){_0x72f902=_0x72f902-0x0;var _0x3da64f=_0x0bb5[_0x72f902];return _0x3da64f;};'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 Redis=require(_0x50bb('0x3'));var db=require(_0x50bb('0x4'))['db'];var utils=require(_0x50bb('0x5'));var logger=require(_0x50bb('0x6'))(_0x50bb('0x7'));var config=require(_0x50bb('0x8'));var jayson=require(_0x50bb('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x50bb('0xa')]=_[_0x50bb('0xb')](config[_0x50bb('0xa')],{'host':_0x50bb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x50bb('0xd'))[_0x50bb('0xe')](socket);function respondWithRpcPromise(_0x3ae598,_0x239a89,_0x5512e1){return new BPromise(function(_0x36f7a1,_0x2edeeb){return client[_0x50bb('0xf')](_0x3ae598,_0x5512e1)[_0x50bb('0x10')](function(_0x346422){logger[_0x50bb('0x11')](_0x50bb('0x12'),_0x239a89,'request\x20sent');logger[_0x50bb('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x239a89,_0x50bb('0x14'),JSON[_0x50bb('0x15')](_0x346422));if(_0x346422[_0x50bb('0x16')]){if(_0x346422['error'][_0x50bb('0x17')]===0x1f4){logger[_0x50bb('0x16')](_0x50bb('0x12'),_0x239a89,_0x346422['error'][_0x50bb('0x18')]);return _0x2edeeb(_0x346422['error'][_0x50bb('0x18')]);}logger[_0x50bb('0x16')](_0x50bb('0x12'),_0x239a89,_0x346422[_0x50bb('0x16')][_0x50bb('0x18')]);return _0x36f7a1(_0x346422['error'][_0x50bb('0x18')]);}else{logger[_0x50bb('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x239a89,_0x50bb('0x14'));_0x36f7a1(_0x346422['result'][_0x50bb('0x18')]);}})[_0x50bb('0x19')](function(_0x4b06f5){logger['error'](_0x50bb('0x12'),_0x239a89,_0x4b06f5);_0x2edeeb(_0x4b06f5);});});}
\ No newline at end of file
index 8716257..529c49d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb13=['length','openchannelAccount:','save','remove','update','removeListener','register'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xdb13,0x10c));var _0x3db1=function(_0x74f692,_0x161319){_0x74f692=_0x74f692-0x0;var _0x32d2f0=_0xdb13[_0x74f692];return _0x32d2f0;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x3db1('0x0'),_0x3db1('0x1'),_0x3db1('0x2')];function createListener(_0x28e569,_0x32468d){return function(_0xd23f18){_0x32468d['emit'](_0x28e569,_0xd23f18);};}function removeListener(_0x3352e3,_0x41fb5d){return function(){OpenchannelAccountEvents[_0x3db1('0x3')](_0x3352e3,_0x41fb5d);};}exports[_0x3db1('0x4')]=function(_0x342b84){for(var _0x5a2345=0x0,_0x37ae52=events[_0x3db1('0x5')];_0x5a2345<_0x37ae52;_0x5a2345++){var _0x28e7b6=events[_0x5a2345];var _0x379cfb=createListener(_0x3db1('0x6')+_0x28e7b6,_0x342b84);OpenchannelAccountEvents['on'](_0x28e7b6,_0x379cfb);}};
\ No newline at end of file
+var _0x4b07=['remove','emit','save'];(function(_0x55ae99,_0x5ab789){var _0x4297e1=function(_0x33ee69){while(--_0x33ee69){_0x55ae99['push'](_0x55ae99['shift']());}};_0x4297e1(++_0x5ab789);}(_0x4b07,0x1d6));var _0x74b0=function(_0x87b34f,_0x3390d5){_0x87b34f=_0x87b34f-0x0;var _0x3a8dc2=_0x4b07[_0x87b34f];return _0x3a8dc2;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x74b0('0x0'),_0x74b0('0x1'),'update'];function createListener(_0x19ddd4,_0x273cce){return function(_0x3d0aaf){_0x273cce[_0x74b0('0x2')](_0x19ddd4,_0x3d0aaf);};}function removeListener(_0x5ed154,_0x397b2a){return function(){OpenchannelAccountEvents['removeListener'](_0x5ed154,_0x397b2a);};}exports['register']=function(_0x49713c){for(var _0x42e551=0x0,_0x459c2d=events['length'];_0x42e551<_0x459c2d;_0x42e551++){var _0x5ea430=events[_0x42e551];var _0x45183d=createListener('openchannelAccount:'+_0x5ea430,_0x49713c);OpenchannelAccountEvents['on'](_0x5ea430,_0x45183d);}};
\ No newline at end of file
index f172167..dde1e2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05ce=['fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x05ce,0x1d0));var _0xe05c=function(_0x1ea467,_0x56ff82){_0x1ea467=_0x1ea467-0x0;var _0x573032=_0x05ce[_0x1ea467];return _0x573032;};'use strict';var multer=require(_0xe05c('0x0'));var util=require(_0xe05c('0x1'));var path=require('path');var timeout=require(_0xe05c('0x2'));var express=require(_0xe05c('0x3'));var router=express['Router']();var fs_extra=require(_0xe05c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe05c('0x5'));var config=require(_0xe05c('0x6'));var controller=require(_0xe05c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe05c('0x8')]);router['get'](_0xe05c('0x9'),auth[_0xe05c('0xa')](),controller[_0xe05c('0xb')]);router['post']('/',auth[_0xe05c('0xa')](),controller[_0xe05c('0xc')]);router[_0xe05c('0xd')]('/:id',auth[_0xe05c('0xa')](),controller[_0xe05c('0xe')]);router[_0xe05c('0xf')]('/:id',auth[_0xe05c('0xa')](),controller[_0xe05c('0x10')]);module[_0xe05c('0x11')]=router;
\ No newline at end of file
+var _0x2a3e=['/:id','create','put','update','delete','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','index','get'];(function(_0x431db6,_0x39e17b){var _0x34674e=function(_0x5d146f){while(--_0x5d146f){_0x431db6['push'](_0x431db6['shift']());}};_0x34674e(++_0x39e17b);}(_0x2a3e,0x17c));var _0xe2a3=function(_0x9cc4e7,_0x20f89d){_0x9cc4e7=_0x9cc4e7-0x0;var _0x238dbd=_0x2a3e[_0x9cc4e7];return _0x238dbd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe2a3('0x0'));var timeout=require('connect-timeout');var express=require(_0xe2a3('0x1'));var router=express[_0xe2a3('0x2')]();var fs_extra=require(_0xe2a3('0x3'));var auth=require(_0xe2a3('0x4'));var interaction=require(_0xe2a3('0x5'));var config=require(_0xe2a3('0x6'));var controller=require(_0xe2a3('0x7'));router['get']('/',auth[_0xe2a3('0x8')](),controller[_0xe2a3('0x9')]);router[_0xe2a3('0xa')](_0xe2a3('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xe2a3('0x8')](),controller[_0xe2a3('0xc')]);router[_0xe2a3('0xd')]('/:id',auth[_0xe2a3('0x8')](),controller[_0xe2a3('0xe')]);router[_0xe2a3('0xf')]('/:id',auth[_0xe2a3('0x8')](),controller['destroy']);module[_0xe2a3('0x10')]=router;
\ No newline at end of file
index f938e9c..3a32b45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5250=['*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x399b24,_0x2d6c6a){var _0x5971c7=function(_0x268fa7){while(--_0x268fa7){_0x399b24['push'](_0x399b24['shift']());}};_0x5971c7(++_0x2d6c6a);}(_0x5250,0x10f));var _0x0525=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x5250[_0x307d86];return _0x361745;};'use strict';var Sequelize=require(_0x0525('0x0'));module[_0x0525('0x1')]={'priority':{'type':Sequelize[_0x0525('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0525('0x3')],'defaultValue':_0x0525('0x4')}};
\ No newline at end of file
+var _0xa093=['STRING','noop','sequelize','exports'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xa093,0x10a));var _0x3a09=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa093[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3a09('0x0'));module[_0x3a09('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3a09('0x2')],'allowNull':![],'defaultValue':_0x3a09('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x3a09('0x2')]},'interval':{'type':Sequelize[_0x3a09('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 7627075..a24be66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e6a=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','OpenchannelApplication','includeAll','findAll','rows','catch','show','params','include','create','body'];(function(_0x163a19,_0x325bb5){var _0xe11359=function(_0x5e345b){while(--_0x5e345b){_0x163a19['push'](_0x163a19['shift']());}};_0xe11359(++_0x325bb5);}(_0x7e6a,0x1ce));var _0xa7e6=function(_0x195904,_0x1c2373){_0x195904=_0x195904-0x0;var _0x36921c=_0x7e6a[_0x195904];return _0x36921c;};'use strict';var emlformat=require(_0xa7e6('0x0'));var rimraf=require(_0xa7e6('0x1'));var zipdir=require(_0xa7e6('0x2'));var jsonpatch=require(_0xa7e6('0x3'));var rp=require(_0xa7e6('0x4'));var moment=require(_0xa7e6('0x5'));var BPromise=require(_0xa7e6('0x6'));var Mustache=require(_0xa7e6('0x7'));var util=require(_0xa7e6('0x8'));var path=require('path');var sox=require(_0xa7e6('0x9'));var csv=require(_0xa7e6('0xa'));var ejs=require(_0xa7e6('0xb'));var fs=require('fs');var fs_extra=require(_0xa7e6('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa7e6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa7e6('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa7e6('0xf'));var Papa=require(_0xa7e6('0x10'));var Redis=require(_0xa7e6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa7e6('0x12'));var as=require(_0xa7e6('0x13'));var hardwareService=require(_0xa7e6('0x14'));var logger=require(_0xa7e6('0x15'))(_0xa7e6('0x16'));var utils=require(_0xa7e6('0x17'));var config=require(_0xa7e6('0x18'));var licenseUtil=require(_0xa7e6('0x19'));var db=require(_0xa7e6('0x1a'))['db'];function respondWithStatusCode(_0x3b3b81,_0x45dfb9){_0x45dfb9=_0x45dfb9||0xcc;return function(_0x4d5cfe){if(_0x4d5cfe){return _0x3b3b81['sendStatus'](_0x45dfb9);}return _0x3b3b81['status'](_0x45dfb9)['end']();};}function respondWithResult(_0x49e07d,_0x1f7ae2){_0x1f7ae2=_0x1f7ae2||0xc8;return function(_0x1211d3){if(_0x1211d3){return _0x49e07d[_0xa7e6('0x1b')](_0x1f7ae2)[_0xa7e6('0x1c')](_0x1211d3);}};}function respondWithFilteredResult(_0x32636c,_0x5566d7){return function(_0x33abad){if(_0x33abad){var _0x3b7dd8=typeof _0x5566d7['offset']===_0xa7e6('0x1d')&&typeof _0x5566d7[_0xa7e6('0x1e')]==='undefined';var _0x501c3b=_0x33abad[_0xa7e6('0x1f')];var _0x478cd2=_0x3b7dd8?0x0:_0x5566d7['offset'];var _0x56ce2b=_0x3b7dd8?_0x33abad[_0xa7e6('0x1f')]:_0x5566d7[_0xa7e6('0x20')]+_0x5566d7[_0xa7e6('0x1e')];var _0x349d63;if(_0x56ce2b>=_0x501c3b){_0x56ce2b=_0x501c3b;_0x349d63=0xc8;}else{_0x349d63=0xce;}_0x32636c[_0xa7e6('0x1b')](_0x349d63);return _0x32636c['set'](_0xa7e6('0x21'),_0x478cd2+'-'+_0x56ce2b+'/'+_0x501c3b)['json'](_0x33abad);}return null;};}function patchUpdates(_0x463d56){return function(_0x3b52a1){try{jsonpatch[_0xa7e6('0x22')](_0x3b52a1,_0x463d56,!![]);}catch(_0x184dc5){return BPromise[_0xa7e6('0x23')](_0x184dc5);}return _0x3b52a1[_0xa7e6('0x24')]();};}function saveUpdates(_0x216560,_0x598308){return function(_0x1ce102){if(_0x1ce102){return _0x1ce102[_0xa7e6('0x25')](_0x216560)[_0xa7e6('0x26')](function(_0x22ae49){return _0x22ae49;});}return null;};}function removeEntity(_0x28e1c2,_0x1fb0d2){return function(_0x249701){if(_0x249701){return _0x249701[_0xa7e6('0x27')]()[_0xa7e6('0x26')](function(){_0x28e1c2[_0xa7e6('0x1b')](0xcc)[_0xa7e6('0x28')]();});}};}function handleEntityNotFound(_0x39f941,_0x31b5a7){return function(_0x5163e9){if(!_0x5163e9){_0x39f941[_0xa7e6('0x29')](0x194);}return _0x5163e9;};}function handleError(_0x53e8cf,_0x43dc20){_0x43dc20=_0x43dc20||0x1f4;return function(_0x473c12){logger[_0xa7e6('0x2a')](_0x473c12[_0xa7e6('0x2b')]);if(_0x473c12[_0xa7e6('0x2c')]){delete _0x473c12['name'];}_0x53e8cf['status'](_0x43dc20)[_0xa7e6('0x2d')](_0x473c12);};}exports[_0xa7e6('0x2e')]=function(_0x52be3b,_0x40ef39){var _0x5a0cbb={},_0x53c7c6={},_0x46a8ab={'count':0x0,'rows':[]};var _0x37ee49=_[_0xa7e6('0x2f')](db['OpenchannelApplication'][_0xa7e6('0x30')],function(_0xf79e64){return{'name':_0xf79e64[_0xa7e6('0x31')],'type':_0xf79e64[_0xa7e6('0x32')]['key']};});_0x53c7c6[_0xa7e6('0x33')]=_[_0xa7e6('0x2f')](_0x37ee49,_0xa7e6('0x2c'));_0x53c7c6[_0xa7e6('0x34')]=_[_0xa7e6('0x35')](_0x52be3b['query']);_0x53c7c6[_0xa7e6('0x36')]=_[_0xa7e6('0x37')](_0x53c7c6['model'],_0x53c7c6[_0xa7e6('0x34')]);_0x5a0cbb[_0xa7e6('0x38')]=_[_0xa7e6('0x37')](_0x53c7c6['model'],qs[_0xa7e6('0x39')](_0x52be3b[_0xa7e6('0x34')][_0xa7e6('0x39')]));_0x5a0cbb[_0xa7e6('0x38')]=_0x5a0cbb[_0xa7e6('0x38')][_0xa7e6('0x3a')]?_0x5a0cbb[_0xa7e6('0x38')]:_0x53c7c6[_0xa7e6('0x33')];if(!_0x52be3b[_0xa7e6('0x34')]['hasOwnProperty'](_0xa7e6('0x3b'))){_0x5a0cbb['limit']=qs[_0xa7e6('0x1e')](_0x52be3b[_0xa7e6('0x34')][_0xa7e6('0x1e')]);_0x5a0cbb[_0xa7e6('0x20')]=qs[_0xa7e6('0x20')](_0x52be3b[_0xa7e6('0x34')][_0xa7e6('0x20')]);}_0x5a0cbb['order']=qs[_0xa7e6('0x3c')](_0x52be3b[_0xa7e6('0x34')]['sort']);_0x5a0cbb[_0xa7e6('0x3d')]=qs[_0xa7e6('0x36')](_[_0xa7e6('0x3e')](_0x52be3b[_0xa7e6('0x34')],_0x53c7c6[_0xa7e6('0x36')]),_0x37ee49);if(_0x52be3b[_0xa7e6('0x34')]['filter']){_0x5a0cbb['where']=_[_0xa7e6('0x3f')](_0x5a0cbb[_0xa7e6('0x3d')],{'$or':_[_0xa7e6('0x2f')](_0x37ee49,function(_0x366e37){if(_0x366e37[_0xa7e6('0x32')]!==_0xa7e6('0x40')){var _0x50e679={};_0x50e679[_0x366e37['name']]={'$like':'%'+_0x52be3b['query'][_0xa7e6('0x41')]+'%'};return _0x50e679;}})});}_0x5a0cbb=_[_0xa7e6('0x3f')]({},_0x5a0cbb,_0x52be3b[_0xa7e6('0x42')]);var _0x18cfaf={'where':_0x5a0cbb[_0xa7e6('0x3d')]};return db[_0xa7e6('0x43')]['count'](_0x18cfaf)[_0xa7e6('0x26')](function(_0x5d7f65){_0x46a8ab['count']=_0x5d7f65;if(_0x52be3b[_0xa7e6('0x34')][_0xa7e6('0x44')]){_0x5a0cbb['include']=[{'all':!![]}];}return db[_0xa7e6('0x43')][_0xa7e6('0x45')](_0x5a0cbb);})[_0xa7e6('0x26')](function(_0x21e893){_0x46a8ab[_0xa7e6('0x46')]=_0x21e893;return _0x46a8ab;})[_0xa7e6('0x26')](respondWithFilteredResult(_0x40ef39,_0x5a0cbb))[_0xa7e6('0x47')](handleError(_0x40ef39,null));};exports[_0xa7e6('0x48')]=function(_0x42dbe3,_0x396b99){var _0x4a8385={'raw':!![],'where':{'id':_0x42dbe3[_0xa7e6('0x49')]['id']}},_0x1ec5cf={};_0x1ec5cf[_0xa7e6('0x33')]=_['keys'](db[_0xa7e6('0x43')][_0xa7e6('0x30')]);_0x1ec5cf['query']=_[_0xa7e6('0x35')](_0x42dbe3[_0xa7e6('0x34')]);_0x1ec5cf[_0xa7e6('0x36')]=_[_0xa7e6('0x37')](_0x1ec5cf[_0xa7e6('0x33')],_0x1ec5cf['query']);_0x4a8385['attributes']=_[_0xa7e6('0x37')](_0x1ec5cf[_0xa7e6('0x33')],qs[_0xa7e6('0x39')](_0x42dbe3['query']['fields']));_0x4a8385[_0xa7e6('0x38')]=_0x4a8385[_0xa7e6('0x38')]['length']?_0x4a8385['attributes']:_0x1ec5cf[_0xa7e6('0x33')];if(_0x42dbe3[_0xa7e6('0x34')][_0xa7e6('0x44')]){_0x4a8385[_0xa7e6('0x4a')]=[{'all':!![]}];}_0x4a8385=_[_0xa7e6('0x3f')]({},_0x4a8385,_0x42dbe3[_0xa7e6('0x42')]);return db['OpenchannelApplication']['find'](_0x4a8385)['then'](handleEntityNotFound(_0x396b99,null))[_0xa7e6('0x26')](respondWithResult(_0x396b99,null))['catch'](handleError(_0x396b99,null));};exports[_0xa7e6('0x4b')]=function(_0xdba2f1,_0x4bb3d5){return db[_0xa7e6('0x43')][_0xa7e6('0x4b')](_0xdba2f1[_0xa7e6('0x4c')],{})[_0xa7e6('0x26')](respondWithResult(_0x4bb3d5,0xc9))[_0xa7e6('0x47')](handleError(_0x4bb3d5,null));};exports[_0xa7e6('0x25')]=function(_0x1cbbc0,_0x2971be){if(_0x1cbbc0[_0xa7e6('0x4c')]['id']){delete _0x1cbbc0['body']['id'];}return db['OpenchannelApplication']['find']({'where':{'id':_0x1cbbc0[_0xa7e6('0x49')]['id']}})[_0xa7e6('0x26')](handleEntityNotFound(_0x2971be,null))[_0xa7e6('0x26')](saveUpdates(_0x1cbbc0[_0xa7e6('0x4c')],null))[_0xa7e6('0x26')](respondWithResult(_0x2971be,null))['catch'](handleError(_0x2971be,null));};exports[_0xa7e6('0x27')]=function(_0x54a722,_0x6149d9){return db[_0xa7e6('0x43')]['find']({'where':{'id':_0x54a722[_0xa7e6('0x49')]['id']}})[_0xa7e6('0x26')](handleEntityNotFound(_0x6149d9,null))[_0xa7e6('0x26')](removeEntity(_0x6149d9,null))[_0xa7e6('0x47')](handleError(_0x6149d9,null));};
\ No newline at end of file
+var _0x0bb3=['key','map','name','keys','query','filters','model','intersection','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','findAll','rows','show','include','find','catch','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','send','index','OpenchannelApplication','rawAttributes'];(function(_0x56c13e,_0x130de5){var _0x5809c3=function(_0x5b0048){while(--_0x5b0048){_0x56c13e['push'](_0x56c13e['shift']());}};_0x5809c3(++_0x130de5);}(_0x0bb3,0x1d2));var _0x30bb=function(_0x2f71f6,_0x3a1f4d){_0x2f71f6=_0x2f71f6-0x0;var _0x2b23ea=_0x0bb3[_0x2f71f6];return _0x2b23ea;};'use strict';var emlformat=require(_0x30bb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x30bb('0x1'));var jsonpatch=require(_0x30bb('0x2'));var rp=require(_0x30bb('0x3'));var moment=require(_0x30bb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x30bb('0x5'));var util=require(_0x30bb('0x6'));var path=require(_0x30bb('0x7'));var sox=require(_0x30bb('0x8'));var csv=require(_0x30bb('0x9'));var ejs=require(_0x30bb('0xa'));var fs=require('fs');var fs_extra=require(_0x30bb('0xb'));var _=require(_0x30bb('0xc'));var squel=require(_0x30bb('0xd'));var crypto=require('crypto');var jsforce=require(_0x30bb('0xe'));var deskjs=require(_0x30bb('0xf'));var toCsv=require(_0x30bb('0x9'));var querystring=require(_0x30bb('0x10'));var Papa=require('papaparse');var Redis=require(_0x30bb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x30bb('0x12'));var as=require(_0x30bb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x30bb('0x14'))(_0x30bb('0x15'));var utils=require(_0x30bb('0x16'));var config=require(_0x30bb('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x990fff,_0x5c9e56){_0x5c9e56=_0x5c9e56||0xcc;return function(_0x1df730){if(_0x1df730){return _0x990fff[_0x30bb('0x18')](_0x5c9e56);}return _0x990fff[_0x30bb('0x19')](_0x5c9e56)['end']();};}function respondWithResult(_0x3a72be,_0x42a2b0){_0x42a2b0=_0x42a2b0||0xc8;return function(_0x1b8011){if(_0x1b8011){return _0x3a72be[_0x30bb('0x19')](_0x42a2b0)[_0x30bb('0x1a')](_0x1b8011);}};}function respondWithFilteredResult(_0x531468,_0x238f24){return function(_0x5f5d9f){if(_0x5f5d9f){var _0x4c7b4d=typeof _0x238f24[_0x30bb('0x1b')]===_0x30bb('0x1c')&&typeof _0x238f24[_0x30bb('0x1d')]===_0x30bb('0x1c');var _0xc15494=_0x5f5d9f[_0x30bb('0x1e')];var _0x38f14b=_0x4c7b4d?0x0:_0x238f24[_0x30bb('0x1b')];var _0x273398=_0x4c7b4d?_0x5f5d9f[_0x30bb('0x1e')]:_0x238f24[_0x30bb('0x1b')]+_0x238f24[_0x30bb('0x1d')];var _0x359015;if(_0x273398>=_0xc15494){_0x273398=_0xc15494;_0x359015=0xc8;}else{_0x359015=0xce;}_0x531468['status'](_0x359015);return _0x531468[_0x30bb('0x1f')](_0x30bb('0x20'),_0x38f14b+'-'+_0x273398+'/'+_0xc15494)[_0x30bb('0x1a')](_0x5f5d9f);}return null;};}function patchUpdates(_0x236dcb){return function(_0x49dbf7){try{jsonpatch['apply'](_0x49dbf7,_0x236dcb,!![]);}catch(_0x7a3906){return BPromise[_0x30bb('0x21')](_0x7a3906);}return _0x49dbf7[_0x30bb('0x22')]();};}function saveUpdates(_0x585f10,_0x17baee){return function(_0x1fbf12){if(_0x1fbf12){return _0x1fbf12[_0x30bb('0x23')](_0x585f10)[_0x30bb('0x24')](function(_0x5110c8){return _0x5110c8;});}return null;};}function removeEntity(_0x2c08a1,_0x4c0a61){return function(_0x2c832a){if(_0x2c832a){return _0x2c832a[_0x30bb('0x25')]()['then'](function(){_0x2c08a1[_0x30bb('0x19')](0xcc)[_0x30bb('0x26')]();});}};}function handleEntityNotFound(_0x4a43c1,_0xa25d69){return function(_0x42fcb3){if(!_0x42fcb3){_0x4a43c1[_0x30bb('0x18')](0x194);}return _0x42fcb3;};}function handleError(_0x371306,_0x25fa92){_0x25fa92=_0x25fa92||0x1f4;return function(_0x399d80){logger[_0x30bb('0x27')](_0x399d80[_0x30bb('0x28')]);if(_0x399d80['name']){delete _0x399d80['name'];}_0x371306[_0x30bb('0x19')](_0x25fa92)[_0x30bb('0x29')](_0x399d80);};}exports[_0x30bb('0x2a')]=function(_0x21e7c2,_0x2d7a5a){var _0x192f6e={},_0x99eb17={},_0x4b5046={'count':0x0,'rows':[]};var _0x1b1fa3=_['map'](db[_0x30bb('0x2b')][_0x30bb('0x2c')],function(_0x3fb92e){return{'name':_0x3fb92e['fieldName'],'type':_0x3fb92e['type'][_0x30bb('0x2d')]};});_0x99eb17['model']=_[_0x30bb('0x2e')](_0x1b1fa3,_0x30bb('0x2f'));_0x99eb17['query']=_[_0x30bb('0x30')](_0x21e7c2[_0x30bb('0x31')]);_0x99eb17[_0x30bb('0x32')]=_['intersection'](_0x99eb17[_0x30bb('0x33')],_0x99eb17[_0x30bb('0x31')]);_0x192f6e['attributes']=_[_0x30bb('0x34')](_0x99eb17['model'],qs[_0x30bb('0x35')](_0x21e7c2[_0x30bb('0x31')][_0x30bb('0x35')]));_0x192f6e[_0x30bb('0x36')]=_0x192f6e[_0x30bb('0x36')][_0x30bb('0x37')]?_0x192f6e['attributes']:_0x99eb17[_0x30bb('0x33')];if(!_0x21e7c2['query']['hasOwnProperty'](_0x30bb('0x38'))){_0x192f6e['limit']=qs['limit'](_0x21e7c2[_0x30bb('0x31')][_0x30bb('0x1d')]);_0x192f6e[_0x30bb('0x1b')]=qs[_0x30bb('0x1b')](_0x21e7c2['query'][_0x30bb('0x1b')]);}_0x192f6e[_0x30bb('0x39')]=qs['sort'](_0x21e7c2[_0x30bb('0x31')][_0x30bb('0x3a')]);_0x192f6e[_0x30bb('0x3b')]=qs[_0x30bb('0x32')](_['pick'](_0x21e7c2['query'],_0x99eb17[_0x30bb('0x32')]),_0x1b1fa3);if(_0x21e7c2[_0x30bb('0x31')]['filter']){_0x192f6e[_0x30bb('0x3b')]=_[_0x30bb('0x3c')](_0x192f6e[_0x30bb('0x3b')],{'$or':_[_0x30bb('0x2e')](_0x1b1fa3,function(_0x4e8adb){if(_0x4e8adb['type']!==_0x30bb('0x3d')){var _0x4ce5b7={};_0x4ce5b7[_0x4e8adb[_0x30bb('0x2f')]]={'$like':'%'+_0x21e7c2[_0x30bb('0x31')][_0x30bb('0x3e')]+'%'};return _0x4ce5b7;}})});}_0x192f6e=_[_0x30bb('0x3c')]({},_0x192f6e,_0x21e7c2[_0x30bb('0x3f')]);var _0x3c421f={'where':_0x192f6e[_0x30bb('0x3b')]};return db['OpenchannelApplication'][_0x30bb('0x1e')](_0x3c421f)['then'](function(_0x2ecda2){_0x4b5046[_0x30bb('0x1e')]=_0x2ecda2;if(_0x21e7c2[_0x30bb('0x31')]['includeAll']){_0x192f6e['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0x30bb('0x40')](_0x192f6e);})['then'](function(_0x21aa37){_0x4b5046[_0x30bb('0x41')]=_0x21aa37;return _0x4b5046;})[_0x30bb('0x24')](respondWithFilteredResult(_0x2d7a5a,_0x192f6e))['catch'](handleError(_0x2d7a5a,null));};exports[_0x30bb('0x42')]=function(_0x543467,_0x5ec5ac){var _0x5d9b61={'raw':!![],'where':{'id':_0x543467['params']['id']}},_0x31d3c4={};_0x31d3c4[_0x30bb('0x33')]=_['keys'](db[_0x30bb('0x2b')][_0x30bb('0x2c')]);_0x31d3c4['query']=_[_0x30bb('0x30')](_0x543467['query']);_0x31d3c4[_0x30bb('0x32')]=_['intersection'](_0x31d3c4['model'],_0x31d3c4[_0x30bb('0x31')]);_0x5d9b61['attributes']=_[_0x30bb('0x34')](_0x31d3c4[_0x30bb('0x33')],qs[_0x30bb('0x35')](_0x543467[_0x30bb('0x31')][_0x30bb('0x35')]));_0x5d9b61[_0x30bb('0x36')]=_0x5d9b61['attributes'][_0x30bb('0x37')]?_0x5d9b61[_0x30bb('0x36')]:_0x31d3c4[_0x30bb('0x33')];if(_0x543467[_0x30bb('0x31')]['includeAll']){_0x5d9b61[_0x30bb('0x43')]=[{'all':!![]}];}_0x5d9b61=_[_0x30bb('0x3c')]({},_0x5d9b61,_0x543467[_0x30bb('0x3f')]);return db[_0x30bb('0x2b')][_0x30bb('0x44')](_0x5d9b61)['then'](handleEntityNotFound(_0x5ec5ac,null))[_0x30bb('0x24')](respondWithResult(_0x5ec5ac,null))[_0x30bb('0x45')](handleError(_0x5ec5ac,null));};exports[_0x30bb('0x46')]=function(_0x49ebd6,_0x15f74c){return db[_0x30bb('0x2b')][_0x30bb('0x46')](_0x49ebd6[_0x30bb('0x47')],{})[_0x30bb('0x24')](respondWithResult(_0x15f74c,0xc9))['catch'](handleError(_0x15f74c,null));};exports[_0x30bb('0x23')]=function(_0x1cb94e,_0x5e8110){if(_0x1cb94e[_0x30bb('0x47')]['id']){delete _0x1cb94e[_0x30bb('0x47')]['id'];}return db[_0x30bb('0x2b')][_0x30bb('0x44')]({'where':{'id':_0x1cb94e[_0x30bb('0x48')]['id']}})['then'](handleEntityNotFound(_0x5e8110,null))[_0x30bb('0x24')](saveUpdates(_0x1cb94e[_0x30bb('0x47')],null))[_0x30bb('0x24')](respondWithResult(_0x5e8110,null))[_0x30bb('0x45')](handleError(_0x5e8110,null));};exports[_0x30bb('0x25')]=function(_0x52e5d0,_0x458d33){return db[_0x30bb('0x2b')][_0x30bb('0x44')]({'where':{'id':_0x52e5d0[_0x30bb('0x48')]['id']}})[_0x30bb('0x24')](handleEntityNotFound(_0x458d33,null))[_0x30bb('0x24')](removeEntity(_0x458d33,null))['catch'](handleError(_0x458d33,null));};
\ No newline at end of file
index c1646e7..bbea6c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d53=['api','moment','rimraf','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x7e201,_0x3efc32){var _0x1c988e=function(_0x3bb303){while(--_0x3bb303){_0x7e201['push'](_0x7e201['shift']());}};_0x1c988e(++_0x3efc32);}(_0x7d53,0x183));var _0x37d5=function(_0x9dcbcc,_0x30c847){_0x9dcbcc=_0x9dcbcc-0x0;var _0x3b0152=_0x7d53[_0x9dcbcc];return _0x3b0152;};'use strict';var _=require(_0x37d5('0x0'));var util=require(_0x37d5('0x1'));var logger=require(_0x37d5('0x2'))(_0x37d5('0x3'));var moment=require(_0x37d5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x37d5('0x5'));var config=require('../../config/environment');var attributes=require(_0x37d5('0x6'));module[_0x37d5('0x7')]=function(_0x253d27,_0x676425){return _0x253d27[_0x37d5('0x8')](_0x37d5('0x9'),attributes,{'tableName':_0x37d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x37d5('0xb'),'collate':_0x37d5('0xc')});};
\ No newline at end of file
+var _0x9731=['utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication'];(function(_0x188e74,_0x44c6ed){var _0x2cce2a=function(_0x354f1e){while(--_0x354f1e){_0x188e74['push'](_0x188e74['shift']());}};_0x2cce2a(++_0x44c6ed);}(_0x9731,0x12d));var _0x1973=function(_0x400917,_0x521828){_0x400917=_0x400917-0x0;var _0x45005c=_0x9731[_0x400917];return _0x45005c;};'use strict';var _=require(_0x1973('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1973('0x1'));var moment=require(_0x1973('0x2'));var BPromise=require(_0x1973('0x3'));var rp=require(_0x1973('0x4'));var fs=require('fs');var path=require(_0x1973('0x5'));var rimraf=require(_0x1973('0x6'));var config=require(_0x1973('0x7'));var attributes=require(_0x1973('0x8'));module['exports']=function(_0x472050,_0x5483e2){return _0x472050[_0x1973('0x9')](_0x1973('0xa'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1973('0xb'),'collate':_0x1973('0xc')});};
\ No newline at end of file
index 0c4ff54..46e62d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa44d=['message','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','attributes','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0xd2f43f,_0x14e269){var _0xdefbd7=function(_0x20a940){while(--_0x20a940){_0xd2f43f['push'](_0xd2f43f['shift']());}};_0xdefbd7(++_0x14e269);}(_0xa44d,0x1ef));var _0xda44=function(_0x35b7d4,_0x5a5c43){_0x35b7d4=_0x35b7d4-0x0;var _0x4e8cee=_0xa44d[_0x35b7d4];return _0x4e8cee;};'use strict';var _=require('lodash');var util=require(_0xda44('0x0'));var moment=require(_0xda44('0x1'));var BPromise=require('bluebird');var rs=require(_0xda44('0x2'));var fs=require('fs');var Redis=require(_0xda44('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xda44('0x4'));var logger=require(_0xda44('0x5'))(_0xda44('0x6'));var config=require(_0xda44('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xda44('0x8')][_0xda44('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e3c18,_0x343c4c,_0x3a0707){return new BPromise(function(_0x2eae39,_0x427188){return client['request'](_0x1e3c18,_0x3a0707)[_0xda44('0xa')](function(_0x2d6447){logger[_0xda44('0xb')](_0xda44('0xc'),_0x343c4c,_0xda44('0xd'));logger[_0xda44('0xe')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x343c4c,'request\x20sent',JSON[_0xda44('0xf')](_0x2d6447));if(_0x2d6447[_0xda44('0x10')]){if(_0x2d6447['error'][_0xda44('0x11')]===0x1f4){logger[_0xda44('0x10')](_0xda44('0xc'),_0x343c4c,_0x2d6447['error'][_0xda44('0x12')]);return _0x427188(_0x2d6447[_0xda44('0x10')]['message']);}logger[_0xda44('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x343c4c,_0x2d6447[_0xda44('0x10')][_0xda44('0x12')]);return _0x2eae39(_0x2d6447[_0xda44('0x10')][_0xda44('0x12')]);}else{logger[_0xda44('0xb')](_0xda44('0xc'),_0x343c4c,_0xda44('0xd'));_0x2eae39(_0x2d6447['result'][_0xda44('0x12')]);}})[_0xda44('0x13')](function(_0x5c07e9){logger[_0xda44('0x10')](_0xda44('0xc'),_0x343c4c,_0x5c07e9);_0x427188(_0x5c07e9);});});}exports[_0xda44('0x14')]=function(_0x45922a){var _0x619ace=this;return new Promise(function(_0x314925,_0x47dcbc){return db[_0xda44('0x15')][_0xda44('0x16')](_0x45922a[_0xda44('0x17')],{'raw':_0x45922a['options']?_0x45922a[_0xda44('0x18')][_0xda44('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45922a[_0xda44('0x18')]?_0x45922a['options']['where']||null:null,'attributes':_0x45922a['options']?_0x45922a[_0xda44('0x18')][_0xda44('0x1a')]||null:null,'limit':_0x45922a['options']?_0x45922a[_0xda44('0x18')]['limit']||null:null})[_0xda44('0xa')](function(_0x306d3e){logger[_0xda44('0xb')](_0xda44('0x14'),_0x45922a);logger['debug']('UpdateOpenchannelApplication',_0x45922a,JSON['stringify'](_0x306d3e));_0x314925(_0x306d3e);})[_0xda44('0x13')](function(_0x286bdc){logger[_0xda44('0x10')](_0xda44('0x14'),_0x286bdc['message'],_0x45922a);_0x47dcbc(_0x619ace[_0xda44('0x10')](0x1f4,_0x286bdc[_0xda44('0x12')]));});});};
\ No newline at end of file
+var _0xbe63=['info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe63,0x114));var _0x3be6=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0xbe63[_0x46f1a6];return _0x38429a;};'use strict';var _=require(_0x3be6('0x0'));var util=require('util');var moment=require(_0x3be6('0x1'));var BPromise=require('bluebird');var rs=require(_0x3be6('0x2'));var fs=require('fs');var Redis=require(_0x3be6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3be6('0x4'));var logger=require('../../config/logger')(_0x3be6('0x5'));var config=require(_0x3be6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3be6('0x7')][_0x3be6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x109483,_0xfc447c,_0x42bd81){return new BPromise(function(_0x5dec55,_0x1c41a3){return client[_0x3be6('0x9')](_0x109483,_0x42bd81)['then'](function(_0x4ada36){logger[_0x3be6('0xa')](_0x3be6('0xb'),_0xfc447c,_0x3be6('0xc'));logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0xfc447c,_0x3be6('0xc'),JSON[_0x3be6('0xd')](_0x4ada36));if(_0x4ada36[_0x3be6('0xe')]){if(_0x4ada36[_0x3be6('0xe')][_0x3be6('0xf')]===0x1f4){logger[_0x3be6('0xe')](_0x3be6('0xb'),_0xfc447c,_0x4ada36['error'][_0x3be6('0x10')]);return _0x1c41a3(_0x4ada36[_0x3be6('0xe')][_0x3be6('0x10')]);}logger[_0x3be6('0xe')](_0x3be6('0xb'),_0xfc447c,_0x4ada36['error'][_0x3be6('0x10')]);return _0x5dec55(_0x4ada36['error'][_0x3be6('0x10')]);}else{logger[_0x3be6('0xa')]('OpenchannelApplication,\x20%s,\x20%s',_0xfc447c,_0x3be6('0xc'));_0x5dec55(_0x4ada36[_0x3be6('0x11')][_0x3be6('0x10')]);}})[_0x3be6('0x12')](function(_0x518bbb){logger[_0x3be6('0xe')](_0x3be6('0xb'),_0xfc447c,_0x518bbb);_0x1c41a3(_0x518bbb);});});}exports[_0x3be6('0x13')]=function(_0x1b2f42){var _0x20d954=this;return new Promise(function(_0x3c8b91,_0x2e5d08){return db[_0x3be6('0x14')][_0x3be6('0x15')](_0x1b2f42[_0x3be6('0x16')],{'raw':_0x1b2f42[_0x3be6('0x17')]?_0x1b2f42[_0x3be6('0x17')][_0x3be6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b2f42['options']?_0x1b2f42[_0x3be6('0x17')][_0x3be6('0x19')]||null:null,'attributes':_0x1b2f42[_0x3be6('0x17')]?_0x1b2f42[_0x3be6('0x17')]['attributes']||null:null,'limit':_0x1b2f42['options']?_0x1b2f42[_0x3be6('0x17')]['limit']||null:null})['then'](function(_0x33abff){logger[_0x3be6('0xa')]('UpdateOpenchannelApplication',_0x1b2f42);logger['debug'](_0x3be6('0x13'),_0x1b2f42,JSON[_0x3be6('0xd')](_0x33abff));_0x3c8b91(_0x33abff);})[_0x3be6('0x12')](function(_0x212f2e){logger[_0x3be6('0xe')](_0x3be6('0x13'),_0x212f2e[_0x3be6('0x10')],_0x1b2f42);_0x2e5d08(_0x20d954[_0x3be6('0xe')](0x1f4,_0x212f2e[_0x3be6('0x10')]));});});};
\ No newline at end of file
index acac710..eb3b875 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbc8=['openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','openchannelinteraction:destroy','destroy','delete','removeTags','util','path','connect-timeout','fs-extra','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMessages','post','create','/:id/messages','addMessage','/:id/tags','tracked'];(function(_0x50b353,_0x425395){var _0x4758bc=function(_0x58c3d0){while(--_0x58c3d0){_0x50b353['push'](_0x50b353['shift']());}};_0x4758bc(++_0x425395);}(_0xbbc8,0x1c8));var _0x8bbc=function(_0x509ac8,_0x2e05c1){_0x509ac8=_0x509ac8-0x0;var _0x2cc4f3=_0xbbc8[_0x509ac8];return _0x2cc4f3;};'use strict';var multer=require('multer');var util=require(_0x8bbc('0x0'));var path=require(_0x8bbc('0x1'));var timeout=require(_0x8bbc('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8bbc('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8bbc('0x4'));var controller=require(_0x8bbc('0x5'));router[_0x8bbc('0x6')]('/',auth[_0x8bbc('0x7')](),controller[_0x8bbc('0x8')]);router[_0x8bbc('0x6')](_0x8bbc('0x9'),auth[_0x8bbc('0x7')](),controller[_0x8bbc('0xa')]);router[_0x8bbc('0x6')](_0x8bbc('0xb'),auth[_0x8bbc('0x7')](),controller[_0x8bbc('0xc')]);router['get']('/:id/messages',auth[_0x8bbc('0x7')](),controller[_0x8bbc('0xd')]);router['get']('/:id/download',auth[_0x8bbc('0x7')](),controller['download']);router[_0x8bbc('0xe')]('/',auth[_0x8bbc('0x7')](),controller[_0x8bbc('0xf')]);router[_0x8bbc('0xe')](_0x8bbc('0x10'),auth[_0x8bbc('0x7')](),controller[_0x8bbc('0x11')]);router[_0x8bbc('0xe')](_0x8bbc('0x12'),auth[_0x8bbc('0x7')](),interaction[_0x8bbc('0x13')](_0x8bbc('0x14'),_0x8bbc('0x15')),controller['addTags']);router[_0x8bbc('0x16')](_0x8bbc('0xb'),auth[_0x8bbc('0x7')](),interaction[_0x8bbc('0x13')](_0x8bbc('0x14'),_0x8bbc('0x17')),controller['update']);router['delete'](_0x8bbc('0xb'),auth[_0x8bbc('0x7')](),interaction[_0x8bbc('0x13')](_0x8bbc('0x14'),_0x8bbc('0x18')),controller[_0x8bbc('0x19')]);router[_0x8bbc('0x1a')](_0x8bbc('0x12'),auth[_0x8bbc('0x7')](),controller[_0x8bbc('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0xe6e3=['fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','/describe','describe','get','/:id','show','/:id/messages','getMessages','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','multer','util','connect-timeout','express'];(function(_0x35d2d6,_0x14e944){var _0x1637d5=function(_0x327b04){while(--_0x327b04){_0x35d2d6['push'](_0x35d2d6['shift']());}};_0x1637d5(++_0x14e944);}(_0xe6e3,0x6c));var _0x3e6e=function(_0x546aaf,_0x1ed138){_0x546aaf=_0x546aaf-0x0;var _0x1cbf6d=_0xe6e3[_0x546aaf];return _0x1cbf6d;};'use strict';var multer=require(_0x3e6e('0x0'));var util=require(_0x3e6e('0x1'));var path=require('path');var timeout=require(_0x3e6e('0x2'));var express=require(_0x3e6e('0x3'));var router=express['Router']();var fs_extra=require(_0x3e6e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3e6e('0x5'));var config=require(_0x3e6e('0x6'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth[_0x3e6e('0x7')](),controller['index']);router['get'](_0x3e6e('0x8'),auth[_0x3e6e('0x7')](),controller[_0x3e6e('0x9')]);router[_0x3e6e('0xa')](_0x3e6e('0xb'),auth[_0x3e6e('0x7')](),controller[_0x3e6e('0xc')]);router[_0x3e6e('0xa')](_0x3e6e('0xd'),auth['isAuthenticated'](),controller[_0x3e6e('0xe')]);router[_0x3e6e('0xa')]('/:id/download',auth[_0x3e6e('0x7')](),controller[_0x3e6e('0xf')]);router['post']('/',auth[_0x3e6e('0x7')](),controller['create']);router[_0x3e6e('0x10')](_0x3e6e('0xd'),auth[_0x3e6e('0x7')](),controller[_0x3e6e('0x11')]);router['post'](_0x3e6e('0x12'),auth['isAuthenticated'](),interaction[_0x3e6e('0x13')](_0x3e6e('0x14'),_0x3e6e('0x15')),controller[_0x3e6e('0x16')]);router[_0x3e6e('0x17')]('/:id',auth[_0x3e6e('0x7')](),interaction[_0x3e6e('0x13')]('openchannel',_0x3e6e('0x18')),controller[_0x3e6e('0x19')]);router[_0x3e6e('0x1a')](_0x3e6e('0xb'),auth['isAuthenticated'](),interaction['tracked']('openchannel',_0x3e6e('0x1b')),controller['destroy']);router[_0x3e6e('0x1a')](_0x3e6e('0x12'),auth[_0x3e6e('0x7')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
index d435f2b..39ff583 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e35=['DATE','ENUM','sequelize','exports','BOOLEAN','STRING'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2e35,0x1d0));var _0x52e3=function(_0x57f4ca,_0x58a248){_0x57f4ca=_0x57f4ca-0x0;var _0x3761b2=_0x2e35[_0x57f4ca];return _0x3761b2;};'use strict';var Sequelize=require(_0x52e3('0x0'));module[_0x52e3('0x1')]={'closed':{'type':Sequelize[_0x52e3('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x52e3('0x3')]},'secondDisposition':{'type':Sequelize[_0x52e3('0x3')]},'thirdDisposition':{'type':Sequelize[_0x52e3('0x3')]},'note':{'type':Sequelize[_0x52e3('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x52e3('0x3')]},'externalUrl':{'type':Sequelize[_0x52e3('0x3')]},'lastMsgAt':{'type':Sequelize[_0x52e3('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x52e3('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x52e3('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x593e=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x593e,0xcb));var _0xe593=function(_0xd891aa,_0x436efc){_0xd891aa=_0xd891aa-0x0;var _0x2f76e2=_0x593e[_0xd891aa];return _0x2f76e2;};'use strict';var Sequelize=require(_0xe593('0x0'));module[_0xe593('0x1')]={'closed':{'type':Sequelize[_0xe593('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe593('0x3')]},'disposition':{'type':Sequelize[_0xe593('0x4')]},'secondDisposition':{'type':Sequelize[_0xe593('0x4')]},'thirdDisposition':{'type':Sequelize[_0xe593('0x4')]},'note':{'type':Sequelize[_0xe593('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xe593('0x4')]},'externalUrl':{'type':Sequelize[_0xe593('0x4')]},'lastMsgAt':{'type':Sequelize[_0xe593('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xe593('0x5')]('in',_0xe593('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xe593('0x5')]('in',_0xe593('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xe593('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xe593('0x2')],'defaultValue':![]}};
\ No newline at end of file
index a7251b4..1a9a0ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e65=['\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','OpenchannelInteraction','a.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','OpenchannelInteractionId','show','params','includeAll','include','options','create','describe','addMessage','ids','omit','sort','pick','format','YYYY-MM-DD\x20HH:mm:ss','OpenchannelMessage','rows','addTags','setTags','findAll','emit','openchannelInteractionTags:save','removeTags','download','unix','join','server','files','root','lastName','attachments','Attachment','direction','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','disposition','threadId','Public','Private','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','System','firstName','secret','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','count','set','reject','save','update','then','destroy','error','stack','name','send','map','fullname','TagIds','Tags','split','forEach','push','catch','waiting','answered','unmanaged','closed','UserId','talking','total','index','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','where','select','field','color','from','tools_tags','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','keys','compact','isEmpty','OpenchannelAccountId','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null'];(function(_0x494721,_0x4babe3){var _0x5a00ca=function(_0x291b0a){while(--_0x291b0a){_0x494721['push'](_0x494721['shift']());}};_0x5a00ca(++_0x4babe3);}(_0x6e65,0x15d));var _0x56e6=function(_0x51a1e7,_0x54cc87){_0x51a1e7=_0x51a1e7-0x0;var _0x4980d2=_0x6e65[_0x51a1e7];return _0x4980d2;};'use strict';var emlformat=require(_0x56e6('0x0'));var rimraf=require(_0x56e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x56e6('0x2'));var moment=require(_0x56e6('0x3'));var BPromise=require(_0x56e6('0x4'));var Mustache=require(_0x56e6('0x5'));var util=require(_0x56e6('0x6'));var path=require('path');var sox=require(_0x56e6('0x7'));var csv=require(_0x56e6('0x8'));var ejs=require(_0x56e6('0x9'));var fs=require('fs');var fs_extra=require(_0x56e6('0xa'));var _=require('lodash');var squel=require(_0x56e6('0xb'));var crypto=require(_0x56e6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x56e6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x56e6('0xe'));var Papa=require(_0x56e6('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x56e6('0x10'));var as=require(_0x56e6('0x11'));var pdf=require(_0x56e6('0x12'));var hardwareService=require(_0x56e6('0x13'));var logger=require(_0x56e6('0x14'))('api');var utils=require(_0x56e6('0x15'));var config=require(_0x56e6('0x16'));var licenseUtil=require(_0x56e6('0x17'));var db=require(_0x56e6('0x18'))['db'];config[_0x56e6('0x19')]=_[_0x56e6('0x1a')](config[_0x56e6('0x19')],{'host':_0x56e6('0x1b'),'port':0x18eb});var socket=require(_0x56e6('0x1c'))(new Redis(config['redis']));require(_0x56e6('0x1d'))[_0x56e6('0x1e')](socket);function respondWithStatusCode(_0x5ccfbb,_0x289897){_0x289897=_0x289897||0xcc;return function(_0x11538f){if(_0x11538f){return _0x5ccfbb[_0x56e6('0x1f')](_0x289897);}return _0x5ccfbb[_0x56e6('0x20')](_0x289897)[_0x56e6('0x21')]();};}function respondWithResult(_0x1c9959,_0x3290d1){_0x3290d1=_0x3290d1||0xc8;return function(_0x5a8cd){if(_0x5a8cd){return _0x1c9959[_0x56e6('0x20')](_0x3290d1)[_0x56e6('0x22')](_0x5a8cd);}};}function respondWithFilteredResult(_0x36e374,_0x40ac24){return function(_0xcef612){if(_0xcef612){var _0x42428a=typeof _0x40ac24[_0x56e6('0x23')]==='undefined'&&typeof _0x40ac24['limit']==='undefined';var _0x19325a=_0xcef612[_0x56e6('0x24')];var _0x409d56=_0x42428a?0x0:_0x40ac24[_0x56e6('0x23')];var _0x13f3ac=_0x42428a?_0xcef612[_0x56e6('0x24')]:_0x40ac24[_0x56e6('0x23')]+_0x40ac24['limit'];var _0x4248b0;if(_0x13f3ac>=_0x19325a){_0x13f3ac=_0x19325a;_0x4248b0=0xc8;}else{_0x4248b0=0xce;}_0x36e374[_0x56e6('0x20')](_0x4248b0);return _0x36e374[_0x56e6('0x25')]('Content-Range',_0x409d56+'-'+_0x13f3ac+'/'+_0x19325a)[_0x56e6('0x22')](_0xcef612);}return null;};}function patchUpdates(_0x2624d4){return function(_0x1a9c80){try{jsonpatch['apply'](_0x1a9c80,_0x2624d4,!![]);}catch(_0x1ac658){return BPromise[_0x56e6('0x26')](_0x1ac658);}return _0x1a9c80[_0x56e6('0x27')]();};}function saveUpdates(_0x2c56fa,_0x49b5fa){return function(_0x176780){if(_0x176780){return _0x176780[_0x56e6('0x28')](_0x2c56fa)[_0x56e6('0x29')](function(_0x15b730){return _0x15b730;});}return null;};}function removeEntity(_0xd1455c,_0x3a494a){return function(_0x117a90){if(_0x117a90){return _0x117a90[_0x56e6('0x2a')]()[_0x56e6('0x29')](function(){_0xd1455c[_0x56e6('0x20')](0xcc)[_0x56e6('0x21')]();});}};}function handleEntityNotFound(_0x3cf1e0,_0x2e8423){return function(_0x3bae0c){if(!_0x3bae0c){_0x3cf1e0[_0x56e6('0x1f')](0x194);}return _0x3bae0c;};}function handleError(_0x1a9302,_0x3d4ae7){_0x3d4ae7=_0x3d4ae7||0x1f4;return function(_0x1dcf9d){logger[_0x56e6('0x2b')](_0x1dcf9d[_0x56e6('0x2c')]);if(_0x1dcf9d[_0x56e6('0x2d')]){delete _0x1dcf9d[_0x56e6('0x2d')];}_0x1a9302[_0x56e6('0x20')](_0x3d4ae7)[_0x56e6('0x2e')](_0x1dcf9d);};}function getInteractionUsers(_0x448e19,_0x5dd580){return new BPromise(function(_0x2f6fac,_0x423a21){try{if(_0x5dd580[_0x448e19['id']]){_0x448e19['Users']=_[_0x56e6('0x2f')](_0x5dd580[_0x448e19['id']],function(_0x5a41f7){return{'id':_0x5a41f7['id'],'fullname':_0x5a41f7[_0x56e6('0x30')]};});}}catch(_0x125f6d){_0x423a21(_0x125f6d);}_0x2f6fac(_0x448e19);});}function getInteractionTags(_0x29259c,_0x24e340){return new BPromise(function(_0x2b2441,_0x351fdd){try{if(_0x29259c[_0x56e6('0x31')]){_0x29259c[_0x56e6('0x32')]=[];_0x29259c[_0x56e6('0x31')][_0x56e6('0x33')](',')[_0x56e6('0x34')](function(_0x3ddddf){_0x29259c[_0x56e6('0x32')][_0x56e6('0x35')](_0x24e340[_0x3ddddf]);});}delete _0x29259c[_0x56e6('0x31')];}catch(_0x296f85){_0x351fdd(_0x296f85);}_0x2b2441(_0x29259c);});}function updateOpenchannelInteraction(_0x5f2369,_0x1a8888,_0x5342e6){return new BPromise(function(_0x1726ec,_0x123955){return getInteractionUsers(_0x5f2369,_0x5342e6)[_0x56e6('0x29')](function(_0x1aa4b3){return getInteractionTags(_0x1aa4b3,_0x1a8888);})['then'](function(_0x14e016){return getStateInteraction(_0x14e016);})[_0x56e6('0x29')](function(_0xf89d22){_0x1726ec(_0xf89d22);})[_0x56e6('0x36')](function(_0x594b2d){_0x123955(_0x594b2d);});});}function getStateInteraction(_0x259fe0){return new BPromise(function(_0x101662){_0x259fe0[_0x56e6('0x37')]=0x0;_0x259fe0['talking']=0x0;_0x259fe0[_0x56e6('0x38')]=0x0;_0x259fe0[_0x56e6('0x39')]=0x0;_0x259fe0['total']=0x0;if(!_0x259fe0[_0x56e6('0x3a')]&&!_0x259fe0[_0x56e6('0x3b')]){_0x259fe0[_0x56e6('0x37')]+=0x1;}if(!_0x259fe0[_0x56e6('0x3a')]&&_0x259fe0[_0x56e6('0x3b')]){_0x259fe0[_0x56e6('0x3c')]+=0x1;if(_0x259fe0['waiting']){_0x259fe0[_0x56e6('0x37')]-=0x1;}}if(_0x259fe0[_0x56e6('0x3a')]&&_0x259fe0[_0x56e6('0x3b')]){_0x259fe0[_0x56e6('0x38')]+=0x1;if(_0x259fe0[_0x56e6('0x3c')]){_0x259fe0[_0x56e6('0x3c')]-=0x1;}}if(_0x259fe0['closed']&&!_0x259fe0[_0x56e6('0x3b')]){_0x259fe0[_0x56e6('0x39')]+=0x1;if(_0x259fe0[_0x56e6('0x37')]){_0x259fe0[_0x56e6('0x37')]-=0x1;}}_0x259fe0[_0x56e6('0x3d')]+=0x1;_0x101662(_0x259fe0);});}exports[_0x56e6('0x3e')]=function(_0x4e8d86,_0x3390f0){var _0x3481de={},_0x2ba4a2={},_0x27b985={'count':0x0,'rows':[]};var _0x458618=_[_0x56e6('0x2f')](db['OpenchannelInteraction'][_0x56e6('0x3f')],function(_0x223ff3){return{'name':_0x223ff3['fieldName'],'type':_0x223ff3[_0x56e6('0x40')][_0x56e6('0x41')]};});_0x2ba4a2[_0x56e6('0x42')]=_[_0x56e6('0x2f')](_0x458618,'name');_0x2ba4a2['query']=_['keys'](_0x4e8d86[_0x56e6('0x43')]);_0x2ba4a2[_0x56e6('0x44')]=_[_0x56e6('0x45')](_0x2ba4a2['model'],_0x2ba4a2[_0x56e6('0x43')]);_0x3481de[_0x56e6('0x46')]=_[_0x56e6('0x45')](_0x2ba4a2[_0x56e6('0x42')],qs[_0x56e6('0x47')](_0x4e8d86['query'][_0x56e6('0x47')]));_0x3481de['attributes']=_0x3481de[_0x56e6('0x46')][_0x56e6('0x48')]?_0x3481de[_0x56e6('0x46')]:_0x2ba4a2[_0x56e6('0x42')];if(!_0x4e8d86[_0x56e6('0x43')][_0x56e6('0x49')]('nolimit')){_0x3481de[_0x56e6('0x4a')]=qs['limit'](_0x4e8d86['query'][_0x56e6('0x4a')]);_0x3481de['offset']=qs[_0x56e6('0x23')](_0x4e8d86[_0x56e6('0x43')][_0x56e6('0x23')]);}_0x3481de[_0x56e6('0x4b')]=qs['sort'](_0x4e8d86[_0x56e6('0x43')]['sort']);_0x3481de[_0x56e6('0x4c')]=qs[_0x56e6('0x44')](_['pick'](_0x4e8d86['query'],_0x2ba4a2['filters']),_0x458618);var _0x548e9f=[];var _0x28a993=squel[_0x56e6('0x4d')]()[_0x56e6('0x4e')]('id')[_0x56e6('0x4e')](_0x56e6('0x2d'))[_0x56e6('0x4e')](_0x56e6('0x4f'))[_0x56e6('0x50')](_0x56e6('0x51'));var _0x118779=squel[_0x56e6('0x4d')]()[_0x56e6('0x4e')](_0x56e6('0x52'))[_0x56e6('0x4e')]('u.fullname')['field'](_0x56e6('0x53'))[_0x56e6('0x50')](_0x56e6('0x54'),'ui')[_0x56e6('0x55')](_0x56e6('0x56'),'u',_0x56e6('0x57'));var _0x35ba4d=squel[_0x56e6('0x4d')]()['from']('openchannel_interactions','i')[_0x56e6('0x55')](_0x56e6('0x58'),'c',_0x56e6('0x59'))[_0x56e6('0x55')](_0x56e6('0x56'),'o',_0x56e6('0x5a'))[_0x56e6('0x55')](_0x56e6('0x5b'),'a',_0x56e6('0x5c'))['left_join'](_0x56e6('0x5d'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x56e6('0x55')](_0x56e6('0x5e'),'it',_0x56e6('0x5f'))[_0x56e6('0x55')]('tools_tags','t',_0x56e6('0x60'));var _0x4cbd60=squel[_0x56e6('0x61')]();var _0x24bad1=[];var _0xe51808=squel[_0x56e6('0x61')]();var _0x6a2cbc;if(_0x4e8d86[_0x56e6('0x43')][_0x56e6('0x62')]){_0x6a2cbc=as['parseSearch'](_0x4e8d86[_0x56e6('0x43')][_0x56e6('0x62')]);var _0xafe434=_0x6a2cbc[_0x56e6('0x63')];for(var _0x84c754=0x0;_0x84c754<_0x6a2cbc[_0x56e6('0x64')]['length'];_0x84c754++){var _0x2936f9=_0x6a2cbc[_0x56e6('0x64')][_0x84c754];var _0x16d5ea='i';var _0x521cdd=_[_0x56e6('0x65')](_0x458618,[_0x56e6('0x2d'),_0x2936f9['field']]);if(!_0x521cdd){switch(_0x2936f9[_0x56e6('0x4e')]){case _0x56e6('0x66'):if(_0x2936f9[_0x56e6('0x67')]==0x1){_0x35ba4d[_0x56e6('0x68')]('`'+_0x2936f9[_0x56e6('0x4e')]+_0x56e6('0x69'));}else{_0x35ba4d[_0x56e6('0x68')]('`'+_0x2936f9[_0x56e6('0x4e')]+'`\x20>\x200');}break;case _0x56e6('0x6a'):if(_0x2936f9[_0x56e6('0x6b')]==='$substring'){if(_0x2936f9[_0x56e6('0x67')][_0x56e6('0x33')]('\x20')['length']>0x1){_0x4cbd60[_0xafe434](_0x56e6('0x6c'),qs['getFullTextValue'](_0x2936f9[_0x56e6('0x67')]),null);}else{var _0x4138eb='%'+_0x2936f9['value']+'%';_0x4cbd60[_0xafe434]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4138eb,_0x4138eb,_0x4138eb);}}else{_0x521cdd=_[_0x56e6('0x65')](_0x458618,['name',_0x56e6('0x6d')]);_0x2936f9[_0x56e6('0x4e')]='ContactId';_0x165020=as[_0x56e6('0x6e')](_0x16d5ea,_0x521cdd[_0x56e6('0x40')],_0x2936f9);_0x4cbd60[_0xafe434](_0x165020[_0x56e6('0x6f')],_0x165020[_0x56e6('0x67')][_0x56e6('0x70')],_0x165020[_0x56e6('0x67')][_0x56e6('0x21')]);}break;case _0x56e6('0x71'):var _0x3ca806=_0x2936f9[_0x56e6('0x67')][_0x56e6('0x33')](',')[_0x56e6('0x2f')](function(_0x529c2a){return Number(_0x529c2a);});_0x3ca806['forEach'](function(_0x248ba3){_0xe51808['or'](_0x56e6('0x72'),'%,'+_0x248ba3+',%');});_0x24bad1=_[_0x56e6('0x73')](_0x24bad1,_0x3ca806);break;case _0x56e6('0x74'):if(_0x2936f9[_0x56e6('0x6b')]===_0x56e6('0x75')){_0x4cbd60[_0xafe434](_0x56e6('0x76'),'%'+_0x2936f9[_0x56e6('0x67')]+'%',null);}else{_0x521cdd=_[_0x56e6('0x65')](_0x458618,[_0x56e6('0x2d'),_0x56e6('0x3b')]);_0x2936f9[_0x56e6('0x4e')]=_0x56e6('0x3b');_0x165020=as[_0x56e6('0x6e')](_0x16d5ea,_0x521cdd[_0x56e6('0x40')],_0x2936f9);_0x4cbd60[_0xafe434](_0x165020[_0x56e6('0x6f')],_0x165020['value'][_0x56e6('0x70')],_0x165020['value'][_0x56e6('0x21')]);}break;case _0x56e6('0x77'):_0x165020=as[_0x56e6('0x6e')]('me',null,_0x2936f9);_0x4cbd60[_0xafe434](_0x165020['text'],_0x165020[_0x56e6('0x67')]['start'],_0x165020[_0x56e6('0x67')][_0x56e6('0x21')]);break;}}else{var _0x165020=as[_0x56e6('0x6e')](_0x16d5ea,_0x521cdd[_0x56e6('0x40')],_0x2936f9);_0x4cbd60[_0xafe434](_0x165020['text'],_0x165020[_0x56e6('0x67')][_0x56e6('0x70')],_0x165020[_0x56e6('0x67')][_0x56e6('0x21')]);}}}else{var _0x26ecba=_(_0x4e8d86[_0x56e6('0x43')])[_0x56e6('0x78')]()['map'](function(_0x3feefa){return _['some'](_0x458618,[_0x56e6('0x2d'),_0x3feefa])?_0x3feefa:undefined;})[_0x56e6('0x79')]()['value']();if(!_[_0x56e6('0x7a')](_0x26ecba)){_0x26ecba[_0x56e6('0x34')](function(_0x4aa8a7){if(_0x4aa8a7===_0x56e6('0x7b')){_0x35ba4d[_0x56e6('0x4c')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x56e6('0x7c')](_0x4e8d86[_0x56e6('0x43')][_0x4aa8a7]));}else if(_0x4aa8a7===_0x56e6('0x7d')){var _0x43b71d=JSON['parse'](_0x4e8d86['query'][_0x4aa8a7])[_0x56e6('0x7e')];var _0xfb0a3d=JSON[_0x56e6('0x7f')](_0x4e8d86[_0x56e6('0x43')][_0x4aa8a7])[_0x56e6('0x80')];_0x35ba4d[_0x56e6('0x4c')](_0x56e6('0x81'),_0x43b71d,_0xfb0a3d);}else{if(_0x4e8d86['query'][_0x4aa8a7]===_0x56e6('0x82')){_0x35ba4d[_0x56e6('0x4c')]('i.'+_0x4aa8a7+_0x56e6('0x83'));}else{_0x35ba4d[_0x56e6('0x4c')]('i.'+_0x4aa8a7+_0x56e6('0x84'),_0x4e8d86[_0x56e6('0x43')][_0x4aa8a7]);}}});}if(_0x4e8d86[_0x56e6('0x43')][_0x56e6('0x85')]){if(_0x4e8d86[_0x56e6('0x43')][_0x56e6('0x85')]==0x1){_0x35ba4d[_0x56e6('0x68')](_0x56e6('0x86'));}else{_0x35ba4d['having']('`unreadMessages`\x20>\x200');}}if(_0x4e8d86[_0x56e6('0x43')]['tag']){_0x24bad1=_[_0x56e6('0x87')](_0x4e8d86[_0x56e6('0x43')][_0x56e6('0x88')])?_0x4e8d86[_0x56e6('0x43')]['tag']:new Array(_0x4e8d86['query'][_0x56e6('0x88')]);_0x24bad1['forEach'](function(_0xe63cc7){_0xe51808['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xe63cc7+',%');});}if(_0x4e8d86[_0x56e6('0x43')][_0x56e6('0x89')]){var _0x1c5ae0=_0x4e8d86[_0x56e6('0x43')]['filter'][_0x56e6('0x8a')]('\x5c','\x5c\x5c')[_0x56e6('0x8a')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1c5ae0)){_0x4cbd60['or'](_0x56e6('0x8b'),_0x1c5ae0+'%');}else{_0x4cbd60['or'](_0x56e6('0x8c'),qs[_0x56e6('0x8d')](_0x1c5ae0))['or'](_0x56e6('0x8e'),_0x1c5ae0+'%')['or'](_0x56e6('0x8f'),_0x1c5ae0+'%');}}}_0x35ba4d[_0x56e6('0x4c')](_0x4cbd60);_0x35ba4d['group']('i.id');var _0x142f14={'type':db['Sequelize'][_0x56e6('0x90')][_0x56e6('0x91')],'raw':!![]};var _0x190d73=_0x35ba4d['clone']();_0x190d73[_0x56e6('0x4e')](_0x56e6('0x92'));_0x190d73[_0x56e6('0x4e')](_0x56e6('0x93'),_0x56e6('0x66'));if(_0x3481de[_0x56e6('0x4b')]){_0x3481de['order'][_0x56e6('0x34')](function(_0x57005b){var _0x475604=_0x57005b[0x0]===_0x56e6('0x94')?_0x57005b[0x0]:'i.'+_0x57005b[0x0];_0x35ba4d[_0x56e6('0x4b')](_0x475604,_0x57005b[0x1]===_0x56e6('0x95')?![]:!![]);});}if(!_[_0x56e6('0x7a')](_0x24bad1)){_0x35ba4d[_0x56e6('0x68')](_0xe51808);_0x190d73[_0x56e6('0x4c')](_0x56e6('0x96'),_0x24bad1);}BPromise['resolve']()['then'](function(){if(!_0x6a2cbc){if(_0x4e8d86[_0x56e6('0x43')][_0x56e6('0x7b')])return;_0x190d73[_0x56e6('0x4c')](_0x56e6('0x97'));_0x35ba4d['where'](_0x56e6('0x97'));return;}if(_0x4e8d86[_0x56e6('0x98')][_0x56e6('0x99')]!==_0x56e6('0x9a'))return;return _0x4e8d86[_0x56e6('0x98')][_0x56e6('0x9b')]({'attributes':['id'],'raw':!![]})[_0x56e6('0x29')](function(_0x5ef6fa){if(_[_0x56e6('0x7a')](_0x5ef6fa)){_0x190d73[_0x56e6('0x4c')](_0x56e6('0x9c'));_0x35ba4d['where']('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x190d73[_0x56e6('0x4c')](_0x56e6('0x9d'),_['map'](_0x5ef6fa,'id'));_0x35ba4d[_0x56e6('0x4c')](_0x56e6('0x9d'),_[_0x56e6('0x2f')](_0x5ef6fa,'id'));}});})[_0x56e6('0x29')](function(){if(_0x4e8d86[_0x56e6('0x98')][_0x56e6('0x99')]===_0x56e6('0x9a')&&!_0x6a2cbc&&!_0x4e8d86['query'][_0x56e6('0x7b')])return[];return db[_0x56e6('0x9e')]['query'](_0x190d73[_0x56e6('0x9f')](),_0x142f14);})[_0x56e6('0x29')](function(_0x108453){_0x27b985[_0x56e6('0x24')]=_0x108453['length'];if(_0x27b985[_0x56e6('0x24')]===0x0)return[];return db[_0x56e6('0x9e')][_0x56e6('0x43')](_0x28a993['toString'](),_0x142f14)['then'](function(_0x55e219){_0x548e9f=_[_0x56e6('0xa0')](_0x55e219,'id');_0x142f14=_[_0x56e6('0xa1')](_0x142f14,{'model':db[_0x56e6('0xa2')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4e8d86[_0x56e6('0x43')]['fields']){_0x3481de[_0x56e6('0x46')][_0x56e6('0x34')](function(_0x224990){_0x35ba4d[_0x56e6('0x4e')]('i.'+_0x224990);});}else{_0x35ba4d[_0x56e6('0x4e')](_0x56e6('0x93'),_0x56e6('0x66'));_0x35ba4d[_0x56e6('0x4e')](_0x56e6('0xa3'),'Account.key');_0x35ba4d['field'](_0x56e6('0xa4'),'Account.mandatoryDisposition');_0x35ba4d[_0x56e6('0x4e')](_0x56e6('0xa5'),_0x56e6('0x94'));_0x35ba4d['field']('i.*');_0x35ba4d[_0x56e6('0x4e')](_0x56e6('0xa6'),_0x56e6('0xa7'));_0x35ba4d[_0x56e6('0x4e')]('c.lastName','Contact.lastName');_0x35ba4d[_0x56e6('0x4e')](_0x56e6('0xa8'),_0x56e6('0xa9'));_0x35ba4d[_0x56e6('0x4e')](_0x56e6('0xaa'),'Contact.phone');_0x35ba4d[_0x56e6('0x4e')](_0x56e6('0xab'),_0x56e6('0xac'));_0x35ba4d[_0x56e6('0x4e')](_0x56e6('0xad'),_0x56e6('0xae'));_0x35ba4d[_0x56e6('0x4e')](_0x56e6('0xaf'),_0x56e6('0xb0'));_0x35ba4d[_0x56e6('0x4e')](_0x56e6('0xb1'),_0x56e6('0xb2'));_0x35ba4d[_0x56e6('0x4e')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x56e6('0x31'));}if(_0x3481de[_0x56e6('0x4a')])_0x35ba4d[_0x56e6('0x4a')](_0x3481de[_0x56e6('0x4a')]);if(_0x3481de['offset'])_0x35ba4d[_0x56e6('0x23')](_0x3481de[_0x56e6('0x23')]);return db['sequelize'][_0x56e6('0x43')](_0x35ba4d['toString'](),_0x142f14);})[_0x56e6('0x29')](function(_0x3271a1){if(_0x3271a1[_0x56e6('0x48')]>0x0)_0x118779['where']('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x56e6('0x2f')](_0x3271a1,'id'));return db[_0x56e6('0x9e')][_0x56e6('0x43')](_0x118779[_0x56e6('0x9f')](),_0x142f14)[_0x56e6('0x29')](function(_0x548750){var _0x1063bf=_['groupBy'](_0x548750,_0x56e6('0xb3'));var _0x34cee2=[];_0x3271a1[_0x56e6('0x34')](function(_0x33025e){_0x34cee2['push'](updateOpenchannelInteraction(_0x33025e,_0x548e9f,_0x1063bf));});return BPromise['all'](_0x34cee2);});});})[_0x56e6('0x29')](function(_0x130801){_0x27b985['rows']=_0x130801;return _0x27b985;})['then'](respondWithFilteredResult(_0x3390f0,_0x3481de))[_0x56e6('0x36')](handleError(_0x3390f0,null));};exports[_0x56e6('0xb4')]=function(_0x264961,_0x30dfc5){var _0x21f044={};if(_0x264961[_0x56e6('0x43')][_0x56e6('0x40')]&&_0x264961['query'][_0x56e6('0x40')]==='from'){_0x21f044[_0x56e6('0x50')]=_0x264961[_0x56e6('0xb5')]['id'];}else{_0x21f044['id']=_0x264961[_0x56e6('0xb5')]['id'];}var _0xdc69e4={'raw':![],'where':_0x21f044},_0x3a8bab={};_0x3a8bab['model']=_[_0x56e6('0x78')](db[_0x56e6('0xa2')][_0x56e6('0x3f')]);_0x3a8bab[_0x56e6('0x43')]=_[_0x56e6('0x78')](_0x264961[_0x56e6('0x43')]);_0x3a8bab[_0x56e6('0x44')]=_[_0x56e6('0x45')](_0x3a8bab[_0x56e6('0x42')],_0x3a8bab[_0x56e6('0x43')]);_0xdc69e4[_0x56e6('0x46')]=_[_0x56e6('0x45')](_0x3a8bab['model'],qs['fields'](_0x264961[_0x56e6('0x43')]['fields']));_0xdc69e4['attributes']=_0xdc69e4[_0x56e6('0x46')][_0x56e6('0x48')]?_0xdc69e4['attributes']:_0x3a8bab['model'];if(_0x264961[_0x56e6('0x43')][_0x56e6('0xb6')]){_0xdc69e4[_0x56e6('0xb7')]=[{'all':!![]}];}_0xdc69e4=_[_0x56e6('0xa1')]({},_0xdc69e4,_0x264961[_0x56e6('0xb8')]);return db[_0x56e6('0xa2')][_0x56e6('0x65')](_0xdc69e4)['then'](handleEntityNotFound(_0x30dfc5,null))[_0x56e6('0x29')](respondWithResult(_0x30dfc5,null))[_0x56e6('0x36')](handleError(_0x30dfc5,null));};exports['create']=function(_0x367959,_0x5527b6){return db['OpenchannelInteraction'][_0x56e6('0xb9')](_0x367959[_0x56e6('0x77')],{})[_0x56e6('0x29')](respondWithResult(_0x5527b6,0xc9))[_0x56e6('0x36')](handleError(_0x5527b6,null));};exports[_0x56e6('0x28')]=function(_0x670e2c,_0x3aee6c){if(_0x670e2c[_0x56e6('0x77')]['id']){delete _0x670e2c[_0x56e6('0x77')]['id'];}return db[_0x56e6('0xa2')][_0x56e6('0x65')]({'where':{'id':_0x670e2c['params']['id']}})[_0x56e6('0x29')](handleEntityNotFound(_0x3aee6c,null))[_0x56e6('0x29')](saveUpdates(_0x670e2c[_0x56e6('0x77')],null))['then'](respondWithResult(_0x3aee6c,null))[_0x56e6('0x36')](handleError(_0x3aee6c,null));};exports[_0x56e6('0x2a')]=function(_0x22bae2,_0x34723c){return db[_0x56e6('0xa2')][_0x56e6('0x65')]({'where':{'id':_0x22bae2['params']['id']}})['then'](handleEntityNotFound(_0x34723c,null))['then'](removeEntity(_0x34723c,null))[_0x56e6('0x36')](handleError(_0x34723c,null));};exports['describe']=function(_0x2682af,_0x1b1086){return db[_0x56e6('0xa2')][_0x56e6('0xba')]()[_0x56e6('0x29')](respondWithResult(_0x1b1086,null))[_0x56e6('0x36')](handleError(_0x1b1086,null));};exports[_0x56e6('0xbb')]=function(_0x3be201,_0x490d48,_0x496d5e){return db['OpenchannelMessage']['find']({'where':{'id':_0x3be201['params']['id']}})[_0x56e6('0x29')](handleEntityNotFound(_0x490d48,null))['then'](function(_0x2b8465){if(_0x2b8465){return _0x2b8465['addMessage'](_0x3be201[_0x56e6('0x77')][_0x56e6('0xbc')],_[_0x56e6('0xbd')](_0x3be201[_0x56e6('0x77')],[_0x56e6('0xbc'),'id'])||{});}})[_0x56e6('0x29')](respondWithResult(_0x490d48,null))[_0x56e6('0x36')](handleError(_0x490d48,null));};exports['getMessages']=function(_0x4a3109,_0x2c7c32,_0x2616eb){var _0xafebcf={'raw':![],'where':{}};var _0x577712={};var _0x2207cc={'count':0x0,'rows':[]};return db[_0x56e6('0xa2')]['findOne']({'where':{'id':_0x4a3109[_0x56e6('0xb5')]['id']}})['then'](handleEntityNotFound(_0x2c7c32,null))[_0x56e6('0x29')](function(_0x1b240f){if(_0x1b240f){_0x577712['model']=_[_0x56e6('0x78')](db['OpenchannelMessage'][_0x56e6('0x3f')]);_0x577712[_0x56e6('0x43')]=_['keys'](_0x4a3109['query']);_0x577712[_0x56e6('0x44')]=_[_0x56e6('0x45')](_0x577712[_0x56e6('0x42')],_0x577712['query']);_0xafebcf['attributes']=_['intersection'](_0x577712[_0x56e6('0x42')],qs[_0x56e6('0x47')](_0x4a3109[_0x56e6('0x43')]['fields']));_0xafebcf[_0x56e6('0x46')]=_0xafebcf[_0x56e6('0x46')]['length']?_0xafebcf['attributes']:_0x577712[_0x56e6('0x42')];if(!_0x4a3109['query'][_0x56e6('0x49')]('nolimit')){_0xafebcf['limit']=qs['limit'](_0x4a3109[_0x56e6('0x43')][_0x56e6('0x4a')]);_0xafebcf[_0x56e6('0x23')]=qs[_0x56e6('0x23')](_0x4a3109['query'][_0x56e6('0x23')]);}_0xafebcf[_0x56e6('0x4b')]=qs['sort'](_0x4a3109[_0x56e6('0x43')][_0x56e6('0xbe')]);_0xafebcf[_0x56e6('0x4c')]=qs['filters'](_[_0x56e6('0xbf')](_0x4a3109[_0x56e6('0x43')],_0x577712['filters']));_0xafebcf[_0x56e6('0x4c')][_0x56e6('0xb3')]=_0x1b240f['id'];if(_0x4a3109[_0x56e6('0x43')][_0x56e6('0x89')]){_0xafebcf[_0x56e6('0x4c')]=_[_0x56e6('0xa1')](_0xafebcf['where'],{'$or':_[_0x56e6('0x2f')](_0xafebcf[_0x56e6('0x46')],function(_0x2f4ecb){var _0x56c2f4={};_0x56c2f4[_0x2f4ecb]={'$like':'%'+_0x4a3109[_0x56e6('0x43')][_0x56e6('0x89')]+'%'};return _0x56c2f4;})});}if(_0x4a3109['query'][_0x56e6('0x7e')]){var _0x3e6e38=_0x4a3109[_0x56e6('0x43')]['$gte'][_0x56e6('0x33')](',');var _0x4017ee={};_0x4017ee[_0x3e6e38[0x0]]={'$gte':moment(_0x3e6e38[0x1])[_0x56e6('0xc0')](_0x56e6('0xc1'))};_0xafebcf[_0x56e6('0x4c')]=_[_0x56e6('0xa1')](_0xafebcf[_0x56e6('0x4c')],_0x4017ee);}_0xafebcf=_[_0x56e6('0xa1')]({},_0xafebcf,_0x4a3109[_0x56e6('0xb8')]);return db['OpenchannelMessage'][_0x56e6('0x24')]({'where':_0xafebcf[_0x56e6('0x4c')]})[_0x56e6('0x29')](function(_0x4040d3){_0x2207cc[_0x56e6('0x24')]=_0x4040d3;if(_0x4a3109[_0x56e6('0x43')][_0x56e6('0xb6')]){_0xafebcf[_0x56e6('0xb7')]=[{'all':!![]}];}return db[_0x56e6('0xc2')]['findAll'](_0xafebcf);})[_0x56e6('0x29')](function(_0x4fc313){_0x2207cc[_0x56e6('0xc3')]=_0x4fc313;return _0x2207cc;});}})['then'](respondWithFilteredResult(_0x2c7c32,_0xafebcf))['catch'](handleError(_0x2c7c32,null));};exports[_0x56e6('0xc4')]=function(_0x1b5777,_0xba0af6,_0x29641c){return db[_0x56e6('0xa2')][_0x56e6('0x65')]({'where':{'id':_0x1b5777[_0x56e6('0xb5')]['id']}})[_0x56e6('0x29')](handleEntityNotFound(_0xba0af6,null))['then'](function(_0x138418){if(_0x138418){return _0x138418[_0x56e6('0xc5')](_0x1b5777[_0x56e6('0x77')][_0x56e6('0xbc')],_['omit'](_0x1b5777[_0x56e6('0x77')],[_0x56e6('0xbc'),'id'])||{})['spread'](function(){return db[_0x56e6('0x71')][_0x56e6('0xc6')]({'attributes':['id',_0x56e6('0x2d'),_0x56e6('0x4f')],'where':{'id':_0x1b5777[_0x56e6('0x77')][_0x56e6('0xbc')]}});})['then'](function(_0x2a101d){socket[_0x56e6('0xc7')](_0x56e6('0xc8'),{'id':Number(_0x1b5777[_0x56e6('0xb5')]['id']),'tags':_0x2a101d||[]});return{'id':Number(_0x1b5777['params']['id']),'tags':_0x2a101d||[]};});}})[_0x56e6('0x29')](respondWithResult(_0xba0af6,null))[_0x56e6('0x36')](handleError(_0xba0af6,null));};exports['removeTags']=function(_0x12578e,_0x6fb375,_0x5a9c16){return db[_0x56e6('0xa2')]['find']({'where':{'id':_0x12578e[_0x56e6('0xb5')]['id']}})['then'](handleEntityNotFound(_0x6fb375,null))['then'](function(_0x161876){if(_0x161876){return _0x161876[_0x56e6('0xc9')](_0x12578e[_0x56e6('0x43')][_0x56e6('0xbc')]);}})[_0x56e6('0x29')](respondWithStatusCode(_0x6fb375,null))['catch'](handleError(_0x6fb375,null));};exports[_0x56e6('0xca')]=function(_0x14a18e,_0x4ef5ec){var _0x2a6ab5=moment()[_0x56e6('0xcb')]()[_0x56e6('0x9f')]();var _0x532eb1=path[_0x56e6('0xcc')](config['root'],_0x56e6('0xcd'),_0x56e6('0xce'),'tmp');var _0x36b821=path[_0x56e6('0xcc')](config[_0x56e6('0xcf')],_0x56e6('0xcd'),_0x56e6('0xce'),'attachments');var _0xad9ddf=path[_0x56e6('0xcc')](_0x532eb1,_0x2a6ab5);var _0x3a4bbc=util['format']('transcript-%d-%s.zip',_0x14a18e[_0x56e6('0xb5')]['id'],_0x2a6ab5);var _0x1aaba8=path['join'](_0x532eb1,_0x3a4bbc);var _0x1f5a5b=[];_0x1f5a5b[_0x56e6('0x35')]({'model':db[_0x56e6('0x74')],'as':_0x56e6('0x74'),'attributes':['id',_0x56e6('0x30')],'raw':!![]});_0x1f5a5b[_0x56e6('0x35')]({'model':db['CmContact'],'as':_0x56e6('0x6a'),'attributes':['id','firstName',_0x56e6('0xd0')],'raw':!![]});if(_0x14a18e[_0x56e6('0x43')][_0x56e6('0xd1')]){_0x1f5a5b[_0x56e6('0x35')]({'model':db[_0x56e6('0xd2')],'as':'Attachment','raw':!![]});}var _0x58cb0=[{'model':db[_0x56e6('0xc2')],'as':'Messages','attributes':['id',_0x56e6('0x77'),_0x56e6('0x7d'),_0x56e6('0xd3'),'secret',_0x56e6('0x85')],'include':_0x1f5a5b}];_0x58cb0[_0x56e6('0x35')]({'model':db[_0x56e6('0xd4')],'as':_0x56e6('0xd5'),'attributes':['id',_0x56e6('0x2d')]});_0x58cb0['push']({'model':db[_0x56e6('0x74')],'as':_0x56e6('0xd6'),'attributes':['id',_0x56e6('0x30')]});return db[_0x56e6('0xa2')][_0x56e6('0x65')]({'where':{'id':_0x14a18e['params']['id']},'include':_0x58cb0})[_0x56e6('0x29')](handleEntityNotFound(_0x4ef5ec,null))[_0x56e6('0x29')](function(_0x51ab72){if(_0x51ab72){var _0x1e023a=_0x51ab72[_0x56e6('0xd7')]({'plain':!![]});fs[_0x56e6('0xd8')](_0xad9ddf);var _0x4cc96a={'channel':_0x56e6('0xd9'),'account':_0x1e023a['Account'][_0x56e6('0x2d')],'agent':_0x1e023a[_0x56e6('0xd6')]?_0x1e023a[_0x56e6('0xd6')]['fullname']:_0x56e6('0xda'),'createdAt':moment(_0x1e023a[_0x56e6('0x7d')])[_0x56e6('0xc0')](_0x56e6('0xc1'))[_0x56e6('0x9f')](),'closedAt':_0x1e023a[_0x56e6('0x3a')]?moment(_0x1e023a['closedAt'])[_0x56e6('0xc0')](_0x56e6('0xc1'))[_0x56e6('0x9f')]():'','disposition':_0x1e023a[_0x56e6('0xdb')],'visibility':_0x1e023a[_0x56e6('0xdc')]?_0x56e6('0xdd'):_0x56e6('0xde'),'messages':_(_0x1e023a[_0x56e6('0xdf')])[_0x56e6('0x89')]({'secret':![]})[_0x56e6('0x2f')](function(_0x43b47b){if(_0x43b47b[_0x56e6('0xd2')]){var _0x36373d=path['join'](_0x36b821,_0x43b47b['Attachment'][_0x56e6('0xe0')]);if(fs[_0x56e6('0xe1')](_0x36373d)){fs[_0x56e6('0xe2')](_0x36373d)[_0x56e6('0xe3')](fs[_0x56e6('0xe4')](path[_0x56e6('0xcc')](_0xad9ddf,_0x43b47b[_0x56e6('0xd2')][_0x56e6('0xe0')])));}}return{'date':moment(_0x43b47b[_0x56e6('0x7d')])[_0x56e6('0xc0')](_0x56e6('0xc1'))[_0x56e6('0x9f')](),'sender':_0x43b47b[_0x56e6('0xd3')]==='out'?_0x43b47b[_0x56e6('0x74')]?_0x43b47b['User']['fullname']:_0x56e6('0xe5'):_0x43b47b[_0x56e6('0x6a')][_0x56e6('0xe6')]+(_0x43b47b[_0x56e6('0x6a')][_0x56e6('0xd0')]?'\x20'+_0x43b47b['Contact'][_0x56e6('0xd0')]:''),'body':_0x43b47b[_0x56e6('0xd2')]?_0x43b47b[_0x56e6('0xd2')][_0x56e6('0xe0')]:_0x43b47b[_0x56e6('0x77')],'direction':_0x43b47b[_0x56e6('0xd3')]==='out'?'A':'C','secret':_0x43b47b[_0x56e6('0xe7')],'read':_0x43b47b[_0x56e6('0x85')],'attachment':_0x43b47b[_0x56e6('0xd2')]};})[_0x56e6('0x67')]()};return ejs[_0x56e6('0xe8')](path[_0x56e6('0xcc')](config[_0x56e6('0xcf')],_0x56e6('0xcd'),_0x56e6('0xe9'),'downloadInteraction.ejs'),{'interaction':_0x4cc96a})[_0x56e6('0x29')](function(_0x369733){var _0x5578fc=path[_0x56e6('0xcc')](_0xad9ddf,_0x56e6('0xea')+_0x1e023a['id']+'-'+_0x2a6ab5+_0x56e6('0xeb'));var _0x21ad56={'path':_0x5578fc,'channel':'Openchannel','interactionId':_0x1e023a['id']};return pdf[_0x56e6('0xec')](_0x369733,_0x21ad56);})['then'](function(){return new BPromise(function(_0x423585,_0x4bac17){zipdir(_0xad9ddf,{'saveTo':_0x1aaba8},function(_0x424746,_0x5d1d5c){if(_0x424746)return _0x4bac17(_0x424746);return _0x423585(_0x5d1d5c);});})['then'](function(){return new BPromise(function(_0x1a63c8,_0x12a8c0){rimraf(_0xad9ddf,function(_0x146168){if(_0x146168)_0x12a8c0(_0x146168);return _0x1a63c8();});});})[_0x56e6('0x29')](function(){return _0x4ef5ec[_0x56e6('0xca')](_0x1aaba8,_0x3a4bbc,function(_0x5314b7){if(_0x5314b7){console[_0x56e6('0xed')](_0x56e6('0xee'),_0x5314b7);}else{fs[_0x56e6('0xef')](_0x1aaba8);}});});});}else{return _0x4ef5ec[_0x56e6('0x1f')](0xc8);}})[_0x56e6('0x36')](handleError(_0x4ef5ec,null));};
\ No newline at end of file
+var _0xb366=['../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','end','status','json','offset','undefined','limit','Content-Range','apply','reject','update','then','stack','name','send','Users','fullname','TagIds','split','forEach','Tags','push','talking','answered','unmanaged','closed','waiting','UserId','total','index','OpenchannelInteraction','rawAttributes','fieldName','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','keys','compact','isEmpty','OpenchannelAccountId','where','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','count','toString','keyBy','merge','a.key','Account.key','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','OpenchannelInteractionId','all','rows','catch','show','params','includeAll','include','create','destroy','describe','OpenchannelMessage','addMessage','ids','getMessages','filter','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','spread','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','format','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','threadId','Private','basename','createReadStream','pipe','out','System','direction','views','downloadInteraction.ejs','transcript-','.pdf','Openchannel','createPdfFromHTML','log','unlinkSync','sendStatus','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x12823d,_0x3502c0){var _0x2cfbdb=function(_0x511b26){while(--_0x511b26){_0x12823d['push'](_0x12823d['shift']());}};_0x2cfbdb(++_0x3502c0);}(_0xb366,0x1db));var _0x6b36=function(_0x138293,_0x197e7f){_0x138293=_0x138293-0x0;var _0x34c4a2=_0xb366[_0x138293];return _0x34c4a2;};'use strict';var emlformat=require(_0x6b36('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b36('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6b36('0x2'));var BPromise=require(_0x6b36('0x3'));var Mustache=require(_0x6b36('0x4'));var util=require(_0x6b36('0x5'));var path=require(_0x6b36('0x6'));var sox=require('sox');var csv=require(_0x6b36('0x7'));var ejs=require(_0x6b36('0x8'));var fs=require('fs');var fs_extra=require(_0x6b36('0x9'));var _=require(_0x6b36('0xa'));var squel=require(_0x6b36('0xb'));var crypto=require(_0x6b36('0xc'));var jsforce=require(_0x6b36('0xd'));var deskjs=require(_0x6b36('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6b36('0xf'));var Papa=require(_0x6b36('0x10'));var Redis=require(_0x6b36('0x11'));var authService=require(_0x6b36('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6b36('0x13'));var pdf=require(_0x6b36('0x14'));var hardwareService=require(_0x6b36('0x15'));var logger=require(_0x6b36('0x16'))(_0x6b36('0x17'));var utils=require(_0x6b36('0x18'));var config=require(_0x6b36('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x6b36('0x1a'))['db'];config[_0x6b36('0x1b')]=_[_0x6b36('0x1c')](config[_0x6b36('0x1b')],{'host':_0x6b36('0x1d'),'port':0x18eb});var socket=require(_0x6b36('0x1e'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x6b36('0x1f')](socket);function respondWithStatusCode(_0x59bb7e,_0x395007){_0x395007=_0x395007||0xcc;return function(_0x14e5cf){if(_0x14e5cf){return _0x59bb7e['sendStatus'](_0x395007);}return _0x59bb7e['status'](_0x395007)[_0x6b36('0x20')]();};}function respondWithResult(_0x187b6a,_0x35cd54){_0x35cd54=_0x35cd54||0xc8;return function(_0x1d76f0){if(_0x1d76f0){return _0x187b6a[_0x6b36('0x21')](_0x35cd54)[_0x6b36('0x22')](_0x1d76f0);}};}function respondWithFilteredResult(_0x112819,_0xaf3b05){return function(_0x41971d){if(_0x41971d){var _0x156c93=typeof _0xaf3b05[_0x6b36('0x23')]===_0x6b36('0x24')&&typeof _0xaf3b05['limit']===_0x6b36('0x24');var _0x5a9cb5=_0x41971d['count'];var _0x3941d2=_0x156c93?0x0:_0xaf3b05[_0x6b36('0x23')];var _0x5e5d44=_0x156c93?_0x41971d['count']:_0xaf3b05[_0x6b36('0x23')]+_0xaf3b05[_0x6b36('0x25')];var _0x570076;if(_0x5e5d44>=_0x5a9cb5){_0x5e5d44=_0x5a9cb5;_0x570076=0xc8;}else{_0x570076=0xce;}_0x112819[_0x6b36('0x21')](_0x570076);return _0x112819['set'](_0x6b36('0x26'),_0x3941d2+'-'+_0x5e5d44+'/'+_0x5a9cb5)['json'](_0x41971d);}return null;};}function patchUpdates(_0x5deaf3){return function(_0x49895a){try{jsonpatch[_0x6b36('0x27')](_0x49895a,_0x5deaf3,!![]);}catch(_0x4e9f30){return BPromise[_0x6b36('0x28')](_0x4e9f30);}return _0x49895a['save']();};}function saveUpdates(_0x59c37e,_0x158494){return function(_0x486fad){if(_0x486fad){return _0x486fad[_0x6b36('0x29')](_0x59c37e)[_0x6b36('0x2a')](function(_0x5ef427){return _0x5ef427;});}return null;};}function removeEntity(_0x21e7ba,_0x2202a5){return function(_0x551c3a){if(_0x551c3a){return _0x551c3a['destroy']()[_0x6b36('0x2a')](function(){_0x21e7ba[_0x6b36('0x21')](0xcc)[_0x6b36('0x20')]();});}};}function handleEntityNotFound(_0x2fda72,_0x209347){return function(_0xd75af9){if(!_0xd75af9){_0x2fda72['sendStatus'](0x194);}return _0xd75af9;};}function handleError(_0x3ce3db,_0x5c1460){_0x5c1460=_0x5c1460||0x1f4;return function(_0x3becb1){logger['error'](_0x3becb1[_0x6b36('0x2b')]);if(_0x3becb1[_0x6b36('0x2c')]){delete _0x3becb1[_0x6b36('0x2c')];}_0x3ce3db[_0x6b36('0x21')](_0x5c1460)[_0x6b36('0x2d')](_0x3becb1);};}function getInteractionUsers(_0x1ea6f0,_0x248f0c){return new BPromise(function(_0x25c567,_0x5f2691){try{if(_0x248f0c[_0x1ea6f0['id']]){_0x1ea6f0[_0x6b36('0x2e')]=_['map'](_0x248f0c[_0x1ea6f0['id']],function(_0x37808c){return{'id':_0x37808c['id'],'fullname':_0x37808c[_0x6b36('0x2f')]};});}}catch(_0x1a34a2){_0x5f2691(_0x1a34a2);}_0x25c567(_0x1ea6f0);});}function getInteractionTags(_0xa2e77b,_0xc7fbdd){return new BPromise(function(_0x352ab4,_0x3fb2be){try{if(_0xa2e77b['TagIds']){_0xa2e77b['Tags']=[];_0xa2e77b[_0x6b36('0x30')][_0x6b36('0x31')](',')[_0x6b36('0x32')](function(_0x2dcc4c){_0xa2e77b[_0x6b36('0x33')][_0x6b36('0x34')](_0xc7fbdd[_0x2dcc4c]);});}delete _0xa2e77b[_0x6b36('0x30')];}catch(_0xdccf76){_0x3fb2be(_0xdccf76);}_0x352ab4(_0xa2e77b);});}function updateOpenchannelInteraction(_0x1773bd,_0x5e0d50,_0x2a11d3){return new BPromise(function(_0x245930,_0x3313f7){return getInteractionUsers(_0x1773bd,_0x2a11d3)[_0x6b36('0x2a')](function(_0x192104){return getInteractionTags(_0x192104,_0x5e0d50);})[_0x6b36('0x2a')](function(_0x451eee){return getStateInteraction(_0x451eee);})[_0x6b36('0x2a')](function(_0x3f0b3a){_0x245930(_0x3f0b3a);})['catch'](function(_0x5a345c){_0x3313f7(_0x5a345c);});});}function getStateInteraction(_0x25324f){return new BPromise(function(_0x2c4c93){_0x25324f['waiting']=0x0;_0x25324f[_0x6b36('0x35')]=0x0;_0x25324f[_0x6b36('0x36')]=0x0;_0x25324f[_0x6b36('0x37')]=0x0;_0x25324f['total']=0x0;if(!_0x25324f[_0x6b36('0x38')]&&!_0x25324f['UserId']){_0x25324f[_0x6b36('0x39')]+=0x1;}if(!_0x25324f[_0x6b36('0x38')]&&_0x25324f[_0x6b36('0x3a')]){_0x25324f['talking']+=0x1;if(_0x25324f[_0x6b36('0x39')]){_0x25324f[_0x6b36('0x39')]-=0x1;}}if(_0x25324f['closed']&&_0x25324f['UserId']){_0x25324f[_0x6b36('0x36')]+=0x1;if(_0x25324f[_0x6b36('0x35')]){_0x25324f['talking']-=0x1;}}if(_0x25324f[_0x6b36('0x38')]&&!_0x25324f[_0x6b36('0x3a')]){_0x25324f[_0x6b36('0x37')]+=0x1;if(_0x25324f['waiting']){_0x25324f[_0x6b36('0x39')]-=0x1;}}_0x25324f[_0x6b36('0x3b')]+=0x1;_0x2c4c93(_0x25324f);});}exports[_0x6b36('0x3c')]=function(_0x344fb3,_0x53dc04){var _0x2525af={},_0x2147de={},_0x8f941a={'count':0x0,'rows':[]};var _0x171956=_['map'](db[_0x6b36('0x3d')][_0x6b36('0x3e')],function(_0x5a7bad){return{'name':_0x5a7bad[_0x6b36('0x3f')],'type':_0x5a7bad['type'][_0x6b36('0x40')]};});_0x2147de['model']=_[_0x6b36('0x41')](_0x171956,_0x6b36('0x2c'));_0x2147de[_0x6b36('0x42')]=_['keys'](_0x344fb3[_0x6b36('0x42')]);_0x2147de[_0x6b36('0x43')]=_[_0x6b36('0x44')](_0x2147de[_0x6b36('0x45')],_0x2147de[_0x6b36('0x42')]);_0x2525af[_0x6b36('0x46')]=_[_0x6b36('0x44')](_0x2147de['model'],qs[_0x6b36('0x47')](_0x344fb3['query'][_0x6b36('0x47')]));_0x2525af[_0x6b36('0x46')]=_0x2525af[_0x6b36('0x46')][_0x6b36('0x48')]?_0x2525af[_0x6b36('0x46')]:_0x2147de[_0x6b36('0x45')];if(!_0x344fb3['query'][_0x6b36('0x49')](_0x6b36('0x4a'))){_0x2525af['limit']=qs[_0x6b36('0x25')](_0x344fb3['query'][_0x6b36('0x25')]);_0x2525af[_0x6b36('0x23')]=qs[_0x6b36('0x23')](_0x344fb3[_0x6b36('0x42')][_0x6b36('0x23')]);}_0x2525af[_0x6b36('0x4b')]=qs['sort'](_0x344fb3['query'][_0x6b36('0x4c')]);_0x2525af['where']=qs[_0x6b36('0x43')](_[_0x6b36('0x4d')](_0x344fb3[_0x6b36('0x42')],_0x2147de[_0x6b36('0x43')]),_0x171956);var _0x2b6dde=[];var _0x2794fc=squel[_0x6b36('0x4e')]()[_0x6b36('0x4f')]('id')[_0x6b36('0x4f')](_0x6b36('0x2c'))[_0x6b36('0x4f')](_0x6b36('0x50'))[_0x6b36('0x51')](_0x6b36('0x52'));var _0x3ec82=squel[_0x6b36('0x4e')]()[_0x6b36('0x4f')](_0x6b36('0x53'))[_0x6b36('0x4f')](_0x6b36('0x54'))[_0x6b36('0x4f')](_0x6b36('0x55'))['from'](_0x6b36('0x56'),'ui')['left_join'](_0x6b36('0x57'),'u',_0x6b36('0x58'));var _0x544d3b=squel[_0x6b36('0x4e')]()[_0x6b36('0x51')](_0x6b36('0x59'),'i')[_0x6b36('0x5a')](_0x6b36('0x5b'),'c',_0x6b36('0x5c'))[_0x6b36('0x5a')]('users','o','o.id\x20=\x20i.UserId')[_0x6b36('0x5a')](_0x6b36('0x5d'),'a',_0x6b36('0x5e'))['left_join'](_0x6b36('0x5f'),'me',_0x6b36('0x60'))[_0x6b36('0x5a')](_0x6b36('0x61'),'it',_0x6b36('0x62'))[_0x6b36('0x5a')]('tools_tags','t',_0x6b36('0x63'));var _0x594fb0=squel[_0x6b36('0x64')]();var _0x17041a=[];var _0x3ecdf7=squel[_0x6b36('0x64')]();var _0x19680e;if(_0x344fb3['query']['search']){_0x19680e=as['parseSearch'](_0x344fb3['query'][_0x6b36('0x65')]);var _0x267d5a=_0x19680e['sqlOperator'];for(var _0x523d73=0x0;_0x523d73<_0x19680e[_0x6b36('0x66')][_0x6b36('0x48')];_0x523d73++){var _0x29a26c=_0x19680e[_0x6b36('0x66')][_0x523d73];var _0xebfe55='i';var _0x3cd085=_[_0x6b36('0x67')](_0x171956,[_0x6b36('0x2c'),_0x29a26c[_0x6b36('0x4f')]]);if(!_0x3cd085){switch(_0x29a26c[_0x6b36('0x4f')]){case _0x6b36('0x68'):if(_0x29a26c['value']==0x1){_0x544d3b[_0x6b36('0x69')]('`'+_0x29a26c[_0x6b36('0x4f')]+_0x6b36('0x6a'));}else{_0x544d3b['having']('`'+_0x29a26c[_0x6b36('0x4f')]+_0x6b36('0x6b'));}break;case _0x6b36('0x6c'):if(_0x29a26c['operator']==='$substring'){if(_0x29a26c[_0x6b36('0x6d')][_0x6b36('0x31')]('\x20')[_0x6b36('0x48')]>0x1){_0x594fb0[_0x267d5a](_0x6b36('0x6e'),qs[_0x6b36('0x6f')](_0x29a26c[_0x6b36('0x6d')]),null);}else{var _0x1b7561='%'+_0x29a26c[_0x6b36('0x6d')]+'%';_0x594fb0[_0x267d5a](_0x6b36('0x70'),_0x1b7561,_0x1b7561,_0x1b7561);}}else{_0x3cd085=_[_0x6b36('0x67')](_0x171956,[_0x6b36('0x2c'),_0x6b36('0x71')]);_0x29a26c['field']='ContactId';_0x783293=as[_0x6b36('0x72')](_0xebfe55,_0x3cd085[_0x6b36('0x73')],_0x29a26c);_0x594fb0[_0x267d5a](_0x783293['text'],_0x783293[_0x6b36('0x6d')][_0x6b36('0x74')],_0x783293[_0x6b36('0x6d')][_0x6b36('0x20')]);}break;case _0x6b36('0x75'):var _0xfe7164=_0x29a26c[_0x6b36('0x6d')]['split'](',')[_0x6b36('0x41')](function(_0x34b7da){return Number(_0x34b7da);});_0xfe7164['forEach'](function(_0x2d84f0){_0x3ecdf7['or'](_0x6b36('0x76'),'%,'+_0x2d84f0+',%');});_0x17041a=_[_0x6b36('0x77')](_0x17041a,_0xfe7164);break;case _0x6b36('0x78'):if(_0x29a26c[_0x6b36('0x79')]===_0x6b36('0x7a')){_0x594fb0[_0x267d5a](_0x6b36('0x7b'),'%'+_0x29a26c[_0x6b36('0x6d')]+'%',null);}else{_0x3cd085=_[_0x6b36('0x67')](_0x171956,['name','UserId']);_0x29a26c['field']=_0x6b36('0x3a');_0x783293=as[_0x6b36('0x72')](_0xebfe55,_0x3cd085[_0x6b36('0x73')],_0x29a26c);_0x594fb0[_0x267d5a](_0x783293[_0x6b36('0x7c')],_0x783293[_0x6b36('0x6d')]['start'],_0x783293['value'][_0x6b36('0x20')]);}break;case _0x6b36('0x7d'):_0x783293=as[_0x6b36('0x72')]('me',null,_0x29a26c);_0x594fb0[_0x267d5a](_0x783293['text'],_0x783293[_0x6b36('0x6d')]['start'],_0x783293[_0x6b36('0x6d')][_0x6b36('0x20')]);break;}}else{var _0x783293=as[_0x6b36('0x72')](_0xebfe55,_0x3cd085[_0x6b36('0x73')],_0x29a26c);_0x594fb0[_0x267d5a](_0x783293[_0x6b36('0x7c')],_0x783293['value'][_0x6b36('0x74')],_0x783293['value'][_0x6b36('0x20')]);}}}else{var _0x589908=_(_0x344fb3[_0x6b36('0x42')])[_0x6b36('0x7e')]()[_0x6b36('0x41')](function(_0x4a3fd7){return _['some'](_0x171956,[_0x6b36('0x2c'),_0x4a3fd7])?_0x4a3fd7:undefined;})[_0x6b36('0x7f')]()['value']();if(!_[_0x6b36('0x80')](_0x589908)){_0x589908['forEach'](function(_0x34a790){if(_0x34a790===_0x6b36('0x81')){_0x544d3b[_0x6b36('0x82')](_0x6b36('0x83'),[][_0x6b36('0x84')](_0x344fb3[_0x6b36('0x42')][_0x34a790]));}else if(_0x34a790===_0x6b36('0x85')){var _0x234e3f=JSON[_0x6b36('0x86')](_0x344fb3['query'][_0x34a790])[_0x6b36('0x87')];var _0x15fe50=JSON[_0x6b36('0x86')](_0x344fb3[_0x6b36('0x42')][_0x34a790])[_0x6b36('0x88')];_0x544d3b[_0x6b36('0x82')](_0x6b36('0x89'),_0x234e3f,_0x15fe50);}else{if(_0x344fb3[_0x6b36('0x42')][_0x34a790]==='null'){_0x544d3b['where']('i.'+_0x34a790+'\x20IS\x20NULL');}else{_0x544d3b[_0x6b36('0x82')]('i.'+_0x34a790+_0x6b36('0x8a'),_0x344fb3[_0x6b36('0x42')][_0x34a790]);}}});}if(_0x344fb3[_0x6b36('0x42')][_0x6b36('0x8b')]){if(_0x344fb3[_0x6b36('0x42')][_0x6b36('0x8b')]==0x1){_0x544d3b['having'](_0x6b36('0x8c'));}else{_0x544d3b['having'](_0x6b36('0x8d'));}}if(_0x344fb3[_0x6b36('0x42')]['tag']){_0x17041a=_[_0x6b36('0x8e')](_0x344fb3[_0x6b36('0x42')][_0x6b36('0x8f')])?_0x344fb3['query'][_0x6b36('0x8f')]:new Array(_0x344fb3[_0x6b36('0x42')][_0x6b36('0x8f')]);_0x17041a[_0x6b36('0x32')](function(_0x485f9e){_0x3ecdf7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x485f9e+',%');});}if(_0x344fb3[_0x6b36('0x42')]['filter']){var _0x50a981=_0x344fb3['query']['filter'][_0x6b36('0x90')]('\x5c','\x5c\x5c')[_0x6b36('0x90')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x50a981)){_0x594fb0['or'](_0x6b36('0x91'),_0x50a981+'%');}else{_0x594fb0['or'](_0x6b36('0x92'),qs[_0x6b36('0x6f')](_0x50a981))['or']('i.from\x20LIKE\x20?',_0x50a981+'%')['or'](_0x6b36('0x93'),_0x50a981+'%');}}}_0x544d3b[_0x6b36('0x82')](_0x594fb0);_0x544d3b[_0x6b36('0x94')](_0x6b36('0x95'));var _0x5b6e62={'type':db['Sequelize'][_0x6b36('0x96')][_0x6b36('0x97')],'raw':!![]};var _0x1c8b8e=_0x544d3b[_0x6b36('0x98')]();_0x1c8b8e[_0x6b36('0x4f')](_0x6b36('0x95'));_0x1c8b8e[_0x6b36('0x4f')](_0x6b36('0x99'),_0x6b36('0x68'));if(_0x2525af[_0x6b36('0x4b')]){_0x2525af[_0x6b36('0x4b')][_0x6b36('0x32')](function(_0x531cf9){var _0x436ccc=_0x531cf9[0x0]===_0x6b36('0x9a')?_0x531cf9[0x0]:'i.'+_0x531cf9[0x0];_0x544d3b[_0x6b36('0x4b')](_0x436ccc,_0x531cf9[0x1]===_0x6b36('0x9b')?![]:!![]);});}if(!_[_0x6b36('0x80')](_0x17041a)){_0x544d3b[_0x6b36('0x69')](_0x3ecdf7);_0x1c8b8e[_0x6b36('0x82')](_0x6b36('0x9c'),_0x17041a);}BPromise[_0x6b36('0x9d')]()[_0x6b36('0x2a')](function(){if(!_0x19680e){if(_0x344fb3[_0x6b36('0x42')][_0x6b36('0x81')])return;_0x1c8b8e['where'](_0x6b36('0x9e'));_0x544d3b[_0x6b36('0x82')](_0x6b36('0x9e'));return;}if(_0x344fb3[_0x6b36('0x9f')][_0x6b36('0xa0')]!==_0x6b36('0xa1'))return;return _0x344fb3[_0x6b36('0x9f')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0x6b36('0x2a')](function(_0x260be3){if(_[_0x6b36('0x80')](_0x260be3)){_0x1c8b8e[_0x6b36('0x82')](_0x6b36('0xa2'));_0x544d3b[_0x6b36('0x82')](_0x6b36('0xa2'));}else{_0x1c8b8e[_0x6b36('0x82')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x260be3,'id'));_0x544d3b[_0x6b36('0x82')](_0x6b36('0x83'),_[_0x6b36('0x41')](_0x260be3,'id'));}});})[_0x6b36('0x2a')](function(){if(_0x344fb3['user']['role']===_0x6b36('0xa1')&&!_0x19680e&&!_0x344fb3[_0x6b36('0x42')][_0x6b36('0x81')])return[];return db[_0x6b36('0xa3')][_0x6b36('0x42')](_0x1c8b8e['toString'](),_0x5b6e62);})[_0x6b36('0x2a')](function(_0x17afe2){_0x8f941a[_0x6b36('0xa4')]=_0x17afe2[_0x6b36('0x48')];if(_0x8f941a[_0x6b36('0xa4')]===0x0)return[];return db[_0x6b36('0xa3')]['query'](_0x2794fc[_0x6b36('0xa5')](),_0x5b6e62)[_0x6b36('0x2a')](function(_0x22f334){_0x2b6dde=_[_0x6b36('0xa6')](_0x22f334,'id');_0x5b6e62=_[_0x6b36('0xa7')](_0x5b6e62,{'model':db[_0x6b36('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x344fb3[_0x6b36('0x42')][_0x6b36('0x47')]){_0x2525af[_0x6b36('0x46')][_0x6b36('0x32')](function(_0xc44a5a){_0x544d3b[_0x6b36('0x4f')]('i.'+_0xc44a5a);});}else{_0x544d3b['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x6b36('0x68'));_0x544d3b['field'](_0x6b36('0xa8'),_0x6b36('0xa9'));_0x544d3b[_0x6b36('0x4f')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x544d3b[_0x6b36('0x4f')](_0x6b36('0xaa'),'contactName');_0x544d3b[_0x6b36('0x4f')](_0x6b36('0xab'));_0x544d3b['field'](_0x6b36('0xac'),_0x6b36('0xad'));_0x544d3b[_0x6b36('0x4f')](_0x6b36('0xae'),_0x6b36('0xaf'));_0x544d3b['field']('c.email',_0x6b36('0xb0'));_0x544d3b[_0x6b36('0x4f')]('c.phone',_0x6b36('0xb1'));_0x544d3b[_0x6b36('0x4f')]('c.mobile',_0x6b36('0xb2'));_0x544d3b[_0x6b36('0x4f')](_0x6b36('0xb3'),_0x6b36('0xb4'));_0x544d3b[_0x6b36('0x4f')](_0x6b36('0xb5'),_0x6b36('0xb6'));_0x544d3b[_0x6b36('0x4f')](_0x6b36('0xb7'),'Owner.internal');_0x544d3b[_0x6b36('0x4f')](_0x6b36('0xb8'),_0x6b36('0x30'));}if(_0x2525af[_0x6b36('0x25')])_0x544d3b[_0x6b36('0x25')](_0x2525af[_0x6b36('0x25')]);if(_0x2525af['offset'])_0x544d3b[_0x6b36('0x23')](_0x2525af[_0x6b36('0x23')]);return db[_0x6b36('0xa3')][_0x6b36('0x42')](_0x544d3b[_0x6b36('0xa5')](),_0x5b6e62);})[_0x6b36('0x2a')](function(_0x4104cb){if(_0x4104cb[_0x6b36('0x48')]>0x0)_0x3ec82[_0x6b36('0x82')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x6b36('0x41')](_0x4104cb,'id'));return db[_0x6b36('0xa3')][_0x6b36('0x42')](_0x3ec82[_0x6b36('0xa5')](),_0x5b6e62)['then'](function(_0x5513dd){var _0x5158a9=_[_0x6b36('0xb9')](_0x5513dd,_0x6b36('0xba'));var _0x454c9e=[];_0x4104cb[_0x6b36('0x32')](function(_0x48efa0){_0x454c9e[_0x6b36('0x34')](updateOpenchannelInteraction(_0x48efa0,_0x2b6dde,_0x5158a9));});return BPromise[_0x6b36('0xbb')](_0x454c9e);});});})[_0x6b36('0x2a')](function(_0x11ae11){_0x8f941a[_0x6b36('0xbc')]=_0x11ae11;return _0x8f941a;})[_0x6b36('0x2a')](respondWithFilteredResult(_0x53dc04,_0x2525af))[_0x6b36('0xbd')](handleError(_0x53dc04,null));};exports[_0x6b36('0xbe')]=function(_0x1b6eeb,_0x32e235){var _0x4a92e1={};if(_0x1b6eeb[_0x6b36('0x42')][_0x6b36('0x73')]&&_0x1b6eeb['query']['type']===_0x6b36('0x51')){_0x4a92e1['from']=_0x1b6eeb[_0x6b36('0xbf')]['id'];}else{_0x4a92e1['id']=_0x1b6eeb[_0x6b36('0xbf')]['id'];}var _0x166ef2={'raw':![],'where':_0x4a92e1},_0x560d97={};_0x560d97['model']=_[_0x6b36('0x7e')](db[_0x6b36('0x3d')]['rawAttributes']);_0x560d97[_0x6b36('0x42')]=_[_0x6b36('0x7e')](_0x1b6eeb[_0x6b36('0x42')]);_0x560d97[_0x6b36('0x43')]=_[_0x6b36('0x44')](_0x560d97[_0x6b36('0x45')],_0x560d97['query']);_0x166ef2[_0x6b36('0x46')]=_[_0x6b36('0x44')](_0x560d97[_0x6b36('0x45')],qs[_0x6b36('0x47')](_0x1b6eeb[_0x6b36('0x42')][_0x6b36('0x47')]));_0x166ef2[_0x6b36('0x46')]=_0x166ef2[_0x6b36('0x46')][_0x6b36('0x48')]?_0x166ef2[_0x6b36('0x46')]:_0x560d97['model'];if(_0x1b6eeb[_0x6b36('0x42')][_0x6b36('0xc0')]){_0x166ef2[_0x6b36('0xc1')]=[{'all':!![]}];}_0x166ef2=_[_0x6b36('0xa7')]({},_0x166ef2,_0x1b6eeb['options']);return db[_0x6b36('0x3d')][_0x6b36('0x67')](_0x166ef2)['then'](handleEntityNotFound(_0x32e235,null))['then'](respondWithResult(_0x32e235,null))['catch'](handleError(_0x32e235,null));};exports[_0x6b36('0xc2')]=function(_0x4496b5,_0x2cec3f){return db[_0x6b36('0x3d')]['create'](_0x4496b5['body'],{})[_0x6b36('0x2a')](respondWithResult(_0x2cec3f,0xc9))[_0x6b36('0xbd')](handleError(_0x2cec3f,null));};exports['update']=function(_0x392685,_0x44bd75){if(_0x392685[_0x6b36('0x7d')]['id']){delete _0x392685[_0x6b36('0x7d')]['id'];}return db[_0x6b36('0x3d')][_0x6b36('0x67')]({'where':{'id':_0x392685['params']['id']}})[_0x6b36('0x2a')](handleEntityNotFound(_0x44bd75,null))[_0x6b36('0x2a')](saveUpdates(_0x392685[_0x6b36('0x7d')],null))[_0x6b36('0x2a')](respondWithResult(_0x44bd75,null))['catch'](handleError(_0x44bd75,null));};exports[_0x6b36('0xc3')]=function(_0x370e28,_0x21f5a8){return db[_0x6b36('0x3d')][_0x6b36('0x67')]({'where':{'id':_0x370e28[_0x6b36('0xbf')]['id']}})[_0x6b36('0x2a')](handleEntityNotFound(_0x21f5a8,null))[_0x6b36('0x2a')](removeEntity(_0x21f5a8,null))[_0x6b36('0xbd')](handleError(_0x21f5a8,null));};exports[_0x6b36('0xc4')]=function(_0x3e6399,_0xa15fa0){return db[_0x6b36('0x3d')]['describe']()[_0x6b36('0x2a')](respondWithResult(_0xa15fa0,null))[_0x6b36('0xbd')](handleError(_0xa15fa0,null));};exports['addMessage']=function(_0x3e511a,_0x3d238b,_0x46db14){return db[_0x6b36('0xc5')][_0x6b36('0x67')]({'where':{'id':_0x3e511a[_0x6b36('0xbf')]['id']}})[_0x6b36('0x2a')](handleEntityNotFound(_0x3d238b,null))[_0x6b36('0x2a')](function(_0x12931b){if(_0x12931b){return _0x12931b[_0x6b36('0xc6')](_0x3e511a[_0x6b36('0x7d')][_0x6b36('0xc7')],_['omit'](_0x3e511a[_0x6b36('0x7d')],[_0x6b36('0xc7'),'id'])||{});}})[_0x6b36('0x2a')](respondWithResult(_0x3d238b,null))['catch'](handleError(_0x3d238b,null));};exports[_0x6b36('0xc8')]=function(_0x2e67a0,_0x10ffeb,_0x567ec4){var _0x573aea={'raw':![],'where':{}};var _0x289d87={};var _0x230fb2={'count':0x0,'rows':[]};return db[_0x6b36('0x3d')]['findOne']({'where':{'id':_0x2e67a0[_0x6b36('0xbf')]['id']}})['then'](handleEntityNotFound(_0x10ffeb,null))[_0x6b36('0x2a')](function(_0x572d13){if(_0x572d13){_0x289d87['model']=_[_0x6b36('0x7e')](db[_0x6b36('0xc5')][_0x6b36('0x3e')]);_0x289d87['query']=_[_0x6b36('0x7e')](_0x2e67a0[_0x6b36('0x42')]);_0x289d87[_0x6b36('0x43')]=_['intersection'](_0x289d87[_0x6b36('0x45')],_0x289d87[_0x6b36('0x42')]);_0x573aea['attributes']=_['intersection'](_0x289d87['model'],qs[_0x6b36('0x47')](_0x2e67a0['query']['fields']));_0x573aea[_0x6b36('0x46')]=_0x573aea[_0x6b36('0x46')][_0x6b36('0x48')]?_0x573aea[_0x6b36('0x46')]:_0x289d87[_0x6b36('0x45')];if(!_0x2e67a0['query']['hasOwnProperty']('nolimit')){_0x573aea[_0x6b36('0x25')]=qs[_0x6b36('0x25')](_0x2e67a0['query'][_0x6b36('0x25')]);_0x573aea['offset']=qs[_0x6b36('0x23')](_0x2e67a0[_0x6b36('0x42')][_0x6b36('0x23')]);}_0x573aea[_0x6b36('0x4b')]=qs[_0x6b36('0x4c')](_0x2e67a0['query']['sort']);_0x573aea['where']=qs['filters'](_[_0x6b36('0x4d')](_0x2e67a0[_0x6b36('0x42')],_0x289d87[_0x6b36('0x43')]));_0x573aea['where'][_0x6b36('0xba')]=_0x572d13['id'];if(_0x2e67a0[_0x6b36('0x42')]['filter']){_0x573aea[_0x6b36('0x82')]=_['merge'](_0x573aea[_0x6b36('0x82')],{'$or':_[_0x6b36('0x41')](_0x573aea[_0x6b36('0x46')],function(_0x47de12){var _0x1145bc={};_0x1145bc[_0x47de12]={'$like':'%'+_0x2e67a0['query'][_0x6b36('0xc9')]+'%'};return _0x1145bc;})});}if(_0x2e67a0['query']['$gte']){var _0x896be1=_0x2e67a0[_0x6b36('0x42')][_0x6b36('0x87')][_0x6b36('0x31')](',');var _0x444740={};_0x444740[_0x896be1[0x0]]={'$gte':moment(_0x896be1[0x1])['format'](_0x6b36('0xca'))};_0x573aea[_0x6b36('0x82')]=_[_0x6b36('0xa7')](_0x573aea[_0x6b36('0x82')],_0x444740);}_0x573aea=_['merge']({},_0x573aea,_0x2e67a0[_0x6b36('0xcb')]);return db[_0x6b36('0xc5')][_0x6b36('0xa4')]({'where':_0x573aea['where']})[_0x6b36('0x2a')](function(_0x3c1cf4){_0x230fb2[_0x6b36('0xa4')]=_0x3c1cf4;if(_0x2e67a0[_0x6b36('0x42')]['includeAll']){_0x573aea[_0x6b36('0xc1')]=[{'all':!![]}];}return db[_0x6b36('0xc5')][_0x6b36('0xcc')](_0x573aea);})[_0x6b36('0x2a')](function(_0x4b1839){_0x230fb2[_0x6b36('0xbc')]=_0x4b1839;return _0x230fb2;});}})['then'](respondWithFilteredResult(_0x10ffeb,_0x573aea))[_0x6b36('0xbd')](handleError(_0x10ffeb,null));};exports[_0x6b36('0xcd')]=function(_0x19223f,_0x26f257,_0x51ccd6){return db[_0x6b36('0x3d')][_0x6b36('0x67')]({'where':{'id':_0x19223f[_0x6b36('0xbf')]['id']}})['then'](handleEntityNotFound(_0x26f257,null))[_0x6b36('0x2a')](function(_0x442753){if(_0x442753){return _0x442753['setTags'](_0x19223f[_0x6b36('0x7d')][_0x6b36('0xc7')],_['omit'](_0x19223f[_0x6b36('0x7d')],[_0x6b36('0xc7'),'id'])||{})[_0x6b36('0xce')](function(){return db[_0x6b36('0x75')][_0x6b36('0xcc')]({'attributes':['id',_0x6b36('0x2c'),_0x6b36('0x50')],'where':{'id':_0x19223f[_0x6b36('0x7d')][_0x6b36('0xc7')]}});})[_0x6b36('0x2a')](function(_0x5aa72c){socket[_0x6b36('0xcf')](_0x6b36('0xd0'),{'id':Number(_0x19223f[_0x6b36('0xbf')]['id']),'tags':_0x5aa72c||[]});return{'id':Number(_0x19223f[_0x6b36('0xbf')]['id']),'tags':_0x5aa72c||[]};});}})[_0x6b36('0x2a')](respondWithResult(_0x26f257,null))[_0x6b36('0xbd')](handleError(_0x26f257,null));};exports[_0x6b36('0xd1')]=function(_0x19ef68,_0x30d691,_0x4c90cc){return db[_0x6b36('0x3d')][_0x6b36('0x67')]({'where':{'id':_0x19ef68[_0x6b36('0xbf')]['id']}})[_0x6b36('0x2a')](handleEntityNotFound(_0x30d691,null))[_0x6b36('0x2a')](function(_0x2d5f35){if(_0x2d5f35){return _0x2d5f35[_0x6b36('0xd1')](_0x19ef68[_0x6b36('0x42')][_0x6b36('0xc7')]);}})[_0x6b36('0x2a')](respondWithStatusCode(_0x30d691,null))[_0x6b36('0xbd')](handleError(_0x30d691,null));};exports[_0x6b36('0xd2')]=function(_0x585a9d,_0x12aaf8){var _0x5a6acc=moment()[_0x6b36('0xd3')]()['toString']();var _0x4d1678=path[_0x6b36('0xd4')](config[_0x6b36('0xd5')],_0x6b36('0xd6'),'files','tmp');var _0x1c5980=path['join'](config[_0x6b36('0xd5')],_0x6b36('0xd6'),_0x6b36('0xd7'),_0x6b36('0xd8'));var _0x20e3f0=path[_0x6b36('0xd4')](_0x4d1678,_0x5a6acc);var _0x3c262c=util[_0x6b36('0xd9')](_0x6b36('0xda'),_0x585a9d[_0x6b36('0xbf')]['id'],_0x5a6acc);var _0x2bc6d9=path['join'](_0x4d1678,_0x3c262c);var _0x386a3e=[];_0x386a3e[_0x6b36('0x34')]({'model':db[_0x6b36('0x78')],'as':'User','attributes':['id',_0x6b36('0x2f')],'raw':!![]});_0x386a3e[_0x6b36('0x34')]({'model':db[_0x6b36('0xdb')],'as':_0x6b36('0x6c'),'attributes':['id',_0x6b36('0xdc'),_0x6b36('0xdd')],'raw':!![]});if(_0x585a9d['query'][_0x6b36('0xd8')]){_0x386a3e['push']({'model':db[_0x6b36('0xde')],'as':_0x6b36('0xde'),'raw':!![]});}var _0x209db7=[{'model':db['OpenchannelMessage'],'as':_0x6b36('0xdf'),'attributes':['id',_0x6b36('0x7d'),_0x6b36('0x85'),'direction',_0x6b36('0xe0'),_0x6b36('0x8b')],'include':_0x386a3e}];_0x209db7['push']({'model':db[_0x6b36('0xe1')],'as':_0x6b36('0xe2'),'attributes':['id',_0x6b36('0x2c')]});_0x209db7[_0x6b36('0x34')]({'model':db[_0x6b36('0x78')],'as':_0x6b36('0xe3'),'attributes':['id','fullname']});return db[_0x6b36('0x3d')]['find']({'where':{'id':_0x585a9d[_0x6b36('0xbf')]['id']},'include':_0x209db7})['then'](handleEntityNotFound(_0x12aaf8,null))[_0x6b36('0x2a')](function(_0x17ed52){if(_0x17ed52){var _0x50417c=_0x17ed52[_0x6b36('0xe4')]({'plain':!![]});fs[_0x6b36('0xe5')](_0x20e3f0);var _0x40a91f={'channel':'Openchannel','account':_0x50417c[_0x6b36('0xe2')]['name'],'agent':_0x50417c['Owner']?_0x50417c[_0x6b36('0xe3')][_0x6b36('0x2f')]:'N.A.','createdAt':moment(_0x50417c[_0x6b36('0x85')])['format'](_0x6b36('0xca'))[_0x6b36('0xa5')](),'closedAt':_0x50417c[_0x6b36('0x38')]?moment(_0x50417c['closedAt'])[_0x6b36('0xd9')](_0x6b36('0xca'))[_0x6b36('0xa5')]():'','disposition':_0x50417c['disposition'],'visibility':_0x50417c[_0x6b36('0xe6')]?'Public':_0x6b36('0xe7'),'messages':_(_0x50417c[_0x6b36('0xdf')])[_0x6b36('0xc9')]({'secret':![]})['map'](function(_0xa259f){if(_0xa259f[_0x6b36('0xde')]){var _0x28c7f4=path[_0x6b36('0xd4')](_0x1c5980,_0xa259f[_0x6b36('0xde')][_0x6b36('0xe8')]);if(fs['existsSync'](_0x28c7f4)){fs[_0x6b36('0xe9')](_0x28c7f4)[_0x6b36('0xea')](fs['createWriteStream'](path[_0x6b36('0xd4')](_0x20e3f0,_0xa259f[_0x6b36('0xde')][_0x6b36('0xe8')])));}}return{'date':moment(_0xa259f['createdAt'])['format'](_0x6b36('0xca'))[_0x6b36('0xa5')](),'sender':_0xa259f['direction']===_0x6b36('0xeb')?_0xa259f[_0x6b36('0x78')]?_0xa259f['User'][_0x6b36('0x2f')]:_0x6b36('0xec'):_0xa259f[_0x6b36('0x6c')][_0x6b36('0xdc')]+(_0xa259f[_0x6b36('0x6c')]['lastName']?'\x20'+_0xa259f['Contact'][_0x6b36('0xdd')]:''),'body':_0xa259f[_0x6b36('0xde')]?_0xa259f[_0x6b36('0xde')][_0x6b36('0xe8')]:_0xa259f[_0x6b36('0x7d')],'direction':_0xa259f[_0x6b36('0xed')]===_0x6b36('0xeb')?'A':'C','secret':_0xa259f['secret'],'read':_0xa259f[_0x6b36('0x8b')],'attachment':_0xa259f['Attachment']};})[_0x6b36('0x6d')]()};return ejs['renderFile'](path['join'](config[_0x6b36('0xd5')],_0x6b36('0xd6'),_0x6b36('0xee'),_0x6b36('0xef')),{'interaction':_0x40a91f})[_0x6b36('0x2a')](function(_0x412d8b){var _0x45346b=path[_0x6b36('0xd4')](_0x20e3f0,_0x6b36('0xf0')+_0x50417c['id']+'-'+_0x5a6acc+_0x6b36('0xf1'));var _0x13f6bb={'path':_0x45346b,'channel':_0x6b36('0xf2'),'interactionId':_0x50417c['id']};return pdf[_0x6b36('0xf3')](_0x412d8b,_0x13f6bb);})[_0x6b36('0x2a')](function(){return new BPromise(function(_0x4892ba,_0x30ff12){zipdir(_0x20e3f0,{'saveTo':_0x2bc6d9},function(_0x5229e3,_0x367ca2){if(_0x5229e3)return _0x30ff12(_0x5229e3);return _0x4892ba(_0x367ca2);});})['then'](function(){return new BPromise(function(_0x10c44c,_0x483e30){rimraf(_0x20e3f0,function(_0x490b08){if(_0x490b08)_0x483e30(_0x490b08);return _0x10c44c();});});})['then'](function(){return _0x12aaf8['download'](_0x2bc6d9,_0x3c262c,function(_0x5d9915){if(_0x5d9915){console[_0x6b36('0xf4')]('err',_0x5d9915);}else{fs[_0x6b36('0xf5')](_0x2bc6d9);}});});});}else{return _0x12aaf8[_0x6b36('0xf6')](0xc8);}})['catch'](handleError(_0x12aaf8,null));};
\ No newline at end of file
index e73af89..664b02c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe002=['emit','catch','hasOwnProperty','hook','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','findAll','then','length'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe002,0x1ba));var _0x2e00=function(_0x1b8d87,_0x4168fb){_0x1b8d87=_0x1b8d87-0x0;var _0x182b74=_0xe002[_0x1b8d87];return _0x182b74;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x2e00('0x0'))['db'][_0x2e00('0x1')];var OpenchannelMessage=require(_0x2e00('0x0'))['db'][_0x2e00('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x2e00('0x3')](0x0);var events={'afterCreate':_0x2e00('0x4'),'afterUpdate':_0x2e00('0x5'),'afterDestroy':_0x2e00('0x6')};function emitEvent(_0x5298b4){return function(_0x31f2c1,_0x3a446c,_0x59ab2e){_0x31f2c1[_0x2e00('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x46b7b0){_0x31f2c1[_0x2e00('0x8')](_0x2e00('0x9'),_0x46b7b0[_0x2e00('0xa')](function(_0x1dd5e5){return{'id':_0x1dd5e5['id']};}));return OpenchannelMessage[_0x2e00('0xb')]({'where':{'OpenchannelInteractionId':_0x31f2c1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2e00('0xc')](function(_0x5d2cda){_0x31f2c1[_0x2e00('0x8')]('unreadMessages',_0x5d2cda[_0x2e00('0xd')]);OpenchannelInteractionEvents[_0x2e00('0xe')](_0x5298b4+':'+_0x31f2c1['id'],_0x31f2c1);OpenchannelInteractionEvents['emit'](_0x5298b4,_0x31f2c1);_0x59ab2e(null);})[_0x2e00('0xf')](_0x59ab2e(null));};}for(var e in events){if(events[_0x2e00('0x10')](e)){var event=events[e];OpenchannelInteraction[_0x2e00('0x11')](e,emitEvent(event));}}module[_0x2e00('0x12')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0x9e7f=['getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9e7f,0xad));var _0xf9e7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9e7f[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xf9e7('0x0'))['db'][_0xf9e7('0x1')];var OpenchannelMessage=require(_0xf9e7('0x0'))['db'][_0xf9e7('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xf9e7('0x3')](0x0);var events={'afterCreate':_0xf9e7('0x4'),'afterUpdate':_0xf9e7('0x5'),'afterDestroy':_0xf9e7('0x6')};function emitEvent(_0x28b80c){return function(_0x48cfaf,_0xaea613,_0x585e61){_0x48cfaf[_0xf9e7('0x7')]({'attributes':['id'],'raw':!![]})[_0xf9e7('0x8')](function(_0x5379ec){_0x48cfaf[_0xf9e7('0x9')](_0xf9e7('0xa'),_0x5379ec[_0xf9e7('0xb')](function(_0x23c9b4){return{'id':_0x23c9b4['id']};}));return OpenchannelMessage[_0xf9e7('0xc')]({'where':{'OpenchannelInteractionId':_0x48cfaf['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf9e7('0x8')](function(_0x3c9087){_0x48cfaf['setDataValue'](_0xf9e7('0xd'),_0x3c9087[_0xf9e7('0xe')]);OpenchannelInteractionEvents[_0xf9e7('0xf')](_0x28b80c+':'+_0x48cfaf['id'],_0x48cfaf);OpenchannelInteractionEvents[_0xf9e7('0xf')](_0x28b80c,_0x48cfaf);_0x585e61(null);})['catch'](_0x585e61(null));};}for(var e in events){if(events[_0xf9e7('0x10')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xf9e7('0x11')]=OpenchannelInteractionEvents;
\ No newline at end of file
index 45a6c23..75d6db4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb89e=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','openchannel_interactions','utf8mb4','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0xb89e,0x177));var _0xeb89=function(_0x2fff83,_0x29d5fe){_0x2fff83=_0x2fff83-0x0;var _0xa2a722=_0xb89e[_0x2fff83];return _0xa2a722;};'use strict';var _=require('lodash');var util=require(_0xeb89('0x0'));var logger=require(_0xeb89('0x1'))(_0xeb89('0x2'));var moment=require(_0xeb89('0x3'));var BPromise=require(_0xeb89('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb89('0x5'));var rimraf=require(_0xeb89('0x6'));var config=require(_0xeb89('0x7'));var attributes=require(_0xeb89('0x8'));module[_0xeb89('0x9')]=function(_0x2f45f,_0x547dfe){return _0x2f45f['define']('OpenchannelInteraction',attributes,{'tableName':_0xeb89('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeb89('0xb'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x503fc2,_0x4d2424,_0x2f3736){if(_0x503fc2['changed'](_0xeb89('0xc'))){_0x503fc2['closedAt']=moment()[_0xeb89('0xd')](_0xeb89('0xe'));}_0x2f3736(null,_0x503fc2);}}});};
\ No newline at end of file
+var _0x9fa0=['rimraf','../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','closed','format','YYYY-MM-DD\x20HH:mm:ss','api','moment','bluebird','request-promise'];(function(_0x95e3c9,_0x5276d9){var _0xafc119=function(_0x28d295){while(--_0x28d295){_0x95e3c9['push'](_0x95e3c9['shift']());}};_0xafc119(++_0x5276d9);}(_0x9fa0,0x6c));var _0x09fa=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9fa0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x09fa('0x0'));var moment=require(_0x09fa('0x1'));var BPromise=require(_0x09fa('0x2'));var rp=require(_0x09fa('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x09fa('0x4'));var config=require(_0x09fa('0x5'));var attributes=require(_0x09fa('0x6'));module['exports']=function(_0xe2e03d,_0x5c10d2){return _0xe2e03d[_0x09fa('0x7')](_0x09fa('0x8'),attributes,{'tableName':_0x09fa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x09fa('0xa'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x182728,_0x4b0012,_0x1ad335){if(_0x182728['changed'](_0x09fa('0xb'))){_0x182728['closedAt']=moment()[_0x09fa('0xc')](_0x09fa('0xd'));}_0x1ad335(null,_0x182728);}}});};
\ No newline at end of file
index 990bb12..69f9ef7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaee0=['UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','where','attributes','limit','debug','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x2c5091,_0x28c913){var _0x114794=function(_0x30d9ec){while(--_0x30d9ec){_0x2c5091['push'](_0x2c5091['shift']());}};_0x114794(++_0x28c913);}(_0xaee0,0x66));var _0x0aee=function(_0x1765c4,_0x151565){_0x1765c4=_0x1765c4-0x0;var _0x56645f=_0xaee0[_0x1765c4];return _0x56645f;};'use strict';var _=require(_0x0aee('0x0'));var util=require('util');var moment=require(_0x0aee('0x1'));var BPromise=require(_0x0aee('0x2'));var rs=require(_0x0aee('0x3'));var fs=require('fs');var Redis=require(_0x0aee('0x4'));var db=require(_0x0aee('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0aee('0x6'))('rpc');var config=require(_0x0aee('0x7'));var jayson=require(_0x0aee('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x0aee('0x9')]=_[_0x0aee('0xa')](config[_0x0aee('0x9')],{'host':_0x0aee('0xb'),'port':0x18eb});var socket=require(_0x0aee('0xc'))(new Redis(config[_0x0aee('0x9')]));require(_0x0aee('0xd'))[_0x0aee('0xe')](socket);function respondWithRpcPromise(_0x3e463c,_0x209992,_0x4dec55){return new BPromise(function(_0x31f352,_0x9e8097){return client[_0x0aee('0xf')](_0x3e463c,_0x4dec55)[_0x0aee('0x10')](function(_0x4dfed9){logger[_0x0aee('0x11')](_0x0aee('0x12'),_0x209992,'request\x20sent');logger['debug'](_0x0aee('0x13'),_0x209992,_0x0aee('0x14'),JSON[_0x0aee('0x15')](_0x4dfed9));if(_0x4dfed9[_0x0aee('0x16')]){if(_0x4dfed9[_0x0aee('0x16')][_0x0aee('0x17')]===0x1f4){logger[_0x0aee('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x209992,_0x4dfed9[_0x0aee('0x16')]['message']);return _0x9e8097(_0x4dfed9['error']['message']);}logger[_0x0aee('0x16')](_0x0aee('0x12'),_0x209992,_0x4dfed9[_0x0aee('0x16')][_0x0aee('0x18')]);return _0x31f352(_0x4dfed9[_0x0aee('0x16')][_0x0aee('0x18')]);}else{logger[_0x0aee('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x209992,_0x0aee('0x14'));_0x31f352(_0x4dfed9[_0x0aee('0x19')][_0x0aee('0x18')]);}})[_0x0aee('0x1a')](function(_0x133338){logger[_0x0aee('0x16')](_0x0aee('0x12'),_0x209992,_0x133338);_0x9e8097(_0x133338);});});}exports[_0x0aee('0x1b')]=function(_0x43c888){var _0x5d81b3=this;return new Promise(function(_0x1312c8,_0x291b9e){return db[_0x0aee('0x1c')]['update'](_0x43c888[_0x0aee('0x1d')],{'raw':_0x43c888['options']?_0x43c888[_0x0aee('0x1e')][_0x0aee('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43c888['options']?_0x43c888[_0x0aee('0x1e')][_0x0aee('0x20')]||null:null,'attributes':_0x43c888[_0x0aee('0x1e')]?_0x43c888[_0x0aee('0x1e')][_0x0aee('0x21')]||null:null,'limit':_0x43c888['options']?_0x43c888[_0x0aee('0x1e')][_0x0aee('0x22')]||null:null})[_0x0aee('0x10')](function(_0x336560){logger['info'](_0x0aee('0x1b'),_0x43c888);logger[_0x0aee('0x23')]('UpdateOpenchannelInteraction',_0x43c888,JSON[_0x0aee('0x15')](_0x336560));_0x1312c8(_0x336560);})['catch'](function(_0x844d8f){logger[_0x0aee('0x16')](_0x0aee('0x1b'),_0x844d8f[_0x0aee('0x18')],_0x43c888);_0x291b9e(_0x5d81b3['error'](0x1f4,_0x844d8f[_0x0aee('0x18')]));});});};exports[_0x0aee('0x24')]=function(_0x305a5a){return new Promise(function(_0x489412,_0x2ee0c4){return db[_0x0aee('0x1c')][_0x0aee('0x25')]({'where':_0x305a5a[_0x0aee('0x1e')]?_0x305a5a[_0x0aee('0x1e')][_0x0aee('0x20')]||null:null})['then'](function(_0x328104){if(_0x328104){return _0x328104[_0x0aee('0x26')](_0x305a5a[_0x0aee('0x1d')][_0x0aee('0x27')],_[_0x0aee('0x28')](_0x305a5a[_0x0aee('0x1d')],[_0x0aee('0x27'),'id'])||{});}})[_0x0aee('0x29')](function(_0x5dfce0){logger[_0x0aee('0x11')]('AddTags',_0x305a5a);logger[_0x0aee('0x23')](_0x0aee('0x2a'),_0x305a5a,JSON[_0x0aee('0x15')](_0x5dfce0));_0x489412(_0x5dfce0);})[_0x0aee('0x1a')](function(_0x47db96){logger[_0x0aee('0x16')](_0x0aee('0x2a'),_0x47db96[_0x0aee('0x18')],_0x305a5a);_0x2ee0c4(_this[_0x0aee('0x16')](0x1f4,_0x47db96[_0x0aee('0x18')]));});});};
\ No newline at end of file
+var _0x9c8e=['attributes','limit','then','AddTagsToOpenchannelInteraction','find','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw'];(function(_0x5498b8,_0x3fd10c){var _0x13c31c=function(_0x1ecf6f){while(--_0x1ecf6f){_0x5498b8['push'](_0x5498b8['shift']());}};_0x13c31c(++_0x3fd10c);}(_0x9c8e,0x10c));var _0xe9c8=function(_0xdfccea,_0x5c2eca){_0xdfccea=_0xdfccea-0x0;var _0x110250=_0x9c8e[_0xdfccea];return _0x110250;};'use strict';var _=require(_0xe9c8('0x0'));var util=require(_0xe9c8('0x1'));var moment=require(_0xe9c8('0x2'));var BPromise=require(_0xe9c8('0x3'));var rs=require(_0xe9c8('0x4'));var fs=require('fs');var Redis=require(_0xe9c8('0x5'));var db=require(_0xe9c8('0x6'))['db'];var utils=require(_0xe9c8('0x7'));var logger=require(_0xe9c8('0x8'))(_0xe9c8('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe9c8('0xa')][_0xe9c8('0xb')]({'port':0x232a});config[_0xe9c8('0xc')]=_['defaults'](config['redis'],{'host':_0xe9c8('0xd'),'port':0x18eb});var socket=require(_0xe9c8('0xe'))(new Redis(config['redis']));require(_0xe9c8('0xf'))[_0xe9c8('0x10')](socket);function respondWithRpcPromise(_0x4876b8,_0x396e7d,_0x4d428f){return new BPromise(function(_0x4731c3,_0x29740b){return client[_0xe9c8('0x11')](_0x4876b8,_0x4d428f)['then'](function(_0x3ef459){logger[_0xe9c8('0x12')](_0xe9c8('0x13'),_0x396e7d,'request\x20sent');logger['debug'](_0xe9c8('0x14'),_0x396e7d,_0xe9c8('0x15'),JSON[_0xe9c8('0x16')](_0x3ef459));if(_0x3ef459[_0xe9c8('0x17')]){if(_0x3ef459[_0xe9c8('0x17')][_0xe9c8('0x18')]===0x1f4){logger[_0xe9c8('0x17')](_0xe9c8('0x13'),_0x396e7d,_0x3ef459[_0xe9c8('0x17')][_0xe9c8('0x19')]);return _0x29740b(_0x3ef459['error']['message']);}logger[_0xe9c8('0x17')](_0xe9c8('0x13'),_0x396e7d,_0x3ef459[_0xe9c8('0x17')]['message']);return _0x4731c3(_0x3ef459[_0xe9c8('0x17')][_0xe9c8('0x19')]);}else{logger[_0xe9c8('0x12')](_0xe9c8('0x13'),_0x396e7d,_0xe9c8('0x15'));_0x4731c3(_0x3ef459['result'][_0xe9c8('0x19')]);}})[_0xe9c8('0x1a')](function(_0x151d11){logger[_0xe9c8('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x396e7d,_0x151d11);_0x29740b(_0x151d11);});});}exports[_0xe9c8('0x1b')]=function(_0x14e79b){var _0x1c73a4=this;return new Promise(function(_0x8e21d2,_0x38150b){return db[_0xe9c8('0x1c')][_0xe9c8('0x1d')](_0x14e79b[_0xe9c8('0x1e')],{'raw':_0x14e79b['options']?_0x14e79b[_0xe9c8('0x1f')][_0xe9c8('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14e79b[_0xe9c8('0x1f')]?_0x14e79b['options']['where']||null:null,'attributes':_0x14e79b[_0xe9c8('0x1f')]?_0x14e79b[_0xe9c8('0x1f')][_0xe9c8('0x21')]||null:null,'limit':_0x14e79b['options']?_0x14e79b[_0xe9c8('0x1f')][_0xe9c8('0x22')]||null:null})[_0xe9c8('0x23')](function(_0x4cc6c9){logger[_0xe9c8('0x12')](_0xe9c8('0x1b'),_0x14e79b);logger['debug'](_0xe9c8('0x1b'),_0x14e79b,JSON[_0xe9c8('0x16')](_0x4cc6c9));_0x8e21d2(_0x4cc6c9);})['catch'](function(_0x4671db){logger[_0xe9c8('0x17')](_0xe9c8('0x1b'),_0x4671db[_0xe9c8('0x19')],_0x14e79b);_0x38150b(_0x1c73a4['error'](0x1f4,_0x4671db[_0xe9c8('0x19')]));});});};exports[_0xe9c8('0x24')]=function(_0x253824){return new Promise(function(_0xfa5085,_0x2912c0){return db[_0xe9c8('0x1c')][_0xe9c8('0x25')]({'where':_0x253824[_0xe9c8('0x1f')]?_0x253824[_0xe9c8('0x1f')]['where']||null:null})[_0xe9c8('0x23')](function(_0x31fd5a){if(_0x31fd5a){return _0x31fd5a[_0xe9c8('0x26')](_0x253824[_0xe9c8('0x1e')]['ids'],_[_0xe9c8('0x27')](_0x253824[_0xe9c8('0x1e')],[_0xe9c8('0x28'),'id'])||{});}})[_0xe9c8('0x29')](function(_0x534fd3){logger[_0xe9c8('0x12')](_0xe9c8('0x2a'),_0x253824);logger['debug'](_0xe9c8('0x2a'),_0x253824,JSON[_0xe9c8('0x16')](_0x534fd3));_0xfa5085(_0x534fd3);})['catch'](function(_0x84445c){logger[_0xe9c8('0x17')](_0xe9c8('0x2a'),_0x84445c[_0xe9c8('0x19')],_0x253824);_0x2912c0(_this[_0xe9c8('0x17')](0x1f4,_0x84445c['message']));});});};
\ No newline at end of file
index d6d577f..ce8246d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1974=['length','openchannelInteraction:','./openchannelInteraction.events','save','remove','removeListener'];(function(_0x19a1bf,_0xd46be){var _0x4e8a3e=function(_0x46ef61){while(--_0x46ef61){_0x19a1bf['push'](_0x19a1bf['shift']());}};_0x4e8a3e(++_0xd46be);}(_0x1974,0xce));var _0x4197=function(_0x15156,_0x152d2b){_0x15156=_0x15156-0x0;var _0xa89e36=_0x1974[_0x15156];return _0xa89e36;};'use strict';var OpenchannelInteractionEvents=require(_0x4197('0x0'));var events=[_0x4197('0x1'),_0x4197('0x2'),'update'];function createListener(_0xce70ce,_0x33aa24){return function(_0x49be50){_0x33aa24['emit'](_0xce70ce,_0x49be50);};}function removeListener(_0x3a8ad2,_0x4b9e28){return function(){OpenchannelInteractionEvents[_0x4197('0x3')](_0x3a8ad2,_0x4b9e28);};}exports['register']=function(_0x356e87){for(var _0x12ae03=0x0,_0x53db55=events[_0x4197('0x4')];_0x12ae03<_0x53db55;_0x12ae03++){var _0x3bdd50=events[_0x12ae03];var _0x4333f5=createListener(_0x4197('0x5')+_0x3bdd50,_0x356e87);OpenchannelInteractionEvents['on'](_0x3bdd50,_0x4333f5);}};
\ No newline at end of file
+var _0x65a0=['emit','removeListener','register','length','./openchannelInteraction.events','remove','update'];(function(_0x29e722,_0x33e8a7){var _0x5231ca=function(_0xdeada8){while(--_0xdeada8){_0x29e722['push'](_0x29e722['shift']());}};_0x5231ca(++_0x33e8a7);}(_0x65a0,0xb3));var _0x065a=function(_0x4740ce,_0x66ae48){_0x4740ce=_0x4740ce-0x0;var _0x3ccee7=_0x65a0[_0x4740ce];return _0x3ccee7;};'use strict';var OpenchannelInteractionEvents=require(_0x065a('0x0'));var events=['save',_0x065a('0x1'),_0x065a('0x2')];function createListener(_0x3373f1,_0x1dbadd){return function(_0x1cd700){_0x1dbadd[_0x065a('0x3')](_0x3373f1,_0x1cd700);};}function removeListener(_0x3fb305,_0x1621f4){return function(){OpenchannelInteractionEvents[_0x065a('0x4')](_0x3fb305,_0x1621f4);};}exports[_0x065a('0x5')]=function(_0x3b0b86){for(var _0x5f38cf=0x0,_0x1d04d3=events[_0x065a('0x6')];_0x5f38cf<_0x1d04d3;_0x5f38cf++){var _0x48ef74=events[_0x5f38cf];var _0x3d66d5=createListener('openchannelInteraction:'+_0x48ef74,_0x3b0b86);OpenchannelInteractionEvents['on'](_0x48ef74,_0x3d66d5);}};
\ No newline at end of file
index ffebca6..f463aa4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x290b68,_0x1f82af){var _0x2f23af=function(_0x5efc22){while(--_0x5efc22){_0x290b68['push'](_0x290b68['shift']());}};_0x2f23af(++_0x1f82af);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0xcb91[_0x35485a];return _0x5148e6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x2babe9,_0xc3e8ba){var _0x462541=function(_0x1f8982){while(--_0x1f8982){_0x2babe9['push'](_0x2babe9['shift']());}};_0x462541(++_0xc3e8ba);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./openchannelMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router;
\ No newline at end of file
index e30bf0f..72f0d7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39c4=['exports','BOOLEAN','out','DATE','STRING','TEXT'];(function(_0x526f17,_0x3e0e9f){var _0x29bfc3=function(_0x278127){while(--_0x278127){_0x526f17['push'](_0x526f17['shift']());}};_0x29bfc3(++_0x3e0e9f);}(_0x39c4,0x174));var _0x439c=function(_0x24104a,_0x5e678a){_0x24104a=_0x24104a-0x0;var _0x2d2bfe=_0x39c4[_0x24104a];return _0x2d2bfe;};'use strict';var Sequelize=require('sequelize');module[_0x439c('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x439c('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x439c('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x439c('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0x439c('0x3')]},'providerName':{'type':Sequelize[_0x439c('0x4')]},'providerResponse':{'type':Sequelize[_0x439c('0x5')]}};
\ No newline at end of file
+var _0x69d4=['DATE','STRING','TEXT','sequelize','exports','medium','BOOLEAN','out'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x69d4,0x83));var _0x469d=function(_0x19f9e6,_0x4f59a6){_0x19f9e6=_0x19f9e6-0x0;var _0x45c862=_0x69d4[_0x19f9e6];return _0x45c862;};'use strict';var Sequelize=require(_0x469d('0x0'));module[_0x469d('0x1')]={'body':{'type':Sequelize['TEXT'](_0x469d('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x469d('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x469d('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x469d('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x469d('0x5')]},'providerName':{'type':Sequelize[_0x469d('0x6')]},'providerResponse':{'type':Sequelize[_0x469d('0x7')]}};
\ No newline at end of file
index 78fe1c7..88a2695 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd64=['fieldName','type','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','keys','length','find','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','agent','OpenchannelInteraction','UserId','isNil','read1stAt','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','User','fullname','email','manual','SIP/%s','channel','event','EventManager','acceptmessage','../../config/logger','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','Sequelize','internal','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','index','map','OpenchannelMessage','rawAttributes'];(function(_0x4baff0,_0x1d953e){var _0x24b0da=function(_0x11aada){while(--_0x11aada){_0x4baff0['push'](_0x4baff0['shift']());}};_0x24b0da(++_0x1d953e);}(_0xdd64,0x1c4));var _0x4dd6=function(_0x34af92,_0x35c9c3){_0x34af92=_0x34af92-0x0;var _0x25297e=_0xdd64[_0x34af92];return _0x25297e;};'use strict';var emlformat=require(_0x4dd6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4dd6('0x1'));var jsonpatch=require(_0x4dd6('0x2'));var rp=require(_0x4dd6('0x3'));var moment=require('moment');var BPromise=require(_0x4dd6('0x4'));var Mustache=require('mustache');var util=require(_0x4dd6('0x5'));var path=require(_0x4dd6('0x6'));var sox=require(_0x4dd6('0x7'));var csv=require('to-csv');var ejs=require(_0x4dd6('0x8'));var fs=require('fs');var fs_extra=require(_0x4dd6('0x9'));var _=require(_0x4dd6('0xa'));var squel=require('squel');var crypto=require(_0x4dd6('0xb'));var jsforce=require(_0x4dd6('0xc'));var deskjs=require(_0x4dd6('0xd'));var toCsv=require(_0x4dd6('0xe'));var querystring=require(_0x4dd6('0xf'));var Papa=require(_0x4dd6('0x10'));var Redis=require(_0x4dd6('0x11'));var authService=require(_0x4dd6('0x12'));var qs=require(_0x4dd6('0x13'));var as=require(_0x4dd6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4dd6('0x15'));var utils=require('../../config/utils');var config=require(_0x4dd6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4dd6('0x17'))['db'];config[_0x4dd6('0x18')]=_[_0x4dd6('0x19')](config[_0x4dd6('0x18')],{'host':_0x4dd6('0x1a'),'port':0x18eb});var socket=require(_0x4dd6('0x1b'))(new Redis(config[_0x4dd6('0x18')]));require(_0x4dd6('0x1c'))['register'](socket);var jayson=require(_0x4dd6('0x1d'));var client=jayson[_0x4dd6('0x1e')][_0x4dd6('0x1f')]({'port':0x232c});var client9002=jayson[_0x4dd6('0x1e')][_0x4dd6('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xf738b,_0x341436,_0x373027,_0x42751f){return new BPromise(function(_0x95db9c,_0x103b94){var _0x57992a=_0x42751f||client;return _0x57992a[_0x4dd6('0x20')](_0xf738b,_0x373027)[_0x4dd6('0x21')](function(_0xb11e2f){logger[_0x4dd6('0x22')](_0x4dd6('0x23'),_0x341436,_0x4dd6('0x24'));logger[_0x4dd6('0x25')](_0x4dd6('0x26'),_0x341436,_0x4dd6('0x24'),JSON[_0x4dd6('0x27')](_0xb11e2f));if(_0xb11e2f[_0x4dd6('0x28')]){if(_0xb11e2f[_0x4dd6('0x28')]['code']===0x1f4){logger[_0x4dd6('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x341436,_0xb11e2f[_0x4dd6('0x28')][_0x4dd6('0x29')]);return _0x103b94(_0xb11e2f[_0x4dd6('0x28')][_0x4dd6('0x29')]);}logger[_0x4dd6('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x341436,_0xb11e2f['error'][_0x4dd6('0x29')]);return _0x95db9c(_0xb11e2f['error'][_0x4dd6('0x29')]);}else{logger[_0x4dd6('0x22')](_0x4dd6('0x23'),_0x341436,'request\x20sent');_0x95db9c(_0xb11e2f[_0x4dd6('0x2a')][_0x4dd6('0x29')]);}})[_0x4dd6('0x2b')](function(_0x472cd0){logger[_0x4dd6('0x28')](_0x4dd6('0x23'),_0x341436,_0x472cd0);_0x103b94(_0x472cd0);});});}function respondWithStatusCode(_0x54de73,_0x4ac64d){_0x4ac64d=_0x4ac64d||0xcc;return function(_0x5d3433){if(_0x5d3433){return _0x54de73[_0x4dd6('0x2c')](_0x4ac64d);}return _0x54de73['status'](_0x4ac64d)[_0x4dd6('0x2d')]();};}function respondWithResult(_0x313b3e,_0x41a97f){_0x41a97f=_0x41a97f||0xc8;return function(_0x217aeb){if(_0x217aeb){return _0x313b3e[_0x4dd6('0x2e')](_0x41a97f)[_0x4dd6('0x2f')](_0x217aeb);}};}function respondWithFilteredResult(_0x14a44e,_0x37282e){return function(_0x42b99a){if(_0x42b99a){var _0x3b6552=typeof _0x37282e[_0x4dd6('0x30')]==='undefined'&&typeof _0x37282e['limit']===_0x4dd6('0x31');var _0x4579a1=_0x42b99a[_0x4dd6('0x32')];var _0x5ee301=_0x3b6552?0x0:_0x37282e[_0x4dd6('0x30')];var _0x14b5bd=_0x3b6552?_0x42b99a[_0x4dd6('0x32')]:_0x37282e[_0x4dd6('0x30')]+_0x37282e[_0x4dd6('0x33')];var _0x3132cd;if(_0x14b5bd>=_0x4579a1){_0x14b5bd=_0x4579a1;_0x3132cd=0xc8;}else{_0x3132cd=0xce;}_0x14a44e[_0x4dd6('0x2e')](_0x3132cd);return _0x14a44e[_0x4dd6('0x34')](_0x4dd6('0x35'),_0x5ee301+'-'+_0x14b5bd+'/'+_0x4579a1)[_0x4dd6('0x2f')](_0x42b99a);}return null;};}function patchUpdates(_0x4fee68){return function(_0x2346d1){try{jsonpatch['apply'](_0x2346d1,_0x4fee68,!![]);}catch(_0x171697){return BPromise[_0x4dd6('0x36')](_0x171697);}return _0x2346d1[_0x4dd6('0x37')]();};}function saveUpdates(_0xf6472f,_0x1d4ceb){return function(_0x633caf){if(_0x633caf){return _0x633caf[_0x4dd6('0x38')](_0xf6472f)[_0x4dd6('0x21')](function(_0x5d3ff0){return _0x5d3ff0;});}return null;};}function removeEntity(_0x1d8eb6,_0x200754){return function(_0xb1347c){if(_0xb1347c){return _0xb1347c[_0x4dd6('0x39')]()[_0x4dd6('0x21')](function(){_0x1d8eb6[_0x4dd6('0x2e')](0xcc)[_0x4dd6('0x2d')]();});}};}function handleEntityNotFound(_0x46fe1d,_0x382736){return function(_0x568cb8){if(!_0x568cb8){_0x46fe1d[_0x4dd6('0x2c')](0x194);}return _0x568cb8;};}function handleError(_0x15f305,_0x5a265a){_0x5a265a=_0x5a265a||0x1f4;return function(_0x22a171){logger[_0x4dd6('0x28')](_0x22a171[_0x4dd6('0x3a')]);if(_0x22a171['name']){delete _0x22a171[_0x4dd6('0x3b')];}_0x15f305[_0x4dd6('0x2e')](_0x5a265a)['send'](_0x22a171);};}exports[_0x4dd6('0x3c')]=function(_0x5cb706,_0x48e222){var _0x5c70f8={},_0x1a366b={},_0x165e43={'count':0x0,'rows':[]};var _0x7bb8de=_[_0x4dd6('0x3d')](db[_0x4dd6('0x3e')][_0x4dd6('0x3f')],function(_0x2cd8c0){return{'name':_0x2cd8c0[_0x4dd6('0x40')],'type':_0x2cd8c0[_0x4dd6('0x41')]['key']};});_0x1a366b['model']=_[_0x4dd6('0x3d')](_0x7bb8de,_0x4dd6('0x3b'));_0x1a366b[_0x4dd6('0x42')]=_['keys'](_0x5cb706[_0x4dd6('0x42')]);_0x1a366b[_0x4dd6('0x43')]=_[_0x4dd6('0x44')](_0x1a366b[_0x4dd6('0x45')],_0x1a366b['query']);_0x5c70f8['attributes']=_[_0x4dd6('0x44')](_0x1a366b[_0x4dd6('0x45')],qs[_0x4dd6('0x46')](_0x5cb706[_0x4dd6('0x42')][_0x4dd6('0x46')]));_0x5c70f8[_0x4dd6('0x47')]=_0x5c70f8['attributes']['length']?_0x5c70f8[_0x4dd6('0x47')]:_0x1a366b[_0x4dd6('0x45')];if(!_0x5cb706[_0x4dd6('0x42')]['hasOwnProperty'](_0x4dd6('0x48'))){_0x5c70f8[_0x4dd6('0x33')]=qs['limit'](_0x5cb706['query']['limit']);_0x5c70f8['offset']=qs[_0x4dd6('0x30')](_0x5cb706[_0x4dd6('0x42')][_0x4dd6('0x30')]);}_0x5c70f8[_0x4dd6('0x49')]=qs[_0x4dd6('0x4a')](_0x5cb706['query'][_0x4dd6('0x4a')]);_0x5c70f8[_0x4dd6('0x4b')]=qs[_0x4dd6('0x43')](_[_0x4dd6('0x4c')](_0x5cb706[_0x4dd6('0x42')],_0x1a366b[_0x4dd6('0x43')]),_0x7bb8de);if(_0x5cb706[_0x4dd6('0x42')][_0x4dd6('0x4d')]){_0x5c70f8[_0x4dd6('0x4b')]=_[_0x4dd6('0x4e')](_0x5c70f8[_0x4dd6('0x4b')],{'$or':_[_0x4dd6('0x3d')](_0x7bb8de,function(_0x4d5100){if(_0x4d5100[_0x4dd6('0x41')]!=='VIRTUAL'){var _0x504fb6={};_0x504fb6[_0x4d5100[_0x4dd6('0x3b')]]={'$like':'%'+_0x5cb706[_0x4dd6('0x42')][_0x4dd6('0x4d')]+'%'};return _0x504fb6;}})});}_0x5c70f8=_[_0x4dd6('0x4e')]({},_0x5c70f8,_0x5cb706[_0x4dd6('0x4f')]);var _0x568ae7={'where':_0x5c70f8[_0x4dd6('0x4b')]};return db['OpenchannelMessage'][_0x4dd6('0x32')](_0x568ae7)[_0x4dd6('0x21')](function(_0x5137a9){_0x165e43['count']=_0x5137a9;if(_0x5cb706[_0x4dd6('0x42')][_0x4dd6('0x50')]){_0x5c70f8[_0x4dd6('0x51')]=[{'all':!![]}];}return db[_0x4dd6('0x3e')][_0x4dd6('0x52')](_0x5c70f8);})[_0x4dd6('0x21')](function(_0x88e0af){_0x165e43[_0x4dd6('0x53')]=_0x88e0af;return _0x165e43;})['then'](respondWithFilteredResult(_0x48e222,_0x5c70f8))[_0x4dd6('0x2b')](handleError(_0x48e222,null));};exports[_0x4dd6('0x54')]=function(_0x1a77b0,_0x15aa83){var _0x5d4b8b={'raw':!![],'where':{'id':_0x1a77b0[_0x4dd6('0x55')]['id']}},_0x35bf8c={};_0x35bf8c[_0x4dd6('0x45')]=_[_0x4dd6('0x56')](db['OpenchannelMessage']['rawAttributes']);_0x35bf8c[_0x4dd6('0x42')]=_[_0x4dd6('0x56')](_0x1a77b0[_0x4dd6('0x42')]);_0x35bf8c[_0x4dd6('0x43')]=_[_0x4dd6('0x44')](_0x35bf8c[_0x4dd6('0x45')],_0x35bf8c[_0x4dd6('0x42')]);_0x5d4b8b[_0x4dd6('0x47')]=_[_0x4dd6('0x44')](_0x35bf8c[_0x4dd6('0x45')],qs[_0x4dd6('0x46')](_0x1a77b0[_0x4dd6('0x42')][_0x4dd6('0x46')]));_0x5d4b8b['attributes']=_0x5d4b8b[_0x4dd6('0x47')][_0x4dd6('0x57')]?_0x5d4b8b[_0x4dd6('0x47')]:_0x35bf8c[_0x4dd6('0x45')];if(_0x1a77b0['query'][_0x4dd6('0x50')]){_0x5d4b8b[_0x4dd6('0x51')]=[{'all':!![]}];}_0x5d4b8b=_[_0x4dd6('0x4e')]({},_0x5d4b8b,_0x1a77b0[_0x4dd6('0x4f')]);return db[_0x4dd6('0x3e')][_0x4dd6('0x58')](_0x5d4b8b)[_0x4dd6('0x21')](handleEntityNotFound(_0x15aa83,null))[_0x4dd6('0x21')](respondWithResult(_0x15aa83,null))[_0x4dd6('0x2b')](handleError(_0x15aa83,null));};exports['create']=function(_0x32a1ed,_0x273491){return db['OpenchannelMessage']['create'](_0x32a1ed[_0x4dd6('0x59')],{})[_0x4dd6('0x21')](respondWithResult(_0x273491,0xc9))[_0x4dd6('0x2b')](handleError(_0x273491,null));};exports[_0x4dd6('0x38')]=function(_0x250e4a,_0x11d771){if(_0x250e4a[_0x4dd6('0x59')]['id']){delete _0x250e4a['body']['id'];}return db[_0x4dd6('0x3e')][_0x4dd6('0x58')]({'where':{'id':_0x250e4a[_0x4dd6('0x55')]['id']}})[_0x4dd6('0x21')](handleEntityNotFound(_0x11d771,null))[_0x4dd6('0x21')](saveUpdates(_0x250e4a[_0x4dd6('0x59')],null))[_0x4dd6('0x21')](respondWithResult(_0x11d771,null))[_0x4dd6('0x2b')](handleError(_0x11d771,null));};exports[_0x4dd6('0x39')]=function(_0x3f178a,_0x5b659e){return db[_0x4dd6('0x3e')][_0x4dd6('0x58')]({'where':{'id':_0x3f178a[_0x4dd6('0x55')]['id']}})[_0x4dd6('0x21')](handleEntityNotFound(_0x5b659e,null))[_0x4dd6('0x21')](removeEntity(_0x5b659e,null))[_0x4dd6('0x2b')](handleError(_0x5b659e,null));};exports['describe']=function(_0x42af93,_0x155035){return db[_0x4dd6('0x3e')][_0x4dd6('0x5a')]()[_0x4dd6('0x21')](respondWithResult(_0x155035,null))[_0x4dd6('0x2b')](handleError(_0x155035,null));};var interaction_log=require('../../config/logger')(_0x4dd6('0x5b'));exports[_0x4dd6('0x5c')]=function(_0x57d3fe,_0x263561,_0xc6cf7c){var _0x2962df={'agent':{},'channel':_0x4dd6('0x5d')};if(_0x57d3fe['body']['id']){delete _0x57d3fe[_0x4dd6('0x59')]['id'];}_0x57d3fe[_0x4dd6('0x59')][_0x4dd6('0x5e')]=!![];_0x57d3fe[_0x4dd6('0x59')][_0x4dd6('0x5f')]=moment()[_0x4dd6('0x60')](_0x4dd6('0x61'));_0x57d3fe[_0x4dd6('0x59')]['UserId']=_0x57d3fe[_0x4dd6('0x59')]['UserId']||_0x57d3fe['user']['id'];_0x2962df[_0x4dd6('0x62')]['id']=_0x57d3fe[_0x4dd6('0x59')]['UserId'];return db[_0x4dd6('0x3e')]['find']({'where':{'id':_0x57d3fe[_0x4dd6('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x263561,null))[_0x4dd6('0x21')](saveUpdates(_0x57d3fe[_0x4dd6('0x59')],null))[_0x4dd6('0x21')](function(_0x17dd79){if(_0x17dd79){_0x2962df[_0x4dd6('0x29')]=_0x17dd79['get']({'plain':!![]});return db[_0x4dd6('0x63')][_0x4dd6('0x58')]({'where':{'id':_0x17dd79['OpenchannelInteractionId']}});}return null;})[_0x4dd6('0x21')](handleEntityNotFound(_0x263561,null))[_0x4dd6('0x21')](function(_0x1f040f){if(_0x1f040f){return _0x1f040f[_0x4dd6('0x38')]({'UserId':_0x57d3fe['body'][_0x4dd6('0x64')],'read1stAt':_[_0x4dd6('0x65')](_0x1f040f[_0x4dd6('0x66')])?moment()['format'](_0x4dd6('0x61')):undefined});}return null;})[_0x4dd6('0x21')](function(_0x1797ad){if(_0x1797ad){_0x2962df[_0x4dd6('0x67')]=_0x1797ad[_0x4dd6('0x68')]({'plain':!![]});interaction_log['info'](_0x4dd6('0x69'),_0x57d3fe['user']['id'],_0x57d3fe['user'][_0x4dd6('0x3b')],_0x57d3fe[_0x4dd6('0x6a')]['role'],_0x2962df[_0x4dd6('0x67')]['id'],_0x57d3fe[_0x4dd6('0x59')]?JSON[_0x4dd6('0x27')](_0x57d3fe[_0x4dd6('0x59')]):'null');return respondWithRpcPromise(_0x4dd6('0x6b'),'acceptMessage',_0x2962df);}return null;})[_0x4dd6('0x21')](function(_0x2f1a7b){var _0x3f1b9f=_0x4dd6('0x6c')+_0x2f1a7b[_0x4dd6('0x29')]['ContactId'];return db[_0x4dd6('0x6d')][_0x4dd6('0x42')](_0x3f1b9f,{'type':db['Sequelize']['QueryTypes'][_0x4dd6('0x6e')],'raw':!![]})[_0x4dd6('0x21')](function(_0x4b6918){return _0x4b6918;});})[_0x4dd6('0x21')](function(_0x52d945){if(_0x52d945){_0x2962df[_0x4dd6('0x29')][_0x4dd6('0x6f')]=_0x52d945[0x0];if(!_0x57d3fe[_0x4dd6('0x59')][_0x4dd6('0x64')])return;return db[_0x4dd6('0x70')]['find']({'where':{'id':_0x57d3fe['body']['UserId'],'role':_0x4dd6('0x62')},'attributes':['id',_0x4dd6('0x3b'),_0x4dd6('0x71'),_0x4dd6('0x72'),'internal'],'raw':!![]});}return null;})[_0x4dd6('0x21')](function(_0x2c7c85){if(!_0x2c7c85)return null;_0x2962df[_0x4dd6('0x29')][_0x4dd6('0x62')]=_0x2c7c85;return _0x2962df;})[_0x4dd6('0x21')](function(_0x1afe78){if(_0x1afe78){if(_0x57d3fe[_0x4dd6('0x59')][_0x4dd6('0x73')]){_0x2962df[_0x4dd6('0x29')]['interface']=util['format'](_0x4dd6('0x74'),_0x57d3fe[_0x4dd6('0x6a')]['name']);_0x2962df[_0x4dd6('0x29')]['channel']=_0x2962df[_0x4dd6('0x75')];_0x2962df[_0x4dd6('0x29')]['motionChannel']=_0x2962df['channel'];_0x2962df['message'][_0x4dd6('0x76')]=_0x4dd6('0x5c');return respondWithRpcPromise(_0x4dd6('0x77'),_0x4dd6('0x77'),{'event':_0x4dd6('0x78'),'message':_0x2962df[_0x4dd6('0x29')]},client9002)[_0x4dd6('0x21')](function(){return _0x2962df;});}return _0x2962df;}return null;})[_0x4dd6('0x21')](respondWithResult(_0x263561,null))[_0x4dd6('0x2b')](handleError(_0x263561,null));};var interaction_log=require(_0x4dd6('0x79'))('openchannel-interactions');exports[_0x4dd6('0x36')]=function(_0x16abab,_0x2dd190,_0x46de6d){var _0x2c86b1={'agent':{},'channel':_0x4dd6('0x5d')};if(_0x16abab[_0x4dd6('0x59')]['id']){delete _0x16abab[_0x4dd6('0x59')]['id'];}_0x16abab[_0x4dd6('0x59')]['UserId']=_0x16abab[_0x4dd6('0x59')]['UserId']||_0x16abab['user']['id'];_0x2c86b1['agent']['id']=_0x16abab[_0x4dd6('0x59')]['UserId'];return db['OpenchannelMessage'][_0x4dd6('0x58')]({'where':{'id':_0x16abab[_0x4dd6('0x55')]['id'],'UserId':null}})[_0x4dd6('0x21')](handleEntityNotFound(_0x2dd190,null))[_0x4dd6('0x21')](function(_0x113510){if(_0x113510){_0x2c86b1[_0x4dd6('0x29')]=_0x113510[_0x4dd6('0x68')]({'plain':!![]});return db[_0x4dd6('0x63')][_0x4dd6('0x58')]({'where':{'id':_0x113510['OpenchannelInteractionId']}});}return null;})[_0x4dd6('0x21')](handleEntityNotFound(_0x2dd190,null))[_0x4dd6('0x21')](function(_0x28869c){if(_0x28869c){_0x2c86b1[_0x4dd6('0x67')]=_0x28869c['get']({'plain':!![]});interaction_log[_0x4dd6('0x22')](_0x4dd6('0x7a'),_0x16abab[_0x4dd6('0x6a')]['id'],_0x16abab[_0x4dd6('0x6a')][_0x4dd6('0x3b')],_0x16abab[_0x4dd6('0x6a')]['role'],_0x2c86b1[_0x4dd6('0x67')]['id'],_0x16abab[_0x4dd6('0x59')]?JSON['stringify'](_0x16abab[_0x4dd6('0x59')]):'null');return respondWithRpcPromise(_0x4dd6('0x7b'),_0x4dd6('0x7c'),_0x2c86b1);}return null;})[_0x4dd6('0x21')](function(_0x36ca5c){var _0x280b58='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x36ca5c[_0x4dd6('0x29')][_0x4dd6('0x7d')];return db['sequelize'][_0x4dd6('0x42')](_0x280b58,{'type':db[_0x4dd6('0x7e')]['QueryTypes'][_0x4dd6('0x6e')],'raw':!![]})[_0x4dd6('0x21')](function(_0x11689d){return _0x11689d;});})[_0x4dd6('0x21')](function(_0x52ff52){if(_0x52ff52){_0x2c86b1[_0x4dd6('0x29')][_0x4dd6('0x6f')]=_0x52ff52[0x0];if(!_0x16abab[_0x4dd6('0x59')][_0x4dd6('0x64')])return;return db[_0x4dd6('0x70')][_0x4dd6('0x58')]({'where':{'id':_0x16abab[_0x4dd6('0x59')][_0x4dd6('0x64')],'role':_0x4dd6('0x62')},'attributes':['id',_0x4dd6('0x3b'),_0x4dd6('0x71'),'email',_0x4dd6('0x7f')],'raw':!![]});}return null;})['then'](function(_0x262318){if(!_0x262318)return null;_0x2c86b1[_0x4dd6('0x29')][_0x4dd6('0x62')]=_0x262318;return _0x2c86b1;})[_0x4dd6('0x21')](function(_0x2656ad){if(_0x2656ad){_0x2656ad[_0x4dd6('0x29')]['interface']=util[_0x4dd6('0x60')](_0x4dd6('0x74'),_0x16abab['user'][_0x4dd6('0x3b')]);_0x2656ad[_0x4dd6('0x29')][_0x4dd6('0x75')]=_0x2c86b1[_0x4dd6('0x75')];_0x2656ad[_0x4dd6('0x29')]['motionChannel']=_0x2c86b1[_0x4dd6('0x75')];_0x2656ad['message']['event']=_0x4dd6('0x36');respondWithRpcPromise(_0x4dd6('0x77'),_0x4dd6('0x77'),{'event':_0x4dd6('0x80'),'message':_0x2656ad[_0x4dd6('0x29')]},client9002);return _0x2c86b1;}return null;})[_0x4dd6('0x21')](respondWithResult(_0x2dd190,null))[_0x4dd6('0x2b')](handleError(_0x2dd190,null));};
\ No newline at end of file
+var _0xef6d=['request-promise','moment','bluebird','mustache','path','ejs','fs-extra','squel','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','destroy','name','index','map','OpenchannelMessage','rawAttributes','fieldName','query','keys','attributes','model','fields','length','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','intersection','create','body','update','find','describe','../../config/logger','openchannel-interactions','accept','openchannel','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','contact','User','fullname','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','interaction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','sequelize','interface','rejectmessage','zip-dir','fast-json-patch'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xef6d,0xf8));var _0xdef6=function(_0x507a86,_0x3e37c9){_0x507a86=_0x507a86-0x0;var _0x472929=_0xef6d[_0x507a86];return _0x472929;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdef6('0x0'));var jsonpatch=require(_0xdef6('0x1'));var rp=require(_0xdef6('0x2'));var moment=require(_0xdef6('0x3'));var BPromise=require(_0xdef6('0x4'));var Mustache=require(_0xdef6('0x5'));var util=require('util');var path=require(_0xdef6('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdef6('0x7'));var fs=require('fs');var fs_extra=require(_0xdef6('0x8'));var _=require('lodash');var squel=require(_0xdef6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdef6('0xa'));var querystring=require(_0xdef6('0xb'));var Papa=require(_0xdef6('0xc'));var Redis=require('ioredis');var authService=require(_0xdef6('0xd'));var qs=require(_0xdef6('0xe'));var as=require(_0xdef6('0xf'));var hardwareService=require(_0xdef6('0x10'));var logger=require('../../config/logger')(_0xdef6('0x11'));var utils=require(_0xdef6('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdef6('0x13'))['db'];config[_0xdef6('0x14')]=_[_0xdef6('0x15')](config['redis'],{'host':_0xdef6('0x16'),'port':0x18eb});var socket=require(_0xdef6('0x17'))(new Redis(config['redis']));require(_0xdef6('0x18'))[_0xdef6('0x19')](socket);var jayson=require(_0xdef6('0x1a'));var client=jayson[_0xdef6('0x1b')][_0xdef6('0x1c')]({'port':0x232c});var client9002=jayson[_0xdef6('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c6847,_0x1e6943,_0x1e5aca,_0x372e2e){return new BPromise(function(_0x1b231b,_0x34532c){var _0x47bbc6=_0x372e2e||client;return _0x47bbc6['request'](_0x4c6847,_0x1e5aca)[_0xdef6('0x1d')](function(_0x22603b){logger[_0xdef6('0x1e')](_0xdef6('0x1f'),_0x1e6943,_0xdef6('0x20'));logger[_0xdef6('0x21')](_0xdef6('0x22'),_0x1e6943,_0xdef6('0x20'),JSON[_0xdef6('0x23')](_0x22603b));if(_0x22603b[_0xdef6('0x24')]){if(_0x22603b[_0xdef6('0x24')][_0xdef6('0x25')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x1e6943,_0x22603b[_0xdef6('0x24')][_0xdef6('0x26')]);return _0x34532c(_0x22603b['error'][_0xdef6('0x26')]);}logger[_0xdef6('0x24')](_0xdef6('0x1f'),_0x1e6943,_0x22603b['error']['message']);return _0x1b231b(_0x22603b[_0xdef6('0x24')][_0xdef6('0x26')]);}else{logger[_0xdef6('0x1e')](_0xdef6('0x1f'),_0x1e6943,_0xdef6('0x20'));_0x1b231b(_0x22603b[_0xdef6('0x27')][_0xdef6('0x26')]);}})['catch'](function(_0x21a7ad){logger[_0xdef6('0x24')](_0xdef6('0x1f'),_0x1e6943,_0x21a7ad);_0x34532c(_0x21a7ad);});});}function respondWithStatusCode(_0x18e676,_0x5d595b){_0x5d595b=_0x5d595b||0xcc;return function(_0x5540b9){if(_0x5540b9){return _0x18e676[_0xdef6('0x28')](_0x5d595b);}return _0x18e676[_0xdef6('0x29')](_0x5d595b)[_0xdef6('0x2a')]();};}function respondWithResult(_0x56bbbd,_0x242b85){_0x242b85=_0x242b85||0xc8;return function(_0x2cd1fc){if(_0x2cd1fc){return _0x56bbbd[_0xdef6('0x29')](_0x242b85)[_0xdef6('0x2b')](_0x2cd1fc);}};}function respondWithFilteredResult(_0x355b02,_0x516dff){return function(_0x401435){if(_0x401435){var _0x425c85=typeof _0x516dff['offset']===_0xdef6('0x2c')&&typeof _0x516dff[_0xdef6('0x2d')]===_0xdef6('0x2c');var _0xb27f65=_0x401435[_0xdef6('0x2e')];var _0x8a3c0=_0x425c85?0x0:_0x516dff[_0xdef6('0x2f')];var _0x6cb48=_0x425c85?_0x401435[_0xdef6('0x2e')]:_0x516dff[_0xdef6('0x2f')]+_0x516dff[_0xdef6('0x2d')];var _0x40640d;if(_0x6cb48>=_0xb27f65){_0x6cb48=_0xb27f65;_0x40640d=0xc8;}else{_0x40640d=0xce;}_0x355b02[_0xdef6('0x29')](_0x40640d);return _0x355b02[_0xdef6('0x30')](_0xdef6('0x31'),_0x8a3c0+'-'+_0x6cb48+'/'+_0xb27f65)[_0xdef6('0x2b')](_0x401435);}return null;};}function patchUpdates(_0x104b1d){return function(_0xe471df){try{jsonpatch[_0xdef6('0x32')](_0xe471df,_0x104b1d,!![]);}catch(_0x4e7d69){return BPromise['reject'](_0x4e7d69);}return _0xe471df[_0xdef6('0x33')]();};}function saveUpdates(_0x443560,_0x18a0b8){return function(_0x33ec54){if(_0x33ec54){return _0x33ec54['update'](_0x443560)[_0xdef6('0x1d')](function(_0x273a5b){return _0x273a5b;});}return null;};}function removeEntity(_0x33ca89,_0x3f1061){return function(_0x44ba97){if(_0x44ba97){return _0x44ba97[_0xdef6('0x34')]()['then'](function(){_0x33ca89[_0xdef6('0x29')](0xcc)[_0xdef6('0x2a')]();});}};}function handleEntityNotFound(_0x1aa21c,_0x3b87cd){return function(_0x2f555c){if(!_0x2f555c){_0x1aa21c[_0xdef6('0x28')](0x194);}return _0x2f555c;};}function handleError(_0x40e3f3,_0x41f824){_0x41f824=_0x41f824||0x1f4;return function(_0x266bfc){logger[_0xdef6('0x24')](_0x266bfc['stack']);if(_0x266bfc[_0xdef6('0x35')]){delete _0x266bfc[_0xdef6('0x35')];}_0x40e3f3['status'](_0x41f824)['send'](_0x266bfc);};}exports[_0xdef6('0x36')]=function(_0x2b3a28,_0x1c5f92){var _0x5cb0a9={},_0x51140b={},_0x37b937={'count':0x0,'rows':[]};var _0x195ece=_[_0xdef6('0x37')](db[_0xdef6('0x38')][_0xdef6('0x39')],function(_0x5ef809){return{'name':_0x5ef809[_0xdef6('0x3a')],'type':_0x5ef809['type']['key']};});_0x51140b['model']=_[_0xdef6('0x37')](_0x195ece,_0xdef6('0x35'));_0x51140b[_0xdef6('0x3b')]=_[_0xdef6('0x3c')](_0x2b3a28[_0xdef6('0x3b')]);_0x51140b['filters']=_['intersection'](_0x51140b['model'],_0x51140b['query']);_0x5cb0a9[_0xdef6('0x3d')]=_['intersection'](_0x51140b[_0xdef6('0x3e')],qs[_0xdef6('0x3f')](_0x2b3a28[_0xdef6('0x3b')][_0xdef6('0x3f')]));_0x5cb0a9[_0xdef6('0x3d')]=_0x5cb0a9[_0xdef6('0x3d')][_0xdef6('0x40')]?_0x5cb0a9[_0xdef6('0x3d')]:_0x51140b['model'];if(!_0x2b3a28[_0xdef6('0x3b')]['hasOwnProperty'](_0xdef6('0x41'))){_0x5cb0a9[_0xdef6('0x2d')]=qs[_0xdef6('0x2d')](_0x2b3a28['query'][_0xdef6('0x2d')]);_0x5cb0a9[_0xdef6('0x2f')]=qs[_0xdef6('0x2f')](_0x2b3a28[_0xdef6('0x3b')][_0xdef6('0x2f')]);}_0x5cb0a9[_0xdef6('0x42')]=qs['sort'](_0x2b3a28['query'][_0xdef6('0x43')]);_0x5cb0a9[_0xdef6('0x44')]=qs[_0xdef6('0x45')](_[_0xdef6('0x46')](_0x2b3a28[_0xdef6('0x3b')],_0x51140b[_0xdef6('0x45')]),_0x195ece);if(_0x2b3a28[_0xdef6('0x3b')]['filter']){_0x5cb0a9[_0xdef6('0x44')]=_[_0xdef6('0x47')](_0x5cb0a9[_0xdef6('0x44')],{'$or':_[_0xdef6('0x37')](_0x195ece,function(_0x27ad53){if(_0x27ad53[_0xdef6('0x48')]!==_0xdef6('0x49')){var _0x53192f={};_0x53192f[_0x27ad53[_0xdef6('0x35')]]={'$like':'%'+_0x2b3a28[_0xdef6('0x3b')][_0xdef6('0x4a')]+'%'};return _0x53192f;}})});}_0x5cb0a9=_[_0xdef6('0x47')]({},_0x5cb0a9,_0x2b3a28[_0xdef6('0x4b')]);var _0x597143={'where':_0x5cb0a9[_0xdef6('0x44')]};return db[_0xdef6('0x38')][_0xdef6('0x2e')](_0x597143)[_0xdef6('0x1d')](function(_0x5830c9){_0x37b937[_0xdef6('0x2e')]=_0x5830c9;if(_0x2b3a28[_0xdef6('0x3b')][_0xdef6('0x4c')]){_0x5cb0a9[_0xdef6('0x4d')]=[{'all':!![]}];}return db[_0xdef6('0x38')]['findAll'](_0x5cb0a9);})['then'](function(_0x557089){_0x37b937[_0xdef6('0x4e')]=_0x557089;return _0x37b937;})['then'](respondWithFilteredResult(_0x1c5f92,_0x5cb0a9))[_0xdef6('0x4f')](handleError(_0x1c5f92,null));};exports[_0xdef6('0x50')]=function(_0x54a7ca,_0x3add6c){var _0x4abced={'raw':!![],'where':{'id':_0x54a7ca[_0xdef6('0x51')]['id']}},_0x1263a5={};_0x1263a5['model']=_[_0xdef6('0x3c')](db['OpenchannelMessage']['rawAttributes']);_0x1263a5[_0xdef6('0x3b')]=_['keys'](_0x54a7ca['query']);_0x1263a5[_0xdef6('0x45')]=_['intersection'](_0x1263a5['model'],_0x1263a5['query']);_0x4abced[_0xdef6('0x3d')]=_[_0xdef6('0x52')](_0x1263a5[_0xdef6('0x3e')],qs[_0xdef6('0x3f')](_0x54a7ca[_0xdef6('0x3b')][_0xdef6('0x3f')]));_0x4abced[_0xdef6('0x3d')]=_0x4abced['attributes'][_0xdef6('0x40')]?_0x4abced[_0xdef6('0x3d')]:_0x1263a5[_0xdef6('0x3e')];if(_0x54a7ca['query']['includeAll']){_0x4abced[_0xdef6('0x4d')]=[{'all':!![]}];}_0x4abced=_[_0xdef6('0x47')]({},_0x4abced,_0x54a7ca[_0xdef6('0x4b')]);return db[_0xdef6('0x38')]['find'](_0x4abced)[_0xdef6('0x1d')](handleEntityNotFound(_0x3add6c,null))[_0xdef6('0x1d')](respondWithResult(_0x3add6c,null))['catch'](handleError(_0x3add6c,null));};exports[_0xdef6('0x53')]=function(_0x31ba5c,_0xe66aa4){return db[_0xdef6('0x38')][_0xdef6('0x53')](_0x31ba5c[_0xdef6('0x54')],{})[_0xdef6('0x1d')](respondWithResult(_0xe66aa4,0xc9))['catch'](handleError(_0xe66aa4,null));};exports[_0xdef6('0x55')]=function(_0x50f991,_0x579db1){if(_0x50f991[_0xdef6('0x54')]['id']){delete _0x50f991['body']['id'];}return db[_0xdef6('0x38')][_0xdef6('0x56')]({'where':{'id':_0x50f991['params']['id']}})['then'](handleEntityNotFound(_0x579db1,null))[_0xdef6('0x1d')](saveUpdates(_0x50f991[_0xdef6('0x54')],null))[_0xdef6('0x1d')](respondWithResult(_0x579db1,null))[_0xdef6('0x4f')](handleError(_0x579db1,null));};exports[_0xdef6('0x34')]=function(_0x8234ad,_0x114c2d){return db[_0xdef6('0x38')][_0xdef6('0x56')]({'where':{'id':_0x8234ad[_0xdef6('0x51')]['id']}})['then'](handleEntityNotFound(_0x114c2d,null))[_0xdef6('0x1d')](removeEntity(_0x114c2d,null))['catch'](handleError(_0x114c2d,null));};exports[_0xdef6('0x57')]=function(_0x267238,_0x41ccbf){return db['OpenchannelMessage'][_0xdef6('0x57')]()[_0xdef6('0x1d')](respondWithResult(_0x41ccbf,null))[_0xdef6('0x4f')](handleError(_0x41ccbf,null));};var interaction_log=require(_0xdef6('0x58'))(_0xdef6('0x59'));exports[_0xdef6('0x5a')]=function(_0x1a5368,_0x5e9b50,_0x3dfd4f){var _0x2f524d={'agent':{},'channel':_0xdef6('0x5b')};if(_0x1a5368[_0xdef6('0x54')]['id']){delete _0x1a5368['body']['id'];}_0x1a5368[_0xdef6('0x54')]['read']=!![];_0x1a5368['body']['readAt']=moment()[_0xdef6('0x5c')](_0xdef6('0x5d'));_0x1a5368[_0xdef6('0x54')][_0xdef6('0x5e')]=_0x1a5368[_0xdef6('0x54')][_0xdef6('0x5e')]||_0x1a5368[_0xdef6('0x5f')]['id'];_0x2f524d[_0xdef6('0x60')]['id']=_0x1a5368[_0xdef6('0x54')]['UserId'];return db[_0xdef6('0x38')]['find']({'where':{'id':_0x1a5368[_0xdef6('0x51')]['id'],'UserId':null}})[_0xdef6('0x1d')](handleEntityNotFound(_0x5e9b50,null))[_0xdef6('0x1d')](saveUpdates(_0x1a5368['body'],null))[_0xdef6('0x1d')](function(_0x5b2dc3){if(_0x5b2dc3){_0x2f524d[_0xdef6('0x26')]=_0x5b2dc3[_0xdef6('0x61')]({'plain':!![]});return db[_0xdef6('0x62')][_0xdef6('0x56')]({'where':{'id':_0x5b2dc3[_0xdef6('0x63')]}});}return null;})[_0xdef6('0x1d')](handleEntityNotFound(_0x5e9b50,null))[_0xdef6('0x1d')](function(_0x4e5916){if(_0x4e5916){return _0x4e5916[_0xdef6('0x55')]({'UserId':_0x1a5368['body']['UserId'],'read1stAt':_['isNil'](_0x4e5916['read1stAt'])?moment()[_0xdef6('0x5c')](_0xdef6('0x5d')):undefined});}return null;})['then'](function(_0x6ed66e){if(_0x6ed66e){_0x2f524d['interaction']=_0x6ed66e[_0xdef6('0x61')]({'plain':!![]});interaction_log[_0xdef6('0x1e')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1a5368[_0xdef6('0x5f')]['id'],_0x1a5368[_0xdef6('0x5f')][_0xdef6('0x35')],_0x1a5368[_0xdef6('0x5f')][_0xdef6('0x64')],_0x2f524d['interaction']['id'],_0x1a5368['body']?JSON[_0xdef6('0x23')](_0x1a5368[_0xdef6('0x54')]):'null');return respondWithRpcPromise(_0xdef6('0x65'),_0xdef6('0x66'),_0x2f524d);}return null;})[_0xdef6('0x1d')](function(_0x339b62){var _0xac8450=_0xdef6('0x67')+_0x339b62[_0xdef6('0x26')][_0xdef6('0x68')];return db['sequelize']['query'](_0xac8450,{'type':db['Sequelize'][_0xdef6('0x69')]['SELECT'],'raw':!![]})[_0xdef6('0x1d')](function(_0x33a975){return _0x33a975;});})['then'](function(_0x254ed1){if(_0x254ed1){_0x2f524d['message'][_0xdef6('0x6a')]=_0x254ed1[0x0];if(!_0x1a5368[_0xdef6('0x54')]['UserId'])return;return db[_0xdef6('0x6b')][_0xdef6('0x56')]({'where':{'id':_0x1a5368[_0xdef6('0x54')][_0xdef6('0x5e')],'role':_0xdef6('0x60')},'attributes':['id',_0xdef6('0x35'),_0xdef6('0x6c'),'email',_0xdef6('0x6d')],'raw':!![]});}return null;})[_0xdef6('0x1d')](function(_0x430851){if(!_0x430851)return null;_0x2f524d[_0xdef6('0x26')][_0xdef6('0x60')]=_0x430851;return _0x2f524d;})[_0xdef6('0x1d')](function(_0x10a057){if(_0x10a057){if(_0x1a5368['body'][_0xdef6('0x6e')]){_0x2f524d['message']['interface']=util[_0xdef6('0x5c')](_0xdef6('0x6f'),_0x1a5368['user'][_0xdef6('0x35')]);_0x2f524d['message'][_0xdef6('0x70')]=_0x2f524d[_0xdef6('0x70')];_0x2f524d[_0xdef6('0x26')][_0xdef6('0x71')]=_0x2f524d[_0xdef6('0x70')];_0x2f524d['message'][_0xdef6('0x72')]=_0xdef6('0x5a');return respondWithRpcPromise('EventManager',_0xdef6('0x73'),{'event':_0xdef6('0x74'),'message':_0x2f524d[_0xdef6('0x26')]},client9002)[_0xdef6('0x1d')](function(){return _0x2f524d;});}return _0x2f524d;}return null;})[_0xdef6('0x1d')](respondWithResult(_0x5e9b50,null))['catch'](handleError(_0x5e9b50,null));};var interaction_log=require('../../config/logger')(_0xdef6('0x59'));exports[_0xdef6('0x75')]=function(_0x5a4f72,_0x4b8b0f,_0x238418){var _0xa30405={'agent':{},'channel':_0xdef6('0x5b')};if(_0x5a4f72[_0xdef6('0x54')]['id']){delete _0x5a4f72['body']['id'];}_0x5a4f72[_0xdef6('0x54')][_0xdef6('0x5e')]=_0x5a4f72[_0xdef6('0x54')][_0xdef6('0x5e')]||_0x5a4f72['user']['id'];_0xa30405['agent']['id']=_0x5a4f72[_0xdef6('0x54')][_0xdef6('0x5e')];return db['OpenchannelMessage'][_0xdef6('0x56')]({'where':{'id':_0x5a4f72[_0xdef6('0x51')]['id'],'UserId':null}})[_0xdef6('0x1d')](handleEntityNotFound(_0x4b8b0f,null))[_0xdef6('0x1d')](function(_0x546944){if(_0x546944){_0xa30405[_0xdef6('0x26')]=_0x546944['get']({'plain':!![]});return db[_0xdef6('0x62')]['find']({'where':{'id':_0x546944[_0xdef6('0x63')]}});}return null;})[_0xdef6('0x1d')](handleEntityNotFound(_0x4b8b0f,null))['then'](function(_0x433da4){if(_0x433da4){_0xa30405[_0xdef6('0x76')]=_0x433da4['get']({'plain':!![]});interaction_log[_0xdef6('0x1e')](_0xdef6('0x77'),_0x5a4f72[_0xdef6('0x5f')]['id'],_0x5a4f72[_0xdef6('0x5f')]['name'],_0x5a4f72[_0xdef6('0x5f')][_0xdef6('0x64')],_0xa30405[_0xdef6('0x76')]['id'],_0x5a4f72['body']?JSON['stringify'](_0x5a4f72['body']):_0xdef6('0x78'));return respondWithRpcPromise('RejectMessage',_0xdef6('0x79'),_0xa30405);}return null;})[_0xdef6('0x1d')](function(_0x954ad6){var _0xec290b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x954ad6[_0xdef6('0x26')][_0xdef6('0x68')];return db[_0xdef6('0x7a')][_0xdef6('0x3b')](_0xec290b,{'type':db['Sequelize'][_0xdef6('0x69')]['SELECT'],'raw':!![]})[_0xdef6('0x1d')](function(_0x39a783){return _0x39a783;});})[_0xdef6('0x1d')](function(_0x4d56bd){if(_0x4d56bd){_0xa30405['message'][_0xdef6('0x6a')]=_0x4d56bd[0x0];if(!_0x5a4f72['body'][_0xdef6('0x5e')])return;return db[_0xdef6('0x6b')][_0xdef6('0x56')]({'where':{'id':_0x5a4f72[_0xdef6('0x54')][_0xdef6('0x5e')],'role':_0xdef6('0x60')},'attributes':['id',_0xdef6('0x35'),_0xdef6('0x6c'),'email','internal'],'raw':!![]});}return null;})[_0xdef6('0x1d')](function(_0x170023){if(!_0x170023)return null;_0xa30405[_0xdef6('0x26')][_0xdef6('0x60')]=_0x170023;return _0xa30405;})[_0xdef6('0x1d')](function(_0x8e58d3){if(_0x8e58d3){_0x8e58d3[_0xdef6('0x26')][_0xdef6('0x7b')]=util[_0xdef6('0x5c')]('SIP/%s',_0x5a4f72[_0xdef6('0x5f')][_0xdef6('0x35')]);_0x8e58d3[_0xdef6('0x26')][_0xdef6('0x70')]=_0xa30405[_0xdef6('0x70')];_0x8e58d3[_0xdef6('0x26')][_0xdef6('0x71')]=_0xa30405['channel'];_0x8e58d3[_0xdef6('0x26')][_0xdef6('0x72')]=_0xdef6('0x75');respondWithRpcPromise('EventManager','EventManager',{'event':_0xdef6('0x7c'),'message':_0x8e58d3['message']},client9002);return _0xa30405;}return null;})['then'](respondWithResult(_0x4b8b0f,null))[_0xdef6('0x4f')](handleError(_0x4b8b0f,null));};
\ No newline at end of file
index 2f9ea21..4610dda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa805=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0xea5313,_0x5ced37){var _0x5ca006=function(_0x5d0ef3){while(--_0x5d0ef3){_0xea5313['push'](_0xea5313['shift']());}};_0x5ca006(++_0x5ced37);}(_0xa805,0x72));var _0x5a80=function(_0x1142e0,_0x1fa675){_0x1142e0=_0x1142e0-0x0;var _0x1ddeac=_0xa805[_0x1142e0];return _0x1ddeac;};'use strict';var EventEmitter=require(_0x5a80('0x0'));var OpenchannelMessage=require(_0x5a80('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x5a80('0x2')](0x0);var events={'afterCreate':_0x5a80('0x3'),'afterUpdate':_0x5a80('0x4'),'afterDestroy':_0x5a80('0x5')};function emitEvent(_0x3cdf17){return function(_0x9e540e,_0x17b4ef,_0x48e680){OpenchannelMessageEvents[_0x5a80('0x6')](_0x3cdf17+':'+_0x9e540e['id'],_0x9e540e);OpenchannelMessageEvents[_0x5a80('0x6')](_0x3cdf17,_0x9e540e);_0x48e680(null);};}for(var e in events){if(events[_0x5a80('0x7')](e)){var event=events[e];OpenchannelMessage[_0x5a80('0x8')](e,emitEvent(event));}}module[_0x5a80('0x9')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0x36ef=['OpenchannelMessage','setMaxListeners','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x5e9d0d,_0x4a724b){var _0x1e349a=function(_0x2c8c6f){while(--_0x2c8c6f){_0x5e9d0d['push'](_0x5e9d0d['shift']());}};_0x1e349a(++_0x4a724b);}(_0x36ef,0x12b));var _0xf36e=function(_0x5f34e1,_0x5e48a2){_0x5f34e1=_0x5f34e1-0x0;var _0xca89d1=_0x36ef[_0x5f34e1];return _0xca89d1;};'use strict';var EventEmitter=require(_0xf36e('0x0'));var OpenchannelMessage=require(_0xf36e('0x1'))['db'][_0xf36e('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xf36e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4adcbf){return function(_0x48c9d4,_0x9f54c,_0x22f62f){OpenchannelMessageEvents[_0xf36e('0x4')](_0x4adcbf+':'+_0x48c9d4['id'],_0x48c9d4);OpenchannelMessageEvents['emit'](_0x4adcbf,_0x48c9d4);_0x22f62f(null);};}for(var e in events){if(events[_0xf36e('0x5')](e)){var event=events[e];OpenchannelMessage[_0xf36e('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
index fdee626..b6dc6a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc22e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','catch','error','CmContact','OpenchannelAccount','find','OpenchannelAccountId','Contact','keys','replyUri','info','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','POST','afterCreate','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x7feb90,_0x28e700){var _0x3c5b33=function(_0x113cfa){while(--_0x113cfa){_0x7feb90['push'](_0x7feb90['shift']());}};_0x3c5b33(++_0x28e700);}(_0xc22e,0x1d3));var _0xec22=function(_0x263bea,_0x3d03d7){_0x263bea=_0x263bea-0x0;var _0x125a3e=_0xc22e[_0x263bea];return _0x125a3e;};'use strict';var _=require('lodash');var util=require(_0xec22('0x0'));var logger=require(_0xec22('0x1'))(_0xec22('0x2'));var moment=require(_0xec22('0x3'));var BPromise=require(_0xec22('0x4'));var rp=require(_0xec22('0x5'));var fs=require('fs');var path=require(_0xec22('0x6'));var rimraf=require(_0xec22('0x7'));var config=require(_0xec22('0x8'));var attributes=require(_0xec22('0x9'));module[_0xec22('0xa')]=function(_0x465e50,_0x171762){return _0x465e50[_0xec22('0xb')](_0xec22('0xc'),attributes,{'tableName':_0xec22('0xd'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0xec22('0xe')],'type':_0xec22('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2ce38d,_0x3c811d,_0x156bf8){var _0x3f3fb6=_0x465e50['models'];var _0x1a8a47=_0x2ce38d[_0xec22('0x10')]({'plain':!![]});if(_0x1a8a47[_0xec22('0x11')][_0xec22('0x12')]()==='in'||_0x1a8a47[_0xec22('0x11')][_0xec22('0x12')]()===_0xec22('0x13')&&!_0x1a8a47[_0xec22('0x14')]&&!_['isNil'](_0x1a8a47[_0xec22('0x15')])){_0x3f3fb6[_0xec22('0x16')][_0xec22('0x17')]({'where':{'id':_0x1a8a47[_0xec22('0x18')]}})[_0xec22('0x19')](function(_0x1126fa){if(_0x1126fa){_0x1126fa[_0xec22('0x1a')]({'lastMsgAt':_0x1a8a47['createdAt'],'lastMsgDirection':_0x1a8a47['direction'][_0xec22('0x12')]()});}})[_0xec22('0x1b')](function(_0x24eced){console[_0xec22('0x1c')](_0x24eced);});}if(_0x1a8a47[_0xec22('0x11')]==='out'&&!_0x1a8a47['secret']){var _0x19b68f;_0x3f3fb6[_0xec22('0x1d')]['describe']()['then'](function(_0x3ecea6){return _0x3f3fb6[_0xec22('0x1e')][_0xec22('0x1f')]({'where':{'id':_0x1a8a47[_0xec22('0x20')]},'include':[{'model':_0x3f3fb6[_0xec22('0x16')],'as':'Interactions','where':{'id':_0x1a8a47[_0xec22('0x18')]},'limit':0x1,'include':[{'model':_0x3f3fb6[_0xec22('0x1d')],'as':_0xec22('0x21'),'attributes':_[_0xec22('0x22')](_0x3ecea6)}]}]});})[_0xec22('0x19')](function(_0x362e57){_0x19b68f=_0x362e57[_0xec22('0x10')]({'plain':!![]});if(_0x19b68f&&_0x19b68f[_0xec22('0x23')]){logger[_0xec22('0x24')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util['format'](_0xec22('0x25'),_0x1a8a47['id'],_0x19b68f[_0xec22('0x23')]));if(_0x19b68f['Interactions']&&_0x19b68f[_0xec22('0x26')][_0xec22('0x27')]){_0x1a8a47[_0xec22('0x28')]=_['omit'](_0x19b68f[_0xec22('0x26')][0x0],_0xec22('0x21'));_0x1a8a47[_0xec22('0x21')]=_0x19b68f['Interactions'][0x0]['Contact'];}var _0x3c811d={'method':_0xec22('0x29'),'uri':encodeURI(_0x19b68f['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3c811d['method']){case'GET':_0x3c811d['qs']=_0x1a8a47;break;case _0xec22('0x29'):_0x3c811d[_0xec22('0xe')]=_0x1a8a47;break;}return rp(_0x3c811d)['then'](function(_0x4a8bb0){logger[_0xec22('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0xec22('0x2a'),util[_0xec22('0x2b')](_0xec22('0x2c'),_0x1a8a47['id'],_0x19b68f[_0xec22('0x23')]));if(_0x4a8bb0['body'][_0xec22('0x2d')]&&_0x4a8bb0[_0xec22('0xe')]['threadId']!=_0x1a8a47['Interaction']['threadId']){return _0x3f3fb6[_0xec22('0x16')]['update']({'threadId':_0x4a8bb0[_0xec22('0xe')][_0xec22('0x2d')]},{'where':{'id':_0x1a8a47['Interaction']['id']}});}else{return;}})['then'](function(){return _0x2ce38d[_0xec22('0x1a')]({'read':!![]});})[_0xec22('0x1b')](function(_0x19d528){logger[_0xec22('0x1c')]('OpenchannelMessage,\x20%s,\x20%s',_0xec22('0x2a'),util['inspect'](_0x19d528,{'showHidden':![],'depth':null}));_0x156bf8();});}else{_0x156bf8();}})['finally'](function(){_0x156bf8();});}else{_0x156bf8();}}},'charset':'utf8mb4','collate':_0xec22('0x2e')});};
\ No newline at end of file
+var _0x2df0=['length','omit','POST','replyUri','GET','OpenchannelMessage,\x20%s,\x20%s','threadId','Interaction','catch','inspect','finally','utf8mb4','lodash','util','api','bluebird','request-promise','path','rimraf','./openchannelMessage.attributes','define','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','error','CmContact','OpenchannelAccount','OpenchannelAccountId','Contact','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions'];(function(_0x553e7d,_0x1eabe3){var _0xb973e=function(_0x4be7ce){while(--_0x4be7ce){_0x553e7d['push'](_0x553e7d['shift']());}};_0xb973e(++_0x1eabe3);}(_0x2df0,0x9f));var _0x02df=function(_0xa31086,_0xdc718a){_0xa31086=_0xa31086-0x0;var _0x732df0=_0x2df0[_0xa31086];return _0x732df0;};'use strict';var _=require(_0x02df('0x0'));var util=require(_0x02df('0x1'));var logger=require('../../config/logger')(_0x02df('0x2'));var moment=require('moment');var BPromise=require(_0x02df('0x3'));var rp=require(_0x02df('0x4'));var fs=require('fs');var path=require(_0x02df('0x5'));var rimraf=require(_0x02df('0x6'));var config=require('../../config/environment');var attributes=require(_0x02df('0x7'));module['exports']=function(_0xac1ef0,_0x26ba56){return _0xac1ef0[_0x02df('0x8')](_0x02df('0x9'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x02df('0xa'),'fields':[_0x02df('0xb')],'type':_0x02df('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c9a07,_0x5c8c01,_0xff42be){var _0x17711c=_0xac1ef0[_0x02df('0xd')];var _0x5aae62=_0x5c9a07[_0x02df('0xe')]({'plain':!![]});if(_0x5aae62['direction'][_0x02df('0xf')]()==='in'||_0x5aae62[_0x02df('0x10')][_0x02df('0xf')]()===_0x02df('0x11')&&!_0x5aae62[_0x02df('0x12')]&&!_[_0x02df('0x13')](_0x5aae62[_0x02df('0x14')])){_0x17711c[_0x02df('0x15')][_0x02df('0x16')]({'where':{'id':_0x5aae62[_0x02df('0x17')]}})[_0x02df('0x18')](function(_0x265370){if(_0x265370){_0x265370[_0x02df('0x19')]({'lastMsgAt':_0x5aae62[_0x02df('0x1a')],'lastMsgDirection':_0x5aae62[_0x02df('0x10')][_0x02df('0xf')]()});}})['catch'](function(_0x436822){console[_0x02df('0x1b')](_0x436822);});}if(_0x5aae62['direction']===_0x02df('0x11')&&!_0x5aae62[_0x02df('0x12')]){var _0x28b985;_0x17711c[_0x02df('0x1c')]['describe']()[_0x02df('0x18')](function(_0x24b1c0){return _0x17711c[_0x02df('0x1d')]['find']({'where':{'id':_0x5aae62[_0x02df('0x1e')]},'include':[{'model':_0x17711c[_0x02df('0x15')],'as':'Interactions','where':{'id':_0x5aae62[_0x02df('0x17')]},'limit':0x1,'include':[{'model':_0x17711c['CmContact'],'as':_0x02df('0x1f'),'attributes':_['keys'](_0x24b1c0)}]}]});})[_0x02df('0x18')](function(_0x34d911){_0x28b985=_0x34d911[_0x02df('0xe')]({'plain':!![]});if(_0x28b985&&_0x28b985['replyUri']){logger[_0x02df('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x02df('0x21'),util[_0x02df('0x22')](_0x02df('0x23'),_0x5aae62['id'],_0x28b985['replyUri']));if(_0x28b985[_0x02df('0x24')]&&_0x28b985[_0x02df('0x24')][_0x02df('0x25')]){_0x5aae62['Interaction']=_[_0x02df('0x26')](_0x28b985['Interactions'][0x0],_0x02df('0x1f'));_0x5aae62[_0x02df('0x1f')]=_0x28b985[_0x02df('0x24')][0x0][_0x02df('0x1f')];}var _0x5c8c01={'method':_0x02df('0x27'),'uri':encodeURI(_0x28b985[_0x02df('0x28')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5c8c01['method']){case _0x02df('0x29'):_0x5c8c01['qs']=_0x5aae62;break;case _0x02df('0x27'):_0x5c8c01[_0x02df('0xb')]=_0x5aae62;break;}return rp(_0x5c8c01)[_0x02df('0x18')](function(_0x4a8db4){logger[_0x02df('0x20')](_0x02df('0x2a'),_0x02df('0x21'),util[_0x02df('0x22')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x5aae62['id'],_0x28b985[_0x02df('0x28')]));if(_0x4a8db4[_0x02df('0xb')][_0x02df('0x2b')]&&_0x4a8db4[_0x02df('0xb')][_0x02df('0x2b')]!=_0x5aae62['Interaction'][_0x02df('0x2b')]){return _0x17711c[_0x02df('0x15')][_0x02df('0x19')]({'threadId':_0x4a8db4['body'][_0x02df('0x2b')]},{'where':{'id':_0x5aae62[_0x02df('0x2c')]['id']}});}else{return;}})[_0x02df('0x18')](function(){return _0x5c9a07[_0x02df('0x19')]({'read':!![]});})[_0x02df('0x2d')](function(_0xf4f37f){logger['error'](_0x02df('0x2a'),_0x02df('0x21'),util[_0x02df('0x2e')](_0xf4f37f,{'showHidden':![],'depth':null}));_0xff42be();});}else{_0xff42be();}})[_0x02df('0x2f')](function(){_0xff42be();});}else{_0xff42be();}}},'charset':_0x02df('0x30'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 7f58752..fc93a83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x454ccf,_0x58ce38){var _0x3c91fd=function(_0x2c7148){while(--_0x2c7148){_0x454ccf['push'](_0x454ccf['shift']());}};_0x3c91fd(++_0x58ce38);}(_0xadb5,0xad));var _0x5adb=function(_0x2c45a9,_0x562d9a){_0x2c45a9=_0x2c45a9-0x0;var _0x3372dc=_0xadb5[_0x2c45a9];return _0x3372dc;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});};
\ No newline at end of file
+var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0xf0ec6e,_0xa183d3){var _0x8bbc27=function(_0x39822b){while(--_0x39822b){_0xf0ec6e['push'](_0xf0ec6e['shift']());}};_0x8bbc27(++_0xa183d3);}(_0xdb28,0x106));var _0x8db2=function(_0x367801,_0x35050a){_0x367801=_0x367801-0x0;var _0xcc9276=_0xdb28[_0x367801];return _0xcc9276;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});};
\ No newline at end of file
index 217b256..ee35abb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f91=['remove','emit','removeListener','register','length','./openchannelMessage.events','save'];(function(_0x55257d,_0x3bdecf){var _0x5c3c46=function(_0x538eef){while(--_0x538eef){_0x55257d['push'](_0x55257d['shift']());}};_0x5c3c46(++_0x3bdecf);}(_0x2f91,0x98));var _0x12f9=function(_0x279ce6,_0x177bb5){_0x279ce6=_0x279ce6-0x0;var _0x1b8f9a=_0x2f91[_0x279ce6];return _0x1b8f9a;};'use strict';var OpenchannelMessageEvents=require(_0x12f9('0x0'));var events=[_0x12f9('0x1'),_0x12f9('0x2'),'update'];function createListener(_0x3280e9,_0xf4931b){return function(_0x28cdd9){_0xf4931b[_0x12f9('0x3')](_0x3280e9,_0x28cdd9);};}function removeListener(_0x5198f0,_0x473285){return function(){OpenchannelMessageEvents[_0x12f9('0x4')](_0x5198f0,_0x473285);};}exports[_0x12f9('0x5')]=function(_0xf06fa3){for(var _0x57a5ff=0x0,_0x7811e=events[_0x12f9('0x6')];_0x57a5ff<_0x7811e;_0x57a5ff++){var _0x4ea10c=events[_0x57a5ff];var _0x5b892a=createListener('openchannelMessage:'+_0x4ea10c,_0xf06fa3);OpenchannelMessageEvents['on'](_0x4ea10c,_0x5b892a);}};
\ No newline at end of file
+var _0xbc37=['./openchannelMessage.events','save','update','removeListener','register','length'];(function(_0x59366d,_0x45e90a){var _0x436663=function(_0xd381a8){while(--_0xd381a8){_0x59366d['push'](_0x59366d['shift']());}};_0x436663(++_0x45e90a);}(_0xbc37,0x11a));var _0x7bc3=function(_0x51a5f0,_0x242359){_0x51a5f0=_0x51a5f0-0x0;var _0x5e4c22=_0xbc37[_0x51a5f0];return _0x5e4c22;};'use strict';var OpenchannelMessageEvents=require(_0x7bc3('0x0'));var events=[_0x7bc3('0x1'),'remove',_0x7bc3('0x2')];function createListener(_0x7af0fe,_0x10e31f){return function(_0x12e140){_0x10e31f['emit'](_0x7af0fe,_0x12e140);};}function removeListener(_0x372ad2,_0x1524ac){return function(){OpenchannelMessageEvents[_0x7bc3('0x3')](_0x372ad2,_0x1524ac);};}exports[_0x7bc3('0x4')]=function(_0x542a38){for(var _0x456da0=0x0,_0x4b6929=events[_0x7bc3('0x5')];_0x456da0<_0x4b6929;_0x456da0++){var _0x3226e0=events[_0x456da0];var _0xc5f3d=createListener('openchannelMessage:'+_0x3226e0,_0x542a38);OpenchannelMessageEvents['on'](_0x3226e0,_0xc5f3d);}};
\ No newline at end of file
index baf2412..c53cab7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb443=['/:id/users','getAgents','post','create','addAgents','put','delete','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x36d0b2,_0x56f96a){var _0x3f595b=function(_0x20d0f8){while(--_0x20d0f8){_0x36d0b2['push'](_0x36d0b2['shift']());}};_0x3f595b(++_0x56f96a);}(_0xb443,0x166));var _0x3b44=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0xb443[_0x1762b4];return _0x29beda;};'use strict';var multer=require(_0x3b44('0x0'));var util=require('util');var path=require(_0x3b44('0x1'));var timeout=require(_0x3b44('0x2'));var express=require(_0x3b44('0x3'));var router=express[_0x3b44('0x4')]();var fs_extra=require(_0x3b44('0x5'));var auth=require(_0x3b44('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3b44('0x7'));var controller=require(_0x3b44('0x8'));router[_0x3b44('0x9')]('/',auth[_0x3b44('0xa')](),controller['index']);router['get'](_0x3b44('0xb'),auth[_0x3b44('0xa')](),controller[_0x3b44('0xc')]);router['get'](_0x3b44('0xd'),auth[_0x3b44('0xa')](),controller[_0x3b44('0xe')]);router[_0x3b44('0x9')](_0x3b44('0xf'),auth[_0x3b44('0xa')](),controller[_0x3b44('0x10')]);router[_0x3b44('0x9')](_0x3b44('0x11'),auth['isAuthenticated'](),controller[_0x3b44('0x12')]);router[_0x3b44('0x9')](_0x3b44('0x13'),auth[_0x3b44('0xa')](),controller[_0x3b44('0x14')]);router[_0x3b44('0x15')]('/',auth[_0x3b44('0xa')](),controller[_0x3b44('0x16')]);router[_0x3b44('0x15')](_0x3b44('0x11'),auth[_0x3b44('0xa')](),controller['addTeams']);router[_0x3b44('0x15')](_0x3b44('0x13'),auth[_0x3b44('0xa')](),controller[_0x3b44('0x17')]);router[_0x3b44('0x18')](_0x3b44('0xd'),auth[_0x3b44('0xa')](),controller['update']);router[_0x3b44('0x19')](_0x3b44('0xd'),auth[_0x3b44('0xa')](),controller[_0x3b44('0x1a')]);router[_0x3b44('0x19')]('/:id/teams',auth[_0x3b44('0xa')](),controller['removeTeams']);router['delete'](_0x3b44('0x13'),auth['isAuthenticated'](),controller[_0x3b44('0x1b')]);module[_0x3b44('0x1c')]=router;
\ No newline at end of file
+var _0x4955=['delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','post','create','addAgents','put','update'];(function(_0x18146c,_0xc1be8a){var _0xe09528=function(_0x192223){while(--_0x192223){_0x18146c['push'](_0x18146c['shift']());}};_0xe09528(++_0xc1be8a);}(_0x4955,0x170));var _0x5495=function(_0x407fc0,_0x3edc8a){_0x407fc0=_0x407fc0-0x0;var _0xbc107b=_0x4955[_0x407fc0];return _0xbc107b;};'use strict';var multer=require(_0x5495('0x0'));var util=require(_0x5495('0x1'));var path=require(_0x5495('0x2'));var timeout=require(_0x5495('0x3'));var express=require(_0x5495('0x4'));var router=express[_0x5495('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5495('0x6'));var interaction=require(_0x5495('0x7'));var config=require('../../config/environment');var controller=require(_0x5495('0x8'));router[_0x5495('0x9')]('/',auth[_0x5495('0xa')](),controller['index']);router[_0x5495('0x9')](_0x5495('0xb'),auth[_0x5495('0xa')](),controller[_0x5495('0xc')]);router[_0x5495('0x9')](_0x5495('0xd'),auth[_0x5495('0xa')](),controller[_0x5495('0xe')]);router['get'](_0x5495('0xf'),auth['isAuthenticated'](),controller['getMembers']);router[_0x5495('0x9')](_0x5495('0x10'),auth[_0x5495('0xa')](),controller[_0x5495('0x11')]);router['get'](_0x5495('0x12'),auth[_0x5495('0xa')](),controller['getAgents']);router[_0x5495('0x13')]('/',auth[_0x5495('0xa')](),controller[_0x5495('0x14')]);router[_0x5495('0x13')](_0x5495('0x10'),auth[_0x5495('0xa')](),controller['addTeams']);router[_0x5495('0x13')](_0x5495('0x12'),auth[_0x5495('0xa')](),controller[_0x5495('0x15')]);router[_0x5495('0x16')](_0x5495('0xd'),auth[_0x5495('0xa')](),controller[_0x5495('0x17')]);router[_0x5495('0x18')]('/:id',auth[_0x5495('0xa')](),controller[_0x5495('0x19')]);router[_0x5495('0x18')](_0x5495('0x10'),auth[_0x5495('0xa')](),controller[_0x5495('0x1a')]);router[_0x5495('0x18')](_0x5495('0x12'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x5495('0x1b')]=router;
\ No newline at end of file
index c11d55b..0b825cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d4b=['ENUM','rrmemory','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d4b,0x8f));var _0xb5d4=function(_0x13dc04,_0x52a21a){_0x13dc04=_0x13dc04-0x0;var _0x2db388=_0x5d4b[_0x13dc04];return _0x2db388;};'use strict';var Sequelize=require(_0xb5d4('0x0'));module['exports']={'name':{'type':Sequelize[_0xb5d4('0x1')],'unique':_0xb5d4('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xb5d4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb5d4('0x4')](_0xb5d4('0x5'),'beepall',_0xb5d4('0x6'))}};
\ No newline at end of file
+var _0xa343=['exports','STRING','name','rrmemory','beepall','roundrobin','sequelize'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xa343,0x1db));var _0x3a34=function(_0x2f0175,_0x250c03){_0x2f0175=_0x2f0175-0x0;var _0x1d9e63=_0xa343[_0x2f0175];return _0x1d9e63;};'use strict';var Sequelize=require(_0x3a34('0x0'));module[_0x3a34('0x1')]={'name':{'type':Sequelize[_0x3a34('0x2')],'unique':_0x3a34('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x3a34('0x4'),_0x3a34('0x5'),_0x3a34('0x6'))}};
\ No newline at end of file
index aeff3ce..a46c4d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x201e=['mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','get','OpenchannelQueues','UserProfileResource','destroy','end','stack','name','send','index','map','OpenchannelQueue','fieldName','type','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','rawAttributes','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','update','describe','getMembers','UserOpenchannelQueue','User','UserId','updatedAt','createdAt','rows','format','%s/%s','SIP','openchannelPause','findOne','Team','getTeams','addTeams','ids','Agents','voicePause','interface','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','toString','SELECT','TeamId','includes','all','union','compact','value','transaction','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x846ae8,_0x33a70b){var _0x356b00=function(_0xa96f69){while(--_0xa96f69){_0x846ae8['push'](_0x846ae8['shift']());}};_0x356b00(++_0x33a70b);}(_0x201e,0x87));var _0xe201=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x201e[_0x45d55e];return _0x29812a;};'use strict';var emlformat=require(_0xe201('0x0'));var rimraf=require(_0xe201('0x1'));var zipdir=require(_0xe201('0x2'));var jsonpatch=require(_0xe201('0x3'));var rp=require(_0xe201('0x4'));var moment=require('moment');var BPromise=require(_0xe201('0x5'));var Mustache=require(_0xe201('0x6'));var util=require(_0xe201('0x7'));var path=require(_0xe201('0x8'));var sox=require('sox');var csv=require(_0xe201('0x9'));var ejs=require(_0xe201('0xa'));var fs=require('fs');var fs_extra=require(_0xe201('0xb'));var _=require(_0xe201('0xc'));var squel=require(_0xe201('0xd'));var crypto=require(_0xe201('0xe'));var jsforce=require(_0xe201('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe201('0x9'));var querystring=require(_0xe201('0x10'));var Papa=require(_0xe201('0x11'));var Redis=require(_0xe201('0x12'));var authService=require(_0xe201('0x13'));var qs=require(_0xe201('0x14'));var as=require(_0xe201('0x15'));var hardwareService=require(_0xe201('0x16'));var logger=require('../../config/logger')(_0xe201('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe201('0x18'));var db=require(_0xe201('0x19'))['db'];config[_0xe201('0x1a')]=_[_0xe201('0x1b')](config['redis'],{'host':_0xe201('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe201('0x1a')]));require('./openchannelQueue.socket')[_0xe201('0x1d')](socket);function respondWithStatusCode(_0x1d0a7c,_0x63ec16){_0x63ec16=_0x63ec16||0xcc;return function(_0x27cd9d){if(_0x27cd9d){return _0x1d0a7c[_0xe201('0x1e')](_0x63ec16);}return _0x1d0a7c[_0xe201('0x1f')](_0x63ec16)['end']();};}function respondWithResult(_0x353ea4,_0x26b77a){_0x26b77a=_0x26b77a||0xc8;return function(_0x50690f){if(_0x50690f){return _0x353ea4[_0xe201('0x1f')](_0x26b77a)[_0xe201('0x20')](_0x50690f);}};}function respondWithFilteredResult(_0x264760,_0x543dd7){return function(_0x3c13fe){if(_0x3c13fe){var _0x1377c7=typeof _0x543dd7[_0xe201('0x21')]===_0xe201('0x22')&&typeof _0x543dd7[_0xe201('0x23')]==='undefined';var _0x1a3671=_0x3c13fe[_0xe201('0x24')];var _0x3d67ed=_0x1377c7?0x0:_0x543dd7[_0xe201('0x21')];var _0x18e3b8=_0x1377c7?_0x3c13fe[_0xe201('0x24')]:_0x543dd7['offset']+_0x543dd7[_0xe201('0x23')];var _0x4f785b;if(_0x18e3b8>=_0x1a3671){_0x18e3b8=_0x1a3671;_0x4f785b=0xc8;}else{_0x4f785b=0xce;}_0x264760['status'](_0x4f785b);return _0x264760[_0xe201('0x25')](_0xe201('0x26'),_0x3d67ed+'-'+_0x18e3b8+'/'+_0x1a3671)[_0xe201('0x20')](_0x3c13fe);}return null;};}function patchUpdates(_0x4f9938){return function(_0x574629){try{jsonpatch[_0xe201('0x27')](_0x574629,_0x4f9938,!![]);}catch(_0x23c904){return BPromise[_0xe201('0x28')](_0x23c904);}return _0x574629[_0xe201('0x29')]();};}function saveUpdates(_0x112003,_0x2c79e6){return function(_0x53ca31){if(_0x53ca31){return _0x53ca31['update'](_0x112003)['then'](function(_0x2f3975){return _0x2f3975;});}return null;};}function removeEntity(_0x137414,_0x2aeabe){return function(_0x169c4f){if(_0x169c4f){return _0x169c4f['destroy']()[_0xe201('0x2a')](function(){var _0x1d9c1b=_0x169c4f[_0xe201('0x2b')]({'plain':!![]});var _0x38c0b2=_0xe201('0x2c');return db[_0xe201('0x2d')][_0xe201('0x2e')]({'where':{'type':_0x38c0b2,'resourceId':_0x1d9c1b['id']}})[_0xe201('0x2a')](function(){return _0x169c4f;});})[_0xe201('0x2a')](function(){_0x137414[_0xe201('0x1f')](0xcc)[_0xe201('0x2f')]();});}};}function handleEntityNotFound(_0xc98c7e,_0x399583){return function(_0x1e307c){if(!_0x1e307c){_0xc98c7e['sendStatus'](0x194);}return _0x1e307c;};}function handleError(_0x55a464,_0x3d6677){_0x3d6677=_0x3d6677||0x1f4;return function(_0x1e9d88){logger['error'](_0x1e9d88[_0xe201('0x30')]);if(_0x1e9d88[_0xe201('0x31')]){delete _0x1e9d88[_0xe201('0x31')];}_0x55a464[_0xe201('0x1f')](_0x3d6677)[_0xe201('0x32')](_0x1e9d88);};}exports[_0xe201('0x33')]=function(_0x429d32,_0x5f050f){var _0x2896b4={},_0x5bfe2f={},_0xb393e8={'count':0x0,'rows':[]};var _0x4b8bc9=_[_0xe201('0x34')](db[_0xe201('0x35')]['rawAttributes'],function(_0x219634){return{'name':_0x219634[_0xe201('0x36')],'type':_0x219634[_0xe201('0x37')]['key']};});_0x5bfe2f['model']=_[_0xe201('0x34')](_0x4b8bc9,_0xe201('0x31'));_0x5bfe2f[_0xe201('0x38')]=_['keys'](_0x429d32[_0xe201('0x38')]);_0x5bfe2f[_0xe201('0x39')]=_['intersection'](_0x5bfe2f[_0xe201('0x3a')],_0x5bfe2f['query']);_0x2896b4[_0xe201('0x3b')]=_[_0xe201('0x3c')](_0x5bfe2f[_0xe201('0x3a')],qs['fields'](_0x429d32[_0xe201('0x38')][_0xe201('0x3d')]));_0x2896b4[_0xe201('0x3b')]=_0x2896b4[_0xe201('0x3b')]['length']?_0x2896b4[_0xe201('0x3b')]:_0x5bfe2f[_0xe201('0x3a')];if(!_0x429d32[_0xe201('0x38')][_0xe201('0x3e')](_0xe201('0x3f'))){_0x2896b4[_0xe201('0x23')]=qs[_0xe201('0x23')](_0x429d32[_0xe201('0x38')]['limit']);_0x2896b4[_0xe201('0x21')]=qs['offset'](_0x429d32[_0xe201('0x38')][_0xe201('0x21')]);}_0x2896b4[_0xe201('0x40')]=qs[_0xe201('0x41')](_0x429d32[_0xe201('0x38')][_0xe201('0x41')]);_0x2896b4['where']=qs[_0xe201('0x39')](_[_0xe201('0x42')](_0x429d32['query'],_0x5bfe2f[_0xe201('0x39')]),_0x4b8bc9);if(_0x429d32[_0xe201('0x38')]['filter']){_0x2896b4[_0xe201('0x43')]=_[_0xe201('0x44')](_0x2896b4[_0xe201('0x43')],{'$or':_['map'](_0x4b8bc9,function(_0x119d6c){if(_0x119d6c['type']!==_0xe201('0x45')){var _0x338258={};_0x338258[_0x119d6c[_0xe201('0x31')]]={'$like':'%'+_0x429d32[_0xe201('0x38')][_0xe201('0x46')]+'%'};return _0x338258;}})});}_0x2896b4=_['merge']({},_0x2896b4,_0x429d32[_0xe201('0x47')]);var _0x1fb525={'where':_0x2896b4[_0xe201('0x43')]};return db['OpenchannelQueue'][_0xe201('0x24')](_0x1fb525)['then'](function(_0x3b33ff){_0xb393e8[_0xe201('0x24')]=_0x3b33ff;if(_0x429d32['query'][_0xe201('0x48')]){_0x2896b4[_0xe201('0x49')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xe201('0x4a')](_0x2896b4);})['then'](function(_0x270ee2){_0xb393e8['rows']=_0x270ee2;return _0xb393e8;})[_0xe201('0x2a')](respondWithFilteredResult(_0x5f050f,_0x2896b4))['catch'](handleError(_0x5f050f,null));};exports[_0xe201('0x4b')]=function(_0x264675,_0x4adc01){var _0x5922d0={'raw':!![],'where':{'id':_0x264675[_0xe201('0x4c')]['id']}},_0x33f48c={};_0x33f48c[_0xe201('0x3a')]=_[_0xe201('0x4d')](db[_0xe201('0x35')][_0xe201('0x4e')]);_0x33f48c[_0xe201('0x38')]=_['keys'](_0x264675[_0xe201('0x38')]);_0x33f48c['filters']=_[_0xe201('0x3c')](_0x33f48c[_0xe201('0x3a')],_0x33f48c[_0xe201('0x38')]);_0x5922d0[_0xe201('0x3b')]=_[_0xe201('0x3c')](_0x33f48c[_0xe201('0x3a')],qs[_0xe201('0x3d')](_0x264675[_0xe201('0x38')][_0xe201('0x3d')]));_0x5922d0[_0xe201('0x3b')]=_0x5922d0['attributes'][_0xe201('0x4f')]?_0x5922d0[_0xe201('0x3b')]:_0x33f48c[_0xe201('0x3a')];if(_0x264675['query']['includeAll']){_0x5922d0[_0xe201('0x49')]=[{'all':!![]}];}_0x5922d0=_[_0xe201('0x44')]({},_0x5922d0,_0x264675[_0xe201('0x47')]);return db[_0xe201('0x35')][_0xe201('0x50')](_0x5922d0)[_0xe201('0x2a')](handleEntityNotFound(_0x4adc01,null))['then'](respondWithResult(_0x4adc01,null))[_0xe201('0x51')](handleError(_0x4adc01,null));};exports[_0xe201('0x52')]=function(_0x3720e6,_0x346c06){return db[_0xe201('0x35')]['create'](_0x3720e6[_0xe201('0x53')],{})[_0xe201('0x2a')](function(_0x21fd71){var _0x251e3e=_0x3720e6[_0xe201('0x54')][_0xe201('0x2b')]({'plain':!![]});if(!_0x251e3e)throw new Error(_0xe201('0x55'));if(_0x251e3e[_0xe201('0x56')]===_0xe201('0x54')){var _0xfd099e=_0x21fd71[_0xe201('0x2b')]({'plain':!![]});var _0x1adfbf='OpenchannelQueues';return db[_0xe201('0x57')][_0xe201('0x50')]({'where':{'name':_0x1adfbf,'userProfileId':_0x251e3e['userProfileId']},'raw':!![]})['then'](function(_0x1545fe){if(_0x1545fe&&_0x1545fe[_0xe201('0x58')]===0x0){return db[_0xe201('0x2d')][_0xe201('0x52')]({'name':_0xfd099e['name'],'resourceId':_0xfd099e['id'],'type':_0x1545fe[_0xe201('0x31')],'sectionId':_0x1545fe['id']},{})['then'](function(){return _0x21fd71;});}else{return _0x21fd71;}})['catch'](function(_0xdff452){logger[_0xe201('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xdff452);throw _0xdff452;});}return _0x21fd71;})['then'](respondWithResult(_0x346c06,0xc9))[_0xe201('0x51')](handleError(_0x346c06,null));};exports[_0xe201('0x5a')]=function(_0x50ff0e,_0x81fa43){if(_0x50ff0e[_0xe201('0x53')]['id']){delete _0x50ff0e[_0xe201('0x53')]['id'];}return db[_0xe201('0x35')][_0xe201('0x50')]({'where':{'id':_0x50ff0e[_0xe201('0x4c')]['id']}})[_0xe201('0x2a')](handleEntityNotFound(_0x81fa43,null))[_0xe201('0x2a')](saveUpdates(_0x50ff0e[_0xe201('0x53')],null))[_0xe201('0x2a')](respondWithResult(_0x81fa43,null))[_0xe201('0x51')](handleError(_0x81fa43,null));};exports[_0xe201('0x2e')]=function(_0x335b83,_0x4b6fb2){return db[_0xe201('0x35')][_0xe201('0x50')]({'where':{'id':_0x335b83['params']['id']}})[_0xe201('0x2a')](handleEntityNotFound(_0x4b6fb2,null))[_0xe201('0x2a')](removeEntity(_0x4b6fb2,null))[_0xe201('0x51')](handleError(_0x4b6fb2,null));};exports['describe']=function(_0x582882,_0x1399e4){return db['OpenchannelQueue'][_0xe201('0x5b')]()['then'](respondWithResult(_0x1399e4,null))[_0xe201('0x51')](handleError(_0x1399e4,null));};exports[_0xe201('0x5c')]=function(_0x2f3185,_0x479d14,_0x47df6d){var _0x51b7ba={'raw':!![],'where':{}},_0x51e346={},_0x2aa1cf;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x2f3185[_0xe201('0x4c')]['id']}})[_0xe201('0x2a')](handleEntityNotFound(_0x479d14,null))[_0xe201('0x2a')](function(_0x3d072d){if(_0x3d072d){_0x2aa1cf=_0x3d072d[_0xe201('0x2b')]({'plain':!![]});_0x51e346[_0xe201('0x3a')]=_[_0xe201('0x4d')](db[_0xe201('0x5d')][_0xe201('0x4e')]);_0x51e346[_0xe201('0x38')]=_['keys'](_0x2f3185[_0xe201('0x38')]);_0x51e346[_0xe201('0x39')]=_[_0xe201('0x3c')](_0x51e346[_0xe201('0x3a')],_0x51e346[_0xe201('0x38')]);_0x51b7ba[_0xe201('0x3b')]=_[_0xe201('0x3c')](_0x51e346[_0xe201('0x3a')],qs[_0xe201('0x3d')](_0x2f3185[_0xe201('0x38')][_0xe201('0x3d')]));_0x51b7ba[_0xe201('0x3b')]=_0x51b7ba[_0xe201('0x3b')]['length']?_0x51b7ba['attributes']:_0x51e346[_0xe201('0x3a')];if(!_0x2f3185[_0xe201('0x38')]['hasOwnProperty'](_0xe201('0x3f'))){_0x51b7ba[_0xe201('0x23')]=qs[_0xe201('0x23')](_0x2f3185[_0xe201('0x38')][_0xe201('0x23')]);_0x51b7ba[_0xe201('0x21')]=qs[_0xe201('0x21')](_0x2f3185[_0xe201('0x38')][_0xe201('0x21')]);}_0x51b7ba[_0xe201('0x40')]=qs[_0xe201('0x41')](_0x2f3185[_0xe201('0x38')][_0xe201('0x41')]);_0x51b7ba[_0xe201('0x43')]=qs[_0xe201('0x39')](_[_0xe201('0x42')](_0x2f3185[_0xe201('0x38')],_0x51e346[_0xe201('0x39')]));_0x51b7ba[_0xe201('0x43')]['OpenchannelQueueId']=_0x3d072d['id'];if(_0x2f3185['query'][_0xe201('0x46')]){_0x51b7ba[_0xe201('0x43')]=_['merge'](_0x51b7ba[_0xe201('0x43')],{'$or':_['map'](_0x51b7ba[_0xe201('0x3b')],function(_0x499e04){var _0x435420={};_0x435420[_0x499e04]={'$like':'%'+_0x2f3185[_0xe201('0x38')][_0xe201('0x46')]+'%'};return _0x435420;})});}_0x51b7ba=_[_0xe201('0x44')]({},_0x51b7ba,_0x2f3185[_0xe201('0x47')]);return db[_0xe201('0x5d')]['findAll'](_0x51b7ba);}})[_0xe201('0x2a')](function(_0xa94501){if(_0xa94501){return db[_0xe201('0x5e')]['findAndCountAll']({'where':{'id':_[_0xe201('0x34')](_0xa94501,_0xe201('0x5f')),'role':'agent'},'attributes':['id',_0xe201('0x31'),'openchannelPause',_0xe201('0x60'),_0xe201('0x61')]});}})['then'](function(_0x2c343c){if(_0x2c343c){return{'count':_0x2c343c[_0xe201('0x24')],'rows':_[_0xe201('0x34')](_0x2c343c[_0xe201('0x62')],function(_0x4f334c){return{'membername':_0x4f334c[_0xe201('0x31')],'UserId':_0x4f334c['id'],'queue_name':_0x2aa1cf['name'],'OpenchannelQueueId':_0x2aa1cf['id'],'interface':util[_0xe201('0x63')](_0xe201('0x64'),_0xe201('0x65'),_0x4f334c[_0xe201('0x31')]),'penalty':0x0,'paused':_0x4f334c[_0xe201('0x66')],'createdAt':_0x4f334c[_0xe201('0x61')],'updatedAt':_0x4f334c['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xe201('0x2a')](respondWithFilteredResult(_0x479d14,_0x51b7ba))[_0xe201('0x51')](handleError(_0x479d14,null));};exports['getTeams']=function(_0x503f5d,_0x36cdbb,_0x37d055){var _0x3ea489={};var _0x1cb5ca={};var _0x25a445;var _0x55e04d;return db['OpenchannelQueue'][_0xe201('0x67')]({'where':{'id':_0x503f5d[_0xe201('0x4c')]['id']}})['then'](handleEntityNotFound(_0x36cdbb,null))['then'](function(_0x3d6f40){if(_0x3d6f40){_0x25a445=_0x3d6f40;_0x1cb5ca[_0xe201('0x3a')]=_['keys'](db[_0xe201('0x68')][_0xe201('0x4e')]);_0x1cb5ca[_0xe201('0x38')]=_['keys'](_0x503f5d[_0xe201('0x38')]);_0x1cb5ca[_0xe201('0x39')]=_[_0xe201('0x3c')](_0x1cb5ca[_0xe201('0x3a')],_0x1cb5ca['query']);_0x3ea489[_0xe201('0x3b')]=_['intersection'](_0x1cb5ca[_0xe201('0x3a')],qs['fields'](_0x503f5d[_0xe201('0x38')][_0xe201('0x3d')]));_0x3ea489[_0xe201('0x3b')]=_0x3ea489['attributes'][_0xe201('0x4f')]?_0x3ea489[_0xe201('0x3b')]:_0x1cb5ca[_0xe201('0x3a')];_0x3ea489[_0xe201('0x40')]=qs['sort'](_0x503f5d['query'][_0xe201('0x41')]);_0x3ea489[_0xe201('0x43')]=qs[_0xe201('0x39')](_[_0xe201('0x42')](_0x503f5d[_0xe201('0x38')],_0x1cb5ca[_0xe201('0x39')]));if(_0x503f5d[_0xe201('0x38')][_0xe201('0x46')]){_0x3ea489['where']=_[_0xe201('0x44')](_0x3ea489['where'],{'$or':_[_0xe201('0x34')](_0x3ea489[_0xe201('0x3b')],function(_0x3fc98c){var _0x4a78e0={};_0x4a78e0[_0x3fc98c]={'$like':'%'+_0x503f5d[_0xe201('0x38')]['filter']+'%'};return _0x4a78e0;})});}_0x3ea489=_[_0xe201('0x44')]({},_0x3ea489,_0x503f5d[_0xe201('0x47')]);return _0x25a445[_0xe201('0x69')](_0x3ea489);}})[_0xe201('0x2a')](function(_0x136d16){if(_0x136d16){_0x55e04d=_0x136d16['length'];if(!_0x503f5d[_0xe201('0x38')][_0xe201('0x3e')]('nolimit')){_0x3ea489[_0xe201('0x23')]=qs[_0xe201('0x23')](_0x503f5d['query'][_0xe201('0x23')]);_0x3ea489[_0xe201('0x21')]=qs[_0xe201('0x21')](_0x503f5d[_0xe201('0x38')][_0xe201('0x21')]);}return _0x25a445[_0xe201('0x69')](_0x3ea489);}})[_0xe201('0x2a')](function(_0x1c5e7e){if(_0x1c5e7e){return _0x1c5e7e?{'count':_0x55e04d,'rows':_0x1c5e7e}:null;}})[_0xe201('0x2a')](respondWithResult(_0x36cdbb,null))[_0xe201('0x51')](handleError(_0x36cdbb,null));};exports[_0xe201('0x6a')]=function(_0x5bad8d,_0x2b537e,_0x2949e3){var _0x139a1c=_0x5bad8d[_0xe201('0x53')][_0xe201('0x6b')];return db[_0xe201('0x68')][_0xe201('0x4a')]({'where':{'id':_0x139a1c},'attributes':['id'],'include':[{'model':db[_0xe201('0x5e')],'as':_0xe201('0x6c'),'attributes':['id','name','online',_0xe201('0x6d'),_0xe201('0x6e')],'raw':!![]}]})[_0xe201('0x2a')](function(_0x5b2f96){if(_0x5b2f96){var _0xd020ff=_['flatMap'](_0x5b2f96,function(_0x1d85bb){var _0x15de11=_0x1d85bb[_0xe201('0x2b')]({'plain':!![]});return _0x15de11['Agents'];});return db['OpenchannelQueue'][_0xe201('0x50')]({'where':{'id':_0x5bad8d['params']['id']}})['then'](function(_0x25423d){return db['sequelize']['transaction'](function(_0x3ca243){return _0x25423d['addTeams'](_0x139a1c,{'transaction':_0x3ca243})[_0xe201('0x2a')](function(){return BPromise['each'](_0xd020ff,function(_0x24b5b8){return db['UserOpenchannelQueue'][_0xe201('0x6f')]({'where':{'UserId':_0x24b5b8['id'],'OpenchannelQueueId':_0x5bad8d[_0xe201('0x4c')]['id']},'transaction':_0x3ca243});});})[_0xe201('0x2a')](function(){_0xd020ff[_0xe201('0x70')](function(_0x2667df){socket[_0xe201('0x71')](_0xe201('0x72'),{'UserId':_0x2667df['id'],'OpenchannelQueueId':_0x25423d['id']});});});});});}})[_0xe201('0x2a')](respondWithStatusCode(_0x2b537e,null))[_0xe201('0x51')](handleError(_0x2b537e,null));};exports[_0xe201('0x73')]=function(_0x1e5189,_0x558496,_0x3fbe44){return db['Team'][_0xe201('0x4a')]({'where':{'id':_0x1e5189['query'][_0xe201('0x6b')]},'attributes':['id'],'include':[{'model':db[_0xe201('0x5e')],'as':_0xe201('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xe201('0x2a')](handleEntityNotFound(_0x558496,null))[_0xe201('0x2a')](function(_0x1e1994){var _0x41cec7=_['map'](_0x1e1994,'id');var _0x4826d8=[];var _0x4d7b2c=[];var _0x24f299=squel[_0xe201('0x74')]();_0x24f299['field']('tq.TeamId')[_0xe201('0x75')](_0xe201('0x76'),'tq')[_0xe201('0x77')]('user_has_teams','ut',_0xe201('0x78'))[_0xe201('0x43')](_0xe201('0x79'),_0x1e5189[_0xe201('0x4c')]['id']);for(var _0x1c30e5=0x0;_0x1c30e5<_0x1e1994[_0xe201('0x4f')];_0x1c30e5+=0x1){let _0x4a3118=_0x1e1994[_0x1c30e5];for(var _0x2470da=0x0;_0x2470da<_0x4a3118[_0xe201('0x6c')]['length'];_0x2470da+=0x1){let _0x264db1=_0x4a3118[_0xe201('0x6c')][_0x2470da];var _0x45122a=_0x24f299[_0xe201('0x7a')]();_0x45122a['where'](_0xe201('0x7b'),_0x264db1['id']);_0x4d7b2c['push'](db[_0xe201('0x7c')][_0xe201('0x38')](_0x45122a[_0xe201('0x7d')](),{'type':db[_0xe201('0x7c')]['QueryTypes'][_0xe201('0x7e')]})[_0xe201('0x2a')](function(_0x1daf37){if(_0x1daf37[_0xe201('0x4f')]===0x1){return _0x264db1['id'];}else{var _0x1deab4=_['every'](_[_0xe201('0x34')](_0x1daf37,_0xe201('0x7f')),function(_0x552964){return _[_0xe201('0x80')](_0x41cec7,_0x552964);});if(_0x1deab4){return _0x264db1['id'];}}}));}}return BPromise[_0xe201('0x81')](_0x4d7b2c)[_0xe201('0x2a')](function(_0x3b974f){_0x4826d8=_(_0x4826d8)[_0xe201('0x82')](_0x3b974f)[_0xe201('0x83')]()[_0xe201('0x84')]();return db['OpenchannelQueue'][_0xe201('0x50')]({'where':{'id':_0x1e5189['params']['id']}})[_0xe201('0x2a')](function(_0x39a98e){return db[_0xe201('0x7c')][_0xe201('0x85')](function(_0x184a2f){return _0x39a98e['removeTeams'](_0x1e5189[_0xe201('0x38')]['ids'],{'transaction':_0x184a2f})[_0xe201('0x2a')](function(){if(!_['isEmpty'](_0x4826d8)){return _0x39a98e['removeAgents'](_0x4826d8,{'transaction':_0x184a2f});}})['then'](function(){_0x4826d8[_0xe201('0x70')](function(_0x1e2014){socket[_0xe201('0x71')](_0xe201('0x86'),{'UserId':_0x1e2014,'OpenchannelQueueId':_0x39a98e['id']});});});});});});})[_0xe201('0x2a')](respondWithStatusCode(_0x558496,null))[_0xe201('0x51')](handleError(_0x558496,null));};exports[_0xe201('0x87')]=function(_0x1b9923,_0x4f17f9,_0x5af365){return db[_0xe201('0x35')][_0xe201('0x50')]({'where':{'id':_0x1b9923[_0xe201('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4f17f9,null))[_0xe201('0x2a')](function(_0x75cd5c){if(_0x75cd5c){return _0x75cd5c['addAgents'](_0x1b9923['body']['ids'],_[_0xe201('0x88')](_0x1b9923[_0xe201('0x53')],['ids','id'])||{})[_0xe201('0x89')](function(_0xc807e9){for(var _0x2f241b=0x0;_0x2f241b<_0x1b9923['body']['ids']['length'];_0x2f241b+=0x1){socket[_0xe201('0x71')]('userOpenchannelQueue:save',{'UserId':Number(_0x1b9923[_0xe201('0x53')][_0xe201('0x6b')][_0x2f241b]),'OpenchannelQueueId':Number(_0x1b9923[_0xe201('0x4c')]['id'])});}return _0xc807e9;});}})[_0xe201('0x2a')](respondWithResult(_0x4f17f9,null))[_0xe201('0x51')](handleError(_0x4f17f9,null));};exports[_0xe201('0x8a')]=function(_0x6f203d,_0x4d4e91,_0x3388a9){return db[_0xe201('0x35')]['find']({'where':{'id':_0x6f203d[_0xe201('0x4c')]['id']}})[_0xe201('0x2a')](handleEntityNotFound(_0x4d4e91,null))[_0xe201('0x2a')](function(_0x1b1535){if(_0x1b1535){return _0x1b1535[_0xe201('0x8a')](_0x6f203d[_0xe201('0x38')][_0xe201('0x6b')])[_0xe201('0x2a')](function(){if(_[_0xe201('0x8b')](_0x6f203d[_0xe201('0x38')]['ids'])){for(var _0x3cd4e7=0x0;_0x3cd4e7<_0x6f203d[_0xe201('0x38')][_0xe201('0x6b')][_0xe201('0x4f')];_0x3cd4e7+=0x1){socket[_0xe201('0x71')]('userOpenchannelQueue:remove',{'UserId':Number(_0x6f203d[_0xe201('0x38')][_0xe201('0x6b')][_0x3cd4e7]),'OpenchannelQueueId':Number(_0x6f203d[_0xe201('0x4c')]['id'])});}}else{socket[_0xe201('0x71')]('userOpenchannelQueue:remove',{'UserId':Number(_0x6f203d['query'][_0xe201('0x6b')]),'OpenchannelQueueId':Number(_0x6f203d[_0xe201('0x4c')]['id'])});}});}})[_0xe201('0x2a')](respondWithStatusCode(_0x4d4e91,null))[_0xe201('0x51')](handleError(_0x4d4e91,null));};exports['getAgents']=function(_0x2426da,_0x537786,_0x371ac4){var _0x18c1da={};var _0x2d8c37={};var _0x38c08e;var _0x272a47;return db['OpenchannelQueue'][_0xe201('0x67')]({'where':{'id':_0x2426da[_0xe201('0x4c')]['id']}})['then'](handleEntityNotFound(_0x537786,null))['then'](function(_0x8c367f){if(_0x8c367f){_0x38c08e=_0x8c367f;_0x2d8c37[_0xe201('0x3a')]=_['keys'](db[_0xe201('0x5e')][_0xe201('0x4e')]);_0x2d8c37[_0xe201('0x38')]=_[_0xe201('0x4d')](_0x2426da[_0xe201('0x38')]);_0x2d8c37[_0xe201('0x39')]=_[_0xe201('0x3c')](_0x2d8c37['model'],_0x2d8c37[_0xe201('0x38')]);_0x18c1da[_0xe201('0x3b')]=_[_0xe201('0x3c')](_0x2d8c37[_0xe201('0x3a')],qs[_0xe201('0x3d')](_0x2426da[_0xe201('0x38')][_0xe201('0x3d')]));_0x18c1da[_0xe201('0x3b')]=_0x18c1da[_0xe201('0x3b')][_0xe201('0x4f')]?_0x18c1da[_0xe201('0x3b')]:_0x2d8c37[_0xe201('0x3a')];_0x18c1da[_0xe201('0x40')]=qs[_0xe201('0x41')](_0x2426da['query'][_0xe201('0x41')]);_0x18c1da['where']=qs[_0xe201('0x39')](_[_0xe201('0x42')](_0x2426da[_0xe201('0x38')],_0x2d8c37[_0xe201('0x39')]));if(_0x2426da[_0xe201('0x38')]['filter']){_0x18c1da['where']=_[_0xe201('0x44')](_0x18c1da[_0xe201('0x43')],{'$or':_[_0xe201('0x34')](_0x18c1da[_0xe201('0x3b')],function(_0x291697){var _0xb3f720={};_0xb3f720[_0x291697]={'$like':'%'+_0x2426da['query']['filter']+'%'};return _0xb3f720;})});}_0x18c1da=_[_0xe201('0x44')]({},_0x18c1da,_0x2426da[_0xe201('0x47')]);return _0x38c08e[_0xe201('0x8c')](_0x18c1da);}})[_0xe201('0x2a')](function(_0x1bcaf8){if(_0x1bcaf8){_0x272a47=_0x1bcaf8['length'];if(!_0x2426da[_0xe201('0x38')][_0xe201('0x3e')](_0xe201('0x3f'))){_0x18c1da[_0xe201('0x23')]=qs[_0xe201('0x23')](_0x2426da['query'][_0xe201('0x23')]);_0x18c1da[_0xe201('0x21')]=qs[_0xe201('0x21')](_0x2426da[_0xe201('0x38')][_0xe201('0x21')]);}return _0x38c08e['getAgents'](_0x18c1da);}})['then'](function(_0x4bfda9){if(_0x4bfda9){return _0x4bfda9?{'count':_0x272a47,'rows':_0x4bfda9}:null;}})[_0xe201('0x2a')](respondWithResult(_0x537786,null))[_0xe201('0x51')](handleError(_0x537786,null));};
\ No newline at end of file
+var _0xd327=['updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','Team','Agents','online','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','ids','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','transaction','removeTeams','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','error','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelQueues','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','agent','openchannelPause'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0xd327,0x153));var _0x7d32=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd327[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x7d32('0x0'));var rimraf=require(_0x7d32('0x1'));var zipdir=require(_0x7d32('0x2'));var jsonpatch=require(_0x7d32('0x3'));var rp=require('request-promise');var moment=require(_0x7d32('0x4'));var BPromise=require(_0x7d32('0x5'));var Mustache=require(_0x7d32('0x6'));var util=require(_0x7d32('0x7'));var path=require('path');var sox=require(_0x7d32('0x8'));var csv=require('to-csv');var ejs=require(_0x7d32('0x9'));var fs=require('fs');var fs_extra=require(_0x7d32('0xa'));var _=require(_0x7d32('0xb'));var squel=require(_0x7d32('0xc'));var crypto=require(_0x7d32('0xd'));var jsforce=require(_0x7d32('0xe'));var deskjs=require(_0x7d32('0xf'));var toCsv=require(_0x7d32('0x10'));var querystring=require(_0x7d32('0x11'));var Papa=require(_0x7d32('0x12'));var Redis=require(_0x7d32('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7d32('0x14'));var as=require(_0x7d32('0x15'));var hardwareService=require(_0x7d32('0x16'));var logger=require(_0x7d32('0x17'))(_0x7d32('0x18'));var utils=require(_0x7d32('0x19'));var config=require(_0x7d32('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x7d32('0x1b'))['db'];config[_0x7d32('0x1c')]=_[_0x7d32('0x1d')](config[_0x7d32('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x7d32('0x1e'))(new Redis(config[_0x7d32('0x1c')]));require(_0x7d32('0x1f'))[_0x7d32('0x20')](socket);function respondWithStatusCode(_0xfc93b,_0x5e027b){_0x5e027b=_0x5e027b||0xcc;return function(_0x5551b8){if(_0x5551b8){return _0xfc93b[_0x7d32('0x21')](_0x5e027b);}return _0xfc93b[_0x7d32('0x22')](_0x5e027b)[_0x7d32('0x23')]();};}function respondWithResult(_0x3f126e,_0xb72eb8){_0xb72eb8=_0xb72eb8||0xc8;return function(_0x561c61){if(_0x561c61){return _0x3f126e['status'](_0xb72eb8)[_0x7d32('0x24')](_0x561c61);}};}function respondWithFilteredResult(_0x17425c,_0x1f5b6a){return function(_0x2e9677){if(_0x2e9677){var _0x187b62=typeof _0x1f5b6a[_0x7d32('0x25')]==='undefined'&&typeof _0x1f5b6a[_0x7d32('0x26')]===_0x7d32('0x27');var _0x1de156=_0x2e9677['count'];var _0x162cbf=_0x187b62?0x0:_0x1f5b6a[_0x7d32('0x25')];var _0x27849e=_0x187b62?_0x2e9677[_0x7d32('0x28')]:_0x1f5b6a[_0x7d32('0x25')]+_0x1f5b6a['limit'];var _0x81df3b;if(_0x27849e>=_0x1de156){_0x27849e=_0x1de156;_0x81df3b=0xc8;}else{_0x81df3b=0xce;}_0x17425c[_0x7d32('0x22')](_0x81df3b);return _0x17425c[_0x7d32('0x29')](_0x7d32('0x2a'),_0x162cbf+'-'+_0x27849e+'/'+_0x1de156)[_0x7d32('0x24')](_0x2e9677);}return null;};}function patchUpdates(_0x3865e0){return function(_0x68c4d0){try{jsonpatch[_0x7d32('0x2b')](_0x68c4d0,_0x3865e0,!![]);}catch(_0x3b72f5){return BPromise[_0x7d32('0x2c')](_0x3b72f5);}return _0x68c4d0[_0x7d32('0x2d')]();};}function saveUpdates(_0x5d8225,_0x4c9202){return function(_0x3f1582){if(_0x3f1582){return _0x3f1582[_0x7d32('0x2e')](_0x5d8225)[_0x7d32('0x2f')](function(_0x4d384d){return _0x4d384d;});}return null;};}function removeEntity(_0x4c3d2a,_0x247495){return function(_0x2c6a49){if(_0x2c6a49){return _0x2c6a49[_0x7d32('0x30')]()['then'](function(){var _0x4fe909=_0x2c6a49[_0x7d32('0x31')]({'plain':!![]});var _0x245be5='OpenchannelQueues';return db['UserProfileResource'][_0x7d32('0x30')]({'where':{'type':_0x245be5,'resourceId':_0x4fe909['id']}})[_0x7d32('0x2f')](function(){return _0x2c6a49;});})[_0x7d32('0x2f')](function(){_0x4c3d2a[_0x7d32('0x22')](0xcc)[_0x7d32('0x23')]();});}};}function handleEntityNotFound(_0xa2103a,_0x1cb5cb){return function(_0xe8887){if(!_0xe8887){_0xa2103a[_0x7d32('0x21')](0x194);}return _0xe8887;};}function handleError(_0x147e94,_0xbd1e49){_0xbd1e49=_0xbd1e49||0x1f4;return function(_0x27c232){logger[_0x7d32('0x32')](_0x27c232['stack']);if(_0x27c232['name']){delete _0x27c232[_0x7d32('0x33')];}_0x147e94[_0x7d32('0x22')](_0xbd1e49)[_0x7d32('0x34')](_0x27c232);};}exports[_0x7d32('0x35')]=function(_0x144e4f,_0x112973){var _0x13b837={},_0x2557cb={},_0x2bd64b={'count':0x0,'rows':[]};var _0x345003=_[_0x7d32('0x36')](db[_0x7d32('0x37')][_0x7d32('0x38')],function(_0xdd5cfc){return{'name':_0xdd5cfc[_0x7d32('0x39')],'type':_0xdd5cfc[_0x7d32('0x3a')][_0x7d32('0x3b')]};});_0x2557cb['model']=_[_0x7d32('0x36')](_0x345003,'name');_0x2557cb[_0x7d32('0x3c')]=_[_0x7d32('0x3d')](_0x144e4f[_0x7d32('0x3c')]);_0x2557cb[_0x7d32('0x3e')]=_[_0x7d32('0x3f')](_0x2557cb[_0x7d32('0x40')],_0x2557cb['query']);_0x13b837[_0x7d32('0x41')]=_['intersection'](_0x2557cb['model'],qs[_0x7d32('0x42')](_0x144e4f[_0x7d32('0x3c')][_0x7d32('0x42')]));_0x13b837['attributes']=_0x13b837['attributes'][_0x7d32('0x43')]?_0x13b837[_0x7d32('0x41')]:_0x2557cb[_0x7d32('0x40')];if(!_0x144e4f[_0x7d32('0x3c')][_0x7d32('0x44')](_0x7d32('0x45'))){_0x13b837['limit']=qs['limit'](_0x144e4f[_0x7d32('0x3c')]['limit']);_0x13b837[_0x7d32('0x25')]=qs['offset'](_0x144e4f[_0x7d32('0x3c')][_0x7d32('0x25')]);}_0x13b837[_0x7d32('0x46')]=qs[_0x7d32('0x47')](_0x144e4f[_0x7d32('0x3c')][_0x7d32('0x47')]);_0x13b837[_0x7d32('0x48')]=qs['filters'](_[_0x7d32('0x49')](_0x144e4f[_0x7d32('0x3c')],_0x2557cb[_0x7d32('0x3e')]),_0x345003);if(_0x144e4f[_0x7d32('0x3c')][_0x7d32('0x4a')]){_0x13b837[_0x7d32('0x48')]=_[_0x7d32('0x4b')](_0x13b837[_0x7d32('0x48')],{'$or':_[_0x7d32('0x36')](_0x345003,function(_0x3e7bb2){if(_0x3e7bb2[_0x7d32('0x3a')]!=='VIRTUAL'){var _0x23c79d={};_0x23c79d[_0x3e7bb2[_0x7d32('0x33')]]={'$like':'%'+_0x144e4f[_0x7d32('0x3c')][_0x7d32('0x4a')]+'%'};return _0x23c79d;}})});}_0x13b837=_[_0x7d32('0x4b')]({},_0x13b837,_0x144e4f[_0x7d32('0x4c')]);var _0x3e3020={'where':_0x13b837[_0x7d32('0x48')]};return db['OpenchannelQueue']['count'](_0x3e3020)[_0x7d32('0x2f')](function(_0x4183c2){_0x2bd64b[_0x7d32('0x28')]=_0x4183c2;if(_0x144e4f[_0x7d32('0x3c')]['includeAll']){_0x13b837[_0x7d32('0x4d')]=[{'all':!![]}];}return db[_0x7d32('0x37')][_0x7d32('0x4e')](_0x13b837);})[_0x7d32('0x2f')](function(_0x112de2){_0x2bd64b[_0x7d32('0x4f')]=_0x112de2;return _0x2bd64b;})[_0x7d32('0x2f')](respondWithFilteredResult(_0x112973,_0x13b837))[_0x7d32('0x50')](handleError(_0x112973,null));};exports[_0x7d32('0x51')]=function(_0x5941f9,_0x3b924e){var _0x5a7988={'raw':!![],'where':{'id':_0x5941f9[_0x7d32('0x52')]['id']}},_0x107ea3={};_0x107ea3['model']=_['keys'](db[_0x7d32('0x37')][_0x7d32('0x38')]);_0x107ea3[_0x7d32('0x3c')]=_['keys'](_0x5941f9[_0x7d32('0x3c')]);_0x107ea3[_0x7d32('0x3e')]=_[_0x7d32('0x3f')](_0x107ea3[_0x7d32('0x40')],_0x107ea3['query']);_0x5a7988[_0x7d32('0x41')]=_[_0x7d32('0x3f')](_0x107ea3[_0x7d32('0x40')],qs['fields'](_0x5941f9['query'][_0x7d32('0x42')]));_0x5a7988[_0x7d32('0x41')]=_0x5a7988[_0x7d32('0x41')][_0x7d32('0x43')]?_0x5a7988[_0x7d32('0x41')]:_0x107ea3['model'];if(_0x5941f9['query'][_0x7d32('0x53')]){_0x5a7988[_0x7d32('0x4d')]=[{'all':!![]}];}_0x5a7988=_[_0x7d32('0x4b')]({},_0x5a7988,_0x5941f9[_0x7d32('0x4c')]);return db['OpenchannelQueue'][_0x7d32('0x54')](_0x5a7988)['then'](handleEntityNotFound(_0x3b924e,null))[_0x7d32('0x2f')](respondWithResult(_0x3b924e,null))[_0x7d32('0x50')](handleError(_0x3b924e,null));};exports[_0x7d32('0x55')]=function(_0x11b2d0,_0x3cda94){return db[_0x7d32('0x37')][_0x7d32('0x55')](_0x11b2d0[_0x7d32('0x56')],{})[_0x7d32('0x2f')](function(_0xbdf84b){var _0x26383f=_0x11b2d0['user'][_0x7d32('0x31')]({'plain':!![]});if(!_0x26383f)throw new Error(_0x7d32('0x57'));if(_0x26383f[_0x7d32('0x58')]===_0x7d32('0x59')){var _0x116ce2=_0xbdf84b['get']({'plain':!![]});var _0x38d9e3=_0x7d32('0x5a');return db['UserProfileSection'][_0x7d32('0x54')]({'where':{'name':_0x38d9e3,'userProfileId':_0x26383f[_0x7d32('0x5b')]},'raw':!![]})[_0x7d32('0x2f')](function(_0x419c42){if(_0x419c42&&_0x419c42['autoAssociation']===0x0){return db[_0x7d32('0x5c')]['create']({'name':_0x116ce2[_0x7d32('0x33')],'resourceId':_0x116ce2['id'],'type':_0x419c42[_0x7d32('0x33')],'sectionId':_0x419c42['id']},{})['then'](function(){return _0xbdf84b;});}else{return _0xbdf84b;}})[_0x7d32('0x50')](function(_0xaab41e){logger[_0x7d32('0x32')](_0x7d32('0x5d'),_0xaab41e);throw _0xaab41e;});}return _0xbdf84b;})[_0x7d32('0x2f')](respondWithResult(_0x3cda94,0xc9))['catch'](handleError(_0x3cda94,null));};exports[_0x7d32('0x2e')]=function(_0x5aba1b,_0x48410b){if(_0x5aba1b[_0x7d32('0x56')]['id']){delete _0x5aba1b[_0x7d32('0x56')]['id'];}return db[_0x7d32('0x37')][_0x7d32('0x54')]({'where':{'id':_0x5aba1b[_0x7d32('0x52')]['id']}})[_0x7d32('0x2f')](handleEntityNotFound(_0x48410b,null))[_0x7d32('0x2f')](saveUpdates(_0x5aba1b[_0x7d32('0x56')],null))[_0x7d32('0x2f')](respondWithResult(_0x48410b,null))[_0x7d32('0x50')](handleError(_0x48410b,null));};exports[_0x7d32('0x30')]=function(_0x30c4a3,_0x53c4ec){return db[_0x7d32('0x37')][_0x7d32('0x54')]({'where':{'id':_0x30c4a3[_0x7d32('0x52')]['id']}})['then'](handleEntityNotFound(_0x53c4ec,null))['then'](removeEntity(_0x53c4ec,null))['catch'](handleError(_0x53c4ec,null));};exports[_0x7d32('0x5e')]=function(_0x1bfc50,_0x629cf){return db[_0x7d32('0x37')][_0x7d32('0x5e')]()[_0x7d32('0x2f')](respondWithResult(_0x629cf,null))[_0x7d32('0x50')](handleError(_0x629cf,null));};exports['getMembers']=function(_0x4d4df8,_0x5278ea,_0x33601e){var _0x270ad6={'raw':!![],'where':{}},_0x283b98={},_0x90fd10;return db['OpenchannelQueue'][_0x7d32('0x5f')]({'where':{'id':_0x4d4df8[_0x7d32('0x52')]['id']}})[_0x7d32('0x2f')](handleEntityNotFound(_0x5278ea,null))[_0x7d32('0x2f')](function(_0x384a49){if(_0x384a49){_0x90fd10=_0x384a49[_0x7d32('0x31')]({'plain':!![]});_0x283b98[_0x7d32('0x40')]=_['keys'](db[_0x7d32('0x60')][_0x7d32('0x38')]);_0x283b98[_0x7d32('0x3c')]=_['keys'](_0x4d4df8[_0x7d32('0x3c')]);_0x283b98['filters']=_[_0x7d32('0x3f')](_0x283b98[_0x7d32('0x40')],_0x283b98[_0x7d32('0x3c')]);_0x270ad6[_0x7d32('0x41')]=_[_0x7d32('0x3f')](_0x283b98[_0x7d32('0x40')],qs[_0x7d32('0x42')](_0x4d4df8[_0x7d32('0x3c')][_0x7d32('0x42')]));_0x270ad6[_0x7d32('0x41')]=_0x270ad6[_0x7d32('0x41')]['length']?_0x270ad6[_0x7d32('0x41')]:_0x283b98[_0x7d32('0x40')];if(!_0x4d4df8[_0x7d32('0x3c')][_0x7d32('0x44')](_0x7d32('0x45'))){_0x270ad6[_0x7d32('0x26')]=qs[_0x7d32('0x26')](_0x4d4df8[_0x7d32('0x3c')][_0x7d32('0x26')]);_0x270ad6[_0x7d32('0x25')]=qs[_0x7d32('0x25')](_0x4d4df8['query'][_0x7d32('0x25')]);}_0x270ad6[_0x7d32('0x46')]=qs['sort'](_0x4d4df8[_0x7d32('0x3c')]['sort']);_0x270ad6[_0x7d32('0x48')]=qs[_0x7d32('0x3e')](_['pick'](_0x4d4df8['query'],_0x283b98['filters']));_0x270ad6['where'][_0x7d32('0x61')]=_0x384a49['id'];if(_0x4d4df8[_0x7d32('0x3c')][_0x7d32('0x4a')]){_0x270ad6[_0x7d32('0x48')]=_[_0x7d32('0x4b')](_0x270ad6[_0x7d32('0x48')],{'$or':_[_0x7d32('0x36')](_0x270ad6[_0x7d32('0x41')],function(_0x11c7e5){var _0x40fd05={};_0x40fd05[_0x11c7e5]={'$like':'%'+_0x4d4df8[_0x7d32('0x3c')]['filter']+'%'};return _0x40fd05;})});}_0x270ad6=_['merge']({},_0x270ad6,_0x4d4df8[_0x7d32('0x4c')]);return db[_0x7d32('0x60')][_0x7d32('0x4e')](_0x270ad6);}})[_0x7d32('0x2f')](function(_0x5b9083){if(_0x5b9083){return db[_0x7d32('0x62')][_0x7d32('0x63')]({'where':{'id':_[_0x7d32('0x36')](_0x5b9083,'UserId'),'role':_0x7d32('0x64')},'attributes':['id','name',_0x7d32('0x65'),_0x7d32('0x66'),_0x7d32('0x67')]});}})[_0x7d32('0x2f')](function(_0x21b8b7){if(_0x21b8b7){return{'count':_0x21b8b7['count'],'rows':_[_0x7d32('0x36')](_0x21b8b7[_0x7d32('0x4f')],function(_0x3c9aef){return{'membername':_0x3c9aef[_0x7d32('0x33')],'UserId':_0x3c9aef['id'],'queue_name':_0x90fd10[_0x7d32('0x33')],'OpenchannelQueueId':_0x90fd10['id'],'interface':util[_0x7d32('0x68')](_0x7d32('0x69'),_0x7d32('0x6a'),_0x3c9aef[_0x7d32('0x33')]),'penalty':0x0,'paused':_0x3c9aef[_0x7d32('0x65')],'createdAt':_0x3c9aef[_0x7d32('0x67')],'updatedAt':_0x3c9aef[_0x7d32('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7d32('0x2f')](respondWithFilteredResult(_0x5278ea,_0x270ad6))[_0x7d32('0x50')](handleError(_0x5278ea,null));};exports[_0x7d32('0x6b')]=function(_0x59103e,_0x14babe,_0x4ff20f){var _0x42d248={};var _0x4dbabc={};var _0x53f7d2;var _0x4c4c50;return db[_0x7d32('0x37')]['findOne']({'where':{'id':_0x59103e[_0x7d32('0x52')]['id']}})[_0x7d32('0x2f')](handleEntityNotFound(_0x14babe,null))['then'](function(_0x21315b){if(_0x21315b){_0x53f7d2=_0x21315b;_0x4dbabc[_0x7d32('0x40')]=_[_0x7d32('0x3d')](db['Team']['rawAttributes']);_0x4dbabc[_0x7d32('0x3c')]=_[_0x7d32('0x3d')](_0x59103e[_0x7d32('0x3c')]);_0x4dbabc[_0x7d32('0x3e')]=_[_0x7d32('0x3f')](_0x4dbabc[_0x7d32('0x40')],_0x4dbabc[_0x7d32('0x3c')]);_0x42d248[_0x7d32('0x41')]=_[_0x7d32('0x3f')](_0x4dbabc[_0x7d32('0x40')],qs[_0x7d32('0x42')](_0x59103e[_0x7d32('0x3c')][_0x7d32('0x42')]));_0x42d248['attributes']=_0x42d248[_0x7d32('0x41')][_0x7d32('0x43')]?_0x42d248[_0x7d32('0x41')]:_0x4dbabc['model'];_0x42d248['order']=qs[_0x7d32('0x47')](_0x59103e[_0x7d32('0x3c')][_0x7d32('0x47')]);_0x42d248[_0x7d32('0x48')]=qs['filters'](_[_0x7d32('0x49')](_0x59103e['query'],_0x4dbabc[_0x7d32('0x3e')]));if(_0x59103e[_0x7d32('0x3c')]['filter']){_0x42d248[_0x7d32('0x48')]=_['merge'](_0x42d248[_0x7d32('0x48')],{'$or':_['map'](_0x42d248[_0x7d32('0x41')],function(_0x5743c6){var _0x6cd3c1={};_0x6cd3c1[_0x5743c6]={'$like':'%'+_0x59103e[_0x7d32('0x3c')][_0x7d32('0x4a')]+'%'};return _0x6cd3c1;})});}_0x42d248=_[_0x7d32('0x4b')]({},_0x42d248,_0x59103e[_0x7d32('0x4c')]);return _0x53f7d2[_0x7d32('0x6b')](_0x42d248);}})[_0x7d32('0x2f')](function(_0x223af0){if(_0x223af0){_0x4c4c50=_0x223af0[_0x7d32('0x43')];if(!_0x59103e[_0x7d32('0x3c')]['hasOwnProperty'](_0x7d32('0x45'))){_0x42d248[_0x7d32('0x26')]=qs[_0x7d32('0x26')](_0x59103e['query']['limit']);_0x42d248[_0x7d32('0x25')]=qs[_0x7d32('0x25')](_0x59103e[_0x7d32('0x3c')][_0x7d32('0x25')]);}return _0x53f7d2['getTeams'](_0x42d248);}})[_0x7d32('0x2f')](function(_0x1c6f9e){if(_0x1c6f9e){return _0x1c6f9e?{'count':_0x4c4c50,'rows':_0x1c6f9e}:null;}})[_0x7d32('0x2f')](respondWithResult(_0x14babe,null))['catch'](handleError(_0x14babe,null));};exports[_0x7d32('0x6c')]=function(_0x41630c,_0x4579c0,_0x38f749){var _0xc04fc8=_0x41630c[_0x7d32('0x56')]['ids'];return db[_0x7d32('0x6d')][_0x7d32('0x4e')]({'where':{'id':_0xc04fc8},'attributes':['id'],'include':[{'model':db[_0x7d32('0x62')],'as':_0x7d32('0x6e'),'attributes':['id','name',_0x7d32('0x6f'),_0x7d32('0x70'),_0x7d32('0x71')],'raw':!![]}]})['then'](function(_0x919eb5){if(_0x919eb5){var _0x21100a=_[_0x7d32('0x72')](_0x919eb5,function(_0x155db9){var _0x37e70e=_0x155db9['get']({'plain':!![]});return _0x37e70e[_0x7d32('0x6e')];});return db[_0x7d32('0x37')][_0x7d32('0x54')]({'where':{'id':_0x41630c[_0x7d32('0x52')]['id']}})[_0x7d32('0x2f')](function(_0x3a59fb){return db['sequelize']['transaction'](function(_0x13dbb0){return _0x3a59fb[_0x7d32('0x6c')](_0xc04fc8,{'transaction':_0x13dbb0})[_0x7d32('0x2f')](function(){return BPromise[_0x7d32('0x73')](_0x21100a,function(_0x45ee4b){return db[_0x7d32('0x60')][_0x7d32('0x74')]({'where':{'UserId':_0x45ee4b['id'],'OpenchannelQueueId':_0x41630c['params']['id']},'transaction':_0x13dbb0});});})[_0x7d32('0x2f')](function(){_0x21100a[_0x7d32('0x75')](function(_0x525e85){socket[_0x7d32('0x76')]('userOpenchannelQueue:save',{'UserId':_0x525e85['id'],'OpenchannelQueueId':_0x3a59fb['id']});});});});});}})[_0x7d32('0x2f')](respondWithStatusCode(_0x4579c0,null))[_0x7d32('0x50')](handleError(_0x4579c0,null));};exports['removeTeams']=function(_0x4dd3a1,_0x249cd0,_0x43a89c){return db[_0x7d32('0x6d')]['findAll']({'where':{'id':_0x4dd3a1[_0x7d32('0x3c')][_0x7d32('0x77')]},'attributes':['id'],'include':[{'model':db[_0x7d32('0x62')],'as':_0x7d32('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x7d32('0x2f')](handleEntityNotFound(_0x249cd0,null))[_0x7d32('0x2f')](function(_0x3771e5){var _0x57bffd=_[_0x7d32('0x36')](_0x3771e5,'id');var _0x3a6800=[];var _0x3a5452=[];var _0x46e8e9=squel[_0x7d32('0x78')]();_0x46e8e9[_0x7d32('0x79')](_0x7d32('0x7a'))[_0x7d32('0x7b')]('team_has_openchannel_queues','tq')[_0x7d32('0x7c')](_0x7d32('0x7d'),'ut',_0x7d32('0x7e'))[_0x7d32('0x48')]('OpenchannelQueueId\x20=\x20?',_0x4dd3a1[_0x7d32('0x52')]['id']);for(var _0xec3fde=0x0;_0xec3fde<_0x3771e5['length'];_0xec3fde+=0x1){let _0x5a03f8=_0x3771e5[_0xec3fde];for(var _0x55f881=0x0;_0x55f881<_0x5a03f8[_0x7d32('0x6e')]['length'];_0x55f881+=0x1){let _0x17d866=_0x5a03f8[_0x7d32('0x6e')][_0x55f881];var _0x1d326f=_0x46e8e9[_0x7d32('0x7f')]();_0x1d326f['where']('ut.UserId\x20=\x20?',_0x17d866['id']);_0x3a5452[_0x7d32('0x80')](db[_0x7d32('0x81')][_0x7d32('0x3c')](_0x1d326f[_0x7d32('0x82')](),{'type':db[_0x7d32('0x81')][_0x7d32('0x83')][_0x7d32('0x84')]})[_0x7d32('0x2f')](function(_0x13a3da){if(_0x13a3da['length']===0x1){return _0x17d866['id'];}else{var _0x1720b9=_['every'](_[_0x7d32('0x36')](_0x13a3da,_0x7d32('0x85')),function(_0x33db59){return _[_0x7d32('0x86')](_0x57bffd,_0x33db59);});if(_0x1720b9){return _0x17d866['id'];}}}));}}return BPromise[_0x7d32('0x87')](_0x3a5452)[_0x7d32('0x2f')](function(_0x190a0d){_0x3a6800=_(_0x3a6800)[_0x7d32('0x88')](_0x190a0d)[_0x7d32('0x89')]()[_0x7d32('0x8a')]();return db[_0x7d32('0x37')]['find']({'where':{'id':_0x4dd3a1[_0x7d32('0x52')]['id']}})[_0x7d32('0x2f')](function(_0x4fd17f){return db[_0x7d32('0x81')][_0x7d32('0x8b')](function(_0x2fd3e9){return _0x4fd17f[_0x7d32('0x8c')](_0x4dd3a1[_0x7d32('0x3c')][_0x7d32('0x77')],{'transaction':_0x2fd3e9})[_0x7d32('0x2f')](function(){if(!_['isEmpty'](_0x3a6800)){return _0x4fd17f[_0x7d32('0x8d')](_0x3a6800,{'transaction':_0x2fd3e9});}})[_0x7d32('0x2f')](function(){_0x3a6800[_0x7d32('0x75')](function(_0x114d70){socket['emit'](_0x7d32('0x8e'),{'UserId':_0x114d70,'OpenchannelQueueId':_0x4fd17f['id']});});});});});});})[_0x7d32('0x2f')](respondWithStatusCode(_0x249cd0,null))[_0x7d32('0x50')](handleError(_0x249cd0,null));};exports[_0x7d32('0x8f')]=function(_0x378ff2,_0x360510,_0x496839){return db['OpenchannelQueue'][_0x7d32('0x54')]({'where':{'id':_0x378ff2[_0x7d32('0x52')]['id']}})[_0x7d32('0x2f')](handleEntityNotFound(_0x360510,null))[_0x7d32('0x2f')](function(_0x1c3764){if(_0x1c3764){return _0x1c3764[_0x7d32('0x8f')](_0x378ff2[_0x7d32('0x56')][_0x7d32('0x77')],_[_0x7d32('0x90')](_0x378ff2[_0x7d32('0x56')],[_0x7d32('0x77'),'id'])||{})[_0x7d32('0x91')](function(_0x28898f){for(var _0x3691b0=0x0;_0x3691b0<_0x378ff2[_0x7d32('0x56')][_0x7d32('0x77')][_0x7d32('0x43')];_0x3691b0+=0x1){socket[_0x7d32('0x76')]('userOpenchannelQueue:save',{'UserId':Number(_0x378ff2[_0x7d32('0x56')][_0x7d32('0x77')][_0x3691b0]),'OpenchannelQueueId':Number(_0x378ff2['params']['id'])});}return _0x28898f;});}})[_0x7d32('0x2f')](respondWithResult(_0x360510,null))[_0x7d32('0x50')](handleError(_0x360510,null));};exports['removeAgents']=function(_0x4425b5,_0x563274,_0x50203d){return db[_0x7d32('0x37')]['find']({'where':{'id':_0x4425b5['params']['id']}})[_0x7d32('0x2f')](handleEntityNotFound(_0x563274,null))[_0x7d32('0x2f')](function(_0x28ca75){if(_0x28ca75){return _0x28ca75[_0x7d32('0x8d')](_0x4425b5['query'][_0x7d32('0x77')])[_0x7d32('0x2f')](function(){if(_['isArray'](_0x4425b5[_0x7d32('0x3c')][_0x7d32('0x77')])){for(var _0x1bf423=0x0;_0x1bf423<_0x4425b5[_0x7d32('0x3c')][_0x7d32('0x77')][_0x7d32('0x43')];_0x1bf423+=0x1){socket[_0x7d32('0x76')](_0x7d32('0x8e'),{'UserId':Number(_0x4425b5[_0x7d32('0x3c')][_0x7d32('0x77')][_0x1bf423]),'OpenchannelQueueId':Number(_0x4425b5[_0x7d32('0x52')]['id'])});}}else{socket[_0x7d32('0x76')](_0x7d32('0x8e'),{'UserId':Number(_0x4425b5['query'][_0x7d32('0x77')]),'OpenchannelQueueId':Number(_0x4425b5[_0x7d32('0x52')]['id'])});}});}})[_0x7d32('0x2f')](respondWithStatusCode(_0x563274,null))[_0x7d32('0x50')](handleError(_0x563274,null));};exports[_0x7d32('0x92')]=function(_0x2bd082,_0xbcab76,_0x188ee7){var _0x23cf82={};var _0x11a0e3={};var _0x53b1fe;var _0x1a6943;return db[_0x7d32('0x37')][_0x7d32('0x5f')]({'where':{'id':_0x2bd082[_0x7d32('0x52')]['id']}})[_0x7d32('0x2f')](handleEntityNotFound(_0xbcab76,null))['then'](function(_0x5517bd){if(_0x5517bd){_0x53b1fe=_0x5517bd;_0x11a0e3[_0x7d32('0x40')]=_[_0x7d32('0x3d')](db[_0x7d32('0x62')]['rawAttributes']);_0x11a0e3[_0x7d32('0x3c')]=_[_0x7d32('0x3d')](_0x2bd082[_0x7d32('0x3c')]);_0x11a0e3[_0x7d32('0x3e')]=_[_0x7d32('0x3f')](_0x11a0e3[_0x7d32('0x40')],_0x11a0e3[_0x7d32('0x3c')]);_0x23cf82[_0x7d32('0x41')]=_[_0x7d32('0x3f')](_0x11a0e3[_0x7d32('0x40')],qs[_0x7d32('0x42')](_0x2bd082[_0x7d32('0x3c')][_0x7d32('0x42')]));_0x23cf82[_0x7d32('0x41')]=_0x23cf82[_0x7d32('0x41')]['length']?_0x23cf82[_0x7d32('0x41')]:_0x11a0e3['model'];_0x23cf82[_0x7d32('0x46')]=qs['sort'](_0x2bd082['query'][_0x7d32('0x47')]);_0x23cf82[_0x7d32('0x48')]=qs['filters'](_[_0x7d32('0x49')](_0x2bd082['query'],_0x11a0e3[_0x7d32('0x3e')]));if(_0x2bd082[_0x7d32('0x3c')][_0x7d32('0x4a')]){_0x23cf82['where']=_[_0x7d32('0x4b')](_0x23cf82['where'],{'$or':_['map'](_0x23cf82[_0x7d32('0x41')],function(_0x40a309){var _0x3b68c9={};_0x3b68c9[_0x40a309]={'$like':'%'+_0x2bd082['query'][_0x7d32('0x4a')]+'%'};return _0x3b68c9;})});}_0x23cf82=_[_0x7d32('0x4b')]({},_0x23cf82,_0x2bd082['options']);return _0x53b1fe['getAgents'](_0x23cf82);}})[_0x7d32('0x2f')](function(_0x205966){if(_0x205966){_0x1a6943=_0x205966[_0x7d32('0x43')];if(!_0x2bd082[_0x7d32('0x3c')][_0x7d32('0x44')](_0x7d32('0x45'))){_0x23cf82[_0x7d32('0x26')]=qs[_0x7d32('0x26')](_0x2bd082[_0x7d32('0x3c')][_0x7d32('0x26')]);_0x23cf82['offset']=qs['offset'](_0x2bd082['query'][_0x7d32('0x25')]);}return _0x53b1fe[_0x7d32('0x92')](_0x23cf82);}})['then'](function(_0x35f9a5){if(_0x35f9a5){return _0x35f9a5?{'count':_0x1a6943,'rows':_0x35f9a5}:null;}})[_0x7d32('0x2f')](respondWithResult(_0xbcab76,null))['catch'](handleError(_0xbcab76,null));};
\ No newline at end of file
index c402dbf..d297308 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e80=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','emit'];(function(_0x52bdde,_0x2fd479){var _0xfced90=function(_0x5d3ad8){while(--_0x5d3ad8){_0x52bdde['push'](_0x52bdde['shift']());}};_0xfced90(++_0x2fd479);}(_0x8e80,0x161));var _0x08e8=function(_0x34e79d,_0x1fb826){_0x34e79d=_0x34e79d-0x0;var _0x56afa8=_0x8e80[_0x34e79d];return _0x56afa8;};'use strict';var EventEmitter=require(_0x08e8('0x0'));var OpenchannelQueue=require(_0x08e8('0x1'))['db'][_0x08e8('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x08e8('0x3')](0x0);var events={'afterCreate':_0x08e8('0x4'),'afterUpdate':_0x08e8('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4463a4){return function(_0x1f6e6e,_0x25babe,_0x37ec5c){OpenchannelQueueEvents[_0x08e8('0x6')](_0x4463a4+':'+_0x1f6e6e['id'],_0x1f6e6e);OpenchannelQueueEvents[_0x08e8('0x6')](_0x4463a4,_0x1f6e6e);_0x37ec5c(null);};}for(var e in events){if(events[_0x08e8('0x7')](e)){var event=events[e];OpenchannelQueue[_0x08e8('0x8')](e,emitEvent(event));}}module[_0x08e8('0x9')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x3452=['remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x2e6e0a,_0x8e6bed){var _0x566cea=function(_0x30e90d){while(--_0x30e90d){_0x2e6e0a['push'](_0x2e6e0a['shift']());}};_0x566cea(++_0x8e6bed);}(_0x3452,0x1ef));var _0x2345=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3452[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x2345('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x2345('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2345('0x2')};function emitEvent(_0x120efe){return function(_0xd0647a,_0x2ccfa1,_0x2d8543){OpenchannelQueueEvents[_0x2345('0x3')](_0x120efe+':'+_0xd0647a['id'],_0xd0647a);OpenchannelQueueEvents[_0x2345('0x3')](_0x120efe,_0xd0647a);_0x2d8543(null);};}for(var e in events){if(events[_0x2345('0x4')](e)){var event=events[e];OpenchannelQueue[_0x2345('0x5')](e,emitEvent(event));}}module[_0x2345('0x6')]=OpenchannelQueueEvents;
\ No newline at end of file
index 143da66..f86aafe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafb2=['bluebird','request-promise','path','rimraf','./openchannelQueue.attributes','exports','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','moment'];(function(_0xe35b33,_0x286bb4){var _0x1b5ecf=function(_0x5a8739){while(--_0x5a8739){_0xe35b33['push'](_0xe35b33['shift']());}};_0x1b5ecf(++_0x286bb4);}(_0xafb2,0x194));var _0x2afb=function(_0x509ae8,_0x584aef){_0x509ae8=_0x509ae8-0x0;var _0x26fa47=_0xafb2[_0x509ae8];return _0x26fa47;};'use strict';var _=require(_0x2afb('0x0'));var util=require(_0x2afb('0x1'));var logger=require(_0x2afb('0x2'))('api');var moment=require(_0x2afb('0x3'));var BPromise=require(_0x2afb('0x4'));var rp=require(_0x2afb('0x5'));var fs=require('fs');var path=require(_0x2afb('0x6'));var rimraf=require(_0x2afb('0x7'));var config=require('../../config/environment');var attributes=require(_0x2afb('0x8'));module[_0x2afb('0x9')]=function(_0x388968,_0x17532a){return _0x388968['define'](_0x2afb('0xa'),attributes,{'tableName':_0x2afb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x52e0=['exports','OpenchannelQueue','openchannel_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes'];(function(_0x4286a5,_0x36a34d){var _0x1f7437=function(_0x537d25){while(--_0x537d25){_0x4286a5['push'](_0x4286a5['shift']());}};_0x1f7437(++_0x36a34d);}(_0x52e0,0xac));var _0x052e=function(_0x2b15ec,_0x1027b6){_0x2b15ec=_0x2b15ec-0x0;var _0x5e320a=_0x52e0[_0x2b15ec];return _0x5e320a;};'use strict';var _=require('lodash');var util=require(_0x052e('0x0'));var logger=require(_0x052e('0x1'))(_0x052e('0x2'));var moment=require(_0x052e('0x3'));var BPromise=require(_0x052e('0x4'));var rp=require(_0x052e('0x5'));var fs=require('fs');var path=require(_0x052e('0x6'));var rimraf=require(_0x052e('0x7'));var config=require(_0x052e('0x8'));var attributes=require(_0x052e('0x9'));module[_0x052e('0xa')]=function(_0x1b7997,_0x4b3c6f){return _0x1b7997['define'](_0x052e('0xb'),attributes,{'tableName':_0x052e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 76b2273..db7636b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5df4=['request\x20sent','debug','error','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','where','attributes','include','map','model','stringify','find','raw','then','ShowOpenchannelQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelQueue.socket','request','info','OpenchannelQueue,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5df4,0xb0));var _0x45df=function(_0x3de077,_0x422ac4){_0x3de077=_0x3de077-0x0;var _0x5d29d5=_0x5df4[_0x3de077];return _0x5d29d5;};'use strict';var _=require(_0x45df('0x0'));var util=require('util');var moment=require(_0x45df('0x1'));var BPromise=require(_0x45df('0x2'));var rs=require(_0x45df('0x3'));var fs=require('fs');var Redis=require(_0x45df('0x4'));var db=require(_0x45df('0x5'))['db'];var utils=require(_0x45df('0x6'));var logger=require(_0x45df('0x7'))('rpc');var config=require(_0x45df('0x8'));var jayson=require(_0x45df('0x9'));var client=jayson[_0x45df('0xa')][_0x45df('0xb')]({'port':0x232a});config[_0x45df('0xc')]=_[_0x45df('0xd')](config[_0x45df('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x45df('0xe'))(new Redis(config[_0x45df('0xc')]));require(_0x45df('0xf'))['register'](socket);function respondWithRpcPromise(_0x59da75,_0xb720da,_0x4677b8){return new BPromise(function(_0x1ff1b5,_0x33b7e1){return client[_0x45df('0x10')](_0x59da75,_0x4677b8)['then'](function(_0x5a3d11){logger[_0x45df('0x11')](_0x45df('0x12'),_0xb720da,_0x45df('0x13'));logger[_0x45df('0x14')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0xb720da,_0x45df('0x13'),JSON['stringify'](_0x5a3d11));if(_0x5a3d11[_0x45df('0x15')]){if(_0x5a3d11[_0x45df('0x15')]['code']===0x1f4){logger[_0x45df('0x15')](_0x45df('0x12'),_0xb720da,_0x5a3d11['error'][_0x45df('0x16')]);return _0x33b7e1(_0x5a3d11[_0x45df('0x15')][_0x45df('0x16')]);}logger[_0x45df('0x15')](_0x45df('0x12'),_0xb720da,_0x5a3d11[_0x45df('0x15')][_0x45df('0x16')]);return _0x1ff1b5(_0x5a3d11[_0x45df('0x15')][_0x45df('0x16')]);}else{logger[_0x45df('0x11')](_0x45df('0x12'),_0xb720da,_0x45df('0x13'));_0x1ff1b5(_0x5a3d11[_0x45df('0x17')][_0x45df('0x16')]);}})[_0x45df('0x18')](function(_0x182fa3){logger[_0x45df('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0xb720da,_0x182fa3);_0x33b7e1(_0x182fa3);});});}exports[_0x45df('0x19')]=function(_0x34c77d){var _0x4bc793=this;return new Promise(function(_0x466cbf,_0x54a74f){return db[_0x45df('0x1a')][_0x45df('0x1b')]({'raw':_0x34c77d[_0x45df('0x1c')]?_0x34c77d['options']['raw']===undefined?!![]:![]:!![],'where':_0x34c77d['options']?_0x34c77d['options'][_0x45df('0x1d')]||null:null,'attributes':_0x34c77d[_0x45df('0x1c')]?_0x34c77d['options'][_0x45df('0x1e')]||null:null,'limit':_0x34c77d[_0x45df('0x1c')]?_0x34c77d[_0x45df('0x1c')]['limit']||null:null,'include':_0x34c77d[_0x45df('0x1c')]?_0x34c77d[_0x45df('0x1c')]['include']?_['map'](_0x34c77d[_0x45df('0x1c')][_0x45df('0x1f')],function(_0x1e3fbf){return{'model':db[_0x1e3fbf['model']],'as':_0x1e3fbf['as'],'attributes':_0x1e3fbf[_0x45df('0x1e')],'include':_0x1e3fbf['include']?_[_0x45df('0x20')](_0x1e3fbf[_0x45df('0x1f')],function(_0x1d0e9e){return{'model':db[_0x1d0e9e['model']],'as':_0x1d0e9e['as'],'attributes':_0x1d0e9e[_0x45df('0x1e')],'include':_0x1d0e9e['include']?_[_0x45df('0x20')](_0x1d0e9e[_0x45df('0x1f')],function(_0x22bdc4){return{'model':db[_0x22bdc4[_0x45df('0x21')]],'as':_0x22bdc4['as'],'attributes':_0x22bdc4[_0x45df('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35338f){logger[_0x45df('0x11')](_0x45df('0x19'),_0x34c77d);logger[_0x45df('0x14')](_0x45df('0x19'),_0x34c77d,JSON[_0x45df('0x22')](_0x35338f));_0x466cbf(_0x35338f);})['catch'](function(_0x266a76){logger[_0x45df('0x15')]('GetOpenchannelQueue',_0x266a76[_0x45df('0x16')],_0x34c77d);_0x54a74f(_0x4bc793[_0x45df('0x15')](0x1f4,_0x266a76[_0x45df('0x16')]));});});};exports['ShowOpenchannelQueue']=function(_0x51262b){var _0x3332c5=this;return new Promise(function(_0x1bb2e9,_0xa08018){return db['OpenchannelQueue'][_0x45df('0x23')]({'raw':_0x51262b[_0x45df('0x1c')]?_0x51262b[_0x45df('0x1c')][_0x45df('0x24')]===undefined?!![]:![]:!![],'where':_0x51262b['options']?_0x51262b[_0x45df('0x1c')]['where']||null:null,'attributes':_0x51262b[_0x45df('0x1c')]?_0x51262b[_0x45df('0x1c')][_0x45df('0x1e')]||null:null,'include':_0x51262b[_0x45df('0x1c')]?_0x51262b[_0x45df('0x1c')][_0x45df('0x1f')]?_['map'](_0x51262b[_0x45df('0x1c')][_0x45df('0x1f')],function(_0x1540e0){return{'model':db[_0x1540e0[_0x45df('0x21')]],'as':_0x1540e0['as'],'attributes':_0x1540e0[_0x45df('0x1e')],'include':_0x1540e0[_0x45df('0x1f')]?_['map'](_0x1540e0['include'],function(_0x18ca1a){return{'model':db[_0x18ca1a['model']],'as':_0x18ca1a['as'],'attributes':_0x18ca1a['attributes'],'include':_0x18ca1a[_0x45df('0x1f')]?_[_0x45df('0x20')](_0x18ca1a['include'],function(_0x8af001){return{'model':db[_0x8af001[_0x45df('0x21')]],'as':_0x8af001['as'],'attributes':_0x8af001[_0x45df('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x45df('0x25')](function(_0xfc90b4){logger[_0x45df('0x11')]('ShowOpenchannelQueue',_0x51262b);logger[_0x45df('0x14')](_0x45df('0x26'),_0x51262b,JSON[_0x45df('0x22')](_0xfc90b4));_0x1bb2e9(_0xfc90b4);})[_0x45df('0x18')](function(_0x3aea1c){logger[_0x45df('0x15')](_0x45df('0x26'),_0x3aea1c[_0x45df('0x16')],_0x51262b);_0xa08018(_0x3332c5[_0x45df('0x15')](0x1f4,_0x3aea1c[_0x45df('0x16')]));});});};
\ No newline at end of file
+var _0x3777=['options','raw','where','attributes','limit','include','map','model','then','ShowOpenchannelQueue','OpenchannelQueue','find','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','request','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue'];(function(_0x171195,_0x5241af){var _0x18d5a2=function(_0xa2e30d){while(--_0xa2e30d){_0x171195['push'](_0x171195['shift']());}};_0x18d5a2(++_0x5241af);}(_0x3777,0x19c));var _0x7377=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x3777[_0x1d9aa0];return _0x226868;};'use strict';var _=require(_0x7377('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7377('0x1'));var rs=require(_0x7377('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7377('0x3'))['db'];var utils=require(_0x7377('0x4'));var logger=require(_0x7377('0x5'))(_0x7377('0x6'));var config=require(_0x7377('0x7'));var jayson=require(_0x7377('0x8'));var client=jayson[_0x7377('0x9')][_0x7377('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x7377('0xb')],{'host':_0x7377('0xc'),'port':0x18eb});var socket=require(_0x7377('0xd'))(new Redis(config['redis']));require(_0x7377('0xe'))['register'](socket);function respondWithRpcPromise(_0x1b91c1,_0x1b8e51,_0x408361){return new BPromise(function(_0x4b910c,_0x2d2fef){return client[_0x7377('0xf')](_0x1b91c1,_0x408361)['then'](function(_0x42bec3){logger[_0x7377('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x1b8e51,_0x7377('0x11'));logger[_0x7377('0x12')](_0x7377('0x13'),_0x1b8e51,_0x7377('0x11'),JSON[_0x7377('0x14')](_0x42bec3));if(_0x42bec3['error']){if(_0x42bec3[_0x7377('0x15')][_0x7377('0x16')]===0x1f4){logger[_0x7377('0x15')](_0x7377('0x17'),_0x1b8e51,_0x42bec3[_0x7377('0x15')]['message']);return _0x2d2fef(_0x42bec3['error'][_0x7377('0x18')]);}logger['error'](_0x7377('0x17'),_0x1b8e51,_0x42bec3['error'][_0x7377('0x18')]);return _0x4b910c(_0x42bec3['error']['message']);}else{logger[_0x7377('0x10')](_0x7377('0x17'),_0x1b8e51,'request\x20sent');_0x4b910c(_0x42bec3[_0x7377('0x19')][_0x7377('0x18')]);}})[_0x7377('0x1a')](function(_0x391ad0){logger['error'](_0x7377('0x17'),_0x1b8e51,_0x391ad0);_0x2d2fef(_0x391ad0);});});}exports[_0x7377('0x1b')]=function(_0x303a7c){var _0xbb58d=this;return new Promise(function(_0x3ef0c8,_0x49b29e){return db['OpenchannelQueue']['findAll']({'raw':_0x303a7c[_0x7377('0x1c')]?_0x303a7c[_0x7377('0x1c')][_0x7377('0x1d')]===undefined?!![]:![]:!![],'where':_0x303a7c['options']?_0x303a7c[_0x7377('0x1c')][_0x7377('0x1e')]||null:null,'attributes':_0x303a7c[_0x7377('0x1c')]?_0x303a7c[_0x7377('0x1c')][_0x7377('0x1f')]||null:null,'limit':_0x303a7c['options']?_0x303a7c[_0x7377('0x1c')][_0x7377('0x20')]||null:null,'include':_0x303a7c[_0x7377('0x1c')]?_0x303a7c[_0x7377('0x1c')][_0x7377('0x21')]?_[_0x7377('0x22')](_0x303a7c[_0x7377('0x1c')][_0x7377('0x21')],function(_0xdd7e1a){return{'model':db[_0xdd7e1a[_0x7377('0x23')]],'as':_0xdd7e1a['as'],'attributes':_0xdd7e1a[_0x7377('0x1f')],'include':_0xdd7e1a[_0x7377('0x21')]?_[_0x7377('0x22')](_0xdd7e1a[_0x7377('0x21')],function(_0x571088){return{'model':db[_0x571088[_0x7377('0x23')]],'as':_0x571088['as'],'attributes':_0x571088['attributes'],'include':_0x571088[_0x7377('0x21')]?_['map'](_0x571088[_0x7377('0x21')],function(_0x867240){return{'model':db[_0x867240['model']],'as':_0x867240['as'],'attributes':_0x867240[_0x7377('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x7377('0x24')](function(_0x156fd5){logger[_0x7377('0x10')](_0x7377('0x1b'),_0x303a7c);logger[_0x7377('0x12')]('GetOpenchannelQueue',_0x303a7c,JSON[_0x7377('0x14')](_0x156fd5));_0x3ef0c8(_0x156fd5);})[_0x7377('0x1a')](function(_0x366811){logger['error']('GetOpenchannelQueue',_0x366811['message'],_0x303a7c);_0x49b29e(_0xbb58d[_0x7377('0x15')](0x1f4,_0x366811['message']));});});};exports[_0x7377('0x25')]=function(_0xd13491){var _0x354b7a=this;return new Promise(function(_0x358cac,_0x57ab07){return db[_0x7377('0x26')][_0x7377('0x27')]({'raw':_0xd13491['options']?_0xd13491[_0x7377('0x1c')][_0x7377('0x1d')]===undefined?!![]:![]:!![],'where':_0xd13491[_0x7377('0x1c')]?_0xd13491[_0x7377('0x1c')][_0x7377('0x1e')]||null:null,'attributes':_0xd13491[_0x7377('0x1c')]?_0xd13491[_0x7377('0x1c')][_0x7377('0x1f')]||null:null,'include':_0xd13491['options']?_0xd13491['options'][_0x7377('0x21')]?_[_0x7377('0x22')](_0xd13491[_0x7377('0x1c')][_0x7377('0x21')],function(_0x4ed5fe){return{'model':db[_0x4ed5fe[_0x7377('0x23')]],'as':_0x4ed5fe['as'],'attributes':_0x4ed5fe['attributes'],'include':_0x4ed5fe[_0x7377('0x21')]?_['map'](_0x4ed5fe['include'],function(_0xc2ae24){return{'model':db[_0xc2ae24[_0x7377('0x23')]],'as':_0xc2ae24['as'],'attributes':_0xc2ae24[_0x7377('0x1f')],'include':_0xc2ae24['include']?_[_0x7377('0x22')](_0xc2ae24['include'],function(_0x401884){return{'model':db[_0x401884['model']],'as':_0x401884['as'],'attributes':_0x401884[_0x7377('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f529e){logger[_0x7377('0x10')](_0x7377('0x25'),_0xd13491);logger['debug'](_0x7377('0x25'),_0xd13491,JSON[_0x7377('0x14')](_0x5f529e));_0x358cac(_0x5f529e);})[_0x7377('0x1a')](function(_0x4f75f5){logger[_0x7377('0x15')](_0x7377('0x25'),_0x4f75f5['message'],_0xd13491);_0x57ab07(_0x354b7a[_0x7377('0x15')](0x1f4,_0x4f75f5[_0x7377('0x18')]));});});};
\ No newline at end of file
index ed622e4..420d1ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36b2=['remove','update','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x36b2,0x181));var _0x236b=function(_0x192fe8,_0x5478c2){_0x192fe8=_0x192fe8-0x0;var _0x1af77a=_0x36b2[_0x192fe8];return _0x1af77a;};'use strict';var OpenchannelQueueEvents=require(_0x236b('0x0'));var events=[_0x236b('0x1'),_0x236b('0x2'),_0x236b('0x3')];function createListener(_0x46ca8f,_0x28bf98){return function(_0x4e5a22){_0x28bf98[_0x236b('0x4')](_0x46ca8f,_0x4e5a22);};}function removeListener(_0x503c5c,_0x4fb0e1){return function(){OpenchannelQueueEvents[_0x236b('0x5')](_0x503c5c,_0x4fb0e1);};}exports[_0x236b('0x6')]=function(_0xb4d4c){for(var _0x26bc62=0x0,_0x1e67c8=events[_0x236b('0x7')];_0x26bc62<_0x1e67c8;_0x26bc62++){var _0x561354=events[_0x26bc62];var _0xa3318c=createListener(_0x236b('0x8')+_0x561354,_0xb4d4c);OpenchannelQueueEvents['on'](_0x561354,_0xa3318c);}};
\ No newline at end of file
+var _0xb88d=['update','emit','removeListener','length','openchannelQueue:','./openchannelQueue.events','save','remove'];(function(_0x4352d1,_0x140c02){var _0x33148c=function(_0x2490ca){while(--_0x2490ca){_0x4352d1['push'](_0x4352d1['shift']());}};_0x33148c(++_0x140c02);}(_0xb88d,0x105));var _0xdb88=function(_0x230fec,_0x3cc8ca){_0x230fec=_0x230fec-0x0;var _0xae112=_0xb88d[_0x230fec];return _0xae112;};'use strict';var OpenchannelQueueEvents=require(_0xdb88('0x0'));var events=[_0xdb88('0x1'),_0xdb88('0x2'),_0xdb88('0x3')];function createListener(_0xeb7c2b,_0x4f7ba6){return function(_0x12c594){_0x4f7ba6[_0xdb88('0x4')](_0xeb7c2b,_0x12c594);};}function removeListener(_0x19a221,_0x2b4ca3){return function(){OpenchannelQueueEvents[_0xdb88('0x5')](_0x19a221,_0x2b4ca3);};}exports['register']=function(_0x5e5631){for(var _0xcca6f1=0x0,_0x57fb17=events[_0xdb88('0x6')];_0xcca6f1<_0x57fb17;_0xcca6f1++){var _0x23496f=events[_0xcca6f1];var _0x336377=createListener(_0xdb88('0x7')+_0x23496f,_0x5e5631);OpenchannelQueueEvents['on'](_0x23496f,_0x336377);}};
\ No newline at end of file
index a331bc9..01ec218 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf7ea=['isAuthenticated','index','/describe','describe','show','post','create','update','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0xa93afd,_0xfdedaa){var _0x47c5e8=function(_0x2822fe){while(--_0x2822fe){_0xa93afd['push'](_0xa93afd['shift']());}};_0x47c5e8(++_0xfdedaa);}(_0xf7ea,0xbf));var _0xaf7e=function(_0x17a866,_0x27b438){_0x17a866=_0x17a866-0x0;var _0x53346f=_0xf7ea[_0x17a866];return _0x53346f;};'use strict';var multer=require(_0xaf7e('0x0'));var util=require(_0xaf7e('0x1'));var path=require(_0xaf7e('0x2'));var timeout=require(_0xaf7e('0x3'));var express=require(_0xaf7e('0x4'));var router=express['Router']();var fs_extra=require(_0xaf7e('0x5'));var auth=require(_0xaf7e('0x6'));var interaction=require(_0xaf7e('0x7'));var config=require('../../config/environment');var controller=require('./openchannelQueueReport.controller');router[_0xaf7e('0x8')]('/',auth[_0xaf7e('0x9')](),controller[_0xaf7e('0xa')]);router[_0xaf7e('0x8')](_0xaf7e('0xb'),auth[_0xaf7e('0x9')](),controller[_0xaf7e('0xc')]);router[_0xaf7e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xaf7e('0xd')]);router[_0xaf7e('0xe')]('/',auth[_0xaf7e('0x9')](),controller[_0xaf7e('0xf')]);router['put']('/:id',auth[_0xaf7e('0x9')](),controller[_0xaf7e('0x10')]);router['delete'](_0xaf7e('0x11'),auth[_0xaf7e('0x9')](),controller[_0xaf7e('0x12')]);module[_0xaf7e('0x13')]=router;
\ No newline at end of file
+var _0x906d=['isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x1c3168,_0x49d04c){var _0xc78b3c=function(_0x5d6e53){while(--_0x5d6e53){_0x1c3168['push'](_0x1c3168['shift']());}};_0xc78b3c(++_0x49d04c);}(_0x906d,0xc4));var _0xd906=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0x906d[_0x88cd7b];return _0x56fcc8;};'use strict';var multer=require(_0xd906('0x0'));var util=require(_0xd906('0x1'));var path=require(_0xd906('0x2'));var timeout=require(_0xd906('0x3'));var express=require(_0xd906('0x4'));var router=express[_0xd906('0x5')]();var fs_extra=require(_0xd906('0x6'));var auth=require(_0xd906('0x7'));var interaction=require(_0xd906('0x8'));var config=require(_0xd906('0x9'));var controller=require('./openchannelQueueReport.controller');router[_0xd906('0xa')]('/',auth[_0xd906('0xb')](),controller[_0xd906('0xc')]);router['get'](_0xd906('0xd'),auth['isAuthenticated'](),controller[_0xd906('0xe')]);router[_0xd906('0xa')](_0xd906('0xf'),auth[_0xd906('0xb')](),controller[_0xd906('0x10')]);router['post']('/',auth[_0xd906('0xb')](),controller[_0xd906('0x11')]);router[_0xd906('0x12')](_0xd906('0xf'),auth[_0xd906('0xb')](),controller[_0xd906('0x13')]);router[_0xd906('0x14')](_0xd906('0xf'),auth[_0xd906('0xb')](),controller[_0xd906('0x15')]);module[_0xd906('0x16')]=router;
\ No newline at end of file
index 55afccb..05daf6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7d7=['STRING','DATE','moment','sequelize','exports'];(function(_0x3515ff,_0x25728d){var _0x3886ae=function(_0x156742){while(--_0x156742){_0x3515ff['push'](_0x3515ff['shift']());}};_0x3886ae(++_0x25728d);}(_0xc7d7,0x13d));var _0x7c7d=function(_0x1e2495,_0x4bb6f3){_0x1e2495=_0x1e2495-0x0;var _0x5b14a8=_0xc7d7[_0x1e2495];return _0x5b14a8;};'use strict';var moment=require(_0x7c7d('0x0'));var Sequelize=require(_0x7c7d('0x1'));module[_0x7c7d('0x2')]={'uniqueid':{'type':Sequelize[_0x7c7d('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7c7d('0x3')]},'joinAt':{'type':Sequelize[_0x7c7d('0x4')]},'leaveAt':{'type':Sequelize[_0x7c7d('0x4')]},'acceptAt':{'type':Sequelize[_0x7c7d('0x4')]},'exitAt':{'type':Sequelize[_0x7c7d('0x4')]},'reason':{'type':Sequelize[_0x7c7d('0x3')]}};
\ No newline at end of file
+var _0xa584=['exports','STRING','DATE','sequelize'];(function(_0x318840,_0x561b1e){var _0x223da4=function(_0x510071){while(--_0x510071){_0x318840['push'](_0x318840['shift']());}};_0x223da4(++_0x561b1e);}(_0xa584,0x163));var _0x4a58=function(_0x4fddc8,_0x4afb4d){_0x4fddc8=_0x4fddc8-0x0;var _0x3aa264=_0xa584[_0x4fddc8];return _0x3aa264;};'use strict';var moment=require('moment');var Sequelize=require(_0x4a58('0x0'));module[_0x4a58('0x1')]={'uniqueid':{'type':Sequelize[_0x4a58('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x4a58('0x2')]},'joinAt':{'type':Sequelize[_0x4a58('0x3')]},'leaveAt':{'type':Sequelize[_0x4a58('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x4a58('0x2')]}};
\ No newline at end of file
index d0beb96..85b10b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce20=['query','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','keys','options','create','body','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','key','model'];(function(_0xe1cd94,_0x19eb6b){var _0x35ffeb=function(_0x215232){while(--_0x215232){_0xe1cd94['push'](_0xe1cd94['shift']());}};_0x35ffeb(++_0x19eb6b);}(_0xce20,0x1e9));var _0x0ce2=function(_0x44739d,_0x2490b0){_0x44739d=_0x44739d-0x0;var _0x2cb4f2=_0xce20[_0x44739d];return _0x2cb4f2;};'use strict';var emlformat=require(_0x0ce2('0x0'));var rimraf=require(_0x0ce2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ce2('0x2'));var rp=require(_0x0ce2('0x3'));var moment=require(_0x0ce2('0x4'));var BPromise=require(_0x0ce2('0x5'));var Mustache=require(_0x0ce2('0x6'));var util=require(_0x0ce2('0x7'));var path=require(_0x0ce2('0x8'));var sox=require(_0x0ce2('0x9'));var csv=require('to-csv');var ejs=require(_0x0ce2('0xa'));var fs=require('fs');var fs_extra=require(_0x0ce2('0xb'));var _=require(_0x0ce2('0xc'));var squel=require('squel');var crypto=require(_0x0ce2('0xd'));var jsforce=require(_0x0ce2('0xe'));var deskjs=require(_0x0ce2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0ce2('0x10'));var Papa=require(_0x0ce2('0x11'));var Redis=require(_0x0ce2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0ce2('0x13'));var as=require(_0x0ce2('0x14'));var hardwareService=require(_0x0ce2('0x15'));var logger=require(_0x0ce2('0x16'))(_0x0ce2('0x17'));var utils=require(_0x0ce2('0x18'));var config=require(_0x0ce2('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0ce2('0x1a'))['db'];function respondWithStatusCode(_0x43e515,_0x242673){_0x242673=_0x242673||0xcc;return function(_0x52ab27){if(_0x52ab27){return _0x43e515['sendStatus'](_0x242673);}return _0x43e515[_0x0ce2('0x1b')](_0x242673)[_0x0ce2('0x1c')]();};}function respondWithResult(_0x3b837b,_0xc495dc){_0xc495dc=_0xc495dc||0xc8;return function(_0x241bbf){if(_0x241bbf){return _0x3b837b[_0x0ce2('0x1b')](_0xc495dc)[_0x0ce2('0x1d')](_0x241bbf);}};}function respondWithFilteredResult(_0x2ae9b8,_0x1b5ceb){return function(_0x2e60bb){if(_0x2e60bb){var _0x1c7460=typeof _0x1b5ceb[_0x0ce2('0x1e')]===_0x0ce2('0x1f')&&typeof _0x1b5ceb['limit']===_0x0ce2('0x1f');var _0x40201c=_0x2e60bb['count'];var _0x33ec73=_0x1c7460?0x0:_0x1b5ceb[_0x0ce2('0x1e')];var _0x44b87c=_0x1c7460?_0x2e60bb[_0x0ce2('0x20')]:_0x1b5ceb['offset']+_0x1b5ceb['limit'];var _0x12ce64;if(_0x44b87c>=_0x40201c){_0x44b87c=_0x40201c;_0x12ce64=0xc8;}else{_0x12ce64=0xce;}_0x2ae9b8[_0x0ce2('0x1b')](_0x12ce64);return _0x2ae9b8[_0x0ce2('0x21')](_0x0ce2('0x22'),_0x33ec73+'-'+_0x44b87c+'/'+_0x40201c)[_0x0ce2('0x1d')](_0x2e60bb);}return null;};}function patchUpdates(_0x4bbfdd){return function(_0x141f57){try{jsonpatch[_0x0ce2('0x23')](_0x141f57,_0x4bbfdd,!![]);}catch(_0x27a39c){return BPromise['reject'](_0x27a39c);}return _0x141f57[_0x0ce2('0x24')]();};}function saveUpdates(_0x3c5d4b,_0x3f0ee9){return function(_0x376caf){if(_0x376caf){return _0x376caf[_0x0ce2('0x25')](_0x3c5d4b)[_0x0ce2('0x26')](function(_0x12d3ba){return _0x12d3ba;});}return null;};}function removeEntity(_0x23b9ee,_0x378137){return function(_0x5541e3){if(_0x5541e3){return _0x5541e3[_0x0ce2('0x27')]()['then'](function(){_0x23b9ee[_0x0ce2('0x1b')](0xcc)[_0x0ce2('0x1c')]();});}};}function handleEntityNotFound(_0x440806,_0x5c0e53){return function(_0x299336){if(!_0x299336){_0x440806['sendStatus'](0x194);}return _0x299336;};}function handleError(_0xef1f3b,_0x4d93bf){_0x4d93bf=_0x4d93bf||0x1f4;return function(_0x12df84){logger['error'](_0x12df84[_0x0ce2('0x28')]);if(_0x12df84[_0x0ce2('0x29')]){delete _0x12df84[_0x0ce2('0x29')];}_0xef1f3b[_0x0ce2('0x1b')](_0x4d93bf)[_0x0ce2('0x2a')](_0x12df84);};}exports[_0x0ce2('0x2b')]=function(_0x3723b2,_0x1c2a0f){var _0x303d84={},_0x3bb05a={},_0x135c3c={'count':0x0,'rows':[]};var _0x3e2c0f=_[_0x0ce2('0x2c')](db[_0x0ce2('0x2d')][_0x0ce2('0x2e')],function(_0x368d0a){return{'name':_0x368d0a[_0x0ce2('0x2f')],'type':_0x368d0a['type'][_0x0ce2('0x30')]};});_0x3bb05a[_0x0ce2('0x31')]=_[_0x0ce2('0x2c')](_0x3e2c0f,_0x0ce2('0x29'));_0x3bb05a[_0x0ce2('0x32')]=_['keys'](_0x3723b2[_0x0ce2('0x32')]);_0x3bb05a['filters']=_['intersection'](_0x3bb05a['model'],_0x3bb05a[_0x0ce2('0x32')]);_0x303d84[_0x0ce2('0x33')]=_[_0x0ce2('0x34')](_0x3bb05a[_0x0ce2('0x31')],qs[_0x0ce2('0x35')](_0x3723b2[_0x0ce2('0x32')][_0x0ce2('0x35')]));_0x303d84[_0x0ce2('0x33')]=_0x303d84[_0x0ce2('0x33')][_0x0ce2('0x36')]?_0x303d84[_0x0ce2('0x33')]:_0x3bb05a['model'];if(!_0x3723b2[_0x0ce2('0x32')]['hasOwnProperty'](_0x0ce2('0x37'))){_0x303d84[_0x0ce2('0x38')]=qs[_0x0ce2('0x38')](_0x3723b2[_0x0ce2('0x32')][_0x0ce2('0x38')]);_0x303d84[_0x0ce2('0x1e')]=qs[_0x0ce2('0x1e')](_0x3723b2[_0x0ce2('0x32')][_0x0ce2('0x1e')]);}_0x303d84[_0x0ce2('0x39')]=qs['sort'](_0x3723b2[_0x0ce2('0x32')][_0x0ce2('0x3a')]);_0x303d84[_0x0ce2('0x3b')]=qs[_0x0ce2('0x3c')](_[_0x0ce2('0x3d')](_0x3723b2[_0x0ce2('0x32')],_0x3bb05a[_0x0ce2('0x3c')]),_0x3e2c0f);if(_0x3723b2[_0x0ce2('0x32')][_0x0ce2('0x3e')]){_0x303d84[_0x0ce2('0x3b')]=_[_0x0ce2('0x3f')](_0x303d84[_0x0ce2('0x3b')],{'$or':_['map'](_0x3e2c0f,function(_0x20793f){if(_0x20793f['type']!==_0x0ce2('0x40')){var _0x35480c={};_0x35480c[_0x20793f[_0x0ce2('0x29')]]={'$like':'%'+_0x3723b2[_0x0ce2('0x32')][_0x0ce2('0x3e')]+'%'};return _0x35480c;}})});}_0x303d84=_[_0x0ce2('0x3f')]({},_0x303d84,_0x3723b2['options']);var _0x47a10d={'where':_0x303d84[_0x0ce2('0x3b')]};return db[_0x0ce2('0x2d')][_0x0ce2('0x20')](_0x47a10d)['then'](function(_0x13bff5){_0x135c3c[_0x0ce2('0x20')]=_0x13bff5;if(_0x3723b2['query'][_0x0ce2('0x41')]){_0x303d84[_0x0ce2('0x42')]=[{'all':!![]}];}return db[_0x0ce2('0x2d')][_0x0ce2('0x43')](_0x303d84);})['then'](function(_0x363fcb){_0x135c3c['rows']=_0x363fcb;return _0x135c3c;})['then'](respondWithFilteredResult(_0x1c2a0f,_0x303d84))[_0x0ce2('0x44')](handleError(_0x1c2a0f,null));};exports[_0x0ce2('0x45')]=function(_0x4f63f1,_0x306e52){var _0x4291ce={'raw':!![],'where':{'id':_0x4f63f1['params']['id']}},_0xc71732={};_0xc71732[_0x0ce2('0x31')]=_['keys'](db[_0x0ce2('0x2d')][_0x0ce2('0x2e')]);_0xc71732[_0x0ce2('0x32')]=_[_0x0ce2('0x46')](_0x4f63f1['query']);_0xc71732[_0x0ce2('0x3c')]=_[_0x0ce2('0x34')](_0xc71732[_0x0ce2('0x31')],_0xc71732[_0x0ce2('0x32')]);_0x4291ce['attributes']=_[_0x0ce2('0x34')](_0xc71732['model'],qs[_0x0ce2('0x35')](_0x4f63f1[_0x0ce2('0x32')][_0x0ce2('0x35')]));_0x4291ce['attributes']=_0x4291ce[_0x0ce2('0x33')][_0x0ce2('0x36')]?_0x4291ce[_0x0ce2('0x33')]:_0xc71732['model'];if(_0x4f63f1['query'][_0x0ce2('0x41')]){_0x4291ce[_0x0ce2('0x42')]=[{'all':!![]}];}_0x4291ce=_[_0x0ce2('0x3f')]({},_0x4291ce,_0x4f63f1[_0x0ce2('0x47')]);return db[_0x0ce2('0x2d')]['find'](_0x4291ce)[_0x0ce2('0x26')](handleEntityNotFound(_0x306e52,null))['then'](respondWithResult(_0x306e52,null))[_0x0ce2('0x44')](handleError(_0x306e52,null));};exports[_0x0ce2('0x48')]=function(_0x29eaa5,_0x4dcbe3){return db[_0x0ce2('0x2d')][_0x0ce2('0x48')](_0x29eaa5['body'],{})['then'](respondWithResult(_0x4dcbe3,0xc9))[_0x0ce2('0x44')](handleError(_0x4dcbe3,null));};exports[_0x0ce2('0x25')]=function(_0x802762,_0x1418aa){if(_0x802762[_0x0ce2('0x49')]['id']){delete _0x802762['body']['id'];}return db[_0x0ce2('0x2d')][_0x0ce2('0x4a')]({'where':{'id':_0x802762[_0x0ce2('0x4b')]['id']}})[_0x0ce2('0x26')](handleEntityNotFound(_0x1418aa,null))[_0x0ce2('0x26')](saveUpdates(_0x802762[_0x0ce2('0x49')],null))[_0x0ce2('0x26')](respondWithResult(_0x1418aa,null))[_0x0ce2('0x44')](handleError(_0x1418aa,null));};exports[_0x0ce2('0x27')]=function(_0x5bf7a8,_0x323496){return db[_0x0ce2('0x2d')]['find']({'where':{'id':_0x5bf7a8[_0x0ce2('0x4b')]['id']}})[_0x0ce2('0x26')](handleEntityNotFound(_0x323496,null))[_0x0ce2('0x26')](removeEntity(_0x323496,null))[_0x0ce2('0x44')](handleError(_0x323496,null));};exports['describe']=function(_0x3be206,_0x37c0b2){return db[_0x0ce2('0x2d')][_0x0ce2('0x4c')]()[_0x0ce2('0x26')](respondWithResult(_0x37c0b2,null))['catch'](handleError(_0x37c0b2,null));};
\ No newline at end of file
+var _0x136d=['describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body'];(function(_0x348503,_0x1be852){var _0x21e535=function(_0x3e0c70){while(--_0x3e0c70){_0x348503['push'](_0x348503['shift']());}};_0x21e535(++_0x1be852);}(_0x136d,0xdc));var _0xd136=function(_0x405385,_0x56f573){_0x405385=_0x405385-0x0;var _0x43837b=_0x136d[_0x405385];return _0x43837b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd136('0x0'));var zipdir=require(_0xd136('0x1'));var jsonpatch=require(_0xd136('0x2'));var rp=require(_0xd136('0x3'));var moment=require('moment');var BPromise=require(_0xd136('0x4'));var Mustache=require(_0xd136('0x5'));var util=require(_0xd136('0x6'));var path=require(_0xd136('0x7'));var sox=require(_0xd136('0x8'));var csv=require(_0xd136('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd136('0xa'));var _=require(_0xd136('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd136('0xc'));var deskjs=require(_0xd136('0xd'));var toCsv=require(_0xd136('0x9'));var querystring=require(_0xd136('0xe'));var Papa=require('papaparse');var Redis=require(_0xd136('0xf'));var authService=require(_0xd136('0x10'));var qs=require(_0xd136('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd136('0x12'))(_0xd136('0x13'));var utils=require(_0xd136('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd136('0x15'));var db=require(_0xd136('0x16'))['db'];function respondWithStatusCode(_0x24dafd,_0x541d15){_0x541d15=_0x541d15||0xcc;return function(_0x5a1c6e){if(_0x5a1c6e){return _0x24dafd[_0xd136('0x17')](_0x541d15);}return _0x24dafd['status'](_0x541d15)[_0xd136('0x18')]();};}function respondWithResult(_0x527446,_0x597345){_0x597345=_0x597345||0xc8;return function(_0xfceaeb){if(_0xfceaeb){return _0x527446[_0xd136('0x19')](_0x597345)[_0xd136('0x1a')](_0xfceaeb);}};}function respondWithFilteredResult(_0x3c15fb,_0x2f8e5f){return function(_0x482115){if(_0x482115){var _0x113d94=typeof _0x2f8e5f[_0xd136('0x1b')]===_0xd136('0x1c')&&typeof _0x2f8e5f[_0xd136('0x1d')]===_0xd136('0x1c');var _0x40caf5=_0x482115[_0xd136('0x1e')];var _0x2f281b=_0x113d94?0x0:_0x2f8e5f[_0xd136('0x1b')];var _0x264de3=_0x113d94?_0x482115[_0xd136('0x1e')]:_0x2f8e5f[_0xd136('0x1b')]+_0x2f8e5f['limit'];var _0x29f43a;if(_0x264de3>=_0x40caf5){_0x264de3=_0x40caf5;_0x29f43a=0xc8;}else{_0x29f43a=0xce;}_0x3c15fb['status'](_0x29f43a);return _0x3c15fb[_0xd136('0x1f')]('Content-Range',_0x2f281b+'-'+_0x264de3+'/'+_0x40caf5)[_0xd136('0x1a')](_0x482115);}return null;};}function patchUpdates(_0x1cdb5c){return function(_0x559206){try{jsonpatch[_0xd136('0x20')](_0x559206,_0x1cdb5c,!![]);}catch(_0xe37509){return BPromise[_0xd136('0x21')](_0xe37509);}return _0x559206['save']();};}function saveUpdates(_0x585572,_0x229c0f){return function(_0x429025){if(_0x429025){return _0x429025[_0xd136('0x22')](_0x585572)[_0xd136('0x23')](function(_0x5a0bfb){return _0x5a0bfb;});}return null;};}function removeEntity(_0x5dd149,_0x32198b){return function(_0x2dd389){if(_0x2dd389){return _0x2dd389[_0xd136('0x24')]()['then'](function(){_0x5dd149['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f6095,_0x2e554b){return function(_0x3a2b97){if(!_0x3a2b97){_0x1f6095['sendStatus'](0x194);}return _0x3a2b97;};}function handleError(_0x5a838b,_0x566b74){_0x566b74=_0x566b74||0x1f4;return function(_0x2810c1){logger[_0xd136('0x25')](_0x2810c1[_0xd136('0x26')]);if(_0x2810c1['name']){delete _0x2810c1[_0xd136('0x27')];}_0x5a838b[_0xd136('0x19')](_0x566b74)[_0xd136('0x28')](_0x2810c1);};}exports[_0xd136('0x29')]=function(_0x102dfb,_0x42633c){var _0x3d4486={},_0x2c5ca5={},_0x24bbd2={'count':0x0,'rows':[]};var _0xe222dd=_[_0xd136('0x2a')](db[_0xd136('0x2b')][_0xd136('0x2c')],function(_0x209e7c){return{'name':_0x209e7c[_0xd136('0x2d')],'type':_0x209e7c[_0xd136('0x2e')]['key']};});_0x2c5ca5[_0xd136('0x2f')]=_[_0xd136('0x2a')](_0xe222dd,_0xd136('0x27'));_0x2c5ca5['query']=_[_0xd136('0x30')](_0x102dfb[_0xd136('0x31')]);_0x2c5ca5[_0xd136('0x32')]=_[_0xd136('0x33')](_0x2c5ca5[_0xd136('0x2f')],_0x2c5ca5[_0xd136('0x31')]);_0x3d4486[_0xd136('0x34')]=_[_0xd136('0x33')](_0x2c5ca5[_0xd136('0x2f')],qs['fields'](_0x102dfb['query'][_0xd136('0x35')]));_0x3d4486[_0xd136('0x34')]=_0x3d4486[_0xd136('0x34')][_0xd136('0x36')]?_0x3d4486[_0xd136('0x34')]:_0x2c5ca5['model'];if(!_0x102dfb['query']['hasOwnProperty']('nolimit')){_0x3d4486['limit']=qs[_0xd136('0x1d')](_0x102dfb[_0xd136('0x31')][_0xd136('0x1d')]);_0x3d4486[_0xd136('0x1b')]=qs['offset'](_0x102dfb[_0xd136('0x31')][_0xd136('0x1b')]);}_0x3d4486[_0xd136('0x37')]=qs[_0xd136('0x38')](_0x102dfb[_0xd136('0x31')][_0xd136('0x38')]);_0x3d4486[_0xd136('0x39')]=qs[_0xd136('0x32')](_[_0xd136('0x3a')](_0x102dfb[_0xd136('0x31')],_0x2c5ca5[_0xd136('0x32')]),_0xe222dd);if(_0x102dfb[_0xd136('0x31')][_0xd136('0x3b')]){_0x3d4486[_0xd136('0x39')]=_[_0xd136('0x3c')](_0x3d4486[_0xd136('0x39')],{'$or':_[_0xd136('0x2a')](_0xe222dd,function(_0x69c698){if(_0x69c698[_0xd136('0x2e')]!=='VIRTUAL'){var _0x8f77ad={};_0x8f77ad[_0x69c698[_0xd136('0x27')]]={'$like':'%'+_0x102dfb[_0xd136('0x31')]['filter']+'%'};return _0x8f77ad;}})});}_0x3d4486=_[_0xd136('0x3c')]({},_0x3d4486,_0x102dfb[_0xd136('0x3d')]);var _0x14bbda={'where':_0x3d4486[_0xd136('0x39')]};return db[_0xd136('0x2b')][_0xd136('0x1e')](_0x14bbda)[_0xd136('0x23')](function(_0x5e9cc8){_0x24bbd2[_0xd136('0x1e')]=_0x5e9cc8;if(_0x102dfb[_0xd136('0x31')][_0xd136('0x3e')]){_0x3d4486[_0xd136('0x3f')]=[{'all':!![]}];}return db[_0xd136('0x2b')][_0xd136('0x40')](_0x3d4486);})['then'](function(_0x1a1523){_0x24bbd2[_0xd136('0x41')]=_0x1a1523;return _0x24bbd2;})['then'](respondWithFilteredResult(_0x42633c,_0x3d4486))[_0xd136('0x42')](handleError(_0x42633c,null));};exports[_0xd136('0x43')]=function(_0x475890,_0x315daf){var _0x58541e={'raw':!![],'where':{'id':_0x475890[_0xd136('0x44')]['id']}},_0x330d21={};_0x330d21[_0xd136('0x2f')]=_[_0xd136('0x30')](db['OpenchannelQueueReport'][_0xd136('0x2c')]);_0x330d21[_0xd136('0x31')]=_[_0xd136('0x30')](_0x475890[_0xd136('0x31')]);_0x330d21['filters']=_[_0xd136('0x33')](_0x330d21[_0xd136('0x2f')],_0x330d21[_0xd136('0x31')]);_0x58541e[_0xd136('0x34')]=_['intersection'](_0x330d21['model'],qs[_0xd136('0x35')](_0x475890[_0xd136('0x31')][_0xd136('0x35')]));_0x58541e[_0xd136('0x34')]=_0x58541e[_0xd136('0x34')][_0xd136('0x36')]?_0x58541e['attributes']:_0x330d21[_0xd136('0x2f')];if(_0x475890['query'][_0xd136('0x3e')]){_0x58541e[_0xd136('0x3f')]=[{'all':!![]}];}_0x58541e=_[_0xd136('0x3c')]({},_0x58541e,_0x475890[_0xd136('0x3d')]);return db[_0xd136('0x2b')][_0xd136('0x45')](_0x58541e)[_0xd136('0x23')](handleEntityNotFound(_0x315daf,null))[_0xd136('0x23')](respondWithResult(_0x315daf,null))['catch'](handleError(_0x315daf,null));};exports[_0xd136('0x46')]=function(_0x5e409d,_0x511bc1){return db['OpenchannelQueueReport'][_0xd136('0x46')](_0x5e409d[_0xd136('0x47')],{})['then'](respondWithResult(_0x511bc1,0xc9))[_0xd136('0x42')](handleError(_0x511bc1,null));};exports[_0xd136('0x22')]=function(_0x4f601a,_0x22b585){if(_0x4f601a[_0xd136('0x47')]['id']){delete _0x4f601a[_0xd136('0x47')]['id'];}return db['OpenchannelQueueReport'][_0xd136('0x45')]({'where':{'id':_0x4f601a[_0xd136('0x44')]['id']}})['then'](handleEntityNotFound(_0x22b585,null))['then'](saveUpdates(_0x4f601a[_0xd136('0x47')],null))[_0xd136('0x23')](respondWithResult(_0x22b585,null))['catch'](handleError(_0x22b585,null));};exports[_0xd136('0x24')]=function(_0xc92e3,_0x5bea95){return db[_0xd136('0x2b')][_0xd136('0x45')]({'where':{'id':_0xc92e3['params']['id']}})[_0xd136('0x23')](handleEntityNotFound(_0x5bea95,null))['then'](removeEntity(_0x5bea95,null))['catch'](handleError(_0x5bea95,null));};exports[_0xd136('0x48')]=function(_0xaff4ae,_0x31c063){return db['OpenchannelQueueReport'][_0xd136('0x48')]()[_0xd136('0x23')](respondWithResult(_0x31c063,null))[_0xd136('0x42')](handleError(_0x31c063,null));};
\ No newline at end of file
index 7ec3878..f9615e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x814b,0x1a2));var _0xb814=function(_0x28d225,_0x43be18){_0x28d225=_0x28d225-0x0;var _0x1f79e1=_0x814b[_0x28d225];return _0x1f79e1;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x575acc,_0x16db96){var _0x42425e=function(_0x4f9902){while(--_0x4f9902){_0x575acc['push'](_0x575acc['shift']());}};_0x42425e(++_0x16db96);}(_0x1261,0x144));var _0x1126=function(_0x28e0f1,_0xd1bfa0){_0x28e0f1=_0x28e0f1-0x0;var _0x13aedc=_0x1261[_0x28e0f1];return _0x13aedc;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 2583804..bf6db89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd914=['OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','body','options','raw','then','UpdateOpenchannelQueueReport','update','attributes','limit','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info'];(function(_0x4b2f3f,_0x2de26f){var _0x537256=function(_0x19eade){while(--_0x19eade){_0x4b2f3f['push'](_0x4b2f3f['shift']());}};_0x537256(++_0x2de26f);}(_0xd914,0x17f));var _0x4d91=function(_0x569fef,_0x49c37a){_0x569fef=_0x569fef-0x0;var _0x11f20b=_0xd914[_0x569fef];return _0x11f20b;};'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 Redis=require(_0x4d91('0x4'));var db=require(_0x4d91('0x5'))['db'];var utils=require(_0x4d91('0x6'));var logger=require(_0x4d91('0x7'))('rpc');var config=require(_0x4d91('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4d91('0x9')][_0x4d91('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x175ce3,_0x27c0d5,_0x22f2a4){return new BPromise(function(_0x150767,_0x3016c0){return client[_0x4d91('0xb')](_0x175ce3,_0x22f2a4)['then'](function(_0x37bde4){logger[_0x4d91('0xc')](_0x4d91('0xd'),_0x27c0d5,_0x4d91('0xe'));logger[_0x4d91('0xf')](_0x4d91('0x10'),_0x27c0d5,'request\x20sent',JSON['stringify'](_0x37bde4));if(_0x37bde4[_0x4d91('0x11')]){if(_0x37bde4[_0x4d91('0x11')][_0x4d91('0x12')]===0x1f4){logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x37bde4[_0x4d91('0x11')]['message']);return _0x3016c0(_0x37bde4['error'][_0x4d91('0x13')]);}logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x37bde4[_0x4d91('0x11')][_0x4d91('0x13')]);return _0x150767(_0x37bde4[_0x4d91('0x11')][_0x4d91('0x13')]);}else{logger['info'](_0x4d91('0xd'),_0x27c0d5,_0x4d91('0xe'));_0x150767(_0x37bde4[_0x4d91('0x14')][_0x4d91('0x13')]);}})[_0x4d91('0x15')](function(_0x554ca8){logger[_0x4d91('0x11')](_0x4d91('0xd'),_0x27c0d5,_0x554ca8);_0x3016c0(_0x554ca8);});});}exports[_0x4d91('0x16')]=function(_0x44b9a7){var _0x4cfa40=this;return new Promise(function(_0x350e23,_0x3b579b){return db[_0x4d91('0x17')]['create'](_0x44b9a7[_0x4d91('0x18')],{'raw':_0x44b9a7[_0x4d91('0x19')]?_0x44b9a7[_0x4d91('0x19')][_0x4d91('0x1a')]===undefined?!![]:![]:!![]})[_0x4d91('0x1b')](function(_0x40cde4){logger[_0x4d91('0xc')](_0x4d91('0x16'),_0x44b9a7);logger[_0x4d91('0xf')](_0x4d91('0x16'),_0x44b9a7,JSON['stringify'](_0x40cde4));_0x350e23(_0x40cde4);})[_0x4d91('0x15')](function(_0x5f5236){logger['error'](_0x4d91('0x16'),_0x5f5236[_0x4d91('0x13')],_0x44b9a7);_0x3b579b(_0x4cfa40[_0x4d91('0x11')](0x1f4,_0x5f5236[_0x4d91('0x13')]));});});};exports[_0x4d91('0x1c')]=function(_0x12b722){var _0x100cd4=this;return new Promise(function(_0x123606,_0x55356b){return db['OpenchannelQueueReport'][_0x4d91('0x1d')](_0x12b722[_0x4d91('0x18')],{'raw':_0x12b722[_0x4d91('0x19')]?_0x12b722[_0x4d91('0x19')][_0x4d91('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12b722[_0x4d91('0x19')]?_0x12b722[_0x4d91('0x19')]['where']||null:null,'attributes':_0x12b722[_0x4d91('0x19')]?_0x12b722[_0x4d91('0x19')][_0x4d91('0x1e')]||null:null,'limit':_0x12b722['options']?_0x12b722['options'][_0x4d91('0x1f')]||null:null})[_0x4d91('0x1b')](function(_0x5ed948){logger['info'](_0x4d91('0x1c'),_0x12b722);logger[_0x4d91('0xf')](_0x4d91('0x1c'),_0x12b722,JSON[_0x4d91('0x20')](_0x5ed948));_0x123606(_0x5ed948);})['catch'](function(_0x2587a1){logger[_0x4d91('0x11')](_0x4d91('0x1c'),_0x2587a1[_0x4d91('0x13')],_0x12b722);_0x55356b(_0x100cd4[_0x4d91('0x11')](0x1f4,_0x2587a1[_0x4d91('0x13')]));});});};
\ No newline at end of file
+var _0xfcbb=['body','raw','where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','UpdateOpenchannelQueueReport','update'];(function(_0x1f8a24,_0x367969){var _0x1ba238=function(_0x197c2d){while(--_0x197c2d){_0x1f8a24['push'](_0x1f8a24['shift']());}};_0x1ba238(++_0x367969);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x29beb4,_0x5e46b0){_0x29beb4=_0x29beb4-0x0;var _0x2ab9ec=_0xfcbb[_0x29beb4];return _0x2ab9ec;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbfcb('0x3'));var db=require(_0xbfcb('0x4'))['db'];var utils=require(_0xbfcb('0x5'));var logger=require(_0xbfcb('0x6'))(_0xbfcb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbfcb('0x8')][_0xbfcb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8d4e6a,_0x2df839,_0x288ee5){return new BPromise(function(_0x2f875c,_0x49717b){return client['request'](_0x8d4e6a,_0x288ee5)[_0xbfcb('0xa')](function(_0x331173){logger[_0xbfcb('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x2df839,_0xbfcb('0xc'));logger[_0xbfcb('0xd')](_0xbfcb('0xe'),_0x2df839,_0xbfcb('0xc'),JSON[_0xbfcb('0xf')](_0x331173));if(_0x331173[_0xbfcb('0x10')]){if(_0x331173['error'][_0xbfcb('0x11')]===0x1f4){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')]['message']);return _0x49717b(_0x331173[_0xbfcb('0x10')]['message']);}logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);return _0x2f875c(_0x331173[_0xbfcb('0x10')][_0xbfcb('0x13')]);}else{logger[_0xbfcb('0xb')](_0xbfcb('0x12'),_0x2df839,_0xbfcb('0xc'));_0x2f875c(_0x331173[_0xbfcb('0x14')][_0xbfcb('0x13')]);}})[_0xbfcb('0x15')](function(_0x26f335){logger[_0xbfcb('0x10')](_0xbfcb('0x12'),_0x2df839,_0x26f335);_0x49717b(_0x26f335);});});}exports[_0xbfcb('0x16')]=function(_0xba1d6){var _0x38689e=this;return new Promise(function(_0x3404aa,_0x46b8d2){return db[_0xbfcb('0x17')][_0xbfcb('0x18')](_0xba1d6['body'],{'raw':_0xba1d6[_0xbfcb('0x19')]?_0xba1d6[_0xbfcb('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xbfcb('0xa')](function(_0x1a7225){logger['info']('CreateOpenchannelQueueReport',_0xba1d6);logger[_0xbfcb('0xd')](_0xbfcb('0x16'),_0xba1d6,JSON[_0xbfcb('0xf')](_0x1a7225));_0x3404aa(_0x1a7225);})[_0xbfcb('0x15')](function(_0x1c5924){logger['error'](_0xbfcb('0x16'),_0x1c5924[_0xbfcb('0x13')],_0xba1d6);_0x46b8d2(_0x38689e[_0xbfcb('0x10')](0x1f4,_0x1c5924[_0xbfcb('0x13')]));});});};exports[_0xbfcb('0x1a')]=function(_0x19616c){var _0x69c8e9=this;return new Promise(function(_0x14e43c,_0x11f6f7){return db[_0xbfcb('0x17')][_0xbfcb('0x1b')](_0x19616c[_0xbfcb('0x1c')],{'raw':_0x19616c[_0xbfcb('0x19')]?_0x19616c[_0xbfcb('0x19')][_0xbfcb('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19616c[_0xbfcb('0x19')]?_0x19616c['options'][_0xbfcb('0x1e')]||null:null,'attributes':_0x19616c[_0xbfcb('0x19')]?_0x19616c['options'][_0xbfcb('0x1f')]||null:null,'limit':_0x19616c[_0xbfcb('0x19')]?_0x19616c[_0xbfcb('0x19')][_0xbfcb('0x20')]||null:null})[_0xbfcb('0xa')](function(_0x3542e9){logger[_0xbfcb('0xb')](_0xbfcb('0x1a'),_0x19616c);logger[_0xbfcb('0xd')](_0xbfcb('0x1a'),_0x19616c,JSON['stringify'](_0x3542e9));_0x14e43c(_0x3542e9);})[_0xbfcb('0x15')](function(_0x3aa3cd){logger[_0xbfcb('0x10')](_0xbfcb('0x1a'),_0x3aa3cd[_0xbfcb('0x13')],_0x19616c);_0x11f6f7(_0x69c8e9[_0xbfcb('0x10')](0x1f4,_0x3aa3cd[_0xbfcb('0x13')]));});});};
\ No newline at end of file
index 246a60e..66e8e08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9acb=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9acb,0x103));var _0xb9ac=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x9acb[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0xb9ac('0x0'));var util=require(_0xb9ac('0x1'));var path=require(_0xb9ac('0x2'));var timeout=require('connect-timeout');var express=require(_0xb9ac('0x3'));var router=express[_0xb9ac('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb9ac('0x5'));var interaction=require(_0xb9ac('0x6'));var config=require(_0xb9ac('0x7'));var controller=require(_0xb9ac('0x8'));router[_0xb9ac('0x9')]('/',auth[_0xb9ac('0xa')](),controller[_0xb9ac('0xb')]);router[_0xb9ac('0x9')](_0xb9ac('0xc'),auth[_0xb9ac('0xa')](),controller[_0xb9ac('0xd')]);router[_0xb9ac('0x9')](_0xb9ac('0xe'),auth[_0xb9ac('0xa')](),controller[_0xb9ac('0xf')]);router[_0xb9ac('0x10')]('/',auth[_0xb9ac('0xa')](),controller[_0xb9ac('0x11')]);router[_0xb9ac('0x12')](_0xb9ac('0xe'),auth[_0xb9ac('0xa')](),controller[_0xb9ac('0x13')]);router[_0xb9ac('0x14')]('/:id',auth[_0xb9ac('0xa')](),controller[_0xb9ac('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x122e=['describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','/describe','isAuthenticated'];(function(_0x41d432,_0x20e878){var _0x1650f9=function(_0x27f177){while(--_0x27f177){_0x41d432['push'](_0x41d432['shift']());}};_0x1650f9(++_0x20e878);}(_0x122e,0x69));var _0xe122=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x122e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xe122('0x0'));var util=require(_0xe122('0x1'));var path=require(_0xe122('0x2'));var timeout=require(_0xe122('0x3'));var express=require(_0xe122('0x4'));var router=express[_0xe122('0x5')]();var fs_extra=require(_0xe122('0x6'));var auth=require(_0xe122('0x7'));var interaction=require(_0xe122('0x8'));var config=require(_0xe122('0x9'));var controller=require(_0xe122('0xa'));router[_0xe122('0xb')]('/',auth['isAuthenticated'](),controller[_0xe122('0xc')]);router[_0xe122('0xb')](_0xe122('0xd'),auth[_0xe122('0xe')](),controller[_0xe122('0xf')]);router[_0xe122('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xe122('0x10')]);router['post']('/',auth[_0xe122('0xe')](),controller[_0xe122('0x11')]);router[_0xe122('0x12')](_0xe122('0x13'),auth['isAuthenticated'](),controller[_0xe122('0x14')]);router[_0xe122('0x15')](_0xe122('0x13'),auth[_0xe122('0xe')](),controller[_0xe122('0x16')]);module[_0xe122('0x17')]=router;
\ No newline at end of file
index 674be7a..5b5ed1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x17108d,_0x158432){var _0x6610a1=function(_0x1129d5){while(--_0x1129d5){_0x17108d['push'](_0x17108d['shift']());}};_0x6610a1(++_0x158432);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1ae31c,_0x8dcd2d){_0x1ae31c=_0x1ae31c-0x0;var _0x19519d=_0xcb91[_0x1ae31c];return _0x19519d;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x4883c2,_0x297aeb){var _0x11230b=function(_0x1414de){while(--_0x1414de){_0x4883c2['push'](_0x4883c2['shift']());}};_0x11230b(++_0x297aeb);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1f7996,_0x299a14){_0x1f7996=_0x1f7996-0x0;var _0x584609=_0xcb91[_0x1f7996];return _0x584609;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
index c222437..6714375 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54db=['options','includeAll','include','findAll','find','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','reject','update','then','destroy','error','stack','name','send','map','OpenchannelTransferReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL'];(function(_0x47796e,_0x3a266e){var _0x54ed0f=function(_0x27c88b){while(--_0x27c88b){_0x47796e['push'](_0x47796e['shift']());}};_0x54ed0f(++_0x3a266e);}(_0x54db,0xa3));var _0xb54d=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x54db[_0x54d4fe];return _0x1ab5bb;};'use strict';var emlformat=require(_0xb54d('0x0'));var rimraf=require(_0xb54d('0x1'));var zipdir=require(_0xb54d('0x2'));var jsonpatch=require(_0xb54d('0x3'));var rp=require(_0xb54d('0x4'));var moment=require(_0xb54d('0x5'));var BPromise=require(_0xb54d('0x6'));var Mustache=require(_0xb54d('0x7'));var util=require(_0xb54d('0x8'));var path=require('path');var sox=require(_0xb54d('0x9'));var csv=require('to-csv');var ejs=require(_0xb54d('0xa'));var fs=require('fs');var fs_extra=require(_0xb54d('0xb'));var _=require(_0xb54d('0xc'));var squel=require(_0xb54d('0xd'));var crypto=require(_0xb54d('0xe'));var jsforce=require(_0xb54d('0xf'));var deskjs=require(_0xb54d('0x10'));var toCsv=require(_0xb54d('0x11'));var querystring=require('querystring');var Papa=require(_0xb54d('0x12'));var Redis=require(_0xb54d('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb54d('0x14'));var as=require(_0xb54d('0x15'));var hardwareService=require(_0xb54d('0x16'));var logger=require(_0xb54d('0x17'))(_0xb54d('0x18'));var utils=require(_0xb54d('0x19'));var config=require(_0xb54d('0x1a'));var licenseUtil=require(_0xb54d('0x1b'));var db=require(_0xb54d('0x1c'))['db'];function respondWithStatusCode(_0x4aa782,_0x273b31){_0x273b31=_0x273b31||0xcc;return function(_0x2785f2){if(_0x2785f2){return _0x4aa782[_0xb54d('0x1d')](_0x273b31);}return _0x4aa782[_0xb54d('0x1e')](_0x273b31)[_0xb54d('0x1f')]();};}function respondWithResult(_0x290d6b,_0x4e4818){_0x4e4818=_0x4e4818||0xc8;return function(_0x1396f1){if(_0x1396f1){return _0x290d6b['status'](_0x4e4818)['json'](_0x1396f1);}};}function respondWithFilteredResult(_0xec1c6f,_0x1f22b9){return function(_0x50c5db){if(_0x50c5db){var _0x11cf54=typeof _0x1f22b9[_0xb54d('0x20')]===_0xb54d('0x21')&&typeof _0x1f22b9['limit']===_0xb54d('0x21');var _0x5046d7=_0x50c5db[_0xb54d('0x22')];var _0x505a73=_0x11cf54?0x0:_0x1f22b9[_0xb54d('0x20')];var _0x29d3b9=_0x11cf54?_0x50c5db['count']:_0x1f22b9['offset']+_0x1f22b9[_0xb54d('0x23')];var _0x2d10f8;if(_0x29d3b9>=_0x5046d7){_0x29d3b9=_0x5046d7;_0x2d10f8=0xc8;}else{_0x2d10f8=0xce;}_0xec1c6f[_0xb54d('0x1e')](_0x2d10f8);return _0xec1c6f[_0xb54d('0x24')]('Content-Range',_0x505a73+'-'+_0x29d3b9+'/'+_0x5046d7)[_0xb54d('0x25')](_0x50c5db);}return null;};}function patchUpdates(_0x2a781f){return function(_0x16f7c7){try{jsonpatch['apply'](_0x16f7c7,_0x2a781f,!![]);}catch(_0x548448){return BPromise[_0xb54d('0x26')](_0x548448);}return _0x16f7c7['save']();};}function saveUpdates(_0x1376e9,_0x4a4867){return function(_0x1ecfd2){if(_0x1ecfd2){return _0x1ecfd2[_0xb54d('0x27')](_0x1376e9)[_0xb54d('0x28')](function(_0x1b1c05){return _0x1b1c05;});}return null;};}function removeEntity(_0x33a5f1,_0x3d28f5){return function(_0x141bca){if(_0x141bca){return _0x141bca[_0xb54d('0x29')]()[_0xb54d('0x28')](function(){_0x33a5f1[_0xb54d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c92a7,_0x7bff3d){return function(_0x21433b){if(!_0x21433b){_0x2c92a7[_0xb54d('0x1d')](0x194);}return _0x21433b;};}function handleError(_0x5288df,_0x49fd3b){_0x49fd3b=_0x49fd3b||0x1f4;return function(_0x1f9a1c){logger[_0xb54d('0x2a')](_0x1f9a1c[_0xb54d('0x2b')]);if(_0x1f9a1c[_0xb54d('0x2c')]){delete _0x1f9a1c[_0xb54d('0x2c')];}_0x5288df['status'](_0x49fd3b)[_0xb54d('0x2d')](_0x1f9a1c);};}exports['index']=function(_0x2cb41b,_0x20549d){var _0x2f366c={},_0x34f351={},_0x2600ed={'count':0x0,'rows':[]};var _0x369f86=_[_0xb54d('0x2e')](db[_0xb54d('0x2f')][_0xb54d('0x30')],function(_0x2ea353){return{'name':_0x2ea353['fieldName'],'type':_0x2ea353['type'][_0xb54d('0x31')]};});_0x34f351[_0xb54d('0x32')]=_['map'](_0x369f86,_0xb54d('0x2c'));_0x34f351[_0xb54d('0x33')]=_[_0xb54d('0x34')](_0x2cb41b[_0xb54d('0x33')]);_0x34f351[_0xb54d('0x35')]=_[_0xb54d('0x36')](_0x34f351[_0xb54d('0x32')],_0x34f351[_0xb54d('0x33')]);_0x2f366c[_0xb54d('0x37')]=_[_0xb54d('0x36')](_0x34f351[_0xb54d('0x32')],qs[_0xb54d('0x38')](_0x2cb41b[_0xb54d('0x33')][_0xb54d('0x38')]));_0x2f366c[_0xb54d('0x37')]=_0x2f366c[_0xb54d('0x37')][_0xb54d('0x39')]?_0x2f366c[_0xb54d('0x37')]:_0x34f351[_0xb54d('0x32')];if(!_0x2cb41b[_0xb54d('0x33')][_0xb54d('0x3a')](_0xb54d('0x3b'))){_0x2f366c[_0xb54d('0x23')]=qs[_0xb54d('0x23')](_0x2cb41b[_0xb54d('0x33')][_0xb54d('0x23')]);_0x2f366c[_0xb54d('0x20')]=qs[_0xb54d('0x20')](_0x2cb41b['query']['offset']);}_0x2f366c[_0xb54d('0x3c')]=qs[_0xb54d('0x3d')](_0x2cb41b[_0xb54d('0x33')][_0xb54d('0x3d')]);_0x2f366c[_0xb54d('0x3e')]=qs['filters'](_[_0xb54d('0x3f')](_0x2cb41b['query'],_0x34f351[_0xb54d('0x35')]),_0x369f86);if(_0x2cb41b[_0xb54d('0x33')][_0xb54d('0x40')]){_0x2f366c[_0xb54d('0x3e')]=_[_0xb54d('0x41')](_0x2f366c[_0xb54d('0x3e')],{'$or':_[_0xb54d('0x2e')](_0x369f86,function(_0x11e1d4){if(_0x11e1d4[_0xb54d('0x42')]!==_0xb54d('0x43')){var _0x34bfb8={};_0x34bfb8[_0x11e1d4['name']]={'$like':'%'+_0x2cb41b[_0xb54d('0x33')][_0xb54d('0x40')]+'%'};return _0x34bfb8;}})});}_0x2f366c=_[_0xb54d('0x41')]({},_0x2f366c,_0x2cb41b[_0xb54d('0x44')]);var _0x4492a5={'where':_0x2f366c[_0xb54d('0x3e')]};return db['OpenchannelTransferReport'][_0xb54d('0x22')](_0x4492a5)[_0xb54d('0x28')](function(_0x18adce){_0x2600ed[_0xb54d('0x22')]=_0x18adce;if(_0x2cb41b[_0xb54d('0x33')][_0xb54d('0x45')]){_0x2f366c[_0xb54d('0x46')]=[{'all':!![]}];}return db[_0xb54d('0x2f')][_0xb54d('0x47')](_0x2f366c);})['then'](function(_0x474e95){_0x2600ed['rows']=_0x474e95;return _0x2600ed;})[_0xb54d('0x28')](respondWithFilteredResult(_0x20549d,_0x2f366c))['catch'](handleError(_0x20549d,null));};exports['show']=function(_0x2df073,_0x9a2277){var _0x10d942={'raw':!![],'where':{'id':_0x2df073['params']['id']}},_0x499826={};_0x499826[_0xb54d('0x32')]=_[_0xb54d('0x34')](db[_0xb54d('0x2f')][_0xb54d('0x30')]);_0x499826['query']=_[_0xb54d('0x34')](_0x2df073[_0xb54d('0x33')]);_0x499826[_0xb54d('0x35')]=_['intersection'](_0x499826[_0xb54d('0x32')],_0x499826['query']);_0x10d942[_0xb54d('0x37')]=_[_0xb54d('0x36')](_0x499826[_0xb54d('0x32')],qs[_0xb54d('0x38')](_0x2df073[_0xb54d('0x33')]['fields']));_0x10d942[_0xb54d('0x37')]=_0x10d942[_0xb54d('0x37')][_0xb54d('0x39')]?_0x10d942[_0xb54d('0x37')]:_0x499826[_0xb54d('0x32')];if(_0x2df073[_0xb54d('0x33')][_0xb54d('0x45')]){_0x10d942[_0xb54d('0x46')]=[{'all':!![]}];}_0x10d942=_[_0xb54d('0x41')]({},_0x10d942,_0x2df073[_0xb54d('0x44')]);return db[_0xb54d('0x2f')][_0xb54d('0x48')](_0x10d942)[_0xb54d('0x28')](handleEntityNotFound(_0x9a2277,null))[_0xb54d('0x28')](respondWithResult(_0x9a2277,null))[_0xb54d('0x49')](handleError(_0x9a2277,null));};exports['create']=function(_0x495359,_0x47dbd3){return db['OpenchannelTransferReport']['create'](_0x495359[_0xb54d('0x4a')],{})[_0xb54d('0x28')](respondWithResult(_0x47dbd3,0xc9))['catch'](handleError(_0x47dbd3,null));};exports['update']=function(_0x366369,_0x5a7235){if(_0x366369[_0xb54d('0x4a')]['id']){delete _0x366369[_0xb54d('0x4a')]['id'];}return db[_0xb54d('0x2f')][_0xb54d('0x48')]({'where':{'id':_0x366369[_0xb54d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a7235,null))[_0xb54d('0x28')](saveUpdates(_0x366369[_0xb54d('0x4a')],null))['then'](respondWithResult(_0x5a7235,null))[_0xb54d('0x49')](handleError(_0x5a7235,null));};exports[_0xb54d('0x29')]=function(_0x3c5a5c,_0x4a233e){return db[_0xb54d('0x2f')][_0xb54d('0x48')]({'where':{'id':_0x3c5a5c[_0xb54d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4a233e,null))['then'](removeEntity(_0x4a233e,null))['catch'](handleError(_0x4a233e,null));};exports[_0xb54d('0x4c')]=function(_0x1bf5c3,_0x594c9c){return db[_0xb54d('0x2f')]['describe']()['then'](respondWithResult(_0x594c9c,null))[_0xb54d('0x49')](handleError(_0x594c9c,null));};
\ No newline at end of file
+var _0xcb45=['json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','order','sort','filters','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x582667,_0x3a10b9){var _0x116726=function(_0xeacf0e){while(--_0xeacf0e){_0x582667['push'](_0x582667['shift']());}};_0x116726(++_0x3a10b9);}(_0xcb45,0x116));var _0x5cb4=function(_0x10de69,_0x52a525){_0x10de69=_0x10de69-0x0;var _0x28cbf4=_0xcb45[_0x10de69];return _0x28cbf4;};'use strict';var emlformat=require(_0x5cb4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5cb4('0x1'));var jsonpatch=require(_0x5cb4('0x2'));var rp=require(_0x5cb4('0x3'));var moment=require(_0x5cb4('0x4'));var BPromise=require(_0x5cb4('0x5'));var Mustache=require(_0x5cb4('0x6'));var util=require('util');var path=require(_0x5cb4('0x7'));var sox=require(_0x5cb4('0x8'));var csv=require('to-csv');var ejs=require(_0x5cb4('0x9'));var fs=require('fs');var fs_extra=require(_0x5cb4('0xa'));var _=require(_0x5cb4('0xb'));var squel=require('squel');var crypto=require(_0x5cb4('0xc'));var jsforce=require(_0x5cb4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5cb4('0xe'));var querystring=require(_0x5cb4('0xf'));var Papa=require('papaparse');var Redis=require(_0x5cb4('0x10'));var authService=require(_0x5cb4('0x11'));var qs=require(_0x5cb4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5cb4('0x13'));var logger=require(_0x5cb4('0x14'))('api');var utils=require(_0x5cb4('0x15'));var config=require(_0x5cb4('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5cb4('0x17'))['db'];function respondWithStatusCode(_0x229833,_0x24c17c){_0x24c17c=_0x24c17c||0xcc;return function(_0x50bb3d){if(_0x50bb3d){return _0x229833[_0x5cb4('0x18')](_0x24c17c);}return _0x229833[_0x5cb4('0x19')](_0x24c17c)['end']();};}function respondWithResult(_0x21e146,_0xffe7f4){_0xffe7f4=_0xffe7f4||0xc8;return function(_0x8d78b8){if(_0x8d78b8){return _0x21e146[_0x5cb4('0x19')](_0xffe7f4)[_0x5cb4('0x1a')](_0x8d78b8);}};}function respondWithFilteredResult(_0x3fae76,_0x4c8b20){return function(_0x1214fb){if(_0x1214fb){var _0x56f066=typeof _0x4c8b20['offset']===_0x5cb4('0x1b')&&typeof _0x4c8b20[_0x5cb4('0x1c')]==='undefined';var _0x180987=_0x1214fb[_0x5cb4('0x1d')];var _0x3a4216=_0x56f066?0x0:_0x4c8b20['offset'];var _0x1efc61=_0x56f066?_0x1214fb[_0x5cb4('0x1d')]:_0x4c8b20[_0x5cb4('0x1e')]+_0x4c8b20[_0x5cb4('0x1c')];var _0x460338;if(_0x1efc61>=_0x180987){_0x1efc61=_0x180987;_0x460338=0xc8;}else{_0x460338=0xce;}_0x3fae76[_0x5cb4('0x19')](_0x460338);return _0x3fae76[_0x5cb4('0x1f')](_0x5cb4('0x20'),_0x3a4216+'-'+_0x1efc61+'/'+_0x180987)[_0x5cb4('0x1a')](_0x1214fb);}return null;};}function patchUpdates(_0x1e8e56){return function(_0x85b0b0){try{jsonpatch[_0x5cb4('0x21')](_0x85b0b0,_0x1e8e56,!![]);}catch(_0x368248){return BPromise[_0x5cb4('0x22')](_0x368248);}return _0x85b0b0[_0x5cb4('0x23')]();};}function saveUpdates(_0x4bfbf7,_0xc37cef){return function(_0x4e5115){if(_0x4e5115){return _0x4e5115[_0x5cb4('0x24')](_0x4bfbf7)[_0x5cb4('0x25')](function(_0x17dff5){return _0x17dff5;});}return null;};}function removeEntity(_0x4a2393,_0x17e01b){return function(_0x3cdc93){if(_0x3cdc93){return _0x3cdc93[_0x5cb4('0x26')]()[_0x5cb4('0x25')](function(){_0x4a2393[_0x5cb4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12a08b,_0x164a37){return function(_0x406b3d){if(!_0x406b3d){_0x12a08b[_0x5cb4('0x18')](0x194);}return _0x406b3d;};}function handleError(_0x544c22,_0x51cf8c){_0x51cf8c=_0x51cf8c||0x1f4;return function(_0x502f1d){logger[_0x5cb4('0x27')](_0x502f1d[_0x5cb4('0x28')]);if(_0x502f1d[_0x5cb4('0x29')]){delete _0x502f1d[_0x5cb4('0x29')];}_0x544c22[_0x5cb4('0x19')](_0x51cf8c)[_0x5cb4('0x2a')](_0x502f1d);};}exports[_0x5cb4('0x2b')]=function(_0x51008e,_0x598b8c){var _0x13deb1={},_0x471d25={},_0x5ead0c={'count':0x0,'rows':[]};var _0x16a120=_[_0x5cb4('0x2c')](db[_0x5cb4('0x2d')]['rawAttributes'],function(_0x550cfa){return{'name':_0x550cfa[_0x5cb4('0x2e')],'type':_0x550cfa[_0x5cb4('0x2f')][_0x5cb4('0x30')]};});_0x471d25[_0x5cb4('0x31')]=_[_0x5cb4('0x2c')](_0x16a120,'name');_0x471d25[_0x5cb4('0x32')]=_[_0x5cb4('0x33')](_0x51008e[_0x5cb4('0x32')]);_0x471d25['filters']=_['intersection'](_0x471d25['model'],_0x471d25['query']);_0x13deb1['attributes']=_[_0x5cb4('0x34')](_0x471d25[_0x5cb4('0x31')],qs['fields'](_0x51008e['query']['fields']));_0x13deb1['attributes']=_0x13deb1[_0x5cb4('0x35')][_0x5cb4('0x36')]?_0x13deb1[_0x5cb4('0x35')]:_0x471d25[_0x5cb4('0x31')];if(!_0x51008e[_0x5cb4('0x32')][_0x5cb4('0x37')]('nolimit')){_0x13deb1[_0x5cb4('0x1c')]=qs[_0x5cb4('0x1c')](_0x51008e[_0x5cb4('0x32')]['limit']);_0x13deb1[_0x5cb4('0x1e')]=qs[_0x5cb4('0x1e')](_0x51008e[_0x5cb4('0x32')]['offset']);}_0x13deb1[_0x5cb4('0x38')]=qs[_0x5cb4('0x39')](_0x51008e[_0x5cb4('0x32')][_0x5cb4('0x39')]);_0x13deb1['where']=qs[_0x5cb4('0x3a')](_['pick'](_0x51008e['query'],_0x471d25[_0x5cb4('0x3a')]),_0x16a120);if(_0x51008e[_0x5cb4('0x32')][_0x5cb4('0x3b')]){_0x13deb1['where']=_[_0x5cb4('0x3c')](_0x13deb1[_0x5cb4('0x3d')],{'$or':_[_0x5cb4('0x2c')](_0x16a120,function(_0x1c02d0){if(_0x1c02d0[_0x5cb4('0x2f')]!==_0x5cb4('0x3e')){var _0x12563c={};_0x12563c[_0x1c02d0[_0x5cb4('0x29')]]={'$like':'%'+_0x51008e[_0x5cb4('0x32')][_0x5cb4('0x3b')]+'%'};return _0x12563c;}})});}_0x13deb1=_[_0x5cb4('0x3c')]({},_0x13deb1,_0x51008e[_0x5cb4('0x3f')]);var _0x413ff2={'where':_0x13deb1[_0x5cb4('0x3d')]};return db[_0x5cb4('0x2d')][_0x5cb4('0x1d')](_0x413ff2)['then'](function(_0x374caa){_0x5ead0c[_0x5cb4('0x1d')]=_0x374caa;if(_0x51008e[_0x5cb4('0x32')][_0x5cb4('0x40')]){_0x13deb1[_0x5cb4('0x41')]=[{'all':!![]}];}return db[_0x5cb4('0x2d')][_0x5cb4('0x42')](_0x13deb1);})[_0x5cb4('0x25')](function(_0x5b1ab9){_0x5ead0c[_0x5cb4('0x43')]=_0x5b1ab9;return _0x5ead0c;})[_0x5cb4('0x25')](respondWithFilteredResult(_0x598b8c,_0x13deb1))[_0x5cb4('0x44')](handleError(_0x598b8c,null));};exports[_0x5cb4('0x45')]=function(_0x215bf0,_0x165177){var _0x42646f={'raw':!![],'where':{'id':_0x215bf0[_0x5cb4('0x46')]['id']}},_0x4478e5={};_0x4478e5[_0x5cb4('0x31')]=_[_0x5cb4('0x33')](db[_0x5cb4('0x2d')][_0x5cb4('0x47')]);_0x4478e5[_0x5cb4('0x32')]=_[_0x5cb4('0x33')](_0x215bf0[_0x5cb4('0x32')]);_0x4478e5[_0x5cb4('0x3a')]=_[_0x5cb4('0x34')](_0x4478e5[_0x5cb4('0x31')],_0x4478e5['query']);_0x42646f[_0x5cb4('0x35')]=_[_0x5cb4('0x34')](_0x4478e5[_0x5cb4('0x31')],qs[_0x5cb4('0x48')](_0x215bf0['query'][_0x5cb4('0x48')]));_0x42646f[_0x5cb4('0x35')]=_0x42646f[_0x5cb4('0x35')][_0x5cb4('0x36')]?_0x42646f[_0x5cb4('0x35')]:_0x4478e5[_0x5cb4('0x31')];if(_0x215bf0[_0x5cb4('0x32')][_0x5cb4('0x40')]){_0x42646f[_0x5cb4('0x41')]=[{'all':!![]}];}_0x42646f=_['merge']({},_0x42646f,_0x215bf0[_0x5cb4('0x3f')]);return db[_0x5cb4('0x2d')][_0x5cb4('0x49')](_0x42646f)['then'](handleEntityNotFound(_0x165177,null))['then'](respondWithResult(_0x165177,null))['catch'](handleError(_0x165177,null));};exports[_0x5cb4('0x4a')]=function(_0x18483e,_0x4acf34){return db[_0x5cb4('0x2d')][_0x5cb4('0x4a')](_0x18483e[_0x5cb4('0x4b')],{})[_0x5cb4('0x25')](respondWithResult(_0x4acf34,0xc9))[_0x5cb4('0x44')](handleError(_0x4acf34,null));};exports[_0x5cb4('0x24')]=function(_0x31e97b,_0x4bde3f){if(_0x31e97b[_0x5cb4('0x4b')]['id']){delete _0x31e97b['body']['id'];}return db[_0x5cb4('0x2d')][_0x5cb4('0x49')]({'where':{'id':_0x31e97b['params']['id']}})[_0x5cb4('0x25')](handleEntityNotFound(_0x4bde3f,null))[_0x5cb4('0x25')](saveUpdates(_0x31e97b[_0x5cb4('0x4b')],null))[_0x5cb4('0x25')](respondWithResult(_0x4bde3f,null))[_0x5cb4('0x44')](handleError(_0x4bde3f,null));};exports[_0x5cb4('0x26')]=function(_0x421eb0,_0x5ba14f){return db[_0x5cb4('0x2d')][_0x5cb4('0x49')]({'where':{'id':_0x421eb0[_0x5cb4('0x46')]['id']}})[_0x5cb4('0x25')](handleEntityNotFound(_0x5ba14f,null))['then'](removeEntity(_0x5ba14f,null))[_0x5cb4('0x44')](handleError(_0x5ba14f,null));};exports['describe']=function(_0x301a9e,_0x27d28f){return db[_0x5cb4('0x2d')]['describe']()['then'](respondWithResult(_0x27d28f,null))[_0x5cb4('0x44')](handleError(_0x27d28f,null));};
\ No newline at end of file
index f9431f8..20a0fd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb33f=['request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xbd7925,_0x2d046b){var _0x213b72=function(_0x2c9784){while(--_0x2c9784){_0xbd7925['push'](_0xbd7925['shift']());}};_0x213b72(++_0x2d046b);}(_0xb33f,0xea));var _0xfb33=function(_0x723aec,_0x251de2){_0x723aec=_0x723aec-0x0;var _0x1450da=_0xb33f[_0x723aec];return _0x1450da;};'use strict';var _=require(_0xfb33('0x0'));var util=require(_0xfb33('0x1'));var logger=require(_0xfb33('0x2'))(_0xfb33('0x3'));var moment=require(_0xfb33('0x4'));var BPromise=require(_0xfb33('0x5'));var rp=require(_0xfb33('0x6'));var fs=require('fs');var path=require(_0xfb33('0x7'));var rimraf=require(_0xfb33('0x8'));var config=require(_0xfb33('0x9'));var attributes=require(_0xfb33('0xa'));module[_0xfb33('0xb')]=function(_0x46f2bb,_0x15e81b){return _0x46f2bb[_0xfb33('0xc')](_0xfb33('0xd'),attributes,{'tableName':_0xfb33('0xe'),'paranoid':![],'indexes':[{'name':_0xfb33('0xf'),'fields':[_0xfb33('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x77c9=['moment','bluebird','path','rimraf','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x2615e2,_0x48c17c){var _0x324c0b=function(_0x3374d5){while(--_0x3374d5){_0x2615e2['push'](_0x2615e2['shift']());}};_0x324c0b(++_0x48c17c);}(_0x77c9,0x182));var _0x977c=function(_0x72bc68,_0x394332){_0x72bc68=_0x72bc68-0x0;var _0x1b61d7=_0x77c9[_0x72bc68];return _0x1b61d7;};'use strict';var _=require(_0x977c('0x0'));var util=require(_0x977c('0x1'));var logger=require(_0x977c('0x2'))(_0x977c('0x3'));var moment=require(_0x977c('0x4'));var BPromise=require(_0x977c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x977c('0x6'));var rimraf=require(_0x977c('0x7'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0x977c('0x8')]=function(_0x5a9fc3,_0x4f21eb){return _0x5a9fc3[_0x977c('0x9')](_0x977c('0xa'),attributes,{'tableName':_0x977c('0xb'),'paranoid':![],'indexes':[{'name':_0x977c('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 959a97d..81ea55e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc18a=['code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x56241f,_0xc69854){var _0x2f68ef=function(_0x3fe05e){while(--_0x3fe05e){_0x56241f['push'](_0x56241f['shift']());}};_0x2f68ef(++_0xc69854);}(_0xc18a,0x1cf));var _0xac18=function(_0x1b0452,_0x3c69a5){_0x1b0452=_0x1b0452-0x0;var _0x140bb1=_0xc18a[_0x1b0452];return _0x140bb1;};'use strict';var _=require(_0xac18('0x0'));var util=require(_0xac18('0x1'));var moment=require(_0xac18('0x2'));var BPromise=require(_0xac18('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xac18('0x4'));var db=require(_0xac18('0x5'))['db'];var utils=require(_0xac18('0x6'));var logger=require(_0xac18('0x7'))(_0xac18('0x8'));var config=require(_0xac18('0x9'));var jayson=require(_0xac18('0xa'));var client=jayson[_0xac18('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xab6cb,_0x268fa1,_0x542a9){return new BPromise(function(_0x2bf4b8,_0xd3c4bc){return client[_0xac18('0xc')](_0xab6cb,_0x542a9)[_0xac18('0xd')](function(_0x223d7f){logger[_0xac18('0xe')](_0xac18('0xf'),_0x268fa1,_0xac18('0x10'));logger[_0xac18('0x11')](_0xac18('0x12'),_0x268fa1,_0xac18('0x10'),JSON['stringify'](_0x223d7f));if(_0x223d7f[_0xac18('0x13')]){if(_0x223d7f['error'][_0xac18('0x14')]===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x268fa1,_0x223d7f[_0xac18('0x13')]['message']);return _0xd3c4bc(_0x223d7f['error'][_0xac18('0x15')]);}logger[_0xac18('0x13')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x268fa1,_0x223d7f[_0xac18('0x13')][_0xac18('0x15')]);return _0x2bf4b8(_0x223d7f['error'][_0xac18('0x15')]);}else{logger['info'](_0xac18('0xf'),_0x268fa1,'request\x20sent');_0x2bf4b8(_0x223d7f['result'][_0xac18('0x15')]);}})[_0xac18('0x16')](function(_0x519c07){logger['error'](_0xac18('0xf'),_0x268fa1,_0x519c07);_0xd3c4bc(_0x519c07);});});}
\ No newline at end of file
+var _0xd13e=['OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3faa16,_0x309ab0){var _0x496ee5=function(_0x2d4353){while(--_0x2d4353){_0x3faa16['push'](_0x3faa16['shift']());}};_0x496ee5(++_0x309ab0);}(_0xd13e,0x193));var _0xed13=function(_0x328e3e,_0x18b50e){_0x328e3e=_0x328e3e-0x0;var _0x29feee=_0xd13e[_0x328e3e];return _0x29feee;};'use strict';var _=require(_0xed13('0x0'));var util=require(_0xed13('0x1'));var moment=require(_0xed13('0x2'));var BPromise=require(_0xed13('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed13('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xed13('0x5'));var logger=require('../../config/logger')(_0xed13('0x6'));var config=require(_0xed13('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x95ff4c,_0x134929,_0xab0fff){return new BPromise(function(_0x3b3984,_0x369798){return client[_0xed13('0x8')](_0x95ff4c,_0xab0fff)[_0xed13('0x9')](function(_0x9bc191){logger[_0xed13('0xa')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x134929,_0xed13('0xb'));logger[_0xed13('0xc')](_0xed13('0xd'),_0x134929,_0xed13('0xb'),JSON[_0xed13('0xe')](_0x9bc191));if(_0x9bc191['error']){if(_0x9bc191[_0xed13('0xf')][_0xed13('0x10')]===0x1f4){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x9bc191[_0xed13('0xf')][_0xed13('0x12')]);return _0x369798(_0x9bc191['error'][_0xed13('0x12')]);}logger['error'](_0xed13('0x11'),_0x134929,_0x9bc191['error'][_0xed13('0x12')]);return _0x3b3984(_0x9bc191['error'][_0xed13('0x12')]);}else{logger['info'](_0xed13('0x11'),_0x134929,_0xed13('0xb'));_0x3b3984(_0x9bc191[_0xed13('0x13')][_0xed13('0x12')]);}})[_0xed13('0x14')](function(_0x1f8585){logger[_0xed13('0xf')](_0xed13('0x11'),_0x134929,_0x1f8585);_0x369798(_0x1f8585);});});}
\ No newline at end of file
index 04fa6b1..f306885 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74a7=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','get','/:id','show','post','put','update','delete','destroy','exports','multer','path'];(function(_0xf0d378,_0x2b27fd){var _0xc11fd2=function(_0x3aebf1){while(--_0x3aebf1){_0xf0d378['push'](_0xf0d378['shift']());}};_0xc11fd2(++_0x2b27fd);}(_0x74a7,0x130));var _0x774a=function(_0x2d3f92,_0x333e38){_0x2d3f92=_0x2d3f92-0x0;var _0x22d75a=_0x74a7[_0x2d3f92];return _0x22d75a;};'use strict';var multer=require(_0x774a('0x0'));var util=require('util');var path=require(_0x774a('0x1'));var timeout=require(_0x774a('0x2'));var express=require(_0x774a('0x3'));var router=express[_0x774a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x774a('0x5'));var config=require(_0x774a('0x6'));var controller=require(_0x774a('0x7'));router['get']('/',auth[_0x774a('0x8')](),controller['index']);router[_0x774a('0x9')](_0x774a('0xa'),auth[_0x774a('0x8')](),controller[_0x774a('0xb')]);router[_0x774a('0xc')]('/',auth[_0x774a('0x8')](),controller['create']);router[_0x774a('0xd')]('/:id',auth[_0x774a('0x8')](),controller[_0x774a('0xe')]);router[_0x774a('0xf')]('/:id',auth[_0x774a('0x8')](),controller[_0x774a('0x10')]);module[_0x774a('0x11')]=router;
\ No newline at end of file
+var _0xa436=['Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x9ba863,_0x2490d9){var _0x54ffff=function(_0x2a08d9){while(--_0x2a08d9){_0x9ba863['push'](_0x9ba863['shift']());}};_0x54ffff(++_0x2490d9);}(_0xa436,0xd8));var _0x6a43=function(_0x3a427f,_0x4d65d4){_0x3a427f=_0x3a427f-0x0;var _0x526c1f=_0xa436[_0x3a427f];return _0x526c1f;};'use strict';var multer=require('multer');var util=require(_0x6a43('0x0'));var path=require(_0x6a43('0x1'));var timeout=require(_0x6a43('0x2'));var express=require(_0x6a43('0x3'));var router=express[_0x6a43('0x4')]();var fs_extra=require(_0x6a43('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6a43('0x6'));var config=require(_0x6a43('0x7'));var controller=require(_0x6a43('0x8'));router[_0x6a43('0x9')]('/',auth[_0x6a43('0xa')](),controller['index']);router[_0x6a43('0x9')](_0x6a43('0xb'),auth[_0x6a43('0xa')](),controller[_0x6a43('0xc')]);router[_0x6a43('0xd')]('/',auth[_0x6a43('0xa')](),controller[_0x6a43('0xe')]);router[_0x6a43('0xf')](_0x6a43('0xb'),auth['isAuthenticated'](),controller[_0x6a43('0x10')]);router[_0x6a43('0x11')](_0x6a43('0xb'),auth[_0x6a43('0xa')](),controller[_0x6a43('0x12')]);module[_0x6a43('0x13')]=router;
\ No newline at end of file
index cae6a42..ad8aa20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2b0=['name','exports','STRING'];(function(_0x2942eb,_0x268b83){var _0x421230=function(_0x27e26f){while(--_0x27e26f){_0x2942eb['push'](_0x2942eb['shift']());}};_0x421230(++_0x268b83);}(_0xe2b0,0x8e));var _0x0e2b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xe2b0[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0x0e2b('0x0')]={'name':{'type':Sequelize[_0x0e2b('0x1')],'unique':_0x0e2b('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x451e=['STRING','name','exports'];(function(_0x4b4bb5,_0x478f32){var _0x4a2601=function(_0x47c747){while(--_0x47c747){_0x4b4bb5['push'](_0x4b4bb5['shift']());}};_0x4a2601(++_0x478f32);}(_0x451e,0x11f));var _0xe451=function(_0x473fa8,_0x55a341){_0x473fa8=_0x473fa8-0x0;var _0x252ff1=_0x451e[_0x473fa8];return _0x252ff1;};'use strict';var Sequelize=require('sequelize');module[_0xe451('0x0')]={'name':{'type':Sequelize[_0xe451('0x1')],'unique':_0xe451('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xe451('0x1')]}};
\ No newline at end of file
index fedc670..eebdd61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x777c=['index','Pause','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','get','Pauses','UserProfileResource','end','stack','name'];(function(_0x1ca8f5,_0x5cdac9){var _0x2c76bd=function(_0x5da6b2){while(--_0x5da6b2){_0x1ca8f5['push'](_0x1ca8f5['shift']());}};_0x2c76bd(++_0x5cdac9);}(_0x777c,0x1bd));var _0xc777=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x777c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc777('0x0'));var rimraf=require(_0xc777('0x1'));var zipdir=require(_0xc777('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc777('0x3'));var moment=require(_0xc777('0x4'));var BPromise=require(_0xc777('0x5'));var Mustache=require(_0xc777('0x6'));var util=require(_0xc777('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc777('0x8'));var ejs=require(_0xc777('0x9'));var fs=require('fs');var fs_extra=require(_0xc777('0xa'));var _=require(_0xc777('0xb'));var squel=require(_0xc777('0xc'));var crypto=require(_0xc777('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc777('0xe'));var toCsv=require(_0xc777('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc777('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc777('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc777('0x11'));var logger=require(_0xc777('0x12'))(_0xc777('0x13'));var utils=require(_0xc777('0x14'));var config=require(_0xc777('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x400962,_0x5916c9){_0x5916c9=_0x5916c9||0xcc;return function(_0x12fe3c){if(_0x12fe3c){return _0x400962[_0xc777('0x16')](_0x5916c9);}return _0x400962[_0xc777('0x17')](_0x5916c9)['end']();};}function respondWithResult(_0x2ca6ab,_0x24a610){_0x24a610=_0x24a610||0xc8;return function(_0x3bd3d9){if(_0x3bd3d9){return _0x2ca6ab[_0xc777('0x17')](_0x24a610)[_0xc777('0x18')](_0x3bd3d9);}};}function respondWithFilteredResult(_0x473aaa,_0x46f8f2){return function(_0x42b603){if(_0x42b603){var _0xa3673f=typeof _0x46f8f2[_0xc777('0x19')]===_0xc777('0x1a')&&typeof _0x46f8f2['limit']==='undefined';var _0x537aba=_0x42b603[_0xc777('0x1b')];var _0x548f7d=_0xa3673f?0x0:_0x46f8f2[_0xc777('0x19')];var _0x43cfa1=_0xa3673f?_0x42b603[_0xc777('0x1b')]:_0x46f8f2['offset']+_0x46f8f2[_0xc777('0x1c')];var _0x2843d;if(_0x43cfa1>=_0x537aba){_0x43cfa1=_0x537aba;_0x2843d=0xc8;}else{_0x2843d=0xce;}_0x473aaa['status'](_0x2843d);return _0x473aaa['set'](_0xc777('0x1d'),_0x548f7d+'-'+_0x43cfa1+'/'+_0x537aba)[_0xc777('0x18')](_0x42b603);}return null;};}function patchUpdates(_0x62453a){return function(_0x33c431){try{jsonpatch[_0xc777('0x1e')](_0x33c431,_0x62453a,!![]);}catch(_0x2ac217){return BPromise[_0xc777('0x1f')](_0x2ac217);}return _0x33c431[_0xc777('0x20')]();};}function saveUpdates(_0x1a45c0,_0x409029){return function(_0x363430){if(_0x363430){return _0x363430[_0xc777('0x21')](_0x1a45c0)[_0xc777('0x22')](function(_0x3abbdf){return _0x3abbdf;});}return null;};}function removeEntity(_0xe68d2a,_0x130473){return function(_0x2d6869){if(_0x2d6869){return _0x2d6869['destroy']()['then'](function(){var _0x1056b4=_0x2d6869[_0xc777('0x23')]({'plain':!![]});var _0x2f3df6=_0xc777('0x24');return db[_0xc777('0x25')]['destroy']({'where':{'type':_0x2f3df6,'resourceId':_0x1056b4['id']}})['then'](function(){return _0x2d6869;});})[_0xc777('0x22')](function(){_0xe68d2a['status'](0xcc)[_0xc777('0x26')]();});}};}function handleEntityNotFound(_0x11aaee,_0xf5471){return function(_0x3e6d43){if(!_0x3e6d43){_0x11aaee[_0xc777('0x16')](0x194);}return _0x3e6d43;};}function handleError(_0x568ab8,_0x589aec){_0x589aec=_0x589aec||0x1f4;return function(_0x1314ba){logger['error'](_0x1314ba[_0xc777('0x27')]);if(_0x1314ba[_0xc777('0x28')]){delete _0x1314ba[_0xc777('0x28')];}_0x568ab8['status'](_0x589aec)['send'](_0x1314ba);};}exports[_0xc777('0x29')]=function(_0x297837,_0x5c49a8){var _0x18e67b={},_0x309051={},_0x32559b={'count':0x0,'rows':[]};var _0x23584c=_['map'](db[_0xc777('0x2a')][_0xc777('0x2b')],function(_0x2a10c8){return{'name':_0x2a10c8['fieldName'],'type':_0x2a10c8[_0xc777('0x2c')][_0xc777('0x2d')]};});_0x309051[_0xc777('0x2e')]=_[_0xc777('0x2f')](_0x23584c,_0xc777('0x28'));_0x309051[_0xc777('0x30')]=_['keys'](_0x297837['query']);_0x309051[_0xc777('0x31')]=_['intersection'](_0x309051[_0xc777('0x2e')],_0x309051['query']);_0x18e67b[_0xc777('0x32')]=_[_0xc777('0x33')](_0x309051[_0xc777('0x2e')],qs[_0xc777('0x34')](_0x297837[_0xc777('0x30')][_0xc777('0x34')]));_0x18e67b[_0xc777('0x32')]=_0x18e67b[_0xc777('0x32')]['length']?_0x18e67b[_0xc777('0x32')]:_0x309051[_0xc777('0x2e')];if(!_0x297837['query'][_0xc777('0x35')](_0xc777('0x36'))){_0x18e67b['limit']=qs['limit'](_0x297837[_0xc777('0x30')]['limit']);_0x18e67b[_0xc777('0x19')]=qs[_0xc777('0x19')](_0x297837[_0xc777('0x30')][_0xc777('0x19')]);}_0x18e67b[_0xc777('0x37')]=qs['sort'](_0x297837[_0xc777('0x30')][_0xc777('0x38')]);_0x18e67b[_0xc777('0x39')]=qs[_0xc777('0x31')](_[_0xc777('0x3a')](_0x297837[_0xc777('0x30')],_0x309051['filters']),_0x23584c);if(_0x297837[_0xc777('0x30')][_0xc777('0x3b')]){_0x18e67b['where']=_[_0xc777('0x3c')](_0x18e67b[_0xc777('0x39')],{'$or':_[_0xc777('0x2f')](_0x23584c,function(_0x46ab1b){if(_0x46ab1b['type']!=='VIRTUAL'){var _0x5efb61={};_0x5efb61[_0x46ab1b[_0xc777('0x28')]]={'$like':'%'+_0x297837[_0xc777('0x30')][_0xc777('0x3b')]+'%'};return _0x5efb61;}})});}_0x18e67b=_['merge']({},_0x18e67b,_0x297837[_0xc777('0x3d')]);var _0x3ff498={'where':_0x18e67b[_0xc777('0x39')]};return db[_0xc777('0x2a')]['count'](_0x3ff498)['then'](function(_0x382685){_0x32559b[_0xc777('0x1b')]=_0x382685;if(_0x297837[_0xc777('0x30')][_0xc777('0x3e')]){_0x18e67b[_0xc777('0x3f')]=[{'all':!![]}];}return db[_0xc777('0x2a')][_0xc777('0x40')](_0x18e67b);})[_0xc777('0x22')](function(_0x5a8ec7){_0x32559b[_0xc777('0x41')]=_0x5a8ec7;return _0x32559b;})[_0xc777('0x22')](respondWithFilteredResult(_0x5c49a8,_0x18e67b))['catch'](handleError(_0x5c49a8,null));};exports[_0xc777('0x42')]=function(_0xb527a4,_0x423971){var _0x40064b={'raw':!![],'where':{'id':_0xb527a4['params']['id']}},_0x27e58e={};_0x27e58e[_0xc777('0x2e')]=_['keys'](db[_0xc777('0x2a')]['rawAttributes']);_0x27e58e['query']=_[_0xc777('0x43')](_0xb527a4[_0xc777('0x30')]);_0x27e58e['filters']=_[_0xc777('0x33')](_0x27e58e[_0xc777('0x2e')],_0x27e58e['query']);_0x40064b[_0xc777('0x32')]=_['intersection'](_0x27e58e[_0xc777('0x2e')],qs['fields'](_0xb527a4['query'][_0xc777('0x34')]));_0x40064b['attributes']=_0x40064b[_0xc777('0x32')]['length']?_0x40064b[_0xc777('0x32')]:_0x27e58e[_0xc777('0x2e')];if(_0xb527a4[_0xc777('0x30')][_0xc777('0x3e')]){_0x40064b['include']=[{'all':!![]}];}_0x40064b=_['merge']({},_0x40064b,_0xb527a4[_0xc777('0x3d')]);return db['Pause'][_0xc777('0x44')](_0x40064b)['then'](handleEntityNotFound(_0x423971,null))['then'](respondWithResult(_0x423971,null))[_0xc777('0x45')](handleError(_0x423971,null));};exports[_0xc777('0x46')]=function(_0x284094,_0x571505){return db['Pause'][_0xc777('0x46')](_0x284094[_0xc777('0x47')],{})[_0xc777('0x22')](function(_0xe58e1b){var _0xa0bb19=_0x284094[_0xc777('0x48')][_0xc777('0x23')]({'plain':!![]});if(!_0xa0bb19)throw new Error(_0xc777('0x49'));if(_0xa0bb19[_0xc777('0x4a')]===_0xc777('0x48')){var _0x2c64b1=_0xe58e1b[_0xc777('0x23')]({'plain':!![]});var _0x3226a3=_0xc777('0x24');return db[_0xc777('0x4b')][_0xc777('0x44')]({'where':{'name':_0x3226a3,'userProfileId':_0xa0bb19['userProfileId']},'raw':!![]})[_0xc777('0x22')](function(_0x2d6628){if(_0x2d6628&&_0x2d6628[_0xc777('0x4c')]===0x0){return db[_0xc777('0x25')][_0xc777('0x46')]({'name':_0x2c64b1['name'],'resourceId':_0x2c64b1['id'],'type':_0x2d6628[_0xc777('0x28')],'sectionId':_0x2d6628['id']},{})[_0xc777('0x22')](function(){return _0xe58e1b;});}else{return _0xe58e1b;}})[_0xc777('0x45')](function(_0x5be8d5){logger[_0xc777('0x4d')](_0xc777('0x4e'),_0x5be8d5);throw _0x5be8d5;});}return _0xe58e1b;})['then'](respondWithResult(_0x571505,0xc9))['catch'](handleError(_0x571505,null));};exports['update']=function(_0x78915a,_0x40fe94){if(_0x78915a[_0xc777('0x47')]['id']){delete _0x78915a['body']['id'];}return db[_0xc777('0x2a')]['find']({'where':{'id':_0x78915a['params']['id']}})[_0xc777('0x22')](handleEntityNotFound(_0x40fe94,null))['then'](saveUpdates(_0x78915a[_0xc777('0x47')],null))[_0xc777('0x22')](respondWithResult(_0x40fe94,null))[_0xc777('0x45')](handleError(_0x40fe94,null));};exports[_0xc777('0x4f')]=function(_0x5dd31d,_0x5169db){return db[_0xc777('0x2a')][_0xc777('0x44')]({'where':{'id':_0x5dd31d[_0xc777('0x50')]['id']}})['then'](handleEntityNotFound(_0x5169db,null))['then'](removeEntity(_0x5169db,null))[_0xc777('0x45')](handleError(_0x5169db,null));};
\ No newline at end of file
+var _0xf1da=['fieldName','key','map','query','keys','model','attributes','fields','length','limit','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','Pauses','error','stack','name','send','Pause'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf1da,0x75));var _0xaf1d=function(_0x245772,_0x2c0818){_0x245772=_0x245772-0x0;var _0x1a1c3b=_0xf1da[_0x245772];return _0x1a1c3b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaf1d('0x0'));var rp=require(_0xaf1d('0x1'));var moment=require(_0xaf1d('0x2'));var BPromise=require(_0xaf1d('0x3'));var Mustache=require(_0xaf1d('0x4'));var util=require(_0xaf1d('0x5'));var path=require('path');var sox=require(_0xaf1d('0x6'));var csv=require(_0xaf1d('0x7'));var ejs=require(_0xaf1d('0x8'));var fs=require('fs');var fs_extra=require(_0xaf1d('0x9'));var _=require('lodash');var squel=require(_0xaf1d('0xa'));var crypto=require(_0xaf1d('0xb'));var jsforce=require(_0xaf1d('0xc'));var deskjs=require(_0xaf1d('0xd'));var toCsv=require(_0xaf1d('0x7'));var querystring=require(_0xaf1d('0xe'));var Papa=require(_0xaf1d('0xf'));var Redis=require('ioredis');var authService=require(_0xaf1d('0x10'));var qs=require(_0xaf1d('0x11'));var as=require(_0xaf1d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf1d('0x13'))(_0xaf1d('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xaf1d('0x15'));var db=require(_0xaf1d('0x16'))['db'];function respondWithStatusCode(_0xf073e5,_0x317ccf){_0x317ccf=_0x317ccf||0xcc;return function(_0x44d0dc){if(_0x44d0dc){return _0xf073e5[_0xaf1d('0x17')](_0x317ccf);}return _0xf073e5[_0xaf1d('0x18')](_0x317ccf)[_0xaf1d('0x19')]();};}function respondWithResult(_0x3338b0,_0x36deed){_0x36deed=_0x36deed||0xc8;return function(_0x36fd82){if(_0x36fd82){return _0x3338b0[_0xaf1d('0x18')](_0x36deed)[_0xaf1d('0x1a')](_0x36fd82);}};}function respondWithFilteredResult(_0x280fa0,_0x5ef02d){return function(_0x452482){if(_0x452482){var _0x30b730=typeof _0x5ef02d['offset']===_0xaf1d('0x1b')&&typeof _0x5ef02d['limit']===_0xaf1d('0x1b');var _0x175305=_0x452482[_0xaf1d('0x1c')];var _0x4401a3=_0x30b730?0x0:_0x5ef02d[_0xaf1d('0x1d')];var _0x2b8297=_0x30b730?_0x452482[_0xaf1d('0x1c')]:_0x5ef02d['offset']+_0x5ef02d['limit'];var _0x4a6f73;if(_0x2b8297>=_0x175305){_0x2b8297=_0x175305;_0x4a6f73=0xc8;}else{_0x4a6f73=0xce;}_0x280fa0[_0xaf1d('0x18')](_0x4a6f73);return _0x280fa0[_0xaf1d('0x1e')](_0xaf1d('0x1f'),_0x4401a3+'-'+_0x2b8297+'/'+_0x175305)[_0xaf1d('0x1a')](_0x452482);}return null;};}function patchUpdates(_0x18ba76){return function(_0x257536){try{jsonpatch[_0xaf1d('0x20')](_0x257536,_0x18ba76,!![]);}catch(_0x292563){return BPromise[_0xaf1d('0x21')](_0x292563);}return _0x257536[_0xaf1d('0x22')]();};}function saveUpdates(_0x29cdc3,_0x3b9c26){return function(_0x2f7509){if(_0x2f7509){return _0x2f7509[_0xaf1d('0x23')](_0x29cdc3)['then'](function(_0x502487){return _0x502487;});}return null;};}function removeEntity(_0x2130cf,_0x1e1bfc){return function(_0x4391af){if(_0x4391af){return _0x4391af[_0xaf1d('0x24')]()[_0xaf1d('0x25')](function(){var _0x522e99=_0x4391af[_0xaf1d('0x26')]({'plain':!![]});var _0x3cb0a3=_0xaf1d('0x27');return db['UserProfileResource'][_0xaf1d('0x24')]({'where':{'type':_0x3cb0a3,'resourceId':_0x522e99['id']}})[_0xaf1d('0x25')](function(){return _0x4391af;});})[_0xaf1d('0x25')](function(){_0x2130cf[_0xaf1d('0x18')](0xcc)[_0xaf1d('0x19')]();});}};}function handleEntityNotFound(_0x5e9226,_0x18d2dd){return function(_0x59295a){if(!_0x59295a){_0x5e9226[_0xaf1d('0x17')](0x194);}return _0x59295a;};}function handleError(_0x53ed99,_0x563e53){_0x563e53=_0x563e53||0x1f4;return function(_0x38dcb0){logger[_0xaf1d('0x28')](_0x38dcb0[_0xaf1d('0x29')]);if(_0x38dcb0[_0xaf1d('0x2a')]){delete _0x38dcb0['name'];}_0x53ed99[_0xaf1d('0x18')](_0x563e53)[_0xaf1d('0x2b')](_0x38dcb0);};}exports['index']=function(_0x287ddb,_0x5a3be2){var _0x26de57={},_0x46267a={},_0x147a6b={'count':0x0,'rows':[]};var _0x164dbd=_['map'](db[_0xaf1d('0x2c')]['rawAttributes'],function(_0x36f808){return{'name':_0x36f808[_0xaf1d('0x2d')],'type':_0x36f808['type'][_0xaf1d('0x2e')]};});_0x46267a['model']=_[_0xaf1d('0x2f')](_0x164dbd,_0xaf1d('0x2a'));_0x46267a[_0xaf1d('0x30')]=_[_0xaf1d('0x31')](_0x287ddb[_0xaf1d('0x30')]);_0x46267a['filters']=_['intersection'](_0x46267a[_0xaf1d('0x32')],_0x46267a['query']);_0x26de57[_0xaf1d('0x33')]=_['intersection'](_0x46267a[_0xaf1d('0x32')],qs[_0xaf1d('0x34')](_0x287ddb[_0xaf1d('0x30')][_0xaf1d('0x34')]));_0x26de57[_0xaf1d('0x33')]=_0x26de57[_0xaf1d('0x33')][_0xaf1d('0x35')]?_0x26de57[_0xaf1d('0x33')]:_0x46267a[_0xaf1d('0x32')];if(!_0x287ddb['query']['hasOwnProperty']('nolimit')){_0x26de57[_0xaf1d('0x36')]=qs['limit'](_0x287ddb[_0xaf1d('0x30')][_0xaf1d('0x36')]);_0x26de57[_0xaf1d('0x1d')]=qs[_0xaf1d('0x1d')](_0x287ddb[_0xaf1d('0x30')]['offset']);}_0x26de57['order']=qs['sort'](_0x287ddb[_0xaf1d('0x30')]['sort']);_0x26de57[_0xaf1d('0x37')]=qs[_0xaf1d('0x38')](_[_0xaf1d('0x39')](_0x287ddb[_0xaf1d('0x30')],_0x46267a[_0xaf1d('0x38')]),_0x164dbd);if(_0x287ddb[_0xaf1d('0x30')][_0xaf1d('0x3a')]){_0x26de57['where']=_[_0xaf1d('0x3b')](_0x26de57[_0xaf1d('0x37')],{'$or':_[_0xaf1d('0x2f')](_0x164dbd,function(_0x53fe50){if(_0x53fe50[_0xaf1d('0x3c')]!==_0xaf1d('0x3d')){var _0x2558db={};_0x2558db[_0x53fe50[_0xaf1d('0x2a')]]={'$like':'%'+_0x287ddb[_0xaf1d('0x30')][_0xaf1d('0x3a')]+'%'};return _0x2558db;}})});}_0x26de57=_[_0xaf1d('0x3b')]({},_0x26de57,_0x287ddb[_0xaf1d('0x3e')]);var _0x903d9e={'where':_0x26de57[_0xaf1d('0x37')]};return db[_0xaf1d('0x2c')][_0xaf1d('0x1c')](_0x903d9e)[_0xaf1d('0x25')](function(_0x2ce0f8){_0x147a6b['count']=_0x2ce0f8;if(_0x287ddb[_0xaf1d('0x30')][_0xaf1d('0x3f')]){_0x26de57[_0xaf1d('0x40')]=[{'all':!![]}];}return db['Pause'][_0xaf1d('0x41')](_0x26de57);})['then'](function(_0x165f7a){_0x147a6b[_0xaf1d('0x42')]=_0x165f7a;return _0x147a6b;})[_0xaf1d('0x25')](respondWithFilteredResult(_0x5a3be2,_0x26de57))[_0xaf1d('0x43')](handleError(_0x5a3be2,null));};exports['show']=function(_0x4dd7c4,_0x3a8d65){var _0x41e20f={'raw':!![],'where':{'id':_0x4dd7c4[_0xaf1d('0x44')]['id']}},_0x163b23={};_0x163b23['model']=_['keys'](db[_0xaf1d('0x2c')]['rawAttributes']);_0x163b23[_0xaf1d('0x30')]=_['keys'](_0x4dd7c4[_0xaf1d('0x30')]);_0x163b23[_0xaf1d('0x38')]=_['intersection'](_0x163b23[_0xaf1d('0x32')],_0x163b23[_0xaf1d('0x30')]);_0x41e20f[_0xaf1d('0x33')]=_[_0xaf1d('0x45')](_0x163b23['model'],qs[_0xaf1d('0x34')](_0x4dd7c4['query'][_0xaf1d('0x34')]));_0x41e20f['attributes']=_0x41e20f[_0xaf1d('0x33')]['length']?_0x41e20f['attributes']:_0x163b23['model'];if(_0x4dd7c4[_0xaf1d('0x30')]['includeAll']){_0x41e20f[_0xaf1d('0x40')]=[{'all':!![]}];}_0x41e20f=_[_0xaf1d('0x3b')]({},_0x41e20f,_0x4dd7c4[_0xaf1d('0x3e')]);return db[_0xaf1d('0x2c')][_0xaf1d('0x46')](_0x41e20f)['then'](handleEntityNotFound(_0x3a8d65,null))[_0xaf1d('0x25')](respondWithResult(_0x3a8d65,null))['catch'](handleError(_0x3a8d65,null));};exports[_0xaf1d('0x47')]=function(_0x417b3c,_0x1fd37b){return db[_0xaf1d('0x2c')]['create'](_0x417b3c[_0xaf1d('0x48')],{})[_0xaf1d('0x25')](function(_0x2f4672){var _0x3eb9ee=_0x417b3c[_0xaf1d('0x49')][_0xaf1d('0x26')]({'plain':!![]});if(!_0x3eb9ee)throw new Error(_0xaf1d('0x4a'));if(_0x3eb9ee[_0xaf1d('0x4b')]==='user'){var _0x47f3d2=_0x2f4672['get']({'plain':!![]});var _0x1d6f14=_0xaf1d('0x27');return db[_0xaf1d('0x4c')][_0xaf1d('0x46')]({'where':{'name':_0x1d6f14,'userProfileId':_0x3eb9ee[_0xaf1d('0x4d')]},'raw':!![]})[_0xaf1d('0x25')](function(_0x286c27){if(_0x286c27&&_0x286c27[_0xaf1d('0x4e')]===0x0){return db[_0xaf1d('0x4f')]['create']({'name':_0x47f3d2['name'],'resourceId':_0x47f3d2['id'],'type':_0x286c27['name'],'sectionId':_0x286c27['id']},{})[_0xaf1d('0x25')](function(){return _0x2f4672;});}else{return _0x2f4672;}})[_0xaf1d('0x43')](function(_0x1d642b){logger[_0xaf1d('0x28')](_0xaf1d('0x50'),_0x1d642b);throw _0x1d642b;});}return _0x2f4672;})[_0xaf1d('0x25')](respondWithResult(_0x1fd37b,0xc9))['catch'](handleError(_0x1fd37b,null));};exports[_0xaf1d('0x23')]=function(_0x36b100,_0x31353b){if(_0x36b100[_0xaf1d('0x48')]['id']){delete _0x36b100[_0xaf1d('0x48')]['id'];}return db[_0xaf1d('0x2c')][_0xaf1d('0x46')]({'where':{'id':_0x36b100[_0xaf1d('0x44')]['id']}})['then'](handleEntityNotFound(_0x31353b,null))[_0xaf1d('0x25')](saveUpdates(_0x36b100[_0xaf1d('0x48')],null))['then'](respondWithResult(_0x31353b,null))['catch'](handleError(_0x31353b,null));};exports[_0xaf1d('0x24')]=function(_0x5ab8af,_0x5ddb6b){return db[_0xaf1d('0x2c')]['find']({'where':{'id':_0x5ab8af['params']['id']}})[_0xaf1d('0x25')](handleEntityNotFound(_0x5ddb6b,null))[_0xaf1d('0x25')](removeEntity(_0x5ddb6b,null))[_0xaf1d('0x43')](handleError(_0x5ddb6b,null));};
\ No newline at end of file
index cb84fe8..5700f1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['tools_pauses','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x47a47b,_0x7255ac){var _0x37b1e5=function(_0x5f5c50){while(--_0x5f5c50){_0x47a47b['push'](_0x47a47b['shift']());}};_0x37b1e5(++_0x7255ac);}(_0x326f,0xd1));var _0xf326=function(_0x656408,_0x40aa10){_0x656408=_0x656408-0x0;var _0x2d907a=_0x326f[_0x656408];return _0x2d907a;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x326f=['tools_pauses','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x2c5a0b,_0x19fba7){var _0x3770cf=function(_0x389ca5){while(--_0x389ca5){_0x2c5a0b['push'](_0x2c5a0b['shift']());}};_0x3770cf(++_0x19fba7);}(_0x326f,0xd1));var _0xf326=function(_0x36759d,_0x380636){_0x36759d=_0x36759d-0x0;var _0x149563=_0x326f[_0x36759d];return _0x149563;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a0830b0..15335f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x21c1fa,_0x3dcbe0){var _0x3632ae=function(_0x373013){while(--_0x373013){_0x21c1fa['push'](_0x21c1fa['shift']());}};_0x3632ae(++_0x3dcbe0);}(_0xb10b,0x12a));var _0xbb10=function(_0x232719,_0x37a326){_0x232719=_0x232719-0x0;var _0x21ee88=_0xb10b[_0x232719];return _0x21ee88;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});};
\ No newline at end of file
+var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x365a6d,_0x322b83){var _0x185338=function(_0x325c3a){while(--_0x325c3a){_0x365a6d['push'](_0x365a6d['shift']());}};_0x185338(++_0x322b83);}(_0xb10b,0x12a));var _0xbb10=function(_0x41f55e,_0x264009){_0x41f55e=_0x41f55e-0x0;var _0x922b33=_0xb10b[_0x41f55e];return _0x922b33;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});};
\ No newline at end of file
index b3e6d17..06fbc92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['/webhook','/:id','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','single','file','upload','webhookPost','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','get','isAuthenticated','index'];(function(_0x28af1a,_0x5f4157){var _0x3d270c=function(_0x4f2bba){while(--_0x4f2bba){_0x28af1a['push'](_0x28af1a['shift']());}};_0x3d270c(++_0x5f4157);}(_0xedd9,0xfc));var _0x9edd=function(_0x32a5d0,_0x5ac802){_0x32a5d0=_0x32a5d0-0x0;var _0x37162c=_0xedd9[_0x32a5d0];return _0x37162c;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),controller['webhookGet']);router[_0x9edd('0x9')](_0x9edd('0xd'),auth[_0x9edd('0xa')](),controller[_0x9edd('0xe')]);router['get'](_0x9edd('0xf'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);var upload=multer({'storage':multer[_0x9edd('0x11')]({'destination':function(_0x523026,_0xbf9da6,_0x13dc4f){_0x13dc4f(null,path['join'](config[_0x9edd('0x12')],_0x9edd('0x13')));},'filename':function(_0x25e64c,_0xfd544a,_0x287ddd){_0xfd544a[_0x9edd('0x14')]=_0xfd544a[_0x9edd('0x14')][_0x9edd('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x287ddd(null,util['format'](_0x9edd('0x16'),path[_0x9edd('0x17')](_0xfd544a[_0x9edd('0x14')],path[_0x9edd('0x18')](_0xfd544a[_0x9edd('0x14')])),Date[_0x9edd('0x19')](),path[_0x9edd('0x18')](_0xfd544a[_0x9edd('0x14')])));}})});router['post']('/',upload[_0x9edd('0x1a')](_0x9edd('0x1b')),controller[_0x9edd('0x1c')]);router['post'](_0x9edd('0xc'),controller[_0x9edd('0x1d')]);router[_0x9edd('0x1e')]('/:id',auth[_0x9edd('0xa')](),controller['update']);router[_0x9edd('0x1f')](_0x9edd('0xd'),auth['isAuthenticated'](),controller['delete']);module[_0x9edd('0x20')]=router;
\ No newline at end of file
+var _0xcb99=['originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','upload','webhookPost','put','update','delete','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./plugin.controller','isAuthenticated','get','/webhook','webhookGet','/:id','show','download','diskStorage','join'];(function(_0x4d6700,_0x3efc2b){var _0x23e92c=function(_0x33d459){while(--_0x33d459){_0x4d6700['push'](_0x4d6700['shift']());}};_0x23e92c(++_0x3efc2b);}(_0xcb99,0x8b));var _0x9cb9=function(_0x12939d,_0x24971d){_0x12939d=_0x12939d-0x0;var _0x38f9ab=_0xcb99[_0x12939d];return _0x38f9ab;};'use strict';var multer=require(_0x9cb9('0x0'));var util=require('util');var path=require(_0x9cb9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9cb9('0x2')]();var fs_extra=require(_0x9cb9('0x3'));var auth=require(_0x9cb9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9cb9('0x5'));var controller=require(_0x9cb9('0x6'));router['get']('/',auth[_0x9cb9('0x7')](),controller['index']);router[_0x9cb9('0x8')](_0x9cb9('0x9'),controller[_0x9cb9('0xa')]);router[_0x9cb9('0x8')](_0x9cb9('0xb'),auth[_0x9cb9('0x7')](),controller[_0x9cb9('0xc')]);router[_0x9cb9('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x9cb9('0xd')]);var upload=multer({'storage':multer[_0x9cb9('0xe')]({'destination':function(_0x1b4fa6,_0x5a0ac7,_0x3be02c){_0x3be02c(null,path[_0x9cb9('0xf')](config['root'],'server/files/plugins'));},'filename':function(_0x227d49,_0x2e687e,_0x3382c8){_0x2e687e[_0x9cb9('0x10')]=_0x2e687e['originalname'][_0x9cb9('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3382c8(null,util[_0x9cb9('0x12')](_0x9cb9('0x13'),path[_0x9cb9('0x14')](_0x2e687e[_0x9cb9('0x10')],path[_0x9cb9('0x15')](_0x2e687e[_0x9cb9('0x10')])),Date[_0x9cb9('0x16')](),path[_0x9cb9('0x15')](_0x2e687e[_0x9cb9('0x10')])));}})});router[_0x9cb9('0x17')]('/',upload[_0x9cb9('0x18')](_0x9cb9('0x19')),controller[_0x9cb9('0x1a')]);router[_0x9cb9('0x17')](_0x9cb9('0x9'),controller[_0x9cb9('0x1b')]);router[_0x9cb9('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x9cb9('0x1d')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9cb9('0x1e')]);module['exports']=router;
\ No newline at end of file
index 28ad548..4fbda3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c1d=['script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x1c1d,0x97));var _0xd1c1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c1d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd1c1('0x0'));module[_0xd1c1('0x1')]={'name':{'type':Sequelize[_0xd1c1('0x2')]},'type':{'type':Sequelize[_0xd1c1('0x3')](_0xd1c1('0x4'),_0xd1c1('0x5'))},'description':{'type':Sequelize[_0xd1c1('0x6')]},'version':{'type':Sequelize[_0xd1c1('0x6')]},'path':{'type':Sequelize[_0xd1c1('0x2')],'comment':_0xd1c1('0x7')},'active':{'type':Sequelize[_0xd1c1('0x8')],'defaultValue':0x0,'comment':_0xd1c1('0x9')},'sidebar':{'type':Sequelize[_0xd1c1('0x3')]('adminOnly',_0xd1c1('0xa'),_0xd1c1('0xb'),'never'),'defaultValue':_0xd1c1('0xb'),'comment':_0xd1c1('0xc')},'icon':{'type':Sequelize[_0xd1c1('0x2')]},'adminUrl':{'type':Sequelize[_0xd1c1('0x2')]},'agentUrl':{'type':Sequelize[_0xd1c1('0x2')]},'scriptName':{'type':Sequelize[_0xd1c1('0x2')]},'scriptPath':{'type':Sequelize[_0xd1c1('0x2')]}};
\ No newline at end of file
+var _0x1d70=['TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script'];(function(_0x3eeef3,_0x17fe78){var _0x1026ce=function(_0x2df8bb){while(--_0x2df8bb){_0x3eeef3['push'](_0x3eeef3['shift']());}};_0x1026ce(++_0x17fe78);}(_0x1d70,0xea));var _0x01d7=function(_0x44ccf4,_0x1553c6){_0x44ccf4=_0x44ccf4-0x0;var _0x2028ca=_0x1d70[_0x44ccf4];return _0x2028ca;};'use strict';var Sequelize=require(_0x01d7('0x0'));module[_0x01d7('0x1')]={'name':{'type':Sequelize[_0x01d7('0x2')]},'type':{'type':Sequelize[_0x01d7('0x3')](_0x01d7('0x4'),_0x01d7('0x5'))},'description':{'type':Sequelize[_0x01d7('0x6')]},'version':{'type':Sequelize[_0x01d7('0x6')]},'path':{'type':Sequelize[_0x01d7('0x2')],'comment':_0x01d7('0x7')},'active':{'type':Sequelize[_0x01d7('0x8')],'defaultValue':0x0,'comment':_0x01d7('0x9')},'sidebar':{'type':Sequelize[_0x01d7('0x3')](_0x01d7('0xa'),_0x01d7('0xb'),_0x01d7('0xc'),_0x01d7('0xd')),'defaultValue':_0x01d7('0xc'),'comment':_0x01d7('0xe')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x01d7('0x2')]},'agentUrl':{'type':Sequelize[_0x01d7('0x2')]},'scriptName':{'type':Sequelize[_0x01d7('0x2')]},'scriptPath':{'type':Sequelize['STRING']}};
\ No newline at end of file
index d91ae3f..2da8bc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5588=['papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./plugin.socket','register','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','name','send','map','Plugin','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','download','join','server/files/plugins','format','%s.zip','basename','path','warning','code','ENOENT','Error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','root','dirname','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','chmodSync','readdirSync','length','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','hostname','http://localhost:','port','encoding','%s%s','headers','content-length','content-type','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','method','eml-format','rimraf','moment','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv'];(function(_0x182594,_0x18b7d1){var _0x4ec8e7=function(_0x49e624){while(--_0x49e624){_0x182594['push'](_0x182594['shift']());}};_0x4ec8e7(++_0x18b7d1);}(_0x5588,0x99));var _0x8558=function(_0xdefe29,_0x3ce7ab){_0xdefe29=_0xdefe29-0x0;var _0x421ba1=_0x5588[_0xdefe29];return _0x421ba1;};'use strict';var emlformat=require(_0x8558('0x0'));var rimraf=require(_0x8558('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8558('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8558('0x3'));var path=require('path');var sox=require(_0x8558('0x4'));var csv=require('to-csv');var ejs=require(_0x8558('0x5'));var fs=require('fs');var fs_extra=require(_0x8558('0x6'));var _=require(_0x8558('0x7'));var squel=require('squel');var crypto=require(_0x8558('0x8'));var jsforce=require(_0x8558('0x9'));var deskjs=require(_0x8558('0xa'));var toCsv=require(_0x8558('0xb'));var querystring=require('querystring');var Papa=require(_0x8558('0xc'));var extract=require(_0x8558('0xd'));var rimraf=require(_0x8558('0x1'));var archiver=require(_0x8558('0xe'));var Redis=require(_0x8558('0xf'));var authService=require(_0x8558('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8558('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8558('0x12'));var utils=require(_0x8558('0x13'));var config=require(_0x8558('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8558('0x15'))['db'];config['redis']=_['defaults'](config[_0x8558('0x16')],{'host':_0x8558('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8558('0x16')]));require(_0x8558('0x18'))[_0x8558('0x19')](socket);function respondWithStatusCode(_0x54cf41,_0x52e511){_0x52e511=_0x52e511||0xcc;return function(_0x2b0c64){if(_0x2b0c64){return _0x54cf41['sendStatus'](_0x52e511);}return _0x54cf41['status'](_0x52e511)[_0x8558('0x1a')]();};}function respondWithResult(_0x341066,_0x263c1b){_0x263c1b=_0x263c1b||0xc8;return function(_0x1f28a7){if(_0x1f28a7){return _0x341066[_0x8558('0x1b')](_0x263c1b)[_0x8558('0x1c')](_0x1f28a7);}};}function respondWithFilteredResult(_0x394809,_0x2a7362){return function(_0x4c4c0a){if(_0x4c4c0a){var _0x34e1cb=typeof _0x2a7362[_0x8558('0x1d')]==='undefined'&&typeof _0x2a7362[_0x8558('0x1e')]===_0x8558('0x1f');var _0x2dd33f=_0x4c4c0a[_0x8558('0x20')];var _0x4d2793=_0x34e1cb?0x0:_0x2a7362[_0x8558('0x1d')];var _0x1fa924=_0x34e1cb?_0x4c4c0a[_0x8558('0x20')]:_0x2a7362['offset']+_0x2a7362[_0x8558('0x1e')];var _0x3db61c;if(_0x1fa924>=_0x2dd33f){_0x1fa924=_0x2dd33f;_0x3db61c=0xc8;}else{_0x3db61c=0xce;}_0x394809[_0x8558('0x1b')](_0x3db61c);return _0x394809[_0x8558('0x21')](_0x8558('0x22'),_0x4d2793+'-'+_0x1fa924+'/'+_0x2dd33f)['json'](_0x4c4c0a);}return null;};}function patchUpdates(_0x3c1643){return function(_0x68ad32){try{jsonpatch[_0x8558('0x23')](_0x68ad32,_0x3c1643,!![]);}catch(_0x8857d0){return BPromise[_0x8558('0x24')](_0x8857d0);}return _0x68ad32[_0x8558('0x25')]();};}function saveUpdates(_0x2a9494,_0x182b8a){return function(_0x4433fc){if(_0x4433fc){return _0x4433fc[_0x8558('0x26')](_0x2a9494)[_0x8558('0x27')](function(_0x2fc345){return _0x2fc345;});}return null;};}function removeEntity(_0x45ea05,_0x15ac28){return function(_0x30821f){if(_0x30821f){return _0x30821f[_0x8558('0x28')]()[_0x8558('0x27')](function(){var _0x56e2c8=_0x30821f[_0x8558('0x29')]({'plain':!![]});var _0x2176c2='Plugins';return db[_0x8558('0x2a')]['destroy']({'where':{'type':_0x2176c2,'resourceId':_0x56e2c8['id']}})[_0x8558('0x27')](function(){return _0x30821f;});})[_0x8558('0x27')](function(){_0x45ea05[_0x8558('0x1b')](0xcc)[_0x8558('0x1a')]();});}};}function handleEntityNotFound(_0x4cdf99,_0x2bb7e3){return function(_0x38ac78){if(!_0x38ac78){_0x4cdf99[_0x8558('0x2b')](0x194);}return _0x38ac78;};}function handleError(_0x4c162e,_0x25bb6c){_0x25bb6c=_0x25bb6c||0x1f4;return function(_0x4f017f){logger[_0x8558('0x2c')](_0x4f017f['stack']);if(_0x4f017f[_0x8558('0x2d')]){delete _0x4f017f[_0x8558('0x2d')];}_0x4c162e[_0x8558('0x1b')](_0x25bb6c)[_0x8558('0x2e')](_0x4f017f);};}exports['index']=function(_0x22120f,_0x1081ec){var _0x3aa3a2={},_0x5111c6={},_0x7aa65c={'count':0x0,'rows':[]};var _0xa86655=_[_0x8558('0x2f')](db[_0x8558('0x30')]['rawAttributes'],function(_0x5ace40){return{'name':_0x5ace40[_0x8558('0x31')],'type':_0x5ace40[_0x8558('0x32')][_0x8558('0x33')]};});_0x5111c6[_0x8558('0x34')]=_['map'](_0xa86655,_0x8558('0x2d'));_0x5111c6['query']=_[_0x8558('0x35')](_0x22120f['query']);_0x5111c6[_0x8558('0x36')]=_[_0x8558('0x37')](_0x5111c6[_0x8558('0x34')],_0x5111c6[_0x8558('0x38')]);_0x3aa3a2[_0x8558('0x39')]=_[_0x8558('0x37')](_0x5111c6[_0x8558('0x34')],qs[_0x8558('0x3a')](_0x22120f['query']['fields']));_0x3aa3a2[_0x8558('0x39')]=_0x3aa3a2[_0x8558('0x39')]['length']?_0x3aa3a2['attributes']:_0x5111c6['model'];if(!_0x22120f[_0x8558('0x38')]['hasOwnProperty']('nolimit')){_0x3aa3a2[_0x8558('0x1e')]=qs[_0x8558('0x1e')](_0x22120f[_0x8558('0x38')][_0x8558('0x1e')]);_0x3aa3a2['offset']=qs[_0x8558('0x1d')](_0x22120f['query'][_0x8558('0x1d')]);}_0x3aa3a2['order']=qs[_0x8558('0x3b')](_0x22120f['query']['sort']);_0x3aa3a2[_0x8558('0x3c')]=qs[_0x8558('0x36')](_[_0x8558('0x3d')](_0x22120f['query'],_0x5111c6['filters']),_0xa86655);if(_0x22120f[_0x8558('0x38')][_0x8558('0x3e')]){_0x3aa3a2[_0x8558('0x3c')]=_['merge'](_0x3aa3a2[_0x8558('0x3c')],{'$or':_[_0x8558('0x2f')](_0xa86655,function(_0x1fd3e6){if(_0x1fd3e6[_0x8558('0x32')]!==_0x8558('0x3f')){var _0x31061e={};_0x31061e[_0x1fd3e6[_0x8558('0x2d')]]={'$like':'%'+_0x22120f[_0x8558('0x38')]['filter']+'%'};return _0x31061e;}})});}_0x3aa3a2=_['merge']({},_0x3aa3a2,_0x22120f[_0x8558('0x40')]);var _0x4cf9ab={'where':_0x3aa3a2['where']};return db[_0x8558('0x30')][_0x8558('0x20')](_0x4cf9ab)[_0x8558('0x27')](function(_0x18daca){_0x7aa65c['count']=_0x18daca;if(_0x22120f[_0x8558('0x38')][_0x8558('0x41')]){_0x3aa3a2[_0x8558('0x42')]=[{'all':!![]}];}return db[_0x8558('0x30')][_0x8558('0x43')](_0x3aa3a2);})[_0x8558('0x27')](function(_0x29b08a){_0x7aa65c[_0x8558('0x44')]=_0x29b08a;return _0x7aa65c;})[_0x8558('0x27')](respondWithFilteredResult(_0x1081ec,_0x3aa3a2))[_0x8558('0x45')](handleError(_0x1081ec,null));};exports[_0x8558('0x46')]=function(_0xe2d9af,_0x5a0a08){var _0x3c2f75={'raw':!![],'where':{'id':_0xe2d9af[_0x8558('0x47')]['id']}},_0x3d65b2={};_0x3d65b2[_0x8558('0x34')]=_[_0x8558('0x35')](db['Plugin'][_0x8558('0x48')]);_0x3d65b2['query']=_[_0x8558('0x35')](_0xe2d9af['query']);_0x3d65b2[_0x8558('0x36')]=_[_0x8558('0x37')](_0x3d65b2[_0x8558('0x34')],_0x3d65b2[_0x8558('0x38')]);_0x3c2f75[_0x8558('0x39')]=_[_0x8558('0x37')](_0x3d65b2['model'],qs['fields'](_0xe2d9af[_0x8558('0x38')][_0x8558('0x3a')]));_0x3c2f75['attributes']=_0x3c2f75[_0x8558('0x39')]['length']?_0x3c2f75[_0x8558('0x39')]:_0x3d65b2['model'];if(_0xe2d9af[_0x8558('0x38')][_0x8558('0x41')]){_0x3c2f75[_0x8558('0x42')]=[{'all':!![]}];}_0x3c2f75=_[_0x8558('0x49')]({},_0x3c2f75,_0xe2d9af[_0x8558('0x40')]);return db[_0x8558('0x30')][_0x8558('0x4a')](_0x3c2f75)[_0x8558('0x27')](handleEntityNotFound(_0x5a0a08,null))[_0x8558('0x27')](respondWithResult(_0x5a0a08,null))[_0x8558('0x45')](handleError(_0x5a0a08,null));};exports[_0x8558('0x4b')]=function(_0x186ae9,_0x95c77a,_0xfc0bdd){return db[_0x8558('0x30')][_0x8558('0x4a')]({'where':{'id':_0x186ae9['params']['id']},'attributes':[_0x8558('0x2d'),'path'],'raw':!![]})['then'](handleEntityNotFound(_0x95c77a,null))[_0x8558('0x27')](function(_0x1f8239){if(_0x1f8239){var _0x59995f=path[_0x8558('0x4c')](config['root'],_0x8558('0x4d'),util[_0x8558('0x4e')](_0x8558('0x4f'),path[_0x8558('0x50')](_0x1f8239[_0x8558('0x51')])));var _0x409348=fs['createWriteStream'](_0x59995f);var _0x5b902f=archiver('zip',{'zlib':{'level':0x9}});_0x5b902f['on'](_0x8558('0x52'),function(_0x43376f){if(_0x43376f[_0x8558('0x53')]===_0x8558('0x54')){logger[_0x8558('0x2c')](_0x43376f);}else{throw new db['Sequelize'][(_0x8558('0x55'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x5b902f['on']('error',function(_0x2e116b){throw new db[(_0x8558('0x56'))][(_0x8558('0x55'))](_0x8558('0x57'));});_0x5b902f['pipe'](_0x409348);_0x5b902f[_0x8558('0x58')](_0x8558('0x59'),{'cwd':path[_0x8558('0x4c')](config[_0x8558('0x5a')],_0x8558('0x4d'),path[_0x8558('0x5b')](_0x1f8239[_0x8558('0x51')])),'ignore':[path[_0x8558('0x4c')](path['basename'](_0x1f8239[_0x8558('0x51')]),'node_modules/**/*'),path[_0x8558('0x4c')](path['basename'](_0x1f8239['path']),'attachments/**/*')],'nodir':!![]})[_0x8558('0x5c')]();_0x409348['on'](_0x8558('0x5d'),function(){if(!fs[_0x8558('0x5e')](_0x59995f)){throw new db[(_0x8558('0x56'))][(_0x8558('0x55'))](_0x8558('0x5f'));}return _0x95c77a['download'](_0x59995f,util['format'](_0x8558('0x4f'),path[_0x8558('0x50')](_0x1f8239[_0x8558('0x51')])),function(_0x1afea7){if(_0x1afea7){throw new db[(_0x8558('0x56'))][(_0x8558('0x55'))](_0x8558('0x60'));}fs[_0x8558('0x61')](_0x59995f);logger[_0x8558('0x62')](_0x8558('0x63'));logger[_0x8558('0x62')](_0x8558('0x64'));});});}return null;})['catch'](handleError(_0x95c77a,null));};exports[_0x8558('0x65')]=function(_0x57b2ec,_0x257e19,_0x35221e){var _0x5f0a57=path[_0x8558('0x50')](_0x57b2ec['file'][_0x8558('0x66')],path[_0x8558('0x67')](_0x57b2ec[_0x8558('0x68')][_0x8558('0x66')]));var _0x38e78f=path['join'](config[_0x8558('0x5a')],_0x8558('0x4d'),_0x57b2ec['file']['filename']);var _0x305e=path[_0x8558('0x4c')](config[_0x8558('0x5a')],_0x8558('0x4d'),_0x5f0a57);logger[_0x8558('0x62')](_0x8558('0x69'),_0x38e78f);logger[_0x8558('0x62')]('Plugin\x20upload\x20destination:\x20%s',_0x305e);try{fs[_0x8558('0x6a')](_0x38e78f,parseInt('0777',0x8));extract(_0x38e78f,{'dir':_0x305e},function(_0x4ad07c){if(_0x4ad07c){logger['error'](_0x4ad07c);handleError(_0x4ad07c,!![]);};var _0x505ac2=fs[_0x8558('0x6b')](_0x305e);if(_0x505ac2[_0x8558('0x6c')]>0x1){removeReferences(_0x38e78f,_0x305e);logger[_0x8558('0x2c')](_0x8558('0x6d'));return _0x35221e(new Error(_0x8558('0x6d')));}var _0x2f212a=fs[_0x8558('0x6e')](path['join'](_0x305e,_0x505ac2[0x0]));if(_0x2f212a[_0x8558('0x6f')]()){removeReferences(_0x38e78f,_0x305e);logger[_0x8558('0x2c')](_0x8558('0x6d'));return _0x35221e(new Error(_0x8558('0x6d')));}if(_0x2f212a[_0x8558('0x70')]()){var _0x34cde8=fs[_0x8558('0x6b')](path[_0x8558('0x4c')](_0x305e,_0x505ac2[0x0]));if(_0x34cde8[_0x8558('0x6c')]===0x0){removeReferences(_0x38e78f,_0x305e);logger[_0x8558('0x2c')]('Invalid\x20plugin\x20structure');return _0x35221e(new Error(_0x8558('0x6d')));}var _0x32425d=_0x34cde8[_0x8558('0x71')](function(_0x356a2f){return _0x356a2f===_0x8558('0x72');});if(!_0x32425d){return _0x35221e(new Error(_0x8558('0x73')));}var _0x359044=fs[_0x8558('0x74')](path[_0x8558('0x4c')](_0x305e,_0x505ac2[0x0],'manifest.json'));var _0x4667fe=JSON[_0x8558('0x75')](_0x359044);if(_0x8558('0x1f')==typeof _0x4667fe[_0x8558('0x2d')]){return _0x35221e(new Error(_0x8558('0x76')));}if(_0x8558('0x1f')==typeof _0x4667fe[_0x8558('0x32')]){return _0x35221e(new Error(_0x8558('0x77')));}if(_0x8558('0x1f')==typeof _0x4667fe[_0x8558('0x78')]){return _0x35221e(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x8558('0x1f')==typeof _0x4667fe[_0x8558('0x79')]){return _0x35221e(new Error(_0x8558('0x7a')));}if(_0x4667fe[_0x8558('0x32')]===_0x8558('0x7b')){if(_0x8558('0x1f')==typeof _0x4667fe['parameters']['views']){return _0x35221e(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x4667fe['parameters'][_0x8558('0x7c')][_0x8558('0x7d')]&&'undefined'==typeof _0x4667fe[_0x8558('0x79')]['views']['agent']){return _0x35221e(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x4667fe[_0x8558('0x32')]===_0x8558('0x7e')){if('undefined'==typeof _0x4667fe[_0x8558('0x79')][_0x8558('0x7f')]){return _0x35221e(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x8558('0x1f')==typeof _0x4667fe['parameters'][_0x8558('0x80')]){return _0x35221e(new Error(_0x8558('0x81')));}}else{return _0x35221e(new Error(_0x8558('0x82')));}var _0x3156a9=_0x4667fe['name'];var _0x3b1348=_0x4667fe['description'];var _0x3a4105=_0x4667fe[_0x8558('0x32')];var _0x1096f5=_0x4667fe['sidebar']?_0x4667fe[_0x8558('0x83')]:_0x8558('0x84');var _0x231382=_0x4667fe['icon']?_0x4667fe['icon']:_0x8558('0x85');var _0x2e5eec='';var _0x29ffaf='';var _0x7110cb='';var _0x451db4='';var _0x16f800=_0x4667fe[_0x8558('0x78')];if(_0x3a4105===_0x8558('0x7b')){if(_0x8558('0x1f')!=typeof _0x4667fe[_0x8558('0x79')]['views'][_0x8558('0x7d')]){var _0x3c1dda=_0x4667fe[_0x8558('0x79')][_0x8558('0x7c')][_0x8558('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x8558('0x86')](_0x3c1dda)){_0x2e5eec=path['join'](_0x8558('0x87'),_0x5f0a57,_0x505ac2[0x0],_0x3c1dda);}else{_0x2e5eec=_0x3c1dda;}}else{logger[_0x8558('0x62')](_0x8558('0x88'));}if(_0x8558('0x1f')!=typeof _0x4667fe[_0x8558('0x79')][_0x8558('0x7c')][_0x8558('0x89')]){var _0x23f8ca=_0x4667fe[_0x8558('0x79')][_0x8558('0x7c')][_0x8558('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x8558('0x86')](_0x23f8ca)){_0x29ffaf=path['join']('plugins',_0x5f0a57,_0x505ac2[0x0],_0x23f8ca);}else{_0x29ffaf=_0x23f8ca;}}else{logger[_0x8558('0x62')](_0x8558('0x8a'));}}else if(_0x3a4105===_0x8558('0x7e')){_0x7110cb=_0x4667fe['parameters'][_0x8558('0x7f')];_0x451db4=_0x4667fe[_0x8558('0x79')]['scriptPath'];if(_0x8558('0x1f')!=typeof _0x4667fe[_0x8558('0x79')][_0x8558('0x7c')]){if(_0x8558('0x1f')!=typeof _0x4667fe[_0x8558('0x79')][_0x8558('0x7c')]['admin']){var _0x3c1dda=_0x4667fe[_0x8558('0x79')]['views'][_0x8558('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x8558('0x86')](_0x3c1dda)){_0x2e5eec=path[_0x8558('0x4c')](_0x8558('0x87'),_0x5f0a57,_0x505ac2[0x0],_0x3c1dda);}else{_0x2e5eec=_0x3c1dda;}}if('undefined'!=typeof _0x4667fe['parameters'][_0x8558('0x7c')][_0x8558('0x89')]){var _0x23f8ca=_0x4667fe[_0x8558('0x79')][_0x8558('0x7c')][_0x8558('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x8558('0x86')](_0x23f8ca)){_0x29ffaf=path[_0x8558('0x4c')](_0x8558('0x87'),_0x5f0a57,_0x505ac2[0x0],_0x23f8ca);}else{_0x29ffaf=_0x23f8ca;}}}}var _0x5d5c4a={'name':_0x3156a9,'description':_0x3b1348,'path':path[_0x8558('0x4c')](_0x5f0a57,_0x505ac2[0x0]),'type':_0x3a4105,'sidebar':_0x1096f5,'icon':_0x231382,'adminUrl':_0x2e5eec,'agentUrl':_0x29ffaf,'scriptName':_0x7110cb,'scriptPath':_0x451db4,'version':_0x16f800};removeReferences(_0x38e78f,null);return db[_0x8558('0x30')][_0x8558('0x8b')](_0x5d5c4a)[_0x8558('0x27')](function(_0x413871){var _0xbda7aa={'role':_0x57b2ec[_0x8558('0x8c')][_0x8558('0x8d')],'userProfileId':_0x57b2ec[_0x8558('0x8c')][_0x8558('0x8e')]};if(!_0xbda7aa)throw new Error(_0x8558('0x8f'));if(_0xbda7aa['role']===_0x8558('0x90')){var _0x13b49d=_0x413871[_0x8558('0x29')]({'plain':!![]});return db[_0x8558('0x91')][_0x8558('0x4a')]({'where':{'name':'Plugins','userProfileId':_0xbda7aa['userProfileId']},'raw':!![]})[_0x8558('0x27')](function(_0x500c9b){if(_0x500c9b&&_0x500c9b[_0x8558('0x92')]===0x0){return db['UserProfileResource'][_0x8558('0x8b')]({'name':_0x13b49d[_0x8558('0x2d')],'resourceId':_0x13b49d['id'],'type':_0x500c9b['name'],'sectionId':_0x500c9b['id']},{})['then'](function(){return _0x413871;});}else{return _0x413871;}})[_0x8558('0x45')](function(_0x3d227e){logger[_0x8558('0x2c')](_0x8558('0x93'),_0x3d227e);throw _0x3d227e;});}return _0x413871;})[_0x8558('0x27')](respondWithResult(_0x257e19,null))[_0x8558('0x45')](handleError(_0x257e19,null));}});}catch(_0x3e9692){_0x257e19[_0x8558('0x1b')](0x1f4)[_0x8558('0x2e')](_0x3e9692);}};function removeReferences(_0x245c20,_0x87f1b9){try{if(_0x245c20){fs[_0x8558('0x61')](_0x245c20);logger[_0x8558('0x62')](_0x8558('0x94'));}if(_0x87f1b9){rimraf(_0x87f1b9,function(){});logger[_0x8558('0x62')](_0x8558('0x95'));}}catch(_0x18bb94){logger[_0x8558('0x2c')](_0x18bb94);}}exports[_0x8558('0x26')]=function(_0xbcc7b6,_0x16d612,_0x346b21){return db[_0x8558('0x30')][_0x8558('0x4a')]({'where':{'id':_0xbcc7b6[_0x8558('0x47')]['id']}})[_0x8558('0x27')](handleEntityNotFound(_0x16d612,null))['then'](saveUpdates(_0xbcc7b6[_0x8558('0x8c')],null))[_0x8558('0x27')](respondWithResult(_0x16d612,null))[_0x8558('0x45')](handleError(_0x16d612,null));};exports[_0x8558('0x96')]=function(_0x11013d,_0x3a8a4a,_0x17bea1){return db[_0x8558('0x30')][_0x8558('0x4a')]({'where':{'id':_0x11013d[_0x8558('0x47')]['id']}})['then'](function(_0x143be6){if(_0x143be6){return _0x143be6['destroy']();}})[_0x8558('0x27')](function(_0x631b7a){rimraf(path[_0x8558('0x4c')](config['root'],_0x8558('0x4d'),path['dirname'](_0x631b7a[_0x8558('0x51')])),function(){});return _0x631b7a;})[_0x8558('0x27')](handleEntityNotFound(_0x3a8a4a,null))['then'](respondWithStatusCode(_0x3a8a4a,null))['catch'](handleError(_0x3a8a4a,null));};exports['webhookGet']=function(_0x54ed3c,_0x1071c7,_0x1f88e7){return BPromise[_0x8558('0x97')]()[_0x8558('0x27')](function(){if(!_0x54ed3c[_0x8558('0x38')][_0x8558('0x51')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x54ed3c['query']['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2567e2=_0x54ed3c[_0x8558('0x38')][_0x8558('0x98')]?_0x54ed3c[_0x8558('0x38')][_0x8558('0x98')]+':'+_0x54ed3c[_0x8558('0x38')]['port']:_0x8558('0x99')+_0x54ed3c[_0x8558('0x38')][_0x8558('0x9a')];var _0x2914c2=_0x54ed3c[_0x8558('0x38')]['json']?_0x54ed3c['query'][_0x8558('0x1c')]:!![];var _0xb560c7=_0x54ed3c['query'][_0x8558('0x9b')]?_0x54ed3c[_0x8558('0x38')][_0x8558('0x9b')]:null;var _0x4cc616={'method':_0x54ed3c['method'],'uri':util['format'](_0x8558('0x9c'),_0x2567e2,_0x54ed3c[_0x8558('0x38')][_0x8558('0x51')]),'json':_0x2914c2,'resolveWithFullResponse':!![],'encoding':_0xb560c7,'qs':_0x54ed3c['query']};if(_0x54ed3c['headers']){_0x4cc616[_0x8558('0x9d')]=_0x54ed3c[_0x8558('0x9d')];if(_0x4cc616[_0x8558('0x9d')]['content-length']){delete _0x4cc616[_0x8558('0x9d')][_0x8558('0x9e')];}}if(_0x4cc616[_0x8558('0x9d')][_0x8558('0x9f')]){delete _0x4cc616[_0x8558('0x9d')][_0x8558('0x9f')];}return rp(_0x4cc616);})[_0x8558('0x27')](function(_0x29c08c){if(_0x29c08c){_0x1071c7[_0x8558('0x21')](_0x29c08c[_0x8558('0x9d')]);logger[_0x8558('0x62')](_0x29c08c[_0x8558('0x8c')]);if(_['endsWith'](_0x54ed3c[_0x8558('0x38')][_0x8558('0x51')],_0x8558('0x4b'))&&_0x29c08c[_0x8558('0xa0')]==0x1f4){return _0x1071c7[_0x8558('0x2b')](_0x29c08c[_0x8558('0xa0')]);}else{return _0x1071c7[_0x8558('0x1b')](_0x29c08c[_0x8558('0xa0')])[_0x8558('0x2e')](_0x29c08c[_0x8558('0x8c')]);}}else{return _0x1071c7[_0x8558('0x2b')](0xc8);}})['catch'](handleError(_0x1071c7,null));};exports[_0x8558('0xa1')]=function(_0x5210b1,_0xed4ea2,_0x44c53b){return BPromise[_0x8558('0x97')]()[_0x8558('0x27')](function(){if(!_0x5210b1[_0x8558('0x38')]['path']){throw new Error(_0x8558('0xa2'));}if(!_0x5210b1['query'][_0x8558('0x9a')]){throw new Error(_0x8558('0xa3'));}var _0xd7c705=_0x5210b1[_0x8558('0x38')]['hostname']?_0x5210b1[_0x8558('0x38')][_0x8558('0x98')]+':'+_0x5210b1['query']['port']:_0x8558('0x99')+_0x5210b1[_0x8558('0x38')]['port'];var _0x17318d=_0x5210b1[_0x8558('0x38')][_0x8558('0x1c')]?_0x5210b1[_0x8558('0x38')]['json']:!![];var _0x5cbc00=_0x5210b1[_0x8558('0x38')][_0x8558('0x9b')]?_0x5210b1['query'][_0x8558('0x9b')]:null;var _0x3d29d5={'method':_0x5210b1[_0x8558('0xa4')],'uri':util[_0x8558('0x4e')](_0x8558('0x9c'),_0xd7c705,_0x5210b1[_0x8558('0x38')][_0x8558('0x51')]),'json':_0x17318d,'resolveWithFullResponse':!![],'encoding':_0x5cbc00,'body':_0x5210b1[_0x8558('0x8c')]};if(_0x5210b1[_0x8558('0x9d')]){_0x3d29d5['headers']=_0x5210b1['headers'];if(_0x3d29d5[_0x8558('0x9d')]['content-length']){delete _0x3d29d5[_0x8558('0x9d')][_0x8558('0x9e')];}}if(_0x3d29d5[_0x8558('0x9d')]['content-type']){delete _0x3d29d5[_0x8558('0x9d')][_0x8558('0x9f')];}return rp(_0x3d29d5);})[_0x8558('0x27')](function(_0x394406){if(_0x394406){_0xed4ea2['set'](_0x394406[_0x8558('0x9d')]);logger['info'](_0x394406[_0x8558('0x8c')]);return _0xed4ea2[_0x8558('0x1b')](_0x394406[_0x8558('0xa0')])[_0x8558('0x2e')](_0x394406[_0x8558('0x8c')]);}else{return _0xed4ea2['sendStatus'](0xc8);}})[_0x8558('0x45')](handleError(_0xed4ea2,null));};
\ No newline at end of file
+var _0x69e0=['destroy','get','Plugins','UserProfileResource','error','stack','name','rawAttributes','type','model','map','query','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','Plugin','includeAll','include','findAll','rows','catch','params','keys','find','download','path','join','root','server/files/plugins','format','zip','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','upload','file','extname','filename','Plugin\x20upload\x20destination:\x20%s','chmodSync','length','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','manifest.json','Plugin\x20manifest\x20missing','parse','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','offset','undefined','limit','count','set','json','reject','save','update','then'];(function(_0x32d0e3,_0x4df014){var _0x4b9285=function(_0x241862){while(--_0x241862){_0x32d0e3['push'](_0x32d0e3['shift']());}};_0x4b9285(++_0x4df014);}(_0x69e0,0x7d));var _0x069e=function(_0x408732,_0x50d08a){_0x408732=_0x408732-0x0;var _0x2c1834=_0x69e0[_0x408732];return _0x2c1834;};'use strict';var emlformat=require(_0x069e('0x0'));var rimraf=require(_0x069e('0x1'));var zipdir=require(_0x069e('0x2'));var jsonpatch=require(_0x069e('0x3'));var rp=require(_0x069e('0x4'));var moment=require(_0x069e('0x5'));var BPromise=require(_0x069e('0x6'));var Mustache=require('mustache');var util=require(_0x069e('0x7'));var path=require('path');var sox=require(_0x069e('0x8'));var csv=require(_0x069e('0x9'));var ejs=require(_0x069e('0xa'));var fs=require('fs');var fs_extra=require(_0x069e('0xb'));var _=require(_0x069e('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x069e('0xd'));var deskjs=require(_0x069e('0xe'));var toCsv=require('to-csv');var querystring=require(_0x069e('0xf'));var Papa=require(_0x069e('0x10'));var extract=require(_0x069e('0x11'));var rimraf=require(_0x069e('0x1'));var archiver=require(_0x069e('0x12'));var Redis=require(_0x069e('0x13'));var authService=require(_0x069e('0x14'));var qs=require(_0x069e('0x15'));var as=require(_0x069e('0x16'));var hardwareService=require(_0x069e('0x17'));var logger=require(_0x069e('0x18'))(_0x069e('0x19'));var utils=require(_0x069e('0x1a'));var config=require(_0x069e('0x1b'));var licenseUtil=require(_0x069e('0x1c'));var db=require(_0x069e('0x1d'))['db'];config[_0x069e('0x1e')]=_['defaults'](config[_0x069e('0x1e')],{'host':_0x069e('0x1f'),'port':0x18eb});var socket=require(_0x069e('0x20'))(new Redis(config['redis']));require('./plugin.socket')[_0x069e('0x21')](socket);function respondWithStatusCode(_0x54d35b,_0x8b1ce6){_0x8b1ce6=_0x8b1ce6||0xcc;return function(_0x2f5408){if(_0x2f5408){return _0x54d35b[_0x069e('0x22')](_0x8b1ce6);}return _0x54d35b['status'](_0x8b1ce6)[_0x069e('0x23')]();};}function respondWithResult(_0x3036e2,_0x568c62){_0x568c62=_0x568c62||0xc8;return function(_0x4102c9){if(_0x4102c9){return _0x3036e2[_0x069e('0x24')](_0x568c62)['json'](_0x4102c9);}};}function respondWithFilteredResult(_0x520497,_0x41817c){return function(_0x3533a9){if(_0x3533a9){var _0x4591d1=typeof _0x41817c[_0x069e('0x25')]===_0x069e('0x26')&&typeof _0x41817c[_0x069e('0x27')]===_0x069e('0x26');var _0x40f0ca=_0x3533a9[_0x069e('0x28')];var _0x345f4e=_0x4591d1?0x0:_0x41817c[_0x069e('0x25')];var _0x4aea14=_0x4591d1?_0x3533a9['count']:_0x41817c['offset']+_0x41817c[_0x069e('0x27')];var _0x51e1a2;if(_0x4aea14>=_0x40f0ca){_0x4aea14=_0x40f0ca;_0x51e1a2=0xc8;}else{_0x51e1a2=0xce;}_0x520497[_0x069e('0x24')](_0x51e1a2);return _0x520497[_0x069e('0x29')]('Content-Range',_0x345f4e+'-'+_0x4aea14+'/'+_0x40f0ca)[_0x069e('0x2a')](_0x3533a9);}return null;};}function patchUpdates(_0x5743eb){return function(_0x13d52f){try{jsonpatch['apply'](_0x13d52f,_0x5743eb,!![]);}catch(_0x2caa6d){return BPromise[_0x069e('0x2b')](_0x2caa6d);}return _0x13d52f[_0x069e('0x2c')]();};}function saveUpdates(_0x589ba5,_0x2f1441){return function(_0x5565d4){if(_0x5565d4){return _0x5565d4[_0x069e('0x2d')](_0x589ba5)[_0x069e('0x2e')](function(_0x508a6a){return _0x508a6a;});}return null;};}function removeEntity(_0x325859,_0x181761){return function(_0x2b4a1c){if(_0x2b4a1c){return _0x2b4a1c[_0x069e('0x2f')]()[_0x069e('0x2e')](function(){var _0x5b08a1=_0x2b4a1c[_0x069e('0x30')]({'plain':!![]});var _0x1e96c4=_0x069e('0x31');return db[_0x069e('0x32')][_0x069e('0x2f')]({'where':{'type':_0x1e96c4,'resourceId':_0x5b08a1['id']}})[_0x069e('0x2e')](function(){return _0x2b4a1c;});})['then'](function(){_0x325859['status'](0xcc)[_0x069e('0x23')]();});}};}function handleEntityNotFound(_0x15152f,_0x17490a){return function(_0x40a461){if(!_0x40a461){_0x15152f['sendStatus'](0x194);}return _0x40a461;};}function handleError(_0xac1f5c,_0x5b1ee3){_0x5b1ee3=_0x5b1ee3||0x1f4;return function(_0x2506ba){logger[_0x069e('0x33')](_0x2506ba[_0x069e('0x34')]);if(_0x2506ba[_0x069e('0x35')]){delete _0x2506ba['name'];}_0xac1f5c[_0x069e('0x24')](_0x5b1ee3)['send'](_0x2506ba);};}exports['index']=function(_0x26a1f8,_0x18f658){var _0x193981={},_0x3bc210={},_0x1a9056={'count':0x0,'rows':[]};var _0x3e3a23=_['map'](db['Plugin'][_0x069e('0x36')],function(_0x111053){return{'name':_0x111053['fieldName'],'type':_0x111053[_0x069e('0x37')]['key']};});_0x3bc210[_0x069e('0x38')]=_[_0x069e('0x39')](_0x3e3a23,_0x069e('0x35'));_0x3bc210['query']=_['keys'](_0x26a1f8[_0x069e('0x3a')]);_0x3bc210['filters']=_[_0x069e('0x3b')](_0x3bc210['model'],_0x3bc210[_0x069e('0x3a')]);_0x193981[_0x069e('0x3c')]=_[_0x069e('0x3b')](_0x3bc210[_0x069e('0x38')],qs['fields'](_0x26a1f8[_0x069e('0x3a')][_0x069e('0x3d')]));_0x193981[_0x069e('0x3c')]=_0x193981[_0x069e('0x3c')]['length']?_0x193981[_0x069e('0x3c')]:_0x3bc210[_0x069e('0x38')];if(!_0x26a1f8[_0x069e('0x3a')][_0x069e('0x3e')]('nolimit')){_0x193981[_0x069e('0x27')]=qs[_0x069e('0x27')](_0x26a1f8['query'][_0x069e('0x27')]);_0x193981[_0x069e('0x25')]=qs[_0x069e('0x25')](_0x26a1f8[_0x069e('0x3a')][_0x069e('0x25')]);}_0x193981['order']=qs[_0x069e('0x3f')](_0x26a1f8[_0x069e('0x3a')][_0x069e('0x3f')]);_0x193981[_0x069e('0x40')]=qs[_0x069e('0x41')](_[_0x069e('0x42')](_0x26a1f8[_0x069e('0x3a')],_0x3bc210['filters']),_0x3e3a23);if(_0x26a1f8[_0x069e('0x3a')][_0x069e('0x43')]){_0x193981[_0x069e('0x40')]=_[_0x069e('0x44')](_0x193981[_0x069e('0x40')],{'$or':_[_0x069e('0x39')](_0x3e3a23,function(_0x54ae9c){if(_0x54ae9c[_0x069e('0x37')]!==_0x069e('0x45')){var _0x322cdd={};_0x322cdd[_0x54ae9c[_0x069e('0x35')]]={'$like':'%'+_0x26a1f8[_0x069e('0x3a')][_0x069e('0x43')]+'%'};return _0x322cdd;}})});}_0x193981=_[_0x069e('0x44')]({},_0x193981,_0x26a1f8[_0x069e('0x46')]);var _0x2132fc={'where':_0x193981[_0x069e('0x40')]};return db[_0x069e('0x47')][_0x069e('0x28')](_0x2132fc)['then'](function(_0x45ded7){_0x1a9056[_0x069e('0x28')]=_0x45ded7;if(_0x26a1f8[_0x069e('0x3a')][_0x069e('0x48')]){_0x193981[_0x069e('0x49')]=[{'all':!![]}];}return db[_0x069e('0x47')][_0x069e('0x4a')](_0x193981);})[_0x069e('0x2e')](function(_0xc8f780){_0x1a9056[_0x069e('0x4b')]=_0xc8f780;return _0x1a9056;})[_0x069e('0x2e')](respondWithFilteredResult(_0x18f658,_0x193981))[_0x069e('0x4c')](handleError(_0x18f658,null));};exports['show']=function(_0x430831,_0x23cdd5){var _0x4a311d={'raw':!![],'where':{'id':_0x430831[_0x069e('0x4d')]['id']}},_0x7e4647={};_0x7e4647[_0x069e('0x38')]=_[_0x069e('0x4e')](db['Plugin'][_0x069e('0x36')]);_0x7e4647[_0x069e('0x3a')]=_['keys'](_0x430831['query']);_0x7e4647[_0x069e('0x41')]=_[_0x069e('0x3b')](_0x7e4647[_0x069e('0x38')],_0x7e4647['query']);_0x4a311d['attributes']=_['intersection'](_0x7e4647[_0x069e('0x38')],qs[_0x069e('0x3d')](_0x430831[_0x069e('0x3a')]['fields']));_0x4a311d['attributes']=_0x4a311d[_0x069e('0x3c')]['length']?_0x4a311d['attributes']:_0x7e4647[_0x069e('0x38')];if(_0x430831['query'][_0x069e('0x48')]){_0x4a311d[_0x069e('0x49')]=[{'all':!![]}];}_0x4a311d=_['merge']({},_0x4a311d,_0x430831[_0x069e('0x46')]);return db[_0x069e('0x47')][_0x069e('0x4f')](_0x4a311d)[_0x069e('0x2e')](handleEntityNotFound(_0x23cdd5,null))['then'](respondWithResult(_0x23cdd5,null))[_0x069e('0x4c')](handleError(_0x23cdd5,null));};exports[_0x069e('0x50')]=function(_0x2431aa,_0xba33b0,_0x5aa4be){return db['Plugin'][_0x069e('0x4f')]({'where':{'id':_0x2431aa[_0x069e('0x4d')]['id']},'attributes':['name',_0x069e('0x51')],'raw':!![]})[_0x069e('0x2e')](handleEntityNotFound(_0xba33b0,null))['then'](function(_0x4ceec7){if(_0x4ceec7){var _0x24c03b=path[_0x069e('0x52')](config[_0x069e('0x53')],_0x069e('0x54'),util[_0x069e('0x55')]('%s.zip',path['basename'](_0x4ceec7[_0x069e('0x51')])));var _0x1f1a8c=fs['createWriteStream'](_0x24c03b);var _0x3baea2=archiver(_0x069e('0x56'),{'zlib':{'level':0x9}});_0x3baea2['on'](_0x069e('0x57'),function(_0x2d03e5){if(_0x2d03e5[_0x069e('0x58')]==='ENOENT'){logger[_0x069e('0x33')](_0x2d03e5);}else{throw new db[(_0x069e('0x59'))][(_0x069e('0x5a'))](_0x069e('0x5b'));}});_0x3baea2['on']('error',function(_0x2b97dd){throw new db['Sequelize'][(_0x069e('0x5a'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x3baea2[_0x069e('0x5c')](_0x1f1a8c);_0x3baea2[_0x069e('0x5d')]('**/*',{'cwd':path[_0x069e('0x52')](config[_0x069e('0x53')],'server/files/plugins',path[_0x069e('0x5e')](_0x4ceec7[_0x069e('0x51')])),'ignore':[path[_0x069e('0x52')](path[_0x069e('0x5f')](_0x4ceec7[_0x069e('0x51')]),_0x069e('0x60')),path[_0x069e('0x52')](path[_0x069e('0x5f')](_0x4ceec7[_0x069e('0x51')]),_0x069e('0x61'))],'nodir':!![]})[_0x069e('0x62')]();_0x1f1a8c['on'](_0x069e('0x63'),function(){if(!fs[_0x069e('0x64')](_0x24c03b)){throw new db[(_0x069e('0x59'))][(_0x069e('0x5a'))](_0x069e('0x65'));}return _0xba33b0['download'](_0x24c03b,util[_0x069e('0x55')](_0x069e('0x66'),path[_0x069e('0x5f')](_0x4ceec7[_0x069e('0x51')])),function(_0x17e84b){if(_0x17e84b){throw new db[(_0x069e('0x59'))]['Error'](_0x069e('0x67'));}fs[_0x069e('0x68')](_0x24c03b);logger[_0x069e('0x69')]('Download\x20completed');logger[_0x069e('0x69')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0xba33b0,null));};exports[_0x069e('0x6a')]=function(_0x5eb0f2,_0x1ef65e,_0x118d81){var _0x54bdc6=path[_0x069e('0x5f')](_0x5eb0f2[_0x069e('0x6b')]['filename'],path[_0x069e('0x6c')](_0x5eb0f2[_0x069e('0x6b')][_0x069e('0x6d')]));var _0x570fbb=path[_0x069e('0x52')](config[_0x069e('0x53')],_0x069e('0x54'),_0x5eb0f2[_0x069e('0x6b')][_0x069e('0x6d')]);var _0x36f883=path[_0x069e('0x52')](config[_0x069e('0x53')],_0x069e('0x54'),_0x54bdc6);logger[_0x069e('0x69')]('Plugin\x20upload\x20filepath:\x20%s',_0x570fbb);logger[_0x069e('0x69')](_0x069e('0x6e'),_0x36f883);try{fs[_0x069e('0x6f')](_0x570fbb,parseInt('0777',0x8));extract(_0x570fbb,{'dir':_0x36f883},function(_0x106b9b){if(_0x106b9b){logger['error'](_0x106b9b);handleError(_0x106b9b,!![]);};var _0x48ccd6=fs['readdirSync'](_0x36f883);if(_0x48ccd6[_0x069e('0x70')]>0x1){removeReferences(_0x570fbb,_0x36f883);logger[_0x069e('0x33')](_0x069e('0x71'));return _0x118d81(new Error(_0x069e('0x71')));}var _0x43ab7d=fs[_0x069e('0x72')](path[_0x069e('0x52')](_0x36f883,_0x48ccd6[0x0]));if(_0x43ab7d[_0x069e('0x73')]()){removeReferences(_0x570fbb,_0x36f883);logger[_0x069e('0x33')](_0x069e('0x71'));return _0x118d81(new Error(_0x069e('0x71')));}if(_0x43ab7d[_0x069e('0x74')]()){var _0x575f4f=fs[_0x069e('0x75')](path[_0x069e('0x52')](_0x36f883,_0x48ccd6[0x0]));if(_0x575f4f[_0x069e('0x70')]===0x0){removeReferences(_0x570fbb,_0x36f883);logger[_0x069e('0x33')](_0x069e('0x71'));return _0x118d81(new Error(_0x069e('0x71')));}var _0x590fb0=_0x575f4f['some'](function(_0x389997){return _0x389997===_0x069e('0x76');});if(!_0x590fb0){return _0x118d81(new Error(_0x069e('0x77')));}var _0x28b9c8=fs['readFileSync'](path[_0x069e('0x52')](_0x36f883,_0x48ccd6[0x0],'manifest.json'));var _0x56908e=JSON[_0x069e('0x78')](_0x28b9c8);if(_0x069e('0x26')==typeof _0x56908e[_0x069e('0x35')]){return _0x118d81(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x069e('0x26')==typeof _0x56908e[_0x069e('0x37')]){return _0x118d81(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x069e('0x26')==typeof _0x56908e['version']){return _0x118d81(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x069e('0x26')==typeof _0x56908e[_0x069e('0x79')]){return _0x118d81(new Error(_0x069e('0x7a')));}if(_0x56908e[_0x069e('0x37')]===_0x069e('0x7b')){if(_0x069e('0x26')==typeof _0x56908e['parameters'][_0x069e('0x7c')]){return _0x118d81(new Error(_0x069e('0x7d')));}if(_0x069e('0x26')==typeof _0x56908e[_0x069e('0x79')][_0x069e('0x7c')][_0x069e('0x7e')]&&'undefined'==typeof _0x56908e['parameters']['views'][_0x069e('0x7f')]){return _0x118d81(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x56908e[_0x069e('0x37')]===_0x069e('0x80')){if(_0x069e('0x26')==typeof _0x56908e['parameters'][_0x069e('0x81')]){return _0x118d81(new Error(_0x069e('0x82')));}if(_0x069e('0x26')==typeof _0x56908e[_0x069e('0x79')]['scriptPath']){return _0x118d81(new Error(_0x069e('0x83')));}}else{return _0x118d81(new Error(_0x069e('0x84')));}var _0x22e47a=_0x56908e[_0x069e('0x35')];var _0x46a1ac=_0x56908e[_0x069e('0x85')];var _0x441ee3=_0x56908e[_0x069e('0x37')];var _0x2fc2a9=_0x56908e['sidebar']?_0x56908e[_0x069e('0x86')]:_0x069e('0x87');var _0x1e5d83=_0x56908e['icon']?_0x56908e[_0x069e('0x88')]:_0x069e('0x89');var _0x1a28b0='';var _0x55168f='';var _0x60982e='';var _0x1155dd='';var _0x129147=_0x56908e[_0x069e('0x8a')];if(_0x441ee3===_0x069e('0x7b')){if(_0x069e('0x26')!=typeof _0x56908e[_0x069e('0x79')][_0x069e('0x7c')][_0x069e('0x7e')]){var _0x21cbbe=_0x56908e['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x069e('0x8b')](_0x21cbbe)){_0x1a28b0=path[_0x069e('0x52')](_0x069e('0x8c'),_0x54bdc6,_0x48ccd6[0x0],_0x21cbbe);}else{_0x1a28b0=_0x21cbbe;}}else{logger[_0x069e('0x69')](_0x069e('0x8d'));}if(_0x069e('0x26')!=typeof _0x56908e['parameters'][_0x069e('0x7c')][_0x069e('0x7f')]){var _0x4dc924=_0x56908e['parameters'][_0x069e('0x7c')][_0x069e('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x069e('0x8b')](_0x4dc924)){_0x55168f=path['join'](_0x069e('0x8c'),_0x54bdc6,_0x48ccd6[0x0],_0x4dc924);}else{_0x55168f=_0x4dc924;}}else{logger[_0x069e('0x69')](_0x069e('0x8e'));}}else if(_0x441ee3===_0x069e('0x80')){_0x60982e=_0x56908e[_0x069e('0x79')][_0x069e('0x81')];_0x1155dd=_0x56908e[_0x069e('0x79')][_0x069e('0x8f')];if(_0x069e('0x26')!=typeof _0x56908e['parameters'][_0x069e('0x7c')]){if('undefined'!=typeof _0x56908e[_0x069e('0x79')]['views'][_0x069e('0x7e')]){var _0x21cbbe=_0x56908e['parameters'][_0x069e('0x7c')][_0x069e('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x069e('0x8b')](_0x21cbbe)){_0x1a28b0=path['join'](_0x069e('0x8c'),_0x54bdc6,_0x48ccd6[0x0],_0x21cbbe);}else{_0x1a28b0=_0x21cbbe;}}if('undefined'!=typeof _0x56908e[_0x069e('0x79')][_0x069e('0x7c')][_0x069e('0x7f')]){var _0x4dc924=_0x56908e[_0x069e('0x79')]['views'][_0x069e('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x069e('0x8b')](_0x4dc924)){_0x55168f=path[_0x069e('0x52')](_0x069e('0x8c'),_0x54bdc6,_0x48ccd6[0x0],_0x4dc924);}else{_0x55168f=_0x4dc924;}}}}var _0x18377b={'name':_0x22e47a,'description':_0x46a1ac,'path':path[_0x069e('0x52')](_0x54bdc6,_0x48ccd6[0x0]),'type':_0x441ee3,'sidebar':_0x2fc2a9,'icon':_0x1e5d83,'adminUrl':_0x1a28b0,'agentUrl':_0x55168f,'scriptName':_0x60982e,'scriptPath':_0x1155dd,'version':_0x129147};removeReferences(_0x570fbb,null);return db[_0x069e('0x47')][_0x069e('0x90')](_0x18377b)[_0x069e('0x2e')](function(_0x151687){var _0x42d55e={'role':_0x5eb0f2['body'][_0x069e('0x91')],'userProfileId':_0x5eb0f2[_0x069e('0x92')][_0x069e('0x93')]};if(!_0x42d55e)throw new Error(_0x069e('0x94'));if(_0x42d55e[_0x069e('0x91')]===_0x069e('0x95')){var _0x2ec301=_0x151687[_0x069e('0x30')]({'plain':!![]});return db[_0x069e('0x96')][_0x069e('0x4f')]({'where':{'name':'Plugins','userProfileId':_0x42d55e[_0x069e('0x93')]},'raw':!![]})[_0x069e('0x2e')](function(_0x57879b){if(_0x57879b&&_0x57879b[_0x069e('0x97')]===0x0){return db[_0x069e('0x32')][_0x069e('0x90')]({'name':_0x2ec301['name'],'resourceId':_0x2ec301['id'],'type':_0x57879b[_0x069e('0x35')],'sectionId':_0x57879b['id']},{})[_0x069e('0x2e')](function(){return _0x151687;});}else{return _0x151687;}})[_0x069e('0x4c')](function(_0x3ca530){logger[_0x069e('0x33')](_0x069e('0x98'),_0x3ca530);throw _0x3ca530;});}return _0x151687;})['then'](respondWithResult(_0x1ef65e,null))['catch'](handleError(_0x1ef65e,null));}});}catch(_0x30823c){_0x1ef65e['status'](0x1f4)[_0x069e('0x99')](_0x30823c);}};function removeReferences(_0x34db45,_0x2b3f54){try{if(_0x34db45){fs[_0x069e('0x68')](_0x34db45);logger[_0x069e('0x69')](_0x069e('0x9a'));}if(_0x2b3f54){rimraf(_0x2b3f54,function(){});logger[_0x069e('0x69')](_0x069e('0x9b'));}}catch(_0x36673f){logger[_0x069e('0x33')](_0x36673f);}}exports['update']=function(_0x427c9e,_0xe48284,_0x51e353){return db['Plugin'][_0x069e('0x4f')]({'where':{'id':_0x427c9e[_0x069e('0x4d')]['id']}})['then'](handleEntityNotFound(_0xe48284,null))[_0x069e('0x2e')](saveUpdates(_0x427c9e[_0x069e('0x92')],null))[_0x069e('0x2e')](respondWithResult(_0xe48284,null))[_0x069e('0x4c')](handleError(_0xe48284,null));};exports[_0x069e('0x9c')]=function(_0x3f1a57,_0x100ba4,_0x4e5c47){return db['Plugin']['find']({'where':{'id':_0x3f1a57[_0x069e('0x4d')]['id']}})['then'](function(_0x41e6a5){if(_0x41e6a5){return _0x41e6a5[_0x069e('0x2f')]();}})[_0x069e('0x2e')](function(_0x258354){rimraf(path[_0x069e('0x52')](config[_0x069e('0x53')],_0x069e('0x54'),path[_0x069e('0x5e')](_0x258354[_0x069e('0x51')])),function(){});return _0x258354;})[_0x069e('0x2e')](handleEntityNotFound(_0x100ba4,null))[_0x069e('0x2e')](respondWithStatusCode(_0x100ba4,null))['catch'](handleError(_0x100ba4,null));};exports[_0x069e('0x9d')]=function(_0x217ce3,_0x1e112c,_0x32bf20){return BPromise['resolve']()[_0x069e('0x2e')](function(){if(!_0x217ce3[_0x069e('0x3a')][_0x069e('0x51')]){throw new Error(_0x069e('0x9e'));}if(!_0x217ce3[_0x069e('0x3a')]['port']){throw new Error(_0x069e('0x9f'));}var _0x10cbff=_0x217ce3['query']['hostname']?_0x217ce3[_0x069e('0x3a')][_0x069e('0xa0')]+':'+_0x217ce3[_0x069e('0x3a')][_0x069e('0xa1')]:_0x069e('0xa2')+_0x217ce3[_0x069e('0x3a')]['port'];var _0xcb1653=_0x217ce3[_0x069e('0x3a')][_0x069e('0x2a')]?_0x217ce3[_0x069e('0x3a')][_0x069e('0x2a')]:!![];var _0x21c98a=_0x217ce3[_0x069e('0x3a')][_0x069e('0xa3')]?_0x217ce3[_0x069e('0x3a')][_0x069e('0xa3')]:null;var _0x4aa3e7={'method':_0x217ce3[_0x069e('0xa4')],'uri':util[_0x069e('0x55')](_0x069e('0xa5'),_0x10cbff,_0x217ce3['query']['path']),'json':_0xcb1653,'resolveWithFullResponse':!![],'encoding':_0x21c98a,'qs':_0x217ce3[_0x069e('0x3a')]};if(_0x217ce3[_0x069e('0xa6')]){_0x4aa3e7[_0x069e('0xa6')]=_0x217ce3[_0x069e('0xa6')];if(_0x4aa3e7['headers'][_0x069e('0xa7')]){delete _0x4aa3e7[_0x069e('0xa6')][_0x069e('0xa7')];}}if(_0x4aa3e7[_0x069e('0xa6')][_0x069e('0xa8')]){delete _0x4aa3e7['headers']['content-type'];}return rp(_0x4aa3e7);})[_0x069e('0x2e')](function(_0x1dc0c0){if(_0x1dc0c0){_0x1e112c[_0x069e('0x29')](_0x1dc0c0[_0x069e('0xa6')]);logger[_0x069e('0x69')](_0x1dc0c0[_0x069e('0x92')]);if(_[_0x069e('0xa9')](_0x217ce3['query'][_0x069e('0x51')],_0x069e('0x50'))&&_0x1dc0c0[_0x069e('0xaa')]==0x1f4){return _0x1e112c[_0x069e('0x22')](_0x1dc0c0[_0x069e('0xaa')]);}else{return _0x1e112c[_0x069e('0x24')](_0x1dc0c0[_0x069e('0xaa')])['send'](_0x1dc0c0[_0x069e('0x92')]);}}else{return _0x1e112c[_0x069e('0x22')](0xc8);}})[_0x069e('0x4c')](handleError(_0x1e112c,null));};exports[_0x069e('0xab')]=function(_0x5cec7a,_0x312c0b,_0x2799bf){return BPromise['resolve']()[_0x069e('0x2e')](function(){if(!_0x5cec7a[_0x069e('0x3a')][_0x069e('0x51')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x5cec7a[_0x069e('0x3a')][_0x069e('0xa1')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x4683e6=_0x5cec7a[_0x069e('0x3a')][_0x069e('0xa0')]?_0x5cec7a[_0x069e('0x3a')]['hostname']+':'+_0x5cec7a[_0x069e('0x3a')][_0x069e('0xa1')]:_0x069e('0xa2')+_0x5cec7a[_0x069e('0x3a')][_0x069e('0xa1')];var _0x2ba194=_0x5cec7a[_0x069e('0x3a')][_0x069e('0x2a')]?_0x5cec7a[_0x069e('0x3a')][_0x069e('0x2a')]:!![];var _0x14ffd2=_0x5cec7a['query'][_0x069e('0xa3')]?_0x5cec7a[_0x069e('0x3a')]['encoding']:null;var _0x301959={'method':_0x5cec7a['method'],'uri':util[_0x069e('0x55')]('%s%s',_0x4683e6,_0x5cec7a[_0x069e('0x3a')][_0x069e('0x51')]),'json':_0x2ba194,'resolveWithFullResponse':!![],'encoding':_0x14ffd2,'body':_0x5cec7a['body']};if(_0x5cec7a[_0x069e('0xa6')]){_0x301959[_0x069e('0xa6')]=_0x5cec7a['headers'];if(_0x301959['headers']['content-length']){delete _0x301959[_0x069e('0xa6')][_0x069e('0xa7')];}}if(_0x301959[_0x069e('0xa6')][_0x069e('0xa8')]){delete _0x301959[_0x069e('0xa6')][_0x069e('0xa8')];}return rp(_0x301959);})[_0x069e('0x2e')](function(_0xc606f7){if(_0xc606f7){_0x312c0b['set'](_0xc606f7[_0x069e('0xa6')]);logger['info'](_0xc606f7[_0x069e('0x92')]);return _0x312c0b[_0x069e('0x24')](_0xc606f7[_0x069e('0xaa')])[_0x069e('0x99')](_0xc606f7[_0x069e('0x92')]);}else{return _0x312c0b[_0x069e('0x22')](0xc8);}})['catch'](handleError(_0x312c0b,null));};
\ No newline at end of file
index c471477..a19d37b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x869e=['update','remove','emit','hasOwnProperty','events','../../mysqldb','Plugin','save'];(function(_0x121a73,_0x59de7e){var _0x28f494=function(_0x10a6a5){while(--_0x10a6a5){_0x121a73['push'](_0x121a73['shift']());}};_0x28f494(++_0x59de7e);}(_0x869e,0x15c));var _0xe869=function(_0x580201,_0x49386d){_0x580201=_0x580201-0x0;var _0x94e701=_0x869e[_0x580201];return _0x94e701;};'use strict';var EventEmitter=require(_0xe869('0x0'));var Plugin=require(_0xe869('0x1'))['db'][_0xe869('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe869('0x3'),'afterUpdate':_0xe869('0x4'),'afterDestroy':_0xe869('0x5')};function emitEvent(_0x34b325){return function(_0x39fee6,_0x597771,_0x21f626){PluginEvents[_0xe869('0x6')](_0x34b325+':'+_0x39fee6['id'],_0x39fee6);PluginEvents[_0xe869('0x6')](_0x34b325,_0x39fee6);_0x21f626(null);};}for(var e in events){if(events[_0xe869('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
+var _0x3079=['../../mysqldb','Plugin','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x4ccc97,_0x1df63e){var _0x1f11d0=function(_0x51e64b){while(--_0x51e64b){_0x4ccc97['push'](_0x4ccc97['shift']());}};_0x1f11d0(++_0x1df63e);}(_0x3079,0x110));var _0x9307=function(_0x3482df,_0x400676){_0x3482df=_0x3482df-0x0;var _0x4ff418=_0x3079[_0x3482df];return _0x4ff418;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x9307('0x0'))['db'][_0x9307('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x9307('0x2')](0x0);var events={'afterCreate':_0x9307('0x3'),'afterUpdate':'update','afterDestroy':_0x9307('0x4')};function emitEvent(_0x1f7680){return function(_0x513b2c,_0x57c9a6,_0x42c46a){PluginEvents[_0x9307('0x5')](_0x1f7680+':'+_0x513b2c['id'],_0x513b2c);PluginEvents[_0x9307('0x5')](_0x1f7680,_0x513b2c);_0x42c46a(null);};}for(var e in events){if(events[_0x9307('0x6')](e)){var event=events[e];Plugin[_0x9307('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
index 4f24ff1..134ece1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e68=['../../config/environment','exports','define','Plugin','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x370d18,_0xd2ad08){var _0x18ea8d=function(_0xbc180a){while(--_0xbc180a){_0x370d18['push'](_0x370d18['shift']());}};_0x18ea8d(++_0xd2ad08);}(_0x0e68,0x1bc));var _0x80e6=function(_0x1fff64,_0x39d987){_0x1fff64=_0x1fff64-0x0;var _0x191fc5=_0x0e68[_0x1fff64];return _0x191fc5;};'use strict';var _=require(_0x80e6('0x0'));var util=require(_0x80e6('0x1'));var logger=require('../../config/logger')(_0x80e6('0x2'));var moment=require(_0x80e6('0x3'));var BPromise=require(_0x80e6('0x4'));var rp=require(_0x80e6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x80e6('0x6'));var config=require(_0x80e6('0x7'));var attributes=require('./plugin.attributes');module[_0x80e6('0x8')]=function(_0x51d061,_0x3f4f8e){return _0x51d061[_0x80e6('0x9')](_0x80e6('0xa'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x028b=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins'];(function(_0x17bcf9,_0xcca31f){var _0x3855fb=function(_0x2f694d){while(--_0x2f694d){_0x17bcf9['push'](_0x17bcf9['shift']());}};_0x3855fb(++_0xcca31f);}(_0x028b,0x1c0));var _0xb028=function(_0x5b5351,_0x3dd581){_0x5b5351=_0x5b5351-0x0;var _0x2367a8=_0x028b[_0x5b5351];return _0x2367a8;};'use strict';var _=require(_0xb028('0x0'));var util=require(_0xb028('0x1'));var logger=require(_0xb028('0x2'))(_0xb028('0x3'));var moment=require(_0xb028('0x4'));var BPromise=require('bluebird');var rp=require(_0xb028('0x5'));var fs=require('fs');var path=require(_0xb028('0x6'));var rimraf=require(_0xb028('0x7'));var config=require(_0xb028('0x8'));var attributes=require(_0xb028('0x9'));module[_0xb028('0xa')]=function(_0x3fb92a,_0x463c86){return _0x3fb92a[_0xb028('0xb')](_0xb028('0xc'),attributes,{'tableName':_0xb028('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1d8f28c..7955eba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff33=['message','info','result','catch','CreatePlugin','options','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5a8f34,_0x11c27b){var _0x497614=function(_0x2089e3){while(--_0x2089e3){_0x5a8f34['push'](_0x5a8f34['shift']());}};_0x497614(++_0x11c27b);}(_0xff33,0x17a));var _0x3ff3=function(_0x1db251,_0xf0443d){_0x1db251=_0x1db251-0x0;var _0x56685a=_0xff33[_0x1db251];return _0x56685a;};'use strict';var _=require('lodash');var util=require(_0x3ff3('0x0'));var moment=require(_0x3ff3('0x1'));var BPromise=require(_0x3ff3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ff3('0x3'));var db=require(_0x3ff3('0x4'))['db'];var utils=require(_0x3ff3('0x5'));var logger=require(_0x3ff3('0x6'))('rpc');var config=require(_0x3ff3('0x7'));var jayson=require(_0x3ff3('0x8'));var client=jayson[_0x3ff3('0x9')][_0x3ff3('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x3ff3('0xb')],{'host':_0x3ff3('0xc'),'port':0x18eb});var socket=require(_0x3ff3('0xd'))(new Redis(config[_0x3ff3('0xb')]));require(_0x3ff3('0xe'))[_0x3ff3('0xf')](socket);function respondWithRpcPromise(_0x3059bb,_0x5609b8,_0x1c9e57){return new BPromise(function(_0xe59801,_0x1b09f6){return client[_0x3ff3('0x10')](_0x3059bb,_0x1c9e57)[_0x3ff3('0x11')](function(_0x4b078a){logger['info'](_0x3ff3('0x12'),_0x5609b8,'request\x20sent');logger[_0x3ff3('0x13')](_0x3ff3('0x14'),_0x5609b8,_0x3ff3('0x15'),JSON[_0x3ff3('0x16')](_0x4b078a));if(_0x4b078a['error']){if(_0x4b078a[_0x3ff3('0x17')][_0x3ff3('0x18')]===0x1f4){logger[_0x3ff3('0x17')]('Plugin,\x20%s,\x20%s',_0x5609b8,_0x4b078a[_0x3ff3('0x17')][_0x3ff3('0x19')]);return _0x1b09f6(_0x4b078a[_0x3ff3('0x17')]['message']);}logger[_0x3ff3('0x17')](_0x3ff3('0x12'),_0x5609b8,_0x4b078a[_0x3ff3('0x17')][_0x3ff3('0x19')]);return _0xe59801(_0x4b078a[_0x3ff3('0x17')][_0x3ff3('0x19')]);}else{logger[_0x3ff3('0x1a')](_0x3ff3('0x12'),_0x5609b8,_0x3ff3('0x15'));_0xe59801(_0x4b078a[_0x3ff3('0x1b')][_0x3ff3('0x19')]);}})[_0x3ff3('0x1c')](function(_0x439ca6){logger[_0x3ff3('0x17')](_0x3ff3('0x12'),_0x5609b8,_0x439ca6);_0x1b09f6(_0x439ca6);});});}exports[_0x3ff3('0x1d')]=function(_0x2d2e3d){var _0x22f1b6=this;return new Promise(function(_0x471da3,_0x236965){return db['Plugin']['create'](_0x2d2e3d['body'],{'raw':_0x2d2e3d['options']?_0x2d2e3d[_0x3ff3('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x3ff3('0x11')](function(_0x447f30){logger[_0x3ff3('0x1a')](_0x3ff3('0x1d'),_0x2d2e3d);logger[_0x3ff3('0x13')]('CreatePlugin',_0x2d2e3d,JSON['stringify'](_0x447f30));_0x471da3(_0x447f30);})['catch'](function(_0x49fbd0){logger[_0x3ff3('0x17')](_0x3ff3('0x1d'),_0x49fbd0['message'],_0x2d2e3d);_0x236965(_0x22f1b6[_0x3ff3('0x17')](0x1f4,_0x49fbd0[_0x3ff3('0x19')]));});});};
\ No newline at end of file
+var _0x4743=['message','result','catch','CreatePlugin','Plugin','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s'];(function(_0x21ae06,_0x40d80a){var _0x47b224=function(_0x3cec90){while(--_0x3cec90){_0x21ae06['push'](_0x21ae06['shift']());}};_0x47b224(++_0x40d80a);}(_0x4743,0x173));var _0x3474=function(_0x2a5fa1,_0x1752c5){_0x2a5fa1=_0x2a5fa1-0x0;var _0x134572=_0x4743[_0x2a5fa1];return _0x134572;};'use strict';var _=require(_0x3474('0x0'));var util=require(_0x3474('0x1'));var moment=require(_0x3474('0x2'));var BPromise=require(_0x3474('0x3'));var rs=require(_0x3474('0x4'));var fs=require('fs');var Redis=require(_0x3474('0x5'));var db=require(_0x3474('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x3474('0x7'))(_0x3474('0x8'));var config=require('../../config/environment');var jayson=require(_0x3474('0x9'));var client=jayson['client'][_0x3474('0xa')]({'port':0x232a});config[_0x3474('0xb')]=_['defaults'](config['redis'],{'host':_0x3474('0xc'),'port':0x18eb});var socket=require(_0x3474('0xd'))(new Redis(config['redis']));require('./plugin.socket')[_0x3474('0xe')](socket);function respondWithRpcPromise(_0x3579b6,_0x2bf1be,_0x14e418){return new BPromise(function(_0x54ea5a,_0xa6baee){return client[_0x3474('0xf')](_0x3579b6,_0x14e418)[_0x3474('0x10')](function(_0x526e17){logger[_0x3474('0x11')]('Plugin,\x20%s,\x20%s',_0x2bf1be,_0x3474('0x12'));logger[_0x3474('0x13')](_0x3474('0x14'),_0x2bf1be,_0x3474('0x12'),JSON[_0x3474('0x15')](_0x526e17));if(_0x526e17[_0x3474('0x16')]){if(_0x526e17[_0x3474('0x16')][_0x3474('0x17')]===0x1f4){logger[_0x3474('0x16')](_0x3474('0x18'),_0x2bf1be,_0x526e17['error']['message']);return _0xa6baee(_0x526e17[_0x3474('0x16')][_0x3474('0x19')]);}logger[_0x3474('0x16')](_0x3474('0x18'),_0x2bf1be,_0x526e17[_0x3474('0x16')][_0x3474('0x19')]);return _0x54ea5a(_0x526e17[_0x3474('0x16')][_0x3474('0x19')]);}else{logger[_0x3474('0x11')](_0x3474('0x18'),_0x2bf1be,'request\x20sent');_0x54ea5a(_0x526e17[_0x3474('0x1a')][_0x3474('0x19')]);}})[_0x3474('0x1b')](function(_0x2cca3b){logger[_0x3474('0x16')](_0x3474('0x18'),_0x2bf1be,_0x2cca3b);_0xa6baee(_0x2cca3b);});});}exports[_0x3474('0x1c')]=function(_0x1043ed){var _0xc425f=this;return new Promise(function(_0x141537,_0x58ee30){return db[_0x3474('0x1d')][_0x3474('0x1e')](_0x1043ed[_0x3474('0x1f')],{'raw':_0x1043ed[_0x3474('0x20')]?_0x1043ed[_0x3474('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x3474('0x10')](function(_0x687a94){logger[_0x3474('0x11')](_0x3474('0x1c'),_0x1043ed);logger[_0x3474('0x13')](_0x3474('0x1c'),_0x1043ed,JSON[_0x3474('0x15')](_0x687a94));_0x141537(_0x687a94);})[_0x3474('0x1b')](function(_0x2b9d8b){logger['error'](_0x3474('0x1c'),_0x2b9d8b[_0x3474('0x19')],_0x1043ed);_0x58ee30(_0xc425f['error'](0x1f4,_0x2b9d8b[_0x3474('0x19')]));});});};
\ No newline at end of file
index 2e3b3c6..6938018 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2079=['register','length','plugin:','./plugin.events','save','remove','emit'];(function(_0x3e1a10,_0x6aeaf2){var _0x2fb8ee=function(_0x473aa3){while(--_0x473aa3){_0x3e1a10['push'](_0x3e1a10['shift']());}};_0x2fb8ee(++_0x6aeaf2);}(_0x2079,0x192));var _0x9207=function(_0x4284e5,_0x409270){_0x4284e5=_0x4284e5-0x0;var _0x28466b=_0x2079[_0x4284e5];return _0x28466b;};'use strict';var PluginEvents=require(_0x9207('0x0'));var events=[_0x9207('0x1'),_0x9207('0x2'),'update'];function createListener(_0x182543,_0x9bc3a2){return function(_0x4627d8){_0x9bc3a2[_0x9207('0x3')](_0x182543,_0x4627d8);};}function removeListener(_0x8ef7c0,_0x61e6fb){return function(){PluginEvents['removeListener'](_0x8ef7c0,_0x61e6fb);};}exports[_0x9207('0x4')]=function(_0xffcaea){for(var _0x1781f7=0x0,_0x37aa9f=events[_0x9207('0x5')];_0x1781f7<_0x37aa9f;_0x1781f7++){var _0x11a16c=events[_0x1781f7];var _0x14ff76=createListener(_0x9207('0x6')+_0x11a16c,_0xffcaea);PluginEvents['on'](_0x11a16c,_0x14ff76);}};
\ No newline at end of file
+var _0x2bc5=['./plugin.events','remove','update','emit','removeListener','register','length','plugin:'];(function(_0x2f3115,_0x2f4ad8){var _0x3314bf=function(_0x2b5dae){while(--_0x2b5dae){_0x2f3115['push'](_0x2f3115['shift']());}};_0x3314bf(++_0x2f4ad8);}(_0x2bc5,0x1a0));var _0x52bc=function(_0x2501f0,_0x51ec5c){_0x2501f0=_0x2501f0-0x0;var _0x2b49c6=_0x2bc5[_0x2501f0];return _0x2b49c6;};'use strict';var PluginEvents=require(_0x52bc('0x0'));var events=['save',_0x52bc('0x1'),_0x52bc('0x2')];function createListener(_0x5e9895,_0x12cc17){return function(_0x18ac2c){_0x12cc17[_0x52bc('0x3')](_0x5e9895,_0x18ac2c);};}function removeListener(_0x11f28d,_0x353061){return function(){PluginEvents[_0x52bc('0x4')](_0x11f28d,_0x353061);};}exports[_0x52bc('0x5')]=function(_0x4fd27a){for(var _0x428cdc=0x0,_0x329422=events[_0x52bc('0x6')];_0x428cdc<_0x329422;_0x428cdc++){var _0xe11eee=events[_0x428cdc];var _0x558a06=createListener(_0x52bc('0x7')+_0xe11eee,_0x4fd27a);PluginEvents['on'](_0xe11eee,_0x558a06);}};
\ No newline at end of file
index 576b76a..ff2d44b 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(_0x54cc43,_0x5c0849){var _0x260505=function(_0x193732){while(--_0x193732){_0x54cc43['push'](_0x54cc43['shift']());}};_0x260505(++_0x5c0849);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x431488,_0x37f9d5){var _0x9ce3d1=function(_0x228d1a){while(--_0x228d1a){_0x431488['push'](_0x431488['shift']());}};_0x9ce3d1(++_0x37f9d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router;
\ No newline at end of file
index bee0a25..524f626 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa75b=['motion2','length','catch','show','describe','params','create','body','script','cwd','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','restart','hasOwnProperty','delete','lodash','api','path','child_process','exec','bluebird','sendStatus','status','stack','name','send','npm\x20install','info','error','then','reject','express'];(function(_0x1381f5,_0x577a2e){var _0xa3e5f4=function(_0x1b9547){while(--_0x1b9547){_0x1381f5['push'](_0x1381f5['shift']());}};_0xa3e5f4(++_0x577a2e);}(_0xa75b,0x170));var _0xba75=function(_0x5be450,_0x4a2cba){_0x5be450=_0x5be450-0x0;var _0x53cbaf=_0xa75b[_0x5be450];return _0x53cbaf;};'use strict';var _=require(_0xba75('0x0'));var pm2=require('../../config/pm2');var logger=require('../../config/logger')(_0xba75('0x1'));var path=require(_0xba75('0x2'));var exec=require(_0xba75('0x3'))[_0xba75('0x4')];var BPromise=require(_0xba75('0x5'));function handleEntityNotFound(_0x336606,_0x152269){return function(_0x398bd5){if(!_0x398bd5){_0x336606[_0xba75('0x6')](0x194);;}return _0x398bd5;};}function respondWithResult(_0x41afc9,_0x2baa28){_0x2baa28=_0x2baa28||0xc8;return function(_0x238a33){if(_0x238a33){return _0x41afc9[_0xba75('0x7')](_0x2baa28)['json'](_0x238a33);}return null;};}function handleError(_0x4b842d,_0x731cae){_0x731cae=_0x731cae||0x1f4;return function(_0x52669f){logger['error'](_0x52669f[_0xba75('0x8')]);if(_0x52669f['name']){delete _0x52669f[_0xba75('0x9')];}_0x4b842d[_0xba75('0x7')](_0x731cae)[_0xba75('0xa')](_0x52669f);};}function execChildProcess(){return new BPromise(function(_0x141931,_0x13f60f){exec(_0xba75('0xb'),function(_0xb5afb8,_0x2538eb,_0x1824e2){logger[_0xba75('0xc')](_0x2538eb);logger[_0xba75('0xc')](_0x1824e2);if(_0xb5afb8){logger[_0xba75('0xd')](_0xb5afb8);return _0x13f60f(_0xb5afb8);}return _0x141931(_0x2538eb);});});}exports['index']=function(_0x55553a,_0x38a6db){return pm2['list']()[_0xba75('0xe')](function(_0x2df615){if(_0x2df615){var _0xa27f76=_[_0xba75('0xf')](_0x2df615,function(_0x4c4a0b){return _0x4c4a0b[_0xba75('0x9')]===_0xba75('0x10')||_0x4c4a0b[_0xba75('0x9')]===_0xba75('0x11');});return{'rows':_0xa27f76,'count':_0xa27f76[_0xba75('0x12')]};}return null;})['then'](respondWithResult(_0x38a6db,null))[_0xba75('0x13')](handleError(_0x38a6db,null));};exports[_0xba75('0x14')]=function(_0x14bd83,_0x47be93){return pm2[_0xba75('0x15')](_0x14bd83[_0xba75('0x16')]['id'])[_0xba75('0xe')](respondWithResult(_0x47be93,null))[_0xba75('0xe')](handleEntityNotFound(_0x47be93,null))[_0xba75('0x13')](handleError(_0x47be93,null));};exports[_0xba75('0x17')]=function(_0x5811cb,_0x23c2ec){if(_0x5811cb[_0xba75('0x18')]['name']&&_0x5811cb['body'][_0xba75('0x19')]){var _0x31bc33=path['join'](__dirname,'../../files/plugins',_0x5811cb[_0xba75('0x18')]['script']);var _0x1b8a36=process[_0xba75('0x1a')]();process[_0xba75('0x1b')](path['dirname'](_0x31bc33));return execChildProcess()[_0xba75('0xe')](function(_0x221d5e){process[_0xba75('0x1b')](_0x1b8a36);return pm2[_0xba75('0x1c')]({'name':_0x5811cb[_0xba75('0x18')][_0xba75('0x9')],'script':_0x31bc33});})['then'](function(_0x246c48){pm2[_0xba75('0x1d')]();return _0x246c48[0x0];})[_0xba75('0xe')](respondWithResult(_0x23c2ec,0xc9))[_0xba75('0x13')](handleError(_0x23c2ec,null));}else{return _0x23c2ec[_0xba75('0x7')](0x1f4)[_0xba75('0xa')]({'message':_0xba75('0x1e')});}};exports[_0xba75('0x1f')]=function(_0x35c571,_0x155c74){if(_0x35c571['body']['id']){delete _0x35c571['body']['id'];}var _0x4e1987={'online':_0xba75('0x20'),'stopped':'stop'};if(_0x4e1987[_0xba75('0x21')](_0x35c571['body'][_0xba75('0x7')])){return pm2[_0x4e1987[_0x35c571[_0xba75('0x18')][_0xba75('0x7')]]](_0x35c571['params']['id'])[_0xba75('0xe')](respondWithResult(_0x155c74,0xc8))[_0xba75('0x13')](handleError(_0x155c74,null));}else{return _0x155c74[_0xba75('0x7')](0x1f4)[_0xba75('0xa')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x200715,_0x481a04){if(_0x200715[_0xba75('0x18')]['id']){delete _0x200715[_0xba75('0x18')]['id'];}if(_0x200715[_0xba75('0x16')]['id']){return pm2[_0xba75('0x22')](_0x200715['params']['id'])[_0xba75('0xe')](function(_0x222d98){pm2['dump']();return _0x222d98[0x0];})[_0xba75('0xe')](respondWithResult(_0x481a04,null))[_0xba75('0x13')](handleError(_0x481a04,null));}else{return _0x481a04[_0xba75('0x7')](0x1f4)[_0xba75('0xa')]({'message':'Unknown\x20id'});}};
\ No newline at end of file
+var _0xd404=['stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','api','path','exec','bluebird','sendStatus','json','name','status','send','npm\x20install','info','error','index','list','then','express','motion2','length','catch','show','describe','params','body','join','script','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart'];(function(_0x4af581,_0x5ce7f6){var _0x56edc2=function(_0x3c4e1b){while(--_0x3c4e1b){_0x4af581['push'](_0x4af581['shift']());}};_0x56edc2(++_0x5ce7f6);}(_0xd404,0x15b));var _0x4d40=function(_0x1f1cd4,_0x4a52c9){_0x1f1cd4=_0x1f1cd4-0x0;var _0x2c4bac=_0xd404[_0x1f1cd4];return _0x2c4bac;};'use strict';var _=require(_0x4d40('0x0'));var pm2=require(_0x4d40('0x1'));var logger=require('../../config/logger')(_0x4d40('0x2'));var path=require(_0x4d40('0x3'));var exec=require('child_process')[_0x4d40('0x4')];var BPromise=require(_0x4d40('0x5'));function handleEntityNotFound(_0xba821,_0x8bde12){return function(_0xbfb4c6){if(!_0xbfb4c6){_0xba821[_0x4d40('0x6')](0x194);;}return _0xbfb4c6;};}function respondWithResult(_0xc2a9db,_0x24a237){_0x24a237=_0x24a237||0xc8;return function(_0x2e4bd8){if(_0x2e4bd8){return _0xc2a9db['status'](_0x24a237)[_0x4d40('0x7')](_0x2e4bd8);}return null;};}function handleError(_0x116941,_0x5a23a2){_0x5a23a2=_0x5a23a2||0x1f4;return function(_0x3bf81a){logger['error'](_0x3bf81a['stack']);if(_0x3bf81a[_0x4d40('0x8')]){delete _0x3bf81a[_0x4d40('0x8')];}_0x116941[_0x4d40('0x9')](_0x5a23a2)[_0x4d40('0xa')](_0x3bf81a);};}function execChildProcess(){return new BPromise(function(_0x1d00cf,_0x357abf){exec(_0x4d40('0xb'),function(_0x2eab7a,_0x1e18bc,_0x3f5c29){logger[_0x4d40('0xc')](_0x1e18bc);logger[_0x4d40('0xc')](_0x3f5c29);if(_0x2eab7a){logger[_0x4d40('0xd')](_0x2eab7a);return _0x357abf(_0x2eab7a);}return _0x1d00cf(_0x1e18bc);});});}exports[_0x4d40('0xe')]=function(_0x5162f9,_0xa644d2){return pm2[_0x4d40('0xf')]()[_0x4d40('0x10')](function(_0x2083bd){if(_0x2083bd){var _0x477a91=_['reject'](_0x2083bd,function(_0x23de7b){return _0x23de7b[_0x4d40('0x8')]===_0x4d40('0x11')||_0x23de7b[_0x4d40('0x8')]===_0x4d40('0x12');});return{'rows':_0x477a91,'count':_0x477a91[_0x4d40('0x13')]};}return null;})[_0x4d40('0x10')](respondWithResult(_0xa644d2,null))[_0x4d40('0x14')](handleError(_0xa644d2,null));};exports[_0x4d40('0x15')]=function(_0x4b5d23,_0x535989){return pm2[_0x4d40('0x16')](_0x4b5d23[_0x4d40('0x17')]['id'])['then'](respondWithResult(_0x535989,null))[_0x4d40('0x10')](handleEntityNotFound(_0x535989,null))[_0x4d40('0x14')](handleError(_0x535989,null));};exports['create']=function(_0x36d031,_0x5a77e0){if(_0x36d031[_0x4d40('0x18')][_0x4d40('0x8')]&&_0x36d031['body']['script']){var _0x375ce0=path[_0x4d40('0x19')](__dirname,'../../files/plugins',_0x36d031[_0x4d40('0x18')][_0x4d40('0x1a')]);var _0x30f058=process['cwd']();process[_0x4d40('0x1b')](path[_0x4d40('0x1c')](_0x375ce0));return execChildProcess()[_0x4d40('0x10')](function(_0x5ca0a0){process['chdir'](_0x30f058);return pm2[_0x4d40('0x1d')]({'name':_0x36d031[_0x4d40('0x18')][_0x4d40('0x8')],'script':_0x375ce0});})[_0x4d40('0x10')](function(_0x4677c9){pm2['dump']();return _0x4677c9[0x0];})[_0x4d40('0x10')](respondWithResult(_0x5a77e0,0xc9))[_0x4d40('0x14')](handleError(_0x5a77e0,null));}else{return _0x5a77e0['status'](0x1f4)['send']({'message':_0x4d40('0x1e')});}};exports[_0x4d40('0x1f')]=function(_0x3fa83e,_0x3ad1d7){if(_0x3fa83e[_0x4d40('0x18')]['id']){delete _0x3fa83e[_0x4d40('0x18')]['id'];}var _0x105635={'online':_0x4d40('0x20'),'stopped':_0x4d40('0x21')};if(_0x105635[_0x4d40('0x22')](_0x3fa83e[_0x4d40('0x18')]['status'])){return pm2[_0x105635[_0x3fa83e['body']['status']]](_0x3fa83e[_0x4d40('0x17')]['id'])[_0x4d40('0x10')](respondWithResult(_0x3ad1d7,0xc8))[_0x4d40('0x14')](handleError(_0x3ad1d7,null));}else{return _0x3ad1d7[_0x4d40('0x9')](0x1f4)['send']({'message':_0x4d40('0x23')});}};exports[_0x4d40('0x24')]=function(_0x429da9,_0x5a6aff){if(_0x429da9[_0x4d40('0x18')]['id']){delete _0x429da9[_0x4d40('0x18')]['id'];}if(_0x429da9[_0x4d40('0x17')]['id']){return pm2[_0x4d40('0x25')](_0x429da9[_0x4d40('0x17')]['id'])['then'](function(_0x2f4b22){pm2['dump']();return _0x2f4b22[0x0];})[_0x4d40('0x10')](respondWithResult(_0x5a6aff,null))[_0x4d40('0x14')](handleError(_0x5a6aff,null));}else{return _0x5a6aff[_0x4d40('0x9')](0x1f4)[_0x4d40('0xa')]({'message':'Unknown\x20id'});}};
\ No newline at end of file
index 79ec4b5..424b202 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37c3=['getAgents','get','getQueues','exports','express','/agents','isAuthenticated'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x37c3,0xa5));var _0x337c=function(_0x434b28,_0x175e52){_0x434b28=_0x434b28-0x0;var _0x2abc52=_0x37c3[_0x434b28];return _0x2abc52;};'use strict';var express=require(_0x337c('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router['get'](_0x337c('0x1'),auth[_0x337c('0x2')](),controller[_0x337c('0x3')]);router[_0x337c('0x4')]('/queues',auth[_0x337c('0x2')](),controller[_0x337c('0x5')]);module[_0x337c('0x6')]=router;
\ No newline at end of file
+var _0x7185=['getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','get','/agents','isAuthenticated'];(function(_0x368152,_0x3ea7a3){var _0x1ec0b6=function(_0x176f39){while(--_0x176f39){_0x368152['push'](_0x368152['shift']());}};_0x1ec0b6(++_0x3ea7a3);}(_0x7185,0x119));var _0x5718=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7185[_0x2641f9];return _0x585741;};'use strict';var express=require(_0x5718('0x0'));var router=express[_0x5718('0x1')]();var auth=require(_0x5718('0x2'));var controller=require(_0x5718('0x3'));router[_0x5718('0x4')](_0x5718('0x5'),auth[_0x5718('0x6')](),controller['getAgents']);router[_0x5718('0x4')]('/queues',auth['isAuthenticated'](),controller[_0x5718('0x7')]);module[_0x5718('0x8')]=router;
\ No newline at end of file
index de01ed1..41dab11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf91=['faxStatusTime','voiceStatusTime','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','query','channel','order','globalQueueFilter','fieldName','type','key','role','agent','where','user','userProfileId','Agents','nolimit','UserProfile','getResources','findAndCountAll','rows','omit','globalStatusFilter','pauseTypeFilter','getQueues','rawAttributes','getOptions','QueueCampaigns','util','jayson/promise','api','../../mysqldb','http','client','offset','limit','undefined','count','status','set','json','error','stack','name','send','request','then','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','voice','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','catch','loggedIn','available','waiting','paused','outbound','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','get','agents','loggedInDb','talking','busy','find','pick','queue','connectedlinenum','getMembers','length','UserId','accountcode','online','voiceStatus','User','Queue','Pause','findAll','QueueId','idle','unknown','unavailable','ringing','isNil','chatPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','pause','chatStatus','openchannelStatus','smsStatus','whatsappStatus','*pause','chat','sms','openchannel','fax','whatsapp','includes','Invalid\x20channel','toLowerCase','isArray','map','getAgents','all','flatten','value','fields','globalStatus','startsWith','DESC','ASC','sort','pauseType','userpic','lastLoginAt','lastPauseAt','internal','address','faxPause','chatCapacity','openchannelCapacity','mailCapacity','whatsappCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','mailStatus','chatStatusTime'];(function(_0x1f2390,_0x5d3f5f){var _0xe19912=function(_0x185653){while(--_0x185653){_0x1f2390['push'](_0x1f2390['shift']());}};_0xe19912(++_0x5d3f5f);}(_0xbf91,0xc1));var _0x1bf9=function(_0x1466ba,_0x4cd93e){_0x1466ba=_0x1466ba-0x0;var _0x56a71b=_0xbf91[_0x1466ba];return _0x56a71b;};'use strict';var util=require(_0x1bf9('0x0'));var _=require('lodash');var jayson=require(_0x1bf9('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x1bf9('0x2'));var db=require(_0x1bf9('0x3'))['db'];var amiClient=jayson['client'][_0x1bf9('0x4')]({'port':0x232a});var routingClient=jayson[_0x1bf9('0x5')][_0x1bf9('0x4')]({'port':0x232c});function respondWithFilteredResult(_0x4c844b,_0x5ec529){return function(_0x2f9cad){if(_0x2f9cad){var _0x507cfb=typeof _0x5ec529[_0x1bf9('0x6')]==='undefined'&&typeof _0x5ec529[_0x1bf9('0x7')]===_0x1bf9('0x8');var _0x3e15b6=_0x2f9cad[_0x1bf9('0x9')];var _0x5ae2d3=_0x507cfb?0x0:_0x5ec529[_0x1bf9('0x6')];var _0x5e2c35=_0x507cfb?_0x2f9cad[_0x1bf9('0x9')]:_0x5ec529[_0x1bf9('0x6')]+_0x5ec529[_0x1bf9('0x7')];var _0x3dc081;if(_0x5e2c35>=_0x3e15b6){_0x5e2c35=_0x3e15b6;_0x3dc081=0xc8;}else{_0x3dc081=0xce;}_0x4c844b[_0x1bf9('0xa')](_0x3dc081);return _0x4c844b[_0x1bf9('0xb')]('Content-Range',_0x5ae2d3+'-'+_0x5e2c35+'/'+_0x3e15b6)[_0x1bf9('0xc')](_0x2f9cad);}return null;};}function handleError(_0x529ba6,_0x538ab3){_0x538ab3=_0x538ab3||0x1f4;return function(_0x2985ca){logger[_0x1bf9('0xd')](_0x2985ca[_0x1bf9('0xe')]);if(_0x2985ca[_0x1bf9('0xf')]){delete _0x2985ca['name'];}_0x529ba6[_0x1bf9('0xa')](_0x538ab3)[_0x1bf9('0x10')](_0x2985ca);};}function getRealtimeAgents(){return new Promise(function(_0x119ac9,_0x3d6d68){return amiClient[_0x1bf9('0x11')]('Agents',{})[_0x1bf9('0x12')](function(_0x34561c){if(_0x34561c[_0x1bf9('0xd')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x164de4=_0x34561c[_0x1bf9('0x13')];return routingClient[_0x1bf9('0x11')]('Agents',{})[_0x1bf9('0x12')](function(_0x25eb37){if(_0x25eb37[_0x1bf9('0xd')])throw new Error(_0x1bf9('0x14'));var _0x1d5304=_0x25eb37[_0x1bf9('0x13')];return _0x119ac9(_[_0x1bf9('0x15')]({},_0x164de4,_0x1d5304));});})['catch'](function(_0xed8187){_0x3d6d68(_0xed8187);});});}function getRealtimeQueues(_0xec9aa3,_0x49437e){return new Promise(function(_0x602340,_0x1ef3fa){var _0x47f97e=_0x49437e===_0x1bf9('0x16')?amiClient:routingClient;return _0x47f97e[_0x1bf9('0x11')](_[_0x1bf9('0x17')](_0x49437e)+_0x1bf9('0x18'),_0xec9aa3)[_0x1bf9('0x12')](function(_0x2a6e2f){if(_0x2a6e2f['error'])throw new Error(util[_0x1bf9('0x19')](_0x1bf9('0x1a'),_0x49437e));return _0x602340(_0x2a6e2f[_0x1bf9('0x13')]);})['catch'](function(_0x2b4550){_0x1ef3fa(_0x2b4550);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x4d7564,_0x264a0e){return amiClient[_0x1bf9('0x11')](_0x1bf9('0x1b'),{})[_0x1bf9('0x12')](function(_0xdd117){if(_0xdd117['error'])throw new Error(_0x1bf9('0x1c'));return _0x4d7564(_0xdd117['result']);})[_0x1bf9('0x1d')](function(_0x411b5c){_0x264a0e(_0x411b5c);});});}function initializeQueues(_0x4dd1d6,_0x1d6cef,_0x38baff,_0x50f995){var _0x10d62d=[_0x1bf9('0x1e'),_0x1bf9('0x1f'),_0x1bf9('0x20'),'talking',_0x1bf9('0x21')];if(_0x38baff===_0x1bf9('0x16')&&_0x50f995===_0x1bf9('0x22')){_0x10d62d[_0x1bf9('0x23')](_0x1bf9('0x24'),_0x1bf9('0x25'),_0x1bf9('0x26'),_0x1bf9('0x27'),_0x1bf9('0x28'),_0x1bf9('0x29'),_0x1bf9('0x2a'),'startProgressive','erlangCalls',_0x1bf9('0x2b'),_0x1bf9('0x2c'),_0x1bf9('0x2d'),_0x1bf9('0x2e'),'dialPredictiveIntervalMaxThreshold',_0x1bf9('0x2f'),'predictiveIntervalAvailable',_0x1bf9('0x30'),_0x1bf9('0x31'),_0x1bf9('0x32'),_0x1bf9('0x33'),'predictiveIntervalAvgHoldtime',_0x1bf9('0x34'));}return _0x4dd1d6['map'](function(_0x2cc4c1){var _0x6e0be=_0x2cc4c1[_0x1bf9('0x35')]({'plain':!![]});_0x6e0be[_0x1bf9('0x36')]=[];_0x6e0be[_0x1bf9('0x21')]=0x0;_0x6e0be[_0x1bf9('0x37')]=0x0;_0x6e0be[_0x1bf9('0x1e')]=0x0;_0x6e0be[_0x1bf9('0x1f')]=0x0;_0x6e0be[_0x1bf9('0x20')]=0x0;if(_0x38baff==='voice'){_0x6e0be[_0x1bf9('0x38')]=0x0;_0x6e0be[_0x1bf9('0x39')]=0x0;if(_0x50f995===_0x1bf9('0x22')){_0x6e0be[_0x1bf9('0x24')]=0x0;_0x6e0be[_0x1bf9('0x25')]=0x0;}}var _0x4ca71f=_[_0x1bf9('0x3a')](_0x1d6cef,['id',_0x6e0be['id']]);if(_0x4ca71f)_[_0x1bf9('0x15')](_0x6e0be,_[_0x1bf9('0x3b')](_0x4ca71f,_0x10d62d));return _0x6e0be;});}function updateAgentVoiceStatus(_0x250b0c,_0x52150e,_0xafd81a){var _0x10d4c5=_['filter'](_0xafd81a,[_0x1bf9('0x3c'),_0x52150e['name']]);if(_0x10d4c5['length']===0x0)return _0x250b0c[_0x1bf9('0x39')]=!![];if(_['some'](_0x10d4c5,[_0x1bf9('0x3d'),_0x250b0c['internal']['toString']()]))return _0x250b0c['talking']=!![];if(!_0x250b0c['talking'])return _0x250b0c[_0x1bf9('0x39')]=!![];}function getVoiceQueueAgents(_0x25a8fb,_0xf7838b,_0x323ad0,_0x4e3504){var _0x52a431=_['find'](_0xf7838b,['id',_0x25a8fb['id']]);if(!_0x52a431)return _0x25a8fb;return _0x52a431[_0x1bf9('0x3e')]({'raw':!![]})[_0x1bf9('0x12')](function(_0x2d0d3f){for(var _0x3dd0d8=0x0;_0x3dd0d8<_0x2d0d3f[_0x1bf9('0x3f')];_0x3dd0d8++){var _0x8289c1=_[_0x1bf9('0x3a')](_0x323ad0,['id',_0x2d0d3f[_0x3dd0d8][_0x1bf9('0x40')]]);if(!_0x8289c1){_0x8289c1={'id':_0x2d0d3f[_0x3dd0d8][_0x1bf9('0x40')],'name':_0x2d0d3f[_0x3dd0d8][_0x1bf9('0x40')],'accountcode':'','online':![]};}var _0x36f85b={'id':_0x8289c1['id'],'name':_0x8289c1[_0x1bf9('0xf')],'internal':_0x8289c1[_0x1bf9('0x41')],'online':Boolean(_0x8289c1[_0x1bf9('0x42')]),'paused':Boolean(_0x2d0d3f[_0x3dd0d8]['paused'])};if(_0x8289c1[_0x1bf9('0x43')]===_0x1bf9('0x38'))updateAgentVoiceStatus(_0x36f85b,_0x25a8fb,_0x4e3504);if(_0x36f85b['online'])_0x25a8fb[_0x1bf9('0x37')]++;if(_0x36f85b[_0x1bf9('0x39')])_0x25a8fb['busy']++;if(_0x36f85b[_0x1bf9('0x21')]&&!_0x36f85b['busy']&&!_0x36f85b['talking'])_0x25a8fb[_0x1bf9('0x21')]++;_0x25a8fb[_0x1bf9('0x36')][_0x1bf9('0x23')](_0x36f85b);}return _0x25a8fb;});}function getQueueAgents(_0x330f22,_0x363941,_0x10348a){var _0x33b981=_0x1bf9('0x44')+_[_0x1bf9('0x17')](_0x10348a)+_0x1bf9('0x45');var _0x59f53e=_0x10348a+_0x1bf9('0x46');return db[_0x33b981][_0x1bf9('0x47')]({'where':{[_[_0x1bf9('0x17')](_0x10348a)+_0x1bf9('0x48')]:_0x330f22['id']},'raw':!![]})[_0x1bf9('0x12')](function(_0x5db588){for(var _0x2a3a53=0x0;_0x2a3a53<_0x5db588[_0x1bf9('0x3f')];_0x2a3a53++){var _0x5841ef=_['find'](_0x363941,['id',_0x5db588[_0x2a3a53]['UserId']]);if(!_0x5841ef){_0x5841ef={'id':_0x5db588[_0x2a3a53]['UserId'],'name':_0x5db588[_0x2a3a53][_0x1bf9('0x40')],'online':![],['pauseField']:![]};}var _0x2bb60c={'id':_0x5841ef['id'],'name':_0x5841ef[_0x1bf9('0xf')],'online':Boolean(_0x5841ef[_0x1bf9('0x42')]),'paused':Boolean(_0x5841ef[_0x59f53e])};if(_0x2bb60c['online'])_0x330f22[_0x1bf9('0x37')]++;_0x330f22[_0x1bf9('0x36')]['push'](_0x2bb60c);}return _0x330f22;});}function isIdle(_0x160027){return _0x160027===_0x1bf9('0x49')||_0x160027===_0x1bf9('0x4a')||_0x160027===_0x1bf9('0x4b')||_0x160027===_0x1bf9('0x4c')||_[_0x1bf9('0x4d')](_0x160027);}function isAgentPaused(_0x30500c,_0x550973){var _0x47ded6=[_0x30500c[_0x1bf9('0x4e')],_0x30500c['faxPause'],_0x30500c[_0x1bf9('0x4f')],_0x30500c[_0x1bf9('0x50')],_0x30500c[_0x1bf9('0x51')],_0x30500c[_0x1bf9('0x52')],_0x30500c[_0x1bf9('0x53')]];if(!_0x550973)return _[_0x1bf9('0x54')](_0x47ded6);var _0x5669ae=_[_0x1bf9('0x55')](_0x47ded6);return _0x5669ae['length']>0x0&&_0x5669ae[_0x1bf9('0x3f')]<_0x47ded6[_0x1bf9('0x3f')]?!![]:![];}function isAgentIdle(_0x5b214d){if(_0x5b214d[_0x1bf9('0x43')]!=='idle'&&_0x5b214d[_0x1bf9('0x52')]){_0x5b214d[_0x1bf9('0x43')]=_0x1bf9('0x56');return![];}return _[_0x1bf9('0x54')]([_0x5b214d[_0x1bf9('0x57')],_0x5b214d['faxStatus'],_0x5b214d['mailStatus'],_0x5b214d[_0x1bf9('0x58')],_0x5b214d[_0x1bf9('0x59')],_0x5b214d[_0x1bf9('0x43')],_0x5b214d[_0x1bf9('0x5a')]],isIdle);}function getAgentStatus(_0x5c70d6){var _0x4b7514=_0x1bf9('0x4a');if(isAgentPaused(_0x5c70d6))_0x4b7514=_0x1bf9('0x56');else if(isAgentPaused(_0x5c70d6,!![]))_0x4b7514=_0x1bf9('0x5b');else if(isAgentIdle(_0x5c70d6))_0x4b7514='idle';else _0x4b7514=_0x1bf9('0x39');return _0x4b7514;}function validateChannel(_0x3b7a2b){var _0x5f156d=['mail',_0x1bf9('0x5c'),_0x1bf9('0x5d'),_0x1bf9('0x5e'),_0x1bf9('0x5f'),_0x1bf9('0x60'),_0x1bf9('0x16')];if(!_[_0x1bf9('0x61')](_0x5f156d,_0x3b7a2b['toLowerCase']()))throw new Error(_0x1bf9('0x62'));return _0x3b7a2b[_0x1bf9('0x63')]();}function getFilteredAgentIds(_0x57a901,_0x36297b){var _0x101d15=_[_0x1bf9('0x64')](_0x57a901)?_0x57a901:[_0x57a901];var _0x491a81=_[_0x1bf9('0x65')](_0x101d15,function(_0x4987fa){return db[_0x36297b]['findOne']({'where':{'name':_0x4987fa}})[_0x1bf9('0x12')](function(_0x30bcb9){if(!_0x30bcb9)return[];return _0x30bcb9[_0x1bf9('0x66')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x1bf9('0x67')](_0x491a81)[_0x1bf9('0x12')](function(_0x55be5b){var _0x2f3f63=_(_0x55be5b)[_0x1bf9('0x68')]()[_0x1bf9('0x65')]('id')['uniq']()[_0x1bf9('0x69')]();return _0x2f3f63;});}function getUpdatedSortOptions(_0x51e0a6){var _0x10e20e={'fields':[],'order':null};var _0x37f0de=_0x51e0a6['split'](',');_0x10e20e[_0x1bf9('0x6a')]=_[_0x1bf9('0x55')](_0x37f0de,function(_0x501522){if(!_0x501522[_0x1bf9('0x61')](_0x1bf9('0x6b')))return!![];_0x10e20e['order']=_[_0x1bf9('0x6c')](_0x501522,'-')?_0x1bf9('0x6d'):_0x1bf9('0x6e');return![];});return _0x10e20e;}function orderAgentsByStatus(_0xffbac,_0x567e18){return _0xffbac[_0x1bf9('0x6f')](function(_0x1a2755,_0x5f3564){if(_0x1a2755['globalStatus']===_0x5f3564[_0x1bf9('0x6b')]&&_0x1a2755['globalStatus']===_0x1bf9('0x56')){if(_0x567e18===_0x1bf9('0x6d'))return(_0x1a2755['pauseType']||'')<(_0x5f3564[_0x1bf9('0x70')]||'')?0x1:-0x1;return _0x1a2755[_0x1bf9('0x70')]<_0x5f3564[_0x1bf9('0x70')]?-0x1:0x1;}else{if(_0x567e18===_0x1bf9('0x6d'))return _0x1a2755[_0x1bf9('0x6b')]<_0x5f3564[_0x1bf9('0x6b')]?0x1:-0x1;return _0x1a2755['globalStatus']<_0x5f3564['globalStatus']?-0x1:0x1;}});}exports[_0x1bf9('0x66')]=function(_0x3c5d80,_0x1f47e9){var _0x59b200={'count':0x0,'rows':[]},_0x4b82c1={},_0x42026b,_0x4c5f88,_0x3afc61,_0x2f40bc,_0x234894=[_0x1bf9('0x71'),_0x1bf9('0x42'),_0x1bf9('0x72'),_0x1bf9('0x73'),_0x1bf9('0x70'),_0x1bf9('0x73'),_0x1bf9('0x74'),_0x1bf9('0x75'),_0x1bf9('0x4e'),_0x1bf9('0x50'),_0x1bf9('0x4f'),_0x1bf9('0x51'),_0x1bf9('0x53'),_0x1bf9('0x76'),_0x1bf9('0x52'),_0x1bf9('0x77'),_0x1bf9('0x78'),_0x1bf9('0x79'),'smsCapacity',_0x1bf9('0x7a'),'faxCapacity','chatCurrentCapacity',_0x1bf9('0x7b'),_0x1bf9('0x7c'),_0x1bf9('0x7d'),_0x1bf9('0x7e'),'faxCurrentCapacity',_0x1bf9('0x57'),_0x1bf9('0x58'),_0x1bf9('0x7f'),_0x1bf9('0x59'),_0x1bf9('0x5a'),'faxStatus',_0x1bf9('0x43'),_0x1bf9('0x80'),'openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime',_0x1bf9('0x81'),_0x1bf9('0x82'),'queue','destconnectedlinenum',_0x1bf9('0x83'),_0x1bf9('0x84'),_0x1bf9('0x85'),_0x1bf9('0x86')],_0x3fdd27=['chatPause',_0x1bf9('0x50'),_0x1bf9('0x4f'),_0x1bf9('0x51'),_0x1bf9('0x53'),'faxPause','voicePause','online'];Promise[_0x1bf9('0x87')]()['then'](function(){if(_0x3c5d80[_0x1bf9('0x88')]['channel'])_0x42026b=validateChannel(_0x3c5d80[_0x1bf9('0x88')][_0x1bf9('0x89')]);if(!_0x3c5d80[_0x1bf9('0x88')][_0x1bf9('0x6f')]||!_0x3c5d80[_0x1bf9('0x88')][_0x1bf9('0x6f')][_0x1bf9('0x61')](_0x1bf9('0x6b')))return;var _0x16b42f=getUpdatedSortOptions(_0x3c5d80['query'][_0x1bf9('0x6f')]);_0x3c5d80[_0x1bf9('0x88')][_0x1bf9('0x6f')]=_0x16b42f['fields']['join'](',');_0x4c5f88=_0x16b42f[_0x1bf9('0x8a')];})[_0x1bf9('0x12')](function(){if(!_0x3c5d80[_0x1bf9('0x88')][_0x1bf9('0x8b')])return[];var _0xac6a1a=_[_0x1bf9('0x17')](_0x42026b)+_0x1bf9('0x45');return getFilteredAgentIds(_0x3c5d80[_0x1bf9('0x88')][_0x1bf9('0x8b')],_0xac6a1a);})[_0x1bf9('0x12')](function(_0x2d8db1){var _0x1e35ce=_[_0x1bf9('0x65')](db[_0x1bf9('0x44')]['rawAttributes'],function(_0x14b852){return{'name':_0x14b852[_0x1bf9('0x8c')],'type':_0x14b852[_0x1bf9('0x8d')][_0x1bf9('0x8e')]};});_0x3c5d80[_0x1bf9('0x88')][_0x1bf9('0x8f')]=_0x1bf9('0x90');_0x3c5d80['query'][_0x1bf9('0x42')]=!![];_0x4b82c1=qs['getOptions'](_0x1e35ce,_0x3c5d80);_0x4b82c1['raw']=!![];if(!_['isEmpty'](_0x2d8db1)){_0x4b82c1['where']=_['merge'](_0x4b82c1[_0x1bf9('0x91')],{'$and':[{'id':{'$in':_0x2d8db1}}]});}else if(!_['isEmpty'](_0x3c5d80[_0x1bf9('0x88')][_0x1bf9('0x8b')])){return _0x59b200;}if(_0x3c5d80['user'][_0x1bf9('0x8f')]===_0x1bf9('0x92')){var _0x549201={'params':{'id':_0x3c5d80['user'][_0x1bf9('0x93')]},'query':{'section':_0x1bf9('0x94'),'role':_0x1bf9('0x90'),'online':!![],'nolimit':_0x3c5d80['query'][_0x1bf9('0x95')],'sort':_0x3c5d80[_0x1bf9('0x88')]['sort'],'filter':_0x3c5d80[_0x1bf9('0x88')][_0x1bf9('0x55')],'raw':!![],'ids':_0x2d8db1}};return db[_0x1bf9('0x96')][_0x1bf9('0x97')](_0x549201);}return db[_0x1bf9('0x44')][_0x1bf9('0x98')](_0x4b82c1);})[_0x1bf9('0x12')](function(_0x2be098){_0x59b200[_0x1bf9('0x9')]=_0x2be098['count'];_0x3afc61=_0x2be098[_0x1bf9('0x99')];return getRealtimeAgents();})['then'](function(_0x20c789){_0x2f40bc=_0x20c789[_0x1bf9('0x99')];return _0x3afc61[_0x1bf9('0x65')](function(_0xd1a7e9){var _0x2188b2=_['find'](_0x2f40bc,['id',_0xd1a7e9['id']]);if(_0x2188b2)_[_0x1bf9('0x15')](_0xd1a7e9,_[_0x1bf9('0x3b')](_[_0x1bf9('0x9a')](_0x2188b2,_0x3fdd27),_0x234894));_0xd1a7e9['globalStatus']=getAgentStatus(_0xd1a7e9);return _0xd1a7e9;});})[_0x1bf9('0x12')](function(_0x4c0aa1){var _0x410bdb;if(_0x3c5d80[_0x1bf9('0x88')][_0x1bf9('0x9b')]){_0x410bdb=_['filter'](_0x4c0aa1,[_0x1bf9('0x6b'),_0x3c5d80['query'][_0x1bf9('0x9b')]]);if(_0x3c5d80['query'][_0x1bf9('0x9c')]){_0x410bdb=_[_0x1bf9('0x55')](_0x410bdb,[_0x1bf9('0x70'),_0x3c5d80['query'][_0x1bf9('0x9c')]]);}}if(_0x410bdb)_0x4c0aa1=_0x410bdb;if(!_0x4c5f88)return _0x4c0aa1;return orderAgentsByStatus(_0x4c0aa1,_0x4c5f88);})[_0x1bf9('0x12')](function(_0x4004d4){_0x59b200[_0x1bf9('0x99')]=_0x4004d4;return _0x59b200;})['then'](respondWithFilteredResult(_0x1f47e9,_0x4b82c1))[_0x1bf9('0x1d')](handleError(_0x1f47e9,null));};exports[_0x1bf9('0x9d')]=function(_0x37bff8,_0x2c304f){var _0x2c5db5={'count':0x0,'rows':[]},_0x4e7928={},_0x4b50d2,_0x42adac,_0x438288,_0x41741b,_0x4c1adc;Promise[_0x1bf9('0x87')]()['then'](function(){if(_0x37bff8[_0x1bf9('0x88')][_0x1bf9('0x89')])_0x4b50d2=validateChannel(_0x37bff8[_0x1bf9('0x88')][_0x1bf9('0x89')]);var _0x57c378=_[_0x1bf9('0x17')](_0x4b50d2)+'Queue';var _0x31bb83=_[_0x1bf9('0x65')](db[_0x57c378][_0x1bf9('0x9e')],function(_0xa711cb){return{'name':_0xa711cb[_0x1bf9('0x8c')],'type':_0xa711cb[_0x1bf9('0x8d')][_0x1bf9('0x8e')]};});_0x4e7928=qs[_0x1bf9('0x9f')](_0x31bb83,_0x37bff8);if(_0x37bff8[_0x1bf9('0x92')][_0x1bf9('0x8f')]==='user'){var _0x14a824={'params':{'id':_0x37bff8[_0x1bf9('0x92')][_0x1bf9('0x93')]},'query':{'section':_0x4b50d2===_0x1bf9('0x16')&&_0x37bff8[_0x1bf9('0x88')][_0x1bf9('0x8d')]==='outbound'?_0x1bf9('0xa0'):_[_0x1bf9('0x17')](_0x4b50d2)+'Queues','type':_0x37bff8[_0x1bf9('0x88')][_0x1bf9('0x8d')],'nolimit':!![],'sort':'name','filter':_0x37bff8[_0x1bf9('0x88')][_0x1bf9('0x55')]}};return db['UserProfile'][_0x1bf9('0x97')](_0x14a824);}return db[_0x57c378]['findAndCountAll'](_0x4e7928);})[_0x1bf9('0x12')](function(_0x34da36){_0x2c5db5[_0x1bf9('0x9')]=_0x34da36['count'];_0x42adac=_0x34da36[_0x1bf9('0x99')];return getRealtimeQueues(_0x37bff8,_0x4b50d2);})[_0x1bf9('0x12')](function(_0x2c1cc5){_0x41741b=_0x2c1cc5[_0x1bf9('0x99')];return getRealtimeAgents();})[_0x1bf9('0x12')](function(_0x167947){_0x438288=_0x167947[_0x1bf9('0x99')];if(_0x4b50d2!=_0x1bf9('0x16'))return;return getRealtimeVoiceQueueChannels();})[_0x1bf9('0x12')](function(_0x43b0dd){_0x4c1adc=_0x43b0dd?_0x43b0dd[_0x1bf9('0x99')]:[];return initializeQueues(_0x42adac,_0x41741b,_0x4b50d2,_0x37bff8[_0x1bf9('0x88')][_0x1bf9('0x8d')]);})[_0x1bf9('0x12')](function(_0x18749){var _0x3940e1=_0x18749[_0x1bf9('0x65')](function(_0x70dc94){if(_0x4b50d2==='voice')return getVoiceQueueAgents(_0x70dc94,_0x42adac,_0x438288,_0x4c1adc);else return getQueueAgents(_0x70dc94,_0x438288,_0x4b50d2);});return Promise['all'](_0x3940e1);})[_0x1bf9('0x12')](function(_0x1b8976){_0x2c5db5['rows']=_0x1b8976;return _0x2c5db5;})['then'](respondWithFilteredResult(_0x2c304f,_0x4e7928))['catch'](handleError(_0x2c304f,null));};
\ No newline at end of file
+var _0x21da=['error','stack','name','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','catch','voice','startCase','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','waiting','talking','paused','push','pTalking','originated','message','dialActive','Trunk','startPredictive','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','loggedIn','busy','outbound','find','pick','filter','queue','length','some','connectedlinenum','internal','getMembers','UserId','accountcode','online','loggedInDb','User','Queue','Pause','findAll','QueueId','idle','unknown','unavailable','ringing','isNil','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','voiceStatus','pause','faxStatus','mailStatus','openchannelStatus','*pause','mail','chat','sms','openchannel','whatsapp','toLowerCase','isArray','getAgents','all','flatten','split','fields','includes','globalStatus','order','startsWith','DESC','ASC','pauseType','lastLoginAt','lastPauseAt','address','chatCapacity','smsCapacity','whatsappCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','smsStatus','whatsappStatus','chatStatusTime','openchannelStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','routealias','query','channel','sort','join','globalQueueFilter','fieldName','key','role','agent','where','merge','user','userProfileId','getResources','findAndCountAll','omit','globalStatusFilter','pauseTypeFilter','rows','getQueues','resolve','rawAttributes','type','getOptions','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','../../mysqldb','client','http','offset','undefined','limit','count','status','set','Content-Range','json'];(function(_0x58fcac,_0x106c64){var _0x7456d8=function(_0x472555){while(--_0x472555){_0x58fcac['push'](_0x58fcac['shift']());}};_0x7456d8(++_0x106c64);}(_0x21da,0x93));var _0xa21d=function(_0x3dcf14,_0x2c13f0){_0x3dcf14=_0x3dcf14-0x0;var _0x2af92e=_0x21da[_0x3dcf14];return _0x2af92e;};'use strict';var util=require('util');var _=require(_0xa21d('0x0'));var jayson=require(_0xa21d('0x1'));var qs=require(_0xa21d('0x2'));var logger=require(_0xa21d('0x3'))('api');var db=require(_0xa21d('0x4'))['db'];var amiClient=jayson[_0xa21d('0x5')][_0xa21d('0x6')]({'port':0x232a});var routingClient=jayson['client'][_0xa21d('0x6')]({'port':0x232c});function respondWithFilteredResult(_0xbed4e5,_0x5ede18){return function(_0x55edc8){if(_0x55edc8){var _0x191c99=typeof _0x5ede18[_0xa21d('0x7')]===_0xa21d('0x8')&&typeof _0x5ede18[_0xa21d('0x9')]===_0xa21d('0x8');var _0x18ecf3=_0x55edc8['count'];var _0x4ea65f=_0x191c99?0x0:_0x5ede18[_0xa21d('0x7')];var _0x978550=_0x191c99?_0x55edc8[_0xa21d('0xa')]:_0x5ede18[_0xa21d('0x7')]+_0x5ede18['limit'];var _0x80ba2f;if(_0x978550>=_0x18ecf3){_0x978550=_0x18ecf3;_0x80ba2f=0xc8;}else{_0x80ba2f=0xce;}_0xbed4e5[_0xa21d('0xb')](_0x80ba2f);return _0xbed4e5[_0xa21d('0xc')](_0xa21d('0xd'),_0x4ea65f+'-'+_0x978550+'/'+_0x18ecf3)[_0xa21d('0xe')](_0x55edc8);}return null;};}function handleError(_0x48a033,_0x3e1169){_0x3e1169=_0x3e1169||0x1f4;return function(_0x1069c0){logger[_0xa21d('0xf')](_0x1069c0[_0xa21d('0x10')]);if(_0x1069c0[_0xa21d('0x11')]){delete _0x1069c0[_0xa21d('0x11')];}_0x48a033[_0xa21d('0xb')](_0x3e1169)[_0xa21d('0x12')](_0x1069c0);};}function getRealtimeAgents(){return new Promise(function(_0x25cf25,_0x1ca55a){return amiClient[_0xa21d('0x13')](_0xa21d('0x14'),{})[_0xa21d('0x15')](function(_0x29a9e5){if(_0x29a9e5[_0xa21d('0xf')])throw new Error(_0xa21d('0x16'));var _0x2fad04=_0x29a9e5['result'];return routingClient['request'](_0xa21d('0x14'),{})['then'](function(_0x1b3fb2){if(_0x1b3fb2[_0xa21d('0xf')])throw new Error(_0xa21d('0x17'));var _0xcacdeb=_0x1b3fb2[_0xa21d('0x18')];return _0x25cf25(_['merge']({},_0x2fad04,_0xcacdeb));});})[_0xa21d('0x19')](function(_0x2934ed){_0x1ca55a(_0x2934ed);});});}function getRealtimeQueues(_0x32e2a6,_0x1b20c0){return new Promise(function(_0x3aba15,_0x3b0147){var _0x3ee9cb=_0x1b20c0===_0xa21d('0x1a')?amiClient:routingClient;return _0x3ee9cb[_0xa21d('0x13')](_[_0xa21d('0x1b')](_0x1b20c0)+'Queues',_0x32e2a6)[_0xa21d('0x15')](function(_0x21669f){if(_0x21669f[_0xa21d('0xf')])throw new Error(util['format'](_0xa21d('0x1c'),_0x1b20c0));return _0x3aba15(_0x21669f['result']);})[_0xa21d('0x19')](function(_0x1a6f52){_0x3b0147(_0x1a6f52);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x323f30,_0x1ab1c0){return amiClient[_0xa21d('0x13')](_0xa21d('0x1d'),{})[_0xa21d('0x15')](function(_0x27e998){if(_0x27e998[_0xa21d('0xf')])throw new Error(_0xa21d('0x1e'));return _0x323f30(_0x27e998[_0xa21d('0x18')]);})[_0xa21d('0x19')](function(_0x233906){_0x1ab1c0(_0x233906);});});}function initializeQueues(_0x9cb3b5,_0x4726da,_0x4e736a,_0x3fa3b2){var _0x5464ea=['loggedIn',_0xa21d('0x1f'),_0xa21d('0x20'),_0xa21d('0x21'),_0xa21d('0x22')];if(_0x4e736a===_0xa21d('0x1a')&&_0x3fa3b2==='outbound'){_0x5464ea[_0xa21d('0x23')](_0xa21d('0x24'),_0xa21d('0x25'),_0xa21d('0x26'),_0xa21d('0x27'),'dialMethod',_0xa21d('0x28'),_0xa21d('0x29'),'startProgressive','erlangCalls','erlangCallToSecond',_0xa21d('0x2a'),_0xa21d('0x2b'),_0xa21d('0x2c'),_0xa21d('0x2d'),_0xa21d('0x2e'),_0xa21d('0x2f'),_0xa21d('0x30'),_0xa21d('0x31'),_0xa21d('0x32'),_0xa21d('0x33'),_0xa21d('0x34'),_0xa21d('0x35'));}return _0x9cb3b5[_0xa21d('0x36')](function(_0x345640){var _0x401e66=_0x345640[_0xa21d('0x37')]({'plain':!![]});_0x401e66[_0xa21d('0x38')]=[];_0x401e66['paused']=0x0;_0x401e66['loggedInDb']=0x0;_0x401e66[_0xa21d('0x39')]=0x0;_0x401e66['available']=0x0;_0x401e66[_0xa21d('0x20')]=0x0;if(_0x4e736a===_0xa21d('0x1a')){_0x401e66[_0xa21d('0x21')]=0x0;_0x401e66[_0xa21d('0x3a')]=0x0;if(_0x3fa3b2===_0xa21d('0x3b')){_0x401e66[_0xa21d('0x24')]=0x0;_0x401e66[_0xa21d('0x25')]=0x0;}}var _0x512aac=_[_0xa21d('0x3c')](_0x4726da,['id',_0x401e66['id']]);if(_0x512aac)_['merge'](_0x401e66,_[_0xa21d('0x3d')](_0x512aac,_0x5464ea));return _0x401e66;});}function updateAgentVoiceStatus(_0xe47267,_0x4b7ca1,_0x68205c){var _0x54ed50=_[_0xa21d('0x3e')](_0x68205c,[_0xa21d('0x3f'),_0x4b7ca1[_0xa21d('0x11')]]);if(_0x54ed50[_0xa21d('0x40')]===0x0)return _0xe47267[_0xa21d('0x3a')]=!![];if(_[_0xa21d('0x41')](_0x54ed50,[_0xa21d('0x42'),_0xe47267[_0xa21d('0x43')]['toString']()]))return _0xe47267[_0xa21d('0x21')]=!![];if(!_0xe47267[_0xa21d('0x21')])return _0xe47267[_0xa21d('0x3a')]=!![];}function getVoiceQueueAgents(_0x3fd6f3,_0x429e81,_0x58a024,_0x401def){var _0x11979d=_[_0xa21d('0x3c')](_0x429e81,['id',_0x3fd6f3['id']]);if(!_0x11979d)return _0x3fd6f3;return _0x11979d[_0xa21d('0x44')]({'raw':!![]})[_0xa21d('0x15')](function(_0x5cea47){for(var _0x299786=0x0;_0x299786<_0x5cea47[_0xa21d('0x40')];_0x299786++){var _0x3f4126=_['find'](_0x58a024,['id',_0x5cea47[_0x299786]['UserId']]);if(!_0x3f4126){_0x3f4126={'id':_0x5cea47[_0x299786][_0xa21d('0x45')],'name':_0x5cea47[_0x299786]['UserId'],'accountcode':'','online':![]};}var _0x49a128={'id':_0x3f4126['id'],'name':_0x3f4126[_0xa21d('0x11')],'internal':_0x3f4126[_0xa21d('0x46')],'online':Boolean(_0x3f4126[_0xa21d('0x47')]),'paused':Boolean(_0x5cea47[_0x299786]['paused'])};if(_0x3f4126['voiceStatus']===_0xa21d('0x21'))updateAgentVoiceStatus(_0x49a128,_0x3fd6f3,_0x401def);if(_0x49a128[_0xa21d('0x47')])_0x3fd6f3[_0xa21d('0x48')]++;if(_0x49a128[_0xa21d('0x3a')])_0x3fd6f3['busy']++;if(_0x49a128['paused']&&!_0x49a128[_0xa21d('0x3a')]&&!_0x49a128[_0xa21d('0x21')])_0x3fd6f3[_0xa21d('0x22')]++;_0x3fd6f3[_0xa21d('0x38')][_0xa21d('0x23')](_0x49a128);}return _0x3fd6f3;});}function getQueueAgents(_0x386aa1,_0x2cb46d,_0x186ebf){var _0x43ee80=_0xa21d('0x49')+_['startCase'](_0x186ebf)+_0xa21d('0x4a');var _0x9efc80=_0x186ebf+_0xa21d('0x4b');return db[_0x43ee80][_0xa21d('0x4c')]({'where':{[_[_0xa21d('0x1b')](_0x186ebf)+_0xa21d('0x4d')]:_0x386aa1['id']},'raw':!![]})[_0xa21d('0x15')](function(_0x1268c7){for(var _0x1dde19=0x0;_0x1dde19<_0x1268c7[_0xa21d('0x40')];_0x1dde19++){var _0x350654=_[_0xa21d('0x3c')](_0x2cb46d,['id',_0x1268c7[_0x1dde19]['UserId']]);if(!_0x350654){_0x350654={'id':_0x1268c7[_0x1dde19][_0xa21d('0x45')],'name':_0x1268c7[_0x1dde19][_0xa21d('0x45')],'online':![],['pauseField']:![]};}var _0x4d80d4={'id':_0x350654['id'],'name':_0x350654[_0xa21d('0x11')],'online':Boolean(_0x350654[_0xa21d('0x47')]),'paused':Boolean(_0x350654[_0x9efc80])};if(_0x4d80d4[_0xa21d('0x47')])_0x386aa1['loggedInDb']++;_0x386aa1[_0xa21d('0x38')]['push'](_0x4d80d4);}return _0x386aa1;});}function isIdle(_0x35f016){return _0x35f016===_0xa21d('0x4e')||_0x35f016===_0xa21d('0x4f')||_0x35f016===_0xa21d('0x50')||_0x35f016===_0xa21d('0x51')||_[_0xa21d('0x52')](_0x35f016);}function isAgentPaused(_0x26491d,_0xc91482){var _0x1e2455=[_0x26491d[_0xa21d('0x53')],_0x26491d[_0xa21d('0x54')],_0x26491d[_0xa21d('0x55')],_0x26491d[_0xa21d('0x56')],_0x26491d[_0xa21d('0x57')],_0x26491d[_0xa21d('0x58')],_0x26491d[_0xa21d('0x59')]];if(!_0xc91482)return _[_0xa21d('0x5a')](_0x1e2455);var _0x265a7e=_[_0xa21d('0x3e')](_0x1e2455);return _0x265a7e['length']>0x0&&_0x265a7e[_0xa21d('0x40')]<_0x1e2455[_0xa21d('0x40')]?!![]:![];}function isAgentIdle(_0x351a65){if(_0x351a65[_0xa21d('0x5b')]!==_0xa21d('0x4e')&&_0x351a65['voicePause']){_0x351a65['voiceStatus']=_0xa21d('0x5c');return![];}return _[_0xa21d('0x5a')]([_0x351a65['chatStatus'],_0x351a65[_0xa21d('0x5d')],_0x351a65[_0xa21d('0x5e')],_0x351a65[_0xa21d('0x5f')],_0x351a65['smsStatus'],_0x351a65[_0xa21d('0x5b')],_0x351a65['whatsappStatus']],isIdle);}function getAgentStatus(_0x2badd1){var _0x3f5460='unknown';if(isAgentPaused(_0x2badd1))_0x3f5460=_0xa21d('0x5c');else if(isAgentPaused(_0x2badd1,!![]))_0x3f5460=_0xa21d('0x60');else if(isAgentIdle(_0x2badd1))_0x3f5460=_0xa21d('0x4e');else _0x3f5460=_0xa21d('0x3a');return _0x3f5460;}function validateChannel(_0x155d7d){var _0x260b0f=[_0xa21d('0x61'),_0xa21d('0x62'),_0xa21d('0x63'),_0xa21d('0x64'),'fax',_0xa21d('0x65'),_0xa21d('0x1a')];if(!_['includes'](_0x260b0f,_0x155d7d[_0xa21d('0x66')]()))throw new Error('Invalid\x20channel');return _0x155d7d[_0xa21d('0x66')]();}function getFilteredAgentIds(_0x4b8253,_0x45fcae){var _0x223596=_[_0xa21d('0x67')](_0x4b8253)?_0x4b8253:[_0x4b8253];var _0x218bd8=_[_0xa21d('0x36')](_0x223596,function(_0x19c833){return db[_0x45fcae]['findOne']({'where':{'name':_0x19c833}})[_0xa21d('0x15')](function(_0x16ae45){if(!_0x16ae45)return[];return _0x16ae45[_0xa21d('0x68')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xa21d('0x69')](_0x218bd8)[_0xa21d('0x15')](function(_0x3b5e36){var _0x3b992c=_(_0x3b5e36)[_0xa21d('0x6a')]()[_0xa21d('0x36')]('id')['uniq']()['value']();return _0x3b992c;});}function getUpdatedSortOptions(_0x2fb6eb){var _0x1d808c={'fields':[],'order':null};var _0x367216=_0x2fb6eb[_0xa21d('0x6b')](',');_0x1d808c[_0xa21d('0x6c')]=_[_0xa21d('0x3e')](_0x367216,function(_0x60f5df){if(!_0x60f5df[_0xa21d('0x6d')](_0xa21d('0x6e')))return!![];_0x1d808c[_0xa21d('0x6f')]=_[_0xa21d('0x70')](_0x60f5df,'-')?_0xa21d('0x71'):_0xa21d('0x72');return![];});return _0x1d808c;}function orderAgentsByStatus(_0x171286,_0x5440b3){return _0x171286['sort'](function(_0x26ec52,_0x2266c1){if(_0x26ec52[_0xa21d('0x6e')]===_0x2266c1['globalStatus']&&_0x26ec52[_0xa21d('0x6e')]===_0xa21d('0x5c')){if(_0x5440b3==='DESC')return(_0x26ec52[_0xa21d('0x73')]||'')<(_0x2266c1['pauseType']||'')?0x1:-0x1;return _0x26ec52[_0xa21d('0x73')]<_0x2266c1[_0xa21d('0x73')]?-0x1:0x1;}else{if(_0x5440b3===_0xa21d('0x71'))return _0x26ec52['globalStatus']<_0x2266c1[_0xa21d('0x6e')]?0x1:-0x1;return _0x26ec52['globalStatus']<_0x2266c1[_0xa21d('0x6e')]?-0x1:0x1;}});}exports[_0xa21d('0x68')]=function(_0x2615fe,_0x123892){var _0xa30d={'count':0x0,'rows':[]},_0x4cfba9={},_0x4f52ef,_0x530964,_0xdfa09b,_0x4f87f4,_0x1ed9f7=['userpic',_0xa21d('0x47'),_0xa21d('0x74'),_0xa21d('0x75'),'pauseType',_0xa21d('0x75'),_0xa21d('0x43'),_0xa21d('0x76'),'chatPause',_0xa21d('0x56'),_0xa21d('0x55'),_0xa21d('0x57'),_0xa21d('0x59'),_0xa21d('0x54'),_0xa21d('0x58'),_0xa21d('0x77'),'openchannelCapacity','mailCapacity',_0xa21d('0x78'),_0xa21d('0x79'),'faxCapacity','chatCurrentCapacity',_0xa21d('0x7a'),_0xa21d('0x7b'),'smsCurrentCapacity',_0xa21d('0x7c'),_0xa21d('0x7d'),_0xa21d('0x7e'),_0xa21d('0x5f'),_0xa21d('0x5e'),_0xa21d('0x7f'),_0xa21d('0x80'),'faxStatus','voiceStatus',_0xa21d('0x81'),_0xa21d('0x82'),'mailStatusTime','smsStatusTime',_0xa21d('0x83'),_0xa21d('0x84'),_0xa21d('0x85'),'queue',_0xa21d('0x86'),_0xa21d('0x87'),_0xa21d('0x88'),'phoneBarEnableAutomaticScreenRecording',_0xa21d('0x89')],_0x236552=[_0xa21d('0x53'),'openchannelPause',_0xa21d('0x55'),'smsPause',_0xa21d('0x59'),_0xa21d('0x54'),_0xa21d('0x58'),_0xa21d('0x47')];Promise['resolve']()[_0xa21d('0x15')](function(){if(_0x2615fe[_0xa21d('0x8a')]['channel'])_0x4f52ef=validateChannel(_0x2615fe[_0xa21d('0x8a')][_0xa21d('0x8b')]);if(!_0x2615fe[_0xa21d('0x8a')]['sort']||!_0x2615fe[_0xa21d('0x8a')][_0xa21d('0x8c')][_0xa21d('0x6d')](_0xa21d('0x6e')))return;var _0x263e8c=getUpdatedSortOptions(_0x2615fe[_0xa21d('0x8a')][_0xa21d('0x8c')]);_0x2615fe[_0xa21d('0x8a')][_0xa21d('0x8c')]=_0x263e8c['fields'][_0xa21d('0x8d')](',');_0x530964=_0x263e8c[_0xa21d('0x6f')];})[_0xa21d('0x15')](function(){if(!_0x2615fe[_0xa21d('0x8a')][_0xa21d('0x8e')])return[];var _0x151253=_['startCase'](_0x4f52ef)+_0xa21d('0x4a');return getFilteredAgentIds(_0x2615fe[_0xa21d('0x8a')]['globalQueueFilter'],_0x151253);})[_0xa21d('0x15')](function(_0x365db9){var _0x1876ab=_[_0xa21d('0x36')](db[_0xa21d('0x49')]['rawAttributes'],function(_0x4d7945){return{'name':_0x4d7945[_0xa21d('0x8f')],'type':_0x4d7945['type'][_0xa21d('0x90')]};});_0x2615fe[_0xa21d('0x8a')][_0xa21d('0x91')]=_0xa21d('0x92');_0x2615fe[_0xa21d('0x8a')]['online']=!![];_0x4cfba9=qs['getOptions'](_0x1876ab,_0x2615fe);_0x4cfba9['raw']=!![];if(!_['isEmpty'](_0x365db9)){_0x4cfba9[_0xa21d('0x93')]=_[_0xa21d('0x94')](_0x4cfba9[_0xa21d('0x93')],{'$and':[{'id':{'$in':_0x365db9}}]});}else if(!_['isEmpty'](_0x2615fe[_0xa21d('0x8a')][_0xa21d('0x8e')])){return _0xa30d;}if(_0x2615fe[_0xa21d('0x95')][_0xa21d('0x91')]==='user'){var _0x6c2b9b={'params':{'id':_0x2615fe[_0xa21d('0x95')][_0xa21d('0x96')]},'query':{'section':_0xa21d('0x14'),'role':_0xa21d('0x92'),'online':!![],'nolimit':_0x2615fe[_0xa21d('0x8a')]['nolimit'],'sort':_0x2615fe['query'][_0xa21d('0x8c')],'filter':_0x2615fe[_0xa21d('0x8a')][_0xa21d('0x3e')],'raw':!![],'ids':_0x365db9}};return db['UserProfile'][_0xa21d('0x97')](_0x6c2b9b);}return db['User'][_0xa21d('0x98')](_0x4cfba9);})['then'](function(_0x143acc){_0xa30d[_0xa21d('0xa')]=_0x143acc[_0xa21d('0xa')];_0xdfa09b=_0x143acc['rows'];return getRealtimeAgents();})[_0xa21d('0x15')](function(_0x31e606){_0x4f87f4=_0x31e606['rows'];return _0xdfa09b[_0xa21d('0x36')](function(_0x53b024){var _0x5b85e6=_[_0xa21d('0x3c')](_0x4f87f4,['id',_0x53b024['id']]);if(_0x5b85e6)_[_0xa21d('0x94')](_0x53b024,_['pick'](_[_0xa21d('0x99')](_0x5b85e6,_0x236552),_0x1ed9f7));_0x53b024[_0xa21d('0x6e')]=getAgentStatus(_0x53b024);return _0x53b024;});})[_0xa21d('0x15')](function(_0x2b4498){var _0x1afdab;if(_0x2615fe[_0xa21d('0x8a')][_0xa21d('0x9a')]){_0x1afdab=_[_0xa21d('0x3e')](_0x2b4498,[_0xa21d('0x6e'),_0x2615fe['query'][_0xa21d('0x9a')]]);if(_0x2615fe[_0xa21d('0x8a')][_0xa21d('0x9b')]){_0x1afdab=_[_0xa21d('0x3e')](_0x1afdab,[_0xa21d('0x73'),_0x2615fe[_0xa21d('0x8a')]['pauseTypeFilter']]);}}if(_0x1afdab)_0x2b4498=_0x1afdab;if(!_0x530964)return _0x2b4498;return orderAgentsByStatus(_0x2b4498,_0x530964);})[_0xa21d('0x15')](function(_0x81268a){_0xa30d[_0xa21d('0x9c')]=_0x81268a;return _0xa30d;})[_0xa21d('0x15')](respondWithFilteredResult(_0x123892,_0x4cfba9))['catch'](handleError(_0x123892,null));};exports[_0xa21d('0x9d')]=function(_0x23de7e,_0x45449f){var _0x56e013={'count':0x0,'rows':[]},_0x37c7a6={},_0x2e225e,_0x3d9994,_0x272ed8,_0x188eda,_0x3dad39;Promise[_0xa21d('0x9e')]()[_0xa21d('0x15')](function(){if(_0x23de7e[_0xa21d('0x8a')]['channel'])_0x2e225e=validateChannel(_0x23de7e[_0xa21d('0x8a')]['channel']);var _0x172663=_['startCase'](_0x2e225e)+_0xa21d('0x4a');var _0x54c0c0=_['map'](db[_0x172663][_0xa21d('0x9f')],function(_0x2fc3e9){return{'name':_0x2fc3e9[_0xa21d('0x8f')],'type':_0x2fc3e9[_0xa21d('0xa0')][_0xa21d('0x90')]};});_0x37c7a6=qs[_0xa21d('0xa1')](_0x54c0c0,_0x23de7e);if(_0x23de7e[_0xa21d('0x95')]['role']===_0xa21d('0x95')){var _0x5af06c={'params':{'id':_0x23de7e['user'][_0xa21d('0x96')]},'query':{'section':_0x2e225e===_0xa21d('0x1a')&&_0x23de7e[_0xa21d('0x8a')][_0xa21d('0xa0')]===_0xa21d('0x3b')?'QueueCampaigns':_[_0xa21d('0x1b')](_0x2e225e)+'Queues','type':_0x23de7e[_0xa21d('0x8a')][_0xa21d('0xa0')],'nolimit':!![],'sort':'name','filter':_0x23de7e[_0xa21d('0x8a')]['filter']}};return db['UserProfile'][_0xa21d('0x97')](_0x5af06c);}return db[_0x172663][_0xa21d('0x98')](_0x37c7a6);})[_0xa21d('0x15')](function(_0x164ae4){_0x56e013['count']=_0x164ae4[_0xa21d('0xa')];_0x3d9994=_0x164ae4[_0xa21d('0x9c')];return getRealtimeQueues(_0x23de7e,_0x2e225e);})[_0xa21d('0x15')](function(_0x5aeee5){_0x188eda=_0x5aeee5['rows'];return getRealtimeAgents();})[_0xa21d('0x15')](function(_0x3c206c){_0x272ed8=_0x3c206c[_0xa21d('0x9c')];if(_0x2e225e!=_0xa21d('0x1a'))return;return getRealtimeVoiceQueueChannels();})['then'](function(_0xc8d36e){_0x3dad39=_0xc8d36e?_0xc8d36e[_0xa21d('0x9c')]:[];return initializeQueues(_0x3d9994,_0x188eda,_0x2e225e,_0x23de7e[_0xa21d('0x8a')][_0xa21d('0xa0')]);})['then'](function(_0x2d21e9){var _0x527cfa=_0x2d21e9[_0xa21d('0x36')](function(_0x379aae){if(_0x2e225e===_0xa21d('0x1a'))return getVoiceQueueAgents(_0x379aae,_0x3d9994,_0x272ed8,_0x3dad39);else return getQueueAgents(_0x379aae,_0x272ed8,_0x2e225e);});return Promise[_0xa21d('0x69')](_0x527cfa);})[_0xa21d('0x15')](function(_0x3dcb4f){_0x56e013[_0xa21d('0x9c')]=_0x3dcb4f;return _0x56e013;})[_0xa21d('0x15')](respondWithFilteredResult(_0x45449f,_0x37c7a6))[_0xa21d('0x19')](handleError(_0x45449f,null));};
\ No newline at end of file
index 191d01d..91536b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0xaaadfa,_0x2bba7e){var _0x46a141=function(_0x4cae80){while(--_0x4cae80){_0xaaadfa['push'](_0xaaadfa['shift']());}};_0x46a141(++_0x2bba7e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2330fd,_0x56e9c7){var _0x5c1eba=function(_0x517719){while(--_0x517719){_0x2330fd['push'](_0x2330fd['shift']());}};_0x5c1eba(++_0x56e9c7);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
index 9fcd065..93d19c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x52c8e8,_0x5ee20d){var _0x31bb1a=function(_0x47233a){while(--_0x47233a){_0x52c8e8['push'](_0x52c8e8['shift']());}};_0x31bb1a(++_0x5ee20d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xc4aa[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'state':{'type':Sequelize[_0xac4a('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xac4a('0x3')]},'scheduledat':{'type':Sequelize[_0xac4a('0x4')]},'uniqueid':{'type':Sequelize[_0xac4a('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xac4a('0x3')]},'campaigntype':{'type':Sequelize[_0xac4a('0x3')]},'membername':{'type':Sequelize[_0xac4a('0x3')]}};
\ No newline at end of file
+var _0x5a63=['INTEGER','STRING','sequelize','exports','DATE'];(function(_0x2f2315,_0x85c29e){var _0x574853=function(_0xd67286){while(--_0xd67286){_0x2f2315['push'](_0x2f2315['shift']());}};_0x574853(++_0x85c29e);}(_0x5a63,0xe3));var _0x35a6=function(_0x37d983,_0x38b3b5){_0x37d983=_0x37d983-0x0;var _0x2818c1=_0x5a63[_0x37d983];return _0x2818c1;};'use strict';var Sequelize=require(_0x35a6('0x0'));module[_0x35a6('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x35a6('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x35a6('0x2')]},'ringtime':{'type':Sequelize[_0x35a6('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x35a6('0x4')]},'campaigntype':{'type':Sequelize[_0x35a6('0x4')]},'membername':{'type':Sequelize[_0x35a6('0x4')]}};
\ No newline at end of file
index 68e2d9c..869635d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b0d=['api','moment','request-promise','rimraf','../../config/environment','./reportAgentPreview.attributes','define','report_agent_preview','lodash','util'];(function(_0x55b037,_0x2d9392){var _0x5f1053=function(_0x7a13d4){while(--_0x7a13d4){_0x55b037['push'](_0x55b037['shift']());}};_0x5f1053(++_0x2d9392);}(_0x7b0d,0x198));var _0xd7b0=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x7b0d[_0x3054be];return _0x3df150;};'use strict';var _=require(_0xd7b0('0x0'));var util=require(_0xd7b0('0x1'));var logger=require('../../config/logger')(_0xd7b0('0x2'));var moment=require(_0xd7b0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd7b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd7b0('0x5'));var config=require(_0xd7b0('0x6'));var attributes=require(_0xd7b0('0x7'));module['exports']=function(_0x571063,_0x509ad6){return _0x571063[_0xd7b0('0x8')]('ReportAgentPreview',attributes,{'tableName':_0xd7b0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd3d3=['report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview'];(function(_0x2a9b6c,_0x29e967){var _0xd92a00=function(_0x2568e3){while(--_0x2568e3){_0x2a9b6c['push'](_0x2a9b6c['shift']());}};_0xd92a00(++_0x29e967);}(_0xd3d3,0x10b));var _0x3d3d=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xd3d3[_0x15c421];return _0x5e5ed5;};'use strict';var _=require(_0x3d3d('0x0'));var util=require(_0x3d3d('0x1'));var logger=require(_0x3d3d('0x2'))(_0x3d3d('0x3'));var moment=require(_0x3d3d('0x4'));var BPromise=require(_0x3d3d('0x5'));var rp=require(_0x3d3d('0x6'));var fs=require('fs');var path=require(_0x3d3d('0x7'));var rimraf=require(_0x3d3d('0x8'));var config=require(_0x3d3d('0x9'));var attributes=require(_0x3d3d('0xa'));module[_0x3d3d('0xb')]=function(_0x5b3914,_0x30cfae){return _0x5b3914['define'](_0x3d3d('0xc'),attributes,{'tableName':_0x3d3d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 01ea67c..a92c808 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66a4=['catch','create','raw','CreateReportAgentPreview','debug','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x50afad,_0x34169f){var _0x5ef68e=function(_0x378b83){while(--_0x378b83){_0x50afad['push'](_0x50afad['shift']());}};_0x5ef68e(++_0x34169f);}(_0x66a4,0x123));var _0x466a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x66a4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x466a('0x0'));var util=require(_0x466a('0x1'));var moment=require(_0x466a('0x2'));var BPromise=require(_0x466a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x466a('0x4'));var logger=require(_0x466a('0x5'))(_0x466a('0x6'));var config=require(_0x466a('0x7'));var jayson=require(_0x466a('0x8'));var client=jayson['client'][_0x466a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e5f69,_0x36fdbe,_0x44d49b){return new BPromise(function(_0xd58896,_0x1fdcb1){return client[_0x466a('0xa')](_0x3e5f69,_0x44d49b)[_0x466a('0xb')](function(_0x2567e1){logger['info'](_0x466a('0xc'),_0x36fdbe,'request\x20sent');logger['debug'](_0x466a('0xd'),_0x36fdbe,_0x466a('0xe'),JSON[_0x466a('0xf')](_0x2567e1));if(_0x2567e1[_0x466a('0x10')]){if(_0x2567e1[_0x466a('0x10')][_0x466a('0x11')]===0x1f4){logger[_0x466a('0x10')](_0x466a('0xc'),_0x36fdbe,_0x2567e1[_0x466a('0x10')][_0x466a('0x12')]);return _0x1fdcb1(_0x2567e1['error']['message']);}logger['error'](_0x466a('0xc'),_0x36fdbe,_0x2567e1[_0x466a('0x10')]['message']);return _0xd58896(_0x2567e1[_0x466a('0x10')][_0x466a('0x12')]);}else{logger[_0x466a('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x36fdbe,_0x466a('0xe'));_0xd58896(_0x2567e1[_0x466a('0x14')]['message']);}})[_0x466a('0x15')](function(_0x10608c){logger[_0x466a('0x10')](_0x466a('0xc'),_0x36fdbe,_0x10608c);_0x1fdcb1(_0x10608c);});});}exports['CreateReportAgentPreview']=function(_0xbf3be4){var _0x5b0a22=this;return new Promise(function(_0x1c020c,_0x30f9a1){return db['ReportAgentPreview'][_0x466a('0x16')](_0xbf3be4['body'],{'raw':_0xbf3be4['options']?_0xbf3be4['options'][_0x466a('0x17')]===undefined?!![]:![]:!![]})[_0x466a('0xb')](function(_0x1ed555){logger['info'](_0x466a('0x18'),_0xbf3be4);logger[_0x466a('0x19')](_0x466a('0x18'),_0xbf3be4,JSON[_0x466a('0xf')](_0x1ed555));_0x1c020c(_0x1ed555);})[_0x466a('0x15')](function(_0x431e64){logger[_0x466a('0x10')](_0x466a('0x18'),_0x431e64[_0x466a('0x12')],_0xbf3be4);_0x30f9a1(_0x5b0a22[_0x466a('0x10')](0x1f4,_0x431e64['message']));});});};
\ No newline at end of file
+var _0x8478=['result','catch','ReportAgentPreview','body','options','raw','CreateReportAgentPreview','debug','stringify','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x9d2818,_0x9cedd8){var _0x2c96b8=function(_0x10d2bc){while(--_0x10d2bc){_0x9d2818['push'](_0x9d2818['shift']());}};_0x2c96b8(++_0x9cedd8);}(_0x8478,0x1a9));var _0x8847=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8478[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x8847('0x0'));var moment=require(_0x8847('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8847('0x2'));var db=require(_0x8847('0x3'))['db'];var utils=require(_0x8847('0x4'));var logger=require(_0x8847('0x5'))(_0x8847('0x6'));var config=require(_0x8847('0x7'));var jayson=require(_0x8847('0x8'));var client=jayson[_0x8847('0x9')][_0x8847('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x543cac,_0x400630,_0x233926){return new BPromise(function(_0x26b223,_0x53215a){return client['request'](_0x543cac,_0x233926)[_0x8847('0xb')](function(_0x44efbf){logger[_0x8847('0xc')](_0x8847('0xd'),_0x400630,_0x8847('0xe'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x400630,_0x8847('0xe'),JSON['stringify'](_0x44efbf));if(_0x44efbf[_0x8847('0xf')]){if(_0x44efbf[_0x8847('0xf')]['code']===0x1f4){logger[_0x8847('0xf')](_0x8847('0xd'),_0x400630,_0x44efbf[_0x8847('0xf')][_0x8847('0x10')]);return _0x53215a(_0x44efbf['error'][_0x8847('0x10')]);}logger[_0x8847('0xf')](_0x8847('0xd'),_0x400630,_0x44efbf[_0x8847('0xf')][_0x8847('0x10')]);return _0x26b223(_0x44efbf[_0x8847('0xf')][_0x8847('0x10')]);}else{logger['info'](_0x8847('0xd'),_0x400630,_0x8847('0xe'));_0x26b223(_0x44efbf[_0x8847('0x11')][_0x8847('0x10')]);}})[_0x8847('0x12')](function(_0x68d96b){logger[_0x8847('0xf')](_0x8847('0xd'),_0x400630,_0x68d96b);_0x53215a(_0x68d96b);});});}exports['CreateReportAgentPreview']=function(_0x12bedb){var _0x2fd039=this;return new Promise(function(_0x33d70d,_0x1c06d9){return db[_0x8847('0x13')]['create'](_0x12bedb[_0x8847('0x14')],{'raw':_0x12bedb[_0x8847('0x15')]?_0x12bedb['options'][_0x8847('0x16')]===undefined?!![]:![]:!![]})[_0x8847('0xb')](function(_0x2c220b){logger[_0x8847('0xc')](_0x8847('0x17'),_0x12bedb);logger[_0x8847('0x18')](_0x8847('0x17'),_0x12bedb,JSON[_0x8847('0x19')](_0x2c220b));_0x33d70d(_0x2c220b);})[_0x8847('0x12')](function(_0x3d165d){logger[_0x8847('0xf')](_0x8847('0x17'),_0x3d165d[_0x8847('0x10')],_0x12bedb);_0x1c06d9(_0x2fd039['error'](0x1f4,_0x3d165d[_0x8847('0x10')]));});});};
\ No newline at end of file
index 0791d4d..82aaf82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c3f=['put','updateVoiceQueue','/outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','post','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','path','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues'];(function(_0x5dad9d,_0xfe8522){var _0x1af9e6=function(_0x80bb71){while(--_0x80bb71){_0x5dad9d['push'](_0x5dad9d['shift']());}};_0x1af9e6(++_0xfe8522);}(_0x8c3f,0xd9));var _0xf8c3=function(_0x55ffd4,_0x507709){_0x55ffd4=_0x55ffd4-0x0;var _0x657e2a=_0x8c3f[_0x55ffd4];return _0x657e2a;};'use strict';var multer=require(_0xf8c3('0x0'));var util=require(_0xf8c3('0x1'));var path=require(_0xf8c3('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xf8c3('0x3'));var controller=require(_0xf8c3('0x4'));router[_0xf8c3('0x5')](_0xf8c3('0x6'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x8')]);router[_0xf8c3('0x5')](_0xf8c3('0x9'),auth[_0xf8c3('0x7')](),controller['voiceChannelMixMonitor']);router['get'](_0xf8c3('0xa'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0xb')]);router['get'](_0xf8c3('0xc'),auth[_0xf8c3('0x7')](),controller['voiceQueues']);router[_0xf8c3('0x5')](_0xf8c3('0xd'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0xe')]);router[_0xf8c3('0x5')]('/mail/queues',auth[_0xf8c3('0x7')](),controller[_0xf8c3('0xf')]);router[_0xf8c3('0x5')](_0xf8c3('0x10'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x11')]);router[_0xf8c3('0x5')](_0xf8c3('0x12'),auth['isAuthenticated'](),controller[_0xf8c3('0x13')]);router[_0xf8c3('0x5')](_0xf8c3('0x14'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x15')]);router['get'](_0xf8c3('0x16'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x17')]);router[_0xf8c3('0x5')](_0xf8c3('0x18'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x19')]);router[_0xf8c3('0x5')](_0xf8c3('0x1a'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x1b')]);router[_0xf8c3('0x5')](_0xf8c3('0x1c'),auth['isAuthenticated'](),controller[_0xf8c3('0x1d')]);router[_0xf8c3('0x5')](_0xf8c3('0x1e'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x1f')]);router[_0xf8c3('0x5')](_0xf8c3('0x20'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x21')]);router['get'](_0xf8c3('0x22'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x23')]);router[_0xf8c3('0x5')](_0xf8c3('0x24'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x25')]);router[_0xf8c3('0x26')](_0xf8c3('0x24'),auth['isAuthenticated'](),controller[_0xf8c3('0x27')]);router['get'](_0xf8c3('0x28'),auth[_0xf8c3('0x7')](),controller['outbound']);router[_0xf8c3('0x5')](_0xf8c3('0x29'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x2a')]);router[_0xf8c3('0x5')](_0xf8c3('0x2b'),auth['isAuthenticated'](),controller[_0xf8c3('0x2c')]);router[_0xf8c3('0x26')](_0xf8c3('0x2d'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x2e')]);router['get'](_0xf8c3('0x2f'),auth[_0xf8c3('0x7')](),controller['telephones']);router[_0xf8c3('0x5')](_0xf8c3('0x30'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x31')]);router[_0xf8c3('0x5')](_0xf8c3('0x32'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x33')]);router[_0xf8c3('0x5')](_0xf8c3('0x34'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x35')]);router[_0xf8c3('0x5')](_0xf8c3('0x36'),auth['isAuthenticated'](),controller[_0xf8c3('0x37')]);router[_0xf8c3('0x5')](_0xf8c3('0x38'),auth[_0xf8c3('0x7')](),controller['mailQueuesWaitingInteractions']);router[_0xf8c3('0x5')](_0xf8c3('0x39'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x3a')]);router[_0xf8c3('0x5')](_0xf8c3('0x3b'),auth['isAuthenticated'](),controller[_0xf8c3('0x3c')]);router[_0xf8c3('0x5')]('/sms/queues/waitinginteractions',auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x3d')]);router[_0xf8c3('0x5')](_0xf8c3('0x3e'),auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router['get']('/fax/queues/waitinginteractions',auth[_0xf8c3('0x7')](),controller['faxQueuesWaitingInteractions']);router[_0xf8c3('0x3f')]('/mail/queues/:id/notify',auth['isAuthenticated'](),controller[_0xf8c3('0x40')]('mail'));router[_0xf8c3('0x5')](_0xf8c3('0x41'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x42')]);router[_0xf8c3('0x3f')](_0xf8c3('0x43'),auth['isAuthenticated'](),controller[_0xf8c3('0x40')]('chat'));router['get'](_0xf8c3('0x44'),auth[_0xf8c3('0x7')](),controller['showChatQueues']);router[_0xf8c3('0x3f')]('/fax/queues/:id/notify',auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x40')](_0xf8c3('0x45')));router[_0xf8c3('0x5')](_0xf8c3('0x46'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x47')]);router['post'](_0xf8c3('0x48'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x40')](_0xf8c3('0x49')));router[_0xf8c3('0x5')](_0xf8c3('0x4a'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x4b')]);router[_0xf8c3('0x3f')](_0xf8c3('0x4c'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x40')](_0xf8c3('0x4d')));router[_0xf8c3('0x3f')](_0xf8c3('0x4e'),auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x40')](_0xf8c3('0x4f')));router['get'](_0xf8c3('0x50'),auth[_0xf8c3('0x7')](),controller['showSmsQueues']);router[_0xf8c3('0x5')](_0xf8c3('0x51'),auth['isAuthenticated'](),controller[_0xf8c3('0x52')]);router[_0xf8c3('0x3f')]('/agents/:id/notify',auth[_0xf8c3('0x7')](),controller[_0xf8c3('0x53')]);module[_0xf8c3('0x54')]=router;
\ No newline at end of file
+var _0xbe4a=['/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','path','express','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','put','agentCapacity','/telephones','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions'];(function(_0x46f1e1,_0xb15e11){var _0x3ce857=function(_0x147844){while(--_0x147844){_0x46f1e1['push'](_0x46f1e1['shift']());}};_0x3ce857(++_0xb15e11);}(_0xbe4a,0x165));var _0xabe4=function(_0x395739,_0x39a094){_0x395739=_0x395739-0x0;var _0x3c244e=_0xbe4a[_0x395739];return _0x3c244e;};'use strict';var multer=require('multer');var util=require(_0xabe4('0x0'));var path=require(_0xabe4('0x1'));var express=require(_0xabe4('0x2'));var router=express[_0xabe4('0x3')]();var auth=require(_0xabe4('0x4'));var controller=require('./rpc.controller');router[_0xabe4('0x5')](_0xabe4('0x6'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x8')]);router[_0xabe4('0x5')]('/voice/channels/:uniqueid/mixmonitor',auth[_0xabe4('0x7')](),controller[_0xabe4('0x9')]);router[_0xabe4('0x5')](_0xabe4('0xa'),auth[_0xabe4('0x7')](),controller[_0xabe4('0xb')]);router[_0xabe4('0x5')](_0xabe4('0xc'),auth[_0xabe4('0x7')](),controller[_0xabe4('0xd')]);router[_0xabe4('0x5')](_0xabe4('0xe'),auth[_0xabe4('0x7')](),controller[_0xabe4('0xf')]);router[_0xabe4('0x5')](_0xabe4('0x10'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x11')]);router[_0xabe4('0x5')](_0xabe4('0x12'),auth[_0xabe4('0x7')](),controller['mailAccounts']);router[_0xabe4('0x5')](_0xabe4('0x13'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x14')]);router[_0xabe4('0x5')](_0xabe4('0x15'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x16')]);router[_0xabe4('0x5')]('/whatsapp/queues',auth[_0xabe4('0x7')](),controller['whatsappQueues']);router['get'](_0xabe4('0x17'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x18')]);router[_0xabe4('0x5')](_0xabe4('0x19'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x1a')]);router[_0xabe4('0x5')](_0xabe4('0x1b'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x1c')]);router[_0xabe4('0x5')](_0xabe4('0x1d'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x1e')]);router[_0xabe4('0x5')](_0xabe4('0x1f'),auth['isAuthenticated'](),controller[_0xabe4('0x20')]);router[_0xabe4('0x5')](_0xabe4('0x21'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x22')]);router[_0xabe4('0x5')]('/voice/queues/:id',auth[_0xabe4('0x7')](),controller[_0xabe4('0x23')]);router['put']('/voice/queues/:id',auth[_0xabe4('0x7')](),controller[_0xabe4('0x24')]);router[_0xabe4('0x5')](_0xabe4('0x25'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x26')]);router[_0xabe4('0x5')](_0xabe4('0x27'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x28')]);router[_0xabe4('0x5')](_0xabe4('0x29'),auth[_0xabe4('0x7')](),controller['agents']);router[_0xabe4('0x2a')]('/agents/:id/capacity',auth['isAuthenticated'](),controller[_0xabe4('0x2b')]);router[_0xabe4('0x5')](_0xabe4('0x2c'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x2d')]);router[_0xabe4('0x5')](_0xabe4('0x2e'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x2f')]);router['get']('/campaigns',auth['isAuthenticated'](),controller[_0xabe4('0x30')]);router[_0xabe4('0x5')](_0xabe4('0x31'),auth['isAuthenticated'](),controller[_0xabe4('0x32')]);router[_0xabe4('0x5')](_0xabe4('0x33'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x34')]);router[_0xabe4('0x5')](_0xabe4('0x35'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x36')]);router[_0xabe4('0x5')](_0xabe4('0x37'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x38')]);router[_0xabe4('0x5')]('/openchannel/queues/:id/waitinginteractions',auth[_0xabe4('0x7')](),controller[_0xabe4('0x39')]);router[_0xabe4('0x5')](_0xabe4('0x3a'),auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0xabe4('0x5')]('/whatsapp/queues/waitinginteractions',auth[_0xabe4('0x7')](),controller[_0xabe4('0x3b')]);router[_0xabe4('0x5')](_0xabe4('0x3c'),auth[_0xabe4('0x7')](),controller['faxQueuesWaitingInteractions']);router[_0xabe4('0x3d')](_0xabe4('0x3e'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x3f')]('mail'));router[_0xabe4('0x5')](_0xabe4('0x40'),auth[_0xabe4('0x7')](),controller['showMailQueues']);router[_0xabe4('0x3d')]('/chat/queues/:id/notify',auth[_0xabe4('0x7')](),controller[_0xabe4('0x3f')](_0xabe4('0x41')));router[_0xabe4('0x5')](_0xabe4('0x42'),auth['isAuthenticated'](),controller[_0xabe4('0x43')]);router[_0xabe4('0x3d')]('/fax/queues/:id/notify',auth['isAuthenticated'](),controller[_0xabe4('0x3f')](_0xabe4('0x44')));router['get'](_0xabe4('0x45'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x46')]);router[_0xabe4('0x3d')](_0xabe4('0x47'),auth['isAuthenticated'](),controller[_0xabe4('0x3f')](_0xabe4('0x48')));router[_0xabe4('0x5')](_0xabe4('0x49'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x4a')]);router[_0xabe4('0x3d')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0xabe4('0x3f')]('sms'));router[_0xabe4('0x3d')]('/whatsapp/queues/:id/notify',auth[_0xabe4('0x7')](),controller[_0xabe4('0x3f')](_0xabe4('0x4b')));router[_0xabe4('0x5')](_0xabe4('0x4c'),auth['isAuthenticated'](),controller['showSmsQueues']);router[_0xabe4('0x5')](_0xabe4('0x4d'),auth['isAuthenticated'](),controller[_0xabe4('0x4e')]);router[_0xabe4('0x3d')](_0xabe4('0x4f'),auth[_0xabe4('0x7')](),controller[_0xabe4('0x50')]);module[_0xabe4('0x51')]=router;
\ No newline at end of file
index 5747bde..84474f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81bd=['client','http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','interface','SIP/%s','internal','AgentCapacity','capacity','telephones','Telephones','Trunks','campaigns','Campaigns','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','findOne','Message','Interaction','update','queue','InteractionId','From','QueueId','TransferReport','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','agent','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','MessageId','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api'];(function(_0x44160f,_0x141088){var _0x39f74d=function(_0x4a7211){while(--_0x4a7211){_0x44160f['push'](_0x44160f['shift']());}};_0x39f74d(++_0x141088);}(_0x81bd,0x7c));var _0xd81b=function(_0x5ca3d6,_0x5c7599){_0x5ca3d6=_0x5ca3d6-0x0;var _0x3a1032=_0x81bd[_0x5ca3d6];return _0x3a1032;};'use strict';var BPromise=require(_0xd81b('0x0'));var moment=require(_0xd81b('0x1'));var _=require(_0xd81b('0x2'));var util=require(_0xd81b('0x3'));var db=require(_0xd81b('0x4'))['db'];var logger=require(_0xd81b('0x5'))(_0xd81b('0x6'));var jayson=require('jayson/promise');var amiClient=jayson[_0xd81b('0x7')][_0xd81b('0x8')]({'port':0x232a});var mailClient=jayson[_0xd81b('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0xd81b('0x7')][_0xd81b('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x1f3f2c,_0x562084,_0x5e14e8){return new BPromise(function(_0xa4cf97,_0x5468d5){var _0x223515=_0x5e14e8?_0x5e14e8:amiClient;return _0x223515[_0xd81b('0x9')](_0x1f3f2c,_0x562084)[_0xd81b('0xa')](function(_0x86dab6){if(_0x86dab6[_0xd81b('0xb')]){if(_0x86dab6[_0xd81b('0xb')][_0xd81b('0xc')]===0x1f4){return _0x5468d5(_0x86dab6[_0xd81b('0xb')][_0xd81b('0xd')]);}return _0xa4cf97(_0x86dab6[_0xd81b('0xb')][_0xd81b('0xd')]);}else{_0xa4cf97(_0x86dab6[_0xd81b('0xe')]);}})[_0xd81b('0xf')](function(_0x560530){_0x5468d5(_0x560530);});});}function respondWithResult(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xc8;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x10')](_0x57f71d)['json'](_0x3f2405);}return _0x21dfff[_0xd81b('0x11')](0x194);};}function handleError(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0x1f4;return function(_0x41bf7a){logger[_0xd81b('0xb')](_0x41bf7a[_0xd81b('0x12')]);if(_0x41bf7a[_0xd81b('0x13')]){delete _0x41bf7a['name'];}_0x47dd04[_0xd81b('0x10')](_0x13dd00)[_0xd81b('0x14')](_0x41bf7a);};}function findById(_0x5c2863){return function(_0x2abef4){if(!_[_0xd81b('0x15')](_0x5c2863)&&!_[_0xd81b('0x15')](_0x2abef4)&&!_[_0xd81b('0x15')](_0x2abef4[_0xd81b('0x16')])){return _[_0xd81b('0x17')](_0x2abef4[_0xd81b('0x16')],function(_0x3d4d34){return _0x3d4d34['id']==_0x5c2863;});}return null;};}exports[_0xd81b('0x18')]=function(_0x285164,_0x1ff3c6){return respondWithRpcPromise(_0xd81b('0x19'),_0x285164[_0xd81b('0x1a')])[_0xd81b('0xa')](respondWithResult(_0x1ff3c6,null))[_0xd81b('0xf')](handleError(_0x1ff3c6,null));};exports[_0xd81b('0x1b')]=function(_0x5f101a,_0x4d566e){return respondWithRpcPromise(_0xd81b('0x1c'),_[_0xd81b('0x1d')](_0x5f101a[_0xd81b('0x1a')],_0x5f101a['params']))[_0xd81b('0xa')](respondWithResult(_0x4d566e,null))[_0xd81b('0xf')](handleError(_0x4d566e,null));};exports['voiceChannelStopMixMonitor']=function(_0xcd6474,_0x13d687){return respondWithRpcPromise(_0xd81b('0x1e'),_[_0xd81b('0x1d')](_0xcd6474[_0xd81b('0x1a')],_0xcd6474[_0xd81b('0x1f')]))[_0xd81b('0xa')](respondWithResult(_0x13d687,null))[_0xd81b('0xf')](handleError(_0x13d687,null));};exports[_0xd81b('0x20')]=function(_0x212c4e,_0x2ccedf){return respondWithRpcPromise(_0xd81b('0x21'),_0x212c4e['query'])[_0xd81b('0xa')](respondWithResult(_0x2ccedf,null))[_0xd81b('0xf')](handleError(_0x2ccedf,null));};exports[_0xd81b('0x22')]=function(_0x31b9fd,_0x3266c2){return respondWithRpcPromise(_0xd81b('0x21'),_0x31b9fd[_0xd81b('0x1a')])[_0xd81b('0xa')](findById(_0x31b9fd[_0xd81b('0x1f')]['id']))['then'](respondWithResult(_0x3266c2,null))[_0xd81b('0xf')](handleError(_0x3266c2,null));};exports['updateVoiceQueue']=function(_0x5c8aee,_0xb9ff9f){return respondWithRpcPromise(_0xd81b('0x23'),_['merge'](_0x5c8aee['body'],_0x5c8aee[_0xd81b('0x1f')]))[_0xd81b('0xa')](respondWithResult(_0xb9ff9f,null))[_0xd81b('0xf')](handleError(_0xb9ff9f,null));};exports[_0xd81b('0x24')]=function(_0x1a1572,_0x4654ba){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xd81b('0x1d')](_0x1a1572[_0xd81b('0x1a')],_0x1a1572['params']))['then'](respondWithResult(_0x4654ba,null))[_0xd81b('0xf')](handleError(_0x4654ba,null));};exports[_0xd81b('0x25')]=function(_0x50472a,_0x50ce25){return respondWithRpcPromise('VoiceQueuesChannels',_0x50472a[_0xd81b('0x1a')])[_0xd81b('0xa')](respondWithResult(_0x50ce25,null))[_0xd81b('0xf')](handleError(_0x50ce25,null));};exports[_0xd81b('0x26')]=function(_0xa56339,_0x12ee8f){return respondWithRpcPromise(_0xd81b('0x27'),_['merge'](_0xa56339[_0xd81b('0x1a')],_0xa56339['params']))[_0xd81b('0xa')](respondWithResult(_0x12ee8f,null))[_0xd81b('0xf')](handleError(_0x12ee8f,null));};exports[_0xd81b('0x28')]=function(_0xcd9e86,_0x36c69f){return respondWithRpcPromise(_0xd81b('0x29'),_[_0xd81b('0x1d')](_0xcd9e86[_0xd81b('0x1a')],_0xcd9e86[_0xd81b('0x1f')]))[_0xd81b('0xa')](respondWithResult(_0x36c69f,null))[_0xd81b('0xf')](handleError(_0x36c69f,null));};exports[_0xd81b('0x2a')]=function(_0x346038,_0x57bc0c){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xd81b('0x1d')](_0x346038[_0xd81b('0x1a')],_0x346038[_0xd81b('0x1f')]))['then'](respondWithResult(_0x57bc0c,null))[_0xd81b('0xf')](handleError(_0x57bc0c,null));};exports[_0xd81b('0x2b')]=function(_0x5a236a,_0x46f058){return respondWithRpcPromise(_0xd81b('0x2c'),_0x5a236a['query'])[_0xd81b('0xa')](respondWithResult(_0x46f058,null))['catch'](handleError(_0x46f058,null));};exports[_0xd81b('0x2d')]=function(_0x2502d1,_0x203365){return respondWithRpcPromise(_0xd81b('0x2e'),_0x2502d1['query'])[_0xd81b('0xa')](respondWithResult(_0x203365,null))[_0xd81b('0xf')](handleError(_0x203365,null));};exports[_0xd81b('0x2f')]=function(_0x67fbe5,_0x3abd60){var _0x466e98;return respondWithRpcPromise(_0xd81b('0x30'),_0x67fbe5['query'])[_0xd81b('0xa')](function(_0x35a295){_0x466e98=_0x35a295;return respondWithRpcPromise(_0xd81b('0x30'),_0x67fbe5['query'],routingClient);})[_0xd81b('0xa')](function(_0x3a05f4){return _[_0xd81b('0x1d')]({},_0x3a05f4,_0x466e98);})[_0xd81b('0xa')](respondWithResult(_0x3abd60,null))[_0xd81b('0xf')](handleError(_0x3abd60,null));};exports['agentCapacity']=function(_0x3dfba7,_0x11d617){if(_0x3dfba7[_0xd81b('0x31')]&&_0x3dfba7[_0xd81b('0x31')][_0xd81b('0x32')]&&_0x3dfba7[_0xd81b('0x33')]&&_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x13')]){for(var _0x4405a8 in _0x3dfba7[_0xd81b('0x31')][_0xd81b('0x32')]){if(_0x3dfba7['body'][_0xd81b('0x32')][_0xd81b('0x34')](_0x4405a8)){db[_0xd81b('0x35')][_0xd81b('0x36')]({'where':{'channel':_0x4405a8,'membername':_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x13')],'type':_0xd81b('0x37'),'exitAt':null,'uniqueid':_0x3dfba7[_0xd81b('0x31')]['interaction'][_0x4405a8]&&_0x3dfba7['body'][_0xd81b('0x32')][_0x4405a8][_0xd81b('0x38')]?{'$notIn':_0x3dfba7[_0xd81b('0x31')][_0xd81b('0x32')][_0x4405a8]}:{'$ne':null}}})[_0xd81b('0xa')](function(_0x37031b){var _0x334bd0=moment()[_0xd81b('0x39')](_0xd81b('0x3a'));for(var _0xcfbbc2=0x0,_0x41e2e6=_0x37031b[_0xd81b('0x38')];_0xcfbbc2<_0x41e2e6;_0xcfbbc2+=0x1){_0x37031b[_0xcfbbc2]['updateAttributes']({'exitAt':_0x334bd0});}});for(var _0x27d18a=0x0;_0x27d18a<_0x3dfba7[_0xd81b('0x31')][_0xd81b('0x32')][_0x4405a8][_0xd81b('0x38')];_0x27d18a+=0x1){db[_0xd81b('0x35')][_0xd81b('0x3b')]({'where':{'channel':_0x4405a8,'membername':_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x13')],'type':_0xd81b('0x37'),'uniqueid':_0x3dfba7['body'][_0xd81b('0x32')][_0x4405a8][_0x27d18a],'exitAt':null},'defaults':{'channel':_0x4405a8,'membername':_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x13')],'interface':_[_0xd81b('0x15')](_0x3dfba7['user'][_0xd81b('0x3c')])?util[_0xd81b('0x39')](_0xd81b('0x3d'),_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x13')]):_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x3c')],'type':_0xd81b('0x37'),'enterAt':moment()[_0xd81b('0x39')]('YYYY-MM-DD\x20HH:mm:ss'),'role':'agent','internal':_0x3dfba7[_0xd81b('0x33')][_0xd81b('0x3e')],'uniqueid':_0x3dfba7[_0xd81b('0x31')][_0xd81b('0x32')][_0x4405a8][_0x27d18a]}});}}}}return respondWithRpcPromise(_0xd81b('0x3f'),{'id':_0x3dfba7[_0xd81b('0x1f')]['id'],'capacity':_0x3dfba7[_0xd81b('0x31')][_0xd81b('0x40')]},routingClient)['then'](respondWithResult(_0x11d617,null))[_0xd81b('0xf')](handleError(_0x11d617,null));};exports[_0xd81b('0x41')]=function(_0x1b523c,_0x3d171a){return respondWithRpcPromise(_0xd81b('0x42'),_0x1b523c['query'])[_0xd81b('0xa')](respondWithResult(_0x3d171a,null))[_0xd81b('0xf')](handleError(_0x3d171a,null));};exports['trunks']=function(_0x1f13c3,_0x315bd5){return respondWithRpcPromise(_0xd81b('0x43'),_0x1f13c3[_0xd81b('0x1a')])[_0xd81b('0xa')](respondWithResult(_0x315bd5,null))[_0xd81b('0xf')](handleError(_0x315bd5,null));};exports[_0xd81b('0x44')]=function(_0x22f588,_0x3ed626){return respondWithRpcPromise(_0xd81b('0x45'),_0x22f588[_0xd81b('0x1a')])['then'](respondWithResult(_0x3ed626,null))[_0xd81b('0xf')](handleError(_0x3ed626,null));};exports['chatQueues']=function(_0x1800fa,_0x7b438c){return respondWithRpcPromise(_0xd81b('0x46'),_0x1800fa[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x7b438c,null))[_0xd81b('0xf')](handleError(_0x7b438c,null));};exports['showChatQueues']=function(_0x2d978d,_0xe0c9c6){return respondWithRpcPromise('ChatQueues',_0x2d978d['query'],routingClient)[_0xd81b('0xa')](findById(_0x2d978d['params']['id']))[_0xd81b('0xa')](respondWithResult(_0xe0c9c6,null))['catch'](handleError(_0xe0c9c6,null));};exports[_0xd81b('0x47')]=function(_0x315a66,_0x3d97ba){return respondWithRpcPromise('MailQueues',_0x315a66[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x3d97ba,null))['catch'](handleError(_0x3d97ba,null));};exports[_0xd81b('0x48')]=function(_0x108aaf,_0x5951ec){return respondWithRpcPromise(_0xd81b('0x49'),_0x108aaf['query'],routingClient)[_0xd81b('0xa')](findById(_0x108aaf[_0xd81b('0x1f')]['id']))[_0xd81b('0xa')](respondWithResult(_0x5951ec,null))[_0xd81b('0xf')](handleError(_0x5951ec,null));};exports[_0xd81b('0x4a')]=function(_0x32eab4,_0x2f2afe){return respondWithRpcPromise(_0xd81b('0x4b'),_0x32eab4[_0xd81b('0x1a')],mailClient)[_0xd81b('0xa')](respondWithResult(_0x2f2afe,null))['catch'](handleError(_0x2f2afe,null));};exports[_0xd81b('0x4c')]=function(_0x434434,_0x385841){return respondWithRpcPromise(_0xd81b('0x4d'),_0x434434[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x385841,null))[_0xd81b('0xf')](handleError(_0x385841,null));};exports['showOpenchannelQueues']=function(_0x57f0fb,_0x5de22d){return respondWithRpcPromise(_0xd81b('0x4d'),_0x57f0fb[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](findById(_0x57f0fb[_0xd81b('0x1f')]['id']))[_0xd81b('0xa')](respondWithResult(_0x5de22d,null))[_0xd81b('0xf')](handleError(_0x5de22d,null));};exports[_0xd81b('0x4e')]=function(_0x5afecf,_0x3fcd8c){return respondWithRpcPromise(_0xd81b('0x4f'),_0x5afecf[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x3fcd8c,null))[_0xd81b('0xf')](handleError(_0x3fcd8c,null));};exports[_0xd81b('0x50')]=function(_0xb5fca8,_0x4ed17d){return respondWithRpcPromise(_0xd81b('0x4f'),_0xb5fca8[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](findById(_0xb5fca8[_0xd81b('0x1f')]['id']))[_0xd81b('0xa')](respondWithResult(_0x4ed17d,null))[_0xd81b('0xf')](handleError(_0x4ed17d,null));};exports[_0xd81b('0x51')]=function(_0x19d4f0,_0x8fa8cd){return respondWithRpcPromise(_0xd81b('0x52'),_0x19d4f0[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x8fa8cd,null))['catch'](handleError(_0x8fa8cd,null));};exports[_0xd81b('0x53')]=function(_0x5358a6,_0x2e7141){return respondWithRpcPromise(_0xd81b('0x52'),_0x5358a6[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](findById(_0x5358a6[_0xd81b('0x1f')]['id']))[_0xd81b('0xa')](respondWithResult(_0x2e7141,null))[_0xd81b('0xf')](handleError(_0x2e7141,null));};exports[_0xd81b('0x54')]=function(_0x10d6d2,_0x36fb7a){return respondWithRpcPromise('FaxQueues',_0x10d6d2[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x36fb7a,null))[_0xd81b('0xf')](handleError(_0x36fb7a,null));};exports[_0xd81b('0x55')]=function(_0x7720d3,_0x5abbb4){return respondWithRpcPromise('FaxQueues',_0x7720d3[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](findById(_0x7720d3[_0xd81b('0x1f')]['id']))[_0xd81b('0xa')](respondWithResult(_0x5abbb4,null))[_0xd81b('0xf')](handleError(_0x5abbb4,null));};exports[_0xd81b('0x56')]=function(_0xaee7e3,_0x539132){return respondWithRpcPromise(_0xd81b('0x57'),_0xaee7e3[_0xd81b('0x1a')])[_0xd81b('0xa')](respondWithResult(_0x539132,null))[_0xd81b('0xf')](handleError(_0x539132,null));};exports[_0xd81b('0x58')]=function(_0x21d039,_0x1e0da3){return respondWithRpcPromise(_0xd81b('0x59'),_0x21d039[_0xd81b('0x1a')],routingClient)['then'](respondWithResult(_0x1e0da3,null))[_0xd81b('0xf')](handleError(_0x1e0da3,null));};exports[_0xd81b('0x5a')]=function(_0x3858eb,_0x9c30e7){return respondWithRpcPromise(_0xd81b('0x5b'),_0x3858eb['query'],routingClient)[_0xd81b('0xa')](respondWithResult(_0x9c30e7,null))[_0xd81b('0xf')](handleError(_0x9c30e7,null));};exports['openchannelQueuesWaitingInteractions']=function(_0xa00645,_0x43e593){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0xa00645[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x43e593,null))[_0xd81b('0xf')](handleError(_0x43e593,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x2aff4b,_0x3db4d7){return respondWithRpcPromise(_0xd81b('0x5c'),_0x2aff4b['query'],routingClient)['then'](function(_0xdd970d){if(_0x2aff4b[_0xd81b('0x1a')][_0xd81b('0x5d')]!==undefined){var _0x5d601d=_(_0xdd970d[_0xd81b('0x16')])[_0xd81b('0x5e')]([_0x2aff4b[_0xd81b('0x1a')][_0xd81b('0x5d')],_0x2aff4b['params']['id']])['map'](_0xd81b('0x5f'))[_0xd81b('0x60')]()[_0xd81b('0x61')]();return _0xdd970d[_0xd81b('0x16')]['filter'](function(_0x1b8b17){return _0x5d601d[_0xd81b('0x62')](_0x1b8b17['queue_id'])>-0x1;});}else{return _0xdd970d[_0xd81b('0x16')]['filter'](function(_0x32a8f4){return _0x32a8f4[_0xd81b('0x5f')]===parseInt(_0x2aff4b['params']['id']);});}})[_0xd81b('0xa')](respondWithResult(_0x3db4d7,null))[_0xd81b('0xf')](handleError(_0x3db4d7,null));};exports[_0xd81b('0x63')]=function(_0x2490f1,_0x2b0fe4){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2490f1[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x2b0fe4,null))[_0xd81b('0xf')](handleError(_0x2b0fe4,null));};exports[_0xd81b('0x64')]=function(_0x1919b2,_0x2b1d96){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x1919b2['query'],routingClient)[_0xd81b('0xa')](respondWithResult(_0x2b1d96,null))[_0xd81b('0xf')](handleError(_0x2b1d96,null));};exports[_0xd81b('0x65')]=function(_0x15aed5,_0x4dd8ac){return respondWithRpcPromise(_0xd81b('0x66'),_0x15aed5[_0xd81b('0x1a')],routingClient)[_0xd81b('0xa')](respondWithResult(_0x4dd8ac,null))[_0xd81b('0xf')](handleError(_0x4dd8ac,null));};exports[_0xd81b('0x67')]=function(_0x589882){return function(_0x3744bf,_0x374ac0){var _0x159b28,_0x40b468;var _0x1d596c=_[_0xd81b('0x68')](_0x589882);var _0x402eb9=_0x589882==='chat'?_0xd81b('0x69'):_0xd81b('0x6a');return db[_0x1d596c+_0xd81b('0x6b')][_0xd81b('0x6c')]({'raw':!![],'where':{'id':_0x3744bf[_0xd81b('0x1f')]['id']}})[_0xd81b('0xa')](function(_0x59bee6){if(_[_0xd81b('0x15')](_0x59bee6)){throw new Error(_0x1d596c+'\x20Queue\x20not\x20found');}_0x159b28=_0x59bee6;return db[_0x1d596c+_0xd81b('0x6d')][_0xd81b('0x6c')]({'where':{'id':_0x3744bf[_0xd81b('0x31')]['messageId']},'include':[{'model':db[_0x1d596c+_0xd81b('0x6e')],'as':_0xd81b('0x6e')},{'model':db[_0x1d596c+_0x402eb9],'as':_0xd81b('0x6a')}]});})[_0xd81b('0xa')](function(_0x254105){if(_[_0xd81b('0x15')](_0x254105)){throw new Error(_0x1d596c+'\x20Message\x20not\x20found');}_0x40b468=_0x254105;return _0x254105[_0xd81b('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5f5514={'uniqueid':_0x589882+'.'+_0x40b468['id']+'.'+_0x40b468[_0xd81b('0x6e')]['id'],'FromUserId':_0x3744bf[_0xd81b('0x33')]['id'],'type':_0xd81b('0x70')};_0x5f5514[_0x1d596c+'MessageId']=_0x40b468['id'];_0x5f5514[_0x1d596c+_0xd81b('0x71')]=_0x40b468[_0xd81b('0x6e')]['id'];_0x5f5514[_0xd81b('0x72')+_0x1d596c+_0x402eb9+'Id']=_0x40b468[_0xd81b('0x6a')]['id'];_0x5f5514['To'+_0x1d596c+_0xd81b('0x73')]=_0x159b28['id'];return db[_0x1d596c+_0xd81b('0x74')]['create'](_0x5f5514);})[_0xd81b('0xa')](function(){return respondWithRpcPromise(_0xd81b('0x75'),{'channel':_0x589882,'interaction':_0x40b468[_0xd81b('0x6e')],'message':_0x40b468,'account':_0x40b468[_0xd81b('0x6a')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd81b('0x70'),'appdata':_0x159b28[_0xd81b('0x13')]+','+(_0x40b468[_0xd81b('0x6a')][_0xd81b('0x76')]||0x12c),'interval':_0xd81b('0x77')}]},routingClient);})[_0xd81b('0xa')](respondWithResult(_0x374ac0,null))[_0xd81b('0xf')](handleError(_0x374ac0,null));};};exports[_0xd81b('0x78')]=function(_0x42eb62,_0x2c19fd){var _0x36d8fd,_0x5adfe4;if(_[_0xd81b('0x15')](_0x42eb62['body'][_0xd81b('0x79')])){throw new Error(_0xd81b('0x7a'));}var _0x1ca94b=_0x42eb62[_0xd81b('0x31')][_0xd81b('0x79')];var _0x115805=_['capitalize'](_0x1ca94b);var _0x3a41e6=_0x1ca94b===_0xd81b('0x7b')?_0xd81b('0x69'):_0xd81b('0x6a');return db[_0xd81b('0x7c')][_0xd81b('0x6c')]({'raw':!![],'where':{'id':_0x42eb62[_0xd81b('0x1f')]['id'],'role':_0xd81b('0x7d')}})[_0xd81b('0xa')](function(_0xfacc8f){if(_[_0xd81b('0x15')](_0xfacc8f)){throw new Error(_0xd81b('0x7e'));}_0x36d8fd=_0xfacc8f;return db[_0x115805+'Message'][_0xd81b('0x6c')]({'where':{'id':_0x42eb62[_0xd81b('0x31')][_0xd81b('0x7f')]},'include':[{'model':db[_0x115805+_0xd81b('0x6e')],'as':_0xd81b('0x6e')},{'model':db[_0x115805+_0x3a41e6],'as':'Account'}]});})[_0xd81b('0xa')](function(_0x1e61d8){if(_[_0xd81b('0x15')](_0x1e61d8)){throw new Error(_0x115805+_0xd81b('0x80'));}_0x5adfe4=_0x1e61d8;return _0x1e61d8[_0xd81b('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0xd81b('0xa')](function(){var _0x4e4919={'uniqueid':_0x1ca94b+'.'+_0x5adfe4['id']+'.'+_0x5adfe4[_0xd81b('0x6e')]['id'],'FromUserId':_0x42eb62['user']['id'],'type':_0xd81b('0x70'),'ToUserId':_0x36d8fd['id']};_0x4e4919[_0x115805+_0xd81b('0x81')]=_0x5adfe4['id'];_0x4e4919[_0x115805+_0xd81b('0x71')]=_0x5adfe4[_0xd81b('0x6e')]['id'];_0x4e4919['From'+_0x115805+_0x3a41e6+'Id']=_0x5adfe4[_0xd81b('0x6a')]['id'];return db[_0x115805+_0xd81b('0x74')]['create'](_0x4e4919);})[_0xd81b('0xa')](function(){return respondWithRpcPromise(_0xd81b('0x75'),{'channel':_0x1ca94b,'interaction':_0x5adfe4[_0xd81b('0x6e')],'message':_0x5adfe4,'account':_0x5adfe4[_0xd81b('0x6a')],'applications':[{'id':0x0,'priority':0x1,'app':_0xd81b('0x7d'),'appdata':_0x36d8fd['name']+','+(_0x5adfe4['Account'][_0xd81b('0x82')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xd81b('0xa')](respondWithResult(_0x2c19fd,null))['catch'](handleError(_0x2c19fd,null));};
\ No newline at end of file
+var _0x7bae=['agent','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','rows','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','InteractionId','QueueId','TransferReport','queue','queueTransferTimeout','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','MessageId','From','Start','agentTransferTimeout','*,*,*,*','lodash','util','../../config/logger','jayson/promise','client','http','request','error','code','message','result','status','json','sendStatus','stack','name','isNil','voiceChannels','VoiceChannels','then','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','query','showVoiceQueues','VoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','MemberReport','findOrCreate','interface','SIP/%s'];(function(_0x108a81,_0x46a733){var _0x2624fd=function(_0x59a0d3){while(--_0x59a0d3){_0x108a81['push'](_0x108a81['shift']());}};_0x2624fd(++_0x46a733);}(_0x7bae,0x13b));var _0xe7ba=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x7bae[_0x5608a3];return _0x1ed50a;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0xe7ba('0x0'));var util=require(_0xe7ba('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0xe7ba('0x2'))('api');var jayson=require(_0xe7ba('0x3'));var amiClient=jayson[_0xe7ba('0x4')][_0xe7ba('0x5')]({'port':0x232a});var mailClient=jayson[_0xe7ba('0x4')][_0xe7ba('0x5')]({'port':0x232b});var routingClient=jayson[_0xe7ba('0x4')][_0xe7ba('0x5')]({'port':0x232c});function respondWithRpcPromise(_0x3c5e59,_0x10b307,_0x34fb18){return new BPromise(function(_0x160565,_0x27b1d5){var _0x41c39d=_0x34fb18?_0x34fb18:amiClient;return _0x41c39d[_0xe7ba('0x6')](_0x3c5e59,_0x10b307)['then'](function(_0x3df8bf){if(_0x3df8bf[_0xe7ba('0x7')]){if(_0x3df8bf[_0xe7ba('0x7')][_0xe7ba('0x8')]===0x1f4){return _0x27b1d5(_0x3df8bf[_0xe7ba('0x7')][_0xe7ba('0x9')]);}return _0x160565(_0x3df8bf[_0xe7ba('0x7')][_0xe7ba('0x9')]);}else{_0x160565(_0x3df8bf[_0xe7ba('0xa')]);}})['catch'](function(_0xf4fcb0){_0x27b1d5(_0xf4fcb0);});});}function respondWithResult(_0x588c8b,_0x602b1){_0x602b1=_0x602b1||0xc8;return function(_0x45229c){if(_0x45229c){return _0x588c8b[_0xe7ba('0xb')](_0x602b1)[_0xe7ba('0xc')](_0x45229c);}return _0x588c8b[_0xe7ba('0xd')](0x194);};}function handleError(_0x41369f,_0x561dbb){_0x561dbb=_0x561dbb||0x1f4;return function(_0x561c48){logger[_0xe7ba('0x7')](_0x561c48[_0xe7ba('0xe')]);if(_0x561c48[_0xe7ba('0xf')]){delete _0x561c48['name'];}_0x41369f[_0xe7ba('0xb')](_0x561dbb)['send'](_0x561c48);};}function findById(_0x590bab){return function(_0x5e9176){if(!_[_0xe7ba('0x10')](_0x590bab)&&!_['isNil'](_0x5e9176)&&!_[_0xe7ba('0x10')](_0x5e9176['rows'])){return _['find'](_0x5e9176['rows'],function(_0x3f326a){return _0x3f326a['id']==_0x590bab;});}return null;};}exports[_0xe7ba('0x11')]=function(_0x39ca38,_0x3c06c3){return respondWithRpcPromise(_0xe7ba('0x12'),_0x39ca38['query'])[_0xe7ba('0x13')](respondWithResult(_0x3c06c3,null))[_0xe7ba('0x14')](handleError(_0x3c06c3,null));};exports[_0xe7ba('0x15')]=function(_0x136ec6,_0x4aaf35){return respondWithRpcPromise(_0xe7ba('0x16'),_[_0xe7ba('0x17')](_0x136ec6['query'],_0x136ec6[_0xe7ba('0x18')]))[_0xe7ba('0x13')](respondWithResult(_0x4aaf35,null))[_0xe7ba('0x14')](handleError(_0x4aaf35,null));};exports[_0xe7ba('0x19')]=function(_0x394b69,_0x2acfc2){return respondWithRpcPromise(_0xe7ba('0x1a'),_[_0xe7ba('0x17')](_0x394b69[_0xe7ba('0x1b')],_0x394b69[_0xe7ba('0x18')]))['then'](respondWithResult(_0x2acfc2,null))['catch'](handleError(_0x2acfc2,null));};exports['voiceQueues']=function(_0x4cd124,_0x4363a8){return respondWithRpcPromise('VoiceQueues',_0x4cd124['query'])['then'](respondWithResult(_0x4363a8,null))[_0xe7ba('0x14')](handleError(_0x4363a8,null));};exports[_0xe7ba('0x1c')]=function(_0xe32862,_0x2ea78a){return respondWithRpcPromise(_0xe7ba('0x1d'),_0xe32862[_0xe7ba('0x1b')])[_0xe7ba('0x13')](findById(_0xe32862[_0xe7ba('0x18')]['id']))['then'](respondWithResult(_0x2ea78a,null))[_0xe7ba('0x14')](handleError(_0x2ea78a,null));};exports['updateVoiceQueue']=function(_0x102925,_0x92fe7){return respondWithRpcPromise(_0xe7ba('0x1e'),_['merge'](_0x102925['body'],_0x102925[_0xe7ba('0x18')]))[_0xe7ba('0x13')](respondWithResult(_0x92fe7,null))[_0xe7ba('0x14')](handleError(_0x92fe7,null));};exports[_0xe7ba('0x1f')]=function(_0x268308,_0x5279dd){return respondWithRpcPromise(_0xe7ba('0x20'),_[_0xe7ba('0x17')](_0x268308['query'],_0x268308[_0xe7ba('0x18')]))['then'](respondWithResult(_0x5279dd,null))['catch'](handleError(_0x5279dd,null));};exports[_0xe7ba('0x21')]=function(_0x134f21,_0x1be947){return respondWithRpcPromise('VoiceQueuesChannels',_0x134f21[_0xe7ba('0x1b')])['then'](respondWithResult(_0x1be947,null))[_0xe7ba('0x14')](handleError(_0x1be947,null));};exports[_0xe7ba('0x22')]=function(_0x3b0a69,_0x27a8d4){return respondWithRpcPromise(_0xe7ba('0x23'),_['merge'](_0x3b0a69[_0xe7ba('0x1b')],_0x3b0a69[_0xe7ba('0x18')]))['then'](respondWithResult(_0x27a8d4,null))[_0xe7ba('0x14')](handleError(_0x27a8d4,null));};exports[_0xe7ba('0x24')]=function(_0x499d3b,_0x524726){return respondWithRpcPromise(_0xe7ba('0x25'),_[_0xe7ba('0x17')](_0x499d3b['query'],_0x499d3b[_0xe7ba('0x18')]))[_0xe7ba('0x13')](respondWithResult(_0x524726,null))[_0xe7ba('0x14')](handleError(_0x524726,null));};exports['voiceQueuesChannelRedirect']=function(_0x3e6eb7,_0x43b313){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xe7ba('0x17')](_0x3e6eb7[_0xe7ba('0x1b')],_0x3e6eb7[_0xe7ba('0x18')]))['then'](respondWithResult(_0x43b313,null))['catch'](handleError(_0x43b313,null));};exports[_0xe7ba('0x26')]=function(_0x2ebb27,_0x58d2a){return respondWithRpcPromise(_0xe7ba('0x27'),_0x2ebb27[_0xe7ba('0x1b')])['then'](respondWithResult(_0x58d2a,null))[_0xe7ba('0x14')](handleError(_0x58d2a,null));};exports[_0xe7ba('0x28')]=function(_0x3139a6,_0x23a912){return respondWithRpcPromise('OutboundChannels',_0x3139a6[_0xe7ba('0x1b')])[_0xe7ba('0x13')](respondWithResult(_0x23a912,null))[_0xe7ba('0x14')](handleError(_0x23a912,null));};exports[_0xe7ba('0x29')]=function(_0x35a5f3,_0x3793c6){var _0x124cc4;return respondWithRpcPromise('Agents',_0x35a5f3[_0xe7ba('0x1b')])[_0xe7ba('0x13')](function(_0x359a4d){_0x124cc4=_0x359a4d;return respondWithRpcPromise(_0xe7ba('0x2a'),_0x35a5f3[_0xe7ba('0x1b')],routingClient);})[_0xe7ba('0x13')](function(_0x220c3b){return _[_0xe7ba('0x17')]({},_0x220c3b,_0x124cc4);})[_0xe7ba('0x13')](respondWithResult(_0x3793c6,null))['catch'](handleError(_0x3793c6,null));};exports[_0xe7ba('0x2b')]=function(_0x417734,_0x5d4be2){if(_0x417734['body']&&_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')]&&_0x417734[_0xe7ba('0x2e')]&&_0x417734['user'][_0xe7ba('0xf')]){for(var _0x82246e in _0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')]){if(_0x417734[_0xe7ba('0x2c')]['interaction'][_0xe7ba('0x2f')](_0x82246e)){db['MemberReport'][_0xe7ba('0x30')]({'where':{'channel':_0x82246e,'membername':_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')],'type':_0xe7ba('0x31'),'exitAt':null,'uniqueid':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e]&&_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e]['length']?{'$notIn':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e]}:{'$ne':null}}})[_0xe7ba('0x13')](function(_0x37dcaa){var _0x3620bc=moment()[_0xe7ba('0x32')](_0xe7ba('0x33'));for(var _0x2c54ac=0x0,_0x45f49a=_0x37dcaa[_0xe7ba('0x34')];_0x2c54ac<_0x45f49a;_0x2c54ac+=0x1){_0x37dcaa[_0x2c54ac]['updateAttributes']({'exitAt':_0x3620bc});}});for(var _0x19ccde=0x0;_0x19ccde<_0x417734['body'][_0xe7ba('0x2d')][_0x82246e][_0xe7ba('0x34')];_0x19ccde+=0x1){db[_0xe7ba('0x35')][_0xe7ba('0x36')]({'where':{'channel':_0x82246e,'membername':_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')],'type':'INTERACTION','uniqueid':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e][_0x19ccde],'exitAt':null},'defaults':{'channel':_0x82246e,'membername':_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')],'interface':_[_0xe7ba('0x10')](_0x417734[_0xe7ba('0x2e')][_0xe7ba('0x37')])?util[_0xe7ba('0x32')](_0xe7ba('0x38'),_0x417734[_0xe7ba('0x2e')][_0xe7ba('0xf')]):_0x417734['user'][_0xe7ba('0x37')],'type':_0xe7ba('0x31'),'enterAt':moment()[_0xe7ba('0x32')](_0xe7ba('0x33')),'role':_0xe7ba('0x39'),'internal':_0x417734[_0xe7ba('0x2e')]['internal'],'uniqueid':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x2d')][_0x82246e][_0x19ccde]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x417734[_0xe7ba('0x18')]['id'],'capacity':_0x417734[_0xe7ba('0x2c')][_0xe7ba('0x3a')]},routingClient)[_0xe7ba('0x13')](respondWithResult(_0x5d4be2,null))['catch'](handleError(_0x5d4be2,null));};exports['telephones']=function(_0xa80cf,_0x2cfdc3){return respondWithRpcPromise(_0xe7ba('0x3b'),_0xa80cf['query'])[_0xe7ba('0x13')](respondWithResult(_0x2cfdc3,null))[_0xe7ba('0x14')](handleError(_0x2cfdc3,null));};exports[_0xe7ba('0x3c')]=function(_0x45bcbd,_0x14beb3){return respondWithRpcPromise(_0xe7ba('0x3d'),_0x45bcbd[_0xe7ba('0x1b')])['then'](respondWithResult(_0x14beb3,null))[_0xe7ba('0x14')](handleError(_0x14beb3,null));};exports[_0xe7ba('0x3e')]=function(_0x316b51,_0x5863c8){return respondWithRpcPromise(_0xe7ba('0x3f'),_0x316b51[_0xe7ba('0x1b')])['then'](respondWithResult(_0x5863c8,null))[_0xe7ba('0x14')](handleError(_0x5863c8,null));};exports[_0xe7ba('0x40')]=function(_0x4da728,_0x3b4ae4){return respondWithRpcPromise('ChatQueues',_0x4da728[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x3b4ae4,null))[_0xe7ba('0x14')](handleError(_0x3b4ae4,null));};exports['showChatQueues']=function(_0x38829a,_0x1128be){return respondWithRpcPromise(_0xe7ba('0x41'),_0x38829a[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x38829a['params']['id']))[_0xe7ba('0x13')](respondWithResult(_0x1128be,null))[_0xe7ba('0x14')](handleError(_0x1128be,null));};exports[_0xe7ba('0x42')]=function(_0x19159c,_0x435dee){return respondWithRpcPromise('MailQueues',_0x19159c[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x435dee,null))[_0xe7ba('0x14')](handleError(_0x435dee,null));};exports[_0xe7ba('0x43')]=function(_0x57b23e,_0x3e31c1){return respondWithRpcPromise(_0xe7ba('0x44'),_0x57b23e[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x57b23e[_0xe7ba('0x18')]['id']))[_0xe7ba('0x13')](respondWithResult(_0x3e31c1,null))['catch'](handleError(_0x3e31c1,null));};exports[_0xe7ba('0x45')]=function(_0x103762,_0x3bd82f){return respondWithRpcPromise('MailAccounts',_0x103762[_0xe7ba('0x1b')],mailClient)[_0xe7ba('0x13')](respondWithResult(_0x3bd82f,null))[_0xe7ba('0x14')](handleError(_0x3bd82f,null));};exports[_0xe7ba('0x46')]=function(_0x45fb0f,_0x162d7f){return respondWithRpcPromise(_0xe7ba('0x47'),_0x45fb0f[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x162d7f,null))[_0xe7ba('0x14')](handleError(_0x162d7f,null));};exports[_0xe7ba('0x48')]=function(_0x27422d,_0x4a5c8c){return respondWithRpcPromise(_0xe7ba('0x47'),_0x27422d[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x27422d['params']['id']))[_0xe7ba('0x13')](respondWithResult(_0x4a5c8c,null))['catch'](handleError(_0x4a5c8c,null));};exports[_0xe7ba('0x49')]=function(_0x194dff,_0x781e04){return respondWithRpcPromise('SmsQueues',_0x194dff['query'],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x781e04,null))[_0xe7ba('0x14')](handleError(_0x781e04,null));};exports[_0xe7ba('0x4a')]=function(_0x4de4c9,_0x3ba4fd){return respondWithRpcPromise(_0xe7ba('0x4b'),_0x4de4c9[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x4de4c9[_0xe7ba('0x18')]['id']))['then'](respondWithResult(_0x3ba4fd,null))[_0xe7ba('0x14')](handleError(_0x3ba4fd,null));};exports[_0xe7ba('0x4c')]=function(_0x70ce9c,_0x50cc8b){return respondWithRpcPromise(_0xe7ba('0x4d'),_0x70ce9c[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x50cc8b,null))[_0xe7ba('0x14')](handleError(_0x50cc8b,null));};exports[_0xe7ba('0x4e')]=function(_0x29c046,_0x6c8738){return respondWithRpcPromise(_0xe7ba('0x4d'),_0x29c046[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](findById(_0x29c046['params']['id']))[_0xe7ba('0x13')](respondWithResult(_0x6c8738,null))[_0xe7ba('0x14')](handleError(_0x6c8738,null));};exports[_0xe7ba('0x4f')]=function(_0xa6da9e,_0x4d8773){return respondWithRpcPromise('FaxQueues',_0xa6da9e[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x4d8773,null))[_0xe7ba('0x14')](handleError(_0x4d8773,null));};exports['showFaxQueues']=function(_0x53ebd1,_0x5561cc){return respondWithRpcPromise(_0xe7ba('0x50'),_0x53ebd1[_0xe7ba('0x1b')],routingClient)['then'](findById(_0x53ebd1[_0xe7ba('0x18')]['id']))['then'](respondWithResult(_0x5561cc,null))[_0xe7ba('0x14')](handleError(_0x5561cc,null));};exports['faxAccounts']=function(_0x11aded,_0x4ebe4a){return respondWithRpcPromise('FaxAccounts',_0x11aded[_0xe7ba('0x1b')])[_0xe7ba('0x13')](respondWithResult(_0x4ebe4a,null))[_0xe7ba('0x14')](handleError(_0x4ebe4a,null));};exports[_0xe7ba('0x51')]=function(_0x157d41,_0x35b755){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x157d41['query'],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x35b755,null))[_0xe7ba('0x14')](handleError(_0x35b755,null));};exports[_0xe7ba('0x52')]=function(_0x2e6e90,_0x18f23e){return respondWithRpcPromise(_0xe7ba('0x53'),_0x2e6e90[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x18f23e,null))[_0xe7ba('0x14')](handleError(_0x18f23e,null));};exports[_0xe7ba('0x54')]=function(_0x325ecb,_0x246f91){return respondWithRpcPromise(_0xe7ba('0x55'),_0x325ecb[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x246f91,null))['catch'](handleError(_0x246f91,null));};exports[_0xe7ba('0x56')]=function(_0x3acb1a,_0x5e16f1){return respondWithRpcPromise(_0xe7ba('0x55'),_0x3acb1a[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](function(_0x2471c8){if(_0x3acb1a[_0xe7ba('0x1b')][_0xe7ba('0x57')]!==undefined){var _0x24c94a=_(_0x2471c8[_0xe7ba('0x58')])[_0xe7ba('0x59')]([_0x3acb1a['query'][_0xe7ba('0x57')],_0x3acb1a['params']['id']])[_0xe7ba('0x5a')](_0xe7ba('0x5b'))[_0xe7ba('0x5c')]()['value']();return _0x2471c8[_0xe7ba('0x58')][_0xe7ba('0x59')](function(_0x2f1938){return _0x24c94a[_0xe7ba('0x5d')](_0x2f1938['queue_id'])>-0x1;});}else{return _0x2471c8[_0xe7ba('0x58')][_0xe7ba('0x59')](function(_0x433644){return _0x433644[_0xe7ba('0x5b')]===parseInt(_0x3acb1a['params']['id']);});}})[_0xe7ba('0x13')](respondWithResult(_0x5e16f1,null))[_0xe7ba('0x14')](handleError(_0x5e16f1,null));};exports[_0xe7ba('0x5e')]=function(_0x1bfb80,_0x16af73){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x1bfb80['query'],routingClient)['then'](respondWithResult(_0x16af73,null))[_0xe7ba('0x14')](handleError(_0x16af73,null));};exports[_0xe7ba('0x5f')]=function(_0x41a346,_0x27e7a5){return respondWithRpcPromise(_0xe7ba('0x60'),_0x41a346[_0xe7ba('0x1b')],routingClient)['then'](respondWithResult(_0x27e7a5,null))[_0xe7ba('0x14')](handleError(_0x27e7a5,null));};exports['faxQueuesWaitingInteractions']=function(_0x439c96,_0x2e3e28){return respondWithRpcPromise(_0xe7ba('0x61'),_0x439c96[_0xe7ba('0x1b')],routingClient)[_0xe7ba('0x13')](respondWithResult(_0x2e3e28,null))[_0xe7ba('0x14')](handleError(_0x2e3e28,null));};exports['queueNotify']=function(_0x44563b){return function(_0x4904d2,_0x8cba2c){var _0x18e715,_0x1d3035;var _0x5e70d9=_[_0xe7ba('0x62')](_0x44563b);var _0x52d73a=_0x44563b===_0xe7ba('0x63')?_0xe7ba('0x64'):_0xe7ba('0x65');return db[_0x5e70d9+_0xe7ba('0x66')][_0xe7ba('0x67')]({'raw':!![],'where':{'id':_0x4904d2[_0xe7ba('0x18')]['id']}})[_0xe7ba('0x13')](function(_0x3bf6b8){if(_[_0xe7ba('0x10')](_0x3bf6b8)){throw new Error(_0x5e70d9+_0xe7ba('0x68'));}_0x18e715=_0x3bf6b8;return db[_0x5e70d9+_0xe7ba('0x69')][_0xe7ba('0x67')]({'where':{'id':_0x4904d2[_0xe7ba('0x2c')][_0xe7ba('0x6a')]},'include':[{'model':db[_0x5e70d9+_0xe7ba('0x6b')],'as':_0xe7ba('0x6b')},{'model':db[_0x5e70d9+_0x52d73a],'as':_0xe7ba('0x65')}]});})[_0xe7ba('0x13')](function(_0x691f8c){if(_[_0xe7ba('0x10')](_0x691f8c)){throw new Error(_0x5e70d9+_0xe7ba('0x6c'));}_0x1d3035=_0x691f8c;return _0x691f8c[_0xe7ba('0x6d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xe7ba('0x13')](function(){var _0x36cf6d={'uniqueid':_0x44563b+'.'+_0x1d3035['id']+'.'+_0x1d3035[_0xe7ba('0x6b')]['id'],'FromUserId':_0x4904d2['user']['id'],'type':'queue'};_0x36cf6d[_0x5e70d9+'MessageId']=_0x1d3035['id'];_0x36cf6d[_0x5e70d9+_0xe7ba('0x6e')]=_0x1d3035[_0xe7ba('0x6b')]['id'];_0x36cf6d['From'+_0x5e70d9+_0x52d73a+'Id']=_0x1d3035['Account']['id'];_0x36cf6d['To'+_0x5e70d9+_0xe7ba('0x6f')]=_0x18e715['id'];return db[_0x5e70d9+_0xe7ba('0x70')]['create'](_0x36cf6d);})[_0xe7ba('0x13')](function(){return respondWithRpcPromise('Start',{'channel':_0x44563b,'interaction':_0x1d3035['Interaction'],'message':_0x1d3035,'account':_0x1d3035['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xe7ba('0x71'),'appdata':_0x18e715[_0xe7ba('0xf')]+','+(_0x1d3035[_0xe7ba('0x65')][_0xe7ba('0x72')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xe7ba('0x13')](respondWithResult(_0x8cba2c,null))[_0xe7ba('0x14')](handleError(_0x8cba2c,null));};};exports['agentNotify']=function(_0x575170,_0x459b0c){var _0x5d5722,_0x40ae10;if(_[_0xe7ba('0x10')](_0x575170[_0xe7ba('0x2c')]['channel'])){throw new Error(_0xe7ba('0x73'));}var _0x17391f=_0x575170[_0xe7ba('0x2c')][_0xe7ba('0x74')];var _0x34b5d8=_[_0xe7ba('0x62')](_0x17391f);var _0x44c657=_0x17391f===_0xe7ba('0x63')?_0xe7ba('0x64'):_0xe7ba('0x65');return db[_0xe7ba('0x75')][_0xe7ba('0x67')]({'raw':!![],'where':{'id':_0x575170[_0xe7ba('0x18')]['id'],'role':_0xe7ba('0x39')}})[_0xe7ba('0x13')](function(_0x16b3df){if(_[_0xe7ba('0x10')](_0x16b3df)){throw new Error(_0xe7ba('0x76'));}_0x5d5722=_0x16b3df;return db[_0x34b5d8+_0xe7ba('0x69')][_0xe7ba('0x67')]({'where':{'id':_0x575170[_0xe7ba('0x2c')]['messageId']},'include':[{'model':db[_0x34b5d8+'Interaction'],'as':'Interaction'},{'model':db[_0x34b5d8+_0x44c657],'as':_0xe7ba('0x65')}]});})[_0xe7ba('0x13')](function(_0x34f0f9){if(_[_0xe7ba('0x10')](_0x34f0f9)){throw new Error(_0x34b5d8+_0xe7ba('0x6c'));}_0x40ae10=_0x34f0f9;return _0x34f0f9['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x2c86d2={'uniqueid':_0x17391f+'.'+_0x40ae10['id']+'.'+_0x40ae10['Interaction']['id'],'FromUserId':_0x575170[_0xe7ba('0x2e')]['id'],'type':_0xe7ba('0x71'),'ToUserId':_0x5d5722['id']};_0x2c86d2[_0x34b5d8+_0xe7ba('0x77')]=_0x40ae10['id'];_0x2c86d2[_0x34b5d8+_0xe7ba('0x6e')]=_0x40ae10[_0xe7ba('0x6b')]['id'];_0x2c86d2[_0xe7ba('0x78')+_0x34b5d8+_0x44c657+'Id']=_0x40ae10[_0xe7ba('0x65')]['id'];return db[_0x34b5d8+_0xe7ba('0x70')]['create'](_0x2c86d2);})[_0xe7ba('0x13')](function(){return respondWithRpcPromise(_0xe7ba('0x79'),{'channel':_0x17391f,'interaction':_0x40ae10[_0xe7ba('0x6b')],'message':_0x40ae10,'account':_0x40ae10['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x5d5722[_0xe7ba('0xf')]+','+(_0x40ae10[_0xe7ba('0x65')][_0xe7ba('0x7a')]||0x12c),'interval':_0xe7ba('0x7b')}]},routingClient);})['then'](respondWithResult(_0x459b0c,null))[_0xe7ba('0x14')](handleError(_0x459b0c,null));};
\ No newline at end of file
index a1da49c..ae13710 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5bb=['/:id/run','create','put','delete','/:id','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','show'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xc5bb,0x126));var _0xbc5b=function(_0x20f6b,_0x4b8538){_0x20f6b=_0x20f6b-0x0;var _0x2407df=_0xc5bb[_0x20f6b];return _0x2407df;};'use strict';var multer=require(_0xbc5b('0x0'));var util=require(_0xbc5b('0x1'));var path=require('path');var timeout=require(_0xbc5b('0x2'));var express=require(_0xbc5b('0x3'));var router=express[_0xbc5b('0x4')]();var fs_extra=require(_0xbc5b('0x5'));var auth=require(_0xbc5b('0x6'));var interaction=require(_0xbc5b('0x7'));var config=require('../../config/environment');var controller=require('./schedule.controller');router['get']('/',auth[_0xbc5b('0x8')](),controller[_0xbc5b('0x9')]);router[_0xbc5b('0xa')]('/:id',auth[_0xbc5b('0x8')](),controller[_0xbc5b('0xb')]);router[_0xbc5b('0xa')](_0xbc5b('0xc'),auth[_0xbc5b('0x8')](),controller['run']);router['post']('/',auth[_0xbc5b('0x8')](),controller[_0xbc5b('0xd')]);router[_0xbc5b('0xe')]('/:id',auth[_0xbc5b('0x8')](),controller['update']);router[_0xbc5b('0xf')](_0xbc5b('0x10'),auth[_0xbc5b('0x8')](),controller['destroy']);module[_0xbc5b('0x11')]=router;
\ No newline at end of file
+var _0x4af7=['/:id','show','get','/:id/run','run','post','create','put','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x4af7,0x172));var _0x74af=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x4af7[_0x44b3bd];return _0x1efc4a;};'use strict';var multer=require(_0x74af('0x0'));var util=require('util');var path=require(_0x74af('0x1'));var timeout=require('connect-timeout');var express=require(_0x74af('0x2'));var router=express[_0x74af('0x3')]();var fs_extra=require(_0x74af('0x4'));var auth=require(_0x74af('0x5'));var interaction=require(_0x74af('0x6'));var config=require(_0x74af('0x7'));var controller=require(_0x74af('0x8'));router['get']('/',auth[_0x74af('0x9')](),controller['index']);router['get'](_0x74af('0xa'),auth['isAuthenticated'](),controller[_0x74af('0xb')]);router[_0x74af('0xc')](_0x74af('0xd'),auth['isAuthenticated'](),controller[_0x74af('0xe')]);router[_0x74af('0xf')]('/',auth[_0x74af('0x9')](),controller[_0x74af('0x10')]);router[_0x74af('0x11')](_0x74af('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x74af('0x12')](_0x74af('0xa'),auth[_0x74af('0x9')](),controller[_0x74af('0x13')]);module['exports']=router;
\ No newline at end of file
index 1fb2070..fe0544d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d88=['weeks','days','minutes','ENUM','csv','pdf','custom','default','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','years','quarters','months'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x5d88,0xd5));var _0x85d8=function(_0x3e2bb3,_0x2a13bf){_0x3e2bb3=_0x3e2bb3-0x0;var _0x30d4dc=_0x5d88[_0x3e2bb3];return _0x30d4dc;};'use strict';var Sequelize=require('sequelize');module[_0x85d8('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x85d8('0x1')]},'active':{'type':Sequelize[_0x85d8('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x85d8('0x1')],'allowNull':![],'defaultValue':_0x85d8('0x3')},'startAt':{'type':Sequelize[_0x85d8('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x85d8('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x85d8('0x5'),_0x85d8('0x6'),_0x85d8('0x7'),_0x85d8('0x8'),_0x85d8('0x9'),'hours',_0x85d8('0xa')),'allowNull':![],'defaultValue':_0x85d8('0x9')},'output':{'type':Sequelize[_0x85d8('0xb')](_0x85d8('0xc'),_0x85d8('0xd'),'xlsx'),'allowNull':![],'defaultValue':_0x85d8('0xc')},'type':{'type':Sequelize[_0x85d8('0xb')](_0x85d8('0xe'),_0x85d8('0xf')),'allowNull':![],'defaultValue':_0x85d8('0xe')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x85d8('0x10')]},'bcc':{'type':Sequelize[_0x85d8('0x10')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xfb19=['sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','ENUM','quarters','months','weeks','days','hours','minutes','csv','xlsx','custom','default'];(function(_0x3aace3,_0x257273){var _0x572543=function(_0xe93782){while(--_0xe93782){_0x3aace3['push'](_0x3aace3['shift']());}};_0x572543(++_0x257273);}(_0xfb19,0x1ed));var _0x9fb1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfb19[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x9fb1('0x0'));module[_0x9fb1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9fb1('0x2')]},'active':{'type':Sequelize[_0x9fb1('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x9fb1('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x9fb1('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x9fb1('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x9fb1('0x6')]('years',_0x9fb1('0x7'),_0x9fb1('0x8'),_0x9fb1('0x9'),_0x9fb1('0xa'),_0x9fb1('0xb'),_0x9fb1('0xc')),'allowNull':![],'defaultValue':_0x9fb1('0xa')},'output':{'type':Sequelize[_0x9fb1('0x6')](_0x9fb1('0xd'),'pdf',_0x9fb1('0xe')),'allowNull':![],'defaultValue':_0x9fb1('0xd')},'type':{'type':Sequelize[_0x9fb1('0x6')](_0x9fb1('0xf'),_0x9fb1('0x10')),'allowNull':![],'defaultValue':_0x9fb1('0xf')},'sendMail':{'type':Sequelize[_0x9fb1('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x9fb1('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index af2a8a4..66ae90b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bc5=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','get','Scheduler','UserProfileResource','error','stack','name','send','map','Schedule','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','type','filter','options','includeAll','include','findAll','rows','catch','params','merge','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','run','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','sendStatus','end'];(function(_0x51ed94,_0x1d4cf8){var _0x10e483=function(_0x35441c){while(--_0x35441c){_0x51ed94['push'](_0x51ed94['shift']());}};_0x10e483(++_0x1d4cf8);}(_0x2bc5,0xdb));var _0x52bc=function(_0x2a86ef,_0x589d9b){_0x2a86ef=_0x2a86ef-0x0;var _0x2a7f48=_0x2bc5[_0x2a86ef];return _0x2a7f48;};'use strict';var emlformat=require(_0x52bc('0x0'));var rimraf=require(_0x52bc('0x1'));var zipdir=require(_0x52bc('0x2'));var jsonpatch=require(_0x52bc('0x3'));var rp=require(_0x52bc('0x4'));var moment=require(_0x52bc('0x5'));var BPromise=require(_0x52bc('0x6'));var Mustache=require(_0x52bc('0x7'));var util=require(_0x52bc('0x8'));var path=require(_0x52bc('0x9'));var sox=require(_0x52bc('0xa'));var csv=require('to-csv');var ejs=require(_0x52bc('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x52bc('0xc'));var jsforce=require(_0x52bc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x52bc('0xe'));var querystring=require(_0x52bc('0xf'));var Papa=require('papaparse');var Redis=require(_0x52bc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x52bc('0x11'));var as=require(_0x52bc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x52bc('0x13'))(_0x52bc('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x52bc('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x578d47,_0x16f476){_0x16f476=_0x16f476||0xcc;return function(_0x364e6b){if(_0x364e6b){return _0x578d47[_0x52bc('0x16')](_0x16f476);}return _0x578d47['status'](_0x16f476)[_0x52bc('0x17')]();};}function respondWithResult(_0x44d18e,_0x3c63b3){_0x3c63b3=_0x3c63b3||0xc8;return function(_0x4099c1){if(_0x4099c1){return _0x44d18e[_0x52bc('0x18')](_0x3c63b3)[_0x52bc('0x19')](_0x4099c1);}};}function respondWithFilteredResult(_0x417f8b,_0x2d405b){return function(_0x2533f1){if(_0x2533f1){var _0x777cbb=typeof _0x2d405b[_0x52bc('0x1a')]===_0x52bc('0x1b')&&typeof _0x2d405b[_0x52bc('0x1c')]===_0x52bc('0x1b');var _0x45ec8b=_0x2533f1[_0x52bc('0x1d')];var _0x3054ab=_0x777cbb?0x0:_0x2d405b[_0x52bc('0x1a')];var _0x386560=_0x777cbb?_0x2533f1[_0x52bc('0x1d')]:_0x2d405b['offset']+_0x2d405b['limit'];var _0x2ab709;if(_0x386560>=_0x45ec8b){_0x386560=_0x45ec8b;_0x2ab709=0xc8;}else{_0x2ab709=0xce;}_0x417f8b[_0x52bc('0x18')](_0x2ab709);return _0x417f8b[_0x52bc('0x1e')](_0x52bc('0x1f'),_0x3054ab+'-'+_0x386560+'/'+_0x45ec8b)[_0x52bc('0x19')](_0x2533f1);}return null;};}function patchUpdates(_0x1a4481){return function(_0x393d26){try{jsonpatch[_0x52bc('0x20')](_0x393d26,_0x1a4481,!![]);}catch(_0x2faa77){return BPromise[_0x52bc('0x21')](_0x2faa77);}return _0x393d26['save']();};}function saveUpdates(_0x368671,_0x298b47){return function(_0x56ab66){if(_0x56ab66){return _0x56ab66[_0x52bc('0x22')](_0x368671)['then'](function(_0x5cb743){return _0x5cb743;});}return null;};}function removeEntity(_0x2e4d65,_0x1a916c){return function(_0x398622){if(_0x398622){return _0x398622[_0x52bc('0x23')]()[_0x52bc('0x24')](function(){var _0x29d58e=_0x398622[_0x52bc('0x25')]({'plain':!![]});var _0x51508b=_0x52bc('0x26');return db[_0x52bc('0x27')]['destroy']({'where':{'type':_0x51508b,'resourceId':_0x29d58e['id']}})[_0x52bc('0x24')](function(){return _0x398622;});})[_0x52bc('0x24')](function(){_0x2e4d65[_0x52bc('0x18')](0xcc)[_0x52bc('0x17')]();});}};}function handleEntityNotFound(_0x450f15,_0x3c10fb){return function(_0x46995d){if(!_0x46995d){_0x450f15['sendStatus'](0x194);}return _0x46995d;};}function handleError(_0x1a0a70,_0x4e3bda){_0x4e3bda=_0x4e3bda||0x1f4;return function(_0x582468){logger[_0x52bc('0x28')](_0x582468[_0x52bc('0x29')]);if(_0x582468[_0x52bc('0x2a')]){delete _0x582468[_0x52bc('0x2a')];}_0x1a0a70[_0x52bc('0x18')](_0x4e3bda)[_0x52bc('0x2b')](_0x582468);};}exports['index']=function(_0x40d26a,_0xd66718){var _0x4cca60={},_0x505562={},_0xb48cb4={'count':0x0,'rows':[]};var _0x3958a5=_[_0x52bc('0x2c')](db[_0x52bc('0x2d')][_0x52bc('0x2e')],function(_0x411a3c){return{'name':_0x411a3c[_0x52bc('0x2f')],'type':_0x411a3c['type'][_0x52bc('0x30')]};});_0x505562[_0x52bc('0x31')]=_['map'](_0x3958a5,_0x52bc('0x2a'));_0x505562[_0x52bc('0x32')]=_[_0x52bc('0x33')](_0x40d26a['query']);_0x505562[_0x52bc('0x34')]=_[_0x52bc('0x35')](_0x505562[_0x52bc('0x31')],_0x505562[_0x52bc('0x32')]);_0x4cca60[_0x52bc('0x36')]=_['intersection'](_0x505562[_0x52bc('0x31')],qs[_0x52bc('0x37')](_0x40d26a[_0x52bc('0x32')]['fields']));_0x4cca60[_0x52bc('0x36')]=_0x4cca60[_0x52bc('0x36')][_0x52bc('0x38')]?_0x4cca60[_0x52bc('0x36')]:_0x505562[_0x52bc('0x31')];if(!_0x40d26a[_0x52bc('0x32')]['hasOwnProperty'](_0x52bc('0x39'))){_0x4cca60[_0x52bc('0x1c')]=qs[_0x52bc('0x1c')](_0x40d26a[_0x52bc('0x32')]['limit']);_0x4cca60['offset']=qs[_0x52bc('0x1a')](_0x40d26a[_0x52bc('0x32')][_0x52bc('0x1a')]);}_0x4cca60[_0x52bc('0x3a')]=qs[_0x52bc('0x3b')](_0x40d26a[_0x52bc('0x32')][_0x52bc('0x3b')]);_0x4cca60['where']=qs[_0x52bc('0x34')](_[_0x52bc('0x3c')](_0x40d26a[_0x52bc('0x32')],_0x505562[_0x52bc('0x34')]),_0x3958a5);if(_0x40d26a[_0x52bc('0x32')]['filter']){_0x4cca60[_0x52bc('0x3d')]=_['merge'](_0x4cca60[_0x52bc('0x3d')],{'$or':_[_0x52bc('0x2c')](_0x3958a5,function(_0xd55967){if(_0xd55967[_0x52bc('0x3e')]!=='VIRTUAL'){var _0x379420={};_0x379420[_0xd55967[_0x52bc('0x2a')]]={'$like':'%'+_0x40d26a[_0x52bc('0x32')][_0x52bc('0x3f')]+'%'};return _0x379420;}})});}_0x4cca60=_['merge']({},_0x4cca60,_0x40d26a[_0x52bc('0x40')]);var _0x5c0487={'where':_0x4cca60[_0x52bc('0x3d')]};return db[_0x52bc('0x2d')][_0x52bc('0x1d')](_0x5c0487)[_0x52bc('0x24')](function(_0xfe176e){_0xb48cb4['count']=_0xfe176e;if(_0x40d26a[_0x52bc('0x32')][_0x52bc('0x41')]){_0x4cca60[_0x52bc('0x42')]=[{'all':!![]}];}return db[_0x52bc('0x2d')][_0x52bc('0x43')](_0x4cca60);})[_0x52bc('0x24')](function(_0x55561e){_0xb48cb4[_0x52bc('0x44')]=_0x55561e;return _0xb48cb4;})[_0x52bc('0x24')](respondWithFilteredResult(_0xd66718,_0x4cca60))[_0x52bc('0x45')](handleError(_0xd66718,null));};exports['show']=function(_0xa0a54,_0x5b9d8d){var _0x59d604={'raw':![],'where':{'id':_0xa0a54[_0x52bc('0x46')]['id']}},_0x3a8c5c={};_0x3a8c5c[_0x52bc('0x31')]=_['keys'](db['Schedule'][_0x52bc('0x2e')]);_0x3a8c5c[_0x52bc('0x32')]=_[_0x52bc('0x33')](_0xa0a54[_0x52bc('0x32')]);_0x3a8c5c['filters']=_[_0x52bc('0x35')](_0x3a8c5c['model'],_0x3a8c5c[_0x52bc('0x32')]);_0x59d604[_0x52bc('0x36')]=_[_0x52bc('0x35')](_0x3a8c5c['model'],qs[_0x52bc('0x37')](_0xa0a54[_0x52bc('0x32')][_0x52bc('0x37')]));_0x59d604[_0x52bc('0x36')]=_0x59d604[_0x52bc('0x36')][_0x52bc('0x38')]?_0x59d604['attributes']:_0x3a8c5c[_0x52bc('0x31')];if(_0xa0a54[_0x52bc('0x32')]['includeAll']){_0x59d604[_0x52bc('0x42')]=[{'all':!![]}];}_0x59d604=_[_0x52bc('0x47')]({},_0x59d604,_0xa0a54[_0x52bc('0x40')]);return db[_0x52bc('0x2d')]['find'](_0x59d604)[_0x52bc('0x24')](handleEntityNotFound(_0x5b9d8d,null))['then'](respondWithResult(_0x5b9d8d,null))[_0x52bc('0x45')](handleError(_0x5b9d8d,null));};exports[_0x52bc('0x48')]=function(_0x4bc2e1,_0x315eba){return db[_0x52bc('0x2d')][_0x52bc('0x48')](_0x4bc2e1[_0x52bc('0x49')],{})['then'](function(_0x146e77){var _0x348aa3=_0x4bc2e1[_0x52bc('0x4a')][_0x52bc('0x25')]({'plain':!![]});if(!_0x348aa3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x348aa3[_0x52bc('0x4b')]==='user'){var _0x4e1283=_0x146e77[_0x52bc('0x25')]({'plain':!![]});var _0x2ede7a=_0x52bc('0x26');return db[_0x52bc('0x4c')][_0x52bc('0x4d')]({'where':{'name':_0x2ede7a,'userProfileId':_0x348aa3[_0x52bc('0x4e')]},'raw':!![]})['then'](function(_0x18ce52){if(_0x18ce52&&_0x18ce52[_0x52bc('0x4f')]===0x0){return db[_0x52bc('0x27')][_0x52bc('0x48')]({'name':_0x4e1283[_0x52bc('0x2a')],'resourceId':_0x4e1283['id'],'type':_0x18ce52[_0x52bc('0x2a')],'sectionId':_0x18ce52['id']},{})[_0x52bc('0x24')](function(){return _0x146e77;});}else{return _0x146e77;}})[_0x52bc('0x45')](function(_0x17aed8){logger[_0x52bc('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x17aed8);throw _0x17aed8;});}return _0x146e77;})[_0x52bc('0x24')](respondWithResult(_0x315eba,0xc9))['catch'](handleError(_0x315eba,null));};exports[_0x52bc('0x22')]=function(_0x443f4b,_0x4f1777){if(_0x443f4b[_0x52bc('0x49')]['id']){delete _0x443f4b['body']['id'];}return db[_0x52bc('0x2d')]['find']({'where':{'id':_0x443f4b['params']['id']}})[_0x52bc('0x24')](handleEntityNotFound(_0x4f1777,null))[_0x52bc('0x24')](saveUpdates(_0x443f4b[_0x52bc('0x49')],null))['then'](respondWithResult(_0x4f1777,null))[_0x52bc('0x45')](handleError(_0x4f1777,null));};exports['destroy']=function(_0x4bb9e8,_0x35df46){return db[_0x52bc('0x2d')][_0x52bc('0x4d')]({'where':{'id':_0x4bb9e8['params']['id']}})['then'](handleEntityNotFound(_0x35df46,null))['then'](removeEntity(_0x35df46,null))[_0x52bc('0x45')](handleError(_0x35df46,null));};exports[_0x52bc('0x50')]=function(_0x118ea7,_0x4f5001,_0x4e7b09){var _0x2eb4cb=require('../../config/schedule');return db[_0x52bc('0x2d')][_0x52bc('0x4d')]({'where':{'id':_0x118ea7['params']['id']},'raw':!![]})[_0x52bc('0x24')](handleEntityNotFound(_0x4f5001,null))[_0x52bc('0x24')](function(){_0x2eb4cb[_0x52bc('0x50')](_0x118ea7[_0x52bc('0x46')]['id']);})[_0x52bc('0x24')](respondWithStatusCode(_0x4f5001,null))[_0x52bc('0x45')](handleError(_0x4f5001,null));};
\ No newline at end of file
+var _0x359b=['end','status','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','Scheduler','UserProfileResource','error','name','send','map','rawAttributes','fieldName','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','VIRTUAL','options','where','Schedule','includeAll','findAll','rows','catch','show','params','keys','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','destroy','run','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5ba08d,_0x281283){var _0x313f5f=function(_0x2c5a03){while(--_0x2c5a03){_0x5ba08d['push'](_0x5ba08d['shift']());}};_0x313f5f(++_0x281283);}(_0x359b,0x13a));var _0xb359=function(_0x56f008,_0x2ae8cd){_0x56f008=_0x56f008-0x0;var _0x11de8a=_0x359b[_0x56f008];return _0x11de8a;};'use strict';var emlformat=require(_0xb359('0x0'));var rimraf=require(_0xb359('0x1'));var zipdir=require(_0xb359('0x2'));var jsonpatch=require(_0xb359('0x3'));var rp=require('request-promise');var moment=require(_0xb359('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb359('0x5'));var util=require(_0xb359('0x6'));var path=require(_0xb359('0x7'));var sox=require(_0xb359('0x8'));var csv=require(_0xb359('0x9'));var ejs=require(_0xb359('0xa'));var fs=require('fs');var fs_extra=require(_0xb359('0xb'));var _=require(_0xb359('0xc'));var squel=require(_0xb359('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb359('0xe'));var toCsv=require(_0xb359('0x9'));var querystring=require(_0xb359('0xf'));var Papa=require('papaparse');var Redis=require(_0xb359('0x10'));var authService=require(_0xb359('0x11'));var qs=require(_0xb359('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb359('0x13'));var logger=require('../../config/logger')(_0xb359('0x14'));var utils=require(_0xb359('0x15'));var config=require(_0xb359('0x16'));var licenseUtil=require(_0xb359('0x17'));var db=require(_0xb359('0x18'))['db'];function respondWithStatusCode(_0x2509e4,_0xbb3973){_0xbb3973=_0xbb3973||0xcc;return function(_0x798c19){if(_0x798c19){return _0x2509e4[_0xb359('0x19')](_0xbb3973);}return _0x2509e4['status'](_0xbb3973)[_0xb359('0x1a')]();};}function respondWithResult(_0x31dad3,_0x16213a){_0x16213a=_0x16213a||0xc8;return function(_0x16f426){if(_0x16f426){return _0x31dad3[_0xb359('0x1b')](_0x16213a)['json'](_0x16f426);}};}function respondWithFilteredResult(_0x396896,_0x16be6a){return function(_0x5de9dc){if(_0x5de9dc){var _0x27a5bc=typeof _0x16be6a['offset']===_0xb359('0x1c')&&typeof _0x16be6a[_0xb359('0x1d')]===_0xb359('0x1c');var _0x186c57=_0x5de9dc['count'];var _0x18698c=_0x27a5bc?0x0:_0x16be6a['offset'];var _0x5f27d9=_0x27a5bc?_0x5de9dc[_0xb359('0x1e')]:_0x16be6a[_0xb359('0x1f')]+_0x16be6a[_0xb359('0x1d')];var _0x46b4aa;if(_0x5f27d9>=_0x186c57){_0x5f27d9=_0x186c57;_0x46b4aa=0xc8;}else{_0x46b4aa=0xce;}_0x396896[_0xb359('0x1b')](_0x46b4aa);return _0x396896[_0xb359('0x20')](_0xb359('0x21'),_0x18698c+'-'+_0x5f27d9+'/'+_0x186c57)['json'](_0x5de9dc);}return null;};}function patchUpdates(_0x307167){return function(_0x205d5a){try{jsonpatch[_0xb359('0x22')](_0x205d5a,_0x307167,!![]);}catch(_0x6d7d09){return BPromise[_0xb359('0x23')](_0x6d7d09);}return _0x205d5a[_0xb359('0x24')]();};}function saveUpdates(_0x503d08,_0x3ce92e){return function(_0x39e659){if(_0x39e659){return _0x39e659[_0xb359('0x25')](_0x503d08)[_0xb359('0x26')](function(_0x4d5942){return _0x4d5942;});}return null;};}function removeEntity(_0x43ecb0,_0x76fc76){return function(_0xa3317e){if(_0xa3317e){return _0xa3317e['destroy']()[_0xb359('0x26')](function(){var _0x4a1fb8=_0xa3317e[_0xb359('0x27')]({'plain':!![]});var _0x400206=_0xb359('0x28');return db[_0xb359('0x29')]['destroy']({'where':{'type':_0x400206,'resourceId':_0x4a1fb8['id']}})[_0xb359('0x26')](function(){return _0xa3317e;});})['then'](function(){_0x43ecb0[_0xb359('0x1b')](0xcc)[_0xb359('0x1a')]();});}};}function handleEntityNotFound(_0xa66987,_0x4263a0){return function(_0x21392a){if(!_0x21392a){_0xa66987[_0xb359('0x19')](0x194);}return _0x21392a;};}function handleError(_0x4c7fea,_0x142a4a){_0x142a4a=_0x142a4a||0x1f4;return function(_0x52cecf){logger[_0xb359('0x2a')](_0x52cecf['stack']);if(_0x52cecf['name']){delete _0x52cecf[_0xb359('0x2b')];}_0x4c7fea['status'](_0x142a4a)[_0xb359('0x2c')](_0x52cecf);};}exports['index']=function(_0x172275,_0x260b1c){var _0x269bac={},_0xdba35b={},_0x366d12={'count':0x0,'rows':[]};var _0x48f8af=_[_0xb359('0x2d')](db['Schedule'][_0xb359('0x2e')],function(_0x4ea214){return{'name':_0x4ea214[_0xb359('0x2f')],'type':_0x4ea214['type'][_0xb359('0x30')]};});_0xdba35b['model']=_[_0xb359('0x2d')](_0x48f8af,_0xb359('0x2b'));_0xdba35b[_0xb359('0x31')]=_['keys'](_0x172275['query']);_0xdba35b[_0xb359('0x32')]=_['intersection'](_0xdba35b[_0xb359('0x33')],_0xdba35b[_0xb359('0x31')]);_0x269bac[_0xb359('0x34')]=_[_0xb359('0x35')](_0xdba35b['model'],qs['fields'](_0x172275[_0xb359('0x31')][_0xb359('0x36')]));_0x269bac[_0xb359('0x34')]=_0x269bac[_0xb359('0x34')][_0xb359('0x37')]?_0x269bac[_0xb359('0x34')]:_0xdba35b[_0xb359('0x33')];if(!_0x172275[_0xb359('0x31')][_0xb359('0x38')](_0xb359('0x39'))){_0x269bac[_0xb359('0x1d')]=qs[_0xb359('0x1d')](_0x172275['query']['limit']);_0x269bac[_0xb359('0x1f')]=qs[_0xb359('0x1f')](_0x172275[_0xb359('0x31')][_0xb359('0x1f')]);}_0x269bac[_0xb359('0x3a')]=qs[_0xb359('0x3b')](_0x172275['query'][_0xb359('0x3b')]);_0x269bac['where']=qs[_0xb359('0x32')](_[_0xb359('0x3c')](_0x172275['query'],_0xdba35b['filters']),_0x48f8af);if(_0x172275['query'][_0xb359('0x3d')]){_0x269bac['where']=_[_0xb359('0x3e')](_0x269bac['where'],{'$or':_[_0xb359('0x2d')](_0x48f8af,function(_0x44f82a){if(_0x44f82a[_0xb359('0x3f')]!==_0xb359('0x40')){var _0x37b439={};_0x37b439[_0x44f82a[_0xb359('0x2b')]]={'$like':'%'+_0x172275[_0xb359('0x31')][_0xb359('0x3d')]+'%'};return _0x37b439;}})});}_0x269bac=_[_0xb359('0x3e')]({},_0x269bac,_0x172275[_0xb359('0x41')]);var _0x3b8d76={'where':_0x269bac[_0xb359('0x42')]};return db[_0xb359('0x43')][_0xb359('0x1e')](_0x3b8d76)[_0xb359('0x26')](function(_0x1d480d){_0x366d12[_0xb359('0x1e')]=_0x1d480d;if(_0x172275[_0xb359('0x31')][_0xb359('0x44')]){_0x269bac['include']=[{'all':!![]}];}return db[_0xb359('0x43')][_0xb359('0x45')](_0x269bac);})[_0xb359('0x26')](function(_0x189c0d){_0x366d12[_0xb359('0x46')]=_0x189c0d;return _0x366d12;})[_0xb359('0x26')](respondWithFilteredResult(_0x260b1c,_0x269bac))[_0xb359('0x47')](handleError(_0x260b1c,null));};exports[_0xb359('0x48')]=function(_0x116ea6,_0x588281){var _0x21a968={'raw':![],'where':{'id':_0x116ea6[_0xb359('0x49')]['id']}},_0xca5f60={};_0xca5f60['model']=_[_0xb359('0x4a')](db[_0xb359('0x43')][_0xb359('0x2e')]);_0xca5f60[_0xb359('0x31')]=_[_0xb359('0x4a')](_0x116ea6[_0xb359('0x31')]);_0xca5f60[_0xb359('0x32')]=_[_0xb359('0x35')](_0xca5f60['model'],_0xca5f60[_0xb359('0x31')]);_0x21a968['attributes']=_[_0xb359('0x35')](_0xca5f60[_0xb359('0x33')],qs[_0xb359('0x36')](_0x116ea6[_0xb359('0x31')][_0xb359('0x36')]));_0x21a968[_0xb359('0x34')]=_0x21a968[_0xb359('0x34')][_0xb359('0x37')]?_0x21a968[_0xb359('0x34')]:_0xca5f60[_0xb359('0x33')];if(_0x116ea6['query'][_0xb359('0x44')]){_0x21a968[_0xb359('0x4b')]=[{'all':!![]}];}_0x21a968=_[_0xb359('0x3e')]({},_0x21a968,_0x116ea6[_0xb359('0x41')]);return db[_0xb359('0x43')]['find'](_0x21a968)[_0xb359('0x26')](handleEntityNotFound(_0x588281,null))[_0xb359('0x26')](respondWithResult(_0x588281,null))[_0xb359('0x47')](handleError(_0x588281,null));};exports[_0xb359('0x4c')]=function(_0x451836,_0x3fd2f2){return db[_0xb359('0x43')][_0xb359('0x4c')](_0x451836[_0xb359('0x4d')],{})[_0xb359('0x26')](function(_0x47d4c0){var _0x3d87e5=_0x451836['user'][_0xb359('0x27')]({'plain':!![]});if(!_0x3d87e5)throw new Error(_0xb359('0x4e'));if(_0x3d87e5['role']==='user'){var _0x5a8ae7=_0x47d4c0[_0xb359('0x27')]({'plain':!![]});var _0x41030b=_0xb359('0x28');return db[_0xb359('0x4f')][_0xb359('0x50')]({'where':{'name':_0x41030b,'userProfileId':_0x3d87e5[_0xb359('0x51')]},'raw':!![]})['then'](function(_0x37993d){if(_0x37993d&&_0x37993d[_0xb359('0x52')]===0x0){return db[_0xb359('0x29')][_0xb359('0x4c')]({'name':_0x5a8ae7[_0xb359('0x2b')],'resourceId':_0x5a8ae7['id'],'type':_0x37993d[_0xb359('0x2b')],'sectionId':_0x37993d['id']},{})[_0xb359('0x26')](function(){return _0x47d4c0;});}else{return _0x47d4c0;}})[_0xb359('0x47')](function(_0x56bec2){logger[_0xb359('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x56bec2);throw _0x56bec2;});}return _0x47d4c0;})[_0xb359('0x26')](respondWithResult(_0x3fd2f2,0xc9))['catch'](handleError(_0x3fd2f2,null));};exports[_0xb359('0x25')]=function(_0x3a4f6a,_0x568b7b){if(_0x3a4f6a[_0xb359('0x4d')]['id']){delete _0x3a4f6a[_0xb359('0x4d')]['id'];}return db[_0xb359('0x43')][_0xb359('0x50')]({'where':{'id':_0x3a4f6a['params']['id']}})['then'](handleEntityNotFound(_0x568b7b,null))['then'](saveUpdates(_0x3a4f6a[_0xb359('0x4d')],null))[_0xb359('0x26')](respondWithResult(_0x568b7b,null))[_0xb359('0x47')](handleError(_0x568b7b,null));};exports[_0xb359('0x53')]=function(_0x28dcfc,_0x518dd8){return db[_0xb359('0x43')][_0xb359('0x50')]({'where':{'id':_0x28dcfc[_0xb359('0x49')]['id']}})[_0xb359('0x26')](handleEntityNotFound(_0x518dd8,null))[_0xb359('0x26')](removeEntity(_0x518dd8,null))['catch'](handleError(_0x518dd8,null));};exports[_0xb359('0x54')]=function(_0x48aaea,_0x309f43,_0xeb6058){var _0x238db0=require('../../config/schedule');return db[_0xb359('0x43')][_0xb359('0x50')]({'where':{'id':_0x48aaea[_0xb359('0x49')]['id']},'raw':!![]})[_0xb359('0x26')](handleEntityNotFound(_0x309f43,null))[_0xb359('0x26')](function(){_0x238db0[_0xb359('0x54')](_0x48aaea[_0xb359('0x49')]['id']);})[_0xb359('0x26')](respondWithStatusCode(_0x309f43,null))[_0xb359('0x47')](handleError(_0x309f43,null));};
\ No newline at end of file
index 00013ec..5229ddd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76b1=['exports','define','Schedule','tools_schedules','lodash','../../config/logger','api','moment','../../config/environment'];(function(_0xf2413d,_0x58d017){var _0x1c6c4f=function(_0x5b4640){while(--_0x5b4640){_0xf2413d['push'](_0xf2413d['shift']());}};_0x1c6c4f(++_0x58d017);}(_0x76b1,0xa6));var _0x176b=function(_0x1e8549,_0x5732d4){_0x1e8549=_0x1e8549-0x0;var _0x31b77b=_0x76b1[_0x1e8549];return _0x31b77b;};'use strict';var _=require(_0x176b('0x0'));var util=require('util');var logger=require(_0x176b('0x1'))(_0x176b('0x2'));var moment=require(_0x176b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x176b('0x4'));var attributes=require('./schedule.attributes');module[_0x176b('0x5')]=function(_0x8b34e1,_0xf06754){return _0x8b34e1[_0x176b('0x6')](_0x176b('0x7'),attributes,{'tableName':_0x176b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x736d=['Schedule','util','api','bluebird','rimraf','./schedule.attributes','define'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0x736d,0x104));var _0xd736=function(_0x31db9b,_0x4b404b){_0x31db9b=_0x31db9b-0x0;var _0x1dd1e8=_0x736d[_0x31db9b];return _0x1dd1e8;};'use strict';var _=require('lodash');var util=require(_0xd736('0x0'));var logger=require('../../config/logger')(_0xd736('0x1'));var moment=require('moment');var BPromise=require(_0xd736('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd736('0x3'));var config=require('../../config/environment');var attributes=require(_0xd736('0x4'));module['exports']=function(_0x478d31,_0x3fa407){return _0x478d31[_0xd736('0x5')](_0xd736('0x6'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2d0703c..d77e16b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44ff=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','lodash','util'];(function(_0x2cd47a,_0x8d7e3d){var _0x1fa38b=function(_0x28b8dc){while(--_0x28b8dc){_0x2cd47a['push'](_0x2cd47a['shift']());}};_0x1fa38b(++_0x8d7e3d);}(_0x44ff,0x1a0));var _0xf44f=function(_0x416cdc,_0x213b87){_0x416cdc=_0x416cdc-0x0;var _0x1931ce=_0x44ff[_0x416cdc];return _0x1931ce;};'use strict';var _=require(_0xf44f('0x0'));var util=require(_0xf44f('0x1'));var moment=require(_0xf44f('0x2'));var BPromise=require('bluebird');var rs=require(_0xf44f('0x3'));var fs=require('fs');var Redis=require(_0xf44f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf44f('0x5'));var logger=require(_0xf44f('0x6'))(_0xf44f('0x7'));var config=require(_0xf44f('0x8'));var jayson=require(_0xf44f('0x9'));var client=jayson[_0xf44f('0xa')][_0xf44f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53eb39,_0x4e2508,_0x306223){return new BPromise(function(_0x2a3417,_0x2845db){return client[_0xf44f('0xc')](_0x53eb39,_0x306223)[_0xf44f('0xd')](function(_0x9ab057){logger[_0xf44f('0xe')](_0xf44f('0xf'),_0x4e2508,_0xf44f('0x10'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x4e2508,_0xf44f('0x10'),JSON[_0xf44f('0x11')](_0x9ab057));if(_0x9ab057['error']){if(_0x9ab057['error'][_0xf44f('0x12')]===0x1f4){logger[_0xf44f('0x13')](_0xf44f('0xf'),_0x4e2508,_0x9ab057['error'][_0xf44f('0x14')]);return _0x2845db(_0x9ab057[_0xf44f('0x13')][_0xf44f('0x14')]);}logger[_0xf44f('0x13')](_0xf44f('0xf'),_0x4e2508,_0x9ab057[_0xf44f('0x13')][_0xf44f('0x14')]);return _0x2a3417(_0x9ab057['error'][_0xf44f('0x14')]);}else{logger['info'](_0xf44f('0xf'),_0x4e2508,_0xf44f('0x10'));_0x2a3417(_0x9ab057['result'][_0xf44f('0x14')]);}})[_0xf44f('0x15')](function(_0x487889){logger['error']('Schedule,\x20%s,\x20%s',_0x4e2508,_0x487889);_0x2845db(_0x487889);});});}
\ No newline at end of file
+var _0x7e49=['http','request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x54a7a1,_0x2d4436){var _0x335d2d=function(_0x15ac2f){while(--_0x15ac2f){_0x54a7a1['push'](_0x54a7a1['shift']());}};_0x335d2d(++_0x2d4436);}(_0x7e49,0xa4));var _0x97e4=function(_0x48e7f9,_0x498542){_0x48e7f9=_0x48e7f9-0x0;var _0x10f99e=_0x7e49[_0x48e7f9];return _0x10f99e;};'use strict';var _=require('lodash');var util=require(_0x97e4('0x0'));var moment=require(_0x97e4('0x1'));var BPromise=require(_0x97e4('0x2'));var rs=require(_0x97e4('0x3'));var fs=require('fs');var Redis=require(_0x97e4('0x4'));var db=require(_0x97e4('0x5'))['db'];var utils=require(_0x97e4('0x6'));var logger=require(_0x97e4('0x7'))(_0x97e4('0x8'));var config=require(_0x97e4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x97e4('0xa')][_0x97e4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e57af,_0x149c64,_0x1eb5ce){return new BPromise(function(_0x35f8ac,_0x38a97a){return client[_0x97e4('0xc')](_0x4e57af,_0x1eb5ce)[_0x97e4('0xd')](function(_0x4875ba){logger['info'](_0x97e4('0xe'),_0x149c64,_0x97e4('0xf'));logger[_0x97e4('0x10')](_0x97e4('0x11'),_0x149c64,_0x97e4('0xf'),JSON[_0x97e4('0x12')](_0x4875ba));if(_0x4875ba['error']){if(_0x4875ba[_0x97e4('0x13')][_0x97e4('0x14')]===0x1f4){logger[_0x97e4('0x13')](_0x97e4('0xe'),_0x149c64,_0x4875ba[_0x97e4('0x13')][_0x97e4('0x15')]);return _0x38a97a(_0x4875ba['error']['message']);}logger[_0x97e4('0x13')](_0x97e4('0xe'),_0x149c64,_0x4875ba[_0x97e4('0x13')]['message']);return _0x35f8ac(_0x4875ba[_0x97e4('0x13')]['message']);}else{logger[_0x97e4('0x16')]('Schedule,\x20%s,\x20%s',_0x149c64,_0x97e4('0xf'));_0x35f8ac(_0x4875ba[_0x97e4('0x17')][_0x97e4('0x15')]);}})[_0x97e4('0x18')](function(_0x5546b1){logger['error'](_0x97e4('0xe'),_0x149c64,_0x5546b1);_0x38a97a(_0x5546b1);});});}
\ No newline at end of file
index 36eafcf..27138c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6488=['get','isAuthenticated','index','/:id','show','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x6488,0x1db));var _0x8648=function(_0x3e3936,_0x24c3a6){_0x3e3936=_0x3e3936-0x0;var _0x10be4e=_0x6488[_0x3e3936];return _0x10be4e;};'use strict';var multer=require(_0x8648('0x0'));var util=require(_0x8648('0x1'));var path=require(_0x8648('0x2'));var timeout=require(_0x8648('0x3'));var express=require(_0x8648('0x4'));var router=express[_0x8648('0x5')]();var fs_extra=require(_0x8648('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8648('0x7'));var config=require(_0x8648('0x8'));var controller=require('./screenRecording.controller');router[_0x8648('0x9')]('/',auth[_0x8648('0xa')](),controller[_0x8648('0xb')]);router[_0x8648('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x8648('0xc'),auth[_0x8648('0xa')](),controller[_0x8648('0xd')]);router[_0x8648('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0x8648('0xe')]);router[_0x8648('0xf')]('/',auth[_0x8648('0xa')](),controller[_0x8648('0x10')]);router[_0x8648('0x11')](_0x8648('0xc'),auth[_0x8648('0xa')](),controller[_0x8648('0x12')]);router[_0x8648('0x13')](_0x8648('0xc'),auth[_0x8648('0xa')](),controller[_0x8648('0x14')]);module[_0x8648('0x15')]=router;
\ No newline at end of file
+var _0xc272=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','create','put','update','delete'];(function(_0x295d0f,_0x40e4ef){var _0x1258a9=function(_0x18180f){while(--_0x18180f){_0x295d0f['push'](_0x295d0f['shift']());}};_0x1258a9(++_0x40e4ef);}(_0xc272,0x1bb));var _0x2c27=function(_0x79c6de,_0x10de94){_0x79c6de=_0x79c6de-0x0;var _0x321a56=_0xc272[_0x79c6de];return _0x321a56;};'use strict';var multer=require(_0x2c27('0x0'));var util=require(_0x2c27('0x1'));var path=require(_0x2c27('0x2'));var timeout=require('connect-timeout');var express=require(_0x2c27('0x3'));var router=express[_0x2c27('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2c27('0x5'));var interaction=require(_0x2c27('0x6'));var config=require(_0x2c27('0x7'));var controller=require('./screenRecording.controller');router[_0x2c27('0x8')]('/',auth[_0x2c27('0x9')](),controller[_0x2c27('0xa')]);router[_0x2c27('0x8')](_0x2c27('0xb'),auth[_0x2c27('0x9')](),controller[_0x2c27('0xc')]);router[_0x2c27('0x8')](_0x2c27('0xd'),auth[_0x2c27('0x9')](),controller['show']);router[_0x2c27('0x8')](_0x2c27('0xe'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x2c27('0xf')]);router[_0x2c27('0x10')](_0x2c27('0xd'),auth[_0x2c27('0x9')](),controller[_0x2c27('0x11')]);router[_0x2c27('0x12')](_0x2c27('0xd'),auth[_0x2c27('0x9')](),controller[_0x2c27('0x13')]);module[_0x2c27('0x14')]=router;
\ No newline at end of file
index db96077..c3e6dd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72fa=['startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','../../config/environment','exports','VIRTUAL','extname','getDataValue','value','STRING','replace','setDataValue','INTEGER'];(function(_0x53f897,_0x539857){var _0x6879f8=function(_0xa3c36){while(--_0xa3c36){_0x53f897['push'](_0x53f897['shift']());}};_0x6879f8(++_0x539857);}(_0x72fa,0x78));var _0xa72f=function(_0x5ad67c,_0x144860){_0x5ad67c=_0x5ad67c-0x0;var _0xccce2e=_0x72fa[_0x5ad67c];return _0xccce2e;};'use strict';var Sequelize=require(_0xa72f('0x0'));var moment=require(_0xa72f('0x1'));var path=require('path');var config=require(_0xa72f('0x2'));module[_0xa72f('0x3')]={'format':{'type':Sequelize[_0xa72f('0x4')],'get':function(){return this['getDataValue']('value')?path[_0xa72f('0x5')](this[_0xa72f('0x6')](_0xa72f('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0xa72f('0x8')]},'channel':{'type':Sequelize[_0xa72f('0x8')]},'value':{'type':Sequelize[_0xa72f('0x8')],'set':function(_0x2cd1a3){var _0xe8aa31=_0x2cd1a3[_0xa72f('0x9')](/\\/g,'/');this[_0xa72f('0xa')]('value',_0xe8aa31);}},'rating':{'type':Sequelize[_0xa72f('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xa72f('0xb')],'set':function(_0x423bc7){this['setDataValue'](_0xa72f('0xc'),moment()[_0xa72f('0xd')](_0x423bc7,'ms'));this['setDataValue'](_0xa72f('0xe'),moment());this[_0xa72f('0xa')](_0xa72f('0xf'),_0x423bc7);}},'startedAt':{'type':Sequelize[_0xa72f('0x10')],'get':function(){return moment(this[_0xa72f('0x6')](_0xa72f('0xc')))[_0xa72f('0x11')](_0xa72f('0x12'))[_0xa72f('0x13')]();}},'closedAt':{'type':Sequelize[_0xa72f('0x10')],'get':function(){return moment(this[_0xa72f('0x6')](_0xa72f('0xe')))['format'](_0xa72f('0x12'))[_0xa72f('0x13')]();}},'createdAt':{'type':Sequelize[_0xa72f('0x10')],'get':function(){return moment(this['getDataValue'](_0xa72f('0x14')))['format'](_0xa72f('0x12'))[_0xa72f('0x13')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xa72f('0x6')](_0xa72f('0x15')))[_0xa72f('0x11')](_0xa72f('0x12'))['toString']();}}};
\ No newline at end of file
+var _0x556a=['getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','DATE','toString','createdAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL'];(function(_0x345f3b,_0x23b362){var _0x4bf4d9=function(_0x507fd0){while(--_0x507fd0){_0x345f3b['push'](_0x345f3b['shift']());}};_0x4bf4d9(++_0x23b362);}(_0x556a,0x1dd));var _0xa556=function(_0x1ca4cd,_0x4455ae){_0x1ca4cd=_0x1ca4cd-0x0;var _0x57761e=_0x556a[_0x1ca4cd];return _0x57761e;};'use strict';var Sequelize=require(_0xa556('0x0'));var moment=require(_0xa556('0x1'));var path=require(_0xa556('0x2'));var config=require(_0xa556('0x3'));module[_0xa556('0x4')]={'format':{'type':Sequelize[_0xa556('0x5')],'get':function(){return this[_0xa556('0x6')](_0xa556('0x7'))?path[_0xa556('0x8')](this['getDataValue'](_0xa556('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0xa556('0x9')]},'channel':{'type':Sequelize[_0xa556('0x9')]},'value':{'type':Sequelize[_0xa556('0x9')],'set':function(_0x358b8c){var _0x5a745c=_0x358b8c[_0xa556('0xa')](/\\/g,'/');this[_0xa556('0xb')](_0xa556('0x7'),_0x5a745c);}},'rating':{'type':Sequelize[_0xa556('0xc')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x44ea8e){this[_0xa556('0xb')](_0xa556('0xd'),moment()[_0xa556('0xe')](_0x44ea8e,'ms'));this[_0xa556('0xb')](_0xa556('0xf'),moment());this[_0xa556('0xb')](_0xa556('0x10'),_0x44ea8e);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xa556('0x6')]('startedAt'))[_0xa556('0x11')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'closedAt':{'type':Sequelize[_0xa556('0x12')],'get':function(){return moment(this[_0xa556('0x6')](_0xa556('0xf')))[_0xa556('0x11')]('MM-DD-YYYY\x20HH:mm')[_0xa556('0x13')]();}},'createdAt':{'type':Sequelize[_0xa556('0x12')],'get':function(){return moment(this[_0xa556('0x6')](_0xa556('0x14')))[_0xa556('0x11')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize[_0xa556('0x12')],'get':function(){return moment(this[_0xa556('0x6')]('updatedAt'))[_0xa556('0x11')]('MM-DD-YYYY\x20HH:mm')['toString']();}}};
\ No newline at end of file
index 4edcba0..38a9fb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98a8=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','duration','createdAt','closedAt','describe','download','../../components/encryptor','join','server/files/screen_recordings','value','%s.cypher','existsSync','decryptFile','secrets','recording','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x230938,_0x2434e3){var _0x3b5634=function(_0x411fb3){while(--_0x411fb3){_0x230938['push'](_0x230938['shift']());}};_0x3b5634(++_0x2434e3);}(_0x98a8,0x12c));var _0x898a=function(_0xc43b3b,_0x212ca3){_0xc43b3b=_0xc43b3b-0x0;var _0x511597=_0x98a8[_0xc43b3b];return _0x511597;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x1426e3,_0x5b7719){return function(_0x20bde0){if(!_0x20bde0){_0x1426e3['sendStatus'](0x194);}return _0x20bde0;};}function handleError(_0x513c6b,_0x53ddb2){_0x53ddb2=_0x53ddb2||0x1f4;return function(_0x3678be){logger[_0x898a('0x25')](_0x3678be[_0x898a('0x26')]);if(_0x3678be[_0x898a('0x27')]){delete _0x3678be[_0x898a('0x27')];}_0x513c6b[_0x898a('0x1a')](_0x53ddb2)[_0x898a('0x28')](_0x3678be);};}exports[_0x898a('0x29')]=function(_0xd31922,_0x58149d){var _0x4b3e68={},_0x47f1ed={},_0xe9c33d={'count':0x0,'rows':[]};var _0x62fe93=_[_0x898a('0x2a')](db[_0x898a('0x2b')][_0x898a('0x2c')],function(_0x560000){return{'name':_0x560000[_0x898a('0x2d')],'type':_0x560000[_0x898a('0x2e')][_0x898a('0x2f')]};});_0x47f1ed[_0x898a('0x30')]=_[_0x898a('0x31')](_[_0x898a('0x2a')](_0x62fe93,'name'),[_0x898a('0x32')]);_0x47f1ed[_0x898a('0x33')]=_[_0x898a('0x34')](_0xd31922[_0x898a('0x33')]);_0x47f1ed[_0x898a('0x35')]=_['intersection'](_0x47f1ed['model'],_0x47f1ed[_0x898a('0x33')]);_0x4b3e68[_0x898a('0x36')]=_[_0x898a('0x37')](_0x47f1ed['model'],qs[_0x898a('0x38')](_0xd31922[_0x898a('0x33')][_0x898a('0x38')]));_0x4b3e68[_0x898a('0x36')]=_0x4b3e68[_0x898a('0x36')][_0x898a('0x39')]?_0x4b3e68[_0x898a('0x36')]:_0x47f1ed[_0x898a('0x30')];if(!_0xd31922['query'][_0x898a('0x3a')]('nolimit')){_0x4b3e68['limit']=qs[_0x898a('0x3b')](_0xd31922['query'][_0x898a('0x3b')]);_0x4b3e68['offset']=qs[_0x898a('0x1e')](_0xd31922['query'][_0x898a('0x1e')]);}_0x4b3e68[_0x898a('0x3c')]=qs[_0x898a('0x3d')](_0xd31922['query']['sort']);_0x4b3e68['where']=qs[_0x898a('0x35')](_[_0x898a('0x3e')](_0xd31922['query'],_0x47f1ed[_0x898a('0x35')]),_0x62fe93);if(_0xd31922[_0x898a('0x33')][_0x898a('0x3f')]){_0x4b3e68[_0x898a('0x40')]=_['merge'](_0x4b3e68['where'],{'$or':_[_0x898a('0x2a')](_0x62fe93,function(_0x454c8c){if(_0x454c8c['type']!=='VIRTUAL'){var _0x168f92={};_0x168f92[_0x454c8c[_0x898a('0x27')]]={'$like':'%'+_0xd31922[_0x898a('0x33')][_0x898a('0x3f')]+'%'};return _0x168f92;}})});}_0x4b3e68=_['merge']({},_0x4b3e68,_0xd31922[_0x898a('0x41')]);var _0x369c02={'where':_0x4b3e68['where']};return db['ScreenRecording']['count'](_0x369c02)[_0x898a('0x23')](function(_0x477a9d){_0xe9c33d[_0x898a('0x1d')]=_0x477a9d;if(_0xd31922[_0x898a('0x33')][_0x898a('0x42')]){_0x4b3e68[_0x898a('0x43')]=[{'all':!![]}];}return db[_0x898a('0x2b')][_0x898a('0x44')](_0x4b3e68);})[_0x898a('0x23')](function(_0x235fcf){_0xe9c33d[_0x898a('0x45')]=_0x235fcf;return _0xe9c33d;})[_0x898a('0x23')](respondWithFilteredResult(_0x58149d,_0x4b3e68))[_0x898a('0x46')](handleError(_0x58149d,null));};exports[_0x898a('0x47')]=function(_0x21f307,_0x4c8628){var _0x26ad34={'raw':![],'where':{'id':_0x21f307[_0x898a('0x48')]['id']}},_0x11c437={};_0x11c437['model']=_[_0x898a('0x34')](db[_0x898a('0x2b')][_0x898a('0x2c')]);_0x11c437[_0x898a('0x33')]=_[_0x898a('0x34')](_0x21f307[_0x898a('0x33')]);_0x11c437[_0x898a('0x35')]=_[_0x898a('0x37')](_0x11c437['model'],_0x11c437[_0x898a('0x33')]);_0x26ad34[_0x898a('0x36')]=_[_0x898a('0x37')](_0x11c437[_0x898a('0x30')],qs['fields'](_0x21f307[_0x898a('0x33')][_0x898a('0x38')]));_0x26ad34['attributes']=_0x26ad34[_0x898a('0x36')]['length']?_0x26ad34[_0x898a('0x36')]:_0x11c437['model'];if(_0x21f307['query'][_0x898a('0x42')]){_0x26ad34['include']=[{'all':!![]}];}_0x26ad34=_[_0x898a('0x49')]({},_0x26ad34,_0x21f307[_0x898a('0x41')]);return db['ScreenRecording'][_0x898a('0x4a')](_0x26ad34)[_0x898a('0x23')](handleEntityNotFound(_0x4c8628,null))['then'](respondWithResult(_0x4c8628,null))[_0x898a('0x46')](handleError(_0x4c8628,null));};exports[_0x898a('0x4b')]=function(_0x11a0a3,_0x118240){return db['ScreenRecording'][_0x898a('0x4b')](_0x11a0a3[_0x898a('0x4c')],{})['then'](respondWithResult(_0x118240,0xc9))[_0x898a('0x46')](handleError(_0x118240,null));};exports[_0x898a('0x22')]=function(_0x4ab441,_0x28525b){if(_0x4ab441['body']['id']){delete _0x4ab441[_0x898a('0x4c')]['id'];}delete _0x4ab441[_0x898a('0x4c')][_0x898a('0x4d')];delete _0x4ab441['body'][_0x898a('0x4e')];delete _0x4ab441[_0x898a('0x4c')][_0x898a('0x4f')];delete _0x4ab441[_0x898a('0x4c')]['value'];return db[_0x898a('0x2b')]['find']({'where':{'id':_0x4ab441[_0x898a('0x48')]['id']}})[_0x898a('0x23')](handleEntityNotFound(_0x28525b,null))[_0x898a('0x23')](saveUpdates(_0x4ab441['body'],null))[_0x898a('0x23')](respondWithResult(_0x28525b,null))[_0x898a('0x46')](handleError(_0x28525b,null));};exports[_0x898a('0x50')]=function(_0x5d325a,_0x52f8c6){return db[_0x898a('0x2b')][_0x898a('0x50')]()[_0x898a('0x23')](respondWithResult(_0x52f8c6,null))[_0x898a('0x46')](handleError(_0x52f8c6,null));};exports[_0x898a('0x51')]=function(_0x36b63a,_0x369f33,_0x6c0f07){var _0x289167=require(_0x898a('0x52'));var _0x2382a9=![];var _0x5e9329={};if(_0x36b63a[_0x898a('0x33')][_0x898a('0x2e')]&&_0x36b63a['query'][_0x898a('0x2e')]==='uniqueid'){_0x5e9329['uniqueid']=_0x36b63a[_0x898a('0x48')]['id'];}else{_0x5e9329['id']=_0x36b63a[_0x898a('0x48')]['id'];}return db[_0x898a('0x2b')]['find']({'where':_0x5e9329,'attributes':['id','value'],'raw':!![]})[_0x898a('0x23')](handleEntityNotFound(_0x369f33,null))[_0x898a('0x23')](function(_0x515725){if(_0x515725){var _0xaa96f7=path[_0x898a('0x53')](config['root'],_0x898a('0x54'),_0x515725[_0x898a('0x55')]);var _0x3122cc=util['format'](_0x898a('0x56'),_0xaa96f7);if(fs[_0x898a('0x57')](_0x3122cc)){_0x2382a9=!![];return _0x289167[_0x898a('0x58')](_0x3122cc,_0xaa96f7,config[_0x898a('0x59')][_0x898a('0x5a')])[_0x898a('0x23')](function(){return _0x515725;});}return _0x515725;}})['then'](function(_0x22a08a){if(_0x22a08a){var _0x4df5f0=path[_0x898a('0x53')](config[_0x898a('0x5b')],_0x898a('0x54'),_0x22a08a[_0x898a('0x55')]);if(!fs[_0x898a('0x57')](_0x4df5f0)){throw new db[(_0x898a('0x5c'))][(_0x898a('0x5d'))](_0x898a('0x5e'));}if(_0x22a08a[_0x898a('0x5f')]){return _0x369f33['download'](_0x4df5f0,_0x22a08a[_0x898a('0x5f')]+path[_0x898a('0x60')](_0x4df5f0),function(){if(_0x2382a9){fs[_0x898a('0x61')](_0x4df5f0);}});}else{return _0x369f33[_0x898a('0x51')](_0x4df5f0,function(_0x219976){if(_0x2382a9){fs[_0x898a('0x61')](_0x4df5f0);}});}}})[_0x898a('0x46')](function(_0x68fd81){if(_0x68fd81[_0x898a('0x62')]===_0x898a('0x5e')){_0x369f33[_0x898a('0x1a')](0x194)[_0x898a('0x28')](_0x898a('0x63'));}else{return handleError(_0x369f33,null);}});};exports[_0x898a('0x24')]=function(_0x22f9ba,_0x5f42ae){return db[_0x898a('0x2b')][_0x898a('0x4a')]({'where':{'id':_0x22f9ba['params']['id']}})[_0x898a('0x23')](function(_0x4583a1){if(_['isNil'](_0x4583a1)){throw new ReferenceError(_0x898a('0x64'));}return _0x4583a1;})[_0x898a('0x23')](function(_0x21f0f8){var _0x1f3f5b=path['join'](config[_0x898a('0x5b')],_0x898a('0x54'),_0x21f0f8[_0x898a('0x55')]);logger[_0x898a('0x65')]('cancellazione\x20fisica\x20documento\x20%s',_0x1f3f5b);if(!_[_0x898a('0x66')](_0x21f0f8[_0x898a('0x55')])&&fs['existsSync'](_0x1f3f5b)){logger[_0x898a('0x65')](_0x898a('0x67')+_0x1f3f5b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x898a('0x68')](_0x1f3f5b);}_0x1f3f5b=_0x1f3f5b+'.cypher';if(!_[_0x898a('0x66')](_0x21f0f8['value'])&&fs['existsSync'](_0x1f3f5b)){logger['info'](_0x898a('0x67')+_0x1f3f5b+_0x898a('0x69'));fs[_0x898a('0x68')](_0x1f3f5b);}return _0x21f0f8;})[_0x898a('0x23')](function(_0x5e0535){if(!_0x5e0535)throw new InternalError();return _0x5e0535['destroy']();})[_0x898a('0x23')](function(){_0x5f42ae[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();})[_0x898a('0x46')](handleError(_0x5f42ae,null));};
\ No newline at end of file
+var _0x7217=['path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','ScreenRecording','fieldName','type','model','differenceBy','format','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','includeAll','rows','catch','params','rawAttributes','intersection','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','decryptFile','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','existsSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x12b1a6,_0x22df2d){var _0x5813d3=function(_0x57773e){while(--_0x57773e){_0x12b1a6['push'](_0x12b1a6['shift']());}};_0x5813d3(++_0x22df2d);}(_0x7217,0x19e));var _0x7721=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x7217[_0x45e98e];return _0x374dba;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x34')](_[_0x7721('0x2f')](_0x5c54f0,'name'),[_0x7721('0x35')]);_0xd7d703[_0x7721('0x36')]=_[_0x7721('0x37')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x38')]=_['intersection'](_0xd7d703[_0x7721('0x33')],_0xd7d703[_0x7721('0x36')]);_0x37b9f0[_0x7721('0x39')]=_['intersection'](_0xd7d703[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x158d98['query'][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')][_0x7721('0x3b')]?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3c')](_0x7721('0x3d'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0['offset']=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x3f')](_0x158d98[_0x7721('0x36')][_0x7721('0x3f')]);_0x37b9f0[_0x7721('0x40')]=qs['filters'](_['pick'](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98[_0x7721('0x36')][_0x7721('0x41')]){_0x37b9f0[_0x7721('0x40')]=_[_0x7721('0x42')](_0x37b9f0['where'],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4cf659){if(_0x4cf659[_0x7721('0x32')]!==_0x7721('0x43')){var _0x5a278e={};_0x5a278e[_0x4cf659[_0x7721('0x44')]]={'$like':'%'+_0x158d98[_0x7721('0x36')]['filter']+'%'};return _0x5a278e;}})});}_0x37b9f0=_['merge']({},_0x37b9f0,_0x158d98[_0x7721('0x45')]);var _0xfc4dc4={'where':_0x37b9f0[_0x7721('0x40')]};return db[_0x7721('0x30')]['count'](_0xfc4dc4)[_0x7721('0x29')](function(_0x120de9){_0x1da2d8[_0x7721('0x22')]=_0x120de9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x46')]){_0x37b9f0['include']=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a5b59){_0x1da2d8[_0x7721('0x47')]=_0x4a5b59;return _0x1da2d8;})[_0x7721('0x29')](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x48')](handleError(_0x1ea4d,null));};exports['show']=function(_0x1453d4,_0x11d853){var _0x1ad315={'raw':![],'where':{'id':_0x1453d4[_0x7721('0x49')]['id']}},_0x481fa8={};_0x481fa8[_0x7721('0x33')]=_[_0x7721('0x37')](db[_0x7721('0x30')][_0x7721('0x4a')]);_0x481fa8[_0x7721('0x36')]=_[_0x7721('0x37')](_0x1453d4['query']);_0x481fa8['filters']=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],_0x481fa8[_0x7721('0x36')]);_0x1ad315[_0x7721('0x39')]=_[_0x7721('0x4b')](_0x481fa8[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x1453d4[_0x7721('0x36')][_0x7721('0x3a')]));_0x1ad315[_0x7721('0x39')]=_0x1ad315['attributes']['length']?_0x1ad315[_0x7721('0x39')]:_0x481fa8[_0x7721('0x33')];if(_0x1453d4[_0x7721('0x36')][_0x7721('0x46')]){_0x1ad315['include']=[{'all':!![]}];}_0x1ad315=_[_0x7721('0x42')]({},_0x1ad315,_0x1453d4[_0x7721('0x45')]);return db['ScreenRecording'][_0x7721('0x4c')](_0x1ad315)['then'](handleEntityNotFound(_0x11d853,null))[_0x7721('0x29')](respondWithResult(_0x11d853,null))['catch'](handleError(_0x11d853,null));};exports[_0x7721('0x4d')]=function(_0x196be4,_0xf17c40){return db['ScreenRecording'][_0x7721('0x4d')](_0x196be4[_0x7721('0x4e')],{})['then'](respondWithResult(_0xf17c40,0xc9))[_0x7721('0x48')](handleError(_0xf17c40,null));};exports[_0x7721('0x28')]=function(_0xf88e8c,_0x5c4078){if(_0xf88e8c[_0x7721('0x4e')]['id']){delete _0xf88e8c['body']['id'];}delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x4f')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x50')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x51')];delete _0xf88e8c[_0x7721('0x4e')][_0x7721('0x52')];return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0xf88e8c[_0x7721('0x49')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x5c4078,null))[_0x7721('0x29')](saveUpdates(_0xf88e8c[_0x7721('0x4e')],null))[_0x7721('0x29')](respondWithResult(_0x5c4078,null))['catch'](handleError(_0x5c4078,null));};exports[_0x7721('0x53')]=function(_0x2f6f30,_0x8e1214){return db[_0x7721('0x30')][_0x7721('0x53')]()[_0x7721('0x29')](respondWithResult(_0x8e1214,null))[_0x7721('0x48')](handleError(_0x8e1214,null));};exports['download']=function(_0x234bee,_0x17036e,_0x134908){var _0x3b7382=require(_0x7721('0x54'));var _0x9c0d4=![];var _0x7fbd6c={};if(_0x234bee[_0x7721('0x36')][_0x7721('0x32')]&&_0x234bee[_0x7721('0x36')][_0x7721('0x32')]==='uniqueid'){_0x7fbd6c[_0x7721('0x55')]=_0x234bee[_0x7721('0x49')]['id'];}else{_0x7fbd6c['id']=_0x234bee[_0x7721('0x49')]['id'];}return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':_0x7fbd6c,'attributes':['id',_0x7721('0x52')],'raw':!![]})[_0x7721('0x29')](handleEntityNotFound(_0x17036e,null))[_0x7721('0x29')](function(_0x360882){if(_0x360882){var _0x287452=path[_0x7721('0x56')](config[_0x7721('0x57')],_0x7721('0x58'),_0x360882[_0x7721('0x52')]);var _0x300ea4=util['format']('%s.cypher',_0x287452);if(fs['existsSync'](_0x300ea4)){_0x9c0d4=!![];return _0x3b7382[_0x7721('0x59')](_0x300ea4,_0x287452,config['secrets']['recording'])['then'](function(){return _0x360882;});}return _0x360882;}})['then'](function(_0x47925a){if(_0x47925a){var _0x219181=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x47925a['value']);if(!fs['existsSync'](_0x219181)){throw new db['Sequelize'][(_0x7721('0x5a'))]('ScreenRecording\x20not\x20found');}if(_0x47925a['filename']){return _0x17036e['download'](_0x219181,_0x47925a[_0x7721('0x5b')]+path[_0x7721('0x5c')](_0x219181),function(){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}else{return _0x17036e['download'](_0x219181,function(_0x2a025c){if(_0x9c0d4){fs[_0x7721('0x5d')](_0x219181);}});}}})[_0x7721('0x48')](function(_0x168343){if(_0x168343[_0x7721('0x5e')]===_0x7721('0x5f')){_0x17036e[_0x7721('0x1c')](0x194)[_0x7721('0x2d')](_0x7721('0x60'));}else{return handleError(_0x17036e,null);}});};exports[_0x7721('0x2a')]=function(_0x3b03cf,_0x10666e){return db[_0x7721('0x30')][_0x7721('0x4c')]({'where':{'id':_0x3b03cf[_0x7721('0x49')]['id']}})['then'](function(_0x233e5d){if(_[_0x7721('0x61')](_0x233e5d)){throw new ReferenceError(_0x7721('0x62'));}return _0x233e5d;})[_0x7721('0x29')](function(_0x542e30){var _0x103009=path[_0x7721('0x56')](config['root'],_0x7721('0x58'),_0x542e30['value']);logger[_0x7721('0x63')](_0x7721('0x64'),_0x103009);if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}_0x103009=_0x103009+'.cypher';if(!_[_0x7721('0x61')](_0x542e30[_0x7721('0x52')])&&fs[_0x7721('0x65')](_0x103009)){logger[_0x7721('0x63')](_0x7721('0x66')+_0x103009+_0x7721('0x67'));fs[_0x7721('0x68')](_0x103009);}return _0x542e30;})['then'](function(_0xb6f2f2){if(!_0xb6f2f2)throw new InternalError();return _0xb6f2f2[_0x7721('0x2a')]();})['then'](function(){_0x10666e[_0x7721('0x1c')](0xcc)['end']();})[_0x7721('0x48')](handleError(_0x10666e,null));};
\ No newline at end of file
index 8c5df51..d7e1fa6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce4c=['ScreenRecording','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./screenRecording.attributes','exports','define'];(function(_0x314112,_0x31e304){var _0x3b721f=function(_0x3cc3e7){while(--_0x3cc3e7){_0x314112['push'](_0x314112['shift']());}};_0x3b721f(++_0x31e304);}(_0xce4c,0x18a));var _0xcce4=function(_0x539a39,_0x480887){_0x539a39=_0x539a39-0x0;var _0x2b2b5e=_0xce4c[_0x539a39];return _0x2b2b5e;};'use strict';var _=require(_0xcce4('0x0'));var util=require(_0xcce4('0x1'));var logger=require(_0xcce4('0x2'))(_0xcce4('0x3'));var moment=require(_0xcce4('0x4'));var BPromise=require(_0xcce4('0x5'));var rp=require(_0xcce4('0x6'));var fs=require('fs');var path=require(_0xcce4('0x7'));var rimraf=require('rimraf');var config=require(_0xcce4('0x8'));var attributes=require(_0xcce4('0x9'));module[_0xcce4('0xa')]=function(_0xa48d59,_0x991d6d){return _0xa48d59[_0xcce4('0xb')](_0xcce4('0xc'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xcce4('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x41cf=['exports','ScreenRecording','screen_recordings','interactionid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes'];(function(_0x2c8641,_0x10d1d5){var _0x55bc03=function(_0x3af66b){while(--_0x3af66b){_0x2c8641['push'](_0x2c8641['shift']());}};_0x55bc03(++_0x10d1d5);}(_0x41cf,0x154));var _0xf41c=function(_0x28509b,_0x5831ff){_0x28509b=_0x28509b-0x0;var _0x1e0b6=_0x41cf[_0x28509b];return _0x1e0b6;};'use strict';var _=require(_0xf41c('0x0'));var util=require(_0xf41c('0x1'));var logger=require('../../config/logger')(_0xf41c('0x2'));var moment=require(_0xf41c('0x3'));var BPromise=require(_0xf41c('0x4'));var rp=require(_0xf41c('0x5'));var fs=require('fs');var path=require(_0xf41c('0x6'));var rimraf=require(_0xf41c('0x7'));var config=require(_0xf41c('0x8'));var attributes=require(_0xf41c('0x9'));module[_0xf41c('0xa')]=function(_0x9922e5,_0x1e2874){return _0x9922e5['define'](_0xf41c('0xb'),attributes,{'tableName':_0xf41c('0xc'),'paranoid':![],'indexes':[{'name':_0xf41c('0xd'),'fields':[_0xf41c('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 5d9575c..2a21569 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3369=['ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ScreenRecording,\x20%s,\x20%s','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info','request\x20sent'];(function(_0x2fac29,_0x5d19d8){var _0x1d0c35=function(_0x283063){while(--_0x283063){_0x2fac29['push'](_0x2fac29['shift']());}};_0x1d0c35(++_0x5d19d8);}(_0x3369,0xda));var _0x9336=function(_0x4236dd,_0x5832de){_0x4236dd=_0x4236dd-0x0;var _0x5a1171=_0x3369[_0x4236dd];return _0x5a1171;};'use strict';var _=require(_0x9336('0x0'));var util=require('util');var moment=require(_0x9336('0x1'));var BPromise=require('bluebird');var rs=require(_0x9336('0x2'));var fs=require('fs');var Redis=require(_0x9336('0x3'));var db=require(_0x9336('0x4'))['db'];var utils=require(_0x9336('0x5'));var logger=require(_0x9336('0x6'))(_0x9336('0x7'));var config=require(_0x9336('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9336('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1027cf,_0x19dce8,_0x5f55de){return new BPromise(function(_0x2fd49b,_0x526654){return client[_0x9336('0xa')](_0x1027cf,_0x5f55de)['then'](function(_0x533212){logger[_0x9336('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x19dce8,_0x9336('0xc'));logger['debug'](_0x9336('0xd'),_0x19dce8,'request\x20sent',JSON[_0x9336('0xe')](_0x533212));if(_0x533212['error']){if(_0x533212[_0x9336('0xf')][_0x9336('0x10')]===0x1f4){logger[_0x9336('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x19dce8,_0x533212[_0x9336('0xf')][_0x9336('0x11')]);return _0x526654(_0x533212[_0x9336('0xf')][_0x9336('0x11')]);}logger['error']('ScreenRecording,\x20%s,\x20%s',_0x19dce8,_0x533212[_0x9336('0xf')][_0x9336('0x11')]);return _0x2fd49b(_0x533212[_0x9336('0xf')][_0x9336('0x11')]);}else{logger[_0x9336('0xb')](_0x9336('0x12'),_0x19dce8,_0x9336('0xc'));_0x2fd49b(_0x533212[_0x9336('0x13')][_0x9336('0x11')]);}})[_0x9336('0x14')](function(_0x58d99a){logger[_0x9336('0xf')](_0x9336('0x12'),_0x19dce8,_0x58d99a);_0x526654(_0x58d99a);});});}
\ No newline at end of file
+var _0x0e10=['debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent'];(function(_0x143623,_0x200aa8){var _0x3f3eb2=function(_0x5c3650){while(--_0x5c3650){_0x143623['push'](_0x143623['shift']());}};_0x3f3eb2(++_0x200aa8);}(_0x0e10,0x110));var _0x00e1=function(_0x4be4db,_0x101209){_0x4be4db=_0x4be4db-0x0;var _0x5604f4=_0x0e10[_0x4be4db];return _0x5604f4;};'use strict';var _=require('lodash');var util=require(_0x00e1('0x0'));var moment=require(_0x00e1('0x1'));var BPromise=require('bluebird');var rs=require(_0x00e1('0x2'));var fs=require('fs');var Redis=require(_0x00e1('0x3'));var db=require(_0x00e1('0x4'))['db'];var utils=require(_0x00e1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x00e1('0x6'));var jayson=require(_0x00e1('0x7'));var client=jayson['client'][_0x00e1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x380c5f,_0x53f0bf,_0xa75ccb){return new BPromise(function(_0x42c1ff,_0x402d41){return client[_0x00e1('0x9')](_0x380c5f,_0xa75ccb)[_0x00e1('0xa')](function(_0x2bef60){logger[_0x00e1('0xb')](_0x00e1('0xc'),_0x53f0bf,_0x00e1('0xd'));logger[_0x00e1('0xe')](_0x00e1('0xf'),_0x53f0bf,_0x00e1('0xd'),JSON[_0x00e1('0x10')](_0x2bef60));if(_0x2bef60['error']){if(_0x2bef60[_0x00e1('0x11')][_0x00e1('0x12')]===0x1f4){logger[_0x00e1('0x11')](_0x00e1('0xc'),_0x53f0bf,_0x2bef60['error']['message']);return _0x402d41(_0x2bef60[_0x00e1('0x11')][_0x00e1('0x13')]);}logger[_0x00e1('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x53f0bf,_0x2bef60['error'][_0x00e1('0x13')]);return _0x42c1ff(_0x2bef60[_0x00e1('0x11')][_0x00e1('0x13')]);}else{logger['info'](_0x00e1('0xc'),_0x53f0bf,'request\x20sent');_0x42c1ff(_0x2bef60[_0x00e1('0x14')][_0x00e1('0x13')]);}})[_0x00e1('0x15')](function(_0x19e257){logger[_0x00e1('0x11')](_0x00e1('0xc'),_0x53f0bf,_0x19e257);_0x402d41(_0x19e257);});});}
\ No newline at end of file
index bc6621e..4853202 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5520=['index','/now','getDate','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','getPreferred','/:id/favicon','diskStorage','join','root','server/files/images/logos/','format','logo','extname','originalname','single','file','addLogo','logologin','post','addLogoLogin','preferred','/:id/preferred','addPreferred','favicon','addFavicon','put','/:id','update','multer','util','express','Router','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated'];(function(_0x4c751e,_0x3a8dc6){var _0x12aa36=function(_0x4e811f){while(--_0x4e811f){_0x4c751e['push'](_0x4c751e['shift']());}};_0x12aa36(++_0x3a8dc6);}(_0x5520,0x72));var _0x0552=function(_0x2ee53b,_0x10e949){_0x2ee53b=_0x2ee53b-0x0;var _0x34bd72=_0x5520[_0x2ee53b];return _0x34bd72;};'use strict';var multer=require(_0x0552('0x0'));var util=require(_0x0552('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0552('0x2'));var router=express[_0x0552('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0552('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0552('0x5'));var controller=require(_0x0552('0x6'));router[_0x0552('0x7')]('/',auth[_0x0552('0x8')](),controller[_0x0552('0x9')]);router[_0x0552('0x7')](_0x0552('0xa'),controller[_0x0552('0xb')]);router[_0x0552('0x7')]('/:id',controller['show']);router[_0x0552('0x7')](_0x0552('0xc'),controller[_0x0552('0xd')]);router['get'](_0x0552('0xe'),controller[_0x0552('0xf')]);router['get'](_0x0552('0x10'),controller['gdpr']);router[_0x0552('0x7')]('/:id/preferred',controller[_0x0552('0x11')]);router[_0x0552('0x7')](_0x0552('0x12'),controller['getFavicon']);var upload=multer({'storage':multer[_0x0552('0x13')]({'destination':function(_0x41ccfb,_0x1f9e7e,_0x25b356){_0x25b356(null,path[_0x0552('0x14')](config[_0x0552('0x15')],_0x0552('0x16')));},'filename':function(_0x245d01,_0x2e9336,_0x1bf2ac){_0x1bf2ac(null,util[_0x0552('0x17')]('%s%s',_0x0552('0x18'),path[_0x0552('0x19')](_0x2e9336[_0x0552('0x1a')])));}})});router['post'](_0x0552('0xc'),upload[_0x0552('0x1b')](_0x0552('0x1c')),controller[_0x0552('0x1d')]);var upload=multer({'storage':multer[_0x0552('0x13')]({'destination':function(_0x463ecc,_0x1c7ed8,_0x57bf6c){_0x57bf6c(null,path[_0x0552('0x14')](config[_0x0552('0x15')],'server/files/images/logos/'));},'filename':function(_0x5681ca,_0x581ec8,_0x35d67b){_0x35d67b(null,util[_0x0552('0x17')]('%s%s',_0x0552('0x1e'),path[_0x0552('0x19')](_0x581ec8[_0x0552('0x1a')])));}})});router[_0x0552('0x1f')]('/:id/logo_login',upload['single']('file'),controller[_0x0552('0x20')]);var upload=multer({'storage':multer[_0x0552('0x13')]({'destination':function(_0x5ba4f0,_0x27f774,_0x232ca2){_0x232ca2(null,path[_0x0552('0x14')](config[_0x0552('0x15')],_0x0552('0x16')));},'filename':function(_0x28df50,_0xf70933,_0x3c86be){_0x3c86be(null,util[_0x0552('0x17')]('%s%s',_0x0552('0x21'),path['extname'](_0xf70933['originalname'])));}})});router[_0x0552('0x1f')](_0x0552('0x22'),upload['single']('file'),controller[_0x0552('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x30f526,_0x37fcc4,_0xadec8c){_0xadec8c(null,path[_0x0552('0x14')](config[_0x0552('0x15')],_0x0552('0x16')));},'filename':function(_0x31244a,_0x20e3c4,_0x2644ee){_0x2644ee(null,util['format']('%s%s',_0x0552('0x24'),path[_0x0552('0x19')](_0x20e3c4[_0x0552('0x1a')])));}})});router[_0x0552('0x1f')](_0x0552('0x12'),upload[_0x0552('0x1b')]('file'),controller[_0x0552('0x25')]);router[_0x0552('0x26')](_0x0552('0x27'),auth[_0x0552('0x8')](),controller[_0x0552('0x28')]);module['exports']=router;
\ No newline at end of file
+var _0x5f09=['getDate','/:id','show','/:id/logo_login','gdpr','/:id/preferred','root','server/files/images/logos/','format','%s%s','logo','originalname','post','/:id/logo','single','file','addLogo','join','logologin','extname','addLogoLogin','diskStorage','preferred','addPreferred','favicon','/:id/favicon','addFavicon','put','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now'];(function(_0xb36843,_0x57c1f4){var _0x227b83=function(_0x3bce6f){while(--_0x3bce6f){_0xb36843['push'](_0xb36843['shift']());}};_0x227b83(++_0x57c1f4);}(_0x5f09,0x1a1));var _0x95f0=function(_0x3957d2,_0x4218e2){_0x3957d2=_0x3957d2-0x0;var _0x3a598c=_0x5f09[_0x3957d2];return _0x3a598c;};'use strict';var multer=require(_0x95f0('0x0'));var util=require(_0x95f0('0x1'));var path=require(_0x95f0('0x2'));var timeout=require('connect-timeout');var express=require(_0x95f0('0x3'));var router=express[_0x95f0('0x4')]();var fs_extra=require(_0x95f0('0x5'));var auth=require(_0x95f0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x95f0('0x7'));var controller=require(_0x95f0('0x8'));router[_0x95f0('0x9')]('/',auth[_0x95f0('0xa')](),controller[_0x95f0('0xb')]);router[_0x95f0('0x9')](_0x95f0('0xc'),controller[_0x95f0('0xd')]);router[_0x95f0('0x9')](_0x95f0('0xe'),controller[_0x95f0('0xf')]);router[_0x95f0('0x9')]('/:id/logo',controller['getLogo']);router[_0x95f0('0x9')](_0x95f0('0x10'),controller['getLogoLogin']);router[_0x95f0('0x9')]('/:id/gdpr',controller[_0x95f0('0x11')]);router[_0x95f0('0x9')](_0x95f0('0x12'),controller['getPreferred']);router[_0x95f0('0x9')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x31d47f,_0x2e0639,_0x3a7232){_0x3a7232(null,path['join'](config[_0x95f0('0x13')],_0x95f0('0x14')));},'filename':function(_0x6e94a9,_0x49f14e,_0x388b61){_0x388b61(null,util[_0x95f0('0x15')](_0x95f0('0x16'),_0x95f0('0x17'),path['extname'](_0x49f14e[_0x95f0('0x18')])));}})});router[_0x95f0('0x19')](_0x95f0('0x1a'),upload[_0x95f0('0x1b')](_0x95f0('0x1c')),controller[_0x95f0('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1eedf8,_0x4ce67c,_0x396650){_0x396650(null,path[_0x95f0('0x1e')](config[_0x95f0('0x13')],_0x95f0('0x14')));},'filename':function(_0x1695b5,_0x15a79f,_0x2c4144){_0x2c4144(null,util[_0x95f0('0x15')](_0x95f0('0x16'),_0x95f0('0x1f'),path[_0x95f0('0x20')](_0x15a79f[_0x95f0('0x18')])));}})});router[_0x95f0('0x19')](_0x95f0('0x10'),upload[_0x95f0('0x1b')](_0x95f0('0x1c')),controller[_0x95f0('0x21')]);var upload=multer({'storage':multer[_0x95f0('0x22')]({'destination':function(_0x587738,_0xa8422a,_0x5c6698){_0x5c6698(null,path[_0x95f0('0x1e')](config[_0x95f0('0x13')],_0x95f0('0x14')));},'filename':function(_0x1cc289,_0x47323b,_0x59e2c){_0x59e2c(null,util[_0x95f0('0x15')]('%s%s',_0x95f0('0x23'),path['extname'](_0x47323b['originalname'])));}})});router[_0x95f0('0x19')](_0x95f0('0x12'),upload['single'](_0x95f0('0x1c')),controller[_0x95f0('0x24')]);var upload=multer({'storage':multer[_0x95f0('0x22')]({'destination':function(_0x45b74b,_0x2662a9,_0x3b8360){_0x3b8360(null,path[_0x95f0('0x1e')](config['root'],_0x95f0('0x14')));},'filename':function(_0x134ac7,_0x3e9bbc,_0x34ba2c){_0x34ba2c(null,util['format']('%s%s',_0x95f0('0x25'),path[_0x95f0('0x20')](_0x3e9bbc['originalname'])));}})});router[_0x95f0('0x19')](_0x95f0('0x26'),upload[_0x95f0('0x1b')](_0x95f0('0x1c')),controller[_0x95f0('0x27')]);router[_0x95f0('0x28')](_0x95f0('0xe'),auth[_0x95f0('0xa')](),controller[_0x95f0('0x29')]);module[_0x95f0('0x2a')]=router;
\ No newline at end of file
index b36d7d3..fdacbb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x3c8b7a,_0x415f5f){var _0x10f507=function(_0x1d8a04){while(--_0x1d8a04){_0x3c8b7a['push'](_0x3c8b7a['shift']());}};_0x10f507(++_0x415f5f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}};
\ No newline at end of file
+var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x29725f,_0x12007b){var _0x70624d=function(_0x32bc80){while(--_0x32bc80){_0x29725f['push'](_0x29725f['shift']());}};_0x70624d(++_0x12007b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}};
\ No newline at end of file
index 1daa557..fb1b0c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cd8=['fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','include','find','body','params','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','default','upperFirst','custom','join','default_logo.svg','Sequelize','\x20not\x20found','../../config/license/util','getLogoLogin','ValidationError','download','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x17c225,_0x5a05e){var _0x4da60b=function(_0x37c623){while(--_0x37c623){_0x17c225['push'](_0x17c225['shift']());}};_0x4da60b(++_0x5a05e);}(_0x0cd8,0x170));var _0x80cd=function(_0xffdf9e,_0x58a4aa){_0xffdf9e=_0xffdf9e-0x0;var _0x4f357a=_0x0cd8[_0xffdf9e];return _0x4f357a;};'use strict';var emlformat=require(_0x80cd('0x0'));var rimraf=require(_0x80cd('0x1'));var zipdir=require(_0x80cd('0x2'));var jsonpatch=require(_0x80cd('0x3'));var rp=require(_0x80cd('0x4'));var moment=require(_0x80cd('0x5'));var BPromise=require(_0x80cd('0x6'));var Mustache=require(_0x80cd('0x7'));var util=require(_0x80cd('0x8'));var path=require(_0x80cd('0x9'));var sox=require(_0x80cd('0xa'));var csv=require(_0x80cd('0xb'));var ejs=require(_0x80cd('0xc'));var fs=require('fs');var fs_extra=require(_0x80cd('0xd'));var _=require(_0x80cd('0xe'));var squel=require(_0x80cd('0xf'));var crypto=require('crypto');var jsforce=require(_0x80cd('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x80cd('0x11'));var Papa=require(_0x80cd('0x12'));var Redis=require(_0x80cd('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x80cd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x80cd('0x15'))(_0x80cd('0x16'));var utils=require(_0x80cd('0x17'));var config=require(_0x80cd('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x80cd('0x19'));var client=jayson[_0x80cd('0x1a')][_0x80cd('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3ae0bb,_0x597f1c,_0x54d27a,_0x50ef60){return new BPromise(function(_0x2b388b,_0x3634c8){var _0x4470ab=_0x50ef60||client;return _0x4470ab[_0x80cd('0x1c')](_0x3ae0bb,_0x54d27a)[_0x80cd('0x1d')](function(_0x31276b){logger[_0x80cd('0x1e')](_0x80cd('0x1f'),_0x597f1c,_0x80cd('0x20'));logger[_0x80cd('0x21')]('Setting,\x20%s,\x20%s,\x20%s',_0x597f1c,_0x80cd('0x20'),JSON[_0x80cd('0x22')](_0x31276b));if(_0x31276b[_0x80cd('0x23')]){if(_0x31276b[_0x80cd('0x23')][_0x80cd('0x24')]===0x1f4){logger[_0x80cd('0x23')](_0x80cd('0x1f'),_0x597f1c,_0x31276b[_0x80cd('0x23')][_0x80cd('0x25')]);return _0x3634c8(_0x31276b[_0x80cd('0x23')][_0x80cd('0x25')]);}logger[_0x80cd('0x23')](_0x80cd('0x1f'),_0x597f1c,_0x31276b[_0x80cd('0x23')][_0x80cd('0x25')]);return _0x2b388b(_0x31276b[_0x80cd('0x23')][_0x80cd('0x25')]);}else{logger[_0x80cd('0x1e')](_0x80cd('0x1f'),_0x597f1c,'request\x20sent');_0x2b388b(_0x31276b[_0x80cd('0x26')]['message']);}})[_0x80cd('0x27')](function(_0xb63951){logger[_0x80cd('0x23')]('Setting,\x20%s,\x20%s',_0x597f1c,_0xb63951);_0x3634c8(_0xb63951);});});}function respondWithStatusCode(_0x64361f,_0x104e20){_0x104e20=_0x104e20||0xcc;return function(_0xd5056b){if(_0xd5056b){return _0x64361f[_0x80cd('0x28')](_0x104e20);}return _0x64361f[_0x80cd('0x29')](_0x104e20)['end']();};}function respondWithResult(_0x177f88,_0x5de9c5){_0x5de9c5=_0x5de9c5||0xc8;return function(_0x48194d){if(_0x48194d){return _0x177f88['status'](_0x5de9c5)[_0x80cd('0x2a')](_0x48194d);}};}function respondWithFilteredResult(_0x24473f,_0x14b8ac){return function(_0x34a0c1){if(_0x34a0c1){var _0x113b17=typeof _0x14b8ac[_0x80cd('0x2b')]===_0x80cd('0x2c')&&typeof _0x14b8ac[_0x80cd('0x2d')]==='undefined';var _0x2d60c6=_0x34a0c1[_0x80cd('0x2e')];var _0x5bd731=_0x113b17?0x0:_0x14b8ac[_0x80cd('0x2b')];var _0x254bd0=_0x113b17?_0x34a0c1[_0x80cd('0x2e')]:_0x14b8ac[_0x80cd('0x2b')]+_0x14b8ac[_0x80cd('0x2d')];var _0x23d037;if(_0x254bd0>=_0x2d60c6){_0x254bd0=_0x2d60c6;_0x23d037=0xc8;}else{_0x23d037=0xce;}_0x24473f[_0x80cd('0x29')](_0x23d037);return _0x24473f[_0x80cd('0x2f')](_0x80cd('0x30'),_0x5bd731+'-'+_0x254bd0+'/'+_0x2d60c6)[_0x80cd('0x2a')](_0x34a0c1);}return null;};}function patchUpdates(_0x500b48){return function(_0x5d61f4){try{jsonpatch[_0x80cd('0x31')](_0x5d61f4,_0x500b48,!![]);}catch(_0x5413b9){return BPromise[_0x80cd('0x32')](_0x5413b9);}return _0x5d61f4[_0x80cd('0x33')]();};}function saveUpdates(_0x15ed6d,_0x5d846a){return function(_0x6aa55f){if(_0x6aa55f){return _0x6aa55f[_0x80cd('0x34')](_0x15ed6d)[_0x80cd('0x1d')](function(_0xfa9561){return _0xfa9561;});}return null;};}function removeEntity(_0xf5f89,_0x554132){return function(_0x7d823){if(_0x7d823){return _0x7d823[_0x80cd('0x35')]()[_0x80cd('0x1d')](function(){_0xf5f89[_0x80cd('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b6397,_0x3a5352){return function(_0x386877){if(!_0x386877){_0x2b6397['sendStatus'](0x194);}return _0x386877;};}function handleError(_0x491e4f,_0x567005){_0x567005=_0x567005||0x1f4;return function(_0x4e7f6e){logger[_0x80cd('0x23')](_0x4e7f6e[_0x80cd('0x36')]);if(_0x4e7f6e[_0x80cd('0x37')]){delete _0x4e7f6e['name'];}_0x491e4f[_0x80cd('0x29')](_0x567005)[_0x80cd('0x38')](_0x4e7f6e);};}exports[_0x80cd('0x39')]=function(_0x43bfd2,_0x58f0c8){var _0x31bd05={},_0x82021={},_0x4603b9={'count':0x0,'rows':[]};var _0x49113e=_[_0x80cd('0x3a')](db[_0x80cd('0x3b')][_0x80cd('0x3c')],function(_0xc12648){return{'name':_0xc12648[_0x80cd('0x3d')],'type':_0xc12648[_0x80cd('0x3e')][_0x80cd('0x3f')]};});_0x82021['model']=_[_0x80cd('0x3a')](_0x49113e,_0x80cd('0x37'));_0x82021[_0x80cd('0x40')]=_[_0x80cd('0x41')](_0x43bfd2[_0x80cd('0x40')]);_0x82021[_0x80cd('0x42')]=_[_0x80cd('0x43')](_0x82021[_0x80cd('0x44')],_0x82021['query']);_0x31bd05['attributes']=_['intersection'](_0x82021['model'],qs[_0x80cd('0x45')](_0x43bfd2[_0x80cd('0x40')]['fields']));_0x31bd05['attributes']=_0x31bd05[_0x80cd('0x46')]['length']?_0x31bd05[_0x80cd('0x46')]:_0x82021[_0x80cd('0x44')];if(!_0x43bfd2[_0x80cd('0x40')][_0x80cd('0x47')]('nolimit')){_0x31bd05[_0x80cd('0x2d')]=qs[_0x80cd('0x2d')](_0x43bfd2[_0x80cd('0x40')][_0x80cd('0x2d')]);_0x31bd05[_0x80cd('0x2b')]=qs[_0x80cd('0x2b')](_0x43bfd2[_0x80cd('0x40')]['offset']);}_0x31bd05['order']=qs[_0x80cd('0x48')](_0x43bfd2['query'][_0x80cd('0x48')]);_0x31bd05['where']=qs[_0x80cd('0x42')](_[_0x80cd('0x49')](_0x43bfd2[_0x80cd('0x40')],_0x82021[_0x80cd('0x42')]),_0x49113e);if(_0x43bfd2[_0x80cd('0x40')]['filter']){_0x31bd05['where']=_['merge'](_0x31bd05[_0x80cd('0x4a')],{'$or':_['map'](_0x49113e,function(_0xb21f){if(_0xb21f[_0x80cd('0x3e')]!==_0x80cd('0x4b')){var _0x2ef84d={};_0x2ef84d[_0xb21f[_0x80cd('0x37')]]={'$like':'%'+_0x43bfd2['query'][_0x80cd('0x4c')]+'%'};return _0x2ef84d;}})});}_0x31bd05=_[_0x80cd('0x4d')]({},_0x31bd05,_0x43bfd2[_0x80cd('0x4e')]);var _0x179121={'where':_0x31bd05[_0x80cd('0x4a')]};return db[_0x80cd('0x3b')][_0x80cd('0x2e')](_0x179121)[_0x80cd('0x1d')](function(_0x2df20e){_0x4603b9['count']=_0x2df20e;if(_0x43bfd2[_0x80cd('0x40')][_0x80cd('0x4f')]){_0x31bd05['include']=[{'all':!![]}];}return db[_0x80cd('0x3b')][_0x80cd('0x50')](_0x31bd05);})[_0x80cd('0x1d')](function(_0x2c974a){_0x4603b9[_0x80cd('0x51')]=_0x2c974a;return _0x4603b9;})[_0x80cd('0x1d')](respondWithFilteredResult(_0x58f0c8,_0x31bd05))[_0x80cd('0x27')](handleError(_0x58f0c8,null));};exports['show']=function(_0x16342e,_0x68c87c){var _0x373d9a={'raw':![],'where':{'id':_0x16342e['params']['id']}},_0x10d48a={};_0x10d48a[_0x80cd('0x44')]=_['keys'](db['Setting']['rawAttributes']);_0x10d48a[_0x80cd('0x40')]=_[_0x80cd('0x41')](_0x16342e[_0x80cd('0x40')]);_0x10d48a[_0x80cd('0x42')]=_['intersection'](_0x10d48a[_0x80cd('0x44')],_0x10d48a['query']);_0x373d9a[_0x80cd('0x46')]=_['intersection'](_0x10d48a['model'],qs[_0x80cd('0x45')](_0x16342e[_0x80cd('0x40')][_0x80cd('0x45')]));_0x373d9a[_0x80cd('0x46')]=_0x373d9a['attributes']['length']?_0x373d9a[_0x80cd('0x46')]:_0x10d48a[_0x80cd('0x44')];if(_0x16342e[_0x80cd('0x40')][_0x80cd('0x4f')]){_0x373d9a[_0x80cd('0x52')]=[{'all':!![]}];}_0x373d9a=_['merge']({},_0x373d9a,_0x16342e[_0x80cd('0x4e')]);return db[_0x80cd('0x3b')][_0x80cd('0x53')](_0x373d9a)[_0x80cd('0x1d')](handleEntityNotFound(_0x68c87c,null))['then'](respondWithResult(_0x68c87c,null))[_0x80cd('0x27')](handleError(_0x68c87c,null));};exports[_0x80cd('0x34')]=function(_0x33eb27,_0x1030f6){if(_0x33eb27[_0x80cd('0x54')]['id']){delete _0x33eb27[_0x80cd('0x54')]['id'];}return db[_0x80cd('0x3b')]['find']({'where':{'id':_0x33eb27[_0x80cd('0x55')]['id']}})[_0x80cd('0x1d')](handleEntityNotFound(_0x1030f6,null))[_0x80cd('0x1d')](saveUpdates(_0x33eb27[_0x80cd('0x54')],null))[_0x80cd('0x1d')](respondWithResult(_0x1030f6,null))['catch'](handleError(_0x1030f6,null));};exports[_0x80cd('0x56')]=function(_0x235986,_0x3f6319,_0x9a11c){if(_0x235986[_0x80cd('0x57')]&&_0x235986[_0x80cd('0x57')][_0x80cd('0x58')]){_0x235986[_0x80cd('0x54')][_0x80cd('0x59')]=_0x235986[_0x80cd('0x57')][_0x80cd('0x58')];}return db[_0x80cd('0x3b')][_0x80cd('0x53')]({'where':{'id':_0x235986['params']['id']}})[_0x80cd('0x1d')](handleEntityNotFound(_0x3f6319,null))[_0x80cd('0x1d')](saveUpdates(_0x235986[_0x80cd('0x54')],null))['then'](respondWithResult(_0x3f6319,null))['catch'](handleError(_0x3f6319,null));};exports[_0x80cd('0x5a')]=function(_0x9837dc,_0x236e14,_0x2c059c){if(_0x9837dc[_0x80cd('0x57')]&&_0x9837dc[_0x80cd('0x57')][_0x80cd('0x58')]){_0x9837dc['body'][_0x80cd('0x5b')]=_0x9837dc[_0x80cd('0x57')][_0x80cd('0x58')];}return db['Setting'][_0x80cd('0x53')]({'where':{'id':_0x9837dc[_0x80cd('0x55')]['id']}})[_0x80cd('0x1d')](handleEntityNotFound(_0x236e14,null))['then'](saveUpdates(_0x9837dc[_0x80cd('0x54')],null))['then'](respondWithResult(_0x236e14,null))['catch'](handleError(_0x236e14,null));};var utilLicense=require('../../config/license/util');exports[_0x80cd('0x5c')]=function(_0x5efb4b,_0x6d97e8,_0x3f145b){var _0x4d5969=_0x80cd('0x5d');var _0xed1868={'custom':![]};return utilLicense[_0x80cd('0x5e')]()[_0x80cd('0x1d')](function(_0x37ecd0){if(_0x37ecd0){_0xed1868=_0x37ecd0;}return db['Setting'][_0x80cd('0x53')]({'where':{'id':_0x5efb4b[_0x80cd('0x55')]['id']},'attributes':[_0x80cd('0x59'),_0x80cd('0x5b'),_0x80cd('0x5f'),_0x80cd('0x60'),_0x80cd('0x61'),_0x80cd('0x62'),_0x80cd('0x63'),_0x80cd('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x6d97e8,null))[_0x80cd('0x1d')](function(_0xdfddf8){if(_0xdfddf8){var _0x2288ff=_0xdfddf8[_0x80cd('0x59')]&&fs[_0x80cd('0x65')](path['join'](config[_0x80cd('0x66')],_0x4d5969,_[_0x80cd('0x67')](_0xdfddf8['logo'])))?path['join'](config[_0x80cd('0x66')],_0x4d5969,_[_0x80cd('0x67')](_0xdfddf8[_0x80cd('0x59')])):path['join'](config['root'],_0x4d5969,_[_0x80cd('0x67')]('default_logo.svg'));var _0x20ce8f=_0x80cd('0x68')+_[_0x80cd('0x69')](_0x80cd('0x59'));if(_0xdfddf8[_0x20ce8f]||!_0xed1868[_0x80cd('0x6a')]){_0x2288ff=path[_0x80cd('0x6b')](config[_0x80cd('0x66')],_0x4d5969,_[_0x80cd('0x67')](_0x80cd('0x6c')));}if(!fs['existsSync'](_0x2288ff)){throw new db[(_0x80cd('0x6d'))]['ValidationError'](_[_0x80cd('0x69')](_0x80cd('0x59'))+_0x80cd('0x6e'));}return _0x6d97e8['download'](_0x2288ff);}})[_0x80cd('0x27')](handleError(_0x6d97e8,null));};var utilLicense=require(_0x80cd('0x6f'));exports[_0x80cd('0x70')]=function(_0x269eb7,_0x4d7830,_0x274fdd){var _0x27311c=_0x80cd('0x5d');var _0x3e5a3a={'custom':![]};return utilLicense[_0x80cd('0x5e')]()['then'](function(_0x128533){if(_0x128533){_0x3e5a3a=_0x128533;}return db['Setting'][_0x80cd('0x53')]({'where':{'id':_0x269eb7['params']['id']},'attributes':[_0x80cd('0x59'),'loginLogo',_0x80cd('0x5f'),_0x80cd('0x60'),_0x80cd('0x61'),'defaultLoginLogo',_0x80cd('0x63'),_0x80cd('0x64')],'raw':!![]});})[_0x80cd('0x1d')](handleEntityNotFound(_0x4d7830,null))[_0x80cd('0x1d')](function(_0x21cbfb){if(_0x21cbfb){var _0xb21fdb=_0x21cbfb['loginLogo']&&fs['existsSync'](path[_0x80cd('0x6b')](config[_0x80cd('0x66')],_0x27311c,_[_0x80cd('0x67')](_0x21cbfb[_0x80cd('0x5b')])))?path[_0x80cd('0x6b')](config[_0x80cd('0x66')],_0x27311c,_[_0x80cd('0x67')](_0x21cbfb[_0x80cd('0x5b')])):path['join'](config[_0x80cd('0x66')],_0x27311c,_[_0x80cd('0x67')]('default_loginLogo.svg'));var _0x32a47d=_0x80cd('0x68')+_['upperFirst'](_0x80cd('0x5b'));if(_0x21cbfb[_0x32a47d]||!_0x3e5a3a[_0x80cd('0x6a')]){_0xb21fdb=path[_0x80cd('0x6b')](config[_0x80cd('0x66')],_0x27311c,_['toLower']('default_loginLogo.svg'));}if(!fs[_0x80cd('0x65')](_0xb21fdb)){throw new db[(_0x80cd('0x6d'))][(_0x80cd('0x71'))](_[_0x80cd('0x69')](_0x80cd('0x5b'))+'\x20not\x20found');}return _0x4d7830[_0x80cd('0x72')](_0xb21fdb);}})[_0x80cd('0x27')](handleError(_0x4d7830,null));};exports[_0x80cd('0x73')]=function(_0x814c2b,_0x53bbd3){return db[_0x80cd('0x3b')][_0x80cd('0x53')]({'where':{'id':_0x814c2b['params']['id']},'attributes':[_0x80cd('0x74')]})[_0x80cd('0x1d')](respondWithResult(_0x53bbd3,null))[_0x80cd('0x27')](handleError(_0x53bbd3,null));};exports[_0x80cd('0x75')]=function(_0x3bff8b,_0x36e2d0,_0x128ff0){if(_0x3bff8b[_0x80cd('0x57')]&&_0x3bff8b[_0x80cd('0x57')][_0x80cd('0x58')]){_0x3bff8b[_0x80cd('0x54')]['preferred']=_0x3bff8b[_0x80cd('0x57')][_0x80cd('0x58')];}return db[_0x80cd('0x3b')][_0x80cd('0x53')]({'where':{'id':_0x3bff8b[_0x80cd('0x55')]['id']}})[_0x80cd('0x1d')](handleEntityNotFound(_0x36e2d0,null))[_0x80cd('0x1d')](saveUpdates(_0x3bff8b['body'],null))[_0x80cd('0x1d')](respondWithResult(_0x36e2d0,null))[_0x80cd('0x27')](handleError(_0x36e2d0,null));};var utilLicense=require(_0x80cd('0x6f'));exports[_0x80cd('0x76')]=function(_0x4dbe88,_0x5c5a2c,_0x145ef4){var _0x1603ca=_0x80cd('0x5d');var _0x378b31={'custom':![]};return utilLicense[_0x80cd('0x5e')]()[_0x80cd('0x1d')](function(_0x88df57){if(_0x88df57){_0x378b31=_0x88df57;}return db[_0x80cd('0x3b')]['find']({'where':{'id':_0x4dbe88['params']['id']},'attributes':[_0x80cd('0x59'),'loginLogo',_0x80cd('0x5f'),_0x80cd('0x60'),_0x80cd('0x61'),_0x80cd('0x62'),_0x80cd('0x63'),_0x80cd('0x64')],'raw':!![]});})[_0x80cd('0x1d')](handleEntityNotFound(_0x5c5a2c,null))[_0x80cd('0x1d')](function(_0x296233){if(_0x296233){var _0x7972ba=_0x296233['preferred']&&fs[_0x80cd('0x65')](path['join'](config[_0x80cd('0x66')],_0x1603ca,_[_0x80cd('0x67')](_0x296233[_0x80cd('0x5f')])))?path[_0x80cd('0x6b')](config[_0x80cd('0x66')],_0x1603ca,_[_0x80cd('0x67')](_0x296233[_0x80cd('0x5f')])):path[_0x80cd('0x6b')](config['root'],_0x1603ca,_[_0x80cd('0x67')](_0x80cd('0x77')));var _0x480aed=_0x80cd('0x68')+_[_0x80cd('0x69')]('preferred');if(_0x296233[_0x480aed]||!_0x378b31[_0x80cd('0x6a')]||!_0x378b31[_0x80cd('0x5f')]){_0x7972ba=path[_0x80cd('0x6b')](config['root'],_0x1603ca,_['toLower'](_0x80cd('0x77')));}if(!fs[_0x80cd('0x65')](_0x7972ba)){throw new db[(_0x80cd('0x6d'))]['ValidationError'](_['upperFirst']('preferred')+_0x80cd('0x6e'));}return _0x5c5a2c[_0x80cd('0x72')](_0x7972ba);}})['catch'](handleError(_0x5c5a2c,null));};exports[_0x80cd('0x78')]=function(_0x4864d9,_0x4da65e,_0x3f2e5d){if(_0x4864d9[_0x80cd('0x57')]&&_0x4864d9[_0x80cd('0x57')][_0x80cd('0x58')]){_0x4864d9[_0x80cd('0x54')][_0x80cd('0x60')]=_0x4864d9[_0x80cd('0x57')][_0x80cd('0x58')];}return db[_0x80cd('0x3b')][_0x80cd('0x53')]({'where':{'id':_0x4864d9['params']['id']}})[_0x80cd('0x1d')](handleEntityNotFound(_0x4da65e,null))[_0x80cd('0x1d')](saveUpdates(_0x4864d9[_0x80cd('0x54')],null))[_0x80cd('0x1d')](respondWithResult(_0x4da65e,null))['catch'](handleError(_0x4da65e,null));};var utilLicense=require(_0x80cd('0x6f'));exports['getFavicon']=function(_0x4dc639,_0x2ec366,_0x1933ca){var _0x35c1cb=_0x80cd('0x5d');var _0x1845e3={'custom':![]};return utilLicense[_0x80cd('0x5e')]()[_0x80cd('0x1d')](function(_0x94640c){if(_0x94640c){_0x1845e3=_0x94640c;}return db[_0x80cd('0x3b')][_0x80cd('0x53')]({'where':{'id':_0x4dc639[_0x80cd('0x55')]['id']},'attributes':[_0x80cd('0x59'),'loginLogo',_0x80cd('0x5f'),_0x80cd('0x60'),_0x80cd('0x61'),_0x80cd('0x62'),_0x80cd('0x63'),_0x80cd('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x2ec366,null))[_0x80cd('0x1d')](function(_0x2854b9){if(_0x2854b9){var _0x2eaa42=_0x2854b9[_0x80cd('0x60')]&&fs[_0x80cd('0x65')](path[_0x80cd('0x6b')](config[_0x80cd('0x66')],_0x35c1cb,_[_0x80cd('0x67')](_0x2854b9['favicon'])))?path[_0x80cd('0x6b')](config[_0x80cd('0x66')],_0x35c1cb,_[_0x80cd('0x67')](_0x2854b9[_0x80cd('0x60')])):path[_0x80cd('0x6b')](config[_0x80cd('0x66')],_0x35c1cb,_['toLower'](_0x80cd('0x79')));var _0x44656f='default'+_[_0x80cd('0x69')](_0x80cd('0x60'));if(_0x2854b9[_0x44656f]||!_0x1845e3[_0x80cd('0x6a')]){_0x2eaa42=path[_0x80cd('0x6b')](config[_0x80cd('0x66')],_0x35c1cb,_['toLower'](_0x80cd('0x79')));}if(!fs[_0x80cd('0x65')](_0x2eaa42)){throw new db[(_0x80cd('0x6d'))][(_0x80cd('0x71'))](_['upperFirst']('favicon')+_0x80cd('0x6e'));}return _0x2ec366[_0x80cd('0x72')](_0x2eaa42);}})[_0x80cd('0x27')](handleError(_0x2ec366,null));};exports[_0x80cd('0x7a')]=function(_0x18b6a6,_0xb6be46){var _0x1371c7={'offset':moment()[_0x80cd('0x7b')]()};_0x1371c7[_0x80cd('0x7c')]=moment()[_0x80cd('0x7b')](_0x1371c7[_0x80cd('0x2b')])[_0x80cd('0x7d')](_0x80cd('0x7e'));return _0xb6be46[_0x80cd('0x29')](0xc8)[_0x80cd('0x38')](_0x1371c7);};
\ No newline at end of file
+var _0xd1e8=['custom','default_logo.svg','\x20not\x20found','download','default_loginLogo.svg','upperFirst','ValidationError','securePassword','addPreferred','server/files/images/logos','default_preferred.png','Sequelize','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','Setting,\x20%s,\x20%s','message','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','end','stack','send','map','Setting','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','include','findAll','show','includeAll','options','find','body','params','addLogo','file','filename','addLogoLogin','loginLogo','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xd1e8,0x101));var _0x8d1e=function(_0x5033da,_0x28668b){_0x5033da=_0x5033da-0x0;var _0x47e33f=_0xd1e8[_0x5033da];return _0x47e33f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8d1e('0x0'));var jsonpatch=require(_0x8d1e('0x1'));var rp=require(_0x8d1e('0x2'));var moment=require(_0x8d1e('0x3'));var BPromise=require(_0x8d1e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8d1e('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8d1e('0x6'));var _=require(_0x8d1e('0x7'));var squel=require(_0x8d1e('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8d1e('0x9'));var toCsv=require(_0x8d1e('0xa'));var querystring=require(_0x8d1e('0xb'));var Papa=require(_0x8d1e('0xc'));var Redis=require('ioredis');var authService=require(_0x8d1e('0xd'));var qs=require(_0x8d1e('0xe'));var as=require(_0x8d1e('0xf'));var hardwareService=require(_0x8d1e('0x10'));var logger=require('../../config/logger')(_0x8d1e('0x11'));var utils=require(_0x8d1e('0x12'));var config=require(_0x8d1e('0x13'));var licenseUtil=require(_0x8d1e('0x14'));var db=require(_0x8d1e('0x15'))['db'];var jayson=require(_0x8d1e('0x16'));var client=jayson[_0x8d1e('0x17')][_0x8d1e('0x18')]({'port':0x232a});function respondWithRpcPromise(_0xf57768,_0x5b3f66,_0x5f2709,_0x33ee8b){return new BPromise(function(_0x26bf64,_0x273b6d){var _0x156d07=_0x33ee8b||client;return _0x156d07[_0x8d1e('0x19')](_0xf57768,_0x5f2709)[_0x8d1e('0x1a')](function(_0x1e9520){logger[_0x8d1e('0x1b')]('Setting,\x20%s,\x20%s',_0x5b3f66,_0x8d1e('0x1c'));logger[_0x8d1e('0x1d')](_0x8d1e('0x1e'),_0x5b3f66,_0x8d1e('0x1c'),JSON[_0x8d1e('0x1f')](_0x1e9520));if(_0x1e9520['error']){if(_0x1e9520['error'][_0x8d1e('0x20')]===0x1f4){logger[_0x8d1e('0x21')](_0x8d1e('0x22'),_0x5b3f66,_0x1e9520[_0x8d1e('0x21')][_0x8d1e('0x23')]);return _0x273b6d(_0x1e9520[_0x8d1e('0x21')][_0x8d1e('0x23')]);}logger['error']('Setting,\x20%s,\x20%s',_0x5b3f66,_0x1e9520['error'][_0x8d1e('0x23')]);return _0x26bf64(_0x1e9520[_0x8d1e('0x21')][_0x8d1e('0x23')]);}else{logger['info'](_0x8d1e('0x22'),_0x5b3f66,_0x8d1e('0x1c'));_0x26bf64(_0x1e9520['result']['message']);}})[_0x8d1e('0x24')](function(_0x2f35d6){logger[_0x8d1e('0x21')](_0x8d1e('0x22'),_0x5b3f66,_0x2f35d6);_0x273b6d(_0x2f35d6);});});}function respondWithStatusCode(_0x50cf72,_0x48f09c){_0x48f09c=_0x48f09c||0xcc;return function(_0x4c65e2){if(_0x4c65e2){return _0x50cf72[_0x8d1e('0x25')](_0x48f09c);}return _0x50cf72['status'](_0x48f09c)['end']();};}function respondWithResult(_0x55c73b,_0x3a22ff){_0x3a22ff=_0x3a22ff||0xc8;return function(_0x54a4d9){if(_0x54a4d9){return _0x55c73b[_0x8d1e('0x26')](_0x3a22ff)['json'](_0x54a4d9);}};}function respondWithFilteredResult(_0x494fc4,_0x35cc0f){return function(_0x46823b){if(_0x46823b){var _0x464ea1=typeof _0x35cc0f[_0x8d1e('0x27')]===_0x8d1e('0x28')&&typeof _0x35cc0f[_0x8d1e('0x29')]===_0x8d1e('0x28');var _0x2243a0=_0x46823b['count'];var _0x38a8e4=_0x464ea1?0x0:_0x35cc0f['offset'];var _0x4dedf8=_0x464ea1?_0x46823b[_0x8d1e('0x2a')]:_0x35cc0f[_0x8d1e('0x27')]+_0x35cc0f[_0x8d1e('0x29')];var _0x4cc8af;if(_0x4dedf8>=_0x2243a0){_0x4dedf8=_0x2243a0;_0x4cc8af=0xc8;}else{_0x4cc8af=0xce;}_0x494fc4[_0x8d1e('0x26')](_0x4cc8af);return _0x494fc4[_0x8d1e('0x2b')](_0x8d1e('0x2c'),_0x38a8e4+'-'+_0x4dedf8+'/'+_0x2243a0)[_0x8d1e('0x2d')](_0x46823b);}return null;};}function patchUpdates(_0x2c4ce7){return function(_0x160242){try{jsonpatch[_0x8d1e('0x2e')](_0x160242,_0x2c4ce7,!![]);}catch(_0x41290b){return BPromise[_0x8d1e('0x2f')](_0x41290b);}return _0x160242['save']();};}function saveUpdates(_0x5d6196,_0x554da6){return function(_0x42b3a7){if(_0x42b3a7){return _0x42b3a7[_0x8d1e('0x30')](_0x5d6196)[_0x8d1e('0x1a')](function(_0x493349){return _0x493349;});}return null;};}function removeEntity(_0x4c44c5,_0x5ada8f){return function(_0x3ea1b3){if(_0x3ea1b3){return _0x3ea1b3['destroy']()['then'](function(){_0x4c44c5[_0x8d1e('0x26')](0xcc)[_0x8d1e('0x31')]();});}};}function handleEntityNotFound(_0x3c7976,_0x4bd4f8){return function(_0x37e75d){if(!_0x37e75d){_0x3c7976[_0x8d1e('0x25')](0x194);}return _0x37e75d;};}function handleError(_0xdc992a,_0x1ab00a){_0x1ab00a=_0x1ab00a||0x1f4;return function(_0xc3d704){logger['error'](_0xc3d704[_0x8d1e('0x32')]);if(_0xc3d704['name']){delete _0xc3d704['name'];}_0xdc992a[_0x8d1e('0x26')](_0x1ab00a)[_0x8d1e('0x33')](_0xc3d704);};}exports['index']=function(_0x5b29de,_0x304d7a){var _0x470622={},_0x3520db={},_0x41da77={'count':0x0,'rows':[]};var _0x1c42df=_[_0x8d1e('0x34')](db[_0x8d1e('0x35')][_0x8d1e('0x36')],function(_0x40d069){return{'name':_0x40d069[_0x8d1e('0x37')],'type':_0x40d069['type'][_0x8d1e('0x38')]};});_0x3520db[_0x8d1e('0x39')]=_[_0x8d1e('0x34')](_0x1c42df,_0x8d1e('0x3a'));_0x3520db[_0x8d1e('0x3b')]=_[_0x8d1e('0x3c')](_0x5b29de[_0x8d1e('0x3b')]);_0x3520db[_0x8d1e('0x3d')]=_['intersection'](_0x3520db[_0x8d1e('0x39')],_0x3520db[_0x8d1e('0x3b')]);_0x470622['attributes']=_[_0x8d1e('0x3e')](_0x3520db[_0x8d1e('0x39')],qs[_0x8d1e('0x3f')](_0x5b29de[_0x8d1e('0x3b')][_0x8d1e('0x3f')]));_0x470622[_0x8d1e('0x40')]=_0x470622['attributes'][_0x8d1e('0x41')]?_0x470622['attributes']:_0x3520db[_0x8d1e('0x39')];if(!_0x5b29de['query'][_0x8d1e('0x42')](_0x8d1e('0x43'))){_0x470622[_0x8d1e('0x29')]=qs[_0x8d1e('0x29')](_0x5b29de[_0x8d1e('0x3b')][_0x8d1e('0x29')]);_0x470622[_0x8d1e('0x27')]=qs[_0x8d1e('0x27')](_0x5b29de[_0x8d1e('0x3b')]['offset']);}_0x470622[_0x8d1e('0x44')]=qs[_0x8d1e('0x45')](_0x5b29de[_0x8d1e('0x3b')][_0x8d1e('0x45')]);_0x470622[_0x8d1e('0x46')]=qs[_0x8d1e('0x3d')](_['pick'](_0x5b29de[_0x8d1e('0x3b')],_0x3520db[_0x8d1e('0x3d')]),_0x1c42df);if(_0x5b29de[_0x8d1e('0x3b')][_0x8d1e('0x47')]){_0x470622[_0x8d1e('0x46')]=_['merge'](_0x470622[_0x8d1e('0x46')],{'$or':_[_0x8d1e('0x34')](_0x1c42df,function(_0x18caaf){if(_0x18caaf[_0x8d1e('0x48')]!==_0x8d1e('0x49')){var _0x148cb9={};_0x148cb9[_0x18caaf[_0x8d1e('0x3a')]]={'$like':'%'+_0x5b29de[_0x8d1e('0x3b')][_0x8d1e('0x47')]+'%'};return _0x148cb9;}})});}_0x470622=_['merge']({},_0x470622,_0x5b29de['options']);var _0x1effd9={'where':_0x470622[_0x8d1e('0x46')]};return db['Setting'][_0x8d1e('0x2a')](_0x1effd9)['then'](function(_0x2d2e16){_0x41da77[_0x8d1e('0x2a')]=_0x2d2e16;if(_0x5b29de[_0x8d1e('0x3b')]['includeAll']){_0x470622[_0x8d1e('0x4a')]=[{'all':!![]}];}return db['Setting'][_0x8d1e('0x4b')](_0x470622);})[_0x8d1e('0x1a')](function(_0x1a3dc1){_0x41da77['rows']=_0x1a3dc1;return _0x41da77;})[_0x8d1e('0x1a')](respondWithFilteredResult(_0x304d7a,_0x470622))[_0x8d1e('0x24')](handleError(_0x304d7a,null));};exports[_0x8d1e('0x4c')]=function(_0x4b6873,_0x509869){var _0x39c751={'raw':![],'where':{'id':_0x4b6873['params']['id']}},_0x4b7759={};_0x4b7759[_0x8d1e('0x39')]=_[_0x8d1e('0x3c')](db[_0x8d1e('0x35')][_0x8d1e('0x36')]);_0x4b7759[_0x8d1e('0x3b')]=_[_0x8d1e('0x3c')](_0x4b6873['query']);_0x4b7759[_0x8d1e('0x3d')]=_[_0x8d1e('0x3e')](_0x4b7759[_0x8d1e('0x39')],_0x4b7759[_0x8d1e('0x3b')]);_0x39c751[_0x8d1e('0x40')]=_['intersection'](_0x4b7759[_0x8d1e('0x39')],qs[_0x8d1e('0x3f')](_0x4b6873[_0x8d1e('0x3b')][_0x8d1e('0x3f')]));_0x39c751[_0x8d1e('0x40')]=_0x39c751[_0x8d1e('0x40')][_0x8d1e('0x41')]?_0x39c751['attributes']:_0x4b7759[_0x8d1e('0x39')];if(_0x4b6873['query'][_0x8d1e('0x4d')]){_0x39c751[_0x8d1e('0x4a')]=[{'all':!![]}];}_0x39c751=_['merge']({},_0x39c751,_0x4b6873[_0x8d1e('0x4e')]);return db[_0x8d1e('0x35')][_0x8d1e('0x4f')](_0x39c751)[_0x8d1e('0x1a')](handleEntityNotFound(_0x509869,null))[_0x8d1e('0x1a')](respondWithResult(_0x509869,null))[_0x8d1e('0x24')](handleError(_0x509869,null));};exports[_0x8d1e('0x30')]=function(_0x21a2e5,_0x42246f){if(_0x21a2e5[_0x8d1e('0x50')]['id']){delete _0x21a2e5[_0x8d1e('0x50')]['id'];}return db[_0x8d1e('0x35')][_0x8d1e('0x4f')]({'where':{'id':_0x21a2e5[_0x8d1e('0x51')]['id']}})[_0x8d1e('0x1a')](handleEntityNotFound(_0x42246f,null))[_0x8d1e('0x1a')](saveUpdates(_0x21a2e5[_0x8d1e('0x50')],null))['then'](respondWithResult(_0x42246f,null))['catch'](handleError(_0x42246f,null));};exports[_0x8d1e('0x52')]=function(_0x1f1aaa,_0x2fecd0,_0x13f962){if(_0x1f1aaa[_0x8d1e('0x53')]&&_0x1f1aaa[_0x8d1e('0x53')]['filename']){_0x1f1aaa[_0x8d1e('0x50')]['logo']=_0x1f1aaa[_0x8d1e('0x53')][_0x8d1e('0x54')];}return db['Setting']['find']({'where':{'id':_0x1f1aaa[_0x8d1e('0x51')]['id']}})[_0x8d1e('0x1a')](handleEntityNotFound(_0x2fecd0,null))[_0x8d1e('0x1a')](saveUpdates(_0x1f1aaa['body'],null))['then'](respondWithResult(_0x2fecd0,null))['catch'](handleError(_0x2fecd0,null));};exports[_0x8d1e('0x55')]=function(_0x53f7a4,_0x3dad4c,_0x11415a){if(_0x53f7a4[_0x8d1e('0x53')]&&_0x53f7a4[_0x8d1e('0x53')]['filename']){_0x53f7a4['body'][_0x8d1e('0x56')]=_0x53f7a4[_0x8d1e('0x53')][_0x8d1e('0x54')];}return db[_0x8d1e('0x35')][_0x8d1e('0x4f')]({'where':{'id':_0x53f7a4[_0x8d1e('0x51')]['id']}})['then'](handleEntityNotFound(_0x3dad4c,null))['then'](saveUpdates(_0x53f7a4[_0x8d1e('0x50')],null))[_0x8d1e('0x1a')](respondWithResult(_0x3dad4c,null))[_0x8d1e('0x24')](handleError(_0x3dad4c,null));};var utilLicense=require(_0x8d1e('0x14'));exports['getLogo']=function(_0x215066,_0x11644c,_0x5c1a60){var _0x33d016='server/files/images/logos';var _0x592690={'custom':![]};return utilLicense[_0x8d1e('0x57')]()['then'](function(_0x4ba9c1){if(_0x4ba9c1){_0x592690=_0x4ba9c1;}return db[_0x8d1e('0x35')]['find']({'where':{'id':_0x215066['params']['id']},'attributes':[_0x8d1e('0x58'),_0x8d1e('0x56'),_0x8d1e('0x59'),_0x8d1e('0x5a'),_0x8d1e('0x5b'),_0x8d1e('0x5c'),_0x8d1e('0x5d'),_0x8d1e('0x5e')],'raw':!![]});})[_0x8d1e('0x1a')](handleEntityNotFound(_0x11644c,null))['then'](function(_0x4b6baf){if(_0x4b6baf){var _0x13dd30=_0x4b6baf[_0x8d1e('0x58')]&&fs[_0x8d1e('0x5f')](path[_0x8d1e('0x60')](config['root'],_0x33d016,_[_0x8d1e('0x61')](_0x4b6baf['logo'])))?path[_0x8d1e('0x60')](config[_0x8d1e('0x62')],_0x33d016,_[_0x8d1e('0x61')](_0x4b6baf['logo'])):path['join'](config[_0x8d1e('0x62')],_0x33d016,_['toLower']('default_logo.svg'));var _0x53fa22=_0x8d1e('0x63')+_['upperFirst'](_0x8d1e('0x58'));if(_0x4b6baf[_0x53fa22]||!_0x592690[_0x8d1e('0x64')]){_0x13dd30=path[_0x8d1e('0x60')](config['root'],_0x33d016,_[_0x8d1e('0x61')](_0x8d1e('0x65')));}if(!fs['existsSync'](_0x13dd30)){throw new db['Sequelize']['ValidationError'](_['upperFirst'](_0x8d1e('0x58'))+_0x8d1e('0x66'));}return _0x11644c[_0x8d1e('0x67')](_0x13dd30);}})[_0x8d1e('0x24')](handleError(_0x11644c,null));};var utilLicense=require(_0x8d1e('0x14'));exports['getLogoLogin']=function(_0x3661cc,_0x44f16b,_0x346f33){var _0x4ea94f='server/files/images/logos';var _0x5e5414={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x3c7fba){if(_0x3c7fba){_0x5e5414=_0x3c7fba;}return db['Setting'][_0x8d1e('0x4f')]({'where':{'id':_0x3661cc[_0x8d1e('0x51')]['id']},'attributes':[_0x8d1e('0x58'),_0x8d1e('0x56'),_0x8d1e('0x59'),_0x8d1e('0x5a'),_0x8d1e('0x5b'),_0x8d1e('0x5c'),_0x8d1e('0x5d'),_0x8d1e('0x5e')],'raw':!![]});})[_0x8d1e('0x1a')](handleEntityNotFound(_0x44f16b,null))['then'](function(_0x61fc52){if(_0x61fc52){var _0x5b2515=_0x61fc52[_0x8d1e('0x56')]&&fs[_0x8d1e('0x5f')](path[_0x8d1e('0x60')](config[_0x8d1e('0x62')],_0x4ea94f,_[_0x8d1e('0x61')](_0x61fc52['loginLogo'])))?path[_0x8d1e('0x60')](config[_0x8d1e('0x62')],_0x4ea94f,_[_0x8d1e('0x61')](_0x61fc52['loginLogo'])):path[_0x8d1e('0x60')](config[_0x8d1e('0x62')],_0x4ea94f,_[_0x8d1e('0x61')](_0x8d1e('0x68')));var _0x1e08fb=_0x8d1e('0x63')+_[_0x8d1e('0x69')](_0x8d1e('0x56'));if(_0x61fc52[_0x1e08fb]||!_0x5e5414['custom']){_0x5b2515=path[_0x8d1e('0x60')](config[_0x8d1e('0x62')],_0x4ea94f,_[_0x8d1e('0x61')](_0x8d1e('0x68')));}if(!fs[_0x8d1e('0x5f')](_0x5b2515)){throw new db['Sequelize'][(_0x8d1e('0x6a'))](_['upperFirst']('loginLogo')+'\x20not\x20found');}return _0x44f16b[_0x8d1e('0x67')](_0x5b2515);}})[_0x8d1e('0x24')](handleError(_0x44f16b,null));};exports['gdpr']=function(_0x127567,_0x41cc98){return db[_0x8d1e('0x35')][_0x8d1e('0x4f')]({'where':{'id':_0x127567[_0x8d1e('0x51')]['id']},'attributes':[_0x8d1e('0x6b')]})[_0x8d1e('0x1a')](respondWithResult(_0x41cc98,null))[_0x8d1e('0x24')](handleError(_0x41cc98,null));};exports[_0x8d1e('0x6c')]=function(_0x45a4a5,_0x5636e4,_0x5867d9){if(_0x45a4a5[_0x8d1e('0x53')]&&_0x45a4a5['file'][_0x8d1e('0x54')]){_0x45a4a5[_0x8d1e('0x50')][_0x8d1e('0x59')]=_0x45a4a5[_0x8d1e('0x53')]['filename'];}return db[_0x8d1e('0x35')]['find']({'where':{'id':_0x45a4a5[_0x8d1e('0x51')]['id']}})[_0x8d1e('0x1a')](handleEntityNotFound(_0x5636e4,null))['then'](saveUpdates(_0x45a4a5[_0x8d1e('0x50')],null))[_0x8d1e('0x1a')](respondWithResult(_0x5636e4,null))['catch'](handleError(_0x5636e4,null));};var utilLicense=require(_0x8d1e('0x14'));exports['getPreferred']=function(_0x59fec8,_0x558578,_0x4d5c49){var _0x353ea1=_0x8d1e('0x6d');var _0x5c851a={'custom':![]};return utilLicense[_0x8d1e('0x57')]()[_0x8d1e('0x1a')](function(_0x28ccbf){if(_0x28ccbf){_0x5c851a=_0x28ccbf;}return db[_0x8d1e('0x35')][_0x8d1e('0x4f')]({'where':{'id':_0x59fec8[_0x8d1e('0x51')]['id']},'attributes':[_0x8d1e('0x58'),_0x8d1e('0x56'),_0x8d1e('0x59'),_0x8d1e('0x5a'),_0x8d1e('0x5b'),_0x8d1e('0x5c'),_0x8d1e('0x5d'),_0x8d1e('0x5e')],'raw':!![]});})[_0x8d1e('0x1a')](handleEntityNotFound(_0x558578,null))[_0x8d1e('0x1a')](function(_0x383bdf){if(_0x383bdf){var _0x4a4c93=_0x383bdf[_0x8d1e('0x59')]&&fs[_0x8d1e('0x5f')](path['join'](config['root'],_0x353ea1,_[_0x8d1e('0x61')](_0x383bdf[_0x8d1e('0x59')])))?path[_0x8d1e('0x60')](config[_0x8d1e('0x62')],_0x353ea1,_[_0x8d1e('0x61')](_0x383bdf[_0x8d1e('0x59')])):path[_0x8d1e('0x60')](config[_0x8d1e('0x62')],_0x353ea1,_['toLower']('default_preferred.png'));var _0x1aacf4='default'+_['upperFirst'](_0x8d1e('0x59'));if(_0x383bdf[_0x1aacf4]||!_0x5c851a[_0x8d1e('0x64')]||!_0x5c851a[_0x8d1e('0x59')]){_0x4a4c93=path[_0x8d1e('0x60')](config[_0x8d1e('0x62')],_0x353ea1,_[_0x8d1e('0x61')](_0x8d1e('0x6e')));}if(!fs[_0x8d1e('0x5f')](_0x4a4c93)){throw new db[(_0x8d1e('0x6f'))][(_0x8d1e('0x6a'))](_[_0x8d1e('0x69')](_0x8d1e('0x59'))+_0x8d1e('0x66'));}return _0x558578[_0x8d1e('0x67')](_0x4a4c93);}})[_0x8d1e('0x24')](handleError(_0x558578,null));};exports[_0x8d1e('0x70')]=function(_0x57ef4c,_0x5dc81b,_0x36aa0f){if(_0x57ef4c[_0x8d1e('0x53')]&&_0x57ef4c[_0x8d1e('0x53')][_0x8d1e('0x54')]){_0x57ef4c[_0x8d1e('0x50')][_0x8d1e('0x5a')]=_0x57ef4c[_0x8d1e('0x53')][_0x8d1e('0x54')];}return db[_0x8d1e('0x35')]['find']({'where':{'id':_0x57ef4c[_0x8d1e('0x51')]['id']}})[_0x8d1e('0x1a')](handleEntityNotFound(_0x5dc81b,null))['then'](saveUpdates(_0x57ef4c[_0x8d1e('0x50')],null))[_0x8d1e('0x1a')](respondWithResult(_0x5dc81b,null))[_0x8d1e('0x24')](handleError(_0x5dc81b,null));};var utilLicense=require(_0x8d1e('0x14'));exports[_0x8d1e('0x71')]=function(_0x1cffc3,_0x57416e,_0x10dd9a){var _0x142695=_0x8d1e('0x6d');var _0x2e38c4={'custom':![]};return utilLicense['getLicense']()[_0x8d1e('0x1a')](function(_0x1e5787){if(_0x1e5787){_0x2e38c4=_0x1e5787;}return db[_0x8d1e('0x35')]['find']({'where':{'id':_0x1cffc3[_0x8d1e('0x51')]['id']},'attributes':[_0x8d1e('0x58'),_0x8d1e('0x56'),_0x8d1e('0x59'),_0x8d1e('0x5a'),_0x8d1e('0x5b'),'defaultLoginLogo',_0x8d1e('0x5d'),_0x8d1e('0x5e')],'raw':!![]});})['then'](handleEntityNotFound(_0x57416e,null))[_0x8d1e('0x1a')](function(_0x288202){if(_0x288202){var _0x1a6271=_0x288202[_0x8d1e('0x5a')]&&fs[_0x8d1e('0x5f')](path[_0x8d1e('0x60')](config[_0x8d1e('0x62')],_0x142695,_[_0x8d1e('0x61')](_0x288202[_0x8d1e('0x5a')])))?path[_0x8d1e('0x60')](config[_0x8d1e('0x62')],_0x142695,_[_0x8d1e('0x61')](_0x288202[_0x8d1e('0x5a')])):path[_0x8d1e('0x60')](config[_0x8d1e('0x62')],_0x142695,_[_0x8d1e('0x61')](_0x8d1e('0x72')));var _0x1ebae7='default'+_[_0x8d1e('0x69')](_0x8d1e('0x5a'));if(_0x288202[_0x1ebae7]||!_0x2e38c4[_0x8d1e('0x64')]){_0x1a6271=path[_0x8d1e('0x60')](config[_0x8d1e('0x62')],_0x142695,_[_0x8d1e('0x61')](_0x8d1e('0x72')));}if(!fs[_0x8d1e('0x5f')](_0x1a6271)){throw new db['Sequelize']['ValidationError'](_[_0x8d1e('0x69')](_0x8d1e('0x5a'))+'\x20not\x20found');}return _0x57416e[_0x8d1e('0x67')](_0x1a6271);}})['catch'](handleError(_0x57416e,null));};exports['getDate']=function(_0x35dfd8,_0x2d2cf4){var _0x460244={'offset':moment()[_0x8d1e('0x73')]()};_0x460244[_0x8d1e('0x74')]=moment()[_0x8d1e('0x73')](_0x460244['offset'])[_0x8d1e('0x75')](_0x8d1e('0x76'));return _0x2d2cf4[_0x8d1e('0x26')](0xc8)[_0x8d1e('0x33')](_0x460244);};
\ No newline at end of file
index d625b7b..9638b2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x1e1020,_0xd64a27){var _0x464719=function(_0x376ffa){while(--_0x376ffa){_0x1e1020['push'](_0x1e1020['shift']());}};_0x464719(++_0xd64a27);}(_0x3e74,0x175));var _0x43e7=function(_0x5d490e,_0x44c776){_0x5d490e=_0x5d490e-0x0;var _0x27201b=_0x3e74[_0x5d490e];return _0x27201b;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3703ca7..6b83107 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x812f=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','map','include','model','lodash','util','moment','bluebird','randomstring'];(function(_0x263f9d,_0x3d854e){var _0x4c4efa=function(_0x48d506){while(--_0x48d506){_0x263f9d['push'](_0x263f9d['shift']());}};_0x4c4efa(++_0x3d854e);}(_0x812f,0xe9));var _0xf812=function(_0x8c49e,_0x17e0cb){_0x8c49e=_0x8c49e-0x0;var _0x57eb67=_0x812f[_0x8c49e];return _0x57eb67;};'use strict';var _=require(_0xf812('0x0'));var util=require(_0xf812('0x1'));var moment=require(_0xf812('0x2'));var BPromise=require(_0xf812('0x3'));var rs=require(_0xf812('0x4'));var fs=require('fs');var Redis=require(_0xf812('0x5'));var db=require(_0xf812('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf812('0x7'));var config=require(_0xf812('0x8'));var jayson=require(_0xf812('0x9'));var client=jayson['client'][_0xf812('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e7a63,_0x4cf3e7,_0x4198d5){return new BPromise(function(_0x57652b,_0xc83921){return client[_0xf812('0xb')](_0x2e7a63,_0x4198d5)[_0xf812('0xc')](function(_0x64426b){logger[_0xf812('0xd')]('Setting,\x20%s,\x20%s',_0x4cf3e7,_0xf812('0xe'));logger[_0xf812('0xf')](_0xf812('0x10'),_0x4cf3e7,'request\x20sent',JSON[_0xf812('0x11')](_0x64426b));if(_0x64426b[_0xf812('0x12')]){if(_0x64426b['error'][_0xf812('0x13')]===0x1f4){logger[_0xf812('0x12')](_0xf812('0x14'),_0x4cf3e7,_0x64426b['error']['message']);return _0xc83921(_0x64426b[_0xf812('0x12')][_0xf812('0x15')]);}logger['error']('Setting,\x20%s,\x20%s',_0x4cf3e7,_0x64426b[_0xf812('0x12')]['message']);return _0x57652b(_0x64426b[_0xf812('0x12')][_0xf812('0x15')]);}else{logger[_0xf812('0xd')](_0xf812('0x14'),_0x4cf3e7,_0xf812('0xe'));_0x57652b(_0x64426b[_0xf812('0x16')][_0xf812('0x15')]);}})[_0xf812('0x17')](function(_0x5cbc17){logger[_0xf812('0x12')](_0xf812('0x14'),_0x4cf3e7,_0x5cbc17);_0xc83921(_0x5cbc17);});});}exports[_0xf812('0x18')]=function(_0x45dfd6){var _0x54913a=this;return new Promise(function(_0x1be9cd,_0x465ff0){return db[_0xf812('0x19')][_0xf812('0x1a')]({'raw':_0x45dfd6[_0xf812('0x1b')]?_0x45dfd6[_0xf812('0x1b')][_0xf812('0x1c')]===undefined?!![]:![]:!![],'where':_0x45dfd6[_0xf812('0x1b')]?_0x45dfd6[_0xf812('0x1b')][_0xf812('0x1d')]||null:null,'attributes':_0x45dfd6[_0xf812('0x1b')]?_0x45dfd6['options'][_0xf812('0x1e')]||null:null,'include':_0x45dfd6[_0xf812('0x1b')]?_0x45dfd6[_0xf812('0x1b')]['include']?_[_0xf812('0x1f')](_0x45dfd6[_0xf812('0x1b')][_0xf812('0x20')],function(_0x2743ad){return{'model':db[_0x2743ad[_0xf812('0x21')]],'as':_0x2743ad['as'],'attributes':_0x2743ad['attributes'],'include':_0x2743ad[_0xf812('0x20')]?_[_0xf812('0x1f')](_0x2743ad[_0xf812('0x20')],function(_0xebb345){return{'model':db[_0xebb345[_0xf812('0x21')]],'as':_0xebb345['as'],'attributes':_0xebb345[_0xf812('0x1e')],'include':_0xebb345['include']?_[_0xf812('0x1f')](_0xebb345[_0xf812('0x20')],function(_0x73855d){return{'model':db[_0x73855d['model']],'as':_0x73855d['as'],'attributes':_0x73855d[_0xf812('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf812('0xc')](function(_0x83ebc2){logger['info'](_0xf812('0x18'),_0x45dfd6);logger[_0xf812('0xf')](_0xf812('0x18'),_0x45dfd6,JSON[_0xf812('0x11')](_0x83ebc2));_0x1be9cd(_0x83ebc2);})[_0xf812('0x17')](function(_0x17673c){logger['error'](_0xf812('0x18'),_0x17673c[_0xf812('0x15')],_0x45dfd6);_0x465ff0(_0x54913a['error'](0x1f4,_0x17673c[_0xf812('0x15')]));});});};
\ No newline at end of file
+var _0x2345=['model','then','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','Setting','find','options','raw','where','include','attributes','map'];(function(_0x92f5e,_0x14bf7e){var _0x5411ce=function(_0x123c13){while(--_0x123c13){_0x92f5e['push'](_0x92f5e['shift']());}};_0x5411ce(++_0x14bf7e);}(_0x2345,0x107));var _0x5234=function(_0x8a239e,_0x22f791){_0x8a239e=_0x8a239e-0x0;var _0x30731d=_0x2345[_0x8a239e];return _0x30731d;};'use strict';var _=require(_0x5234('0x0'));var util=require('util');var moment=require(_0x5234('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5234('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5234('0x3'));var logger=require(_0x5234('0x4'))(_0x5234('0x5'));var config=require('../../config/environment');var jayson=require(_0x5234('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xcc6643,_0x5c8317,_0x591a7e){return new BPromise(function(_0x1c7b80,_0x1c39b0){return client[_0x5234('0x7')](_0xcc6643,_0x591a7e)['then'](function(_0x276b8c){logger[_0x5234('0x8')](_0x5234('0x9'),_0x5c8317,_0x5234('0xa'));logger['debug'](_0x5234('0xb'),_0x5c8317,_0x5234('0xa'),JSON[_0x5234('0xc')](_0x276b8c));if(_0x276b8c[_0x5234('0xd')]){if(_0x276b8c[_0x5234('0xd')][_0x5234('0xe')]===0x1f4){logger['error'](_0x5234('0x9'),_0x5c8317,_0x276b8c[_0x5234('0xd')][_0x5234('0xf')]);return _0x1c39b0(_0x276b8c[_0x5234('0xd')][_0x5234('0xf')]);}logger[_0x5234('0xd')](_0x5234('0x9'),_0x5c8317,_0x276b8c[_0x5234('0xd')][_0x5234('0xf')]);return _0x1c7b80(_0x276b8c[_0x5234('0xd')][_0x5234('0xf')]);}else{logger['info'](_0x5234('0x9'),_0x5c8317,_0x5234('0xa'));_0x1c7b80(_0x276b8c[_0x5234('0x10')][_0x5234('0xf')]);}})[_0x5234('0x11')](function(_0x3bcaa1){logger[_0x5234('0xd')](_0x5234('0x9'),_0x5c8317,_0x3bcaa1);_0x1c39b0(_0x3bcaa1);});});}exports[_0x5234('0x12')]=function(_0x55eb30){var _0x4eafc5=this;return new Promise(function(_0x55875a,_0x55bf7e){return db[_0x5234('0x13')][_0x5234('0x14')]({'raw':_0x55eb30[_0x5234('0x15')]?_0x55eb30['options'][_0x5234('0x16')]===undefined?!![]:![]:!![],'where':_0x55eb30[_0x5234('0x15')]?_0x55eb30['options'][_0x5234('0x17')]||null:null,'attributes':_0x55eb30[_0x5234('0x15')]?_0x55eb30[_0x5234('0x15')]['attributes']||null:null,'include':_0x55eb30[_0x5234('0x15')]?_0x55eb30[_0x5234('0x15')][_0x5234('0x18')]?_['map'](_0x55eb30[_0x5234('0x15')][_0x5234('0x18')],function(_0x2eac39){return{'model':db[_0x2eac39['model']],'as':_0x2eac39['as'],'attributes':_0x2eac39[_0x5234('0x19')],'include':_0x2eac39[_0x5234('0x18')]?_[_0x5234('0x1a')](_0x2eac39[_0x5234('0x18')],function(_0x36e252){return{'model':db[_0x36e252[_0x5234('0x1b')]],'as':_0x36e252['as'],'attributes':_0x36e252[_0x5234('0x19')],'include':_0x36e252[_0x5234('0x18')]?_['map'](_0x36e252[_0x5234('0x18')],function(_0x2c46f4){return{'model':db[_0x2c46f4[_0x5234('0x1b')]],'as':_0x2c46f4['as'],'attributes':_0x2c46f4[_0x5234('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5234('0x1c')](function(_0x487b20){logger[_0x5234('0x8')](_0x5234('0x12'),_0x55eb30);logger['debug']('ShowSetting',_0x55eb30,JSON['stringify'](_0x487b20));_0x55875a(_0x487b20);})[_0x5234('0x11')](function(_0x1d91d3){logger['error'](_0x5234('0x12'),_0x1d91d3[_0x5234('0xf')],_0x55eb30);_0x55bf7e(_0x4eafc5['error'](0x1f4,_0x1d91d3[_0x5234('0xf')]));});});};
\ No newline at end of file
index 8c460b2..f143986 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['/:id/send','status','put','update','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/notify','notify','addApplications'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x7217,0x19e));var _0x7721=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x7217[_0x1da04e];return _0xdd8c41;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getApplications']);router[_0x7721('0x8')](_0x7721('0x14'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x8')](_0x7721('0x16'),controller[_0x7721('0x17')]);router['get'](_0x7721('0x18'),auth[_0x7721('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x1a')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addDisposition']);router[_0x7721('0x1a')]('/:id/canned_answers',auth[_0x7721('0x9')](),controller['addAnswer']);router[_0x7721('0x1a')](_0x7721('0x1b'),controller[_0x7721('0x1c')]);router[_0x7721('0x1a')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1d')]);router[_0x7721('0x1a')](_0x7721('0x1e'),auth[_0x7721('0x9')](),controller['send']);router[_0x7721('0x1a')](_0x7721('0x16'),controller[_0x7721('0x1f')]);router[_0x7721('0x1a')]('/:id/users',auth[_0x7721('0x9')](),controller['addAgents']);router[_0x7721('0x20')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x21')]);router[_0x7721('0x22')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller['destroy']);router[_0x7721('0x22')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller[_0x7721('0x23')]);router[_0x7721('0x22')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x24')]);router[_0x7721('0x22')]('/:id/users',auth[_0x7721('0x9')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x7217=['/:id/send','status','put','update','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','create','post','/:id/notify','notify','addApplications'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7217,0x19e));var _0x7721=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x7217[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getApplications']);router[_0x7721('0x8')](_0x7721('0x14'),auth['isAuthenticated'](),controller[_0x7721('0x15')]);router[_0x7721('0x8')](_0x7721('0x16'),controller[_0x7721('0x17')]);router['get'](_0x7721('0x18'),auth[_0x7721('0x9')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x1a')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addDisposition']);router[_0x7721('0x1a')]('/:id/canned_answers',auth[_0x7721('0x9')](),controller['addAnswer']);router[_0x7721('0x1a')](_0x7721('0x1b'),controller[_0x7721('0x1c')]);router[_0x7721('0x1a')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1d')]);router[_0x7721('0x1a')](_0x7721('0x1e'),auth[_0x7721('0x9')](),controller['send']);router[_0x7721('0x1a')](_0x7721('0x16'),controller[_0x7721('0x1f')]);router[_0x7721('0x1a')]('/:id/users',auth[_0x7721('0x9')](),controller['addAgents']);router[_0x7721('0x20')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0x21')]);router[_0x7721('0x22')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller['destroy']);router[_0x7721('0x22')](_0x7721('0xf'),auth[_0x7721('0x9')](),controller[_0x7721('0x23')]);router[_0x7721('0x22')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x24')]);router[_0x7721('0x22')]('/:id/users',auth[_0x7721('0x9')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 623ed70..0ea6325 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45c8=['clicksend','plivo','clickatell','csc','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','randomstring','exports','name','STRING','generate','ENUM','twilio','skebby','connectel'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x45c8,0xc9));var _0x845c=function(_0x4b22dc,_0x819cbc){_0x4b22dc=_0x4b22dc-0x0;var _0x5963c6=_0x45c8[_0x4b22dc];return _0x5963c6;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x845c('0x0'));module[_0x845c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x845c('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x845c('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x845c('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x845c('0x3')],'defaultValue':function(){return rs[_0x845c('0x4')]();}},'phone':{'type':Sequelize[_0x845c('0x3')]},'type':{'type':Sequelize[_0x845c('0x5')](_0x845c('0x6'),_0x845c('0x7'),_0x845c('0x8'),_0x845c('0x9'),_0x845c('0xa'),_0x845c('0xb'),'bandwidth',_0x845c('0xc'),'infobip','intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x845c('0x3')]},'authToken':{'type':Sequelize[_0x845c('0x3')]},'smsMethod':{'type':Sequelize[_0x845c('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x845c('0x3')]},'password':{'type':Sequelize[_0x845c('0x3')]},'apiKey':{'type':Sequelize[_0x845c('0x3')]},'applicationId':{'type':Sequelize[_0x845c('0x3')]},'accountId':{'type':Sequelize[_0x845c('0x3')]},'senderString':{'type':Sequelize[_0x845c('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x845c('0x3')]},'notificationTemplate':{'type':Sequelize[_0x845c('0xd')],'defaultValue':function(){return _0x845c('0xe');}},'notificationSound':{'type':Sequelize[_0x845c('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x845c('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x845c('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x845c('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x845c('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x845c('0x10')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x845c('0x11'),'set':function(_0x4c1207){if(!_0x4c1207)this['setDataValue'](_0x845c('0x12'),null);this[_0x845c('0x13')](_0x845c('0x14'),_0x4c1207);}}};
\ No newline at end of file
+var _0xb99c=['clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','randomstring','name','STRING','generate','ENUM','skebby','connectel'];(function(_0x138d06,_0x33edf2){var _0x1a01eb=function(_0x387acb){while(--_0x387acb){_0x138d06['push'](_0x138d06['shift']());}};_0x1a01eb(++_0x33edf2);}(_0xb99c,0x1f2));var _0xcb99=function(_0x23fc28,_0x29b03f){_0x23fc28=_0x23fc28-0x0;var _0x16a204=_0xb99c[_0x23fc28];return _0x16a204;};'use strict';var Sequelize=require(_0xcb99('0x0'));var rs=require(_0xcb99('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xcb99('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xcb99('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xcb99('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xcb99('0x3')],'defaultValue':function(){return rs[_0xcb99('0x4')]();}},'phone':{'type':Sequelize[_0xcb99('0x3')]},'type':{'type':Sequelize[_0xcb99('0x5')]('twilio',_0xcb99('0x6'),_0xcb99('0x7'),_0xcb99('0x8'),_0xcb99('0x9'),_0xcb99('0xa'),_0xcb99('0xb'),_0xcb99('0xc'),_0xcb99('0xd'),_0xcb99('0xe'))},'accountSid':{'type':Sequelize[_0xcb99('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xcb99('0x3')]},'smsMethod':{'type':Sequelize[_0xcb99('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xcb99('0x3')]},'password':{'type':Sequelize[_0xcb99('0x3')]},'apiKey':{'type':Sequelize[_0xcb99('0x3')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize[_0xcb99('0x3')]},'senderString':{'type':Sequelize[_0xcb99('0x3')]},'deliveryReport':{'type':Sequelize[_0xcb99('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0xcb99('0x3')]},'notificationTemplate':{'type':Sequelize[_0xcb99('0x10')],'defaultValue':function(){return _0xcb99('0x11');}},'notificationSound':{'type':Sequelize[_0xcb99('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcb99('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcb99('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcb99('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xcb99('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcb99('0x12')],'comment':_0xcb99('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xcb99('0x14'),'set':function(_0x2bcfb3){if(!_0x2bcfb3)this[_0xcb99('0x15')]('mandatoryDispositionPauseId',null);this[_0xcb99('0x15')]('mandatoryDisposition',_0x2bcfb3);}}};
\ No newline at end of file
index ebc40a7..6fcb02a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7415=['bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./smsAccount.socket','register','jayson/promise','client','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','end','stack','name','send','index','Pause','map','SmsAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','filter','includeAll','include','rows','show','mandatoryDispositionPause','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getDispositions','Disposition','findAll','removeDispositions','ids','addAnswer','SmsAccountId','CannedAnswer','getAnswers','findOne','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','describe','Sequelize','no\x20available\x20attributes','updatedAt','difference','mobile','from','From','Body','messageId','MessageSid','skebby','connectel','clicksend','message_id','plivo','Text','MessageUUID','results','originatingAddress','segmentedMessage','clickatell','fromNumber','text','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','ValidationError','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','ListId','Contacts','list','omit','SmsInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','getApplications','getInteractions','Contact','Owner','internal','Tag','Tags','tag','to\x20is\x20mandatory','CmList','List','out','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','infobip','groupName','DELIVERED','redif','SmsAccount,\x20%s,\x20%s,\x20%s','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','state','message-id','csc','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x29efe0,_0x52d0cf){var _0x3c599b=function(_0x5dc090){while(--_0x5dc090){_0x29efe0['push'](_0x29efe0['shift']());}};_0x3c599b(++_0x52d0cf);}(_0x7415,0x1d7));var _0x5741=function(_0x571184,_0x273a7a){_0x571184=_0x571184-0x0;var _0xadefff=_0x7415[_0x571184];return _0xadefff;};'use strict';var emlformat=require(_0x5741('0x0'));var rimraf=require(_0x5741('0x1'));var zipdir=require(_0x5741('0x2'));var jsonpatch=require(_0x5741('0x3'));var rp=require('request-promise');var moment=require(_0x5741('0x4'));var BPromise=require(_0x5741('0x5'));var Mustache=require(_0x5741('0x6'));var util=require(_0x5741('0x7'));var path=require(_0x5741('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5741('0x9'));var fs=require('fs');var fs_extra=require(_0x5741('0xa'));var _=require(_0x5741('0xb'));var squel=require(_0x5741('0xc'));var crypto=require(_0x5741('0xd'));var jsforce=require(_0x5741('0xe'));var deskjs=require(_0x5741('0xf'));var toCsv=require(_0x5741('0x10'));var querystring=require(_0x5741('0x11'));var Papa=require('papaparse');var Redis=require(_0x5741('0x12'));var authService=require(_0x5741('0x13'));var qs=require(_0x5741('0x14'));var as=require(_0x5741('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5741('0x16'))(_0x5741('0x17'));var utils=require(_0x5741('0x18'));var config=require(_0x5741('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x5741('0x1a'))['db'];config['redis']=_[_0x5741('0x1b')](config[_0x5741('0x1c')],{'host':_0x5741('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5741('0x1c')]));require(_0x5741('0x1e'))[_0x5741('0x1f')](socket);var jayson=require(_0x5741('0x20'));var client=jayson[_0x5741('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x58d653,_0x26b96f,_0x26a9ce,_0x32dcec){return new BPromise(function(_0x48bc17,_0xbffa4f){var _0x5f55ce=_0x32dcec||client;return _0x5f55ce['request'](_0x58d653,_0x26a9ce)['then'](function(_0x9ea4dc){logger[_0x5741('0x22')](_0x5741('0x23'),_0x26b96f,_0x5741('0x24'));logger[_0x5741('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x26b96f,'request\x20sent',JSON[_0x5741('0x26')](_0x9ea4dc));if(_0x9ea4dc[_0x5741('0x27')]){if(_0x9ea4dc['error'][_0x5741('0x28')]===0x1f4){logger['error'](_0x5741('0x23'),_0x26b96f,_0x9ea4dc[_0x5741('0x27')]['message']);return _0xbffa4f(_0x9ea4dc[_0x5741('0x27')][_0x5741('0x29')]);}logger[_0x5741('0x27')]('SmsAccount,\x20%s,\x20%s',_0x26b96f,_0x9ea4dc[_0x5741('0x27')][_0x5741('0x29')]);return _0x48bc17(_0x9ea4dc[_0x5741('0x27')][_0x5741('0x29')]);}else{logger['info'](_0x5741('0x23'),_0x26b96f,_0x5741('0x24'));_0x48bc17(_0x9ea4dc[_0x5741('0x2a')]['message']);}})[_0x5741('0x2b')](function(_0x6da4be){logger['error'](_0x5741('0x23'),_0x26b96f,_0x6da4be);_0xbffa4f(_0x6da4be);});});}function respondWithStatusCode(_0x14df9c,_0x429510){_0x429510=_0x429510||0xcc;return function(_0x1063ee){if(_0x1063ee){return _0x14df9c[_0x5741('0x2c')](_0x429510);}return _0x14df9c[_0x5741('0x2d')](_0x429510)['end']();};}function respondWithResult(_0x417a36,_0x3a8f07){_0x3a8f07=_0x3a8f07||0xc8;return function(_0x4ce907){if(_0x4ce907){return _0x417a36[_0x5741('0x2d')](_0x3a8f07)['json'](_0x4ce907);}};}function respondWithFilteredResult(_0x5a8452,_0x216269){return function(_0x59f90d){if(_0x59f90d){var _0x35f786=typeof _0x216269['offset']===_0x5741('0x2e')&&typeof _0x216269[_0x5741('0x2f')]===_0x5741('0x2e');var _0x37f559=_0x59f90d[_0x5741('0x30')];var _0x469bb0=_0x35f786?0x0:_0x216269['offset'];var _0x10a46b=_0x35f786?_0x59f90d[_0x5741('0x30')]:_0x216269['offset']+_0x216269['limit'];var _0x14154f;if(_0x10a46b>=_0x37f559){_0x10a46b=_0x37f559;_0x14154f=0xc8;}else{_0x14154f=0xce;}_0x5a8452[_0x5741('0x2d')](_0x14154f);return _0x5a8452[_0x5741('0x31')]('Content-Range',_0x469bb0+'-'+_0x10a46b+'/'+_0x37f559)[_0x5741('0x32')](_0x59f90d);}return null;};}function patchUpdates(_0x4c7b60){return function(_0x2da421){try{jsonpatch[_0x5741('0x33')](_0x2da421,_0x4c7b60,!![]);}catch(_0xba3958){return BPromise[_0x5741('0x34')](_0xba3958);}return _0x2da421[_0x5741('0x35')]();};}function saveUpdates(_0x3160d5,_0x48f07d){return function(_0x2efb27){if(_0x2efb27){return _0x2efb27[_0x5741('0x36')](_0x3160d5)[_0x5741('0x37')](function(_0xf50428){return _0xf50428;});}return null;};}function removeEntity(_0x51af11,_0x3aea10){return function(_0x426d6b){if(_0x426d6b){return _0x426d6b[_0x5741('0x38')]()[_0x5741('0x37')](function(){var _0x47d4e3=_0x426d6b['get']({'plain':!![]});var _0x3b6e93='SmsAccounts';return db['UserProfileResource'][_0x5741('0x38')]({'where':{'type':_0x3b6e93,'resourceId':_0x47d4e3['id']}})[_0x5741('0x37')](function(){return _0x426d6b;});})[_0x5741('0x37')](function(){_0x51af11[_0x5741('0x2d')](0xcc)[_0x5741('0x39')]();});}};}function handleEntityNotFound(_0x5ebd70,_0x1e0f02){return function(_0x59a79a){if(!_0x59a79a){_0x5ebd70[_0x5741('0x2c')](0x194);}return _0x59a79a;};}function handleError(_0x1fca90,_0x23ffb3){_0x23ffb3=_0x23ffb3||0x1f4;return function(_0x10469e){logger[_0x5741('0x27')](_0x10469e[_0x5741('0x3a')]);if(_0x10469e[_0x5741('0x3b')]){delete _0x10469e[_0x5741('0x3b')];}_0x1fca90['status'](_0x23ffb3)[_0x5741('0x3c')](_0x10469e);};}exports[_0x5741('0x3d')]=function(_0x28d177,_0x2228bd){var _0x5d4437={'include':[{'model':db[_0x5741('0x3e')],'as':'mandatoryDispositionPause'}]},_0xdde23d={},_0x3c744e={'count':0x0,'rows':[]};var _0x23bd1f=_[_0x5741('0x3f')](db[_0x5741('0x40')][_0x5741('0x41')],function(_0x205fed){return{'name':_0x205fed[_0x5741('0x42')],'type':_0x205fed[_0x5741('0x43')][_0x5741('0x44')]};});_0xdde23d['model']=_['map'](_0x23bd1f,'name');_0xdde23d[_0x5741('0x45')]=_[_0x5741('0x46')](_0x28d177[_0x5741('0x45')]);_0xdde23d[_0x5741('0x47')]=_[_0x5741('0x48')](_0xdde23d[_0x5741('0x49')],_0xdde23d[_0x5741('0x45')]);_0x5d4437[_0x5741('0x4a')]=_[_0x5741('0x48')](_0xdde23d[_0x5741('0x49')],qs[_0x5741('0x4b')](_0x28d177[_0x5741('0x45')][_0x5741('0x4b')]));_0x5d4437['attributes']=_0x5d4437[_0x5741('0x4a')][_0x5741('0x4c')]?_0x5d4437[_0x5741('0x4a')]:_0xdde23d[_0x5741('0x49')];if(!_0x28d177[_0x5741('0x45')][_0x5741('0x4d')](_0x5741('0x4e'))){_0x5d4437['limit']=qs['limit'](_0x28d177[_0x5741('0x45')][_0x5741('0x2f')]);_0x5d4437[_0x5741('0x4f')]=qs[_0x5741('0x4f')](_0x28d177[_0x5741('0x45')][_0x5741('0x4f')]);}_0x5d4437[_0x5741('0x50')]=qs[_0x5741('0x51')](_0x28d177[_0x5741('0x45')][_0x5741('0x51')]);_0x5d4437[_0x5741('0x52')]=qs[_0x5741('0x47')](_[_0x5741('0x53')](_0x28d177['query'],_0xdde23d['filters']),_0x23bd1f);if(_0x28d177[_0x5741('0x45')]['filter']){_0x5d4437['where']=_[_0x5741('0x54')](_0x5d4437[_0x5741('0x52')],{'$or':_[_0x5741('0x3f')](_0x23bd1f,function(_0x3edfde){if(_0x3edfde[_0x5741('0x43')]!=='VIRTUAL'){var _0x37bc75={};_0x37bc75[_0x3edfde[_0x5741('0x3b')]]={'$like':'%'+_0x28d177['query'][_0x5741('0x55')]+'%'};return _0x37bc75;}})});}_0x5d4437=_['merge']({},_0x5d4437,_0x28d177['options']);var _0x560024={'where':_0x5d4437[_0x5741('0x52')]};return db[_0x5741('0x40')][_0x5741('0x30')](_0x560024)[_0x5741('0x37')](function(_0xcaa92c){_0x3c744e[_0x5741('0x30')]=_0xcaa92c;if(_0x28d177[_0x5741('0x45')][_0x5741('0x56')]){_0x5d4437[_0x5741('0x57')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x5d4437);})[_0x5741('0x37')](function(_0x567d5b){_0x3c744e[_0x5741('0x58')]=_0x567d5b;return _0x3c744e;})['then'](respondWithFilteredResult(_0x2228bd,_0x5d4437))[_0x5741('0x2b')](handleError(_0x2228bd,null));};exports[_0x5741('0x59')]=function(_0x2948cb,_0x35824d){var _0x5d4ca2={'raw':![],'where':{'id':_0x2948cb['params']['id']},'include':[{'model':db[_0x5741('0x3e')],'as':_0x5741('0x5a')}]},_0x5afd21={};_0x5afd21[_0x5741('0x49')]=_['keys'](db[_0x5741('0x40')][_0x5741('0x41')]);_0x5afd21[_0x5741('0x45')]=_[_0x5741('0x46')](_0x2948cb[_0x5741('0x45')]);_0x5afd21[_0x5741('0x47')]=_['intersection'](_0x5afd21[_0x5741('0x49')],_0x5afd21[_0x5741('0x45')]);_0x5d4ca2[_0x5741('0x4a')]=_[_0x5741('0x48')](_0x5afd21['model'],qs[_0x5741('0x4b')](_0x2948cb[_0x5741('0x45')][_0x5741('0x4b')]));_0x5d4ca2['attributes']=_0x5d4ca2[_0x5741('0x4a')]['length']?_0x5d4ca2[_0x5741('0x4a')]:_0x5afd21[_0x5741('0x49')];if(_0x2948cb['query'][_0x5741('0x56')]){_0x5d4ca2[_0x5741('0x57')]=[{'all':!![]}];}_0x5d4ca2=_[_0x5741('0x54')]({},_0x5d4ca2,_0x2948cb[_0x5741('0x5b')]);return db[_0x5741('0x40')][_0x5741('0x5c')](_0x5d4ca2)['then'](handleEntityNotFound(_0x35824d,null))[_0x5741('0x37')](respondWithResult(_0x35824d,null))[_0x5741('0x2b')](handleError(_0x35824d,null));};exports['create']=function(_0x1711da,_0x77d027){return db[_0x5741('0x40')][_0x5741('0x5d')](_0x1711da[_0x5741('0x5e')],{})[_0x5741('0x37')](function(_0x4fc050){var _0x271f86=_0x1711da[_0x5741('0x5f')][_0x5741('0x60')]({'plain':!![]});if(!_0x271f86)throw new Error(_0x5741('0x61'));if(_0x271f86[_0x5741('0x62')]==='user'){var _0x1fe0e3=_0x4fc050[_0x5741('0x60')]({'plain':!![]});var _0x2886d2=_0x5741('0x63');return db[_0x5741('0x64')][_0x5741('0x5c')]({'where':{'name':_0x2886d2,'userProfileId':_0x271f86[_0x5741('0x65')]},'raw':!![]})[_0x5741('0x37')](function(_0x3874e5){if(_0x3874e5&&_0x3874e5[_0x5741('0x66')]===0x0){return db[_0x5741('0x67')][_0x5741('0x5d')]({'name':_0x1fe0e3[_0x5741('0x3b')],'resourceId':_0x1fe0e3['id'],'type':_0x3874e5[_0x5741('0x3b')],'sectionId':_0x3874e5['id']},{})[_0x5741('0x37')](function(){return _0x4fc050;});}else{return _0x4fc050;}})[_0x5741('0x2b')](function(_0x5ae0e6){logger[_0x5741('0x27')](_0x5741('0x68'),_0x5ae0e6);throw _0x5ae0e6;});}return _0x4fc050;})[_0x5741('0x37')](respondWithResult(_0x77d027,0xc9))[_0x5741('0x2b')](handleError(_0x77d027,null));};exports[_0x5741('0x36')]=function(_0x3c84db,_0x2f8028){if(_0x3c84db[_0x5741('0x5e')]['id']){delete _0x3c84db[_0x5741('0x5e')]['id'];}return db[_0x5741('0x40')]['find']({'where':{'id':_0x3c84db[_0x5741('0x69')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x5741('0x37')](handleEntityNotFound(_0x2f8028,null))[_0x5741('0x37')](saveUpdates(_0x3c84db[_0x5741('0x5e')],null))[_0x5741('0x37')](respondWithResult(_0x2f8028,null))[_0x5741('0x2b')](handleError(_0x2f8028,null));};exports[_0x5741('0x38')]=function(_0x4e321a,_0x5a92dc){return db[_0x5741('0x40')]['find']({'where':{'id':_0x4e321a[_0x5741('0x69')]['id']}})[_0x5741('0x37')](handleEntityNotFound(_0x5a92dc,null))[_0x5741('0x37')](removeEntity(_0x5a92dc,null))[_0x5741('0x2b')](handleError(_0x5a92dc,null));};exports['describe']=function(_0xcfbd5c,_0x34fdeb){return db[_0x5741('0x40')]['describe']()[_0x5741('0x37')](respondWithResult(_0x34fdeb,null))[_0x5741('0x2b')](handleError(_0x34fdeb,null));};exports['addDisposition']=function(_0x1f8164,_0x33e379,_0x51add6){if(_0x1f8164[_0x5741('0x5e')]['id']){delete _0x1f8164['body']['id'];}return db[_0x5741('0x40')][_0x5741('0x5c')]({'where':{'id':_0x1f8164[_0x5741('0x69')]['id']}})[_0x5741('0x37')](handleEntityNotFound(_0x33e379,null))['then'](function(_0x136747){if(_0x136747){_0x1f8164['body']['SmsAccountId']=_0x136747['id'];return db['Disposition'][_0x5741('0x5d')](_0x1f8164['body']);}})['then'](respondWithResult(_0x33e379,null))[_0x5741('0x2b')](handleError(_0x33e379,null));};exports[_0x5741('0x6a')]=function(_0x43effd,_0x1943d4,_0x45354d){var _0x3987a6={'raw':![],'where':{}};var _0x375277={};var _0x296068={'count':0x0,'rows':[]};return db[_0x5741('0x40')]['findOne']({'where':{'id':_0x43effd[_0x5741('0x69')]['id']}})[_0x5741('0x37')](handleEntityNotFound(_0x1943d4,null))[_0x5741('0x37')](function(_0x135fc5){if(_0x135fc5){_0x375277['model']=_[_0x5741('0x46')](db[_0x5741('0x6b')][_0x5741('0x41')]);_0x375277[_0x5741('0x45')]=_[_0x5741('0x46')](_0x43effd[_0x5741('0x45')]);_0x375277[_0x5741('0x47')]=_[_0x5741('0x48')](_0x375277[_0x5741('0x49')],_0x375277[_0x5741('0x45')]);_0x3987a6[_0x5741('0x4a')]=_[_0x5741('0x48')](_0x375277[_0x5741('0x49')],qs[_0x5741('0x4b')](_0x43effd['query']['fields']));_0x3987a6[_0x5741('0x4a')]=_0x3987a6[_0x5741('0x4a')][_0x5741('0x4c')]?_0x3987a6[_0x5741('0x4a')]:_0x375277[_0x5741('0x49')];if(!_0x43effd[_0x5741('0x45')][_0x5741('0x4d')]('nolimit')){_0x3987a6[_0x5741('0x2f')]=qs[_0x5741('0x2f')](_0x43effd['query'][_0x5741('0x2f')]);_0x3987a6[_0x5741('0x4f')]=qs[_0x5741('0x4f')](_0x43effd[_0x5741('0x45')][_0x5741('0x4f')]);}_0x3987a6[_0x5741('0x50')]=qs[_0x5741('0x51')](_0x43effd[_0x5741('0x45')][_0x5741('0x51')]);_0x3987a6[_0x5741('0x52')]=qs[_0x5741('0x47')](_['pick'](_0x43effd['query'],_0x375277[_0x5741('0x47')]));_0x3987a6[_0x5741('0x52')]['SmsAccountId']=_0x135fc5['id'];if(_0x43effd['query']['filter']){_0x3987a6['where']=_[_0x5741('0x54')](_0x3987a6[_0x5741('0x52')],{'$or':_['map'](_0x3987a6[_0x5741('0x4a')],function(_0x4359f3){var _0x1b5cfd={};_0x1b5cfd[_0x4359f3]={'$like':'%'+_0x43effd[_0x5741('0x45')]['filter']+'%'};return _0x1b5cfd;})});}_0x3987a6=_[_0x5741('0x54')]({},_0x3987a6,_0x43effd[_0x5741('0x5b')]);return db['Disposition'][_0x5741('0x30')]({'where':_0x3987a6[_0x5741('0x52')]})[_0x5741('0x37')](function(_0x3737c6){_0x296068[_0x5741('0x30')]=_0x3737c6;if(_0x43effd[_0x5741('0x45')][_0x5741('0x56')]){_0x3987a6[_0x5741('0x57')]=[{'all':!![]}];}return db[_0x5741('0x6b')][_0x5741('0x6c')](_0x3987a6);})[_0x5741('0x37')](function(_0xf5ac76){_0x296068[_0x5741('0x58')]=_0xf5ac76;return _0x296068;});}})['then'](respondWithFilteredResult(_0x1943d4,_0x3987a6))[_0x5741('0x2b')](handleError(_0x1943d4,null));};exports[_0x5741('0x6d')]=function(_0x286920,_0x3ef235,_0x4dfc29){return db[_0x5741('0x40')][_0x5741('0x5c')]({'where':{'id':_0x286920[_0x5741('0x69')]['id']}})[_0x5741('0x37')](handleEntityNotFound(_0x3ef235,null))[_0x5741('0x37')](function(_0x5a8ed8){if(_0x5a8ed8){return _0x5a8ed8['removeDispositions'](_0x286920[_0x5741('0x45')][_0x5741('0x6e')]);}})[_0x5741('0x37')](respondWithStatusCode(_0x3ef235,null))[_0x5741('0x2b')](handleError(_0x3ef235,null));};exports[_0x5741('0x6f')]=function(_0x3751df,_0x959e57,_0x2d7709){if(_0x3751df[_0x5741('0x5e')]['id']){delete _0x3751df['body']['id'];}return db[_0x5741('0x40')][_0x5741('0x5c')]({'where':{'id':_0x3751df[_0x5741('0x69')]['id']}})['then'](handleEntityNotFound(_0x959e57,null))['then'](function(_0x28d87b){if(_0x28d87b){_0x3751df['body'][_0x5741('0x70')]=_0x28d87b['id'];return db[_0x5741('0x71')][_0x5741('0x5d')](_0x3751df[_0x5741('0x5e')]);}})[_0x5741('0x37')](respondWithResult(_0x959e57,null))[_0x5741('0x2b')](handleError(_0x959e57,null));};exports[_0x5741('0x72')]=function(_0x353bc1,_0x1ef2b2,_0x5b1ed1){var _0x4393f1={'raw':![],'where':{}};var _0x98075c={};var _0x19ae37={'count':0x0,'rows':[]};return db[_0x5741('0x40')][_0x5741('0x73')]({'where':{'id':_0x353bc1['params']['id']}})['then'](handleEntityNotFound(_0x1ef2b2,null))[_0x5741('0x37')](function(_0x302470){if(_0x302470){_0x98075c['model']=_[_0x5741('0x46')](db[_0x5741('0x71')]['rawAttributes']);_0x98075c[_0x5741('0x45')]=_[_0x5741('0x46')](_0x353bc1['query']);_0x98075c['filters']=_[_0x5741('0x48')](_0x98075c[_0x5741('0x49')],_0x98075c[_0x5741('0x45')]);_0x4393f1[_0x5741('0x4a')]=_[_0x5741('0x48')](_0x98075c[_0x5741('0x49')],qs['fields'](_0x353bc1[_0x5741('0x45')]['fields']));_0x4393f1[_0x5741('0x4a')]=_0x4393f1[_0x5741('0x4a')][_0x5741('0x4c')]?_0x4393f1['attributes']:_0x98075c[_0x5741('0x49')];if(!_0x353bc1[_0x5741('0x45')][_0x5741('0x4d')](_0x5741('0x4e'))){_0x4393f1[_0x5741('0x2f')]=qs[_0x5741('0x2f')](_0x353bc1[_0x5741('0x45')][_0x5741('0x2f')]);_0x4393f1[_0x5741('0x4f')]=qs[_0x5741('0x4f')](_0x353bc1[_0x5741('0x45')][_0x5741('0x4f')]);}_0x4393f1[_0x5741('0x50')]=qs['sort'](_0x353bc1[_0x5741('0x45')]['sort']);_0x4393f1['where']=qs[_0x5741('0x47')](_[_0x5741('0x53')](_0x353bc1[_0x5741('0x45')],_0x98075c['filters']));_0x4393f1[_0x5741('0x52')][_0x5741('0x70')]=_0x302470['id'];if(_0x353bc1['query'][_0x5741('0x55')]){_0x4393f1[_0x5741('0x52')]=_[_0x5741('0x54')](_0x4393f1['where'],{'$or':_[_0x5741('0x3f')](_0x4393f1[_0x5741('0x4a')],function(_0x421e82){var _0x1ab887={};_0x1ab887[_0x421e82]={'$like':'%'+_0x353bc1[_0x5741('0x45')][_0x5741('0x55')]+'%'};return _0x1ab887;})});}_0x4393f1=_[_0x5741('0x54')]({},_0x4393f1,_0x353bc1[_0x5741('0x5b')]);return db[_0x5741('0x71')]['count']({'where':_0x4393f1[_0x5741('0x52')]})['then'](function(_0x44f014){_0x19ae37['count']=_0x44f014;if(_0x353bc1[_0x5741('0x45')][_0x5741('0x56')]){_0x4393f1[_0x5741('0x57')]=[{'all':!![]}];}return db[_0x5741('0x71')][_0x5741('0x6c')](_0x4393f1);})[_0x5741('0x37')](function(_0x309ffd){_0x19ae37[_0x5741('0x58')]=_0x309ffd;return _0x19ae37;});}})['then'](respondWithFilteredResult(_0x1ef2b2,_0x4393f1))[_0x5741('0x2b')](handleError(_0x1ef2b2,null));};exports[_0x5741('0x74')]=function(_0x5aa204,_0x3a8a65,_0x20b462){return db['SmsAccount'][_0x5741('0x5c')]({'where':{'id':_0x5aa204[_0x5741('0x69')]['id']}})[_0x5741('0x37')](handleEntityNotFound(_0x3a8a65,null))[_0x5741('0x37')](function(_0x1456d3){if(_0x1456d3){return _0x1456d3[_0x5741('0x74')](_0x5aa204[_0x5741('0x45')][_0x5741('0x6e')]);}})[_0x5741('0x37')](respondWithStatusCode(_0x3a8a65,null))['catch'](handleError(_0x3a8a65,null));};exports[_0x5741('0x75')]=function(_0x5c249b,_0xa9ea00,_0x343e6e){var _0x27db70={'channel':_0x5741('0x76')};var _0x4a3c3f=[];var _0x334eea=[];var _0x2327f2={};return db['SmsAccount'][_0x5741('0x5c')]({'where':{'id':_0x5c249b[_0x5741('0x69')]['id']},'include':[{'model':db[_0x5741('0x77')],'as':_0x5741('0x78')}]})[_0x5741('0x37')](handleEntityNotFound(_0xa9ea00,null))[_0x5741('0x37')](function(_0x30204b){_0x27db70[_0x5741('0x79')]=_0x30204b;_0x27db70[_0x5741('0x7a')]=_[_0x5741('0x7b')](_0x30204b['Applications'],[_0x5741('0x7c')],[_0x5741('0x7d')]);if(_0x27db70['account'][_0x5741('0x78')]){delete _0x27db70['account']['Applications'];}return db[_0x5741('0x7e')][_0x5741('0x7f')]();})[_0x5741('0x37')](function(_0x3ddac3){if(!_0x3ddac3){throw new db[(_0x5741('0x80'))]['ValidationError'](_0x5741('0x81'));}_0x4a3c3f=_['difference'](_[_0x5741('0x46')](_0x3ddac3),['createdAt',_0x5741('0x82')]);_0x334eea=_[_0x5741('0x83')](_[_0x5741('0x46')](_0x3ddac3),['createdAt','updatedAt','CompanyId','ListId']);_0x27db70[_0x5741('0x5e')]={'mapKey':_0x5741('0x84')};if(_0x27db70[_0x5741('0x79')][_0x5741('0x43')]){switch(_0x27db70['account']['type']){case'twilio':_0x27db70['body'][_0x5741('0x85')]=_0x5c249b[_0x5741('0x5e')][_0x5741('0x86')];_0x27db70['body'][_0x5741('0x5e')]=_0x5c249b['body'][_0x5741('0x87')];_0x27db70[_0x5741('0x5e')][_0x5741('0x88')]=_0x5c249b[_0x5741('0x5e')][_0x5741('0x89')];break;case _0x5741('0x8a'):_0x27db70['body'][_0x5741('0x85')]='+'+_0x5c249b[_0x5741('0x5e')]['sender'];_0x27db70[_0x5741('0x5e')][_0x5741('0x5e')]=_0x5c249b[_0x5741('0x5e')]['text'];break;case _0x5741('0x8b'):_0x27db70[_0x5741('0x5e')][_0x5741('0x85')]=_0x5c249b[_0x5741('0x5e')][_0x5741('0x85')];_0x27db70[_0x5741('0x5e')]['body']=_0x5c249b[_0x5741('0x5e')]['message'];break;case _0x5741('0x8c'):_0x27db70[_0x5741('0x5e')][_0x5741('0x85')]=_0x5c249b[_0x5741('0x5e')][_0x5741('0x85')];_0x27db70[_0x5741('0x5e')][_0x5741('0x5e')]=_0x5c249b[_0x5741('0x5e')][_0x5741('0x5e')];_0x27db70[_0x5741('0x5e')][_0x5741('0x88')]=_0x5c249b[_0x5741('0x5e')][_0x5741('0x8d')];break;case _0x5741('0x8e'):_0x27db70[_0x5741('0x5e')][_0x5741('0x85')]=_0x5c249b[_0x5741('0x5e')][_0x5741('0x86')];_0x27db70[_0x5741('0x5e')][_0x5741('0x5e')]=_0x5c249b[_0x5741('0x5e')][_0x5741('0x8f')];_0x27db70[_0x5741('0x5e')][_0x5741('0x88')]=_0x5c249b[_0x5741('0x5e')][_0x5741('0x90')];break;case'infobip':_0x27db70[_0x5741('0x5e')][_0x5741('0x85')]='+'+_0x5c249b[_0x5741('0x5e')]['results'][0x0][_0x5741('0x85')];_0x27db70[_0x5741('0x5e')][_0x5741('0x5e')]=_0x5c249b[_0x5741('0x5e')][_0x5741('0x91')][0x0]['text'];_0x27db70['body'][_0x5741('0x88')]=_0x5c249b[_0x5741('0x5e')][_0x5741('0x91')][0x0][_0x5741('0x88')];break;case'csc':_0x27db70[_0x5741('0x5e')][_0x5741('0x85')]=_0x5c249b[_0x5741('0x5e')][_0x5741('0x92')];_0x27db70[_0x5741('0x5e')]['body']=_0x5c249b[_0x5741('0x5e')][_0x5741('0x93')][_0x5741('0x29')];break;case _0x5741('0x94'):_0x27db70['body']['from']=_0x5c249b[_0x5741('0x5e')][_0x5741('0x95')];_0x27db70[_0x5741('0x5e')]['body']=_0x5c249b[_0x5741('0x5e')][_0x5741('0x96')];_0x27db70['body']['messageId']=_0x5c249b[_0x5741('0x5e')][_0x5741('0x97')];break;case _0x5741('0x98'):_0x27db70[_0x5741('0x5e')][_0x5741('0x88')]=_0x5c249b[_0x5741('0x5e')][0x0][_0x5741('0x29')]['id'];_0x27db70[_0x5741('0x5e')][_0x5741('0x85')]=_0x5c249b[_0x5741('0x5e')][0x0][_0x5741('0x29')][_0x5741('0x85')];_0x27db70[_0x5741('0x5e')]['body']=_0x5c249b[_0x5741('0x5e')][0x0]['message'][_0x5741('0x96')];break;case _0x5741('0x99'):_0x27db70['body'][_0x5741('0x85')]=_0x5c249b[_0x5741('0x5e')][_0x5741('0x85')];_0x27db70['body'][_0x5741('0x5e')]=_0x5c249b['body']['message'];_0x27db70['body'][_0x5741('0x88')]=_0x5c249b[_0x5741('0x5e')][_0x5741('0x9a')];break;}}if(_0x27db70[_0x5741('0x5e')]['id']){delete _0x27db70[_0x5741('0x5e')]['id'];}if(_[_0x5741('0x9b')](_0x27db70[_0x5741('0x5e')][_0x5741('0x85')])){throw new db[(_0x5741('0x80'))]['ValidationError'](_0x5741('0x9c'));}if(_[_0x5741('0x9b')](_0x27db70['body'][_0x5741('0x5e')])||_0x27db70[_0x5741('0x5e')][_0x5741('0x5e')]===''){throw new db[(_0x5741('0x80'))][(_0x5741('0x9d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5741('0x9b')](_0x27db70['body'][_0x5741('0x9e')])){throw new db[(_0x5741('0x80'))][(_0x5741('0x9d'))](_0x5741('0x9f')+_0x334eea);}if(!_[_0x5741('0xa0')](_0x334eea,_0x27db70['body'][_0x5741('0x9e')])){throw new db[(_0x5741('0x80'))][(_0x5741('0x9d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x334eea);}_0x2327f2[_0x27db70[_0x5741('0x5e')]['mapKey']]=_0x27db70[_0x5741('0x5e')][_0x5741('0x85')];return db['CmList']['find']({'where':{'id':_0x27db70['account'][_0x5741('0xa1')]},'include':[{'model':db['CmContact'],'as':_0x5741('0xa2'),'where':_0x2327f2,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x5741('0x37')](handleEntityNotFound(_0xa9ea00,null))[_0x5741('0x37')](function(_0x271b2b){if(_0x271b2b){_0x27db70[_0x5741('0xa3')]=_[_0x5741('0xa4')](_0x271b2b,[_0x5741('0xa2')]);if(_0x271b2b['Contacts'][_0x5741('0x4c')]){return _0x271b2b['Contacts'][0x0];}var _0xff6bf9=_[_0x5741('0x1b')](_0x27db70[_0x5741('0x5e')],{'firstName':_0x27db70[_0x5741('0x5e')][_0x5741('0x85')],'ListId':_0x271b2b['id']});_0xff6bf9[_0x27db70['body']['mapKey']]=_0x27db70['body'][_0x5741('0x85')];return db[_0x5741('0x7e')][_0x5741('0x5d')](_0xff6bf9,{'fields':_0x4a3c3f,'raw':!![]});}})[_0x5741('0x37')](handleEntityNotFound(_0xa9ea00,null))[_0x5741('0x37')](function(_0x86083){if(_0x86083){_0x27db70['contact']=_0x86083;var _0x10ead7={'ContactId':_0x86083['id'],'phone':_0x27db70[_0x5741('0x5e')][_0x5741('0x85')],'SmsAccountId':_0x5c249b[_0x5741('0x69')]['id']};var _0x1ca2ed={'ContactId':_0x86083['id'],'SmsAccountId':_0x5c249b[_0x5741('0x69')]['id'],'closed':![]};return db[_0x5741('0xa5')][_0x5741('0x5c')]({'where':_0x1ca2ed})[_0x5741('0x37')](function(_0x4b6ef9){if(_0x4b6ef9){return[_0x4b6ef9,![]];}return db[_0x5741('0xa5')]['create'](_0x10ead7)['then'](function(_0x1398b3){return[_0x1398b3,!![]];});});}})[_0x5741('0xa6')](function(_0xc4c518,_0x5bc6c4){_0x27db70['interaction']=_0xc4c518[_0x5741('0x60')]({'plain':!![]});_0x27db70[_0x5741('0xa7')][_0x5741('0xa8')]=![];if(_0x5bc6c4){if(_0x27db70['account'][_0x5741('0xa9')]){_0x27db70['applications'][_0x5741('0xaa')]({'id':0x0,'priority':_0x27db70[_0x5741('0x7a')][_0x5741('0x4c')]+0x1,'app':_0x5741('0xab'),'appdata':'unmanaged','interval':_0x5741('0xac')});}_0x27db70[_0x5741('0xa7')][_0x5741('0xa8')]=!![];}return db['SmsMessage'][_0x5741('0x5d')]({'phone':_0x27db70[_0x5741('0x5e')][_0x5741('0x85')],'messageId':_0x27db70[_0x5741('0x5e')][_0x5741('0x88')],'body':_0x27db70[_0x5741('0x5e')][_0x5741('0x5e')],'SmsAccountId':_0x5c249b[_0x5741('0x69')]['id'],'SmsInteractionId':_0xc4c518['id'],'direction':'in','ContactId':_0xc4c518[_0x5741('0xad')],'AttachmentId':_0x27db70[_0x5741('0x5e')][_0x5741('0xae')]});})['then'](function(_0x465ddd){_0x27db70[_0x5741('0x29')]=_0x465ddd;if(_0x27db70['interaction'][_0x5741('0xaf')]){return db[_0x5741('0xb0')][_0x5741('0x5c')]({'attributes':['id',_0x5741('0x3b')],'where':{'id':_0x27db70[_0x5741('0xa7')][_0x5741('0xaf')]}})[_0x5741('0x37')](function(_0x22b503){if(_0x22b503){_0x27db70[_0x5741('0x7a')][_0x5741('0xb1')]({'id':0x0,'priority':0x0,'app':_0x5741('0xb2'),'appdata':_0x22b503['name']+','+(_0x27db70[_0x5741('0x79')][_0x5741('0xb3')]||0xa),'interval':_0x5741('0xac')});}return respondWithRpcPromise(_0x5741('0xb4'),'startRouting',_0x27db70);});}return respondWithRpcPromise(_0x5741('0xb4'),_0x5741('0xb5'),_0x27db70);})[_0x5741('0x37')](function(_0xcb6977){if(_0xcb6977){var _0x406c09=0xc8;var _0xecadc4=_0x5741('0xb6');logger[_0x5741('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xecadc4,_0x406c09,_0x5741('0xb7'));logger[_0x5741('0x25')](_0x5741('0xb8'),_0xecadc4,_0x406c09,'entity\x20found',JSON[_0x5741('0x26')](_0xcb6977));if(_0x27db70['account'][_0x5741('0x43')]===_0x5741('0xb9')){return _0xa9ea00[_0x5741('0x2d')](_0x406c09)[_0x5741('0x31')](_0x5741('0xba'),_0x5741('0xbb'))[_0x5741('0x3c')](_0x5741('0xbc'));}else{return _0xa9ea00[_0x5741('0x2d')](_0x406c09)[_0x5741('0x32')](_0xcb6977);}}})['catch'](handleError(_0xa9ea00,null));};exports[_0x5741('0xbd')]=function(_0x361ee0,_0x5b3c32){var _0x5f68de=_0x361ee0[_0x5741('0x69')]['id'];var _0x2937b2=_0x361ee0[_0x5741('0x5e')];var _0x23c58d=0xc8;var _0x85ab89=null;return db['sequelize'][_0x5741('0xbe')]({'isolationLevel':db[_0x5741('0xbf')][_0x5741('0xc0')][_0x5741('0xc1')][_0x5741('0xc2')]},function(_0x5573cd){return db[_0x5741('0x40')][_0x5741('0x73')]({'where':{'id':_0x5f68de},'transaction':_0x5573cd})[_0x5741('0x37')](function(_0x5a744e){if(_0x5a744e){return db[_0x5741('0x77')]['destroy']({'where':{'SmsAccountId':_0x5f68de},'transaction':_0x5573cd})[_0x5741('0x37')](function(){var _0x560aba=_[_0x5741('0x3f')](_0x2937b2,function(_0x39e7bc){_0x39e7bc['SmsAccountId']=_0x5f68de;return _0x39e7bc;});return db[_0x5741('0x77')][_0x5741('0xc3')](_0x560aba,{'transaction':_0x5573cd});});}else{_0x23c58d=0x194;_0x85ab89=[];}});})['then'](function(){if(_0x23c58d!==0x194){return db[_0x5741('0x77')]['findAndCountAll']({'where':{'SmsAccountId':_0x5f68de},'order':_0x5741('0x7c')})[_0x5741('0x37')](function(_0xe9d9f5){_0x85ab89=_0xe9d9f5;});}})[_0x5741('0x2b')](function(_0x5367eb){_0x23c58d=0x1f4;logger['error'](_0x5367eb[_0x5741('0x3a')]);if(_0x5367eb['name']){delete _0x5367eb[_0x5741('0x3b')];}_0x85ab89=_0x5367eb;})['finally'](function(){if(_0x85ab89===null){_0x5b3c32[_0x5741('0x2c')](_0x23c58d);}else{if(_0x23c58d===0x1f4){_0x5b3c32[_0x5741('0x2d')](_0x23c58d)['send'](_0x85ab89);}else{_0x5b3c32['status'](_0x23c58d)[_0x5741('0x32')](_0x85ab89);}}});};exports['getApplications']=function(_0x313395,_0x430940,_0xfcaf51){var _0x242d33={};var _0x43e005={};var _0x3cdcf7;var _0x33a6d1;return db[_0x5741('0x40')]['findOne']({'where':{'id':_0x313395[_0x5741('0x69')]['id']}})['then'](handleEntityNotFound(_0x430940,null))[_0x5741('0x37')](function(_0x1205da){if(_0x1205da){_0x3cdcf7=_0x1205da;_0x43e005[_0x5741('0x49')]=_['keys'](db[_0x5741('0x77')][_0x5741('0x41')]);_0x43e005[_0x5741('0x45')]=_[_0x5741('0x46')](_0x313395[_0x5741('0x45')]);_0x43e005[_0x5741('0x47')]=_[_0x5741('0x48')](_0x43e005[_0x5741('0x49')],_0x43e005[_0x5741('0x45')]);_0x242d33[_0x5741('0x4a')]=_[_0x5741('0x48')](_0x43e005[_0x5741('0x49')],qs[_0x5741('0x4b')](_0x313395[_0x5741('0x45')]['fields']));_0x242d33['attributes']=_0x242d33[_0x5741('0x4a')][_0x5741('0x4c')]?_0x242d33[_0x5741('0x4a')]:_0x43e005[_0x5741('0x49')];_0x242d33['order']=qs[_0x5741('0x51')](_0x313395[_0x5741('0x45')]['sort']);_0x242d33[_0x5741('0x52')]=qs['filters'](_[_0x5741('0x53')](_0x313395['query'],_0x43e005[_0x5741('0x47')]));if(_0x313395[_0x5741('0x45')][_0x5741('0x55')]){_0x242d33[_0x5741('0x52')]=_[_0x5741('0x54')](_0x242d33[_0x5741('0x52')],{'$or':_[_0x5741('0x3f')](_0x242d33[_0x5741('0x4a')],function(_0x24651e){var _0x126aad={};_0x126aad[_0x24651e]={'$like':'%'+_0x313395['query'][_0x5741('0x55')]+'%'};return _0x126aad;})});}_0x242d33=_[_0x5741('0x54')]({},_0x242d33,_0x313395[_0x5741('0x5b')]);return _0x3cdcf7[_0x5741('0xc4')](_0x242d33);}})['then'](function(_0x1bdd95){if(_0x1bdd95){_0x33a6d1=_0x1bdd95['length'];if(!_0x313395[_0x5741('0x45')][_0x5741('0x4d')]('nolimit')){_0x242d33[_0x5741('0x2f')]=qs[_0x5741('0x2f')](_0x313395[_0x5741('0x45')][_0x5741('0x2f')]);_0x242d33[_0x5741('0x4f')]=qs['offset'](_0x313395[_0x5741('0x45')][_0x5741('0x4f')]);}return _0x3cdcf7[_0x5741('0xc4')](_0x242d33);}})['then'](function(_0x25f2e8){if(_0x25f2e8){return _0x25f2e8?{'count':_0x33a6d1,'rows':_0x25f2e8}:null;}})[_0x5741('0x37')](respondWithResult(_0x430940,null))[_0x5741('0x2b')](handleError(_0x430940,null));};exports[_0x5741('0xc5')]=function(_0xfa232a,_0xa657c5,_0x31742d){var _0x41ae05={'raw':![],'where':{}};var _0xe27b3d={};var _0x55f621={'count':0x0,'rows':[]};return db[_0x5741('0x40')][_0x5741('0x73')]({'where':{'id':_0xfa232a[_0x5741('0x69')]['id']}})[_0x5741('0x37')](handleEntityNotFound(_0xa657c5,null))[_0x5741('0x37')](function(_0x470b8e){if(_0x470b8e){_0xe27b3d[_0x5741('0x49')]=_[_0x5741('0x46')](db['SmsInteraction'][_0x5741('0x41')]);_0xe27b3d['query']=_[_0x5741('0x46')](_0xfa232a[_0x5741('0x45')]);_0xe27b3d[_0x5741('0x47')]=_[_0x5741('0x48')](_0xe27b3d[_0x5741('0x49')],_0xe27b3d[_0x5741('0x45')]);_0x41ae05[_0x5741('0x4a')]=_[_0x5741('0x48')](_0xe27b3d['model'],qs[_0x5741('0x4b')](_0xfa232a[_0x5741('0x45')][_0x5741('0x4b')]));_0x41ae05[_0x5741('0x4a')]=_0x41ae05[_0x5741('0x4a')][_0x5741('0x4c')]?_0x41ae05[_0x5741('0x4a')]:_0xe27b3d[_0x5741('0x49')];if(!_0xfa232a[_0x5741('0x45')][_0x5741('0x4d')](_0x5741('0x4e'))){_0x41ae05['limit']=qs[_0x5741('0x2f')](_0xfa232a[_0x5741('0x45')][_0x5741('0x2f')]);_0x41ae05[_0x5741('0x4f')]=qs[_0x5741('0x4f')](_0xfa232a[_0x5741('0x45')][_0x5741('0x4f')]);}_0x41ae05[_0x5741('0x50')]=qs[_0x5741('0x51')](_0xfa232a['query'][_0x5741('0x51')]);_0x41ae05[_0x5741('0x52')]=qs[_0x5741('0x47')](_[_0x5741('0x53')](_0xfa232a[_0x5741('0x45')],_0xe27b3d[_0x5741('0x47')]));_0x41ae05[_0x5741('0x52')][_0x5741('0x70')]=_0x470b8e['id'];if(_0xfa232a[_0x5741('0x45')][_0x5741('0x55')]){_0x41ae05[_0x5741('0x52')]=_[_0x5741('0x54')](_0x41ae05[_0x5741('0x52')],{'$or':_[_0x5741('0x3f')](_0x41ae05[_0x5741('0x4a')],function(_0x51046d){var _0x15ae2e={};_0x15ae2e[_0x51046d]={'$like':'%'+_0xfa232a[_0x5741('0x45')][_0x5741('0x55')]+'%'};return _0x15ae2e;})});}_0x41ae05=_[_0x5741('0x54')]({},_0x41ae05,_0xfa232a[_0x5741('0x5b')]);return db[_0x5741('0xa5')][_0x5741('0x30')]({'where':_0x41ae05[_0x5741('0x52')]})['then'](function(_0x1e479c){_0x55f621[_0x5741('0x30')]=_0x1e479c;if(_0xfa232a[_0x5741('0x45')]['includeAll']){_0x41ae05[_0x5741('0x57')]=[{'model':db['CmContact'],'as':_0x5741('0xc6'),'required':![]},{'model':db['User'],'as':_0x5741('0xc7'),'attributes':[_0x5741('0x3b'),'fullname',_0x5741('0xc8')],'required':![]},{'model':db[_0x5741('0xc9')],'as':_0x5741('0xca'),'attributes':['id','name','color'],'where':_0xfa232a[_0x5741('0x45')]['tag']?{'id':_0xfa232a[_0x5741('0x45')][_0x5741('0xcb')]}:undefined,'required':_0xfa232a[_0x5741('0x45')][_0x5741('0xcb')]?!![]:![]}];}return db[_0x5741('0xa5')]['findAll'](_0x41ae05);})['then'](function(_0x36a034){_0x55f621[_0x5741('0x58')]=_0x36a034;return _0x55f621;});}})[_0x5741('0x37')](respondWithFilteredResult(_0xa657c5,_0x41ae05))[_0x5741('0x2b')](handleError(_0xa657c5,null));};exports[_0x5741('0x3c')]=function(_0x5de4b9,_0x578dca,_0x341107){var _0x5ce90e,_0x502ea7,_0x345963;if(_['isNil'](_0x5de4b9[_0x5741('0x5e')]['body'])||_0x5de4b9[_0x5741('0x5e')][_0x5741('0x5e')]===''){throw new db[(_0x5741('0x80'))][(_0x5741('0x9d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5741('0x9b')](_0x5de4b9[_0x5741('0x5e')]['to'])){throw new db[(_0x5741('0x80'))][(_0x5741('0x9d'))](_0x5741('0xcc'));}_0x5ce90e=_0x5de4b9['body']['to'];return db[_0x5741('0x40')][_0x5741('0x5c')]({'where':{'id':_0x5de4b9[_0x5741('0x69')]['id']},'include':[{'model':db[_0x5741('0xcd')],'as':_0x5741('0xce'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x5ce90e},'limit':0x1,'order':[[_0x5741('0x82'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x578dca,null))[_0x5741('0x37')](function(_0x3e8d99){if(_0x3e8d99&&_0x3e8d99[_0x5741('0xce')]){_0x502ea7=_0x3e8d99[_0x5741('0x60')]({'plain':!![]});if(_0x502ea7['List']&&_0x502ea7[_0x5741('0xce')][_0x5741('0xa2')][_0x5741('0x4c')]){return _0x502ea7[_0x5741('0xce')][_0x5741('0xa2')][0x0];}return db[_0x5741('0x7e')][_0x5741('0x5d')](_[_0x5741('0x1b')](_0x5de4b9['body'],{'firstName':_0x5ce90e,'mobile':_0x5ce90e,'phone':_0x5ce90e,'ListId':_0x502ea7[_0x5741('0xa1')]}));}})['then'](handleEntityNotFound(_0x578dca,null))[_0x5741('0x37')](function(_0x2db816){if(_0x2db816){_0x345963=_0x2db816;return db[_0x5741('0xa5')][_0x5741('0x5c')]({'where':{'ContactId':_0x345963['id'],'closed':![],'SmsAccountId':_0x502ea7['id']}})[_0x5741('0x37')](function(_0x3296f6){if(_0x3296f6){return[_0x3296f6,![]];}return db[_0x5741('0xa5')][_0x5741('0x5d')]({'UserId':_0x5de4b9[_0x5741('0x5f')]['id'],'ContactId':_0x345963['id'],'SmsAccountId':_0x502ea7['id'],'phone':_0x5ce90e,'firstMsgDirection':_0x5741('0xcf'),'Messages':[_['merge'](_0x5de4b9[_0x5741('0x5e')],{'read':![],'body':_0x5de4b9[_0x5741('0x5e')][_0x5741('0x5e')],'phone':_0x5ce90e,'SmsAccountId':_0x502ea7['id'],'UserId':_0x5de4b9[_0x5741('0x5f')]['id'],'ContactId':_0x345963['id']})]},{'include':[{'model':db[_0x5741('0xd0')],'as':_0x5741('0xd1')}]})[_0x5741('0x37')](function(_0x5a7509){return[_0x5a7509,!![]];});});}})[_0x5741('0xa6')](function(_0x187155,_0x2b0d14){if(_0x2b0d14){return _0x187155;}return db[_0x5741('0xd0')][_0x5741('0x5d')](_[_0x5741('0x54')](_0x5de4b9[_0x5741('0x5e')],{'read':![],'body':_0x5de4b9['body'][_0x5741('0x5e')],'phone':_0x5ce90e,'SmsAccountId':_0x502ea7['id'],'SmsInteractionId':_0x187155['id'],'UserId':_0x5de4b9[_0x5741('0x5f')]['id'],'ContactId':_0x345963['id']}))[_0x5741('0x37')](function(_0x4332d7){_0x187155[_0x5741('0xd2')][_0x5741('0xd1')]=[];_0x187155['dataValues'][_0x5741('0xd1')][_0x5741('0xaa')](_0x4332d7['dataValues']);return _0x187155;});})[_0x5741('0x37')](respondWithResult(_0x578dca,null))[_0x5741('0x2b')](handleError(_0x578dca,null));};exports[_0x5741('0x2d')]=function(_0x443c0f,_0x17b8f7,_0x41ebab){if(_0x443c0f['body']['id']){delete _0x443c0f[_0x5741('0x5e')]['id'];}var _0x1920f8,_0x588135,_0x3094ba;return db['SmsAccount'][_0x5741('0x5c')]({'where':{'id':_0x443c0f[_0x5741('0x69')]['id']}})['then'](handleEntityNotFound(_0x17b8f7,null))['then'](function(_0x401fe8){if(_0x401fe8){_0x3094ba=_0x401fe8;logger[_0x5741('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5741('0x2d'),_0x5741('0xd3'),_0x401fe8['type'],util[_0x5741('0xd4')](_0x443c0f[_0x5741('0x5e')],{'showHidden':![],'depth':null}));switch(_0x401fe8[_0x5741('0x43')]){case _0x5741('0x8a'):if(_0x443c0f[_0x5741('0x5e')][_0x5741('0xd5')]&&_0x443c0f[_0x5741('0x5e')][_0x5741('0x2d')]){_0x588135=_0x443c0f[_0x5741('0x5e')]['status'];return db[_0x5741('0xd0')][_0x5741('0x5c')]({'where':{'messageId':_0x443c0f[_0x5741('0x5e')][_0x5741('0xd5')]}});}break;case _0x5741('0x8b'):if(_0x443c0f[_0x5741('0x5e')][_0x5741('0xd6')]&&_0x443c0f['body'][_0x5741('0xd7')]){_0x588135=_0x443c0f['body'][_0x5741('0xd7')];return db[_0x5741('0xd0')]['find']({'where':{'messageId':_0x443c0f[_0x5741('0x5e')]['requestid']}});}break;case _0x5741('0x8c'):if(_0x443c0f[_0x5741('0x5e')][_0x5741('0x8d')]&&_0x443c0f['body'][_0x5741('0xd8')]){_0x588135=_0x443c0f[_0x5741('0x5e')][_0x5741('0xd8')];return db['SmsMessage'][_0x5741('0x5c')]({'where':{'messageId':_0x443c0f['body'][_0x5741('0x8d')]}});}break;case _0x5741('0xd9'):var _0x323ca6=_0x443c0f[_0x5741('0x5e')]['results'][0x0];if(_0x323ca6[_0x5741('0x88')]&&_0x323ca6[_0x5741('0x2d')][_0x5741('0xda')]===_0x5741('0xdb')){_0x588135=_0x323ca6['status']['groupName'];return db['SmsMessage'][_0x5741('0x5c')]({'where':{'messageId':_0x323ca6[_0x5741('0x88')]}});}break;case _0x5741('0x94'):if(_0x443c0f[_0x5741('0x5e')][_0x5741('0x88')]&&_0x443c0f[_0x5741('0x5e')][_0x5741('0x2d')]){_0x588135=_0x443c0f['body']['status'];return db[_0x5741('0xd0')]['find']({'where':{'messageId':_0x443c0f[_0x5741('0x5e')][_0x5741('0x88')]}});}break;case _0x5741('0x98'):if(_0x443c0f['body'][0x0]['message']['id']){_0x588135=_0x443c0f['body'][0x0][_0x5741('0x43')];return db['SmsMessage'][_0x5741('0x5c')]({'where':{'messageId':_0x443c0f[_0x5741('0x5e')][0x0]['message']['id']}});}break;case _0x5741('0x99'):if(_0x443c0f['body'][_0x5741('0xdc')]&&_0x443c0f['body'][_0x5741('0x2d')]){_0x588135=_0x443c0f['body'][_0x5741('0x2d')];return db[_0x5741('0xd0')]['find']({'where':{'messageId':_0x443c0f['body']['redif']}});}break;}}})[_0x5741('0x37')](handleEntityNotFound(_0x17b8f7,null))[_0x5741('0x37')](function(_0x9cce72){if(_0x9cce72){_0x1920f8=_0x9cce72;switch(_0x3094ba[_0x5741('0x43')]){case'skebby':if(_0x588135===_0x5741('0xdb')){return _0x1920f8['update']({'read':!![]});}else{logger[_0x5741('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5741('0x2d'),'skebby',util[_0x5741('0xd4')](_0x443c0f[_0x5741('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x5741('0x8b'):if(_0x588135==='1'){return _0x1920f8[_0x5741('0x36')]({'read':!![]});}else{logger[_0x5741('0x27')](_0x5741('0xdd'),_0x5741('0x2d'),'skebby',util[_0x5741('0xd4')](_0x443c0f[_0x5741('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x5741('0x8c'):if(!_0x443c0f[_0x5741('0x5e')][_0x5741('0xde')]&&_0x588135>=0xc8&&_0x588135<=0xce){return _0x1920f8[_0x5741('0x36')]({'read':!![]});}else{logger[_0x5741('0x27')](_0x5741('0xdd'),_0x5741('0x2d'),_0x5741('0x8c'),util[_0x5741('0xd4')](_0x443c0f['body'],{'showHidden':![],'depth':null}));}break;case _0x5741('0xd9'):var _0x31c5d9=_0x443c0f[_0x5741('0x5e')]['results'][0x0];if(_0x31c5d9[_0x5741('0x2d')][_0x5741('0xda')]==='DELIVERED'){return _0x1920f8['update']({'read':!![]});}else{logger[_0x5741('0x27')](_0x5741('0xdd'),_0x5741('0x2d'),'infobip',util['inspect'](_0x443c0f[_0x5741('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x5741('0x94'):if(_0x588135==_0x5741('0xdf')||_0x588135==_0x5741('0xe0')){return _0x1920f8['update']({'read':!![]});}else{logger[_0x5741('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5741('0x2d'),_0x5741('0x94'),util[_0x5741('0xd4')](_0x443c0f[_0x5741('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x5741('0x98'):if(_0x588135=='message-delivered'){return _0x1920f8['update']({'read':!![]});}else{logger[_0x5741('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5741('0x2d'),_0x5741('0x98'),util[_0x5741('0xd4')](_0x443c0f[_0x5741('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x5741('0x99'):if(_0x588135===_0x5741('0xe1')||_0x588135===_0x5741('0xe2')){return _0x1920f8[_0x5741('0x36')]({'read':!![]});}else{logger['error'](_0x5741('0xdd'),_0x5741('0x2d'),_0x5741('0x99'),util['inspect'](_0x443c0f[_0x5741('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x1920f8;}})[_0x5741('0x37')](respondWithResult(_0x17b8f7,null))['catch'](handleError(_0x17b8f7,null));};exports[_0x5741('0xe3')]=function(_0x1798b7,_0x2e1de9,_0x3c5805){var _0x17aabc,_0xed42a8,_0x1dccda;return db[_0x5741('0x40')][_0x5741('0x5c')]({'where':{'id':_0x1798b7[_0x5741('0x69')]['id']}})[_0x5741('0x37')](handleEntityNotFound(_0x2e1de9,null))[_0x5741('0x37')](function(_0x139768){if(_0x139768){_0x1dccda=_0x139768;logger['debug'](_0x5741('0xdd'),_0x5741('0x2d'),_0x5741('0xd3'),_0x139768['type'],util[_0x5741('0xd4')](_0x1798b7[_0x5741('0x45')],{'showHidden':![],'depth':null}));switch(_0x139768[_0x5741('0x43')]){case'csc':if(_0x1798b7[_0x5741('0x45')]['message-id']&&_0x1798b7[_0x5741('0x45')][_0x5741('0xe4')]){_0xed42a8=_0x1798b7[_0x5741('0x45')][_0x5741('0xe4')];return db['SmsMessage'][_0x5741('0x5c')]({'where':{'messageId':_0x1798b7['query'][_0x5741('0xe5')]}});}break;}}})[_0x5741('0x37')](handleEntityNotFound(_0x2e1de9,null))[_0x5741('0x37')](function(_0x335d88){if(_0x335d88){_0x17aabc=_0x335d88;switch(_0x1dccda['type']){case _0x5741('0xe6'):if(_0xed42a8==='2'||_0xed42a8==='6'){return _0x17aabc[_0x5741('0x36')]({'read':!![]});}else{logger[_0x5741('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x5741('0xe6'),util[_0x5741('0xd4')](_0x1798b7['query'],{'showHidden':![],'depth':null}));};break;}return _0x17aabc;}})[_0x5741('0x37')](respondWithResult(_0x2e1de9,null))['catch'](handleError(_0x2e1de9,null));};exports[_0x5741('0xe7')]=function(_0x3ef244,_0x2dd571,_0x264371){return db[_0x5741('0x40')][_0x5741('0x5c')]({'where':{'id':_0x3ef244[_0x5741('0x69')]['id']}})[_0x5741('0x37')](handleEntityNotFound(_0x2dd571,null))[_0x5741('0x37')](function(_0x4cce9d){if(_0x4cce9d){return _0x4cce9d[_0x5741('0xe7')](_0x3ef244[_0x5741('0x5e')]['ids'],_[_0x5741('0xa4')](_0x3ef244[_0x5741('0x5e')],[_0x5741('0x6e'),'id'])||{})[_0x5741('0xa6')](function(_0x2e826c){for(var _0x4f86e6=0x0;_0x4f86e6<_0x3ef244[_0x5741('0x5e')][_0x5741('0x6e')]['length'];_0x4f86e6+=0x1){socket[_0x5741('0xe8')](_0x5741('0xe9'),{'UserId':Number(_0x3ef244[_0x5741('0x5e')][_0x5741('0x6e')][_0x4f86e6]),'SmsAccountId':Number(_0x3ef244[_0x5741('0x69')]['id'])});}return _0x2e826c;});}})[_0x5741('0x37')](respondWithResult(_0x2dd571,null))[_0x5741('0x2b')](handleError(_0x2dd571,null));};exports['removeAgents']=function(_0x4ae3c3,_0x4732e7,_0x3db7e3){return db[_0x5741('0x40')][_0x5741('0x5c')]({'where':{'id':_0x4ae3c3[_0x5741('0x69')]['id']}})[_0x5741('0x37')](handleEntityNotFound(_0x4732e7,null))['then'](function(_0x1b5249){if(_0x1b5249){return _0x1b5249[_0x5741('0xea')](_0x4ae3c3[_0x5741('0x45')][_0x5741('0x6e')])['then'](function(){if(_[_0x5741('0xeb')](_0x4ae3c3[_0x5741('0x45')]['ids'])){for(var _0xcf550b=0x0;_0xcf550b<_0x4ae3c3['query']['ids'][_0x5741('0x4c')];_0xcf550b+=0x1){socket['emit'](_0x5741('0xec'),{'UserId':Number(_0x4ae3c3['query'][_0x5741('0x6e')][_0xcf550b]),'SmsAccountId':Number(_0x4ae3c3[_0x5741('0x69')]['id'])});}}else{socket[_0x5741('0xe8')](_0x5741('0xec'),{'UserId':Number(_0x4ae3c3[_0x5741('0x45')][_0x5741('0x6e')]),'SmsAccountId':Number(_0x4ae3c3['params']['id'])});}});}})[_0x5741('0x37')](respondWithStatusCode(_0x4732e7,null))[_0x5741('0x2b')](handleError(_0x4732e7,null));};exports['getAgents']=function(_0x1f4e1a,_0x4e9da6,_0x438434){var _0x264a9c={};var _0x57a406={};var _0x3ad8d3;var _0x5b79f9;return db['SmsAccount'][_0x5741('0x73')]({'where':{'id':_0x1f4e1a['params']['id']}})[_0x5741('0x37')](handleEntityNotFound(_0x4e9da6,null))['then'](function(_0x52ec23){if(_0x52ec23){_0x3ad8d3=_0x52ec23;_0x57a406['model']=_['keys'](db[_0x5741('0xb0')][_0x5741('0x41')]);_0x57a406[_0x5741('0x45')]=_[_0x5741('0x46')](_0x1f4e1a[_0x5741('0x45')]);_0x57a406[_0x5741('0x47')]=_[_0x5741('0x48')](_0x57a406['model'],_0x57a406['query']);_0x264a9c[_0x5741('0x4a')]=_['intersection'](_0x57a406[_0x5741('0x49')],qs[_0x5741('0x4b')](_0x1f4e1a[_0x5741('0x45')]['fields']));_0x264a9c['attributes']=_0x264a9c[_0x5741('0x4a')][_0x5741('0x4c')]?_0x264a9c[_0x5741('0x4a')]:_0x57a406['model'];_0x264a9c[_0x5741('0x50')]=qs['sort'](_0x1f4e1a[_0x5741('0x45')][_0x5741('0x51')]);_0x264a9c[_0x5741('0x52')]=qs[_0x5741('0x47')](_['pick'](_0x1f4e1a['query'],_0x57a406[_0x5741('0x47')]));if(_0x1f4e1a['query'][_0x5741('0x55')]){_0x264a9c[_0x5741('0x52')]=_[_0x5741('0x54')](_0x264a9c['where'],{'$or':_[_0x5741('0x3f')](_0x264a9c[_0x5741('0x4a')],function(_0x3be204){var _0xac779f={};_0xac779f[_0x3be204]={'$like':'%'+_0x1f4e1a['query'][_0x5741('0x55')]+'%'};return _0xac779f;})});}_0x264a9c=_['merge']({},_0x264a9c,_0x1f4e1a[_0x5741('0x5b')]);return _0x3ad8d3[_0x5741('0xed')](_0x264a9c);}})[_0x5741('0x37')](function(_0x2d26d4){if(_0x2d26d4){_0x5b79f9=_0x2d26d4[_0x5741('0x4c')];if(!_0x1f4e1a[_0x5741('0x45')]['hasOwnProperty'](_0x5741('0x4e'))){_0x264a9c[_0x5741('0x2f')]=qs[_0x5741('0x2f')](_0x1f4e1a[_0x5741('0x45')][_0x5741('0x2f')]);_0x264a9c[_0x5741('0x4f')]=qs['offset'](_0x1f4e1a[_0x5741('0x45')][_0x5741('0x4f')]);}return _0x3ad8d3[_0x5741('0xed')](_0x264a9c);}})[_0x5741('0x37')](function(_0x282931){if(_0x282931){return _0x282931?{'count':_0x5b79f9,'rows':_0x282931}:null;}})[_0x5741('0x37')](respondWithResult(_0x4e9da6,null))[_0x5741('0x2b')](handleError(_0x4e9da6,null));};
\ No newline at end of file
+var _0xea13=['close','unmanaged','*,*,*,*','SmsMessage','AttachmentId','User','UserId','unshift','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','List','Messages','spread','dataValues','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','bandwidth','redif','inspect','clicksend','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','intelepeer','DELIVRD','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','fs-extra','crypto','jsforce','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./smsAccount.socket','register','jayson/promise','client','then','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','destroy','get','SmsAccounts','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','describe','addDisposition','SmsAccountId','Disposition','findOne','removeDispositions','addAnswer','CannedAnswer','ids','notify','SmsApplication','Applications','account','applications','orderBy','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','messageId','MessageSid','skebby','sender','text','connectel','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','omit','contact','SmsInteraction','interaction','created'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xea13,0x1e5));var _0x3ea1=function(_0x3add8f,_0x2c76f9){_0x3add8f=_0x3add8f-0x0;var _0x386b13=_0xea13[_0x3add8f];return _0x386b13;};'use strict';var emlformat=require(_0x3ea1('0x0'));var rimraf=require(_0x3ea1('0x1'));var zipdir=require(_0x3ea1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3ea1('0x3'));var Mustache=require(_0x3ea1('0x4'));var util=require(_0x3ea1('0x5'));var path=require(_0x3ea1('0x6'));var sox=require(_0x3ea1('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ea1('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3ea1('0x9'));var jsforce=require(_0x3ea1('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3ea1('0xb'));var hardwareService=require(_0x3ea1('0xc'));var logger=require(_0x3ea1('0xd'))('api');var utils=require(_0x3ea1('0xe'));var config=require('../../config/environment');var licenseUtil=require(_0x3ea1('0xf'));var db=require(_0x3ea1('0x10'))['db'];config[_0x3ea1('0x11')]=_[_0x3ea1('0x12')](config[_0x3ea1('0x11')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3ea1('0x11')]));require(_0x3ea1('0x13'))[_0x3ea1('0x14')](socket);var jayson=require(_0x3ea1('0x15'));var client=jayson[_0x3ea1('0x16')]['http']({'port':0x232c});function respondWithRpcPromise(_0x296bdf,_0x104851,_0x46a416,_0x28fd1f){return new BPromise(function(_0x1637c1,_0x365bbb){var _0x316007=_0x28fd1f||client;return _0x316007['request'](_0x296bdf,_0x46a416)[_0x3ea1('0x17')](function(_0x19694c){logger['info'](_0x3ea1('0x18'),_0x104851,'request\x20sent');logger[_0x3ea1('0x19')](_0x3ea1('0x1a'),_0x104851,_0x3ea1('0x1b'),JSON[_0x3ea1('0x1c')](_0x19694c));if(_0x19694c[_0x3ea1('0x1d')]){if(_0x19694c['error'][_0x3ea1('0x1e')]===0x1f4){logger[_0x3ea1('0x1d')](_0x3ea1('0x18'),_0x104851,_0x19694c[_0x3ea1('0x1d')][_0x3ea1('0x1f')]);return _0x365bbb(_0x19694c[_0x3ea1('0x1d')][_0x3ea1('0x1f')]);}logger[_0x3ea1('0x1d')]('SmsAccount,\x20%s,\x20%s',_0x104851,_0x19694c['error'][_0x3ea1('0x1f')]);return _0x1637c1(_0x19694c[_0x3ea1('0x1d')][_0x3ea1('0x1f')]);}else{logger[_0x3ea1('0x20')](_0x3ea1('0x18'),_0x104851,_0x3ea1('0x1b'));_0x1637c1(_0x19694c[_0x3ea1('0x21')][_0x3ea1('0x1f')]);}})[_0x3ea1('0x22')](function(_0x2bd256){logger[_0x3ea1('0x1d')](_0x3ea1('0x18'),_0x104851,_0x2bd256);_0x365bbb(_0x2bd256);});});}function respondWithStatusCode(_0x5092e3,_0x7f94f7){_0x7f94f7=_0x7f94f7||0xcc;return function(_0x44ac31){if(_0x44ac31){return _0x5092e3[_0x3ea1('0x23')](_0x7f94f7);}return _0x5092e3[_0x3ea1('0x24')](_0x7f94f7)['end']();};}function respondWithResult(_0x20cd56,_0x15b785){_0x15b785=_0x15b785||0xc8;return function(_0x547cbc){if(_0x547cbc){return _0x20cd56[_0x3ea1('0x24')](_0x15b785)[_0x3ea1('0x25')](_0x547cbc);}};}function respondWithFilteredResult(_0x57dc71,_0xf58088){return function(_0x5a6696){if(_0x5a6696){var _0x15f975=typeof _0xf58088[_0x3ea1('0x26')]==='undefined'&&typeof _0xf58088[_0x3ea1('0x27')]===_0x3ea1('0x28');var _0xa80b32=_0x5a6696['count'];var _0x163aad=_0x15f975?0x0:_0xf58088[_0x3ea1('0x26')];var _0x14fb2d=_0x15f975?_0x5a6696[_0x3ea1('0x29')]:_0xf58088[_0x3ea1('0x26')]+_0xf58088['limit'];var _0x23b291;if(_0x14fb2d>=_0xa80b32){_0x14fb2d=_0xa80b32;_0x23b291=0xc8;}else{_0x23b291=0xce;}_0x57dc71['status'](_0x23b291);return _0x57dc71[_0x3ea1('0x2a')](_0x3ea1('0x2b'),_0x163aad+'-'+_0x14fb2d+'/'+_0xa80b32)[_0x3ea1('0x25')](_0x5a6696);}return null;};}function patchUpdates(_0x7f62d9){return function(_0x6010c3){try{jsonpatch[_0x3ea1('0x2c')](_0x6010c3,_0x7f62d9,!![]);}catch(_0x383faa){return BPromise[_0x3ea1('0x2d')](_0x383faa);}return _0x6010c3['save']();};}function saveUpdates(_0x2e5e5f,_0x378e7c){return function(_0x48f2b0){if(_0x48f2b0){return _0x48f2b0['update'](_0x2e5e5f)[_0x3ea1('0x17')](function(_0x154acf){return _0x154acf;});}return null;};}function removeEntity(_0x593462,_0x1f5f44){return function(_0x415777){if(_0x415777){return _0x415777[_0x3ea1('0x2e')]()[_0x3ea1('0x17')](function(){var _0x2d2078=_0x415777[_0x3ea1('0x2f')]({'plain':!![]});var _0x58bead=_0x3ea1('0x30');return db[_0x3ea1('0x31')]['destroy']({'where':{'type':_0x58bead,'resourceId':_0x2d2078['id']}})[_0x3ea1('0x17')](function(){return _0x415777;});})['then'](function(){_0x593462[_0x3ea1('0x24')](0xcc)[_0x3ea1('0x32')]();});}};}function handleEntityNotFound(_0x5816a7,_0x225ace){return function(_0x4e1ea0){if(!_0x4e1ea0){_0x5816a7[_0x3ea1('0x23')](0x194);}return _0x4e1ea0;};}function handleError(_0x1cfa6a,_0x49da9c){_0x49da9c=_0x49da9c||0x1f4;return function(_0x57d58f){logger[_0x3ea1('0x1d')](_0x57d58f[_0x3ea1('0x33')]);if(_0x57d58f[_0x3ea1('0x34')]){delete _0x57d58f[_0x3ea1('0x34')];}_0x1cfa6a[_0x3ea1('0x24')](_0x49da9c)[_0x3ea1('0x35')](_0x57d58f);};}exports[_0x3ea1('0x36')]=function(_0x5ea02a,_0x4e70a3){var _0x3303cf={'include':[{'model':db[_0x3ea1('0x37')],'as':_0x3ea1('0x38')}]},_0x3246e9={},_0x6cdbfe={'count':0x0,'rows':[]};var _0x56fc04=_['map'](db[_0x3ea1('0x39')][_0x3ea1('0x3a')],function(_0x3463ff){return{'name':_0x3463ff[_0x3ea1('0x3b')],'type':_0x3463ff['type'][_0x3ea1('0x3c')]};});_0x3246e9[_0x3ea1('0x3d')]=_[_0x3ea1('0x3e')](_0x56fc04,'name');_0x3246e9[_0x3ea1('0x3f')]=_[_0x3ea1('0x40')](_0x5ea02a['query']);_0x3246e9[_0x3ea1('0x41')]=_[_0x3ea1('0x42')](_0x3246e9[_0x3ea1('0x3d')],_0x3246e9[_0x3ea1('0x3f')]);_0x3303cf['attributes']=_['intersection'](_0x3246e9[_0x3ea1('0x3d')],qs[_0x3ea1('0x43')](_0x5ea02a[_0x3ea1('0x3f')][_0x3ea1('0x43')]));_0x3303cf[_0x3ea1('0x44')]=_0x3303cf[_0x3ea1('0x44')][_0x3ea1('0x45')]?_0x3303cf[_0x3ea1('0x44')]:_0x3246e9['model'];if(!_0x5ea02a[_0x3ea1('0x3f')][_0x3ea1('0x46')](_0x3ea1('0x47'))){_0x3303cf[_0x3ea1('0x27')]=qs[_0x3ea1('0x27')](_0x5ea02a['query'][_0x3ea1('0x27')]);_0x3303cf['offset']=qs[_0x3ea1('0x26')](_0x5ea02a[_0x3ea1('0x3f')]['offset']);}_0x3303cf[_0x3ea1('0x48')]=qs[_0x3ea1('0x49')](_0x5ea02a[_0x3ea1('0x3f')][_0x3ea1('0x49')]);_0x3303cf[_0x3ea1('0x4a')]=qs[_0x3ea1('0x41')](_[_0x3ea1('0x4b')](_0x5ea02a['query'],_0x3246e9[_0x3ea1('0x41')]),_0x56fc04);if(_0x5ea02a[_0x3ea1('0x3f')][_0x3ea1('0x4c')]){_0x3303cf[_0x3ea1('0x4a')]=_[_0x3ea1('0x4d')](_0x3303cf['where'],{'$or':_[_0x3ea1('0x3e')](_0x56fc04,function(_0x5bbf7b){if(_0x5bbf7b[_0x3ea1('0x4e')]!==_0x3ea1('0x4f')){var _0x381492={};_0x381492[_0x5bbf7b['name']]={'$like':'%'+_0x5ea02a[_0x3ea1('0x3f')][_0x3ea1('0x4c')]+'%'};return _0x381492;}})});}_0x3303cf=_[_0x3ea1('0x4d')]({},_0x3303cf,_0x5ea02a[_0x3ea1('0x50')]);var _0x15c800={'where':_0x3303cf['where']};return db[_0x3ea1('0x39')][_0x3ea1('0x29')](_0x15c800)['then'](function(_0x551bf9){_0x6cdbfe[_0x3ea1('0x29')]=_0x551bf9;if(_0x5ea02a[_0x3ea1('0x3f')]['includeAll']){_0x3303cf[_0x3ea1('0x51')]=[{'all':!![]}];}return db[_0x3ea1('0x39')][_0x3ea1('0x52')](_0x3303cf);})[_0x3ea1('0x17')](function(_0x5216f5){_0x6cdbfe[_0x3ea1('0x53')]=_0x5216f5;return _0x6cdbfe;})[_0x3ea1('0x17')](respondWithFilteredResult(_0x4e70a3,_0x3303cf))[_0x3ea1('0x22')](handleError(_0x4e70a3,null));};exports[_0x3ea1('0x54')]=function(_0x47c79a,_0x722561){var _0x57f386={'raw':![],'where':{'id':_0x47c79a['params']['id']},'include':[{'model':db[_0x3ea1('0x37')],'as':'mandatoryDispositionPause'}]},_0x42e56a={};_0x42e56a['model']=_['keys'](db['SmsAccount'][_0x3ea1('0x3a')]);_0x42e56a['query']=_['keys'](_0x47c79a['query']);_0x42e56a[_0x3ea1('0x41')]=_[_0x3ea1('0x42')](_0x42e56a[_0x3ea1('0x3d')],_0x42e56a['query']);_0x57f386[_0x3ea1('0x44')]=_[_0x3ea1('0x42')](_0x42e56a[_0x3ea1('0x3d')],qs[_0x3ea1('0x43')](_0x47c79a['query'][_0x3ea1('0x43')]));_0x57f386[_0x3ea1('0x44')]=_0x57f386[_0x3ea1('0x44')]['length']?_0x57f386[_0x3ea1('0x44')]:_0x42e56a[_0x3ea1('0x3d')];if(_0x47c79a[_0x3ea1('0x3f')][_0x3ea1('0x55')]){_0x57f386[_0x3ea1('0x51')]=[{'all':!![]}];}_0x57f386=_[_0x3ea1('0x4d')]({},_0x57f386,_0x47c79a[_0x3ea1('0x50')]);return db[_0x3ea1('0x39')]['find'](_0x57f386)[_0x3ea1('0x17')](handleEntityNotFound(_0x722561,null))['then'](respondWithResult(_0x722561,null))[_0x3ea1('0x22')](handleError(_0x722561,null));};exports['create']=function(_0x1fe0ff,_0x38dbd4){return db[_0x3ea1('0x39')][_0x3ea1('0x56')](_0x1fe0ff[_0x3ea1('0x57')],{})[_0x3ea1('0x17')](function(_0x438f23){var _0x5dd7b4=_0x1fe0ff['user']['get']({'plain':!![]});if(!_0x5dd7b4)throw new Error(_0x3ea1('0x58'));if(_0x5dd7b4['role']===_0x3ea1('0x59')){var _0x31dc8b=_0x438f23[_0x3ea1('0x2f')]({'plain':!![]});var _0x4625c1=_0x3ea1('0x30');return db[_0x3ea1('0x5a')]['find']({'where':{'name':_0x4625c1,'userProfileId':_0x5dd7b4['userProfileId']},'raw':!![]})[_0x3ea1('0x17')](function(_0x1fb735){if(_0x1fb735&&_0x1fb735[_0x3ea1('0x5b')]===0x0){return db[_0x3ea1('0x31')][_0x3ea1('0x56')]({'name':_0x31dc8b['name'],'resourceId':_0x31dc8b['id'],'type':_0x1fb735[_0x3ea1('0x34')],'sectionId':_0x1fb735['id']},{})[_0x3ea1('0x17')](function(){return _0x438f23;});}else{return _0x438f23;}})[_0x3ea1('0x22')](function(_0x2df3ae){logger[_0x3ea1('0x1d')](_0x3ea1('0x5c'),_0x2df3ae);throw _0x2df3ae;});}return _0x438f23;})['then'](respondWithResult(_0x38dbd4,0xc9))[_0x3ea1('0x22')](handleError(_0x38dbd4,null));};exports[_0x3ea1('0x5d')]=function(_0x28890d,_0x3330cb){if(_0x28890d[_0x3ea1('0x57')]['id']){delete _0x28890d[_0x3ea1('0x57')]['id'];}return db['SmsAccount'][_0x3ea1('0x5e')]({'where':{'id':_0x28890d[_0x3ea1('0x5f')]['id']},'include':[{'model':db[_0x3ea1('0x37')],'as':_0x3ea1('0x38')}]})['then'](handleEntityNotFound(_0x3330cb,null))[_0x3ea1('0x17')](saveUpdates(_0x28890d[_0x3ea1('0x57')],null))[_0x3ea1('0x17')](respondWithResult(_0x3330cb,null))[_0x3ea1('0x22')](handleError(_0x3330cb,null));};exports[_0x3ea1('0x2e')]=function(_0x36841c,_0x54fc1f){return db[_0x3ea1('0x39')][_0x3ea1('0x5e')]({'where':{'id':_0x36841c[_0x3ea1('0x5f')]['id']}})[_0x3ea1('0x17')](handleEntityNotFound(_0x54fc1f,null))[_0x3ea1('0x17')](removeEntity(_0x54fc1f,null))[_0x3ea1('0x22')](handleError(_0x54fc1f,null));};exports[_0x3ea1('0x60')]=function(_0x50fbc9,_0x580c26){return db['SmsAccount'][_0x3ea1('0x60')]()[_0x3ea1('0x17')](respondWithResult(_0x580c26,null))[_0x3ea1('0x22')](handleError(_0x580c26,null));};exports[_0x3ea1('0x61')]=function(_0x31c3b7,_0x3e77d7,_0x587487){if(_0x31c3b7[_0x3ea1('0x57')]['id']){delete _0x31c3b7[_0x3ea1('0x57')]['id'];}return db[_0x3ea1('0x39')][_0x3ea1('0x5e')]({'where':{'id':_0x31c3b7[_0x3ea1('0x5f')]['id']}})[_0x3ea1('0x17')](handleEntityNotFound(_0x3e77d7,null))['then'](function(_0x1180eb){if(_0x1180eb){_0x31c3b7[_0x3ea1('0x57')][_0x3ea1('0x62')]=_0x1180eb['id'];return db[_0x3ea1('0x63')][_0x3ea1('0x56')](_0x31c3b7[_0x3ea1('0x57')]);}})[_0x3ea1('0x17')](respondWithResult(_0x3e77d7,null))[_0x3ea1('0x22')](handleError(_0x3e77d7,null));};exports['getDispositions']=function(_0xd96937,_0x2bfaeb,_0xd1c0a3){var _0xb374d2={'raw':![],'where':{}};var _0x145720={};var _0x58c9bf={'count':0x0,'rows':[]};return db[_0x3ea1('0x39')][_0x3ea1('0x64')]({'where':{'id':_0xd96937[_0x3ea1('0x5f')]['id']}})[_0x3ea1('0x17')](handleEntityNotFound(_0x2bfaeb,null))[_0x3ea1('0x17')](function(_0x22e4e9){if(_0x22e4e9){_0x145720[_0x3ea1('0x3d')]=_[_0x3ea1('0x40')](db[_0x3ea1('0x63')][_0x3ea1('0x3a')]);_0x145720[_0x3ea1('0x3f')]=_[_0x3ea1('0x40')](_0xd96937[_0x3ea1('0x3f')]);_0x145720[_0x3ea1('0x41')]=_[_0x3ea1('0x42')](_0x145720[_0x3ea1('0x3d')],_0x145720[_0x3ea1('0x3f')]);_0xb374d2[_0x3ea1('0x44')]=_[_0x3ea1('0x42')](_0x145720[_0x3ea1('0x3d')],qs[_0x3ea1('0x43')](_0xd96937[_0x3ea1('0x3f')][_0x3ea1('0x43')]));_0xb374d2['attributes']=_0xb374d2[_0x3ea1('0x44')][_0x3ea1('0x45')]?_0xb374d2[_0x3ea1('0x44')]:_0x145720[_0x3ea1('0x3d')];if(!_0xd96937[_0x3ea1('0x3f')][_0x3ea1('0x46')](_0x3ea1('0x47'))){_0xb374d2[_0x3ea1('0x27')]=qs[_0x3ea1('0x27')](_0xd96937[_0x3ea1('0x3f')][_0x3ea1('0x27')]);_0xb374d2[_0x3ea1('0x26')]=qs['offset'](_0xd96937[_0x3ea1('0x3f')]['offset']);}_0xb374d2[_0x3ea1('0x48')]=qs[_0x3ea1('0x49')](_0xd96937[_0x3ea1('0x3f')]['sort']);_0xb374d2[_0x3ea1('0x4a')]=qs[_0x3ea1('0x41')](_['pick'](_0xd96937['query'],_0x145720['filters']));_0xb374d2[_0x3ea1('0x4a')][_0x3ea1('0x62')]=_0x22e4e9['id'];if(_0xd96937[_0x3ea1('0x3f')][_0x3ea1('0x4c')]){_0xb374d2['where']=_[_0x3ea1('0x4d')](_0xb374d2[_0x3ea1('0x4a')],{'$or':_[_0x3ea1('0x3e')](_0xb374d2[_0x3ea1('0x44')],function(_0x13507a){var _0x36dff2={};_0x36dff2[_0x13507a]={'$like':'%'+_0xd96937['query'][_0x3ea1('0x4c')]+'%'};return _0x36dff2;})});}_0xb374d2=_[_0x3ea1('0x4d')]({},_0xb374d2,_0xd96937[_0x3ea1('0x50')]);return db[_0x3ea1('0x63')]['count']({'where':_0xb374d2[_0x3ea1('0x4a')]})[_0x3ea1('0x17')](function(_0x2d547d){_0x58c9bf['count']=_0x2d547d;if(_0xd96937[_0x3ea1('0x3f')]['includeAll']){_0xb374d2['include']=[{'all':!![]}];}return db[_0x3ea1('0x63')]['findAll'](_0xb374d2);})[_0x3ea1('0x17')](function(_0x5ef5f7){_0x58c9bf[_0x3ea1('0x53')]=_0x5ef5f7;return _0x58c9bf;});}})[_0x3ea1('0x17')](respondWithFilteredResult(_0x2bfaeb,_0xb374d2))[_0x3ea1('0x22')](handleError(_0x2bfaeb,null));};exports[_0x3ea1('0x65')]=function(_0x5e45f9,_0x514a34,_0x40cf72){return db[_0x3ea1('0x39')][_0x3ea1('0x5e')]({'where':{'id':_0x5e45f9[_0x3ea1('0x5f')]['id']}})[_0x3ea1('0x17')](handleEntityNotFound(_0x514a34,null))[_0x3ea1('0x17')](function(_0x3087ce){if(_0x3087ce){return _0x3087ce[_0x3ea1('0x65')](_0x5e45f9['query']['ids']);}})[_0x3ea1('0x17')](respondWithStatusCode(_0x514a34,null))[_0x3ea1('0x22')](handleError(_0x514a34,null));};exports[_0x3ea1('0x66')]=function(_0x5706fd,_0x34fb9a,_0x19210f){if(_0x5706fd['body']['id']){delete _0x5706fd[_0x3ea1('0x57')]['id'];}return db[_0x3ea1('0x39')][_0x3ea1('0x5e')]({'where':{'id':_0x5706fd[_0x3ea1('0x5f')]['id']}})[_0x3ea1('0x17')](handleEntityNotFound(_0x34fb9a,null))[_0x3ea1('0x17')](function(_0xfe2990){if(_0xfe2990){_0x5706fd[_0x3ea1('0x57')][_0x3ea1('0x62')]=_0xfe2990['id'];return db[_0x3ea1('0x67')][_0x3ea1('0x56')](_0x5706fd['body']);}})[_0x3ea1('0x17')](respondWithResult(_0x34fb9a,null))['catch'](handleError(_0x34fb9a,null));};exports['getAnswers']=function(_0x46e563,_0x35caf8,_0x547f2c){var _0x178f3e={'raw':![],'where':{}};var _0x4eeee5={};var _0x36db74={'count':0x0,'rows':[]};return db[_0x3ea1('0x39')][_0x3ea1('0x64')]({'where':{'id':_0x46e563[_0x3ea1('0x5f')]['id']}})[_0x3ea1('0x17')](handleEntityNotFound(_0x35caf8,null))[_0x3ea1('0x17')](function(_0xfbe808){if(_0xfbe808){_0x4eeee5[_0x3ea1('0x3d')]=_[_0x3ea1('0x40')](db[_0x3ea1('0x67')]['rawAttributes']);_0x4eeee5[_0x3ea1('0x3f')]=_['keys'](_0x46e563['query']);_0x4eeee5['filters']=_[_0x3ea1('0x42')](_0x4eeee5[_0x3ea1('0x3d')],_0x4eeee5[_0x3ea1('0x3f')]);_0x178f3e['attributes']=_[_0x3ea1('0x42')](_0x4eeee5[_0x3ea1('0x3d')],qs[_0x3ea1('0x43')](_0x46e563[_0x3ea1('0x3f')]['fields']));_0x178f3e['attributes']=_0x178f3e[_0x3ea1('0x44')]['length']?_0x178f3e[_0x3ea1('0x44')]:_0x4eeee5['model'];if(!_0x46e563[_0x3ea1('0x3f')]['hasOwnProperty'](_0x3ea1('0x47'))){_0x178f3e[_0x3ea1('0x27')]=qs['limit'](_0x46e563[_0x3ea1('0x3f')][_0x3ea1('0x27')]);_0x178f3e[_0x3ea1('0x26')]=qs[_0x3ea1('0x26')](_0x46e563[_0x3ea1('0x3f')]['offset']);}_0x178f3e['order']=qs[_0x3ea1('0x49')](_0x46e563['query'][_0x3ea1('0x49')]);_0x178f3e[_0x3ea1('0x4a')]=qs[_0x3ea1('0x41')](_[_0x3ea1('0x4b')](_0x46e563[_0x3ea1('0x3f')],_0x4eeee5[_0x3ea1('0x41')]));_0x178f3e[_0x3ea1('0x4a')][_0x3ea1('0x62')]=_0xfbe808['id'];if(_0x46e563[_0x3ea1('0x3f')][_0x3ea1('0x4c')]){_0x178f3e[_0x3ea1('0x4a')]=_['merge'](_0x178f3e[_0x3ea1('0x4a')],{'$or':_['map'](_0x178f3e[_0x3ea1('0x44')],function(_0x15ac38){var _0x1db3ba={};_0x1db3ba[_0x15ac38]={'$like':'%'+_0x46e563[_0x3ea1('0x3f')][_0x3ea1('0x4c')]+'%'};return _0x1db3ba;})});}_0x178f3e=_[_0x3ea1('0x4d')]({},_0x178f3e,_0x46e563['options']);return db[_0x3ea1('0x67')][_0x3ea1('0x29')]({'where':_0x178f3e['where']})[_0x3ea1('0x17')](function(_0x2d4ebc){_0x36db74[_0x3ea1('0x29')]=_0x2d4ebc;if(_0x46e563[_0x3ea1('0x3f')]['includeAll']){_0x178f3e['include']=[{'all':!![]}];}return db[_0x3ea1('0x67')][_0x3ea1('0x52')](_0x178f3e);})[_0x3ea1('0x17')](function(_0x3a20a6){_0x36db74[_0x3ea1('0x53')]=_0x3a20a6;return _0x36db74;});}})[_0x3ea1('0x17')](respondWithFilteredResult(_0x35caf8,_0x178f3e))['catch'](handleError(_0x35caf8,null));};exports['removeAnswers']=function(_0x42da9a,_0x208d97,_0x569c8f){return db['SmsAccount']['find']({'where':{'id':_0x42da9a[_0x3ea1('0x5f')]['id']}})[_0x3ea1('0x17')](handleEntityNotFound(_0x208d97,null))[_0x3ea1('0x17')](function(_0x1dad51){if(_0x1dad51){return _0x1dad51['removeAnswers'](_0x42da9a[_0x3ea1('0x3f')][_0x3ea1('0x68')]);}})[_0x3ea1('0x17')](respondWithStatusCode(_0x208d97,null))[_0x3ea1('0x22')](handleError(_0x208d97,null));};exports[_0x3ea1('0x69')]=function(_0x50c467,_0x4da8e6,_0x1d11f6){var _0x553f43={'channel':'sms'};var _0x2d7657=[];var _0x5c9a6a=[];var _0x1b3afb={};return db[_0x3ea1('0x39')][_0x3ea1('0x5e')]({'where':{'id':_0x50c467[_0x3ea1('0x5f')]['id']},'include':[{'model':db[_0x3ea1('0x6a')],'as':_0x3ea1('0x6b')}]})[_0x3ea1('0x17')](handleEntityNotFound(_0x4da8e6,null))['then'](function(_0x1825b6){_0x553f43[_0x3ea1('0x6c')]=_0x1825b6;_0x553f43[_0x3ea1('0x6d')]=_[_0x3ea1('0x6e')](_0x1825b6[_0x3ea1('0x6b')],['priority'],['asc']);if(_0x553f43[_0x3ea1('0x6c')][_0x3ea1('0x6b')]){delete _0x553f43[_0x3ea1('0x6c')][_0x3ea1('0x6b')];}return db[_0x3ea1('0x6f')][_0x3ea1('0x60')]();})['then'](function(_0x1e20b0){if(!_0x1e20b0){throw new db['Sequelize'][(_0x3ea1('0x70'))](_0x3ea1('0x71'));}_0x2d7657=_[_0x3ea1('0x72')](_[_0x3ea1('0x40')](_0x1e20b0),[_0x3ea1('0x73'),_0x3ea1('0x74')]);_0x5c9a6a=_['difference'](_[_0x3ea1('0x40')](_0x1e20b0),[_0x3ea1('0x73'),'updatedAt',_0x3ea1('0x75'),_0x3ea1('0x76')]);_0x553f43[_0x3ea1('0x57')]={'mapKey':_0x3ea1('0x77')};if(_0x553f43['account'][_0x3ea1('0x4e')]){switch(_0x553f43[_0x3ea1('0x6c')][_0x3ea1('0x4e')]){case _0x3ea1('0x78'):_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x79')]=_0x50c467[_0x3ea1('0x57')][_0x3ea1('0x7a')];_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x57')]=_0x50c467[_0x3ea1('0x57')]['Body'];_0x553f43['body'][_0x3ea1('0x7b')]=_0x50c467[_0x3ea1('0x57')][_0x3ea1('0x7c')];break;case _0x3ea1('0x7d'):_0x553f43[_0x3ea1('0x57')]['from']='+'+_0x50c467['body'][_0x3ea1('0x7e')];_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x57')]=_0x50c467[_0x3ea1('0x57')][_0x3ea1('0x7f')];break;case _0x3ea1('0x80'):_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x79')]=_0x50c467[_0x3ea1('0x57')][_0x3ea1('0x79')];_0x553f43['body']['body']=_0x50c467[_0x3ea1('0x57')]['message'];break;case'clicksend':_0x553f43['body'][_0x3ea1('0x79')]=_0x50c467['body'][_0x3ea1('0x79')];_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x57')]=_0x50c467[_0x3ea1('0x57')][_0x3ea1('0x57')];_0x553f43[_0x3ea1('0x57')]['messageId']=_0x50c467[_0x3ea1('0x57')][_0x3ea1('0x81')];break;case _0x3ea1('0x82'):_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x79')]=_0x50c467[_0x3ea1('0x57')]['From'];_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x57')]=_0x50c467[_0x3ea1('0x57')][_0x3ea1('0x83')];_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x7b')]=_0x50c467[_0x3ea1('0x57')][_0x3ea1('0x84')];break;case _0x3ea1('0x85'):_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x79')]='+'+_0x50c467[_0x3ea1('0x57')]['results'][0x0][_0x3ea1('0x79')];_0x553f43['body'][_0x3ea1('0x57')]=_0x50c467[_0x3ea1('0x57')][_0x3ea1('0x86')][0x0][_0x3ea1('0x7f')];_0x553f43['body'][_0x3ea1('0x7b')]=_0x50c467[_0x3ea1('0x57')][_0x3ea1('0x86')][0x0][_0x3ea1('0x7b')];break;case _0x3ea1('0x87'):_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x79')]=_0x50c467[_0x3ea1('0x57')][_0x3ea1('0x88')];_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x57')]=_0x50c467['body'][_0x3ea1('0x89')][_0x3ea1('0x1f')];break;case _0x3ea1('0x8a'):_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x79')]=_0x50c467[_0x3ea1('0x57')]['fromNumber'];_0x553f43[_0x3ea1('0x57')]['body']=_0x50c467['body'][_0x3ea1('0x7f')];_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x7b')]=_0x50c467['body'][_0x3ea1('0x8b')];break;case'bandwidth':_0x553f43['body'][_0x3ea1('0x7b')]=_0x50c467['body'][0x0]['message']['id'];_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x79')]=_0x50c467['body'][0x0][_0x3ea1('0x1f')][_0x3ea1('0x79')];_0x553f43['body'][_0x3ea1('0x57')]=_0x50c467[_0x3ea1('0x57')][0x0]['message']['text'];break;case'intelepeer':_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x79')]=_0x50c467[_0x3ea1('0x57')][_0x3ea1('0x79')];_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x57')]=_0x50c467[_0x3ea1('0x57')]['message'];_0x553f43[_0x3ea1('0x57')]['messageId']=_0x50c467[_0x3ea1('0x57')]['refid'];break;}}if(_0x553f43[_0x3ea1('0x57')]['id']){delete _0x553f43['body']['id'];}if(_[_0x3ea1('0x8c')](_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x79')])){throw new db[(_0x3ea1('0x8d'))][(_0x3ea1('0x70'))](_0x3ea1('0x8e'));}if(_['isNil'](_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x57')])||_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x57')]===''){throw new db[(_0x3ea1('0x8d'))][(_0x3ea1('0x70'))](_0x3ea1('0x8f'));}if(_[_0x3ea1('0x8c')](_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x90')])){throw new db['Sequelize'][(_0x3ea1('0x70'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5c9a6a);}if(!_['includes'](_0x5c9a6a,_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x90')])){throw new db['Sequelize'][(_0x3ea1('0x70'))](_0x3ea1('0x91')+_0x5c9a6a);}_0x1b3afb[_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x90')]]=_0x553f43['body'][_0x3ea1('0x79')];return db[_0x3ea1('0x92')]['find']({'where':{'id':_0x553f43['account'][_0x3ea1('0x76')]},'include':[{'model':db[_0x3ea1('0x6f')],'as':_0x3ea1('0x93'),'where':_0x1b3afb,'limit':0x1,'order':[[_0x3ea1('0x74'),'DESC']]}]});})[_0x3ea1('0x17')](handleEntityNotFound(_0x4da8e6,null))[_0x3ea1('0x17')](function(_0x7710ff){if(_0x7710ff){_0x553f43[_0x3ea1('0x94')]=_[_0x3ea1('0x95')](_0x7710ff,[_0x3ea1('0x93')]);if(_0x7710ff[_0x3ea1('0x93')][_0x3ea1('0x45')]){return _0x7710ff[_0x3ea1('0x93')][0x0];}var _0x2b72aa=_[_0x3ea1('0x12')](_0x553f43[_0x3ea1('0x57')],{'firstName':_0x553f43[_0x3ea1('0x57')]['from'],'ListId':_0x7710ff['id']});_0x2b72aa[_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x90')]]=_0x553f43['body'][_0x3ea1('0x79')];return db[_0x3ea1('0x6f')][_0x3ea1('0x56')](_0x2b72aa,{'fields':_0x2d7657,'raw':!![]});}})[_0x3ea1('0x17')](handleEntityNotFound(_0x4da8e6,null))[_0x3ea1('0x17')](function(_0x542dd3){if(_0x542dd3){_0x553f43[_0x3ea1('0x96')]=_0x542dd3;var _0x1201b5={'ContactId':_0x542dd3['id'],'phone':_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x79')],'SmsAccountId':_0x50c467[_0x3ea1('0x5f')]['id']};var _0x171bf7={'ContactId':_0x542dd3['id'],'SmsAccountId':_0x50c467[_0x3ea1('0x5f')]['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x171bf7})[_0x3ea1('0x17')](function(_0x124924){if(_0x124924){return[_0x124924,![]];}return db[_0x3ea1('0x97')][_0x3ea1('0x56')](_0x1201b5)['then'](function(_0xec2210){return[_0xec2210,!![]];});});}})['spread'](function(_0x126369,_0x527e77){_0x553f43[_0x3ea1('0x98')]=_0x126369[_0x3ea1('0x2f')]({'plain':!![]});_0x553f43[_0x3ea1('0x98')][_0x3ea1('0x99')]=![];if(_0x527e77){if(_0x553f43[_0x3ea1('0x6c')]['autoclose']){_0x553f43['applications']['push']({'id':0x0,'priority':_0x553f43[_0x3ea1('0x6d')][_0x3ea1('0x45')]+0x1,'app':_0x3ea1('0x9a'),'appdata':_0x3ea1('0x9b'),'interval':_0x3ea1('0x9c')});}_0x553f43['interaction']['created']=!![];}return db[_0x3ea1('0x9d')][_0x3ea1('0x56')]({'phone':_0x553f43['body'][_0x3ea1('0x79')],'messageId':_0x553f43['body'][_0x3ea1('0x7b')],'body':_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x57')],'SmsAccountId':_0x50c467['params']['id'],'SmsInteractionId':_0x126369['id'],'direction':'in','ContactId':_0x126369['ContactId'],'AttachmentId':_0x553f43[_0x3ea1('0x57')][_0x3ea1('0x9e')]});})[_0x3ea1('0x17')](function(_0x16b921){_0x553f43[_0x3ea1('0x1f')]=_0x16b921;if(_0x553f43[_0x3ea1('0x98')]['UserId']){return db[_0x3ea1('0x9f')]['find']({'attributes':['id',_0x3ea1('0x34')],'where':{'id':_0x553f43[_0x3ea1('0x98')][_0x3ea1('0xa0')]}})[_0x3ea1('0x17')](function(_0x289cfb){if(_0x289cfb){_0x553f43['applications'][_0x3ea1('0xa1')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x289cfb['name']+','+(_0x553f43[_0x3ea1('0x6c')][_0x3ea1('0xa2')]||0xa),'interval':_0x3ea1('0x9c')});}return respondWithRpcPromise('Start',_0x3ea1('0xa3'),_0x553f43);});}return respondWithRpcPromise(_0x3ea1('0xa4'),'startRouting',_0x553f43);})[_0x3ea1('0x17')](function(_0x4f7a23){if(_0x4f7a23){var _0x33182d=0xc8;var _0xe512d9=_0x3ea1('0xa5');logger['info'](_0x3ea1('0x1a'),_0xe512d9,_0x33182d,_0x3ea1('0xa6'));logger[_0x3ea1('0x19')](_0x3ea1('0xa7'),_0xe512d9,_0x33182d,_0x3ea1('0xa6'),JSON[_0x3ea1('0x1c')](_0x4f7a23));if(_0x553f43['account'][_0x3ea1('0x4e')]==='twilio'){return _0x4da8e6[_0x3ea1('0x24')](_0x33182d)[_0x3ea1('0x2a')](_0x3ea1('0xa8'),_0x3ea1('0xa9'))[_0x3ea1('0x35')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x4da8e6['status'](_0x33182d)[_0x3ea1('0x25')](_0x4f7a23);}}})[_0x3ea1('0x22')](handleError(_0x4da8e6,null));};exports[_0x3ea1('0xaa')]=function(_0x5ac72a,_0x19ade3){var _0x57c691=_0x5ac72a[_0x3ea1('0x5f')]['id'];var _0x1b6e39=_0x5ac72a['body'];var _0x21009c=0xc8;var _0xc2a389=null;return db[_0x3ea1('0xab')][_0x3ea1('0xac')]({'isolationLevel':db[_0x3ea1('0xab')]['Transaction'][_0x3ea1('0xad')][_0x3ea1('0xae')]},function(_0x50f4ad){return db[_0x3ea1('0x39')][_0x3ea1('0x64')]({'where':{'id':_0x57c691},'transaction':_0x50f4ad})[_0x3ea1('0x17')](function(_0x1b3d96){if(_0x1b3d96){return db['SmsApplication'][_0x3ea1('0x2e')]({'where':{'SmsAccountId':_0x57c691},'transaction':_0x50f4ad})[_0x3ea1('0x17')](function(){var _0x12d37e=_['map'](_0x1b6e39,function(_0x207bf7){_0x207bf7[_0x3ea1('0x62')]=_0x57c691;return _0x207bf7;});return db[_0x3ea1('0x6a')]['bulkCreate'](_0x12d37e,{'transaction':_0x50f4ad});});}else{_0x21009c=0x194;_0xc2a389=[];}});})['then'](function(){if(_0x21009c!==0x194){return db[_0x3ea1('0x6a')][_0x3ea1('0xaf')]({'where':{'SmsAccountId':_0x57c691},'order':'priority'})['then'](function(_0x2b6125){_0xc2a389=_0x2b6125;});}})[_0x3ea1('0x22')](function(_0x542adb){_0x21009c=0x1f4;logger['error'](_0x542adb[_0x3ea1('0x33')]);if(_0x542adb[_0x3ea1('0x34')]){delete _0x542adb[_0x3ea1('0x34')];}_0xc2a389=_0x542adb;})[_0x3ea1('0xb0')](function(){if(_0xc2a389===null){_0x19ade3[_0x3ea1('0x23')](_0x21009c);}else{if(_0x21009c===0x1f4){_0x19ade3[_0x3ea1('0x24')](_0x21009c)[_0x3ea1('0x35')](_0xc2a389);}else{_0x19ade3[_0x3ea1('0x24')](_0x21009c)[_0x3ea1('0x25')](_0xc2a389);}}});};exports['getApplications']=function(_0x2f0020,_0x3070f2,_0x2eac37){var _0x5e556d={};var _0x5707cb={};var _0x583625;var _0x21408a;return db['SmsAccount'][_0x3ea1('0x64')]({'where':{'id':_0x2f0020[_0x3ea1('0x5f')]['id']}})[_0x3ea1('0x17')](handleEntityNotFound(_0x3070f2,null))['then'](function(_0xad0cf1){if(_0xad0cf1){_0x583625=_0xad0cf1;_0x5707cb[_0x3ea1('0x3d')]=_[_0x3ea1('0x40')](db[_0x3ea1('0x6a')][_0x3ea1('0x3a')]);_0x5707cb[_0x3ea1('0x3f')]=_[_0x3ea1('0x40')](_0x2f0020[_0x3ea1('0x3f')]);_0x5707cb[_0x3ea1('0x41')]=_[_0x3ea1('0x42')](_0x5707cb[_0x3ea1('0x3d')],_0x5707cb[_0x3ea1('0x3f')]);_0x5e556d[_0x3ea1('0x44')]=_[_0x3ea1('0x42')](_0x5707cb['model'],qs['fields'](_0x2f0020[_0x3ea1('0x3f')][_0x3ea1('0x43')]));_0x5e556d[_0x3ea1('0x44')]=_0x5e556d[_0x3ea1('0x44')][_0x3ea1('0x45')]?_0x5e556d[_0x3ea1('0x44')]:_0x5707cb[_0x3ea1('0x3d')];_0x5e556d[_0x3ea1('0x48')]=qs[_0x3ea1('0x49')](_0x2f0020[_0x3ea1('0x3f')]['sort']);_0x5e556d['where']=qs[_0x3ea1('0x41')](_[_0x3ea1('0x4b')](_0x2f0020[_0x3ea1('0x3f')],_0x5707cb['filters']));if(_0x2f0020[_0x3ea1('0x3f')][_0x3ea1('0x4c')]){_0x5e556d[_0x3ea1('0x4a')]=_[_0x3ea1('0x4d')](_0x5e556d[_0x3ea1('0x4a')],{'$or':_[_0x3ea1('0x3e')](_0x5e556d[_0x3ea1('0x44')],function(_0x5f33ec){var _0x549b6b={};_0x549b6b[_0x5f33ec]={'$like':'%'+_0x2f0020['query']['filter']+'%'};return _0x549b6b;})});}_0x5e556d=_[_0x3ea1('0x4d')]({},_0x5e556d,_0x2f0020[_0x3ea1('0x50')]);return _0x583625[_0x3ea1('0xb1')](_0x5e556d);}})['then'](function(_0x31eb49){if(_0x31eb49){_0x21408a=_0x31eb49[_0x3ea1('0x45')];if(!_0x2f0020['query'][_0x3ea1('0x46')]('nolimit')){_0x5e556d['limit']=qs['limit'](_0x2f0020[_0x3ea1('0x3f')][_0x3ea1('0x27')]);_0x5e556d['offset']=qs[_0x3ea1('0x26')](_0x2f0020[_0x3ea1('0x3f')][_0x3ea1('0x26')]);}return _0x583625[_0x3ea1('0xb1')](_0x5e556d);}})[_0x3ea1('0x17')](function(_0x493a84){if(_0x493a84){return _0x493a84?{'count':_0x21408a,'rows':_0x493a84}:null;}})[_0x3ea1('0x17')](respondWithResult(_0x3070f2,null))[_0x3ea1('0x22')](handleError(_0x3070f2,null));};exports[_0x3ea1('0xb2')]=function(_0x1ccd8a,_0xd97b7d,_0x33076e){var _0x4d4722={'raw':![],'where':{}};var _0x39357d={};var _0x3dcfe2={'count':0x0,'rows':[]};return db[_0x3ea1('0x39')]['findOne']({'where':{'id':_0x1ccd8a[_0x3ea1('0x5f')]['id']}})[_0x3ea1('0x17')](handleEntityNotFound(_0xd97b7d,null))['then'](function(_0x336d5b){if(_0x336d5b){_0x39357d['model']=_[_0x3ea1('0x40')](db[_0x3ea1('0x97')][_0x3ea1('0x3a')]);_0x39357d[_0x3ea1('0x3f')]=_[_0x3ea1('0x40')](_0x1ccd8a['query']);_0x39357d[_0x3ea1('0x41')]=_[_0x3ea1('0x42')](_0x39357d[_0x3ea1('0x3d')],_0x39357d[_0x3ea1('0x3f')]);_0x4d4722['attributes']=_['intersection'](_0x39357d[_0x3ea1('0x3d')],qs[_0x3ea1('0x43')](_0x1ccd8a[_0x3ea1('0x3f')][_0x3ea1('0x43')]));_0x4d4722['attributes']=_0x4d4722[_0x3ea1('0x44')][_0x3ea1('0x45')]?_0x4d4722[_0x3ea1('0x44')]:_0x39357d[_0x3ea1('0x3d')];if(!_0x1ccd8a[_0x3ea1('0x3f')][_0x3ea1('0x46')](_0x3ea1('0x47'))){_0x4d4722[_0x3ea1('0x27')]=qs[_0x3ea1('0x27')](_0x1ccd8a[_0x3ea1('0x3f')]['limit']);_0x4d4722[_0x3ea1('0x26')]=qs[_0x3ea1('0x26')](_0x1ccd8a[_0x3ea1('0x3f')]['offset']);}_0x4d4722[_0x3ea1('0x48')]=qs['sort'](_0x1ccd8a['query'][_0x3ea1('0x49')]);_0x4d4722[_0x3ea1('0x4a')]=qs[_0x3ea1('0x41')](_[_0x3ea1('0x4b')](_0x1ccd8a[_0x3ea1('0x3f')],_0x39357d[_0x3ea1('0x41')]));_0x4d4722[_0x3ea1('0x4a')][_0x3ea1('0x62')]=_0x336d5b['id'];if(_0x1ccd8a['query'][_0x3ea1('0x4c')]){_0x4d4722[_0x3ea1('0x4a')]=_[_0x3ea1('0x4d')](_0x4d4722[_0x3ea1('0x4a')],{'$or':_[_0x3ea1('0x3e')](_0x4d4722[_0x3ea1('0x44')],function(_0xad12d2){var _0x113626={};_0x113626[_0xad12d2]={'$like':'%'+_0x1ccd8a[_0x3ea1('0x3f')][_0x3ea1('0x4c')]+'%'};return _0x113626;})});}_0x4d4722=_[_0x3ea1('0x4d')]({},_0x4d4722,_0x1ccd8a[_0x3ea1('0x50')]);return db[_0x3ea1('0x97')][_0x3ea1('0x29')]({'where':_0x4d4722['where']})['then'](function(_0x4fe644){_0x3dcfe2['count']=_0x4fe644;if(_0x1ccd8a[_0x3ea1('0x3f')][_0x3ea1('0x55')]){_0x4d4722[_0x3ea1('0x51')]=[{'model':db[_0x3ea1('0x6f')],'as':_0x3ea1('0xb3'),'required':![]},{'model':db[_0x3ea1('0x9f')],'as':'Owner','attributes':[_0x3ea1('0x34'),_0x3ea1('0xb4'),_0x3ea1('0xb5')],'required':![]},{'model':db[_0x3ea1('0xb6')],'as':_0x3ea1('0xb7'),'attributes':['id',_0x3ea1('0x34'),_0x3ea1('0xb8')],'where':_0x1ccd8a[_0x3ea1('0x3f')]['tag']?{'id':_0x1ccd8a['query'][_0x3ea1('0xb9')]}:undefined,'required':_0x1ccd8a[_0x3ea1('0x3f')]['tag']?!![]:![]}];}return db['SmsInteraction'][_0x3ea1('0x52')](_0x4d4722);})[_0x3ea1('0x17')](function(_0x3ac535){_0x3dcfe2[_0x3ea1('0x53')]=_0x3ac535;return _0x3dcfe2;});}})['then'](respondWithFilteredResult(_0xd97b7d,_0x4d4722))[_0x3ea1('0x22')](handleError(_0xd97b7d,null));};exports[_0x3ea1('0x35')]=function(_0x16bb9a,_0x1ff3fb,_0x744349){var _0x17c55e,_0x2e0f90,_0x310b23;if(_[_0x3ea1('0x8c')](_0x16bb9a['body'][_0x3ea1('0x57')])||_0x16bb9a[_0x3ea1('0x57')][_0x3ea1('0x57')]===''){throw new db['Sequelize'][(_0x3ea1('0x70'))](_0x3ea1('0x8f'));}if(_[_0x3ea1('0x8c')](_0x16bb9a[_0x3ea1('0x57')]['to'])){throw new db[(_0x3ea1('0x8d'))][(_0x3ea1('0x70'))]('to\x20is\x20mandatory');}_0x17c55e=_0x16bb9a[_0x3ea1('0x57')]['to'];return db['SmsAccount'][_0x3ea1('0x5e')]({'where':{'id':_0x16bb9a['params']['id']},'include':[{'model':db['CmList'],'as':_0x3ea1('0xba'),'include':[{'model':db[_0x3ea1('0x6f')],'as':'Contacts','where':{'mobile':_0x17c55e},'limit':0x1,'order':[[_0x3ea1('0x74'),'DESC']]}]}]})[_0x3ea1('0x17')](handleEntityNotFound(_0x1ff3fb,null))[_0x3ea1('0x17')](function(_0x27201f){if(_0x27201f&&_0x27201f[_0x3ea1('0xba')]){_0x2e0f90=_0x27201f[_0x3ea1('0x2f')]({'plain':!![]});if(_0x2e0f90['List']&&_0x2e0f90['List'][_0x3ea1('0x93')][_0x3ea1('0x45')]){return _0x2e0f90[_0x3ea1('0xba')]['Contacts'][0x0];}return db[_0x3ea1('0x6f')][_0x3ea1('0x56')](_[_0x3ea1('0x12')](_0x16bb9a[_0x3ea1('0x57')],{'firstName':_0x17c55e,'mobile':_0x17c55e,'phone':_0x17c55e,'ListId':_0x2e0f90['ListId']}));}})[_0x3ea1('0x17')](handleEntityNotFound(_0x1ff3fb,null))[_0x3ea1('0x17')](function(_0x2f654b){if(_0x2f654b){_0x310b23=_0x2f654b;return db[_0x3ea1('0x97')][_0x3ea1('0x5e')]({'where':{'ContactId':_0x310b23['id'],'closed':![],'SmsAccountId':_0x2e0f90['id']}})['then'](function(_0x2c0a27){if(_0x2c0a27){return[_0x2c0a27,![]];}return db['SmsInteraction'][_0x3ea1('0x56')]({'UserId':_0x16bb9a[_0x3ea1('0x59')]['id'],'ContactId':_0x310b23['id'],'SmsAccountId':_0x2e0f90['id'],'phone':_0x17c55e,'firstMsgDirection':'out','Messages':[_[_0x3ea1('0x4d')](_0x16bb9a[_0x3ea1('0x57')],{'read':![],'body':_0x16bb9a[_0x3ea1('0x57')][_0x3ea1('0x57')],'phone':_0x17c55e,'SmsAccountId':_0x2e0f90['id'],'UserId':_0x16bb9a[_0x3ea1('0x59')]['id'],'ContactId':_0x310b23['id']})]},{'include':[{'model':db[_0x3ea1('0x9d')],'as':_0x3ea1('0xbb')}]})[_0x3ea1('0x17')](function(_0x3d52bd){return[_0x3d52bd,!![]];});});}})[_0x3ea1('0xbc')](function(_0x2842a6,_0x3de5b8){if(_0x3de5b8){return _0x2842a6;}return db[_0x3ea1('0x9d')][_0x3ea1('0x56')](_[_0x3ea1('0x4d')](_0x16bb9a[_0x3ea1('0x57')],{'read':![],'body':_0x16bb9a[_0x3ea1('0x57')][_0x3ea1('0x57')],'phone':_0x17c55e,'SmsAccountId':_0x2e0f90['id'],'SmsInteractionId':_0x2842a6['id'],'UserId':_0x16bb9a[_0x3ea1('0x59')]['id'],'ContactId':_0x310b23['id']}))[_0x3ea1('0x17')](function(_0x1e61b6){_0x2842a6[_0x3ea1('0xbd')][_0x3ea1('0xbb')]=[];_0x2842a6[_0x3ea1('0xbd')][_0x3ea1('0xbb')]['push'](_0x1e61b6[_0x3ea1('0xbd')]);return _0x2842a6;});})[_0x3ea1('0x17')](respondWithResult(_0x1ff3fb,null))[_0x3ea1('0x22')](handleError(_0x1ff3fb,null));};exports['status']=function(_0x36ba78,_0x183fde,_0x369fc2){if(_0x36ba78[_0x3ea1('0x57')]['id']){delete _0x36ba78['body']['id'];}var _0x8aef54,_0x3ee15b,_0x37500e;return db[_0x3ea1('0x39')][_0x3ea1('0x5e')]({'where':{'id':_0x36ba78['params']['id']}})['then'](handleEntityNotFound(_0x183fde,null))[_0x3ea1('0x17')](function(_0x40f15f){if(_0x40f15f){_0x37500e=_0x40f15f;logger[_0x3ea1('0x19')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x40f15f[_0x3ea1('0x4e')],util['inspect'](_0x36ba78[_0x3ea1('0x57')],{'showHidden':![],'depth':null}));switch(_0x40f15f['type']){case _0x3ea1('0x7d'):if(_0x36ba78[_0x3ea1('0x57')][_0x3ea1('0xbe')]&&_0x36ba78['body']['status']){_0x3ee15b=_0x36ba78[_0x3ea1('0x57')][_0x3ea1('0x24')];return db[_0x3ea1('0x9d')][_0x3ea1('0x5e')]({'where':{'messageId':_0x36ba78[_0x3ea1('0x57')][_0x3ea1('0xbe')]}});}break;case _0x3ea1('0x80'):if(_0x36ba78[_0x3ea1('0x57')][_0x3ea1('0xbf')]&&_0x36ba78[_0x3ea1('0x57')][_0x3ea1('0xc0')]){_0x3ee15b=_0x36ba78['body'][_0x3ea1('0xc0')];return db[_0x3ea1('0x9d')][_0x3ea1('0x5e')]({'where':{'messageId':_0x36ba78[_0x3ea1('0x57')][_0x3ea1('0xbf')]}});}break;case'clicksend':if(_0x36ba78['body'][_0x3ea1('0x81')]&&_0x36ba78[_0x3ea1('0x57')][_0x3ea1('0xc1')]){_0x3ee15b=_0x36ba78[_0x3ea1('0x57')][_0x3ea1('0xc1')];return db[_0x3ea1('0x9d')]['find']({'where':{'messageId':_0x36ba78['body']['message_id']}});}break;case _0x3ea1('0x85'):var _0x179cc8=_0x36ba78[_0x3ea1('0x57')]['results'][0x0];if(_0x179cc8[_0x3ea1('0x7b')]&&_0x179cc8[_0x3ea1('0x24')][_0x3ea1('0xc2')]===_0x3ea1('0xc3')){_0x3ee15b=_0x179cc8[_0x3ea1('0x24')][_0x3ea1('0xc2')];return db[_0x3ea1('0x9d')][_0x3ea1('0x5e')]({'where':{'messageId':_0x179cc8[_0x3ea1('0x7b')]}});}break;case _0x3ea1('0x8a'):if(_0x36ba78[_0x3ea1('0x57')][_0x3ea1('0x7b')]&&_0x36ba78[_0x3ea1('0x57')][_0x3ea1('0x24')]){_0x3ee15b=_0x36ba78[_0x3ea1('0x57')][_0x3ea1('0x24')];return db['SmsMessage'][_0x3ea1('0x5e')]({'where':{'messageId':_0x36ba78[_0x3ea1('0x57')][_0x3ea1('0x7b')]}});}break;case _0x3ea1('0xc4'):if(_0x36ba78[_0x3ea1('0x57')][0x0]['message']['id']){_0x3ee15b=_0x36ba78[_0x3ea1('0x57')][0x0][_0x3ea1('0x4e')];return db[_0x3ea1('0x9d')][_0x3ea1('0x5e')]({'where':{'messageId':_0x36ba78[_0x3ea1('0x57')][0x0][_0x3ea1('0x1f')]['id']}});}break;case'intelepeer':if(_0x36ba78[_0x3ea1('0x57')]['redif']&&_0x36ba78[_0x3ea1('0x57')][_0x3ea1('0x24')]){_0x3ee15b=_0x36ba78[_0x3ea1('0x57')][_0x3ea1('0x24')];return db[_0x3ea1('0x9d')][_0x3ea1('0x5e')]({'where':{'messageId':_0x36ba78['body'][_0x3ea1('0xc5')]}});}break;}}})[_0x3ea1('0x17')](handleEntityNotFound(_0x183fde,null))[_0x3ea1('0x17')](function(_0x13f366){if(_0x13f366){_0x8aef54=_0x13f366;switch(_0x37500e[_0x3ea1('0x4e')]){case _0x3ea1('0x7d'):if(_0x3ee15b===_0x3ea1('0xc3')){return _0x8aef54[_0x3ea1('0x5d')]({'read':!![]});}else{logger[_0x3ea1('0x1d')](_0x3ea1('0x1a'),_0x3ea1('0x24'),_0x3ea1('0x7d'),util[_0x3ea1('0xc6')](_0x36ba78[_0x3ea1('0x57')],{'showHidden':![],'depth':null}));}break;case _0x3ea1('0x80'):if(_0x3ee15b==='1'){return _0x8aef54[_0x3ea1('0x5d')]({'read':!![]});}else{logger[_0x3ea1('0x1d')](_0x3ea1('0x1a'),'status',_0x3ea1('0x7d'),util[_0x3ea1('0xc6')](_0x36ba78[_0x3ea1('0x57')],{'showHidden':![],'depth':null}));}break;case _0x3ea1('0xc7'):if(!_0x36ba78[_0x3ea1('0x57')][_0x3ea1('0xc8')]&&_0x3ee15b>=0xc8&&_0x3ee15b<=0xce){return _0x8aef54[_0x3ea1('0x5d')]({'read':!![]});}else{logger['error'](_0x3ea1('0x1a'),'status',_0x3ea1('0xc7'),util['inspect'](_0x36ba78['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xddadaf=_0x36ba78[_0x3ea1('0x57')]['results'][0x0];if(_0xddadaf[_0x3ea1('0x24')][_0x3ea1('0xc2')]===_0x3ea1('0xc3')){return _0x8aef54[_0x3ea1('0x5d')]({'read':!![]});}else{logger[_0x3ea1('0x1d')](_0x3ea1('0x1a'),_0x3ea1('0x24'),_0x3ea1('0x85'),util[_0x3ea1('0xc6')](_0x36ba78['body'],{'showHidden':![],'depth':null}));}break;case _0x3ea1('0x8a'):if(_0x3ee15b==_0x3ea1('0xc9')||_0x3ee15b==_0x3ea1('0xca')){return _0x8aef54[_0x3ea1('0x5d')]({'read':!![]});}else{logger[_0x3ea1('0x1d')](_0x3ea1('0x1a'),_0x3ea1('0x24'),_0x3ea1('0x8a'),util[_0x3ea1('0xc6')](_0x36ba78[_0x3ea1('0x57')],{'showHidden':![],'depth':null}));}break;case _0x3ea1('0xc4'):if(_0x3ee15b=='message-delivered'){return _0x8aef54[_0x3ea1('0x5d')]({'read':!![]});}else{logger[_0x3ea1('0x1d')](_0x3ea1('0x1a'),_0x3ea1('0x24'),'bandwidth',util['inspect'](_0x36ba78[_0x3ea1('0x57')],{'showHidden':![],'depth':null}));}break;case _0x3ea1('0xcb'):if(_0x3ee15b===_0x3ea1('0xcc')||_0x3ee15b==='ACCEPTD'){return _0x8aef54[_0x3ea1('0x5d')]({'read':!![]});}else{logger[_0x3ea1('0x1d')](_0x3ea1('0x1a'),'status','intelepeer',util[_0x3ea1('0xc6')](_0x36ba78[_0x3ea1('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x8aef54;}})['then'](respondWithResult(_0x183fde,null))['catch'](handleError(_0x183fde,null));};exports['statusGet']=function(_0x152c1d,_0x1f99c3,_0x716af4){var _0x4beb85,_0x245708,_0x5b3b2c;return db[_0x3ea1('0x39')][_0x3ea1('0x5e')]({'where':{'id':_0x152c1d[_0x3ea1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1f99c3,null))[_0x3ea1('0x17')](function(_0x307957){if(_0x307957){_0x5b3b2c=_0x307957;logger[_0x3ea1('0x19')](_0x3ea1('0x1a'),_0x3ea1('0x24'),'received\x20delivery\x20report\x20from',_0x307957[_0x3ea1('0x4e')],util[_0x3ea1('0xc6')](_0x152c1d[_0x3ea1('0x3f')],{'showHidden':![],'depth':null}));switch(_0x307957[_0x3ea1('0x4e')]){case _0x3ea1('0x87'):if(_0x152c1d[_0x3ea1('0x3f')][_0x3ea1('0xcd')]&&_0x152c1d[_0x3ea1('0x3f')][_0x3ea1('0xce')]){_0x245708=_0x152c1d['query'][_0x3ea1('0xce')];return db[_0x3ea1('0x9d')]['find']({'where':{'messageId':_0x152c1d[_0x3ea1('0x3f')]['message-id']}});}break;}}})[_0x3ea1('0x17')](handleEntityNotFound(_0x1f99c3,null))[_0x3ea1('0x17')](function(_0x4a9ef4){if(_0x4a9ef4){_0x4beb85=_0x4a9ef4;switch(_0x5b3b2c['type']){case _0x3ea1('0x87'):if(_0x245708==='2'||_0x245708==='6'){return _0x4beb85[_0x3ea1('0x5d')]({'read':!![]});}else{logger[_0x3ea1('0x1d')](_0x3ea1('0x1a'),_0x3ea1('0x24'),_0x3ea1('0x87'),util[_0x3ea1('0xc6')](_0x152c1d[_0x3ea1('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0x4beb85;}})['then'](respondWithResult(_0x1f99c3,null))[_0x3ea1('0x22')](handleError(_0x1f99c3,null));};exports[_0x3ea1('0xcf')]=function(_0x166608,_0x3bce7a,_0x2857da){return db[_0x3ea1('0x39')][_0x3ea1('0x5e')]({'where':{'id':_0x166608[_0x3ea1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3bce7a,null))[_0x3ea1('0x17')](function(_0x5db519){if(_0x5db519){return _0x5db519[_0x3ea1('0xcf')](_0x166608['body'][_0x3ea1('0x68')],_[_0x3ea1('0x95')](_0x166608[_0x3ea1('0x57')],[_0x3ea1('0x68'),'id'])||{})[_0x3ea1('0xbc')](function(_0x39ff92){for(var _0x15eec8=0x0;_0x15eec8<_0x166608[_0x3ea1('0x57')][_0x3ea1('0x68')]['length'];_0x15eec8+=0x1){socket[_0x3ea1('0xd0')](_0x3ea1('0xd1'),{'UserId':Number(_0x166608[_0x3ea1('0x57')][_0x3ea1('0x68')][_0x15eec8]),'SmsAccountId':Number(_0x166608['params']['id'])});}return _0x39ff92;});}})['then'](respondWithResult(_0x3bce7a,null))[_0x3ea1('0x22')](handleError(_0x3bce7a,null));};exports[_0x3ea1('0xd2')]=function(_0x59fe52,_0x59d86d,_0x1748fe){return db[_0x3ea1('0x39')][_0x3ea1('0x5e')]({'where':{'id':_0x59fe52[_0x3ea1('0x5f')]['id']}})['then'](handleEntityNotFound(_0x59d86d,null))['then'](function(_0x5e1712){if(_0x5e1712){return _0x5e1712['removeAgents'](_0x59fe52['query'][_0x3ea1('0x68')])[_0x3ea1('0x17')](function(){if(_['isArray'](_0x59fe52[_0x3ea1('0x3f')][_0x3ea1('0x68')])){for(var _0x3440d1=0x0;_0x3440d1<_0x59fe52[_0x3ea1('0x3f')][_0x3ea1('0x68')]['length'];_0x3440d1+=0x1){socket[_0x3ea1('0xd0')](_0x3ea1('0xd3'),{'UserId':Number(_0x59fe52['query'][_0x3ea1('0x68')][_0x3440d1]),'SmsAccountId':Number(_0x59fe52[_0x3ea1('0x5f')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x59fe52[_0x3ea1('0x3f')][_0x3ea1('0x68')]),'SmsAccountId':Number(_0x59fe52['params']['id'])});}});}})[_0x3ea1('0x17')](respondWithStatusCode(_0x59d86d,null))[_0x3ea1('0x22')](handleError(_0x59d86d,null));};exports[_0x3ea1('0xd4')]=function(_0x56d946,_0x35de26,_0x14f1d){var _0x513979={};var _0x19a070={};var _0x55404a;var _0x67f981;return db[_0x3ea1('0x39')][_0x3ea1('0x64')]({'where':{'id':_0x56d946['params']['id']}})['then'](handleEntityNotFound(_0x35de26,null))[_0x3ea1('0x17')](function(_0x2b4fc2){if(_0x2b4fc2){_0x55404a=_0x2b4fc2;_0x19a070[_0x3ea1('0x3d')]=_['keys'](db[_0x3ea1('0x9f')][_0x3ea1('0x3a')]);_0x19a070[_0x3ea1('0x3f')]=_[_0x3ea1('0x40')](_0x56d946[_0x3ea1('0x3f')]);_0x19a070['filters']=_['intersection'](_0x19a070[_0x3ea1('0x3d')],_0x19a070[_0x3ea1('0x3f')]);_0x513979[_0x3ea1('0x44')]=_[_0x3ea1('0x42')](_0x19a070[_0x3ea1('0x3d')],qs[_0x3ea1('0x43')](_0x56d946[_0x3ea1('0x3f')][_0x3ea1('0x43')]));_0x513979['attributes']=_0x513979['attributes'][_0x3ea1('0x45')]?_0x513979[_0x3ea1('0x44')]:_0x19a070[_0x3ea1('0x3d')];_0x513979['order']=qs['sort'](_0x56d946[_0x3ea1('0x3f')][_0x3ea1('0x49')]);_0x513979['where']=qs[_0x3ea1('0x41')](_['pick'](_0x56d946[_0x3ea1('0x3f')],_0x19a070['filters']));if(_0x56d946['query'][_0x3ea1('0x4c')]){_0x513979[_0x3ea1('0x4a')]=_[_0x3ea1('0x4d')](_0x513979[_0x3ea1('0x4a')],{'$or':_[_0x3ea1('0x3e')](_0x513979[_0x3ea1('0x44')],function(_0x48b2f7){var _0xc8ef3={};_0xc8ef3[_0x48b2f7]={'$like':'%'+_0x56d946['query'][_0x3ea1('0x4c')]+'%'};return _0xc8ef3;})});}_0x513979=_[_0x3ea1('0x4d')]({},_0x513979,_0x56d946['options']);return _0x55404a[_0x3ea1('0xd4')](_0x513979);}})[_0x3ea1('0x17')](function(_0xb98fc6){if(_0xb98fc6){_0x67f981=_0xb98fc6[_0x3ea1('0x45')];if(!_0x56d946['query'][_0x3ea1('0x46')](_0x3ea1('0x47'))){_0x513979['limit']=qs[_0x3ea1('0x27')](_0x56d946[_0x3ea1('0x3f')][_0x3ea1('0x27')]);_0x513979['offset']=qs[_0x3ea1('0x26')](_0x56d946[_0x3ea1('0x3f')][_0x3ea1('0x26')]);}return _0x55404a[_0x3ea1('0xd4')](_0x513979);}})[_0x3ea1('0x17')](function(_0x2a1553){if(_0x2a1553){return _0x2a1553?{'count':_0x67f981,'rows':_0x2a1553}:null;}})[_0x3ea1('0x17')](respondWithResult(_0x35de26,null))[_0x3ea1('0x22')](handleError(_0x35de26,null));};
\ No newline at end of file
index d5f9c21..47f0edd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb90b=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsAccount','setMaxListeners','save'];(function(_0x4e3f46,_0x506747){var _0x3b7230=function(_0x3ddb31){while(--_0x3ddb31){_0x4e3f46['push'](_0x4e3f46['shift']());}};_0x3b7230(++_0x506747);}(_0xb90b,0x1eb));var _0xbb90=function(_0x4f7331,_0x1eff27){_0x4f7331=_0x4f7331-0x0;var _0x2df517=_0xb90b[_0x4f7331];return _0x2df517;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xbb90('0x0'))['db'][_0xbb90('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xbb90('0x2')](0x0);var events={'afterCreate':_0xbb90('0x3'),'afterUpdate':_0xbb90('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7d4f1e){return function(_0x112bbf,_0x458a0f,_0x48fcd6){SmsAccountEvents[_0xbb90('0x5')](_0x7d4f1e+':'+_0x112bbf['id'],_0x112bbf);SmsAccountEvents['emit'](_0x7d4f1e,_0x112bbf);_0x48fcd6(null);};}for(var e in events){if(events[_0xbb90('0x6')](e)){var event=events[e];SmsAccount[_0xbb90('0x7')](e,emitEvent(event));}}module[_0xbb90('0x8')]=SmsAccountEvents;
\ No newline at end of file
+var _0x1a0c=['../../mysqldb','SmsAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x6e8f5c,_0x5f0829){var _0x5555d2=function(_0x34fa09){while(--_0x34fa09){_0x6e8f5c['push'](_0x6e8f5c['shift']());}};_0x5555d2(++_0x5f0829);}(_0x1a0c,0x15e));var _0xc1a0=function(_0x43bed9,_0x26adca){_0x43bed9=_0x43bed9-0x0;var _0x27b03d=_0x1a0c[_0x43bed9];return _0x27b03d;};'use strict';var EventEmitter=require(_0xc1a0('0x0'));var SmsAccount=require(_0xc1a0('0x1'))['db'][_0xc1a0('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xc1a0('0x3')](0x0);var events={'afterCreate':_0xc1a0('0x4'),'afterUpdate':_0xc1a0('0x5'),'afterDestroy':'remove'};function emitEvent(_0x6b4015){return function(_0x42edbd,_0xb7f787,_0x11c8e2){SmsAccountEvents[_0xc1a0('0x6')](_0x6b4015+':'+_0x42edbd['id'],_0x42edbd);SmsAccountEvents[_0xc1a0('0x6')](_0x6b4015,_0x42edbd);_0x11c8e2(null);};}for(var e in events){if(events[_0xc1a0('0x7')](e)){var event=events[e];SmsAccount[_0xc1a0('0x8')](e,emitEvent(event));}}module['exports']=SmsAccountEvents;
\ No newline at end of file
index 80e79fc..fd3491c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe43d=['request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','define','lodash','util','api','moment','bluebird'];(function(_0x245307,_0x12cbb9){var _0x4cf712=function(_0x1ee4af){while(--_0x1ee4af){_0x245307['push'](_0x245307['shift']());}};_0x4cf712(++_0x12cbb9);}(_0xe43d,0x150));var _0xde43=function(_0x26d9b3,_0x591f4e){_0x26d9b3=_0x26d9b3-0x0;var _0x15c226=_0xe43d[_0x26d9b3];return _0x15c226;};'use strict';var _=require(_0xde43('0x0'));var util=require(_0xde43('0x1'));var logger=require('../../config/logger')(_0xde43('0x2'));var moment=require(_0xde43('0x3'));var BPromise=require(_0xde43('0x4'));var rp=require(_0xde43('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde43('0x6'));var config=require(_0xde43('0x7'));var attributes=require(_0xde43('0x8'));module[_0xde43('0x9')]=function(_0x501bf6,_0x2951f7){return _0x501bf6[_0xde43('0xa')]('SmsAccount',attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a41=['../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x2fe781,_0x357146){var _0x1443c7=function(_0x1f4a26){while(--_0x1f4a26){_0x2fe781['push'](_0x2fe781['shift']());}};_0x1443c7(++_0x357146);}(_0x0a41,0x1b8));var _0x10a4=function(_0x4fb73e,_0x17f37d){_0x4fb73e=_0x4fb73e-0x0;var _0x14de68=_0x0a41[_0x4fb73e];return _0x14de68;};'use strict';var _=require(_0x10a4('0x0'));var util=require(_0x10a4('0x1'));var logger=require(_0x10a4('0x2'))('api');var moment=require(_0x10a4('0x3'));var BPromise=require(_0x10a4('0x4'));var rp=require(_0x10a4('0x5'));var fs=require('fs');var path=require(_0x10a4('0x6'));var rimraf=require(_0x10a4('0x7'));var config=require(_0x10a4('0x8'));var attributes=require(_0x10a4('0x9'));module[_0x10a4('0xa')]=function(_0x34e3ed,_0x25cadf){return _0x34e3ed[_0x10a4('0xb')](_0x10a4('0xc'),attributes,{'tableName':_0x10a4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e972d55..ad4f216 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe408=['./smsAccount.socket','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x5d963e,_0x5edbfe){var _0x523c8e=function(_0x58d7ae){while(--_0x58d7ae){_0x5d963e['push'](_0x5d963e['shift']());}};_0x523c8e(++_0x5edbfe);}(_0xe408,0x14e));var _0x8e40=function(_0x44946b,_0xf874ec){_0x44946b=_0x44946b-0x0;var _0x249bc4=_0xe408[_0x44946b];return _0x249bc4;};'use strict';var _=require(_0x8e40('0x0'));var util=require(_0x8e40('0x1'));var moment=require(_0x8e40('0x2'));var BPromise=require(_0x8e40('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e40('0x4'));var db=require(_0x8e40('0x5'))['db'];var utils=require(_0x8e40('0x6'));var logger=require(_0x8e40('0x7'))(_0x8e40('0x8'));var config=require(_0x8e40('0x9'));var jayson=require(_0x8e40('0xa'));var client=jayson[_0x8e40('0xb')][_0x8e40('0xc')]({'port':0x232a});config[_0x8e40('0xd')]=_[_0x8e40('0xe')](config[_0x8e40('0xd')],{'host':_0x8e40('0xf'),'port':0x18eb});var socket=require(_0x8e40('0x10'))(new Redis(config[_0x8e40('0xd')]));require(_0x8e40('0x11'))[_0x8e40('0x12')](socket);function respondWithRpcPromise(_0x258941,_0x2d50dc,_0x5bdae3){return new BPromise(function(_0x36100c,_0x790ef2){return client[_0x8e40('0x13')](_0x258941,_0x5bdae3)['then'](function(_0x3bad04){logger[_0x8e40('0x14')](_0x8e40('0x15'),_0x2d50dc,_0x8e40('0x16'));logger[_0x8e40('0x17')](_0x8e40('0x18'),_0x2d50dc,_0x8e40('0x16'),JSON['stringify'](_0x3bad04));if(_0x3bad04[_0x8e40('0x19')]){if(_0x3bad04[_0x8e40('0x19')]['code']===0x1f4){logger[_0x8e40('0x19')](_0x8e40('0x15'),_0x2d50dc,_0x3bad04[_0x8e40('0x19')][_0x8e40('0x1a')]);return _0x790ef2(_0x3bad04[_0x8e40('0x19')][_0x8e40('0x1a')]);}logger[_0x8e40('0x19')](_0x8e40('0x15'),_0x2d50dc,_0x3bad04[_0x8e40('0x19')]['message']);return _0x36100c(_0x3bad04[_0x8e40('0x19')]['message']);}else{logger['info'](_0x8e40('0x15'),_0x2d50dc,'request\x20sent');_0x36100c(_0x3bad04['result'][_0x8e40('0x1a')]);}})['catch'](function(_0x555e43){logger[_0x8e40('0x19')](_0x8e40('0x15'),_0x2d50dc,_0x555e43);_0x790ef2(_0x555e43);});});}exports[_0x8e40('0x1b')]=function(_0x3e277f){var _0x2c9946=this;return new Promise(function(_0x3c8996,_0x4a928d){return db[_0x8e40('0x1c')][_0x8e40('0x1d')]({'raw':_0x3e277f['options']?_0x3e277f[_0x8e40('0x1e')][_0x8e40('0x1f')]===undefined?!![]:![]:!![],'where':_0x3e277f['options']?_0x3e277f[_0x8e40('0x1e')][_0x8e40('0x20')]||null:null,'attributes':_0x3e277f[_0x8e40('0x1e')]?_0x3e277f[_0x8e40('0x1e')][_0x8e40('0x21')]||null:null,'include':_0x3e277f[_0x8e40('0x1e')]?_0x3e277f['options'][_0x8e40('0x22')]?_[_0x8e40('0x23')](_0x3e277f['options'][_0x8e40('0x22')],function(_0x46d864){return{'model':db[_0x46d864[_0x8e40('0x24')]],'as':_0x46d864['as'],'attributes':_0x46d864[_0x8e40('0x21')],'include':_0x46d864[_0x8e40('0x22')]?_[_0x8e40('0x23')](_0x46d864[_0x8e40('0x22')],function(_0x399d80){return{'model':db[_0x399d80[_0x8e40('0x24')]],'as':_0x399d80['as'],'attributes':_0x399d80[_0x8e40('0x21')],'include':_0x399d80[_0x8e40('0x22')]?_[_0x8e40('0x23')](_0x399d80['include'],function(_0x4d334b){return{'model':db[_0x4d334b[_0x8e40('0x24')]],'as':_0x4d334b['as'],'attributes':_0x4d334b[_0x8e40('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf0b058){logger['info'](_0x8e40('0x1b'),_0x3e277f);logger[_0x8e40('0x17')](_0x8e40('0x1b'),_0x3e277f,JSON[_0x8e40('0x25')](_0xf0b058));_0x3c8996(_0xf0b058);})[_0x8e40('0x26')](function(_0x313d6c){logger[_0x8e40('0x19')](_0x8e40('0x1b'),_0x313d6c[_0x8e40('0x1a')],_0x3e277f);_0x4a928d(_0x2c9946[_0x8e40('0x19')](0x1f4,_0x313d6c[_0x8e40('0x1a')]));});});};
\ No newline at end of file
+var _0x4fc4=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','options','where','include','map','model','attributes','debug'];(function(_0x5bd5ff,_0x48e5b5){var _0x3eb376=function(_0xa84252){while(--_0xa84252){_0x5bd5ff['push'](_0x5bd5ff['shift']());}};_0x3eb376(++_0x48e5b5);}(_0x4fc4,0x168));var _0x44fc=function(_0x1ef804,_0x294bf4){_0x1ef804=_0x1ef804-0x0;var _0x2da202=_0x4fc4[_0x1ef804];return _0x2da202;};'use strict';var _=require(_0x44fc('0x0'));var util=require(_0x44fc('0x1'));var moment=require(_0x44fc('0x2'));var BPromise=require(_0x44fc('0x3'));var rs=require(_0x44fc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x44fc('0x5'))['db'];var utils=require(_0x44fc('0x6'));var logger=require(_0x44fc('0x7'))(_0x44fc('0x8'));var config=require(_0x44fc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x44fc('0xa')][_0x44fc('0xb')]({'port':0x232a});config[_0x44fc('0xc')]=_[_0x44fc('0xd')](config[_0x44fc('0xc')],{'host':_0x44fc('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x44fc('0xc')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x598367,_0x4130b7,_0x1a0cab){return new BPromise(function(_0x183372,_0x43deff){return client[_0x44fc('0xf')](_0x598367,_0x1a0cab)[_0x44fc('0x10')](function(_0x11bc31){logger[_0x44fc('0x11')](_0x44fc('0x12'),_0x4130b7,_0x44fc('0x13'));logger['debug'](_0x44fc('0x14'),_0x4130b7,_0x44fc('0x13'),JSON[_0x44fc('0x15')](_0x11bc31));if(_0x11bc31[_0x44fc('0x16')]){if(_0x11bc31[_0x44fc('0x16')][_0x44fc('0x17')]===0x1f4){logger[_0x44fc('0x16')](_0x44fc('0x12'),_0x4130b7,_0x11bc31[_0x44fc('0x16')][_0x44fc('0x18')]);return _0x43deff(_0x11bc31[_0x44fc('0x16')][_0x44fc('0x18')]);}logger[_0x44fc('0x16')](_0x44fc('0x12'),_0x4130b7,_0x11bc31[_0x44fc('0x16')][_0x44fc('0x18')]);return _0x183372(_0x11bc31[_0x44fc('0x16')]['message']);}else{logger[_0x44fc('0x11')](_0x44fc('0x12'),_0x4130b7,'request\x20sent');_0x183372(_0x11bc31[_0x44fc('0x19')][_0x44fc('0x18')]);}})[_0x44fc('0x1a')](function(_0x31d17f){logger[_0x44fc('0x16')]('SmsAccount,\x20%s,\x20%s',_0x4130b7,_0x31d17f);_0x43deff(_0x31d17f);});});}exports[_0x44fc('0x1b')]=function(_0xe81f09){var _0x32fabb=this;return new Promise(function(_0x210e3e,_0x14c1de){return db[_0x44fc('0x1c')]['find']({'raw':_0xe81f09[_0x44fc('0x1d')]?_0xe81f09['options']['raw']===undefined?!![]:![]:!![],'where':_0xe81f09[_0x44fc('0x1d')]?_0xe81f09['options'][_0x44fc('0x1e')]||null:null,'attributes':_0xe81f09[_0x44fc('0x1d')]?_0xe81f09[_0x44fc('0x1d')]['attributes']||null:null,'include':_0xe81f09['options']?_0xe81f09[_0x44fc('0x1d')][_0x44fc('0x1f')]?_[_0x44fc('0x20')](_0xe81f09['options'][_0x44fc('0x1f')],function(_0x5cc32a){return{'model':db[_0x5cc32a[_0x44fc('0x21')]],'as':_0x5cc32a['as'],'attributes':_0x5cc32a['attributes'],'include':_0x5cc32a[_0x44fc('0x1f')]?_[_0x44fc('0x20')](_0x5cc32a['include'],function(_0x83b0d3){return{'model':db[_0x83b0d3['model']],'as':_0x83b0d3['as'],'attributes':_0x83b0d3[_0x44fc('0x22')],'include':_0x83b0d3[_0x44fc('0x1f')]?_[_0x44fc('0x20')](_0x83b0d3[_0x44fc('0x1f')],function(_0x2d7d73){return{'model':db[_0x2d7d73['model']],'as':_0x2d7d73['as'],'attributes':_0x2d7d73[_0x44fc('0x22')]};}):[]};}):[]};}):[]:[]})[_0x44fc('0x10')](function(_0x5d2694){logger[_0x44fc('0x11')](_0x44fc('0x1b'),_0xe81f09);logger[_0x44fc('0x23')](_0x44fc('0x1b'),_0xe81f09,JSON[_0x44fc('0x15')](_0x5d2694));_0x210e3e(_0x5d2694);})[_0x44fc('0x1a')](function(_0x1a685c){logger[_0x44fc('0x16')]('ShowSmsAccount',_0x1a685c[_0x44fc('0x18')],_0xe81f09);_0x14c1de(_0x32fabb[_0x44fc('0x16')](0x1f4,_0x1a685c[_0x44fc('0x18')]));});});};
\ No newline at end of file
index 7984fcc..6f4515a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index 9d490de..4cc9799 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x50fc74,_0x141aa4){var _0x2fda7d=function(_0x19ac6a){while(--_0x19ac6a){_0x50fc74['push'](_0x50fc74['shift']());}};_0x2fda7d(++_0x141aa4);}(_0xedd9,0xfc));var _0x9edd=function(_0x2a983c,_0x12f857){_0x2a983c=_0x2a983c-0x0;var _0xcadcca=_0xedd9[_0x2a983c];return _0xcadcca;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x2433eb,_0x2be63d){var _0x33bb71=function(_0x4be355){while(--_0x4be355){_0x2433eb['push'](_0x2433eb['shift']());}};_0x33bb71(++_0x2be63d);}(_0x7217,0x19e));var _0x7721=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x7217[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router;
\ No newline at end of file
index c77386e..1d71a78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ccd=['*,*,*,*','TEXT','STRING'];(function(_0xf0853d,_0x56dad3){var _0x49d66d=function(_0x1850a2){while(--_0x1850a2){_0xf0853d['push'](_0xf0853d['shift']());}};_0x49d66d(++_0x56dad3);}(_0x5ccd,0x1b1));var _0xd5cc=function(_0x88f8ca,_0x1e419a){_0x88f8ca=_0x88f8ca-0x0;var _0x46f4b1=_0x5ccd[_0x88f8ca];return _0x46f4b1;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd5cc('0x0')]()},'description':{'type':Sequelize[_0xd5cc('0x1')]},'interval':{'type':Sequelize[_0xd5cc('0x1')],'defaultValue':_0xd5cc('0x2')}};
\ No newline at end of file
+var _0x651e=['TEXT','STRING','sequelize','noop'];(function(_0x538230,_0x522250){var _0x30f32b=function(_0x37a340){while(--_0x37a340){_0x538230['push'](_0x538230['shift']());}};_0x30f32b(++_0x522250);}(_0x651e,0x192));var _0xe651=function(_0x3a00e0,_0x29d175){_0x3a00e0=_0x3a00e0-0x0;var _0x357b64=_0x651e[_0x3a00e0];return _0x357b64;};'use strict';var Sequelize=require(_0xe651('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe651('0x1')},'appdata':{'type':Sequelize[_0xe651('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe651('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 5873065..b847e4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4d6=['fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','SmsApplication','rawAttributes','fieldName','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','rimraf','zip-dir'];(function(_0x4aaaef,_0x4cd2d0){var _0xbe59a=function(_0x271997){while(--_0x271997){_0x4aaaef['push'](_0x4aaaef['shift']());}};_0xbe59a(++_0x4cd2d0);}(_0xd4d6,0xe2));var _0x6d4d=function(_0x4288e6,_0xcb38df){_0x4288e6=_0x4288e6-0x0;var _0x28e00e=_0xd4d6[_0x4288e6];return _0x28e00e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6d4d('0x0'));var zipdir=require(_0x6d4d('0x1'));var jsonpatch=require(_0x6d4d('0x2'));var rp=require(_0x6d4d('0x3'));var moment=require(_0x6d4d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6d4d('0x5'));var util=require(_0x6d4d('0x6'));var path=require(_0x6d4d('0x7'));var sox=require(_0x6d4d('0x8'));var csv=require(_0x6d4d('0x9'));var ejs=require(_0x6d4d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6d4d('0xb'));var squel=require(_0x6d4d('0xc'));var crypto=require(_0x6d4d('0xd'));var jsforce=require(_0x6d4d('0xe'));var deskjs=require(_0x6d4d('0xf'));var toCsv=require(_0x6d4d('0x9'));var querystring=require('querystring');var Papa=require(_0x6d4d('0x10'));var Redis=require(_0x6d4d('0x11'));var authService=require(_0x6d4d('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d4d('0x13'));var logger=require(_0x6d4d('0x14'))(_0x6d4d('0x15'));var utils=require(_0x6d4d('0x16'));var config=require(_0x6d4d('0x17'));var licenseUtil=require(_0x6d4d('0x18'));var db=require(_0x6d4d('0x19'))['db'];function respondWithStatusCode(_0x2076de,_0xcb0750){_0xcb0750=_0xcb0750||0xcc;return function(_0x26c1ca){if(_0x26c1ca){return _0x2076de['sendStatus'](_0xcb0750);}return _0x2076de[_0x6d4d('0x1a')](_0xcb0750)[_0x6d4d('0x1b')]();};}function respondWithResult(_0x1708d3,_0x42161e){_0x42161e=_0x42161e||0xc8;return function(_0x1d3019){if(_0x1d3019){return _0x1708d3['status'](_0x42161e)[_0x6d4d('0x1c')](_0x1d3019);}};}function respondWithFilteredResult(_0x58cc07,_0x1c5237){return function(_0x1b95af){if(_0x1b95af){var _0xeaa0b2=typeof _0x1c5237[_0x6d4d('0x1d')]===_0x6d4d('0x1e')&&typeof _0x1c5237['limit']===_0x6d4d('0x1e');var _0x52064e=_0x1b95af[_0x6d4d('0x1f')];var _0xa66857=_0xeaa0b2?0x0:_0x1c5237[_0x6d4d('0x1d')];var _0x2b7274=_0xeaa0b2?_0x1b95af[_0x6d4d('0x1f')]:_0x1c5237['offset']+_0x1c5237[_0x6d4d('0x20')];var _0x23666e;if(_0x2b7274>=_0x52064e){_0x2b7274=_0x52064e;_0x23666e=0xc8;}else{_0x23666e=0xce;}_0x58cc07[_0x6d4d('0x1a')](_0x23666e);return _0x58cc07[_0x6d4d('0x21')](_0x6d4d('0x22'),_0xa66857+'-'+_0x2b7274+'/'+_0x52064e)[_0x6d4d('0x1c')](_0x1b95af);}return null;};}function patchUpdates(_0xafd66d){return function(_0x55493f){try{jsonpatch[_0x6d4d('0x23')](_0x55493f,_0xafd66d,!![]);}catch(_0x402791){return BPromise[_0x6d4d('0x24')](_0x402791);}return _0x55493f[_0x6d4d('0x25')]();};}function saveUpdates(_0x76abd8,_0x3280a7){return function(_0x4ac395){if(_0x4ac395){return _0x4ac395[_0x6d4d('0x26')](_0x76abd8)[_0x6d4d('0x27')](function(_0x331188){return _0x331188;});}return null;};}function removeEntity(_0x1bcf8d,_0x29ad47){return function(_0x1b5dea){if(_0x1b5dea){return _0x1b5dea[_0x6d4d('0x28')]()[_0x6d4d('0x27')](function(){_0x1bcf8d[_0x6d4d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x514e11,_0x33de3b){return function(_0x195751){if(!_0x195751){_0x514e11[_0x6d4d('0x29')](0x194);}return _0x195751;};}function handleError(_0x108c2b,_0x52db06){_0x52db06=_0x52db06||0x1f4;return function(_0x564056){logger[_0x6d4d('0x2a')](_0x564056[_0x6d4d('0x2b')]);if(_0x564056['name']){delete _0x564056[_0x6d4d('0x2c')];}_0x108c2b[_0x6d4d('0x1a')](_0x52db06)['send'](_0x564056);};}exports[_0x6d4d('0x2d')]=function(_0x5d3e4,_0x3ef436){var _0x250af9={},_0x16765b={},_0x833ded={'count':0x0,'rows':[]};var _0x41ae51=_[_0x6d4d('0x2e')](db[_0x6d4d('0x2f')][_0x6d4d('0x30')],function(_0x173285){return{'name':_0x173285[_0x6d4d('0x31')],'type':_0x173285['type']['key']};});_0x16765b['model']=_['map'](_0x41ae51,'name');_0x16765b['query']=_[_0x6d4d('0x32')](_0x5d3e4[_0x6d4d('0x33')]);_0x16765b[_0x6d4d('0x34')]=_[_0x6d4d('0x35')](_0x16765b[_0x6d4d('0x36')],_0x16765b[_0x6d4d('0x33')]);_0x250af9[_0x6d4d('0x37')]=_[_0x6d4d('0x35')](_0x16765b[_0x6d4d('0x36')],qs[_0x6d4d('0x38')](_0x5d3e4[_0x6d4d('0x33')]['fields']));_0x250af9[_0x6d4d('0x37')]=_0x250af9['attributes'][_0x6d4d('0x39')]?_0x250af9[_0x6d4d('0x37')]:_0x16765b['model'];if(!_0x5d3e4[_0x6d4d('0x33')][_0x6d4d('0x3a')]('nolimit')){_0x250af9[_0x6d4d('0x20')]=qs[_0x6d4d('0x20')](_0x5d3e4[_0x6d4d('0x33')][_0x6d4d('0x20')]);_0x250af9[_0x6d4d('0x1d')]=qs[_0x6d4d('0x1d')](_0x5d3e4[_0x6d4d('0x33')]['offset']);}_0x250af9[_0x6d4d('0x3b')]=qs[_0x6d4d('0x3c')](_0x5d3e4[_0x6d4d('0x33')][_0x6d4d('0x3c')]);_0x250af9['where']=qs[_0x6d4d('0x34')](_['pick'](_0x5d3e4['query'],_0x16765b[_0x6d4d('0x34')]),_0x41ae51);if(_0x5d3e4[_0x6d4d('0x33')][_0x6d4d('0x3d')]){_0x250af9[_0x6d4d('0x3e')]=_['merge'](_0x250af9[_0x6d4d('0x3e')],{'$or':_['map'](_0x41ae51,function(_0x1529f1){if(_0x1529f1[_0x6d4d('0x3f')]!==_0x6d4d('0x40')){var _0x578c60={};_0x578c60[_0x1529f1[_0x6d4d('0x2c')]]={'$like':'%'+_0x5d3e4[_0x6d4d('0x33')]['filter']+'%'};return _0x578c60;}})});}_0x250af9=_[_0x6d4d('0x41')]({},_0x250af9,_0x5d3e4[_0x6d4d('0x42')]);var _0x11357a={'where':_0x250af9[_0x6d4d('0x3e')]};return db[_0x6d4d('0x2f')][_0x6d4d('0x1f')](_0x11357a)[_0x6d4d('0x27')](function(_0x4cb574){_0x833ded[_0x6d4d('0x1f')]=_0x4cb574;if(_0x5d3e4[_0x6d4d('0x33')][_0x6d4d('0x43')]){_0x250af9[_0x6d4d('0x44')]=[{'all':!![]}];}return db['SmsApplication'][_0x6d4d('0x45')](_0x250af9);})[_0x6d4d('0x27')](function(_0x1578b8){_0x833ded[_0x6d4d('0x46')]=_0x1578b8;return _0x833ded;})[_0x6d4d('0x27')](respondWithFilteredResult(_0x3ef436,_0x250af9))[_0x6d4d('0x47')](handleError(_0x3ef436,null));};exports['show']=function(_0x56be1e,_0x2a2787){var _0x4a0b9b={'raw':!![],'where':{'id':_0x56be1e[_0x6d4d('0x48')]['id']}},_0x45cfc1={};_0x45cfc1[_0x6d4d('0x36')]=_['keys'](db[_0x6d4d('0x2f')][_0x6d4d('0x30')]);_0x45cfc1[_0x6d4d('0x33')]=_[_0x6d4d('0x32')](_0x56be1e[_0x6d4d('0x33')]);_0x45cfc1[_0x6d4d('0x34')]=_[_0x6d4d('0x35')](_0x45cfc1[_0x6d4d('0x36')],_0x45cfc1[_0x6d4d('0x33')]);_0x4a0b9b[_0x6d4d('0x37')]=_[_0x6d4d('0x35')](_0x45cfc1['model'],qs[_0x6d4d('0x38')](_0x56be1e[_0x6d4d('0x33')][_0x6d4d('0x38')]));_0x4a0b9b[_0x6d4d('0x37')]=_0x4a0b9b['attributes']['length']?_0x4a0b9b['attributes']:_0x45cfc1['model'];if(_0x56be1e['query'][_0x6d4d('0x43')]){_0x4a0b9b['include']=[{'all':!![]}];}_0x4a0b9b=_['merge']({},_0x4a0b9b,_0x56be1e[_0x6d4d('0x42')]);return db[_0x6d4d('0x2f')][_0x6d4d('0x49')](_0x4a0b9b)[_0x6d4d('0x27')](handleEntityNotFound(_0x2a2787,null))[_0x6d4d('0x27')](respondWithResult(_0x2a2787,null))[_0x6d4d('0x47')](handleError(_0x2a2787,null));};exports[_0x6d4d('0x4a')]=function(_0x55d40a,_0x3745e8){return db['SmsApplication'][_0x6d4d('0x4a')](_0x55d40a[_0x6d4d('0x4b')],{})[_0x6d4d('0x27')](respondWithResult(_0x3745e8,0xc9))[_0x6d4d('0x47')](handleError(_0x3745e8,null));};exports[_0x6d4d('0x26')]=function(_0x2a32e2,_0x533c4e){if(_0x2a32e2[_0x6d4d('0x4b')]['id']){delete _0x2a32e2['body']['id'];}return db[_0x6d4d('0x2f')][_0x6d4d('0x49')]({'where':{'id':_0x2a32e2['params']['id']}})['then'](handleEntityNotFound(_0x533c4e,null))['then'](saveUpdates(_0x2a32e2[_0x6d4d('0x4b')],null))[_0x6d4d('0x27')](respondWithResult(_0x533c4e,null))['catch'](handleError(_0x533c4e,null));};exports[_0x6d4d('0x28')]=function(_0x3eb0c2,_0x1ef490){return db[_0x6d4d('0x2f')]['find']({'where':{'id':_0x3eb0c2[_0x6d4d('0x48')]['id']}})['then'](handleEntityNotFound(_0x1ef490,null))['then'](removeEntity(_0x1ef490,null))[_0x6d4d('0x47')](handleError(_0x1ef490,null));};
\ No newline at end of file
+var _0x5730=['sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','destroy','then','error','name','send','index','map','SmsApplication','rawAttributes','type','key','query','filters','intersection','attributes','length','model','hasOwnProperty','limit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','keys','fields','options','body','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x2d3d0d,_0x67ac82){var _0xca35b6=function(_0x483979){while(--_0x483979){_0x2d3d0d['push'](_0x2d3d0d['shift']());}};_0xca35b6(++_0x67ac82);}(_0x5730,0x1e4));var _0x0573=function(_0x287a56,_0x16836e){_0x287a56=_0x287a56-0x0;var _0x27d07c=_0x5730[_0x287a56];return _0x27d07c;};'use strict';var emlformat=require(_0x0573('0x0'));var rimraf=require(_0x0573('0x1'));var zipdir=require(_0x0573('0x2'));var jsonpatch=require(_0x0573('0x3'));var rp=require(_0x0573('0x4'));var moment=require(_0x0573('0x5'));var BPromise=require(_0x0573('0x6'));var Mustache=require(_0x0573('0x7'));var util=require('util');var path=require('path');var sox=require(_0x0573('0x8'));var csv=require(_0x0573('0x9'));var ejs=require(_0x0573('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0573('0xb'));var squel=require(_0x0573('0xc'));var crypto=require(_0x0573('0xd'));var jsforce=require(_0x0573('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0573('0x9'));var querystring=require(_0x0573('0xf'));var Papa=require(_0x0573('0x10'));var Redis=require(_0x0573('0x11'));var authService=require(_0x0573('0x12'));var qs=require(_0x0573('0x13'));var as=require(_0x0573('0x14'));var hardwareService=require(_0x0573('0x15'));var logger=require(_0x0573('0x16'))(_0x0573('0x17'));var utils=require(_0x0573('0x18'));var config=require(_0x0573('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x0573('0x1a'))['db'];function respondWithStatusCode(_0x575812,_0x1d336d){_0x1d336d=_0x1d336d||0xcc;return function(_0x5aae43){if(_0x5aae43){return _0x575812[_0x0573('0x1b')](_0x1d336d);}return _0x575812[_0x0573('0x1c')](_0x1d336d)[_0x0573('0x1d')]();};}function respondWithResult(_0x4b5212,_0x3dad56){_0x3dad56=_0x3dad56||0xc8;return function(_0x1748eb){if(_0x1748eb){return _0x4b5212[_0x0573('0x1c')](_0x3dad56)[_0x0573('0x1e')](_0x1748eb);}};}function respondWithFilteredResult(_0x5ad2b5,_0x5e94ce){return function(_0x11eb90){if(_0x11eb90){var _0x4a10e5=typeof _0x5e94ce[_0x0573('0x1f')]===_0x0573('0x20')&&typeof _0x5e94ce['limit']==='undefined';var _0x5655e6=_0x11eb90[_0x0573('0x21')];var _0x5373a2=_0x4a10e5?0x0:_0x5e94ce['offset'];var _0x8f41cc=_0x4a10e5?_0x11eb90[_0x0573('0x21')]:_0x5e94ce[_0x0573('0x1f')]+_0x5e94ce['limit'];var _0x2867f4;if(_0x8f41cc>=_0x5655e6){_0x8f41cc=_0x5655e6;_0x2867f4=0xc8;}else{_0x2867f4=0xce;}_0x5ad2b5['status'](_0x2867f4);return _0x5ad2b5[_0x0573('0x22')](_0x0573('0x23'),_0x5373a2+'-'+_0x8f41cc+'/'+_0x5655e6)[_0x0573('0x1e')](_0x11eb90);}return null;};}function patchUpdates(_0x59b572){return function(_0xc7fe2a){try{jsonpatch['apply'](_0xc7fe2a,_0x59b572,!![]);}catch(_0x22b445){return BPromise['reject'](_0x22b445);}return _0xc7fe2a['save']();};}function saveUpdates(_0x1c476a,_0x32ffa5){return function(_0x32b5d3){if(_0x32b5d3){return _0x32b5d3[_0x0573('0x24')](_0x1c476a)['then'](function(_0x5294e4){return _0x5294e4;});}return null;};}function removeEntity(_0x181b84,_0x18cdb6){return function(_0x1e90d1){if(_0x1e90d1){return _0x1e90d1[_0x0573('0x25')]()[_0x0573('0x26')](function(){_0x181b84[_0x0573('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa4f6c,_0xffd746){return function(_0x1fea31){if(!_0x1fea31){_0xa4f6c[_0x0573('0x1b')](0x194);}return _0x1fea31;};}function handleError(_0x1052e0,_0x3f2332){_0x3f2332=_0x3f2332||0x1f4;return function(_0x2d284c){logger[_0x0573('0x27')](_0x2d284c['stack']);if(_0x2d284c[_0x0573('0x28')]){delete _0x2d284c[_0x0573('0x28')];}_0x1052e0[_0x0573('0x1c')](_0x3f2332)[_0x0573('0x29')](_0x2d284c);};}exports[_0x0573('0x2a')]=function(_0x569f46,_0xef0268){var _0x1b529a={},_0x61deca={},_0x4a123f={'count':0x0,'rows':[]};var _0x2c077c=_[_0x0573('0x2b')](db[_0x0573('0x2c')][_0x0573('0x2d')],function(_0x2a90e7){return{'name':_0x2a90e7['fieldName'],'type':_0x2a90e7[_0x0573('0x2e')][_0x0573('0x2f')]};});_0x61deca['model']=_[_0x0573('0x2b')](_0x2c077c,'name');_0x61deca[_0x0573('0x30')]=_['keys'](_0x569f46[_0x0573('0x30')]);_0x61deca[_0x0573('0x31')]=_[_0x0573('0x32')](_0x61deca['model'],_0x61deca[_0x0573('0x30')]);_0x1b529a['attributes']=_[_0x0573('0x32')](_0x61deca['model'],qs['fields'](_0x569f46[_0x0573('0x30')]['fields']));_0x1b529a['attributes']=_0x1b529a[_0x0573('0x33')][_0x0573('0x34')]?_0x1b529a[_0x0573('0x33')]:_0x61deca[_0x0573('0x35')];if(!_0x569f46[_0x0573('0x30')][_0x0573('0x36')]('nolimit')){_0x1b529a[_0x0573('0x37')]=qs[_0x0573('0x37')](_0x569f46[_0x0573('0x30')][_0x0573('0x37')]);_0x1b529a['offset']=qs[_0x0573('0x1f')](_0x569f46[_0x0573('0x30')]['offset']);}_0x1b529a['order']=qs[_0x0573('0x38')](_0x569f46['query'][_0x0573('0x38')]);_0x1b529a[_0x0573('0x39')]=qs[_0x0573('0x31')](_[_0x0573('0x3a')](_0x569f46[_0x0573('0x30')],_0x61deca[_0x0573('0x31')]),_0x2c077c);if(_0x569f46['query'][_0x0573('0x3b')]){_0x1b529a['where']=_[_0x0573('0x3c')](_0x1b529a[_0x0573('0x39')],{'$or':_[_0x0573('0x2b')](_0x2c077c,function(_0x193615){if(_0x193615['type']!=='VIRTUAL'){var _0x27a6fc={};_0x27a6fc[_0x193615[_0x0573('0x28')]]={'$like':'%'+_0x569f46['query'][_0x0573('0x3b')]+'%'};return _0x27a6fc;}})});}_0x1b529a=_[_0x0573('0x3c')]({},_0x1b529a,_0x569f46['options']);var _0xde2091={'where':_0x1b529a[_0x0573('0x39')]};return db[_0x0573('0x2c')][_0x0573('0x21')](_0xde2091)['then'](function(_0x208d66){_0x4a123f[_0x0573('0x21')]=_0x208d66;if(_0x569f46['query'][_0x0573('0x3d')]){_0x1b529a[_0x0573('0x3e')]=[{'all':!![]}];}return db['SmsApplication'][_0x0573('0x3f')](_0x1b529a);})[_0x0573('0x26')](function(_0x1d8cb2){_0x4a123f[_0x0573('0x40')]=_0x1d8cb2;return _0x4a123f;})['then'](respondWithFilteredResult(_0xef0268,_0x1b529a))['catch'](handleError(_0xef0268,null));};exports[_0x0573('0x41')]=function(_0x360765,_0xc1cc2a){var _0x174cda={'raw':!![],'where':{'id':_0x360765[_0x0573('0x42')]['id']}},_0x31c3b8={};_0x31c3b8[_0x0573('0x35')]=_[_0x0573('0x43')](db['SmsApplication'][_0x0573('0x2d')]);_0x31c3b8[_0x0573('0x30')]=_[_0x0573('0x43')](_0x360765[_0x0573('0x30')]);_0x31c3b8['filters']=_[_0x0573('0x32')](_0x31c3b8[_0x0573('0x35')],_0x31c3b8[_0x0573('0x30')]);_0x174cda['attributes']=_[_0x0573('0x32')](_0x31c3b8[_0x0573('0x35')],qs[_0x0573('0x44')](_0x360765[_0x0573('0x30')]['fields']));_0x174cda[_0x0573('0x33')]=_0x174cda[_0x0573('0x33')][_0x0573('0x34')]?_0x174cda[_0x0573('0x33')]:_0x31c3b8[_0x0573('0x35')];if(_0x360765[_0x0573('0x30')][_0x0573('0x3d')]){_0x174cda['include']=[{'all':!![]}];}_0x174cda=_['merge']({},_0x174cda,_0x360765[_0x0573('0x45')]);return db[_0x0573('0x2c')]['find'](_0x174cda)[_0x0573('0x26')](handleEntityNotFound(_0xc1cc2a,null))[_0x0573('0x26')](respondWithResult(_0xc1cc2a,null))['catch'](handleError(_0xc1cc2a,null));};exports['create']=function(_0x86e2fa,_0x2660d6){return db[_0x0573('0x2c')]['create'](_0x86e2fa[_0x0573('0x46')],{})['then'](respondWithResult(_0x2660d6,0xc9))[_0x0573('0x47')](handleError(_0x2660d6,null));};exports[_0x0573('0x24')]=function(_0x52b742,_0x5df0ff){if(_0x52b742[_0x0573('0x46')]['id']){delete _0x52b742['body']['id'];}return db['SmsApplication'][_0x0573('0x48')]({'where':{'id':_0x52b742[_0x0573('0x42')]['id']}})['then'](handleEntityNotFound(_0x5df0ff,null))['then'](saveUpdates(_0x52b742[_0x0573('0x46')],null))[_0x0573('0x26')](respondWithResult(_0x5df0ff,null))[_0x0573('0x47')](handleError(_0x5df0ff,null));};exports[_0x0573('0x25')]=function(_0x2214cd,_0xb6533f){return db['SmsApplication']['find']({'where':{'id':_0x2214cd[_0x0573('0x42')]['id']}})['then'](handleEntityNotFound(_0xb6533f,null))[_0x0573('0x26')](removeEntity(_0xb6533f,null))[_0x0573('0x47')](handleError(_0xb6533f,null));};
\ No newline at end of file
index 110c069..2d84cbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7881=['request-promise','exports','SmsApplication','sms_applications','utf8mb4','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7881,0x69));var _0x1788=function(_0x2233e5,_0x1986c8){_0x2233e5=_0x2233e5-0x0;var _0x862716=_0x7881[_0x2233e5];return _0x862716;};'use strict';var _=require('lodash');var util=require(_0x1788('0x0'));var logger=require(_0x1788('0x1'))(_0x1788('0x2'));var moment=require(_0x1788('0x3'));var BPromise=require(_0x1788('0x4'));var rp=require(_0x1788('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsApplication.attributes');module[_0x1788('0x6')]=function(_0x26db9b,_0x142696){return _0x26db9b['define'](_0x1788('0x7'),attributes,{'tableName':_0x1788('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1788('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xe142=['utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsApplication','sms_applications','utf8mb4'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe142,0xaa));var _0x2e14=function(_0x590096,_0xa578da){_0x590096=_0x590096-0x0;var _0x53e9e=_0xe142[_0x590096];return _0x53e9e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2e14('0x0'))('api');var moment=require(_0x2e14('0x1'));var BPromise=require(_0x2e14('0x2'));var rp=require(_0x2e14('0x3'));var fs=require('fs');var path=require(_0x2e14('0x4'));var rimraf=require(_0x2e14('0x5'));var config=require(_0x2e14('0x6'));var attributes=require('./smsApplication.attributes');module[_0x2e14('0x7')]=function(_0x33e99b,_0x1bfd45){return _0x33e99b[_0x2e14('0x8')](_0x2e14('0x9'),attributes,{'tableName':_0x2e14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2e14('0xb'),'collate':_0x2e14('0xc')});};
\ No newline at end of file
index 1471407..bd676b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69d4=['error','SmsApplication,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify'];(function(_0x380af2,_0x36cf66){var _0x1789dc=function(_0x37b604){while(--_0x37b604){_0x380af2['push'](_0x380af2['shift']());}};_0x1789dc(++_0x36cf66);}(_0x69d4,0x83));var _0x469d=function(_0xbeb808,_0x881ddf){_0xbeb808=_0xbeb808-0x0;var _0x5d6909=_0x69d4[_0xbeb808];return _0x5d6909;};'use strict';var _=require(_0x469d('0x0'));var util=require(_0x469d('0x1'));var moment=require('moment');var BPromise=require(_0x469d('0x2'));var rs=require(_0x469d('0x3'));var fs=require('fs');var Redis=require(_0x469d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x469d('0x5'));var logger=require('../../config/logger')(_0x469d('0x6'));var config=require(_0x469d('0x7'));var jayson=require(_0x469d('0x8'));var client=jayson[_0x469d('0x9')][_0x469d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb15ca9,_0x5129a8,_0x1e9300){return new BPromise(function(_0x486595,_0x37ee05){return client[_0x469d('0xb')](_0xb15ca9,_0x1e9300)[_0x469d('0xc')](function(_0x5f05c9){logger['info']('SmsApplication,\x20%s,\x20%s',_0x5129a8,_0x469d('0xd'));logger[_0x469d('0xe')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x5129a8,_0x469d('0xd'),JSON[_0x469d('0xf')](_0x5f05c9));if(_0x5f05c9[_0x469d('0x10')]){if(_0x5f05c9['error']['code']===0x1f4){logger['error'](_0x469d('0x11'),_0x5129a8,_0x5f05c9[_0x469d('0x10')][_0x469d('0x12')]);return _0x37ee05(_0x5f05c9[_0x469d('0x10')][_0x469d('0x12')]);}logger[_0x469d('0x10')](_0x469d('0x11'),_0x5129a8,_0x5f05c9['error'][_0x469d('0x12')]);return _0x486595(_0x5f05c9[_0x469d('0x10')][_0x469d('0x12')]);}else{logger[_0x469d('0x13')]('SmsApplication,\x20%s,\x20%s',_0x5129a8,_0x469d('0xd'));_0x486595(_0x5f05c9[_0x469d('0x14')][_0x469d('0x12')]);}})['catch'](function(_0x16d3b5){logger[_0x469d('0x10')](_0x469d('0x11'),_0x5129a8,_0x16d3b5);_0x37ee05(_0x16d3b5);});});}
\ No newline at end of file
+var _0xaebd=['SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','SmsApplication,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x2d4ff3,_0x57f3f6){var _0x71cf13=function(_0x116278){while(--_0x116278){_0x2d4ff3['push'](_0x2d4ff3['shift']());}};_0x71cf13(++_0x57f3f6);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x2aeebb,_0x530d19){_0x2aeebb=_0x2aeebb-0x0;var _0x43204e=_0xaebd[_0x2aeebb];return _0x43204e;};'use strict';var _=require(_0xdaeb('0x0'));var util=require('util');var moment=require(_0xdaeb('0x1'));var BPromise=require(_0xdaeb('0x2'));var rs=require(_0xdaeb('0x3'));var fs=require('fs');var Redis=require(_0xdaeb('0x4'));var db=require(_0xdaeb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdaeb('0x6'))(_0xdaeb('0x7'));var config=require(_0xdaeb('0x8'));var jayson=require(_0xdaeb('0x9'));var client=jayson[_0xdaeb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ea090,_0x3f7ba1,_0x52c717){return new BPromise(function(_0x550bd9,_0x1b9d37){return client[_0xdaeb('0xb')](_0x3ea090,_0x52c717)[_0xdaeb('0xc')](function(_0x5e0ae9){logger[_0xdaeb('0xd')]('SmsApplication,\x20%s,\x20%s',_0x3f7ba1,_0xdaeb('0xe'));logger['debug'](_0xdaeb('0xf'),_0x3f7ba1,'request\x20sent',JSON[_0xdaeb('0x10')](_0x5e0ae9));if(_0x5e0ae9[_0xdaeb('0x11')]){if(_0x5e0ae9['error']['code']===0x1f4){logger[_0xdaeb('0x11')]('SmsApplication,\x20%s,\x20%s',_0x3f7ba1,_0x5e0ae9[_0xdaeb('0x11')][_0xdaeb('0x12')]);return _0x1b9d37(_0x5e0ae9[_0xdaeb('0x11')][_0xdaeb('0x12')]);}logger[_0xdaeb('0x11')](_0xdaeb('0x13'),_0x3f7ba1,_0x5e0ae9[_0xdaeb('0x11')]['message']);return _0x550bd9(_0x5e0ae9['error'][_0xdaeb('0x12')]);}else{logger[_0xdaeb('0xd')](_0xdaeb('0x13'),_0x3f7ba1,_0xdaeb('0xe'));_0x550bd9(_0x5e0ae9['result']['message']);}})[_0xdaeb('0x14')](function(_0x4dd803){logger['error'](_0xdaeb('0x13'),_0x3f7ba1,_0x4dd803);_0x1b9d37(_0x4dd803);});});}
\ No newline at end of file
index 81da806..5fdfe45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4f4=['/:id/tags','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','post','create','tracked','sms','smsinteraction:addtags','put','smsinteraction:update','update','delete','/:id','smsinteraction:destroy','destroy'];(function(_0x4c2c72,_0x295857){var _0x13e980=function(_0x143c39){while(--_0x143c39){_0x4c2c72['push'](_0x4c2c72['shift']());}};_0x13e980(++_0x295857);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x191308,_0x41cc23){_0x191308=_0x191308-0x0;var _0x4373f6=_0xf4f4[_0x191308];return _0x4373f6;};'use strict';var multer=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var path=require('path');var timeout=require(_0x4f4f('0x2'));var express=require(_0x4f4f('0x3'));var router=express[_0x4f4f('0x4')]();var fs_extra=require(_0x4f4f('0x5'));var auth=require(_0x4f4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f4f('0x7'));var controller=require('./smsInteraction.controller');router[_0x4f4f('0x8')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xa')]);router[_0x4f4f('0x8')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0x8')]('/:id',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xd')]);router[_0x4f4f('0x8')](_0x4f4f('0xe'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xf')]);router[_0x4f4f('0x8')](_0x4f4f('0x10'),auth['isAuthenticated'](),controller['download']);router[_0x4f4f('0x11')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x12')]);router[_0x4f4f('0x11')](_0x4f4f('0xe'),auth[_0x4f4f('0x9')](),controller['addMessage']);router[_0x4f4f('0x11')]('/:id/tags',auth[_0x4f4f('0x9')](),interaction[_0x4f4f('0x13')](_0x4f4f('0x14'),_0x4f4f('0x15')),controller['addTags']);router[_0x4f4f('0x16')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x4f4f('0x14'),_0x4f4f('0x17')),controller[_0x4f4f('0x18')]);router[_0x4f4f('0x19')](_0x4f4f('0x1a'),auth[_0x4f4f('0x9')](),interaction[_0x4f4f('0x13')](_0x4f4f('0x14'),_0x4f4f('0x1b')),controller[_0x4f4f('0x1c')]);router[_0x4f4f('0x19')](_0x4f4f('0x1d'),auth['isAuthenticated'](),controller[_0x4f4f('0x1e')]);module[_0x4f4f('0x1f')]=router;
\ No newline at end of file
+var _0xa571=['get','isAuthenticated','index','/describe','/:id','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','tracked','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xa571,0x107));var _0x1a57=function(_0xc34cd4,_0x463064){_0xc34cd4=_0xc34cd4-0x0;var _0x128eaa=_0xa571[_0xc34cd4];return _0x128eaa;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./smsInteraction.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['describe']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0x7')](_0x1a57('0xe'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1a57('0x10')]);router[_0x1a57('0x11')](_0x1a57('0xc'),auth['isAuthenticated'](),controller[_0x1a57('0x12')]);router[_0x1a57('0x11')]('/:id/tags',auth[_0x1a57('0x8')](),interaction['tracked'](_0x1a57('0x13'),_0x1a57('0x14')),controller[_0x1a57('0x15')]);router[_0x1a57('0x16')]('/:id',auth[_0x1a57('0x8')](),interaction['tracked']('sms',_0x1a57('0x17')),controller[_0x1a57('0x18')]);router[_0x1a57('0x19')]('/:id',auth[_0x1a57('0x8')](),interaction[_0x1a57('0x1a')](_0x1a57('0x13'),'smsinteraction:destroy'),controller[_0x1a57('0x1b')]);router[_0x1a57('0x19')](_0x1a57('0x1c'),auth[_0x1a57('0x8')](),controller[_0x1a57('0x1d')]);module['exports']=router;
\ No newline at end of file
index 62315ef..4dc6fa1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb9=['DATE','STRING','ENUM','out','sequelize','moment','exports','BOOLEAN'];(function(_0xa7429c,_0x3f6c95){var _0x57aacc=function(_0x276abe){while(--_0x276abe){_0xa7429c['push'](_0xa7429c['shift']());}};_0x57aacc(++_0x3f6c95);}(_0xbdb9,0xac));var _0x9bdb=function(_0x91c3e9,_0x24d475){_0x91c3e9=_0x91c3e9-0x0;var _0x2bd925=_0xbdb9[_0x91c3e9];return _0x2bd925;};'use strict';var Sequelize=require(_0x9bdb('0x0'));var moment=require(_0x9bdb('0x1'));module[_0x9bdb('0x2')]={'closed':{'type':Sequelize[_0x9bdb('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9bdb('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9bdb('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x9bdb('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x9bdb('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9bdb('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x9bdb('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x3663=['BOOLEAN','sequelize','moment','exports','DATE','STRING','ENUM'];(function(_0x486839,_0x3830ce){var _0x17bc33=function(_0x1000d1){while(--_0x1000d1){_0x486839['push'](_0x486839['shift']());}};_0x17bc33(++_0x3830ce);}(_0x3663,0x1cf));var _0x3366=function(_0x460fd9,_0x4b4b97){_0x460fd9=_0x460fd9-0x0;var _0x424e18=_0x3663[_0x460fd9];return _0x424e18;};'use strict';var Sequelize=require(_0x3366('0x0'));var moment=require(_0x3366('0x1'));module[_0x3366('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3366('0x3')]},'disposition':{'type':Sequelize[_0x3366('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3366('0x4')]},'note':{'type':Sequelize[_0x3366('0x4')]},'phone':{'type':Sequelize[_0x3366('0x4')]},'read1stAt':{'type':Sequelize[_0x3366('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x3366('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3366('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x3366('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3366('0x6')],'defaultValue':![]}};
\ No newline at end of file
index 762f5d9..c680125 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd71f=['get','mkdirSync','Sms','Owner','N.A.','closedAt','disposition','out','System','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','name','send','map','fullname','TagIds','Tags','split','forEach','push','waiting','talking','answered','unmanaged','total','closed','UserId','index','SmsInteraction','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','field','color','from','tools_tags','select','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','text','some','compact','SmsAccountId','concat','parse','$gte','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','rows','params','includeAll','include','options','catch','create','update','describe','addMessage','SmsMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','join','server','files','root','attachments','User','CmContact','firstName','lastName','Messages','createdAt','direction','secret','SmsAccount','Account'];(function(_0x21b359,_0x4dc80e){var _0x57b8e7=function(_0x135adb){while(--_0x135adb){_0x21b359['push'](_0x21b359['shift']());}};_0x57b8e7(++_0x4dc80e);}(_0xd71f,0x101));var _0xfd71=function(_0xaf4fd9,_0xb79669){_0xaf4fd9=_0xaf4fd9-0x0;var _0x15d9b3=_0xd71f[_0xaf4fd9];return _0x15d9b3;};'use strict';var emlformat=require(_0xfd71('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfd71('0x1'));var jsonpatch=require(_0xfd71('0x2'));var rp=require(_0xfd71('0x3'));var moment=require('moment');var BPromise=require(_0xfd71('0x4'));var Mustache=require(_0xfd71('0x5'));var util=require(_0xfd71('0x6'));var path=require(_0xfd71('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfd71('0x8'));var fs=require('fs');var fs_extra=require(_0xfd71('0x9'));var _=require(_0xfd71('0xa'));var squel=require(_0xfd71('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfd71('0xc'));var toCsv=require('to-csv');var querystring=require(_0xfd71('0xd'));var Papa=require(_0xfd71('0xe'));var Redis=require(_0xfd71('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfd71('0x10'));var as=require(_0xfd71('0x11'));var pdf=require(_0xfd71('0x12'));var hardwareService=require(_0xfd71('0x13'));var logger=require(_0xfd71('0x14'))(_0xfd71('0x15'));var utils=require(_0xfd71('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xfd71('0x17'));var db=require(_0xfd71('0x18'))['db'];config['redis']=_[_0xfd71('0x19')](config[_0xfd71('0x1a')],{'host':_0xfd71('0x1b'),'port':0x18eb});var socket=require(_0xfd71('0x1c'))(new Redis(config[_0xfd71('0x1a')]));require(_0xfd71('0x1d'))['register'](socket);function respondWithStatusCode(_0x47364a,_0xb4693b){_0xb4693b=_0xb4693b||0xcc;return function(_0xc4ae81){if(_0xc4ae81){return _0x47364a[_0xfd71('0x1e')](_0xb4693b);}return _0x47364a[_0xfd71('0x1f')](_0xb4693b)[_0xfd71('0x20')]();};}function respondWithResult(_0x3fa39d,_0x48d4ec){_0x48d4ec=_0x48d4ec||0xc8;return function(_0x4584bc){if(_0x4584bc){return _0x3fa39d[_0xfd71('0x1f')](_0x48d4ec)[_0xfd71('0x21')](_0x4584bc);}};}function respondWithFilteredResult(_0x2a0bda,_0x442a4c){return function(_0x1539bb){if(_0x1539bb){var _0x42c570=typeof _0x442a4c[_0xfd71('0x22')]===_0xfd71('0x23')&&typeof _0x442a4c[_0xfd71('0x24')]==='undefined';var _0x598505=_0x1539bb[_0xfd71('0x25')];var _0x1a3b1f=_0x42c570?0x0:_0x442a4c[_0xfd71('0x22')];var _0x38a58a=_0x42c570?_0x1539bb[_0xfd71('0x25')]:_0x442a4c[_0xfd71('0x22')]+_0x442a4c[_0xfd71('0x24')];var _0x311157;if(_0x38a58a>=_0x598505){_0x38a58a=_0x598505;_0x311157=0xc8;}else{_0x311157=0xce;}_0x2a0bda[_0xfd71('0x1f')](_0x311157);return _0x2a0bda[_0xfd71('0x26')]('Content-Range',_0x1a3b1f+'-'+_0x38a58a+'/'+_0x598505)[_0xfd71('0x21')](_0x1539bb);}return null;};}function patchUpdates(_0x4d4a7b){return function(_0xc6223a){try{jsonpatch['apply'](_0xc6223a,_0x4d4a7b,!![]);}catch(_0x554ba6){return BPromise[_0xfd71('0x27')](_0x554ba6);}return _0xc6223a[_0xfd71('0x28')]();};}function saveUpdates(_0x458bb9,_0x24373e){return function(_0x269089){if(_0x269089){return _0x269089['update'](_0x458bb9)[_0xfd71('0x29')](function(_0x7e6e2a){return _0x7e6e2a;});}return null;};}function removeEntity(_0x57ab49,_0x2c6225){return function(_0x5b3635){if(_0x5b3635){return _0x5b3635['destroy']()[_0xfd71('0x29')](function(){_0x57ab49['status'](0xcc)[_0xfd71('0x20')]();});}};}function handleEntityNotFound(_0x2f6808,_0x3dae65){return function(_0x2eab59){if(!_0x2eab59){_0x2f6808[_0xfd71('0x1e')](0x194);}return _0x2eab59;};}function handleError(_0x5314d5,_0x378afa){_0x378afa=_0x378afa||0x1f4;return function(_0x3545bf){logger['error'](_0x3545bf['stack']);if(_0x3545bf[_0xfd71('0x2a')]){delete _0x3545bf[_0xfd71('0x2a')];}_0x5314d5['status'](_0x378afa)[_0xfd71('0x2b')](_0x3545bf);};}function getInteractionUsers(_0x693f3a,_0x423c31){return new BPromise(function(_0x273916,_0x5477c5){try{if(_0x423c31[_0x693f3a['id']]){_0x693f3a['Users']=_[_0xfd71('0x2c')](_0x423c31[_0x693f3a['id']],function(_0x2ea3d7){return{'id':_0x2ea3d7['id'],'fullname':_0x2ea3d7[_0xfd71('0x2d')]};});}}catch(_0x28e004){_0x5477c5(_0x28e004);}_0x273916(_0x693f3a);});}function getInteractionTags(_0x16c6a2,_0x507fa4){return new BPromise(function(_0x16cfdf,_0x100fef){try{if(_0x16c6a2[_0xfd71('0x2e')]){_0x16c6a2[_0xfd71('0x2f')]=[];_0x16c6a2[_0xfd71('0x2e')][_0xfd71('0x30')](',')[_0xfd71('0x31')](function(_0x5dc070){_0x16c6a2[_0xfd71('0x2f')][_0xfd71('0x32')](_0x507fa4[_0x5dc070]);});}delete _0x16c6a2[_0xfd71('0x2e')];}catch(_0x4dcc59){_0x100fef(_0x4dcc59);}_0x16cfdf(_0x16c6a2);});}function updateSmsInteraction(_0x594974,_0x1c6893,_0x59f772){return new BPromise(function(_0x9f394f,_0x3cf2ae){return getInteractionUsers(_0x594974,_0x59f772)[_0xfd71('0x29')](function(_0x283895){return getInteractionTags(_0x283895,_0x1c6893);})[_0xfd71('0x29')](function(_0x3b12ca){return getStateInteraction(_0x3b12ca);})['then'](function(_0x4ecabe){_0x9f394f(_0x4ecabe);})['catch'](function(_0x1ab799){_0x3cf2ae(_0x1ab799);});});}function getStateInteraction(_0x1c2ce9){return new BPromise(function(_0x302581){_0x1c2ce9[_0xfd71('0x33')]=0x0;_0x1c2ce9[_0xfd71('0x34')]=0x0;_0x1c2ce9[_0xfd71('0x35')]=0x0;_0x1c2ce9[_0xfd71('0x36')]=0x0;_0x1c2ce9[_0xfd71('0x37')]=0x0;if(!_0x1c2ce9[_0xfd71('0x38')]&&!_0x1c2ce9[_0xfd71('0x39')]){_0x1c2ce9[_0xfd71('0x33')]+=0x1;}if(!_0x1c2ce9[_0xfd71('0x38')]&&_0x1c2ce9['UserId']){_0x1c2ce9[_0xfd71('0x34')]+=0x1;if(_0x1c2ce9[_0xfd71('0x33')]){_0x1c2ce9['waiting']-=0x1;}}if(_0x1c2ce9[_0xfd71('0x38')]&&_0x1c2ce9[_0xfd71('0x39')]){_0x1c2ce9[_0xfd71('0x35')]+=0x1;if(_0x1c2ce9[_0xfd71('0x34')]){_0x1c2ce9['talking']-=0x1;}}if(_0x1c2ce9['closed']&&!_0x1c2ce9[_0xfd71('0x39')]){_0x1c2ce9[_0xfd71('0x36')]+=0x1;if(_0x1c2ce9[_0xfd71('0x33')]){_0x1c2ce9[_0xfd71('0x33')]-=0x1;}}_0x1c2ce9[_0xfd71('0x37')]+=0x1;_0x302581(_0x1c2ce9);});}exports[_0xfd71('0x3a')]=function(_0x4e18b2,_0x9c8ae0){var _0x345b85={},_0x2ccb6b={},_0x31131c={'count':0x0,'rows':[]};var _0x2e2518=_[_0xfd71('0x2c')](db[_0xfd71('0x3b')][_0xfd71('0x3c')],function(_0x591645){return{'name':_0x591645[_0xfd71('0x3d')],'type':_0x591645[_0xfd71('0x3e')]['key']};});_0x2ccb6b[_0xfd71('0x3f')]=_[_0xfd71('0x2c')](_0x2e2518,'name');_0x2ccb6b[_0xfd71('0x40')]=_[_0xfd71('0x41')](_0x4e18b2[_0xfd71('0x40')]);_0x2ccb6b[_0xfd71('0x42')]=_['intersection'](_0x2ccb6b['model'],_0x2ccb6b['query']);_0x345b85[_0xfd71('0x43')]=_[_0xfd71('0x44')](_0x2ccb6b[_0xfd71('0x3f')],qs['fields'](_0x4e18b2['query'][_0xfd71('0x45')]));_0x345b85['attributes']=_0x345b85[_0xfd71('0x43')][_0xfd71('0x46')]?_0x345b85[_0xfd71('0x43')]:_0x2ccb6b[_0xfd71('0x3f')];if(!_0x4e18b2[_0xfd71('0x40')][_0xfd71('0x47')](_0xfd71('0x48'))){_0x345b85[_0xfd71('0x24')]=qs[_0xfd71('0x24')](_0x4e18b2[_0xfd71('0x40')][_0xfd71('0x24')]);_0x345b85['offset']=qs[_0xfd71('0x22')](_0x4e18b2[_0xfd71('0x40')]['offset']);}_0x345b85[_0xfd71('0x49')]=qs[_0xfd71('0x4a')](_0x4e18b2[_0xfd71('0x40')]['sort']);_0x345b85['where']=qs[_0xfd71('0x42')](_[_0xfd71('0x4b')](_0x4e18b2[_0xfd71('0x40')],_0x2ccb6b[_0xfd71('0x42')]),_0x2e2518);var _0x1c88bc=[];var _0x3c6cb7=squel['select']()[_0xfd71('0x4c')]('id')[_0xfd71('0x4c')](_0xfd71('0x2a'))[_0xfd71('0x4c')](_0xfd71('0x4d'))[_0xfd71('0x4e')](_0xfd71('0x4f'));var _0x41c5d7=squel[_0xfd71('0x50')]()[_0xfd71('0x4c')](_0xfd71('0x51'))[_0xfd71('0x4c')](_0xfd71('0x52'))['field'](_0xfd71('0x53'))['from'](_0xfd71('0x54'),'ui')[_0xfd71('0x55')]('users','u',_0xfd71('0x56'));var _0x23e191=squel['select']()[_0xfd71('0x4e')](_0xfd71('0x57'),'i')[_0xfd71('0x55')]('cm_contacts','c',_0xfd71('0x58'))['left_join'](_0xfd71('0x59'),'o',_0xfd71('0x5a'))[_0xfd71('0x55')](_0xfd71('0x5b'),'a','a.id\x20=\x20i.SmsAccountId')[_0xfd71('0x55')](_0xfd71('0x5c'),'me',_0xfd71('0x5d'))['left_join'](_0xfd71('0x5e'),'it',_0xfd71('0x5f'))['left_join'](_0xfd71('0x4f'),'t',_0xfd71('0x60'));var _0x262246=squel[_0xfd71('0x61')]();var _0x41e9bf=[];var _0x56d55c=squel[_0xfd71('0x61')]();var _0x28909f;if(_0x4e18b2[_0xfd71('0x40')][_0xfd71('0x62')]){_0x28909f=as[_0xfd71('0x63')](_0x4e18b2[_0xfd71('0x40')][_0xfd71('0x62')]);var _0x2b75ad=_0x28909f[_0xfd71('0x64')];for(var _0xe2b21c=0x0;_0xe2b21c<_0x28909f['conditions'][_0xfd71('0x46')];_0xe2b21c++){var _0x2362e8=_0x28909f[_0xfd71('0x65')][_0xe2b21c];var _0x5be334='i';var _0x494ed5=_[_0xfd71('0x66')](_0x2e2518,[_0xfd71('0x2a'),_0x2362e8['field']]);if(!_0x494ed5){switch(_0x2362e8['field']){case'unreadMessages':if(_0x2362e8[_0xfd71('0x67')]==0x1){_0x23e191[_0xfd71('0x68')]('`'+_0x2362e8[_0xfd71('0x4c')]+_0xfd71('0x69'));}else{_0x23e191[_0xfd71('0x68')]('`'+_0x2362e8[_0xfd71('0x4c')]+'`\x20>\x200');}break;case _0xfd71('0x6a'):if(_0x2362e8[_0xfd71('0x6b')]===_0xfd71('0x6c')){if(_0x2362e8[_0xfd71('0x67')][_0xfd71('0x30')]('\x20')['length']>0x1){_0x262246[_0x2b75ad](_0xfd71('0x6d'),qs[_0xfd71('0x6e')](_0x2362e8[_0xfd71('0x67')]),null);}else{var _0x1dbbd8='%'+_0x2362e8[_0xfd71('0x67')]+'%';_0x262246[_0x2b75ad](_0xfd71('0x6f'),_0x1dbbd8,_0x1dbbd8,_0x1dbbd8);}}else{_0x494ed5=_[_0xfd71('0x66')](_0x2e2518,['name',_0xfd71('0x70')]);_0x2362e8[_0xfd71('0x4c')]=_0xfd71('0x70');_0x55f544=as[_0xfd71('0x71')](_0x5be334,_0x494ed5['type'],_0x2362e8);_0x262246[_0x2b75ad](_0x55f544['text'],_0x55f544[_0xfd71('0x67')][_0xfd71('0x72')],_0x55f544['value'][_0xfd71('0x20')]);}break;case _0xfd71('0x73'):var _0x22e3ef=_0x2362e8[_0xfd71('0x67')][_0xfd71('0x30')](',')[_0xfd71('0x2c')](function(_0x5c72c3){return Number(_0x5c72c3);});_0x22e3ef[_0xfd71('0x31')](function(_0x1e9824){_0x56d55c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1e9824+',%');});_0x41e9bf=_['union'](_0x41e9bf,_0x22e3ef);break;case'User':if(_0x2362e8[_0xfd71('0x6b')]===_0xfd71('0x6c')){_0x262246[_0x2b75ad](_0xfd71('0x74'),'%'+_0x2362e8[_0xfd71('0x67')]+'%',null);}else{_0x494ed5=_[_0xfd71('0x66')](_0x2e2518,[_0xfd71('0x2a'),_0xfd71('0x39')]);_0x2362e8['field']='UserId';_0x55f544=as[_0xfd71('0x71')](_0x5be334,_0x494ed5[_0xfd71('0x3e')],_0x2362e8);_0x262246[_0x2b75ad](_0x55f544['text'],_0x55f544[_0xfd71('0x67')][_0xfd71('0x72')],_0x55f544[_0xfd71('0x67')]['end']);}break;case _0xfd71('0x75'):_0x55f544=as['buildExpression']('me',null,_0x2362e8);_0x262246[_0x2b75ad](_0x55f544[_0xfd71('0x76')],_0x55f544['value'][_0xfd71('0x72')],_0x55f544[_0xfd71('0x67')][_0xfd71('0x20')]);break;}}else{var _0x55f544=as[_0xfd71('0x71')](_0x5be334,_0x494ed5[_0xfd71('0x3e')],_0x2362e8);_0x262246[_0x2b75ad](_0x55f544['text'],_0x55f544[_0xfd71('0x67')][_0xfd71('0x72')],_0x55f544['value'][_0xfd71('0x20')]);}}}else{var _0x29a956=_(_0x4e18b2[_0xfd71('0x40')])['keys']()[_0xfd71('0x2c')](function(_0x43d349){return _[_0xfd71('0x77')](_0x2e2518,['name',_0x43d349])?_0x43d349:undefined;})[_0xfd71('0x78')]()[_0xfd71('0x67')]();if(!_['isEmpty'](_0x29a956)){_0x29a956['forEach'](function(_0x5d217a){if(_0x5d217a===_0xfd71('0x79')){_0x23e191['where']('i.SmsAccountId\x20IN\x20?',[][_0xfd71('0x7a')](_0x4e18b2['query'][_0x5d217a]));}else if(_0x5d217a==='createdAt'){var _0x7003dc=JSON[_0xfd71('0x7b')](_0x4e18b2['query'][_0x5d217a])[_0xfd71('0x7c')];var _0x3899f7=JSON[_0xfd71('0x7b')](_0x4e18b2[_0xfd71('0x40')][_0x5d217a])[_0xfd71('0x7d')];_0x23e191[_0xfd71('0x7e')](_0xfd71('0x7f'),_0x7003dc,_0x3899f7);}else{if(_0x4e18b2[_0xfd71('0x40')][_0x5d217a]===_0xfd71('0x80')){_0x23e191['where']('i.'+_0x5d217a+'\x20IS\x20NULL');}else{_0x23e191['where']('i.'+_0x5d217a+_0xfd71('0x81'),_0x4e18b2[_0xfd71('0x40')][_0x5d217a]);}}});}if(_0x4e18b2[_0xfd71('0x40')]['read']){if(_0x4e18b2[_0xfd71('0x40')][_0xfd71('0x82')]==0x1){_0x23e191[_0xfd71('0x68')](_0xfd71('0x83'));}else{_0x23e191[_0xfd71('0x68')](_0xfd71('0x84'));}}if(_0x4e18b2['query'][_0xfd71('0x85')]){_0x41e9bf=_[_0xfd71('0x86')](_0x4e18b2[_0xfd71('0x40')][_0xfd71('0x85')])?_0x4e18b2['query']['tag']:new Array(_0x4e18b2['query'][_0xfd71('0x85')]);_0x41e9bf['forEach'](function(_0x177268){_0x56d55c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x177268+',%');});}if(_0x4e18b2[_0xfd71('0x40')][_0xfd71('0x87')]){var _0x25fab3=_0x4e18b2['query'][_0xfd71('0x87')][_0xfd71('0x88')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x25fab3)){_0x262246['or'](_0xfd71('0x89'),_0x25fab3+'%')['or'](_0xfd71('0x8a'),_0x25fab3+'%');}else{_0x262246['or'](_0xfd71('0x8b'),qs[_0xfd71('0x6e')](_0x25fab3))['or'](_0xfd71('0x8c'),_0x25fab3+'%');}}}_0x23e191[_0xfd71('0x7e')](_0x262246);_0x23e191[_0xfd71('0x8d')](_0xfd71('0x8e'));var _0x4e54f7={'type':db[_0xfd71('0x8f')][_0xfd71('0x90')]['SELECT'],'raw':!![]};var _0x1f42eb=_0x23e191[_0xfd71('0x91')]();_0x1f42eb[_0xfd71('0x4c')](_0xfd71('0x8e'));_0x1f42eb[_0xfd71('0x4c')](_0xfd71('0x92'),_0xfd71('0x93'));if(_0x345b85[_0xfd71('0x49')]){_0x345b85['order'][_0xfd71('0x31')](function(_0x582dc7){var _0x2c0622=_0x582dc7[0x0]===_0xfd71('0x94')?_0x582dc7[0x0]:'i.'+_0x582dc7[0x0];_0x23e191[_0xfd71('0x49')](_0x2c0622,_0x582dc7[0x1]===_0xfd71('0x95')?![]:!![]);});}if(!_['isEmpty'](_0x41e9bf)){_0x23e191['having'](_0x56d55c);_0x1f42eb[_0xfd71('0x7e')](_0xfd71('0x96'),_0x41e9bf);}BPromise[_0xfd71('0x97')]()[_0xfd71('0x29')](function(){if(!_0x28909f){if(_0x4e18b2['query'][_0xfd71('0x79')])return;_0x1f42eb['where'](_0xfd71('0x98'));_0x23e191[_0xfd71('0x7e')](_0xfd71('0x98'));return;}if(_0x4e18b2[_0xfd71('0x99')][_0xfd71('0x9a')]!==_0xfd71('0x9b'))return;return _0x4e18b2[_0xfd71('0x99')][_0xfd71('0x9c')]({'attributes':['id'],'raw':!![]})[_0xfd71('0x29')](function(_0x2cb9bc){if(_['isEmpty'](_0x2cb9bc)){_0x1f42eb[_0xfd71('0x7e')](_0xfd71('0x9d'));_0x23e191[_0xfd71('0x7e')](_0xfd71('0x9d'));}else{_0x1f42eb['where']('i.SmsAccountId\x20IN\x20?',_[_0xfd71('0x2c')](_0x2cb9bc,'id'));_0x23e191[_0xfd71('0x7e')](_0xfd71('0x9e'),_[_0xfd71('0x2c')](_0x2cb9bc,'id'));}});})[_0xfd71('0x29')](function(){if(_0x4e18b2[_0xfd71('0x99')]['role']==='agent'&&!_0x28909f&&!_0x4e18b2[_0xfd71('0x40')][_0xfd71('0x79')])return[];return db[_0xfd71('0x9f')][_0xfd71('0x40')](_0x1f42eb[_0xfd71('0xa0')](),_0x4e54f7);})['then'](function(_0x3e1a42){_0x31131c['count']=_0x3e1a42[_0xfd71('0x46')];if(_0x31131c[_0xfd71('0x25')]===0x0)return[];return db[_0xfd71('0x9f')][_0xfd71('0x40')](_0x3c6cb7[_0xfd71('0xa0')](),_0x4e54f7)[_0xfd71('0x29')](function(_0x7d6bad){_0x1c88bc=_[_0xfd71('0xa1')](_0x7d6bad,'id');_0x4e54f7=_[_0xfd71('0xa2')](_0x4e54f7,{'model':db[_0xfd71('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4e18b2[_0xfd71('0x40')][_0xfd71('0x45')]){_0x345b85[_0xfd71('0x43')][_0xfd71('0x31')](function(_0x1cf77c){_0x23e191[_0xfd71('0x4c')]('i.'+_0x1cf77c);});}else{_0x23e191[_0xfd71('0x4c')](_0xfd71('0x92'),_0xfd71('0x93'));_0x23e191[_0xfd71('0x4c')](_0xfd71('0xa3'),_0xfd71('0xa4'));_0x23e191['field'](_0xfd71('0xa5'),'Account.mandatoryDisposition');_0x23e191['field'](_0xfd71('0xa6'),_0xfd71('0x94'));_0x23e191[_0xfd71('0x4c')]('i.*');_0x23e191['field'](_0xfd71('0xa7'),_0xfd71('0xa8'));_0x23e191['field'](_0xfd71('0xa9'),_0xfd71('0xaa'));_0x23e191[_0xfd71('0x4c')](_0xfd71('0xab'),_0xfd71('0xac'));_0x23e191[_0xfd71('0x4c')](_0xfd71('0xad'),'Contact.phone');_0x23e191['field'](_0xfd71('0xae'),_0xfd71('0xaf'));_0x23e191[_0xfd71('0x4c')](_0xfd71('0xb0'),_0xfd71('0xb1'));_0x23e191[_0xfd71('0x4c')](_0xfd71('0xb2'),_0xfd71('0xb3'));_0x23e191[_0xfd71('0x4c')](_0xfd71('0xb4'),'Owner.internal');_0x23e191[_0xfd71('0x4c')](_0xfd71('0xb5'),'TagIds');}if(_0x345b85[_0xfd71('0x24')])_0x23e191['limit'](_0x345b85[_0xfd71('0x24')]);if(_0x345b85[_0xfd71('0x22')])_0x23e191[_0xfd71('0x22')](_0x345b85['offset']);return db['sequelize'][_0xfd71('0x40')](_0x23e191[_0xfd71('0xa0')](),_0x4e54f7);})['then'](function(_0x33a5cf){if(_0x33a5cf[_0xfd71('0x46')]>0x0)_0x41c5d7[_0xfd71('0x7e')](_0xfd71('0xb6'),_[_0xfd71('0x2c')](_0x33a5cf,'id'));return db[_0xfd71('0x9f')][_0xfd71('0x40')](_0x41c5d7['toString'](),_0x4e54f7)[_0xfd71('0x29')](function(_0x48ef52){var _0xd7d212=_[_0xfd71('0xb7')](_0x48ef52,_0xfd71('0xb8'));var _0x38703e=[];_0x33a5cf[_0xfd71('0x31')](function(_0x2c8d66){_0x38703e['push'](updateSmsInteraction(_0x2c8d66,_0x1c88bc,_0xd7d212));});return BPromise['all'](_0x38703e);});});})['then'](function(_0x51f032){_0x31131c[_0xfd71('0xb9')]=_0x51f032;return _0x31131c;})[_0xfd71('0x29')](respondWithFilteredResult(_0x9c8ae0,_0x345b85))['catch'](handleError(_0x9c8ae0,null));};exports['show']=function(_0x53973d,_0x2e5bc9){var _0x1ccd52={'raw':![],'where':{'id':_0x53973d[_0xfd71('0xba')]['id']}},_0x3067f9={};_0x3067f9[_0xfd71('0x3f')]=_[_0xfd71('0x41')](db[_0xfd71('0x3b')][_0xfd71('0x3c')]);_0x3067f9[_0xfd71('0x40')]=_['keys'](_0x53973d[_0xfd71('0x40')]);_0x3067f9[_0xfd71('0x42')]=_[_0xfd71('0x44')](_0x3067f9[_0xfd71('0x3f')],_0x3067f9[_0xfd71('0x40')]);_0x1ccd52[_0xfd71('0x43')]=_[_0xfd71('0x44')](_0x3067f9[_0xfd71('0x3f')],qs[_0xfd71('0x45')](_0x53973d[_0xfd71('0x40')][_0xfd71('0x45')]));_0x1ccd52['attributes']=_0x1ccd52['attributes'][_0xfd71('0x46')]?_0x1ccd52[_0xfd71('0x43')]:_0x3067f9[_0xfd71('0x3f')];if(_0x53973d[_0xfd71('0x40')][_0xfd71('0xbb')]){_0x1ccd52[_0xfd71('0xbc')]=[{'all':!![]}];}_0x1ccd52=_[_0xfd71('0xa2')]({},_0x1ccd52,_0x53973d[_0xfd71('0xbd')]);return db[_0xfd71('0x3b')][_0xfd71('0x66')](_0x1ccd52)[_0xfd71('0x29')](handleEntityNotFound(_0x2e5bc9,null))[_0xfd71('0x29')](respondWithResult(_0x2e5bc9,null))[_0xfd71('0xbe')](handleError(_0x2e5bc9,null));};exports[_0xfd71('0xbf')]=function(_0x23d8b7,_0x194a18){return db['SmsInteraction']['create'](_0x23d8b7['body'],{})[_0xfd71('0x29')](respondWithResult(_0x194a18,0xc9))[_0xfd71('0xbe')](handleError(_0x194a18,null));};exports[_0xfd71('0xc0')]=function(_0x2225da,_0x3da7b1){if(_0x2225da[_0xfd71('0x75')]['id']){delete _0x2225da['body']['id'];}return db[_0xfd71('0x3b')][_0xfd71('0x66')]({'where':{'id':_0x2225da[_0xfd71('0xba')]['id']}})[_0xfd71('0x29')](handleEntityNotFound(_0x3da7b1,null))[_0xfd71('0x29')](saveUpdates(_0x2225da['body'],null))[_0xfd71('0x29')](respondWithResult(_0x3da7b1,null))['catch'](handleError(_0x3da7b1,null));};exports['destroy']=function(_0x76a52a,_0x2d3046){return db[_0xfd71('0x3b')][_0xfd71('0x66')]({'where':{'id':_0x76a52a['params']['id']}})['then'](handleEntityNotFound(_0x2d3046,null))[_0xfd71('0x29')](removeEntity(_0x2d3046,null))[_0xfd71('0xbe')](handleError(_0x2d3046,null));};exports['describe']=function(_0x3a8e94,_0x4af840){return db[_0xfd71('0x3b')][_0xfd71('0xc1')]()[_0xfd71('0x29')](respondWithResult(_0x4af840,null))['catch'](handleError(_0x4af840,null));};exports[_0xfd71('0xc2')]=function(_0xd89b4b,_0x21873b,_0x428c8d){return db[_0xfd71('0xc3')]['find']({'where':{'id':_0xd89b4b[_0xfd71('0xba')]['id']}})[_0xfd71('0x29')](handleEntityNotFound(_0x21873b,null))['then'](function(_0xc3cb){if(_0xc3cb){return _0xc3cb['addMessage'](_0xd89b4b[_0xfd71('0x75')][_0xfd71('0xc4')],_[_0xfd71('0xc5')](_0xd89b4b[_0xfd71('0x75')],[_0xfd71('0xc4'),'id'])||{});}})['then'](respondWithResult(_0x21873b,null))[_0xfd71('0xbe')](handleError(_0x21873b,null));};exports[_0xfd71('0xc6')]=function(_0x5bc0b9,_0x24f5d9,_0x40361d){var _0x1811a0={'raw':![],'where':{}};var _0x4103fb={};var _0x5797e1={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x5bc0b9[_0xfd71('0xba')]['id']}})[_0xfd71('0x29')](handleEntityNotFound(_0x24f5d9,null))['then'](function(_0x19f576){if(_0x19f576){_0x4103fb[_0xfd71('0x3f')]=_[_0xfd71('0x41')](db['SmsMessage']['rawAttributes']);_0x4103fb['query']=_[_0xfd71('0x41')](_0x5bc0b9['query']);_0x4103fb[_0xfd71('0x42')]=_[_0xfd71('0x44')](_0x4103fb[_0xfd71('0x3f')],_0x4103fb['query']);_0x1811a0[_0xfd71('0x43')]=_['intersection'](_0x4103fb[_0xfd71('0x3f')],qs[_0xfd71('0x45')](_0x5bc0b9[_0xfd71('0x40')][_0xfd71('0x45')]));_0x1811a0['attributes']=_0x1811a0[_0xfd71('0x43')][_0xfd71('0x46')]?_0x1811a0[_0xfd71('0x43')]:_0x4103fb[_0xfd71('0x3f')];if(!_0x5bc0b9['query'][_0xfd71('0x47')](_0xfd71('0x48'))){_0x1811a0['limit']=qs['limit'](_0x5bc0b9[_0xfd71('0x40')][_0xfd71('0x24')]);_0x1811a0[_0xfd71('0x22')]=qs[_0xfd71('0x22')](_0x5bc0b9[_0xfd71('0x40')][_0xfd71('0x22')]);}_0x1811a0[_0xfd71('0x49')]=qs['sort'](_0x5bc0b9[_0xfd71('0x40')][_0xfd71('0x4a')]);_0x1811a0['where']=qs['filters'](_[_0xfd71('0x4b')](_0x5bc0b9['query'],_0x4103fb[_0xfd71('0x42')]));_0x1811a0[_0xfd71('0x7e')]['SmsInteractionId']=_0x19f576['id'];if(_0x5bc0b9[_0xfd71('0x40')][_0xfd71('0x87')]){_0x1811a0[_0xfd71('0x7e')]=_[_0xfd71('0xa2')](_0x1811a0[_0xfd71('0x7e')],{'$or':_['map'](_0x1811a0[_0xfd71('0x43')],function(_0x188718){var _0x1633f5={};_0x1633f5[_0x188718]={'$like':'%'+_0x5bc0b9[_0xfd71('0x40')][_0xfd71('0x87')]+'%'};return _0x1633f5;})});}if(_0x5bc0b9['query']['$gte']){var _0x29c3ad=_0x5bc0b9[_0xfd71('0x40')]['$gte']['split'](',');var _0xca3d3c={};_0xca3d3c[_0x29c3ad[0x0]]={'$gte':moment(_0x29c3ad[0x1])[_0xfd71('0xc7')](_0xfd71('0xc8'))};_0x1811a0['where']=_[_0xfd71('0xa2')](_0x1811a0[_0xfd71('0x7e')],_0xca3d3c);}_0x1811a0=_['merge']({},_0x1811a0,_0x5bc0b9[_0xfd71('0xbd')]);return db[_0xfd71('0xc3')]['count']({'where':_0x1811a0[_0xfd71('0x7e')]})[_0xfd71('0x29')](function(_0x11b82b){_0x5797e1['count']=_0x11b82b;if(_0x5bc0b9[_0xfd71('0x40')][_0xfd71('0xbb')]){_0x1811a0[_0xfd71('0xbc')]=[{'all':!![]}];}return db[_0xfd71('0xc3')]['findAll'](_0x1811a0);})[_0xfd71('0x29')](function(_0x350c5a){_0x5797e1[_0xfd71('0xb9')]=_0x350c5a;return _0x5797e1;});}})[_0xfd71('0x29')](respondWithFilteredResult(_0x24f5d9,_0x1811a0))[_0xfd71('0xbe')](handleError(_0x24f5d9,null));};exports['addTags']=function(_0x4a6676,_0x3d2ab3,_0xd73cc1){return db[_0xfd71('0x3b')]['find']({'where':{'id':_0x4a6676[_0xfd71('0xba')]['id']}})[_0xfd71('0x29')](handleEntityNotFound(_0x3d2ab3,null))[_0xfd71('0x29')](function(_0x436c09){if(_0x436c09){return _0x436c09[_0xfd71('0xc9')](_0x4a6676[_0xfd71('0x75')][_0xfd71('0xc4')],_[_0xfd71('0xc5')](_0x4a6676['body'],[_0xfd71('0xc4'),'id'])||{})[_0xfd71('0xca')](function(){return db['Tag']['findAll']({'attributes':['id',_0xfd71('0x2a'),'color'],'where':{'id':_0x4a6676['body']['ids']}});})['then'](function(_0x2fffdf){socket[_0xfd71('0xcb')](_0xfd71('0xcc'),{'id':Number(_0x4a6676[_0xfd71('0xba')]['id']),'tags':_0x2fffdf||[]});return{'id':Number(_0x4a6676[_0xfd71('0xba')]['id']),'tags':_0x2fffdf||[]};});}})['then'](respondWithResult(_0x3d2ab3,null))['catch'](handleError(_0x3d2ab3,null));};exports[_0xfd71('0xcd')]=function(_0x36847a,_0x5e4176,_0x9672a3){return db[_0xfd71('0x3b')][_0xfd71('0x66')]({'where':{'id':_0x36847a['params']['id']}})[_0xfd71('0x29')](handleEntityNotFound(_0x5e4176,null))[_0xfd71('0x29')](function(_0x126e1f){if(_0x126e1f){return _0x126e1f[_0xfd71('0xcd')](_0x36847a[_0xfd71('0x40')][_0xfd71('0xc4')]);}})['then'](respondWithStatusCode(_0x5e4176,null))[_0xfd71('0xbe')](handleError(_0x5e4176,null));};exports[_0xfd71('0xce')]=function(_0xe45ea9,_0x4e20d9){var _0x3f0b04=moment()[_0xfd71('0xcf')]()['toString']();var _0x5a0c76=path[_0xfd71('0xd0')](config['root'],_0xfd71('0xd1'),_0xfd71('0xd2'),'tmp');var _0x59e448=path['join'](config[_0xfd71('0xd3')],_0xfd71('0xd1'),_0xfd71('0xd2'),_0xfd71('0xd4'));var _0x4847d3=path['join'](_0x5a0c76,_0x3f0b04);var _0x38196c=util['format']('transcript-%d-%s.zip',_0xe45ea9[_0xfd71('0xba')]['id'],_0x3f0b04);var _0x32969b=path[_0xfd71('0xd0')](_0x5a0c76,_0x38196c);var _0x2dd857=[];_0x2dd857[_0xfd71('0x32')]({'model':db[_0xfd71('0xd5')],'as':_0xfd71('0xd5'),'attributes':['id','fullname'],'raw':!![]});_0x2dd857[_0xfd71('0x32')]({'model':db[_0xfd71('0xd6')],'as':_0xfd71('0x6a'),'attributes':['id',_0xfd71('0xd7'),_0xfd71('0xd8')],'raw':!![]});var _0x41d4ca=[{'model':db[_0xfd71('0xc3')],'as':_0xfd71('0xd9'),'attributes':['id',_0xfd71('0x75'),_0xfd71('0xda'),_0xfd71('0xdb'),_0xfd71('0xdc'),_0xfd71('0x82')],'include':_0x2dd857}];_0x41d4ca['push']({'model':db[_0xfd71('0xdd')],'as':_0xfd71('0xde'),'attributes':['id',_0xfd71('0x2a')]});_0x41d4ca['push']({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db['SmsInteraction'][_0xfd71('0x66')]({'where':{'id':_0xe45ea9['params']['id']},'include':_0x41d4ca})[_0xfd71('0x29')](handleEntityNotFound(_0x4e20d9,null))['then'](function(_0x295c49){if(_0x295c49){var _0x39f6ef=_0x295c49[_0xfd71('0xdf')]({'plain':!![]});fs[_0xfd71('0xe0')](_0x4847d3);var _0x5f0f7a={'channel':_0xfd71('0xe1'),'account':_0x39f6ef['Account']['name'],'agent':_0x39f6ef[_0xfd71('0xe2')]?_0x39f6ef[_0xfd71('0xe2')][_0xfd71('0x2d')]:_0xfd71('0xe3'),'createdAt':moment(_0x39f6ef[_0xfd71('0xda')])[_0xfd71('0xc7')](_0xfd71('0xc8'))[_0xfd71('0xa0')](),'closedAt':_0x39f6ef[_0xfd71('0x38')]?moment(_0x39f6ef[_0xfd71('0xe4')])[_0xfd71('0xc7')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfd71('0xa0')]():'','disposition':_0x39f6ef[_0xfd71('0xe5')],'messages':_(_0x39f6ef['Messages'])[_0xfd71('0x87')]({'secret':![]})[_0xfd71('0x2c')](function(_0x2e60eb){return{'date':moment(_0x2e60eb['createdAt'])[_0xfd71('0xc7')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfd71('0xa0')](),'sender':_0x2e60eb['direction']===_0xfd71('0xe6')?_0x2e60eb['User']?_0x2e60eb[_0xfd71('0xd5')][_0xfd71('0x2d')]:_0xfd71('0xe7'):_0x2e60eb['Contact'][_0xfd71('0xd7')]+(_0x2e60eb[_0xfd71('0x6a')][_0xfd71('0xd8')]?'\x20'+_0x2e60eb[_0xfd71('0x6a')][_0xfd71('0xd8')]:''),'body':_0x2e60eb['body'],'direction':_0x2e60eb[_0xfd71('0xdb')]===_0xfd71('0xe6')?'A':'C','secret':_0x2e60eb[_0xfd71('0xdc')],'read':_0x2e60eb[_0xfd71('0x82')]};})['value']()};return ejs[_0xfd71('0xe8')](path['join'](config[_0xfd71('0xd3')],_0xfd71('0xd1'),_0xfd71('0xe9'),'downloadInteraction.ejs'),{'interaction':_0x5f0f7a})['then'](function(_0x24a9f8){var _0x2bf3ee=path[_0xfd71('0xd0')](_0x4847d3,_0xfd71('0xea')+_0x39f6ef['id']+'-'+_0x3f0b04+_0xfd71('0xeb'));var _0x33d823={'path':_0x2bf3ee,'channel':_0xfd71('0xe1'),'interactionId':_0x39f6ef['id']};return pdf[_0xfd71('0xec')](_0x24a9f8,_0x33d823);})[_0xfd71('0x29')](function(){return new BPromise(function(_0x35a771,_0x362e5d){zipdir(_0x4847d3,{'saveTo':_0x32969b},function(_0x4788fb,_0x4aee59){if(_0x4788fb)return _0x362e5d(_0x4788fb);return _0x35a771(_0x4aee59);});})[_0xfd71('0x29')](function(){return new BPromise(function(_0x40f5dc,_0x4b68b3){rimraf(_0x4847d3,function(_0x18d7b2){if(_0x18d7b2)_0x4b68b3(_0x18d7b2);return _0x40f5dc();});});})[_0xfd71('0x29')](function(){return _0x4e20d9[_0xfd71('0xce')](_0x32969b,_0x38196c,function(_0x46b28a){if(_0x46b28a){console[_0xfd71('0xed')](_0xfd71('0xee'),_0x46b28a);}else{fs[_0xfd71('0xef')](_0x32969b);}});});});}else{return _0x4e20d9[_0xfd71('0x1e')](0xc8);}})[_0xfd71('0xbe')](handleError(_0x4e20d9,null));};
\ No newline at end of file
+var _0x5caf=['total','index','SmsInteraction','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','select','field','color','tools_tags','u.id','u.fullname','users','u.id\x20=\x20ui.UserId','from','sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','toString','sequelize','merge','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','all','rows','show','params','keys','includeAll','include','catch','create','destroy','describe','addMessage','SmsMessage','omit','ids','getMessages','findOne','hasOwnProperty','SmsInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','emit','smsInteractionTags:save','removeTags','unix','tmp','join','root','server','files','attachments','format','transcript-%d-%s.zip','firstName','lastName','Messages','direction','secret','SmsAccount','Account','User','get','Sms','Owner','N.A.','disposition','out','System','renderFile','views','downloadInteraction.ejs','.pdf','download','log','eml-format','zip-dir','fast-json-patch','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','status','offset','undefined','limit','count','json','apply','reject','save','update','end','sendStatus','stack','name','send','map','fullname','Tags','split','forEach','push','TagIds','then','waiting','UserId','closed','talking','unmanaged'];(function(_0x137e04,_0x3c0799){var _0x4c6762=function(_0x45f489){while(--_0x45f489){_0x137e04['push'](_0x137e04['shift']());}};_0x4c6762(++_0x3c0799);}(_0x5caf,0xaa));var _0xf5ca=function(_0x80c75e,_0xe8ec83){_0x80c75e=_0x80c75e-0x0;var _0x14d39e=_0x5caf[_0x80c75e];return _0x14d39e;};'use strict';var emlformat=require(_0xf5ca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf5ca('0x1'));var jsonpatch=require(_0xf5ca('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf5ca('0x3'));var util=require('util');var path=require(_0xf5ca('0x4'));var sox=require(_0xf5ca('0x5'));var csv=require(_0xf5ca('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf5ca('0x7'));var _=require(_0xf5ca('0x8'));var squel=require(_0xf5ca('0x9'));var crypto=require(_0xf5ca('0xa'));var jsforce=require(_0xf5ca('0xb'));var deskjs=require(_0xf5ca('0xc'));var toCsv=require(_0xf5ca('0x6'));var querystring=require(_0xf5ca('0xd'));var Papa=require(_0xf5ca('0xe'));var Redis=require(_0xf5ca('0xf'));var authService=require(_0xf5ca('0x10'));var qs=require(_0xf5ca('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0xf5ca('0x12'));var logger=require(_0xf5ca('0x13'))(_0xf5ca('0x14'));var utils=require(_0xf5ca('0x15'));var config=require(_0xf5ca('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf5ca('0x17'))['db'];config[_0xf5ca('0x18')]=_['defaults'](config[_0xf5ca('0x18')],{'host':_0xf5ca('0x19'),'port':0x18eb});var socket=require(_0xf5ca('0x1a'))(new Redis(config[_0xf5ca('0x18')]));require(_0xf5ca('0x1b'))['register'](socket);function respondWithStatusCode(_0x3f1079,_0x30be82){_0x30be82=_0x30be82||0xcc;return function(_0x1b2ea0){if(_0x1b2ea0){return _0x3f1079['sendStatus'](_0x30be82);}return _0x3f1079['status'](_0x30be82)['end']();};}function respondWithResult(_0xdb105d,_0x4f69cc){_0x4f69cc=_0x4f69cc||0xc8;return function(_0x195593){if(_0x195593){return _0xdb105d[_0xf5ca('0x1c')](_0x4f69cc)['json'](_0x195593);}};}function respondWithFilteredResult(_0x263027,_0x1860b8){return function(_0x2a54d0){if(_0x2a54d0){var _0xa448c1=typeof _0x1860b8[_0xf5ca('0x1d')]===_0xf5ca('0x1e')&&typeof _0x1860b8[_0xf5ca('0x1f')]===_0xf5ca('0x1e');var _0x484a5c=_0x2a54d0[_0xf5ca('0x20')];var _0x2de0f3=_0xa448c1?0x0:_0x1860b8[_0xf5ca('0x1d')];var _0x1c3572=_0xa448c1?_0x2a54d0[_0xf5ca('0x20')]:_0x1860b8['offset']+_0x1860b8['limit'];var _0x226f9a;if(_0x1c3572>=_0x484a5c){_0x1c3572=_0x484a5c;_0x226f9a=0xc8;}else{_0x226f9a=0xce;}_0x263027[_0xf5ca('0x1c')](_0x226f9a);return _0x263027['set']('Content-Range',_0x2de0f3+'-'+_0x1c3572+'/'+_0x484a5c)[_0xf5ca('0x21')](_0x2a54d0);}return null;};}function patchUpdates(_0x4a6aeb){return function(_0x363108){try{jsonpatch[_0xf5ca('0x22')](_0x363108,_0x4a6aeb,!![]);}catch(_0x56a415){return BPromise[_0xf5ca('0x23')](_0x56a415);}return _0x363108[_0xf5ca('0x24')]();};}function saveUpdates(_0x52d996,_0x262447){return function(_0x55314d){if(_0x55314d){return _0x55314d[_0xf5ca('0x25')](_0x52d996)['then'](function(_0x302b12){return _0x302b12;});}return null;};}function removeEntity(_0x356afc,_0x281ce6){return function(_0x21e95c){if(_0x21e95c){return _0x21e95c['destroy']()['then'](function(){_0x356afc[_0xf5ca('0x1c')](0xcc)[_0xf5ca('0x26')]();});}};}function handleEntityNotFound(_0x3542d9,_0x155c4a){return function(_0x2b0310){if(!_0x2b0310){_0x3542d9[_0xf5ca('0x27')](0x194);}return _0x2b0310;};}function handleError(_0x414124,_0x30dcd2){_0x30dcd2=_0x30dcd2||0x1f4;return function(_0x4919fb){logger['error'](_0x4919fb[_0xf5ca('0x28')]);if(_0x4919fb[_0xf5ca('0x29')]){delete _0x4919fb[_0xf5ca('0x29')];}_0x414124[_0xf5ca('0x1c')](_0x30dcd2)[_0xf5ca('0x2a')](_0x4919fb);};}function getInteractionUsers(_0x5778f9,_0x28308d){return new BPromise(function(_0x25efb7,_0x6e982c){try{if(_0x28308d[_0x5778f9['id']]){_0x5778f9['Users']=_[_0xf5ca('0x2b')](_0x28308d[_0x5778f9['id']],function(_0x55ee9a){return{'id':_0x55ee9a['id'],'fullname':_0x55ee9a[_0xf5ca('0x2c')]};});}}catch(_0xda5a30){_0x6e982c(_0xda5a30);}_0x25efb7(_0x5778f9);});}function getInteractionTags(_0xfd6d36,_0x400cca){return new BPromise(function(_0x49ec7e,_0x59c967){try{if(_0xfd6d36['TagIds']){_0xfd6d36[_0xf5ca('0x2d')]=[];_0xfd6d36['TagIds'][_0xf5ca('0x2e')](',')[_0xf5ca('0x2f')](function(_0x6597e2){_0xfd6d36['Tags'][_0xf5ca('0x30')](_0x400cca[_0x6597e2]);});}delete _0xfd6d36[_0xf5ca('0x31')];}catch(_0x11ba96){_0x59c967(_0x11ba96);}_0x49ec7e(_0xfd6d36);});}function updateSmsInteraction(_0x13d818,_0x43b7cd,_0x1094eb){return new BPromise(function(_0x4dc27c,_0x289929){return getInteractionUsers(_0x13d818,_0x1094eb)[_0xf5ca('0x32')](function(_0x5e3b17){return getInteractionTags(_0x5e3b17,_0x43b7cd);})['then'](function(_0x2184ba){return getStateInteraction(_0x2184ba);})['then'](function(_0x1cee5c){_0x4dc27c(_0x1cee5c);})['catch'](function(_0xce541d){_0x289929(_0xce541d);});});}function getStateInteraction(_0x41802b){return new BPromise(function(_0x56a88a){_0x41802b[_0xf5ca('0x33')]=0x0;_0x41802b['talking']=0x0;_0x41802b['answered']=0x0;_0x41802b['unmanaged']=0x0;_0x41802b['total']=0x0;if(!_0x41802b['closed']&&!_0x41802b[_0xf5ca('0x34')]){_0x41802b['waiting']+=0x1;}if(!_0x41802b[_0xf5ca('0x35')]&&_0x41802b[_0xf5ca('0x34')]){_0x41802b[_0xf5ca('0x36')]+=0x1;if(_0x41802b[_0xf5ca('0x33')]){_0x41802b[_0xf5ca('0x33')]-=0x1;}}if(_0x41802b[_0xf5ca('0x35')]&&_0x41802b[_0xf5ca('0x34')]){_0x41802b['answered']+=0x1;if(_0x41802b[_0xf5ca('0x36')]){_0x41802b[_0xf5ca('0x36')]-=0x1;}}if(_0x41802b[_0xf5ca('0x35')]&&!_0x41802b[_0xf5ca('0x34')]){_0x41802b[_0xf5ca('0x37')]+=0x1;if(_0x41802b[_0xf5ca('0x33')]){_0x41802b['waiting']-=0x1;}}_0x41802b[_0xf5ca('0x38')]+=0x1;_0x56a88a(_0x41802b);});}exports[_0xf5ca('0x39')]=function(_0x452826,_0x2ca7d8){var _0x1bc7df={},_0x4ed472={},_0x7ae866={'count':0x0,'rows':[]};var _0x2f3d47=_['map'](db[_0xf5ca('0x3a')][_0xf5ca('0x3b')],function(_0x3efa99){return{'name':_0x3efa99[_0xf5ca('0x3c')],'type':_0x3efa99['type'][_0xf5ca('0x3d')]};});_0x4ed472[_0xf5ca('0x3e')]=_[_0xf5ca('0x2b')](_0x2f3d47,_0xf5ca('0x29'));_0x4ed472[_0xf5ca('0x3f')]=_['keys'](_0x452826[_0xf5ca('0x3f')]);_0x4ed472[_0xf5ca('0x40')]=_['intersection'](_0x4ed472['model'],_0x4ed472['query']);_0x1bc7df[_0xf5ca('0x41')]=_[_0xf5ca('0x42')](_0x4ed472['model'],qs[_0xf5ca('0x43')](_0x452826[_0xf5ca('0x3f')]['fields']));_0x1bc7df[_0xf5ca('0x41')]=_0x1bc7df[_0xf5ca('0x41')][_0xf5ca('0x44')]?_0x1bc7df[_0xf5ca('0x41')]:_0x4ed472[_0xf5ca('0x3e')];if(!_0x452826[_0xf5ca('0x3f')]['hasOwnProperty'](_0xf5ca('0x45'))){_0x1bc7df['limit']=qs[_0xf5ca('0x1f')](_0x452826[_0xf5ca('0x3f')][_0xf5ca('0x1f')]);_0x1bc7df[_0xf5ca('0x1d')]=qs['offset'](_0x452826[_0xf5ca('0x3f')]['offset']);}_0x1bc7df[_0xf5ca('0x46')]=qs[_0xf5ca('0x47')](_0x452826[_0xf5ca('0x3f')]['sort']);_0x1bc7df['where']=qs[_0xf5ca('0x40')](_['pick'](_0x452826['query'],_0x4ed472[_0xf5ca('0x40')]),_0x2f3d47);var _0x5603ed=[];var _0x494ddc=squel[_0xf5ca('0x48')]()[_0xf5ca('0x49')]('id')[_0xf5ca('0x49')](_0xf5ca('0x29'))[_0xf5ca('0x49')](_0xf5ca('0x4a'))['from'](_0xf5ca('0x4b'));var _0x584dbc=squel[_0xf5ca('0x48')]()['field'](_0xf5ca('0x4c'))[_0xf5ca('0x49')](_0xf5ca('0x4d'))['field']('ui.SmsInteractionId')['from']('user_has_sms_interactions','ui')['left_join'](_0xf5ca('0x4e'),'u',_0xf5ca('0x4f'));var _0x36e96c=squel[_0xf5ca('0x48')]()[_0xf5ca('0x50')](_0xf5ca('0x51'),'i')[_0xf5ca('0x52')](_0xf5ca('0x53'),'c',_0xf5ca('0x54'))['left_join'](_0xf5ca('0x4e'),'o','o.id\x20=\x20i.UserId')[_0xf5ca('0x52')](_0xf5ca('0x55'),'a',_0xf5ca('0x56'))[_0xf5ca('0x52')](_0xf5ca('0x57'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xf5ca('0x52')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')[_0xf5ca('0x52')]('tools_tags','t',_0xf5ca('0x58'));var _0x44243e=squel[_0xf5ca('0x59')]();var _0x4f88ab=[];var _0x431795=squel['expr']();var _0x2cbf3;if(_0x452826[_0xf5ca('0x3f')][_0xf5ca('0x5a')]){_0x2cbf3=as[_0xf5ca('0x5b')](_0x452826[_0xf5ca('0x3f')]['search']);var _0x4e4008=_0x2cbf3[_0xf5ca('0x5c')];for(var _0x5e7bfe=0x0;_0x5e7bfe<_0x2cbf3[_0xf5ca('0x5d')][_0xf5ca('0x44')];_0x5e7bfe++){var _0x20381e=_0x2cbf3[_0xf5ca('0x5d')][_0x5e7bfe];var _0x4b7f5b='i';var _0x3550af=_[_0xf5ca('0x5e')](_0x2f3d47,[_0xf5ca('0x29'),_0x20381e['field']]);if(!_0x3550af){switch(_0x20381e[_0xf5ca('0x49')]){case _0xf5ca('0x5f'):if(_0x20381e[_0xf5ca('0x60')]==0x1){_0x36e96c[_0xf5ca('0x61')]('`'+_0x20381e[_0xf5ca('0x49')]+_0xf5ca('0x62'));}else{_0x36e96c[_0xf5ca('0x61')]('`'+_0x20381e[_0xf5ca('0x49')]+'`\x20>\x200');}break;case _0xf5ca('0x63'):if(_0x20381e[_0xf5ca('0x64')]===_0xf5ca('0x65')){if(_0x20381e[_0xf5ca('0x60')][_0xf5ca('0x2e')]('\x20')[_0xf5ca('0x44')]>0x1){_0x44243e[_0x4e4008](_0xf5ca('0x66'),qs[_0xf5ca('0x67')](_0x20381e[_0xf5ca('0x60')]),null);}else{var _0x135231='%'+_0x20381e[_0xf5ca('0x60')]+'%';_0x44243e[_0x4e4008](_0xf5ca('0x68'),_0x135231,_0x135231,_0x135231);}}else{_0x3550af=_[_0xf5ca('0x5e')](_0x2f3d47,[_0xf5ca('0x29'),_0xf5ca('0x69')]);_0x20381e[_0xf5ca('0x49')]=_0xf5ca('0x69');_0x30e379=as[_0xf5ca('0x6a')](_0x4b7f5b,_0x3550af[_0xf5ca('0x6b')],_0x20381e);_0x44243e[_0x4e4008](_0x30e379[_0xf5ca('0x6c')],_0x30e379[_0xf5ca('0x60')][_0xf5ca('0x6d')],_0x30e379[_0xf5ca('0x60')][_0xf5ca('0x26')]);}break;case _0xf5ca('0x6e'):var _0x434d1b=_0x20381e[_0xf5ca('0x60')][_0xf5ca('0x2e')](',')[_0xf5ca('0x2b')](function(_0x5e8121){return Number(_0x5e8121);});_0x434d1b['forEach'](function(_0x39607a){_0x431795['or'](_0xf5ca('0x6f'),'%,'+_0x39607a+',%');});_0x4f88ab=_[_0xf5ca('0x70')](_0x4f88ab,_0x434d1b);break;case'User':if(_0x20381e['operator']===_0xf5ca('0x65')){_0x44243e[_0x4e4008](_0xf5ca('0x71'),'%'+_0x20381e['value']+'%',null);}else{_0x3550af=_[_0xf5ca('0x5e')](_0x2f3d47,[_0xf5ca('0x29'),_0xf5ca('0x34')]);_0x20381e[_0xf5ca('0x49')]='UserId';_0x30e379=as[_0xf5ca('0x6a')](_0x4b7f5b,_0x3550af['type'],_0x20381e);_0x44243e[_0x4e4008](_0x30e379[_0xf5ca('0x6c')],_0x30e379[_0xf5ca('0x60')][_0xf5ca('0x6d')],_0x30e379[_0xf5ca('0x60')][_0xf5ca('0x26')]);}break;case _0xf5ca('0x72'):_0x30e379=as[_0xf5ca('0x6a')]('me',null,_0x20381e);_0x44243e[_0x4e4008](_0x30e379[_0xf5ca('0x6c')],_0x30e379[_0xf5ca('0x60')][_0xf5ca('0x6d')],_0x30e379[_0xf5ca('0x60')][_0xf5ca('0x26')]);break;}}else{var _0x30e379=as[_0xf5ca('0x6a')](_0x4b7f5b,_0x3550af[_0xf5ca('0x6b')],_0x20381e);_0x44243e[_0x4e4008](_0x30e379[_0xf5ca('0x6c')],_0x30e379['value'][_0xf5ca('0x6d')],_0x30e379['value'][_0xf5ca('0x26')]);}}}else{var _0x3cbaa9=_(_0x452826[_0xf5ca('0x3f')])['keys']()[_0xf5ca('0x2b')](function(_0xbb806c){return _['some'](_0x2f3d47,[_0xf5ca('0x29'),_0xbb806c])?_0xbb806c:undefined;})[_0xf5ca('0x73')]()[_0xf5ca('0x60')]();if(!_[_0xf5ca('0x74')](_0x3cbaa9)){_0x3cbaa9['forEach'](function(_0x229c7e){if(_0x229c7e===_0xf5ca('0x75')){_0x36e96c['where'](_0xf5ca('0x76'),[][_0xf5ca('0x77')](_0x452826['query'][_0x229c7e]));}else if(_0x229c7e===_0xf5ca('0x78')){var _0x4c4015=JSON[_0xf5ca('0x79')](_0x452826[_0xf5ca('0x3f')][_0x229c7e])[_0xf5ca('0x7a')];var _0x2245a7=JSON[_0xf5ca('0x79')](_0x452826[_0xf5ca('0x3f')][_0x229c7e])[_0xf5ca('0x7b')];_0x36e96c[_0xf5ca('0x7c')](_0xf5ca('0x7d'),_0x4c4015,_0x2245a7);}else{if(_0x452826['query'][_0x229c7e]==='null'){_0x36e96c['where']('i.'+_0x229c7e+_0xf5ca('0x7e'));}else{_0x36e96c[_0xf5ca('0x7c')]('i.'+_0x229c7e+_0xf5ca('0x7f'),_0x452826['query'][_0x229c7e]);}}});}if(_0x452826[_0xf5ca('0x3f')][_0xf5ca('0x80')]){if(_0x452826[_0xf5ca('0x3f')]['read']==0x1){_0x36e96c[_0xf5ca('0x61')]('`unreadMessages`\x20=\x200');}else{_0x36e96c[_0xf5ca('0x61')](_0xf5ca('0x81'));}}if(_0x452826[_0xf5ca('0x3f')]['tag']){_0x4f88ab=_[_0xf5ca('0x82')](_0x452826['query']['tag'])?_0x452826[_0xf5ca('0x3f')][_0xf5ca('0x83')]:new Array(_0x452826['query']['tag']);_0x4f88ab[_0xf5ca('0x2f')](function(_0x549e06){_0x431795['or'](_0xf5ca('0x6f'),'%,'+_0x549e06+',%');});}if(_0x452826[_0xf5ca('0x3f')][_0xf5ca('0x84')]){var _0x282b1d=_0x452826['query'][_0xf5ca('0x84')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x282b1d)){_0x44243e['or'](_0xf5ca('0x85'),_0x282b1d+'%')['or']('i.phone\x20LIKE\x20?',_0x282b1d+'%');}else{_0x44243e['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x282b1d))['or'](_0xf5ca('0x86'),_0x282b1d+'%');}}}_0x36e96c['where'](_0x44243e);_0x36e96c[_0xf5ca('0x87')]('i.id');var _0x14ce7a={'type':db[_0xf5ca('0x88')]['QueryTypes'][_0xf5ca('0x89')],'raw':!![]};var _0x2b2331=_0x36e96c['clone']();_0x2b2331['field'](_0xf5ca('0x8a'));_0x2b2331[_0xf5ca('0x49')](_0xf5ca('0x8b'),'unreadMessages');if(_0x1bc7df[_0xf5ca('0x46')]){_0x1bc7df['order'][_0xf5ca('0x2f')](function(_0x177b2d){var _0xf5d9eb=_0x177b2d[0x0]===_0xf5ca('0x8c')?_0x177b2d[0x0]:'i.'+_0x177b2d[0x0];_0x36e96c[_0xf5ca('0x46')](_0xf5d9eb,_0x177b2d[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x4f88ab)){_0x36e96c[_0xf5ca('0x61')](_0x431795);_0x2b2331['where'](_0xf5ca('0x8d'),_0x4f88ab);}BPromise[_0xf5ca('0x8e')]()['then'](function(){if(!_0x2cbf3){if(_0x452826[_0xf5ca('0x3f')][_0xf5ca('0x75')])return;_0x2b2331[_0xf5ca('0x7c')](_0xf5ca('0x8f'));_0x36e96c['where'](_0xf5ca('0x8f'));return;}if(_0x452826[_0xf5ca('0x90')][_0xf5ca('0x91')]!==_0xf5ca('0x92'))return;return _0x452826[_0xf5ca('0x90')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0xf5ca('0x32')](function(_0x1f8af3){if(_[_0xf5ca('0x74')](_0x1f8af3)){_0x2b2331[_0xf5ca('0x7c')]('i.SmsAccountId\x20IS\x20NULL');_0x36e96c[_0xf5ca('0x7c')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x2b2331[_0xf5ca('0x7c')](_0xf5ca('0x76'),_['map'](_0x1f8af3,'id'));_0x36e96c[_0xf5ca('0x7c')](_0xf5ca('0x76'),_[_0xf5ca('0x2b')](_0x1f8af3,'id'));}});})[_0xf5ca('0x32')](function(){if(_0x452826[_0xf5ca('0x90')][_0xf5ca('0x91')]===_0xf5ca('0x92')&&!_0x2cbf3&&!_0x452826[_0xf5ca('0x3f')]['SmsAccountId'])return[];return db['sequelize'][_0xf5ca('0x3f')](_0x2b2331[_0xf5ca('0x93')](),_0x14ce7a);})[_0xf5ca('0x32')](function(_0x4573d2){_0x7ae866[_0xf5ca('0x20')]=_0x4573d2[_0xf5ca('0x44')];if(_0x7ae866[_0xf5ca('0x20')]===0x0)return[];return db[_0xf5ca('0x94')]['query'](_0x494ddc[_0xf5ca('0x93')](),_0x14ce7a)[_0xf5ca('0x32')](function(_0x19d2e0){_0x5603ed=_['keyBy'](_0x19d2e0,'id');_0x14ce7a=_[_0xf5ca('0x95')](_0x14ce7a,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x452826[_0xf5ca('0x3f')][_0xf5ca('0x43')]){_0x1bc7df[_0xf5ca('0x41')][_0xf5ca('0x2f')](function(_0x1fe545){_0x36e96c[_0xf5ca('0x49')]('i.'+_0x1fe545);});}else{_0x36e96c[_0xf5ca('0x49')](_0xf5ca('0x8b'),_0xf5ca('0x5f'));_0x36e96c['field'](_0xf5ca('0x96'),'Account.key');_0x36e96c[_0xf5ca('0x49')]('a.mandatoryDisposition',_0xf5ca('0x97'));_0x36e96c[_0xf5ca('0x49')](_0xf5ca('0x98'),_0xf5ca('0x8c'));_0x36e96c[_0xf5ca('0x49')]('i.*');_0x36e96c[_0xf5ca('0x49')](_0xf5ca('0x99'),_0xf5ca('0x9a'));_0x36e96c[_0xf5ca('0x49')](_0xf5ca('0x9b'),_0xf5ca('0x9c'));_0x36e96c[_0xf5ca('0x49')](_0xf5ca('0x9d'),_0xf5ca('0x9e'));_0x36e96c['field'](_0xf5ca('0x9f'),_0xf5ca('0xa0'));_0x36e96c[_0xf5ca('0x49')](_0xf5ca('0xa1'),_0xf5ca('0xa2'));_0x36e96c['field']('c.fax',_0xf5ca('0xa3'));_0x36e96c[_0xf5ca('0x49')](_0xf5ca('0xa4'),'Owner.fullname');_0x36e96c[_0xf5ca('0x49')](_0xf5ca('0xa5'),_0xf5ca('0xa6'));_0x36e96c[_0xf5ca('0x49')](_0xf5ca('0xa7'),_0xf5ca('0x31'));}if(_0x1bc7df[_0xf5ca('0x1f')])_0x36e96c[_0xf5ca('0x1f')](_0x1bc7df[_0xf5ca('0x1f')]);if(_0x1bc7df[_0xf5ca('0x1d')])_0x36e96c['offset'](_0x1bc7df[_0xf5ca('0x1d')]);return db[_0xf5ca('0x94')][_0xf5ca('0x3f')](_0x36e96c[_0xf5ca('0x93')](),_0x14ce7a);})[_0xf5ca('0x32')](function(_0x77816){if(_0x77816[_0xf5ca('0x44')]>0x0)_0x584dbc['where'](_0xf5ca('0xa8'),_[_0xf5ca('0x2b')](_0x77816,'id'));return db[_0xf5ca('0x94')]['query'](_0x584dbc[_0xf5ca('0x93')](),_0x14ce7a)[_0xf5ca('0x32')](function(_0x5ba32b){var _0x6bdf15=_[_0xf5ca('0xa9')](_0x5ba32b,'SmsInteractionId');var _0x29e26a=[];_0x77816['forEach'](function(_0x1c6c92){_0x29e26a[_0xf5ca('0x30')](updateSmsInteraction(_0x1c6c92,_0x5603ed,_0x6bdf15));});return BPromise[_0xf5ca('0xaa')](_0x29e26a);});});})[_0xf5ca('0x32')](function(_0x2bde8c){_0x7ae866[_0xf5ca('0xab')]=_0x2bde8c;return _0x7ae866;})[_0xf5ca('0x32')](respondWithFilteredResult(_0x2ca7d8,_0x1bc7df))['catch'](handleError(_0x2ca7d8,null));};exports[_0xf5ca('0xac')]=function(_0x145f52,_0x5b16eb){var _0x4f345d={'raw':![],'where':{'id':_0x145f52[_0xf5ca('0xad')]['id']}},_0x4b20b3={};_0x4b20b3[_0xf5ca('0x3e')]=_['keys'](db[_0xf5ca('0x3a')][_0xf5ca('0x3b')]);_0x4b20b3[_0xf5ca('0x3f')]=_[_0xf5ca('0xae')](_0x145f52[_0xf5ca('0x3f')]);_0x4b20b3['filters']=_[_0xf5ca('0x42')](_0x4b20b3[_0xf5ca('0x3e')],_0x4b20b3['query']);_0x4f345d['attributes']=_[_0xf5ca('0x42')](_0x4b20b3[_0xf5ca('0x3e')],qs[_0xf5ca('0x43')](_0x145f52['query']['fields']));_0x4f345d[_0xf5ca('0x41')]=_0x4f345d[_0xf5ca('0x41')]['length']?_0x4f345d[_0xf5ca('0x41')]:_0x4b20b3[_0xf5ca('0x3e')];if(_0x145f52[_0xf5ca('0x3f')][_0xf5ca('0xaf')]){_0x4f345d[_0xf5ca('0xb0')]=[{'all':!![]}];}_0x4f345d=_[_0xf5ca('0x95')]({},_0x4f345d,_0x145f52['options']);return db[_0xf5ca('0x3a')][_0xf5ca('0x5e')](_0x4f345d)['then'](handleEntityNotFound(_0x5b16eb,null))['then'](respondWithResult(_0x5b16eb,null))[_0xf5ca('0xb1')](handleError(_0x5b16eb,null));};exports[_0xf5ca('0xb2')]=function(_0x255c8f,_0x1e7f2e){return db['SmsInteraction'][_0xf5ca('0xb2')](_0x255c8f[_0xf5ca('0x72')],{})['then'](respondWithResult(_0x1e7f2e,0xc9))['catch'](handleError(_0x1e7f2e,null));};exports[_0xf5ca('0x25')]=function(_0x51cd17,_0x3d71c4){if(_0x51cd17[_0xf5ca('0x72')]['id']){delete _0x51cd17[_0xf5ca('0x72')]['id'];}return db['SmsInteraction'][_0xf5ca('0x5e')]({'where':{'id':_0x51cd17[_0xf5ca('0xad')]['id']}})[_0xf5ca('0x32')](handleEntityNotFound(_0x3d71c4,null))[_0xf5ca('0x32')](saveUpdates(_0x51cd17[_0xf5ca('0x72')],null))[_0xf5ca('0x32')](respondWithResult(_0x3d71c4,null))['catch'](handleError(_0x3d71c4,null));};exports[_0xf5ca('0xb3')]=function(_0x3fc8ac,_0x411edb){return db['SmsInteraction'][_0xf5ca('0x5e')]({'where':{'id':_0x3fc8ac[_0xf5ca('0xad')]['id']}})[_0xf5ca('0x32')](handleEntityNotFound(_0x411edb,null))[_0xf5ca('0x32')](removeEntity(_0x411edb,null))['catch'](handleError(_0x411edb,null));};exports[_0xf5ca('0xb4')]=function(_0x1b708a,_0x14be1f){return db[_0xf5ca('0x3a')][_0xf5ca('0xb4')]()[_0xf5ca('0x32')](respondWithResult(_0x14be1f,null))[_0xf5ca('0xb1')](handleError(_0x14be1f,null));};exports[_0xf5ca('0xb5')]=function(_0x5c0b29,_0x1564e4,_0x1f669d){return db[_0xf5ca('0xb6')][_0xf5ca('0x5e')]({'where':{'id':_0x5c0b29[_0xf5ca('0xad')]['id']}})['then'](handleEntityNotFound(_0x1564e4,null))[_0xf5ca('0x32')](function(_0x6bb9ac){if(_0x6bb9ac){return _0x6bb9ac['addMessage'](_0x5c0b29[_0xf5ca('0x72')]['ids'],_[_0xf5ca('0xb7')](_0x5c0b29[_0xf5ca('0x72')],[_0xf5ca('0xb8'),'id'])||{});}})[_0xf5ca('0x32')](respondWithResult(_0x1564e4,null))[_0xf5ca('0xb1')](handleError(_0x1564e4,null));};exports[_0xf5ca('0xb9')]=function(_0x3c40cd,_0x2d34f1,_0x197c6){var _0x5ee525={'raw':![],'where':{}};var _0x4da9a6={};var _0x44e568={'count':0x0,'rows':[]};return db[_0xf5ca('0x3a')][_0xf5ca('0xba')]({'where':{'id':_0x3c40cd[_0xf5ca('0xad')]['id']}})[_0xf5ca('0x32')](handleEntityNotFound(_0x2d34f1,null))[_0xf5ca('0x32')](function(_0x46a515){if(_0x46a515){_0x4da9a6[_0xf5ca('0x3e')]=_[_0xf5ca('0xae')](db[_0xf5ca('0xb6')][_0xf5ca('0x3b')]);_0x4da9a6['query']=_[_0xf5ca('0xae')](_0x3c40cd[_0xf5ca('0x3f')]);_0x4da9a6[_0xf5ca('0x40')]=_[_0xf5ca('0x42')](_0x4da9a6['model'],_0x4da9a6[_0xf5ca('0x3f')]);_0x5ee525['attributes']=_[_0xf5ca('0x42')](_0x4da9a6[_0xf5ca('0x3e')],qs[_0xf5ca('0x43')](_0x3c40cd[_0xf5ca('0x3f')][_0xf5ca('0x43')]));_0x5ee525[_0xf5ca('0x41')]=_0x5ee525[_0xf5ca('0x41')]['length']?_0x5ee525[_0xf5ca('0x41')]:_0x4da9a6['model'];if(!_0x3c40cd[_0xf5ca('0x3f')][_0xf5ca('0xbb')](_0xf5ca('0x45'))){_0x5ee525['limit']=qs[_0xf5ca('0x1f')](_0x3c40cd['query']['limit']);_0x5ee525['offset']=qs['offset'](_0x3c40cd[_0xf5ca('0x3f')][_0xf5ca('0x1d')]);}_0x5ee525[_0xf5ca('0x46')]=qs[_0xf5ca('0x47')](_0x3c40cd[_0xf5ca('0x3f')][_0xf5ca('0x47')]);_0x5ee525[_0xf5ca('0x7c')]=qs[_0xf5ca('0x40')](_['pick'](_0x3c40cd[_0xf5ca('0x3f')],_0x4da9a6[_0xf5ca('0x40')]));_0x5ee525[_0xf5ca('0x7c')][_0xf5ca('0xbc')]=_0x46a515['id'];if(_0x3c40cd[_0xf5ca('0x3f')][_0xf5ca('0x84')]){_0x5ee525[_0xf5ca('0x7c')]=_['merge'](_0x5ee525[_0xf5ca('0x7c')],{'$or':_[_0xf5ca('0x2b')](_0x5ee525[_0xf5ca('0x41')],function(_0xfb7824){var _0x4b5250={};_0x4b5250[_0xfb7824]={'$like':'%'+_0x3c40cd[_0xf5ca('0x3f')]['filter']+'%'};return _0x4b5250;})});}if(_0x3c40cd[_0xf5ca('0x3f')]['$gte']){var _0xb90575=_0x3c40cd['query'][_0xf5ca('0x7a')][_0xf5ca('0x2e')](',');var _0x5bee01={};_0x5bee01[_0xb90575[0x0]]={'$gte':moment(_0xb90575[0x1])['format'](_0xf5ca('0xbd'))};_0x5ee525[_0xf5ca('0x7c')]=_[_0xf5ca('0x95')](_0x5ee525[_0xf5ca('0x7c')],_0x5bee01);}_0x5ee525=_[_0xf5ca('0x95')]({},_0x5ee525,_0x3c40cd['options']);return db[_0xf5ca('0xb6')][_0xf5ca('0x20')]({'where':_0x5ee525[_0xf5ca('0x7c')]})[_0xf5ca('0x32')](function(_0xf814fb){_0x44e568['count']=_0xf814fb;if(_0x3c40cd['query'][_0xf5ca('0xaf')]){_0x5ee525[_0xf5ca('0xb0')]=[{'all':!![]}];}return db['SmsMessage'][_0xf5ca('0xbe')](_0x5ee525);})['then'](function(_0x2f8591){_0x44e568[_0xf5ca('0xab')]=_0x2f8591;return _0x44e568;});}})[_0xf5ca('0x32')](respondWithFilteredResult(_0x2d34f1,_0x5ee525))[_0xf5ca('0xb1')](handleError(_0x2d34f1,null));};exports[_0xf5ca('0xbf')]=function(_0x68b48c,_0x2241b8,_0x2276fc){return db[_0xf5ca('0x3a')][_0xf5ca('0x5e')]({'where':{'id':_0x68b48c['params']['id']}})[_0xf5ca('0x32')](handleEntityNotFound(_0x2241b8,null))[_0xf5ca('0x32')](function(_0x323809){if(_0x323809){return _0x323809[_0xf5ca('0xc0')](_0x68b48c[_0xf5ca('0x72')][_0xf5ca('0xb8')],_[_0xf5ca('0xb7')](_0x68b48c['body'],[_0xf5ca('0xb8'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0xf5ca('0x29'),_0xf5ca('0x4a')],'where':{'id':_0x68b48c['body'][_0xf5ca('0xb8')]}});})[_0xf5ca('0x32')](function(_0x55921d){socket[_0xf5ca('0xc1')](_0xf5ca('0xc2'),{'id':Number(_0x68b48c['params']['id']),'tags':_0x55921d||[]});return{'id':Number(_0x68b48c['params']['id']),'tags':_0x55921d||[]};});}})[_0xf5ca('0x32')](respondWithResult(_0x2241b8,null))[_0xf5ca('0xb1')](handleError(_0x2241b8,null));};exports[_0xf5ca('0xc3')]=function(_0x512d6a,_0x53df58,_0x5d6fbf){return db[_0xf5ca('0x3a')][_0xf5ca('0x5e')]({'where':{'id':_0x512d6a[_0xf5ca('0xad')]['id']}})[_0xf5ca('0x32')](handleEntityNotFound(_0x53df58,null))['then'](function(_0x28d539){if(_0x28d539){return _0x28d539[_0xf5ca('0xc3')](_0x512d6a[_0xf5ca('0x3f')][_0xf5ca('0xb8')]);}})['then'](respondWithStatusCode(_0x53df58,null))[_0xf5ca('0xb1')](handleError(_0x53df58,null));};exports['download']=function(_0x33b87d,_0x4e1ac9){var _0x8c3a37=moment()[_0xf5ca('0xc4')]()[_0xf5ca('0x93')]();var _0x47ff59=path['join'](config['root'],'server','files',_0xf5ca('0xc5'));var _0x36ed6e=path[_0xf5ca('0xc6')](config[_0xf5ca('0xc7')],_0xf5ca('0xc8'),_0xf5ca('0xc9'),_0xf5ca('0xca'));var _0x21b40c=path[_0xf5ca('0xc6')](_0x47ff59,_0x8c3a37);var _0x1402bd=util[_0xf5ca('0xcb')](_0xf5ca('0xcc'),_0x33b87d[_0xf5ca('0xad')]['id'],_0x8c3a37);var _0x319ac5=path[_0xf5ca('0xc6')](_0x47ff59,_0x1402bd);var _0x3ef092=[];_0x3ef092['push']({'model':db['User'],'as':'User','attributes':['id',_0xf5ca('0x2c')],'raw':!![]});_0x3ef092[_0xf5ca('0x30')]({'model':db['CmContact'],'as':_0xf5ca('0x63'),'attributes':['id',_0xf5ca('0xcd'),_0xf5ca('0xce')],'raw':!![]});var _0x27ecf7=[{'model':db[_0xf5ca('0xb6')],'as':_0xf5ca('0xcf'),'attributes':['id','body','createdAt',_0xf5ca('0xd0'),_0xf5ca('0xd1'),_0xf5ca('0x80')],'include':_0x3ef092}];_0x27ecf7[_0xf5ca('0x30')]({'model':db[_0xf5ca('0xd2')],'as':_0xf5ca('0xd3'),'attributes':['id','name']});_0x27ecf7[_0xf5ca('0x30')]({'model':db[_0xf5ca('0xd4')],'as':'Owner','attributes':['id',_0xf5ca('0x2c')]});return db['SmsInteraction'][_0xf5ca('0x5e')]({'where':{'id':_0x33b87d['params']['id']},'include':_0x27ecf7})[_0xf5ca('0x32')](handleEntityNotFound(_0x4e1ac9,null))[_0xf5ca('0x32')](function(_0x3bfcce){if(_0x3bfcce){var _0x220f0f=_0x3bfcce[_0xf5ca('0xd5')]({'plain':!![]});fs['mkdirSync'](_0x21b40c);var _0x5c1967={'channel':_0xf5ca('0xd6'),'account':_0x220f0f['Account'][_0xf5ca('0x29')],'agent':_0x220f0f[_0xf5ca('0xd7')]?_0x220f0f['Owner'][_0xf5ca('0x2c')]:_0xf5ca('0xd8'),'createdAt':moment(_0x220f0f['createdAt'])[_0xf5ca('0xcb')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x220f0f['closed']?moment(_0x220f0f['closedAt'])[_0xf5ca('0xcb')](_0xf5ca('0xbd'))['toString']():'','disposition':_0x220f0f[_0xf5ca('0xd9')],'messages':_(_0x220f0f[_0xf5ca('0xcf')])[_0xf5ca('0x84')]({'secret':![]})[_0xf5ca('0x2b')](function(_0x4a9a48){return{'date':moment(_0x4a9a48[_0xf5ca('0x78')])[_0xf5ca('0xcb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf5ca('0x93')](),'sender':_0x4a9a48[_0xf5ca('0xd0')]===_0xf5ca('0xda')?_0x4a9a48[_0xf5ca('0xd4')]?_0x4a9a48['User']['fullname']:_0xf5ca('0xdb'):_0x4a9a48[_0xf5ca('0x63')]['firstName']+(_0x4a9a48['Contact'][_0xf5ca('0xce')]?'\x20'+_0x4a9a48['Contact'][_0xf5ca('0xce')]:''),'body':_0x4a9a48['body'],'direction':_0x4a9a48[_0xf5ca('0xd0')]===_0xf5ca('0xda')?'A':'C','secret':_0x4a9a48[_0xf5ca('0xd1')],'read':_0x4a9a48[_0xf5ca('0x80')]};})[_0xf5ca('0x60')]()};return ejs[_0xf5ca('0xdc')](path['join'](config[_0xf5ca('0xc7')],_0xf5ca('0xc8'),_0xf5ca('0xdd'),_0xf5ca('0xde')),{'interaction':_0x5c1967})[_0xf5ca('0x32')](function(_0x448299){var _0xe93b6=path[_0xf5ca('0xc6')](_0x21b40c,'transcript-'+_0x220f0f['id']+'-'+_0x8c3a37+_0xf5ca('0xdf'));var _0x8262a3={'path':_0xe93b6,'channel':_0xf5ca('0xd6'),'interactionId':_0x220f0f['id']};return pdf['createPdfFromHTML'](_0x448299,_0x8262a3);})[_0xf5ca('0x32')](function(){return new BPromise(function(_0xf4d9d3,_0x56be8d){zipdir(_0x21b40c,{'saveTo':_0x319ac5},function(_0x118c05,_0x599ee9){if(_0x118c05)return _0x56be8d(_0x118c05);return _0xf4d9d3(_0x599ee9);});})[_0xf5ca('0x32')](function(){return new BPromise(function(_0x4a1ef4,_0x1cf602){rimraf(_0x21b40c,function(_0x45a413){if(_0x45a413)_0x1cf602(_0x45a413);return _0x4a1ef4();});});})[_0xf5ca('0x32')](function(){return _0x4e1ac9[_0xf5ca('0xe0')](_0x319ac5,_0x1402bd,function(_0x5a977e){if(_0x5a977e){console[_0xf5ca('0xe1')]('err',_0x5a977e);}else{fs['unlinkSync'](_0x319ac5);}});});});}else{return _0x4e1ac9[_0xf5ca('0x27')](0xc8);}})['catch'](handleError(_0x4e1ac9,null));};
\ No newline at end of file
index 4ac56ab..9be496c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0972=['save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x5599aa,_0x1986fa){var _0x5d8e58=function(_0x1e6cc5){while(--_0x1e6cc5){_0x5599aa['push'](_0x5599aa['shift']());}};_0x5d8e58(++_0x1986fa);}(_0x0972,0x64));var _0x2097=function(_0x215797,_0x49d505){_0x215797=_0x215797-0x0;var _0x4a3697=_0x0972[_0x215797];return _0x4a3697;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x2097('0x0'))['db']['SmsInteraction'];var SmsMessage=require(_0x2097('0x0'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x2097('0x1')](0x0);var events={'afterCreate':_0x2097('0x2'),'afterUpdate':'update','afterDestroy':_0x2097('0x3')};function emitEvent(_0x431d1c){return function(_0xe6fbae,_0x1a7d26,_0x2f84d8){_0xe6fbae[_0x2097('0x4')]({'attributes':['id'],'raw':!![]})[_0x2097('0x5')](function(_0x59739f){_0xe6fbae[_0x2097('0x6')](_0x2097('0x7'),_0x59739f[_0x2097('0x8')](function(_0x1d94e2){return{'id':_0x1d94e2['id']};}));return SmsMessage[_0x2097('0x9')]({'where':{'SmsInteractionId':_0xe6fbae['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2e0024){_0xe6fbae[_0x2097('0x6')](_0x2097('0xa'),_0x2e0024[_0x2097('0xb')]);SmsInteractionEvents[_0x2097('0xc')](_0x431d1c+':'+_0xe6fbae['id'],_0xe6fbae);SmsInteractionEvents[_0x2097('0xc')](_0x431d1c,_0xe6fbae);_0x2f84d8(null);})[_0x2097('0xd')](_0x2f84d8(null));};}for(var e in events){if(events[_0x2097('0xe')](e)){var event=events[e];SmsInteraction[_0x2097('0xf')](e,emitEvent(event));}}module[_0x2097('0x10')]=SmsInteractionEvents;
\ No newline at end of file
+var _0xb44a=['hook','exports','SmsInteraction','SmsMessage','update','getUsers','then','setDataValue','Users','map','findAll','length','catch','hasOwnProperty'];(function(_0x38019b,_0x2d357e){var _0x1907d2=function(_0x281a35){while(--_0x281a35){_0x38019b['push'](_0x38019b['shift']());}};_0x1907d2(++_0x2d357e);}(_0xb44a,0x1c2));var _0xab44=function(_0x479f47,_0x3d619a){_0x479f47=_0x479f47-0x0;var _0xc3fac2=_0xb44a[_0x479f47];return _0xc3fac2;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0xab44('0x0')];var SmsMessage=require('../../mysqldb')['db'][_0xab44('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xab44('0x2'),'afterDestroy':'remove'};function emitEvent(_0x1b9e05){return function(_0x32396c,_0x2e3662,_0x28681a){_0x32396c[_0xab44('0x3')]({'attributes':['id'],'raw':!![]})[_0xab44('0x4')](function(_0x3ead8d){_0x32396c[_0xab44('0x5')](_0xab44('0x6'),_0x3ead8d[_0xab44('0x7')](function(_0x2ba1c1){return{'id':_0x2ba1c1['id']};}));return SmsMessage[_0xab44('0x8')]({'where':{'SmsInteractionId':_0x32396c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xab44('0x4')](function(_0x55c7d2){_0x32396c[_0xab44('0x5')]('unreadMessages',_0x55c7d2[_0xab44('0x9')]);SmsInteractionEvents['emit'](_0x1b9e05+':'+_0x32396c['id'],_0x32396c);SmsInteractionEvents['emit'](_0x1b9e05,_0x32396c);_0x28681a(null);})[_0xab44('0xa')](_0x28681a(null));};}for(var e in events){if(events[_0xab44('0xb')](e)){var event=events[e];SmsInteraction[_0xab44('0xc')](e,emitEvent(event));}}module[_0xab44('0xd')]=SmsInteractionEvents;
\ No newline at end of file
index 36bc5b8..272688a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca2c=['define','SmsInteraction','sms_interactions','changed','closed','format','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x153044,_0x12f6a2){var _0x5e3304=function(_0x27a448){while(--_0x27a448){_0x153044['push'](_0x153044['shift']());}};_0x5e3304(++_0x12f6a2);}(_0xca2c,0x76));var _0xcca2=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xca2c[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xcca2('0x0'));var util=require(_0xcca2('0x1'));var logger=require(_0xcca2('0x2'))(_0xcca2('0x3'));var moment=require(_0xcca2('0x4'));var BPromise=require(_0xcca2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcca2('0x6'));var rimraf=require(_0xcca2('0x7'));var config=require(_0xcca2('0x8'));var attributes=require('./smsInteraction.attributes');module[_0xcca2('0x9')]=function(_0x10b499,_0x332ecb){return _0x10b499[_0xcca2('0xa')](_0xcca2('0xb'),attributes,{'tableName':_0xcca2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2baa5f,_0x336db4,_0x541ecb){if(_0x2baa5f[_0xcca2('0xd')](_0xcca2('0xe'))){_0x2baa5f['closedAt']=moment()[_0xcca2('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x541ecb(null,_0x2baa5f);}}});};
\ No newline at end of file
+var _0xd0bb=['SmsInteraction','sms_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes','exports'];(function(_0x93b7d1,_0x3f08b2){var _0x9ec56=function(_0x3cb02f){while(--_0x3cb02f){_0x93b7d1['push'](_0x93b7d1['shift']());}};_0x9ec56(++_0x3f08b2);}(_0xd0bb,0xa6));var _0xbd0b=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0xd0bb[_0x3fd3a3];return _0xa3e4d5;};'use strict';var _=require('lodash');var util=require(_0xbd0b('0x0'));var logger=require(_0xbd0b('0x1'))(_0xbd0b('0x2'));var moment=require(_0xbd0b('0x3'));var BPromise=require(_0xbd0b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd0b('0x5'));var rimraf=require(_0xbd0b('0x6'));var config=require(_0xbd0b('0x7'));var attributes=require(_0xbd0b('0x8'));module[_0xbd0b('0x9')]=function(_0x3e942f,_0x479c1f){return _0x3e942f['define'](_0xbd0b('0xa'),attributes,{'tableName':_0xbd0b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x25409c,_0x99cbac,_0x293afb){if(_0x25409c['changed'](_0xbd0b('0xc'))){_0x25409c[_0xbd0b('0xd')]=moment()[_0xbd0b('0xe')](_0xbd0b('0xf'));}_0x293afb(null,_0x25409c);}}});};
\ No newline at end of file
index 570c0fa..aa65db4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde57=['socket.io-emitter','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','UpdateSmsInteraction','body','options','where','attributes','limit','debug','catch','AddTagsToSmsInteraction','SmsInteraction','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost'];(function(_0x337cf8,_0x445af5){var _0x3abf8c=function(_0x5f1599){while(--_0x5f1599){_0x337cf8['push'](_0x337cf8['shift']());}};_0x3abf8c(++_0x445af5);}(_0xde57,0x1b6));var _0x7de5=function(_0x4d08b8,_0x34c445){_0x4d08b8=_0x4d08b8-0x0;var _0x70214a=_0xde57[_0x4d08b8];return _0x70214a;};'use strict';var _=require(_0x7de5('0x0'));var util=require(_0x7de5('0x1'));var moment=require(_0x7de5('0x2'));var BPromise=require(_0x7de5('0x3'));var rs=require(_0x7de5('0x4'));var fs=require('fs');var Redis=require(_0x7de5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7de5('0x6'));var logger=require('../../config/logger')(_0x7de5('0x7'));var config=require(_0x7de5('0x8'));var jayson=require(_0x7de5('0x9'));var client=jayson[_0x7de5('0xa')]['http']({'port':0x232a});config[_0x7de5('0xb')]=_['defaults'](config[_0x7de5('0xb')],{'host':_0x7de5('0xc'),'port':0x18eb});var socket=require(_0x7de5('0xd'))(new Redis(config['redis']));require(_0x7de5('0xe'))[_0x7de5('0xf')](socket);function respondWithRpcPromise(_0x17a202,_0x2741da,_0x164173){return new BPromise(function(_0x132ad2,_0x5108b4){return client[_0x7de5('0x10')](_0x17a202,_0x164173)[_0x7de5('0x11')](function(_0x531f76){logger['info'](_0x7de5('0x12'),_0x2741da,_0x7de5('0x13'));logger['debug'](_0x7de5('0x14'),_0x2741da,'request\x20sent',JSON[_0x7de5('0x15')](_0x531f76));if(_0x531f76[_0x7de5('0x16')]){if(_0x531f76[_0x7de5('0x16')]['code']===0x1f4){logger[_0x7de5('0x16')](_0x7de5('0x12'),_0x2741da,_0x531f76[_0x7de5('0x16')][_0x7de5('0x17')]);return _0x5108b4(_0x531f76[_0x7de5('0x16')][_0x7de5('0x17')]);}logger[_0x7de5('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x2741da,_0x531f76['error'][_0x7de5('0x17')]);return _0x132ad2(_0x531f76['error'][_0x7de5('0x17')]);}else{logger[_0x7de5('0x18')]('SmsInteraction,\x20%s,\x20%s',_0x2741da,_0x7de5('0x13'));_0x132ad2(_0x531f76[_0x7de5('0x19')][_0x7de5('0x17')]);}})['catch'](function(_0x3c53eb){logger[_0x7de5('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x2741da,_0x3c53eb);_0x5108b4(_0x3c53eb);});});}exports[_0x7de5('0x1a')]=function(_0x3c9160){var _0x331d3e=this;return new Promise(function(_0xbb358c,_0x1ac199){return db['SmsInteraction']['update'](_0x3c9160[_0x7de5('0x1b')],{'raw':_0x3c9160[_0x7de5('0x1c')]?_0x3c9160['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c9160['options']?_0x3c9160[_0x7de5('0x1c')][_0x7de5('0x1d')]||null:null,'attributes':_0x3c9160['options']?_0x3c9160['options'][_0x7de5('0x1e')]||null:null,'limit':_0x3c9160['options']?_0x3c9160[_0x7de5('0x1c')][_0x7de5('0x1f')]||null:null})[_0x7de5('0x11')](function(_0x4caba2){logger[_0x7de5('0x18')](_0x7de5('0x1a'),_0x3c9160);logger[_0x7de5('0x20')](_0x7de5('0x1a'),_0x3c9160,JSON[_0x7de5('0x15')](_0x4caba2));_0xbb358c(_0x4caba2);})[_0x7de5('0x21')](function(_0x3a19bb){logger[_0x7de5('0x16')]('UpdateSmsInteraction',_0x3a19bb[_0x7de5('0x17')],_0x3c9160);_0x1ac199(_0x331d3e[_0x7de5('0x16')](0x1f4,_0x3a19bb[_0x7de5('0x17')]));});});};exports[_0x7de5('0x22')]=function(_0x947246){return new Promise(function(_0x2126c7,_0x2e047c){return db[_0x7de5('0x23')]['find']({'where':_0x947246[_0x7de5('0x1c')]?_0x947246[_0x7de5('0x1c')][_0x7de5('0x1d')]||null:null})[_0x7de5('0x11')](function(_0x94257){if(_0x94257){return _0x94257[_0x7de5('0x24')](_0x947246[_0x7de5('0x1b')]['ids'],_[_0x7de5('0x25')](_0x947246[_0x7de5('0x1b')],[_0x7de5('0x26'),'id'])||{});}})[_0x7de5('0x27')](function(_0x2d9c89){logger[_0x7de5('0x18')](_0x7de5('0x28'),_0x947246);logger[_0x7de5('0x20')](_0x7de5('0x28'),_0x947246,JSON['stringify'](_0x2d9c89));_0x2126c7(_0x2d9c89);})[_0x7de5('0x21')](function(_0x18efd3){logger[_0x7de5('0x16')](_0x7de5('0x28'),_0x18efd3[_0x7de5('0x17')],_0x947246);_0x2e047c(_this[_0x7de5('0x16')](0x1f4,_0x18efd3['message']));});});};
\ No newline at end of file
+var _0x8802=['spread','AddTags','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsInteraction.socket','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','UpdateSmsInteraction','update','body','options','raw','where','attributes','limit','catch','AddTagsToSmsInteraction','find','ids'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x8802,0x7e));var _0x2880=function(_0x54cd98,_0x3029e6){_0x54cd98=_0x54cd98-0x0;var _0x4abd09=_0x8802[_0x54cd98];return _0x4abd09;};'use strict';var _=require(_0x2880('0x0'));var util=require('util');var moment=require(_0x2880('0x1'));var BPromise=require('bluebird');var rs=require(_0x2880('0x2'));var fs=require('fs');var Redis=require(_0x2880('0x3'));var db=require(_0x2880('0x4'))['db'];var utils=require(_0x2880('0x5'));var logger=require(_0x2880('0x6'))(_0x2880('0x7'));var config=require(_0x2880('0x8'));var jayson=require(_0x2880('0x9'));var client=jayson[_0x2880('0xa')][_0x2880('0xb')]({'port':0x232a});config[_0x2880('0xc')]=_[_0x2880('0xd')](config[_0x2880('0xc')],{'host':_0x2880('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2880('0xc')]));require(_0x2880('0xf'))['register'](socket);function respondWithRpcPromise(_0x51d822,_0x19952b,_0x55ca98){return new BPromise(function(_0x459068,_0x833894){return client[_0x2880('0x10')](_0x51d822,_0x55ca98)[_0x2880('0x11')](function(_0xda6cdc){logger['info'](_0x2880('0x12'),_0x19952b,_0x2880('0x13'));logger[_0x2880('0x14')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x19952b,_0x2880('0x13'),JSON['stringify'](_0xda6cdc));if(_0xda6cdc[_0x2880('0x15')]){if(_0xda6cdc[_0x2880('0x15')][_0x2880('0x16')]===0x1f4){logger[_0x2880('0x15')](_0x2880('0x12'),_0x19952b,_0xda6cdc[_0x2880('0x15')][_0x2880('0x17')]);return _0x833894(_0xda6cdc['error']['message']);}logger[_0x2880('0x15')](_0x2880('0x12'),_0x19952b,_0xda6cdc['error'][_0x2880('0x17')]);return _0x459068(_0xda6cdc[_0x2880('0x15')]['message']);}else{logger[_0x2880('0x18')](_0x2880('0x12'),_0x19952b,_0x2880('0x13'));_0x459068(_0xda6cdc[_0x2880('0x19')]['message']);}})['catch'](function(_0x2eef3f){logger['error'](_0x2880('0x12'),_0x19952b,_0x2eef3f);_0x833894(_0x2eef3f);});});}exports[_0x2880('0x1a')]=function(_0x52db8f){var _0x401728=this;return new Promise(function(_0x479e30,_0x10b359){return db['SmsInteraction'][_0x2880('0x1b')](_0x52db8f[_0x2880('0x1c')],{'raw':_0x52db8f[_0x2880('0x1d')]?_0x52db8f[_0x2880('0x1d')][_0x2880('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52db8f[_0x2880('0x1d')]?_0x52db8f[_0x2880('0x1d')][_0x2880('0x1f')]||null:null,'attributes':_0x52db8f[_0x2880('0x1d')]?_0x52db8f[_0x2880('0x1d')][_0x2880('0x20')]||null:null,'limit':_0x52db8f[_0x2880('0x1d')]?_0x52db8f[_0x2880('0x1d')][_0x2880('0x21')]||null:null})[_0x2880('0x11')](function(_0x4cf71b){logger['info']('UpdateSmsInteraction',_0x52db8f);logger[_0x2880('0x14')](_0x2880('0x1a'),_0x52db8f,JSON['stringify'](_0x4cf71b));_0x479e30(_0x4cf71b);})[_0x2880('0x22')](function(_0x4162e1){logger[_0x2880('0x15')]('UpdateSmsInteraction',_0x4162e1[_0x2880('0x17')],_0x52db8f);_0x10b359(_0x401728['error'](0x1f4,_0x4162e1['message']));});});};exports[_0x2880('0x23')]=function(_0x12f2dc){return new Promise(function(_0x1d4b7c,_0x1e2b10){return db['SmsInteraction'][_0x2880('0x24')]({'where':_0x12f2dc[_0x2880('0x1d')]?_0x12f2dc[_0x2880('0x1d')][_0x2880('0x1f')]||null:null})[_0x2880('0x11')](function(_0x212693){if(_0x212693){return _0x212693['addTags'](_0x12f2dc[_0x2880('0x1c')][_0x2880('0x25')],_['omit'](_0x12f2dc[_0x2880('0x1c')],[_0x2880('0x25'),'id'])||{});}})[_0x2880('0x26')](function(_0x27a2bd){logger['info'](_0x2880('0x27'),_0x12f2dc);logger['debug'](_0x2880('0x27'),_0x12f2dc,JSON[_0x2880('0x28')](_0x27a2bd));_0x1d4b7c(_0x27a2bd);})['catch'](function(_0x3c97f2){logger[_0x2880('0x15')](_0x2880('0x27'),_0x3c97f2['message'],_0x12f2dc);_0x1e2b10(_this[_0x2880('0x15')](0x1f4,_0x3c97f2[_0x2880('0x17')]));});});};
\ No newline at end of file
index 5a9076f..4d6a351 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69ba=['./smsInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x145d5d,_0x5aa973){var _0x15562d=function(_0x2c617e){while(--_0x2c617e){_0x145d5d['push'](_0x145d5d['shift']());}};_0x15562d(++_0x5aa973);}(_0x69ba,0xaf));var _0xa69b=function(_0x145356,_0x5c65e7){_0x145356=_0x145356-0x0;var _0x37fa63=_0x69ba[_0x145356];return _0x37fa63;};'use strict';var SmsInteractionEvents=require(_0xa69b('0x0'));var events=[_0xa69b('0x1'),_0xa69b('0x2'),_0xa69b('0x3')];function createListener(_0x53a5a0,_0x29207f){return function(_0x345d40){_0x29207f[_0xa69b('0x4')](_0x53a5a0,_0x345d40);};}function removeListener(_0x172ebc,_0x467f9c){return function(){SmsInteractionEvents[_0xa69b('0x5')](_0x172ebc,_0x467f9c);};}exports[_0xa69b('0x6')]=function(_0x4c1110){for(var _0x22597a=0x0,_0x98287b=events['length'];_0x22597a<_0x98287b;_0x22597a++){var _0x307571=events[_0x22597a];var _0x5f2363=createListener('smsInteraction:'+_0x307571,_0x4c1110);SmsInteractionEvents['on'](_0x307571,_0x5f2363);}};
\ No newline at end of file
+var _0x9b8d=['update','emit','removeListener','smsInteraction:'];(function(_0x5f5a18,_0x38b923){var _0x1a70c6=function(_0x59ec31){while(--_0x59ec31){_0x5f5a18['push'](_0x5f5a18['shift']());}};_0x1a70c6(++_0x38b923);}(_0x9b8d,0x68));var _0xd9b8=function(_0x315b61,_0x4bb11e){_0x315b61=_0x315b61-0x0;var _0x3521e8=_0x9b8d[_0x315b61];return _0x3521e8;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=['save','remove',_0xd9b8('0x0')];function createListener(_0x414204,_0x4e0222){return function(_0x5a6720){_0x4e0222[_0xd9b8('0x1')](_0x414204,_0x5a6720);};}function removeListener(_0xa5443a,_0x31c448){return function(){SmsInteractionEvents[_0xd9b8('0x2')](_0xa5443a,_0x31c448);};}exports['register']=function(_0x442c22){for(var _0x54f87a=0x0,_0x36873b=events['length'];_0x54f87a<_0x36873b;_0x54f87a++){var _0x29d505=events[_0x54f87a];var _0x266fcb=createListener(_0xd9b8('0x3')+_0x29d505,_0x442c22);SmsInteractionEvents['on'](_0x29d505,_0x266fcb);}};
\ No newline at end of file
index 27ceaa4..de552f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x153c=['post','tracked','sms','/:id/status','put','/:id','/:id/accept','/:id/reject','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','/describe','isAuthenticated','describe','show'];(function(_0x3ce2c4,_0x4544c1){var _0x4047c1=function(_0x3fece6){while(--_0x3fece6){_0x3ce2c4['push'](_0x3ce2c4['shift']());}};_0x4047c1(++_0x4544c1);}(_0x153c,0x8c));var _0xc153=function(_0x4102f7,_0x4b3ec3){_0x4102f7=_0x4102f7-0x0;var _0x3562d6=_0x153c[_0x4102f7];return _0x3562d6;};'use strict';var multer=require(_0xc153('0x0'));var util=require(_0xc153('0x1'));var path=require(_0xc153('0x2'));var timeout=require(_0xc153('0x3'));var express=require('express');var router=express[_0xc153('0x4')]();var fs_extra=require(_0xc153('0x5'));var auth=require(_0xc153('0x6'));var interaction=require(_0xc153('0x7'));var config=require(_0xc153('0x8'));var controller=require(_0xc153('0x9'));router[_0xc153('0xa')]('/',auth['isAuthenticated'](),controller[_0xc153('0xb')]);router[_0xc153('0xa')](_0xc153('0xc'),auth[_0xc153('0xd')](),controller[_0xc153('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc153('0xf')]);router[_0xc153('0x10')]('/',auth[_0xc153('0xd')](),interaction[_0xc153('0x11')](_0xc153('0x12'),'smsmessage:create'),controller['create']);router[_0xc153('0x10')](_0xc153('0x13'),controller['status']);router[_0xc153('0x14')](_0xc153('0x15'),auth['isAuthenticated'](),controller['update']);router[_0xc153('0x14')](_0xc153('0x16'),auth[_0xc153('0xd')](),controller['accept']);router[_0xc153('0x14')](_0xc153('0x17'),auth[_0xc153('0xd')](),controller['reject']);router[_0xc153('0x18')](_0xc153('0x15'),auth['isAuthenticated'](),controller['destroy']);module[_0xc153('0x19')]=router;
\ No newline at end of file
+var _0x26e4=['/:id/accept','accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','post','sms','smsmessage:create','create','put','update'];(function(_0x9df618,_0x2c252a){var _0x5c77c5=function(_0x13a8d1){while(--_0x13a8d1){_0x9df618['push'](_0x9df618['shift']());}};_0x5c77c5(++_0x2c252a);}(_0x26e4,0xec));var _0x426e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x26e4[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x426e('0x0'));var path=require(_0x426e('0x1'));var timeout=require(_0x426e('0x2'));var express=require(_0x426e('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x426e('0x4'));var interaction=require(_0x426e('0x5'));var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0x426e('0x6')]('/',auth[_0x426e('0x7')](),controller[_0x426e('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x426e('0x9')]);router[_0x426e('0x6')](_0x426e('0xa'),auth[_0x426e('0x7')](),controller['show']);router[_0x426e('0xb')]('/',auth[_0x426e('0x7')](),interaction['tracked'](_0x426e('0xc'),_0x426e('0xd')),controller[_0x426e('0xe')]);router['post']('/:id/status',controller['status']);router[_0x426e('0xf')](_0x426e('0xa'),auth[_0x426e('0x7')](),controller[_0x426e('0x10')]);router[_0x426e('0xf')](_0x426e('0x11'),auth[_0x426e('0x7')](),controller[_0x426e('0x12')]);router[_0x426e('0xf')](_0x426e('0x13'),auth['isAuthenticated'](),controller[_0x426e('0x14')]);router[_0x426e('0x15')](_0x426e('0xa'),auth['isAuthenticated'](),controller[_0x426e('0x16')]);module['exports']=router;
\ No newline at end of file
index f2a5852..a983223 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9cc=['ENUM','out','STRING','DATE','exports','TEXT','medium','BOOLEAN'];(function(_0x761f08,_0x3079f8){var _0x583806=function(_0x2ff6fb){while(--_0x2ff6fb){_0x761f08['push'](_0x761f08['shift']());}};_0x583806(++_0x3079f8);}(_0xd9cc,0xb4));var _0xcd9c=function(_0xe6c6aa,_0x3e132b){_0xe6c6aa=_0xe6c6aa-0x0;var _0x231687=_0xd9cc[_0xe6c6aa];return _0x231687;};'use strict';var Sequelize=require('sequelize');module[_0xcd9c('0x0')]={'body':{'type':Sequelize[_0xcd9c('0x1')](_0xcd9c('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xcd9c('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcd9c('0x4')]('in',_0xcd9c('0x5')),'defaultValue':_0xcd9c('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xcd9c('0x6')](0xbe)},'phone':{'type':Sequelize[_0xcd9c('0x6')]},'readAt':{'type':Sequelize[_0xcd9c('0x7')]},'secret':{'type':Sequelize[_0xcd9c('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xcd9c('0x6')]},'providerResponse':{'type':Sequelize[_0xcd9c('0x1')]}};
\ No newline at end of file
+var _0xafca=['out','STRING','DATE','sequelize','TEXT','medium'];(function(_0x3f92ec,_0x2075e9){var _0x592026=function(_0x40a6c6){while(--_0x40a6c6){_0x3f92ec['push'](_0x3f92ec['shift']());}};_0x592026(++_0x2075e9);}(_0xafca,0x1ef));var _0xaafc=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xafca[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xaafc('0x0'));module['exports']={'body':{'type':Sequelize[_0xaafc('0x1')](_0xaafc('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xaafc('0x3')),'defaultValue':_0xaafc('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xaafc('0x4')](0xbe)},'phone':{'type':Sequelize[_0xaafc('0x4')]},'readAt':{'type':Sequelize[_0xaafc('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xaafc('0x4')]},'providerResponse':{'type':Sequelize[_0xaafc('0x1')]}};
\ No newline at end of file
index 09dbd3c..3707cfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x015e=['Status','plivio','results','groupName','DELIVERED','infobip','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','agent','get','SmsInteractionId','UserId','isNil','read1stAt','user','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','channel','motionChannel','EventManager','acceptmessage','reject','SmsInteraction','RejectMessage','rejectMessage','sequelize','SIP/%s','event','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','inspect','twilio','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','sent'];(function(_0x3932e5,_0x43d0f3){var _0x5784e1=function(_0x3e0fae){while(--_0x3e0fae){_0x3932e5['push'](_0x3932e5['shift']());}};_0x5784e1(++_0x43d0f3);}(_0x015e,0x138));var _0xe015=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0x015e[_0x5a79e2];return _0x266c45;};'use strict';var emlformat=require(_0xe015('0x0'));var rimraf=require(_0xe015('0x1'));var zipdir=require(_0xe015('0x2'));var jsonpatch=require(_0xe015('0x3'));var rp=require('request-promise');var moment=require(_0xe015('0x4'));var BPromise=require(_0xe015('0x5'));var Mustache=require(_0xe015('0x6'));var util=require(_0xe015('0x7'));var path=require(_0xe015('0x8'));var sox=require(_0xe015('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe015('0xa'));var _=require(_0xe015('0xb'));var squel=require(_0xe015('0xc'));var crypto=require(_0xe015('0xd'));var jsforce=require(_0xe015('0xe'));var deskjs=require(_0xe015('0xf'));var toCsv=require(_0xe015('0x10'));var querystring=require(_0xe015('0x11'));var Papa=require(_0xe015('0x12'));var Redis=require(_0xe015('0x13'));var authService=require(_0xe015('0x14'));var qs=require(_0xe015('0x15'));var as=require(_0xe015('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe015('0x17'))(_0xe015('0x18'));var utils=require(_0xe015('0x19'));var config=require(_0xe015('0x1a'));var licenseUtil=require(_0xe015('0x1b'));var db=require(_0xe015('0x1c'))['db'];config[_0xe015('0x1d')]=_[_0xe015('0x1e')](config[_0xe015('0x1d')],{'host':_0xe015('0x1f'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe015('0x1d')]));require('./smsMessage.socket')[_0xe015('0x20')](socket);var jayson=require(_0xe015('0x21'));var client=jayson[_0xe015('0x22')][_0xe015('0x23')]({'port':0x232c});var client9002=jayson['client'][_0xe015('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x372337,_0xdbcfe,_0xe5cedc,_0x191682){return new BPromise(function(_0x38b0a7,_0x42a92a){var _0x123271=_0x191682||client;return _0x123271[_0xe015('0x24')](_0x372337,_0xe5cedc)[_0xe015('0x25')](function(_0x2ad4b8){logger[_0xe015('0x26')](_0xe015('0x27'),_0xdbcfe,_0xe015('0x28'));logger[_0xe015('0x29')](_0xe015('0x2a'),_0xdbcfe,_0xe015('0x28'),JSON[_0xe015('0x2b')](_0x2ad4b8));if(_0x2ad4b8['error']){if(_0x2ad4b8['error']['code']===0x1f4){logger[_0xe015('0x2c')](_0xe015('0x27'),_0xdbcfe,_0x2ad4b8['error'][_0xe015('0x2d')]);return _0x42a92a(_0x2ad4b8[_0xe015('0x2c')]['message']);}logger[_0xe015('0x2c')](_0xe015('0x27'),_0xdbcfe,_0x2ad4b8['error']['message']);return _0x38b0a7(_0x2ad4b8[_0xe015('0x2c')][_0xe015('0x2d')]);}else{logger[_0xe015('0x26')]('SmsMessage,\x20%s,\x20%s',_0xdbcfe,_0xe015('0x28'));_0x38b0a7(_0x2ad4b8[_0xe015('0x2e')][_0xe015('0x2d')]);}})[_0xe015('0x2f')](function(_0x3344ba){logger[_0xe015('0x2c')](_0xe015('0x27'),_0xdbcfe,_0x3344ba);_0x42a92a(_0x3344ba);});});}function respondWithStatusCode(_0x1ef4d2,_0x290e10){_0x290e10=_0x290e10||0xcc;return function(_0x3cdf97){if(_0x3cdf97){return _0x1ef4d2[_0xe015('0x30')](_0x290e10);}return _0x1ef4d2[_0xe015('0x31')](_0x290e10)[_0xe015('0x32')]();};}function respondWithResult(_0x36178d,_0x18cf9e){_0x18cf9e=_0x18cf9e||0xc8;return function(_0x54e0df){if(_0x54e0df){return _0x36178d['status'](_0x18cf9e)[_0xe015('0x33')](_0x54e0df);}};}function respondWithFilteredResult(_0x5d10df,_0x739050){return function(_0x2446d9){if(_0x2446d9){var _0x1e90b5=typeof _0x739050[_0xe015('0x34')]===_0xe015('0x35')&&typeof _0x739050[_0xe015('0x36')]==='undefined';var _0x245ca0=_0x2446d9[_0xe015('0x37')];var _0x452926=_0x1e90b5?0x0:_0x739050[_0xe015('0x34')];var _0x247b86=_0x1e90b5?_0x2446d9[_0xe015('0x37')]:_0x739050[_0xe015('0x34')]+_0x739050[_0xe015('0x36')];var _0xc15a9c;if(_0x247b86>=_0x245ca0){_0x247b86=_0x245ca0;_0xc15a9c=0xc8;}else{_0xc15a9c=0xce;}_0x5d10df[_0xe015('0x31')](_0xc15a9c);return _0x5d10df[_0xe015('0x38')](_0xe015('0x39'),_0x452926+'-'+_0x247b86+'/'+_0x245ca0)[_0xe015('0x33')](_0x2446d9);}return null;};}function patchUpdates(_0x3a8dc7){return function(_0x4cf903){try{jsonpatch[_0xe015('0x3a')](_0x4cf903,_0x3a8dc7,!![]);}catch(_0x5aded5){return BPromise['reject'](_0x5aded5);}return _0x4cf903[_0xe015('0x3b')]();};}function saveUpdates(_0x54e424,_0x3cffd8){return function(_0x2b9af2){if(_0x2b9af2){return _0x2b9af2[_0xe015('0x3c')](_0x54e424)[_0xe015('0x25')](function(_0x4651f8){return _0x4651f8;});}return null;};}function removeEntity(_0x3f3989,_0xc304db){return function(_0x15f433){if(_0x15f433){return _0x15f433[_0xe015('0x3d')]()['then'](function(){_0x3f3989[_0xe015('0x31')](0xcc)[_0xe015('0x32')]();});}};}function handleEntityNotFound(_0x51ba8b,_0x1c25ba){return function(_0x33f38f){if(!_0x33f38f){_0x51ba8b[_0xe015('0x30')](0x194);}return _0x33f38f;};}function handleError(_0x4d42d0,_0x5d1f66){_0x5d1f66=_0x5d1f66||0x1f4;return function(_0x4a4166){logger[_0xe015('0x2c')](_0x4a4166['stack']);if(_0x4a4166['name']){delete _0x4a4166[_0xe015('0x3e')];}_0x4d42d0[_0xe015('0x31')](_0x5d1f66)[_0xe015('0x3f')](_0x4a4166);};}exports[_0xe015('0x40')]=function(_0x4f4f5c,_0x20ad2a){var _0x4380d5={},_0x505931={},_0x228c83={'count':0x0,'rows':[]};var _0x164fc8=_[_0xe015('0x41')](db[_0xe015('0x42')][_0xe015('0x43')],function(_0x424582){return{'name':_0x424582[_0xe015('0x44')],'type':_0x424582[_0xe015('0x45')][_0xe015('0x46')]};});_0x505931[_0xe015('0x47')]=_[_0xe015('0x41')](_0x164fc8,'name');_0x505931[_0xe015('0x48')]=_['keys'](_0x4f4f5c['query']);_0x505931['filters']=_[_0xe015('0x49')](_0x505931['model'],_0x505931[_0xe015('0x48')]);_0x4380d5[_0xe015('0x4a')]=_[_0xe015('0x49')](_0x505931[_0xe015('0x47')],qs[_0xe015('0x4b')](_0x4f4f5c[_0xe015('0x48')][_0xe015('0x4b')]));_0x4380d5['attributes']=_0x4380d5[_0xe015('0x4a')][_0xe015('0x4c')]?_0x4380d5[_0xe015('0x4a')]:_0x505931['model'];if(!_0x4f4f5c[_0xe015('0x48')][_0xe015('0x4d')](_0xe015('0x4e'))){_0x4380d5[_0xe015('0x36')]=qs['limit'](_0x4f4f5c[_0xe015('0x48')][_0xe015('0x36')]);_0x4380d5[_0xe015('0x34')]=qs[_0xe015('0x34')](_0x4f4f5c[_0xe015('0x48')][_0xe015('0x34')]);}_0x4380d5[_0xe015('0x4f')]=qs[_0xe015('0x50')](_0x4f4f5c['query'][_0xe015('0x50')]);_0x4380d5[_0xe015('0x51')]=qs[_0xe015('0x52')](_[_0xe015('0x53')](_0x4f4f5c[_0xe015('0x48')],_0x505931[_0xe015('0x52')]),_0x164fc8);if(_0x4f4f5c[_0xe015('0x48')]['filter']){_0x4380d5[_0xe015('0x51')]=_[_0xe015('0x54')](_0x4380d5[_0xe015('0x51')],{'$or':_[_0xe015('0x41')](_0x164fc8,function(_0x566859){if(_0x566859['type']!==_0xe015('0x55')){var _0x435d73={};_0x435d73[_0x566859['name']]={'$like':'%'+_0x4f4f5c[_0xe015('0x48')][_0xe015('0x56')]+'%'};return _0x435d73;}})});}_0x4380d5=_['merge']({},_0x4380d5,_0x4f4f5c['options']);var _0xb608e5={'where':_0x4380d5['where']};return db['SmsMessage'][_0xe015('0x37')](_0xb608e5)['then'](function(_0x319e20){_0x228c83[_0xe015('0x37')]=_0x319e20;if(_0x4f4f5c['query'][_0xe015('0x57')]){_0x4380d5[_0xe015('0x58')]=[{'all':!![]}];}return db[_0xe015('0x42')][_0xe015('0x59')](_0x4380d5);})[_0xe015('0x25')](function(_0x106ade){_0x228c83[_0xe015('0x5a')]=_0x106ade;return _0x228c83;})['then'](respondWithFilteredResult(_0x20ad2a,_0x4380d5))[_0xe015('0x2f')](handleError(_0x20ad2a,null));};exports[_0xe015('0x5b')]=function(_0x4034ff,_0x51ddb7){var _0xb3574d={'raw':!![],'where':{'id':_0x4034ff[_0xe015('0x5c')]['id']}},_0x1f072a={};_0x1f072a[_0xe015('0x47')]=_['keys'](db['SmsMessage'][_0xe015('0x43')]);_0x1f072a[_0xe015('0x48')]=_['keys'](_0x4034ff[_0xe015('0x48')]);_0x1f072a[_0xe015('0x52')]=_[_0xe015('0x49')](_0x1f072a[_0xe015('0x47')],_0x1f072a[_0xe015('0x48')]);_0xb3574d[_0xe015('0x4a')]=_[_0xe015('0x49')](_0x1f072a['model'],qs[_0xe015('0x4b')](_0x4034ff['query'][_0xe015('0x4b')]));_0xb3574d[_0xe015('0x4a')]=_0xb3574d[_0xe015('0x4a')][_0xe015('0x4c')]?_0xb3574d['attributes']:_0x1f072a[_0xe015('0x47')];if(_0x4034ff[_0xe015('0x48')][_0xe015('0x57')]){_0xb3574d[_0xe015('0x58')]=[{'all':!![]}];}_0xb3574d=_['merge']({},_0xb3574d,_0x4034ff['options']);return db[_0xe015('0x42')][_0xe015('0x5d')](_0xb3574d)[_0xe015('0x25')](handleEntityNotFound(_0x51ddb7,null))['then'](respondWithResult(_0x51ddb7,null))[_0xe015('0x2f')](handleError(_0x51ddb7,null));};exports[_0xe015('0x5e')]=function(_0x324a97,_0x1414ce){return db[_0xe015('0x42')][_0xe015('0x5e')](_0x324a97[_0xe015('0x5f')],{})[_0xe015('0x25')](respondWithResult(_0x1414ce,0xc9))[_0xe015('0x2f')](handleError(_0x1414ce,null));};exports['update']=function(_0xf4ba70,_0x2c7eab){if(_0xf4ba70['body']['id']){delete _0xf4ba70[_0xe015('0x5f')]['id'];}return db['SmsMessage'][_0xe015('0x5d')]({'where':{'id':_0xf4ba70[_0xe015('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2c7eab,null))[_0xe015('0x25')](saveUpdates(_0xf4ba70[_0xe015('0x5f')],null))[_0xe015('0x25')](respondWithResult(_0x2c7eab,null))[_0xe015('0x2f')](handleError(_0x2c7eab,null));};exports['destroy']=function(_0xec0ed8,_0x54acbb){return db[_0xe015('0x42')][_0xe015('0x5d')]({'where':{'id':_0xec0ed8[_0xe015('0x5c')]['id']}})[_0xe015('0x25')](handleEntityNotFound(_0x54acbb,null))['then'](removeEntity(_0x54acbb,null))['catch'](handleError(_0x54acbb,null));};exports[_0xe015('0x60')]=function(_0x172848,_0x39b7b1){return db[_0xe015('0x42')]['describe']()[_0xe015('0x25')](respondWithResult(_0x39b7b1,null))[_0xe015('0x2f')](handleError(_0x39b7b1,null));};var interaction_log=require('../../config/logger')(_0xe015('0x61'));exports[_0xe015('0x62')]=function(_0x129d00,_0x541e77,_0x8e668){var _0x3069a5={'agent':{},'channel':_0xe015('0x63')};if(_0x129d00[_0xe015('0x5f')]['id']){delete _0x129d00[_0xe015('0x5f')]['id'];}_0x129d00['body'][_0xe015('0x64')]=!![];_0x129d00['body'][_0xe015('0x65')]=moment()[_0xe015('0x66')](_0xe015('0x67'));_0x129d00[_0xe015('0x5f')]['UserId']=_0x129d00[_0xe015('0x5f')]['UserId']||_0x129d00['user']['id'];_0x3069a5[_0xe015('0x68')]['id']=_0x129d00[_0xe015('0x5f')]['UserId'];return db[_0xe015('0x42')]['find']({'where':{'id':_0x129d00[_0xe015('0x5c')]['id'],'UserId':null}})[_0xe015('0x25')](handleEntityNotFound(_0x541e77,null))[_0xe015('0x25')](saveUpdates(_0x129d00['body'],null))[_0xe015('0x25')](function(_0x5ae31e){if(_0x5ae31e){_0x3069a5['message']=_0x5ae31e[_0xe015('0x69')]({'plain':!![]});return db['SmsInteraction'][_0xe015('0x5d')]({'where':{'id':_0x5ae31e[_0xe015('0x6a')]}});}return null;})[_0xe015('0x25')](handleEntityNotFound(_0x541e77,null))['then'](function(_0x275159){if(_0x275159){return _0x275159[_0xe015('0x3c')]({'UserId':_0x129d00['body'][_0xe015('0x6b')],'read1stAt':_[_0xe015('0x6c')](_0x275159[_0xe015('0x6d')])?moment()[_0xe015('0x66')](_0xe015('0x67')):undefined});}return null;})[_0xe015('0x25')](function(_0x591513){if(_0x591513){_0x3069a5['interaction']=_0x591513[_0xe015('0x69')]({'plain':!![]});interaction_log[_0xe015('0x26')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x129d00[_0xe015('0x6e')]['id'],_0x129d00[_0xe015('0x6e')][_0xe015('0x3e')],_0x129d00[_0xe015('0x6e')][_0xe015('0x6f')],_0x3069a5[_0xe015('0x70')]['id'],_0x129d00['body']?JSON[_0xe015('0x2b')](_0x129d00[_0xe015('0x5f')]):_0xe015('0x71'));return respondWithRpcPromise(_0xe015('0x72'),_0xe015('0x73'),_0x3069a5);}return null;})['then'](function(_0x1457c9){var _0x510af1=_0xe015('0x74')+_0x1457c9['message']['ContactId'];return db['sequelize'][_0xe015('0x48')](_0x510af1,{'type':db[_0xe015('0x75')][_0xe015('0x76')][_0xe015('0x77')],'raw':!![]})[_0xe015('0x25')](function(_0x39632a){return _0x39632a;});})['then'](function(_0x4f9123){if(_0x4f9123){_0x3069a5['message'][_0xe015('0x78')]=_0x4f9123[0x0];if(!_0x129d00['body'][_0xe015('0x6b')])return;return db[_0xe015('0x79')][_0xe015('0x5d')]({'where':{'id':_0x129d00['body'][_0xe015('0x6b')],'role':'agent'},'attributes':['id',_0xe015('0x3e'),_0xe015('0x7a'),_0xe015('0x7b'),_0xe015('0x7c')],'raw':!![]});}return null;})[_0xe015('0x25')](function(_0x4ffe23){if(!_0x4ffe23)return null;_0x3069a5[_0xe015('0x2d')][_0xe015('0x68')]=_0x4ffe23;return _0x3069a5;})[_0xe015('0x25')](function(_0x206c84){if(_0x206c84){if(_0x129d00[_0xe015('0x5f')][_0xe015('0x7d')]){_0x3069a5['message']['interface']=util[_0xe015('0x66')]('SIP/%s',_0x129d00['user'][_0xe015('0x3e')]);_0x3069a5[_0xe015('0x2d')][_0xe015('0x7e')]=_0x3069a5['channel'];_0x3069a5['message'][_0xe015('0x7f')]=_0x3069a5[_0xe015('0x7e')];_0x3069a5[_0xe015('0x2d')]['event']=_0xe015('0x62');return respondWithRpcPromise(_0xe015('0x80'),'EventManager',{'event':_0xe015('0x81'),'message':_0x3069a5[_0xe015('0x2d')]},client9002)[_0xe015('0x25')](function(){return _0x3069a5;});}return _0x3069a5;}return null;})['then'](respondWithResult(_0x541e77,null))[_0xe015('0x2f')](handleError(_0x541e77,null));};var interaction_log=require(_0xe015('0x17'))(_0xe015('0x61'));exports[_0xe015('0x82')]=function(_0x2bb9ec,_0x39394f,_0x4e52c9){var _0xd4ea55={'agent':{},'channel':_0xe015('0x63')};if(_0x2bb9ec['body']['id']){delete _0x2bb9ec['body']['id'];}_0x2bb9ec[_0xe015('0x5f')]['UserId']=_0x2bb9ec['body']['UserId']||_0x2bb9ec[_0xe015('0x6e')]['id'];_0xd4ea55[_0xe015('0x68')]['id']=_0x2bb9ec['body'][_0xe015('0x6b')];return db[_0xe015('0x42')][_0xe015('0x5d')]({'where':{'id':_0x2bb9ec['params']['id'],'UserId':null}})[_0xe015('0x25')](handleEntityNotFound(_0x39394f,null))[_0xe015('0x25')](function(_0x2341c9){if(_0x2341c9){_0xd4ea55[_0xe015('0x2d')]=_0x2341c9[_0xe015('0x69')]({'plain':!![]});return db[_0xe015('0x83')][_0xe015('0x5d')]({'where':{'id':_0x2341c9[_0xe015('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x39394f,null))['then'](function(_0x337a58){if(_0x337a58){_0xd4ea55[_0xe015('0x70')]=_0x337a58['get']({'plain':!![]});interaction_log[_0xe015('0x26')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2bb9ec['user']['id'],_0x2bb9ec[_0xe015('0x6e')]['name'],_0x2bb9ec[_0xe015('0x6e')][_0xe015('0x6f')],_0xd4ea55[_0xe015('0x70')]['id'],_0x2bb9ec[_0xe015('0x5f')]?JSON[_0xe015('0x2b')](_0x2bb9ec[_0xe015('0x5f')]):_0xe015('0x71'));return respondWithRpcPromise(_0xe015('0x84'),_0xe015('0x85'),_0xd4ea55);}return null;})[_0xe015('0x25')](function(_0x1084e8){var _0x8aa536=_0xe015('0x74')+_0x1084e8['message']['ContactId'];return db[_0xe015('0x86')][_0xe015('0x48')](_0x8aa536,{'type':db[_0xe015('0x75')][_0xe015('0x76')][_0xe015('0x77')],'raw':!![]})[_0xe015('0x25')](function(_0x314dbf){return _0x314dbf;});})[_0xe015('0x25')](function(_0x328186){if(_0x328186){_0xd4ea55[_0xe015('0x2d')][_0xe015('0x78')]=_0x328186[0x0];if(!_0x2bb9ec['body'][_0xe015('0x6b')])return;return db[_0xe015('0x79')][_0xe015('0x5d')]({'where':{'id':_0x2bb9ec['body'][_0xe015('0x6b')],'role':_0xe015('0x68')},'attributes':['id',_0xe015('0x3e'),_0xe015('0x7a'),_0xe015('0x7b'),'internal'],'raw':!![]});}return null;})[_0xe015('0x25')](function(_0x549e13){if(!_0x549e13)return null;_0xd4ea55['message'][_0xe015('0x68')]=_0x549e13;return _0xd4ea55;})['then'](function(_0x2ec19f){if(_0x2ec19f){_0x2ec19f[_0xe015('0x2d')]['interface']=util[_0xe015('0x66')](_0xe015('0x87'),_0x2bb9ec[_0xe015('0x6e')]['name']);_0x2ec19f[_0xe015('0x2d')][_0xe015('0x7e')]=_0xd4ea55[_0xe015('0x7e')];_0x2ec19f[_0xe015('0x2d')]['motionChannel']=_0xd4ea55[_0xe015('0x7e')];_0x2ec19f[_0xe015('0x2d')][_0xe015('0x88')]='reject';respondWithRpcPromise(_0xe015('0x80'),'EventManager',{'event':_0xe015('0x89'),'message':_0x2ec19f[_0xe015('0x2d')]},client9002);return _0xd4ea55;}return null;})[_0xe015('0x25')](respondWithResult(_0x39394f,null))[_0xe015('0x2f')](handleError(_0x39394f,null));};exports[_0xe015('0x31')]=function(_0x569224,_0x3ef2f3,_0x595e78){if(_0x569224[_0xe015('0x5f')]['id']){delete _0x569224['body']['id'];}var _0x555bf5;return db[_0xe015('0x42')]['find']({'where':{'id':_0x569224[_0xe015('0x5c')]['id']}})[_0xe015('0x25')](handleEntityNotFound(_0x3ef2f3,null))[_0xe015('0x25')](function(_0x1395e2){if(_0x1395e2){_0x555bf5=_0x1395e2;return db[_0xe015('0x8a')]['find']({'where':{'id':_0x1395e2['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x3ef2f3,null))['then'](function(_0x329434){if(_0x329434){logger[_0xe015('0x29')](_0xe015('0x2a'),_0xe015('0x31'),_0xe015('0x8b'),_0x329434[_0xe015('0x45')],util[_0xe015('0x8c')](_0x569224[_0xe015('0x5f')],{'showHidden':![],'depth':null}));switch(_0x329434[_0xe015('0x45')]){case _0xe015('0x8d'):if(_0x569224['body']['MessageSid']&&_0x569224[_0xe015('0x5f')]['MessageSid']===_0x555bf5[_0xe015('0x8e')]){return _0x555bf5[_0xe015('0x3c')]({'read':!![]});}else{logger['error'](_0xe015('0x8f'),'status','twilio',util[_0xe015('0x8c')](_0x569224[_0xe015('0x5f')],{'showHidden':![],'depth':null}));}break;case _0xe015('0x90'):if(_0x569224['body'][_0xe015('0x91')]&&_0x569224['body'][_0xe015('0x91')]===_0x555bf5[_0xe015('0x8e')]&&_['indexOf']([_0xe015('0x92'),'delivered'],_0x569224[_0xe015('0x5f')][_0xe015('0x93')])>=0x0){return _0x555bf5[_0xe015('0x3c')]({'read':!![]});}else{logger[_0xe015('0x2c')](_0xe015('0x8f'),_0xe015('0x31'),_0xe015('0x94'),util['inspect'](_0x569224[_0xe015('0x5f')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x1d9984=_0x569224[_0xe015('0x5f')][_0xe015('0x95')][0x0];if(_0x1d9984[_0xe015('0x31')][_0xe015('0x96')]===_0xe015('0x97')){return _0x555bf5[_0xe015('0x3c')]({'read':!![]});}else{logger[_0xe015('0x2c')](_0xe015('0x8f'),_0xe015('0x31'),_0xe015('0x98'),util[_0xe015('0x8c')](_0x569224[_0xe015('0x5f')],{'showHidden':![],'depth':null}));}break;}return _0x555bf5;}})[_0xe015('0x25')](respondWithResult(_0x3ef2f3,null))[_0xe015('0x2f')](handleError(_0x3ef2f3,null));};
\ No newline at end of file
+var _0x689f=['crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','then','destroy','stack','name','send','type','key','map','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','where','pick','filter','merge','options','SmsMessage','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','body','describe','accept','sms','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteractionId','update','isNil','interaction','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','sms-interactions','reject','SmsInteraction','RejectMessage','rejectMessage','sequelize','Sequelize','User','motionChannel','rejectmessage','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','delivered','Status','plivio','groupName','infobip','fast-json-patch','request-promise','mustache','path','to-csv','ejs','fs-extra','squel'];(function(_0x3619b1,_0x1a0e94){var _0xe3583c=function(_0x4b7f56){while(--_0x4b7f56){_0x3619b1['push'](_0x3619b1['shift']());}};_0xe3583c(++_0x1a0e94);}(_0x689f,0x81));var _0xf689=function(_0x46df85,_0x52f339){_0x46df85=_0x46df85-0x0;var _0x1411b8=_0x689f[_0x46df85];return _0x1411b8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf689('0x0'));var rp=require(_0xf689('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf689('0x2'));var util=require('util');var path=require(_0xf689('0x3'));var sox=require('sox');var csv=require(_0xf689('0x4'));var ejs=require(_0xf689('0x5'));var fs=require('fs');var fs_extra=require(_0xf689('0x6'));var _=require('lodash');var squel=require(_0xf689('0x7'));var crypto=require(_0xf689('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xf689('0x9'));var toCsv=require(_0xf689('0x4'));var querystring=require('querystring');var Papa=require(_0xf689('0xa'));var Redis=require(_0xf689('0xb'));var authService=require(_0xf689('0xc'));var qs=require(_0xf689('0xd'));var as=require(_0xf689('0xe'));var hardwareService=require(_0xf689('0xf'));var logger=require(_0xf689('0x10'))('api');var utils=require(_0xf689('0x11'));var config=require(_0xf689('0x12'));var licenseUtil=require(_0xf689('0x13'));var db=require(_0xf689('0x14'))['db'];config[_0xf689('0x15')]=_[_0xf689('0x16')](config[_0xf689('0x15')],{'host':_0xf689('0x17'),'port':0x18eb});var socket=require(_0xf689('0x18'))(new Redis(config['redis']));require(_0xf689('0x19'))[_0xf689('0x1a')](socket);var jayson=require(_0xf689('0x1b'));var client=jayson[_0xf689('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xf689('0x1c')][_0xf689('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xd01a52,_0x2f0c9f,_0x4ac760,_0xc59d61){return new BPromise(function(_0x56327e,_0x331bca){var _0x2960c7=_0xc59d61||client;return _0x2960c7['request'](_0xd01a52,_0x4ac760)['then'](function(_0x327a10){logger[_0xf689('0x1e')](_0xf689('0x1f'),_0x2f0c9f,_0xf689('0x20'));logger['debug'](_0xf689('0x21'),_0x2f0c9f,_0xf689('0x20'),JSON[_0xf689('0x22')](_0x327a10));if(_0x327a10[_0xf689('0x23')]){if(_0x327a10[_0xf689('0x23')][_0xf689('0x24')]===0x1f4){logger['error'](_0xf689('0x1f'),_0x2f0c9f,_0x327a10[_0xf689('0x23')][_0xf689('0x25')]);return _0x331bca(_0x327a10[_0xf689('0x23')][_0xf689('0x25')]);}logger[_0xf689('0x23')](_0xf689('0x1f'),_0x2f0c9f,_0x327a10['error'][_0xf689('0x25')]);return _0x56327e(_0x327a10['error']['message']);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x2f0c9f,_0xf689('0x20'));_0x56327e(_0x327a10[_0xf689('0x26')]['message']);}})[_0xf689('0x27')](function(_0xdf14ca){logger[_0xf689('0x23')]('SmsMessage,\x20%s,\x20%s',_0x2f0c9f,_0xdf14ca);_0x331bca(_0xdf14ca);});});}function respondWithStatusCode(_0xd9490a,_0x399fd6){_0x399fd6=_0x399fd6||0xcc;return function(_0x604c8e){if(_0x604c8e){return _0xd9490a[_0xf689('0x28')](_0x399fd6);}return _0xd9490a[_0xf689('0x29')](_0x399fd6)[_0xf689('0x2a')]();};}function respondWithResult(_0x51ea64,_0x36e645){_0x36e645=_0x36e645||0xc8;return function(_0x22a069){if(_0x22a069){return _0x51ea64[_0xf689('0x29')](_0x36e645)['json'](_0x22a069);}};}function respondWithFilteredResult(_0x43a1f4,_0x4d68d8){return function(_0x4e60ed){if(_0x4e60ed){var _0x5a3e8f=typeof _0x4d68d8[_0xf689('0x2b')]===_0xf689('0x2c')&&typeof _0x4d68d8[_0xf689('0x2d')]==='undefined';var _0x3971ce=_0x4e60ed['count'];var _0x5545d6=_0x5a3e8f?0x0:_0x4d68d8['offset'];var _0x1ad556=_0x5a3e8f?_0x4e60ed['count']:_0x4d68d8[_0xf689('0x2b')]+_0x4d68d8[_0xf689('0x2d')];var _0xbdbb96;if(_0x1ad556>=_0x3971ce){_0x1ad556=_0x3971ce;_0xbdbb96=0xc8;}else{_0xbdbb96=0xce;}_0x43a1f4[_0xf689('0x29')](_0xbdbb96);return _0x43a1f4[_0xf689('0x2e')](_0xf689('0x2f'),_0x5545d6+'-'+_0x1ad556+'/'+_0x3971ce)[_0xf689('0x30')](_0x4e60ed);}return null;};}function patchUpdates(_0x19db4c){return function(_0x4ac483){try{jsonpatch['apply'](_0x4ac483,_0x19db4c,!![]);}catch(_0xc3e1f3){return BPromise['reject'](_0xc3e1f3);}return _0x4ac483['save']();};}function saveUpdates(_0x340ad3,_0x4d5fe1){return function(_0x32b7a6){if(_0x32b7a6){return _0x32b7a6['update'](_0x340ad3)[_0xf689('0x31')](function(_0x5a1889){return _0x5a1889;});}return null;};}function removeEntity(_0x53d6e8,_0xd2e041){return function(_0x29ba57){if(_0x29ba57){return _0x29ba57[_0xf689('0x32')]()[_0xf689('0x31')](function(){_0x53d6e8['status'](0xcc)[_0xf689('0x2a')]();});}};}function handleEntityNotFound(_0x2a69a6,_0x4aeaac){return function(_0x35cec0){if(!_0x35cec0){_0x2a69a6[_0xf689('0x28')](0x194);}return _0x35cec0;};}function handleError(_0x150763,_0x4d05bd){_0x4d05bd=_0x4d05bd||0x1f4;return function(_0x192b72){logger[_0xf689('0x23')](_0x192b72[_0xf689('0x33')]);if(_0x192b72[_0xf689('0x34')]){delete _0x192b72['name'];}_0x150763['status'](_0x4d05bd)[_0xf689('0x35')](_0x192b72);};}exports['index']=function(_0x491f8a,_0x2182d1){var _0x12eb64={},_0x2ed430={},_0x1e84d5={'count':0x0,'rows':[]};var _0x402cfe=_['map'](db['SmsMessage']['rawAttributes'],function(_0x50014f){return{'name':_0x50014f['fieldName'],'type':_0x50014f[_0xf689('0x36')][_0xf689('0x37')]};});_0x2ed430['model']=_[_0xf689('0x38')](_0x402cfe,_0xf689('0x34'));_0x2ed430[_0xf689('0x39')]=_[_0xf689('0x3a')](_0x491f8a[_0xf689('0x39')]);_0x2ed430[_0xf689('0x3b')]=_[_0xf689('0x3c')](_0x2ed430[_0xf689('0x3d')],_0x2ed430[_0xf689('0x39')]);_0x12eb64['attributes']=_[_0xf689('0x3c')](_0x2ed430[_0xf689('0x3d')],qs[_0xf689('0x3e')](_0x491f8a['query'][_0xf689('0x3e')]));_0x12eb64['attributes']=_0x12eb64['attributes'][_0xf689('0x3f')]?_0x12eb64[_0xf689('0x40')]:_0x2ed430['model'];if(!_0x491f8a[_0xf689('0x39')][_0xf689('0x41')](_0xf689('0x42'))){_0x12eb64['limit']=qs['limit'](_0x491f8a['query'][_0xf689('0x2d')]);_0x12eb64[_0xf689('0x2b')]=qs[_0xf689('0x2b')](_0x491f8a[_0xf689('0x39')]['offset']);}_0x12eb64['order']=qs['sort'](_0x491f8a['query']['sort']);_0x12eb64[_0xf689('0x43')]=qs[_0xf689('0x3b')](_[_0xf689('0x44')](_0x491f8a[_0xf689('0x39')],_0x2ed430['filters']),_0x402cfe);if(_0x491f8a[_0xf689('0x39')][_0xf689('0x45')]){_0x12eb64[_0xf689('0x43')]=_[_0xf689('0x46')](_0x12eb64[_0xf689('0x43')],{'$or':_['map'](_0x402cfe,function(_0x449118){if(_0x449118['type']!=='VIRTUAL'){var _0xd461cf={};_0xd461cf[_0x449118[_0xf689('0x34')]]={'$like':'%'+_0x491f8a[_0xf689('0x39')][_0xf689('0x45')]+'%'};return _0xd461cf;}})});}_0x12eb64=_['merge']({},_0x12eb64,_0x491f8a[_0xf689('0x47')]);var _0x45e2a5={'where':_0x12eb64[_0xf689('0x43')]};return db[_0xf689('0x48')]['count'](_0x45e2a5)[_0xf689('0x31')](function(_0x453767){_0x1e84d5['count']=_0x453767;if(_0x491f8a['query']['includeAll']){_0x12eb64[_0xf689('0x49')]=[{'all':!![]}];}return db['SmsMessage'][_0xf689('0x4a')](_0x12eb64);})['then'](function(_0x415e80){_0x1e84d5[_0xf689('0x4b')]=_0x415e80;return _0x1e84d5;})['then'](respondWithFilteredResult(_0x2182d1,_0x12eb64))[_0xf689('0x27')](handleError(_0x2182d1,null));};exports[_0xf689('0x4c')]=function(_0x38af55,_0x200ce4){var _0x30c8c6={'raw':!![],'where':{'id':_0x38af55[_0xf689('0x4d')]['id']}},_0x841cb5={};_0x841cb5[_0xf689('0x3d')]=_[_0xf689('0x3a')](db['SmsMessage'][_0xf689('0x4e')]);_0x841cb5[_0xf689('0x39')]=_[_0xf689('0x3a')](_0x38af55['query']);_0x841cb5[_0xf689('0x3b')]=_[_0xf689('0x3c')](_0x841cb5[_0xf689('0x3d')],_0x841cb5[_0xf689('0x39')]);_0x30c8c6['attributes']=_[_0xf689('0x3c')](_0x841cb5[_0xf689('0x3d')],qs[_0xf689('0x3e')](_0x38af55[_0xf689('0x39')][_0xf689('0x3e')]));_0x30c8c6[_0xf689('0x40')]=_0x30c8c6['attributes'][_0xf689('0x3f')]?_0x30c8c6[_0xf689('0x40')]:_0x841cb5['model'];if(_0x38af55['query'][_0xf689('0x4f')]){_0x30c8c6[_0xf689('0x49')]=[{'all':!![]}];}_0x30c8c6=_[_0xf689('0x46')]({},_0x30c8c6,_0x38af55['options']);return db[_0xf689('0x48')][_0xf689('0x50')](_0x30c8c6)[_0xf689('0x31')](handleEntityNotFound(_0x200ce4,null))[_0xf689('0x31')](respondWithResult(_0x200ce4,null))['catch'](handleError(_0x200ce4,null));};exports['create']=function(_0x1ea311,_0x3f665e){return db[_0xf689('0x48')][_0xf689('0x51')](_0x1ea311[_0xf689('0x52')],{})[_0xf689('0x31')](respondWithResult(_0x3f665e,0xc9))['catch'](handleError(_0x3f665e,null));};exports['update']=function(_0x3805e4,_0x21b282){if(_0x3805e4[_0xf689('0x52')]['id']){delete _0x3805e4[_0xf689('0x52')]['id'];}return db[_0xf689('0x48')]['find']({'where':{'id':_0x3805e4['params']['id']}})['then'](handleEntityNotFound(_0x21b282,null))[_0xf689('0x31')](saveUpdates(_0x3805e4[_0xf689('0x52')],null))[_0xf689('0x31')](respondWithResult(_0x21b282,null))[_0xf689('0x27')](handleError(_0x21b282,null));};exports[_0xf689('0x32')]=function(_0x1d2266,_0x3cad97){return db[_0xf689('0x48')]['find']({'where':{'id':_0x1d2266[_0xf689('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3cad97,null))[_0xf689('0x31')](removeEntity(_0x3cad97,null))[_0xf689('0x27')](handleError(_0x3cad97,null));};exports[_0xf689('0x53')]=function(_0x1b1ed3,_0x98c293){return db[_0xf689('0x48')][_0xf689('0x53')]()[_0xf689('0x31')](respondWithResult(_0x98c293,null))['catch'](handleError(_0x98c293,null));};var interaction_log=require(_0xf689('0x10'))('sms-interactions');exports[_0xf689('0x54')]=function(_0x4e0a29,_0x286612,_0x23785c){var _0x3289ff={'agent':{},'channel':_0xf689('0x55')};if(_0x4e0a29['body']['id']){delete _0x4e0a29[_0xf689('0x52')]['id'];}_0x4e0a29[_0xf689('0x52')]['read']=!![];_0x4e0a29[_0xf689('0x52')][_0xf689('0x56')]=moment()[_0xf689('0x57')](_0xf689('0x58'));_0x4e0a29[_0xf689('0x52')][_0xf689('0x59')]=_0x4e0a29[_0xf689('0x52')][_0xf689('0x59')]||_0x4e0a29[_0xf689('0x5a')]['id'];_0x3289ff[_0xf689('0x5b')]['id']=_0x4e0a29['body'][_0xf689('0x59')];return db[_0xf689('0x48')][_0xf689('0x50')]({'where':{'id':_0x4e0a29[_0xf689('0x4d')]['id'],'UserId':null}})[_0xf689('0x31')](handleEntityNotFound(_0x286612,null))[_0xf689('0x31')](saveUpdates(_0x4e0a29[_0xf689('0x52')],null))[_0xf689('0x31')](function(_0x8c5b6d){if(_0x8c5b6d){_0x3289ff[_0xf689('0x25')]=_0x8c5b6d[_0xf689('0x5c')]({'plain':!![]});return db['SmsInteraction'][_0xf689('0x50')]({'where':{'id':_0x8c5b6d[_0xf689('0x5d')]}});}return null;})[_0xf689('0x31')](handleEntityNotFound(_0x286612,null))[_0xf689('0x31')](function(_0x16eb37){if(_0x16eb37){return _0x16eb37[_0xf689('0x5e')]({'UserId':_0x4e0a29['body'][_0xf689('0x59')],'read1stAt':_[_0xf689('0x5f')](_0x16eb37['read1stAt'])?moment()[_0xf689('0x57')](_0xf689('0x58')):undefined});}return null;})[_0xf689('0x31')](function(_0x358e72){if(_0x358e72){_0x3289ff[_0xf689('0x60')]=_0x358e72[_0xf689('0x5c')]({'plain':!![]});interaction_log[_0xf689('0x1e')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4e0a29[_0xf689('0x5a')]['id'],_0x4e0a29[_0xf689('0x5a')][_0xf689('0x34')],_0x4e0a29[_0xf689('0x5a')][_0xf689('0x61')],_0x3289ff[_0xf689('0x60')]['id'],_0x4e0a29[_0xf689('0x52')]?JSON[_0xf689('0x22')](_0x4e0a29[_0xf689('0x52')]):_0xf689('0x62'));return respondWithRpcPromise('AcceptMessage',_0xf689('0x63'),_0x3289ff);}return null;})[_0xf689('0x31')](function(_0x5080d5){var _0x2ce189=_0xf689('0x64')+_0x5080d5['message'][_0xf689('0x65')];return db['sequelize'][_0xf689('0x39')](_0x2ce189,{'type':db['Sequelize'][_0xf689('0x66')][_0xf689('0x67')],'raw':!![]})[_0xf689('0x31')](function(_0xad6998){return _0xad6998;});})[_0xf689('0x31')](function(_0x4eb9e0){if(_0x4eb9e0){_0x3289ff[_0xf689('0x25')][_0xf689('0x68')]=_0x4eb9e0[0x0];if(!_0x4e0a29[_0xf689('0x52')][_0xf689('0x59')])return;return db['User'][_0xf689('0x50')]({'where':{'id':_0x4e0a29[_0xf689('0x52')]['UserId'],'role':'agent'},'attributes':['id',_0xf689('0x34'),_0xf689('0x69'),_0xf689('0x6a'),_0xf689('0x6b')],'raw':!![]});}return null;})['then'](function(_0x3b0d1a){if(!_0x3b0d1a)return null;_0x3289ff[_0xf689('0x25')][_0xf689('0x5b')]=_0x3b0d1a;return _0x3289ff;})[_0xf689('0x31')](function(_0x4b9718){if(_0x4b9718){if(_0x4e0a29[_0xf689('0x52')][_0xf689('0x6c')]){_0x3289ff[_0xf689('0x25')][_0xf689('0x6d')]=util[_0xf689('0x57')](_0xf689('0x6e'),_0x4e0a29[_0xf689('0x5a')][_0xf689('0x34')]);_0x3289ff[_0xf689('0x25')]['channel']=_0x3289ff[_0xf689('0x6f')];_0x3289ff[_0xf689('0x25')]['motionChannel']=_0x3289ff[_0xf689('0x6f')];_0x3289ff[_0xf689('0x25')][_0xf689('0x70')]=_0xf689('0x54');return respondWithRpcPromise(_0xf689('0x71'),'EventManager',{'event':_0xf689('0x72'),'message':_0x3289ff[_0xf689('0x25')]},client9002)[_0xf689('0x31')](function(){return _0x3289ff;});}return _0x3289ff;}return null;})[_0xf689('0x31')](respondWithResult(_0x286612,null))['catch'](handleError(_0x286612,null));};var interaction_log=require(_0xf689('0x10'))(_0xf689('0x73'));exports[_0xf689('0x74')]=function(_0x2c122b,_0x5f5a29,_0x23c19b){var _0xb72452={'agent':{},'channel':_0xf689('0x55')};if(_0x2c122b[_0xf689('0x52')]['id']){delete _0x2c122b[_0xf689('0x52')]['id'];}_0x2c122b[_0xf689('0x52')][_0xf689('0x59')]=_0x2c122b['body']['UserId']||_0x2c122b[_0xf689('0x5a')]['id'];_0xb72452['agent']['id']=_0x2c122b[_0xf689('0x52')][_0xf689('0x59')];return db[_0xf689('0x48')]['find']({'where':{'id':_0x2c122b[_0xf689('0x4d')]['id'],'UserId':null}})[_0xf689('0x31')](handleEntityNotFound(_0x5f5a29,null))['then'](function(_0xd966b4){if(_0xd966b4){_0xb72452[_0xf689('0x25')]=_0xd966b4[_0xf689('0x5c')]({'plain':!![]});return db[_0xf689('0x75')]['find']({'where':{'id':_0xd966b4[_0xf689('0x5d')]}});}return null;})[_0xf689('0x31')](handleEntityNotFound(_0x5f5a29,null))[_0xf689('0x31')](function(_0x110564){if(_0x110564){_0xb72452[_0xf689('0x60')]=_0x110564[_0xf689('0x5c')]({'plain':!![]});interaction_log[_0xf689('0x1e')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2c122b['user']['id'],_0x2c122b[_0xf689('0x5a')][_0xf689('0x34')],_0x2c122b[_0xf689('0x5a')][_0xf689('0x61')],_0xb72452[_0xf689('0x60')]['id'],_0x2c122b[_0xf689('0x52')]?JSON[_0xf689('0x22')](_0x2c122b[_0xf689('0x52')]):'null');return respondWithRpcPromise(_0xf689('0x76'),_0xf689('0x77'),_0xb72452);}return null;})['then'](function(_0x1b2225){var _0x2bef6e=_0xf689('0x64')+_0x1b2225['message']['ContactId'];return db[_0xf689('0x78')][_0xf689('0x39')](_0x2bef6e,{'type':db[_0xf689('0x79')]['QueryTypes'][_0xf689('0x67')],'raw':!![]})[_0xf689('0x31')](function(_0x15cce4){return _0x15cce4;});})['then'](function(_0xee7141){if(_0xee7141){_0xb72452[_0xf689('0x25')][_0xf689('0x68')]=_0xee7141[0x0];if(!_0x2c122b['body'][_0xf689('0x59')])return;return db[_0xf689('0x7a')]['find']({'where':{'id':_0x2c122b[_0xf689('0x52')]['UserId'],'role':_0xf689('0x5b')},'attributes':['id',_0xf689('0x34'),_0xf689('0x69'),_0xf689('0x6a'),_0xf689('0x6b')],'raw':!![]});}return null;})[_0xf689('0x31')](function(_0x36d63f){if(!_0x36d63f)return null;_0xb72452[_0xf689('0x25')][_0xf689('0x5b')]=_0x36d63f;return _0xb72452;})[_0xf689('0x31')](function(_0x253f3e){if(_0x253f3e){_0x253f3e[_0xf689('0x25')][_0xf689('0x6d')]=util[_0xf689('0x57')](_0xf689('0x6e'),_0x2c122b['user'][_0xf689('0x34')]);_0x253f3e[_0xf689('0x25')][_0xf689('0x6f')]=_0xb72452['channel'];_0x253f3e[_0xf689('0x25')][_0xf689('0x7b')]=_0xb72452[_0xf689('0x6f')];_0x253f3e[_0xf689('0x25')]['event']=_0xf689('0x74');respondWithRpcPromise('EventManager',_0xf689('0x71'),{'event':_0xf689('0x7c'),'message':_0x253f3e[_0xf689('0x25')]},client9002);return _0xb72452;}return null;})[_0xf689('0x31')](respondWithResult(_0x5f5a29,null))[_0xf689('0x27')](handleError(_0x5f5a29,null));};exports[_0xf689('0x29')]=function(_0x584d35,_0x4047db,_0x526d01){if(_0x584d35['body']['id']){delete _0x584d35[_0xf689('0x52')]['id'];}var _0xb26418;return db[_0xf689('0x48')][_0xf689('0x50')]({'where':{'id':_0x584d35[_0xf689('0x4d')]['id']}})[_0xf689('0x31')](handleEntityNotFound(_0x4047db,null))['then'](function(_0x25560c){if(_0x25560c){_0xb26418=_0x25560c;return db['SmsAccount'][_0xf689('0x50')]({'where':{'id':_0x25560c['SmsAccountId']}});}})[_0xf689('0x31')](handleEntityNotFound(_0x4047db,null))[_0xf689('0x31')](function(_0x330372){if(_0x330372){logger['debug'](_0xf689('0x21'),'status','received\x20delivery\x20report\x20from',_0x330372[_0xf689('0x36')],util[_0xf689('0x7d')](_0x584d35['body'],{'showHidden':![],'depth':null}));switch(_0x330372['type']){case _0xf689('0x7e'):if(_0x584d35['body'][_0xf689('0x7f')]&&_0x584d35[_0xf689('0x52')][_0xf689('0x7f')]===_0xb26418[_0xf689('0x80')]){return _0xb26418[_0xf689('0x5e')]({'read':!![]});}else{logger[_0xf689('0x23')](_0xf689('0x81'),_0xf689('0x29'),_0xf689('0x7e'),util['inspect'](_0x584d35[_0xf689('0x52')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x584d35[_0xf689('0x52')][_0xf689('0x82')]&&_0x584d35[_0xf689('0x52')][_0xf689('0x82')]===_0xb26418['messageId']&&_[_0xf689('0x83')](['sent',_0xf689('0x84')],_0x584d35[_0xf689('0x52')][_0xf689('0x85')])>=0x0){return _0xb26418[_0xf689('0x5e')]({'read':!![]});}else{logger['error'](_0xf689('0x81'),'status',_0xf689('0x86'),util[_0xf689('0x7d')](_0x584d35['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x2766fd=_0x584d35['body']['results'][0x0];if(_0x2766fd[_0xf689('0x29')][_0xf689('0x87')]==='DELIVERED'){return _0xb26418[_0xf689('0x5e')]({'read':!![]});}else{logger[_0xf689('0x23')](_0xf689('0x81'),_0xf689('0x29'),_0xf689('0x88'),util['inspect'](_0x584d35['body'],{'showHidden':![],'depth':null}));}break;}return _0xb26418;}})[_0xf689('0x31')](respondWithResult(_0x4047db,null))[_0xf689('0x27')](handleError(_0x4047db,null));};
\ No newline at end of file
index f9d27e3..e876376 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5ec=['exports','events','../../mysqldb','SmsMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x1cd3e3,_0xbeb106){var _0x4a3336=function(_0x2a385d){while(--_0x2a385d){_0x1cd3e3['push'](_0x1cd3e3['shift']());}};_0x4a3336(++_0xbeb106);}(_0xd5ec,0xb5));var _0xcd5e=function(_0x91d019,_0x5223c4){_0x91d019=_0x91d019-0x0;var _0x19de1f=_0xd5ec[_0x91d019];return _0x19de1f;};'use strict';var EventEmitter=require(_0xcd5e('0x0'));var SmsMessage=require(_0xcd5e('0x1'))['db'][_0xcd5e('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xcd5e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcd5e('0x4'),'afterDestroy':_0xcd5e('0x5')};function emitEvent(_0x3b2e5b){return function(_0x27882f,_0x198510,_0x54fc9d){SmsMessageEvents['emit'](_0x3b2e5b+':'+_0x27882f['id'],_0x27882f);SmsMessageEvents[_0xcd5e('0x6')](_0x3b2e5b,_0x27882f);_0x54fc9d(null);};}for(var e in events){if(events[_0xcd5e('0x7')](e)){var event=events[e];SmsMessage[_0xcd5e('0x8')](e,emitEvent(event));}}module[_0xcd5e('0x9')]=SmsMessageEvents;
\ No newline at end of file
+var _0xdcbe=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit'];(function(_0x34e019,_0x369969){var _0x31a180=function(_0x98ed00){while(--_0x98ed00){_0x34e019['push'](_0x34e019['shift']());}};_0x31a180(++_0x369969);}(_0xdcbe,0x19a));var _0xedcb=function(_0x42de7d,_0x3d3b27){_0x42de7d=_0x42de7d-0x0;var _0x50e713=_0xdcbe[_0x42de7d];return _0x50e713;};'use strict';var EventEmitter=require(_0xedcb('0x0'));var SmsMessage=require(_0xedcb('0x1'))['db'][_0xedcb('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xedcb('0x3')](0x0);var events={'afterCreate':_0xedcb('0x4'),'afterUpdate':_0xedcb('0x5'),'afterDestroy':_0xedcb('0x6')};function emitEvent(_0x53273d){return function(_0x36b39f,_0x4ceecc,_0x1f868c){SmsMessageEvents[_0xedcb('0x7')](_0x53273d+':'+_0x36b39f['id'],_0x36b39f);SmsMessageEvents[_0xedcb('0x7')](_0x53273d,_0x36b39f);_0x1f868c(null);};}for(var e in events){if(events[_0xedcb('0x8')](e)){var event=events[e];SmsMessage[_0xedcb('0x9')](e,emitEvent(event));}}module[_0xedcb('0xa')]=SmsMessageEvents;
\ No newline at end of file
index e686348..7c585ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17f7=['../../config/environment','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','models','get','direction','toLowerCase','out','isNil','UserId','findOne','then','update','createdAt','catch','error','secret','type','twilio','authToken','phone','messages','body','remote','/api/sms/messages/','/status?token=','token','sid','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','sender','&password=','split','sms','POST','user_key','session_key','total_sent','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','length','createHash','md5','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','bandwidth','intelepeer','Bearer\x20','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x17f7,0x161));var _0x717f=function(_0x4fc122,_0x1c10c8){_0x4fc122=_0x4fc122-0x0;var _0x552bc1=_0x17f7[_0x4fc122];return _0x552bc1;};'use strict';var _=require('lodash');var util=require(_0x717f('0x0'));var logger=require(_0x717f('0x1'))(_0x717f('0x2'));var moment=require(_0x717f('0x3'));var BPromise=require(_0x717f('0x4'));var rp=require(_0x717f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x717f('0x6'));var config=require(_0x717f('0x7'));var attributes=require(_0x717f('0x8'));module[_0x717f('0x9')]=function(_0x38a620,_0x1cb361){return _0x38a620[_0x717f('0xa')]('SmsMessage',attributes,{'tableName':_0x717f('0xb'),'paranoid':![],'indexes':[{'name':_0x717f('0xc'),'fields':[_0x717f('0xc')]},{'name':_0x717f('0xd'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2c486e,_0x42ca76,_0x44f332){var _0x2a45d8=_0x38a620[_0x717f('0xe')];var _0x56b48c=_0x2c486e[_0x717f('0xf')]({'plain':!![]});if(_0x56b48c[_0x717f('0x10')][_0x717f('0x11')]()==='in'||_0x56b48c[_0x717f('0x10')][_0x717f('0x11')]()===_0x717f('0x12')&&!_0x56b48c['secret']&&!_[_0x717f('0x13')](_0x56b48c[_0x717f('0x14')])&&!_[_0x717f('0x13')](_0x56b48c['SmsInteractionId'])){_0x2a45d8['SmsInteraction'][_0x717f('0x15')]({'where':{'id':_0x56b48c['SmsInteractionId']}})[_0x717f('0x16')](function(_0x48b2b8){if(_0x48b2b8){_0x48b2b8[_0x717f('0x17')]({'lastMsgAt':_0x56b48c[_0x717f('0x18')],'lastMsgDirection':_0x56b48c[_0x717f('0x10')]['toLowerCase']()});}})[_0x717f('0x19')](function(_0x2645c3){console[_0x717f('0x1a')](_0x2645c3);});}if(_0x56b48c[_0x717f('0x10')]===_0x717f('0x12')&&!_0x56b48c[_0x717f('0x1b')]){var _0x198296;_0x2a45d8['SmsAccount']['find']({'where':{'id':_0x56b48c['SmsAccountId']},'raw':!![]})[_0x717f('0x16')](function(_0x142a68){_0x198296=_0x142a68;if(_0x198296&&_0x198296['type']){switch(_0x198296[_0x717f('0x1c')]){case _0x717f('0x1d'):var _0x24361a=require('twilio');if(_0x198296['accountSid']&&_0x198296[_0x717f('0x1e')]&&_0x198296[_0x717f('0x1f')]){var _0x115378=new _0x24361a(_0x198296['accountSid'],_0x198296[_0x717f('0x1e')]);_0x115378[_0x717f('0x20')]['create']({'body':_0x56b48c[_0x717f('0x21')],'to':_0x56b48c['phone'],'from':_0x198296[_0x717f('0x1f')],'statusCallback':_0x198296[_0x717f('0x22')]+_0x717f('0x23')+_0x56b48c['id']+_0x717f('0x24')+_0x198296[_0x717f('0x25')]})[_0x717f('0x16')](function(_0x492fb3){if(_0x492fb3['sid']){return _0x2c486e[_0x717f('0x17')]({'messageId':_0x492fb3[_0x717f('0x26')]});}})['catch'](function(_0x4b17ad){logger[_0x717f('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x717f('0x1d'),util[_0x717f('0x27')](_0x4b17ad,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x717f('0x28'),_0x717f('0x29'),_0x717f('0x1d'),_0x717f('0x2a'));}break;case _0x717f('0x2b'):var _0x4e0707='https://api.skebby.it/API/v1.0/REST/';if(_0x198296[_0x717f('0x2c')]&&_0x198296[_0x717f('0x2d')]){var _0x75d46a={'recipient':[_0x56b48c[_0x717f('0x1f')]],'message':_0x56b48c[_0x717f('0x21')],'message_type':_0x198296['smsMethod']};if(_0x198296[_0x717f('0x2e')]&&_0x198296[_0x717f('0x2e')]!=='SI'){_0x75d46a[_0x717f('0x2f')]=_0x198296['phone'];}var _0x3e33ce={'url':_0x4e0707+'login?username='+_0x198296[_0x717f('0x2c')]+_0x717f('0x30')+_0x198296['password'],'method':'GET'};rp(_0x3e33ce)[_0x717f('0x16')](function(_0x1c3956){var _0x1ef449=_0x1c3956[_0x717f('0x31')](';');var _0xd34d7f={'user_key':_0x1ef449[0x0],'session_key':_0x1ef449[0x1]};_0x3e33ce={'url':_0x4e0707+_0x717f('0x32'),'method':_0x717f('0x33'),'headers':{'user_key':_0xd34d7f[_0x717f('0x34')],'Session_key':_0xd34d7f[_0x717f('0x35')]},'json':!![],'body':_0x75d46a};return rp(_0x3e33ce);})[_0x717f('0x16')](function(_0x1e3d2a){if(_0x1e3d2a[_0x717f('0x36')]>=0x1){var _0x264f9b={'messageId':_0x1e3d2a['internal_order_id']};if(_0x198296[_0x717f('0x2e')]!=='GP'||!_0x198296['deliveryReport']){_0x264f9b[_0x717f('0x37')]=!![];}return _0x2c486e[_0x717f('0x17')](_0x264f9b);}else{return logger[_0x717f('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x717f('0x2b'),util[_0x717f('0x27')](_0x1e3d2a,{'showHidden':![],'depth':null}));}})[_0x717f('0x19')](function(_0x301f84){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x717f('0x29'),'skebby',util[_0x717f('0x27')](_0x301f84,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x717f('0x28'),_0x717f('0x29'),'skebby',_0x717f('0x38'));}break;case _0x717f('0x39'):if(_0x198296[_0x717f('0x1e')]){var _0x56d0e0={'recipient':_0x56b48c[_0x717f('0x1f')],'message':_0x56b48c[_0x717f('0x21')],'sender':_0x198296[_0x717f('0x3a')]||_0x198296['phone'],'authorization':_0x198296['authToken']};var _0x42ca76={'method':'POST','uri':_0x717f('0x3b'),'body':_0x56d0e0,'json':!![]};rp(_0x42ca76)[_0x717f('0x16')](function(_0x48ba28){var _0x137a51={'messageId':_0x48ba28[_0x717f('0x3c')]};if(!_0x198296[_0x717f('0x3d')]){_0x137a51[_0x717f('0x37')]=!![];}return _0x2c486e[_0x717f('0x17')](_0x137a51);})[_0x717f('0x19')](function(_0x58dc1e){logger['error'](_0x717f('0x28'),_0x717f('0x29'),_0x717f('0x39'),util[_0x717f('0x27')](_0x58dc1e,{'showHidden':![],'depth':null}));});}else{logger[_0x717f('0x1a')](_0x717f('0x28'),_0x717f('0x29'),'connectel',_0x717f('0x3e'));}break;case _0x717f('0x3f'):if(_0x198296[_0x717f('0x2c')]&&_0x198296[_0x717f('0x2d')]){var _0x56d0e0={'messages':[{'source':'xCALLY\x20Motion','to':_0x56b48c[_0x717f('0x1f')],'body':_0x56b48c[_0x717f('0x21')],'from':_0x198296[_0x717f('0x3a')]||_0x198296[_0x717f('0x1f')]}]};var _0x146959=util[_0x717f('0x40')](_0x717f('0x41'),_0x198296[_0x717f('0x2c')],_0x198296['password']);var _0x42ca76={'method':_0x717f('0x33'),'uri':_0x717f('0x42'),'body':_0x56d0e0,'headers':{'Authorization':util[_0x717f('0x40')]('Basic\x20%s',new Buffer(_0x146959)[_0x717f('0x43')](_0x717f('0x44')))},'json':!![]};rp(_0x42ca76)[_0x717f('0x16')](function(_0x52098f){if(_0x52098f[_0x717f('0x45')]>=0xc8&&_0x52098f['http_code']<=0xce){if(_0x52098f['data']&&_0x52098f[_0x717f('0x46')][_0x717f('0x47')]>0x0){var _0x1ad9a0=_['head'](_0x52098f[_0x717f('0x46')][_0x717f('0x20')]);var _0x3e019c={'messageId':_0x1ad9a0['message_id']};if(!_0x198296[_0x717f('0x3d')]){_0x3e019c[_0x717f('0x37')]=!![];}return _0x2c486e[_0x717f('0x17')](_0x3e019c);}else{logger['error'](_0x717f('0x28'),_0x717f('0x29'),_0x717f('0x48'),util[_0x717f('0x27')](_0x52098f,{'showHidden':![],'depth':null}));}}else{logger[_0x717f('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x717f('0x48'),util[_0x717f('0x27')](_0x52098f,{'showHidden':![],'depth':null}));}})[_0x717f('0x19')](function(_0x3e0eab){logger[_0x717f('0x1a')](_0x717f('0x28'),'afterCreate','clickSend',util[_0x717f('0x27')](_0x3e0eab,{'showHidden':![],'depth':null}));});}else{logger[_0x717f('0x1a')](_0x717f('0x28'),_0x717f('0x29'),_0x717f('0x48'),_0x717f('0x38'));}break;case _0x717f('0x49'):if(_0x198296['authId']&&_0x198296[_0x717f('0x1e')]){var _0x56d0e0={'dst':_0x56b48c[_0x717f('0x1f')],'text':_0x56b48c[_0x717f('0x21')],'src':_0x198296[_0x717f('0x3a')]||_0x198296[_0x717f('0x1f')],'url':_0x198296[_0x717f('0x22')]+_0x717f('0x23')+_0x56b48c['id']+_0x717f('0x24')+_0x198296[_0x717f('0x25')]};var _0x146959=util['format'](_0x717f('0x41'),_0x198296[_0x717f('0x4a')],_0x198296['authToken']);var _0x42ca76={'method':_0x717f('0x33'),'uri':util[_0x717f('0x40')](_0x717f('0x4b'),_0x198296[_0x717f('0x4a')]),'body':_0x56d0e0,'headers':{'Authorization':util['format'](_0x717f('0x4c'),new Buffer(_0x146959)[_0x717f('0x43')](_0x717f('0x44')))},'json':!![]};rp(_0x42ca76)['then'](function(_0x4bd2cb){var _0x3ddb29={'messageId':_0x4bd2cb['message_uuid'][0x0]};return _0x2c486e[_0x717f('0x17')](_0x3ddb29);})[_0x717f('0x19')](function(_0x1bfd94){logger['error'](_0x717f('0x28'),'afterCreate',_0x717f('0x49'),util[_0x717f('0x27')](_0x1bfd94,{'showHidden':![],'depth':null}));});}else{logger[_0x717f('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x717f('0x29'),_0x717f('0x49'),_0x717f('0x4d'));}break;case _0x717f('0x4e'):if(_0x198296[_0x717f('0x2c')]&&_0x198296[_0x717f('0x2d')]){if(_0x198296[_0x717f('0x4f')]){var _0x43a850={'method':_0x717f('0x33'),'uri':_0x198296[_0x717f('0x4f')]+_0x717f('0x50'),'body':{'username':_0x198296['username'],'password':_0x198296[_0x717f('0x2d')]},'json':!![]};return rp(_0x43a850)['then'](function(_0x54ead8){var _0x24fbea={'method':'POST','uri':_0x198296[_0x717f('0x4f')]+_0x717f('0x51'),'body':{'messages':[{'from':_0x198296[_0x717f('0x1f')],'destinations':[{'to':_0x56b48c[_0x717f('0x1f')]}],'text':_0x56b48c[_0x717f('0x21')],'notifyUrl':_0x198296['remote']+_0x717f('0x23')+_0x56b48c['id']+_0x717f('0x24')+_0x198296[_0x717f('0x25')],'notifyContentType':'application/json','callbackData':_0x198296[_0x717f('0x1f')]+';'+_0x56b48c[_0x717f('0x21')]}]},'headers':{'Authorization':_0x717f('0x52')+_0x54ead8[_0x717f('0x25')]},'json':!![]};return rp(_0x24fbea)['then'](function(_0x9bdd35){if(_0x9bdd35[_0x717f('0x20')]){var _0x59d56f={'messageId':_0x9bdd35[_0x717f('0x20')][0x0][_0x717f('0xc')]};if(!_0x198296[_0x717f('0x3d')]){_0x59d56f['read']=!![];}return _0x2c486e[_0x717f('0x17')](_0x59d56f);}else{return logger[_0x717f('0x1a')](_0x717f('0x28'),_0x717f('0x29'),_0x717f('0x4e'),util['inspect'](_0x9bdd35,{'showHidden':![],'depth':null}));}});})[_0x717f('0x19')](function(_0x4ad9ce){return logger[_0x717f('0x1a')](_0x717f('0x28'),'afterCreate',_0x717f('0x4e'),util[_0x717f('0x27')](_0x4ad9ce,{'showHidden':![],'depth':null}));});}else{logger[_0x717f('0x1a')](_0x717f('0x28'),_0x717f('0x29'),_0x717f('0x4e'),_0x717f('0x53'));}}else{logger[_0x717f('0x1a')](_0x717f('0x28'),_0x717f('0x29'),_0x717f('0x4e'),_0x717f('0x38'));}break;case _0x717f('0x54'):var _0x680034=require(_0x717f('0x55'));if(_0x198296[_0x717f('0x56')]){var _0x3c90e4={};_0x3c90e4[_0x717f('0x57')]=_0x198296[_0x717f('0x2c')];_0x3c90e4[_0x717f('0x1f')]=_0x56b48c['phone'];_0x3c90e4['sender']=_0x198296[_0x717f('0x1f')];_0x3c90e4[_0x717f('0x58')]=_0x56b48c[_0x717f('0x21')];_0x3c90e4[_0x717f('0x59')]=+new Date();var _0x55c9d8='';var _0x301a74='';var _0x194722=Object['keys'](_0x3c90e4);_0x194722['sort']();for(var _0x16726b=0x0;_0x16726b<_0x194722[_0x717f('0x5a')];_0x16726b++){if(_0x55c9d8!=''){_0x55c9d8+='&';}_0x55c9d8+=_0x194722[_0x16726b]+'='+encodeURIComponent(_0x3c90e4[_0x194722[_0x16726b]]);_0x301a74+=_0x3c90e4[_0x194722[_0x16726b]];}_0x301a74+=_0x198296[_0x717f('0x56')];_0x301a74=_0x680034[_0x717f('0x5b')](_0x717f('0x5c'))[_0x717f('0x17')](_0x301a74)['digest'](_0x717f('0x5d'));if(_0x55c9d8!==''){_0x55c9d8+='&';}_0x55c9d8+=_0x717f('0x5e')+_0x301a74;var _0x3e33ce={'method':'GET','uri':_0x198296[_0x717f('0x4f')]+_0x717f('0x5f')+_0x55c9d8,'json':!![]};return rp(_0x3e33ce)[_0x717f('0x16')](function(_0x595516){var _0x2c651d=Object['keys'](_0x595516);if(_0x595516[_0x2c651d[0x0]][_0x717f('0x1a')]&&parseInt(_0x595516[_0x2c651d[0x0]]['error'])===0x0){var _0x5ad3cf={'messageId':_0x595516[_0x2c651d[0x0]][_0x717f('0x60')]};if(!_0x198296[_0x717f('0x3d')]){_0x5ad3cf[_0x717f('0x37')]=!![];}return _0x2c486e[_0x717f('0x17')](_0x5ad3cf);}else{return logger[_0x717f('0x1a')](_0x717f('0x28'),_0x717f('0x29'),_0x717f('0x54'),util[_0x717f('0x27')](_0x595516[_0x717f('0x1a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x1b0635){return logger[_0x717f('0x1a')](_0x717f('0x28'),_0x717f('0x29'),_0x717f('0x54'),util[_0x717f('0x27')](_0x1b0635,{'showHidden':![],'depth':null}));});}else{logger[_0x717f('0x1a')](_0x717f('0x28'),_0x717f('0x29'),_0x717f('0x54'),_0x717f('0x61'));}break;case'clickatell':if(_0x198296[_0x717f('0x56')]){var _0x4caef3={'method':'POST','uri':_0x717f('0x62'),'headers':{'Authorization':_0x198296[_0x717f('0x56')]},'body':{'content':_0x56b48c[_0x717f('0x21')],'to':[_0x56b48c[_0x717f('0x1f')]],'from':_0x198296['phone'],'binary':![],'clientMessageId':_0x717f('0x63'),'charset':_0x717f('0x64')},'json':!![]};rp(_0x4caef3)['then'](function(_0x453b33){if(!_0x453b33['error']){var _0x96809f={'messageId':_0x453b33['messages'][0x0][_0x717f('0x65')]};if(!_0x198296[_0x717f('0x3d')]){_0x96809f[_0x717f('0x37')]=!![];}return _0x2c486e[_0x717f('0x17')](_0x96809f);}else{return logger['error'](_0x717f('0x28'),'afterCreate',_0x717f('0x66'),util[_0x717f('0x27')](_0x453b33[_0x717f('0x1a')],{'showHidden':![],'depth':null}));}})[_0x717f('0x19')](function(_0x3a24de){return logger[_0x717f('0x1a')](_0x717f('0x28'),_0x717f('0x29'),_0x717f('0x66'),util[_0x717f('0x27')](_0x3a24de,{'showHidden':![],'depth':null}));});}else{logger[_0x717f('0x1a')](_0x717f('0x28'),_0x717f('0x29'),_0x717f('0x66'),_0x717f('0x61'));}break;case'bandwidth':if(_0x198296['username']&&_0x198296[_0x717f('0x2d')]){var _0x146959=util[_0x717f('0x40')](_0x717f('0x41'),_0x198296[_0x717f('0x2c')],_0x198296[_0x717f('0x2d')]);var _0x42ca76={'method':_0x717f('0x33'),'uri':_0x717f('0x67')+_0x198296[_0x717f('0x68')]+_0x717f('0x69'),'body':{'to':[_0x56b48c[_0x717f('0x1f')]],'text':_0x56b48c[_0x717f('0x21')],'from':_0x198296[_0x717f('0x1f')],'applicationId':_0x198296[_0x717f('0x6a')]},'headers':{'Authorization':util['format'](_0x717f('0x4c'),new Buffer(_0x146959)['toString']('base64'))},'json':!![]};rp(_0x42ca76)[_0x717f('0x16')](function(_0x4320f1){if(_0x4320f1['id']){var _0x47dd8e={'messageId':_0x4320f1['id']};return _0x2c486e[_0x717f('0x17')](_0x47dd8e);}else{logger[_0x717f('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x717f('0x6b'),util['inspect'](_0x4320f1,{'showHidden':![],'depth':null}));}})[_0x717f('0x19')](function(_0x199356){logger[_0x717f('0x1a')](_0x717f('0x28'),'afterCreate','bandwidth',util[_0x717f('0x27')](_0x199356,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x717f('0x28'),_0x717f('0x29'),_0x717f('0x6b'),_0x717f('0x38'));}break;case _0x717f('0x6c'):if(_0x198296[_0x717f('0x56')]){var _0xb56fbe={};var _0x3e33ce={'method':_0x717f('0x33'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x717f('0x6d')+_0x198296[_0x717f('0x56')],'Content-Type':_0x717f('0x6e')},'body':{'from':_0x198296[_0x717f('0x1f')],'to':_0x56b48c[_0x717f('0x1f')],'text':_0x56b48c['body']},'json':!![]};return rp(_0x3e33ce)['then'](function(_0xd7eea6){if(_0xd7eea6[_0x717f('0x6f')]==0xca){_0xb56fbe[_0x717f('0x70')]=_0xd7eea6;var _0x16559a={'method':_0x717f('0x33'),'uri':_0x717f('0x71'),'headers':{'Authorization':_0x717f('0x6d')+_0x198296[_0x717f('0x56')],'Content-Type':'application/json'},'body':{'refid':_0xb56fbe[_0x717f('0x70')][_0x717f('0x72')]},'json':!![]};return rp(_0x16559a)[_0x717f('0x16')](function(_0x2fe9ab){_0xb56fbe[_0x717f('0x73')]=_0x2fe9ab;var _0x2cd14a={'messageId':_0xb56fbe[_0x717f('0x70')][_0x717f('0x72')],'read':!![]};return _0x2c486e[_0x717f('0x17')](_0x2cd14a);});}else{return logger['error'](_0x717f('0x28'),_0x717f('0x29'),_0x717f('0x6c'),util[_0x717f('0x27')](_0xd7eea6,{'showHidden':![],'depth':null}));}})[_0x717f('0x19')](function(_0x5489c2){return logger['error'](_0x717f('0x28'),'afterCreate','intelepeer',util[_0x717f('0x27')](_0x5489c2,{'showHidden':![],'depth':null}));});}else{return logger[_0x717f('0x1a')](_0x717f('0x28'),_0x717f('0x29'),_0x717f('0x6c'),_0x717f('0x74'));}break;}}})[_0x717f('0x75')](function(){_0x44f332();});}else{_0x44f332();}}},'charset':_0x717f('0x76'),'collate':_0x717f('0x77')});};
\ No newline at end of file
+var _0xc404=['authToken','phone','create','/api/sms/messages/','/status?token=','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','password','smsMethod','sender','username','GET','sms','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','%s:%s','POST','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','base64','http_code','head','messages','message_id','clickSend','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','timestamp','keys','length','apiKey','createHash','md5','digest','hex','signature=','/external/get/send.php?','clickatell','https://platform.clickatell.com/messages','uuid','Missing\x20parameters:\x20apiKey','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','isNil','SmsInteractionId','findOne','then','update','createdAt','catch','SmsAccount','SmsAccountId','type','twilio','accountSid'];(function(_0x55bcd6,_0x1b20e2){var _0x32dd7b=function(_0x249936){while(--_0x249936){_0x55bcd6['push'](_0x55bcd6['shift']());}};_0x32dd7b(++_0x1b20e2);}(_0xc404,0xd8));var _0x4c40=function(_0x455d18,_0x117ea1){_0x455d18=_0x455d18-0x0;var _0x2d6a0a=_0xc404[_0x455d18];return _0x2d6a0a;};'use strict';var _=require(_0x4c40('0x0'));var util=require(_0x4c40('0x1'));var logger=require(_0x4c40('0x2'))(_0x4c40('0x3'));var moment=require(_0x4c40('0x4'));var BPromise=require('bluebird');var rp=require(_0x4c40('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4c40('0x6'));var config=require(_0x4c40('0x7'));var attributes=require(_0x4c40('0x8'));module[_0x4c40('0x9')]=function(_0x52b437,_0x20a573){return _0x52b437[_0x4c40('0xa')](_0x4c40('0xb'),attributes,{'tableName':_0x4c40('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x4c40('0xd')]},{'name':_0x4c40('0xe'),'fields':[_0x4c40('0xf')],'type':_0x4c40('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1972ee,_0x33255e,_0x33c395){var _0x3afc20=_0x52b437[_0x4c40('0x11')];var _0x2acb4b=_0x1972ee[_0x4c40('0x12')]({'plain':!![]});if(_0x2acb4b[_0x4c40('0x13')]['toLowerCase']()==='in'||_0x2acb4b[_0x4c40('0x13')][_0x4c40('0x14')]()===_0x4c40('0x15')&&!_0x2acb4b[_0x4c40('0x16')]&&!_['isNil'](_0x2acb4b[_0x4c40('0x17')])&&!_[_0x4c40('0x18')](_0x2acb4b[_0x4c40('0x19')])){_0x3afc20['SmsInteraction'][_0x4c40('0x1a')]({'where':{'id':_0x2acb4b[_0x4c40('0x19')]}})[_0x4c40('0x1b')](function(_0x18342f){if(_0x18342f){_0x18342f[_0x4c40('0x1c')]({'lastMsgAt':_0x2acb4b[_0x4c40('0x1d')],'lastMsgDirection':_0x2acb4b[_0x4c40('0x13')][_0x4c40('0x14')]()});}})[_0x4c40('0x1e')](function(_0x102eff){console['error'](_0x102eff);});}if(_0x2acb4b[_0x4c40('0x13')]===_0x4c40('0x15')&&!_0x2acb4b[_0x4c40('0x16')]){var _0x2e2732;_0x3afc20[_0x4c40('0x1f')]['find']({'where':{'id':_0x2acb4b[_0x4c40('0x20')]},'raw':!![]})[_0x4c40('0x1b')](function(_0x59da98){_0x2e2732=_0x59da98;if(_0x2e2732&&_0x2e2732['type']){switch(_0x2e2732[_0x4c40('0x21')]){case _0x4c40('0x22'):var _0x182410=require(_0x4c40('0x22'));if(_0x2e2732[_0x4c40('0x23')]&&_0x2e2732[_0x4c40('0x24')]&&_0x2e2732[_0x4c40('0x25')]){var _0x2a467d=new _0x182410(_0x2e2732[_0x4c40('0x23')],_0x2e2732[_0x4c40('0x24')]);_0x2a467d['messages'][_0x4c40('0x26')]({'body':_0x2acb4b[_0x4c40('0xf')],'to':_0x2acb4b[_0x4c40('0x25')],'from':_0x2e2732[_0x4c40('0x25')],'statusCallback':_0x2e2732['remote']+_0x4c40('0x27')+_0x2acb4b['id']+_0x4c40('0x28')+_0x2e2732[_0x4c40('0x29')]})['then'](function(_0x130779){if(_0x130779[_0x4c40('0x2a')]){return _0x1972ee[_0x4c40('0x1c')]({'messageId':_0x130779[_0x4c40('0x2a')]});}})[_0x4c40('0x1e')](function(_0x24dec2){logger[_0x4c40('0x2b')](_0x4c40('0x2c'),_0x4c40('0x2d'),_0x4c40('0x22'),util[_0x4c40('0x2e')](_0x24dec2,{'showHidden':![],'depth':null}));});}else{logger[_0x4c40('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4c40('0x2d'),_0x4c40('0x22'),_0x4c40('0x2f'));}break;case'skebby':var _0xb5333e='https://api.skebby.it/API/v1.0/REST/';if(_0x2e2732['username']&&_0x2e2732[_0x4c40('0x30')]){var _0x2f4098={'recipient':[_0x2acb4b[_0x4c40('0x25')]],'message':_0x2acb4b[_0x4c40('0xf')],'message_type':_0x2e2732[_0x4c40('0x31')]};if(_0x2e2732['smsMethod']&&_0x2e2732[_0x4c40('0x31')]!=='SI'){_0x2f4098[_0x4c40('0x32')]=_0x2e2732[_0x4c40('0x25')];}var _0x28f923={'url':_0xb5333e+'login?username='+_0x2e2732[_0x4c40('0x33')]+'&password='+_0x2e2732[_0x4c40('0x30')],'method':_0x4c40('0x34')};rp(_0x28f923)[_0x4c40('0x1b')](function(_0x32e673){var _0x205909=_0x32e673['split'](';');var _0x39cd6e={'user_key':_0x205909[0x0],'session_key':_0x205909[0x1]};_0x28f923={'url':_0xb5333e+_0x4c40('0x35'),'method':'POST','headers':{'user_key':_0x39cd6e[_0x4c40('0x36')],'Session_key':_0x39cd6e[_0x4c40('0x37')]},'json':!![],'body':_0x2f4098};return rp(_0x28f923);})[_0x4c40('0x1b')](function(_0x1c18d9){if(_0x1c18d9[_0x4c40('0x38')]>=0x1){var _0x4b2ee4={'messageId':_0x1c18d9[_0x4c40('0x39')]};if(_0x2e2732[_0x4c40('0x31')]!=='GP'||!_0x2e2732[_0x4c40('0x3a')]){_0x4b2ee4[_0x4c40('0x3b')]=!![];}return _0x1972ee['update'](_0x4b2ee4);}else{return logger[_0x4c40('0x2b')](_0x4c40('0x2c'),_0x4c40('0x2d'),'skebby',util[_0x4c40('0x2e')](_0x1c18d9,{'showHidden':![],'depth':null}));}})[_0x4c40('0x1e')](function(_0x2f86fa){return logger['error'](_0x4c40('0x2c'),_0x4c40('0x2d'),'skebby',util[_0x4c40('0x2e')](_0x2f86fa,{'showHidden':![],'depth':null}));});}else{logger[_0x4c40('0x2b')](_0x4c40('0x2c'),'afterCreate',_0x4c40('0x3c'),_0x4c40('0x3d'));}break;case _0x4c40('0x3e'):if(_0x2e2732[_0x4c40('0x24')]){var _0x11f51a={'recipient':_0x2acb4b[_0x4c40('0x25')],'message':_0x2acb4b[_0x4c40('0xf')],'sender':_0x2e2732[_0x4c40('0x3f')]||_0x2e2732[_0x4c40('0x25')],'authorization':_0x2e2732[_0x4c40('0x24')]};var _0x33255e={'method':'POST','uri':_0x4c40('0x40'),'body':_0x11f51a,'json':!![]};rp(_0x33255e)[_0x4c40('0x1b')](function(_0x484782){var _0x35b59f={'messageId':_0x484782[_0x4c40('0x41')]};if(!_0x2e2732[_0x4c40('0x3a')]){_0x35b59f['read']=!![];}return _0x1972ee[_0x4c40('0x1c')](_0x35b59f);})[_0x4c40('0x1e')](function(_0x395699){logger['error'](_0x4c40('0x2c'),_0x4c40('0x2d'),_0x4c40('0x3e'),util[_0x4c40('0x2e')](_0x395699,{'showHidden':![],'depth':null}));});}else{logger[_0x4c40('0x2b')](_0x4c40('0x2c'),'afterCreate',_0x4c40('0x3e'),_0x4c40('0x42'));}break;case _0x4c40('0x43'):if(_0x2e2732[_0x4c40('0x33')]&&_0x2e2732['password']){var _0x11f51a={'messages':[{'source':_0x4c40('0x44'),'to':_0x2acb4b[_0x4c40('0x25')],'body':_0x2acb4b[_0x4c40('0xf')],'from':_0x2e2732[_0x4c40('0x3f')]||_0x2e2732['phone']}]};var _0x3c48ab=util['format'](_0x4c40('0x45'),_0x2e2732[_0x4c40('0x33')],_0x2e2732['password']);var _0x33255e={'method':_0x4c40('0x46'),'uri':_0x4c40('0x47'),'body':_0x11f51a,'headers':{'Authorization':util[_0x4c40('0x48')](_0x4c40('0x49'),new Buffer(_0x3c48ab)['toString'](_0x4c40('0x4a')))},'json':!![]};rp(_0x33255e)[_0x4c40('0x1b')](function(_0x40fe46){if(_0x40fe46['http_code']>=0xc8&&_0x40fe46[_0x4c40('0x4b')]<=0xce){if(_0x40fe46['data']&&_0x40fe46['data']['queued_count']>0x0){var _0x2774d4=_[_0x4c40('0x4c')](_0x40fe46['data'][_0x4c40('0x4d')]);var _0x4fdb12={'messageId':_0x2774d4[_0x4c40('0x4e')]};if(!_0x2e2732[_0x4c40('0x3a')]){_0x4fdb12[_0x4c40('0x3b')]=!![];}return _0x1972ee[_0x4c40('0x1c')](_0x4fdb12);}else{logger[_0x4c40('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4c40('0x4f'),util[_0x4c40('0x2e')](_0x40fe46,{'showHidden':![],'depth':null}));}}else{logger[_0x4c40('0x2b')](_0x4c40('0x2c'),'afterCreate',_0x4c40('0x4f'),util[_0x4c40('0x2e')](_0x40fe46,{'showHidden':![],'depth':null}));}})[_0x4c40('0x1e')](function(_0x1549b5){logger['error'](_0x4c40('0x2c'),_0x4c40('0x2d'),'clickSend',util[_0x4c40('0x2e')](_0x1549b5,{'showHidden':![],'depth':null}));});}else{logger[_0x4c40('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4c40('0x2d'),_0x4c40('0x4f'),'Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x2e2732[_0x4c40('0x50')]&&_0x2e2732[_0x4c40('0x24')]){var _0x11f51a={'dst':_0x2acb4b[_0x4c40('0x25')],'text':_0x2acb4b[_0x4c40('0xf')],'src':_0x2e2732['senderString']||_0x2e2732[_0x4c40('0x25')],'url':_0x2e2732[_0x4c40('0x51')]+_0x4c40('0x27')+_0x2acb4b['id']+_0x4c40('0x28')+_0x2e2732['token']};var _0x3c48ab=util[_0x4c40('0x48')]('%s:%s',_0x2e2732[_0x4c40('0x50')],_0x2e2732[_0x4c40('0x24')]);var _0x33255e={'method':_0x4c40('0x46'),'uri':util[_0x4c40('0x48')](_0x4c40('0x52'),_0x2e2732[_0x4c40('0x50')]),'body':_0x11f51a,'headers':{'Authorization':util[_0x4c40('0x48')](_0x4c40('0x49'),new Buffer(_0x3c48ab)[_0x4c40('0x53')](_0x4c40('0x4a')))},'json':!![]};rp(_0x33255e)[_0x4c40('0x1b')](function(_0x43a403){var _0x237a99={'messageId':_0x43a403[_0x4c40('0x54')][0x0]};return _0x1972ee[_0x4c40('0x1c')](_0x237a99);})[_0x4c40('0x1e')](function(_0x3c331a){logger[_0x4c40('0x2b')](_0x4c40('0x2c'),_0x4c40('0x2d'),_0x4c40('0x55'),util[_0x4c40('0x2e')](_0x3c331a,{'showHidden':![],'depth':null}));});}else{logger[_0x4c40('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4c40('0x2d'),_0x4c40('0x55'),_0x4c40('0x56'));}break;case _0x4c40('0x57'):if(_0x2e2732[_0x4c40('0x33')]&&_0x2e2732[_0x4c40('0x30')]){if(_0x2e2732['baseUrl']){var _0x311a2d={'method':'POST','uri':_0x2e2732[_0x4c40('0x58')]+_0x4c40('0x59'),'body':{'username':_0x2e2732['username'],'password':_0x2e2732['password']},'json':!![]};return rp(_0x311a2d)[_0x4c40('0x1b')](function(_0x40a299){var _0x2bc9ff={'method':_0x4c40('0x46'),'uri':_0x2e2732[_0x4c40('0x58')]+_0x4c40('0x5a'),'body':{'messages':[{'from':_0x2e2732[_0x4c40('0x25')],'destinations':[{'to':_0x2acb4b[_0x4c40('0x25')]}],'text':_0x2acb4b[_0x4c40('0xf')],'notifyUrl':_0x2e2732[_0x4c40('0x51')]+_0x4c40('0x27')+_0x2acb4b['id']+_0x4c40('0x28')+_0x2e2732['token'],'notifyContentType':_0x4c40('0x5b'),'callbackData':_0x2e2732[_0x4c40('0x25')]+';'+_0x2acb4b[_0x4c40('0xf')]}]},'headers':{'Authorization':_0x4c40('0x5c')+_0x40a299[_0x4c40('0x29')]},'json':!![]};return rp(_0x2bc9ff)[_0x4c40('0x1b')](function(_0x4aaecc){if(_0x4aaecc['messages']){var _0x4c0f9c={'messageId':_0x4aaecc[_0x4c40('0x4d')][0x0][_0x4c40('0xd')]};if(!_0x2e2732[_0x4c40('0x3a')]){_0x4c0f9c['read']=!![];}return _0x1972ee[_0x4c40('0x1c')](_0x4c0f9c);}else{return logger[_0x4c40('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4c40('0x2d'),_0x4c40('0x57'),util[_0x4c40('0x2e')](_0x4aaecc,{'showHidden':![],'depth':null}));}});})[_0x4c40('0x1e')](function(_0x260ea0){return logger[_0x4c40('0x2b')](_0x4c40('0x2c'),_0x4c40('0x2d'),'infobip',util[_0x4c40('0x2e')](_0x260ea0,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4c40('0x2c'),_0x4c40('0x2d'),_0x4c40('0x57'),_0x4c40('0x5d'));}}else{logger['error'](_0x4c40('0x2c'),_0x4c40('0x2d'),_0x4c40('0x57'),_0x4c40('0x3d'));}break;case _0x4c40('0x5e'):var _0x3e2ac8=require(_0x4c40('0x5f'));if(_0x2e2732['apiKey']){var _0x4a71af={};_0x4a71af[_0x4c40('0x60')]=_0x2e2732[_0x4c40('0x33')];_0x4a71af[_0x4c40('0x25')]=_0x2acb4b[_0x4c40('0x25')];_0x4a71af['sender']=_0x2e2732[_0x4c40('0x25')];_0x4a71af['text']=_0x2acb4b['body'];_0x4a71af[_0x4c40('0x61')]=+new Date();var _0x418177='';var _0x4a4b35='';var _0x4d7ef1=Object[_0x4c40('0x62')](_0x4a71af);_0x4d7ef1['sort']();for(var _0x30bcdb=0x0;_0x30bcdb<_0x4d7ef1[_0x4c40('0x63')];_0x30bcdb++){if(_0x418177!=''){_0x418177+='&';}_0x418177+=_0x4d7ef1[_0x30bcdb]+'='+encodeURIComponent(_0x4a71af[_0x4d7ef1[_0x30bcdb]]);_0x4a4b35+=_0x4a71af[_0x4d7ef1[_0x30bcdb]];}_0x4a4b35+=_0x2e2732[_0x4c40('0x64')];_0x4a4b35=_0x3e2ac8[_0x4c40('0x65')](_0x4c40('0x66'))[_0x4c40('0x1c')](_0x4a4b35)[_0x4c40('0x67')](_0x4c40('0x68'));if(_0x418177!==''){_0x418177+='&';}_0x418177+=_0x4c40('0x69')+_0x4a4b35;var _0x28f923={'method':_0x4c40('0x34'),'uri':_0x2e2732[_0x4c40('0x58')]+_0x4c40('0x6a')+_0x418177,'json':!![]};return rp(_0x28f923)['then'](function(_0x16dfff){var _0x527d39=Object[_0x4c40('0x62')](_0x16dfff);if(_0x16dfff[_0x527d39[0x0]]['error']&&parseInt(_0x16dfff[_0x527d39[0x0]][_0x4c40('0x2b')])===0x0){var _0x270734={'messageId':_0x16dfff[_0x527d39[0x0]]['id_sms']};if(!_0x2e2732[_0x4c40('0x3a')]){_0x270734[_0x4c40('0x3b')]=!![];}return _0x1972ee[_0x4c40('0x1c')](_0x270734);}else{return logger[_0x4c40('0x2b')](_0x4c40('0x2c'),_0x4c40('0x2d'),'csc',util[_0x4c40('0x2e')](_0x16dfff[_0x4c40('0x2b')],{'showHidden':![],'depth':null}));}})[_0x4c40('0x1e')](function(_0x279324){return logger[_0x4c40('0x2b')](_0x4c40('0x2c'),'afterCreate','csc',util[_0x4c40('0x2e')](_0x279324,{'showHidden':![],'depth':null}));});}else{logger[_0x4c40('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4c40('0x2d'),_0x4c40('0x5e'),'Missing\x20parameters:\x20apiKey');}break;case _0x4c40('0x6b'):if(_0x2e2732[_0x4c40('0x64')]){var _0x3b2b26={'method':_0x4c40('0x46'),'uri':_0x4c40('0x6c'),'headers':{'Authorization':_0x2e2732[_0x4c40('0x64')]},'body':{'content':_0x2acb4b[_0x4c40('0xf')],'to':[_0x2acb4b[_0x4c40('0x25')]],'from':_0x2e2732[_0x4c40('0x25')],'binary':![],'clientMessageId':_0x4c40('0x6d'),'charset':'UTF-8'},'json':!![]};rp(_0x3b2b26)[_0x4c40('0x1b')](function(_0x51f77a){if(!_0x51f77a[_0x4c40('0x2b')]){var _0x170217={'messageId':_0x51f77a[_0x4c40('0x4d')][0x0]['apiMessageId']};if(!_0x2e2732['deliveryReport']){_0x170217[_0x4c40('0x3b')]=!![];}return _0x1972ee[_0x4c40('0x1c')](_0x170217);}else{return logger[_0x4c40('0x2b')](_0x4c40('0x2c'),_0x4c40('0x2d'),_0x4c40('0x6b'),util[_0x4c40('0x2e')](_0x51f77a['error'],{'showHidden':![],'depth':null}));}})[_0x4c40('0x1e')](function(_0x54873b){return logger[_0x4c40('0x2b')](_0x4c40('0x2c'),'afterCreate',_0x4c40('0x6b'),util[_0x4c40('0x2e')](_0x54873b,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4c40('0x2d'),_0x4c40('0x6b'),_0x4c40('0x6e'));}break;case'bandwidth':if(_0x2e2732[_0x4c40('0x33')]&&_0x2e2732[_0x4c40('0x30')]){var _0x3c48ab=util[_0x4c40('0x48')](_0x4c40('0x45'),_0x2e2732['username'],_0x2e2732[_0x4c40('0x30')]);var _0x33255e={'method':'POST','uri':_0x4c40('0x6f')+_0x2e2732[_0x4c40('0x70')]+_0x4c40('0x71'),'body':{'to':[_0x2acb4b['phone']],'text':_0x2acb4b['body'],'from':_0x2e2732[_0x4c40('0x25')],'applicationId':_0x2e2732['applicationId']},'headers':{'Authorization':util['format'](_0x4c40('0x49'),new Buffer(_0x3c48ab)['toString'](_0x4c40('0x4a')))},'json':!![]};rp(_0x33255e)['then'](function(_0x426577){if(_0x426577['id']){var _0x141919={'messageId':_0x426577['id']};return _0x1972ee[_0x4c40('0x1c')](_0x141919);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4c40('0x72'),util[_0x4c40('0x2e')](_0x426577,{'showHidden':![],'depth':null}));}})[_0x4c40('0x1e')](function(_0x230934){logger[_0x4c40('0x2b')](_0x4c40('0x2c'),_0x4c40('0x2d'),_0x4c40('0x72'),util[_0x4c40('0x2e')](_0x230934,{'showHidden':![],'depth':null}));});}else{logger[_0x4c40('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4c40('0x72'),_0x4c40('0x3d'));}break;case _0x4c40('0x73'):if(_0x2e2732[_0x4c40('0x64')]){var _0x12c8b6={};var _0x28f923={'method':'POST','uri':_0x4c40('0x74'),'headers':{'Authorization':_0x4c40('0x75')+_0x2e2732[_0x4c40('0x64')],'Content-Type':_0x4c40('0x5b')},'body':{'from':_0x2e2732[_0x4c40('0x25')],'to':_0x2acb4b[_0x4c40('0x25')],'text':_0x2acb4b[_0x4c40('0xf')]},'json':!![]};return rp(_0x28f923)[_0x4c40('0x1b')](function(_0x272b5c){if(_0x272b5c[_0x4c40('0x76')]==0xca){_0x12c8b6[_0x4c40('0x77')]=_0x272b5c;var _0x247084={'method':_0x4c40('0x46'),'uri':_0x4c40('0x78'),'headers':{'Authorization':_0x4c40('0x75')+_0x2e2732['apiKey'],'Content-Type':_0x4c40('0x5b')},'body':{'refid':_0x12c8b6[_0x4c40('0x77')][_0x4c40('0x79')]},'json':!![]};return rp(_0x247084)[_0x4c40('0x1b')](function(_0x1ecb1b){_0x12c8b6[_0x4c40('0x7a')]=_0x1ecb1b;var _0x11db88={'messageId':_0x12c8b6[_0x4c40('0x77')]['refid'],'read':!![]};return _0x1972ee[_0x4c40('0x1c')](_0x11db88);});}else{return logger[_0x4c40('0x2b')](_0x4c40('0x2c'),_0x4c40('0x2d'),_0x4c40('0x73'),util[_0x4c40('0x2e')](_0x272b5c,{'showHidden':![],'depth':null}));}})[_0x4c40('0x1e')](function(_0x1b19bd){return logger[_0x4c40('0x2b')](_0x4c40('0x2c'),_0x4c40('0x2d'),_0x4c40('0x73'),util['inspect'](_0x1b19bd,{'showHidden':![],'depth':null}));});}else{return logger[_0x4c40('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4c40('0x2d'),_0x4c40('0x73'),'Token\x20not\x20received');}break;}}})[_0x4c40('0x7b')](function(){_0x33c395();});}else{_0x33c395();}}},'charset':_0x4c40('0x7c'),'collate':_0x4c40('0x7d')});};
\ No newline at end of file
index cdf0d9a..8b23e4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25a2=['SmsMessage','raw','then','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSmsMessage'];(function(_0x2e8798,_0x2aab4d){var _0x4ee41b=function(_0xb829b7){while(--_0xb829b7){_0x2e8798['push'](_0x2e8798['shift']());}};_0x4ee41b(++_0x2aab4d);}(_0x25a2,0x16f));var _0x225a=function(_0x12ee26,_0x50395e){_0x12ee26=_0x12ee26-0x0;var _0x137c85=_0x25a2[_0x12ee26];return _0x137c85;};'use strict';var _=require(_0x225a('0x0'));var util=require(_0x225a('0x1'));var moment=require(_0x225a('0x2'));var BPromise=require(_0x225a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x225a('0x4'));var db=require(_0x225a('0x5'))['db'];var utils=require(_0x225a('0x6'));var logger=require(_0x225a('0x7'))(_0x225a('0x8'));var config=require(_0x225a('0x9'));var jayson=require(_0x225a('0xa'));var client=jayson[_0x225a('0xb')][_0x225a('0xc')]({'port':0x232a});config[_0x225a('0xd')]=_[_0x225a('0xe')](config[_0x225a('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x225a('0xd')]));require(_0x225a('0xf'))[_0x225a('0x10')](socket);function respondWithRpcPromise(_0x2fc81f,_0x266cf3,_0x43a9d5){return new BPromise(function(_0x43497d,_0x30341b){return client[_0x225a('0x11')](_0x2fc81f,_0x43a9d5)['then'](function(_0x5508f2){logger[_0x225a('0x12')](_0x225a('0x13'),_0x266cf3,'request\x20sent');logger['debug'](_0x225a('0x14'),_0x266cf3,_0x225a('0x15'),JSON[_0x225a('0x16')](_0x5508f2));if(_0x5508f2['error']){if(_0x5508f2[_0x225a('0x17')][_0x225a('0x18')]===0x1f4){logger['error'](_0x225a('0x13'),_0x266cf3,_0x5508f2[_0x225a('0x17')][_0x225a('0x19')]);return _0x30341b(_0x5508f2['error'][_0x225a('0x19')]);}logger[_0x225a('0x17')](_0x225a('0x13'),_0x266cf3,_0x5508f2[_0x225a('0x17')][_0x225a('0x19')]);return _0x43497d(_0x5508f2[_0x225a('0x17')]['message']);}else{logger[_0x225a('0x12')]('SmsMessage,\x20%s,\x20%s',_0x266cf3,'request\x20sent');_0x43497d(_0x5508f2[_0x225a('0x1a')]['message']);}})[_0x225a('0x1b')](function(_0x1723bb){logger['error'](_0x225a('0x13'),_0x266cf3,_0x1723bb);_0x30341b(_0x1723bb);});});}exports[_0x225a('0x1c')]=function(_0x86e053){var _0x3aed82=this;return new Promise(function(_0x43f495,_0x45b7a1){return db[_0x225a('0x1d')]['create'](_0x86e053['body'],{'raw':_0x86e053['options']?_0x86e053['options'][_0x225a('0x1e')]===undefined?!![]:![]:!![]})[_0x225a('0x1f')](function(_0x494b22){logger[_0x225a('0x12')](_0x225a('0x1c'),_0x86e053);logger[_0x225a('0x20')]('CreateSmsMessage',_0x86e053,JSON[_0x225a('0x16')](_0x494b22));_0x43f495(_0x494b22);})['catch'](function(_0x5d3af1){logger[_0x225a('0x17')](_0x225a('0x1c'),_0x5d3af1[_0x225a('0x19')],_0x86e053);_0x45b7a1(_0x3aed82[_0x225a('0x17')](0x1f4,_0x5d3af1['message']));});});};
\ No newline at end of file
+var _0x4dba=['stringify','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','socket.io-emitter','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateSmsMessage','SmsMessage','body','options','then','debug'];(function(_0x28cbdc,_0x23a7f8){var _0x51a8d3=function(_0x317dd2){while(--_0x317dd2){_0x28cbdc['push'](_0x28cbdc['shift']());}};_0x51a8d3(++_0x23a7f8);}(_0x4dba,0x69));var _0xa4db=function(_0x3fc1fc,_0x23244b){_0x3fc1fc=_0x3fc1fc-0x0;var _0x55deb2=_0x4dba[_0x3fc1fc];return _0x55deb2;};'use strict';var _=require('lodash');var util=require(_0xa4db('0x0'));var moment=require(_0xa4db('0x1'));var BPromise=require('bluebird');var rs=require(_0xa4db('0x2'));var fs=require('fs');var Redis=require(_0xa4db('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa4db('0x4'));var config=require(_0xa4db('0x5'));var jayson=require(_0xa4db('0x6'));var client=jayson[_0xa4db('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa4db('0x8'))(new Redis(config['redis']));require(_0xa4db('0x9'))[_0xa4db('0xa')](socket);function respondWithRpcPromise(_0x330c8f,_0x41214b,_0x474a09){return new BPromise(function(_0x4daddd,_0x32a2ee){return client[_0xa4db('0xb')](_0x330c8f,_0x474a09)['then'](function(_0x43cb6a){logger[_0xa4db('0xc')](_0xa4db('0xd'),_0x41214b,_0xa4db('0xe'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x41214b,_0xa4db('0xe'),JSON['stringify'](_0x43cb6a));if(_0x43cb6a[_0xa4db('0xf')]){if(_0x43cb6a[_0xa4db('0xf')][_0xa4db('0x10')]===0x1f4){logger[_0xa4db('0xf')](_0xa4db('0xd'),_0x41214b,_0x43cb6a[_0xa4db('0xf')][_0xa4db('0x11')]);return _0x32a2ee(_0x43cb6a[_0xa4db('0xf')]['message']);}logger[_0xa4db('0xf')](_0xa4db('0xd'),_0x41214b,_0x43cb6a['error'][_0xa4db('0x11')]);return _0x4daddd(_0x43cb6a[_0xa4db('0xf')][_0xa4db('0x11')]);}else{logger[_0xa4db('0xc')](_0xa4db('0xd'),_0x41214b,_0xa4db('0xe'));_0x4daddd(_0x43cb6a['result'][_0xa4db('0x11')]);}})[_0xa4db('0x12')](function(_0x3354f4){logger[_0xa4db('0xf')](_0xa4db('0xd'),_0x41214b,_0x3354f4);_0x32a2ee(_0x3354f4);});});}exports[_0xa4db('0x13')]=function(_0x2d1627){var _0x1c8ea9=this;return new Promise(function(_0x4af502,_0x2a262d){return db[_0xa4db('0x14')]['create'](_0x2d1627[_0xa4db('0x15')],{'raw':_0x2d1627[_0xa4db('0x16')]?_0x2d1627['options']['raw']===undefined?!![]:![]:!![]})[_0xa4db('0x17')](function(_0x28bf69){logger[_0xa4db('0xc')](_0xa4db('0x13'),_0x2d1627);logger[_0xa4db('0x18')](_0xa4db('0x13'),_0x2d1627,JSON[_0xa4db('0x19')](_0x28bf69));_0x4af502(_0x28bf69);})[_0xa4db('0x12')](function(_0x27caa5){logger['error'](_0xa4db('0x13'),_0x27caa5[_0xa4db('0x11')],_0x2d1627);_0x2a262d(_0x1c8ea9['error'](0x1f4,_0x27caa5[_0xa4db('0x11')]));});});};
\ No newline at end of file
index a3d01d0..e7d63c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f8d=['update','emit','removeListener','register','./smsMessage.events','save'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x2f8d,0xa0));var _0xd2f8=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x2f8d[_0xb0f7c3];return _0x28ea68;};'use strict';var SmsMessageEvents=require(_0xd2f8('0x0'));var events=[_0xd2f8('0x1'),'remove',_0xd2f8('0x2')];function createListener(_0x5790d1,_0x593529){return function(_0x3d3370){_0x593529[_0xd2f8('0x3')](_0x5790d1,_0x3d3370);};}function removeListener(_0x2e509a,_0x220430){return function(){SmsMessageEvents[_0xd2f8('0x4')](_0x2e509a,_0x220430);};}exports[_0xd2f8('0x5')]=function(_0x1ef5e){for(var _0x1e5bc4=0x0,_0x126f7e=events['length'];_0x1e5bc4<_0x126f7e;_0x1e5bc4++){var _0x5c0074=events[_0x1e5bc4];var _0x4ec4d2=createListener('smsMessage:'+_0x5c0074,_0x1ef5e);SmsMessageEvents['on'](_0x5c0074,_0x4ec4d2);}};
\ No newline at end of file
+var _0x2731=['removeListener','register','length','smsMessage:','save','remove','emit'];(function(_0x3236be,_0x47eb9b){var _0x40a904=function(_0x14301c){while(--_0x14301c){_0x3236be['push'](_0x3236be['shift']());}};_0x40a904(++_0x47eb9b);}(_0x2731,0x17e));var _0x1273=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2731[_0x17d9e3];return _0x14192d;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x1273('0x0'),_0x1273('0x1'),'update'];function createListener(_0xe786b9,_0x57ee4c){return function(_0x34f9c1){_0x57ee4c[_0x1273('0x2')](_0xe786b9,_0x34f9c1);};}function removeListener(_0x55226d,_0x32b7ab){return function(){SmsMessageEvents[_0x1273('0x3')](_0x55226d,_0x32b7ab);};}exports[_0x1273('0x4')]=function(_0x4de85c){for(var _0x568641=0x0,_0x5eacaa=events[_0x1273('0x5')];_0x568641<_0x5eacaa;_0x568641++){var _0x1d09ce=events[_0x568641];var _0x5cca86=createListener(_0x1273('0x6')+_0x1d09ce,_0x4de85c);SmsMessageEvents['on'](_0x1d09ce,_0x5cca86);}};
\ No newline at end of file
index 29bf614..192b97a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75a7=['create','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post'];(function(_0x36d8b3,_0xf7a02d){var _0x5731b9=function(_0x14d1ce){while(--_0x14d1ce){_0x36d8b3['push'](_0x36d8b3['shift']());}};_0x5731b9(++_0xf7a02d);}(_0x75a7,0x17e));var _0x775a=function(_0x18dedf,_0x36b35d){_0x18dedf=_0x18dedf-0x0;var _0x1637f9=_0x75a7[_0x18dedf];return _0x1637f9;};'use strict';var multer=require('multer');var util=require(_0x775a('0x0'));var path=require(_0x775a('0x1'));var timeout=require(_0x775a('0x2'));var express=require(_0x775a('0x3'));var router=express[_0x775a('0x4')]();var fs_extra=require(_0x775a('0x5'));var auth=require(_0x775a('0x6'));var interaction=require(_0x775a('0x7'));var config=require(_0x775a('0x8'));var controller=require('./smsQueue.controller');router[_0x775a('0x9')]('/',auth['isAuthenticated'](),controller[_0x775a('0xa')]);router[_0x775a('0x9')](_0x775a('0xb'),auth[_0x775a('0xc')](),controller['describe']);router[_0x775a('0x9')](_0x775a('0xd'),auth[_0x775a('0xc')](),controller[_0x775a('0xe')]);router['get'](_0x775a('0xf'),auth[_0x775a('0xc')](),controller['getMembers']);router[_0x775a('0x9')](_0x775a('0x10'),auth['isAuthenticated'](),controller[_0x775a('0x11')]);router[_0x775a('0x9')](_0x775a('0x12'),auth['isAuthenticated'](),controller[_0x775a('0x13')]);router[_0x775a('0x14')]('/',auth[_0x775a('0xc')](),controller[_0x775a('0x15')]);router['post'](_0x775a('0x10'),auth[_0x775a('0xc')](),controller[_0x775a('0x16')]);router[_0x775a('0x14')](_0x775a('0x12'),auth[_0x775a('0xc')](),controller[_0x775a('0x17')]);router[_0x775a('0x18')](_0x775a('0xd'),auth[_0x775a('0xc')](),controller[_0x775a('0x19')]);router['delete'](_0x775a('0xd'),auth[_0x775a('0xc')](),controller[_0x775a('0x1a')]);router[_0x775a('0x1b')](_0x775a('0x10'),auth[_0x775a('0xc')](),controller[_0x775a('0x1c')]);router['delete']('/:id/users',auth[_0x775a('0xc')](),controller[_0x775a('0x1d')]);module[_0x775a('0x1e')]=router;
\ No newline at end of file
+var _0xb050=['destroy','removeTeams','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','post','create','/:id/users','addAgents','put','update','delete'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0xb050,0xac));var _0x0b05=function(_0xee75f8,_0x31d91b){_0xee75f8=_0xee75f8-0x0;var _0x5dcc14=_0xb050[_0xee75f8];return _0x5dcc14;};'use strict';var multer=require(_0x0b05('0x0'));var util=require(_0x0b05('0x1'));var path=require(_0x0b05('0x2'));var timeout=require('connect-timeout');var express=require(_0x0b05('0x3'));var router=express[_0x0b05('0x4')]();var fs_extra=require(_0x0b05('0x5'));var auth=require(_0x0b05('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0b05('0x7'));var controller=require('./smsQueue.controller');router[_0x0b05('0x8')]('/',auth[_0x0b05('0x9')](),controller['index']);router[_0x0b05('0x8')](_0x0b05('0xa'),auth[_0x0b05('0x9')](),controller['describe']);router[_0x0b05('0x8')](_0x0b05('0xb'),auth['isAuthenticated'](),controller[_0x0b05('0xc')]);router['get'](_0x0b05('0xd'),auth[_0x0b05('0x9')](),controller[_0x0b05('0xe')]);router[_0x0b05('0x8')](_0x0b05('0xf'),auth[_0x0b05('0x9')](),controller[_0x0b05('0x10')]);router[_0x0b05('0x8')]('/:id/users',auth[_0x0b05('0x9')](),controller['getAgents']);router[_0x0b05('0x11')]('/',auth[_0x0b05('0x9')](),controller[_0x0b05('0x12')]);router[_0x0b05('0x11')](_0x0b05('0xf'),auth[_0x0b05('0x9')](),controller['addTeams']);router[_0x0b05('0x11')](_0x0b05('0x13'),auth[_0x0b05('0x9')](),controller[_0x0b05('0x14')]);router[_0x0b05('0x15')](_0x0b05('0xb'),auth['isAuthenticated'](),controller[_0x0b05('0x16')]);router[_0x0b05('0x17')](_0x0b05('0xb'),auth[_0x0b05('0x9')](),controller[_0x0b05('0x18')]);router[_0x0b05('0x17')](_0x0b05('0xf'),auth['isAuthenticated'](),controller[_0x0b05('0x19')]);router['delete']('/:id/users',auth[_0x0b05('0x9')](),controller[_0x0b05('0x1a')]);module[_0x0b05('0x1b')]=router;
\ No newline at end of file
index 2364643..a702310 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a5d=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x346a05,_0x82ac79){var _0x5570ee=function(_0x13ca1e){while(--_0x13ca1e){_0x346a05['push'](_0x346a05['shift']());}};_0x5570ee(++_0x82ac79);}(_0x2a5d,0x1b8));var _0xd2a5=function(_0x53ad58,_0x3fb489){_0x53ad58=_0x53ad58-0x0;var _0x554b03=_0x2a5d[_0x53ad58];return _0x554b03;};'use strict';var Sequelize=require(_0xd2a5('0x0'));module[_0xd2a5('0x1')]={'name':{'type':Sequelize[_0xd2a5('0x2')],'unique':_0xd2a5('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd2a5('0x2')]},'timeout':{'type':Sequelize[_0xd2a5('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd2a5('0x5')](_0xd2a5('0x6'),_0xd2a5('0x7'),_0xd2a5('0x8'))}};
\ No newline at end of file
+var _0x04dd=['ENUM','beepall','roundrobin','sequelize','STRING','name','INTEGER'];(function(_0x4c4247,_0x2d967a){var _0x71958c=function(_0x3b069f){while(--_0x3b069f){_0x4c4247['push'](_0x4c4247['shift']());}};_0x71958c(++_0x2d967a);}(_0x04dd,0x1c3));var _0xd04d=function(_0x34b245,_0xfe65b4){_0x34b245=_0x34b245-0x0;var _0x3a8984=_0x04dd[_0x34b245];return _0x3a8984;};'use strict';var Sequelize=require(_0xd04d('0x0'));module['exports']={'name':{'type':Sequelize[_0xd04d('0x1')],'unique':_0xd04d('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd04d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd04d('0x4')]('rrmemory',_0xd04d('0x5'),_0xd04d('0x6'))}};
\ No newline at end of file
index e8b1b0f..e2131c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08af=['addTeams','ids','User','Agents','online','voicePause','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','field','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','all','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','SmsQueues','end','error','name','map','SmsQueue','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','describe','getMembers','findOne','UserSmsQueue','rawAttributes','order','SmsQueueId','options','findAndCountAll','UserId','agent','format','smsPause','createdAt','updatedAt','Team','getTeams'];(function(_0x2c372a,_0x3d2df3){var _0x4b093c=function(_0x3d25d0){while(--_0x3d25d0){_0x2c372a['push'](_0x2c372a['shift']());}};_0x4b093c(++_0x3d2df3);}(_0x08af,0x1c2));var _0xf08a=function(_0x482ddd,_0x3e1bd2){_0x482ddd=_0x482ddd-0x0;var _0x5c4a0f=_0x08af[_0x482ddd];return _0x5c4a0f;};'use strict';var emlformat=require(_0xf08a('0x0'));var rimraf=require(_0xf08a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf08a('0x2'));var rp=require('request-promise');var moment=require(_0xf08a('0x3'));var BPromise=require(_0xf08a('0x4'));var Mustache=require(_0xf08a('0x5'));var util=require(_0xf08a('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf08a('0x7'));var fs=require('fs');var fs_extra=require(_0xf08a('0x8'));var _=require(_0xf08a('0x9'));var squel=require(_0xf08a('0xa'));var crypto=require(_0xf08a('0xb'));var jsforce=require(_0xf08a('0xc'));var deskjs=require(_0xf08a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf08a('0xe'));var Papa=require(_0xf08a('0xf'));var Redis=require(_0xf08a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf08a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf08a('0x12'));var utils=require(_0xf08a('0x13'));var config=require(_0xf08a('0x14'));var licenseUtil=require(_0xf08a('0x15'));var db=require(_0xf08a('0x16'))['db'];config[_0xf08a('0x17')]=_['defaults'](config['redis'],{'host':_0xf08a('0x18'),'port':0x18eb});var socket=require(_0xf08a('0x19'))(new Redis(config[_0xf08a('0x17')]));require(_0xf08a('0x1a'))['register'](socket);function respondWithStatusCode(_0x1a5955,_0x1da676){_0x1da676=_0x1da676||0xcc;return function(_0x24ca70){if(_0x24ca70){return _0x1a5955[_0xf08a('0x1b')](_0x1da676);}return _0x1a5955['status'](_0x1da676)['end']();};}function respondWithResult(_0x2f5c6a,_0x338313){_0x338313=_0x338313||0xc8;return function(_0x48fa7b){if(_0x48fa7b){return _0x2f5c6a[_0xf08a('0x1c')](_0x338313)[_0xf08a('0x1d')](_0x48fa7b);}};}function respondWithFilteredResult(_0x3253e3,_0x4ea043){return function(_0x2dce66){if(_0x2dce66){var _0x7fe64=typeof _0x4ea043['offset']===_0xf08a('0x1e')&&typeof _0x4ea043[_0xf08a('0x1f')]==='undefined';var _0x2b7a7e=_0x2dce66[_0xf08a('0x20')];var _0x1e2f01=_0x7fe64?0x0:_0x4ea043['offset'];var _0x5ff7ad=_0x7fe64?_0x2dce66[_0xf08a('0x20')]:_0x4ea043[_0xf08a('0x21')]+_0x4ea043[_0xf08a('0x1f')];var _0x537080;if(_0x5ff7ad>=_0x2b7a7e){_0x5ff7ad=_0x2b7a7e;_0x537080=0xc8;}else{_0x537080=0xce;}_0x3253e3['status'](_0x537080);return _0x3253e3[_0xf08a('0x22')](_0xf08a('0x23'),_0x1e2f01+'-'+_0x5ff7ad+'/'+_0x2b7a7e)[_0xf08a('0x1d')](_0x2dce66);}return null;};}function patchUpdates(_0x3dccad){return function(_0x181185){try{jsonpatch[_0xf08a('0x24')](_0x181185,_0x3dccad,!![]);}catch(_0x1617d6){return BPromise[_0xf08a('0x25')](_0x1617d6);}return _0x181185[_0xf08a('0x26')]();};}function saveUpdates(_0x5b9ec5,_0x760485){return function(_0x117319){if(_0x117319){return _0x117319[_0xf08a('0x27')](_0x5b9ec5)['then'](function(_0x145b95){return _0x145b95;});}return null;};}function removeEntity(_0x4ee7fd,_0x37b8ef){return function(_0x539fba){if(_0x539fba){return _0x539fba[_0xf08a('0x28')]()[_0xf08a('0x29')](function(){var _0x1fb88a=_0x539fba['get']({'plain':!![]});var _0x5de8be=_0xf08a('0x2a');return db['UserProfileResource'][_0xf08a('0x28')]({'where':{'type':_0x5de8be,'resourceId':_0x1fb88a['id']}})['then'](function(){return _0x539fba;});})[_0xf08a('0x29')](function(){_0x4ee7fd[_0xf08a('0x1c')](0xcc)[_0xf08a('0x2b')]();});}};}function handleEntityNotFound(_0x3f4e13,_0x5d0217){return function(_0x218057){if(!_0x218057){_0x3f4e13[_0xf08a('0x1b')](0x194);}return _0x218057;};}function handleError(_0x57b60d,_0x7b42ca){_0x7b42ca=_0x7b42ca||0x1f4;return function(_0x3e6b23){logger[_0xf08a('0x2c')](_0x3e6b23['stack']);if(_0x3e6b23[_0xf08a('0x2d')]){delete _0x3e6b23[_0xf08a('0x2d')];}_0x57b60d[_0xf08a('0x1c')](_0x7b42ca)['send'](_0x3e6b23);};}exports['index']=function(_0x4ceba3,_0x3f964a){var _0x27cfe8={},_0x198e6={},_0xc9f7b1={'count':0x0,'rows':[]};var _0xaf5948=_[_0xf08a('0x2e')](db[_0xf08a('0x2f')]['rawAttributes'],function(_0x26e3df){return{'name':_0x26e3df[_0xf08a('0x30')],'type':_0x26e3df[_0xf08a('0x31')][_0xf08a('0x32')]};});_0x198e6[_0xf08a('0x33')]=_[_0xf08a('0x2e')](_0xaf5948,_0xf08a('0x2d'));_0x198e6['query']=_[_0xf08a('0x34')](_0x4ceba3[_0xf08a('0x35')]);_0x198e6['filters']=_[_0xf08a('0x36')](_0x198e6[_0xf08a('0x33')],_0x198e6[_0xf08a('0x35')]);_0x27cfe8[_0xf08a('0x37')]=_[_0xf08a('0x36')](_0x198e6[_0xf08a('0x33')],qs['fields'](_0x4ceba3[_0xf08a('0x35')][_0xf08a('0x38')]));_0x27cfe8[_0xf08a('0x37')]=_0x27cfe8[_0xf08a('0x37')][_0xf08a('0x39')]?_0x27cfe8[_0xf08a('0x37')]:_0x198e6[_0xf08a('0x33')];if(!_0x4ceba3[_0xf08a('0x35')][_0xf08a('0x3a')](_0xf08a('0x3b'))){_0x27cfe8[_0xf08a('0x1f')]=qs['limit'](_0x4ceba3[_0xf08a('0x35')][_0xf08a('0x1f')]);_0x27cfe8['offset']=qs[_0xf08a('0x21')](_0x4ceba3[_0xf08a('0x35')]['offset']);}_0x27cfe8['order']=qs[_0xf08a('0x3c')](_0x4ceba3[_0xf08a('0x35')][_0xf08a('0x3c')]);_0x27cfe8['where']=qs[_0xf08a('0x3d')](_[_0xf08a('0x3e')](_0x4ceba3[_0xf08a('0x35')],_0x198e6[_0xf08a('0x3d')]),_0xaf5948);if(_0x4ceba3[_0xf08a('0x35')][_0xf08a('0x3f')]){_0x27cfe8[_0xf08a('0x40')]=_[_0xf08a('0x41')](_0x27cfe8[_0xf08a('0x40')],{'$or':_[_0xf08a('0x2e')](_0xaf5948,function(_0x1e6f51){if(_0x1e6f51[_0xf08a('0x31')]!==_0xf08a('0x42')){var _0x3c990d={};_0x3c990d[_0x1e6f51[_0xf08a('0x2d')]]={'$like':'%'+_0x4ceba3['query'][_0xf08a('0x3f')]+'%'};return _0x3c990d;}})});}_0x27cfe8=_[_0xf08a('0x41')]({},_0x27cfe8,_0x4ceba3['options']);var _0x17f89e={'where':_0x27cfe8[_0xf08a('0x40')]};return db[_0xf08a('0x2f')][_0xf08a('0x20')](_0x17f89e)['then'](function(_0xddbe7e){_0xc9f7b1['count']=_0xddbe7e;if(_0x4ceba3[_0xf08a('0x35')][_0xf08a('0x43')]){_0x27cfe8[_0xf08a('0x44')]=[{'all':!![]}];}return db[_0xf08a('0x2f')][_0xf08a('0x45')](_0x27cfe8);})[_0xf08a('0x29')](function(_0x57d835){_0xc9f7b1[_0xf08a('0x46')]=_0x57d835;return _0xc9f7b1;})['then'](respondWithFilteredResult(_0x3f964a,_0x27cfe8))['catch'](handleError(_0x3f964a,null));};exports[_0xf08a('0x47')]=function(_0x109e00,_0x5b2ec1){var _0x449e3={'raw':!![],'where':{'id':_0x109e00[_0xf08a('0x48')]['id']}},_0x7d2da6={};_0x7d2da6[_0xf08a('0x33')]=_['keys'](db['SmsQueue']['rawAttributes']);_0x7d2da6[_0xf08a('0x35')]=_[_0xf08a('0x34')](_0x109e00[_0xf08a('0x35')]);_0x7d2da6[_0xf08a('0x3d')]=_['intersection'](_0x7d2da6[_0xf08a('0x33')],_0x7d2da6[_0xf08a('0x35')]);_0x449e3['attributes']=_[_0xf08a('0x36')](_0x7d2da6[_0xf08a('0x33')],qs[_0xf08a('0x38')](_0x109e00[_0xf08a('0x35')][_0xf08a('0x38')]));_0x449e3[_0xf08a('0x37')]=_0x449e3[_0xf08a('0x37')]['length']?_0x449e3['attributes']:_0x7d2da6['model'];if(_0x109e00['query'][_0xf08a('0x43')]){_0x449e3[_0xf08a('0x44')]=[{'all':!![]}];}_0x449e3=_['merge']({},_0x449e3,_0x109e00['options']);return db[_0xf08a('0x2f')][_0xf08a('0x49')](_0x449e3)['then'](handleEntityNotFound(_0x5b2ec1,null))[_0xf08a('0x29')](respondWithResult(_0x5b2ec1,null))['catch'](handleError(_0x5b2ec1,null));};exports[_0xf08a('0x4a')]=function(_0x1272fa,_0x5f3ebd){return db[_0xf08a('0x2f')]['create'](_0x1272fa[_0xf08a('0x4b')],{})[_0xf08a('0x29')](function(_0x2be87e){var _0x9f3547=_0x1272fa[_0xf08a('0x4c')][_0xf08a('0x4d')]({'plain':!![]});if(!_0x9f3547)throw new Error(_0xf08a('0x4e'));if(_0x9f3547[_0xf08a('0x4f')]===_0xf08a('0x4c')){var _0x5cc7df=_0x2be87e[_0xf08a('0x4d')]({'plain':!![]});var _0x34062f=_0xf08a('0x2a');return db[_0xf08a('0x50')][_0xf08a('0x49')]({'where':{'name':_0x34062f,'userProfileId':_0x9f3547[_0xf08a('0x51')]},'raw':!![]})[_0xf08a('0x29')](function(_0x27e97a){if(_0x27e97a&&_0x27e97a[_0xf08a('0x52')]===0x0){return db[_0xf08a('0x53')][_0xf08a('0x4a')]({'name':_0x5cc7df['name'],'resourceId':_0x5cc7df['id'],'type':_0x27e97a['name'],'sectionId':_0x27e97a['id']},{})[_0xf08a('0x29')](function(){return _0x2be87e;});}else{return _0x2be87e;}})[_0xf08a('0x54')](function(_0x329c23){logger[_0xf08a('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x329c23);throw _0x329c23;});}return _0x2be87e;})[_0xf08a('0x29')](respondWithResult(_0x5f3ebd,0xc9))[_0xf08a('0x54')](handleError(_0x5f3ebd,null));};exports['update']=function(_0x227ccd,_0x398bc6){if(_0x227ccd[_0xf08a('0x4b')]['id']){delete _0x227ccd[_0xf08a('0x4b')]['id'];}return db[_0xf08a('0x2f')][_0xf08a('0x49')]({'where':{'id':_0x227ccd[_0xf08a('0x48')]['id']}})[_0xf08a('0x29')](handleEntityNotFound(_0x398bc6,null))['then'](saveUpdates(_0x227ccd[_0xf08a('0x4b')],null))[_0xf08a('0x29')](respondWithResult(_0x398bc6,null))[_0xf08a('0x54')](handleError(_0x398bc6,null));};exports[_0xf08a('0x28')]=function(_0x56ab6c,_0x3ca800){return db[_0xf08a('0x2f')][_0xf08a('0x49')]({'where':{'id':_0x56ab6c[_0xf08a('0x48')]['id']}})[_0xf08a('0x29')](handleEntityNotFound(_0x3ca800,null))[_0xf08a('0x29')](removeEntity(_0x3ca800,null))[_0xf08a('0x54')](handleError(_0x3ca800,null));};exports[_0xf08a('0x55')]=function(_0x2b3af1,_0x3f888b){return db['SmsQueue'][_0xf08a('0x55')]()[_0xf08a('0x29')](respondWithResult(_0x3f888b,null))['catch'](handleError(_0x3f888b,null));};exports[_0xf08a('0x56')]=function(_0x529bb9,_0x5a9b25,_0x340668){var _0x4e8732={'raw':!![],'where':{}},_0x84e064={},_0x118a7e;return db[_0xf08a('0x2f')][_0xf08a('0x57')]({'where':{'id':_0x529bb9[_0xf08a('0x48')]['id']}})['then'](handleEntityNotFound(_0x5a9b25,null))[_0xf08a('0x29')](function(_0x3ed9c7){if(_0x3ed9c7){_0x118a7e=_0x3ed9c7[_0xf08a('0x4d')]({'plain':!![]});_0x84e064['model']=_['keys'](db[_0xf08a('0x58')][_0xf08a('0x59')]);_0x84e064[_0xf08a('0x35')]=_[_0xf08a('0x34')](_0x529bb9['query']);_0x84e064[_0xf08a('0x3d')]=_[_0xf08a('0x36')](_0x84e064[_0xf08a('0x33')],_0x84e064[_0xf08a('0x35')]);_0x4e8732[_0xf08a('0x37')]=_[_0xf08a('0x36')](_0x84e064['model'],qs[_0xf08a('0x38')](_0x529bb9[_0xf08a('0x35')][_0xf08a('0x38')]));_0x4e8732['attributes']=_0x4e8732[_0xf08a('0x37')][_0xf08a('0x39')]?_0x4e8732['attributes']:_0x84e064[_0xf08a('0x33')];if(!_0x529bb9[_0xf08a('0x35')]['hasOwnProperty'](_0xf08a('0x3b'))){_0x4e8732[_0xf08a('0x1f')]=qs[_0xf08a('0x1f')](_0x529bb9[_0xf08a('0x35')][_0xf08a('0x1f')]);_0x4e8732['offset']=qs[_0xf08a('0x21')](_0x529bb9[_0xf08a('0x35')][_0xf08a('0x21')]);}_0x4e8732[_0xf08a('0x5a')]=qs['sort'](_0x529bb9['query'][_0xf08a('0x3c')]);_0x4e8732[_0xf08a('0x40')]=qs[_0xf08a('0x3d')](_['pick'](_0x529bb9['query'],_0x84e064[_0xf08a('0x3d')]));_0x4e8732[_0xf08a('0x40')][_0xf08a('0x5b')]=_0x3ed9c7['id'];if(_0x529bb9[_0xf08a('0x35')][_0xf08a('0x3f')]){_0x4e8732[_0xf08a('0x40')]=_['merge'](_0x4e8732['where'],{'$or':_[_0xf08a('0x2e')](_0x4e8732[_0xf08a('0x37')],function(_0x30dcfc){var _0x49f6e2={};_0x49f6e2[_0x30dcfc]={'$like':'%'+_0x529bb9[_0xf08a('0x35')]['filter']+'%'};return _0x49f6e2;})});}_0x4e8732=_[_0xf08a('0x41')]({},_0x4e8732,_0x529bb9[_0xf08a('0x5c')]);return db[_0xf08a('0x58')][_0xf08a('0x45')](_0x4e8732);}})[_0xf08a('0x29')](function(_0x36c516){if(_0x36c516){return db['User'][_0xf08a('0x5d')]({'where':{'id':_[_0xf08a('0x2e')](_0x36c516,_0xf08a('0x5e')),'role':_0xf08a('0x5f')},'attributes':['id',_0xf08a('0x2d'),'smsPause','updatedAt','createdAt']});}})[_0xf08a('0x29')](function(_0x3590b8){if(_0x3590b8){return{'count':_0x3590b8[_0xf08a('0x20')],'rows':_[_0xf08a('0x2e')](_0x3590b8[_0xf08a('0x46')],function(_0x5cebed){return{'membername':_0x5cebed['name'],'UserId':_0x5cebed['id'],'queue_name':_0x118a7e[_0xf08a('0x2d')],'SmsQueueId':_0x118a7e['id'],'interface':util[_0xf08a('0x60')]('%s/%s','SIP',_0x5cebed[_0xf08a('0x2d')]),'penalty':0x0,'paused':_0x5cebed[_0xf08a('0x61')],'createdAt':_0x5cebed[_0xf08a('0x62')],'updatedAt':_0x5cebed[_0xf08a('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf08a('0x29')](respondWithFilteredResult(_0x5a9b25,_0x4e8732))[_0xf08a('0x54')](handleError(_0x5a9b25,null));};exports['getTeams']=function(_0x3595e2,_0x4153bd,_0x554b95){var _0x11624d={};var _0x1df469={};var _0x5546e1;var _0x4567a9;return db[_0xf08a('0x2f')]['findOne']({'where':{'id':_0x3595e2[_0xf08a('0x48')]['id']}})['then'](handleEntityNotFound(_0x4153bd,null))['then'](function(_0x5d5fbf){if(_0x5d5fbf){_0x5546e1=_0x5d5fbf;_0x1df469['model']=_[_0xf08a('0x34')](db[_0xf08a('0x64')][_0xf08a('0x59')]);_0x1df469[_0xf08a('0x35')]=_['keys'](_0x3595e2[_0xf08a('0x35')]);_0x1df469[_0xf08a('0x3d')]=_[_0xf08a('0x36')](_0x1df469[_0xf08a('0x33')],_0x1df469[_0xf08a('0x35')]);_0x11624d[_0xf08a('0x37')]=_[_0xf08a('0x36')](_0x1df469[_0xf08a('0x33')],qs[_0xf08a('0x38')](_0x3595e2[_0xf08a('0x35')]['fields']));_0x11624d[_0xf08a('0x37')]=_0x11624d['attributes'][_0xf08a('0x39')]?_0x11624d[_0xf08a('0x37')]:_0x1df469[_0xf08a('0x33')];_0x11624d[_0xf08a('0x5a')]=qs['sort'](_0x3595e2[_0xf08a('0x35')][_0xf08a('0x3c')]);_0x11624d['where']=qs[_0xf08a('0x3d')](_[_0xf08a('0x3e')](_0x3595e2[_0xf08a('0x35')],_0x1df469[_0xf08a('0x3d')]));if(_0x3595e2['query'][_0xf08a('0x3f')]){_0x11624d[_0xf08a('0x40')]=_[_0xf08a('0x41')](_0x11624d[_0xf08a('0x40')],{'$or':_[_0xf08a('0x2e')](_0x11624d[_0xf08a('0x37')],function(_0x3f4580){var _0x4f8388={};_0x4f8388[_0x3f4580]={'$like':'%'+_0x3595e2[_0xf08a('0x35')][_0xf08a('0x3f')]+'%'};return _0x4f8388;})});}_0x11624d=_[_0xf08a('0x41')]({},_0x11624d,_0x3595e2[_0xf08a('0x5c')]);return _0x5546e1[_0xf08a('0x65')](_0x11624d);}})[_0xf08a('0x29')](function(_0x510266){if(_0x510266){_0x4567a9=_0x510266[_0xf08a('0x39')];if(!_0x3595e2[_0xf08a('0x35')]['hasOwnProperty'](_0xf08a('0x3b'))){_0x11624d[_0xf08a('0x1f')]=qs[_0xf08a('0x1f')](_0x3595e2[_0xf08a('0x35')][_0xf08a('0x1f')]);_0x11624d[_0xf08a('0x21')]=qs['offset'](_0x3595e2[_0xf08a('0x35')][_0xf08a('0x21')]);}return _0x5546e1[_0xf08a('0x65')](_0x11624d);}})[_0xf08a('0x29')](function(_0x287cd0){if(_0x287cd0){return _0x287cd0?{'count':_0x4567a9,'rows':_0x287cd0}:null;}})[_0xf08a('0x29')](respondWithResult(_0x4153bd,null))[_0xf08a('0x54')](handleError(_0x4153bd,null));};exports[_0xf08a('0x66')]=function(_0x598a5f,_0x126b00,_0xd1ee65){var _0x10c4ab=_0x598a5f[_0xf08a('0x4b')][_0xf08a('0x67')];return db[_0xf08a('0x64')][_0xf08a('0x45')]({'where':{'id':_0x10c4ab},'attributes':['id'],'include':[{'model':db[_0xf08a('0x68')],'as':_0xf08a('0x69'),'attributes':['id',_0xf08a('0x2d'),_0xf08a('0x6a'),_0xf08a('0x6b'),'interface'],'raw':!![]}]})['then'](function(_0xddd018){if(_0xddd018){var _0x2dd8f6=_[_0xf08a('0x6c')](_0xddd018,function(_0x10438d){var _0x25eaaa=_0x10438d[_0xf08a('0x4d')]({'plain':!![]});return _0x25eaaa[_0xf08a('0x69')];});return db[_0xf08a('0x2f')][_0xf08a('0x49')]({'where':{'id':_0x598a5f['params']['id']}})[_0xf08a('0x29')](function(_0x42b9b6){return db[_0xf08a('0x6d')][_0xf08a('0x6e')](function(_0x24b6b0){return _0x42b9b6[_0xf08a('0x66')](_0x10c4ab,{'transaction':_0x24b6b0})['then'](function(){return BPromise['each'](_0x2dd8f6,function(_0x4814f4){return db[_0xf08a('0x58')][_0xf08a('0x6f')]({'where':{'UserId':_0x4814f4['id'],'SmsQueueId':_0x598a5f[_0xf08a('0x48')]['id']},'transaction':_0x24b6b0});});})['then'](function(){_0x2dd8f6[_0xf08a('0x70')](function(_0x26181e){socket[_0xf08a('0x71')](_0xf08a('0x72'),{'UserId':_0x26181e['id'],'SmsQueueId':_0x42b9b6['id']});});});});});}})[_0xf08a('0x29')](respondWithStatusCode(_0x126b00,null))['catch'](handleError(_0x126b00,null));};exports[_0xf08a('0x73')]=function(_0x83015e,_0x3eefa5,_0x7f151){return db['Team'][_0xf08a('0x45')]({'where':{'id':_0x83015e[_0xf08a('0x35')][_0xf08a('0x67')]},'attributes':['id'],'include':[{'model':db[_0xf08a('0x68')],'as':_0xf08a('0x69'),'attributes':['id'],'raw':!![]}]})[_0xf08a('0x29')](handleEntityNotFound(_0x3eefa5,null))['then'](function(_0x4469c1){var _0x570b97=_[_0xf08a('0x2e')](_0x4469c1,'id');var _0x430129=[];var _0x1510ea=[];var _0x5ccd1f=squel[_0xf08a('0x74')]();_0x5ccd1f[_0xf08a('0x75')]('tq.TeamId')[_0xf08a('0x76')](_0xf08a('0x77'),'tq')[_0xf08a('0x78')](_0xf08a('0x79'),'ut',_0xf08a('0x7a'))[_0xf08a('0x40')]('SmsQueueId\x20=\x20?',_0x83015e[_0xf08a('0x48')]['id']);for(var _0xf18eff=0x0;_0xf18eff<_0x4469c1[_0xf08a('0x39')];_0xf18eff+=0x1){let _0x4e675e=_0x4469c1[_0xf18eff];for(var _0x403b6c=0x0;_0x403b6c<_0x4e675e[_0xf08a('0x69')][_0xf08a('0x39')];_0x403b6c+=0x1){let _0x2c224f=_0x4e675e['Agents'][_0x403b6c];var _0x59adca=_0x5ccd1f['clone']();_0x59adca[_0xf08a('0x40')](_0xf08a('0x7b'),_0x2c224f['id']);_0x1510ea['push'](db['sequelize']['query'](_0x59adca[_0xf08a('0x7c')](),{'type':db[_0xf08a('0x6d')][_0xf08a('0x7d')][_0xf08a('0x7e')]})[_0xf08a('0x29')](function(_0xd3d5e2){if(_0xd3d5e2['length']===0x1){return _0x2c224f['id'];}else{var _0x1a9755=_['every'](_[_0xf08a('0x2e')](_0xd3d5e2,'TeamId'),function(_0x36d205){return _['includes'](_0x570b97,_0x36d205);});if(_0x1a9755){return _0x2c224f['id'];}}}));}}return BPromise[_0xf08a('0x7f')](_0x1510ea)[_0xf08a('0x29')](function(_0x23ad91){_0x430129=_(_0x430129)['union'](_0x23ad91)[_0xf08a('0x80')]()[_0xf08a('0x81')]();return db[_0xf08a('0x2f')][_0xf08a('0x49')]({'where':{'id':_0x83015e[_0xf08a('0x48')]['id']}})[_0xf08a('0x29')](function(_0x1842cd){return db[_0xf08a('0x6d')][_0xf08a('0x6e')](function(_0x383bf4){return _0x1842cd[_0xf08a('0x73')](_0x83015e[_0xf08a('0x35')][_0xf08a('0x67')],{'transaction':_0x383bf4})[_0xf08a('0x29')](function(){if(!_[_0xf08a('0x82')](_0x430129)){return _0x1842cd[_0xf08a('0x83')](_0x430129,{'transaction':_0x383bf4});}})[_0xf08a('0x29')](function(){_0x430129[_0xf08a('0x70')](function(_0x51d641){socket[_0xf08a('0x71')](_0xf08a('0x84'),{'UserId':_0x51d641,'SmsQueueId':_0x1842cd['id']});});});});});});})[_0xf08a('0x29')](respondWithStatusCode(_0x3eefa5,null))['catch'](handleError(_0x3eefa5,null));};exports[_0xf08a('0x85')]=function(_0x519ead,_0x4d07b7,_0x1ebe41){return db['SmsQueue']['find']({'where':{'id':_0x519ead['params']['id']}})[_0xf08a('0x29')](handleEntityNotFound(_0x4d07b7,null))[_0xf08a('0x29')](function(_0x2da5ca){if(_0x2da5ca){return _0x2da5ca['addAgents'](_0x519ead[_0xf08a('0x4b')][_0xf08a('0x67')],_[_0xf08a('0x86')](_0x519ead[_0xf08a('0x4b')],[_0xf08a('0x67'),'id'])||{})[_0xf08a('0x87')](function(_0x1e13c2){for(var _0x61b40f=0x0;_0x61b40f<_0x519ead['body'][_0xf08a('0x67')][_0xf08a('0x39')];_0x61b40f+=0x1){socket['emit'](_0xf08a('0x72'),{'UserId':Number(_0x519ead[_0xf08a('0x4b')][_0xf08a('0x67')][_0x61b40f]),'SmsQueueId':Number(_0x519ead[_0xf08a('0x48')]['id'])});}return _0x1e13c2;});}})[_0xf08a('0x29')](respondWithResult(_0x4d07b7,null))[_0xf08a('0x54')](handleError(_0x4d07b7,null));};exports[_0xf08a('0x83')]=function(_0x4b87b0,_0xb09561,_0x16641f){return db[_0xf08a('0x2f')][_0xf08a('0x49')]({'where':{'id':_0x4b87b0[_0xf08a('0x48')]['id']}})[_0xf08a('0x29')](handleEntityNotFound(_0xb09561,null))[_0xf08a('0x29')](function(_0x50d894){if(_0x50d894){return _0x50d894[_0xf08a('0x83')](_0x4b87b0[_0xf08a('0x35')]['ids'])[_0xf08a('0x29')](function(){if(_[_0xf08a('0x88')](_0x4b87b0[_0xf08a('0x35')][_0xf08a('0x67')])){for(var _0x244523=0x0;_0x244523<_0x4b87b0[_0xf08a('0x35')][_0xf08a('0x67')][_0xf08a('0x39')];_0x244523+=0x1){socket[_0xf08a('0x71')](_0xf08a('0x84'),{'UserId':Number(_0x4b87b0[_0xf08a('0x35')]['ids'][_0x244523]),'SmsQueueId':Number(_0x4b87b0['params']['id'])});}}else{socket[_0xf08a('0x71')](_0xf08a('0x84'),{'UserId':Number(_0x4b87b0[_0xf08a('0x35')]['ids']),'SmsQueueId':Number(_0x4b87b0['params']['id'])});}});}})[_0xf08a('0x29')](respondWithStatusCode(_0xb09561,null))[_0xf08a('0x54')](handleError(_0xb09561,null));};exports[_0xf08a('0x89')]=function(_0x555a10,_0x1108f8,_0x2af1c6){var _0x41cdf8={};var _0x1d4758={};var _0x2cacb5;var _0x34dffd;return db[_0xf08a('0x2f')][_0xf08a('0x57')]({'where':{'id':_0x555a10[_0xf08a('0x48')]['id']}})[_0xf08a('0x29')](handleEntityNotFound(_0x1108f8,null))['then'](function(_0x569ffb){if(_0x569ffb){_0x2cacb5=_0x569ffb;_0x1d4758[_0xf08a('0x33')]=_[_0xf08a('0x34')](db[_0xf08a('0x68')][_0xf08a('0x59')]);_0x1d4758[_0xf08a('0x35')]=_[_0xf08a('0x34')](_0x555a10[_0xf08a('0x35')]);_0x1d4758[_0xf08a('0x3d')]=_[_0xf08a('0x36')](_0x1d4758['model'],_0x1d4758[_0xf08a('0x35')]);_0x41cdf8['attributes']=_['intersection'](_0x1d4758[_0xf08a('0x33')],qs[_0xf08a('0x38')](_0x555a10['query']['fields']));_0x41cdf8[_0xf08a('0x37')]=_0x41cdf8[_0xf08a('0x37')][_0xf08a('0x39')]?_0x41cdf8[_0xf08a('0x37')]:_0x1d4758[_0xf08a('0x33')];_0x41cdf8['order']=qs[_0xf08a('0x3c')](_0x555a10['query']['sort']);_0x41cdf8[_0xf08a('0x40')]=qs[_0xf08a('0x3d')](_['pick'](_0x555a10[_0xf08a('0x35')],_0x1d4758[_0xf08a('0x3d')]));if(_0x555a10[_0xf08a('0x35')][_0xf08a('0x3f')]){_0x41cdf8[_0xf08a('0x40')]=_['merge'](_0x41cdf8['where'],{'$or':_[_0xf08a('0x2e')](_0x41cdf8['attributes'],function(_0x569b56){var _0x587ace={};_0x587ace[_0x569b56]={'$like':'%'+_0x555a10[_0xf08a('0x35')][_0xf08a('0x3f')]+'%'};return _0x587ace;})});}_0x41cdf8=_[_0xf08a('0x41')]({},_0x41cdf8,_0x555a10[_0xf08a('0x5c')]);return _0x2cacb5[_0xf08a('0x89')](_0x41cdf8);}})[_0xf08a('0x29')](function(_0x2d7408){if(_0x2d7408){_0x34dffd=_0x2d7408[_0xf08a('0x39')];if(!_0x555a10['query'][_0xf08a('0x3a')](_0xf08a('0x3b'))){_0x41cdf8['limit']=qs['limit'](_0x555a10[_0xf08a('0x35')][_0xf08a('0x1f')]);_0x41cdf8[_0xf08a('0x21')]=qs['offset'](_0x555a10['query']['offset']);}return _0x2cacb5[_0xf08a('0x89')](_0x41cdf8);}})[_0xf08a('0x29')](function(_0x1a5a40){if(_0x1a5a40){return _0x1a5a40?{'count':_0x34dffd,'rows':_0x1a5a40}:null;}})[_0xf08a('0x29')](respondWithResult(_0x1108f8,null))[_0xf08a('0x54')](handleError(_0x1108f8,null));};
\ No newline at end of file
+var _0x1806=['includeAll','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','filter','findAll','User','findAndCountAll','agent','smsPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','order','addTeams','Agents','online','voicePause','flatMap','get','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','ids','select','from','team_has_sms_queues','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','isArray','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','status','json','offset','undefined','limit','count','set','apply','save','update','then','SmsQueues','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','map','SmsQueue','rawAttributes','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options'];(function(_0x122941,_0x26c524){var _0x33cd31=function(_0x4554b2){while(--_0x4554b2){_0x122941['push'](_0x122941['shift']());}};_0x33cd31(++_0x26c524);}(_0x1806,0x162));var _0x6180=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x1806[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x6180('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6180('0x1'));var rp=require(_0x6180('0x2'));var moment=require(_0x6180('0x3'));var BPromise=require(_0x6180('0x4'));var Mustache=require('mustache');var util=require(_0x6180('0x5'));var path=require('path');var sox=require(_0x6180('0x6'));var csv=require(_0x6180('0x7'));var ejs=require(_0x6180('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6180('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6180('0xa'));var deskjs=require(_0x6180('0xb'));var toCsv=require(_0x6180('0x7'));var querystring=require(_0x6180('0xc'));var Papa=require(_0x6180('0xd'));var Redis=require('ioredis');var authService=require(_0x6180('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x6180('0xf'));var hardwareService=require(_0x6180('0x10'));var logger=require(_0x6180('0x11'))(_0x6180('0x12'));var utils=require(_0x6180('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x6180('0x14'));var db=require(_0x6180('0x15'))['db'];config[_0x6180('0x16')]=_[_0x6180('0x17')](config['redis'],{'host':_0x6180('0x18'),'port':0x18eb});var socket=require(_0x6180('0x19'))(new Redis(config[_0x6180('0x16')]));require(_0x6180('0x1a'))[_0x6180('0x1b')](socket);function respondWithStatusCode(_0x5be4f7,_0x545d14){_0x545d14=_0x545d14||0xcc;return function(_0x2307b8){if(_0x2307b8){return _0x5be4f7['sendStatus'](_0x545d14);}return _0x5be4f7[_0x6180('0x1c')](_0x545d14)['end']();};}function respondWithResult(_0x29e96a,_0x50ea08){_0x50ea08=_0x50ea08||0xc8;return function(_0x598f9e){if(_0x598f9e){return _0x29e96a[_0x6180('0x1c')](_0x50ea08)[_0x6180('0x1d')](_0x598f9e);}};}function respondWithFilteredResult(_0x4b200e,_0x5c03ff){return function(_0x46e2cf){if(_0x46e2cf){var _0x2422f4=typeof _0x5c03ff[_0x6180('0x1e')]===_0x6180('0x1f')&&typeof _0x5c03ff[_0x6180('0x20')]===_0x6180('0x1f');var _0x2e070d=_0x46e2cf[_0x6180('0x21')];var _0x23ef72=_0x2422f4?0x0:_0x5c03ff[_0x6180('0x1e')];var _0x229e74=_0x2422f4?_0x46e2cf[_0x6180('0x21')]:_0x5c03ff[_0x6180('0x1e')]+_0x5c03ff['limit'];var _0x493444;if(_0x229e74>=_0x2e070d){_0x229e74=_0x2e070d;_0x493444=0xc8;}else{_0x493444=0xce;}_0x4b200e[_0x6180('0x1c')](_0x493444);return _0x4b200e[_0x6180('0x22')]('Content-Range',_0x23ef72+'-'+_0x229e74+'/'+_0x2e070d)[_0x6180('0x1d')](_0x46e2cf);}return null;};}function patchUpdates(_0x709de6){return function(_0x848dce){try{jsonpatch[_0x6180('0x23')](_0x848dce,_0x709de6,!![]);}catch(_0x585916){return BPromise['reject'](_0x585916);}return _0x848dce[_0x6180('0x24')]();};}function saveUpdates(_0x3c77cb,_0x995c18){return function(_0x539e7c){if(_0x539e7c){return _0x539e7c[_0x6180('0x25')](_0x3c77cb)[_0x6180('0x26')](function(_0x11886c){return _0x11886c;});}return null;};}function removeEntity(_0x476616,_0x22802c){return function(_0x2262db){if(_0x2262db){return _0x2262db['destroy']()[_0x6180('0x26')](function(){var _0x329fe4=_0x2262db['get']({'plain':!![]});var _0x2eeaa1=_0x6180('0x27');return db[_0x6180('0x28')][_0x6180('0x29')]({'where':{'type':_0x2eeaa1,'resourceId':_0x329fe4['id']}})[_0x6180('0x26')](function(){return _0x2262db;});})['then'](function(){_0x476616['status'](0xcc)[_0x6180('0x2a')]();});}};}function handleEntityNotFound(_0x5a1194,_0xf0bec9){return function(_0x4a0421){if(!_0x4a0421){_0x5a1194[_0x6180('0x2b')](0x194);}return _0x4a0421;};}function handleError(_0x28c7c2,_0x400bfd){_0x400bfd=_0x400bfd||0x1f4;return function(_0x3b9b18){logger[_0x6180('0x2c')](_0x3b9b18[_0x6180('0x2d')]);if(_0x3b9b18['name']){delete _0x3b9b18[_0x6180('0x2e')];}_0x28c7c2[_0x6180('0x1c')](_0x400bfd)[_0x6180('0x2f')](_0x3b9b18);};}exports['index']=function(_0x194440,_0xa20be8){var _0x3946d5={},_0x12607c={},_0x459eb0={'count':0x0,'rows':[]};var _0x428b07=_[_0x6180('0x30')](db[_0x6180('0x31')][_0x6180('0x32')],function(_0x59b058){return{'name':_0x59b058['fieldName'],'type':_0x59b058[_0x6180('0x33')][_0x6180('0x34')]};});_0x12607c[_0x6180('0x35')]=_[_0x6180('0x30')](_0x428b07,_0x6180('0x2e'));_0x12607c[_0x6180('0x36')]=_[_0x6180('0x37')](_0x194440[_0x6180('0x36')]);_0x12607c[_0x6180('0x38')]=_[_0x6180('0x39')](_0x12607c[_0x6180('0x35')],_0x12607c[_0x6180('0x36')]);_0x3946d5['attributes']=_[_0x6180('0x39')](_0x12607c['model'],qs[_0x6180('0x3a')](_0x194440[_0x6180('0x36')][_0x6180('0x3a')]));_0x3946d5['attributes']=_0x3946d5['attributes'][_0x6180('0x3b')]?_0x3946d5[_0x6180('0x3c')]:_0x12607c['model'];if(!_0x194440[_0x6180('0x36')][_0x6180('0x3d')](_0x6180('0x3e'))){_0x3946d5['limit']=qs['limit'](_0x194440[_0x6180('0x36')][_0x6180('0x20')]);_0x3946d5[_0x6180('0x1e')]=qs[_0x6180('0x1e')](_0x194440[_0x6180('0x36')][_0x6180('0x1e')]);}_0x3946d5['order']=qs[_0x6180('0x3f')](_0x194440[_0x6180('0x36')][_0x6180('0x3f')]);_0x3946d5[_0x6180('0x40')]=qs[_0x6180('0x38')](_[_0x6180('0x41')](_0x194440[_0x6180('0x36')],_0x12607c['filters']),_0x428b07);if(_0x194440[_0x6180('0x36')]['filter']){_0x3946d5[_0x6180('0x40')]=_[_0x6180('0x42')](_0x3946d5[_0x6180('0x40')],{'$or':_[_0x6180('0x30')](_0x428b07,function(_0x3d09b2){if(_0x3d09b2[_0x6180('0x33')]!==_0x6180('0x43')){var _0x39d306={};_0x39d306[_0x3d09b2[_0x6180('0x2e')]]={'$like':'%'+_0x194440[_0x6180('0x36')]['filter']+'%'};return _0x39d306;}})});}_0x3946d5=_[_0x6180('0x42')]({},_0x3946d5,_0x194440[_0x6180('0x44')]);var _0x4e4771={'where':_0x3946d5[_0x6180('0x40')]};return db[_0x6180('0x31')][_0x6180('0x21')](_0x4e4771)['then'](function(_0x4c07b3){_0x459eb0[_0x6180('0x21')]=_0x4c07b3;if(_0x194440[_0x6180('0x36')][_0x6180('0x45')]){_0x3946d5['include']=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x3946d5);})[_0x6180('0x26')](function(_0x1e21fc){_0x459eb0['rows']=_0x1e21fc;return _0x459eb0;})[_0x6180('0x26')](respondWithFilteredResult(_0xa20be8,_0x3946d5))[_0x6180('0x46')](handleError(_0xa20be8,null));};exports[_0x6180('0x47')]=function(_0x5383c4,_0xf7608b){var _0x225c2e={'raw':!![],'where':{'id':_0x5383c4[_0x6180('0x48')]['id']}},_0x2c6969={};_0x2c6969[_0x6180('0x35')]=_[_0x6180('0x37')](db[_0x6180('0x31')][_0x6180('0x32')]);_0x2c6969[_0x6180('0x36')]=_[_0x6180('0x37')](_0x5383c4[_0x6180('0x36')]);_0x2c6969[_0x6180('0x38')]=_['intersection'](_0x2c6969['model'],_0x2c6969[_0x6180('0x36')]);_0x225c2e[_0x6180('0x3c')]=_[_0x6180('0x39')](_0x2c6969[_0x6180('0x35')],qs['fields'](_0x5383c4[_0x6180('0x36')][_0x6180('0x3a')]));_0x225c2e[_0x6180('0x3c')]=_0x225c2e[_0x6180('0x3c')][_0x6180('0x3b')]?_0x225c2e[_0x6180('0x3c')]:_0x2c6969[_0x6180('0x35')];if(_0x5383c4['query'][_0x6180('0x45')]){_0x225c2e[_0x6180('0x49')]=[{'all':!![]}];}_0x225c2e=_['merge']({},_0x225c2e,_0x5383c4['options']);return db[_0x6180('0x31')][_0x6180('0x4a')](_0x225c2e)['then'](handleEntityNotFound(_0xf7608b,null))['then'](respondWithResult(_0xf7608b,null))['catch'](handleError(_0xf7608b,null));};exports[_0x6180('0x4b')]=function(_0x2217e3,_0x207873){return db[_0x6180('0x31')]['create'](_0x2217e3[_0x6180('0x4c')],{})['then'](function(_0x52a2c3){var _0x305cb4=_0x2217e3[_0x6180('0x4d')]['get']({'plain':!![]});if(!_0x305cb4)throw new Error(_0x6180('0x4e'));if(_0x305cb4[_0x6180('0x4f')]==='user'){var _0x4b8961=_0x52a2c3['get']({'plain':!![]});var _0xc18999=_0x6180('0x27');return db['UserProfileSection'][_0x6180('0x4a')]({'where':{'name':_0xc18999,'userProfileId':_0x305cb4[_0x6180('0x50')]},'raw':!![]})[_0x6180('0x26')](function(_0x313442){if(_0x313442&&_0x313442[_0x6180('0x51')]===0x0){return db['UserProfileResource'][_0x6180('0x4b')]({'name':_0x4b8961[_0x6180('0x2e')],'resourceId':_0x4b8961['id'],'type':_0x313442[_0x6180('0x2e')],'sectionId':_0x313442['id']},{})[_0x6180('0x26')](function(){return _0x52a2c3;});}else{return _0x52a2c3;}})[_0x6180('0x46')](function(_0x524d7c){logger[_0x6180('0x2c')](_0x6180('0x52'),_0x524d7c);throw _0x524d7c;});}return _0x52a2c3;})[_0x6180('0x26')](respondWithResult(_0x207873,0xc9))['catch'](handleError(_0x207873,null));};exports[_0x6180('0x25')]=function(_0x3a5994,_0x358bc9){if(_0x3a5994[_0x6180('0x4c')]['id']){delete _0x3a5994[_0x6180('0x4c')]['id'];}return db[_0x6180('0x31')]['find']({'where':{'id':_0x3a5994[_0x6180('0x48')]['id']}})['then'](handleEntityNotFound(_0x358bc9,null))[_0x6180('0x26')](saveUpdates(_0x3a5994['body'],null))[_0x6180('0x26')](respondWithResult(_0x358bc9,null))[_0x6180('0x46')](handleError(_0x358bc9,null));};exports[_0x6180('0x29')]=function(_0x29025b,_0x1630ee){return db[_0x6180('0x31')][_0x6180('0x4a')]({'where':{'id':_0x29025b[_0x6180('0x48')]['id']}})['then'](handleEntityNotFound(_0x1630ee,null))[_0x6180('0x26')](removeEntity(_0x1630ee,null))[_0x6180('0x46')](handleError(_0x1630ee,null));};exports[_0x6180('0x53')]=function(_0xf3e584,_0x40be1b){return db[_0x6180('0x31')][_0x6180('0x53')]()[_0x6180('0x26')](respondWithResult(_0x40be1b,null))['catch'](handleError(_0x40be1b,null));};exports[_0x6180('0x54')]=function(_0x14e8cf,_0x509271,_0x257744){var _0x347923={'raw':!![],'where':{}},_0x25953a={},_0x4a4bd8;return db[_0x6180('0x31')][_0x6180('0x55')]({'where':{'id':_0x14e8cf[_0x6180('0x48')]['id']}})['then'](handleEntityNotFound(_0x509271,null))['then'](function(_0x209fe0){if(_0x209fe0){_0x4a4bd8=_0x209fe0['get']({'plain':!![]});_0x25953a[_0x6180('0x35')]=_['keys'](db[_0x6180('0x56')][_0x6180('0x32')]);_0x25953a[_0x6180('0x36')]=_[_0x6180('0x37')](_0x14e8cf[_0x6180('0x36')]);_0x25953a[_0x6180('0x38')]=_[_0x6180('0x39')](_0x25953a['model'],_0x25953a['query']);_0x347923['attributes']=_[_0x6180('0x39')](_0x25953a[_0x6180('0x35')],qs[_0x6180('0x3a')](_0x14e8cf[_0x6180('0x36')][_0x6180('0x3a')]));_0x347923['attributes']=_0x347923[_0x6180('0x3c')][_0x6180('0x3b')]?_0x347923[_0x6180('0x3c')]:_0x25953a[_0x6180('0x35')];if(!_0x14e8cf[_0x6180('0x36')]['hasOwnProperty'](_0x6180('0x3e'))){_0x347923[_0x6180('0x20')]=qs[_0x6180('0x20')](_0x14e8cf['query'][_0x6180('0x20')]);_0x347923[_0x6180('0x1e')]=qs['offset'](_0x14e8cf['query']['offset']);}_0x347923['order']=qs[_0x6180('0x3f')](_0x14e8cf[_0x6180('0x36')][_0x6180('0x3f')]);_0x347923[_0x6180('0x40')]=qs[_0x6180('0x38')](_[_0x6180('0x41')](_0x14e8cf[_0x6180('0x36')],_0x25953a[_0x6180('0x38')]));_0x347923[_0x6180('0x40')][_0x6180('0x57')]=_0x209fe0['id'];if(_0x14e8cf[_0x6180('0x36')]['filter']){_0x347923[_0x6180('0x40')]=_[_0x6180('0x42')](_0x347923[_0x6180('0x40')],{'$or':_[_0x6180('0x30')](_0x347923[_0x6180('0x3c')],function(_0x5601a5){var _0x20b70b={};_0x20b70b[_0x5601a5]={'$like':'%'+_0x14e8cf[_0x6180('0x36')][_0x6180('0x58')]+'%'};return _0x20b70b;})});}_0x347923=_[_0x6180('0x42')]({},_0x347923,_0x14e8cf[_0x6180('0x44')]);return db[_0x6180('0x56')][_0x6180('0x59')](_0x347923);}})['then'](function(_0x27fd40){if(_0x27fd40){return db[_0x6180('0x5a')][_0x6180('0x5b')]({'where':{'id':_[_0x6180('0x30')](_0x27fd40,'UserId'),'role':_0x6180('0x5c')},'attributes':['id',_0x6180('0x2e'),_0x6180('0x5d'),_0x6180('0x5e'),_0x6180('0x5f')]});}})[_0x6180('0x26')](function(_0x539fa2){if(_0x539fa2){return{'count':_0x539fa2[_0x6180('0x21')],'rows':_[_0x6180('0x30')](_0x539fa2[_0x6180('0x60')],function(_0x170a20){return{'membername':_0x170a20[_0x6180('0x2e')],'UserId':_0x170a20['id'],'queue_name':_0x4a4bd8['name'],'SmsQueueId':_0x4a4bd8['id'],'interface':util[_0x6180('0x61')](_0x6180('0x62'),_0x6180('0x63'),_0x170a20[_0x6180('0x2e')]),'penalty':0x0,'paused':_0x170a20['smsPause'],'createdAt':_0x170a20[_0x6180('0x5f')],'updatedAt':_0x170a20[_0x6180('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6180('0x26')](respondWithFilteredResult(_0x509271,_0x347923))['catch'](handleError(_0x509271,null));};exports[_0x6180('0x64')]=function(_0x19abbc,_0x7ac57c,_0x1a01e5){var _0x4c554b={};var _0xff0544={};var _0x1a930b;var _0x35c816;return db['SmsQueue'][_0x6180('0x55')]({'where':{'id':_0x19abbc[_0x6180('0x48')]['id']}})[_0x6180('0x26')](handleEntityNotFound(_0x7ac57c,null))[_0x6180('0x26')](function(_0x5093e0){if(_0x5093e0){_0x1a930b=_0x5093e0;_0xff0544[_0x6180('0x35')]=_[_0x6180('0x37')](db[_0x6180('0x65')][_0x6180('0x32')]);_0xff0544[_0x6180('0x36')]=_[_0x6180('0x37')](_0x19abbc[_0x6180('0x36')]);_0xff0544['filters']=_[_0x6180('0x39')](_0xff0544['model'],_0xff0544[_0x6180('0x36')]);_0x4c554b['attributes']=_['intersection'](_0xff0544[_0x6180('0x35')],qs[_0x6180('0x3a')](_0x19abbc['query']['fields']));_0x4c554b[_0x6180('0x3c')]=_0x4c554b[_0x6180('0x3c')][_0x6180('0x3b')]?_0x4c554b[_0x6180('0x3c')]:_0xff0544[_0x6180('0x35')];_0x4c554b[_0x6180('0x66')]=qs['sort'](_0x19abbc['query'][_0x6180('0x3f')]);_0x4c554b[_0x6180('0x40')]=qs[_0x6180('0x38')](_[_0x6180('0x41')](_0x19abbc[_0x6180('0x36')],_0xff0544[_0x6180('0x38')]));if(_0x19abbc[_0x6180('0x36')][_0x6180('0x58')]){_0x4c554b['where']=_[_0x6180('0x42')](_0x4c554b[_0x6180('0x40')],{'$or':_[_0x6180('0x30')](_0x4c554b[_0x6180('0x3c')],function(_0x4416de){var _0x39ee57={};_0x39ee57[_0x4416de]={'$like':'%'+_0x19abbc[_0x6180('0x36')][_0x6180('0x58')]+'%'};return _0x39ee57;})});}_0x4c554b=_[_0x6180('0x42')]({},_0x4c554b,_0x19abbc['options']);return _0x1a930b[_0x6180('0x64')](_0x4c554b);}})[_0x6180('0x26')](function(_0x45dc6e){if(_0x45dc6e){_0x35c816=_0x45dc6e[_0x6180('0x3b')];if(!_0x19abbc[_0x6180('0x36')][_0x6180('0x3d')](_0x6180('0x3e'))){_0x4c554b[_0x6180('0x20')]=qs[_0x6180('0x20')](_0x19abbc[_0x6180('0x36')][_0x6180('0x20')]);_0x4c554b[_0x6180('0x1e')]=qs['offset'](_0x19abbc['query'][_0x6180('0x1e')]);}return _0x1a930b[_0x6180('0x64')](_0x4c554b);}})['then'](function(_0x3b4400){if(_0x3b4400){return _0x3b4400?{'count':_0x35c816,'rows':_0x3b4400}:null;}})[_0x6180('0x26')](respondWithResult(_0x7ac57c,null))['catch'](handleError(_0x7ac57c,null));};exports[_0x6180('0x67')]=function(_0x11ed69,_0x136caa,_0x3b45e2){var _0x5155f5=_0x11ed69[_0x6180('0x4c')]['ids'];return db[_0x6180('0x65')][_0x6180('0x59')]({'where':{'id':_0x5155f5},'attributes':['id'],'include':[{'model':db[_0x6180('0x5a')],'as':_0x6180('0x68'),'attributes':['id',_0x6180('0x2e'),_0x6180('0x69'),_0x6180('0x6a'),'interface'],'raw':!![]}]})[_0x6180('0x26')](function(_0x3b388e){if(_0x3b388e){var _0xcca336=_[_0x6180('0x6b')](_0x3b388e,function(_0x5c6071){var _0xf7c400=_0x5c6071[_0x6180('0x6c')]({'plain':!![]});return _0xf7c400[_0x6180('0x68')];});return db[_0x6180('0x31')][_0x6180('0x4a')]({'where':{'id':_0x11ed69[_0x6180('0x48')]['id']}})[_0x6180('0x26')](function(_0x24c4be){return db[_0x6180('0x6d')][_0x6180('0x6e')](function(_0x4be7c6){return _0x24c4be['addTeams'](_0x5155f5,{'transaction':_0x4be7c6})[_0x6180('0x26')](function(){return BPromise[_0x6180('0x6f')](_0xcca336,function(_0x37d93b){return db[_0x6180('0x56')][_0x6180('0x70')]({'where':{'UserId':_0x37d93b['id'],'SmsQueueId':_0x11ed69[_0x6180('0x48')]['id']},'transaction':_0x4be7c6});});})[_0x6180('0x26')](function(){_0xcca336[_0x6180('0x71')](function(_0x56b502){socket[_0x6180('0x72')](_0x6180('0x73'),{'UserId':_0x56b502['id'],'SmsQueueId':_0x24c4be['id']});});});});});}})[_0x6180('0x26')](respondWithStatusCode(_0x136caa,null))[_0x6180('0x46')](handleError(_0x136caa,null));};exports[_0x6180('0x74')]=function(_0x1804a2,_0xe85af,_0x5cdf06){return db['Team']['findAll']({'where':{'id':_0x1804a2[_0x6180('0x36')][_0x6180('0x75')]},'attributes':['id'],'include':[{'model':db[_0x6180('0x5a')],'as':_0x6180('0x68'),'attributes':['id'],'raw':!![]}]})[_0x6180('0x26')](handleEntityNotFound(_0xe85af,null))[_0x6180('0x26')](function(_0x3b9877){var _0x1bc00a=_['map'](_0x3b9877,'id');var _0x58b48b=[];var _0x238456=[];var _0x1d629a=squel[_0x6180('0x76')]();_0x1d629a['field']('tq.TeamId')[_0x6180('0x77')](_0x6180('0x78'),'tq')['join']('user_has_teams','ut',_0x6180('0x79'))['where']('SmsQueueId\x20=\x20?',_0x1804a2['params']['id']);for(var _0x19fc48=0x0;_0x19fc48<_0x3b9877[_0x6180('0x3b')];_0x19fc48+=0x1){let _0x3cf143=_0x3b9877[_0x19fc48];for(var _0x822add=0x0;_0x822add<_0x3cf143[_0x6180('0x68')]['length'];_0x822add+=0x1){let _0x12ccf0=_0x3cf143['Agents'][_0x822add];var _0xaa8367=_0x1d629a[_0x6180('0x7a')]();_0xaa8367[_0x6180('0x40')](_0x6180('0x7b'),_0x12ccf0['id']);_0x238456[_0x6180('0x7c')](db[_0x6180('0x6d')][_0x6180('0x36')](_0xaa8367[_0x6180('0x7d')](),{'type':db[_0x6180('0x6d')][_0x6180('0x7e')][_0x6180('0x7f')]})['then'](function(_0x8cce7f){if(_0x8cce7f[_0x6180('0x3b')]===0x1){return _0x12ccf0['id'];}else{var _0x5d1def=_[_0x6180('0x80')](_['map'](_0x8cce7f,_0x6180('0x81')),function(_0x3ba121){return _['includes'](_0x1bc00a,_0x3ba121);});if(_0x5d1def){return _0x12ccf0['id'];}}}));}}return BPromise[_0x6180('0x82')](_0x238456)[_0x6180('0x26')](function(_0x57ba4e){_0x58b48b=_(_0x58b48b)[_0x6180('0x83')](_0x57ba4e)[_0x6180('0x84')]()[_0x6180('0x85')]();return db[_0x6180('0x31')][_0x6180('0x4a')]({'where':{'id':_0x1804a2[_0x6180('0x48')]['id']}})[_0x6180('0x26')](function(_0x3f4c15){return db[_0x6180('0x6d')][_0x6180('0x6e')](function(_0x1a48d5){return _0x3f4c15['removeTeams'](_0x1804a2['query'][_0x6180('0x75')],{'transaction':_0x1a48d5})[_0x6180('0x26')](function(){if(!_[_0x6180('0x86')](_0x58b48b)){return _0x3f4c15[_0x6180('0x87')](_0x58b48b,{'transaction':_0x1a48d5});}})[_0x6180('0x26')](function(){_0x58b48b['forEach'](function(_0x546a7c){socket[_0x6180('0x72')](_0x6180('0x88'),{'UserId':_0x546a7c,'SmsQueueId':_0x3f4c15['id']});});});});});});})[_0x6180('0x26')](respondWithStatusCode(_0xe85af,null))[_0x6180('0x46')](handleError(_0xe85af,null));};exports[_0x6180('0x89')]=function(_0x28736e,_0x3a8eb9,_0x1d0df5){return db[_0x6180('0x31')][_0x6180('0x4a')]({'where':{'id':_0x28736e[_0x6180('0x48')]['id']}})[_0x6180('0x26')](handleEntityNotFound(_0x3a8eb9,null))[_0x6180('0x26')](function(_0xdfc371){if(_0xdfc371){return _0xdfc371[_0x6180('0x89')](_0x28736e[_0x6180('0x4c')][_0x6180('0x75')],_[_0x6180('0x8a')](_0x28736e['body'],[_0x6180('0x75'),'id'])||{})['spread'](function(_0x2ded78){for(var _0x33a9fb=0x0;_0x33a9fb<_0x28736e['body'][_0x6180('0x75')][_0x6180('0x3b')];_0x33a9fb+=0x1){socket[_0x6180('0x72')](_0x6180('0x73'),{'UserId':Number(_0x28736e['body']['ids'][_0x33a9fb]),'SmsQueueId':Number(_0x28736e[_0x6180('0x48')]['id'])});}return _0x2ded78;});}})['then'](respondWithResult(_0x3a8eb9,null))['catch'](handleError(_0x3a8eb9,null));};exports[_0x6180('0x87')]=function(_0x220331,_0x4dd6a1,_0x34fed2){return db[_0x6180('0x31')]['find']({'where':{'id':_0x220331['params']['id']}})['then'](handleEntityNotFound(_0x4dd6a1,null))[_0x6180('0x26')](function(_0x2ec27b){if(_0x2ec27b){return _0x2ec27b[_0x6180('0x87')](_0x220331[_0x6180('0x36')]['ids'])[_0x6180('0x26')](function(){if(_[_0x6180('0x8b')](_0x220331[_0x6180('0x36')][_0x6180('0x75')])){for(var _0x3290fe=0x0;_0x3290fe<_0x220331['query']['ids']['length'];_0x3290fe+=0x1){socket[_0x6180('0x72')](_0x6180('0x88'),{'UserId':Number(_0x220331[_0x6180('0x36')]['ids'][_0x3290fe]),'SmsQueueId':Number(_0x220331[_0x6180('0x48')]['id'])});}}else{socket[_0x6180('0x72')](_0x6180('0x88'),{'UserId':Number(_0x220331['query'][_0x6180('0x75')]),'SmsQueueId':Number(_0x220331['params']['id'])});}});}})[_0x6180('0x26')](respondWithStatusCode(_0x4dd6a1,null))[_0x6180('0x46')](handleError(_0x4dd6a1,null));};exports[_0x6180('0x8c')]=function(_0x5dfbb5,_0x1feb76,_0x4324fc){var _0x5e2016={};var _0x58bc84={};var _0x171a31;var _0x3ea10e;return db[_0x6180('0x31')]['findOne']({'where':{'id':_0x5dfbb5['params']['id']}})[_0x6180('0x26')](handleEntityNotFound(_0x1feb76,null))[_0x6180('0x26')](function(_0x8004f9){if(_0x8004f9){_0x171a31=_0x8004f9;_0x58bc84[_0x6180('0x35')]=_['keys'](db[_0x6180('0x5a')][_0x6180('0x32')]);_0x58bc84['query']=_['keys'](_0x5dfbb5[_0x6180('0x36')]);_0x58bc84['filters']=_[_0x6180('0x39')](_0x58bc84[_0x6180('0x35')],_0x58bc84['query']);_0x5e2016['attributes']=_['intersection'](_0x58bc84['model'],qs['fields'](_0x5dfbb5[_0x6180('0x36')][_0x6180('0x3a')]));_0x5e2016['attributes']=_0x5e2016[_0x6180('0x3c')]['length']?_0x5e2016[_0x6180('0x3c')]:_0x58bc84[_0x6180('0x35')];_0x5e2016[_0x6180('0x66')]=qs[_0x6180('0x3f')](_0x5dfbb5[_0x6180('0x36')]['sort']);_0x5e2016[_0x6180('0x40')]=qs[_0x6180('0x38')](_['pick'](_0x5dfbb5[_0x6180('0x36')],_0x58bc84['filters']));if(_0x5dfbb5['query'][_0x6180('0x58')]){_0x5e2016['where']=_[_0x6180('0x42')](_0x5e2016[_0x6180('0x40')],{'$or':_['map'](_0x5e2016[_0x6180('0x3c')],function(_0xcb50d3){var _0x30bac4={};_0x30bac4[_0xcb50d3]={'$like':'%'+_0x5dfbb5[_0x6180('0x36')][_0x6180('0x58')]+'%'};return _0x30bac4;})});}_0x5e2016=_[_0x6180('0x42')]({},_0x5e2016,_0x5dfbb5['options']);return _0x171a31[_0x6180('0x8c')](_0x5e2016);}})[_0x6180('0x26')](function(_0x36a983){if(_0x36a983){_0x3ea10e=_0x36a983[_0x6180('0x3b')];if(!_0x5dfbb5[_0x6180('0x36')][_0x6180('0x3d')](_0x6180('0x3e'))){_0x5e2016[_0x6180('0x20')]=qs['limit'](_0x5dfbb5['query'][_0x6180('0x20')]);_0x5e2016['offset']=qs[_0x6180('0x1e')](_0x5dfbb5[_0x6180('0x36')]['offset']);}return _0x171a31[_0x6180('0x8c')](_0x5e2016);}})[_0x6180('0x26')](function(_0x2e4961){if(_0x2e4961){return _0x2e4961?{'count':_0x3ea10e,'rows':_0x2e4961}:null;}})[_0x6180('0x26')](respondWithResult(_0x1feb76,null))[_0x6180('0x46')](handleError(_0x1feb76,null));};
\ No newline at end of file
index d0249a8..a51df3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68e7=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','save','update'];(function(_0x27e7e2,_0x3ddb8a){var _0x55431f=function(_0xb012a2){while(--_0xb012a2){_0x27e7e2['push'](_0x27e7e2['shift']());}};_0x55431f(++_0x3ddb8a);}(_0x68e7,0x9d));var _0x768e=function(_0x544feb,_0x250c58){_0x544feb=_0x544feb-0x0;var _0x3ee4c5=_0x68e7[_0x544feb];return _0x3ee4c5;};'use strict';var EventEmitter=require(_0x768e('0x0'));var SmsQueue=require(_0x768e('0x1'))['db'][_0x768e('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x768e('0x3'),'afterUpdate':_0x768e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x388a44){return function(_0x35889f,_0x146033,_0x47bf2f){SmsQueueEvents[_0x768e('0x5')](_0x388a44+':'+_0x35889f['id'],_0x35889f);SmsQueueEvents['emit'](_0x388a44,_0x35889f);_0x47bf2f(null);};}for(var e in events){if(events[_0x768e('0x6')](e)){var event=events[e];SmsQueue[_0x768e('0x7')](e,emitEvent(event));}}module[_0x768e('0x8')]=SmsQueueEvents;
\ No newline at end of file
+var _0x6fcf=['remove','emit','hasOwnProperty','exports','../../mysqldb','SmsQueue','setMaxListeners','save','update'];(function(_0x9d0771,_0x8a970b){var _0x81fef0=function(_0x8eadf8){while(--_0x8eadf8){_0x9d0771['push'](_0x9d0771['shift']());}};_0x81fef0(++_0x8a970b);}(_0x6fcf,0xe5));var _0xf6fc=function(_0x3e5595,_0xbe4275){_0x3e5595=_0x3e5595-0x0;var _0x3fd3a6=_0x6fcf[_0x3e5595];return _0x3fd3a6;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xf6fc('0x0'))['db'][_0xf6fc('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xf6fc('0x2')](0x0);var events={'afterCreate':_0xf6fc('0x3'),'afterUpdate':_0xf6fc('0x4'),'afterDestroy':_0xf6fc('0x5')};function emitEvent(_0x67dc83){return function(_0xc69230,_0x146656,_0x4ebd3b){SmsQueueEvents[_0xf6fc('0x6')](_0x67dc83+':'+_0xc69230['id'],_0xc69230);SmsQueueEvents['emit'](_0x67dc83,_0xc69230);_0x4ebd3b(null);};}for(var e in events){if(events[_0xf6fc('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xf6fc('0x8')]=SmsQueueEvents;
\ No newline at end of file
index 59ee668..b995671 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5580=['define','sms_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./smsQueue.attributes','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5580,0xbd));var _0x0558=function(_0x2cbfe3,_0x3997e5){_0x2cbfe3=_0x2cbfe3-0x0;var _0xcd8d50=_0x5580[_0x2cbfe3];return _0xcd8d50;};'use strict';var _=require(_0x0558('0x0'));var util=require('util');var logger=require(_0x0558('0x1'))(_0x0558('0x2'));var moment=require(_0x0558('0x3'));var BPromise=require(_0x0558('0x4'));var rp=require(_0x0558('0x5'));var fs=require('fs');var path=require(_0x0558('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0558('0x7'));module[_0x0558('0x8')]=function(_0x21d4e9,_0x55ca16){return _0x21d4e9[_0x0558('0x9')]('SmsQueue',attributes,{'tableName':_0x0558('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd81c=['../../config/environment','./smsQueue.attributes','SmsQueue','sms_queues','lodash','util','moment','bluebird','path'];(function(_0x2c004d,_0x214dc5){var _0x2e226e=function(_0x3ff2ff){while(--_0x3ff2ff){_0x2c004d['push'](_0x2c004d['shift']());}};_0x2e226e(++_0x214dc5);}(_0xd81c,0xa6));var _0xcd81=function(_0x235a08,_0x47a4a3){_0x235a08=_0x235a08-0x0;var _0x4249ce=_0xd81c[_0x235a08];return _0x4249ce;};'use strict';var _=require(_0xcd81('0x0'));var util=require(_0xcd81('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcd81('0x2'));var BPromise=require(_0xcd81('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd81('0x4'));var rimraf=require('rimraf');var config=require(_0xcd81('0x5'));var attributes=require(_0xcd81('0x6'));module['exports']=function(_0x362803,_0x31c479){return _0x362803['define'](_0xcd81('0x7'),attributes,{'tableName':_0xcd81('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b7490d5..447087a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4836=['ShowSmsQueue','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','then','info','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','SmsQueue,\x20%s,\x20%s','result','catch','GetSmsQueue','options','raw','attributes','include','map','model','stringify'];(function(_0x338284,_0x31675f){var _0x2e4fc4=function(_0x822814){while(--_0x822814){_0x338284['push'](_0x338284['shift']());}};_0x2e4fc4(++_0x31675f);}(_0x4836,0x16a));var _0x6483=function(_0x404000,_0x703a63){_0x404000=_0x404000-0x0;var _0x1f16ec=_0x4836[_0x404000];return _0x1f16ec;};'use strict';var _=require(_0x6483('0x0'));var util=require(_0x6483('0x1'));var moment=require('moment');var BPromise=require(_0x6483('0x2'));var rs=require(_0x6483('0x3'));var fs=require('fs');var Redis=require(_0x6483('0x4'));var db=require(_0x6483('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6483('0x6'))(_0x6483('0x7'));var config=require(_0x6483('0x8'));var jayson=require(_0x6483('0x9'));var client=jayson[_0x6483('0xa')][_0x6483('0xb')]({'port':0x232a});config[_0x6483('0xc')]=_[_0x6483('0xd')](config[_0x6483('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6483('0xe'))(new Redis(config[_0x6483('0xc')]));require('./smsQueue.socket')[_0x6483('0xf')](socket);function respondWithRpcPromise(_0x254ea6,_0xac9a00,_0x494162){return new BPromise(function(_0x12fb4e,_0x448dc3){return client['request'](_0x254ea6,_0x494162)[_0x6483('0x10')](function(_0x23a90d){logger[_0x6483('0x11')]('SmsQueue,\x20%s,\x20%s',_0xac9a00,'request\x20sent');logger[_0x6483('0x12')](_0x6483('0x13'),_0xac9a00,_0x6483('0x14'),JSON['stringify'](_0x23a90d));if(_0x23a90d[_0x6483('0x15')]){if(_0x23a90d['error']['code']===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0xac9a00,_0x23a90d[_0x6483('0x15')][_0x6483('0x16')]);return _0x448dc3(_0x23a90d[_0x6483('0x15')][_0x6483('0x16')]);}logger['error'](_0x6483('0x17'),_0xac9a00,_0x23a90d['error'][_0x6483('0x16')]);return _0x12fb4e(_0x23a90d[_0x6483('0x15')][_0x6483('0x16')]);}else{logger[_0x6483('0x11')]('SmsQueue,\x20%s,\x20%s',_0xac9a00,_0x6483('0x14'));_0x12fb4e(_0x23a90d[_0x6483('0x18')][_0x6483('0x16')]);}})[_0x6483('0x19')](function(_0x1b22de){logger[_0x6483('0x15')]('SmsQueue,\x20%s,\x20%s',_0xac9a00,_0x1b22de);_0x448dc3(_0x1b22de);});});}exports[_0x6483('0x1a')]=function(_0x53b53d){var _0x29a54e=this;return new Promise(function(_0x227f64,_0x481412){return db['SmsQueue']['findAll']({'raw':_0x53b53d[_0x6483('0x1b')]?_0x53b53d[_0x6483('0x1b')][_0x6483('0x1c')]===undefined?!![]:![]:!![],'where':_0x53b53d[_0x6483('0x1b')]?_0x53b53d[_0x6483('0x1b')]['where']||null:null,'attributes':_0x53b53d[_0x6483('0x1b')]?_0x53b53d[_0x6483('0x1b')][_0x6483('0x1d')]||null:null,'limit':_0x53b53d['options']?_0x53b53d[_0x6483('0x1b')]['limit']||null:null,'include':_0x53b53d['options']?_0x53b53d[_0x6483('0x1b')][_0x6483('0x1e')]?_[_0x6483('0x1f')](_0x53b53d['options']['include'],function(_0x34c8ce){return{'model':db[_0x34c8ce['model']],'as':_0x34c8ce['as'],'attributes':_0x34c8ce[_0x6483('0x1d')],'include':_0x34c8ce[_0x6483('0x1e')]?_[_0x6483('0x1f')](_0x34c8ce[_0x6483('0x1e')],function(_0x4a6dd8){return{'model':db[_0x4a6dd8[_0x6483('0x20')]],'as':_0x4a6dd8['as'],'attributes':_0x4a6dd8[_0x6483('0x1d')],'include':_0x4a6dd8[_0x6483('0x1e')]?_[_0x6483('0x1f')](_0x4a6dd8['include'],function(_0x2cb7d6){return{'model':db[_0x2cb7d6[_0x6483('0x20')]],'as':_0x2cb7d6['as'],'attributes':_0x2cb7d6[_0x6483('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5947dd){logger['info'](_0x6483('0x1a'),_0x53b53d);logger[_0x6483('0x12')](_0x6483('0x1a'),_0x53b53d,JSON[_0x6483('0x21')](_0x5947dd));_0x227f64(_0x5947dd);})['catch'](function(_0x12a64b){logger[_0x6483('0x15')](_0x6483('0x1a'),_0x12a64b[_0x6483('0x16')],_0x53b53d);_0x481412(_0x29a54e[_0x6483('0x15')](0x1f4,_0x12a64b[_0x6483('0x16')]));});});};exports[_0x6483('0x22')]=function(_0x10c6c1){var _0xb0830a=this;return new Promise(function(_0x51fdeb,_0x1d7178){return db['SmsQueue']['find']({'raw':_0x10c6c1['options']?_0x10c6c1[_0x6483('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x10c6c1['options']?_0x10c6c1[_0x6483('0x1b')][_0x6483('0x23')]||null:null,'attributes':_0x10c6c1['options']?_0x10c6c1[_0x6483('0x1b')]['attributes']||null:null,'include':_0x10c6c1[_0x6483('0x1b')]?_0x10c6c1[_0x6483('0x1b')][_0x6483('0x1e')]?_[_0x6483('0x1f')](_0x10c6c1[_0x6483('0x1b')][_0x6483('0x1e')],function(_0x2723e5){return{'model':db[_0x2723e5[_0x6483('0x20')]],'as':_0x2723e5['as'],'attributes':_0x2723e5[_0x6483('0x1d')],'include':_0x2723e5['include']?_[_0x6483('0x1f')](_0x2723e5[_0x6483('0x1e')],function(_0x1de438){return{'model':db[_0x1de438[_0x6483('0x20')]],'as':_0x1de438['as'],'attributes':_0x1de438['attributes'],'include':_0x1de438[_0x6483('0x1e')]?_[_0x6483('0x1f')](_0x1de438[_0x6483('0x1e')],function(_0x439b65){return{'model':db[_0x439b65[_0x6483('0x20')]],'as':_0x439b65['as'],'attributes':_0x439b65[_0x6483('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6483('0x10')](function(_0x146bac){logger[_0x6483('0x11')](_0x6483('0x22'),_0x10c6c1);logger[_0x6483('0x12')](_0x6483('0x22'),_0x10c6c1,JSON[_0x6483('0x21')](_0x146bac));_0x51fdeb(_0x146bac);})[_0x6483('0x19')](function(_0x5c493b){logger[_0x6483('0x15')](_0x6483('0x22'),_0x5c493b[_0x6483('0x16')],_0x10c6c1);_0x1d7178(_0xb0830a['error'](0x1f4,_0x5c493b['message']));});});};
\ No newline at end of file
+var _0xe208=['./smsQueue.socket','register','request','then','info','request\x20sent','debug','stringify','error','SmsQueue,\x20%s,\x20%s','message','catch','GetSmsQueue','SmsQueue','options','raw','where','attributes','limit','include','map','model','ShowSmsQueue','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x440202,_0x59e436){var _0x4381c9=function(_0xb93104){while(--_0xb93104){_0x440202['push'](_0x440202['shift']());}};_0x4381c9(++_0x59e436);}(_0xe208,0x83));var _0x8e20=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0xe208[_0xc67528];return _0x38e26d;};'use strict';var _=require(_0x8e20('0x0'));var util=require(_0x8e20('0x1'));var moment=require(_0x8e20('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e20('0x3'))['db'];var utils=require(_0x8e20('0x4'));var logger=require(_0x8e20('0x5'))(_0x8e20('0x6'));var config=require(_0x8e20('0x7'));var jayson=require(_0x8e20('0x8'));var client=jayson[_0x8e20('0x9')][_0x8e20('0xa')]({'port':0x232a});config[_0x8e20('0xb')]=_[_0x8e20('0xc')](config[_0x8e20('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8e20('0xb')]));require(_0x8e20('0xd'))[_0x8e20('0xe')](socket);function respondWithRpcPromise(_0x325dc3,_0x1cbd3b,_0x2b86a7){return new BPromise(function(_0xaea8fa,_0x3a77f0){return client[_0x8e20('0xf')](_0x325dc3,_0x2b86a7)[_0x8e20('0x10')](function(_0x3344fc){logger[_0x8e20('0x11')]('SmsQueue,\x20%s,\x20%s',_0x1cbd3b,_0x8e20('0x12'));logger[_0x8e20('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x1cbd3b,'request\x20sent',JSON[_0x8e20('0x14')](_0x3344fc));if(_0x3344fc[_0x8e20('0x15')]){if(_0x3344fc[_0x8e20('0x15')]['code']===0x1f4){logger[_0x8e20('0x15')](_0x8e20('0x16'),_0x1cbd3b,_0x3344fc[_0x8e20('0x15')][_0x8e20('0x17')]);return _0x3a77f0(_0x3344fc[_0x8e20('0x15')][_0x8e20('0x17')]);}logger[_0x8e20('0x15')]('SmsQueue,\x20%s,\x20%s',_0x1cbd3b,_0x3344fc[_0x8e20('0x15')]['message']);return _0xaea8fa(_0x3344fc[_0x8e20('0x15')][_0x8e20('0x17')]);}else{logger['info'](_0x8e20('0x16'),_0x1cbd3b,'request\x20sent');_0xaea8fa(_0x3344fc['result'][_0x8e20('0x17')]);}})[_0x8e20('0x18')](function(_0x23e15a){logger[_0x8e20('0x15')]('SmsQueue,\x20%s,\x20%s',_0x1cbd3b,_0x23e15a);_0x3a77f0(_0x23e15a);});});}exports[_0x8e20('0x19')]=function(_0x30369c){var _0x119289=this;return new Promise(function(_0x46ae61,_0x3f1463){return db[_0x8e20('0x1a')]['findAll']({'raw':_0x30369c[_0x8e20('0x1b')]?_0x30369c[_0x8e20('0x1b')][_0x8e20('0x1c')]===undefined?!![]:![]:!![],'where':_0x30369c['options']?_0x30369c[_0x8e20('0x1b')][_0x8e20('0x1d')]||null:null,'attributes':_0x30369c[_0x8e20('0x1b')]?_0x30369c[_0x8e20('0x1b')][_0x8e20('0x1e')]||null:null,'limit':_0x30369c[_0x8e20('0x1b')]?_0x30369c[_0x8e20('0x1b')][_0x8e20('0x1f')]||null:null,'include':_0x30369c[_0x8e20('0x1b')]?_0x30369c[_0x8e20('0x1b')][_0x8e20('0x20')]?_[_0x8e20('0x21')](_0x30369c['options']['include'],function(_0x1d1a4c){return{'model':db[_0x1d1a4c[_0x8e20('0x22')]],'as':_0x1d1a4c['as'],'attributes':_0x1d1a4c[_0x8e20('0x1e')],'include':_0x1d1a4c[_0x8e20('0x20')]?_[_0x8e20('0x21')](_0x1d1a4c[_0x8e20('0x20')],function(_0x32597a){return{'model':db[_0x32597a['model']],'as':_0x32597a['as'],'attributes':_0x32597a[_0x8e20('0x1e')],'include':_0x32597a['include']?_[_0x8e20('0x21')](_0x32597a['include'],function(_0xacccde){return{'model':db[_0xacccde[_0x8e20('0x22')]],'as':_0xacccde['as'],'attributes':_0xacccde[_0x8e20('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8e20('0x10')](function(_0x31f285){logger[_0x8e20('0x11')]('GetSmsQueue',_0x30369c);logger[_0x8e20('0x13')](_0x8e20('0x19'),_0x30369c,JSON[_0x8e20('0x14')](_0x31f285));_0x46ae61(_0x31f285);})[_0x8e20('0x18')](function(_0x152593){logger['error'](_0x8e20('0x19'),_0x152593[_0x8e20('0x17')],_0x30369c);_0x3f1463(_0x119289[_0x8e20('0x15')](0x1f4,_0x152593[_0x8e20('0x17')]));});});};exports['ShowSmsQueue']=function(_0x4f579c){var _0xc61449=this;return new Promise(function(_0x4e4446,_0x480247){return db[_0x8e20('0x1a')]['find']({'raw':_0x4f579c['options']?_0x4f579c[_0x8e20('0x1b')][_0x8e20('0x1c')]===undefined?!![]:![]:!![],'where':_0x4f579c['options']?_0x4f579c[_0x8e20('0x1b')][_0x8e20('0x1d')]||null:null,'attributes':_0x4f579c[_0x8e20('0x1b')]?_0x4f579c[_0x8e20('0x1b')][_0x8e20('0x1e')]||null:null,'include':_0x4f579c['options']?_0x4f579c['options']['include']?_[_0x8e20('0x21')](_0x4f579c[_0x8e20('0x1b')]['include'],function(_0x4cbad9){return{'model':db[_0x4cbad9['model']],'as':_0x4cbad9['as'],'attributes':_0x4cbad9[_0x8e20('0x1e')],'include':_0x4cbad9['include']?_[_0x8e20('0x21')](_0x4cbad9['include'],function(_0x5b7856){return{'model':db[_0x5b7856['model']],'as':_0x5b7856['as'],'attributes':_0x5b7856[_0x8e20('0x1e')],'include':_0x5b7856[_0x8e20('0x20')]?_[_0x8e20('0x21')](_0x5b7856[_0x8e20('0x20')],function(_0x4e70c1){return{'model':db[_0x4e70c1['model']],'as':_0x4e70c1['as'],'attributes':_0x4e70c1[_0x8e20('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25f2db){logger[_0x8e20('0x11')](_0x8e20('0x23'),_0x4f579c);logger[_0x8e20('0x13')](_0x8e20('0x23'),_0x4f579c,JSON[_0x8e20('0x14')](_0x25f2db));_0x4e4446(_0x25f2db);})[_0x8e20('0x18')](function(_0x1fe7c8){logger['error'](_0x8e20('0x23'),_0x1fe7c8['message'],_0x4f579c);_0x480247(_0xc61449[_0x8e20('0x15')](0x1f4,_0x1fe7c8[_0x8e20('0x17')]));});});};
\ No newline at end of file
index 5a50045..1f5c408 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fd3=['smsQueue:','./smsQueue.events','save','remove','emit','removeListener'];(function(_0x3861f7,_0x995b22){var _0x50879f=function(_0x3003f1){while(--_0x3003f1){_0x3861f7['push'](_0x3861f7['shift']());}};_0x50879f(++_0x995b22);}(_0x4fd3,0x15d));var _0x34fd=function(_0x1edea6,_0x867058){_0x1edea6=_0x1edea6-0x0;var _0x262191=_0x4fd3[_0x1edea6];return _0x262191;};'use strict';var SmsQueueEvents=require(_0x34fd('0x0'));var events=[_0x34fd('0x1'),_0x34fd('0x2'),'update'];function createListener(_0x92bdeb,_0x39438f){return function(_0x95454a){_0x39438f[_0x34fd('0x3')](_0x92bdeb,_0x95454a);};}function removeListener(_0x2e571a,_0x4b2e7c){return function(){SmsQueueEvents[_0x34fd('0x4')](_0x2e571a,_0x4b2e7c);};}exports['register']=function(_0x234a76){for(var _0x28829a=0x0,_0x4a525e=events['length'];_0x28829a<_0x4a525e;_0x28829a++){var _0xe237fb=events[_0x28829a];var _0x218891=createListener(_0x34fd('0x5')+_0xe237fb,_0x234a76);SmsQueueEvents['on'](_0xe237fb,_0x218891);}};
\ No newline at end of file
+var _0x1763=['smsQueue:','save','remove','update','removeListener'];(function(_0x31a938,_0x4daec6){var _0x1bf341=function(_0x514261){while(--_0x514261){_0x31a938['push'](_0x31a938['shift']());}};_0x1bf341(++_0x4daec6);}(_0x1763,0xc4));var _0x3176=function(_0x54d52c,_0x55b8d9){_0x54d52c=_0x54d52c-0x0;var _0x28f99e=_0x1763[_0x54d52c];return _0x28f99e;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x3176('0x0'),_0x3176('0x1'),_0x3176('0x2')];function createListener(_0x2c4e8e,_0x575d92){return function(_0x1dff49){_0x575d92['emit'](_0x2c4e8e,_0x1dff49);};}function removeListener(_0x2c3756,_0x527dad){return function(){SmsQueueEvents[_0x3176('0x3')](_0x2c3756,_0x527dad);};}exports['register']=function(_0x1ef825){for(var _0x5613fb=0x0,_0x1ba873=events['length'];_0x5613fb<_0x1ba873;_0x5613fb++){var _0x5ea9ea=events[_0x5613fb];var _0x2176cb=createListener(_0x3176('0x4')+_0x5ea9ea,_0x1ef825);SmsQueueEvents['on'](_0x5ea9ea,_0x2176cb);}};
\ No newline at end of file
index d6423e1..36aac44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc21c=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','put','delete','destroy','multer','util'];(function(_0xc42c74,_0x3ee920){var _0xbe1455=function(_0x421ee4){while(--_0x421ee4){_0xc42c74['push'](_0xc42c74['shift']());}};_0xbe1455(++_0x3ee920);}(_0xc21c,0x166));var _0xcc21=function(_0x11a90e,_0x30b2ed){_0x11a90e=_0x11a90e-0x0;var _0x17a19f=_0xc21c[_0x11a90e];return _0x17a19f;};'use strict';var multer=require(_0xcc21('0x0'));var util=require(_0xcc21('0x1'));var path=require('path');var timeout=require(_0xcc21('0x2'));var express=require(_0xcc21('0x3'));var router=express[_0xcc21('0x4')]();var fs_extra=require(_0xcc21('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcc21('0x6'));var config=require(_0xcc21('0x7'));var controller=require(_0xcc21('0x8'));router[_0xcc21('0x9')]('/',auth[_0xcc21('0xa')](),controller[_0xcc21('0xb')]);router[_0xcc21('0x9')]('/describe',auth[_0xcc21('0xa')](),controller[_0xcc21('0xc')]);router[_0xcc21('0x9')](_0xcc21('0xd'),auth['isAuthenticated'](),controller[_0xcc21('0xe')]);router['post']('/',auth[_0xcc21('0xa')](),controller['create']);router[_0xcc21('0xf')](_0xcc21('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xcc21('0x10')](_0xcc21('0xd'),auth['isAuthenticated'](),controller[_0xcc21('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x03e2=['/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x486532,_0x20e6d1){var _0x931fb0=function(_0x39b47f){while(--_0x39b47f){_0x486532['push'](_0x486532['shift']());}};_0x931fb0(++_0x20e6d1);}(_0x03e2,0x119));var _0x203e=function(_0x257e5c,_0x492b31){_0x257e5c=_0x257e5c-0x0;var _0x2becff=_0x03e2[_0x257e5c];return _0x2becff;};'use strict';var multer=require('multer');var util=require(_0x203e('0x0'));var path=require(_0x203e('0x1'));var timeout=require(_0x203e('0x2'));var express=require(_0x203e('0x3'));var router=express[_0x203e('0x4')]();var fs_extra=require(_0x203e('0x5'));var auth=require(_0x203e('0x6'));var interaction=require(_0x203e('0x7'));var config=require(_0x203e('0x8'));var controller=require('./smsQueueReport.controller');router[_0x203e('0x9')]('/',auth[_0x203e('0xa')](),controller['index']);router[_0x203e('0x9')](_0x203e('0xb'),auth['isAuthenticated'](),controller[_0x203e('0xc')]);router[_0x203e('0x9')](_0x203e('0xd'),auth['isAuthenticated'](),controller[_0x203e('0xe')]);router[_0x203e('0xf')]('/',auth[_0x203e('0xa')](),controller[_0x203e('0x10')]);router[_0x203e('0x11')]('/:id',auth[_0x203e('0xa')](),controller[_0x203e('0x12')]);router[_0x203e('0x13')](_0x203e('0xd'),auth[_0x203e('0xa')](),controller[_0x203e('0x14')]);module['exports']=router;
\ No newline at end of file
index c082601..f0f04a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cab=['sequelize','exports','STRING','DATE','moment'];(function(_0x1ab180,_0x382b2c){var _0xfb2c2d=function(_0x1c5fd3){while(--_0x1c5fd3){_0x1ab180['push'](_0x1ab180['shift']());}};_0xfb2c2d(++_0x382b2c);}(_0x7cab,0x18a));var _0xb7ca=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x7cab[_0x2642cb];return _0xe6e41;};'use strict';var moment=require(_0xb7ca('0x0'));var Sequelize=require(_0xb7ca('0x1'));module[_0xb7ca('0x2')]={'uniqueid':{'type':Sequelize[_0xb7ca('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb7ca('0x3')]},'joinAt':{'type':Sequelize[_0xb7ca('0x4')]},'leaveAt':{'type':Sequelize[_0xb7ca('0x4')]},'acceptAt':{'type':Sequelize[_0xb7ca('0x4')]},'exitAt':{'type':Sequelize[_0xb7ca('0x4')]},'reason':{'type':Sequelize[_0xb7ca('0x3')]}};
\ No newline at end of file
+var _0xbb07=['moment','sequelize','exports','STRING','DATE'];(function(_0x662c2e,_0x1574c0){var _0x1203d3=function(_0x1068e6){while(--_0x1068e6){_0x662c2e['push'](_0x662c2e['shift']());}};_0x1203d3(++_0x1574c0);}(_0xbb07,0xf0));var _0x7bb0=function(_0x3feed7,_0x209f8e){_0x3feed7=_0x3feed7-0x0;var _0x38fbcd=_0xbb07[_0x3feed7];return _0x38fbcd;};'use strict';var moment=require(_0x7bb0('0x0'));var Sequelize=require(_0x7bb0('0x1'));module[_0x7bb0('0x2')]={'uniqueid':{'type':Sequelize[_0x7bb0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7bb0('0x3')]},'joinAt':{'type':Sequelize[_0x7bb0('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x7bb0('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x7bb0('0x3')]}};
\ No newline at end of file
index 09dbbc9..ff9839b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb78d=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','sendStatus','error','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','then','includeAll','include','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x74115b,_0x31f752){var _0x57ebbd=function(_0x234873){while(--_0x234873){_0x74115b['push'](_0x74115b['shift']());}};_0x57ebbd(++_0x31f752);}(_0xb78d,0x113));var _0xdb78=function(_0x963b7b,_0x26dde9){_0x963b7b=_0x963b7b-0x0;var _0x6ea1b9=_0xb78d[_0x963b7b];return _0x6ea1b9;};'use strict';var emlformat=require(_0xdb78('0x0'));var rimraf=require(_0xdb78('0x1'));var zipdir=require(_0xdb78('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdb78('0x3'));var util=require(_0xdb78('0x4'));var path=require(_0xdb78('0x5'));var sox=require(_0xdb78('0x6'));var csv=require(_0xdb78('0x7'));var ejs=require(_0xdb78('0x8'));var fs=require('fs');var fs_extra=require(_0xdb78('0x9'));var _=require(_0xdb78('0xa'));var squel=require(_0xdb78('0xb'));var crypto=require('crypto');var jsforce=require(_0xdb78('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdb78('0x7'));var querystring=require(_0xdb78('0xd'));var Papa=require(_0xdb78('0xe'));var Redis=require(_0xdb78('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdb78('0x10'));var as=require(_0xdb78('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb78('0x12'))(_0xdb78('0x13'));var utils=require(_0xdb78('0x14'));var config=require(_0xdb78('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xdb78('0x16'))['db'];function respondWithStatusCode(_0x1a5c6f,_0x42eb85){_0x42eb85=_0x42eb85||0xcc;return function(_0x356862){if(_0x356862){return _0x1a5c6f['sendStatus'](_0x42eb85);}return _0x1a5c6f['status'](_0x42eb85)[_0xdb78('0x17')]();};}function respondWithResult(_0x5a3bdc,_0x288eb){_0x288eb=_0x288eb||0xc8;return function(_0x3cdc60){if(_0x3cdc60){return _0x5a3bdc[_0xdb78('0x18')](_0x288eb)['json'](_0x3cdc60);}};}function respondWithFilteredResult(_0x41a7b9,_0x18b71b){return function(_0x270563){if(_0x270563){var _0x2c679f=typeof _0x18b71b[_0xdb78('0x19')]===_0xdb78('0x1a')&&typeof _0x18b71b[_0xdb78('0x1b')]===_0xdb78('0x1a');var _0x164205=_0x270563[_0xdb78('0x1c')];var _0x24c50c=_0x2c679f?0x0:_0x18b71b[_0xdb78('0x19')];var _0x41aa16=_0x2c679f?_0x270563[_0xdb78('0x1c')]:_0x18b71b['offset']+_0x18b71b[_0xdb78('0x1b')];var _0x53d882;if(_0x41aa16>=_0x164205){_0x41aa16=_0x164205;_0x53d882=0xc8;}else{_0x53d882=0xce;}_0x41a7b9[_0xdb78('0x18')](_0x53d882);return _0x41a7b9[_0xdb78('0x1d')]('Content-Range',_0x24c50c+'-'+_0x41aa16+'/'+_0x164205)[_0xdb78('0x1e')](_0x270563);}return null;};}function patchUpdates(_0x9da8f8){return function(_0x528753){try{jsonpatch[_0xdb78('0x1f')](_0x528753,_0x9da8f8,!![]);}catch(_0x62021f){return BPromise[_0xdb78('0x20')](_0x62021f);}return _0x528753[_0xdb78('0x21')]();};}function saveUpdates(_0x100deb,_0x1adf20){return function(_0x11dad6){if(_0x11dad6){return _0x11dad6[_0xdb78('0x22')](_0x100deb)['then'](function(_0x5517c1){return _0x5517c1;});}return null;};}function removeEntity(_0x122065,_0xa3dc7d){return function(_0x228971){if(_0x228971){return _0x228971[_0xdb78('0x23')]()['then'](function(){_0x122065[_0xdb78('0x18')](0xcc)[_0xdb78('0x17')]();});}};}function handleEntityNotFound(_0x4f85b9,_0x41762c){return function(_0xc0cf03){if(!_0xc0cf03){_0x4f85b9[_0xdb78('0x24')](0x194);}return _0xc0cf03;};}function handleError(_0x11f9c7,_0x1603c3){_0x1603c3=_0x1603c3||0x1f4;return function(_0x27a982){logger[_0xdb78('0x25')](_0x27a982['stack']);if(_0x27a982[_0xdb78('0x26')]){delete _0x27a982[_0xdb78('0x26')];}_0x11f9c7[_0xdb78('0x18')](_0x1603c3)[_0xdb78('0x27')](_0x27a982);};}exports[_0xdb78('0x28')]=function(_0x57866a,_0x511dff){var _0x442130={},_0xb7e81e={},_0x3acc7c={'count':0x0,'rows':[]};var _0x37403e=_[_0xdb78('0x29')](db[_0xdb78('0x2a')][_0xdb78('0x2b')],function(_0x495616){return{'name':_0x495616[_0xdb78('0x2c')],'type':_0x495616[_0xdb78('0x2d')]['key']};});_0xb7e81e['model']=_[_0xdb78('0x29')](_0x37403e,_0xdb78('0x26'));_0xb7e81e[_0xdb78('0x2e')]=_[_0xdb78('0x2f')](_0x57866a[_0xdb78('0x2e')]);_0xb7e81e[_0xdb78('0x30')]=_['intersection'](_0xb7e81e[_0xdb78('0x31')],_0xb7e81e['query']);_0x442130['attributes']=_[_0xdb78('0x32')](_0xb7e81e[_0xdb78('0x31')],qs[_0xdb78('0x33')](_0x57866a[_0xdb78('0x2e')][_0xdb78('0x33')]));_0x442130[_0xdb78('0x34')]=_0x442130['attributes']['length']?_0x442130[_0xdb78('0x34')]:_0xb7e81e[_0xdb78('0x31')];if(!_0x57866a['query'][_0xdb78('0x35')](_0xdb78('0x36'))){_0x442130[_0xdb78('0x1b')]=qs[_0xdb78('0x1b')](_0x57866a['query'][_0xdb78('0x1b')]);_0x442130[_0xdb78('0x19')]=qs[_0xdb78('0x19')](_0x57866a[_0xdb78('0x2e')][_0xdb78('0x19')]);}_0x442130['order']=qs[_0xdb78('0x37')](_0x57866a['query'][_0xdb78('0x37')]);_0x442130[_0xdb78('0x38')]=qs[_0xdb78('0x30')](_[_0xdb78('0x39')](_0x57866a['query'],_0xb7e81e[_0xdb78('0x30')]),_0x37403e);if(_0x57866a[_0xdb78('0x2e')][_0xdb78('0x3a')]){_0x442130[_0xdb78('0x38')]=_[_0xdb78('0x3b')](_0x442130[_0xdb78('0x38')],{'$or':_[_0xdb78('0x29')](_0x37403e,function(_0x4980cb){if(_0x4980cb[_0xdb78('0x2d')]!=='VIRTUAL'){var _0x44d381={};_0x44d381[_0x4980cb[_0xdb78('0x26')]]={'$like':'%'+_0x57866a[_0xdb78('0x2e')][_0xdb78('0x3a')]+'%'};return _0x44d381;}})});}_0x442130=_[_0xdb78('0x3b')]({},_0x442130,_0x57866a[_0xdb78('0x3c')]);var _0x5d0bf4={'where':_0x442130[_0xdb78('0x38')]};return db[_0xdb78('0x2a')][_0xdb78('0x1c')](_0x5d0bf4)[_0xdb78('0x3d')](function(_0xf3f979){_0x3acc7c['count']=_0xf3f979;if(_0x57866a['query'][_0xdb78('0x3e')]){_0x442130[_0xdb78('0x3f')]=[{'all':!![]}];}return db[_0xdb78('0x2a')]['findAll'](_0x442130);})[_0xdb78('0x3d')](function(_0x77e036){_0x3acc7c[_0xdb78('0x40')]=_0x77e036;return _0x3acc7c;})['then'](respondWithFilteredResult(_0x511dff,_0x442130))[_0xdb78('0x41')](handleError(_0x511dff,null));};exports[_0xdb78('0x42')]=function(_0x168abb,_0xb88bbc){var _0x2422ae={'raw':!![],'where':{'id':_0x168abb['params']['id']}},_0x5c53ee={};_0x5c53ee[_0xdb78('0x31')]=_[_0xdb78('0x2f')](db[_0xdb78('0x2a')]['rawAttributes']);_0x5c53ee[_0xdb78('0x2e')]=_[_0xdb78('0x2f')](_0x168abb[_0xdb78('0x2e')]);_0x5c53ee[_0xdb78('0x30')]=_[_0xdb78('0x32')](_0x5c53ee[_0xdb78('0x31')],_0x5c53ee[_0xdb78('0x2e')]);_0x2422ae[_0xdb78('0x34')]=_['intersection'](_0x5c53ee[_0xdb78('0x31')],qs[_0xdb78('0x33')](_0x168abb[_0xdb78('0x2e')][_0xdb78('0x33')]));_0x2422ae[_0xdb78('0x34')]=_0x2422ae['attributes']['length']?_0x2422ae['attributes']:_0x5c53ee[_0xdb78('0x31')];if(_0x168abb['query'][_0xdb78('0x3e')]){_0x2422ae[_0xdb78('0x3f')]=[{'all':!![]}];}_0x2422ae=_[_0xdb78('0x3b')]({},_0x2422ae,_0x168abb[_0xdb78('0x3c')]);return db[_0xdb78('0x2a')][_0xdb78('0x43')](_0x2422ae)['then'](handleEntityNotFound(_0xb88bbc,null))['then'](respondWithResult(_0xb88bbc,null))['catch'](handleError(_0xb88bbc,null));};exports[_0xdb78('0x44')]=function(_0x2711ff,_0x1d2268){return db[_0xdb78('0x2a')][_0xdb78('0x44')](_0x2711ff[_0xdb78('0x45')],{})['then'](respondWithResult(_0x1d2268,0xc9))[_0xdb78('0x41')](handleError(_0x1d2268,null));};exports[_0xdb78('0x22')]=function(_0x2bae93,_0xa86658){if(_0x2bae93[_0xdb78('0x45')]['id']){delete _0x2bae93[_0xdb78('0x45')]['id'];}return db[_0xdb78('0x2a')][_0xdb78('0x43')]({'where':{'id':_0x2bae93[_0xdb78('0x46')]['id']}})[_0xdb78('0x3d')](handleEntityNotFound(_0xa86658,null))['then'](saveUpdates(_0x2bae93[_0xdb78('0x45')],null))[_0xdb78('0x3d')](respondWithResult(_0xa86658,null))['catch'](handleError(_0xa86658,null));};exports[_0xdb78('0x23')]=function(_0x42af53,_0xbb1e9){return db[_0xdb78('0x2a')]['find']({'where':{'id':_0x42af53[_0xdb78('0x46')]['id']}})[_0xdb78('0x3d')](handleEntityNotFound(_0xbb1e9,null))[_0xdb78('0x3d')](removeEntity(_0xbb1e9,null))['catch'](handleError(_0xbb1e9,null));};exports['describe']=function(_0x24e724,_0x5cd307){return db[_0xdb78('0x2a')][_0xdb78('0x47')]()[_0xdb78('0x3d')](respondWithResult(_0x5cd307,null))[_0xdb78('0x41')](handleError(_0x5cd307,null));};
\ No newline at end of file
+var _0x3d4b=['status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','SmsQueueReport','rawAttributes','type','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','then','includeAll','rows','catch','show','params','keys','include','find','create','body','describe','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x33c12c,_0x386940){var _0x36096c=function(_0x4d487c){while(--_0x4d487c){_0x33c12c['push'](_0x33c12c['shift']());}};_0x36096c(++_0x386940);}(_0x3d4b,0x14e));var _0xb3d4=function(_0x29af39,_0x343c56){_0x29af39=_0x29af39-0x0;var _0x3ab715=_0x3d4b[_0x29af39];return _0x3ab715;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb3d4('0x0'));var zipdir=require(_0xb3d4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb3d4('0x2'));var BPromise=require(_0xb3d4('0x3'));var Mustache=require(_0xb3d4('0x4'));var util=require(_0xb3d4('0x5'));var path=require('path');var sox=require(_0xb3d4('0x6'));var csv=require(_0xb3d4('0x7'));var ejs=require(_0xb3d4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb3d4('0x9'));var squel=require('squel');var crypto=require(_0xb3d4('0xa'));var jsforce=require(_0xb3d4('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb3d4('0x7'));var querystring=require(_0xb3d4('0xc'));var Papa=require(_0xb3d4('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb3d4('0xe'));var as=require(_0xb3d4('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb3d4('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xb3d4('0x11'));var licenseUtil=require(_0xb3d4('0x12'));var db=require(_0xb3d4('0x13'))['db'];function respondWithStatusCode(_0x39bb77,_0x2e9f75){_0x2e9f75=_0x2e9f75||0xcc;return function(_0x18aede){if(_0x18aede){return _0x39bb77[_0xb3d4('0x14')](_0x2e9f75);}return _0x39bb77[_0xb3d4('0x15')](_0x2e9f75)[_0xb3d4('0x16')]();};}function respondWithResult(_0x57c946,_0x3ea4fa){_0x3ea4fa=_0x3ea4fa||0xc8;return function(_0x1bbc8f){if(_0x1bbc8f){return _0x57c946[_0xb3d4('0x15')](_0x3ea4fa)[_0xb3d4('0x17')](_0x1bbc8f);}};}function respondWithFilteredResult(_0xf8e6cb,_0x2bb3ea){return function(_0x511665){if(_0x511665){var _0x4792c9=typeof _0x2bb3ea['offset']===_0xb3d4('0x18')&&typeof _0x2bb3ea['limit']==='undefined';var _0x1d57d5=_0x511665[_0xb3d4('0x19')];var _0x33e92e=_0x4792c9?0x0:_0x2bb3ea['offset'];var _0x1d6a2d=_0x4792c9?_0x511665['count']:_0x2bb3ea[_0xb3d4('0x1a')]+_0x2bb3ea[_0xb3d4('0x1b')];var _0x4609db;if(_0x1d6a2d>=_0x1d57d5){_0x1d6a2d=_0x1d57d5;_0x4609db=0xc8;}else{_0x4609db=0xce;}_0xf8e6cb['status'](_0x4609db);return _0xf8e6cb[_0xb3d4('0x1c')](_0xb3d4('0x1d'),_0x33e92e+'-'+_0x1d6a2d+'/'+_0x1d57d5)['json'](_0x511665);}return null;};}function patchUpdates(_0x5918c4){return function(_0x14d149){try{jsonpatch[_0xb3d4('0x1e')](_0x14d149,_0x5918c4,!![]);}catch(_0x941774){return BPromise[_0xb3d4('0x1f')](_0x941774);}return _0x14d149[_0xb3d4('0x20')]();};}function saveUpdates(_0xcaf06,_0xb62bb5){return function(_0x480418){if(_0x480418){return _0x480418[_0xb3d4('0x21')](_0xcaf06)['then'](function(_0x3ca2e1){return _0x3ca2e1;});}return null;};}function removeEntity(_0x428cb1,_0x399678){return function(_0x4e4661){if(_0x4e4661){return _0x4e4661[_0xb3d4('0x22')]()['then'](function(){_0x428cb1[_0xb3d4('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x530b3d,_0x14e30d){return function(_0x583e33){if(!_0x583e33){_0x530b3d['sendStatus'](0x194);}return _0x583e33;};}function handleError(_0x16274f,_0x99b67d){_0x99b67d=_0x99b67d||0x1f4;return function(_0x38e8c7){logger['error'](_0x38e8c7[_0xb3d4('0x23')]);if(_0x38e8c7[_0xb3d4('0x24')]){delete _0x38e8c7['name'];}_0x16274f[_0xb3d4('0x15')](_0x99b67d)[_0xb3d4('0x25')](_0x38e8c7);};}exports[_0xb3d4('0x26')]=function(_0x43081e,_0x3379e3){var _0x880aba={},_0x42d05b={},_0x411ce3={'count':0x0,'rows':[]};var _0x287641=_['map'](db[_0xb3d4('0x27')][_0xb3d4('0x28')],function(_0x20c710){return{'name':_0x20c710['fieldName'],'type':_0x20c710[_0xb3d4('0x29')]['key']};});_0x42d05b[_0xb3d4('0x2a')]=_[_0xb3d4('0x2b')](_0x287641,_0xb3d4('0x24'));_0x42d05b[_0xb3d4('0x2c')]=_['keys'](_0x43081e[_0xb3d4('0x2c')]);_0x42d05b[_0xb3d4('0x2d')]=_[_0xb3d4('0x2e')](_0x42d05b[_0xb3d4('0x2a')],_0x42d05b['query']);_0x880aba['attributes']=_['intersection'](_0x42d05b[_0xb3d4('0x2a')],qs['fields'](_0x43081e[_0xb3d4('0x2c')][_0xb3d4('0x2f')]));_0x880aba['attributes']=_0x880aba[_0xb3d4('0x30')][_0xb3d4('0x31')]?_0x880aba[_0xb3d4('0x30')]:_0x42d05b['model'];if(!_0x43081e[_0xb3d4('0x2c')][_0xb3d4('0x32')](_0xb3d4('0x33'))){_0x880aba['limit']=qs[_0xb3d4('0x1b')](_0x43081e[_0xb3d4('0x2c')]['limit']);_0x880aba['offset']=qs[_0xb3d4('0x1a')](_0x43081e['query'][_0xb3d4('0x1a')]);}_0x880aba['order']=qs[_0xb3d4('0x34')](_0x43081e[_0xb3d4('0x2c')][_0xb3d4('0x34')]);_0x880aba['where']=qs[_0xb3d4('0x2d')](_[_0xb3d4('0x35')](_0x43081e[_0xb3d4('0x2c')],_0x42d05b['filters']),_0x287641);if(_0x43081e[_0xb3d4('0x2c')][_0xb3d4('0x36')]){_0x880aba[_0xb3d4('0x37')]=_['merge'](_0x880aba['where'],{'$or':_[_0xb3d4('0x2b')](_0x287641,function(_0x417d5b){if(_0x417d5b[_0xb3d4('0x29')]!==_0xb3d4('0x38')){var _0x547562={};_0x547562[_0x417d5b[_0xb3d4('0x24')]]={'$like':'%'+_0x43081e['query'][_0xb3d4('0x36')]+'%'};return _0x547562;}})});}_0x880aba=_[_0xb3d4('0x39')]({},_0x880aba,_0x43081e[_0xb3d4('0x3a')]);var _0x37ef20={'where':_0x880aba[_0xb3d4('0x37')]};return db[_0xb3d4('0x27')][_0xb3d4('0x19')](_0x37ef20)[_0xb3d4('0x3b')](function(_0x4f1758){_0x411ce3[_0xb3d4('0x19')]=_0x4f1758;if(_0x43081e[_0xb3d4('0x2c')][_0xb3d4('0x3c')]){_0x880aba['include']=[{'all':!![]}];}return db[_0xb3d4('0x27')]['findAll'](_0x880aba);})[_0xb3d4('0x3b')](function(_0x59cd5f){_0x411ce3[_0xb3d4('0x3d')]=_0x59cd5f;return _0x411ce3;})['then'](respondWithFilteredResult(_0x3379e3,_0x880aba))[_0xb3d4('0x3e')](handleError(_0x3379e3,null));};exports[_0xb3d4('0x3f')]=function(_0x45437a,_0x3938e3){var _0x5139be={'raw':!![],'where':{'id':_0x45437a[_0xb3d4('0x40')]['id']}},_0x2e75ef={};_0x2e75ef[_0xb3d4('0x2a')]=_['keys'](db[_0xb3d4('0x27')]['rawAttributes']);_0x2e75ef['query']=_[_0xb3d4('0x41')](_0x45437a['query']);_0x2e75ef[_0xb3d4('0x2d')]=_[_0xb3d4('0x2e')](_0x2e75ef[_0xb3d4('0x2a')],_0x2e75ef[_0xb3d4('0x2c')]);_0x5139be[_0xb3d4('0x30')]=_[_0xb3d4('0x2e')](_0x2e75ef[_0xb3d4('0x2a')],qs[_0xb3d4('0x2f')](_0x45437a[_0xb3d4('0x2c')][_0xb3d4('0x2f')]));_0x5139be['attributes']=_0x5139be['attributes'][_0xb3d4('0x31')]?_0x5139be[_0xb3d4('0x30')]:_0x2e75ef[_0xb3d4('0x2a')];if(_0x45437a['query'][_0xb3d4('0x3c')]){_0x5139be[_0xb3d4('0x42')]=[{'all':!![]}];}_0x5139be=_['merge']({},_0x5139be,_0x45437a[_0xb3d4('0x3a')]);return db[_0xb3d4('0x27')][_0xb3d4('0x43')](_0x5139be)[_0xb3d4('0x3b')](handleEntityNotFound(_0x3938e3,null))['then'](respondWithResult(_0x3938e3,null))[_0xb3d4('0x3e')](handleError(_0x3938e3,null));};exports[_0xb3d4('0x44')]=function(_0x28a8f1,_0x1d36a3){return db[_0xb3d4('0x27')][_0xb3d4('0x44')](_0x28a8f1[_0xb3d4('0x45')],{})[_0xb3d4('0x3b')](respondWithResult(_0x1d36a3,0xc9))[_0xb3d4('0x3e')](handleError(_0x1d36a3,null));};exports[_0xb3d4('0x21')]=function(_0xacec19,_0x48a27f){if(_0xacec19[_0xb3d4('0x45')]['id']){delete _0xacec19[_0xb3d4('0x45')]['id'];}return db[_0xb3d4('0x27')]['find']({'where':{'id':_0xacec19['params']['id']}})[_0xb3d4('0x3b')](handleEntityNotFound(_0x48a27f,null))['then'](saveUpdates(_0xacec19[_0xb3d4('0x45')],null))[_0xb3d4('0x3b')](respondWithResult(_0x48a27f,null))['catch'](handleError(_0x48a27f,null));};exports['destroy']=function(_0x4e6ba6,_0x1d3add){return db[_0xb3d4('0x27')][_0xb3d4('0x43')]({'where':{'id':_0x4e6ba6['params']['id']}})[_0xb3d4('0x3b')](handleEntityNotFound(_0x1d3add,null))[_0xb3d4('0x3b')](removeEntity(_0x1d3add,null))[_0xb3d4('0x3e')](handleError(_0x1d3add,null));};exports[_0xb3d4('0x46')]=function(_0x379415,_0x13e5b5){return db[_0xb3d4('0x27')][_0xb3d4('0x46')]()[_0xb3d4('0x3b')](respondWithResult(_0x13e5b5,null))[_0xb3d4('0x3e')](handleError(_0x13e5b5,null));};
\ No newline at end of file
index 54037f3..d9b187f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0x4d089e,_0x33fb0e){var _0x14115d=function(_0x1c7638){while(--_0x1c7638){_0x4d089e['push'](_0x4d089e['shift']());}};_0x14115d(++_0x33fb0e);}(_0xe706,0xa3));var _0x6e70=function(_0x1599ae,_0x50ac2b){_0x1599ae=_0x1599ae-0x0;var _0x5c97cc=_0xe706[_0x1599ae];return _0x5c97cc;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 6f574d5..b299968 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0976=['raw','UpdateSmsQueueReport','update','options','where','limit','util','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','then','SmsQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body'];(function(_0x5466e0,_0x586206){var _0xf32c89=function(_0x68e0e9){while(--_0x68e0e9){_0x5466e0['push'](_0x5466e0['shift']());}};_0xf32c89(++_0x586206);}(_0x0976,0x1ec));var _0x6097=function(_0x59aa68,_0x3bda17){_0x59aa68=_0x59aa68-0x0;var _0x65207f=_0x0976[_0x59aa68];return _0x65207f;};'use strict';var _=require('lodash');var util=require(_0x6097('0x0'));var moment=require('moment');var BPromise=require(_0x6097('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6097('0x2'))['db'];var utils=require(_0x6097('0x3'));var logger=require('../../config/logger')(_0x6097('0x4'));var config=require('../../config/environment');var jayson=require(_0x6097('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x554153,_0x40046f,_0x23b0c0){return new BPromise(function(_0x5b135b,_0x3e236d){return client['request'](_0x554153,_0x23b0c0)[_0x6097('0x6')](function(_0x444bec){logger['info'](_0x6097('0x7'),_0x40046f,'request\x20sent');logger[_0x6097('0x8')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x40046f,'request\x20sent',JSON[_0x6097('0x9')](_0x444bec));if(_0x444bec[_0x6097('0xa')]){if(_0x444bec[_0x6097('0xa')][_0x6097('0xb')]===0x1f4){logger[_0x6097('0xa')](_0x6097('0x7'),_0x40046f,_0x444bec[_0x6097('0xa')][_0x6097('0xc')]);return _0x3e236d(_0x444bec['error'][_0x6097('0xc')]);}logger[_0x6097('0xa')]('SmsQueueReport,\x20%s,\x20%s',_0x40046f,_0x444bec[_0x6097('0xa')]['message']);return _0x5b135b(_0x444bec[_0x6097('0xa')]['message']);}else{logger[_0x6097('0xd')](_0x6097('0x7'),_0x40046f,_0x6097('0xe'));_0x5b135b(_0x444bec[_0x6097('0xf')]['message']);}})[_0x6097('0x10')](function(_0x9243f0){logger[_0x6097('0xa')](_0x6097('0x7'),_0x40046f,_0x9243f0);_0x3e236d(_0x9243f0);});});}exports[_0x6097('0x11')]=function(_0x22ce88){var _0x418084=this;return new Promise(function(_0x268be0,_0x17a568){return db[_0x6097('0x12')][_0x6097('0x13')](_0x22ce88[_0x6097('0x14')],{'raw':_0x22ce88['options']?_0x22ce88['options'][_0x6097('0x15')]===undefined?!![]:![]:!![]})[_0x6097('0x6')](function(_0x3c7c5b){logger[_0x6097('0xd')](_0x6097('0x11'),_0x22ce88);logger[_0x6097('0x8')](_0x6097('0x11'),_0x22ce88,JSON[_0x6097('0x9')](_0x3c7c5b));_0x268be0(_0x3c7c5b);})[_0x6097('0x10')](function(_0x5a7036){logger[_0x6097('0xa')](_0x6097('0x11'),_0x5a7036[_0x6097('0xc')],_0x22ce88);_0x17a568(_0x418084['error'](0x1f4,_0x5a7036[_0x6097('0xc')]));});});};exports[_0x6097('0x16')]=function(_0x5d3ac4){var _0x35028b=this;return new Promise(function(_0xa23a74,_0x56b35b){return db[_0x6097('0x12')][_0x6097('0x17')](_0x5d3ac4[_0x6097('0x14')],{'raw':_0x5d3ac4[_0x6097('0x18')]?_0x5d3ac4[_0x6097('0x18')][_0x6097('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d3ac4[_0x6097('0x18')]?_0x5d3ac4[_0x6097('0x18')][_0x6097('0x19')]||null:null,'attributes':_0x5d3ac4[_0x6097('0x18')]?_0x5d3ac4[_0x6097('0x18')]['attributes']||null:null,'limit':_0x5d3ac4[_0x6097('0x18')]?_0x5d3ac4[_0x6097('0x18')][_0x6097('0x1a')]||null:null})[_0x6097('0x6')](function(_0x2c8930){logger[_0x6097('0xd')](_0x6097('0x16'),_0x5d3ac4);logger[_0x6097('0x8')]('UpdateSmsQueueReport',_0x5d3ac4,JSON['stringify'](_0x2c8930));_0xa23a74(_0x2c8930);})[_0x6097('0x10')](function(_0x493daa){logger[_0x6097('0xa')](_0x6097('0x16'),_0x493daa[_0x6097('0xc')],_0x5d3ac4);_0x56b35b(_0x35028b['error'](0x1f4,_0x493daa[_0x6097('0xc')]));});});};
\ No newline at end of file
+var _0x3676=['CreateSmsQueueReport','SmsQueueReport','body','options','raw','update','where','attributes','limit','UpdateSmsQueueReport','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x3676,0x155));var _0x6367=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x3676[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0x6367('0x0'));var util=require(_0x6367('0x1'));var moment=require(_0x6367('0x2'));var BPromise=require(_0x6367('0x3'));var rs=require(_0x6367('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6367('0x5'));var logger=require(_0x6367('0x6'))(_0x6367('0x7'));var config=require('../../config/environment');var jayson=require(_0x6367('0x8'));var client=jayson[_0x6367('0x9')][_0x6367('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24e6c0,_0x8777fe,_0x189fbe){return new BPromise(function(_0xd7776d,_0x485ca5){return client[_0x6367('0xb')](_0x24e6c0,_0x189fbe)[_0x6367('0xc')](function(_0x15b086){logger['info'](_0x6367('0xd'),_0x8777fe,_0x6367('0xe'));logger[_0x6367('0xf')](_0x6367('0x10'),_0x8777fe,_0x6367('0xe'),JSON['stringify'](_0x15b086));if(_0x15b086[_0x6367('0x11')]){if(_0x15b086['error']['code']===0x1f4){logger[_0x6367('0x11')](_0x6367('0xd'),_0x8777fe,_0x15b086[_0x6367('0x11')]['message']);return _0x485ca5(_0x15b086[_0x6367('0x11')][_0x6367('0x12')]);}logger[_0x6367('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x8777fe,_0x15b086[_0x6367('0x11')][_0x6367('0x12')]);return _0xd7776d(_0x15b086['error']['message']);}else{logger[_0x6367('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x8777fe,'request\x20sent');_0xd7776d(_0x15b086[_0x6367('0x14')][_0x6367('0x12')]);}})[_0x6367('0x15')](function(_0x5a1c80){logger[_0x6367('0x11')](_0x6367('0xd'),_0x8777fe,_0x5a1c80);_0x485ca5(_0x5a1c80);});});}exports[_0x6367('0x16')]=function(_0x11ff9f){var _0x10a9a0=this;return new Promise(function(_0x1747f2,_0xf7f46b){return db[_0x6367('0x17')]['create'](_0x11ff9f[_0x6367('0x18')],{'raw':_0x11ff9f[_0x6367('0x19')]?_0x11ff9f[_0x6367('0x19')][_0x6367('0x1a')]===undefined?!![]:![]:!![]})[_0x6367('0xc')](function(_0x3277b6){logger[_0x6367('0x13')](_0x6367('0x16'),_0x11ff9f);logger[_0x6367('0xf')](_0x6367('0x16'),_0x11ff9f,JSON['stringify'](_0x3277b6));_0x1747f2(_0x3277b6);})[_0x6367('0x15')](function(_0x3e5f5c){logger[_0x6367('0x11')](_0x6367('0x16'),_0x3e5f5c['message'],_0x11ff9f);_0xf7f46b(_0x10a9a0[_0x6367('0x11')](0x1f4,_0x3e5f5c[_0x6367('0x12')]));});});};exports['UpdateSmsQueueReport']=function(_0x5b81df){var _0x3575c4=this;return new Promise(function(_0x21d08a,_0x50ff49){return db[_0x6367('0x17')][_0x6367('0x1b')](_0x5b81df[_0x6367('0x18')],{'raw':_0x5b81df[_0x6367('0x19')]?_0x5b81df[_0x6367('0x19')][_0x6367('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b81df[_0x6367('0x19')]?_0x5b81df[_0x6367('0x19')][_0x6367('0x1c')]||null:null,'attributes':_0x5b81df['options']?_0x5b81df[_0x6367('0x19')][_0x6367('0x1d')]||null:null,'limit':_0x5b81df['options']?_0x5b81df[_0x6367('0x19')][_0x6367('0x1e')]||null:null})[_0x6367('0xc')](function(_0x37d02e){logger[_0x6367('0x13')]('UpdateSmsQueueReport',_0x5b81df);logger[_0x6367('0xf')](_0x6367('0x1f'),_0x5b81df,JSON[_0x6367('0x20')](_0x37d02e));_0x21d08a(_0x37d02e);})[_0x6367('0x15')](function(_0x22c8c6){logger[_0x6367('0x11')](_0x6367('0x1f'),_0x22c8c6[_0x6367('0x12')],_0x5b81df);_0x50ff49(_0x3575c4['error'](0x1f4,_0x22c8c6[_0x6367('0x12')]));});});};
\ No newline at end of file
index f0b5204..0e9944f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fed=['path','connect-timeout','express','fs-extra','../../components/auth/service','./smsTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x34f415,_0x576ebf){var _0x1fb1ea=function(_0x29aa60){while(--_0x29aa60){_0x34f415['push'](_0x34f415['shift']());}};_0x1fb1ea(++_0x576ebf);}(_0x2fed,0x7c));var _0xd2fe=function(_0x26c5d7,_0x427c4a){_0x26c5d7=_0x26c5d7-0x0;var _0x54c934=_0x2fed[_0x26c5d7];return _0x54c934;};'use strict';var multer=require(_0xd2fe('0x0'));var util=require(_0xd2fe('0x1'));var path=require(_0xd2fe('0x2'));var timeout=require(_0xd2fe('0x3'));var express=require(_0xd2fe('0x4'));var router=express['Router']();var fs_extra=require(_0xd2fe('0x5'));var auth=require(_0xd2fe('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd2fe('0x7'));router[_0xd2fe('0x8')]('/',auth[_0xd2fe('0x9')](),controller['index']);router[_0xd2fe('0x8')](_0xd2fe('0xa'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0xb')]);router['get'](_0xd2fe('0xc'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0xd')]);router[_0xd2fe('0xe')]('/',auth[_0xd2fe('0x9')](),controller[_0xd2fe('0xf')]);router[_0xd2fe('0x10')](_0xd2fe('0xc'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0x11')]);router[_0xd2fe('0x12')](_0xd2fe('0xc'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0x13')]);module[_0xd2fe('0x14')]=router;
\ No newline at end of file
+var _0xfc76=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','isAuthenticated','index','get','describe','/:id','show','create','put','update'];(function(_0x24447f,_0xd9383a){var _0x5e3a92=function(_0x3d156b){while(--_0x3d156b){_0x24447f['push'](_0x24447f['shift']());}};_0x5e3a92(++_0xd9383a);}(_0xfc76,0xb5));var _0x6fc7=function(_0x438753,_0x5cb22a){_0x438753=_0x438753-0x0;var _0x2244cf=_0xfc76[_0x438753];return _0x2244cf;};'use strict';var multer=require('multer');var util=require(_0x6fc7('0x0'));var path=require(_0x6fc7('0x1'));var timeout=require(_0x6fc7('0x2'));var express=require(_0x6fc7('0x3'));var router=express[_0x6fc7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6fc7('0x5'));var interaction=require(_0x6fc7('0x6'));var config=require('../../config/environment');var controller=require(_0x6fc7('0x7'));router['get']('/',auth[_0x6fc7('0x8')](),controller[_0x6fc7('0x9')]);router[_0x6fc7('0xa')]('/describe',auth[_0x6fc7('0x8')](),controller[_0x6fc7('0xb')]);router[_0x6fc7('0xa')](_0x6fc7('0xc'),auth[_0x6fc7('0x8')](),controller[_0x6fc7('0xd')]);router['post']('/',auth[_0x6fc7('0x8')](),controller[_0x6fc7('0xe')]);router[_0x6fc7('0xf')](_0x6fc7('0xc'),auth[_0x6fc7('0x8')](),controller[_0x6fc7('0x10')]);router['delete'](_0x6fc7('0xc'),auth[_0x6fc7('0x8')](),controller['destroy']);module[_0x6fc7('0x11')]=router;
\ No newline at end of file
index 87ee86e..075669d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x5d6814,_0x1dfdc5){var _0x271a00=function(_0xf9c87c){while(--_0xf9c87c){_0x5d6814['push'](_0x5d6814['shift']());}};_0x271a00(++_0x1dfdc5);}(_0x34e8,0x12c));var _0x834e=function(_0xb9519d,_0x5e33ab){_0xb9519d=_0xb9519d-0x0;var _0x169796=_0x34e8[_0xb9519d];return _0x169796;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
+var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x4f75b5,_0x4db76d){var _0x5c263b=function(_0x31e622){while(--_0x31e622){_0x4f75b5['push'](_0x4f75b5['shift']());}};_0x5c263b(++_0x4db76d);}(_0x34e8,0x12c));var _0x834e=function(_0x57a77b,_0xf437d9){_0x57a77b=_0x57a77b-0x0;var _0x1d6394=_0x34e8[_0x57a77b];return _0x1d6394;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
index cd0a080..116aa57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca96=['params','keys','options','create','body','describe','eml-format','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','model','query','attributes','intersection','fields','length','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','count','includeAll','include','findAll','catch','show'];(function(_0x3a58aa,_0x583fcb){var _0x4d102b=function(_0x4eced6){while(--_0x4eced6){_0x3a58aa['push'](_0x3a58aa['shift']());}};_0x4d102b(++_0x583fcb);}(_0xca96,0x126));var _0x6ca9=function(_0x52e4c6,_0x386a70){_0x52e4c6=_0x52e4c6-0x0;var _0x39c471=_0xca96[_0x52e4c6];return _0x39c471;};'use strict';var emlformat=require(_0x6ca9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6ca9('0x1'));var moment=require('moment');var BPromise=require(_0x6ca9('0x2'));var Mustache=require(_0x6ca9('0x3'));var util=require('util');var path=require(_0x6ca9('0x4'));var sox=require(_0x6ca9('0x5'));var csv=require(_0x6ca9('0x6'));var ejs=require(_0x6ca9('0x7'));var fs=require('fs');var fs_extra=require(_0x6ca9('0x8'));var _=require(_0x6ca9('0x9'));var squel=require('squel');var crypto=require(_0x6ca9('0xa'));var jsforce=require(_0x6ca9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6ca9('0x6'));var querystring=require('querystring');var Papa=require(_0x6ca9('0xc'));var Redis=require('ioredis');var authService=require(_0x6ca9('0xd'));var qs=require(_0x6ca9('0xe'));var as=require(_0x6ca9('0xf'));var hardwareService=require(_0x6ca9('0x10'));var logger=require(_0x6ca9('0x11'))(_0x6ca9('0x12'));var utils=require(_0x6ca9('0x13'));var config=require(_0x6ca9('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ca9('0x15'))['db'];function respondWithStatusCode(_0x817d84,_0x3e6f7b){_0x3e6f7b=_0x3e6f7b||0xcc;return function(_0x39cc2e){if(_0x39cc2e){return _0x817d84[_0x6ca9('0x16')](_0x3e6f7b);}return _0x817d84[_0x6ca9('0x17')](_0x3e6f7b)['end']();};}function respondWithResult(_0xf92c22,_0x1c44ab){_0x1c44ab=_0x1c44ab||0xc8;return function(_0x45f78b){if(_0x45f78b){return _0xf92c22['status'](_0x1c44ab)[_0x6ca9('0x18')](_0x45f78b);}};}function respondWithFilteredResult(_0x206c36,_0x3a473d){return function(_0x15ea91){if(_0x15ea91){var _0x4f9617=typeof _0x3a473d[_0x6ca9('0x19')]===_0x6ca9('0x1a')&&typeof _0x3a473d[_0x6ca9('0x1b')]===_0x6ca9('0x1a');var _0x1a4523=_0x15ea91['count'];var _0x234536=_0x4f9617?0x0:_0x3a473d[_0x6ca9('0x19')];var _0x467c2c=_0x4f9617?_0x15ea91['count']:_0x3a473d[_0x6ca9('0x19')]+_0x3a473d[_0x6ca9('0x1b')];var _0x2c9735;if(_0x467c2c>=_0x1a4523){_0x467c2c=_0x1a4523;_0x2c9735=0xc8;}else{_0x2c9735=0xce;}_0x206c36[_0x6ca9('0x17')](_0x2c9735);return _0x206c36[_0x6ca9('0x1c')](_0x6ca9('0x1d'),_0x234536+'-'+_0x467c2c+'/'+_0x1a4523)['json'](_0x15ea91);}return null;};}function patchUpdates(_0x3920f2){return function(_0x31c673){try{jsonpatch[_0x6ca9('0x1e')](_0x31c673,_0x3920f2,!![]);}catch(_0xb639a8){return BPromise[_0x6ca9('0x1f')](_0xb639a8);}return _0x31c673['save']();};}function saveUpdates(_0x50166f,_0x566389){return function(_0x5c6d6c){if(_0x5c6d6c){return _0x5c6d6c[_0x6ca9('0x20')](_0x50166f)[_0x6ca9('0x21')](function(_0x48548c){return _0x48548c;});}return null;};}function removeEntity(_0x1e7bfe,_0xfdbf96){return function(_0x2c044d){if(_0x2c044d){return _0x2c044d[_0x6ca9('0x22')]()['then'](function(){_0x1e7bfe[_0x6ca9('0x17')](0xcc)[_0x6ca9('0x23')]();});}};}function handleEntityNotFound(_0xe1fe8f,_0x22c12e){return function(_0x305ac5){if(!_0x305ac5){_0xe1fe8f[_0x6ca9('0x16')](0x194);}return _0x305ac5;};}function handleError(_0x1654fe,_0x28c3a7){_0x28c3a7=_0x28c3a7||0x1f4;return function(_0x3af538){logger[_0x6ca9('0x24')](_0x3af538[_0x6ca9('0x25')]);if(_0x3af538[_0x6ca9('0x26')]){delete _0x3af538['name'];}_0x1654fe[_0x6ca9('0x17')](_0x28c3a7)[_0x6ca9('0x27')](_0x3af538);};}exports[_0x6ca9('0x28')]=function(_0x9539f4,_0x5b77a8){var _0x312b71={},_0x1df5ea={},_0x217142={'count':0x0,'rows':[]};var _0x3efc18=_[_0x6ca9('0x29')](db[_0x6ca9('0x2a')][_0x6ca9('0x2b')],function(_0xf7e9b0){return{'name':_0xf7e9b0[_0x6ca9('0x2c')],'type':_0xf7e9b0[_0x6ca9('0x2d')]['key']};});_0x1df5ea[_0x6ca9('0x2e')]=_['map'](_0x3efc18,'name');_0x1df5ea['query']=_['keys'](_0x9539f4['query']);_0x1df5ea['filters']=_['intersection'](_0x1df5ea[_0x6ca9('0x2e')],_0x1df5ea[_0x6ca9('0x2f')]);_0x312b71[_0x6ca9('0x30')]=_[_0x6ca9('0x31')](_0x1df5ea['model'],qs[_0x6ca9('0x32')](_0x9539f4['query'][_0x6ca9('0x32')]));_0x312b71[_0x6ca9('0x30')]=_0x312b71['attributes'][_0x6ca9('0x33')]?_0x312b71['attributes']:_0x1df5ea[_0x6ca9('0x2e')];if(!_0x9539f4[_0x6ca9('0x2f')]['hasOwnProperty'](_0x6ca9('0x34'))){_0x312b71[_0x6ca9('0x1b')]=qs['limit'](_0x9539f4[_0x6ca9('0x2f')][_0x6ca9('0x1b')]);_0x312b71['offset']=qs['offset'](_0x9539f4[_0x6ca9('0x2f')][_0x6ca9('0x19')]);}_0x312b71['order']=qs[_0x6ca9('0x35')](_0x9539f4['query'][_0x6ca9('0x35')]);_0x312b71[_0x6ca9('0x36')]=qs[_0x6ca9('0x37')](_[_0x6ca9('0x38')](_0x9539f4[_0x6ca9('0x2f')],_0x1df5ea[_0x6ca9('0x37')]),_0x3efc18);if(_0x9539f4[_0x6ca9('0x2f')]['filter']){_0x312b71[_0x6ca9('0x36')]=_[_0x6ca9('0x39')](_0x312b71['where'],{'$or':_[_0x6ca9('0x29')](_0x3efc18,function(_0xc1dfa7){if(_0xc1dfa7[_0x6ca9('0x2d')]!==_0x6ca9('0x3a')){var _0x3f3b5c={};_0x3f3b5c[_0xc1dfa7[_0x6ca9('0x26')]]={'$like':'%'+_0x9539f4[_0x6ca9('0x2f')][_0x6ca9('0x3b')]+'%'};return _0x3f3b5c;}})});}_0x312b71=_[_0x6ca9('0x39')]({},_0x312b71,_0x9539f4['options']);var _0x54c468={'where':_0x312b71[_0x6ca9('0x36')]};return db[_0x6ca9('0x2a')][_0x6ca9('0x3c')](_0x54c468)[_0x6ca9('0x21')](function(_0x4ce9e6){_0x217142[_0x6ca9('0x3c')]=_0x4ce9e6;if(_0x9539f4[_0x6ca9('0x2f')][_0x6ca9('0x3d')]){_0x312b71[_0x6ca9('0x3e')]=[{'all':!![]}];}return db[_0x6ca9('0x2a')][_0x6ca9('0x3f')](_0x312b71);})[_0x6ca9('0x21')](function(_0x560e41){_0x217142['rows']=_0x560e41;return _0x217142;})[_0x6ca9('0x21')](respondWithFilteredResult(_0x5b77a8,_0x312b71))[_0x6ca9('0x40')](handleError(_0x5b77a8,null));};exports[_0x6ca9('0x41')]=function(_0x5a87de,_0x120ad9){var _0x3c5de9={'raw':!![],'where':{'id':_0x5a87de[_0x6ca9('0x42')]['id']}},_0xe42930={};_0xe42930[_0x6ca9('0x2e')]=_[_0x6ca9('0x43')](db[_0x6ca9('0x2a')][_0x6ca9('0x2b')]);_0xe42930['query']=_[_0x6ca9('0x43')](_0x5a87de[_0x6ca9('0x2f')]);_0xe42930[_0x6ca9('0x37')]=_[_0x6ca9('0x31')](_0xe42930[_0x6ca9('0x2e')],_0xe42930['query']);_0x3c5de9['attributes']=_[_0x6ca9('0x31')](_0xe42930[_0x6ca9('0x2e')],qs[_0x6ca9('0x32')](_0x5a87de[_0x6ca9('0x2f')]['fields']));_0x3c5de9['attributes']=_0x3c5de9[_0x6ca9('0x30')][_0x6ca9('0x33')]?_0x3c5de9[_0x6ca9('0x30')]:_0xe42930[_0x6ca9('0x2e')];if(_0x5a87de['query'][_0x6ca9('0x3d')]){_0x3c5de9[_0x6ca9('0x3e')]=[{'all':!![]}];}_0x3c5de9=_[_0x6ca9('0x39')]({},_0x3c5de9,_0x5a87de[_0x6ca9('0x44')]);return db[_0x6ca9('0x2a')]['find'](_0x3c5de9)[_0x6ca9('0x21')](handleEntityNotFound(_0x120ad9,null))[_0x6ca9('0x21')](respondWithResult(_0x120ad9,null))['catch'](handleError(_0x120ad9,null));};exports[_0x6ca9('0x45')]=function(_0x29ca74,_0x3d33c6){return db['SmsTransferReport']['create'](_0x29ca74[_0x6ca9('0x46')],{})[_0x6ca9('0x21')](respondWithResult(_0x3d33c6,0xc9))['catch'](handleError(_0x3d33c6,null));};exports[_0x6ca9('0x20')]=function(_0x26d251,_0x41b8db){if(_0x26d251[_0x6ca9('0x46')]['id']){delete _0x26d251[_0x6ca9('0x46')]['id'];}return db[_0x6ca9('0x2a')]['find']({'where':{'id':_0x26d251[_0x6ca9('0x42')]['id']}})[_0x6ca9('0x21')](handleEntityNotFound(_0x41b8db,null))[_0x6ca9('0x21')](saveUpdates(_0x26d251[_0x6ca9('0x46')],null))[_0x6ca9('0x21')](respondWithResult(_0x41b8db,null))['catch'](handleError(_0x41b8db,null));};exports[_0x6ca9('0x22')]=function(_0x5574e9,_0x3b8310){return db[_0x6ca9('0x2a')]['find']({'where':{'id':_0x5574e9[_0x6ca9('0x42')]['id']}})[_0x6ca9('0x21')](handleEntityNotFound(_0x3b8310,null))[_0x6ca9('0x21')](removeEntity(_0x3b8310,null))['catch'](handleError(_0x3b8310,null));};exports[_0x6ca9('0x47')]=function(_0x29b450,_0x29a3c5){return db['SmsTransferReport']['describe']()[_0x6ca9('0x21')](respondWithResult(_0x29a3c5,null))['catch'](handleError(_0x29a3c5,null));};
\ No newline at end of file
+var _0xe3cd=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','key','query','keys','filters','attributes','intersection','model','fields','length','nolimit','order','where','pick','filter','merge','type','options','includeAll','rows','catch','show','params','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x20f28e,_0x1d2f0f){var _0x33f4a4=function(_0x439718){while(--_0x439718){_0x20f28e['push'](_0x20f28e['shift']());}};_0x33f4a4(++_0x1d2f0f);}(_0xe3cd,0x1ea));var _0xde3c=function(_0x5aa0ed,_0x3ecf24){_0x5aa0ed=_0x5aa0ed-0x0;var _0x4208c3=_0xe3cd[_0x5aa0ed];return _0x4208c3;};'use strict';var emlformat=require(_0xde3c('0x0'));var rimraf=require(_0xde3c('0x1'));var zipdir=require(_0xde3c('0x2'));var jsonpatch=require(_0xde3c('0x3'));var rp=require(_0xde3c('0x4'));var moment=require('moment');var BPromise=require(_0xde3c('0x5'));var Mustache=require(_0xde3c('0x6'));var util=require(_0xde3c('0x7'));var path=require(_0xde3c('0x8'));var sox=require(_0xde3c('0x9'));var csv=require(_0xde3c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xde3c('0xb'));var _=require(_0xde3c('0xc'));var squel=require('squel');var crypto=require(_0xde3c('0xd'));var jsforce=require(_0xde3c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xde3c('0xf'));var Papa=require(_0xde3c('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xde3c('0x11'));var hardwareService=require(_0xde3c('0x12'));var logger=require(_0xde3c('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xde3c('0x14'));var licenseUtil=require(_0xde3c('0x15'));var db=require(_0xde3c('0x16'))['db'];function respondWithStatusCode(_0x39e71d,_0x445ffa){_0x445ffa=_0x445ffa||0xcc;return function(_0x4d1366){if(_0x4d1366){return _0x39e71d[_0xde3c('0x17')](_0x445ffa);}return _0x39e71d['status'](_0x445ffa)[_0xde3c('0x18')]();};}function respondWithResult(_0x2b32e7,_0x1f6630){_0x1f6630=_0x1f6630||0xc8;return function(_0x17cab6){if(_0x17cab6){return _0x2b32e7[_0xde3c('0x19')](_0x1f6630)[_0xde3c('0x1a')](_0x17cab6);}};}function respondWithFilteredResult(_0x2f2e88,_0x2786b9){return function(_0x1638a8){if(_0x1638a8){var _0x21167c=typeof _0x2786b9[_0xde3c('0x1b')]==='undefined'&&typeof _0x2786b9[_0xde3c('0x1c')]===_0xde3c('0x1d');var _0x1c247f=_0x1638a8[_0xde3c('0x1e')];var _0x382cef=_0x21167c?0x0:_0x2786b9['offset'];var _0x4cf0fa=_0x21167c?_0x1638a8[_0xde3c('0x1e')]:_0x2786b9[_0xde3c('0x1b')]+_0x2786b9['limit'];var _0x18cb4d;if(_0x4cf0fa>=_0x1c247f){_0x4cf0fa=_0x1c247f;_0x18cb4d=0xc8;}else{_0x18cb4d=0xce;}_0x2f2e88['status'](_0x18cb4d);return _0x2f2e88[_0xde3c('0x1f')](_0xde3c('0x20'),_0x382cef+'-'+_0x4cf0fa+'/'+_0x1c247f)['json'](_0x1638a8);}return null;};}function patchUpdates(_0x41688b){return function(_0x1b06f2){try{jsonpatch[_0xde3c('0x21')](_0x1b06f2,_0x41688b,!![]);}catch(_0x4419cb){return BPromise['reject'](_0x4419cb);}return _0x1b06f2[_0xde3c('0x22')]();};}function saveUpdates(_0x23d721,_0x1579a9){return function(_0x53f2b3){if(_0x53f2b3){return _0x53f2b3['update'](_0x23d721)[_0xde3c('0x23')](function(_0x566381){return _0x566381;});}return null;};}function removeEntity(_0x552926,_0x132165){return function(_0x7d6f14){if(_0x7d6f14){return _0x7d6f14[_0xde3c('0x24')]()[_0xde3c('0x23')](function(){_0x552926['status'](0xcc)[_0xde3c('0x18')]();});}};}function handleEntityNotFound(_0x391a27,_0x2a3d2c){return function(_0x4cc8f6){if(!_0x4cc8f6){_0x391a27[_0xde3c('0x17')](0x194);}return _0x4cc8f6;};}function handleError(_0x50df46,_0x36dfea){_0x36dfea=_0x36dfea||0x1f4;return function(_0x237666){logger[_0xde3c('0x25')](_0x237666[_0xde3c('0x26')]);if(_0x237666[_0xde3c('0x27')]){delete _0x237666['name'];}_0x50df46['status'](_0x36dfea)[_0xde3c('0x28')](_0x237666);};}exports[_0xde3c('0x29')]=function(_0x4275ce,_0x5c348c){var _0x3e87e5={},_0x3a79db={},_0x1fe1b8={'count':0x0,'rows':[]};var _0x4a6ebc=_[_0xde3c('0x2a')](db[_0xde3c('0x2b')][_0xde3c('0x2c')],function(_0xbbfae0){return{'name':_0xbbfae0[_0xde3c('0x2d')],'type':_0xbbfae0['type'][_0xde3c('0x2e')]};});_0x3a79db['model']=_[_0xde3c('0x2a')](_0x4a6ebc,_0xde3c('0x27'));_0x3a79db[_0xde3c('0x2f')]=_[_0xde3c('0x30')](_0x4275ce[_0xde3c('0x2f')]);_0x3a79db[_0xde3c('0x31')]=_['intersection'](_0x3a79db['model'],_0x3a79db[_0xde3c('0x2f')]);_0x3e87e5[_0xde3c('0x32')]=_[_0xde3c('0x33')](_0x3a79db[_0xde3c('0x34')],qs[_0xde3c('0x35')](_0x4275ce[_0xde3c('0x2f')][_0xde3c('0x35')]));_0x3e87e5['attributes']=_0x3e87e5[_0xde3c('0x32')][_0xde3c('0x36')]?_0x3e87e5[_0xde3c('0x32')]:_0x3a79db[_0xde3c('0x34')];if(!_0x4275ce[_0xde3c('0x2f')]['hasOwnProperty'](_0xde3c('0x37'))){_0x3e87e5['limit']=qs['limit'](_0x4275ce[_0xde3c('0x2f')][_0xde3c('0x1c')]);_0x3e87e5[_0xde3c('0x1b')]=qs[_0xde3c('0x1b')](_0x4275ce[_0xde3c('0x2f')][_0xde3c('0x1b')]);}_0x3e87e5[_0xde3c('0x38')]=qs['sort'](_0x4275ce[_0xde3c('0x2f')]['sort']);_0x3e87e5[_0xde3c('0x39')]=qs[_0xde3c('0x31')](_[_0xde3c('0x3a')](_0x4275ce[_0xde3c('0x2f')],_0x3a79db[_0xde3c('0x31')]),_0x4a6ebc);if(_0x4275ce[_0xde3c('0x2f')][_0xde3c('0x3b')]){_0x3e87e5['where']=_[_0xde3c('0x3c')](_0x3e87e5[_0xde3c('0x39')],{'$or':_[_0xde3c('0x2a')](_0x4a6ebc,function(_0xc9a58c){if(_0xc9a58c[_0xde3c('0x3d')]!=='VIRTUAL'){var _0x536db6={};_0x536db6[_0xc9a58c[_0xde3c('0x27')]]={'$like':'%'+_0x4275ce['query'][_0xde3c('0x3b')]+'%'};return _0x536db6;}})});}_0x3e87e5=_[_0xde3c('0x3c')]({},_0x3e87e5,_0x4275ce[_0xde3c('0x3e')]);var _0x6d9036={'where':_0x3e87e5[_0xde3c('0x39')]};return db[_0xde3c('0x2b')][_0xde3c('0x1e')](_0x6d9036)[_0xde3c('0x23')](function(_0x458348){_0x1fe1b8[_0xde3c('0x1e')]=_0x458348;if(_0x4275ce[_0xde3c('0x2f')][_0xde3c('0x3f')]){_0x3e87e5['include']=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x3e87e5);})[_0xde3c('0x23')](function(_0x3a7704){_0x1fe1b8[_0xde3c('0x40')]=_0x3a7704;return _0x1fe1b8;})['then'](respondWithFilteredResult(_0x5c348c,_0x3e87e5))[_0xde3c('0x41')](handleError(_0x5c348c,null));};exports[_0xde3c('0x42')]=function(_0x56bb38,_0xbf3013){var _0x452c6b={'raw':!![],'where':{'id':_0x56bb38[_0xde3c('0x43')]['id']}},_0x1570d3={};_0x1570d3[_0xde3c('0x34')]=_['keys'](db[_0xde3c('0x2b')][_0xde3c('0x2c')]);_0x1570d3[_0xde3c('0x2f')]=_[_0xde3c('0x30')](_0x56bb38[_0xde3c('0x2f')]);_0x1570d3[_0xde3c('0x31')]=_[_0xde3c('0x33')](_0x1570d3['model'],_0x1570d3[_0xde3c('0x2f')]);_0x452c6b[_0xde3c('0x32')]=_[_0xde3c('0x33')](_0x1570d3[_0xde3c('0x34')],qs[_0xde3c('0x35')](_0x56bb38[_0xde3c('0x2f')]['fields']));_0x452c6b[_0xde3c('0x32')]=_0x452c6b['attributes'][_0xde3c('0x36')]?_0x452c6b[_0xde3c('0x32')]:_0x1570d3[_0xde3c('0x34')];if(_0x56bb38[_0xde3c('0x2f')][_0xde3c('0x3f')]){_0x452c6b['include']=[{'all':!![]}];}_0x452c6b=_['merge']({},_0x452c6b,_0x56bb38[_0xde3c('0x3e')]);return db[_0xde3c('0x2b')]['find'](_0x452c6b)[_0xde3c('0x23')](handleEntityNotFound(_0xbf3013,null))[_0xde3c('0x23')](respondWithResult(_0xbf3013,null))['catch'](handleError(_0xbf3013,null));};exports[_0xde3c('0x44')]=function(_0xb6ad33,_0x3b3cba){return db[_0xde3c('0x2b')][_0xde3c('0x44')](_0xb6ad33[_0xde3c('0x45')],{})[_0xde3c('0x23')](respondWithResult(_0x3b3cba,0xc9))['catch'](handleError(_0x3b3cba,null));};exports[_0xde3c('0x46')]=function(_0x1238af,_0x2bf831){if(_0x1238af[_0xde3c('0x45')]['id']){delete _0x1238af['body']['id'];}return db[_0xde3c('0x2b')][_0xde3c('0x47')]({'where':{'id':_0x1238af[_0xde3c('0x43')]['id']}})[_0xde3c('0x23')](handleEntityNotFound(_0x2bf831,null))[_0xde3c('0x23')](saveUpdates(_0x1238af[_0xde3c('0x45')],null))[_0xde3c('0x23')](respondWithResult(_0x2bf831,null))[_0xde3c('0x41')](handleError(_0x2bf831,null));};exports[_0xde3c('0x24')]=function(_0x1c1ab0,_0x1996db){return db[_0xde3c('0x2b')][_0xde3c('0x47')]({'where':{'id':_0x1c1ab0[_0xde3c('0x43')]['id']}})[_0xde3c('0x23')](handleEntityNotFound(_0x1996db,null))['then'](removeEntity(_0x1996db,null))[_0xde3c('0x41')](handleError(_0x1996db,null));};exports['describe']=function(_0x1f839e,_0x453542){return db[_0xde3c('0x2b')][_0xde3c('0x48')]()[_0xde3c('0x23')](respondWithResult(_0x453542,null))['catch'](handleError(_0x453542,null));};
\ No newline at end of file
index 769ac44..89b83ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6f1=['./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x460f81,_0x553431){var _0x423f0d=function(_0x267a6b){while(--_0x267a6b){_0x460f81['push'](_0x460f81['shift']());}};_0x423f0d(++_0x553431);}(_0xb6f1,0x118));var _0x1b6f=function(_0x333714,_0x3370ac){_0x333714=_0x333714-0x0;var _0x4c211e=_0xb6f1[_0x333714];return _0x4c211e;};'use strict';var _=require(_0x1b6f('0x0'));var util=require('util');var logger=require(_0x1b6f('0x1'))('api');var moment=require(_0x1b6f('0x2'));var BPromise=require(_0x1b6f('0x3'));var rp=require(_0x1b6f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b6f('0x5'));var config=require('../../config/environment');var attributes=require(_0x1b6f('0x6'));module[_0x1b6f('0x7')]=function(_0xd4703b,_0x493c91){return _0xd4703b['define'](_0x1b6f('0x8'),attributes,{'tableName':_0x1b6f('0x9'),'paranoid':![],'indexes':[{'name':_0x1b6f('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7cb2=['./smsTransferReport.attributes','define','SmsTransferReport','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x529695,_0xea1b07){var _0x15df0d=function(_0x13c6a8){while(--_0x13c6a8){_0x529695['push'](_0x529695['shift']());}};_0x15df0d(++_0xea1b07);}(_0x7cb2,0x178));var _0x27cb=function(_0x55e6f3,_0x4de09f){_0x55e6f3=_0x55e6f3-0x0;var _0x10a1e4=_0x7cb2[_0x55e6f3];return _0x10a1e4;};'use strict';var _=require('lodash');var util=require(_0x27cb('0x0'));var logger=require(_0x27cb('0x1'))(_0x27cb('0x2'));var moment=require(_0x27cb('0x3'));var BPromise=require(_0x27cb('0x4'));var rp=require(_0x27cb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x27cb('0x6'));var config=require(_0x27cb('0x7'));var attributes=require(_0x27cb('0x8'));module['exports']=function(_0x42604a,_0x3ca9ec){return _0x42604a[_0x27cb('0x9')](_0x27cb('0xa'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x27cb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index c38cc30..5008b7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe314=['debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','SmsTransferReport,\x20%s,\x20%s'];(function(_0x3861f7,_0x995b22){var _0x50879f=function(_0x3003f1){while(--_0x3003f1){_0x3861f7['push'](_0x3861f7['shift']());}};_0x50879f(++_0x995b22);}(_0xe314,0x7c));var _0x4e31=function(_0x2b8c3d,_0x5e52b6){_0x2b8c3d=_0x2b8c3d-0x0;var _0xf2b223=_0xe314[_0x2b8c3d];return _0xf2b223;};'use strict';var _=require('lodash');var util=require(_0x4e31('0x0'));var moment=require(_0x4e31('0x1'));var BPromise=require(_0x4e31('0x2'));var rs=require(_0x4e31('0x3'));var fs=require('fs');var Redis=require(_0x4e31('0x4'));var db=require(_0x4e31('0x5'))['db'];var utils=require(_0x4e31('0x6'));var logger=require(_0x4e31('0x7'))(_0x4e31('0x8'));var config=require(_0x4e31('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4e31('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29d63d,_0x608c4d,_0x311a10){return new BPromise(function(_0x430fb9,_0x11e865){return client['request'](_0x29d63d,_0x311a10)[_0x4e31('0xb')](function(_0x29dfe8){logger[_0x4e31('0xc')](_0x4e31('0xd'),_0x608c4d,'request\x20sent');logger[_0x4e31('0xe')](_0x4e31('0xf'),_0x608c4d,_0x4e31('0x10'),JSON[_0x4e31('0x11')](_0x29dfe8));if(_0x29dfe8[_0x4e31('0x12')]){if(_0x29dfe8[_0x4e31('0x12')][_0x4e31('0x13')]===0x1f4){logger[_0x4e31('0x12')](_0x4e31('0xd'),_0x608c4d,_0x29dfe8[_0x4e31('0x12')][_0x4e31('0x14')]);return _0x11e865(_0x29dfe8[_0x4e31('0x12')][_0x4e31('0x14')]);}logger[_0x4e31('0x12')](_0x4e31('0xd'),_0x608c4d,_0x29dfe8[_0x4e31('0x12')][_0x4e31('0x14')]);return _0x430fb9(_0x29dfe8[_0x4e31('0x12')]['message']);}else{logger[_0x4e31('0xc')](_0x4e31('0xd'),_0x608c4d,'request\x20sent');_0x430fb9(_0x29dfe8[_0x4e31('0x15')][_0x4e31('0x14')]);}})[_0x4e31('0x16')](function(_0x56cfc7){logger[_0x4e31('0x12')](_0x4e31('0xd'),_0x608c4d,_0x56cfc7);_0x11e865(_0x56cfc7);});});}
\ No newline at end of file
+var _0x24ca=['request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','SmsTransferReport,\x20%s,\x20%s'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x24ca,0x8c));var _0xa24c=function(_0x5a7d41,_0x4447e2){_0x5a7d41=_0x5a7d41-0x0;var _0x98d8fa=_0x24ca[_0x5a7d41];return _0x98d8fa;};'use strict';var _=require(_0xa24c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa24c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa24c('0x2'));var db=require(_0xa24c('0x3'))['db'];var utils=require(_0xa24c('0x4'));var logger=require('../../config/logger')(_0xa24c('0x5'));var config=require(_0xa24c('0x6'));var jayson=require(_0xa24c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52147a,_0x2288d4,_0x3c10d9){return new BPromise(function(_0x1218ea,_0x3c3959){return client[_0xa24c('0x8')](_0x52147a,_0x3c10d9)[_0xa24c('0x9')](function(_0x5bedc6){logger[_0xa24c('0xa')](_0xa24c('0xb'),_0x2288d4,_0xa24c('0xc'));logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x2288d4,_0xa24c('0xc'),JSON[_0xa24c('0xd')](_0x5bedc6));if(_0x5bedc6[_0xa24c('0xe')]){if(_0x5bedc6[_0xa24c('0xe')][_0xa24c('0xf')]===0x1f4){logger[_0xa24c('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x2288d4,_0x5bedc6['error']['message']);return _0x3c3959(_0x5bedc6[_0xa24c('0xe')][_0xa24c('0x10')]);}logger[_0xa24c('0xe')](_0xa24c('0xb'),_0x2288d4,_0x5bedc6[_0xa24c('0xe')]['message']);return _0x1218ea(_0x5bedc6[_0xa24c('0xe')]['message']);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x2288d4,_0xa24c('0xc'));_0x1218ea(_0x5bedc6[_0xa24c('0x11')][_0xa24c('0x10')]);}})[_0xa24c('0x12')](function(_0x204e7a){logger[_0xa24c('0xe')](_0xa24c('0xb'),_0x2288d4,_0x204e7a);_0x3c3959(_0x204e7a);});});}
\ No newline at end of file
index 26a0f05..8aefa19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae4a=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','root','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','extname','now','post','single','file','create','put','update','delete','exports'];(function(_0x429003,_0x3508da){var _0x3cc0d9=function(_0x1bc27c){while(--_0x1bc27c){_0x429003['push'](_0x429003['shift']());}};_0x3cc0d9(++_0x3508da);}(_0xae4a,0x18c));var _0xaae4=function(_0x1bebea,_0x1a1eb4){_0x1bebea=_0x1bebea-0x0;var _0x2cd4c2=_0xae4a[_0x1bebea];return _0x2cd4c2;};'use strict';var multer=require('multer');var util=require(_0xaae4('0x0'));var path=require(_0xaae4('0x1'));var timeout=require(_0xaae4('0x2'));var express=require(_0xaae4('0x3'));var router=express[_0xaae4('0x4')]();var fs_extra=require(_0xaae4('0x5'));var auth=require(_0xaae4('0x6'));var interaction=require(_0xaae4('0x7'));var config=require(_0xaae4('0x8'));var controller=require(_0xaae4('0x9'));router[_0xaae4('0xa')]('/',auth[_0xaae4('0xb')](),controller[_0xaae4('0xc')]);router[_0xaae4('0xa')](_0xaae4('0xd'),auth['isAuthenticated'](),controller[_0xaae4('0xe')]);router[_0xaae4('0xa')](_0xaae4('0xf'),auth[_0xaae4('0xb')](),controller[_0xaae4('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x18e02a,_0x24c226,_0x823fbe){_0x823fbe(null,path['join'](config[_0xaae4('0x11')],_0xaae4('0x12')));},'filename':function(_0x37041f,_0x27ce00,_0x542edc){_0x27ce00['originalname']=_0x27ce00[_0xaae4('0x13')][_0xaae4('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x542edc(null,util['format'](_0xaae4('0x15'),path[_0xaae4('0x16')](_0x27ce00[_0xaae4('0x13')],path[_0xaae4('0x17')](_0x27ce00['originalname'])),Date[_0xaae4('0x18')](),path['extname'](_0x27ce00[_0xaae4('0x13')])));}})});router[_0xaae4('0x19')]('/',upload[_0xaae4('0x1a')](_0xaae4('0x1b')),controller[_0xaae4('0x1c')]);router[_0xaae4('0x1d')](_0xaae4('0xd'),auth[_0xaae4('0xb')](),controller[_0xaae4('0x1e')]);router['delete'](_0xaae4('0xd'),auth[_0xaae4('0xb')](),controller[_0xaae4('0x1f')]);module[_0xaae4('0x20')]=router;
\ No newline at end of file
+var _0xed27=['join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','single','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','download','diskStorage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed27,0x65));var _0x7ed2=function(_0x50261f,_0x142860){_0x50261f=_0x50261f-0x0;var _0x3f6c7e=_0xed27[_0x50261f];return _0x3f6c7e;};'use strict';var multer=require(_0x7ed2('0x0'));var util=require(_0x7ed2('0x1'));var path=require('path');var timeout=require(_0x7ed2('0x2'));var express=require(_0x7ed2('0x3'));var router=express[_0x7ed2('0x4')]();var fs_extra=require(_0x7ed2('0x5'));var auth=require(_0x7ed2('0x6'));var interaction=require(_0x7ed2('0x7'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0x7ed2('0x8')]('/',auth[_0x7ed2('0x9')](),controller[_0x7ed2('0xa')]);router[_0x7ed2('0x8')](_0x7ed2('0xb'),auth[_0x7ed2('0x9')](),controller[_0x7ed2('0xc')]);router[_0x7ed2('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x7ed2('0xd')]);var upload=multer({'storage':multer[_0x7ed2('0xe')]({'destination':function(_0x20eb80,_0x1b09e7,_0x38496b){_0x38496b(null,path[_0x7ed2('0xf')](config[_0x7ed2('0x10')],_0x7ed2('0x11')));},'filename':function(_0x9cb9b9,_0x27acc0,_0x465f92){_0x27acc0[_0x7ed2('0x12')]=_0x27acc0['originalname'][_0x7ed2('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x465f92(null,util[_0x7ed2('0x14')](_0x7ed2('0x15'),path['basename'](_0x27acc0[_0x7ed2('0x12')],path[_0x7ed2('0x16')](_0x27acc0[_0x7ed2('0x12')])),Date[_0x7ed2('0x17')](),path[_0x7ed2('0x16')](_0x27acc0['originalname'])));}})});router['post']('/',upload[_0x7ed2('0x18')]('file'),controller['create']);router[_0x7ed2('0x19')](_0x7ed2('0xb'),auth[_0x7ed2('0x9')](),controller[_0x7ed2('0x1a')]);router[_0x7ed2('0x1b')](_0x7ed2('0xb'),auth['isAuthenticated'](),controller['delete']);module[_0x7ed2('0x1c')]=router;
\ No newline at end of file
index b2fe35f..68afd53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x637e=['FLOAT','BIGINT','INTEGER','sequelize','exports','name','STRING'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x637e,0x1ae));var _0xe637=function(_0x276413,_0x2c8e7a){_0x276413=_0x276413-0x0;var _0xff711d=_0x637e[_0x276413];return _0xff711d;};'use strict';var Sequelize=require(_0xe637('0x0'));module[_0xe637('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe637('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xe637('0x3')]},'display_name':{'type':Sequelize[_0xe637('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0xe637('0x3')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xe637('0x4')]},'original_sampleCount':{'type':Sequelize[_0xe637('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xe637('0x5')]},'original_sampleRate':{'type':Sequelize[_0xe637('0x6')]},'converted_format':{'type':Sequelize[_0xe637('0x3')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xe637('0x5')]},'converted_channelCount':{'type':Sequelize[_0xe637('0x6')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xe951=['STRING','FLOAT','INTEGER','BIGINT','exports'];(function(_0x8ccd38,_0x415834){var _0xbe27f6=function(_0x4945d6){while(--_0x4945d6){_0x8ccd38['push'](_0x8ccd38['shift']());}};_0xbe27f6(++_0x415834);}(_0xe951,0x10d));var _0x1e95=function(_0x438874,_0x50bced){_0x438874=_0x438874-0x0;var _0x3a51c1=_0xe951[_0x438874];return _0x3a51c1;};'use strict';var Sequelize=require('sequelize');module[_0x1e95('0x0')]={'name':{'type':Sequelize[_0x1e95('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x1e95('0x1')]},'display_name':{'type':Sequelize[_0x1e95('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x1e95('0x1')]},'original_format':{'type':Sequelize[_0x1e95('0x1')]},'original_duration':{'type':Sequelize[_0x1e95('0x2')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x1e95('0x3')]},'converted_format':{'type':Sequelize[_0x1e95('0x1')]},'converted_duration':{'type':Sequelize[_0x1e95('0x2')]},'converted_sampleCount':{'type':Sequelize[_0x1e95('0x4')]},'converted_channelCount':{'type':Sequelize[_0x1e95('0x3')]},'converted_bitRate':{'type':Sequelize[_0x1e95('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x1e95('0x3')]}};
\ No newline at end of file
index 7121331..8c9e288 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f12=['stack','name','map','Sound','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','save_name','converted_format','existsSync','join','Sequelize','ValidationError','Sound\x20not\x20found','download','format','%s.%s','create','basename','file','originalname','extname','filename','wav','root','server/files/sounds/converted','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','transcode','unlinkSync','send','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','pick','delete','params','server/files/sounds/original','original_format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','then','destroy','get','Sounds','error'];(function(_0x3e9aa0,_0x19a76a){var _0x53fe98=function(_0x4a3951){while(--_0x4a3951){_0x3e9aa0['push'](_0x3e9aa0['shift']());}};_0x53fe98(++_0x19a76a);}(_0x1f12,0x1d6));var _0x21f1=function(_0x102de0,_0xf2ad05){_0x102de0=_0x102de0-0x0;var _0x6917dd=_0x1f12[_0x102de0];return _0x6917dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x21f1('0x0'));var zipdir=require(_0x21f1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x21f1('0x2'));var moment=require(_0x21f1('0x3'));var BPromise=require(_0x21f1('0x4'));var Mustache=require('mustache');var util=require(_0x21f1('0x5'));var path=require(_0x21f1('0x6'));var sox=require(_0x21f1('0x7'));var csv=require(_0x21f1('0x8'));var ejs=require(_0x21f1('0x9'));var fs=require('fs');var fs_extra=require(_0x21f1('0xa'));var _=require(_0x21f1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x21f1('0xc'));var deskjs=require(_0x21f1('0xd'));var toCsv=require(_0x21f1('0x8'));var querystring=require('querystring');var Papa=require(_0x21f1('0xe'));var Redis=require(_0x21f1('0xf'));var authService=require(_0x21f1('0x10'));var qs=require(_0x21f1('0x11'));var as=require(_0x21f1('0x12'));var hardwareService=require(_0x21f1('0x13'));var logger=require(_0x21f1('0x14'))(_0x21f1('0x15'));var utils=require(_0x21f1('0x16'));var config=require(_0x21f1('0x17'));var licenseUtil=require(_0x21f1('0x18'));var db=require(_0x21f1('0x19'))['db'];function respondWithStatusCode(_0x5c9564,_0x462c7f){_0x462c7f=_0x462c7f||0xcc;return function(_0x16d7e0){if(_0x16d7e0){return _0x5c9564[_0x21f1('0x1a')](_0x462c7f);}return _0x5c9564[_0x21f1('0x1b')](_0x462c7f)[_0x21f1('0x1c')]();};}function respondWithResult(_0x4cf0d3,_0x50ec72){_0x50ec72=_0x50ec72||0xc8;return function(_0x46c369){if(_0x46c369){return _0x4cf0d3[_0x21f1('0x1b')](_0x50ec72)['json'](_0x46c369);}};}function respondWithFilteredResult(_0x367a54,_0x82da15){return function(_0x506a4b){if(_0x506a4b){var _0x2d3700=typeof _0x82da15[_0x21f1('0x1d')]===_0x21f1('0x1e')&&typeof _0x82da15[_0x21f1('0x1f')]==='undefined';var _0x57f396=_0x506a4b[_0x21f1('0x20')];var _0x235b69=_0x2d3700?0x0:_0x82da15['offset'];var _0xd4fa67=_0x2d3700?_0x506a4b[_0x21f1('0x20')]:_0x82da15[_0x21f1('0x1d')]+_0x82da15['limit'];var _0x32aadd;if(_0xd4fa67>=_0x57f396){_0xd4fa67=_0x57f396;_0x32aadd=0xc8;}else{_0x32aadd=0xce;}_0x367a54['status'](_0x32aadd);return _0x367a54['set']('Content-Range',_0x235b69+'-'+_0xd4fa67+'/'+_0x57f396)[_0x21f1('0x21')](_0x506a4b);}return null;};}function patchUpdates(_0x2f2bd1){return function(_0xdbbb11){try{jsonpatch[_0x21f1('0x22')](_0xdbbb11,_0x2f2bd1,!![]);}catch(_0x389f4d){return BPromise[_0x21f1('0x23')](_0x389f4d);}return _0xdbbb11[_0x21f1('0x24')]();};}function saveUpdates(_0x34a0b5,_0x44c358){return function(_0x1d15b6){if(_0x1d15b6){return _0x1d15b6['update'](_0x34a0b5)[_0x21f1('0x25')](function(_0x3d9f33){return _0x3d9f33;});}return null;};}function removeEntity(_0x876e77,_0x5a8776){return function(_0x564016){if(_0x564016){return _0x564016[_0x21f1('0x26')]()[_0x21f1('0x25')](function(){var _0x2f23f6=_0x564016[_0x21f1('0x27')]({'plain':!![]});var _0x2d895f=_0x21f1('0x28');return db['UserProfileResource'][_0x21f1('0x26')]({'where':{'type':_0x2d895f,'resourceId':_0x2f23f6['id']}})[_0x21f1('0x25')](function(){return _0x564016;});})[_0x21f1('0x25')](function(){_0x876e77['status'](0xcc)[_0x21f1('0x1c')]();});}};}function handleEntityNotFound(_0x2227f9,_0x5ab5b8){return function(_0x22a821){if(!_0x22a821){_0x2227f9[_0x21f1('0x1a')](0x194);}return _0x22a821;};}function handleError(_0x5798d7,_0x4993b5){_0x4993b5=_0x4993b5||0x1f4;return function(_0x3b1dc9){logger[_0x21f1('0x29')](_0x3b1dc9[_0x21f1('0x2a')]);if(_0x3b1dc9[_0x21f1('0x2b')]){delete _0x3b1dc9['name'];}_0x5798d7[_0x21f1('0x1b')](_0x4993b5)['send'](_0x3b1dc9);};}exports['index']=function(_0x4bb7e5,_0x3b034c){var _0x522286={},_0x1e0265={},_0x1315b3={'count':0x0,'rows':[]};var _0x28c796=_[_0x21f1('0x2c')](db[_0x21f1('0x2d')][_0x21f1('0x2e')],function(_0x209248){return{'name':_0x209248[_0x21f1('0x2f')],'type':_0x209248[_0x21f1('0x30')][_0x21f1('0x31')]};});_0x1e0265['model']=_[_0x21f1('0x2c')](_0x28c796,_0x21f1('0x2b'));_0x1e0265['query']=_[_0x21f1('0x32')](_0x4bb7e5[_0x21f1('0x33')]);_0x1e0265['filters']=_[_0x21f1('0x34')](_0x1e0265[_0x21f1('0x35')],_0x1e0265['query']);_0x522286[_0x21f1('0x36')]=_[_0x21f1('0x34')](_0x1e0265[_0x21f1('0x35')],qs[_0x21f1('0x37')](_0x4bb7e5['query']['fields']));_0x522286[_0x21f1('0x36')]=_0x522286[_0x21f1('0x36')][_0x21f1('0x38')]?_0x522286[_0x21f1('0x36')]:_0x1e0265[_0x21f1('0x35')];if(!_0x4bb7e5['query'][_0x21f1('0x39')](_0x21f1('0x3a'))){_0x522286[_0x21f1('0x1f')]=qs[_0x21f1('0x1f')](_0x4bb7e5[_0x21f1('0x33')][_0x21f1('0x1f')]);_0x522286[_0x21f1('0x1d')]=qs['offset'](_0x4bb7e5['query']['offset']);}_0x522286[_0x21f1('0x3b')]=qs[_0x21f1('0x3c')](_0x4bb7e5[_0x21f1('0x33')]['sort']);_0x522286[_0x21f1('0x3d')]=qs['filters'](_['pick'](_0x4bb7e5[_0x21f1('0x33')],_0x1e0265[_0x21f1('0x3e')]),_0x28c796);if(_0x4bb7e5[_0x21f1('0x33')][_0x21f1('0x3f')]){_0x522286['where']=_[_0x21f1('0x40')](_0x522286[_0x21f1('0x3d')],{'$or':_[_0x21f1('0x2c')](_0x28c796,function(_0x8f52bf){if(_0x8f52bf['type']!==_0x21f1('0x41')){var _0x5941c0={};_0x5941c0[_0x8f52bf[_0x21f1('0x2b')]]={'$like':'%'+_0x4bb7e5[_0x21f1('0x33')]['filter']+'%'};return _0x5941c0;}})});}_0x522286=_[_0x21f1('0x40')]({},_0x522286,_0x4bb7e5[_0x21f1('0x42')]);var _0x413cb6={'where':_0x522286['where']};return db[_0x21f1('0x2d')][_0x21f1('0x20')](_0x413cb6)[_0x21f1('0x25')](function(_0x29357f){_0x1315b3['count']=_0x29357f;if(_0x4bb7e5['query'][_0x21f1('0x43')]){_0x522286[_0x21f1('0x44')]=[{'all':!![]}];}return db['Sound'][_0x21f1('0x45')](_0x522286);})['then'](function(_0x59d33f){_0x1315b3[_0x21f1('0x46')]=_0x59d33f;return _0x1315b3;})[_0x21f1('0x25')](respondWithFilteredResult(_0x3b034c,_0x522286))[_0x21f1('0x47')](handleError(_0x3b034c,null));};exports['show']=function(_0x53f66b,_0xe30688){var _0x2980f8={'raw':!![],'where':{'id':_0x53f66b['params']['id']}},_0x42780a={};_0x42780a[_0x21f1('0x35')]=_[_0x21f1('0x32')](db[_0x21f1('0x2d')][_0x21f1('0x2e')]);_0x42780a['query']=_[_0x21f1('0x32')](_0x53f66b[_0x21f1('0x33')]);_0x42780a[_0x21f1('0x3e')]=_[_0x21f1('0x34')](_0x42780a['model'],_0x42780a[_0x21f1('0x33')]);_0x2980f8[_0x21f1('0x36')]=_[_0x21f1('0x34')](_0x42780a[_0x21f1('0x35')],qs[_0x21f1('0x37')](_0x53f66b[_0x21f1('0x33')]['fields']));_0x2980f8[_0x21f1('0x36')]=_0x2980f8['attributes'][_0x21f1('0x38')]?_0x2980f8[_0x21f1('0x36')]:_0x42780a[_0x21f1('0x35')];if(_0x53f66b[_0x21f1('0x33')]['includeAll']){_0x2980f8[_0x21f1('0x44')]=[{'all':!![]}];}_0x2980f8=_['merge']({},_0x2980f8,_0x53f66b[_0x21f1('0x42')]);return db[_0x21f1('0x2d')][_0x21f1('0x48')](_0x2980f8)[_0x21f1('0x25')](handleEntityNotFound(_0xe30688,null))[_0x21f1('0x25')](respondWithResult(_0xe30688,null))[_0x21f1('0x47')](handleError(_0xe30688,null));};exports['download']=function(_0x3b95da,_0x4e778e,_0x3de966){return db[_0x21f1('0x2d')]['find']({'where':{'id':_0x3b95da['params']['id']},'attributes':['name',_0x21f1('0x49'),_0x21f1('0x4a')],'raw':!![]})[_0x21f1('0x25')](handleEntityNotFound(_0x4e778e,null))[_0x21f1('0x25')](function(_0x565865){if(_0x565865){if(!fs[_0x21f1('0x4b')](path[_0x21f1('0x4c')](config['root'],'server/files/sounds/converted',_0x565865['save_name']+'.'+_0x565865[_0x21f1('0x4a')]))){throw new db[(_0x21f1('0x4d'))][(_0x21f1('0x4e'))](_0x21f1('0x4f'));}return _0x4e778e[_0x21f1('0x50')](path[_0x21f1('0x4c')](config['root'],'server/files/sounds/converted',util[_0x21f1('0x51')](_0x21f1('0x52'),_0x565865[_0x21f1('0x49')],_0x565865[_0x21f1('0x4a')])),util[_0x21f1('0x51')](_0x21f1('0x52'),_0x565865[_0x21f1('0x2b')],_0x565865['converted_format']));}return null;})[_0x21f1('0x47')](handleError(_0x4e778e,null));};exports[_0x21f1('0x53')]=function(_0x5ad6e3,_0x5dff27,_0x57c31a){var _0x5c86ef={'name':path[_0x21f1('0x54')](_0x5ad6e3[_0x21f1('0x55')][_0x21f1('0x56')],path[_0x21f1('0x57')](_0x5ad6e3[_0x21f1('0x55')]['originalname'])),'save_name':path[_0x21f1('0x54')](_0x5ad6e3[_0x21f1('0x55')][_0x21f1('0x58')],path[_0x21f1('0x57')](_0x5ad6e3[_0x21f1('0x55')][_0x21f1('0x58')])),'original_format':path[_0x21f1('0x57')](_0x5ad6e3[_0x21f1('0x55')]['originalname'])['substring'](0x1),'converted_format':_0x21f1('0x59')};var _0x5c50e7=path['join'](config[_0x21f1('0x5a')],'server/files/sounds/original',_0x5ad6e3[_0x21f1('0x55')][_0x21f1('0x58')]);var _0x89b7e8=path['join'](config[_0x21f1('0x5a')],_0x21f1('0x5b'),util[_0x21f1('0x51')](_0x21f1('0x52'),path['basename'](_0x5ad6e3['file'][_0x21f1('0x58')],path[_0x21f1('0x57')](_0x5ad6e3[_0x21f1('0x55')][_0x21f1('0x58')])),_0x5c86ef[_0x21f1('0x4a')]));logger[_0x21f1('0x5c')](_0x21f1('0x5d'),_0x5c50e7);logger['info'](_0x21f1('0x5e'),_0x89b7e8);try{fs['chmodSync'](_0x5c50e7,parseInt(_0x21f1('0x5f'),0x8));var _0x2591f7=sox[_0x21f1('0x60')](_0x5c50e7,_0x89b7e8,{'sampleRate':0x1f40,'format':_0x21f1('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2591f7['on']('error',function(_0x1f2280){fs[_0x21f1('0x61')](_0x5c50e7);_0x5dff27[_0x21f1('0x1b')](0x1f4)[_0x21f1('0x62')](_0x1f2280);});_0x2591f7['on'](_0x21f1('0x63'),function(_0x30ec41){_0x5c86ef['original_duration']=isNaN(_0x30ec41[_0x21f1('0x64')])?null:_0x30ec41[_0x21f1('0x64')]*0x3e8;_0x5c86ef[_0x21f1('0x65')]=isNaN(_0x30ec41['sampleCount'])?null:_0x30ec41[_0x21f1('0x66')];_0x5c86ef[_0x21f1('0x67')]=isNaN(_0x30ec41[_0x21f1('0x68')])?null:_0x30ec41[_0x21f1('0x68')];_0x5c86ef[_0x21f1('0x69')]=isNaN(_0x30ec41[_0x21f1('0x6a')])?null:_0x30ec41[_0x21f1('0x6a')];_0x5c86ef[_0x21f1('0x6b')]=isNaN(_0x30ec41[_0x21f1('0x6c')])?null:_0x30ec41['sampleRate'];});_0x2591f7['on']('dest',function(_0x478049){_0x5c86ef[_0x21f1('0x6d')]=isNaN(_0x478049['duration'])?null:_0x478049['duration']*0x3e8;_0x5c86ef[_0x21f1('0x6e')]=isNaN(_0x478049[_0x21f1('0x66')])?null:_0x478049[_0x21f1('0x66')];_0x5c86ef[_0x21f1('0x6f')]=isNaN(_0x478049[_0x21f1('0x68')])?null:_0x478049[_0x21f1('0x68')];_0x5c86ef[_0x21f1('0x70')]=isNaN(_0x478049[_0x21f1('0x6a')])?null:_0x478049['bitRate'];_0x5c86ef[_0x21f1('0x71')]=isNaN(_0x478049[_0x21f1('0x6c')])?null:_0x478049['sampleRate'];});_0x2591f7['on'](_0x21f1('0x1c'),function(){fs['chmodSync'](_0x89b7e8,parseInt(_0x21f1('0x5f'),0x8));return db[_0x21f1('0x2d')][_0x21f1('0x53')](_0x5c86ef)[_0x21f1('0x25')](function(_0x2c754f){var _0x41aa50={'role':_0x5ad6e3[_0x21f1('0x72')][_0x21f1('0x73')],'userProfileId':_0x5ad6e3[_0x21f1('0x72')][_0x21f1('0x74')]};if(!_0x41aa50)throw new Error(_0x21f1('0x75'));if(_0x41aa50[_0x21f1('0x73')]===_0x21f1('0x76')){var _0x1e2e7f=_0x2c754f[_0x21f1('0x27')]({'plain':!![]});return db[_0x21f1('0x77')][_0x21f1('0x48')]({'where':{'name':_0x21f1('0x28'),'userProfileId':_0x41aa50[_0x21f1('0x74')]},'raw':!![]})['then'](function(_0x24db7b){if(_0x24db7b&&_0x24db7b['autoAssociation']===0x0){return db['UserProfileResource'][_0x21f1('0x53')]({'name':_0x1e2e7f[_0x21f1('0x2b')],'resourceId':_0x1e2e7f['id'],'type':_0x24db7b[_0x21f1('0x2b')],'sectionId':_0x24db7b['id']},{})[_0x21f1('0x25')](function(){return _0x2c754f;});}else{return _0x2c754f;}})[_0x21f1('0x47')](function(_0x2a72bb){logger[_0x21f1('0x29')](_0x21f1('0x78'),_0x2a72bb);throw _0x2a72bb;});}return _0x2c754f;})[_0x21f1('0x25')](respondWithResult(_0x5dff27,null))[_0x21f1('0x47')](handleError(_0x5dff27,null));});_0x2591f7[_0x21f1('0x79')]();}catch(_0x5bf9e4){_0x5dff27['status'](0x1f4)[_0x21f1('0x62')](_0x5bf9e4);}};exports[_0x21f1('0x7a')]=function(_0xb043d,_0x30eb38,_0x26dbe9){return db[_0x21f1('0x2d')][_0x21f1('0x48')]({'where':{'id':_0xb043d['params']['id']}})[_0x21f1('0x25')](handleEntityNotFound(_0x30eb38,null))[_0x21f1('0x25')](saveUpdates(_[_0x21f1('0x7b')](_0xb043d['body'],[_0x21f1('0x2b'),'description']),null))[_0x21f1('0x25')](respondWithResult(_0x30eb38,null))[_0x21f1('0x47')](handleError(_0x30eb38,null));};exports[_0x21f1('0x7c')]=function(_0x3a92f0,_0x16aea2,_0x7b6486){return db[_0x21f1('0x2d')]['find']({'where':{'id':_0x3a92f0[_0x21f1('0x7d')]['id']}})[_0x21f1('0x25')](function(_0x4aa47a){if(_0x4aa47a){return _0x4aa47a[_0x21f1('0x26')]();}})[_0x21f1('0x25')](function(_0x597f55){var _0x2fef89=path[_0x21f1('0x4c')](config[_0x21f1('0x5a')],_0x21f1('0x7e'),util[_0x21f1('0x51')]('%s.%s',_0x597f55['save_name'],_0x597f55[_0x21f1('0x7f')]));var _0x2ecc0f=path[_0x21f1('0x4c')](config[_0x21f1('0x5a')],_0x21f1('0x5b'),util[_0x21f1('0x51')](_0x21f1('0x52'),_0x597f55[_0x21f1('0x49')],_0x597f55['converted_format']));fs[_0x21f1('0x61')](_0x2fef89);fs['unlinkSync'](_0x2ecc0f);return _0x597f55;})[_0x21f1('0x25')](function(_0x26a327){if(_0x26a327){return _0x16aea2[_0x21f1('0x1b')](0xcc)[_0x21f1('0x1c')]();}})[_0x21f1('0x25')](handleEntityNotFound(_0x16aea2,null))[_0x21f1('0x47')](handleError(_0x16aea2,null));};
\ No newline at end of file
+var _0x8d48=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','send','index','Sound','rawAttributes','type','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','download','converted_format','existsSync','join','root','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','save_name','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','original_duration','duration','sampleCount','original_channelCount','channelCount','bitRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x5b3c12,_0x4131b1){var _0x3b88b1=function(_0x51acc1){while(--_0x51acc1){_0x5b3c12['push'](_0x5b3c12['shift']());}};_0x3b88b1(++_0x4131b1);}(_0x8d48,0x6e));var _0x88d4=function(_0x546895,_0xb414da){_0x546895=_0x546895-0x0;var _0x3b5a09=_0x8d48[_0x546895];return _0x3b5a09;};'use strict';var emlformat=require(_0x88d4('0x0'));var rimraf=require(_0x88d4('0x1'));var zipdir=require(_0x88d4('0x2'));var jsonpatch=require(_0x88d4('0x3'));var rp=require(_0x88d4('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x88d4('0x5'));var path=require(_0x88d4('0x6'));var sox=require('sox');var csv=require(_0x88d4('0x7'));var ejs=require(_0x88d4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x88d4('0x9'));var squel=require('squel');var crypto=require(_0x88d4('0xa'));var jsforce=require(_0x88d4('0xb'));var deskjs=require(_0x88d4('0xc'));var toCsv=require(_0x88d4('0x7'));var querystring=require(_0x88d4('0xd'));var Papa=require(_0x88d4('0xe'));var Redis=require(_0x88d4('0xf'));var authService=require(_0x88d4('0x10'));var qs=require(_0x88d4('0x11'));var as=require(_0x88d4('0x12'));var hardwareService=require(_0x88d4('0x13'));var logger=require(_0x88d4('0x14'))('api');var utils=require(_0x88d4('0x15'));var config=require(_0x88d4('0x16'));var licenseUtil=require(_0x88d4('0x17'));var db=require(_0x88d4('0x18'))['db'];function respondWithStatusCode(_0x224f0b,_0x48bd58){_0x48bd58=_0x48bd58||0xcc;return function(_0x5f3e50){if(_0x5f3e50){return _0x224f0b[_0x88d4('0x19')](_0x48bd58);}return _0x224f0b[_0x88d4('0x1a')](_0x48bd58)[_0x88d4('0x1b')]();};}function respondWithResult(_0x2ec1fd,_0xd77e0c){_0xd77e0c=_0xd77e0c||0xc8;return function(_0x49bdf3){if(_0x49bdf3){return _0x2ec1fd[_0x88d4('0x1a')](_0xd77e0c)[_0x88d4('0x1c')](_0x49bdf3);}};}function respondWithFilteredResult(_0xb37133,_0x106ee3){return function(_0x1bccfd){if(_0x1bccfd){var _0xd7a47=typeof _0x106ee3[_0x88d4('0x1d')]===_0x88d4('0x1e')&&typeof _0x106ee3[_0x88d4('0x1f')]===_0x88d4('0x1e');var _0x5a5708=_0x1bccfd[_0x88d4('0x20')];var _0x55a277=_0xd7a47?0x0:_0x106ee3[_0x88d4('0x1d')];var _0x22dc2f=_0xd7a47?_0x1bccfd[_0x88d4('0x20')]:_0x106ee3[_0x88d4('0x1d')]+_0x106ee3['limit'];var _0x4ec854;if(_0x22dc2f>=_0x5a5708){_0x22dc2f=_0x5a5708;_0x4ec854=0xc8;}else{_0x4ec854=0xce;}_0xb37133[_0x88d4('0x1a')](_0x4ec854);return _0xb37133[_0x88d4('0x21')](_0x88d4('0x22'),_0x55a277+'-'+_0x22dc2f+'/'+_0x5a5708)[_0x88d4('0x1c')](_0x1bccfd);}return null;};}function patchUpdates(_0x1b1778){return function(_0x29382e){try{jsonpatch[_0x88d4('0x23')](_0x29382e,_0x1b1778,!![]);}catch(_0x4a0614){return BPromise[_0x88d4('0x24')](_0x4a0614);}return _0x29382e[_0x88d4('0x25')]();};}function saveUpdates(_0x3728b7,_0x50fd19){return function(_0x39e9ba){if(_0x39e9ba){return _0x39e9ba[_0x88d4('0x26')](_0x3728b7)[_0x88d4('0x27')](function(_0x20d0ec){return _0x20d0ec;});}return null;};}function removeEntity(_0x4ccc50,_0x542810){return function(_0x27a36){if(_0x27a36){return _0x27a36[_0x88d4('0x28')]()[_0x88d4('0x27')](function(){var _0x5ef33b=_0x27a36[_0x88d4('0x29')]({'plain':!![]});var _0xc406cf=_0x88d4('0x2a');return db[_0x88d4('0x2b')]['destroy']({'where':{'type':_0xc406cf,'resourceId':_0x5ef33b['id']}})[_0x88d4('0x27')](function(){return _0x27a36;});})[_0x88d4('0x27')](function(){_0x4ccc50[_0x88d4('0x1a')](0xcc)[_0x88d4('0x1b')]();});}};}function handleEntityNotFound(_0x337ba2,_0x147171){return function(_0x20eb77){if(!_0x20eb77){_0x337ba2[_0x88d4('0x19')](0x194);}return _0x20eb77;};}function handleError(_0x2c8623,_0x3c82dd){_0x3c82dd=_0x3c82dd||0x1f4;return function(_0x540e6f){logger[_0x88d4('0x2c')](_0x540e6f[_0x88d4('0x2d')]);if(_0x540e6f[_0x88d4('0x2e')]){delete _0x540e6f[_0x88d4('0x2e')];}_0x2c8623[_0x88d4('0x1a')](_0x3c82dd)[_0x88d4('0x2f')](_0x540e6f);};}exports[_0x88d4('0x30')]=function(_0x4b6308,_0xdee8a3){var _0x5e207b={},_0x4d834d={},_0x28f113={'count':0x0,'rows':[]};var _0x35dc1b=_['map'](db[_0x88d4('0x31')][_0x88d4('0x32')],function(_0x1d8572){return{'name':_0x1d8572['fieldName'],'type':_0x1d8572[_0x88d4('0x33')]['key']};});_0x4d834d[_0x88d4('0x34')]=_[_0x88d4('0x35')](_0x35dc1b,_0x88d4('0x2e'));_0x4d834d['query']=_[_0x88d4('0x36')](_0x4b6308[_0x88d4('0x37')]);_0x4d834d['filters']=_[_0x88d4('0x38')](_0x4d834d['model'],_0x4d834d[_0x88d4('0x37')]);_0x5e207b[_0x88d4('0x39')]=_[_0x88d4('0x38')](_0x4d834d[_0x88d4('0x34')],qs[_0x88d4('0x3a')](_0x4b6308[_0x88d4('0x37')]['fields']));_0x5e207b[_0x88d4('0x39')]=_0x5e207b[_0x88d4('0x39')]['length']?_0x5e207b[_0x88d4('0x39')]:_0x4d834d[_0x88d4('0x34')];if(!_0x4b6308[_0x88d4('0x37')][_0x88d4('0x3b')](_0x88d4('0x3c'))){_0x5e207b[_0x88d4('0x1f')]=qs[_0x88d4('0x1f')](_0x4b6308['query'][_0x88d4('0x1f')]);_0x5e207b[_0x88d4('0x1d')]=qs[_0x88d4('0x1d')](_0x4b6308['query'][_0x88d4('0x1d')]);}_0x5e207b[_0x88d4('0x3d')]=qs['sort'](_0x4b6308[_0x88d4('0x37')][_0x88d4('0x3e')]);_0x5e207b['where']=qs[_0x88d4('0x3f')](_[_0x88d4('0x40')](_0x4b6308['query'],_0x4d834d[_0x88d4('0x3f')]),_0x35dc1b);if(_0x4b6308[_0x88d4('0x37')][_0x88d4('0x41')]){_0x5e207b[_0x88d4('0x42')]=_[_0x88d4('0x43')](_0x5e207b['where'],{'$or':_['map'](_0x35dc1b,function(_0x1c7bdc){if(_0x1c7bdc[_0x88d4('0x33')]!==_0x88d4('0x44')){var _0x3c5597={};_0x3c5597[_0x1c7bdc[_0x88d4('0x2e')]]={'$like':'%'+_0x4b6308[_0x88d4('0x37')][_0x88d4('0x41')]+'%'};return _0x3c5597;}})});}_0x5e207b=_['merge']({},_0x5e207b,_0x4b6308[_0x88d4('0x45')]);var _0x6a1e7e={'where':_0x5e207b['where']};return db[_0x88d4('0x31')][_0x88d4('0x20')](_0x6a1e7e)[_0x88d4('0x27')](function(_0x51cb10){_0x28f113[_0x88d4('0x20')]=_0x51cb10;if(_0x4b6308['query'][_0x88d4('0x46')]){_0x5e207b[_0x88d4('0x47')]=[{'all':!![]}];}return db[_0x88d4('0x31')]['findAll'](_0x5e207b);})['then'](function(_0x4d8f59){_0x28f113[_0x88d4('0x48')]=_0x4d8f59;return _0x28f113;})[_0x88d4('0x27')](respondWithFilteredResult(_0xdee8a3,_0x5e207b))[_0x88d4('0x49')](handleError(_0xdee8a3,null));};exports[_0x88d4('0x4a')]=function(_0x32fe79,_0x1943bb){var _0x42c381={'raw':!![],'where':{'id':_0x32fe79[_0x88d4('0x4b')]['id']}},_0x474852={};_0x474852[_0x88d4('0x34')]=_[_0x88d4('0x36')](db[_0x88d4('0x31')][_0x88d4('0x32')]);_0x474852[_0x88d4('0x37')]=_[_0x88d4('0x36')](_0x32fe79['query']);_0x474852[_0x88d4('0x3f')]=_[_0x88d4('0x38')](_0x474852[_0x88d4('0x34')],_0x474852[_0x88d4('0x37')]);_0x42c381['attributes']=_[_0x88d4('0x38')](_0x474852[_0x88d4('0x34')],qs[_0x88d4('0x3a')](_0x32fe79[_0x88d4('0x37')][_0x88d4('0x3a')]));_0x42c381['attributes']=_0x42c381[_0x88d4('0x39')][_0x88d4('0x4c')]?_0x42c381[_0x88d4('0x39')]:_0x474852[_0x88d4('0x34')];if(_0x32fe79[_0x88d4('0x37')][_0x88d4('0x46')]){_0x42c381[_0x88d4('0x47')]=[{'all':!![]}];}_0x42c381=_[_0x88d4('0x43')]({},_0x42c381,_0x32fe79[_0x88d4('0x45')]);return db[_0x88d4('0x31')]['find'](_0x42c381)[_0x88d4('0x27')](handleEntityNotFound(_0x1943bb,null))['then'](respondWithResult(_0x1943bb,null))['catch'](handleError(_0x1943bb,null));};exports[_0x88d4('0x4d')]=function(_0x41bf57,_0x204c96,_0x1cae0e){return db[_0x88d4('0x31')]['find']({'where':{'id':_0x41bf57[_0x88d4('0x4b')]['id']},'attributes':['name','save_name',_0x88d4('0x4e')],'raw':!![]})[_0x88d4('0x27')](handleEntityNotFound(_0x204c96,null))[_0x88d4('0x27')](function(_0x307936){if(_0x307936){if(!fs[_0x88d4('0x4f')](path[_0x88d4('0x50')](config[_0x88d4('0x51')],'server/files/sounds/converted',_0x307936['save_name']+'.'+_0x307936[_0x88d4('0x4e')]))){throw new db[(_0x88d4('0x52'))][(_0x88d4('0x53'))](_0x88d4('0x54'));}return _0x204c96[_0x88d4('0x4d')](path[_0x88d4('0x50')](config['root'],_0x88d4('0x55'),util[_0x88d4('0x56')](_0x88d4('0x57'),_0x307936[_0x88d4('0x58')],_0x307936[_0x88d4('0x4e')])),util[_0x88d4('0x56')](_0x88d4('0x57'),_0x307936[_0x88d4('0x2e')],_0x307936[_0x88d4('0x4e')]));}return null;})[_0x88d4('0x49')](handleError(_0x204c96,null));};exports[_0x88d4('0x59')]=function(_0x154951,_0x1fd2db,_0x44a7b7){var _0x4d7cc8={'name':path[_0x88d4('0x5a')](_0x154951[_0x88d4('0x5b')][_0x88d4('0x5c')],path['extname'](_0x154951[_0x88d4('0x5b')][_0x88d4('0x5c')])),'save_name':path['basename'](_0x154951[_0x88d4('0x5b')]['filename'],path[_0x88d4('0x5d')](_0x154951['file'][_0x88d4('0x5e')])),'original_format':path['extname'](_0x154951['file'][_0x88d4('0x5c')])[_0x88d4('0x5f')](0x1),'converted_format':_0x88d4('0x60')};var _0x48b4b0=path['join'](config[_0x88d4('0x51')],_0x88d4('0x61'),_0x154951[_0x88d4('0x5b')]['filename']);var _0x32c86f=path[_0x88d4('0x50')](config[_0x88d4('0x51')],_0x88d4('0x55'),util[_0x88d4('0x56')](_0x88d4('0x57'),path[_0x88d4('0x5a')](_0x154951[_0x88d4('0x5b')][_0x88d4('0x5e')],path[_0x88d4('0x5d')](_0x154951[_0x88d4('0x5b')][_0x88d4('0x5e')])),_0x4d7cc8[_0x88d4('0x4e')]));logger[_0x88d4('0x62')](_0x88d4('0x63'),_0x48b4b0);logger[_0x88d4('0x62')](_0x88d4('0x64'),_0x32c86f);try{fs[_0x88d4('0x65')](_0x48b4b0,parseInt('0777',0x8));var _0x1835e5=sox[_0x88d4('0x66')](_0x48b4b0,_0x32c86f,{'sampleRate':0x1f40,'format':_0x88d4('0x60'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1835e5['on'](_0x88d4('0x2c'),function(_0x37572d){fs['unlinkSync'](_0x48b4b0);_0x1fd2db[_0x88d4('0x1a')](0x1f4)[_0x88d4('0x2f')](_0x37572d);});_0x1835e5['on']('src',function(_0x1a4800){_0x4d7cc8[_0x88d4('0x67')]=isNaN(_0x1a4800[_0x88d4('0x68')])?null:_0x1a4800[_0x88d4('0x68')]*0x3e8;_0x4d7cc8['original_sampleCount']=isNaN(_0x1a4800[_0x88d4('0x69')])?null:_0x1a4800['sampleCount'];_0x4d7cc8[_0x88d4('0x6a')]=isNaN(_0x1a4800['channelCount'])?null:_0x1a4800[_0x88d4('0x6b')];_0x4d7cc8['original_bitRate']=isNaN(_0x1a4800[_0x88d4('0x6c')])?null:_0x1a4800[_0x88d4('0x6c')];_0x4d7cc8['original_sampleRate']=isNaN(_0x1a4800[_0x88d4('0x6d')])?null:_0x1a4800[_0x88d4('0x6d')];});_0x1835e5['on'](_0x88d4('0x6e'),function(_0x4d442a){_0x4d7cc8[_0x88d4('0x6f')]=isNaN(_0x4d442a[_0x88d4('0x68')])?null:_0x4d442a[_0x88d4('0x68')]*0x3e8;_0x4d7cc8['converted_sampleCount']=isNaN(_0x4d442a[_0x88d4('0x69')])?null:_0x4d442a['sampleCount'];_0x4d7cc8[_0x88d4('0x70')]=isNaN(_0x4d442a[_0x88d4('0x6b')])?null:_0x4d442a[_0x88d4('0x6b')];_0x4d7cc8[_0x88d4('0x71')]=isNaN(_0x4d442a[_0x88d4('0x6c')])?null:_0x4d442a['bitRate'];_0x4d7cc8[_0x88d4('0x72')]=isNaN(_0x4d442a[_0x88d4('0x6d')])?null:_0x4d442a['sampleRate'];});_0x1835e5['on'](_0x88d4('0x1b'),function(){fs[_0x88d4('0x65')](_0x32c86f,parseInt('0777',0x8));return db['Sound'][_0x88d4('0x59')](_0x4d7cc8)[_0x88d4('0x27')](function(_0x1723fa){var _0x49e06a={'role':_0x154951[_0x88d4('0x73')][_0x88d4('0x74')],'userProfileId':_0x154951['body']['userProfileId']};if(!_0x49e06a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49e06a['role']===_0x88d4('0x75')){var _0x5a94d5=_0x1723fa[_0x88d4('0x29')]({'plain':!![]});return db['UserProfileSection'][_0x88d4('0x76')]({'where':{'name':_0x88d4('0x2a'),'userProfileId':_0x49e06a[_0x88d4('0x77')]},'raw':!![]})[_0x88d4('0x27')](function(_0x2b4d78){if(_0x2b4d78&&_0x2b4d78[_0x88d4('0x78')]===0x0){return db[_0x88d4('0x2b')]['create']({'name':_0x5a94d5['name'],'resourceId':_0x5a94d5['id'],'type':_0x2b4d78['name'],'sectionId':_0x2b4d78['id']},{})[_0x88d4('0x27')](function(){return _0x1723fa;});}else{return _0x1723fa;}})[_0x88d4('0x49')](function(_0x348b34){logger[_0x88d4('0x2c')](_0x88d4('0x79'),_0x348b34);throw _0x348b34;});}return _0x1723fa;})[_0x88d4('0x27')](respondWithResult(_0x1fd2db,null))[_0x88d4('0x49')](handleError(_0x1fd2db,null));});_0x1835e5[_0x88d4('0x7a')]();}catch(_0x199f46){_0x1fd2db['status'](0x1f4)[_0x88d4('0x2f')](_0x199f46);}};exports[_0x88d4('0x26')]=function(_0x6d648e,_0x2a61d8,_0x4e1ca6){return db[_0x88d4('0x31')][_0x88d4('0x76')]({'where':{'id':_0x6d648e[_0x88d4('0x4b')]['id']}})[_0x88d4('0x27')](handleEntityNotFound(_0x2a61d8,null))[_0x88d4('0x27')](saveUpdates(_[_0x88d4('0x40')](_0x6d648e[_0x88d4('0x73')],[_0x88d4('0x2e'),_0x88d4('0x7b')]),null))[_0x88d4('0x27')](respondWithResult(_0x2a61d8,null))[_0x88d4('0x49')](handleError(_0x2a61d8,null));};exports[_0x88d4('0x7c')]=function(_0x190a27,_0x566fcc,_0x88f34f){return db[_0x88d4('0x31')][_0x88d4('0x76')]({'where':{'id':_0x190a27[_0x88d4('0x4b')]['id']}})['then'](function(_0x21d0df){if(_0x21d0df){return _0x21d0df[_0x88d4('0x28')]();}})['then'](function(_0x167376){var _0x46987e=path[_0x88d4('0x50')](config['root'],_0x88d4('0x61'),util[_0x88d4('0x56')](_0x88d4('0x57'),_0x167376[_0x88d4('0x58')],_0x167376['original_format']));var _0xdafaff=path[_0x88d4('0x50')](config['root'],_0x88d4('0x55'),util[_0x88d4('0x56')]('%s.%s',_0x167376[_0x88d4('0x58')],_0x167376[_0x88d4('0x4e')]));fs['unlinkSync'](_0x46987e);fs[_0x88d4('0x7d')](_0xdafaff);return _0x167376;})['then'](function(_0x586d83){if(_0x586d83){return _0x566fcc[_0x88d4('0x1a')](0xcc)[_0x88d4('0x1b')]();}})[_0x88d4('0x27')](handleEntityNotFound(_0x566fcc,null))[_0x88d4('0x49')](handleError(_0x566fcc,null));};
\ No newline at end of file
index 27f98a1..07efef5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c32=['./sound.attributes','exports','define','Sound','tools_sounds','lodash','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x8c32,0xec));var _0x28c3=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x8c32[_0x29d94e];return _0x106237;};'use strict';var _=require(_0x28c3('0x0'));var util=require('util');var logger=require(_0x28c3('0x1'))(_0x28c3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x28c3('0x3'));var fs=require('fs');var path=require(_0x28c3('0x4'));var rimraf=require('rimraf');var config=require(_0x28c3('0x5'));var attributes=require(_0x28c3('0x6'));module[_0x28c3('0x7')]=function(_0x3290fc,_0x31b6f3){return _0x3290fc[_0x28c3('0x8')](_0x28c3('0x9'),attributes,{'tableName':_0x28c3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x71d7=['rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xdbd04d,_0x22ca32){var _0x253e11=function(_0x14277b){while(--_0x14277b){_0xdbd04d['push'](_0xdbd04d['shift']());}};_0x253e11(++_0x22ca32);}(_0x71d7,0x106));var _0x771d=function(_0x594bb1,_0x32b1c9){_0x594bb1=_0x594bb1-0x0;var _0x5bdf21=_0x71d7[_0x594bb1];return _0x5bdf21;};'use strict';var _=require(_0x771d('0x0'));var util=require(_0x771d('0x1'));var logger=require(_0x771d('0x2'))(_0x771d('0x3'));var moment=require(_0x771d('0x4'));var BPromise=require(_0x771d('0x5'));var rp=require(_0x771d('0x6'));var fs=require('fs');var path=require(_0x771d('0x7'));var rimraf=require(_0x771d('0x8'));var config=require(_0x771d('0x9'));var attributes=require(_0x771d('0xa'));module[_0x771d('0xb')]=function(_0x182c4c,_0x1c15e1){return _0x182c4c[_0x771d('0xc')](_0x771d('0xd'),attributes,{'tableName':_0x771d('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fcf84f2..0096afc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd36e=['result','catch','ShowSound','Sound','options','raw','where','attributes','include','map','model','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Sound,\x20%s,\x20%s','message'];(function(_0x4e139c,_0x389082){var _0x3b7887=function(_0x4ed478){while(--_0x4ed478){_0x4e139c['push'](_0x4e139c['shift']());}};_0x3b7887(++_0x389082);}(_0xd36e,0x1ec));var _0xed36=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd36e[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xed36('0x0'));var util=require(_0xed36('0x1'));var moment=require(_0xed36('0x2'));var BPromise=require('bluebird');var rs=require(_0xed36('0x3'));var fs=require('fs');var Redis=require(_0xed36('0x4'));var db=require(_0xed36('0x5'))['db'];var utils=require(_0xed36('0x6'));var logger=require('../../config/logger')(_0xed36('0x7'));var config=require(_0xed36('0x8'));var jayson=require(_0xed36('0x9'));var client=jayson[_0xed36('0xa')][_0xed36('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ff547,_0x2ebe36,_0x1604b8){return new BPromise(function(_0x2ed186,_0x32fb47){return client['request'](_0x4ff547,_0x1604b8)['then'](function(_0x1359f4){logger[_0xed36('0xc')]('Sound,\x20%s,\x20%s',_0x2ebe36,'request\x20sent');logger['debug'](_0xed36('0xd'),_0x2ebe36,_0xed36('0xe'),JSON[_0xed36('0xf')](_0x1359f4));if(_0x1359f4[_0xed36('0x10')]){if(_0x1359f4['error'][_0xed36('0x11')]===0x1f4){logger[_0xed36('0x10')](_0xed36('0x12'),_0x2ebe36,_0x1359f4[_0xed36('0x10')][_0xed36('0x13')]);return _0x32fb47(_0x1359f4[_0xed36('0x10')][_0xed36('0x13')]);}logger[_0xed36('0x10')](_0xed36('0x12'),_0x2ebe36,_0x1359f4[_0xed36('0x10')][_0xed36('0x13')]);return _0x2ed186(_0x1359f4[_0xed36('0x10')][_0xed36('0x13')]);}else{logger[_0xed36('0xc')]('Sound,\x20%s,\x20%s',_0x2ebe36,_0xed36('0xe'));_0x2ed186(_0x1359f4[_0xed36('0x14')]['message']);}})[_0xed36('0x15')](function(_0x2cfa86){logger[_0xed36('0x10')]('Sound,\x20%s,\x20%s',_0x2ebe36,_0x2cfa86);_0x32fb47(_0x2cfa86);});});}exports[_0xed36('0x16')]=function(_0x2d8e54){var _0x38a8c4=this;return new Promise(function(_0x214bca,_0x47a68d){return db[_0xed36('0x17')]['find']({'raw':_0x2d8e54['options']?_0x2d8e54[_0xed36('0x18')][_0xed36('0x19')]===undefined?!![]:![]:!![],'where':_0x2d8e54['options']?_0x2d8e54[_0xed36('0x18')][_0xed36('0x1a')]||null:null,'attributes':_0x2d8e54['options']?_0x2d8e54[_0xed36('0x18')][_0xed36('0x1b')]||null:null,'include':_0x2d8e54[_0xed36('0x18')]?_0x2d8e54['options'][_0xed36('0x1c')]?_[_0xed36('0x1d')](_0x2d8e54[_0xed36('0x18')][_0xed36('0x1c')],function(_0x42bb71){return{'model':db[_0x42bb71[_0xed36('0x1e')]],'as':_0x42bb71['as'],'attributes':_0x42bb71[_0xed36('0x1b')],'include':_0x42bb71[_0xed36('0x1c')]?_[_0xed36('0x1d')](_0x42bb71['include'],function(_0x5ed189){return{'model':db[_0x5ed189[_0xed36('0x1e')]],'as':_0x5ed189['as'],'attributes':_0x5ed189[_0xed36('0x1b')],'include':_0x5ed189[_0xed36('0x1c')]?_[_0xed36('0x1d')](_0x5ed189[_0xed36('0x1c')],function(_0x5f1a19){return{'model':db[_0x5f1a19['model']],'as':_0x5f1a19['as'],'attributes':_0x5f1a19[_0xed36('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xed36('0x1f')](function(_0x44ccc7){logger[_0xed36('0xc')](_0xed36('0x16'),_0x2d8e54);logger['debug'](_0xed36('0x16'),_0x2d8e54,JSON[_0xed36('0xf')](_0x44ccc7));_0x214bca(_0x44ccc7);})[_0xed36('0x15')](function(_0x33ff0c){logger[_0xed36('0x10')](_0xed36('0x16'),_0x33ff0c[_0xed36('0x13')],_0x2d8e54);_0x47a68d(_0x38a8c4[_0xed36('0x10')](0x1f4,_0x33ff0c['message']));});});};
\ No newline at end of file
+var _0xb3ad=['Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','info','result','catch','Sound','options','raw','where','include','attributes','map','ShowSound','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug'];(function(_0x2510ad,_0x3cb2ee){var _0x107b8f=function(_0x9b3282){while(--_0x9b3282){_0x2510ad['push'](_0x2510ad['shift']());}};_0x107b8f(++_0x3cb2ee);}(_0xb3ad,0x171));var _0xdb3a=function(_0x417eb6,_0x22f854){_0x417eb6=_0x417eb6-0x0;var _0x11c87e=_0xb3ad[_0x417eb6];return _0x11c87e;};'use strict';var _=require(_0xdb3a('0x0'));var util=require(_0xdb3a('0x1'));var moment=require(_0xdb3a('0x2'));var BPromise=require(_0xdb3a('0x3'));var rs=require(_0xdb3a('0x4'));var fs=require('fs');var Redis=require(_0xdb3a('0x5'));var db=require(_0xdb3a('0x6'))['db'];var utils=require(_0xdb3a('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xdb3a('0x8'));var jayson=require(_0xdb3a('0x9'));var client=jayson[_0xdb3a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d6885,_0x592005,_0xc19a27){return new BPromise(function(_0x41cd8d,_0x542d53){return client[_0xdb3a('0xb')](_0x1d6885,_0xc19a27)[_0xdb3a('0xc')](function(_0xc64f1f){logger['info']('Sound,\x20%s,\x20%s',_0x592005,_0xdb3a('0xd'));logger[_0xdb3a('0xe')](_0xdb3a('0xf'),_0x592005,_0xdb3a('0xd'),JSON[_0xdb3a('0x10')](_0xc64f1f));if(_0xc64f1f['error']){if(_0xc64f1f[_0xdb3a('0x11')][_0xdb3a('0x12')]===0x1f4){logger[_0xdb3a('0x11')](_0xdb3a('0x13'),_0x592005,_0xc64f1f[_0xdb3a('0x11')][_0xdb3a('0x14')]);return _0x542d53(_0xc64f1f[_0xdb3a('0x11')][_0xdb3a('0x14')]);}logger[_0xdb3a('0x11')]('Sound,\x20%s,\x20%s',_0x592005,_0xc64f1f[_0xdb3a('0x11')]['message']);return _0x41cd8d(_0xc64f1f[_0xdb3a('0x11')][_0xdb3a('0x14')]);}else{logger[_0xdb3a('0x15')](_0xdb3a('0x13'),_0x592005,_0xdb3a('0xd'));_0x41cd8d(_0xc64f1f[_0xdb3a('0x16')][_0xdb3a('0x14')]);}})[_0xdb3a('0x17')](function(_0x522bf7){logger[_0xdb3a('0x11')](_0xdb3a('0x13'),_0x592005,_0x522bf7);_0x542d53(_0x522bf7);});});}exports['ShowSound']=function(_0x55838b){var _0x28a17d=this;return new Promise(function(_0x319788,_0x48ee08){return db[_0xdb3a('0x18')]['find']({'raw':_0x55838b['options']?_0x55838b[_0xdb3a('0x19')][_0xdb3a('0x1a')]===undefined?!![]:![]:!![],'where':_0x55838b[_0xdb3a('0x19')]?_0x55838b[_0xdb3a('0x19')][_0xdb3a('0x1b')]||null:null,'attributes':_0x55838b[_0xdb3a('0x19')]?_0x55838b[_0xdb3a('0x19')]['attributes']||null:null,'include':_0x55838b[_0xdb3a('0x19')]?_0x55838b[_0xdb3a('0x19')]['include']?_['map'](_0x55838b[_0xdb3a('0x19')][_0xdb3a('0x1c')],function(_0x116159){return{'model':db[_0x116159['model']],'as':_0x116159['as'],'attributes':_0x116159[_0xdb3a('0x1d')],'include':_0x116159[_0xdb3a('0x1c')]?_[_0xdb3a('0x1e')](_0x116159[_0xdb3a('0x1c')],function(_0x45f2fa){return{'model':db[_0x45f2fa['model']],'as':_0x45f2fa['as'],'attributes':_0x45f2fa[_0xdb3a('0x1d')],'include':_0x45f2fa['include']?_[_0xdb3a('0x1e')](_0x45f2fa[_0xdb3a('0x1c')],function(_0x4c504){return{'model':db[_0x4c504['model']],'as':_0x4c504['as'],'attributes':_0x4c504[_0xdb3a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xdb3a('0xc')](function(_0x5c8b8f){logger[_0xdb3a('0x15')](_0xdb3a('0x1f'),_0x55838b);logger[_0xdb3a('0xe')](_0xdb3a('0x1f'),_0x55838b,JSON[_0xdb3a('0x10')](_0x5c8b8f));_0x319788(_0x5c8b8f);})[_0xdb3a('0x17')](function(_0x755fa5){logger['error'](_0xdb3a('0x1f'),_0x755fa5[_0xdb3a('0x14')],_0x55838b);_0x48ee08(_0x28a17d[_0xdb3a('0x11')](0x1f4,_0x755fa5[_0xdb3a('0x14')]));});});};
\ No newline at end of file
index 078ae96..e9a312f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ffd=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','get','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x4e0a0b,_0x3b2f6a){_0x4e0a0b=_0x4e0a0b-0x0;var _0x1c71b3=_0x9ffd[_0x4e0a0b];return _0x1c71b3;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router;
\ No newline at end of file
+var _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x41a336,_0x41ff4b){var _0x23a1c8=function(_0x28b95f){while(--_0x28b95f){_0x41a336['push'](_0x41a336['shift']());}};_0x23a1c8(++_0x41ff4b);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xb7e7[_0x34bc30];return _0x5706de;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router;
\ No newline at end of file
index 02fefda..9521fff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d5b=['STRING','TEXT','medium','out','exports'];(function(_0x5578b6,_0x34b602){var _0x2a6ff0=function(_0x782c24){while(--_0x782c24){_0x5578b6['push'](_0x5578b6['shift']());}};_0x2a6ff0(++_0x34b602);}(_0x7d5b,0x1ad));var _0xb7d5=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x7d5b[_0x2f1762];return _0x8ab21;};'use strict';var Sequelize=require('sequelize');module[_0xb7d5('0x0')]={'uniqueid':{'type':Sequelize[_0xb7d5('0x1')]},'body':{'type':Sequelize[_0xb7d5('0x2')](_0xb7d5('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb7d5('0x4')),'defaultValue':_0xb7d5('0x4'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x4fac=['ENUM','out','exports','STRING','TEXT','medium'];(function(_0xd341b,_0x3100ba){var _0x86bd5a=function(_0x325140){while(--_0x325140){_0xd341b['push'](_0xd341b['shift']());}};_0x86bd5a(++_0x3100ba);}(_0x4fac,0x170));var _0xc4fa=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4fac[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module[_0xc4fa('0x0')]={'uniqueid':{'type':Sequelize[_0xc4fa('0x1')]},'body':{'type':Sequelize[_0xc4fa('0x2')](_0xc4fa('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xc4fa('0x4')]('in',_0xc4fa('0x5')),'defaultValue':_0xc4fa('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xc4fa('0x1')]},'providerResponse':{'type':Sequelize[_0xc4fa('0x2')]}};
\ No newline at end of file
index b1f565c..08f0477 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x16d4=['query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','length','include','merge','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','SquareMessage','type','model'];(function(_0x2b3c76,_0x56d99a){var _0x108e68=function(_0x49d7b2){while(--_0x49d7b2){_0x2b3c76['push'](_0x2b3c76['shift']());}};_0x108e68(++_0x56d99a);}(_0x16d4,0x189));var _0x416d=function(_0x3ba7c5,_0x32b46f){_0x3ba7c5=_0x3ba7c5-0x0;var _0x4e4917=_0x16d4[_0x3ba7c5];return _0x4e4917;};'use strict';var emlformat=require(_0x416d('0x0'));var rimraf=require(_0x416d('0x1'));var zipdir=require(_0x416d('0x2'));var jsonpatch=require(_0x416d('0x3'));var rp=require(_0x416d('0x4'));var moment=require('moment');var BPromise=require(_0x416d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x416d('0x6'));var sox=require(_0x416d('0x7'));var csv=require(_0x416d('0x8'));var ejs=require(_0x416d('0x9'));var fs=require('fs');var fs_extra=require(_0x416d('0xa'));var _=require(_0x416d('0xb'));var squel=require(_0x416d('0xc'));var crypto=require(_0x416d('0xd'));var jsforce=require(_0x416d('0xe'));var deskjs=require(_0x416d('0xf'));var toCsv=require(_0x416d('0x8'));var querystring=require(_0x416d('0x10'));var Papa=require('papaparse');var Redis=require(_0x416d('0x11'));var authService=require(_0x416d('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x416d('0x13'))(_0x416d('0x14'));var utils=require('../../config/utils');var config=require(_0x416d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x106345,_0x488772){_0x488772=_0x488772||0xcc;return function(_0xffbb71){if(_0xffbb71){return _0x106345[_0x416d('0x16')](_0x488772);}return _0x106345[_0x416d('0x17')](_0x488772)['end']();};}function respondWithResult(_0x140884,_0x634e57){_0x634e57=_0x634e57||0xc8;return function(_0x5a1202){if(_0x5a1202){return _0x140884[_0x416d('0x17')](_0x634e57)[_0x416d('0x18')](_0x5a1202);}};}function respondWithFilteredResult(_0x13999d,_0x1e6924){return function(_0x4da4c6){if(_0x4da4c6){var _0x2c83d9=typeof _0x1e6924[_0x416d('0x19')]===_0x416d('0x1a')&&typeof _0x1e6924[_0x416d('0x1b')]==='undefined';var _0x390807=_0x4da4c6[_0x416d('0x1c')];var _0x540de7=_0x2c83d9?0x0:_0x1e6924['offset'];var _0x209981=_0x2c83d9?_0x4da4c6['count']:_0x1e6924['offset']+_0x1e6924[_0x416d('0x1b')];var _0x8aaa50;if(_0x209981>=_0x390807){_0x209981=_0x390807;_0x8aaa50=0xc8;}else{_0x8aaa50=0xce;}_0x13999d['status'](_0x8aaa50);return _0x13999d[_0x416d('0x1d')](_0x416d('0x1e'),_0x540de7+'-'+_0x209981+'/'+_0x390807)[_0x416d('0x18')](_0x4da4c6);}return null;};}function patchUpdates(_0x20c97c){return function(_0x41f670){try{jsonpatch[_0x416d('0x1f')](_0x41f670,_0x20c97c,!![]);}catch(_0x2ddc13){return BPromise[_0x416d('0x20')](_0x2ddc13);}return _0x41f670[_0x416d('0x21')]();};}function saveUpdates(_0x10aefd,_0xdb9efc){return function(_0x29c6b4){if(_0x29c6b4){return _0x29c6b4[_0x416d('0x22')](_0x10aefd)[_0x416d('0x23')](function(_0x95190d){return _0x95190d;});}return null;};}function removeEntity(_0x473547,_0x551a19){return function(_0x37d82d){if(_0x37d82d){return _0x37d82d[_0x416d('0x24')]()[_0x416d('0x23')](function(){_0x473547['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c2a10,_0x3168fb){return function(_0x4a767a){if(!_0x4a767a){_0x2c2a10[_0x416d('0x16')](0x194);}return _0x4a767a;};}function handleError(_0xcccf39,_0x5672f4){_0x5672f4=_0x5672f4||0x1f4;return function(_0x54afc9){logger['error'](_0x54afc9[_0x416d('0x25')]);if(_0x54afc9[_0x416d('0x26')]){delete _0x54afc9['name'];}_0xcccf39[_0x416d('0x17')](_0x5672f4)[_0x416d('0x27')](_0x54afc9);};}exports[_0x416d('0x28')]=function(_0x203a3d,_0x300e52){var _0x5b38ea={},_0x4e8465={},_0xf551f1={'count':0x0,'rows':[]};var _0x149e96=_[_0x416d('0x29')](db[_0x416d('0x2a')]['rawAttributes'],function(_0x396a77){return{'name':_0x396a77['fieldName'],'type':_0x396a77[_0x416d('0x2b')]['key']};});_0x4e8465[_0x416d('0x2c')]=_['map'](_0x149e96,'name');_0x4e8465[_0x416d('0x2d')]=_['keys'](_0x203a3d['query']);_0x4e8465[_0x416d('0x2e')]=_[_0x416d('0x2f')](_0x4e8465['model'],_0x4e8465['query']);_0x5b38ea['attributes']=_[_0x416d('0x2f')](_0x4e8465[_0x416d('0x2c')],qs[_0x416d('0x30')](_0x203a3d[_0x416d('0x2d')]['fields']));_0x5b38ea[_0x416d('0x31')]=_0x5b38ea['attributes']['length']?_0x5b38ea[_0x416d('0x31')]:_0x4e8465['model'];if(!_0x203a3d[_0x416d('0x2d')][_0x416d('0x32')](_0x416d('0x33'))){_0x5b38ea[_0x416d('0x1b')]=qs[_0x416d('0x1b')](_0x203a3d[_0x416d('0x2d')][_0x416d('0x1b')]);_0x5b38ea[_0x416d('0x19')]=qs[_0x416d('0x19')](_0x203a3d[_0x416d('0x2d')][_0x416d('0x19')]);}_0x5b38ea[_0x416d('0x34')]=qs[_0x416d('0x35')](_0x203a3d[_0x416d('0x2d')][_0x416d('0x35')]);_0x5b38ea[_0x416d('0x36')]=qs['filters'](_[_0x416d('0x37')](_0x203a3d['query'],_0x4e8465[_0x416d('0x2e')]),_0x149e96);if(_0x203a3d[_0x416d('0x2d')][_0x416d('0x38')]){_0x5b38ea[_0x416d('0x36')]=_['merge'](_0x5b38ea['where'],{'$or':_[_0x416d('0x29')](_0x149e96,function(_0x2fe3fb){if(_0x2fe3fb[_0x416d('0x2b')]!==_0x416d('0x39')){var _0x15f8be={};_0x15f8be[_0x2fe3fb[_0x416d('0x26')]]={'$like':'%'+_0x203a3d[_0x416d('0x2d')][_0x416d('0x38')]+'%'};return _0x15f8be;}})});}_0x5b38ea=_['merge']({},_0x5b38ea,_0x203a3d[_0x416d('0x3a')]);var _0x108bfd={'where':_0x5b38ea[_0x416d('0x36')]};return db['SquareMessage']['count'](_0x108bfd)[_0x416d('0x23')](function(_0x5d9785){_0xf551f1[_0x416d('0x1c')]=_0x5d9785;if(_0x203a3d[_0x416d('0x2d')][_0x416d('0x3b')]){_0x5b38ea['include']=[{'all':!![]}];}return db[_0x416d('0x2a')][_0x416d('0x3c')](_0x5b38ea);})[_0x416d('0x23')](function(_0x571093){_0xf551f1[_0x416d('0x3d')]=_0x571093;return _0xf551f1;})[_0x416d('0x23')](respondWithFilteredResult(_0x300e52,_0x5b38ea))[_0x416d('0x3e')](handleError(_0x300e52,null));};exports[_0x416d('0x3f')]=function(_0x56b50a,_0x360f71){var _0x2bccb6={'raw':!![],'where':{'id':_0x56b50a[_0x416d('0x40')]['id']}},_0x2594ad={};_0x2594ad[_0x416d('0x2c')]=_[_0x416d('0x41')](db['SquareMessage'][_0x416d('0x42')]);_0x2594ad['query']=_[_0x416d('0x41')](_0x56b50a[_0x416d('0x2d')]);_0x2594ad[_0x416d('0x2e')]=_['intersection'](_0x2594ad['model'],_0x2594ad[_0x416d('0x2d')]);_0x2bccb6[_0x416d('0x31')]=_[_0x416d('0x2f')](_0x2594ad[_0x416d('0x2c')],qs[_0x416d('0x30')](_0x56b50a[_0x416d('0x2d')][_0x416d('0x30')]));_0x2bccb6[_0x416d('0x31')]=_0x2bccb6[_0x416d('0x31')][_0x416d('0x43')]?_0x2bccb6['attributes']:_0x2594ad['model'];if(_0x56b50a['query'][_0x416d('0x3b')]){_0x2bccb6[_0x416d('0x44')]=[{'all':!![]}];}_0x2bccb6=_[_0x416d('0x45')]({},_0x2bccb6,_0x56b50a[_0x416d('0x3a')]);return db[_0x416d('0x2a')]['find'](_0x2bccb6)[_0x416d('0x23')](handleEntityNotFound(_0x360f71,null))[_0x416d('0x23')](respondWithResult(_0x360f71,null))[_0x416d('0x3e')](handleError(_0x360f71,null));};exports[_0x416d('0x46')]=function(_0x1d046f,_0x24ec80){return db[_0x416d('0x2a')]['create'](_0x1d046f[_0x416d('0x47')],{})[_0x416d('0x23')](respondWithResult(_0x24ec80,0xc9))['catch'](handleError(_0x24ec80,null));};exports[_0x416d('0x22')]=function(_0x3f4ca5,_0x132543){if(_0x3f4ca5[_0x416d('0x47')]['id']){delete _0x3f4ca5['body']['id'];}return db[_0x416d('0x2a')][_0x416d('0x48')]({'where':{'id':_0x3f4ca5[_0x416d('0x40')]['id']}})[_0x416d('0x23')](handleEntityNotFound(_0x132543,null))[_0x416d('0x23')](saveUpdates(_0x3f4ca5['body'],null))[_0x416d('0x23')](respondWithResult(_0x132543,null))[_0x416d('0x3e')](handleError(_0x132543,null));};exports['destroy']=function(_0x34f7ac,_0x594cb3){return db[_0x416d('0x2a')]['find']({'where':{'id':_0x34f7ac['params']['id']}})['then'](handleEntityNotFound(_0x594cb3,null))[_0x416d('0x23')](removeEntity(_0x594cb3,null))[_0x416d('0x3e')](handleError(_0x594cb3,null));};
\ No newline at end of file
+var _0x4c84=['type','model','keys','query','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','SquareMessage','includeAll','findAll','rows','catch','show','params','fields','length','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','rawAttributes','fieldName'];(function(_0x5a1dad,_0x21c9b6){var _0x1216da=function(_0x2fa0bb){while(--_0x2fa0bb){_0x5a1dad['push'](_0x5a1dad['shift']());}};_0x1216da(++_0x21c9b6);}(_0x4c84,0x14d));var _0x44c8=function(_0x19592e,_0x420948){_0x19592e=_0x19592e-0x0;var _0x6fb188=_0x4c84[_0x19592e];return _0x6fb188;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x44c8('0x0'));var zipdir=require(_0x44c8('0x1'));var jsonpatch=require(_0x44c8('0x2'));var rp=require(_0x44c8('0x3'));var moment=require(_0x44c8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x44c8('0x5'));var util=require(_0x44c8('0x6'));var path=require(_0x44c8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x44c8('0x8'));var _=require('lodash');var squel=require(_0x44c8('0x9'));var crypto=require(_0x44c8('0xa'));var jsforce=require(_0x44c8('0xb'));var deskjs=require(_0x44c8('0xc'));var toCsv=require(_0x44c8('0xd'));var querystring=require(_0x44c8('0xe'));var Papa=require(_0x44c8('0xf'));var Redis=require(_0x44c8('0x10'));var authService=require(_0x44c8('0x11'));var qs=require(_0x44c8('0x12'));var as=require(_0x44c8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x44c8('0x14'))(_0x44c8('0x15'));var utils=require('../../config/utils');var config=require(_0x44c8('0x16'));var licenseUtil=require(_0x44c8('0x17'));var db=require(_0x44c8('0x18'))['db'];function respondWithStatusCode(_0x370149,_0x438e8f){_0x438e8f=_0x438e8f||0xcc;return function(_0x5f4d4b){if(_0x5f4d4b){return _0x370149[_0x44c8('0x19')](_0x438e8f);}return _0x370149['status'](_0x438e8f)[_0x44c8('0x1a')]();};}function respondWithResult(_0x39eaef,_0x51b85a){_0x51b85a=_0x51b85a||0xc8;return function(_0x246926){if(_0x246926){return _0x39eaef[_0x44c8('0x1b')](_0x51b85a)[_0x44c8('0x1c')](_0x246926);}};}function respondWithFilteredResult(_0x3eddc0,_0x28f849){return function(_0x1c641b){if(_0x1c641b){var _0x5c276f=typeof _0x28f849[_0x44c8('0x1d')]===_0x44c8('0x1e')&&typeof _0x28f849[_0x44c8('0x1f')]==='undefined';var _0xa3af51=_0x1c641b[_0x44c8('0x20')];var _0x40cd8a=_0x5c276f?0x0:_0x28f849[_0x44c8('0x1d')];var _0x13f03f=_0x5c276f?_0x1c641b[_0x44c8('0x20')]:_0x28f849['offset']+_0x28f849['limit'];var _0x18bbf9;if(_0x13f03f>=_0xa3af51){_0x13f03f=_0xa3af51;_0x18bbf9=0xc8;}else{_0x18bbf9=0xce;}_0x3eddc0[_0x44c8('0x1b')](_0x18bbf9);return _0x3eddc0[_0x44c8('0x21')](_0x44c8('0x22'),_0x40cd8a+'-'+_0x13f03f+'/'+_0xa3af51)[_0x44c8('0x1c')](_0x1c641b);}return null;};}function patchUpdates(_0x4736a8){return function(_0x181494){try{jsonpatch[_0x44c8('0x23')](_0x181494,_0x4736a8,!![]);}catch(_0x3d7d0f){return BPromise[_0x44c8('0x24')](_0x3d7d0f);}return _0x181494[_0x44c8('0x25')]();};}function saveUpdates(_0x4596e6,_0x19f69c){return function(_0x1b2e13){if(_0x1b2e13){return _0x1b2e13[_0x44c8('0x26')](_0x4596e6)['then'](function(_0x380859){return _0x380859;});}return null;};}function removeEntity(_0x58298b,_0x327afd){return function(_0x5774c5){if(_0x5774c5){return _0x5774c5[_0x44c8('0x27')]()[_0x44c8('0x28')](function(){_0x58298b[_0x44c8('0x1b')](0xcc)[_0x44c8('0x1a')]();});}};}function handleEntityNotFound(_0x86510,_0xf881c4){return function(_0x316890){if(!_0x316890){_0x86510['sendStatus'](0x194);}return _0x316890;};}function handleError(_0x46471a,_0x3b5e10){_0x3b5e10=_0x3b5e10||0x1f4;return function(_0x4e9d8b){logger['error'](_0x4e9d8b[_0x44c8('0x29')]);if(_0x4e9d8b[_0x44c8('0x2a')]){delete _0x4e9d8b['name'];}_0x46471a['status'](_0x3b5e10)[_0x44c8('0x2b')](_0x4e9d8b);};}exports[_0x44c8('0x2c')]=function(_0x56f8ff,_0x3a8f86){var _0x55c3ff={},_0x19df7e={},_0x2054e5={'count':0x0,'rows':[]};var _0x5a3657=_['map'](db['SquareMessage'][_0x44c8('0x2d')],function(_0x42f58b){return{'name':_0x42f58b[_0x44c8('0x2e')],'type':_0x42f58b[_0x44c8('0x2f')]['key']};});_0x19df7e[_0x44c8('0x30')]=_['map'](_0x5a3657,_0x44c8('0x2a'));_0x19df7e['query']=_[_0x44c8('0x31')](_0x56f8ff[_0x44c8('0x32')]);_0x19df7e[_0x44c8('0x33')]=_[_0x44c8('0x34')](_0x19df7e[_0x44c8('0x30')],_0x19df7e[_0x44c8('0x32')]);_0x55c3ff['attributes']=_[_0x44c8('0x34')](_0x19df7e[_0x44c8('0x30')],qs['fields'](_0x56f8ff[_0x44c8('0x32')]['fields']));_0x55c3ff[_0x44c8('0x35')]=_0x55c3ff[_0x44c8('0x35')]['length']?_0x55c3ff['attributes']:_0x19df7e[_0x44c8('0x30')];if(!_0x56f8ff[_0x44c8('0x32')]['hasOwnProperty'](_0x44c8('0x36'))){_0x55c3ff[_0x44c8('0x1f')]=qs['limit'](_0x56f8ff[_0x44c8('0x32')][_0x44c8('0x1f')]);_0x55c3ff[_0x44c8('0x1d')]=qs['offset'](_0x56f8ff[_0x44c8('0x32')][_0x44c8('0x1d')]);}_0x55c3ff[_0x44c8('0x37')]=qs[_0x44c8('0x38')](_0x56f8ff[_0x44c8('0x32')][_0x44c8('0x38')]);_0x55c3ff[_0x44c8('0x39')]=qs['filters'](_[_0x44c8('0x3a')](_0x56f8ff[_0x44c8('0x32')],_0x19df7e['filters']),_0x5a3657);if(_0x56f8ff[_0x44c8('0x32')][_0x44c8('0x3b')]){_0x55c3ff[_0x44c8('0x39')]=_[_0x44c8('0x3c')](_0x55c3ff[_0x44c8('0x39')],{'$or':_[_0x44c8('0x3d')](_0x5a3657,function(_0x12c880){if(_0x12c880[_0x44c8('0x2f')]!==_0x44c8('0x3e')){var _0xb0125e={};_0xb0125e[_0x12c880[_0x44c8('0x2a')]]={'$like':'%'+_0x56f8ff[_0x44c8('0x32')][_0x44c8('0x3b')]+'%'};return _0xb0125e;}})});}_0x55c3ff=_[_0x44c8('0x3c')]({},_0x55c3ff,_0x56f8ff[_0x44c8('0x3f')]);var _0x3badb9={'where':_0x55c3ff[_0x44c8('0x39')]};return db[_0x44c8('0x40')][_0x44c8('0x20')](_0x3badb9)[_0x44c8('0x28')](function(_0x52b029){_0x2054e5['count']=_0x52b029;if(_0x56f8ff['query'][_0x44c8('0x41')]){_0x55c3ff['include']=[{'all':!![]}];}return db[_0x44c8('0x40')][_0x44c8('0x42')](_0x55c3ff);})['then'](function(_0x36bdf1){_0x2054e5[_0x44c8('0x43')]=_0x36bdf1;return _0x2054e5;})[_0x44c8('0x28')](respondWithFilteredResult(_0x3a8f86,_0x55c3ff))[_0x44c8('0x44')](handleError(_0x3a8f86,null));};exports[_0x44c8('0x45')]=function(_0x237f66,_0x42ac6f){var _0x2b623f={'raw':!![],'where':{'id':_0x237f66[_0x44c8('0x46')]['id']}},_0x570912={};_0x570912[_0x44c8('0x30')]=_[_0x44c8('0x31')](db[_0x44c8('0x40')][_0x44c8('0x2d')]);_0x570912[_0x44c8('0x32')]=_[_0x44c8('0x31')](_0x237f66[_0x44c8('0x32')]);_0x570912['filters']=_[_0x44c8('0x34')](_0x570912[_0x44c8('0x30')],_0x570912[_0x44c8('0x32')]);_0x2b623f[_0x44c8('0x35')]=_[_0x44c8('0x34')](_0x570912[_0x44c8('0x30')],qs[_0x44c8('0x47')](_0x237f66['query']['fields']));_0x2b623f[_0x44c8('0x35')]=_0x2b623f[_0x44c8('0x35')][_0x44c8('0x48')]?_0x2b623f[_0x44c8('0x35')]:_0x570912[_0x44c8('0x30')];if(_0x237f66['query'][_0x44c8('0x41')]){_0x2b623f['include']=[{'all':!![]}];}_0x2b623f=_[_0x44c8('0x3c')]({},_0x2b623f,_0x237f66[_0x44c8('0x3f')]);return db[_0x44c8('0x40')][_0x44c8('0x49')](_0x2b623f)[_0x44c8('0x28')](handleEntityNotFound(_0x42ac6f,null))[_0x44c8('0x28')](respondWithResult(_0x42ac6f,null))[_0x44c8('0x44')](handleError(_0x42ac6f,null));};exports[_0x44c8('0x4a')]=function(_0xaae4a3,_0x2a9d86){return db[_0x44c8('0x40')][_0x44c8('0x4a')](_0xaae4a3[_0x44c8('0x4b')],{})[_0x44c8('0x28')](respondWithResult(_0x2a9d86,0xc9))[_0x44c8('0x44')](handleError(_0x2a9d86,null));};exports['update']=function(_0x4a6cdd,_0x36807b){if(_0x4a6cdd[_0x44c8('0x4b')]['id']){delete _0x4a6cdd['body']['id'];}return db[_0x44c8('0x40')][_0x44c8('0x49')]({'where':{'id':_0x4a6cdd[_0x44c8('0x46')]['id']}})[_0x44c8('0x28')](handleEntityNotFound(_0x36807b,null))[_0x44c8('0x28')](saveUpdates(_0x4a6cdd[_0x44c8('0x4b')],null))[_0x44c8('0x28')](respondWithResult(_0x36807b,null))['catch'](handleError(_0x36807b,null));};exports[_0x44c8('0x27')]=function(_0x33e40c,_0x18f2a9){return db[_0x44c8('0x40')][_0x44c8('0x49')]({'where':{'id':_0x33e40c['params']['id']}})[_0x44c8('0x28')](handleEntityNotFound(_0x18f2a9,null))['then'](removeEntity(_0x18f2a9,null))[_0x44c8('0x44')](handleError(_0x18f2a9,null));};
\ No newline at end of file
index c42703a..e4297ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6469=['define','SquareMessage','square_messages','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x180abd,_0x1e0f91){var _0x1d5a66=function(_0x552a7e){while(--_0x552a7e){_0x180abd['push'](_0x180abd['shift']());}};_0x1d5a66(++_0x1e0f91);}(_0x6469,0x78));var _0x9646=function(_0x7c63f0,_0x2a140a){_0x7c63f0=_0x7c63f0-0x0;var _0x260bdf=_0x6469[_0x7c63f0];return _0x260bdf;};'use strict';var _=require(_0x9646('0x0'));var util=require('util');var logger=require(_0x9646('0x1'))(_0x9646('0x2'));var moment=require(_0x9646('0x3'));var BPromise=require(_0x9646('0x4'));var rp=require(_0x9646('0x5'));var fs=require('fs');var path=require(_0x9646('0x6'));var rimraf=require(_0x9646('0x7'));var config=require(_0x9646('0x8'));var attributes=require('./squareMessage.attributes');module[_0x9646('0x9')]=function(_0x5a731f,_0xfd14c6){return _0x5a731f[_0x9646('0xa')](_0x9646('0xb'),attributes,{'tableName':_0x9646('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ecb=['moment','request-promise','path','rimraf','../../config/environment','define','SquareMessage','square_messages','lodash','util','../../config/logger','api'];(function(_0x1c1166,_0x4ab029){var _0x3a5a67=function(_0xd33136){while(--_0xd33136){_0x1c1166['push'](_0x1c1166['shift']());}};_0x3a5a67(++_0x4ab029);}(_0x4ecb,0xf8));var _0xb4ec=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x4ecb[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0xb4ec('0x0'));var util=require(_0xb4ec('0x1'));var logger=require(_0xb4ec('0x2'))(_0xb4ec('0x3'));var moment=require(_0xb4ec('0x4'));var BPromise=require('bluebird');var rp=require(_0xb4ec('0x5'));var fs=require('fs');var path=require(_0xb4ec('0x6'));var rimraf=require(_0xb4ec('0x7'));var config=require(_0xb4ec('0x8'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x55f689,_0x1da43f){return _0x55f689[_0xb4ec('0x9')](_0xb4ec('0xa'),attributes,{'tableName':_0xb4ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c91cefd..163a53e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xade4=['raw','CreateSquareMessage','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','client','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SquareMessage','create','body','options'];(function(_0x320d18,_0x7a06d9){var _0x18166f=function(_0x15c016){while(--_0x15c016){_0x320d18['push'](_0x320d18['shift']());}};_0x18166f(++_0x7a06d9);}(_0xade4,0x147));var _0x4ade=function(_0x179dee,_0x487515){_0x179dee=_0x179dee-0x0;var _0x494709=_0xade4[_0x179dee];return _0x494709;};'use strict';var _=require(_0x4ade('0x0'));var util=require(_0x4ade('0x1'));var moment=require(_0x4ade('0x2'));var BPromise=require(_0x4ade('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ade('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4ade('0x5'));var config=require(_0x4ade('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4ade('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x482c96,_0x3fe369,_0x3e992d){return new BPromise(function(_0x415d59,_0x2185ca){return client['request'](_0x482c96,_0x3e992d)[_0x4ade('0x8')](function(_0x11d584){logger[_0x4ade('0x9')](_0x4ade('0xa'),_0x3fe369,_0x4ade('0xb'));logger[_0x4ade('0xc')](_0x4ade('0xd'),_0x3fe369,_0x4ade('0xb'),JSON[_0x4ade('0xe')](_0x11d584));if(_0x11d584[_0x4ade('0xf')]){if(_0x11d584['error']['code']===0x1f4){logger[_0x4ade('0xf')](_0x4ade('0xa'),_0x3fe369,_0x11d584[_0x4ade('0xf')]['message']);return _0x2185ca(_0x11d584['error']['message']);}logger[_0x4ade('0xf')]('SquareMessage,\x20%s,\x20%s',_0x3fe369,_0x11d584['error'][_0x4ade('0x10')]);return _0x415d59(_0x11d584['error'][_0x4ade('0x10')]);}else{logger[_0x4ade('0x9')](_0x4ade('0xa'),_0x3fe369,_0x4ade('0xb'));_0x415d59(_0x11d584[_0x4ade('0x11')]['message']);}})[_0x4ade('0x12')](function(_0x418e13){logger[_0x4ade('0xf')](_0x4ade('0xa'),_0x3fe369,_0x418e13);_0x2185ca(_0x418e13);});});}exports['CreateSquareMessage']=function(_0x37dddb){var _0x544a00=this;return new Promise(function(_0x9f5a0e,_0x4b3551){return db[_0x4ade('0x13')][_0x4ade('0x14')](_0x37dddb[_0x4ade('0x15')],{'raw':_0x37dddb['options']?_0x37dddb[_0x4ade('0x16')][_0x4ade('0x17')]===undefined?!![]:![]:!![]})[_0x4ade('0x8')](function(_0x33149a){logger['info'](_0x4ade('0x18'),_0x37dddb);logger['debug'](_0x4ade('0x18'),_0x37dddb,JSON[_0x4ade('0xe')](_0x33149a));_0x9f5a0e(_0x33149a);})['catch'](function(_0x34ace5){logger['error'](_0x4ade('0x18'),_0x34ace5[_0x4ade('0x10')],_0x37dddb);_0x4b3551(_0x544a00['error'](0x1f4,_0x34ace5['message']));});});};
\ No newline at end of file
+var _0xbc18=['request\x20sent','error','message','result','catch','SquareMessage','create','body','options','CreateSquareMessage','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s'];(function(_0x37928a,_0x46c7c7){var _0xbff5a9=function(_0x86b44b){while(--_0x86b44b){_0x37928a['push'](_0x37928a['shift']());}};_0xbff5a9(++_0x46c7c7);}(_0xbc18,0xeb));var _0x8bc1=function(_0x47604d,_0x15a014){_0x47604d=_0x47604d-0x0;var _0x388e4c=_0xbc18[_0x47604d];return _0x388e4c;};'use strict';var _=require('lodash');var util=require(_0x8bc1('0x0'));var moment=require(_0x8bc1('0x1'));var BPromise=require(_0x8bc1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8bc1('0x3'));var db=require(_0x8bc1('0x4'))['db'];var utils=require(_0x8bc1('0x5'));var logger=require(_0x8bc1('0x6'))(_0x8bc1('0x7'));var config=require(_0x8bc1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8bc1('0x9')][_0x8bc1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57582b,_0x4706ad,_0x370021){return new BPromise(function(_0x331b92,_0xac2968){return client[_0x8bc1('0xb')](_0x57582b,_0x370021)[_0x8bc1('0xc')](function(_0x4f3439){logger[_0x8bc1('0xd')](_0x8bc1('0xe'),_0x4706ad,'request\x20sent');logger[_0x8bc1('0xf')](_0x8bc1('0x10'),_0x4706ad,_0x8bc1('0x11'),JSON['stringify'](_0x4f3439));if(_0x4f3439[_0x8bc1('0x12')]){if(_0x4f3439[_0x8bc1('0x12')]['code']===0x1f4){logger[_0x8bc1('0x12')](_0x8bc1('0xe'),_0x4706ad,_0x4f3439['error']['message']);return _0xac2968(_0x4f3439[_0x8bc1('0x12')]['message']);}logger[_0x8bc1('0x12')](_0x8bc1('0xe'),_0x4706ad,_0x4f3439['error']['message']);return _0x331b92(_0x4f3439['error'][_0x8bc1('0x13')]);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x4706ad,'request\x20sent');_0x331b92(_0x4f3439[_0x8bc1('0x14')][_0x8bc1('0x13')]);}})[_0x8bc1('0x15')](function(_0x218d7e){logger[_0x8bc1('0x12')](_0x8bc1('0xe'),_0x4706ad,_0x218d7e);_0xac2968(_0x218d7e);});});}exports['CreateSquareMessage']=function(_0x3c8b56){var _0x47a4ca=this;return new Promise(function(_0xf2da7b,_0x5d9570){return db[_0x8bc1('0x16')][_0x8bc1('0x17')](_0x3c8b56[_0x8bc1('0x18')],{'raw':_0x3c8b56[_0x8bc1('0x19')]?_0x3c8b56[_0x8bc1('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xf8c10d){logger[_0x8bc1('0xd')](_0x8bc1('0x1a'),_0x3c8b56);logger[_0x8bc1('0xf')](_0x8bc1('0x1a'),_0x3c8b56,JSON[_0x8bc1('0x1b')](_0xf8c10d));_0xf2da7b(_0xf8c10d);})['catch'](function(_0x452848){logger[_0x8bc1('0x12')](_0x8bc1('0x1a'),_0x452848[_0x8bc1('0x13')],_0x3c8b56);_0x5d9570(_0x47a4ca['error'](0x1f4,_0x452848['message']));});});};
\ No newline at end of file
index 4d178c2..bfbae77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb37f=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','15s','post','/:id'];(function(_0x2e0a4e,_0x522471){var _0x414f7b=function(_0x31a444){while(--_0x31a444){_0x2e0a4e['push'](_0x2e0a4e['shift']());}};_0x414f7b(++_0x522471);}(_0xb37f,0x1be));var _0xfb37=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xb37f[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require(_0xfb37('0x0'));var util=require('util');var path=require(_0xfb37('0x1'));var timeout=require(_0xfb37('0x2'));var express=require(_0xfb37('0x3'));var router=express[_0xfb37('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfb37('0x5'));var interaction=require(_0xfb37('0x6'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router['get']('/',auth[_0xfb37('0x7')](),controller[_0xfb37('0x8')]);router[_0xfb37('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/test',auth[_0xfb37('0x7')](),timeout(_0xfb37('0xa')),controller['test']);router[_0xfb37('0xb')]('/',auth[_0xfb37('0x7')](),controller['create']);router['put'](_0xfb37('0xc'),auth[_0xfb37('0x7')](),controller[_0xfb37('0xd')]);router[_0xfb37('0xe')](_0xfb37('0xc'),auth['isAuthenticated'](),controller[_0xfb37('0xf')]);module[_0xfb37('0x10')]=router;
\ No newline at end of file
+var _0xd69e=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','index','get','/:id','show','/:id/test','test','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x5be795,_0x1cb1b8){var _0x4e8a3b=function(_0x5584ef){while(--_0x5584ef){_0x5be795['push'](_0x5be795['shift']());}};_0x4e8a3b(++_0x1cb1b8);}(_0xd69e,0x76));var _0xed69=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xd69e[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require(_0xed69('0x0'));var util=require(_0xed69('0x1'));var path=require(_0xed69('0x2'));var timeout=require(_0xed69('0x3'));var express=require(_0xed69('0x4'));var router=express[_0xed69('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xed69('0x6'));var interaction=require(_0xed69('0x7'));var config=require(_0xed69('0x8'));var controller=require(_0xed69('0x9'));router['get']('/',auth[_0xed69('0xa')](),controller[_0xed69('0xb')]);router[_0xed69('0xc')](_0xed69('0xd'),auth[_0xed69('0xa')](),controller[_0xed69('0xe')]);router[_0xed69('0xc')](_0xed69('0xf'),auth['isAuthenticated'](),timeout('15s'),controller[_0xed69('0x10')]);router[_0xed69('0x11')]('/',auth['isAuthenticated'](),controller[_0xed69('0x12')]);router[_0xed69('0x13')](_0xed69('0xd'),auth[_0xed69('0xa')](),controller[_0xed69('0x14')]);router[_0xed69('0x15')](_0xed69('0xd'),auth[_0xed69('0xa')](),controller[_0xed69('0x16')]);module[_0xed69('0x17')]=router;
\ No newline at end of file
index a01239b..f2672f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07ce=['STRING','name','sequelize','exports'];(function(_0x5cf27e,_0xc88b76){var _0x221edc=function(_0x322bd4){while(--_0x322bd4){_0x5cf27e['push'](_0x5cf27e['shift']());}};_0x221edc(++_0xc88b76);}(_0x07ce,0x142));var _0xe07c=function(_0x4df922,_0x2dd0d6){_0x4df922=_0x4df922-0x0;var _0x5e2a8b=_0x07ce[_0x4df922];return _0x5e2a8b;};'use strict';var Sequelize=require(_0xe07c('0x0'));module[_0xe07c('0x1')]={'name':{'type':Sequelize[_0xe07c('0x2')],'unique':_0xe07c('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xe07c('0x2')]},'description':{'type':Sequelize[_0xe07c('0x2')]}};
\ No newline at end of file
+var _0x3d34=['name','STRING','sequelize','exports'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x3d34,0x182));var _0x43d3=function(_0x3038be,_0x425d69){_0x3038be=_0x3038be-0x0;var _0x581d4e=_0x3d34[_0x3038be];return _0x581d4e;};'use strict';var Sequelize=require(_0x43d3('0x0'));module[_0x43d3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x43d3('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x43d3('0x3')]}};
\ No newline at end of file
index 6a97fa8..49aa190 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdec7=['length','hasOwnProperty','nolimit','sort','pick','filter','where','type','VIRTUAL','merge','options','SquareOdbc','include','rows','show','params','includeAll','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','create','update','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','Content-Range','apply','reject','save','then','get','destroy','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x6d6fc,_0xf3c9b4){var _0x25c92e=function(_0x119462){while(--_0x119462){_0x6d6fc['push'](_0x6d6fc['shift']());}};_0x25c92e(++_0xf3c9b4);}(_0xdec7,0xca));var _0x7dec=function(_0x1b361c,_0x1e904a){_0x1b361c=_0x1b361c-0x0;var _0x4440a1=_0xdec7[_0x1b361c];return _0x4440a1;};'use strict';var emlformat=require(_0x7dec('0x0'));var rimraf=require(_0x7dec('0x1'));var zipdir=require(_0x7dec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dec('0x3'));var moment=require(_0x7dec('0x4'));var BPromise=require(_0x7dec('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7dec('0x6'));var csv=require(_0x7dec('0x7'));var ejs=require(_0x7dec('0x8'));var fs=require('fs');var fs_extra=require(_0x7dec('0x9'));var _=require('lodash');var squel=require(_0x7dec('0xa'));var crypto=require(_0x7dec('0xb'));var jsforce=require(_0x7dec('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7dec('0x7'));var querystring=require(_0x7dec('0xd'));var Papa=require('papaparse');var Redis=require(_0x7dec('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7dec('0xf'));var as=require(_0x7dec('0x10'));var hardwareService=require(_0x7dec('0x11'));var logger=require(_0x7dec('0x12'))(_0x7dec('0x13'));var utils=require(_0x7dec('0x14'));var config=require(_0x7dec('0x15'));var licenseUtil=require(_0x7dec('0x16'));var db=require(_0x7dec('0x17'))['db'];function respondWithStatusCode(_0x57525b,_0x37bd25){_0x37bd25=_0x37bd25||0xcc;return function(_0x109337){if(_0x109337){return _0x57525b[_0x7dec('0x18')](_0x37bd25);}return _0x57525b[_0x7dec('0x19')](_0x37bd25)[_0x7dec('0x1a')]();};}function respondWithResult(_0xb6818c,_0x51c06d){_0x51c06d=_0x51c06d||0xc8;return function(_0x37e0b1){if(_0x37e0b1){return _0xb6818c[_0x7dec('0x19')](_0x51c06d)[_0x7dec('0x1b')](_0x37e0b1);}};}function respondWithFilteredResult(_0x586bbf,_0x3c42bc){return function(_0x49390f){if(_0x49390f){var _0x3f82d4=typeof _0x3c42bc[_0x7dec('0x1c')]==='undefined'&&typeof _0x3c42bc[_0x7dec('0x1d')]===_0x7dec('0x1e');var _0x140d97=_0x49390f['count'];var _0x11da31=_0x3f82d4?0x0:_0x3c42bc[_0x7dec('0x1c')];var _0x547ef7=_0x3f82d4?_0x49390f['count']:_0x3c42bc[_0x7dec('0x1c')]+_0x3c42bc[_0x7dec('0x1d')];var _0x3f86c8;if(_0x547ef7>=_0x140d97){_0x547ef7=_0x140d97;_0x3f86c8=0xc8;}else{_0x3f86c8=0xce;}_0x586bbf[_0x7dec('0x19')](_0x3f86c8);return _0x586bbf['set'](_0x7dec('0x1f'),_0x11da31+'-'+_0x547ef7+'/'+_0x140d97)[_0x7dec('0x1b')](_0x49390f);}return null;};}function patchUpdates(_0x364637){return function(_0x2cdbe2){try{jsonpatch[_0x7dec('0x20')](_0x2cdbe2,_0x364637,!![]);}catch(_0x2bc7ec){return BPromise[_0x7dec('0x21')](_0x2bc7ec);}return _0x2cdbe2[_0x7dec('0x22')]();};}function saveUpdates(_0x5b20e5,_0x57aedc){return function(_0x31c02d){if(_0x31c02d){return _0x31c02d['update'](_0x5b20e5)[_0x7dec('0x23')](function(_0x54ca6f){return _0x54ca6f;});}return null;};}function removeEntity(_0xdffdf9,_0x566b72){return function(_0x3ff4e3){if(_0x3ff4e3){return _0x3ff4e3['destroy']()[_0x7dec('0x23')](function(){var _0x5b1077=_0x3ff4e3[_0x7dec('0x24')]({'plain':!![]});var _0x5762a6='ODBC';return db['UserProfileResource'][_0x7dec('0x25')]({'where':{'type':_0x5762a6,'resourceId':_0x5b1077['id']}})[_0x7dec('0x23')](function(){return _0x3ff4e3;});})[_0x7dec('0x23')](function(){_0xdffdf9[_0x7dec('0x19')](0xcc)[_0x7dec('0x1a')]();});}};}function handleEntityNotFound(_0x2c2a5b,_0x413058){return function(_0xfa2e60){if(!_0xfa2e60){_0x2c2a5b['sendStatus'](0x194);}return _0xfa2e60;};}function handleError(_0x8fae15,_0x35bc07){_0x35bc07=_0x35bc07||0x1f4;return function(_0x37e2b2){logger[_0x7dec('0x26')](_0x37e2b2[_0x7dec('0x27')]);if(_0x37e2b2[_0x7dec('0x28')]){delete _0x37e2b2[_0x7dec('0x28')];}_0x8fae15[_0x7dec('0x19')](_0x35bc07)[_0x7dec('0x29')](_0x37e2b2);};}exports[_0x7dec('0x2a')]=function(_0x5d9a6f,_0x3a1704){var _0x3582ca={},_0x5b6d0f={},_0x2fd5e6={'count':0x0,'rows':[]};var _0x1012ed=_[_0x7dec('0x2b')](db['SquareOdbc'][_0x7dec('0x2c')],function(_0x3df84a){return{'name':_0x3df84a['fieldName'],'type':_0x3df84a['type'][_0x7dec('0x2d')]};});_0x5b6d0f[_0x7dec('0x2e')]=_[_0x7dec('0x2b')](_0x1012ed,'name');_0x5b6d0f[_0x7dec('0x2f')]=_[_0x7dec('0x30')](_0x5d9a6f[_0x7dec('0x2f')]);_0x5b6d0f[_0x7dec('0x31')]=_[_0x7dec('0x32')](_0x5b6d0f[_0x7dec('0x2e')],_0x5b6d0f[_0x7dec('0x2f')]);_0x3582ca[_0x7dec('0x33')]=_['intersection'](_0x5b6d0f[_0x7dec('0x2e')],qs[_0x7dec('0x34')](_0x5d9a6f[_0x7dec('0x2f')][_0x7dec('0x34')]));_0x3582ca[_0x7dec('0x33')]=_0x3582ca[_0x7dec('0x33')][_0x7dec('0x35')]?_0x3582ca['attributes']:_0x5b6d0f[_0x7dec('0x2e')];if(!_0x5d9a6f[_0x7dec('0x2f')][_0x7dec('0x36')](_0x7dec('0x37'))){_0x3582ca[_0x7dec('0x1d')]=qs['limit'](_0x5d9a6f['query']['limit']);_0x3582ca[_0x7dec('0x1c')]=qs[_0x7dec('0x1c')](_0x5d9a6f[_0x7dec('0x2f')][_0x7dec('0x1c')]);}_0x3582ca['order']=qs[_0x7dec('0x38')](_0x5d9a6f['query']['sort']);_0x3582ca['where']=qs[_0x7dec('0x31')](_[_0x7dec('0x39')](_0x5d9a6f[_0x7dec('0x2f')],_0x5b6d0f[_0x7dec('0x31')]),_0x1012ed);if(_0x5d9a6f['query'][_0x7dec('0x3a')]){_0x3582ca['where']=_['merge'](_0x3582ca[_0x7dec('0x3b')],{'$or':_['map'](_0x1012ed,function(_0x2bb4b5){if(_0x2bb4b5[_0x7dec('0x3c')]!==_0x7dec('0x3d')){var _0x234dc5={};_0x234dc5[_0x2bb4b5[_0x7dec('0x28')]]={'$like':'%'+_0x5d9a6f[_0x7dec('0x2f')][_0x7dec('0x3a')]+'%'};return _0x234dc5;}})});}_0x3582ca=_[_0x7dec('0x3e')]({},_0x3582ca,_0x5d9a6f[_0x7dec('0x3f')]);var _0x57fb75={'where':_0x3582ca['where']};return db[_0x7dec('0x40')]['count'](_0x57fb75)[_0x7dec('0x23')](function(_0x7b4ce9){_0x2fd5e6['count']=_0x7b4ce9;if(_0x5d9a6f[_0x7dec('0x2f')]['includeAll']){_0x3582ca[_0x7dec('0x41')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x3582ca);})['then'](function(_0x1e81cf){_0x2fd5e6[_0x7dec('0x42')]=_0x1e81cf;return _0x2fd5e6;})[_0x7dec('0x23')](respondWithFilteredResult(_0x3a1704,_0x3582ca))['catch'](handleError(_0x3a1704,null));};exports[_0x7dec('0x43')]=function(_0x110dc6,_0x12ab16){var _0x56c746={'raw':!![],'where':{'id':_0x110dc6[_0x7dec('0x44')]['id']}},_0x2cf64a={};_0x2cf64a['model']=_['keys'](db['SquareOdbc']['rawAttributes']);_0x2cf64a['query']=_[_0x7dec('0x30')](_0x110dc6['query']);_0x2cf64a['filters']=_[_0x7dec('0x32')](_0x2cf64a[_0x7dec('0x2e')],_0x2cf64a[_0x7dec('0x2f')]);_0x56c746[_0x7dec('0x33')]=_[_0x7dec('0x32')](_0x2cf64a['model'],qs[_0x7dec('0x34')](_0x110dc6['query'][_0x7dec('0x34')]));_0x56c746[_0x7dec('0x33')]=_0x56c746['attributes'][_0x7dec('0x35')]?_0x56c746[_0x7dec('0x33')]:_0x2cf64a[_0x7dec('0x2e')];if(_0x110dc6[_0x7dec('0x2f')][_0x7dec('0x45')]){_0x56c746[_0x7dec('0x41')]=[{'all':!![]}];}_0x56c746=_[_0x7dec('0x3e')]({},_0x56c746,_0x110dc6[_0x7dec('0x3f')]);return db[_0x7dec('0x40')][_0x7dec('0x46')](_0x56c746)[_0x7dec('0x23')](handleEntityNotFound(_0x12ab16,null))['then'](respondWithResult(_0x12ab16,null))[_0x7dec('0x47')](handleError(_0x12ab16,null));};exports['create']=function(_0x428426,_0x371dfc){return db['SquareOdbc']['create'](_0x428426[_0x7dec('0x48')],{})[_0x7dec('0x23')](function(_0x2c98a8){var _0xad631e=_0x428426[_0x7dec('0x49')]['get']({'plain':!![]});if(!_0xad631e)throw new Error(_0x7dec('0x4a'));if(_0xad631e[_0x7dec('0x4b')]==='user'){var _0x259669=_0x2c98a8[_0x7dec('0x24')]({'plain':!![]});var _0x5f28a9='ODBC';return db['UserProfileSection'][_0x7dec('0x46')]({'where':{'name':_0x5f28a9,'userProfileId':_0xad631e[_0x7dec('0x4c')]},'raw':!![]})[_0x7dec('0x23')](function(_0x5bd022){if(_0x5bd022&&_0x5bd022['autoAssociation']===0x0){return db[_0x7dec('0x4d')][_0x7dec('0x4e')]({'name':_0x259669[_0x7dec('0x28')],'resourceId':_0x259669['id'],'type':_0x5bd022[_0x7dec('0x28')],'sectionId':_0x5bd022['id']},{})['then'](function(){return _0x2c98a8;});}else{return _0x2c98a8;}})[_0x7dec('0x47')](function(_0x197bf4){logger[_0x7dec('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x197bf4);throw _0x197bf4;});}return _0x2c98a8;})[_0x7dec('0x23')](respondWithResult(_0x371dfc,0xc9))[_0x7dec('0x47')](handleError(_0x371dfc,null));};exports[_0x7dec('0x4f')]=function(_0x28d90f,_0x9c7505){if(_0x28d90f[_0x7dec('0x48')]['id']){delete _0x28d90f[_0x7dec('0x48')]['id'];}return db[_0x7dec('0x40')][_0x7dec('0x46')]({'where':{'id':_0x28d90f['params']['id']}})[_0x7dec('0x23')](handleEntityNotFound(_0x9c7505,null))[_0x7dec('0x23')](saveUpdates(_0x28d90f[_0x7dec('0x48')],null))['then'](respondWithResult(_0x9c7505,null))[_0x7dec('0x47')](handleError(_0x9c7505,null));};exports['destroy']=function(_0x99a604,_0x4e1c36){return db[_0x7dec('0x40')][_0x7dec('0x46')]({'where':{'id':_0x99a604[_0x7dec('0x44')]['id']}})[_0x7dec('0x23')](handleEntityNotFound(_0x4e1c36,null))['then'](removeEntity(_0x4e1c36,null))[_0x7dec('0x47')](handleError(_0x4e1c36,null));};exports[_0x7dec('0x50')]=function(_0x12562a,_0x55753f,_0x1c1722){var _0x3d9039;return db[_0x7dec('0x40')]['find']({'where':{'id':_0x12562a[_0x7dec('0x44')]['id']},'attributes':['id',_0x7dec('0x51')]})['then'](handleEntityNotFound(_0x55753f,null))[_0x7dec('0x23')](function(_0x2800f7){if(_0x2800f7){var _0x526dd3=require(_0x7dec('0x52'))();_0x526dd3[_0x7dec('0x53')](_0x2800f7[_0x7dec('0x51')]);_0x526dd3[_0x7dec('0x54')]();return _0x2800f7;}})['then'](respondWithResult(_0x55753f,null))[_0x7dec('0x47')](handleError(_0x55753f,null));};
\ No newline at end of file
+var _0x11fb=['send','index','map','SquareOdbc','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','openSync','closeSync','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','get','ODBC','UserProfileResource','destroy','end','error','stack'];(function(_0x57a4ca,_0x3e31eb){var _0x9d7818=function(_0x39664c){while(--_0x39664c){_0x57a4ca['push'](_0x57a4ca['shift']());}};_0x9d7818(++_0x3e31eb);}(_0x11fb,0x1ca));var _0xb11f=function(_0x40af5c,_0x3b6ad5){_0x40af5c=_0x40af5c-0x0;var _0x170a99=_0x11fb[_0x40af5c];return _0x170a99;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb11f('0x0'));var jsonpatch=require(_0xb11f('0x1'));var rp=require('request-promise');var moment=require(_0xb11f('0x2'));var BPromise=require(_0xb11f('0x3'));var Mustache=require(_0xb11f('0x4'));var util=require('util');var path=require(_0xb11f('0x5'));var sox=require('sox');var csv=require(_0xb11f('0x6'));var ejs=require(_0xb11f('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb11f('0x8'));var squel=require(_0xb11f('0x9'));var crypto=require('crypto');var jsforce=require(_0xb11f('0xa'));var deskjs=require(_0xb11f('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb11f('0xc'));var Redis=require(_0xb11f('0xd'));var authService=require(_0xb11f('0xe'));var qs=require(_0xb11f('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb11f('0x10'));var logger=require('../../config/logger')(_0xb11f('0x11'));var utils=require(_0xb11f('0x12'));var config=require(_0xb11f('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31b9e5,_0x393c36){_0x393c36=_0x393c36||0xcc;return function(_0x197144){if(_0x197144){return _0x31b9e5[_0xb11f('0x14')](_0x393c36);}return _0x31b9e5['status'](_0x393c36)['end']();};}function respondWithResult(_0x933a90,_0x2ea941){_0x2ea941=_0x2ea941||0xc8;return function(_0x2fcf3b){if(_0x2fcf3b){return _0x933a90['status'](_0x2ea941)[_0xb11f('0x15')](_0x2fcf3b);}};}function respondWithFilteredResult(_0x23d892,_0x42f48f){return function(_0x5b0fbb){if(_0x5b0fbb){var _0x2a2d0e=typeof _0x42f48f[_0xb11f('0x16')]===_0xb11f('0x17')&&typeof _0x42f48f[_0xb11f('0x18')]==='undefined';var _0x2960ee=_0x5b0fbb[_0xb11f('0x19')];var _0x5ad8a1=_0x2a2d0e?0x0:_0x42f48f['offset'];var _0x5f5622=_0x2a2d0e?_0x5b0fbb['count']:_0x42f48f[_0xb11f('0x16')]+_0x42f48f['limit'];var _0x3af16f;if(_0x5f5622>=_0x2960ee){_0x5f5622=_0x2960ee;_0x3af16f=0xc8;}else{_0x3af16f=0xce;}_0x23d892[_0xb11f('0x1a')](_0x3af16f);return _0x23d892[_0xb11f('0x1b')](_0xb11f('0x1c'),_0x5ad8a1+'-'+_0x5f5622+'/'+_0x2960ee)[_0xb11f('0x15')](_0x5b0fbb);}return null;};}function patchUpdates(_0x4859c9){return function(_0xa5b7bb){try{jsonpatch[_0xb11f('0x1d')](_0xa5b7bb,_0x4859c9,!![]);}catch(_0x459892){return BPromise[_0xb11f('0x1e')](_0x459892);}return _0xa5b7bb['save']();};}function saveUpdates(_0x53b0d1,_0x10c2ed){return function(_0x5011b6){if(_0x5011b6){return _0x5011b6[_0xb11f('0x1f')](_0x53b0d1)[_0xb11f('0x20')](function(_0x3fd48b){return _0x3fd48b;});}return null;};}function removeEntity(_0xff4e48,_0x3f76a0){return function(_0x2d6fdb){if(_0x2d6fdb){return _0x2d6fdb['destroy']()['then'](function(){var _0x128c59=_0x2d6fdb[_0xb11f('0x21')]({'plain':!![]});var _0x36284d=_0xb11f('0x22');return db[_0xb11f('0x23')][_0xb11f('0x24')]({'where':{'type':_0x36284d,'resourceId':_0x128c59['id']}})[_0xb11f('0x20')](function(){return _0x2d6fdb;});})['then'](function(){_0xff4e48[_0xb11f('0x1a')](0xcc)[_0xb11f('0x25')]();});}};}function handleEntityNotFound(_0x263b41,_0x16c87e){return function(_0x3045a9){if(!_0x3045a9){_0x263b41[_0xb11f('0x14')](0x194);}return _0x3045a9;};}function handleError(_0x3c1620,_0xf1f119){_0xf1f119=_0xf1f119||0x1f4;return function(_0x162b9e){logger[_0xb11f('0x26')](_0x162b9e[_0xb11f('0x27')]);if(_0x162b9e['name']){delete _0x162b9e['name'];}_0x3c1620[_0xb11f('0x1a')](_0xf1f119)[_0xb11f('0x28')](_0x162b9e);};}exports[_0xb11f('0x29')]=function(_0x5ce646,_0x146279){var _0x1fe909={},_0x12c40f={},_0x3ded4d={'count':0x0,'rows':[]};var _0x425b8b=_[_0xb11f('0x2a')](db[_0xb11f('0x2b')]['rawAttributes'],function(_0x352da6){return{'name':_0x352da6['fieldName'],'type':_0x352da6[_0xb11f('0x2c')][_0xb11f('0x2d')]};});_0x12c40f[_0xb11f('0x2e')]=_[_0xb11f('0x2a')](_0x425b8b,_0xb11f('0x2f'));_0x12c40f[_0xb11f('0x30')]=_['keys'](_0x5ce646['query']);_0x12c40f[_0xb11f('0x31')]=_[_0xb11f('0x32')](_0x12c40f[_0xb11f('0x2e')],_0x12c40f[_0xb11f('0x30')]);_0x1fe909[_0xb11f('0x33')]=_[_0xb11f('0x32')](_0x12c40f['model'],qs[_0xb11f('0x34')](_0x5ce646[_0xb11f('0x30')][_0xb11f('0x34')]));_0x1fe909['attributes']=_0x1fe909[_0xb11f('0x33')][_0xb11f('0x35')]?_0x1fe909[_0xb11f('0x33')]:_0x12c40f[_0xb11f('0x2e')];if(!_0x5ce646[_0xb11f('0x30')][_0xb11f('0x36')](_0xb11f('0x37'))){_0x1fe909[_0xb11f('0x18')]=qs[_0xb11f('0x18')](_0x5ce646[_0xb11f('0x30')][_0xb11f('0x18')]);_0x1fe909[_0xb11f('0x16')]=qs[_0xb11f('0x16')](_0x5ce646[_0xb11f('0x30')][_0xb11f('0x16')]);}_0x1fe909[_0xb11f('0x38')]=qs[_0xb11f('0x39')](_0x5ce646[_0xb11f('0x30')][_0xb11f('0x39')]);_0x1fe909[_0xb11f('0x3a')]=qs[_0xb11f('0x31')](_['pick'](_0x5ce646['query'],_0x12c40f[_0xb11f('0x31')]),_0x425b8b);if(_0x5ce646[_0xb11f('0x30')][_0xb11f('0x3b')]){_0x1fe909['where']=_[_0xb11f('0x3c')](_0x1fe909['where'],{'$or':_[_0xb11f('0x2a')](_0x425b8b,function(_0x4311f5){if(_0x4311f5['type']!==_0xb11f('0x3d')){var _0x12fa9d={};_0x12fa9d[_0x4311f5[_0xb11f('0x2f')]]={'$like':'%'+_0x5ce646[_0xb11f('0x30')][_0xb11f('0x3b')]+'%'};return _0x12fa9d;}})});}_0x1fe909=_['merge']({},_0x1fe909,_0x5ce646['options']);var _0x1cfc51={'where':_0x1fe909[_0xb11f('0x3a')]};return db[_0xb11f('0x2b')][_0xb11f('0x19')](_0x1cfc51)[_0xb11f('0x20')](function(_0x919b96){_0x3ded4d[_0xb11f('0x19')]=_0x919b96;if(_0x5ce646[_0xb11f('0x30')][_0xb11f('0x3e')]){_0x1fe909['include']=[{'all':!![]}];}return db['SquareOdbc'][_0xb11f('0x3f')](_0x1fe909);})[_0xb11f('0x20')](function(_0x49c5bb){_0x3ded4d[_0xb11f('0x40')]=_0x49c5bb;return _0x3ded4d;})[_0xb11f('0x20')](respondWithFilteredResult(_0x146279,_0x1fe909))[_0xb11f('0x41')](handleError(_0x146279,null));};exports[_0xb11f('0x42')]=function(_0x1d5c41,_0xe1e44b){var _0x188e05={'raw':!![],'where':{'id':_0x1d5c41[_0xb11f('0x43')]['id']}},_0x56c563={};_0x56c563['model']=_[_0xb11f('0x44')](db[_0xb11f('0x2b')][_0xb11f('0x45')]);_0x56c563[_0xb11f('0x30')]=_['keys'](_0x1d5c41['query']);_0x56c563[_0xb11f('0x31')]=_[_0xb11f('0x32')](_0x56c563['model'],_0x56c563[_0xb11f('0x30')]);_0x188e05[_0xb11f('0x33')]=_['intersection'](_0x56c563[_0xb11f('0x2e')],qs[_0xb11f('0x34')](_0x1d5c41[_0xb11f('0x30')][_0xb11f('0x34')]));_0x188e05[_0xb11f('0x33')]=_0x188e05['attributes'][_0xb11f('0x35')]?_0x188e05['attributes']:_0x56c563[_0xb11f('0x2e')];if(_0x1d5c41[_0xb11f('0x30')][_0xb11f('0x3e')]){_0x188e05['include']=[{'all':!![]}];}_0x188e05=_[_0xb11f('0x3c')]({},_0x188e05,_0x1d5c41[_0xb11f('0x46')]);return db[_0xb11f('0x2b')]['find'](_0x188e05)[_0xb11f('0x20')](handleEntityNotFound(_0xe1e44b,null))[_0xb11f('0x20')](respondWithResult(_0xe1e44b,null))[_0xb11f('0x41')](handleError(_0xe1e44b,null));};exports[_0xb11f('0x47')]=function(_0xe92750,_0x5bebdd){return db[_0xb11f('0x2b')][_0xb11f('0x47')](_0xe92750[_0xb11f('0x48')],{})[_0xb11f('0x20')](function(_0x623bb6){var _0x48baa2=_0xe92750[_0xb11f('0x49')]['get']({'plain':!![]});if(!_0x48baa2)throw new Error(_0xb11f('0x4a'));if(_0x48baa2[_0xb11f('0x4b')]===_0xb11f('0x49')){var _0x3438dd=_0x623bb6[_0xb11f('0x21')]({'plain':!![]});var _0x2f614f=_0xb11f('0x22');return db[_0xb11f('0x4c')][_0xb11f('0x4d')]({'where':{'name':_0x2f614f,'userProfileId':_0x48baa2['userProfileId']},'raw':!![]})[_0xb11f('0x20')](function(_0x354553){if(_0x354553&&_0x354553['autoAssociation']===0x0){return db[_0xb11f('0x23')][_0xb11f('0x47')]({'name':_0x3438dd[_0xb11f('0x2f')],'resourceId':_0x3438dd['id'],'type':_0x354553['name'],'sectionId':_0x354553['id']},{})[_0xb11f('0x20')](function(){return _0x623bb6;});}else{return _0x623bb6;}})['catch'](function(_0x5d48ba){logger[_0xb11f('0x26')](_0xb11f('0x4e'),_0x5d48ba);throw _0x5d48ba;});}return _0x623bb6;})[_0xb11f('0x20')](respondWithResult(_0x5bebdd,0xc9))['catch'](handleError(_0x5bebdd,null));};exports['update']=function(_0x56edaa,_0xf16490){if(_0x56edaa['body']['id']){delete _0x56edaa[_0xb11f('0x48')]['id'];}return db[_0xb11f('0x2b')]['find']({'where':{'id':_0x56edaa[_0xb11f('0x43')]['id']}})['then'](handleEntityNotFound(_0xf16490,null))[_0xb11f('0x20')](saveUpdates(_0x56edaa['body'],null))[_0xb11f('0x20')](respondWithResult(_0xf16490,null))[_0xb11f('0x41')](handleError(_0xf16490,null));};exports[_0xb11f('0x24')]=function(_0x3d69cb,_0xccf9b0){return db[_0xb11f('0x2b')][_0xb11f('0x4d')]({'where':{'id':_0x3d69cb[_0xb11f('0x43')]['id']}})['then'](handleEntityNotFound(_0xccf9b0,null))[_0xb11f('0x20')](removeEntity(_0xccf9b0,null))['catch'](handleError(_0xccf9b0,null));};exports[_0xb11f('0x4f')]=function(_0x247163,_0x3aa49a,_0xbcbed){var _0x3b8204;return db[_0xb11f('0x2b')]['find']({'where':{'id':_0x247163[_0xb11f('0x43')]['id']},'attributes':['id',_0xb11f('0x50')]})[_0xb11f('0x20')](handleEntityNotFound(_0x3aa49a,null))['then'](function(_0x5d7496){if(_0x5d7496){var _0x328ffc=require('odbc')();_0x328ffc[_0xb11f('0x51')](_0x5d7496[_0xb11f('0x50')]);_0x328ffc[_0xb11f('0x52')]();return _0x5d7496;}})[_0xb11f('0x20')](respondWithResult(_0x3aa49a,null))[_0xb11f('0x41')](handleError(_0x3aa49a,null));};
\ No newline at end of file
index 76c369b..d941631 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0434=['request-promise','path','rimraf','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','api','bluebird'];(function(_0x42e4ed,_0x4ee3fd){var _0x258dce=function(_0xac1550){while(--_0xac1550){_0x42e4ed['push'](_0x42e4ed['shift']());}};_0x258dce(++_0x4ee3fd);}(_0x0434,0xe0));var _0x4043=function(_0x164af1,_0x3cf772){_0x164af1=_0x164af1-0x0;var _0x5d81a2=_0x0434[_0x164af1];return _0x5d81a2;};'use strict';var _=require(_0x4043('0x0'));var util=require(_0x4043('0x1'));var logger=require('../../config/logger')(_0x4043('0x2'));var moment=require('moment');var BPromise=require(_0x4043('0x3'));var rp=require(_0x4043('0x4'));var fs=require('fs');var path=require(_0x4043('0x5'));var rimraf=require(_0x4043('0x6'));var config=require('../../config/environment');var attributes=require(_0x4043('0x7'));module[_0x4043('0x8')]=function(_0x43cb04,_0x10b7b9){return _0x43cb04[_0x4043('0x9')](_0x4043('0xa'),attributes,{'tableName':_0x4043('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb478=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','exports','square_odbc','lodash','util'];(function(_0x42b407,_0x3cb4e1){var _0x12aa4f=function(_0x8a307b){while(--_0x8a307b){_0x42b407['push'](_0x42b407['shift']());}};_0x12aa4f(++_0x3cb4e1);}(_0xb478,0x1ae));var _0x8b47=function(_0x11f083,_0x38a7dd){_0x11f083=_0x11f083-0x0;var _0x1a41f3=_0xb478[_0x11f083];return _0x1a41f3;};'use strict';var _=require(_0x8b47('0x0'));var util=require(_0x8b47('0x1'));var logger=require(_0x8b47('0x2'))(_0x8b47('0x3'));var moment=require(_0x8b47('0x4'));var BPromise=require(_0x8b47('0x5'));var rp=require(_0x8b47('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b47('0x7'));var config=require(_0x8b47('0x8'));var attributes=require(_0x8b47('0x9'));module[_0x8b47('0xa')]=function(_0x12d04d,_0x115627){return _0x12d04d['define']('SquareOdbc',attributes,{'tableName':_0x8b47('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ea4b845..9a48622 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2359=['map','model','then','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','ShowSquareOdbc','find','options','raw','where','attributes','include'];(function(_0x8933e6,_0x3f34c2){var _0x3e103a=function(_0x196a70){while(--_0x196a70){_0x8933e6['push'](_0x8933e6['shift']());}};_0x3e103a(++_0x3f34c2);}(_0x2359,0xa4));var _0x9235=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x2359[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x9235('0x0'));var util=require(_0x9235('0x1'));var moment=require(_0x9235('0x2'));var BPromise=require(_0x9235('0x3'));var rs=require(_0x9235('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9235('0x5'))['db'];var utils=require(_0x9235('0x6'));var logger=require(_0x9235('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9235('0x8')][_0x9235('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19c566,_0x286a27,_0x374cf6){return new BPromise(function(_0x47ead1,_0x725853){return client[_0x9235('0xa')](_0x19c566,_0x374cf6)['then'](function(_0x26401f){logger['info'](_0x9235('0xb'),_0x286a27,_0x9235('0xc'));logger[_0x9235('0xd')](_0x9235('0xe'),_0x286a27,_0x9235('0xc'),JSON['stringify'](_0x26401f));if(_0x26401f['error']){if(_0x26401f[_0x9235('0xf')][_0x9235('0x10')]===0x1f4){logger[_0x9235('0xf')](_0x9235('0xb'),_0x286a27,_0x26401f[_0x9235('0xf')][_0x9235('0x11')]);return _0x725853(_0x26401f['error'][_0x9235('0x11')]);}logger[_0x9235('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x286a27,_0x26401f[_0x9235('0xf')]['message']);return _0x47ead1(_0x26401f[_0x9235('0xf')][_0x9235('0x11')]);}else{logger[_0x9235('0x12')](_0x9235('0xb'),_0x286a27,'request\x20sent');_0x47ead1(_0x26401f[_0x9235('0x13')][_0x9235('0x11')]);}})[_0x9235('0x14')](function(_0x2c79e2){logger[_0x9235('0xf')](_0x9235('0xb'),_0x286a27,_0x2c79e2);_0x725853(_0x2c79e2);});});}exports[_0x9235('0x15')]=function(_0x1eb75a){var _0xec5516=this;return new Promise(function(_0x525afa,_0x20f076){return db['SquareOdbc'][_0x9235('0x16')]({'raw':_0x1eb75a[_0x9235('0x17')]?_0x1eb75a[_0x9235('0x17')][_0x9235('0x18')]===undefined?!![]:![]:!![],'where':_0x1eb75a[_0x9235('0x17')]?_0x1eb75a[_0x9235('0x17')][_0x9235('0x19')]||null:null,'attributes':_0x1eb75a[_0x9235('0x17')]?_0x1eb75a[_0x9235('0x17')][_0x9235('0x1a')]||null:null,'include':_0x1eb75a[_0x9235('0x17')]?_0x1eb75a['options'][_0x9235('0x1b')]?_[_0x9235('0x1c')](_0x1eb75a[_0x9235('0x17')][_0x9235('0x1b')],function(_0x46c05d){return{'model':db[_0x46c05d[_0x9235('0x1d')]],'as':_0x46c05d['as'],'attributes':_0x46c05d[_0x9235('0x1a')],'include':_0x46c05d[_0x9235('0x1b')]?_['map'](_0x46c05d[_0x9235('0x1b')],function(_0x12cfae){return{'model':db[_0x12cfae[_0x9235('0x1d')]],'as':_0x12cfae['as'],'attributes':_0x12cfae[_0x9235('0x1a')],'include':_0x12cfae[_0x9235('0x1b')]?_[_0x9235('0x1c')](_0x12cfae[_0x9235('0x1b')],function(_0x337394){return{'model':db[_0x337394[_0x9235('0x1d')]],'as':_0x337394['as'],'attributes':_0x337394[_0x9235('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9235('0x1e')](function(_0x3fda54){logger[_0x9235('0x12')](_0x9235('0x15'),_0x1eb75a);logger[_0x9235('0xd')]('ShowSquareOdbc',_0x1eb75a,JSON[_0x9235('0x1f')](_0x3fda54));_0x525afa(_0x3fda54);})['catch'](function(_0x43a12b){logger[_0x9235('0xf')](_0x9235('0x15'),_0x43a12b['message'],_0x1eb75a);_0x20f076(_0xec5516['error'](0x1f4,_0x43a12b[_0x9235('0x11')]));});});};
\ No newline at end of file
+var _0x714f=['SquareOdbc,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','options','raw','where','attributes','include','map','model','debug','util','moment','ioredis','../../mysqldb','rpc','jayson/promise','http','then','info'];(function(_0x69eb4f,_0x29aeeb){var _0x4323df=function(_0xbe349){while(--_0xbe349){_0x69eb4f['push'](_0x69eb4f['shift']());}};_0x4323df(++_0x29aeeb);}(_0x714f,0x1c2));var _0xf714=function(_0xd299c3,_0x4ba0f1){_0xd299c3=_0xd299c3-0x0;var _0x376574=_0x714f[_0xd299c3];return _0x376574;};'use strict';var _=require('lodash');var util=require(_0xf714('0x0'));var moment=require(_0xf714('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf714('0x2'));var db=require(_0xf714('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf714('0x4'));var config=require('../../config/environment');var jayson=require(_0xf714('0x5'));var client=jayson['client'][_0xf714('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xa7310,_0x4c58db,_0xceb77f){return new BPromise(function(_0x3c6e70,_0x48d7a2){return client['request'](_0xa7310,_0xceb77f)[_0xf714('0x7')](function(_0x2418f9){logger[_0xf714('0x8')](_0xf714('0x9'),_0x4c58db,_0xf714('0xa'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x4c58db,_0xf714('0xa'),JSON[_0xf714('0xb')](_0x2418f9));if(_0x2418f9['error']){if(_0x2418f9[_0xf714('0xc')][_0xf714('0xd')]===0x1f4){logger[_0xf714('0xc')](_0xf714('0x9'),_0x4c58db,_0x2418f9[_0xf714('0xc')]['message']);return _0x48d7a2(_0x2418f9['error']['message']);}logger[_0xf714('0xc')]('SquareOdbc,\x20%s,\x20%s',_0x4c58db,_0x2418f9['error'][_0xf714('0xe')]);return _0x3c6e70(_0x2418f9[_0xf714('0xc')][_0xf714('0xe')]);}else{logger['info'](_0xf714('0x9'),_0x4c58db,'request\x20sent');_0x3c6e70(_0x2418f9[_0xf714('0xf')]['message']);}})[_0xf714('0x10')](function(_0x1c62a2){logger['error'](_0xf714('0x9'),_0x4c58db,_0x1c62a2);_0x48d7a2(_0x1c62a2);});});}exports[_0xf714('0x11')]=function(_0x5ac200){var _0xde0bab=this;return new Promise(function(_0x519213,_0x5b628c){return db[_0xf714('0x12')]['find']({'raw':_0x5ac200[_0xf714('0x13')]?_0x5ac200[_0xf714('0x13')][_0xf714('0x14')]===undefined?!![]:![]:!![],'where':_0x5ac200[_0xf714('0x13')]?_0x5ac200[_0xf714('0x13')][_0xf714('0x15')]||null:null,'attributes':_0x5ac200[_0xf714('0x13')]?_0x5ac200[_0xf714('0x13')][_0xf714('0x16')]||null:null,'include':_0x5ac200['options']?_0x5ac200[_0xf714('0x13')][_0xf714('0x17')]?_[_0xf714('0x18')](_0x5ac200[_0xf714('0x13')][_0xf714('0x17')],function(_0x4af0aa){return{'model':db[_0x4af0aa['model']],'as':_0x4af0aa['as'],'attributes':_0x4af0aa['attributes'],'include':_0x4af0aa[_0xf714('0x17')]?_[_0xf714('0x18')](_0x4af0aa[_0xf714('0x17')],function(_0x26486e){return{'model':db[_0x26486e[_0xf714('0x19')]],'as':_0x26486e['as'],'attributes':_0x26486e[_0xf714('0x16')],'include':_0x26486e['include']?_[_0xf714('0x18')](_0x26486e['include'],function(_0x20a6ca){return{'model':db[_0x20a6ca[_0xf714('0x19')]],'as':_0x20a6ca['as'],'attributes':_0x20a6ca[_0xf714('0x16')]};}):[]};}):[]};}):[]:[]})[_0xf714('0x7')](function(_0x5d13e9){logger[_0xf714('0x8')](_0xf714('0x11'),_0x5ac200);logger[_0xf714('0x1a')](_0xf714('0x11'),_0x5ac200,JSON[_0xf714('0xb')](_0x5d13e9));_0x519213(_0x5d13e9);})[_0xf714('0x10')](function(_0x17ef2a){logger[_0xf714('0xc')](_0xf714('0x11'),_0x17ef2a[_0xf714('0xe')],_0x5ac200);_0x5b628c(_0xde0bab['error'](0x1f4,_0x17ef2a[_0xf714('0xe')]));});});};
\ No newline at end of file
index b84f885..780b7db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a2a=['getUsers','post','create','/:id/users','addUsers','put','update','delete','destroy','removeUsers','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index'];(function(_0x2e3edb,_0x219506){var _0x129f55=function(_0x7c7bc0){while(--_0x7c7bc0){_0x2e3edb['push'](_0x2e3edb['shift']());}};_0x129f55(++_0x219506);}(_0x8a2a,0x11f));var _0xa8a2=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x8a2a[_0x1b4b23];return _0x2a325b;};'use strict';var multer=require('multer');var util=require(_0xa8a2('0x0'));var path=require(_0xa8a2('0x1'));var timeout=require(_0xa8a2('0x2'));var express=require(_0xa8a2('0x3'));var router=express[_0xa8a2('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa8a2('0x5'));var interaction=require(_0xa8a2('0x6'));var config=require(_0xa8a2('0x7'));var controller=require(_0xa8a2('0x8'));router[_0xa8a2('0x9')]('/',auth[_0xa8a2('0xa')](),controller[_0xa8a2('0xb')]);router[_0xa8a2('0x9')]('/:id',auth[_0xa8a2('0xa')](),controller['show']);router['get']('/:id/users',auth[_0xa8a2('0xa')](),controller[_0xa8a2('0xc')]);router[_0xa8a2('0xd')]('/',auth['isAuthenticated'](),controller[_0xa8a2('0xe')]);router[_0xa8a2('0xd')](_0xa8a2('0xf'),auth[_0xa8a2('0xa')](),controller[_0xa8a2('0x10')]);router[_0xa8a2('0x11')]('/:id',auth[_0xa8a2('0xa')](),controller[_0xa8a2('0x12')]);router[_0xa8a2('0x13')]('/:id',auth[_0xa8a2('0xa')](),controller[_0xa8a2('0x14')]);router[_0xa8a2('0x13')](_0xa8a2('0xf'),auth[_0xa8a2('0xa')](),controller[_0xa8a2('0x15')]);module[_0xa8a2('0x16')]=router;
\ No newline at end of file
+var _0x463f=['update','delete','removeUsers','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./squareProject.controller','get','/:id','show','/:id/users','isAuthenticated','getUsers','post','addUsers','put'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x463f,0x164));var _0xf463=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x463f[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0xf463('0x0'));var util=require(_0xf463('0x1'));var path=require(_0xf463('0x2'));var timeout=require(_0xf463('0x3'));var express=require(_0xf463('0x4'));var router=express[_0xf463('0x5')]();var fs_extra=require(_0xf463('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf463('0x7'));var config=require('../../config/environment');var controller=require(_0xf463('0x8'));router[_0xf463('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf463('0x9')](_0xf463('0xa'),auth['isAuthenticated'](),controller[_0xf463('0xb')]);router[_0xf463('0x9')](_0xf463('0xc'),auth[_0xf463('0xd')](),controller[_0xf463('0xe')]);router['post']('/',auth[_0xf463('0xd')](),controller['create']);router[_0xf463('0xf')](_0xf463('0xc'),auth[_0xf463('0xd')](),controller[_0xf463('0x10')]);router[_0xf463('0x11')](_0xf463('0xa'),auth[_0xf463('0xd')](),controller[_0xf463('0x12')]);router[_0xf463('0x13')](_0xf463('0xa'),auth[_0xf463('0xd')](),controller['destroy']);router[_0xf463('0x13')](_0xf463('0xc'),auth[_0xf463('0xd')](),controller[_0xf463('0x14')]);module[_0xf463('0x15')]=router;
\ No newline at end of file
index e389215..58543be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fdd=['TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE','exports','STRING'];(function(_0x1a7546,_0xc197db){var _0x281be7=function(_0x43b3f0){while(--_0x43b3f0){_0x1a7546['push'](_0x1a7546['shift']());}};_0x281be7(++_0xc197db);}(_0x4fdd,0x17f));var _0xd4fd=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4fdd[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0xd4fd('0x0')]={'name':{'type':Sequelize[_0xd4fd('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xd4fd('0x2')]},'preproduction':{'type':Sequelize[_0xd4fd('0x3')](_0xd4fd('0x4')),'get':function(){if(this[_0xd4fd('0x5')](_0xd4fd('0x6'))){return this[_0xd4fd('0x5')](_0xd4fd('0x6'))[_0xd4fd('0x7')](_0xd4fd('0x8'));}}},'production':{'type':Sequelize[_0xd4fd('0x3')](_0xd4fd('0x4')),'get':function(){if(this[_0xd4fd('0x5')]('production')){return this[_0xd4fd('0x5')](_0xd4fd('0x9'))[_0xd4fd('0x7')](_0xd4fd('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xd4fd('0xa')]}};
\ No newline at end of file
+var _0x9541=['exports','STRING','name','BLOB','long','getDataValue','preproduction','utf8','production','toString','DATE','sequelize'];(function(_0x360ebc,_0x3dfa35){var _0x5d1ad9=function(_0x346d72){while(--_0x346d72){_0x360ebc['push'](_0x360ebc['shift']());}};_0x5d1ad9(++_0x3dfa35);}(_0x9541,0x8f));var _0x1954=function(_0x523af6,_0x2d595e){_0x523af6=_0x523af6-0x0;var _0x26fc8a=_0x9541[_0x523af6];return _0x26fc8a;};'use strict';var Sequelize=require(_0x1954('0x0'));module[_0x1954('0x1')]={'name':{'type':Sequelize[_0x1954('0x2')],'unique':_0x1954('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x1954('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x1954('0x4')](_0x1954('0x5')),'get':function(){if(this[_0x1954('0x6')](_0x1954('0x7'))){return this[_0x1954('0x6')](_0x1954('0x7'))['toString'](_0x1954('0x8'));}}},'production':{'type':Sequelize['BLOB'](_0x1954('0x5')),'get':function(){if(this[_0x1954('0x6')](_0x1954('0x9'))){return this[_0x1954('0x6')]('production')[_0x1954('0xa')]('utf8');}}},'savedAt':{'type':Sequelize[_0x1954('0xb')]},'publishedAt':{'type':Sequelize[_0x1954('0xb')]}};
\ No newline at end of file
index 95b1b27..4975197 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8952=['params','publish','production','addUsers','ids','removeUsers','emit','userSquareProject:remove','getUsers','order','map','hasOwnProperty','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./squareProject.socket','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','update','then','destroy','get','SquareProjects','agi','stringify','error','name','send','SquareProject','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x4680cf,_0x20346b){var _0x1eaba9=function(_0x1702f7){while(--_0x1702f7){_0x4680cf['push'](_0x4680cf['shift']());}};_0x1eaba9(++_0x20346b);}(_0x8952,0x17e));var _0x2895=function(_0x31f9e1,_0x37ab38){_0x31f9e1=_0x31f9e1-0x0;var _0x16b85d=_0x8952[_0x31f9e1];return _0x16b85d;};'use strict';var _=require('lodash');var Redis=require(_0x2895('0x0'));var qs=require(_0x2895('0x1'));var logger=require(_0x2895('0x2'))(_0x2895('0x3'));var config=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];config[_0x2895('0x5')]=_[_0x2895('0x6')](config[_0x2895('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x2895('0x7'))(new Redis(config[_0x2895('0x5')]));require(_0x2895('0x8'))['register'](socket);function respondWithStatusCode(_0x526c32,_0x238b4a){_0x238b4a=_0x238b4a||0xcc;return function(_0x335002){if(_0x335002){return _0x526c32[_0x2895('0x9')](_0x238b4a);}return _0x526c32[_0x2895('0xa')](_0x238b4a)[_0x2895('0xb')]();};}function respondWithResult(_0x4952fa,_0x14fb67){_0x14fb67=_0x14fb67||0xc8;return function(_0x5f2632){if(_0x5f2632){return _0x4952fa[_0x2895('0xa')](_0x14fb67)['json'](_0x5f2632);}};}function respondWithFilteredResult(_0x5e66fc,_0x56c5b9){return function(_0x9bb58c){if(_0x9bb58c){var _0x1829a2=typeof _0x56c5b9[_0x2895('0xc')]==='undefined'&&typeof _0x56c5b9[_0x2895('0xd')]===_0x2895('0xe');var _0x4b1342=_0x9bb58c[_0x2895('0xf')];var _0x2cbeb1=_0x1829a2?0x0:_0x56c5b9['offset'];var _0x590a1b=_0x1829a2?_0x9bb58c[_0x2895('0xf')]:_0x56c5b9[_0x2895('0xc')]+_0x56c5b9['limit'];var _0x2198c3;if(_0x590a1b>=_0x4b1342){_0x590a1b=_0x4b1342;_0x2198c3=0xc8;}else{_0x2198c3=0xce;}_0x5e66fc[_0x2895('0xa')](_0x2198c3);return _0x5e66fc[_0x2895('0x10')](_0x2895('0x11'),_0x2cbeb1+'-'+_0x590a1b+'/'+_0x4b1342)[_0x2895('0x12')](_0x9bb58c);}return null;};}function saveUpdates(_0x2627e6){return function(_0x6a5c7e){if(_0x6a5c7e){return _0x6a5c7e[_0x2895('0x13')](_0x2627e6)[_0x2895('0x14')](function(_0x407b86){return _0x407b86;});}return null;};}function removeEntity(_0x10a1bf){return function(_0x183b05){if(_0x183b05){return _0x183b05[_0x2895('0x15')]()[_0x2895('0x14')](function(){var _0x155124=_0x183b05[_0x2895('0x16')]({'plain':!![]});var _0x2fe8fe=_0x2895('0x17');return db['UserProfileResource']['destroy']({'where':{'type':_0x2fe8fe,'resourceId':_0x155124['id']}})['then'](function(){return _0x183b05;});})[_0x2895('0x14')](function(){var _0x12c2fb=new Redis(config[_0x2895('0x5')]);_0x12c2fb['publish'](_0x2895('0x18'),JSON[_0x2895('0x19')]({'id':_0x183b05['id'],'deleted':!![]}));})[_0x2895('0x14')](function(){_0x10a1bf[_0x2895('0xa')](0xcc)[_0x2895('0xb')]();});}};}function handleEntityNotFound(_0x5dbbfe){return function(_0x30c6c3){if(!_0x30c6c3){_0x5dbbfe[_0x2895('0x9')](0x194);}return _0x30c6c3;};}function handleError(_0x5671fa,_0x142e58){_0x142e58=_0x142e58||0x1f4;return function(_0x384357){logger[_0x2895('0x1a')](_0x384357['stack']);if(_0x384357['name']){delete _0x384357[_0x2895('0x1b')];}_0x5671fa[_0x2895('0xa')](_0x142e58)[_0x2895('0x1c')](_0x384357);};}exports['index']=function(_0x3d3320,_0x3690ce){var _0x480604={},_0x293ad3={},_0x127540={'count':0x0,'rows':[]};var _0x2cd4df=_['map'](db[_0x2895('0x1d')][_0x2895('0x1e')],function(_0x5eedfc){return{'name':_0x5eedfc[_0x2895('0x1f')],'type':_0x5eedfc['type']['key']};});_0x293ad3[_0x2895('0x20')]=_['map'](_0x2cd4df,_0x2895('0x1b'));_0x293ad3[_0x2895('0x21')]=_['keys'](_0x3d3320['query']);_0x293ad3[_0x2895('0x22')]=_[_0x2895('0x23')](_0x293ad3[_0x2895('0x20')],_0x293ad3[_0x2895('0x21')]);_0x480604[_0x2895('0x24')]=_[_0x2895('0x23')](_0x293ad3[_0x2895('0x20')],qs['fields'](_0x3d3320[_0x2895('0x21')][_0x2895('0x25')]));_0x480604[_0x2895('0x24')]=_0x480604['attributes'][_0x2895('0x26')]?_0x480604[_0x2895('0x24')]:_0x293ad3[_0x2895('0x20')];if(!_0x3d3320[_0x2895('0x21')]['hasOwnProperty'](_0x2895('0x27'))){_0x480604[_0x2895('0xd')]=qs[_0x2895('0xd')](_0x3d3320[_0x2895('0x21')][_0x2895('0xd')]);_0x480604['offset']=qs['offset'](_0x3d3320[_0x2895('0x21')][_0x2895('0xc')]);}_0x480604['order']=qs[_0x2895('0x28')](_0x3d3320['query'][_0x2895('0x28')]);_0x480604[_0x2895('0x29')]=qs['filters'](_[_0x2895('0x2a')](_0x3d3320['query'],_0x293ad3[_0x2895('0x22')]),_0x2cd4df);if(_0x3d3320['query']['filter']){_0x480604[_0x2895('0x29')]=_[_0x2895('0x2b')](_0x480604[_0x2895('0x29')],{'$or':_['map'](_0x2cd4df,function(_0x1e4348){if(_0x1e4348[_0x2895('0x2c')]!==_0x2895('0x2d')){var _0x3ff672={};_0x3ff672[_0x1e4348[_0x2895('0x1b')]]={'$like':'%'+_0x3d3320[_0x2895('0x21')][_0x2895('0x2e')]+'%'};return _0x3ff672;}})});}_0x480604=_[_0x2895('0x2b')]({},_0x480604,_0x3d3320[_0x2895('0x2f')]);var _0xa6b8c5={'where':_0x480604['where']};return db[_0x2895('0x1d')][_0x2895('0xf')](_0xa6b8c5)[_0x2895('0x14')](function(_0x1e5788){_0x127540[_0x2895('0xf')]=_0x1e5788;if(_0x3d3320[_0x2895('0x21')][_0x2895('0x30')]){_0x480604['include']=[{'all':!![]}];}return db['SquareProject'][_0x2895('0x31')](_0x480604);})[_0x2895('0x14')](function(_0x24b9e0){_0x127540[_0x2895('0x32')]=_0x24b9e0;return _0x127540;})[_0x2895('0x14')](respondWithFilteredResult(_0x3690ce,_0x480604))[_0x2895('0x33')](handleError(_0x3690ce,null));};exports['show']=function(_0x5d18ef,_0x3f083e){var _0x20208f={'raw':![],'where':{'id':_0x5d18ef['params']['id']}},_0x5ce598={};_0x5ce598[_0x2895('0x20')]=_[_0x2895('0x34')](db[_0x2895('0x1d')][_0x2895('0x1e')]);_0x5ce598[_0x2895('0x21')]=_[_0x2895('0x34')](_0x5d18ef['query']);_0x5ce598[_0x2895('0x22')]=_[_0x2895('0x23')](_0x5ce598[_0x2895('0x20')],_0x5ce598[_0x2895('0x21')]);_0x20208f['attributes']=_[_0x2895('0x23')](_0x5ce598[_0x2895('0x20')],qs[_0x2895('0x25')](_0x5d18ef[_0x2895('0x21')]['fields']));_0x20208f['attributes']=_0x20208f[_0x2895('0x24')][_0x2895('0x26')]?_0x20208f[_0x2895('0x24')]:_0x5ce598[_0x2895('0x20')];if(_0x5d18ef[_0x2895('0x21')]['includeAll']){_0x20208f['include']=[{'all':!![]}];}_0x20208f=_[_0x2895('0x2b')]({},_0x20208f,_0x5d18ef[_0x2895('0x2f')]);return db[_0x2895('0x1d')][_0x2895('0x35')](_0x20208f)[_0x2895('0x14')](handleEntityNotFound(_0x3f083e,null))[_0x2895('0x14')](respondWithResult(_0x3f083e,null))[_0x2895('0x33')](handleError(_0x3f083e,null));};exports['create']=function(_0x1a2bb0,_0x25dd5b){return db[_0x2895('0x1d')][_0x2895('0x36')](_0x1a2bb0[_0x2895('0x37')],{})[_0x2895('0x14')](function(_0x232464){var _0x299d71=_0x1a2bb0['user'][_0x2895('0x16')]({'plain':!![]});if(!_0x299d71)throw new Error(_0x2895('0x38'));if(_0x299d71[_0x2895('0x39')]==='user'){var _0xc85aa1=_0x232464[_0x2895('0x16')]({'plain':!![]});var _0x5e4f70=_0x2895('0x17');return db[_0x2895('0x3a')][_0x2895('0x35')]({'where':{'name':_0x5e4f70,'userProfileId':_0x299d71[_0x2895('0x3b')]},'raw':!![]})[_0x2895('0x14')](function(_0x3cc331){if(_0x3cc331&&_0x3cc331[_0x2895('0x3c')]===0x0){return db['UserProfileResource'][_0x2895('0x36')]({'name':_0xc85aa1[_0x2895('0x1b')],'resourceId':_0xc85aa1['id'],'type':_0x3cc331['name'],'sectionId':_0x3cc331['id']},{})['then'](function(){return _0x232464;});}else{return _0x232464;}})['catch'](function(_0x212a1f){logger[_0x2895('0x1a')](_0x2895('0x3d'),_0x212a1f);throw _0x212a1f;});}return _0x232464;})[_0x2895('0x14')](respondWithResult(_0x25dd5b,0xc9))[_0x2895('0x33')](handleError(_0x25dd5b,null));};exports[_0x2895('0x13')]=function(_0xaca46c,_0x7df911){if(_0xaca46c[_0x2895('0x37')]['id']){delete _0xaca46c[_0x2895('0x37')]['id'];}return db[_0x2895('0x1d')][_0x2895('0x35')]({'where':{'id':_0xaca46c[_0x2895('0x3e')]['id']}})[_0x2895('0x14')](handleEntityNotFound(_0x7df911,null))[_0x2895('0x14')](saveUpdates(_0xaca46c[_0x2895('0x37')],null))[_0x2895('0x14')](function(_0x3e0fde){if(!_0x3e0fde)return;var _0xbcf98=_0x3e0fde[_0x2895('0x16')]({'plain':!![]});return _0xbcf98;})[_0x2895('0x14')](function(_0x90ed5d){var _0x434f23=new Redis(config[_0x2895('0x5')]);_0x434f23[_0x2895('0x3f')](_0x2895('0x18'),JSON[_0x2895('0x19')](_[_0x2895('0x2a')](_0x90ed5d,['id',_0x2895('0x1b'),_0x2895('0x40')])));return _0x90ed5d;})[_0x2895('0x14')](respondWithResult(_0x7df911,null))['catch'](handleError(_0x7df911,null));};exports[_0x2895('0x15')]=function(_0x1f7d91,_0x2bc573){return db[_0x2895('0x1d')][_0x2895('0x35')]({'where':{'id':_0x1f7d91[_0x2895('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2bc573,null))[_0x2895('0x14')](removeEntity(_0x2bc573,null))['catch'](handleError(_0x2bc573,null));};exports[_0x2895('0x41')]=function(_0x2fed1c,_0x319795){return db[_0x2895('0x1d')][_0x2895('0x35')]({'where':{'id':_0x2fed1c['params']['id']}})['then'](handleEntityNotFound(_0x319795,null))[_0x2895('0x14')](function(_0x11d336){if(_0x11d336){return _0x11d336[_0x2895('0x41')](_0x2fed1c['body'][_0x2895('0x42')],_['omit'](_0x2fed1c[_0x2895('0x37')],['ids','id'])||{});}})['then'](respondWithResult(_0x319795,null))['catch'](handleError(_0x319795,null));};exports['removeUsers']=function(_0x36177d,_0x2ff725){return db[_0x2895('0x1d')][_0x2895('0x35')]({'where':{'id':_0x36177d[_0x2895('0x3e')]['id']}})[_0x2895('0x14')](handleEntityNotFound(_0x2ff725,null))[_0x2895('0x14')](function(_0x5d186c){if(_0x5d186c){return _0x5d186c[_0x2895('0x43')](_0x36177d[_0x2895('0x21')]['ids'])[_0x2895('0x14')](function(){if(_['isArray'](_0x36177d['query'][_0x2895('0x42')])){for(var _0x14d7f9=0x0;_0x14d7f9<_0x36177d['query'][_0x2895('0x42')][_0x2895('0x26')];_0x14d7f9+=0x1){socket[_0x2895('0x44')](_0x2895('0x45'),{'UserId':Number(_0x36177d['query'][_0x2895('0x42')][_0x14d7f9]),'SquareProjectId':Number(_0x36177d['params']['id'])});}}else{socket[_0x2895('0x44')]('userSquareProject:remove',{'UserId':Number(_0x36177d['query'][_0x2895('0x42')]),'SquareProjectId':Number(_0x36177d['params']['id'])});}});}})[_0x2895('0x14')](respondWithStatusCode(_0x2ff725,null))[_0x2895('0x33')](handleError(_0x2ff725,null));};exports[_0x2895('0x46')]=function(_0x559ef3,_0x44eb51){var _0x115357={};var _0x5b6413={};var _0x52f07d;var _0x147074;return db[_0x2895('0x1d')]['findOne']({'where':{'id':_0x559ef3[_0x2895('0x3e')]['id']}})['then'](handleEntityNotFound(_0x44eb51,null))['then'](function(_0x98b64d){if(_0x98b64d){_0x52f07d=_0x98b64d;_0x5b6413[_0x2895('0x20')]=_[_0x2895('0x34')](db['User'][_0x2895('0x1e')]);_0x5b6413[_0x2895('0x21')]=_[_0x2895('0x34')](_0x559ef3[_0x2895('0x21')]);_0x5b6413[_0x2895('0x22')]=_[_0x2895('0x23')](_0x5b6413[_0x2895('0x20')],_0x5b6413['query']);_0x115357[_0x2895('0x24')]=_[_0x2895('0x23')](_0x5b6413[_0x2895('0x20')],qs[_0x2895('0x25')](_0x559ef3[_0x2895('0x21')][_0x2895('0x25')]));_0x115357[_0x2895('0x24')]=_0x115357[_0x2895('0x24')]['length']?_0x115357[_0x2895('0x24')]:_0x5b6413[_0x2895('0x20')];_0x115357[_0x2895('0x47')]=qs[_0x2895('0x28')](_0x559ef3[_0x2895('0x21')][_0x2895('0x28')]);_0x115357[_0x2895('0x29')]=qs[_0x2895('0x22')](_[_0x2895('0x2a')](_0x559ef3[_0x2895('0x21')],_0x5b6413['filters']));if(_0x559ef3[_0x2895('0x21')][_0x2895('0x2e')]){_0x115357[_0x2895('0x29')]=_[_0x2895('0x2b')](_0x115357[_0x2895('0x29')],{'$or':_[_0x2895('0x48')](_0x115357[_0x2895('0x24')],function(_0x438982){var _0x203609={};_0x203609[_0x438982]={'$like':'%'+_0x559ef3[_0x2895('0x21')]['filter']+'%'};return _0x203609;})});}_0x115357=_[_0x2895('0x2b')]({},_0x115357,_0x559ef3[_0x2895('0x2f')]);return _0x52f07d[_0x2895('0x46')](_0x115357);}})[_0x2895('0x14')](function(_0x14561d){if(_0x14561d){_0x147074=_0x14561d['length'];if(!_0x559ef3[_0x2895('0x21')][_0x2895('0x49')]('nolimit')){_0x115357['limit']=qs['limit'](_0x559ef3[_0x2895('0x21')][_0x2895('0xd')]);_0x115357[_0x2895('0xc')]=qs[_0x2895('0xc')](_0x559ef3[_0x2895('0x21')]['offset']);}return _0x52f07d['getUsers'](_0x115357);}})[_0x2895('0x14')](function(_0x580796){if(_0x580796){return _0x580796?{'count':_0x147074,'rows':_0x580796}:null;}})[_0x2895('0x14')](respondWithResult(_0x44eb51,null))['catch'](handleError(_0x44eb51,null));};
\ No newline at end of file
+var _0x8952=['params','publish','production','addUsers','ids','removeUsers','emit','userSquareProject:remove','getUsers','order','map','hasOwnProperty','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./squareProject.socket','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','update','then','destroy','get','SquareProjects','agi','stringify','error','name','send','SquareProject','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x59176e,_0x3bcfab){var _0x4d0d76=function(_0x4eab39){while(--_0x4eab39){_0x59176e['push'](_0x59176e['shift']());}};_0x4d0d76(++_0x3bcfab);}(_0x8952,0x17e));var _0x2895=function(_0x1491c0,_0x1cb6d2){_0x1491c0=_0x1491c0-0x0;var _0xc5bbe5=_0x8952[_0x1491c0];return _0xc5bbe5;};'use strict';var _=require('lodash');var Redis=require(_0x2895('0x0'));var qs=require(_0x2895('0x1'));var logger=require(_0x2895('0x2'))(_0x2895('0x3'));var config=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];config[_0x2895('0x5')]=_[_0x2895('0x6')](config[_0x2895('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x2895('0x7'))(new Redis(config[_0x2895('0x5')]));require(_0x2895('0x8'))['register'](socket);function respondWithStatusCode(_0x526c32,_0x238b4a){_0x238b4a=_0x238b4a||0xcc;return function(_0x335002){if(_0x335002){return _0x526c32[_0x2895('0x9')](_0x238b4a);}return _0x526c32[_0x2895('0xa')](_0x238b4a)[_0x2895('0xb')]();};}function respondWithResult(_0x4952fa,_0x14fb67){_0x14fb67=_0x14fb67||0xc8;return function(_0x5f2632){if(_0x5f2632){return _0x4952fa[_0x2895('0xa')](_0x14fb67)['json'](_0x5f2632);}};}function respondWithFilteredResult(_0x5e66fc,_0x56c5b9){return function(_0x9bb58c){if(_0x9bb58c){var _0x1829a2=typeof _0x56c5b9[_0x2895('0xc')]==='undefined'&&typeof _0x56c5b9[_0x2895('0xd')]===_0x2895('0xe');var _0x4b1342=_0x9bb58c[_0x2895('0xf')];var _0x2cbeb1=_0x1829a2?0x0:_0x56c5b9['offset'];var _0x590a1b=_0x1829a2?_0x9bb58c[_0x2895('0xf')]:_0x56c5b9[_0x2895('0xc')]+_0x56c5b9['limit'];var _0x2198c3;if(_0x590a1b>=_0x4b1342){_0x590a1b=_0x4b1342;_0x2198c3=0xc8;}else{_0x2198c3=0xce;}_0x5e66fc[_0x2895('0xa')](_0x2198c3);return _0x5e66fc[_0x2895('0x10')](_0x2895('0x11'),_0x2cbeb1+'-'+_0x590a1b+'/'+_0x4b1342)[_0x2895('0x12')](_0x9bb58c);}return null;};}function saveUpdates(_0x2627e6){return function(_0x6a5c7e){if(_0x6a5c7e){return _0x6a5c7e[_0x2895('0x13')](_0x2627e6)[_0x2895('0x14')](function(_0x407b86){return _0x407b86;});}return null;};}function removeEntity(_0x10a1bf){return function(_0x183b05){if(_0x183b05){return _0x183b05[_0x2895('0x15')]()[_0x2895('0x14')](function(){var _0x155124=_0x183b05[_0x2895('0x16')]({'plain':!![]});var _0x2fe8fe=_0x2895('0x17');return db['UserProfileResource']['destroy']({'where':{'type':_0x2fe8fe,'resourceId':_0x155124['id']}})['then'](function(){return _0x183b05;});})[_0x2895('0x14')](function(){var _0x12c2fb=new Redis(config[_0x2895('0x5')]);_0x12c2fb['publish'](_0x2895('0x18'),JSON[_0x2895('0x19')]({'id':_0x183b05['id'],'deleted':!![]}));})[_0x2895('0x14')](function(){_0x10a1bf[_0x2895('0xa')](0xcc)[_0x2895('0xb')]();});}};}function handleEntityNotFound(_0x5dbbfe){return function(_0x30c6c3){if(!_0x30c6c3){_0x5dbbfe[_0x2895('0x9')](0x194);}return _0x30c6c3;};}function handleError(_0x5671fa,_0x142e58){_0x142e58=_0x142e58||0x1f4;return function(_0x384357){logger[_0x2895('0x1a')](_0x384357['stack']);if(_0x384357['name']){delete _0x384357[_0x2895('0x1b')];}_0x5671fa[_0x2895('0xa')](_0x142e58)[_0x2895('0x1c')](_0x384357);};}exports['index']=function(_0x3d3320,_0x3690ce){var _0x480604={},_0x293ad3={},_0x127540={'count':0x0,'rows':[]};var _0x2cd4df=_['map'](db[_0x2895('0x1d')][_0x2895('0x1e')],function(_0x5eedfc){return{'name':_0x5eedfc[_0x2895('0x1f')],'type':_0x5eedfc['type']['key']};});_0x293ad3[_0x2895('0x20')]=_['map'](_0x2cd4df,_0x2895('0x1b'));_0x293ad3[_0x2895('0x21')]=_['keys'](_0x3d3320['query']);_0x293ad3[_0x2895('0x22')]=_[_0x2895('0x23')](_0x293ad3[_0x2895('0x20')],_0x293ad3[_0x2895('0x21')]);_0x480604[_0x2895('0x24')]=_[_0x2895('0x23')](_0x293ad3[_0x2895('0x20')],qs['fields'](_0x3d3320[_0x2895('0x21')][_0x2895('0x25')]));_0x480604[_0x2895('0x24')]=_0x480604['attributes'][_0x2895('0x26')]?_0x480604[_0x2895('0x24')]:_0x293ad3[_0x2895('0x20')];if(!_0x3d3320[_0x2895('0x21')]['hasOwnProperty'](_0x2895('0x27'))){_0x480604[_0x2895('0xd')]=qs[_0x2895('0xd')](_0x3d3320[_0x2895('0x21')][_0x2895('0xd')]);_0x480604['offset']=qs['offset'](_0x3d3320[_0x2895('0x21')][_0x2895('0xc')]);}_0x480604['order']=qs[_0x2895('0x28')](_0x3d3320['query'][_0x2895('0x28')]);_0x480604[_0x2895('0x29')]=qs['filters'](_[_0x2895('0x2a')](_0x3d3320['query'],_0x293ad3[_0x2895('0x22')]),_0x2cd4df);if(_0x3d3320['query']['filter']){_0x480604[_0x2895('0x29')]=_[_0x2895('0x2b')](_0x480604[_0x2895('0x29')],{'$or':_['map'](_0x2cd4df,function(_0x1e4348){if(_0x1e4348[_0x2895('0x2c')]!==_0x2895('0x2d')){var _0x3ff672={};_0x3ff672[_0x1e4348[_0x2895('0x1b')]]={'$like':'%'+_0x3d3320[_0x2895('0x21')][_0x2895('0x2e')]+'%'};return _0x3ff672;}})});}_0x480604=_[_0x2895('0x2b')]({},_0x480604,_0x3d3320[_0x2895('0x2f')]);var _0xa6b8c5={'where':_0x480604['where']};return db[_0x2895('0x1d')][_0x2895('0xf')](_0xa6b8c5)[_0x2895('0x14')](function(_0x1e5788){_0x127540[_0x2895('0xf')]=_0x1e5788;if(_0x3d3320[_0x2895('0x21')][_0x2895('0x30')]){_0x480604['include']=[{'all':!![]}];}return db['SquareProject'][_0x2895('0x31')](_0x480604);})[_0x2895('0x14')](function(_0x24b9e0){_0x127540[_0x2895('0x32')]=_0x24b9e0;return _0x127540;})[_0x2895('0x14')](respondWithFilteredResult(_0x3690ce,_0x480604))[_0x2895('0x33')](handleError(_0x3690ce,null));};exports['show']=function(_0x5d18ef,_0x3f083e){var _0x20208f={'raw':![],'where':{'id':_0x5d18ef['params']['id']}},_0x5ce598={};_0x5ce598[_0x2895('0x20')]=_[_0x2895('0x34')](db[_0x2895('0x1d')][_0x2895('0x1e')]);_0x5ce598[_0x2895('0x21')]=_[_0x2895('0x34')](_0x5d18ef['query']);_0x5ce598[_0x2895('0x22')]=_[_0x2895('0x23')](_0x5ce598[_0x2895('0x20')],_0x5ce598[_0x2895('0x21')]);_0x20208f['attributes']=_[_0x2895('0x23')](_0x5ce598[_0x2895('0x20')],qs[_0x2895('0x25')](_0x5d18ef[_0x2895('0x21')]['fields']));_0x20208f['attributes']=_0x20208f[_0x2895('0x24')][_0x2895('0x26')]?_0x20208f[_0x2895('0x24')]:_0x5ce598[_0x2895('0x20')];if(_0x5d18ef[_0x2895('0x21')]['includeAll']){_0x20208f['include']=[{'all':!![]}];}_0x20208f=_[_0x2895('0x2b')]({},_0x20208f,_0x5d18ef[_0x2895('0x2f')]);return db[_0x2895('0x1d')][_0x2895('0x35')](_0x20208f)[_0x2895('0x14')](handleEntityNotFound(_0x3f083e,null))[_0x2895('0x14')](respondWithResult(_0x3f083e,null))[_0x2895('0x33')](handleError(_0x3f083e,null));};exports['create']=function(_0x1a2bb0,_0x25dd5b){return db[_0x2895('0x1d')][_0x2895('0x36')](_0x1a2bb0[_0x2895('0x37')],{})[_0x2895('0x14')](function(_0x232464){var _0x299d71=_0x1a2bb0['user'][_0x2895('0x16')]({'plain':!![]});if(!_0x299d71)throw new Error(_0x2895('0x38'));if(_0x299d71[_0x2895('0x39')]==='user'){var _0xc85aa1=_0x232464[_0x2895('0x16')]({'plain':!![]});var _0x5e4f70=_0x2895('0x17');return db[_0x2895('0x3a')][_0x2895('0x35')]({'where':{'name':_0x5e4f70,'userProfileId':_0x299d71[_0x2895('0x3b')]},'raw':!![]})[_0x2895('0x14')](function(_0x3cc331){if(_0x3cc331&&_0x3cc331[_0x2895('0x3c')]===0x0){return db['UserProfileResource'][_0x2895('0x36')]({'name':_0xc85aa1[_0x2895('0x1b')],'resourceId':_0xc85aa1['id'],'type':_0x3cc331['name'],'sectionId':_0x3cc331['id']},{})['then'](function(){return _0x232464;});}else{return _0x232464;}})['catch'](function(_0x212a1f){logger[_0x2895('0x1a')](_0x2895('0x3d'),_0x212a1f);throw _0x212a1f;});}return _0x232464;})[_0x2895('0x14')](respondWithResult(_0x25dd5b,0xc9))[_0x2895('0x33')](handleError(_0x25dd5b,null));};exports[_0x2895('0x13')]=function(_0xaca46c,_0x7df911){if(_0xaca46c[_0x2895('0x37')]['id']){delete _0xaca46c[_0x2895('0x37')]['id'];}return db[_0x2895('0x1d')][_0x2895('0x35')]({'where':{'id':_0xaca46c[_0x2895('0x3e')]['id']}})[_0x2895('0x14')](handleEntityNotFound(_0x7df911,null))[_0x2895('0x14')](saveUpdates(_0xaca46c[_0x2895('0x37')],null))[_0x2895('0x14')](function(_0x3e0fde){if(!_0x3e0fde)return;var _0xbcf98=_0x3e0fde[_0x2895('0x16')]({'plain':!![]});return _0xbcf98;})[_0x2895('0x14')](function(_0x90ed5d){var _0x434f23=new Redis(config[_0x2895('0x5')]);_0x434f23[_0x2895('0x3f')](_0x2895('0x18'),JSON[_0x2895('0x19')](_[_0x2895('0x2a')](_0x90ed5d,['id',_0x2895('0x1b'),_0x2895('0x40')])));return _0x90ed5d;})[_0x2895('0x14')](respondWithResult(_0x7df911,null))['catch'](handleError(_0x7df911,null));};exports[_0x2895('0x15')]=function(_0x1f7d91,_0x2bc573){return db[_0x2895('0x1d')][_0x2895('0x35')]({'where':{'id':_0x1f7d91[_0x2895('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2bc573,null))[_0x2895('0x14')](removeEntity(_0x2bc573,null))['catch'](handleError(_0x2bc573,null));};exports[_0x2895('0x41')]=function(_0x2fed1c,_0x319795){return db[_0x2895('0x1d')][_0x2895('0x35')]({'where':{'id':_0x2fed1c['params']['id']}})['then'](handleEntityNotFound(_0x319795,null))[_0x2895('0x14')](function(_0x11d336){if(_0x11d336){return _0x11d336[_0x2895('0x41')](_0x2fed1c['body'][_0x2895('0x42')],_['omit'](_0x2fed1c[_0x2895('0x37')],['ids','id'])||{});}})['then'](respondWithResult(_0x319795,null))['catch'](handleError(_0x319795,null));};exports['removeUsers']=function(_0x36177d,_0x2ff725){return db[_0x2895('0x1d')][_0x2895('0x35')]({'where':{'id':_0x36177d[_0x2895('0x3e')]['id']}})[_0x2895('0x14')](handleEntityNotFound(_0x2ff725,null))[_0x2895('0x14')](function(_0x5d186c){if(_0x5d186c){return _0x5d186c[_0x2895('0x43')](_0x36177d[_0x2895('0x21')]['ids'])[_0x2895('0x14')](function(){if(_['isArray'](_0x36177d['query'][_0x2895('0x42')])){for(var _0x14d7f9=0x0;_0x14d7f9<_0x36177d['query'][_0x2895('0x42')][_0x2895('0x26')];_0x14d7f9+=0x1){socket[_0x2895('0x44')](_0x2895('0x45'),{'UserId':Number(_0x36177d['query'][_0x2895('0x42')][_0x14d7f9]),'SquareProjectId':Number(_0x36177d['params']['id'])});}}else{socket[_0x2895('0x44')]('userSquareProject:remove',{'UserId':Number(_0x36177d['query'][_0x2895('0x42')]),'SquareProjectId':Number(_0x36177d['params']['id'])});}});}})[_0x2895('0x14')](respondWithStatusCode(_0x2ff725,null))[_0x2895('0x33')](handleError(_0x2ff725,null));};exports[_0x2895('0x46')]=function(_0x559ef3,_0x44eb51){var _0x115357={};var _0x5b6413={};var _0x52f07d;var _0x147074;return db[_0x2895('0x1d')]['findOne']({'where':{'id':_0x559ef3[_0x2895('0x3e')]['id']}})['then'](handleEntityNotFound(_0x44eb51,null))['then'](function(_0x98b64d){if(_0x98b64d){_0x52f07d=_0x98b64d;_0x5b6413[_0x2895('0x20')]=_[_0x2895('0x34')](db['User'][_0x2895('0x1e')]);_0x5b6413[_0x2895('0x21')]=_[_0x2895('0x34')](_0x559ef3[_0x2895('0x21')]);_0x5b6413[_0x2895('0x22')]=_[_0x2895('0x23')](_0x5b6413[_0x2895('0x20')],_0x5b6413['query']);_0x115357[_0x2895('0x24')]=_[_0x2895('0x23')](_0x5b6413[_0x2895('0x20')],qs[_0x2895('0x25')](_0x559ef3[_0x2895('0x21')][_0x2895('0x25')]));_0x115357[_0x2895('0x24')]=_0x115357[_0x2895('0x24')]['length']?_0x115357[_0x2895('0x24')]:_0x5b6413[_0x2895('0x20')];_0x115357[_0x2895('0x47')]=qs[_0x2895('0x28')](_0x559ef3[_0x2895('0x21')][_0x2895('0x28')]);_0x115357[_0x2895('0x29')]=qs[_0x2895('0x22')](_[_0x2895('0x2a')](_0x559ef3[_0x2895('0x21')],_0x5b6413['filters']));if(_0x559ef3[_0x2895('0x21')][_0x2895('0x2e')]){_0x115357[_0x2895('0x29')]=_[_0x2895('0x2b')](_0x115357[_0x2895('0x29')],{'$or':_[_0x2895('0x48')](_0x115357[_0x2895('0x24')],function(_0x438982){var _0x203609={};_0x203609[_0x438982]={'$like':'%'+_0x559ef3[_0x2895('0x21')]['filter']+'%'};return _0x203609;})});}_0x115357=_[_0x2895('0x2b')]({},_0x115357,_0x559ef3[_0x2895('0x2f')]);return _0x52f07d[_0x2895('0x46')](_0x115357);}})[_0x2895('0x14')](function(_0x14561d){if(_0x14561d){_0x147074=_0x14561d['length'];if(!_0x559ef3[_0x2895('0x21')][_0x2895('0x49')]('nolimit')){_0x115357['limit']=qs['limit'](_0x559ef3[_0x2895('0x21')][_0x2895('0xd')]);_0x115357[_0x2895('0xc')]=qs[_0x2895('0xc')](_0x559ef3[_0x2895('0x21')]['offset']);}return _0x52f07d['getUsers'](_0x115357);}})[_0x2895('0x14')](function(_0x580796){if(_0x580796){return _0x580796?{'count':_0x147074,'rows':_0x580796}:null;}})[_0x2895('0x14')](respondWithResult(_0x44eb51,null))['catch'](handleError(_0x44eb51,null));};
\ No newline at end of file
index c0df1a7..2be5f3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc9=['hook','events','../../mysqldb','SquareProject','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x484f06,_0x36e4ac){var _0x332d44=function(_0x1db42e){while(--_0x1db42e){_0x484f06['push'](_0x484f06['shift']());}};_0x332d44(++_0x36e4ac);}(_0x4fc9,0xeb));var _0x94fc=function(_0x4ffa4b,_0x5614f1){_0x4ffa4b=_0x4ffa4b-0x0;var _0x1df14e=_0x4fc9[_0x4ffa4b];return _0x1df14e;};'use strict';var EventEmitter=require(_0x94fc('0x0'));var SquareProject=require(_0x94fc('0x1'))['db'][_0x94fc('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x94fc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x94fc('0x4'),'afterDestroy':_0x94fc('0x5')};function emitEvent(_0x5c1d56){return function(_0x31c926,_0x51d2c5,_0x4f77f3){SquareProjectEvents[_0x94fc('0x6')](_0x5c1d56+':'+_0x31c926['id'],_0x31c926);SquareProjectEvents[_0x94fc('0x6')](_0x5c1d56,_0x31c926);_0x4f77f3(null);};}for(var e in events){if(events[_0x94fc('0x7')](e)){var event=events[e];SquareProject[_0x94fc('0x8')](e,emitEvent(event));}}module['exports']=SquareProjectEvents;
\ No newline at end of file
+var _0xa128=['remove','emit','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update'];(function(_0x545bd6,_0x24fa08){var _0x5b10a4=function(_0x301208){while(--_0x301208){_0x545bd6['push'](_0x545bd6['shift']());}};_0x5b10a4(++_0x24fa08);}(_0xa128,0xa4));var _0x8a12=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xa128[_0x173441];return _0x2423a8;};'use strict';var EventEmitter=require(_0x8a12('0x0'));var SquareProject=require(_0x8a12('0x1'))['db'][_0x8a12('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x8a12('0x3')](0x0);var events={'afterCreate':_0x8a12('0x4'),'afterUpdate':_0x8a12('0x5'),'afterDestroy':_0x8a12('0x6')};function emitEvent(_0x3cac82){return function(_0x2cdbca,_0x3dff0a,_0x3c55be){SquareProjectEvents['emit'](_0x3cac82+':'+_0x2cdbca['id'],_0x2cdbca);SquareProjectEvents[_0x8a12('0x7')](_0x3cac82,_0x2cdbca);_0x3c55be(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x8a12('0x8')](e,emitEvent(event));}}module[_0x8a12('0x9')]=SquareProjectEvents;
\ No newline at end of file
index a0f0149..c4abd6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6e8=['savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareProject','square_projects','changed','preproduction'];(function(_0x5efb91,_0x39b378){var _0x57ff36=function(_0xb085ee){while(--_0xb085ee){_0x5efb91['push'](_0x5efb91['shift']());}};_0x57ff36(++_0x39b378);}(_0xa6e8,0x148));var _0x8a6e=function(_0xef03a5,_0x28c0df){_0xef03a5=_0xef03a5-0x0;var _0x4eae1f=_0xa6e8[_0xef03a5];return _0x4eae1f;};'use strict';var _=require('lodash');var util=require(_0x8a6e('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8a6e('0x1'));var rp=require(_0x8a6e('0x2'));var fs=require('fs');var path=require(_0x8a6e('0x3'));var rimraf=require(_0x8a6e('0x4'));var config=require(_0x8a6e('0x5'));var attributes=require('./squareProject.attributes');module[_0x8a6e('0x6')]=function(_0x403d3a,_0x1de782){return _0x403d3a[_0x8a6e('0x7')](_0x8a6e('0x8'),attributes,{'tableName':_0x8a6e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x551daa,_0x49b070,_0x560e34){if(_0x551daa[_0x8a6e('0xa')](_0x8a6e('0xb'))){_0x551daa[_0x8a6e('0xc')]=moment()[_0x8a6e('0xd')](_0x8a6e('0xe'));}if(_0x551daa[_0x8a6e('0xa')](_0x8a6e('0xf'))){_0x551daa[_0x8a6e('0x10')]=moment()[_0x8a6e('0xd')](_0x8a6e('0xe'));}_0x560e34(null,_0x551daa);}}});};
\ No newline at end of file
+var _0x7469=['path','rimraf','../../config/environment','./squareProject.attributes','exports','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','publishedAt','lodash','util','api','request-promise'];(function(_0x172948,_0x4262cc){var _0x4aeaa9=function(_0x5ec4b3){while(--_0x5ec4b3){_0x172948['push'](_0x172948['shift']());}};_0x4aeaa9(++_0x4262cc);}(_0x7469,0xfc));var _0x9746=function(_0x3051ee,_0x1e59f9){_0x3051ee=_0x3051ee-0x0;var _0x1de6f9=_0x7469[_0x3051ee];return _0x1de6f9;};'use strict';var _=require(_0x9746('0x0'));var util=require(_0x9746('0x1'));var logger=require('../../config/logger')(_0x9746('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9746('0x3'));var fs=require('fs');var path=require(_0x9746('0x4'));var rimraf=require(_0x9746('0x5'));var config=require(_0x9746('0x6'));var attributes=require(_0x9746('0x7'));module[_0x9746('0x8')]=function(_0x271f4e,_0x4535c5){return _0x271f4e['define']('SquareProject',attributes,{'tableName':_0x9746('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x18b0b8,_0x201bc6,_0x1cdeac){if(_0x18b0b8[_0x9746('0xa')](_0x9746('0xb'))){_0x18b0b8[_0x9746('0xc')]=moment()[_0x9746('0xd')](_0x9746('0xe'));}if(_0x18b0b8[_0x9746('0xa')]('production')){_0x18b0b8[_0x9746('0xf')]=moment()[_0x9746('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1cdeac(null,_0x18b0b8);}}});};
\ No newline at end of file
index 4fe134d..ab670d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb69=['then','debug','stringify','catch','error','message','ShowSquareProject','find','info','lodash','ioredis','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x9cabc6,_0x16fdd4){var _0x140e91=function(_0x4131e8){while(--_0x4131e8){_0x9cabc6['push'](_0x9cabc6['shift']());}};_0x140e91(++_0x16fdd4);}(_0xdb69,0x15e));var _0x9db6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xdb69[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x9db6('0x0'));var Redis=require(_0x9db6('0x1'));var db=require('../../mysqldb')['db'];var logger=require(_0x9db6('0x2'))(_0x9db6('0x3'));var config=require(_0x9db6('0x4'));config[_0x9db6('0x5')]=_[_0x9db6('0x6')](config[_0x9db6('0x5')],{'host':_0x9db6('0x7'),'port':0x18eb});var socket=require(_0x9db6('0x8'))(new Redis(config[_0x9db6('0x5')]));require(_0x9db6('0x9'))[_0x9db6('0xa')](socket);exports[_0x9db6('0xb')]=function(_0x1a16df){var _0x5411c3=this;return new Promise(function(_0x33d83c,_0x2b52b1){return db[_0x9db6('0xc')][_0x9db6('0xd')]({'raw':_0x1a16df[_0x9db6('0xe')]?_0x1a16df['options'][_0x9db6('0xf')]===undefined?!![]:![]:!![],'where':_0x1a16df[_0x9db6('0xe')]?_0x1a16df[_0x9db6('0xe')][_0x9db6('0x10')]||null:null,'attributes':_0x1a16df[_0x9db6('0xe')]?_0x1a16df[_0x9db6('0xe')][_0x9db6('0x11')]||null:null,'limit':_0x1a16df[_0x9db6('0xe')]?_0x1a16df[_0x9db6('0xe')][_0x9db6('0x12')]||null:null,'include':_0x1a16df['options']?_0x1a16df['options'][_0x9db6('0x13')]?_[_0x9db6('0x14')](_0x1a16df[_0x9db6('0xe')][_0x9db6('0x13')],function(_0x4fd354){return{'model':db[_0x4fd354[_0x9db6('0x15')]],'as':_0x4fd354['as'],'attributes':_0x4fd354['attributes'],'include':_0x4fd354[_0x9db6('0x13')]?_[_0x9db6('0x14')](_0x4fd354[_0x9db6('0x13')],function(_0x38e49d){return{'model':db[_0x38e49d[_0x9db6('0x15')]],'as':_0x38e49d['as'],'attributes':_0x38e49d[_0x9db6('0x11')],'include':_0x38e49d[_0x9db6('0x13')]?_[_0x9db6('0x14')](_0x38e49d[_0x9db6('0x13')],function(_0x38ab2d){return{'model':db[_0x38ab2d['model']],'as':_0x38ab2d['as'],'attributes':_0x38ab2d[_0x9db6('0x11')]};}):[]};}):[]};}):[]:[]})[_0x9db6('0x16')](function(_0x311d90){logger['info'](_0x9db6('0xb'),_0x1a16df);logger[_0x9db6('0x17')](_0x9db6('0xb'),_0x1a16df,JSON[_0x9db6('0x18')](_0x311d90));_0x33d83c(_0x311d90);})[_0x9db6('0x19')](function(_0x3b5d54){logger[_0x9db6('0x1a')](_0x9db6('0xb'),_0x3b5d54[_0x9db6('0x1b')],_0x1a16df);_0x2b52b1(_0x5411c3[_0x9db6('0x1a')](0x1f4,_0x3b5d54[_0x9db6('0x1b')]));});});};exports[_0x9db6('0x1c')]=function(_0x526c44){var _0x44d085=this;return new Promise(function(_0x3845a2,_0x267d4e){return db['SquareProject'][_0x9db6('0x1d')]({'raw':_0x526c44[_0x9db6('0xe')]?_0x526c44['options'][_0x9db6('0xf')]===undefined?!![]:![]:!![],'where':_0x526c44[_0x9db6('0xe')]?_0x526c44[_0x9db6('0xe')][_0x9db6('0x10')]||null:null,'attributes':_0x526c44['options']?_0x526c44[_0x9db6('0xe')]['attributes']||null:null,'include':_0x526c44[_0x9db6('0xe')]?_0x526c44['options']['include']?_[_0x9db6('0x14')](_0x526c44[_0x9db6('0xe')][_0x9db6('0x13')],function(_0x3b5bf2){return{'model':db[_0x3b5bf2[_0x9db6('0x15')]],'as':_0x3b5bf2['as'],'attributes':_0x3b5bf2['attributes'],'include':_0x3b5bf2['include']?_['map'](_0x3b5bf2[_0x9db6('0x13')],function(_0x2475cc){return{'model':db[_0x2475cc[_0x9db6('0x15')]],'as':_0x2475cc['as'],'attributes':_0x2475cc[_0x9db6('0x11')],'include':_0x2475cc[_0x9db6('0x13')]?_['map'](_0x2475cc['include'],function(_0x2a3e0b){return{'model':db[_0x2a3e0b[_0x9db6('0x15')]],'as':_0x2a3e0b['as'],'attributes':_0x2a3e0b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3618ec){logger[_0x9db6('0x1e')](_0x9db6('0x1c'),_0x526c44);logger[_0x9db6('0x17')](_0x9db6('0x1c'),_0x526c44,JSON[_0x9db6('0x18')](_0x3618ec));_0x3845a2(_0x3618ec);})[_0x9db6('0x19')](function(_0x24a06b){logger[_0x9db6('0x1a')]('ShowSquareProject',_0x24a06b[_0x9db6('0x1b')],_0x526c44);_0x267d4e(_0x44d085[_0x9db6('0x1a')](0x1f4,_0x24a06b[_0x9db6('0x1b')]));});});};
\ No newline at end of file
+var _0xa2b4=['rpc','../../config/environment','defaults','redis','socket.io-emitter','./squareProject.socket','SquareProject','findAll','options','raw','attributes','limit','include','map','model','then','info','GetSquareProjects','stringify','error','message','ShowSquareProject','find','where','debug','lodash','ioredis','../../mysqldb'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xa2b4,0x14d));var _0x4a2b=function(_0x29ac16,_0x4b230a){_0x29ac16=_0x29ac16-0x0;var _0x382158=_0xa2b4[_0x29ac16];return _0x382158;};'use strict';var _=require(_0x4a2b('0x0'));var Redis=require(_0x4a2b('0x1'));var db=require(_0x4a2b('0x2'))['db'];var logger=require('../../config/logger')(_0x4a2b('0x3'));var config=require(_0x4a2b('0x4'));config['redis']=_[_0x4a2b('0x5')](config[_0x4a2b('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x4a2b('0x7'))(new Redis(config[_0x4a2b('0x6')]));require(_0x4a2b('0x8'))['register'](socket);exports['GetSquareProjects']=function(_0x1d2be6){var _0x3b8a78=this;return new Promise(function(_0x2cc958,_0x9f980){return db[_0x4a2b('0x9')][_0x4a2b('0xa')]({'raw':_0x1d2be6['options']?_0x1d2be6[_0x4a2b('0xb')][_0x4a2b('0xc')]===undefined?!![]:![]:!![],'where':_0x1d2be6[_0x4a2b('0xb')]?_0x1d2be6[_0x4a2b('0xb')]['where']||null:null,'attributes':_0x1d2be6[_0x4a2b('0xb')]?_0x1d2be6[_0x4a2b('0xb')][_0x4a2b('0xd')]||null:null,'limit':_0x1d2be6['options']?_0x1d2be6['options'][_0x4a2b('0xe')]||null:null,'include':_0x1d2be6[_0x4a2b('0xb')]?_0x1d2be6[_0x4a2b('0xb')][_0x4a2b('0xf')]?_[_0x4a2b('0x10')](_0x1d2be6['options'][_0x4a2b('0xf')],function(_0x2bd18e){return{'model':db[_0x2bd18e[_0x4a2b('0x11')]],'as':_0x2bd18e['as'],'attributes':_0x2bd18e['attributes'],'include':_0x2bd18e[_0x4a2b('0xf')]?_[_0x4a2b('0x10')](_0x2bd18e['include'],function(_0x1d7846){return{'model':db[_0x1d7846[_0x4a2b('0x11')]],'as':_0x1d7846['as'],'attributes':_0x1d7846['attributes'],'include':_0x1d7846[_0x4a2b('0xf')]?_[_0x4a2b('0x10')](_0x1d7846[_0x4a2b('0xf')],function(_0x10bd1d){return{'model':db[_0x10bd1d[_0x4a2b('0x11')]],'as':_0x10bd1d['as'],'attributes':_0x10bd1d[_0x4a2b('0xd')]};}):[]};}):[]};}):[]:[]})[_0x4a2b('0x12')](function(_0x1dac1a){logger[_0x4a2b('0x13')](_0x4a2b('0x14'),_0x1d2be6);logger['debug']('GetSquareProjects',_0x1d2be6,JSON[_0x4a2b('0x15')](_0x1dac1a));_0x2cc958(_0x1dac1a);})['catch'](function(_0x3c54b1){logger[_0x4a2b('0x16')](_0x4a2b('0x14'),_0x3c54b1[_0x4a2b('0x17')],_0x1d2be6);_0x9f980(_0x3b8a78['error'](0x1f4,_0x3c54b1[_0x4a2b('0x17')]));});});};exports[_0x4a2b('0x18')]=function(_0x2f4bc2){var _0x4c9c4c=this;return new Promise(function(_0x2a2697,_0xa22ad){return db[_0x4a2b('0x9')][_0x4a2b('0x19')]({'raw':_0x2f4bc2[_0x4a2b('0xb')]?_0x2f4bc2[_0x4a2b('0xb')][_0x4a2b('0xc')]===undefined?!![]:![]:!![],'where':_0x2f4bc2[_0x4a2b('0xb')]?_0x2f4bc2[_0x4a2b('0xb')][_0x4a2b('0x1a')]||null:null,'attributes':_0x2f4bc2[_0x4a2b('0xb')]?_0x2f4bc2['options'][_0x4a2b('0xd')]||null:null,'include':_0x2f4bc2[_0x4a2b('0xb')]?_0x2f4bc2[_0x4a2b('0xb')][_0x4a2b('0xf')]?_[_0x4a2b('0x10')](_0x2f4bc2[_0x4a2b('0xb')]['include'],function(_0x32aba6){return{'model':db[_0x32aba6[_0x4a2b('0x11')]],'as':_0x32aba6['as'],'attributes':_0x32aba6[_0x4a2b('0xd')],'include':_0x32aba6[_0x4a2b('0xf')]?_['map'](_0x32aba6[_0x4a2b('0xf')],function(_0x5ff325){return{'model':db[_0x5ff325['model']],'as':_0x5ff325['as'],'attributes':_0x5ff325[_0x4a2b('0xd')],'include':_0x5ff325['include']?_[_0x4a2b('0x10')](_0x5ff325[_0x4a2b('0xf')],function(_0x26f404){return{'model':db[_0x26f404['model']],'as':_0x26f404['as'],'attributes':_0x26f404[_0x4a2b('0xd')]};}):[]};}):[]};}):[]:[]})[_0x4a2b('0x12')](function(_0xcba9ed){logger[_0x4a2b('0x13')](_0x4a2b('0x18'),_0x2f4bc2);logger[_0x4a2b('0x1b')]('ShowSquareProject',_0x2f4bc2,JSON[_0x4a2b('0x15')](_0xcba9ed));_0x2a2697(_0xcba9ed);})['catch'](function(_0x47be9a){logger[_0x4a2b('0x16')]('ShowSquareProject',_0x47be9a[_0x4a2b('0x17')],_0x2f4bc2);_0xa22ad(_0x4c9c4c[_0x4a2b('0x16')](0x1f4,_0x47be9a[_0x4a2b('0x17')]));});});};
\ No newline at end of file
index 2052e2e..3087704 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3186=['emit','removeListener','length','squareProject:','save','remove','update'];(function(_0x16dbfd,_0x2f9431){var _0x382254=function(_0x19dade){while(--_0x19dade){_0x16dbfd['push'](_0x16dbfd['shift']());}};_0x382254(++_0x2f9431);}(_0x3186,0x1d2));var _0x6318=function(_0x4081e9,_0x157feb){_0x4081e9=_0x4081e9-0x0;var _0x35cf25=_0x3186[_0x4081e9];return _0x35cf25;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x6318('0x0'),_0x6318('0x1'),_0x6318('0x2')];function createListener(_0x237480,_0x17242d){return function(_0x4ab73b){_0x17242d[_0x6318('0x3')](_0x237480,_0x4ab73b);};}function removeListener(_0x51b5f6,_0x124a19){return function(){SquareProjectEvents[_0x6318('0x4')](_0x51b5f6,_0x124a19);};}exports['register']=function(_0x20f4bc){for(var _0x75e0aa=0x0,_0x458abc=events[_0x6318('0x5')];_0x75e0aa<_0x458abc;_0x75e0aa++){var _0x5450f0=events[_0x75e0aa];var _0x560fb7=createListener(_0x6318('0x6')+_0x5450f0,_0x20f4bc);SquareProjectEvents['on'](_0x5450f0,_0x560fb7);}};
\ No newline at end of file
+var _0x6e0a=['register','length','squareProject:','save','remove','update','emit','removeListener'];(function(_0x251cdf,_0x58037e){var _0x1263c4=function(_0x115cb4){while(--_0x115cb4){_0x251cdf['push'](_0x251cdf['shift']());}};_0x1263c4(++_0x58037e);}(_0x6e0a,0x1cb));var _0xa6e0=function(_0x1f7fb2,_0x116309){_0x1f7fb2=_0x1f7fb2-0x0;var _0x61fc27=_0x6e0a[_0x1f7fb2];return _0x61fc27;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0xa6e0('0x0'),_0xa6e0('0x1'),_0xa6e0('0x2')];function createListener(_0x5a18ac,_0x1f3d9a){return function(_0x1fa056){_0x1f3d9a[_0xa6e0('0x3')](_0x5a18ac,_0x1fa056);};}function removeListener(_0x57ae71,_0x2fad67){return function(){SquareProjectEvents[_0xa6e0('0x4')](_0x57ae71,_0x2fad67);};}exports[_0xa6e0('0x5')]=function(_0x47ac66){for(var _0xaee08e=0x0,_0x1e4548=events[_0xa6e0('0x6')];_0xaee08e<_0x1e4548;_0xaee08e++){var _0x40acbf=events[_0xaee08e];var _0x308f9c=createListener(_0xa6e0('0x7')+_0x40acbf,_0x47ac66);SquareProjectEvents['on'](_0x40acbf,_0x308f9c);}};
\ No newline at end of file
index 6bbda82..5559594 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports'];(function(_0x5e39b8,_0xa78ee4){var _0x32970a=function(_0x435459){while(--_0x435459){_0x5e39b8['push'](_0x5e39b8['shift']());}};_0x32970a(++_0xa78ee4);}(_0x814b,0x1a2));var _0xb814=function(_0x6148ee,_0x4d2fca){_0x6148ee=_0x6148ee-0x0;var _0x5afc74=_0x814b[_0x6148ee];return _0x5afc74;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0x10')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xc'),auth[_0xb814('0xb')](),controller['update']);router[_0xb814('0x13')]('/:id',auth[_0xb814('0xb')](),controller[_0xb814('0x14')]);module[_0xb814('0x15')]=router;
\ No newline at end of file
+var _0x1261=['isAuthenticated','show','/:id/download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','index','get'];(function(_0x5a7116,_0x373c79){var _0x1e2f1b=function(_0x7d9c7a){while(--_0x7d9c7a){_0x5a7116['push'](_0x5a7116['shift']());}};_0x1e2f1b(++_0x373c79);}(_0x1261,0x144));var _0x1126=function(_0x41d2d4,_0x12bcf4){_0x41d2d4=_0x41d2d4-0x0;var _0x225e0f=_0x1261[_0x41d2d4];return _0x225e0f;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['download']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x12')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x13')]);module[_0x1126('0x14')]=router;
\ No newline at end of file
index 705312b..b8efe5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bd8=['STRING','VIRTUAL','getDataValue','substring','sequelize'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x2bd8,0x130));var _0x82bd=function(_0x1078b1,_0x20c470){_0x1078b1=_0x1078b1-0x0;var _0x3eef3a=_0x2bd8[_0x1078b1];return _0x3eef3a;};'use strict';var Sequelize=require(_0x82bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x82bd('0x1')]},'callerid':{'type':Sequelize[_0x82bd('0x1')]},'calleridname':{'type':Sequelize[_0x82bd('0x1')]},'context':{'type':Sequelize[_0x82bd('0x1')]},'extension':{'type':Sequelize[_0x82bd('0x1')]},'priority':{'type':Sequelize[_0x82bd('0x1')]},'accountcode':{'type':Sequelize[_0x82bd('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x82bd('0x1')]},'saveName':{'type':Sequelize[_0x82bd('0x1')]},'filename':{'type':Sequelize[_0x82bd('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x82bd('0x2')],'get':function(){var _0x77d7a9='';var _0x226f60=this[_0x82bd('0x3')]('savePath');if(_0x226f60){_0x77d7a9=_0x226f60[_0x82bd('0x4')](_0x226f60['lastIndexOf']('.'));}return _0x77d7a9;}}};
\ No newline at end of file
+var _0xeec6=['sequelize','exports','STRING','getDataValue','savePath','lastIndexOf'];(function(_0xb0358c,_0x3e40c9){var _0x583f13=function(_0x5288a7){while(--_0x5288a7){_0xb0358c['push'](_0xb0358c['shift']());}};_0x583f13(++_0x3e40c9);}(_0xeec6,0x1c2));var _0x6eec=function(_0x50af9c,_0xf03b1e){_0x50af9c=_0x50af9c-0x0;var _0x5b5e5a=_0xeec6[_0x50af9c];return _0x5b5e5a;};'use strict';var Sequelize=require(_0x6eec('0x0'));module[_0x6eec('0x1')]={'uniqueid':{'type':Sequelize[_0x6eec('0x2')]},'callerid':{'type':Sequelize[_0x6eec('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6eec('0x2')]},'extension':{'type':Sequelize[_0x6eec('0x2')]},'priority':{'type':Sequelize[_0x6eec('0x2')]},'accountcode':{'type':Sequelize[_0x6eec('0x2')]},'dnid':{'type':Sequelize[_0x6eec('0x2')]},'projectName':{'type':Sequelize[_0x6eec('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x6eec('0x2')]},'savePath':{'type':Sequelize[_0x6eec('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x5a5e47='';var _0x1c810e=this[_0x6eec('0x3')](_0x6eec('0x4'));if(_0x1c810e){_0x5a5e47=_0x1c810e['substring'](_0x1c810e[_0x6eec('0x5')]('.'));}return _0x5a5e47;}}};
\ No newline at end of file
index baf7212..d1172d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc38=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','update','then','destroy','stack','name','send','map','SquareRecording','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','uniqueid','savePath','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','filename','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xcc38,0x126));var _0x8cc3=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xcc38[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x8cc3('0x0'));var rimraf=require(_0x8cc3('0x1'));var zipdir=require(_0x8cc3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8cc3('0x3'));var moment=require(_0x8cc3('0x4'));var BPromise=require(_0x8cc3('0x5'));var Mustache=require('mustache');var util=require(_0x8cc3('0x6'));var path=require(_0x8cc3('0x7'));var sox=require(_0x8cc3('0x8'));var csv=require(_0x8cc3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8cc3('0xa'));var _=require(_0x8cc3('0xb'));var squel=require(_0x8cc3('0xc'));var crypto=require(_0x8cc3('0xd'));var jsforce=require(_0x8cc3('0xe'));var deskjs=require(_0x8cc3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8cc3('0x10'));var Papa=require(_0x8cc3('0x11'));var Redis=require(_0x8cc3('0x12'));var authService=require(_0x8cc3('0x13'));var qs=require(_0x8cc3('0x14'));var as=require(_0x8cc3('0x15'));var hardwareService=require(_0x8cc3('0x16'));var logger=require(_0x8cc3('0x17'))(_0x8cc3('0x18'));var utils=require('../../config/utils');var config=require(_0x8cc3('0x19'));var licenseUtil=require(_0x8cc3('0x1a'));var db=require(_0x8cc3('0x1b'))['db'];function respondWithStatusCode(_0x59eeab,_0x48e0c9){_0x48e0c9=_0x48e0c9||0xcc;return function(_0x42c9d7){if(_0x42c9d7){return _0x59eeab[_0x8cc3('0x1c')](_0x48e0c9);}return _0x59eeab[_0x8cc3('0x1d')](_0x48e0c9)[_0x8cc3('0x1e')]();};}function respondWithResult(_0x494cfe,_0x44704a){_0x44704a=_0x44704a||0xc8;return function(_0x412b8a){if(_0x412b8a){return _0x494cfe[_0x8cc3('0x1d')](_0x44704a)[_0x8cc3('0x1f')](_0x412b8a);}};}function respondWithFilteredResult(_0x4fadd3,_0xe1d8c8){return function(_0x12f63f){if(_0x12f63f){var _0x17c3a0=typeof _0xe1d8c8['offset']===_0x8cc3('0x20')&&typeof _0xe1d8c8['limit']===_0x8cc3('0x20');var _0x52b458=_0x12f63f['count'];var _0x56f885=_0x17c3a0?0x0:_0xe1d8c8[_0x8cc3('0x21')];var _0x2e9dfb=_0x17c3a0?_0x12f63f[_0x8cc3('0x22')]:_0xe1d8c8[_0x8cc3('0x21')]+_0xe1d8c8[_0x8cc3('0x23')];var _0x2c62ed;if(_0x2e9dfb>=_0x52b458){_0x2e9dfb=_0x52b458;_0x2c62ed=0xc8;}else{_0x2c62ed=0xce;}_0x4fadd3[_0x8cc3('0x1d')](_0x2c62ed);return _0x4fadd3[_0x8cc3('0x24')](_0x8cc3('0x25'),_0x56f885+'-'+_0x2e9dfb+'/'+_0x52b458)[_0x8cc3('0x1f')](_0x12f63f);}return null;};}function patchUpdates(_0x9934b){return function(_0x45b6f5){try{jsonpatch[_0x8cc3('0x26')](_0x45b6f5,_0x9934b,!![]);}catch(_0x4a0bf8){return BPromise['reject'](_0x4a0bf8);}return _0x45b6f5['save']();};}function saveUpdates(_0x1e53c3,_0x4aba3d){return function(_0x559e48){if(_0x559e48){return _0x559e48[_0x8cc3('0x27')](_0x1e53c3)[_0x8cc3('0x28')](function(_0x22eed3){return _0x22eed3;});}return null;};}function removeEntity(_0x16433b,_0x109b4f){return function(_0x43511f){if(_0x43511f){return _0x43511f[_0x8cc3('0x29')]()[_0x8cc3('0x28')](function(){_0x16433b[_0x8cc3('0x1d')](0xcc)[_0x8cc3('0x1e')]();});}};}function handleEntityNotFound(_0x51a328,_0x4d8127){return function(_0x28c249){if(!_0x28c249){_0x51a328[_0x8cc3('0x1c')](0x194);}return _0x28c249;};}function handleError(_0x286f92,_0x366654){_0x366654=_0x366654||0x1f4;return function(_0x1f4ed2){logger['error'](_0x1f4ed2[_0x8cc3('0x2a')]);if(_0x1f4ed2['name']){delete _0x1f4ed2[_0x8cc3('0x2b')];}_0x286f92['status'](_0x366654)[_0x8cc3('0x2c')](_0x1f4ed2);};}exports['index']=function(_0x2bed73,_0x81633f){var _0x3556ff={},_0x387039={},_0x1d567d={'count':0x0,'rows':[]};var _0xda3c7=_[_0x8cc3('0x2d')](db[_0x8cc3('0x2e')][_0x8cc3('0x2f')],function(_0x559b56){return{'name':_0x559b56[_0x8cc3('0x30')],'type':_0x559b56[_0x8cc3('0x31')][_0x8cc3('0x32')]};});_0x387039['model']=_[_0x8cc3('0x2d')](_0xda3c7,_0x8cc3('0x2b'));_0x387039[_0x8cc3('0x33')]=_[_0x8cc3('0x34')](_0x2bed73[_0x8cc3('0x33')]);_0x387039[_0x8cc3('0x35')]=_['intersection'](_0x387039[_0x8cc3('0x36')],_0x387039[_0x8cc3('0x33')]);_0x3556ff[_0x8cc3('0x37')]=_[_0x8cc3('0x38')](_0x387039[_0x8cc3('0x36')],qs[_0x8cc3('0x39')](_0x2bed73[_0x8cc3('0x33')][_0x8cc3('0x39')]));_0x3556ff[_0x8cc3('0x37')]=_0x3556ff[_0x8cc3('0x37')]['length']?_0x3556ff[_0x8cc3('0x37')]:_0x387039['model'];if(!_0x2bed73[_0x8cc3('0x33')][_0x8cc3('0x3a')]('nolimit')){_0x3556ff['limit']=qs['limit'](_0x2bed73[_0x8cc3('0x33')][_0x8cc3('0x23')]);_0x3556ff['offset']=qs[_0x8cc3('0x21')](_0x2bed73[_0x8cc3('0x33')][_0x8cc3('0x21')]);}_0x3556ff[_0x8cc3('0x3b')]=qs['sort'](_0x2bed73['query']['sort']);_0x3556ff[_0x8cc3('0x3c')]=qs['filters'](_[_0x8cc3('0x3d')](_0x2bed73[_0x8cc3('0x33')],_0x387039[_0x8cc3('0x35')]),_0xda3c7);if(_0x2bed73['query'][_0x8cc3('0x3e')]){_0x3556ff[_0x8cc3('0x3c')]=_[_0x8cc3('0x3f')](_0x3556ff[_0x8cc3('0x3c')],{'$or':_[_0x8cc3('0x2d')](_0xda3c7,function(_0xe3c6a9){if(_0xe3c6a9['type']!==_0x8cc3('0x40')){var _0x2c4b7d={};_0x2c4b7d[_0xe3c6a9[_0x8cc3('0x2b')]]={'$like':'%'+_0x2bed73[_0x8cc3('0x33')][_0x8cc3('0x3e')]+'%'};return _0x2c4b7d;}})});}_0x3556ff=_[_0x8cc3('0x3f')]({},_0x3556ff,_0x2bed73['options']);var _0x5a7a1a={'where':_0x3556ff[_0x8cc3('0x3c')]};return db['SquareRecording'][_0x8cc3('0x22')](_0x5a7a1a)[_0x8cc3('0x28')](function(_0x51c205){_0x1d567d['count']=_0x51c205;if(_0x2bed73['query'][_0x8cc3('0x41')]){_0x3556ff[_0x8cc3('0x42')]=[{'all':!![]}];}return db[_0x8cc3('0x2e')][_0x8cc3('0x43')](_0x3556ff);})['then'](function(_0x120193){_0x1d567d[_0x8cc3('0x44')]=_0x120193;return _0x1d567d;})[_0x8cc3('0x28')](respondWithFilteredResult(_0x81633f,_0x3556ff))[_0x8cc3('0x45')](handleError(_0x81633f,null));};exports[_0x8cc3('0x46')]=function(_0x3d4426,_0x2ee181){var _0x5946c7={'raw':!![],'where':{'id':_0x3d4426[_0x8cc3('0x47')]['id']}},_0x4346f1={};_0x4346f1[_0x8cc3('0x36')]=_['keys'](db[_0x8cc3('0x2e')]['rawAttributes']);_0x4346f1['query']=_[_0x8cc3('0x34')](_0x3d4426['query']);_0x4346f1['filters']=_['intersection'](_0x4346f1[_0x8cc3('0x36')],_0x4346f1[_0x8cc3('0x33')]);_0x5946c7['attributes']=_[_0x8cc3('0x38')](_0x4346f1['model'],qs['fields'](_0x3d4426[_0x8cc3('0x33')][_0x8cc3('0x39')]));_0x5946c7[_0x8cc3('0x37')]=_0x5946c7[_0x8cc3('0x37')][_0x8cc3('0x48')]?_0x5946c7['attributes']:_0x4346f1[_0x8cc3('0x36')];if(_0x3d4426[_0x8cc3('0x33')][_0x8cc3('0x41')]){_0x5946c7[_0x8cc3('0x42')]=[{'all':!![]}];}_0x5946c7=_['merge']({},_0x5946c7,_0x3d4426[_0x8cc3('0x49')]);return db['SquareRecording'][_0x8cc3('0x4a')](_0x5946c7)[_0x8cc3('0x28')](handleEntityNotFound(_0x2ee181,null))[_0x8cc3('0x28')](respondWithResult(_0x2ee181,null))[_0x8cc3('0x45')](handleError(_0x2ee181,null));};exports[_0x8cc3('0x4b')]=function(_0x2f31a5,_0x15ddff){return db[_0x8cc3('0x2e')][_0x8cc3('0x4b')](_0x2f31a5[_0x8cc3('0x4c')],{})['then'](respondWithResult(_0x15ddff,0xc9))['catch'](handleError(_0x15ddff,null));};exports[_0x8cc3('0x27')]=function(_0x543631,_0x222c58){if(_0x543631[_0x8cc3('0x4c')]['id']){delete _0x543631[_0x8cc3('0x4c')]['id'];}return db[_0x8cc3('0x2e')][_0x8cc3('0x4a')]({'where':{'id':_0x543631[_0x8cc3('0x47')]['id']}})['then'](handleEntityNotFound(_0x222c58,null))[_0x8cc3('0x28')](saveUpdates(_0x543631[_0x8cc3('0x4c')],null))['then'](respondWithResult(_0x222c58,null))[_0x8cc3('0x45')](handleError(_0x222c58,null));};exports['download']=function(_0x2542c7,_0x55ddeb,_0x2d24bf){var _0x24273c=require('../../components/encryptor');var _0x2eff56=![];var _0xab2ce0={};if(_0x2542c7['query']['type']&&_0x2542c7[_0x8cc3('0x33')][_0x8cc3('0x31')]===_0x8cc3('0x4d')){_0xab2ce0['uniqueid']=_0x2542c7[_0x8cc3('0x47')]['id'];}else{_0xab2ce0['id']=_0x2542c7[_0x8cc3('0x47')]['id'];}return db[_0x8cc3('0x2e')][_0x8cc3('0x4a')]({'where':_0xab2ce0,'attributes':['id',_0x8cc3('0x4e'),'filename'],'raw':!![]})[_0x8cc3('0x28')](handleEntityNotFound(_0x55ddeb,null))[_0x8cc3('0x28')](function(_0x19aaac){if(_0x19aaac){var _0x43d8a9=_0x19aaac[_0x8cc3('0x4e')];var _0x4c7603=util['format'](_0x8cc3('0x4f'),_0x43d8a9);if(fs[_0x8cc3('0x50')](_0x4c7603)){_0x2eff56=!![];return _0x24273c[_0x8cc3('0x51')](_0x4c7603,_0x43d8a9,config[_0x8cc3('0x52')]['recording'])[_0x8cc3('0x28')](function(){return _0x19aaac;});}return _0x19aaac;}})['then'](function(_0x5249b8){if(_0x5249b8){var _0x377535=_0x5249b8[_0x8cc3('0x4e')];if(!fs[_0x8cc3('0x50')](_0x377535)){throw new db[(_0x8cc3('0x53'))][(_0x8cc3('0x54'))](_0x8cc3('0x55'));}if(_0x5249b8['filename']){return _0x55ddeb[_0x8cc3('0x56')](_0x377535,_0x5249b8[_0x8cc3('0x57')]+path[_0x8cc3('0x58')](_0x377535),function(){if(_0x2eff56){fs[_0x8cc3('0x59')](_0x377535);}});}else{return _0x55ddeb[_0x8cc3('0x56')](_0x377535,function(_0x22fcd4){if(_0x2eff56){fs[_0x8cc3('0x59')](_0x377535);}});}}})[_0x8cc3('0x45')](function(_0x35d4d3){if(_0x35d4d3[_0x8cc3('0x5a')]===_0x8cc3('0x55')){_0x55ddeb[_0x8cc3('0x1d')](0x194)[_0x8cc3('0x2c')](_0x8cc3('0x5b'));}else{return handleError(_0x55ddeb,null);}});};exports[_0x8cc3('0x29')]=function(_0x3207f1,_0x4e4729){return db[_0x8cc3('0x2e')][_0x8cc3('0x4a')]({'where':{'id':_0x3207f1[_0x8cc3('0x47')]['id']}})[_0x8cc3('0x28')](function(_0x3d9bff){if(_[_0x8cc3('0x5c')](_0x3d9bff)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3d9bff;})[_0x8cc3('0x28')](function(_0x166987){var _0x3913db=_0x166987[_0x8cc3('0x4e')];logger[_0x8cc3('0x5d')](_0x8cc3('0x5e'),_0x3913db);if(!_[_0x8cc3('0x5c')](_0x166987[_0x8cc3('0x4e')])&&fs[_0x8cc3('0x50')](_0x3913db)){logger['info'](_0x8cc3('0x5f')+_0x3913db+_0x8cc3('0x60'));fs['unlinkSync'](_0x3913db);}_0x3913db=_0x3913db+'.cypher';if(!_[_0x8cc3('0x5c')](_0x166987[_0x8cc3('0x4e')])&&fs[_0x8cc3('0x50')](_0x3913db)){logger['info'](_0x8cc3('0x5f')+_0x3913db+_0x8cc3('0x60'));fs[_0x8cc3('0x61')](_0x3913db);}return _0x166987;})[_0x8cc3('0x28')](function(_0x52a9aa){if(!_0x52a9aa)throw new InternalError();return _0x52a9aa['destroy']();})[_0x8cc3('0x28')](function(){_0x4e4729[_0x8cc3('0x1d')](0xcc)[_0x8cc3('0x1e')]();})[_0x8cc3('0x45')](handleError(_0x4e4729,null));};
\ No newline at end of file
+var _0x54fd=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','includeAll','find','create','body','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','SquareRecording\x20not\x20found','download','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x3f9ac2,_0x1b670b){var _0xe6a436=function(_0x1f3ea5){while(--_0x1f3ea5){_0x3f9ac2['push'](_0x3f9ac2['shift']());}};_0xe6a436(++_0x1b670b);}(_0x54fd,0x16a));var _0xd54f=function(_0x5d0adf,_0x4122fd){_0x5d0adf=_0x5d0adf-0x0;var _0x32329e=_0x54fd[_0x5d0adf];return _0x32329e;};'use strict';var emlformat=require(_0xd54f('0x0'));var rimraf=require(_0xd54f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd54f('0x2'));var BPromise=require(_0xd54f('0x3'));var Mustache=require('mustache');var util=require(_0xd54f('0x4'));var path=require(_0xd54f('0x5'));var sox=require(_0xd54f('0x6'));var csv=require('to-csv');var ejs=require(_0xd54f('0x7'));var fs=require('fs');var fs_extra=require(_0xd54f('0x8'));var _=require(_0xd54f('0x9'));var squel=require(_0xd54f('0xa'));var crypto=require(_0xd54f('0xb'));var jsforce=require(_0xd54f('0xc'));var deskjs=require(_0xd54f('0xd'));var toCsv=require(_0xd54f('0xe'));var querystring=require(_0xd54f('0xf'));var Papa=require(_0xd54f('0x10'));var Redis=require(_0xd54f('0x11'));var authService=require(_0xd54f('0x12'));var qs=require(_0xd54f('0x13'));var as=require(_0xd54f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd54f('0x15'))(_0xd54f('0x16'));var utils=require(_0xd54f('0x17'));var config=require(_0xd54f('0x18'));var licenseUtil=require(_0xd54f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4edd67,_0x46ee02){_0x46ee02=_0x46ee02||0xcc;return function(_0x4e2bb7){if(_0x4e2bb7){return _0x4edd67[_0xd54f('0x1a')](_0x46ee02);}return _0x4edd67[_0xd54f('0x1b')](_0x46ee02)[_0xd54f('0x1c')]();};}function respondWithResult(_0x161ead,_0x577546){_0x577546=_0x577546||0xc8;return function(_0x524c74){if(_0x524c74){return _0x161ead['status'](_0x577546)[_0xd54f('0x1d')](_0x524c74);}};}function respondWithFilteredResult(_0x1e8d62,_0xb3c50b){return function(_0x487cbf){if(_0x487cbf){var _0xe11798=typeof _0xb3c50b[_0xd54f('0x1e')]===_0xd54f('0x1f')&&typeof _0xb3c50b[_0xd54f('0x20')]===_0xd54f('0x1f');var _0x3f0eea=_0x487cbf[_0xd54f('0x21')];var _0x5cdf59=_0xe11798?0x0:_0xb3c50b['offset'];var _0x566063=_0xe11798?_0x487cbf[_0xd54f('0x21')]:_0xb3c50b[_0xd54f('0x1e')]+_0xb3c50b[_0xd54f('0x20')];var _0x4d7430;if(_0x566063>=_0x3f0eea){_0x566063=_0x3f0eea;_0x4d7430=0xc8;}else{_0x4d7430=0xce;}_0x1e8d62[_0xd54f('0x1b')](_0x4d7430);return _0x1e8d62['set'](_0xd54f('0x22'),_0x5cdf59+'-'+_0x566063+'/'+_0x3f0eea)[_0xd54f('0x1d')](_0x487cbf);}return null;};}function patchUpdates(_0x4ed831){return function(_0x1f909f){try{jsonpatch[_0xd54f('0x23')](_0x1f909f,_0x4ed831,!![]);}catch(_0x450822){return BPromise['reject'](_0x450822);}return _0x1f909f[_0xd54f('0x24')]();};}function saveUpdates(_0x193d5d,_0x37512a){return function(_0x512e47){if(_0x512e47){return _0x512e47[_0xd54f('0x25')](_0x193d5d)[_0xd54f('0x26')](function(_0x21629e){return _0x21629e;});}return null;};}function removeEntity(_0xa7db44,_0x2d3ec9){return function(_0x15b2bc){if(_0x15b2bc){return _0x15b2bc[_0xd54f('0x27')]()[_0xd54f('0x26')](function(){_0xa7db44[_0xd54f('0x1b')](0xcc)[_0xd54f('0x1c')]();});}};}function handleEntityNotFound(_0x3e14bd,_0x10da47){return function(_0x347fc5){if(!_0x347fc5){_0x3e14bd[_0xd54f('0x1a')](0x194);}return _0x347fc5;};}function handleError(_0x34fa34,_0x1f4825){_0x1f4825=_0x1f4825||0x1f4;return function(_0x5a102b){logger[_0xd54f('0x28')](_0x5a102b[_0xd54f('0x29')]);if(_0x5a102b[_0xd54f('0x2a')]){delete _0x5a102b['name'];}_0x34fa34['status'](_0x1f4825)[_0xd54f('0x2b')](_0x5a102b);};}exports['index']=function(_0x3abb5f,_0x37b7b0){var _0x4a6480={},_0x1df651={},_0x2094e1={'count':0x0,'rows':[]};var _0x53ec1c=_[_0xd54f('0x2c')](db[_0xd54f('0x2d')][_0xd54f('0x2e')],function(_0x2e9bd0){return{'name':_0x2e9bd0[_0xd54f('0x2f')],'type':_0x2e9bd0[_0xd54f('0x30')][_0xd54f('0x31')]};});_0x1df651[_0xd54f('0x32')]=_[_0xd54f('0x2c')](_0x53ec1c,_0xd54f('0x2a'));_0x1df651[_0xd54f('0x33')]=_[_0xd54f('0x34')](_0x3abb5f[_0xd54f('0x33')]);_0x1df651[_0xd54f('0x35')]=_['intersection'](_0x1df651[_0xd54f('0x32')],_0x1df651[_0xd54f('0x33')]);_0x4a6480[_0xd54f('0x36')]=_[_0xd54f('0x37')](_0x1df651[_0xd54f('0x32')],qs[_0xd54f('0x38')](_0x3abb5f[_0xd54f('0x33')]['fields']));_0x4a6480[_0xd54f('0x36')]=_0x4a6480[_0xd54f('0x36')][_0xd54f('0x39')]?_0x4a6480[_0xd54f('0x36')]:_0x1df651['model'];if(!_0x3abb5f[_0xd54f('0x33')][_0xd54f('0x3a')](_0xd54f('0x3b'))){_0x4a6480[_0xd54f('0x20')]=qs[_0xd54f('0x20')](_0x3abb5f[_0xd54f('0x33')][_0xd54f('0x20')]);_0x4a6480[_0xd54f('0x1e')]=qs['offset'](_0x3abb5f[_0xd54f('0x33')][_0xd54f('0x1e')]);}_0x4a6480['order']=qs[_0xd54f('0x3c')](_0x3abb5f['query']['sort']);_0x4a6480[_0xd54f('0x3d')]=qs[_0xd54f('0x35')](_[_0xd54f('0x3e')](_0x3abb5f[_0xd54f('0x33')],_0x1df651[_0xd54f('0x35')]),_0x53ec1c);if(_0x3abb5f[_0xd54f('0x33')][_0xd54f('0x3f')]){_0x4a6480[_0xd54f('0x3d')]=_[_0xd54f('0x40')](_0x4a6480[_0xd54f('0x3d')],{'$or':_[_0xd54f('0x2c')](_0x53ec1c,function(_0x313f1d){if(_0x313f1d['type']!=='VIRTUAL'){var _0x54eabb={};_0x54eabb[_0x313f1d[_0xd54f('0x2a')]]={'$like':'%'+_0x3abb5f[_0xd54f('0x33')][_0xd54f('0x3f')]+'%'};return _0x54eabb;}})});}_0x4a6480=_[_0xd54f('0x40')]({},_0x4a6480,_0x3abb5f['options']);var _0x4f3242={'where':_0x4a6480[_0xd54f('0x3d')]};return db[_0xd54f('0x2d')]['count'](_0x4f3242)[_0xd54f('0x26')](function(_0x408d2e){_0x2094e1['count']=_0x408d2e;if(_0x3abb5f[_0xd54f('0x33')]['includeAll']){_0x4a6480[_0xd54f('0x41')]=[{'all':!![]}];}return db[_0xd54f('0x2d')][_0xd54f('0x42')](_0x4a6480);})[_0xd54f('0x26')](function(_0x52bc88){_0x2094e1[_0xd54f('0x43')]=_0x52bc88;return _0x2094e1;})[_0xd54f('0x26')](respondWithFilteredResult(_0x37b7b0,_0x4a6480))[_0xd54f('0x44')](handleError(_0x37b7b0,null));};exports[_0xd54f('0x45')]=function(_0x5e9d9a,_0x2fb90a){var _0x5b33d9={'raw':!![],'where':{'id':_0x5e9d9a[_0xd54f('0x46')]['id']}},_0x32c444={};_0x32c444[_0xd54f('0x32')]=_[_0xd54f('0x34')](db[_0xd54f('0x2d')][_0xd54f('0x2e')]);_0x32c444['query']=_['keys'](_0x5e9d9a['query']);_0x32c444[_0xd54f('0x35')]=_[_0xd54f('0x37')](_0x32c444[_0xd54f('0x32')],_0x32c444['query']);_0x5b33d9['attributes']=_['intersection'](_0x32c444[_0xd54f('0x32')],qs[_0xd54f('0x38')](_0x5e9d9a[_0xd54f('0x33')][_0xd54f('0x38')]));_0x5b33d9[_0xd54f('0x36')]=_0x5b33d9[_0xd54f('0x36')][_0xd54f('0x39')]?_0x5b33d9['attributes']:_0x32c444[_0xd54f('0x32')];if(_0x5e9d9a['query'][_0xd54f('0x47')]){_0x5b33d9['include']=[{'all':!![]}];}_0x5b33d9=_[_0xd54f('0x40')]({},_0x5b33d9,_0x5e9d9a['options']);return db[_0xd54f('0x2d')][_0xd54f('0x48')](_0x5b33d9)[_0xd54f('0x26')](handleEntityNotFound(_0x2fb90a,null))['then'](respondWithResult(_0x2fb90a,null))[_0xd54f('0x44')](handleError(_0x2fb90a,null));};exports[_0xd54f('0x49')]=function(_0x1c2486,_0x444c84){return db['SquareRecording']['create'](_0x1c2486[_0xd54f('0x4a')],{})['then'](respondWithResult(_0x444c84,0xc9))[_0xd54f('0x44')](handleError(_0x444c84,null));};exports[_0xd54f('0x25')]=function(_0x44f974,_0x5675d3){if(_0x44f974[_0xd54f('0x4a')]['id']){delete _0x44f974['body']['id'];}return db['SquareRecording']['find']({'where':{'id':_0x44f974[_0xd54f('0x46')]['id']}})['then'](handleEntityNotFound(_0x5675d3,null))[_0xd54f('0x26')](saveUpdates(_0x44f974[_0xd54f('0x4a')],null))[_0xd54f('0x26')](respondWithResult(_0x5675d3,null))[_0xd54f('0x44')](handleError(_0x5675d3,null));};exports['download']=function(_0x1c42c5,_0x366266,_0x57c61d){var _0x223f75=require('../../components/encryptor');var _0x1dc25d=![];var _0x551ab2={};if(_0x1c42c5[_0xd54f('0x33')][_0xd54f('0x30')]&&_0x1c42c5[_0xd54f('0x33')]['type']==='uniqueid'){_0x551ab2[_0xd54f('0x4b')]=_0x1c42c5[_0xd54f('0x46')]['id'];}else{_0x551ab2['id']=_0x1c42c5[_0xd54f('0x46')]['id'];}return db[_0xd54f('0x2d')][_0xd54f('0x48')]({'where':_0x551ab2,'attributes':['id','savePath',_0xd54f('0x4c')],'raw':!![]})[_0xd54f('0x26')](handleEntityNotFound(_0x366266,null))[_0xd54f('0x26')](function(_0x465255){if(_0x465255){var _0x1c2adf=_0x465255[_0xd54f('0x4d')];var _0x39cf60=util[_0xd54f('0x4e')](_0xd54f('0x4f'),_0x1c2adf);if(fs[_0xd54f('0x50')](_0x39cf60)){_0x1dc25d=!![];return _0x223f75[_0xd54f('0x51')](_0x39cf60,_0x1c2adf,config[_0xd54f('0x52')][_0xd54f('0x53')])[_0xd54f('0x26')](function(){return _0x465255;});}return _0x465255;}})['then'](function(_0x2b27e0){if(_0x2b27e0){var _0x5a65e4=_0x2b27e0[_0xd54f('0x4d')];if(!fs['existsSync'](_0x5a65e4)){throw new db['Sequelize']['ValidationError'](_0xd54f('0x54'));}if(_0x2b27e0[_0xd54f('0x4c')]){return _0x366266[_0xd54f('0x55')](_0x5a65e4,_0x2b27e0[_0xd54f('0x4c')]+path[_0xd54f('0x56')](_0x5a65e4),function(){if(_0x1dc25d){fs[_0xd54f('0x57')](_0x5a65e4);}});}else{return _0x366266['download'](_0x5a65e4,function(_0x1f8283){if(_0x1dc25d){fs[_0xd54f('0x57')](_0x5a65e4);}});}}})[_0xd54f('0x44')](function(_0x38f29b){if(_0x38f29b[_0xd54f('0x58')]===_0xd54f('0x54')){_0x366266['status'](0x194)['send'](_0xd54f('0x59'));}else{return handleError(_0x366266,null);}});};exports['destroy']=function(_0x45b8a9,_0x43675c){return db[_0xd54f('0x2d')][_0xd54f('0x48')]({'where':{'id':_0x45b8a9[_0xd54f('0x46')]['id']}})[_0xd54f('0x26')](function(_0x537f73){if(_[_0xd54f('0x5a')](_0x537f73)){throw new ReferenceError(_0xd54f('0x5b'));}return _0x537f73;})[_0xd54f('0x26')](function(_0x469992){var _0x4d49e1=_0x469992[_0xd54f('0x4d')];logger[_0xd54f('0x5c')]('cancellazione\x20fisica\x20documento\x20%s',_0x4d49e1);if(!_[_0xd54f('0x5a')](_0x469992[_0xd54f('0x4d')])&&fs[_0xd54f('0x50')](_0x4d49e1)){logger[_0xd54f('0x5c')](_0xd54f('0x5d')+_0x4d49e1+_0xd54f('0x5e'));fs[_0xd54f('0x5f')](_0x4d49e1);}_0x4d49e1=_0x4d49e1+'.cypher';if(!_[_0xd54f('0x5a')](_0x469992['savePath'])&&fs[_0xd54f('0x50')](_0x4d49e1)){logger[_0xd54f('0x5c')](_0xd54f('0x5d')+_0x4d49e1+_0xd54f('0x5e'));fs[_0xd54f('0x5f')](_0x4d49e1);}return _0x469992;})[_0xd54f('0x26')](function(_0x461d60){if(!_0x461d60)throw new InternalError();return _0x461d60['destroy']();})['then'](function(){_0x43675c[_0xd54f('0x1b')](0xcc)[_0xd54f('0x1c')]();})[_0xd54f('0x44')](handleError(_0x43675c,null));};
\ No newline at end of file
index c71fd37..990c891 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56b9=['define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./squareRecording.attributes','exports'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x56b9,0x196));var _0x956b=function(_0x38febf,_0x1fdebc){_0x38febf=_0x38febf-0x0;var _0x36db7f=_0x56b9[_0x38febf];return _0x36db7f;};'use strict';var _=require(_0x956b('0x0'));var util=require(_0x956b('0x1'));var logger=require(_0x956b('0x2'))(_0x956b('0x3'));var moment=require(_0x956b('0x4'));var BPromise=require(_0x956b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x956b('0x6'));var rimraf=require('rimraf');var config=require(_0x956b('0x7'));var attributes=require(_0x956b('0x8'));module[_0x956b('0x9')]=function(_0x58ab26,_0x12725c){return _0x58ab26[_0x956b('0xa')](_0x956b('0xb'),attributes,{'tableName':_0x956b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc14a=['../../config/environment','exports','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x3cb842,_0x1be409){var _0x144b10=function(_0x507fe9){while(--_0x507fe9){_0x3cb842['push'](_0x3cb842['shift']());}};_0x144b10(++_0x1be409);}(_0xc14a,0xa9));var _0xac14=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc14a[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xac14('0x0'));var util=require(_0xac14('0x1'));var logger=require(_0xac14('0x2'))(_0xac14('0x3'));var moment=require(_0xac14('0x4'));var BPromise=require('bluebird');var rp=require(_0xac14('0x5'));var fs=require('fs');var path=require(_0xac14('0x6'));var rimraf=require('rimraf');var config=require(_0xac14('0x7'));var attributes=require('./squareRecording.attributes');module[_0xac14('0x8')]=function(_0x244723,_0x3c2415){return _0x244723['define'](_0xac14('0x9'),attributes,{'tableName':_0xac14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0571b80..b9f7573 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1afe=['then','info','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareRecording,\x20%s,\x20%s','message','catch','CreateSquareRecording','SquareRecording','create','options','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request'];(function(_0x8e7fb8,_0x3c01fc){var _0x3a59d8=function(_0x415971){while(--_0x415971){_0x8e7fb8['push'](_0x8e7fb8['shift']());}};_0x3a59d8(++_0x3c01fc);}(_0x1afe,0x16d));var _0xe1af=function(_0x488bf3,_0x5489b7){_0x488bf3=_0x488bf3-0x0;var _0x1c8e36=_0x1afe[_0x488bf3];return _0x1c8e36;};'use strict';var _=require(_0xe1af('0x0'));var util=require(_0xe1af('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe1af('0x2'));var fs=require('fs');var Redis=require(_0xe1af('0x3'));var db=require(_0xe1af('0x4'))['db'];var utils=require(_0xe1af('0x5'));var logger=require(_0xe1af('0x6'))(_0xe1af('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe1af('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57c5bb,_0x591314,_0x1214f9){return new BPromise(function(_0x1e5b18,_0x4fd226){return client[_0xe1af('0x9')](_0x57c5bb,_0x1214f9)[_0xe1af('0xa')](function(_0x5a32e7){logger[_0xe1af('0xb')]('SquareRecording,\x20%s,\x20%s',_0x591314,_0xe1af('0xc'));logger['debug'](_0xe1af('0xd'),_0x591314,_0xe1af('0xc'),JSON[_0xe1af('0xe')](_0x5a32e7));if(_0x5a32e7['error']){if(_0x5a32e7[_0xe1af('0xf')][_0xe1af('0x10')]===0x1f4){logger[_0xe1af('0xf')](_0xe1af('0x11'),_0x591314,_0x5a32e7[_0xe1af('0xf')][_0xe1af('0x12')]);return _0x4fd226(_0x5a32e7[_0xe1af('0xf')][_0xe1af('0x12')]);}logger[_0xe1af('0xf')](_0xe1af('0x11'),_0x591314,_0x5a32e7['error'][_0xe1af('0x12')]);return _0x1e5b18(_0x5a32e7[_0xe1af('0xf')][_0xe1af('0x12')]);}else{logger['info'](_0xe1af('0x11'),_0x591314,_0xe1af('0xc'));_0x1e5b18(_0x5a32e7['result']['message']);}})[_0xe1af('0x13')](function(_0x1e3150){logger[_0xe1af('0xf')](_0xe1af('0x11'),_0x591314,_0x1e3150);_0x4fd226(_0x1e3150);});});}exports[_0xe1af('0x14')]=function(_0x1d635d){var _0x58b4fd=this;return new Promise(function(_0x27d034,_0x59f7d3){return db[_0xe1af('0x15')][_0xe1af('0x16')](_0x1d635d['body'],{'raw':_0x1d635d['options']?_0x1d635d[_0xe1af('0x17')][_0xe1af('0x18')]===undefined?!![]:![]:!![]})[_0xe1af('0xa')](function(_0xdcbbd6){logger['info'](_0xe1af('0x14'),_0x1d635d);logger['debug'](_0xe1af('0x14'),_0x1d635d,JSON[_0xe1af('0xe')](_0xdcbbd6));_0x27d034(_0xdcbbd6);})[_0xe1af('0x13')](function(_0x2c79d3){logger[_0xe1af('0xf')](_0xe1af('0x14'),_0x2c79d3[_0xe1af('0x12')],_0x1d635d);_0x59f7d3(_0x58b4fd[_0xe1af('0xf')](0x1f4,_0x2c79d3['message']));});});};
\ No newline at end of file
+var _0x0e26=['debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateSquareRecording','SquareRecording','create','body','options','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s'];(function(_0x1e09f2,_0x23d1bb){var _0x19d8d4=function(_0x29bb06){while(--_0x29bb06){_0x1e09f2['push'](_0x1e09f2['shift']());}};_0x19d8d4(++_0x23d1bb);}(_0x0e26,0x1c1));var _0x60e2=function(_0x2390d7,_0x2f4750){_0x2390d7=_0x2390d7-0x0;var _0x29b03=_0x0e26[_0x2390d7];return _0x29b03;};'use strict';var _=require('lodash');var util=require(_0x60e2('0x0'));var moment=require(_0x60e2('0x1'));var BPromise=require('bluebird');var rs=require(_0x60e2('0x2'));var fs=require('fs');var Redis=require(_0x60e2('0x3'));var db=require(_0x60e2('0x4'))['db'];var utils=require(_0x60e2('0x5'));var logger=require(_0x60e2('0x6'))(_0x60e2('0x7'));var config=require('../../config/environment');var jayson=require(_0x60e2('0x8'));var client=jayson[_0x60e2('0x9')][_0x60e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2133f3,_0x3c8d74,_0xfbe78f){return new BPromise(function(_0x2b08e2,_0x4f4069){return client[_0x60e2('0xb')](_0x2133f3,_0xfbe78f)[_0x60e2('0xc')](function(_0x1a21c7){logger[_0x60e2('0xd')](_0x60e2('0xe'),_0x3c8d74,'request\x20sent');logger[_0x60e2('0xf')](_0x60e2('0x10'),_0x3c8d74,'request\x20sent',JSON[_0x60e2('0x11')](_0x1a21c7));if(_0x1a21c7[_0x60e2('0x12')]){if(_0x1a21c7[_0x60e2('0x12')][_0x60e2('0x13')]===0x1f4){logger['error'](_0x60e2('0xe'),_0x3c8d74,_0x1a21c7['error'][_0x60e2('0x14')]);return _0x4f4069(_0x1a21c7[_0x60e2('0x12')][_0x60e2('0x14')]);}logger[_0x60e2('0x12')]('SquareRecording,\x20%s,\x20%s',_0x3c8d74,_0x1a21c7[_0x60e2('0x12')][_0x60e2('0x14')]);return _0x2b08e2(_0x1a21c7['error'][_0x60e2('0x14')]);}else{logger[_0x60e2('0xd')](_0x60e2('0xe'),_0x3c8d74,_0x60e2('0x15'));_0x2b08e2(_0x1a21c7[_0x60e2('0x16')][_0x60e2('0x14')]);}})[_0x60e2('0x17')](function(_0x3e13a9){logger[_0x60e2('0x12')](_0x60e2('0xe'),_0x3c8d74,_0x3e13a9);_0x4f4069(_0x3e13a9);});});}exports[_0x60e2('0x18')]=function(_0x5bb200){var _0xa84bb7=this;return new Promise(function(_0x147080,_0x57b7b0){return db[_0x60e2('0x19')][_0x60e2('0x1a')](_0x5bb200[_0x60e2('0x1b')],{'raw':_0x5bb200[_0x60e2('0x1c')]?_0x5bb200[_0x60e2('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x60e2('0xc')](function(_0x3ab10b){logger['info']('CreateSquareRecording',_0x5bb200);logger['debug'](_0x60e2('0x18'),_0x5bb200,JSON[_0x60e2('0x11')](_0x3ab10b));_0x147080(_0x3ab10b);})[_0x60e2('0x17')](function(_0x56e916){logger[_0x60e2('0x12')](_0x60e2('0x18'),_0x56e916[_0x60e2('0x14')],_0x5bb200);_0x57b7b0(_0xa84bb7[_0x60e2('0x12')](0x1f4,_0x56e916['message']));});});};
\ No newline at end of file
index 7f34bd2..5850683 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x1aee2f,_0x46b656){var _0x16361c=function(_0x1c4bfc){while(--_0x1c4bfc){_0x1aee2f['push'](_0x1aee2f['shift']());}};_0x16361c(++_0x46b656);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router;
\ No newline at end of file
+var _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5ecb14,_0x5921b3){var _0xead3ec=function(_0x575fc0){while(--_0x575fc0){_0x5ecb14['push'](_0x5ecb14['shift']());}};_0xead3ec(++_0x5921b3);}(_0xb10b,0x12a));var _0xbb10=function(_0x1f55f9,_0xf5c554){_0x1f55f9=_0x1f55f9-0x0;var _0x885614=_0xb10b[_0x1f55f9];return _0x885614;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
index a1d2ec7..a540f5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86ea=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x5e5568,_0x300d0d){var _0x557045=function(_0x2ee76c){while(--_0x2ee76c){_0x5e5568['push'](_0x5e5568['shift']());}};_0x557045(++_0x300d0d);}(_0x86ea,0x18d));var _0xa86e=function(_0x4dff21,_0x4732de){_0x4dff21=_0x4dff21-0x0;var _0x4b00ef=_0x86ea[_0x4dff21];return _0x4b00ef;};'use strict';var Sequelize=require(_0xa86e('0x0'));module[_0xa86e('0x1')]={'network':{'type':Sequelize[_0xa86e('0x2')]},'network_script':{'type':Sequelize[_0xa86e('0x2')]},'request':{'type':Sequelize[_0xa86e('0x2')]},'channel':{'type':Sequelize[_0xa86e('0x2')]},'language':{'type':Sequelize[_0xa86e('0x2')]},'type':{'type':Sequelize[_0xa86e('0x2')]},'uniqueid':{'type':Sequelize[_0xa86e('0x2')]},'version':{'type':Sequelize[_0xa86e('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0xa86e('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xa86e('0x2')]},'dnid':{'type':Sequelize[_0xa86e('0x2')]},'rdnis':{'type':Sequelize[_0xa86e('0x2')]},'context':{'type':Sequelize[_0xa86e('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xa86e('0x2')]},'accountcode':{'type':Sequelize[_0xa86e('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xa86e('0x2')]},'joinAt':{'type':Sequelize[_0xa86e('0x3')]},'leaveAt':{'type':Sequelize[_0xa86e('0x3')]},'bot':{'type':Sequelize[_0xa86e('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xa8fb=['STRING','DATE','sequelize'];(function(_0x323bf6,_0x19aed6){var _0x18da88=function(_0x1111da){while(--_0x1111da){_0x323bf6['push'](_0x323bf6['shift']());}};_0x18da88(++_0x19aed6);}(_0xa8fb,0x1bb));var _0xba8f=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xa8fb[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require(_0xba8f('0x0'));module['exports']={'network':{'type':Sequelize[_0xba8f('0x1')]},'network_script':{'type':Sequelize[_0xba8f('0x1')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xba8f('0x1')]},'language':{'type':Sequelize[_0xba8f('0x1')]},'type':{'type':Sequelize[_0xba8f('0x1')]},'uniqueid':{'type':Sequelize[_0xba8f('0x1')]},'version':{'type':Sequelize[_0xba8f('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0xba8f('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xba8f('0x1')]},'callingtns':{'type':Sequelize[_0xba8f('0x1')]},'dnid':{'type':Sequelize[_0xba8f('0x1')]},'rdnis':{'type':Sequelize[_0xba8f('0x1')]},'context':{'type':Sequelize[_0xba8f('0x1')]},'extension':{'type':Sequelize[_0xba8f('0x1')]},'priority':{'type':Sequelize[_0xba8f('0x1')]},'enhanced':{'type':Sequelize[_0xba8f('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0xba8f('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xba8f('0x2')]},'leaveAt':{'type':Sequelize[_0xba8f('0x2')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 852dff8..f7b0d06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf93=['lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','filter','options','SquareReport','includeAll','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra'];(function(_0x40386f,_0x486668){var _0x5cd6a9=function(_0x455b95){while(--_0x455b95){_0x40386f['push'](_0x40386f['shift']());}};_0x5cd6a9(++_0x486668);}(_0xdf93,0x10e));var _0x3df9=function(_0xfe94a5,_0x1c639a){_0xfe94a5=_0xfe94a5-0x0;var _0x2f3114=_0xdf93[_0xfe94a5];return _0x2f3114;};'use strict';var emlformat=require(_0x3df9('0x0'));var rimraf=require(_0x3df9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3df9('0x2'));var rp=require(_0x3df9('0x3'));var moment=require(_0x3df9('0x4'));var BPromise=require(_0x3df9('0x5'));var Mustache=require('mustache');var util=require(_0x3df9('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x3df9('0x7'));var ejs=require(_0x3df9('0x8'));var fs=require('fs');var fs_extra=require(_0x3df9('0x9'));var _=require(_0x3df9('0xa'));var squel=require(_0x3df9('0xb'));var crypto=require('crypto');var jsforce=require(_0x3df9('0xc'));var deskjs=require(_0x3df9('0xd'));var toCsv=require(_0x3df9('0x7'));var querystring=require(_0x3df9('0xe'));var Papa=require(_0x3df9('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3df9('0x10'));var as=require(_0x3df9('0x11'));var hardwareService=require(_0x3df9('0x12'));var logger=require('../../config/logger')(_0x3df9('0x13'));var utils=require(_0x3df9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3df9('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c2734,_0x30a70b){_0x30a70b=_0x30a70b||0xcc;return function(_0x5ce8c6){if(_0x5ce8c6){return _0x1c2734['sendStatus'](_0x30a70b);}return _0x1c2734[_0x3df9('0x16')](_0x30a70b)[_0x3df9('0x17')]();};}function respondWithResult(_0x1cceab,_0x3b8fdd){_0x3b8fdd=_0x3b8fdd||0xc8;return function(_0x51874d){if(_0x51874d){return _0x1cceab[_0x3df9('0x16')](_0x3b8fdd)[_0x3df9('0x18')](_0x51874d);}};}function respondWithFilteredResult(_0x49c217,_0x3790b7){return function(_0x200940){if(_0x200940){var _0x35e06d=typeof _0x3790b7[_0x3df9('0x19')]===_0x3df9('0x1a')&&typeof _0x3790b7[_0x3df9('0x1b')]===_0x3df9('0x1a');var _0x1e5408=_0x200940['count'];var _0x28521d=_0x35e06d?0x0:_0x3790b7[_0x3df9('0x19')];var _0x3c5611=_0x35e06d?_0x200940[_0x3df9('0x1c')]:_0x3790b7[_0x3df9('0x19')]+_0x3790b7[_0x3df9('0x1b')];var _0x418f51;if(_0x3c5611>=_0x1e5408){_0x3c5611=_0x1e5408;_0x418f51=0xc8;}else{_0x418f51=0xce;}_0x49c217['status'](_0x418f51);return _0x49c217[_0x3df9('0x1d')](_0x3df9('0x1e'),_0x28521d+'-'+_0x3c5611+'/'+_0x1e5408)[_0x3df9('0x18')](_0x200940);}return null;};}function patchUpdates(_0x1c8844){return function(_0xee5a4){try{jsonpatch[_0x3df9('0x1f')](_0xee5a4,_0x1c8844,!![]);}catch(_0x4a111c){return BPromise[_0x3df9('0x20')](_0x4a111c);}return _0xee5a4[_0x3df9('0x21')]();};}function saveUpdates(_0x1065de,_0x1e56a1){return function(_0x33f033){if(_0x33f033){return _0x33f033[_0x3df9('0x22')](_0x1065de)[_0x3df9('0x23')](function(_0x2b3be3){return _0x2b3be3;});}return null;};}function removeEntity(_0x365d88,_0x4fa4aa){return function(_0x496897){if(_0x496897){return _0x496897[_0x3df9('0x24')]()[_0x3df9('0x23')](function(){_0x365d88[_0x3df9('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a06d6,_0x2c74b6){return function(_0x2218c0){if(!_0x2218c0){_0x2a06d6[_0x3df9('0x25')](0x194);}return _0x2218c0;};}function handleError(_0x1bdfaf,_0x5aa23c){_0x5aa23c=_0x5aa23c||0x1f4;return function(_0x210aa1){logger['error'](_0x210aa1[_0x3df9('0x26')]);if(_0x210aa1[_0x3df9('0x27')]){delete _0x210aa1[_0x3df9('0x27')];}_0x1bdfaf[_0x3df9('0x16')](_0x5aa23c)[_0x3df9('0x28')](_0x210aa1);};}exports['index']=function(_0x1e4f0a,_0x1ee6fb){var _0x28ff3e={},_0x2671a6={},_0x3e5478={'count':0x0,'rows':[]};var _0x13dcdd=_['map'](db['SquareReport'][_0x3df9('0x29')],function(_0x11cb86){return{'name':_0x11cb86[_0x3df9('0x2a')],'type':_0x11cb86[_0x3df9('0x2b')][_0x3df9('0x2c')]};});_0x2671a6[_0x3df9('0x2d')]=_[_0x3df9('0x2e')](_0x13dcdd,_0x3df9('0x27'));_0x2671a6[_0x3df9('0x2f')]=_[_0x3df9('0x30')](_0x1e4f0a[_0x3df9('0x2f')]);_0x2671a6[_0x3df9('0x31')]=_[_0x3df9('0x32')](_0x2671a6[_0x3df9('0x2d')],_0x2671a6[_0x3df9('0x2f')]);_0x28ff3e[_0x3df9('0x33')]=_[_0x3df9('0x32')](_0x2671a6[_0x3df9('0x2d')],qs[_0x3df9('0x34')](_0x1e4f0a['query'][_0x3df9('0x34')]));_0x28ff3e['attributes']=_0x28ff3e[_0x3df9('0x33')]['length']?_0x28ff3e['attributes']:_0x2671a6[_0x3df9('0x2d')];if(!_0x1e4f0a[_0x3df9('0x2f')][_0x3df9('0x35')]('nolimit')){_0x28ff3e[_0x3df9('0x1b')]=qs[_0x3df9('0x1b')](_0x1e4f0a[_0x3df9('0x2f')][_0x3df9('0x1b')]);_0x28ff3e[_0x3df9('0x19')]=qs['offset'](_0x1e4f0a[_0x3df9('0x2f')][_0x3df9('0x19')]);}_0x28ff3e[_0x3df9('0x36')]=qs[_0x3df9('0x37')](_0x1e4f0a['query'][_0x3df9('0x37')]);_0x28ff3e[_0x3df9('0x38')]=qs[_0x3df9('0x31')](_['pick'](_0x1e4f0a['query'],_0x2671a6[_0x3df9('0x31')]),_0x13dcdd);if(_0x1e4f0a[_0x3df9('0x2f')]['filter']){_0x28ff3e['where']=_[_0x3df9('0x39')](_0x28ff3e[_0x3df9('0x38')],{'$or':_[_0x3df9('0x2e')](_0x13dcdd,function(_0x1bcaab){if(_0x1bcaab[_0x3df9('0x2b')]!=='VIRTUAL'){var _0x1f08c4={};_0x1f08c4[_0x1bcaab[_0x3df9('0x27')]]={'$like':'%'+_0x1e4f0a[_0x3df9('0x2f')][_0x3df9('0x3a')]+'%'};return _0x1f08c4;}})});}_0x28ff3e=_['merge']({},_0x28ff3e,_0x1e4f0a[_0x3df9('0x3b')]);var _0x1fdb6f={'where':_0x28ff3e[_0x3df9('0x38')]};return db[_0x3df9('0x3c')][_0x3df9('0x1c')](_0x1fdb6f)[_0x3df9('0x23')](function(_0x93d63c){_0x3e5478['count']=_0x93d63c;if(_0x1e4f0a[_0x3df9('0x2f')][_0x3df9('0x3d')]){_0x28ff3e['include']=[{'all':!![]}];}return db[_0x3df9('0x3c')][_0x3df9('0x3e')](_0x28ff3e);})[_0x3df9('0x23')](function(_0x1412b9){_0x3e5478[_0x3df9('0x3f')]=_0x1412b9;return _0x3e5478;})[_0x3df9('0x23')](respondWithFilteredResult(_0x1ee6fb,_0x28ff3e))[_0x3df9('0x40')](handleError(_0x1ee6fb,null));};exports['show']=function(_0xf1816d,_0x2160c1){var _0x3dd30c={'raw':!![],'where':{'id':_0xf1816d[_0x3df9('0x41')]['id']}},_0x384ac9={};_0x384ac9[_0x3df9('0x2d')]=_[_0x3df9('0x30')](db['SquareReport'][_0x3df9('0x29')]);_0x384ac9['query']=_[_0x3df9('0x30')](_0xf1816d['query']);_0x384ac9[_0x3df9('0x31')]=_[_0x3df9('0x32')](_0x384ac9[_0x3df9('0x2d')],_0x384ac9[_0x3df9('0x2f')]);_0x3dd30c[_0x3df9('0x33')]=_[_0x3df9('0x32')](_0x384ac9[_0x3df9('0x2d')],qs[_0x3df9('0x34')](_0xf1816d[_0x3df9('0x2f')][_0x3df9('0x34')]));_0x3dd30c[_0x3df9('0x33')]=_0x3dd30c['attributes']['length']?_0x3dd30c[_0x3df9('0x33')]:_0x384ac9[_0x3df9('0x2d')];if(_0xf1816d[_0x3df9('0x2f')]['includeAll']){_0x3dd30c['include']=[{'all':!![]}];}_0x3dd30c=_[_0x3df9('0x39')]({},_0x3dd30c,_0xf1816d[_0x3df9('0x3b')]);return db[_0x3df9('0x3c')][_0x3df9('0x42')](_0x3dd30c)['then'](handleEntityNotFound(_0x2160c1,null))[_0x3df9('0x23')](respondWithResult(_0x2160c1,null))['catch'](handleError(_0x2160c1,null));};exports[_0x3df9('0x43')]=function(_0x2c84f3,_0x54b62f){return db['SquareReport']['create'](_0x2c84f3[_0x3df9('0x44')],{})[_0x3df9('0x23')](respondWithResult(_0x54b62f,0xc9))[_0x3df9('0x40')](handleError(_0x54b62f,null));};exports['update']=function(_0x2328f8,_0x50fe61){if(_0x2328f8[_0x3df9('0x44')]['id']){delete _0x2328f8[_0x3df9('0x44')]['id'];}return db[_0x3df9('0x3c')][_0x3df9('0x42')]({'where':{'id':_0x2328f8[_0x3df9('0x41')]['id']}})[_0x3df9('0x23')](handleEntityNotFound(_0x50fe61,null))[_0x3df9('0x23')](saveUpdates(_0x2328f8[_0x3df9('0x44')],null))['then'](respondWithResult(_0x50fe61,null))[_0x3df9('0x40')](handleError(_0x50fe61,null));};exports[_0x3df9('0x24')]=function(_0x55db9f,_0x3d72e8){return db[_0x3df9('0x3c')]['find']({'where':{'id':_0x55db9f['params']['id']}})[_0x3df9('0x23')](handleEntityNotFound(_0x3d72e8,null))[_0x3df9('0x23')](removeEntity(_0x3d72e8,null))[_0x3df9('0x40')](handleError(_0x3d72e8,null));};exports[_0x3df9('0x45')]=function(_0xd9a68d,_0x394cb0){return db[_0x3df9('0x3c')][_0x3df9('0x45')]()[_0x3df9('0x23')](respondWithResult(_0x394cb0,null))['catch'](handleError(_0x394cb0,null));};
\ No newline at end of file
+var _0xcf59=['reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','merge','filter','options','SquareReport','includeAll','findAll','rows','length','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply'];(function(_0x25d4b0,_0x27039f){var _0x3d0f68=function(_0xe32faa){while(--_0xe32faa){_0x25d4b0['push'](_0x25d4b0['shift']());}};_0x3d0f68(++_0x27039f);}(_0xcf59,0x102));var _0x9cf5=function(_0x354b70,_0x2ee366){_0x354b70=_0x354b70-0x0;var _0x56a7e8=_0xcf59[_0x354b70];return _0x56a7e8;};'use strict';var emlformat=require(_0x9cf5('0x0'));var rimraf=require(_0x9cf5('0x1'));var zipdir=require(_0x9cf5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9cf5('0x3'));var moment=require(_0x9cf5('0x4'));var BPromise=require(_0x9cf5('0x5'));var Mustache=require(_0x9cf5('0x6'));var util=require(_0x9cf5('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x9cf5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9cf5('0x9'));var _=require('lodash');var squel=require(_0x9cf5('0xa'));var crypto=require(_0x9cf5('0xb'));var jsforce=require(_0x9cf5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9cf5('0x8'));var querystring=require(_0x9cf5('0xd'));var Papa=require(_0x9cf5('0xe'));var Redis=require(_0x9cf5('0xf'));var authService=require(_0x9cf5('0x10'));var qs=require(_0x9cf5('0x11'));var as=require(_0x9cf5('0x12'));var hardwareService=require(_0x9cf5('0x13'));var logger=require(_0x9cf5('0x14'))(_0x9cf5('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9cf5('0x16'));var db=require(_0x9cf5('0x17'))['db'];function respondWithStatusCode(_0xc0d998,_0x10cbe5){_0x10cbe5=_0x10cbe5||0xcc;return function(_0x1b63c9){if(_0x1b63c9){return _0xc0d998[_0x9cf5('0x18')](_0x10cbe5);}return _0xc0d998[_0x9cf5('0x19')](_0x10cbe5)[_0x9cf5('0x1a')]();};}function respondWithResult(_0x204d1c,_0x588c2b){_0x588c2b=_0x588c2b||0xc8;return function(_0x2f5701){if(_0x2f5701){return _0x204d1c[_0x9cf5('0x19')](_0x588c2b)['json'](_0x2f5701);}};}function respondWithFilteredResult(_0x285183,_0x3aa51e){return function(_0x413ef6){if(_0x413ef6){var _0x2c5baa=typeof _0x3aa51e['offset']===_0x9cf5('0x1b')&&typeof _0x3aa51e['limit']===_0x9cf5('0x1b');var _0x359d54=_0x413ef6[_0x9cf5('0x1c')];var _0x6d6def=_0x2c5baa?0x0:_0x3aa51e[_0x9cf5('0x1d')];var _0x4dcf2b=_0x2c5baa?_0x413ef6[_0x9cf5('0x1c')]:_0x3aa51e['offset']+_0x3aa51e[_0x9cf5('0x1e')];var _0xfd6a43;if(_0x4dcf2b>=_0x359d54){_0x4dcf2b=_0x359d54;_0xfd6a43=0xc8;}else{_0xfd6a43=0xce;}_0x285183[_0x9cf5('0x19')](_0xfd6a43);return _0x285183[_0x9cf5('0x1f')]('Content-Range',_0x6d6def+'-'+_0x4dcf2b+'/'+_0x359d54)[_0x9cf5('0x20')](_0x413ef6);}return null;};}function patchUpdates(_0x416575){return function(_0x58318a){try{jsonpatch[_0x9cf5('0x21')](_0x58318a,_0x416575,!![]);}catch(_0x2a5cb4){return BPromise[_0x9cf5('0x22')](_0x2a5cb4);}return _0x58318a[_0x9cf5('0x23')]();};}function saveUpdates(_0xcc0295,_0x1e5d1d){return function(_0xbe661f){if(_0xbe661f){return _0xbe661f[_0x9cf5('0x24')](_0xcc0295)[_0x9cf5('0x25')](function(_0x5c7af){return _0x5c7af;});}return null;};}function removeEntity(_0xf7e299,_0x5c4095){return function(_0x560187){if(_0x560187){return _0x560187['destroy']()['then'](function(){_0xf7e299['status'](0xcc)[_0x9cf5('0x1a')]();});}};}function handleEntityNotFound(_0x4bf9f3,_0x1c3ce5){return function(_0x4ad259){if(!_0x4ad259){_0x4bf9f3[_0x9cf5('0x18')](0x194);}return _0x4ad259;};}function handleError(_0x5b8886,_0x1d651f){_0x1d651f=_0x1d651f||0x1f4;return function(_0x1c64eb){logger['error'](_0x1c64eb[_0x9cf5('0x26')]);if(_0x1c64eb['name']){delete _0x1c64eb[_0x9cf5('0x27')];}_0x5b8886[_0x9cf5('0x19')](_0x1d651f)[_0x9cf5('0x28')](_0x1c64eb);};}exports[_0x9cf5('0x29')]=function(_0x3929df,_0x4bdf72){var _0x3fd9ee={},_0x22e258={},_0x177fa4={'count':0x0,'rows':[]};var _0x4a394c=_[_0x9cf5('0x2a')](db['SquareReport'][_0x9cf5('0x2b')],function(_0x1b8cdc){return{'name':_0x1b8cdc[_0x9cf5('0x2c')],'type':_0x1b8cdc[_0x9cf5('0x2d')][_0x9cf5('0x2e')]};});_0x22e258[_0x9cf5('0x2f')]=_['map'](_0x4a394c,_0x9cf5('0x27'));_0x22e258['query']=_[_0x9cf5('0x30')](_0x3929df[_0x9cf5('0x31')]);_0x22e258['filters']=_[_0x9cf5('0x32')](_0x22e258['model'],_0x22e258['query']);_0x3fd9ee[_0x9cf5('0x33')]=_[_0x9cf5('0x32')](_0x22e258[_0x9cf5('0x2f')],qs[_0x9cf5('0x34')](_0x3929df[_0x9cf5('0x31')][_0x9cf5('0x34')]));_0x3fd9ee[_0x9cf5('0x33')]=_0x3fd9ee[_0x9cf5('0x33')]['length']?_0x3fd9ee[_0x9cf5('0x33')]:_0x22e258[_0x9cf5('0x2f')];if(!_0x3929df['query'][_0x9cf5('0x35')]('nolimit')){_0x3fd9ee[_0x9cf5('0x1e')]=qs['limit'](_0x3929df[_0x9cf5('0x31')][_0x9cf5('0x1e')]);_0x3fd9ee[_0x9cf5('0x1d')]=qs['offset'](_0x3929df['query'][_0x9cf5('0x1d')]);}_0x3fd9ee[_0x9cf5('0x36')]=qs[_0x9cf5('0x37')](_0x3929df[_0x9cf5('0x31')][_0x9cf5('0x37')]);_0x3fd9ee[_0x9cf5('0x38')]=qs[_0x9cf5('0x39')](_[_0x9cf5('0x3a')](_0x3929df['query'],_0x22e258[_0x9cf5('0x39')]),_0x4a394c);if(_0x3929df[_0x9cf5('0x31')]['filter']){_0x3fd9ee[_0x9cf5('0x38')]=_[_0x9cf5('0x3b')](_0x3fd9ee[_0x9cf5('0x38')],{'$or':_[_0x9cf5('0x2a')](_0x4a394c,function(_0x3913cf){if(_0x3913cf[_0x9cf5('0x2d')]!=='VIRTUAL'){var _0x36e6f2={};_0x36e6f2[_0x3913cf[_0x9cf5('0x27')]]={'$like':'%'+_0x3929df[_0x9cf5('0x31')][_0x9cf5('0x3c')]+'%'};return _0x36e6f2;}})});}_0x3fd9ee=_[_0x9cf5('0x3b')]({},_0x3fd9ee,_0x3929df[_0x9cf5('0x3d')]);var _0x346d99={'where':_0x3fd9ee[_0x9cf5('0x38')]};return db[_0x9cf5('0x3e')]['count'](_0x346d99)[_0x9cf5('0x25')](function(_0x5adfe3){_0x177fa4[_0x9cf5('0x1c')]=_0x5adfe3;if(_0x3929df['query'][_0x9cf5('0x3f')]){_0x3fd9ee['include']=[{'all':!![]}];}return db[_0x9cf5('0x3e')][_0x9cf5('0x40')](_0x3fd9ee);})[_0x9cf5('0x25')](function(_0x476159){_0x177fa4[_0x9cf5('0x41')]=_0x476159;return _0x177fa4;})['then'](respondWithFilteredResult(_0x4bdf72,_0x3fd9ee))['catch'](handleError(_0x4bdf72,null));};exports['show']=function(_0x2e3df9,_0x41827b){var _0xc5281={'raw':!![],'where':{'id':_0x2e3df9['params']['id']}},_0x3b3422={};_0x3b3422[_0x9cf5('0x2f')]=_[_0x9cf5('0x30')](db[_0x9cf5('0x3e')][_0x9cf5('0x2b')]);_0x3b3422[_0x9cf5('0x31')]=_['keys'](_0x2e3df9[_0x9cf5('0x31')]);_0x3b3422[_0x9cf5('0x39')]=_[_0x9cf5('0x32')](_0x3b3422[_0x9cf5('0x2f')],_0x3b3422['query']);_0xc5281[_0x9cf5('0x33')]=_['intersection'](_0x3b3422[_0x9cf5('0x2f')],qs['fields'](_0x2e3df9[_0x9cf5('0x31')][_0x9cf5('0x34')]));_0xc5281[_0x9cf5('0x33')]=_0xc5281['attributes'][_0x9cf5('0x42')]?_0xc5281[_0x9cf5('0x33')]:_0x3b3422[_0x9cf5('0x2f')];if(_0x2e3df9[_0x9cf5('0x31')][_0x9cf5('0x3f')]){_0xc5281['include']=[{'all':!![]}];}_0xc5281=_[_0x9cf5('0x3b')]({},_0xc5281,_0x2e3df9[_0x9cf5('0x3d')]);return db[_0x9cf5('0x3e')][_0x9cf5('0x43')](_0xc5281)[_0x9cf5('0x25')](handleEntityNotFound(_0x41827b,null))[_0x9cf5('0x25')](respondWithResult(_0x41827b,null))[_0x9cf5('0x44')](handleError(_0x41827b,null));};exports[_0x9cf5('0x45')]=function(_0x37d909,_0x2a5d38){return db['SquareReport']['create'](_0x37d909[_0x9cf5('0x46')],{})['then'](respondWithResult(_0x2a5d38,0xc9))[_0x9cf5('0x44')](handleError(_0x2a5d38,null));};exports[_0x9cf5('0x24')]=function(_0x20d1f4,_0x25621c){if(_0x20d1f4[_0x9cf5('0x46')]['id']){delete _0x20d1f4[_0x9cf5('0x46')]['id'];}return db[_0x9cf5('0x3e')]['find']({'where':{'id':_0x20d1f4[_0x9cf5('0x47')]['id']}})[_0x9cf5('0x25')](handleEntityNotFound(_0x25621c,null))[_0x9cf5('0x25')](saveUpdates(_0x20d1f4[_0x9cf5('0x46')],null))['then'](respondWithResult(_0x25621c,null))[_0x9cf5('0x44')](handleError(_0x25621c,null));};exports['destroy']=function(_0xb5e938,_0x3fe2a9){return db['SquareReport'][_0x9cf5('0x43')]({'where':{'id':_0xb5e938['params']['id']}})['then'](handleEntityNotFound(_0x3fe2a9,null))[_0x9cf5('0x25')](removeEntity(_0x3fe2a9,null))['catch'](handleError(_0x3fe2a9,null));};exports[_0x9cf5('0x48')]=function(_0x4e57ed,_0x597f91){return db[_0x9cf5('0x3e')][_0x9cf5('0x48')]()['then'](respondWithResult(_0x597f91,null))[_0x9cf5('0x44')](handleError(_0x597f91,null));};
\ No newline at end of file
index f934030..02d4ac4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f85=['SquareReport','uid_pname','uniqueid','project_name','leaveAt','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','exports'];(function(_0x39772f,_0x5605cb){var _0xc9edbf=function(_0x106a39){while(--_0x106a39){_0x39772f['push'](_0x39772f['shift']());}};_0xc9edbf(++_0x5605cb);}(_0x3f85,0x125));var _0x53f8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f85[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x53f8('0x0'));var logger=require(_0x53f8('0x1'))('api');var moment=require(_0x53f8('0x2'));var BPromise=require('bluebird');var rp=require(_0x53f8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x53f8('0x4'));var config=require(_0x53f8('0x5'));var attributes=require('./squareReport.attributes');module[_0x53f8('0x6')]=function(_0x1b5ef7,_0x47dfd6){return _0x1b5ef7['define'](_0x53f8('0x7'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x53f8('0x8'),'fields':[_0x53f8('0x9'),_0x53f8('0xa')]},{'name':'leaveAt','fields':[_0x53f8('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd953=['../../config/logger','api','request-promise','rimraf','../../config/environment','./squareReport.attributes','exports','define','uid_pname','project_name','leaveAt','lodash'];(function(_0x2dfb12,_0x8d3cce){var _0x15b5e6=function(_0x5522ca){while(--_0x5522ca){_0x2dfb12['push'](_0x2dfb12['shift']());}};_0x15b5e6(++_0x8d3cce);}(_0xd953,0xfb));var _0x3d95=function(_0x1d9992,_0x48ddc3){_0x1d9992=_0x1d9992-0x0;var _0x497c91=_0xd953[_0x1d9992];return _0x497c91;};'use strict';var _=require(_0x3d95('0x0'));var util=require('util');var logger=require(_0x3d95('0x1'))(_0x3d95('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3d95('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3d95('0x4'));var config=require(_0x3d95('0x5'));var attributes=require(_0x3d95('0x6'));module[_0x3d95('0x7')]=function(_0x65e65f,_0x10adbc){return _0x65e65f[_0x3d95('0x8')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x3d95('0x9'),'fields':['uniqueid',_0x3d95('0xa')]},{'name':_0x3d95('0xb'),'fields':['leaveAt']}],'timestamps':!![]});};
\ No newline at end of file
index 1934709..ac2a7f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14de=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareReport','SquareReport','body','options','raw','update','attributes','UpdateSquareReport','lodash','util','moment','bluebird'];(function(_0x513430,_0x3fba3c){var _0x5cb95c=function(_0xb6228a){while(--_0xb6228a){_0x513430['push'](_0x513430['shift']());}};_0x5cb95c(++_0x3fba3c);}(_0x14de,0x1ca));var _0xe14d=function(_0x4d8242,_0x39a36b){_0x4d8242=_0x4d8242-0x0;var _0x34e0b8=_0x14de[_0x4d8242];return _0x34e0b8;};'use strict';var _=require(_0xe14d('0x0'));var util=require(_0xe14d('0x1'));var moment=require(_0xe14d('0x2'));var BPromise=require(_0xe14d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe14d('0x4'))['db'];var utils=require(_0xe14d('0x5'));var logger=require(_0xe14d('0x6'))(_0xe14d('0x7'));var config=require(_0xe14d('0x8'));var jayson=require(_0xe14d('0x9'));var client=jayson[_0xe14d('0xa')][_0xe14d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x569eaa,_0x31b4d2,_0x3f9ddb){return new BPromise(function(_0x1e84a4,_0x5258c8){return client[_0xe14d('0xc')](_0x569eaa,_0x3f9ddb)[_0xe14d('0xd')](function(_0x1ad8ec){logger[_0xe14d('0xe')](_0xe14d('0xf'),_0x31b4d2,_0xe14d('0x10'));logger[_0xe14d('0x11')](_0xe14d('0x12'),_0x31b4d2,'request\x20sent',JSON[_0xe14d('0x13')](_0x1ad8ec));if(_0x1ad8ec[_0xe14d('0x14')]){if(_0x1ad8ec[_0xe14d('0x14')][_0xe14d('0x15')]===0x1f4){logger[_0xe14d('0x14')](_0xe14d('0xf'),_0x31b4d2,_0x1ad8ec[_0xe14d('0x14')][_0xe14d('0x16')]);return _0x5258c8(_0x1ad8ec['error']['message']);}logger[_0xe14d('0x14')]('SquareReport,\x20%s,\x20%s',_0x31b4d2,_0x1ad8ec[_0xe14d('0x14')][_0xe14d('0x16')]);return _0x1e84a4(_0x1ad8ec[_0xe14d('0x14')][_0xe14d('0x16')]);}else{logger['info'](_0xe14d('0xf'),_0x31b4d2,_0xe14d('0x10'));_0x1e84a4(_0x1ad8ec[_0xe14d('0x17')][_0xe14d('0x16')]);}})[_0xe14d('0x18')](function(_0x562aa8){logger[_0xe14d('0x14')]('SquareReport,\x20%s,\x20%s',_0x31b4d2,_0x562aa8);_0x5258c8(_0x562aa8);});});}exports[_0xe14d('0x19')]=function(_0x3634f4){var _0x2cbd1e=this;return new Promise(function(_0x340db4,_0x180ddb){return db[_0xe14d('0x1a')]['create'](_0x3634f4[_0xe14d('0x1b')],{'raw':_0x3634f4[_0xe14d('0x1c')]?_0x3634f4[_0xe14d('0x1c')][_0xe14d('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0xe9951b){logger[_0xe14d('0xe')](_0xe14d('0x19'),_0x3634f4);logger[_0xe14d('0x11')](_0xe14d('0x19'),_0x3634f4,JSON[_0xe14d('0x13')](_0xe9951b));_0x340db4(_0xe9951b);})[_0xe14d('0x18')](function(_0x302570){logger[_0xe14d('0x14')](_0xe14d('0x19'),_0x302570[_0xe14d('0x16')],_0x3634f4);_0x180ddb(_0x2cbd1e[_0xe14d('0x14')](0x1f4,_0x302570[_0xe14d('0x16')]));});});};exports['UpdateSquareReport']=function(_0x10febc){var _0x12d342=this;return new Promise(function(_0x1b4946,_0x12c3f6){return db[_0xe14d('0x1a')][_0xe14d('0x1e')](_0x10febc[_0xe14d('0x1b')],{'raw':_0x10febc[_0xe14d('0x1c')]?_0x10febc[_0xe14d('0x1c')][_0xe14d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10febc[_0xe14d('0x1c')]?_0x10febc['options']['where']||null:null,'attributes':_0x10febc[_0xe14d('0x1c')]?_0x10febc['options'][_0xe14d('0x1f')]||null:null,'limit':_0x10febc[_0xe14d('0x1c')]?_0x10febc[_0xe14d('0x1c')]['limit']||null:null})[_0xe14d('0xd')](function(_0x5bf8d4){logger[_0xe14d('0xe')](_0xe14d('0x20'),_0x10febc);logger[_0xe14d('0x11')]('UpdateSquareReport',_0x10febc,JSON[_0xe14d('0x13')](_0x5bf8d4));_0x1b4946(_0x5bf8d4);})[_0xe14d('0x18')](function(_0x579a9a){logger[_0xe14d('0x14')]('UpdateSquareReport',_0x579a9a['message'],_0x10febc);_0x12c3f6(_0x12d342[_0xe14d('0x14')](0x1f4,_0x579a9a[_0xe14d('0x16')]));});});};
\ No newline at end of file
+var _0xeb33=['../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','info','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','UpdateSquareReport','update','where','attributes','limit','lodash','util','bluebird','../../mysqldb'];(function(_0x4f32a7,_0x8b0e85){var _0x14d92d=function(_0x802b14){while(--_0x802b14){_0x4f32a7['push'](_0x4f32a7['shift']());}};_0x14d92d(++_0x8b0e85);}(_0xeb33,0x1eb));var _0x3eb3=function(_0x219a66,_0x3a1795){_0x219a66=_0x219a66-0x0;var _0x4fcc89=_0xeb33[_0x219a66];return _0x4fcc89;};'use strict';var _=require(_0x3eb3('0x0'));var util=require(_0x3eb3('0x1'));var moment=require('moment');var BPromise=require(_0x3eb3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3eb3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3eb3('0x4'))(_0x3eb3('0x5'));var config=require('../../config/environment');var jayson=require(_0x3eb3('0x6'));var client=jayson[_0x3eb3('0x7')][_0x3eb3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x35dd03,_0x973b2,_0x385971){return new BPromise(function(_0x895a65,_0xd145ac){return client[_0x3eb3('0x9')](_0x35dd03,_0x385971)[_0x3eb3('0xa')](function(_0x4bffeb){logger['info']('SquareReport,\x20%s,\x20%s',_0x973b2,_0x3eb3('0xb'));logger[_0x3eb3('0xc')](_0x3eb3('0xd'),_0x973b2,_0x3eb3('0xb'),JSON[_0x3eb3('0xe')](_0x4bffeb));if(_0x4bffeb[_0x3eb3('0xf')]){if(_0x4bffeb[_0x3eb3('0xf')][_0x3eb3('0x10')]===0x1f4){logger['error'](_0x3eb3('0x11'),_0x973b2,_0x4bffeb[_0x3eb3('0xf')][_0x3eb3('0x12')]);return _0xd145ac(_0x4bffeb[_0x3eb3('0xf')][_0x3eb3('0x12')]);}logger['error'](_0x3eb3('0x11'),_0x973b2,_0x4bffeb[_0x3eb3('0xf')]['message']);return _0x895a65(_0x4bffeb[_0x3eb3('0xf')][_0x3eb3('0x12')]);}else{logger[_0x3eb3('0x13')]('SquareReport,\x20%s,\x20%s',_0x973b2,_0x3eb3('0xb'));_0x895a65(_0x4bffeb[_0x3eb3('0x14')][_0x3eb3('0x12')]);}})[_0x3eb3('0x15')](function(_0xcb3c8a){logger['error'](_0x3eb3('0x11'),_0x973b2,_0xcb3c8a);_0xd145ac(_0xcb3c8a);});});}exports[_0x3eb3('0x16')]=function(_0x316aab){var _0x1cea6a=this;return new Promise(function(_0x3ee2c3,_0x1dc426){return db[_0x3eb3('0x17')][_0x3eb3('0x18')](_0x316aab[_0x3eb3('0x19')],{'raw':_0x316aab[_0x3eb3('0x1a')]?_0x316aab['options'][_0x3eb3('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0xec1b7f){logger[_0x3eb3('0x13')](_0x3eb3('0x16'),_0x316aab);logger['debug'](_0x3eb3('0x16'),_0x316aab,JSON[_0x3eb3('0xe')](_0xec1b7f));_0x3ee2c3(_0xec1b7f);})[_0x3eb3('0x15')](function(_0x4e619b){logger[_0x3eb3('0xf')](_0x3eb3('0x16'),_0x4e619b[_0x3eb3('0x12')],_0x316aab);_0x1dc426(_0x1cea6a[_0x3eb3('0xf')](0x1f4,_0x4e619b[_0x3eb3('0x12')]));});});};exports[_0x3eb3('0x1c')]=function(_0x532c87){var _0xe25bab=this;return new Promise(function(_0xaaf571,_0x199edd){return db[_0x3eb3('0x17')][_0x3eb3('0x1d')](_0x532c87[_0x3eb3('0x19')],{'raw':_0x532c87[_0x3eb3('0x1a')]?_0x532c87[_0x3eb3('0x1a')][_0x3eb3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x532c87['options']?_0x532c87[_0x3eb3('0x1a')][_0x3eb3('0x1e')]||null:null,'attributes':_0x532c87['options']?_0x532c87['options'][_0x3eb3('0x1f')]||null:null,'limit':_0x532c87[_0x3eb3('0x1a')]?_0x532c87[_0x3eb3('0x1a')][_0x3eb3('0x20')]||null:null})['then'](function(_0x3809d2){logger['info'](_0x3eb3('0x1c'),_0x532c87);logger[_0x3eb3('0xc')]('UpdateSquareReport',_0x532c87,JSON['stringify'](_0x3809d2));_0xaaf571(_0x3809d2);})['catch'](function(_0x3691b2){logger[_0x3eb3('0xf')](_0x3eb3('0x1c'),_0x3691b2[_0x3eb3('0x12')],_0x532c87);_0x199edd(_0xe25bab[_0x3eb3('0xf')](0x1f4,_0x3691b2[_0x3eb3('0x12')]));});});};
\ No newline at end of file
index ed34c2b..64dcc27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8904=['/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','get','/describe','describe'];(function(_0x4828f6,_0x25cc6b){var _0x57f785=function(_0x14ea78){while(--_0x14ea78){_0x4828f6['push'](_0x4828f6['shift']());}};_0x57f785(++_0x25cc6b);}(_0x8904,0x7b));var _0x4890=function(_0x2c1384,_0x462c08){_0x2c1384=_0x2c1384-0x0;var _0x47455a=_0x8904[_0x2c1384];return _0x47455a;};'use strict';var multer=require(_0x4890('0x0'));var util=require(_0x4890('0x1'));var path=require(_0x4890('0x2'));var timeout=require(_0x4890('0x3'));var express=require(_0x4890('0x4'));var router=express[_0x4890('0x5')]();var fs_extra=require(_0x4890('0x6'));var auth=require(_0x4890('0x7'));var interaction=require(_0x4890('0x8'));var config=require(_0x4890('0x9'));var controller=require(_0x4890('0xa'));router['get']('/',auth[_0x4890('0xb')](),controller['index']);router[_0x4890('0xc')](_0x4890('0xd'),auth[_0x4890('0xb')](),controller[_0x4890('0xe')]);router['get'](_0x4890('0xf'),auth['isAuthenticated'](),controller[_0x4890('0x10')]);router[_0x4890('0x11')]('/',auth['isAuthenticated'](),controller[_0x4890('0x12')]);router[_0x4890('0x13')](_0x4890('0xf'),auth[_0x4890('0xb')](),controller['update']);router[_0x4890('0x14')]('/:id',auth[_0x4890('0xb')](),controller[_0x4890('0x15')]);module[_0x4890('0x16')]=router;
\ No newline at end of file
+var _0xe03a=['/describe','describe','/:id','show','create','put','update','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index'];(function(_0x5b3143,_0x184dfb){var _0x3c56df=function(_0x4a9690){while(--_0x4a9690){_0x5b3143['push'](_0x5b3143['shift']());}};_0x3c56df(++_0x184dfb);}(_0xe03a,0xd0));var _0xae03=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe03a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xae03('0x0'));var util=require(_0xae03('0x1'));var path=require(_0xae03('0x2'));var timeout=require(_0xae03('0x3'));var express=require(_0xae03('0x4'));var router=express['Router']();var fs_extra=require(_0xae03('0x5'));var auth=require(_0xae03('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xae03('0x7'));var controller=require(_0xae03('0x8'));router[_0xae03('0x9')]('/',auth[_0xae03('0xa')](),controller[_0xae03('0xb')]);router[_0xae03('0x9')](_0xae03('0xc'),auth[_0xae03('0xa')](),controller[_0xae03('0xd')]);router[_0xae03('0x9')](_0xae03('0xe'),auth[_0xae03('0xa')](),controller[_0xae03('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xae03('0x10')]);router[_0xae03('0x11')](_0xae03('0xe'),auth[_0xae03('0xa')](),controller[_0xae03('0x12')]);router[_0xae03('0x13')](_0xae03('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 0d94221..1935b96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0931=['TEXT','sequelize','STRING'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x0931,0x163));var _0x1093=function(_0x217476,_0x2a197f){_0x217476=_0x217476-0x0;var _0x47cdb1=_0x0931[_0x217476];return _0x47cdb1;};'use strict';var Sequelize=require(_0x1093('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x1093('0x1')]},'node':{'type':Sequelize[_0x1093('0x1')]},'application':{'type':Sequelize[_0x1093('0x1')]},'data':{'type':Sequelize[_0x1093('0x2')]},'project_name':{'type':Sequelize[_0x1093('0x1')]},'callerid':{'type':Sequelize[_0x1093('0x1')]}};
\ No newline at end of file
+var _0x9c5e=['TEXT','sequelize','exports','STRING'];(function(_0xd2e2ab,_0x2440cf){var _0x1703a2=function(_0x23deba){while(--_0x23deba){_0xd2e2ab['push'](_0xd2e2ab['shift']());}};_0x1703a2(++_0x2440cf);}(_0x9c5e,0x8d));var _0xe9c5=function(_0x22c51b,_0x5d1d66){_0x22c51b=_0x22c51b-0x0;var _0x396bf2=_0x9c5e[_0x22c51b];return _0x396bf2;};'use strict';var Sequelize=require(_0xe9c5('0x0'));module[_0xe9c5('0x1')]={'uniqueid':{'type':Sequelize[_0xe9c5('0x2')]},'node':{'type':Sequelize[_0xe9c5('0x2')]},'application':{'type':Sequelize[_0xe9c5('0x2')]},'data':{'type':Sequelize[_0xe9c5('0x3')]},'project_name':{'type':Sequelize[_0xe9c5('0x2')]},'callerid':{'type':Sequelize[_0xe9c5('0x2')]}};
\ No newline at end of file
index b20cc0d..32857de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f78=['end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','name','index','SquareDetailsReport','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','filter','merge','type','includeAll','include','findAll','rows','then','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x5869f5,_0x176fd5){var _0x6beba1=function(_0x253e04){while(--_0x253e04){_0x5869f5['push'](_0x5869f5['shift']());}};_0x6beba1(++_0x176fd5);}(_0x2f78,0x162));var _0x82f7=function(_0x6cf3f4,_0x1bc3b9){_0x6cf3f4=_0x6cf3f4-0x0;var _0x165f6e=_0x2f78[_0x6cf3f4];return _0x165f6e;};'use strict';var emlformat=require(_0x82f7('0x0'));var rimraf=require(_0x82f7('0x1'));var zipdir=require(_0x82f7('0x2'));var jsonpatch=require(_0x82f7('0x3'));var rp=require(_0x82f7('0x4'));var moment=require(_0x82f7('0x5'));var BPromise=require(_0x82f7('0x6'));var Mustache=require(_0x82f7('0x7'));var util=require(_0x82f7('0x8'));var path=require(_0x82f7('0x9'));var sox=require(_0x82f7('0xa'));var csv=require(_0x82f7('0xb'));var ejs=require(_0x82f7('0xc'));var fs=require('fs');var fs_extra=require(_0x82f7('0xd'));var _=require(_0x82f7('0xe'));var squel=require(_0x82f7('0xf'));var crypto=require(_0x82f7('0x10'));var jsforce=require(_0x82f7('0x11'));var deskjs=require(_0x82f7('0x12'));var toCsv=require(_0x82f7('0xb'));var querystring=require(_0x82f7('0x13'));var Papa=require(_0x82f7('0x14'));var Redis=require('ioredis');var authService=require(_0x82f7('0x15'));var qs=require(_0x82f7('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82f7('0x17'));var logger=require(_0x82f7('0x18'))(_0x82f7('0x19'));var utils=require('../../config/utils');var config=require(_0x82f7('0x1a'));var licenseUtil=require(_0x82f7('0x1b'));var db=require(_0x82f7('0x1c'))['db'];function respondWithStatusCode(_0x22fdb2,_0x1b092f){_0x1b092f=_0x1b092f||0xcc;return function(_0x2bbb44){if(_0x2bbb44){return _0x22fdb2[_0x82f7('0x1d')](_0x1b092f);}return _0x22fdb2[_0x82f7('0x1e')](_0x1b092f)[_0x82f7('0x1f')]();};}function respondWithResult(_0x292185,_0x5af604){_0x5af604=_0x5af604||0xc8;return function(_0x5ac1b9){if(_0x5ac1b9){return _0x292185[_0x82f7('0x1e')](_0x5af604)[_0x82f7('0x20')](_0x5ac1b9);}};}function respondWithFilteredResult(_0x2d4f23,_0x2046f7){return function(_0x5399a4){if(_0x5399a4){var _0x74e261=typeof _0x2046f7[_0x82f7('0x21')]===_0x82f7('0x22')&&typeof _0x2046f7['limit']===_0x82f7('0x22');var _0x31a3c9=_0x5399a4[_0x82f7('0x23')];var _0x3a0ecc=_0x74e261?0x0:_0x2046f7[_0x82f7('0x21')];var _0x375e27=_0x74e261?_0x5399a4['count']:_0x2046f7[_0x82f7('0x21')]+_0x2046f7['limit'];var _0x47d67e;if(_0x375e27>=_0x31a3c9){_0x375e27=_0x31a3c9;_0x47d67e=0xc8;}else{_0x47d67e=0xce;}_0x2d4f23[_0x82f7('0x1e')](_0x47d67e);return _0x2d4f23[_0x82f7('0x24')](_0x82f7('0x25'),_0x3a0ecc+'-'+_0x375e27+'/'+_0x31a3c9)[_0x82f7('0x20')](_0x5399a4);}return null;};}function patchUpdates(_0x87b6fa){return function(_0x22ea1a){try{jsonpatch[_0x82f7('0x26')](_0x22ea1a,_0x87b6fa,!![]);}catch(_0x56bea1){return BPromise[_0x82f7('0x27')](_0x56bea1);}return _0x22ea1a[_0x82f7('0x28')]();};}function saveUpdates(_0x3be70b,_0x3d7376){return function(_0x306127){if(_0x306127){return _0x306127[_0x82f7('0x29')](_0x3be70b)['then'](function(_0x40cb0f){return _0x40cb0f;});}return null;};}function removeEntity(_0x5d2d89,_0x260af6){return function(_0x8954a8){if(_0x8954a8){return _0x8954a8[_0x82f7('0x2a')]()['then'](function(){_0x5d2d89['status'](0xcc)[_0x82f7('0x1f')]();});}};}function handleEntityNotFound(_0x6b028,_0x72ce54){return function(_0xf6ad3f){if(!_0xf6ad3f){_0x6b028['sendStatus'](0x194);}return _0xf6ad3f;};}function handleError(_0x5157c1,_0x2c0ba4){_0x2c0ba4=_0x2c0ba4||0x1f4;return function(_0x49800a){logger['error'](_0x49800a['stack']);if(_0x49800a[_0x82f7('0x2b')]){delete _0x49800a[_0x82f7('0x2b')];}_0x5157c1['status'](_0x2c0ba4)['send'](_0x49800a);};}exports[_0x82f7('0x2c')]=function(_0x4002cd,_0x43a8fc){var _0x42ba57={},_0xbe6d35={},_0x3bf323={'count':0x0,'rows':[]};var _0x30f508=_['map'](db[_0x82f7('0x2d')]['rawAttributes'],function(_0x155275){return{'name':_0x155275['fieldName'],'type':_0x155275['type'][_0x82f7('0x2e')]};});_0xbe6d35[_0x82f7('0x2f')]=_[_0x82f7('0x30')](_0x30f508,'name');_0xbe6d35[_0x82f7('0x31')]=_[_0x82f7('0x32')](_0x4002cd['query']);_0xbe6d35['filters']=_[_0x82f7('0x33')](_0xbe6d35['model'],_0xbe6d35[_0x82f7('0x31')]);_0x42ba57[_0x82f7('0x34')]=_[_0x82f7('0x33')](_0xbe6d35[_0x82f7('0x2f')],qs['fields'](_0x4002cd['query'][_0x82f7('0x35')]));_0x42ba57[_0x82f7('0x34')]=_0x42ba57['attributes'][_0x82f7('0x36')]?_0x42ba57[_0x82f7('0x34')]:_0xbe6d35[_0x82f7('0x2f')];if(!_0x4002cd[_0x82f7('0x31')][_0x82f7('0x37')]('nolimit')){_0x42ba57[_0x82f7('0x38')]=qs['limit'](_0x4002cd[_0x82f7('0x31')][_0x82f7('0x38')]);_0x42ba57[_0x82f7('0x21')]=qs['offset'](_0x4002cd['query'][_0x82f7('0x21')]);}_0x42ba57[_0x82f7('0x39')]=qs[_0x82f7('0x3a')](_0x4002cd['query']['sort']);_0x42ba57[_0x82f7('0x3b')]=qs[_0x82f7('0x3c')](_['pick'](_0x4002cd['query'],_0xbe6d35[_0x82f7('0x3c')]),_0x30f508);if(_0x4002cd[_0x82f7('0x31')][_0x82f7('0x3d')]){_0x42ba57['where']=_[_0x82f7('0x3e')](_0x42ba57[_0x82f7('0x3b')],{'$or':_['map'](_0x30f508,function(_0x409424){if(_0x409424[_0x82f7('0x3f')]!=='VIRTUAL'){var _0xc32fc6={};_0xc32fc6[_0x409424[_0x82f7('0x2b')]]={'$like':'%'+_0x4002cd[_0x82f7('0x31')]['filter']+'%'};return _0xc32fc6;}})});}_0x42ba57=_[_0x82f7('0x3e')]({},_0x42ba57,_0x4002cd['options']);var _0x5778b8={'where':_0x42ba57[_0x82f7('0x3b')]};return db[_0x82f7('0x2d')]['count'](_0x5778b8)['then'](function(_0x47002a){_0x3bf323[_0x82f7('0x23')]=_0x47002a;if(_0x4002cd['query'][_0x82f7('0x40')]){_0x42ba57[_0x82f7('0x41')]=[{'all':!![]}];}return db[_0x82f7('0x2d')][_0x82f7('0x42')](_0x42ba57);})['then'](function(_0x1d0572){_0x3bf323[_0x82f7('0x43')]=_0x1d0572;return _0x3bf323;})[_0x82f7('0x44')](respondWithFilteredResult(_0x43a8fc,_0x42ba57))[_0x82f7('0x45')](handleError(_0x43a8fc,null));};exports[_0x82f7('0x46')]=function(_0x31585c,_0x518057){var _0x345c13={'raw':!![],'where':{'id':_0x31585c[_0x82f7('0x47')]['id']}},_0x35b59e={};_0x35b59e[_0x82f7('0x2f')]=_[_0x82f7('0x32')](db[_0x82f7('0x2d')][_0x82f7('0x48')]);_0x35b59e[_0x82f7('0x31')]=_[_0x82f7('0x32')](_0x31585c[_0x82f7('0x31')]);_0x35b59e[_0x82f7('0x3c')]=_['intersection'](_0x35b59e[_0x82f7('0x2f')],_0x35b59e['query']);_0x345c13['attributes']=_[_0x82f7('0x33')](_0x35b59e[_0x82f7('0x2f')],qs[_0x82f7('0x35')](_0x31585c[_0x82f7('0x31')][_0x82f7('0x35')]));_0x345c13[_0x82f7('0x34')]=_0x345c13[_0x82f7('0x34')][_0x82f7('0x36')]?_0x345c13['attributes']:_0x35b59e['model'];if(_0x31585c[_0x82f7('0x31')]['includeAll']){_0x345c13['include']=[{'all':!![]}];}_0x345c13=_[_0x82f7('0x3e')]({},_0x345c13,_0x31585c['options']);return db[_0x82f7('0x2d')]['find'](_0x345c13)['then'](handleEntityNotFound(_0x518057,null))[_0x82f7('0x44')](respondWithResult(_0x518057,null))[_0x82f7('0x45')](handleError(_0x518057,null));};exports[_0x82f7('0x49')]=function(_0x37c1bd,_0x10607f){return db[_0x82f7('0x2d')][_0x82f7('0x49')](_0x37c1bd[_0x82f7('0x4a')],{})[_0x82f7('0x44')](respondWithResult(_0x10607f,0xc9))[_0x82f7('0x45')](handleError(_0x10607f,null));};exports[_0x82f7('0x29')]=function(_0x483f7a,_0x160179){if(_0x483f7a[_0x82f7('0x4a')]['id']){delete _0x483f7a[_0x82f7('0x4a')]['id'];}return db[_0x82f7('0x2d')][_0x82f7('0x4b')]({'where':{'id':_0x483f7a['params']['id']}})[_0x82f7('0x44')](handleEntityNotFound(_0x160179,null))[_0x82f7('0x44')](saveUpdates(_0x483f7a[_0x82f7('0x4a')],null))[_0x82f7('0x44')](respondWithResult(_0x160179,null))['catch'](handleError(_0x160179,null));};exports[_0x82f7('0x2a')]=function(_0x364dfe,_0x299b5f){return db[_0x82f7('0x2d')][_0x82f7('0x4b')]({'where':{'id':_0x364dfe[_0x82f7('0x47')]['id']}})[_0x82f7('0x44')](handleEntityNotFound(_0x299b5f,null))[_0x82f7('0x44')](removeEntity(_0x299b5f,null))[_0x82f7('0x45')](handleError(_0x299b5f,null));};exports[_0x82f7('0x4c')]=function(_0x22c1cd,_0x3db26c){return db[_0x82f7('0x2d')][_0x82f7('0x4c')]()[_0x82f7('0x44')](respondWithResult(_0x3db26c,null))[_0x82f7('0x45')](handleError(_0x3db26c,null));};
\ No newline at end of file
+var _0xb803=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','SquareDetailsReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','describe'];(function(_0x2e43a3,_0x45b80c){var _0x3fb5e1=function(_0x52a178){while(--_0x52a178){_0x2e43a3['push'](_0x2e43a3['shift']());}};_0x3fb5e1(++_0x45b80c);}(_0xb803,0xea));var _0x3b80=function(_0x5e0205,_0x3aa2c6){_0x5e0205=_0x5e0205-0x0;var _0x1565a8=_0xb803[_0x5e0205];return _0x1565a8;};'use strict';var emlformat=require(_0x3b80('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3b80('0x1'));var jsonpatch=require(_0x3b80('0x2'));var rp=require(_0x3b80('0x3'));var moment=require(_0x3b80('0x4'));var BPromise=require(_0x3b80('0x5'));var Mustache=require(_0x3b80('0x6'));var util=require(_0x3b80('0x7'));var path=require(_0x3b80('0x8'));var sox=require(_0x3b80('0x9'));var csv=require(_0x3b80('0xa'));var ejs=require(_0x3b80('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3b80('0xc'));var squel=require(_0x3b80('0xd'));var crypto=require(_0x3b80('0xe'));var jsforce=require(_0x3b80('0xf'));var deskjs=require(_0x3b80('0x10'));var toCsv=require(_0x3b80('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3b80('0x11'));var authService=require(_0x3b80('0x12'));var qs=require(_0x3b80('0x13'));var as=require(_0x3b80('0x14'));var hardwareService=require(_0x3b80('0x15'));var logger=require(_0x3b80('0x16'))(_0x3b80('0x17'));var utils=require(_0x3b80('0x18'));var config=require(_0x3b80('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b80('0x1a'))['db'];function respondWithStatusCode(_0x1900a4,_0x4dae5e){_0x4dae5e=_0x4dae5e||0xcc;return function(_0x53ed89){if(_0x53ed89){return _0x1900a4[_0x3b80('0x1b')](_0x4dae5e);}return _0x1900a4[_0x3b80('0x1c')](_0x4dae5e)[_0x3b80('0x1d')]();};}function respondWithResult(_0x1b4e9e,_0x2f9a61){_0x2f9a61=_0x2f9a61||0xc8;return function(_0x12bdd4){if(_0x12bdd4){return _0x1b4e9e[_0x3b80('0x1c')](_0x2f9a61)[_0x3b80('0x1e')](_0x12bdd4);}};}function respondWithFilteredResult(_0x2d4248,_0xd2e5fb){return function(_0x2f98c3){if(_0x2f98c3){var _0x1abb00=typeof _0xd2e5fb[_0x3b80('0x1f')]===_0x3b80('0x20')&&typeof _0xd2e5fb['limit']===_0x3b80('0x20');var _0x7c229d=_0x2f98c3[_0x3b80('0x21')];var _0x4a7b4a=_0x1abb00?0x0:_0xd2e5fb[_0x3b80('0x1f')];var _0x5dd986=_0x1abb00?_0x2f98c3[_0x3b80('0x21')]:_0xd2e5fb[_0x3b80('0x1f')]+_0xd2e5fb[_0x3b80('0x22')];var _0x8cc58d;if(_0x5dd986>=_0x7c229d){_0x5dd986=_0x7c229d;_0x8cc58d=0xc8;}else{_0x8cc58d=0xce;}_0x2d4248[_0x3b80('0x1c')](_0x8cc58d);return _0x2d4248[_0x3b80('0x23')](_0x3b80('0x24'),_0x4a7b4a+'-'+_0x5dd986+'/'+_0x7c229d)[_0x3b80('0x1e')](_0x2f98c3);}return null;};}function patchUpdates(_0x5d5438){return function(_0x3f0c0f){try{jsonpatch[_0x3b80('0x25')](_0x3f0c0f,_0x5d5438,!![]);}catch(_0x30aff1){return BPromise[_0x3b80('0x26')](_0x30aff1);}return _0x3f0c0f[_0x3b80('0x27')]();};}function saveUpdates(_0x407778,_0x22310a){return function(_0x463ba5){if(_0x463ba5){return _0x463ba5[_0x3b80('0x28')](_0x407778)[_0x3b80('0x29')](function(_0x106c7f){return _0x106c7f;});}return null;};}function removeEntity(_0x20bfff,_0x3169cc){return function(_0x151302){if(_0x151302){return _0x151302[_0x3b80('0x2a')]()[_0x3b80('0x29')](function(){_0x20bfff[_0x3b80('0x1c')](0xcc)[_0x3b80('0x1d')]();});}};}function handleEntityNotFound(_0x256c9e,_0x17bfb1){return function(_0x27d321){if(!_0x27d321){_0x256c9e['sendStatus'](0x194);}return _0x27d321;};}function handleError(_0x4fdc46,_0x3eb26b){_0x3eb26b=_0x3eb26b||0x1f4;return function(_0x42b394){logger[_0x3b80('0x2b')](_0x42b394[_0x3b80('0x2c')]);if(_0x42b394[_0x3b80('0x2d')]){delete _0x42b394['name'];}_0x4fdc46[_0x3b80('0x1c')](_0x3eb26b)['send'](_0x42b394);};}exports['index']=function(_0x6ef3d5,_0x2fa32d){var _0x517d03={},_0x481828={},_0x175a03={'count':0x0,'rows':[]};var _0x3074b5=_['map'](db[_0x3b80('0x2e')][_0x3b80('0x2f')],function(_0x1ea139){return{'name':_0x1ea139[_0x3b80('0x30')],'type':_0x1ea139[_0x3b80('0x31')]['key']};});_0x481828[_0x3b80('0x32')]=_['map'](_0x3074b5,_0x3b80('0x2d'));_0x481828[_0x3b80('0x33')]=_[_0x3b80('0x34')](_0x6ef3d5['query']);_0x481828[_0x3b80('0x35')]=_[_0x3b80('0x36')](_0x481828[_0x3b80('0x32')],_0x481828['query']);_0x517d03[_0x3b80('0x37')]=_['intersection'](_0x481828[_0x3b80('0x32')],qs['fields'](_0x6ef3d5['query'][_0x3b80('0x38')]));_0x517d03['attributes']=_0x517d03[_0x3b80('0x37')]['length']?_0x517d03['attributes']:_0x481828[_0x3b80('0x32')];if(!_0x6ef3d5[_0x3b80('0x33')][_0x3b80('0x39')](_0x3b80('0x3a'))){_0x517d03['limit']=qs[_0x3b80('0x22')](_0x6ef3d5[_0x3b80('0x33')][_0x3b80('0x22')]);_0x517d03[_0x3b80('0x1f')]=qs[_0x3b80('0x1f')](_0x6ef3d5[_0x3b80('0x33')][_0x3b80('0x1f')]);}_0x517d03[_0x3b80('0x3b')]=qs[_0x3b80('0x3c')](_0x6ef3d5[_0x3b80('0x33')][_0x3b80('0x3c')]);_0x517d03['where']=qs[_0x3b80('0x35')](_[_0x3b80('0x3d')](_0x6ef3d5[_0x3b80('0x33')],_0x481828[_0x3b80('0x35')]),_0x3074b5);if(_0x6ef3d5[_0x3b80('0x33')][_0x3b80('0x3e')]){_0x517d03['where']=_[_0x3b80('0x3f')](_0x517d03[_0x3b80('0x40')],{'$or':_['map'](_0x3074b5,function(_0x20dc85){if(_0x20dc85[_0x3b80('0x31')]!==_0x3b80('0x41')){var _0xc51a1b={};_0xc51a1b[_0x20dc85[_0x3b80('0x2d')]]={'$like':'%'+_0x6ef3d5[_0x3b80('0x33')][_0x3b80('0x3e')]+'%'};return _0xc51a1b;}})});}_0x517d03=_['merge']({},_0x517d03,_0x6ef3d5['options']);var _0x27ceee={'where':_0x517d03[_0x3b80('0x40')]};return db[_0x3b80('0x2e')]['count'](_0x27ceee)[_0x3b80('0x29')](function(_0xbadfba){_0x175a03[_0x3b80('0x21')]=_0xbadfba;if(_0x6ef3d5[_0x3b80('0x33')][_0x3b80('0x42')]){_0x517d03[_0x3b80('0x43')]=[{'all':!![]}];}return db[_0x3b80('0x2e')][_0x3b80('0x44')](_0x517d03);})['then'](function(_0x3d2d28){_0x175a03[_0x3b80('0x45')]=_0x3d2d28;return _0x175a03;})['then'](respondWithFilteredResult(_0x2fa32d,_0x517d03))[_0x3b80('0x46')](handleError(_0x2fa32d,null));};exports[_0x3b80('0x47')]=function(_0x2ebac7,_0x4cbbe5){var _0x228780={'raw':!![],'where':{'id':_0x2ebac7['params']['id']}},_0x178a22={};_0x178a22['model']=_[_0x3b80('0x34')](db[_0x3b80('0x2e')][_0x3b80('0x2f')]);_0x178a22[_0x3b80('0x33')]=_[_0x3b80('0x34')](_0x2ebac7[_0x3b80('0x33')]);_0x178a22[_0x3b80('0x35')]=_[_0x3b80('0x36')](_0x178a22[_0x3b80('0x32')],_0x178a22[_0x3b80('0x33')]);_0x228780[_0x3b80('0x37')]=_['intersection'](_0x178a22['model'],qs['fields'](_0x2ebac7[_0x3b80('0x33')][_0x3b80('0x38')]));_0x228780[_0x3b80('0x37')]=_0x228780[_0x3b80('0x37')][_0x3b80('0x48')]?_0x228780[_0x3b80('0x37')]:_0x178a22[_0x3b80('0x32')];if(_0x2ebac7[_0x3b80('0x33')][_0x3b80('0x42')]){_0x228780['include']=[{'all':!![]}];}_0x228780=_[_0x3b80('0x3f')]({},_0x228780,_0x2ebac7['options']);return db[_0x3b80('0x2e')][_0x3b80('0x49')](_0x228780)[_0x3b80('0x29')](handleEntityNotFound(_0x4cbbe5,null))[_0x3b80('0x29')](respondWithResult(_0x4cbbe5,null))[_0x3b80('0x46')](handleError(_0x4cbbe5,null));};exports[_0x3b80('0x4a')]=function(_0x157c33,_0x489855){return db[_0x3b80('0x2e')][_0x3b80('0x4a')](_0x157c33[_0x3b80('0x4b')],{})[_0x3b80('0x29')](respondWithResult(_0x489855,0xc9))[_0x3b80('0x46')](handleError(_0x489855,null));};exports['update']=function(_0x27ea70,_0x408ceb){if(_0x27ea70[_0x3b80('0x4b')]['id']){delete _0x27ea70['body']['id'];}return db[_0x3b80('0x2e')][_0x3b80('0x49')]({'where':{'id':_0x27ea70[_0x3b80('0x4c')]['id']}})['then'](handleEntityNotFound(_0x408ceb,null))[_0x3b80('0x29')](saveUpdates(_0x27ea70[_0x3b80('0x4b')],null))[_0x3b80('0x29')](respondWithResult(_0x408ceb,null))[_0x3b80('0x46')](handleError(_0x408ceb,null));};exports[_0x3b80('0x2a')]=function(_0x42d7ad,_0x194647){return db['SquareDetailsReport'][_0x3b80('0x49')]({'where':{'id':_0x42d7ad[_0x3b80('0x4c')]['id']}})[_0x3b80('0x29')](handleEntityNotFound(_0x194647,null))[_0x3b80('0x29')](removeEntity(_0x194647,null))[_0x3b80('0x46')](handleError(_0x194647,null));};exports[_0x3b80('0x4d')]=function(_0x35a53a,_0x28ae6b){return db[_0x3b80('0x2e')][_0x3b80('0x4d')]()[_0x3b80('0x29')](respondWithResult(_0x28ae6b,null))[_0x3b80('0x46')](handleError(_0x28ae6b,null));};
\ No newline at end of file
index ce3e7a5..d5b10a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe3c=['define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports'];(function(_0x35d775,_0x25431e){var _0x59384d=function(_0x1a0c15){while(--_0x1a0c15){_0x35d775['push'](_0x35d775['shift']());}};_0x59384d(++_0x25431e);}(_0xbe3c,0x76));var _0xcbe3=function(_0xef2a14,_0x4c359a){_0xef2a14=_0xef2a14-0x0;var _0x242a4d=_0xbe3c[_0xef2a14];return _0x242a4d;};'use strict';var _=require(_0xcbe3('0x0'));var util=require(_0xcbe3('0x1'));var logger=require(_0xcbe3('0x2'))(_0xcbe3('0x3'));var moment=require(_0xcbe3('0x4'));var BPromise=require(_0xcbe3('0x5'));var rp=require(_0xcbe3('0x6'));var fs=require('fs');var path=require(_0xcbe3('0x7'));var rimraf=require(_0xcbe3('0x8'));var config=require(_0xcbe3('0x9'));var attributes=require(_0xcbe3('0xa'));module[_0xcbe3('0xb')]=function(_0x24c4eb,_0x4e9d0b){return _0x24c4eb[_0xcbe3('0xc')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9e4d=['rimraf','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x53273a,_0x5ed978){var _0x3c41db=function(_0x491a57){while(--_0x491a57){_0x53273a['push'](_0x53273a['shift']());}};_0x3c41db(++_0x5ed978);}(_0x9e4d,0x1f1));var _0xd9e4=function(_0x5ebd36,_0x21274a){_0x5ebd36=_0x5ebd36-0x0;var _0x9047ed=_0x9e4d[_0x5ebd36];return _0x9047ed;};'use strict';var _=require(_0xd9e4('0x0'));var util=require(_0xd9e4('0x1'));var logger=require('../../config/logger')(_0xd9e4('0x2'));var moment=require(_0xd9e4('0x3'));var BPromise=require(_0xd9e4('0x4'));var rp=require(_0xd9e4('0x5'));var fs=require('fs');var path=require(_0xd9e4('0x6'));var rimraf=require(_0xd9e4('0x7'));var config=require(_0xd9e4('0x8'));var attributes=require(_0xd9e4('0x9'));module[_0xd9e4('0xa')]=function(_0x3ede50,_0x26cddc){return _0x3ede50['define'](_0xd9e4('0xb'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 00f8eff..3338897 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe511=['options','raw','then','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareDetailsReport','SquareDetailsReport','body'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xe511,0x16f));var _0x1e51=function(_0x18e80c,_0x4077f7){_0x18e80c=_0x18e80c-0x0;var _0x183ba9=_0xe511[_0x18e80c];return _0x183ba9;};'use strict';var _=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var moment=require('moment');var BPromise=require(_0x1e51('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e51('0x3'));var db=require(_0x1e51('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1e51('0x5'))(_0x1e51('0x6'));var config=require(_0x1e51('0x7'));var jayson=require(_0x1e51('0x8'));var client=jayson['client'][_0x1e51('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21ed6b,_0x5c4590,_0x4fa2ba){return new BPromise(function(_0x394ad8,_0x133021){return client['request'](_0x21ed6b,_0x4fa2ba)['then'](function(_0x658941){logger[_0x1e51('0xa')](_0x1e51('0xb'),_0x5c4590,_0x1e51('0xc'));logger[_0x1e51('0xd')](_0x1e51('0xe'),_0x5c4590,'request\x20sent',JSON[_0x1e51('0xf')](_0x658941));if(_0x658941[_0x1e51('0x10')]){if(_0x658941[_0x1e51('0x10')][_0x1e51('0x11')]===0x1f4){logger[_0x1e51('0x10')](_0x1e51('0xb'),_0x5c4590,_0x658941['error'][_0x1e51('0x12')]);return _0x133021(_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);}logger[_0x1e51('0x10')](_0x1e51('0xb'),_0x5c4590,_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);return _0x394ad8(_0x658941[_0x1e51('0x10')][_0x1e51('0x12')]);}else{logger[_0x1e51('0xa')]('SquareDetailsReport,\x20%s,\x20%s',_0x5c4590,_0x1e51('0xc'));_0x394ad8(_0x658941[_0x1e51('0x13')][_0x1e51('0x12')]);}})['catch'](function(_0xa3b410){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x5c4590,_0xa3b410);_0x133021(_0xa3b410);});});}exports[_0x1e51('0x14')]=function(_0x27dcad){var _0x40ae4c=this;return new Promise(function(_0x4785a5,_0x4d1aae){return db[_0x1e51('0x15')]['create'](_0x27dcad[_0x1e51('0x16')],{'raw':_0x27dcad['options']?_0x27dcad[_0x1e51('0x17')][_0x1e51('0x18')]===undefined?!![]:![]:!![]})[_0x1e51('0x19')](function(_0x183a95){logger['info']('CreateSquareDetailsReport',_0x27dcad);logger['debug']('CreateSquareDetailsReport',_0x27dcad,JSON[_0x1e51('0xf')](_0x183a95));_0x4785a5(_0x183a95);})['catch'](function(_0x3f7340){logger[_0x1e51('0x10')](_0x1e51('0x14'),_0x3f7340[_0x1e51('0x12')],_0x27dcad);_0x4d1aae(_0x40ae4c[_0x1e51('0x10')](0x1f4,_0x3f7340[_0x1e51('0x12')]));});});};
\ No newline at end of file
+var _0xa30a=['message','request\x20sent','CreateSquareDetailsReport','create','body','debug','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5d860f,_0x467498){var _0x236490=function(_0x5e045c){while(--_0x5e045c){_0x5d860f['push'](_0x5d860f['shift']());}};_0x236490(++_0x467498);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var moment=require(_0xaa30('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa30('0x3'));var fs=require('fs');var Redis=require(_0xaa30('0x4'));var db=require(_0xaa30('0x5'))['db'];var utils=require(_0xaa30('0x6'));var logger=require(_0xaa30('0x7'))(_0xaa30('0x8'));var config=require(_0xaa30('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa30('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8af448,_0x14fe09,_0x42dc22){return new BPromise(function(_0x5d076a,_0xedbc45){return client[_0xaa30('0xb')](_0x8af448,_0x42dc22)[_0xaa30('0xc')](function(_0x59d028){logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,'request\x20sent');logger['debug'](_0xaa30('0xf'),_0x14fe09,'request\x20sent',JSON[_0xaa30('0x10')](_0x59d028));if(_0x59d028[_0xaa30('0x11')]){if(_0x59d028[_0xaa30('0x11')][_0xaa30('0x12')]===0x1f4){logger['error'](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0xedbc45(_0x59d028['error'][_0xaa30('0x13')]);}logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0x5d076a(_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);}else{logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,_0xaa30('0x14'));_0x5d076a(_0x59d028['result'][_0xaa30('0x13')]);}})['catch'](function(_0x5eb356){logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x5eb356);_0xedbc45(_0x5eb356);});});}exports[_0xaa30('0x15')]=function(_0x540e36){var _0x54fa49=this;return new Promise(function(_0x53f9fd,_0x23ad3b){return db['SquareDetailsReport'][_0xaa30('0x16')](_0x540e36[_0xaa30('0x17')],{'raw':_0x540e36['options']?_0x540e36['options']['raw']===undefined?!![]:![]:!![]})[_0xaa30('0xc')](function(_0x3e4f1d){logger[_0xaa30('0xd')](_0xaa30('0x15'),_0x540e36);logger[_0xaa30('0x18')]('CreateSquareDetailsReport',_0x540e36,JSON[_0xaa30('0x10')](_0x3e4f1d));_0x53f9fd(_0x3e4f1d);})[_0xaa30('0x19')](function(_0x2e16e7){logger[_0xaa30('0x11')](_0xaa30('0x15'),_0x2e16e7['message'],_0x540e36);_0x23ad3b(_0x54fa49[_0xaa30('0x11')](0x1f4,_0x2e16e7[_0xaa30('0x13')]));});});};
\ No newline at end of file
index 8f39696..d323ad3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc562=['/process/:pid/kill','isAuthenticated','killProcess','exports','Router','./system.controller','index','get'];(function(_0x57120e,_0x427d2d){var _0x1539f5=function(_0x5864ed){while(--_0x5864ed){_0x57120e['push'](_0x57120e['shift']());}};_0x1539f5(++_0x427d2d);}(_0xc562,0x1f4));var _0x2c56=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xc562[_0x160c73];return _0xd9302;};'use strict';var express=require('express');var router=express[_0x2c56('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x2c56('0x1'));router['get']('/',auth['isAuthenticated'](),controller[_0x2c56('0x2')]);router[_0x2c56('0x3')](_0x2c56('0x4'),auth[_0x2c56('0x5')](),controller[_0x2c56('0x6')]);module[_0x2c56('0x7')]=router;
\ No newline at end of file
+var _0xdbaf=['get','index','/process/:pid/kill','isAuthenticated','exports','express','Router','../../components/auth/service','./system.controller'];(function(_0x1e6665,_0x48415b){var _0x3c5bce=function(_0x3bf6be){while(--_0x3bf6be){_0x1e6665['push'](_0x1e6665['shift']());}};_0x3c5bce(++_0x48415b);}(_0xdbaf,0xcb));var _0xfdba=function(_0x5ab594,_0x536ccc){_0x5ab594=_0x5ab594-0x0;var _0x223286=_0xdbaf[_0x5ab594];return _0x223286;};'use strict';var express=require(_0xfdba('0x0'));var router=express[_0xfdba('0x1')]();var auth=require(_0xfdba('0x2'));var controller=require(_0xfdba('0x3'));router[_0xfdba('0x4')]('/',auth['isAuthenticated'](),controller[_0xfdba('0x5')]);router[_0xfdba('0x4')](_0xfdba('0x6'),auth[_0xfdba('0x7')](),controller['killProcess']);module[_0xfdba('0x8')]=router;
\ No newline at end of file
index 2b99e18..70b5203 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf459=['indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','pid','SIGINT','killProcess','systeminformation','child_process','exec','../../config/logger','error','inspect','name','status','send','index','getAllData','then','json','catch','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params'];(function(_0x593627,_0x12a6aa){var _0x49d42a=function(_0x22089a){while(--_0x22089a){_0x593627['push'](_0x593627['shift']());}};_0x49d42a(++_0x12a6aa);}(_0xf459,0x10f));var _0x9f45=function(_0x597484,_0x199340){_0x597484=_0x597484-0x0;var _0x218e64=_0xf459[_0x597484];return _0x218e64;};'use strict';var info=require(_0x9f45('0x0'));var exec=require(_0x9f45('0x1'))[_0x9f45('0x2')];var logger=require(_0x9f45('0x3'))('api');var util=require('util');var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x162bf4,_0xa865b4,_0x4b7a57){_0xa865b4=_0xa865b4||0x1f4;return function(_0x179e81){logger[_0x9f45('0x4')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x4b7a57,_0xa865b4,util[_0x9f45('0x5')](_0x179e81,{'showHidden':![],'depth':null}));delete _0x179e81[_0x9f45('0x6')];_0x162bf4[_0x9f45('0x7')](_0xa865b4)[_0x9f45('0x8')](_0x179e81);};}exports[_0x9f45('0x9')]=function(_0x4d34dd,_0x4fbe78){return info[_0x9f45('0xa')]()[_0x9f45('0xb')](function(_0x457234){return _0x4fbe78[_0x9f45('0x7')](0xc8)[_0x9f45('0xc')](_0x457234);})[_0x9f45('0xd')](function(_0x20b3e9){return _0x4fbe78[_0x9f45('0x7')](0x1f4)[_0x9f45('0xc')](_0x20b3e9);});};exports['killProcess']=function(_0x3dc62e,_0x136a9e){var _0xec1dd4=[_0x9f45('0xe')];return new BPromise(function(_0x3c7a35,_0x3fd4dc){return exec(util['format'](_0x9f45('0xf'),_0x3dc62e[_0x9f45('0x10')]['pid']),function(_0x25bf2e,_0x49fb00,_0x2b004d){if(_0x25bf2e){return _0x3fd4dc(_0x25bf2e);}return _0x3c7a35(_0x49fb00);});})[_0x9f45('0xb')](function(_0x165cf6){var _0x2d9a64=![];var _0x10928a=_0x165cf6['split'](/\n/);for(var _0x3c263d=0x0,_0xef8fa7=_0xec1dd4['length'];_0x3c263d<_0xef8fa7,_0x2d9a64===![];_0x3c263d+=0x1){if(_0x165cf6[_0x9f45('0x11')](_0xec1dd4[_0x3c263d])>=0x0){_0x2d9a64=!![];}}if(!_0x2d9a64){throw new Error(util[_0x9f45('0x12')](_0x9f45('0x13'),_0x3dc62e['params']['pid']));}process[_0x9f45('0x14')](_0x3dc62e['params'][_0x9f45('0x15')],_0x9f45('0x16'));return _0x136a9e[_0x9f45('0x7')](0xc8)[_0x9f45('0xc')]({'message':util[_0x9f45('0x12')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x3dc62e[_0x9f45('0x10')][_0x9f45('0x15')])});})[_0x9f45('0xd')](handleError(_0x136a9e,null,_0x9f45('0x17')));};
\ No newline at end of file
+var _0x073d=['SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','child_process','exec','../../config/logger','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','catch','json','killProcess','components/import/cm','format','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!'];(function(_0x13df9a,_0x70b907){var _0x594349=function(_0x215580){while(--_0x215580){_0x13df9a['push'](_0x13df9a['shift']());}};_0x594349(++_0x70b907);}(_0x073d,0xd2));var _0xd073=function(_0x2f601c,_0x5a94a2){_0x2f601c=_0x2f601c-0x0;var _0x50a269=_0x073d[_0x2f601c];return _0x50a269;};'use strict';var info=require('systeminformation');var exec=require(_0xd073('0x0'))[_0xd073('0x1')];var logger=require(_0xd073('0x2'))('api');var util=require(_0xd073('0x3'));var BPromise=require('bluebird');var _=require(_0xd073('0x4'));function handleError(_0x423dc8,_0x494f81,_0x11bd94){_0x494f81=_0x494f81||0x1f4;return function(_0x37cb71){logger[_0xd073('0x5')](_0xd073('0x6'),_0x11bd94,_0x494f81,util[_0xd073('0x7')](_0x37cb71,{'showHidden':![],'depth':null}));delete _0x37cb71[_0xd073('0x8')];_0x423dc8[_0xd073('0x9')](_0x494f81)[_0xd073('0xa')](_0x37cb71);};}exports[_0xd073('0xb')]=function(_0x149c3e,_0x2a8ab7){return info[_0xd073('0xc')]()[_0xd073('0xd')](function(_0x3f1fc6){return _0x2a8ab7['status'](0xc8)['json'](_0x3f1fc6);})[_0xd073('0xe')](function(_0x53ee1c){return _0x2a8ab7[_0xd073('0x9')](0x1f4)[_0xd073('0xf')](_0x53ee1c);});};exports[_0xd073('0x10')]=function(_0x8ec873,_0x2a3482){var _0x5bb5af=[_0xd073('0x11')];return new BPromise(function(_0x6769eb,_0x43d214){return exec(util[_0xd073('0x12')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x8ec873[_0xd073('0x13')][_0xd073('0x14')]),function(_0x5066a8,_0xb5e1e2,_0x3965a8){if(_0x5066a8){return _0x43d214(_0x5066a8);}return _0x6769eb(_0xb5e1e2);});})[_0xd073('0xd')](function(_0x402b13){var _0x55d1d9=![];var _0x49a1dd=_0x402b13['split'](/\n/);for(var _0x5ac7b2=0x0,_0x195c5d=_0x5bb5af[_0xd073('0x15')];_0x5ac7b2<_0x195c5d,_0x55d1d9===![];_0x5ac7b2+=0x1){if(_0x402b13[_0xd073('0x16')](_0x5bb5af[_0x5ac7b2])>=0x0){_0x55d1d9=!![];}}if(!_0x55d1d9){throw new Error(util['format'](_0xd073('0x17'),_0x8ec873[_0xd073('0x13')][_0xd073('0x14')]));}process['kill'](_0x8ec873[_0xd073('0x13')][_0xd073('0x14')],_0xd073('0x18'));return _0x2a3482[_0xd073('0x9')](0xc8)['json']({'message':util[_0xd073('0x12')](_0xd073('0x19'),_0x8ec873[_0xd073('0x13')]['pid'])});})[_0xd073('0xe')](handleError(_0x2a3482,null,_0xd073('0x10')));};
\ No newline at end of file
index 2eb0c12..001738d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32d7=['multer','path','connect-timeout','express','Router','../../components/auth/service','./tag.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete'];(function(_0x8ba19a,_0x1d2b2b){var _0x2bd8b4=function(_0xee823f){while(--_0xee823f){_0x8ba19a['push'](_0x8ba19a['shift']());}};_0x2bd8b4(++_0x1d2b2b);}(_0x32d7,0xd0));var _0x732d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x32d7[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x732d('0x0'));var util=require('util');var path=require(_0x732d('0x1'));var timeout=require(_0x732d('0x2'));var express=require(_0x732d('0x3'));var router=express[_0x732d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x732d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x732d('0x6'));router[_0x732d('0x7')]('/',auth[_0x732d('0x8')](),controller[_0x732d('0x9')]);router[_0x732d('0x7')](_0x732d('0xa'),auth[_0x732d('0x8')](),controller[_0x732d('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x732d('0xc')]);router[_0x732d('0xd')](_0x732d('0xa'),auth[_0x732d('0x8')](),controller[_0x732d('0xe')]);router[_0x732d('0xf')](_0x732d('0xa'),auth[_0x732d('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x306e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x468b49,_0x351ef5){var _0x1c7543=function(_0x5d8a2e){while(--_0x5d8a2e){_0x468b49['push'](_0x468b49['shift']());}};_0x1c7543(++_0x351ef5);}(_0x306e,0x13b));var _0xe306=function(_0x8d0eba,_0x45770d){_0x8d0eba=_0x8d0eba-0x0;var _0x3affdc=_0x306e[_0x8d0eba];return _0x3affdc;};'use strict';var multer=require(_0xe306('0x0'));var util=require(_0xe306('0x1'));var path=require('path');var timeout=require(_0xe306('0x2'));var express=require(_0xe306('0x3'));var router=express[_0xe306('0x4')]();var fs_extra=require(_0xe306('0x5'));var auth=require(_0xe306('0x6'));var interaction=require(_0xe306('0x7'));var config=require(_0xe306('0x8'));var controller=require('./tag.controller');router[_0xe306('0x9')]('/',auth[_0xe306('0xa')](),controller['index']);router[_0xe306('0x9')](_0xe306('0xb'),auth[_0xe306('0xa')](),controller[_0xe306('0xc')]);router[_0xe306('0xd')]('/',auth[_0xe306('0xa')](),controller[_0xe306('0xe')]);router[_0xe306('0xf')](_0xe306('0xb'),auth['isAuthenticated'](),controller[_0xe306('0x10')]);router[_0xe306('0x11')](_0xe306('0xb'),auth[_0xe306('0xa')](),controller[_0xe306('0x12')]);module[_0xe306('0x13')]=router;
\ No newline at end of file
index 7317377..73dec6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd71d=['name','sequelize','exports','STRING'];(function(_0x50cc28,_0x13d2e0){var _0x57c51d=function(_0x142c07){while(--_0x142c07){_0x50cc28['push'](_0x50cc28['shift']());}};_0x57c51d(++_0x13d2e0);}(_0xd71d,0x1a5));var _0xdd71=function(_0x29c261,_0x3af39a){_0x29c261=_0x29c261-0x0;var _0x1a9335=_0xd71d[_0x29c261];return _0x1a9335;};'use strict';var Sequelize=require(_0xdd71('0x0'));module[_0xdd71('0x1')]={'name':{'type':Sequelize[_0xdd71('0x2')],'unique':_0xdd71('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xdd71('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xdd71('0x2')]}};
\ No newline at end of file
+var _0x2d93=['STRING','name','#0091EA','sequelize','exports'];(function(_0x47fd4f,_0x59cb4f){var _0x57bae9=function(_0x341431){while(--_0x341431){_0x47fd4f['push'](_0x47fd4f['shift']());}};_0x57bae9(++_0x59cb4f);}(_0x2d93,0xf3));var _0x32d9=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0x2d93[_0xf0bcac];return _0x4e4c65;};'use strict';var Sequelize=require(_0x32d9('0x0'));module[_0x32d9('0x1')]={'name':{'type':Sequelize[_0x32d9('0x2')],'unique':_0x32d9('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x32d9('0x2')],'defaultValue':_0x32d9('0x4')},'description':{'type':Sequelize[_0x32d9('0x2')]}};
\ No newline at end of file
index a86dab8..f66b875 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa88=['../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','get','UserProfileResource','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','options','Tag','includeAll','rows','show','params','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Tags','UserProfileSection','userProfileId','autoAssociation','update','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5f5aa8,_0x17aba8){var _0x23ef0a=function(_0x1ed299){while(--_0x1ed299){_0x5f5aa8['push'](_0x5f5aa8['shift']());}};_0x23ef0a(++_0x17aba8);}(_0xaa88,0x137));var _0x8aa8=function(_0x3616bb,_0x86fe00){_0x3616bb=_0x3616bb-0x0;var _0x1c0994=_0xaa88[_0x3616bb];return _0x1c0994;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){var _0xe978ab=_0x3ca7dc[_0x8aa8('0x25')]({'plain':!![]});var _0x547a7b='Tags';return db[_0x8aa8('0x26')][_0x8aa8('0x27')]({'where':{'type':_0x547a7b,'resourceId':_0xe978ab['id']}})[_0x8aa8('0x24')](function(){return _0x3ca7dc;});})[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bc34a,_0x49d561){return function(_0x2a0ff2){if(!_0x2a0ff2){_0x2bc34a[_0x8aa8('0x19')](0x194);}return _0x2a0ff2;};}function handleError(_0x15ff33,_0x519ac0){_0x519ac0=_0x519ac0||0x1f4;return function(_0x4c5c5c){logger[_0x8aa8('0x28')](_0x4c5c5c['stack']);if(_0x4c5c5c[_0x8aa8('0x29')]){delete _0x4c5c5c[_0x8aa8('0x29')];}_0x15ff33[_0x8aa8('0x1a')](_0x519ac0)[_0x8aa8('0x2a')](_0x4c5c5c);};}exports[_0x8aa8('0x2b')]=function(_0x4d5c2e,_0x267f4c){var _0x3003e5={},_0x4b67f5={},_0x99f74e={'count':0x0,'rows':[]};var _0xee2f61=_[_0x8aa8('0x2c')](db['Tag'][_0x8aa8('0x2d')],function(_0x3a0dce){return{'name':_0x3a0dce[_0x8aa8('0x2e')],'type':_0x3a0dce[_0x8aa8('0x2f')][_0x8aa8('0x30')]};});_0x4b67f5[_0x8aa8('0x31')]=_[_0x8aa8('0x2c')](_0xee2f61,_0x8aa8('0x29'));_0x4b67f5[_0x8aa8('0x32')]=_[_0x8aa8('0x33')](_0x4d5c2e[_0x8aa8('0x32')]);_0x4b67f5['filters']=_['intersection'](_0x4b67f5[_0x8aa8('0x31')],_0x4b67f5[_0x8aa8('0x32')]);_0x3003e5[_0x8aa8('0x34')]=_[_0x8aa8('0x35')](_0x4b67f5[_0x8aa8('0x31')],qs[_0x8aa8('0x36')](_0x4d5c2e['query']['fields']));_0x3003e5[_0x8aa8('0x34')]=_0x3003e5['attributes'][_0x8aa8('0x37')]?_0x3003e5[_0x8aa8('0x34')]:_0x4b67f5[_0x8aa8('0x31')];if(!_0x4d5c2e['query'][_0x8aa8('0x38')](_0x8aa8('0x39'))){_0x3003e5[_0x8aa8('0x1f')]=qs['limit'](_0x4d5c2e['query'][_0x8aa8('0x1f')]);_0x3003e5[_0x8aa8('0x1d')]=qs['offset'](_0x4d5c2e[_0x8aa8('0x32')][_0x8aa8('0x1d')]);}_0x3003e5['order']=qs[_0x8aa8('0x3a')](_0x4d5c2e['query']['sort']);_0x3003e5[_0x8aa8('0x3b')]=qs['filters'](_[_0x8aa8('0x3c')](_0x4d5c2e[_0x8aa8('0x32')],_0x4b67f5[_0x8aa8('0x3d')]),_0xee2f61);if(_0x4d5c2e[_0x8aa8('0x32')]['filter']){_0x3003e5[_0x8aa8('0x3b')]=_[_0x8aa8('0x3e')](_0x3003e5['where'],{'$or':_[_0x8aa8('0x2c')](_0xee2f61,function(_0xc770ec){if(_0xc770ec['type']!==_0x8aa8('0x3f')){var _0x3c6115={};_0x3c6115[_0xc770ec[_0x8aa8('0x29')]]={'$like':'%'+_0x4d5c2e[_0x8aa8('0x32')][_0x8aa8('0x40')]+'%'};return _0x3c6115;}})});}_0x3003e5=_[_0x8aa8('0x3e')]({},_0x3003e5,_0x4d5c2e[_0x8aa8('0x41')]);var _0x3fb265={'where':_0x3003e5[_0x8aa8('0x3b')]};return db[_0x8aa8('0x42')][_0x8aa8('0x20')](_0x3fb265)[_0x8aa8('0x24')](function(_0x17c730){_0x99f74e[_0x8aa8('0x20')]=_0x17c730;if(_0x4d5c2e[_0x8aa8('0x32')][_0x8aa8('0x43')]){_0x3003e5['include']=[{'all':!![]}];}return db[_0x8aa8('0x42')]['findAll'](_0x3003e5);})['then'](function(_0x572132){_0x99f74e[_0x8aa8('0x44')]=_0x572132;return _0x99f74e;})['then'](respondWithFilteredResult(_0x267f4c,_0x3003e5))['catch'](handleError(_0x267f4c,null));};exports[_0x8aa8('0x45')]=function(_0x4da4d8,_0x1ddf7f){var _0x5d8a6a={'raw':!![],'where':{'id':_0x4da4d8[_0x8aa8('0x46')]['id']}},_0x5a132a={};_0x5a132a[_0x8aa8('0x31')]=_[_0x8aa8('0x33')](db[_0x8aa8('0x42')][_0x8aa8('0x2d')]);_0x5a132a[_0x8aa8('0x32')]=_[_0x8aa8('0x33')](_0x4da4d8['query']);_0x5a132a[_0x8aa8('0x3d')]=_['intersection'](_0x5a132a[_0x8aa8('0x31')],_0x5a132a[_0x8aa8('0x32')]);_0x5d8a6a[_0x8aa8('0x34')]=_[_0x8aa8('0x35')](_0x5a132a[_0x8aa8('0x31')],qs[_0x8aa8('0x36')](_0x4da4d8['query']['fields']));_0x5d8a6a[_0x8aa8('0x34')]=_0x5d8a6a[_0x8aa8('0x34')]['length']?_0x5d8a6a[_0x8aa8('0x34')]:_0x5a132a[_0x8aa8('0x31')];if(_0x4da4d8[_0x8aa8('0x32')]['includeAll']){_0x5d8a6a['include']=[{'all':!![]}];}_0x5d8a6a=_['merge']({},_0x5d8a6a,_0x4da4d8['options']);return db[_0x8aa8('0x42')][_0x8aa8('0x47')](_0x5d8a6a)['then'](handleEntityNotFound(_0x1ddf7f,null))[_0x8aa8('0x24')](respondWithResult(_0x1ddf7f,null))[_0x8aa8('0x48')](handleError(_0x1ddf7f,null));};exports[_0x8aa8('0x49')]=function(_0x1aa1b6,_0x20384a){return db[_0x8aa8('0x42')]['create'](_0x1aa1b6['body'],{})[_0x8aa8('0x24')](function(_0x546988){var _0x20c368=_0x1aa1b6['user'][_0x8aa8('0x25')]({'plain':!![]});if(!_0x20c368)throw new Error(_0x8aa8('0x4a'));if(_0x20c368[_0x8aa8('0x4b')]===_0x8aa8('0x4c')){var _0x36de37=_0x546988[_0x8aa8('0x25')]({'plain':!![]});var _0x997597=_0x8aa8('0x4d');return db[_0x8aa8('0x4e')][_0x8aa8('0x47')]({'where':{'name':_0x997597,'userProfileId':_0x20c368[_0x8aa8('0x4f')]},'raw':!![]})[_0x8aa8('0x24')](function(_0x4fc51d){if(_0x4fc51d&&_0x4fc51d[_0x8aa8('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x36de37['name'],'resourceId':_0x36de37['id'],'type':_0x4fc51d[_0x8aa8('0x29')],'sectionId':_0x4fc51d['id']},{})['then'](function(){return _0x546988;});}else{return _0x546988;}})[_0x8aa8('0x48')](function(_0x1474fd){logger[_0x8aa8('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1474fd);throw _0x1474fd;});}return _0x546988;})[_0x8aa8('0x24')](respondWithResult(_0x20384a,0xc9))[_0x8aa8('0x48')](handleError(_0x20384a,null));};exports[_0x8aa8('0x51')]=function(_0x24f34e,_0x4ccb77){if(_0x24f34e['body']['id']){delete _0x24f34e[_0x8aa8('0x52')]['id'];}return db[_0x8aa8('0x42')][_0x8aa8('0x47')]({'where':{'id':_0x24f34e[_0x8aa8('0x46')]['id']}})['then'](handleEntityNotFound(_0x4ccb77,null))['then'](saveUpdates(_0x24f34e[_0x8aa8('0x52')],null))[_0x8aa8('0x24')](respondWithResult(_0x4ccb77,null))[_0x8aa8('0x48')](handleError(_0x4ccb77,null));};exports['destroy']=function(_0x33e9ae,_0x3a814f){return db['Tag']['find']({'where':{'id':_0x33e9ae['params']['id']}})['then'](handleEntityNotFound(_0x3a814f,null))[_0x8aa8('0x24')](removeEntity(_0x3a814f,null))['catch'](handleError(_0x3a814f,null));};
\ No newline at end of file
+var _0x04b8=['userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','Tags','error','stack','name','send','index','map','Tag','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get'];(function(_0x2fca79,_0x3c2358){var _0x42e044=function(_0x471210){while(--_0x471210){_0x2fca79['push'](_0x2fca79['shift']());}};_0x42e044(++_0x3c2358);}(_0x04b8,0x159));var _0x804b=function(_0x2a3981,_0x10b892){_0x2a3981=_0x2a3981-0x0;var _0x550274=_0x04b8[_0x2a3981];return _0x550274;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x804b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x804b('0x1'));var rp=require(_0x804b('0x2'));var moment=require('moment');var BPromise=require(_0x804b('0x3'));var Mustache=require(_0x804b('0x4'));var util=require('util');var path=require(_0x804b('0x5'));var sox=require(_0x804b('0x6'));var csv=require(_0x804b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x804b('0x8'));var _=require(_0x804b('0x9'));var squel=require(_0x804b('0xa'));var crypto=require('crypto');var jsforce=require(_0x804b('0xb'));var deskjs=require(_0x804b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x804b('0xd'));var Papa=require(_0x804b('0xe'));var Redis=require(_0x804b('0xf'));var authService=require(_0x804b('0x10'));var qs=require(_0x804b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x804b('0x12'));var logger=require(_0x804b('0x13'))(_0x804b('0x14'));var utils=require(_0x804b('0x15'));var config=require(_0x804b('0x16'));var licenseUtil=require(_0x804b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15a4eb,_0x5303cc){_0x5303cc=_0x5303cc||0xcc;return function(_0x23ee57){if(_0x23ee57){return _0x15a4eb[_0x804b('0x18')](_0x5303cc);}return _0x15a4eb[_0x804b('0x19')](_0x5303cc)[_0x804b('0x1a')]();};}function respondWithResult(_0x581fbf,_0x215825){_0x215825=_0x215825||0xc8;return function(_0x1b01a7){if(_0x1b01a7){return _0x581fbf[_0x804b('0x19')](_0x215825)[_0x804b('0x1b')](_0x1b01a7);}};}function respondWithFilteredResult(_0x4ff1be,_0x2fd593){return function(_0x8ccbe0){if(_0x8ccbe0){var _0x5e1cfe=typeof _0x2fd593[_0x804b('0x1c')]==='undefined'&&typeof _0x2fd593[_0x804b('0x1d')]===_0x804b('0x1e');var _0x13662e=_0x8ccbe0[_0x804b('0x1f')];var _0x3a05c0=_0x5e1cfe?0x0:_0x2fd593['offset'];var _0x871d6c=_0x5e1cfe?_0x8ccbe0['count']:_0x2fd593[_0x804b('0x1c')]+_0x2fd593[_0x804b('0x1d')];var _0x42cceb;if(_0x871d6c>=_0x13662e){_0x871d6c=_0x13662e;_0x42cceb=0xc8;}else{_0x42cceb=0xce;}_0x4ff1be[_0x804b('0x19')](_0x42cceb);return _0x4ff1be['set'](_0x804b('0x20'),_0x3a05c0+'-'+_0x871d6c+'/'+_0x13662e)[_0x804b('0x1b')](_0x8ccbe0);}return null;};}function patchUpdates(_0x427166){return function(_0x11eaf6){try{jsonpatch[_0x804b('0x21')](_0x11eaf6,_0x427166,!![]);}catch(_0x267878){return BPromise[_0x804b('0x22')](_0x267878);}return _0x11eaf6[_0x804b('0x23')]();};}function saveUpdates(_0xaa9521,_0x2b7271){return function(_0x1acc48){if(_0x1acc48){return _0x1acc48['update'](_0xaa9521)[_0x804b('0x24')](function(_0x5a77e0){return _0x5a77e0;});}return null;};}function removeEntity(_0x5585f8,_0x44a921){return function(_0x367024){if(_0x367024){return _0x367024[_0x804b('0x25')]()[_0x804b('0x24')](function(){var _0x9080c2=_0x367024['get']({'plain':!![]});var _0x2de812=_0x804b('0x26');return db['UserProfileResource'][_0x804b('0x25')]({'where':{'type':_0x2de812,'resourceId':_0x9080c2['id']}})[_0x804b('0x24')](function(){return _0x367024;});})[_0x804b('0x24')](function(){_0x5585f8[_0x804b('0x19')](0xcc)[_0x804b('0x1a')]();});}};}function handleEntityNotFound(_0x5cc1dd,_0x456580){return function(_0x22f822){if(!_0x22f822){_0x5cc1dd[_0x804b('0x18')](0x194);}return _0x22f822;};}function handleError(_0xe145e,_0x3d1ecc){_0x3d1ecc=_0x3d1ecc||0x1f4;return function(_0x4a6079){logger[_0x804b('0x27')](_0x4a6079[_0x804b('0x28')]);if(_0x4a6079[_0x804b('0x29')]){delete _0x4a6079['name'];}_0xe145e[_0x804b('0x19')](_0x3d1ecc)[_0x804b('0x2a')](_0x4a6079);};}exports[_0x804b('0x2b')]=function(_0x57b8da,_0x408857){var _0x471c04={},_0x5e8f85={},_0x391376={'count':0x0,'rows':[]};var _0x37dd3e=_[_0x804b('0x2c')](db[_0x804b('0x2d')][_0x804b('0x2e')],function(_0x241c96){return{'name':_0x241c96['fieldName'],'type':_0x241c96[_0x804b('0x2f')][_0x804b('0x30')]};});_0x5e8f85[_0x804b('0x31')]=_[_0x804b('0x2c')](_0x37dd3e,_0x804b('0x29'));_0x5e8f85[_0x804b('0x32')]=_[_0x804b('0x33')](_0x57b8da[_0x804b('0x32')]);_0x5e8f85[_0x804b('0x34')]=_[_0x804b('0x35')](_0x5e8f85[_0x804b('0x31')],_0x5e8f85[_0x804b('0x32')]);_0x471c04[_0x804b('0x36')]=_[_0x804b('0x35')](_0x5e8f85[_0x804b('0x31')],qs[_0x804b('0x37')](_0x57b8da[_0x804b('0x32')][_0x804b('0x37')]));_0x471c04[_0x804b('0x36')]=_0x471c04[_0x804b('0x36')][_0x804b('0x38')]?_0x471c04[_0x804b('0x36')]:_0x5e8f85[_0x804b('0x31')];if(!_0x57b8da[_0x804b('0x32')][_0x804b('0x39')]('nolimit')){_0x471c04['limit']=qs['limit'](_0x57b8da[_0x804b('0x32')][_0x804b('0x1d')]);_0x471c04[_0x804b('0x1c')]=qs['offset'](_0x57b8da['query']['offset']);}_0x471c04[_0x804b('0x3a')]=qs[_0x804b('0x3b')](_0x57b8da[_0x804b('0x32')][_0x804b('0x3b')]);_0x471c04[_0x804b('0x3c')]=qs[_0x804b('0x34')](_[_0x804b('0x3d')](_0x57b8da[_0x804b('0x32')],_0x5e8f85[_0x804b('0x34')]),_0x37dd3e);if(_0x57b8da[_0x804b('0x32')][_0x804b('0x3e')]){_0x471c04[_0x804b('0x3c')]=_[_0x804b('0x3f')](_0x471c04['where'],{'$or':_[_0x804b('0x2c')](_0x37dd3e,function(_0x4654f4){if(_0x4654f4[_0x804b('0x2f')]!==_0x804b('0x40')){var _0x62cfee={};_0x62cfee[_0x4654f4['name']]={'$like':'%'+_0x57b8da['query'][_0x804b('0x3e')]+'%'};return _0x62cfee;}})});}_0x471c04=_[_0x804b('0x3f')]({},_0x471c04,_0x57b8da[_0x804b('0x41')]);var _0x5206f9={'where':_0x471c04[_0x804b('0x3c')]};return db['Tag'][_0x804b('0x1f')](_0x5206f9)[_0x804b('0x24')](function(_0x20ccc7){_0x391376[_0x804b('0x1f')]=_0x20ccc7;if(_0x57b8da[_0x804b('0x32')][_0x804b('0x42')]){_0x471c04[_0x804b('0x43')]=[{'all':!![]}];}return db['Tag'][_0x804b('0x44')](_0x471c04);})[_0x804b('0x24')](function(_0x1dcec8){_0x391376[_0x804b('0x45')]=_0x1dcec8;return _0x391376;})['then'](respondWithFilteredResult(_0x408857,_0x471c04))[_0x804b('0x46')](handleError(_0x408857,null));};exports[_0x804b('0x47')]=function(_0x1df519,_0x1c3d93){var _0x320aeb={'raw':!![],'where':{'id':_0x1df519[_0x804b('0x48')]['id']}},_0xbca498={};_0xbca498[_0x804b('0x31')]=_['keys'](db[_0x804b('0x2d')]['rawAttributes']);_0xbca498['query']=_['keys'](_0x1df519[_0x804b('0x32')]);_0xbca498['filters']=_[_0x804b('0x35')](_0xbca498[_0x804b('0x31')],_0xbca498[_0x804b('0x32')]);_0x320aeb[_0x804b('0x36')]=_['intersection'](_0xbca498[_0x804b('0x31')],qs[_0x804b('0x37')](_0x1df519[_0x804b('0x32')]['fields']));_0x320aeb[_0x804b('0x36')]=_0x320aeb[_0x804b('0x36')][_0x804b('0x38')]?_0x320aeb['attributes']:_0xbca498[_0x804b('0x31')];if(_0x1df519[_0x804b('0x32')][_0x804b('0x42')]){_0x320aeb[_0x804b('0x43')]=[{'all':!![]}];}_0x320aeb=_[_0x804b('0x3f')]({},_0x320aeb,_0x1df519[_0x804b('0x41')]);return db[_0x804b('0x2d')][_0x804b('0x49')](_0x320aeb)[_0x804b('0x24')](handleEntityNotFound(_0x1c3d93,null))[_0x804b('0x24')](respondWithResult(_0x1c3d93,null))[_0x804b('0x46')](handleError(_0x1c3d93,null));};exports[_0x804b('0x4a')]=function(_0x20862f,_0x2c1796){return db['Tag']['create'](_0x20862f[_0x804b('0x4b')],{})[_0x804b('0x24')](function(_0x82fc71){var _0x53124f=_0x20862f[_0x804b('0x4c')]['get']({'plain':!![]});if(!_0x53124f)throw new Error(_0x804b('0x4d'));if(_0x53124f[_0x804b('0x4e')]===_0x804b('0x4c')){var _0x3ca9ff=_0x82fc71[_0x804b('0x4f')]({'plain':!![]});var _0x111e3f='Tags';return db['UserProfileSection'][_0x804b('0x49')]({'where':{'name':_0x111e3f,'userProfileId':_0x53124f[_0x804b('0x50')]},'raw':!![]})['then'](function(_0x5103b7){if(_0x5103b7&&_0x5103b7[_0x804b('0x51')]===0x0){return db[_0x804b('0x52')][_0x804b('0x4a')]({'name':_0x3ca9ff['name'],'resourceId':_0x3ca9ff['id'],'type':_0x5103b7[_0x804b('0x29')],'sectionId':_0x5103b7['id']},{})[_0x804b('0x24')](function(){return _0x82fc71;});}else{return _0x82fc71;}})['catch'](function(_0x2756de){logger['error'](_0x804b('0x53'),_0x2756de);throw _0x2756de;});}return _0x82fc71;})['then'](respondWithResult(_0x2c1796,0xc9))[_0x804b('0x46')](handleError(_0x2c1796,null));};exports[_0x804b('0x54')]=function(_0x47c835,_0x2f9360){if(_0x47c835['body']['id']){delete _0x47c835[_0x804b('0x4b')]['id'];}return db[_0x804b('0x2d')][_0x804b('0x49')]({'where':{'id':_0x47c835[_0x804b('0x48')]['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x2f9360,null))[_0x804b('0x24')](saveUpdates(_0x47c835[_0x804b('0x4b')],null))[_0x804b('0x24')](respondWithResult(_0x2f9360,null))[_0x804b('0x46')](handleError(_0x2f9360,null));};exports[_0x804b('0x25')]=function(_0x5d53f9,_0x53b91d){return db[_0x804b('0x2d')]['find']({'where':{'id':_0x5d53f9['params']['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x53b91d,null))[_0x804b('0x24')](removeEntity(_0x53b91d,null))[_0x804b('0x46')](handleError(_0x53b91d,null));};
\ No newline at end of file
index 4e80983..243d43f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf9a=['rimraf','../../config/environment','./tag.attributes','exports','define','Tag','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x41085e,_0x468a5a){var _0x24112d=function(_0x412715){while(--_0x412715){_0x41085e['push'](_0x41085e['shift']());}};_0x24112d(++_0x468a5a);}(_0xbf9a,0x7e));var _0xabf9=function(_0x59bcb1,_0x5a4b6c){_0x59bcb1=_0x59bcb1-0x0;var _0x4a737f=_0xbf9a[_0x59bcb1];return _0x4a737f;};'use strict';var _=require(_0xabf9('0x0'));var util=require('util');var logger=require(_0xabf9('0x1'))(_0xabf9('0x2'));var moment=require(_0xabf9('0x3'));var BPromise=require('bluebird');var rp=require(_0xabf9('0x4'));var fs=require('fs');var path=require(_0xabf9('0x5'));var rimraf=require(_0xabf9('0x6'));var config=require(_0xabf9('0x7'));var attributes=require(_0xabf9('0x8'));module[_0xabf9('0x9')]=function(_0x5b0451,_0x1848dc){return _0x5b0451[_0xabf9('0xa')](_0xabf9('0xb'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3355=['path','rimraf','../../config/environment','exports','define','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3f4328,_0x389f8f){var _0x2df80a=function(_0x59b887){while(--_0x59b887){_0x3f4328['push'](_0x3f4328['shift']());}};_0x2df80a(++_0x389f8f);}(_0x3355,0xe1));var _0x5335=function(_0x46f08e,_0x2c2393){_0x46f08e=_0x46f08e-0x0;var _0x19919d=_0x3355[_0x46f08e];return _0x19919d;};'use strict';var _=require('lodash');var util=require(_0x5335('0x0'));var logger=require(_0x5335('0x1'))('api');var moment=require(_0x5335('0x2'));var BPromise=require(_0x5335('0x3'));var rp=require(_0x5335('0x4'));var fs=require('fs');var path=require(_0x5335('0x5'));var rimraf=require(_0x5335('0x6'));var config=require(_0x5335('0x7'));var attributes=require('./tag.attributes');module[_0x5335('0x8')]=function(_0x4d743b,_0x183d20){return _0x4d743b[_0x5335('0x9')]('Tag',attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2e0da78..03c07ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a28=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x34ce33,_0x81780e){var _0x562815=function(_0x473c62){while(--_0x473c62){_0x34ce33['push'](_0x34ce33['shift']());}};_0x562815(++_0x81780e);}(_0x8a28,0xfd));var _0x88a2=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x8a28[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0x88a2('0x0'));var util=require(_0x88a2('0x1'));var moment=require(_0x88a2('0x2'));var BPromise=require(_0x88a2('0x3'));var rs=require(_0x88a2('0x4'));var fs=require('fs');var Redis=require(_0x88a2('0x5'));var db=require(_0x88a2('0x6'))['db'];var utils=require(_0x88a2('0x7'));var logger=require('../../config/logger')(_0x88a2('0x8'));var config=require(_0x88a2('0x9'));var jayson=require(_0x88a2('0xa'));var client=jayson[_0x88a2('0xb')][_0x88a2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5cb591,_0x1629ea,_0x5406ed){return new BPromise(function(_0x1cdf6b,_0x2a8576){return client[_0x88a2('0xd')](_0x5cb591,_0x5406ed)[_0x88a2('0xe')](function(_0x2db7dd){logger[_0x88a2('0xf')](_0x88a2('0x10'),_0x1629ea,_0x88a2('0x11'));logger[_0x88a2('0x12')]('Tag,\x20%s,\x20%s,\x20%s',_0x1629ea,'request\x20sent',JSON[_0x88a2('0x13')](_0x2db7dd));if(_0x2db7dd[_0x88a2('0x14')]){if(_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x15')]===0x1f4){logger[_0x88a2('0x14')]('Tag,\x20%s,\x20%s',_0x1629ea,_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x16')]);return _0x2a8576(_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x16')]);}logger['error'](_0x88a2('0x10'),_0x1629ea,_0x2db7dd[_0x88a2('0x14')][_0x88a2('0x16')]);return _0x1cdf6b(_0x2db7dd['error'][_0x88a2('0x16')]);}else{logger[_0x88a2('0xf')](_0x88a2('0x10'),_0x1629ea,_0x88a2('0x11'));_0x1cdf6b(_0x2db7dd[_0x88a2('0x17')][_0x88a2('0x16')]);}})[_0x88a2('0x18')](function(_0x2f5220){logger[_0x88a2('0x14')](_0x88a2('0x10'),_0x1629ea,_0x2f5220);_0x2a8576(_0x2f5220);});});}
\ No newline at end of file
+var _0x8d9b=['rpc','../../config/environment','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8d9b,0x104));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb8d9('0x0'));var util=require(_0xb8d9('0x1'));var moment=require(_0xb8d9('0x2'));var BPromise=require(_0xb8d9('0x3'));var rs=require(_0xb8d9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb8d9('0x5'));var logger=require('../../config/logger')(_0xb8d9('0x6'));var config=require(_0xb8d9('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x21c87d,_0x537b18,_0x53339b){return new BPromise(function(_0x4c2b8f,_0x13352e){return client[_0xb8d9('0x8')](_0x21c87d,_0x53339b)[_0xb8d9('0x9')](function(_0x2189b1){logger[_0xb8d9('0xa')](_0xb8d9('0xb'),_0x537b18,_0xb8d9('0xc'));logger['debug'](_0xb8d9('0xd'),_0x537b18,'request\x20sent',JSON[_0xb8d9('0xe')](_0x2189b1));if(_0x2189b1[_0xb8d9('0xf')]){if(_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x10')]===0x1f4){logger[_0xb8d9('0xf')](_0xb8d9('0xb'),_0x537b18,_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x11')]);return _0x13352e(_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x11')]);}logger[_0xb8d9('0xf')](_0xb8d9('0xb'),_0x537b18,_0x2189b1[_0xb8d9('0xf')][_0xb8d9('0x11')]);return _0x4c2b8f(_0x2189b1['error'][_0xb8d9('0x11')]);}else{logger[_0xb8d9('0xa')](_0xb8d9('0xb'),_0x537b18,_0xb8d9('0xc'));_0x4c2b8f(_0x2189b1[_0xb8d9('0x12')]['message']);}})['catch'](function(_0x5b7d5a){logger[_0xb8d9('0xf')](_0xb8d9('0xb'),_0x537b18,_0x5b7d5a);_0x13352e(_0x5b7d5a);});});}
\ No newline at end of file
index b1701fb..4f3a1b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_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 timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
index eade065..ca6b3d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['name','exports','STRING'];(function(_0x4bf944,_0x2a6edf){var _0x242e1b=function(_0x253c1a){while(--_0x253c1a){_0x4bf944['push'](_0x4bf944['shift']());}};_0x242e1b(++_0x2a6edf);}(_0x2032,0xd9));var _0x2203=function(_0x23c90e,_0x19f971){_0x23c90e=_0x23c90e-0x0;var _0x45cab2=_0x2032[_0x23c90e];return _0x45cab2;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd8b0=['exports','sequelize'];(function(_0x5b3748,_0x2e4f4e){var _0x34475d=function(_0x42c048){while(--_0x42c048){_0x5b3748['push'](_0x5b3748['shift']());}};_0x34475d(++_0x2e4f4e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 3419ad9..eab1553 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb53a=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','end','status','offset','undefined','count','limit','apply','reject','save','update','then','name','send','index','map','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','options','Team','includeAll','include','findAll','rows','catch','show','params','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','sequelize','transaction','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','WhatsappQueueId','TeamVoicePrefix','VoicePrefixId','getQueues','isValidChannel','Unknown\x20channel','capitalize','channel','toLowerCase','order','Queues','findOne','ids','ValidationError','remove','Voice','Mail','Sms','Openchannel','through','penalty','QueueId','TeamVoiceQueue','User','Queue','findOrCreate','emit','Queue:save','online','voicePause','isNil','interface','all','UserVoicePrefix','upsert','removeAgents','isArray','Chat','Whatsapp','UserVoiceQueueRt','getAgents','nolimit','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xb53a,0x118));var _0xab53=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb53a[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xab53('0x0'));var rimraf=require(_0xab53('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xab53('0x2'));var rp=require(_0xab53('0x3'));var moment=require('moment');var BPromise=require(_0xab53('0x4'));var Mustache=require(_0xab53('0x5'));var util=require(_0xab53('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xab53('0x7'));var ejs=require(_0xab53('0x8'));var fs=require('fs');var fs_extra=require(_0xab53('0x9'));var _=require('lodash');var squel=require(_0xab53('0xa'));var crypto=require(_0xab53('0xb'));var jsforce=require(_0xab53('0xc'));var deskjs=require(_0xab53('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xab53('0xe'));var Redis=require('ioredis');var authService=require(_0xab53('0xf'));var qs=require(_0xab53('0x10'));var as=require(_0xab53('0x11'));var hardwareService=require(_0xab53('0x12'));var logger=require('../../config/logger')(_0xab53('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xab53('0x14'))['db'];config['redis']=_[_0xab53('0x15')](config[_0xab53('0x16')],{'host':_0xab53('0x17'),'port':0x18eb});var socket=require(_0xab53('0x18'))(new Redis(config[_0xab53('0x16')]));require(_0xab53('0x19'))[_0xab53('0x1a')](socket);function respondWithStatusCode(_0x3ffe79,_0x57de3b){_0x57de3b=_0x57de3b||0xcc;return function(_0x3c16ba){if(_0x3c16ba){return _0x3ffe79[_0xab53('0x1b')](_0x57de3b);}return _0x3ffe79['status'](_0x57de3b)[_0xab53('0x1c')]();};}function respondWithResult(_0x2ec541,_0x460891){_0x460891=_0x460891||0xc8;return function(_0x427f06){if(_0x427f06){return _0x2ec541[_0xab53('0x1d')](_0x460891)['json'](_0x427f06);}};}function respondWithFilteredResult(_0x45026e,_0x5a4bf7){return function(_0x26c48c){if(_0x26c48c){var _0x28e98a=typeof _0x5a4bf7[_0xab53('0x1e')]==='undefined'&&typeof _0x5a4bf7['limit']===_0xab53('0x1f');var _0x523e4d=_0x26c48c['count'];var _0x5ef1a4=_0x28e98a?0x0:_0x5a4bf7[_0xab53('0x1e')];var _0x224b18=_0x28e98a?_0x26c48c[_0xab53('0x20')]:_0x5a4bf7[_0xab53('0x1e')]+_0x5a4bf7[_0xab53('0x21')];var _0x215636;if(_0x224b18>=_0x523e4d){_0x224b18=_0x523e4d;_0x215636=0xc8;}else{_0x215636=0xce;}_0x45026e[_0xab53('0x1d')](_0x215636);return _0x45026e['set']('Content-Range',_0x5ef1a4+'-'+_0x224b18+'/'+_0x523e4d)['json'](_0x26c48c);}return null;};}function patchUpdates(_0x49fd50){return function(_0xf033b9){try{jsonpatch[_0xab53('0x22')](_0xf033b9,_0x49fd50,!![]);}catch(_0x4c9144){return BPromise[_0xab53('0x23')](_0x4c9144);}return _0xf033b9[_0xab53('0x24')]();};}function saveUpdates(_0x574bc7,_0x426a8f){return function(_0x515342){if(_0x515342){return _0x515342[_0xab53('0x25')](_0x574bc7)[_0xab53('0x26')](function(_0x30552b){return _0x30552b;});}return null;};}function handleEntityNotFound(_0x45ef09,_0x3a5a55){return function(_0x4e38b3){if(!_0x4e38b3){_0x45ef09[_0xab53('0x1b')](0x194);}return _0x4e38b3;};}function handleError(_0x1e0f1e,_0x2ed3ea){_0x2ed3ea=_0x2ed3ea||0x1f4;return function(_0xed22f3){logger['error'](_0xed22f3['stack']);if(_0xed22f3[_0xab53('0x27')]){delete _0xed22f3['name'];}_0x1e0f1e[_0xab53('0x1d')](_0x2ed3ea)[_0xab53('0x28')](_0xed22f3);};}exports[_0xab53('0x29')]=function(_0x1d3e38,_0x13721a){var _0x192feb={},_0x441924={},_0x248b74={'count':0x0,'rows':[]};var _0x32e773=_[_0xab53('0x2a')](db['Team'][_0xab53('0x2b')],function(_0x34403b){return{'name':_0x34403b['fieldName'],'type':_0x34403b[_0xab53('0x2c')][_0xab53('0x2d')]};});_0x441924[_0xab53('0x2e')]=_[_0xab53('0x2a')](_0x32e773,'name');_0x441924[_0xab53('0x2f')]=_['keys'](_0x1d3e38[_0xab53('0x2f')]);_0x441924[_0xab53('0x30')]=_['intersection'](_0x441924[_0xab53('0x2e')],_0x441924[_0xab53('0x2f')]);_0x192feb[_0xab53('0x31')]=_[_0xab53('0x32')](_0x441924[_0xab53('0x2e')],qs[_0xab53('0x33')](_0x1d3e38[_0xab53('0x2f')][_0xab53('0x33')]));_0x192feb[_0xab53('0x31')]=_0x192feb[_0xab53('0x31')][_0xab53('0x34')]?_0x192feb[_0xab53('0x31')]:_0x441924[_0xab53('0x2e')];if(!_0x1d3e38['query'][_0xab53('0x35')]('nolimit')){_0x192feb[_0xab53('0x21')]=qs[_0xab53('0x21')](_0x1d3e38[_0xab53('0x2f')][_0xab53('0x21')]);_0x192feb[_0xab53('0x1e')]=qs[_0xab53('0x1e')](_0x1d3e38['query'][_0xab53('0x1e')]);}_0x192feb['order']=qs[_0xab53('0x36')](_0x1d3e38[_0xab53('0x2f')][_0xab53('0x36')]);_0x192feb['where']=qs[_0xab53('0x30')](_[_0xab53('0x37')](_0x1d3e38[_0xab53('0x2f')],_0x441924['filters']),_0x32e773);if(_0x1d3e38[_0xab53('0x2f')]['filter']){_0x192feb[_0xab53('0x38')]=_[_0xab53('0x39')](_0x192feb[_0xab53('0x38')],{'$or':_[_0xab53('0x2a')](_0x32e773,function(_0x1e42fa){if(_0x1e42fa[_0xab53('0x2c')]!==_0xab53('0x3a')){var _0x1c21fe={};_0x1c21fe[_0x1e42fa[_0xab53('0x27')]]={'$like':'%'+_0x1d3e38[_0xab53('0x2f')][_0xab53('0x3b')]+'%'};return _0x1c21fe;}})});}_0x192feb=_['merge']({},_0x192feb,_0x1d3e38[_0xab53('0x3c')]);var _0x60ee48={'where':_0x192feb[_0xab53('0x38')]};return db[_0xab53('0x3d')][_0xab53('0x20')](_0x60ee48)[_0xab53('0x26')](function(_0x2613f2){_0x248b74[_0xab53('0x20')]=_0x2613f2;if(_0x1d3e38[_0xab53('0x2f')][_0xab53('0x3e')]){_0x192feb[_0xab53('0x3f')]=[{'all':!![]}];}return db[_0xab53('0x3d')][_0xab53('0x40')](_0x192feb);})[_0xab53('0x26')](function(_0x4548fe){_0x248b74[_0xab53('0x41')]=_0x4548fe;return _0x248b74;})[_0xab53('0x26')](respondWithFilteredResult(_0x13721a,_0x192feb))[_0xab53('0x42')](handleError(_0x13721a,null));};exports[_0xab53('0x43')]=function(_0x1cc6f3,_0x205eb9){var _0x4acea5={'raw':![],'where':{'id':_0x1cc6f3[_0xab53('0x44')]['id']}},_0x485b5f={};_0x485b5f[_0xab53('0x2e')]=_[_0xab53('0x45')](db['Team'][_0xab53('0x2b')]);_0x485b5f[_0xab53('0x2f')]=_[_0xab53('0x45')](_0x1cc6f3[_0xab53('0x2f')]);_0x485b5f['filters']=_[_0xab53('0x32')](_0x485b5f[_0xab53('0x2e')],_0x485b5f['query']);_0x4acea5[_0xab53('0x31')]=_['intersection'](_0x485b5f['model'],qs[_0xab53('0x33')](_0x1cc6f3[_0xab53('0x2f')][_0xab53('0x33')]));_0x4acea5[_0xab53('0x31')]=_0x4acea5[_0xab53('0x31')][_0xab53('0x34')]?_0x4acea5[_0xab53('0x31')]:_0x485b5f[_0xab53('0x2e')];if(_0x1cc6f3[_0xab53('0x2f')][_0xab53('0x3e')]){_0x4acea5[_0xab53('0x3f')]=[{'all':!![]}];}_0x4acea5=_['merge']({},_0x4acea5,_0x1cc6f3[_0xab53('0x3c')]);return db['Team'][_0xab53('0x46')](_0x4acea5)[_0xab53('0x26')](handleEntityNotFound(_0x205eb9,null))['then'](respondWithResult(_0x205eb9,null))[_0xab53('0x42')](handleError(_0x205eb9,null));};exports[_0xab53('0x47')]=function(_0xad8dd2,_0x495372){return db[_0xab53('0x3d')]['create'](_0xad8dd2['body'],{})[_0xab53('0x26')](function(_0x50a378){var _0x29cb6c=_0xad8dd2[_0xab53('0x48')][_0xab53('0x49')]({'plain':!![]});if(!_0x29cb6c)throw new Error(_0xab53('0x4a'));if(_0x29cb6c[_0xab53('0x4b')]===_0xab53('0x48')){var _0x5ecf69=_0x50a378[_0xab53('0x49')]({'plain':!![]});var _0x80436d=_0xab53('0x4c');return db[_0xab53('0x4d')]['find']({'where':{'name':_0x80436d,'userProfileId':_0x29cb6c[_0xab53('0x4e')]},'raw':!![]})[_0xab53('0x26')](function(_0x34beb5){if(_0x34beb5&&_0x34beb5[_0xab53('0x4f')]===0x0){return db[_0xab53('0x50')]['create']({'name':_0x5ecf69[_0xab53('0x27')],'resourceId':_0x5ecf69['id'],'type':_0x34beb5[_0xab53('0x27')],'sectionId':_0x34beb5['id']},{})[_0xab53('0x26')](function(){return _0x50a378;});}else{return _0x50a378;}})[_0xab53('0x42')](function(_0x25801c){logger[_0xab53('0x51')](_0xab53('0x52'),_0x25801c);throw _0x25801c;});}return _0x50a378;})[_0xab53('0x26')](respondWithResult(_0x495372,0xc9))[_0xab53('0x42')](handleError(_0x495372,null));};exports[_0xab53('0x25')]=function(_0x451bb8,_0x3f3842){if(_0x451bb8[_0xab53('0x53')]['id']){delete _0x451bb8[_0xab53('0x53')]['id'];}return db['Team'][_0xab53('0x46')]({'where':{'id':_0x451bb8[_0xab53('0x44')]['id']}})[_0xab53('0x26')](handleEntityNotFound(_0x3f3842,null))[_0xab53('0x26')](saveUpdates(_0x451bb8[_0xab53('0x53')],null))['then'](respondWithResult(_0x3f3842,null))[_0xab53('0x42')](handleError(_0x3f3842,null));};exports[_0xab53('0x54')]=function(_0x3d47b4,_0x366a22){var _0x58e218=_0x3d47b4[_0xab53('0x44')]['id'];var _0x3daf66=[];return db[_0xab53('0x55')][_0xab53('0x56')](function(_0x448ae0){var _0x39b332='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x58e218;return db[_0xab53('0x55')][_0xab53('0x2f')](_0x39b332,{'type':db[_0xab53('0x57')][_0xab53('0x58')][_0xab53('0x59')],'raw':!![],'transaction':_0x448ae0})[_0xab53('0x26')](function(_0xe8d3b8){_0x3daf66=_[_0xab53('0x2a')](_0xe8d3b8,function(_0x4f27b6){return Number(_0x4f27b6[_0xab53('0x5a')]);});})[_0xab53('0x26')](function(){var _0x3230f0=_0xab53('0x5b')+_0x58e218;return db[_0xab53('0x55')][_0xab53('0x2f')](_0x3230f0,{'type':db[_0xab53('0x57')][_0xab53('0x58')][_0xab53('0x59')],'raw':!![],'transaction':_0x448ae0});})[_0xab53('0x26')](function(_0x3b36f6){var _0x44a46b=_['map'](_0x3b36f6,function(_0x12cb61){return Number(_0x12cb61['VoiceQueueId']);});return db[_0xab53('0x5c')][_0xab53('0x54')]({'where':{'UserId':{'$in':_0x3daf66},'VoiceQueueId':{'$in':_0x44a46b}},'transaction':_0x448ae0});})[_0xab53('0x26')](function(){var _0x511d0a=_0xab53('0x5d')+_0x58e218;return db['sequelize']['query'](_0x511d0a,{'type':db[_0xab53('0x57')][_0xab53('0x58')][_0xab53('0x59')],'raw':!![],'transaction':_0x448ae0});})[_0xab53('0x26')](function(_0x38a40b){var _0x283612=_[_0xab53('0x2a')](_0x38a40b,function(_0x41e05b){return Number(_0x41e05b[_0xab53('0x5e')]);});return db[_0xab53('0x5f')]['destroy']({'where':{'UserId':{'$in':_0x3daf66},'MailQueueId':{'$in':_0x283612}},'transaction':_0x448ae0});})[_0xab53('0x26')](function(){var _0x4f92bf='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x58e218;return db[_0xab53('0x55')]['query'](_0x4f92bf,{'type':db[_0xab53('0x57')]['QueryTypes'][_0xab53('0x59')],'raw':!![],'transaction':_0x448ae0});})[_0xab53('0x26')](function(_0x73b9b5){var _0x2e66a5=_[_0xab53('0x2a')](_0x73b9b5,function(_0xaf9f5b){return Number(_0xaf9f5b[_0xab53('0x60')]);});return db[_0xab53('0x61')][_0xab53('0x54')]({'where':{'UserId':{'$in':_0x3daf66},'SmsQueueId':{'$in':_0x2e66a5}},'transaction':_0x448ae0});})[_0xab53('0x26')](function(){var _0x2d652d=_0xab53('0x62')+_0x58e218;return db[_0xab53('0x55')][_0xab53('0x2f')](_0x2d652d,{'type':db[_0xab53('0x57')][_0xab53('0x58')][_0xab53('0x59')],'raw':!![],'transaction':_0x448ae0});})['then'](function(_0xcd0323){var _0x2a1c66=_['map'](_0xcd0323,function(_0x5b395a){return Number(_0x5b395a[_0xab53('0x63')]);});return db[_0xab53('0x64')]['destroy']({'where':{'UserId':{'$in':_0x3daf66},'ChatQueueId':{'$in':_0x2a1c66}},'transaction':_0x448ae0});})[_0xab53('0x26')](function(){var _0x1506ad='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x58e218;return db[_0xab53('0x55')][_0xab53('0x2f')](_0x1506ad,{'type':db[_0xab53('0x57')][_0xab53('0x58')][_0xab53('0x59')],'raw':!![],'transaction':_0x448ae0});})[_0xab53('0x26')](function(_0xa218c8){var _0x444e20=_[_0xab53('0x2a')](_0xa218c8,function(_0x41d66f){return Number(_0x41d66f[_0xab53('0x65')]);});return db['UserFaxQueue'][_0xab53('0x54')]({'where':{'UserId':{'$in':_0x3daf66},'FaxQueueId':{'$in':_0x444e20}},'transaction':_0x448ae0});})[_0xab53('0x26')](function(){var _0x56fdd7=_0xab53('0x66')+_0x58e218;return db[_0xab53('0x55')][_0xab53('0x2f')](_0x56fdd7,{'type':db[_0xab53('0x57')][_0xab53('0x58')][_0xab53('0x59')],'raw':!![],'transaction':_0x448ae0});})[_0xab53('0x26')](function(_0x3a2c0f){var _0xd2668b=_['map'](_0x3a2c0f,function(_0x34f85f){return Number(_0x34f85f[_0xab53('0x67')]);});return db[_0xab53('0x68')][_0xab53('0x54')]({'where':{'UserId':{'$in':_0x3daf66},'OpenchannelQueueId':{'$in':_0xd2668b}},'transaction':_0x448ae0});})[_0xab53('0x26')](function(){var _0x105183='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x58e218;return db[_0xab53('0x55')][_0xab53('0x2f')](_0x105183,{'type':db[_0xab53('0x57')][_0xab53('0x58')][_0xab53('0x59')],'raw':!![],'transaction':_0x448ae0});})[_0xab53('0x26')](function(_0x327263){var _0x3d17e3=_[_0xab53('0x2a')](_0x327263,function(_0x15a615){return Number(_0x15a615[_0xab53('0x69')]);});return db['UserWhatsappQueue'][_0xab53('0x54')]({'where':{'UserId':{'$in':_0x3daf66},'WhatsappQueueId':{'$in':_0x3d17e3}},'transaction':_0x448ae0});})[_0xab53('0x26')](function(){return db[_0xab53('0x6a')][_0xab53('0x46')]({'where':{'TeamId':_0x58e218}});})[_0xab53('0x26')](function(_0x569167){if(_0x569167===null){return;}return db['UserVoicePrefix'][_0xab53('0x54')]({'where':{'UserId':{'$in':_0x3daf66},'VoicePrefixId':_0x569167[_0xab53('0x6b')]},'transaction':_0x448ae0});})['then'](function(){return db[_0xab53('0x3d')][_0xab53('0x54')]({'where':{'id':_0x58e218},'cascade':!![],'transaction':_0x448ae0});})[_0xab53('0x26')](function(_0x1f59d0){if(_0x1f59d0===0x0){_0x366a22[_0xab53('0x1b')](0x194);}else{return db[_0xab53('0x50')][_0xab53('0x54')]({'where':{'type':_0xab53('0x4c'),'resourceId':_0x58e218},'cascade':!![],'transaction':_0x448ae0})[_0xab53('0x26')](function(){_0x366a22[_0xab53('0x1d')](0xcc)[_0xab53('0x1c')]();});}})[_0xab53('0x42')](function(_0x5d3fc0){_0x366a22[_0xab53('0x1d')](0x1f4)[_0xab53('0x28')](_0x5d3fc0);});});};exports[_0xab53('0x6c')]=function(_0x401897,_0x714758,_0x460f8c){return db[_0xab53('0x3d')]['findOne']({'where':{'id':_0x401897[_0xab53('0x44')]['id']}})['then'](handleEntityNotFound(_0x714758,null))['then'](function(_0x4373eb){if(!_0x401897['query']['channel']||!utils[_0xab53('0x6d')](_0x401897['query']['channel'])){throw new db[(_0xab53('0x57'))]['ValidationError'](_0xab53('0x6e'));}var _0x4f7f6e={};var _0x120a29={};_0x120a29['model']=_['keys'](db[_[_0xab53('0x6f')](_0x401897[_0xab53('0x2f')][_0xab53('0x70')][_0xab53('0x71')]())+'Queue']['rawAttributes']);_0x120a29[_0xab53('0x2f')]=_[_0xab53('0x45')](_0x401897[_0xab53('0x2f')]);_0x120a29[_0xab53('0x30')]=_[_0xab53('0x32')](_0x120a29[_0xab53('0x2e')],_0x120a29[_0xab53('0x2f')]);_0x4f7f6e['attributes']=_[_0xab53('0x32')](_0x120a29['model'],qs[_0xab53('0x33')](_0x401897[_0xab53('0x2f')][_0xab53('0x33')]));_0x4f7f6e['attributes']=_0x4f7f6e['attributes'][_0xab53('0x34')]?_0x4f7f6e[_0xab53('0x31')]:_0x120a29[_0xab53('0x2e')];_0x4f7f6e[_0xab53('0x21')]=qs[_0xab53('0x21')](_0x401897[_0xab53('0x2f')][_0xab53('0x21')]);_0x4f7f6e['offset']=qs[_0xab53('0x1e')](_0x401897['query'][_0xab53('0x1e')]);_0x4f7f6e[_0xab53('0x72')]=qs[_0xab53('0x36')](_0x401897[_0xab53('0x2f')][_0xab53('0x36')]);_0x4f7f6e['where']=qs[_0xab53('0x30')](_[_0xab53('0x37')](_0x401897[_0xab53('0x2f')],_0x120a29[_0xab53('0x30')]));_0x4f7f6e=_[_0xab53('0x39')]({},_0x4f7f6e,_0x401897[_0xab53('0x3c')]);return _0x4373eb[_0xab53('0x49')+_[_0xab53('0x6f')](_0x401897['query']['channel'][_0xab53('0x71')]())+_0xab53('0x73')](_0x4f7f6e);})[_0xab53('0x26')](respondWithResult(_0x714758,null))[_0xab53('0x42')](handleError(_0x714758,null));};exports['addQueues']=function(_0x1e0e6f,_0x58e1f5,_0x4f3d71){return db['Team'][_0xab53('0x74')]({'where':{'id':_0x1e0e6f['params']['id']}})['then'](function(_0xf7e487){if(_0xf7e487){if(!_0x1e0e6f[_0xab53('0x53')][_0xab53('0x70')]||!utils[_0xab53('0x6d')](_0x1e0e6f[_0xab53('0x53')][_0xab53('0x70')])){throw new db[(_0xab53('0x57'))]['ValidationError'](_0xab53('0x6e'));}return _0xf7e487['add'+_[_0xab53('0x6f')](_0x1e0e6f[_0xab53('0x53')]['channel'][_0xab53('0x71')]())+'Queues'](_0x1e0e6f[_0xab53('0x53')][_0xab53('0x75')]);}return null;})[_0xab53('0x26')](handleEntityNotFound(_0x58e1f5,null))[_0xab53('0x26')](respondWithStatusCode(_0x58e1f5,null))[_0xab53('0x42')](handleError(_0x58e1f5,null));};exports['removeQueues']=function(_0x4dfd7c,_0x47e712,_0x5caf43){return db[_0xab53('0x3d')][_0xab53('0x74')]({'where':{'id':_0x4dfd7c[_0xab53('0x44')]['id']}})[_0xab53('0x26')](function(_0x205668){if(_0x205668){if(!_0x4dfd7c['query'][_0xab53('0x70')]||!utils[_0xab53('0x6d')](_0x4dfd7c[_0xab53('0x2f')][_0xab53('0x70')])){throw new db[(_0xab53('0x57'))][(_0xab53('0x76'))](_0xab53('0x6e'));}return _0x205668[_0xab53('0x77')+_[_0xab53('0x6f')](_0x4dfd7c[_0xab53('0x2f')]['channel'][_0xab53('0x71')]())+_0xab53('0x73')](_0x4dfd7c['query'][_0xab53('0x75')]);}return null;})[_0xab53('0x26')](handleEntityNotFound(_0x47e712,null))[_0xab53('0x26')](respondWithStatusCode(_0x47e712,null))[_0xab53('0x42')](handleError(_0x47e712,null));};exports['addAgents']=function(_0x2ed6ee,_0x2176c5){var _0x2d97ca=_['isArray'](_0x2ed6ee[_0xab53('0x53')][_0xab53('0x75')])?_0x2ed6ee[_0xab53('0x53')][_0xab53('0x75')]:[_0x2ed6ee[_0xab53('0x53')][_0xab53('0x75')]];var _0x34181f=_0x2ed6ee[_0xab53('0x44')]['id'];return db[_0xab53('0x3d')]['find']({'where':{'id':_0x34181f}})[_0xab53('0x26')](handleEntityNotFound(_0x2176c5,null))[_0xab53('0x26')](function(_0x4367f4){if(_0x4367f4){var _0x266dd7=[_0xab53('0x78'),'Chat',_0xab53('0x79'),_0xab53('0x7a'),'Fax',_0xab53('0x7b'),'Whatsapp'];return db[_0xab53('0x55')]['transaction'](function(_0x523345){var _0x215801=_['map'](_0x266dd7,function(_0x1a3b2e){var _0x4fa791={'attributes':['id',_0xab53('0x27')]};if(_0x1a3b2e===_0xab53('0x78')){_0x4fa791[_0xab53('0x7c')]={'attributes':[_0xab53('0x7d')]};}return _0x4367f4[_0xab53('0x49')+_0x1a3b2e+'Queues'](_0x4fa791)['then'](function(_0x152c54){var _0x4f7ed8=_[_0xab53('0x2a')](_0x152c54,function(_0x2458e2){var _0x27bce4=_[_0xab53('0x2a')](_0x2d97ca,function(_0x54f9c7){var _0x5bab52={'where':{'UserId':_0x54f9c7,[_0x1a3b2e+_0xab53('0x7e')]:_0x2458e2['id']},'transaction':_0x523345};if(_0x1a3b2e==='Voice'){_0x5bab52['defaults']={'penalty':_0x2458e2[_0xab53('0x7f')]['penalty']};}return db[_0xab53('0x80')+_0x1a3b2e+_0xab53('0x81')][_0xab53('0x82')](_0x5bab52)['then'](function(){socket[_0xab53('0x83')](_0xab53('0x48')+_0x1a3b2e+_0xab53('0x84'),{'UserId':_0x54f9c7,[_0x1a3b2e+_0xab53('0x7e')]:_0x2458e2['id']});if(_0x1a3b2e!==_0xab53('0x78')){return;}return db['User'][_0xab53('0x40')]({'where':{'id':_0x2d97ca,'online':0x1},'attributes':['id',_0xab53('0x27'),_0xab53('0x85'),_0xab53('0x86'),'interface'],'raw':!![]})['then'](function(_0x507933){var _0x2ee293=_['map'](_0x507933,function(_0x808ba9){return db['UserVoiceQueueRt']['upsert']({'membername':_0x808ba9[_0xab53('0x27')],'UserId':_0x808ba9['id'],'queue_name':_0x2458e2[_0xab53('0x27')],'VoiceQueueId':_0x2458e2['id'],'interface':_[_0xab53('0x87')](_0x808ba9[_0xab53('0x88')])?util['format']('SIP/%s',_0x808ba9[_0xab53('0x27')]):_0x808ba9[_0xab53('0x88')],'paused':_0x808ba9[_0xab53('0x86')]||![],'penalty':_0x2458e2[_0xab53('0x7f')][_0xab53('0x7d')]},{'transaction':_0x523345});});return Promise['all'](_0x2ee293);});});});return Promise[_0xab53('0x89')](_0x27bce4);});return Promise['all'](_0x4f7ed8);})['then'](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x34181f}})[_0xab53('0x26')](function(_0x4ba722){if(_0x4ba722){var _0x233913=_[_0xab53('0x2a')](_0x2d97ca,function(_0x95dab4){db[_0xab53('0x8a')][_0xab53('0x8b')]({'UserId':_0x95dab4,'VoicePrefixId':_0x4ba722[_0xab53('0x6b')]});});return Promise[_0xab53('0x89')](_0x233913);}});});});return Promise[_0xab53('0x89')](_0x215801)['then'](function(){return _0x4367f4['addAgents'](_0x2d97ca,{'transaction':_0x523345})['spread'](function(_0x1c3b03){return _0x1c3b03;});});});}})[_0xab53('0x26')](respondWithResult(_0x2176c5,null))[_0xab53('0x42')](handleError(_0x2176c5,null));};exports[_0xab53('0x8c')]=function(_0x18612b,_0x277452){var _0x14f919=_[_0xab53('0x8d')](_0x18612b['query'][_0xab53('0x75')])?_0x18612b[_0xab53('0x2f')][_0xab53('0x75')]:[_0x18612b[_0xab53('0x2f')][_0xab53('0x75')]];var _0x72049b=_0x18612b[_0xab53('0x44')]['id'];return db[_0xab53('0x3d')][_0xab53('0x46')]({'where':{'id':_0x72049b}})[_0xab53('0x26')](handleEntityNotFound(_0x277452,null))[_0xab53('0x26')](function(_0x365e93){if(_0x365e93){var _0x3ea043=['Voice',_0xab53('0x8e'),_0xab53('0x79'),_0xab53('0x7a'),'Fax',_0xab53('0x7b'),_0xab53('0x8f')];return db['sequelize'][_0xab53('0x56')](function(_0x192f48){var _0x3b6662=_[_0xab53('0x2a')](_0x3ea043,function(_0x1b6d3f){var _0x5cf62e={'attributes':['id',_0xab53('0x27')]};return _0x365e93[_0xab53('0x49')+_0x1b6d3f+_0xab53('0x73')](_0x5cf62e)[_0xab53('0x26')](function(_0x30f514){var _0x17cdb3=_[_0xab53('0x2a')](_0x30f514,function(_0x2fbe67){return _0x2fbe67['removeAgents'](_0x14f919,{'transaction':_0x192f48})[_0xab53('0x26')](function(){var _0x561a72=_['map'](_0x14f919,function(_0x243b14){socket[_0xab53('0x83')](_0xab53('0x48')+_0x1b6d3f+'Queue:remove',{'UserId':Number(_0x243b14),[_0x1b6d3f+'QueueId']:_0x2fbe67['id']});if(_0x1b6d3f!=='Voice'){return;}return db[_0xab53('0x90')][_0xab53('0x54')]({'where':{'VoiceQueueId':_0x2fbe67['id'],'UserId':_0x243b14},'transaction':_0x192f48});});return Promise['all'](_0x561a72);});});return Promise['all'](_0x17cdb3);});});return Promise[_0xab53('0x89')](_0x3b6662)[_0xab53('0x26')](function(){return _0x365e93[_0xab53('0x8c')](_0x14f919,{'transaction':_0x192f48});})[_0xab53('0x26')](function(){return db['TeamVoicePrefix'][_0xab53('0x74')]({'where':{'teamId':_0x72049b}})[_0xab53('0x26')](function(_0x1d5ba1){if(_0x1d5ba1){var _0x275564=_[_0xab53('0x2a')](_0x14f919,function(_0x534b7a){db[_0xab53('0x8a')][_0xab53('0x54')]({'where':{'UserId':_0x534b7a,'VoicePrefixId':_0x1d5ba1[_0xab53('0x6b')]}});});return Promise['all'](_0x275564);}});});});}})[_0xab53('0x26')](respondWithStatusCode(_0x277452,null))[_0xab53('0x42')](handleError(_0x277452,null));};exports[_0xab53('0x91')]=function(_0x149452,_0x4f5109,_0x2b045d){var _0x5f4337={};var _0x19868b={};var _0x1dbe41;var _0x4f7109;return db['Team'][_0xab53('0x74')]({'where':{'id':_0x149452[_0xab53('0x44')]['id']}})[_0xab53('0x26')](handleEntityNotFound(_0x4f5109,null))[_0xab53('0x26')](function(_0x2c5a0b){if(_0x2c5a0b){_0x1dbe41=_0x2c5a0b;_0x19868b[_0xab53('0x2e')]=_[_0xab53('0x45')](db['User'][_0xab53('0x2b')]);_0x19868b[_0xab53('0x2f')]=_[_0xab53('0x45')](_0x149452[_0xab53('0x2f')]);_0x19868b[_0xab53('0x30')]=_['intersection'](_0x19868b[_0xab53('0x2e')],_0x19868b[_0xab53('0x2f')]);_0x5f4337['attributes']=_[_0xab53('0x32')](_0x19868b[_0xab53('0x2e')],qs[_0xab53('0x33')](_0x149452[_0xab53('0x2f')][_0xab53('0x33')]));_0x5f4337[_0xab53('0x31')]=_0x5f4337[_0xab53('0x31')][_0xab53('0x34')]?_0x5f4337[_0xab53('0x31')]:_0x19868b[_0xab53('0x2e')];_0x5f4337[_0xab53('0x72')]=qs[_0xab53('0x36')](_0x149452[_0xab53('0x2f')][_0xab53('0x36')]);_0x5f4337['where']=qs[_0xab53('0x30')](_[_0xab53('0x37')](_0x149452['query'],_0x19868b['filters']));if(_0x149452[_0xab53('0x2f')][_0xab53('0x3b')]){_0x5f4337[_0xab53('0x38')]=_[_0xab53('0x39')](_0x5f4337['where'],{'$or':_[_0xab53('0x2a')](_0x5f4337['attributes'],function(_0x44e34e){var _0x1327ea={};_0x1327ea[_0x44e34e]={'$like':'%'+_0x149452[_0xab53('0x2f')][_0xab53('0x3b')]+'%'};return _0x1327ea;})});}_0x5f4337=_[_0xab53('0x39')]({},_0x5f4337,_0x149452['options']);return _0x1dbe41[_0xab53('0x91')](_0x5f4337);}})[_0xab53('0x26')](function(_0x5c9a91){if(_0x5c9a91){_0x4f7109=_0x5c9a91[_0xab53('0x34')];if(!_0x149452['query'][_0xab53('0x35')](_0xab53('0x92'))){_0x5f4337[_0xab53('0x21')]=qs[_0xab53('0x21')](_0x149452[_0xab53('0x2f')][_0xab53('0x21')]);_0x5f4337[_0xab53('0x1e')]=qs[_0xab53('0x1e')](_0x149452[_0xab53('0x2f')][_0xab53('0x1e')]);}return _0x1dbe41[_0xab53('0x91')](_0x5f4337);}})['then'](function(_0x211a0d){if(_0x211a0d){return _0x211a0d?{'count':_0x4f7109,'rows':_0x211a0d}:null;}})[_0xab53('0x26')](respondWithResult(_0x4f5109,null))[_0xab53('0x42')](handleError(_0x4f5109,null));};
\ No newline at end of file
+var _0x7b8e=['remove','addAgents','Voice','Chat','Mail','Fax','Openchannel','Whatsapp','transaction','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','interface','upsert','isNil','format','voicePause','all','spread','removeAgents','isArray','Sms','Queue:remove','UserVoiceQueueRt','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./team.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','Team','rawAttributes','fieldName','type','key','model','keys','intersection','query','fields','attributes','length','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','UserProfileResource','end','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','Queue','order','toLowerCase','Queues','addQueues','findOne','add','ids'];(function(_0x5538b1,_0x45c1ef){var _0x31deff=function(_0xd1ac9b){while(--_0xd1ac9b){_0x5538b1['push'](_0x5538b1['shift']());}};_0x31deff(++_0x45c1ef);}(_0x7b8e,0x1f2));var _0xe7b8=function(_0x1f22a8,_0x414e3d){_0x1f22a8=_0x1f22a8-0x0;var _0x35cde2=_0x7b8e[_0x1f22a8];return _0x35cde2;};'use strict';var emlformat=require(_0xe7b8('0x0'));var rimraf=require(_0xe7b8('0x1'));var zipdir=require(_0xe7b8('0x2'));var jsonpatch=require(_0xe7b8('0x3'));var rp=require('request-promise');var moment=require(_0xe7b8('0x4'));var BPromise=require(_0xe7b8('0x5'));var Mustache=require(_0xe7b8('0x6'));var util=require('util');var path=require(_0xe7b8('0x7'));var sox=require(_0xe7b8('0x8'));var csv=require(_0xe7b8('0x9'));var ejs=require(_0xe7b8('0xa'));var fs=require('fs');var fs_extra=require(_0xe7b8('0xb'));var _=require(_0xe7b8('0xc'));var squel=require(_0xe7b8('0xd'));var crypto=require(_0xe7b8('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe7b8('0xf'));var toCsv=require(_0xe7b8('0x9'));var querystring=require(_0xe7b8('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7b8('0x11'));var qs=require(_0xe7b8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe7b8('0x13'));var logger=require(_0xe7b8('0x14'))('api');var utils=require(_0xe7b8('0x15'));var config=require(_0xe7b8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe7b8('0x17'))['db'];config[_0xe7b8('0x18')]=_[_0xe7b8('0x19')](config['redis'],{'host':_0xe7b8('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe7b8('0x18')]));require(_0xe7b8('0x1b'))[_0xe7b8('0x1c')](socket);function respondWithStatusCode(_0x3721cc,_0x33db6c){_0x33db6c=_0x33db6c||0xcc;return function(_0x2df8fa){if(_0x2df8fa){return _0x3721cc[_0xe7b8('0x1d')](_0x33db6c);}return _0x3721cc[_0xe7b8('0x1e')](_0x33db6c)['end']();};}function respondWithResult(_0x14fc68,_0x1ac6c9){_0x1ac6c9=_0x1ac6c9||0xc8;return function(_0x4d134a){if(_0x4d134a){return _0x14fc68[_0xe7b8('0x1e')](_0x1ac6c9)[_0xe7b8('0x1f')](_0x4d134a);}};}function respondWithFilteredResult(_0x408eae,_0x207d9b){return function(_0x2e8341){if(_0x2e8341){var _0x1f8195=typeof _0x207d9b[_0xe7b8('0x20')]===_0xe7b8('0x21')&&typeof _0x207d9b['limit']===_0xe7b8('0x21');var _0x14724d=_0x2e8341[_0xe7b8('0x22')];var _0x32331c=_0x1f8195?0x0:_0x207d9b['offset'];var _0x2ba1db=_0x1f8195?_0x2e8341[_0xe7b8('0x22')]:_0x207d9b[_0xe7b8('0x20')]+_0x207d9b[_0xe7b8('0x23')];var _0xa81d53;if(_0x2ba1db>=_0x14724d){_0x2ba1db=_0x14724d;_0xa81d53=0xc8;}else{_0xa81d53=0xce;}_0x408eae[_0xe7b8('0x1e')](_0xa81d53);return _0x408eae['set'](_0xe7b8('0x24'),_0x32331c+'-'+_0x2ba1db+'/'+_0x14724d)['json'](_0x2e8341);}return null;};}function patchUpdates(_0x17efa2){return function(_0xb22e70){try{jsonpatch[_0xe7b8('0x25')](_0xb22e70,_0x17efa2,!![]);}catch(_0x10fb10){return BPromise[_0xe7b8('0x26')](_0x10fb10);}return _0xb22e70[_0xe7b8('0x27')]();};}function saveUpdates(_0x177eec,_0x2d70b7){return function(_0x5538f3){if(_0x5538f3){return _0x5538f3[_0xe7b8('0x28')](_0x177eec)[_0xe7b8('0x29')](function(_0x57c949){return _0x57c949;});}return null;};}function handleEntityNotFound(_0x7cfca7,_0x292f9f){return function(_0x542246){if(!_0x542246){_0x7cfca7[_0xe7b8('0x1d')](0x194);}return _0x542246;};}function handleError(_0x425074,_0x2dcac5){_0x2dcac5=_0x2dcac5||0x1f4;return function(_0x1ed6db){logger[_0xe7b8('0x2a')](_0x1ed6db[_0xe7b8('0x2b')]);if(_0x1ed6db[_0xe7b8('0x2c')]){delete _0x1ed6db['name'];}_0x425074[_0xe7b8('0x1e')](_0x2dcac5)[_0xe7b8('0x2d')](_0x1ed6db);};}exports[_0xe7b8('0x2e')]=function(_0x2166d6,_0xbf41dc){var _0x3176ee={},_0x29b847={},_0x249a77={'count':0x0,'rows':[]};var _0x34b473=_[_0xe7b8('0x2f')](db[_0xe7b8('0x30')][_0xe7b8('0x31')],function(_0x37e6d9){return{'name':_0x37e6d9[_0xe7b8('0x32')],'type':_0x37e6d9[_0xe7b8('0x33')][_0xe7b8('0x34')]};});_0x29b847[_0xe7b8('0x35')]=_['map'](_0x34b473,_0xe7b8('0x2c'));_0x29b847['query']=_[_0xe7b8('0x36')](_0x2166d6['query']);_0x29b847['filters']=_[_0xe7b8('0x37')](_0x29b847['model'],_0x29b847[_0xe7b8('0x38')]);_0x3176ee['attributes']=_[_0xe7b8('0x37')](_0x29b847[_0xe7b8('0x35')],qs[_0xe7b8('0x39')](_0x2166d6[_0xe7b8('0x38')][_0xe7b8('0x39')]));_0x3176ee[_0xe7b8('0x3a')]=_0x3176ee[_0xe7b8('0x3a')][_0xe7b8('0x3b')]?_0x3176ee['attributes']:_0x29b847[_0xe7b8('0x35')];if(!_0x2166d6[_0xe7b8('0x38')]['hasOwnProperty'](_0xe7b8('0x3c'))){_0x3176ee[_0xe7b8('0x23')]=qs['limit'](_0x2166d6['query'][_0xe7b8('0x23')]);_0x3176ee[_0xe7b8('0x20')]=qs['offset'](_0x2166d6[_0xe7b8('0x38')]['offset']);}_0x3176ee['order']=qs[_0xe7b8('0x3d')](_0x2166d6['query'][_0xe7b8('0x3d')]);_0x3176ee[_0xe7b8('0x3e')]=qs[_0xe7b8('0x3f')](_['pick'](_0x2166d6[_0xe7b8('0x38')],_0x29b847[_0xe7b8('0x3f')]),_0x34b473);if(_0x2166d6[_0xe7b8('0x38')][_0xe7b8('0x40')]){_0x3176ee[_0xe7b8('0x3e')]=_[_0xe7b8('0x41')](_0x3176ee['where'],{'$or':_['map'](_0x34b473,function(_0x414890){if(_0x414890[_0xe7b8('0x33')]!==_0xe7b8('0x42')){var _0x5601b0={};_0x5601b0[_0x414890[_0xe7b8('0x2c')]]={'$like':'%'+_0x2166d6[_0xe7b8('0x38')][_0xe7b8('0x40')]+'%'};return _0x5601b0;}})});}_0x3176ee=_[_0xe7b8('0x41')]({},_0x3176ee,_0x2166d6[_0xe7b8('0x43')]);var _0x4ead70={'where':_0x3176ee['where']};return db['Team']['count'](_0x4ead70)[_0xe7b8('0x29')](function(_0x3c31f3){_0x249a77[_0xe7b8('0x22')]=_0x3c31f3;if(_0x2166d6[_0xe7b8('0x38')][_0xe7b8('0x44')]){_0x3176ee['include']=[{'all':!![]}];}return db[_0xe7b8('0x30')][_0xe7b8('0x45')](_0x3176ee);})[_0xe7b8('0x29')](function(_0x8397e3){_0x249a77[_0xe7b8('0x46')]=_0x8397e3;return _0x249a77;})[_0xe7b8('0x29')](respondWithFilteredResult(_0xbf41dc,_0x3176ee))[_0xe7b8('0x47')](handleError(_0xbf41dc,null));};exports[_0xe7b8('0x48')]=function(_0x1a6196,_0x321acc){var _0x59f062={'raw':![],'where':{'id':_0x1a6196['params']['id']}},_0x402e0b={};_0x402e0b[_0xe7b8('0x35')]=_[_0xe7b8('0x36')](db[_0xe7b8('0x30')][_0xe7b8('0x31')]);_0x402e0b['query']=_[_0xe7b8('0x36')](_0x1a6196[_0xe7b8('0x38')]);_0x402e0b[_0xe7b8('0x3f')]=_['intersection'](_0x402e0b['model'],_0x402e0b[_0xe7b8('0x38')]);_0x59f062[_0xe7b8('0x3a')]=_[_0xe7b8('0x37')](_0x402e0b['model'],qs['fields'](_0x1a6196['query']['fields']));_0x59f062[_0xe7b8('0x3a')]=_0x59f062['attributes'][_0xe7b8('0x3b')]?_0x59f062[_0xe7b8('0x3a')]:_0x402e0b[_0xe7b8('0x35')];if(_0x1a6196[_0xe7b8('0x38')][_0xe7b8('0x44')]){_0x59f062[_0xe7b8('0x49')]=[{'all':!![]}];}_0x59f062=_['merge']({},_0x59f062,_0x1a6196['options']);return db[_0xe7b8('0x30')][_0xe7b8('0x4a')](_0x59f062)[_0xe7b8('0x29')](handleEntityNotFound(_0x321acc,null))['then'](respondWithResult(_0x321acc,null))[_0xe7b8('0x47')](handleError(_0x321acc,null));};exports[_0xe7b8('0x4b')]=function(_0x2292a2,_0x815d82){return db[_0xe7b8('0x30')]['create'](_0x2292a2[_0xe7b8('0x4c')],{})[_0xe7b8('0x29')](function(_0x1f898a){var _0x4ca61f=_0x2292a2[_0xe7b8('0x4d')][_0xe7b8('0x4e')]({'plain':!![]});if(!_0x4ca61f)throw new Error(_0xe7b8('0x4f'));if(_0x4ca61f[_0xe7b8('0x50')]===_0xe7b8('0x4d')){var _0x579037=_0x1f898a[_0xe7b8('0x4e')]({'plain':!![]});var _0x495bd7=_0xe7b8('0x51');return db['UserProfileSection']['find']({'where':{'name':_0x495bd7,'userProfileId':_0x4ca61f['userProfileId']},'raw':!![]})[_0xe7b8('0x29')](function(_0x333225){if(_0x333225&&_0x333225[_0xe7b8('0x52')]===0x0){return db['UserProfileResource'][_0xe7b8('0x4b')]({'name':_0x579037[_0xe7b8('0x2c')],'resourceId':_0x579037['id'],'type':_0x333225[_0xe7b8('0x2c')],'sectionId':_0x333225['id']},{})[_0xe7b8('0x29')](function(){return _0x1f898a;});}else{return _0x1f898a;}})[_0xe7b8('0x47')](function(_0x36faa7){logger[_0xe7b8('0x2a')](_0xe7b8('0x53'),_0x36faa7);throw _0x36faa7;});}return _0x1f898a;})[_0xe7b8('0x29')](respondWithResult(_0x815d82,0xc9))[_0xe7b8('0x47')](handleError(_0x815d82,null));};exports[_0xe7b8('0x28')]=function(_0x1b8404,_0x4558d5){if(_0x1b8404[_0xe7b8('0x4c')]['id']){delete _0x1b8404['body']['id'];}return db[_0xe7b8('0x30')][_0xe7b8('0x4a')]({'where':{'id':_0x1b8404[_0xe7b8('0x54')]['id']}})[_0xe7b8('0x29')](handleEntityNotFound(_0x4558d5,null))[_0xe7b8('0x29')](saveUpdates(_0x1b8404[_0xe7b8('0x4c')],null))[_0xe7b8('0x29')](respondWithResult(_0x4558d5,null))[_0xe7b8('0x47')](handleError(_0x4558d5,null));};exports[_0xe7b8('0x55')]=function(_0x51cd54,_0x32927e){var _0x18065=_0x51cd54[_0xe7b8('0x54')]['id'];var _0x39bee2=[];return db[_0xe7b8('0x56')]['transaction'](function(_0x452974){var _0x509407=_0xe7b8('0x57')+_0x18065;return db[_0xe7b8('0x56')][_0xe7b8('0x38')](_0x509407,{'type':db[_0xe7b8('0x58')][_0xe7b8('0x59')]['SELECT'],'raw':!![],'transaction':_0x452974})[_0xe7b8('0x29')](function(_0x4d4d28){_0x39bee2=_[_0xe7b8('0x2f')](_0x4d4d28,function(_0x35c65b){return Number(_0x35c65b[_0xe7b8('0x5a')]);});})[_0xe7b8('0x29')](function(){var _0x194783=_0xe7b8('0x5b')+_0x18065;return db[_0xe7b8('0x56')][_0xe7b8('0x38')](_0x194783,{'type':db[_0xe7b8('0x58')][_0xe7b8('0x59')][_0xe7b8('0x5c')],'raw':!![],'transaction':_0x452974});})[_0xe7b8('0x29')](function(_0x2a5d1f){var _0x444206=_[_0xe7b8('0x2f')](_0x2a5d1f,function(_0x30b700){return Number(_0x30b700[_0xe7b8('0x5d')]);});return db['UserVoiceQueue']['destroy']({'where':{'UserId':{'$in':_0x39bee2},'VoiceQueueId':{'$in':_0x444206}},'transaction':_0x452974});})[_0xe7b8('0x29')](function(){var _0x289953=_0xe7b8('0x5e')+_0x18065;return db[_0xe7b8('0x56')]['query'](_0x289953,{'type':db['Sequelize'][_0xe7b8('0x59')][_0xe7b8('0x5c')],'raw':!![],'transaction':_0x452974});})[_0xe7b8('0x29')](function(_0x2ac552){var _0x103de3=_[_0xe7b8('0x2f')](_0x2ac552,function(_0xc82a06){return Number(_0xc82a06[_0xe7b8('0x5f')]);});return db[_0xe7b8('0x60')]['destroy']({'where':{'UserId':{'$in':_0x39bee2},'MailQueueId':{'$in':_0x103de3}},'transaction':_0x452974});})[_0xe7b8('0x29')](function(){var _0x2b2cc8=_0xe7b8('0x61')+_0x18065;return db[_0xe7b8('0x56')][_0xe7b8('0x38')](_0x2b2cc8,{'type':db[_0xe7b8('0x58')][_0xe7b8('0x59')]['SELECT'],'raw':!![],'transaction':_0x452974});})[_0xe7b8('0x29')](function(_0x36392d){var _0xba5825=_[_0xe7b8('0x2f')](_0x36392d,function(_0x2ed965){return Number(_0x2ed965[_0xe7b8('0x62')]);});return db[_0xe7b8('0x63')][_0xe7b8('0x55')]({'where':{'UserId':{'$in':_0x39bee2},'SmsQueueId':{'$in':_0xba5825}},'transaction':_0x452974});})[_0xe7b8('0x29')](function(){var _0x355f65=_0xe7b8('0x64')+_0x18065;return db[_0xe7b8('0x56')][_0xe7b8('0x38')](_0x355f65,{'type':db[_0xe7b8('0x58')][_0xe7b8('0x59')][_0xe7b8('0x5c')],'raw':!![],'transaction':_0x452974});})['then'](function(_0xe63295){var _0x2f832e=_[_0xe7b8('0x2f')](_0xe63295,function(_0x4c5087){return Number(_0x4c5087[_0xe7b8('0x65')]);});return db['UserChatQueue'][_0xe7b8('0x55')]({'where':{'UserId':{'$in':_0x39bee2},'ChatQueueId':{'$in':_0x2f832e}},'transaction':_0x452974});})['then'](function(){var _0x5ba333=_0xe7b8('0x66')+_0x18065;return db[_0xe7b8('0x56')][_0xe7b8('0x38')](_0x5ba333,{'type':db[_0xe7b8('0x58')][_0xe7b8('0x59')][_0xe7b8('0x5c')],'raw':!![],'transaction':_0x452974});})['then'](function(_0x36d101){var _0xbe61e4=_[_0xe7b8('0x2f')](_0x36d101,function(_0x1a7bd1){return Number(_0x1a7bd1['FaxQueueId']);});return db[_0xe7b8('0x67')][_0xe7b8('0x55')]({'where':{'UserId':{'$in':_0x39bee2},'FaxQueueId':{'$in':_0xbe61e4}},'transaction':_0x452974});})['then'](function(){var _0x437426=_0xe7b8('0x68')+_0x18065;return db[_0xe7b8('0x56')][_0xe7b8('0x38')](_0x437426,{'type':db[_0xe7b8('0x58')]['QueryTypes'][_0xe7b8('0x5c')],'raw':!![],'transaction':_0x452974});})['then'](function(_0x7551ef){var _0x1422c5=_[_0xe7b8('0x2f')](_0x7551ef,function(_0x3b6740){return Number(_0x3b6740[_0xe7b8('0x69')]);});return db['UserOpenchannelQueue'][_0xe7b8('0x55')]({'where':{'UserId':{'$in':_0x39bee2},'OpenchannelQueueId':{'$in':_0x1422c5}},'transaction':_0x452974});})[_0xe7b8('0x29')](function(){var _0x35cb6c=_0xe7b8('0x6a')+_0x18065;return db['sequelize'][_0xe7b8('0x38')](_0x35cb6c,{'type':db[_0xe7b8('0x58')][_0xe7b8('0x59')][_0xe7b8('0x5c')],'raw':!![],'transaction':_0x452974});})[_0xe7b8('0x29')](function(_0x4a6e13){var _0x299b98=_[_0xe7b8('0x2f')](_0x4a6e13,function(_0x2c4184){return Number(_0x2c4184[_0xe7b8('0x6b')]);});return db['UserWhatsappQueue'][_0xe7b8('0x55')]({'where':{'UserId':{'$in':_0x39bee2},'WhatsappQueueId':{'$in':_0x299b98}},'transaction':_0x452974});})[_0xe7b8('0x29')](function(){return db[_0xe7b8('0x6c')][_0xe7b8('0x4a')]({'where':{'TeamId':_0x18065}});})['then'](function(_0x2335b4){if(_0x2335b4===null){return;}return db[_0xe7b8('0x6d')]['destroy']({'where':{'UserId':{'$in':_0x39bee2},'VoicePrefixId':_0x2335b4[_0xe7b8('0x6e')]},'transaction':_0x452974});})['then'](function(){return db[_0xe7b8('0x30')][_0xe7b8('0x55')]({'where':{'id':_0x18065},'cascade':!![],'transaction':_0x452974});})[_0xe7b8('0x29')](function(_0x51bb58){if(_0x51bb58===0x0){_0x32927e['sendStatus'](0x194);}else{return db[_0xe7b8('0x6f')]['destroy']({'where':{'type':'Teams','resourceId':_0x18065},'cascade':!![],'transaction':_0x452974})[_0xe7b8('0x29')](function(){_0x32927e[_0xe7b8('0x1e')](0xcc)[_0xe7b8('0x70')]();});}})[_0xe7b8('0x47')](function(_0x1474ac){_0x32927e[_0xe7b8('0x1e')](0x1f4)['send'](_0x1474ac);});});};exports['getQueues']=function(_0x130d0c,_0x14a5b7,_0x10fc73){return db[_0xe7b8('0x30')]['findOne']({'where':{'id':_0x130d0c['params']['id']}})[_0xe7b8('0x29')](handleEntityNotFound(_0x14a5b7,null))[_0xe7b8('0x29')](function(_0x2bbff3){if(!_0x130d0c[_0xe7b8('0x38')][_0xe7b8('0x71')]||!utils[_0xe7b8('0x72')](_0x130d0c[_0xe7b8('0x38')][_0xe7b8('0x71')])){throw new db[(_0xe7b8('0x58'))][(_0xe7b8('0x73'))](_0xe7b8('0x74'));}var _0x177f9e={};var _0xc34c10={};_0xc34c10[_0xe7b8('0x35')]=_[_0xe7b8('0x36')](db[_[_0xe7b8('0x75')](_0x130d0c[_0xe7b8('0x38')][_0xe7b8('0x71')]['toLowerCase']())+_0xe7b8('0x76')]['rawAttributes']);_0xc34c10[_0xe7b8('0x38')]=_['keys'](_0x130d0c[_0xe7b8('0x38')]);_0xc34c10['filters']=_[_0xe7b8('0x37')](_0xc34c10['model'],_0xc34c10[_0xe7b8('0x38')]);_0x177f9e[_0xe7b8('0x3a')]=_[_0xe7b8('0x37')](_0xc34c10[_0xe7b8('0x35')],qs[_0xe7b8('0x39')](_0x130d0c['query'][_0xe7b8('0x39')]));_0x177f9e[_0xe7b8('0x3a')]=_0x177f9e['attributes'][_0xe7b8('0x3b')]?_0x177f9e[_0xe7b8('0x3a')]:_0xc34c10[_0xe7b8('0x35')];_0x177f9e[_0xe7b8('0x23')]=qs['limit'](_0x130d0c[_0xe7b8('0x38')][_0xe7b8('0x23')]);_0x177f9e[_0xe7b8('0x20')]=qs[_0xe7b8('0x20')](_0x130d0c['query'][_0xe7b8('0x20')]);_0x177f9e[_0xe7b8('0x77')]=qs[_0xe7b8('0x3d')](_0x130d0c['query']['sort']);_0x177f9e['where']=qs[_0xe7b8('0x3f')](_['pick'](_0x130d0c['query'],_0xc34c10[_0xe7b8('0x3f')]));_0x177f9e=_[_0xe7b8('0x41')]({},_0x177f9e,_0x130d0c[_0xe7b8('0x43')]);return _0x2bbff3[_0xe7b8('0x4e')+_['capitalize'](_0x130d0c[_0xe7b8('0x38')][_0xe7b8('0x71')][_0xe7b8('0x78')]())+_0xe7b8('0x79')](_0x177f9e);})[_0xe7b8('0x29')](respondWithResult(_0x14a5b7,null))[_0xe7b8('0x47')](handleError(_0x14a5b7,null));};exports[_0xe7b8('0x7a')]=function(_0x6e6df8,_0x350cc9,_0x1faa24){return db[_0xe7b8('0x30')][_0xe7b8('0x7b')]({'where':{'id':_0x6e6df8[_0xe7b8('0x54')]['id']}})[_0xe7b8('0x29')](function(_0x48fc86){if(_0x48fc86){if(!_0x6e6df8['body'][_0xe7b8('0x71')]||!utils[_0xe7b8('0x72')](_0x6e6df8['body']['channel'])){throw new db[(_0xe7b8('0x58'))]['ValidationError'](_0xe7b8('0x74'));}return _0x48fc86[_0xe7b8('0x7c')+_[_0xe7b8('0x75')](_0x6e6df8[_0xe7b8('0x4c')][_0xe7b8('0x71')]['toLowerCase']())+'Queues'](_0x6e6df8[_0xe7b8('0x4c')][_0xe7b8('0x7d')]);}return null;})[_0xe7b8('0x29')](handleEntityNotFound(_0x350cc9,null))[_0xe7b8('0x29')](respondWithStatusCode(_0x350cc9,null))[_0xe7b8('0x47')](handleError(_0x350cc9,null));};exports['removeQueues']=function(_0x52e957,_0x4f5093,_0x12500e){return db[_0xe7b8('0x30')][_0xe7b8('0x7b')]({'where':{'id':_0x52e957[_0xe7b8('0x54')]['id']}})[_0xe7b8('0x29')](function(_0x5b1a90){if(_0x5b1a90){if(!_0x52e957['query'][_0xe7b8('0x71')]||!utils['isValidChannel'](_0x52e957['query'][_0xe7b8('0x71')])){throw new db[(_0xe7b8('0x58'))]['ValidationError']('Unknown\x20channel');}return _0x5b1a90[_0xe7b8('0x7e')+_[_0xe7b8('0x75')](_0x52e957['query'][_0xe7b8('0x71')][_0xe7b8('0x78')]())+_0xe7b8('0x79')](_0x52e957[_0xe7b8('0x38')][_0xe7b8('0x7d')]);}return null;})[_0xe7b8('0x29')](handleEntityNotFound(_0x4f5093,null))[_0xe7b8('0x29')](respondWithStatusCode(_0x4f5093,null))[_0xe7b8('0x47')](handleError(_0x4f5093,null));};exports[_0xe7b8('0x7f')]=function(_0x369d16,_0x3feff7){var _0x3f3597=_['isArray'](_0x369d16[_0xe7b8('0x4c')][_0xe7b8('0x7d')])?_0x369d16[_0xe7b8('0x4c')][_0xe7b8('0x7d')]:[_0x369d16[_0xe7b8('0x4c')][_0xe7b8('0x7d')]];var _0x48a0a8=_0x369d16[_0xe7b8('0x54')]['id'];return db[_0xe7b8('0x30')][_0xe7b8('0x4a')]({'where':{'id':_0x48a0a8}})[_0xe7b8('0x29')](handleEntityNotFound(_0x3feff7,null))['then'](function(_0x2c2b5f){if(_0x2c2b5f){var _0x53ad0f=[_0xe7b8('0x80'),_0xe7b8('0x81'),_0xe7b8('0x82'),'Sms',_0xe7b8('0x83'),_0xe7b8('0x84'),_0xe7b8('0x85')];return db[_0xe7b8('0x56')][_0xe7b8('0x86')](function(_0x48d619){var _0x258055=_[_0xe7b8('0x2f')](_0x53ad0f,function(_0x198847){var _0x165311={'attributes':['id','name']};if(_0x198847===_0xe7b8('0x80')){_0x165311[_0xe7b8('0x87')]={'attributes':[_0xe7b8('0x88')]};}return _0x2c2b5f[_0xe7b8('0x4e')+_0x198847+_0xe7b8('0x79')](_0x165311)[_0xe7b8('0x29')](function(_0x3921a0){var _0x3b239f=_[_0xe7b8('0x2f')](_0x3921a0,function(_0xded9af){var _0x499d92=_['map'](_0x3f3597,function(_0x53bafc){var _0x2c4364={'where':{'UserId':_0x53bafc,[_0x198847+_0xe7b8('0x89')]:_0xded9af['id']},'transaction':_0x48d619};if(_0x198847==='Voice'){_0x2c4364[_0xe7b8('0x19')]={'penalty':_0xded9af[_0xe7b8('0x8a')]['penalty']};}return db[_0xe7b8('0x8b')+_0x198847+_0xe7b8('0x76')][_0xe7b8('0x8c')](_0x2c4364)[_0xe7b8('0x29')](function(){socket[_0xe7b8('0x8d')](_0xe7b8('0x4d')+_0x198847+_0xe7b8('0x8e'),{'UserId':_0x53bafc,[_0x198847+_0xe7b8('0x89')]:_0xded9af['id']});if(_0x198847!=='Voice'){return;}return db[_0xe7b8('0x8b')][_0xe7b8('0x45')]({'where':{'id':_0x3f3597,'online':0x1},'attributes':['id',_0xe7b8('0x2c'),'online','voicePause',_0xe7b8('0x8f')],'raw':!![]})[_0xe7b8('0x29')](function(_0x599ef6){var _0x1ebcf9=_[_0xe7b8('0x2f')](_0x599ef6,function(_0x3eb282){return db['UserVoiceQueueRt'][_0xe7b8('0x90')]({'membername':_0x3eb282[_0xe7b8('0x2c')],'UserId':_0x3eb282['id'],'queue_name':_0xded9af[_0xe7b8('0x2c')],'VoiceQueueId':_0xded9af['id'],'interface':_[_0xe7b8('0x91')](_0x3eb282['interface'])?util[_0xe7b8('0x92')]('SIP/%s',_0x3eb282['name']):_0x3eb282['interface'],'paused':_0x3eb282[_0xe7b8('0x93')]||![],'penalty':_0xded9af[_0xe7b8('0x8a')][_0xe7b8('0x88')]},{'transaction':_0x48d619});});return Promise[_0xe7b8('0x94')](_0x1ebcf9);});});});return Promise[_0xe7b8('0x94')](_0x499d92);});return Promise[_0xe7b8('0x94')](_0x3b239f);})['then'](function(){return db[_0xe7b8('0x6c')][_0xe7b8('0x7b')]({'where':{'teamId':_0x48a0a8}})['then'](function(_0x3e8da5){if(_0x3e8da5){var _0x47c268=_[_0xe7b8('0x2f')](_0x3f3597,function(_0x54e0cc){db[_0xe7b8('0x6d')][_0xe7b8('0x90')]({'UserId':_0x54e0cc,'VoicePrefixId':_0x3e8da5['VoicePrefixId']});});return Promise[_0xe7b8('0x94')](_0x47c268);}});});});return Promise[_0xe7b8('0x94')](_0x258055)[_0xe7b8('0x29')](function(){return _0x2c2b5f[_0xe7b8('0x7f')](_0x3f3597,{'transaction':_0x48d619})[_0xe7b8('0x95')](function(_0xbded0a){return _0xbded0a;});});});}})[_0xe7b8('0x29')](respondWithResult(_0x3feff7,null))[_0xe7b8('0x47')](handleError(_0x3feff7,null));};exports[_0xe7b8('0x96')]=function(_0x472282,_0x1bf90b){var _0xda4a84=_[_0xe7b8('0x97')](_0x472282['query'][_0xe7b8('0x7d')])?_0x472282[_0xe7b8('0x38')]['ids']:[_0x472282[_0xe7b8('0x38')][_0xe7b8('0x7d')]];var _0x28ec78=_0x472282['params']['id'];return db['Team'][_0xe7b8('0x4a')]({'where':{'id':_0x28ec78}})[_0xe7b8('0x29')](handleEntityNotFound(_0x1bf90b,null))[_0xe7b8('0x29')](function(_0x1034df){if(_0x1034df){var _0xa4b955=[_0xe7b8('0x80'),_0xe7b8('0x81'),_0xe7b8('0x82'),_0xe7b8('0x98'),'Fax','Openchannel',_0xe7b8('0x85')];return db[_0xe7b8('0x56')]['transaction'](function(_0x2b7311){var _0x2fbc63=_[_0xe7b8('0x2f')](_0xa4b955,function(_0x772a69){var _0x8315e1={'attributes':['id','name']};return _0x1034df[_0xe7b8('0x4e')+_0x772a69+_0xe7b8('0x79')](_0x8315e1)[_0xe7b8('0x29')](function(_0x526cd2){var _0x19eaa1=_['map'](_0x526cd2,function(_0x2f3c57){return _0x2f3c57[_0xe7b8('0x96')](_0xda4a84,{'transaction':_0x2b7311})['then'](function(){var _0x30ab1c=_[_0xe7b8('0x2f')](_0xda4a84,function(_0x386f37){socket[_0xe7b8('0x8d')](_0xe7b8('0x4d')+_0x772a69+_0xe7b8('0x99'),{'UserId':Number(_0x386f37),[_0x772a69+_0xe7b8('0x89')]:_0x2f3c57['id']});if(_0x772a69!=='Voice'){return;}return db[_0xe7b8('0x9a')][_0xe7b8('0x55')]({'where':{'VoiceQueueId':_0x2f3c57['id'],'UserId':_0x386f37},'transaction':_0x2b7311});});return Promise[_0xe7b8('0x94')](_0x30ab1c);});});return Promise[_0xe7b8('0x94')](_0x19eaa1);});});return Promise[_0xe7b8('0x94')](_0x2fbc63)[_0xe7b8('0x29')](function(){return _0x1034df[_0xe7b8('0x96')](_0xda4a84,{'transaction':_0x2b7311});})['then'](function(){return db[_0xe7b8('0x6c')][_0xe7b8('0x7b')]({'where':{'teamId':_0x28ec78}})[_0xe7b8('0x29')](function(_0xea15ca){if(_0xea15ca){var _0x4c4e61=_['map'](_0xda4a84,function(_0x460b37){db[_0xe7b8('0x6d')]['destroy']({'where':{'UserId':_0x460b37,'VoicePrefixId':_0xea15ca['VoicePrefixId']}});});return Promise['all'](_0x4c4e61);}});});});}})[_0xe7b8('0x29')](respondWithStatusCode(_0x1bf90b,null))[_0xe7b8('0x47')](handleError(_0x1bf90b,null));};exports[_0xe7b8('0x9b')]=function(_0x2f33b6,_0x46bcee,_0x101a1b){var _0x26d97b={};var _0x2172f1={};var _0x8fb828;var _0x4d107e;return db['Team'][_0xe7b8('0x7b')]({'where':{'id':_0x2f33b6['params']['id']}})[_0xe7b8('0x29')](handleEntityNotFound(_0x46bcee,null))[_0xe7b8('0x29')](function(_0x281eba){if(_0x281eba){_0x8fb828=_0x281eba;_0x2172f1[_0xe7b8('0x35')]=_[_0xe7b8('0x36')](db[_0xe7b8('0x8b')][_0xe7b8('0x31')]);_0x2172f1[_0xe7b8('0x38')]=_[_0xe7b8('0x36')](_0x2f33b6[_0xe7b8('0x38')]);_0x2172f1[_0xe7b8('0x3f')]=_[_0xe7b8('0x37')](_0x2172f1[_0xe7b8('0x35')],_0x2172f1[_0xe7b8('0x38')]);_0x26d97b[_0xe7b8('0x3a')]=_['intersection'](_0x2172f1[_0xe7b8('0x35')],qs[_0xe7b8('0x39')](_0x2f33b6[_0xe7b8('0x38')][_0xe7b8('0x39')]));_0x26d97b[_0xe7b8('0x3a')]=_0x26d97b['attributes'][_0xe7b8('0x3b')]?_0x26d97b[_0xe7b8('0x3a')]:_0x2172f1[_0xe7b8('0x35')];_0x26d97b[_0xe7b8('0x77')]=qs[_0xe7b8('0x3d')](_0x2f33b6[_0xe7b8('0x38')][_0xe7b8('0x3d')]);_0x26d97b[_0xe7b8('0x3e')]=qs['filters'](_['pick'](_0x2f33b6['query'],_0x2172f1[_0xe7b8('0x3f')]));if(_0x2f33b6[_0xe7b8('0x38')][_0xe7b8('0x40')]){_0x26d97b['where']=_[_0xe7b8('0x41')](_0x26d97b['where'],{'$or':_[_0xe7b8('0x2f')](_0x26d97b[_0xe7b8('0x3a')],function(_0x1a0f8a){var _0x15016b={};_0x15016b[_0x1a0f8a]={'$like':'%'+_0x2f33b6[_0xe7b8('0x38')][_0xe7b8('0x40')]+'%'};return _0x15016b;})});}_0x26d97b=_['merge']({},_0x26d97b,_0x2f33b6[_0xe7b8('0x43')]);return _0x8fb828[_0xe7b8('0x9b')](_0x26d97b);}})[_0xe7b8('0x29')](function(_0x5c6ee5){if(_0x5c6ee5){_0x4d107e=_0x5c6ee5[_0xe7b8('0x3b')];if(!_0x2f33b6[_0xe7b8('0x38')]['hasOwnProperty'](_0xe7b8('0x3c'))){_0x26d97b[_0xe7b8('0x23')]=qs[_0xe7b8('0x23')](_0x2f33b6[_0xe7b8('0x38')][_0xe7b8('0x23')]);_0x26d97b[_0xe7b8('0x20')]=qs[_0xe7b8('0x20')](_0x2f33b6[_0xe7b8('0x38')]['offset']);}return _0x8fb828['getAgents'](_0x26d97b);}})['then'](function(_0x3dcc2e){if(_0x3dcc2e){return _0x3dcc2e?{'count':_0x4d107e,'rows':_0x3dcc2e}:null;}})[_0xe7b8('0x29')](respondWithResult(_0x46bcee,null))[_0xe7b8('0x47')](handleError(_0x46bcee,null));};
\ No newline at end of file
index 7736cb3..fca1a96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5702=['setMaxListeners','remove','emit','hook','exports','../../mysqldb'];(function(_0x477300,_0x3ab723){var _0x15ed3a=function(_0x4fe459){while(--_0x4fe459){_0x477300['push'](_0x477300['shift']());}};_0x15ed3a(++_0x3ab723);}(_0x5702,0x13d));var _0x2570=function(_0x43846a,_0x49a534){_0x43846a=_0x43846a-0x0;var _0x91f107=_0x5702[_0x43846a];return _0x91f107;};'use strict';var EventEmitter=require('events');var Team=require(_0x2570('0x0'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x2570('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2570('0x2')};function emitEvent(_0xfd470c){return function(_0xd595d,_0x4732c4,_0x244564){TeamEvents[_0x2570('0x3')](_0xfd470c+':'+_0xd595d['id'],_0xd595d);TeamEvents['emit'](_0xfd470c,_0xd595d);_0x244564(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x2570('0x4')](e,emitEvent(event));}}module[_0x2570('0x5')]=TeamEvents;
\ No newline at end of file
+var _0x1239=['hook','exports','events','../../mysqldb','Team','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3d5df9,_0x5b3623){var _0x50ba39=function(_0x3c0de0){while(--_0x3c0de0){_0x3d5df9['push'](_0x3d5df9['shift']());}};_0x50ba39(++_0x5b3623);}(_0x1239,0xd3));var _0x9123=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1239[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0x9123('0x0'));var Team=require(_0x9123('0x1'))['db'][_0x9123('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x9123('0x3')](0x0);var events={'afterCreate':_0x9123('0x4'),'afterUpdate':_0x9123('0x5'),'afterDestroy':_0x9123('0x6')};function emitEvent(_0x3ea48a){return function(_0x1c6f8f,_0x121b7a,_0x5de3e4){TeamEvents['emit'](_0x3ea48a+':'+_0x1c6f8f['id'],_0x1c6f8f);TeamEvents[_0x9123('0x7')](_0x3ea48a,_0x1c6f8f);_0x5de3e4(null);};}for(var e in events){if(events[_0x9123('0x8')](e)){var event=events[e];Team[_0x9123('0x9')](e,emitEvent(event));}}module[_0x9123('0xa')]=TeamEvents;
\ No newline at end of file
index e6266fa..651d268 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd12=['catch','exports','Team','Fax','Openchannel','Sms','Voice','Whatsapp','resolve','then','map','all','./team.attributes','get','Queues','setDataValue','channel'];(function(_0x49a909,_0x35e28f){var _0x5709c2=function(_0x1f1d4f){while(--_0x1f1d4f){_0x49a909['push'](_0x49a909['shift']());}};_0x5709c2(++_0x35e28f);}(_0xfd12,0x11c));var _0x2fd1=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0xfd12[_0x16dbfd];return _0x382254;};'use strict';var _=require('lodash');var attributes=require(_0x2fd1('0x0'));function getQueuesByChannel(_0x8e4bae,_0x1e9582){var _0x3e6d80=_0x2fd1('0x1')+_0x1e9582+_0x2fd1('0x2');return _0x8e4bae[_0x3e6d80]()['then'](function(_0x14c236){return _['map'](_0x14c236,function(_0x23139c){_0x23139c[_0x2fd1('0x3')](_0x2fd1('0x4'),_0x1e9582);return _0x23139c;});})[_0x2fd1('0x5')](function(_0x4f298f){throw _0x4f298f;});}module[_0x2fd1('0x6')]=function(_0x5db88d){return _0x5db88d['define'](_0x2fd1('0x7'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x18d7be=this;var _0x1eaf6e=['Chat',_0x2fd1('0x8'),'Mail',_0x2fd1('0x9'),_0x2fd1('0xa'),_0x2fd1('0xb'),_0x2fd1('0xc')];return Promise[_0x2fd1('0xd')]()[_0x2fd1('0xe')](function(){var _0x8c2b81=_[_0x2fd1('0xf')](_0x1eaf6e,function(_0x38c226){return getQueuesByChannel(_0x18d7be,_0x38c226);});return Promise[_0x2fd1('0x10')](_0x8c2b81);})[_0x2fd1('0x5')](function(_0x4cd489){throw _0x4cd489;});}}});};
\ No newline at end of file
+var _0x3fa2=['./team.attributes','then','map','channel','catch','define','teams','Mail','Sms','Voice','resolve','lodash'];(function(_0x3bc717,_0x267d7f){var _0x1f9766=function(_0x5138d1){while(--_0x5138d1){_0x3bc717['push'](_0x3bc717['shift']());}};_0x1f9766(++_0x267d7f);}(_0x3fa2,0xb3));var _0x23fa=function(_0x33ceeb,_0x58b863){_0x33ceeb=_0x33ceeb-0x0;var _0x5b6556=_0x3fa2[_0x33ceeb];return _0x5b6556;};'use strict';var _=require(_0x23fa('0x0'));var attributes=require(_0x23fa('0x1'));function getQueuesByChannel(_0x154086,_0x7f4ff1){var _0x47d538='get'+_0x7f4ff1+'Queues';return _0x154086[_0x47d538]()[_0x23fa('0x2')](function(_0x3f50fe){return _[_0x23fa('0x3')](_0x3f50fe,function(_0x4e5e86){_0x4e5e86['setDataValue'](_0x23fa('0x4'),_0x7f4ff1);return _0x4e5e86;});})[_0x23fa('0x5')](function(_0x4eb5a1){throw _0x4eb5a1;});}module['exports']=function(_0xf90178){return _0xf90178[_0x23fa('0x6')]('Team',attributes,{'tableName':_0x23fa('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x51a435=this;var _0x346477=['Chat','Fax',_0x23fa('0x8'),'Openchannel',_0x23fa('0x9'),_0x23fa('0xa'),'Whatsapp'];return Promise[_0x23fa('0xb')]()[_0x23fa('0x2')](function(){var _0x57f6d5=_[_0x23fa('0x3')](_0x346477,function(_0x3e6b21){return getQueuesByChannel(_0x51a435,_0x3e6b21);});return Promise['all'](_0x57f6d5);})[_0x23fa('0x5')](function(_0x5303fe){throw _0x5303fe;});}}});};
\ No newline at end of file
index 82b3279..25d3e56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x653e=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','./team.socket','register','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x24d711,_0x3cdb28){var _0x3491b4=function(_0xd5957e){while(--_0xd5957e){_0x24d711['push'](_0x24d711['shift']());}};_0x3491b4(++_0x3cdb28);}(_0x653e,0x1b1));var _0xe653=function(_0x16bb0e,_0x343132){_0x16bb0e=_0x16bb0e-0x0;var _0x102b8b=_0x653e[_0x16bb0e];return _0x102b8b;};'use strict';var _=require(_0xe653('0x0'));var util=require(_0xe653('0x1'));var moment=require(_0xe653('0x2'));var BPromise=require(_0xe653('0x3'));var rs=require(_0xe653('0x4'));var fs=require('fs');var Redis=require(_0xe653('0x5'));var db=require(_0xe653('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe653('0x7'))(_0xe653('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe653('0x9')][_0xe653('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe653('0xb')],{'host':_0xe653('0xc'),'port':0x18eb});var socket=require(_0xe653('0xd'))(new Redis(config[_0xe653('0xb')]));require(_0xe653('0xe'))[_0xe653('0xf')](socket);function respondWithRpcPromise(_0x3a790e,_0x100633,_0x5de000){return new BPromise(function(_0x3938a4,_0x1634f3){return client['request'](_0x3a790e,_0x5de000)[_0xe653('0x10')](function(_0x295c9e){logger[_0xe653('0x11')](_0xe653('0x12'),_0x100633,_0xe653('0x13'));logger[_0xe653('0x14')](_0xe653('0x15'),_0x100633,_0xe653('0x13'),JSON[_0xe653('0x16')](_0x295c9e));if(_0x295c9e[_0xe653('0x17')]){if(_0x295c9e[_0xe653('0x17')][_0xe653('0x18')]===0x1f4){logger[_0xe653('0x17')](_0xe653('0x12'),_0x100633,_0x295c9e[_0xe653('0x17')][_0xe653('0x19')]);return _0x1634f3(_0x295c9e[_0xe653('0x17')]['message']);}logger[_0xe653('0x17')](_0xe653('0x12'),_0x100633,_0x295c9e[_0xe653('0x17')][_0xe653('0x19')]);return _0x3938a4(_0x295c9e[_0xe653('0x17')]['message']);}else{logger[_0xe653('0x11')](_0xe653('0x12'),_0x100633,_0xe653('0x13'));_0x3938a4(_0x295c9e['result'][_0xe653('0x19')]);}})[_0xe653('0x1a')](function(_0x24927b){logger[_0xe653('0x17')]('Team,\x20%s,\x20%s',_0x100633,_0x24927b);_0x1634f3(_0x24927b);});});}
\ No newline at end of file
+var _0x805a=['request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','client','defaults','redis','localhost','./team.socket'];(function(_0x1f69dd,_0x17ec9d){var _0x4e1d1b=function(_0x1800df){while(--_0x1800df){_0x1f69dd['push'](_0x1f69dd['shift']());}};_0x4e1d1b(++_0x17ec9d);}(_0x805a,0x137));var _0xa805=function(_0x48c550,_0x428ac2){_0x48c550=_0x48c550-0x0;var _0x4bf9ee=_0x805a[_0x48c550];return _0x4bf9ee;};'use strict';var _=require(_0xa805('0x0'));var util=require(_0xa805('0x1'));var moment=require(_0xa805('0x2'));var BPromise=require('bluebird');var rs=require(_0xa805('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa805('0x4'))['db'];var utils=require(_0xa805('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa805('0x6')]['http']({'port':0x232a});config['redis']=_[_0xa805('0x7')](config[_0xa805('0x8')],{'host':_0xa805('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa805('0x8')]));require(_0xa805('0xa'))['register'](socket);function respondWithRpcPromise(_0x3d906d,_0x31c585,_0x44fe6d){return new BPromise(function(_0x110548,_0x12535f){return client[_0xa805('0xb')](_0x3d906d,_0x44fe6d)[_0xa805('0xc')](function(_0x200738){logger[_0xa805('0xd')](_0xa805('0xe'),_0x31c585,_0xa805('0xf'));logger[_0xa805('0x10')]('Team,\x20%s,\x20%s,\x20%s',_0x31c585,_0xa805('0xf'),JSON[_0xa805('0x11')](_0x200738));if(_0x200738[_0xa805('0x12')]){if(_0x200738[_0xa805('0x12')][_0xa805('0x13')]===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x31c585,_0x200738['error']['message']);return _0x12535f(_0x200738[_0xa805('0x12')][_0xa805('0x14')]);}logger[_0xa805('0x12')](_0xa805('0xe'),_0x31c585,_0x200738[_0xa805('0x12')][_0xa805('0x14')]);return _0x110548(_0x200738['error'][_0xa805('0x14')]);}else{logger[_0xa805('0xd')]('Team,\x20%s,\x20%s',_0x31c585,_0xa805('0xf'));_0x110548(_0x200738[_0xa805('0x15')]['message']);}})[_0xa805('0x16')](function(_0x4bf261){logger[_0xa805('0x12')](_0xa805('0xe'),_0x31c585,_0x4bf261);_0x12535f(_0x4bf261);});});}
\ No newline at end of file
index b9ca4f8..fac76ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cfa=['save','remove','update','removeListener','register','team:'];(function(_0x1f9756,_0x31780a){var _0x53cefa=function(_0x448c0d){while(--_0x448c0d){_0x1f9756['push'](_0x1f9756['shift']());}};_0x53cefa(++_0x31780a);}(_0x9cfa,0xfc));var _0xa9cf=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9cfa[_0x397e5f];return _0x5302b8;};'use strict';var TeamEvents=require('./team.events');var events=[_0xa9cf('0x0'),_0xa9cf('0x1'),_0xa9cf('0x2')];function createListener(_0x356473,_0x203c20){return function(_0xb29c45){_0x203c20['emit'](_0x356473,_0xb29c45);};}function removeListener(_0x4bab2c,_0x3ed65f){return function(){TeamEvents[_0xa9cf('0x3')](_0x4bab2c,_0x3ed65f);};}exports[_0xa9cf('0x4')]=function(_0x426059){for(var _0x59fe6a=0x0,_0x316c3b=events['length'];_0x59fe6a<_0x316c3b;_0x59fe6a++){var _0x42e1b8=events[_0x59fe6a];var _0x14ef20=createListener(_0xa9cf('0x5')+_0x42e1b8,_0x426059);TeamEvents['on'](_0x42e1b8,_0x14ef20);}};
\ No newline at end of file
+var _0x8747=['removeListener','length','team:','./team.events','remove','emit'];(function(_0x29f730,_0x23d7ed){var _0x189806=function(_0x2838a7){while(--_0x2838a7){_0x29f730['push'](_0x29f730['shift']());}};_0x189806(++_0x23d7ed);}(_0x8747,0xab));var _0x7874=function(_0xf1b134,_0xb399dd){_0xf1b134=_0xf1b134-0x0;var _0x139dbb=_0x8747[_0xf1b134];return _0x139dbb;};'use strict';var TeamEvents=require(_0x7874('0x0'));var events=['save',_0x7874('0x1'),'update'];function createListener(_0x31ba87,_0x18845c){return function(_0x2bf623){_0x18845c[_0x7874('0x2')](_0x31ba87,_0x2bf623);};}function removeListener(_0x26d80c,_0x327a47){return function(){TeamEvents[_0x7874('0x3')](_0x26d80c,_0x327a47);};}exports['register']=function(_0x23f2ac){for(var _0x328cf6=0x0,_0x13c1b8=events[_0x7874('0x4')];_0x328cf6<_0x13c1b8;_0x328cf6++){var _0xe4d823=events[_0x328cf6];var _0x51cfe6=createListener(_0x7874('0x5')+_0xe4d823,_0x23f2ac);TeamEvents['on'](_0xe4d823,_0x51cfe6);}};
\ No newline at end of file
index 2426a46..a4e8be3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3ea=['exports','INTEGER','sequelize'];(function(_0x25f1e0,_0x272a89){var _0x3dfcfc=function(_0x33db20){while(--_0x33db20){_0x25f1e0['push'](_0x25f1e0['shift']());}};_0x3dfcfc(++_0x272a89);}(_0xb3ea,0xc5));var _0xab3e=function(_0x4ffdf9,_0x286906){_0x4ffdf9=_0x4ffdf9-0x0;var _0x132a6c=_0xb3ea[_0x4ffdf9];return _0x132a6c;};'use strict';var Sequelize=require(_0xab3e('0x0'));module[_0xab3e('0x1')]={'TeamId':{'type':Sequelize[_0xab3e('0x2')]},'VoicePrefixId':{'type':Sequelize[_0xab3e('0x2')]}};
\ No newline at end of file
+var _0x3a41=['exports','INTEGER','sequelize'];(function(_0x4226e8,_0x5cdd46){var _0x13c031=function(_0x59356b){while(--_0x59356b){_0x4226e8['push'](_0x4226e8['shift']());}};_0x13c031(++_0x5cdd46);}(_0x3a41,0x86));var _0x13a4=function(_0x5e45fa,_0x24a7b4){_0x5e45fa=_0x5e45fa-0x0;var _0x244b80=_0x3a41[_0x5e45fa];return _0x244b80;};'use strict';var Sequelize=require(_0x13a4('0x0'));module[_0x13a4('0x1')]={'TeamId':{'type':Sequelize[_0x13a4('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x13a4('0x2')]}};
\ No newline at end of file
index b0e9ce6..ef09cd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9173=['./teamVoicePrefix.attributes','exports','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','api','moment','bluebird','path','../../config/environment'];(function(_0x31282c,_0x24c78a){var _0x5e37ca=function(_0x320bdc){while(--_0x320bdc){_0x31282c['push'](_0x31282c['shift']());}};_0x5e37ca(++_0x24c78a);}(_0x9173,0xb4));var _0x3917=function(_0xf9383d,_0x36403f){_0xf9383d=_0xf9383d-0x0;var _0x432e4c=_0x9173[_0xf9383d];return _0x432e4c;};'use strict';var _=require(_0x3917('0x0'));var util=require(_0x3917('0x1'));var logger=require('../../config/logger')(_0x3917('0x2'));var moment=require(_0x3917('0x3'));var BPromise=require(_0x3917('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3917('0x5'));var rimraf=require('rimraf');var config=require(_0x3917('0x6'));var attributes=require(_0x3917('0x7'));module[_0x3917('0x8')]=function(_0x403e03,_0x2dace9){return _0x403e03['define'](_0x3917('0x9'),attributes,{'tableName':_0x3917('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5523=['./teamVoicePrefix.attributes','exports','team_has_voice_prefixes','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5523,0x137));var _0x3552=function(_0x35efb7,_0x274493){_0x35efb7=_0x35efb7-0x0;var _0x16045c=_0x5523[_0x35efb7];return _0x16045c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3552('0x0'))(_0x3552('0x1'));var moment=require(_0x3552('0x2'));var BPromise=require(_0x3552('0x3'));var rp=require(_0x3552('0x4'));var fs=require('fs');var path=require(_0x3552('0x5'));var rimraf=require(_0x3552('0x6'));var config=require(_0x3552('0x7'));var attributes=require(_0x3552('0x8'));module[_0x3552('0x9')]=function(_0x3225aa,_0x58385b){return _0x3225aa['define']('TeamVoicePrefix',attributes,{'tableName':_0x3552('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9d1a40a..f0821d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x12ec32,_0x458007){var _0x5ea2b5=function(_0x378f9c){while(--_0x378f9c){_0x12ec32['push'](_0x12ec32['shift']());}};_0x5ea2b5(++_0x458007);}(_0xedd9,0xfc));var _0x9edd=function(_0xf5c112,_0x1ca83c){_0xf5c112=_0xf5c112-0x0;var _0x31ef62=_0xedd9[_0xf5c112];return _0x31ef62;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x157a2d,_0x2ea5dc){var _0x3f6395=function(_0x2a14b3){while(--_0x2a14b3){_0x157a2d['push'](_0x157a2d['shift']());}};_0x3f6395(++_0x2ea5dc);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index 97b6834..53711fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e6a=['exports','INTEGER','sequelize'];(function(_0xf4c91,_0x1c8c2b){var _0xc6ff8d=function(_0x59ca27){while(--_0x59ca27){_0xf4c91['push'](_0xf4c91['shift']());}};_0xc6ff8d(++_0x1c8c2b);}(_0x1e6a,0xe9));var _0xa1e6=function(_0x5a3064,_0xe26a17){_0x5a3064=_0x5a3064-0x0;var _0x19b13b=_0x1e6a[_0x5a3064];return _0x19b13b;};'use strict';var Sequelize=require(_0xa1e6('0x0'));module[_0xa1e6('0x1')]={'penalty':{'type':Sequelize[_0xa1e6('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd252=['exports','INTEGER','sequelize'];(function(_0x9d1a71,_0x2c2317){var _0xa5189a=function(_0x43987f){while(--_0x43987f){_0x9d1a71['push'](_0x9d1a71['shift']());}};_0xa5189a(++_0x2c2317);}(_0xd252,0xb3));var _0x2d25=function(_0x46aebd,_0x488973){_0x46aebd=_0x46aebd-0x0;var _0x549577=_0xd252[_0x46aebd];return _0x549577;};'use strict';var Sequelize=require(_0x2d25('0x0'));module[_0x2d25('0x1')]={'penalty':{'type':Sequelize[_0x2d25('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 5d7ad1e..92dc017 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd4e=['path','../../config/environment','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','../../config/logger','api','request-promise'];(function(_0x3a1f40,_0x4f0135){var _0x33830a=function(_0x39c269){while(--_0x39c269){_0x3a1f40['push'](_0x3a1f40['shift']());}};_0x33830a(++_0x4f0135);}(_0xcd4e,0x187));var _0xecd4=function(_0x475e96,_0x37ca1d){_0x475e96=_0x475e96-0x0;var _0x287091=_0xcd4e[_0x475e96];return _0x287091;};'use strict';var _=require(_0xecd4('0x0'));var util=require(_0xecd4('0x1'));var logger=require(_0xecd4('0x2'))(_0xecd4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xecd4('0x4'));var fs=require('fs');var path=require(_0xecd4('0x5'));var rimraf=require('rimraf');var config=require(_0xecd4('0x6'));var attributes=require('./teamVoiceQueue.attributes');module[_0xecd4('0x7')]=function(_0x47f6ae,_0x41dd0c){return _0x47f6ae[_0xecd4('0x8')](_0xecd4('0x9'),attributes,{'tableName':_0xecd4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2bbb=['team_has_voice_queues','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','TeamVoiceQueue'];(function(_0x1ebdd0,_0x3b992c){var _0x153331=function(_0x2044e5){while(--_0x2044e5){_0x1ebdd0['push'](_0x1ebdd0['shift']());}};_0x153331(++_0x3b992c);}(_0x2bbb,0x85));var _0xb2bb=function(_0x84c8d7,_0x3966ad){_0x84c8d7=_0x84c8d7-0x0;var _0x2315ff=_0x2bbb[_0x84c8d7];return _0x2315ff;};'use strict';var _=require('lodash');var util=require(_0xb2bb('0x0'));var logger=require(_0xb2bb('0x1'))(_0xb2bb('0x2'));var moment=require('moment');var BPromise=require(_0xb2bb('0x3'));var rp=require(_0xb2bb('0x4'));var fs=require('fs');var path=require(_0xb2bb('0x5'));var rimraf=require(_0xb2bb('0x6'));var config=require(_0xb2bb('0x7'));var attributes=require(_0xb2bb('0x8'));module['exports']=function(_0x3581e2,_0x5bee47){return _0x3581e2['define'](_0xb2bb('0x9'),attributes,{'tableName':_0xb2bb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cfb8b10..fe08c4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91d9=['message','TeamVoiceQueue,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','code'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x91d9,0xe0));var _0x991d=function(_0x2bd598,_0x596346){_0x2bd598=_0x2bd598-0x0;var _0x493fd6=_0x91d9[_0x2bd598];return _0x493fd6;};'use strict';var _=require('lodash');var util=require(_0x991d('0x0'));var moment=require(_0x991d('0x1'));var BPromise=require(_0x991d('0x2'));var rs=require(_0x991d('0x3'));var fs=require('fs');var Redis=require(_0x991d('0x4'));var db=require(_0x991d('0x5'))['db'];var utils=require(_0x991d('0x6'));var logger=require('../../config/logger')(_0x991d('0x7'));var config=require(_0x991d('0x8'));var jayson=require(_0x991d('0x9'));var client=jayson[_0x991d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d2bf0,_0x66e6ab,_0x2b065e){return new BPromise(function(_0x19d0e0,_0x27aa60){return client[_0x991d('0xb')](_0x3d2bf0,_0x2b065e)['then'](function(_0x359502){logger[_0x991d('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x66e6ab,_0x991d('0xd'));logger[_0x991d('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x66e6ab,_0x991d('0xd'),JSON[_0x991d('0xf')](_0x359502));if(_0x359502[_0x991d('0x10')]){if(_0x359502[_0x991d('0x10')][_0x991d('0x11')]===0x1f4){logger[_0x991d('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x66e6ab,_0x359502['error']['message']);return _0x27aa60(_0x359502[_0x991d('0x10')][_0x991d('0x12')]);}logger[_0x991d('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x66e6ab,_0x359502[_0x991d('0x10')][_0x991d('0x12')]);return _0x19d0e0(_0x359502['error'][_0x991d('0x12')]);}else{logger[_0x991d('0xc')](_0x991d('0x13'),_0x66e6ab,'request\x20sent');_0x19d0e0(_0x359502[_0x991d('0x14')]['message']);}})[_0x991d('0x15')](function(_0x4c4730){logger['error'](_0x991d('0x13'),_0x66e6ab,_0x4c4730);_0x27aa60(_0x4c4730);});});}
\ No newline at end of file
+var _0x0410=['request','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0410,0x198));var _0x0041=function(_0x4cc198,_0x11a598){_0x4cc198=_0x4cc198-0x0;var _0x3e8858=_0x0410[_0x4cc198];return _0x3e8858;};'use strict';var _=require(_0x0041('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0041('0x1'));var rs=require(_0x0041('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0041('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0041('0x4'))(_0x0041('0x5'));var config=require(_0x0041('0x6'));var jayson=require(_0x0041('0x7'));var client=jayson[_0x0041('0x8')][_0x0041('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34519f,_0x1be823,_0x1e7a10){return new BPromise(function(_0x3fb1e1,_0x4abc99){return client[_0x0041('0xa')](_0x34519f,_0x1e7a10)['then'](function(_0x448b14){logger['info'](_0x0041('0xb'),_0x1be823,_0x0041('0xc'));logger[_0x0041('0xd')](_0x0041('0xe'),_0x1be823,_0x0041('0xc'),JSON[_0x0041('0xf')](_0x448b14));if(_0x448b14[_0x0041('0x10')]){if(_0x448b14[_0x0041('0x10')][_0x0041('0x11')]===0x1f4){logger['error'](_0x0041('0xb'),_0x1be823,_0x448b14[_0x0041('0x10')][_0x0041('0x12')]);return _0x4abc99(_0x448b14[_0x0041('0x10')][_0x0041('0x12')]);}logger[_0x0041('0x10')](_0x0041('0xb'),_0x1be823,_0x448b14[_0x0041('0x10')]['message']);return _0x3fb1e1(_0x448b14['error'][_0x0041('0x12')]);}else{logger[_0x0041('0x13')](_0x0041('0xb'),_0x1be823,_0x0041('0xc'));_0x3fb1e1(_0x448b14[_0x0041('0x14')]['message']);}})[_0x0041('0x15')](function(_0x2c8e83){logger[_0x0041('0x10')](_0x0041('0xb'),_0x1be823,_0x2c8e83);_0x4abc99(_0x2c8e83);});});}
\ No newline at end of file
index c63aad9..2bfd6ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b0e=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports'];(function(_0x5e2d4b,_0xd96e0d){var _0x29436b=function(_0x1bf5bc){while(--_0x1bf5bc){_0x5e2d4b['push'](_0x5e2d4b['shift']());}};_0x29436b(++_0xd96e0d);}(_0x1b0e,0x132));var _0xe1b0=function(_0x479dff,_0x400b9c){_0x479dff=_0x479dff-0x0;var _0x1125e2=_0x1b0e[_0x479dff];return _0x1125e2;};'use strict';var multer=require(_0xe1b0('0x0'));var util=require(_0xe1b0('0x1'));var path=require(_0xe1b0('0x2'));var timeout=require(_0xe1b0('0x3'));var express=require(_0xe1b0('0x4'));var router=express[_0xe1b0('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe1b0('0x6'));var config=require(_0xe1b0('0x7'));var controller=require('./template.controller');router[_0xe1b0('0x8')]('/',auth[_0xe1b0('0x9')](),controller[_0xe1b0('0xa')]);router['get'](_0xe1b0('0xb'),auth[_0xe1b0('0x9')](),controller['show']);router[_0xe1b0('0xc')]('/',auth[_0xe1b0('0x9')](),controller[_0xe1b0('0xd')]);router[_0xe1b0('0xe')](_0xe1b0('0xb'),auth[_0xe1b0('0x9')](),controller[_0xe1b0('0xf')]);router[_0xe1b0('0x10')](_0xe1b0('0xb'),auth[_0xe1b0('0x9')](),controller['destroy']);module[_0xe1b0('0x11')]=router;
\ No newline at end of file
+var _0x6333=['./template.controller','get','/:id','isAuthenticated','update','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x1e52ae,_0x3484f0){var _0x1132f3=function(_0x1c9a53){while(--_0x1c9a53){_0x1e52ae['push'](_0x1e52ae['shift']());}};_0x1132f3(++_0x3484f0);}(_0x6333,0x83));var _0x3633=function(_0x5d711e,_0xa3745){_0x5d711e=_0x5d711e-0x0;var _0x4e9020=_0x6333[_0x5d711e];return _0x4e9020;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3633('0x0'));var express=require('express');var router=express[_0x3633('0x1')]();var fs_extra=require(_0x3633('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x3633('0x3'));var config=require('../../config/environment');var controller=require(_0x3633('0x4'));router[_0x3633('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3633('0x5')](_0x3633('0x6'),auth[_0x3633('0x7')](),controller['show']);router['post']('/',auth[_0x3633('0x7')](),controller['create']);router['put'](_0x3633('0x6'),auth[_0x3633('0x7')](),controller[_0x3633('0x8')]);router['delete'](_0x3633('0x6'),auth[_0x3633('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 74fdb8b..6eed1d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x107e=['sequelize','exports','STRING','TEXT'];(function(_0x1fa4d2,_0x4cd57b){var _0x210a98=function(_0x53baa5){while(--_0x53baa5){_0x1fa4d2['push'](_0x1fa4d2['shift']());}};_0x210a98(++_0x4cd57b);}(_0x107e,0x1d4));var _0xe107=function(_0x39510e,_0x434436){_0x39510e=_0x39510e-0x0;var _0x29f103=_0x107e[_0x39510e];return _0x29f103;};'use strict';var Sequelize=require(_0xe107('0x0'));module[_0xe107('0x1')]={'name':{'type':Sequelize[_0xe107('0x2')]},'description':{'type':Sequelize[_0xe107('0x2')]},'html':{'type':Sequelize[_0xe107('0x3')]}};
\ No newline at end of file
+var _0x4222=['sequelize','STRING'];(function(_0x54ede9,_0x28c342){var _0x5537d1=function(_0x4ce100){while(--_0x4ce100){_0x54ede9['push'](_0x54ede9['shift']());}};_0x5537d1(++_0x28c342);}(_0x4222,0x17c));var _0x2422=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x4222[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0x2422('0x0'));module['exports']={'name':{'type':Sequelize[_0x2422('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index e67afb9..ee838bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59e7=['rawAttributes','fieldName','type','keys','query','filters','model','fields','attributes','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','include','findAll','rows','show','params','intersection','includeAll','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Templates','UserProfileResource','destroy','sendStatus','error','name','index','Template'];(function(_0x93942f,_0xb48547){var _0x23fcd8=function(_0x4728be){while(--_0x4728be){_0x93942f['push'](_0x93942f['shift']());}};_0x23fcd8(++_0xb48547);}(_0x59e7,0x74));var _0x759e=function(_0x4cde2e,_0x11207c){_0x4cde2e=_0x4cde2e-0x0;var _0x4eace9=_0x59e7[_0x4cde2e];return _0x4eace9;};'use strict';var emlformat=require(_0x759e('0x0'));var rimraf=require(_0x759e('0x1'));var zipdir=require(_0x759e('0x2'));var jsonpatch=require(_0x759e('0x3'));var rp=require(_0x759e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x759e('0x5'));var util=require('util');var path=require(_0x759e('0x6'));var sox=require(_0x759e('0x7'));var csv=require(_0x759e('0x8'));var ejs=require(_0x759e('0x9'));var fs=require('fs');var fs_extra=require(_0x759e('0xa'));var _=require('lodash');var squel=require(_0x759e('0xb'));var crypto=require(_0x759e('0xc'));var jsforce=require(_0x759e('0xd'));var deskjs=require(_0x759e('0xe'));var toCsv=require(_0x759e('0x8'));var querystring=require(_0x759e('0xf'));var Papa=require('papaparse');var Redis=require(_0x759e('0x10'));var authService=require(_0x759e('0x11'));var qs=require(_0x759e('0x12'));var as=require(_0x759e('0x13'));var hardwareService=require(_0x759e('0x14'));var logger=require(_0x759e('0x15'))(_0x759e('0x16'));var utils=require(_0x759e('0x17'));var config=require(_0x759e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x759e('0x19'))['db'];function respondWithStatusCode(_0x2f9b2d,_0x275e68){_0x275e68=_0x275e68||0xcc;return function(_0x505f32){if(_0x505f32){return _0x2f9b2d['sendStatus'](_0x275e68);}return _0x2f9b2d[_0x759e('0x1a')](_0x275e68)[_0x759e('0x1b')]();};}function respondWithResult(_0x5bdff1,_0x50849f){_0x50849f=_0x50849f||0xc8;return function(_0x1e42f7){if(_0x1e42f7){return _0x5bdff1[_0x759e('0x1a')](_0x50849f)['json'](_0x1e42f7);}};}function respondWithFilteredResult(_0xa8d91c,_0x35646e){return function(_0x3c16b0){if(_0x3c16b0){var _0x9d51c1=typeof _0x35646e[_0x759e('0x1c')]===_0x759e('0x1d')&&typeof _0x35646e[_0x759e('0x1e')]==='undefined';var _0x597325=_0x3c16b0[_0x759e('0x1f')];var _0x582b87=_0x9d51c1?0x0:_0x35646e[_0x759e('0x1c')];var _0x2f5629=_0x9d51c1?_0x3c16b0[_0x759e('0x1f')]:_0x35646e[_0x759e('0x1c')]+_0x35646e[_0x759e('0x1e')];var _0x530d69;if(_0x2f5629>=_0x597325){_0x2f5629=_0x597325;_0x530d69=0xc8;}else{_0x530d69=0xce;}_0xa8d91c['status'](_0x530d69);return _0xa8d91c[_0x759e('0x20')](_0x759e('0x21'),_0x582b87+'-'+_0x2f5629+'/'+_0x597325)['json'](_0x3c16b0);}return null;};}function patchUpdates(_0x3e91a8){return function(_0x222442){try{jsonpatch[_0x759e('0x22')](_0x222442,_0x3e91a8,!![]);}catch(_0x2fc1dd){return BPromise[_0x759e('0x23')](_0x2fc1dd);}return _0x222442[_0x759e('0x24')]();};}function saveUpdates(_0x3b053b,_0x3225aa){return function(_0x3f8dc5){if(_0x3f8dc5){return _0x3f8dc5[_0x759e('0x25')](_0x3b053b)[_0x759e('0x26')](function(_0x212769){return _0x212769;});}return null;};}function removeEntity(_0x154866,_0x497fdc){return function(_0x45652b){if(_0x45652b){return _0x45652b['destroy']()['then'](function(){var _0x1cffd5=_0x45652b[_0x759e('0x27')]({'plain':!![]});var _0x18d161=_0x759e('0x28');return db[_0x759e('0x29')][_0x759e('0x2a')]({'where':{'type':_0x18d161,'resourceId':_0x1cffd5['id']}})[_0x759e('0x26')](function(){return _0x45652b;});})['then'](function(){_0x154866[_0x759e('0x1a')](0xcc)[_0x759e('0x1b')]();});}};}function handleEntityNotFound(_0x189c6e,_0x57eda2){return function(_0x2293df){if(!_0x2293df){_0x189c6e[_0x759e('0x2b')](0x194);}return _0x2293df;};}function handleError(_0x207aee,_0x4d1dcf){_0x4d1dcf=_0x4d1dcf||0x1f4;return function(_0x48945e){logger[_0x759e('0x2c')](_0x48945e['stack']);if(_0x48945e[_0x759e('0x2d')]){delete _0x48945e[_0x759e('0x2d')];}_0x207aee['status'](_0x4d1dcf)['send'](_0x48945e);};}exports[_0x759e('0x2e')]=function(_0x1c6fa6,_0x14f625){var _0x312962={},_0x19f67f={},_0x24d1ca={'count':0x0,'rows':[]};var _0x314c9a=_['map'](db[_0x759e('0x2f')][_0x759e('0x30')],function(_0x134261){return{'name':_0x134261[_0x759e('0x31')],'type':_0x134261[_0x759e('0x32')]['key']};});_0x19f67f['model']=_['map'](_0x314c9a,'name');_0x19f67f['query']=_[_0x759e('0x33')](_0x1c6fa6[_0x759e('0x34')]);_0x19f67f[_0x759e('0x35')]=_['intersection'](_0x19f67f[_0x759e('0x36')],_0x19f67f[_0x759e('0x34')]);_0x312962['attributes']=_['intersection'](_0x19f67f['model'],qs[_0x759e('0x37')](_0x1c6fa6[_0x759e('0x34')][_0x759e('0x37')]));_0x312962[_0x759e('0x38')]=_0x312962['attributes']['length']?_0x312962[_0x759e('0x38')]:_0x19f67f[_0x759e('0x36')];if(!_0x1c6fa6['query']['hasOwnProperty'](_0x759e('0x39'))){_0x312962[_0x759e('0x1e')]=qs[_0x759e('0x1e')](_0x1c6fa6[_0x759e('0x34')]['limit']);_0x312962[_0x759e('0x1c')]=qs['offset'](_0x1c6fa6[_0x759e('0x34')]['offset']);}_0x312962[_0x759e('0x3a')]=qs[_0x759e('0x3b')](_0x1c6fa6[_0x759e('0x34')][_0x759e('0x3b')]);_0x312962[_0x759e('0x3c')]=qs[_0x759e('0x35')](_[_0x759e('0x3d')](_0x1c6fa6['query'],_0x19f67f[_0x759e('0x35')]),_0x314c9a);if(_0x1c6fa6[_0x759e('0x34')]['filter']){_0x312962[_0x759e('0x3c')]=_[_0x759e('0x3e')](_0x312962['where'],{'$or':_[_0x759e('0x3f')](_0x314c9a,function(_0xaf5d87){if(_0xaf5d87['type']!==_0x759e('0x40')){var _0x2dc179={};_0x2dc179[_0xaf5d87[_0x759e('0x2d')]]={'$like':'%'+_0x1c6fa6[_0x759e('0x34')][_0x759e('0x41')]+'%'};return _0x2dc179;}})});}_0x312962=_['merge']({},_0x312962,_0x1c6fa6[_0x759e('0x42')]);var _0x42cd56={'where':_0x312962[_0x759e('0x3c')]};return db['Template'][_0x759e('0x1f')](_0x42cd56)[_0x759e('0x26')](function(_0x15023e){_0x24d1ca[_0x759e('0x1f')]=_0x15023e;if(_0x1c6fa6[_0x759e('0x34')]['includeAll']){_0x312962[_0x759e('0x43')]=[{'all':!![]}];}return db[_0x759e('0x2f')][_0x759e('0x44')](_0x312962);})[_0x759e('0x26')](function(_0x4b6580){_0x24d1ca[_0x759e('0x45')]=_0x4b6580;return _0x24d1ca;})[_0x759e('0x26')](respondWithFilteredResult(_0x14f625,_0x312962))['catch'](handleError(_0x14f625,null));};exports[_0x759e('0x46')]=function(_0x284a44,_0x35b771){var _0x29501d={'raw':!![],'where':{'id':_0x284a44[_0x759e('0x47')]['id']}},_0x498d5b={};_0x498d5b[_0x759e('0x36')]=_[_0x759e('0x33')](db['Template'][_0x759e('0x30')]);_0x498d5b['query']=_[_0x759e('0x33')](_0x284a44[_0x759e('0x34')]);_0x498d5b[_0x759e('0x35')]=_[_0x759e('0x48')](_0x498d5b[_0x759e('0x36')],_0x498d5b[_0x759e('0x34')]);_0x29501d[_0x759e('0x38')]=_[_0x759e('0x48')](_0x498d5b['model'],qs['fields'](_0x284a44[_0x759e('0x34')][_0x759e('0x37')]));_0x29501d[_0x759e('0x38')]=_0x29501d['attributes']['length']?_0x29501d[_0x759e('0x38')]:_0x498d5b['model'];if(_0x284a44[_0x759e('0x34')][_0x759e('0x49')]){_0x29501d[_0x759e('0x43')]=[{'all':!![]}];}_0x29501d=_[_0x759e('0x3e')]({},_0x29501d,_0x284a44[_0x759e('0x42')]);return db[_0x759e('0x2f')][_0x759e('0x4a')](_0x29501d)['then'](handleEntityNotFound(_0x35b771,null))[_0x759e('0x26')](respondWithResult(_0x35b771,null))['catch'](handleError(_0x35b771,null));};exports['create']=function(_0x6d54c7,_0x9e1f1c){return db[_0x759e('0x2f')]['create'](_0x6d54c7[_0x759e('0x4b')],{})[_0x759e('0x26')](function(_0x4d7104){var _0x4f8daf=_0x6d54c7['user'][_0x759e('0x27')]({'plain':!![]});if(!_0x4f8daf)throw new Error(_0x759e('0x4c'));if(_0x4f8daf['role']==='user'){var _0x11066e=_0x4d7104['get']({'plain':!![]});var _0x165754='Templates';return db[_0x759e('0x4d')][_0x759e('0x4a')]({'where':{'name':_0x165754,'userProfileId':_0x4f8daf[_0x759e('0x4e')]},'raw':!![]})[_0x759e('0x26')](function(_0x928a8e){if(_0x928a8e&&_0x928a8e['autoAssociation']===0x0){return db[_0x759e('0x29')][_0x759e('0x4f')]({'name':_0x11066e['name'],'resourceId':_0x11066e['id'],'type':_0x928a8e[_0x759e('0x2d')],'sectionId':_0x928a8e['id']},{})[_0x759e('0x26')](function(){return _0x4d7104;});}else{return _0x4d7104;}})[_0x759e('0x50')](function(_0x462d8f){logger['error'](_0x759e('0x51'),_0x462d8f);throw _0x462d8f;});}return _0x4d7104;})['then'](respondWithResult(_0x9e1f1c,0xc9))[_0x759e('0x50')](handleError(_0x9e1f1c,null));};exports[_0x759e('0x25')]=function(_0x1ed904,_0x3e92d7){if(_0x1ed904[_0x759e('0x4b')]['id']){delete _0x1ed904['body']['id'];}return db[_0x759e('0x2f')][_0x759e('0x4a')]({'where':{'id':_0x1ed904[_0x759e('0x47')]['id']}})[_0x759e('0x26')](handleEntityNotFound(_0x3e92d7,null))[_0x759e('0x26')](saveUpdates(_0x1ed904[_0x759e('0x4b')],null))[_0x759e('0x26')](respondWithResult(_0x3e92d7,null))[_0x759e('0x50')](handleError(_0x3e92d7,null));};exports[_0x759e('0x2a')]=function(_0x12cb4d,_0x1fadfe){return db[_0x759e('0x2f')][_0x759e('0x4a')]({'where':{'id':_0x12cb4d['params']['id']}})[_0x759e('0x26')](handleEntityNotFound(_0x1fadfe,null))[_0x759e('0x26')](removeEntity(_0x1fadfe,null))[_0x759e('0x50')](handleError(_0x1fadfe,null));};
\ No newline at end of file
+var _0xa70f=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll','rows','show','params','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Templates','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','end','sendStatus','error','stack','name','send','map','Template','rawAttributes','fieldName','type','key'];(function(_0x4181a9,_0x1033eb){var _0x2adc75=function(_0x11e896){while(--_0x11e896){_0x4181a9['push'](_0x4181a9['shift']());}};_0x2adc75(++_0x1033eb);}(_0xa70f,0x6b));var _0xfa70=function(_0x3815e0,_0x126cc3){_0x3815e0=_0x3815e0-0x0;var _0x16a84d=_0xa70f[_0x3815e0];return _0x16a84d;};'use strict';var emlformat=require(_0xfa70('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfa70('0x1'));var jsonpatch=require(_0xfa70('0x2'));var rp=require('request-promise');var moment=require(_0xfa70('0x3'));var BPromise=require(_0xfa70('0x4'));var Mustache=require(_0xfa70('0x5'));var util=require('util');var path=require(_0xfa70('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfa70('0x7'));var squel=require(_0xfa70('0x8'));var crypto=require(_0xfa70('0x9'));var jsforce=require(_0xfa70('0xa'));var deskjs=require(_0xfa70('0xb'));var toCsv=require(_0xfa70('0xc'));var querystring=require(_0xfa70('0xd'));var Papa=require('papaparse');var Redis=require(_0xfa70('0xe'));var authService=require(_0xfa70('0xf'));var qs=require(_0xfa70('0x10'));var as=require(_0xfa70('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfa70('0x12'));var utils=require(_0xfa70('0x13'));var config=require(_0xfa70('0x14'));var licenseUtil=require(_0xfa70('0x15'));var db=require(_0xfa70('0x16'))['db'];function respondWithStatusCode(_0x32b8e5,_0x221f2b){_0x221f2b=_0x221f2b||0xcc;return function(_0x43ebb3){if(_0x43ebb3){return _0x32b8e5['sendStatus'](_0x221f2b);}return _0x32b8e5[_0xfa70('0x17')](_0x221f2b)['end']();};}function respondWithResult(_0x21f139,_0xe570da){_0xe570da=_0xe570da||0xc8;return function(_0x5eff4d){if(_0x5eff4d){return _0x21f139[_0xfa70('0x17')](_0xe570da)[_0xfa70('0x18')](_0x5eff4d);}};}function respondWithFilteredResult(_0x5c81b0,_0xa3d5d1){return function(_0x12e0ff){if(_0x12e0ff){var _0x57a693=typeof _0xa3d5d1['offset']===_0xfa70('0x19')&&typeof _0xa3d5d1[_0xfa70('0x1a')]===_0xfa70('0x19');var _0x6b187c=_0x12e0ff[_0xfa70('0x1b')];var _0xcbfb23=_0x57a693?0x0:_0xa3d5d1[_0xfa70('0x1c')];var _0x102a8c=_0x57a693?_0x12e0ff[_0xfa70('0x1b')]:_0xa3d5d1['offset']+_0xa3d5d1[_0xfa70('0x1a')];var _0x260fc3;if(_0x102a8c>=_0x6b187c){_0x102a8c=_0x6b187c;_0x260fc3=0xc8;}else{_0x260fc3=0xce;}_0x5c81b0[_0xfa70('0x17')](_0x260fc3);return _0x5c81b0[_0xfa70('0x1d')]('Content-Range',_0xcbfb23+'-'+_0x102a8c+'/'+_0x6b187c)[_0xfa70('0x18')](_0x12e0ff);}return null;};}function patchUpdates(_0x48c33c){return function(_0xaa215e){try{jsonpatch[_0xfa70('0x1e')](_0xaa215e,_0x48c33c,!![]);}catch(_0x43b291){return BPromise[_0xfa70('0x1f')](_0x43b291);}return _0xaa215e[_0xfa70('0x20')]();};}function saveUpdates(_0x210273,_0x200f25){return function(_0x136f49){if(_0x136f49){return _0x136f49[_0xfa70('0x21')](_0x210273)[_0xfa70('0x22')](function(_0x4a5d46){return _0x4a5d46;});}return null;};}function removeEntity(_0x35b437,_0x2f5776){return function(_0x550550){if(_0x550550){return _0x550550[_0xfa70('0x23')]()[_0xfa70('0x22')](function(){var _0x230e81=_0x550550[_0xfa70('0x24')]({'plain':!![]});var _0x13688c='Templates';return db['UserProfileResource'][_0xfa70('0x23')]({'where':{'type':_0x13688c,'resourceId':_0x230e81['id']}})[_0xfa70('0x22')](function(){return _0x550550;});})[_0xfa70('0x22')](function(){_0x35b437[_0xfa70('0x17')](0xcc)[_0xfa70('0x25')]();});}};}function handleEntityNotFound(_0x1c2b3d,_0x13ab67){return function(_0x31cff2){if(!_0x31cff2){_0x1c2b3d[_0xfa70('0x26')](0x194);}return _0x31cff2;};}function handleError(_0x7bf3cc,_0x3f1ee4){_0x3f1ee4=_0x3f1ee4||0x1f4;return function(_0x1cbffd){logger[_0xfa70('0x27')](_0x1cbffd[_0xfa70('0x28')]);if(_0x1cbffd[_0xfa70('0x29')]){delete _0x1cbffd['name'];}_0x7bf3cc['status'](_0x3f1ee4)[_0xfa70('0x2a')](_0x1cbffd);};}exports['index']=function(_0x248942,_0x7dab6f){var _0x4d917f={},_0x7b2a1d={},_0x76f029={'count':0x0,'rows':[]};var _0x207332=_[_0xfa70('0x2b')](db[_0xfa70('0x2c')][_0xfa70('0x2d')],function(_0x26cd12){return{'name':_0x26cd12[_0xfa70('0x2e')],'type':_0x26cd12[_0xfa70('0x2f')][_0xfa70('0x30')]};});_0x7b2a1d[_0xfa70('0x31')]=_[_0xfa70('0x2b')](_0x207332,_0xfa70('0x29'));_0x7b2a1d[_0xfa70('0x32')]=_[_0xfa70('0x33')](_0x248942[_0xfa70('0x32')]);_0x7b2a1d[_0xfa70('0x34')]=_[_0xfa70('0x35')](_0x7b2a1d[_0xfa70('0x31')],_0x7b2a1d[_0xfa70('0x32')]);_0x4d917f[_0xfa70('0x36')]=_[_0xfa70('0x35')](_0x7b2a1d[_0xfa70('0x31')],qs[_0xfa70('0x37')](_0x248942[_0xfa70('0x32')][_0xfa70('0x37')]));_0x4d917f['attributes']=_0x4d917f['attributes'][_0xfa70('0x38')]?_0x4d917f['attributes']:_0x7b2a1d[_0xfa70('0x31')];if(!_0x248942[_0xfa70('0x32')][_0xfa70('0x39')]('nolimit')){_0x4d917f[_0xfa70('0x1a')]=qs[_0xfa70('0x1a')](_0x248942['query']['limit']);_0x4d917f[_0xfa70('0x1c')]=qs[_0xfa70('0x1c')](_0x248942[_0xfa70('0x32')]['offset']);}_0x4d917f['order']=qs[_0xfa70('0x3a')](_0x248942['query'][_0xfa70('0x3a')]);_0x4d917f[_0xfa70('0x3b')]=qs['filters'](_['pick'](_0x248942[_0xfa70('0x32')],_0x7b2a1d['filters']),_0x207332);if(_0x248942[_0xfa70('0x32')]['filter']){_0x4d917f[_0xfa70('0x3b')]=_[_0xfa70('0x3c')](_0x4d917f[_0xfa70('0x3b')],{'$or':_[_0xfa70('0x2b')](_0x207332,function(_0x22e012){if(_0x22e012[_0xfa70('0x2f')]!==_0xfa70('0x3d')){var _0x7fcb91={};_0x7fcb91[_0x22e012[_0xfa70('0x29')]]={'$like':'%'+_0x248942[_0xfa70('0x32')][_0xfa70('0x3e')]+'%'};return _0x7fcb91;}})});}_0x4d917f=_[_0xfa70('0x3c')]({},_0x4d917f,_0x248942[_0xfa70('0x3f')]);var _0xdd2821={'where':_0x4d917f[_0xfa70('0x3b')]};return db[_0xfa70('0x2c')][_0xfa70('0x1b')](_0xdd2821)[_0xfa70('0x22')](function(_0x2b3b14){_0x76f029[_0xfa70('0x1b')]=_0x2b3b14;if(_0x248942[_0xfa70('0x32')][_0xfa70('0x40')]){_0x4d917f['include']=[{'all':!![]}];}return db[_0xfa70('0x2c')]['findAll'](_0x4d917f);})[_0xfa70('0x22')](function(_0x4c89b2){_0x76f029[_0xfa70('0x41')]=_0x4c89b2;return _0x76f029;})[_0xfa70('0x22')](respondWithFilteredResult(_0x7dab6f,_0x4d917f))['catch'](handleError(_0x7dab6f,null));};exports[_0xfa70('0x42')]=function(_0x50150a,_0x2bb22d){var _0x36e5c7={'raw':!![],'where':{'id':_0x50150a[_0xfa70('0x43')]['id']}},_0x109f01={};_0x109f01['model']=_[_0xfa70('0x33')](db[_0xfa70('0x2c')][_0xfa70('0x2d')]);_0x109f01[_0xfa70('0x32')]=_['keys'](_0x50150a[_0xfa70('0x32')]);_0x109f01['filters']=_[_0xfa70('0x35')](_0x109f01[_0xfa70('0x31')],_0x109f01[_0xfa70('0x32')]);_0x36e5c7[_0xfa70('0x36')]=_[_0xfa70('0x35')](_0x109f01[_0xfa70('0x31')],qs[_0xfa70('0x37')](_0x50150a['query'][_0xfa70('0x37')]));_0x36e5c7[_0xfa70('0x36')]=_0x36e5c7[_0xfa70('0x36')][_0xfa70('0x38')]?_0x36e5c7['attributes']:_0x109f01[_0xfa70('0x31')];if(_0x50150a[_0xfa70('0x32')][_0xfa70('0x40')]){_0x36e5c7['include']=[{'all':!![]}];}_0x36e5c7=_[_0xfa70('0x3c')]({},_0x36e5c7,_0x50150a[_0xfa70('0x3f')]);return db[_0xfa70('0x2c')]['find'](_0x36e5c7)[_0xfa70('0x22')](handleEntityNotFound(_0x2bb22d,null))['then'](respondWithResult(_0x2bb22d,null))[_0xfa70('0x44')](handleError(_0x2bb22d,null));};exports['create']=function(_0x3aaf44,_0x39d4ce){return db[_0xfa70('0x2c')][_0xfa70('0x45')](_0x3aaf44['body'],{})[_0xfa70('0x22')](function(_0x195bd9){var _0x4eaada=_0x3aaf44['user'][_0xfa70('0x24')]({'plain':!![]});if(!_0x4eaada)throw new Error(_0xfa70('0x46'));if(_0x4eaada['role']===_0xfa70('0x47')){var _0x384002=_0x195bd9[_0xfa70('0x24')]({'plain':!![]});var _0x1fdc2d=_0xfa70('0x48');return db['UserProfileSection'][_0xfa70('0x49')]({'where':{'name':_0x1fdc2d,'userProfileId':_0x4eaada[_0xfa70('0x4a')]},'raw':!![]})[_0xfa70('0x22')](function(_0x510fd1){if(_0x510fd1&&_0x510fd1['autoAssociation']===0x0){return db[_0xfa70('0x4b')][_0xfa70('0x45')]({'name':_0x384002[_0xfa70('0x29')],'resourceId':_0x384002['id'],'type':_0x510fd1[_0xfa70('0x29')],'sectionId':_0x510fd1['id']},{})[_0xfa70('0x22')](function(){return _0x195bd9;});}else{return _0x195bd9;}})[_0xfa70('0x44')](function(_0x45426f){logger[_0xfa70('0x27')](_0xfa70('0x4c'),_0x45426f);throw _0x45426f;});}return _0x195bd9;})[_0xfa70('0x22')](respondWithResult(_0x39d4ce,0xc9))[_0xfa70('0x44')](handleError(_0x39d4ce,null));};exports[_0xfa70('0x21')]=function(_0x499220,_0xa62ac7){if(_0x499220['body']['id']){delete _0x499220['body']['id'];}return db['Template'][_0xfa70('0x49')]({'where':{'id':_0x499220[_0xfa70('0x43')]['id']}})[_0xfa70('0x22')](handleEntityNotFound(_0xa62ac7,null))[_0xfa70('0x22')](saveUpdates(_0x499220[_0xfa70('0x4d')],null))[_0xfa70('0x22')](respondWithResult(_0xa62ac7,null))[_0xfa70('0x44')](handleError(_0xa62ac7,null));};exports[_0xfa70('0x23')]=function(_0x442be3,_0x29f7e7){return db[_0xfa70('0x2c')][_0xfa70('0x49')]({'where':{'id':_0x442be3[_0xfa70('0x43')]['id']}})['then'](handleEntityNotFound(_0x29f7e7,null))['then'](removeEntity(_0x29f7e7,null))['catch'](handleError(_0x29f7e7,null));};
\ No newline at end of file
index f1df431..62cb56b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10ed=['rimraf','../../config/environment','exports','define','Template','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x59aa59,_0x48e977){var _0x482486=function(_0x3e3fea){while(--_0x3e3fea){_0x59aa59['push'](_0x59aa59['shift']());}};_0x482486(++_0x48e977);}(_0x10ed,0x68));var _0xd10e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x10ed[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xd10e('0x0'));var util=require(_0xd10e('0x1'));var logger=require(_0xd10e('0x2'))('api');var moment=require(_0xd10e('0x3'));var BPromise=require('bluebird');var rp=require(_0xd10e('0x4'));var fs=require('fs');var path=require(_0xd10e('0x5'));var rimraf=require(_0xd10e('0x6'));var config=require(_0xd10e('0x7'));var attributes=require('./template.attributes');module[_0xd10e('0x8')]=function(_0x12a29a,_0x3b7065){return _0x12a29a[_0xd10e('0x9')](_0xd10e('0xa'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6541=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash','../../config/logger'];(function(_0x23c2ec,_0x5adc8e){var _0xece329=function(_0x49d43e){while(--_0x49d43e){_0x23c2ec['push'](_0x23c2ec['shift']());}};_0xece329(++_0x5adc8e);}(_0x6541,0x132));var _0x1654=function(_0x40fc4a,_0x9cd8e1){_0x40fc4a=_0x40fc4a-0x0;var _0x5b4baf=_0x6541[_0x40fc4a];return _0x5b4baf;};'use strict';var _=require(_0x1654('0x0'));var util=require('util');var logger=require(_0x1654('0x1'))(_0x1654('0x2'));var moment=require(_0x1654('0x3'));var BPromise=require(_0x1654('0x4'));var rp=require(_0x1654('0x5'));var fs=require('fs');var path=require(_0x1654('0x6'));var rimraf=require(_0x1654('0x7'));var config=require(_0x1654('0x8'));var attributes=require(_0x1654('0x9'));module[_0x1654('0xa')]=function(_0x4af0cd,_0x324430){return _0x4af0cd[_0x1654('0xb')](_0x1654('0xc'),attributes,{'tableName':_0x1654('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7e145bb..9e694b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x021b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetTemplate','Template','options','raw','where','limit','include','map','model','attributes','lodash'];(function(_0x576ad0,_0x27c1b2){var _0x322308=function(_0x3ff79b){while(--_0x3ff79b){_0x576ad0['push'](_0x576ad0['shift']());}};_0x322308(++_0x27c1b2);}(_0x021b,0x95));var _0xb021=function(_0x43caa2,_0x1ffb73){_0x43caa2=_0x43caa2-0x0;var _0x51b342=_0x021b[_0x43caa2];return _0x51b342;};'use strict';var _=require(_0xb021('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb021('0x1'));var db=require(_0xb021('0x2'))['db'];var utils=require(_0xb021('0x3'));var logger=require(_0xb021('0x4'))(_0xb021('0x5'));var config=require(_0xb021('0x6'));var jayson=require(_0xb021('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x33756f,_0x209c96,_0x4998ee){return new BPromise(function(_0x2aa1f3,_0x24e027){return client['request'](_0x33756f,_0x4998ee)[_0xb021('0x8')](function(_0x5edaa1){logger['info'](_0xb021('0x9'),_0x209c96,_0xb021('0xa'));logger[_0xb021('0xb')](_0xb021('0xc'),_0x209c96,_0xb021('0xa'),JSON[_0xb021('0xd')](_0x5edaa1));if(_0x5edaa1[_0xb021('0xe')]){if(_0x5edaa1[_0xb021('0xe')][_0xb021('0xf')]===0x1f4){logger[_0xb021('0xe')](_0xb021('0x9'),_0x209c96,_0x5edaa1['error'][_0xb021('0x10')]);return _0x24e027(_0x5edaa1[_0xb021('0xe')]['message']);}logger[_0xb021('0xe')](_0xb021('0x9'),_0x209c96,_0x5edaa1[_0xb021('0xe')]['message']);return _0x2aa1f3(_0x5edaa1[_0xb021('0xe')][_0xb021('0x10')]);}else{logger[_0xb021('0x11')]('Template,\x20%s,\x20%s',_0x209c96,_0xb021('0xa'));_0x2aa1f3(_0x5edaa1[_0xb021('0x12')]['message']);}})[_0xb021('0x13')](function(_0x5436fd){logger[_0xb021('0xe')](_0xb021('0x9'),_0x209c96,_0x5436fd);_0x24e027(_0x5436fd);});});}exports[_0xb021('0x14')]=function(_0xe0559d){var _0x35f289=this;return new Promise(function(_0x26ca60,_0x50935d){return db[_0xb021('0x15')]['findAll']({'raw':_0xe0559d[_0xb021('0x16')]?_0xe0559d[_0xb021('0x16')][_0xb021('0x17')]===undefined?!![]:![]:!![],'where':_0xe0559d[_0xb021('0x16')]?_0xe0559d['options'][_0xb021('0x18')]||null:null,'attributes':_0xe0559d[_0xb021('0x16')]?_0xe0559d[_0xb021('0x16')]['attributes']||null:null,'limit':_0xe0559d[_0xb021('0x16')]?_0xe0559d[_0xb021('0x16')][_0xb021('0x19')]||null:null,'include':_0xe0559d[_0xb021('0x16')]?_0xe0559d[_0xb021('0x16')][_0xb021('0x1a')]?_[_0xb021('0x1b')](_0xe0559d['options'][_0xb021('0x1a')],function(_0x1891c4){return{'model':db[_0x1891c4[_0xb021('0x1c')]],'as':_0x1891c4['as'],'attributes':_0x1891c4[_0xb021('0x1d')],'include':_0x1891c4[_0xb021('0x1a')]?_['map'](_0x1891c4[_0xb021('0x1a')],function(_0x28f62d){return{'model':db[_0x28f62d[_0xb021('0x1c')]],'as':_0x28f62d['as'],'attributes':_0x28f62d[_0xb021('0x1d')],'include':_0x28f62d['include']?_[_0xb021('0x1b')](_0x28f62d[_0xb021('0x1a')],function(_0x40010c){return{'model':db[_0x40010c[_0xb021('0x1c')]],'as':_0x40010c['as'],'attributes':_0x40010c[_0xb021('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1681ae){logger[_0xb021('0x11')]('GetTemplate',_0xe0559d);logger[_0xb021('0xb')](_0xb021('0x14'),_0xe0559d,JSON[_0xb021('0xd')](_0x1681ae));_0x26ca60(_0x1681ae);})[_0xb021('0x13')](function(_0x25482a){logger[_0xb021('0xe')](_0xb021('0x14'),_0x25482a[_0xb021('0x10')],_0xe0559d);_0x50935d(_0x35f289[_0xb021('0xe')](0x1f4,_0x25482a[_0xb021('0x10')]));});});};
\ No newline at end of file
+var _0x3408=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetTemplate','Template','findAll','options','raw','attributes','limit','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x193c10,_0x329e0d){var _0x5fe7f=function(_0x4d1715){while(--_0x4d1715){_0x193c10['push'](_0x193c10['shift']());}};_0x5fe7f(++_0x329e0d);}(_0x3408,0x11a));var _0x8340=function(_0x4e4354,_0x54fb35){_0x4e4354=_0x4e4354-0x0;var _0x4401cc=_0x3408[_0x4e4354];return _0x4401cc;};'use strict';var _=require('lodash');var util=require(_0x8340('0x0'));var moment=require(_0x8340('0x1'));var BPromise=require(_0x8340('0x2'));var rs=require(_0x8340('0x3'));var fs=require('fs');var Redis=require(_0x8340('0x4'));var db=require(_0x8340('0x5'))['db'];var utils=require(_0x8340('0x6'));var logger=require(_0x8340('0x7'))('rpc');var config=require(_0x8340('0x8'));var jayson=require(_0x8340('0x9'));var client=jayson[_0x8340('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x370cd8,_0x4007a0,_0x5ea79a){return new BPromise(function(_0x45e172,_0x52a7c4){return client['request'](_0x370cd8,_0x5ea79a)[_0x8340('0xb')](function(_0x53062e){logger[_0x8340('0xc')](_0x8340('0xd'),_0x4007a0,'request\x20sent');logger[_0x8340('0xe')](_0x8340('0xf'),_0x4007a0,_0x8340('0x10'),JSON[_0x8340('0x11')](_0x53062e));if(_0x53062e['error']){if(_0x53062e[_0x8340('0x12')][_0x8340('0x13')]===0x1f4){logger[_0x8340('0x12')]('Template,\x20%s,\x20%s',_0x4007a0,_0x53062e[_0x8340('0x12')][_0x8340('0x14')]);return _0x52a7c4(_0x53062e['error'][_0x8340('0x14')]);}logger[_0x8340('0x12')](_0x8340('0xd'),_0x4007a0,_0x53062e[_0x8340('0x12')]['message']);return _0x45e172(_0x53062e['error'][_0x8340('0x14')]);}else{logger['info'](_0x8340('0xd'),_0x4007a0,_0x8340('0x10'));_0x45e172(_0x53062e['result'][_0x8340('0x14')]);}})[_0x8340('0x15')](function(_0x5338b5){logger[_0x8340('0x12')](_0x8340('0xd'),_0x4007a0,_0x5338b5);_0x52a7c4(_0x5338b5);});});}exports[_0x8340('0x16')]=function(_0x1e6253){var _0x48db65=this;return new Promise(function(_0x3acd91,_0x1a1d79){return db[_0x8340('0x17')][_0x8340('0x18')]({'raw':_0x1e6253[_0x8340('0x19')]?_0x1e6253['options'][_0x8340('0x1a')]===undefined?!![]:![]:!![],'where':_0x1e6253['options']?_0x1e6253[_0x8340('0x19')]['where']||null:null,'attributes':_0x1e6253[_0x8340('0x19')]?_0x1e6253[_0x8340('0x19')][_0x8340('0x1b')]||null:null,'limit':_0x1e6253[_0x8340('0x19')]?_0x1e6253['options'][_0x8340('0x1c')]||null:null,'include':_0x1e6253['options']?_0x1e6253['options'][_0x8340('0x1d')]?_[_0x8340('0x1e')](_0x1e6253[_0x8340('0x19')][_0x8340('0x1d')],function(_0xd432cd){return{'model':db[_0xd432cd[_0x8340('0x1f')]],'as':_0xd432cd['as'],'attributes':_0xd432cd[_0x8340('0x1b')],'include':_0xd432cd[_0x8340('0x1d')]?_[_0x8340('0x1e')](_0xd432cd['include'],function(_0x7d2b75){return{'model':db[_0x7d2b75[_0x8340('0x1f')]],'as':_0x7d2b75['as'],'attributes':_0x7d2b75[_0x8340('0x1b')],'include':_0x7d2b75['include']?_[_0x8340('0x1e')](_0x7d2b75[_0x8340('0x1d')],function(_0x200d96){return{'model':db[_0x200d96[_0x8340('0x1f')]],'as':_0x200d96['as'],'attributes':_0x200d96[_0x8340('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2eae4d){logger[_0x8340('0xc')]('GetTemplate',_0x1e6253);logger[_0x8340('0xe')](_0x8340('0x16'),_0x1e6253,JSON['stringify'](_0x2eae4d));_0x3acd91(_0x2eae4d);})['catch'](function(_0x4dfda0){logger[_0x8340('0x12')](_0x8340('0x16'),_0x4dfda0[_0x8340('0x14')],_0x1e6253);_0x1a1d79(_0x48db65[_0x8340('0x12')](0x1f4,_0x4dfda0['message']));});});};
\ No newline at end of file
index 8d8e158..d839b5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06a0=['exports','multer','path','Router','fs-extra','../../components/auth/service','./trigger.controller','get','isAuthenticated','index','/:id','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','update','delete','destroy'];(function(_0x5a4d96,_0x2fb762){var _0x496cbb=function(_0x33b472){while(--_0x33b472){_0x5a4d96['push'](_0x5a4d96['shift']());}};_0x496cbb(++_0x2fb762);}(_0x06a0,0x1e1));var _0x006a=function(_0x42639d,_0x2d1f80){_0x42639d=_0x42639d-0x0;var _0x390dff=_0x06a0[_0x42639d];return _0x390dff;};'use strict';var multer=require(_0x006a('0x0'));var util=require('util');var path=require(_0x006a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x006a('0x2')]();var fs_extra=require(_0x006a('0x3'));var auth=require(_0x006a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x006a('0x5'));router[_0x006a('0x6')]('/',auth[_0x006a('0x7')](),controller[_0x006a('0x8')]);router[_0x006a('0x6')](_0x006a('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x006a('0x6')](_0x006a('0xa'),auth[_0x006a('0x7')](),controller[_0x006a('0xb')]);router[_0x006a('0x6')](_0x006a('0xc'),auth[_0x006a('0x7')](),controller[_0x006a('0xd')]);router[_0x006a('0x6')](_0x006a('0xe'),auth[_0x006a('0x7')](),controller[_0x006a('0xf')]);router[_0x006a('0x10')]('/',auth[_0x006a('0x7')](),controller[_0x006a('0x11')]);router['post']('/:id/all_conditions',auth[_0x006a('0x7')](),controller[_0x006a('0x12')]);router[_0x006a('0x10')](_0x006a('0xc'),auth[_0x006a('0x7')](),controller[_0x006a('0x13')]);router[_0x006a('0x10')]('/:id/actions',auth['isAuthenticated'](),controller['addAction']);router['put'](_0x006a('0x9'),auth[_0x006a('0x7')](),controller[_0x006a('0x14')]);router[_0x006a('0x15')](_0x006a('0x9'),auth['isAuthenticated'](),controller[_0x006a('0x16')]);module[_0x006a('0x17')]=router;
\ No newline at end of file
+var _0xbe5e=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions','post','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','update','destroy','exports','multer'];(function(_0x399849,_0x3b630d){var _0xfbb04=function(_0x4fea04){while(--_0x4fea04){_0x399849['push'](_0x399849['shift']());}};_0xfbb04(++_0x3b630d);}(_0xbe5e,0x81));var _0xebe5=function(_0x4efee2,_0x48e32c){_0x4efee2=_0x4efee2-0x0;var _0x221221=_0xbe5e[_0x4efee2];return _0x221221;};'use strict';var multer=require(_0xebe5('0x0'));var util=require(_0xebe5('0x1'));var path=require('path');var timeout=require(_0xebe5('0x2'));var express=require(_0xebe5('0x3'));var router=express[_0xebe5('0x4')]();var fs_extra=require(_0xebe5('0x5'));var auth=require(_0xebe5('0x6'));var interaction=require(_0xebe5('0x7'));var config=require(_0xebe5('0x8'));var controller=require('./trigger.controller');router[_0xebe5('0x9')]('/',auth['isAuthenticated'](),controller[_0xebe5('0xa')]);router[_0xebe5('0x9')](_0xebe5('0xb'),auth[_0xebe5('0xc')](),controller[_0xebe5('0xd')]);router[_0xebe5('0x9')](_0xebe5('0xe'),auth[_0xebe5('0xc')](),controller[_0xebe5('0xf')]);router['get']('/:id/any_conditions',auth[_0xebe5('0xc')](),controller[_0xebe5('0x10')]);router['get'](_0xebe5('0x11'),auth[_0xebe5('0xc')](),controller['getActions']);router[_0xebe5('0x12')]('/',auth[_0xebe5('0xc')](),controller['create']);router['post']('/:id/all_conditions',auth[_0xebe5('0xc')](),controller[_0xebe5('0x13')]);router['post'](_0xebe5('0x14'),auth[_0xebe5('0xc')](),controller[_0xebe5('0x15')]);router['post'](_0xebe5('0x11'),auth[_0xebe5('0xc')](),controller[_0xebe5('0x16')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xebe5('0x17')]);router['delete']('/:id',auth[_0xebe5('0xc')](),controller[_0xebe5('0x18')]);module[_0xebe5('0x19')]=router;
\ No newline at end of file
index 25f63d7..764e05b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf04=['sequelize','exports','STRING'];(function(_0x557801,_0x359d85){var _0x20daab=function(_0xe0d2de){while(--_0xe0d2de){_0x557801['push'](_0x557801['shift']());}};_0x20daab(++_0x359d85);}(_0xcf04,0x1f2));var _0x4cf0=function(_0x142d8c,_0x1eac12){_0x142d8c=_0x142d8c-0x0;var _0xb61402=_0xcf04[_0x142d8c];return _0xb61402;};'use strict';var Sequelize=require(_0x4cf0('0x0'));module[_0x4cf0('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4cf0('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x53f1=['BOOLEAN','STRING'];(function(_0x2534cf,_0x545be6){var _0x221461=function(_0x379e83){while(--_0x379e83){_0x2534cf['push'](_0x2534cf['shift']());}};_0x221461(++_0x545be6);}(_0x53f1,0x7d));var _0x153f=function(_0x280e16,_0x3f7594){_0x280e16=_0x280e16-0x0;var _0x3063c2=_0x53f1[_0x280e16];return _0x3063c2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x153f('0x0')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x153f('0x1')],'defaultValue':![]}};
\ No newline at end of file
index a03176c..857a0cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e20=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','destroy','then','get','Triggers','UserProfileResource','error','stack','map','Trigger','fieldName','type','key','name','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','includeAll','include','rows','catch','show','params','rawAttributes','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','sort','getAnyConditions','findOne','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x2cb154,_0x92a409){var _0x37d8a3=function(_0x32baab){while(--_0x32baab){_0x2cb154['push'](_0x2cb154['shift']());}};_0x37d8a3(++_0x92a409);}(_0x2e20,0x1c8));var _0x02e2=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0x2e20[_0xbc346f];return _0x9f9260;};'use strict';var emlformat=require(_0x02e2('0x0'));var rimraf=require(_0x02e2('0x1'));var zipdir=require(_0x02e2('0x2'));var jsonpatch=require(_0x02e2('0x3'));var rp=require(_0x02e2('0x4'));var moment=require(_0x02e2('0x5'));var BPromise=require(_0x02e2('0x6'));var Mustache=require(_0x02e2('0x7'));var util=require(_0x02e2('0x8'));var path=require(_0x02e2('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x02e2('0xa'));var _=require(_0x02e2('0xb'));var squel=require(_0x02e2('0xc'));var crypto=require('crypto');var jsforce=require(_0x02e2('0xd'));var deskjs=require(_0x02e2('0xe'));var toCsv=require(_0x02e2('0xf'));var querystring=require(_0x02e2('0x10'));var Papa=require(_0x02e2('0x11'));var Redis=require(_0x02e2('0x12'));var authService=require(_0x02e2('0x13'));var qs=require(_0x02e2('0x14'));var as=require(_0x02e2('0x15'));var hardwareService=require(_0x02e2('0x16'));var logger=require('../../config/logger')(_0x02e2('0x17'));var utils=require(_0x02e2('0x18'));var config=require(_0x02e2('0x19'));var licenseUtil=require(_0x02e2('0x1a'));var db=require(_0x02e2('0x1b'))['db'];function respondWithStatusCode(_0x3e3c96,_0x2a1ffa){_0x2a1ffa=_0x2a1ffa||0xcc;return function(_0x3745b7){if(_0x3745b7){return _0x3e3c96[_0x02e2('0x1c')](_0x2a1ffa);}return _0x3e3c96[_0x02e2('0x1d')](_0x2a1ffa)[_0x02e2('0x1e')]();};}function respondWithResult(_0x2e71bc,_0x42a947){_0x42a947=_0x42a947||0xc8;return function(_0x323bb9){if(_0x323bb9){return _0x2e71bc[_0x02e2('0x1d')](_0x42a947)[_0x02e2('0x1f')](_0x323bb9);}};}function respondWithFilteredResult(_0x111cd6,_0x5073da){return function(_0x2507eb){if(_0x2507eb){var _0x55d66e=typeof _0x5073da[_0x02e2('0x20')]===_0x02e2('0x21')&&typeof _0x5073da[_0x02e2('0x22')]===_0x02e2('0x21');var _0x39c018=_0x2507eb[_0x02e2('0x23')];var _0x46b392=_0x55d66e?0x0:_0x5073da['offset'];var _0x3c0ffe=_0x55d66e?_0x2507eb['count']:_0x5073da[_0x02e2('0x20')]+_0x5073da['limit'];var _0x51f291;if(_0x3c0ffe>=_0x39c018){_0x3c0ffe=_0x39c018;_0x51f291=0xc8;}else{_0x51f291=0xce;}_0x111cd6['status'](_0x51f291);return _0x111cd6[_0x02e2('0x24')]('Content-Range',_0x46b392+'-'+_0x3c0ffe+'/'+_0x39c018)[_0x02e2('0x1f')](_0x2507eb);}return null;};}function patchUpdates(_0x1937c1){return function(_0xa20aed){try{jsonpatch['apply'](_0xa20aed,_0x1937c1,!![]);}catch(_0x570b68){return BPromise[_0x02e2('0x25')](_0x570b68);}return _0xa20aed[_0x02e2('0x26')]();};}function saveUpdates(_0x450322,_0x1da277){return function(_0x41ce37){if(_0x41ce37){return _0x41ce37[_0x02e2('0x27')](_0x450322)['then'](function(_0x522b10){return _0x522b10;});}return null;};}function removeEntity(_0x5b08d9,_0x3c3617){return function(_0x3df68c){if(_0x3df68c){return _0x3df68c[_0x02e2('0x28')]()[_0x02e2('0x29')](function(){var _0x58d079=_0x3df68c[_0x02e2('0x2a')]({'plain':!![]});var _0x24d611=_0x02e2('0x2b');return db[_0x02e2('0x2c')][_0x02e2('0x28')]({'where':{'type':_0x24d611,'resourceId':_0x58d079['id']}})['then'](function(){return _0x3df68c;});})[_0x02e2('0x29')](function(){_0x5b08d9[_0x02e2('0x1d')](0xcc)[_0x02e2('0x1e')]();});}};}function handleEntityNotFound(_0x20df30,_0x1f5af6){return function(_0x3e5123){if(!_0x3e5123){_0x20df30[_0x02e2('0x1c')](0x194);}return _0x3e5123;};}function handleError(_0x3c349c,_0x4545ce){_0x4545ce=_0x4545ce||0x1f4;return function(_0x46e43e){logger[_0x02e2('0x2d')](_0x46e43e[_0x02e2('0x2e')]);if(_0x46e43e['name']){delete _0x46e43e['name'];}_0x3c349c[_0x02e2('0x1d')](_0x4545ce)['send'](_0x46e43e);};}exports['index']=function(_0x5c33c7,_0x23bf56){var _0x53031d={},_0x54f154={},_0x35c489={'count':0x0,'rows':[]};var _0x221d1c=_[_0x02e2('0x2f')](db[_0x02e2('0x30')]['rawAttributes'],function(_0x11b180){return{'name':_0x11b180[_0x02e2('0x31')],'type':_0x11b180[_0x02e2('0x32')][_0x02e2('0x33')]};});_0x54f154['model']=_[_0x02e2('0x2f')](_0x221d1c,_0x02e2('0x34'));_0x54f154['query']=_[_0x02e2('0x35')](_0x5c33c7[_0x02e2('0x36')]);_0x54f154[_0x02e2('0x37')]=_[_0x02e2('0x38')](_0x54f154[_0x02e2('0x39')],_0x54f154[_0x02e2('0x36')]);_0x53031d[_0x02e2('0x3a')]=_[_0x02e2('0x38')](_0x54f154[_0x02e2('0x39')],qs['fields'](_0x5c33c7['query'][_0x02e2('0x3b')]));_0x53031d[_0x02e2('0x3a')]=_0x53031d[_0x02e2('0x3a')][_0x02e2('0x3c')]?_0x53031d[_0x02e2('0x3a')]:_0x54f154[_0x02e2('0x39')];if(!_0x5c33c7['query'][_0x02e2('0x3d')](_0x02e2('0x3e'))){_0x53031d[_0x02e2('0x22')]=qs[_0x02e2('0x22')](_0x5c33c7['query'][_0x02e2('0x22')]);_0x53031d['offset']=qs[_0x02e2('0x20')](_0x5c33c7[_0x02e2('0x36')]['offset']);}_0x53031d[_0x02e2('0x3f')]=qs['sort'](_0x5c33c7[_0x02e2('0x36')]['sort']);_0x53031d[_0x02e2('0x40')]=qs[_0x02e2('0x37')](_[_0x02e2('0x41')](_0x5c33c7[_0x02e2('0x36')],_0x54f154[_0x02e2('0x37')]),_0x221d1c);if(_0x5c33c7['query'][_0x02e2('0x42')]){_0x53031d['where']=_[_0x02e2('0x43')](_0x53031d[_0x02e2('0x40')],{'$or':_['map'](_0x221d1c,function(_0x58a08d){if(_0x58a08d[_0x02e2('0x32')]!=='VIRTUAL'){var _0x59b126={};_0x59b126[_0x58a08d[_0x02e2('0x34')]]={'$like':'%'+_0x5c33c7['query'][_0x02e2('0x42')]+'%'};return _0x59b126;}})});}_0x53031d=_[_0x02e2('0x43')]({},_0x53031d,_0x5c33c7['options']);var _0x14e44f={'where':_0x53031d[_0x02e2('0x40')]};return db[_0x02e2('0x30')][_0x02e2('0x23')](_0x14e44f)[_0x02e2('0x29')](function(_0x3c6896){_0x35c489[_0x02e2('0x23')]=_0x3c6896;if(_0x5c33c7[_0x02e2('0x36')][_0x02e2('0x44')]){_0x53031d[_0x02e2('0x45')]=[{'all':!![]}];}return db['Trigger']['findAll'](_0x53031d);})[_0x02e2('0x29')](function(_0x34809c){_0x35c489[_0x02e2('0x46')]=_0x34809c;return _0x35c489;})['then'](respondWithFilteredResult(_0x23bf56,_0x53031d))[_0x02e2('0x47')](handleError(_0x23bf56,null));};exports[_0x02e2('0x48')]=function(_0x3f33f4,_0x535f88){var _0x5bcc8a={'raw':![],'where':{'id':_0x3f33f4[_0x02e2('0x49')]['id']}},_0x222636={};_0x222636[_0x02e2('0x39')]=_[_0x02e2('0x35')](db['Trigger'][_0x02e2('0x4a')]);_0x222636[_0x02e2('0x36')]=_[_0x02e2('0x35')](_0x3f33f4[_0x02e2('0x36')]);_0x222636[_0x02e2('0x37')]=_['intersection'](_0x222636[_0x02e2('0x39')],_0x222636[_0x02e2('0x36')]);_0x5bcc8a[_0x02e2('0x3a')]=_[_0x02e2('0x38')](_0x222636[_0x02e2('0x39')],qs['fields'](_0x3f33f4[_0x02e2('0x36')]['fields']));_0x5bcc8a[_0x02e2('0x3a')]=_0x5bcc8a[_0x02e2('0x3a')][_0x02e2('0x3c')]?_0x5bcc8a['attributes']:_0x222636[_0x02e2('0x39')];if(_0x3f33f4['query'][_0x02e2('0x44')]){_0x5bcc8a[_0x02e2('0x45')]=[{'all':!![]}];}_0x5bcc8a=_['merge']({},_0x5bcc8a,_0x3f33f4[_0x02e2('0x4b')]);return db['Trigger']['find'](_0x5bcc8a)[_0x02e2('0x29')](handleEntityNotFound(_0x535f88,null))[_0x02e2('0x29')](respondWithResult(_0x535f88,null))[_0x02e2('0x47')](handleError(_0x535f88,null));};exports['create']=function(_0x41c0b1,_0x3e69ad){return db[_0x02e2('0x30')][_0x02e2('0x4c')](_0x41c0b1[_0x02e2('0x4d')],{})['then'](function(_0x568e3d){var _0xd2f8=_0x41c0b1[_0x02e2('0x4e')]['get']({'plain':!![]});if(!_0xd2f8)throw new Error(_0x02e2('0x4f'));if(_0xd2f8['role']===_0x02e2('0x4e')){var _0xd2047=_0x568e3d[_0x02e2('0x2a')]({'plain':!![]});var _0x162bf9=_0x02e2('0x2b');return db[_0x02e2('0x50')][_0x02e2('0x51')]({'where':{'name':_0x162bf9,'userProfileId':_0xd2f8['userProfileId']},'raw':!![]})[_0x02e2('0x29')](function(_0x5d2418){if(_0x5d2418&&_0x5d2418[_0x02e2('0x52')]===0x0){return db['UserProfileResource'][_0x02e2('0x4c')]({'name':_0xd2047[_0x02e2('0x34')],'resourceId':_0xd2047['id'],'type':_0x5d2418[_0x02e2('0x34')],'sectionId':_0x5d2418['id']},{})['then'](function(){return _0x568e3d;});}else{return _0x568e3d;}})['catch'](function(_0x1f70b0){logger['error'](_0x02e2('0x53'),_0x1f70b0);throw _0x1f70b0;});}return _0x568e3d;})[_0x02e2('0x29')](respondWithResult(_0x3e69ad,0xc9))[_0x02e2('0x47')](handleError(_0x3e69ad,null));};exports[_0x02e2('0x27')]=function(_0xdc820a,_0x279391){if(_0xdc820a[_0x02e2('0x4d')]['id']){delete _0xdc820a[_0x02e2('0x4d')]['id'];}return db[_0x02e2('0x30')][_0x02e2('0x51')]({'where':{'id':_0xdc820a['params']['id']}})[_0x02e2('0x29')](handleEntityNotFound(_0x279391,null))['then'](saveUpdates(_0xdc820a[_0x02e2('0x4d')],null))[_0x02e2('0x29')](respondWithResult(_0x279391,null))[_0x02e2('0x47')](handleError(_0x279391,null));};exports['destroy']=function(_0x41a9f1,_0x54cd84){return db['Trigger']['find']({'where':{'id':_0x41a9f1['params']['id']}})[_0x02e2('0x29')](handleEntityNotFound(_0x54cd84,null))[_0x02e2('0x29')](removeEntity(_0x54cd84,null))[_0x02e2('0x47')](handleError(_0x54cd84,null));};exports['addAllCondition']=function(_0x26b77f,_0x3bdada,_0x4cbc43){if(_0x26b77f[_0x02e2('0x4d')]['id']){delete _0x26b77f['body']['id'];}return db[_0x02e2('0x30')][_0x02e2('0x51')]({'where':{'id':_0x26b77f[_0x02e2('0x49')]['id']}})[_0x02e2('0x29')](handleEntityNotFound(_0x3bdada,null))['then'](function(_0x4b9796){if(_0x4b9796){_0x26b77f[_0x02e2('0x4d')][_0x02e2('0x54')]=_0x4b9796['id'];return db[_0x02e2('0x55')][_0x02e2('0x4c')](_0x26b77f[_0x02e2('0x4d')]);}})['then'](respondWithResult(_0x3bdada,null))[_0x02e2('0x47')](handleError(_0x3bdada,null));};exports[_0x02e2('0x56')]=function(_0x271497,_0x110921,_0x917f95){if(_0x271497[_0x02e2('0x4d')]['id']){delete _0x271497[_0x02e2('0x4d')]['id'];}return db[_0x02e2('0x30')][_0x02e2('0x51')]({'where':{'id':_0x271497['params']['id']}})[_0x02e2('0x29')](handleEntityNotFound(_0x110921,null))['then'](function(_0x3575cc){if(_0x3575cc){_0x271497[_0x02e2('0x4d')][_0x02e2('0x57')]=_0x3575cc['id'];return db['Condition'][_0x02e2('0x4c')](_0x271497['body']);}})[_0x02e2('0x29')](respondWithResult(_0x110921,null))['catch'](handleError(_0x110921,null));};exports[_0x02e2('0x58')]=function(_0x3941f9,_0xd87484,_0x581a7a){var _0x27ec8e={};var _0x19333f={};var _0x4146d2;var _0x32c2aa;return db['Trigger']['findOne']({'where':{'id':_0x3941f9[_0x02e2('0x49')]['id']}})[_0x02e2('0x29')](handleEntityNotFound(_0xd87484,null))[_0x02e2('0x29')](function(_0x34254c){if(_0x34254c){_0x4146d2=_0x34254c;_0x19333f['model']=_[_0x02e2('0x35')](db['Condition'][_0x02e2('0x4a')]);_0x19333f[_0x02e2('0x36')]=_['keys'](_0x3941f9[_0x02e2('0x36')]);_0x19333f[_0x02e2('0x37')]=_[_0x02e2('0x38')](_0x19333f[_0x02e2('0x39')],_0x19333f[_0x02e2('0x36')]);_0x27ec8e[_0x02e2('0x3a')]=_[_0x02e2('0x38')](_0x19333f[_0x02e2('0x39')],qs[_0x02e2('0x3b')](_0x3941f9[_0x02e2('0x36')]['fields']));_0x27ec8e[_0x02e2('0x3a')]=_0x27ec8e[_0x02e2('0x3a')][_0x02e2('0x3c')]?_0x27ec8e[_0x02e2('0x3a')]:_0x19333f[_0x02e2('0x39')];_0x27ec8e[_0x02e2('0x3f')]=qs[_0x02e2('0x59')](_0x3941f9[_0x02e2('0x36')][_0x02e2('0x59')]);_0x27ec8e[_0x02e2('0x40')]=qs[_0x02e2('0x37')](_[_0x02e2('0x41')](_0x3941f9['query'],_0x19333f[_0x02e2('0x37')]));if(_0x3941f9[_0x02e2('0x36')][_0x02e2('0x42')]){_0x27ec8e[_0x02e2('0x40')]=_[_0x02e2('0x43')](_0x27ec8e[_0x02e2('0x40')],{'$or':_[_0x02e2('0x2f')](_0x27ec8e[_0x02e2('0x3a')],function(_0x2af747){var _0x2d320c={};_0x2d320c[_0x2af747]={'$like':'%'+_0x3941f9[_0x02e2('0x36')][_0x02e2('0x42')]+'%'};return _0x2d320c;})});}_0x27ec8e=_['merge']({},_0x27ec8e,_0x3941f9['options']);return _0x4146d2['getAllConditions'](_0x27ec8e);}})[_0x02e2('0x29')](function(_0x32335f){if(_0x32335f){_0x32c2aa=_0x32335f['length'];if(!_0x3941f9[_0x02e2('0x36')][_0x02e2('0x3d')](_0x02e2('0x3e'))){_0x27ec8e['limit']=qs['limit'](_0x3941f9['query']['limit']);_0x27ec8e[_0x02e2('0x20')]=qs[_0x02e2('0x20')](_0x3941f9[_0x02e2('0x36')][_0x02e2('0x20')]);}return _0x4146d2[_0x02e2('0x58')](_0x27ec8e);}})[_0x02e2('0x29')](function(_0x12f836){if(_0x12f836){return _0x12f836?{'count':_0x32c2aa,'rows':_0x12f836}:null;}})['then'](respondWithResult(_0xd87484,null))[_0x02e2('0x47')](handleError(_0xd87484,null));};exports[_0x02e2('0x5a')]=function(_0x5e9c45,_0x5494d5,_0x18148a){var _0xbc20a2={};var _0x161019={};var _0x2e38a8;var _0x4d951a;return db['Trigger'][_0x02e2('0x5b')]({'where':{'id':_0x5e9c45['params']['id']}})[_0x02e2('0x29')](handleEntityNotFound(_0x5494d5,null))[_0x02e2('0x29')](function(_0x38965c){if(_0x38965c){_0x2e38a8=_0x38965c;_0x161019['model']=_['keys'](db[_0x02e2('0x55')][_0x02e2('0x4a')]);_0x161019[_0x02e2('0x36')]=_['keys'](_0x5e9c45[_0x02e2('0x36')]);_0x161019[_0x02e2('0x37')]=_[_0x02e2('0x38')](_0x161019[_0x02e2('0x39')],_0x161019['query']);_0xbc20a2[_0x02e2('0x3a')]=_['intersection'](_0x161019['model'],qs[_0x02e2('0x3b')](_0x5e9c45[_0x02e2('0x36')]['fields']));_0xbc20a2[_0x02e2('0x3a')]=_0xbc20a2[_0x02e2('0x3a')]['length']?_0xbc20a2['attributes']:_0x161019[_0x02e2('0x39')];_0xbc20a2[_0x02e2('0x3f')]=qs[_0x02e2('0x59')](_0x5e9c45[_0x02e2('0x36')][_0x02e2('0x59')]);_0xbc20a2[_0x02e2('0x40')]=qs[_0x02e2('0x37')](_[_0x02e2('0x41')](_0x5e9c45[_0x02e2('0x36')],_0x161019['filters']));if(_0x5e9c45[_0x02e2('0x36')][_0x02e2('0x42')]){_0xbc20a2[_0x02e2('0x40')]=_[_0x02e2('0x43')](_0xbc20a2['where'],{'$or':_[_0x02e2('0x2f')](_0xbc20a2[_0x02e2('0x3a')],function(_0x3bb3c6){var _0x2cb856={};_0x2cb856[_0x3bb3c6]={'$like':'%'+_0x5e9c45[_0x02e2('0x36')]['filter']+'%'};return _0x2cb856;})});}_0xbc20a2=_[_0x02e2('0x43')]({},_0xbc20a2,_0x5e9c45[_0x02e2('0x4b')]);return _0x2e38a8[_0x02e2('0x5a')](_0xbc20a2);}})[_0x02e2('0x29')](function(_0x71a564){if(_0x71a564){_0x4d951a=_0x71a564[_0x02e2('0x3c')];if(!_0x5e9c45[_0x02e2('0x36')][_0x02e2('0x3d')](_0x02e2('0x3e'))){_0xbc20a2['limit']=qs[_0x02e2('0x22')](_0x5e9c45[_0x02e2('0x36')]['limit']);_0xbc20a2[_0x02e2('0x20')]=qs[_0x02e2('0x20')](_0x5e9c45[_0x02e2('0x36')][_0x02e2('0x20')]);}return _0x2e38a8[_0x02e2('0x5a')](_0xbc20a2);}})[_0x02e2('0x29')](function(_0x28dabb){if(_0x28dabb){return _0x28dabb?{'count':_0x4d951a,'rows':_0x28dabb}:null;}})[_0x02e2('0x29')](respondWithResult(_0x5494d5,null))['catch'](handleError(_0x5494d5,null));};exports['addAction']=function(_0x427654,_0x12839c,_0x2d9e5c){if(_0x427654[_0x02e2('0x4d')]['id']){delete _0x427654[_0x02e2('0x4d')]['id'];}return db['Trigger']['find']({'where':{'id':_0x427654[_0x02e2('0x49')]['id']}})[_0x02e2('0x29')](handleEntityNotFound(_0x12839c,null))[_0x02e2('0x29')](function(_0x20d5a6){if(_0x20d5a6){_0x427654['body'][_0x02e2('0x5c')]=_0x20d5a6['id'];return db[_0x02e2('0x5d')][_0x02e2('0x4c')](_0x427654[_0x02e2('0x4d')]);}})['then'](respondWithResult(_0x12839c,null))[_0x02e2('0x47')](handleError(_0x12839c,null));};exports[_0x02e2('0x5e')]=function(_0xb4cf0a,_0x21b1d1,_0xd472a7){var _0x7d6c5e={};var _0x167371={};var _0xe15b;var _0x3f56fb;return db[_0x02e2('0x30')][_0x02e2('0x5b')]({'where':{'id':_0xb4cf0a[_0x02e2('0x49')]['id']}})['then'](handleEntityNotFound(_0x21b1d1,null))[_0x02e2('0x29')](function(_0x32c51f){if(_0x32c51f){_0xe15b=_0x32c51f;_0x167371[_0x02e2('0x39')]=_['keys'](db[_0x02e2('0x5d')][_0x02e2('0x4a')]);_0x167371[_0x02e2('0x36')]=_[_0x02e2('0x35')](_0xb4cf0a[_0x02e2('0x36')]);_0x167371['filters']=_[_0x02e2('0x38')](_0x167371[_0x02e2('0x39')],_0x167371['query']);_0x7d6c5e[_0x02e2('0x3a')]=_[_0x02e2('0x38')](_0x167371[_0x02e2('0x39')],qs[_0x02e2('0x3b')](_0xb4cf0a['query']['fields']));_0x7d6c5e[_0x02e2('0x3a')]=_0x7d6c5e['attributes']['length']?_0x7d6c5e[_0x02e2('0x3a')]:_0x167371[_0x02e2('0x39')];_0x7d6c5e[_0x02e2('0x3f')]=qs['sort'](_0xb4cf0a['query'][_0x02e2('0x59')]);_0x7d6c5e[_0x02e2('0x40')]=qs[_0x02e2('0x37')](_['pick'](_0xb4cf0a[_0x02e2('0x36')],_0x167371['filters']));if(_0xb4cf0a[_0x02e2('0x36')][_0x02e2('0x42')]){_0x7d6c5e['where']=_[_0x02e2('0x43')](_0x7d6c5e['where'],{'$or':_[_0x02e2('0x2f')](_0x7d6c5e[_0x02e2('0x3a')],function(_0x4046b0){var _0x480aa4={};_0x480aa4[_0x4046b0]={'$like':'%'+_0xb4cf0a[_0x02e2('0x36')][_0x02e2('0x42')]+'%'};return _0x480aa4;})});}_0x7d6c5e=_['merge']({},_0x7d6c5e,_0xb4cf0a['options']);return _0xe15b['getActions'](_0x7d6c5e);}})[_0x02e2('0x29')](function(_0x55688c){if(_0x55688c){_0x3f56fb=_0x55688c['length'];if(!_0xb4cf0a['query'][_0x02e2('0x3d')](_0x02e2('0x3e'))){_0x7d6c5e[_0x02e2('0x22')]=qs[_0x02e2('0x22')](_0xb4cf0a[_0x02e2('0x36')]['limit']);_0x7d6c5e[_0x02e2('0x20')]=qs[_0x02e2('0x20')](_0xb4cf0a[_0x02e2('0x36')]['offset']);}return _0xe15b[_0x02e2('0x5e')](_0x7d6c5e);}})[_0x02e2('0x29')](function(_0x50210e){if(_0x50210e){return _0x50210e?{'count':_0x3f56fb,'rows':_0x50210e}:null;}})[_0x02e2('0x29')](respondWithResult(_0x21b1d1,null))[_0x02e2('0x47')](handleError(_0x21b1d1,null));};
\ No newline at end of file
+var _0xfd21=['offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','map','Trigger','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','params','keys','create','body','role','user','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','nolimit','addAction','Action','getActions','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json'];(function(_0x4b86be,_0x539474){var _0x3196f6=function(_0x3fc506){while(--_0x3fc506){_0x4b86be['push'](_0x4b86be['shift']());}};_0x3196f6(++_0x539474);}(_0xfd21,0x96));var _0x1fd2=function(_0xda8f77,_0x82a349){_0xda8f77=_0xda8f77-0x0;var _0x6a843c=_0xfd21[_0xda8f77];return _0x6a843c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1fd2('0x0'));var jsonpatch=require(_0x1fd2('0x1'));var rp=require(_0x1fd2('0x2'));var moment=require('moment');var BPromise=require(_0x1fd2('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1fd2('0x4'));var sox=require(_0x1fd2('0x5'));var csv=require(_0x1fd2('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1fd2('0x7'));var _=require('lodash');var squel=require(_0x1fd2('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1fd2('0x9'));var toCsv=require(_0x1fd2('0x6'));var querystring=require(_0x1fd2('0xa'));var Papa=require(_0x1fd2('0xb'));var Redis=require(_0x1fd2('0xc'));var authService=require(_0x1fd2('0xd'));var qs=require(_0x1fd2('0xe'));var as=require(_0x1fd2('0xf'));var hardwareService=require(_0x1fd2('0x10'));var logger=require('../../config/logger')(_0x1fd2('0x11'));var utils=require(_0x1fd2('0x12'));var config=require(_0x1fd2('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ac57a,_0xf6fff9){_0xf6fff9=_0xf6fff9||0xcc;return function(_0x3dbbb3){if(_0x3dbbb3){return _0x3ac57a[_0x1fd2('0x14')](_0xf6fff9);}return _0x3ac57a[_0x1fd2('0x15')](_0xf6fff9)[_0x1fd2('0x16')]();};}function respondWithResult(_0x34e006,_0xc9b1f7){_0xc9b1f7=_0xc9b1f7||0xc8;return function(_0x1c428a){if(_0x1c428a){return _0x34e006[_0x1fd2('0x15')](_0xc9b1f7)[_0x1fd2('0x17')](_0x1c428a);}};}function respondWithFilteredResult(_0x53ef48,_0x2dab43){return function(_0x4e4092){if(_0x4e4092){var _0x11be03=typeof _0x2dab43[_0x1fd2('0x18')]===_0x1fd2('0x19')&&typeof _0x2dab43[_0x1fd2('0x1a')]===_0x1fd2('0x19');var _0x26d783=_0x4e4092[_0x1fd2('0x1b')];var _0x2f2631=_0x11be03?0x0:_0x2dab43[_0x1fd2('0x18')];var _0x4a2eed=_0x11be03?_0x4e4092[_0x1fd2('0x1b')]:_0x2dab43['offset']+_0x2dab43[_0x1fd2('0x1a')];var _0x59602d;if(_0x4a2eed>=_0x26d783){_0x4a2eed=_0x26d783;_0x59602d=0xc8;}else{_0x59602d=0xce;}_0x53ef48[_0x1fd2('0x15')](_0x59602d);return _0x53ef48[_0x1fd2('0x1c')](_0x1fd2('0x1d'),_0x2f2631+'-'+_0x4a2eed+'/'+_0x26d783)[_0x1fd2('0x17')](_0x4e4092);}return null;};}function patchUpdates(_0x177d44){return function(_0x362bfa){try{jsonpatch[_0x1fd2('0x1e')](_0x362bfa,_0x177d44,!![]);}catch(_0x5b2e94){return BPromise['reject'](_0x5b2e94);}return _0x362bfa['save']();};}function saveUpdates(_0x15f5f1,_0x5a24b4){return function(_0x350e7a){if(_0x350e7a){return _0x350e7a[_0x1fd2('0x1f')](_0x15f5f1)[_0x1fd2('0x20')](function(_0x3e34e6){return _0x3e34e6;});}return null;};}function removeEntity(_0xa925ed,_0x1281bd){return function(_0x3824d5){if(_0x3824d5){return _0x3824d5[_0x1fd2('0x21')]()['then'](function(){var _0x1b4471=_0x3824d5[_0x1fd2('0x22')]({'plain':!![]});var _0x42d0b5=_0x1fd2('0x23');return db[_0x1fd2('0x24')]['destroy']({'where':{'type':_0x42d0b5,'resourceId':_0x1b4471['id']}})[_0x1fd2('0x20')](function(){return _0x3824d5;});})[_0x1fd2('0x20')](function(){_0xa925ed[_0x1fd2('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e6225,_0x3fbf04){return function(_0x4b72c7){if(!_0x4b72c7){_0x5e6225[_0x1fd2('0x14')](0x194);}return _0x4b72c7;};}function handleError(_0x4d438e,_0x488b5f){_0x488b5f=_0x488b5f||0x1f4;return function(_0x1a5352){logger[_0x1fd2('0x25')](_0x1a5352[_0x1fd2('0x26')]);if(_0x1a5352['name']){delete _0x1a5352[_0x1fd2('0x27')];}_0x4d438e['status'](_0x488b5f)[_0x1fd2('0x28')](_0x1a5352);};}exports['index']=function(_0x46b995,_0x49344b){var _0x71199d={},_0x38792a={},_0x160123={'count':0x0,'rows':[]};var _0x24ff75=_[_0x1fd2('0x29')](db[_0x1fd2('0x2a')][_0x1fd2('0x2b')],function(_0x5ce36b){return{'name':_0x5ce36b[_0x1fd2('0x2c')],'type':_0x5ce36b['type'][_0x1fd2('0x2d')]};});_0x38792a['model']=_[_0x1fd2('0x29')](_0x24ff75,_0x1fd2('0x27'));_0x38792a['query']=_['keys'](_0x46b995[_0x1fd2('0x2e')]);_0x38792a[_0x1fd2('0x2f')]=_[_0x1fd2('0x30')](_0x38792a[_0x1fd2('0x31')],_0x38792a[_0x1fd2('0x2e')]);_0x71199d[_0x1fd2('0x32')]=_['intersection'](_0x38792a[_0x1fd2('0x31')],qs[_0x1fd2('0x33')](_0x46b995['query'][_0x1fd2('0x33')]));_0x71199d[_0x1fd2('0x32')]=_0x71199d[_0x1fd2('0x32')][_0x1fd2('0x34')]?_0x71199d['attributes']:_0x38792a[_0x1fd2('0x31')];if(!_0x46b995[_0x1fd2('0x2e')][_0x1fd2('0x35')]('nolimit')){_0x71199d[_0x1fd2('0x1a')]=qs[_0x1fd2('0x1a')](_0x46b995[_0x1fd2('0x2e')][_0x1fd2('0x1a')]);_0x71199d[_0x1fd2('0x18')]=qs[_0x1fd2('0x18')](_0x46b995[_0x1fd2('0x2e')]['offset']);}_0x71199d[_0x1fd2('0x36')]=qs[_0x1fd2('0x37')](_0x46b995[_0x1fd2('0x2e')][_0x1fd2('0x37')]);_0x71199d[_0x1fd2('0x38')]=qs[_0x1fd2('0x2f')](_[_0x1fd2('0x39')](_0x46b995[_0x1fd2('0x2e')],_0x38792a[_0x1fd2('0x2f')]),_0x24ff75);if(_0x46b995[_0x1fd2('0x2e')]['filter']){_0x71199d['where']=_[_0x1fd2('0x3a')](_0x71199d['where'],{'$or':_[_0x1fd2('0x29')](_0x24ff75,function(_0x55ee96){if(_0x55ee96['type']!==_0x1fd2('0x3b')){var _0x8fd055={};_0x8fd055[_0x55ee96[_0x1fd2('0x27')]]={'$like':'%'+_0x46b995[_0x1fd2('0x2e')][_0x1fd2('0x3c')]+'%'};return _0x8fd055;}})});}_0x71199d=_['merge']({},_0x71199d,_0x46b995[_0x1fd2('0x3d')]);var _0x2808a0={'where':_0x71199d['where']};return db['Trigger'][_0x1fd2('0x1b')](_0x2808a0)[_0x1fd2('0x20')](function(_0x4912a1){_0x160123['count']=_0x4912a1;if(_0x46b995['query'][_0x1fd2('0x3e')]){_0x71199d[_0x1fd2('0x3f')]=[{'all':!![]}];}return db['Trigger'][_0x1fd2('0x40')](_0x71199d);})[_0x1fd2('0x20')](function(_0x1d6282){_0x160123['rows']=_0x1d6282;return _0x160123;})[_0x1fd2('0x20')](respondWithFilteredResult(_0x49344b,_0x71199d))[_0x1fd2('0x41')](handleError(_0x49344b,null));};exports['show']=function(_0x2c22ed,_0x3a64f5){var _0x558833={'raw':![],'where':{'id':_0x2c22ed[_0x1fd2('0x42')]['id']}},_0x23174d={};_0x23174d['model']=_[_0x1fd2('0x43')](db[_0x1fd2('0x2a')][_0x1fd2('0x2b')]);_0x23174d[_0x1fd2('0x2e')]=_['keys'](_0x2c22ed[_0x1fd2('0x2e')]);_0x23174d[_0x1fd2('0x2f')]=_[_0x1fd2('0x30')](_0x23174d[_0x1fd2('0x31')],_0x23174d[_0x1fd2('0x2e')]);_0x558833[_0x1fd2('0x32')]=_[_0x1fd2('0x30')](_0x23174d[_0x1fd2('0x31')],qs['fields'](_0x2c22ed['query'][_0x1fd2('0x33')]));_0x558833['attributes']=_0x558833['attributes'][_0x1fd2('0x34')]?_0x558833['attributes']:_0x23174d[_0x1fd2('0x31')];if(_0x2c22ed[_0x1fd2('0x2e')][_0x1fd2('0x3e')]){_0x558833[_0x1fd2('0x3f')]=[{'all':!![]}];}_0x558833=_['merge']({},_0x558833,_0x2c22ed[_0x1fd2('0x3d')]);return db['Trigger']['find'](_0x558833)['then'](handleEntityNotFound(_0x3a64f5,null))['then'](respondWithResult(_0x3a64f5,null))['catch'](handleError(_0x3a64f5,null));};exports[_0x1fd2('0x44')]=function(_0x3751ef,_0x2c40a0){return db['Trigger'][_0x1fd2('0x44')](_0x3751ef[_0x1fd2('0x45')],{})[_0x1fd2('0x20')](function(_0x1d3ecb){var _0x9ac3e4=_0x3751ef['user']['get']({'plain':!![]});if(!_0x9ac3e4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9ac3e4[_0x1fd2('0x46')]===_0x1fd2('0x47')){var _0xc8595c=_0x1d3ecb['get']({'plain':!![]});var _0x31cbe9=_0x1fd2('0x23');return db['UserProfileSection'][_0x1fd2('0x48')]({'where':{'name':_0x31cbe9,'userProfileId':_0x9ac3e4['userProfileId']},'raw':!![]})[_0x1fd2('0x20')](function(_0x55bdaf){if(_0x55bdaf&&_0x55bdaf[_0x1fd2('0x49')]===0x0){return db[_0x1fd2('0x24')]['create']({'name':_0xc8595c[_0x1fd2('0x27')],'resourceId':_0xc8595c['id'],'type':_0x55bdaf[_0x1fd2('0x27')],'sectionId':_0x55bdaf['id']},{})[_0x1fd2('0x20')](function(){return _0x1d3ecb;});}else{return _0x1d3ecb;}})['catch'](function(_0x33c856){logger['error'](_0x1fd2('0x4a'),_0x33c856);throw _0x33c856;});}return _0x1d3ecb;})[_0x1fd2('0x20')](respondWithResult(_0x2c40a0,0xc9))[_0x1fd2('0x41')](handleError(_0x2c40a0,null));};exports['update']=function(_0x4a05ac,_0x2dd911){if(_0x4a05ac[_0x1fd2('0x45')]['id']){delete _0x4a05ac[_0x1fd2('0x45')]['id'];}return db['Trigger']['find']({'where':{'id':_0x4a05ac[_0x1fd2('0x42')]['id']}})['then'](handleEntityNotFound(_0x2dd911,null))[_0x1fd2('0x20')](saveUpdates(_0x4a05ac['body'],null))[_0x1fd2('0x20')](respondWithResult(_0x2dd911,null))['catch'](handleError(_0x2dd911,null));};exports[_0x1fd2('0x21')]=function(_0x404556,_0x7fb4c7){return db[_0x1fd2('0x2a')]['find']({'where':{'id':_0x404556['params']['id']}})[_0x1fd2('0x20')](handleEntityNotFound(_0x7fb4c7,null))['then'](removeEntity(_0x7fb4c7,null))[_0x1fd2('0x41')](handleError(_0x7fb4c7,null));};exports[_0x1fd2('0x4b')]=function(_0x2e982f,_0x45f46b,_0x16a1dd){if(_0x2e982f['body']['id']){delete _0x2e982f['body']['id'];}return db[_0x1fd2('0x2a')][_0x1fd2('0x48')]({'where':{'id':_0x2e982f[_0x1fd2('0x42')]['id']}})[_0x1fd2('0x20')](handleEntityNotFound(_0x45f46b,null))[_0x1fd2('0x20')](function(_0x5890e5){if(_0x5890e5){_0x2e982f[_0x1fd2('0x45')][_0x1fd2('0x4c')]=_0x5890e5['id'];return db[_0x1fd2('0x4d')]['create'](_0x2e982f[_0x1fd2('0x45')]);}})['then'](respondWithResult(_0x45f46b,null))[_0x1fd2('0x41')](handleError(_0x45f46b,null));};exports[_0x1fd2('0x4e')]=function(_0x1cede5,_0x19e49c,_0x561d3b){if(_0x1cede5['body']['id']){delete _0x1cede5['body']['id'];}return db[_0x1fd2('0x2a')]['find']({'where':{'id':_0x1cede5[_0x1fd2('0x42')]['id']}})['then'](handleEntityNotFound(_0x19e49c,null))[_0x1fd2('0x20')](function(_0x5692e4){if(_0x5692e4){_0x1cede5['body'][_0x1fd2('0x4f')]=_0x5692e4['id'];return db[_0x1fd2('0x4d')]['create'](_0x1cede5[_0x1fd2('0x45')]);}})[_0x1fd2('0x20')](respondWithResult(_0x19e49c,null))['catch'](handleError(_0x19e49c,null));};exports[_0x1fd2('0x50')]=function(_0x459e18,_0x53ee1b,_0xdcdbb6){var _0x17f517={};var _0xe62521={};var _0x229bf6;var _0x3accfd;return db[_0x1fd2('0x2a')][_0x1fd2('0x51')]({'where':{'id':_0x459e18['params']['id']}})[_0x1fd2('0x20')](handleEntityNotFound(_0x53ee1b,null))[_0x1fd2('0x20')](function(_0x16eac7){if(_0x16eac7){_0x229bf6=_0x16eac7;_0xe62521[_0x1fd2('0x31')]=_['keys'](db[_0x1fd2('0x4d')][_0x1fd2('0x2b')]);_0xe62521[_0x1fd2('0x2e')]=_['keys'](_0x459e18[_0x1fd2('0x2e')]);_0xe62521[_0x1fd2('0x2f')]=_[_0x1fd2('0x30')](_0xe62521[_0x1fd2('0x31')],_0xe62521[_0x1fd2('0x2e')]);_0x17f517[_0x1fd2('0x32')]=_[_0x1fd2('0x30')](_0xe62521['model'],qs[_0x1fd2('0x33')](_0x459e18[_0x1fd2('0x2e')][_0x1fd2('0x33')]));_0x17f517[_0x1fd2('0x32')]=_0x17f517['attributes'][_0x1fd2('0x34')]?_0x17f517[_0x1fd2('0x32')]:_0xe62521[_0x1fd2('0x31')];_0x17f517[_0x1fd2('0x36')]=qs[_0x1fd2('0x37')](_0x459e18[_0x1fd2('0x2e')][_0x1fd2('0x37')]);_0x17f517['where']=qs['filters'](_[_0x1fd2('0x39')](_0x459e18[_0x1fd2('0x2e')],_0xe62521[_0x1fd2('0x2f')]));if(_0x459e18[_0x1fd2('0x2e')][_0x1fd2('0x3c')]){_0x17f517[_0x1fd2('0x38')]=_['merge'](_0x17f517[_0x1fd2('0x38')],{'$or':_[_0x1fd2('0x29')](_0x17f517[_0x1fd2('0x32')],function(_0x5cb6ee){var _0x3254fb={};_0x3254fb[_0x5cb6ee]={'$like':'%'+_0x459e18[_0x1fd2('0x2e')][_0x1fd2('0x3c')]+'%'};return _0x3254fb;})});}_0x17f517=_[_0x1fd2('0x3a')]({},_0x17f517,_0x459e18[_0x1fd2('0x3d')]);return _0x229bf6[_0x1fd2('0x50')](_0x17f517);}})[_0x1fd2('0x20')](function(_0x1da88b){if(_0x1da88b){_0x3accfd=_0x1da88b[_0x1fd2('0x34')];if(!_0x459e18[_0x1fd2('0x2e')][_0x1fd2('0x35')]('nolimit')){_0x17f517[_0x1fd2('0x1a')]=qs[_0x1fd2('0x1a')](_0x459e18[_0x1fd2('0x2e')]['limit']);_0x17f517[_0x1fd2('0x18')]=qs[_0x1fd2('0x18')](_0x459e18[_0x1fd2('0x2e')]['offset']);}return _0x229bf6[_0x1fd2('0x50')](_0x17f517);}})[_0x1fd2('0x20')](function(_0x1d791b){if(_0x1d791b){return _0x1d791b?{'count':_0x3accfd,'rows':_0x1d791b}:null;}})[_0x1fd2('0x20')](respondWithResult(_0x53ee1b,null))['catch'](handleError(_0x53ee1b,null));};exports[_0x1fd2('0x52')]=function(_0x47dd7e,_0x13c265,_0x4536e4){var _0x58053c={};var _0x1ced1c={};var _0x159e78;var _0x208f3b;return db['Trigger'][_0x1fd2('0x51')]({'where':{'id':_0x47dd7e[_0x1fd2('0x42')]['id']}})['then'](handleEntityNotFound(_0x13c265,null))[_0x1fd2('0x20')](function(_0xe064be){if(_0xe064be){_0x159e78=_0xe064be;_0x1ced1c['model']=_[_0x1fd2('0x43')](db['Condition'][_0x1fd2('0x2b')]);_0x1ced1c[_0x1fd2('0x2e')]=_[_0x1fd2('0x43')](_0x47dd7e[_0x1fd2('0x2e')]);_0x1ced1c[_0x1fd2('0x2f')]=_[_0x1fd2('0x30')](_0x1ced1c[_0x1fd2('0x31')],_0x1ced1c[_0x1fd2('0x2e')]);_0x58053c['attributes']=_[_0x1fd2('0x30')](_0x1ced1c['model'],qs[_0x1fd2('0x33')](_0x47dd7e[_0x1fd2('0x2e')][_0x1fd2('0x33')]));_0x58053c[_0x1fd2('0x32')]=_0x58053c[_0x1fd2('0x32')][_0x1fd2('0x34')]?_0x58053c[_0x1fd2('0x32')]:_0x1ced1c[_0x1fd2('0x31')];_0x58053c['order']=qs[_0x1fd2('0x37')](_0x47dd7e[_0x1fd2('0x2e')][_0x1fd2('0x37')]);_0x58053c[_0x1fd2('0x38')]=qs[_0x1fd2('0x2f')](_['pick'](_0x47dd7e[_0x1fd2('0x2e')],_0x1ced1c[_0x1fd2('0x2f')]));if(_0x47dd7e['query'][_0x1fd2('0x3c')]){_0x58053c[_0x1fd2('0x38')]=_['merge'](_0x58053c[_0x1fd2('0x38')],{'$or':_['map'](_0x58053c[_0x1fd2('0x32')],function(_0x2b648d){var _0x4b39f0={};_0x4b39f0[_0x2b648d]={'$like':'%'+_0x47dd7e['query'][_0x1fd2('0x3c')]+'%'};return _0x4b39f0;})});}_0x58053c=_[_0x1fd2('0x3a')]({},_0x58053c,_0x47dd7e['options']);return _0x159e78[_0x1fd2('0x52')](_0x58053c);}})[_0x1fd2('0x20')](function(_0x28d084){if(_0x28d084){_0x208f3b=_0x28d084['length'];if(!_0x47dd7e['query'][_0x1fd2('0x35')](_0x1fd2('0x53'))){_0x58053c[_0x1fd2('0x1a')]=qs[_0x1fd2('0x1a')](_0x47dd7e['query']['limit']);_0x58053c[_0x1fd2('0x18')]=qs[_0x1fd2('0x18')](_0x47dd7e[_0x1fd2('0x2e')]['offset']);}return _0x159e78[_0x1fd2('0x52')](_0x58053c);}})['then'](function(_0x101dc8){if(_0x101dc8){return _0x101dc8?{'count':_0x208f3b,'rows':_0x101dc8}:null;}})[_0x1fd2('0x20')](respondWithResult(_0x13c265,null))[_0x1fd2('0x41')](handleError(_0x13c265,null));};exports[_0x1fd2('0x54')]=function(_0x583e11,_0x39e67b,_0x2dcb92){if(_0x583e11[_0x1fd2('0x45')]['id']){delete _0x583e11[_0x1fd2('0x45')]['id'];}return db['Trigger'][_0x1fd2('0x48')]({'where':{'id':_0x583e11[_0x1fd2('0x42')]['id']}})[_0x1fd2('0x20')](handleEntityNotFound(_0x39e67b,null))['then'](function(_0x17bf81){if(_0x17bf81){_0x583e11[_0x1fd2('0x45')]['TriggerId']=_0x17bf81['id'];return db[_0x1fd2('0x55')][_0x1fd2('0x44')](_0x583e11['body']);}})[_0x1fd2('0x20')](respondWithResult(_0x39e67b,null))[_0x1fd2('0x41')](handleError(_0x39e67b,null));};exports['getActions']=function(_0x1dc8df,_0x2f3991,_0x6483a7){var _0x39659b={};var _0x1d6929={};var _0x4d25b0;var _0x5d369a;return db[_0x1fd2('0x2a')][_0x1fd2('0x51')]({'where':{'id':_0x1dc8df[_0x1fd2('0x42')]['id']}})[_0x1fd2('0x20')](handleEntityNotFound(_0x2f3991,null))[_0x1fd2('0x20')](function(_0x20466f){if(_0x20466f){_0x4d25b0=_0x20466f;_0x1d6929[_0x1fd2('0x31')]=_[_0x1fd2('0x43')](db['Action']['rawAttributes']);_0x1d6929[_0x1fd2('0x2e')]=_[_0x1fd2('0x43')](_0x1dc8df[_0x1fd2('0x2e')]);_0x1d6929[_0x1fd2('0x2f')]=_[_0x1fd2('0x30')](_0x1d6929['model'],_0x1d6929[_0x1fd2('0x2e')]);_0x39659b[_0x1fd2('0x32')]=_[_0x1fd2('0x30')](_0x1d6929[_0x1fd2('0x31')],qs[_0x1fd2('0x33')](_0x1dc8df[_0x1fd2('0x2e')]['fields']));_0x39659b[_0x1fd2('0x32')]=_0x39659b[_0x1fd2('0x32')][_0x1fd2('0x34')]?_0x39659b[_0x1fd2('0x32')]:_0x1d6929[_0x1fd2('0x31')];_0x39659b[_0x1fd2('0x36')]=qs[_0x1fd2('0x37')](_0x1dc8df[_0x1fd2('0x2e')][_0x1fd2('0x37')]);_0x39659b[_0x1fd2('0x38')]=qs[_0x1fd2('0x2f')](_[_0x1fd2('0x39')](_0x1dc8df[_0x1fd2('0x2e')],_0x1d6929[_0x1fd2('0x2f')]));if(_0x1dc8df['query'][_0x1fd2('0x3c')]){_0x39659b[_0x1fd2('0x38')]=_[_0x1fd2('0x3a')](_0x39659b[_0x1fd2('0x38')],{'$or':_[_0x1fd2('0x29')](_0x39659b['attributes'],function(_0x296a54){var _0x37e603={};_0x37e603[_0x296a54]={'$like':'%'+_0x1dc8df[_0x1fd2('0x2e')][_0x1fd2('0x3c')]+'%'};return _0x37e603;})});}_0x39659b=_[_0x1fd2('0x3a')]({},_0x39659b,_0x1dc8df[_0x1fd2('0x3d')]);return _0x4d25b0['getActions'](_0x39659b);}})['then'](function(_0x290143){if(_0x290143){_0x5d369a=_0x290143[_0x1fd2('0x34')];if(!_0x1dc8df[_0x1fd2('0x2e')][_0x1fd2('0x35')](_0x1fd2('0x53'))){_0x39659b['limit']=qs[_0x1fd2('0x1a')](_0x1dc8df[_0x1fd2('0x2e')][_0x1fd2('0x1a')]);_0x39659b[_0x1fd2('0x18')]=qs[_0x1fd2('0x18')](_0x1dc8df[_0x1fd2('0x2e')][_0x1fd2('0x18')]);}return _0x4d25b0[_0x1fd2('0x56')](_0x39659b);}})[_0x1fd2('0x20')](function(_0x36fc50){if(_0x36fc50){return _0x36fc50?{'count':_0x5d369a,'rows':_0x36fc50}:null;}})[_0x1fd2('0x20')](respondWithResult(_0x2f3991,null))[_0x1fd2('0x41')](handleError(_0x2f3991,null));};
\ No newline at end of file
index 5cf1877..33049fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe644=['path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4947d7,_0x270f05){var _0x4b6e94=function(_0x469ae4){while(--_0x469ae4){_0x4947d7['push'](_0x4947d7['shift']());}};_0x4b6e94(++_0x270f05);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var logger=require(_0x4e64('0x2'))(_0x4e64('0x3'));var moment=require(_0x4e64('0x4'));var BPromise=require(_0x4e64('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e64('0x6'));var rimraf=require(_0x4e64('0x7'));var config=require(_0x4e64('0x8'));var attributes=require(_0x4e64('0x9'));module[_0x4e64('0xa')]=function(_0x13fa90,_0x55c23b){return _0x13fa90[_0x4e64('0xb')](_0x4e64('0xc'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7250=['rimraf','./trigger.attributes','Trigger','tools_triggers','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7250,0x1b1));var _0x0725=function(_0x4fc4fd,_0x1d2e99){_0x4fc4fd=_0x4fc4fd-0x0;var _0x370d13=_0x7250[_0x4fc4fd];return _0x370d13;};'use strict';var _=require(_0x0725('0x0'));var util=require(_0x0725('0x1'));var logger=require('../../config/logger')(_0x0725('0x2'));var moment=require(_0x0725('0x3'));var BPromise=require(_0x0725('0x4'));var rp=require(_0x0725('0x5'));var fs=require('fs');var path=require(_0x0725('0x6'));var rimraf=require(_0x0725('0x7'));var config=require('../../config/environment');var attributes=require(_0x0725('0x8'));module['exports']=function(_0x4e8c6c,_0xa32c3f){return _0x4e8c6c['define'](_0x0725('0x9'),attributes,{'tableName':_0x0725('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5f2a5e7..750a6e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc62d=['code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger','options','raw','where','limit','map','model','include','attributes','ShowTrigger','find','lodash','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x542eb7,_0x2bf879){var _0x478ab4=function(_0x1aec0d){while(--_0x1aec0d){_0x542eb7['push'](_0x542eb7['shift']());}};_0x478ab4(++_0x2bf879);}(_0xc62d,0xb6));var _0xdc62=function(_0x2af127,_0x358d69){_0x2af127=_0x2af127-0x0;var _0x1c4bcd=_0xc62d[_0x2af127];return _0x1c4bcd;};'use strict';var _=require(_0xdc62('0x0'));var util=require('util');var moment=require(_0xdc62('0x1'));var BPromise=require('bluebird');var rs=require(_0xdc62('0x2'));var fs=require('fs');var Redis=require(_0xdc62('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc62('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xdc62('0x5'));var jayson=require(_0xdc62('0x6'));var client=jayson[_0xdc62('0x7')][_0xdc62('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39df03,_0x426f60,_0x53894f){return new BPromise(function(_0x3df8ca,_0x19133c){return client['request'](_0x39df03,_0x53894f)[_0xdc62('0x9')](function(_0x3349e6){logger[_0xdc62('0xa')]('Trigger,\x20%s,\x20%s',_0x426f60,_0xdc62('0xb'));logger[_0xdc62('0xc')](_0xdc62('0xd'),_0x426f60,_0xdc62('0xb'),JSON[_0xdc62('0xe')](_0x3349e6));if(_0x3349e6[_0xdc62('0xf')]){if(_0x3349e6[_0xdc62('0xf')][_0xdc62('0x10')]===0x1f4){logger['error'](_0xdc62('0x11'),_0x426f60,_0x3349e6[_0xdc62('0xf')][_0xdc62('0x12')]);return _0x19133c(_0x3349e6[_0xdc62('0xf')]['message']);}logger[_0xdc62('0xf')]('Trigger,\x20%s,\x20%s',_0x426f60,_0x3349e6[_0xdc62('0xf')]['message']);return _0x3df8ca(_0x3349e6['error']['message']);}else{logger['info'](_0xdc62('0x11'),_0x426f60,_0xdc62('0xb'));_0x3df8ca(_0x3349e6[_0xdc62('0x13')][_0xdc62('0x12')]);}})[_0xdc62('0x14')](function(_0x571f97){logger['error'](_0xdc62('0x11'),_0x426f60,_0x571f97);_0x19133c(_0x571f97);});});}exports[_0xdc62('0x15')]=function(_0x3fe40d){var _0x8856c7=this;return new Promise(function(_0x3c86f2,_0x406603){return db[_0xdc62('0x16')]['findAll']({'raw':_0x3fe40d[_0xdc62('0x17')]?_0x3fe40d[_0xdc62('0x17')][_0xdc62('0x18')]===undefined?!![]:![]:!![],'where':_0x3fe40d[_0xdc62('0x17')]?_0x3fe40d[_0xdc62('0x17')][_0xdc62('0x19')]||null:null,'attributes':_0x3fe40d['options']?_0x3fe40d['options']['attributes']||null:null,'limit':_0x3fe40d['options']?_0x3fe40d[_0xdc62('0x17')][_0xdc62('0x1a')]||null:null,'include':_0x3fe40d[_0xdc62('0x17')]?_0x3fe40d[_0xdc62('0x17')]['include']?_[_0xdc62('0x1b')](_0x3fe40d[_0xdc62('0x17')]['include'],function(_0x104aac){return{'model':db[_0x104aac[_0xdc62('0x1c')]],'as':_0x104aac['as'],'attributes':_0x104aac['attributes'],'include':_0x104aac[_0xdc62('0x1d')]?_[_0xdc62('0x1b')](_0x104aac['include'],function(_0x1ad5a4){return{'model':db[_0x1ad5a4[_0xdc62('0x1c')]],'as':_0x1ad5a4['as'],'attributes':_0x1ad5a4[_0xdc62('0x1e')],'include':_0x1ad5a4['include']?_['map'](_0x1ad5a4[_0xdc62('0x1d')],function(_0x395310){return{'model':db[_0x395310[_0xdc62('0x1c')]],'as':_0x395310['as'],'attributes':_0x395310[_0xdc62('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21ec4f){logger[_0xdc62('0xa')](_0xdc62('0x15'),_0x3fe40d);logger[_0xdc62('0xc')](_0xdc62('0x15'),_0x3fe40d,JSON[_0xdc62('0xe')](_0x21ec4f));_0x3c86f2(_0x21ec4f);})[_0xdc62('0x14')](function(_0x595182){logger[_0xdc62('0xf')]('GetTrigger',_0x595182[_0xdc62('0x12')],_0x3fe40d);_0x406603(_0x8856c7['error'](0x1f4,_0x595182[_0xdc62('0x12')]));});});};exports[_0xdc62('0x1f')]=function(_0x6b1e9e){var _0x17d8e4=this;return new Promise(function(_0x3e237f,_0x48b3f1){return db['Trigger'][_0xdc62('0x20')]({'raw':_0x6b1e9e[_0xdc62('0x17')]?_0x6b1e9e[_0xdc62('0x17')][_0xdc62('0x18')]===undefined?!![]:![]:!![],'where':_0x6b1e9e[_0xdc62('0x17')]?_0x6b1e9e[_0xdc62('0x17')][_0xdc62('0x19')]||null:null,'attributes':_0x6b1e9e[_0xdc62('0x17')]?_0x6b1e9e[_0xdc62('0x17')]['attributes']||null:null,'include':_0x6b1e9e['options']?_0x6b1e9e[_0xdc62('0x17')][_0xdc62('0x1d')]?_[_0xdc62('0x1b')](_0x6b1e9e['options']['include'],function(_0x5f21ac){return{'model':db[_0x5f21ac['model']],'as':_0x5f21ac['as'],'attributes':_0x5f21ac[_0xdc62('0x1e')],'include':_0x5f21ac[_0xdc62('0x1d')]?_['map'](_0x5f21ac[_0xdc62('0x1d')],function(_0x20f78b){return{'model':db[_0x20f78b['model']],'as':_0x20f78b['as'],'attributes':_0x20f78b[_0xdc62('0x1e')],'include':_0x20f78b['include']?_['map'](_0x20f78b[_0xdc62('0x1d')],function(_0x338dbf){return{'model':db[_0x338dbf['model']],'as':_0x338dbf['as'],'attributes':_0x338dbf[_0xdc62('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdc62('0x9')](function(_0x499993){logger[_0xdc62('0xa')](_0xdc62('0x1f'),_0x6b1e9e);logger[_0xdc62('0xc')]('ShowTrigger',_0x6b1e9e,JSON[_0xdc62('0xe')](_0x499993));_0x3e237f(_0x499993);})[_0xdc62('0x14')](function(_0x5d7f3e){logger[_0xdc62('0xf')](_0xdc62('0x1f'),_0x5d7f3e[_0xdc62('0x12')],_0x6b1e9e);_0x48b3f1(_0x17d8e4['error'](0x1f4,_0x5d7f3e[_0xdc62('0x12')]));});});};
\ No newline at end of file
+var _0x1526=['findAll','raw','options','where','attributes','include','map','model','ShowTrigger','Trigger','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger'];(function(_0x19ef71,_0x3e8b00){var _0x35ee66=function(_0x49842b){while(--_0x49842b){_0x19ef71['push'](_0x19ef71['shift']());}};_0x35ee66(++_0x3e8b00);}(_0x1526,0x1f4));var _0x6152=function(_0x41570f,_0x50fbd8){_0x41570f=_0x41570f-0x0;var _0x19368d=_0x1526[_0x41570f];return _0x19368d;};'use strict';var _=require(_0x6152('0x0'));var util=require(_0x6152('0x1'));var moment=require(_0x6152('0x2'));var BPromise=require(_0x6152('0x3'));var rs=require(_0x6152('0x4'));var fs=require('fs');var Redis=require(_0x6152('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6152('0x6'));var logger=require(_0x6152('0x7'))(_0x6152('0x8'));var config=require(_0x6152('0x9'));var jayson=require(_0x6152('0xa'));var client=jayson['client'][_0x6152('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c404c,_0x403980,_0x47d618){return new BPromise(function(_0x324b79,_0x4f5f34){return client[_0x6152('0xc')](_0x2c404c,_0x47d618)[_0x6152('0xd')](function(_0x5cc962){logger[_0x6152('0xe')]('Trigger,\x20%s,\x20%s',_0x403980,_0x6152('0xf'));logger[_0x6152('0x10')]('Trigger,\x20%s,\x20%s,\x20%s',_0x403980,_0x6152('0xf'),JSON[_0x6152('0x11')](_0x5cc962));if(_0x5cc962[_0x6152('0x12')]){if(_0x5cc962['error'][_0x6152('0x13')]===0x1f4){logger['error'](_0x6152('0x14'),_0x403980,_0x5cc962[_0x6152('0x12')]['message']);return _0x4f5f34(_0x5cc962['error'][_0x6152('0x15')]);}logger[_0x6152('0x12')](_0x6152('0x14'),_0x403980,_0x5cc962[_0x6152('0x12')]['message']);return _0x324b79(_0x5cc962[_0x6152('0x12')][_0x6152('0x15')]);}else{logger['info'](_0x6152('0x14'),_0x403980,_0x6152('0xf'));_0x324b79(_0x5cc962[_0x6152('0x16')][_0x6152('0x15')]);}})[_0x6152('0x17')](function(_0x79824a){logger[_0x6152('0x12')](_0x6152('0x14'),_0x403980,_0x79824a);_0x4f5f34(_0x79824a);});});}exports[_0x6152('0x18')]=function(_0x540a0b){var _0x2a2807=this;return new Promise(function(_0x16baed,_0x2c0c4b){return db['Trigger'][_0x6152('0x19')]({'raw':_0x540a0b['options']?_0x540a0b['options'][_0x6152('0x1a')]===undefined?!![]:![]:!![],'where':_0x540a0b['options']?_0x540a0b[_0x6152('0x1b')][_0x6152('0x1c')]||null:null,'attributes':_0x540a0b[_0x6152('0x1b')]?_0x540a0b[_0x6152('0x1b')][_0x6152('0x1d')]||null:null,'limit':_0x540a0b['options']?_0x540a0b[_0x6152('0x1b')]['limit']||null:null,'include':_0x540a0b[_0x6152('0x1b')]?_0x540a0b[_0x6152('0x1b')][_0x6152('0x1e')]?_[_0x6152('0x1f')](_0x540a0b[_0x6152('0x1b')]['include'],function(_0x574538){return{'model':db[_0x574538['model']],'as':_0x574538['as'],'attributes':_0x574538['attributes'],'include':_0x574538['include']?_[_0x6152('0x1f')](_0x574538['include'],function(_0x1ed12a){return{'model':db[_0x1ed12a[_0x6152('0x20')]],'as':_0x1ed12a['as'],'attributes':_0x1ed12a[_0x6152('0x1d')],'include':_0x1ed12a['include']?_[_0x6152('0x1f')](_0x1ed12a[_0x6152('0x1e')],function(_0x1cd7cd){return{'model':db[_0x1cd7cd['model']],'as':_0x1cd7cd['as'],'attributes':_0x1cd7cd[_0x6152('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6152('0xd')](function(_0x5f547d){logger[_0x6152('0xe')]('GetTrigger',_0x540a0b);logger[_0x6152('0x10')]('GetTrigger',_0x540a0b,JSON[_0x6152('0x11')](_0x5f547d));_0x16baed(_0x5f547d);})[_0x6152('0x17')](function(_0x21ab92){logger[_0x6152('0x12')](_0x6152('0x18'),_0x21ab92['message'],_0x540a0b);_0x2c0c4b(_0x2a2807[_0x6152('0x12')](0x1f4,_0x21ab92['message']));});});};exports[_0x6152('0x21')]=function(_0x1262d3){var _0x26678f=this;return new Promise(function(_0x207af5,_0x57f8b9){return db[_0x6152('0x22')]['find']({'raw':_0x1262d3['options']?_0x1262d3[_0x6152('0x1b')][_0x6152('0x1a')]===undefined?!![]:![]:!![],'where':_0x1262d3[_0x6152('0x1b')]?_0x1262d3[_0x6152('0x1b')][_0x6152('0x1c')]||null:null,'attributes':_0x1262d3[_0x6152('0x1b')]?_0x1262d3[_0x6152('0x1b')]['attributes']||null:null,'include':_0x1262d3[_0x6152('0x1b')]?_0x1262d3[_0x6152('0x1b')][_0x6152('0x1e')]?_['map'](_0x1262d3[_0x6152('0x1b')][_0x6152('0x1e')],function(_0x47f5a3){return{'model':db[_0x47f5a3[_0x6152('0x20')]],'as':_0x47f5a3['as'],'attributes':_0x47f5a3[_0x6152('0x1d')],'include':_0x47f5a3[_0x6152('0x1e')]?_[_0x6152('0x1f')](_0x47f5a3[_0x6152('0x1e')],function(_0x41629e){return{'model':db[_0x41629e[_0x6152('0x20')]],'as':_0x41629e['as'],'attributes':_0x41629e[_0x6152('0x1d')],'include':_0x41629e[_0x6152('0x1e')]?_[_0x6152('0x1f')](_0x41629e['include'],function(_0x4f60d0){return{'model':db[_0x4f60d0[_0x6152('0x20')]],'as':_0x4f60d0['as'],'attributes':_0x4f60d0[_0x6152('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ab8e0){logger['info']('ShowTrigger',_0x1262d3);logger[_0x6152('0x10')]('ShowTrigger',_0x1262d3,JSON[_0x6152('0x11')](_0x4ab8e0));_0x207af5(_0x4ab8e0);})[_0x6152('0x17')](function(_0xa7bca){logger['error'](_0x6152('0x21'),_0xa7bca[_0x6152('0x15')],_0x1262d3);_0x57f8b9(_0x26678f[_0x6152('0x12')](0x1f4,_0xa7bca[_0x6152('0x15')]));});});};
\ No newline at end of file
index f06a560..2201f12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61d3=['fs-extra','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone','clone','create','put','update','delete','exports','multer','util','path','express','Router'];(function(_0x11dd76,_0x45fa7c){var _0x43efc2=function(_0x41157f){while(--_0x41157f){_0x11dd76['push'](_0x11dd76['shift']());}};_0x43efc2(++_0x45fa7c);}(_0x61d3,0x13b));var _0x361d=function(_0xef8b9c,_0x1a4667){_0xef8b9c=_0xef8b9c-0x0;var _0x538186=_0x61d3[_0xef8b9c];return _0x538186;};'use strict';var multer=require(_0x361d('0x0'));var util=require(_0x361d('0x1'));var path=require(_0x361d('0x2'));var timeout=require('connect-timeout');var express=require(_0x361d('0x3'));var router=express[_0x361d('0x4')]();var fs_extra=require(_0x361d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x361d('0x6'));router[_0x361d('0x7')]('/',auth[_0x361d('0x8')](),controller[_0x361d('0x9')]);router[_0x361d('0x7')](_0x361d('0xa'),auth[_0x361d('0x8')](),controller[_0x361d('0xb')]);router[_0x361d('0xc')](_0x361d('0xd'),auth['isAuthenticated'](),controller[_0x361d('0xe')]);router[_0x361d('0xc')]('/',auth[_0x361d('0x8')](),controller[_0x361d('0xf')]);router[_0x361d('0x10')](_0x361d('0xa'),auth['isAuthenticated'](),controller[_0x361d('0x11')]);router[_0x361d('0x12')](_0x361d('0xa'),auth[_0x361d('0x8')](),controller['destroy']);module[_0x361d('0x13')]=router;
\ No newline at end of file
+var _0x3037=['/:id','show','clone','create','put','destroy','exports','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x876008,_0x233898){var _0x44dae1=function(_0x5ed149){while(--_0x5ed149){_0x876008['push'](_0x876008['shift']());}};_0x44dae1(++_0x233898);}(_0x3037,0x1c7));var _0x7303=function(_0x480b48,_0x1a6a26){_0x480b48=_0x480b48-0x0;var _0x309ed7=_0x3037[_0x480b48];return _0x309ed7;};'use strict';var multer=require(_0x7303('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7303('0x1'));var router=express[_0x7303('0x2')]();var fs_extra=require(_0x7303('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7303('0x4'));var config=require(_0x7303('0x5'));var controller=require('./trunk.controller');router[_0x7303('0x6')]('/',auth[_0x7303('0x7')](),controller[_0x7303('0x8')]);router[_0x7303('0x6')](_0x7303('0x9'),auth[_0x7303('0x7')](),controller[_0x7303('0xa')]);router['post']('/:id/clone',auth[_0x7303('0x7')](),controller[_0x7303('0xb')]);router['post']('/',auth[_0x7303('0x7')](),controller[_0x7303('0xc')]);router[_0x7303('0xd')]('/:id',auth[_0x7303('0x7')](),controller['update']);router['delete'](_0x7303('0x9'),auth['isAuthenticated'](),controller[_0x7303('0xe')]);module[_0x7303('0xf')]=router;
\ No newline at end of file
index b96e665..6652e01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf654=['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','info','shortinfo','auto','yes','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','uac','uas','fingerprint','active','actpass','dynamic','update','update,nonat','BOOLEAN','sequelize','STRING','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf654,0x1af));var _0x4f65=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf654[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x4f65('0x0'));module['exports']={'name':{'type':Sequelize[_0x4f65('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4f65('0x2')](_0x4f65('0x3'),_0x4f65('0x4'),_0x4f65('0x5')),'allowNull':![],'defaultValue':_0x4f65('0x3')},'context':{'type':Sequelize[_0x4f65('0x1')],'allowNull':![],'defaultValue':_0x4f65('0x6')},'callingpres':{'type':Sequelize[_0x4f65('0x2')](_0x4f65('0x7'),_0x4f65('0x8'),_0x4f65('0x9'),_0x4f65('0xa'),'PROHIB_NOT_SCREENED',_0x4f65('0xb'),_0x4f65('0xc'),_0x4f65('0xd'))},'deny':{'type':Sequelize[_0x4f65('0x1')]},'permit':{'type':Sequelize[_0x4f65('0x1')]},'secret':{'type':Sequelize[_0x4f65('0x1')]},'md5secret':{'type':Sequelize[_0x4f65('0x1')]},'remotesecret':{'type':Sequelize[_0x4f65('0x1')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x4f65('0xe'),'set':function(_0x2930fc){this[_0x4f65('0xf')](_0x4f65('0x10'),_0x2930fc?_0x2930fc[_0x4f65('0x11')](','):null);},'get':function(){return this[_0x4f65('0x12')](_0x4f65('0x10'))?this[_0x4f65('0x12')]('transport')[_0x4f65('0x13')](','):null;},'comment':_0x4f65('0x14')},'dtmfmode':{'type':Sequelize[_0x4f65('0x2')](_0x4f65('0x15'),_0x4f65('0x16'),_0x4f65('0x17'),'inband',_0x4f65('0x18')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x4f65('0x19'),'no','nonat','update',_0x4f65('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4f65('0x2')](_0x4f65('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4f65('0x1')]},'directmediadeny':{'type':Sequelize[_0x4f65('0x1')]},'nat':{'type':Sequelize[_0x4f65('0x1')],'defaultValue':_0x4f65('0x1b'),'set':function(_0x1ca4d8){this[_0x4f65('0xf')]('nat',_0x1ca4d8?_0x1ca4d8['join'](','):null);},'get':function(){return this[_0x4f65('0x12')](_0x4f65('0x1c'))?this[_0x4f65('0x12')](_0x4f65('0x1c'))[_0x4f65('0x13')](','):null;},'comment':_0x4f65('0x1d')},'callgroup':{'type':Sequelize[_0x4f65('0x1')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x4f65('0x1')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4f65('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0x4f65('0x1')],'allowNull':![],'defaultValue':_0x4f65('0x1e'),'set':function(_0xb5034b){this['setDataValue'](_0x4f65('0x1f'),_0xb5034b?_0xb5034b[_0x4f65('0x11')](';'):_0x4f65('0x1e'));},'get':function(){return this[_0x4f65('0x12')](_0x4f65('0x1f'))?this['getDataValue'](_0x4f65('0x1f'))[_0x4f65('0x13')](';'):null;},'comment':_0x4f65('0x20')},'autoframing':{'type':Sequelize[_0x4f65('0x2')](_0x4f65('0x19'),'no')},'insecure':{'type':Sequelize[_0x4f65('0x1')],'defaultValue':_0x4f65('0x21'),'set':function(_0xd19030){this[_0x4f65('0xf')](_0x4f65('0x22'),_0xd19030?_0xd19030[_0x4f65('0x11')](','):null);},'get':function(){return this[_0x4f65('0x12')](_0x4f65('0x22'))?this[_0x4f65('0x12')](_0x4f65('0x22'))[_0x4f65('0x13')](','):null;},'comment':_0x4f65('0x23')},'trustrpid':{'type':Sequelize['ENUM'](_0x4f65('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x4f65('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no','never')},'promiscredir':{'type':Sequelize[_0x4f65('0x2')](_0x4f65('0x19'),'no')},'useclientcode':{'type':Sequelize[_0x4f65('0x2')](_0x4f65('0x19'),'no')},'accountcode':{'type':Sequelize[_0x4f65('0x24')](0xb)},'setvar':{'type':Sequelize[_0x4f65('0x1')]},'callerid':{'type':Sequelize[_0x4f65('0x1')],'defaultValue':_0x4f65('0x25')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x4f65('0x2')](_0x4f65('0x19'),'no'),'defaultValue':_0x4f65('0x19')},'busylevel':{'type':Sequelize[_0x4f65('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x4f65('0x2')](_0x4f65('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0x4f65('0x2')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x4f65('0x2')]('yes','no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x4f65('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0x4f65('0x1')]},'template':{'type':Sequelize[_0x4f65('0x1')]},'videosupport':{'type':Sequelize[_0x4f65('0x2')](_0x4f65('0x19'),'no',_0x4f65('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x4f65('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x4f65('0x19'),'no')},'mailbox':{'type':Sequelize[_0x4f65('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0x4f65('0x27'),'refuse','originate')},'session_expires':{'type':Sequelize[_0x4f65('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x4f65('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x4f65('0x2')](_0x4f65('0x28'),'uas'),'defaultValue':_0x4f65('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x4f65('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x4f65('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x4f65('0x2')](_0x4f65('0x19'),'no'),'defaultValue':_0x4f65('0x19')},'keepalive':{'type':Sequelize[_0x4f65('0x24')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x4f65('0x2')](_0x4f65('0x19'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4f65('0x1')]},'callbackextension':{'type':Sequelize[_0x4f65('0x1')]},'timert1':{'type':Sequelize[_0x4f65('0x24')](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize[_0x4f65('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x4f65('0x1')]},'contactdeny':{'type':Sequelize[_0x4f65('0x1')]},'contactacl':{'type':Sequelize[_0x4f65('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x4f65('0x1')]},'use_q850_reason':{'type':Sequelize[_0x4f65('0x1')]},'maxforwards':{'type':Sequelize[_0x4f65('0x24')](0xb)},'encryption':{'type':Sequelize[_0x4f65('0x2')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x4f65('0x2')](_0x4f65('0x19'),'no')},'force_avp':{'type':Sequelize[_0x4f65('0x2')](_0x4f65('0x19'),'no')},'icesupport':{'type':Sequelize[_0x4f65('0x2')](_0x4f65('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0x4f65('0x2')](_0x4f65('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0x4f65('0x2')]('yes','no',_0x4f65('0x2a'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x4f65('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x4f65('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x4f65('0x1')]},'dtlscafile':{'type':Sequelize[_0x4f65('0x1')]},'dtlscapath':{'type':Sequelize[_0x4f65('0x1')]},'dtlssetup':{'type':Sequelize[_0x4f65('0x2')](_0x4f65('0x2b'),'passive',_0x4f65('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x4f65('0x1')]},'usereqphone':{'type':Sequelize[_0x4f65('0x2')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4f65('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x4f65('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x4f65('0x2')](_0x4f65('0x19'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x4f65('0x19'),'no')},'vmexten':{'type':Sequelize[_0x4f65('0x1')]},'mohinterpret':{'type':Sequelize[_0x4f65('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x4f65('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0x4f65('0x2d')},'canreinvite':{'type':Sequelize[_0x4f65('0x2')]('yes','no','nonat',_0x4f65('0x2e'),_0x4f65('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x4f65('0x1')]},'active':{'type':Sequelize[_0x4f65('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x4f65('0x1')],'defaultValue':'no'}};
\ No newline at end of file
+var _0xad0e=['user','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','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','info','inband','nonat','update','outgoing','yes','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','originate','uas','pai','active','passive','update,nonat','BOOLEAN','exports','STRING','name','friend'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xad0e,0xb4));var _0xead0=function(_0x44d9b3,_0x1db5fd){_0x44d9b3=_0x44d9b3-0x0;var _0x138d75=_0xad0e[_0x44d9b3];return _0x138d75;};'use strict';var Sequelize=require('sequelize');module[_0xead0('0x0')]={'name':{'type':Sequelize[_0xead0('0x1')],'allowNull':![],'unique':_0xead0('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xead0('0x3'),_0xead0('0x4'),'peer'),'allowNull':![],'defaultValue':_0xead0('0x3')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xead0('0x5')},'callingpres':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x7'),'ALLOWED_PASSED_SCREEN',_0xead0('0x8'),'ALLOWED',_0xead0('0x9'),'PROHIB_PASSED_SCREEN',_0xead0('0xa'),_0xead0('0xb'))},'deny':{'type':Sequelize[_0xead0('0x1')]},'permit':{'type':Sequelize[_0xead0('0x1')]},'secret':{'type':Sequelize[_0xead0('0x1')]},'md5secret':{'type':Sequelize[_0xead0('0x1')]},'remotesecret':{'type':Sequelize[_0xead0('0x1')]},'transport':{'type':Sequelize[_0xead0('0x1')],'defaultValue':_0xead0('0xc'),'set':function(_0x102ed9){this[_0xead0('0xd')](_0xead0('0xe'),_0x102ed9?_0x102ed9[_0xead0('0xf')](','):null);},'get':function(){return this[_0xead0('0x10')]('transport')?this['getDataValue']('transport')[_0xead0('0x11')](','):null;},'comment':_0xead0('0x12')},'dtmfmode':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x13'),_0xead0('0x14'),'shortinfo',_0xead0('0x15'),'auto'),'defaultValue':_0xead0('0x13')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0xead0('0x16'),_0xead0('0x17'),_0xead0('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xead0('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xead0('0x1')]},'directmediadeny':{'type':Sequelize[_0xead0('0x1')]},'nat':{'type':Sequelize['STRING'],'defaultValue':'force_rport,comedia','set':function(_0x4e848d){this[_0xead0('0xd')](_0xead0('0x1a'),_0x4e848d?_0x4e848d[_0xead0('0xf')](','):null);},'get':function(){return this[_0xead0('0x10')](_0xead0('0x1a'))?this[_0xead0('0x10')]('nat')['split'](','):null;},'comment':_0xead0('0x1b')},'callgroup':{'type':Sequelize[_0xead0('0x1')]},'namedcallgroup':{'type':Sequelize[_0xead0('0x1')]},'pickupgroup':{'type':Sequelize[_0xead0('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xead0('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xead0('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xead0('0x1')],'defaultValue':'all'},'allow':{'type':Sequelize[_0xead0('0x1')],'allowNull':![],'defaultValue':_0xead0('0x1c'),'set':function(_0xfe199d){this[_0xead0('0xd')]('allow',_0xfe199d?_0xfe199d['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xead0('0x10')](_0xead0('0x1d'))?this[_0xead0('0x10')](_0xead0('0x1d'))['split'](';'):null;},'comment':_0xead0('0x1e')},'autoframing':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x19'),'no')},'insecure':{'type':Sequelize[_0xead0('0x1')],'defaultValue':_0xead0('0x1f'),'set':function(_0x2ec9ff){this[_0xead0('0xd')]('insecure',_0x2ec9ff?_0x2ec9ff['join'](','):null);},'get':function(){return this[_0xead0('0x10')](_0xead0('0x20'))?this['getDataValue'](_0xead0('0x20'))[_0xead0('0x11')](','):null;},'comment':_0xead0('0x21')},'trustrpid':{'type':Sequelize['ENUM'](_0xead0('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x19'),'no',_0xead0('0x22'))},'promiscredir':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x19'),'no')},'useclientcode':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x19'),'no')},'accountcode':{'type':Sequelize[_0xead0('0x23')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xead0('0x1')],'defaultValue':_0xead0('0x24')},'amaflags':{'type':Sequelize[_0xead0('0x1')]},'callcounter':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x19'),'no'),'defaultValue':_0xead0('0x19')},'busylevel':{'type':Sequelize[_0xead0('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0xead0('0x6')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x19'),'no')},'subscribecontext':{'type':Sequelize[_0xead0('0x1')]},'template':{'type':Sequelize[_0xead0('0x1')]},'videosupport':{'type':Sequelize[_0xead0('0x6')]('yes','no',_0xead0('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xead0('0x19'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x26'),'refuse',_0xead0('0x27'))},'session_expires':{'type':Sequelize[_0xead0('0x23')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xead0('0x6')]('uac',_0xead0('0x28')),'defaultValue':_0xead0('0x28')},'t38pt_usertpsource':{'type':Sequelize[_0xead0('0x1')]},'regexten':{'type':Sequelize[_0xead0('0x1')]},'fromdomain':{'type':Sequelize[_0xead0('0x1')]},'fromuser':{'type':Sequelize[_0xead0('0x1')]},'port':{'type':Sequelize[_0xead0('0x23')](0x5)},'qualify':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x19'),'no'),'defaultValue':_0xead0('0x19')},'keepalive':{'type':Sequelize[_0xead0('0x23')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xead0('0x1')]},'rtptimeout':{'type':Sequelize[_0xead0('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xead0('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xead0('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x19'),'no',_0xead0('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xead0('0x1')]},'callbackextension':{'type':Sequelize[_0xead0('0x1')]},'timert1':{'type':Sequelize[_0xead0('0x23')](0xb)},'timerb':{'type':Sequelize[_0xead0('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0xead0('0x23')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xead0('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xead0('0x1')]},'use_q850_reason':{'type':Sequelize[_0xead0('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x19'),'no')},'force_avp':{'type':Sequelize[_0xead0('0x6')]('yes','no')},'icesupport':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x19'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize[_0xead0('0x23')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xead0('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0xead0('0x1')]},'dtlssetup':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x2a'),_0xead0('0x2b'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xead0('0x1')]},'usereqphone':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xead0('0x1')]},'recordofffeature':{'type':Sequelize[_0xead0('0x1')]},'call_limit':{'type':Sequelize[_0xead0('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0xead0('0x6')](_0xead0('0x19'),'no')},'vmexten':{'type':Sequelize[_0xead0('0x1')]},'mohinterpret':{'type':Sequelize[_0xead0('0x1')]},'mohsuggest':{'type':Sequelize[_0xead0('0x1')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xead0('0x1')]},'host':{'type':Sequelize[_0xead0('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xead0('0x6')]('yes','no',_0xead0('0x16'),'update',_0xead0('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xead0('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xead0('0x1')],'defaultValue':'no'}};
\ No newline at end of file
index 12dbfa8..b6eb5ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['update','destroy','get','Trunks','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','Trunk','findAll','show','params','includeAll','include','options','clone','find','omit','createdAt','updatedAt','body','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','utf8','server/files/templates/registry.ejs','render','/etc/asterisk/sip_xcally_trunks.conf','registry','writeFileSync','Reload','chan_sip.so','server/files/templates/trunk.ejs','join','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','Trunk,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save'];(function(_0x37a3f3,_0x663b49){var _0x4da923=function(_0x47713f){while(--_0x47713f){_0x37a3f3['push'](_0x37a3f3['shift']());}};_0x4da923(++_0x663b49);}(_0x008c,0x188));var _0xc008=function(_0x1c72b8,_0x104b7e){_0x1c72b8=_0x1c72b8-0x0;var _0x191114=_0x008c[_0x1c72b8];return _0x191114;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];var jayson=require(_0xc008('0x18'));var client=jayson[_0xc008('0x19')][_0xc008('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x593f7a,_0x560e28,_0x33f44c,_0x50c1ab){return new BPromise(function(_0x25e13f,_0x4584e1){var _0x2073ef=_0x50c1ab||client;return _0x2073ef[_0xc008('0x1b')](_0x593f7a,_0x33f44c)[_0xc008('0x1c')](function(_0x5ee00b){logger['info']('Trunk,\x20%s,\x20%s',_0x560e28,_0xc008('0x1d'));logger[_0xc008('0x1e')](_0xc008('0x1f'),_0x560e28,_0xc008('0x1d'),JSON['stringify'](_0x5ee00b));if(_0x5ee00b['error']){if(_0x5ee00b['error']['code']===0x1f4){logger[_0xc008('0x20')](_0xc008('0x21'),_0x560e28,_0x5ee00b['error'][_0xc008('0x22')]);return _0x4584e1(_0x5ee00b['error']['message']);}logger['error']('Trunk,\x20%s,\x20%s',_0x560e28,_0x5ee00b[_0xc008('0x20')]['message']);return _0x25e13f(_0x5ee00b['error']['message']);}else{logger['info']('Trunk,\x20%s,\x20%s',_0x560e28,_0xc008('0x1d'));_0x25e13f(_0x5ee00b[_0xc008('0x23')][_0xc008('0x22')]);}})[_0xc008('0x24')](function(_0x11cc75){logger[_0xc008('0x20')]('Trunk,\x20%s,\x20%s',_0x560e28,_0x11cc75);_0x4584e1(_0x11cc75);});});}function respondWithStatusCode(_0x459fd9,_0x5c85f2){_0x5c85f2=_0x5c85f2||0xcc;return function(_0x58a6ea){if(_0x58a6ea){return _0x459fd9[_0xc008('0x25')](_0x5c85f2);}return _0x459fd9[_0xc008('0x26')](_0x5c85f2)[_0xc008('0x27')]();};}function respondWithResult(_0x3cb28c,_0x5410f5){_0x5410f5=_0x5410f5||0xc8;return function(_0x48582b){if(_0x48582b){return _0x3cb28c['status'](_0x5410f5)[_0xc008('0x28')](_0x48582b);}};}function respondWithFilteredResult(_0x15dade,_0x92c582){return function(_0x2e31c2){if(_0x2e31c2){var _0x5bebd9=typeof _0x92c582['offset']==='undefined'&&typeof _0x92c582['limit']==='undefined';var _0x3865c0=_0x2e31c2[_0xc008('0x29')];var _0x25eae4=_0x5bebd9?0x0:_0x92c582['offset'];var _0x24c14c=_0x5bebd9?_0x2e31c2[_0xc008('0x29')]:_0x92c582[_0xc008('0x2a')]+_0x92c582[_0xc008('0x2b')];var _0x4c5dec;if(_0x24c14c>=_0x3865c0){_0x24c14c=_0x3865c0;_0x4c5dec=0xc8;}else{_0x4c5dec=0xce;}_0x15dade[_0xc008('0x26')](_0x4c5dec);return _0x15dade[_0xc008('0x2c')]('Content-Range',_0x25eae4+'-'+_0x24c14c+'/'+_0x3865c0)['json'](_0x2e31c2);}return null;};}function patchUpdates(_0x539766){return function(_0x1032b2){try{jsonpatch[_0xc008('0x2d')](_0x1032b2,_0x539766,!![]);}catch(_0xf831f2){return BPromise[_0xc008('0x2e')](_0xf831f2);}return _0x1032b2[_0xc008('0x2f')]();};}function saveUpdates(_0xceebc3,_0x294f97){return function(_0x22d8e8){if(_0x22d8e8){return _0x22d8e8[_0xc008('0x30')](_0xceebc3)[_0xc008('0x1c')](function(_0x2f4b6b){return _0x2f4b6b;});}return null;};}function removeEntity(_0x1ac7c8,_0x596ee8){return function(_0x334a09){if(_0x334a09){return _0x334a09[_0xc008('0x31')]()['then'](function(){var _0xaf4b84=_0x334a09[_0xc008('0x32')]({'plain':!![]});var _0x383be7=_0xc008('0x33');return db[_0xc008('0x34')][_0xc008('0x31')]({'where':{'type':_0x383be7,'resourceId':_0xaf4b84['id']}})[_0xc008('0x1c')](function(){return _0x334a09;});})[_0xc008('0x1c')](function(){_0x1ac7c8[_0xc008('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x415b87,_0x389a40){return function(_0x459df4){if(!_0x459df4){_0x415b87[_0xc008('0x25')](0x194);}return _0x459df4;};}function handleError(_0x40002f,_0x315562){_0x315562=_0x315562||0x1f4;return function(_0x1667a0){logger['error'](_0x1667a0[_0xc008('0x35')]);if(_0x1667a0[_0xc008('0x36')]){delete _0x1667a0['name'];}_0x40002f[_0xc008('0x26')](_0x315562)[_0xc008('0x37')](_0x1667a0);};}exports['index']=function(_0x263473,_0x2e4ae1){var _0x280e9b={},_0x55ff48={},_0x53b353={'count':0x0,'rows':[]};var _0x478810=_[_0xc008('0x38')](db['Trunk'][_0xc008('0x39')],function(_0x3884dd){return{'name':_0x3884dd[_0xc008('0x3a')],'type':_0x3884dd[_0xc008('0x3b')][_0xc008('0x3c')]};});_0x55ff48[_0xc008('0x3d')]=_[_0xc008('0x38')](_0x478810,_0xc008('0x36'));_0x55ff48[_0xc008('0x3e')]=_[_0xc008('0x3f')](_0x263473[_0xc008('0x3e')]);_0x55ff48[_0xc008('0x40')]=_[_0xc008('0x41')](_0x55ff48[_0xc008('0x3d')],_0x55ff48['query']);_0x280e9b[_0xc008('0x42')]=_[_0xc008('0x41')](_0x55ff48[_0xc008('0x3d')],qs[_0xc008('0x43')](_0x263473['query'][_0xc008('0x43')]));_0x280e9b[_0xc008('0x42')]=_0x280e9b[_0xc008('0x42')][_0xc008('0x44')]?_0x280e9b[_0xc008('0x42')]:_0x55ff48['model'];if(!_0x263473[_0xc008('0x3e')][_0xc008('0x45')](_0xc008('0x46'))){_0x280e9b[_0xc008('0x2b')]=qs[_0xc008('0x2b')](_0x263473['query'][_0xc008('0x2b')]);_0x280e9b[_0xc008('0x2a')]=qs[_0xc008('0x2a')](_0x263473[_0xc008('0x3e')]['offset']);}_0x280e9b[_0xc008('0x47')]=qs[_0xc008('0x48')](_0x263473[_0xc008('0x3e')]['sort']);_0x280e9b[_0xc008('0x49')]=qs['filters'](_[_0xc008('0x4a')](_0x263473['query'],_0x55ff48[_0xc008('0x40')]),_0x478810);if(_0x263473[_0xc008('0x3e')]['filter']){_0x280e9b[_0xc008('0x49')]=_[_0xc008('0x4b')](_0x280e9b[_0xc008('0x49')],{'$or':_['map'](_0x478810,function(_0x1cec64){if(_0x1cec64[_0xc008('0x3b')]!==_0xc008('0x4c')){var _0x44fc5d={};_0x44fc5d[_0x1cec64[_0xc008('0x36')]]={'$like':'%'+_0x263473[_0xc008('0x3e')]['filter']+'%'};return _0x44fc5d;}})});}_0x280e9b=_['merge']({},_0x280e9b,_0x263473['options']);var _0x4552ed={'where':_0x280e9b[_0xc008('0x49')]};return db[_0xc008('0x4d')][_0xc008('0x29')](_0x4552ed)[_0xc008('0x1c')](function(_0x24f6a4){_0x53b353[_0xc008('0x29')]=_0x24f6a4;if(_0x263473[_0xc008('0x3e')]['includeAll']){_0x280e9b['include']=[{'all':!![]}];}return db['Trunk'][_0xc008('0x4e')](_0x280e9b);})[_0xc008('0x1c')](function(_0x158eae){_0x53b353['rows']=_0x158eae;return _0x53b353;})[_0xc008('0x1c')](respondWithFilteredResult(_0x2e4ae1,_0x280e9b))[_0xc008('0x24')](handleError(_0x2e4ae1,null));};exports[_0xc008('0x4f')]=function(_0x1c2c50,_0x4981b4){var _0x56e4ac={'raw':![],'where':{'id':_0x1c2c50[_0xc008('0x50')]['id']}},_0x17ec90={};_0x17ec90[_0xc008('0x3d')]=_[_0xc008('0x3f')](db['Trunk']['rawAttributes']);_0x17ec90[_0xc008('0x3e')]=_['keys'](_0x1c2c50[_0xc008('0x3e')]);_0x17ec90[_0xc008('0x40')]=_[_0xc008('0x41')](_0x17ec90['model'],_0x17ec90[_0xc008('0x3e')]);_0x56e4ac[_0xc008('0x42')]=_[_0xc008('0x41')](_0x17ec90[_0xc008('0x3d')],qs[_0xc008('0x43')](_0x1c2c50['query'][_0xc008('0x43')]));_0x56e4ac[_0xc008('0x42')]=_0x56e4ac['attributes'][_0xc008('0x44')]?_0x56e4ac[_0xc008('0x42')]:_0x17ec90['model'];if(_0x1c2c50['query'][_0xc008('0x51')]){_0x56e4ac[_0xc008('0x52')]=[{'all':!![]}];}_0x56e4ac=_[_0xc008('0x4b')]({},_0x56e4ac,_0x1c2c50[_0xc008('0x53')]);return db[_0xc008('0x4d')]['find'](_0x56e4ac)['then'](handleEntityNotFound(_0x4981b4,null))[_0xc008('0x1c')](respondWithResult(_0x4981b4,null))['catch'](handleError(_0x4981b4,null));};exports[_0xc008('0x54')]=function(_0x25d351,_0xf94fcb){var _0x2f1105={'where':{'id':_0x25d351[_0xc008('0x50')]['id']}},_0x44f42d={};_0x44f42d['model']=_[_0xc008('0x3f')](db[_0xc008('0x4d')][_0xc008('0x39')]);_0x2f1105[_0xc008('0x42')]=_[_0xc008('0x41')](_0x44f42d['model'],qs[_0xc008('0x43')](_0x25d351['query']['fields']));_0x2f1105['attributes']=_0x2f1105[_0xc008('0x42')][_0xc008('0x44')]?_0x2f1105[_0xc008('0x42')]:_0x44f42d['model'];if(_0x25d351[_0xc008('0x3e')][_0xc008('0x51')]){_0x2f1105[_0xc008('0x52')]=[{'all':!![]}];}_0x2f1105=_['merge']({},_0x2f1105,_0x25d351[_0xc008('0x53')]);return db[_0xc008('0x4d')][_0xc008('0x55')](_0x2f1105)[_0xc008('0x1c')](handleEntityNotFound(_0xf94fcb,null))['then'](function(_0x4022dd){if(_0x4022dd){var _0x4eaa6d=_0x4022dd[_0xc008('0x32')]({'plain':!![]});_0x4eaa6d=qs[_0xc008('0x56')](_0x4eaa6d,['id',_0xc008('0x57'),_0xc008('0x58')]);_0x25d351[_0xc008('0x59')]=_[_0xc008('0x56')](_0x25d351['body'],['id',_0xc008('0x57'),'updatedAt']);return db['Trunk'][_0xc008('0x5a')](_[_0xc008('0x4b')](_0x4eaa6d,_0x25d351['body']),{'include':_0x25d351[_0xc008('0x3e')][_0xc008('0x51')]?[{'all':!![]}]:undefined})[_0xc008('0x1c')](function(_0x4517c0){var _0x21ee6d=_0x25d351[_0xc008('0x5b')][_0xc008('0x32')]({'plain':!![]});if(!_0x21ee6d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x21ee6d[_0xc008('0x5c')]===_0xc008('0x5b')){var _0x3bfb15=_0x4517c0[_0xc008('0x32')]({'plain':!![]});var _0xb3ca0f=_0xc008('0x33');return db[_0xc008('0x5d')][_0xc008('0x55')]({'where':{'name':_0xb3ca0f,'userProfileId':_0x21ee6d[_0xc008('0x5e')]},'raw':!![]})[_0xc008('0x1c')](function(_0x1bef66){if(_0x1bef66&&_0x1bef66[_0xc008('0x5f')]===0x0){return db[_0xc008('0x34')][_0xc008('0x5a')]({'name':_0x3bfb15['name'],'resourceId':_0x3bfb15['id'],'type':_0x1bef66[_0xc008('0x36')],'sectionId':_0x1bef66['id']},{})[_0xc008('0x1c')](function(){return _0x4517c0;});}else{return _0x4517c0;}})[_0xc008('0x24')](function(_0x566dea){logger[_0xc008('0x20')](_0xc008('0x60'),_0x566dea);throw _0x566dea;});}return _0x4517c0;});}})['then'](respondWithResult(_0xf94fcb,0xc9))['catch'](handleError(_0xf94fcb,null));};exports[_0xc008('0x5a')]=function(_0x2a4c2b,_0x7bad14,_0x39083c){var _0x1a2ce7;return db[_0xc008('0x4d')][_0xc008('0x5a')](_0x2a4c2b[_0xc008('0x59')],{'raw':!![]})[_0xc008('0x1c')](function(_0x1b059b){_0x1a2ce7=_0x1b059b;return db[_0xc008('0x4d')]['findAll']({'raw':!![]});})[_0xc008('0x1c')](function(_0x25a52b){var _0xfdb5e3=fs[_0xc008('0x61')](path['join'](config[_0xc008('0x62')],'server/files/templates/trunk.ejs'),_0xc008('0x63'));var _0x46fa7b=fs[_0xc008('0x61')](path['join'](config[_0xc008('0x62')],_0xc008('0x64')),_0xc008('0x63'));var _0x553f5c=ejs[_0xc008('0x65')](_0xfdb5e3,{'trunks':_0x25a52b||[]});fs['writeFileSync'](_0xc008('0x66'),_0x553f5c);if(_0x1a2ce7[_0xc008('0x67')]){var _0x23012c=ejs[_0xc008('0x65')](_0x46fa7b,{'trunks':_0x25a52b||[]});fs[_0xc008('0x68')]('/etc/asterisk/sip_xcally_registers.conf',_0x23012c);}})[_0xc008('0x1c')](function(){return respondWithRpcPromise(_0xc008('0x69'),'create',{'module':_0xc008('0x6a')});})['then'](function(){var _0x278cbe=_0x2a4c2b['user'][_0xc008('0x32')]({'plain':!![]});if(!_0x278cbe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x278cbe[_0xc008('0x5c')]===_0xc008('0x5b')){var _0x33d8e4=_0x1a2ce7[_0xc008('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xc008('0x55')]({'where':{'name':_0xc008('0x33'),'userProfileId':_0x278cbe[_0xc008('0x5e')]},'raw':!![]})[_0xc008('0x1c')](function(_0x321500){if(_0x321500&&_0x321500[_0xc008('0x5f')]===0x0){return db[_0xc008('0x34')][_0xc008('0x5a')]({'name':_0x33d8e4['name'],'resourceId':_0x33d8e4['id'],'type':_0x321500[_0xc008('0x36')],'sectionId':_0x321500['id']},{})['then'](function(){return _0x1a2ce7;});}else{return _0x1a2ce7;}})['catch'](function(_0x4c84da){logger[_0xc008('0x20')](_0xc008('0x60'),_0x4c84da);throw _0x4c84da;});}return _0x1a2ce7;})[_0xc008('0x1c')](respondWithResult(_0x7bad14,0xc9))[_0xc008('0x24')](handleError(_0x7bad14,null));};exports[_0xc008('0x30')]=function(_0x2e9646,_0x23ef42,_0x519328){var _0x127bdf;return db['Trunk'][_0xc008('0x55')]({'where':{'id':_0x2e9646[_0xc008('0x50')]['id']}})[_0xc008('0x1c')](handleEntityNotFound(_0x23ef42,null))[_0xc008('0x1c')](saveUpdates(_0x2e9646[_0xc008('0x59')],null))[_0xc008('0x1c')](function(_0x23d4ff){if(_0x23d4ff){_0x127bdf=_0x23d4ff;return db[_0xc008('0x4d')][_0xc008('0x4e')]({'raw':!![]});}})[_0xc008('0x1c')](function(_0x334ed8){if(_0x334ed8){var _0x1dd9fe=fs['readFileSync'](path['join'](config[_0xc008('0x62')],_0xc008('0x6b')),_0xc008('0x63'));var _0x572d93=fs[_0xc008('0x61')](path[_0xc008('0x6c')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0x3fc44f=ejs[_0xc008('0x65')](_0x1dd9fe,{'trunks':_0x334ed8||[]});fs[_0xc008('0x68')](_0xc008('0x66'),_0x3fc44f);var _0x1101b8=ejs[_0xc008('0x65')](_0x572d93,{'trunks':_0x334ed8||[]});fs[_0xc008('0x68')](_0xc008('0x6d'),_0x1101b8);return respondWithRpcPromise(_0xc008('0x69'),_0xc008('0x30'),{'module':'chan_sip.so'});}return null;})['then'](function(_0xc644fe){if(_0xc644fe){return _0x127bdf;}})[_0xc008('0x1c')](respondWithResult(_0x23ef42,null))[_0xc008('0x24')](handleError(_0x23ef42,null));};exports[_0xc008('0x31')]=function(_0x2b94b2,_0x37fc2c,_0x4b434f){var _0x5794fe;return db[_0xc008('0x4d')][_0xc008('0x55')]({'where':{'id':_0x2b94b2[_0xc008('0x50')]['id']}})['then'](handleEntityNotFound(_0x37fc2c,null))['then'](removeEntity(_0x37fc2c,null))['then'](function(){return db['Trunk']['findAll']({'raw':!![]});})['then'](function(_0x276de2){var _0x52bf60=fs[_0xc008('0x61')](path['join'](config[_0xc008('0x62')],_0xc008('0x6b')),_0xc008('0x63'));var _0x5bc8b0=fs['readFileSync'](path[_0xc008('0x6c')](config['root'],_0xc008('0x64')),_0xc008('0x63'));var _0x544519=ejs[_0xc008('0x65')](_0x52bf60,{'trunks':_0x276de2});var _0x4db90b=ejs['render'](_0x5bc8b0,{'trunks':_0x276de2});fs[_0xc008('0x68')](_0xc008('0x66'),_0x544519);fs['writeFileSync'](_0xc008('0x6d'),_0x4db90b);return respondWithRpcPromise(_0xc008('0x69'),_0xc008('0x31'),{'module':'chan_sip.so'});})[_0xc008('0x24')](handleError(_0x37fc2c,null));};
\ No newline at end of file
+var _0x9bde=['fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','offset','order','sort','where','pick','filter','VIRTUAL','merge','Trunk','includeAll','findAll','rows','show','params','fields','include','options','clone','find','omit','createdAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/registry.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','root','server/files/templates/trunk.ejs','writeFileSync','rimraf'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2a69cd,_0x1b6aea){_0x2a69cd=_0x2a69cd-0x0;var _0x42cfa1=_0x9bde[_0x2a69cd];return _0x42cfa1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe9bd('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x220d07,_0x429e88,_0x3435b4,_0x51109f){return new BPromise(function(_0x47ba5e,_0x46a95e){var _0x248818=_0x51109f||client;return _0x248818[_0xe9bd('0x1a')](_0x220d07,_0x3435b4)[_0xe9bd('0x1b')](function(_0x3360bd){logger[_0xe9bd('0x1c')](_0xe9bd('0x1d'),_0x429e88,'request\x20sent');logger[_0xe9bd('0x1e')](_0xe9bd('0x1f'),_0x429e88,_0xe9bd('0x20'),JSON['stringify'](_0x3360bd));if(_0x3360bd[_0xe9bd('0x21')]){if(_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x22')]===0x1f4){logger[_0xe9bd('0x21')]('Trunk,\x20%s,\x20%s',_0x429e88,_0x3360bd[_0xe9bd('0x21')]['message']);return _0x46a95e(_0x3360bd[_0xe9bd('0x21')]['message']);}logger[_0xe9bd('0x21')](_0xe9bd('0x1d'),_0x429e88,_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x23')]);return _0x47ba5e(_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x23')]);}else{logger[_0xe9bd('0x1c')]('Trunk,\x20%s,\x20%s',_0x429e88,_0xe9bd('0x20'));_0x47ba5e(_0x3360bd[_0xe9bd('0x24')]['message']);}})[_0xe9bd('0x25')](function(_0x505c23){logger[_0xe9bd('0x21')](_0xe9bd('0x1d'),_0x429e88,_0x505c23);_0x46a95e(_0x505c23);});});}function respondWithStatusCode(_0x36f8c0,_0xf02209){_0xf02209=_0xf02209||0xcc;return function(_0x5bc4bf){if(_0x5bc4bf){return _0x36f8c0[_0xe9bd('0x26')](_0xf02209);}return _0x36f8c0[_0xe9bd('0x27')](_0xf02209)[_0xe9bd('0x28')]();};}function respondWithResult(_0x39b206,_0x2641be){_0x2641be=_0x2641be||0xc8;return function(_0xb52d45){if(_0xb52d45){return _0x39b206[_0xe9bd('0x27')](_0x2641be)[_0xe9bd('0x29')](_0xb52d45);}};}function respondWithFilteredResult(_0x1ae889,_0x5987af){return function(_0x3c211a){if(_0x3c211a){var _0x38fdfa=typeof _0x5987af['offset']===_0xe9bd('0x2a')&&typeof _0x5987af[_0xe9bd('0x2b')]===_0xe9bd('0x2a');var _0x429055=_0x3c211a[_0xe9bd('0x2c')];var _0x183601=_0x38fdfa?0x0:_0x5987af['offset'];var _0x5b7f1d=_0x38fdfa?_0x3c211a[_0xe9bd('0x2c')]:_0x5987af['offset']+_0x5987af[_0xe9bd('0x2b')];var _0x1f2c0e;if(_0x5b7f1d>=_0x429055){_0x5b7f1d=_0x429055;_0x1f2c0e=0xc8;}else{_0x1f2c0e=0xce;}_0x1ae889[_0xe9bd('0x27')](_0x1f2c0e);return _0x1ae889[_0xe9bd('0x2d')](_0xe9bd('0x2e'),_0x183601+'-'+_0x5b7f1d+'/'+_0x429055)['json'](_0x3c211a);}return null;};}function patchUpdates(_0x4b7bc2){return function(_0x7f2c5){try{jsonpatch[_0xe9bd('0x2f')](_0x7f2c5,_0x4b7bc2,!![]);}catch(_0x3f96a0){return BPromise[_0xe9bd('0x30')](_0x3f96a0);}return _0x7f2c5[_0xe9bd('0x31')]();};}function saveUpdates(_0x1f0f9e,_0x3c31ee){return function(_0x66213a){if(_0x66213a){return _0x66213a[_0xe9bd('0x32')](_0x1f0f9e)['then'](function(_0x426004){return _0x426004;});}return null;};}function removeEntity(_0x81a31f,_0x390a43){return function(_0x5117bc){if(_0x5117bc){return _0x5117bc['destroy']()[_0xe9bd('0x1b')](function(){var _0x2e9593=_0x5117bc[_0xe9bd('0x33')]({'plain':!![]});var _0x3ed60a=_0xe9bd('0x34');return db[_0xe9bd('0x35')][_0xe9bd('0x36')]({'where':{'type':_0x3ed60a,'resourceId':_0x2e9593['id']}})[_0xe9bd('0x1b')](function(){return _0x5117bc;});})[_0xe9bd('0x1b')](function(){_0x81a31f[_0xe9bd('0x27')](0xcc)[_0xe9bd('0x28')]();});}};}function handleEntityNotFound(_0x549dd1,_0x2ad46e){return function(_0x199477){if(!_0x199477){_0x549dd1[_0xe9bd('0x26')](0x194);}return _0x199477;};}function handleError(_0x8ff624,_0x264ba0){_0x264ba0=_0x264ba0||0x1f4;return function(_0x147da5){logger['error'](_0x147da5[_0xe9bd('0x37')]);if(_0x147da5[_0xe9bd('0x38')]){delete _0x147da5['name'];}_0x8ff624[_0xe9bd('0x27')](_0x264ba0)[_0xe9bd('0x39')](_0x147da5);};}exports['index']=function(_0x4b1da0,_0x2785e6){var _0xdf43b9={},_0x4d2f3d={},_0x2d1289={'count':0x0,'rows':[]};var _0x3ea705=_[_0xe9bd('0x3a')](db['Trunk'][_0xe9bd('0x3b')],function(_0x4d1945){return{'name':_0x4d1945[_0xe9bd('0x3c')],'type':_0x4d1945[_0xe9bd('0x3d')][_0xe9bd('0x3e')]};});_0x4d2f3d[_0xe9bd('0x3f')]=_['map'](_0x3ea705,_0xe9bd('0x38'));_0x4d2f3d[_0xe9bd('0x40')]=_[_0xe9bd('0x41')](_0x4b1da0[_0xe9bd('0x40')]);_0x4d2f3d[_0xe9bd('0x42')]=_[_0xe9bd('0x43')](_0x4d2f3d[_0xe9bd('0x3f')],_0x4d2f3d[_0xe9bd('0x40')]);_0xdf43b9[_0xe9bd('0x44')]=_[_0xe9bd('0x43')](_0x4d2f3d['model'],qs['fields'](_0x4b1da0[_0xe9bd('0x40')]['fields']));_0xdf43b9[_0xe9bd('0x44')]=_0xdf43b9[_0xe9bd('0x44')][_0xe9bd('0x45')]?_0xdf43b9['attributes']:_0x4d2f3d[_0xe9bd('0x3f')];if(!_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x46')]('nolimit')){_0xdf43b9[_0xe9bd('0x2b')]=qs[_0xe9bd('0x2b')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x2b')]);_0xdf43b9[_0xe9bd('0x47')]=qs[_0xe9bd('0x47')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x47')]);}_0xdf43b9[_0xe9bd('0x48')]=qs[_0xe9bd('0x49')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x49')]);_0xdf43b9[_0xe9bd('0x4a')]=qs[_0xe9bd('0x42')](_[_0xe9bd('0x4b')](_0x4b1da0['query'],_0x4d2f3d['filters']),_0x3ea705);if(_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x4c')]){_0xdf43b9[_0xe9bd('0x4a')]=_['merge'](_0xdf43b9['where'],{'$or':_[_0xe9bd('0x3a')](_0x3ea705,function(_0x3f6f22){if(_0x3f6f22[_0xe9bd('0x3d')]!==_0xe9bd('0x4d')){var _0x39fb61={};_0x39fb61[_0x3f6f22[_0xe9bd('0x38')]]={'$like':'%'+_0x4b1da0[_0xe9bd('0x40')]['filter']+'%'};return _0x39fb61;}})});}_0xdf43b9=_[_0xe9bd('0x4e')]({},_0xdf43b9,_0x4b1da0['options']);var _0x36726e={'where':_0xdf43b9[_0xe9bd('0x4a')]};return db[_0xe9bd('0x4f')][_0xe9bd('0x2c')](_0x36726e)[_0xe9bd('0x1b')](function(_0x4b7b67){_0x2d1289[_0xe9bd('0x2c')]=_0x4b7b67;if(_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x50')]){_0xdf43b9['include']=[{'all':!![]}];}return db[_0xe9bd('0x4f')][_0xe9bd('0x51')](_0xdf43b9);})[_0xe9bd('0x1b')](function(_0x5a466b){_0x2d1289[_0xe9bd('0x52')]=_0x5a466b;return _0x2d1289;})[_0xe9bd('0x1b')](respondWithFilteredResult(_0x2785e6,_0xdf43b9))[_0xe9bd('0x25')](handleError(_0x2785e6,null));};exports[_0xe9bd('0x53')]=function(_0x1ee09c,_0x579d26){var _0x3f4833={'raw':![],'where':{'id':_0x1ee09c[_0xe9bd('0x54')]['id']}},_0x4b8ff9={};_0x4b8ff9[_0xe9bd('0x3f')]=_[_0xe9bd('0x41')](db[_0xe9bd('0x4f')][_0xe9bd('0x3b')]);_0x4b8ff9['query']=_[_0xe9bd('0x41')](_0x1ee09c['query']);_0x4b8ff9[_0xe9bd('0x42')]=_[_0xe9bd('0x43')](_0x4b8ff9['model'],_0x4b8ff9['query']);_0x3f4833[_0xe9bd('0x44')]=_['intersection'](_0x4b8ff9[_0xe9bd('0x3f')],qs['fields'](_0x1ee09c[_0xe9bd('0x40')][_0xe9bd('0x55')]));_0x3f4833['attributes']=_0x3f4833[_0xe9bd('0x44')]['length']?_0x3f4833[_0xe9bd('0x44')]:_0x4b8ff9[_0xe9bd('0x3f')];if(_0x1ee09c[_0xe9bd('0x40')]['includeAll']){_0x3f4833[_0xe9bd('0x56')]=[{'all':!![]}];}_0x3f4833=_[_0xe9bd('0x4e')]({},_0x3f4833,_0x1ee09c[_0xe9bd('0x57')]);return db[_0xe9bd('0x4f')]['find'](_0x3f4833)['then'](handleEntityNotFound(_0x579d26,null))[_0xe9bd('0x1b')](respondWithResult(_0x579d26,null))['catch'](handleError(_0x579d26,null));};exports[_0xe9bd('0x58')]=function(_0x3c33b8,_0xc7dd2f){var _0xc818b4={'where':{'id':_0x3c33b8[_0xe9bd('0x54')]['id']}},_0x159f68={};_0x159f68[_0xe9bd('0x3f')]=_[_0xe9bd('0x41')](db[_0xe9bd('0x4f')][_0xe9bd('0x3b')]);_0xc818b4[_0xe9bd('0x44')]=_[_0xe9bd('0x43')](_0x159f68['model'],qs['fields'](_0x3c33b8['query'][_0xe9bd('0x55')]));_0xc818b4['attributes']=_0xc818b4[_0xe9bd('0x44')][_0xe9bd('0x45')]?_0xc818b4[_0xe9bd('0x44')]:_0x159f68[_0xe9bd('0x3f')];if(_0x3c33b8[_0xe9bd('0x40')][_0xe9bd('0x50')]){_0xc818b4[_0xe9bd('0x56')]=[{'all':!![]}];}_0xc818b4=_[_0xe9bd('0x4e')]({},_0xc818b4,_0x3c33b8[_0xe9bd('0x57')]);return db['Trunk'][_0xe9bd('0x59')](_0xc818b4)[_0xe9bd('0x1b')](handleEntityNotFound(_0xc7dd2f,null))[_0xe9bd('0x1b')](function(_0x3f848d){if(_0x3f848d){var _0x4d58c1=_0x3f848d[_0xe9bd('0x33')]({'plain':!![]});_0x4d58c1=qs[_0xe9bd('0x5a')](_0x4d58c1,['id',_0xe9bd('0x5b'),'updatedAt']);_0x3c33b8[_0xe9bd('0x5c')]=_[_0xe9bd('0x5a')](_0x3c33b8[_0xe9bd('0x5c')],['id',_0xe9bd('0x5b'),'updatedAt']);return db['Trunk'][_0xe9bd('0x5d')](_[_0xe9bd('0x4e')](_0x4d58c1,_0x3c33b8[_0xe9bd('0x5c')]),{'include':_0x3c33b8[_0xe9bd('0x40')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x305efa){var _0x20855b=_0x3c33b8[_0xe9bd('0x5e')][_0xe9bd('0x33')]({'plain':!![]});if(!_0x20855b)throw new Error(_0xe9bd('0x5f'));if(_0x20855b[_0xe9bd('0x60')]==='user'){var _0x179c8d=_0x305efa['get']({'plain':!![]});var _0x27e07c=_0xe9bd('0x34');return db[_0xe9bd('0x61')][_0xe9bd('0x59')]({'where':{'name':_0x27e07c,'userProfileId':_0x20855b['userProfileId']},'raw':!![]})[_0xe9bd('0x1b')](function(_0x263ad9){if(_0x263ad9&&_0x263ad9[_0xe9bd('0x62')]===0x0){return db['UserProfileResource'][_0xe9bd('0x5d')]({'name':_0x179c8d[_0xe9bd('0x38')],'resourceId':_0x179c8d['id'],'type':_0x263ad9[_0xe9bd('0x38')],'sectionId':_0x263ad9['id']},{})[_0xe9bd('0x1b')](function(){return _0x305efa;});}else{return _0x305efa;}})[_0xe9bd('0x25')](function(_0x16b66c){logger[_0xe9bd('0x21')](_0xe9bd('0x63'),_0x16b66c);throw _0x16b66c;});}return _0x305efa;});}})[_0xe9bd('0x1b')](respondWithResult(_0xc7dd2f,0xc9))[_0xe9bd('0x25')](handleError(_0xc7dd2f,null));};exports[_0xe9bd('0x5d')]=function(_0x37d07a,_0x5d1e4b,_0x3a12e9){var _0x9d0603;return db['Trunk'][_0xe9bd('0x5d')](_0x37d07a[_0xe9bd('0x5c')],{'raw':!![]})['then'](function(_0x561165){_0x9d0603=_0x561165;return db[_0xe9bd('0x4f')][_0xe9bd('0x51')]({'raw':!![]});})['then'](function(_0x4ec8be){var _0x4a6422=fs[_0xe9bd('0x64')](path['join'](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x1fc88d=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config['root'],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x337284=ejs[_0xe9bd('0x68')](_0x4a6422,{'trunks':_0x4ec8be||[]});fs['writeFileSync'](_0xe9bd('0x69'),_0x337284);if(_0x9d0603[_0xe9bd('0x6a')]){var _0x11ebcb=ejs['render'](_0x1fc88d,{'trunks':_0x4ec8be||[]});fs['writeFileSync'](_0xe9bd('0x6b'),_0x11ebcb);}})[_0xe9bd('0x1b')](function(){return respondWithRpcPromise(_0xe9bd('0x6c'),_0xe9bd('0x5d'),{'module':_0xe9bd('0x6d')});})[_0xe9bd('0x1b')](function(){var _0x3fda4c=_0x37d07a[_0xe9bd('0x5e')]['get']({'plain':!![]});if(!_0x3fda4c)throw new Error(_0xe9bd('0x5f'));if(_0x3fda4c[_0xe9bd('0x60')]===_0xe9bd('0x5e')){var _0x3db47a=_0x9d0603[_0xe9bd('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xe9bd('0x59')]({'where':{'name':'Trunks','userProfileId':_0x3fda4c['userProfileId']},'raw':!![]})[_0xe9bd('0x1b')](function(_0x4496e3){if(_0x4496e3&&_0x4496e3['autoAssociation']===0x0){return db[_0xe9bd('0x35')][_0xe9bd('0x5d')]({'name':_0x3db47a[_0xe9bd('0x38')],'resourceId':_0x3db47a['id'],'type':_0x4496e3[_0xe9bd('0x38')],'sectionId':_0x4496e3['id']},{})['then'](function(){return _0x9d0603;});}else{return _0x9d0603;}})[_0xe9bd('0x25')](function(_0x41fb41){logger['error'](_0xe9bd('0x63'),_0x41fb41);throw _0x41fb41;});}return _0x9d0603;})[_0xe9bd('0x1b')](respondWithResult(_0x5d1e4b,0xc9))[_0xe9bd('0x25')](handleError(_0x5d1e4b,null));};exports[_0xe9bd('0x32')]=function(_0x2e63c7,_0x1a36aa,_0x466a89){var _0x5e127b;return db[_0xe9bd('0x4f')][_0xe9bd('0x59')]({'where':{'id':_0x2e63c7[_0xe9bd('0x54')]['id']}})[_0xe9bd('0x1b')](handleEntityNotFound(_0x1a36aa,null))[_0xe9bd('0x1b')](saveUpdates(_0x2e63c7[_0xe9bd('0x5c')],null))[_0xe9bd('0x1b')](function(_0x2adc49){if(_0x2adc49){_0x5e127b=_0x2adc49;return db[_0xe9bd('0x4f')]['findAll']({'raw':!![]});}})[_0xe9bd('0x1b')](function(_0x466952){if(_0x466952){var _0x256890=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config[_0xe9bd('0x6e')],_0xe9bd('0x6f')),'utf8');var _0x18519d=fs[_0xe9bd('0x64')](path['join'](config[_0xe9bd('0x6e')],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x2083c4=ejs[_0xe9bd('0x68')](_0x256890,{'trunks':_0x466952||[]});fs[_0xe9bd('0x70')](_0xe9bd('0x69'),_0x2083c4);var _0x4f3dc6=ejs['render'](_0x18519d,{'trunks':_0x466952||[]});fs[_0xe9bd('0x70')](_0xe9bd('0x6b'),_0x4f3dc6);return respondWithRpcPromise(_0xe9bd('0x6c'),_0xe9bd('0x32'),{'module':_0xe9bd('0x6d')});}return null;})[_0xe9bd('0x1b')](function(_0x1b46f4){if(_0x1b46f4){return _0x5e127b;}})['then'](respondWithResult(_0x1a36aa,null))[_0xe9bd('0x25')](handleError(_0x1a36aa,null));};exports[_0xe9bd('0x36')]=function(_0x29833b,_0x256862,_0x14cdd5){var _0x74063;return db[_0xe9bd('0x4f')]['find']({'where':{'id':_0x29833b['params']['id']}})['then'](handleEntityNotFound(_0x256862,null))[_0xe9bd('0x1b')](removeEntity(_0x256862,null))['then'](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0xe9bd('0x1b')](function(_0x402ab2){var _0xf170d4=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config[_0xe9bd('0x6e')],_0xe9bd('0x6f')),_0xe9bd('0x67'));var _0x14ec42=fs['readFileSync'](path[_0xe9bd('0x65')](config['root'],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x22c67f=ejs[_0xe9bd('0x68')](_0xf170d4,{'trunks':_0x402ab2});var _0x416938=ejs['render'](_0x14ec42,{'trunks':_0x402ab2});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x22c67f);fs[_0xe9bd('0x70')](_0xe9bd('0x6b'),_0x416938);return respondWithRpcPromise('Reload',_0xe9bd('0x36'),{'module':_0xe9bd('0x6d')});})[_0xe9bd('0x25')](handleError(_0x256862,null));};
\ No newline at end of file
index f33afac..b6cb600 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdc1=['../../config/environment','./trunk.attributes','exports','define','tools_trunks','lodash','moment','bluebird','rimraf'];(function(_0x5710ee,_0x411be0){var _0x48b315=function(_0xf548c5){while(--_0xf548c5){_0x5710ee['push'](_0x5710ee['shift']());}};_0x48b315(++_0x411be0);}(_0xbdc1,0x188));var _0x1bdc=function(_0x3fd598,_0x57fa5f){_0x3fd598=_0x3fd598-0x0;var _0x3d4c44=_0xbdc1[_0x3fd598];return _0x3d4c44;};'use strict';var _=require(_0x1bdc('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1bdc('0x1'));var BPromise=require(_0x1bdc('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1bdc('0x3'));var config=require(_0x1bdc('0x4'));var attributes=require(_0x1bdc('0x5'));module[_0x1bdc('0x6')]=function(_0x542cad,_0x5a4dec){return _0x542cad[_0x1bdc('0x7')]('Trunk',attributes,{'tableName':_0x1bdc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd5d7=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Trunk','lodash','util'];(function(_0x3a8fed,_0x1e692f){var _0x2e4a1c=function(_0x1f418c){while(--_0x1f418c){_0x3a8fed['push'](_0x3a8fed['shift']());}};_0x2e4a1c(++_0x1e692f);}(_0xd5d7,0x19e));var _0x7d5d=function(_0x107d6d,_0x51420c){_0x107d6d=_0x107d6d-0x0;var _0x112837=_0xd5d7[_0x107d6d];return _0x112837;};'use strict';var _=require(_0x7d5d('0x0'));var util=require(_0x7d5d('0x1'));var logger=require(_0x7d5d('0x2'))(_0x7d5d('0x3'));var moment=require(_0x7d5d('0x4'));var BPromise=require(_0x7d5d('0x5'));var rp=require(_0x7d5d('0x6'));var fs=require('fs');var path=require(_0x7d5d('0x7'));var rimraf=require(_0x7d5d('0x8'));var config=require(_0x7d5d('0x9'));var attributes=require('./trunk.attributes');module[_0x7d5d('0xa')]=function(_0x20180b,_0x41f86c){return _0x20180b[_0x7d5d('0xb')](_0x7d5d('0xc'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 56dd0df..3c67b6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96fa=['Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetTrunk','Trunk','findAll','options','attributes','limit','include','map','model','debug','where','ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x96fa,0xc4));var _0xa96f=function(_0x2c3536,_0x981389){_0x2c3536=_0x2c3536-0x0;var _0xb11172=_0x96fa[_0x2c3536];return _0xb11172;};'use strict';var _=require(_0xa96f('0x0'));var util=require(_0xa96f('0x1'));var moment=require(_0xa96f('0x2'));var BPromise=require(_0xa96f('0x3'));var rs=require(_0xa96f('0x4'));var fs=require('fs');var Redis=require(_0xa96f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xa96f('0x6'));var logger=require(_0xa96f('0x7'))(_0xa96f('0x8'));var config=require('../../config/environment');var jayson=require(_0xa96f('0x9'));var client=jayson[_0xa96f('0xa')][_0xa96f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e9c8b,_0x3dcf92,_0x2be1b7){return new BPromise(function(_0x28494d,_0x3d37bb){return client[_0xa96f('0xc')](_0x4e9c8b,_0x2be1b7)[_0xa96f('0xd')](function(_0x2f12e7){logger['info'](_0xa96f('0xe'),_0x3dcf92,_0xa96f('0xf'));logger['debug'](_0xa96f('0x10'),_0x3dcf92,'request\x20sent',JSON[_0xa96f('0x11')](_0x2f12e7));if(_0x2f12e7[_0xa96f('0x12')]){if(_0x2f12e7[_0xa96f('0x12')]['code']===0x1f4){logger['error'](_0xa96f('0xe'),_0x3dcf92,_0x2f12e7[_0xa96f('0x12')][_0xa96f('0x13')]);return _0x3d37bb(_0x2f12e7[_0xa96f('0x12')][_0xa96f('0x13')]);}logger[_0xa96f('0x12')](_0xa96f('0xe'),_0x3dcf92,_0x2f12e7[_0xa96f('0x12')]['message']);return _0x28494d(_0x2f12e7[_0xa96f('0x12')][_0xa96f('0x13')]);}else{logger[_0xa96f('0x14')](_0xa96f('0xe'),_0x3dcf92,_0xa96f('0xf'));_0x28494d(_0x2f12e7[_0xa96f('0x15')]['message']);}})[_0xa96f('0x16')](function(_0x3caaed){logger['error']('Trunk,\x20%s,\x20%s',_0x3dcf92,_0x3caaed);_0x3d37bb(_0x3caaed);});});}exports[_0xa96f('0x17')]=function(_0x27ff1b){var _0x5f314e=this;return new Promise(function(_0x43c489,_0x3ca9ae){return db[_0xa96f('0x18')][_0xa96f('0x19')]({'raw':_0x27ff1b[_0xa96f('0x1a')]?_0x27ff1b[_0xa96f('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x27ff1b[_0xa96f('0x1a')]?_0x27ff1b[_0xa96f('0x1a')]['where']||null:null,'attributes':_0x27ff1b['options']?_0x27ff1b[_0xa96f('0x1a')][_0xa96f('0x1b')]||null:null,'limit':_0x27ff1b['options']?_0x27ff1b[_0xa96f('0x1a')][_0xa96f('0x1c')]||null:null,'include':_0x27ff1b[_0xa96f('0x1a')]?_0x27ff1b[_0xa96f('0x1a')][_0xa96f('0x1d')]?_[_0xa96f('0x1e')](_0x27ff1b['options']['include'],function(_0x312421){return{'model':db[_0x312421[_0xa96f('0x1f')]],'as':_0x312421['as'],'attributes':_0x312421[_0xa96f('0x1b')],'include':_0x312421[_0xa96f('0x1d')]?_[_0xa96f('0x1e')](_0x312421[_0xa96f('0x1d')],function(_0x1a7922){return{'model':db[_0x1a7922['model']],'as':_0x1a7922['as'],'attributes':_0x1a7922[_0xa96f('0x1b')],'include':_0x1a7922[_0xa96f('0x1d')]?_[_0xa96f('0x1e')](_0x1a7922['include'],function(_0x1f374e){return{'model':db[_0x1f374e[_0xa96f('0x1f')]],'as':_0x1f374e['as'],'attributes':_0x1f374e[_0xa96f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa96f('0xd')](function(_0x3f5b40){logger['info'](_0xa96f('0x17'),_0x27ff1b);logger[_0xa96f('0x20')](_0xa96f('0x17'),_0x27ff1b,JSON[_0xa96f('0x11')](_0x3f5b40));_0x43c489(_0x3f5b40);})[_0xa96f('0x16')](function(_0x13e398){logger[_0xa96f('0x12')](_0xa96f('0x17'),_0x13e398[_0xa96f('0x13')],_0x27ff1b);_0x3ca9ae(_0x5f314e[_0xa96f('0x12')](0x1f4,_0x13e398['message']));});});};exports['ShowTrunk']=function(_0x39bb61){var _0x5228df=this;return new Promise(function(_0x5dbbb1,_0x322534){return db[_0xa96f('0x18')]['find']({'raw':_0x39bb61['options']?_0x39bb61[_0xa96f('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x39bb61[_0xa96f('0x1a')]?_0x39bb61['options'][_0xa96f('0x21')]||null:null,'attributes':_0x39bb61[_0xa96f('0x1a')]?_0x39bb61[_0xa96f('0x1a')][_0xa96f('0x1b')]||null:null,'include':_0x39bb61[_0xa96f('0x1a')]?_0x39bb61[_0xa96f('0x1a')]['include']?_[_0xa96f('0x1e')](_0x39bb61[_0xa96f('0x1a')][_0xa96f('0x1d')],function(_0x1a79f4){return{'model':db[_0x1a79f4[_0xa96f('0x1f')]],'as':_0x1a79f4['as'],'attributes':_0x1a79f4['attributes'],'include':_0x1a79f4[_0xa96f('0x1d')]?_[_0xa96f('0x1e')](_0x1a79f4['include'],function(_0x471e61){return{'model':db[_0x471e61[_0xa96f('0x1f')]],'as':_0x471e61['as'],'attributes':_0x471e61[_0xa96f('0x1b')],'include':_0x471e61[_0xa96f('0x1d')]?_[_0xa96f('0x1e')](_0x471e61[_0xa96f('0x1d')],function(_0x35a8a6){return{'model':db[_0x35a8a6[_0xa96f('0x1f')]],'as':_0x35a8a6['as'],'attributes':_0x35a8a6[_0xa96f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa96f('0xd')](function(_0x1870ed){logger[_0xa96f('0x14')](_0xa96f('0x22'),_0x39bb61);logger['debug'](_0xa96f('0x22'),_0x39bb61,JSON[_0xa96f('0x11')](_0x1870ed));_0x5dbbb1(_0x1870ed);})[_0xa96f('0x16')](function(_0x27712b){logger[_0xa96f('0x12')](_0xa96f('0x22'),_0x27712b['message'],_0x39bb61);_0x322534(_0x5228df[_0xa96f('0x12')](0x1f4,_0x27712b[_0xa96f('0x13')]));});});};
\ No newline at end of file
+var _0x9055=['options','raw','where','attributes','limit','include','map','model','GetTrunk','ShowTrunk','find','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','Trunk,\x20%s,\x20%s','message','result','catch','Trunk','findAll'];(function(_0x44454f,_0x4bfbe8){var _0x475150=function(_0x1cde13){while(--_0x1cde13){_0x44454f['push'](_0x44454f['shift']());}};_0x475150(++_0x4bfbe8);}(_0x9055,0x1eb));var _0x5905=function(_0x25fc12,_0x4358d7){_0x25fc12=_0x25fc12-0x0;var _0x34ceb6=_0x9055[_0x25fc12];return _0x34ceb6;};'use strict';var _=require(_0x5905('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5905('0x1'));var db=require(_0x5905('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x5905('0x3'))(_0x5905('0x4'));var config=require(_0x5905('0x5'));var jayson=require(_0x5905('0x6'));var client=jayson[_0x5905('0x7')][_0x5905('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x275cea,_0x412c90,_0x59d027){return new BPromise(function(_0x551d85,_0x24b89f){return client['request'](_0x275cea,_0x59d027)[_0x5905('0x9')](function(_0x530680){logger[_0x5905('0xa')]('Trunk,\x20%s,\x20%s',_0x412c90,_0x5905('0xb'));logger[_0x5905('0xc')]('Trunk,\x20%s,\x20%s,\x20%s',_0x412c90,'request\x20sent',JSON[_0x5905('0xd')](_0x530680));if(_0x530680[_0x5905('0xe')]){if(_0x530680[_0x5905('0xe')]['code']===0x1f4){logger[_0x5905('0xe')](_0x5905('0xf'),_0x412c90,_0x530680['error'][_0x5905('0x10')]);return _0x24b89f(_0x530680[_0x5905('0xe')]['message']);}logger[_0x5905('0xe')](_0x5905('0xf'),_0x412c90,_0x530680[_0x5905('0xe')][_0x5905('0x10')]);return _0x551d85(_0x530680[_0x5905('0xe')][_0x5905('0x10')]);}else{logger[_0x5905('0xa')](_0x5905('0xf'),_0x412c90,_0x5905('0xb'));_0x551d85(_0x530680[_0x5905('0x11')][_0x5905('0x10')]);}})[_0x5905('0x12')](function(_0x374e70){logger['error'](_0x5905('0xf'),_0x412c90,_0x374e70);_0x24b89f(_0x374e70);});});}exports['GetTrunk']=function(_0xa4e4fb){var _0x594aba=this;return new Promise(function(_0x234d36,_0x73b880){return db[_0x5905('0x13')][_0x5905('0x14')]({'raw':_0xa4e4fb[_0x5905('0x15')]?_0xa4e4fb[_0x5905('0x15')][_0x5905('0x16')]===undefined?!![]:![]:!![],'where':_0xa4e4fb[_0x5905('0x15')]?_0xa4e4fb[_0x5905('0x15')][_0x5905('0x17')]||null:null,'attributes':_0xa4e4fb[_0x5905('0x15')]?_0xa4e4fb['options'][_0x5905('0x18')]||null:null,'limit':_0xa4e4fb[_0x5905('0x15')]?_0xa4e4fb['options'][_0x5905('0x19')]||null:null,'include':_0xa4e4fb['options']?_0xa4e4fb[_0x5905('0x15')][_0x5905('0x1a')]?_[_0x5905('0x1b')](_0xa4e4fb[_0x5905('0x15')]['include'],function(_0x364be5){return{'model':db[_0x364be5[_0x5905('0x1c')]],'as':_0x364be5['as'],'attributes':_0x364be5[_0x5905('0x18')],'include':_0x364be5[_0x5905('0x1a')]?_['map'](_0x364be5['include'],function(_0x206fc9){return{'model':db[_0x206fc9[_0x5905('0x1c')]],'as':_0x206fc9['as'],'attributes':_0x206fc9['attributes'],'include':_0x206fc9[_0x5905('0x1a')]?_['map'](_0x206fc9[_0x5905('0x1a')],function(_0x292b80){return{'model':db[_0x292b80['model']],'as':_0x292b80['as'],'attributes':_0x292b80[_0x5905('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5905('0x9')](function(_0x179b85){logger[_0x5905('0xa')]('GetTrunk',_0xa4e4fb);logger[_0x5905('0xc')](_0x5905('0x1d'),_0xa4e4fb,JSON[_0x5905('0xd')](_0x179b85));_0x234d36(_0x179b85);})['catch'](function(_0x9e554a){logger['error'](_0x5905('0x1d'),_0x9e554a[_0x5905('0x10')],_0xa4e4fb);_0x73b880(_0x594aba[_0x5905('0xe')](0x1f4,_0x9e554a[_0x5905('0x10')]));});});};exports[_0x5905('0x1e')]=function(_0x447c8c){var _0x22fea4=this;return new Promise(function(_0x3f80db,_0x2bf839){return db[_0x5905('0x13')][_0x5905('0x1f')]({'raw':_0x447c8c[_0x5905('0x15')]?_0x447c8c[_0x5905('0x15')][_0x5905('0x16')]===undefined?!![]:![]:!![],'where':_0x447c8c[_0x5905('0x15')]?_0x447c8c[_0x5905('0x15')][_0x5905('0x17')]||null:null,'attributes':_0x447c8c[_0x5905('0x15')]?_0x447c8c[_0x5905('0x15')][_0x5905('0x18')]||null:null,'include':_0x447c8c['options']?_0x447c8c['options']['include']?_['map'](_0x447c8c[_0x5905('0x15')][_0x5905('0x1a')],function(_0xda5485){return{'model':db[_0xda5485[_0x5905('0x1c')]],'as':_0xda5485['as'],'attributes':_0xda5485[_0x5905('0x18')],'include':_0xda5485['include']?_['map'](_0xda5485['include'],function(_0x136d00){return{'model':db[_0x136d00[_0x5905('0x1c')]],'as':_0x136d00['as'],'attributes':_0x136d00[_0x5905('0x18')],'include':_0x136d00['include']?_[_0x5905('0x1b')](_0x136d00[_0x5905('0x1a')],function(_0x3cd3a2){return{'model':db[_0x3cd3a2[_0x5905('0x1c')]],'as':_0x3cd3a2['as'],'attributes':_0x3cd3a2[_0x5905('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5905('0x9')](function(_0x2d12a4){logger[_0x5905('0xa')](_0x5905('0x1e'),_0x447c8c);logger['debug'](_0x5905('0x1e'),_0x447c8c,JSON[_0x5905('0xd')](_0x2d12a4));_0x3f80db(_0x2d12a4);})[_0x5905('0x12')](function(_0x3318c8){logger[_0x5905('0xe')]('ShowTrunk',_0x3318c8[_0x5905('0x10')],_0x447c8c);_0x2bf839(_0x22fea4[_0x5905('0xe')](0x1f4,_0x3318c8[_0x5905('0x10')]));});});};
\ No newline at end of file
index 52e9bcf..e636fcb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd32f=['../../components/auth/service','./user-setting.controller','/:id','isAuthenticated','exports','Router'];(function(_0x4a11f8,_0x17e15f){var _0xd8f565=function(_0x49713a){while(--_0x49713a){_0x4a11f8['push'](_0x4a11f8['shift']());}};_0xd8f565(++_0x17e15f);}(_0xd32f,0x12b));var _0xfd32=function(_0x45e1a7,_0x24a6b3){_0x45e1a7=_0x45e1a7-0x0;var _0x16a42f=_0xd32f[_0x45e1a7];return _0x16a42f;};'use strict';var express=require('express');var router=express[_0xfd32('0x0')]();var auth=require(_0xfd32('0x1'));var controller=require(_0xfd32('0x2'));router['put'](_0xfd32('0x3'),auth[_0xfd32('0x4')](),controller['update']);module[_0xfd32('0x5')]=router;
\ No newline at end of file
+var _0x9136=['Router','../../components/auth/service','update','exports','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9136,0x185));var _0x6913=function(_0x530f74,_0x387424){_0x530f74=_0x530f74-0x0;var _0x2b54fb=_0x9136[_0x530f74];return _0x2b54fb;};'use strict';var express=require(_0x6913('0x0'));var router=express[_0x6913('0x1')]();var auth=require(_0x6913('0x2'));var controller=require('./user-setting.controller');router['put']('/:id',auth['isAuthenticated'](),controller[_0x6913('0x3')]);module[_0x6913('0x4')]=router;
\ No newline at end of file
index bff093d..2c61b99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd420=['sequelize','error','warning','debug','exports','BOOLEAN','TEXT','DATE','INTEGER','UserId'];(function(_0x516f09,_0x17b125){var _0x4601e9=function(_0x1c6c53){while(--_0x1c6c53){_0x516f09['push'](_0x516f09['shift']());}};_0x4601e9(++_0x17b125);}(_0xd420,0x8c));var _0x0d42=function(_0x4b777d,_0x1e0608){_0x4b777d=_0x4b777d-0x0;var _0x5390e0=_0xd420[_0x4b777d];return _0x5390e0;};'use strict';var Sequelize=require(_0x0d42('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x0d42('0x1'),_0x0d42('0x2'),'info',_0x0d42('0x3')];module[_0x0d42('0x4')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x0d42('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x0d42('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x0d42('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x0d42('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x0d42('0x8')],'unique':_0x0d42('0x9')}};
\ No newline at end of file
+var _0x0d57=['error','warning','exports','ENUM','BOOLEAN','TEXT','DATE','INTEGER','UserId','sequelize'];(function(_0x496e72,_0x12b015){var _0x8e1ba2=function(_0x1fb794){while(--_0x1fb794){_0x496e72['push'](_0x496e72['shift']());}};_0x8e1ba2(++_0x12b015);}(_0x0d57,0x149));var _0x70d5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0d57[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x70d5('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x70d5('0x1'),_0x70d5('0x2'),'info','debug'];module[_0x70d5('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0x70d5('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x70d5('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x70d5('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x70d5('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x70d5('0x8')],'unique':_0x70d5('0x9')}};
\ No newline at end of file
index 563c149..792a0b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6208=['../../mysqldb','redis','./user-setting.socket','register','defaults','localhost','status','json','update','then','sendStatus','error','stack','name','user','role','admin','params','Invalid\x20user\x20setting\x20id','body','catch','lodash','../../config/logger','api'];(function(_0x2bd443,_0x3b60d8){var _0x45159a=function(_0x1ddbec){while(--_0x1ddbec){_0x2bd443['push'](_0x2bd443['shift']());}};_0x45159a(++_0x3b60d8);}(_0x6208,0x17d));var _0x8620=function(_0x2932cf,_0x362fd9){_0x2932cf=_0x2932cf-0x0;var _0x1711dd=_0x6208[_0x2932cf];return _0x1711dd;};'use strict';var _=require(_0x8620('0x0'));var Redis=require('ioredis');var logger=require(_0x8620('0x1'))(_0x8620('0x2'));var config=require('../../config/environment');var db=require(_0x8620('0x3'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x8620('0x4')]));require(_0x8620('0x5'))[_0x8620('0x6')](socket);config[_0x8620('0x4')]=_[_0x8620('0x7')](config[_0x8620('0x4')],{'host':_0x8620('0x8'),'port':0x18eb});function respondWithResult(_0x525095,_0x270a35){_0x270a35=_0x270a35||0xc8;return function(_0x1a6e9e){if(_0x1a6e9e){return _0x525095[_0x8620('0x9')](_0x270a35)[_0x8620('0xa')](_0x1a6e9e);}};}function saveUpdates(_0x38d90a){return function(_0x3fa6a9){if(_0x3fa6a9){return _0x3fa6a9[_0x8620('0xb')](_0x38d90a)[_0x8620('0xc')](function(_0x1e0bf7){return _0x1e0bf7;});}return null;};}function handleEntityNotFound(_0x52cb7a){return function(_0xaf2e78){if(!_0xaf2e78){_0x52cb7a[_0x8620('0xd')](0x194);}return _0xaf2e78;};}function handleError(_0x50cbc6,_0x4ea300){_0x4ea300=_0x4ea300||0x1f4;return function(_0x3b6d6e){logger[_0x8620('0xe')](_0x3b6d6e[_0x8620('0xf')]);if(_0x3b6d6e[_0x8620('0x10')]){delete _0x3b6d6e[_0x8620('0x10')];}_0x50cbc6[_0x8620('0x9')](_0x4ea300)['send'](_0x3b6d6e);};}exports[_0x8620('0xb')]=function(_0x5a1f8f,_0xdfa354){if(_0x5a1f8f[_0x8620('0x11')][_0x8620('0x12')]!==_0x8620('0x13'))throw new Error('Unauthorized');if(isNaN(Number(_0x5a1f8f[_0x8620('0x14')]['id'])))throw new Error(_0x8620('0x15'));return db['UserSetting']['find']({'where':{'id':_0x5a1f8f[_0x8620('0x14')]['id']}})[_0x8620('0xc')](handleEntityNotFound(_0xdfa354,null))['then'](saveUpdates(_0x5a1f8f[_0x8620('0x16')],null))['then'](respondWithResult(_0xdfa354,null))[_0x8620('0x17')](handleError(_0xdfa354,null));};
\ No newline at end of file
+var _0xca2b=['admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','register','then','sendStatus','error','stack','name','status','update','user','role'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xca2b,0x156));var _0xbca2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xca2b[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xbca2('0x0'));var Redis=require(_0xbca2('0x1'));var logger=require(_0xbca2('0x2'))(_0xbca2('0x3'));var config=require(_0xbca2('0x4'));var db=require(_0xbca2('0x5'))['db'];var socket=require(_0xbca2('0x6'))(new Redis(config[_0xbca2('0x7')]));require('./user-setting.socket')[_0xbca2('0x8')](socket);config[_0xbca2('0x7')]=_['defaults'](config[_0xbca2('0x7')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x3476ee,_0x214cdf){_0x214cdf=_0x214cdf||0xc8;return function(_0x226fca){if(_0x226fca){return _0x3476ee['status'](_0x214cdf)['json'](_0x226fca);}};}function saveUpdates(_0xddc139){return function(_0x5a0c03){if(_0x5a0c03){return _0x5a0c03['update'](_0xddc139)[_0xbca2('0x9')](function(_0x8116b2){return _0x8116b2;});}return null;};}function handleEntityNotFound(_0x1b3903){return function(_0x24cec){if(!_0x24cec){_0x1b3903[_0xbca2('0xa')](0x194);}return _0x24cec;};}function handleError(_0x1a2639,_0x20759f){_0x20759f=_0x20759f||0x1f4;return function(_0x3b0f66){logger[_0xbca2('0xb')](_0x3b0f66[_0xbca2('0xc')]);if(_0x3b0f66[_0xbca2('0xd')]){delete _0x3b0f66[_0xbca2('0xd')];}_0x1a2639[_0xbca2('0xe')](_0x20759f)['send'](_0x3b0f66);};}exports[_0xbca2('0xf')]=function(_0xa00fad,_0x3bfc3d){if(_0xa00fad[_0xbca2('0x10')][_0xbca2('0x11')]!==_0xbca2('0x12'))throw new Error(_0xbca2('0x13'));if(isNaN(Number(_0xa00fad[_0xbca2('0x14')]['id'])))throw new Error(_0xbca2('0x15'));return db['UserSetting']['find']({'where':{'id':_0xa00fad[_0xbca2('0x14')]['id']}})[_0xbca2('0x9')](handleEntityNotFound(_0x3bfc3d,null))['then'](saveUpdates(_0xa00fad[_0xbca2('0x16')],null))[_0xbca2('0x9')](respondWithResult(_0x3bfc3d,null))[_0xbca2('0x17')](handleError(_0x3bfc3d,null));};
\ No newline at end of file
index 917a283..bece58b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf446=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserSetting','setMaxListeners','save','update'];(function(_0x228657,_0x4d1486){var _0x2153c4=function(_0x4131a3){while(--_0x4131a3){_0x228657['push'](_0x228657['shift']());}};_0x2153c4(++_0x4d1486);}(_0xf446,0xb5));var _0x6f44=function(_0x44db7c,_0x76e23){_0x44db7c=_0x44db7c-0x0;var _0x3bff02=_0xf446[_0x44db7c];return _0x3bff02;};'use strict';var EventEmitter=require(_0x6f44('0x0'));var UserSetting=require(_0x6f44('0x1'))['db'][_0x6f44('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x6f44('0x3')](0x0);var events={'afterCreate':_0x6f44('0x4'),'afterUpdate':_0x6f44('0x5'),'afterDestroy':_0x6f44('0x6')};function emitEvent(_0x2eeda8){return function(_0x3ab252,_0x418f7d,_0x2fd593){UserSettingEvents[_0x6f44('0x7')](_0x2eeda8+':'+_0x3ab252['id'],_0x3ab252);UserSettingEvents['emit'](_0x2eeda8,_0x3ab252);_0x2fd593(null);};}for(var e in events){if(events[_0x6f44('0x8')](e)){var event=events[e];UserSetting[_0x6f44('0x9')](e,emitEvent(event));}}module[_0x6f44('0xa')]=UserSettingEvents;
\ No newline at end of file
+var _0x8c27=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x167542,_0x9dc2b4){var _0x31727f=function(_0x20595a){while(--_0x20595a){_0x167542['push'](_0x167542['shift']());}};_0x31727f(++_0x9dc2b4);}(_0x8c27,0x92));var _0x78c2=function(_0x188bcd,_0x52f234){_0x188bcd=_0x188bcd-0x0;var _0x3c4e5b=_0x8c27[_0x188bcd];return _0x3c4e5b;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x78c2('0x0'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x78c2('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x78c2('0x2'),'afterDestroy':_0x78c2('0x3')};function emitEvent(_0xc3f52c){return function(_0x477ed3,_0x4fcec6,_0x491eb9){UserSettingEvents[_0x78c2('0x4')](_0xc3f52c+':'+_0x477ed3['id'],_0x477ed3);UserSettingEvents[_0x78c2('0x4')](_0xc3f52c,_0x477ed3);_0x491eb9(null);};}for(var e in events){if(events[_0x78c2('0x5')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x78c2('0x6')]=UserSettingEvents;
\ No newline at end of file
index 0edc2e1..044351f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43c8=['clientSideLoggingEnabledSince','exports','define','UserSetting','user_settings','clientSideLoggingEnabled'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x43c8,0xaf));var _0x843c=function(_0xb66224,_0x3a3f2f){_0xb66224=_0xb66224-0x0;var _0x346365=_0x43c8[_0xb66224];return _0x346365;};'use strict';var attributes=require('./user-setting.attributes');module[_0x843c('0x0')]=function(_0x5e8751){return _0x5e8751[_0x843c('0x1')](_0x843c('0x2'),attributes,{'tableName':_0x843c('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x302fdb){if(!_0x302fdb[_0x843c('0x4')])_0x302fdb[_0x843c('0x5')]=null;else if(_0x302fdb[_0x843c('0x5')]===null)_0x302fdb['clientSideLoggingEnabledSince']=new Date();}}});};
\ No newline at end of file
+var _0x9c00=['clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports','UserSetting','user_settings'];(function(_0x8d5821,_0x2d2ef3){var _0x29ef7c=function(_0x2f9ea1){while(--_0x2f9ea1){_0x8d5821['push'](_0x8d5821['shift']());}};_0x29ef7c(++_0x2d2ef3);}(_0x9c00,0x1a0));var _0x09c0=function(_0x407e38,_0x30e1cb){_0x407e38=_0x407e38-0x0;var _0x996a91=_0x9c00[_0x407e38];return _0x996a91;};'use strict';var attributes=require(_0x09c0('0x0'));module[_0x09c0('0x1')]=function(_0x4dff21){return _0x4dff21['define'](_0x09c0('0x2'),attributes,{'tableName':_0x09c0('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5d1967){if(!_0x5d1967[_0x09c0('0x4')])_0x5d1967[_0x09c0('0x5')]=null;else if(_0x5d1967[_0x09c0('0x5')]===null)_0x5d1967[_0x09c0('0x5')]=new Date();}}});};
\ No newline at end of file
index a05f92f..1921162 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47e4=['length','./user-setting.events','save','remove','update','user-setting:update','emit','UserId','register'];(function(_0x3c6971,_0x2580ee){var _0x18622d=function(_0x5454ab){while(--_0x5454ab){_0x3c6971['push'](_0x3c6971['shift']());}};_0x18622d(++_0x2580ee);}(_0x47e4,0x196));var _0x447e=function(_0x13915f,_0x3d90c6){_0x13915f=_0x13915f-0x0;var _0x373181=_0x47e4[_0x13915f];return _0x373181;};'use strict';var UserSettingEvents=require(_0x447e('0x0'));var events=[_0x447e('0x1'),_0x447e('0x2'),_0x447e('0x3')];function createListener(_0x3c68c2,_0x1901ee){return function(_0x3cbe74){_0x1901ee['emit'](_0x3c68c2,_0x3cbe74);if(_0x3c68c2===_0x447e('0x4')){_0x1901ee[_0x447e('0x5')]('user-setting:update:user-'+_0x3cbe74[_0x447e('0x6')],_0x3cbe74);}};}exports[_0x447e('0x7')]=function(_0x327e4d){for(var _0x28b094=0x0,_0x3c1121=events[_0x447e('0x8')];_0x28b094<_0x3c1121;_0x28b094++){var _0x19e14a=events[_0x28b094];var _0x4234b4=createListener('user-setting:'+_0x19e14a,_0x327e4d);UserSettingEvents['on'](_0x19e14a,_0x4234b4);}};
\ No newline at end of file
+var _0x9d7c=['./user-setting.events','remove','update','emit','user-setting:update','UserId','length'];(function(_0x1b8813,_0x58ed59){var _0x514c1a=function(_0x1ff255){while(--_0x1ff255){_0x1b8813['push'](_0x1b8813['shift']());}};_0x514c1a(++_0x58ed59);}(_0x9d7c,0x1dc));var _0xc9d7=function(_0x46361e,_0x243aaf){_0x46361e=_0x46361e-0x0;var _0x14e302=_0x9d7c[_0x46361e];return _0x14e302;};'use strict';var UserSettingEvents=require(_0xc9d7('0x0'));var events=['save',_0xc9d7('0x1'),_0xc9d7('0x2')];function createListener(_0x151e9d,_0x101704){return function(_0x4204a8){_0x101704[_0xc9d7('0x3')](_0x151e9d,_0x4204a8);if(_0x151e9d===_0xc9d7('0x4')){_0x101704[_0xc9d7('0x3')]('user-setting:update:user-'+_0x4204a8[_0xc9d7('0x5')],_0x4204a8);}};}exports['register']=function(_0x26610b){for(var _0x29c0d5=0x0,_0x3e9e42=events[_0xc9d7('0x6')];_0x29c0d5<_0x3e9e42;_0x29c0d5++){var _0x3e1ded=events[_0x29c0d5];var _0x1aea9a=createListener('user-setting:'+_0x3e1ded,_0x26610b);UserSettingEvents['on'](_0x3e1ded,_0x1aea9a);}};
\ No newline at end of file
index a32a3a1..ae04a3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95f0=['getContacts','getQueues','/:id/queues_rt','/:id/groups','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','getOpenchannelInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','getScheduledCalls','/:id/api_key','post','create','addQueues','diskStorage','join','server/files/images/','format','now','originalname','single','file','addAvatar','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/fax_interactions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','/:id','/:id/password','changePassword','delete','/:id/queues','removeQueues','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','/:id/openchannel_accounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','path','connect-timeout','express','fs-extra','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','/presence','getPresence','show','/:id/avatar','getOpenTabs','/:id/contacts'];(function(_0x104158,_0x23c876){var _0x2cd851=function(_0x1ed64d){while(--_0x1ed64d){_0x104158['push'](_0x104158['shift']());}};_0x2cd851(++_0x23c876);}(_0x95f0,0xc0));var _0x095f=function(_0x3d12b6,_0x719b03){_0x3d12b6=_0x3d12b6-0x0;var _0x63b76=_0x95f0[_0x3d12b6];return _0x63b76;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x095f('0x0'));var timeout=require(_0x095f('0x1'));var express=require(_0x095f('0x2'));var router=express['Router']();var fs_extra=require(_0x095f('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x095f('0x4'));var controller=require(_0x095f('0x5'));router[_0x095f('0x6')]('/',auth[_0x095f('0x7')](),controller[_0x095f('0x8')]);router['get'](_0x095f('0x9'),auth[_0x095f('0x7')](),controller[_0x095f('0xa')]);router[_0x095f('0x6')]('/whoami',auth['isAuthenticated'](),controller[_0x095f('0xb')]);router['get'](_0x095f('0xc'),auth['isAuthenticated'](),controller[_0x095f('0xd')]);router[_0x095f('0x6')]('/:id',auth[_0x095f('0x7')](),controller[_0x095f('0xe')]);router[_0x095f('0x6')](_0x095f('0xf'),controller['getAvatar']);router[_0x095f('0x6')]('/:id/open_tabs',auth[_0x095f('0x7')](),controller[_0x095f('0x10')]);router[_0x095f('0x6')](_0x095f('0x11'),auth[_0x095f('0x7')](),controller[_0x095f('0x12')]);router['get']('/:id/queues',auth['isAuthenticated'](),controller[_0x095f('0x13')]);router[_0x095f('0x6')](_0x095f('0x14'),auth[_0x095f('0x7')](),controller['getVoiceQueuesRt']);router[_0x095f('0x6')](_0x095f('0x15'),auth[_0x095f('0x7')](),controller[_0x095f('0x16')]);router['get']('/:id/recordings',auth[_0x095f('0x7')](),controller[_0x095f('0x17')]);router[_0x095f('0x6')](_0x095f('0x18'),auth[_0x095f('0x7')](),controller[_0x095f('0x19')]);router['get']('/:id/chat/interactions',auth['isAuthenticated'](),controller[_0x095f('0x1a')]);router[_0x095f('0x6')]('/:id/openchannel/interactions',auth[_0x095f('0x7')](),controller[_0x095f('0x1b')]);router[_0x095f('0x6')]('/:id/mail/interactions',auth['isAuthenticated'](),controller['getMailInteractions']);router[_0x095f('0x6')]('/:id/sms/interactions',auth[_0x095f('0x7')](),controller[_0x095f('0x1c')]);router[_0x095f('0x6')](_0x095f('0x1d'),auth[_0x095f('0x7')](),controller[_0x095f('0x1e')]);router[_0x095f('0x6')](_0x095f('0x1f'),auth[_0x095f('0x7')](),controller[_0x095f('0x20')]);router[_0x095f('0x6')](_0x095f('0x21'),auth[_0x095f('0x7')](),controller[_0x095f('0x22')]);router[_0x095f('0x6')]('/:id/lists',auth[_0x095f('0x7')](),controller[_0x095f('0x23')]);router['get'](_0x095f('0x24'),auth[_0x095f('0x7')](),controller[_0x095f('0x25')]);router[_0x095f('0x6')](_0x095f('0x26'),auth['isAuthenticated'](),controller[_0x095f('0x27')]);router[_0x095f('0x6')](_0x095f('0x28'),auth[_0x095f('0x7')](),controller['getFaxAccounts']);router['get'](_0x095f('0x29'),auth[_0x095f('0x7')](),controller[_0x095f('0x2a')]);router[_0x095f('0x6')]('/:id/openchannel_accounts',auth[_0x095f('0x7')](),controller[_0x095f('0x2b')]);router[_0x095f('0x6')](_0x095f('0x2c'),auth['isAuthenticated'](),controller[_0x095f('0x2d')]);router[_0x095f('0x6')](_0x095f('0x2e'),auth[_0x095f('0x7')](),controller[_0x095f('0x2f')]);router['get'](_0x095f('0x30'),auth[_0x095f('0x7')](),controller[_0x095f('0x31')]);router[_0x095f('0x6')](_0x095f('0x32'),auth[_0x095f('0x7')](),controller[_0x095f('0x33')]);router['get']('/:id/scheduled_calls',auth[_0x095f('0x7')](),controller[_0x095f('0x34')]);router['get'](_0x095f('0x35'),auth[_0x095f('0x7')](),controller['getApiKey']);router[_0x095f('0x36')]('/:id/contacts',auth['isAuthenticated'](),controller['addContacts']);router[_0x095f('0x36')]('/',auth[_0x095f('0x7')](),controller[_0x095f('0x37')]);router[_0x095f('0x36')]('/create_many',auth['isAuthenticated'](),controller['bulkCreate']);router[_0x095f('0x36')]('/:id/queues',auth[_0x095f('0x7')](),controller[_0x095f('0x38')]);var upload=multer({'storage':multer[_0x095f('0x39')]({'destination':function(_0x41f592,_0x5e61bf,_0x3257d0){_0x3257d0(null,path[_0x095f('0x3a')](config['root'],_0x095f('0x3b')));},'filename':function(_0x5c7b25,_0x3731d0,_0x19aaec){_0x19aaec(null,util[_0x095f('0x3c')]('%s-%s',Date[_0x095f('0x3d')](),_0x3731d0[_0x095f('0x3e')]));}})});router[_0x095f('0x36')]('/:id/avatar',upload[_0x095f('0x3f')](_0x095f('0x40')),controller[_0x095f('0x41')]);router['post']('/:id/login',auth[_0x095f('0x7')](),controller[_0x095f('0x42')]);router[_0x095f('0x36')](_0x095f('0x43'),auth['isAuthenticated'](),controller['logout']);router[_0x095f('0x36')](_0x095f('0x44'),auth[_0x095f('0x7')](),controller[_0x095f('0x45')]);router['post'](_0x095f('0x46'),auth[_0x095f('0x7')](),controller[_0x095f('0x47')]);router['post']('/:id/teams',auth[_0x095f('0x7')](),controller[_0x095f('0x48')]);router['post'](_0x095f('0x49'),auth[_0x095f('0x7')](),controller[_0x095f('0x4a')]);router['post']('/:id/mail_interactions',auth['isAuthenticated'](),controller['addMailInteractions']);router[_0x095f('0x36')](_0x095f('0x4b'),auth[_0x095f('0x7')](),controller['addFaxInteractions']);router[_0x095f('0x36')](_0x095f('0x4c'),auth[_0x095f('0x7')](),controller['addSmsInteractions']);router[_0x095f('0x36')](_0x095f('0x4d'),auth[_0x095f('0x7')](),controller[_0x095f('0x4e')]);router['post'](_0x095f('0x4f'),auth[_0x095f('0x7')](),controller[_0x095f('0x50')]);router[_0x095f('0x36')](_0x095f('0x28'),auth[_0x095f('0x7')](),controller['addFaxAccounts']);router['post']('/:id/mail_accounts',auth[_0x095f('0x7')](),controller['addMailAccounts']);router[_0x095f('0x36')]('/:id/openchannel_accounts',auth[_0x095f('0x7')](),controller[_0x095f('0x51')]);router[_0x095f('0x36')](_0x095f('0x2c'),auth[_0x095f('0x7')](),controller[_0x095f('0x52')]);router['post'](_0x095f('0x2e'),auth[_0x095f('0x7')](),controller[_0x095f('0x53')]);router[_0x095f('0x36')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x095f('0x54')]);router[_0x095f('0x36')]('/:id/square_projects',auth[_0x095f('0x7')](),controller[_0x095f('0x55')]);router['post'](_0x095f('0x35'),auth[_0x095f('0x7')](),controller['createApiKey']);router['put'](_0x095f('0x56'),auth[_0x095f('0x7')](),controller['update']);router['put'](_0x095f('0x57'),auth[_0x095f('0x7')](),controller[_0x095f('0x58')]);router[_0x095f('0x59')](_0x095f('0x5a'),auth[_0x095f('0x7')](),controller[_0x095f('0x5b')]);router[_0x095f('0x59')](_0x095f('0x21'),auth[_0x095f('0x7')](),controller['removeTeams']);router[_0x095f('0x59')](_0x095f('0x56'),auth[_0x095f('0x7')](),controller['destroy']);router[_0x095f('0x59')]('/:id/chat_interactions',auth['isAuthenticated'](),controller['removeChatInteractions']);router[_0x095f('0x59')](_0x095f('0x5c'),auth[_0x095f('0x7')](),controller[_0x095f('0x5d')]);router[_0x095f('0x59')](_0x095f('0x4b'),auth[_0x095f('0x7')](),controller[_0x095f('0x5e')]);router['delete'](_0x095f('0x4c'),auth['isAuthenticated'](),controller[_0x095f('0x5f')]);router[_0x095f('0x59')](_0x095f('0x4d'),auth[_0x095f('0x7')](),controller[_0x095f('0x60')]);router[_0x095f('0x59')](_0x095f('0x4f'),auth[_0x095f('0x7')](),controller['removeWhatsappInteractions']);router['delete'](_0x095f('0x28'),auth['isAuthenticated'](),controller[_0x095f('0x61')]);router['delete'](_0x095f('0x29'),auth[_0x095f('0x7')](),controller['removeMailAccounts']);router['delete'](_0x095f('0x62'),auth[_0x095f('0x7')](),controller[_0x095f('0x63')]);router[_0x095f('0x59')](_0x095f('0x2c'),auth[_0x095f('0x7')](),controller[_0x095f('0x64')]);router[_0x095f('0x59')]('/:id/chat_websites',auth[_0x095f('0x7')](),controller[_0x095f('0x65')]);router['delete'](_0x095f('0x30'),auth[_0x095f('0x7')](),controller[_0x095f('0x66')]);router[_0x095f('0x59')](_0x095f('0x32'),auth['isAuthenticated'](),controller[_0x095f('0x67')]);router['delete'](_0x095f('0x35'),auth[_0x095f('0x7')](),controller[_0x095f('0x68')]);module['exports']=router;
\ No newline at end of file
+var _0x2931=['addWhatsappAccounts','addSquareProjects','createApiKey','put','update','changePassword','delete','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','/:id/api_key','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/whoami','whoami','getPresence','/:id','show','getAvatar','getOpenTabs','/:id/contacts','getContacts','getQueues','/:id/queues_rt','/:id/groups','getGroups','/:id/recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getApiKey','post','addContacts','create','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','root','format','%s-%s','now','originalname','/:id/avatar','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts'];(function(_0x4a23c8,_0xef8868){var _0x18ca31=function(_0x25f83a){while(--_0x25f83a){_0x4a23c8['push'](_0x4a23c8['shift']());}};_0x18ca31(++_0xef8868);}(_0x2931,0x171));var _0x1293=function(_0x4ee172,_0x25bd58){_0x4ee172=_0x4ee172-0x0;var _0x4e0ec8=_0x2931[_0x4ee172];return _0x4e0ec8;};'use strict';var multer=require('multer');var util=require(_0x1293('0x0'));var path=require(_0x1293('0x1'));var timeout=require(_0x1293('0x2'));var express=require(_0x1293('0x3'));var router=express[_0x1293('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1293('0x5'));var interaction=require(_0x1293('0x6'));var config=require(_0x1293('0x7'));var controller=require('./user.controller');router['get']('/',auth[_0x1293('0x8')](),controller[_0x1293('0x9')]);router['get'](_0x1293('0xa'),auth['isAuthenticated'](),controller[_0x1293('0xb')]);router[_0x1293('0xc')](_0x1293('0xd'),auth[_0x1293('0x8')](),controller[_0x1293('0xe')]);router['get']('/presence',auth[_0x1293('0x8')](),controller[_0x1293('0xf')]);router[_0x1293('0xc')](_0x1293('0x10'),auth['isAuthenticated'](),controller[_0x1293('0x11')]);router['get']('/:id/avatar',controller[_0x1293('0x12')]);router[_0x1293('0xc')]('/:id/open_tabs',auth[_0x1293('0x8')](),controller[_0x1293('0x13')]);router['get'](_0x1293('0x14'),auth['isAuthenticated'](),controller[_0x1293('0x15')]);router[_0x1293('0xc')]('/:id/queues',auth['isAuthenticated'](),controller[_0x1293('0x16')]);router[_0x1293('0xc')](_0x1293('0x17'),auth[_0x1293('0x8')](),controller['getVoiceQueuesRt']);router[_0x1293('0xc')](_0x1293('0x18'),auth[_0x1293('0x8')](),controller[_0x1293('0x19')]);router[_0x1293('0xc')](_0x1293('0x1a'),auth[_0x1293('0x8')](),controller['getRecordings']);router[_0x1293('0xc')]('/:id/screen_recordings',auth[_0x1293('0x8')](),controller['getScreenRecordings']);router[_0x1293('0xc')](_0x1293('0x1b'),auth[_0x1293('0x8')](),controller[_0x1293('0x1c')]);router[_0x1293('0xc')](_0x1293('0x1d'),auth['isAuthenticated'](),controller[_0x1293('0x1e')]);router[_0x1293('0xc')]('/:id/mail/interactions',auth[_0x1293('0x8')](),controller[_0x1293('0x1f')]);router[_0x1293('0xc')](_0x1293('0x20'),auth[_0x1293('0x8')](),controller[_0x1293('0x21')]);router[_0x1293('0xc')](_0x1293('0x22'),auth[_0x1293('0x8')](),controller[_0x1293('0x23')]);router[_0x1293('0xc')](_0x1293('0x24'),auth[_0x1293('0x8')](),controller[_0x1293('0x25')]);router[_0x1293('0xc')](_0x1293('0x26'),auth[_0x1293('0x8')](),controller['getTeams']);router[_0x1293('0xc')](_0x1293('0x27'),auth['isAuthenticated'](),controller[_0x1293('0x28')]);router[_0x1293('0xc')](_0x1293('0x29'),auth[_0x1293('0x8')](),controller[_0x1293('0x2a')]);router[_0x1293('0xc')](_0x1293('0x2b'),auth[_0x1293('0x8')](),controller['getVoicePrefixes']);router[_0x1293('0xc')](_0x1293('0x2c'),auth[_0x1293('0x8')](),controller[_0x1293('0x2d')]);router['get'](_0x1293('0x2e'),auth[_0x1293('0x8')](),controller[_0x1293('0x2f')]);router[_0x1293('0xc')](_0x1293('0x30'),auth[_0x1293('0x8')](),controller[_0x1293('0x31')]);router[_0x1293('0xc')](_0x1293('0x32'),auth[_0x1293('0x8')](),controller[_0x1293('0x33')]);router['get'](_0x1293('0x34'),auth[_0x1293('0x8')](),controller[_0x1293('0x35')]);router[_0x1293('0xc')]('/:id/whatsapp_accounts',auth[_0x1293('0x8')](),controller['getWhatsappAccounts']);router[_0x1293('0xc')](_0x1293('0x36'),auth[_0x1293('0x8')](),controller[_0x1293('0x37')]);router[_0x1293('0xc')](_0x1293('0x38'),auth[_0x1293('0x8')](),controller['getScheduledCalls']);router[_0x1293('0xc')]('/:id/api_key',auth[_0x1293('0x8')](),controller[_0x1293('0x39')]);router[_0x1293('0x3a')](_0x1293('0x14'),auth[_0x1293('0x8')](),controller[_0x1293('0x3b')]);router[_0x1293('0x3a')]('/',auth[_0x1293('0x8')](),controller[_0x1293('0x3c')]);router[_0x1293('0x3a')](_0x1293('0x3d'),auth[_0x1293('0x8')](),controller[_0x1293('0x3e')]);router[_0x1293('0x3a')](_0x1293('0x3f'),auth[_0x1293('0x8')](),controller[_0x1293('0x40')]);var upload=multer({'storage':multer[_0x1293('0x41')]({'destination':function(_0x47be8c,_0x3e26f0,_0x9a340b){_0x9a340b(null,path['join'](config[_0x1293('0x42')],'server/files/images/'));},'filename':function(_0x5192c4,_0x3d9b34,_0x1f5f30){_0x1f5f30(null,util[_0x1293('0x43')](_0x1293('0x44'),Date[_0x1293('0x45')](),_0x3d9b34[_0x1293('0x46')]));}})});router[_0x1293('0x3a')](_0x1293('0x47'),upload[_0x1293('0x48')](_0x1293('0x49')),controller[_0x1293('0x4a')]);router['post'](_0x1293('0x4b'),auth[_0x1293('0x8')](),controller[_0x1293('0x4c')]);router[_0x1293('0x3a')](_0x1293('0x4d'),auth[_0x1293('0x8')](),controller[_0x1293('0x4e')]);router[_0x1293('0x3a')](_0x1293('0x4f'),auth[_0x1293('0x8')](),controller[_0x1293('0x50')]);router[_0x1293('0x3a')](_0x1293('0x51'),auth[_0x1293('0x8')](),controller[_0x1293('0x52')]);router['post'](_0x1293('0x26'),auth[_0x1293('0x8')](),controller[_0x1293('0x53')]);router[_0x1293('0x3a')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x1293('0x54')]);router['post'](_0x1293('0x55'),auth[_0x1293('0x8')](),controller[_0x1293('0x56')]);router[_0x1293('0x3a')](_0x1293('0x57'),auth[_0x1293('0x8')](),controller['addFaxInteractions']);router[_0x1293('0x3a')](_0x1293('0x58'),auth[_0x1293('0x8')](),controller[_0x1293('0x59')]);router['post'](_0x1293('0x5a'),auth[_0x1293('0x8')](),controller['addOpenchannelInteractions']);router[_0x1293('0x3a')](_0x1293('0x5b'),auth[_0x1293('0x8')](),controller[_0x1293('0x5c')]);router[_0x1293('0x3a')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x1293('0x5d')]);router[_0x1293('0x3a')]('/:id/mail_accounts',auth[_0x1293('0x8')](),controller[_0x1293('0x5e')]);router['post'](_0x1293('0x30'),auth[_0x1293('0x8')](),controller[_0x1293('0x5f')]);router[_0x1293('0x3a')]('/:id/sms_accounts',auth[_0x1293('0x8')](),controller[_0x1293('0x60')]);router[_0x1293('0x3a')](_0x1293('0x34'),auth[_0x1293('0x8')](),controller[_0x1293('0x61')]);router[_0x1293('0x3a')](_0x1293('0x62'),auth['isAuthenticated'](),controller[_0x1293('0x63')]);router[_0x1293('0x3a')](_0x1293('0x36'),auth[_0x1293('0x8')](),controller[_0x1293('0x64')]);router['post']('/:id/api_key',auth[_0x1293('0x8')](),controller[_0x1293('0x65')]);router[_0x1293('0x66')](_0x1293('0x10'),auth['isAuthenticated'](),controller[_0x1293('0x67')]);router['put']('/:id/password',auth[_0x1293('0x8')](),controller[_0x1293('0x68')]);router['delete'](_0x1293('0x3f'),auth[_0x1293('0x8')](),controller['removeQueues']);router[_0x1293('0x69')](_0x1293('0x26'),auth[_0x1293('0x8')](),controller[_0x1293('0x6a')]);router[_0x1293('0x69')](_0x1293('0x10'),auth[_0x1293('0x8')](),controller[_0x1293('0x6b')]);router[_0x1293('0x69')](_0x1293('0x6c'),auth[_0x1293('0x8')](),controller[_0x1293('0x6d')]);router['delete'](_0x1293('0x55'),auth[_0x1293('0x8')](),controller[_0x1293('0x6e')]);router[_0x1293('0x69')](_0x1293('0x57'),auth[_0x1293('0x8')](),controller[_0x1293('0x6f')]);router[_0x1293('0x69')]('/:id/sms_interactions',auth[_0x1293('0x8')](),controller['removeSmsInteractions']);router[_0x1293('0x69')](_0x1293('0x5a'),auth[_0x1293('0x8')](),controller['removeOpenchannelInteractions']);router[_0x1293('0x69')](_0x1293('0x5b'),auth[_0x1293('0x8')](),controller[_0x1293('0x70')]);router['delete']('/:id/fax_accounts',auth[_0x1293('0x8')](),controller[_0x1293('0x71')]);router[_0x1293('0x69')](_0x1293('0x2e'),auth['isAuthenticated'](),controller[_0x1293('0x72')]);router[_0x1293('0x69')](_0x1293('0x30'),auth[_0x1293('0x8')](),controller['removeOpenchannelAccounts']);router[_0x1293('0x69')]('/:id/sms_accounts',auth['isAuthenticated'](),controller['removeSmsAccounts']);router[_0x1293('0x69')]('/:id/chat_websites',auth['isAuthenticated'](),controller['removeChatWebsites']);router['delete'](_0x1293('0x62'),auth[_0x1293('0x8')](),controller['removeWhatsappAccounts']);router[_0x1293('0x69')](_0x1293('0x36'),auth[_0x1293('0x8')](),controller['removeSquareProjects']);router[_0x1293('0x69')](_0x1293('0x73'),auth[_0x1293('0x8')](),controller['removeApiKey']);module[_0x1293('0x74')]=router;
\ No newline at end of file
index acc8096..f198927 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['refuse','originate','uac','uas','fingerprint','update,nonat','TEXT','showWebBar','get','isArray','wss','udp','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','BOOLEAN','DATE','dynamic','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','join','transport','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept'];(function(_0x3e555e,_0x303613){var _0x25cc88=function(_0x38a46e){while(--_0x38a46e){_0x3e555e['push'](_0x3e555e['shift']());}};_0x25cc88(++_0x303613);}(_0x70e0,0x17b));var _0x070e=function(_0x51ffcc,_0x4a9139){_0x51ffcc=_0x51ffcc-0x0;var _0x53bad1=_0x70e0[_0x51ffcc];return _0x53bad1;};'use strict';var Sequelize=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var util=require(_0x070e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'unique':_0x070e('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x277d32){this[_0x070e('0x5')]('name',_0x277d32);this[_0x070e('0x5')]('defaultuser',_0x277d32);},'comment':_0x070e('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x56e420){this['setDataValue'](_0x070e('0x7'),_0x56e420);this[_0x070e('0x5')](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),_0x56e420,this[_0x070e('0xb')](_0x070e('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x070e('0xd'),'validate':{'isEmail':!![]},'set':function(_0x2e3e5e){if(_0x2e3e5e){this[_0x070e('0x5')](_0x070e('0xd'),_0x2e3e5e[_0x070e('0xe')]());}}},'role':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x10'),_0x070e('0x11'),_0x070e('0x12'),_0x070e('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x4a33d2){this['setDataValue'](_0x070e('0xc'),_0x4a33d2);this[_0x070e('0x5')]('accountcode',_0x4a33d2);this['setDataValue'](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),this[_0x070e('0xb')]('fullname'),_0x4a33d2));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x070e('0x3')]},'mobile':{'type':Sequelize[_0x070e('0x3')]},'address':{'type':Sequelize[_0x070e('0x3')]},'zipcode':{'type':Sequelize[_0x070e('0x3')]},'userpic':{'type':Sequelize[_0x070e('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x070e('0x3')]},'online':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x070e('0x16')]},'voicePause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x070e('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x070e('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x17')},'ipaddr':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x070e('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x18'),_0x070e('0x11'),_0x070e('0x19')),'allowNull':!![],'defaultValue':_0x070e('0x18')},'context':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x1a'),_0x070e('0x1b'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x070e('0x1c'),_0x070e('0x1d'),_0x070e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x59c5b4){this[_0x070e('0x5')]('transport',_0x59c5b4?_0x59c5b4[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')]('transport')?this['getDataValue'](_0x070e('0x20'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x070e('0x22'),_0x070e('0x23'),_0x070e('0x24'),_0x070e('0x25'),_0x070e('0x26')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x28'),_0x070e('0x29'),_0x070e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x2b'),'set':function(_0x34746e){this['setDataValue']('nat',_0x34746e?_0x34746e['join'](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2c'))?this[_0x070e('0xb')](_0x070e('0x2c'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x070e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x070e('0x3')]},'pickupgroup':{'type':Sequelize[_0x070e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x070e('0x3')]},'disallow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':_0x070e('0x2d'),'set':function(_0x4800a9){this[_0x070e('0x5')]('allow',_0x4800a9?_0x4800a9[_0x070e('0x1f')](';'):_0x070e('0x2d'));},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2e'))?this[_0x070e('0xb')]('allow')[_0x070e('0x21')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'set':function(_0x38879f){this['setDataValue'](_0x070e('0x2f'),_0x38879f?_0x38879f[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2f'))?this['getDataValue'](_0x070e('0x2f'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x30')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x31')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x32'),_0x070e('0x33'),_0x070e('0x34')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x35'),'uas'),'allowNull':!![],'defaultValue':_0x070e('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'keepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x37'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x070e('0xf')]('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x28'),'update',_0x070e('0x38')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x070e('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x070e('0x39')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x4cb86f){this['setDataValue'](_0x070e('0x3a'),_0x4cb86f);var _0x1ae5cb=this[_0x070e('0x3b')]({'plain':!![]});switch(_0x4cb86f){case 0x0:case 0x1:var _0x122198=_0x1ae5cb[_0x070e('0x20')]?_[_0x070e('0x3c')](_0x1ae5cb['transport'])?_0x1ae5cb[_0x070e('0x20')]['join']():_0x1ae5cb[_0x070e('0x20')]:'udp';if(_0x122198===_0x070e('0x3d')){_0x122198=_0x070e('0x3e');}this['setDataValue'](_0x070e('0x20'),_0x122198);this['setDataValue'](_0x070e('0x3f'),'no');this[_0x070e('0x5')](_0x070e('0x40'),null);this[_0x070e('0x5')](_0x070e('0x41'),null);this[_0x070e('0x5')](_0x070e('0x42'),null);this[_0x070e('0x5')](_0x070e('0x43'),null);this[_0x070e('0x5')](_0x070e('0x44'),null);this[_0x070e('0x5')](_0x070e('0x45'),null);this[_0x070e('0x5')]('dtlscertfile',null);this[_0x070e('0x5')](_0x070e('0x46'),null);this[_0x070e('0x5')](_0x070e('0x47'),'no');break;case 0x2:this['setDataValue'](_0x070e('0x20'),_0x070e('0x3d'));this[_0x070e('0x5')](_0x070e('0x3f'),_0x070e('0x27'));this[_0x070e('0x5')]('avpf',_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x41'),_0x070e('0x27'));this['setDataValue'](_0x070e('0x42'),'yes');this[_0x070e('0x5')](_0x070e('0x43'),_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x44'),'no');this['setDataValue'](_0x070e('0x45'),_0x070e('0x48'));this[_0x070e('0x5')](_0x070e('0x49'),_0x1ae5cb['dtlscertfile']||_0x070e('0x4a'));this['setDataValue'](_0x070e('0x46'),_0x1ae5cb[_0x070e('0x46')]||_0x070e('0x4b'));this['setDataValue'](_0x070e('0x47'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x070e('0x39')],'set':function(_0x5ce157){this[_0x070e('0x5')](_0x070e('0x4c'),_0x5ce157?_0x5ce157['join'](','):[]);},'get':function(){return this[_0x070e('0xb')]('permissions')?_[_0x070e('0x4d')](this[_0x070e('0xb')]('permissions')['split'](','),function(_0x29ee66){return parseInt(_0x29ee66,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x070e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x070e('0x4e')],'get':function(){return this[_0x070e('0xb')](_0x070e('0x4f'))?this[_0x070e('0xb')](_0x070e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x070e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4f720f){if(typeof _0x4f720f==='string'){var _0x1624cd=_0x4f720f==='1'?!![]:_0x4f720f==='0'?![]:_0x4f720f===_0x070e('0x50')?!![]:_0x4f720f===_0x070e('0x51')?![]:![];this[_0x070e('0x5')]('screenrecording',_0x1624cd);}else{this[_0x070e('0x5')](_0x070e('0x52'),_0x4f720f);}}},'blocked':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![],'set':function(_0xd74f9c){this[_0x070e('0x5')](_0x070e('0x53'),_0xd74f9c);if(_0xd74f9c===!![]){this['setDataValue'](_0x070e('0x54'),moment());this['setDataValue'](_0x070e('0x55'),0x0);}else{this[_0x070e('0x5')](_0x070e('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x070e('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x070e('0x14')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x9c44=['get','udp','encryption','avpf','force_avp','icesupport','dtlscertfile','dtlsprivatekey','wss','dtlsenable','dtlsverify','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','rtcp_mux','permissions','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','loginAttempts','blockedAt','UNSIGNED','util','lodash','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','email','admin','user','telephone','local','INTEGER','internal','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','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]','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','certificate','active','update,nonat','TEXT'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9c44,0x178));var _0x49c4=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9c44[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var util=require(_0x49c4('0x0'));var _=require(_0x49c4('0x1'));module[_0x49c4('0x2')]={'name':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2ad237){this['setDataValue']('name',_0x2ad237);this[_0x49c4('0x5')]('defaultuser',_0x2ad237);},'comment':_0x49c4('0x6')},'fullname':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'set':function(_0x69bc41){this[_0x49c4('0x5')](_0x49c4('0x7'),_0x69bc41);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),_0x69bc41,this[_0x49c4('0xb')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'unique':_0x49c4('0xc'),'validate':{'isEmail':!![]},'set':function(_0x58cad7){if(_0x58cad7){this[_0x49c4('0x5')](_0x49c4('0xc'),_0x58cad7['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x49c4('0xd'),_0x49c4('0xe'),'agent',_0x49c4('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':_0x49c4('0x10')},'internal':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':![],'unique':_0x49c4('0x12'),'set':function(_0x2decee){this[_0x49c4('0x5')](_0x49c4('0x12'),_0x2decee);this[_0x49c4('0x5')](_0x49c4('0x13'),_0x2decee);this['setDataValue'](_0x49c4('0x8'),util[_0x49c4('0x9')](_0x49c4('0xa'),this[_0x49c4('0xb')](_0x49c4('0x7')),_0x2decee));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x49c4('0x3')]},'mobile':{'type':Sequelize[_0x49c4('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x49c4('0x3')]},'city':{'type':Sequelize[_0x49c4('0x3')]},'country':{'type':Sequelize[_0x49c4('0x3')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x49c4('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':_0x49c4('0x16')},'lastPauseAt':{'type':Sequelize[_0x49c4('0x14')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x49c4('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x17')},'ipaddr':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x19'),'user',_0x49c4('0x1a')),'allowNull':!![],'defaultValue':_0x49c4('0x19')},'context':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x1b')},'callingpres':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x1c'),_0x49c4('0x1d'),_0x49c4('0x1e'),_0x49c4('0x1f'),_0x49c4('0x20'),_0x49c4('0x21'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':'udp','set':function(_0x38ad77){this[_0x49c4('0x5')](_0x49c4('0x22'),_0x38ad77?_0x38ad77[_0x49c4('0x23')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0x49c4('0xb')](_0x49c4('0x22'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x25')},'dtmfmode':{'type':Sequelize[_0x49c4('0x18')]('rfc2833',_0x49c4('0x26'),_0x49c4('0x27'),_0x49c4('0x28'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x49c4('0x2d'),'set':function(_0x5b96df){this[_0x49c4('0x5')](_0x49c4('0x2e'),_0x5b96df?_0x5b96df[_0x49c4('0x23')](','):null);},'get':function(){return this[_0x49c4('0xb')]('nat')?this[_0x49c4('0xb')](_0x49c4('0x2e'))[_0x49c4('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedcallgroup':{'type':Sequelize[_0x49c4('0x3')]},'pickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x49c4('0x3')]},'language':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x49c4('0x3')]},'disallow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x2f')},'allow':{'type':Sequelize[_0x49c4('0x3')],'allowNull':![],'defaultValue':_0x49c4('0x30'),'set':function(_0x1e506a){this['setDataValue'](_0x49c4('0x31'),_0x1e506a?_0x1e506a[_0x49c4('0x23')](';'):_0x49c4('0x30'));},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x31'))?this[_0x49c4('0xb')](_0x49c4('0x31'))[_0x49c4('0x24')](';'):null;},'comment':_0x49c4('0x32')},'autoframing':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'set':function(_0x326142){this['setDataValue'](_0x49c4('0x33'),_0x326142?_0x326142['join'](','):null);},'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x33'))?this[_0x49c4('0xb')](_0x49c4('0x33'))[_0x49c4('0x24')](','):null;},'comment':_0x49c4('0x34')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![],'defaultValue':_0x49c4('0x35')},'amaflags':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x36'),_0x49c4('0x37'),_0x49c4('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x39'),'uas'),'allowNull':!![],'defaultValue':_0x49c4('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x49c4('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x3b'),_0x49c4('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x3d'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x49c4('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x49c4('0x18')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no',_0x49c4('0x2a'),_0x49c4('0x2b'),_0x49c4('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x49c4('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x49c4('0x14')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x49c4('0x3f')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x10dec7){this[_0x49c4('0x5')]('showWebBar',_0x10dec7);var _0x39c455=this[_0x49c4('0x40')]({'plain':!![]});switch(_0x10dec7){case 0x0:case 0x1:var _0x4f50bf=_0x39c455['transport']?_['isArray'](_0x39c455['transport'])?_0x39c455[_0x49c4('0x22')]['join']():_0x39c455[_0x49c4('0x22')]:_0x49c4('0x41');if(_0x4f50bf==='wss'){_0x4f50bf=_0x49c4('0x41');}this[_0x49c4('0x5')]('transport',_0x4f50bf);this[_0x49c4('0x5')](_0x49c4('0x42'),'no');this[_0x49c4('0x5')](_0x49c4('0x43'),null);this['setDataValue'](_0x49c4('0x44'),null);this[_0x49c4('0x5')](_0x49c4('0x45'),null);this[_0x49c4('0x5')]('dtlsenable',null);this[_0x49c4('0x5')]('dtlsverify',null);this['setDataValue']('dtlssetup',null);this['setDataValue'](_0x49c4('0x46'),null);this[_0x49c4('0x5')](_0x49c4('0x47'),null);this[_0x49c4('0x5')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0x49c4('0x22'),_0x49c4('0x48'));this[_0x49c4('0x5')](_0x49c4('0x42'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x43'),_0x49c4('0x29'));this['setDataValue'](_0x49c4('0x44'),'yes');this[_0x49c4('0x5')](_0x49c4('0x45'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x49'),_0x49c4('0x29'));this[_0x49c4('0x5')](_0x49c4('0x4a'),'no');this[_0x49c4('0x5')](_0x49c4('0x4b'),_0x49c4('0x4c'));this[_0x49c4('0x5')](_0x49c4('0x46'),_0x39c455[_0x49c4('0x46')]||_0x49c4('0x4d'));this[_0x49c4('0x5')](_0x49c4('0x47'),_0x39c455[_0x49c4('0x47')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x49c4('0x4e'),_0x49c4('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x1a15f3){this[_0x49c4('0x5')](_0x49c4('0x4f'),_0x1a15f3?_0x1a15f3[_0x49c4('0x23')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this[_0x49c4('0xb')](_0x49c4('0x4f'))[_0x49c4('0x24')](','),function(_0x2f4289){return parseInt(_0x2f4289,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x49c4('0x18')](_0x49c4('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x49c4('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x49c4('0xb')](_0x49c4('0x50'))?this[_0x49c4('0xb')](_0x49c4('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x49c4('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x49c4('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x27b77d){if(typeof _0x27b77d===_0x49c4('0x51')){var _0x34870e=_0x27b77d==='1'?!![]:_0x27b77d==='0'?![]:_0x27b77d==='true'?!![]:_0x27b77d===_0x49c4('0x52')?![]:![];this[_0x49c4('0x5')](_0x49c4('0x53'),_0x34870e);}else{this[_0x49c4('0x5')](_0x49c4('0x53'),_0x27b77d);}}},'blocked':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![],'set':function(_0x38b291){this[_0x49c4('0x5')](_0x49c4('0x54'),_0x38b291);if(_0x38b291===!![]){this[_0x49c4('0x5')]('blockedAt',moment());this[_0x49c4('0x5')](_0x49c4('0x55'),0x0);}else{this['setDataValue'](_0x49c4('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x49c4('0x11')](0x5)[_0x49c4('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x49c4('0x11')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x49c4('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 610b155..c4722c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce58=['removeSquareProjects','getScheduledCalls','$gt','$gte','$lt','$lte','$eq','$not','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','firstName','dialActive','VoiceQueue','CmHopper','getApiKey','retrieveApiKey','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','nonce','token','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','getUserSetting','getPresence','teams','inbound','queues','flatten','lower','toString','asc','desc','uniqBy','orderBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','offline','idle','unavailable','ringing','slice','charAt','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','OpenTabs','util','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','client','http','then','info','User,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','Content-Range','update','emit','userNotification:recalc:','destroy','get','admin','Users','Agents','agent','filter','ignore','role','find','value','name','UserProfileResource','stack','send','index','map','fieldName','type','includes','password','salt','getOptions','User','query','includeAll','include','true','userSetting','attributes','push','findAll','rows','chat','sms','dataValues','fax','mail','openchannel','whatsapp','all','show','model','differenceBy','keys','rawAttributes','filters','fields','UserSetting','merge','body','describe','addContacts','params','ids','omit','internal','Setting','findById','validatePasswordPattern','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','length','from','voicemail','mailbox','fullname','email','permissions','102','103','110','104','105','106','107','108','111','115','Unauthorized','user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','create','VoiceMail','Telephones','autoAssociation','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','telephone','UserProfileSection','isEmpty','compact','changePassword','oldPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','ValidationError','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','newPassword','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','previousPasswords','updatePasswordsHistory','addQueues','online','loginInPause','voicePause','interface','isValidChannel','capitalize','toLowerCase','Queues','penalty','spread','Queue:save','voice','format','SIP/%s','UserVoiceQueueRt','removeQueues','channel','Unknown\x20channel','remove','isArray','QueueId','Queue:remove','userpic','file','filename','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','CmContact','intersection','order','sort','where','pick','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','limit','Queue','options','Unknown\x20role','getVoiceQueuesRt','ChatGroup','getGroups','getRecordings','VoiceRecording','getScreenRecordings','ScreenRecording','UserId','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','remoteAddress','socket','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','PAUSE','concat','LOGININPAUSE','isMiddleware','resolve','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','chatPause','faxPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','%s%s','Pause','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','User\x20with\x20id\x20%s\x20not\x20found','addAgent','getDataValue','Voice','upsert','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','getAssociatedQueues','removeAgent','getLists','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects'];(function(_0x13a107,_0x3b7f40){var _0x272c60=function(_0x22b589){while(--_0x22b589){_0x13a107['push'](_0x13a107['shift']());}};_0x272c60(++_0x3b7f40);}(_0xce58,0x1d3));var _0x8ce5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce58[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x8ce5('0x0'));var path=require(_0x8ce5('0x1'));var fs=require('fs');var _=require(_0x8ce5('0x2'));var squel=require(_0x8ce5('0x3'));var jayson=require(_0x8ce5('0x4'));var Redis=require(_0x8ce5('0x5'));var authService=require(_0x8ce5('0x6'));var qs=require(_0x8ce5('0x7'));var logger=require(_0x8ce5('0x8'))(_0x8ce5('0x9'));var utils=require(_0x8ce5('0xa'));var config=require(_0x8ce5('0xb'));var licenseUtil=require('../../config/license/util');var APIBadRequestError=require(_0x8ce5('0xc'))[_0x8ce5('0xd')];var APINotFoundError=require(_0x8ce5('0xc'))[_0x8ce5('0xe')];var APIHandleError=require(_0x8ce5('0xc'))['handleError'];var db=require(_0x8ce5('0xf'))['db'];var socket=require(_0x8ce5('0x10'))(new Redis(config[_0x8ce5('0x11')]));require(_0x8ce5('0x12'))[_0x8ce5('0x13')](socket);config[_0x8ce5('0x11')]=_[_0x8ce5('0x14')](config[_0x8ce5('0x11')],{'host':'localhost','port':0x18eb});var client=jayson[_0x8ce5('0x15')][_0x8ce5('0x16')]({'port':0x232a});var values;function respondWithRpcPromise(_0x1219b5,_0x338802,_0x12dc8f,_0xadf48f){return new BPromise(function(_0x5bddba,_0x272845){var _0x1d73ce=_0xadf48f||client;return _0x1d73ce['request'](_0x1219b5,_0x12dc8f)[_0x8ce5('0x17')](function(_0x342359){logger[_0x8ce5('0x18')](_0x8ce5('0x19'),_0x338802,'request\x20sent');logger[_0x8ce5('0x1a')]('User,\x20%s,\x20%s,\x20%s',_0x338802,_0x8ce5('0x1b'),JSON[_0x8ce5('0x1c')](_0x342359));if(_0x342359[_0x8ce5('0x1d')]){if(_0x342359[_0x8ce5('0x1d')][_0x8ce5('0x1e')]===0x1f4){logger[_0x8ce5('0x1d')](_0x8ce5('0x19'),_0x338802,_0x342359[_0x8ce5('0x1d')]['message']);return _0x272845(_0x342359[_0x8ce5('0x1d')][_0x8ce5('0x1f')]);}logger[_0x8ce5('0x1d')](_0x8ce5('0x19'),_0x338802,_0x342359[_0x8ce5('0x1d')][_0x8ce5('0x1f')]);return _0x5bddba(_0x342359[_0x8ce5('0x1d')][_0x8ce5('0x1f')]);}else{logger[_0x8ce5('0x18')](_0x8ce5('0x19'),_0x338802,_0x8ce5('0x1b'));_0x5bddba(_0x342359['result']['message']);}})[_0x8ce5('0x20')](function(_0x46ba6c){logger[_0x8ce5('0x1d')](_0x8ce5('0x19'),_0x338802,_0x46ba6c);_0x272845(_0x46ba6c);});});}function respondWithStatusCode(_0x5e4fa7,_0x36b7ba){_0x36b7ba=_0x36b7ba||0xcc;return function(_0x48fafe){if(_0x48fafe){return _0x5e4fa7[_0x8ce5('0x21')](_0x36b7ba);}return _0x5e4fa7[_0x8ce5('0x22')](_0x36b7ba)[_0x8ce5('0x23')]();};}function respondWithResult(_0x2dc448,_0x2bd5bc){_0x2bd5bc=_0x2bd5bc||0xc8;return function(_0x5e3525){if(_0x5e3525){return _0x2dc448['status'](_0x2bd5bc)[_0x8ce5('0x24')](_0x5e3525);}};}function respondWithFilteredResult(_0x3e9bac,_0x16bf76){return function(_0x4f34e3){if(_0x4f34e3){var _0x39a6b8=typeof _0x16bf76[_0x8ce5('0x25')]===_0x8ce5('0x26')&&typeof _0x16bf76['limit']==='undefined';var _0x4becd4=_0x4f34e3[_0x8ce5('0x27')];var _0x23669b=_0x39a6b8?0x0:_0x16bf76[_0x8ce5('0x25')];var _0x33196d=_0x39a6b8?_0x4f34e3[_0x8ce5('0x27')]:_0x16bf76['offset']+_0x16bf76['limit'];var _0x3a012b;if(_0x33196d>=_0x4becd4){_0x33196d=_0x4becd4;_0x3a012b=0xc8;}else{_0x3a012b=0xce;}_0x3e9bac[_0x8ce5('0x22')](_0x3a012b);return _0x3e9bac['set'](_0x8ce5('0x28'),_0x23669b+'-'+_0x33196d+'/'+_0x4becd4)[_0x8ce5('0x24')](_0x4f34e3);}return null;};}function saveUpdates(_0x5b61a2){return function(_0xbc9627){if(_0xbc9627){return _0xbc9627[_0x8ce5('0x29')](_0x5b61a2)['then'](function(_0x413acd){socket[_0x8ce5('0x2a')](_0x8ce5('0x2b')+_0x413acd['id'],{});return _0x413acd;});}return null;};}function removeEntity(_0x15fd3b){return function(_0x4554b7){if(_0x4554b7){return _0x4554b7[_0x8ce5('0x2c')]()['then'](function(){var _0x187d4f=_0x4554b7[_0x8ce5('0x2d')]({'plain':!![]});if(_0x187d4f['role']===_0x8ce5('0x2e'))return;var _0x31d53a=[{'name':_0x8ce5('0x2f'),'value':'user','ignore':!![]},{'name':_0x8ce5('0x30'),'value':_0x8ce5('0x31'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x3ae945=_(_0x31d53a)[_0x8ce5('0x32')](_0x8ce5('0x33'))['map']('value')['value']();if(_['includes'](_0x3ae945,_0x187d4f[_0x8ce5('0x34')])){return;}var _0x1cdc07=_[_0x8ce5('0x35')](_0x31d53a,[_0x8ce5('0x36'),_0x187d4f[_0x8ce5('0x34')]])[_0x8ce5('0x37')];return db[_0x8ce5('0x38')][_0x8ce5('0x2c')]({'where':{'type':_0x1cdc07,'resourceId':_0x187d4f['id']}})[_0x8ce5('0x17')](function(){return _0x4554b7;});})['then'](function(){_0x15fd3b['status'](0xcc)[_0x8ce5('0x23')]();});}};}function handleEntityNotFound(_0x3bed2f){return function(_0x35e5b7){if(!_0x35e5b7){_0x3bed2f[_0x8ce5('0x21')](0x194);}return _0x35e5b7;};}function handleError(_0xee66eb,_0x2be446){_0x2be446=_0x2be446||0x1f4;return function(_0x33b199){logger[_0x8ce5('0x1d')](_0x33b199[_0x8ce5('0x39')]);if(_0x33b199[_0x8ce5('0x37')]){delete _0x33b199[_0x8ce5('0x37')];}_0xee66eb[_0x8ce5('0x22')](_0x2be446)[_0x8ce5('0x3a')](_0x33b199);};}exports[_0x8ce5('0x3b')]=function(_0x55b306,_0x3a83ae){var _0x4f7172={},_0x481778={'count':0x0,'rows':[]};var _0x40cfdf=_(db['User']['rawAttributes'])[_0x8ce5('0x3c')](function(_0x1f5571){return{'name':_0x1f5571[_0x8ce5('0x3d')],'type':_0x1f5571[_0x8ce5('0x3e')]['key']};})[_0x8ce5('0x32')](function(_0x49a888){return!_[_0x8ce5('0x3f')]([_0x8ce5('0x40'),_0x8ce5('0x41')],_0x49a888[_0x8ce5('0x37')]);})[_0x8ce5('0x36')]();_0x4f7172=qs[_0x8ce5('0x42')](_0x40cfdf,_0x55b306);var _0x296403={'where':_0x4f7172['where']};return db[_0x8ce5('0x43')]['count'](_0x296403)['then'](function(_0x52dd69){_0x481778[_0x8ce5('0x27')]=_0x52dd69;if(_0x55b306[_0x8ce5('0x44')][_0x8ce5('0x45')]){_0x4f7172[_0x8ce5('0x46')]=[{'all':!![]}];}if(_0x55b306[_0x8ce5('0x44')]['userSetting']===_0x8ce5('0x47')){_0x4f7172[_0x8ce5('0x46')]=[{'model':db['UserSetting'],'as':_0x8ce5('0x48')}];}if(!_['includes'](_0x4f7172[_0x8ce5('0x49')],'id')){_0x4f7172['attributes'][_0x8ce5('0x4a')]('id');}return db[_0x8ce5('0x43')][_0x8ce5('0x4b')](_0x4f7172);})['then'](function(_0x1bee19){_0x481778[_0x8ce5('0x4c')]=_0x1bee19;if(_0x55b306[_0x8ce5('0x44')]['openTabs']===_0x8ce5('0x47')){var _0x3cab59=[];for(var _0x57fcf3=0x0;_0x57fcf3<_0x481778['rows']['length'];_0x57fcf3++){_0x3cab59[_0x8ce5('0x4a')](get_open_tabs(_0x8ce5('0x4d'),_0x481778[_0x8ce5('0x4c')][_0x57fcf3]['dataValues']));_0x3cab59[_0x8ce5('0x4a')](get_open_tabs(_0x8ce5('0x4e'),_0x481778[_0x8ce5('0x4c')][_0x57fcf3][_0x8ce5('0x4f')]));_0x3cab59[_0x8ce5('0x4a')](get_open_tabs(_0x8ce5('0x50'),_0x481778[_0x8ce5('0x4c')][_0x57fcf3]['dataValues']));_0x3cab59[_0x8ce5('0x4a')](get_open_tabs(_0x8ce5('0x51'),_0x481778['rows'][_0x57fcf3][_0x8ce5('0x4f')]));_0x3cab59[_0x8ce5('0x4a')](get_open_tabs(_0x8ce5('0x52'),_0x481778[_0x8ce5('0x4c')][_0x57fcf3]['dataValues']));_0x3cab59[_0x8ce5('0x4a')](get_open_tabs(_0x8ce5('0x53'),_0x481778[_0x8ce5('0x4c')][_0x57fcf3][_0x8ce5('0x4f')]));}return BPromise[_0x8ce5('0x54')](_0x3cab59)[_0x8ce5('0x17')](function(){return _0x481778;});}else{return _0x481778;}})[_0x8ce5('0x17')](respondWithFilteredResult(_0x3a83ae,_0x4f7172))['catch'](handleError(_0x3a83ae,null));};exports[_0x8ce5('0x55')]=function(_0x1b1208,_0x305bfd){var _0x35234a={'raw':![],'where':{'id':_0x1b1208['params']['id']}},_0x4da111={};_0x4da111[_0x8ce5('0x56')]=_[_0x8ce5('0x57')](_[_0x8ce5('0x58')](db[_0x8ce5('0x43')][_0x8ce5('0x59')]),[_0x8ce5('0x40'),'salt']);_0x4da111[_0x8ce5('0x44')]=_[_0x8ce5('0x58')](_0x1b1208[_0x8ce5('0x44')]);_0x4da111[_0x8ce5('0x5a')]=_['intersection'](_0x4da111[_0x8ce5('0x56')],_0x4da111[_0x8ce5('0x44')]);_0x35234a[_0x8ce5('0x49')]=_['intersection'](_0x4da111[_0x8ce5('0x56')],qs[_0x8ce5('0x5b')](_0x1b1208[_0x8ce5('0x44')]['fields']));_0x35234a[_0x8ce5('0x49')]=_0x35234a['attributes']['length']?_0x35234a[_0x8ce5('0x49')]:_0x4da111[_0x8ce5('0x56')];if(_0x1b1208[_0x8ce5('0x44')][_0x8ce5('0x45')]){_0x35234a[_0x8ce5('0x46')]=[{'all':!![]}];}if(_0x1b1208[_0x8ce5('0x44')][_0x8ce5('0x48')]===_0x8ce5('0x47')){_0x35234a['include']=[{'model':db[_0x8ce5('0x5c')],'as':_0x8ce5('0x48')}];}_0x35234a=_[_0x8ce5('0x5d')]({},_0x35234a,_0x1b1208['options']);if(!_[_0x8ce5('0x3f')](_0x35234a[_0x8ce5('0x49')],'id')){_0x35234a['attributes'][_0x8ce5('0x4a')]('id');}return db[_0x8ce5('0x43')]['find'](_0x35234a)[_0x8ce5('0x17')](handleEntityNotFound(_0x305bfd,null))[_0x8ce5('0x17')](function(_0x495efd){var _0x12c526=[];values=_0x495efd;if(_0x1b1208[_0x8ce5('0x44')]['openTabs']===_0x8ce5('0x47')){_0x12c526[_0x8ce5('0x4a')](get_open_tabs('chat',_0x495efd[_0x8ce5('0x4f')]));_0x12c526[_0x8ce5('0x4a')](get_open_tabs(_0x8ce5('0x4e'),_0x495efd[_0x8ce5('0x4f')]));_0x12c526[_0x8ce5('0x4a')](get_open_tabs(_0x8ce5('0x52'),_0x495efd['dataValues']));_0x12c526['push'](get_open_tabs(_0x8ce5('0x53'),_0x495efd['dataValues']));_0x12c526['push'](get_open_tabs(_0x8ce5('0x50'),_0x495efd['dataValues']));_0x12c526['push'](get_open_tabs(_0x8ce5('0x51'),_0x495efd[_0x8ce5('0x4f')]));return BPromise[_0x8ce5('0x54')](_0x12c526);}else{return values;}})['then'](function(){return values;})[_0x8ce5('0x17')](respondWithResult(_0x305bfd,null))[_0x8ce5('0x20')](handleError(_0x305bfd,null));};exports['update']=function(_0x12c8ef,_0x43524e){if(_0x12c8ef[_0x8ce5('0x5e')]['id']){delete _0x12c8ef[_0x8ce5('0x5e')]['id'];}delete _0x12c8ef[_0x8ce5('0x5e')][_0x8ce5('0x34')];return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x12c8ef['params']['id']}})['then'](handleEntityNotFound(_0x43524e,null))['then'](saveUpdates(_0x12c8ef[_0x8ce5('0x5e')],null))['then'](respondWithResult(_0x43524e,null))['catch'](handleError(_0x43524e,null));};exports['describe']=function(_0x4ce6d3,_0x55b480){return db[_0x8ce5('0x43')][_0x8ce5('0x5f')]()[_0x8ce5('0x17')](respondWithResult(_0x55b480,null))[_0x8ce5('0x20')](handleError(_0x55b480,null));};exports[_0x8ce5('0x60')]=function(_0x501ab7,_0x95e621){return db[_0x8ce5('0x43')]['find']({'where':{'id':_0x501ab7[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x95e621,null))[_0x8ce5('0x17')](function(_0x1f25f1){if(_0x1f25f1){return _0x1f25f1[_0x8ce5('0x60')](_0x501ab7[_0x8ce5('0x5e')][_0x8ce5('0x62')],_[_0x8ce5('0x63')](_0x501ab7[_0x8ce5('0x5e')],[_0x8ce5('0x62'),'id'])||{});}})[_0x8ce5('0x17')](respondWithResult(_0x95e621,null))[_0x8ce5('0x20')](handleError(_0x95e621,null));};function validateUser(_0x4ab86d){return new BPromise(function(_0x1262f5,_0x4ae5ae){if(_0x4ab86d[_0x8ce5('0x64')])return _0x1262f5(_0x4ab86d);return db[_0x8ce5('0x65')][_0x8ce5('0x66')](0x1)[_0x8ce5('0x17')](function(_0x47e2f2){if(_0x47e2f2['securePassword'])authService[_0x8ce5('0x67')](_0x4ab86d[_0x8ce5('0x40')]);db[_0x8ce5('0x43')][_0x8ce5('0x68')](_0x8ce5('0x64'))[_0x8ce5('0x17')](function(_0x474a4b){if(_[_0x8ce5('0x69')](_0x474a4b)){_0x4ab86d[_0x8ce5('0x64')]=_0x47e2f2['min_internal']||0x1;return;}if(_[_0x8ce5('0x69')](_0x47e2f2['min_internal'])||_0x47e2f2[_0x8ce5('0x6a')]===_0x474a4b){_0x4ab86d['internal']=_0x474a4b+0x1;return;}if(_0x47e2f2['min_internal']>_0x474a4b){_0x4ab86d['internal']=_0x47e2f2['min_internal'];return;}return db[_0x8ce5('0x6b')][_0x8ce5('0x44')](_0x8ce5('0x6c'),{'type':db[_0x8ce5('0x6b')][_0x8ce5('0x6d')][_0x8ce5('0x6e')]})['then'](function(_0x1ced7b){if(_0x1ced7b&&_0x1ced7b['length']){for(var _0x22a517=0x0,_0x18f1fe=_0x1ced7b[_0x8ce5('0x6f')];_0x22a517<_0x18f1fe&&_[_0x8ce5('0x69')](_0x4ab86d[_0x8ce5('0x64')]);_0x22a517++){if(_0x47e2f2[_0x8ce5('0x6a')]<=_0x1ced7b[_0x22a517][_0x8ce5('0x70')]){_0x4ab86d[_0x8ce5('0x64')]=_0x1ced7b[_0x22a517][_0x8ce5('0x70')];}else if(_0x47e2f2[_0x8ce5('0x6a')]>_0x1ced7b[_0x22a517][_0x8ce5('0x70')]&&_0x47e2f2[_0x8ce5('0x6a')]<=_0x1ced7b[_0x22a517]['to']){_0x4ab86d['internal']=_0x47e2f2[_0x8ce5('0x6a')];}}}if(_[_0x8ce5('0x69')](_0x4ab86d[_0x8ce5('0x64')])){_0x4ab86d[_0x8ce5('0x64')]=_0x474a4b+0x1;}return _0x1262f5(_0x4ab86d);});});})[_0x8ce5('0x20')](function(_0x40aa70){_0x4ae5ae(_0x40aa70);});});}function updateUser(_0x367091){return new BPromise(function(_0x2f47f9,_0x5d6126){try{if(_0x367091[_0x8ce5('0x71')]){_0x367091[_0x8ce5('0x72')]=_0x367091[_0x8ce5('0x64')];_0x367091['VoiceMail']={'mailbox':_0x367091[_0x8ce5('0x64')],'password':_0x367091['password'],'fullname':_0x367091[_0x8ce5('0x73')],'email':_0x367091[_0x8ce5('0x74')]};}if(_0x367091[_0x8ce5('0x34')]==='agent'){if(!_0x367091[_0x8ce5('0x75')])_0x367091[_0x8ce5('0x75')]=['101',_0x8ce5('0x76'),_0x8ce5('0x77'),'113',_0x8ce5('0x78'),_0x8ce5('0x79'),_0x8ce5('0x7a'),_0x8ce5('0x7b'),_0x8ce5('0x7c'),_0x8ce5('0x7d'),'109','100',_0x8ce5('0x7e'),'114',_0x8ce5('0x7f')];}_0x2f47f9(_0x367091);}catch(_0x3362ce){_0x5d6126(_0x3362ce);}});}exports['create']=function(_0x15b770,_0x3f887e){if(_0x15b770['user'][_0x8ce5('0x34')]===_0x8ce5('0x31'))throw new Error(_0x8ce5('0x80'));if(_0x15b770['body']['role']==='user'&&_0x15b770[_0x8ce5('0x81')][_0x8ce5('0x34')]!==_0x8ce5('0x2e')){throw new Error(_0x8ce5('0x82'));}if(_0x15b770[_0x8ce5('0x5e')][_0x8ce5('0x34')]==='admin'&&_0x15b770[_0x8ce5('0x81')][_0x8ce5('0x34')]!==_0x8ce5('0x2e')){throw new Error(_0x8ce5('0x83'));}return licenseUtil['checkUserLimits']([_0x15b770[_0x8ce5('0x5e')]])['then'](function(){return validateUser(_0x15b770[_0x8ce5('0x5e')]);})[_0x8ce5('0x17')](function(_0x4a0246){return updateUser(_0x4a0246)[_0x8ce5('0x17')](function(_0x138c58){if(_0x138c58[_0x8ce5('0x34')]===_0x8ce5('0x2e')){_0x138c58[_0x8ce5('0x84')]=_0x15b770[_0x8ce5('0x81')][_0x8ce5('0x84')];delete _0x138c58[_0x8ce5('0x85')];}return _0x138c58;});})[_0x8ce5('0x17')](function(_0xf5e1b7){return db[_0x8ce5('0x43')][_0x8ce5('0x86')](_0xf5e1b7,{'include':[{'model':db[_0x8ce5('0x87')],'as':_0x8ce5('0x87')}]});})['then'](function(_0x47d7cc){if(_0x15b770[_0x8ce5('0x5e')][_0x8ce5('0x34')]==='user')return _0x47d7cc;if(_0x15b770['user']['role']!=='user')return _0x47d7cc;return db['UserProfileSection'][_0x8ce5('0x35')]({'where':{'name':_0x47d7cc['role']===_0x8ce5('0x31')?_0x8ce5('0x30'):_0x8ce5('0x88'),'userProfileId':_0x15b770[_0x8ce5('0x81')][_0x8ce5('0x85')]},'raw':!![]})['then'](function(_0x17fe58){if(!_0x17fe58||_0x17fe58[_0x8ce5('0x89')]!=0x0)return _0x47d7cc;return db[_0x8ce5('0x38')][_0x8ce5('0x86')]({'name':_0x47d7cc[_0x8ce5('0x37')],'resourceId':_0x47d7cc['id'],'type':_0x17fe58['name'],'sectionId':_0x17fe58['id']},{})['then'](function(){return _0x47d7cc;});})[_0x8ce5('0x20')](function(_0x16a5f8){logger[_0x8ce5('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16a5f8);throw _0x16a5f8;});})[_0x8ce5('0x17')](respondWithResult(_0x3f887e,0xc9))[_0x8ce5('0x20')](handleError(_0x3f887e,null));};exports[_0x8ce5('0x8a')]=function(_0x2fded8,_0x4f7500){var _0x3032e=_0x2fded8[_0x8ce5('0x5e')];var _0x57eed3=[];if(_0x2fded8['user'][_0x8ce5('0x34')]===_0x8ce5('0x31'))throw new Error(_0x8ce5('0x80'));if(_[_0x8ce5('0x8b')](_0x3032e,[_0x8ce5('0x34'),_0x8ce5('0x81')])&&_0x2fded8[_0x8ce5('0x81')][_0x8ce5('0x34')]!==_0x8ce5('0x2e')){throw new Error(_0x8ce5('0x82'));}if(_[_0x8ce5('0x8b')](_0x3032e,[_0x8ce5('0x34'),_0x8ce5('0x2e')])&&_0x2fded8[_0x8ce5('0x81')][_0x8ce5('0x34')]!=='admin'){throw new Error(_0x8ce5('0x8c'));}return licenseUtil['checkUserLimits'](_0x3032e)[_0x8ce5('0x17')](function(){return validateUser(_0x3032e[0x0]);})[_0x8ce5('0x17')](function(){for(var _0x43442b=0x1;_0x43442b<_0x3032e[_0x8ce5('0x6f')];_0x43442b++){var _0x9c93be=_0x3032e[_0x43442b-0x1][_0x8ce5('0x64')];if(!_0x3032e[_0x43442b][_0x8ce5('0x64')])_0x3032e[_0x43442b][_0x8ce5('0x64')]=_0x9c93be+0x1;_0x57eed3[_0x8ce5('0x4a')](validateUser(_0x3032e[_0x43442b]));}return BPromise['all'](_0x57eed3);})[_0x8ce5('0x17')](function(){_0x57eed3=[];for(var _0x3e31de=0x0;_0x3e31de<_0x3032e[_0x8ce5('0x6f')];_0x3e31de++){_0x57eed3[_0x8ce5('0x4a')](updateUser(_0x3032e[_0x3e31de]));}return BPromise['all'](_0x57eed3);})['then'](function(){return BPromise[_0x8ce5('0x8d')](_0x3032e,function(_0x497d5d){return db[_0x8ce5('0x43')][_0x8ce5('0x86')](_0x497d5d,{'include':[{'model':db[_0x8ce5('0x87')],'as':_0x8ce5('0x87')}]})['then'](function(_0x498e35){_0x497d5d['id']=_0x498e35['id'];return _0x497d5d;});});})[_0x8ce5('0x17')](function(_0x160f29){if(_0x2fded8[_0x8ce5('0x5e')][_0x8ce5('0x34')]===_0x8ce5('0x81'))return _0x160f29;if(_0x2fded8[_0x8ce5('0x81')][_0x8ce5('0x34')]!==_0x8ce5('0x81'))return _0x160f29;var _0x9b6cad=_[_0x8ce5('0x8b')](_0x160f29,function(_0x436add){return _0x436add[_0x8ce5('0x34')]==='agent'||_0x436add[_0x8ce5('0x34')]===_0x8ce5('0x8e');});if(!_0x9b6cad)return _0x160f29;return db[_0x8ce5('0x8f')][_0x8ce5('0x4b')]({'where':{'name':{'$or':[_0x8ce5('0x30'),_0x8ce5('0x88')]},'userProfileId':_0x2fded8[_0x8ce5('0x81')][_0x8ce5('0x85')]},'raw':!![]})[_0x8ce5('0x17')](function(_0x591d0e){if(_[_0x8ce5('0x90')](_0x591d0e)||!_[_0x8ce5('0x8b')](_0x591d0e,['autoAssociation',0x0]))return _0x160f29;_0x57eed3=[];var _0x10ad9c=_(_0x591d0e)[_0x8ce5('0x3c')](function(_0x25a570){if(_0x25a570[_0x8ce5('0x89')]===0x1)return;return _0x25a570['name']===_0x8ce5('0x30')?_0x8ce5('0x31'):_0x8ce5('0x8e');})[_0x8ce5('0x91')]()[_0x8ce5('0x36')]();for(var _0x29715f=0x0;_0x29715f<_0x160f29[_0x8ce5('0x6f')];_0x29715f++){if(!_[_0x8ce5('0x3f')](_0x10ad9c,_0x160f29[_0x29715f][_0x8ce5('0x34')]))return;var _0x203483=_0x160f29[_0x29715f][_0x8ce5('0x34')]===_0x8ce5('0x31')?'Agents':_0x8ce5('0x88');_0x57eed3[_0x8ce5('0x4a')](db[_0x8ce5('0x38')][_0x8ce5('0x86')]({'name':_0x160f29[_0x29715f][_0x8ce5('0x37')],'resourceId':_0x160f29[_0x29715f]['id'],'type':_0x203483,'sectionId':_[_0x8ce5('0x35')](_0x591d0e,[_0x8ce5('0x37'),_0x203483])['id']},{}));}return BPromise['all'](_0x57eed3);});})[_0x8ce5('0x17')](respondWithResult(_0x4f7500,0xc9))[_0x8ce5('0x20')](handleError(_0x4f7500,null));};exports[_0x8ce5('0x92')]=function(_0x21a33d,_0x543e42){if(_0x21a33d[_0x8ce5('0x5e')]['id']){delete _0x21a33d[_0x8ce5('0x5e')]['id'];}return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x21a33d[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](function(_0x18030c){if(!_0x18030c)return null;if(_0x18030c['id']===_0x21a33d[_0x8ce5('0x81')]['id']){if(!_0x21a33d[_0x8ce5('0x5e')][_0x8ce5('0x93')]||!_0x21a33d['body']['newPassword']){throw new db[(_0x8ce5('0x94'))]['ValidationError'](_0x8ce5('0x95'));}if(!_0x18030c[_0x8ce5('0x96')](_0x21a33d['body'][_0x8ce5('0x93')])){throw new db['Sequelize'][(_0x8ce5('0x97'))](_0x8ce5('0x98'));}if(_0x21a33d['body'][_0x8ce5('0x93')]===_0x21a33d[_0x8ce5('0x5e')]['newPassword']){throw new db[(_0x8ce5('0x94'))][(_0x8ce5('0x97'))](_0x8ce5('0x99'));}}else if(_0x21a33d['user'][_0x8ce5('0x34')]==='admin'){if(!_0x21a33d[_0x8ce5('0x5e')][_0x8ce5('0x9a')]){throw new db[(_0x8ce5('0x94'))][(_0x8ce5('0x97'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x21a33d[_0x8ce5('0x81')][_0x8ce5('0x34')]===_0x8ce5('0x81')){if(!_0x21a33d[_0x8ce5('0x5e')][_0x8ce5('0x9a')]){throw new db[(_0x8ce5('0x94'))][(_0x8ce5('0x97'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x18030c['role']!=='agent'){throw new db[(_0x8ce5('0x94'))][(_0x8ce5('0x97'))](_0x8ce5('0x80'));}}else{throw new db[(_0x8ce5('0x94'))][(_0x8ce5('0x97'))](_0x8ce5('0x80'));}return _0x18030c;})[_0x8ce5('0x17')](handleEntityNotFound(_0x543e42,null))[_0x8ce5('0x17')](function(_0x3f3f52){return db['Setting'][_0x8ce5('0x9b')]({'attributes':['id',_0x8ce5('0x9c'),_0x8ce5('0x9d'),_0x8ce5('0x9e')]})['then'](function(_0x4e9606){if(_0x4e9606[_0x8ce5('0x9c')])authService[_0x8ce5('0x67')](_0x21a33d[_0x8ce5('0x5e')]['newPassword']);if(!_0x4e9606['enforcePasswordHistory']||!_0x3f3f52['previousPasswords'])return _0x3f3f52;authService[_0x8ce5('0x9f')](_0x21a33d['body'][_0x8ce5('0x9a')],_0x3f3f52[_0x8ce5('0xa0')],_0x4e9606['passwordHistoryLimit']);return _0x3f3f52;})[_0x8ce5('0x17')](saveUpdates({'password':_0x21a33d[_0x8ce5('0x5e')][_0x8ce5('0x9a')],'passwordResetAt':_0x21a33d['user']['id']==_0x21a33d[_0x8ce5('0x61')]['id']?moment():null,'previousPasswords':authService[_0x8ce5('0xa1')](_0x21a33d[_0x8ce5('0x5e')][_0x8ce5('0x9a')],_0x3f3f52[_0x8ce5('0xa0')])},null));})['then'](respondWithResult(_0x543e42,null))[_0x8ce5('0x20')](handleError(_0x543e42,null));};exports[_0x8ce5('0xa2')]=function(_0x28c7ff,_0x77e214){var _0x215185=_0x28c7ff['body']['channel'];return db[_0x8ce5('0x43')]['find']({'where':{'id':_0x28c7ff[_0x8ce5('0x61')]['id']},'attributes':['id','name',_0x8ce5('0x34'),_0x8ce5('0xa3'),_0x8ce5('0xa4'),_0x8ce5('0xa5'),_0x8ce5('0xa6')]})[_0x8ce5('0x17')](handleEntityNotFound(_0x77e214,null))[_0x8ce5('0x17')](function(_0x83f83c){if(_0x83f83c){if(!utils[_0x8ce5('0xa7')](_0x215185)){throw new db[(_0x8ce5('0x94'))][(_0x8ce5('0x97'))]('Unknown\x20channel');}return _0x83f83c['add'+_[_0x8ce5('0xa8')](_0x215185[_0x8ce5('0xa9')]())+_0x8ce5('0xaa')](_0x28c7ff[_0x8ce5('0x5e')][_0x8ce5('0x62')],{'penalty':_0x28c7ff['body'][_0x8ce5('0xab')]||0x0})[_0x8ce5('0xac')](function(_0x908776){for(var _0xa582a0=0x0;_0xa582a0<_0x28c7ff['body'][_0x8ce5('0x62')][_0x8ce5('0x6f')];_0xa582a0+=0x1){var _0x5ad40e={'UserId':Number(_0x28c7ff[_0x8ce5('0x61')]['id'])};_0x5ad40e[_[_0x8ce5('0xa8')](_0x215185['toLowerCase']())+'QueueId']=Number(_0x28c7ff['body'][_0x8ce5('0x62')][_0xa582a0]);socket['emit']('user'+_[_0x8ce5('0xa8')](_0x215185[_0x8ce5('0xa9')]())+_0x8ce5('0xad'),_0x5ad40e);}return _0x908776;})['then'](function(){if(_0x215185===_0x8ce5('0xae')){return db['VoiceQueue']['findAll']({'where':{'id':_0x28c7ff['body'][_0x8ce5('0x62')]||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x173d2b){var _0x1f9de7=_0x83f83c['get']({'plain':!![]});var _0x107870=[];if(_0x215185===_0x8ce5('0xae')&&_0x1f9de7[_0x8ce5('0x34')]===_0x8ce5('0x31')&&_0x1f9de7[_0x8ce5('0xa3')]){for(var _0x3dba12=0x0;_0x3dba12<_0x173d2b[_0x8ce5('0x6f')];_0x3dba12+=0x1){_0x107870['push']({'membername':_0x1f9de7[_0x8ce5('0x37')],'UserId':_0x1f9de7['id'],'queue_name':_0x173d2b[_0x3dba12]['name'],'VoiceQueueId':_0x173d2b[_0x3dba12]['id'],'interface':_[_0x8ce5('0x69')](_0x1f9de7[_0x8ce5('0xa6')])?util[_0x8ce5('0xaf')](_0x8ce5('0xb0'),_0x1f9de7['name']):_0x1f9de7['interface'],'paused':_0x1f9de7['voicePause']||![],'penalty':_0x28c7ff[_0x8ce5('0x5e')][_0x8ce5('0xab')]||0x0});}return BPromise[_0x8ce5('0x8d')](_0x107870,function(_0x38f9fb){return db[_0x8ce5('0xb1')]['upsert'](_0x38f9fb);});}return _0x83f83c;});}})['then'](respondWithStatusCode(_0x77e214,null))[_0x8ce5('0x20')](handleError(_0x77e214,null));};exports[_0x8ce5('0xb2')]=function(_0x387150,_0x4d1eaf){var _0x139e3f,_0x4259e5;return db['User'][_0x8ce5('0x35')]({'where':{'id':_0x387150[_0x8ce5('0x61')]['id']},'attributes':['id',_0x8ce5('0x37'),_0x8ce5('0x34')]})[_0x8ce5('0x17')](handleEntityNotFound(_0x4d1eaf,null))[_0x8ce5('0x17')](function(_0x5ebef8){if(_0x5ebef8){_0x139e3f=_0x5ebef8;if(!_0x387150[_0x8ce5('0x44')][_0x8ce5('0xb3')]||!utils[_0x8ce5('0xa7')](_0x387150['query'][_0x8ce5('0xb3')])){throw new db[(_0x8ce5('0x94'))]['ValidationError'](_0x8ce5('0xb4'));}return _0x5ebef8[_0x8ce5('0xb5')+_[_0x8ce5('0xa8')](_0x387150['query'][_0x8ce5('0xb3')]['toLowerCase']())+'Queues'](_0x387150[_0x8ce5('0x44')]['ids']);}})[_0x8ce5('0x17')](function(_0x5b97e8){if(_[_0x8ce5('0xb6')](_0x387150[_0x8ce5('0x44')]['ids'])){for(var _0x4aa7ac=0x0;_0x4aa7ac<_0x387150[_0x8ce5('0x44')][_0x8ce5('0x62')][_0x8ce5('0x6f')];_0x4aa7ac+=0x1){_0x4259e5={'UserId':Number(_0x387150[_0x8ce5('0x61')]['id'])};_0x4259e5[_['capitalize'](_0x387150[_0x8ce5('0x44')][_0x8ce5('0xb3')][_0x8ce5('0xa9')]())+_0x8ce5('0xb7')]=Number(_0x387150[_0x8ce5('0x44')][_0x8ce5('0x62')][_0x4aa7ac]);socket[_0x8ce5('0x2a')](_0x8ce5('0x81')+_[_0x8ce5('0xa8')](_0x387150['query'][_0x8ce5('0xb3')][_0x8ce5('0xa9')]())+_0x8ce5('0xb8'),_0x4259e5);}}else{_0x4259e5={'UserId':Number(_0x387150[_0x8ce5('0x61')]['id'])};_0x4259e5[_[_0x8ce5('0xa8')](_0x387150[_0x8ce5('0x44')][_0x8ce5('0xb3')][_0x8ce5('0xa9')]())+_0x8ce5('0xb7')]=Number(_0x387150[_0x8ce5('0x44')]['ids']);socket['emit'](_0x8ce5('0x81')+_[_0x8ce5('0xa8')](_0x387150[_0x8ce5('0x44')][_0x8ce5('0xb3')][_0x8ce5('0xa9')]())+'Queue:remove',_0x4259e5);}return _0x5b97e8;})['then'](function(){if(_0x387150[_0x8ce5('0x44')]['channel']==='voice'){return db[_0x8ce5('0xb1')][_0x8ce5('0x2c')]({'where':{'UserId':_0x387150[_0x8ce5('0x61')]['id'],'VoiceQueueId':_0x387150[_0x8ce5('0x44')][_0x8ce5('0x62')]},'individualHooks':!![]})['then'](function(){return _0x139e3f;});}return _0x139e3f;})['then'](respondWithStatusCode(_0x4d1eaf,null))[_0x8ce5('0x20')](handleError(_0x4d1eaf,null));};exports['addAvatar']=function(_0x546180,_0x133de2){_0x546180['body'][_0x8ce5('0xb9')]=_0x546180[_0x8ce5('0xba')][_0x8ce5('0xbb')];return db[_0x8ce5('0x43')]['find']({'where':{'id':_0x546180[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x133de2,null))[_0x8ce5('0x17')](saveUpdates(_0x546180[_0x8ce5('0x5e')],null))[_0x8ce5('0x17')](respondWithResult(_0x133de2,null))[_0x8ce5('0x20')](handleError(_0x133de2,null));};exports['getAvatar']=function(_0x1e63ea,_0x2905a5){var _0x31a03e=path[_0x8ce5('0xbc')](config[_0x8ce5('0xbd')],_0x8ce5('0xbe'));return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x1e63ea['params']['id']},'attributes':['id',_0x8ce5('0xb9')],'raw':!![]})['then'](handleEntityNotFound(_0x2905a5,null))['then'](function(_0x54a8e1){if(_0x54a8e1){if(_[_0x8ce5('0x69')](_0x54a8e1[_0x8ce5('0xb9')])){return _0x2905a5[_0x8ce5('0xbf')](_0x31a03e);}else{if(!fs[_0x8ce5('0xc0')](path[_0x8ce5('0xbc')](config[_0x8ce5('0xbd')],_0x8ce5('0xc1'),_0x54a8e1[_0x8ce5('0xb9')]))){return _0x2905a5[_0x8ce5('0xbf')](_0x31a03e);}return _0x2905a5[_0x8ce5('0xbf')](path[_0x8ce5('0xbc')](config[_0x8ce5('0xbd')],_0x8ce5('0xc1'),_0x54a8e1[_0x8ce5('0xb9')]));}}})['catch'](handleError(_0x2905a5,null));};exports[_0x8ce5('0xc2')]=function(_0x40645d,_0x4f98ca){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x40645d[_0x8ce5('0x61')]['id']},'attributes':['id']})[_0x8ce5('0x17')](handleEntityNotFound(_0x4f98ca,null))['then'](function(_0x507818){var _0x51e768=[];values=_0x507818[_0x8ce5('0x4f')];_0x51e768[_0x8ce5('0x4a')](get_open_tabs(_0x8ce5('0x4d'),_0x507818[_0x8ce5('0x4f')]));_0x51e768[_0x8ce5('0x4a')](get_open_tabs(_0x8ce5('0x4e'),_0x507818[_0x8ce5('0x4f')]));_0x51e768[_0x8ce5('0x4a')](get_open_tabs(_0x8ce5('0x52'),_0x507818[_0x8ce5('0x4f')]));_0x51e768['push'](get_open_tabs('whatsapp',_0x507818[_0x8ce5('0x4f')]));_0x51e768[_0x8ce5('0x4a')](get_open_tabs(_0x8ce5('0x50'),_0x507818[_0x8ce5('0x4f')]));_0x51e768[_0x8ce5('0x4a')](get_open_tabs(_0x8ce5('0x51'),_0x507818[_0x8ce5('0x4f')]));return BPromise[_0x8ce5('0x54')](_0x51e768);})[_0x8ce5('0x17')](function(_0x3f31fd){if(_0x3f31fd){var _0x5e86d6=_[_0x8ce5('0x3c')](values[_0x8ce5('0xc3')],function(_0x1ef4dd){return{'channel':_0x8ce5('0xc4'),'id':_0x1ef4dd['id'],'createdAt':_0x1ef4dd[_0x8ce5('0xc5')]};});var _0x2b7b7a=_[_0x8ce5('0x3c')](values[_0x8ce5('0xc6')],function(_0x168c3a){return{'channel':_0x8ce5('0xc7'),'id':_0x168c3a['id'],'createdAt':_0x168c3a['createdAt']};});var _0x1fefde=_[_0x8ce5('0x3c')](values[_0x8ce5('0xc8')],function(_0x20da00){return{'channel':_0x8ce5('0xc9'),'id':_0x20da00['id'],'createdAt':_0x20da00['createdAt']};});var _0x51c028=_[_0x8ce5('0x3c')](values[_0x8ce5('0xca')],function(_0x5b6d76){return{'channel':_0x8ce5('0xcb'),'id':_0x5b6d76['id'],'createdAt':_0x5b6d76[_0x8ce5('0xc5')]};});var _0x123c81=_['map'](values[_0x8ce5('0xcc')],function(_0x5e48ef){return{'channel':_0x8ce5('0xcd'),'id':_0x5e48ef['id'],'createdAt':_0x5e48ef['createdAt']};});var _0xb40e8a=_[_0x8ce5('0x3c')](values[_0x8ce5('0xce')],function(_0x548b44){return{'channel':_0x8ce5('0xcf'),'id':_0x548b44['id'],'createdAt':_0x548b44[_0x8ce5('0xc5')]};});var _0x485eed=_['concat'](_0x5e86d6,_0x2b7b7a,_0x1fefde,_0x51c028,_0x123c81,_0xb40e8a);var _0x53f7bb={'count':_0x485eed[_0x8ce5('0x6f')],'rows':_0x485eed};return _0x53f7bb;}else return null;})[_0x8ce5('0x17')](respondWithResult(_0x4f98ca,null))[_0x8ce5('0x20')](handleError(_0x4f98ca,null));};exports[_0x8ce5('0xd0')]=function(_0x1239f3,_0x5e3307){var _0x571aac={};var _0x35b0b5={};var _0x2491e2;var _0x1e90a7;return db[_0x8ce5('0x43')][_0x8ce5('0x9b')]({'where':{'id':_0x1239f3[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x5e3307,null))[_0x8ce5('0x17')](function(_0x4b8852){if(_0x4b8852){_0x2491e2=_0x4b8852;_0x35b0b5[_0x8ce5('0x56')]=_[_0x8ce5('0x58')](db[_0x8ce5('0xd1')][_0x8ce5('0x59')]);_0x35b0b5['query']=_[_0x8ce5('0x58')](_0x1239f3[_0x8ce5('0x44')]);_0x35b0b5[_0x8ce5('0x5a')]=_[_0x8ce5('0xd2')](_0x35b0b5[_0x8ce5('0x56')],_0x35b0b5[_0x8ce5('0x44')]);_0x571aac[_0x8ce5('0x49')]=_[_0x8ce5('0xd2')](_0x35b0b5['model'],qs[_0x8ce5('0x5b')](_0x1239f3[_0x8ce5('0x44')][_0x8ce5('0x5b')]));_0x571aac[_0x8ce5('0x49')]=_0x571aac[_0x8ce5('0x49')]['length']?_0x571aac[_0x8ce5('0x49')]:_0x35b0b5['model'];_0x571aac[_0x8ce5('0xd3')]=qs['sort'](_0x1239f3['query'][_0x8ce5('0xd4')]);_0x571aac[_0x8ce5('0xd5')]=qs['filters'](_[_0x8ce5('0xd6')](_0x1239f3[_0x8ce5('0x44')],_0x35b0b5[_0x8ce5('0x5a')]));if(_0x1239f3[_0x8ce5('0x44')][_0x8ce5('0x32')]){_0x571aac['where']=_[_0x8ce5('0x5d')](_0x571aac[_0x8ce5('0xd5')],{'$or':_[_0x8ce5('0x3c')](_0x571aac[_0x8ce5('0x49')],function(_0xbaf4b9){var _0x1bf295={};_0x1bf295[_0xbaf4b9]={'$like':'%'+_0x1239f3['query'][_0x8ce5('0x32')]+'%'};return _0x1bf295;})});}_0x571aac=_['merge']({},_0x571aac,_0x1239f3['options']);return _0x2491e2['getContacts'](_0x571aac);}})[_0x8ce5('0x17')](function(_0xd17c8a){if(_0xd17c8a){_0x1e90a7=_0xd17c8a['length'];if(_0x1239f3[_0x8ce5('0x44')][_0x8ce5('0xd7')](_0x8ce5('0x45'))){_0x571aac[_0x8ce5('0x46')]=[{'model':db[_0x8ce5('0xd8')],'as':_0x8ce5('0xd9'),'required':![]},{'model':db[_0x8ce5('0xda')],'as':_0x8ce5('0xdb'),'attributes':['id','name',_0x8ce5('0xdc')],'where':_0x1239f3[_0x8ce5('0x44')]['tag']?{'id':_0x1239f3[_0x8ce5('0x44')][_0x8ce5('0xdd')]}:undefined,'required':_0x1239f3[_0x8ce5('0x44')]['tag']?!![]:![]}];}if(!_0x1239f3[_0x8ce5('0x44')][_0x8ce5('0xd7')](_0x8ce5('0xde'))){_0x571aac['limit']=qs[_0x8ce5('0xdf')](_0x1239f3[_0x8ce5('0x44')]['limit']);_0x571aac[_0x8ce5('0x25')]=qs[_0x8ce5('0x25')](_0x1239f3[_0x8ce5('0x44')][_0x8ce5('0x25')]);}return _0x2491e2['getContacts'](_0x571aac);}})[_0x8ce5('0x17')](function(_0x485559){if(_0x485559){return _0x485559?{'count':_0x1e90a7,'rows':_0x485559}:null;}})[_0x8ce5('0x17')](respondWithResult(_0x5e3307,null))[_0x8ce5('0x20')](handleError(_0x5e3307,null));};exports['getQueues']=function(_0x50c0f8,_0x38f555){var _0x2bcbc8;var _0x5be37c={};var _0x7b461a;return db[_0x8ce5('0x43')][_0x8ce5('0x9b')]({'where':{'id':_0x50c0f8[_0x8ce5('0x61')]['id']},'attributes':['id',_0x8ce5('0x37'),_0x8ce5('0x34')]})['then'](handleEntityNotFound(_0x38f555,null))[_0x8ce5('0x17')](function(_0x23d064){if(!utils[_0x8ce5('0xa7')](_0x50c0f8[_0x8ce5('0x44')][_0x8ce5('0xb3')])){throw new db['Sequelize'][(_0x8ce5('0x97'))](_0x8ce5('0xb4'));}_0x2bcbc8=_0x23d064;var _0x463916={};_0x463916[_0x8ce5('0x56')]=_['keys'](db[_[_0x8ce5('0xa8')](_0x50c0f8[_0x8ce5('0x44')][_0x8ce5('0xb3')])+_0x8ce5('0xe0')][_0x8ce5('0x59')]);_0x463916[_0x8ce5('0x44')]=_[_0x8ce5('0x58')](_0x50c0f8[_0x8ce5('0x44')]);_0x463916[_0x8ce5('0x5a')]=_['intersection'](_0x463916[_0x8ce5('0x56')],_0x463916[_0x8ce5('0x44')]);_0x5be37c['attributes']=_[_0x8ce5('0xd2')](_0x463916[_0x8ce5('0x56')],qs[_0x8ce5('0x5b')](_0x50c0f8[_0x8ce5('0x44')]['fields']));_0x5be37c[_0x8ce5('0x49')]=_0x5be37c[_0x8ce5('0x49')]['length']?_0x5be37c[_0x8ce5('0x49')]:_0x463916[_0x8ce5('0x56')];_0x5be37c[_0x8ce5('0xd3')]=qs[_0x8ce5('0xd4')](_0x50c0f8[_0x8ce5('0x44')][_0x8ce5('0xd4')]);_0x5be37c[_0x8ce5('0xd5')]=qs[_0x8ce5('0x5a')](_[_0x8ce5('0xd6')](_0x50c0f8['query'],_0x463916[_0x8ce5('0x5a')]));if(_0x50c0f8[_0x8ce5('0x44')]['filter']){_0x5be37c[_0x8ce5('0xd5')]=_[_0x8ce5('0x5d')](_0x5be37c[_0x8ce5('0xd5')],{'$or':_[_0x8ce5('0x3c')](_0x5be37c['attributes'],function(_0x3815a9){var _0x4046e6={};_0x4046e6[_0x3815a9]={'$like':'%'+_0x50c0f8[_0x8ce5('0x44')][_0x8ce5('0x32')]+'%'};return _0x4046e6;})});}_0x5be37c=_['merge']({},_0x5be37c,_0x50c0f8[_0x8ce5('0xe1')]);switch(_0x2bcbc8[_0x8ce5('0x34')]){case _0x8ce5('0x2e'):return db[_['capitalize'](_0x50c0f8[_0x8ce5('0x44')][_0x8ce5('0xb3')])+_0x8ce5('0xe0')][_0x8ce5('0x4b')](_0x5be37c);case'user':case _0x8ce5('0x31'):return _0x2bcbc8[_0x8ce5('0x2d')+_[_0x8ce5('0xa8')](_0x50c0f8[_0x8ce5('0x44')][_0x8ce5('0xb3')])+_0x8ce5('0xaa')](_0x5be37c);default:throw new db[(_0x8ce5('0x94'))][(_0x8ce5('0x97'))](_0x8ce5('0xe2'));}})[_0x8ce5('0x17')](function(_0x2e818c){_0x7b461a=_0x2e818c[_0x8ce5('0x6f')];if(!_0x50c0f8['query'][_0x8ce5('0xd7')]('nolimit')){_0x5be37c[_0x8ce5('0xdf')]=qs['limit'](_0x50c0f8[_0x8ce5('0x44')][_0x8ce5('0xdf')]);_0x5be37c[_0x8ce5('0x25')]=qs[_0x8ce5('0x25')](_0x50c0f8[_0x8ce5('0x44')][_0x8ce5('0x25')]);}switch(_0x2bcbc8[_0x8ce5('0x34')]){case _0x8ce5('0x2e'):return db[_[_0x8ce5('0xa8')](_0x50c0f8[_0x8ce5('0x44')][_0x8ce5('0xb3')])+_0x8ce5('0xe0')][_0x8ce5('0x4b')](_0x5be37c);case _0x8ce5('0x81'):case _0x8ce5('0x31'):return _0x2bcbc8[_0x8ce5('0x2d')+_[_0x8ce5('0xa8')](_0x50c0f8[_0x8ce5('0x44')][_0x8ce5('0xb3')])+_0x8ce5('0xaa')](_0x5be37c);}})[_0x8ce5('0x17')](function(_0x5c32d0){return{'count':_0x7b461a,'rows':_0x5c32d0};})['then'](respondWithResult(_0x38f555,null))['catch'](handleError(_0x38f555,null));};exports[_0x8ce5('0xe3')]=function(_0x31442c,_0x18fb35){var _0x9acc15={};var _0x3b73fa={};var _0x3e680e;var _0x3da529;return db[_0x8ce5('0x43')][_0x8ce5('0x9b')]({'where':{'id':_0x31442c[_0x8ce5('0x61')]['id']}})['then'](handleEntityNotFound(_0x18fb35,null))['then'](function(_0x143a40){if(_0x143a40){_0x3e680e=_0x143a40;_0x3b73fa[_0x8ce5('0x56')]=_[_0x8ce5('0x58')](db[_0x8ce5('0xb1')][_0x8ce5('0x59')]);_0x3b73fa[_0x8ce5('0x44')]=_[_0x8ce5('0x58')](_0x31442c[_0x8ce5('0x44')]);_0x3b73fa[_0x8ce5('0x5a')]=_[_0x8ce5('0xd2')](_0x3b73fa['model'],_0x3b73fa[_0x8ce5('0x44')]);_0x9acc15[_0x8ce5('0x49')]=_['intersection'](_0x3b73fa[_0x8ce5('0x56')],qs[_0x8ce5('0x5b')](_0x31442c[_0x8ce5('0x44')][_0x8ce5('0x5b')]));_0x9acc15[_0x8ce5('0x49')]=_0x9acc15['attributes']['length']?_0x9acc15[_0x8ce5('0x49')]:_0x3b73fa[_0x8ce5('0x56')];_0x9acc15[_0x8ce5('0xd3')]=qs['sort'](_0x31442c[_0x8ce5('0x44')][_0x8ce5('0xd4')]);_0x9acc15['where']=qs[_0x8ce5('0x5a')](_[_0x8ce5('0xd6')](_0x31442c[_0x8ce5('0x44')],_0x3b73fa[_0x8ce5('0x5a')]));if(_0x31442c[_0x8ce5('0x44')][_0x8ce5('0x32')]){_0x9acc15['where']=_[_0x8ce5('0x5d')](_0x9acc15[_0x8ce5('0xd5')],{'$or':_[_0x8ce5('0x3c')](_0x9acc15[_0x8ce5('0x49')],function(_0x269aee){var _0x46bb5e={};_0x46bb5e[_0x269aee]={'$like':'%'+_0x31442c[_0x8ce5('0x44')][_0x8ce5('0x32')]+'%'};return _0x46bb5e;})});}_0x9acc15=_['merge']({},_0x9acc15,_0x31442c[_0x8ce5('0xe1')]);return _0x3e680e['getVoiceQueuesRt'](_0x9acc15);}})[_0x8ce5('0x17')](function(_0x57b16f){if(_0x57b16f){_0x3da529=_0x57b16f['length'];if(!_0x31442c['query']['hasOwnProperty'](_0x8ce5('0xde'))){_0x9acc15['limit']=qs[_0x8ce5('0xdf')](_0x31442c[_0x8ce5('0x44')][_0x8ce5('0xdf')]);_0x9acc15[_0x8ce5('0x25')]=qs[_0x8ce5('0x25')](_0x31442c['query']['offset']);}return _0x3e680e[_0x8ce5('0xe3')](_0x9acc15);}})[_0x8ce5('0x17')](function(_0x53bd8e){if(_0x53bd8e){return _0x53bd8e?{'count':_0x3da529,'rows':_0x53bd8e}:null;}})[_0x8ce5('0x17')](respondWithResult(_0x18fb35,null))[_0x8ce5('0x20')](handleError(_0x18fb35,null));};exports['getGroups']=function(_0x56d684,_0x4597c7){var _0x431594={};var _0xc96cd3={};var _0x2e7813;var _0x5f3888;return db[_0x8ce5('0x43')][_0x8ce5('0x9b')]({'where':{'id':_0x56d684[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x4597c7,null))[_0x8ce5('0x17')](function(_0x69e288){if(_0x69e288){_0x2e7813=_0x69e288;_0xc96cd3[_0x8ce5('0x56')]=_[_0x8ce5('0x58')](db[_0x8ce5('0xe4')][_0x8ce5('0x59')]);_0xc96cd3[_0x8ce5('0x44')]=_['keys'](_0x56d684['query']);_0xc96cd3[_0x8ce5('0x5a')]=_[_0x8ce5('0xd2')](_0xc96cd3[_0x8ce5('0x56')],_0xc96cd3[_0x8ce5('0x44')]);_0x431594[_0x8ce5('0x49')]=_[_0x8ce5('0xd2')](_0xc96cd3[_0x8ce5('0x56')],qs['fields'](_0x56d684['query']['fields']));_0x431594[_0x8ce5('0x49')]=_0x431594[_0x8ce5('0x49')][_0x8ce5('0x6f')]?_0x431594[_0x8ce5('0x49')]:_0xc96cd3[_0x8ce5('0x56')];_0x431594[_0x8ce5('0xd3')]=qs[_0x8ce5('0xd4')](_0x56d684['query'][_0x8ce5('0xd4')]);_0x431594[_0x8ce5('0xd5')]=qs[_0x8ce5('0x5a')](_[_0x8ce5('0xd6')](_0x56d684[_0x8ce5('0x44')],_0xc96cd3[_0x8ce5('0x5a')]));if(_0x56d684[_0x8ce5('0x44')][_0x8ce5('0x32')]){_0x431594[_0x8ce5('0xd5')]=_['merge'](_0x431594[_0x8ce5('0xd5')],{'$or':_['map'](_0x431594[_0x8ce5('0x49')],function(_0x122cc2){var _0x2658ef={};_0x2658ef[_0x122cc2]={'$like':'%'+_0x56d684['query'][_0x8ce5('0x32')]+'%'};return _0x2658ef;})});}_0x431594=_[_0x8ce5('0x5d')]({},_0x431594,_0x56d684['options']);return _0x2e7813[_0x8ce5('0xe5')](_0x431594);}})[_0x8ce5('0x17')](function(_0x4346f4){if(_0x4346f4){_0x5f3888=_0x4346f4['length'];if(!_0x56d684[_0x8ce5('0x44')][_0x8ce5('0xd7')](_0x8ce5('0xde'))){_0x431594['limit']=qs[_0x8ce5('0xdf')](_0x56d684['query'][_0x8ce5('0xdf')]);_0x431594[_0x8ce5('0x25')]=qs[_0x8ce5('0x25')](_0x56d684['query']['offset']);}return _0x2e7813[_0x8ce5('0xe5')](_0x431594);}})['then'](function(_0x549d3c){if(_0x549d3c){return _0x549d3c?{'count':_0x5f3888,'rows':_0x549d3c}:null;}})[_0x8ce5('0x17')](respondWithResult(_0x4597c7,null))[_0x8ce5('0x20')](handleError(_0x4597c7,null));};exports[_0x8ce5('0xe6')]=function(_0x1f2a7e,_0x243da1){var _0x4322d7={'raw':!![],'where':{}};var _0x7b303c={};var _0x296441={'count':0x0,'rows':[]};return db[_0x8ce5('0x43')]['findOne']({'where':{'id':_0x1f2a7e[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x243da1,null))[_0x8ce5('0x17')](function(_0x1ab497){if(_0x1ab497){_0x7b303c[_0x8ce5('0x56')]=_[_0x8ce5('0x58')](db['VoiceRecording'][_0x8ce5('0x59')]);_0x7b303c[_0x8ce5('0x44')]=_[_0x8ce5('0x58')](_0x1f2a7e[_0x8ce5('0x44')]);_0x7b303c[_0x8ce5('0x5a')]=_['intersection'](_0x7b303c['model'],_0x7b303c[_0x8ce5('0x44')]);_0x4322d7['attributes']=_[_0x8ce5('0xd2')](_0x7b303c[_0x8ce5('0x56')],qs[_0x8ce5('0x5b')](_0x1f2a7e[_0x8ce5('0x44')][_0x8ce5('0x5b')]));_0x4322d7[_0x8ce5('0x49')]=_0x4322d7[_0x8ce5('0x49')]['length']?_0x4322d7[_0x8ce5('0x49')]:_0x7b303c[_0x8ce5('0x56')];if(!_0x1f2a7e[_0x8ce5('0x44')]['hasOwnProperty'](_0x8ce5('0xde'))){_0x4322d7['limit']=qs[_0x8ce5('0xdf')](_0x1f2a7e[_0x8ce5('0x44')][_0x8ce5('0xdf')]);_0x4322d7['offset']=qs['offset'](_0x1f2a7e[_0x8ce5('0x44')][_0x8ce5('0x25')]);}_0x4322d7[_0x8ce5('0xd3')]=qs[_0x8ce5('0xd4')](_0x1f2a7e['query'][_0x8ce5('0xd4')]);_0x4322d7['where']=qs[_0x8ce5('0x5a')](_[_0x8ce5('0xd6')](_0x1f2a7e[_0x8ce5('0x44')],_0x7b303c['filters']));_0x4322d7[_0x8ce5('0xd5')]['UserId']=_0x1ab497['id'];if(_0x1f2a7e[_0x8ce5('0x44')][_0x8ce5('0x32')]){_0x4322d7['where']=_[_0x8ce5('0x5d')](_0x4322d7[_0x8ce5('0xd5')],{'$or':_[_0x8ce5('0x3c')](_0x4322d7[_0x8ce5('0x49')],function(_0x1a72bf){var _0x2e0c5c={};_0x2e0c5c[_0x1a72bf]={'$like':'%'+_0x1f2a7e[_0x8ce5('0x44')][_0x8ce5('0x32')]+'%'};return _0x2e0c5c;})});}_0x4322d7=_['merge']({},_0x4322d7,_0x1f2a7e[_0x8ce5('0xe1')]);return db['VoiceRecording'][_0x8ce5('0x27')]({'where':_0x4322d7[_0x8ce5('0xd5')]})[_0x8ce5('0x17')](function(_0xc75355){_0x296441[_0x8ce5('0x27')]=_0xc75355;if(_0x1f2a7e[_0x8ce5('0x44')][_0x8ce5('0x45')]){_0x4322d7['include']=[{'all':!![]}];}return db[_0x8ce5('0xe7')][_0x8ce5('0x4b')](_0x4322d7);})['then'](function(_0x2d0009){_0x296441[_0x8ce5('0x4c')]=_0x2d0009;return _0x296441;});}})['then'](respondWithFilteredResult(_0x243da1,_0x4322d7))[_0x8ce5('0x20')](handleError(_0x243da1,null));};exports[_0x8ce5('0xe8')]=function(_0x152d0c,_0x329572){var _0x9d6d52={'raw':!![],'where':{}};var _0x2446bc={};var _0x31f5c2={'count':0x0,'rows':[]};return db[_0x8ce5('0x43')]['findOne']({'where':{'id':_0x152d0c[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x329572,null))['then'](function(_0x1f4583){if(_0x1f4583){_0x2446bc['model']=_[_0x8ce5('0x58')](db[_0x8ce5('0xe9')][_0x8ce5('0x59')]);_0x2446bc[_0x8ce5('0x44')]=_['keys'](_0x152d0c[_0x8ce5('0x44')]);_0x2446bc[_0x8ce5('0x5a')]=_[_0x8ce5('0xd2')](_0x2446bc[_0x8ce5('0x56')],_0x2446bc[_0x8ce5('0x44')]);_0x9d6d52[_0x8ce5('0x49')]=_[_0x8ce5('0xd2')](_0x2446bc[_0x8ce5('0x56')],qs[_0x8ce5('0x5b')](_0x152d0c[_0x8ce5('0x44')][_0x8ce5('0x5b')]));_0x9d6d52[_0x8ce5('0x49')]=_0x9d6d52[_0x8ce5('0x49')][_0x8ce5('0x6f')]?_0x9d6d52[_0x8ce5('0x49')]:_0x2446bc[_0x8ce5('0x56')];if(!_0x152d0c[_0x8ce5('0x44')][_0x8ce5('0xd7')](_0x8ce5('0xde'))){_0x9d6d52[_0x8ce5('0xdf')]=qs[_0x8ce5('0xdf')](_0x152d0c[_0x8ce5('0x44')][_0x8ce5('0xdf')]);_0x9d6d52[_0x8ce5('0x25')]=qs[_0x8ce5('0x25')](_0x152d0c[_0x8ce5('0x44')][_0x8ce5('0x25')]);}_0x9d6d52[_0x8ce5('0xd3')]=qs['sort'](_0x152d0c['query'][_0x8ce5('0xd4')]);_0x9d6d52['where']=qs[_0x8ce5('0x5a')](_[_0x8ce5('0xd6')](_0x152d0c[_0x8ce5('0x44')],_0x2446bc[_0x8ce5('0x5a')]));_0x9d6d52['where'][_0x8ce5('0xea')]=_0x1f4583['id'];if(_0x152d0c[_0x8ce5('0x44')]['filter']){_0x9d6d52[_0x8ce5('0xd5')]=_[_0x8ce5('0x5d')](_0x9d6d52[_0x8ce5('0xd5')],{'$or':_[_0x8ce5('0x3c')](_0x9d6d52[_0x8ce5('0x49')],function(_0x43609b){var _0x4a4ce2={};_0x4a4ce2[_0x43609b]={'$like':'%'+_0x152d0c[_0x8ce5('0x44')][_0x8ce5('0x32')]+'%'};return _0x4a4ce2;})});}_0x9d6d52=_[_0x8ce5('0x5d')]({},_0x9d6d52,_0x152d0c[_0x8ce5('0xe1')]);return db['ScreenRecording'][_0x8ce5('0x27')]({'where':_0x9d6d52[_0x8ce5('0xd5')]})[_0x8ce5('0x17')](function(_0x5c9161){_0x31f5c2[_0x8ce5('0x27')]=_0x5c9161;if(_0x152d0c['query'][_0x8ce5('0x45')]){_0x9d6d52[_0x8ce5('0x46')]=[{'all':!![]}];}return db[_0x8ce5('0xe9')]['findAll'](_0x9d6d52);})[_0x8ce5('0x17')](function(_0xbf4859){_0x31f5c2[_0x8ce5('0x4c')]=_0xbf4859;return _0x31f5c2;});}})[_0x8ce5('0x17')](respondWithFilteredResult(_0x329572,_0x9d6d52))[_0x8ce5('0x20')](handleError(_0x329572,null));};exports['getChatInteractions']=function(_0x44d62a,_0x57fda4){var _0x4bc413={};var _0x450bdc={};var _0x48e57d;var _0x2706a1;return db[_0x8ce5('0x43')][_0x8ce5('0x9b')]({'where':{'id':_0x44d62a[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x57fda4,null))['then'](function(_0x2c0931){if(_0x2c0931){_0x48e57d=_0x2c0931;_0x450bdc[_0x8ce5('0x56')]=_[_0x8ce5('0x58')](db['ChatInteraction'][_0x8ce5('0x59')]);_0x450bdc[_0x8ce5('0x44')]=_['keys'](_0x44d62a[_0x8ce5('0x44')]);_0x450bdc['filters']=_[_0x8ce5('0xd2')](_0x450bdc['model'],_0x450bdc['query']);_0x4bc413[_0x8ce5('0x49')]=_['intersection'](_0x450bdc['model'],qs[_0x8ce5('0x5b')](_0x44d62a[_0x8ce5('0x44')][_0x8ce5('0x5b')]));_0x4bc413[_0x8ce5('0x49')]=_0x4bc413[_0x8ce5('0x49')][_0x8ce5('0x6f')]?_0x4bc413['attributes']:_0x450bdc['model'];_0x4bc413[_0x8ce5('0xd3')]=qs[_0x8ce5('0xd4')](_0x44d62a[_0x8ce5('0x44')][_0x8ce5('0xd4')]);_0x4bc413['where']=qs[_0x8ce5('0x5a')](_[_0x8ce5('0xd6')](_0x44d62a[_0x8ce5('0x44')],_0x450bdc['filters']));if(_0x44d62a[_0x8ce5('0x44')][_0x8ce5('0x32')]){_0x4bc413[_0x8ce5('0xd5')]=_['merge'](_0x4bc413[_0x8ce5('0xd5')],{'$or':_['map'](_0x4bc413[_0x8ce5('0x49')],function(_0x489c94){var _0x469399={};_0x469399[_0x489c94]={'$like':'%'+_0x44d62a[_0x8ce5('0x44')][_0x8ce5('0x32')]+'%'};return _0x469399;})});}_0x4bc413=_[_0x8ce5('0x5d')]({},_0x4bc413,_0x44d62a[_0x8ce5('0xe1')]);return _0x48e57d[_0x8ce5('0xeb')](_0x4bc413);}})[_0x8ce5('0x17')](function(_0x2b342a){if(_0x2b342a){_0x2706a1=_0x2b342a[_0x8ce5('0x6f')];if(!_0x44d62a['query'][_0x8ce5('0xd7')](_0x8ce5('0xde'))){_0x4bc413[_0x8ce5('0xdf')]=qs[_0x8ce5('0xdf')](_0x44d62a[_0x8ce5('0x44')]['limit']);_0x4bc413['offset']=qs['offset'](_0x44d62a[_0x8ce5('0x44')][_0x8ce5('0x25')]);}return _0x48e57d[_0x8ce5('0xeb')](_0x4bc413);}})[_0x8ce5('0x17')](function(_0x2a9d1d){if(_0x2a9d1d){return _0x2a9d1d?{'count':_0x2706a1,'rows':_0x2a9d1d}:null;}})[_0x8ce5('0x17')](respondWithResult(_0x57fda4,null))[_0x8ce5('0x20')](handleError(_0x57fda4,null));};exports[_0x8ce5('0xec')]=function(_0x3a87f3,_0x57b48d){var _0x59cac9={};var _0x336736={};var _0x2b586b;var _0x4e8fd5;return db['User'][_0x8ce5('0x9b')]({'where':{'id':_0x3a87f3[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x57b48d,null))[_0x8ce5('0x17')](function(_0x1c82fb){if(_0x1c82fb){_0x2b586b=_0x1c82fb;_0x336736[_0x8ce5('0x56')]=_[_0x8ce5('0x58')](db[_0x8ce5('0xed')][_0x8ce5('0x59')]);_0x336736[_0x8ce5('0x44')]=_[_0x8ce5('0x58')](_0x3a87f3[_0x8ce5('0x44')]);_0x336736['filters']=_['intersection'](_0x336736['model'],_0x336736[_0x8ce5('0x44')]);_0x59cac9['attributes']=_['intersection'](_0x336736[_0x8ce5('0x56')],qs[_0x8ce5('0x5b')](_0x3a87f3[_0x8ce5('0x44')][_0x8ce5('0x5b')]));_0x59cac9[_0x8ce5('0x49')]=_0x59cac9[_0x8ce5('0x49')][_0x8ce5('0x6f')]?_0x59cac9[_0x8ce5('0x49')]:_0x336736[_0x8ce5('0x56')];_0x59cac9[_0x8ce5('0xd3')]=qs[_0x8ce5('0xd4')](_0x3a87f3[_0x8ce5('0x44')]['sort']);_0x59cac9[_0x8ce5('0xd5')]=qs[_0x8ce5('0x5a')](_['pick'](_0x3a87f3['query'],_0x336736[_0x8ce5('0x5a')]));if(_0x3a87f3[_0x8ce5('0x44')][_0x8ce5('0x32')]){_0x59cac9['where']=_[_0x8ce5('0x5d')](_0x59cac9[_0x8ce5('0xd5')],{'$or':_[_0x8ce5('0x3c')](_0x59cac9[_0x8ce5('0x49')],function(_0xf49deb){var _0x558a21={};_0x558a21[_0xf49deb]={'$like':'%'+_0x3a87f3[_0x8ce5('0x44')][_0x8ce5('0x32')]+'%'};return _0x558a21;})});}_0x59cac9=_[_0x8ce5('0x5d')]({},_0x59cac9,_0x3a87f3[_0x8ce5('0xe1')]);return _0x2b586b[_0x8ce5('0xec')](_0x59cac9);}})[_0x8ce5('0x17')](function(_0x4fb752){if(_0x4fb752){_0x4e8fd5=_0x4fb752['length'];if(!_0x3a87f3['query'][_0x8ce5('0xd7')]('nolimit')){_0x59cac9[_0x8ce5('0xdf')]=qs[_0x8ce5('0xdf')](_0x3a87f3[_0x8ce5('0x44')][_0x8ce5('0xdf')]);_0x59cac9[_0x8ce5('0x25')]=qs[_0x8ce5('0x25')](_0x3a87f3[_0x8ce5('0x44')][_0x8ce5('0x25')]);}return _0x2b586b[_0x8ce5('0xec')](_0x59cac9);}})[_0x8ce5('0x17')](function(_0x5e9c5c){if(_0x5e9c5c){return _0x5e9c5c?{'count':_0x4e8fd5,'rows':_0x5e9c5c}:null;}})[_0x8ce5('0x17')](respondWithResult(_0x57b48d,null))[_0x8ce5('0x20')](handleError(_0x57b48d,null));};exports[_0x8ce5('0xee')]=function(_0x13ed1a,_0x107d12){var _0x1cc45f={'raw':!![],'where':{}};var _0x367742={};var _0xdd7cb7={'count':0x0,'rows':[]};return db['User'][_0x8ce5('0x9b')]({'where':{'id':_0x13ed1a[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x107d12,null))['then'](function(_0x304f62){if(_0x304f62){_0x367742['model']=_[_0x8ce5('0x58')](db[_0x8ce5('0xef')][_0x8ce5('0x59')]);_0x367742['query']=_[_0x8ce5('0x58')](_0x13ed1a['query']);_0x367742['filters']=_[_0x8ce5('0xd2')](_0x367742[_0x8ce5('0x56')],_0x367742['query']);_0x1cc45f[_0x8ce5('0x49')]=_['intersection'](_0x367742['model'],qs[_0x8ce5('0x5b')](_0x13ed1a[_0x8ce5('0x44')]['fields']));_0x1cc45f[_0x8ce5('0x49')]=_0x1cc45f[_0x8ce5('0x49')][_0x8ce5('0x6f')]?_0x1cc45f[_0x8ce5('0x49')]:_0x367742['model'];if(!_0x13ed1a[_0x8ce5('0x44')][_0x8ce5('0xd7')](_0x8ce5('0xde'))){_0x1cc45f[_0x8ce5('0xdf')]=qs[_0x8ce5('0xdf')](_0x13ed1a[_0x8ce5('0x44')][_0x8ce5('0xdf')]);_0x1cc45f[_0x8ce5('0x25')]=qs[_0x8ce5('0x25')](_0x13ed1a[_0x8ce5('0x44')][_0x8ce5('0x25')]);}_0x1cc45f['order']=qs['sort'](_0x13ed1a[_0x8ce5('0x44')][_0x8ce5('0xd4')]);_0x1cc45f[_0x8ce5('0xd5')]=qs[_0x8ce5('0x5a')](_[_0x8ce5('0xd6')](_0x13ed1a[_0x8ce5('0x44')],_0x367742[_0x8ce5('0x5a')]));_0x1cc45f[_0x8ce5('0xd5')][_0x8ce5('0xea')]=_0x304f62['id'];if(_0x13ed1a['query']['filter']){_0x1cc45f['where']=_[_0x8ce5('0x5d')](_0x1cc45f[_0x8ce5('0xd5')],{'$or':_['map'](_0x1cc45f['attributes'],function(_0x1bba52){var _0x1a754f={};_0x1a754f[_0x1bba52]={'$like':'%'+_0x13ed1a[_0x8ce5('0x44')][_0x8ce5('0x32')]+'%'};return _0x1a754f;})});}_0x1cc45f=_[_0x8ce5('0x5d')]({},_0x1cc45f,_0x13ed1a[_0x8ce5('0xe1')]);return db[_0x8ce5('0xef')][_0x8ce5('0x27')]({'where':_0x1cc45f['where']})[_0x8ce5('0x17')](function(_0x250f2c){_0xdd7cb7[_0x8ce5('0x27')]=_0x250f2c;if(_0x13ed1a[_0x8ce5('0x44')][_0x8ce5('0x45')]){_0x1cc45f[_0x8ce5('0x46')]=[{'all':!![]}];}return db['MailInteraction'][_0x8ce5('0x4b')](_0x1cc45f);})[_0x8ce5('0x17')](function(_0x2abbe7){_0xdd7cb7[_0x8ce5('0x4c')]=_0x2abbe7;return _0xdd7cb7;});}})[_0x8ce5('0x17')](respondWithFilteredResult(_0x107d12,_0x1cc45f))['catch'](handleError(_0x107d12,null));};exports[_0x8ce5('0xf0')]=function(_0x562852,_0x17dd87){var _0x3cff3b={};var _0x29c109={};var _0x36634d;var _0x1b4cea;return db[_0x8ce5('0x43')]['findOne']({'where':{'id':_0x562852[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x17dd87,null))[_0x8ce5('0x17')](function(_0x29a072){if(_0x29a072){_0x36634d=_0x29a072;_0x29c109[_0x8ce5('0x56')]=_['keys'](db[_0x8ce5('0xf1')]['rawAttributes']);_0x29c109[_0x8ce5('0x44')]=_[_0x8ce5('0x58')](_0x562852[_0x8ce5('0x44')]);_0x29c109['filters']=_[_0x8ce5('0xd2')](_0x29c109[_0x8ce5('0x56')],_0x29c109[_0x8ce5('0x44')]);_0x3cff3b[_0x8ce5('0x49')]=_[_0x8ce5('0xd2')](_0x29c109[_0x8ce5('0x56')],qs[_0x8ce5('0x5b')](_0x562852[_0x8ce5('0x44')][_0x8ce5('0x5b')]));_0x3cff3b[_0x8ce5('0x49')]=_0x3cff3b[_0x8ce5('0x49')]['length']?_0x3cff3b[_0x8ce5('0x49')]:_0x29c109['model'];_0x3cff3b[_0x8ce5('0xd3')]=qs[_0x8ce5('0xd4')](_0x562852[_0x8ce5('0x44')][_0x8ce5('0xd4')]);_0x3cff3b[_0x8ce5('0xd5')]=qs[_0x8ce5('0x5a')](_[_0x8ce5('0xd6')](_0x562852['query'],_0x29c109[_0x8ce5('0x5a')]));if(_0x562852[_0x8ce5('0x44')][_0x8ce5('0x32')]){_0x3cff3b[_0x8ce5('0xd5')]=_['merge'](_0x3cff3b[_0x8ce5('0xd5')],{'$or':_[_0x8ce5('0x3c')](_0x3cff3b[_0x8ce5('0x49')],function(_0x1639cf){var _0x44881b={};_0x44881b[_0x1639cf]={'$like':'%'+_0x562852[_0x8ce5('0x44')][_0x8ce5('0x32')]+'%'};return _0x44881b;})});}_0x3cff3b=_[_0x8ce5('0x5d')]({},_0x3cff3b,_0x562852[_0x8ce5('0xe1')]);return _0x36634d[_0x8ce5('0xf0')](_0x3cff3b);}})[_0x8ce5('0x17')](function(_0xda847c){if(_0xda847c){_0x1b4cea=_0xda847c[_0x8ce5('0x6f')];if(!_0x562852[_0x8ce5('0x44')][_0x8ce5('0xd7')]('nolimit')){_0x3cff3b[_0x8ce5('0xdf')]=qs[_0x8ce5('0xdf')](_0x562852[_0x8ce5('0x44')][_0x8ce5('0xdf')]);_0x3cff3b['offset']=qs[_0x8ce5('0x25')](_0x562852['query'][_0x8ce5('0x25')]);}return _0x36634d[_0x8ce5('0xf0')](_0x3cff3b);}})[_0x8ce5('0x17')](function(_0x522bba){if(_0x522bba){return _0x522bba?{'count':_0x1b4cea,'rows':_0x522bba}:null;}})[_0x8ce5('0x17')](respondWithResult(_0x17dd87,null))['catch'](handleError(_0x17dd87,null));};exports[_0x8ce5('0xf2')]=function(_0x3c70b2,_0x5ab788){var _0x418b69={};var _0x2eb4b8={};var _0x41064f;var _0x537e7b;return db[_0x8ce5('0x43')][_0x8ce5('0x9b')]({'where':{'id':_0x3c70b2[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x5ab788,null))[_0x8ce5('0x17')](function(_0x49f9f4){if(_0x49f9f4){_0x41064f=_0x49f9f4;_0x2eb4b8[_0x8ce5('0x56')]=_[_0x8ce5('0x58')](db[_0x8ce5('0xf3')][_0x8ce5('0x59')]);_0x2eb4b8['query']=_['keys'](_0x3c70b2[_0x8ce5('0x44')]);_0x2eb4b8['filters']=_[_0x8ce5('0xd2')](_0x2eb4b8[_0x8ce5('0x56')],_0x2eb4b8['query']);_0x418b69[_0x8ce5('0x49')]=_['intersection'](_0x2eb4b8['model'],qs[_0x8ce5('0x5b')](_0x3c70b2['query'][_0x8ce5('0x5b')]));_0x418b69[_0x8ce5('0x49')]=_0x418b69[_0x8ce5('0x49')][_0x8ce5('0x6f')]?_0x418b69[_0x8ce5('0x49')]:_0x2eb4b8['model'];_0x418b69['order']=qs[_0x8ce5('0xd4')](_0x3c70b2[_0x8ce5('0x44')][_0x8ce5('0xd4')]);_0x418b69['where']=qs['filters'](_[_0x8ce5('0xd6')](_0x3c70b2[_0x8ce5('0x44')],_0x2eb4b8[_0x8ce5('0x5a')]));if(_0x3c70b2[_0x8ce5('0x44')]['filter']){_0x418b69[_0x8ce5('0xd5')]=_[_0x8ce5('0x5d')](_0x418b69[_0x8ce5('0xd5')],{'$or':_[_0x8ce5('0x3c')](_0x418b69['attributes'],function(_0x4c4ce1){var _0x300164={};_0x300164[_0x4c4ce1]={'$like':'%'+_0x3c70b2['query'][_0x8ce5('0x32')]+'%'};return _0x300164;})});}_0x418b69=_[_0x8ce5('0x5d')]({},_0x418b69,_0x3c70b2[_0x8ce5('0xe1')]);return _0x41064f[_0x8ce5('0xf2')](_0x418b69);}})['then'](function(_0x3ffc1a){if(_0x3ffc1a){_0x537e7b=_0x3ffc1a[_0x8ce5('0x6f')];if(!_0x3c70b2[_0x8ce5('0x44')][_0x8ce5('0xd7')](_0x8ce5('0xde'))){_0x418b69[_0x8ce5('0xdf')]=qs[_0x8ce5('0xdf')](_0x3c70b2['query'][_0x8ce5('0xdf')]);_0x418b69[_0x8ce5('0x25')]=qs[_0x8ce5('0x25')](_0x3c70b2['query'][_0x8ce5('0x25')]);}return _0x41064f[_0x8ce5('0xf2')](_0x418b69);}})['then'](function(_0x3e9710){if(_0x3e9710){return _0x3e9710?{'count':_0x537e7b,'rows':_0x3e9710}:null;}})[_0x8ce5('0x17')](respondWithResult(_0x5ab788,null))[_0x8ce5('0x20')](handleError(_0x5ab788,null));};exports[_0x8ce5('0xf4')]=function(_0x1163f7,_0x2c71c4){var _0x54f4c4={};var _0xbc8d99={};var _0x54a563;var _0x27b1d3;return db[_0x8ce5('0x43')][_0x8ce5('0x9b')]({'where':{'id':_0x1163f7[_0x8ce5('0x61')]['id']}})['then'](handleEntityNotFound(_0x2c71c4,null))['then'](function(_0xde8242){if(_0xde8242){_0x54a563=_0xde8242;_0xbc8d99[_0x8ce5('0x56')]=_['keys'](db[_0x8ce5('0xf5')][_0x8ce5('0x59')]);_0xbc8d99[_0x8ce5('0x44')]=_[_0x8ce5('0x58')](_0x1163f7[_0x8ce5('0x44')]);_0xbc8d99[_0x8ce5('0x5a')]=_[_0x8ce5('0xd2')](_0xbc8d99[_0x8ce5('0x56')],_0xbc8d99['query']);_0x54f4c4['attributes']=_['intersection'](_0xbc8d99[_0x8ce5('0x56')],qs[_0x8ce5('0x5b')](_0x1163f7[_0x8ce5('0x44')][_0x8ce5('0x5b')]));_0x54f4c4[_0x8ce5('0x49')]=_0x54f4c4[_0x8ce5('0x49')][_0x8ce5('0x6f')]?_0x54f4c4[_0x8ce5('0x49')]:_0xbc8d99['model'];_0x54f4c4[_0x8ce5('0xd3')]=qs[_0x8ce5('0xd4')](_0x1163f7['query'][_0x8ce5('0xd4')]);_0x54f4c4['where']=qs[_0x8ce5('0x5a')](_[_0x8ce5('0xd6')](_0x1163f7['query'],_0xbc8d99['filters']));if(_0x1163f7[_0x8ce5('0x44')][_0x8ce5('0x32')]){_0x54f4c4[_0x8ce5('0xd5')]=_['merge'](_0x54f4c4[_0x8ce5('0xd5')],{'$or':_[_0x8ce5('0x3c')](_0x54f4c4[_0x8ce5('0x49')],function(_0x228ea6){var _0x403106={};_0x403106[_0x228ea6]={'$like':'%'+_0x1163f7[_0x8ce5('0x44')][_0x8ce5('0x32')]+'%'};return _0x403106;})});}_0x54f4c4=_[_0x8ce5('0x5d')]({},_0x54f4c4,_0x1163f7['options']);return _0x54a563[_0x8ce5('0xf4')](_0x54f4c4);}})[_0x8ce5('0x17')](function(_0x7e3dd0){if(_0x7e3dd0){_0x27b1d3=_0x7e3dd0[_0x8ce5('0x6f')];if(!_0x1163f7[_0x8ce5('0x44')][_0x8ce5('0xd7')](_0x8ce5('0xde'))){_0x54f4c4[_0x8ce5('0xdf')]=qs['limit'](_0x1163f7[_0x8ce5('0x44')][_0x8ce5('0xdf')]);_0x54f4c4[_0x8ce5('0x25')]=qs['offset'](_0x1163f7['query'][_0x8ce5('0x25')]);}return _0x54a563['getWhatsappInteractions'](_0x54f4c4);}})['then'](function(_0x58ac62){if(_0x58ac62){return _0x58ac62?{'count':_0x27b1d3,'rows':_0x58ac62}:null;}})['then'](respondWithResult(_0x2c71c4,null))[_0x8ce5('0x20')](handleError(_0x2c71c4,null));};exports[_0x8ce5('0xf6')]=function(_0x17751f,_0x423a46,_0x5260b0){var _0x133b18;var _0x9dc17a;var _0x31e39e;var _0x23228e=!_[_0x8ce5('0x69')](_0x17751f[_0x8ce5('0x61')]['id'])?_0x17751f['params']['id']:!_[_0x8ce5('0x69')](_0x17751f[_0x8ce5('0x81')]['id'])?_0x17751f[_0x8ce5('0x81')]['id']:null;return db[_0x8ce5('0x43')]['find']({'where':{'id':_0x23228e,'role':{'$or':[_0x8ce5('0x2e'),'user','agent']}},'attributes':['id',_0x8ce5('0x37'),_0x8ce5('0xf7'),_0x8ce5('0xf8'),'role',_0x8ce5('0x64'),'loginInPause']})[_0x8ce5('0x17')](function(_0x10a9ad){if(_0x10a9ad){if(_0x10a9ad[_0x8ce5('0x34')]===_0x8ce5('0x31')){_0x133b18=_0x10a9ad;if(_0x17751f[_0x8ce5('0x5e')]['interface']){_0x31e39e=util[_0x8ce5('0xaf')](_0x8ce5('0xf9'),_0x133b18[_0x17751f['body'][_0x8ce5('0xa6')]]);}else if(_0x17751f[_0x8ce5('0x5e')]['intrf']){_0x31e39e=util[_0x8ce5('0xaf')](_0x8ce5('0xb0'),_0x17751f['body'][_0x8ce5('0xfa')]);}else{_0x31e39e=util[_0x8ce5('0xaf')]('SIP/%s',_0x133b18[_0x8ce5('0x37')]);}socket['to'](util['format'](_0x8ce5('0xfb'),_0x133b18[_0x8ce5('0x37')]))[_0x8ce5('0x2a')](_0x8ce5('0xfc'),{'user':{'id':_0x133b18['id'],'name':_0x133b18[_0x8ce5('0x37')]},'ip':_0x17751f[_0x8ce5('0xfd')]['x-forwarded-for']||_0x17751f['connection'][_0x8ce5('0xfe')]||_0x17751f[_0x8ce5('0xff')][_0x8ce5('0xfe')]||_0x17751f[_0x8ce5('0x100')][_0x8ce5('0xff')][_0x8ce5('0xfe')]});return db[_0x8ce5('0xb1')][_0x8ce5('0x2c')]({'where':{'membername':_0x133b18['name']},'individualHooks':!![]});}}else{throw new db[(_0x8ce5('0x94'))][(_0x8ce5('0x97'))](_0x8ce5('0x101'));}})[_0x8ce5('0x17')](function(){if(_0x133b18){return _0x133b18['getVoiceQueues']({'raw':!![]});}})[_0x8ce5('0x17')](function(_0x3061b8){if(_0x133b18){var _0x224c39=[];if(_0x3061b8){_0x9dc17a=_0x3061b8;if(_0x9dc17a[_0x8ce5('0x6f')]){for(var _0x15e5d6=0x0;_0x15e5d6<_0x9dc17a[_0x8ce5('0x6f')];_0x15e5d6++){_0x224c39['push']({'membername':_0x133b18[_0x8ce5('0x37')],'UserId':_0x133b18['id'],'queue_name':_0x9dc17a[_0x15e5d6][_0x8ce5('0x37')],'VoiceQueueId':_0x9dc17a[_0x15e5d6]['id'],'interface':_0x31e39e,'paused':_0x133b18[_0x8ce5('0xa4')]||![],'penalty':_0x9dc17a[_0x15e5d6]['UserVoiceQueue.penalty']||0x0});}return BPromise['each'](_0x224c39,function(_0x42b2ac){return db[_0x8ce5('0xb1')]['upsert'](_0x42b2ac);});}}}})[_0x8ce5('0x17')](function(){if(_0x133b18){return db[_0x8ce5('0x102')][_0x8ce5('0x4b')]({'where':{'membername':_0x133b18[_0x8ce5('0x37')],'exitAt':null}});}})[_0x8ce5('0x17')](function(_0x32c727){if(_0x133b18){var _0x16412f=[];_0x32c727[_0x8ce5('0x103')](function(_0x293a6e){_0x16412f[_0x8ce5('0x4a')](_0x293a6e[_0x8ce5('0x29')]({'exitAt':moment()[_0x8ce5('0xaf')](_0x8ce5('0x104'))}));});return BPromise[_0x8ce5('0x54')](_0x16412f);}})['then'](function(){if(_0x133b18){var _0x1a2fc8=[];var _0x36bf55=[];var _0x1c1202=utils[_0x8ce5('0x105')]();var _0x1d54c5={'membername':_0x133b18[_0x8ce5('0x37')],'interface':_0x31e39e,'enterAt':moment()['format'](_0x8ce5('0x104')),'role':_0x133b18[_0x8ce5('0x34')],'internal':_0x133b18[_0x8ce5('0x64')]};_0x1c1202[_0x8ce5('0x103')](function(_0x5ada51){_0x1a2fc8[_0x8ce5('0x4a')](_[_0x8ce5('0x5d')]({'channel':_0x5ada51,'type':_0x8ce5('0x106'),'data1':_0x17751f[_0x8ce5('0x5e')]['device'],'data2':_0x31e39e},_0x1d54c5));if(_0x133b18[_0x8ce5('0xa4')]){_0x36bf55['push'](_[_0x8ce5('0x5d')]({'channel':_0x5ada51,'type':_0x8ce5('0x107'),'data1':'LOGININPAUSE'},_0x1d54c5));}});return db[_0x8ce5('0x102')]['bulkCreate'](_0x1a2fc8[_0x8ce5('0x108')](_0x36bf55),{'individualHooks':!![]});}})[_0x8ce5('0x17')](function(){if(_0x133b18){return _0x133b18['update']({'online':!![],'lastLoginAt':moment()[_0x8ce5('0xaf')](_0x8ce5('0x104')),'voicePause':_0x133b18['loginInPause']||![],'mailPause':_0x133b18[_0x8ce5('0xa4')]||![],'chatPause':_0x133b18['loginInPause']||![],'faxPause':_0x133b18[_0x8ce5('0xa4')]||![],'smsPause':_0x133b18[_0x8ce5('0xa4')]||![],'openchannelPause':_0x133b18[_0x8ce5('0xa4')]||![],'whatsappPause':_0x133b18['loginInPause']||![],'pauseType':_0x133b18[_0x8ce5('0xa4')]?_0x8ce5('0x109'):null,'interface':_0x31e39e,'lastPauseAt':moment()[_0x8ce5('0xaf')]('YYYY-MM-DD\x20HH:mm:ss')});}})['then'](function(_0x398167){if(_0x17751f[_0x8ce5('0x10a')]){return _0x5260b0();}else{return BPromise[_0x8ce5('0x10b')](_0x398167)['then'](respondWithResult(_0x423a46,null));}})[_0x8ce5('0x20')](handleError(_0x423a46,null));};exports['logout']=function(_0x3498b2,_0x3ba8e5){var _0x16e9ad;return db['User'][_0x8ce5('0x35')]({'where':{'id':_0x3498b2[_0x8ce5('0x61')]['id'],'role':_0x8ce5('0x31')},'attributes':['id',_0x8ce5('0x37'),_0x8ce5('0x34')]})[_0x8ce5('0x17')](handleEntityNotFound(_0x3ba8e5,null))[_0x8ce5('0x17')](function(_0x2f2b8f){if(_0x2f2b8f){_0x16e9ad=_0x2f2b8f;return db[_0x8ce5('0xb1')]['destroy']({'where':{'membername':_0x16e9ad[_0x8ce5('0x37')]},'individualHooks':!![]});}})[_0x8ce5('0x17')](function(){return db[_0x8ce5('0x102')]['findAll']({'where':{'membername':_0x16e9ad[_0x8ce5('0x37')],'exitAt':null}});})['then'](function(_0xae3355){var _0x1bd3bf=[];_0xae3355[_0x8ce5('0x103')](function(_0x1e06cb){_0x1bd3bf[_0x8ce5('0x4a')](_0x1e06cb[_0x8ce5('0x29')]({'exitAt':moment()[_0x8ce5('0xaf')](_0x8ce5('0x104'))}));});return BPromise[_0x8ce5('0x54')](_0x1bd3bf);})[_0x8ce5('0x17')](function(){return _0x16e9ad[_0x8ce5('0x29')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x8ce5('0x17')](respondWithResult(_0x3ba8e5,null))['catch'](handleError(_0x3ba8e5,null));};exports[_0x8ce5('0x10c')]=function(_0x5a1b3b,_0x52d874){var _0x51992b;return db[_0x8ce5('0xb1')][_0x8ce5('0x29')]({'paused':0x1},{'where':{'UserId':_0x5a1b3b[_0x8ce5('0x61')]['id']},'individualHooks':!![]})[_0x8ce5('0x17')](function(){return db['User']['find']({'where':{'id':_0x5a1b3b['params']['id'],'role':_0x8ce5('0x31')},'attributes':['id',_0x8ce5('0x37'),_0x8ce5('0x34'),_0x8ce5('0x64'),'interface']});})['then'](handleEntityNotFound(_0x52d874,null))[_0x8ce5('0x17')](function(_0x4eeaad){if(_0x4eeaad){_0x51992b=_0x4eeaad;return respondWithRpcPromise(_0x8ce5('0x10d'),_0x8ce5('0x10c'),{'id':_0x51992b['id'],'name':_0x51992b['name'],'pause':!![]});}})[_0x8ce5('0x17')](function(){if(_0x51992b){return db['MemberReport'][_0x8ce5('0x4b')]({'where':{'membername':_0x51992b[_0x8ce5('0x37')],'type':_0x8ce5('0x107'),'exitAt':null}});}})[_0x8ce5('0x17')](function(_0x267f5b){if(_0x267f5b[_0x8ce5('0x6f')]){var _0x112ec0=moment()[_0x8ce5('0xaf')](_0x8ce5('0x104'));for(var _0xe5fade=0x0,_0x4dc988=_0x267f5b[_0x8ce5('0x6f')];_0xe5fade<_0x4dc988;_0xe5fade++){_0x267f5b[_0xe5fade][_0x8ce5('0x10e')]({'exitAt':_0x112ec0});}}})['then'](function(){var _0x19cc87=[];var _0x5832c1=utils[_0x8ce5('0x105')]();_0x5832c1['forEach'](function(_0x364b44){_0x19cc87[_0x8ce5('0x4a')]({'channel':_0x364b44,'membername':_0x51992b[_0x8ce5('0x37')],'interface':_[_0x8ce5('0x69')](_0x51992b[_0x8ce5('0xa6')])?util[_0x8ce5('0xaf')](_0x8ce5('0xb0'),_0x51992b[_0x8ce5('0x37')]):_0x51992b[_0x8ce5('0xa6')],'type':'PAUSE','enterAt':moment()[_0x8ce5('0xaf')](_0x8ce5('0x104')),'data1':_0x5a1b3b[_0x8ce5('0x5e')][_0x8ce5('0x3e')]||_0x8ce5('0x10f'),'role':_0x51992b[_0x8ce5('0x34')],'internal':_0x51992b[_0x8ce5('0x64')]});});return db[_0x8ce5('0x102')]['bulkCreate'](_0x19cc87,{'individualHooks':!![]});})[_0x8ce5('0x17')](function(){return _0x51992b[_0x8ce5('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x5a1b3b[_0x8ce5('0x5e')][_0x8ce5('0x3e')]||_0x8ce5('0x10f'),'lastPauseAt':moment()[_0x8ce5('0xaf')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x8ce5('0x17')](respondWithResult(_0x52d874,null))['catch'](handleError(_0x52d874,null));};exports[_0x8ce5('0x110')]=function(_0x2bbb32,_0x3640f6){var _0x39255c;return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x2bbb32['params']['id']},'attributes':['id','name',_0x8ce5('0x34'),_0x8ce5('0xa5'),'mailPause',_0x8ce5('0x111'),_0x8ce5('0x112'),'openchannelPause',_0x8ce5('0x113'),_0x8ce5('0x114'),_0x8ce5('0x115'),_0x8ce5('0x116')]})[_0x8ce5('0x17')](handleEntityNotFound(_0x3640f6,null))['then'](function(_0x5d9284){if(_0x5d9284){_0x39255c=_0x5d9284;if(_0x2bbb32['body'][_0x8ce5('0xb3')]&&!utils['isValidChannel'](_0x2bbb32[_0x8ce5('0x5e')][_0x8ce5('0xb3')])){throw new db[(_0x8ce5('0x94'))][(_0x8ce5('0x97'))]('Unknown\x20channel');}switch(_0x2bbb32[_0x8ce5('0x5e')]['channel']){case _0x8ce5('0xae'):return respondWithRpcPromise(_0x8ce5('0x10d'),_0x8ce5('0x110'),{'id':_0x39255c['id'],'name':_0x39255c[_0x8ce5('0x37')],'pause':![]})[_0x8ce5('0x17')](function(){return db[_0x8ce5('0xb1')]['update']({'paused':0x0},{'where':{'UserId':_0x39255c['id']},'individualHooks':!![]});})[_0x8ce5('0x17')](function(){return db[_0x8ce5('0x102')][_0x8ce5('0x35')]({'where':{'channel':_0x2bbb32['body']['channel'],'membername':_0x39255c[_0x8ce5('0x37')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x41c831){if(_0x41c831){return _0x41c831['update']({'exitAt':moment()[_0x8ce5('0xaf')](_0x8ce5('0x104')),'data2':_0x8ce5('0x117')},{'individualHooks':!![]});}return null;})[_0x8ce5('0x17')](function(){return _0x39255c[_0x8ce5('0x29')]({'voicePause':![]});});case _0x8ce5('0x51'):case'chat':case _0x8ce5('0x50'):case _0x8ce5('0x4e'):case'whatsapp':case _0x8ce5('0x52'):return db[_0x8ce5('0x102')][_0x8ce5('0x35')]({'where':{'channel':_0x2bbb32[_0x8ce5('0x5e')][_0x8ce5('0xb3')],'membername':_0x39255c[_0x8ce5('0x37')],'type':_0x8ce5('0x107'),'exitAt':null}})['then'](function(_0x309323){if(_0x309323){return _0x309323['update']({'exitAt':moment()[_0x8ce5('0xaf')](_0x8ce5('0x104')),'data2':_0x8ce5('0x117')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x347211={};_['set'](_0x347211,util[_0x8ce5('0xaf')](_0x8ce5('0x118'),_0x2bbb32['body'][_0x8ce5('0xb3')],_0x8ce5('0x119')),![]);return _0x39255c['update'](_0x347211);});default:return respondWithRpcPromise(_0x8ce5('0x10d'),_0x8ce5('0x110'),{'id':_0x39255c['id'],'name':_0x39255c[_0x8ce5('0x37')],'pause':![]})[_0x8ce5('0x17')](function(){return db[_0x8ce5('0xb1')][_0x8ce5('0x29')]({'paused':0x0},{'where':{'UserId':_0x39255c['id']}});})[_0x8ce5('0x17')](function(){return db[_0x8ce5('0x102')][_0x8ce5('0x4b')]({'where':{'membername':_0x39255c[_0x8ce5('0x37')],'type':'PAUSE','exitAt':null}});})[_0x8ce5('0x17')](function(_0x227265){var _0x23bf7f=[];_0x227265['forEach'](function(_0x405c72){_0x23bf7f['push'](_0x405c72[_0x8ce5('0x29')]({'exitAt':moment()[_0x8ce5('0xaf')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x8ce5('0x117')}));});return BPromise['all'](_0x23bf7f);})[_0x8ce5('0x17')](function(){return _0x39255c['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x8ce5('0x17')](respondWithResult(_0x3640f6,null))[_0x8ce5('0x20')](handleError(_0x3640f6,null));};exports[_0x8ce5('0x11a')]=function(_0x5530f2,_0x4953c2){var _0x4c4c2c={};var _0x55737b={};var _0x3348e6;var _0x198424;return db['User'][_0x8ce5('0x9b')]({'where':{'id':_0x5530f2['params']['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x4953c2,null))[_0x8ce5('0x17')](function(_0x1644d5){if(_0x1644d5){_0x3348e6=_0x1644d5;_0x55737b[_0x8ce5('0x56')]=_['keys'](db[_0x8ce5('0x11b')][_0x8ce5('0x59')]);_0x55737b[_0x8ce5('0x44')]=_['keys'](_0x5530f2[_0x8ce5('0x44')]);_0x55737b[_0x8ce5('0x5a')]=_[_0x8ce5('0xd2')](_0x55737b[_0x8ce5('0x56')],_0x55737b[_0x8ce5('0x44')]);_0x4c4c2c[_0x8ce5('0x49')]=_['intersection'](_0x55737b[_0x8ce5('0x56')],qs[_0x8ce5('0x5b')](_0x5530f2['query']['fields']));_0x4c4c2c[_0x8ce5('0x49')]=_0x4c4c2c[_0x8ce5('0x49')][_0x8ce5('0x6f')]?_0x4c4c2c[_0x8ce5('0x49')]:_0x55737b[_0x8ce5('0x56')];_0x4c4c2c[_0x8ce5('0xd3')]=qs['sort'](_0x5530f2[_0x8ce5('0x44')][_0x8ce5('0xd4')]);_0x4c4c2c[_0x8ce5('0xd5')]=qs[_0x8ce5('0x5a')](_[_0x8ce5('0xd6')](_0x5530f2[_0x8ce5('0x44')],_0x55737b[_0x8ce5('0x5a')]));if(_0x5530f2[_0x8ce5('0x44')]['filter']){_0x4c4c2c['where']=_[_0x8ce5('0x5d')](_0x4c4c2c['where'],{'$or':_[_0x8ce5('0x3c')](_0x4c4c2c[_0x8ce5('0x49')],function(_0x4e52d1){var _0x422c8e={};_0x422c8e[_0x4e52d1]={'$like':'%'+_0x5530f2[_0x8ce5('0x44')][_0x8ce5('0x32')]+'%'};return _0x422c8e;})});}_0x4c4c2c=_[_0x8ce5('0x5d')]({},_0x4c4c2c,_0x5530f2[_0x8ce5('0xe1')]);return _0x3348e6['getTeams'](_0x4c4c2c);}})[_0x8ce5('0x17')](function(_0x2f6056){if(_0x2f6056){_0x198424=_0x2f6056[_0x8ce5('0x6f')];if(!_0x5530f2[_0x8ce5('0x44')][_0x8ce5('0xd7')](_0x8ce5('0xde'))){_0x4c4c2c[_0x8ce5('0xdf')]=qs[_0x8ce5('0xdf')](_0x5530f2['query']['limit']);_0x4c4c2c['offset']=qs['offset'](_0x5530f2[_0x8ce5('0x44')]['offset']);}return _0x3348e6[_0x8ce5('0x11a')](_0x4c4c2c);}})[_0x8ce5('0x17')](function(_0x1d5097){if(_0x1d5097){return _0x1d5097?{'count':_0x198424,'rows':_0x1d5097}:null;}})[_0x8ce5('0x17')](respondWithResult(_0x4953c2,null))[_0x8ce5('0x20')](handleError(_0x4953c2,null));};exports[_0x8ce5('0x11c')]=function(_0x115cb3,_0x1cc213){var _0x1e61e4=_0x115cb3[_0x8ce5('0x61')]['id'];var _0x50d997=_0x115cb3[_0x8ce5('0x5e')]?_0x115cb3['body'][_0x8ce5('0x62')]:null;var _0x1b8538=[];return Promise[_0x8ce5('0x10b')]()[_0x8ce5('0x17')](function(){if(!_0x50d997)throw new APIBadRequestError(_0x8ce5('0x11d'));})[_0x8ce5('0x17')](function(){return db['User'][_0x8ce5('0x9b')]({'where':{'id':_0x1e61e4}});})[_0x8ce5('0x17')](function(_0x135edf){if(!_0x135edf)throw new APINotFoundError(util[_0x8ce5('0xaf')](_0x8ce5('0x11e'),_0x115cb3[_0x8ce5('0x61')]['id']));return db['sequelize']['transaction'](function(_0x27963a){return _0x135edf[_0x8ce5('0x11c')](_0x50d997,{'transaction':_0x27963a})[_0x8ce5('0x17')](function(){return db[_0x8ce5('0x11b')]['findAll']({'where':{'id':{'$in':_0x50d997}}});})['then'](function(_0x18ad33){var _0x41d557=_['map'](_0x18ad33,function(_0x5c8176){return _0x5c8176['getAssociatedQueues']();});return Promise['all'](_0x41d557);})['then'](function(_0x1a17c7){_0x1b8538=_['flattenDeep'](_0x1a17c7);var _0x3d542c=_['map'](_0x1b8538,function(_0xd922e4){return _0xd922e4[_0x8ce5('0x11f')](_0x135edf['id'],{'transaction':_0x27963a});});return Promise[_0x8ce5('0x54')](_0x3d542c);})[_0x8ce5('0x17')](function(){if(!_0x135edf[_0x8ce5('0xa3')])return;var _0x474cd0=_[_0x8ce5('0x32')](_0x1b8538,function(_0x9160ae){return _0x9160ae[_0x8ce5('0x120')](_0x8ce5('0xb3'))===_0x8ce5('0x121');});var _0x1eb30b=_[_0x8ce5('0x3c')](_0x474cd0,function(_0x1aff67){return db['UserVoiceQueueRt'][_0x8ce5('0x122')]({'membername':_0x135edf[_0x8ce5('0x37')],'UserId':_0x135edf['id'],'queue_name':_0x1aff67[_0x8ce5('0x37')],'VoiceQueueId':_0x1aff67['id'],'interface':_[_0x8ce5('0x69')](_0x135edf[_0x8ce5('0xa6')])?util[_0x8ce5('0xaf')](_0x8ce5('0xb0'),_0x135edf['name']):_0x135edf[_0x8ce5('0xa6')],'paused':_0x135edf['voicePause']||![],'penalty':_0x135edf[_0x8ce5('0xab')]},{'transaction':_0x27963a});});return Promise[_0x8ce5('0x54')](_0x1eb30b);})[_0x8ce5('0x17')](function(){return db[_0x8ce5('0x123')][_0x8ce5('0x4b')]({'where':{'teamId':{'$in':_0x50d997}}});})[_0x8ce5('0x17')](function(_0x1e1056){var _0x522fd1=_['map'](_0x1e1056,function(_0x4f6814){return db[_0x8ce5('0x124')][_0x8ce5('0x86')]({'UserId':_0x135edf['id'],'VoicePrefixId':_0x4f6814[_0x8ce5('0x125')]},{'transaction':_0x27963a});});return Promise[_0x8ce5('0x54')](_0x522fd1);});});})[_0x8ce5('0x17')](function(){for(var _0x24208f=0x0;_0x24208f<_0x1b8538[_0x8ce5('0x6f')];_0x24208f++){var _0x1db355=_0x1b8538[_0x24208f][_0x8ce5('0x120')]('channel');var _0x53f0b6=_0x1db355+_0x8ce5('0xb7');socket[_0x8ce5('0x2a')](_0x8ce5('0x81')+_0x1db355+_0x8ce5('0xad'),{'UserId':_0x1e61e4,['queueField']:_0x1b8538[_0x24208f]['id']});}})['then'](respondWithStatusCode(_0x1cc213,null))[_0x8ce5('0x20')](APIHandleError(_0x1cc213));};exports[_0x8ce5('0x126')]=function(_0xfb4c92,_0x567ace){var _0x51394e=_0xfb4c92[_0x8ce5('0x61')]['id'];var _0xafde53=null;if(_0xfb4c92['query'][_0x8ce5('0x62')]){_0xafde53=_[_0x8ce5('0xb6')](_0xfb4c92[_0x8ce5('0x44')][_0x8ce5('0x62')])?_0xfb4c92['query'][_0x8ce5('0x62')]:[_0xfb4c92[_0x8ce5('0x44')][_0x8ce5('0x62')]];}var _0x42fc2b=[];return Promise[_0x8ce5('0x10b')]()['then'](function(){if(!_0xafde53)throw new APIBadRequestError(_0x8ce5('0x127'));})[_0x8ce5('0x17')](function(){return db[_0x8ce5('0x43')][_0x8ce5('0x9b')]({'where':{'id':_0x51394e}});})[_0x8ce5('0x17')](function(_0x2e54fe){if(!_0x2e54fe)throw new APINotFoundError(util[_0x8ce5('0xaf')](_0x8ce5('0x11e'),_0xfb4c92[_0x8ce5('0x61')]['id']));return db[_0x8ce5('0x6b')][_0x8ce5('0x128')](function(_0x59d9b8){return _0x2e54fe['removeTeams'](_0xafde53,{'transaction':_0x59d9b8})[_0x8ce5('0x17')](function(){return db[_0x8ce5('0x11b')][_0x8ce5('0x4b')]({'where':{'id':{'$in':_0xafde53}}});})['then'](function(_0x251166){var _0x165924=_[_0x8ce5('0x3c')](_0x251166,function(_0x22a4fa){return _0x22a4fa[_0x8ce5('0x129')]();});return Promise[_0x8ce5('0x54')](_0x165924);})[_0x8ce5('0x17')](function(_0x248b54){_0x42fc2b=_['flattenDeep'](_0x248b54);var _0x497c93=_[_0x8ce5('0x3c')](_0x42fc2b,function(_0x40378b){return _0x40378b[_0x8ce5('0x12a')](_0x2e54fe['id'],{'transaction':_0x59d9b8});});return Promise[_0x8ce5('0x54')](_0x497c93);})[_0x8ce5('0x17')](function(){if(!_0x2e54fe['online'])return;var _0x29afa3=_[_0x8ce5('0x32')](_0x42fc2b,function(_0x17c454){return _0x17c454['getDataValue'](_0x8ce5('0xb3'))==='Voice';});var _0x4d9508=_[_0x8ce5('0x3c')](_0x29afa3,function(_0x559858){return db[_0x8ce5('0xb1')][_0x8ce5('0x2c')]({'where':{'VoiceQueueId':_0x559858['id'],'UserId':_0x2e54fe['id']},'transaction':_0x59d9b8});});return Promise[_0x8ce5('0x54')](_0x4d9508);})[_0x8ce5('0x17')](function(){return db[_0x8ce5('0x123')][_0x8ce5('0x4b')]({'where':{'teamId':{'$in':_0xafde53}}});})['then'](function(_0x4bb66e){var _0x392e76=_[_0x8ce5('0x3c')](_0x4bb66e,function(_0x369109){return db[_0x8ce5('0x124')][_0x8ce5('0x2c')]({'where':{'UserId':_0x2e54fe['id'],'VoicePrefixId':_0x369109[_0x8ce5('0x125')]}},{'transaction':_0x59d9b8});});return Promise[_0x8ce5('0x54')](_0x392e76);});});})[_0x8ce5('0x17')](function(){for(var _0x58623f=0x0;_0x58623f<_0x42fc2b[_0x8ce5('0x6f')];_0x58623f++){var _0xf0f204=_0x42fc2b[_0x58623f]['getDataValue']('channel');var _0x46267d=_0xf0f204+_0x8ce5('0xb7');socket[_0x8ce5('0x2a')](_0x8ce5('0x81')+_0xf0f204+_0x8ce5('0xb8'),{'UserId':_0x51394e,['queueField']:_0x42fc2b[_0x58623f]['id']});}})['then'](respondWithStatusCode(_0x567ace,null))[_0x8ce5('0x20')](APIHandleError(_0x567ace));};exports[_0x8ce5('0x12b')]=function(_0x48bdd2,_0x761da8){var _0x2e687f={};var _0x42fdda={};var _0xf6f838;var _0x131dc5;return db[_0x8ce5('0x43')][_0x8ce5('0x9b')]({'where':{'id':_0x48bdd2[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x761da8,null))[_0x8ce5('0x17')](function(_0x4a111a){if(_0x4a111a){_0xf6f838=_0x4a111a;_0x42fdda[_0x8ce5('0x56')]=_[_0x8ce5('0x58')](db['CmList'][_0x8ce5('0x59')]);_0x42fdda[_0x8ce5('0x44')]=_[_0x8ce5('0x58')](_0x48bdd2[_0x8ce5('0x44')]);_0x42fdda[_0x8ce5('0x5a')]=_[_0x8ce5('0xd2')](_0x42fdda[_0x8ce5('0x56')],_0x42fdda['query']);_0x2e687f[_0x8ce5('0x49')]=_[_0x8ce5('0xd2')](_0x42fdda[_0x8ce5('0x56')],qs['fields'](_0x48bdd2[_0x8ce5('0x44')][_0x8ce5('0x5b')]));_0x2e687f[_0x8ce5('0x49')]=_0x2e687f[_0x8ce5('0x49')]['length']?_0x2e687f[_0x8ce5('0x49')]:_0x42fdda['model'];_0x2e687f['order']=qs[_0x8ce5('0xd4')](_0x48bdd2[_0x8ce5('0x44')][_0x8ce5('0xd4')]);_0x2e687f['where']=qs[_0x8ce5('0x5a')](_['pick'](_0x48bdd2[_0x8ce5('0x44')],_0x42fdda['filters']));if(_0x48bdd2[_0x8ce5('0x44')][_0x8ce5('0x32')]){_0x2e687f[_0x8ce5('0xd5')]=_[_0x8ce5('0x5d')](_0x2e687f[_0x8ce5('0xd5')],{'$or':_['map'](_0x2e687f[_0x8ce5('0x49')],function(_0x1907df){var _0x5bfd31={};_0x5bfd31[_0x1907df]={'$like':'%'+_0x48bdd2[_0x8ce5('0x44')][_0x8ce5('0x32')]+'%'};return _0x5bfd31;})});}_0x2e687f=_[_0x8ce5('0x5d')]({},_0x2e687f,_0x48bdd2[_0x8ce5('0xe1')]);return _0xf6f838[_0x8ce5('0x12b')](_0x2e687f);}})[_0x8ce5('0x17')](function(_0x17945b){if(_0x17945b){_0x131dc5=_0x17945b['length'];if(!_0x48bdd2['query'][_0x8ce5('0xd7')]('nolimit')){_0x2e687f['limit']=qs[_0x8ce5('0xdf')](_0x48bdd2[_0x8ce5('0x44')]['limit']);_0x2e687f[_0x8ce5('0x25')]=qs['offset'](_0x48bdd2['query'][_0x8ce5('0x25')]);}return _0xf6f838[_0x8ce5('0x12b')](_0x2e687f);}})[_0x8ce5('0x17')](function(_0x5c2096){if(_0x5c2096){return _0x5c2096?{'count':_0x131dc5,'rows':_0x5c2096}:null;}})[_0x8ce5('0x17')](respondWithResult(_0x761da8,null))[_0x8ce5('0x20')](handleError(_0x761da8,null));};exports['getAgents']=function(_0xb80f,_0x3338e1){var _0x129fcf={};var _0x524aa8={};var _0x5a961b;return db['User'][_0x8ce5('0x9b')]({'where':{'id':_0xb80f[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x3338e1,null))['then'](function(_0x4e88cf){if(_0x4e88cf){_0x5a961b=_0x4e88cf;_0x524aa8['model']=_[_0x8ce5('0x58')](db['User'][_0x8ce5('0x59')]);_0x524aa8[_0x8ce5('0x44')]=_[_0x8ce5('0x58')](_0xb80f['query']);_0x524aa8[_0x8ce5('0x5a')]=_[_0x8ce5('0xd2')](_0x524aa8[_0x8ce5('0x56')],_0x524aa8[_0x8ce5('0x44')]);_0x129fcf[_0x8ce5('0x49')]=_['intersection'](_0x524aa8[_0x8ce5('0x56')],qs['fields'](_0xb80f[_0x8ce5('0x44')]['fields']));_0x129fcf['attributes']=_0x129fcf[_0x8ce5('0x49')]['length']?_0x129fcf[_0x8ce5('0x49')]:_0x524aa8[_0x8ce5('0x56')];_0x129fcf['order']=qs[_0x8ce5('0xd4')](_0xb80f[_0x8ce5('0x44')][_0x8ce5('0xd4')]);_0x129fcf[_0x8ce5('0xd5')]=qs[_0x8ce5('0x5a')](_[_0x8ce5('0xd6')](_0xb80f[_0x8ce5('0x44')],_0x524aa8[_0x8ce5('0x5a')]));if(_0xb80f[_0x8ce5('0x44')][_0x8ce5('0x32')]){_0x129fcf[_0x8ce5('0xd5')]=_[_0x8ce5('0x5d')](_0x129fcf[_0x8ce5('0xd5')],{'$or':_['map'](_0x129fcf[_0x8ce5('0x49')],function(_0x2af3e2){var _0x13321e={};_0x13321e[_0x2af3e2]={'$like':'%'+_0xb80f[_0x8ce5('0x44')][_0x8ce5('0x32')]+'%'};return _0x13321e;})});}_0x129fcf['model']=db['User'];_0x129fcf['as']=_0x8ce5('0x30');_0x129fcf=_['merge']({},_0x129fcf,_0xb80f['options']);return _0x5a961b['getVoiceQueues']({'include':[_0x129fcf]});}})[_0x8ce5('0x17')](function(_0x4f1cdb){if(_0x4f1cdb){var _0x10dd46={},_0x3a8af0=[];for(var _0x5972f5=0x0;_0x5972f5<_0x4f1cdb[_0x8ce5('0x6f')];_0x5972f5+=0x1){for(var _0x1376c5=0x0,_0x1dcaef;_0x1376c5<_0x4f1cdb[_0x5972f5]['Agents'][_0x8ce5('0x6f')];_0x1376c5+=0x1){_0x1dcaef=_0x4f1cdb[_0x5972f5][_0x8ce5('0x30')][_0x1376c5]['get']({'plain':!![]});_0x10dd46[_0x1dcaef['id']]=_0x1dcaef;}}_0x10dd46=_['values'](_0x10dd46);for(var _0x15ea58=qs[_0x8ce5('0x25')](_0xb80f[_0x8ce5('0x44')]['offset']);_0x15ea58<_0x10dd46[_0x8ce5('0x6f')]&&_0x3a8af0['length']<qs[_0x8ce5('0xdf')](_0xb80f[_0x8ce5('0x44')]['limit']);_0x15ea58+=0x1){if(_0x10dd46[_0x15ea58]){_0x3a8af0[_0x8ce5('0x4a')](_0x10dd46[_0x15ea58]);}}return{'count':_0x10dd46['length'],'rows':_0x3a8af0};}})['then'](respondWithResult(_0x3338e1,null))[_0x8ce5('0x20')](handleError(_0x3338e1,null));};exports[_0x8ce5('0x2c')]=function(_0x5de06a,_0x2b529b){if(_0x5de06a[_0x8ce5('0x81')]['id']==_0x5de06a['params']['id']){return _0x2b529b[_0x8ce5('0x22')](0x1f4)['send']({'message':_0x8ce5('0x12c')});}return db['User'][_0x8ce5('0x35')]({'where':{'id':_0x5de06a[_0x8ce5('0x61')]['id']}})['then'](handleEntityNotFound(_0x2b529b,null))[_0x8ce5('0x17')](removeEntity(_0x2b529b,null))['catch'](handleError(_0x2b529b,null));};exports[_0x8ce5('0x12d')]=function(_0x520640,_0x34443c){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x520640[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x34443c,null))[_0x8ce5('0x17')](function(_0x4a7f93){if(_0x4a7f93){return _0x4a7f93[_0x8ce5('0x12d')](_0x520640[_0x8ce5('0x5e')][_0x8ce5('0x62')],_[_0x8ce5('0x63')](_0x520640[_0x8ce5('0x5e')],[_0x8ce5('0x62'),'id'])||{})['spread'](function(){for(var _0xa3161b=0x0;_0xa3161b<_0x520640['body'][_0x8ce5('0x62')][_0x8ce5('0x6f')];_0xa3161b+=0x1){socket[_0x8ce5('0x2a')](_0x8ce5('0x12e'),{'ChatInteractionId':Number(_0x520640['body'][_0x8ce5('0x62')][_0xa3161b]),'UserId':Number(_0x520640[_0x8ce5('0x61')]['id'])});}return _0x520640[_0x8ce5('0x5e')][_0x8ce5('0x62')];});}})[_0x8ce5('0x17')](respondWithResult(_0x34443c,null))['catch'](handleError(_0x34443c,null));};exports[_0x8ce5('0x12f')]=function(_0xd157d8,_0xca5cc4){return db[_0x8ce5('0x43')]['find']({'where':{'id':_0xd157d8[_0x8ce5('0x61')]['id']}})['then'](handleEntityNotFound(_0xca5cc4,null))['then'](function(_0x41b037){if(_0x41b037){return _0x41b037[_0x8ce5('0x12f')](_0xd157d8[_0x8ce5('0x44')][_0x8ce5('0x62')])[_0x8ce5('0x17')](function(){if(_[_0x8ce5('0xb6')](_0xd157d8[_0x8ce5('0x44')][_0x8ce5('0x62')])){for(var _0x4a0771=0x0;_0x4a0771<_0xd157d8[_0x8ce5('0x44')][_0x8ce5('0x62')][_0x8ce5('0x6f')];_0x4a0771+=0x1){socket[_0x8ce5('0x2a')](_0x8ce5('0x130'),{'ChatInteractionId':Number(_0xd157d8['query'][_0x8ce5('0x62')][_0x4a0771]),'UserId':Number(_0xd157d8[_0x8ce5('0x61')]['id'])});}}else{socket[_0x8ce5('0x2a')](_0x8ce5('0x130'),{'ChatInteractionId':Number(_0xd157d8[_0x8ce5('0x44')][_0x8ce5('0x62')]),'UserId':Number(_0xd157d8[_0x8ce5('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0xca5cc4,null))[_0x8ce5('0x20')](handleError(_0xca5cc4,null));};exports[_0x8ce5('0x131')]=function(_0x414d1f,_0x259972){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x414d1f[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x259972,null))[_0x8ce5('0x17')](function(_0x20826e){if(_0x20826e){return _0x20826e[_0x8ce5('0x131')](_0x414d1f[_0x8ce5('0x5e')][_0x8ce5('0x62')],_['omit'](_0x414d1f[_0x8ce5('0x5e')],['ids','id'])||{})[_0x8ce5('0xac')](function(){for(var _0x501e34=0x0;_0x501e34<_0x414d1f[_0x8ce5('0x5e')][_0x8ce5('0x62')]['length'];_0x501e34+=0x1){socket[_0x8ce5('0x2a')](_0x8ce5('0x132'),{'MailInteractionId':Number(_0x414d1f[_0x8ce5('0x5e')][_0x8ce5('0x62')][_0x501e34]),'UserId':Number(_0x414d1f['params']['id'])});}return _0x414d1f[_0x8ce5('0x5e')][_0x8ce5('0x62')];});}})[_0x8ce5('0x17')](respondWithResult(_0x259972,null))['catch'](handleError(_0x259972,null));};exports['removeMailInteractions']=function(_0xed33b,_0x3650c9){return db[_0x8ce5('0x43')]['find']({'where':{'id':_0xed33b['params']['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x3650c9,null))[_0x8ce5('0x17')](function(_0x512c04){if(_0x512c04){return _0x512c04[_0x8ce5('0x133')](_0xed33b[_0x8ce5('0x44')][_0x8ce5('0x62')])[_0x8ce5('0x17')](function(){if(_['isArray'](_0xed33b['query'][_0x8ce5('0x62')])){for(var _0x229c40=0x0;_0x229c40<_0xed33b[_0x8ce5('0x44')]['ids']['length'];_0x229c40+=0x1){socket['emit'](_0x8ce5('0x134'),{'MailInteractionId':Number(_0xed33b[_0x8ce5('0x44')][_0x8ce5('0x62')][_0x229c40]),'UserId':Number(_0xed33b[_0x8ce5('0x61')]['id'])});}}else{socket[_0x8ce5('0x2a')](_0x8ce5('0x134'),{'MailInteractionId':Number(_0xed33b[_0x8ce5('0x44')][_0x8ce5('0x62')]),'UserId':Number(_0xed33b[_0x8ce5('0x61')]['id'])});}});}})[_0x8ce5('0x17')](respondWithStatusCode(_0x3650c9,null))['catch'](handleError(_0x3650c9,null));};exports[_0x8ce5('0x135')]=function(_0x473651,_0x222fcc){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x473651[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x222fcc,null))[_0x8ce5('0x17')](function(_0x4ac5ba){if(_0x4ac5ba){return _0x4ac5ba[_0x8ce5('0x135')](_0x473651[_0x8ce5('0x5e')][_0x8ce5('0x62')],_[_0x8ce5('0x63')](_0x473651[_0x8ce5('0x5e')],[_0x8ce5('0x62'),'id'])||{})[_0x8ce5('0xac')](function(){for(var _0x190e1e=0x0;_0x190e1e<_0x473651[_0x8ce5('0x5e')][_0x8ce5('0x62')]['length'];_0x190e1e+=0x1){socket[_0x8ce5('0x2a')](_0x8ce5('0x136'),{'FaxInteractionId':Number(_0x473651[_0x8ce5('0x5e')][_0x8ce5('0x62')][_0x190e1e]),'UserId':Number(_0x473651[_0x8ce5('0x61')]['id'])});}return _0x473651['body'][_0x8ce5('0x62')];});}})[_0x8ce5('0x17')](respondWithResult(_0x222fcc,null))[_0x8ce5('0x20')](handleError(_0x222fcc,null));};exports[_0x8ce5('0x137')]=function(_0x1adc01,_0x178513){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x1adc01[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x178513,null))[_0x8ce5('0x17')](function(_0x28f4fd){if(_0x28f4fd){return _0x28f4fd[_0x8ce5('0x137')](_0x1adc01[_0x8ce5('0x44')]['ids'])['then'](function(){if(_[_0x8ce5('0xb6')](_0x1adc01[_0x8ce5('0x44')][_0x8ce5('0x62')])){for(var _0x336e27=0x0;_0x336e27<_0x1adc01['query'][_0x8ce5('0x62')][_0x8ce5('0x6f')];_0x336e27+=0x1){socket[_0x8ce5('0x2a')](_0x8ce5('0x138'),{'FaxInteractionId':Number(_0x1adc01[_0x8ce5('0x44')][_0x8ce5('0x62')][_0x336e27]),'UserId':Number(_0x1adc01[_0x8ce5('0x61')]['id'])});}}else{socket['emit'](_0x8ce5('0x138'),{'FaxInteractionId':Number(_0x1adc01[_0x8ce5('0x44')][_0x8ce5('0x62')]),'UserId':Number(_0x1adc01[_0x8ce5('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0x178513,null))[_0x8ce5('0x20')](handleError(_0x178513,null));};exports[_0x8ce5('0x139')]=function(_0x1f0a87,_0x2751b8){return db['User'][_0x8ce5('0x35')]({'where':{'id':_0x1f0a87[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x2751b8,null))[_0x8ce5('0x17')](function(_0xccda99){if(_0xccda99){return _0xccda99['addSmsInteractions'](_0x1f0a87[_0x8ce5('0x5e')][_0x8ce5('0x62')],_[_0x8ce5('0x63')](_0x1f0a87[_0x8ce5('0x5e')],['ids','id'])||{})[_0x8ce5('0xac')](function(){for(var _0x1a6b54=0x0;_0x1a6b54<_0x1f0a87['body'][_0x8ce5('0x62')][_0x8ce5('0x6f')];_0x1a6b54+=0x1){socket[_0x8ce5('0x2a')](_0x8ce5('0x13a'),{'SmsInteractionId':Number(_0x1f0a87[_0x8ce5('0x5e')]['ids'][_0x1a6b54]),'UserId':Number(_0x1f0a87[_0x8ce5('0x61')]['id'])});}return _0x1f0a87[_0x8ce5('0x5e')]['ids'];});}})[_0x8ce5('0x17')](respondWithResult(_0x2751b8,null))[_0x8ce5('0x20')](handleError(_0x2751b8,null));};exports['removeSmsInteractions']=function(_0x210eaf,_0x5069e6){return db[_0x8ce5('0x43')]['find']({'where':{'id':_0x210eaf[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x5069e6,null))[_0x8ce5('0x17')](function(_0x1090c3){if(_0x1090c3){return _0x1090c3[_0x8ce5('0x13b')](_0x210eaf[_0x8ce5('0x44')]['ids'])[_0x8ce5('0x17')](function(){if(_['isArray'](_0x210eaf[_0x8ce5('0x44')][_0x8ce5('0x62')])){for(var _0x25f4b8=0x0;_0x25f4b8<_0x210eaf['query'][_0x8ce5('0x62')]['length'];_0x25f4b8+=0x1){socket[_0x8ce5('0x2a')](_0x8ce5('0x13c'),{'SmsInteractionId':Number(_0x210eaf[_0x8ce5('0x44')]['ids'][_0x25f4b8]),'UserId':Number(_0x210eaf[_0x8ce5('0x61')]['id'])});}}else{socket[_0x8ce5('0x2a')](_0x8ce5('0x13c'),{'SmsInteractionId':Number(_0x210eaf['query'][_0x8ce5('0x62')]),'UserId':Number(_0x210eaf[_0x8ce5('0x61')]['id'])});}});}})[_0x8ce5('0x17')](respondWithStatusCode(_0x5069e6,null))[_0x8ce5('0x20')](handleError(_0x5069e6,null));};exports[_0x8ce5('0x13d')]=function(_0x2afc1f,_0xbbff27){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x2afc1f[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0xbbff27,null))['then'](function(_0x24ac6d){if(_0x24ac6d){return _0x24ac6d[_0x8ce5('0x13d')](_0x2afc1f[_0x8ce5('0x5e')][_0x8ce5('0x62')],_[_0x8ce5('0x63')](_0x2afc1f[_0x8ce5('0x5e')],[_0x8ce5('0x62'),'id'])||{})[_0x8ce5('0xac')](function(){for(var _0x1f5bc7=0x0;_0x1f5bc7<_0x2afc1f[_0x8ce5('0x5e')][_0x8ce5('0x62')][_0x8ce5('0x6f')];_0x1f5bc7+=0x1){socket[_0x8ce5('0x2a')]('user_has_openchannel_interactions:save',{'OpenchannelInteractionId':Number(_0x2afc1f[_0x8ce5('0x5e')][_0x8ce5('0x62')][_0x1f5bc7]),'UserId':Number(_0x2afc1f['params']['id'])});}return _0x2afc1f[_0x8ce5('0x5e')]['ids'];});}})['then'](respondWithResult(_0xbbff27,null))['catch'](handleError(_0xbbff27,null));};exports[_0x8ce5('0x13e')]=function(_0x2b3a86,_0x437fa0){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x2b3a86[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x437fa0,null))[_0x8ce5('0x17')](function(_0x23e347){if(_0x23e347){return _0x23e347['removeOpenchannelInteractions'](_0x2b3a86['query'][_0x8ce5('0x62')])[_0x8ce5('0x17')](function(){if(_[_0x8ce5('0xb6')](_0x2b3a86['query'][_0x8ce5('0x62')])){for(var _0x56a455=0x0;_0x56a455<_0x2b3a86[_0x8ce5('0x44')][_0x8ce5('0x62')][_0x8ce5('0x6f')];_0x56a455+=0x1){socket[_0x8ce5('0x2a')](_0x8ce5('0x13f'),{'OpenchannelInteractionId':Number(_0x2b3a86[_0x8ce5('0x44')][_0x8ce5('0x62')][_0x56a455]),'UserId':Number(_0x2b3a86['params']['id'])});}}else{socket['emit'](_0x8ce5('0x13f'),{'OpenchannelInteractionId':Number(_0x2b3a86['query'][_0x8ce5('0x62')]),'UserId':Number(_0x2b3a86[_0x8ce5('0x61')]['id'])});}});}})[_0x8ce5('0x17')](respondWithStatusCode(_0x437fa0,null))[_0x8ce5('0x20')](handleError(_0x437fa0,null));};exports['addWhatsappInteractions']=function(_0x281cec,_0x483347){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x281cec['params']['id']}})['then'](handleEntityNotFound(_0x483347,null))[_0x8ce5('0x17')](function(_0x1ac24d){if(_0x1ac24d){return _0x1ac24d[_0x8ce5('0x140')](_0x281cec['body'][_0x8ce5('0x62')],_[_0x8ce5('0x63')](_0x281cec[_0x8ce5('0x5e')],[_0x8ce5('0x62'),'id'])||{})[_0x8ce5('0xac')](function(){for(var _0x58f54b=0x0;_0x58f54b<_0x281cec[_0x8ce5('0x5e')][_0x8ce5('0x62')][_0x8ce5('0x6f')];_0x58f54b+=0x1){socket[_0x8ce5('0x2a')]('user_has_whatsapp_interactions:save',{'WhatsappInteractionId':Number(_0x281cec[_0x8ce5('0x5e')]['ids'][_0x58f54b]),'UserId':Number(_0x281cec['params']['id'])});}return _0x281cec['body'][_0x8ce5('0x62')];});}})[_0x8ce5('0x17')](respondWithResult(_0x483347,null))[_0x8ce5('0x20')](handleError(_0x483347,null));};exports[_0x8ce5('0x141')]=function(_0x3c89a7,_0x12777f){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x3c89a7['params']['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x12777f,null))[_0x8ce5('0x17')](function(_0x1affd1){if(_0x1affd1){return _0x1affd1[_0x8ce5('0x141')](_0x3c89a7[_0x8ce5('0x44')][_0x8ce5('0x62')]);}})[_0x8ce5('0x17')](respondWithStatusCode(_0x12777f,null))[_0x8ce5('0x20')](handleError(_0x12777f,null));};exports[_0x8ce5('0x142')]=function(_0x28f7e9,_0x5a48e0){var _0x508dc0={};var _0x55e8ba={};var _0x129e8a;var _0x2b7bb9;return db[_0x8ce5('0x43')][_0x8ce5('0x9b')]({'where':{'id':_0x28f7e9[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x5a48e0,null))[_0x8ce5('0x17')](function(_0x163d85){if(_0x163d85){_0x129e8a=_0x163d85;_0x55e8ba[_0x8ce5('0x56')]=_[_0x8ce5('0x58')](db['VoicePrefix'][_0x8ce5('0x59')]);_0x55e8ba[_0x8ce5('0x44')]=_[_0x8ce5('0x58')](_0x28f7e9[_0x8ce5('0x44')]);_0x55e8ba[_0x8ce5('0x5a')]=_[_0x8ce5('0xd2')](_0x55e8ba[_0x8ce5('0x56')],_0x55e8ba[_0x8ce5('0x44')]);_0x508dc0['attributes']=_[_0x8ce5('0xd2')](_0x55e8ba['model'],qs[_0x8ce5('0x5b')](_0x28f7e9[_0x8ce5('0x44')][_0x8ce5('0x5b')]));_0x508dc0[_0x8ce5('0x49')]=_0x508dc0[_0x8ce5('0x49')]['length']?_0x508dc0[_0x8ce5('0x49')]:_0x55e8ba[_0x8ce5('0x56')];_0x508dc0[_0x8ce5('0xd3')]=qs[_0x8ce5('0xd4')](_0x28f7e9[_0x8ce5('0x44')][_0x8ce5('0xd4')]);_0x508dc0['where']=qs['filters'](_[_0x8ce5('0xd6')](_0x28f7e9[_0x8ce5('0x44')],_0x55e8ba[_0x8ce5('0x5a')]));if(_0x28f7e9['query'][_0x8ce5('0x32')]){_0x508dc0['where']=_[_0x8ce5('0x5d')](_0x508dc0[_0x8ce5('0xd5')],{'$or':_[_0x8ce5('0x3c')](_0x508dc0[_0x8ce5('0x49')],function(_0x39973b){var _0x5eacf9={};_0x5eacf9[_0x39973b]={'$like':'%'+_0x28f7e9[_0x8ce5('0x44')][_0x8ce5('0x32')]+'%'};return _0x5eacf9;})});}_0x508dc0=_[_0x8ce5('0x5d')]({},_0x508dc0,_0x28f7e9[_0x8ce5('0xe1')]);return _0x129e8a[_0x8ce5('0x142')](_0x508dc0);}})['then'](function(_0x5311a3){if(_0x5311a3){_0x2b7bb9=_0x5311a3[_0x8ce5('0x6f')];if(!_0x28f7e9[_0x8ce5('0x44')][_0x8ce5('0xd7')](_0x8ce5('0xde'))){_0x508dc0[_0x8ce5('0xdf')]=qs['limit'](_0x28f7e9[_0x8ce5('0x44')][_0x8ce5('0xdf')]);_0x508dc0[_0x8ce5('0x25')]=qs[_0x8ce5('0x25')](_0x28f7e9[_0x8ce5('0x44')][_0x8ce5('0x25')]);}return _0x129e8a[_0x8ce5('0x142')](_0x508dc0);}})[_0x8ce5('0x17')](function(_0x5e8232){if(_0x5e8232){return _0x5e8232?{'count':_0x2b7bb9,'rows':_0x5e8232}:null;}})['then'](respondWithResult(_0x5a48e0,null))[_0x8ce5('0x20')](handleError(_0x5a48e0,null));};exports[_0x8ce5('0x143')]=function(_0x147c24,_0x3de3be){var _0x109f1b={};var _0x4dae35={};var _0x345eb4;var _0x489ba2;return db['User'][_0x8ce5('0x9b')]({'where':{'id':_0x147c24[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x3de3be,null))['then'](function(_0x16e8fd){if(_0x16e8fd){_0x345eb4=_0x16e8fd;_0x4dae35[_0x8ce5('0x56')]=_[_0x8ce5('0x58')](db[_0x8ce5('0x144')]['rawAttributes']);_0x4dae35[_0x8ce5('0x44')]=_[_0x8ce5('0x58')](_0x147c24[_0x8ce5('0x44')]);_0x4dae35['filters']=_[_0x8ce5('0xd2')](_0x4dae35['model'],_0x4dae35['query']);_0x109f1b[_0x8ce5('0x49')]=_[_0x8ce5('0xd2')](_0x4dae35['model'],qs['fields'](_0x147c24[_0x8ce5('0x44')][_0x8ce5('0x5b')]));_0x109f1b[_0x8ce5('0x49')]=_0x109f1b[_0x8ce5('0x49')]['length']?_0x109f1b[_0x8ce5('0x49')]:_0x4dae35[_0x8ce5('0x56')];_0x109f1b[_0x8ce5('0xd3')]=qs[_0x8ce5('0xd4')](_0x147c24[_0x8ce5('0x44')][_0x8ce5('0xd4')]);_0x109f1b['where']=qs[_0x8ce5('0x5a')](_[_0x8ce5('0xd6')](_0x147c24[_0x8ce5('0x44')],_0x4dae35['filters']));if(_0x147c24[_0x8ce5('0x44')][_0x8ce5('0x32')]){_0x109f1b[_0x8ce5('0xd5')]=_[_0x8ce5('0x5d')](_0x109f1b['where'],{'$or':_[_0x8ce5('0x3c')](_0x109f1b[_0x8ce5('0x49')],function(_0x1e3ff5){var _0x3e597b={};_0x3e597b[_0x1e3ff5]={'$like':'%'+_0x147c24[_0x8ce5('0x44')][_0x8ce5('0x32')]+'%'};return _0x3e597b;})});}_0x109f1b=_[_0x8ce5('0x5d')]({},_0x109f1b,_0x147c24[_0x8ce5('0xe1')]);return _0x345eb4['getFaxAccounts'](_0x109f1b);}})[_0x8ce5('0x17')](function(_0x58681a){if(_0x58681a){_0x489ba2=_0x58681a[_0x8ce5('0x6f')];if(!_0x147c24[_0x8ce5('0x44')][_0x8ce5('0xd7')](_0x8ce5('0xde'))){_0x109f1b['limit']=qs[_0x8ce5('0xdf')](_0x147c24[_0x8ce5('0x44')]['limit']);_0x109f1b['offset']=qs[_0x8ce5('0x25')](_0x147c24[_0x8ce5('0x44')][_0x8ce5('0x25')]);}return _0x345eb4['getFaxAccounts'](_0x109f1b);}})[_0x8ce5('0x17')](function(_0x149d19){if(_0x149d19){return _0x149d19?{'count':_0x489ba2,'rows':_0x149d19}:null;}})['then'](respondWithResult(_0x3de3be,null))[_0x8ce5('0x20')](handleError(_0x3de3be,null));};exports[_0x8ce5('0x145')]=function(_0x2836de,_0x42857e){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x2836de[_0x8ce5('0x61')]['id']}})['then'](handleEntityNotFound(_0x42857e,null))['then'](function(_0xbcad9b){if(_0xbcad9b){return _0xbcad9b[_0x8ce5('0x145')](_0x2836de['body'][_0x8ce5('0x62')],_['omit'](_0x2836de[_0x8ce5('0x5e')],[_0x8ce5('0x62'),'id'])||{});}})[_0x8ce5('0x17')](respondWithResult(_0x42857e,null))['catch'](handleError(_0x42857e,null));};exports[_0x8ce5('0x146')]=function(_0x1ced65,_0x5de958){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x1ced65[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x5de958,null))[_0x8ce5('0x17')](function(_0x9aaf3e){if(_0x9aaf3e){return _0x9aaf3e[_0x8ce5('0x146')](_0x1ced65[_0x8ce5('0x44')][_0x8ce5('0x62')]);}})[_0x8ce5('0x17')](respondWithStatusCode(_0x5de958,null))[_0x8ce5('0x20')](handleError(_0x5de958,null));};exports[_0x8ce5('0x147')]=function(_0x2e3b9d,_0xa1a884){var _0x572845={};var _0x24ac2d={};var _0x663f51;var _0x484ee4;return db[_0x8ce5('0x43')][_0x8ce5('0x9b')]({'where':{'id':_0x2e3b9d[_0x8ce5('0x61')]['id']}})['then'](handleEntityNotFound(_0xa1a884,null))['then'](function(_0x61363){if(_0x61363){_0x663f51=_0x61363;_0x24ac2d[_0x8ce5('0x56')]=_[_0x8ce5('0x58')](db['MailAccount'][_0x8ce5('0x59')]);_0x24ac2d[_0x8ce5('0x44')]=_[_0x8ce5('0x58')](_0x2e3b9d[_0x8ce5('0x44')]);_0x24ac2d[_0x8ce5('0x5a')]=_[_0x8ce5('0xd2')](_0x24ac2d[_0x8ce5('0x56')],_0x24ac2d[_0x8ce5('0x44')]);_0x572845[_0x8ce5('0x49')]=_[_0x8ce5('0xd2')](_0x24ac2d['model'],qs[_0x8ce5('0x5b')](_0x2e3b9d['query'][_0x8ce5('0x5b')]));_0x572845[_0x8ce5('0x49')]=_0x572845['attributes'][_0x8ce5('0x6f')]?_0x572845[_0x8ce5('0x49')]:_0x24ac2d[_0x8ce5('0x56')];_0x572845[_0x8ce5('0xd3')]=qs['sort'](_0x2e3b9d[_0x8ce5('0x44')][_0x8ce5('0xd4')]);_0x572845['where']=qs['filters'](_['pick'](_0x2e3b9d[_0x8ce5('0x44')],_0x24ac2d[_0x8ce5('0x5a')]));if(_0x2e3b9d['query']['filter']){_0x572845[_0x8ce5('0xd5')]=_[_0x8ce5('0x5d')](_0x572845[_0x8ce5('0xd5')],{'$or':_['map'](_0x572845[_0x8ce5('0x49')],function(_0xc0a747){var _0x313918={};_0x313918[_0xc0a747]={'$like':'%'+_0x2e3b9d[_0x8ce5('0x44')]['filter']+'%'};return _0x313918;})});}_0x572845=_[_0x8ce5('0x5d')]({},_0x572845,_0x2e3b9d['options']);return _0x663f51['getMailAccounts'](_0x572845);}})[_0x8ce5('0x17')](function(_0x59533c){if(_0x59533c){_0x484ee4=_0x59533c[_0x8ce5('0x6f')];if(!_0x2e3b9d[_0x8ce5('0x44')][_0x8ce5('0xd7')](_0x8ce5('0xde'))){_0x572845[_0x8ce5('0xdf')]=qs[_0x8ce5('0xdf')](_0x2e3b9d[_0x8ce5('0x44')][_0x8ce5('0xdf')]);_0x572845[_0x8ce5('0x25')]=qs[_0x8ce5('0x25')](_0x2e3b9d[_0x8ce5('0x44')][_0x8ce5('0x25')]);}return _0x663f51[_0x8ce5('0x147')](_0x572845);}})[_0x8ce5('0x17')](function(_0x135a86){if(_0x135a86){return _0x135a86?{'count':_0x484ee4,'rows':_0x135a86}:null;}})[_0x8ce5('0x17')](respondWithResult(_0xa1a884,null))[_0x8ce5('0x20')](handleError(_0xa1a884,null));};exports[_0x8ce5('0x148')]=function(_0xdf52e0,_0x4abd03){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0xdf52e0[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x4abd03,null))[_0x8ce5('0x17')](function(_0x64ceb0){if(_0x64ceb0){return _0x64ceb0[_0x8ce5('0x148')](_0xdf52e0['body']['ids'],_[_0x8ce5('0x63')](_0xdf52e0[_0x8ce5('0x5e')],[_0x8ce5('0x62'),'id'])||{});}})[_0x8ce5('0x17')](respondWithResult(_0x4abd03,null))[_0x8ce5('0x20')](handleError(_0x4abd03,null));};exports[_0x8ce5('0x149')]=function(_0x18e6d8,_0xa7fa39){return db['User']['find']({'where':{'id':_0x18e6d8['params']['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0xa7fa39,null))[_0x8ce5('0x17')](function(_0x4ab80a){if(_0x4ab80a){return _0x4ab80a[_0x8ce5('0x149')](_0x18e6d8[_0x8ce5('0x44')][_0x8ce5('0x62')]);}})[_0x8ce5('0x17')](respondWithStatusCode(_0xa7fa39,null))[_0x8ce5('0x20')](handleError(_0xa7fa39,null));};exports[_0x8ce5('0x14a')]=function(_0x482c77,_0x1a49cd){var _0x3b162f={};var _0x2d1db2={};var _0x31a309;var _0x40e185;return db['User'][_0x8ce5('0x9b')]({'where':{'id':_0x482c77['params']['id']}})['then'](handleEntityNotFound(_0x1a49cd,null))[_0x8ce5('0x17')](function(_0x3ba532){if(_0x3ba532){_0x31a309=_0x3ba532;_0x2d1db2['model']=_['keys'](db[_0x8ce5('0x14b')][_0x8ce5('0x59')]);_0x2d1db2[_0x8ce5('0x44')]=_[_0x8ce5('0x58')](_0x482c77['query']);_0x2d1db2[_0x8ce5('0x5a')]=_['intersection'](_0x2d1db2[_0x8ce5('0x56')],_0x2d1db2['query']);_0x3b162f[_0x8ce5('0x49')]=_[_0x8ce5('0xd2')](_0x2d1db2[_0x8ce5('0x56')],qs[_0x8ce5('0x5b')](_0x482c77[_0x8ce5('0x44')][_0x8ce5('0x5b')]));_0x3b162f[_0x8ce5('0x49')]=_0x3b162f[_0x8ce5('0x49')][_0x8ce5('0x6f')]?_0x3b162f[_0x8ce5('0x49')]:_0x2d1db2['model'];_0x3b162f[_0x8ce5('0xd3')]=qs[_0x8ce5('0xd4')](_0x482c77[_0x8ce5('0x44')][_0x8ce5('0xd4')]);_0x3b162f['where']=qs[_0x8ce5('0x5a')](_[_0x8ce5('0xd6')](_0x482c77[_0x8ce5('0x44')],_0x2d1db2[_0x8ce5('0x5a')]));if(_0x482c77[_0x8ce5('0x44')][_0x8ce5('0x32')]){_0x3b162f[_0x8ce5('0xd5')]=_[_0x8ce5('0x5d')](_0x3b162f[_0x8ce5('0xd5')],{'$or':_[_0x8ce5('0x3c')](_0x3b162f[_0x8ce5('0x49')],function(_0x4a0a6f){var _0x5899d0={};_0x5899d0[_0x4a0a6f]={'$like':'%'+_0x482c77[_0x8ce5('0x44')][_0x8ce5('0x32')]+'%'};return _0x5899d0;})});}_0x3b162f=_['merge']({},_0x3b162f,_0x482c77[_0x8ce5('0xe1')]);return _0x31a309[_0x8ce5('0x14a')](_0x3b162f);}})[_0x8ce5('0x17')](function(_0x5d979a){if(_0x5d979a){_0x40e185=_0x5d979a[_0x8ce5('0x6f')];if(!_0x482c77['query'][_0x8ce5('0xd7')](_0x8ce5('0xde'))){_0x3b162f['limit']=qs['limit'](_0x482c77[_0x8ce5('0x44')][_0x8ce5('0xdf')]);_0x3b162f[_0x8ce5('0x25')]=qs['offset'](_0x482c77[_0x8ce5('0x44')][_0x8ce5('0x25')]);}return _0x31a309['getOpenchannelAccounts'](_0x3b162f);}})[_0x8ce5('0x17')](function(_0x3edd91){if(_0x3edd91){return _0x3edd91?{'count':_0x40e185,'rows':_0x3edd91}:null;}})[_0x8ce5('0x17')](respondWithResult(_0x1a49cd,null))['catch'](handleError(_0x1a49cd,null));};exports[_0x8ce5('0x14c')]=function(_0xb983fa,_0x2d3e92){return db[_0x8ce5('0x43')]['find']({'where':{'id':_0xb983fa[_0x8ce5('0x61')]['id']}})['then'](handleEntityNotFound(_0x2d3e92,null))[_0x8ce5('0x17')](function(_0x5c9adf){if(_0x5c9adf){return _0x5c9adf[_0x8ce5('0x14c')](_0xb983fa[_0x8ce5('0x5e')][_0x8ce5('0x62')],_['omit'](_0xb983fa[_0x8ce5('0x5e')],['ids','id'])||{});}})[_0x8ce5('0x17')](respondWithResult(_0x2d3e92,null))[_0x8ce5('0x20')](handleError(_0x2d3e92,null));};exports[_0x8ce5('0x14d')]=function(_0x138a4d,_0x403b42){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x138a4d['params']['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x403b42,null))[_0x8ce5('0x17')](function(_0x54e490){if(_0x54e490){return _0x54e490[_0x8ce5('0x14d')](_0x138a4d[_0x8ce5('0x44')][_0x8ce5('0x62')]);}})[_0x8ce5('0x17')](respondWithStatusCode(_0x403b42,null))[_0x8ce5('0x20')](handleError(_0x403b42,null));};exports['getSmsAccounts']=function(_0x9c4cc0,_0x2206d7){var _0x31fdf0={};var _0x25cea0={};var _0xea57f4;var _0x3e75bc;return db[_0x8ce5('0x43')][_0x8ce5('0x9b')]({'where':{'id':_0x9c4cc0[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x2206d7,null))[_0x8ce5('0x17')](function(_0x577296){if(_0x577296){_0xea57f4=_0x577296;_0x25cea0[_0x8ce5('0x56')]=_['keys'](db[_0x8ce5('0x14e')][_0x8ce5('0x59')]);_0x25cea0[_0x8ce5('0x44')]=_[_0x8ce5('0x58')](_0x9c4cc0['query']);_0x25cea0[_0x8ce5('0x5a')]=_['intersection'](_0x25cea0[_0x8ce5('0x56')],_0x25cea0[_0x8ce5('0x44')]);_0x31fdf0['attributes']=_[_0x8ce5('0xd2')](_0x25cea0['model'],qs[_0x8ce5('0x5b')](_0x9c4cc0['query'][_0x8ce5('0x5b')]));_0x31fdf0['attributes']=_0x31fdf0['attributes']['length']?_0x31fdf0[_0x8ce5('0x49')]:_0x25cea0[_0x8ce5('0x56')];_0x31fdf0[_0x8ce5('0xd3')]=qs[_0x8ce5('0xd4')](_0x9c4cc0['query'][_0x8ce5('0xd4')]);_0x31fdf0[_0x8ce5('0xd5')]=qs[_0x8ce5('0x5a')](_['pick'](_0x9c4cc0[_0x8ce5('0x44')],_0x25cea0[_0x8ce5('0x5a')]));if(_0x9c4cc0[_0x8ce5('0x44')][_0x8ce5('0x32')]){_0x31fdf0['where']=_['merge'](_0x31fdf0[_0x8ce5('0xd5')],{'$or':_[_0x8ce5('0x3c')](_0x31fdf0[_0x8ce5('0x49')],function(_0xf9280d){var _0x407799={};_0x407799[_0xf9280d]={'$like':'%'+_0x9c4cc0[_0x8ce5('0x44')][_0x8ce5('0x32')]+'%'};return _0x407799;})});}_0x31fdf0=_[_0x8ce5('0x5d')]({},_0x31fdf0,_0x9c4cc0[_0x8ce5('0xe1')]);return _0xea57f4[_0x8ce5('0x14f')](_0x31fdf0);}})['then'](function(_0x1fc713){if(_0x1fc713){_0x3e75bc=_0x1fc713['length'];if(!_0x9c4cc0[_0x8ce5('0x44')][_0x8ce5('0xd7')]('nolimit')){_0x31fdf0['limit']=qs[_0x8ce5('0xdf')](_0x9c4cc0[_0x8ce5('0x44')]['limit']);_0x31fdf0[_0x8ce5('0x25')]=qs[_0x8ce5('0x25')](_0x9c4cc0['query'][_0x8ce5('0x25')]);}return _0xea57f4['getSmsAccounts'](_0x31fdf0);}})[_0x8ce5('0x17')](function(_0x5bde89){if(_0x5bde89){return _0x5bde89?{'count':_0x3e75bc,'rows':_0x5bde89}:null;}})['then'](respondWithResult(_0x2206d7,null))[_0x8ce5('0x20')](handleError(_0x2206d7,null));};exports['addSmsAccounts']=function(_0x12f3f0,_0x234a96){return db[_0x8ce5('0x43')]['find']({'where':{'id':_0x12f3f0['params']['id']}})['then'](handleEntityNotFound(_0x234a96,null))[_0x8ce5('0x17')](function(_0x435dbf){if(_0x435dbf){return _0x435dbf[_0x8ce5('0x150')](_0x12f3f0[_0x8ce5('0x5e')][_0x8ce5('0x62')],_['omit'](_0x12f3f0[_0x8ce5('0x5e')],[_0x8ce5('0x62'),'id'])||{});}})[_0x8ce5('0x17')](respondWithResult(_0x234a96,null))['catch'](handleError(_0x234a96,null));};exports[_0x8ce5('0x151')]=function(_0x5ed1da,_0x4818d1){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x5ed1da[_0x8ce5('0x61')]['id']}})['then'](handleEntityNotFound(_0x4818d1,null))[_0x8ce5('0x17')](function(_0x5d9914){if(_0x5d9914){return _0x5d9914[_0x8ce5('0x151')](_0x5ed1da[_0x8ce5('0x44')][_0x8ce5('0x62')]);}})[_0x8ce5('0x17')](respondWithStatusCode(_0x4818d1,null))['catch'](handleError(_0x4818d1,null));};exports[_0x8ce5('0x152')]=function(_0x31eaa3,_0x4b25ff){var _0x340baf={};var _0x482c26={};var _0x14a09c;var _0x28fde8;return db[_0x8ce5('0x43')][_0x8ce5('0x9b')]({'where':{'id':_0x31eaa3[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x4b25ff,null))['then'](function(_0x4be277){if(_0x4be277){_0x14a09c=_0x4be277;_0x482c26[_0x8ce5('0x56')]=_[_0x8ce5('0x58')](db[_0x8ce5('0x153')]['rawAttributes']);_0x482c26[_0x8ce5('0x44')]=_['keys'](_0x31eaa3['query']);_0x482c26[_0x8ce5('0x5a')]=_[_0x8ce5('0xd2')](_0x482c26[_0x8ce5('0x56')],_0x482c26[_0x8ce5('0x44')]);_0x340baf[_0x8ce5('0x49')]=_[_0x8ce5('0xd2')](_0x482c26[_0x8ce5('0x56')],qs[_0x8ce5('0x5b')](_0x31eaa3['query'][_0x8ce5('0x5b')]));_0x340baf[_0x8ce5('0x49')]=_0x340baf[_0x8ce5('0x49')][_0x8ce5('0x6f')]?_0x340baf[_0x8ce5('0x49')]:_0x482c26[_0x8ce5('0x56')];_0x340baf['order']=qs['sort'](_0x31eaa3[_0x8ce5('0x44')][_0x8ce5('0xd4')]);_0x340baf['where']=qs[_0x8ce5('0x5a')](_['pick'](_0x31eaa3[_0x8ce5('0x44')],_0x482c26[_0x8ce5('0x5a')]));if(_0x31eaa3['query'][_0x8ce5('0x32')]){_0x340baf[_0x8ce5('0xd5')]=_['merge'](_0x340baf[_0x8ce5('0xd5')],{'$or':_[_0x8ce5('0x3c')](_0x340baf[_0x8ce5('0x49')],function(_0x44f553){var _0x377a21={};_0x377a21[_0x44f553]={'$like':'%'+_0x31eaa3[_0x8ce5('0x44')]['filter']+'%'};return _0x377a21;})});}_0x340baf=_[_0x8ce5('0x5d')]({},_0x340baf,_0x31eaa3[_0x8ce5('0xe1')]);return _0x14a09c[_0x8ce5('0x152')](_0x340baf);}})[_0x8ce5('0x17')](function(_0x31749f){if(_0x31749f){_0x28fde8=_0x31749f[_0x8ce5('0x6f')];if(!_0x31eaa3[_0x8ce5('0x44')][_0x8ce5('0xd7')](_0x8ce5('0xde'))){_0x340baf[_0x8ce5('0xdf')]=qs[_0x8ce5('0xdf')](_0x31eaa3['query'][_0x8ce5('0xdf')]);_0x340baf[_0x8ce5('0x25')]=qs['offset'](_0x31eaa3[_0x8ce5('0x44')][_0x8ce5('0x25')]);}return _0x14a09c['getChatWebsites'](_0x340baf);}})[_0x8ce5('0x17')](function(_0x45152d){if(_0x45152d){return _0x45152d?{'count':_0x28fde8,'rows':_0x45152d}:null;}})[_0x8ce5('0x17')](respondWithResult(_0x4b25ff,null))['catch'](handleError(_0x4b25ff,null));};exports[_0x8ce5('0x154')]=function(_0x4584be,_0x4f0728){return db['User']['find']({'where':{'id':_0x4584be[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x4f0728,null))['then'](function(_0x37e204){if(_0x37e204){return _0x37e204[_0x8ce5('0x154')](_0x4584be['body'][_0x8ce5('0x62')],_[_0x8ce5('0x63')](_0x4584be[_0x8ce5('0x5e')],['ids','id'])||{});}})[_0x8ce5('0x17')](respondWithResult(_0x4f0728,null))[_0x8ce5('0x20')](handleError(_0x4f0728,null));};exports[_0x8ce5('0x155')]=function(_0x243c11,_0x203079){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x243c11[_0x8ce5('0x61')]['id']}})['then'](handleEntityNotFound(_0x203079,null))['then'](function(_0xba4679){if(_0xba4679){return _0xba4679['removeChatWebsites'](_0x243c11['query']['ids']);}})[_0x8ce5('0x17')](respondWithStatusCode(_0x203079,null))['catch'](handleError(_0x203079,null));};exports[_0x8ce5('0x156')]=function(_0x10e3aa,_0x1ba0aa){var _0x3a4897={};var _0x3a2488={};var _0x17b8a9;var _0x405f36;return db['User'][_0x8ce5('0x9b')]({'where':{'id':_0x10e3aa[_0x8ce5('0x61')]['id']}})['then'](handleEntityNotFound(_0x1ba0aa,null))['then'](function(_0x425aeb){if(_0x425aeb){_0x17b8a9=_0x425aeb;_0x3a2488[_0x8ce5('0x56')]=_[_0x8ce5('0x58')](db['WhatsappAccount'][_0x8ce5('0x59')]);_0x3a2488[_0x8ce5('0x44')]=_[_0x8ce5('0x58')](_0x10e3aa[_0x8ce5('0x44')]);_0x3a2488[_0x8ce5('0x5a')]=_[_0x8ce5('0xd2')](_0x3a2488['model'],_0x3a2488['query']);_0x3a4897[_0x8ce5('0x49')]=_[_0x8ce5('0xd2')](_0x3a2488[_0x8ce5('0x56')],qs[_0x8ce5('0x5b')](_0x10e3aa['query'][_0x8ce5('0x5b')]));_0x3a4897[_0x8ce5('0x49')]=_0x3a4897['attributes'][_0x8ce5('0x6f')]?_0x3a4897[_0x8ce5('0x49')]:_0x3a2488['model'];_0x3a4897['order']=qs['sort'](_0x10e3aa[_0x8ce5('0x44')][_0x8ce5('0xd4')]);_0x3a4897['where']=qs['filters'](_[_0x8ce5('0xd6')](_0x10e3aa['query'],_0x3a2488[_0x8ce5('0x5a')]));if(_0x10e3aa[_0x8ce5('0x44')][_0x8ce5('0x32')]){_0x3a4897[_0x8ce5('0xd5')]=_[_0x8ce5('0x5d')](_0x3a4897[_0x8ce5('0xd5')],{'$or':_['map'](_0x3a4897[_0x8ce5('0x49')],function(_0x50647d){var _0x446863={};_0x446863[_0x50647d]={'$like':'%'+_0x10e3aa['query'][_0x8ce5('0x32')]+'%'};return _0x446863;})});}_0x3a4897=_[_0x8ce5('0x5d')]({},_0x3a4897,_0x10e3aa[_0x8ce5('0xe1')]);return _0x17b8a9[_0x8ce5('0x156')](_0x3a4897);}})[_0x8ce5('0x17')](function(_0x280234){if(_0x280234){_0x405f36=_0x280234[_0x8ce5('0x6f')];if(!_0x10e3aa[_0x8ce5('0x44')][_0x8ce5('0xd7')](_0x8ce5('0xde'))){_0x3a4897[_0x8ce5('0xdf')]=qs[_0x8ce5('0xdf')](_0x10e3aa[_0x8ce5('0x44')][_0x8ce5('0xdf')]);_0x3a4897['offset']=qs[_0x8ce5('0x25')](_0x10e3aa['query'][_0x8ce5('0x25')]);}return _0x17b8a9[_0x8ce5('0x156')](_0x3a4897);}})['then'](function(_0x31f697){if(_0x31f697){return _0x31f697?{'count':_0x405f36,'rows':_0x31f697}:null;}})[_0x8ce5('0x17')](respondWithResult(_0x1ba0aa,null))[_0x8ce5('0x20')](handleError(_0x1ba0aa,null));};exports[_0x8ce5('0x157')]=function(_0x3c772e,_0x50604a){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x3c772e[_0x8ce5('0x61')]['id']}})['then'](handleEntityNotFound(_0x50604a,null))[_0x8ce5('0x17')](function(_0x435aaf){if(_0x435aaf){return _0x435aaf[_0x8ce5('0x157')](_0x3c772e[_0x8ce5('0x5e')][_0x8ce5('0x62')],_[_0x8ce5('0x63')](_0x3c772e['body'],[_0x8ce5('0x62'),'id'])||{});}})[_0x8ce5('0x17')](respondWithResult(_0x50604a,null))[_0x8ce5('0x20')](handleError(_0x50604a,null));};exports[_0x8ce5('0x158')]=function(_0x86e877,_0x25366b){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x86e877['params']['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x25366b,null))[_0x8ce5('0x17')](function(_0x39afe1){if(_0x39afe1){return _0x39afe1[_0x8ce5('0x158')](_0x86e877[_0x8ce5('0x44')][_0x8ce5('0x62')]);}})[_0x8ce5('0x17')](respondWithStatusCode(_0x25366b,null))['catch'](handleError(_0x25366b,null));};exports['getSquareProjects']=function(_0x495660,_0x4f0f82){var _0x34bed4={};var _0x5e4db9={};var _0x2712bd;var _0x26653a;return db[_0x8ce5('0x43')][_0x8ce5('0x9b')]({'where':{'id':_0x495660['params']['id']}})['then'](handleEntityNotFound(_0x4f0f82,null))['then'](function(_0x3e7d43){if(_0x3e7d43){_0x2712bd=_0x3e7d43;_0x5e4db9[_0x8ce5('0x56')]=_[_0x8ce5('0x58')](db['SquareProject'][_0x8ce5('0x59')]);_0x5e4db9[_0x8ce5('0x44')]=_['keys'](_0x495660[_0x8ce5('0x44')]);_0x5e4db9[_0x8ce5('0x5a')]=_[_0x8ce5('0xd2')](_0x5e4db9[_0x8ce5('0x56')],_0x5e4db9[_0x8ce5('0x44')]);_0x34bed4['attributes']=_[_0x8ce5('0xd2')](_0x5e4db9[_0x8ce5('0x56')],qs[_0x8ce5('0x5b')](_0x495660[_0x8ce5('0x44')][_0x8ce5('0x5b')]));_0x34bed4['attributes']=_0x34bed4['attributes'][_0x8ce5('0x6f')]?_0x34bed4[_0x8ce5('0x49')]:_0x5e4db9['model'];_0x34bed4[_0x8ce5('0xd3')]=qs[_0x8ce5('0xd4')](_0x495660['query']['sort']);_0x34bed4['where']=qs[_0x8ce5('0x5a')](_['pick'](_0x495660[_0x8ce5('0x44')],_0x5e4db9[_0x8ce5('0x5a')]));if(_0x495660[_0x8ce5('0x44')][_0x8ce5('0x32')]){_0x34bed4['where']=_['merge'](_0x34bed4[_0x8ce5('0xd5')],{'$or':_[_0x8ce5('0x3c')](_0x34bed4[_0x8ce5('0x49')],function(_0x52d13d){var _0x444de8={};_0x444de8[_0x52d13d]={'$like':'%'+_0x495660['query']['filter']+'%'};return _0x444de8;})});}_0x34bed4=_[_0x8ce5('0x5d')]({},_0x34bed4,_0x495660[_0x8ce5('0xe1')]);return _0x2712bd['getSquareProjects'](_0x34bed4);}})[_0x8ce5('0x17')](function(_0x21ac17){if(_0x21ac17){_0x26653a=_0x21ac17['length'];if(!_0x495660[_0x8ce5('0x44')][_0x8ce5('0xd7')](_0x8ce5('0xde'))){_0x34bed4[_0x8ce5('0xdf')]=qs[_0x8ce5('0xdf')](_0x495660['query']['limit']);_0x34bed4[_0x8ce5('0x25')]=qs[_0x8ce5('0x25')](_0x495660[_0x8ce5('0x44')][_0x8ce5('0x25')]);}return _0x2712bd[_0x8ce5('0x159')](_0x34bed4);}})[_0x8ce5('0x17')](function(_0x2926a4){if(_0x2926a4){return _0x2926a4?{'count':_0x26653a,'rows':_0x2926a4}:null;}})[_0x8ce5('0x17')](respondWithResult(_0x4f0f82,null))[_0x8ce5('0x20')](handleError(_0x4f0f82,null));};exports[_0x8ce5('0x15a')]=function(_0x40b284,_0x19986c){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x40b284[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x19986c,null))['then'](function(_0x370d54){if(_0x370d54){return _0x370d54[_0x8ce5('0x15a')](_0x40b284[_0x8ce5('0x5e')]['ids'],_[_0x8ce5('0x63')](_0x40b284[_0x8ce5('0x5e')],[_0x8ce5('0x62'),'id'])||{});}})[_0x8ce5('0x17')](respondWithResult(_0x19986c,null))[_0x8ce5('0x20')](handleError(_0x19986c,null));};exports['removeSquareProjects']=function(_0x2198c2,_0x189e7f){return db[_0x8ce5('0x43')]['find']({'where':{'id':_0x2198c2['params']['id']}})['then'](handleEntityNotFound(_0x189e7f,null))[_0x8ce5('0x17')](function(_0x314c56){if(_0x314c56){return _0x314c56[_0x8ce5('0x15b')](_0x2198c2[_0x8ce5('0x44')][_0x8ce5('0x62')]);}})[_0x8ce5('0x17')](respondWithStatusCode(_0x189e7f,null))[_0x8ce5('0x20')](handleError(_0x189e7f,null));};exports[_0x8ce5('0x15c')]=function(_0x58f7f0,_0x10b379){var _0x482bd3={},_0xbc0ff6={},_0x50561d={'count':0x0,'rows':[]};var _0x3f5df8=db['CmHopper'][_0x8ce5('0x59')];_0xbc0ff6[_0x8ce5('0x56')]=_[_0x8ce5('0x58')](_0x3f5df8);_0xbc0ff6[_0x8ce5('0x44')]=_['keys'](_0x58f7f0[_0x8ce5('0x44')]);_0xbc0ff6[_0x8ce5('0x5a')]=_[_0x8ce5('0xd2')](_0xbc0ff6[_0x8ce5('0x56')],_0xbc0ff6['query']);_0xbc0ff6[_0x8ce5('0x5a')]=_[_0x8ce5('0x108')](_0xbc0ff6[_0x8ce5('0x5a')],['$and','$or',_0x8ce5('0x15d'),_0x8ce5('0x15e'),_0x8ce5('0x15f'),_0x8ce5('0x160'),'$ne',_0x8ce5('0x161'),_0x8ce5('0x162'),'$between','$notBetween',_0x8ce5('0x163'),_0x8ce5('0x164'),_0x8ce5('0x165'),_0x8ce5('0x166'),_0x8ce5('0x167'),_0x8ce5('0x168'),_0x8ce5('0x165'),'$overlap',_0x8ce5('0x169'),_0x8ce5('0x16a'),'$any']);_0x482bd3['attributes']=_[_0x8ce5('0xd2')](_0xbc0ff6[_0x8ce5('0x56')],qs[_0x8ce5('0x5b')](_0x58f7f0[_0x8ce5('0x44')][_0x8ce5('0x5b')]));_0x482bd3['attributes']=_0x482bd3[_0x8ce5('0x49')][_0x8ce5('0x6f')]?_0x482bd3[_0x8ce5('0x49')]:_0xbc0ff6[_0x8ce5('0x56')];if(!_0x58f7f0[_0x8ce5('0x44')]['hasOwnProperty']('nolimit')){_0x482bd3[_0x8ce5('0xdf')]=qs[_0x8ce5('0xdf')](_0x58f7f0['query']['limit']);_0x482bd3[_0x8ce5('0x25')]=qs[_0x8ce5('0x25')](_0x58f7f0[_0x8ce5('0x44')][_0x8ce5('0x25')]);}_0x482bd3[_0x8ce5('0xd3')]=qs[_0x8ce5('0xd4')](_0x58f7f0[_0x8ce5('0x44')][_0x8ce5('0xd4')]);_0x482bd3['where']=qs['filters'](_['pick'](_0x58f7f0[_0x8ce5('0x44')],_0xbc0ff6['filters']));if(_0x58f7f0[_0x8ce5('0x44')][_0x8ce5('0x32')]){_0x482bd3['where']=_['merge'](_0x482bd3[_0x8ce5('0xd5')],{'$or':_[_0x8ce5('0x3c')](_0x482bd3['attributes'],function(_0x5ad346){var _0x5d8e56={};_0x5d8e56[_0x5ad346]={'$like':'%'+_0x58f7f0[_0x8ce5('0x44')][_0x8ce5('0x32')]+'%'};return _0x5d8e56;})});}_0x482bd3[_0x8ce5('0xd5')]={'$and':[_0x482bd3['where'],{'$or':[{'UserId':_0x58f7f0[_0x8ce5('0x61')]['id']},{'OwnerId':_0x58f7f0[_0x8ce5('0x61')]['id']}]}]};_0x482bd3=_[_0x8ce5('0x5d')]({},_0x482bd3,_0x58f7f0[_0x8ce5('0xe1')]);var _0x980032={'where':_0x482bd3[_0x8ce5('0xd5')]};return db['CmHopper'][_0x8ce5('0x27')](_0x980032)[_0x8ce5('0x17')](function(_0x52f8f4){_0x50561d[_0x8ce5('0x27')]=_0x52f8f4;if(_0x58f7f0[_0x8ce5('0x44')][_0x8ce5('0x45')]){_0x482bd3['include']=[{'attributes':['id',_0x8ce5('0x16b'),'lastName',_0x8ce5('0xf7')],'model':db[_0x8ce5('0xd1')],'as':'Contact'},{'attributes':['id',_0x8ce5('0x37'),_0x8ce5('0x16c')],'model':db[_0x8ce5('0x16d')],'as':_0x8ce5('0xe0')}];}return db[_0x8ce5('0x16e')][_0x8ce5('0x4b')](_0x482bd3);})[_0x8ce5('0x17')](function(_0x239ceb){_0x50561d['rows']=_0x239ceb;return _0x50561d;})[_0x8ce5('0x17')](respondWithFilteredResult(_0x10b379,_0x482bd3))[_0x8ce5('0x20')](handleError(_0x10b379,null));};exports[_0x8ce5('0x16f')]=function(_0x326e72,_0x257c40){if(!_['isNil'](_0x326e72['user']['id'])&&(_0x326e72[_0x8ce5('0x81')][_0x8ce5('0x34')]==_0x8ce5('0x2e')||_0x326e72[_0x8ce5('0x81')][_0x8ce5('0x34')]==_0x8ce5('0x81'))){return db[_0x8ce5('0x43')][_0x8ce5('0x9b')]({'where':{'id':_0x326e72[_0x8ce5('0x61')]['id']},'raw':!![]})[_0x8ce5('0x17')](function(_0x24a8a5){return authService[_0x8ce5('0x170')](_0x24a8a5);})[_0x8ce5('0x17')](function(_0x3790d0){if(_0x3790d0){return _0x257c40['status'](0xc8)['json']({'api_key':_0x3790d0['token']});}else{return _0x257c40['status'](0xcc)[_0x8ce5('0x24')]({'message':'No\x20API\x20access\x20key\x20found!'});}})[_0x8ce5('0x20')](handleError(_0x257c40,0x193));}else{return _0x257c40['status'](0x191)['json']({'message':_0x8ce5('0x171')});}};exports[_0x8ce5('0x172')]=function(_0x5796ce,_0x45039b){if(!_['isNil'](_0x5796ce[_0x8ce5('0x81')]['id'])&&(_0x5796ce[_0x8ce5('0x81')][_0x8ce5('0x34')]==_0x8ce5('0x2e')||_0x5796ce['user'][_0x8ce5('0x34')]==_0x8ce5('0x81'))){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x5796ce['params']['id']}})[_0x8ce5('0x17')](function(_0x1d75cb){return authService['generateApiKey'](_0x1d75cb);})[_0x8ce5('0x17')](function(_0x5d87ff){return db['User'][_0x8ce5('0x29')]({'apiKeyIat':_0x5d87ff['iat'],'apiKeyNonce':_0x5d87ff[_0x8ce5('0x173')]},{'where':{'id':_0x5796ce[_0x8ce5('0x61')]['id']}})['then'](function(){return _0x45039b['status'](0xc8)[_0x8ce5('0x24')]({'api_key':_0x5d87ff[_0x8ce5('0x174')]});});})['catch'](handleError(_0x45039b,0x193));}else{return _0x45039b[_0x8ce5('0x22')](0x191)[_0x8ce5('0x24')]({'message':_0x8ce5('0x171')});}};exports[_0x8ce5('0x175')]=function(_0x1f639d,_0x421fc5){if(!_[_0x8ce5('0x69')](_0x1f639d[_0x8ce5('0x81')]['id'])&&(_0x1f639d[_0x8ce5('0x81')]['role']==_0x8ce5('0x2e')||_0x1f639d['user'][_0x8ce5('0x34')]==_0x8ce5('0x81'))){return db[_0x8ce5('0x43')][_0x8ce5('0x35')]({'where':{'id':_0x1f639d[_0x8ce5('0x61')]['id']}})[_0x8ce5('0x17')](handleEntityNotFound(_0x421fc5,null))[_0x8ce5('0x17')](function(_0x417ae4){if(_0x417ae4&&_0x417ae4[_0x8ce5('0x176')]&&_0x417ae4[_0x8ce5('0x177')])return _0x417ae4;else throw{'message':_0x8ce5('0x178')};})[_0x8ce5('0x17')](function(){return db[_0x8ce5('0x43')][_0x8ce5('0x29')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x1f639d['params']['id']}});})['then'](respondWithStatusCode(_0x421fc5,0xc8))[_0x8ce5('0x20')](handleError(_0x421fc5,0x193));}else{return _0x421fc5['status'](0x191)[_0x8ce5('0x24')]({'message':_0x8ce5('0x171')});}};exports[_0x8ce5('0x179')]=function(_0x48dd23,_0x483b5e){var _0x4b12bf=_0x48dd23[_0x8ce5('0x81')][_0x8ce5('0x2d')]({'plain':!![]});if(!_0x4b12bf){return _0x483b5e['status'](0x191)['send']('Unable\x20to\x20retrieve\x20the\x20current\x20user');}else{Promise[_0x8ce5('0x10b')]()[_0x8ce5('0x17')](function(){if(_0x48dd23[_0x8ce5('0x44')][_0x8ce5('0x48')]!=='true')return;return _0x48dd23['user'][_0x8ce5('0x17a')]();})['then'](function(_0x5c6f1a){if(!_0x5c6f1a)return;return _0x5c6f1a[_0x8ce5('0x2d')]({'plain':!![]});})[_0x8ce5('0x17')](function(_0x18da93){_0x4b12bf[_0x8ce5('0x48')]=_0x18da93;return _0x483b5e[_0x8ce5('0x22')](0xc8)[_0x8ce5('0x24')](_0x4b12bf);});}};exports[_0x8ce5('0x17b')]=function(_0x6e9317,_0x308148){var _0x1c446c={'offset':0x0},_0x53b484={'count':0x0,'rows':[]};Promise[_0x8ce5('0x10b')]()['then'](function(){if(!_0x6e9317[_0x8ce5('0x44')][_0x8ce5('0x32')]&&!_0x6e9317[_0x8ce5('0x44')][_0x8ce5('0x17c')]&&!_0x6e9317[_0x8ce5('0x44')]['queues'])return[];return Promise['resolve']()[_0x8ce5('0x17')](function(){var _0x527435=[];if(!_[_0x8ce5('0x90')](_0x6e9317[_0x8ce5('0x44')][_0x8ce5('0x17c')])){_0x527435[_0x8ce5('0x4a')](db[_0x8ce5('0x11b')][_0x8ce5('0x4b')]({'attributes':['id',_0x8ce5('0x37')],'where':{'id':_0x6e9317[_0x8ce5('0x44')][_0x8ce5('0x17c')]}}));}if(!_[_0x8ce5('0x90')](_0x6e9317[_0x8ce5('0x44')]['queues'])){_0x527435[_0x8ce5('0x4a')](db[_0x8ce5('0x16d')]['findAll']({'attributes':['id','name'],'type':_0x8ce5('0x17d'),'where':{'id':_0x6e9317[_0x8ce5('0x44')][_0x8ce5('0x17e')]}}));}return Promise[_0x8ce5('0x54')](_0x527435);})[_0x8ce5('0x17')](function(_0x170bdf){var _0x5168c4=_[_0x8ce5('0x17f')](_0x170bdf)[_0x8ce5('0x3c')](function(_0x5a6191){return _0x5a6191['getAgents']({'attributes':['id',_0x8ce5('0x37'),_0x8ce5('0x64'),_0x8ce5('0xa3')],'raw':!![]});});return Promise[_0x8ce5('0x54')](_0x5168c4);})[_0x8ce5('0x17')](function(_0x594781){var _0x50b011=_[_0x8ce5('0x17f')](_0x594781);if(!_0x6e9317[_0x8ce5('0x44')]['filter'])return _0x50b011;if(_[_0x8ce5('0x90')](_0x50b011)){return db['User']['findAll']({'attributes':['id','name',_0x8ce5('0x64'),'online'],'where':{'role':_0x8ce5('0x31'),'$or':[db[_0x8ce5('0x6b')][_0x8ce5('0xd5')](db[_0x8ce5('0x6b')]['fn'](_0x8ce5('0x180'),db[_0x8ce5('0x6b')]['col'](_0x8ce5('0x37'))),{'$like':'%'+_0x6e9317[_0x8ce5('0x44')][_0x8ce5('0x32')]['toLowerCase']()+'%'}),{'internal':{'$like':'%'+_0x6e9317[_0x8ce5('0x44')]['filter']+'%'}}]},'raw':!![]});}else{return _(_0x50b011)['flatten']()[_0x8ce5('0x32')](function(_0x233a44){return _0x233a44[_0x8ce5('0x37')]['toLowerCase']()[_0x8ce5('0x3f')](_0x6e9317[_0x8ce5('0x44')][_0x8ce5('0x32')][_0x8ce5('0xa9')]())||_0x233a44['internal'][_0x8ce5('0x181')]()[_0x8ce5('0x3f')](_0x6e9317[_0x8ce5('0x44')][_0x8ce5('0x32')]);})[_0x8ce5('0x36')]();}})[_0x8ce5('0x17')](function(_0x4924a7){var _0xf07ff1=_0x8ce5('0x37');var _0x9ac526=_0x8ce5('0x182');if(_0x6e9317[_0x8ce5('0x44')]['sort']){_0x9ac526=_0x6e9317[_0x8ce5('0x44')][_0x8ce5('0xd4')][0x0]==='-'?_0x8ce5('0x183'):'asc';_0xf07ff1=_0x9ac526===_0x8ce5('0x182')?_0x6e9317['query']['sort']:_0x6e9317[_0x8ce5('0x44')]['sort']['substring'](0x1);}return _(_0x4924a7)[_0x8ce5('0x184')]('id')[_0x8ce5('0x185')]([function(_0x8dab7e){return _0xf07ff1===_0x8ce5('0x37')?_0x8dab7e[_0xf07ff1][_0x8ce5('0xa9')]():_0x8dab7e[_0xf07ff1];}],[_0x9ac526])[_0x8ce5('0x3c')](function(_0x1826f0){return _[_0x8ce5('0xd6')](_0x1826f0,['id',_0x8ce5('0x37'),_0x8ce5('0x64'),'online']);})[_0x8ce5('0x36')]();})[_0x8ce5('0x17')](function(_0x6f9354){return client[_0x8ce5('0x186')]('Agents',_0x6e9317)['then'](function(_0x39305d){if(_0x39305d[_0x8ce5('0x1d')])throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');var _0x313440=_0x39305d['result'];var _0x2962ec=jayson['client'][_0x8ce5('0x16')]({'port':0x232c});return _0x2962ec[_0x8ce5('0x186')](_0x8ce5('0x30'),_0x6e9317)[_0x8ce5('0x17')](function(_0x5378fc){if(_0x5378fc[_0x8ce5('0x1d')])throw new Error(_0x8ce5('0x187'));var _0x218378=_0x5378fc[_0x8ce5('0x188')];return _[_0x8ce5('0x5d')]({},_0x218378,_0x313440);});})[_0x8ce5('0x17')](function(_0x8dcf17){return _[_0x8ce5('0x3c')](_0x6f9354,function(_0x38e6aa){var _0x552fd5=_['find'](_0x8dcf17[_0x8ce5('0x4c')],['id',_0x38e6aa['id']]);if(!_0x552fd5||!_0x38e6aa['online']){_0x38e6aa[_0x8ce5('0x22')]=_0x8ce5('0x189');}else if(_0x552fd5[_0x8ce5('0xa5')]){_0x38e6aa[_0x8ce5('0x22')]=_0x8ce5('0x10c');}else{_0x38e6aa[_0x8ce5('0x22')]=_[_0x8ce5('0x3f')]([_0x8ce5('0x18a'),'unknown',_0x8ce5('0x18b'),_0x8ce5('0x18c'),null,undefined],_0x552fd5['voiceStatus'])?_0x8ce5('0xa3'):'busy';}return _0x38e6aa;});});});})['then'](function(_0x477825){if(!_0x6e9317[_0x8ce5('0x44')][_0x8ce5('0xd7')](_0x8ce5('0xde'))){_0x1c446c['limit']=qs[_0x8ce5('0xdf')](_0x6e9317['query'][_0x8ce5('0xdf')]||0xa);_0x1c446c['offset']=qs['offset'](_0x6e9317[_0x8ce5('0x44')]['offset']);}_0x53b484['count']=_0x477825[_0x8ce5('0x6f')];_0x53b484[_0x8ce5('0x4c')]=_0x1c446c['limit']?_0x477825[_0x8ce5('0x18d')](_0x1c446c[_0x8ce5('0x25')],_0x1c446c['offset']+_0x1c446c[_0x8ce5('0xdf')]):_0x477825;return _0x53b484;})[_0x8ce5('0x17')](respondWithFilteredResult(_0x308148,_0x1c446c))[_0x8ce5('0x20')](handleError(_0x308148,null));};function get_open_tabs(_0x1d4265,_0x1ca550){var _0x1a1a84=_0x1d4265[_0x8ce5('0x18e')](0x0)['toUpperCase']()+_0x1d4265[_0x8ce5('0x18d')](0x1);var _0xba4767={'type':db[_0x8ce5('0x94')][_0x8ce5('0x6d')][_0x8ce5('0x6e')],'raw':!![]};return new BPromise(function(_0x5c5a62,_0x27873c){var _0x180e74=squel[_0x8ce5('0x18f')]()[_0x8ce5('0x190')](_0x8ce5('0x191')+_0x1a1a84+_0x8ce5('0x192'),'id')['field'](_0x8ce5('0x193'))[_0x8ce5('0x70')](_0x8ce5('0x194')+_0x1d4265+_0x8ce5('0x195'),'ui')[_0x8ce5('0xd5')]('ui.UserId\x20=\x20?',_0x1ca550['id']);return db[_0x8ce5('0x6b')]['query'](_0x180e74['toString'](),_0xba4767)[_0x8ce5('0x17')](function(_0x5cc710){_0x1ca550[_0x1a1a84+_0x8ce5('0x196')]=_0x5cc710;_0x5c5a62(_0x5cc710);})[_0x8ce5('0x20')](function(_0x4fbb17){_0x27873c(_0x4fbb17);});});}
\ No newline at end of file
+var _0x6b13=['type','key','password','where','User','query','include','true','UserSetting','userSetting','attributes','findAll','rows','openTabs','push','chat','dataValues','fax','whatsapp','show','params','differenceBy','keys','salt','filters','intersection','model','fields','length','includeAll','options','find','openchannel','all','body','describe','addContacts','ids','internal','Setting','findById','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','email','permissions','101','102','103','110','104','105','106','107','108','109','100','111','115','create','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','Telephones','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Unauthorized','findOne','enforcePasswordHistory','previousPasswords','validatePasswordHistory','updatePasswordsHistory','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','penalty','spread','QueueId','Queue:save','VoiceQueue','voice','format','SIP/%s','each','upsert','removeQueues','Queues','isArray','Queue:remove','UserVoiceQueueRt','userpic','file','getAvatar','join','root','server/files/images/','download','sms','ChatOpenTabs','createdAt','FaxOpenTabs','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','SMS','concat','CmContact','sort','merge','getContacts','CmList','List','Tags','color','tag','hasOwnProperty','nolimit','getQueues','order','pick','Queue','Unknown\x20role','getVoiceQueuesRt','getRecordings','VoiceRecording','ScreenRecording','UserId','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','mobile','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','remoteAddress','connection','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','PAUSE','MemberReport','isMiddleware','resolve','pause','QueuePause','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','mailPause','openchannelPause','smsPause','whatsapppause','manual','mail','Pause','Team','getTeams','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','User\x20with\x20id\x20%s\x20not\x20found','transaction','getAssociatedQueues','flattenDeep','addAgent','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeAgent','getLists','getAgents','values','addChatInteractions','omit','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','addFaxInteractions','removeFaxInteractions','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','CmHopper','$and','$or','$gte','$lte','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','firstName','Contact','dialActive','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','createApiKey','generateApiKey','nonce','token','removeApiKey','API\x20key\x20not\x20available','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','isEmpty','teams','queues','inbound','flatten','lower','col','toString','asc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','busy','slice','select','InteractionId','ui.createdAt','user_has_','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','util','path','lodash','jayson/promise','ioredis','../../components/auth/service','../../config/logger','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','socket.io-emitter','./user.socket','register','defaults','redis','localhost','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','update','emit','userNotification:recalc:','destroy','get','admin','Users','user','Agents','agent','telephone','filter','ignore','map','value','includes','role','name','UserProfileResource','stack','send','rawAttributes','fieldName'];(function(_0x2b2ac7,_0x2c82c6){var _0x3ff59e=function(_0x55bd22){while(--_0x55bd22){_0x2b2ac7['push'](_0x2b2ac7['shift']());}};_0x3ff59e(++_0x2c82c6);}(_0x6b13,0x140));var _0x36b1=function(_0x150fd9,_0xa49dcb){_0x150fd9=_0x150fd9-0x0;var _0x556529=_0x6b13[_0x150fd9];return _0x556529;};'use strict';var moment=require(_0x36b1('0x0'));var BPromise=require(_0x36b1('0x1'));var util=require(_0x36b1('0x2'));var path=require(_0x36b1('0x3'));var fs=require('fs');var _=require(_0x36b1('0x4'));var squel=require('squel');var jayson=require(_0x36b1('0x5'));var Redis=require(_0x36b1('0x6'));var authService=require(_0x36b1('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x36b1('0x8'))('api');var utils=require('../../config/utils');var config=require(_0x36b1('0x9'));var licenseUtil=require(_0x36b1('0xa'));var APIBadRequestError=require(_0x36b1('0xb'))[_0x36b1('0xc')];var APINotFoundError=require(_0x36b1('0xb'))[_0x36b1('0xd')];var APIHandleError=require('../../errors/api')['handleError'];var db=require('../../mysqldb')['db'];var socket=require(_0x36b1('0xe'))(new Redis(config['redis']));require(_0x36b1('0xf'))[_0x36b1('0x10')](socket);config['redis']=_[_0x36b1('0x11')](config[_0x36b1('0x12')],{'host':_0x36b1('0x13'),'port':0x18eb});var client=jayson[_0x36b1('0x14')][_0x36b1('0x15')]({'port':0x232a});var values;function respondWithRpcPromise(_0x44c941,_0x439f20,_0x29e0ec,_0x10cfd3){return new BPromise(function(_0x8e3d88,_0x3d53f9){var _0x451372=_0x10cfd3||client;return _0x451372[_0x36b1('0x16')](_0x44c941,_0x29e0ec)[_0x36b1('0x17')](function(_0x77eac5){logger[_0x36b1('0x18')](_0x36b1('0x19'),_0x439f20,_0x36b1('0x1a'));logger[_0x36b1('0x1b')]('User,\x20%s,\x20%s,\x20%s',_0x439f20,_0x36b1('0x1a'),JSON[_0x36b1('0x1c')](_0x77eac5));if(_0x77eac5[_0x36b1('0x1d')]){if(_0x77eac5[_0x36b1('0x1d')]['code']===0x1f4){logger['error'](_0x36b1('0x19'),_0x439f20,_0x77eac5[_0x36b1('0x1d')][_0x36b1('0x1e')]);return _0x3d53f9(_0x77eac5[_0x36b1('0x1d')]['message']);}logger[_0x36b1('0x1d')](_0x36b1('0x19'),_0x439f20,_0x77eac5['error']['message']);return _0x8e3d88(_0x77eac5[_0x36b1('0x1d')][_0x36b1('0x1e')]);}else{logger[_0x36b1('0x18')](_0x36b1('0x19'),_0x439f20,'request\x20sent');_0x8e3d88(_0x77eac5[_0x36b1('0x1f')][_0x36b1('0x1e')]);}})[_0x36b1('0x20')](function(_0x42ad2e){logger['error']('User,\x20%s,\x20%s',_0x439f20,_0x42ad2e);_0x3d53f9(_0x42ad2e);});});}function respondWithStatusCode(_0x5b4101,_0x4aff8d){_0x4aff8d=_0x4aff8d||0xcc;return function(_0x46fa25){if(_0x46fa25){return _0x5b4101[_0x36b1('0x21')](_0x4aff8d);}return _0x5b4101[_0x36b1('0x22')](_0x4aff8d)[_0x36b1('0x23')]();};}function respondWithResult(_0x4310a3,_0xe3fa03){_0xe3fa03=_0xe3fa03||0xc8;return function(_0x40e1db){if(_0x40e1db){return _0x4310a3[_0x36b1('0x22')](_0xe3fa03)[_0x36b1('0x24')](_0x40e1db);}};}function respondWithFilteredResult(_0x574d89,_0x1cfd93){return function(_0x536bd0){if(_0x536bd0){var _0x1c45c8=typeof _0x1cfd93['offset']==='undefined'&&typeof _0x1cfd93[_0x36b1('0x25')]===_0x36b1('0x26');var _0x230807=_0x536bd0[_0x36b1('0x27')];var _0x2fdcd3=_0x1c45c8?0x0:_0x1cfd93[_0x36b1('0x28')];var _0x2da3f0=_0x1c45c8?_0x536bd0[_0x36b1('0x27')]:_0x1cfd93['offset']+_0x1cfd93['limit'];var _0xda6198;if(_0x2da3f0>=_0x230807){_0x2da3f0=_0x230807;_0xda6198=0xc8;}else{_0xda6198=0xce;}_0x574d89['status'](_0xda6198);return _0x574d89[_0x36b1('0x29')]('Content-Range',_0x2fdcd3+'-'+_0x2da3f0+'/'+_0x230807)[_0x36b1('0x24')](_0x536bd0);}return null;};}function saveUpdates(_0x28a8e8){return function(_0x28fee4){if(_0x28fee4){return _0x28fee4[_0x36b1('0x2a')](_0x28a8e8)['then'](function(_0x26606a){socket[_0x36b1('0x2b')](_0x36b1('0x2c')+_0x26606a['id'],{});return _0x26606a;});}return null;};}function removeEntity(_0x32cc63){return function(_0x4879b6){if(_0x4879b6){return _0x4879b6[_0x36b1('0x2d')]()[_0x36b1('0x17')](function(){var _0x1c2550=_0x4879b6[_0x36b1('0x2e')]({'plain':!![]});if(_0x1c2550['role']===_0x36b1('0x2f'))return;var _0x57f769=[{'name':_0x36b1('0x30'),'value':_0x36b1('0x31'),'ignore':!![]},{'name':_0x36b1('0x32'),'value':_0x36b1('0x33'),'ignore':![]},{'name':'Telephones','value':_0x36b1('0x34'),'ignore':![]}];var _0x149eeb=_(_0x57f769)[_0x36b1('0x35')](_0x36b1('0x36'))[_0x36b1('0x37')](_0x36b1('0x38'))[_0x36b1('0x38')]();if(_[_0x36b1('0x39')](_0x149eeb,_0x1c2550[_0x36b1('0x3a')])){return;}var _0x3929fc=_['find'](_0x57f769,['value',_0x1c2550[_0x36b1('0x3a')]])[_0x36b1('0x3b')];return db[_0x36b1('0x3c')][_0x36b1('0x2d')]({'where':{'type':_0x3929fc,'resourceId':_0x1c2550['id']}})['then'](function(){return _0x4879b6;});})[_0x36b1('0x17')](function(){_0x32cc63[_0x36b1('0x22')](0xcc)[_0x36b1('0x23')]();});}};}function handleEntityNotFound(_0x46e776){return function(_0x32bf40){if(!_0x32bf40){_0x46e776[_0x36b1('0x21')](0x194);}return _0x32bf40;};}function handleError(_0x3ddf7e,_0x896a09){_0x896a09=_0x896a09||0x1f4;return function(_0x2659b8){logger['error'](_0x2659b8[_0x36b1('0x3d')]);if(_0x2659b8['name']){delete _0x2659b8[_0x36b1('0x3b')];}_0x3ddf7e[_0x36b1('0x22')](_0x896a09)[_0x36b1('0x3e')](_0x2659b8);};}exports['index']=function(_0x5f3ed0,_0x419b7d){var _0x48260d={},_0xdb98a7={'count':0x0,'rows':[]};var _0x3604a9=_(db['User'][_0x36b1('0x3f')])['map'](function(_0x37f538){return{'name':_0x37f538[_0x36b1('0x40')],'type':_0x37f538[_0x36b1('0x41')][_0x36b1('0x42')]};})[_0x36b1('0x35')](function(_0x15797){return!_[_0x36b1('0x39')]([_0x36b1('0x43'),'salt'],_0x15797[_0x36b1('0x3b')]);})[_0x36b1('0x38')]();_0x48260d=qs['getOptions'](_0x3604a9,_0x5f3ed0);var _0x5f22a9={'where':_0x48260d[_0x36b1('0x44')]};return db[_0x36b1('0x45')][_0x36b1('0x27')](_0x5f22a9)[_0x36b1('0x17')](function(_0xf953dd){_0xdb98a7[_0x36b1('0x27')]=_0xf953dd;if(_0x5f3ed0[_0x36b1('0x46')]['includeAll']){_0x48260d[_0x36b1('0x47')]=[{'all':!![]}];}if(_0x5f3ed0[_0x36b1('0x46')]['userSetting']===_0x36b1('0x48')){_0x48260d[_0x36b1('0x47')]=[{'model':db[_0x36b1('0x49')],'as':_0x36b1('0x4a')}];}if(!_[_0x36b1('0x39')](_0x48260d[_0x36b1('0x4b')],'id')){_0x48260d[_0x36b1('0x4b')]['push']('id');}return db[_0x36b1('0x45')][_0x36b1('0x4c')](_0x48260d);})[_0x36b1('0x17')](function(_0x500075){_0xdb98a7[_0x36b1('0x4d')]=_0x500075;if(_0x5f3ed0[_0x36b1('0x46')][_0x36b1('0x4e')]===_0x36b1('0x48')){var _0x5a26b0=[];for(var _0x5f3a28=0x0;_0x5f3a28<_0xdb98a7[_0x36b1('0x4d')]['length'];_0x5f3a28++){_0x5a26b0[_0x36b1('0x4f')](get_open_tabs(_0x36b1('0x50'),_0xdb98a7[_0x36b1('0x4d')][_0x5f3a28][_0x36b1('0x51')]));_0x5a26b0['push'](get_open_tabs('sms',_0xdb98a7[_0x36b1('0x4d')][_0x5f3a28][_0x36b1('0x51')]));_0x5a26b0[_0x36b1('0x4f')](get_open_tabs(_0x36b1('0x52'),_0xdb98a7['rows'][_0x5f3a28][_0x36b1('0x51')]));_0x5a26b0[_0x36b1('0x4f')](get_open_tabs('mail',_0xdb98a7['rows'][_0x5f3a28][_0x36b1('0x51')]));_0x5a26b0[_0x36b1('0x4f')](get_open_tabs('openchannel',_0xdb98a7['rows'][_0x5f3a28][_0x36b1('0x51')]));_0x5a26b0[_0x36b1('0x4f')](get_open_tabs(_0x36b1('0x53'),_0xdb98a7[_0x36b1('0x4d')][_0x5f3a28][_0x36b1('0x51')]));}return BPromise['all'](_0x5a26b0)[_0x36b1('0x17')](function(){return _0xdb98a7;});}else{return _0xdb98a7;}})[_0x36b1('0x17')](respondWithFilteredResult(_0x419b7d,_0x48260d))[_0x36b1('0x20')](handleError(_0x419b7d,null));};exports[_0x36b1('0x54')]=function(_0x48fcac,_0x582a3f){var _0x18f401={'raw':![],'where':{'id':_0x48fcac[_0x36b1('0x55')]['id']}},_0x23483a={};_0x23483a['model']=_[_0x36b1('0x56')](_[_0x36b1('0x57')](db[_0x36b1('0x45')][_0x36b1('0x3f')]),[_0x36b1('0x43'),_0x36b1('0x58')]);_0x23483a[_0x36b1('0x46')]=_[_0x36b1('0x57')](_0x48fcac['query']);_0x23483a[_0x36b1('0x59')]=_[_0x36b1('0x5a')](_0x23483a[_0x36b1('0x5b')],_0x23483a['query']);_0x18f401[_0x36b1('0x4b')]=_[_0x36b1('0x5a')](_0x23483a[_0x36b1('0x5b')],qs[_0x36b1('0x5c')](_0x48fcac[_0x36b1('0x46')][_0x36b1('0x5c')]));_0x18f401[_0x36b1('0x4b')]=_0x18f401[_0x36b1('0x4b')][_0x36b1('0x5d')]?_0x18f401[_0x36b1('0x4b')]:_0x23483a['model'];if(_0x48fcac[_0x36b1('0x46')][_0x36b1('0x5e')]){_0x18f401[_0x36b1('0x47')]=[{'all':!![]}];}if(_0x48fcac['query']['userSetting']===_0x36b1('0x48')){_0x18f401['include']=[{'model':db[_0x36b1('0x49')],'as':_0x36b1('0x4a')}];}_0x18f401=_['merge']({},_0x18f401,_0x48fcac[_0x36b1('0x5f')]);if(!_[_0x36b1('0x39')](_0x18f401['attributes'],'id')){_0x18f401[_0x36b1('0x4b')][_0x36b1('0x4f')]('id');}return db[_0x36b1('0x45')][_0x36b1('0x60')](_0x18f401)['then'](handleEntityNotFound(_0x582a3f,null))[_0x36b1('0x17')](function(_0x57e365){var _0xf2f338=[];values=_0x57e365;if(_0x48fcac[_0x36b1('0x46')][_0x36b1('0x4e')]===_0x36b1('0x48')){_0xf2f338[_0x36b1('0x4f')](get_open_tabs(_0x36b1('0x50'),_0x57e365['dataValues']));_0xf2f338[_0x36b1('0x4f')](get_open_tabs('sms',_0x57e365[_0x36b1('0x51')]));_0xf2f338[_0x36b1('0x4f')](get_open_tabs(_0x36b1('0x61'),_0x57e365[_0x36b1('0x51')]));_0xf2f338[_0x36b1('0x4f')](get_open_tabs(_0x36b1('0x53'),_0x57e365[_0x36b1('0x51')]));_0xf2f338['push'](get_open_tabs(_0x36b1('0x52'),_0x57e365[_0x36b1('0x51')]));_0xf2f338['push'](get_open_tabs('mail',_0x57e365[_0x36b1('0x51')]));return BPromise[_0x36b1('0x62')](_0xf2f338);}else{return values;}})[_0x36b1('0x17')](function(){return values;})[_0x36b1('0x17')](respondWithResult(_0x582a3f,null))['catch'](handleError(_0x582a3f,null));};exports[_0x36b1('0x2a')]=function(_0x4b149b,_0x40ce53){if(_0x4b149b[_0x36b1('0x63')]['id']){delete _0x4b149b['body']['id'];}delete _0x4b149b[_0x36b1('0x63')][_0x36b1('0x3a')];return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x4b149b[_0x36b1('0x55')]['id']}})['then'](handleEntityNotFound(_0x40ce53,null))['then'](saveUpdates(_0x4b149b[_0x36b1('0x63')],null))[_0x36b1('0x17')](respondWithResult(_0x40ce53,null))[_0x36b1('0x20')](handleError(_0x40ce53,null));};exports['describe']=function(_0xbe9e2b,_0x150674){return db['User'][_0x36b1('0x64')]()['then'](respondWithResult(_0x150674,null))[_0x36b1('0x20')](handleError(_0x150674,null));};exports[_0x36b1('0x65')]=function(_0x410767,_0x2dd4d7){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x410767[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x2dd4d7,null))[_0x36b1('0x17')](function(_0x43a448){if(_0x43a448){return _0x43a448[_0x36b1('0x65')](_0x410767['body']['ids'],_['omit'](_0x410767['body'],[_0x36b1('0x66'),'id'])||{});}})['then'](respondWithResult(_0x2dd4d7,null))[_0x36b1('0x20')](handleError(_0x2dd4d7,null));};function validateUser(_0x2dfd5a){return new BPromise(function(_0x1b5685,_0x41c83f){if(_0x2dfd5a[_0x36b1('0x67')])return _0x1b5685(_0x2dfd5a);return db[_0x36b1('0x68')][_0x36b1('0x69')](0x1)['then'](function(_0x5dafb1){if(_0x5dafb1[_0x36b1('0x6a')])authService[_0x36b1('0x6b')](_0x2dfd5a[_0x36b1('0x43')]);db[_0x36b1('0x45')][_0x36b1('0x6c')](_0x36b1('0x67'))[_0x36b1('0x17')](function(_0x5b84c7){if(_[_0x36b1('0x6d')](_0x5b84c7)){_0x2dfd5a[_0x36b1('0x67')]=_0x5dafb1[_0x36b1('0x6e')]||0x1;return;}if(_[_0x36b1('0x6d')](_0x5dafb1[_0x36b1('0x6e')])||_0x5dafb1[_0x36b1('0x6e')]===_0x5b84c7){_0x2dfd5a['internal']=_0x5b84c7+0x1;return;}if(_0x5dafb1[_0x36b1('0x6e')]>_0x5b84c7){_0x2dfd5a[_0x36b1('0x67')]=_0x5dafb1['min_internal'];return;}return db[_0x36b1('0x6f')][_0x36b1('0x46')](_0x36b1('0x70'),{'type':db['sequelize'][_0x36b1('0x71')][_0x36b1('0x72')]})['then'](function(_0x2b6c5f){if(_0x2b6c5f&&_0x2b6c5f['length']){for(var _0x287c97=0x0,_0x57a91b=_0x2b6c5f[_0x36b1('0x5d')];_0x287c97<_0x57a91b&&_[_0x36b1('0x6d')](_0x2dfd5a[_0x36b1('0x67')]);_0x287c97++){if(_0x5dafb1[_0x36b1('0x6e')]<=_0x2b6c5f[_0x287c97]['from']){_0x2dfd5a['internal']=_0x2b6c5f[_0x287c97][_0x36b1('0x73')];}else if(_0x5dafb1['min_internal']>_0x2b6c5f[_0x287c97]['from']&&_0x5dafb1[_0x36b1('0x6e')]<=_0x2b6c5f[_0x287c97]['to']){_0x2dfd5a[_0x36b1('0x67')]=_0x5dafb1[_0x36b1('0x6e')];}}}if(_['isNil'](_0x2dfd5a[_0x36b1('0x67')])){_0x2dfd5a[_0x36b1('0x67')]=_0x5b84c7+0x1;}return _0x1b5685(_0x2dfd5a);});});})[_0x36b1('0x20')](function(_0x5448ca){_0x41c83f(_0x5448ca);});});}function updateUser(_0x15a50d){return new BPromise(function(_0x293312,_0x1a5159){try{if(_0x15a50d[_0x36b1('0x74')]){_0x15a50d['mailbox']=_0x15a50d[_0x36b1('0x67')];_0x15a50d['VoiceMail']={'mailbox':_0x15a50d[_0x36b1('0x67')],'password':_0x15a50d[_0x36b1('0x43')],'fullname':_0x15a50d['fullname'],'email':_0x15a50d[_0x36b1('0x75')]};}if(_0x15a50d[_0x36b1('0x3a')]==='agent'){if(!_0x15a50d[_0x36b1('0x76')])_0x15a50d[_0x36b1('0x76')]=[_0x36b1('0x77'),_0x36b1('0x78'),_0x36b1('0x79'),'113',_0x36b1('0x7a'),_0x36b1('0x7b'),_0x36b1('0x7c'),_0x36b1('0x7d'),_0x36b1('0x7e'),_0x36b1('0x7f'),_0x36b1('0x80'),_0x36b1('0x81'),_0x36b1('0x82'),'114',_0x36b1('0x83')];}_0x293312(_0x15a50d);}catch(_0x46ae07){_0x1a5159(_0x46ae07);}});}exports[_0x36b1('0x84')]=function(_0x2e13e7,_0x19dc48){if(_0x2e13e7[_0x36b1('0x31')][_0x36b1('0x3a')]===_0x36b1('0x33'))throw new Error('Unauthorized');if(_0x2e13e7[_0x36b1('0x63')][_0x36b1('0x3a')]===_0x36b1('0x31')&&_0x2e13e7[_0x36b1('0x31')][_0x36b1('0x3a')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x2e13e7[_0x36b1('0x63')][_0x36b1('0x3a')]===_0x36b1('0x2f')&&_0x2e13e7[_0x36b1('0x31')][_0x36b1('0x3a')]!=='admin'){throw new Error(_0x36b1('0x85'));}return licenseUtil[_0x36b1('0x86')]([_0x2e13e7['body']])['then'](function(){return validateUser(_0x2e13e7[_0x36b1('0x63')]);})[_0x36b1('0x17')](function(_0x3895ed){return updateUser(_0x3895ed)['then'](function(_0x29c754){if(_0x29c754[_0x36b1('0x3a')]===_0x36b1('0x2f')){_0x29c754[_0x36b1('0x87')]=_0x2e13e7[_0x36b1('0x31')][_0x36b1('0x87')];delete _0x29c754[_0x36b1('0x88')];}return _0x29c754;});})[_0x36b1('0x17')](function(_0x47c58e){return db[_0x36b1('0x45')][_0x36b1('0x84')](_0x47c58e,{'include':[{'model':db[_0x36b1('0x89')],'as':_0x36b1('0x89')}]});})[_0x36b1('0x17')](function(_0x5978c2){if(_0x2e13e7[_0x36b1('0x63')][_0x36b1('0x3a')]===_0x36b1('0x31'))return _0x5978c2;if(_0x2e13e7['user']['role']!==_0x36b1('0x31'))return _0x5978c2;return db[_0x36b1('0x8a')][_0x36b1('0x60')]({'where':{'name':_0x5978c2[_0x36b1('0x3a')]==='agent'?_0x36b1('0x32'):'Telephones','userProfileId':_0x2e13e7[_0x36b1('0x31')][_0x36b1('0x88')]},'raw':!![]})['then'](function(_0xe77cf6){if(!_0xe77cf6||_0xe77cf6[_0x36b1('0x8b')]!=0x0)return _0x5978c2;return db[_0x36b1('0x3c')][_0x36b1('0x84')]({'name':_0x5978c2['name'],'resourceId':_0x5978c2['id'],'type':_0xe77cf6[_0x36b1('0x3b')],'sectionId':_0xe77cf6['id']},{})[_0x36b1('0x17')](function(){return _0x5978c2;});})[_0x36b1('0x20')](function(_0x5a6eeb){logger[_0x36b1('0x1d')](_0x36b1('0x8c'),_0x5a6eeb);throw _0x5a6eeb;});})['then'](respondWithResult(_0x19dc48,0xc9))[_0x36b1('0x20')](handleError(_0x19dc48,null));};exports[_0x36b1('0x8d')]=function(_0x196903,_0xb7a4f1){var _0x393c3a=_0x196903[_0x36b1('0x63')];var _0x55234e=[];if(_0x196903[_0x36b1('0x31')][_0x36b1('0x3a')]===_0x36b1('0x33'))throw new Error('Unauthorized');if(_[_0x36b1('0x8e')](_0x393c3a,['role',_0x36b1('0x31')])&&_0x196903['user'][_0x36b1('0x3a')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0x36b1('0x8e')](_0x393c3a,[_0x36b1('0x3a'),_0x36b1('0x2f')])&&_0x196903[_0x36b1('0x31')]['role']!==_0x36b1('0x2f')){throw new Error(_0x36b1('0x8f'));}return licenseUtil[_0x36b1('0x86')](_0x393c3a)[_0x36b1('0x17')](function(){return validateUser(_0x393c3a[0x0]);})['then'](function(){for(var _0x404f3d=0x1;_0x404f3d<_0x393c3a[_0x36b1('0x5d')];_0x404f3d++){var _0x52bc68=_0x393c3a[_0x404f3d-0x1]['internal'];if(!_0x393c3a[_0x404f3d]['internal'])_0x393c3a[_0x404f3d]['internal']=_0x52bc68+0x1;_0x55234e[_0x36b1('0x4f')](validateUser(_0x393c3a[_0x404f3d]));}return BPromise[_0x36b1('0x62')](_0x55234e);})[_0x36b1('0x17')](function(){_0x55234e=[];for(var _0x3263eb=0x0;_0x3263eb<_0x393c3a['length'];_0x3263eb++){_0x55234e[_0x36b1('0x4f')](updateUser(_0x393c3a[_0x3263eb]));}return BPromise[_0x36b1('0x62')](_0x55234e);})[_0x36b1('0x17')](function(){return BPromise['each'](_0x393c3a,function(_0x361e74){return db[_0x36b1('0x45')][_0x36b1('0x84')](_0x361e74,{'include':[{'model':db[_0x36b1('0x89')],'as':'VoiceMail'}]})[_0x36b1('0x17')](function(_0x1cb7bc){_0x361e74['id']=_0x1cb7bc['id'];return _0x361e74;});});})[_0x36b1('0x17')](function(_0x273cfc){if(_0x196903[_0x36b1('0x63')][_0x36b1('0x3a')]===_0x36b1('0x31'))return _0x273cfc;if(_0x196903[_0x36b1('0x31')]['role']!==_0x36b1('0x31'))return _0x273cfc;var _0x14c1dc=_[_0x36b1('0x8e')](_0x273cfc,function(_0x245ea0){return _0x245ea0[_0x36b1('0x3a')]===_0x36b1('0x33')||_0x245ea0['role']===_0x36b1('0x34');});if(!_0x14c1dc)return _0x273cfc;return db['UserProfileSection'][_0x36b1('0x4c')]({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x196903['user']['userProfileId']},'raw':!![]})[_0x36b1('0x17')](function(_0x912d5c){if(_['isEmpty'](_0x912d5c)||!_['some'](_0x912d5c,[_0x36b1('0x8b'),0x0]))return _0x273cfc;_0x55234e=[];var _0x39a07b=_(_0x912d5c)[_0x36b1('0x37')](function(_0x243e04){if(_0x243e04[_0x36b1('0x8b')]===0x1)return;return _0x243e04[_0x36b1('0x3b')]===_0x36b1('0x32')?'agent':'telephone';})['compact']()[_0x36b1('0x38')]();for(var _0x1feff6=0x0;_0x1feff6<_0x273cfc[_0x36b1('0x5d')];_0x1feff6++){if(!_['includes'](_0x39a07b,_0x273cfc[_0x1feff6][_0x36b1('0x3a')]))return;var _0xd6aac=_0x273cfc[_0x1feff6][_0x36b1('0x3a')]===_0x36b1('0x33')?'Agents':_0x36b1('0x90');_0x55234e[_0x36b1('0x4f')](db[_0x36b1('0x3c')][_0x36b1('0x84')]({'name':_0x273cfc[_0x1feff6]['name'],'resourceId':_0x273cfc[_0x1feff6]['id'],'type':_0xd6aac,'sectionId':_['find'](_0x912d5c,['name',_0xd6aac])['id']},{}));}return BPromise[_0x36b1('0x62')](_0x55234e);});})['then'](respondWithResult(_0xb7a4f1,0xc9))[_0x36b1('0x20')](handleError(_0xb7a4f1,null));};exports['changePassword']=function(_0x308385,_0x5ee44f){if(_0x308385['body']['id']){delete _0x308385[_0x36b1('0x63')]['id'];}return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x308385[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](function(_0x1f6042){if(!_0x1f6042)return null;if(_0x1f6042['id']===_0x308385['user']['id']){if(!_0x308385[_0x36b1('0x63')][_0x36b1('0x91')]||!_0x308385['body'][_0x36b1('0x92')]){throw new db[(_0x36b1('0x93'))][(_0x36b1('0x94'))](_0x36b1('0x95'));}if(!_0x1f6042[_0x36b1('0x96')](_0x308385[_0x36b1('0x63')][_0x36b1('0x91')])){throw new db[(_0x36b1('0x93'))][(_0x36b1('0x94'))]('Wrong\x20credentials');}if(_0x308385[_0x36b1('0x63')][_0x36b1('0x91')]===_0x308385[_0x36b1('0x63')][_0x36b1('0x92')]){throw new db['Sequelize']['ValidationError'](_0x36b1('0x97'));}}else if(_0x308385[_0x36b1('0x31')][_0x36b1('0x3a')]===_0x36b1('0x2f')){if(!_0x308385[_0x36b1('0x63')]['newPassword']){throw new db[(_0x36b1('0x93'))][(_0x36b1('0x94'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x308385[_0x36b1('0x31')][_0x36b1('0x3a')]==='user'){if(!_0x308385[_0x36b1('0x63')][_0x36b1('0x92')]){throw new db['Sequelize']['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x1f6042[_0x36b1('0x3a')]!==_0x36b1('0x33')){throw new db[(_0x36b1('0x93'))][(_0x36b1('0x94'))]('Unauthorized');}}else{throw new db[(_0x36b1('0x93'))]['ValidationError'](_0x36b1('0x98'));}return _0x1f6042;})['then'](handleEntityNotFound(_0x5ee44f,null))['then'](function(_0x31b8e1){return db['Setting'][_0x36b1('0x99')]({'attributes':['id',_0x36b1('0x6a'),_0x36b1('0x9a'),'passwordHistoryLimit']})[_0x36b1('0x17')](function(_0x163127){if(_0x163127['securePassword'])authService[_0x36b1('0x6b')](_0x308385[_0x36b1('0x63')][_0x36b1('0x92')]);if(!_0x163127['enforcePasswordHistory']||!_0x31b8e1[_0x36b1('0x9b')])return _0x31b8e1;authService[_0x36b1('0x9c')](_0x308385[_0x36b1('0x63')]['newPassword'],_0x31b8e1[_0x36b1('0x9b')],_0x163127['passwordHistoryLimit']);return _0x31b8e1;})[_0x36b1('0x17')](saveUpdates({'password':_0x308385[_0x36b1('0x63')]['newPassword'],'passwordResetAt':_0x308385[_0x36b1('0x31')]['id']==_0x308385['params']['id']?moment():null,'previousPasswords':authService[_0x36b1('0x9d')](_0x308385[_0x36b1('0x63')][_0x36b1('0x92')],_0x31b8e1[_0x36b1('0x9b')])},null));})[_0x36b1('0x17')](respondWithResult(_0x5ee44f,null))[_0x36b1('0x20')](handleError(_0x5ee44f,null));};exports['addQueues']=function(_0x19f305,_0x448958){var _0x493bea=_0x19f305['body'][_0x36b1('0x9e')];return db['User'][_0x36b1('0x60')]({'where':{'id':_0x19f305['params']['id']},'attributes':['id',_0x36b1('0x3b'),'role',_0x36b1('0x9f'),_0x36b1('0xa0'),_0x36b1('0xa1'),_0x36b1('0xa2')]})[_0x36b1('0x17')](handleEntityNotFound(_0x448958,null))[_0x36b1('0x17')](function(_0x274a87){if(_0x274a87){if(!utils[_0x36b1('0xa3')](_0x493bea)){throw new db[(_0x36b1('0x93'))][(_0x36b1('0x94'))](_0x36b1('0xa4'));}return _0x274a87[_0x36b1('0xa5')+_[_0x36b1('0xa6')](_0x493bea[_0x36b1('0xa7')]())+'Queues'](_0x19f305[_0x36b1('0x63')][_0x36b1('0x66')],{'penalty':_0x19f305['body'][_0x36b1('0xa8')]||0x0})[_0x36b1('0xa9')](function(_0xd59fa9){for(var _0x164c03=0x0;_0x164c03<_0x19f305[_0x36b1('0x63')][_0x36b1('0x66')]['length'];_0x164c03+=0x1){var _0x31816c={'UserId':Number(_0x19f305['params']['id'])};_0x31816c[_[_0x36b1('0xa6')](_0x493bea['toLowerCase']())+_0x36b1('0xaa')]=Number(_0x19f305[_0x36b1('0x63')][_0x36b1('0x66')][_0x164c03]);socket[_0x36b1('0x2b')](_0x36b1('0x31')+_[_0x36b1('0xa6')](_0x493bea[_0x36b1('0xa7')]())+_0x36b1('0xab'),_0x31816c);}return _0xd59fa9;})[_0x36b1('0x17')](function(){if(_0x493bea==='voice'){return db[_0x36b1('0xac')]['findAll']({'where':{'id':_0x19f305[_0x36b1('0x63')][_0x36b1('0x66')]||[]},'raw':!![],'attributes':['id',_0x36b1('0x3b')]});}})[_0x36b1('0x17')](function(_0x2fce7c){var _0x94c8f1=_0x274a87[_0x36b1('0x2e')]({'plain':!![]});var _0x533590=[];if(_0x493bea===_0x36b1('0xad')&&_0x94c8f1['role']===_0x36b1('0x33')&&_0x94c8f1[_0x36b1('0x9f')]){for(var _0x301c08=0x0;_0x301c08<_0x2fce7c[_0x36b1('0x5d')];_0x301c08+=0x1){_0x533590['push']({'membername':_0x94c8f1[_0x36b1('0x3b')],'UserId':_0x94c8f1['id'],'queue_name':_0x2fce7c[_0x301c08][_0x36b1('0x3b')],'VoiceQueueId':_0x2fce7c[_0x301c08]['id'],'interface':_['isNil'](_0x94c8f1[_0x36b1('0xa2')])?util[_0x36b1('0xae')](_0x36b1('0xaf'),_0x94c8f1[_0x36b1('0x3b')]):_0x94c8f1[_0x36b1('0xa2')],'paused':_0x94c8f1[_0x36b1('0xa1')]||![],'penalty':_0x19f305['body'][_0x36b1('0xa8')]||0x0});}return BPromise[_0x36b1('0xb0')](_0x533590,function(_0x5abb58){return db['UserVoiceQueueRt'][_0x36b1('0xb1')](_0x5abb58);});}return _0x274a87;});}})['then'](respondWithStatusCode(_0x448958,null))[_0x36b1('0x20')](handleError(_0x448958,null));};exports[_0x36b1('0xb2')]=function(_0x3b3968,_0xc5a49c){var _0x232e90,_0x219273;return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x3b3968[_0x36b1('0x55')]['id']},'attributes':['id',_0x36b1('0x3b'),_0x36b1('0x3a')]})[_0x36b1('0x17')](handleEntityNotFound(_0xc5a49c,null))[_0x36b1('0x17')](function(_0x9bfd2){if(_0x9bfd2){_0x232e90=_0x9bfd2;if(!_0x3b3968[_0x36b1('0x46')]['channel']||!utils[_0x36b1('0xa3')](_0x3b3968[_0x36b1('0x46')][_0x36b1('0x9e')])){throw new db[(_0x36b1('0x93'))][(_0x36b1('0x94'))](_0x36b1('0xa4'));}return _0x9bfd2['remove'+_[_0x36b1('0xa6')](_0x3b3968['query'][_0x36b1('0x9e')][_0x36b1('0xa7')]())+_0x36b1('0xb3')](_0x3b3968[_0x36b1('0x46')]['ids']);}})['then'](function(_0x2475f1){if(_[_0x36b1('0xb4')](_0x3b3968[_0x36b1('0x46')]['ids'])){for(var _0x4a185a=0x0;_0x4a185a<_0x3b3968[_0x36b1('0x46')][_0x36b1('0x66')][_0x36b1('0x5d')];_0x4a185a+=0x1){_0x219273={'UserId':Number(_0x3b3968[_0x36b1('0x55')]['id'])};_0x219273[_[_0x36b1('0xa6')](_0x3b3968[_0x36b1('0x46')][_0x36b1('0x9e')][_0x36b1('0xa7')]())+_0x36b1('0xaa')]=Number(_0x3b3968['query'][_0x36b1('0x66')][_0x4a185a]);socket[_0x36b1('0x2b')]('user'+_['capitalize'](_0x3b3968['query'][_0x36b1('0x9e')][_0x36b1('0xa7')]())+'Queue:remove',_0x219273);}}else{_0x219273={'UserId':Number(_0x3b3968[_0x36b1('0x55')]['id'])};_0x219273[_[_0x36b1('0xa6')](_0x3b3968[_0x36b1('0x46')]['channel'][_0x36b1('0xa7')]())+_0x36b1('0xaa')]=Number(_0x3b3968[_0x36b1('0x46')][_0x36b1('0x66')]);socket[_0x36b1('0x2b')]('user'+_[_0x36b1('0xa6')](_0x3b3968[_0x36b1('0x46')][_0x36b1('0x9e')][_0x36b1('0xa7')]())+_0x36b1('0xb5'),_0x219273);}return _0x2475f1;})[_0x36b1('0x17')](function(){if(_0x3b3968[_0x36b1('0x46')][_0x36b1('0x9e')]===_0x36b1('0xad')){return db[_0x36b1('0xb6')][_0x36b1('0x2d')]({'where':{'UserId':_0x3b3968[_0x36b1('0x55')]['id'],'VoiceQueueId':_0x3b3968[_0x36b1('0x46')][_0x36b1('0x66')]},'individualHooks':!![]})['then'](function(){return _0x232e90;});}return _0x232e90;})['then'](respondWithStatusCode(_0xc5a49c,null))[_0x36b1('0x20')](handleError(_0xc5a49c,null));};exports['addAvatar']=function(_0x50bfcd,_0x22f61a){_0x50bfcd[_0x36b1('0x63')][_0x36b1('0xb7')]=_0x50bfcd[_0x36b1('0xb8')]['filename'];return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x50bfcd[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x22f61a,null))[_0x36b1('0x17')](saveUpdates(_0x50bfcd[_0x36b1('0x63')],null))['then'](respondWithResult(_0x22f61a,null))['catch'](handleError(_0x22f61a,null));};exports[_0x36b1('0xb9')]=function(_0x2f40a0,_0x3abbec){var _0x56758f=path[_0x36b1('0xba')](config[_0x36b1('0xbb')],'server/files/images/logos/default_profile.png');return db['User']['find']({'where':{'id':_0x2f40a0[_0x36b1('0x55')]['id']},'attributes':['id',_0x36b1('0xb7')],'raw':!![]})[_0x36b1('0x17')](handleEntityNotFound(_0x3abbec,null))['then'](function(_0x4e4c77){if(_0x4e4c77){if(_[_0x36b1('0x6d')](_0x4e4c77[_0x36b1('0xb7')])){return _0x3abbec['download'](_0x56758f);}else{if(!fs['existsSync'](path['join'](config[_0x36b1('0xbb')],_0x36b1('0xbc'),_0x4e4c77['userpic']))){return _0x3abbec[_0x36b1('0xbd')](_0x56758f);}return _0x3abbec[_0x36b1('0xbd')](path[_0x36b1('0xba')](config['root'],_0x36b1('0xbc'),_0x4e4c77[_0x36b1('0xb7')]));}}})[_0x36b1('0x20')](handleError(_0x3abbec,null));};exports['getOpenTabs']=function(_0x204701,_0x4e67e5){return db['User'][_0x36b1('0x60')]({'where':{'id':_0x204701[_0x36b1('0x55')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x4e67e5,null))[_0x36b1('0x17')](function(_0x55681a){var _0x58e9ad=[];values=_0x55681a[_0x36b1('0x51')];_0x58e9ad[_0x36b1('0x4f')](get_open_tabs('chat',_0x55681a['dataValues']));_0x58e9ad[_0x36b1('0x4f')](get_open_tabs(_0x36b1('0xbe'),_0x55681a[_0x36b1('0x51')]));_0x58e9ad[_0x36b1('0x4f')](get_open_tabs(_0x36b1('0x61'),_0x55681a[_0x36b1('0x51')]));_0x58e9ad['push'](get_open_tabs(_0x36b1('0x53'),_0x55681a[_0x36b1('0x51')]));_0x58e9ad['push'](get_open_tabs(_0x36b1('0x52'),_0x55681a[_0x36b1('0x51')]));_0x58e9ad[_0x36b1('0x4f')](get_open_tabs('mail',_0x55681a[_0x36b1('0x51')]));return BPromise[_0x36b1('0x62')](_0x58e9ad);})[_0x36b1('0x17')](function(_0x8a20a1){if(_0x8a20a1){var _0x2a12a1=_[_0x36b1('0x37')](values[_0x36b1('0xbf')],function(_0x19f390){return{'channel':'CHAT','id':_0x19f390['id'],'createdAt':_0x19f390[_0x36b1('0xc0')]};});var _0x3e2802=_[_0x36b1('0x37')](values[_0x36b1('0xc1')],function(_0x2441ae){return{'channel':'FAX','id':_0x2441ae['id'],'createdAt':_0x2441ae[_0x36b1('0xc0')]};});var _0x381fa1=_['map'](values['OpenchannelOpenTabs'],function(_0x576229){return{'channel':_0x36b1('0xc2'),'id':_0x576229['id'],'createdAt':_0x576229[_0x36b1('0xc0')]};});var _0x41f5a7=_[_0x36b1('0x37')](values[_0x36b1('0xc3')],function(_0x5b4f3e){return{'channel':'MAIL','id':_0x5b4f3e['id'],'createdAt':_0x5b4f3e['createdAt']};});var _0x4e8b6f=_[_0x36b1('0x37')](values[_0x36b1('0xc4')],function(_0x55fe25){return{'channel':_0x36b1('0xc5'),'id':_0x55fe25['id'],'createdAt':_0x55fe25[_0x36b1('0xc0')]};});var _0x348669=_['map'](values['WhatsappOpenTabs'],function(_0x1eaa82){return{'channel':'WHATSAPP','id':_0x1eaa82['id'],'createdAt':_0x1eaa82['createdAt']};});var _0x54ca2d=_[_0x36b1('0xc6')](_0x2a12a1,_0x3e2802,_0x381fa1,_0x41f5a7,_0x4e8b6f,_0x348669);var _0x48ecfa={'count':_0x54ca2d[_0x36b1('0x5d')],'rows':_0x54ca2d};return _0x48ecfa;}else return null;})[_0x36b1('0x17')](respondWithResult(_0x4e67e5,null))[_0x36b1('0x20')](handleError(_0x4e67e5,null));};exports['getContacts']=function(_0x23a181,_0x3eb69f){var _0x41cf63={};var _0x4fb9b8={};var _0x38fe15;var _0xf9a378;return db['User'][_0x36b1('0x99')]({'where':{'id':_0x23a181[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x3eb69f,null))[_0x36b1('0x17')](function(_0x467e9f){if(_0x467e9f){_0x38fe15=_0x467e9f;_0x4fb9b8[_0x36b1('0x5b')]=_['keys'](db[_0x36b1('0xc7')]['rawAttributes']);_0x4fb9b8['query']=_[_0x36b1('0x57')](_0x23a181['query']);_0x4fb9b8[_0x36b1('0x59')]=_['intersection'](_0x4fb9b8[_0x36b1('0x5b')],_0x4fb9b8[_0x36b1('0x46')]);_0x41cf63[_0x36b1('0x4b')]=_[_0x36b1('0x5a')](_0x4fb9b8[_0x36b1('0x5b')],qs[_0x36b1('0x5c')](_0x23a181[_0x36b1('0x46')]['fields']));_0x41cf63[_0x36b1('0x4b')]=_0x41cf63[_0x36b1('0x4b')][_0x36b1('0x5d')]?_0x41cf63['attributes']:_0x4fb9b8[_0x36b1('0x5b')];_0x41cf63['order']=qs['sort'](_0x23a181[_0x36b1('0x46')][_0x36b1('0xc8')]);_0x41cf63[_0x36b1('0x44')]=qs[_0x36b1('0x59')](_['pick'](_0x23a181[_0x36b1('0x46')],_0x4fb9b8[_0x36b1('0x59')]));if(_0x23a181[_0x36b1('0x46')][_0x36b1('0x35')]){_0x41cf63['where']=_[_0x36b1('0xc9')](_0x41cf63[_0x36b1('0x44')],{'$or':_[_0x36b1('0x37')](_0x41cf63[_0x36b1('0x4b')],function(_0x83b605){var _0x576a9d={};_0x576a9d[_0x83b605]={'$like':'%'+_0x23a181[_0x36b1('0x46')][_0x36b1('0x35')]+'%'};return _0x576a9d;})});}_0x41cf63=_['merge']({},_0x41cf63,_0x23a181[_0x36b1('0x5f')]);return _0x38fe15[_0x36b1('0xca')](_0x41cf63);}})['then'](function(_0x7dcb32){if(_0x7dcb32){_0xf9a378=_0x7dcb32[_0x36b1('0x5d')];if(_0x23a181[_0x36b1('0x46')]['hasOwnProperty'](_0x36b1('0x5e'))){_0x41cf63[_0x36b1('0x47')]=[{'model':db[_0x36b1('0xcb')],'as':_0x36b1('0xcc'),'required':![]},{'model':db['Tag'],'as':_0x36b1('0xcd'),'attributes':['id',_0x36b1('0x3b'),_0x36b1('0xce')],'where':_0x23a181['query'][_0x36b1('0xcf')]?{'id':_0x23a181[_0x36b1('0x46')][_0x36b1('0xcf')]}:undefined,'required':_0x23a181[_0x36b1('0x46')][_0x36b1('0xcf')]?!![]:![]}];}if(!_0x23a181[_0x36b1('0x46')][_0x36b1('0xd0')](_0x36b1('0xd1'))){_0x41cf63[_0x36b1('0x25')]=qs[_0x36b1('0x25')](_0x23a181[_0x36b1('0x46')][_0x36b1('0x25')]);_0x41cf63['offset']=qs[_0x36b1('0x28')](_0x23a181[_0x36b1('0x46')][_0x36b1('0x28')]);}return _0x38fe15[_0x36b1('0xca')](_0x41cf63);}})[_0x36b1('0x17')](function(_0x1441a0){if(_0x1441a0){return _0x1441a0?{'count':_0xf9a378,'rows':_0x1441a0}:null;}})[_0x36b1('0x17')](respondWithResult(_0x3eb69f,null))[_0x36b1('0x20')](handleError(_0x3eb69f,null));};exports[_0x36b1('0xd2')]=function(_0x49cee5,_0x226304){var _0x11f5ae;var _0x41388a={};var _0x44438c;return db[_0x36b1('0x45')][_0x36b1('0x99')]({'where':{'id':_0x49cee5[_0x36b1('0x55')]['id']},'attributes':['id',_0x36b1('0x3b'),_0x36b1('0x3a')]})[_0x36b1('0x17')](handleEntityNotFound(_0x226304,null))[_0x36b1('0x17')](function(_0x2eac16){if(!utils[_0x36b1('0xa3')](_0x49cee5[_0x36b1('0x46')]['channel'])){throw new db['Sequelize'][(_0x36b1('0x94'))]('Unknown\x20channel');}_0x11f5ae=_0x2eac16;var _0x6207c5={};_0x6207c5[_0x36b1('0x5b')]=_[_0x36b1('0x57')](db[_[_0x36b1('0xa6')](_0x49cee5[_0x36b1('0x46')]['channel'])+'Queue'][_0x36b1('0x3f')]);_0x6207c5[_0x36b1('0x46')]=_['keys'](_0x49cee5['query']);_0x6207c5[_0x36b1('0x59')]=_[_0x36b1('0x5a')](_0x6207c5[_0x36b1('0x5b')],_0x6207c5[_0x36b1('0x46')]);_0x41388a[_0x36b1('0x4b')]=_[_0x36b1('0x5a')](_0x6207c5[_0x36b1('0x5b')],qs[_0x36b1('0x5c')](_0x49cee5['query'][_0x36b1('0x5c')]));_0x41388a['attributes']=_0x41388a[_0x36b1('0x4b')]['length']?_0x41388a['attributes']:_0x6207c5['model'];_0x41388a[_0x36b1('0xd3')]=qs[_0x36b1('0xc8')](_0x49cee5[_0x36b1('0x46')]['sort']);_0x41388a['where']=qs[_0x36b1('0x59')](_[_0x36b1('0xd4')](_0x49cee5[_0x36b1('0x46')],_0x6207c5[_0x36b1('0x59')]));if(_0x49cee5['query'][_0x36b1('0x35')]){_0x41388a[_0x36b1('0x44')]=_[_0x36b1('0xc9')](_0x41388a[_0x36b1('0x44')],{'$or':_[_0x36b1('0x37')](_0x41388a['attributes'],function(_0x18d615){var _0x1a68bb={};_0x1a68bb[_0x18d615]={'$like':'%'+_0x49cee5[_0x36b1('0x46')][_0x36b1('0x35')]+'%'};return _0x1a68bb;})});}_0x41388a=_['merge']({},_0x41388a,_0x49cee5[_0x36b1('0x5f')]);switch(_0x11f5ae[_0x36b1('0x3a')]){case'admin':return db[_['capitalize'](_0x49cee5[_0x36b1('0x46')][_0x36b1('0x9e')])+_0x36b1('0xd5')][_0x36b1('0x4c')](_0x41388a);case _0x36b1('0x31'):case _0x36b1('0x33'):return _0x11f5ae['get'+_['capitalize'](_0x49cee5[_0x36b1('0x46')][_0x36b1('0x9e')])+_0x36b1('0xb3')](_0x41388a);default:throw new db[(_0x36b1('0x93'))][(_0x36b1('0x94'))](_0x36b1('0xd6'));}})[_0x36b1('0x17')](function(_0x333f80){_0x44438c=_0x333f80['length'];if(!_0x49cee5[_0x36b1('0x46')][_0x36b1('0xd0')](_0x36b1('0xd1'))){_0x41388a[_0x36b1('0x25')]=qs[_0x36b1('0x25')](_0x49cee5[_0x36b1('0x46')][_0x36b1('0x25')]);_0x41388a[_0x36b1('0x28')]=qs['offset'](_0x49cee5[_0x36b1('0x46')]['offset']);}switch(_0x11f5ae['role']){case _0x36b1('0x2f'):return db[_['capitalize'](_0x49cee5[_0x36b1('0x46')][_0x36b1('0x9e')])+_0x36b1('0xd5')][_0x36b1('0x4c')](_0x41388a);case _0x36b1('0x31'):case _0x36b1('0x33'):return _0x11f5ae[_0x36b1('0x2e')+_['capitalize'](_0x49cee5['query'][_0x36b1('0x9e')])+_0x36b1('0xb3')](_0x41388a);}})[_0x36b1('0x17')](function(_0x441fd2){return{'count':_0x44438c,'rows':_0x441fd2};})[_0x36b1('0x17')](respondWithResult(_0x226304,null))[_0x36b1('0x20')](handleError(_0x226304,null));};exports[_0x36b1('0xd7')]=function(_0x24794c,_0x416e07){var _0x2c016a={};var _0x208f3b={};var _0x134485;var _0xba41c0;return db[_0x36b1('0x45')][_0x36b1('0x99')]({'where':{'id':_0x24794c[_0x36b1('0x55')]['id']}})['then'](handleEntityNotFound(_0x416e07,null))[_0x36b1('0x17')](function(_0x42dc63){if(_0x42dc63){_0x134485=_0x42dc63;_0x208f3b[_0x36b1('0x5b')]=_[_0x36b1('0x57')](db[_0x36b1('0xb6')][_0x36b1('0x3f')]);_0x208f3b['query']=_[_0x36b1('0x57')](_0x24794c[_0x36b1('0x46')]);_0x208f3b[_0x36b1('0x59')]=_[_0x36b1('0x5a')](_0x208f3b['model'],_0x208f3b['query']);_0x2c016a[_0x36b1('0x4b')]=_[_0x36b1('0x5a')](_0x208f3b['model'],qs[_0x36b1('0x5c')](_0x24794c[_0x36b1('0x46')][_0x36b1('0x5c')]));_0x2c016a[_0x36b1('0x4b')]=_0x2c016a[_0x36b1('0x4b')][_0x36b1('0x5d')]?_0x2c016a['attributes']:_0x208f3b[_0x36b1('0x5b')];_0x2c016a[_0x36b1('0xd3')]=qs[_0x36b1('0xc8')](_0x24794c[_0x36b1('0x46')][_0x36b1('0xc8')]);_0x2c016a[_0x36b1('0x44')]=qs[_0x36b1('0x59')](_[_0x36b1('0xd4')](_0x24794c['query'],_0x208f3b[_0x36b1('0x59')]));if(_0x24794c['query'][_0x36b1('0x35')]){_0x2c016a[_0x36b1('0x44')]=_['merge'](_0x2c016a['where'],{'$or':_[_0x36b1('0x37')](_0x2c016a['attributes'],function(_0x54a76c){var _0x246232={};_0x246232[_0x54a76c]={'$like':'%'+_0x24794c[_0x36b1('0x46')][_0x36b1('0x35')]+'%'};return _0x246232;})});}_0x2c016a=_[_0x36b1('0xc9')]({},_0x2c016a,_0x24794c[_0x36b1('0x5f')]);return _0x134485[_0x36b1('0xd7')](_0x2c016a);}})['then'](function(_0x550777){if(_0x550777){_0xba41c0=_0x550777[_0x36b1('0x5d')];if(!_0x24794c[_0x36b1('0x46')][_0x36b1('0xd0')](_0x36b1('0xd1'))){_0x2c016a[_0x36b1('0x25')]=qs[_0x36b1('0x25')](_0x24794c[_0x36b1('0x46')][_0x36b1('0x25')]);_0x2c016a[_0x36b1('0x28')]=qs[_0x36b1('0x28')](_0x24794c['query'][_0x36b1('0x28')]);}return _0x134485['getVoiceQueuesRt'](_0x2c016a);}})[_0x36b1('0x17')](function(_0x4714f4){if(_0x4714f4){return _0x4714f4?{'count':_0xba41c0,'rows':_0x4714f4}:null;}})[_0x36b1('0x17')](respondWithResult(_0x416e07,null))[_0x36b1('0x20')](handleError(_0x416e07,null));};exports['getGroups']=function(_0x2f7c9f,_0x581ae0){var _0x1c8e98={};var _0x502012={};var _0x5b4dcc;var _0x4e543a;return db[_0x36b1('0x45')][_0x36b1('0x99')]({'where':{'id':_0x2f7c9f[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x581ae0,null))[_0x36b1('0x17')](function(_0x1b7ce0){if(_0x1b7ce0){_0x5b4dcc=_0x1b7ce0;_0x502012['model']=_[_0x36b1('0x57')](db['ChatGroup']['rawAttributes']);_0x502012[_0x36b1('0x46')]=_[_0x36b1('0x57')](_0x2f7c9f[_0x36b1('0x46')]);_0x502012[_0x36b1('0x59')]=_[_0x36b1('0x5a')](_0x502012[_0x36b1('0x5b')],_0x502012[_0x36b1('0x46')]);_0x1c8e98[_0x36b1('0x4b')]=_[_0x36b1('0x5a')](_0x502012[_0x36b1('0x5b')],qs[_0x36b1('0x5c')](_0x2f7c9f[_0x36b1('0x46')][_0x36b1('0x5c')]));_0x1c8e98[_0x36b1('0x4b')]=_0x1c8e98[_0x36b1('0x4b')][_0x36b1('0x5d')]?_0x1c8e98['attributes']:_0x502012[_0x36b1('0x5b')];_0x1c8e98[_0x36b1('0xd3')]=qs[_0x36b1('0xc8')](_0x2f7c9f[_0x36b1('0x46')]['sort']);_0x1c8e98[_0x36b1('0x44')]=qs['filters'](_[_0x36b1('0xd4')](_0x2f7c9f[_0x36b1('0x46')],_0x502012[_0x36b1('0x59')]));if(_0x2f7c9f[_0x36b1('0x46')][_0x36b1('0x35')]){_0x1c8e98['where']=_[_0x36b1('0xc9')](_0x1c8e98['where'],{'$or':_[_0x36b1('0x37')](_0x1c8e98[_0x36b1('0x4b')],function(_0x4e6680){var _0x4f4304={};_0x4f4304[_0x4e6680]={'$like':'%'+_0x2f7c9f[_0x36b1('0x46')]['filter']+'%'};return _0x4f4304;})});}_0x1c8e98=_[_0x36b1('0xc9')]({},_0x1c8e98,_0x2f7c9f['options']);return _0x5b4dcc['getGroups'](_0x1c8e98);}})[_0x36b1('0x17')](function(_0x14c1a2){if(_0x14c1a2){_0x4e543a=_0x14c1a2[_0x36b1('0x5d')];if(!_0x2f7c9f[_0x36b1('0x46')][_0x36b1('0xd0')](_0x36b1('0xd1'))){_0x1c8e98[_0x36b1('0x25')]=qs[_0x36b1('0x25')](_0x2f7c9f['query'][_0x36b1('0x25')]);_0x1c8e98[_0x36b1('0x28')]=qs[_0x36b1('0x28')](_0x2f7c9f[_0x36b1('0x46')][_0x36b1('0x28')]);}return _0x5b4dcc['getGroups'](_0x1c8e98);}})[_0x36b1('0x17')](function(_0x1498de){if(_0x1498de){return _0x1498de?{'count':_0x4e543a,'rows':_0x1498de}:null;}})[_0x36b1('0x17')](respondWithResult(_0x581ae0,null))['catch'](handleError(_0x581ae0,null));};exports[_0x36b1('0xd8')]=function(_0x41d8bf,_0x3a81cb){var _0x3eb9cb={'raw':!![],'where':{}};var _0x254350={};var _0x139544={'count':0x0,'rows':[]};return db[_0x36b1('0x45')]['findOne']({'where':{'id':_0x41d8bf['params']['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x3a81cb,null))[_0x36b1('0x17')](function(_0x21aef5){if(_0x21aef5){_0x254350[_0x36b1('0x5b')]=_[_0x36b1('0x57')](db[_0x36b1('0xd9')][_0x36b1('0x3f')]);_0x254350[_0x36b1('0x46')]=_['keys'](_0x41d8bf['query']);_0x254350[_0x36b1('0x59')]=_[_0x36b1('0x5a')](_0x254350[_0x36b1('0x5b')],_0x254350[_0x36b1('0x46')]);_0x3eb9cb['attributes']=_['intersection'](_0x254350['model'],qs[_0x36b1('0x5c')](_0x41d8bf[_0x36b1('0x46')]['fields']));_0x3eb9cb[_0x36b1('0x4b')]=_0x3eb9cb[_0x36b1('0x4b')][_0x36b1('0x5d')]?_0x3eb9cb[_0x36b1('0x4b')]:_0x254350[_0x36b1('0x5b')];if(!_0x41d8bf[_0x36b1('0x46')][_0x36b1('0xd0')]('nolimit')){_0x3eb9cb['limit']=qs[_0x36b1('0x25')](_0x41d8bf[_0x36b1('0x46')][_0x36b1('0x25')]);_0x3eb9cb['offset']=qs[_0x36b1('0x28')](_0x41d8bf[_0x36b1('0x46')][_0x36b1('0x28')]);}_0x3eb9cb['order']=qs['sort'](_0x41d8bf[_0x36b1('0x46')][_0x36b1('0xc8')]);_0x3eb9cb[_0x36b1('0x44')]=qs[_0x36b1('0x59')](_[_0x36b1('0xd4')](_0x41d8bf[_0x36b1('0x46')],_0x254350[_0x36b1('0x59')]));_0x3eb9cb[_0x36b1('0x44')]['UserId']=_0x21aef5['id'];if(_0x41d8bf[_0x36b1('0x46')][_0x36b1('0x35')]){_0x3eb9cb[_0x36b1('0x44')]=_[_0x36b1('0xc9')](_0x3eb9cb[_0x36b1('0x44')],{'$or':_['map'](_0x3eb9cb[_0x36b1('0x4b')],function(_0x3c623b){var _0x69d3b1={};_0x69d3b1[_0x3c623b]={'$like':'%'+_0x41d8bf[_0x36b1('0x46')]['filter']+'%'};return _0x69d3b1;})});}_0x3eb9cb=_[_0x36b1('0xc9')]({},_0x3eb9cb,_0x41d8bf[_0x36b1('0x5f')]);return db['VoiceRecording'][_0x36b1('0x27')]({'where':_0x3eb9cb[_0x36b1('0x44')]})[_0x36b1('0x17')](function(_0x29f167){_0x139544['count']=_0x29f167;if(_0x41d8bf[_0x36b1('0x46')][_0x36b1('0x5e')]){_0x3eb9cb[_0x36b1('0x47')]=[{'all':!![]}];}return db[_0x36b1('0xd9')]['findAll'](_0x3eb9cb);})['then'](function(_0x51e2c0){_0x139544[_0x36b1('0x4d')]=_0x51e2c0;return _0x139544;});}})[_0x36b1('0x17')](respondWithFilteredResult(_0x3a81cb,_0x3eb9cb))[_0x36b1('0x20')](handleError(_0x3a81cb,null));};exports['getScreenRecordings']=function(_0x2e4c71,_0x2ae66a){var _0x1166ea={'raw':!![],'where':{}};var _0x1b3375={};var _0x5d1cd1={'count':0x0,'rows':[]};return db['User'][_0x36b1('0x99')]({'where':{'id':_0x2e4c71[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x2ae66a,null))[_0x36b1('0x17')](function(_0x2c4dc1){if(_0x2c4dc1){_0x1b3375[_0x36b1('0x5b')]=_['keys'](db[_0x36b1('0xda')][_0x36b1('0x3f')]);_0x1b3375[_0x36b1('0x46')]=_[_0x36b1('0x57')](_0x2e4c71[_0x36b1('0x46')]);_0x1b3375['filters']=_[_0x36b1('0x5a')](_0x1b3375[_0x36b1('0x5b')],_0x1b3375[_0x36b1('0x46')]);_0x1166ea[_0x36b1('0x4b')]=_[_0x36b1('0x5a')](_0x1b3375['model'],qs[_0x36b1('0x5c')](_0x2e4c71['query'][_0x36b1('0x5c')]));_0x1166ea[_0x36b1('0x4b')]=_0x1166ea[_0x36b1('0x4b')][_0x36b1('0x5d')]?_0x1166ea['attributes']:_0x1b3375['model'];if(!_0x2e4c71[_0x36b1('0x46')][_0x36b1('0xd0')](_0x36b1('0xd1'))){_0x1166ea[_0x36b1('0x25')]=qs[_0x36b1('0x25')](_0x2e4c71['query']['limit']);_0x1166ea[_0x36b1('0x28')]=qs[_0x36b1('0x28')](_0x2e4c71['query'][_0x36b1('0x28')]);}_0x1166ea[_0x36b1('0xd3')]=qs[_0x36b1('0xc8')](_0x2e4c71[_0x36b1('0x46')][_0x36b1('0xc8')]);_0x1166ea[_0x36b1('0x44')]=qs['filters'](_['pick'](_0x2e4c71[_0x36b1('0x46')],_0x1b3375[_0x36b1('0x59')]));_0x1166ea[_0x36b1('0x44')][_0x36b1('0xdb')]=_0x2c4dc1['id'];if(_0x2e4c71['query'][_0x36b1('0x35')]){_0x1166ea['where']=_[_0x36b1('0xc9')](_0x1166ea[_0x36b1('0x44')],{'$or':_[_0x36b1('0x37')](_0x1166ea[_0x36b1('0x4b')],function(_0x3180bd){var _0x4a5293={};_0x4a5293[_0x3180bd]={'$like':'%'+_0x2e4c71[_0x36b1('0x46')][_0x36b1('0x35')]+'%'};return _0x4a5293;})});}_0x1166ea=_[_0x36b1('0xc9')]({},_0x1166ea,_0x2e4c71[_0x36b1('0x5f')]);return db['ScreenRecording']['count']({'where':_0x1166ea['where']})[_0x36b1('0x17')](function(_0x4a9294){_0x5d1cd1[_0x36b1('0x27')]=_0x4a9294;if(_0x2e4c71[_0x36b1('0x46')]['includeAll']){_0x1166ea[_0x36b1('0x47')]=[{'all':!![]}];}return db['ScreenRecording'][_0x36b1('0x4c')](_0x1166ea);})[_0x36b1('0x17')](function(_0x406af7){_0x5d1cd1[_0x36b1('0x4d')]=_0x406af7;return _0x5d1cd1;});}})[_0x36b1('0x17')](respondWithFilteredResult(_0x2ae66a,_0x1166ea))[_0x36b1('0x20')](handleError(_0x2ae66a,null));};exports[_0x36b1('0xdc')]=function(_0x16071c,_0x4fd535){var _0xff3fa8={};var _0x5cabc4={};var _0x4eb492;var _0x12dbff;return db[_0x36b1('0x45')][_0x36b1('0x99')]({'where':{'id':_0x16071c['params']['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x4fd535,null))['then'](function(_0x2786d1){if(_0x2786d1){_0x4eb492=_0x2786d1;_0x5cabc4['model']=_[_0x36b1('0x57')](db[_0x36b1('0xdd')][_0x36b1('0x3f')]);_0x5cabc4[_0x36b1('0x46')]=_[_0x36b1('0x57')](_0x16071c[_0x36b1('0x46')]);_0x5cabc4[_0x36b1('0x59')]=_[_0x36b1('0x5a')](_0x5cabc4[_0x36b1('0x5b')],_0x5cabc4['query']);_0xff3fa8[_0x36b1('0x4b')]=_[_0x36b1('0x5a')](_0x5cabc4[_0x36b1('0x5b')],qs[_0x36b1('0x5c')](_0x16071c[_0x36b1('0x46')][_0x36b1('0x5c')]));_0xff3fa8['attributes']=_0xff3fa8[_0x36b1('0x4b')][_0x36b1('0x5d')]?_0xff3fa8[_0x36b1('0x4b')]:_0x5cabc4[_0x36b1('0x5b')];_0xff3fa8[_0x36b1('0xd3')]=qs['sort'](_0x16071c[_0x36b1('0x46')][_0x36b1('0xc8')]);_0xff3fa8[_0x36b1('0x44')]=qs[_0x36b1('0x59')](_[_0x36b1('0xd4')](_0x16071c[_0x36b1('0x46')],_0x5cabc4[_0x36b1('0x59')]));if(_0x16071c['query']['filter']){_0xff3fa8[_0x36b1('0x44')]=_['merge'](_0xff3fa8[_0x36b1('0x44')],{'$or':_['map'](_0xff3fa8[_0x36b1('0x4b')],function(_0x432e88){var _0x598a95={};_0x598a95[_0x432e88]={'$like':'%'+_0x16071c['query'][_0x36b1('0x35')]+'%'};return _0x598a95;})});}_0xff3fa8=_[_0x36b1('0xc9')]({},_0xff3fa8,_0x16071c[_0x36b1('0x5f')]);return _0x4eb492[_0x36b1('0xdc')](_0xff3fa8);}})['then'](function(_0x472087){if(_0x472087){_0x12dbff=_0x472087[_0x36b1('0x5d')];if(!_0x16071c[_0x36b1('0x46')][_0x36b1('0xd0')](_0x36b1('0xd1'))){_0xff3fa8['limit']=qs['limit'](_0x16071c[_0x36b1('0x46')][_0x36b1('0x25')]);_0xff3fa8['offset']=qs[_0x36b1('0x28')](_0x16071c['query']['offset']);}return _0x4eb492[_0x36b1('0xdc')](_0xff3fa8);}})[_0x36b1('0x17')](function(_0x4bd947){if(_0x4bd947){return _0x4bd947?{'count':_0x12dbff,'rows':_0x4bd947}:null;}})[_0x36b1('0x17')](respondWithResult(_0x4fd535,null))[_0x36b1('0x20')](handleError(_0x4fd535,null));};exports['getOpenchannelInteractions']=function(_0x492dbc,_0x11243a){var _0x4cc4ca={};var _0x2621e0={};var _0x441ab6;var _0x8caae6;return db['User']['findOne']({'where':{'id':_0x492dbc[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x11243a,null))[_0x36b1('0x17')](function(_0xaf8f7){if(_0xaf8f7){_0x441ab6=_0xaf8f7;_0x2621e0['model']=_[_0x36b1('0x57')](db[_0x36b1('0xde')][_0x36b1('0x3f')]);_0x2621e0[_0x36b1('0x46')]=_['keys'](_0x492dbc[_0x36b1('0x46')]);_0x2621e0['filters']=_[_0x36b1('0x5a')](_0x2621e0[_0x36b1('0x5b')],_0x2621e0['query']);_0x4cc4ca['attributes']=_['intersection'](_0x2621e0[_0x36b1('0x5b')],qs[_0x36b1('0x5c')](_0x492dbc[_0x36b1('0x46')][_0x36b1('0x5c')]));_0x4cc4ca[_0x36b1('0x4b')]=_0x4cc4ca['attributes']['length']?_0x4cc4ca[_0x36b1('0x4b')]:_0x2621e0[_0x36b1('0x5b')];_0x4cc4ca[_0x36b1('0xd3')]=qs[_0x36b1('0xc8')](_0x492dbc['query'][_0x36b1('0xc8')]);_0x4cc4ca[_0x36b1('0x44')]=qs['filters'](_[_0x36b1('0xd4')](_0x492dbc[_0x36b1('0x46')],_0x2621e0[_0x36b1('0x59')]));if(_0x492dbc[_0x36b1('0x46')][_0x36b1('0x35')]){_0x4cc4ca['where']=_['merge'](_0x4cc4ca[_0x36b1('0x44')],{'$or':_['map'](_0x4cc4ca[_0x36b1('0x4b')],function(_0x3e52fa){var _0x25a202={};_0x25a202[_0x3e52fa]={'$like':'%'+_0x492dbc[_0x36b1('0x46')]['filter']+'%'};return _0x25a202;})});}_0x4cc4ca=_[_0x36b1('0xc9')]({},_0x4cc4ca,_0x492dbc[_0x36b1('0x5f')]);return _0x441ab6[_0x36b1('0xdf')](_0x4cc4ca);}})[_0x36b1('0x17')](function(_0x4e82d7){if(_0x4e82d7){_0x8caae6=_0x4e82d7[_0x36b1('0x5d')];if(!_0x492dbc[_0x36b1('0x46')][_0x36b1('0xd0')](_0x36b1('0xd1'))){_0x4cc4ca[_0x36b1('0x25')]=qs[_0x36b1('0x25')](_0x492dbc[_0x36b1('0x46')][_0x36b1('0x25')]);_0x4cc4ca['offset']=qs[_0x36b1('0x28')](_0x492dbc['query']['offset']);}return _0x441ab6[_0x36b1('0xdf')](_0x4cc4ca);}})[_0x36b1('0x17')](function(_0x2e09c2){if(_0x2e09c2){return _0x2e09c2?{'count':_0x8caae6,'rows':_0x2e09c2}:null;}})['then'](respondWithResult(_0x11243a,null))[_0x36b1('0x20')](handleError(_0x11243a,null));};exports[_0x36b1('0xe0')]=function(_0x23b1a5,_0x2174e8){var _0x430051={'raw':!![],'where':{}};var _0x4d68af={};var _0x391599={'count':0x0,'rows':[]};return db[_0x36b1('0x45')][_0x36b1('0x99')]({'where':{'id':_0x23b1a5[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x2174e8,null))[_0x36b1('0x17')](function(_0x2c152b){if(_0x2c152b){_0x4d68af['model']=_[_0x36b1('0x57')](db[_0x36b1('0xe1')][_0x36b1('0x3f')]);_0x4d68af[_0x36b1('0x46')]=_[_0x36b1('0x57')](_0x23b1a5['query']);_0x4d68af[_0x36b1('0x59')]=_[_0x36b1('0x5a')](_0x4d68af[_0x36b1('0x5b')],_0x4d68af[_0x36b1('0x46')]);_0x430051['attributes']=_[_0x36b1('0x5a')](_0x4d68af[_0x36b1('0x5b')],qs[_0x36b1('0x5c')](_0x23b1a5[_0x36b1('0x46')]['fields']));_0x430051['attributes']=_0x430051['attributes'][_0x36b1('0x5d')]?_0x430051[_0x36b1('0x4b')]:_0x4d68af[_0x36b1('0x5b')];if(!_0x23b1a5[_0x36b1('0x46')]['hasOwnProperty'](_0x36b1('0xd1'))){_0x430051[_0x36b1('0x25')]=qs[_0x36b1('0x25')](_0x23b1a5[_0x36b1('0x46')]['limit']);_0x430051['offset']=qs['offset'](_0x23b1a5['query'][_0x36b1('0x28')]);}_0x430051[_0x36b1('0xd3')]=qs[_0x36b1('0xc8')](_0x23b1a5['query'][_0x36b1('0xc8')]);_0x430051['where']=qs[_0x36b1('0x59')](_[_0x36b1('0xd4')](_0x23b1a5[_0x36b1('0x46')],_0x4d68af[_0x36b1('0x59')]));_0x430051['where'][_0x36b1('0xdb')]=_0x2c152b['id'];if(_0x23b1a5[_0x36b1('0x46')][_0x36b1('0x35')]){_0x430051[_0x36b1('0x44')]=_['merge'](_0x430051[_0x36b1('0x44')],{'$or':_[_0x36b1('0x37')](_0x430051[_0x36b1('0x4b')],function(_0x48e8ec){var _0x1b408a={};_0x1b408a[_0x48e8ec]={'$like':'%'+_0x23b1a5[_0x36b1('0x46')][_0x36b1('0x35')]+'%'};return _0x1b408a;})});}_0x430051=_['merge']({},_0x430051,_0x23b1a5[_0x36b1('0x5f')]);return db[_0x36b1('0xe1')]['count']({'where':_0x430051[_0x36b1('0x44')]})['then'](function(_0x4acb29){_0x391599['count']=_0x4acb29;if(_0x23b1a5['query']['includeAll']){_0x430051['include']=[{'all':!![]}];}return db[_0x36b1('0xe1')]['findAll'](_0x430051);})[_0x36b1('0x17')](function(_0x33cbb6){_0x391599[_0x36b1('0x4d')]=_0x33cbb6;return _0x391599;});}})['then'](respondWithFilteredResult(_0x2174e8,_0x430051))['catch'](handleError(_0x2174e8,null));};exports['getSmsInteractions']=function(_0x9da452,_0x22bcd7){var _0x237af1={};var _0x2bed49={};var _0x45711b;var _0x2f4548;return db[_0x36b1('0x45')][_0x36b1('0x99')]({'where':{'id':_0x9da452['params']['id']}})['then'](handleEntityNotFound(_0x22bcd7,null))[_0x36b1('0x17')](function(_0xda670d){if(_0xda670d){_0x45711b=_0xda670d;_0x2bed49[_0x36b1('0x5b')]=_[_0x36b1('0x57')](db['SmsInteraction'][_0x36b1('0x3f')]);_0x2bed49[_0x36b1('0x46')]=_[_0x36b1('0x57')](_0x9da452[_0x36b1('0x46')]);_0x2bed49[_0x36b1('0x59')]=_['intersection'](_0x2bed49[_0x36b1('0x5b')],_0x2bed49[_0x36b1('0x46')]);_0x237af1[_0x36b1('0x4b')]=_[_0x36b1('0x5a')](_0x2bed49[_0x36b1('0x5b')],qs[_0x36b1('0x5c')](_0x9da452[_0x36b1('0x46')]['fields']));_0x237af1[_0x36b1('0x4b')]=_0x237af1[_0x36b1('0x4b')]['length']?_0x237af1[_0x36b1('0x4b')]:_0x2bed49['model'];_0x237af1['order']=qs[_0x36b1('0xc8')](_0x9da452[_0x36b1('0x46')][_0x36b1('0xc8')]);_0x237af1[_0x36b1('0x44')]=qs['filters'](_['pick'](_0x9da452[_0x36b1('0x46')],_0x2bed49['filters']));if(_0x9da452[_0x36b1('0x46')]['filter']){_0x237af1[_0x36b1('0x44')]=_[_0x36b1('0xc9')](_0x237af1[_0x36b1('0x44')],{'$or':_[_0x36b1('0x37')](_0x237af1[_0x36b1('0x4b')],function(_0x355fdc){var _0x4eaf8c={};_0x4eaf8c[_0x355fdc]={'$like':'%'+_0x9da452['query'][_0x36b1('0x35')]+'%'};return _0x4eaf8c;})});}_0x237af1=_[_0x36b1('0xc9')]({},_0x237af1,_0x9da452[_0x36b1('0x5f')]);return _0x45711b[_0x36b1('0xe2')](_0x237af1);}})[_0x36b1('0x17')](function(_0x2bf8ea){if(_0x2bf8ea){_0x2f4548=_0x2bf8ea[_0x36b1('0x5d')];if(!_0x9da452[_0x36b1('0x46')][_0x36b1('0xd0')](_0x36b1('0xd1'))){_0x237af1['limit']=qs[_0x36b1('0x25')](_0x9da452['query'][_0x36b1('0x25')]);_0x237af1[_0x36b1('0x28')]=qs[_0x36b1('0x28')](_0x9da452[_0x36b1('0x46')][_0x36b1('0x28')]);}return _0x45711b[_0x36b1('0xe2')](_0x237af1);}})['then'](function(_0x415af0){if(_0x415af0){return _0x415af0?{'count':_0x2f4548,'rows':_0x415af0}:null;}})['then'](respondWithResult(_0x22bcd7,null))[_0x36b1('0x20')](handleError(_0x22bcd7,null));};exports[_0x36b1('0xe3')]=function(_0x4130bd,_0xc112d8){var _0x2063e9={};var _0x29ac97={};var _0x28d9be;var _0x464fe7;return db[_0x36b1('0x45')]['findOne']({'where':{'id':_0x4130bd[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0xc112d8,null))['then'](function(_0x22b4fb){if(_0x22b4fb){_0x28d9be=_0x22b4fb;_0x29ac97[_0x36b1('0x5b')]=_[_0x36b1('0x57')](db[_0x36b1('0xe4')][_0x36b1('0x3f')]);_0x29ac97[_0x36b1('0x46')]=_[_0x36b1('0x57')](_0x4130bd[_0x36b1('0x46')]);_0x29ac97[_0x36b1('0x59')]=_[_0x36b1('0x5a')](_0x29ac97['model'],_0x29ac97[_0x36b1('0x46')]);_0x2063e9['attributes']=_[_0x36b1('0x5a')](_0x29ac97[_0x36b1('0x5b')],qs[_0x36b1('0x5c')](_0x4130bd[_0x36b1('0x46')]['fields']));_0x2063e9[_0x36b1('0x4b')]=_0x2063e9[_0x36b1('0x4b')][_0x36b1('0x5d')]?_0x2063e9[_0x36b1('0x4b')]:_0x29ac97[_0x36b1('0x5b')];_0x2063e9['order']=qs[_0x36b1('0xc8')](_0x4130bd[_0x36b1('0x46')][_0x36b1('0xc8')]);_0x2063e9[_0x36b1('0x44')]=qs[_0x36b1('0x59')](_['pick'](_0x4130bd[_0x36b1('0x46')],_0x29ac97[_0x36b1('0x59')]));if(_0x4130bd['query'][_0x36b1('0x35')]){_0x2063e9[_0x36b1('0x44')]=_[_0x36b1('0xc9')](_0x2063e9[_0x36b1('0x44')],{'$or':_[_0x36b1('0x37')](_0x2063e9['attributes'],function(_0x3d3fdd){var _0x3bd13a={};_0x3bd13a[_0x3d3fdd]={'$like':'%'+_0x4130bd[_0x36b1('0x46')][_0x36b1('0x35')]+'%'};return _0x3bd13a;})});}_0x2063e9=_[_0x36b1('0xc9')]({},_0x2063e9,_0x4130bd[_0x36b1('0x5f')]);return _0x28d9be[_0x36b1('0xe3')](_0x2063e9);}})[_0x36b1('0x17')](function(_0xc8a83){if(_0xc8a83){_0x464fe7=_0xc8a83['length'];if(!_0x4130bd['query']['hasOwnProperty'](_0x36b1('0xd1'))){_0x2063e9[_0x36b1('0x25')]=qs[_0x36b1('0x25')](_0x4130bd[_0x36b1('0x46')][_0x36b1('0x25')]);_0x2063e9[_0x36b1('0x28')]=qs[_0x36b1('0x28')](_0x4130bd[_0x36b1('0x46')][_0x36b1('0x28')]);}return _0x28d9be[_0x36b1('0xe3')](_0x2063e9);}})[_0x36b1('0x17')](function(_0x1c9307){if(_0x1c9307){return _0x1c9307?{'count':_0x464fe7,'rows':_0x1c9307}:null;}})[_0x36b1('0x17')](respondWithResult(_0xc112d8,null))[_0x36b1('0x20')](handleError(_0xc112d8,null));};exports[_0x36b1('0xe5')]=function(_0x5ded3c,_0x20648e){var _0x4ef2ba={};var _0x46fa7e={};var _0x1709b3;var _0x3c1964;return db[_0x36b1('0x45')][_0x36b1('0x99')]({'where':{'id':_0x5ded3c['params']['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x20648e,null))[_0x36b1('0x17')](function(_0x563dc7){if(_0x563dc7){_0x1709b3=_0x563dc7;_0x46fa7e[_0x36b1('0x5b')]=_['keys'](db[_0x36b1('0xe6')][_0x36b1('0x3f')]);_0x46fa7e[_0x36b1('0x46')]=_['keys'](_0x5ded3c[_0x36b1('0x46')]);_0x46fa7e[_0x36b1('0x59')]=_[_0x36b1('0x5a')](_0x46fa7e['model'],_0x46fa7e[_0x36b1('0x46')]);_0x4ef2ba['attributes']=_[_0x36b1('0x5a')](_0x46fa7e['model'],qs[_0x36b1('0x5c')](_0x5ded3c['query'][_0x36b1('0x5c')]));_0x4ef2ba[_0x36b1('0x4b')]=_0x4ef2ba[_0x36b1('0x4b')][_0x36b1('0x5d')]?_0x4ef2ba[_0x36b1('0x4b')]:_0x46fa7e[_0x36b1('0x5b')];_0x4ef2ba[_0x36b1('0xd3')]=qs['sort'](_0x5ded3c[_0x36b1('0x46')][_0x36b1('0xc8')]);_0x4ef2ba[_0x36b1('0x44')]=qs[_0x36b1('0x59')](_[_0x36b1('0xd4')](_0x5ded3c[_0x36b1('0x46')],_0x46fa7e[_0x36b1('0x59')]));if(_0x5ded3c[_0x36b1('0x46')][_0x36b1('0x35')]){_0x4ef2ba[_0x36b1('0x44')]=_[_0x36b1('0xc9')](_0x4ef2ba[_0x36b1('0x44')],{'$or':_['map'](_0x4ef2ba['attributes'],function(_0x4f16c8){var _0x403096={};_0x403096[_0x4f16c8]={'$like':'%'+_0x5ded3c[_0x36b1('0x46')]['filter']+'%'};return _0x403096;})});}_0x4ef2ba=_['merge']({},_0x4ef2ba,_0x5ded3c[_0x36b1('0x5f')]);return _0x1709b3[_0x36b1('0xe5')](_0x4ef2ba);}})[_0x36b1('0x17')](function(_0x5e8224){if(_0x5e8224){_0x3c1964=_0x5e8224['length'];if(!_0x5ded3c['query'][_0x36b1('0xd0')](_0x36b1('0xd1'))){_0x4ef2ba[_0x36b1('0x25')]=qs[_0x36b1('0x25')](_0x5ded3c[_0x36b1('0x46')][_0x36b1('0x25')]);_0x4ef2ba[_0x36b1('0x28')]=qs['offset'](_0x5ded3c[_0x36b1('0x46')][_0x36b1('0x28')]);}return _0x1709b3[_0x36b1('0xe5')](_0x4ef2ba);}})[_0x36b1('0x17')](function(_0x2482d9){if(_0x2482d9){return _0x2482d9?{'count':_0x3c1964,'rows':_0x2482d9}:null;}})[_0x36b1('0x17')](respondWithResult(_0x20648e,null))[_0x36b1('0x20')](handleError(_0x20648e,null));};exports[_0x36b1('0xe7')]=function(_0x53616b,_0x5c569a,_0x5c8742){var _0x4c4abb;var _0x41b860;var _0x1ed8d1;var _0x520589=!_['isNil'](_0x53616b[_0x36b1('0x55')]['id'])?_0x53616b['params']['id']:!_[_0x36b1('0x6d')](_0x53616b['user']['id'])?_0x53616b[_0x36b1('0x31')]['id']:null;return db[_0x36b1('0x45')]['find']({'where':{'id':_0x520589,'role':{'$or':['admin',_0x36b1('0x31'),'agent']}},'attributes':['id',_0x36b1('0x3b'),'phone',_0x36b1('0xe8'),_0x36b1('0x3a'),_0x36b1('0x67'),_0x36b1('0xa0')]})[_0x36b1('0x17')](function(_0x3e2479){if(_0x3e2479){if(_0x3e2479[_0x36b1('0x3a')]===_0x36b1('0x33')){_0x4c4abb=_0x3e2479;if(_0x53616b[_0x36b1('0x63')][_0x36b1('0xa2')]){_0x1ed8d1=util[_0x36b1('0xae')](_0x36b1('0xe9'),_0x4c4abb[_0x53616b[_0x36b1('0x63')][_0x36b1('0xa2')]]);}else if(_0x53616b[_0x36b1('0x63')][_0x36b1('0xea')]){_0x1ed8d1=util['format'](_0x36b1('0xaf'),_0x53616b['body'][_0x36b1('0xea')]);}else{_0x1ed8d1=util['format'](_0x36b1('0xaf'),_0x4c4abb[_0x36b1('0x3b')]);}socket['to'](util[_0x36b1('0xae')]('user:%s',_0x4c4abb[_0x36b1('0x3b')]))['emit'](_0x36b1('0xeb'),{'user':{'id':_0x4c4abb['id'],'name':_0x4c4abb['name']},'ip':_0x53616b[_0x36b1('0xec')]['x-forwarded-for']||_0x53616b['connection'][_0x36b1('0xed')]||_0x53616b['socket'][_0x36b1('0xed')]||_0x53616b[_0x36b1('0xee')][_0x36b1('0xef')][_0x36b1('0xed')]});return db[_0x36b1('0xb6')][_0x36b1('0x2d')]({'where':{'membername':_0x4c4abb[_0x36b1('0x3b')]},'individualHooks':!![]});}}else{throw new db[(_0x36b1('0x93'))][(_0x36b1('0x94'))](_0x36b1('0xf0'));}})[_0x36b1('0x17')](function(){if(_0x4c4abb){return _0x4c4abb[_0x36b1('0xf1')]({'raw':!![]});}})[_0x36b1('0x17')](function(_0x4ce645){if(_0x4c4abb){var _0x4a9f46=[];if(_0x4ce645){_0x41b860=_0x4ce645;if(_0x41b860[_0x36b1('0x5d')]){for(var _0x5ae393=0x0;_0x5ae393<_0x41b860[_0x36b1('0x5d')];_0x5ae393++){_0x4a9f46[_0x36b1('0x4f')]({'membername':_0x4c4abb[_0x36b1('0x3b')],'UserId':_0x4c4abb['id'],'queue_name':_0x41b860[_0x5ae393][_0x36b1('0x3b')],'VoiceQueueId':_0x41b860[_0x5ae393]['id'],'interface':_0x1ed8d1,'paused':_0x4c4abb[_0x36b1('0xa0')]||![],'penalty':_0x41b860[_0x5ae393]['UserVoiceQueue.penalty']||0x0});}return BPromise['each'](_0x4a9f46,function(_0x629e68){return db[_0x36b1('0xb6')]['upsert'](_0x629e68);});}}}})[_0x36b1('0x17')](function(){if(_0x4c4abb){return db['MemberReport'][_0x36b1('0x4c')]({'where':{'membername':_0x4c4abb[_0x36b1('0x3b')],'exitAt':null}});}})['then'](function(_0x11fe69){if(_0x4c4abb){var _0x368b08=[];_0x11fe69[_0x36b1('0xf2')](function(_0x4ebe65){_0x368b08['push'](_0x4ebe65[_0x36b1('0x2a')]({'exitAt':moment()[_0x36b1('0xae')](_0x36b1('0xf3'))}));});return BPromise[_0x36b1('0x62')](_0x368b08);}})[_0x36b1('0x17')](function(){if(_0x4c4abb){var _0x526aca=[];var _0x5eaf98=[];var _0x5f2fed=utils['getChannels']();var _0x285d58={'membername':_0x4c4abb['name'],'interface':_0x1ed8d1,'enterAt':moment()[_0x36b1('0xae')](_0x36b1('0xf3')),'role':_0x4c4abb[_0x36b1('0x3a')],'internal':_0x4c4abb[_0x36b1('0x67')]};_0x5f2fed[_0x36b1('0xf2')](function(_0x1161fd){_0x526aca[_0x36b1('0x4f')](_[_0x36b1('0xc9')]({'channel':_0x1161fd,'type':_0x36b1('0xf4'),'data1':_0x53616b[_0x36b1('0x63')]['device'],'data2':_0x1ed8d1},_0x285d58));if(_0x4c4abb['loginInPause']){_0x5eaf98['push'](_[_0x36b1('0xc9')]({'channel':_0x1161fd,'type':_0x36b1('0xf5'),'data1':'LOGININPAUSE'},_0x285d58));}});return db[_0x36b1('0xf6')][_0x36b1('0x8d')](_0x526aca['concat'](_0x5eaf98),{'individualHooks':!![]});}})['then'](function(){if(_0x4c4abb){return _0x4c4abb[_0x36b1('0x2a')]({'online':!![],'lastLoginAt':moment()['format'](_0x36b1('0xf3')),'voicePause':_0x4c4abb[_0x36b1('0xa0')]||![],'mailPause':_0x4c4abb['loginInPause']||![],'chatPause':_0x4c4abb['loginInPause']||![],'faxPause':_0x4c4abb['loginInPause']||![],'smsPause':_0x4c4abb[_0x36b1('0xa0')]||![],'openchannelPause':_0x4c4abb[_0x36b1('0xa0')]||![],'whatsappPause':_0x4c4abb[_0x36b1('0xa0')]||![],'pauseType':_0x4c4abb[_0x36b1('0xa0')]?'LOGININPAUSE':null,'interface':_0x1ed8d1,'lastPauseAt':moment()[_0x36b1('0xae')](_0x36b1('0xf3'))});}})[_0x36b1('0x17')](function(_0x5a9826){if(_0x53616b[_0x36b1('0xf7')]){return _0x5c8742();}else{return BPromise[_0x36b1('0xf8')](_0x5a9826)['then'](respondWithResult(_0x5c569a,null));}})[_0x36b1('0x20')](handleError(_0x5c569a,null));};exports['logout']=function(_0x31a084,_0x4946a2){var _0x3f26e0;return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x31a084['params']['id'],'role':_0x36b1('0x33')},'attributes':['id',_0x36b1('0x3b'),_0x36b1('0x3a')]})[_0x36b1('0x17')](handleEntityNotFound(_0x4946a2,null))[_0x36b1('0x17')](function(_0x469219){if(_0x469219){_0x3f26e0=_0x469219;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x3f26e0['name']},'individualHooks':!![]});}})[_0x36b1('0x17')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x3f26e0['name'],'exitAt':null}});})[_0x36b1('0x17')](function(_0x381967){var _0x4a4629=[];_0x381967['forEach'](function(_0x3da4cb){_0x4a4629[_0x36b1('0x4f')](_0x3da4cb[_0x36b1('0x2a')]({'exitAt':moment()[_0x36b1('0xae')](_0x36b1('0xf3'))}));});return BPromise[_0x36b1('0x62')](_0x4a4629);})[_0x36b1('0x17')](function(){return _0x3f26e0[_0x36b1('0x2a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x4946a2,null))['catch'](handleError(_0x4946a2,null));};exports[_0x36b1('0xf9')]=function(_0x47a21c,_0x1aa35f){var _0x4fd671;return db[_0x36b1('0xb6')]['update']({'paused':0x1},{'where':{'UserId':_0x47a21c[_0x36b1('0x55')]['id']},'individualHooks':!![]})['then'](function(){return db[_0x36b1('0x45')]['find']({'where':{'id':_0x47a21c[_0x36b1('0x55')]['id'],'role':'agent'},'attributes':['id',_0x36b1('0x3b'),'role','internal',_0x36b1('0xa2')]});})[_0x36b1('0x17')](handleEntityNotFound(_0x1aa35f,null))[_0x36b1('0x17')](function(_0x1ebab0){if(_0x1ebab0){_0x4fd671=_0x1ebab0;return respondWithRpcPromise(_0x36b1('0xfa'),_0x36b1('0xf9'),{'id':_0x4fd671['id'],'name':_0x4fd671[_0x36b1('0x3b')],'pause':!![]});}})[_0x36b1('0x17')](function(){if(_0x4fd671){return db[_0x36b1('0xf6')][_0x36b1('0x4c')]({'where':{'membername':_0x4fd671[_0x36b1('0x3b')],'type':_0x36b1('0xf5'),'exitAt':null}});}})['then'](function(_0x2f8f42){if(_0x2f8f42[_0x36b1('0x5d')]){var _0x3cebbe=moment()[_0x36b1('0xae')](_0x36b1('0xf3'));for(var _0x416fb9=0x0,_0x29b836=_0x2f8f42[_0x36b1('0x5d')];_0x416fb9<_0x29b836;_0x416fb9++){_0x2f8f42[_0x416fb9][_0x36b1('0xfb')]({'exitAt':_0x3cebbe});}}})[_0x36b1('0x17')](function(){var _0x5161c6=[];var _0x190501=utils[_0x36b1('0xfc')]();_0x190501[_0x36b1('0xf2')](function(_0x347b54){_0x5161c6['push']({'channel':_0x347b54,'membername':_0x4fd671['name'],'interface':_[_0x36b1('0x6d')](_0x4fd671[_0x36b1('0xa2')])?util[_0x36b1('0xae')](_0x36b1('0xaf'),_0x4fd671[_0x36b1('0x3b')]):_0x4fd671[_0x36b1('0xa2')],'type':_0x36b1('0xf5'),'enterAt':moment()[_0x36b1('0xae')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x47a21c[_0x36b1('0x63')][_0x36b1('0x41')]||_0x36b1('0xfd'),'role':_0x4fd671[_0x36b1('0x3a')],'internal':_0x4fd671[_0x36b1('0x67')]});});return db[_0x36b1('0xf6')][_0x36b1('0x8d')](_0x5161c6,{'individualHooks':!![]});})[_0x36b1('0x17')](function(){return _0x4fd671[_0x36b1('0x2a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x47a21c['body'][_0x36b1('0x41')]||_0x36b1('0xfd'),'lastPauseAt':moment()[_0x36b1('0xae')](_0x36b1('0xf3'))});})[_0x36b1('0x17')](respondWithResult(_0x1aa35f,null))[_0x36b1('0x20')](handleError(_0x1aa35f,null));};exports[_0x36b1('0xfe')]=function(_0xd06fab,_0x5c480a){var _0x6a9ff;return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0xd06fab[_0x36b1('0x55')]['id']},'attributes':['id','name','role',_0x36b1('0xa1'),_0x36b1('0xff'),'chatPause','faxPause',_0x36b1('0x100'),_0x36b1('0x101'),_0x36b1('0x102'),'pauseType','lastPauseAt']})['then'](handleEntityNotFound(_0x5c480a,null))[_0x36b1('0x17')](function(_0x22f305){if(_0x22f305){_0x6a9ff=_0x22f305;if(_0xd06fab['body'][_0x36b1('0x9e')]&&!utils[_0x36b1('0xa3')](_0xd06fab[_0x36b1('0x63')][_0x36b1('0x9e')])){throw new db[(_0x36b1('0x93'))]['ValidationError']('Unknown\x20channel');}switch(_0xd06fab[_0x36b1('0x63')][_0x36b1('0x9e')]){case _0x36b1('0xad'):return respondWithRpcPromise(_0x36b1('0xfa'),_0x36b1('0xfe'),{'id':_0x6a9ff['id'],'name':_0x6a9ff[_0x36b1('0x3b')],'pause':![]})[_0x36b1('0x17')](function(){return db[_0x36b1('0xb6')][_0x36b1('0x2a')]({'paused':0x0},{'where':{'UserId':_0x6a9ff['id']},'individualHooks':!![]});})[_0x36b1('0x17')](function(){return db[_0x36b1('0xf6')][_0x36b1('0x60')]({'where':{'channel':_0xd06fab[_0x36b1('0x63')][_0x36b1('0x9e')],'membername':_0x6a9ff[_0x36b1('0x3b')],'type':_0x36b1('0xf5'),'exitAt':null}});})[_0x36b1('0x17')](function(_0xfdcfc5){if(_0xfdcfc5){return _0xfdcfc5[_0x36b1('0x2a')]({'exitAt':moment()[_0x36b1('0xae')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x36b1('0x103')},{'individualHooks':!![]});}return null;})[_0x36b1('0x17')](function(){return _0x6a9ff[_0x36b1('0x2a')]({'voicePause':![]});});case _0x36b1('0x104'):case _0x36b1('0x50'):case _0x36b1('0x52'):case _0x36b1('0xbe'):case _0x36b1('0x53'):case _0x36b1('0x61'):return db['MemberReport']['find']({'where':{'channel':_0xd06fab[_0x36b1('0x63')][_0x36b1('0x9e')],'membername':_0x6a9ff[_0x36b1('0x3b')],'type':_0x36b1('0xf5'),'exitAt':null}})[_0x36b1('0x17')](function(_0x3bd300){if(_0x3bd300){return _0x3bd300[_0x36b1('0x2a')]({'exitAt':moment()[_0x36b1('0xae')](_0x36b1('0xf3')),'data2':_0x36b1('0x103')},{'individualHooks':!![]});}return null;})[_0x36b1('0x17')](function(){var _0x7d67a5={};_['set'](_0x7d67a5,util[_0x36b1('0xae')]('%s%s',_0xd06fab[_0x36b1('0x63')][_0x36b1('0x9e')],_0x36b1('0x105')),![]);return _0x6a9ff[_0x36b1('0x2a')](_0x7d67a5);});default:return respondWithRpcPromise('QueuePause',_0x36b1('0xfe'),{'id':_0x6a9ff['id'],'name':_0x6a9ff['name'],'pause':![]})[_0x36b1('0x17')](function(){return db['UserVoiceQueueRt'][_0x36b1('0x2a')]({'paused':0x0},{'where':{'UserId':_0x6a9ff['id']}});})[_0x36b1('0x17')](function(){return db[_0x36b1('0xf6')]['findAll']({'where':{'membername':_0x6a9ff[_0x36b1('0x3b')],'type':_0x36b1('0xf5'),'exitAt':null}});})[_0x36b1('0x17')](function(_0x33363e){var _0x5bd821=[];_0x33363e[_0x36b1('0xf2')](function(_0x31bbb3){_0x5bd821[_0x36b1('0x4f')](_0x31bbb3[_0x36b1('0x2a')]({'exitAt':moment()['format'](_0x36b1('0xf3')),'data2':_0x36b1('0x103')}));});return BPromise['all'](_0x5bd821);})[_0x36b1('0x17')](function(){return _0x6a9ff[_0x36b1('0x2a')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x36b1('0x17')](respondWithResult(_0x5c480a,null))[_0x36b1('0x20')](handleError(_0x5c480a,null));};exports['getTeams']=function(_0xa759b3,_0xb9462d){var _0x3ca264={};var _0xdff506={};var _0x684060;var _0x55abb1;return db['User'][_0x36b1('0x99')]({'where':{'id':_0xa759b3[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0xb9462d,null))['then'](function(_0x26d9c4){if(_0x26d9c4){_0x684060=_0x26d9c4;_0xdff506['model']=_[_0x36b1('0x57')](db[_0x36b1('0x106')]['rawAttributes']);_0xdff506[_0x36b1('0x46')]=_[_0x36b1('0x57')](_0xa759b3[_0x36b1('0x46')]);_0xdff506['filters']=_['intersection'](_0xdff506[_0x36b1('0x5b')],_0xdff506['query']);_0x3ca264[_0x36b1('0x4b')]=_['intersection'](_0xdff506[_0x36b1('0x5b')],qs[_0x36b1('0x5c')](_0xa759b3[_0x36b1('0x46')][_0x36b1('0x5c')]));_0x3ca264[_0x36b1('0x4b')]=_0x3ca264[_0x36b1('0x4b')][_0x36b1('0x5d')]?_0x3ca264[_0x36b1('0x4b')]:_0xdff506['model'];_0x3ca264['order']=qs[_0x36b1('0xc8')](_0xa759b3[_0x36b1('0x46')][_0x36b1('0xc8')]);_0x3ca264[_0x36b1('0x44')]=qs[_0x36b1('0x59')](_[_0x36b1('0xd4')](_0xa759b3['query'],_0xdff506[_0x36b1('0x59')]));if(_0xa759b3['query']['filter']){_0x3ca264[_0x36b1('0x44')]=_[_0x36b1('0xc9')](_0x3ca264[_0x36b1('0x44')],{'$or':_[_0x36b1('0x37')](_0x3ca264['attributes'],function(_0x5d058b){var _0x4a8a40={};_0x4a8a40[_0x5d058b]={'$like':'%'+_0xa759b3[_0x36b1('0x46')][_0x36b1('0x35')]+'%'};return _0x4a8a40;})});}_0x3ca264=_[_0x36b1('0xc9')]({},_0x3ca264,_0xa759b3['options']);return _0x684060['getTeams'](_0x3ca264);}})[_0x36b1('0x17')](function(_0xa9c47b){if(_0xa9c47b){_0x55abb1=_0xa9c47b['length'];if(!_0xa759b3[_0x36b1('0x46')]['hasOwnProperty'](_0x36b1('0xd1'))){_0x3ca264[_0x36b1('0x25')]=qs[_0x36b1('0x25')](_0xa759b3['query']['limit']);_0x3ca264[_0x36b1('0x28')]=qs[_0x36b1('0x28')](_0xa759b3[_0x36b1('0x46')]['offset']);}return _0x684060[_0x36b1('0x107')](_0x3ca264);}})[_0x36b1('0x17')](function(_0x2c2cf0){if(_0x2c2cf0){return _0x2c2cf0?{'count':_0x55abb1,'rows':_0x2c2cf0}:null;}})['then'](respondWithResult(_0xb9462d,null))[_0x36b1('0x20')](handleError(_0xb9462d,null));};exports[_0x36b1('0x108')]=function(_0x508075,_0x1ccbfa){var _0x95f78d=_0x508075['params']['id'];var _0x17b57c=_0x508075[_0x36b1('0x63')]?_0x508075[_0x36b1('0x63')][_0x36b1('0x66')]:null;var _0x4735ad=[];return Promise[_0x36b1('0xf8')]()[_0x36b1('0x17')](function(){if(!_0x17b57c)throw new APIBadRequestError(_0x36b1('0x109'));})[_0x36b1('0x17')](function(){return db[_0x36b1('0x45')][_0x36b1('0x99')]({'where':{'id':_0x95f78d}});})['then'](function(_0x153750){if(!_0x153750)throw new APINotFoundError(util[_0x36b1('0xae')](_0x36b1('0x10a'),_0x508075[_0x36b1('0x55')]['id']));return db[_0x36b1('0x6f')][_0x36b1('0x10b')](function(_0x51d3ef){return _0x153750[_0x36b1('0x108')](_0x17b57c,{'transaction':_0x51d3ef})[_0x36b1('0x17')](function(){return db[_0x36b1('0x106')]['findAll']({'where':{'id':{'$in':_0x17b57c}}});})['then'](function(_0x229037){var _0x1a0f3a=_['map'](_0x229037,function(_0x190068){return _0x190068[_0x36b1('0x10c')]();});return Promise[_0x36b1('0x62')](_0x1a0f3a);})['then'](function(_0x294558){_0x4735ad=_[_0x36b1('0x10d')](_0x294558);var _0x4bc845=_['map'](_0x4735ad,function(_0x4086d1){return _0x4086d1[_0x36b1('0x10e')](_0x153750['id'],{'transaction':_0x51d3ef});});return Promise[_0x36b1('0x62')](_0x4bc845);})[_0x36b1('0x17')](function(){if(!_0x153750[_0x36b1('0x9f')])return;var _0xe208d6=_[_0x36b1('0x35')](_0x4735ad,function(_0x511330){return _0x511330[_0x36b1('0x10f')](_0x36b1('0x9e'))===_0x36b1('0x110');});var _0xbb2b6f=_[_0x36b1('0x37')](_0xe208d6,function(_0xcd997c){return db['UserVoiceQueueRt'][_0x36b1('0xb1')]({'membername':_0x153750[_0x36b1('0x3b')],'UserId':_0x153750['id'],'queue_name':_0xcd997c[_0x36b1('0x3b')],'VoiceQueueId':_0xcd997c['id'],'interface':_[_0x36b1('0x6d')](_0x153750[_0x36b1('0xa2')])?util[_0x36b1('0xae')](_0x36b1('0xaf'),_0x153750[_0x36b1('0x3b')]):_0x153750[_0x36b1('0xa2')],'paused':_0x153750[_0x36b1('0xa1')]||![],'penalty':_0x153750[_0x36b1('0xa8')]},{'transaction':_0x51d3ef});});return Promise[_0x36b1('0x62')](_0xbb2b6f);})[_0x36b1('0x17')](function(){return db[_0x36b1('0x111')]['findAll']({'where':{'teamId':{'$in':_0x17b57c}}});})[_0x36b1('0x17')](function(_0x3855f6){var _0x4a7f76=_[_0x36b1('0x37')](_0x3855f6,function(_0x4a7fe0){return db[_0x36b1('0x112')]['create']({'UserId':_0x153750['id'],'VoicePrefixId':_0x4a7fe0['VoicePrefixId']},{'transaction':_0x51d3ef});});return Promise[_0x36b1('0x62')](_0x4a7f76);});});})[_0x36b1('0x17')](function(){for(var _0x95f79e=0x0;_0x95f79e<_0x4735ad[_0x36b1('0x5d')];_0x95f79e++){var _0x508da3=_0x4735ad[_0x95f79e]['getDataValue'](_0x36b1('0x9e'));var _0x3f16eb=_0x508da3+_0x36b1('0xaa');socket[_0x36b1('0x2b')]('user'+_0x508da3+_0x36b1('0xab'),{'UserId':_0x95f78d,['queueField']:_0x4735ad[_0x95f79e]['id']});}})[_0x36b1('0x17')](respondWithStatusCode(_0x1ccbfa,null))['catch'](APIHandleError(_0x1ccbfa));};exports[_0x36b1('0x113')]=function(_0x56dbe1,_0x16730e){var _0x32801e=_0x56dbe1[_0x36b1('0x55')]['id'];var _0x12a1ef=null;if(_0x56dbe1['query'][_0x36b1('0x66')]){_0x12a1ef=_[_0x36b1('0xb4')](_0x56dbe1['query'][_0x36b1('0x66')])?_0x56dbe1[_0x36b1('0x46')][_0x36b1('0x66')]:[_0x56dbe1['query'][_0x36b1('0x66')]];}var _0x147a78=[];return Promise[_0x36b1('0xf8')]()[_0x36b1('0x17')](function(){if(!_0x12a1ef)throw new APIBadRequestError(_0x36b1('0x114'));})['then'](function(){return db[_0x36b1('0x45')][_0x36b1('0x99')]({'where':{'id':_0x32801e}});})[_0x36b1('0x17')](function(_0x5a38f1){if(!_0x5a38f1)throw new APINotFoundError(util[_0x36b1('0xae')](_0x36b1('0x10a'),_0x56dbe1['params']['id']));return db[_0x36b1('0x6f')]['transaction'](function(_0x1546c2){return _0x5a38f1[_0x36b1('0x113')](_0x12a1ef,{'transaction':_0x1546c2})['then'](function(){return db[_0x36b1('0x106')][_0x36b1('0x4c')]({'where':{'id':{'$in':_0x12a1ef}}});})[_0x36b1('0x17')](function(_0x37b0b2){var _0x2fe661=_['map'](_0x37b0b2,function(_0x24307a){return _0x24307a['getAssociatedQueues']();});return Promise[_0x36b1('0x62')](_0x2fe661);})[_0x36b1('0x17')](function(_0x39b21a){_0x147a78=_[_0x36b1('0x10d')](_0x39b21a);var _0x5c02c0=_['map'](_0x147a78,function(_0x21b77e){return _0x21b77e[_0x36b1('0x115')](_0x5a38f1['id'],{'transaction':_0x1546c2});});return Promise[_0x36b1('0x62')](_0x5c02c0);})[_0x36b1('0x17')](function(){if(!_0x5a38f1[_0x36b1('0x9f')])return;var _0xe4741a=_[_0x36b1('0x35')](_0x147a78,function(_0x2c9ff0){return _0x2c9ff0['getDataValue']('channel')===_0x36b1('0x110');});var _0x135400=_['map'](_0xe4741a,function(_0x3a49a5){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x3a49a5['id'],'UserId':_0x5a38f1['id']},'transaction':_0x1546c2});});return Promise['all'](_0x135400);})[_0x36b1('0x17')](function(){return db[_0x36b1('0x111')][_0x36b1('0x4c')]({'where':{'teamId':{'$in':_0x12a1ef}}});})[_0x36b1('0x17')](function(_0x17697b){var _0x28e790=_[_0x36b1('0x37')](_0x17697b,function(_0x518d9c){return db[_0x36b1('0x112')][_0x36b1('0x2d')]({'where':{'UserId':_0x5a38f1['id'],'VoicePrefixId':_0x518d9c['VoicePrefixId']}},{'transaction':_0x1546c2});});return Promise['all'](_0x28e790);});});})[_0x36b1('0x17')](function(){for(var _0x5d68e0=0x0;_0x5d68e0<_0x147a78[_0x36b1('0x5d')];_0x5d68e0++){var _0xec582=_0x147a78[_0x5d68e0][_0x36b1('0x10f')](_0x36b1('0x9e'));var _0x3fa6c5=_0xec582+_0x36b1('0xaa');socket[_0x36b1('0x2b')](_0x36b1('0x31')+_0xec582+_0x36b1('0xb5'),{'UserId':_0x32801e,['queueField']:_0x147a78[_0x5d68e0]['id']});}})[_0x36b1('0x17')](respondWithStatusCode(_0x16730e,null))[_0x36b1('0x20')](APIHandleError(_0x16730e));};exports['getLists']=function(_0x156718,_0x40b0de){var _0x57b9e3={};var _0x4c2865={};var _0x953256;var _0x5dd0ac;return db[_0x36b1('0x45')][_0x36b1('0x99')]({'where':{'id':_0x156718[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x40b0de,null))[_0x36b1('0x17')](function(_0x4ececf){if(_0x4ececf){_0x953256=_0x4ececf;_0x4c2865[_0x36b1('0x5b')]=_['keys'](db[_0x36b1('0xcb')][_0x36b1('0x3f')]);_0x4c2865[_0x36b1('0x46')]=_[_0x36b1('0x57')](_0x156718['query']);_0x4c2865[_0x36b1('0x59')]=_['intersection'](_0x4c2865[_0x36b1('0x5b')],_0x4c2865[_0x36b1('0x46')]);_0x57b9e3[_0x36b1('0x4b')]=_[_0x36b1('0x5a')](_0x4c2865[_0x36b1('0x5b')],qs[_0x36b1('0x5c')](_0x156718['query'][_0x36b1('0x5c')]));_0x57b9e3['attributes']=_0x57b9e3['attributes'][_0x36b1('0x5d')]?_0x57b9e3[_0x36b1('0x4b')]:_0x4c2865[_0x36b1('0x5b')];_0x57b9e3[_0x36b1('0xd3')]=qs[_0x36b1('0xc8')](_0x156718[_0x36b1('0x46')][_0x36b1('0xc8')]);_0x57b9e3[_0x36b1('0x44')]=qs[_0x36b1('0x59')](_[_0x36b1('0xd4')](_0x156718[_0x36b1('0x46')],_0x4c2865[_0x36b1('0x59')]));if(_0x156718[_0x36b1('0x46')][_0x36b1('0x35')]){_0x57b9e3[_0x36b1('0x44')]=_[_0x36b1('0xc9')](_0x57b9e3['where'],{'$or':_[_0x36b1('0x37')](_0x57b9e3['attributes'],function(_0x34a7db){var _0x171c98={};_0x171c98[_0x34a7db]={'$like':'%'+_0x156718[_0x36b1('0x46')]['filter']+'%'};return _0x171c98;})});}_0x57b9e3=_[_0x36b1('0xc9')]({},_0x57b9e3,_0x156718[_0x36b1('0x5f')]);return _0x953256[_0x36b1('0x116')](_0x57b9e3);}})[_0x36b1('0x17')](function(_0x331761){if(_0x331761){_0x5dd0ac=_0x331761[_0x36b1('0x5d')];if(!_0x156718[_0x36b1('0x46')][_0x36b1('0xd0')]('nolimit')){_0x57b9e3[_0x36b1('0x25')]=qs[_0x36b1('0x25')](_0x156718[_0x36b1('0x46')][_0x36b1('0x25')]);_0x57b9e3[_0x36b1('0x28')]=qs[_0x36b1('0x28')](_0x156718[_0x36b1('0x46')][_0x36b1('0x28')]);}return _0x953256['getLists'](_0x57b9e3);}})[_0x36b1('0x17')](function(_0x1a3f20){if(_0x1a3f20){return _0x1a3f20?{'count':_0x5dd0ac,'rows':_0x1a3f20}:null;}})[_0x36b1('0x17')](respondWithResult(_0x40b0de,null))['catch'](handleError(_0x40b0de,null));};exports[_0x36b1('0x117')]=function(_0xe0bb65,_0x5b6cde){var _0x8b40cb={};var _0x4f297f={};var _0x40e3e5;return db['User'][_0x36b1('0x99')]({'where':{'id':_0xe0bb65[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x5b6cde,null))[_0x36b1('0x17')](function(_0x81c3ed){if(_0x81c3ed){_0x40e3e5=_0x81c3ed;_0x4f297f[_0x36b1('0x5b')]=_[_0x36b1('0x57')](db[_0x36b1('0x45')][_0x36b1('0x3f')]);_0x4f297f['query']=_[_0x36b1('0x57')](_0xe0bb65[_0x36b1('0x46')]);_0x4f297f[_0x36b1('0x59')]=_[_0x36b1('0x5a')](_0x4f297f[_0x36b1('0x5b')],_0x4f297f[_0x36b1('0x46')]);_0x8b40cb['attributes']=_[_0x36b1('0x5a')](_0x4f297f[_0x36b1('0x5b')],qs[_0x36b1('0x5c')](_0xe0bb65[_0x36b1('0x46')][_0x36b1('0x5c')]));_0x8b40cb['attributes']=_0x8b40cb[_0x36b1('0x4b')][_0x36b1('0x5d')]?_0x8b40cb[_0x36b1('0x4b')]:_0x4f297f[_0x36b1('0x5b')];_0x8b40cb[_0x36b1('0xd3')]=qs[_0x36b1('0xc8')](_0xe0bb65[_0x36b1('0x46')][_0x36b1('0xc8')]);_0x8b40cb[_0x36b1('0x44')]=qs[_0x36b1('0x59')](_[_0x36b1('0xd4')](_0xe0bb65[_0x36b1('0x46')],_0x4f297f[_0x36b1('0x59')]));if(_0xe0bb65['query'][_0x36b1('0x35')]){_0x8b40cb['where']=_['merge'](_0x8b40cb[_0x36b1('0x44')],{'$or':_['map'](_0x8b40cb[_0x36b1('0x4b')],function(_0x50ac67){var _0x3ac002={};_0x3ac002[_0x50ac67]={'$like':'%'+_0xe0bb65['query'][_0x36b1('0x35')]+'%'};return _0x3ac002;})});}_0x8b40cb[_0x36b1('0x5b')]=db[_0x36b1('0x45')];_0x8b40cb['as']=_0x36b1('0x32');_0x8b40cb=_[_0x36b1('0xc9')]({},_0x8b40cb,_0xe0bb65[_0x36b1('0x5f')]);return _0x40e3e5['getVoiceQueues']({'include':[_0x8b40cb]});}})['then'](function(_0x4d5515){if(_0x4d5515){var _0x2352a7={},_0x4f5589=[];for(var _0x3d8337=0x0;_0x3d8337<_0x4d5515[_0x36b1('0x5d')];_0x3d8337+=0x1){for(var _0x34ba95=0x0,_0x5ae7a1;_0x34ba95<_0x4d5515[_0x3d8337][_0x36b1('0x32')]['length'];_0x34ba95+=0x1){_0x5ae7a1=_0x4d5515[_0x3d8337][_0x36b1('0x32')][_0x34ba95][_0x36b1('0x2e')]({'plain':!![]});_0x2352a7[_0x5ae7a1['id']]=_0x5ae7a1;}}_0x2352a7=_[_0x36b1('0x118')](_0x2352a7);for(var _0x2a2687=qs[_0x36b1('0x28')](_0xe0bb65[_0x36b1('0x46')]['offset']);_0x2a2687<_0x2352a7['length']&&_0x4f5589[_0x36b1('0x5d')]<qs['limit'](_0xe0bb65['query']['limit']);_0x2a2687+=0x1){if(_0x2352a7[_0x2a2687]){_0x4f5589['push'](_0x2352a7[_0x2a2687]);}}return{'count':_0x2352a7[_0x36b1('0x5d')],'rows':_0x4f5589};}})[_0x36b1('0x17')](respondWithResult(_0x5b6cde,null))[_0x36b1('0x20')](handleError(_0x5b6cde,null));};exports[_0x36b1('0x2d')]=function(_0x5d4ef9,_0x1af5fa){if(_0x5d4ef9[_0x36b1('0x31')]['id']==_0x5d4ef9[_0x36b1('0x55')]['id']){return _0x1af5fa[_0x36b1('0x22')](0x1f4)[_0x36b1('0x3e')]({'message':'You\x20can\x27t\x20delete\x20yourself'});}return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x5d4ef9[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x1af5fa,null))[_0x36b1('0x17')](removeEntity(_0x1af5fa,null))['catch'](handleError(_0x1af5fa,null));};exports[_0x36b1('0x119')]=function(_0xc41cf2,_0x359fab){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0xc41cf2[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x359fab,null))[_0x36b1('0x17')](function(_0x441bc6){if(_0x441bc6){return _0x441bc6['addChatInteractions'](_0xc41cf2[_0x36b1('0x63')][_0x36b1('0x66')],_[_0x36b1('0x11a')](_0xc41cf2[_0x36b1('0x63')],[_0x36b1('0x66'),'id'])||{})[_0x36b1('0xa9')](function(){for(var _0x2101f1=0x0;_0x2101f1<_0xc41cf2['body']['ids'][_0x36b1('0x5d')];_0x2101f1+=0x1){socket['emit'](_0x36b1('0x11b'),{'ChatInteractionId':Number(_0xc41cf2[_0x36b1('0x63')]['ids'][_0x2101f1]),'UserId':Number(_0xc41cf2['params']['id'])});}return _0xc41cf2[_0x36b1('0x63')]['ids'];});}})[_0x36b1('0x17')](respondWithResult(_0x359fab,null))[_0x36b1('0x20')](handleError(_0x359fab,null));};exports[_0x36b1('0x11c')]=function(_0x352b9b,_0x240bf4){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x352b9b[_0x36b1('0x55')]['id']}})['then'](handleEntityNotFound(_0x240bf4,null))[_0x36b1('0x17')](function(_0xc95272){if(_0xc95272){return _0xc95272[_0x36b1('0x11c')](_0x352b9b['query']['ids'])['then'](function(){if(_[_0x36b1('0xb4')](_0x352b9b['query'][_0x36b1('0x66')])){for(var _0x3aa56b=0x0;_0x3aa56b<_0x352b9b['query']['ids'][_0x36b1('0x5d')];_0x3aa56b+=0x1){socket['emit'](_0x36b1('0x11d'),{'ChatInteractionId':Number(_0x352b9b[_0x36b1('0x46')]['ids'][_0x3aa56b]),'UserId':Number(_0x352b9b[_0x36b1('0x55')]['id'])});}}else{socket[_0x36b1('0x2b')](_0x36b1('0x11d'),{'ChatInteractionId':Number(_0x352b9b[_0x36b1('0x46')][_0x36b1('0x66')]),'UserId':Number(_0x352b9b[_0x36b1('0x55')]['id'])});}});}})[_0x36b1('0x17')](respondWithStatusCode(_0x240bf4,null))[_0x36b1('0x20')](handleError(_0x240bf4,null));};exports[_0x36b1('0x11e')]=function(_0x18233c,_0x165118){return db['User'][_0x36b1('0x60')]({'where':{'id':_0x18233c[_0x36b1('0x55')]['id']}})['then'](handleEntityNotFound(_0x165118,null))['then'](function(_0x36b815){if(_0x36b815){return _0x36b815[_0x36b1('0x11e')](_0x18233c[_0x36b1('0x63')][_0x36b1('0x66')],_[_0x36b1('0x11a')](_0x18233c['body'],['ids','id'])||{})[_0x36b1('0xa9')](function(){for(var _0x24f211=0x0;_0x24f211<_0x18233c['body'][_0x36b1('0x66')][_0x36b1('0x5d')];_0x24f211+=0x1){socket[_0x36b1('0x2b')](_0x36b1('0x11f'),{'MailInteractionId':Number(_0x18233c[_0x36b1('0x63')][_0x36b1('0x66')][_0x24f211]),'UserId':Number(_0x18233c[_0x36b1('0x55')]['id'])});}return _0x18233c[_0x36b1('0x63')]['ids'];});}})['then'](respondWithResult(_0x165118,null))[_0x36b1('0x20')](handleError(_0x165118,null));};exports[_0x36b1('0x120')]=function(_0x1290dd,_0x59e48a){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x1290dd[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x59e48a,null))['then'](function(_0x18bae5){if(_0x18bae5){return _0x18bae5[_0x36b1('0x120')](_0x1290dd[_0x36b1('0x46')][_0x36b1('0x66')])[_0x36b1('0x17')](function(){if(_[_0x36b1('0xb4')](_0x1290dd[_0x36b1('0x46')][_0x36b1('0x66')])){for(var _0x1322f0=0x0;_0x1322f0<_0x1290dd[_0x36b1('0x46')][_0x36b1('0x66')][_0x36b1('0x5d')];_0x1322f0+=0x1){socket[_0x36b1('0x2b')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x1290dd[_0x36b1('0x46')][_0x36b1('0x66')][_0x1322f0]),'UserId':Number(_0x1290dd[_0x36b1('0x55')]['id'])});}}else{socket[_0x36b1('0x2b')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x1290dd['query'][_0x36b1('0x66')]),'UserId':Number(_0x1290dd['params']['id'])});}});}})['then'](respondWithStatusCode(_0x59e48a,null))[_0x36b1('0x20')](handleError(_0x59e48a,null));};exports['addFaxInteractions']=function(_0x59ccd5,_0x1ce530){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x59ccd5['params']['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x1ce530,null))[_0x36b1('0x17')](function(_0x6cc55){if(_0x6cc55){return _0x6cc55[_0x36b1('0x121')](_0x59ccd5['body'][_0x36b1('0x66')],_['omit'](_0x59ccd5[_0x36b1('0x63')],[_0x36b1('0x66'),'id'])||{})[_0x36b1('0xa9')](function(){for(var _0x27b6d0=0x0;_0x27b6d0<_0x59ccd5[_0x36b1('0x63')]['ids']['length'];_0x27b6d0+=0x1){socket['emit']('user_has_fax_interactions:save',{'FaxInteractionId':Number(_0x59ccd5[_0x36b1('0x63')][_0x36b1('0x66')][_0x27b6d0]),'UserId':Number(_0x59ccd5[_0x36b1('0x55')]['id'])});}return _0x59ccd5[_0x36b1('0x63')][_0x36b1('0x66')];});}})['then'](respondWithResult(_0x1ce530,null))[_0x36b1('0x20')](handleError(_0x1ce530,null));};exports['removeFaxInteractions']=function(_0x5a6916,_0x2abf86){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x5a6916[_0x36b1('0x55')]['id']}})['then'](handleEntityNotFound(_0x2abf86,null))['then'](function(_0x4ed37e){if(_0x4ed37e){return _0x4ed37e[_0x36b1('0x122')](_0x5a6916['query'][_0x36b1('0x66')])[_0x36b1('0x17')](function(){if(_[_0x36b1('0xb4')](_0x5a6916[_0x36b1('0x46')][_0x36b1('0x66')])){for(var _0x8709dc=0x0;_0x8709dc<_0x5a6916[_0x36b1('0x46')][_0x36b1('0x66')][_0x36b1('0x5d')];_0x8709dc+=0x1){socket[_0x36b1('0x2b')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x5a6916[_0x36b1('0x46')][_0x36b1('0x66')][_0x8709dc]),'UserId':Number(_0x5a6916[_0x36b1('0x55')]['id'])});}}else{socket[_0x36b1('0x2b')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x5a6916[_0x36b1('0x46')][_0x36b1('0x66')]),'UserId':Number(_0x5a6916[_0x36b1('0x55')]['id'])});}});}})[_0x36b1('0x17')](respondWithStatusCode(_0x2abf86,null))[_0x36b1('0x20')](handleError(_0x2abf86,null));};exports[_0x36b1('0x123')]=function(_0x17144c,_0x37af2f){return db['User'][_0x36b1('0x60')]({'where':{'id':_0x17144c[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x37af2f,null))[_0x36b1('0x17')](function(_0x445ffd){if(_0x445ffd){return _0x445ffd['addSmsInteractions'](_0x17144c[_0x36b1('0x63')][_0x36b1('0x66')],_['omit'](_0x17144c[_0x36b1('0x63')],[_0x36b1('0x66'),'id'])||{})['spread'](function(){for(var _0x71add9=0x0;_0x71add9<_0x17144c[_0x36b1('0x63')]['ids']['length'];_0x71add9+=0x1){socket[_0x36b1('0x2b')](_0x36b1('0x124'),{'SmsInteractionId':Number(_0x17144c[_0x36b1('0x63')][_0x36b1('0x66')][_0x71add9]),'UserId':Number(_0x17144c[_0x36b1('0x55')]['id'])});}return _0x17144c[_0x36b1('0x63')][_0x36b1('0x66')];});}})['then'](respondWithResult(_0x37af2f,null))['catch'](handleError(_0x37af2f,null));};exports['removeSmsInteractions']=function(_0x5f0db3,_0x2f904a){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x5f0db3[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x2f904a,null))[_0x36b1('0x17')](function(_0x56a05a){if(_0x56a05a){return _0x56a05a[_0x36b1('0x125')](_0x5f0db3[_0x36b1('0x46')][_0x36b1('0x66')])[_0x36b1('0x17')](function(){if(_[_0x36b1('0xb4')](_0x5f0db3[_0x36b1('0x46')][_0x36b1('0x66')])){for(var _0x5690fd=0x0;_0x5690fd<_0x5f0db3[_0x36b1('0x46')]['ids']['length'];_0x5690fd+=0x1){socket['emit'](_0x36b1('0x126'),{'SmsInteractionId':Number(_0x5f0db3[_0x36b1('0x46')][_0x36b1('0x66')][_0x5690fd]),'UserId':Number(_0x5f0db3['params']['id'])});}}else{socket[_0x36b1('0x2b')](_0x36b1('0x126'),{'SmsInteractionId':Number(_0x5f0db3[_0x36b1('0x46')]['ids']),'UserId':Number(_0x5f0db3[_0x36b1('0x55')]['id'])});}});}})[_0x36b1('0x17')](respondWithStatusCode(_0x2f904a,null))[_0x36b1('0x20')](handleError(_0x2f904a,null));};exports['addOpenchannelInteractions']=function(_0x5681a0,_0x32c10d){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x5681a0[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x32c10d,null))[_0x36b1('0x17')](function(_0x25c6f7){if(_0x25c6f7){return _0x25c6f7['addOpenchannelInteractions'](_0x5681a0['body'][_0x36b1('0x66')],_[_0x36b1('0x11a')](_0x5681a0['body'],['ids','id'])||{})[_0x36b1('0xa9')](function(){for(var _0xc5f99f=0x0;_0xc5f99f<_0x5681a0['body'][_0x36b1('0x66')][_0x36b1('0x5d')];_0xc5f99f+=0x1){socket[_0x36b1('0x2b')](_0x36b1('0x127'),{'OpenchannelInteractionId':Number(_0x5681a0['body'][_0x36b1('0x66')][_0xc5f99f]),'UserId':Number(_0x5681a0[_0x36b1('0x55')]['id'])});}return _0x5681a0[_0x36b1('0x63')][_0x36b1('0x66')];});}})['then'](respondWithResult(_0x32c10d,null))[_0x36b1('0x20')](handleError(_0x32c10d,null));};exports[_0x36b1('0x128')]=function(_0x240fab,_0x12627c){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x240fab[_0x36b1('0x55')]['id']}})['then'](handleEntityNotFound(_0x12627c,null))[_0x36b1('0x17')](function(_0x2da2bf){if(_0x2da2bf){return _0x2da2bf[_0x36b1('0x128')](_0x240fab[_0x36b1('0x46')][_0x36b1('0x66')])['then'](function(){if(_[_0x36b1('0xb4')](_0x240fab['query'][_0x36b1('0x66')])){for(var _0x4d522c=0x0;_0x4d522c<_0x240fab['query'][_0x36b1('0x66')][_0x36b1('0x5d')];_0x4d522c+=0x1){socket[_0x36b1('0x2b')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x240fab[_0x36b1('0x46')][_0x36b1('0x66')][_0x4d522c]),'UserId':Number(_0x240fab[_0x36b1('0x55')]['id'])});}}else{socket[_0x36b1('0x2b')](_0x36b1('0x129'),{'OpenchannelInteractionId':Number(_0x240fab[_0x36b1('0x46')][_0x36b1('0x66')]),'UserId':Number(_0x240fab['params']['id'])});}});}})[_0x36b1('0x17')](respondWithStatusCode(_0x12627c,null))[_0x36b1('0x20')](handleError(_0x12627c,null));};exports['addWhatsappInteractions']=function(_0x4cdc6c,_0x24e38a){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x4cdc6c[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x24e38a,null))['then'](function(_0x2c89a8){if(_0x2c89a8){return _0x2c89a8[_0x36b1('0x12a')](_0x4cdc6c['body']['ids'],_[_0x36b1('0x11a')](_0x4cdc6c[_0x36b1('0x63')],[_0x36b1('0x66'),'id'])||{})[_0x36b1('0xa9')](function(){for(var _0x350b31=0x0;_0x350b31<_0x4cdc6c[_0x36b1('0x63')][_0x36b1('0x66')][_0x36b1('0x5d')];_0x350b31+=0x1){socket['emit'](_0x36b1('0x12b'),{'WhatsappInteractionId':Number(_0x4cdc6c[_0x36b1('0x63')]['ids'][_0x350b31]),'UserId':Number(_0x4cdc6c[_0x36b1('0x55')]['id'])});}return _0x4cdc6c[_0x36b1('0x63')]['ids'];});}})[_0x36b1('0x17')](respondWithResult(_0x24e38a,null))[_0x36b1('0x20')](handleError(_0x24e38a,null));};exports[_0x36b1('0x12c')]=function(_0x594c2c,_0x5d4a80){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x594c2c['params']['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x5d4a80,null))[_0x36b1('0x17')](function(_0x3056a3){if(_0x3056a3){return _0x3056a3['removeWhatsappInteractions'](_0x594c2c[_0x36b1('0x46')][_0x36b1('0x66')]);}})[_0x36b1('0x17')](respondWithStatusCode(_0x5d4a80,null))[_0x36b1('0x20')](handleError(_0x5d4a80,null));};exports[_0x36b1('0x12d')]=function(_0x9367a6,_0x1f8896){var _0x2539e6={};var _0x179c08={};var _0x41cb88;var _0x21b99c;return db[_0x36b1('0x45')][_0x36b1('0x99')]({'where':{'id':_0x9367a6[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x1f8896,null))['then'](function(_0x3cdfbe){if(_0x3cdfbe){_0x41cb88=_0x3cdfbe;_0x179c08[_0x36b1('0x5b')]=_[_0x36b1('0x57')](db[_0x36b1('0x12e')][_0x36b1('0x3f')]);_0x179c08['query']=_[_0x36b1('0x57')](_0x9367a6[_0x36b1('0x46')]);_0x179c08[_0x36b1('0x59')]=_[_0x36b1('0x5a')](_0x179c08['model'],_0x179c08[_0x36b1('0x46')]);_0x2539e6[_0x36b1('0x4b')]=_[_0x36b1('0x5a')](_0x179c08[_0x36b1('0x5b')],qs[_0x36b1('0x5c')](_0x9367a6[_0x36b1('0x46')][_0x36b1('0x5c')]));_0x2539e6['attributes']=_0x2539e6[_0x36b1('0x4b')][_0x36b1('0x5d')]?_0x2539e6[_0x36b1('0x4b')]:_0x179c08['model'];_0x2539e6[_0x36b1('0xd3')]=qs[_0x36b1('0xc8')](_0x9367a6[_0x36b1('0x46')][_0x36b1('0xc8')]);_0x2539e6[_0x36b1('0x44')]=qs[_0x36b1('0x59')](_['pick'](_0x9367a6[_0x36b1('0x46')],_0x179c08[_0x36b1('0x59')]));if(_0x9367a6[_0x36b1('0x46')][_0x36b1('0x35')]){_0x2539e6[_0x36b1('0x44')]=_[_0x36b1('0xc9')](_0x2539e6[_0x36b1('0x44')],{'$or':_[_0x36b1('0x37')](_0x2539e6[_0x36b1('0x4b')],function(_0x4bd758){var _0x7950ea={};_0x7950ea[_0x4bd758]={'$like':'%'+_0x9367a6[_0x36b1('0x46')][_0x36b1('0x35')]+'%'};return _0x7950ea;})});}_0x2539e6=_[_0x36b1('0xc9')]({},_0x2539e6,_0x9367a6[_0x36b1('0x5f')]);return _0x41cb88[_0x36b1('0x12d')](_0x2539e6);}})['then'](function(_0x56d211){if(_0x56d211){_0x21b99c=_0x56d211['length'];if(!_0x9367a6[_0x36b1('0x46')][_0x36b1('0xd0')](_0x36b1('0xd1'))){_0x2539e6[_0x36b1('0x25')]=qs[_0x36b1('0x25')](_0x9367a6[_0x36b1('0x46')][_0x36b1('0x25')]);_0x2539e6[_0x36b1('0x28')]=qs[_0x36b1('0x28')](_0x9367a6[_0x36b1('0x46')]['offset']);}return _0x41cb88[_0x36b1('0x12d')](_0x2539e6);}})[_0x36b1('0x17')](function(_0x6c54a3){if(_0x6c54a3){return _0x6c54a3?{'count':_0x21b99c,'rows':_0x6c54a3}:null;}})[_0x36b1('0x17')](respondWithResult(_0x1f8896,null))[_0x36b1('0x20')](handleError(_0x1f8896,null));};exports[_0x36b1('0x12f')]=function(_0x564da6,_0x265a3e){var _0x1d35e7={};var _0x51053b={};var _0x585390;var _0x53f8ef;return db[_0x36b1('0x45')][_0x36b1('0x99')]({'where':{'id':_0x564da6['params']['id']}})['then'](handleEntityNotFound(_0x265a3e,null))[_0x36b1('0x17')](function(_0x429e08){if(_0x429e08){_0x585390=_0x429e08;_0x51053b['model']=_['keys'](db[_0x36b1('0x130')][_0x36b1('0x3f')]);_0x51053b['query']=_[_0x36b1('0x57')](_0x564da6[_0x36b1('0x46')]);_0x51053b[_0x36b1('0x59')]=_[_0x36b1('0x5a')](_0x51053b[_0x36b1('0x5b')],_0x51053b[_0x36b1('0x46')]);_0x1d35e7[_0x36b1('0x4b')]=_[_0x36b1('0x5a')](_0x51053b[_0x36b1('0x5b')],qs[_0x36b1('0x5c')](_0x564da6[_0x36b1('0x46')][_0x36b1('0x5c')]));_0x1d35e7[_0x36b1('0x4b')]=_0x1d35e7[_0x36b1('0x4b')][_0x36b1('0x5d')]?_0x1d35e7[_0x36b1('0x4b')]:_0x51053b[_0x36b1('0x5b')];_0x1d35e7[_0x36b1('0xd3')]=qs[_0x36b1('0xc8')](_0x564da6[_0x36b1('0x46')][_0x36b1('0xc8')]);_0x1d35e7[_0x36b1('0x44')]=qs['filters'](_[_0x36b1('0xd4')](_0x564da6[_0x36b1('0x46')],_0x51053b[_0x36b1('0x59')]));if(_0x564da6[_0x36b1('0x46')][_0x36b1('0x35')]){_0x1d35e7[_0x36b1('0x44')]=_[_0x36b1('0xc9')](_0x1d35e7[_0x36b1('0x44')],{'$or':_[_0x36b1('0x37')](_0x1d35e7[_0x36b1('0x4b')],function(_0x10e990){var _0x346cfc={};_0x346cfc[_0x10e990]={'$like':'%'+_0x564da6[_0x36b1('0x46')][_0x36b1('0x35')]+'%'};return _0x346cfc;})});}_0x1d35e7=_[_0x36b1('0xc9')]({},_0x1d35e7,_0x564da6[_0x36b1('0x5f')]);return _0x585390['getFaxAccounts'](_0x1d35e7);}})[_0x36b1('0x17')](function(_0x33d369){if(_0x33d369){_0x53f8ef=_0x33d369[_0x36b1('0x5d')];if(!_0x564da6[_0x36b1('0x46')]['hasOwnProperty'](_0x36b1('0xd1'))){_0x1d35e7[_0x36b1('0x25')]=qs[_0x36b1('0x25')](_0x564da6['query'][_0x36b1('0x25')]);_0x1d35e7[_0x36b1('0x28')]=qs['offset'](_0x564da6[_0x36b1('0x46')][_0x36b1('0x28')]);}return _0x585390[_0x36b1('0x12f')](_0x1d35e7);}})['then'](function(_0x18679b){if(_0x18679b){return _0x18679b?{'count':_0x53f8ef,'rows':_0x18679b}:null;}})[_0x36b1('0x17')](respondWithResult(_0x265a3e,null))[_0x36b1('0x20')](handleError(_0x265a3e,null));};exports['addFaxAccounts']=function(_0x39d4fa,_0x39a231){return db['User'][_0x36b1('0x60')]({'where':{'id':_0x39d4fa[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x39a231,null))['then'](function(_0x207070){if(_0x207070){return _0x207070[_0x36b1('0x131')](_0x39d4fa[_0x36b1('0x63')][_0x36b1('0x66')],_[_0x36b1('0x11a')](_0x39d4fa['body'],['ids','id'])||{});}})[_0x36b1('0x17')](respondWithResult(_0x39a231,null))[_0x36b1('0x20')](handleError(_0x39a231,null));};exports[_0x36b1('0x132')]=function(_0x454f7b,_0x24f861){return db[_0x36b1('0x45')]['find']({'where':{'id':_0x454f7b[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x24f861,null))[_0x36b1('0x17')](function(_0x5bb7ff){if(_0x5bb7ff){return _0x5bb7ff[_0x36b1('0x132')](_0x454f7b[_0x36b1('0x46')][_0x36b1('0x66')]);}})['then'](respondWithStatusCode(_0x24f861,null))[_0x36b1('0x20')](handleError(_0x24f861,null));};exports['getMailAccounts']=function(_0x3e4459,_0x176a5d){var _0x1e0f93={};var _0x419a62={};var _0x5e7220;var _0x14350c;return db[_0x36b1('0x45')][_0x36b1('0x99')]({'where':{'id':_0x3e4459['params']['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x176a5d,null))[_0x36b1('0x17')](function(_0x400092){if(_0x400092){_0x5e7220=_0x400092;_0x419a62['model']=_['keys'](db['MailAccount'][_0x36b1('0x3f')]);_0x419a62[_0x36b1('0x46')]=_[_0x36b1('0x57')](_0x3e4459[_0x36b1('0x46')]);_0x419a62[_0x36b1('0x59')]=_['intersection'](_0x419a62[_0x36b1('0x5b')],_0x419a62[_0x36b1('0x46')]);_0x1e0f93['attributes']=_[_0x36b1('0x5a')](_0x419a62['model'],qs[_0x36b1('0x5c')](_0x3e4459[_0x36b1('0x46')][_0x36b1('0x5c')]));_0x1e0f93[_0x36b1('0x4b')]=_0x1e0f93[_0x36b1('0x4b')]['length']?_0x1e0f93[_0x36b1('0x4b')]:_0x419a62[_0x36b1('0x5b')];_0x1e0f93[_0x36b1('0xd3')]=qs['sort'](_0x3e4459[_0x36b1('0x46')][_0x36b1('0xc8')]);_0x1e0f93['where']=qs[_0x36b1('0x59')](_[_0x36b1('0xd4')](_0x3e4459[_0x36b1('0x46')],_0x419a62['filters']));if(_0x3e4459[_0x36b1('0x46')][_0x36b1('0x35')]){_0x1e0f93[_0x36b1('0x44')]=_[_0x36b1('0xc9')](_0x1e0f93[_0x36b1('0x44')],{'$or':_[_0x36b1('0x37')](_0x1e0f93[_0x36b1('0x4b')],function(_0xe09736){var _0x160b47={};_0x160b47[_0xe09736]={'$like':'%'+_0x3e4459[_0x36b1('0x46')][_0x36b1('0x35')]+'%'};return _0x160b47;})});}_0x1e0f93=_['merge']({},_0x1e0f93,_0x3e4459[_0x36b1('0x5f')]);return _0x5e7220[_0x36b1('0x133')](_0x1e0f93);}})[_0x36b1('0x17')](function(_0x27f45f){if(_0x27f45f){_0x14350c=_0x27f45f[_0x36b1('0x5d')];if(!_0x3e4459[_0x36b1('0x46')]['hasOwnProperty']('nolimit')){_0x1e0f93[_0x36b1('0x25')]=qs[_0x36b1('0x25')](_0x3e4459[_0x36b1('0x46')][_0x36b1('0x25')]);_0x1e0f93[_0x36b1('0x28')]=qs[_0x36b1('0x28')](_0x3e4459[_0x36b1('0x46')]['offset']);}return _0x5e7220[_0x36b1('0x133')](_0x1e0f93);}})[_0x36b1('0x17')](function(_0x824e03){if(_0x824e03){return _0x824e03?{'count':_0x14350c,'rows':_0x824e03}:null;}})['then'](respondWithResult(_0x176a5d,null))['catch'](handleError(_0x176a5d,null));};exports['addMailAccounts']=function(_0x481c7f,_0x3e69f3){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x481c7f['params']['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x3e69f3,null))[_0x36b1('0x17')](function(_0x25615c){if(_0x25615c){return _0x25615c[_0x36b1('0x134')](_0x481c7f[_0x36b1('0x63')][_0x36b1('0x66')],_[_0x36b1('0x11a')](_0x481c7f[_0x36b1('0x63')],['ids','id'])||{});}})[_0x36b1('0x17')](respondWithResult(_0x3e69f3,null))[_0x36b1('0x20')](handleError(_0x3e69f3,null));};exports[_0x36b1('0x135')]=function(_0x1414a9,_0x5e3a92){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x1414a9[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x5e3a92,null))[_0x36b1('0x17')](function(_0x1c9de7){if(_0x1c9de7){return _0x1c9de7['removeMailAccounts'](_0x1414a9[_0x36b1('0x46')][_0x36b1('0x66')]);}})['then'](respondWithStatusCode(_0x5e3a92,null))[_0x36b1('0x20')](handleError(_0x5e3a92,null));};exports[_0x36b1('0x136')]=function(_0x18d942,_0x16a1f5){var _0x3a133a={};var _0xbf5954={};var _0x24ff5d;var _0x4d095c;return db[_0x36b1('0x45')][_0x36b1('0x99')]({'where':{'id':_0x18d942[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x16a1f5,null))[_0x36b1('0x17')](function(_0x3309b5){if(_0x3309b5){_0x24ff5d=_0x3309b5;_0xbf5954['model']=_[_0x36b1('0x57')](db['OpenchannelAccount'][_0x36b1('0x3f')]);_0xbf5954[_0x36b1('0x46')]=_[_0x36b1('0x57')](_0x18d942['query']);_0xbf5954[_0x36b1('0x59')]=_[_0x36b1('0x5a')](_0xbf5954[_0x36b1('0x5b')],_0xbf5954[_0x36b1('0x46')]);_0x3a133a[_0x36b1('0x4b')]=_[_0x36b1('0x5a')](_0xbf5954[_0x36b1('0x5b')],qs[_0x36b1('0x5c')](_0x18d942['query'][_0x36b1('0x5c')]));_0x3a133a['attributes']=_0x3a133a['attributes'][_0x36b1('0x5d')]?_0x3a133a[_0x36b1('0x4b')]:_0xbf5954[_0x36b1('0x5b')];_0x3a133a[_0x36b1('0xd3')]=qs[_0x36b1('0xc8')](_0x18d942['query']['sort']);_0x3a133a[_0x36b1('0x44')]=qs[_0x36b1('0x59')](_[_0x36b1('0xd4')](_0x18d942[_0x36b1('0x46')],_0xbf5954[_0x36b1('0x59')]));if(_0x18d942[_0x36b1('0x46')][_0x36b1('0x35')]){_0x3a133a[_0x36b1('0x44')]=_[_0x36b1('0xc9')](_0x3a133a[_0x36b1('0x44')],{'$or':_[_0x36b1('0x37')](_0x3a133a[_0x36b1('0x4b')],function(_0x3b9264){var _0x2b7010={};_0x2b7010[_0x3b9264]={'$like':'%'+_0x18d942[_0x36b1('0x46')]['filter']+'%'};return _0x2b7010;})});}_0x3a133a=_[_0x36b1('0xc9')]({},_0x3a133a,_0x18d942['options']);return _0x24ff5d[_0x36b1('0x136')](_0x3a133a);}})[_0x36b1('0x17')](function(_0xe01a77){if(_0xe01a77){_0x4d095c=_0xe01a77[_0x36b1('0x5d')];if(!_0x18d942[_0x36b1('0x46')][_0x36b1('0xd0')](_0x36b1('0xd1'))){_0x3a133a[_0x36b1('0x25')]=qs[_0x36b1('0x25')](_0x18d942[_0x36b1('0x46')][_0x36b1('0x25')]);_0x3a133a[_0x36b1('0x28')]=qs['offset'](_0x18d942[_0x36b1('0x46')][_0x36b1('0x28')]);}return _0x24ff5d[_0x36b1('0x136')](_0x3a133a);}})[_0x36b1('0x17')](function(_0x49e980){if(_0x49e980){return _0x49e980?{'count':_0x4d095c,'rows':_0x49e980}:null;}})[_0x36b1('0x17')](respondWithResult(_0x16a1f5,null))[_0x36b1('0x20')](handleError(_0x16a1f5,null));};exports[_0x36b1('0x137')]=function(_0x418a46,_0x11f9cc){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x418a46['params']['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x11f9cc,null))['then'](function(_0xeec1fc){if(_0xeec1fc){return _0xeec1fc[_0x36b1('0x137')](_0x418a46[_0x36b1('0x63')]['ids'],_['omit'](_0x418a46[_0x36b1('0x63')],[_0x36b1('0x66'),'id'])||{});}})['then'](respondWithResult(_0x11f9cc,null))[_0x36b1('0x20')](handleError(_0x11f9cc,null));};exports[_0x36b1('0x138')]=function(_0x388b2f,_0x16c787){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x388b2f['params']['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x16c787,null))[_0x36b1('0x17')](function(_0x31f330){if(_0x31f330){return _0x31f330[_0x36b1('0x138')](_0x388b2f['query'][_0x36b1('0x66')]);}})[_0x36b1('0x17')](respondWithStatusCode(_0x16c787,null))[_0x36b1('0x20')](handleError(_0x16c787,null));};exports[_0x36b1('0x139')]=function(_0x4fca31,_0x494d20){var _0x59c3c6={};var _0x53fa3f={};var _0x3a827b;var _0x4c999e;return db[_0x36b1('0x45')][_0x36b1('0x99')]({'where':{'id':_0x4fca31[_0x36b1('0x55')]['id']}})['then'](handleEntityNotFound(_0x494d20,null))['then'](function(_0x4ff2ab){if(_0x4ff2ab){_0x3a827b=_0x4ff2ab;_0x53fa3f[_0x36b1('0x5b')]=_['keys'](db[_0x36b1('0x13a')]['rawAttributes']);_0x53fa3f[_0x36b1('0x46')]=_[_0x36b1('0x57')](_0x4fca31[_0x36b1('0x46')]);_0x53fa3f[_0x36b1('0x59')]=_[_0x36b1('0x5a')](_0x53fa3f['model'],_0x53fa3f[_0x36b1('0x46')]);_0x59c3c6['attributes']=_[_0x36b1('0x5a')](_0x53fa3f[_0x36b1('0x5b')],qs[_0x36b1('0x5c')](_0x4fca31[_0x36b1('0x46')][_0x36b1('0x5c')]));_0x59c3c6[_0x36b1('0x4b')]=_0x59c3c6[_0x36b1('0x4b')][_0x36b1('0x5d')]?_0x59c3c6[_0x36b1('0x4b')]:_0x53fa3f[_0x36b1('0x5b')];_0x59c3c6[_0x36b1('0xd3')]=qs['sort'](_0x4fca31[_0x36b1('0x46')][_0x36b1('0xc8')]);_0x59c3c6['where']=qs[_0x36b1('0x59')](_[_0x36b1('0xd4')](_0x4fca31[_0x36b1('0x46')],_0x53fa3f[_0x36b1('0x59')]));if(_0x4fca31[_0x36b1('0x46')][_0x36b1('0x35')]){_0x59c3c6[_0x36b1('0x44')]=_['merge'](_0x59c3c6[_0x36b1('0x44')],{'$or':_[_0x36b1('0x37')](_0x59c3c6[_0x36b1('0x4b')],function(_0x308800){var _0x573988={};_0x573988[_0x308800]={'$like':'%'+_0x4fca31[_0x36b1('0x46')][_0x36b1('0x35')]+'%'};return _0x573988;})});}_0x59c3c6=_[_0x36b1('0xc9')]({},_0x59c3c6,_0x4fca31[_0x36b1('0x5f')]);return _0x3a827b[_0x36b1('0x139')](_0x59c3c6);}})[_0x36b1('0x17')](function(_0x1ac8e6){if(_0x1ac8e6){_0x4c999e=_0x1ac8e6['length'];if(!_0x4fca31[_0x36b1('0x46')][_0x36b1('0xd0')](_0x36b1('0xd1'))){_0x59c3c6['limit']=qs[_0x36b1('0x25')](_0x4fca31['query']['limit']);_0x59c3c6['offset']=qs[_0x36b1('0x28')](_0x4fca31[_0x36b1('0x46')][_0x36b1('0x28')]);}return _0x3a827b['getSmsAccounts'](_0x59c3c6);}})[_0x36b1('0x17')](function(_0xcd7bc5){if(_0xcd7bc5){return _0xcd7bc5?{'count':_0x4c999e,'rows':_0xcd7bc5}:null;}})[_0x36b1('0x17')](respondWithResult(_0x494d20,null))[_0x36b1('0x20')](handleError(_0x494d20,null));};exports[_0x36b1('0x13b')]=function(_0x46d278,_0x5abd21){return db['User'][_0x36b1('0x60')]({'where':{'id':_0x46d278['params']['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x5abd21,null))[_0x36b1('0x17')](function(_0x343a3f){if(_0x343a3f){return _0x343a3f[_0x36b1('0x13b')](_0x46d278[_0x36b1('0x63')][_0x36b1('0x66')],_[_0x36b1('0x11a')](_0x46d278[_0x36b1('0x63')],[_0x36b1('0x66'),'id'])||{});}})[_0x36b1('0x17')](respondWithResult(_0x5abd21,null))[_0x36b1('0x20')](handleError(_0x5abd21,null));};exports[_0x36b1('0x13c')]=function(_0x557fa4,_0x5807ad){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x557fa4[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x5807ad,null))['then'](function(_0x297731){if(_0x297731){return _0x297731['removeSmsAccounts'](_0x557fa4[_0x36b1('0x46')][_0x36b1('0x66')]);}})[_0x36b1('0x17')](respondWithStatusCode(_0x5807ad,null))[_0x36b1('0x20')](handleError(_0x5807ad,null));};exports[_0x36b1('0x13d')]=function(_0x36adfe,_0x2f83a1){var _0x398eb4={};var _0x3f3707={};var _0x4aa904;var _0x29c1c9;return db[_0x36b1('0x45')]['findOne']({'where':{'id':_0x36adfe[_0x36b1('0x55')]['id']}})['then'](handleEntityNotFound(_0x2f83a1,null))[_0x36b1('0x17')](function(_0xde8362){if(_0xde8362){_0x4aa904=_0xde8362;_0x3f3707[_0x36b1('0x5b')]=_[_0x36b1('0x57')](db[_0x36b1('0x13e')][_0x36b1('0x3f')]);_0x3f3707['query']=_[_0x36b1('0x57')](_0x36adfe[_0x36b1('0x46')]);_0x3f3707[_0x36b1('0x59')]=_[_0x36b1('0x5a')](_0x3f3707[_0x36b1('0x5b')],_0x3f3707[_0x36b1('0x46')]);_0x398eb4['attributes']=_[_0x36b1('0x5a')](_0x3f3707['model'],qs[_0x36b1('0x5c')](_0x36adfe[_0x36b1('0x46')][_0x36b1('0x5c')]));_0x398eb4[_0x36b1('0x4b')]=_0x398eb4[_0x36b1('0x4b')]['length']?_0x398eb4[_0x36b1('0x4b')]:_0x3f3707[_0x36b1('0x5b')];_0x398eb4['order']=qs['sort'](_0x36adfe[_0x36b1('0x46')][_0x36b1('0xc8')]);_0x398eb4[_0x36b1('0x44')]=qs[_0x36b1('0x59')](_[_0x36b1('0xd4')](_0x36adfe[_0x36b1('0x46')],_0x3f3707[_0x36b1('0x59')]));if(_0x36adfe[_0x36b1('0x46')]['filter']){_0x398eb4['where']=_[_0x36b1('0xc9')](_0x398eb4['where'],{'$or':_[_0x36b1('0x37')](_0x398eb4[_0x36b1('0x4b')],function(_0x10f723){var _0x179444={};_0x179444[_0x10f723]={'$like':'%'+_0x36adfe[_0x36b1('0x46')][_0x36b1('0x35')]+'%'};return _0x179444;})});}_0x398eb4=_[_0x36b1('0xc9')]({},_0x398eb4,_0x36adfe[_0x36b1('0x5f')]);return _0x4aa904['getChatWebsites'](_0x398eb4);}})['then'](function(_0x1605a8){if(_0x1605a8){_0x29c1c9=_0x1605a8[_0x36b1('0x5d')];if(!_0x36adfe['query']['hasOwnProperty'](_0x36b1('0xd1'))){_0x398eb4['limit']=qs[_0x36b1('0x25')](_0x36adfe['query'][_0x36b1('0x25')]);_0x398eb4[_0x36b1('0x28')]=qs[_0x36b1('0x28')](_0x36adfe[_0x36b1('0x46')][_0x36b1('0x28')]);}return _0x4aa904[_0x36b1('0x13d')](_0x398eb4);}})[_0x36b1('0x17')](function(_0x5d47ad){if(_0x5d47ad){return _0x5d47ad?{'count':_0x29c1c9,'rows':_0x5d47ad}:null;}})[_0x36b1('0x17')](respondWithResult(_0x2f83a1,null))[_0x36b1('0x20')](handleError(_0x2f83a1,null));};exports['addChatWebsites']=function(_0xe906ee,_0x3e94e7){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0xe906ee[_0x36b1('0x55')]['id']}})['then'](handleEntityNotFound(_0x3e94e7,null))[_0x36b1('0x17')](function(_0x36f3f8){if(_0x36f3f8){return _0x36f3f8[_0x36b1('0x13f')](_0xe906ee[_0x36b1('0x63')][_0x36b1('0x66')],_[_0x36b1('0x11a')](_0xe906ee[_0x36b1('0x63')],['ids','id'])||{});}})[_0x36b1('0x17')](respondWithResult(_0x3e94e7,null))[_0x36b1('0x20')](handleError(_0x3e94e7,null));};exports[_0x36b1('0x140')]=function(_0x365a3b,_0x279450){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x365a3b['params']['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x279450,null))['then'](function(_0x35a6af){if(_0x35a6af){return _0x35a6af['removeChatWebsites'](_0x365a3b['query'][_0x36b1('0x66')]);}})[_0x36b1('0x17')](respondWithStatusCode(_0x279450,null))['catch'](handleError(_0x279450,null));};exports['getWhatsappAccounts']=function(_0x32e175,_0x1cb0b6){var _0x1dd3e2={};var _0x5bf103={};var _0x16b81a;var _0x4c5e3e;return db[_0x36b1('0x45')]['findOne']({'where':{'id':_0x32e175[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x1cb0b6,null))[_0x36b1('0x17')](function(_0x1a354d){if(_0x1a354d){_0x16b81a=_0x1a354d;_0x5bf103['model']=_[_0x36b1('0x57')](db['WhatsappAccount'][_0x36b1('0x3f')]);_0x5bf103['query']=_[_0x36b1('0x57')](_0x32e175[_0x36b1('0x46')]);_0x5bf103['filters']=_[_0x36b1('0x5a')](_0x5bf103['model'],_0x5bf103[_0x36b1('0x46')]);_0x1dd3e2['attributes']=_[_0x36b1('0x5a')](_0x5bf103[_0x36b1('0x5b')],qs['fields'](_0x32e175[_0x36b1('0x46')][_0x36b1('0x5c')]));_0x1dd3e2['attributes']=_0x1dd3e2['attributes']['length']?_0x1dd3e2[_0x36b1('0x4b')]:_0x5bf103['model'];_0x1dd3e2[_0x36b1('0xd3')]=qs[_0x36b1('0xc8')](_0x32e175[_0x36b1('0x46')]['sort']);_0x1dd3e2[_0x36b1('0x44')]=qs[_0x36b1('0x59')](_[_0x36b1('0xd4')](_0x32e175[_0x36b1('0x46')],_0x5bf103['filters']));if(_0x32e175['query']['filter']){_0x1dd3e2['where']=_[_0x36b1('0xc9')](_0x1dd3e2[_0x36b1('0x44')],{'$or':_['map'](_0x1dd3e2[_0x36b1('0x4b')],function(_0x240018){var _0x2cd08e={};_0x2cd08e[_0x240018]={'$like':'%'+_0x32e175[_0x36b1('0x46')][_0x36b1('0x35')]+'%'};return _0x2cd08e;})});}_0x1dd3e2=_['merge']({},_0x1dd3e2,_0x32e175[_0x36b1('0x5f')]);return _0x16b81a[_0x36b1('0x141')](_0x1dd3e2);}})['then'](function(_0x2e8971){if(_0x2e8971){_0x4c5e3e=_0x2e8971[_0x36b1('0x5d')];if(!_0x32e175[_0x36b1('0x46')][_0x36b1('0xd0')](_0x36b1('0xd1'))){_0x1dd3e2[_0x36b1('0x25')]=qs['limit'](_0x32e175[_0x36b1('0x46')][_0x36b1('0x25')]);_0x1dd3e2[_0x36b1('0x28')]=qs[_0x36b1('0x28')](_0x32e175[_0x36b1('0x46')][_0x36b1('0x28')]);}return _0x16b81a[_0x36b1('0x141')](_0x1dd3e2);}})[_0x36b1('0x17')](function(_0x3306fa){if(_0x3306fa){return _0x3306fa?{'count':_0x4c5e3e,'rows':_0x3306fa}:null;}})['then'](respondWithResult(_0x1cb0b6,null))[_0x36b1('0x20')](handleError(_0x1cb0b6,null));};exports[_0x36b1('0x142')]=function(_0x363ccd,_0x135784){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x363ccd['params']['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x135784,null))[_0x36b1('0x17')](function(_0x169632){if(_0x169632){return _0x169632[_0x36b1('0x142')](_0x363ccd[_0x36b1('0x63')][_0x36b1('0x66')],_[_0x36b1('0x11a')](_0x363ccd[_0x36b1('0x63')],['ids','id'])||{});}})[_0x36b1('0x17')](respondWithResult(_0x135784,null))['catch'](handleError(_0x135784,null));};exports['removeWhatsappAccounts']=function(_0x52d89f,_0x3b7188){return db['User']['find']({'where':{'id':_0x52d89f[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x3b7188,null))[_0x36b1('0x17')](function(_0x572997){if(_0x572997){return _0x572997[_0x36b1('0x143')](_0x52d89f[_0x36b1('0x46')][_0x36b1('0x66')]);}})[_0x36b1('0x17')](respondWithStatusCode(_0x3b7188,null))[_0x36b1('0x20')](handleError(_0x3b7188,null));};exports[_0x36b1('0x144')]=function(_0x2e2c9a,_0x53c9ca){var _0x22b1fe={};var _0x6dccfd={};var _0x50f498;var _0x15ed11;return db[_0x36b1('0x45')][_0x36b1('0x99')]({'where':{'id':_0x2e2c9a[_0x36b1('0x55')]['id']}})['then'](handleEntityNotFound(_0x53c9ca,null))['then'](function(_0x530807){if(_0x530807){_0x50f498=_0x530807;_0x6dccfd[_0x36b1('0x5b')]=_[_0x36b1('0x57')](db[_0x36b1('0x145')]['rawAttributes']);_0x6dccfd[_0x36b1('0x46')]=_[_0x36b1('0x57')](_0x2e2c9a[_0x36b1('0x46')]);_0x6dccfd[_0x36b1('0x59')]=_[_0x36b1('0x5a')](_0x6dccfd[_0x36b1('0x5b')],_0x6dccfd[_0x36b1('0x46')]);_0x22b1fe[_0x36b1('0x4b')]=_[_0x36b1('0x5a')](_0x6dccfd[_0x36b1('0x5b')],qs['fields'](_0x2e2c9a[_0x36b1('0x46')][_0x36b1('0x5c')]));_0x22b1fe['attributes']=_0x22b1fe[_0x36b1('0x4b')][_0x36b1('0x5d')]?_0x22b1fe['attributes']:_0x6dccfd[_0x36b1('0x5b')];_0x22b1fe['order']=qs[_0x36b1('0xc8')](_0x2e2c9a[_0x36b1('0x46')][_0x36b1('0xc8')]);_0x22b1fe[_0x36b1('0x44')]=qs[_0x36b1('0x59')](_['pick'](_0x2e2c9a[_0x36b1('0x46')],_0x6dccfd[_0x36b1('0x59')]));if(_0x2e2c9a[_0x36b1('0x46')][_0x36b1('0x35')]){_0x22b1fe[_0x36b1('0x44')]=_[_0x36b1('0xc9')](_0x22b1fe[_0x36b1('0x44')],{'$or':_[_0x36b1('0x37')](_0x22b1fe[_0x36b1('0x4b')],function(_0x10b08f){var _0x562292={};_0x562292[_0x10b08f]={'$like':'%'+_0x2e2c9a[_0x36b1('0x46')]['filter']+'%'};return _0x562292;})});}_0x22b1fe=_['merge']({},_0x22b1fe,_0x2e2c9a['options']);return _0x50f498['getSquareProjects'](_0x22b1fe);}})[_0x36b1('0x17')](function(_0x1cfb33){if(_0x1cfb33){_0x15ed11=_0x1cfb33[_0x36b1('0x5d')];if(!_0x2e2c9a[_0x36b1('0x46')]['hasOwnProperty'](_0x36b1('0xd1'))){_0x22b1fe[_0x36b1('0x25')]=qs[_0x36b1('0x25')](_0x2e2c9a[_0x36b1('0x46')][_0x36b1('0x25')]);_0x22b1fe[_0x36b1('0x28')]=qs[_0x36b1('0x28')](_0x2e2c9a['query'][_0x36b1('0x28')]);}return _0x50f498['getSquareProjects'](_0x22b1fe);}})[_0x36b1('0x17')](function(_0x59d65a){if(_0x59d65a){return _0x59d65a?{'count':_0x15ed11,'rows':_0x59d65a}:null;}})['then'](respondWithResult(_0x53c9ca,null))[_0x36b1('0x20')](handleError(_0x53c9ca,null));};exports[_0x36b1('0x146')]=function(_0x5c5d02,_0x223d4c){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x5c5d02['params']['id']}})['then'](handleEntityNotFound(_0x223d4c,null))[_0x36b1('0x17')](function(_0x11e063){if(_0x11e063){return _0x11e063[_0x36b1('0x146')](_0x5c5d02[_0x36b1('0x63')][_0x36b1('0x66')],_[_0x36b1('0x11a')](_0x5c5d02[_0x36b1('0x63')],[_0x36b1('0x66'),'id'])||{});}})['then'](respondWithResult(_0x223d4c,null))[_0x36b1('0x20')](handleError(_0x223d4c,null));};exports[_0x36b1('0x147')]=function(_0x4f6a8c,_0x58f6c8){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x4f6a8c[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x58f6c8,null))['then'](function(_0x1417f5){if(_0x1417f5){return _0x1417f5[_0x36b1('0x147')](_0x4f6a8c[_0x36b1('0x46')][_0x36b1('0x66')]);}})[_0x36b1('0x17')](respondWithStatusCode(_0x58f6c8,null))[_0x36b1('0x20')](handleError(_0x58f6c8,null));};exports['getScheduledCalls']=function(_0x26c90a,_0x500a0b){var _0x26d16d={},_0x23cf8b={},_0x493b54={'count':0x0,'rows':[]};var _0x4e3cb1=db[_0x36b1('0x148')]['rawAttributes'];_0x23cf8b['model']=_[_0x36b1('0x57')](_0x4e3cb1);_0x23cf8b[_0x36b1('0x46')]=_['keys'](_0x26c90a['query']);_0x23cf8b[_0x36b1('0x59')]=_[_0x36b1('0x5a')](_0x23cf8b[_0x36b1('0x5b')],_0x23cf8b['query']);_0x23cf8b[_0x36b1('0x59')]=_[_0x36b1('0xc6')](_0x23cf8b['filters'],[_0x36b1('0x149'),_0x36b1('0x14a'),'$gt',_0x36b1('0x14b'),'$lt',_0x36b1('0x14c'),'$ne',_0x36b1('0x14d'),'$not',_0x36b1('0x14e'),_0x36b1('0x14f'),_0x36b1('0x150'),_0x36b1('0x151'),_0x36b1('0x152'),_0x36b1('0x153'),'$iLike',_0x36b1('0x154'),_0x36b1('0x152'),_0x36b1('0x155'),_0x36b1('0x156'),_0x36b1('0x157'),_0x36b1('0x158')]);_0x26d16d['attributes']=_[_0x36b1('0x5a')](_0x23cf8b[_0x36b1('0x5b')],qs[_0x36b1('0x5c')](_0x26c90a[_0x36b1('0x46')][_0x36b1('0x5c')]));_0x26d16d['attributes']=_0x26d16d['attributes'][_0x36b1('0x5d')]?_0x26d16d[_0x36b1('0x4b')]:_0x23cf8b[_0x36b1('0x5b')];if(!_0x26c90a[_0x36b1('0x46')][_0x36b1('0xd0')](_0x36b1('0xd1'))){_0x26d16d[_0x36b1('0x25')]=qs[_0x36b1('0x25')](_0x26c90a[_0x36b1('0x46')]['limit']);_0x26d16d[_0x36b1('0x28')]=qs[_0x36b1('0x28')](_0x26c90a[_0x36b1('0x46')][_0x36b1('0x28')]);}_0x26d16d[_0x36b1('0xd3')]=qs[_0x36b1('0xc8')](_0x26c90a[_0x36b1('0x46')][_0x36b1('0xc8')]);_0x26d16d[_0x36b1('0x44')]=qs[_0x36b1('0x59')](_[_0x36b1('0xd4')](_0x26c90a['query'],_0x23cf8b[_0x36b1('0x59')]));if(_0x26c90a[_0x36b1('0x46')][_0x36b1('0x35')]){_0x26d16d['where']=_[_0x36b1('0xc9')](_0x26d16d['where'],{'$or':_[_0x36b1('0x37')](_0x26d16d[_0x36b1('0x4b')],function(_0x163f4a){var _0x3eaddd={};_0x3eaddd[_0x163f4a]={'$like':'%'+_0x26c90a[_0x36b1('0x46')][_0x36b1('0x35')]+'%'};return _0x3eaddd;})});}_0x26d16d[_0x36b1('0x44')]={'$and':[_0x26d16d['where'],{'$or':[{'UserId':_0x26c90a[_0x36b1('0x55')]['id']},{'OwnerId':_0x26c90a[_0x36b1('0x55')]['id']}]}]};_0x26d16d=_[_0x36b1('0xc9')]({},_0x26d16d,_0x26c90a[_0x36b1('0x5f')]);var _0x37a1d3={'where':_0x26d16d[_0x36b1('0x44')]};return db[_0x36b1('0x148')][_0x36b1('0x27')](_0x37a1d3)[_0x36b1('0x17')](function(_0x2bbdfb){_0x493b54[_0x36b1('0x27')]=_0x2bbdfb;if(_0x26c90a[_0x36b1('0x46')]['includeAll']){_0x26d16d['include']=[{'attributes':['id',_0x36b1('0x159'),'lastName','phone'],'model':db[_0x36b1('0xc7')],'as':_0x36b1('0x15a')},{'attributes':['id',_0x36b1('0x3b'),_0x36b1('0x15b')],'model':db[_0x36b1('0xac')],'as':_0x36b1('0xd5')}];}return db[_0x36b1('0x148')][_0x36b1('0x4c')](_0x26d16d);})[_0x36b1('0x17')](function(_0x13fffd){_0x493b54['rows']=_0x13fffd;return _0x493b54;})[_0x36b1('0x17')](respondWithFilteredResult(_0x500a0b,_0x26d16d))['catch'](handleError(_0x500a0b,null));};exports[_0x36b1('0x15c')]=function(_0x5bebc3,_0x2a6825){if(!_[_0x36b1('0x6d')](_0x5bebc3['user']['id'])&&(_0x5bebc3[_0x36b1('0x31')]['role']==_0x36b1('0x2f')||_0x5bebc3['user'][_0x36b1('0x3a')]==_0x36b1('0x31'))){return db[_0x36b1('0x45')]['findOne']({'where':{'id':_0x5bebc3[_0x36b1('0x55')]['id']},'raw':!![]})[_0x36b1('0x17')](function(_0x3fb544){return authService[_0x36b1('0x15d')](_0x3fb544);})[_0x36b1('0x17')](function(_0x110dfe){if(_0x110dfe){return _0x2a6825['status'](0xc8)[_0x36b1('0x24')]({'api_key':_0x110dfe['token']});}else{return _0x2a6825['status'](0xcc)[_0x36b1('0x24')]({'message':_0x36b1('0x15e')});}})[_0x36b1('0x20')](handleError(_0x2a6825,0x193));}else{return _0x2a6825[_0x36b1('0x22')](0x191)['json']({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0x36b1('0x15f')]=function(_0x4e41ab,_0x595325){if(!_[_0x36b1('0x6d')](_0x4e41ab[_0x36b1('0x31')]['id'])&&(_0x4e41ab[_0x36b1('0x31')][_0x36b1('0x3a')]==_0x36b1('0x2f')||_0x4e41ab[_0x36b1('0x31')][_0x36b1('0x3a')]=='user')){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x4e41ab[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](function(_0x1670c8){return authService[_0x36b1('0x160')](_0x1670c8);})[_0x36b1('0x17')](function(_0x6edbfb){return db[_0x36b1('0x45')][_0x36b1('0x2a')]({'apiKeyIat':_0x6edbfb['iat'],'apiKeyNonce':_0x6edbfb[_0x36b1('0x161')]},{'where':{'id':_0x4e41ab['params']['id']}})[_0x36b1('0x17')](function(){return _0x595325['status'](0xc8)[_0x36b1('0x24')]({'api_key':_0x6edbfb[_0x36b1('0x162')]});});})[_0x36b1('0x20')](handleError(_0x595325,0x193));}else{return _0x595325[_0x36b1('0x22')](0x191)['json']({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0x36b1('0x163')]=function(_0x21ad54,_0x232821){if(!_[_0x36b1('0x6d')](_0x21ad54[_0x36b1('0x31')]['id'])&&(_0x21ad54[_0x36b1('0x31')]['role']==_0x36b1('0x2f')||_0x21ad54['user'][_0x36b1('0x3a')]==_0x36b1('0x31'))){return db[_0x36b1('0x45')][_0x36b1('0x60')]({'where':{'id':_0x21ad54[_0x36b1('0x55')]['id']}})[_0x36b1('0x17')](handleEntityNotFound(_0x232821,null))[_0x36b1('0x17')](function(_0x2736ff){if(_0x2736ff&&_0x2736ff['apiKeyNonce']&&_0x2736ff['apiKeyIat'])return _0x2736ff;else throw{'message':_0x36b1('0x164')};})['then'](function(){return db[_0x36b1('0x45')]['update']({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x21ad54['params']['id']}});})[_0x36b1('0x17')](respondWithStatusCode(_0x232821,0xc8))[_0x36b1('0x20')](handleError(_0x232821,0x193));}else{return _0x232821[_0x36b1('0x22')](0x191)[_0x36b1('0x24')]({'message':_0x36b1('0x165')});}};exports[_0x36b1('0x166')]=function(_0x46a275,_0x5ac15e){var _0x521ee2=_0x46a275['user'][_0x36b1('0x2e')]({'plain':!![]});if(!_0x521ee2){return _0x5ac15e['status'](0x191)[_0x36b1('0x3e')](_0x36b1('0x167'));}else{Promise[_0x36b1('0xf8')]()['then'](function(){if(_0x46a275[_0x36b1('0x46')][_0x36b1('0x4a')]!=='true')return;return _0x46a275[_0x36b1('0x31')][_0x36b1('0x168')]();})[_0x36b1('0x17')](function(_0x4894e0){if(!_0x4894e0)return;return _0x4894e0[_0x36b1('0x2e')]({'plain':!![]});})[_0x36b1('0x17')](function(_0x4ea991){_0x521ee2[_0x36b1('0x4a')]=_0x4ea991;return _0x5ac15e[_0x36b1('0x22')](0xc8)['json'](_0x521ee2);});}};exports['getPresence']=function(_0x2d4a6d,_0x3a35fd){var _0x4707eb={'offset':0x0},_0x3b5df4={'count':0x0,'rows':[]};Promise[_0x36b1('0xf8')]()[_0x36b1('0x17')](function(){if(!_0x2d4a6d['query'][_0x36b1('0x35')]&&!_0x2d4a6d['query']['teams']&&!_0x2d4a6d[_0x36b1('0x46')]['queues'])return[];return Promise[_0x36b1('0xf8')]()['then'](function(){var _0x2abc6e=[];if(!_[_0x36b1('0x169')](_0x2d4a6d[_0x36b1('0x46')][_0x36b1('0x16a')])){_0x2abc6e[_0x36b1('0x4f')](db[_0x36b1('0x106')][_0x36b1('0x4c')]({'attributes':['id',_0x36b1('0x3b')],'where':{'id':_0x2d4a6d[_0x36b1('0x46')][_0x36b1('0x16a')]}}));}if(!_[_0x36b1('0x169')](_0x2d4a6d[_0x36b1('0x46')][_0x36b1('0x16b')])){_0x2abc6e[_0x36b1('0x4f')](db[_0x36b1('0xac')][_0x36b1('0x4c')]({'attributes':['id','name'],'type':_0x36b1('0x16c'),'where':{'id':_0x2d4a6d[_0x36b1('0x46')]['queues']}}));}return Promise['all'](_0x2abc6e);})[_0x36b1('0x17')](function(_0x37f81b){var _0x5d5d5a=_['flatten'](_0x37f81b)[_0x36b1('0x37')](function(_0x20c2ce){return _0x20c2ce[_0x36b1('0x117')]({'attributes':['id','name',_0x36b1('0x67'),_0x36b1('0x9f')],'raw':!![]});});return Promise[_0x36b1('0x62')](_0x5d5d5a);})['then'](function(_0x1f5854){var _0x87e81a=_[_0x36b1('0x16d')](_0x1f5854);if(!_0x2d4a6d[_0x36b1('0x46')][_0x36b1('0x35')])return _0x87e81a;if(_[_0x36b1('0x169')](_0x87e81a)){return db[_0x36b1('0x45')]['findAll']({'attributes':['id',_0x36b1('0x3b'),_0x36b1('0x67'),'online'],'where':{'role':_0x36b1('0x33'),'$or':[db[_0x36b1('0x6f')][_0x36b1('0x44')](db['sequelize']['fn'](_0x36b1('0x16e'),db[_0x36b1('0x6f')][_0x36b1('0x16f')](_0x36b1('0x3b'))),{'$like':'%'+_0x2d4a6d[_0x36b1('0x46')][_0x36b1('0x35')]['toLowerCase']()+'%'}),{'internal':{'$like':'%'+_0x2d4a6d[_0x36b1('0x46')]['filter']+'%'}}]},'raw':!![]});}else{return _(_0x87e81a)[_0x36b1('0x16d')]()[_0x36b1('0x35')](function(_0x4c5d3a){return _0x4c5d3a[_0x36b1('0x3b')][_0x36b1('0xa7')]()[_0x36b1('0x39')](_0x2d4a6d[_0x36b1('0x46')][_0x36b1('0x35')]['toLowerCase']())||_0x4c5d3a[_0x36b1('0x67')][_0x36b1('0x170')]()[_0x36b1('0x39')](_0x2d4a6d[_0x36b1('0x46')][_0x36b1('0x35')]);})[_0x36b1('0x38')]();}})[_0x36b1('0x17')](function(_0x20e52d){var _0x3941fa=_0x36b1('0x3b');var _0x312d77=_0x36b1('0x171');if(_0x2d4a6d[_0x36b1('0x46')][_0x36b1('0xc8')]){_0x312d77=_0x2d4a6d[_0x36b1('0x46')][_0x36b1('0xc8')][0x0]==='-'?'desc':_0x36b1('0x171');_0x3941fa=_0x312d77===_0x36b1('0x171')?_0x2d4a6d[_0x36b1('0x46')][_0x36b1('0xc8')]:_0x2d4a6d[_0x36b1('0x46')][_0x36b1('0xc8')][_0x36b1('0x172')](0x1);}return _(_0x20e52d)[_0x36b1('0x173')]('id')[_0x36b1('0x174')]([function(_0x4180cc){return _0x3941fa==='name'?_0x4180cc[_0x3941fa][_0x36b1('0xa7')]():_0x4180cc[_0x3941fa];}],[_0x312d77])['map'](function(_0x43e3f0){return _[_0x36b1('0xd4')](_0x43e3f0,['id','name',_0x36b1('0x67'),'online']);})[_0x36b1('0x38')]();})[_0x36b1('0x17')](function(_0x4c7d8f){return client[_0x36b1('0x16')]('Agents',_0x2d4a6d)[_0x36b1('0x17')](function(_0x9c3cb5){if(_0x9c3cb5[_0x36b1('0x1d')])throw new Error(_0x36b1('0x175'));var _0x848d22=_0x9c3cb5[_0x36b1('0x1f')];var _0x5dc2b2=jayson[_0x36b1('0x14')][_0x36b1('0x15')]({'port':0x232c});return _0x5dc2b2[_0x36b1('0x16')](_0x36b1('0x32'),_0x2d4a6d)[_0x36b1('0x17')](function(_0xe9a1ca){if(_0xe9a1ca[_0x36b1('0x1d')])throw new Error(_0x36b1('0x176'));var _0x21608d=_0xe9a1ca[_0x36b1('0x1f')];return _[_0x36b1('0xc9')]({},_0x21608d,_0x848d22);});})['then'](function(_0x4e7e9b){return _[_0x36b1('0x37')](_0x4c7d8f,function(_0x929702){var _0x5dce4c=_[_0x36b1('0x60')](_0x4e7e9b[_0x36b1('0x4d')],['id',_0x929702['id']]);if(!_0x5dce4c||!_0x929702[_0x36b1('0x9f')]){_0x929702[_0x36b1('0x22')]=_0x36b1('0x177');}else if(_0x5dce4c[_0x36b1('0xa1')]){_0x929702[_0x36b1('0x22')]=_0x36b1('0xf9');}else{_0x929702[_0x36b1('0x22')]=_[_0x36b1('0x39')]([_0x36b1('0x178'),'unknown','unavailable','ringing',null,undefined],_0x5dce4c['voiceStatus'])?_0x36b1('0x9f'):_0x36b1('0x179');}return _0x929702;});});});})[_0x36b1('0x17')](function(_0xd9dbb8){if(!_0x2d4a6d[_0x36b1('0x46')]['hasOwnProperty'](_0x36b1('0xd1'))){_0x4707eb[_0x36b1('0x25')]=qs['limit'](_0x2d4a6d['query'][_0x36b1('0x25')]||0xa);_0x4707eb[_0x36b1('0x28')]=qs[_0x36b1('0x28')](_0x2d4a6d[_0x36b1('0x46')]['offset']);}_0x3b5df4[_0x36b1('0x27')]=_0xd9dbb8[_0x36b1('0x5d')];_0x3b5df4['rows']=_0x4707eb[_0x36b1('0x25')]?_0xd9dbb8[_0x36b1('0x17a')](_0x4707eb[_0x36b1('0x28')],_0x4707eb[_0x36b1('0x28')]+_0x4707eb['limit']):_0xd9dbb8;return _0x3b5df4;})[_0x36b1('0x17')](respondWithFilteredResult(_0x3a35fd,_0x4707eb))['catch'](handleError(_0x3a35fd,null));};function get_open_tabs(_0x12d6b9,_0x319fd8){var _0x5af399=_0x12d6b9['charAt'](0x0)['toUpperCase']()+_0x12d6b9[_0x36b1('0x17a')](0x1);var _0x464ca1={'type':db[_0x36b1('0x93')][_0x36b1('0x71')]['SELECT'],'raw':!![]};return new BPromise(function(_0x3d59ff,_0x47ab50){var _0x7c7224=squel[_0x36b1('0x17b')]()['field']('ui.'+_0x5af399+_0x36b1('0x17c'),'id')['field'](_0x36b1('0x17d'))[_0x36b1('0x73')](_0x36b1('0x17e')+_0x12d6b9+'_interactions','ui')[_0x36b1('0x44')](_0x36b1('0x17f'),_0x319fd8['id']);return db['sequelize'][_0x36b1('0x46')](_0x7c7224['toString'](),_0x464ca1)[_0x36b1('0x17')](function(_0x55f559){_0x319fd8[_0x5af399+_0x36b1('0x180')]=_0x55f559;_0x3d59ff(_0x55f559);})[_0x36b1('0x20')](function(_0x56bd4e){_0x47ab50(_0x56bd4e);});});}
\ No newline at end of file
index 7299fdc..c62fc90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c17=['save','update','remove','emit','exports','events','../../mysqldb','User','setMaxListeners'];(function(_0x16430b,_0x134480){var _0x387e85=function(_0x2e788d){while(--_0x2e788d){_0x16430b['push'](_0x16430b['shift']());}};_0x387e85(++_0x134480);}(_0x1c17,0x10a));var _0x71c1=function(_0x38a846,_0x117c7b){_0x38a846=_0x38a846-0x0;var _0x47a872=_0x1c17[_0x38a846];return _0x47a872;};'use strict';var EventEmitter=require(_0x71c1('0x0'));var User=require(_0x71c1('0x1'))['db'][_0x71c1('0x2')];var UserEvents=new EventEmitter();UserEvents[_0x71c1('0x3')](0x0);var events={'afterCreate':_0x71c1('0x4'),'afterUpdate':_0x71c1('0x5'),'afterDestroy':_0x71c1('0x6')};function emitEvent(_0x500885){return function(_0x454102,_0x1c3c73,_0x7fb16e){UserEvents[_0x71c1('0x7')](_0x500885+':'+_0x454102['id'],_0x454102);UserEvents[_0x71c1('0x7')](_0x500885,_0x454102);_0x7fb16e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];User['hook'](e,emitEvent(event));}}module[_0x71c1('0x8')]=UserEvents;
\ No newline at end of file
+var _0x633a=['events','User','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x16f69d,_0x21390a){var _0x4c0392=function(_0x37564e){while(--_0x37564e){_0x16f69d['push'](_0x16f69d['shift']());}};_0x4c0392(++_0x21390a);}(_0x633a,0x110));var _0xa633=function(_0x29706b,_0x5041d3){_0x29706b=_0x29706b-0x0;var _0x4068d8=_0x633a[_0x29706b];return _0x4068d8;};'use strict';var EventEmitter=require(_0xa633('0x0'));var User=require('../../mysqldb')['db'][_0xa633('0x1')];var UserEvents=new EventEmitter();UserEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa633('0x2'),'afterDestroy':_0xa633('0x3')};function emitEvent(_0x36f945){return function(_0x117aee,_0x586a7f,_0xdaae1e){UserEvents[_0xa633('0x4')](_0x36f945+':'+_0x117aee['id'],_0x117aee);UserEvents[_0xa633('0x4')](_0x36f945,_0x117aee);_0xdaae1e(null);};}for(var e in events){if(events[_0xa633('0x5')](e)){var event=events[e];User[_0xa633('0x6')](e,emitEvent(event));}}module[_0xa633('0x7')]=UserEvents;
\ No newline at end of file
index ec7e8ef..bea9643 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7eb=['_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','priority','then','catch','define','User','utf8_bin','userProfileId','UserProfile','find','privacyEnabled','updatePassword','changed','internal','concat','resolve','userSetting','createUserSetting','error','bulkCreate','chanspy','VoiceExtension','destroy','encryptPassword','function','randomBytes','base64','salt','pbkdf2Sync','sha1','toString','pbkdf2','indexOf','provider','Invalid\x20password','makeSalt','md5secret','bluebird','crypto','util','lodash','./user.attributes','google','length','context','from-sip','%s%s','push','merge','format','CDR(type)=%s','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','password','ChanSpy','SIP/%s,%s','name','options','join','record','wav','WAV','gsm','system','Set','CDR(type)=internal','extensionMonitor','includes'];(function(_0x89f587,_0x2ac259){var _0x2c3bb2=function(_0x42e0dc){while(--_0x42e0dc){_0x89f587['push'](_0x89f587['shift']());}};_0x2c3bb2(++_0x2ac259);}(_0xd7eb,0x107));var _0xbd7e=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xd7eb[_0x4a53d];return _0x27410e;};'use strict';var BPromise=require(_0xbd7e('0x0'));var crypto=require(_0xbd7e('0x1'));var util=require(_0xbd7e('0x2'));var md5=require('md5');var _=require(_0xbd7e('0x3'));var attributes=require(_0xbd7e('0x4'));var authTypes=[_0xbd7e('0x5')];var validatePresenceOf=function(_0xf395ea){return _0xf395ea&&_0xf395ea[_0xbd7e('0x6')];};var getChanSpyApplications=function(_0xd670ca,_0x40fc93,_0x5421c4){var _0x141768={'context':_0xd670ca[_0xbd7e('0x7')]||_0xbd7e('0x8'),'type':'system','isApp':![],'UserId':_0xd670ca['id']};var _0xdde680=[];for(var _0x416eb6=0x0,_0x53d8c4=0x1;_0x416eb6<_0x5421c4['length'];_0x416eb6++,_0x53d8c4=0x1){var _0x3d8d5b={'exten':util['format'](_0xbd7e('0x9'),_0x5421c4[_0x416eb6]['prefix'],_0x40fc93),'ChanSpyId':_0x5421c4[_0x416eb6]['id']};_0xdde680[_0xbd7e('0xa')](_[_0xbd7e('0xb')]({'app':'Set','appdata':util[_0xbd7e('0xc')](_0xbd7e('0xd'),'chanspy'),'priority':_0x53d8c4++},_0x141768,_0x3d8d5b));if(_0x5421c4[_0x416eb6]['record']){_0xdde680[_0xbd7e('0xa')](_[_0xbd7e('0xb')]({'app':_0xbd7e('0xe'),'appdata':util[_0xbd7e('0xc')](_0xbd7e('0xf'),_0x5421c4[_0x416eb6][_0xbd7e('0x10')]),'priority':_0x53d8c4++},_0x141768,_0x3d8d5b));}if(_0x5421c4[_0x416eb6][_0xbd7e('0x11')]){_0xdde680[_0xbd7e('0xa')](_[_0xbd7e('0xb')]({'app':'Authenticate','appdata':_0x5421c4[_0x416eb6][_0xbd7e('0x12')],'priority':_0x53d8c4++},_0x141768,_0x3d8d5b));}_0xdde680['push'](_[_0xbd7e('0xb')]({'app':_0xbd7e('0x13'),'appdata':util['format'](_0xbd7e('0x14'),_0xd670ca[_0xbd7e('0x15')],_0x5421c4[_0x416eb6][_0xbd7e('0x16')]?_0x5421c4[_0x416eb6]['options'][_0xbd7e('0x17')](''):''),'priority':_0x53d8c4++},_0x141768,_0x3d8d5b));if(_0x5421c4[_0x416eb6][_0xbd7e('0x18')]){_0xdde680['push'](_[_0xbd7e('0xb')]({'app':'StopMixMonitor','priority':_0x53d8c4++},_0x141768,_0x3d8d5b));}}return _0xdde680;};var getUserApplications=function(_0x343bd2,_0x1a800e){var _0x1d3ed8=[_0xbd7e('0x19'),_0xbd7e('0x1a'),_0xbd7e('0x1b')];var _0x4e31f2={'context':_0x343bd2[_0xbd7e('0x7')]||'from-sip','exten':_0x1a800e,'type':_0xbd7e('0x1c'),'isApp':![],'UserId':_0x343bd2['id']};var _0x6d2bcb=[{'app':_0xbd7e('0x1d'),'appdata':_0xbd7e('0x1e')}];if(_0x343bd2[_0xbd7e('0x1f')]&&_[_0xbd7e('0x20')](_0x1d3ed8,_0x343bd2[_0xbd7e('0x1f')])){_0x6d2bcb[_0xbd7e('0xa')]({'app':_0xbd7e('0x1d'),'appdata':_0xbd7e('0x21')});_0x6d2bcb[_0xbd7e('0xa')]({'app':_0xbd7e('0x1d'),'appdata':util[_0xbd7e('0xc')](_0xbd7e('0x22'),_0x343bd2['extensionMonitor'])});_0x6d2bcb[_0xbd7e('0xa')]({'app':_0xbd7e('0x23'),'appdata':util[_0xbd7e('0xc')](_0xbd7e('0x24'),_0x343bd2['name'])});}else{_0x6d2bcb['push']({'app':'Dial','appdata':util[_0xbd7e('0xc')](_0xbd7e('0x25'),_0x343bd2[_0xbd7e('0x15')])});}_0x6d2bcb['push']({'app':'Hangup'});for(var _0x2b83ac=0x0;_0x2b83ac<_0x6d2bcb['length'];_0x2b83ac++){_0x6d2bcb[_0x2b83ac][_0xbd7e('0x26')]=_0x2b83ac+0x1;_0x6d2bcb[_0x2b83ac]=_['defaults'](_0x6d2bcb[_0x2b83ac],_0x4e31f2);}return _0x6d2bcb;};var getChanSpyPromise=function(_0x27ec70,_0x2581de){return new BPromise(function(_0x13ef56,_0x56519e){return _0x27ec70['VoiceChanSpy']['findAll']()[_0xbd7e('0x27')](function(_0xa1f6d){if(_0xa1f6d){var _0x2ba606=getChanSpyApplications(_0x2581de,_0x2581de['internal'],_0xa1f6d);if(_0x2581de['internal']!=_0x2581de[_0xbd7e('0x15')]){_0x2ba606=_0x2ba606['concat'](getChanSpyApplications(_0x2581de,_0x2581de[_0xbd7e('0x15')],_0xa1f6d));}return _0x13ef56(_0x2ba606);}return _0x13ef56([]);})[_0xbd7e('0x28')](function(_0x7b0d0d){_0x56519e(_0x7b0d0d);});});};module['exports']=function(_0x1baa71){var _0x57be77=_0x1baa71['models'];return _0x1baa71[_0xbd7e('0x29')](_0xbd7e('0x2a'),attributes,{'tableName':'users','charset':'utf8','collate':_0xbd7e('0x2b'),'hooks':{'beforeCreate':function(_0x288158,_0xe7efd3,_0x558d2b){var _0x1776e6=typeof _0x288158[_0xbd7e('0x2c')]==='undefined'?BPromise['resolve'](null):_0x57be77[_0xbd7e('0x2d')][_0xbd7e('0x2e')]({'where':{'id':_0x288158[_0xbd7e('0x2c')]}});_0x1776e6[_0xbd7e('0x27')](function(_0x4d80bf){if(_0x4d80bf){_0x288158[_0xbd7e('0x2f')]=_0x4d80bf['privacyEnabled'];}})[_0xbd7e('0x27')](function(){_0x288158['updateMd5Password']();_0x288158[_0xbd7e('0x30')](_0x558d2b);})[_0xbd7e('0x28')](function(_0x1e03b9){_0x558d2b(_0x1e03b9);});},'beforeUpdate':function(_0xf54bd4,_0x307582,_0x366ca1){Promise['resolve']()[_0xbd7e('0x27')](function(){if(_0xf54bd4[_0xbd7e('0x31')]('userProfileId')===![])return;return _0x57be77['UserProfile']['find']({'where':{'id':_0xf54bd4[_0xbd7e('0x2c')]}})[_0xbd7e('0x27')](function(_0x47ec23){if(_0x47ec23)_0xf54bd4[_0xbd7e('0x2f')]=_0x47ec23['privacyEnabled'];return;});})[_0xbd7e('0x27')](function(){if(_0xf54bd4[_0xbd7e('0x31')]('password')){_0xf54bd4['updateMd5Password']();return _0xf54bd4['updatePassword'](_0x366ca1);}_0x366ca1();})['catch'](function(_0x4aca23){_0x366ca1(_0x4aca23);});},'afterCreate':function(_0x519f1f,_0x4c7d46,_0x527809){var _0x3edc8b=getUserApplications(_0x519f1f,_0x519f1f[_0xbd7e('0x32')]);if(_0x519f1f['internal']!=_0x519f1f['name']){_0x3edc8b=_0x3edc8b[_0xbd7e('0x33')](getUserApplications(_0x519f1f,_0x519f1f[_0xbd7e('0x15')]));}return Promise[_0xbd7e('0x34')]()[_0xbd7e('0x27')](function(){if(!_0x519f1f[_0xbd7e('0x35')]){return _0x519f1f[_0xbd7e('0x36')]({'clientSideLoggingLevel':_0xbd7e('0x37'),'clientSideLoggingEnabled':![]});}})[_0xbd7e('0x27')](function(){return _0x57be77['VoiceExtension'][_0xbd7e('0x38')](_0x3edc8b);})['then'](function(){if(_0x519f1f[_0xbd7e('0x39')]){return getChanSpyPromise(_0x57be77,_0x519f1f);}})['then'](function(_0x4692ea){if(_0x4692ea&&_0x4692ea[_0xbd7e('0x6')]){return _0x57be77[_0xbd7e('0x3a')][_0xbd7e('0x38')](_0x4692ea);}})[_0xbd7e('0x27')](function(){_0x527809();})[_0xbd7e('0x28')](function(_0x2d6a09){_0x527809(_0x2d6a09);});},'afterUpdate':function(_0x30e5a3,_0x23516c,_0x4a5eff){return BPromise[_0xbd7e('0x34')]()[_0xbd7e('0x27')](function(){if(_0x30e5a3[_0xbd7e('0x31')]('chanspy')||_0x30e5a3[_0xbd7e('0x31')]('context')){return _0x57be77[_0xbd7e('0x3a')][_0xbd7e('0x3b')]({'where':{'UserId':_0x30e5a3['id'],'type':_0xbd7e('0x1c'),'ChanSpyId':{'$ne':null}}})[_0xbd7e('0x27')](function(){if(_0x30e5a3[_0xbd7e('0x39')]){return getChanSpyPromise(_0x57be77,_0x30e5a3)[_0xbd7e('0x27')](function(_0x534e0b){if(_0x534e0b&&_0x534e0b[_0xbd7e('0x6')]){return _0x57be77[_0xbd7e('0x3a')][_0xbd7e('0x38')](_0x534e0b);}});}});}})[_0xbd7e('0x27')](function(){if(_0x30e5a3[_0xbd7e('0x31')](_0xbd7e('0x1f'))||_0x30e5a3['changed']('context')){return _0x57be77[_0xbd7e('0x3a')][_0xbd7e('0x3b')]({'where':{'UserId':_0x30e5a3['id'],'type':_0xbd7e('0x1c'),'ChanSpyId':null}})[_0xbd7e('0x27')](function(){var _0xedc2af=getUserApplications(_0x30e5a3,_0x30e5a3[_0xbd7e('0x32')]);if(_0x30e5a3[_0xbd7e('0x32')]!=_0x30e5a3[_0xbd7e('0x15')]){_0xedc2af=_0xedc2af['concat'](getUserApplications(_0x30e5a3,_0x30e5a3[_0xbd7e('0x15')]));}return _0x57be77['VoiceExtension'][_0xbd7e('0x38')](_0xedc2af);});}})[_0xbd7e('0x27')](function(){_0x4a5eff();})[_0xbd7e('0x28')](function(_0x42d0cd){_0x4a5eff(_0x42d0cd);});},'afterDestroy':function(_0x39b3c0){return _0x57be77['VoiceExtension'][_0xbd7e('0x3b')]({'where':{'UserId':_0x39b3c0['id'],'type':_0xbd7e('0x1c')}});}},'instanceMethods':{'authenticate':function(_0x2c8143,_0x1909e3){if(!_0x1909e3){return this[_0xbd7e('0x12')]===this[_0xbd7e('0x3c')](_0x2c8143);}var _0x50467=this;this[_0xbd7e('0x3c')](_0x2c8143,function(_0x3695a7,_0x657f0e){if(_0x3695a7){_0x1909e3(_0x3695a7);}if(_0x50467[_0xbd7e('0x12')]===_0x657f0e){_0x1909e3(null,!![]);}else{_0x1909e3(null,![]);}});},'makeSalt':function(_0x55730b,_0x5cfb8a){var _0x8be74e=0x10;if(typeof arguments[0x0]===_0xbd7e('0x3d')){_0x5cfb8a=arguments[0x0];_0x55730b=_0x8be74e;}else if(typeof arguments[0x1]===_0xbd7e('0x3d')){_0x5cfb8a=arguments[0x1];}else{throw new Error('Missing\x20Callback');}if(!_0x55730b){_0x55730b=_0x8be74e;}return crypto[_0xbd7e('0x3e')](_0x55730b,function(_0x20bfaf,_0x469592){if(_0x20bfaf){_0x5cfb8a(_0x20bfaf);}return _0x5cfb8a(null,_0x469592['toString'](_0xbd7e('0x3f')));});},'encryptPassword':function(_0x242878,_0x23fecc){if(!_0x242878||!this[_0xbd7e('0x40')]){return _0x23fecc?_0x23fecc(null):null;}var _0x1dab80=0x2710;var _0x35a20f=0x40;var _0xaca2cc=new Buffer(this['salt'],'base64');if(!_0x23fecc){return crypto[_0xbd7e('0x41')](_0x242878,_0xaca2cc,_0x1dab80,_0x35a20f,_0xbd7e('0x42'))[_0xbd7e('0x43')]('base64');}return crypto[_0xbd7e('0x44')](_0x242878,_0xaca2cc,_0x1dab80,_0x35a20f,_0xbd7e('0x42'),function(_0xb6d98b,_0x104baf){if(_0xb6d98b){_0x23fecc(_0xb6d98b);}return _0x23fecc(null,_0x104baf[_0xbd7e('0x43')]('base64'));});},'updatePassword':function(_0x2c22b5){if(!this[_0xbd7e('0x12')]){return _0x2c22b5(null);}if(!validatePresenceOf(this['password'])&&authTypes[_0xbd7e('0x45')](this[_0xbd7e('0x46')])===-0x1){_0x2c22b5(new Error(_0xbd7e('0x47')));}var _0x690459=this;this[_0xbd7e('0x48')](function(_0x319f00,_0x25eb63){if(_0x319f00){return _0x2c22b5(_0x319f00);}_0x690459[_0xbd7e('0x40')]=_0x25eb63;_0x690459[_0xbd7e('0x3c')](_0x690459[_0xbd7e('0x12')],function(_0x4c1750,_0x14283b){if(_0x4c1750){_0x2c22b5(_0x4c1750);}_0x690459['password']=_0x14283b;_0x2c22b5(null);});});},'updateMd5Password':function(){this['md5secret']=md5(this[_0xbd7e('0x15')]+':asterisk:'+this[_0xbd7e('0x12')]);return this[_0xbd7e('0x49')];}}});};
\ No newline at end of file
+var _0xb377=['salt','pbkdf2Sync','base64','pbkdf2','sha1','indexOf','provider','Invalid\x20password','md5secret','util','md5','./user.attributes','google','context','from-sip','system','format','%s%s','prefix','push','CDR(type)=%s','chanspy','merge','MixMonitor','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','options','join','record','wav','WAV','gsm','Set','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','name','SIP/%s,,tTxX','Hangup','length','priority','defaults','VoiceChanSpy','findAll','then','internal','concat','catch','define','User','utf8','userProfileId','undefined','resolve','find','privacyEnabled','updateMd5Password','updatePassword','changed','UserProfile','password','userSetting','error','VoiceExtension','bulkCreate','destroy','encryptPassword','function','Missing\x20Callback','toString'];(function(_0x48b28f,_0x44ba87){var _0x4d3cdd=function(_0x502e62){while(--_0x502e62){_0x48b28f['push'](_0x48b28f['shift']());}};_0x4d3cdd(++_0x44ba87);}(_0xb377,0xed));var _0x7b37=function(_0x32dd83,_0x2eda98){_0x32dd83=_0x32dd83-0x0;var _0x3be22f=_0xb377[_0x32dd83];return _0x3be22f;};'use strict';var BPromise=require('bluebird');var crypto=require('crypto');var util=require(_0x7b37('0x0'));var md5=require(_0x7b37('0x1'));var _=require('lodash');var attributes=require(_0x7b37('0x2'));var authTypes=[_0x7b37('0x3')];var validatePresenceOf=function(_0x407f9e){return _0x407f9e&&_0x407f9e['length'];};var getChanSpyApplications=function(_0x18393e,_0x4aecc8,_0x354dbb){var _0x3f6a80={'context':_0x18393e[_0x7b37('0x4')]||_0x7b37('0x5'),'type':_0x7b37('0x6'),'isApp':![],'UserId':_0x18393e['id']};var _0x42d4d0=[];for(var _0x3030e1=0x0,_0x9764de=0x1;_0x3030e1<_0x354dbb['length'];_0x3030e1++,_0x9764de=0x1){var _0x30fa52={'exten':util[_0x7b37('0x7')](_0x7b37('0x8'),_0x354dbb[_0x3030e1][_0x7b37('0x9')],_0x4aecc8),'ChanSpyId':_0x354dbb[_0x3030e1]['id']};_0x42d4d0[_0x7b37('0xa')](_['merge']({'app':'Set','appdata':util[_0x7b37('0x7')](_0x7b37('0xb'),_0x7b37('0xc')),'priority':_0x9764de++},_0x3f6a80,_0x30fa52));if(_0x354dbb[_0x3030e1]['record']){_0x42d4d0[_0x7b37('0xa')](_[_0x7b37('0xd')]({'app':_0x7b37('0xe'),'appdata':util[_0x7b37('0x7')]('${UNIQUEID}.%s,a',_0x354dbb[_0x3030e1][_0x7b37('0xf')]),'priority':_0x9764de++},_0x3f6a80,_0x30fa52));}if(_0x354dbb[_0x3030e1][_0x7b37('0x10')]){_0x42d4d0['push'](_[_0x7b37('0xd')]({'app':_0x7b37('0x11'),'appdata':_0x354dbb[_0x3030e1]['password'],'priority':_0x9764de++},_0x3f6a80,_0x30fa52));}_0x42d4d0[_0x7b37('0xa')](_[_0x7b37('0xd')]({'app':_0x7b37('0x12'),'appdata':util['format'](_0x7b37('0x13'),_0x18393e['name'],_0x354dbb[_0x3030e1][_0x7b37('0x14')]?_0x354dbb[_0x3030e1][_0x7b37('0x14')][_0x7b37('0x15')](''):''),'priority':_0x9764de++},_0x3f6a80,_0x30fa52));if(_0x354dbb[_0x3030e1][_0x7b37('0x16')]){_0x42d4d0[_0x7b37('0xa')](_['merge']({'app':'StopMixMonitor','priority':_0x9764de++},_0x3f6a80,_0x30fa52));}}return _0x42d4d0;};var getUserApplications=function(_0x4be120,_0x4968fa){var _0x208efa=[_0x7b37('0x17'),_0x7b37('0x18'),_0x7b37('0x19')];var _0x173e33={'context':_0x4be120['context']||'from-sip','exten':_0x4968fa,'type':_0x7b37('0x6'),'isApp':![],'UserId':_0x4be120['id']};var _0x4f3c9c=[{'app':_0x7b37('0x1a'),'appdata':'CDR(type)=internal'}];if(_0x4be120[_0x7b37('0x1b')]&&_[_0x7b37('0x1c')](_0x208efa,_0x4be120[_0x7b37('0x1b')])){_0x4f3c9c[_0x7b37('0xa')]({'app':'Set','appdata':_0x7b37('0x1d')});_0x4f3c9c[_0x7b37('0xa')]({'app':'Set','appdata':util[_0x7b37('0x7')](_0x7b37('0x1e'),_0x4be120['extensionMonitor'])});_0x4f3c9c[_0x7b37('0xa')]({'app':_0x7b37('0x1f'),'appdata':util[_0x7b37('0x7')](_0x7b37('0x20'),_0x4be120[_0x7b37('0x21')])});}else{_0x4f3c9c[_0x7b37('0xa')]({'app':'Dial','appdata':util[_0x7b37('0x7')](_0x7b37('0x22'),_0x4be120[_0x7b37('0x21')])});}_0x4f3c9c['push']({'app':_0x7b37('0x23')});for(var _0x5c8a68=0x0;_0x5c8a68<_0x4f3c9c[_0x7b37('0x24')];_0x5c8a68++){_0x4f3c9c[_0x5c8a68][_0x7b37('0x25')]=_0x5c8a68+0x1;_0x4f3c9c[_0x5c8a68]=_[_0x7b37('0x26')](_0x4f3c9c[_0x5c8a68],_0x173e33);}return _0x4f3c9c;};var getChanSpyPromise=function(_0x43ebae,_0xde48df){return new BPromise(function(_0x496a2a,_0x4199a8){return _0x43ebae[_0x7b37('0x27')][_0x7b37('0x28')]()[_0x7b37('0x29')](function(_0x3e4e9c){if(_0x3e4e9c){var _0x36ccf7=getChanSpyApplications(_0xde48df,_0xde48df[_0x7b37('0x2a')],_0x3e4e9c);if(_0xde48df[_0x7b37('0x2a')]!=_0xde48df[_0x7b37('0x21')]){_0x36ccf7=_0x36ccf7[_0x7b37('0x2b')](getChanSpyApplications(_0xde48df,_0xde48df['name'],_0x3e4e9c));}return _0x496a2a(_0x36ccf7);}return _0x496a2a([]);})[_0x7b37('0x2c')](function(_0x27862c){_0x4199a8(_0x27862c);});});};module['exports']=function(_0x35c387){var _0xd6c09f=_0x35c387['models'];return _0x35c387[_0x7b37('0x2d')](_0x7b37('0x2e'),attributes,{'tableName':'users','charset':_0x7b37('0x2f'),'collate':'utf8_bin','hooks':{'beforeCreate':function(_0x535f32,_0xabeb00,_0x332249){var _0x2b4e22=typeof _0x535f32[_0x7b37('0x30')]===_0x7b37('0x31')?BPromise[_0x7b37('0x32')](null):_0xd6c09f['UserProfile'][_0x7b37('0x33')]({'where':{'id':_0x535f32[_0x7b37('0x30')]}});_0x2b4e22[_0x7b37('0x29')](function(_0x1bc61b){if(_0x1bc61b){_0x535f32[_0x7b37('0x34')]=_0x1bc61b['privacyEnabled'];}})[_0x7b37('0x29')](function(){_0x535f32[_0x7b37('0x35')]();_0x535f32[_0x7b37('0x36')](_0x332249);})[_0x7b37('0x2c')](function(_0x27f584){_0x332249(_0x27f584);});},'beforeUpdate':function(_0x35c735,_0x50bbe9,_0xcf7781){Promise['resolve']()['then'](function(){if(_0x35c735[_0x7b37('0x37')](_0x7b37('0x30'))===![])return;return _0xd6c09f[_0x7b37('0x38')][_0x7b37('0x33')]({'where':{'id':_0x35c735['userProfileId']}})[_0x7b37('0x29')](function(_0x29ec1d){if(_0x29ec1d)_0x35c735[_0x7b37('0x34')]=_0x29ec1d[_0x7b37('0x34')];return;});})[_0x7b37('0x29')](function(){if(_0x35c735[_0x7b37('0x37')](_0x7b37('0x39'))){_0x35c735[_0x7b37('0x35')]();return _0x35c735[_0x7b37('0x36')](_0xcf7781);}_0xcf7781();})[_0x7b37('0x2c')](function(_0x52a267){_0xcf7781(_0x52a267);});},'afterCreate':function(_0x423c7a,_0x649e7d,_0xb4ac54){var _0x1ae44a=getUserApplications(_0x423c7a,_0x423c7a[_0x7b37('0x2a')]);if(_0x423c7a['internal']!=_0x423c7a[_0x7b37('0x21')]){_0x1ae44a=_0x1ae44a[_0x7b37('0x2b')](getUserApplications(_0x423c7a,_0x423c7a['name']));}return Promise['resolve']()['then'](function(){if(!_0x423c7a[_0x7b37('0x3a')]){return _0x423c7a['createUserSetting']({'clientSideLoggingLevel':_0x7b37('0x3b'),'clientSideLoggingEnabled':![]});}})[_0x7b37('0x29')](function(){return _0xd6c09f[_0x7b37('0x3c')][_0x7b37('0x3d')](_0x1ae44a);})[_0x7b37('0x29')](function(){if(_0x423c7a[_0x7b37('0xc')]){return getChanSpyPromise(_0xd6c09f,_0x423c7a);}})[_0x7b37('0x29')](function(_0x23b798){if(_0x23b798&&_0x23b798[_0x7b37('0x24')]){return _0xd6c09f[_0x7b37('0x3c')]['bulkCreate'](_0x23b798);}})[_0x7b37('0x29')](function(){_0xb4ac54();})[_0x7b37('0x2c')](function(_0x91533f){_0xb4ac54(_0x91533f);});},'afterUpdate':function(_0x4a5421,_0xdd486b,_0x5dd27f){return BPromise[_0x7b37('0x32')]()['then'](function(){if(_0x4a5421[_0x7b37('0x37')](_0x7b37('0xc'))||_0x4a5421[_0x7b37('0x37')](_0x7b37('0x4'))){return _0xd6c09f[_0x7b37('0x3c')][_0x7b37('0x3e')]({'where':{'UserId':_0x4a5421['id'],'type':'system','ChanSpyId':{'$ne':null}}})[_0x7b37('0x29')](function(){if(_0x4a5421[_0x7b37('0xc')]){return getChanSpyPromise(_0xd6c09f,_0x4a5421)[_0x7b37('0x29')](function(_0x16e320){if(_0x16e320&&_0x16e320[_0x7b37('0x24')]){return _0xd6c09f[_0x7b37('0x3c')]['bulkCreate'](_0x16e320);}});}});}})[_0x7b37('0x29')](function(){if(_0x4a5421['changed']('extensionMonitor')||_0x4a5421[_0x7b37('0x37')](_0x7b37('0x4'))){return _0xd6c09f[_0x7b37('0x3c')][_0x7b37('0x3e')]({'where':{'UserId':_0x4a5421['id'],'type':'system','ChanSpyId':null}})[_0x7b37('0x29')](function(){var _0x101588=getUserApplications(_0x4a5421,_0x4a5421[_0x7b37('0x2a')]);if(_0x4a5421[_0x7b37('0x2a')]!=_0x4a5421[_0x7b37('0x21')]){_0x101588=_0x101588['concat'](getUserApplications(_0x4a5421,_0x4a5421['name']));}return _0xd6c09f[_0x7b37('0x3c')]['bulkCreate'](_0x101588);});}})['then'](function(){_0x5dd27f();})[_0x7b37('0x2c')](function(_0x44479d){_0x5dd27f(_0x44479d);});},'afterDestroy':function(_0x51f8ac){return _0xd6c09f['VoiceExtension'][_0x7b37('0x3e')]({'where':{'UserId':_0x51f8ac['id'],'type':'system'}});}},'instanceMethods':{'authenticate':function(_0x51a115,_0x22d5bc){if(!_0x22d5bc){return this[_0x7b37('0x39')]===this[_0x7b37('0x3f')](_0x51a115);}var _0x495d05=this;this[_0x7b37('0x3f')](_0x51a115,function(_0x1598d7,_0x1fbe19){if(_0x1598d7){_0x22d5bc(_0x1598d7);}if(_0x495d05['password']===_0x1fbe19){_0x22d5bc(null,!![]);}else{_0x22d5bc(null,![]);}});},'makeSalt':function(_0x29bb34,_0x5b3fe3){var _0x31d40f=0x10;if(typeof arguments[0x0]===_0x7b37('0x40')){_0x5b3fe3=arguments[0x0];_0x29bb34=_0x31d40f;}else if(typeof arguments[0x1]===_0x7b37('0x40')){_0x5b3fe3=arguments[0x1];}else{throw new Error(_0x7b37('0x41'));}if(!_0x29bb34){_0x29bb34=_0x31d40f;}return crypto['randomBytes'](_0x29bb34,function(_0x52cf46,_0x37cfe5){if(_0x52cf46){_0x5b3fe3(_0x52cf46);}return _0x5b3fe3(null,_0x37cfe5[_0x7b37('0x42')]('base64'));});},'encryptPassword':function(_0x48b505,_0x409bce){if(!_0x48b505||!this[_0x7b37('0x43')]){return _0x409bce?_0x409bce(null):null;}var _0x5c1e03=0x2710;var _0x9bfdc5=0x40;var _0x468907=new Buffer(this[_0x7b37('0x43')],'base64');if(!_0x409bce){return crypto[_0x7b37('0x44')](_0x48b505,_0x468907,_0x5c1e03,_0x9bfdc5,'sha1')[_0x7b37('0x42')](_0x7b37('0x45'));}return crypto[_0x7b37('0x46')](_0x48b505,_0x468907,_0x5c1e03,_0x9bfdc5,_0x7b37('0x47'),function(_0xbfacba,_0x410561){if(_0xbfacba){_0x409bce(_0xbfacba);}return _0x409bce(null,_0x410561[_0x7b37('0x42')](_0x7b37('0x45')));});},'updatePassword':function(_0x55c08d){if(!this[_0x7b37('0x39')]){return _0x55c08d(null);}if(!validatePresenceOf(this[_0x7b37('0x39')])&&authTypes[_0x7b37('0x48')](this[_0x7b37('0x49')])===-0x1){_0x55c08d(new Error(_0x7b37('0x4a')));}var _0x2eeb6e=this;this['makeSalt'](function(_0x33050e,_0xa821ba){if(_0x33050e){return _0x55c08d(_0x33050e);}_0x2eeb6e[_0x7b37('0x43')]=_0xa821ba;_0x2eeb6e[_0x7b37('0x3f')](_0x2eeb6e[_0x7b37('0x39')],function(_0x416bd9,_0x842ed0){if(_0x416bd9){_0x55c08d(_0x416bd9);}_0x2eeb6e['password']=_0x842ed0;_0x55c08d(null);});});},'updateMd5Password':function(){this[_0x7b37('0x4b')]=md5(this['name']+':asterisk:'+this[_0x7b37('0x39')]);return this[_0x7b37('0x4b')];}}});};
\ No newline at end of file
index 2ddde42..ddd52e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ebd=['phone','loginInPause','count','../../config/license/util','getLicense','agents','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','LOGININPAUSE','bulkCreate','concat','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','info','User,\x20%s,\x20%s','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','GetUser','User','options','where','limit','include','map','model','attributes','then','debug','find','raw','ShowUser','PauseUser','name','internal','interface','UserVoiceQueueRt','update','findAll','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','body','type','DEFAULT\x20PAUSE','role','MemberReport','findOne','channel','Unknown\x20channel','voice','mail','chat','sms','openchannel','whatsapp','system','%s%s','Pause','all','LogoutUser','destroy','LoginUser','mobile'];(function(_0x235f49,_0x2992b4){var _0x551139=function(_0x35565c){while(--_0x35565c){_0x235f49['push'](_0x235f49['shift']());}};_0x551139(++_0x2992b4);}(_0x0ebd,0x1d0));var _0xd0eb=function(_0x5c7a9c,_0x24fd5b){_0x5c7a9c=_0x5c7a9c-0x0;var _0x3cdbb1=_0x0ebd[_0x5c7a9c];return _0x3cdbb1;};'use strict';var _=require(_0xd0eb('0x0'));var util=require(_0xd0eb('0x1'));var moment=require(_0xd0eb('0x2'));var BPromise=require(_0xd0eb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd0eb('0x4'));var db=require(_0xd0eb('0x5'))['db'];var utils=require(_0xd0eb('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd0eb('0x7'));var client=jayson[_0xd0eb('0x8')][_0xd0eb('0x9')]({'port':0x232a});config[_0xd0eb('0xa')]=_['defaults'](config[_0xd0eb('0xa')],{'host':_0xd0eb('0xb'),'port':0x18eb});var socket=require(_0xd0eb('0xc'))(new Redis(config[_0xd0eb('0xa')]));require('./user.socket')[_0xd0eb('0xd')](socket);function respondWithRpcPromise(_0x97aabf,_0x6ef9bc,_0x569f8e){return new BPromise(function(_0x3da184,_0xb3180d){return client[_0xd0eb('0xe')](_0x97aabf,_0x569f8e)['then'](function(_0x4ada23){logger[_0xd0eb('0xf')](_0xd0eb('0x10'),_0x6ef9bc,'request\x20sent');logger['debug'](_0xd0eb('0x11'),_0x6ef9bc,_0xd0eb('0x12'),JSON[_0xd0eb('0x13')](_0x4ada23));if(_0x4ada23[_0xd0eb('0x14')]){if(_0x4ada23[_0xd0eb('0x14')]['code']===0x1f4){logger[_0xd0eb('0x14')](_0xd0eb('0x10'),_0x6ef9bc,_0x4ada23[_0xd0eb('0x14')][_0xd0eb('0x15')]);return _0xb3180d(_0x4ada23['error'][_0xd0eb('0x15')]);}logger[_0xd0eb('0x14')]('User,\x20%s,\x20%s',_0x6ef9bc,_0x4ada23[_0xd0eb('0x14')][_0xd0eb('0x15')]);return _0x3da184(_0x4ada23[_0xd0eb('0x14')][_0xd0eb('0x15')]);}else{logger[_0xd0eb('0xf')](_0xd0eb('0x10'),_0x6ef9bc,_0xd0eb('0x12'));_0x3da184(_0x4ada23['result'][_0xd0eb('0x15')]);}})[_0xd0eb('0x16')](function(_0x4b8f85){logger['error'](_0xd0eb('0x10'),_0x6ef9bc,_0x4b8f85);_0xb3180d(_0x4b8f85);});});}exports[_0xd0eb('0x17')]=function(_0x462b45){var _0x1324a0=this;return new Promise(function(_0x476dd1,_0x2ce50d){return db[_0xd0eb('0x18')]['findAll']({'raw':_0x462b45[_0xd0eb('0x19')]?_0x462b45[_0xd0eb('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x462b45[_0xd0eb('0x19')]?_0x462b45[_0xd0eb('0x19')][_0xd0eb('0x1a')]||null:null,'attributes':_0x462b45[_0xd0eb('0x19')]?_0x462b45[_0xd0eb('0x19')]['attributes']||null:null,'limit':_0x462b45[_0xd0eb('0x19')]?_0x462b45['options'][_0xd0eb('0x1b')]||null:null,'include':_0x462b45[_0xd0eb('0x19')]?_0x462b45[_0xd0eb('0x19')][_0xd0eb('0x1c')]?_[_0xd0eb('0x1d')](_0x462b45[_0xd0eb('0x19')][_0xd0eb('0x1c')],function(_0x546d0f){return{'model':db[_0x546d0f[_0xd0eb('0x1e')]],'as':_0x546d0f['as'],'attributes':_0x546d0f['attributes'],'include':_0x546d0f[_0xd0eb('0x1c')]?_[_0xd0eb('0x1d')](_0x546d0f[_0xd0eb('0x1c')],function(_0x59ecab){return{'model':db[_0x59ecab[_0xd0eb('0x1e')]],'as':_0x59ecab['as'],'attributes':_0x59ecab[_0xd0eb('0x1f')],'include':_0x59ecab[_0xd0eb('0x1c')]?_['map'](_0x59ecab[_0xd0eb('0x1c')],function(_0x20ba62){return{'model':db[_0x20ba62[_0xd0eb('0x1e')]],'as':_0x20ba62['as'],'attributes':_0x20ba62['attributes']};}):[]};}):[]};}):[]:[]})[_0xd0eb('0x20')](function(_0x4691f2){logger['info'](_0xd0eb('0x17'),_0x462b45);logger[_0xd0eb('0x21')](_0xd0eb('0x17'),_0x462b45,JSON[_0xd0eb('0x13')](_0x4691f2));_0x476dd1(_0x4691f2);})[_0xd0eb('0x16')](function(_0x7cad97){logger['error'](_0xd0eb('0x17'),_0x7cad97[_0xd0eb('0x15')],_0x462b45);_0x2ce50d(_0x1324a0[_0xd0eb('0x14')](0x1f4,_0x7cad97[_0xd0eb('0x15')]));});});};exports['ShowUser']=function(_0x124a26){var _0x2e3df7=this;return new Promise(function(_0x401be0,_0x72f766){return db[_0xd0eb('0x18')][_0xd0eb('0x22')]({'raw':_0x124a26[_0xd0eb('0x19')]?_0x124a26[_0xd0eb('0x19')][_0xd0eb('0x23')]===undefined?!![]:![]:!![],'where':_0x124a26[_0xd0eb('0x19')]?_0x124a26[_0xd0eb('0x19')]['where']||null:null,'attributes':_0x124a26[_0xd0eb('0x19')]?_0x124a26['options'][_0xd0eb('0x1f')]||null:null,'include':_0x124a26[_0xd0eb('0x19')]?_0x124a26[_0xd0eb('0x19')][_0xd0eb('0x1c')]?_['map'](_0x124a26['options'][_0xd0eb('0x1c')],function(_0x12f928){return{'model':db[_0x12f928['model']],'as':_0x12f928['as'],'attributes':_0x12f928[_0xd0eb('0x1f')],'include':_0x12f928[_0xd0eb('0x1c')]?_[_0xd0eb('0x1d')](_0x12f928[_0xd0eb('0x1c')],function(_0x364173){return{'model':db[_0x364173[_0xd0eb('0x1e')]],'as':_0x364173['as'],'attributes':_0x364173['attributes'],'include':_0x364173[_0xd0eb('0x1c')]?_[_0xd0eb('0x1d')](_0x364173['include'],function(_0xe739eb){return{'model':db[_0xe739eb[_0xd0eb('0x1e')]],'as':_0xe739eb['as'],'attributes':_0xe739eb[_0xd0eb('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xd0eb('0x20')](function(_0x27a2b0){logger[_0xd0eb('0xf')](_0xd0eb('0x24'),_0x124a26);logger[_0xd0eb('0x21')](_0xd0eb('0x24'),_0x124a26,JSON[_0xd0eb('0x13')](_0x27a2b0));_0x401be0(_0x27a2b0);})['catch'](function(_0x54c370){logger[_0xd0eb('0x14')](_0xd0eb('0x24'),_0x54c370[_0xd0eb('0x15')],_0x124a26);_0x72f766(_0x2e3df7['error'](0x1f4,_0x54c370[_0xd0eb('0x15')]));});});};exports[_0xd0eb('0x25')]=function(_0x4ffc5c){var _0x455b04=this;return new Promise(function(_0x2e9f06,_0x2f38af){var _0x5e87bb;return db[_0xd0eb('0x18')][_0xd0eb('0x22')]({'where':_0x4ffc5c[_0xd0eb('0x19')][_0xd0eb('0x1a')]||{},'attributes':['id',_0xd0eb('0x26'),'role',_0xd0eb('0x27'),_0xd0eb('0x28')]})['then'](function(_0x372c2b){if(_0x372c2b){_0x5e87bb=_0x372c2b;return db[_0xd0eb('0x29')][_0xd0eb('0x2a')]({'paused':0x1},{'where':{'UserId':_0x5e87bb['id']},'individualHooks':!![]});}})['then'](function(){if(_0x5e87bb){return db['MemberReport'][_0xd0eb('0x2b')]({'where':{'membername':_0x5e87bb['name'],'type':_0xd0eb('0x2c'),'exitAt':null}});}})[_0xd0eb('0x20')](function(_0x3b2c8b){if(_0x5e87bb){if(_0x3b2c8b&&_0x3b2c8b['length']){var _0x3a5fd5=moment()[_0xd0eb('0x2d')](_0xd0eb('0x2e'));for(var _0x3f8a75=0x0,_0x362d33=_0x3b2c8b[_0xd0eb('0x2f')];_0x3f8a75<_0x362d33;_0x3f8a75++){_0x3b2c8b[_0x3f8a75][_0xd0eb('0x30')]({'exitAt':_0x3a5fd5});}}}})[_0xd0eb('0x20')](function(){if(_0x5e87bb){var _0x2f1dff=[];var _0x51f30e=utils[_0xd0eb('0x31')]();_0x51f30e[_0xd0eb('0x32')](function(_0x442558){_0x2f1dff[_0xd0eb('0x33')]({'channel':_0x442558,'membername':_0x5e87bb['name'],'interface':_[_0xd0eb('0x34')](_0x5e87bb[_0xd0eb('0x28')])?util[_0xd0eb('0x2d')](_0xd0eb('0x35'),_0x5e87bb[_0xd0eb('0x26')]):_0x5e87bb[_0xd0eb('0x28')],'type':_0xd0eb('0x2c'),'enterAt':moment()[_0xd0eb('0x2d')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x4ffc5c[_0xd0eb('0x36')][_0xd0eb('0x37')]||_0xd0eb('0x38'),'role':_0x5e87bb[_0xd0eb('0x39')],'internal':_0x5e87bb[_0xd0eb('0x27')],'uniqueid':_0x4ffc5c[_0xd0eb('0x36')]['uniqueid']||null});});return db[_0xd0eb('0x3a')]['bulkCreate'](_0x2f1dff,{'individualHooks':!![]});}})['then'](function(){if(_0x5e87bb){return _0x5e87bb[_0xd0eb('0x2a')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4ffc5c[_0xd0eb('0x36')][_0xd0eb('0x37')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0xd0eb('0x20')](function(_0x26ad00){_0x2e9f06(_0x26ad00);})[_0xd0eb('0x16')](function(_0x4e35d6){_0x2f38af(_0x455b04[_0xd0eb('0x14')](0x1f4,_0x4e35d6[_0xd0eb('0x15')]));});});};exports['UnpauseUser']=function(_0x1ef969){var _0x494e3b=this;return new Promise(function(_0x37b1cd,_0x2cceb5){var _0x631126;return db[_0xd0eb('0x18')][_0xd0eb('0x3b')]({'where':_0x1ef969[_0xd0eb('0x19')]['where']||{},'attributes':['id',_0xd0eb('0x26')]})['then'](function(_0x277d19){if(_0x277d19){_0x631126=_0x277d19;if(_0x1ef969[_0xd0eb('0x36')][_0xd0eb('0x3c')]&&!utils['isValidChannel'](_0x1ef969[_0xd0eb('0x36')]['channel'])){throw new Error(_0xd0eb('0x3d'));}switch(_0x1ef969[_0xd0eb('0x36')]['channel']){case _0xd0eb('0x3e'):return db[_0xd0eb('0x29')][_0xd0eb('0x2a')]({'paused':0x0},{'where':{'UserId':_0x631126['id']}})['then'](function(){return db['MemberReport'][_0xd0eb('0x22')]({'where':{'channel':_0x1ef969['body'][_0xd0eb('0x3c')],'membername':_0x631126[_0xd0eb('0x26')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x3b840c){if(_0x3b840c){return _0x3b840c[_0xd0eb('0x2a')]({'exitAt':moment()['format'](_0xd0eb('0x2e')),'data2':'system'},{'individualHooks':!![]});}return null;})[_0xd0eb('0x20')](function(){return _0x631126[_0xd0eb('0x2a')]({'voicePause':![]});});case _0xd0eb('0x3f'):case _0xd0eb('0x40'):case'fax':case _0xd0eb('0x41'):case _0xd0eb('0x42'):case _0xd0eb('0x43'):return db[_0xd0eb('0x3a')][_0xd0eb('0x22')]({'where':{'channel':_0x1ef969[_0xd0eb('0x36')][_0xd0eb('0x3c')],'membername':_0x631126[_0xd0eb('0x26')],'type':_0xd0eb('0x2c'),'exitAt':null}})[_0xd0eb('0x20')](function(_0x303d29){return _0x303d29[_0xd0eb('0x2a')]({'exitAt':moment()[_0xd0eb('0x2d')](_0xd0eb('0x2e')),'data2':_0xd0eb('0x44')},{'individualHooks':!![]});})[_0xd0eb('0x20')](function(){var _0x45bf62={};_['set'](_0x45bf62,util[_0xd0eb('0x2d')](_0xd0eb('0x45'),_0x1ef969[_0xd0eb('0x36')]['channel'],_0xd0eb('0x46')),![]);return _0x631126[_0xd0eb('0x2a')](_0x45bf62);});default:return db[_0xd0eb('0x29')][_0xd0eb('0x2a')]({'paused':0x0},{'where':{'UserId':_0x631126['id']}})['then'](function(){return db['MemberReport'][_0xd0eb('0x2b')]({'where':{'membername':_0x631126[_0xd0eb('0x26')],'type':_0xd0eb('0x2c'),'exitAt':null}});})[_0xd0eb('0x20')](function(_0x24ac29){var _0x198cd6=[];_0x24ac29[_0xd0eb('0x32')](function(_0x3d9b29){_0x198cd6[_0xd0eb('0x33')](_0x3d9b29[_0xd0eb('0x2a')]({'exitAt':moment()['format'](_0xd0eb('0x2e')),'data2':_0xd0eb('0x44')}));});return BPromise[_0xd0eb('0x47')](_0x198cd6);})[_0xd0eb('0x20')](function(){return _0x631126[_0xd0eb('0x2a')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0xd0eb('0x20')](function(_0x4f0349){_0x37b1cd(_0x4f0349);})[_0xd0eb('0x16')](function(_0x286874){_0x2cceb5(_0x494e3b[_0xd0eb('0x14')](0x1f4,_0x286874[_0xd0eb('0x15')]));});});};exports[_0xd0eb('0x48')]=function(_0x3243cc){var _0xa79a79=this;return new Promise(function(_0x488600,_0x2509df){var _0x513a91;return db[_0xd0eb('0x18')][_0xd0eb('0x3b')]({'where':_0x3243cc['options']['where']||{},'attributes':['id',_0xd0eb('0x26')]})[_0xd0eb('0x20')](function(_0x3ac7a1){if(_0x3ac7a1){_0x513a91=_0x3ac7a1;return db[_0xd0eb('0x29')][_0xd0eb('0x49')]({'where':{'membername':_0x513a91[_0xd0eb('0x26')]},'individualHooks':!![]});}})[_0xd0eb('0x20')](function(){if(_0x513a91){return db[_0xd0eb('0x3a')][_0xd0eb('0x2b')]({'where':{'membername':_0x513a91[_0xd0eb('0x26')],'exitAt':null}});}})[_0xd0eb('0x20')](function(_0x1d8693){if(_0x513a91){if(_0x1d8693&&_0x1d8693[_0xd0eb('0x2f')]){var _0x4c2d5a=[];_0x1d8693[_0xd0eb('0x32')](function(_0x3d440b){_0x4c2d5a[_0xd0eb('0x33')](_0x3d440b[_0xd0eb('0x2a')]({'exitAt':moment()[_0xd0eb('0x2d')](_0xd0eb('0x2e'))}));});return BPromise[_0xd0eb('0x47')](_0x4c2d5a);}}})[_0xd0eb('0x20')](function(){if(_0x513a91){return _0x513a91[_0xd0eb('0x2a')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xd0eb('0x20')](function(_0x46e1d2){_0x488600(_0x46e1d2);})[_0xd0eb('0x16')](function(_0x36eed6){_0x2509df(_0xa79a79[_0xd0eb('0x14')](0x1f4,_0x36eed6['message']));});});};exports[_0xd0eb('0x4a')]=function(_0x4da770){var _0x146920=this;return new Promise(function(_0x5d6cf6,_0x2b5ee6){var _0x33e0b5;var _0x5c479a;var _0x2fea38;var _0x56e82e;return db[_0xd0eb('0x18')][_0xd0eb('0x3b')]({'where':_0x4da770['options']['where']||{},'attributes':['id','name','role',_0xd0eb('0x4b'),_0xd0eb('0x4c'),_0xd0eb('0x27'),_0xd0eb('0x4d'),_0xd0eb('0x28')]})[_0xd0eb('0x20')](function(_0x2b7486){if(_0x2b7486){_0x33e0b5=_0x2b7486;_0x56e82e=_0x4da770[_0xd0eb('0x36')][_0xd0eb('0x28')]?_0x4da770[_0xd0eb('0x36')][_0xd0eb('0x28')]:util[_0xd0eb('0x2d')](_0xd0eb('0x35'),_0x33e0b5[_0xd0eb('0x26')]);return db[_0xd0eb('0x18')][_0xd0eb('0x4e')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x33e0b5['id']}}});}})['then'](function(_0x1bdc41){if(_0x1bdc41){_0x2fea38=_0x1bdc41;return require(_0xd0eb('0x4f'))[_0xd0eb('0x50')]();}})['then'](function(_0x9818bd){if(_0x9818bd&&_0x9818bd['agents']&&_0x2fea38>=_0x9818bd[_0xd0eb('0x51')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xd0eb('0x20')](function(){if(_0x33e0b5){return db[_0xd0eb('0x29')][_0xd0eb('0x49')]({'where':{'membername':_0x33e0b5['name']},'individualHooks':!![]});}})[_0xd0eb('0x20')](function(){if(_0x33e0b5){return _0x33e0b5[_0xd0eb('0x52')]({'raw':!![]});}})[_0xd0eb('0x20')](function(_0x313f53){if(_0x33e0b5){if(_0x313f53){var _0x2a0f57=[];_0x5c479a=_0x313f53;if(_0x5c479a[_0xd0eb('0x2f')]){for(var _0x1a7bfd=0x0;_0x1a7bfd<_0x5c479a[_0xd0eb('0x2f')];_0x1a7bfd++){_0x2a0f57[_0xd0eb('0x33')](db[_0xd0eb('0x29')][_0xd0eb('0x53')]({'membername':_0x33e0b5[_0xd0eb('0x26')],'UserId':_0x33e0b5['id'],'queue_name':_0x5c479a[_0x1a7bfd][_0xd0eb('0x26')],'VoiceQueueId':_0x5c479a[_0x1a7bfd]['id'],'interface':_0x56e82e,'paused':_0x33e0b5[_0xd0eb('0x4d')]||![],'penalty':_0x5c479a[_0x1a7bfd][_0xd0eb('0x54')]||0x0}));}return BPromise[_0xd0eb('0x47')](_0x2a0f57);}}}})[_0xd0eb('0x20')](function(){if(_0x33e0b5){return db[_0xd0eb('0x3a')][_0xd0eb('0x2b')]({'where':{'membername':_0x33e0b5['name'],'exitAt':null}});}})[_0xd0eb('0x20')](function(_0x2ace56){if(_0x33e0b5){if(_0x2ace56&&_0x2ace56[_0xd0eb('0x2f')]){var _0x436057=[];_0x2ace56[_0xd0eb('0x32')](function(_0x1fbcd2){_0x436057[_0xd0eb('0x33')](_0x1fbcd2[_0xd0eb('0x2a')]({'exitAt':moment()[_0xd0eb('0x2d')](_0xd0eb('0x2e'))}));});return BPromise['all'](_0x436057);}}})[_0xd0eb('0x20')](function(_0x5640ff){if(_0x33e0b5){var _0x528332=[];var _0x192b3f=[];var _0x23c1d1=utils[_0xd0eb('0x31')]();var _0x5ff7cf={'membername':_0x33e0b5[_0xd0eb('0x26')],'interface':_0x56e82e,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x33e0b5['role'],'internal':_0x33e0b5[_0xd0eb('0x27')]};_0x23c1d1['forEach'](function(_0x29d30b){_0x528332[_0xd0eb('0x33')](_[_0xd0eb('0x55')]({'channel':_0x29d30b,'type':_0xd0eb('0x56'),'data1':'callysquare','data2':_0x56e82e},_0x5ff7cf));if(_0x33e0b5['loginInPause']){_0x192b3f[_0xd0eb('0x33')](_[_0xd0eb('0x55')]({'channel':_0x29d30b,'type':_0xd0eb('0x2c'),'data1':_0xd0eb('0x57')},_0x5ff7cf));}});return db['MemberReport'][_0xd0eb('0x58')](_0x528332[_0xd0eb('0x59')](_0x192b3f),{'individualHooks':!![]});}})[_0xd0eb('0x20')](function(){if(_0x33e0b5){return _0x33e0b5['update']({'online':!![],'lastLoginAt':moment()['format'](_0xd0eb('0x2e')),'voicePause':_0x33e0b5[_0xd0eb('0x4d')]||![],'mailPause':_0x33e0b5[_0xd0eb('0x4d')]||![],'chatPause':_0x33e0b5[_0xd0eb('0x4d')]||![],'faxPause':_0x33e0b5[_0xd0eb('0x4d')]||![],'smsPause':_0x33e0b5[_0xd0eb('0x4d')]||![],'openchannelPause':_0x33e0b5[_0xd0eb('0x4d')]||![],'pauseType':_0x33e0b5[_0xd0eb('0x4d')]?_0xd0eb('0x57'):null,'lastPauseAt':moment()[_0xd0eb('0x2d')](_0xd0eb('0x2e')),'interface':_0x56e82e});}})[_0xd0eb('0x20')](function(_0xd70ba7){_0x5d6cf6(_0xd70ba7);})[_0xd0eb('0x16')](function(_0x493a1c){_0x2b5ee6(_0x146920[_0xd0eb('0x14')](0x1f4,_0x493a1c[_0xd0eb('0x15')]));});});};
\ No newline at end of file
+var _0x6f25=['LogoutUser','destroy','mobile','loginInPause','SIP/%s','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','User','findAll','options','raw','attributes','include','map','model','debug','GetUser','catch','ShowUser','find','where','PauseUser','name','role','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','forEach','push','isNil','format','type','uniqueid','bulkCreate','DEFAULT\x20PAUSE','UnpauseUser','findOne','body','channel','isValidChannel','system','mail','chat','fax','sms','openchannel','whatsapp','set','all'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x6f25,0x1d3));var _0x56f2=function(_0x209cce,_0x38da1c){_0x209cce=_0x209cce-0x0;var _0x5e0fa9=_0x6f25[_0x209cce];return _0x5e0fa9;};'use strict';var _=require(_0x56f2('0x0'));var util=require('util');var moment=require(_0x56f2('0x1'));var BPromise=require(_0x56f2('0x2'));var rs=require(_0x56f2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x56f2('0x4'))['db'];var utils=require(_0x56f2('0x5'));var logger=require(_0x56f2('0x6'))(_0x56f2('0x7'));var config=require(_0x56f2('0x8'));var jayson=require(_0x56f2('0x9'));var client=jayson['client'][_0x56f2('0xa')]({'port':0x232a});config[_0x56f2('0xb')]=_[_0x56f2('0xc')](config[_0x56f2('0xb')],{'host':_0x56f2('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x56f2('0xb')]));require('./user.socket')[_0x56f2('0xe')](socket);function respondWithRpcPromise(_0x3a6d74,_0x17b020,_0x96f51f){return new BPromise(function(_0x413f77,_0x223a90){return client['request'](_0x3a6d74,_0x96f51f)[_0x56f2('0xf')](function(_0x4c2599){logger[_0x56f2('0x10')](_0x56f2('0x11'),_0x17b020,_0x56f2('0x12'));logger['debug'](_0x56f2('0x13'),_0x17b020,'request\x20sent',JSON[_0x56f2('0x14')](_0x4c2599));if(_0x4c2599[_0x56f2('0x15')]){if(_0x4c2599['error'][_0x56f2('0x16')]===0x1f4){logger[_0x56f2('0x15')](_0x56f2('0x11'),_0x17b020,_0x4c2599[_0x56f2('0x15')]['message']);return _0x223a90(_0x4c2599['error'][_0x56f2('0x17')]);}logger[_0x56f2('0x15')](_0x56f2('0x11'),_0x17b020,_0x4c2599['error']['message']);return _0x413f77(_0x4c2599[_0x56f2('0x15')]['message']);}else{logger['info'](_0x56f2('0x11'),_0x17b020,_0x56f2('0x12'));_0x413f77(_0x4c2599[_0x56f2('0x18')][_0x56f2('0x17')]);}})['catch'](function(_0x55ef56){logger[_0x56f2('0x15')](_0x56f2('0x11'),_0x17b020,_0x55ef56);_0x223a90(_0x55ef56);});});}exports['GetUser']=function(_0x49cf1d){var _0x2a8795=this;return new Promise(function(_0x2a8a02,_0x736145){return db[_0x56f2('0x19')][_0x56f2('0x1a')]({'raw':_0x49cf1d[_0x56f2('0x1b')]?_0x49cf1d[_0x56f2('0x1b')][_0x56f2('0x1c')]===undefined?!![]:![]:!![],'where':_0x49cf1d[_0x56f2('0x1b')]?_0x49cf1d[_0x56f2('0x1b')]['where']||null:null,'attributes':_0x49cf1d['options']?_0x49cf1d[_0x56f2('0x1b')][_0x56f2('0x1d')]||null:null,'limit':_0x49cf1d[_0x56f2('0x1b')]?_0x49cf1d[_0x56f2('0x1b')]['limit']||null:null,'include':_0x49cf1d[_0x56f2('0x1b')]?_0x49cf1d['options'][_0x56f2('0x1e')]?_[_0x56f2('0x1f')](_0x49cf1d[_0x56f2('0x1b')][_0x56f2('0x1e')],function(_0xdbaf95){return{'model':db[_0xdbaf95[_0x56f2('0x20')]],'as':_0xdbaf95['as'],'attributes':_0xdbaf95[_0x56f2('0x1d')],'include':_0xdbaf95['include']?_[_0x56f2('0x1f')](_0xdbaf95[_0x56f2('0x1e')],function(_0x1a621e){return{'model':db[_0x1a621e[_0x56f2('0x20')]],'as':_0x1a621e['as'],'attributes':_0x1a621e[_0x56f2('0x1d')],'include':_0x1a621e[_0x56f2('0x1e')]?_['map'](_0x1a621e[_0x56f2('0x1e')],function(_0x3b1884){return{'model':db[_0x3b1884[_0x56f2('0x20')]],'as':_0x3b1884['as'],'attributes':_0x3b1884[_0x56f2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x56f2('0xf')](function(_0x1651fc){logger[_0x56f2('0x10')]('GetUser',_0x49cf1d);logger[_0x56f2('0x21')](_0x56f2('0x22'),_0x49cf1d,JSON['stringify'](_0x1651fc));_0x2a8a02(_0x1651fc);})[_0x56f2('0x23')](function(_0x468bb1){logger['error'](_0x56f2('0x22'),_0x468bb1[_0x56f2('0x17')],_0x49cf1d);_0x736145(_0x2a8795[_0x56f2('0x15')](0x1f4,_0x468bb1[_0x56f2('0x17')]));});});};exports[_0x56f2('0x24')]=function(_0x49c47c){var _0x349c5d=this;return new Promise(function(_0xc5da9,_0x3b7d66){return db[_0x56f2('0x19')][_0x56f2('0x25')]({'raw':_0x49c47c['options']?_0x49c47c['options'][_0x56f2('0x1c')]===undefined?!![]:![]:!![],'where':_0x49c47c[_0x56f2('0x1b')]?_0x49c47c[_0x56f2('0x1b')][_0x56f2('0x26')]||null:null,'attributes':_0x49c47c[_0x56f2('0x1b')]?_0x49c47c[_0x56f2('0x1b')][_0x56f2('0x1d')]||null:null,'include':_0x49c47c[_0x56f2('0x1b')]?_0x49c47c[_0x56f2('0x1b')][_0x56f2('0x1e')]?_[_0x56f2('0x1f')](_0x49c47c[_0x56f2('0x1b')][_0x56f2('0x1e')],function(_0x463a83){return{'model':db[_0x463a83[_0x56f2('0x20')]],'as':_0x463a83['as'],'attributes':_0x463a83[_0x56f2('0x1d')],'include':_0x463a83[_0x56f2('0x1e')]?_['map'](_0x463a83['include'],function(_0x14f06b){return{'model':db[_0x14f06b[_0x56f2('0x20')]],'as':_0x14f06b['as'],'attributes':_0x14f06b[_0x56f2('0x1d')],'include':_0x14f06b['include']?_['map'](_0x14f06b[_0x56f2('0x1e')],function(_0x15f82f){return{'model':db[_0x15f82f[_0x56f2('0x20')]],'as':_0x15f82f['as'],'attributes':_0x15f82f[_0x56f2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x56f2('0xf')](function(_0x2be91d){logger[_0x56f2('0x10')](_0x56f2('0x24'),_0x49c47c);logger[_0x56f2('0x21')]('ShowUser',_0x49c47c,JSON[_0x56f2('0x14')](_0x2be91d));_0xc5da9(_0x2be91d);})[_0x56f2('0x23')](function(_0x6d37a7){logger['error'](_0x56f2('0x24'),_0x6d37a7[_0x56f2('0x17')],_0x49c47c);_0x3b7d66(_0x349c5d[_0x56f2('0x15')](0x1f4,_0x6d37a7[_0x56f2('0x17')]));});});};exports[_0x56f2('0x27')]=function(_0x3265f2){var _0x47e491=this;return new Promise(function(_0x206c99,_0x3eb721){var _0x56a65c;return db[_0x56f2('0x19')][_0x56f2('0x25')]({'where':_0x3265f2[_0x56f2('0x1b')][_0x56f2('0x26')]||{},'attributes':['id',_0x56f2('0x28'),_0x56f2('0x29'),_0x56f2('0x2a'),_0x56f2('0x2b')]})[_0x56f2('0xf')](function(_0x1f9304){if(_0x1f9304){_0x56a65c=_0x1f9304;return db[_0x56f2('0x2c')][_0x56f2('0x2d')]({'paused':0x1},{'where':{'UserId':_0x56a65c['id']},'individualHooks':!![]});}})[_0x56f2('0xf')](function(){if(_0x56a65c){return db[_0x56f2('0x2e')]['findAll']({'where':{'membername':_0x56a65c[_0x56f2('0x28')],'type':_0x56f2('0x2f'),'exitAt':null}});}})[_0x56f2('0xf')](function(_0x35a215){if(_0x56a65c){if(_0x35a215&&_0x35a215[_0x56f2('0x30')]){var _0x127cad=moment()['format'](_0x56f2('0x31'));for(var _0x59fa1d=0x0,_0x40f225=_0x35a215[_0x56f2('0x30')];_0x59fa1d<_0x40f225;_0x59fa1d++){_0x35a215[_0x59fa1d][_0x56f2('0x32')]({'exitAt':_0x127cad});}}}})['then'](function(){if(_0x56a65c){var _0x3491de=[];var _0x450937=utils['getChannels']();_0x450937[_0x56f2('0x33')](function(_0xf189b3){_0x3491de[_0x56f2('0x34')]({'channel':_0xf189b3,'membername':_0x56a65c[_0x56f2('0x28')],'interface':_[_0x56f2('0x35')](_0x56a65c['interface'])?util[_0x56f2('0x36')]('SIP/%s',_0x56a65c[_0x56f2('0x28')]):_0x56a65c['interface'],'type':_0x56f2('0x2f'),'enterAt':moment()[_0x56f2('0x36')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x3265f2['body'][_0x56f2('0x37')]||'DEFAULT\x20PAUSE','role':_0x56a65c[_0x56f2('0x29')],'internal':_0x56a65c[_0x56f2('0x2a')],'uniqueid':_0x3265f2['body'][_0x56f2('0x38')]||null});});return db['MemberReport'][_0x56f2('0x39')](_0x3491de,{'individualHooks':!![]});}})[_0x56f2('0xf')](function(){if(_0x56a65c){return _0x56a65c[_0x56f2('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3265f2['body'][_0x56f2('0x37')]||_0x56f2('0x3a'),'lastPauseAt':moment()['format'](_0x56f2('0x31'))});}})[_0x56f2('0xf')](function(_0x343a72){_0x206c99(_0x343a72);})[_0x56f2('0x23')](function(_0x5c8a72){_0x3eb721(_0x47e491[_0x56f2('0x15')](0x1f4,_0x5c8a72['message']));});});};exports[_0x56f2('0x3b')]=function(_0x4086d3){var _0x11fef2=this;return new Promise(function(_0x504c04,_0x16f353){var _0xb877c2;return db[_0x56f2('0x19')][_0x56f2('0x3c')]({'where':_0x4086d3[_0x56f2('0x1b')][_0x56f2('0x26')]||{},'attributes':['id',_0x56f2('0x28')]})['then'](function(_0x5ddc3a){if(_0x5ddc3a){_0xb877c2=_0x5ddc3a;if(_0x4086d3[_0x56f2('0x3d')][_0x56f2('0x3e')]&&!utils[_0x56f2('0x3f')](_0x4086d3['body'][_0x56f2('0x3e')])){throw new Error('Unknown\x20channel');}switch(_0x4086d3[_0x56f2('0x3d')][_0x56f2('0x3e')]){case'voice':return db[_0x56f2('0x2c')]['update']({'paused':0x0},{'where':{'UserId':_0xb877c2['id']}})['then'](function(){return db[_0x56f2('0x2e')][_0x56f2('0x25')]({'where':{'channel':_0x4086d3[_0x56f2('0x3d')][_0x56f2('0x3e')],'membername':_0xb877c2[_0x56f2('0x28')],'type':'PAUSE','exitAt':null}});})[_0x56f2('0xf')](function(_0x190c68){if(_0x190c68){return _0x190c68[_0x56f2('0x2d')]({'exitAt':moment()[_0x56f2('0x36')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x56f2('0x40')},{'individualHooks':!![]});}return null;})[_0x56f2('0xf')](function(){return _0xb877c2['update']({'voicePause':![]});});case _0x56f2('0x41'):case _0x56f2('0x42'):case _0x56f2('0x43'):case _0x56f2('0x44'):case _0x56f2('0x45'):case _0x56f2('0x46'):return db[_0x56f2('0x2e')][_0x56f2('0x25')]({'where':{'channel':_0x4086d3[_0x56f2('0x3d')][_0x56f2('0x3e')],'membername':_0xb877c2[_0x56f2('0x28')],'type':'PAUSE','exitAt':null}})[_0x56f2('0xf')](function(_0x2420de){return _0x2420de['update']({'exitAt':moment()['format'](_0x56f2('0x31')),'data2':_0x56f2('0x40')},{'individualHooks':!![]});})[_0x56f2('0xf')](function(){var _0x32c829={};_[_0x56f2('0x47')](_0x32c829,util[_0x56f2('0x36')]('%s%s',_0x4086d3[_0x56f2('0x3d')]['channel'],'Pause'),![]);return _0xb877c2[_0x56f2('0x2d')](_0x32c829);});default:return db[_0x56f2('0x2c')][_0x56f2('0x2d')]({'paused':0x0},{'where':{'UserId':_0xb877c2['id']}})[_0x56f2('0xf')](function(){return db[_0x56f2('0x2e')][_0x56f2('0x1a')]({'where':{'membername':_0xb877c2[_0x56f2('0x28')],'type':_0x56f2('0x2f'),'exitAt':null}});})[_0x56f2('0xf')](function(_0x54f768){var _0x312b1c=[];_0x54f768[_0x56f2('0x33')](function(_0x737f83){_0x312b1c['push'](_0x737f83['update']({'exitAt':moment()[_0x56f2('0x36')](_0x56f2('0x31')),'data2':_0x56f2('0x40')}));});return BPromise[_0x56f2('0x48')](_0x312b1c);})[_0x56f2('0xf')](function(){return _0xb877c2[_0x56f2('0x2d')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x56f2('0xf')](function(_0x17fd4b){_0x504c04(_0x17fd4b);})['catch'](function(_0x3b8e2b){_0x16f353(_0x11fef2[_0x56f2('0x15')](0x1f4,_0x3b8e2b[_0x56f2('0x17')]));});});};exports[_0x56f2('0x49')]=function(_0x366b6e){var _0xac4582=this;return new Promise(function(_0x43011e,_0x23cdfc){var _0x210fd2;return db[_0x56f2('0x19')][_0x56f2('0x3c')]({'where':_0x366b6e[_0x56f2('0x1b')][_0x56f2('0x26')]||{},'attributes':['id',_0x56f2('0x28')]})[_0x56f2('0xf')](function(_0x28e7aa){if(_0x28e7aa){_0x210fd2=_0x28e7aa;return db[_0x56f2('0x2c')][_0x56f2('0x4a')]({'where':{'membername':_0x210fd2[_0x56f2('0x28')]},'individualHooks':!![]});}})[_0x56f2('0xf')](function(){if(_0x210fd2){return db[_0x56f2('0x2e')][_0x56f2('0x1a')]({'where':{'membername':_0x210fd2[_0x56f2('0x28')],'exitAt':null}});}})[_0x56f2('0xf')](function(_0x5a5c5e){if(_0x210fd2){if(_0x5a5c5e&&_0x5a5c5e[_0x56f2('0x30')]){var _0x3dfd35=[];_0x5a5c5e[_0x56f2('0x33')](function(_0x3244fc){_0x3dfd35['push'](_0x3244fc['update']({'exitAt':moment()['format'](_0x56f2('0x31'))}));});return BPromise['all'](_0x3dfd35);}}})['then'](function(){if(_0x210fd2){return _0x210fd2[_0x56f2('0x2d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x56f2('0xf')](function(_0x58acc6){_0x43011e(_0x58acc6);})[_0x56f2('0x23')](function(_0x1318d0){_0x23cdfc(_0xac4582[_0x56f2('0x15')](0x1f4,_0x1318d0['message']));});});};exports['LoginUser']=function(_0x1ac3c6){var _0x54369e=this;return new Promise(function(_0x599e36,_0x28790e){var _0x3d4024;var _0x262aef;var _0x116b63;var _0x230899;return db[_0x56f2('0x19')][_0x56f2('0x3c')]({'where':_0x1ac3c6['options']['where']||{},'attributes':['id',_0x56f2('0x28'),_0x56f2('0x29'),_0x56f2('0x4b'),'phone','internal',_0x56f2('0x4c'),'interface']})['then'](function(_0xfa743f){if(_0xfa743f){_0x3d4024=_0xfa743f;_0x230899=_0x1ac3c6[_0x56f2('0x3d')][_0x56f2('0x2b')]?_0x1ac3c6[_0x56f2('0x3d')]['interface']:util[_0x56f2('0x36')](_0x56f2('0x4d'),_0x3d4024['name']);return db['User']['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x3d4024['id']}}});}})[_0x56f2('0xf')](function(_0x13b6cf){if(_0x13b6cf){_0x116b63=_0x13b6cf;return require(_0x56f2('0x4e'))[_0x56f2('0x4f')]();}})['then'](function(_0x350e9b){if(_0x350e9b&&_0x350e9b[_0x56f2('0x50')]&&_0x116b63>=_0x350e9b[_0x56f2('0x50')]){throw new Error(_0x56f2('0x51'));}})[_0x56f2('0xf')](function(){if(_0x3d4024){return db[_0x56f2('0x2c')][_0x56f2('0x4a')]({'where':{'membername':_0x3d4024[_0x56f2('0x28')]},'individualHooks':!![]});}})[_0x56f2('0xf')](function(){if(_0x3d4024){return _0x3d4024[_0x56f2('0x52')]({'raw':!![]});}})[_0x56f2('0xf')](function(_0x1345e3){if(_0x3d4024){if(_0x1345e3){var _0x4e29c5=[];_0x262aef=_0x1345e3;if(_0x262aef[_0x56f2('0x30')]){for(var _0x13ee7f=0x0;_0x13ee7f<_0x262aef[_0x56f2('0x30')];_0x13ee7f++){_0x4e29c5['push'](db['UserVoiceQueueRt'][_0x56f2('0x53')]({'membername':_0x3d4024[_0x56f2('0x28')],'UserId':_0x3d4024['id'],'queue_name':_0x262aef[_0x13ee7f][_0x56f2('0x28')],'VoiceQueueId':_0x262aef[_0x13ee7f]['id'],'interface':_0x230899,'paused':_0x3d4024['loginInPause']||![],'penalty':_0x262aef[_0x13ee7f][_0x56f2('0x54')]||0x0}));}return BPromise[_0x56f2('0x48')](_0x4e29c5);}}}})[_0x56f2('0xf')](function(){if(_0x3d4024){return db['MemberReport'][_0x56f2('0x1a')]({'where':{'membername':_0x3d4024[_0x56f2('0x28')],'exitAt':null}});}})['then'](function(_0x447745){if(_0x3d4024){if(_0x447745&&_0x447745[_0x56f2('0x30')]){var _0x473ed9=[];_0x447745['forEach'](function(_0x3a5cb8){_0x473ed9[_0x56f2('0x34')](_0x3a5cb8[_0x56f2('0x2d')]({'exitAt':moment()[_0x56f2('0x36')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x56f2('0x48')](_0x473ed9);}}})[_0x56f2('0xf')](function(_0x12d52a){if(_0x3d4024){var _0x49120b=[];var _0x38066e=[];var _0x112866=utils['getChannels']();var _0x15e571={'membername':_0x3d4024[_0x56f2('0x28')],'interface':_0x230899,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x3d4024[_0x56f2('0x29')],'internal':_0x3d4024[_0x56f2('0x2a')]};_0x112866['forEach'](function(_0x4776a0){_0x49120b[_0x56f2('0x34')](_[_0x56f2('0x55')]({'channel':_0x4776a0,'type':_0x56f2('0x56'),'data1':_0x56f2('0x57'),'data2':_0x230899},_0x15e571));if(_0x3d4024[_0x56f2('0x4c')]){_0x38066e[_0x56f2('0x34')](_['merge']({'channel':_0x4776a0,'type':_0x56f2('0x2f'),'data1':_0x56f2('0x58')},_0x15e571));}});return db['MemberReport']['bulkCreate'](_0x49120b[_0x56f2('0x59')](_0x38066e),{'individualHooks':!![]});}})[_0x56f2('0xf')](function(){if(_0x3d4024){return _0x3d4024[_0x56f2('0x2d')]({'online':!![],'lastLoginAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x3d4024['loginInPause']||![],'mailPause':_0x3d4024[_0x56f2('0x4c')]||![],'chatPause':_0x3d4024[_0x56f2('0x4c')]||![],'faxPause':_0x3d4024[_0x56f2('0x4c')]||![],'smsPause':_0x3d4024[_0x56f2('0x4c')]||![],'openchannelPause':_0x3d4024[_0x56f2('0x4c')]||![],'pauseType':_0x3d4024[_0x56f2('0x4c')]?_0x56f2('0x58'):null,'lastPauseAt':moment()[_0x56f2('0x36')](_0x56f2('0x31')),'interface':_0x230899});}})[_0x56f2('0xf')](function(_0x276ba9){_0x599e36(_0x276ba9);})[_0x56f2('0x23')](function(_0x34bdfc){_0x28790e(_0x54369e['error'](0x1f4,_0x34bdfc[_0x56f2('0x17')]));});});};
\ No newline at end of file
index b50cb72..aa6fadb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02c3=['./user.events','remove','update','emit','removeListener','length','user:'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x02c3,0x7e));var _0x302c=function(_0x269557,_0x2c0d45){_0x269557=_0x269557-0x0;var _0x4e683a=_0x02c3[_0x269557];return _0x4e683a;};'use strict';var UserEvents=require(_0x302c('0x0'));var events=['save',_0x302c('0x1'),_0x302c('0x2')];function createListener(_0x408978,_0x2f00d4){return function(_0x52057d){_0x2f00d4[_0x302c('0x3')](_0x408978,_0x52057d);};}function removeListener(_0x5b577e,_0x3f41eb){return function(){UserEvents[_0x302c('0x4')](_0x5b577e,_0x3f41eb);};}exports['register']=function(_0x550bc4){for(var _0x4a5e72=0x0,_0x378970=events[_0x302c('0x5')];_0x4a5e72<_0x378970;_0x4a5e72++){var _0x13add1=events[_0x4a5e72];var _0x4de8b6=createListener(_0x302c('0x6')+_0x13add1,_0x550bc4);UserEvents['on'](_0x13add1,_0x4de8b6);}};
\ No newline at end of file
+var _0xec89=['update','emit','removeListener','user:','./user.events','save'];(function(_0x42ad75,_0x412e8c){var _0x4ca13c=function(_0x1984ff){while(--_0x1984ff){_0x42ad75['push'](_0x42ad75['shift']());}};_0x4ca13c(++_0x412e8c);}(_0xec89,0x1de));var _0x9ec8=function(_0x4c4c40,_0x78ec93){_0x4c4c40=_0x4c4c40-0x0;var _0x310dd4=_0xec89[_0x4c4c40];return _0x310dd4;};'use strict';var UserEvents=require(_0x9ec8('0x0'));var events=[_0x9ec8('0x1'),'remove',_0x9ec8('0x2')];function createListener(_0x4df73d,_0x21395c){return function(_0x367133){_0x21395c[_0x9ec8('0x3')](_0x4df73d,_0x367133);};}function removeListener(_0x19f014,_0x3466d9){return function(){UserEvents[_0x9ec8('0x4')](_0x19f014,_0x3466d9);};}exports['register']=function(_0x4633e9){for(var _0x338e37=0x0,_0x31e32e=events['length'];_0x338e37<_0x31e32e;_0x338e37++){var _0x54575c=events[_0x338e37];var _0x576d8a=createListener(_0x9ec8('0x5')+_0x54575c,_0x4633e9);UserEvents['on'](_0x54575c,_0x576d8a);}};
\ No newline at end of file
index 9130059..fc1f893 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x335db2,_0x3e70f6){var _0x410499=function(_0x47a829){while(--_0x47a829){_0x335db2['push'](_0x335db2['shift']());}};_0x410499(++_0x3e70f6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1cc9db,_0x302472){var _0x3b93dc=function(_0x1a27c4){while(--_0x1a27c4){_0x1cc9db['push'](_0x1cc9db['shift']());}};_0x3b93dc(++_0x302472);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x25fa5c,_0x421141){_0x25fa5c=_0x25fa5c-0x0;var _0x1bade2=_0xcb91[_0x25fa5c];return _0x1bade2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
index b07c8d6..476e7d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71f7=['exports','sequelize'];(function(_0x3899cb,_0xb95555){var _0x3fe239=function(_0x12a2dc){while(--_0x12a2dc){_0x3899cb['push'](_0x3899cb['shift']());}};_0x3fe239(++_0xb95555);}(_0x71f7,0x1a7));var _0x771f=function(_0x4fffcc,_0x43b26b){_0x4fffcc=_0x4fffcc-0x0;var _0x2f0a0f=_0x71f7[_0x4fffcc];return _0x2f0a0f;};'use strict';var Sequelize=require(_0x771f('0x0'));module[_0x771f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x7086=['INTEGER','sequelize','exports'];(function(_0x48bd63,_0x5f8e86){var _0x4eaade=function(_0x5cf196){while(--_0x5cf196){_0x48bd63['push'](_0x48bd63['shift']());}};_0x4eaade(++_0x5f8e86);}(_0x7086,0x115));var _0x6708=function(_0x5f6101,_0x1fa70e){_0x5f6101=_0x5f6101-0x0;var _0x288e73=_0x7086[_0x5f6101];return _0x288e73;};'use strict';var Sequelize=require(_0x6708('0x0'));module[_0x6708('0x1')]={'penalty':{'type':Sequelize[_0x6708('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 932e467..d555b52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c40=['rimraf','../../config/environment','exports','UserChatQueue','user_has_chat_queues','../../config/logger','bluebird','request-promise','path'];(function(_0x274d0f,_0x450d34){var _0x4c9bcc=function(_0x56213b){while(--_0x56213b){_0x274d0f['push'](_0x274d0f['shift']());}};_0x4c9bcc(++_0x450d34);}(_0x8c40,0x113));var _0x08c4=function(_0x55c499,_0x619fda){_0x55c499=_0x55c499-0x0;var _0x2d52be=_0x8c40[_0x55c499];return _0x2d52be;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x08c4('0x0'))('api');var moment=require('moment');var BPromise=require(_0x08c4('0x1'));var rp=require(_0x08c4('0x2'));var fs=require('fs');var path=require(_0x08c4('0x3'));var rimraf=require(_0x08c4('0x4'));var config=require(_0x08c4('0x5'));var attributes=require('./userChatQueue.attributes');module[_0x08c4('0x6')]=function(_0x267166,_0x4f6ea6){return _0x267166['define'](_0x08c4('0x7'),attributes,{'tableName':_0x08c4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcca8=['user_has_chat_queues','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','UserChatQueue'];(function(_0xaa0309,_0x1c8008){var _0x5de7ce=function(_0x3aa6ae){while(--_0x3aa6ae){_0xaa0309['push'](_0xaa0309['shift']());}};_0x5de7ce(++_0x1c8008);}(_0xcca8,0x137));var _0x8cca=function(_0x4dae00,_0x15b194){_0x4dae00=_0x4dae00-0x0;var _0x16bf42=_0xcca8[_0x4dae00];return _0x16bf42;};'use strict';var _=require(_0x8cca('0x0'));var util=require(_0x8cca('0x1'));var logger=require(_0x8cca('0x2'))('api');var moment=require(_0x8cca('0x3'));var BPromise=require('bluebird');var rp=require(_0x8cca('0x4'));var fs=require('fs');var path=require(_0x8cca('0x5'));var rimraf=require(_0x8cca('0x6'));var config=require(_0x8cca('0x7'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x143e7f,_0x317181){return _0x143e7f['define'](_0x8cca('0x8'),attributes,{'tableName':_0x8cca('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 77582c5..b4e061c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a61=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x205078,_0xcc9428){var _0x3e06b7=function(_0x413900){while(--_0x413900){_0x205078['push'](_0x205078['shift']());}};_0x3e06b7(++_0xcc9428);}(_0x1a61,0xb1));var _0x11a6=function(_0x7a8c89,_0x36470b){_0x7a8c89=_0x7a8c89-0x0;var _0x2244b7=_0x1a61[_0x7a8c89];return _0x2244b7;};'use strict';var _=require(_0x11a6('0x0'));var util=require('util');var moment=require(_0x11a6('0x1'));var BPromise=require(_0x11a6('0x2'));var rs=require(_0x11a6('0x3'));var fs=require('fs');var Redis=require(_0x11a6('0x4'));var db=require(_0x11a6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x11a6('0x6'))(_0x11a6('0x7'));var config=require('../../config/environment');var jayson=require(_0x11a6('0x8'));var client=jayson[_0x11a6('0x9')][_0x11a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d703b,_0x306849,_0x214003){return new BPromise(function(_0x15170b,_0x3dd25a){return client[_0x11a6('0xb')](_0x5d703b,_0x214003)[_0x11a6('0xc')](function(_0x3c5071){logger[_0x11a6('0xd')](_0x11a6('0xe'),_0x306849,'request\x20sent');logger[_0x11a6('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x306849,_0x11a6('0x10'),JSON[_0x11a6('0x11')](_0x3c5071));if(_0x3c5071[_0x11a6('0x12')]){if(_0x3c5071[_0x11a6('0x12')][_0x11a6('0x13')]===0x1f4){logger[_0x11a6('0x12')](_0x11a6('0xe'),_0x306849,_0x3c5071[_0x11a6('0x12')]['message']);return _0x3dd25a(_0x3c5071[_0x11a6('0x12')][_0x11a6('0x14')]);}logger[_0x11a6('0x12')](_0x11a6('0xe'),_0x306849,_0x3c5071[_0x11a6('0x12')][_0x11a6('0x14')]);return _0x15170b(_0x3c5071[_0x11a6('0x12')][_0x11a6('0x14')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x306849,_0x11a6('0x10'));_0x15170b(_0x3c5071['result'][_0x11a6('0x14')]);}})[_0x11a6('0x15')](function(_0x1344f5){logger[_0x11a6('0x12')](_0x11a6('0xe'),_0x306849,_0x1344f5);_0x3dd25a(_0x1344f5);});});}
\ No newline at end of file
+var _0xc6f4=['rpc','../../config/environment','client','http','then','info','UserChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x3c424f,_0x1c61c2){var _0x3fee82=function(_0xc78512){while(--_0xc78512){_0x3c424f['push'](_0x3c424f['shift']());}};_0x3fee82(++_0x1c61c2);}(_0xc6f4,0x15f));var _0x4c6f=function(_0x2f727b,_0x2b8006){_0x2f727b=_0x2f727b-0x0;var _0x27c001=_0xc6f4[_0x2f727b];return _0x27c001;};'use strict';var _=require('lodash');var util=require(_0x4c6f('0x0'));var moment=require('moment');var BPromise=require(_0x4c6f('0x1'));var rs=require(_0x4c6f('0x2'));var fs=require('fs');var Redis=require(_0x4c6f('0x3'));var db=require(_0x4c6f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c6f('0x5'))(_0x4c6f('0x6'));var config=require(_0x4c6f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4c6f('0x8')][_0x4c6f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c5954,_0x5a4e74,_0xe3dec7){return new BPromise(function(_0x36b092,_0x468a8d){return client['request'](_0x1c5954,_0xe3dec7)[_0x4c6f('0xa')](function(_0x534092){logger[_0x4c6f('0xb')](_0x4c6f('0xc'),_0x5a4e74,'request\x20sent');logger[_0x4c6f('0xd')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x5a4e74,_0x4c6f('0xe'),JSON[_0x4c6f('0xf')](_0x534092));if(_0x534092[_0x4c6f('0x10')]){if(_0x534092[_0x4c6f('0x10')][_0x4c6f('0x11')]===0x1f4){logger[_0x4c6f('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x5a4e74,_0x534092[_0x4c6f('0x10')]['message']);return _0x468a8d(_0x534092[_0x4c6f('0x10')][_0x4c6f('0x12')]);}logger['error'](_0x4c6f('0xc'),_0x5a4e74,_0x534092[_0x4c6f('0x10')][_0x4c6f('0x12')]);return _0x36b092(_0x534092[_0x4c6f('0x10')][_0x4c6f('0x12')]);}else{logger[_0x4c6f('0xb')]('UserChatQueue,\x20%s,\x20%s',_0x5a4e74,_0x4c6f('0xe'));_0x36b092(_0x534092[_0x4c6f('0x13')][_0x4c6f('0x12')]);}})[_0x4c6f('0x14')](function(_0x5495ec){logger['error'](_0x4c6f('0xc'),_0x5a4e74,_0x5495ec);_0x468a8d(_0x5495ec);});});}
\ No newline at end of file
index 84a5895..593c76b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5713e1,_0x436f86){var _0x5a3430=function(_0x30d2b9){while(--_0x30d2b9){_0x5713e1['push'](_0x5713e1['shift']());}};_0x5a3430(++_0x436f86);}(_0xe706,0xa3));var _0x6e70=function(_0x5249be,_0x251784){_0x5249be=_0x5249be-0x0;var _0x19ba8e=_0xe706[_0x5249be];return _0x19ba8e;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1e1e39,_0x1b36f8){var _0x45cc43=function(_0xacebf5){while(--_0xacebf5){_0x1e1e39['push'](_0x1e1e39['shift']());}};_0x45cc43(++_0x1b36f8);}(_0x70e0,0x17b));var _0x070e=function(_0x1f4086,_0x2c5b1c){_0x1f4086=_0x1f4086-0x0;var _0x292ce6=_0x70e0[_0x1f4086];return _0x292ce6;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
index 6791259..41d7e44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x65ef=['sequelize','INTEGER'];(function(_0x4dd479,_0x26d87a){var _0x1b6807=function(_0x2bec19){while(--_0x2bec19){_0x4dd479['push'](_0x4dd479['shift']());}};_0x1b6807(++_0x26d87a);}(_0x65ef,0x74));var _0xf65e=function(_0x3ff9a3,_0x42daff){_0x3ff9a3=_0x3ff9a3-0x0;var _0x294ed4=_0x65ef[_0x3ff9a3];return _0x294ed4;};'use strict';var Sequelize=require(_0xf65e('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xf65e('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf65e('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x3f97=['INTEGER'];(function(_0x44a4c4,_0x440b0c){var _0x47adb8=function(_0xd43d22){while(--_0xd43d22){_0x44a4c4['push'](_0x44a4c4['shift']());}};_0x47adb8(++_0x440b0c);}(_0x3f97,0xdd));var _0x73f9=function(_0x2e9034,_0x4e9e83){_0x2e9034=_0x2e9034-0x0;var _0x1af1c1=_0x3f97[_0x2e9034];return _0x1af1c1;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x73f9('0x0')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
index fb1a5b7..66fdc59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4291=['bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','UserFaxQueue','lodash','util','../../config/logger','api','moment'];(function(_0x37b31e,_0x19f312){var _0x4e9867=function(_0x15f200){while(--_0x15f200){_0x37b31e['push'](_0x37b31e['shift']());}};_0x4e9867(++_0x19f312);}(_0x4291,0x8a));var _0x1429=function(_0x20196b,_0xe51c70){_0x20196b=_0x20196b-0x0;var _0x31a066=_0x4291[_0x20196b];return _0x31a066;};'use strict';var _=require(_0x1429('0x0'));var util=require(_0x1429('0x1'));var logger=require(_0x1429('0x2'))(_0x1429('0x3'));var moment=require(_0x1429('0x4'));var BPromise=require(_0x1429('0x5'));var rp=require(_0x1429('0x6'));var fs=require('fs');var path=require(_0x1429('0x7'));var rimraf=require(_0x1429('0x8'));var config=require(_0x1429('0x9'));var attributes=require(_0x1429('0xa'));module[_0x1429('0xb')]=function(_0x5dcb5f,_0x36b524){return _0x5dcb5f['define'](_0x1429('0xc'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x841c=['exports','define','UserFaxQueue','user_has_fax_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x354a8c,_0x3e0a8f){var _0x5cd677=function(_0x116eb3){while(--_0x116eb3){_0x354a8c['push'](_0x354a8c['shift']());}};_0x5cd677(++_0x3e0a8f);}(_0x841c,0xe5));var _0xc841=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x841c[_0x1b2ff7];return _0x31656a;};'use strict';var _=require('lodash');var util=require(_0xc841('0x0'));var logger=require(_0xc841('0x1'))(_0xc841('0x2'));var moment=require(_0xc841('0x3'));var BPromise=require(_0xc841('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userFaxQueue.attributes');module[_0xc841('0x5')]=function(_0x52471a,_0x1b6e62){return _0x52471a[_0xc841('0x6')](_0xc841('0x7'),attributes,{'tableName':_0xc841('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9f32cc3..0c6d387 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x796e=['util','moment','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','lodash'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0x796e,0x17b));var _0xe796=function(_0x25f1bf,_0x1c78d8){_0x25f1bf=_0x25f1bf-0x0;var _0x5705c1=_0x796e[_0x25f1bf];return _0x5705c1;};'use strict';var _=require(_0xe796('0x0'));var util=require(_0xe796('0x1'));var moment=require(_0xe796('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe796('0x3'));var db=require(_0xe796('0x4'))['db'];var utils=require(_0xe796('0x5'));var logger=require('../../config/logger')(_0xe796('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe796('0x7')][_0xe796('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x14bae6,_0x27f72e,_0x311e95){return new BPromise(function(_0x542b13,_0x46e1e8){return client[_0xe796('0x9')](_0x14bae6,_0x311e95)['then'](function(_0x4cb43b){logger[_0xe796('0xa')](_0xe796('0xb'),_0x27f72e,'request\x20sent');logger[_0xe796('0xc')](_0xe796('0xd'),_0x27f72e,'request\x20sent',JSON['stringify'](_0x4cb43b));if(_0x4cb43b[_0xe796('0xe')]){if(_0x4cb43b[_0xe796('0xe')][_0xe796('0xf')]===0x1f4){logger[_0xe796('0xe')](_0xe796('0xb'),_0x27f72e,_0x4cb43b[_0xe796('0xe')][_0xe796('0x10')]);return _0x46e1e8(_0x4cb43b[_0xe796('0xe')]['message']);}logger['error'](_0xe796('0xb'),_0x27f72e,_0x4cb43b[_0xe796('0xe')][_0xe796('0x10')]);return _0x542b13(_0x4cb43b[_0xe796('0xe')][_0xe796('0x10')]);}else{logger['info'](_0xe796('0xb'),_0x27f72e,_0xe796('0x11'));_0x542b13(_0x4cb43b[_0xe796('0x12')][_0xe796('0x10')]);}})['catch'](function(_0x414c3e){logger[_0xe796('0xe')](_0xe796('0xb'),_0x27f72e,_0x414c3e);_0x46e1e8(_0x414c3e);});});}
\ No newline at end of file
+var _0x8b2e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserFaxQueue,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4d77a4,_0x3be85a){var _0x15a00e=function(_0x3dc23b){while(--_0x3dc23b){_0x4d77a4['push'](_0x4d77a4['shift']());}};_0x15a00e(++_0x3be85a);}(_0x8b2e,0xc8));var _0xe8b2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b2e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe8b2('0x0'));var util=require(_0xe8b2('0x1'));var moment=require(_0xe8b2('0x2'));var BPromise=require(_0xe8b2('0x3'));var rs=require(_0xe8b2('0x4'));var fs=require('fs');var Redis=require(_0xe8b2('0x5'));var db=require(_0xe8b2('0x6'))['db'];var utils=require(_0xe8b2('0x7'));var logger=require(_0xe8b2('0x8'))(_0xe8b2('0x9'));var config=require(_0xe8b2('0xa'));var jayson=require(_0xe8b2('0xb'));var client=jayson[_0xe8b2('0xc')][_0xe8b2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x378284,_0x305a50,_0x341071){return new BPromise(function(_0xd9b9cd,_0x32d617){return client['request'](_0x378284,_0x341071)['then'](function(_0x18cc21){logger[_0xe8b2('0xe')](_0xe8b2('0xf'),_0x305a50,'request\x20sent');logger[_0xe8b2('0x10')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x305a50,_0xe8b2('0x11'),JSON['stringify'](_0x18cc21));if(_0x18cc21['error']){if(_0x18cc21[_0xe8b2('0x12')][_0xe8b2('0x13')]===0x1f4){logger[_0xe8b2('0x12')](_0xe8b2('0xf'),_0x305a50,_0x18cc21[_0xe8b2('0x12')][_0xe8b2('0x14')]);return _0x32d617(_0x18cc21[_0xe8b2('0x12')][_0xe8b2('0x14')]);}logger[_0xe8b2('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x305a50,_0x18cc21[_0xe8b2('0x12')][_0xe8b2('0x14')]);return _0xd9b9cd(_0x18cc21[_0xe8b2('0x12')]['message']);}else{logger[_0xe8b2('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x305a50,_0xe8b2('0x11'));_0xd9b9cd(_0x18cc21[_0xe8b2('0x15')][_0xe8b2('0x14')]);}})[_0xe8b2('0x16')](function(_0x38f4ff){logger['error'](_0xe8b2('0xf'),_0x305a50,_0x38f4ff);_0x32d617(_0x38f4ff);});});}
\ No newline at end of file
index b0e020f..cd2aa72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x628eee,_0x3f3fba){var _0x447718=function(_0x38112b){while(--_0x38112b){_0x628eee['push'](_0x628eee['shift']());}};_0x447718(++_0x3f3fba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x18c6a2,_0x447b47){var _0x845250=function(_0x4b6de0){while(--_0x4b6de0){_0x18c6a2['push'](_0x18c6a2['shift']());}};_0x845250(++_0x447b47);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x172ed7,_0x3d08fd){_0x172ed7=_0x172ed7-0x0;var _0xfa8f61=_0xcb91[_0x172ed7];return _0xfa8f61;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
index 884993a..229a868 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x126b=['INTEGER','sequelize'];(function(_0x53781f,_0xa86c3c){var _0x45ab83=function(_0x3a557a){while(--_0x3a557a){_0x53781f['push'](_0x53781f['shift']());}};_0x45ab83(++_0xa86c3c);}(_0x126b,0x171));var _0xb126=function(_0x3bc7dc,_0x4aaeb7){_0x3bc7dc=_0x3bc7dc-0x0;var _0x518fc4=_0x126b[_0x3bc7dc];return _0x518fc4;};'use strict';var Sequelize=require(_0xb126('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xb126('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xc80f=['sequelize','exports','INTEGER'];(function(_0x53e300,_0x4805ad){var _0x1120ed=function(_0x201e75){while(--_0x201e75){_0x53e300['push'](_0x53e300['shift']());}};_0x1120ed(++_0x4805ad);}(_0xc80f,0x7e));var _0xfc80=function(_0x43b319,_0x271336){_0x43b319=_0x43b319-0x0;var _0x5b95b1=_0xc80f[_0x43b319];return _0x5b95b1;};'use strict';var Sequelize=require(_0xfc80('0x0'));module[_0xfc80('0x1')]={'penalty':{'type':Sequelize[_0xfc80('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 68aa01e..8afa588 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3efc=['api','moment','request-promise','path','../../config/environment','./userMailQueue.attributes','define','user_has_mail_queues','lodash'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3efc,0xf2));var _0xc3ef=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3efc[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xc3ef('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc3ef('0x1'));var moment=require(_0xc3ef('0x2'));var BPromise=require('bluebird');var rp=require(_0xc3ef('0x3'));var fs=require('fs');var path=require(_0xc3ef('0x4'));var rimraf=require('rimraf');var config=require(_0xc3ef('0x5'));var attributes=require(_0xc3ef('0x6'));module['exports']=function(_0xf864b,_0x3f57a8){return _0xf864b[_0xc3ef('0x7')]('UserMailQueue',attributes,{'tableName':_0xc3ef('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0afe=['api','moment','bluebird','request-promise','path','rimraf','./userMailQueue.attributes','define','util','../../config/logger'];(function(_0x2e866f,_0x32ac48){var _0x2b8196=function(_0xac8c12){while(--_0xac8c12){_0x2e866f['push'](_0x2e866f['shift']());}};_0x2b8196(++_0x32ac48);}(_0x0afe,0x17a));var _0xe0af=function(_0x2ab202,_0x5a8f28){_0x2ab202=_0x2ab202-0x0;var _0x64b1be=_0x0afe[_0x2ab202];return _0x64b1be;};'use strict';var _=require('lodash');var util=require(_0xe0af('0x0'));var logger=require(_0xe0af('0x1'))(_0xe0af('0x2'));var moment=require(_0xe0af('0x3'));var BPromise=require(_0xe0af('0x4'));var rp=require(_0xe0af('0x5'));var fs=require('fs');var path=require(_0xe0af('0x6'));var rimraf=require(_0xe0af('0x7'));var config=require('../../config/environment');var attributes=require(_0xe0af('0x8'));module['exports']=function(_0x283696,_0xf5f6a6){return _0x283696[_0xe0af('0x9')]('UserMailQueue',attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0a2992d..2912f6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x4d2028,_0x2e20b2){var _0xad4246=function(_0x5d7650){while(--_0x5d7650){_0x4d2028['push'](_0x4d2028['shift']());}};_0xad4246(++_0x2e20b2);}(_0x00bb,0x1d8));var _0xb00b=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x00bb[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});}
\ No newline at end of file
+var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x324e79,_0x10bf24){var _0x15c660=function(_0x379201){while(--_0x379201){_0x324e79['push'](_0x324e79['shift']());}};_0x15c660(++_0x10bf24);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x00bb[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});}
\ No newline at end of file
index d6716e7..23d7b00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7277=['./userNotification.controller','isAuthenticated','sendUserNotification','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x7277,0x1b1));var _0x7727=function(_0x4a0b1f,_0x14e63e){_0x4a0b1f=_0x4a0b1f-0x0;var _0x4afbfa=_0x7277[_0x4a0b1f];return _0x4afbfa;};'use strict';var multer=require(_0x7727('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7727('0x1'));var router=express[_0x7727('0x2')]();var fs_extra=require(_0x7727('0x3'));var auth=require(_0x7727('0x4'));var interaction=require(_0x7727('0x5'));var config=require(_0x7727('0x6'));var controller=require(_0x7727('0x7'));router['post']('/',auth[_0x7727('0x8')](),controller[_0x7727('0x9')]);module[_0x7727('0xa')]=router;
\ No newline at end of file
+var _0x7263=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','post','isAuthenticated','sendUserNotification','exports'];(function(_0x4bc56d,_0x38edaa){var _0xdbff7d=function(_0x52b827){while(--_0x52b827){_0x4bc56d['push'](_0x4bc56d['shift']());}};_0xdbff7d(++_0x38edaa);}(_0x7263,0x6e));var _0x3726=function(_0x5cf1ed,_0x36ec12){_0x5cf1ed=_0x5cf1ed-0x0;var _0xe157d8=_0x7263[_0x5cf1ed];return _0xe157d8;};'use strict';var multer=require(_0x3726('0x0'));var util=require(_0x3726('0x1'));var path=require(_0x3726('0x2'));var timeout=require('connect-timeout');var express=require(_0x3726('0x3'));var router=express[_0x3726('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3726('0x5'));var interaction=require(_0x3726('0x6'));var config=require('../../config/environment');var controller=require('./userNotification.controller');router[_0x3726('0x7')]('/',auth[_0x3726('0x8')](),controller[_0x3726('0x9')]);module[_0x3726('0xa')]=router;
\ No newline at end of file
index 472065e..5bc6fc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9f2=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x16b77e,_0x4a56a3){var _0x3ae284=function(_0x5d2481){while(--_0x5d2481){_0x16b77e['push'](_0x16b77e['shift']());}};_0x3ae284(++_0x4a56a3);}(_0xb9f2,0x71));var _0x2b9f=function(_0x28a429,_0x157b0e){_0x28a429=_0x28a429-0x0;var _0x130976=_0xb9f2[_0x28a429];return _0x130976;};'use strict';var Sequelize=require(_0x2b9f('0x0'));module['exports']={'body':{'type':Sequelize[_0x2b9f('0x1')]},'senderName':{'type':Sequelize[_0x2b9f('0x2')]},'recipientsId':{'type':Sequelize[_0x2b9f('0x1')]},'recipientsDescription':{'type':Sequelize[_0x2b9f('0x2')]},'beep':{'type':Sequelize[_0x2b9f('0x3')]}};
\ No newline at end of file
+var _0x9fd3=['sequelize','exports','TEXT','STRING'];(function(_0x1a9dea,_0x3e44bf){var _0x4b3727=function(_0xf0d7c0){while(--_0xf0d7c0){_0x1a9dea['push'](_0x1a9dea['shift']());}};_0x4b3727(++_0x3e44bf);}(_0x9fd3,0x1d0));var _0x39fd=function(_0x41ae49,_0x2644ef){_0x41ae49=_0x41ae49-0x0;var _0x44dd24=_0x9fd3[_0x41ae49];return _0x44dd24;};'use strict';var Sequelize=require(_0x39fd('0x0'));module[_0x39fd('0x1')]={'body':{'type':Sequelize[_0x39fd('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x39fd('0x2')]},'recipientsDescription':{'type':Sequelize[_0x39fd('0x3')]},'beep':{'type':Sequelize['BOOLEAN']}};
\ No newline at end of file
index 86cc876..6174bfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49d3=['User','union','ids','queue','replace','Queue','push','all','flatten','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','redis','localhost','socket.io-emitter','./userNotification.socket','register','end','status','json','undefined','count','offset','limit','set','Content-Range','update','then','destroy','sendStatus','error','name','send','sendUserNotification','body','text','hasOwnProperty','TemplateId','Sequelize','ValidationError','view','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','forEach','startCase'];(function(_0xe11332,_0x3b7982){var _0x3deb84=function(_0x250f46){while(--_0x250f46){_0xe11332['push'](_0xe11332['shift']());}};_0x3deb84(++_0x3b7982);}(_0x49d3,0x6f));var _0x349d=function(_0x1ab638,_0x260a51){_0x1ab638=_0x1ab638-0x0;var _0x58618c=_0x49d3[_0x1ab638];return _0x58618c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x349d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x349d('0x1'));var rp=require(_0x349d('0x2'));var moment=require(_0x349d('0x3'));var BPromise=require(_0x349d('0x4'));var Mustache=require(_0x349d('0x5'));var util=require(_0x349d('0x6'));var path=require(_0x349d('0x7'));var sox=require(_0x349d('0x8'));var csv=require(_0x349d('0x9'));var ejs=require(_0x349d('0xa'));var fs=require('fs');var fs_extra=require(_0x349d('0xb'));var _=require(_0x349d('0xc'));var squel=require(_0x349d('0xd'));var crypto=require(_0x349d('0xe'));var jsforce=require(_0x349d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x349d('0x9'));var querystring=require(_0x349d('0x10'));var Papa=require(_0x349d('0x11'));var Redis=require(_0x349d('0x12'));var authService=require(_0x349d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x349d('0x14'));var hardwareService=require(_0x349d('0x15'));var logger=require('../../config/logger')(_0x349d('0x16'));var utils=require(_0x349d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x349d('0x18')]=_['defaults'](config[_0x349d('0x18')],{'host':_0x349d('0x19'),'port':0x18eb});var socket=require(_0x349d('0x1a'))(new Redis(config['redis']));require(_0x349d('0x1b'))[_0x349d('0x1c')](socket);function respondWithStatusCode(_0x5b8027,_0x41d1f5){_0x41d1f5=_0x41d1f5||0xcc;return function(_0x501995){if(_0x501995){return _0x5b8027['sendStatus'](_0x41d1f5);}return _0x5b8027['status'](_0x41d1f5)[_0x349d('0x1d')]();};}function respondWithResult(_0x54a0e5,_0x4f72ce){_0x4f72ce=_0x4f72ce||0xc8;return function(_0x12c072){if(_0x12c072){return _0x54a0e5[_0x349d('0x1e')](_0x4f72ce)[_0x349d('0x1f')](_0x12c072);}};}function respondWithFilteredResult(_0xcb0021,_0x251324){return function(_0x1cb27f){if(_0x1cb27f){var _0x312b61=typeof _0x251324['offset']==='undefined'&&typeof _0x251324['limit']===_0x349d('0x20');var _0x440688=_0x1cb27f[_0x349d('0x21')];var _0x212e69=_0x312b61?0x0:_0x251324['offset'];var _0x4583a0=_0x312b61?_0x1cb27f[_0x349d('0x21')]:_0x251324[_0x349d('0x22')]+_0x251324[_0x349d('0x23')];var _0x1400fe;if(_0x4583a0>=_0x440688){_0x4583a0=_0x440688;_0x1400fe=0xc8;}else{_0x1400fe=0xce;}_0xcb0021[_0x349d('0x1e')](_0x1400fe);return _0xcb0021[_0x349d('0x24')](_0x349d('0x25'),_0x212e69+'-'+_0x4583a0+'/'+_0x440688)['json'](_0x1cb27f);}return null;};}function patchUpdates(_0x20c219){return function(_0x27d0fa){try{jsonpatch['apply'](_0x27d0fa,_0x20c219,!![]);}catch(_0x1452ee){return BPromise['reject'](_0x1452ee);}return _0x27d0fa['save']();};}function saveUpdates(_0xd949df,_0x44b3a4){return function(_0x83b549){if(_0x83b549){return _0x83b549[_0x349d('0x26')](_0xd949df)[_0x349d('0x27')](function(_0xd2347e){return _0xd2347e;});}return null;};}function removeEntity(_0xcbf05b,_0x3f7602){return function(_0x2e24bf){if(_0x2e24bf){return _0x2e24bf[_0x349d('0x28')]()[_0x349d('0x27')](function(){_0xcbf05b[_0x349d('0x1e')](0xcc)[_0x349d('0x1d')]();});}};}function handleEntityNotFound(_0x193adf,_0x4e9501){return function(_0x1402e0){if(!_0x1402e0){_0x193adf[_0x349d('0x29')](0x194);}return _0x1402e0;};}function handleError(_0x178e81,_0x403581){_0x403581=_0x403581||0x1f4;return function(_0x6a4672){logger[_0x349d('0x2a')](_0x6a4672['stack']);if(_0x6a4672[_0x349d('0x2b')]){delete _0x6a4672[_0x349d('0x2b')];}_0x178e81[_0x349d('0x1e')](_0x403581)[_0x349d('0x2c')](_0x6a4672);};}exports[_0x349d('0x2d')]=function(_0x49bd8d,_0x4ef2eb,_0x10b836){if(!_0x49bd8d[_0x349d('0x2e')]['hasOwnProperty'](_0x349d('0x2f'))&&!_0x49bd8d[_0x349d('0x2e')][_0x349d('0x30')](_0x349d('0x31'))){throw new db[(_0x349d('0x32'))][(_0x349d('0x33'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x49bd8d[_0x349d('0x2e')][_0x349d('0x30')](_0x349d('0x31'))&&!_0x49bd8d['body']['hasOwnProperty'](_0x349d('0x34'))){throw new db[(_0x349d('0x32'))][(_0x349d('0x33'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x49bd8d[_0x349d('0x2e')][_0x349d('0x30')](_0x349d('0x35'))){throw new db[(_0x349d('0x32'))][(_0x349d('0x33'))](_0x349d('0x36'));}else{try{var _0x2d5370=JSON[_0x349d('0x37')](_0x49bd8d[_0x349d('0x2e')][_0x349d('0x35')]);}catch(_0x1818f9){logger[_0x349d('0x2a')](_0x1818f9);throw new db[(_0x349d('0x32'))][(_0x349d('0x33'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x1364db=[_0x349d('0x38'),_0x349d('0x39'),_0x349d('0x3a'),_0x349d('0x3b'),_0x349d('0x3c'),'voicequeue','whatsappqueue',_0x349d('0x3d'),_0x349d('0x3e')];if(_[_0x349d('0x3f')](_0x2d5370,function(_0x447d0d){return!_[_0x349d('0x40')](_0x1364db,_0x447d0d[_0x349d('0x41')][_0x349d('0x42')]());})){throw new db[(_0x349d('0x32'))]['ValidationError'](_0x349d('0x43'));}}}var _0xaca583={};_0xaca583[_0x349d('0x44')]=_0x49bd8d[_0x349d('0x2e')]['hasOwnProperty'](_0x349d('0x44'))?_0x49bd8d['body'][_0x349d('0x44')]:_0x49bd8d[_0x349d('0x3e')][_0x349d('0x45')];_0xaca583[_0x349d('0x46')]=_[_0x349d('0x47')](_0x49bd8d[_0x349d('0x2e')]['recipientsDescription'])?null:_0x49bd8d[_0x349d('0x2e')][_0x349d('0x46')];_0xaca583[_0x349d('0x48')]=_0x49bd8d[_0x349d('0x2e')][_0x349d('0x48')]||![];_0xaca583[_0x349d('0x49')]=_0x49bd8d[_0x349d('0x3e')]['id'];return getContent(_0x49bd8d[_0x349d('0x2e')])[_0x349d('0x27')](function(_0x4ffb9e){_0xaca583[_0x349d('0x2e')]=_0x4ffb9e;return getRecipients(_0x2d5370);})['then'](function(_0x5c9d46){_0xaca583[_0x349d('0x4a')]=_[_0x349d('0x4b')](_0x5c9d46)[_0x349d('0x4c')](',');return db[_0x349d('0x4d')][_0x349d('0x4e')](function(_0x4950c1){return db[_0x349d('0x4f')][_0x349d('0x50')](_0xaca583,{'raw':!![],'transaction':_0x4950c1})[_0x349d('0x27')](function(_0x39baa2){var _0x5c83bc={'sender':_0xaca583[_0x349d('0x44')],'description':_0xaca583[_0x349d('0x46')],'content':_0xaca583['body'],'beep':_0xaca583[_0x349d('0x48')]};_0x5c9d46['forEach'](function(_0x16b7db){_0x5c83bc['recipient']=_0x16b7db;socket[_0x349d('0x51')](_0x349d('0x52'),_0x5c83bc);});return _0x39baa2;});});})[_0x349d('0x27')](respondWithResult(_0x4ef2eb,0xc9))[_0x349d('0x53')](handleError(_0x4ef2eb,null));};function getContent(_0x59a7d3){return new BPromise(function(_0x5be304,_0x55ba05){if(_0x59a7d3[_0x349d('0x2f')]){_0x5be304(_0x59a7d3[_0x349d('0x2f')]);return;}return db[_0x349d('0x54')][_0x349d('0x55')]({'attributes':[_0x349d('0x56')],'where':{'id':_0x59a7d3[_0x349d('0x31')]},'raw':!![]})[_0x349d('0x27')](function(_0x3fd054){if(!_0x3fd054)throw new db['Sequelize'][(_0x349d('0x33'))](_0x349d('0x57'));var _0x2b5e8c=Mustache[_0x349d('0x58')](_0x3fd054[_0x349d('0x56')],_0x59a7d3['view']);_0x5be304(_0x2b5e8c);})[_0x349d('0x53')](function(_0xa640de){_0x55ba05(_0xa640de);});});}function getRecipients(_0x119551){return new BPromise(function(_0x352c00,_0x222261){var _0x1621e3=[];var _0x1bd120=[];_0x119551[_0x349d('0x59')](function(_0x2bbfeb){var _0x46a9d2=_[_0x349d('0x5a')](_0x2bbfeb[_0x349d('0x41')][_0x349d('0x42')]());if(_0x46a9d2===_0x349d('0x5b')){_0x1621e3=_[_0x349d('0x5c')](_0x1621e3,_0x2bbfeb[_0x349d('0x5d')]);}else{if(_[_0x349d('0x40')](_0x46a9d2,_0x349d('0x5e')))_0x46a9d2=_0x46a9d2[_0x349d('0x5f')](_0x349d('0x5e'),_0x349d('0x60'));_0x2bbfeb[_0x349d('0x5d')]['forEach'](function(_0x234527){_0x1bd120[_0x349d('0x61')](getAgents(_0x46a9d2,_0x234527));});}});return BPromise[_0x349d('0x62')](_0x1bd120)[_0x349d('0x27')](function(_0x7b4c){_0x1621e3=_[_0x349d('0x5c')](_0x1621e3,_[_0x349d('0x63')](_0x7b4c));_0x352c00(_0x1621e3);})[_0x349d('0x53')](function(_0x3efcca){_0x222261(_0x3efcca);});});}function getAgents(_0x43a254,_0x5afc6c){return new BPromise(function(_0x5db45c,_0x2a5b9a){return db[_0x43a254][_0x349d('0x55')]({'where':{'id':_0x5afc6c}})[_0x349d('0x27')](function(_0x351f45){return _0x351f45[_0x349d('0x64')]({'attributes':['id'],'raw':!![]})['then'](function(_0x371dc3){var _0x236bef=_['map'](_0x371dc3,'id');_0x5db45c(_0x236bef);});})[_0x349d('0x53')](function(_0x5c09bd){_0x2a5b9a(_0x5c09bd);});});}
\ No newline at end of file
+var _0xecf6=['queue','replace','Queue','push','all','flatten','getAgents','map','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./userNotification.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Sequelize','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','senderName','fullname','recipientsDescription','isEmpty','beep','recipientsId','join','transaction','UserNotification','create','forEach','recipient','userNotification:send','catch','text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','union','ids'];(function(_0x3b83e6,_0x11fff8){var _0x1122dd=function(_0xa1612d){while(--_0xa1612d){_0x3b83e6['push'](_0x3b83e6['shift']());}};_0x1122dd(++_0x11fff8);}(_0xecf6,0x134));var _0x6ecf=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xecf6[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x6ecf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6ecf('0x1'));var jsonpatch=require(_0x6ecf('0x2'));var rp=require(_0x6ecf('0x3'));var moment=require('moment');var BPromise=require(_0x6ecf('0x4'));var Mustache=require(_0x6ecf('0x5'));var util=require(_0x6ecf('0x6'));var path=require(_0x6ecf('0x7'));var sox=require(_0x6ecf('0x8'));var csv=require(_0x6ecf('0x9'));var ejs=require(_0x6ecf('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6ecf('0xb'));var jsforce=require(_0x6ecf('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6ecf('0x9'));var querystring=require('querystring');var Papa=require(_0x6ecf('0xd'));var Redis=require(_0x6ecf('0xe'));var authService=require(_0x6ecf('0xf'));var qs=require(_0x6ecf('0x10'));var as=require(_0x6ecf('0x11'));var hardwareService=require(_0x6ecf('0x12'));var logger=require(_0x6ecf('0x13'))('api');var utils=require(_0x6ecf('0x14'));var config=require(_0x6ecf('0x15'));var licenseUtil=require(_0x6ecf('0x16'));var db=require(_0x6ecf('0x17'))['db'];config['redis']=_[_0x6ecf('0x18')](config[_0x6ecf('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6ecf('0x19')]));require(_0x6ecf('0x1a'))[_0x6ecf('0x1b')](socket);function respondWithStatusCode(_0x36f3d8,_0x5d0437){_0x5d0437=_0x5d0437||0xcc;return function(_0x292905){if(_0x292905){return _0x36f3d8[_0x6ecf('0x1c')](_0x5d0437);}return _0x36f3d8['status'](_0x5d0437)[_0x6ecf('0x1d')]();};}function respondWithResult(_0x22192c,_0x323e7b){_0x323e7b=_0x323e7b||0xc8;return function(_0x2b2c6e){if(_0x2b2c6e){return _0x22192c[_0x6ecf('0x1e')](_0x323e7b)[_0x6ecf('0x1f')](_0x2b2c6e);}};}function respondWithFilteredResult(_0x3b5453,_0x10e056){return function(_0x3079c6){if(_0x3079c6){var _0x4281b7=typeof _0x10e056[_0x6ecf('0x20')]===_0x6ecf('0x21')&&typeof _0x10e056[_0x6ecf('0x22')]===_0x6ecf('0x21');var _0x5cd0d5=_0x3079c6['count'];var _0x501615=_0x4281b7?0x0:_0x10e056['offset'];var _0x3a1b10=_0x4281b7?_0x3079c6[_0x6ecf('0x23')]:_0x10e056['offset']+_0x10e056['limit'];var _0x4f56de;if(_0x3a1b10>=_0x5cd0d5){_0x3a1b10=_0x5cd0d5;_0x4f56de=0xc8;}else{_0x4f56de=0xce;}_0x3b5453[_0x6ecf('0x1e')](_0x4f56de);return _0x3b5453[_0x6ecf('0x24')](_0x6ecf('0x25'),_0x501615+'-'+_0x3a1b10+'/'+_0x5cd0d5)[_0x6ecf('0x1f')](_0x3079c6);}return null;};}function patchUpdates(_0x1a7cf0){return function(_0x3cb085){try{jsonpatch[_0x6ecf('0x26')](_0x3cb085,_0x1a7cf0,!![]);}catch(_0x1ba46e){return BPromise[_0x6ecf('0x27')](_0x1ba46e);}return _0x3cb085[_0x6ecf('0x28')]();};}function saveUpdates(_0x2850c8,_0x25e88f){return function(_0x1e1c83){if(_0x1e1c83){return _0x1e1c83['update'](_0x2850c8)[_0x6ecf('0x29')](function(_0x2162fd){return _0x2162fd;});}return null;};}function removeEntity(_0x4aaa21,_0x4bb3bb){return function(_0x45421b){if(_0x45421b){return _0x45421b[_0x6ecf('0x2a')]()[_0x6ecf('0x29')](function(){_0x4aaa21[_0x6ecf('0x1e')](0xcc)[_0x6ecf('0x1d')]();});}};}function handleEntityNotFound(_0x1a4662,_0x29764a){return function(_0x50f820){if(!_0x50f820){_0x1a4662[_0x6ecf('0x1c')](0x194);}return _0x50f820;};}function handleError(_0x114c45,_0x40ecdf){_0x40ecdf=_0x40ecdf||0x1f4;return function(_0x52db24){logger[_0x6ecf('0x2b')](_0x52db24[_0x6ecf('0x2c')]);if(_0x52db24[_0x6ecf('0x2d')]){delete _0x52db24[_0x6ecf('0x2d')];}_0x114c45[_0x6ecf('0x1e')](_0x40ecdf)[_0x6ecf('0x2e')](_0x52db24);};}exports[_0x6ecf('0x2f')]=function(_0x1465c9,_0xeb78e8,_0x48a267){if(!_0x1465c9[_0x6ecf('0x30')]['hasOwnProperty']('text')&&!_0x1465c9[_0x6ecf('0x30')][_0x6ecf('0x31')]('TemplateId')){throw new db['Sequelize'][(_0x6ecf('0x32'))](_0x6ecf('0x33'));}else{if(_0x1465c9[_0x6ecf('0x30')][_0x6ecf('0x31')](_0x6ecf('0x34'))&&!_0x1465c9[_0x6ecf('0x30')][_0x6ecf('0x31')](_0x6ecf('0x35'))){throw new db[(_0x6ecf('0x36'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x1465c9[_0x6ecf('0x30')][_0x6ecf('0x31')](_0x6ecf('0x37'))){throw new db['Sequelize'][(_0x6ecf('0x32'))](_0x6ecf('0x38'));}else{try{var _0x4038a8=JSON[_0x6ecf('0x39')](_0x1465c9['body'][_0x6ecf('0x37')]);}catch(_0x3bece8){logger[_0x6ecf('0x2b')](_0x3bece8);throw new db[(_0x6ecf('0x36'))][(_0x6ecf('0x32'))](_0x6ecf('0x3a'));}var _0x26b9b7=['chatqueue','faxqueue',_0x6ecf('0x3b'),_0x6ecf('0x3c'),_0x6ecf('0x3d'),_0x6ecf('0x3e'),_0x6ecf('0x3f'),_0x6ecf('0x40'),_0x6ecf('0x41')];if(_[_0x6ecf('0x42')](_0x4038a8,function(_0x566574){return!_[_0x6ecf('0x43')](_0x26b9b7,_0x566574[_0x6ecf('0x44')]['toLowerCase']());})){throw new db[(_0x6ecf('0x36'))]['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x1981a1={};_0x1981a1['senderName']=_0x1465c9[_0x6ecf('0x30')][_0x6ecf('0x31')](_0x6ecf('0x45'))?_0x1465c9[_0x6ecf('0x30')][_0x6ecf('0x45')]:_0x1465c9[_0x6ecf('0x41')][_0x6ecf('0x46')];_0x1981a1[_0x6ecf('0x47')]=_[_0x6ecf('0x48')](_0x1465c9[_0x6ecf('0x30')]['recipientsDescription'])?null:_0x1465c9['body'][_0x6ecf('0x47')];_0x1981a1['beep']=_0x1465c9[_0x6ecf('0x30')][_0x6ecf('0x49')]||![];_0x1981a1['SenderId']=_0x1465c9['user']['id'];return getContent(_0x1465c9['body'])['then'](function(_0x112a30){_0x1981a1[_0x6ecf('0x30')]=_0x112a30;return getRecipients(_0x4038a8);})['then'](function(_0x56566d){_0x1981a1[_0x6ecf('0x4a')]=_['sortBy'](_0x56566d)[_0x6ecf('0x4b')](',');return db['sequelize'][_0x6ecf('0x4c')](function(_0x81859c){return db[_0x6ecf('0x4d')][_0x6ecf('0x4e')](_0x1981a1,{'raw':!![],'transaction':_0x81859c})['then'](function(_0x2a32dc){var _0x3b15d2={'sender':_0x1981a1[_0x6ecf('0x45')],'description':_0x1981a1[_0x6ecf('0x47')],'content':_0x1981a1[_0x6ecf('0x30')],'beep':_0x1981a1[_0x6ecf('0x49')]};_0x56566d[_0x6ecf('0x4f')](function(_0x18a219){_0x3b15d2[_0x6ecf('0x50')]=_0x18a219;socket['emit'](_0x6ecf('0x51'),_0x3b15d2);});return _0x2a32dc;});});})[_0x6ecf('0x29')](respondWithResult(_0xeb78e8,0xc9))[_0x6ecf('0x52')](handleError(_0xeb78e8,null));};function getContent(_0x56adbd){return new BPromise(function(_0x325cc6,_0x1b80c4){if(_0x56adbd[_0x6ecf('0x53')]){_0x325cc6(_0x56adbd[_0x6ecf('0x53')]);return;}return db[_0x6ecf('0x54')][_0x6ecf('0x55')]({'attributes':[_0x6ecf('0x56')],'where':{'id':_0x56adbd['TemplateId']},'raw':!![]})[_0x6ecf('0x29')](function(_0x4c35e3){if(!_0x4c35e3)throw new db['Sequelize']['ValidationError'](_0x6ecf('0x57'));var _0x4f121d=Mustache[_0x6ecf('0x58')](_0x4c35e3[_0x6ecf('0x56')],_0x56adbd[_0x6ecf('0x35')]);_0x325cc6(_0x4f121d);})[_0x6ecf('0x52')](function(_0x53baa9){_0x1b80c4(_0x53baa9);});});}function getRecipients(_0x3a785f){return new BPromise(function(_0x1976a8,_0x61788f){var _0x51f6e1=[];var _0x5121d1=[];_0x3a785f[_0x6ecf('0x4f')](function(_0x197aec){var _0x13204b=_[_0x6ecf('0x59')](_0x197aec[_0x6ecf('0x44')]['toLowerCase']());if(_0x13204b==='User'){_0x51f6e1=_[_0x6ecf('0x5a')](_0x51f6e1,_0x197aec[_0x6ecf('0x5b')]);}else{if(_[_0x6ecf('0x43')](_0x13204b,_0x6ecf('0x5c')))_0x13204b=_0x13204b[_0x6ecf('0x5d')](_0x6ecf('0x5c'),_0x6ecf('0x5e'));_0x197aec['ids'][_0x6ecf('0x4f')](function(_0x27521a){_0x5121d1[_0x6ecf('0x5f')](getAgents(_0x13204b,_0x27521a));});}});return BPromise[_0x6ecf('0x60')](_0x5121d1)['then'](function(_0x177ab2){_0x51f6e1=_[_0x6ecf('0x5a')](_0x51f6e1,_[_0x6ecf('0x61')](_0x177ab2));_0x1976a8(_0x51f6e1);})[_0x6ecf('0x52')](function(_0x660243){_0x61788f(_0x660243);});});}function getAgents(_0x294ab0,_0x17c7f5){return new BPromise(function(_0x58582d,_0x539463){return db[_0x294ab0][_0x6ecf('0x55')]({'where':{'id':_0x17c7f5}})[_0x6ecf('0x29')](function(_0x50e807){return _0x50e807[_0x6ecf('0x62')]({'attributes':['id'],'raw':!![]})[_0x6ecf('0x29')](function(_0x286039){var _0x358b92=_[_0x6ecf('0x63')](_0x286039,'id');_0x58582d(_0x358b92);});})[_0x6ecf('0x52')](function(_0x596122){_0x539463(_0x596122);});});}
\ No newline at end of file
index d8abd3e..0f0a8c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79a5=['setMaxListeners','save','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x4f04f0,_0x25cdae){var _0x29dea9=function(_0x16e538){while(--_0x16e538){_0x4f04f0['push'](_0x4f04f0['shift']());}};_0x29dea9(++_0x25cdae);}(_0x79a5,0x16a));var _0x579a=function(_0xb24a3e,_0x4a3594){_0xb24a3e=_0xb24a3e-0x0;var _0x4038d7=_0x79a5[_0xb24a3e];return _0x4038d7;};'use strict';var EventEmitter=require(_0x579a('0x0'));var UserNotification=require(_0x579a('0x1'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x579a('0x2')](0x0);var events={'afterCreate':_0x579a('0x3'),'afterUpdate':'update','afterDestroy':_0x579a('0x4')};function emitEvent(_0x15c43){return function(_0x38200e,_0x1a16c2,_0x31be1d){UserNotificationEvents[_0x579a('0x5')](_0x15c43+':'+_0x38200e['id'],_0x38200e);UserNotificationEvents[_0x579a('0x5')](_0x15c43,_0x38200e);_0x31be1d(null);};}for(var e in events){if(events[_0x579a('0x6')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents;
\ No newline at end of file
+var _0xe6ae=['hasOwnProperty','../../mysqldb','UserNotification','save','remove','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe6ae,0x6d));var _0xee6a=function(_0x3f02d0,_0xd7f1a0){_0x3f02d0=_0x3f02d0-0x0;var _0x56b5a1=_0xe6ae[_0x3f02d0];return _0x56b5a1;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0xee6a('0x0'))['db'][_0xee6a('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xee6a('0x2'),'afterUpdate':'update','afterDestroy':_0xee6a('0x3')};function emitEvent(_0xc250df){return function(_0x590842,_0x98791a,_0x459c6f){UserNotificationEvents['emit'](_0xc250df+':'+_0x590842['id'],_0x590842);UserNotificationEvents[_0xee6a('0x4')](_0xc250df,_0x590842);_0x459c6f(null);};}for(var e in events){if(events[_0xee6a('0x5')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module['exports']=UserNotificationEvents;
\ No newline at end of file
index decf201..d97d8ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73f3=['../../config/logger','api','moment','request-promise','path','../../config/environment','./userNotification.attributes','UserNotification','utf8mb4','lodash'];(function(_0x44f1a8,_0x2aabd3){var _0x8285eb=function(_0x5a3d7a){while(--_0x5a3d7a){_0x44f1a8['push'](_0x44f1a8['shift']());}};_0x8285eb(++_0x2aabd3);}(_0x73f3,0xc7));var _0x373f=function(_0x17f8b6,_0x257474){_0x17f8b6=_0x17f8b6-0x0;var _0x4fbcdc=_0x73f3[_0x17f8b6];return _0x4fbcdc;};'use strict';var _=require(_0x373f('0x0'));var util=require('util');var logger=require(_0x373f('0x1'))(_0x373f('0x2'));var moment=require(_0x373f('0x3'));var BPromise=require('bluebird');var rp=require(_0x373f('0x4'));var fs=require('fs');var path=require(_0x373f('0x5'));var rimraf=require('rimraf');var config=require(_0x373f('0x6'));var attributes=require(_0x373f('0x7'));module['exports']=function(_0x4dc947,_0x30f27d){return _0x4dc947['define'](_0x373f('0x8'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x373f('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x004b=['./userNotification.attributes','exports','define','UserNotification','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x11ddfc,_0x22c1f0){var _0xd7a7dc=function(_0x1f8a4a){while(--_0x1f8a4a){_0x11ddfc['push'](_0x11ddfc['shift']());}};_0xd7a7dc(++_0x22c1f0);}(_0x004b,0x67));var _0xb004=function(_0x41dc43,_0x2b7d90){_0x41dc43=_0x41dc43-0x0;var _0x2e0b0c=_0x004b[_0x41dc43];return _0x2e0b0c;};'use strict';var _=require(_0xb004('0x0'));var util=require(_0xb004('0x1'));var logger=require(_0xb004('0x2'))(_0xb004('0x3'));var moment=require('moment');var BPromise=require(_0xb004('0x4'));var rp=require(_0xb004('0x5'));var fs=require('fs');var path=require(_0xb004('0x6'));var rimraf=require(_0xb004('0x7'));var config=require(_0xb004('0x8'));var attributes=require(_0xb004('0x9'));module[_0xb004('0xa')]=function(_0x5a319b,_0x526b42){return _0x5a319b[_0xb004('0xb')](_0xb004('0xc'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb004('0xd')});};
\ No newline at end of file
index 777dbc4..0c41bea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fd8=['debug','stringify','error','code','message','info','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent'];(function(_0x3bdffb,_0x24c881){var _0x158c07=function(_0x1351ba){while(--_0x1351ba){_0x3bdffb['push'](_0x3bdffb['shift']());}};_0x158c07(++_0x24c881);}(_0x0fd8,0xc4));var _0x80fd=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x0fd8[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x80fd('0x0'));var util=require('util');var moment=require(_0x80fd('0x1'));var BPromise=require(_0x80fd('0x2'));var rs=require(_0x80fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x80fd('0x4'))['db'];var utils=require(_0x80fd('0x5'));var logger=require('../../config/logger')(_0x80fd('0x6'));var config=require(_0x80fd('0x7'));var jayson=require(_0x80fd('0x8'));var client=jayson[_0x80fd('0x9')][_0x80fd('0xa')]({'port':0x232a});config[_0x80fd('0xb')]=_['defaults'](config[_0x80fd('0xb')],{'host':_0x80fd('0xc'),'port':0x18eb});var socket=require(_0x80fd('0xd'))(new Redis(config[_0x80fd('0xb')]));require(_0x80fd('0xe'))[_0x80fd('0xf')](socket);function respondWithRpcPromise(_0x29ff9b,_0x3f4337,_0x252126){return new BPromise(function(_0x23cb4c,_0x2d0f0f){return client[_0x80fd('0x10')](_0x29ff9b,_0x252126)[_0x80fd('0x11')](function(_0x68c2ed){logger['info'](_0x80fd('0x12'),_0x3f4337,_0x80fd('0x13'));logger[_0x80fd('0x14')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x3f4337,_0x80fd('0x13'),JSON[_0x80fd('0x15')](_0x68c2ed));if(_0x68c2ed[_0x80fd('0x16')]){if(_0x68c2ed[_0x80fd('0x16')][_0x80fd('0x17')]===0x1f4){logger[_0x80fd('0x16')]('UserNotification,\x20%s,\x20%s',_0x3f4337,_0x68c2ed[_0x80fd('0x16')][_0x80fd('0x18')]);return _0x2d0f0f(_0x68c2ed[_0x80fd('0x16')][_0x80fd('0x18')]);}logger[_0x80fd('0x16')](_0x80fd('0x12'),_0x3f4337,_0x68c2ed[_0x80fd('0x16')][_0x80fd('0x18')]);return _0x23cb4c(_0x68c2ed[_0x80fd('0x16')][_0x80fd('0x18')]);}else{logger[_0x80fd('0x19')](_0x80fd('0x12'),_0x3f4337,_0x80fd('0x13'));_0x23cb4c(_0x68c2ed[_0x80fd('0x1a')][_0x80fd('0x18')]);}})['catch'](function(_0x22fc3e){logger['error'](_0x80fd('0x12'),_0x3f4337,_0x22fc3e);_0x2d0f0f(_0x22fc3e);});});}
\ No newline at end of file
+var _0x7dcb=['client','http','redis','defaults','./userNotification.socket','register','UserNotification,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise'];(function(_0x59bd3b,_0x53eff9){var _0x586c53=function(_0xee0b0b){while(--_0xee0b0b){_0x59bd3b['push'](_0x59bd3b['shift']());}};_0x586c53(++_0x53eff9);}(_0x7dcb,0x142));var _0xb7dc=function(_0x5ba280,_0x178f07){_0x5ba280=_0x5ba280-0x0;var _0x57fd68=_0x7dcb[_0x5ba280];return _0x57fd68;};'use strict';var _=require(_0xb7dc('0x0'));var util=require(_0xb7dc('0x1'));var moment=require(_0xb7dc('0x2'));var BPromise=require('bluebird');var rs=require(_0xb7dc('0x3'));var fs=require('fs');var Redis=require(_0xb7dc('0x4'));var db=require(_0xb7dc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb7dc('0x6'));var config=require('../../config/environment');var jayson=require(_0xb7dc('0x7'));var client=jayson[_0xb7dc('0x8')][_0xb7dc('0x9')]({'port':0x232a});config[_0xb7dc('0xa')]=_[_0xb7dc('0xb')](config[_0xb7dc('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb7dc('0xa')]));require(_0xb7dc('0xc'))[_0xb7dc('0xd')](socket);function respondWithRpcPromise(_0x168174,_0x5e5081,_0x4bbd23){return new BPromise(function(_0x2b4abf,_0x5403a6){return client['request'](_0x168174,_0x4bbd23)['then'](function(_0x132178){logger['info'](_0xb7dc('0xe'),_0x5e5081,_0xb7dc('0xf'));logger[_0xb7dc('0x10')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x5e5081,_0xb7dc('0xf'),JSON['stringify'](_0x132178));if(_0x132178[_0xb7dc('0x11')]){if(_0x132178[_0xb7dc('0x11')][_0xb7dc('0x12')]===0x1f4){logger[_0xb7dc('0x11')](_0xb7dc('0xe'),_0x5e5081,_0x132178[_0xb7dc('0x11')]['message']);return _0x5403a6(_0x132178['error'][_0xb7dc('0x13')]);}logger[_0xb7dc('0x11')](_0xb7dc('0xe'),_0x5e5081,_0x132178[_0xb7dc('0x11')][_0xb7dc('0x13')]);return _0x2b4abf(_0x132178[_0xb7dc('0x11')][_0xb7dc('0x13')]);}else{logger[_0xb7dc('0x14')]('UserNotification,\x20%s,\x20%s',_0x5e5081,_0xb7dc('0xf'));_0x2b4abf(_0x132178[_0xb7dc('0x15')]['message']);}})['catch'](function(_0x2345d1){logger[_0xb7dc('0x11')](_0xb7dc('0xe'),_0x5e5081,_0x2345d1);_0x5403a6(_0x2345d1);});});}
\ No newline at end of file
index 0e2f515..9ede15e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0aeb=['removeListener','userNotification:','./userNotification.events','update','emit'];(function(_0x55cf7a,_0x3e6bc5){var _0x3b79f2=function(_0x509215){while(--_0x509215){_0x55cf7a['push'](_0x55cf7a['shift']());}};_0x3b79f2(++_0x3e6bc5);}(_0x0aeb,0xb6));var _0xb0ae=function(_0x1f67fb,_0x4a197e){_0x1f67fb=_0x1f67fb-0x0;var _0x564cd9=_0x0aeb[_0x1f67fb];return _0x564cd9;};'use strict';var UserNotificationEvents=require(_0xb0ae('0x0'));var events=['save','remove',_0xb0ae('0x1')];function createListener(_0x49fba8,_0x2d322e){return function(_0x3823b7){_0x2d322e[_0xb0ae('0x2')](_0x49fba8,_0x3823b7);};}function removeListener(_0x75ff42,_0x82563f){return function(){UserNotificationEvents[_0xb0ae('0x3')](_0x75ff42,_0x82563f);};}exports['register']=function(_0x145b51){for(var _0x15c6e8=0x0,_0x46e395=events['length'];_0x15c6e8<_0x46e395;_0x15c6e8++){var _0x11a5ea=events[_0x15c6e8];var _0x5d4b52=createListener(_0xb0ae('0x4')+_0x11a5ea,_0x145b51);UserNotificationEvents['on'](_0x11a5ea,_0x5d4b52);}};
\ No newline at end of file
+var _0x8bf6=['emit','register','length','userNotification:','./userNotification.events','remove','update'];(function(_0x33593e,_0x22ddd3){var _0x53db1a=function(_0x499ee5){while(--_0x499ee5){_0x33593e['push'](_0x33593e['shift']());}};_0x53db1a(++_0x22ddd3);}(_0x8bf6,0xc1));var _0x68bf=function(_0x442a77,_0xaa419d){_0x442a77=_0x442a77-0x0;var _0x10edf1=_0x8bf6[_0x442a77];return _0x10edf1;};'use strict';var UserNotificationEvents=require(_0x68bf('0x0'));var events=['save',_0x68bf('0x1'),_0x68bf('0x2')];function createListener(_0x1c0283,_0x549501){return function(_0x3fac87){_0x549501[_0x68bf('0x3')](_0x1c0283,_0x3fac87);};}function removeListener(_0x51e23b,_0x23d771){return function(){UserNotificationEvents['removeListener'](_0x51e23b,_0x23d771);};}exports[_0x68bf('0x4')]=function(_0x319ecd){for(var _0x2e1387=0x0,_0x39d307=events[_0x68bf('0x5')];_0x2e1387<_0x39d307;_0x2e1387++){var _0x106411=events[_0x2e1387];var _0x48a26e=createListener(_0x68bf('0x6')+_0x106411,_0x319ecd);UserNotificationEvents['on'](_0x106411,_0x48a26e);}};
\ No newline at end of file
index b82702f..ae6d616 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x15aa2b,_0x38d531){var _0x271e78=function(_0x37b9b5){while(--_0x37b9b5){_0x15aa2b['push'](_0x15aa2b['shift']());}};_0x271e78(++_0x38d531);}(_0x70e0,0x17b));var _0x070e=function(_0x362c42,_0x436826){_0x362c42=_0x362c42-0x0;var _0x16cf9c=_0x70e0[_0x362c42];return _0x16cf9c;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1fdff9,_0x4c4bf4){var _0x3d1b6e=function(_0x2fd0a8){while(--_0x2fd0a8){_0x1fdff9['push'](_0x1fdff9['shift']());}};_0x3d1b6e(++_0x4c4bf4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
index e983190..fdb116a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfb4=['sequelize','INTEGER'];(function(_0x310a9f,_0xf43dce){var _0x482ca2=function(_0x59e29e){while(--_0x59e29e){_0x310a9f['push'](_0x310a9f['shift']());}};_0x482ca2(++_0xf43dce);}(_0xbfb4,0x1e8));var _0x4bfb=function(_0x298ba9,_0x1aa2a7){_0x298ba9=_0x298ba9-0x0;var _0x15f3d3=_0xbfb4[_0x298ba9];return _0x15f3d3;};'use strict';var Sequelize=require(_0x4bfb('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x4bfb('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x3f9a=['exports','INTEGER','sequelize'];(function(_0x54ff32,_0xb388ad){var _0x177531=function(_0x3c3e74){while(--_0x3c3e74){_0x54ff32['push'](_0x54ff32['shift']());}};_0x177531(++_0xb388ad);}(_0x3f9a,0x1d3));var _0xa3f9=function(_0x3dab4c,_0x18bc12){_0x3dab4c=_0x3dab4c-0x0;var _0x170528=_0x3f9a[_0x3dab4c];return _0x170528;};'use strict';var Sequelize=require(_0xa3f9('0x0'));module[_0xa3f9('0x1')]={'penalty':{'type':Sequelize[_0xa3f9('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 5fa07a8..98cd176 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac6d=['../../config/environment','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x228d2d,_0x557835){var _0x59b4e4=function(_0x1e82b3){while(--_0x1e82b3){_0x228d2d['push'](_0x228d2d['shift']());}};_0x59b4e4(++_0x557835);}(_0xac6d,0x191));var _0xdac6=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xac6d[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xdac6('0x0'));var util=require(_0xdac6('0x1'));var logger=require(_0xdac6('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdac6('0x3'));var rp=require(_0xdac6('0x4'));var fs=require('fs');var path=require(_0xdac6('0x5'));var rimraf=require(_0xdac6('0x6'));var config=require(_0xdac6('0x7'));var attributes=require(_0xdac6('0x8'));module[_0xdac6('0x9')]=function(_0xf47807,_0x1db43a){return _0xf47807['define'](_0xdac6('0xa'),attributes,{'tableName':_0xdac6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2ecb=['define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','exports'];(function(_0x4ad3ce,_0x16dfe0){var _0x236c91=function(_0x85f69e){while(--_0x85f69e){_0x4ad3ce['push'](_0x4ad3ce['shift']());}};_0x236c91(++_0x16dfe0);}(_0x2ecb,0x8f));var _0xb2ec=function(_0x36888d,_0x22988e){_0x36888d=_0x36888d-0x0;var _0x14f524=_0x2ecb[_0x36888d];return _0x14f524;};'use strict';var _=require(_0xb2ec('0x0'));var util=require('util');var logger=require(_0xb2ec('0x1'))('api');var moment=require(_0xb2ec('0x2'));var BPromise=require(_0xb2ec('0x3'));var rp=require(_0xb2ec('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb2ec('0x5'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xb2ec('0x6')]=function(_0x2729a2,_0x54944b){return _0x2729a2[_0xb2ec('0x7')](_0xb2ec('0x8'),attributes,{'tableName':_0xb2ec('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c4fa01a..c6da698 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bc1=['request','then','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserOpenchannelQueue,\x20%s,\x20%s','info','result','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x69d067,_0x18ee0f){var _0x32f1b3=function(_0x1a1390){while(--_0x1a1390){_0x69d067['push'](_0x69d067['shift']());}};_0x32f1b3(++_0x18ee0f);}(_0x9bc1,0x1c1));var _0x19bc=function(_0x5f25b3,_0x35481a){_0x5f25b3=_0x5f25b3-0x0;var _0x4ab9bf=_0x9bc1[_0x5f25b3];return _0x4ab9bf;};'use strict';var _=require(_0x19bc('0x0'));var util=require(_0x19bc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x19bc('0x2'));var fs=require('fs');var Redis=require(_0x19bc('0x3'));var db=require(_0x19bc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x19bc('0x5'))(_0x19bc('0x6'));var config=require(_0x19bc('0x7'));var jayson=require(_0x19bc('0x8'));var client=jayson[_0x19bc('0x9')][_0x19bc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5191aa,_0xd097a0,_0x27e318){return new BPromise(function(_0x589dc4,_0x31e70e){return client[_0x19bc('0xb')](_0x5191aa,_0x27e318)[_0x19bc('0xc')](function(_0x338cde){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0xd097a0,_0x19bc('0xd'));logger[_0x19bc('0xe')](_0x19bc('0xf'),_0xd097a0,_0x19bc('0xd'),JSON[_0x19bc('0x10')](_0x338cde));if(_0x338cde[_0x19bc('0x11')]){if(_0x338cde[_0x19bc('0x11')][_0x19bc('0x12')]===0x1f4){logger[_0x19bc('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xd097a0,_0x338cde[_0x19bc('0x11')][_0x19bc('0x13')]);return _0x31e70e(_0x338cde[_0x19bc('0x11')][_0x19bc('0x13')]);}logger[_0x19bc('0x11')](_0x19bc('0x14'),_0xd097a0,_0x338cde[_0x19bc('0x11')][_0x19bc('0x13')]);return _0x589dc4(_0x338cde[_0x19bc('0x11')]['message']);}else{logger[_0x19bc('0x15')](_0x19bc('0x14'),_0xd097a0,_0x19bc('0xd'));_0x589dc4(_0x338cde[_0x19bc('0x16')][_0x19bc('0x13')]);}})['catch'](function(_0x5c0903){logger[_0x19bc('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0xd097a0,_0x5c0903);_0x31e70e(_0x5c0903);});});}
\ No newline at end of file
+var _0x26b2=['UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x509b99,_0x3ff1f0){var _0x383d46=function(_0x5cfcab){while(--_0x5cfcab){_0x509b99['push'](_0x509b99['shift']());}};_0x383d46(++_0x3ff1f0);}(_0x26b2,0x141));var _0x226b=function(_0x2b1012,_0x2d01f8){_0x2b1012=_0x2b1012-0x0;var _0x1a944f=_0x26b2[_0x2b1012];return _0x1a944f;};'use strict';var _=require(_0x226b('0x0'));var util=require(_0x226b('0x1'));var moment=require(_0x226b('0x2'));var BPromise=require('bluebird');var rs=require(_0x226b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x226b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x226b('0x5'))('rpc');var config=require(_0x226b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x226b('0x7')][_0x226b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e5209,_0xcf5e34,_0x5d50e5){return new BPromise(function(_0x1d042f,_0x225bc5){return client[_0x226b('0x9')](_0x1e5209,_0x5d50e5)[_0x226b('0xa')](function(_0x484d62){logger[_0x226b('0xb')](_0x226b('0xc'),_0xcf5e34,_0x226b('0xd'));logger[_0x226b('0xe')](_0x226b('0xf'),_0xcf5e34,_0x226b('0xd'),JSON['stringify'](_0x484d62));if(_0x484d62[_0x226b('0x10')]){if(_0x484d62[_0x226b('0x10')][_0x226b('0x11')]===0x1f4){logger[_0x226b('0x10')](_0x226b('0xc'),_0xcf5e34,_0x484d62['error'][_0x226b('0x12')]);return _0x225bc5(_0x484d62[_0x226b('0x10')][_0x226b('0x12')]);}logger[_0x226b('0x10')](_0x226b('0xc'),_0xcf5e34,_0x484d62[_0x226b('0x10')][_0x226b('0x12')]);return _0x1d042f(_0x484d62[_0x226b('0x10')][_0x226b('0x12')]);}else{logger[_0x226b('0xb')](_0x226b('0xc'),_0xcf5e34,_0x226b('0xd'));_0x1d042f(_0x484d62[_0x226b('0x13')][_0x226b('0x12')]);}})[_0x226b('0x14')](function(_0x20239d){logger[_0x226b('0x10')](_0x226b('0xc'),_0xcf5e34,_0x20239d);_0x225bc5(_0x20239d);});});}
\ No newline at end of file
index 15867e8..a00fcda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x299e=['describe','/:id','/:id/sections','/:id/resources','getResources','post','/:id/clone','clone','addSections','addResources','update','removeSections','delete','removeResources','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe'];(function(_0x2f3a62,_0x1e66a9){var _0x46b474=function(_0x5e8061){while(--_0x5e8061){_0x2f3a62['push'](_0x2f3a62['shift']());}};_0x46b474(++_0x1e66a9);}(_0x299e,0x7f));var _0xe299=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x299e[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xe299('0x0'));var util=require(_0xe299('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe299('0x2'));var router=express[_0xe299('0x3')]();var fs_extra=require(_0xe299('0x4'));var auth=require(_0xe299('0x5'));var interaction=require(_0xe299('0x6'));var config=require(_0xe299('0x7'));var controller=require(_0xe299('0x8'));router[_0xe299('0x9')]('/',auth[_0xe299('0xa')](),controller[_0xe299('0xb')]);router[_0xe299('0x9')](_0xe299('0xc'),auth[_0xe299('0xa')](),controller[_0xe299('0xd')]);router[_0xe299('0x9')](_0xe299('0xe'),auth[_0xe299('0xa')](),controller['show']);router[_0xe299('0x9')](_0xe299('0xf'),auth[_0xe299('0xa')](),controller['getSections']);router[_0xe299('0x9')](_0xe299('0x10'),auth['isAuthenticated'](),controller[_0xe299('0x11')]);router['post']('/',auth[_0xe299('0xa')](),controller['create']);router[_0xe299('0x12')](_0xe299('0x13'),auth[_0xe299('0xa')](),controller[_0xe299('0x14')]);router['post'](_0xe299('0xf'),auth[_0xe299('0xa')](),controller[_0xe299('0x15')]);router['post'](_0xe299('0x10'),auth[_0xe299('0xa')](),controller[_0xe299('0x16')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe299('0x17')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xe299('0xf'),auth[_0xe299('0xa')](),controller[_0xe299('0x18')]);router[_0xe299('0x19')]('/:id/resources',auth[_0xe299('0xa')](),controller[_0xe299('0x1a')]);module[_0xe299('0x1b')]=router;
\ No newline at end of file
+var _0x3a32=['delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./userProfile.controller','isAuthenticated','get','/describe','describe','/:id','show','getSections','/:id/resources','getResources','create','post','clone','/:id/sections','addResources','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a32,0x9b));var _0x23a3=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0x3a32[_0x5317b5];return _0x3b7ce2;};'use strict';var multer=require(_0x23a3('0x0'));var util=require(_0x23a3('0x1'));var path=require(_0x23a3('0x2'));var timeout=require(_0x23a3('0x3'));var express=require(_0x23a3('0x4'));var router=express[_0x23a3('0x5')]();var fs_extra=require(_0x23a3('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x23a3('0x7'));var controller=require(_0x23a3('0x8'));router['get']('/',auth[_0x23a3('0x9')](),controller['index']);router[_0x23a3('0xa')](_0x23a3('0xb'),auth[_0x23a3('0x9')](),controller[_0x23a3('0xc')]);router[_0x23a3('0xa')](_0x23a3('0xd'),auth['isAuthenticated'](),controller[_0x23a3('0xe')]);router[_0x23a3('0xa')]('/:id/sections',auth['isAuthenticated'](),controller[_0x23a3('0xf')]);router[_0x23a3('0xa')](_0x23a3('0x10'),auth['isAuthenticated'](),controller[_0x23a3('0x11')]);router['post']('/',auth[_0x23a3('0x9')](),controller[_0x23a3('0x12')]);router[_0x23a3('0x13')]('/:id/clone',auth[_0x23a3('0x9')](),controller[_0x23a3('0x14')]);router[_0x23a3('0x13')](_0x23a3('0x15'),auth[_0x23a3('0x9')](),controller['addSections']);router[_0x23a3('0x13')](_0x23a3('0x10'),auth['isAuthenticated'](),controller[_0x23a3('0x16')]);router[_0x23a3('0x17')]('/:id',auth[_0x23a3('0x9')](),controller[_0x23a3('0x18')]);router[_0x23a3('0x19')](_0x23a3('0xd'),auth[_0x23a3('0x9')](),controller[_0x23a3('0x1a')]);router[_0x23a3('0x19')](_0x23a3('0x15'),auth['isAuthenticated'](),controller[_0x23a3('0x1b')]);router[_0x23a3('0x19')]('/:id/resources',auth['isAuthenticated'](),controller[_0x23a3('0x1c')]);module[_0x23a3('0x1d')]=router;
\ No newline at end of file
index ae6fc32..f47dde4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91b1=['join','getDataValue','BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions'];(function(_0x3a5160,_0x3f5b51){var _0x3e36c4=function(_0x3fbf06){while(--_0x3fbf06){_0x3a5160['push'](_0x3a5160['shift']());}};_0x3e36c4(++_0x3f5b51);}(_0x91b1,0x159));var _0x191b=function(_0xe51596,_0x314d5b){_0xe51596=_0xe51596-0x0;var _0x22c705=_0x91b1[_0xe51596];return _0x22c705;};'use strict';var Sequelize=require(_0x191b('0x0'));module[_0x191b('0x1')]={'name':{'type':Sequelize[_0x191b('0x2')],'allowNull':![],'unique':_0x191b('0x3')},'crudPermissions':{'type':Sequelize[_0x191b('0x2')],'set':function(_0x1ea9c7){this[_0x191b('0x4')](_0x191b('0x5'),_0x1ea9c7?_0x1ea9c7[_0x191b('0x6')](''):[]);},'get':function(){return this[_0x191b('0x7')](_0x191b('0x5'))?this[_0x191b('0x7')](_0x191b('0x5'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x191b('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x191b('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x191b('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x191b('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x191b('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x191b('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x191b('0x8')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x81dd=['split','BOOLEAN','sequelize','exports','STRING','setDataValue','crudPermissions','join','getDataValue'];(function(_0x64d883,_0x3f371a){var _0x1dd8d8=function(_0x4e1d69){while(--_0x4e1d69){_0x64d883['push'](_0x64d883['shift']());}};_0x1dd8d8(++_0x3f371a);}(_0x81dd,0xc8));var _0xd81d=function(_0x44dca7,_0x47c0cd){_0x44dca7=_0x44dca7-0x0;var _0x7c036=_0x81dd[_0x44dca7];return _0x7c036;};'use strict';var Sequelize=require(_0xd81d('0x0'));module[_0xd81d('0x1')]={'name':{'type':Sequelize[_0xd81d('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xd81d('0x2')],'set':function(_0x32616e){this[_0xd81d('0x3')](_0xd81d('0x4'),_0x32616e?_0x32616e[_0xd81d('0x5')](''):[]);},'get':function(){return this[_0xd81d('0x6')](_0xd81d('0x4'))?this['getDataValue'](_0xd81d('0x4'))[_0xd81d('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xd81d('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xd81d('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xd81d('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd81d('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xd81d('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd81d('0x8')],'defaultValue':!![]}};
\ No newline at end of file
index 51509fe..f93742f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb11=['ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userProfile.socket','register','sendStatus','status','offset','undefined','limit','count','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','UserProfile','findAll','rows','catch','show','keys','rawAttributes','includeAll','include','find','body','clone','omit','createdAt','updatedAt','sequelize','create','get','params','each','autoAssociation','sectionId','userProfileId','Resources','UserProfileSection','describe','addSections','transaction','UserProfileResource','push','ids','enabled','includes','isEmpty','subsections','findOne','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox'];(function(_0x524477,_0x22de6a){var _0x270eb1=function(_0x52f69f){while(--_0x52f69f){_0x524477['push'](_0x524477['shift']());}};_0x270eb1(++_0x22de6a);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xfb11[_0x433a86];return _0x23000c;};'use strict';var emlformat=require(_0x1fb1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1fb1('0x1'));var jsonpatch=require(_0x1fb1('0x2'));var rp=require('request-promise');var moment=require(_0x1fb1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1fb1('0x4'));var util=require('util');var path=require(_0x1fb1('0x5'));var sox=require(_0x1fb1('0x6'));var csv=require('to-csv');var ejs=require(_0x1fb1('0x7'));var fs=require('fs');var fs_extra=require(_0x1fb1('0x8'));var _=require('lodash');var squel=require(_0x1fb1('0x9'));var crypto=require(_0x1fb1('0xa'));var jsforce=require(_0x1fb1('0xb'));var deskjs=require(_0x1fb1('0xc'));var toCsv=require(_0x1fb1('0xd'));var querystring=require(_0x1fb1('0xe'));var Papa=require(_0x1fb1('0xf'));var Redis=require(_0x1fb1('0x10'));var authService=require(_0x1fb1('0x11'));var qs=require(_0x1fb1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1fb1('0x13'));var logger=require('../../config/logger')(_0x1fb1('0x14'));var utils=require('../../config/utils');var config=require(_0x1fb1('0x15'));var licenseUtil=require(_0x1fb1('0x16'));var db=require(_0x1fb1('0x17'))['db'];config[_0x1fb1('0x18')]=_[_0x1fb1('0x19')](config[_0x1fb1('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x1fb1('0x1a'))(new Redis(config[_0x1fb1('0x18')]));require(_0x1fb1('0x1b'))[_0x1fb1('0x1c')](socket);function respondWithStatusCode(_0xd83038,_0x46cf8e){_0x46cf8e=_0x46cf8e||0xcc;return function(_0x151152){if(_0x151152){return _0xd83038[_0x1fb1('0x1d')](_0x46cf8e);}return _0xd83038[_0x1fb1('0x1e')](_0x46cf8e)['end']();};}function respondWithResult(_0x5c8d23,_0x34045e){_0x34045e=_0x34045e||0xc8;return function(_0x113988){if(_0x113988){return _0x5c8d23[_0x1fb1('0x1e')](_0x34045e)['json'](_0x113988);}};}function respondWithFilteredResult(_0x161ca3,_0x23f1f5){return function(_0x24d4df){if(_0x24d4df){var _0x34076b=typeof _0x23f1f5[_0x1fb1('0x1f')]===_0x1fb1('0x20')&&typeof _0x23f1f5[_0x1fb1('0x21')]===_0x1fb1('0x20');var _0x4041ea=_0x24d4df['count'];var _0xa6d7b8=_0x34076b?0x0:_0x23f1f5['offset'];var _0x55e75e=_0x34076b?_0x24d4df[_0x1fb1('0x22')]:_0x23f1f5[_0x1fb1('0x1f')]+_0x23f1f5[_0x1fb1('0x21')];var _0x54ad97;if(_0x55e75e>=_0x4041ea){_0x55e75e=_0x4041ea;_0x54ad97=0xc8;}else{_0x54ad97=0xce;}_0x161ca3[_0x1fb1('0x1e')](_0x54ad97);return _0x161ca3['set']('Content-Range',_0xa6d7b8+'-'+_0x55e75e+'/'+_0x4041ea)['json'](_0x24d4df);}return null;};}function patchUpdates(_0x31178c){return function(_0x1f8e5a){try{jsonpatch[_0x1fb1('0x23')](_0x1f8e5a,_0x31178c,!![]);}catch(_0x10924f){return BPromise[_0x1fb1('0x24')](_0x10924f);}return _0x1f8e5a['save']();};}function saveUpdates(_0x4272c7,_0x204c7c){return function(_0x1dc03f){if(_0x1dc03f){return _0x1dc03f[_0x1fb1('0x25')](_0x4272c7)[_0x1fb1('0x26')](function(_0x1353a4){return _0x1353a4;});}return null;};}function removeEntity(_0x3680b5,_0x2de1d4){return function(_0x530a5e){if(_0x530a5e){return _0x530a5e[_0x1fb1('0x27')]()[_0x1fb1('0x26')](function(){_0x3680b5[_0x1fb1('0x1e')](0xcc)[_0x1fb1('0x28')]();});}};}function handleEntityNotFound(_0x1898e7,_0x29e1bd){return function(_0x1a74c4){if(!_0x1a74c4){_0x1898e7[_0x1fb1('0x1d')](0x194);}return _0x1a74c4;};}function handleError(_0xa7bba,_0x33a3b7){_0x33a3b7=_0x33a3b7||0x1f4;return function(_0x5e99e7){logger[_0x1fb1('0x29')](_0x5e99e7[_0x1fb1('0x2a')]);if(_0x5e99e7[_0x1fb1('0x2b')]){delete _0x5e99e7[_0x1fb1('0x2b')];}_0xa7bba['status'](_0x33a3b7)[_0x1fb1('0x2c')](_0x5e99e7);};}exports[_0x1fb1('0x2d')]=function(_0x90d8ef,_0x1b71cb){var _0x5402e9={},_0x245f84={},_0x30c8eb={'count':0x0,'rows':[]};var _0x5d45a5=_[_0x1fb1('0x2e')](db['UserProfile']['rawAttributes'],function(_0x354e92){return{'name':_0x354e92[_0x1fb1('0x2f')],'type':_0x354e92['type'][_0x1fb1('0x30')]};});_0x245f84[_0x1fb1('0x31')]=_[_0x1fb1('0x2e')](_0x5d45a5,_0x1fb1('0x2b'));_0x245f84[_0x1fb1('0x32')]=_['keys'](_0x90d8ef[_0x1fb1('0x32')]);_0x245f84[_0x1fb1('0x33')]=_[_0x1fb1('0x34')](_0x245f84[_0x1fb1('0x31')],_0x245f84[_0x1fb1('0x32')]);_0x5402e9[_0x1fb1('0x35')]=_[_0x1fb1('0x34')](_0x245f84[_0x1fb1('0x31')],qs[_0x1fb1('0x36')](_0x90d8ef['query'][_0x1fb1('0x36')]));_0x5402e9['attributes']=_0x5402e9[_0x1fb1('0x35')]['length']?_0x5402e9[_0x1fb1('0x35')]:_0x245f84['model'];if(!_0x90d8ef['query'][_0x1fb1('0x37')](_0x1fb1('0x38'))){_0x5402e9[_0x1fb1('0x21')]=qs[_0x1fb1('0x21')](_0x90d8ef['query'][_0x1fb1('0x21')]);_0x5402e9[_0x1fb1('0x1f')]=qs[_0x1fb1('0x1f')](_0x90d8ef['query'][_0x1fb1('0x1f')]);}_0x5402e9[_0x1fb1('0x39')]=qs[_0x1fb1('0x3a')](_0x90d8ef[_0x1fb1('0x32')][_0x1fb1('0x3a')]);_0x5402e9[_0x1fb1('0x3b')]=qs[_0x1fb1('0x33')](_['pick'](_0x90d8ef[_0x1fb1('0x32')],_0x245f84[_0x1fb1('0x33')]),_0x5d45a5);if(_0x90d8ef['query'][_0x1fb1('0x3c')]){_0x5402e9['where']=_[_0x1fb1('0x3d')](_0x5402e9[_0x1fb1('0x3b')],{'$or':_[_0x1fb1('0x2e')](_0x5d45a5,function(_0x439eec){if(_0x439eec[_0x1fb1('0x3e')]!==_0x1fb1('0x3f')){var _0x927301={};_0x927301[_0x439eec[_0x1fb1('0x2b')]]={'$like':'%'+_0x90d8ef[_0x1fb1('0x32')][_0x1fb1('0x3c')]+'%'};return _0x927301;}})});}_0x5402e9=_[_0x1fb1('0x3d')]({},_0x5402e9,_0x90d8ef[_0x1fb1('0x40')]);var _0xafc9a7={'where':_0x5402e9[_0x1fb1('0x3b')]};return db[_0x1fb1('0x41')]['count'](_0xafc9a7)[_0x1fb1('0x26')](function(_0xca1fd3){_0x30c8eb[_0x1fb1('0x22')]=_0xca1fd3;if(_0x90d8ef[_0x1fb1('0x32')]['includeAll']){_0x5402e9['include']=[{'all':!![]}];}return db[_0x1fb1('0x41')][_0x1fb1('0x42')](_0x5402e9);})[_0x1fb1('0x26')](function(_0x3edc8a){_0x30c8eb[_0x1fb1('0x43')]=_0x3edc8a;return _0x30c8eb;})[_0x1fb1('0x26')](respondWithFilteredResult(_0x1b71cb,_0x5402e9))[_0x1fb1('0x44')](handleError(_0x1b71cb,null));};exports[_0x1fb1('0x45')]=function(_0x14aa27,_0x320bda){var _0x4a943c={'raw':![],'where':{'id':_0x14aa27['params']['id']}},_0x44ccbe={};_0x44ccbe['model']=_[_0x1fb1('0x46')](db[_0x1fb1('0x41')][_0x1fb1('0x47')]);_0x44ccbe[_0x1fb1('0x32')]=_['keys'](_0x14aa27['query']);_0x44ccbe[_0x1fb1('0x33')]=_[_0x1fb1('0x34')](_0x44ccbe[_0x1fb1('0x31')],_0x44ccbe[_0x1fb1('0x32')]);_0x4a943c[_0x1fb1('0x35')]=_[_0x1fb1('0x34')](_0x44ccbe[_0x1fb1('0x31')],qs[_0x1fb1('0x36')](_0x14aa27[_0x1fb1('0x32')]['fields']));_0x4a943c['attributes']=_0x4a943c[_0x1fb1('0x35')]['length']?_0x4a943c[_0x1fb1('0x35')]:_0x44ccbe[_0x1fb1('0x31')];if(_0x14aa27[_0x1fb1('0x32')][_0x1fb1('0x48')]){_0x4a943c[_0x1fb1('0x49')]=[{'all':!![]}];}_0x4a943c=_[_0x1fb1('0x3d')]({},_0x4a943c,_0x14aa27['options']);return db[_0x1fb1('0x41')][_0x1fb1('0x4a')](_0x4a943c)[_0x1fb1('0x26')](handleEntityNotFound(_0x320bda,null))['then'](respondWithResult(_0x320bda,null))[_0x1fb1('0x44')](handleError(_0x320bda,null));};exports['create']=function(_0x6e105b,_0xba4fa7){return db[_0x1fb1('0x41')]['create'](_0x6e105b[_0x1fb1('0x4b')],{})[_0x1fb1('0x26')](respondWithResult(_0xba4fa7,0xc9))['catch'](handleError(_0xba4fa7,null));};exports[_0x1fb1('0x4c')]=function(_0x263161,_0x31a4ef){var _0x5771d5={'where':{'id':_0x263161['params']['id']}},_0x58a576={};_0x58a576[_0x1fb1('0x31')]=_[_0x1fb1('0x46')](db[_0x1fb1('0x41')][_0x1fb1('0x47')]);_0x5771d5[_0x1fb1('0x35')]=_[_0x1fb1('0x34')](_0x58a576['model'],qs['fields'](_0x263161[_0x1fb1('0x32')][_0x1fb1('0x36')]));_0x5771d5[_0x1fb1('0x35')]=_0x5771d5[_0x1fb1('0x35')]['length']?_0x5771d5['attributes']:_0x58a576[_0x1fb1('0x31')];if(_0x263161['query'][_0x1fb1('0x48')]){_0x5771d5['include']=[{'all':!![]}];}_0x5771d5=_[_0x1fb1('0x3d')]({},_0x5771d5,_0x263161['options']);return db[_0x1fb1('0x41')][_0x1fb1('0x4a')](_0x5771d5)[_0x1fb1('0x26')](handleEntityNotFound(_0x31a4ef,null))[_0x1fb1('0x26')](function(_0x1b197c){if(_0x1b197c){var _0x4f09bc=_0x1b197c['get']({'plain':!![]});_0x4f09bc=qs[_0x1fb1('0x4d')](_0x4f09bc,['id',_0x1fb1('0x4e'),'updatedAt','crudPermissions']);_0x263161[_0x1fb1('0x4b')]=_[_0x1fb1('0x4d')](_0x263161[_0x1fb1('0x4b')],['id',_0x1fb1('0x4e'),_0x1fb1('0x4f')]);return db[_0x1fb1('0x50')]['transaction'](function(_0x8c0b96){return db[_0x1fb1('0x41')][_0x1fb1('0x51')](_[_0x1fb1('0x3d')](_0x4f09bc,_0x263161[_0x1fb1('0x4b')]),{'include':_0x263161[_0x1fb1('0x32')][_0x1fb1('0x48')]?[{'all':!![]}]:undefined,'transaction':_0x8c0b96})['then'](function(_0x1fd9e1){var _0x2557a9=_0x1fd9e1[_0x1fb1('0x52')]({'plain':!![]});return db['UserProfileSection'][_0x1fb1('0x42')]({'where':{'userProfileId':_0x263161[_0x1fb1('0x53')]['id']},'raw':!![]})[_0x1fb1('0x26')](function(_0x5ecccb){if(_0x5ecccb){return BPromise[_0x1fb1('0x54')](_0x5ecccb,function(_0x2b232b){return new BPromise(function(_0x101921,_0x4232cf){if(_0x2b232b[_0x1fb1('0x55')]===null||_0x2b232b[_0x1fb1('0x55')]===0x1)_0x101921(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x2b232b['id']},'raw':!![]})[_0x1fb1('0x26')](function(_0x1d7478){var _0x32b126=_[_0x1fb1('0x2e')](_0x1d7478,function(_0xdb1c){return qs[_0x1fb1('0x4d')](_0xdb1c,['id',_0x1fb1('0x4e'),'updatedAt',_0x1fb1('0x56')]);});_0x101921(_0x32b126);})[_0x1fb1('0x44')](function(_0x444efc){_0x4232cf(_0x444efc);});})[_0x1fb1('0x26')](function(_0x37505c){var _0xd87c55=qs['omit'](_0x2b232b,['id',_0x1fb1('0x4e'),_0x1fb1('0x4f')]);_0xd87c55[_0x1fb1('0x57')]=_0x2557a9['id'];if(_0x37505c)_0xd87c55[_0x1fb1('0x58')]=_0x37505c;return _0xd87c55;})[_0x1fb1('0x26')](function(_0x4a74f9){return db[_0x1fb1('0x59')][_0x1fb1('0x51')](_0x4a74f9,{'include':[{'model':db['UserProfileResource'],'as':_0x1fb1('0x58')}],'raw':!![],'transaction':_0x8c0b96});});})['then'](function(){return _0x2557a9;});}});});});}})[_0x1fb1('0x26')](respondWithResult(_0x31a4ef,0xc9))[_0x1fb1('0x44')](handleError(_0x31a4ef,null));};exports[_0x1fb1('0x25')]=function(_0x3b52a7,_0x5b7d81){if(_0x3b52a7[_0x1fb1('0x4b')]['id']){delete _0x3b52a7[_0x1fb1('0x4b')]['id'];}return db[_0x1fb1('0x41')][_0x1fb1('0x4a')]({'where':{'id':_0x3b52a7['params']['id']}})[_0x1fb1('0x26')](handleEntityNotFound(_0x5b7d81,null))['then'](saveUpdates(_0x3b52a7[_0x1fb1('0x4b')],null))[_0x1fb1('0x26')](respondWithResult(_0x5b7d81,null))['catch'](handleError(_0x5b7d81,null));};exports[_0x1fb1('0x27')]=function(_0x3fb4c9,_0xfcb803){return db[_0x1fb1('0x41')][_0x1fb1('0x4a')]({'where':{'id':_0x3fb4c9[_0x1fb1('0x53')]['id']}})[_0x1fb1('0x26')](handleEntityNotFound(_0xfcb803,null))['then'](removeEntity(_0xfcb803,null))[_0x1fb1('0x44')](handleError(_0xfcb803,null));};exports[_0x1fb1('0x5a')]=function(_0x5c2332,_0x48cd0b){return db[_0x1fb1('0x41')][_0x1fb1('0x5a')]()[_0x1fb1('0x26')](respondWithResult(_0x48cd0b,null))[_0x1fb1('0x44')](handleError(_0x48cd0b,null));};exports[_0x1fb1('0x5b')]=function(_0x26715b,_0x39f5ad){var _0x597e51=_0x26715b[_0x1fb1('0x4b')];return db[_0x1fb1('0x41')][_0x1fb1('0x4a')]({'where':{'id':_0x26715b[_0x1fb1('0x53')]['id']}})[_0x1fb1('0x26')](handleEntityNotFound(_0x39f5ad,null))[_0x1fb1('0x26')](function(_0x3c0873){if(_0x3c0873){return db[_0x1fb1('0x50')][_0x1fb1('0x5c')](function(_0x517397){return db[_0x1fb1('0x59')][_0x1fb1('0x27')]({'where':{'userProfileId':_0x26715b['params']['id'],'sectionId':_[_0x1fb1('0x2e')](_0x597e51,function(_0x1416d8){return _0x1416d8[_0x1fb1('0x56')];})},'transaction':_0x517397})['then'](function(){var _0x153ed5=_[_0x1fb1('0x2e')](_0x597e51,function(_0x1d9dc0){_0x1d9dc0[_0x1fb1('0x57')]=_0x26715b[_0x1fb1('0x53')]['id'];return _0x1d9dc0;});var _0x2c4775=[];return BPromise[_0x1fb1('0x54')](_0x153ed5,function(_0x33fe10){return db[_0x1fb1('0x59')][_0x1fb1('0x51')](_0x33fe10,{'include':[{'model':db[_0x1fb1('0x5d')],'as':_0x1fb1('0x58')}],'raw':!![],'transaction':_0x517397})[_0x1fb1('0x26')](function(_0x200555){_0x2c4775[_0x1fb1('0x5e')](_0x200555[_0x1fb1('0x52')]({'plain':!![]}));});})[_0x1fb1('0x26')](function(){return _0x2c4775;});});});}})[_0x1fb1('0x26')](function(_0x18e041){return _0x18e041;})[_0x1fb1('0x26')](respondWithResult(_0x39f5ad,null))[_0x1fb1('0x44')](handleError(_0x39f5ad,null));};exports['removeSections']=function(_0x507b59,_0x3adab6){var _0x4d0c20;return db[_0x1fb1('0x41')][_0x1fb1('0x4a')]({'where':{'id':_0x507b59['params']['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0x3adab6,null))['then'](function(_0x169d9e){if(_0x169d9e){_0x4d0c20=_0x169d9e;return db[_0x1fb1('0x59')][_0x1fb1('0x27')]({'where':{'userProfileId':_0x507b59[_0x1fb1('0x53')]['id'],'sectionId':_0x507b59[_0x1fb1('0x32')][_0x1fb1('0x5f')]}});}})[_0x1fb1('0x26')](function(){return _0x4d0c20;})[_0x1fb1('0x26')](respondWithStatusCode(_0x3adab6,null))['catch'](handleError(_0x3adab6,null));};exports['getSections']=function(_0x45dc47,_0x1ba897){var _0x2ed745=[];var _0x1110e8=[];return db[_0x1fb1('0x59')][_0x1fb1('0x42')]({'where':{'userProfileId':_0x45dc47[_0x1fb1('0x53')]['id']},'raw':!![]})[_0x1fb1('0x26')](function(_0x13a680){_0x2ed745=_[_0x1fb1('0x3c')](_0x13a680,function(_0x570f24){return _0x570f24[_0x1fb1('0x60')]===0x1||_[_0x1fb1('0x61')]([0x3eb,0x709],_0x570f24['sectionId']);});if(!_[_0x1fb1('0x62')](_0x2ed745)){return _[_0x1fb1('0x2e')](_0x2ed745,function(_0x48e66f){return _0x48e66f[_0x1fb1('0x56')];});}else{return;}})[_0x1fb1('0x26')](function(_0x286f7c){if(_0x286f7c)_0x1110e8=_0x286f7c;if(_[_0x1fb1('0x61')](_0x1110e8,0x64)){var _0x50c22f=_[_0x1fb1('0x4a')](_0x2ed745,{'sectionId':0x64});return hasDefaultDashboard(_0x50c22f)[_0x1fb1('0x26')](function(_0x4a5056){return _[_0x1fb1('0x2e')](_0x2ed745,function(_0x52ea00){if(_0x52ea00['sectionId']===0x64){_0x52ea00[_0x1fb1('0x63')]=_0x4a5056;}return _0x52ea00;});});}else{return;}})[_0x1fb1('0x26')](function(_0x9fc0ae){if(_0x9fc0ae)_0x2ed745=_0x9fc0ae;if(_[_0x1fb1('0x61')](_0x1110e8,0x3eb)){var _0x294476=_[_0x1fb1('0x4a')](_0x2ed745,{'sectionId':0x3eb});return getCustomDashboards(_0x294476)['then'](function(_0x474bed){return _[_0x1fb1('0x2e')](_0x2ed745,function(_0x430758){if(_0x294476[_0x1fb1('0x60')]){if(_0x430758['sectionId']===0x3eb){_0x430758[_0x1fb1('0x63')]=_0x474bed;}}else{if(_0x430758[_0x1fb1('0x56')]===0x64){_0x430758['subsections']=_0x474bed;}}return _0x430758;});});}else{return;}})['then'](function(_0x7fa740){if(_0x7fa740)_0x2ed745=_0x7fa740;if(_[_0x1fb1('0x61')](_0x1110e8,0x709)){var _0x317222=_[_0x1fb1('0x4a')](_0x2ed745,{'sectionId':0x709});return getPlugins(_0x317222)['then'](function(_0x18dd72){if(_0x317222['enabled']){return _['map'](_0x2ed745,function(_0x5c6b26){if(_0x5c6b26['sectionId']===0x709){_0x5c6b26[_0x1fb1('0x63')]=_0x18dd72;}return _0x5c6b26;});}else{var _0x39b093={'sectionId':0x76c,'enabled':0x1,'subsections':_0x18dd72};var _0xb4a34=_[_0x1fb1('0x2e')](_0x2ed745);_0xb4a34[_0x1fb1('0x5e')](_0x39b093);return _0xb4a34;}});}else{return;}})[_0x1fb1('0x26')](function(_0x5acf57){if(_0x5acf57)_0x2ed745=_0x5acf57;return _[_0x1fb1('0x3c')](_0x2ed745,[_0x1fb1('0x60'),0x1]);})[_0x1fb1('0x26')](respondWithResult(_0x1ba897,null))[_0x1fb1('0x44')](handleError(_0x1ba897,null));};function hasDefaultDashboard(_0x102756){var _0x212713=[0x65];return new BPromise(function(_0x4fd426,_0x3c94b9){try{if(_0x102756[_0x1fb1('0x55')]){_0x4fd426(_0x212713);}else{return db[_0x1fb1('0x5d')][_0x1fb1('0x64')]({'where':{'sectionId':_0x102756['id']},'raw':!![]})[_0x1fb1('0x26')](function(_0x4abfb7){_0x4abfb7?_0x4fd426(_0x212713):_0x4fd426();});}}catch(_0x38db30){_0x3c94b9(_0x38db30);}});}function getCustomDashboards(_0x4be09a){var _0x426226=[];return new BPromise(function(_0x13b7a1,_0x115f1d){try{if(_0x4be09a[_0x1fb1('0x55')]){return db['Dashboard']['findAll']({'raw':!![]})['then'](function(_0x3ffb18){_0x3ffb18['forEach'](function(_0x4860e0){_0x426226[_0x1fb1('0x5e')](_0x4860e0['id']+0x1869f);});_0x13b7a1(_0x426226);});}else{return db[_0x1fb1('0x5d')][_0x1fb1('0x42')]({'where':{'sectionId':_0x4be09a['id']},'raw':!![]})[_0x1fb1('0x26')](function(_0x3fb0e8){_0x3fb0e8[_0x1fb1('0x65')](function(_0x47a193){_0x426226[_0x1fb1('0x5e')](_0x47a193[_0x1fb1('0x66')]+0x1869f);});_0x13b7a1(_0x426226);});}}catch(_0x21d798){_0x115f1d(_0x21d798);}});}function getPlugins(_0x45c770){var _0x364f00=[];return new BPromise(function(_0xd07208,_0x339300){try{if(_0x45c770[_0x1fb1('0x55')]){return db[_0x1fb1('0x67')]['findAll']({'raw':!![]})[_0x1fb1('0x26')](function(_0x10fcc6){_0x10fcc6[_0x1fb1('0x65')](function(_0x220e36){_0x364f00[_0x1fb1('0x5e')](_0x220e36['id']+0x15b38);});_0xd07208(_0x364f00);});}else{return db['UserProfileResource'][_0x1fb1('0x42')]({'where':{'sectionId':_0x45c770['id']},'raw':!![]})['then'](function(_0x3e19e4){_0x3e19e4['forEach'](function(_0x4eed3d){_0x364f00[_0x1fb1('0x5e')](_0x4eed3d['resourceId']+0x15b38);});_0xd07208(_0x364f00);});}}catch(_0x49e286){_0x339300(_0x49e286);}});}exports['addResources']=function(_0x2b5a14,_0x4b6faa){return db[_0x1fb1('0x41')][_0x1fb1('0x4a')]({'where':{'id':_0x2b5a14[_0x1fb1('0x53')]['id']}})[_0x1fb1('0x26')](handleEntityNotFound(_0x4b6faa,null))[_0x1fb1('0x26')](function(_0x4f51fb){if(_0x4f51fb){return db[_0x1fb1('0x50')][_0x1fb1('0x5c')](function(_0x377741){return db[_0x1fb1('0x59')][_0x1fb1('0x42')]({'where':{'userProfileId':_0x2b5a14[_0x1fb1('0x53')]['id']},'attributes':['id'],'raw':!![]})[_0x1fb1('0x26')](function(_0x44029b){if(_0x44029b){return db[_0x1fb1('0x59')][_0x1fb1('0x27')]({'where':{'userProfileId':_0x2b5a14[_0x1fb1('0x53')]['id'],'id':_[_0x1fb1('0x2e')](_0x44029b,function(_0x4cd96a){return _0x4cd96a['id'];})},'transaction':_0x377741});}})['then'](function(_0x8be954){var _0x3116c7=_[_0x1fb1('0x2e')](_0x2b5a14[_0x1fb1('0x4b')],function(_0x4f149b){_0x4f149b[_0x1fb1('0x57')]=_0x2b5a14[_0x1fb1('0x53')]['id'];return _0x4f149b;});return db[_0x1fb1('0x59')][_0x1fb1('0x68')](_0x3116c7,{'raw':!![],'transaction':_0x377741});})[_0x1fb1('0x26')](function(_0x59bcc0){var _0x144f8f=_[_0x1fb1('0x3c')](_[_0x1fb1('0x2e')](_0x59bcc0,function(_0x1455e4){return _0x1455e4[_0x1fb1('0x52')]({'plain':!![]});}),{'includeAll':![]});if(_0x144f8f){return db['UserProfileSection'][_0x1fb1('0x42')]({'where':{'userProfileId':_0x2b5a14['params']['id'],'sectionId':_[_0x1fb1('0x2e')](_0x144f8f,function(_0x4cc416){return _0x4cc416[_0x1fb1('0x56')];})},'attributes':['id',_0x1fb1('0x56')],'raw':!![]})[_0x1fb1('0x26')](function(_0x58410b){var _0x3c8e90=_[_0x1fb1('0x2e')](_0x2b5a14[_0x1fb1('0x4b')],function(_0x419775){_0x419775[_0x1fb1('0x57')]=_0x2b5a14[_0x1fb1('0x53')]['id'];return _0x419775;});return db[_0x1fb1('0x5d')][_0x1fb1('0x68')](_0x3c8e90,{'raw':!![],'transaction':_0x377741});});}})['catch'](handleError(_0x4b6faa,null));});}})['then'](function(_0x1d3789){var _0x3ae4d1=_['map'](_0x1d3789,function(_0x3ab6dc){return _0x3ab6dc[_0x1fb1('0x52')]({'plain':!![]});});})[_0x1fb1('0x26')](respondWithResult(_0x4b6faa,null))[_0x1fb1('0x44')](handleError(_0x4b6faa,null));};exports[_0x1fb1('0x69')]=function(_0x2f021f,_0x219015,_0x4038da){return db['UserProfile']['find']({'where':{'id':_0x2f021f['params']['id']}})[_0x1fb1('0x26')](handleEntityNotFound(_0x219015,null))[_0x1fb1('0x26')](function(_0x224261){if(_0x224261){return _0x224261[_0x1fb1('0x69')](_0x2f021f['query'][_0x1fb1('0x5f')]);}})[_0x1fb1('0x26')](respondWithStatusCode(_0x219015,null))['catch'](handleError(_0x219015,null));};exports[_0x1fb1('0x6a')]=function(_0x1406e8,_0xf30beb){var _0x1d7a69={};if(!_0x1406e8[_0x1fb1('0x32')][_0x1fb1('0x6b')])throw new Error('Missing\x20section\x20parameter');if(!_0x1406e8['query'][_0x1fb1('0x37')](_0x1fb1('0x38'))){_0x1d7a69[_0x1fb1('0x21')]=qs['limit'](_0x1406e8[_0x1fb1('0x32')][_0x1fb1('0x21')]);_0x1d7a69[_0x1fb1('0x1f')]=qs['offset'](_0x1406e8[_0x1fb1('0x32')][_0x1fb1('0x1f')]);}return db['UserProfile']['find']({'where':{'id':_0x1406e8[_0x1fb1('0x53')]['id']}})[_0x1fb1('0x26')](function(_0x319635){if(!_0x319635)throw new Error(_0x1fb1('0x6c')+_0x1406e8['params']['id']);return db[_0x1fb1('0x41')][_0x1fb1('0x6a')](_0x1406e8);})[_0x1fb1('0x26')](respondWithFilteredResult(_0xf30beb,_0x1d7a69))['catch'](handleError(_0xf30beb,null));};
\ No newline at end of file
+var _0xf08c=['map','UserProfile','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','type','options','count','findAll','show','params','rawAttributes','includeAll','include','find','catch','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','sectionId','userProfileId','Resources','describe','addSections','UserProfileResource','removeSections','getSections','enabled','includes','isEmpty','subsections','push','autoAssociation','findOne','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','ids','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','offset','undefined','limit','Content-Range','json','reject','update','destroy','then','error','stack','name','send','index'];(function(_0x3cf2e9,_0x49c280){var _0x460ab3=function(_0x4e1ef5){while(--_0x4e1ef5){_0x3cf2e9['push'](_0x3cf2e9['shift']());}};_0x460ab3(++_0x49c280);}(_0xf08c,0xb5));var _0xcf08=function(_0x36a629,_0x11cc92){_0x36a629=_0x36a629-0x0;var _0x5af0ca=_0xf08c[_0x36a629];return _0x5af0ca;};'use strict';var emlformat=require(_0xcf08('0x0'));var rimraf=require(_0xcf08('0x1'));var zipdir=require(_0xcf08('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf08('0x3'));var moment=require(_0xcf08('0x4'));var BPromise=require(_0xcf08('0x5'));var Mustache=require(_0xcf08('0x6'));var util=require('util');var path=require('path');var sox=require(_0xcf08('0x7'));var csv=require(_0xcf08('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf08('0x9'));var _=require(_0xcf08('0xa'));var squel=require(_0xcf08('0xb'));var crypto=require(_0xcf08('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcf08('0x8'));var querystring=require('querystring');var Papa=require(_0xcf08('0xd'));var Redis=require(_0xcf08('0xe'));var authService=require(_0xcf08('0xf'));var qs=require(_0xcf08('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf08('0x11'));var logger=require(_0xcf08('0x12'))(_0xcf08('0x13'));var utils=require(_0xcf08('0x14'));var config=require(_0xcf08('0x15'));var licenseUtil=require(_0xcf08('0x16'));var db=require(_0xcf08('0x17'))['db'];config[_0xcf08('0x18')]=_[_0xcf08('0x19')](config[_0xcf08('0x18')],{'host':_0xcf08('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userProfile.socket')[_0xcf08('0x1b')](socket);function respondWithStatusCode(_0x1d727f,_0x5976da){_0x5976da=_0x5976da||0xcc;return function(_0x1a131d){if(_0x1a131d){return _0x1d727f[_0xcf08('0x1c')](_0x5976da);}return _0x1d727f[_0xcf08('0x1d')](_0x5976da)[_0xcf08('0x1e')]();};}function respondWithResult(_0xf97f6e,_0x4efc1a){_0x4efc1a=_0x4efc1a||0xc8;return function(_0xa838ef){if(_0xa838ef){return _0xf97f6e['status'](_0x4efc1a)['json'](_0xa838ef);}};}function respondWithFilteredResult(_0x4072c7,_0x798fc2){return function(_0x4c4970){if(_0x4c4970){var _0x2e5027=typeof _0x798fc2[_0xcf08('0x1f')]===_0xcf08('0x20')&&typeof _0x798fc2[_0xcf08('0x21')]===_0xcf08('0x20');var _0x3b9a4b=_0x4c4970['count'];var _0x386fe3=_0x2e5027?0x0:_0x798fc2[_0xcf08('0x1f')];var _0x43174e=_0x2e5027?_0x4c4970['count']:_0x798fc2[_0xcf08('0x1f')]+_0x798fc2['limit'];var _0x633937;if(_0x43174e>=_0x3b9a4b){_0x43174e=_0x3b9a4b;_0x633937=0xc8;}else{_0x633937=0xce;}_0x4072c7[_0xcf08('0x1d')](_0x633937);return _0x4072c7['set'](_0xcf08('0x22'),_0x386fe3+'-'+_0x43174e+'/'+_0x3b9a4b)[_0xcf08('0x23')](_0x4c4970);}return null;};}function patchUpdates(_0x209d5d){return function(_0x361c7f){try{jsonpatch['apply'](_0x361c7f,_0x209d5d,!![]);}catch(_0x31aceb){return BPromise[_0xcf08('0x24')](_0x31aceb);}return _0x361c7f['save']();};}function saveUpdates(_0x39ba73,_0x50c926){return function(_0xa21bc2){if(_0xa21bc2){return _0xa21bc2[_0xcf08('0x25')](_0x39ba73)['then'](function(_0x2a4b96){return _0x2a4b96;});}return null;};}function removeEntity(_0x32d41d,_0x27f0bc){return function(_0x213511){if(_0x213511){return _0x213511[_0xcf08('0x26')]()[_0xcf08('0x27')](function(){_0x32d41d[_0xcf08('0x1d')](0xcc)[_0xcf08('0x1e')]();});}};}function handleEntityNotFound(_0x8ad51d,_0x306ac7){return function(_0x4bfaad){if(!_0x4bfaad){_0x8ad51d['sendStatus'](0x194);}return _0x4bfaad;};}function handleError(_0x371741,_0x37035d){_0x37035d=_0x37035d||0x1f4;return function(_0x4a98d7){logger[_0xcf08('0x28')](_0x4a98d7[_0xcf08('0x29')]);if(_0x4a98d7[_0xcf08('0x2a')]){delete _0x4a98d7[_0xcf08('0x2a')];}_0x371741[_0xcf08('0x1d')](_0x37035d)[_0xcf08('0x2b')](_0x4a98d7);};}exports[_0xcf08('0x2c')]=function(_0x29f65d,_0xf482f8){var _0x315b96={},_0x28636b={},_0x242edd={'count':0x0,'rows':[]};var _0x2e6543=_[_0xcf08('0x2d')](db[_0xcf08('0x2e')]['rawAttributes'],function(_0x3a544c){return{'name':_0x3a544c['fieldName'],'type':_0x3a544c['type'][_0xcf08('0x2f')]};});_0x28636b['model']=_['map'](_0x2e6543,'name');_0x28636b[_0xcf08('0x30')]=_[_0xcf08('0x31')](_0x29f65d[_0xcf08('0x30')]);_0x28636b['filters']=_['intersection'](_0x28636b[_0xcf08('0x32')],_0x28636b[_0xcf08('0x30')]);_0x315b96[_0xcf08('0x33')]=_[_0xcf08('0x34')](_0x28636b[_0xcf08('0x32')],qs[_0xcf08('0x35')](_0x29f65d[_0xcf08('0x30')]['fields']));_0x315b96[_0xcf08('0x33')]=_0x315b96['attributes'][_0xcf08('0x36')]?_0x315b96[_0xcf08('0x33')]:_0x28636b['model'];if(!_0x29f65d[_0xcf08('0x30')][_0xcf08('0x37')](_0xcf08('0x38'))){_0x315b96['limit']=qs['limit'](_0x29f65d[_0xcf08('0x30')][_0xcf08('0x21')]);_0x315b96[_0xcf08('0x1f')]=qs[_0xcf08('0x1f')](_0x29f65d[_0xcf08('0x30')][_0xcf08('0x1f')]);}_0x315b96[_0xcf08('0x39')]=qs[_0xcf08('0x3a')](_0x29f65d[_0xcf08('0x30')][_0xcf08('0x3a')]);_0x315b96['where']=qs['filters'](_[_0xcf08('0x3b')](_0x29f65d[_0xcf08('0x30')],_0x28636b[_0xcf08('0x3c')]),_0x2e6543);if(_0x29f65d[_0xcf08('0x30')][_0xcf08('0x3d')]){_0x315b96[_0xcf08('0x3e')]=_[_0xcf08('0x3f')](_0x315b96[_0xcf08('0x3e')],{'$or':_['map'](_0x2e6543,function(_0x1aae6f){if(_0x1aae6f[_0xcf08('0x40')]!=='VIRTUAL'){var _0x2795fc={};_0x2795fc[_0x1aae6f['name']]={'$like':'%'+_0x29f65d[_0xcf08('0x30')][_0xcf08('0x3d')]+'%'};return _0x2795fc;}})});}_0x315b96=_[_0xcf08('0x3f')]({},_0x315b96,_0x29f65d[_0xcf08('0x41')]);var _0x1b6047={'where':_0x315b96[_0xcf08('0x3e')]};return db[_0xcf08('0x2e')][_0xcf08('0x42')](_0x1b6047)['then'](function(_0x2f7495){_0x242edd[_0xcf08('0x42')]=_0x2f7495;if(_0x29f65d[_0xcf08('0x30')]['includeAll']){_0x315b96['include']=[{'all':!![]}];}return db[_0xcf08('0x2e')][_0xcf08('0x43')](_0x315b96);})[_0xcf08('0x27')](function(_0x907b7e){_0x242edd['rows']=_0x907b7e;return _0x242edd;})[_0xcf08('0x27')](respondWithFilteredResult(_0xf482f8,_0x315b96))['catch'](handleError(_0xf482f8,null));};exports[_0xcf08('0x44')]=function(_0x19cb89,_0x438d8a){var _0x486375={'raw':![],'where':{'id':_0x19cb89[_0xcf08('0x45')]['id']}},_0x420f7d={};_0x420f7d[_0xcf08('0x32')]=_[_0xcf08('0x31')](db[_0xcf08('0x2e')][_0xcf08('0x46')]);_0x420f7d[_0xcf08('0x30')]=_[_0xcf08('0x31')](_0x19cb89[_0xcf08('0x30')]);_0x420f7d['filters']=_[_0xcf08('0x34')](_0x420f7d[_0xcf08('0x32')],_0x420f7d[_0xcf08('0x30')]);_0x486375[_0xcf08('0x33')]=_[_0xcf08('0x34')](_0x420f7d['model'],qs[_0xcf08('0x35')](_0x19cb89[_0xcf08('0x30')][_0xcf08('0x35')]));_0x486375[_0xcf08('0x33')]=_0x486375[_0xcf08('0x33')][_0xcf08('0x36')]?_0x486375[_0xcf08('0x33')]:_0x420f7d[_0xcf08('0x32')];if(_0x19cb89[_0xcf08('0x30')][_0xcf08('0x47')]){_0x486375[_0xcf08('0x48')]=[{'all':!![]}];}_0x486375=_[_0xcf08('0x3f')]({},_0x486375,_0x19cb89[_0xcf08('0x41')]);return db[_0xcf08('0x2e')][_0xcf08('0x49')](_0x486375)[_0xcf08('0x27')](handleEntityNotFound(_0x438d8a,null))[_0xcf08('0x27')](respondWithResult(_0x438d8a,null))[_0xcf08('0x4a')](handleError(_0x438d8a,null));};exports[_0xcf08('0x4b')]=function(_0x52d03d,_0x559c3b){return db[_0xcf08('0x2e')][_0xcf08('0x4b')](_0x52d03d[_0xcf08('0x4c')],{})[_0xcf08('0x27')](respondWithResult(_0x559c3b,0xc9))[_0xcf08('0x4a')](handleError(_0x559c3b,null));};exports[_0xcf08('0x4d')]=function(_0x4cd7b2,_0x34cdb0){var _0x2d8168={'where':{'id':_0x4cd7b2[_0xcf08('0x45')]['id']}},_0x36e753={};_0x36e753[_0xcf08('0x32')]=_[_0xcf08('0x31')](db['UserProfile'][_0xcf08('0x46')]);_0x2d8168[_0xcf08('0x33')]=_[_0xcf08('0x34')](_0x36e753['model'],qs[_0xcf08('0x35')](_0x4cd7b2[_0xcf08('0x30')][_0xcf08('0x35')]));_0x2d8168[_0xcf08('0x33')]=_0x2d8168[_0xcf08('0x33')][_0xcf08('0x36')]?_0x2d8168['attributes']:_0x36e753[_0xcf08('0x32')];if(_0x4cd7b2[_0xcf08('0x30')]['includeAll']){_0x2d8168[_0xcf08('0x48')]=[{'all':!![]}];}_0x2d8168=_[_0xcf08('0x3f')]({},_0x2d8168,_0x4cd7b2[_0xcf08('0x41')]);return db['UserProfile']['find'](_0x2d8168)[_0xcf08('0x27')](handleEntityNotFound(_0x34cdb0,null))[_0xcf08('0x27')](function(_0xc059dd){if(_0xc059dd){var _0x2bf669=_0xc059dd[_0xcf08('0x4e')]({'plain':!![]});_0x2bf669=qs[_0xcf08('0x4f')](_0x2bf669,['id',_0xcf08('0x50'),_0xcf08('0x51'),_0xcf08('0x52')]);_0x4cd7b2[_0xcf08('0x4c')]=_['omit'](_0x4cd7b2['body'],['id',_0xcf08('0x50'),'updatedAt']);return db[_0xcf08('0x53')][_0xcf08('0x54')](function(_0x4a05fc){return db[_0xcf08('0x2e')][_0xcf08('0x4b')](_['merge'](_0x2bf669,_0x4cd7b2[_0xcf08('0x4c')]),{'include':_0x4cd7b2['query'][_0xcf08('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x4a05fc})['then'](function(_0x4c7bc6){var _0x218a1e=_0x4c7bc6['get']({'plain':!![]});return db[_0xcf08('0x55')][_0xcf08('0x43')]({'where':{'userProfileId':_0x4cd7b2[_0xcf08('0x45')]['id']},'raw':!![]})[_0xcf08('0x27')](function(_0x5b25c4){if(_0x5b25c4){return BPromise[_0xcf08('0x56')](_0x5b25c4,function(_0x58b30e){return new BPromise(function(_0x2ba63c,_0x537bce){if(_0x58b30e['autoAssociation']===null||_0x58b30e['autoAssociation']===0x1)_0x2ba63c(null);return db['UserProfileResource'][_0xcf08('0x43')]({'where':{'sectionId':_0x58b30e['id']},'raw':!![]})['then'](function(_0x41a665){var _0xafe320=_[_0xcf08('0x2d')](_0x41a665,function(_0x3a0615){return qs[_0xcf08('0x4f')](_0x3a0615,['id',_0xcf08('0x50'),_0xcf08('0x51'),_0xcf08('0x57')]);});_0x2ba63c(_0xafe320);})[_0xcf08('0x4a')](function(_0x19ca45){_0x537bce(_0x19ca45);});})[_0xcf08('0x27')](function(_0x45557e){var _0x1f3c7d=qs[_0xcf08('0x4f')](_0x58b30e,['id','createdAt',_0xcf08('0x51')]);_0x1f3c7d[_0xcf08('0x58')]=_0x218a1e['id'];if(_0x45557e)_0x1f3c7d['Resources']=_0x45557e;return _0x1f3c7d;})[_0xcf08('0x27')](function(_0x3773d6){return db[_0xcf08('0x55')][_0xcf08('0x4b')](_0x3773d6,{'include':[{'model':db['UserProfileResource'],'as':_0xcf08('0x59')}],'raw':!![],'transaction':_0x4a05fc});});})[_0xcf08('0x27')](function(){return _0x218a1e;});}});});});}})[_0xcf08('0x27')](respondWithResult(_0x34cdb0,0xc9))['catch'](handleError(_0x34cdb0,null));};exports[_0xcf08('0x25')]=function(_0x4a7b7c,_0x57c1e3){if(_0x4a7b7c[_0xcf08('0x4c')]['id']){delete _0x4a7b7c[_0xcf08('0x4c')]['id'];}return db['UserProfile'][_0xcf08('0x49')]({'where':{'id':_0x4a7b7c[_0xcf08('0x45')]['id']}})[_0xcf08('0x27')](handleEntityNotFound(_0x57c1e3,null))[_0xcf08('0x27')](saveUpdates(_0x4a7b7c['body'],null))['then'](respondWithResult(_0x57c1e3,null))[_0xcf08('0x4a')](handleError(_0x57c1e3,null));};exports['destroy']=function(_0x4c1630,_0x389fcf){return db[_0xcf08('0x2e')]['find']({'where':{'id':_0x4c1630[_0xcf08('0x45')]['id']}})['then'](handleEntityNotFound(_0x389fcf,null))[_0xcf08('0x27')](removeEntity(_0x389fcf,null))[_0xcf08('0x4a')](handleError(_0x389fcf,null));};exports['describe']=function(_0x8f0bfa,_0x4010c3){return db[_0xcf08('0x2e')][_0xcf08('0x5a')]()[_0xcf08('0x27')](respondWithResult(_0x4010c3,null))[_0xcf08('0x4a')](handleError(_0x4010c3,null));};exports[_0xcf08('0x5b')]=function(_0x4fdc59,_0x4202eb){var _0x57f236=_0x4fdc59[_0xcf08('0x4c')];return db[_0xcf08('0x2e')][_0xcf08('0x49')]({'where':{'id':_0x4fdc59[_0xcf08('0x45')]['id']}})[_0xcf08('0x27')](handleEntityNotFound(_0x4202eb,null))[_0xcf08('0x27')](function(_0x740feb){if(_0x740feb){return db[_0xcf08('0x53')][_0xcf08('0x54')](function(_0x109ab5){return db[_0xcf08('0x55')]['destroy']({'where':{'userProfileId':_0x4fdc59[_0xcf08('0x45')]['id'],'sectionId':_[_0xcf08('0x2d')](_0x57f236,function(_0x21a907){return _0x21a907[_0xcf08('0x57')];})},'transaction':_0x109ab5})[_0xcf08('0x27')](function(){var _0x4ea8fc=_[_0xcf08('0x2d')](_0x57f236,function(_0x5c09ff){_0x5c09ff[_0xcf08('0x58')]=_0x4fdc59[_0xcf08('0x45')]['id'];return _0x5c09ff;});var _0x2d93ce=[];return BPromise[_0xcf08('0x56')](_0x4ea8fc,function(_0x30e8c6){return db['UserProfileSection'][_0xcf08('0x4b')](_0x30e8c6,{'include':[{'model':db[_0xcf08('0x5c')],'as':_0xcf08('0x59')}],'raw':!![],'transaction':_0x109ab5})[_0xcf08('0x27')](function(_0x201790){_0x2d93ce['push'](_0x201790[_0xcf08('0x4e')]({'plain':!![]}));});})[_0xcf08('0x27')](function(){return _0x2d93ce;});});});}})['then'](function(_0xd5ac41){return _0xd5ac41;})['then'](respondWithResult(_0x4202eb,null))[_0xcf08('0x4a')](handleError(_0x4202eb,null));};exports[_0xcf08('0x5d')]=function(_0x2409fe,_0x598865){var _0x1a0567;return db[_0xcf08('0x2e')][_0xcf08('0x49')]({'where':{'id':_0x2409fe[_0xcf08('0x45')]['id']},'attributes':['id','name']})[_0xcf08('0x27')](handleEntityNotFound(_0x598865,null))[_0xcf08('0x27')](function(_0x35ce02){if(_0x35ce02){_0x1a0567=_0x35ce02;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x2409fe[_0xcf08('0x45')]['id'],'sectionId':_0x2409fe['query']['ids']}});}})[_0xcf08('0x27')](function(){return _0x1a0567;})['then'](respondWithStatusCode(_0x598865,null))[_0xcf08('0x4a')](handleError(_0x598865,null));};exports[_0xcf08('0x5e')]=function(_0x50f8bd,_0x53ec27){var _0x379f0a=[];var _0x3527fc=[];return db[_0xcf08('0x55')]['findAll']({'where':{'userProfileId':_0x50f8bd[_0xcf08('0x45')]['id']},'raw':!![]})[_0xcf08('0x27')](function(_0x554211){_0x379f0a=_[_0xcf08('0x3d')](_0x554211,function(_0x4935a7){return _0x4935a7[_0xcf08('0x5f')]===0x1||_[_0xcf08('0x60')]([0x3eb,0x709],_0x4935a7['sectionId']);});if(!_[_0xcf08('0x61')](_0x379f0a)){return _['map'](_0x379f0a,function(_0x239cac){return _0x239cac[_0xcf08('0x57')];});}else{return;}})[_0xcf08('0x27')](function(_0xca7b34){if(_0xca7b34)_0x3527fc=_0xca7b34;if(_[_0xcf08('0x60')](_0x3527fc,0x64)){var _0x366737=_['find'](_0x379f0a,{'sectionId':0x64});return hasDefaultDashboard(_0x366737)['then'](function(_0x6bbd9f){return _[_0xcf08('0x2d')](_0x379f0a,function(_0x575662){if(_0x575662[_0xcf08('0x57')]===0x64){_0x575662['subsections']=_0x6bbd9f;}return _0x575662;});});}else{return;}})[_0xcf08('0x27')](function(_0x21753d){if(_0x21753d)_0x379f0a=_0x21753d;if(_[_0xcf08('0x60')](_0x3527fc,0x3eb)){var _0x4b7549=_[_0xcf08('0x49')](_0x379f0a,{'sectionId':0x3eb});return getCustomDashboards(_0x4b7549)['then'](function(_0x2db692){return _[_0xcf08('0x2d')](_0x379f0a,function(_0x58c490){if(_0x4b7549[_0xcf08('0x5f')]){if(_0x58c490[_0xcf08('0x57')]===0x3eb){_0x58c490[_0xcf08('0x62')]=_0x2db692;}}else{if(_0x58c490[_0xcf08('0x57')]===0x64){_0x58c490['subsections']=_0x2db692;}}return _0x58c490;});});}else{return;}})['then'](function(_0x103b74){if(_0x103b74)_0x379f0a=_0x103b74;if(_[_0xcf08('0x60')](_0x3527fc,0x709)){var _0xb682c7=_[_0xcf08('0x49')](_0x379f0a,{'sectionId':0x709});return getPlugins(_0xb682c7)[_0xcf08('0x27')](function(_0x51ab43){if(_0xb682c7['enabled']){return _[_0xcf08('0x2d')](_0x379f0a,function(_0x4b658d){if(_0x4b658d[_0xcf08('0x57')]===0x709){_0x4b658d['subsections']=_0x51ab43;}return _0x4b658d;});}else{var _0x45fc65={'sectionId':0x76c,'enabled':0x1,'subsections':_0x51ab43};var _0x3f603e=_['map'](_0x379f0a);_0x3f603e[_0xcf08('0x63')](_0x45fc65);return _0x3f603e;}});}else{return;}})[_0xcf08('0x27')](function(_0x3a555b){if(_0x3a555b)_0x379f0a=_0x3a555b;return _[_0xcf08('0x3d')](_0x379f0a,[_0xcf08('0x5f'),0x1]);})[_0xcf08('0x27')](respondWithResult(_0x53ec27,null))[_0xcf08('0x4a')](handleError(_0x53ec27,null));};function hasDefaultDashboard(_0xeb5989){var _0x4f69fb=[0x65];return new BPromise(function(_0x240d4b,_0xdf2977){try{if(_0xeb5989[_0xcf08('0x64')]){_0x240d4b(_0x4f69fb);}else{return db[_0xcf08('0x5c')][_0xcf08('0x65')]({'where':{'sectionId':_0xeb5989['id']},'raw':!![]})['then'](function(_0x558486){_0x558486?_0x240d4b(_0x4f69fb):_0x240d4b();});}}catch(_0x463c7a){_0xdf2977(_0x463c7a);}});}function getCustomDashboards(_0x71f20){var _0x2528d5=[];return new BPromise(function(_0x566c1f,_0xea2d8){try{if(_0x71f20['autoAssociation']){return db[_0xcf08('0x66')][_0xcf08('0x43')]({'raw':!![]})['then'](function(_0xe9fd1){_0xe9fd1[_0xcf08('0x67')](function(_0x33c5ad){_0x2528d5[_0xcf08('0x63')](_0x33c5ad['id']+0x1869f);});_0x566c1f(_0x2528d5);});}else{return db[_0xcf08('0x5c')]['findAll']({'where':{'sectionId':_0x71f20['id']},'raw':!![]})[_0xcf08('0x27')](function(_0x1b820d){_0x1b820d[_0xcf08('0x67')](function(_0x4a5e04){_0x2528d5[_0xcf08('0x63')](_0x4a5e04[_0xcf08('0x68')]+0x1869f);});_0x566c1f(_0x2528d5);});}}catch(_0x32ca75){_0xea2d8(_0x32ca75);}});}function getPlugins(_0x3c0258){var _0x2e577e=[];return new BPromise(function(_0x58b504,_0x7ae6e5){try{if(_0x3c0258[_0xcf08('0x64')]){return db[_0xcf08('0x69')][_0xcf08('0x43')]({'raw':!![]})[_0xcf08('0x27')](function(_0x504480){_0x504480['forEach'](function(_0x2a2904){_0x2e577e[_0xcf08('0x63')](_0x2a2904['id']+0x15b38);});_0x58b504(_0x2e577e);});}else{return db[_0xcf08('0x5c')][_0xcf08('0x43')]({'where':{'sectionId':_0x3c0258['id']},'raw':!![]})['then'](function(_0x1facf5){_0x1facf5['forEach'](function(_0x3945f7){_0x2e577e[_0xcf08('0x63')](_0x3945f7['resourceId']+0x15b38);});_0x58b504(_0x2e577e);});}}catch(_0x3539f9){_0x7ae6e5(_0x3539f9);}});}exports['addResources']=function(_0x5a390d,_0x38b733){return db[_0xcf08('0x2e')]['find']({'where':{'id':_0x5a390d[_0xcf08('0x45')]['id']}})[_0xcf08('0x27')](handleEntityNotFound(_0x38b733,null))[_0xcf08('0x27')](function(_0x5568c2){if(_0x5568c2){return db[_0xcf08('0x53')][_0xcf08('0x54')](function(_0x2f116f){return db[_0xcf08('0x55')][_0xcf08('0x43')]({'where':{'userProfileId':_0x5a390d[_0xcf08('0x45')]['id']},'attributes':['id'],'raw':!![]})[_0xcf08('0x27')](function(_0x293476){if(_0x293476){return db['UserProfileSection'][_0xcf08('0x26')]({'where':{'userProfileId':_0x5a390d[_0xcf08('0x45')]['id'],'id':_[_0xcf08('0x2d')](_0x293476,function(_0x39f145){return _0x39f145['id'];})},'transaction':_0x2f116f});}})[_0xcf08('0x27')](function(_0x3eb343){var _0x8a054e=_[_0xcf08('0x2d')](_0x5a390d[_0xcf08('0x4c')],function(_0x1a2e65){_0x1a2e65[_0xcf08('0x58')]=_0x5a390d['params']['id'];return _0x1a2e65;});return db[_0xcf08('0x55')]['bulkCreate'](_0x8a054e,{'raw':!![],'transaction':_0x2f116f});})[_0xcf08('0x27')](function(_0x199fef){var _0x424395=_[_0xcf08('0x3d')](_[_0xcf08('0x2d')](_0x199fef,function(_0x39861a){return _0x39861a['get']({'plain':!![]});}),{'includeAll':![]});if(_0x424395){return db[_0xcf08('0x55')][_0xcf08('0x43')]({'where':{'userProfileId':_0x5a390d[_0xcf08('0x45')]['id'],'sectionId':_[_0xcf08('0x2d')](_0x424395,function(_0x109961){return _0x109961[_0xcf08('0x57')];})},'attributes':['id',_0xcf08('0x57')],'raw':!![]})[_0xcf08('0x27')](function(_0x376117){var _0x456209=_[_0xcf08('0x2d')](_0x5a390d[_0xcf08('0x4c')],function(_0x3074f6){_0x3074f6[_0xcf08('0x58')]=_0x5a390d[_0xcf08('0x45')]['id'];return _0x3074f6;});return db[_0xcf08('0x5c')][_0xcf08('0x6a')](_0x456209,{'raw':!![],'transaction':_0x2f116f});});}})[_0xcf08('0x4a')](handleError(_0x38b733,null));});}})[_0xcf08('0x27')](function(_0x292c98){var _0x5925bc=_['map'](_0x292c98,function(_0x2c6aad){return _0x2c6aad['get']({'plain':!![]});});})[_0xcf08('0x27')](respondWithResult(_0x38b733,null))['catch'](handleError(_0x38b733,null));};exports['removeResources']=function(_0x44070e,_0xb9d4d5,_0x5e496f){return db['UserProfile'][_0xcf08('0x49')]({'where':{'id':_0x44070e[_0xcf08('0x45')]['id']}})[_0xcf08('0x27')](handleEntityNotFound(_0xb9d4d5,null))['then'](function(_0x37e166){if(_0x37e166){return _0x37e166[_0xcf08('0x6b')](_0x44070e[_0xcf08('0x30')][_0xcf08('0x6c')]);}})['then'](respondWithStatusCode(_0xb9d4d5,null))[_0xcf08('0x4a')](handleError(_0xb9d4d5,null));};exports['getResources']=function(_0x2eef6a,_0x5ee59a){var _0x4d53a2={};if(!_0x2eef6a[_0xcf08('0x30')][_0xcf08('0x6d')])throw new Error(_0xcf08('0x6e'));if(!_0x2eef6a[_0xcf08('0x30')][_0xcf08('0x37')](_0xcf08('0x38'))){_0x4d53a2[_0xcf08('0x21')]=qs[_0xcf08('0x21')](_0x2eef6a[_0xcf08('0x30')][_0xcf08('0x21')]);_0x4d53a2['offset']=qs[_0xcf08('0x1f')](_0x2eef6a[_0xcf08('0x30')][_0xcf08('0x1f')]);}return db[_0xcf08('0x2e')][_0xcf08('0x49')]({'where':{'id':_0x2eef6a[_0xcf08('0x45')]['id']}})[_0xcf08('0x27')](function(_0x196e6c){if(!_0x196e6c)throw new Error(_0xcf08('0x6f')+_0x2eef6a[_0xcf08('0x45')]['id']);return db[_0xcf08('0x2e')][_0xcf08('0x70')](_0x2eef6a);})[_0xcf08('0x27')](respondWithFilteredResult(_0x5ee59a,_0x4d53a2))[_0xcf08('0x4a')](handleError(_0x5ee59a,null));};
\ No newline at end of file
index 144c95f..d94f487 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f37=['../../mysqldb','setMaxListeners','remove','emit','hook','exports','events'];(function(_0x54ca8f,_0x14a848){var _0x3070e7=function(_0x47fcb7){while(--_0x47fcb7){_0x54ca8f['push'](_0x54ca8f['shift']());}};_0x3070e7(++_0x14a848);}(_0x9f37,0xd1));var _0x79f3=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x9f37[_0x2be8c2];return _0x97f531;};'use strict';var EventEmitter=require(_0x79f3('0x0'));var UserProfile=require(_0x79f3('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x79f3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x79f3('0x3')};function emitEvent(_0x3c3d35){return function(_0x4b11da,_0x599d3a,_0x361808){UserProfileEvents[_0x79f3('0x4')](_0x3c3d35+':'+_0x4b11da['id'],_0x4b11da);UserProfileEvents['emit'](_0x3c3d35,_0x4b11da);_0x361808(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x79f3('0x5')](e,emitEvent(event));}}module[_0x79f3('0x6')]=UserProfileEvents;
\ No newline at end of file
+var _0xd663=['update','remove','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x78626,_0x129a84){var _0xc8cfab=function(_0x3e4366){while(--_0x3e4366){_0x78626['push'](_0x78626['shift']());}};_0xc8cfab(++_0x129a84);}(_0xd663,0x1ed));var _0x3d66=function(_0xd0c045,_0x32b679){_0xd0c045=_0xd0c045-0x0;var _0xc7f536=_0xd663[_0xd0c045];return _0xc7f536;};'use strict';var EventEmitter=require(_0x3d66('0x0'));var UserProfile=require(_0x3d66('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x3d66('0x2')](0x0);var events={'afterCreate':_0x3d66('0x3'),'afterUpdate':_0x3d66('0x4'),'afterDestroy':_0x3d66('0x5')};function emitEvent(_0xb5a453){return function(_0x4e9001,_0x28d76b,_0x533dcc){UserProfileEvents['emit'](_0xb5a453+':'+_0x4e9001['id'],_0x4e9001);UserProfileEvents['emit'](_0xb5a453,_0x4e9001);_0x533dcc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x3d66('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents;
\ No newline at end of file
index 0e4de17..7a0df74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd117=['foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','ids','color','tag','ThroughTags','rows','openTabs','true','dataValues','fax','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','value','findAll','associatedResources','map','field','model','then','name','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','odbc','parentSections','SquareProjects','projects','JscriptyProject','CmContact','Lists','lists','CmList','CmCompany','globalcustomfields','chatqueues','chatwebsites','ChatWebsite','inboundroutes','internalroutes','outboundroutes','contexts','VoiceMail','Agents','User','role','agent','Telephones','membername','telephone','VoiceQueues','queue','QueueCampaigns','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','users','agents','Users','admin','user','zendeskaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','CannedAnswer','dispositions','Dashboard','Interval','pauses','scheduler','Schedule','Sound','tags','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','extractedreports','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','OpenTabs','define','UserProfile','user_profiles','raw','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','autoAssociation','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','filters','pick','merge','key','VIRTUAL'];(function(_0xf61d62,_0x5e1ce1){var _0x1b8b00=function(_0x21dbba){while(--_0x21dbba){_0xf61d62['push'](_0xf61d62['shift']());}};_0x1b8b00(++_0x5e1ce1);}(_0xd117,0x182));var _0x7d11=function(_0x1abeb2,_0x79f462){_0x1abeb2=_0x1abeb2-0x0;var _0x48da20=_0xd117[_0x1abeb2];return _0x48da20;};'use strict';var _=require(_0x7d11('0x0'));var attributes=require(_0x7d11('0x1'));var qs=require(_0x7d11('0x2'));var squel=require(_0x7d11('0x3'));module[_0x7d11('0x4')]=function(_0x26e0f0){var _0x306ae4=_0x26e0f0[_0x7d11('0x5')];function _0x3c07be(_0x31fcb0,_0x589c51){return new Promise(function(_0x2689c6,_0x27d7e8){if(!_0x589c51)return _0x2689c6(null);var _0x40c3c4=_0x589c51[_0x7d11('0x6')]?{[_0x589c51[_0x7d11('0x6')]['field']]:_0x589c51[_0x7d11('0x6')][_0x7d11('0x7')]}:undefined;return _0x306ae4[_0x31fcb0][_0x7d11('0x8')]({'where':_0x40c3c4,'raw':!![]})['then'](function(_0x305eef){_0x589c51[_0x7d11('0x9')]=_[_0x7d11('0xa')](_0x305eef,'id');_0x2689c6(_0x589c51);})['catch'](function(_0x37047f){_0x27d7e8(_0x37047f);});});}function _0x48b0f1(_0x58a6fd,_0xb15984){return new Promise(function(_0x5c6d5d,_0x4a8668){var _0xc52a95=_0x58a6fd['filter']?{[_0x58a6fd[_0x7d11('0x6')][_0x7d11('0xb')]]:_0x58a6fd['filter'][_0x7d11('0x7')]}:undefined;return _0x306ae4[_0x58a6fd[_0x7d11('0xc')]]['findAll']({'where':_0xc52a95,'raw':!![]})[_0x7d11('0xd')](function(_0x16949d){_0xb15984[_0x7d11('0x9')]=_[_0x7d11('0xa')](_0x16949d,function(_0x417e2d){return _0x417e2d[_0x7d11('0xe')];});_0x5c6d5d(_0xb15984);})[_0x7d11('0xf')](function(_0xb1669e){_0x4a8668(_0xb1669e);});});}function _0x4aa795(_0x1db0df,_0x12c2ff,_0x169733){if(!_0x12c2ff)return Promise[_0x7d11('0x10')](null);return new Promise(function(_0x45f916,_0x528fdc){return _0x306ae4[_0x7d11('0x11')][_0x7d11('0x8')]({'where':{'sectionId':_0x12c2ff['id']},'raw':!![]})['then'](function(_0x5459df){if(_0x1db0df[_0x7d11('0xb')]&&_0x1db0df['field']!=='id'){_0x12c2ff[_0x7d11('0x9')]=_['map'](_0x5459df,function(_0xbe0a79){return _0xbe0a79[_0x1db0df[_0x7d11('0xb')]];});}else{if(_0x169733===_0x7d11('0x12')){_0x12c2ff[_0x7d11('0x9')]=_[_0x7d11('0xa')](_0x5459df,function(_0x117bb9){return{'id':_0x117bb9[_0x7d11('0x13')],'type':_0x117bb9[_0x7d11('0x14')]};});}else{_0x12c2ff['associatedResources']=_[_0x7d11('0xa')](_0x5459df,function(_0x4a34f4){return _0x4a34f4['resourceId'];});}}_0x45f916(_0x12c2ff);})['catch'](function(_0x27a818){_0x528fdc(_0x27a818);});});}function _0x3545dc(_0x44476c,_0x1a7853){var _0x355d14={'parentSections':[]};switch(_0x44476c[_0x7d11('0x15')]()){case _0x7d11('0x16'):_0x355d14[_0x7d11('0x17')]='SquareProject';break;case _0x7d11('0x18'):_0x355d14['childModel']='SquareOdbc';break;case'squarerecordings':_0x355d14[_0x7d11('0x17')]='SquareRecording';_0x355d14[_0x7d11('0x19')]=[{'name':_0x7d11('0x1a'),'field':_0x7d11('0xe'),'foreignKey':'projectName'}];break;case _0x7d11('0x1b'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x1c');break;case'contacts':_0x355d14[_0x7d11('0x17')]=_0x7d11('0x1d');_0x355d14[_0x7d11('0x19')]=[{'name':_0x7d11('0x1e'),'field':'id','foreignKey':'ListId'}];break;case _0x7d11('0x1f'):_0x355d14['childModel']=_0x7d11('0x20');break;case'companies':_0x355d14[_0x7d11('0x17')]=_0x7d11('0x21');break;case _0x7d11('0x22'):_0x355d14['childModel']='CmCustomField';break;case _0x7d11('0x23'):_0x355d14[_0x7d11('0x17')]='ChatQueue';break;case _0x7d11('0x24'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x25');break;case'faxqueues':_0x355d14[_0x7d11('0x17')]='FaxQueue';break;case'faxaccounts':_0x355d14[_0x7d11('0x17')]='FaxAccount';break;case _0x7d11('0x26'):case _0x7d11('0x27'):case _0x7d11('0x28'):_0x355d14[_0x7d11('0x17')]='VoiceExtension';break;case _0x7d11('0x29'):_0x355d14[_0x7d11('0x17')]='VoiceContext';break;case'voicemails':_0x355d14[_0x7d11('0x17')]=_0x7d11('0x2a');break;case'voicerecordings':_0x355d14[_0x7d11('0x17')]='VoiceRecording';_0x355d14['parentSections']=[{'name':_0x7d11('0x2b'),'field':'name','foreignKey':'membername','model':_0x7d11('0x2c'),'filter':{'field':_0x7d11('0x2d'),'value':[_0x7d11('0x2e')]}},{'name':_0x7d11('0x2f'),'field':_0x7d11('0xe'),'foreignKey':_0x7d11('0x30'),'model':_0x7d11('0x2c'),'filter':{'field':_0x7d11('0x2d'),'value':[_0x7d11('0x31')]}},{'name':_0x7d11('0x32'),'field':_0x7d11('0xe'),'foreignKey':_0x7d11('0x33'),'model':'VoiceQueue','filter':{'field':_0x7d11('0x14'),'value':['inbound']}},{'name':_0x7d11('0x34'),'field':_0x7d11('0xe'),'foreignKey':_0x7d11('0x33'),'model':_0x7d11('0x35'),'filter':{'field':'type','value':[_0x7d11('0x36')]}}];break;case _0x7d11('0x37'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x38');break;case'chanspies':_0x355d14[_0x7d11('0x17')]='VoiceChanSpy';break;case _0x7d11('0x39'):_0x355d14['childModel']=_0x7d11('0x3a');break;case _0x7d11('0x3b'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x3c');break;case'mailqueues':_0x355d14['childModel']=_0x7d11('0x3d');break;case _0x7d11('0x3e'):_0x355d14['childModel']=_0x7d11('0x3f');break;case _0x7d11('0x40'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x41');break;case _0x7d11('0x42'):_0x355d14[_0x7d11('0x17')]='OpenchannelQueue';break;case _0x7d11('0x43'):_0x355d14['childModel']=_0x7d11('0x44');break;case _0x7d11('0x45'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x46');break;case _0x7d11('0x47'):_0x355d14[_0x7d11('0x17')]='SmsAccount';break;case'whatsappqueues':_0x355d14['childModel']=_0x7d11('0x48');break;case _0x7d11('0x49'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x4a');break;case _0x7d11('0x4b'):_0x355d14['childModel']=_0x7d11('0x4c');break;case _0x7d11('0x4d'):case'queuecampaigns':_0x355d14[_0x7d11('0x17')]=_0x7d11('0x35');if(_0x1a7853){_0x355d14[_0x7d11('0x19')]=[{'name':'VoiceQueues'},{'name':_0x7d11('0x34')}];}break;case _0x7d11('0x4e'):case _0x7d11('0x4f'):case'telephones':_0x355d14[_0x7d11('0x17')]='User';if(_0x1a7853){_0x355d14[_0x7d11('0x19')]=[{'name':_0x7d11('0x50'),'filter':{'field':_0x7d11('0x2d'),'value':[_0x7d11('0x51'),_0x7d11('0x52')]},'ignore':!![]},{'name':_0x7d11('0x2b')},{'name':_0x7d11('0x2f')}];}break;case _0x7d11('0x53'):_0x355d14[_0x7d11('0x17')]='ZendeskAccount';break;case'salesforceaccounts':_0x355d14['childModel']=_0x7d11('0x54');break;case _0x7d11('0x55'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x56');break;case _0x7d11('0x57'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x58');break;case _0x7d11('0x59'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x5a');break;case _0x7d11('0x5b'):_0x355d14[_0x7d11('0x17')]='ZohoAccount';break;case _0x7d11('0x5c'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x2c');break;case'cannedanswers':_0x355d14['childModel']=_0x7d11('0x5d');break;case _0x7d11('0x5e'):_0x355d14[_0x7d11('0x17')]='Disposition';break;case'customdashboards':_0x355d14[_0x7d11('0x17')]=_0x7d11('0x5f');break;case'intervals':_0x355d14[_0x7d11('0x17')]=_0x7d11('0x60');break;case _0x7d11('0x61'):_0x355d14[_0x7d11('0x17')]='Pause';break;case _0x7d11('0x62'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x63');break;case'sounds':_0x355d14['childModel']=_0x7d11('0x64');break;case _0x7d11('0x65'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x66');break;case _0x7d11('0x67'):_0x355d14['childModel']=_0x7d11('0x68');break;case _0x7d11('0x69'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x6a');break;case'trunks':_0x355d14['childModel']=_0x7d11('0x6b');break;case _0x7d11('0x6c'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x6d');break;case _0x7d11('0x6e'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x6f');break;case _0x7d11('0x70'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x12');_0x355d14['parentSections']=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0x7d11('0x71'):_0x355d14[_0x7d11('0x17')]=_0x7d11('0x72');break;}return _0x355d14;}function _0x5508cf(_0x45918d,_0x222375){var _0x3b1762=_0x45918d[_0x7d11('0x73')](0x0)[_0x7d11('0x74')]()+_0x45918d[_0x7d11('0x75')](0x1);var _0x505573={'type':_0x306ae4[_0x7d11('0x76')][_0x7d11('0x77')][_0x7d11('0x78')],'raw':!![]};return new Promise(function(_0x4c072b,_0x5e5ac3){var _0x481a64=squel['select']()[_0x7d11('0xb')]('ui.'+_0x3b1762+'InteractionId','id')['field'](_0x7d11('0x79'))[_0x7d11('0x7a')](_0x7d11('0x7b')+_0x45918d+_0x7d11('0x7c'),'ui')[_0x7d11('0x7d')](_0x7d11('0x7e'),_0x222375['id']);return _0x306ae4['sequelize'][_0x7d11('0x7f')](_0x481a64['toString'](),_0x505573)[_0x7d11('0xd')](function(_0x49f904){_0x222375[_0x3b1762+_0x7d11('0x80')]=_0x49f904;_0x4c072b(_0x49f904);})[_0x7d11('0xf')](function(_0x4ce8f2){_0x5e5ac3(_0x4ce8f2);});});}return _0x26e0f0[_0x7d11('0x81')](_0x7d11('0x82'),attributes,{'tableName':_0x7d11('0x83'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x8201e3){var _0x5581bb={'raw':_0x8201e3['query'][_0x7d11('0x84')],'where':{}};var _0x23b502={};var _0x2e57e4={'count':0x0,'rows':[]};var _0x4027f8=_0x8201e3[_0x7d11('0x7f')]['section'];var _0x2b9ba0=_0x8201e3['query'][_0x7d11('0x85')]||![];var _0x1c33dd=_0x3545dc(_0x4027f8,_0x2b9ba0);if(!_0x1c33dd[_0x7d11('0x17')])throw new Error(_0x7d11('0x86')+_0x4027f8+'\x27');var _0x4df2da=[{'name':_0x4027f8}];if(!_[_0x7d11('0x87')](_0x1c33dd['parentSections']))_0x4df2da=_0x1c33dd[_0x7d11('0x19')];var _0x366f5e=[];for(var _0x19015f=0x0;_0x19015f<_0x4df2da[_0x7d11('0x88')];_0x19015f++){_0x366f5e[_0x7d11('0x89')](_0x306ae4[_0x7d11('0x8a')][_0x7d11('0x8b')]({'where':{'userProfileId':_0x8201e3[_0x7d11('0x8c')]['id'],'name':_0x4df2da[_0x19015f][_0x7d11('0xe')]},'raw':!![]}));}return Promise[_0x7d11('0x8d')](_0x366f5e)[_0x7d11('0xd')](function(_0x850e26){var _0x346250=_[_0x7d11('0x6')](_0x850e26,function(_0x490434){return _0x490434?_0x490434:undefined;});var _0x36895a=_['filter'](_0x4df2da,[_0x7d11('0x8e'),!![]]);var _0x4c113b=_[_0x7d11('0x87')](_0x346250)&&_[_0x7d11('0x87')](_0x36895a)?null:_[_0x7d11('0x8f')](_0x36895a,_0x346250);if(!_0x4c113b)return null;var _0x1d54f7=[];for(var _0x4aac67=0x0;_0x4aac67<_0x4c113b['length'];_0x4aac67++){var _0x1351ee=_[_0x7d11('0x8b')](_0x4df2da,function(_0x12566a){return _0x4c113b[_0x4aac67]?_0x12566a['name']===_0x4c113b[_0x4aac67][_0x7d11('0xe')]:null;});if(_0x1351ee){if(_0x4c113b[_0x4aac67][_0x7d11('0x8e')]){_0x1d54f7[_0x7d11('0x89')](_0x3c07be(_0x1c33dd[_0x7d11('0x17')],_0x4c113b[_0x4aac67]));}else{if(!_0x4c113b[_0x4aac67][_0x7d11('0x90')]){_0x1d54f7[_0x7d11('0x89')](_0x4aa795(_0x1351ee,_0x4c113b[_0x4aac67],_0x1c33dd['childModel']));}else{if(_0x1351ee[_0x7d11('0xc')]){_0x1d54f7['push'](_0x48b0f1(_0x1351ee,_0x4c113b[_0x4aac67]));}}}}}return Promise[_0x7d11('0x8d')](_0x1d54f7);})['then'](function(_0x48f52c){var _0x26dd08=_0x48f52c;var _0x235658=null;if(_0x26dd08){_0x235658=_0x26dd08[_0x7d11('0x88')]===0x1?_0x26dd08[0x0]:null;}if(!_0x235658&&!_0x26dd08)return _0x2e57e4;var _0x14ee15=_0x306ae4[_0x1c33dd[_0x7d11('0x17')]][_0x7d11('0x91')];_0x23b502[_0x7d11('0xc')]=_[_0x7d11('0x92')](_0x14ee15);_0x23b502[_0x7d11('0x7f')]=_[_0x7d11('0x92')](_0x8201e3[_0x7d11('0x7f')]);_0x23b502['filters']=_[_0x7d11('0x93')](_0x23b502['model'],_0x23b502[_0x7d11('0x7f')]);_0x5581bb[_0x7d11('0x94')]=_[_0x7d11('0x93')](_0x23b502[_0x7d11('0xc')],qs[_0x7d11('0x95')](_0x8201e3[_0x7d11('0x7f')][_0x7d11('0x95')]));_0x5581bb['attributes']=_0x5581bb['attributes'][_0x7d11('0x88')]?_0x5581bb[_0x7d11('0x94')]:_0x23b502[_0x7d11('0xc')];if(!_0x8201e3[_0x7d11('0x7f')][_0x7d11('0x96')]('nolimit')){_0x5581bb[_0x7d11('0x97')]=qs['limit'](_0x8201e3[_0x7d11('0x7f')][_0x7d11('0x97')]);_0x5581bb[_0x7d11('0x98')]=qs[_0x7d11('0x98')](_0x8201e3[_0x7d11('0x7f')][_0x7d11('0x98')]);}_0x5581bb[_0x7d11('0x99')]=qs[_0x7d11('0x9a')](_0x8201e3['query']['sort']);_0x5581bb[_0x7d11('0x7d')]=qs[_0x7d11('0x9b')](_[_0x7d11('0x9c')](_0x8201e3['query'],_0x23b502['filters']));if(_0x8201e3[_0x7d11('0x7f')]['filter']){_0x5581bb[_0x7d11('0x7d')]=_[_0x7d11('0x9d')](_0x5581bb[_0x7d11('0x7d')],{'$or':_[_0x7d11('0xa')](_0x14ee15,function(_0x4b4dd5){if(_0x4b4dd5[_0x7d11('0x14')][_0x7d11('0x9e')]!==_0x7d11('0x9f')){var _0x3ee9b4={};_0x3ee9b4[_0x4b4dd5[_0x7d11('0xb')]]={'$like':'%'+_0x8201e3[_0x7d11('0x7f')][_0x7d11('0x6')]+'%'};return _0x3ee9b4;}})});}var _0x1b719a=[];var _0x481e2f=null;var _0x41f989={};if(_0x235658){_0x481e2f=_[_0x7d11('0x8b')](_0x4df2da,[_0x7d11('0xe'),_0x235658[_0x7d11('0xe')]]);if(_0x481e2f[_0x7d11('0xb')]){_0x41f989={};if(_0x1c33dd['childModel']===_0x7d11('0x12')){_0x41f989[_0x481e2f[_0x7d11('0xa0')]]=_[_0x7d11('0xa')](_0x235658[_0x7d11('0x9')],'id');}else{_0x41f989[_0x481e2f[_0x7d11('0xa0')]]=_0x235658['associatedResources'];}_0x1b719a['push'](_0x41f989);}else{_0x5581bb['where']['id']=_0x235658[_0x7d11('0x9')];}}else{for(var _0x4c15e9=0x0;_0x4c15e9<_0x26dd08[_0x7d11('0x88')];_0x4c15e9++){_0x481e2f=_['find'](_0x4df2da,['name',_0x26dd08[_0x4c15e9][_0x7d11('0xe')]]);if(_0x481e2f[_0x7d11('0xb')]){_0x41f989={};_0x41f989[_0x481e2f[_0x7d11('0xa0')]]=_0x26dd08[_0x4c15e9][_0x7d11('0x9')];_0x1b719a[_0x7d11('0x89')](_0x41f989);}else{if(!_0x5581bb[_0x7d11('0x7d')]['id'])_0x5581bb[_0x7d11('0x7d')]['id']=[];_0x26dd08[_0x4c15e9][_0x7d11('0x9')][_0x7d11('0xa1')](function(_0x29eda1){_0x5581bb['where']['id'][_0x7d11('0x89')](_0x29eda1);});}}}if(!_[_0x7d11('0x87')](_0x1b719a)){_0x5581bb['where']=_[_0x7d11('0x9d')](_0x5581bb[_0x7d11('0x7d')],{'$and':{'$or':_0x1b719a}});}_0x5581bb=_[_0x7d11('0x9d')]({},_0x5581bb,_0x8201e3[_0x7d11('0xa2')]);if(_0x235658&&!_0x235658['autoAssociation']&&_0x1c33dd['childModel']===_0x7d11('0x12')){if(_0x8201e3['query'][_0x7d11('0xa3')]){_0x5581bb[_0x7d11('0xa4')]=[{'all':!![]}];}return _0x306ae4[_0x1c33dd[_0x7d11('0x17')]][_0x7d11('0x8')](_0x5581bb)[_0x7d11('0xd')](function(_0x269f3f){var _0x238486=[];_0x269f3f['forEach'](function(_0x3381e0){var _0x3212fa;switch(_0x3381e0[_0x7d11('0xa5')]){case _0x7d11('0xa6'):_0x3212fa=_['find'](_0x235658[_0x7d11('0x9')],function(_0x18cb6b){return _0x18cb6b['id']===_0x3381e0['reportId']&&_0x18cb6b[_0x7d11('0x14')]===_0x7d11('0xa7');});break;case _0x7d11('0xa8'):_0x3212fa=_['find'](_0x235658[_0x7d11('0x9')],function(_0x34d95d){return _0x34d95d['id']===_0x3381e0['reportId']&&_0x34d95d[_0x7d11('0x14')]===_0x7d11('0xa9');});break;}if(_0x3212fa)_0x238486['push'](_0x3381e0);});_0x2e57e4[_0x7d11('0xaa')]=_0x238486['length'];_0x2e57e4['rows']=_0x238486;return _0x2e57e4;});}else{if(!_['isEmpty'](_0x8201e3['query'][_0x7d11('0xab')])){_0x5581bb[_0x7d11('0x7d')]['id']=_0x5581bb[_0x7d11('0x7d')]['id']?_[_0x7d11('0x93')](_0x5581bb[_0x7d11('0x7d')]['id'],_0x8201e3[_0x7d11('0x7f')][_0x7d11('0xab')]):_0x8201e3[_0x7d11('0x7f')][_0x7d11('0xab')];}return _0x306ae4[_0x1c33dd[_0x7d11('0x17')]]['count']({'where':_0x5581bb['where']})[_0x7d11('0xd')](function(_0x158e0f){_0x2e57e4['count']=_0x158e0f;if(_0x8201e3['query'][_0x7d11('0xa3')]){if(_0x1c33dd[_0x7d11('0x17')]===_0x7d11('0x1d')){_0x5581bb[_0x7d11('0xa4')]=[{'model':_0x306ae4['Tag'],'as':'Tags','attributes':['id','name',_0x7d11('0xac')],'required':_0x8201e3[_0x7d11('0x7f')][_0x7d11('0xad')]?!![]:![]},{'model':_0x306ae4['Tag'],'as':_0x7d11('0xae'),'attributes':['id',_0x7d11('0xe'),'color'],'through':_0x8201e3[_0x7d11('0x7f')][_0x7d11('0xad')]?{'attributes':[],'where':{'TagId':_0x8201e3['query']['tag']||undefined}}:{},'required':_0x8201e3[_0x7d11('0x7f')][_0x7d11('0xad')]?!![]:![]}];}else{_0x5581bb['include']=[{'all':!![]}];}}return _0x306ae4[_0x1c33dd['childModel']][_0x7d11('0x8')](_0x5581bb);})[_0x7d11('0xd')](function(_0x3df0ab){_0x2e57e4[_0x7d11('0xaf')]=_0x3df0ab;if(_0x4027f8==='Agents'&&_0x8201e3[_0x7d11('0x7f')][_0x7d11('0xb0')]===_0x7d11('0xb1')){var _0x83416b=[];for(var _0x491d94=0x0;_0x491d94<_0x2e57e4[_0x7d11('0xaf')][_0x7d11('0x88')];_0x491d94++){_0x83416b[_0x7d11('0x89')](_0x5508cf('chat',_0x2e57e4[_0x7d11('0xaf')][_0x491d94]['dataValues']));_0x83416b[_0x7d11('0x89')](_0x5508cf('sms',_0x2e57e4[_0x7d11('0xaf')][_0x491d94][_0x7d11('0xb2')]));_0x83416b[_0x7d11('0x89')](_0x5508cf(_0x7d11('0xb3'),_0x2e57e4[_0x7d11('0xaf')][_0x491d94][_0x7d11('0xb2')]));_0x83416b['push'](_0x5508cf('mail',_0x2e57e4[_0x7d11('0xaf')][_0x491d94][_0x7d11('0xb2')]));_0x83416b[_0x7d11('0x89')](_0x5508cf(_0x7d11('0xb4'),_0x2e57e4['rows'][_0x491d94][_0x7d11('0xb2')]));_0x83416b[_0x7d11('0x89')](_0x5508cf(_0x7d11('0xb5'),_0x2e57e4[_0x7d11('0xaf')][_0x491d94]['dataValues']));}return Promise[_0x7d11('0x8d')](_0x83416b)[_0x7d11('0xd')](function(){return _0x2e57e4;});}return _0x2e57e4;});}});}}});};
\ No newline at end of file
+var _0xda2d=['variables','Variable','plugins','reportId','metrics','charAt','toUpperCase','slice','QueryTypes','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','mergeResources','isEmpty','length','push','UserProfileSection','params','find','ignore','autoAssociation','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','default','DefaultReports','custom','CustomReports','count','ids','CmContact','Tag','Tags','color','tag','ThroughTags','rows','openTabs','true','chat','dataValues','fax','mail','openchannel','all','./userProfile.attributes','../../components/parsers/qs','squel','exports','filter','field','value','then','map','catch','model','findAll','name','resolve','UserProfileResource','associatedResources','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','SquareProject','odbc','childModel','SquareOdbc','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','ChatWebsite','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','role','agent','Telephones','User','telephone','VoiceQueues','VoiceQueue','queue','outbound','VoiceMusicOnHold','chanspies','VoicePrefix','ivrcampaigns','Campaign','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','telephones','Users','user','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','scheduler','Schedule','sounds','Sound','tags','templates','Template','Trigger'];(function(_0x1f99a0,_0x50b73d){var _0x1e0849=function(_0x41e764){while(--_0x41e764){_0x1f99a0['push'](_0x1f99a0['shift']());}};_0x1e0849(++_0x50b73d);}(_0xda2d,0x102));var _0xdda2=function(_0xb256e9,_0x26bc9f){_0xb256e9=_0xb256e9-0x0;var _0x173b0b=_0xda2d[_0xb256e9];return _0x173b0b;};'use strict';var _=require('lodash');var attributes=require(_0xdda2('0x0'));var qs=require(_0xdda2('0x1'));var squel=require(_0xdda2('0x2'));module[_0xdda2('0x3')]=function(_0x329c5e){var _0x58973d=_0x329c5e['models'];function _0x5a5f9f(_0x357e97,_0x319129){return new Promise(function(_0x2965a5,_0x39f6c9){if(!_0x319129)return _0x2965a5(null);var _0xc256bc=_0x319129[_0xdda2('0x4')]?{[_0x319129[_0xdda2('0x4')][_0xdda2('0x5')]]:_0x319129[_0xdda2('0x4')][_0xdda2('0x6')]}:undefined;return _0x58973d[_0x357e97]['findAll']({'where':_0xc256bc,'raw':!![]})[_0xdda2('0x7')](function(_0x22c6e5){_0x319129['associatedResources']=_[_0xdda2('0x8')](_0x22c6e5,'id');_0x2965a5(_0x319129);})[_0xdda2('0x9')](function(_0x42d990){_0x39f6c9(_0x42d990);});});}function _0x346119(_0x171123,_0x30ca9a){return new Promise(function(_0x26fe81,_0x1dac9a){var _0x57aba3=_0x171123['filter']?{[_0x171123['filter'][_0xdda2('0x5')]]:_0x171123[_0xdda2('0x4')][_0xdda2('0x6')]}:undefined;return _0x58973d[_0x171123[_0xdda2('0xa')]][_0xdda2('0xb')]({'where':_0x57aba3,'raw':!![]})[_0xdda2('0x7')](function(_0x3490f1){_0x30ca9a['associatedResources']=_[_0xdda2('0x8')](_0x3490f1,function(_0x4b0220){return _0x4b0220[_0xdda2('0xc')];});_0x26fe81(_0x30ca9a);})[_0xdda2('0x9')](function(_0x3553d5){_0x1dac9a(_0x3553d5);});});}function _0x457764(_0x1922b1,_0x5d8a83,_0x55d674){if(!_0x5d8a83)return Promise[_0xdda2('0xd')](null);return new Promise(function(_0x518c6d,_0x1a5192){return _0x58973d[_0xdda2('0xe')][_0xdda2('0xb')]({'where':{'sectionId':_0x5d8a83['id']},'raw':!![]})[_0xdda2('0x7')](function(_0x8d44b7){if(_0x1922b1[_0xdda2('0x5')]&&_0x1922b1[_0xdda2('0x5')]!=='id'){_0x5d8a83[_0xdda2('0xf')]=_[_0xdda2('0x8')](_0x8d44b7,function(_0x337b0b){return _0x337b0b[_0x1922b1[_0xdda2('0x5')]];});}else{if(_0x55d674===_0xdda2('0x10')){_0x5d8a83['associatedResources']=_[_0xdda2('0x8')](_0x8d44b7,function(_0x5dfce7){return{'id':_0x5dfce7[_0xdda2('0x11')],'type':_0x5dfce7[_0xdda2('0x12')]};});}else{_0x5d8a83[_0xdda2('0xf')]=_['map'](_0x8d44b7,function(_0x347ee6){return _0x347ee6['resourceId'];});}}_0x518c6d(_0x5d8a83);})[_0xdda2('0x9')](function(_0x107ee4){_0x1a5192(_0x107ee4);});});}function _0x4ac3eb(_0x144f1e,_0xfda248){var _0x2528d7={'parentSections':[]};switch(_0x144f1e[_0xdda2('0x13')]()){case _0xdda2('0x14'):_0x2528d7['childModel']=_0xdda2('0x15');break;case _0xdda2('0x16'):_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x18');break;case'squarerecordings':_0x2528d7['childModel']=_0xdda2('0x19');_0x2528d7[_0xdda2('0x1a')]=[{'name':_0xdda2('0x1b'),'field':'name','foreignKey':_0xdda2('0x1c')}];break;case _0xdda2('0x1d'):_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x1e');break;case _0xdda2('0x1f'):_0x2528d7[_0xdda2('0x17')]='CmContact';_0x2528d7[_0xdda2('0x1a')]=[{'name':_0xdda2('0x20'),'field':'id','foreignKey':'ListId'}];break;case _0xdda2('0x21'):_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x22');break;case _0xdda2('0x23'):_0x2528d7['childModel']=_0xdda2('0x24');break;case _0xdda2('0x25'):_0x2528d7['childModel']=_0xdda2('0x26');break;case'chatqueues':_0x2528d7[_0xdda2('0x17')]='ChatQueue';break;case'chatwebsites':_0x2528d7['childModel']=_0xdda2('0x27');break;case'faxqueues':_0x2528d7[_0xdda2('0x17')]='FaxQueue';break;case'faxaccounts':_0x2528d7['childModel']=_0xdda2('0x28');break;case _0xdda2('0x29'):case _0xdda2('0x2a'):case _0xdda2('0x2b'):_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x2c');break;case _0xdda2('0x2d'):_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x2e');break;case _0xdda2('0x2f'):_0x2528d7['childModel']=_0xdda2('0x30');break;case _0xdda2('0x31'):_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x32');_0x2528d7[_0xdda2('0x1a')]=[{'name':_0xdda2('0x33'),'field':_0xdda2('0xc'),'foreignKey':'membername','model':'User','filter':{'field':_0xdda2('0x34'),'value':[_0xdda2('0x35')]}},{'name':_0xdda2('0x36'),'field':'name','foreignKey':'membername','model':_0xdda2('0x37'),'filter':{'field':_0xdda2('0x34'),'value':[_0xdda2('0x38')]}},{'name':_0xdda2('0x39'),'field':_0xdda2('0xc'),'foreignKey':'queue','model':_0xdda2('0x3a'),'filter':{'field':_0xdda2('0x12'),'value':['inbound']}},{'name':'QueueCampaigns','field':_0xdda2('0xc'),'foreignKey':_0xdda2('0x3b'),'model':_0xdda2('0x3a'),'filter':{'field':_0xdda2('0x12'),'value':[_0xdda2('0x3c')]}}];break;case'musiconholds':_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x3d');break;case _0xdda2('0x3e'):_0x2528d7[_0xdda2('0x17')]='VoiceChanSpy';break;case'voiceprefixes':_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x3f');break;case _0xdda2('0x40'):_0x2528d7['childModel']=_0xdda2('0x41');break;case'mailqueues':_0x2528d7[_0xdda2('0x17')]='MailQueue';break;case _0xdda2('0x42'):_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x43');break;case _0xdda2('0x44'):_0x2528d7['childModel']=_0xdda2('0x45');break;case'openchannelqueues':_0x2528d7[_0xdda2('0x17')]='OpenchannelQueue';break;case _0xdda2('0x46'):_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x47');break;case _0xdda2('0x48'):_0x2528d7[_0xdda2('0x17')]='SmsQueue';break;case _0xdda2('0x49'):_0x2528d7[_0xdda2('0x17')]='SmsAccount';break;case _0xdda2('0x4a'):_0x2528d7['childModel']=_0xdda2('0x4b');break;case _0xdda2('0x4c'):_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x4d');break;case _0xdda2('0x4e'):_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x4f');break;case _0xdda2('0x50'):case _0xdda2('0x51'):_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x3a');if(_0xfda248){_0x2528d7[_0xdda2('0x1a')]=[{'name':_0xdda2('0x39')},{'name':'QueueCampaigns'}];}break;case'users':case'agents':case _0xdda2('0x52'):_0x2528d7[_0xdda2('0x17')]='User';if(_0xfda248){_0x2528d7[_0xdda2('0x1a')]=[{'name':_0xdda2('0x53'),'filter':{'field':_0xdda2('0x34'),'value':['admin',_0xdda2('0x54')]},'ignore':!![]},{'name':_0xdda2('0x33')},{'name':'Telephones'}];}break;case'zendeskaccounts':_0x2528d7[_0xdda2('0x17')]='ZendeskAccount';break;case _0xdda2('0x55'):_0x2528d7['childModel']=_0xdda2('0x56');break;case _0xdda2('0x57'):_0x2528d7['childModel']='FreshdeskAccount';break;case _0xdda2('0x58'):_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x59');break;case _0xdda2('0x5a'):_0x2528d7['childModel']=_0xdda2('0x5b');break;case _0xdda2('0x5c'):_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x5d');break;case _0xdda2('0x5e'):_0x2528d7['childModel']=_0xdda2('0x37');break;case _0xdda2('0x5f'):_0x2528d7['childModel']=_0xdda2('0x60');break;case _0xdda2('0x61'):_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x62');break;case _0xdda2('0x63'):_0x2528d7[_0xdda2('0x17')]='Dashboard';break;case _0xdda2('0x64'):_0x2528d7['childModel']=_0xdda2('0x65');break;case'pauses':_0x2528d7[_0xdda2('0x17')]='Pause';break;case _0xdda2('0x66'):_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x67');break;case _0xdda2('0x68'):_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x69');break;case _0xdda2('0x6a'):_0x2528d7[_0xdda2('0x17')]='Tag';break;case _0xdda2('0x6b'):_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x6c');break;case'triggers':_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x6d');break;case'trunks':_0x2528d7[_0xdda2('0x17')]='Trunk';break;case _0xdda2('0x6e'):_0x2528d7[_0xdda2('0x17')]=_0xdda2('0x6f');break;case _0xdda2('0x70'):_0x2528d7[_0xdda2('0x17')]='Plugin';break;case'extractedreports':_0x2528d7['childModel']=_0xdda2('0x10');_0x2528d7[_0xdda2('0x1a')]=[{'name':'Reports','field':'id','foreignKey':_0xdda2('0x71')}];break;case _0xdda2('0x72'):_0x2528d7[_0xdda2('0x17')]='AnalyticMetric';break;}return _0x2528d7;}function _0x3fd76c(_0x14af86,_0x113266){var _0x58ae15=_0x14af86[_0xdda2('0x73')](0x0)[_0xdda2('0x74')]()+_0x14af86[_0xdda2('0x75')](0x1);var _0x25c9a9={'type':_0x58973d['Sequelize'][_0xdda2('0x76')]['SELECT'],'raw':!![]};return new Promise(function(_0x494b81,_0x58fcec){var _0x285cec=squel[_0xdda2('0x77')]()[_0xdda2('0x5')](_0xdda2('0x78')+_0x58ae15+_0xdda2('0x79'),'id')[_0xdda2('0x5')](_0xdda2('0x7a'))[_0xdda2('0x7b')](_0xdda2('0x7c')+_0x14af86+_0xdda2('0x7d'),'ui')[_0xdda2('0x7e')]('ui.UserId\x20=\x20?',_0x113266['id']);return _0x58973d[_0xdda2('0x7f')][_0xdda2('0x80')](_0x285cec[_0xdda2('0x81')](),_0x25c9a9)[_0xdda2('0x7')](function(_0x90bb5c){_0x113266[_0x58ae15+_0xdda2('0x82')]=_0x90bb5c;_0x494b81(_0x90bb5c);})[_0xdda2('0x9')](function(_0x57fb41){_0x58fcec(_0x57fb41);});});}return _0x329c5e[_0xdda2('0x83')](_0xdda2('0x84'),attributes,{'tableName':_0xdda2('0x85'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xe8d81a){var _0x44f619={'raw':_0xe8d81a['query'][_0xdda2('0x86')],'where':{}};var _0x145d45={};var _0xbc441a={'count':0x0,'rows':[]};var _0x2c442e=_0xe8d81a[_0xdda2('0x80')]['section'];var _0x17aaab=_0xe8d81a[_0xdda2('0x80')][_0xdda2('0x87')]||![];var _0x4530b7=_0x4ac3eb(_0x2c442e,_0x17aaab);if(!_0x4530b7[_0xdda2('0x17')])throw new Error('Invalid\x20section\x20\x27'+_0x2c442e+'\x27');var _0x29dd19=[{'name':_0x2c442e}];if(!_[_0xdda2('0x88')](_0x4530b7[_0xdda2('0x1a')]))_0x29dd19=_0x4530b7['parentSections'];var _0x1b7b96=[];for(var _0x483c17=0x0;_0x483c17<_0x29dd19[_0xdda2('0x89')];_0x483c17++){_0x1b7b96[_0xdda2('0x8a')](_0x58973d[_0xdda2('0x8b')]['find']({'where':{'userProfileId':_0xe8d81a[_0xdda2('0x8c')]['id'],'name':_0x29dd19[_0x483c17][_0xdda2('0xc')]},'raw':!![]}));}return Promise['all'](_0x1b7b96)[_0xdda2('0x7')](function(_0x5adab5){var _0x3d645b=_[_0xdda2('0x4')](_0x5adab5,function(_0x354fb9){return _0x354fb9?_0x354fb9:undefined;});var _0x29cf1a=_[_0xdda2('0x4')](_0x29dd19,['ignore',!![]]);var _0x586ca1=_[_0xdda2('0x88')](_0x3d645b)&&_[_0xdda2('0x88')](_0x29cf1a)?null:_['union'](_0x29cf1a,_0x3d645b);if(!_0x586ca1)return null;var _0x53e9e0=[];for(var _0x439eb0=0x0;_0x439eb0<_0x586ca1['length'];_0x439eb0++){var _0x12a052=_[_0xdda2('0x8d')](_0x29dd19,function(_0x4910a6){return _0x586ca1[_0x439eb0]?_0x4910a6[_0xdda2('0xc')]===_0x586ca1[_0x439eb0][_0xdda2('0xc')]:null;});if(_0x12a052){if(_0x586ca1[_0x439eb0][_0xdda2('0x8e')]){_0x53e9e0[_0xdda2('0x8a')](_0x5a5f9f(_0x4530b7[_0xdda2('0x17')],_0x586ca1[_0x439eb0]));}else{if(!_0x586ca1[_0x439eb0][_0xdda2('0x8f')]){_0x53e9e0['push'](_0x457764(_0x12a052,_0x586ca1[_0x439eb0],_0x4530b7[_0xdda2('0x17')]));}else{if(_0x12a052[_0xdda2('0xa')]){_0x53e9e0[_0xdda2('0x8a')](_0x346119(_0x12a052,_0x586ca1[_0x439eb0]));}}}}}return Promise['all'](_0x53e9e0);})[_0xdda2('0x7')](function(_0x2ec405){var _0x51963f=_0x2ec405;var _0x4e721b=null;if(_0x51963f){_0x4e721b=_0x51963f[_0xdda2('0x89')]===0x1?_0x51963f[0x0]:null;}if(!_0x4e721b&&!_0x51963f)return _0xbc441a;var _0x232823=_0x58973d[_0x4530b7[_0xdda2('0x17')]]['rawAttributes'];_0x145d45['model']=_[_0xdda2('0x90')](_0x232823);_0x145d45['query']=_[_0xdda2('0x90')](_0xe8d81a[_0xdda2('0x80')]);_0x145d45[_0xdda2('0x91')]=_[_0xdda2('0x92')](_0x145d45[_0xdda2('0xa')],_0x145d45[_0xdda2('0x80')]);_0x44f619['attributes']=_['intersection'](_0x145d45[_0xdda2('0xa')],qs['fields'](_0xe8d81a[_0xdda2('0x80')][_0xdda2('0x93')]));_0x44f619[_0xdda2('0x94')]=_0x44f619[_0xdda2('0x94')][_0xdda2('0x89')]?_0x44f619[_0xdda2('0x94')]:_0x145d45[_0xdda2('0xa')];if(!_0xe8d81a[_0xdda2('0x80')][_0xdda2('0x95')]('nolimit')){_0x44f619[_0xdda2('0x96')]=qs[_0xdda2('0x96')](_0xe8d81a[_0xdda2('0x80')][_0xdda2('0x96')]);_0x44f619['offset']=qs[_0xdda2('0x97')](_0xe8d81a[_0xdda2('0x80')][_0xdda2('0x97')]);}_0x44f619[_0xdda2('0x98')]=qs['sort'](_0xe8d81a['query'][_0xdda2('0x99')]);_0x44f619[_0xdda2('0x7e')]=qs[_0xdda2('0x91')](_[_0xdda2('0x9a')](_0xe8d81a['query'],_0x145d45[_0xdda2('0x91')]));if(_0xe8d81a[_0xdda2('0x80')][_0xdda2('0x4')]){_0x44f619[_0xdda2('0x7e')]=_[_0xdda2('0x9b')](_0x44f619[_0xdda2('0x7e')],{'$or':_[_0xdda2('0x8')](_0x232823,function(_0x103e37){if(_0x103e37[_0xdda2('0x12')][_0xdda2('0x9c')]!==_0xdda2('0x9d')){var _0x23a80a={};_0x23a80a[_0x103e37[_0xdda2('0x5')]]={'$like':'%'+_0xe8d81a[_0xdda2('0x80')][_0xdda2('0x4')]+'%'};return _0x23a80a;}})});}var _0x4b9481=[];var _0x221f72=null;var _0x20969b={};if(_0x4e721b){_0x221f72=_['find'](_0x29dd19,['name',_0x4e721b[_0xdda2('0xc')]]);if(_0x221f72[_0xdda2('0x5')]){_0x20969b={};if(_0x4530b7[_0xdda2('0x17')]===_0xdda2('0x10')){_0x20969b[_0x221f72[_0xdda2('0x9e')]]=_[_0xdda2('0x8')](_0x4e721b['associatedResources'],'id');}else{_0x20969b[_0x221f72[_0xdda2('0x9e')]]=_0x4e721b[_0xdda2('0xf')];}_0x4b9481[_0xdda2('0x8a')](_0x20969b);}else{_0x44f619[_0xdda2('0x7e')]['id']=_0x4e721b['associatedResources'];}}else{for(var _0xbf1248=0x0;_0xbf1248<_0x51963f['length'];_0xbf1248++){_0x221f72=_[_0xdda2('0x8d')](_0x29dd19,[_0xdda2('0xc'),_0x51963f[_0xbf1248]['name']]);if(_0x221f72[_0xdda2('0x5')]){_0x20969b={};_0x20969b[_0x221f72[_0xdda2('0x9e')]]=_0x51963f[_0xbf1248][_0xdda2('0xf')];_0x4b9481[_0xdda2('0x8a')](_0x20969b);}else{if(!_0x44f619[_0xdda2('0x7e')]['id'])_0x44f619[_0xdda2('0x7e')]['id']=[];_0x51963f[_0xbf1248][_0xdda2('0xf')][_0xdda2('0x9f')](function(_0x3a375d){_0x44f619[_0xdda2('0x7e')]['id'][_0xdda2('0x8a')](_0x3a375d);});}}}if(!_['isEmpty'](_0x4b9481)){_0x44f619[_0xdda2('0x7e')]=_[_0xdda2('0x9b')](_0x44f619[_0xdda2('0x7e')],{'$and':{'$or':_0x4b9481}});}_0x44f619=_[_0xdda2('0x9b')]({},_0x44f619,_0xe8d81a[_0xdda2('0xa0')]);if(_0x4e721b&&!_0x4e721b['autoAssociation']&&_0x4530b7[_0xdda2('0x17')]===_0xdda2('0x10')){if(_0xe8d81a['query'][_0xdda2('0xa1')]){_0x44f619[_0xdda2('0xa2')]=[{'all':!![]}];}return _0x58973d[_0x4530b7['childModel']]['findAll'](_0x44f619)[_0xdda2('0x7')](function(_0x304609){var _0x179b1a=[];_0x304609[_0xdda2('0x9f')](function(_0x14d8fa){var _0x2478e2;switch(_0x14d8fa['reportType']){case _0xdda2('0xa3'):_0x2478e2=_[_0xdda2('0x8d')](_0x4e721b['associatedResources'],function(_0x4bd37d){return _0x4bd37d['id']===_0x14d8fa[_0xdda2('0x71')]&&_0x4bd37d['type']===_0xdda2('0xa4');});break;case _0xdda2('0xa5'):_0x2478e2=_[_0xdda2('0x8d')](_0x4e721b['associatedResources'],function(_0xe6f37b){return _0xe6f37b['id']===_0x14d8fa['reportId']&&_0xe6f37b[_0xdda2('0x12')]===_0xdda2('0xa6');});break;}if(_0x2478e2)_0x179b1a[_0xdda2('0x8a')](_0x14d8fa);});_0xbc441a[_0xdda2('0xa7')]=_0x179b1a['length'];_0xbc441a['rows']=_0x179b1a;return _0xbc441a;});}else{if(!_[_0xdda2('0x88')](_0xe8d81a[_0xdda2('0x80')]['ids'])){_0x44f619[_0xdda2('0x7e')]['id']=_0x44f619[_0xdda2('0x7e')]['id']?_[_0xdda2('0x92')](_0x44f619[_0xdda2('0x7e')]['id'],_0xe8d81a[_0xdda2('0x80')][_0xdda2('0xa8')]):_0xe8d81a[_0xdda2('0x80')][_0xdda2('0xa8')];}return _0x58973d[_0x4530b7[_0xdda2('0x17')]][_0xdda2('0xa7')]({'where':_0x44f619[_0xdda2('0x7e')]})[_0xdda2('0x7')](function(_0x528185){_0xbc441a['count']=_0x528185;if(_0xe8d81a['query'][_0xdda2('0xa1')]){if(_0x4530b7['childModel']===_0xdda2('0xa9')){_0x44f619[_0xdda2('0xa2')]=[{'model':_0x58973d[_0xdda2('0xaa')],'as':_0xdda2('0xab'),'attributes':['id','name',_0xdda2('0xac')],'required':_0xe8d81a[_0xdda2('0x80')][_0xdda2('0xad')]?!![]:![]},{'model':_0x58973d['Tag'],'as':_0xdda2('0xae'),'attributes':['id',_0xdda2('0xc'),_0xdda2('0xac')],'through':_0xe8d81a['query']['tag']?{'attributes':[],'where':{'TagId':_0xe8d81a[_0xdda2('0x80')][_0xdda2('0xad')]||undefined}}:{},'required':_0xe8d81a[_0xdda2('0x80')]['tag']?!![]:![]}];}else{_0x44f619[_0xdda2('0xa2')]=[{'all':!![]}];}}return _0x58973d[_0x4530b7[_0xdda2('0x17')]][_0xdda2('0xb')](_0x44f619);})[_0xdda2('0x7')](function(_0x354f35){_0xbc441a[_0xdda2('0xaf')]=_0x354f35;if(_0x2c442e===_0xdda2('0x33')&&_0xe8d81a['query'][_0xdda2('0xb0')]===_0xdda2('0xb1')){var _0x43e405=[];for(var _0x75b905=0x0;_0x75b905<_0xbc441a['rows'][_0xdda2('0x89')];_0x75b905++){_0x43e405[_0xdda2('0x8a')](_0x3fd76c(_0xdda2('0xb2'),_0xbc441a[_0xdda2('0xaf')][_0x75b905]['dataValues']));_0x43e405['push'](_0x3fd76c('sms',_0xbc441a[_0xdda2('0xaf')][_0x75b905][_0xdda2('0xb3')]));_0x43e405[_0xdda2('0x8a')](_0x3fd76c(_0xdda2('0xb4'),_0xbc441a[_0xdda2('0xaf')][_0x75b905][_0xdda2('0xb3')]));_0x43e405['push'](_0x3fd76c(_0xdda2('0xb5'),_0xbc441a[_0xdda2('0xaf')][_0x75b905][_0xdda2('0xb3')]));_0x43e405[_0xdda2('0x8a')](_0x3fd76c(_0xdda2('0xb6'),_0xbc441a[_0xdda2('0xaf')][_0x75b905][_0xdda2('0xb3')]));_0x43e405[_0xdda2('0x8a')](_0x3fd76c('whatsapp',_0xbc441a[_0xdda2('0xaf')][_0x75b905]['dataValues']));}return Promise[_0xdda2('0xb7')](_0x43e405)['then'](function(){return _0xbc441a;});}return _0xbc441a;});}});}}});};
\ No newline at end of file
index b22e51e..219af6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55c1=['info','request\x20sent','debug','stringify','error','code','UserProfile,\x20%s,\x20%s','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','register','request'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x55c1,0x1e5));var _0x155c=function(_0x5114aa,_0x4596b9){_0x5114aa=_0x5114aa-0x0;var _0x1841bc=_0x55c1[_0x5114aa];return _0x1841bc;};'use strict';var _=require(_0x155c('0x0'));var util=require(_0x155c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x155c('0x2'));var db=require(_0x155c('0x3'))['db'];var utils=require(_0x155c('0x4'));var logger=require(_0x155c('0x5'))(_0x155c('0x6'));var config=require('../../config/environment');var jayson=require(_0x155c('0x7'));var client=jayson[_0x155c('0x8')][_0x155c('0x9')]({'port':0x232a});config['redis']=_[_0x155c('0xa')](config[_0x155c('0xb')],{'host':_0x155c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userProfile.socket')[_0x155c('0xd')](socket);function respondWithRpcPromise(_0xb51331,_0x2bf577,_0x2194ff){return new BPromise(function(_0x4f95f0,_0x228de5){return client[_0x155c('0xe')](_0xb51331,_0x2194ff)['then'](function(_0x192182){logger[_0x155c('0xf')]('UserProfile,\x20%s,\x20%s',_0x2bf577,_0x155c('0x10'));logger[_0x155c('0x11')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x2bf577,_0x155c('0x10'),JSON[_0x155c('0x12')](_0x192182));if(_0x192182[_0x155c('0x13')]){if(_0x192182['error'][_0x155c('0x14')]===0x1f4){logger[_0x155c('0x13')](_0x155c('0x15'),_0x2bf577,_0x192182[_0x155c('0x13')][_0x155c('0x16')]);return _0x228de5(_0x192182['error'][_0x155c('0x16')]);}logger[_0x155c('0x13')]('UserProfile,\x20%s,\x20%s',_0x2bf577,_0x192182[_0x155c('0x13')]['message']);return _0x4f95f0(_0x192182[_0x155c('0x13')][_0x155c('0x16')]);}else{logger[_0x155c('0xf')]('UserProfile,\x20%s,\x20%s',_0x2bf577,_0x155c('0x10'));_0x4f95f0(_0x192182[_0x155c('0x17')][_0x155c('0x16')]);}})[_0x155c('0x18')](function(_0x43f537){logger[_0x155c('0x13')](_0x155c('0x15'),_0x2bf577,_0x43f537);_0x228de5(_0x43f537);});});}
\ No newline at end of file
+var _0xd1ca=['./userProfile.socket','register','request','info','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','UserProfile,\x20%s,\x20%s','message','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','socket.io-emitter'];(function(_0x20c512,_0x36c198){var _0x25236e=function(_0x418ec3){while(--_0x418ec3){_0x20c512['push'](_0x20c512['shift']());}};_0x25236e(++_0x36c198);}(_0xd1ca,0x140));var _0xad1c=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xd1ca[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0xad1c('0x0'));var util=require(_0xad1c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad1c('0x2'));var db=require(_0xad1c('0x3'))['db'];var utils=require(_0xad1c('0x4'));var logger=require('../../config/logger')(_0xad1c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xad1c('0x6')][_0xad1c('0x7')]({'port':0x232a});config[_0xad1c('0x8')]=_['defaults'](config[_0xad1c('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xad1c('0x9'))(new Redis(config[_0xad1c('0x8')]));require(_0xad1c('0xa'))[_0xad1c('0xb')](socket);function respondWithRpcPromise(_0x24bad3,_0x27364d,_0x1cc68b){return new BPromise(function(_0x3d790c,_0x46ecae){return client[_0xad1c('0xc')](_0x24bad3,_0x1cc68b)['then'](function(_0x195454){logger[_0xad1c('0xd')]('UserProfile,\x20%s,\x20%s',_0x27364d,_0xad1c('0xe'));logger[_0xad1c('0xf')](_0xad1c('0x10'),_0x27364d,_0xad1c('0xe'),JSON[_0xad1c('0x11')](_0x195454));if(_0x195454[_0xad1c('0x12')]){if(_0x195454[_0xad1c('0x12')]['code']===0x1f4){logger[_0xad1c('0x12')](_0xad1c('0x13'),_0x27364d,_0x195454[_0xad1c('0x12')][_0xad1c('0x14')]);return _0x46ecae(_0x195454[_0xad1c('0x12')]['message']);}logger[_0xad1c('0x12')](_0xad1c('0x13'),_0x27364d,_0x195454[_0xad1c('0x12')][_0xad1c('0x14')]);return _0x3d790c(_0x195454['error'][_0xad1c('0x14')]);}else{logger['info'](_0xad1c('0x13'),_0x27364d,_0xad1c('0xe'));_0x3d790c(_0x195454['result']['message']);}})[_0xad1c('0x15')](function(_0xa353d8){logger[_0xad1c('0x12')](_0xad1c('0x13'),_0x27364d,_0xa353d8);_0x46ecae(_0xa353d8);});});}
\ No newline at end of file
index 4ba559c..92fd7a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda94=['./userProfile.events','save','remove','update','emit','removeListener','register','length','userProfile:'];(function(_0x112e2a,_0x364486){var _0x4f8af9=function(_0xa11c0d){while(--_0xa11c0d){_0x112e2a['push'](_0x112e2a['shift']());}};_0x4f8af9(++_0x364486);}(_0xda94,0x14d));var _0x4da9=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0xda94[_0x565ed7];return _0x183ad7;};'use strict';var UserProfileEvents=require(_0x4da9('0x0'));var events=[_0x4da9('0x1'),_0x4da9('0x2'),_0x4da9('0x3')];function createListener(_0xa64d5e,_0x29b5ab){return function(_0x397487){_0x29b5ab[_0x4da9('0x4')](_0xa64d5e,_0x397487);};}function removeListener(_0x2ea56b,_0x290f26){return function(){UserProfileEvents[_0x4da9('0x5')](_0x2ea56b,_0x290f26);};}exports[_0x4da9('0x6')]=function(_0x37a872){for(var _0x57a22e=0x0,_0x2c75f0=events[_0x4da9('0x7')];_0x57a22e<_0x2c75f0;_0x57a22e++){var _0x2bfa39=events[_0x57a22e];var _0x2bad5e=createListener(_0x4da9('0x8')+_0x2bfa39,_0x37a872);UserProfileEvents['on'](_0x2bfa39,_0x2bad5e);}};
\ No newline at end of file
+var _0x5929=['register','length','userProfile:','./userProfile.events','save','remove','emit','removeListener'];(function(_0x5af956,_0x5796a2){var _0x21060b=function(_0x457984){while(--_0x457984){_0x5af956['push'](_0x5af956['shift']());}};_0x21060b(++_0x5796a2);}(_0x5929,0x1bb));var _0x9592=function(_0x5c927e,_0x55f499){_0x5c927e=_0x5c927e-0x0;var _0x11c9a5=_0x5929[_0x5c927e];return _0x11c9a5;};'use strict';var UserProfileEvents=require(_0x9592('0x0'));var events=[_0x9592('0x1'),_0x9592('0x2'),'update'];function createListener(_0x31fbca,_0x92e5){return function(_0x368229){_0x92e5[_0x9592('0x3')](_0x31fbca,_0x368229);};}function removeListener(_0x51db13,_0x1c8583){return function(){UserProfileEvents[_0x9592('0x4')](_0x51db13,_0x1c8583);};}exports[_0x9592('0x5')]=function(_0x1900b6){for(var _0x4ef0a6=0x0,_0x4a2f38=events[_0x9592('0x6')];_0x4ef0a6<_0x4a2f38;_0x4ef0a6++){var _0x4e1a29=events[_0x4ef0a6];var _0x172e4b=createListener(_0x9592('0x7')+_0x4e1a29,_0x1900b6);UserProfileEvents['on'](_0x4e1a29,_0x172e4b);}};
\ No newline at end of file
index b4f055c..c9a7698 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dee=['/:id','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x487137,_0x99182c){var _0x100716=function(_0x45c2ed){while(--_0x45c2ed){_0x487137['push'](_0x487137['shift']());}};_0x100716(++_0x99182c);}(_0x5dee,0x116));var _0xe5de=function(_0x12fe54,_0x39ba01){_0x12fe54=_0x12fe54-0x0;var _0x3011e7=_0x5dee[_0x12fe54];return _0x3011e7;};'use strict';var multer=require(_0xe5de('0x0'));var util=require(_0xe5de('0x1'));var path=require(_0xe5de('0x2'));var timeout=require(_0xe5de('0x3'));var express=require(_0xe5de('0x4'));var router=express[_0xe5de('0x5')]();var fs_extra=require(_0xe5de('0x6'));var auth=require(_0xe5de('0x7'));var interaction=require(_0xe5de('0x8'));var config=require(_0xe5de('0x9'));var controller=require(_0xe5de('0xa'));router['get']('/',auth[_0xe5de('0xb')](),controller[_0xe5de('0xc')]);router[_0xe5de('0xd')](_0xe5de('0xe'),auth['isAuthenticated'](),controller[_0xe5de('0xf')]);router[_0xe5de('0xd')](_0xe5de('0x10'),auth[_0xe5de('0xb')](),controller['show']);router['post']('/',auth[_0xe5de('0xb')](),controller['create']);router[_0xe5de('0x11')](_0xe5de('0x10'),auth['isAuthenticated'](),controller[_0xe5de('0x12')]);router[_0xe5de('0x13')](_0xe5de('0x10'),auth[_0xe5de('0xb')](),controller[_0xe5de('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x5225=['path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','/describe','isAuthenticated','/:id','show','create','put','update','delete','multer','util'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x5225,0x97));var _0x5522=function(_0x561049,_0x330926){_0x561049=_0x561049-0x0;var _0x52f109=_0x5225[_0x561049];return _0x52f109;};'use strict';var multer=require(_0x5522('0x0'));var util=require(_0x5522('0x1'));var path=require(_0x5522('0x2'));var timeout=require(_0x5522('0x3'));var express=require('express');var router=express[_0x5522('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5522('0x5'));var config=require(_0x5522('0x6'));var controller=require(_0x5522('0x7'));router[_0x5522('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5522('0x9'),auth[_0x5522('0xa')](),controller['describe']);router['get'](_0x5522('0xb'),auth[_0x5522('0xa')](),controller[_0x5522('0xc')]);router['post']('/',auth[_0x5522('0xa')](),controller[_0x5522('0xd')]);router[_0x5522('0xe')](_0x5522('0xb'),auth['isAuthenticated'](),controller[_0x5522('0xf')]);router[_0x5522('0x10')](_0x5522('0xb'),auth[_0x5522('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 811016e..f17430d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d54=['sequelize','exports','INTEGER','STRING'];(function(_0x444b46,_0x25fc41){var _0x32dc45=function(_0x42f466){while(--_0x42f466){_0x444b46['push'](_0x444b46['shift']());}};_0x32dc45(++_0x25fc41);}(_0x0d54,0xb0));var _0x40d5=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x0d54[_0x1c8c28];return _0x1f59b4;};'use strict';var Sequelize=require(_0x40d5('0x0'));module[_0x40d5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x40d5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x40d5('0x3')],'allowNull':![]}};
\ No newline at end of file
+var _0x8457=['sequelize','exports','STRING'];(function(_0x4e685d,_0xcfa8bb){var _0x3417bf=function(_0x55978e){while(--_0x55978e){_0x4e685d['push'](_0x4e685d['shift']());}};_0x3417bf(++_0xcfa8bb);}(_0x8457,0xb4));var _0x7845=function(_0xbe80fa,_0x583dd0){_0xbe80fa=_0xbe80fa-0x0;var _0x122309=_0x8457[_0xbe80fa];return _0x122309;};'use strict';var Sequelize=require(_0x7845('0x0'));module[_0x7845('0x1')]={'name':{'type':Sequelize[_0x7845('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 8d3ab2f..e502bd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8952=['filter','VIRTUAL','merge','options','findAll','rows','show','params','keys','includeAll','include','catch','create','body','destroy','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','end','stack','name','map','UserProfileResource','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8952,0x17e));var _0x2895=function(_0x5122a7,_0xdf550e){_0x5122a7=_0x5122a7-0x0;var _0x3ee128=_0x8952[_0x5122a7];return _0x3ee128;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2895('0x0'));var zipdir=require(_0x2895('0x1'));var jsonpatch=require(_0x2895('0x2'));var rp=require(_0x2895('0x3'));var moment=require(_0x2895('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2895('0x5'));var util=require(_0x2895('0x6'));var path=require(_0x2895('0x7'));var sox=require('sox');var csv=require(_0x2895('0x8'));var ejs=require(_0x2895('0x9'));var fs=require('fs');var fs_extra=require(_0x2895('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2895('0xb'));var jsforce=require(_0x2895('0xc'));var deskjs=require(_0x2895('0xd'));var toCsv=require(_0x2895('0x8'));var querystring=require(_0x2895('0xe'));var Papa=require('papaparse');var Redis=require(_0x2895('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2895('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2895('0x11'));var utils=require(_0x2895('0x12'));var config=require(_0x2895('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x2895('0x14'))['db'];function respondWithStatusCode(_0x3924be,_0x4b1342){_0x4b1342=_0x4b1342||0xcc;return function(_0x32574c){if(_0x32574c){return _0x3924be[_0x2895('0x15')](_0x4b1342);}return _0x3924be['status'](_0x4b1342)['end']();};}function respondWithResult(_0x1d1493,_0x2ca2ac){_0x2ca2ac=_0x2ca2ac||0xc8;return function(_0x5777a0){if(_0x5777a0){return _0x1d1493[_0x2895('0x16')](_0x2ca2ac)[_0x2895('0x17')](_0x5777a0);}};}function respondWithFilteredResult(_0x27b50e,_0x1ae013){return function(_0x1d3659){if(_0x1d3659){var _0x2627e6=typeof _0x1ae013[_0x2895('0x18')]===_0x2895('0x19')&&typeof _0x1ae013[_0x2895('0x1a')]===_0x2895('0x19');var _0x10a1bf=_0x1d3659[_0x2895('0x1b')];var _0xbf8b63=_0x2627e6?0x0:_0x1ae013[_0x2895('0x18')];var _0x155124=_0x2627e6?_0x1d3659[_0x2895('0x1b')]:_0x1ae013[_0x2895('0x18')]+_0x1ae013[_0x2895('0x1a')];var _0x5a8eab;if(_0x155124>=_0x10a1bf){_0x155124=_0x10a1bf;_0x5a8eab=0xc8;}else{_0x5a8eab=0xce;}_0x27b50e['status'](_0x5a8eab);return _0x27b50e['set'](_0x2895('0x1c'),_0xbf8b63+'-'+_0x155124+'/'+_0x10a1bf)[_0x2895('0x17')](_0x1d3659);}return null;};}function patchUpdates(_0x3ec4da){return function(_0x593e47){try{jsonpatch[_0x2895('0x1d')](_0x593e47,_0x3ec4da,!![]);}catch(_0x190b79){return BPromise[_0x2895('0x1e')](_0x190b79);}return _0x593e47[_0x2895('0x1f')]();};}function saveUpdates(_0x8b75e0,_0x5dbbfe){return function(_0x30c6c3){if(_0x30c6c3){return _0x30c6c3[_0x2895('0x20')](_0x8b75e0)['then'](function(_0x142e58){return _0x142e58;});}return null;};}function removeEntity(_0x384357,_0x6f8ad4){return function(_0x511286){if(_0x511286){return _0x511286['destroy']()[_0x2895('0x21')](function(){_0x384357[_0x2895('0x16')](0xcc)[_0x2895('0x22')]();});}};}function handleEntityNotFound(_0x4a21cf,_0x3d3320){return function(_0x3690ce){if(!_0x3690ce){_0x4a21cf['sendStatus'](0x194);}return _0x3690ce;};}function handleError(_0x293ad3,_0x127540){_0x127540=_0x127540||0x1f4;return function(_0x2cd4df){logger['error'](_0x2cd4df[_0x2895('0x23')]);if(_0x2cd4df[_0x2895('0x24')]){delete _0x2cd4df['name'];}_0x293ad3[_0x2895('0x16')](_0x127540)['send'](_0x2cd4df);};}exports['index']=function(_0x18a935,_0x4ee2cc){var _0xfa4f85={},_0x381538={},_0x4fdd94={'count':0x0,'rows':[]};var _0x5574bf=_[_0x2895('0x25')](db[_0x2895('0x26')][_0x2895('0x27')],function(_0x14e343){return{'name':_0x14e343[_0x2895('0x28')],'type':_0x14e343[_0x2895('0x29')][_0x2895('0x2a')]};});_0x381538['model']=_[_0x2895('0x25')](_0x5574bf,_0x2895('0x24'));_0x381538[_0x2895('0x2b')]=_['keys'](_0x18a935[_0x2895('0x2b')]);_0x381538[_0x2895('0x2c')]=_[_0x2895('0x2d')](_0x381538[_0x2895('0x2e')],_0x381538['query']);_0xfa4f85[_0x2895('0x2f')]=_[_0x2895('0x2d')](_0x381538[_0x2895('0x2e')],qs[_0x2895('0x30')](_0x18a935[_0x2895('0x2b')]['fields']));_0xfa4f85['attributes']=_0xfa4f85[_0x2895('0x2f')][_0x2895('0x31')]?_0xfa4f85['attributes']:_0x381538[_0x2895('0x2e')];if(!_0x18a935['query'][_0x2895('0x32')](_0x2895('0x33'))){_0xfa4f85['limit']=qs[_0x2895('0x1a')](_0x18a935['query'][_0x2895('0x1a')]);_0xfa4f85['offset']=qs['offset'](_0x18a935[_0x2895('0x2b')][_0x2895('0x18')]);}_0xfa4f85[_0x2895('0x34')]=qs['sort'](_0x18a935[_0x2895('0x2b')][_0x2895('0x35')]);_0xfa4f85[_0x2895('0x36')]=qs[_0x2895('0x2c')](_[_0x2895('0x37')](_0x18a935[_0x2895('0x2b')],_0x381538[_0x2895('0x2c')]),_0x5574bf);if(_0x18a935[_0x2895('0x2b')][_0x2895('0x38')]){_0xfa4f85[_0x2895('0x36')]=_['merge'](_0xfa4f85[_0x2895('0x36')],{'$or':_[_0x2895('0x25')](_0x5574bf,function(_0x47413d){if(_0x47413d[_0x2895('0x29')]!==_0x2895('0x39')){var _0x12d7d8={};_0x12d7d8[_0x47413d[_0x2895('0x24')]]={'$like':'%'+_0x18a935['query']['filter']+'%'};return _0x12d7d8;}})});}_0xfa4f85=_[_0x2895('0x3a')]({},_0xfa4f85,_0x18a935[_0x2895('0x3b')]);var _0x24b9e0={'where':_0xfa4f85[_0x2895('0x36')]};return db[_0x2895('0x26')][_0x2895('0x1b')](_0x24b9e0)['then'](function(_0x5d18ef){_0x4fdd94[_0x2895('0x1b')]=_0x5d18ef;if(_0x18a935[_0x2895('0x2b')]['includeAll']){_0xfa4f85['include']=[{'all':!![]}];}return db[_0x2895('0x26')][_0x2895('0x3c')](_0xfa4f85);})[_0x2895('0x21')](function(_0x28967f){_0x4fdd94[_0x2895('0x3d')]=_0x28967f;return _0x4fdd94;})[_0x2895('0x21')](respondWithFilteredResult(_0x4ee2cc,_0xfa4f85))['catch'](handleError(_0x4ee2cc,null));};exports[_0x2895('0x3e')]=function(_0x2cfb24,_0x18ca24){var _0x1537fd={'raw':![],'where':{'id':_0x2cfb24[_0x2895('0x3f')]['id']}},_0x4af6d6={};_0x4af6d6[_0x2895('0x2e')]=_[_0x2895('0x40')](db[_0x2895('0x26')]['rawAttributes']);_0x4af6d6['query']=_[_0x2895('0x40')](_0x2cfb24[_0x2895('0x2b')]);_0x4af6d6[_0x2895('0x2c')]=_[_0x2895('0x2d')](_0x4af6d6[_0x2895('0x2e')],_0x4af6d6['query']);_0x1537fd['attributes']=_[_0x2895('0x2d')](_0x4af6d6[_0x2895('0x2e')],qs[_0x2895('0x30')](_0x2cfb24[_0x2895('0x2b')][_0x2895('0x30')]));_0x1537fd[_0x2895('0x2f')]=_0x1537fd[_0x2895('0x2f')]['length']?_0x1537fd[_0x2895('0x2f')]:_0x4af6d6[_0x2895('0x2e')];if(_0x2cfb24[_0x2895('0x2b')][_0x2895('0x41')]){_0x1537fd[_0x2895('0x42')]=[{'all':!![]}];}_0x1537fd=_[_0x2895('0x3a')]({},_0x1537fd,_0x2cfb24[_0x2895('0x3b')]);return db[_0x2895('0x26')]['find'](_0x1537fd)[_0x2895('0x21')](handleEntityNotFound(_0x18ca24,null))[_0x2895('0x21')](respondWithResult(_0x18ca24,null))[_0x2895('0x43')](handleError(_0x18ca24,null));};exports['create']=function(_0xc85aa1,_0x5307a9){return db['UserProfileResource'][_0x2895('0x44')](_0xc85aa1[_0x2895('0x45')],{})[_0x2895('0x21')](respondWithResult(_0x5307a9,0xc9))[_0x2895('0x43')](handleError(_0x5307a9,null));};exports[_0x2895('0x20')]=function(_0x3cc331,_0x11e53a){if(_0x3cc331['body']['id']){delete _0x3cc331[_0x2895('0x45')]['id'];}return db[_0x2895('0x26')]['find']({'where':{'id':_0x3cc331['params']['id']}})['then'](handleEntityNotFound(_0x11e53a,null))[_0x2895('0x21')](saveUpdates(_0x3cc331[_0x2895('0x45')],null))[_0x2895('0x21')](respondWithResult(_0x11e53a,null))[_0x2895('0x43')](handleError(_0x11e53a,null));};exports[_0x2895('0x46')]=function(_0x3c5261,_0xaca46c){return db[_0x2895('0x26')][_0x2895('0x47')]({'where':{'id':_0x3c5261[_0x2895('0x3f')]['id']}})[_0x2895('0x21')](handleEntityNotFound(_0xaca46c,null))[_0x2895('0x21')](removeEntity(_0xaca46c,null))[_0x2895('0x43')](handleError(_0xaca46c,null));};exports[_0x2895('0x48')]=function(_0x356d35,_0x3c1135){return db[_0x2895('0x26')][_0x2895('0x48')]()[_0x2895('0x21')](respondWithResult(_0x3c1135,null))[_0x2895('0x43')](handleError(_0x3c1135,null));};
\ No newline at end of file
+var _0xba34=['../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x2962b4,_0x4b0786){var _0x411b7d=function(_0x363aad){while(--_0x363aad){_0x2962b4['push'](_0x2962b4['shift']());}};_0x411b7d(++_0x4b0786);}(_0xba34,0x119));var _0x4ba3=function(_0x3deda8,_0x21b0fb){_0x3deda8=_0x3deda8-0x0;var _0x5cd549=_0xba34[_0x3deda8];return _0x5cd549;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));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('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['UserProfileResource']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['create']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['create'](_0xa4bbb2[_0x4ba3('0x49')],{})[_0x4ba3('0x26')](respondWithResult(_0x1fe115,0xc9))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports['update']=function(_0x47f588,_0x34dc04){if(_0x47f588['body']['id']){delete _0x47f588[_0x4ba3('0x49')]['id'];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x47f588[_0x4ba3('0x4a')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x34dc04,null))[_0x4ba3('0x26')](saveUpdates(_0x47f588['body'],null))[_0x4ba3('0x26')](respondWithResult(_0x34dc04,null))[_0x4ba3('0x46')](handleError(_0x34dc04,null));};exports['destroy']=function(_0x325475,_0x12ae6f){return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'id':_0x325475[_0x4ba3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12ae6f,null))[_0x4ba3('0x26')](removeEntity(_0x12ae6f,null))[_0x4ba3('0x46')](handleError(_0x12ae6f,null));};exports['describe']=function(_0x43f820,_0x19d70f){return db[_0x4ba3('0x2d')][_0x4ba3('0x4b')]()[_0x4ba3('0x26')](respondWithResult(_0x19d70f,null))[_0x4ba3('0x46')](handleError(_0x19d70f,null));};
\ No newline at end of file
index 764c90c..48da332 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0381=['path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','compositeIndex','resourceId','sectionId','lodash','../../config/logger','api','bluebird'];(function(_0x233d57,_0x284678){var _0x3eec8c=function(_0x56d91b){while(--_0x56d91b){_0x233d57['push'](_0x233d57['shift']());}};_0x3eec8c(++_0x284678);}(_0x0381,0x106));var _0x1038=function(_0x5647fb,_0x5c222f){_0x5647fb=_0x5647fb-0x0;var _0x1c7e7e=_0x0381[_0x5647fb];return _0x1c7e7e;};'use strict';var _=require(_0x1038('0x0'));var util=require('util');var logger=require(_0x1038('0x1'))(_0x1038('0x2'));var moment=require('moment');var BPromise=require(_0x1038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1038('0x4'));var rimraf=require(_0x1038('0x5'));var config=require(_0x1038('0x6'));var attributes=require(_0x1038('0x7'));module[_0x1038('0x8')]=function(_0x1a98e1,_0x1e25e9){return _0x1a98e1[_0x1038('0x9')](_0x1038('0xa'),attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x1038('0xb'),'fields':[_0x1038('0xc'),_0x1038('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xffe4=['../../config/environment','./userProfileResource.attributes','user_profile_has_resources','resourceId','sectionId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1d044b,_0x142a89){var _0x3a15e9=function(_0x46f1fd){while(--_0x46f1fd){_0x1d044b['push'](_0x1d044b['shift']());}};_0x3a15e9(++_0x142a89);}(_0xffe4,0xd7));var _0x4ffe=function(_0xdc51ba,_0x2253bd){_0xdc51ba=_0xdc51ba-0x0;var _0x2cef5c=_0xffe4[_0xdc51ba];return _0x2cef5c;};'use strict';var _=require(_0x4ffe('0x0'));var util=require(_0x4ffe('0x1'));var logger=require(_0x4ffe('0x2'))(_0x4ffe('0x3'));var moment=require(_0x4ffe('0x4'));var BPromise=require(_0x4ffe('0x5'));var rp=require(_0x4ffe('0x6'));var fs=require('fs');var path=require(_0x4ffe('0x7'));var rimraf=require(_0x4ffe('0x8'));var config=require(_0x4ffe('0x9'));var attributes=require(_0x4ffe('0xa'));module['exports']=function(_0x48016f,_0x487b4a){return _0x48016f['define']('UserProfileResource',attributes,{'tableName':_0x4ffe('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x4ffe('0xc'),_0x4ffe('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index d90431c..726d34b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a25=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','debug','request\x20sent','stringify','error','code','message','UserProfileResource,\x20%s,\x20%s','info','catch'];(function(_0x3f6e5d,_0x32a6c0){var _0x10a877=function(_0x1edcea){while(--_0x1edcea){_0x3f6e5d['push'](_0x3f6e5d['shift']());}};_0x10a877(++_0x32a6c0);}(_0x1a25,0x1f4));var _0x51a2=function(_0x424a26,_0x125957){_0x424a26=_0x424a26-0x0;var _0x20cc43=_0x1a25[_0x424a26];return _0x20cc43;};'use strict';var _=require(_0x51a2('0x0'));var util=require(_0x51a2('0x1'));var moment=require(_0x51a2('0x2'));var BPromise=require(_0x51a2('0x3'));var rs=require(_0x51a2('0x4'));var fs=require('fs');var Redis=require(_0x51a2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x51a2('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x51a2('0x7'));var jayson=require(_0x51a2('0x8'));var client=jayson[_0x51a2('0x9')][_0x51a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x200010,_0x52b251,_0x30c3ab){return new BPromise(function(_0x117187,_0x3c8cf8){return client['request'](_0x200010,_0x30c3ab)['then'](function(_0x2936ae){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x52b251,'request\x20sent');logger[_0x51a2('0xb')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x52b251,_0x51a2('0xc'),JSON[_0x51a2('0xd')](_0x2936ae));if(_0x2936ae[_0x51a2('0xe')]){if(_0x2936ae[_0x51a2('0xe')][_0x51a2('0xf')]===0x1f4){logger[_0x51a2('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x52b251,_0x2936ae[_0x51a2('0xe')][_0x51a2('0x10')]);return _0x3c8cf8(_0x2936ae[_0x51a2('0xe')]['message']);}logger['error'](_0x51a2('0x11'),_0x52b251,_0x2936ae[_0x51a2('0xe')]['message']);return _0x117187(_0x2936ae[_0x51a2('0xe')][_0x51a2('0x10')]);}else{logger[_0x51a2('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x52b251,_0x51a2('0xc'));_0x117187(_0x2936ae['result']['message']);}})[_0x51a2('0x13')](function(_0xc854d5){logger[_0x51a2('0xe')](_0x51a2('0x11'),_0x52b251,_0xc854d5);_0x3c8cf8(_0xc854d5);});});}
\ No newline at end of file
+var _0xbb18=['client','http','request','then','request\x20sent','debug','stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xbb18,0x1ac));var _0x8bb1=function(_0x3a8db5,_0x31cff7){_0x3a8db5=_0x3a8db5-0x0;var _0x2c03cd=_0xbb18[_0x3a8db5];return _0x2c03cd;};'use strict';var _=require(_0x8bb1('0x0'));var util=require(_0x8bb1('0x1'));var moment=require(_0x8bb1('0x2'));var BPromise=require('bluebird');var rs=require(_0x8bb1('0x3'));var fs=require('fs');var Redis=require(_0x8bb1('0x4'));var db=require(_0x8bb1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8bb1('0x6'));var config=require(_0x8bb1('0x7'));var jayson=require(_0x8bb1('0x8'));var client=jayson[_0x8bb1('0x9')][_0x8bb1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x448038,_0x448e27,_0x457367){return new BPromise(function(_0x4a0330,_0x111c8c){return client[_0x8bb1('0xb')](_0x448038,_0x457367)[_0x8bb1('0xc')](function(_0x549e7a){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x448e27,_0x8bb1('0xd'));logger[_0x8bb1('0xe')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x448e27,_0x8bb1('0xd'),JSON[_0x8bb1('0xf')](_0x549e7a));if(_0x549e7a[_0x8bb1('0x10')]){if(_0x549e7a[_0x8bb1('0x10')][_0x8bb1('0x11')]===0x1f4){logger[_0x8bb1('0x10')](_0x8bb1('0x12'),_0x448e27,_0x549e7a[_0x8bb1('0x10')][_0x8bb1('0x13')]);return _0x111c8c(_0x549e7a[_0x8bb1('0x10')][_0x8bb1('0x13')]);}logger[_0x8bb1('0x10')](_0x8bb1('0x12'),_0x448e27,_0x549e7a['error'][_0x8bb1('0x13')]);return _0x4a0330(_0x549e7a['error'][_0x8bb1('0x13')]);}else{logger[_0x8bb1('0x14')](_0x8bb1('0x12'),_0x448e27,'request\x20sent');_0x4a0330(_0x549e7a[_0x8bb1('0x15')][_0x8bb1('0x13')]);}})[_0x8bb1('0x16')](function(_0x4749ea){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x448e27,_0x4749ea);_0x111c8c(_0x4749ea);});});}
\ No newline at end of file
index 134d931..1cced71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x46c1=['destroy','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','delete'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x46c1,0x187));var _0x146c=function(_0x2fef7f,_0x28ef5b){_0x2fef7f=_0x2fef7f-0x0;var _0x5d4690=_0x46c1[_0x2fef7f];return _0x5d4690;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x146c('0x0'));var router=express[_0x146c('0x1')]();var fs_extra=require(_0x146c('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x146c('0x3'));var config=require(_0x146c('0x4'));var controller=require('./userProfileSection.controller');router[_0x146c('0x5')]('/',auth[_0x146c('0x6')](),controller[_0x146c('0x7')]);router[_0x146c('0x5')](_0x146c('0x8'),auth[_0x146c('0x6')](),controller['describe']);router[_0x146c('0x5')](_0x146c('0x9'),auth['isAuthenticated'](),controller[_0x146c('0xa')]);router[_0x146c('0xb')]('/',auth[_0x146c('0x6')](),controller[_0x146c('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x146c('0xd')](_0x146c('0x9'),auth[_0x146c('0x6')](),controller[_0x146c('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xdc3e=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','multer','util','path','connect-timeout'];(function(_0x485c9f,_0x399a20){var _0x2ba76e=function(_0x3598d4){while(--_0x3598d4){_0x485c9f['push'](_0x485c9f['shift']());}};_0x2ba76e(++_0x399a20);}(_0xdc3e,0xb0));var _0xedc3=function(_0x415244,_0x4c5ffa){_0x415244=_0x415244-0x0;var _0x7ebc77=_0xdc3e[_0x415244];return _0x7ebc77;};'use strict';var multer=require(_0xedc3('0x0'));var util=require(_0xedc3('0x1'));var path=require(_0xedc3('0x2'));var timeout=require(_0xedc3('0x3'));var express=require(_0xedc3('0x4'));var router=express[_0xedc3('0x5')]();var fs_extra=require(_0xedc3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xedc3('0x7'));var config=require(_0xedc3('0x8'));var controller=require('./userProfileSection.controller');router[_0xedc3('0x9')]('/',auth[_0xedc3('0xa')](),controller['index']);router[_0xedc3('0x9')](_0xedc3('0xb'),auth['isAuthenticated'](),controller[_0xedc3('0xc')]);router['get'](_0xedc3('0xd'),auth['isAuthenticated'](),controller[_0xedc3('0xe')]);router[_0xedc3('0xf')]('/',auth[_0xedc3('0xa')](),controller[_0xedc3('0x10')]);router[_0xedc3('0x11')]('/:id',auth[_0xedc3('0xa')](),controller[_0xedc3('0x12')]);router[_0xedc3('0x13')]('/:id',auth[_0xedc3('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 174d25c..24293b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d25=['INTEGER','BOOLEAN','getDataValue','crudPermissions','split','exports','STRING'];(function(_0x1220dc,_0x448145){var _0x264ada=function(_0x171972){while(--_0x171972){_0x1220dc['push'](_0x1220dc['shift']());}};_0x264ada(++_0x448145);}(_0x7d25,0x8a));var _0x57d2=function(_0x59d89e,_0x55edf5){_0x59d89e=_0x59d89e-0x0;var _0x554e93=_0x7d25[_0x59d89e];return _0x554e93;};'use strict';var Sequelize=require('sequelize');module[_0x57d2('0x0')]={'name':{'type':Sequelize[_0x57d2('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x57d2('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x57d2('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x57d2('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x57d2('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x57d2('0x1')],'set':function(_0x5c1baa){this['setDataValue']('crudPermissions',_0x5c1baa?_0x5c1baa['join'](''):[]);},'get':function(){return this[_0x57d2('0x4')]('crudPermissions')?this[_0x57d2('0x4')](_0x57d2('0x5'))[_0x57d2('0x6')](''):[];}}};
\ No newline at end of file
+var _0x0713=['getDataValue','split','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x4eb93a,_0xb0fad5){var _0x52d34f=function(_0x4a6e43){while(--_0x4a6e43){_0x4eb93a['push'](_0x4eb93a['shift']());}};_0x52d34f(++_0xb0fad5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x3071('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x3071('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x3071('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x3071('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x2c547f){this[_0x3071('0x3')](_0x3071('0x4'),_0x2c547f?_0x2c547f[_0x3071('0x5')](''):[]);},'get':function(){return this[_0x3071('0x6')](_0x3071('0x4'))?this[_0x3071('0x6')](_0x3071('0x4'))[_0x3071('0x7')](''):[];}}};
\ No newline at end of file
index afd5350..f2a9c44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee61=['model','query','keys','intersection','attributes','fields','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','length','create','body','find','params','describe','eml-format','fast-json-patch','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','UserProfileSection','rawAttributes','fieldName','type'];(function(_0x494e4b,_0x7ed6d1){var _0x10ec2e=function(_0x4620bf){while(--_0x4620bf){_0x494e4b['push'](_0x494e4b['shift']());}};_0x10ec2e(++_0x7ed6d1);}(_0xee61,0xec));var _0x1ee6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xee61[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x1ee6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1ee6('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1ee6('0x2'));var Mustache=require('mustache');var util=require(_0x1ee6('0x3'));var path=require('path');var sox=require(_0x1ee6('0x4'));var csv=require(_0x1ee6('0x5'));var ejs=require(_0x1ee6('0x6'));var fs=require('fs');var fs_extra=require(_0x1ee6('0x7'));var _=require(_0x1ee6('0x8'));var squel=require(_0x1ee6('0x9'));var crypto=require(_0x1ee6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1ee6('0xb'));var toCsv=require(_0x1ee6('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1ee6('0xc'));var authService=require(_0x1ee6('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x1ee6('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ee6('0xf'))(_0x1ee6('0x10'));var utils=require('../../config/utils');var config=require(_0x1ee6('0x11'));var licenseUtil=require(_0x1ee6('0x12'));var db=require(_0x1ee6('0x13'))['db'];function respondWithStatusCode(_0x34827b,_0x24165a){_0x24165a=_0x24165a||0xcc;return function(_0x376be4){if(_0x376be4){return _0x34827b[_0x1ee6('0x14')](_0x24165a);}return _0x34827b[_0x1ee6('0x15')](_0x24165a)['end']();};}function respondWithResult(_0x5d0e94,_0xab9eda){_0xab9eda=_0xab9eda||0xc8;return function(_0x269c5d){if(_0x269c5d){return _0x5d0e94[_0x1ee6('0x15')](_0xab9eda)[_0x1ee6('0x16')](_0x269c5d);}};}function respondWithFilteredResult(_0x8308fe,_0x46a56b){return function(_0x37feba){if(_0x37feba){var _0x442f53=typeof _0x46a56b[_0x1ee6('0x17')]==='undefined'&&typeof _0x46a56b[_0x1ee6('0x18')]===_0x1ee6('0x19');var _0x145818=_0x37feba[_0x1ee6('0x1a')];var _0x24538b=_0x442f53?0x0:_0x46a56b['offset'];var _0x143232=_0x442f53?_0x37feba['count']:_0x46a56b[_0x1ee6('0x17')]+_0x46a56b[_0x1ee6('0x18')];var _0x54df43;if(_0x143232>=_0x145818){_0x143232=_0x145818;_0x54df43=0xc8;}else{_0x54df43=0xce;}_0x8308fe[_0x1ee6('0x15')](_0x54df43);return _0x8308fe[_0x1ee6('0x1b')](_0x1ee6('0x1c'),_0x24538b+'-'+_0x143232+'/'+_0x145818)[_0x1ee6('0x16')](_0x37feba);}return null;};}function patchUpdates(_0x72295a){return function(_0x40dd2d){try{jsonpatch[_0x1ee6('0x1d')](_0x40dd2d,_0x72295a,!![]);}catch(_0x977abe){return BPromise[_0x1ee6('0x1e')](_0x977abe);}return _0x40dd2d[_0x1ee6('0x1f')]();};}function saveUpdates(_0x3cf791,_0x3989e7){return function(_0x18d3f2){if(_0x18d3f2){return _0x18d3f2[_0x1ee6('0x20')](_0x3cf791)[_0x1ee6('0x21')](function(_0x310218){return _0x310218;});}return null;};}function removeEntity(_0x216ef2,_0x2127a8){return function(_0x5ccd19){if(_0x5ccd19){return _0x5ccd19[_0x1ee6('0x22')]()[_0x1ee6('0x21')](function(){_0x216ef2[_0x1ee6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27d1c5,_0xb5d1b6){return function(_0x4e7f28){if(!_0x4e7f28){_0x27d1c5[_0x1ee6('0x14')](0x194);}return _0x4e7f28;};}function handleError(_0x43042d,_0x2ea611){_0x2ea611=_0x2ea611||0x1f4;return function(_0x34ca0b){logger[_0x1ee6('0x23')](_0x34ca0b[_0x1ee6('0x24')]);if(_0x34ca0b[_0x1ee6('0x25')]){delete _0x34ca0b[_0x1ee6('0x25')];}_0x43042d[_0x1ee6('0x15')](_0x2ea611)[_0x1ee6('0x26')](_0x34ca0b);};}exports['index']=function(_0x3494a1,_0x4d3579){var _0x2225b9={},_0x31f38c={},_0x1a7fea={'count':0x0,'rows':[]};var _0x5cbe43=_[_0x1ee6('0x27')](db[_0x1ee6('0x28')][_0x1ee6('0x29')],function(_0x45d36d){return{'name':_0x45d36d[_0x1ee6('0x2a')],'type':_0x45d36d[_0x1ee6('0x2b')]['key']};});_0x31f38c[_0x1ee6('0x2c')]=_[_0x1ee6('0x27')](_0x5cbe43,_0x1ee6('0x25'));_0x31f38c[_0x1ee6('0x2d')]=_[_0x1ee6('0x2e')](_0x3494a1[_0x1ee6('0x2d')]);_0x31f38c['filters']=_[_0x1ee6('0x2f')](_0x31f38c[_0x1ee6('0x2c')],_0x31f38c['query']);_0x2225b9[_0x1ee6('0x30')]=_[_0x1ee6('0x2f')](_0x31f38c[_0x1ee6('0x2c')],qs[_0x1ee6('0x31')](_0x3494a1[_0x1ee6('0x2d')][_0x1ee6('0x31')]));_0x2225b9[_0x1ee6('0x30')]=_0x2225b9['attributes']['length']?_0x2225b9[_0x1ee6('0x30')]:_0x31f38c[_0x1ee6('0x2c')];if(!_0x3494a1[_0x1ee6('0x2d')]['hasOwnProperty']('nolimit')){_0x2225b9[_0x1ee6('0x18')]=qs[_0x1ee6('0x18')](_0x3494a1[_0x1ee6('0x2d')][_0x1ee6('0x18')]);_0x2225b9[_0x1ee6('0x17')]=qs['offset'](_0x3494a1['query'][_0x1ee6('0x17')]);}_0x2225b9[_0x1ee6('0x32')]=qs[_0x1ee6('0x33')](_0x3494a1[_0x1ee6('0x2d')][_0x1ee6('0x33')]);_0x2225b9[_0x1ee6('0x34')]=qs[_0x1ee6('0x35')](_[_0x1ee6('0x36')](_0x3494a1[_0x1ee6('0x2d')],_0x31f38c[_0x1ee6('0x35')]),_0x5cbe43);if(_0x3494a1[_0x1ee6('0x2d')][_0x1ee6('0x37')]){_0x2225b9[_0x1ee6('0x34')]=_[_0x1ee6('0x38')](_0x2225b9[_0x1ee6('0x34')],{'$or':_[_0x1ee6('0x27')](_0x5cbe43,function(_0xfc8d9){if(_0xfc8d9[_0x1ee6('0x2b')]!==_0x1ee6('0x39')){var _0x36a25b={};_0x36a25b[_0xfc8d9['name']]={'$like':'%'+_0x3494a1[_0x1ee6('0x2d')]['filter']+'%'};return _0x36a25b;}})});}_0x2225b9=_[_0x1ee6('0x38')]({},_0x2225b9,_0x3494a1[_0x1ee6('0x3a')]);var _0x47ea46={'where':_0x2225b9['where']};return db[_0x1ee6('0x28')][_0x1ee6('0x1a')](_0x47ea46)[_0x1ee6('0x21')](function(_0x165143){_0x1a7fea[_0x1ee6('0x1a')]=_0x165143;if(_0x3494a1[_0x1ee6('0x2d')][_0x1ee6('0x3b')]){_0x2225b9[_0x1ee6('0x3c')]=[{'all':!![]}];}return db['UserProfileSection'][_0x1ee6('0x3d')](_0x2225b9);})[_0x1ee6('0x21')](function(_0x354eaa){_0x1a7fea[_0x1ee6('0x3e')]=_0x354eaa;return _0x1a7fea;})[_0x1ee6('0x21')](respondWithFilteredResult(_0x4d3579,_0x2225b9))[_0x1ee6('0x3f')](handleError(_0x4d3579,null));};exports['show']=function(_0xce3086,_0x51912f){var _0x5c666b={'raw':![],'where':{'id':_0xce3086['params']['id']}},_0x295216={};_0x295216[_0x1ee6('0x2c')]=_[_0x1ee6('0x2e')](db[_0x1ee6('0x28')][_0x1ee6('0x29')]);_0x295216[_0x1ee6('0x2d')]=_[_0x1ee6('0x2e')](_0xce3086['query']);_0x295216[_0x1ee6('0x35')]=_[_0x1ee6('0x2f')](_0x295216[_0x1ee6('0x2c')],_0x295216[_0x1ee6('0x2d')]);_0x5c666b[_0x1ee6('0x30')]=_[_0x1ee6('0x2f')](_0x295216[_0x1ee6('0x2c')],qs[_0x1ee6('0x31')](_0xce3086['query']['fields']));_0x5c666b[_0x1ee6('0x30')]=_0x5c666b[_0x1ee6('0x30')][_0x1ee6('0x40')]?_0x5c666b['attributes']:_0x295216[_0x1ee6('0x2c')];if(_0xce3086[_0x1ee6('0x2d')][_0x1ee6('0x3b')]){_0x5c666b['include']=[{'all':!![]}];}_0x5c666b=_['merge']({},_0x5c666b,_0xce3086[_0x1ee6('0x3a')]);return db[_0x1ee6('0x28')]['find'](_0x5c666b)['then'](handleEntityNotFound(_0x51912f,null))[_0x1ee6('0x21')](respondWithResult(_0x51912f,null))[_0x1ee6('0x3f')](handleError(_0x51912f,null));};exports[_0x1ee6('0x41')]=function(_0x19b483,_0x14dcfc){return db[_0x1ee6('0x28')]['create'](_0x19b483[_0x1ee6('0x42')],{})['then'](respondWithResult(_0x14dcfc,0xc9))['catch'](handleError(_0x14dcfc,null));};exports['update']=function(_0x2d32f6,_0x1678d8){if(_0x2d32f6[_0x1ee6('0x42')]['id']){delete _0x2d32f6[_0x1ee6('0x42')]['id'];}return db[_0x1ee6('0x28')]['find']({'where':{'id':_0x2d32f6['params']['id']}})[_0x1ee6('0x21')](handleEntityNotFound(_0x1678d8,null))['then'](saveUpdates(_0x2d32f6['body'],null))['then'](respondWithResult(_0x1678d8,null))['catch'](handleError(_0x1678d8,null));};exports[_0x1ee6('0x22')]=function(_0x387809,_0x3f63c9){return db[_0x1ee6('0x28')][_0x1ee6('0x43')]({'where':{'id':_0x387809[_0x1ee6('0x44')]['id']}})[_0x1ee6('0x21')](handleEntityNotFound(_0x3f63c9,null))['then'](removeEntity(_0x3f63c9,null))[_0x1ee6('0x3f')](handleError(_0x3f63c9,null));};exports[_0x1ee6('0x45')]=function(_0x35c2b0,_0x580737){return db[_0x1ee6('0x28')][_0x1ee6('0x45')]()[_0x1ee6('0x21')](respondWithResult(_0x580737,null))[_0x1ee6('0x3f')](handleError(_0x580737,null));};
\ No newline at end of file
+var _0xd859=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','UserProfileSection','includeAll','findAll','show','params','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x5648a4,_0x23eb1b){var _0x585520=function(_0x41997e){while(--_0x41997e){_0x5648a4['push'](_0x5648a4['shift']());}};_0x585520(++_0x23eb1b);}(_0xd859,0x7e));var _0x9d85=function(_0x4e9df2,_0x36818e){_0x4e9df2=_0x4e9df2-0x0;var _0x9fe790=_0xd859[_0x4e9df2];return _0x9fe790;};'use strict';var emlformat=require(_0x9d85('0x0'));var rimraf=require(_0x9d85('0x1'));var zipdir=require(_0x9d85('0x2'));var jsonpatch=require(_0x9d85('0x3'));var rp=require(_0x9d85('0x4'));var moment=require(_0x9d85('0x5'));var BPromise=require(_0x9d85('0x6'));var Mustache=require(_0x9d85('0x7'));var util=require('util');var path=require(_0x9d85('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9d85('0x9'));var _=require(_0x9d85('0xa'));var squel=require('squel');var crypto=require(_0x9d85('0xb'));var jsforce=require(_0x9d85('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9d85('0xd'));var querystring=require(_0x9d85('0xe'));var Papa=require('papaparse');var Redis=require(_0x9d85('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9d85('0x10'));var logger=require(_0x9d85('0x11'))(_0x9d85('0x12'));var utils=require('../../config/utils');var config=require(_0x9d85('0x13'));var licenseUtil=require(_0x9d85('0x14'));var db=require(_0x9d85('0x15'))['db'];function respondWithStatusCode(_0x552afc,_0x1ea8cc){_0x1ea8cc=_0x1ea8cc||0xcc;return function(_0x16c5e9){if(_0x16c5e9){return _0x552afc[_0x9d85('0x16')](_0x1ea8cc);}return _0x552afc[_0x9d85('0x17')](_0x1ea8cc)[_0x9d85('0x18')]();};}function respondWithResult(_0x22fdb9,_0x261d47){_0x261d47=_0x261d47||0xc8;return function(_0x3393e7){if(_0x3393e7){return _0x22fdb9[_0x9d85('0x17')](_0x261d47)[_0x9d85('0x19')](_0x3393e7);}};}function respondWithFilteredResult(_0x51c0c4,_0x2d7232){return function(_0x3383a3){if(_0x3383a3){var _0xb30981=typeof _0x2d7232[_0x9d85('0x1a')]==='undefined'&&typeof _0x2d7232[_0x9d85('0x1b')]===_0x9d85('0x1c');var _0x7c682=_0x3383a3[_0x9d85('0x1d')];var _0x244b8b=_0xb30981?0x0:_0x2d7232['offset'];var _0x5633cd=_0xb30981?_0x3383a3[_0x9d85('0x1d')]:_0x2d7232[_0x9d85('0x1a')]+_0x2d7232['limit'];var _0x19c955;if(_0x5633cd>=_0x7c682){_0x5633cd=_0x7c682;_0x19c955=0xc8;}else{_0x19c955=0xce;}_0x51c0c4['status'](_0x19c955);return _0x51c0c4[_0x9d85('0x1e')](_0x9d85('0x1f'),_0x244b8b+'-'+_0x5633cd+'/'+_0x7c682)[_0x9d85('0x19')](_0x3383a3);}return null;};}function patchUpdates(_0x3b717f){return function(_0x546bf4){try{jsonpatch['apply'](_0x546bf4,_0x3b717f,!![]);}catch(_0x2d97d6){return BPromise[_0x9d85('0x20')](_0x2d97d6);}return _0x546bf4['save']();};}function saveUpdates(_0x352a15,_0xa87689){return function(_0x166b1a){if(_0x166b1a){return _0x166b1a[_0x9d85('0x21')](_0x352a15)[_0x9d85('0x22')](function(_0x5d8430){return _0x5d8430;});}return null;};}function removeEntity(_0x3e61f1,_0x43519b){return function(_0x547399){if(_0x547399){return _0x547399[_0x9d85('0x23')]()[_0x9d85('0x22')](function(){_0x3e61f1['status'](0xcc)[_0x9d85('0x18')]();});}};}function handleEntityNotFound(_0x5b1b79,_0x1541e2){return function(_0x4e14c1){if(!_0x4e14c1){_0x5b1b79[_0x9d85('0x16')](0x194);}return _0x4e14c1;};}function handleError(_0x30f241,_0x489e5e){_0x489e5e=_0x489e5e||0x1f4;return function(_0x41d21b){logger[_0x9d85('0x24')](_0x41d21b[_0x9d85('0x25')]);if(_0x41d21b[_0x9d85('0x26')]){delete _0x41d21b[_0x9d85('0x26')];}_0x30f241['status'](_0x489e5e)[_0x9d85('0x27')](_0x41d21b);};}exports[_0x9d85('0x28')]=function(_0x6147ae,_0x5ba87){var _0x2126c9={},_0x2f6280={},_0x5874d2={'count':0x0,'rows':[]};var _0x196c1f=_[_0x9d85('0x29')](db['UserProfileSection'][_0x9d85('0x2a')],function(_0x34cefc){return{'name':_0x34cefc[_0x9d85('0x2b')],'type':_0x34cefc['type'][_0x9d85('0x2c')]};});_0x2f6280['model']=_['map'](_0x196c1f,'name');_0x2f6280[_0x9d85('0x2d')]=_[_0x9d85('0x2e')](_0x6147ae[_0x9d85('0x2d')]);_0x2f6280[_0x9d85('0x2f')]=_[_0x9d85('0x30')](_0x2f6280['model'],_0x2f6280['query']);_0x2126c9[_0x9d85('0x31')]=_['intersection'](_0x2f6280[_0x9d85('0x32')],qs['fields'](_0x6147ae[_0x9d85('0x2d')][_0x9d85('0x33')]));_0x2126c9[_0x9d85('0x31')]=_0x2126c9['attributes'][_0x9d85('0x34')]?_0x2126c9[_0x9d85('0x31')]:_0x2f6280[_0x9d85('0x32')];if(!_0x6147ae[_0x9d85('0x2d')]['hasOwnProperty'](_0x9d85('0x35'))){_0x2126c9[_0x9d85('0x1b')]=qs['limit'](_0x6147ae[_0x9d85('0x2d')][_0x9d85('0x1b')]);_0x2126c9['offset']=qs['offset'](_0x6147ae['query'][_0x9d85('0x1a')]);}_0x2126c9[_0x9d85('0x36')]=qs[_0x9d85('0x37')](_0x6147ae[_0x9d85('0x2d')][_0x9d85('0x37')]);_0x2126c9[_0x9d85('0x38')]=qs[_0x9d85('0x2f')](_[_0x9d85('0x39')](_0x6147ae[_0x9d85('0x2d')],_0x2f6280[_0x9d85('0x2f')]),_0x196c1f);if(_0x6147ae[_0x9d85('0x2d')][_0x9d85('0x3a')]){_0x2126c9[_0x9d85('0x38')]=_[_0x9d85('0x3b')](_0x2126c9['where'],{'$or':_[_0x9d85('0x29')](_0x196c1f,function(_0xb79618){if(_0xb79618[_0x9d85('0x3c')]!=='VIRTUAL'){var _0xecc607={};_0xecc607[_0xb79618[_0x9d85('0x26')]]={'$like':'%'+_0x6147ae[_0x9d85('0x2d')][_0x9d85('0x3a')]+'%'};return _0xecc607;}})});}_0x2126c9=_[_0x9d85('0x3b')]({},_0x2126c9,_0x6147ae[_0x9d85('0x3d')]);var _0x13702c={'where':_0x2126c9['where']};return db[_0x9d85('0x3e')][_0x9d85('0x1d')](_0x13702c)['then'](function(_0x1d6d70){_0x5874d2[_0x9d85('0x1d')]=_0x1d6d70;if(_0x6147ae[_0x9d85('0x2d')][_0x9d85('0x3f')]){_0x2126c9['include']=[{'all':!![]}];}return db[_0x9d85('0x3e')][_0x9d85('0x40')](_0x2126c9);})[_0x9d85('0x22')](function(_0x5bdd42){_0x5874d2['rows']=_0x5bdd42;return _0x5874d2;})[_0x9d85('0x22')](respondWithFilteredResult(_0x5ba87,_0x2126c9))['catch'](handleError(_0x5ba87,null));};exports[_0x9d85('0x41')]=function(_0x589793,_0x501c66){var _0x1bac37={'raw':![],'where':{'id':_0x589793[_0x9d85('0x42')]['id']}},_0x59042a={};_0x59042a[_0x9d85('0x32')]=_[_0x9d85('0x2e')](db[_0x9d85('0x3e')][_0x9d85('0x2a')]);_0x59042a[_0x9d85('0x2d')]=_[_0x9d85('0x2e')](_0x589793[_0x9d85('0x2d')]);_0x59042a[_0x9d85('0x2f')]=_[_0x9d85('0x30')](_0x59042a[_0x9d85('0x32')],_0x59042a[_0x9d85('0x2d')]);_0x1bac37[_0x9d85('0x31')]=_['intersection'](_0x59042a['model'],qs['fields'](_0x589793[_0x9d85('0x2d')][_0x9d85('0x33')]));_0x1bac37[_0x9d85('0x31')]=_0x1bac37[_0x9d85('0x31')][_0x9d85('0x34')]?_0x1bac37[_0x9d85('0x31')]:_0x59042a[_0x9d85('0x32')];if(_0x589793[_0x9d85('0x2d')]['includeAll']){_0x1bac37[_0x9d85('0x43')]=[{'all':!![]}];}_0x1bac37=_[_0x9d85('0x3b')]({},_0x1bac37,_0x589793[_0x9d85('0x3d')]);return db[_0x9d85('0x3e')][_0x9d85('0x44')](_0x1bac37)[_0x9d85('0x22')](handleEntityNotFound(_0x501c66,null))[_0x9d85('0x22')](respondWithResult(_0x501c66,null))[_0x9d85('0x45')](handleError(_0x501c66,null));};exports[_0x9d85('0x46')]=function(_0x881677,_0x886e70){return db[_0x9d85('0x3e')][_0x9d85('0x46')](_0x881677[_0x9d85('0x47')],{})[_0x9d85('0x22')](respondWithResult(_0x886e70,0xc9))['catch'](handleError(_0x886e70,null));};exports[_0x9d85('0x21')]=function(_0x52a358,_0x54ad50){if(_0x52a358[_0x9d85('0x47')]['id']){delete _0x52a358[_0x9d85('0x47')]['id'];}return db[_0x9d85('0x3e')][_0x9d85('0x44')]({'where':{'id':_0x52a358[_0x9d85('0x42')]['id']}})[_0x9d85('0x22')](handleEntityNotFound(_0x54ad50,null))[_0x9d85('0x22')](saveUpdates(_0x52a358[_0x9d85('0x47')],null))[_0x9d85('0x22')](respondWithResult(_0x54ad50,null))['catch'](handleError(_0x54ad50,null));};exports[_0x9d85('0x23')]=function(_0x51833e,_0x3b88ce){return db['UserProfileSection'][_0x9d85('0x44')]({'where':{'id':_0x51833e[_0x9d85('0x42')]['id']}})[_0x9d85('0x22')](handleEntityNotFound(_0x3b88ce,null))[_0x9d85('0x22')](removeEntity(_0x3b88ce,null))[_0x9d85('0x45')](handleError(_0x3b88ce,null));};exports[_0x9d85('0x48')]=function(_0x35f411,_0xc67ca0){return db[_0x9d85('0x3e')][_0x9d85('0x48')]()[_0x9d85('0x22')](respondWithResult(_0xc67ca0,null))['catch'](handleError(_0xc67ca0,null));};
\ No newline at end of file
index b123119..51f386f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x831a=['api','bluebird','request-promise','../../config/environment','exports','define','UserProfileSection','sectionId','userProfileId','lodash','../../config/logger'];(function(_0x579a4e,_0x3bdc26){var _0x530e9b=function(_0x232196){while(--_0x232196){_0x579a4e['push'](_0x579a4e['shift']());}};_0x530e9b(++_0x3bdc26);}(_0x831a,0x1ed));var _0xa831=function(_0x536967,_0x3d8a20){_0x536967=_0x536967-0x0;var _0xfb74c0=_0x831a[_0x536967];return _0xfb74c0;};'use strict';var _=require(_0xa831('0x0'));var util=require('util');var logger=require(_0xa831('0x1'))(_0xa831('0x2'));var moment=require('moment');var BPromise=require(_0xa831('0x3'));var rp=require(_0xa831('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa831('0x5'));var attributes=require('./userProfileSection.attributes');module[_0xa831('0x6')]=function(_0x598ccb,_0xc455e5){return _0x598ccb[_0xa831('0x7')](_0xa831('0x8'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xa831('0x9'),_0xa831('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf7bc=['request-promise','path','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','../../config/logger','moment','bluebird'];(function(_0x4446e5,_0x38d2be){var _0x21a16d=function(_0x586cd6){while(--_0x586cd6){_0x4446e5['push'](_0x4446e5['shift']());}};_0x21a16d(++_0x38d2be);}(_0xf7bc,0x1a0));var _0xcf7b=function(_0x88a09,_0xe9fba3){_0x88a09=_0x88a09-0x0;var _0x3ca68f=_0xf7bc[_0x88a09];return _0x3ca68f;};'use strict';var _=require(_0xcf7b('0x0'));var util=require('util');var logger=require(_0xcf7b('0x1'))('api');var moment=require(_0xcf7b('0x2'));var BPromise=require(_0xcf7b('0x3'));var rp=require(_0xcf7b('0x4'));var fs=require('fs');var path=require(_0xcf7b('0x5'));var rimraf=require('rimraf');var config=require(_0xcf7b('0x6'));var attributes=require(_0xcf7b('0x7'));module[_0xcf7b('0x8')]=function(_0x1c73cf,_0x4286a7){return _0x1c73cf[_0xcf7b('0x9')](_0xcf7b('0xa'),attributes,{'tableName':_0xcf7b('0xb'),'paranoid':![],'indexes':[{'name':_0xcf7b('0xc'),'fields':['sectionId',_0xcf7b('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 7e43ed7..ff05677 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1739=['code','UserProfileSection,\x20%s,\x20%s','message','error','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x21c69c,_0x1b7535){var _0x2acd03=function(_0x4c70f0){while(--_0x4c70f0){_0x21c69c['push'](_0x21c69c['shift']());}};_0x2acd03(++_0x1b7535);}(_0x1739,0x1a8));var _0x9173=function(_0x246eda,_0x4dbd5d){_0x246eda=_0x246eda-0x0;var _0x9cc39b=_0x1739[_0x246eda];return _0x9cc39b;};'use strict';var _=require('lodash');var util=require(_0x9173('0x0'));var moment=require(_0x9173('0x1'));var BPromise=require('bluebird');var rs=require(_0x9173('0x2'));var fs=require('fs');var Redis=require(_0x9173('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9173('0x4'));var logger=require(_0x9173('0x5'))(_0x9173('0x6'));var config=require('../../config/environment');var jayson=require(_0x9173('0x7'));var client=jayson[_0x9173('0x8')][_0x9173('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x43b061,_0x2aa45b,_0x1b2394){return new BPromise(function(_0x568dda,_0x246f4c){return client[_0x9173('0xa')](_0x43b061,_0x1b2394)[_0x9173('0xb')](function(_0x2fb88b){logger[_0x9173('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x2aa45b,_0x9173('0xd'));logger['debug'](_0x9173('0xe'),_0x2aa45b,_0x9173('0xd'),JSON[_0x9173('0xf')](_0x2fb88b));if(_0x2fb88b['error']){if(_0x2fb88b['error'][_0x9173('0x10')]===0x1f4){logger['error'](_0x9173('0x11'),_0x2aa45b,_0x2fb88b['error'][_0x9173('0x12')]);return _0x246f4c(_0x2fb88b[_0x9173('0x13')][_0x9173('0x12')]);}logger[_0x9173('0x13')](_0x9173('0x11'),_0x2aa45b,_0x2fb88b[_0x9173('0x13')][_0x9173('0x12')]);return _0x568dda(_0x2fb88b[_0x9173('0x13')]['message']);}else{logger[_0x9173('0xc')]('UserProfileSection,\x20%s,\x20%s',_0x2aa45b,_0x9173('0xd'));_0x568dda(_0x2fb88b['result']['message']);}})['catch'](function(_0x1ad9e3){logger[_0x9173('0x13')]('UserProfileSection,\x20%s,\x20%s',_0x2aa45b,_0x1ad9e3);_0x246f4c(_0x1ad9e3);});});}
\ No newline at end of file
+var _0xccc2=['info','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','UserProfileSection,\x20%s,\x20%s','message'];(function(_0x20ec50,_0x309b2b){var _0x2f90af=function(_0x36a3b8){while(--_0x36a3b8){_0x20ec50['push'](_0x20ec50['shift']());}};_0x2f90af(++_0x309b2b);}(_0xccc2,0xa2));var _0x2ccc=function(_0x403414,_0x17a7b7){_0x403414=_0x403414-0x0;var _0x4956a0=_0xccc2[_0x403414];return _0x4956a0;};'use strict';var _=require(_0x2ccc('0x0'));var util=require(_0x2ccc('0x1'));var moment=require('moment');var BPromise=require(_0x2ccc('0x2'));var rs=require(_0x2ccc('0x3'));var fs=require('fs');var Redis=require(_0x2ccc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2ccc('0x5'));var logger=require(_0x2ccc('0x6'))('rpc');var config=require(_0x2ccc('0x7'));var jayson=require(_0x2ccc('0x8'));var client=jayson[_0x2ccc('0x9')][_0x2ccc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5834b3,_0x228391,_0x3fb6b2){return new BPromise(function(_0x418d27,_0x3f0826){return client[_0x2ccc('0xb')](_0x5834b3,_0x3fb6b2)['then'](function(_0x4764b6){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x228391,_0x2ccc('0xc'));logger['debug'](_0x2ccc('0xd'),_0x228391,_0x2ccc('0xc'),JSON[_0x2ccc('0xe')](_0x4764b6));if(_0x4764b6['error']){if(_0x4764b6[_0x2ccc('0xf')]['code']===0x1f4){logger[_0x2ccc('0xf')](_0x2ccc('0x10'),_0x228391,_0x4764b6[_0x2ccc('0xf')]['message']);return _0x3f0826(_0x4764b6['error'][_0x2ccc('0x11')]);}logger[_0x2ccc('0xf')](_0x2ccc('0x10'),_0x228391,_0x4764b6[_0x2ccc('0xf')][_0x2ccc('0x11')]);return _0x418d27(_0x4764b6['error'][_0x2ccc('0x11')]);}else{logger[_0x2ccc('0x12')](_0x2ccc('0x10'),_0x228391,_0x2ccc('0xc'));_0x418d27(_0x4764b6[_0x2ccc('0x13')][_0x2ccc('0x11')]);}})['catch'](function(_0x2a477e){logger[_0x2ccc('0xf')](_0x2ccc('0x10'),_0x228391,_0x2a477e);_0x3f0826(_0x2a477e);});});}
\ No newline at end of file
index 9689f8d..284a369 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2ad39a,_0x3460c1){var _0xdd74fa=function(_0x30968a){while(--_0x30968a){_0x2ad39a['push'](_0x2ad39a['shift']());}};_0xdd74fa(++_0x3460c1);}(_0xe706,0xa3));var _0x6e70=function(_0x309e57,_0xe1c277){_0x309e57=_0x309e57-0x0;var _0x313c98=_0xe706[_0x309e57];return _0x313c98;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x6a967b,_0x278067){var _0x1cb08f=function(_0x296ea9){while(--_0x296ea9){_0x6a967b['push'](_0x6a967b['shift']());}};_0x1cb08f(++_0x278067);}(_0x70e0,0x17b));var _0x070e=function(_0x4a2dab,_0x12845b){_0x4a2dab=_0x4a2dab-0x0;var _0x3502b7=_0x70e0[_0x4a2dab];return _0x3502b7;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
index f42524b..0fe7cd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44c5=['INTEGER','sequelize','exports'];(function(_0x40a26,_0x1be746){var _0x46189d=function(_0x3a4d52){while(--_0x3a4d52){_0x40a26['push'](_0x40a26['shift']());}};_0x46189d(++_0x1be746);}(_0x44c5,0x76));var _0x544c=function(_0x179b53,_0x31f6fe){_0x179b53=_0x179b53-0x0;var _0x38a146=_0x44c5[_0x179b53];return _0x38a146;};'use strict';var Sequelize=require(_0x544c('0x0'));module[_0x544c('0x1')]={'penalty':{'type':Sequelize[_0x544c('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x2cd0=['sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2cd0,0x8a));var _0x02cd=function(_0x566687,_0x507933){_0x566687=_0x566687-0x0;var _0x2126b1=_0x2cd0[_0x566687];return _0x2126b1;};'use strict';var Sequelize=require(_0x02cd('0x0'));module[_0x02cd('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 58252a1..c41578d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x958a=['bluebird','request-promise','path','../../config/environment','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','api','moment'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x958a,0x128));var _0xa958=function(_0x39536b,_0x5b4d1e){_0x39536b=_0x39536b-0x0;var _0x5b5545=_0x958a[_0x39536b];return _0x5b5545;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var logger=require('../../config/logger')(_0xa958('0x2'));var moment=require(_0xa958('0x3'));var BPromise=require(_0xa958('0x4'));var rp=require(_0xa958('0x5'));var fs=require('fs');var path=require(_0xa958('0x6'));var rimraf=require('rimraf');var config=require(_0xa958('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0xa958('0x8')]=function(_0x9b7d9e,_0x2692d6){return _0x9b7d9e[_0xa958('0x9')](_0xa958('0xa'),attributes,{'tableName':_0xa958('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8f9d=['define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes'];(function(_0x3bf3e8,_0x261d81){var _0x45419c=function(_0x2215aa){while(--_0x2215aa){_0x3bf3e8['push'](_0x3bf3e8['shift']());}};_0x45419c(++_0x261d81);}(_0x8f9d,0x93));var _0xd8f9=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8f9d[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xd8f9('0x0'));var util=require('util');var logger=require(_0xd8f9('0x1'))('api');var moment=require(_0xd8f9('0x2'));var BPromise=require(_0xd8f9('0x3'));var rp=require(_0xd8f9('0x4'));var fs=require('fs');var path=require(_0xd8f9('0x5'));var rimraf=require(_0xd8f9('0x6'));var config=require(_0xd8f9('0x7'));var attributes=require(_0xd8f9('0x8'));module['exports']=function(_0x1c37be,_0x24dd1e){return _0x1c37be[_0xd8f9('0x9')](_0xd8f9('0xa'),attributes,{'tableName':_0xd8f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 93edd79..0b64743 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xceba=['stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x386eda,_0x157d90){var _0x13caab=function(_0x4a02c2){while(--_0x4a02c2){_0x386eda['push'](_0x386eda['shift']());}};_0x13caab(++_0x157d90);}(_0xceba,0x1a8));var _0xaceb=function(_0x24dc27,_0x426ffc){_0x24dc27=_0x24dc27-0x0;var _0x57a07d=_0xceba[_0x24dc27];return _0x57a07d;};'use strict';var _=require(_0xaceb('0x0'));var util=require(_0xaceb('0x1'));var moment=require(_0xaceb('0x2'));var BPromise=require(_0xaceb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaceb('0x4'));var db=require(_0xaceb('0x5'))['db'];var utils=require(_0xaceb('0x6'));var logger=require(_0xaceb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xaceb('0x8'));var client=jayson[_0xaceb('0x9')][_0xaceb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x65a5e0,_0xe61d9f,_0x57676e){return new BPromise(function(_0x2ff560,_0x278f97){return client[_0xaceb('0xb')](_0x65a5e0,_0x57676e)[_0xaceb('0xc')](function(_0x4991e4){logger['info'](_0xaceb('0xd'),_0xe61d9f,_0xaceb('0xe'));logger[_0xaceb('0xf')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0xe61d9f,'request\x20sent',JSON[_0xaceb('0x10')](_0x4991e4));if(_0x4991e4[_0xaceb('0x11')]){if(_0x4991e4[_0xaceb('0x11')][_0xaceb('0x12')]===0x1f4){logger['error'](_0xaceb('0xd'),_0xe61d9f,_0x4991e4['error'][_0xaceb('0x13')]);return _0x278f97(_0x4991e4['error'][_0xaceb('0x13')]);}logger[_0xaceb('0x11')](_0xaceb('0xd'),_0xe61d9f,_0x4991e4['error'][_0xaceb('0x13')]);return _0x2ff560(_0x4991e4[_0xaceb('0x11')][_0xaceb('0x13')]);}else{logger[_0xaceb('0x14')](_0xaceb('0xd'),_0xe61d9f,_0xaceb('0xe'));_0x2ff560(_0x4991e4['result'][_0xaceb('0x13')]);}})[_0xaceb('0x15')](function(_0xdebfb1){logger['error'](_0xaceb('0xd'),_0xe61d9f,_0xdebfb1);_0x278f97(_0xdebfb1);});});}
\ No newline at end of file
+var _0x8483=['code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error'];(function(_0x2d5f2b,_0x5e57fe){var _0x1c0b71=function(_0x5d8deb){while(--_0x5d8deb){_0x2d5f2b['push'](_0x2d5f2b['shift']());}};_0x1c0b71(++_0x5e57fe);}(_0x8483,0xdc));var _0x3848=function(_0x28da9f,_0x80b006){_0x28da9f=_0x28da9f-0x0;var _0x16b4a2=_0x8483[_0x28da9f];return _0x16b4a2;};'use strict';var _=require('lodash');var util=require(_0x3848('0x0'));var moment=require(_0x3848('0x1'));var BPromise=require('bluebird');var rs=require(_0x3848('0x2'));var fs=require('fs');var Redis=require(_0x3848('0x3'));var db=require(_0x3848('0x4'))['db'];var utils=require(_0x3848('0x5'));var logger=require(_0x3848('0x6'))(_0x3848('0x7'));var config=require(_0x3848('0x8'));var jayson=require(_0x3848('0x9'));var client=jayson[_0x3848('0xa')][_0x3848('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e763a,_0x27cd66,_0x41c7af){return new BPromise(function(_0x320a74,_0x290eba){return client[_0x3848('0xc')](_0x1e763a,_0x41c7af)[_0x3848('0xd')](function(_0x22328b){logger[_0x3848('0xe')](_0x3848('0xf'),_0x27cd66,_0x3848('0x10'));logger[_0x3848('0x11')](_0x3848('0x12'),_0x27cd66,_0x3848('0x10'),JSON['stringify'](_0x22328b));if(_0x22328b[_0x3848('0x13')]){if(_0x22328b['error'][_0x3848('0x14')]===0x1f4){logger['error'](_0x3848('0xf'),_0x27cd66,_0x22328b[_0x3848('0x13')][_0x3848('0x15')]);return _0x290eba(_0x22328b[_0x3848('0x13')][_0x3848('0x15')]);}logger[_0x3848('0x13')](_0x3848('0xf'),_0x27cd66,_0x22328b['error'][_0x3848('0x15')]);return _0x320a74(_0x22328b['error']['message']);}else{logger[_0x3848('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x27cd66,_0x3848('0x10'));_0x320a74(_0x22328b[_0x3848('0x16')][_0x3848('0x15')]);}})[_0x3848('0x17')](function(_0x5027de){logger[_0x3848('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x27cd66,_0x5027de);_0x290eba(_0x5027de);});});}
\ No newline at end of file
index 5f37de3..2bab897 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06c1=['exports','INTEGER'];(function(_0x47b15f,_0x103e93){var _0x55bf25=function(_0x51fe7f){while(--_0x51fe7f){_0x47b15f['push'](_0x47b15f['shift']());}};_0x55bf25(++_0x103e93);}(_0x06c1,0x1da));var _0x106c=function(_0x883d7,_0x28edb8){_0x883d7=_0x883d7-0x0;var _0x1559d6=_0x06c1[_0x883d7];return _0x1559d6;};'use strict';var Sequelize=require('sequelize');module[_0x106c('0x0')]={'UserId':{'type':Sequelize[_0x106c('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x106c('0x1')]}};
\ No newline at end of file
+var _0x2be9=['exports','INTEGER','sequelize'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x2be9,0xb9));var _0x92be=function(_0x17017e,_0x509679){_0x17017e=_0x17017e-0x0;var _0xbc7086=_0x2be9[_0x17017e];return _0xbc7086;};'use strict';var Sequelize=require(_0x92be('0x0'));module[_0x92be('0x1')]={'UserId':{'type':Sequelize[_0x92be('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x92be('0x2')]}};
\ No newline at end of file
index d438f4a..90ff9e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3fae1f,_0xff3f74){var _0x57180c=function(_0x381b64){while(--_0x381b64){_0x3fae1f['push'](_0x3fae1f['shift']());}};_0x57180c(++_0xff3f74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1cde7e,_0xdeeea6){var _0x560fbd=function(_0x4392c2){while(--_0x4392c2){_0x1cde7e['push'](_0x1cde7e['shift']());}};_0x560fbd(++_0xdeeea6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xa9e0[_0x2576d7];return _0x16a08c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 069e6d5..b72b0b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x10cac9,_0x5a16fe){var _0x422a09=function(_0x569364){while(--_0x569364){_0x10cac9['push'](_0x10cac9['shift']());}};_0x422a09(++_0x5a16fe);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x366ce0,_0x4c3fad){var _0x5ae1c0=function(_0x6a4ad6){while(--_0x6a4ad6){_0x366ce0['push'](_0x366ce0['shift']());}};_0x5ae1c0(++_0x4c3fad);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
index 1eb52b4..a746f4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x977d=['exports','sequelize'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0x977d,0xc7));var _0xd977=function(_0x23d701,_0x941bce){_0x23d701=_0x23d701-0x0;var _0x5f3562=_0x977d[_0x23d701];return _0x5f3562;};'use strict';var Sequelize=require(_0xd977('0x0'));module[_0xd977('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf65f=['exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf65f,0xe0));var _0xff65=function(_0x51b648,_0x3af80d){_0x51b648=_0x51b648-0x0;var _0x58a6e5=_0xf65f[_0x51b648];return _0x58a6e5;};'use strict';var Sequelize=require('sequelize');module[_0xff65('0x0')]={'penalty':{'type':Sequelize[_0xff65('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index a5c528c..933ab2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a01=['./userVoiceQueue.attributes','exports','define','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x2c602e,_0x1d26f5){var _0x1a2650=function(_0x2370d1){while(--_0x2370d1){_0x2c602e['push'](_0x2c602e['shift']());}};_0x1a2650(++_0x1d26f5);}(_0x0a01,0x156));var _0x10a0=function(_0x343d53,_0x494df3){_0x343d53=_0x343d53-0x0;var _0x879ce3=_0x0a01[_0x343d53];return _0x879ce3;};'use strict';var _=require(_0x10a0('0x0'));var util=require(_0x10a0('0x1'));var logger=require(_0x10a0('0x2'))(_0x10a0('0x3'));var moment=require(_0x10a0('0x4'));var BPromise=require(_0x10a0('0x5'));var rp=require(_0x10a0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x10a0('0x7'));var config=require(_0x10a0('0x8'));var attributes=require(_0x10a0('0x9'));module[_0x10a0('0xa')]=function(_0x3eaecf,_0x154139){return _0x3eaecf[_0x10a0('0xb')]('UserVoiceQueue',attributes,{'tableName':_0x10a0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x48f1=['request-promise','rimraf','../../config/environment','define','lodash','util','../../config/logger','moment','bluebird'];(function(_0x53dda4,_0x41bafd){var _0x316336=function(_0x539b98){while(--_0x539b98){_0x53dda4['push'](_0x53dda4['shift']());}};_0x316336(++_0x41bafd);}(_0x48f1,0x1a2));var _0x148f=function(_0x3b4482,_0x5016dd){_0x3b4482=_0x3b4482-0x0;var _0x5481ac=_0x48f1[_0x3b4482];return _0x5481ac;};'use strict';var _=require(_0x148f('0x0'));var util=require(_0x148f('0x1'));var logger=require(_0x148f('0x2'))('api');var moment=require(_0x148f('0x3'));var BPromise=require(_0x148f('0x4'));var rp=require(_0x148f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x148f('0x6'));var config=require(_0x148f('0x7'));var attributes=require('./userVoiceQueue.attributes');module['exports']=function(_0x370728,_0x3ad5b0){return _0x370728[_0x148f('0x8')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 340ccc1..9f2d173 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb7a=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UserVoiceQueue,\x20%s,\x20%s','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x578057,_0x119d0a){var _0x18aeb=function(_0x56d75c){while(--_0x56d75c){_0x578057['push'](_0x578057['shift']());}};_0x18aeb(++_0x119d0a);}(_0xeb7a,0x1c8));var _0xaeb7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeb7a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaeb7('0x0'));var BPromise=require(_0xaeb7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaeb7('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xaeb7('0x3'));var logger=require(_0xaeb7('0x4'))(_0xaeb7('0x5'));var config=require(_0xaeb7('0x6'));var jayson=require(_0xaeb7('0x7'));var client=jayson[_0xaeb7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41b5ca,_0xb9ccd2,_0x48c582){return new BPromise(function(_0xd05486,_0x1590e4){return client[_0xaeb7('0x9')](_0x41b5ca,_0x48c582)[_0xaeb7('0xa')](function(_0x3f16eb){logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0xb9ccd2,_0xaeb7('0xb'));logger[_0xaeb7('0xc')](_0xaeb7('0xd'),_0xb9ccd2,'request\x20sent',JSON[_0xaeb7('0xe')](_0x3f16eb));if(_0x3f16eb[_0xaeb7('0xf')]){if(_0x3f16eb['error'][_0xaeb7('0x10')]===0x1f4){logger[_0xaeb7('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0xb9ccd2,_0x3f16eb[_0xaeb7('0xf')][_0xaeb7('0x11')]);return _0x1590e4(_0x3f16eb['error'][_0xaeb7('0x11')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0xb9ccd2,_0x3f16eb[_0xaeb7('0xf')][_0xaeb7('0x11')]);return _0xd05486(_0x3f16eb[_0xaeb7('0xf')]['message']);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0xb9ccd2,_0xaeb7('0xb'));_0xd05486(_0x3f16eb[_0xaeb7('0x12')]['message']);}})[_0xaeb7('0x13')](function(_0x57633a){logger[_0xaeb7('0xf')](_0xaeb7('0x14'),_0xb9ccd2,_0x57633a);_0x1590e4(_0x57633a);});});}
\ No newline at end of file
+var _0x4367=['http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client'];(function(_0x59a68e,_0x3a6c39){var _0x389ae8=function(_0x21c1bc){while(--_0x21c1bc){_0x59a68e['push'](_0x59a68e['shift']());}};_0x389ae8(++_0x3a6c39);}(_0x4367,0xe9));var _0x7436=function(_0x542219,_0x89d392){_0x542219=_0x542219-0x0;var _0x55ca42=_0x4367[_0x542219];return _0x55ca42;};'use strict';var _=require(_0x7436('0x0'));var util=require(_0x7436('0x1'));var moment=require('moment');var BPromise=require(_0x7436('0x2'));var rs=require(_0x7436('0x3'));var fs=require('fs');var Redis=require(_0x7436('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7436('0x5'));var logger=require('../../config/logger')(_0x7436('0x6'));var config=require('../../config/environment');var jayson=require(_0x7436('0x7'));var client=jayson[_0x7436('0x8')][_0x7436('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x451b78,_0x2b9341,_0x429dfa){return new BPromise(function(_0x634b,_0x408065){return client[_0x7436('0xa')](_0x451b78,_0x429dfa)[_0x7436('0xb')](function(_0x5f37ff){logger[_0x7436('0xc')](_0x7436('0xd'),_0x2b9341,'request\x20sent');logger[_0x7436('0xe')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x2b9341,_0x7436('0xf'),JSON[_0x7436('0x10')](_0x5f37ff));if(_0x5f37ff[_0x7436('0x11')]){if(_0x5f37ff['error'][_0x7436('0x12')]===0x1f4){logger[_0x7436('0x11')](_0x7436('0xd'),_0x2b9341,_0x5f37ff[_0x7436('0x11')][_0x7436('0x13')]);return _0x408065(_0x5f37ff[_0x7436('0x11')][_0x7436('0x13')]);}logger[_0x7436('0x11')](_0x7436('0xd'),_0x2b9341,_0x5f37ff[_0x7436('0x11')][_0x7436('0x13')]);return _0x634b(_0x5f37ff[_0x7436('0x11')]['message']);}else{logger[_0x7436('0xc')](_0x7436('0xd'),_0x2b9341,_0x7436('0xf'));_0x634b(_0x5f37ff[_0x7436('0x14')][_0x7436('0x13')]);}})[_0x7436('0x15')](function(_0x59afad){logger[_0x7436('0x11')](_0x7436('0xd'),_0x2b9341,_0x59afad);_0x408065(_0x59afad);});});}
\ No newline at end of file
index 832cef4..42312e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1ca3b2,_0x1c9614){var _0x573545=function(_0x4024f4){while(--_0x4024f4){_0x1ca3b2['push'](_0x1ca3b2['shift']());}};_0x573545(++_0x1c9614);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xcb91[_0x313c96];return _0x522f53;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1b1380,_0x359ae0){var _0x384e40=function(_0x537ee2){while(--_0x537ee2){_0x1b1380['push'](_0x1b1380['shift']());}};_0x384e40(++_0x359ae0);}(_0x70e0,0x17b));var _0x070e=function(_0x2e4211,_0x536d67){_0x2e4211=_0x2e4211-0x0;var _0x9f0bbe=_0x70e0[_0x2e4211];return _0x9f0bbe;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
index 8e28e3c..dceeb92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f9d=['STRING','queue_interface','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x3f9d,0x179));var _0xd3f9=function(_0x1fc27e,_0x52402c){_0x1fc27e=_0x1fc27e-0x0;var _0x252a06=_0x3f9d[_0x1fc27e];return _0x252a06;};'use strict';var Sequelize=require('sequelize');module[_0xd3f9('0x0')]={'uniqueid':{'type':Sequelize[_0xd3f9('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xd3f9('0x2')},'membername':{'type':Sequelize[_0xd3f9('0x3')],'allowNull':![],'comment':_0xd3f9('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xd3f9('0x3')],'allowNull':![],'unique':_0xd3f9('0x4'),'comment':_0xd3f9('0x2')},'VoiceQueueId':{'type':Sequelize[_0xd3f9('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xd3f9('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0xd3f9('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xd3f9('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}};
\ No newline at end of file
+var _0x99e0=['INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x99e0,0xd0));var _0x099e=function(_0x19595a,_0x4767ee){_0x19595a=_0x19595a-0x0;var _0x4713c5=_0x99e0[_0x19595a];return _0x4713c5;};'use strict';var Sequelize=require(_0x099e('0x0'));module[_0x099e('0x1')]={'uniqueid':{'type':Sequelize[_0x099e('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x099e('0x3')},'membername':{'type':Sequelize[_0x099e('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x099e('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x099e('0x4')],'allowNull':![],'unique':_0x099e('0x5'),'comment':_0x099e('0x3')},'VoiceQueueId':{'type':Sequelize[_0x099e('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x099e('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x099e('0x3')},'penalty':{'type':Sequelize[_0x099e('0x2')](0xb),'defaultValue':0x0,'comment':_0x099e('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x099e('0x3')}};
\ No newline at end of file
index daa2663..8204a7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc7d=['UserVoiceQueueRt','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x590f69,_0x28c33e){var _0x58bba9=function(_0x371533){while(--_0x371533){_0x590f69['push'](_0x590f69['shift']());}};_0x58bba9(++_0x28c33e);}(_0xbc7d,0xc6));var _0xdbc7=function(_0x15af0f,_0x5454ce){_0x15af0f=_0x15af0f-0x0;var _0x2bd1cb=_0xbc7d[_0x15af0f];return _0x2bd1cb;};'use strict';var EventEmitter=require(_0xdbc7('0x0'));var UserVoiceQueueRt=require(_0xdbc7('0x1'))['db'][_0xdbc7('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xdbc7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdbc7('0x4'),'afterDestroy':_0xdbc7('0x5')};function emitEvent(_0x3210ca){return function(_0x6faeaa,_0x70b82,_0x244984){UserVoiceQueueRtEvents[_0xdbc7('0x6')](_0x3210ca+':'+_0x6faeaa['id'],_0x6faeaa);UserVoiceQueueRtEvents[_0xdbc7('0x6')](_0x3210ca,_0x6faeaa);_0x244984(null);};}for(var e in events){if(events[_0xdbc7('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xdbc7('0x8')](e,emitEvent(event));}}module[_0xdbc7('0x9')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0x98b8=['setMaxListeners','save','update','remove','exports','events','../../mysqldb','UserVoiceQueueRt'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x98b8,0x185));var _0x898b=function(_0x1e6e39,_0x3c98ed){_0x1e6e39=_0x1e6e39-0x0;var _0x2d9029=_0x98b8[_0x1e6e39];return _0x2d9029;};'use strict';var EventEmitter=require(_0x898b('0x0'));var UserVoiceQueueRt=require(_0x898b('0x1'))['db'][_0x898b('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x898b('0x3')](0x0);var events={'afterCreate':_0x898b('0x4'),'afterUpdate':_0x898b('0x5'),'afterDestroy':_0x898b('0x6')};function emitEvent(_0x38787c){return function(_0x18a910,_0x5abafc,_0x399e7f){UserVoiceQueueRtEvents['emit'](_0x38787c+':'+_0x18a910['id'],_0x18a910);UserVoiceQueueRtEvents['emit'](_0x38787c,_0x18a910);_0x399e7f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x898b('0x7')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index c6c396f..3f951ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b5b=['./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x58ecb4,_0x2c03c4){var _0x4b2adc=function(_0x1f4ac0){while(--_0x1f4ac0){_0x58ecb4['push'](_0x58ecb4['shift']());}};_0x4b2adc(++_0x2c03c4);}(_0x7b5b,0x100));var _0xb7b5=function(_0x26d5f1,_0x14ea93){_0x26d5f1=_0x26d5f1-0x0;var _0x5966d2=_0x7b5b[_0x26d5f1];return _0x5966d2;};'use strict';var _=require(_0xb7b5('0x0'));var util=require(_0xb7b5('0x1'));var logger=require(_0xb7b5('0x2'))(_0xb7b5('0x3'));var moment=require(_0xb7b5('0x4'));var BPromise=require(_0xb7b5('0x5'));var rp=require(_0xb7b5('0x6'));var fs=require('fs');var path=require(_0xb7b5('0x7'));var rimraf=require(_0xb7b5('0x8'));var config=require(_0xb7b5('0x9'));var attributes=require(_0xb7b5('0xa'));module['exports']=function(_0x17acc8,_0x3f9293){return _0x17acc8[_0xb7b5('0xb')](_0xb7b5('0xc'),attributes,{'tableName':_0xb7b5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb555=['../../config/logger','api','moment','bluebird','path','rimraf','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','util'];(function(_0x2e58c7,_0x23d092){var _0x26eb00=function(_0x343124){while(--_0x343124){_0x2e58c7['push'](_0x2e58c7['shift']());}};_0x26eb00(++_0x23d092);}(_0xb555,0x11f));var _0x5b55=function(_0x2338e8,_0x4deb56){_0x2338e8=_0x2338e8-0x0;var _0x10a66f=_0xb555[_0x2338e8];return _0x10a66f;};'use strict';var _=require('lodash');var util=require(_0x5b55('0x0'));var logger=require(_0x5b55('0x1'))(_0x5b55('0x2'));var moment=require(_0x5b55('0x3'));var BPromise=require(_0x5b55('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b55('0x5'));var rimraf=require(_0x5b55('0x6'));var config=require('../../config/environment');var attributes=require(_0x5b55('0x7'));module[_0x5b55('0x8')]=function(_0x301f35,_0x3659ed){return _0x301f35[_0x5b55('0x9')](_0x5b55('0xa'),attributes,{'tableName':_0x5b55('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 664b65f..c4ce14b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2a9=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','lodash','util','moment','bluebird'];(function(_0x483b35,_0x18400d){var _0x2636db=function(_0x21c35b){while(--_0x21c35b){_0x483b35['push'](_0x483b35['shift']());}};_0x2636db(++_0x18400d);}(_0xd2a9,0xab));var _0x9d2a=function(_0x3092de,_0x1973e0){_0x3092de=_0x3092de-0x0;var _0x1e0cf5=_0xd2a9[_0x3092de];return _0x1e0cf5;};'use strict';var _=require(_0x9d2a('0x0'));var util=require(_0x9d2a('0x1'));var moment=require(_0x9d2a('0x2'));var BPromise=require(_0x9d2a('0x3'));var rs=require(_0x9d2a('0x4'));var fs=require('fs');var Redis=require(_0x9d2a('0x5'));var db=require(_0x9d2a('0x6'))['db'];var utils=require(_0x9d2a('0x7'));var logger=require(_0x9d2a('0x8'))(_0x9d2a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9d2a('0xa')]({'port':0x232a});config[_0x9d2a('0xb')]=_['defaults'](config['redis'],{'host':_0x9d2a('0xc'),'port':0x18eb});var socket=require(_0x9d2a('0xd'))(new Redis(config[_0x9d2a('0xb')]));require(_0x9d2a('0xe'))[_0x9d2a('0xf')](socket);function respondWithRpcPromise(_0x193cb1,_0x182b67,_0x2be65d){return new BPromise(function(_0x46e22f,_0x4a321a){return client[_0x9d2a('0x10')](_0x193cb1,_0x2be65d)[_0x9d2a('0x11')](function(_0x3ef21b){logger['info'](_0x9d2a('0x12'),_0x182b67,_0x9d2a('0x13'));logger[_0x9d2a('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x182b67,'request\x20sent',JSON[_0x9d2a('0x15')](_0x3ef21b));if(_0x3ef21b['error']){if(_0x3ef21b['error'][_0x9d2a('0x16')]===0x1f4){logger[_0x9d2a('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x182b67,_0x3ef21b[_0x9d2a('0x17')][_0x9d2a('0x18')]);return _0x4a321a(_0x3ef21b[_0x9d2a('0x17')][_0x9d2a('0x18')]);}logger[_0x9d2a('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x182b67,_0x3ef21b[_0x9d2a('0x17')]['message']);return _0x46e22f(_0x3ef21b['error'][_0x9d2a('0x18')]);}else{logger[_0x9d2a('0x19')](_0x9d2a('0x12'),_0x182b67,_0x9d2a('0x13'));_0x46e22f(_0x3ef21b['result']['message']);}})['catch'](function(_0x29b5f2){logger[_0x9d2a('0x17')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x182b67,_0x29b5f2);_0x4a321a(_0x29b5f2);});});}exports[_0x9d2a('0x1a')]=function(_0x1e65fc){var _0x47079f=this;return new Promise(function(_0xaa00b6,_0x442730){return db[_0x9d2a('0x1b')][_0x9d2a('0x1c')]({'raw':_0x1e65fc[_0x9d2a('0x1d')]?_0x1e65fc['options']['raw']===undefined?!![]:![]:!![],'where':_0x1e65fc[_0x9d2a('0x1d')]?_0x1e65fc[_0x9d2a('0x1d')][_0x9d2a('0x1e')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x9d2a('0x1f')]['fn']('IF',db[_0x9d2a('0x1f')]['literal'](_0x9d2a('0x20')))),_0x9d2a('0x21')]]})['then'](function(_0x4dd92f){logger['info'](_0x9d2a('0x1a'),_0x1e65fc);logger['debug'](_0x9d2a('0x1a'),_0x1e65fc,JSON[_0x9d2a('0x15')](_0x4dd92f));_0xaa00b6(_0x4dd92f);})[_0x9d2a('0x22')](function(_0x44ce3d){logger[_0x9d2a('0x17')]('GetVoiceQueueRtPauses',_0x44ce3d[_0x9d2a('0x18')],_0x1e65fc);_0x442730(_0x47079f[_0x9d2a('0x17')](0x1f4,_0x44ce3d[_0x9d2a('0x18')]));});});};
\ No newline at end of file
+var _0x3cd3=['http','defaults','redis','socket.io-emitter','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x29592b,_0x12378c){var _0x596d76=function(_0x588d80){while(--_0x588d80){_0x29592b['push'](_0x29592b['shift']());}};_0x596d76(++_0x12378c);}(_0x3cd3,0x1a6));var _0x33cd=function(_0x77fddd,_0x3b0250){_0x77fddd=_0x77fddd-0x0;var _0xeaf7d7=_0x3cd3[_0x77fddd];return _0xeaf7d7;};'use strict';var _=require(_0x33cd('0x0'));var util=require(_0x33cd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x33cd('0x2'));var fs=require('fs');var Redis=require(_0x33cd('0x3'));var db=require(_0x33cd('0x4'))['db'];var utils=require(_0x33cd('0x5'));var logger=require(_0x33cd('0x6'))('rpc');var config=require(_0x33cd('0x7'));var jayson=require(_0x33cd('0x8'));var client=jayson[_0x33cd('0x9')][_0x33cd('0xa')]({'port':0x232a});config['redis']=_[_0x33cd('0xb')](config[_0x33cd('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x33cd('0xd'))(new Redis(config[_0x33cd('0xc')]));require('./userVoiceQueueRt.socket')[_0x33cd('0xe')](socket);function respondWithRpcPromise(_0x14f105,_0x21f486,_0x2ba1d3){return new BPromise(function(_0x30f8b3,_0x3a689a){return client['request'](_0x14f105,_0x2ba1d3)[_0x33cd('0xf')](function(_0x791977){logger[_0x33cd('0x10')](_0x33cd('0x11'),_0x21f486,_0x33cd('0x12'));logger[_0x33cd('0x13')](_0x33cd('0x14'),_0x21f486,_0x33cd('0x12'),JSON['stringify'](_0x791977));if(_0x791977[_0x33cd('0x15')]){if(_0x791977[_0x33cd('0x15')][_0x33cd('0x16')]===0x1f4){logger['error'](_0x33cd('0x11'),_0x21f486,_0x791977[_0x33cd('0x15')][_0x33cd('0x17')]);return _0x3a689a(_0x791977[_0x33cd('0x15')][_0x33cd('0x17')]);}logger[_0x33cd('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x21f486,_0x791977['error']['message']);return _0x30f8b3(_0x791977[_0x33cd('0x15')][_0x33cd('0x17')]);}else{logger[_0x33cd('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x21f486,_0x33cd('0x12'));_0x30f8b3(_0x791977['result'][_0x33cd('0x17')]);}})[_0x33cd('0x18')](function(_0x567185){logger['error'](_0x33cd('0x11'),_0x21f486,_0x567185);_0x3a689a(_0x567185);});});}exports[_0x33cd('0x19')]=function(_0x588342){var _0x17e509=this;return new Promise(function(_0x3e88cb,_0x2b2b52){return db[_0x33cd('0x1a')][_0x33cd('0x1b')]({'raw':_0x588342[_0x33cd('0x1c')]?_0x588342[_0x33cd('0x1c')][_0x33cd('0x1d')]===undefined?!![]:![]:!![],'where':_0x588342[_0x33cd('0x1c')]?_0x588342[_0x33cd('0x1c')][_0x33cd('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0x33cd('0x1f'),db[_0x33cd('0x20')]['fn']('IF',db['sequelize'][_0x33cd('0x21')](_0x33cd('0x22')))),'outboundQueuePauses']]})[_0x33cd('0xf')](function(_0x4fece2){logger['info'](_0x33cd('0x19'),_0x588342);logger[_0x33cd('0x13')](_0x33cd('0x19'),_0x588342,JSON[_0x33cd('0x23')](_0x4fece2));_0x3e88cb(_0x4fece2);})[_0x33cd('0x18')](function(_0x1e98b3){logger['error'](_0x33cd('0x19'),_0x1e98b3[_0x33cd('0x17')],_0x588342);_0x2b2b52(_0x17e509[_0x33cd('0x15')](0x1f4,_0x1e98b3[_0x33cd('0x17')]));});});};
\ No newline at end of file
index 024b5db..5c88935 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x644f=['emit','removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x517fa8,_0x3adce0){var _0x5409f4=function(_0x501e80){while(--_0x501e80){_0x517fa8['push'](_0x517fa8['shift']());}};_0x5409f4(++_0x3adce0);}(_0x644f,0xc2));var _0xf644=function(_0x3b2244,_0x54873f){_0x3b2244=_0x3b2244-0x0;var _0x2dcc14=_0x644f[_0x3b2244];return _0x2dcc14;};'use strict';var UserVoiceQueueRtEvents=require(_0xf644('0x0'));var events=[_0xf644('0x1'),'remove','update'];function createListener(_0x19242f,_0xc5044c){return function(_0x240500){_0xc5044c[_0xf644('0x2')](_0x19242f,_0x240500);};}function removeListener(_0x372b63,_0x3759da){return function(){UserVoiceQueueRtEvents[_0xf644('0x3')](_0x372b63,_0x3759da);};}exports[_0xf644('0x4')]=function(_0x9938ed){for(var _0x1a6cbb=0x0,_0x2c7aaf=events[_0xf644('0x5')];_0x1a6cbb<_0x2c7aaf;_0x1a6cbb++){var _0x50362e=events[_0x1a6cbb];var _0x2c2868=createListener(_0xf644('0x6')+_0x50362e,_0x9938ed);UserVoiceQueueRtEvents['on'](_0x50362e,_0x2c2868);}};
\ No newline at end of file
+var _0xfc17=['emit','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update'];(function(_0x4120e5,_0x46663d){var _0x1b54f4=function(_0x44a354){while(--_0x44a354){_0x4120e5['push'](_0x4120e5['shift']());}};_0x1b54f4(++_0x46663d);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x4b7403,_0x4b8e0a){_0x4b7403=_0x4b7403-0x0;var _0x3df17c=_0xfc17[_0x4b7403];return _0x3df17c;};'use strict';var UserVoiceQueueRtEvents=require(_0x7fc1('0x0'));var events=[_0x7fc1('0x1'),_0x7fc1('0x2'),_0x7fc1('0x3')];function createListener(_0x524e76,_0x184a4d){return function(_0x3bbf44){_0x184a4d[_0x7fc1('0x4')](_0x524e76,_0x3bbf44);};}function removeListener(_0x1f6079,_0x44101d){return function(){UserVoiceQueueRtEvents[_0x7fc1('0x5')](_0x1f6079,_0x44101d);};}exports['register']=function(_0x30f5f8){for(var _0x1867ea=0x0,_0x2267ea=events[_0x7fc1('0x6')];_0x1867ea<_0x2267ea;_0x1867ea++){var _0x24c678=events[_0x1867ea];var _0x1b7106=createListener(_0x7fc1('0x7')+_0x24c678,_0x30f5f8);UserVoiceQueueRtEvents['on'](_0x24c678,_0x1b7106);}};
\ No newline at end of file
index 6615261..8c49287 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x938ac3,_0x2fc1a2){var _0x18350a=function(_0x387c20){while(--_0x387c20){_0x938ac3['push'](_0x938ac3['shift']());}};_0x18350a(++_0x2fc1a2);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x9c44,0x178));var _0x49c4=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x9c44[_0x21549c];return _0x426cbd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
index 0ed36a3..28f224d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x506b=['INTEGER','exports'];(function(_0x23a348,_0x58dba5){var _0x5c3066=function(_0x4441b5){while(--_0x4441b5){_0x23a348['push'](_0x23a348['shift']());}};_0x5c3066(++_0x58dba5);}(_0x506b,0x14b));var _0xb506=function(_0x4bb0d4,_0x5e5dff){_0x4bb0d4=_0x4bb0d4-0x0;var _0x1e5e08=_0x506b[_0x4bb0d4];return _0x1e5e08;};'use strict';var Sequelize=require('sequelize');module[_0xb506('0x0')]={'penalty':{'type':Sequelize[_0xb506('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x9d26=['exports','sequelize'];(function(_0x315add,_0x5e9ace){var _0x40956b=function(_0x5273d2){while(--_0x5273d2){_0x315add['push'](_0x315add['shift']());}};_0x40956b(++_0x5e9ace);}(_0x9d26,0xf7));var _0x69d2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x9d26[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x69d2('0x0'));module[_0x69d2('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 44bb4a5..b58f99f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92b5=['lodash','util','../../config/logger','api','moment','bluebird','path','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x835ba,_0x47a71b){var _0x22681e=function(_0x38ced1){while(--_0x38ced1){_0x835ba['push'](_0x835ba['shift']());}};_0x22681e(++_0x47a71b);}(_0x92b5,0x138));var _0x592b=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x92b5[_0x24061a];return _0x82054e;};'use strict';var _=require(_0x592b('0x0'));var util=require(_0x592b('0x1'));var logger=require(_0x592b('0x2'))(_0x592b('0x3'));var moment=require(_0x592b('0x4'));var BPromise=require(_0x592b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x592b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x592b('0x7'));module[_0x592b('0x8')]=function(_0xd46b56,_0x487183){return _0xd46b56[_0x592b('0x9')](_0x592b('0xa'),attributes,{'tableName':_0x592b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2df1=['UserWhatsappQueue','lodash','util','../../config/logger','moment','request-promise','../../config/environment'];(function(_0xc60af5,_0xbdbaa9){var _0x18d410=function(_0x48287f){while(--_0x48287f){_0xc60af5['push'](_0xc60af5['shift']());}};_0x18d410(++_0xbdbaa9);}(_0x2df1,0x120));var _0x12df=function(_0x5a0a4f,_0x453520){_0x5a0a4f=_0x5a0a4f-0x0;var _0x5cd8cc=_0x2df1[_0x5a0a4f];return _0x5cd8cc;};'use strict';var _=require(_0x12df('0x0'));var util=require(_0x12df('0x1'));var logger=require(_0x12df('0x2'))('api');var moment=require(_0x12df('0x3'));var BPromise=require('bluebird');var rp=require(_0x12df('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x12df('0x5'));var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x5f2ff5,_0x5134bf){return _0x5f2ff5['define'](_0x12df('0x6'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index be14666..f203f6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe759=['../../config/utils','../../config/logger','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x43ee57,_0x378d22){var _0x1f5f14=function(_0x12e70f){while(--_0x12e70f){_0x43ee57['push'](_0x43ee57['shift']());}};_0x1f5f14(++_0x378d22);}(_0xe759,0xb8));var _0x9e75=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe759[_0x432682];return _0x463d05;};'use strict';var _=require(_0x9e75('0x0'));var util=require(_0x9e75('0x1'));var moment=require(_0x9e75('0x2'));var BPromise=require(_0x9e75('0x3'));var rs=require(_0x9e75('0x4'));var fs=require('fs');var Redis=require(_0x9e75('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e75('0x6'));var logger=require(_0x9e75('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9e75('0x8'));var client=jayson[_0x9e75('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd10cd8,_0x451e73,_0x2d5384){return new BPromise(function(_0x886796,_0x3aff5a){return client['request'](_0xd10cd8,_0x2d5384)[_0x9e75('0xa')](function(_0x3ab0bc){logger[_0x9e75('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x451e73,_0x9e75('0xc'));logger[_0x9e75('0xd')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x451e73,_0x9e75('0xc'),JSON[_0x9e75('0xe')](_0x3ab0bc));if(_0x3ab0bc[_0x9e75('0xf')]){if(_0x3ab0bc[_0x9e75('0xf')][_0x9e75('0x10')]===0x1f4){logger[_0x9e75('0xf')](_0x9e75('0x11'),_0x451e73,_0x3ab0bc[_0x9e75('0xf')][_0x9e75('0x12')]);return _0x3aff5a(_0x3ab0bc[_0x9e75('0xf')]['message']);}logger[_0x9e75('0xf')](_0x9e75('0x11'),_0x451e73,_0x3ab0bc[_0x9e75('0xf')]['message']);return _0x886796(_0x3ab0bc[_0x9e75('0xf')][_0x9e75('0x12')]);}else{logger['info'](_0x9e75('0x11'),_0x451e73,_0x9e75('0xc'));_0x886796(_0x3ab0bc['result'][_0x9e75('0x12')]);}})['catch'](function(_0x1ac096){logger['error'](_0x9e75('0x11'),_0x451e73,_0x1ac096);_0x3aff5a(_0x1ac096);});});}
\ No newline at end of file
+var _0xb201=['request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x97732c,_0x16a969){var _0xee6292=function(_0x5e98f7){while(--_0x5e98f7){_0x97732c['push'](_0x97732c['shift']());}};_0xee6292(++_0x16a969);}(_0xb201,0x14d));var _0x1b20=function(_0x3b0d96,_0x4a9c15){_0x3b0d96=_0x3b0d96-0x0;var _0x311546=_0xb201[_0x3b0d96];return _0x311546;};'use strict';var _=require(_0x1b20('0x0'));var util=require(_0x1b20('0x1'));var moment=require(_0x1b20('0x2'));var BPromise=require(_0x1b20('0x3'));var rs=require(_0x1b20('0x4'));var fs=require('fs');var Redis=require(_0x1b20('0x5'));var db=require(_0x1b20('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1b20('0x7'))(_0x1b20('0x8'));var config=require(_0x1b20('0x9'));var jayson=require(_0x1b20('0xa'));var client=jayson['client'][_0x1b20('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58a196,_0x498385,_0x2d68b0){return new BPromise(function(_0x571c5d,_0x7e91dc){return client[_0x1b20('0xc')](_0x58a196,_0x2d68b0)[_0x1b20('0xd')](function(_0x4c9252){logger[_0x1b20('0xe')](_0x1b20('0xf'),_0x498385,_0x1b20('0x10'));logger[_0x1b20('0x11')](_0x1b20('0x12'),_0x498385,'request\x20sent',JSON[_0x1b20('0x13')](_0x4c9252));if(_0x4c9252[_0x1b20('0x14')]){if(_0x4c9252[_0x1b20('0x14')][_0x1b20('0x15')]===0x1f4){logger[_0x1b20('0x14')]('UserWhatsappQueue,\x20%s,\x20%s',_0x498385,_0x4c9252['error']['message']);return _0x7e91dc(_0x4c9252[_0x1b20('0x14')][_0x1b20('0x16')]);}logger[_0x1b20('0x14')](_0x1b20('0xf'),_0x498385,_0x4c9252['error'][_0x1b20('0x16')]);return _0x571c5d(_0x4c9252[_0x1b20('0x14')][_0x1b20('0x16')]);}else{logger[_0x1b20('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x498385,_0x1b20('0x10'));_0x571c5d(_0x4c9252['result'][_0x1b20('0x16')]);}})['catch'](function(_0x290f7d){logger[_0x1b20('0x14')](_0x1b20('0xf'),_0x498385,_0x290f7d);_0x7e91dc(_0x290f7d);});});}
\ No newline at end of file
index 1d8cce5..964c524 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14d=['../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0xe14d,0x1ee));var _0xde14=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xe14d[_0x40bffc];return _0x3007e9;};'use strict';var multer=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var path=require(_0xde14('0x2'));var timeout=require(_0xde14('0x3'));var express=require('express');var router=express[_0xde14('0x4')]();var fs_extra=require(_0xde14('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var controller=require(_0xde14('0x8'));router[_0xde14('0x9')]('/',auth[_0xde14('0xa')](),controller[_0xde14('0xb')]);router['get']('/:id',auth[_0xde14('0xa')](),controller[_0xde14('0xc')]);router[_0xde14('0xd')]('/',auth[_0xde14('0xa')](),controller[_0xde14('0xe')]);router[_0xde14('0xf')](_0xde14('0x10'),auth[_0xde14('0xa')](),controller['update']);router[_0xde14('0x11')](_0xde14('0x10'),auth[_0xde14('0xa')](),controller[_0xde14('0x12')]);module[_0xde14('0x13')]=router;
\ No newline at end of file
+var _0x68fc=['delete','destroy','exports','multer','util','path','Router','../../components/auth/service','./variable.controller','get','isAuthenticated','index','show','post','create','put','/:id','update'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x68fc,0xa5));var _0xc68f=function(_0xf64799,_0x513bbc){_0xf64799=_0xf64799-0x0;var _0x5f5993=_0x68fc[_0xf64799];return _0x5f5993;};'use strict';var multer=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var path=require(_0xc68f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc68f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc68f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc68f('0x5'));router[_0xc68f('0x6')]('/',auth[_0xc68f('0x7')](),controller[_0xc68f('0x8')]);router['get']('/:id',auth[_0xc68f('0x7')](),controller[_0xc68f('0x9')]);router[_0xc68f('0xa')]('/',auth[_0xc68f('0x7')](),controller[_0xc68f('0xb')]);router[_0xc68f('0xc')](_0xc68f('0xd'),auth[_0xc68f('0x7')](),controller[_0xc68f('0xe')]);router[_0xc68f('0xf')]('/:id',auth[_0xc68f('0x7')](),controller[_0xc68f('0x10')]);module[_0xc68f('0x11')]=router;
\ No newline at end of file
index 48724de..f04bd33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e46=['STRING','name','exports'];(function(_0x8299df,_0x2887e1){var _0x4a707f=function(_0x38ff3c){while(--_0x38ff3c){_0x8299df['push'](_0x8299df['shift']());}};_0x4a707f(++_0x2887e1);}(_0x6e46,0x188));var _0x66e4=function(_0x4d1639,_0x5565af){_0x4d1639=_0x4d1639-0x0;var _0x446a31=_0x6e46[_0x4d1639];return _0x446a31;};'use strict';var Sequelize=require('sequelize');module[_0x66e4('0x0')]={'name':{'type':Sequelize[_0x66e4('0x1')],'unique':_0x66e4('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x66e4('0x1')]}};
\ No newline at end of file
+var _0xf650=['name','sequelize','exports','STRING'];(function(_0x4c19cf,_0x495019){var _0x1c7c90=function(_0x4df60d){while(--_0x4df60d){_0x4c19cf['push'](_0x4c19cf['shift']());}};_0x1c7c90(++_0x495019);}(_0xf650,0xe9));var _0x0f65=function(_0x313bfd,_0x2921fc){_0x313bfd=_0x313bfd-0x0;var _0x1376ef=_0xf650[_0x313bfd];return _0x1376ef;};'use strict';var Sequelize=require(_0x0f65('0x0'));module[_0x0f65('0x1')]={'name':{'type':Sequelize[_0x0f65('0x2')],'unique':_0x0f65('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0f65('0x2')]}};
\ No newline at end of file
index c313aef..3bdb9d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf5e=['to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','destroy','then','get','UserProfileResource','error','stack','name','send','index','Variable','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','params','create','body','role','user','Variables','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x38163e,_0x5c658c){var _0x22908b=function(_0x5430a2){while(--_0x5430a2){_0x38163e['push'](_0x38163e['shift']());}};_0x22908b(++_0x5c658c);}(_0xbf5e,0x157));var _0xebf5=function(_0x185e85,_0x356977){_0x185e85=_0x185e85-0x0;var _0x296487=_0xbf5e[_0x185e85];return _0x296487;};'use strict';var emlformat=require(_0xebf5('0x0'));var rimraf=require(_0xebf5('0x1'));var zipdir=require(_0xebf5('0x2'));var jsonpatch=require(_0xebf5('0x3'));var rp=require(_0xebf5('0x4'));var moment=require(_0xebf5('0x5'));var BPromise=require(_0xebf5('0x6'));var Mustache=require('mustache');var util=require(_0xebf5('0x7'));var path=require(_0xebf5('0x8'));var sox=require('sox');var csv=require(_0xebf5('0x9'));var ejs=require(_0xebf5('0xa'));var fs=require('fs');var fs_extra=require(_0xebf5('0xb'));var _=require(_0xebf5('0xc'));var squel=require(_0xebf5('0xd'));var crypto=require(_0xebf5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xebf5('0xf'));var toCsv=require(_0xebf5('0x9'));var querystring=require(_0xebf5('0x10'));var Papa=require(_0xebf5('0x11'));var Redis=require('ioredis');var authService=require(_0xebf5('0x12'));var qs=require(_0xebf5('0x13'));var as=require(_0xebf5('0x14'));var hardwareService=require(_0xebf5('0x15'));var logger=require('../../config/logger')(_0xebf5('0x16'));var utils=require(_0xebf5('0x17'));var config=require(_0xebf5('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xebf5('0x19'))['db'];function respondWithStatusCode(_0xef1e54,_0x2e03f7){_0x2e03f7=_0x2e03f7||0xcc;return function(_0x2e0a22){if(_0x2e0a22){return _0xef1e54['sendStatus'](_0x2e03f7);}return _0xef1e54[_0xebf5('0x1a')](_0x2e03f7)[_0xebf5('0x1b')]();};}function respondWithResult(_0x785aca,_0x369f54){_0x369f54=_0x369f54||0xc8;return function(_0x10cb82){if(_0x10cb82){return _0x785aca['status'](_0x369f54)[_0xebf5('0x1c')](_0x10cb82);}};}function respondWithFilteredResult(_0x316e6e,_0x5be5b1){return function(_0x3a26f8){if(_0x3a26f8){var _0x1840fa=typeof _0x5be5b1['offset']===_0xebf5('0x1d')&&typeof _0x5be5b1[_0xebf5('0x1e')]==='undefined';var _0x3df771=_0x3a26f8['count'];var _0x5564ef=_0x1840fa?0x0:_0x5be5b1[_0xebf5('0x1f')];var _0x41f631=_0x1840fa?_0x3a26f8['count']:_0x5be5b1[_0xebf5('0x1f')]+_0x5be5b1['limit'];var _0x4f72d9;if(_0x41f631>=_0x3df771){_0x41f631=_0x3df771;_0x4f72d9=0xc8;}else{_0x4f72d9=0xce;}_0x316e6e[_0xebf5('0x1a')](_0x4f72d9);return _0x316e6e[_0xebf5('0x20')](_0xebf5('0x21'),_0x5564ef+'-'+_0x41f631+'/'+_0x3df771)['json'](_0x3a26f8);}return null;};}function patchUpdates(_0x15600d){return function(_0x4787fa){try{jsonpatch[_0xebf5('0x22')](_0x4787fa,_0x15600d,!![]);}catch(_0xa789f7){return BPromise[_0xebf5('0x23')](_0xa789f7);}return _0x4787fa[_0xebf5('0x24')]();};}function saveUpdates(_0x165630,_0x304c3b){return function(_0x2739a7){if(_0x2739a7){return _0x2739a7['update'](_0x165630)['then'](function(_0x17df92){return _0x17df92;});}return null;};}function removeEntity(_0x4dda3e,_0x2e39c5){return function(_0x520158){if(_0x520158){return _0x520158[_0xebf5('0x25')]()[_0xebf5('0x26')](function(){var _0x5ae700=_0x520158[_0xebf5('0x27')]({'plain':!![]});var _0x7a83ba='Variables';return db[_0xebf5('0x28')]['destroy']({'where':{'type':_0x7a83ba,'resourceId':_0x5ae700['id']}})[_0xebf5('0x26')](function(){return _0x520158;});})[_0xebf5('0x26')](function(){_0x4dda3e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ac321,_0x593695){return function(_0x398c3b){if(!_0x398c3b){_0x1ac321['sendStatus'](0x194);}return _0x398c3b;};}function handleError(_0x2f570b,_0x10f785){_0x10f785=_0x10f785||0x1f4;return function(_0x312be3){logger[_0xebf5('0x29')](_0x312be3[_0xebf5('0x2a')]);if(_0x312be3[_0xebf5('0x2b')]){delete _0x312be3[_0xebf5('0x2b')];}_0x2f570b[_0xebf5('0x1a')](_0x10f785)[_0xebf5('0x2c')](_0x312be3);};}exports[_0xebf5('0x2d')]=function(_0xb18bed,_0x14d8f3){var _0x130bef={},_0x411f7a={},_0x54ff61={'count':0x0,'rows':[]};var _0x48c3b7=_['map'](db[_0xebf5('0x2e')][_0xebf5('0x2f')],function(_0x7accb7){return{'name':_0x7accb7['fieldName'],'type':_0x7accb7[_0xebf5('0x30')][_0xebf5('0x31')]};});_0x411f7a[_0xebf5('0x32')]=_[_0xebf5('0x33')](_0x48c3b7,_0xebf5('0x2b'));_0x411f7a[_0xebf5('0x34')]=_[_0xebf5('0x35')](_0xb18bed[_0xebf5('0x34')]);_0x411f7a[_0xebf5('0x36')]=_[_0xebf5('0x37')](_0x411f7a[_0xebf5('0x32')],_0x411f7a['query']);_0x130bef[_0xebf5('0x38')]=_[_0xebf5('0x37')](_0x411f7a[_0xebf5('0x32')],qs[_0xebf5('0x39')](_0xb18bed[_0xebf5('0x34')]['fields']));_0x130bef[_0xebf5('0x38')]=_0x130bef[_0xebf5('0x38')][_0xebf5('0x3a')]?_0x130bef[_0xebf5('0x38')]:_0x411f7a[_0xebf5('0x32')];if(!_0xb18bed[_0xebf5('0x34')][_0xebf5('0x3b')](_0xebf5('0x3c'))){_0x130bef[_0xebf5('0x1e')]=qs[_0xebf5('0x1e')](_0xb18bed['query'][_0xebf5('0x1e')]);_0x130bef[_0xebf5('0x1f')]=qs['offset'](_0xb18bed[_0xebf5('0x34')][_0xebf5('0x1f')]);}_0x130bef[_0xebf5('0x3d')]=qs['sort'](_0xb18bed[_0xebf5('0x34')][_0xebf5('0x3e')]);_0x130bef[_0xebf5('0x3f')]=qs[_0xebf5('0x36')](_[_0xebf5('0x40')](_0xb18bed[_0xebf5('0x34')],_0x411f7a[_0xebf5('0x36')]),_0x48c3b7);if(_0xb18bed['query'][_0xebf5('0x41')]){_0x130bef[_0xebf5('0x3f')]=_['merge'](_0x130bef[_0xebf5('0x3f')],{'$or':_[_0xebf5('0x33')](_0x48c3b7,function(_0x3049ac){if(_0x3049ac[_0xebf5('0x30')]!==_0xebf5('0x42')){var _0x172421={};_0x172421[_0x3049ac['name']]={'$like':'%'+_0xb18bed[_0xebf5('0x34')][_0xebf5('0x41')]+'%'};return _0x172421;}})});}_0x130bef=_[_0xebf5('0x43')]({},_0x130bef,_0xb18bed[_0xebf5('0x44')]);var _0x497114={'where':_0x130bef['where']};return db[_0xebf5('0x2e')][_0xebf5('0x45')](_0x497114)['then'](function(_0x2d5c8f){_0x54ff61[_0xebf5('0x45')]=_0x2d5c8f;if(_0xb18bed['query'][_0xebf5('0x46')]){_0x130bef[_0xebf5('0x47')]=[{'all':!![]}];}return db['Variable'][_0xebf5('0x48')](_0x130bef);})[_0xebf5('0x26')](function(_0x392cf1){_0x54ff61[_0xebf5('0x49')]=_0x392cf1;return _0x54ff61;})['then'](respondWithFilteredResult(_0x14d8f3,_0x130bef))[_0xebf5('0x4a')](handleError(_0x14d8f3,null));};exports[_0xebf5('0x4b')]=function(_0x41f27b,_0x43e95c){var _0x1c1113={'raw':!![],'where':{'id':_0x41f27b[_0xebf5('0x4c')]['id']}},_0x4e7b25={};_0x4e7b25[_0xebf5('0x32')]=_[_0xebf5('0x35')](db[_0xebf5('0x2e')][_0xebf5('0x2f')]);_0x4e7b25[_0xebf5('0x34')]=_[_0xebf5('0x35')](_0x41f27b[_0xebf5('0x34')]);_0x4e7b25[_0xebf5('0x36')]=_[_0xebf5('0x37')](_0x4e7b25[_0xebf5('0x32')],_0x4e7b25[_0xebf5('0x34')]);_0x1c1113[_0xebf5('0x38')]=_[_0xebf5('0x37')](_0x4e7b25[_0xebf5('0x32')],qs['fields'](_0x41f27b[_0xebf5('0x34')][_0xebf5('0x39')]));_0x1c1113['attributes']=_0x1c1113['attributes'][_0xebf5('0x3a')]?_0x1c1113[_0xebf5('0x38')]:_0x4e7b25[_0xebf5('0x32')];if(_0x41f27b['query'][_0xebf5('0x46')]){_0x1c1113[_0xebf5('0x47')]=[{'all':!![]}];}_0x1c1113=_[_0xebf5('0x43')]({},_0x1c1113,_0x41f27b[_0xebf5('0x44')]);return db[_0xebf5('0x2e')]['find'](_0x1c1113)[_0xebf5('0x26')](handleEntityNotFound(_0x43e95c,null))['then'](respondWithResult(_0x43e95c,null))[_0xebf5('0x4a')](handleError(_0x43e95c,null));};exports[_0xebf5('0x4d')]=function(_0x2d5c7e,_0x2e9f1f){return db['Variable'][_0xebf5('0x4d')](_0x2d5c7e[_0xebf5('0x4e')],{})[_0xebf5('0x26')](function(_0x576a99){var _0x3e447c=_0x2d5c7e['user'][_0xebf5('0x27')]({'plain':!![]});if(!_0x3e447c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e447c[_0xebf5('0x4f')]===_0xebf5('0x50')){var _0xfb5113=_0x576a99[_0xebf5('0x27')]({'plain':!![]});var _0x29b9b2=_0xebf5('0x51');return db[_0xebf5('0x52')][_0xebf5('0x53')]({'where':{'name':_0x29b9b2,'userProfileId':_0x3e447c[_0xebf5('0x54')]},'raw':!![]})[_0xebf5('0x26')](function(_0x12f3b8){if(_0x12f3b8&&_0x12f3b8[_0xebf5('0x55')]===0x0){return db[_0xebf5('0x28')][_0xebf5('0x4d')]({'name':_0xfb5113[_0xebf5('0x2b')],'resourceId':_0xfb5113['id'],'type':_0x12f3b8['name'],'sectionId':_0x12f3b8['id']},{})[_0xebf5('0x26')](function(){return _0x576a99;});}else{return _0x576a99;}})[_0xebf5('0x4a')](function(_0x474cf4){logger[_0xebf5('0x29')](_0xebf5('0x56'),_0x474cf4);throw _0x474cf4;});}return _0x576a99;})[_0xebf5('0x26')](respondWithResult(_0x2e9f1f,0xc9))[_0xebf5('0x4a')](handleError(_0x2e9f1f,null));};exports[_0xebf5('0x57')]=function(_0x58a95e,_0x12eec3){if(_0x58a95e['body']['id']){delete _0x58a95e[_0xebf5('0x4e')]['id'];}return db[_0xebf5('0x2e')][_0xebf5('0x53')]({'where':{'id':_0x58a95e[_0xebf5('0x4c')]['id']}})[_0xebf5('0x26')](handleEntityNotFound(_0x12eec3,null))['then'](saveUpdates(_0x58a95e[_0xebf5('0x4e')],null))[_0xebf5('0x26')](respondWithResult(_0x12eec3,null))[_0xebf5('0x4a')](handleError(_0x12eec3,null));};exports[_0xebf5('0x25')]=function(_0x59b751,_0x1e3a55){return db['Variable'][_0xebf5('0x53')]({'where':{'id':_0x59b751['params']['id']}})['then'](handleEntityNotFound(_0x1e3a55,null))[_0xebf5('0x26')](removeEntity(_0x1e3a55,null))[_0xebf5('0x4a')](handleError(_0x1e3a55,null));};
\ No newline at end of file
+var _0xa4ea=['length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','offset','undefined','limit','count','status','Content-Range','json','reject','save','update','then','destroy','Variables','UserProfileResource','error','stack','name','send','map','Variable','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields'];(function(_0x4b83e7,_0x4b1a90){var _0x311b7b=function(_0x184c71){while(--_0x184c71){_0x4b83e7['push'](_0x4b83e7['shift']());}};_0x311b7b(++_0x4b1a90);}(_0xa4ea,0x1ef));var _0xaa4e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa4ea[_0xbe200f];return _0x192597;};'use strict';var emlformat=require(_0xaa4e('0x0'));var rimraf=require(_0xaa4e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa4e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xaa4e('0x3'));var Mustache=require(_0xaa4e('0x4'));var util=require('util');var path=require(_0xaa4e('0x5'));var sox=require(_0xaa4e('0x6'));var csv=require(_0xaa4e('0x7'));var ejs=require(_0xaa4e('0x8'));var fs=require('fs');var fs_extra=require(_0xaa4e('0x9'));var _=require('lodash');var squel=require(_0xaa4e('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaa4e('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xaa4e('0xc'));var Redis=require(_0xaa4e('0xd'));var authService=require(_0xaa4e('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xaa4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa4e('0x10'))(_0xaa4e('0x11'));var utils=require(_0xaa4e('0x12'));var config=require(_0xaa4e('0x13'));var licenseUtil=require(_0xaa4e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10134a,_0x935ced){_0x935ced=_0x935ced||0xcc;return function(_0x1d1a56){if(_0x1d1a56){return _0x10134a[_0xaa4e('0x15')](_0x935ced);}return _0x10134a['status'](_0x935ced)['end']();};}function respondWithResult(_0x55ce86,_0xc95734){_0xc95734=_0xc95734||0xc8;return function(_0x311f12){if(_0x311f12){return _0x55ce86['status'](_0xc95734)['json'](_0x311f12);}};}function respondWithFilteredResult(_0x41fc0d,_0x41dee4){return function(_0x1715eb){if(_0x1715eb){var _0x43942c=typeof _0x41dee4[_0xaa4e('0x16')]===_0xaa4e('0x17')&&typeof _0x41dee4[_0xaa4e('0x18')]===_0xaa4e('0x17');var _0x4d12e5=_0x1715eb[_0xaa4e('0x19')];var _0x18e558=_0x43942c?0x0:_0x41dee4['offset'];var _0x5b58d0=_0x43942c?_0x1715eb[_0xaa4e('0x19')]:_0x41dee4[_0xaa4e('0x16')]+_0x41dee4['limit'];var _0x26f1b5;if(_0x5b58d0>=_0x4d12e5){_0x5b58d0=_0x4d12e5;_0x26f1b5=0xc8;}else{_0x26f1b5=0xce;}_0x41fc0d[_0xaa4e('0x1a')](_0x26f1b5);return _0x41fc0d['set'](_0xaa4e('0x1b'),_0x18e558+'-'+_0x5b58d0+'/'+_0x4d12e5)[_0xaa4e('0x1c')](_0x1715eb);}return null;};}function patchUpdates(_0xad1897){return function(_0x46c01f){try{jsonpatch['apply'](_0x46c01f,_0xad1897,!![]);}catch(_0x5e9ebf){return BPromise[_0xaa4e('0x1d')](_0x5e9ebf);}return _0x46c01f[_0xaa4e('0x1e')]();};}function saveUpdates(_0x5d46b1,_0x2878c6){return function(_0x5efb6e){if(_0x5efb6e){return _0x5efb6e[_0xaa4e('0x1f')](_0x5d46b1)[_0xaa4e('0x20')](function(_0x5ec8b9){return _0x5ec8b9;});}return null;};}function removeEntity(_0x2971d4,_0x2e9b5f){return function(_0x57dd63){if(_0x57dd63){return _0x57dd63[_0xaa4e('0x21')]()[_0xaa4e('0x20')](function(){var _0x34bcbf=_0x57dd63['get']({'plain':!![]});var _0x2493b6=_0xaa4e('0x22');return db[_0xaa4e('0x23')]['destroy']({'where':{'type':_0x2493b6,'resourceId':_0x34bcbf['id']}})[_0xaa4e('0x20')](function(){return _0x57dd63;});})['then'](function(){_0x2971d4[_0xaa4e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x431a87,_0x520d30){return function(_0x17940f){if(!_0x17940f){_0x431a87[_0xaa4e('0x15')](0x194);}return _0x17940f;};}function handleError(_0x20cabd,_0x4b16b7){_0x4b16b7=_0x4b16b7||0x1f4;return function(_0x4537ae){logger[_0xaa4e('0x24')](_0x4537ae[_0xaa4e('0x25')]);if(_0x4537ae['name']){delete _0x4537ae[_0xaa4e('0x26')];}_0x20cabd['status'](_0x4b16b7)[_0xaa4e('0x27')](_0x4537ae);};}exports['index']=function(_0x380e4e,_0x53903b){var _0x13b52a={},_0x2f4363={},_0x20ccd5={'count':0x0,'rows':[]};var _0x5711e5=_[_0xaa4e('0x28')](db[_0xaa4e('0x29')][_0xaa4e('0x2a')],function(_0x75c2ea){return{'name':_0x75c2ea[_0xaa4e('0x2b')],'type':_0x75c2ea[_0xaa4e('0x2c')]['key']};});_0x2f4363[_0xaa4e('0x2d')]=_[_0xaa4e('0x28')](_0x5711e5,_0xaa4e('0x26'));_0x2f4363[_0xaa4e('0x2e')]=_['keys'](_0x380e4e[_0xaa4e('0x2e')]);_0x2f4363[_0xaa4e('0x2f')]=_['intersection'](_0x2f4363[_0xaa4e('0x2d')],_0x2f4363[_0xaa4e('0x2e')]);_0x13b52a[_0xaa4e('0x30')]=_[_0xaa4e('0x31')](_0x2f4363[_0xaa4e('0x2d')],qs[_0xaa4e('0x32')](_0x380e4e['query']['fields']));_0x13b52a[_0xaa4e('0x30')]=_0x13b52a[_0xaa4e('0x30')][_0xaa4e('0x33')]?_0x13b52a['attributes']:_0x2f4363[_0xaa4e('0x2d')];if(!_0x380e4e[_0xaa4e('0x2e')][_0xaa4e('0x34')](_0xaa4e('0x35'))){_0x13b52a[_0xaa4e('0x18')]=qs[_0xaa4e('0x18')](_0x380e4e[_0xaa4e('0x2e')]['limit']);_0x13b52a['offset']=qs[_0xaa4e('0x16')](_0x380e4e[_0xaa4e('0x2e')][_0xaa4e('0x16')]);}_0x13b52a[_0xaa4e('0x36')]=qs['sort'](_0x380e4e['query'][_0xaa4e('0x37')]);_0x13b52a[_0xaa4e('0x38')]=qs[_0xaa4e('0x2f')](_['pick'](_0x380e4e[_0xaa4e('0x2e')],_0x2f4363[_0xaa4e('0x2f')]),_0x5711e5);if(_0x380e4e[_0xaa4e('0x2e')][_0xaa4e('0x39')]){_0x13b52a[_0xaa4e('0x38')]=_[_0xaa4e('0x3a')](_0x13b52a['where'],{'$or':_[_0xaa4e('0x28')](_0x5711e5,function(_0x459816){if(_0x459816[_0xaa4e('0x2c')]!==_0xaa4e('0x3b')){var _0x3eac4a={};_0x3eac4a[_0x459816[_0xaa4e('0x26')]]={'$like':'%'+_0x380e4e['query']['filter']+'%'};return _0x3eac4a;}})});}_0x13b52a=_[_0xaa4e('0x3a')]({},_0x13b52a,_0x380e4e[_0xaa4e('0x3c')]);var _0x1deb8a={'where':_0x13b52a[_0xaa4e('0x38')]};return db[_0xaa4e('0x29')]['count'](_0x1deb8a)['then'](function(_0x240523){_0x20ccd5['count']=_0x240523;if(_0x380e4e[_0xaa4e('0x2e')][_0xaa4e('0x3d')]){_0x13b52a[_0xaa4e('0x3e')]=[{'all':!![]}];}return db[_0xaa4e('0x29')][_0xaa4e('0x3f')](_0x13b52a);})['then'](function(_0xe27ad7){_0x20ccd5['rows']=_0xe27ad7;return _0x20ccd5;})[_0xaa4e('0x20')](respondWithFilteredResult(_0x53903b,_0x13b52a))[_0xaa4e('0x40')](handleError(_0x53903b,null));};exports[_0xaa4e('0x41')]=function(_0x139c1a,_0x301085){var _0xaf27e5={'raw':!![],'where':{'id':_0x139c1a[_0xaa4e('0x42')]['id']}},_0x419f4f={};_0x419f4f[_0xaa4e('0x2d')]=_['keys'](db[_0xaa4e('0x29')]['rawAttributes']);_0x419f4f[_0xaa4e('0x2e')]=_[_0xaa4e('0x43')](_0x139c1a[_0xaa4e('0x2e')]);_0x419f4f[_0xaa4e('0x2f')]=_[_0xaa4e('0x31')](_0x419f4f['model'],_0x419f4f[_0xaa4e('0x2e')]);_0xaf27e5[_0xaa4e('0x30')]=_[_0xaa4e('0x31')](_0x419f4f[_0xaa4e('0x2d')],qs[_0xaa4e('0x32')](_0x139c1a['query'][_0xaa4e('0x32')]));_0xaf27e5[_0xaa4e('0x30')]=_0xaf27e5[_0xaa4e('0x30')][_0xaa4e('0x33')]?_0xaf27e5[_0xaa4e('0x30')]:_0x419f4f[_0xaa4e('0x2d')];if(_0x139c1a[_0xaa4e('0x2e')][_0xaa4e('0x3d')]){_0xaf27e5[_0xaa4e('0x3e')]=[{'all':!![]}];}_0xaf27e5=_[_0xaa4e('0x3a')]({},_0xaf27e5,_0x139c1a[_0xaa4e('0x3c')]);return db[_0xaa4e('0x29')][_0xaa4e('0x44')](_0xaf27e5)[_0xaa4e('0x20')](handleEntityNotFound(_0x301085,null))[_0xaa4e('0x20')](respondWithResult(_0x301085,null))[_0xaa4e('0x40')](handleError(_0x301085,null));};exports[_0xaa4e('0x45')]=function(_0x989f95,_0x26d1e2){return db[_0xaa4e('0x29')][_0xaa4e('0x45')](_0x989f95[_0xaa4e('0x46')],{})[_0xaa4e('0x20')](function(_0x1b09c5){var _0x47591c=_0x989f95[_0xaa4e('0x47')][_0xaa4e('0x48')]({'plain':!![]});if(!_0x47591c)throw new Error(_0xaa4e('0x49'));if(_0x47591c['role']==='user'){var _0x4beefc=_0x1b09c5[_0xaa4e('0x48')]({'plain':!![]});var _0x19142d=_0xaa4e('0x22');return db[_0xaa4e('0x4a')][_0xaa4e('0x44')]({'where':{'name':_0x19142d,'userProfileId':_0x47591c[_0xaa4e('0x4b')]},'raw':!![]})[_0xaa4e('0x20')](function(_0x389e71){if(_0x389e71&&_0x389e71[_0xaa4e('0x4c')]===0x0){return db[_0xaa4e('0x23')][_0xaa4e('0x45')]({'name':_0x4beefc[_0xaa4e('0x26')],'resourceId':_0x4beefc['id'],'type':_0x389e71['name'],'sectionId':_0x389e71['id']},{})[_0xaa4e('0x20')](function(){return _0x1b09c5;});}else{return _0x1b09c5;}})[_0xaa4e('0x40')](function(_0x5f0a72){logger[_0xaa4e('0x24')](_0xaa4e('0x4d'),_0x5f0a72);throw _0x5f0a72;});}return _0x1b09c5;})[_0xaa4e('0x20')](respondWithResult(_0x26d1e2,0xc9))['catch'](handleError(_0x26d1e2,null));};exports[_0xaa4e('0x1f')]=function(_0xe9b385,_0x50c3d2){if(_0xe9b385['body']['id']){delete _0xe9b385[_0xaa4e('0x46')]['id'];}return db[_0xaa4e('0x29')]['find']({'where':{'id':_0xe9b385[_0xaa4e('0x42')]['id']}})['then'](handleEntityNotFound(_0x50c3d2,null))[_0xaa4e('0x20')](saveUpdates(_0xe9b385[_0xaa4e('0x46')],null))[_0xaa4e('0x20')](respondWithResult(_0x50c3d2,null))[_0xaa4e('0x40')](handleError(_0x50c3d2,null));};exports['destroy']=function(_0x3fe35b,_0x1acc56){return db[_0xaa4e('0x29')][_0xaa4e('0x44')]({'where':{'id':_0x3fe35b['params']['id']}})['then'](handleEntityNotFound(_0x1acc56,null))['then'](removeEntity(_0x1acc56,null))['catch'](handleError(_0x1acc56,null));};
\ No newline at end of file
index c318f2a..b01996d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeba5=['../../config/logger','api','moment','request-promise','path','./variable.attributes','define','tools_variables','lodash','util'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xeba5,0x152));var _0x5eba=function(_0x103ec4,_0x310c30){_0x103ec4=_0x103ec4-0x0;var _0x8b0bd0=_0xeba5[_0x103ec4];return _0x8b0bd0;};'use strict';var _=require(_0x5eba('0x0'));var util=require(_0x5eba('0x1'));var logger=require(_0x5eba('0x2'))(_0x5eba('0x3'));var moment=require(_0x5eba('0x4'));var BPromise=require('bluebird');var rp=require(_0x5eba('0x5'));var fs=require('fs');var path=require(_0x5eba('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5eba('0x7'));module['exports']=function(_0x44b7a6,_0x13763a){return _0x44b7a6[_0x5eba('0x8')]('Variable',attributes,{'tableName':_0x5eba('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x07e9=['tools_variables','lodash','util','moment','rimraf','../../config/environment','./variable.attributes','define','Variable'];(function(_0x5d0a1d,_0x56b68e){var _0x5020cc=function(_0x34eb6a){while(--_0x34eb6a){_0x5d0a1d['push'](_0x5d0a1d['shift']());}};_0x5020cc(++_0x56b68e);}(_0x07e9,0x196));var _0x907e=function(_0x595525,_0x38f861){_0x595525=_0x595525-0x0;var _0x488f20=_0x07e9[_0x595525];return _0x488f20;};'use strict';var _=require(_0x907e('0x0'));var util=require(_0x907e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x907e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x907e('0x3'));var config=require(_0x907e('0x4'));var attributes=require(_0x907e('0x5'));module['exports']=function(_0x4b0857,_0x3270c2){return _0x4b0857[_0x907e('0x6')](_0x907e('0x7'),attributes,{'tableName':_0x907e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 24eb995..133053d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowVariable','Variable','find','options','attributes','map','include','model','catch','lodash','util'];(function(_0xb7190f,_0x42212b){var _0x29a59f=function(_0x4f824e){while(--_0x4f824e){_0xb7190f['push'](_0xb7190f['shift']());}};_0x29a59f(++_0x42212b);}(_0xabce,0x103));var _0xeabc=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xabce[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Variable,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}exports[_0xeabc('0x14')]=function(_0x58a3c0){var _0x16f08b=this;return new Promise(function(_0x31dd53,_0x31f52a){return db[_0xeabc('0x15')][_0xeabc('0x16')]({'raw':_0x58a3c0['options']?_0x58a3c0[_0xeabc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['where']||null:null,'attributes':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x18')]||null:null,'include':_0x58a3c0[_0xeabc('0x17')]?_0x58a3c0[_0xeabc('0x17')]['include']?_[_0xeabc('0x19')](_0x58a3c0[_0xeabc('0x17')][_0xeabc('0x1a')],function(_0x5bdd57){return{'model':db[_0x5bdd57[_0xeabc('0x1b')]],'as':_0x5bdd57['as'],'attributes':_0x5bdd57[_0xeabc('0x18')],'include':_0x5bdd57[_0xeabc('0x1a')]?_[_0xeabc('0x19')](_0x5bdd57['include'],function(_0x109e1d){return{'model':db[_0x109e1d['model']],'as':_0x109e1d['as'],'attributes':_0x109e1d[_0xeabc('0x18')],'include':_0x109e1d['include']?_[_0xeabc('0x19')](_0x109e1d[_0xeabc('0x1a')],function(_0x269621){return{'model':db[_0x269621[_0xeabc('0x1b')]],'as':_0x269621['as'],'attributes':_0x269621[_0xeabc('0x18')]};}):[]};}):[]};}):[]:[]})[_0xeabc('0x9')](function(_0x131722){logger['info']('ShowVariable',_0x58a3c0);logger[_0xeabc('0xd')]('ShowVariable',_0x58a3c0,JSON[_0xeabc('0xf')](_0x131722));_0x31dd53(_0x131722);})[_0xeabc('0x1c')](function(_0x48fb52){logger[_0xeabc('0x10')](_0xeabc('0x14'),_0x48fb52[_0xeabc('0x12')],_0x58a3c0);_0x31f52a(_0x16f08b[_0xeabc('0x10')](0x1f4,_0x48fb52[_0xeabc('0x12')]));});});};
\ No newline at end of file
+var _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','Variable,\x20%s,\x20%s','result','catch','ShowVariable','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x1cfda3,_0x32e81){var _0x45a82f=function(_0x19078e){while(--_0x19078e){_0x1cfda3['push'](_0x1cfda3['shift']());}};_0x45a82f(++_0x32e81);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4ce028,_0x526d4b){_0x4ce028=_0x4ce028-0x0;var _0x583d0c=_0x5fc3[_0x4ce028];return _0x583d0c;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Variable,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['Variable'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});};
\ No newline at end of file
index 5570268..cc32e56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8952=['/restart','restart','migrations','express','Router','../../components/auth/service','./version.controller','get','index','isAuthenticated','canUpdate','fetch','/reset','pull'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x8952,0xc7));var _0x2895=function(_0x14802d,_0x42737c){_0x14802d=_0x14802d-0x0;var _0x58fa59=_0x8952[_0x14802d];return _0x58fa59;};'use strict';var express=require(_0x2895('0x0'));var router=express[_0x2895('0x1')]();var auth=require(_0x2895('0x2'));var controller=require(_0x2895('0x3'));router[_0x2895('0x4')]('/',controller[_0x2895('0x5')]);router[_0x2895('0x4')]('/fetch',auth[_0x2895('0x6')](),auth[_0x2895('0x7')](),controller[_0x2895('0x8')]);router[_0x2895('0x4')](_0x2895('0x9'),auth[_0x2895('0x6')](),auth[_0x2895('0x7')](),controller['reset']);router[_0x2895('0x4')]('/pull',auth[_0x2895('0x6')](),auth['canUpdate'](),controller[_0x2895('0xa')]);router['get'](_0x2895('0xb'),auth[_0x2895('0x6')](),controller[_0x2895('0xc')]);router[_0x2895('0x4')]('/migrations',controller[_0x2895('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xc3f5=['get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/restart','restart','/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller'];(function(_0x507fa9,_0x4015ed){var _0x47fb68=function(_0x1b02c1){while(--_0x1b02c1){_0x507fa9['push'](_0x507fa9['shift']());}};_0x47fb68(++_0x4015ed);}(_0xc3f5,0x84));var _0x5c3f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc3f5[_0xa464c9];return _0x3d73c4;};'use strict';var express=require(_0x5c3f('0x0'));var router=express[_0x5c3f('0x1')]();var auth=require(_0x5c3f('0x2'));var controller=require(_0x5c3f('0x3'));router[_0x5c3f('0x4')]('/',controller[_0x5c3f('0x5')]);router['get'](_0x5c3f('0x6'),auth[_0x5c3f('0x7')](),auth[_0x5c3f('0x8')](),controller[_0x5c3f('0x9')]);router[_0x5c3f('0x4')](_0x5c3f('0xa'),auth[_0x5c3f('0x7')](),auth[_0x5c3f('0x8')](),controller[_0x5c3f('0xb')]);router['get']('/pull',auth[_0x5c3f('0x7')](),auth['canUpdate'](),controller['pull']);router[_0x5c3f('0x4')](_0x5c3f('0xc'),auth[_0x5c3f('0x7')](),controller[_0x5c3f('0xd')]);router[_0x5c3f('0x4')](_0x5c3f('0xe'),controller[_0x5c3f('0xf')]);module[_0x5c3f('0x10')]=router;
\ No newline at end of file
index a1ce8a8..c94b762 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f61=['constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','map','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','exec','../../mysqldb','../../config/environment','../../config/logger','simple-git','root','exports','query','latest','fetch','tags','2.0.0','status','json','info','git\x20fetch','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','error','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','server','replace','.js','sort','sequelize','Migration','getQueryInterface'];(function(_0x254563,_0x11751a){var _0x1d4f46=function(_0x146ad4){while(--_0x146ad4){_0x254563['push'](_0x254563['shift']());}};_0x1d4f46(++_0x11751a);}(_0x8f61,0x68));var _0x18f6=function(_0x29ed2c,_0x49b561){_0x29ed2c=_0x29ed2c-0x0;var _0xc9ad2=_0x8f61[_0x29ed2c];return _0xc9ad2;};'use strict';var Umzug=require(_0x18f6('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x18f6('0x1'));var pkginfo=require(_0x18f6('0x2'))(module,_0x18f6('0x3'));var compareVersions=require('compare-versions');var exec=require('child_process')[_0x18f6('0x4')];var db=require(_0x18f6('0x5'))['db'];var config=require(_0x18f6('0x6'));var pm2=require('../../config/pm2');var logger=require(_0x18f6('0x7'))('update');var git=require(_0x18f6('0x8'))(config[_0x18f6('0x9')]);exports['index']=function(_0x491dd4,_0x5773d9){var _0x2f6092={'current':module[_0x18f6('0xa')]['version'],'phonebar':0x2};if(_0x491dd4[_0x18f6('0xb')]&&_0x491dd4[_0x18f6('0xb')][_0x18f6('0xc')]){return git[_0x18f6('0xd')]()[_0x18f6('0xe')](function(_0x43c9df,_0x1e1ddc){_0x2f6092['latest']=(_0x43c9df?module[_0x18f6('0xa')][_0x18f6('0x3')]:_0x1e1ddc[_0x18f6('0xc')])||_0x18f6('0xf');return _0x5773d9[_0x18f6('0x10')](0xc8)['json'](_0x2f6092);});}else{return _0x5773d9[_0x18f6('0x10')](0xc8)[_0x18f6('0x11')](_0x2f6092);}};exports[_0x18f6('0xd')]=function(_0x43d037,_0x5db8e2){return git[_0x18f6('0xd')](['origin','master'],function(_0x1e3925){if(_0x1e3925){logger['error'](_0x1e3925);return _0x5db8e2[_0x18f6('0x10')](0x1f4)['json'](_0x1e3925);}logger[_0x18f6('0x12')](_0x18f6('0x13'));return _0x5db8e2[_0x18f6('0x10')](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x18f6('0x14')]=function(_0x24efdb,_0x52eeae){return git[_0x18f6('0x14')](['--hard',_0x18f6('0x15')],function(_0x78a22f){if(_0x78a22f){logger['error'](_0x78a22f);return _0x52eeae[_0x18f6('0x10')](0x1f4)[_0x18f6('0x11')](_0x78a22f);}logger['info'](_0x18f6('0x16'));return _0x52eeae[_0x18f6('0x10')](0xc8)[_0x18f6('0x11')]({'output':_0x18f6('0x17')});});};exports['pull']=function(_0x1d916b,_0x31f8aa){exec('npm\x20install\x20--production',function(_0x1765b4,_0x30be55,_0x417da9){logger[_0x18f6('0x12')](_0x30be55);logger[_0x18f6('0x12')](_0x417da9);if(_0x1765b4){logger[_0x18f6('0x18')](_0x1765b4);return _0x31f8aa[_0x18f6('0x10')](0x1f4)[_0x18f6('0x11')](_0x1765b4);}return _0x31f8aa['status'](0xc8)[_0x18f6('0x11')]({'output':_0x30be55});});};exports['restart']=function(_0x87be8d,_0x193818){return pm2[_0x18f6('0x19')](_0x18f6('0x1a'))[_0x18f6('0x1b')](function(_0x16e414){logger[_0x18f6('0x12')](_0x18f6('0x1c'),_0x16e414);return _0x193818['status'](0xc8)['json']({'output':_0x18f6('0x1d')});})[_0x18f6('0x1e')](function(_0x988122){logger['error'](_0x988122);return _0x193818[_0x18f6('0x10')](0x1f4)['json'](_0x988122);});};exports[_0x18f6('0x1f')]=function(_0x410eff,_0x1e2489){var _0x429aba=fs[_0x18f6('0x20')](path['join'](config[_0x18f6('0x9')],_0x18f6('0x21'),'migrations'));var _0x591300=[];for(var _0x27d996=0x0;_0x27d996<_0x429aba['length'];_0x27d996++){var _0xf9bcc0=_0x429aba[_0x27d996][_0x18f6('0x22')](_0x18f6('0x23'),'');if(compareVersions(module[_0x18f6('0xa')][_0x18f6('0x3')],_0xf9bcc0)===-0x1){_0x591300['push'](_0xf9bcc0);}}if(_0x591300['length']){var _0x10bc9d=_0x591300[_0x18f6('0x24')](compareVersions);var _0x308fd3=new Umzug({'storage':_0x18f6('0x25'),'storageOptions':{'model':db[_0x18f6('0x26')],'modelName':'Migration','columnName':_0x18f6('0x3')},'migrations':{'params':[db[_0x18f6('0x25')][_0x18f6('0x27')](),db[_0x18f6('0x25')][_0x18f6('0x28')],function(){throw new Error(_0x18f6('0x29'));}],'path':path[_0x18f6('0x2a')](config[_0x18f6('0x9')],_0x18f6('0x21'),'migrations'),'pattern':/\.js$/}});_0x308fd3['up']({'migrations':_[_0x18f6('0x2b')](_0x10bc9d,function(_0xfd2e0){return _0xfd2e0+_0x18f6('0x23');})})[_0x18f6('0x1b')](function(){return _0x1e2489['status'](0xc8)[_0x18f6('0x11')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x18f6('0xa')][_0x18f6('0x3')]+_0x18f6('0x2c')+_[_0x18f6('0x2d')](_0x10bc9d),'migrations':_[_0x18f6('0x2a')](_0x10bc9d)});})[_0x18f6('0x1e')](function(_0x1513d9){if(_0x1513d9 instanceof db[_0x18f6('0x25')][_0x18f6('0x2e')]){return _0x1e2489[_0x18f6('0x10')](0xc8)[_0x18f6('0x11')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x1e2489['status'](0x1f4)[_0x18f6('0x11')](_0x1513d9);}});}else{return _0x1e2489[_0x18f6('0x10')](0xc8)[_0x18f6('0x11')]({'output':_0x18f6('0x2f')});}};
\ No newline at end of file
+var _0xc8ff=['status','json','fetch','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','server','length','replace','.js','sort','sequelize','Migration','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/logger','update','simple-git','root','index','exports','query','tags','version','latest'];(function(_0x327901,_0x5e0a93){var _0x23c236=function(_0x206d31){while(--_0x206d31){_0x327901['push'](_0x327901['shift']());}};_0x23c236(++_0x5e0a93);}(_0xc8ff,0xcb));var _0xfc8f=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xc8ff[_0x55e08b];return _0xd1a7ff;};'use strict';var Umzug=require(_0xfc8f('0x0'));var path=require(_0xfc8f('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xfc8f('0x2'))(module,'version');var compareVersions=require(_0xfc8f('0x3'));var exec=require(_0xfc8f('0x4'))['exec'];var db=require(_0xfc8f('0x5'))['db'];var config=require(_0xfc8f('0x6'));var pm2=require('../../config/pm2');var logger=require(_0xfc8f('0x7'))(_0xfc8f('0x8'));var git=require(_0xfc8f('0x9'))(config[_0xfc8f('0xa')]);exports[_0xfc8f('0xb')]=function(_0x3f86b6,_0x143fd2){var _0x1af310={'current':module[_0xfc8f('0xc')]['version'],'phonebar':0x2};if(_0x3f86b6[_0xfc8f('0xd')]&&_0x3f86b6[_0xfc8f('0xd')]['latest']){return git['fetch']()[_0xfc8f('0xe')](function(_0x4e0543,_0x5af1b6){_0x1af310['latest']=(_0x4e0543?module[_0xfc8f('0xc')][_0xfc8f('0xf')]:_0x5af1b6[_0xfc8f('0x10')])||'2.0.0';return _0x143fd2[_0xfc8f('0x11')](0xc8)[_0xfc8f('0x12')](_0x1af310);});}else{return _0x143fd2['status'](0xc8)[_0xfc8f('0x12')](_0x1af310);}};exports[_0xfc8f('0x13')]=function(_0x3ad2b8,_0x4a784d){return git[_0xfc8f('0x13')]([_0xfc8f('0x14'),_0xfc8f('0x15')],function(_0x1e67c1){if(_0x1e67c1){logger[_0xfc8f('0x16')](_0x1e67c1);return _0x4a784d[_0xfc8f('0x11')](0x1f4)[_0xfc8f('0x12')](_0x1e67c1);}logger[_0xfc8f('0x17')](_0xfc8f('0x18'));return _0x4a784d[_0xfc8f('0x11')](0xc8)['json']({'output':_0xfc8f('0x19')});});};exports[_0xfc8f('0x1a')]=function(_0xe0822a,_0x131162){return git[_0xfc8f('0x1a')]([_0xfc8f('0x1b'),_0xfc8f('0x1c')],function(_0x4707cb){if(_0x4707cb){logger[_0xfc8f('0x16')](_0x4707cb);return _0x131162[_0xfc8f('0x11')](0x1f4)['json'](_0x4707cb);}logger['info'](_0xfc8f('0x1d'));return _0x131162[_0xfc8f('0x11')](0xc8)[_0xfc8f('0x12')]({'output':_0xfc8f('0x1e')});});};exports[_0xfc8f('0x1f')]=function(_0x51add9,_0x42fb50){exec(_0xfc8f('0x20'),function(_0x3034d9,_0x449970,_0x3c7d48){logger[_0xfc8f('0x17')](_0x449970);logger[_0xfc8f('0x17')](_0x3c7d48);if(_0x3034d9){logger[_0xfc8f('0x16')](_0x3034d9);return _0x42fb50['status'](0x1f4)[_0xfc8f('0x12')](_0x3034d9);}return _0x42fb50[_0xfc8f('0x11')](0xc8)[_0xfc8f('0x12')]({'output':_0x449970});});};exports[_0xfc8f('0x21')]=function(_0x4c0bea,_0x3821ca){return pm2[_0xfc8f('0x21')](_0xfc8f('0x22'))[_0xfc8f('0x23')](function(_0x4d52fd){logger[_0xfc8f('0x17')](_0xfc8f('0x24'),_0x4d52fd);return _0x3821ca[_0xfc8f('0x11')](0xc8)[_0xfc8f('0x12')]({'output':_0xfc8f('0x25')});})['catch'](function(_0x20f2c7){logger[_0xfc8f('0x16')](_0x20f2c7);return _0x3821ca[_0xfc8f('0x11')](0x1f4)['json'](_0x20f2c7);});};exports[_0xfc8f('0x26')]=function(_0xa064cf,_0x4b375e){var _0x42a4ca=fs[_0xfc8f('0x27')](path[_0xfc8f('0x28')](config['root'],_0xfc8f('0x29'),'migrations'));var _0x48972f=[];for(var _0x2cf368=0x0;_0x2cf368<_0x42a4ca[_0xfc8f('0x2a')];_0x2cf368++){var _0x5dac18=_0x42a4ca[_0x2cf368][_0xfc8f('0x2b')](_0xfc8f('0x2c'),'');if(compareVersions(module[_0xfc8f('0xc')][_0xfc8f('0xf')],_0x5dac18)===-0x1){_0x48972f['push'](_0x5dac18);}}if(_0x48972f[_0xfc8f('0x2a')]){var _0x143737=_0x48972f[_0xfc8f('0x2d')](compareVersions);var _0xd050a7=new Umzug({'storage':_0xfc8f('0x2e'),'storageOptions':{'model':db[_0xfc8f('0x2f')],'modelName':_0xfc8f('0x2f'),'columnName':_0xfc8f('0xf')},'migrations':{'params':[db[_0xfc8f('0x2e')][_0xfc8f('0x30')](),db[_0xfc8f('0x2e')]['constructor'],function(){throw new Error(_0xfc8f('0x31'));}],'path':path[_0xfc8f('0x28')](config[_0xfc8f('0xa')],_0xfc8f('0x29'),_0xfc8f('0x26')),'pattern':/\.js$/}});_0xd050a7['up']({'migrations':_[_0xfc8f('0x32')](_0x143737,function(_0x512c45){return _0x512c45+_0xfc8f('0x2c');})})['then'](function(){return _0x4b375e['status'](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports']['version']+_0xfc8f('0x33')+_[_0xfc8f('0x34')](_0x143737),'migrations':_[_0xfc8f('0x28')](_0x143737)});})['catch'](function(_0xcb2561){if(_0xcb2561 instanceof db[_0xfc8f('0x2e')][_0xfc8f('0x35')]){return _0x4b375e['status'](0xc8)[_0xfc8f('0x12')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x4b375e[_0xfc8f('0x11')](0x1f4)[_0xfc8f('0x12')](_0xcb2561);}});}else{return _0x4b375e[_0xfc8f('0x11')](0xc8)['json']({'output':_0xfc8f('0x36')});}};
\ No newline at end of file
index 04e7fd4..5cb4baf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x451e=['update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','put'];(function(_0x4e11d5,_0x1ce514){var _0x5e4e4c=function(_0xbee63d){while(--_0xbee63d){_0x4e11d5['push'](_0x4e11d5['shift']());}};_0x5e4e4c(++_0x1ce514);}(_0x451e,0xfe));var _0xe451=function(_0x591461,_0x1da822){_0x591461=_0x591461-0x0;var _0x2c6c2a=_0x451e[_0x591461];return _0x2c6c2a;};'use strict';var multer=require(_0xe451('0x0'));var util=require(_0xe451('0x1'));var path=require(_0xe451('0x2'));var timeout=require(_0xe451('0x3'));var express=require(_0xe451('0x4'));var router=express[_0xe451('0x5')]();var fs_extra=require(_0xe451('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xe451('0x7'));var config=require(_0xe451('0x8'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0xe451('0x9')](),controller[_0xe451('0xa')]);router['get'](_0xe451('0xb'),auth[_0xe451('0x9')](),controller[_0xe451('0xc')]);router[_0xe451('0xd')](_0xe451('0xe'),auth[_0xe451('0x9')](),controller[_0xe451('0xf')]);router[_0xe451('0x10')]('/',auth[_0xe451('0x9')](),controller[_0xe451('0x11')]);router[_0xe451('0x12')](_0xe451('0xe'),auth['isAuthenticated'](),controller[_0xe451('0x13')]);router['delete']('/:id',auth[_0xe451('0x9')](),controller[_0xe451('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x291d=['put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0x31b050,_0x123673){var _0x1129e5=function(_0x3c422d){while(--_0x3c422d){_0x31b050['push'](_0x31b050['shift']());}};_0x1129e5(++_0x123673);}(_0x291d,0x1d1));var _0xd291=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x291d[_0x266618];return _0x54dbf5;};'use strict';var multer=require('multer');var util=require(_0xd291('0x0'));var path=require(_0xd291('0x1'));var timeout=require(_0xd291('0x2'));var express=require(_0xd291('0x3'));var router=express['Router']();var fs_extra=require(_0xd291('0x4'));var auth=require(_0xd291('0x5'));var interaction=require(_0xd291('0x6'));var config=require(_0xd291('0x7'));var controller=require(_0xd291('0x8'));router[_0xd291('0x9')]('/',auth[_0xd291('0xa')](),controller[_0xd291('0xb')]);router['get']('/describe',auth[_0xd291('0xa')](),controller[_0xd291('0xc')]);router[_0xd291('0x9')](_0xd291('0xd'),auth[_0xd291('0xa')](),controller[_0xd291('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd291('0xf')](_0xd291('0xd'),auth[_0xd291('0xa')](),controller[_0xd291('0x10')]);router[_0xd291('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xd291('0x12')]);module[_0xd291('0x13')]=router;
\ No newline at end of file
index 0cf7e59..90d9812 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6db4=['DATE','INTEGER','BOOLEAN','exports','STRING'];(function(_0x3a389a,_0x518996){var _0x3e9615=function(_0x34a3e8){while(--_0x34a3e8){_0x3a389a['push'](_0x3a389a['shift']());}};_0x3e9615(++_0x518996);}(_0x6db4,0x111));var _0x46db=function(_0x28bf65,_0x5b4844){_0x28bf65=_0x28bf65-0x0;var _0x29d9c4=_0x6db4[_0x28bf65];return _0x29d9c4;};'use strict';var Sequelize=require('sequelize');module[_0x46db('0x0')]={'type':{'type':Sequelize[_0x46db('0x1')]},'uniqueid':{'type':Sequelize[_0x46db('0x1')]},'calleridnum':{'type':Sequelize[_0x46db('0x1')]},'calleridname':{'type':Sequelize[_0x46db('0x1')]},'queue':{'type':Sequelize[_0x46db('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x46db('0x1')]},'agentcalledAt':{'type':Sequelize[_0x46db('0x2')]},'agentconnectAt':{'type':Sequelize[_0x46db('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x46db('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x46db('0x2')]},'agentdumpAt':{'type':Sequelize[_0x46db('0x2')]},'holdtime':{'type':Sequelize[_0x46db('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x46db('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x46db('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x46db('0x3')]},'agentacw':{'type':Sequelize[_0x46db('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x46db('0x3')]},'reason':{'type':Sequelize[_0x46db('0x1')]},'lastevent':{'type':Sequelize[_0x46db('0x1')]},'channel':{'type':Sequelize[_0x46db('0x1')]},'channelstate':{'type':Sequelize[_0x46db('0x3')]},'channelstatedesc':{'type':Sequelize[_0x46db('0x1')]},'connectedlinenum':{'type':Sequelize[_0x46db('0x1')]},'connectedlinename':{'type':Sequelize[_0x46db('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x46db('0x1')]},'context':{'type':Sequelize[_0x46db('0x1')]},'exten':{'type':Sequelize[_0x46db('0x1')]},'priority':{'type':Sequelize[_0x46db('0x1')]},'destchannel':{'type':Sequelize[_0x46db('0x1')]},'destchannelstate':{'type':Sequelize[_0x46db('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x46db('0x1')]},'destcalleridnum':{'type':Sequelize[_0x46db('0x1')]},'destcalleridname':{'type':Sequelize[_0x46db('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x46db('0x1')]},'destcontext':{'type':Sequelize[_0x46db('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x46db('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x46db('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x46db('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x46db('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x46db('0x1')]},'transferuniqueid':{'type':Sequelize[_0x46db('0x1')]},'agententerreason':{'type':Sequelize[_0x46db('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x1a37=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x2696f1,_0x7de5e4){var _0x3e5706=function(_0xfcb99e){while(--_0xfcb99e){_0x2696f1['push'](_0x2696f1['shift']());}};_0x3e5706(++_0x7de5e4);}(_0x1a37,0xb4));var _0x71a3=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x1a37[_0x409353];return _0x4f4b59;};'use strict';var Sequelize=require(_0x71a3('0x0'));module[_0x71a3('0x1')]={'type':{'type':Sequelize[_0x71a3('0x2')]},'uniqueid':{'type':Sequelize[_0x71a3('0x2')]},'calleridnum':{'type':Sequelize[_0x71a3('0x2')]},'calleridname':{'type':Sequelize[_0x71a3('0x2')]},'queue':{'type':Sequelize[_0x71a3('0x2')]},'interface':{'type':Sequelize[_0x71a3('0x2')]},'membername':{'type':Sequelize[_0x71a3('0x2')]},'agentcalledAt':{'type':Sequelize[_0x71a3('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x71a3('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x71a3('0x3')]},'holdtime':{'type':Sequelize[_0x71a3('0x4')]},'agentcomplete':{'type':Sequelize[_0x71a3('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x71a3('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x71a3('0x2')]},'lastevent':{'type':Sequelize[_0x71a3('0x2')]},'channel':{'type':Sequelize[_0x71a3('0x2')]},'channelstate':{'type':Sequelize[_0x71a3('0x4')]},'channelstatedesc':{'type':Sequelize[_0x71a3('0x2')]},'connectedlinenum':{'type':Sequelize[_0x71a3('0x2')]},'connectedlinename':{'type':Sequelize[_0x71a3('0x2')]},'language':{'type':Sequelize[_0x71a3('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x71a3('0x2')]},'destchannel':{'type':Sequelize[_0x71a3('0x2')]},'destchannelstate':{'type':Sequelize[_0x71a3('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x71a3('0x2')]},'destcalleridnum':{'type':Sequelize[_0x71a3('0x2')]},'destcalleridname':{'type':Sequelize[_0x71a3('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x71a3('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x71a3('0x2')]},'destlanguage':{'type':Sequelize[_0x71a3('0x2')]},'destaccountcode':{'type':Sequelize[_0x71a3('0x2')]},'destcontext':{'type':Sequelize[_0x71a3('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x71a3('0x2')]},'destuniqueid':{'type':Sequelize[_0x71a3('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x71a3('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x71a3('0x2')],'comment':_0x71a3('0x6')},'transferexten':{'type':Sequelize[_0x71a3('0x2')]},'transferuniqueid':{'type':Sequelize[_0x71a3('0x2')]},'agententerreason':{'type':Sequelize[_0x71a3('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 39c4d0f..79fbbd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};
\ No newline at end of file
+var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};
\ No newline at end of file
index ea3a9b5..6f94220 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b83=['./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x4c367b,_0x2f749e){var _0x122fcb=function(_0x43d063){while(--_0x43d063){_0x4c367b['push'](_0x4c367b['shift']());}};_0x122fcb(++_0x2f749e);}(_0x2b83,0x1d3));var _0x32b8=function(_0x56afc2,_0x4d3146){_0x56afc2=_0x56afc2-0x0;var _0x50b7f5=_0x2b83[_0x56afc2];return _0x50b7f5;};'use strict';var _=require('lodash');var util=require(_0x32b8('0x0'));var logger=require(_0x32b8('0x1'))('api');var moment=require(_0x32b8('0x2'));var BPromise=require(_0x32b8('0x3'));var rp=require(_0x32b8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x32b8('0x5'));var attributes=require(_0x32b8('0x6'));module['exports']=function(_0x6bbc3d,_0x55abd0){return _0x6bbc3d[_0x32b8('0x7')](_0x32b8('0x8'),attributes,{'tableName':_0x32b8('0x9'),'paranoid':![],'indexes':[{'fields':[_0x32b8('0xa'),'destuniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0dee=['rimraf','../../config/environment','./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','destuniqueid','lodash','util','api','bluebird','request-promise'];(function(_0x3417ac,_0x49e622){var _0x9e1f0e=function(_0x5e1d66){while(--_0x5e1d66){_0x3417ac['push'](_0x3417ac['shift']());}};_0x9e1f0e(++_0x49e622);}(_0x0dee,0xf7));var _0xe0de=function(_0x239257,_0x5710d4){_0x239257=_0x239257-0x0;var _0x39213a=_0x0dee[_0x239257];return _0x39213a;};'use strict';var _=require(_0xe0de('0x0'));var util=require(_0xe0de('0x1'));var logger=require('../../config/logger')(_0xe0de('0x2'));var moment=require('moment');var BPromise=require(_0xe0de('0x3'));var rp=require(_0xe0de('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe0de('0x5'));var config=require(_0xe0de('0x6'));var attributes=require(_0xe0de('0x7'));module['exports']=function(_0x2fc94c,_0x4957d7){return _0x2fc94c[_0xe0de('0x8')](_0xe0de('0x9'),attributes,{'tableName':_0xe0de('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xe0de('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 1051651..b09dbd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bf7=['stringify','code','VoiceAgentReport,\x20%s,\x20%s','message','error','CreateVoiceAgentReport','body','options','raw','catch','UpdateVoiceAgentReport','VoiceAgentReport','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x2077be,_0x26136a){var _0x198bbf=function(_0x2fd7e3){while(--_0x2fd7e3){_0x2077be['push'](_0x2077be['shift']());}};_0x198bbf(++_0x26136a);}(_0x9bf7,0x8b));var _0x79bf=function(_0xf840e5,_0x5c99d6){_0xf840e5=_0xf840e5-0x0;var _0x2c7bc3=_0x9bf7[_0xf840e5];return _0x2c7bc3;};'use strict';var _=require(_0x79bf('0x0'));var util=require(_0x79bf('0x1'));var moment=require(_0x79bf('0x2'));var BPromise=require(_0x79bf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x79bf('0x4'));var db=require(_0x79bf('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x79bf('0x6'));var config=require(_0x79bf('0x7'));var jayson=require(_0x79bf('0x8'));var client=jayson[_0x79bf('0x9')][_0x79bf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3201bb,_0x7a7b83,_0xc7d5d6){return new BPromise(function(_0x34cd99,_0x1cad84){return client[_0x79bf('0xb')](_0x3201bb,_0xc7d5d6)[_0x79bf('0xc')](function(_0x510bcb){logger[_0x79bf('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x7a7b83,_0x79bf('0xe'));logger[_0x79bf('0xf')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x7a7b83,_0x79bf('0xe'),JSON[_0x79bf('0x10')](_0x510bcb));if(_0x510bcb['error']){if(_0x510bcb['error'][_0x79bf('0x11')]===0x1f4){logger['error'](_0x79bf('0x12'),_0x7a7b83,_0x510bcb['error'][_0x79bf('0x13')]);return _0x1cad84(_0x510bcb['error']['message']);}logger[_0x79bf('0x14')]('VoiceAgentReport,\x20%s,\x20%s',_0x7a7b83,_0x510bcb[_0x79bf('0x14')]['message']);return _0x34cd99(_0x510bcb[_0x79bf('0x14')]['message']);}else{logger[_0x79bf('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x7a7b83,_0x79bf('0xe'));_0x34cd99(_0x510bcb['result']['message']);}})['catch'](function(_0x2b7106){logger['error'](_0x79bf('0x12'),_0x7a7b83,_0x2b7106);_0x1cad84(_0x2b7106);});});}exports[_0x79bf('0x15')]=function(_0x4a7cb6){var _0x131244=this;return new Promise(function(_0x28d413,_0x518ed4){return db['VoiceAgentReport']['create'](_0x4a7cb6[_0x79bf('0x16')],{'raw':_0x4a7cb6['options']?_0x4a7cb6[_0x79bf('0x17')][_0x79bf('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x1ef85f){logger[_0x79bf('0xd')](_0x79bf('0x15'),_0x4a7cb6);logger[_0x79bf('0xf')](_0x79bf('0x15'),_0x4a7cb6,JSON[_0x79bf('0x10')](_0x1ef85f));_0x28d413(_0x1ef85f);})[_0x79bf('0x19')](function(_0x53dd11){logger[_0x79bf('0x14')](_0x79bf('0x15'),_0x53dd11[_0x79bf('0x13')],_0x4a7cb6);_0x518ed4(_0x131244['error'](0x1f4,_0x53dd11['message']));});});};exports[_0x79bf('0x1a')]=function(_0x21dcca){var _0x28f796=this;return new Promise(function(_0x4d6151,_0x734e63){return db[_0x79bf('0x1b')]['update'](_0x21dcca['body'],{'raw':_0x21dcca[_0x79bf('0x17')]?_0x21dcca[_0x79bf('0x17')][_0x79bf('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21dcca[_0x79bf('0x17')]?_0x21dcca[_0x79bf('0x17')][_0x79bf('0x1c')]||null:null,'attributes':_0x21dcca[_0x79bf('0x17')]?_0x21dcca['options'][_0x79bf('0x1d')]||null:null,'limit':_0x21dcca['options']?_0x21dcca['options'][_0x79bf('0x1e')]||null:null})[_0x79bf('0xc')](function(_0x2c9cb7){logger[_0x79bf('0xd')]('UpdateVoiceAgentReport',_0x21dcca);logger['debug']('UpdateVoiceAgentReport',_0x21dcca,JSON[_0x79bf('0x10')](_0x2c9cb7));_0x4d6151(_0x2c9cb7);})[_0x79bf('0x19')](function(_0x596684){logger['error'](_0x79bf('0x1a'),_0x596684[_0x79bf('0x13')],_0x21dcca);_0x734e63(_0x28f796['error'](0x1f4,_0x596684['message']));});});};
\ No newline at end of file
+var _0x4f17=['debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','CreateVoiceAgentReport','VoiceAgentReport','options','raw','stringify','catch','UpdateVoiceAgentReport','update','body','where','attributes','limit','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','VoiceAgentReport,\x20%s,\x20%s'];(function(_0x467488,_0x38c7ae){var _0x56107f=function(_0x4992b3){while(--_0x4992b3){_0x467488['push'](_0x467488['shift']());}};_0x56107f(++_0x38c7ae);}(_0x4f17,0x1c5));var _0x74f1=function(_0x3ecf65,_0x3bac13){_0x3ecf65=_0x3ecf65-0x0;var _0x1907df=_0x4f17[_0x3ecf65];return _0x1907df;};'use strict';var _=require(_0x74f1('0x0'));var util=require('util');var moment=require(_0x74f1('0x1'));var BPromise=require('bluebird');var rs=require(_0x74f1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x74f1('0x3'));var logger=require(_0x74f1('0x4'))(_0x74f1('0x5'));var config=require('../../config/environment');var jayson=require(_0x74f1('0x6'));var client=jayson[_0x74f1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c5939,_0x3461d1,_0x242007){return new BPromise(function(_0x28b1fb,_0x1dc01b){return client['request'](_0x5c5939,_0x242007)[_0x74f1('0x8')](function(_0x458597){logger[_0x74f1('0x9')](_0x74f1('0xa'),_0x3461d1,'request\x20sent');logger[_0x74f1('0xb')](_0x74f1('0xc'),_0x3461d1,_0x74f1('0xd'),JSON['stringify'](_0x458597));if(_0x458597[_0x74f1('0xe')]){if(_0x458597[_0x74f1('0xe')][_0x74f1('0xf')]===0x1f4){logger['error'](_0x74f1('0xa'),_0x3461d1,_0x458597[_0x74f1('0xe')][_0x74f1('0x10')]);return _0x1dc01b(_0x458597[_0x74f1('0xe')][_0x74f1('0x10')]);}logger[_0x74f1('0xe')](_0x74f1('0xa'),_0x3461d1,_0x458597[_0x74f1('0xe')][_0x74f1('0x10')]);return _0x28b1fb(_0x458597[_0x74f1('0xe')][_0x74f1('0x10')]);}else{logger[_0x74f1('0x9')](_0x74f1('0xa'),_0x3461d1,_0x74f1('0xd'));_0x28b1fb(_0x458597['result'][_0x74f1('0x10')]);}})['catch'](function(_0x4e61e8){logger[_0x74f1('0xe')](_0x74f1('0xa'),_0x3461d1,_0x4e61e8);_0x1dc01b(_0x4e61e8);});});}exports[_0x74f1('0x11')]=function(_0xa485d8){var _0x2806e8=this;return new Promise(function(_0x56aaf7,_0x68e1cd){return db[_0x74f1('0x12')]['create'](_0xa485d8['body'],{'raw':_0xa485d8['options']?_0xa485d8[_0x74f1('0x13')][_0x74f1('0x14')]===undefined?!![]:![]:!![]})[_0x74f1('0x8')](function(_0x15a91f){logger[_0x74f1('0x9')](_0x74f1('0x11'),_0xa485d8);logger[_0x74f1('0xb')](_0x74f1('0x11'),_0xa485d8,JSON[_0x74f1('0x15')](_0x15a91f));_0x56aaf7(_0x15a91f);})[_0x74f1('0x16')](function(_0xad1612){logger['error']('CreateVoiceAgentReport',_0xad1612[_0x74f1('0x10')],_0xa485d8);_0x68e1cd(_0x2806e8['error'](0x1f4,_0xad1612[_0x74f1('0x10')]));});});};exports[_0x74f1('0x17')]=function(_0x13c127){var _0x48a872=this;return new Promise(function(_0x48b8b0,_0x207290){return db['VoiceAgentReport'][_0x74f1('0x18')](_0x13c127[_0x74f1('0x19')],{'raw':_0x13c127[_0x74f1('0x13')]?_0x13c127['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13c127['options']?_0x13c127[_0x74f1('0x13')][_0x74f1('0x1a')]||null:null,'attributes':_0x13c127[_0x74f1('0x13')]?_0x13c127[_0x74f1('0x13')][_0x74f1('0x1b')]||null:null,'limit':_0x13c127[_0x74f1('0x13')]?_0x13c127[_0x74f1('0x13')][_0x74f1('0x1c')]||null:null})[_0x74f1('0x8')](function(_0x24851f){logger[_0x74f1('0x9')]('UpdateVoiceAgentReport',_0x13c127);logger[_0x74f1('0xb')]('UpdateVoiceAgentReport',_0x13c127,JSON[_0x74f1('0x15')](_0x24851f));_0x48b8b0(_0x24851f);})[_0x74f1('0x16')](function(_0x32c4f8){logger['error'](_0x74f1('0x17'),_0x32c4f8['message'],_0x13c127);_0x207290(_0x48a872[_0x74f1('0xe')](0x1f4,_0x32c4f8[_0x74f1('0x10')]));});});};
\ No newline at end of file
index 9cf5b75..06f8b0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b67=['../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','destroy','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x22a4cd,_0x34a46e){var _0x2b1903=function(_0x51c15d){while(--_0x51c15d){_0x22a4cd['push'](_0x22a4cd['shift']());}};_0x2b1903(++_0x34a46e);}(_0x9b67,0xf6));var _0x79b6=function(_0x87c2f4,_0x5bf82f){_0x87c2f4=_0x87c2f4-0x0;var _0x30851a=_0x9b67[_0x87c2f4];return _0x30851a;};'use strict';var multer=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var path=require(_0x79b6('0x2'));var timeout=require(_0x79b6('0x3'));var express=require(_0x79b6('0x4'));var router=express['Router']();var fs_extra=require(_0x79b6('0x5'));var auth=require(_0x79b6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x79b6('0x7'));router[_0x79b6('0x8')]('/',auth[_0x79b6('0x9')](),controller[_0x79b6('0xa')]);router[_0x79b6('0x8')](_0x79b6('0xb'),auth[_0x79b6('0x9')](),controller['describe']);router[_0x79b6('0x8')](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller[_0x79b6('0xd')]);router[_0x79b6('0xe')]('/',auth['isAuthenticated'](),controller[_0x79b6('0xf')]);router[_0x79b6('0x10')](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller['update']);router['delete'](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller[_0x79b6('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xee14=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','path'];(function(_0x32c159,_0x5231f2){var _0x4121f4=function(_0x50cea5){while(--_0x50cea5){_0x32c159['push'](_0x32c159['shift']());}};_0x4121f4(++_0x5231f2);}(_0xee14,0x13a));var _0x4ee1=function(_0x99f3d3,_0x50d43a){_0x99f3d3=_0x99f3d3-0x0;var _0x13ffa9=_0xee14[_0x99f3d3];return _0x13ffa9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ee1('0x0'));var timeout=require(_0x4ee1('0x1'));var express=require(_0x4ee1('0x2'));var router=express[_0x4ee1('0x3')]();var fs_extra=require(_0x4ee1('0x4'));var auth=require(_0x4ee1('0x5'));var interaction=require(_0x4ee1('0x6'));var config=require(_0x4ee1('0x7'));var controller=require(_0x4ee1('0x8'));router['get']('/',auth[_0x4ee1('0x9')](),controller['index']);router[_0x4ee1('0xa')](_0x4ee1('0xb'),auth[_0x4ee1('0x9')](),controller[_0x4ee1('0xc')]);router[_0x4ee1('0xa')](_0x4ee1('0xd'),auth['isAuthenticated'](),controller[_0x4ee1('0xe')]);router[_0x4ee1('0xf')]('/',auth['isAuthenticated'](),controller[_0x4ee1('0x10')]);router[_0x4ee1('0x11')](_0x4ee1('0xd'),auth[_0x4ee1('0x9')](),controller['update']);router[_0x4ee1('0x12')](_0x4ee1('0xd'),auth[_0x4ee1('0x9')](),controller[_0x4ee1('0x13')]);module[_0x4ee1('0x14')]=router;
\ No newline at end of file
index 947db94..0effa86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb65=['internal','outbound','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0xbe0bad,_0x242e22){var _0x2a18cc=function(_0x17f8ff){while(--_0x17f8ff){_0xbe0bad['push'](_0xbe0bad['shift']());}};_0x2a18cc(++_0x242e22);}(_0xfb65,0xb7));var _0x5fb6=function(_0x493a97,_0x50a93e){_0x493a97=_0x493a97-0x0;var _0x51f171=_0xfb65[_0x493a97];return _0x51f171;};'use strict';var Sequelize=require(_0x5fb6('0x0'));module[_0x5fb6('0x1')]={'uniqueid':{'type':Sequelize[_0x5fb6('0x2')]},'type':{'type':Sequelize[_0x5fb6('0x3')]('inbound',_0x5fb6('0x4'),_0x5fb6('0x5'),'inbound-fax',_0x5fb6('0x6'),_0x5fb6('0x7'))},'tag':{'type':Sequelize[_0x5fb6('0x2')]},'accountcode':{'type':Sequelize[_0x5fb6('0x2')]},'source':{'type':Sequelize[_0x5fb6('0x2')]},'destination':{'type':Sequelize[_0x5fb6('0x2')]},'destinationcontext':{'type':Sequelize[_0x5fb6('0x2')]},'callerid':{'type':Sequelize[_0x5fb6('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x5fb6('0x2')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x5fb6('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x5fb6('0x9')]},'answertime':{'type':Sequelize[_0x5fb6('0x9')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x5fb6('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5fb6('0x2')]},'amaflags':{'type':Sequelize[_0x5fb6('0x2')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x5fb6('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x5fb6('0x2')]},'note':{'type':Sequelize[_0x5fb6('0x2')]},'prefix':{'type':Sequelize[_0x5fb6('0x2')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x5fb6('0x2')]}};
\ No newline at end of file
+var _0x4893=['dialer','STRING','TEXT','DATE','INTEGER','sequelize','exports','ENUM','internal','outbound','inbound-fax'];(function(_0x2bff9c,_0xe5758){var _0x24ca0b=function(_0x20223a){while(--_0x20223a){_0x2bff9c['push'](_0x2bff9c['shift']());}};_0x24ca0b(++_0xe5758);}(_0x4893,0x118));var _0x3489=function(_0x7b5cdd,_0x8c88d8){_0x7b5cdd=_0x7b5cdd-0x0;var _0x3a29ae=_0x4893[_0x7b5cdd];return _0x3a29ae;};'use strict';var Sequelize=require(_0x3489('0x0'));module[_0x3489('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3489('0x2')]('inbound',_0x3489('0x3'),_0x3489('0x4'),_0x3489('0x5'),'outbound-fax',_0x3489('0x6'))},'tag':{'type':Sequelize[_0x3489('0x7')]},'accountcode':{'type':Sequelize[_0x3489('0x7')]},'source':{'type':Sequelize[_0x3489('0x7')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x3489('0x7')]},'channel':{'type':Sequelize[_0x3489('0x7')]},'destinationchannel':{'type':Sequelize[_0x3489('0x7')]},'lastapplication':{'type':Sequelize[_0x3489('0x7')]},'lastdata':{'type':Sequelize[_0x3489('0x8')]},'starttime':{'type':Sequelize[_0x3489('0x9')]},'systemanswertime':{'type':Sequelize[_0x3489('0x9')]},'answertime':{'type':Sequelize[_0x3489('0x9')]},'endtime':{'type':Sequelize[_0x3489('0x9')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x3489('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3489('0x7')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x3489('0x7')]},'userThirdDisposition':{'type':Sequelize[_0x3489('0x7')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x3489('0xa')]},'sipcallid':{'type':Sequelize[_0x3489('0x7')]}};
\ No newline at end of file
index 54ed374..a8a9674 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x2be96a,_0x1278d3){_0x2be96a=_0x2be96a-0x0;var _0x247f2a=_0x2032[_0x2be96a];return _0x247f2a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));};
\ No newline at end of file
+var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x5e1b91,_0x236f17){var _0x59b52f=function(_0x5c05ed){while(--_0x5c05ed){_0x5e1b91['push'](_0x5e1b91['shift']());}};_0x59b52f(++_0x236f17);}(_0xadb5,0xad));var _0x5adb=function(_0x52ef08,_0x479c91){_0x52ef08=_0x52ef08-0x0;var _0x184c2f=_0xadb5[_0x52ef08];return _0x184c2f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));};
\ No newline at end of file
index 946505b..1ed080b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0360=['../../config/environment','exports','define','VoiceCallReport','report_call','lodash','api','moment','request-promise','path','rimraf'];(function(_0x29e35f,_0x4859ef){var _0x266b74=function(_0xc09e1){while(--_0xc09e1){_0x29e35f['push'](_0x29e35f['shift']());}};_0x266b74(++_0x4859ef);}(_0x0360,0x15a));var _0x0036=function(_0x2ce444,_0x4924dd){_0x2ce444=_0x2ce444-0x0;var _0x8f4d15=_0x0360[_0x2ce444];return _0x8f4d15;};'use strict';var _=require(_0x0036('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0036('0x1'));var moment=require(_0x0036('0x2'));var BPromise=require('bluebird');var rp=require(_0x0036('0x3'));var fs=require('fs');var path=require(_0x0036('0x4'));var rimraf=require(_0x0036('0x5'));var config=require(_0x0036('0x6'));var attributes=require('./voiceCallReport.attributes');module[_0x0036('0x7')]=function(_0x40737b,_0xa6a9f4){return _0x40737b[_0x0036('0x8')](_0x0036('0x9'),attributes,{'tableName':_0x0036('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6244=['rimraf','../../config/environment','./voiceCallReport.attributes','exports','uniqueid','lodash','util','../../config/logger','moment','request-promise'];(function(_0x4867a6,_0x2ffd52){var _0x358e95=function(_0x526fa4){while(--_0x526fa4){_0x4867a6['push'](_0x4867a6['shift']());}};_0x358e95(++_0x2ffd52);}(_0x6244,0xcd));var _0x4624=function(_0x5e07cb,_0x1f98cd){_0x5e07cb=_0x5e07cb-0x0;var _0x21c56f=_0x6244[_0x5e07cb];return _0x21c56f;};'use strict';var _=require(_0x4624('0x0'));var util=require(_0x4624('0x1'));var logger=require(_0x4624('0x2'))('api');var moment=require(_0x4624('0x3'));var BPromise=require('bluebird');var rp=require(_0x4624('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4624('0x5'));var config=require(_0x4624('0x6'));var attributes=require(_0x4624('0x7'));module[_0x4624('0x8')]=function(_0x29c671,_0x2bc8a4){return _0x29c671['define']('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x4624('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 0c9f664..e5c29f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cfa=['../../config/environment','jayson/promise','client','http','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','options','raw','where','limit','map','include','attributes','model','then','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3557d0,_0x39f204){var _0x38d56c=function(_0x5a582e){while(--_0x5a582e){_0x3557d0['push'](_0x3557d0['shift']());}};_0x38d56c(++_0x39f204);}(_0x5cfa,0x11a));var _0xa5cf=function(_0x3d7793,_0x4ac936){_0x3d7793=_0x3d7793-0x0;var _0x30da47=_0x5cfa[_0x3d7793];return _0x30da47;};'use strict';var _=require('lodash');var util=require(_0xa5cf('0x0'));var moment=require('moment');var BPromise=require(_0xa5cf('0x1'));var rs=require(_0xa5cf('0x2'));var fs=require('fs');var Redis=require(_0xa5cf('0x3'));var db=require(_0xa5cf('0x4'))['db'];var utils=require(_0xa5cf('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa5cf('0x6'));var jayson=require(_0xa5cf('0x7'));var client=jayson[_0xa5cf('0x8')][_0xa5cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x184f98,_0x15336d,_0x9eaf46){return new BPromise(function(_0x171230,_0x7c5f51){return client['request'](_0x184f98,_0x9eaf46)['then'](function(_0x4c7cb2){logger[_0xa5cf('0xa')](_0xa5cf('0xb'),_0x15336d,_0xa5cf('0xc'));logger[_0xa5cf('0xd')](_0xa5cf('0xe'),_0x15336d,'request\x20sent',JSON[_0xa5cf('0xf')](_0x4c7cb2));if(_0x4c7cb2[_0xa5cf('0x10')]){if(_0x4c7cb2[_0xa5cf('0x10')][_0xa5cf('0x11')]===0x1f4){logger['error'](_0xa5cf('0xb'),_0x15336d,_0x4c7cb2[_0xa5cf('0x10')][_0xa5cf('0x12')]);return _0x7c5f51(_0x4c7cb2[_0xa5cf('0x10')][_0xa5cf('0x12')]);}logger['error'](_0xa5cf('0xb'),_0x15336d,_0x4c7cb2['error'][_0xa5cf('0x12')]);return _0x171230(_0x4c7cb2['error'][_0xa5cf('0x12')]);}else{logger[_0xa5cf('0xa')](_0xa5cf('0xb'),_0x15336d,_0xa5cf('0xc'));_0x171230(_0x4c7cb2[_0xa5cf('0x13')][_0xa5cf('0x12')]);}})[_0xa5cf('0x14')](function(_0x1c1ec6){logger[_0xa5cf('0x10')](_0xa5cf('0xb'),_0x15336d,_0x1c1ec6);_0x7c5f51(_0x1c1ec6);});});}exports[_0xa5cf('0x15')]=function(_0x3fce58){var _0x4f2d1b=this;return new Promise(function(_0x30de23,_0x49a4da){return db[_0xa5cf('0x16')]['findAll']({'raw':_0x3fce58[_0xa5cf('0x17')]?_0x3fce58[_0xa5cf('0x17')][_0xa5cf('0x18')]===undefined?!![]:![]:!![],'where':_0x3fce58['options']?_0x3fce58[_0xa5cf('0x17')][_0xa5cf('0x19')]||null:null,'attributes':_0x3fce58[_0xa5cf('0x17')]?_0x3fce58[_0xa5cf('0x17')]['attributes']||null:null,'limit':_0x3fce58[_0xa5cf('0x17')]?_0x3fce58[_0xa5cf('0x17')][_0xa5cf('0x1a')]||null:null,'include':_0x3fce58[_0xa5cf('0x17')]?_0x3fce58[_0xa5cf('0x17')]['include']?_[_0xa5cf('0x1b')](_0x3fce58[_0xa5cf('0x17')][_0xa5cf('0x1c')],function(_0x113ff2){return{'model':db[_0x113ff2['model']],'as':_0x113ff2['as'],'attributes':_0x113ff2[_0xa5cf('0x1d')],'include':_0x113ff2[_0xa5cf('0x1c')]?_[_0xa5cf('0x1b')](_0x113ff2[_0xa5cf('0x1c')],function(_0xa41053){return{'model':db[_0xa41053['model']],'as':_0xa41053['as'],'attributes':_0xa41053['attributes'],'include':_0xa41053[_0xa5cf('0x1c')]?_[_0xa5cf('0x1b')](_0xa41053[_0xa5cf('0x1c')],function(_0x15174d){return{'model':db[_0x15174d[_0xa5cf('0x1e')]],'as':_0x15174d['as'],'attributes':_0x15174d[_0xa5cf('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa5cf('0x1f')](function(_0x4b1105){logger[_0xa5cf('0xa')](_0xa5cf('0x15'),_0x3fce58);logger[_0xa5cf('0xd')]('GetVoiceCallReport',_0x3fce58,JSON['stringify'](_0x4b1105));_0x30de23(_0x4b1105);})['catch'](function(_0x40d3e2){logger['error'](_0xa5cf('0x15'),_0x40d3e2[_0xa5cf('0x12')],_0x3fce58);_0x49a4da(_0x4f2d1b[_0xa5cf('0x10')](0x1f4,_0x40d3e2[_0xa5cf('0x12')]));});});};exports[_0xa5cf('0x20')]=function(_0x369925){var _0x15c961=this;return new Promise(function(_0x285186,_0x25908c){return db[_0xa5cf('0x16')][_0xa5cf('0x21')](_0x369925[_0xa5cf('0x22')],{'raw':_0x369925[_0xa5cf('0x17')]?_0x369925[_0xa5cf('0x17')][_0xa5cf('0x18')]===undefined?!![]:![]:!![]})[_0xa5cf('0x1f')](function(_0x341d62){logger['info'](_0xa5cf('0x20'),_0x369925);logger[_0xa5cf('0xd')](_0xa5cf('0x20'),_0x369925,JSON[_0xa5cf('0xf')](_0x341d62));_0x285186(_0x341d62);})[_0xa5cf('0x14')](function(_0x5f5118){logger[_0xa5cf('0x10')](_0xa5cf('0x20'),_0x5f5118['message'],_0x369925);_0x25908c(_0x15c961[_0xa5cf('0x10')](0x1f4,_0x5f5118[_0xa5cf('0x12')]));});});};exports[_0xa5cf('0x23')]=function(_0x51f0ab){var _0x186975=this;return new Promise(function(_0x16564b,_0x56d044){return db['VoiceCallReport']['update'](_0x51f0ab[_0xa5cf('0x22')],{'raw':_0x51f0ab['options']?_0x51f0ab['options'][_0xa5cf('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51f0ab[_0xa5cf('0x17')]?_0x51f0ab[_0xa5cf('0x17')][_0xa5cf('0x19')]||null:null,'attributes':_0x51f0ab[_0xa5cf('0x17')]?_0x51f0ab['options'][_0xa5cf('0x1d')]||null:null,'limit':_0x51f0ab['options']?_0x51f0ab[_0xa5cf('0x17')][_0xa5cf('0x1a')]||null:null})[_0xa5cf('0x1f')](function(_0x3ad7b1){logger[_0xa5cf('0xa')](_0xa5cf('0x23'),_0x51f0ab);logger[_0xa5cf('0xd')](_0xa5cf('0x23'),_0x51f0ab,JSON[_0xa5cf('0xf')](_0x3ad7b1));_0x16564b(_0x3ad7b1);})[_0xa5cf('0x14')](function(_0x1fa551){logger['error'](_0xa5cf('0x23'),_0x1fa551[_0xa5cf('0x12')],_0x51f0ab);_0x56d044(_0x186975['error'](0x1f4,_0x1fa551['message']));});});};
\ No newline at end of file
+var _0xafcb=['GetVoiceCallReport','CreateVoiceCallReport','UpdateVoiceCallReport','update','body','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x5e5820,_0x5e4cfd){var _0x2f7654=function(_0x510682){while(--_0x510682){_0x5e5820['push'](_0x5e5820['shift']());}};_0x2f7654(++_0x5e4cfd);}(_0xafcb,0x108));var _0xbafc=function(_0x13407f,_0x4d434b){_0x13407f=_0x13407f-0x0;var _0x447615=_0xafcb[_0x13407f];return _0x447615;};'use strict';var _=require(_0xbafc('0x0'));var util=require(_0xbafc('0x1'));var moment=require(_0xbafc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbafc('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbafc('0x4'))(_0xbafc('0x5'));var config=require(_0xbafc('0x6'));var jayson=require(_0xbafc('0x7'));var client=jayson[_0xbafc('0x8')][_0xbafc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d364f,_0x39cf06,_0x1ef84b){return new BPromise(function(_0x1fb99f,_0xad501b){return client[_0xbafc('0xa')](_0x1d364f,_0x1ef84b)[_0xbafc('0xb')](function(_0x235b63){logger['info'](_0xbafc('0xc'),_0x39cf06,_0xbafc('0xd'));logger[_0xbafc('0xe')](_0xbafc('0xf'),_0x39cf06,_0xbafc('0xd'),JSON[_0xbafc('0x10')](_0x235b63));if(_0x235b63[_0xbafc('0x11')]){if(_0x235b63[_0xbafc('0x11')][_0xbafc('0x12')]===0x1f4){logger['error'](_0xbafc('0xc'),_0x39cf06,_0x235b63[_0xbafc('0x11')][_0xbafc('0x13')]);return _0xad501b(_0x235b63['error']['message']);}logger['error'](_0xbafc('0xc'),_0x39cf06,_0x235b63[_0xbafc('0x11')][_0xbafc('0x13')]);return _0x1fb99f(_0x235b63['error'][_0xbafc('0x13')]);}else{logger[_0xbafc('0x14')]('VoiceCallReport,\x20%s,\x20%s',_0x39cf06,_0xbafc('0xd'));_0x1fb99f(_0x235b63['result'][_0xbafc('0x13')]);}})[_0xbafc('0x15')](function(_0x2785cd){logger[_0xbafc('0x11')](_0xbafc('0xc'),_0x39cf06,_0x2785cd);_0xad501b(_0x2785cd);});});}exports['GetVoiceCallReport']=function(_0x58e150){var _0x3cc7f=this;return new Promise(function(_0x1af7a2,_0x1d1ee0){return db[_0xbafc('0x16')][_0xbafc('0x17')]({'raw':_0x58e150['options']?_0x58e150[_0xbafc('0x18')][_0xbafc('0x19')]===undefined?!![]:![]:!![],'where':_0x58e150[_0xbafc('0x18')]?_0x58e150[_0xbafc('0x18')][_0xbafc('0x1a')]||null:null,'attributes':_0x58e150[_0xbafc('0x18')]?_0x58e150[_0xbafc('0x18')][_0xbafc('0x1b')]||null:null,'limit':_0x58e150[_0xbafc('0x18')]?_0x58e150[_0xbafc('0x18')][_0xbafc('0x1c')]||null:null,'include':_0x58e150[_0xbafc('0x18')]?_0x58e150[_0xbafc('0x18')][_0xbafc('0x1d')]?_[_0xbafc('0x1e')](_0x58e150['options']['include'],function(_0xf07d43){return{'model':db[_0xf07d43[_0xbafc('0x1f')]],'as':_0xf07d43['as'],'attributes':_0xf07d43[_0xbafc('0x1b')],'include':_0xf07d43[_0xbafc('0x1d')]?_[_0xbafc('0x1e')](_0xf07d43[_0xbafc('0x1d')],function(_0x1197b3){return{'model':db[_0x1197b3['model']],'as':_0x1197b3['as'],'attributes':_0x1197b3['attributes'],'include':_0x1197b3[_0xbafc('0x1d')]?_['map'](_0x1197b3[_0xbafc('0x1d')],function(_0x37286f){return{'model':db[_0x37286f[_0xbafc('0x1f')]],'as':_0x37286f['as'],'attributes':_0x37286f[_0xbafc('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xbafc('0xb')](function(_0x581b60){logger[_0xbafc('0x14')](_0xbafc('0x20'),_0x58e150);logger[_0xbafc('0xe')](_0xbafc('0x20'),_0x58e150,JSON[_0xbafc('0x10')](_0x581b60));_0x1af7a2(_0x581b60);})[_0xbafc('0x15')](function(_0x59f283){logger[_0xbafc('0x11')](_0xbafc('0x20'),_0x59f283[_0xbafc('0x13')],_0x58e150);_0x1d1ee0(_0x3cc7f[_0xbafc('0x11')](0x1f4,_0x59f283['message']));});});};exports['CreateVoiceCallReport']=function(_0x29f08f){var _0xd0df02=this;return new Promise(function(_0x83bf0d,_0x2f3609){return db[_0xbafc('0x16')]['create'](_0x29f08f['body'],{'raw':_0x29f08f[_0xbafc('0x18')]?_0x29f08f[_0xbafc('0x18')][_0xbafc('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x11bb11){logger[_0xbafc('0x14')]('CreateVoiceCallReport',_0x29f08f);logger['debug'](_0xbafc('0x21'),_0x29f08f,JSON['stringify'](_0x11bb11));_0x83bf0d(_0x11bb11);})['catch'](function(_0x3448a4){logger[_0xbafc('0x11')]('CreateVoiceCallReport',_0x3448a4['message'],_0x29f08f);_0x2f3609(_0xd0df02['error'](0x1f4,_0x3448a4[_0xbafc('0x13')]));});});};exports[_0xbafc('0x22')]=function(_0x167372){var _0x3942c8=this;return new Promise(function(_0xf2a377,_0x389df1){return db[_0xbafc('0x16')][_0xbafc('0x23')](_0x167372[_0xbafc('0x24')],{'raw':_0x167372['options']?_0x167372[_0xbafc('0x18')][_0xbafc('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x167372[_0xbafc('0x18')]?_0x167372[_0xbafc('0x18')]['where']||null:null,'attributes':_0x167372[_0xbafc('0x18')]?_0x167372[_0xbafc('0x18')][_0xbafc('0x1b')]||null:null,'limit':_0x167372[_0xbafc('0x18')]?_0x167372['options'][_0xbafc('0x1c')]||null:null})[_0xbafc('0xb')](function(_0x1bcb37){logger[_0xbafc('0x14')]('UpdateVoiceCallReport',_0x167372);logger['debug']('UpdateVoiceCallReport',_0x167372,JSON[_0xbafc('0x10')](_0x1bcb37));_0xf2a377(_0x1bcb37);})[_0xbafc('0x15')](function(_0x4f5bfd){logger[_0xbafc('0x11')](_0xbafc('0x22'),_0x4f5bfd[_0xbafc('0x13')],_0x167372);_0x389df1(_0x3942c8[_0xbafc('0x11')](0x1f4,_0x4f5bfd[_0xbafc('0x13')]));});});};
\ No newline at end of file
index 47378fc..d4765ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3295=['express','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','put','delete','exports','util','path','connect-timeout'];(function(_0x15bc45,_0x5d6b58){var _0x45e83e=function(_0x502079){while(--_0x502079){_0x15bc45['push'](_0x15bc45['shift']());}};_0x45e83e(++_0x5d6b58);}(_0x3295,0x13f));var _0x5329=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x3295[_0x556927];return _0x5f1235;};'use strict';var multer=require('multer');var util=require(_0x5329('0x0'));var path=require(_0x5329('0x1'));var timeout=require(_0x5329('0x2'));var express=require(_0x5329('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5329('0x4'));var config=require(_0x5329('0x5'));var controller=require('./voiceChanSpy.controller');router[_0x5329('0x6')]('/',auth[_0x5329('0x7')](),controller['index']);router[_0x5329('0x6')](_0x5329('0x8'),auth[_0x5329('0x7')](),controller[_0x5329('0x9')]);router[_0x5329('0xa')]('/',auth[_0x5329('0x7')](),controller['create']);router[_0x5329('0xb')](_0x5329('0x8'),auth[_0x5329('0x7')](),controller['update']);router[_0x5329('0xc')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x5329('0xd')]=router;
\ No newline at end of file
+var _0xad54=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy'];(function(_0x390520,_0x41479e){var _0x2b66b1=function(_0x56af3f){while(--_0x56af3f){_0x390520['push'](_0x390520['shift']());}};_0x2b66b1(++_0x41479e);}(_0xad54,0x1a5));var _0x4ad5=function(_0x45735b,_0x15bf2f){_0x45735b=_0x45735b-0x0;var _0x1c7553=_0xad54[_0x45735b];return _0x1c7553;};'use strict';var multer=require(_0x4ad5('0x0'));var util=require(_0x4ad5('0x1'));var path=require(_0x4ad5('0x2'));var timeout=require(_0x4ad5('0x3'));var express=require(_0x4ad5('0x4'));var router=express[_0x4ad5('0x5')]();var fs_extra=require(_0x4ad5('0x6'));var auth=require(_0x4ad5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x4ad5('0x8'));var controller=require('./voiceChanSpy.controller');router[_0x4ad5('0x9')]('/',auth['isAuthenticated'](),controller[_0x4ad5('0xa')]);router[_0x4ad5('0x9')](_0x4ad5('0xb'),auth[_0x4ad5('0xc')](),controller[_0x4ad5('0xd')]);router[_0x4ad5('0xe')]('/',auth['isAuthenticated'](),controller[_0x4ad5('0xf')]);router[_0x4ad5('0x10')](_0x4ad5('0xb'),auth[_0x4ad5('0xc')](),controller[_0x4ad5('0x11')]);router['delete'](_0x4ad5('0xb'),auth[_0x4ad5('0xc')](),controller[_0x4ad5('0x12')]);module[_0x4ad5('0x13')]=router;
\ No newline at end of file
index 76c39e7..f504971 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf391=['split','BOOLEAN','sequelize','STRING','name','options','join','getDataValue'];(function(_0x6399b4,_0x58d411){var _0x5a622b=function(_0x575d7f){while(--_0x575d7f){_0x6399b4['push'](_0x6399b4['shift']());}};_0x5a622b(++_0x58d411);}(_0xf391,0x18a));var _0x1f39=function(_0x21a0c0,_0x3844cd){_0x21a0c0=_0x21a0c0-0x0;var _0x3d249e=_0xf391[_0x21a0c0];return _0x3d249e;};'use strict';var Sequelize=require(_0x1f39('0x0'));module['exports']={'name':{'type':Sequelize[_0x1f39('0x1')]},'prefix':{'type':Sequelize[_0x1f39('0x1')],'unique':_0x1f39('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x1f39('0x1')],'set':function(_0x7540e5){this['setDataValue'](_0x1f39('0x3'),_0x7540e5?_0x7540e5[_0x1f39('0x4')](''):[]);},'get':function(){return this[_0x1f39('0x5')](_0x1f39('0x3'))?this['getDataValue'](_0x1f39('0x3'))[_0x1f39('0x6')](''):[];}},'auth':{'type':Sequelize[_0x1f39('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x1f39('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x1f39('0x1')]},'description':{'type':Sequelize[_0x1f39('0x1')]}};
\ No newline at end of file
+var _0xed19=['BOOLEAN','sequelize','exports','STRING','setDataValue','options','join','getDataValue','split'];(function(_0x59dbc3,_0xfc1f22){var _0x1ba735=function(_0x5bc380){while(--_0x5bc380){_0x59dbc3['push'](_0x59dbc3['shift']());}};_0x1ba735(++_0xfc1f22);}(_0xed19,0xf4));var _0x9ed1=function(_0x5ca209,_0x83caee){_0x5ca209=_0x5ca209-0x0;var _0x23576a=_0xed19[_0x5ca209];return _0x23576a;};'use strict';var Sequelize=require(_0x9ed1('0x0'));module[_0x9ed1('0x1')]={'name':{'type':Sequelize[_0x9ed1('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x9ed1('0x2')],'set':function(_0x4e4486){this[_0x9ed1('0x3')](_0x9ed1('0x4'),_0x4e4486?_0x4e4486[_0x9ed1('0x5')](''):[]);},'get':function(){return this[_0x9ed1('0x6')]('options')?this[_0x9ed1('0x6')](_0x9ed1('0x4'))[_0x9ed1('0x7')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x9ed1('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9ed1('0x2')]}};
\ No newline at end of file
index ef0e2a9..a12126e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dae=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','Content-Range','json','apply','save','update','then','get','ChanSpies','UserProfileResource','destroy','stack','name','map','VoiceChanSpy','rawAttributes','type','key','model','query','keys'];(function(_0x1d01be,_0x107191){var _0x467fd8=function(_0x2325bf){while(--_0x2325bf){_0x1d01be['push'](_0x1d01be['shift']());}};_0x467fd8(++_0x107191);}(_0x2dae,0xc3));var _0xe2da=function(_0x15942a,_0x13b58c){_0x15942a=_0x15942a-0x0;var _0x36a9fb=_0x2dae[_0x15942a];return _0x36a9fb;};'use strict';var emlformat=require(_0xe2da('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe2da('0x1'));var jsonpatch=require(_0xe2da('0x2'));var rp=require(_0xe2da('0x3'));var moment=require(_0xe2da('0x4'));var BPromise=require(_0xe2da('0x5'));var Mustache=require('mustache');var util=require(_0xe2da('0x6'));var path=require(_0xe2da('0x7'));var sox=require(_0xe2da('0x8'));var csv=require(_0xe2da('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe2da('0xa'));var _=require(_0xe2da('0xb'));var squel=require(_0xe2da('0xc'));var crypto=require(_0xe2da('0xd'));var jsforce=require(_0xe2da('0xe'));var deskjs=require(_0xe2da('0xf'));var toCsv=require(_0xe2da('0x9'));var querystring=require(_0xe2da('0x10'));var Papa=require(_0xe2da('0x11'));var Redis=require('ioredis');var authService=require(_0xe2da('0x12'));var qs=require(_0xe2da('0x13'));var as=require(_0xe2da('0x14'));var hardwareService=require(_0xe2da('0x15'));var logger=require(_0xe2da('0x16'))(_0xe2da('0x17'));var utils=require(_0xe2da('0x18'));var config=require(_0xe2da('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xe2da('0x1a'))['db'];function respondWithStatusCode(_0x5200b1,_0x4377c6){_0x4377c6=_0x4377c6||0xcc;return function(_0x245ad7){if(_0x245ad7){return _0x5200b1[_0xe2da('0x1b')](_0x4377c6);}return _0x5200b1[_0xe2da('0x1c')](_0x4377c6)[_0xe2da('0x1d')]();};}function respondWithResult(_0x5660b5,_0x295a86){_0x295a86=_0x295a86||0xc8;return function(_0x48584b){if(_0x48584b){return _0x5660b5[_0xe2da('0x1c')](_0x295a86)['json'](_0x48584b);}};}function respondWithFilteredResult(_0x586b27,_0x403d1c){return function(_0x3dfc52){if(_0x3dfc52){var _0x33f919=typeof _0x403d1c['offset']===_0xe2da('0x1e')&&typeof _0x403d1c[_0xe2da('0x1f')]===_0xe2da('0x1e');var _0x33568f=_0x3dfc52['count'];var _0x45bb92=_0x33f919?0x0:_0x403d1c[_0xe2da('0x20')];var _0x417363=_0x33f919?_0x3dfc52[_0xe2da('0x21')]:_0x403d1c[_0xe2da('0x20')]+_0x403d1c['limit'];var _0x56eeb1;if(_0x417363>=_0x33568f){_0x417363=_0x33568f;_0x56eeb1=0xc8;}else{_0x56eeb1=0xce;}_0x586b27[_0xe2da('0x1c')](_0x56eeb1);return _0x586b27['set'](_0xe2da('0x22'),_0x45bb92+'-'+_0x417363+'/'+_0x33568f)[_0xe2da('0x23')](_0x3dfc52);}return null;};}function patchUpdates(_0x332193){return function(_0x203d36){try{jsonpatch[_0xe2da('0x24')](_0x203d36,_0x332193,!![]);}catch(_0x3e22de){return BPromise['reject'](_0x3e22de);}return _0x203d36[_0xe2da('0x25')]();};}function saveUpdates(_0x53cc4e,_0x30efdc){return function(_0x191d38){if(_0x191d38){return _0x191d38[_0xe2da('0x26')](_0x53cc4e)[_0xe2da('0x27')](function(_0x30dea4){return _0x30dea4;});}return null;};}function removeEntity(_0x1e45e9,_0x38f2c4){return function(_0x221e98){if(_0x221e98){return _0x221e98['destroy']()[_0xe2da('0x27')](function(){var _0x357bff=_0x221e98[_0xe2da('0x28')]({'plain':!![]});var _0x14704d=_0xe2da('0x29');return db[_0xe2da('0x2a')][_0xe2da('0x2b')]({'where':{'type':_0x14704d,'resourceId':_0x357bff['id']}})['then'](function(){return _0x221e98;});})[_0xe2da('0x27')](function(){_0x1e45e9[_0xe2da('0x1c')](0xcc)[_0xe2da('0x1d')]();});}};}function handleEntityNotFound(_0x38ee5e,_0x36ca43){return function(_0x2b6c9e){if(!_0x2b6c9e){_0x38ee5e[_0xe2da('0x1b')](0x194);}return _0x2b6c9e;};}function handleError(_0x39f60e,_0x516f42){_0x516f42=_0x516f42||0x1f4;return function(_0x487a7c){logger['error'](_0x487a7c[_0xe2da('0x2c')]);if(_0x487a7c[_0xe2da('0x2d')]){delete _0x487a7c[_0xe2da('0x2d')];}_0x39f60e[_0xe2da('0x1c')](_0x516f42)['send'](_0x487a7c);};}exports['index']=function(_0x356ab4,_0x1ec8ca){var _0x262d40={},_0x39f983={},_0x7ab5ee={'count':0x0,'rows':[]};var _0x15df33=_[_0xe2da('0x2e')](db[_0xe2da('0x2f')][_0xe2da('0x30')],function(_0x499400){return{'name':_0x499400['fieldName'],'type':_0x499400[_0xe2da('0x31')][_0xe2da('0x32')]};});_0x39f983[_0xe2da('0x33')]=_[_0xe2da('0x2e')](_0x15df33,_0xe2da('0x2d'));_0x39f983[_0xe2da('0x34')]=_[_0xe2da('0x35')](_0x356ab4[_0xe2da('0x34')]);_0x39f983[_0xe2da('0x36')]=_[_0xe2da('0x37')](_0x39f983[_0xe2da('0x33')],_0x39f983[_0xe2da('0x34')]);_0x262d40[_0xe2da('0x38')]=_[_0xe2da('0x37')](_0x39f983[_0xe2da('0x33')],qs[_0xe2da('0x39')](_0x356ab4[_0xe2da('0x34')][_0xe2da('0x39')]));_0x262d40['attributes']=_0x262d40[_0xe2da('0x38')][_0xe2da('0x3a')]?_0x262d40[_0xe2da('0x38')]:_0x39f983['model'];if(!_0x356ab4[_0xe2da('0x34')][_0xe2da('0x3b')](_0xe2da('0x3c'))){_0x262d40['limit']=qs['limit'](_0x356ab4[_0xe2da('0x34')][_0xe2da('0x1f')]);_0x262d40['offset']=qs[_0xe2da('0x20')](_0x356ab4[_0xe2da('0x34')][_0xe2da('0x20')]);}_0x262d40[_0xe2da('0x3d')]=qs[_0xe2da('0x3e')](_0x356ab4['query'][_0xe2da('0x3e')]);_0x262d40['where']=qs['filters'](_[_0xe2da('0x3f')](_0x356ab4['query'],_0x39f983[_0xe2da('0x36')]),_0x15df33);if(_0x356ab4[_0xe2da('0x34')]['filter']){_0x262d40[_0xe2da('0x40')]=_[_0xe2da('0x41')](_0x262d40['where'],{'$or':_['map'](_0x15df33,function(_0x55be3e){if(_0x55be3e[_0xe2da('0x31')]!==_0xe2da('0x42')){var _0x26ba99={};_0x26ba99[_0x55be3e[_0xe2da('0x2d')]]={'$like':'%'+_0x356ab4[_0xe2da('0x34')][_0xe2da('0x43')]+'%'};return _0x26ba99;}})});}_0x262d40=_[_0xe2da('0x41')]({},_0x262d40,_0x356ab4['options']);var _0x3d1fd={'where':_0x262d40[_0xe2da('0x40')]};return db[_0xe2da('0x2f')][_0xe2da('0x21')](_0x3d1fd)[_0xe2da('0x27')](function(_0x5a1550){_0x7ab5ee[_0xe2da('0x21')]=_0x5a1550;if(_0x356ab4[_0xe2da('0x34')][_0xe2da('0x44')]){_0x262d40['include']=[{'all':!![]}];}return db[_0xe2da('0x2f')][_0xe2da('0x45')](_0x262d40);})[_0xe2da('0x27')](function(_0x4096c5){_0x7ab5ee[_0xe2da('0x46')]=_0x4096c5;return _0x7ab5ee;})[_0xe2da('0x27')](respondWithFilteredResult(_0x1ec8ca,_0x262d40))[_0xe2da('0x47')](handleError(_0x1ec8ca,null));};exports[_0xe2da('0x48')]=function(_0x4aec15,_0x21cc34){var _0x472d1e={'raw':![],'where':{'id':_0x4aec15[_0xe2da('0x49')]['id']}},_0x2113e8={};_0x2113e8[_0xe2da('0x33')]=_['keys'](db[_0xe2da('0x2f')][_0xe2da('0x30')]);_0x2113e8[_0xe2da('0x34')]=_[_0xe2da('0x35')](_0x4aec15[_0xe2da('0x34')]);_0x2113e8[_0xe2da('0x36')]=_[_0xe2da('0x37')](_0x2113e8['model'],_0x2113e8[_0xe2da('0x34')]);_0x472d1e['attributes']=_[_0xe2da('0x37')](_0x2113e8[_0xe2da('0x33')],qs[_0xe2da('0x39')](_0x4aec15['query'][_0xe2da('0x39')]));_0x472d1e[_0xe2da('0x38')]=_0x472d1e['attributes'][_0xe2da('0x3a')]?_0x472d1e[_0xe2da('0x38')]:_0x2113e8[_0xe2da('0x33')];if(_0x4aec15['query'][_0xe2da('0x44')]){_0x472d1e['include']=[{'all':!![]}];}_0x472d1e=_['merge']({},_0x472d1e,_0x4aec15[_0xe2da('0x4a')]);return db['VoiceChanSpy'][_0xe2da('0x4b')](_0x472d1e)[_0xe2da('0x27')](handleEntityNotFound(_0x21cc34,null))['then'](respondWithResult(_0x21cc34,null))[_0xe2da('0x47')](handleError(_0x21cc34,null));};exports[_0xe2da('0x4c')]=function(_0x482547,_0x4a6d80){return db[_0xe2da('0x2f')]['create'](_0x482547[_0xe2da('0x4d')],{})[_0xe2da('0x27')](function(_0x259546){var _0x1c17f1=_0x482547[_0xe2da('0x4e')][_0xe2da('0x28')]({'plain':!![]});if(!_0x1c17f1)throw new Error(_0xe2da('0x4f'));if(_0x1c17f1[_0xe2da('0x50')]===_0xe2da('0x4e')){var _0x515f9b=_0x259546[_0xe2da('0x28')]({'plain':!![]});var _0x157c36=_0xe2da('0x29');return db['UserProfileSection'][_0xe2da('0x4b')]({'where':{'name':_0x157c36,'userProfileId':_0x1c17f1[_0xe2da('0x51')]},'raw':!![]})[_0xe2da('0x27')](function(_0x125118){if(_0x125118&&_0x125118[_0xe2da('0x52')]===0x0){return db[_0xe2da('0x2a')][_0xe2da('0x4c')]({'name':_0x515f9b['name'],'resourceId':_0x515f9b['id'],'type':_0x125118['name'],'sectionId':_0x125118['id']},{})[_0xe2da('0x27')](function(){return _0x259546;});}else{return _0x259546;}})[_0xe2da('0x47')](function(_0x28f916){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28f916);throw _0x28f916;});}return _0x259546;})[_0xe2da('0x27')](respondWithResult(_0x4a6d80,0xc9))['catch'](handleError(_0x4a6d80,null));};exports[_0xe2da('0x26')]=function(_0x153749,_0x8e78b9){if(_0x153749[_0xe2da('0x4d')]['id']){delete _0x153749[_0xe2da('0x4d')]['id'];}return db[_0xe2da('0x2f')][_0xe2da('0x4b')]({'where':{'id':_0x153749[_0xe2da('0x49')]['id']}})[_0xe2da('0x27')](handleEntityNotFound(_0x8e78b9,null))['then'](saveUpdates(_0x153749[_0xe2da('0x4d')],null))[_0xe2da('0x27')](respondWithResult(_0x8e78b9,null))[_0xe2da('0x47')](handleError(_0x8e78b9,null));};exports[_0xe2da('0x2b')]=function(_0x51d174,_0x25b8a7){return db[_0xe2da('0x2f')][_0xe2da('0x4b')]({'where':{'id':_0x51d174['params']['id']}})[_0xe2da('0x27')](handleEntityNotFound(_0x25b8a7,null))[_0xe2da('0x27')](removeEntity(_0x25b8a7,null))[_0xe2da('0x47')](handleError(_0x25b8a7,null));};
\ No newline at end of file
+var _0x50c1=['intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','rows','catch','show','includeAll','options','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChanSpies','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','save','update','destroy','then','get','name','send','VoiceChanSpy','rawAttributes','key','map','query','keys','filters'];(function(_0x5a41c7,_0x2f55ce){var _0x176597=function(_0x3b8eff){while(--_0x3b8eff){_0x5a41c7['push'](_0x5a41c7['shift']());}};_0x176597(++_0x2f55ce);}(_0x50c1,0x1a5));var _0x150c=function(_0x6d6f4f,_0xcc05eb){_0x6d6f4f=_0x6d6f4f-0x0;var _0x55207d=_0x50c1[_0x6d6f4f];return _0x55207d;};'use strict';var emlformat=require(_0x150c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x150c('0x1'));var rp=require(_0x150c('0x2'));var moment=require(_0x150c('0x3'));var BPromise=require(_0x150c('0x4'));var Mustache=require(_0x150c('0x5'));var util=require(_0x150c('0x6'));var path=require(_0x150c('0x7'));var sox=require(_0x150c('0x8'));var csv=require(_0x150c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x150c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x150c('0xb'));var deskjs=require(_0x150c('0xc'));var toCsv=require(_0x150c('0x9'));var querystring=require(_0x150c('0xd'));var Papa=require(_0x150c('0xe'));var Redis=require(_0x150c('0xf'));var authService=require(_0x150c('0x10'));var qs=require(_0x150c('0x11'));var as=require(_0x150c('0x12'));var hardwareService=require(_0x150c('0x13'));var logger=require('../../config/logger')(_0x150c('0x14'));var utils=require(_0x150c('0x15'));var config=require(_0x150c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x150c('0x17'))['db'];function respondWithStatusCode(_0x4e2f73,_0x4c513d){_0x4c513d=_0x4c513d||0xcc;return function(_0x2c9a8a){if(_0x2c9a8a){return _0x4e2f73[_0x150c('0x18')](_0x4c513d);}return _0x4e2f73[_0x150c('0x19')](_0x4c513d)[_0x150c('0x1a')]();};}function respondWithResult(_0x293b98,_0x17205c){_0x17205c=_0x17205c||0xc8;return function(_0x333600){if(_0x333600){return _0x293b98[_0x150c('0x19')](_0x17205c)[_0x150c('0x1b')](_0x333600);}};}function respondWithFilteredResult(_0x3c6772,_0x11bc9e){return function(_0x2c0626){if(_0x2c0626){var _0x5c657f=typeof _0x11bc9e[_0x150c('0x1c')]==='undefined'&&typeof _0x11bc9e[_0x150c('0x1d')]==='undefined';var _0x59ae9e=_0x2c0626[_0x150c('0x1e')];var _0x40c0d0=_0x5c657f?0x0:_0x11bc9e[_0x150c('0x1c')];var _0x3c5a84=_0x5c657f?_0x2c0626['count']:_0x11bc9e[_0x150c('0x1c')]+_0x11bc9e[_0x150c('0x1d')];var _0x9a9d64;if(_0x3c5a84>=_0x59ae9e){_0x3c5a84=_0x59ae9e;_0x9a9d64=0xc8;}else{_0x9a9d64=0xce;}_0x3c6772[_0x150c('0x19')](_0x9a9d64);return _0x3c6772[_0x150c('0x1f')](_0x150c('0x20'),_0x40c0d0+'-'+_0x3c5a84+'/'+_0x59ae9e)['json'](_0x2c0626);}return null;};}function patchUpdates(_0x220c15){return function(_0x365de8){try{jsonpatch['apply'](_0x365de8,_0x220c15,!![]);}catch(_0x12e158){return BPromise['reject'](_0x12e158);}return _0x365de8[_0x150c('0x21')]();};}function saveUpdates(_0x25503b,_0x29a2f){return function(_0x1c41f4){if(_0x1c41f4){return _0x1c41f4[_0x150c('0x22')](_0x25503b)['then'](function(_0x68b03b){return _0x68b03b;});}return null;};}function removeEntity(_0x3f9044,_0x332173){return function(_0x188536){if(_0x188536){return _0x188536[_0x150c('0x23')]()[_0x150c('0x24')](function(){var _0x43f121=_0x188536[_0x150c('0x25')]({'plain':!![]});var _0x3b1ce6='ChanSpies';return db['UserProfileResource'][_0x150c('0x23')]({'where':{'type':_0x3b1ce6,'resourceId':_0x43f121['id']}})[_0x150c('0x24')](function(){return _0x188536;});})[_0x150c('0x24')](function(){_0x3f9044['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44d4e1,_0x1ab18c){return function(_0x11571a){if(!_0x11571a){_0x44d4e1[_0x150c('0x18')](0x194);}return _0x11571a;};}function handleError(_0x38e67b,_0x419b80){_0x419b80=_0x419b80||0x1f4;return function(_0x420628){logger['error'](_0x420628['stack']);if(_0x420628[_0x150c('0x26')]){delete _0x420628[_0x150c('0x26')];}_0x38e67b[_0x150c('0x19')](_0x419b80)[_0x150c('0x27')](_0x420628);};}exports['index']=function(_0x4a961f,_0x3acbc8){var _0x2f1b04={},_0x470652={},_0x4f6bca={'count':0x0,'rows':[]};var _0x1802ac=_['map'](db[_0x150c('0x28')][_0x150c('0x29')],function(_0x180da3){return{'name':_0x180da3['fieldName'],'type':_0x180da3['type'][_0x150c('0x2a')]};});_0x470652['model']=_[_0x150c('0x2b')](_0x1802ac,_0x150c('0x26'));_0x470652[_0x150c('0x2c')]=_[_0x150c('0x2d')](_0x4a961f[_0x150c('0x2c')]);_0x470652[_0x150c('0x2e')]=_[_0x150c('0x2f')](_0x470652['model'],_0x470652[_0x150c('0x2c')]);_0x2f1b04[_0x150c('0x30')]=_['intersection'](_0x470652[_0x150c('0x31')],qs[_0x150c('0x32')](_0x4a961f[_0x150c('0x2c')]['fields']));_0x2f1b04[_0x150c('0x30')]=_0x2f1b04[_0x150c('0x30')][_0x150c('0x33')]?_0x2f1b04['attributes']:_0x470652[_0x150c('0x31')];if(!_0x4a961f['query']['hasOwnProperty'](_0x150c('0x34'))){_0x2f1b04['limit']=qs['limit'](_0x4a961f[_0x150c('0x2c')][_0x150c('0x1d')]);_0x2f1b04[_0x150c('0x1c')]=qs[_0x150c('0x1c')](_0x4a961f[_0x150c('0x2c')][_0x150c('0x1c')]);}_0x2f1b04[_0x150c('0x35')]=qs['sort'](_0x4a961f[_0x150c('0x2c')][_0x150c('0x36')]);_0x2f1b04[_0x150c('0x37')]=qs['filters'](_[_0x150c('0x38')](_0x4a961f[_0x150c('0x2c')],_0x470652[_0x150c('0x2e')]),_0x1802ac);if(_0x4a961f[_0x150c('0x2c')][_0x150c('0x39')]){_0x2f1b04['where']=_[_0x150c('0x3a')](_0x2f1b04[_0x150c('0x37')],{'$or':_[_0x150c('0x2b')](_0x1802ac,function(_0x4c5310){if(_0x4c5310[_0x150c('0x3b')]!==_0x150c('0x3c')){var _0x1e8a57={};_0x1e8a57[_0x4c5310[_0x150c('0x26')]]={'$like':'%'+_0x4a961f[_0x150c('0x2c')][_0x150c('0x39')]+'%'};return _0x1e8a57;}})});}_0x2f1b04=_[_0x150c('0x3a')]({},_0x2f1b04,_0x4a961f['options']);var _0x510ab6={'where':_0x2f1b04['where']};return db[_0x150c('0x28')][_0x150c('0x1e')](_0x510ab6)[_0x150c('0x24')](function(_0x4503d8){_0x4f6bca[_0x150c('0x1e')]=_0x4503d8;if(_0x4a961f[_0x150c('0x2c')]['includeAll']){_0x2f1b04[_0x150c('0x3d')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x150c('0x3e')](_0x2f1b04);})[_0x150c('0x24')](function(_0x2a9ce4){_0x4f6bca[_0x150c('0x3f')]=_0x2a9ce4;return _0x4f6bca;})[_0x150c('0x24')](respondWithFilteredResult(_0x3acbc8,_0x2f1b04))[_0x150c('0x40')](handleError(_0x3acbc8,null));};exports[_0x150c('0x41')]=function(_0x438305,_0x3eab5d){var _0x122395={'raw':![],'where':{'id':_0x438305['params']['id']}},_0x49c5b8={};_0x49c5b8['model']=_['keys'](db['VoiceChanSpy'][_0x150c('0x29')]);_0x49c5b8[_0x150c('0x2c')]=_[_0x150c('0x2d')](_0x438305['query']);_0x49c5b8[_0x150c('0x2e')]=_['intersection'](_0x49c5b8[_0x150c('0x31')],_0x49c5b8[_0x150c('0x2c')]);_0x122395[_0x150c('0x30')]=_[_0x150c('0x2f')](_0x49c5b8[_0x150c('0x31')],qs[_0x150c('0x32')](_0x438305[_0x150c('0x2c')][_0x150c('0x32')]));_0x122395[_0x150c('0x30')]=_0x122395[_0x150c('0x30')][_0x150c('0x33')]?_0x122395['attributes']:_0x49c5b8['model'];if(_0x438305['query'][_0x150c('0x42')]){_0x122395[_0x150c('0x3d')]=[{'all':!![]}];}_0x122395=_[_0x150c('0x3a')]({},_0x122395,_0x438305[_0x150c('0x43')]);return db[_0x150c('0x28')][_0x150c('0x44')](_0x122395)[_0x150c('0x24')](handleEntityNotFound(_0x3eab5d,null))[_0x150c('0x24')](respondWithResult(_0x3eab5d,null))[_0x150c('0x40')](handleError(_0x3eab5d,null));};exports['create']=function(_0x61eaaf,_0x5e5c5d){return db[_0x150c('0x28')]['create'](_0x61eaaf[_0x150c('0x45')],{})[_0x150c('0x24')](function(_0x400ec4){var _0x1aa194=_0x61eaaf['user'][_0x150c('0x25')]({'plain':!![]});if(!_0x1aa194)throw new Error(_0x150c('0x46'));if(_0x1aa194[_0x150c('0x47')]===_0x150c('0x48')){var _0x22f54d=_0x400ec4[_0x150c('0x25')]({'plain':!![]});var _0xedd3c1=_0x150c('0x49');return db[_0x150c('0x4a')][_0x150c('0x44')]({'where':{'name':_0xedd3c1,'userProfileId':_0x1aa194[_0x150c('0x4b')]},'raw':!![]})[_0x150c('0x24')](function(_0x1b101c){if(_0x1b101c&&_0x1b101c['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x22f54d[_0x150c('0x26')],'resourceId':_0x22f54d['id'],'type':_0x1b101c[_0x150c('0x26')],'sectionId':_0x1b101c['id']},{})['then'](function(){return _0x400ec4;});}else{return _0x400ec4;}})[_0x150c('0x40')](function(_0x31bbf7){logger['error'](_0x150c('0x4c'),_0x31bbf7);throw _0x31bbf7;});}return _0x400ec4;})[_0x150c('0x24')](respondWithResult(_0x5e5c5d,0xc9))[_0x150c('0x40')](handleError(_0x5e5c5d,null));};exports['update']=function(_0x1f7bcf,_0x4266b4){if(_0x1f7bcf[_0x150c('0x45')]['id']){delete _0x1f7bcf[_0x150c('0x45')]['id'];}return db[_0x150c('0x28')][_0x150c('0x44')]({'where':{'id':_0x1f7bcf[_0x150c('0x4d')]['id']}})[_0x150c('0x24')](handleEntityNotFound(_0x4266b4,null))[_0x150c('0x24')](saveUpdates(_0x1f7bcf['body'],null))[_0x150c('0x24')](respondWithResult(_0x4266b4,null))[_0x150c('0x40')](handleError(_0x4266b4,null));};exports[_0x150c('0x23')]=function(_0x2b89ee,_0x384e70){return db[_0x150c('0x28')][_0x150c('0x44')]({'where':{'id':_0x2b89ee[_0x150c('0x4d')]['id']}})[_0x150c('0x24')](handleEntityNotFound(_0x384e70,null))[_0x150c('0x24')](removeEntity(_0x384e70,null))[_0x150c('0x40')](handleError(_0x384e70,null));};
\ No newline at end of file
index dbf06d5..4c5a068 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ee2=['util','bluebird','./voiceChanSpy.attributes','context','format','%s%s','prefix','system','push','merge','Set','chanspy','record','MixMonitor','recordingFormat','password','SIP/%s,%s','name','options','join','length','internal','User','then','catch','exports','models','define','voice_chanspy','VoiceExtension','destroy','lodash'];(function(_0x339af5,_0x57a7b1){var _0x2a3212=function(_0x5eedb3){while(--_0x5eedb3){_0x339af5['push'](_0x339af5['shift']());}};_0x2a3212(++_0x57a7b1);}(_0x5ee2,0x1bf));var _0x25ee=function(_0x4e212c,_0x227e17){_0x4e212c=_0x4e212c-0x0;var _0x103075=_0x5ee2[_0x4e212c];return _0x103075;};'use strict';var _=require(_0x25ee('0x0'));var util=require(_0x25ee('0x1'));var BPromise=require(_0x25ee('0x2'));var attributes=require(_0x25ee('0x3'));var getUserApplications=function(_0x743860,_0x56b2d2,_0x55b809){var _0x320e5e=0x1;var _0x55058e=[];var _0x74e31b={'context':_0x56b2d2[_0x25ee('0x4')]||'from-sip','exten':util[_0x25ee('0x5')](_0x25ee('0x6'),_0x743860[_0x25ee('0x7')],_0x55b809),'type':_0x25ee('0x8'),'isApp':![],'ChanSpyId':_0x743860['id'],'UserId':_0x56b2d2['id']};_0x55058e[_0x25ee('0x9')](_[_0x25ee('0xa')]({'app':_0x25ee('0xb'),'appdata':util[_0x25ee('0x5')]('CDR(type)=%s',_0x25ee('0xc')),'priority':_0x320e5e++},_0x74e31b));if(_0x743860[_0x25ee('0xd')]){_0x55058e[_0x25ee('0x9')](_[_0x25ee('0xa')]({'app':_0x25ee('0xe'),'appdata':util[_0x25ee('0x5')]('${UNIQUEID}.%s,a',_0x743860[_0x25ee('0xf')]),'priority':_0x320e5e++},_0x74e31b));}if(_0x743860['auth']){_0x55058e['push'](_['merge']({'app':'Authenticate','appdata':_0x743860[_0x25ee('0x10')],'priority':_0x320e5e++},_0x74e31b));}_0x55058e[_0x25ee('0x9')](_[_0x25ee('0xa')]({'app':'ChanSpy','appdata':util[_0x25ee('0x5')](_0x25ee('0x11'),_0x56b2d2[_0x25ee('0x12')],_0x743860['options']?_0x743860[_0x25ee('0x13')][_0x25ee('0x14')](''):''),'priority':_0x320e5e++},_0x74e31b));if(_0x743860[_0x25ee('0xd')]){_0x55058e[_0x25ee('0x9')](_[_0x25ee('0xa')]({'app':'StopMixMonitor','priority':_0x320e5e++},_0x74e31b));}return _0x55058e;};var getChanSpyApplications=function(_0x49f4dd,_0x2e41be){var _0x136e0e=[];for(var _0x4bdc90=0x0,_0x1c9a3f=0x1;_0x4bdc90<_0x2e41be[_0x25ee('0x15')];_0x4bdc90++,_0x1c9a3f=0x1){_0x136e0e=_0x136e0e['concat'](getUserApplications(_0x49f4dd,_0x2e41be[_0x4bdc90],_0x2e41be[_0x4bdc90][_0x25ee('0x16')]));if(_0x2e41be[_0x4bdc90][_0x25ee('0x16')]!=_0x2e41be[_0x4bdc90]['name']){_0x136e0e=_0x136e0e['concat'](getUserApplications(_0x49f4dd,_0x2e41be[_0x4bdc90],_0x2e41be[_0x4bdc90][_0x25ee('0x12')]));}}return _0x136e0e;};var getChanSpyPromise=function(_0x897ca4,_0x33821f){return new BPromise(function(_0x22af46,_0x42a47c){return _0x897ca4[_0x25ee('0x17')]['findAll']({'attributes':['id',_0x25ee('0x12'),_0x25ee('0x16')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x25ee('0x18')](function(_0x8bc338){if(_0x8bc338){return _0x22af46(getChanSpyApplications(_0x33821f,_0x8bc338));}return _0x22af46([]);})[_0x25ee('0x19')](function(_0xf6e892){_0x42a47c(_0xf6e892);});});};module[_0x25ee('0x1a')]=function(_0x3f283b,_0x554d11){var _0x4dfb9b=_0x3f283b[_0x25ee('0x1b')];return _0x3f283b[_0x25ee('0x1c')]('VoiceChanSpy',attributes,{'tableName':_0x25ee('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2c2f16,_0x3cf2ce,_0x17a652){return getChanSpyPromise(_0x4dfb9b,_0x2c2f16)[_0x25ee('0x18')](function(_0x2cf66f){if(_0x2cf66f&&_0x2cf66f[_0x25ee('0x15')]){return _0x4dfb9b['VoiceExtension']['bulkCreate'](_0x2cf66f);}})[_0x25ee('0x18')](function(){_0x17a652();})[_0x25ee('0x19')](function(_0x5cda23){_0x17a652(_0x5cda23);});},'afterUpdate':function(_0x4f82f8,_0x13e8d0,_0x4f333a){return _0x4dfb9b[_0x25ee('0x1e')][_0x25ee('0x1f')]({'where':{'ChanSpyId':_0x4f82f8['id']}})[_0x25ee('0x18')](function(){return getChanSpyPromise(_0x4dfb9b,_0x4f82f8);})[_0x25ee('0x18')](function(_0x236c62){if(_0x236c62&&_0x236c62[_0x25ee('0x15')]){return _0x4dfb9b['VoiceExtension']['bulkCreate'](_0x236c62);}})[_0x25ee('0x18')](function(){_0x4f333a();})[_0x25ee('0x19')](function(_0x499cd4){_0x4f333a(_0x499cd4);});},'afterDestroy':function(_0x7bd950,_0x3c3ac5,_0x351ec3){return _0x4dfb9b[_0x25ee('0x1e')][_0x25ee('0x1f')]({'where':{'ChanSpyId':_0x7bd950['id']}})[_0x25ee('0x18')](function(){_0x351ec3();})['catch'](function(_0x4b9801){_0x351ec3(_0x4b9801);});}}});};
\ No newline at end of file
+var _0x9cae=['voice_chanspy','then','VoiceExtension','bulkCreate','destroy','lodash','bluebird','context','prefix','system','push','merge','Set','format','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','length','concat','internal','name','User','findAll','catch','define','VoiceChanSpy'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9cae,0x8d));var _0xe9ca=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9cae[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe9ca('0x0'));var util=require('util');var BPromise=require(_0xe9ca('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x55663e,_0xc37260,_0x487307){var _0xb83e60=0x1;var _0x1ad2e3=[];var _0x38963f={'context':_0xc37260[_0xe9ca('0x2')]||'from-sip','exten':util['format']('%s%s',_0x55663e[_0xe9ca('0x3')],_0x487307),'type':_0xe9ca('0x4'),'isApp':![],'ChanSpyId':_0x55663e['id'],'UserId':_0xc37260['id']};_0x1ad2e3[_0xe9ca('0x5')](_[_0xe9ca('0x6')]({'app':_0xe9ca('0x7'),'appdata':util[_0xe9ca('0x8')]('CDR(type)=%s',_0xe9ca('0x9')),'priority':_0xb83e60++},_0x38963f));if(_0x55663e[_0xe9ca('0xa')]){_0x1ad2e3['push'](_['merge']({'app':_0xe9ca('0xb'),'appdata':util[_0xe9ca('0x8')](_0xe9ca('0xc'),_0x55663e['recordingFormat']),'priority':_0xb83e60++},_0x38963f));}if(_0x55663e['auth']){_0x1ad2e3[_0xe9ca('0x5')](_[_0xe9ca('0x6')]({'app':_0xe9ca('0xd'),'appdata':_0x55663e[_0xe9ca('0xe')],'priority':_0xb83e60++},_0x38963f));}_0x1ad2e3[_0xe9ca('0x5')](_['merge']({'app':_0xe9ca('0xf'),'appdata':util[_0xe9ca('0x8')](_0xe9ca('0x10'),_0xc37260['name'],_0x55663e[_0xe9ca('0x11')]?_0x55663e[_0xe9ca('0x11')][_0xe9ca('0x12')](''):''),'priority':_0xb83e60++},_0x38963f));if(_0x55663e[_0xe9ca('0xa')]){_0x1ad2e3[_0xe9ca('0x5')](_['merge']({'app':_0xe9ca('0x13'),'priority':_0xb83e60++},_0x38963f));}return _0x1ad2e3;};var getChanSpyApplications=function(_0x2e3d34,_0x38ac42){var _0x308d24=[];for(var _0x3b0247=0x0,_0x42d852=0x1;_0x3b0247<_0x38ac42[_0xe9ca('0x14')];_0x3b0247++,_0x42d852=0x1){_0x308d24=_0x308d24[_0xe9ca('0x15')](getUserApplications(_0x2e3d34,_0x38ac42[_0x3b0247],_0x38ac42[_0x3b0247]['internal']));if(_0x38ac42[_0x3b0247][_0xe9ca('0x16')]!=_0x38ac42[_0x3b0247][_0xe9ca('0x17')]){_0x308d24=_0x308d24['concat'](getUserApplications(_0x2e3d34,_0x38ac42[_0x3b0247],_0x38ac42[_0x3b0247][_0xe9ca('0x17')]));}}return _0x308d24;};var getChanSpyPromise=function(_0x57a230,_0x2b1b3e){return new BPromise(function(_0x307029,_0x6cd0bc){return _0x57a230[_0xe9ca('0x18')][_0xe9ca('0x19')]({'attributes':['id',_0xe9ca('0x17'),_0xe9ca('0x16')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})['then'](function(_0x193ca0){if(_0x193ca0){return _0x307029(getChanSpyApplications(_0x2b1b3e,_0x193ca0));}return _0x307029([]);})[_0xe9ca('0x1a')](function(_0x12bf6a){_0x6cd0bc(_0x12bf6a);});});};module['exports']=function(_0x442995,_0x12e4a6){var _0x47a9b0=_0x442995['models'];return _0x442995[_0xe9ca('0x1b')](_0xe9ca('0x1c'),attributes,{'tableName':_0xe9ca('0x1d'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4523fe,_0x2edc75,_0x798495){return getChanSpyPromise(_0x47a9b0,_0x4523fe)[_0xe9ca('0x1e')](function(_0x2f5e5e){if(_0x2f5e5e&&_0x2f5e5e['length']){return _0x47a9b0[_0xe9ca('0x1f')][_0xe9ca('0x20')](_0x2f5e5e);}})[_0xe9ca('0x1e')](function(){_0x798495();})[_0xe9ca('0x1a')](function(_0x2de5b6){_0x798495(_0x2de5b6);});},'afterUpdate':function(_0x5a94e7,_0x4820d9,_0x262c32){return _0x47a9b0[_0xe9ca('0x1f')]['destroy']({'where':{'ChanSpyId':_0x5a94e7['id']}})['then'](function(){return getChanSpyPromise(_0x47a9b0,_0x5a94e7);})[_0xe9ca('0x1e')](function(_0xf71b02){if(_0xf71b02&&_0xf71b02[_0xe9ca('0x14')]){return _0x47a9b0[_0xe9ca('0x1f')]['bulkCreate'](_0xf71b02);}})['then'](function(){_0x262c32();})[_0xe9ca('0x1a')](function(_0x270284){_0x262c32(_0x270284);});},'afterDestroy':function(_0x349d3a,_0x326e83,_0x405e5c){return _0x47a9b0[_0xe9ca('0x1f')][_0xe9ca('0x21')]({'where':{'ChanSpyId':_0x349d3a['id']}})[_0xe9ca('0x1e')](function(){_0x405e5c();})[_0xe9ca('0x1a')](function(_0x5793c9){_0x405e5c(_0x5793c9);});}}});};
\ No newline at end of file
index 61d6ee0..1a64836 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd691=['jayson/promise','client','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x11cd67,_0x5402e2){var _0x4f1f3b=function(_0x308392){while(--_0x308392){_0x11cd67['push'](_0x11cd67['shift']());}};_0x4f1f3b(++_0x5402e2);}(_0xd691,0xe6));var _0x1d69=function(_0x14bbf3,_0xca820f){_0x14bbf3=_0x14bbf3-0x0;var _0x1b280c=_0xd691[_0x14bbf3];return _0x1b280c;};'use strict';var _=require(_0x1d69('0x0'));var util=require(_0x1d69('0x1'));var moment=require(_0x1d69('0x2'));var BPromise=require('bluebird');var rs=require(_0x1d69('0x3'));var fs=require('fs');var Redis=require(_0x1d69('0x4'));var db=require(_0x1d69('0x5'))['db'];var utils=require(_0x1d69('0x6'));var logger=require(_0x1d69('0x7'))(_0x1d69('0x8'));var config=require(_0x1d69('0x9'));var jayson=require(_0x1d69('0xa'));var client=jayson[_0x1d69('0xb')][_0x1d69('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a5b0c,_0x520acb,_0x267da3){return new BPromise(function(_0x49f008,_0x369d44){return client[_0x1d69('0xd')](_0x5a5b0c,_0x267da3)[_0x1d69('0xe')](function(_0x364061){logger['info'](_0x1d69('0xf'),_0x520acb,_0x1d69('0x10'));logger[_0x1d69('0x11')](_0x1d69('0x12'),_0x520acb,_0x1d69('0x10'),JSON['stringify'](_0x364061));if(_0x364061['error']){if(_0x364061[_0x1d69('0x13')][_0x1d69('0x14')]===0x1f4){logger[_0x1d69('0x13')](_0x1d69('0xf'),_0x520acb,_0x364061[_0x1d69('0x13')][_0x1d69('0x15')]);return _0x369d44(_0x364061[_0x1d69('0x13')][_0x1d69('0x15')]);}logger[_0x1d69('0x13')](_0x1d69('0xf'),_0x520acb,_0x364061[_0x1d69('0x13')][_0x1d69('0x15')]);return _0x49f008(_0x364061[_0x1d69('0x13')]['message']);}else{logger['info'](_0x1d69('0xf'),_0x520acb,_0x1d69('0x10'));_0x49f008(_0x364061[_0x1d69('0x16')][_0x1d69('0x15')]);}})[_0x1d69('0x17')](function(_0x383771){logger['error'](_0x1d69('0xf'),_0x520acb,_0x383771);_0x369d44(_0x383771);});});}
\ No newline at end of file
+var _0x9aea=['result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x3f9828,_0xf07728){var _0xf5e8a3=function(_0x45f2f7){while(--_0x45f2f7){_0x3f9828['push'](_0x3f9828['shift']());}};_0xf5e8a3(++_0xf07728);}(_0x9aea,0xdd));var _0xa9ae=function(_0x4623f9,_0x1e984c){_0x4623f9=_0x4623f9-0x0;var _0x105adc=_0x9aea[_0x4623f9];return _0x105adc;};'use strict';var _=require(_0xa9ae('0x0'));var util=require('util');var moment=require(_0xa9ae('0x1'));var BPromise=require('bluebird');var rs=require(_0xa9ae('0x2'));var fs=require('fs');var Redis=require(_0xa9ae('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa9ae('0x4'));var logger=require(_0xa9ae('0x5'))(_0xa9ae('0x6'));var config=require(_0xa9ae('0x7'));var jayson=require(_0xa9ae('0x8'));var client=jayson['client'][_0xa9ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22734b,_0x1e57c4,_0x53e52c){return new BPromise(function(_0x1f2e4b,_0x3917f0){return client[_0xa9ae('0xa')](_0x22734b,_0x53e52c)[_0xa9ae('0xb')](function(_0x1882dc){logger[_0xa9ae('0xc')](_0xa9ae('0xd'),_0x1e57c4,_0xa9ae('0xe'));logger[_0xa9ae('0xf')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x1e57c4,_0xa9ae('0xe'),JSON['stringify'](_0x1882dc));if(_0x1882dc[_0xa9ae('0x10')]){if(_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x11')]===0x1f4){logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x12')]);return _0x3917f0(_0x1882dc[_0xa9ae('0x10')]['message']);}logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x1882dc[_0xa9ae('0x10')][_0xa9ae('0x12')]);return _0x1f2e4b(_0x1882dc['error'][_0xa9ae('0x12')]);}else{logger[_0xa9ae('0xc')](_0xa9ae('0xd'),_0x1e57c4,_0xa9ae('0xe'));_0x1f2e4b(_0x1882dc[_0xa9ae('0x13')][_0xa9ae('0x12')]);}})['catch'](function(_0x3e4810){logger[_0xa9ae('0x10')](_0xa9ae('0xd'),_0x1e57c4,_0x3e4810);_0x3917f0(_0x3e4810);});});}
\ No newline at end of file
index be0a45e..f9d6dd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c15=['put','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x46c882,_0x54c2e1){var _0x22c031=function(_0x26057c){while(--_0x26057c){_0x46c882['push'](_0x46c882['shift']());}};_0x22c031(++_0x54c2e1);}(_0x0c15,0x104));var _0x50c1=function(_0x1ccba2,_0x5c2fd7){_0x1ccba2=_0x1ccba2-0x0;var _0x494603=_0x0c15[_0x1ccba2];return _0x494603;};'use strict';var multer=require(_0x50c1('0x0'));var util=require(_0x50c1('0x1'));var path=require(_0x50c1('0x2'));var timeout=require(_0x50c1('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x50c1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x50c1('0x5'));var config=require(_0x50c1('0x6'));var controller=require('./voiceContext.controller');router[_0x50c1('0x7')]('/',auth[_0x50c1('0x8')](),controller[_0x50c1('0x9')]);router[_0x50c1('0x7')](_0x50c1('0xa'),auth['isAuthenticated'](),controller[_0x50c1('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x50c1('0xc')](_0x50c1('0xa'),auth[_0x50c1('0x8')](),controller[_0x50c1('0xd')]);router[_0x50c1('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x50c1('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x8262=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','create','update','delete','destroy'];(function(_0x53e276,_0x428468){var _0x32b2b6=function(_0x1daf0d){while(--_0x1daf0d){_0x53e276['push'](_0x53e276['shift']());}};_0x32b2b6(++_0x428468);}(_0x8262,0x190));var _0x2826=function(_0x34edee,_0x4b96f1){_0x34edee=_0x34edee-0x0;var _0x2bba1a=_0x8262[_0x34edee];return _0x2bba1a;};'use strict';var multer=require(_0x2826('0x0'));var util=require(_0x2826('0x1'));var path=require(_0x2826('0x2'));var timeout=require(_0x2826('0x3'));var express=require(_0x2826('0x4'));var router=express['Router']();var fs_extra=require(_0x2826('0x5'));var auth=require(_0x2826('0x6'));var interaction=require(_0x2826('0x7'));var config=require(_0x2826('0x8'));var controller=require('./voiceContext.controller');router['get']('/',auth[_0x2826('0x9')](),controller[_0x2826('0xa')]);router[_0x2826('0xb')](_0x2826('0xc'),auth['isAuthenticated'](),controller[_0x2826('0xd')]);router['post']('/',auth[_0x2826('0x9')](),controller[_0x2826('0xe')]);router['put'](_0x2826('0xc'),auth['isAuthenticated'](),controller[_0x2826('0xf')]);router[_0x2826('0x10')](_0x2826('0xc'),auth[_0x2826('0x9')](),controller[_0x2826('0x11')]);module[_0x2826('0x12')]=router;
\ No newline at end of file
index 92353f0..2ca152c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6319=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x6319,0xc3));var _0x9631=function(_0x1ad430,_0x2763ab){_0x1ad430=_0x1ad430-0x0;var _0x55c846=_0x6319[_0x1ad430];return _0x55c846;};'use strict';var Sequelize=require(_0x9631('0x0'));module[_0x9631('0x1')]={'name':{'type':Sequelize[_0x9631('0x2')],'unique':_0x9631('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x9631('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x1be7=['STRING','BOOLEAN','sequelize','exports','name'];(function(_0x43afbb,_0x448109){var _0xa9ddec=function(_0x4e965f){while(--_0x4e965f){_0x43afbb['push'](_0x43afbb['shift']());}};_0xa9ddec(++_0x448109);}(_0x1be7,0xd9));var _0x71be=function(_0x4301c7,_0x34373b){_0x4301c7=_0x4301c7-0x0;var _0x167782=_0x1be7[_0x4301c7];return _0x167782;};'use strict';var Sequelize=require(_0x71be('0x0'));module[_0x71be('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x71be('0x2')},'description':{'type':Sequelize[_0x71be('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x71be('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index ebff34f..65adeb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8789=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','undefined','count','offset','limit','json','apply','reject','save','update','destroy','then','get','Contexts','UserProfileResource','name','send','index','map','VoiceContext','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','/etc/asterisk/extensions_xcally_contexts.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','utf8','render','chan_sip.so','writeFileSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0x8789,0x12f));var _0x9878=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x8789[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0x9878('0x0'));var rimraf=require(_0x9878('0x1'));var zipdir=require(_0x9878('0x2'));var jsonpatch=require(_0x9878('0x3'));var rp=require('request-promise');var moment=require(_0x9878('0x4'));var BPromise=require(_0x9878('0x5'));var Mustache=require(_0x9878('0x6'));var util=require('util');var path=require(_0x9878('0x7'));var sox=require('sox');var csv=require(_0x9878('0x8'));var ejs=require(_0x9878('0x9'));var fs=require('fs');var fs_extra=require(_0x9878('0xa'));var _=require(_0x9878('0xb'));var squel=require('squel');var crypto=require(_0x9878('0xc'));var jsforce=require(_0x9878('0xd'));var deskjs=require(_0x9878('0xe'));var toCsv=require(_0x9878('0x8'));var querystring=require(_0x9878('0xf'));var Papa=require(_0x9878('0x10'));var Redis=require(_0x9878('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9878('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9878('0x13'));var logger=require(_0x9878('0x14'))('api');var utils=require(_0x9878('0x15'));var config=require(_0x9878('0x16'));var licenseUtil=require(_0x9878('0x17'));var db=require(_0x9878('0x18'))['db'];var jayson=require(_0x9878('0x19'));var client=jayson[_0x9878('0x1a')][_0x9878('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x5a5072,_0x177a49,_0x2fdc2c,_0x438914){return new BPromise(function(_0x11a51d,_0x37e2b8){var _0x3a9605=_0x438914||client;return _0x3a9605['request'](_0x5a5072,_0x2fdc2c)['then'](function(_0x35e04a){logger[_0x9878('0x1c')](_0x9878('0x1d'),_0x177a49,_0x9878('0x1e'));logger[_0x9878('0x1f')](_0x9878('0x20'),_0x177a49,_0x9878('0x1e'),JSON[_0x9878('0x21')](_0x35e04a));if(_0x35e04a['error']){if(_0x35e04a[_0x9878('0x22')]['code']===0x1f4){logger[_0x9878('0x22')](_0x9878('0x1d'),_0x177a49,_0x35e04a['error'][_0x9878('0x23')]);return _0x37e2b8(_0x35e04a[_0x9878('0x22')]['message']);}logger[_0x9878('0x22')]('VoiceContext,\x20%s,\x20%s',_0x177a49,_0x35e04a[_0x9878('0x22')][_0x9878('0x23')]);return _0x11a51d(_0x35e04a['error']['message']);}else{logger[_0x9878('0x1c')](_0x9878('0x1d'),_0x177a49,'request\x20sent');_0x11a51d(_0x35e04a[_0x9878('0x24')][_0x9878('0x23')]);}})[_0x9878('0x25')](function(_0x191fd8){logger['error']('VoiceContext,\x20%s,\x20%s',_0x177a49,_0x191fd8);_0x37e2b8(_0x191fd8);});});}function respondWithStatusCode(_0x17c333,_0x2d329b){_0x2d329b=_0x2d329b||0xcc;return function(_0x50f421){if(_0x50f421){return _0x17c333[_0x9878('0x26')](_0x2d329b);}return _0x17c333[_0x9878('0x27')](_0x2d329b)[_0x9878('0x28')]();};}function respondWithResult(_0xd1155c,_0x1ced04){_0x1ced04=_0x1ced04||0xc8;return function(_0x532d09){if(_0x532d09){return _0xd1155c[_0x9878('0x27')](_0x1ced04)['json'](_0x532d09);}};}function respondWithFilteredResult(_0x4907ff,_0x804094){return function(_0x413af4){if(_0x413af4){var _0x30d2bb=typeof _0x804094['offset']===_0x9878('0x29')&&typeof _0x804094['limit']==='undefined';var _0x230c5d=_0x413af4[_0x9878('0x2a')];var _0x27e59b=_0x30d2bb?0x0:_0x804094[_0x9878('0x2b')];var _0x1c13d1=_0x30d2bb?_0x413af4[_0x9878('0x2a')]:_0x804094[_0x9878('0x2b')]+_0x804094[_0x9878('0x2c')];var _0x4565b2;if(_0x1c13d1>=_0x230c5d){_0x1c13d1=_0x230c5d;_0x4565b2=0xc8;}else{_0x4565b2=0xce;}_0x4907ff[_0x9878('0x27')](_0x4565b2);return _0x4907ff['set']('Content-Range',_0x27e59b+'-'+_0x1c13d1+'/'+_0x230c5d)[_0x9878('0x2d')](_0x413af4);}return null;};}function patchUpdates(_0x1c3152){return function(_0x20e1b8){try{jsonpatch[_0x9878('0x2e')](_0x20e1b8,_0x1c3152,!![]);}catch(_0xb909ea){return BPromise[_0x9878('0x2f')](_0xb909ea);}return _0x20e1b8[_0x9878('0x30')]();};}function saveUpdates(_0x2180eb,_0x5919fe){return function(_0x45b2fd){if(_0x45b2fd){return _0x45b2fd[_0x9878('0x31')](_0x2180eb)['then'](function(_0x416841){return _0x416841;});}return null;};}function removeEntity(_0x3c6140,_0x35e696){return function(_0x1f36df){if(_0x1f36df){return _0x1f36df[_0x9878('0x32')]()[_0x9878('0x33')](function(){var _0x22e446=_0x1f36df[_0x9878('0x34')]({'plain':!![]});var _0x2c1aad=_0x9878('0x35');return db[_0x9878('0x36')][_0x9878('0x32')]({'where':{'type':_0x2c1aad,'resourceId':_0x22e446['id']}})[_0x9878('0x33')](function(){return _0x1f36df;});})[_0x9878('0x33')](function(){_0x3c6140[_0x9878('0x27')](0xcc)[_0x9878('0x28')]();});}};}function handleEntityNotFound(_0x42e727,_0x492d42){return function(_0x139eaf){if(!_0x139eaf){_0x42e727[_0x9878('0x26')](0x194);}return _0x139eaf;};}function handleError(_0x2b3262,_0xe44a6d){_0xe44a6d=_0xe44a6d||0x1f4;return function(_0xa274b8){logger[_0x9878('0x22')](_0xa274b8['stack']);if(_0xa274b8[_0x9878('0x37')]){delete _0xa274b8[_0x9878('0x37')];}_0x2b3262[_0x9878('0x27')](_0xe44a6d)[_0x9878('0x38')](_0xa274b8);};}exports[_0x9878('0x39')]=function(_0x697ff0,_0x40e711){var _0x24768b={},_0xd20e51={},_0x21e3c5={'count':0x0,'rows':[]};var _0x3fdaeb=_[_0x9878('0x3a')](db[_0x9878('0x3b')]['rawAttributes'],function(_0x289d1b){return{'name':_0x289d1b[_0x9878('0x3c')],'type':_0x289d1b[_0x9878('0x3d')][_0x9878('0x3e')]};});_0xd20e51[_0x9878('0x3f')]=_[_0x9878('0x3a')](_0x3fdaeb,_0x9878('0x37'));_0xd20e51[_0x9878('0x40')]=_[_0x9878('0x41')](_0x697ff0[_0x9878('0x40')]);_0xd20e51[_0x9878('0x42')]=_[_0x9878('0x43')](_0xd20e51[_0x9878('0x3f')],_0xd20e51[_0x9878('0x40')]);_0x24768b['attributes']=_['intersection'](_0xd20e51['model'],qs[_0x9878('0x44')](_0x697ff0['query']['fields']));_0x24768b[_0x9878('0x45')]=_0x24768b[_0x9878('0x45')][_0x9878('0x46')]?_0x24768b[_0x9878('0x45')]:_0xd20e51[_0x9878('0x3f')];if(!_0x697ff0[_0x9878('0x40')][_0x9878('0x47')](_0x9878('0x48'))){_0x24768b['limit']=qs[_0x9878('0x2c')](_0x697ff0[_0x9878('0x40')]['limit']);_0x24768b['offset']=qs[_0x9878('0x2b')](_0x697ff0[_0x9878('0x40')][_0x9878('0x2b')]);}_0x24768b[_0x9878('0x49')]=qs[_0x9878('0x4a')](_0x697ff0[_0x9878('0x40')][_0x9878('0x4a')]);_0x24768b['where']=qs[_0x9878('0x42')](_[_0x9878('0x4b')](_0x697ff0[_0x9878('0x40')],_0xd20e51[_0x9878('0x42')]),_0x3fdaeb);if(_0x697ff0[_0x9878('0x40')][_0x9878('0x4c')]){_0x24768b[_0x9878('0x4d')]=_[_0x9878('0x4e')](_0x24768b[_0x9878('0x4d')],{'$or':_[_0x9878('0x3a')](_0x3fdaeb,function(_0x3ee37c){if(_0x3ee37c['type']!==_0x9878('0x4f')){var _0x3a3ca7={};_0x3a3ca7[_0x3ee37c[_0x9878('0x37')]]={'$like':'%'+_0x697ff0[_0x9878('0x40')][_0x9878('0x4c')]+'%'};return _0x3a3ca7;}})});}_0x24768b=_['merge']({},_0x24768b,_0x697ff0[_0x9878('0x50')]);var _0x1474c2={'where':_0x24768b[_0x9878('0x4d')]};return db[_0x9878('0x3b')][_0x9878('0x2a')](_0x1474c2)[_0x9878('0x33')](function(_0x3c12a4){_0x21e3c5[_0x9878('0x2a')]=_0x3c12a4;if(_0x697ff0[_0x9878('0x40')][_0x9878('0x51')]){_0x24768b[_0x9878('0x52')]=[{'all':!![]}];}return db[_0x9878('0x3b')][_0x9878('0x53')](_0x24768b);})[_0x9878('0x33')](function(_0x15486e){_0x21e3c5[_0x9878('0x54')]=_0x15486e;return _0x21e3c5;})[_0x9878('0x33')](respondWithFilteredResult(_0x40e711,_0x24768b))[_0x9878('0x25')](handleError(_0x40e711,null));};exports[_0x9878('0x55')]=function(_0x424653,_0x4c1b67){var _0x103aef={'raw':![],'where':{'id':_0x424653[_0x9878('0x56')]['id']}},_0x1e10da={};_0x1e10da[_0x9878('0x3f')]=_[_0x9878('0x41')](db[_0x9878('0x3b')]['rawAttributes']);_0x1e10da[_0x9878('0x40')]=_[_0x9878('0x41')](_0x424653[_0x9878('0x40')]);_0x1e10da[_0x9878('0x42')]=_[_0x9878('0x43')](_0x1e10da['model'],_0x1e10da[_0x9878('0x40')]);_0x103aef[_0x9878('0x45')]=_[_0x9878('0x43')](_0x1e10da['model'],qs[_0x9878('0x44')](_0x424653[_0x9878('0x40')][_0x9878('0x44')]));_0x103aef[_0x9878('0x45')]=_0x103aef['attributes'][_0x9878('0x46')]?_0x103aef['attributes']:_0x1e10da['model'];if(_0x424653['query']['includeAll']){_0x103aef[_0x9878('0x52')]=[{'all':!![]}];}_0x103aef=_[_0x9878('0x4e')]({},_0x103aef,_0x424653['options']);return db['VoiceContext'][_0x9878('0x57')](_0x103aef)[_0x9878('0x33')](handleEntityNotFound(_0x4c1b67,null))[_0x9878('0x33')](respondWithResult(_0x4c1b67,null))[_0x9878('0x25')](handleError(_0x4c1b67,null));};exports[_0x9878('0x58')]=function(_0x3a19ae,_0x71b6f6,_0x2e6f95){var _0x5a4e61;return db[_0x9878('0x3b')]['create'](_0x3a19ae[_0x9878('0x59')],{'raw':!![]})[_0x9878('0x33')](function(_0x50d3c1){_0x5a4e61=_0x50d3c1;return db[_0x9878('0x3b')][_0x9878('0x53')]({'raw':!![]});})[_0x9878('0x33')](function(_0x5eeb69){var _0x58fe2c=fs[_0x9878('0x5a')](path[_0x9878('0x5b')](config[_0x9878('0x5c')],_0x9878('0x5d')),'utf8');var _0x758ffc=ejs['render'](_0x58fe2c,{'contexts':_0x5eeb69||[]});fs['writeFileSync'](_0x9878('0x5e'),_0x758ffc);})[_0x9878('0x33')](function(){return respondWithRpcPromise(_0x9878('0x5f'),_0x9878('0x58'),{'module':'chan_sip.so'});})[_0x9878('0x33')](function(){var _0x33723e=_0x3a19ae['user'][_0x9878('0x34')]({'plain':!![]});if(!_0x33723e)throw new Error(_0x9878('0x60'));if(_0x33723e[_0x9878('0x61')]===_0x9878('0x62')){var _0x318963=_0x5a4e61[_0x9878('0x34')]({'plain':!![]});return db[_0x9878('0x63')][_0x9878('0x57')]({'where':{'name':_0x9878('0x35'),'userProfileId':_0x33723e[_0x9878('0x64')]},'raw':!![]})[_0x9878('0x33')](function(_0x38b1dc){if(_0x38b1dc&&_0x38b1dc[_0x9878('0x65')]===0x0){return db[_0x9878('0x36')][_0x9878('0x58')]({'name':_0x318963['name'],'resourceId':_0x318963['id'],'type':_0x38b1dc[_0x9878('0x37')],'sectionId':_0x38b1dc['id']},{})[_0x9878('0x33')](function(){return _0x5a4e61;});}else{return _0x5a4e61;}})[_0x9878('0x25')](function(_0x411234){logger[_0x9878('0x22')](_0x9878('0x66'),_0x411234);throw _0x411234;});}return _0x5a4e61;})['then'](respondWithResult(_0x71b6f6,0xc9))[_0x9878('0x25')](handleError(_0x71b6f6,null));};exports[_0x9878('0x31')]=function(_0x172d10,_0x48ff46,_0x2ec75d){var _0x14ec1b;return db[_0x9878('0x3b')][_0x9878('0x57')]({'where':{'id':_0x172d10[_0x9878('0x56')]['id']}})[_0x9878('0x33')](handleEntityNotFound(_0x48ff46,null))[_0x9878('0x33')](saveUpdates(_0x172d10[_0x9878('0x59')],null))[_0x9878('0x33')](function(_0xa872a8){if(_0xa872a8){_0x14ec1b=_0xa872a8;return db[_0x9878('0x3b')]['findAll']({'raw':!![]});}})[_0x9878('0x33')](function(_0x2247b8){var _0x49277f=fs[_0x9878('0x5a')](path[_0x9878('0x5b')](config[_0x9878('0x5c')],_0x9878('0x5d')),_0x9878('0x67'));var _0x15e652=ejs[_0x9878('0x68')](_0x49277f,{'contexts':_0x2247b8||[]});fs['writeFileSync'](_0x9878('0x5e'),_0x15e652);})['then'](function(){return respondWithRpcPromise(_0x9878('0x5f'),'update',{'module':_0x9878('0x69')});})['then'](function(){return _0x14ec1b;})['then'](respondWithResult(_0x48ff46,null))[_0x9878('0x25')](handleError(_0x48ff46,null));};exports[_0x9878('0x32')]=function(_0x3e2fbb,_0x16dee5,_0x429049){var _0x445115;return db['VoiceContext'][_0x9878('0x57')]({'where':{'id':_0x3e2fbb[_0x9878('0x56')]['id']}})[_0x9878('0x33')](handleEntityNotFound(_0x16dee5,null))[_0x9878('0x33')](removeEntity(_0x16dee5,null))[_0x9878('0x33')](function(){return db[_0x9878('0x3b')][_0x9878('0x53')]({'raw':!![]});})[_0x9878('0x33')](function(_0xc7c8b5){var _0x51f4b7=fs[_0x9878('0x5a')](path[_0x9878('0x5b')](config[_0x9878('0x5c')],'server/files/templates/context.ejs'),_0x9878('0x67'));var _0x3808eb=ejs['render'](_0x51f4b7,{'contexts':_0xc7c8b5});fs[_0x9878('0x6a')](_0x9878('0x5e'),_0x3808eb);return respondWithRpcPromise(_0x9878('0x5f'),_0x9878('0x32'),{'module':_0x9878('0x69')});})[_0x9878('0x25')](handleError(_0x16dee5,null));};
\ No newline at end of file
+var _0x42b9=['role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/context.ejs','chan_sip.so','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','VoiceContext,\x20%s,\x20%s','message','result','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','get','Contexts','UserProfileResource','destroy','sendStatus','name','send','map','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','merge','include','VoiceContext','findAll','rows','catch','show','params','length','includeAll','options','create','body','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user'];(function(_0x8ebb33,_0x13f312){var _0x453c81=function(_0x3f9152){while(--_0x3f9152){_0x8ebb33['push'](_0x8ebb33['shift']());}};_0x453c81(++_0x13f312);}(_0x42b9,0x19c));var _0x942b=function(_0x29d9b2,_0x1e3dde){_0x29d9b2=_0x29d9b2-0x0;var _0x44ed88=_0x42b9[_0x29d9b2];return _0x44ed88;};'use strict';var emlformat=require(_0x942b('0x0'));var rimraf=require(_0x942b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x942b('0x2'));var rp=require(_0x942b('0x3'));var moment=require(_0x942b('0x4'));var BPromise=require(_0x942b('0x5'));var Mustache=require('mustache');var util=require(_0x942b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x942b('0x7'));var ejs=require(_0x942b('0x8'));var fs=require('fs');var fs_extra=require(_0x942b('0x9'));var _=require(_0x942b('0xa'));var squel=require(_0x942b('0xb'));var crypto=require(_0x942b('0xc'));var jsforce=require(_0x942b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x942b('0x7'));var querystring=require('querystring');var Papa=require(_0x942b('0xe'));var Redis=require(_0x942b('0xf'));var authService=require(_0x942b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x942b('0x11'));var hardwareService=require(_0x942b('0x12'));var logger=require('../../config/logger')(_0x942b('0x13'));var utils=require(_0x942b('0x14'));var config=require(_0x942b('0x15'));var licenseUtil=require(_0x942b('0x16'));var db=require(_0x942b('0x17'))['db'];var jayson=require(_0x942b('0x18'));var client=jayson['client'][_0x942b('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x5a3bc3,_0x3b08e4,_0x15252e,_0xcbae28){return new BPromise(function(_0x1c9649,_0x556e90){var _0x14c3db=_0xcbae28||client;return _0x14c3db[_0x942b('0x1a')](_0x5a3bc3,_0x15252e)[_0x942b('0x1b')](function(_0x4c0332){logger[_0x942b('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x3b08e4,_0x942b('0x1d'));logger['debug'](_0x942b('0x1e'),_0x3b08e4,_0x942b('0x1d'),JSON['stringify'](_0x4c0332));if(_0x4c0332[_0x942b('0x1f')]){if(_0x4c0332[_0x942b('0x1f')]['code']===0x1f4){logger[_0x942b('0x1f')](_0x942b('0x20'),_0x3b08e4,_0x4c0332['error']['message']);return _0x556e90(_0x4c0332['error'][_0x942b('0x21')]);}logger['error'](_0x942b('0x20'),_0x3b08e4,_0x4c0332[_0x942b('0x1f')][_0x942b('0x21')]);return _0x1c9649(_0x4c0332['error'][_0x942b('0x21')]);}else{logger[_0x942b('0x1c')](_0x942b('0x20'),_0x3b08e4,_0x942b('0x1d'));_0x1c9649(_0x4c0332[_0x942b('0x22')][_0x942b('0x21')]);}})['catch'](function(_0x36d1bd){logger[_0x942b('0x1f')](_0x942b('0x20'),_0x3b08e4,_0x36d1bd);_0x556e90(_0x36d1bd);});});}function respondWithStatusCode(_0x348a8e,_0x5f0a0a){_0x5f0a0a=_0x5f0a0a||0xcc;return function(_0xc7e3c4){if(_0xc7e3c4){return _0x348a8e['sendStatus'](_0x5f0a0a);}return _0x348a8e[_0x942b('0x23')](_0x5f0a0a)[_0x942b('0x24')]();};}function respondWithResult(_0x1747de,_0x4695ae){_0x4695ae=_0x4695ae||0xc8;return function(_0x389568){if(_0x389568){return _0x1747de[_0x942b('0x23')](_0x4695ae)['json'](_0x389568);}};}function respondWithFilteredResult(_0x1e5e75,_0x2f81ec){return function(_0x247301){if(_0x247301){var _0x397ae4=typeof _0x2f81ec[_0x942b('0x25')]==='undefined'&&typeof _0x2f81ec['limit']===_0x942b('0x26');var _0x3333c5=_0x247301['count'];var _0x37a9a7=_0x397ae4?0x0:_0x2f81ec['offset'];var _0x4f5f26=_0x397ae4?_0x247301[_0x942b('0x27')]:_0x2f81ec[_0x942b('0x25')]+_0x2f81ec[_0x942b('0x28')];var _0x39029c;if(_0x4f5f26>=_0x3333c5){_0x4f5f26=_0x3333c5;_0x39029c=0xc8;}else{_0x39029c=0xce;}_0x1e5e75[_0x942b('0x23')](_0x39029c);return _0x1e5e75[_0x942b('0x29')](_0x942b('0x2a'),_0x37a9a7+'-'+_0x4f5f26+'/'+_0x3333c5)[_0x942b('0x2b')](_0x247301);}return null;};}function patchUpdates(_0x561669){return function(_0x4fee12){try{jsonpatch[_0x942b('0x2c')](_0x4fee12,_0x561669,!![]);}catch(_0x5c49f7){return BPromise[_0x942b('0x2d')](_0x5c49f7);}return _0x4fee12[_0x942b('0x2e')]();};}function saveUpdates(_0x2ca770,_0x15a755){return function(_0x4818e5){if(_0x4818e5){return _0x4818e5[_0x942b('0x2f')](_0x2ca770)[_0x942b('0x1b')](function(_0x4e751b){return _0x4e751b;});}return null;};}function removeEntity(_0x79ad2b,_0xcd293f){return function(_0x4fbd42){if(_0x4fbd42){return _0x4fbd42['destroy']()[_0x942b('0x1b')](function(){var _0x3a5748=_0x4fbd42[_0x942b('0x30')]({'plain':!![]});var _0xff8cbf=_0x942b('0x31');return db[_0x942b('0x32')][_0x942b('0x33')]({'where':{'type':_0xff8cbf,'resourceId':_0x3a5748['id']}})[_0x942b('0x1b')](function(){return _0x4fbd42;});})[_0x942b('0x1b')](function(){_0x79ad2b[_0x942b('0x23')](0xcc)[_0x942b('0x24')]();});}};}function handleEntityNotFound(_0x3a5de5,_0x3a0ebb){return function(_0x41ac3c){if(!_0x41ac3c){_0x3a5de5[_0x942b('0x34')](0x194);}return _0x41ac3c;};}function handleError(_0x5b2881,_0x1904fd){_0x1904fd=_0x1904fd||0x1f4;return function(_0x51f13b){logger[_0x942b('0x1f')](_0x51f13b['stack']);if(_0x51f13b[_0x942b('0x35')]){delete _0x51f13b[_0x942b('0x35')];}_0x5b2881[_0x942b('0x23')](_0x1904fd)[_0x942b('0x36')](_0x51f13b);};}exports['index']=function(_0x60cc68,_0x71736e){var _0x3f8b21={},_0x40a6d9={},_0x3b257e={'count':0x0,'rows':[]};var _0x3d92e9=_[_0x942b('0x37')](db['VoiceContext']['rawAttributes'],function(_0x397f06){return{'name':_0x397f06['fieldName'],'type':_0x397f06[_0x942b('0x38')][_0x942b('0x39')]};});_0x40a6d9[_0x942b('0x3a')]=_['map'](_0x3d92e9,_0x942b('0x35'));_0x40a6d9[_0x942b('0x3b')]=_[_0x942b('0x3c')](_0x60cc68[_0x942b('0x3b')]);_0x40a6d9[_0x942b('0x3d')]=_[_0x942b('0x3e')](_0x40a6d9['model'],_0x40a6d9[_0x942b('0x3b')]);_0x3f8b21[_0x942b('0x3f')]=_[_0x942b('0x3e')](_0x40a6d9[_0x942b('0x3a')],qs[_0x942b('0x40')](_0x60cc68[_0x942b('0x3b')][_0x942b('0x40')]));_0x3f8b21['attributes']=_0x3f8b21[_0x942b('0x3f')]['length']?_0x3f8b21[_0x942b('0x3f')]:_0x40a6d9[_0x942b('0x3a')];if(!_0x60cc68[_0x942b('0x3b')][_0x942b('0x41')](_0x942b('0x42'))){_0x3f8b21[_0x942b('0x28')]=qs[_0x942b('0x28')](_0x60cc68['query']['limit']);_0x3f8b21[_0x942b('0x25')]=qs['offset'](_0x60cc68[_0x942b('0x3b')]['offset']);}_0x3f8b21['order']=qs[_0x942b('0x43')](_0x60cc68[_0x942b('0x3b')][_0x942b('0x43')]);_0x3f8b21[_0x942b('0x44')]=qs[_0x942b('0x3d')](_['pick'](_0x60cc68[_0x942b('0x3b')],_0x40a6d9['filters']),_0x3d92e9);if(_0x60cc68['query']['filter']){_0x3f8b21[_0x942b('0x44')]=_['merge'](_0x3f8b21[_0x942b('0x44')],{'$or':_[_0x942b('0x37')](_0x3d92e9,function(_0x3f6fde){if(_0x3f6fde[_0x942b('0x38')]!==_0x942b('0x45')){var _0x2b5276={};_0x2b5276[_0x3f6fde['name']]={'$like':'%'+_0x60cc68[_0x942b('0x3b')][_0x942b('0x46')]+'%'};return _0x2b5276;}})});}_0x3f8b21=_[_0x942b('0x47')]({},_0x3f8b21,_0x60cc68['options']);var _0x24cc30={'where':_0x3f8b21['where']};return db['VoiceContext'][_0x942b('0x27')](_0x24cc30)['then'](function(_0x4a5bf0){_0x3b257e[_0x942b('0x27')]=_0x4a5bf0;if(_0x60cc68['query']['includeAll']){_0x3f8b21[_0x942b('0x48')]=[{'all':!![]}];}return db[_0x942b('0x49')][_0x942b('0x4a')](_0x3f8b21);})[_0x942b('0x1b')](function(_0x75695e){_0x3b257e[_0x942b('0x4b')]=_0x75695e;return _0x3b257e;})['then'](respondWithFilteredResult(_0x71736e,_0x3f8b21))[_0x942b('0x4c')](handleError(_0x71736e,null));};exports[_0x942b('0x4d')]=function(_0x54fc4b,_0x48d84f){var _0x3e6e14={'raw':![],'where':{'id':_0x54fc4b[_0x942b('0x4e')]['id']}},_0x2f6df5={};_0x2f6df5[_0x942b('0x3a')]=_[_0x942b('0x3c')](db[_0x942b('0x49')]['rawAttributes']);_0x2f6df5['query']=_[_0x942b('0x3c')](_0x54fc4b[_0x942b('0x3b')]);_0x2f6df5['filters']=_['intersection'](_0x2f6df5[_0x942b('0x3a')],_0x2f6df5[_0x942b('0x3b')]);_0x3e6e14['attributes']=_[_0x942b('0x3e')](_0x2f6df5['model'],qs[_0x942b('0x40')](_0x54fc4b['query'][_0x942b('0x40')]));_0x3e6e14['attributes']=_0x3e6e14[_0x942b('0x3f')][_0x942b('0x4f')]?_0x3e6e14[_0x942b('0x3f')]:_0x2f6df5['model'];if(_0x54fc4b['query'][_0x942b('0x50')]){_0x3e6e14['include']=[{'all':!![]}];}_0x3e6e14=_[_0x942b('0x47')]({},_0x3e6e14,_0x54fc4b[_0x942b('0x51')]);return db[_0x942b('0x49')]['find'](_0x3e6e14)[_0x942b('0x1b')](handleEntityNotFound(_0x48d84f,null))[_0x942b('0x1b')](respondWithResult(_0x48d84f,null))[_0x942b('0x4c')](handleError(_0x48d84f,null));};exports[_0x942b('0x52')]=function(_0xc08ce1,_0x41d29a,_0xe346c5){var _0xd3221f;return db[_0x942b('0x49')]['create'](_0xc08ce1[_0x942b('0x53')],{'raw':!![]})[_0x942b('0x1b')](function(_0x1380cb){_0xd3221f=_0x1380cb;return db['VoiceContext'][_0x942b('0x4a')]({'raw':!![]});})[_0x942b('0x1b')](function(_0x1f16ce){var _0x193d80=fs[_0x942b('0x54')](path[_0x942b('0x55')](config[_0x942b('0x56')],'server/files/templates/context.ejs'),_0x942b('0x57'));var _0x221595=ejs[_0x942b('0x58')](_0x193d80,{'contexts':_0x1f16ce||[]});fs[_0x942b('0x59')](_0x942b('0x5a'),_0x221595);})[_0x942b('0x1b')](function(){return respondWithRpcPromise(_0x942b('0x5b'),_0x942b('0x52'),{'module':'chan_sip.so'});})[_0x942b('0x1b')](function(){var _0x23cd05=_0xc08ce1[_0x942b('0x5c')]['get']({'plain':!![]});if(!_0x23cd05)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23cd05[_0x942b('0x5d')]===_0x942b('0x5c')){var _0x477d0a=_0xd3221f['get']({'plain':!![]});return db[_0x942b('0x5e')][_0x942b('0x5f')]({'where':{'name':'Contexts','userProfileId':_0x23cd05[_0x942b('0x60')]},'raw':!![]})[_0x942b('0x1b')](function(_0x502c83){if(_0x502c83&&_0x502c83[_0x942b('0x61')]===0x0){return db[_0x942b('0x32')][_0x942b('0x52')]({'name':_0x477d0a['name'],'resourceId':_0x477d0a['id'],'type':_0x502c83[_0x942b('0x35')],'sectionId':_0x502c83['id']},{})[_0x942b('0x1b')](function(){return _0xd3221f;});}else{return _0xd3221f;}})[_0x942b('0x4c')](function(_0xc30d45){logger[_0x942b('0x1f')](_0x942b('0x62'),_0xc30d45);throw _0xc30d45;});}return _0xd3221f;})[_0x942b('0x1b')](respondWithResult(_0x41d29a,0xc9))['catch'](handleError(_0x41d29a,null));};exports['update']=function(_0x24bbf6,_0x5a80d7,_0x3379c7){var _0x2857a0;return db[_0x942b('0x49')][_0x942b('0x5f')]({'where':{'id':_0x24bbf6[_0x942b('0x4e')]['id']}})[_0x942b('0x1b')](handleEntityNotFound(_0x5a80d7,null))['then'](saveUpdates(_0x24bbf6[_0x942b('0x53')],null))[_0x942b('0x1b')](function(_0xa9157a){if(_0xa9157a){_0x2857a0=_0xa9157a;return db['VoiceContext'][_0x942b('0x4a')]({'raw':!![]});}})[_0x942b('0x1b')](function(_0x29f072){var _0x19c406=fs[_0x942b('0x54')](path[_0x942b('0x55')](config[_0x942b('0x56')],_0x942b('0x63')),_0x942b('0x57'));var _0x4b69b3=ejs[_0x942b('0x58')](_0x19c406,{'contexts':_0x29f072||[]});fs[_0x942b('0x59')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4b69b3);})['then'](function(){return respondWithRpcPromise('Reload','update',{'module':_0x942b('0x64')});})[_0x942b('0x1b')](function(){return _0x2857a0;})['then'](respondWithResult(_0x5a80d7,null))[_0x942b('0x4c')](handleError(_0x5a80d7,null));};exports[_0x942b('0x33')]=function(_0x49cf2f,_0x14ec4f,_0xdf68b0){var _0x40a969;return db[_0x942b('0x49')][_0x942b('0x5f')]({'where':{'id':_0x49cf2f[_0x942b('0x4e')]['id']}})[_0x942b('0x1b')](handleEntityNotFound(_0x14ec4f,null))[_0x942b('0x1b')](removeEntity(_0x14ec4f,null))['then'](function(){return db[_0x942b('0x49')][_0x942b('0x4a')]({'raw':!![]});})['then'](function(_0x18db0f){var _0x197075=fs[_0x942b('0x54')](path[_0x942b('0x55')](config[_0x942b('0x56')],_0x942b('0x63')),_0x942b('0x57'));var _0x13efa3=ejs['render'](_0x197075,{'contexts':_0x18db0f});fs[_0x942b('0x59')](_0x942b('0x5a'),_0x13efa3);return respondWithRpcPromise(_0x942b('0x5b'),_0x942b('0x33'),{'module':_0x942b('0x64')});})[_0x942b('0x4c')](handleError(_0x14ec4f,null));};
\ No newline at end of file
index e4f35e7..555b8d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ebf=['rimraf','./voiceContext.attributes','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x26020a,_0x1db674){var _0x2a02a0=function(_0x1f83be){while(--_0x1f83be){_0x26020a['push'](_0x26020a['shift']());}};_0x2a02a0(++_0x1db674);}(_0x7ebf,0x119));var _0xf7eb=function(_0x38a8af,_0x5729e2){_0x38a8af=_0x38a8af-0x0;var _0x25cc45=_0x7ebf[_0x38a8af];return _0x25cc45;};'use strict';var _=require(_0xf7eb('0x0'));var util=require(_0xf7eb('0x1'));var logger=require(_0xf7eb('0x2'))(_0xf7eb('0x3'));var moment=require(_0xf7eb('0x4'));var BPromise=require(_0xf7eb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf7eb('0x6'));var rimraf=require(_0xf7eb('0x7'));var config=require('../../config/environment');var attributes=require(_0xf7eb('0x8'));module['exports']=function(_0x57feac,_0x173ddd){return _0x57feac[_0xf7eb('0x9')](_0xf7eb('0xa'),attributes,{'tableName':_0xf7eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8998=['VoiceContext','voice_contexts','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports'];(function(_0x28c7a7,_0x55a356){var _0x50610f=function(_0x3a4038){while(--_0x3a4038){_0x28c7a7['push'](_0x28c7a7['shift']());}};_0x50610f(++_0x55a356);}(_0x8998,0x1ca));var _0x8899=function(_0x2ebff1,_0x5195bd){_0x2ebff1=_0x2ebff1-0x0;var _0x547033=_0x8998[_0x2ebff1];return _0x547033;};'use strict';var _=require(_0x8899('0x0'));var util=require(_0x8899('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8899('0x2'));var BPromise=require(_0x8899('0x3'));var rp=require(_0x8899('0x4'));var fs=require('fs');var path=require(_0x8899('0x5'));var rimraf=require(_0x8899('0x6'));var config=require(_0x8899('0x7'));var attributes=require(_0x8899('0x8'));module[_0x8899('0x9')]=function(_0x333623,_0x28947d){return _0x333623['define'](_0x8899('0xa'),attributes,{'tableName':_0x8899('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c0fe9c7..45e26fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x416b=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb'];(function(_0x13fda6,_0x12ac4a){var _0x26cc23=function(_0x386996){while(--_0x386996){_0x13fda6['push'](_0x13fda6['shift']());}};_0x26cc23(++_0x12ac4a);}(_0x416b,0x1c8));var _0xb416=function(_0x79a6e8,_0x1c2b24){_0x79a6e8=_0x79a6e8-0x0;var _0xeeb993=_0x416b[_0x79a6e8];return _0xeeb993;};'use strict';var _=require(_0xb416('0x0'));var util=require(_0xb416('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb416('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb416('0x3'))['db'];var utils=require(_0xb416('0x4'));var logger=require(_0xb416('0x5'))(_0xb416('0x6'));var config=require(_0xb416('0x7'));var jayson=require(_0xb416('0x8'));var client=jayson[_0xb416('0x9')][_0xb416('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11956d,_0x41d631,_0x3f3868){return new BPromise(function(_0x53974f,_0x3c3f4b){return client[_0xb416('0xb')](_0x11956d,_0x3f3868)[_0xb416('0xc')](function(_0x574591){logger[_0xb416('0xd')](_0xb416('0xe'),_0x41d631,_0xb416('0xf'));logger[_0xb416('0x10')](_0xb416('0x11'),_0x41d631,'request\x20sent',JSON['stringify'](_0x574591));if(_0x574591['error']){if(_0x574591[_0xb416('0x12')][_0xb416('0x13')]===0x1f4){logger[_0xb416('0x12')](_0xb416('0xe'),_0x41d631,_0x574591['error'][_0xb416('0x14')]);return _0x3c3f4b(_0x574591[_0xb416('0x12')]['message']);}logger[_0xb416('0x12')]('VoiceContext,\x20%s,\x20%s',_0x41d631,_0x574591[_0xb416('0x12')][_0xb416('0x14')]);return _0x53974f(_0x574591[_0xb416('0x12')][_0xb416('0x14')]);}else{logger['info'](_0xb416('0xe'),_0x41d631,_0xb416('0xf'));_0x53974f(_0x574591[_0xb416('0x15')][_0xb416('0x14')]);}})[_0xb416('0x16')](function(_0x9230ad){logger[_0xb416('0x12')]('VoiceContext,\x20%s,\x20%s',_0x41d631,_0x9230ad);_0x3c3f4b(_0x9230ad);});});}
\ No newline at end of file
+var _0x349e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x349e,0xcb));var _0xe349=function(_0x5dc400,_0x19716f){_0x5dc400=_0x5dc400-0x0;var _0x42499f=_0x349e[_0x5dc400];return _0x42499f;};'use strict';var _=require(_0xe349('0x0'));var util=require(_0xe349('0x1'));var moment=require(_0xe349('0x2'));var BPromise=require(_0xe349('0x3'));var rs=require(_0xe349('0x4'));var fs=require('fs');var Redis=require(_0xe349('0x5'));var db=require(_0xe349('0x6'))['db'];var utils=require(_0xe349('0x7'));var logger=require(_0xe349('0x8'))('rpc');var config=require(_0xe349('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe349('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x494605,_0xcb9b49,_0x6efb47){return new BPromise(function(_0x535968,_0x114c1b){return client[_0xe349('0xb')](_0x494605,_0x6efb47)[_0xe349('0xc')](function(_0x7b08d2){logger[_0xe349('0xd')]('VoiceContext,\x20%s,\x20%s',_0xcb9b49,_0xe349('0xe'));logger[_0xe349('0xf')](_0xe349('0x10'),_0xcb9b49,_0xe349('0xe'),JSON[_0xe349('0x11')](_0x7b08d2));if(_0x7b08d2[_0xe349('0x12')]){if(_0x7b08d2[_0xe349('0x12')][_0xe349('0x13')]===0x1f4){logger[_0xe349('0x12')](_0xe349('0x14'),_0xcb9b49,_0x7b08d2[_0xe349('0x12')][_0xe349('0x15')]);return _0x114c1b(_0x7b08d2[_0xe349('0x12')][_0xe349('0x15')]);}logger[_0xe349('0x12')](_0xe349('0x14'),_0xcb9b49,_0x7b08d2[_0xe349('0x12')]['message']);return _0x535968(_0x7b08d2[_0xe349('0x12')]['message']);}else{logger[_0xe349('0xd')](_0xe349('0x14'),_0xcb9b49,_0xe349('0xe'));_0x535968(_0x7b08d2['result']['message']);}})[_0xe349('0x16')](function(_0x3ff17c){logger[_0xe349('0x12')](_0xe349('0x14'),_0xcb9b49,_0x3ff17c);_0x114c1b(_0x3ff17c);});});}
\ No newline at end of file
index 58d3c7f..3af4622 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe07c=['../../components/auth/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2483a4,_0x5e69e6){var _0x32d51d=function(_0x299b61){while(--_0x299b61){_0x2483a4['push'](_0x2483a4['shift']());}};_0x32d51d(++_0x5e69e6);}(_0xe07c,0x1f3));var _0xce07=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xe07c[_0x4b2436];return _0x4f5ab2;};'use strict';var multer=require(_0xce07('0x0'));var util=require(_0xce07('0x1'));var path=require(_0xce07('0x2'));var timeout=require(_0xce07('0x3'));var express=require(_0xce07('0x4'));var router=express[_0xce07('0x5')]();var fs_extra=require(_0xce07('0x6'));var auth=require(_0xce07('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xce07('0x8'));var controller=require(_0xce07('0x9'));router[_0xce07('0xa')]('/',auth[_0xce07('0xb')](),controller[_0xce07('0xc')]);router[_0xce07('0xa')](_0xce07('0xd'),auth[_0xce07('0xb')](),controller[_0xce07('0xe')]);router[_0xce07('0xa')](_0xce07('0xf'),auth[_0xce07('0xb')](),controller[_0xce07('0x10')]);router[_0xce07('0x11')]('/',auth[_0xce07('0xb')](),controller[_0xce07('0x12')]);router['put'](_0xce07('0xf'),auth[_0xce07('0xb')](),controller[_0xce07('0x13')]);router['delete'](_0xce07('0xf'),auth[_0xce07('0xb')](),controller[_0xce07('0x14')]);module[_0xce07('0x15')]=router;
\ No newline at end of file
+var _0xbcf4=['put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbcf4,0x16a));var _0x4bcf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcf4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x4bcf('0x0'));var path=require(_0x4bcf('0x1'));var timeout=require(_0x4bcf('0x2'));var express=require(_0x4bcf('0x3'));var router=express['Router']();var fs_extra=require(_0x4bcf('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4bcf('0x5'));var config=require(_0x4bcf('0x6'));var controller=require(_0x4bcf('0x7'));router[_0x4bcf('0x8')]('/',auth['isAuthenticated'](),controller[_0x4bcf('0x9')]);router[_0x4bcf('0x8')](_0x4bcf('0xa'),auth[_0x4bcf('0xb')](),controller[_0x4bcf('0xc')]);router[_0x4bcf('0x8')](_0x4bcf('0xd'),auth[_0x4bcf('0xb')](),controller[_0x4bcf('0xe')]);router[_0x4bcf('0xf')]('/',auth[_0x4bcf('0xb')](),controller['create']);router[_0x4bcf('0x10')](_0x4bcf('0xd'),auth['isAuthenticated'](),controller[_0x4bcf('0x11')]);router[_0x4bcf('0x12')](_0x4bcf('0xd'),auth[_0x4bcf('0xb')](),controller[_0x4bcf('0x13')]);module[_0x4bcf('0x14')]=router;
\ No newline at end of file
index cde9c53..c37bc5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f0d=['STRING','INTEGER','DATE','called,connect,complete','exports'];(function(_0x3530b3,_0x55a220){var _0x4d351c=function(_0x194aa7){while(--_0x194aa7){_0x3530b3['push'](_0x3530b3['shift']());}};_0x4d351c(++_0x55a220);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x100342,_0x41be34){_0x100342=_0x100342-0x0;var _0x1f1824=_0x6f0d[_0x100342];return _0x1f1824;};'use strict';var Sequelize=require('sequelize');module[_0xd6f0('0x0')]={'privilege':{'type':Sequelize[_0xd6f0('0x1')]},'channel':{'type':Sequelize[_0xd6f0('0x1')]},'channelstate':{'type':Sequelize[_0xd6f0('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd6f0('0x1')]},'calleridname':{'type':Sequelize[_0xd6f0('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd6f0('0x1')]},'connectedlinename':{'type':Sequelize[_0xd6f0('0x1')]},'language':{'type':Sequelize[_0xd6f0('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd6f0('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd6f0('0x2')]},'uniqueid':{'type':Sequelize[_0xd6f0('0x1')]},'linkedid':{'type':Sequelize[_0xd6f0('0x1')]},'destchannel':{'type':Sequelize[_0xd6f0('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xd6f0('0x1')]},'destcalleridname':{'type':Sequelize[_0xd6f0('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd6f0('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd6f0('0x1')]},'destlanguage':{'type':Sequelize[_0xd6f0('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xd6f0('0x1')]},'destexten':{'type':Sequelize[_0xd6f0('0x1')]},'destpriority':{'type':Sequelize[_0xd6f0('0x2')]},'destuniqueid':{'type':Sequelize[_0xd6f0('0x1')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0xd6f0('0x1')]},'dialstatus':{'type':Sequelize[_0xd6f0('0x1')]},'starttime':{'type':Sequelize[_0xd6f0('0x3')]},'answertime':{'type':Sequelize[_0xd6f0('0x3')]},'endtime':{'type':Sequelize[_0xd6f0('0x3')]},'lastevent':{'type':Sequelize[_0xd6f0('0x1')],'comment':_0xd6f0('0x4')},'routeId':{'type':Sequelize[_0xd6f0('0x2')]},'duration':{'type':Sequelize[_0xd6f0('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xd6f0('0x2')]}};
\ No newline at end of file
+var _0x9c44=['STRING','INTEGER','DATE','called,connect,complete'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize[_0x49c4('0x0')]},'channel':{'type':Sequelize[_0x49c4('0x0')]},'channelstate':{'type':Sequelize[_0x49c4('0x1')]},'channelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'calleridnum':{'type':Sequelize[_0x49c4('0x0')]},'calleridname':{'type':Sequelize[_0x49c4('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x49c4('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x49c4('0x0')]},'exten':{'type':Sequelize[_0x49c4('0x0')]},'priority':{'type':Sequelize[_0x49c4('0x1')]},'uniqueid':{'type':Sequelize[_0x49c4('0x0')]},'linkedid':{'type':Sequelize[_0x49c4('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x49c4('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridnum':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridname':{'type':Sequelize[_0x49c4('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x49c4('0x0')]},'destaccountcode':{'type':Sequelize[_0x49c4('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x49c4('0x0')]},'destpriority':{'type':Sequelize[_0x49c4('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x49c4('0x0')]},'dialstatus':{'type':Sequelize[_0x49c4('0x0')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x49c4('0x2')]},'endtime':{'type':Sequelize[_0x49c4('0x2')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x49c4('0x3')},'routeId':{'type':Sequelize[_0x49c4('0x1')]},'duration':{'type':Sequelize[_0x49c4('0x1')]},'holdtime':{'type':Sequelize[_0x49c4('0x1')]},'billableseconds':{'type':Sequelize[_0x49c4('0x1')]}};
\ No newline at end of file
index 8541cbb..05cb9a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d6b=['type','key','model','keys','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','then','includeAll','findAll','show','params','rawAttributes','fields','options','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','destroy','sendStatus','error','stack','name','send','index','map','VoiceDialReport'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x1d6b,0x6c));var _0xb1d6=function(_0x4b4277,_0x22676f){_0x4b4277=_0x4b4277-0x0;var _0x1ff405=_0x1d6b[_0x4b4277];return _0x1ff405;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb1d6('0x0'));var zipdir=require(_0xb1d6('0x1'));var jsonpatch=require(_0xb1d6('0x2'));var rp=require(_0xb1d6('0x3'));var moment=require(_0xb1d6('0x4'));var BPromise=require(_0xb1d6('0x5'));var Mustache=require(_0xb1d6('0x6'));var util=require('util');var path=require(_0xb1d6('0x7'));var sox=require(_0xb1d6('0x8'));var csv=require('to-csv');var ejs=require(_0xb1d6('0x9'));var fs=require('fs');var fs_extra=require(_0xb1d6('0xa'));var _=require(_0xb1d6('0xb'));var squel=require('squel');var crypto=require(_0xb1d6('0xc'));var jsforce=require(_0xb1d6('0xd'));var deskjs=require(_0xb1d6('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb1d6('0xf'));var Papa=require(_0xb1d6('0x10'));var Redis=require(_0xb1d6('0x11'));var authService=require(_0xb1d6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb1d6('0x13'));var hardwareService=require(_0xb1d6('0x14'));var logger=require(_0xb1d6('0x15'))(_0xb1d6('0x16'));var utils=require('../../config/utils');var config=require(_0xb1d6('0x17'));var licenseUtil=require(_0xb1d6('0x18'));var db=require(_0xb1d6('0x19'))['db'];function respondWithStatusCode(_0x1bfb0b,_0x2e94f1){_0x2e94f1=_0x2e94f1||0xcc;return function(_0x32d9b8){if(_0x32d9b8){return _0x1bfb0b['sendStatus'](_0x2e94f1);}return _0x1bfb0b[_0xb1d6('0x1a')](_0x2e94f1)[_0xb1d6('0x1b')]();};}function respondWithResult(_0x1887dc,_0x17b978){_0x17b978=_0x17b978||0xc8;return function(_0x34ab41){if(_0x34ab41){return _0x1887dc[_0xb1d6('0x1a')](_0x17b978)[_0xb1d6('0x1c')](_0x34ab41);}};}function respondWithFilteredResult(_0x138b34,_0xa67bc3){return function(_0x1978b9){if(_0x1978b9){var _0x20b2cb=typeof _0xa67bc3[_0xb1d6('0x1d')]==='undefined'&&typeof _0xa67bc3[_0xb1d6('0x1e')]===_0xb1d6('0x1f');var _0x3b511b=_0x1978b9[_0xb1d6('0x20')];var _0x59f525=_0x20b2cb?0x0:_0xa67bc3['offset'];var _0x16d3b2=_0x20b2cb?_0x1978b9[_0xb1d6('0x20')]:_0xa67bc3[_0xb1d6('0x1d')]+_0xa67bc3['limit'];var _0x5ba669;if(_0x16d3b2>=_0x3b511b){_0x16d3b2=_0x3b511b;_0x5ba669=0xc8;}else{_0x5ba669=0xce;}_0x138b34[_0xb1d6('0x1a')](_0x5ba669);return _0x138b34['set'](_0xb1d6('0x21'),_0x59f525+'-'+_0x16d3b2+'/'+_0x3b511b)[_0xb1d6('0x1c')](_0x1978b9);}return null;};}function patchUpdates(_0x2c855e){return function(_0x242eb9){try{jsonpatch[_0xb1d6('0x22')](_0x242eb9,_0x2c855e,!![]);}catch(_0xed996b){return BPromise['reject'](_0xed996b);}return _0x242eb9[_0xb1d6('0x23')]();};}function saveUpdates(_0x114389,_0x124a12){return function(_0x1d38e0){if(_0x1d38e0){return _0x1d38e0[_0xb1d6('0x24')](_0x114389)['then'](function(_0xf28caf){return _0xf28caf;});}return null;};}function removeEntity(_0x2bec71,_0x5d38a3){return function(_0x57fbba){if(_0x57fbba){return _0x57fbba[_0xb1d6('0x25')]()['then'](function(){_0x2bec71['status'](0xcc)[_0xb1d6('0x1b')]();});}};}function handleEntityNotFound(_0xb9ca71,_0x528cb6){return function(_0x8b00db){if(!_0x8b00db){_0xb9ca71[_0xb1d6('0x26')](0x194);}return _0x8b00db;};}function handleError(_0x2ab25f,_0x5337af){_0x5337af=_0x5337af||0x1f4;return function(_0x4bf9e7){logger[_0xb1d6('0x27')](_0x4bf9e7[_0xb1d6('0x28')]);if(_0x4bf9e7[_0xb1d6('0x29')]){delete _0x4bf9e7[_0xb1d6('0x29')];}_0x2ab25f[_0xb1d6('0x1a')](_0x5337af)[_0xb1d6('0x2a')](_0x4bf9e7);};}exports[_0xb1d6('0x2b')]=function(_0x460e32,_0x1b3729){var _0x17893c={},_0x45f5c0={},_0x4f43e2={'count':0x0,'rows':[]};var _0x5a8b90=_[_0xb1d6('0x2c')](db[_0xb1d6('0x2d')]['rawAttributes'],function(_0x4b9815){return{'name':_0x4b9815['fieldName'],'type':_0x4b9815[_0xb1d6('0x2e')][_0xb1d6('0x2f')]};});_0x45f5c0[_0xb1d6('0x30')]=_[_0xb1d6('0x2c')](_0x5a8b90,_0xb1d6('0x29'));_0x45f5c0['query']=_[_0xb1d6('0x31')](_0x460e32[_0xb1d6('0x32')]);_0x45f5c0['filters']=_[_0xb1d6('0x33')](_0x45f5c0[_0xb1d6('0x30')],_0x45f5c0['query']);_0x17893c[_0xb1d6('0x34')]=_[_0xb1d6('0x33')](_0x45f5c0[_0xb1d6('0x30')],qs['fields'](_0x460e32[_0xb1d6('0x32')]['fields']));_0x17893c[_0xb1d6('0x34')]=_0x17893c[_0xb1d6('0x34')][_0xb1d6('0x35')]?_0x17893c[_0xb1d6('0x34')]:_0x45f5c0[_0xb1d6('0x30')];if(!_0x460e32[_0xb1d6('0x32')][_0xb1d6('0x36')](_0xb1d6('0x37'))){_0x17893c[_0xb1d6('0x1e')]=qs[_0xb1d6('0x1e')](_0x460e32['query'][_0xb1d6('0x1e')]);_0x17893c[_0xb1d6('0x1d')]=qs[_0xb1d6('0x1d')](_0x460e32[_0xb1d6('0x32')]['offset']);}_0x17893c[_0xb1d6('0x38')]=qs[_0xb1d6('0x39')](_0x460e32[_0xb1d6('0x32')][_0xb1d6('0x39')]);_0x17893c[_0xb1d6('0x3a')]=qs[_0xb1d6('0x3b')](_[_0xb1d6('0x3c')](_0x460e32[_0xb1d6('0x32')],_0x45f5c0['filters']),_0x5a8b90);if(_0x460e32['query'][_0xb1d6('0x3d')]){_0x17893c[_0xb1d6('0x3a')]=_[_0xb1d6('0x3e')](_0x17893c[_0xb1d6('0x3a')],{'$or':_[_0xb1d6('0x2c')](_0x5a8b90,function(_0x2a51d9){if(_0x2a51d9[_0xb1d6('0x2e')]!==_0xb1d6('0x3f')){var _0x5d6d99={};_0x5d6d99[_0x2a51d9['name']]={'$like':'%'+_0x460e32['query']['filter']+'%'};return _0x5d6d99;}})});}_0x17893c=_[_0xb1d6('0x3e')]({},_0x17893c,_0x460e32['options']);var _0x1eb210={'where':_0x17893c[_0xb1d6('0x3a')]};return db[_0xb1d6('0x2d')][_0xb1d6('0x20')](_0x1eb210)[_0xb1d6('0x40')](function(_0x2f01b5){_0x4f43e2['count']=_0x2f01b5;if(_0x460e32[_0xb1d6('0x32')][_0xb1d6('0x41')]){_0x17893c['include']=[{'all':!![]}];}return db[_0xb1d6('0x2d')][_0xb1d6('0x42')](_0x17893c);})[_0xb1d6('0x40')](function(_0x4f0ad8){_0x4f43e2['rows']=_0x4f0ad8;return _0x4f43e2;})[_0xb1d6('0x40')](respondWithFilteredResult(_0x1b3729,_0x17893c))['catch'](handleError(_0x1b3729,null));};exports[_0xb1d6('0x43')]=function(_0x4ade4b,_0x142cee){var _0x33b1b3={'raw':!![],'where':{'id':_0x4ade4b[_0xb1d6('0x44')]['id']}},_0xe3a7e8={};_0xe3a7e8[_0xb1d6('0x30')]=_[_0xb1d6('0x31')](db[_0xb1d6('0x2d')][_0xb1d6('0x45')]);_0xe3a7e8[_0xb1d6('0x32')]=_[_0xb1d6('0x31')](_0x4ade4b[_0xb1d6('0x32')]);_0xe3a7e8[_0xb1d6('0x3b')]=_[_0xb1d6('0x33')](_0xe3a7e8['model'],_0xe3a7e8[_0xb1d6('0x32')]);_0x33b1b3[_0xb1d6('0x34')]=_[_0xb1d6('0x33')](_0xe3a7e8[_0xb1d6('0x30')],qs[_0xb1d6('0x46')](_0x4ade4b['query']['fields']));_0x33b1b3[_0xb1d6('0x34')]=_0x33b1b3[_0xb1d6('0x34')][_0xb1d6('0x35')]?_0x33b1b3[_0xb1d6('0x34')]:_0xe3a7e8[_0xb1d6('0x30')];if(_0x4ade4b[_0xb1d6('0x32')]['includeAll']){_0x33b1b3['include']=[{'all':!![]}];}_0x33b1b3=_[_0xb1d6('0x3e')]({},_0x33b1b3,_0x4ade4b[_0xb1d6('0x47')]);return db['VoiceDialReport'][_0xb1d6('0x48')](_0x33b1b3)[_0xb1d6('0x40')](handleEntityNotFound(_0x142cee,null))[_0xb1d6('0x40')](respondWithResult(_0x142cee,null))[_0xb1d6('0x49')](handleError(_0x142cee,null));};exports[_0xb1d6('0x4a')]=function(_0x36cf66,_0x4d376e){return db['VoiceDialReport'][_0xb1d6('0x4a')](_0x36cf66['body'],{})[_0xb1d6('0x40')](respondWithResult(_0x4d376e,0xc9))[_0xb1d6('0x49')](handleError(_0x4d376e,null));};exports['update']=function(_0x2959c5,_0x563e6e){if(_0x2959c5['body']['id']){delete _0x2959c5[_0xb1d6('0x4b')]['id'];}return db[_0xb1d6('0x2d')][_0xb1d6('0x48')]({'where':{'id':_0x2959c5[_0xb1d6('0x44')]['id']}})[_0xb1d6('0x40')](handleEntityNotFound(_0x563e6e,null))['then'](saveUpdates(_0x2959c5[_0xb1d6('0x4b')],null))[_0xb1d6('0x40')](respondWithResult(_0x563e6e,null))[_0xb1d6('0x49')](handleError(_0x563e6e,null));};exports['destroy']=function(_0x400acb,_0x2982f6){return db[_0xb1d6('0x2d')][_0xb1d6('0x48')]({'where':{'id':_0x400acb['params']['id']}})['then'](handleEntityNotFound(_0x2982f6,null))[_0xb1d6('0x40')](removeEntity(_0x2982f6,null))[_0xb1d6('0x49')](handleError(_0x2982f6,null));};exports[_0xb1d6('0x4c')]=function(_0x587be6,_0x3d3005){return db[_0xb1d6('0x2d')]['describe']()['then'](respondWithResult(_0x3d3005,null))[_0xb1d6('0x49')](handleError(_0x3d3005,null));};
\ No newline at end of file
+var _0xfbb7=['body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','VoiceDialReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create'];(function(_0x3634a0,_0x383192){var _0x4daa90=function(_0x5888a9){while(--_0x5888a9){_0x3634a0['push'](_0x3634a0['shift']());}};_0x4daa90(++_0x383192);}(_0xfbb7,0x143));var _0x7fbb=function(_0x4dfea1,_0x3bf267){_0x4dfea1=_0x4dfea1-0x0;var _0xf69f56=_0xfbb7[_0x4dfea1];return _0xf69f56;};'use strict';var emlformat=require(_0x7fbb('0x0'));var rimraf=require(_0x7fbb('0x1'));var zipdir=require(_0x7fbb('0x2'));var jsonpatch=require(_0x7fbb('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7fbb('0x4'));var Mustache=require(_0x7fbb('0x5'));var util=require(_0x7fbb('0x6'));var path=require('path');var sox=require(_0x7fbb('0x7'));var csv=require(_0x7fbb('0x8'));var ejs=require(_0x7fbb('0x9'));var fs=require('fs');var fs_extra=require(_0x7fbb('0xa'));var _=require(_0x7fbb('0xb'));var squel=require(_0x7fbb('0xc'));var crypto=require(_0x7fbb('0xd'));var jsforce=require(_0x7fbb('0xe'));var deskjs=require(_0x7fbb('0xf'));var toCsv=require(_0x7fbb('0x8'));var querystring=require(_0x7fbb('0x10'));var Papa=require(_0x7fbb('0x11'));var Redis=require(_0x7fbb('0x12'));var authService=require(_0x7fbb('0x13'));var qs=require(_0x7fbb('0x14'));var as=require(_0x7fbb('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fbb('0x16'))(_0x7fbb('0x17'));var utils=require(_0x7fbb('0x18'));var config=require(_0x7fbb('0x19'));var licenseUtil=require(_0x7fbb('0x1a'));var db=require(_0x7fbb('0x1b'))['db'];function respondWithStatusCode(_0x16babf,_0x1287fc){_0x1287fc=_0x1287fc||0xcc;return function(_0x228cf4){if(_0x228cf4){return _0x16babf[_0x7fbb('0x1c')](_0x1287fc);}return _0x16babf[_0x7fbb('0x1d')](_0x1287fc)[_0x7fbb('0x1e')]();};}function respondWithResult(_0x3481b6,_0x79e355){_0x79e355=_0x79e355||0xc8;return function(_0x4bdccb){if(_0x4bdccb){return _0x3481b6[_0x7fbb('0x1d')](_0x79e355)[_0x7fbb('0x1f')](_0x4bdccb);}};}function respondWithFilteredResult(_0x9ad123,_0x2b2c82){return function(_0x2b148f){if(_0x2b148f){var _0x71415b=typeof _0x2b2c82[_0x7fbb('0x20')]===_0x7fbb('0x21')&&typeof _0x2b2c82[_0x7fbb('0x22')]===_0x7fbb('0x21');var _0x51f0dd=_0x2b148f[_0x7fbb('0x23')];var _0x454a41=_0x71415b?0x0:_0x2b2c82[_0x7fbb('0x20')];var _0x510ce1=_0x71415b?_0x2b148f['count']:_0x2b2c82[_0x7fbb('0x20')]+_0x2b2c82['limit'];var _0x55a148;if(_0x510ce1>=_0x51f0dd){_0x510ce1=_0x51f0dd;_0x55a148=0xc8;}else{_0x55a148=0xce;}_0x9ad123[_0x7fbb('0x1d')](_0x55a148);return _0x9ad123[_0x7fbb('0x24')](_0x7fbb('0x25'),_0x454a41+'-'+_0x510ce1+'/'+_0x51f0dd)[_0x7fbb('0x1f')](_0x2b148f);}return null;};}function patchUpdates(_0x2d3904){return function(_0x31e153){try{jsonpatch[_0x7fbb('0x26')](_0x31e153,_0x2d3904,!![]);}catch(_0x187bc0){return BPromise[_0x7fbb('0x27')](_0x187bc0);}return _0x31e153[_0x7fbb('0x28')]();};}function saveUpdates(_0x409b17,_0x54063e){return function(_0x7bf2c9){if(_0x7bf2c9){return _0x7bf2c9[_0x7fbb('0x29')](_0x409b17)['then'](function(_0x202630){return _0x202630;});}return null;};}function removeEntity(_0x316273,_0x26bab7){return function(_0x138b9b){if(_0x138b9b){return _0x138b9b['destroy']()['then'](function(){_0x316273[_0x7fbb('0x1d')](0xcc)[_0x7fbb('0x1e')]();});}};}function handleEntityNotFound(_0x4066a8,_0x2d5ac0){return function(_0x29c713){if(!_0x29c713){_0x4066a8[_0x7fbb('0x1c')](0x194);}return _0x29c713;};}function handleError(_0x298818,_0x2f1b8a){_0x2f1b8a=_0x2f1b8a||0x1f4;return function(_0x231307){logger['error'](_0x231307[_0x7fbb('0x2a')]);if(_0x231307[_0x7fbb('0x2b')]){delete _0x231307[_0x7fbb('0x2b')];}_0x298818['status'](_0x2f1b8a)[_0x7fbb('0x2c')](_0x231307);};}exports[_0x7fbb('0x2d')]=function(_0x12622b,_0x4a36cb){var _0x5793ff={},_0x123a47={},_0x444354={'count':0x0,'rows':[]};var _0x39f1d8=_[_0x7fbb('0x2e')](db[_0x7fbb('0x2f')]['rawAttributes'],function(_0x374eb8){return{'name':_0x374eb8[_0x7fbb('0x30')],'type':_0x374eb8[_0x7fbb('0x31')][_0x7fbb('0x32')]};});_0x123a47[_0x7fbb('0x33')]=_['map'](_0x39f1d8,'name');_0x123a47[_0x7fbb('0x34')]=_[_0x7fbb('0x35')](_0x12622b[_0x7fbb('0x34')]);_0x123a47[_0x7fbb('0x36')]=_[_0x7fbb('0x37')](_0x123a47[_0x7fbb('0x33')],_0x123a47['query']);_0x5793ff[_0x7fbb('0x38')]=_[_0x7fbb('0x37')](_0x123a47['model'],qs['fields'](_0x12622b[_0x7fbb('0x34')][_0x7fbb('0x39')]));_0x5793ff[_0x7fbb('0x38')]=_0x5793ff['attributes']['length']?_0x5793ff[_0x7fbb('0x38')]:_0x123a47['model'];if(!_0x12622b[_0x7fbb('0x34')][_0x7fbb('0x3a')](_0x7fbb('0x3b'))){_0x5793ff[_0x7fbb('0x22')]=qs[_0x7fbb('0x22')](_0x12622b['query'][_0x7fbb('0x22')]);_0x5793ff[_0x7fbb('0x20')]=qs[_0x7fbb('0x20')](_0x12622b['query'][_0x7fbb('0x20')]);}_0x5793ff[_0x7fbb('0x3c')]=qs[_0x7fbb('0x3d')](_0x12622b['query'][_0x7fbb('0x3d')]);_0x5793ff[_0x7fbb('0x3e')]=qs[_0x7fbb('0x36')](_['pick'](_0x12622b['query'],_0x123a47[_0x7fbb('0x36')]),_0x39f1d8);if(_0x12622b['query'][_0x7fbb('0x3f')]){_0x5793ff['where']=_['merge'](_0x5793ff['where'],{'$or':_[_0x7fbb('0x2e')](_0x39f1d8,function(_0x13e215){if(_0x13e215['type']!==_0x7fbb('0x40')){var _0x56d8cc={};_0x56d8cc[_0x13e215[_0x7fbb('0x2b')]]={'$like':'%'+_0x12622b['query'][_0x7fbb('0x3f')]+'%'};return _0x56d8cc;}})});}_0x5793ff=_[_0x7fbb('0x41')]({},_0x5793ff,_0x12622b[_0x7fbb('0x42')]);var _0x2c9827={'where':_0x5793ff['where']};return db[_0x7fbb('0x2f')][_0x7fbb('0x23')](_0x2c9827)[_0x7fbb('0x43')](function(_0x3b68f6){_0x444354['count']=_0x3b68f6;if(_0x12622b[_0x7fbb('0x34')][_0x7fbb('0x44')]){_0x5793ff[_0x7fbb('0x45')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x7fbb('0x46')](_0x5793ff);})[_0x7fbb('0x43')](function(_0xfa29bb){_0x444354[_0x7fbb('0x47')]=_0xfa29bb;return _0x444354;})[_0x7fbb('0x43')](respondWithFilteredResult(_0x4a36cb,_0x5793ff))[_0x7fbb('0x48')](handleError(_0x4a36cb,null));};exports['show']=function(_0x4d055f,_0x509355){var _0x3e65aa={'raw':!![],'where':{'id':_0x4d055f[_0x7fbb('0x49')]['id']}},_0x1f56bb={};_0x1f56bb['model']=_[_0x7fbb('0x35')](db['VoiceDialReport'][_0x7fbb('0x4a')]);_0x1f56bb[_0x7fbb('0x34')]=_[_0x7fbb('0x35')](_0x4d055f['query']);_0x1f56bb[_0x7fbb('0x36')]=_[_0x7fbb('0x37')](_0x1f56bb['model'],_0x1f56bb['query']);_0x3e65aa[_0x7fbb('0x38')]=_['intersection'](_0x1f56bb[_0x7fbb('0x33')],qs[_0x7fbb('0x39')](_0x4d055f['query'][_0x7fbb('0x39')]));_0x3e65aa[_0x7fbb('0x38')]=_0x3e65aa['attributes']['length']?_0x3e65aa[_0x7fbb('0x38')]:_0x1f56bb['model'];if(_0x4d055f[_0x7fbb('0x34')][_0x7fbb('0x44')]){_0x3e65aa[_0x7fbb('0x45')]=[{'all':!![]}];}_0x3e65aa=_[_0x7fbb('0x41')]({},_0x3e65aa,_0x4d055f[_0x7fbb('0x42')]);return db[_0x7fbb('0x2f')][_0x7fbb('0x4b')](_0x3e65aa)[_0x7fbb('0x43')](handleEntityNotFound(_0x509355,null))[_0x7fbb('0x43')](respondWithResult(_0x509355,null))['catch'](handleError(_0x509355,null));};exports[_0x7fbb('0x4c')]=function(_0x32ca0b,_0x2e6986){return db[_0x7fbb('0x2f')][_0x7fbb('0x4c')](_0x32ca0b['body'],{})[_0x7fbb('0x43')](respondWithResult(_0x2e6986,0xc9))[_0x7fbb('0x48')](handleError(_0x2e6986,null));};exports[_0x7fbb('0x29')]=function(_0x5c673a,_0x424b19){if(_0x5c673a[_0x7fbb('0x4d')]['id']){delete _0x5c673a['body']['id'];}return db[_0x7fbb('0x2f')][_0x7fbb('0x4b')]({'where':{'id':_0x5c673a[_0x7fbb('0x49')]['id']}})['then'](handleEntityNotFound(_0x424b19,null))[_0x7fbb('0x43')](saveUpdates(_0x5c673a[_0x7fbb('0x4d')],null))['then'](respondWithResult(_0x424b19,null))[_0x7fbb('0x48')](handleError(_0x424b19,null));};exports[_0x7fbb('0x4e')]=function(_0x5aac70,_0x5ce0b7){return db[_0x7fbb('0x2f')][_0x7fbb('0x4b')]({'where':{'id':_0x5aac70[_0x7fbb('0x49')]['id']}})[_0x7fbb('0x43')](handleEntityNotFound(_0x5ce0b7,null))['then'](removeEntity(_0x5ce0b7,null))[_0x7fbb('0x48')](handleError(_0x5ce0b7,null));};exports[_0x7fbb('0x4f')]=function(_0x344529,_0x48481d){return db['VoiceDialReport'][_0x7fbb('0x4f')]()['then'](respondWithResult(_0x48481d,null))[_0x7fbb('0x48')](handleError(_0x48481d,null));};
\ No newline at end of file
index 62301b5..9fd7ff3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5523=['api','bluebird','request-promise','path','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','../../config/logger'];(function(_0x242a98,_0x13988e){var _0x580999=function(_0x341927){while(--_0x341927){_0x242a98['push'](_0x242a98['shift']());}};_0x580999(++_0x13988e);}(_0x5523,0x15b));var _0x3552=function(_0x5dffd7,_0x149e2e){_0x5dffd7=_0x5dffd7-0x0;var _0x4a8688=_0x5523[_0x5dffd7];return _0x4a8688;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3552('0x0'))(_0x3552('0x1'));var moment=require('moment');var BPromise=require(_0x3552('0x2'));var rp=require(_0x3552('0x3'));var fs=require('fs');var path=require(_0x3552('0x4'));var rimraf=require('rimraf');var config=require(_0x3552('0x5'));var attributes=require(_0x3552('0x6'));module[_0x3552('0x7')]=function(_0x49f208,_0x2213c0){return _0x49f208[_0x3552('0x8')](_0x3552('0x9'),attributes,{'tableName':_0x3552('0xa'),'paranoid':![],'indexes':[{'fields':[_0x3552('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5715=['request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','uniqueid','lodash','util','api','bluebird'];(function(_0x3d6d6f,_0x588ac4){var _0x4e7fa7=function(_0x3c46c4){while(--_0x3c46c4){_0x3d6d6f['push'](_0x3d6d6f['shift']());}};_0x4e7fa7(++_0x588ac4);}(_0x5715,0xd4));var _0x5571=function(_0x4de1b1,_0x18c64c){_0x4de1b1=_0x4de1b1-0x0;var _0x639f27=_0x5715[_0x4de1b1];return _0x639f27;};'use strict';var _=require(_0x5571('0x0'));var util=require(_0x5571('0x1'));var logger=require('../../config/logger')(_0x5571('0x2'));var moment=require('moment');var BPromise=require(_0x5571('0x3'));var rp=require(_0x5571('0x4'));var fs=require('fs');var path=require(_0x5571('0x5'));var rimraf=require(_0x5571('0x6'));var config=require(_0x5571('0x7'));var attributes=require(_0x5571('0x8'));module[_0x5571('0x9')]=function(_0x5a4fbe,_0x397cb2){return _0x5a4fbe[_0x5571('0xa')]('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x5571('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 49b1853..b484566 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe698=['raw','CreateVoiceDialReport','debug','stringify','UpdateVoiceDialReport','update','where','attributes','limit','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','error','code','message','info','VoiceDialReport','create','body','options'];(function(_0x516927,_0xb4aad0){var _0x30749b=function(_0x2ca6cc){while(--_0x2ca6cc){_0x516927['push'](_0x516927['shift']());}};_0x30749b(++_0xb4aad0);}(_0xe698,0x180));var _0x8e69=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe698[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8e69('0x0'));var util=require(_0x8e69('0x1'));var moment=require(_0x8e69('0x2'));var BPromise=require(_0x8e69('0x3'));var rs=require(_0x8e69('0x4'));var fs=require('fs');var Redis=require(_0x8e69('0x5'));var db=require(_0x8e69('0x6'))['db'];var utils=require(_0x8e69('0x7'));var logger=require(_0x8e69('0x8'))(_0x8e69('0x9'));var config=require('../../config/environment');var jayson=require(_0x8e69('0xa'));var client=jayson[_0x8e69('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xced606,_0x1f4c34,_0x4a4a4c){return new BPromise(function(_0x3badcf,_0x4d5d17){return client[_0x8e69('0xc')](_0xced606,_0x4a4a4c)[_0x8e69('0xd')](function(_0x2a3e0c){logger['info'](_0x8e69('0xe'),_0x1f4c34,_0x8e69('0xf'));logger['debug']('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x1f4c34,_0x8e69('0xf'),JSON['stringify'](_0x2a3e0c));if(_0x2a3e0c[_0x8e69('0x10')]){if(_0x2a3e0c[_0x8e69('0x10')][_0x8e69('0x11')]===0x1f4){logger[_0x8e69('0x10')](_0x8e69('0xe'),_0x1f4c34,_0x2a3e0c[_0x8e69('0x10')][_0x8e69('0x12')]);return _0x4d5d17(_0x2a3e0c[_0x8e69('0x10')][_0x8e69('0x12')]);}logger[_0x8e69('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x1f4c34,_0x2a3e0c[_0x8e69('0x10')][_0x8e69('0x12')]);return _0x3badcf(_0x2a3e0c[_0x8e69('0x10')][_0x8e69('0x12')]);}else{logger[_0x8e69('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x1f4c34,_0x8e69('0xf'));_0x3badcf(_0x2a3e0c['result'][_0x8e69('0x12')]);}})['catch'](function(_0x12a469){logger[_0x8e69('0x10')](_0x8e69('0xe'),_0x1f4c34,_0x12a469);_0x4d5d17(_0x12a469);});});}exports['CreateVoiceDialReport']=function(_0x422625){var _0x4dc221=this;return new Promise(function(_0x8133ae,_0x2dfdc1){return db[_0x8e69('0x14')][_0x8e69('0x15')](_0x422625[_0x8e69('0x16')],{'raw':_0x422625[_0x8e69('0x17')]?_0x422625[_0x8e69('0x17')][_0x8e69('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x263a7a){logger['info'](_0x8e69('0x19'),_0x422625);logger[_0x8e69('0x1a')]('CreateVoiceDialReport',_0x422625,JSON[_0x8e69('0x1b')](_0x263a7a));_0x8133ae(_0x263a7a);})['catch'](function(_0x566709){logger[_0x8e69('0x10')](_0x8e69('0x19'),_0x566709[_0x8e69('0x12')],_0x422625);_0x2dfdc1(_0x4dc221[_0x8e69('0x10')](0x1f4,_0x566709['message']));});});};exports[_0x8e69('0x1c')]=function(_0x17c3f4){var _0x1c7d06=this;return new Promise(function(_0x1bbc38,_0x6d179b){return db[_0x8e69('0x14')][_0x8e69('0x1d')](_0x17c3f4['body'],{'raw':_0x17c3f4[_0x8e69('0x17')]?_0x17c3f4[_0x8e69('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17c3f4[_0x8e69('0x17')]?_0x17c3f4[_0x8e69('0x17')][_0x8e69('0x1e')]||null:null,'attributes':_0x17c3f4[_0x8e69('0x17')]?_0x17c3f4[_0x8e69('0x17')][_0x8e69('0x1f')]||null:null,'limit':_0x17c3f4['options']?_0x17c3f4[_0x8e69('0x17')][_0x8e69('0x20')]||null:null})['then'](function(_0x3c2c7c){logger['info']('UpdateVoiceDialReport',_0x17c3f4);logger['debug'](_0x8e69('0x1c'),_0x17c3f4,JSON[_0x8e69('0x1b')](_0x3c2c7c));_0x1bbc38(_0x3c2c7c);})[_0x8e69('0x21')](function(_0x10c9aa){logger[_0x8e69('0x10')]('UpdateVoiceDialReport',_0x10c9aa[_0x8e69('0x12')],_0x17c3f4);_0x6d179b(_0x1c7d06[_0x8e69('0x10')](0x1f4,_0x10c9aa['message']));});});};
\ No newline at end of file
+var _0x02d6=['VoiceDialReport,\x20%s,\x20%s,\x20%s','code','error','message','CreateVoiceDialReport','VoiceDialReport','create','body','options','stringify','catch','UpdateVoiceDialReport','update','raw','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xfaf9e9,_0x54e675){var _0xc28fbf=function(_0x536461){while(--_0x536461){_0xfaf9e9['push'](_0xfaf9e9['shift']());}};_0xc28fbf(++_0x54e675);}(_0x02d6,0xca));var _0x602d=function(_0x14e6de,_0x293358){_0x14e6de=_0x14e6de-0x0;var _0xc157fc=_0x02d6[_0x14e6de];return _0xc157fc;};'use strict';var _=require(_0x602d('0x0'));var util=require(_0x602d('0x1'));var moment=require(_0x602d('0x2'));var BPromise=require(_0x602d('0x3'));var rs=require(_0x602d('0x4'));var fs=require('fs');var Redis=require(_0x602d('0x5'));var db=require(_0x602d('0x6'))['db'];var utils=require(_0x602d('0x7'));var logger=require('../../config/logger')(_0x602d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x602d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x39a91b,_0x1f3c49,_0x35ebcb){return new BPromise(function(_0x3a19d4,_0x39372e){return client['request'](_0x39a91b,_0x35ebcb)[_0x602d('0xa')](function(_0x167599){logger[_0x602d('0xb')](_0x602d('0xc'),_0x1f3c49,_0x602d('0xd'));logger[_0x602d('0xe')](_0x602d('0xf'),_0x1f3c49,_0x602d('0xd'),JSON['stringify'](_0x167599));if(_0x167599['error']){if(_0x167599['error'][_0x602d('0x10')]===0x1f4){logger[_0x602d('0x11')](_0x602d('0xc'),_0x1f3c49,_0x167599['error'][_0x602d('0x12')]);return _0x39372e(_0x167599['error'][_0x602d('0x12')]);}logger[_0x602d('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x1f3c49,_0x167599[_0x602d('0x11')][_0x602d('0x12')]);return _0x3a19d4(_0x167599[_0x602d('0x11')][_0x602d('0x12')]);}else{logger[_0x602d('0xb')](_0x602d('0xc'),_0x1f3c49,_0x602d('0xd'));_0x3a19d4(_0x167599['result'][_0x602d('0x12')]);}})['catch'](function(_0x3c94c7){logger[_0x602d('0x11')](_0x602d('0xc'),_0x1f3c49,_0x3c94c7);_0x39372e(_0x3c94c7);});});}exports[_0x602d('0x13')]=function(_0x619047){var _0x3fac61=this;return new Promise(function(_0x2dc13c,_0x7f8d2d){return db[_0x602d('0x14')][_0x602d('0x15')](_0x619047[_0x602d('0x16')],{'raw':_0x619047[_0x602d('0x17')]?_0x619047[_0x602d('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x602d('0xa')](function(_0x38f5d3){logger[_0x602d('0xb')](_0x602d('0x13'),_0x619047);logger[_0x602d('0xe')](_0x602d('0x13'),_0x619047,JSON[_0x602d('0x18')](_0x38f5d3));_0x2dc13c(_0x38f5d3);})[_0x602d('0x19')](function(_0x517be0){logger[_0x602d('0x11')](_0x602d('0x13'),_0x517be0[_0x602d('0x12')],_0x619047);_0x7f8d2d(_0x3fac61['error'](0x1f4,_0x517be0[_0x602d('0x12')]));});});};exports[_0x602d('0x1a')]=function(_0x4d2904){var _0xa7357b=this;return new Promise(function(_0xd037c5,_0x310b7f){return db['VoiceDialReport'][_0x602d('0x1b')](_0x4d2904[_0x602d('0x16')],{'raw':_0x4d2904[_0x602d('0x17')]?_0x4d2904[_0x602d('0x17')][_0x602d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d2904[_0x602d('0x17')]?_0x4d2904[_0x602d('0x17')][_0x602d('0x1d')]||null:null,'attributes':_0x4d2904[_0x602d('0x17')]?_0x4d2904[_0x602d('0x17')]['attributes']||null:null,'limit':_0x4d2904['options']?_0x4d2904['options'][_0x602d('0x1e')]||null:null})['then'](function(_0x530626){logger[_0x602d('0xb')]('UpdateVoiceDialReport',_0x4d2904);logger[_0x602d('0xe')](_0x602d('0x1a'),_0x4d2904,JSON[_0x602d('0x18')](_0x530626));_0xd037c5(_0x530626);})[_0x602d('0x19')](function(_0x5db3b9){logger[_0x602d('0x11')](_0x602d('0x1a'),_0x5db3b9[_0x602d('0x12')],_0x4d2904);_0x310b7f(_0xa7357b[_0x602d('0x11')](0x1f4,_0x5db3b9[_0x602d('0x12')]));});});};
\ No newline at end of file
index 1cb8da8..79b8219 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c57=['/:id/applications','addApplications','put','update','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x5c57,0x1f3));var _0x75c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c57[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x75c5('0x0'));var util=require(_0x75c5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x75c5('0x2')]();var fs_extra=require(_0x75c5('0x3'));var auth=require(_0x75c5('0x4'));var interaction=require(_0x75c5('0x5'));var config=require(_0x75c5('0x6'));var controller=require(_0x75c5('0x7'));router[_0x75c5('0x8')]('/',auth[_0x75c5('0x9')](),controller[_0x75c5('0xa')]);router[_0x75c5('0x8')](_0x75c5('0xb'),auth[_0x75c5('0x9')](),controller[_0x75c5('0xc')]);router[_0x75c5('0xd')]('/',auth[_0x75c5('0x9')](),controller['create']);router[_0x75c5('0xd')](_0x75c5('0xe'),auth[_0x75c5('0x9')](),controller[_0x75c5('0xf')]);router[_0x75c5('0x10')]('/:id',auth[_0x75c5('0x9')](),controller[_0x75c5('0x11')]);router['delete'](_0x75c5('0xb'),auth[_0x75c5('0x9')](),controller['destroy']);module[_0x75c5('0x12')]=router;
\ No newline at end of file
+var _0x7125=['../../components/interaction/service','./voiceExtension.controller','isAuthenticated','index','get','/:id','post','/:id/applications','addApplications','put','update','delete','multer','util','path','express','fs-extra','../../components/auth/service'];(function(_0x51b5fe,_0x59a149){var _0x4839d2=function(_0x1e4183){while(--_0x1e4183){_0x51b5fe['push'](_0x51b5fe['shift']());}};_0x4839d2(++_0x59a149);}(_0x7125,0x108));var _0x5712=function(_0xe4bafc,_0x539614){_0xe4bafc=_0xe4bafc-0x0;var _0x36965d=_0x7125[_0xe4bafc];return _0x36965d;};'use strict';var multer=require(_0x5712('0x0'));var util=require(_0x5712('0x1'));var path=require(_0x5712('0x2'));var timeout=require('connect-timeout');var express=require(_0x5712('0x3'));var router=express['Router']();var fs_extra=require(_0x5712('0x4'));var auth=require(_0x5712('0x5'));var interaction=require(_0x5712('0x6'));var config=require('../../config/environment');var controller=require(_0x5712('0x7'));router['get']('/',auth[_0x5712('0x8')](),controller[_0x5712('0x9')]);router[_0x5712('0xa')](_0x5712('0xb'),auth[_0x5712('0x8')](),controller['show']);router[_0x5712('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5712('0xc')](_0x5712('0xd'),auth[_0x5712('0x8')](),controller[_0x5712('0xe')]);router[_0x5712('0xf')](_0x5712('0xb'),auth[_0x5712('0x8')](),controller[_0x5712('0x10')]);router[_0x5712('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 4f667c7..47b8601 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b9f=['INTEGER','wav','BOOLEAN','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','internal','inbound-fax','outbound-fax','any','*,*,*,*'];(function(_0x2594e8,_0xdb0b08){var _0x56ef00=function(_0x4db9eb){while(--_0x4db9eb){_0x2594e8['push'](_0x2594e8['shift']());}};_0x56ef00(++_0xdb0b08);}(_0x3b9f,0x124));var _0xf3b9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x3b9f[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xf3b9('0x0'));module[_0xf3b9('0x1')]={'context':{'type':Sequelize[_0xf3b9('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xf3b9('0x2')],'allowNull':![],'unique':_0xf3b9('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf3b9('0x4')},'appdata':{'type':Sequelize[_0xf3b9('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xf3b9('0x5')](_0xf3b9('0x6'),'outbound',_0xf3b9('0x7'),_0xf3b9('0x8'),_0xf3b9('0x9'),'system',_0xf3b9('0xa')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xf3b9('0x2')],'allowNull':![],'defaultValue':_0xf3b9('0xb')},'IntervalId':{'type':Sequelize[_0xf3b9('0xc')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xf3b9('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xf3b9('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xf3b9('0xc')]},'recordingFormat':{'type':Sequelize[_0xf3b9('0x2')],'defaultValue':_0xf3b9('0xd')},'answer':{'type':Sequelize[_0xf3b9('0xe')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x49e3a6){return this['getDataValue'](_0xf3b9('0xf'));}},'alias':{'type':Sequelize[_0xf3b9('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0x00e9=['getDataValue','exten','sequelize','exports','STRING','compositeIndex','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','INTEGER','BOOLEAN','wav','VIRTUAL'];(function(_0x3b84a8,_0xd456ed){var _0x2c020d=function(_0x46b9e3){while(--_0x46b9e3){_0x3b84a8['push'](_0x3b84a8['shift']());}};_0x2c020d(++_0xd456ed);}(_0x00e9,0x146));var _0x900e=function(_0x3e89d5,_0x381312){_0x3e89d5=_0x3e89d5-0x0;var _0x26a45d=_0x00e9[_0x3e89d5];return _0x26a45d;};'use strict';var Sequelize=require(_0x900e('0x0'));module[_0x900e('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x900e('0x2')],'allowNull':![],'unique':_0x900e('0x3')},'priority':{'type':Sequelize[_0x900e('0x2')],'allowNull':![],'defaultValue':'1','unique':_0x900e('0x3')},'tag':{'type':Sequelize[_0x900e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x900e('0x4')](_0x900e('0x5'),_0x900e('0x6'),_0x900e('0x7'),_0x900e('0x8'),_0x900e('0x9'),_0x900e('0xa'),_0x900e('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x900e('0x2')]},'interval':{'type':Sequelize[_0x900e('0x2')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize[_0x900e('0xc')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x900e('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0x900e('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x900e('0xc')]},'recordingFormat':{'type':Sequelize[_0x900e('0x2')],'defaultValue':_0x900e('0xe')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x900e('0xf')],'get':function(_0x352e03){return this[_0x900e('0x10')](_0x900e('0x11'));}},'alias':{'type':Sequelize[_0x900e('0x2')],'allowNull':!![]}};
\ No newline at end of file
index b69fb49..dce0556 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5762=['outbound','InternalRoutes','internal','ignore','map','value','includes','type','find','name','UserProfileResource','end','error','stack','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','length','body','startsWith','exten','concat','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','cutdigits','alias','addApplications','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','send','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','defaults','redis','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','destroy','then','inbound','OutboundRoutes'];(function(_0x567e72,_0x13d7e5){var _0x312971=function(_0xac1640){while(--_0xac1640){_0x567e72['push'](_0x567e72['shift']());}};_0x312971(++_0x13d7e5);}(_0x5762,0x15d));var _0x2576=function(_0x5b740d,_0x89abbe){_0x5b740d=_0x5b740d-0x0;var _0x46b17c=_0x5762[_0x5b740d];return _0x46b17c;};'use strict';var _=require(_0x2576('0x0'));var Redis=require(_0x2576('0x1'));var qs=require(_0x2576('0x2'));var logger=require(_0x2576('0x3'))('api');var config=require(_0x2576('0x4'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x2576('0x5')](config[_0x2576('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x2576('0x7'))(new Redis(config['redis']));require(_0x2576('0x8'))[_0x2576('0x9')](socket);function respondWithStatusCode(_0x2fd354,_0x5a8db2){_0x5a8db2=_0x5a8db2||0xcc;return function(_0x5ac598){if(_0x5ac598){return _0x2fd354[_0x2576('0xa')](_0x5a8db2);}return _0x2fd354[_0x2576('0xb')](_0x5a8db2)['end']();};}function respondWithResult(_0x23cf5f,_0x5956af){_0x5956af=_0x5956af||0xc8;return function(_0x17ca08){if(_0x17ca08){return _0x23cf5f['status'](_0x5956af)[_0x2576('0xc')](_0x17ca08);}};}function respondWithFilteredResult(_0xd21ba8,_0x52c8f1){return function(_0x27a043){if(_0x27a043){var _0x1fb121=typeof _0x52c8f1[_0x2576('0xd')]==='undefined'&&typeof _0x52c8f1[_0x2576('0xe')]===_0x2576('0xf');var _0x510be6=_0x27a043[_0x2576('0x10')];var _0x5bee06=_0x1fb121?0x0:_0x52c8f1[_0x2576('0xd')];var _0x1f551f=_0x1fb121?_0x27a043[_0x2576('0x10')]:_0x52c8f1[_0x2576('0xd')]+_0x52c8f1[_0x2576('0xe')];var _0x4c8e25;if(_0x1f551f>=_0x510be6){_0x1f551f=_0x510be6;_0x4c8e25=0xc8;}else{_0x4c8e25=0xce;}_0xd21ba8[_0x2576('0xb')](_0x4c8e25);return _0xd21ba8[_0x2576('0x11')](_0x2576('0x12'),_0x5bee06+'-'+_0x1f551f+'/'+_0x510be6)[_0x2576('0xc')](_0x27a043);}return null;};}function removeEntity(_0x3cfed4){return function(_0x1be67b){if(_0x1be67b){return _0x1be67b[_0x2576('0x13')]()[_0x2576('0x14')](function(){var _0x2d8286=_0x1be67b['get']({'plain':!![]});var _0x493e9d=[{'name':'InboundRoutes','value':_0x2576('0x15'),'ignore':![]},{'name':_0x2576('0x16'),'value':_0x2576('0x17'),'ignore':![]},{'name':_0x2576('0x18'),'value':_0x2576('0x19'),'ignore':![]}];var _0x2e8e19=_(_0x493e9d)['filter'](_0x2576('0x1a'))[_0x2576('0x1b')](_0x2576('0x1c'))['value']();if(_[_0x2576('0x1d')](_0x2e8e19,_0x2d8286[_0x2576('0x1e')])){return;}var _0x5da391=_[_0x2576('0x1f')](_0x493e9d,[_0x2576('0x1c'),_0x2d8286[_0x2576('0x1e')]])[_0x2576('0x20')];return db[_0x2576('0x21')]['destroy']({'where':{'type':_0x5da391,'resourceId':_0x2d8286['id']}})[_0x2576('0x14')](function(){return _0x1be67b;});})[_0x2576('0x14')](function(){_0x3cfed4[_0x2576('0xb')](0xcc)[_0x2576('0x22')]();});}};}function handleEntityNotFound(_0x4ece05){return function(_0x2cd168){if(!_0x2cd168){_0x4ece05[_0x2576('0xa')](0x194);}return _0x2cd168;};}function handleError(_0x5b9869,_0x3540a9){_0x3540a9=_0x3540a9||0x1f4;return function(_0x1170f5){logger[_0x2576('0x23')](_0x1170f5[_0x2576('0x24')]);if(_0x1170f5[_0x2576('0x20')]){delete _0x1170f5[_0x2576('0x20')];}_0x5b9869['status'](_0x3540a9)['send'](_0x1170f5);};}exports[_0x2576('0x25')]=function(_0x19b084,_0xe99fee){var _0x293a3a={},_0x573db4={},_0x473c47={'count':0x0,'rows':[]};var _0x1e1195=_['map'](db[_0x2576('0x26')][_0x2576('0x27')],function(_0x2a9a7f){return{'name':_0x2a9a7f[_0x2576('0x28')],'type':_0x2a9a7f[_0x2576('0x1e')][_0x2576('0x29')]};});_0x573db4[_0x2576('0x2a')]=_[_0x2576('0x1b')](_0x1e1195,'name');_0x573db4[_0x2576('0x2b')]=_[_0x2576('0x2c')](_0x19b084[_0x2576('0x2b')]);_0x573db4[_0x2576('0x2d')]=_[_0x2576('0x2e')](_0x573db4[_0x2576('0x2a')],_0x573db4['query']);_0x293a3a['attributes']=_[_0x2576('0x2e')](_0x573db4[_0x2576('0x2a')],qs[_0x2576('0x2f')](_0x19b084[_0x2576('0x2b')][_0x2576('0x2f')]));_0x293a3a['attributes']=_0x293a3a[_0x2576('0x30')]['length']?_0x293a3a[_0x2576('0x30')]:_0x573db4[_0x2576('0x2a')];if(!_0x19b084['query'][_0x2576('0x31')](_0x2576('0x32'))){_0x293a3a['limit']=qs['limit'](_0x19b084[_0x2576('0x2b')][_0x2576('0xe')]);_0x293a3a[_0x2576('0xd')]=qs[_0x2576('0xd')](_0x19b084[_0x2576('0x2b')]['offset']);}_0x293a3a[_0x2576('0x33')]=qs[_0x2576('0x34')](_0x19b084[_0x2576('0x2b')]['sort']);_0x293a3a[_0x2576('0x35')]=qs[_0x2576('0x2d')](_[_0x2576('0x36')](_0x19b084['query'],_0x573db4[_0x2576('0x2d')]),_0x1e1195);if(_0x19b084[_0x2576('0x2b')][_0x2576('0x37')]){_0x293a3a[_0x2576('0x35')]=_[_0x2576('0x38')](_0x293a3a[_0x2576('0x35')],{'$or':_['map'](_0x1e1195,function(_0x4daa0d){if(_0x4daa0d[_0x2576('0x1e')]!==_0x2576('0x39')){var _0xa94a15={};_0xa94a15[_0x4daa0d[_0x2576('0x20')]]={'$like':'%'+_0x19b084['query'][_0x2576('0x37')]+'%'};return _0xa94a15;}})});}_0x293a3a=_[_0x2576('0x38')]({},_0x293a3a,_0x19b084[_0x2576('0x3a')]);var _0x18a648={'where':_0x293a3a['where']};return db[_0x2576('0x26')][_0x2576('0x10')](_0x18a648)[_0x2576('0x14')](function(_0x3effcb){_0x473c47[_0x2576('0x10')]=_0x3effcb;if(_0x19b084['query'][_0x2576('0x3b')]){_0x293a3a[_0x2576('0x3c')]=[{'all':!![]}];}return db[_0x2576('0x26')]['findAll'](_0x293a3a);})[_0x2576('0x14')](function(_0x4de7e){_0x473c47['rows']=_0x4de7e;return _0x473c47;})['then'](respondWithFilteredResult(_0xe99fee,_0x293a3a))[_0x2576('0x3d')](handleError(_0xe99fee,null));};exports[_0x2576('0x3e')]=function(_0x4769a7,_0x56966d){var _0x4f3949={'raw':![],'where':{'id':_0x4769a7[_0x2576('0x3f')]['id']}},_0x116b19={};_0x116b19[_0x2576('0x2a')]=_[_0x2576('0x2c')](db[_0x2576('0x26')]['rawAttributes']);_0x116b19[_0x2576('0x2b')]=_[_0x2576('0x2c')](_0x4769a7['query']);_0x116b19[_0x2576('0x2d')]=_[_0x2576('0x2e')](_0x116b19[_0x2576('0x2a')],_0x116b19[_0x2576('0x2b')]);_0x4f3949[_0x2576('0x30')]=_[_0x2576('0x2e')](_0x116b19[_0x2576('0x2a')],qs[_0x2576('0x2f')](_0x4769a7['query'][_0x2576('0x2f')]));_0x4f3949['attributes']=_0x4f3949[_0x2576('0x30')][_0x2576('0x40')]?_0x4f3949[_0x2576('0x30')]:_0x116b19[_0x2576('0x2a')];if(_0x4769a7[_0x2576('0x2b')][_0x2576('0x3b')]){_0x4f3949['include']=[{'all':!![]}];}_0x4f3949=_['merge']({},_0x4f3949,_0x4769a7[_0x2576('0x3a')]);return db[_0x2576('0x26')][_0x2576('0x1f')](_0x4f3949)[_0x2576('0x14')](handleEntityNotFound(_0x56966d,null))[_0x2576('0x14')](respondWithResult(_0x56966d,null))[_0x2576('0x3d')](handleError(_0x56966d,null));};exports['destroy']=function(_0x479c68,_0x180a6d){return db[_0x2576('0x26')][_0x2576('0x1f')]({'where':{'id':_0x479c68['params']['id']}})[_0x2576('0x14')](handleEntityNotFound(_0x180a6d,null))['then'](removeEntity(_0x180a6d,null))[_0x2576('0x3d')](handleError(_0x180a6d,null));};exports['create']=function(_0x391946,_0x166d9d){if(_0x391946[_0x2576('0x41')][_0x2576('0x1e')]===_0x2576('0x17')&&!_[_0x2576('0x42')](_0x391946[_0x2576('0x41')][_0x2576('0x43')],'_')){_0x391946[_0x2576('0x41')][_0x2576('0x43')]='_'[_0x2576('0x44')](_0x391946[_0x2576('0x41')][_0x2576('0x43')]);}return db['VoiceExtension'][_0x2576('0x45')](_0x391946[_0x2576('0x41')],{'raw':![]})['then'](function(_0x1d5b85){var _0x106be5=_0x391946[_0x2576('0x46')][_0x2576('0x47')]({'plain':!![]});if(!_0x106be5)throw new Error(_0x2576('0x48'));if(_0x106be5[_0x2576('0x49')]==='user'){var _0x8080e4=_0x1d5b85[_0x2576('0x47')]({'plain':!![]});var _0x583629=[{'name':_0x2576('0x4a'),'value':_0x2576('0x15')},{'name':_0x2576('0x16'),'value':_0x2576('0x17')},{'name':_0x2576('0x18'),'value':_0x2576('0x19')}];var _0x5ca5a9=_[_0x2576('0x1f')](_0x583629,[_0x2576('0x1c'),_0x8080e4[_0x2576('0x1e')]])[_0x2576('0x20')];return db['UserProfileSection']['find']({'where':{'name':_0x5ca5a9,'userProfileId':_0x106be5[_0x2576('0x4b')]},'raw':!![]})[_0x2576('0x14')](function(_0x223443){if(_0x223443&&_0x223443['autoAssociation']===0x0){return db['UserProfileResource'][_0x2576('0x45')]({'name':_0x8080e4[_0x2576('0x20')],'resourceId':_0x8080e4['id'],'type':_0x223443['name'],'sectionId':_0x223443['id']},{})[_0x2576('0x14')](function(){return _0x1d5b85;});}else{return _0x1d5b85;}})['catch'](function(_0x3e7faf){logger[_0x2576('0x23')](_0x2576('0x4c'),_0x3e7faf);throw _0x3e7faf;});}return _0x1d5b85;})[_0x2576('0x14')](respondWithResult(_0x166d9d,0xc9))[_0x2576('0x3d')](handleError(_0x166d9d,null));};exports[_0x2576('0x4d')]=function(_0x5a055a,_0xb8d17c){if(_0x5a055a[_0x2576('0x41')]['id']){delete _0x5a055a[_0x2576('0x41')]['id'];}return db[_0x2576('0x26')]['find']({'where':{'id':_0x5a055a['params']['id']}})[_0x2576('0x14')](handleEntityNotFound(_0xb8d17c,null))[_0x2576('0x14')](function(_0x326513){if(_0x326513){return db[_0x2576('0x26')][_0x2576('0x4d')](_[_0x2576('0x36')](_0x5a055a[_0x2576('0x41')],[_0x2576('0x43'),_0x2576('0x4e'),'description','recordingFormat',_0x2576('0x4f'),'mandatoryDisposition',_0x2576('0x50')]),{'where':{'context':_0x326513['context'],'exten':_0x326513[_0x2576('0x43')]},'individualHooks':!![]})['then'](function(_0x5d41fa){return _0x5d41fa;});}return null;})[_0x2576('0x14')](respondWithStatusCode(_0xb8d17c,null))[_0x2576('0x3d')](handleError(_0xb8d17c,null));};exports[_0x2576('0x51')]=function(_0x23719e,_0x8845dc){var _0x5e129f=_0x23719e[_0x2576('0x3f')]['id'];var _0x297baf=_0x23719e[_0x2576('0x41')];var _0x419d68=0xc8;var _0x3d36bc=null;return db['sequelize'][_0x2576('0x52')]({'isolationLevel':db['sequelize'][_0x2576('0x53')][_0x2576('0x54')][_0x2576('0x55')]},function(_0x8776ed){return db[_0x2576('0x26')][_0x2576('0x56')]({'where':{'id':_0x5e129f},'transaction':_0x8776ed})[_0x2576('0x14')](function(_0x45d923){if(_0x45d923){return db[_0x2576('0x26')]['destroy']({'where':{'VoiceExtensionId':_0x5e129f},'transaction':_0x8776ed})[_0x2576('0x14')](function(){var _0x1a6958=_[_0x2576('0x1b')](_0x297baf,function(_0x2fbbe5){_0x2fbbe5['VoiceExtensionId']=_0x5e129f;_0x2fbbe5[_0x2576('0x57')]=!![];return _0x2fbbe5;});return _0x45d923[_0x2576('0x58')](_0x1a6958);})['then'](function(_0x1df0f5){return db[_0x2576('0x26')][_0x2576('0x59')](_0x1df0f5,{'transaction':_0x8776ed});});}else{_0x419d68=0x194;_0x3d36bc=[];}});})[_0x2576('0x14')](function(){if(_0x419d68!==0x194){return db['VoiceExtension'][_0x2576('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5e129f},'order':_0x2576('0x5b')})[_0x2576('0x14')](function(_0x30b648){_0x3d36bc=_0x30b648;});}})[_0x2576('0x3d')](function(_0x1b9a45){_0x419d68=0x1f4;logger[_0x2576('0x23')](_0x1b9a45[_0x2576('0x24')]);if(_0x1b9a45[_0x2576('0x20')]){delete _0x1b9a45[_0x2576('0x20')];}_0x3d36bc=_0x1b9a45;})['finally'](function(){if(_0x3d36bc===null){_0x8845dc[_0x2576('0xa')](_0x419d68);}else{if(_0x419d68===0x1f4){_0x8845dc[_0x2576('0xb')](_0x419d68)[_0x2576('0x5c')](_0x3d36bc);}else{_0x8845dc[_0x2576('0xb')](_0x419d68)['json'](_0x3d36bc);}}});};
\ No newline at end of file
+var _0x2fdd=['includeAll','findAll','catch','show','params','include','create','startsWith','body','exten','concat','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','internal','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','cutdigits','mandatoryDisposition','alias','sequelize','transaction','Transaction','READ_COMMITTED','findOne','VoiceExtensionId','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','json','lodash','../../components/parsers/qs','../../config/logger','api','redis','defaults','localhost','register','sendStatus','status','offset','undefined','count','limit','set','Content-Range','destroy','then','inbound','OutboundRoutes','outbound','InternalRoutes','filter','ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','send','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','VoiceExtension'];(function(_0x36a603,_0x141e6c){var _0x35b7d9=function(_0x4ecb96){while(--_0x4ecb96){_0x36a603['push'](_0x36a603['shift']());}};_0x35b7d9(++_0x141e6c);}(_0x2fdd,0x123));var _0xd2fd=function(_0x5598e0,_0x53a233){_0x5598e0=_0x5598e0-0x0;var _0x29555d=_0x2fdd[_0x5598e0];return _0x29555d;};'use strict';var _=require(_0xd2fd('0x0'));var Redis=require('ioredis');var qs=require(_0xd2fd('0x1'));var logger=require(_0xd2fd('0x2'))(_0xd2fd('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xd2fd('0x4')]=_[_0xd2fd('0x5')](config[_0xd2fd('0x4')],{'host':_0xd2fd('0x6'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceExtension.socket')[_0xd2fd('0x7')](socket);function respondWithStatusCode(_0x489559,_0x118be8){_0x118be8=_0x118be8||0xcc;return function(_0x830e37){if(_0x830e37){return _0x489559[_0xd2fd('0x8')](_0x118be8);}return _0x489559[_0xd2fd('0x9')](_0x118be8)['end']();};}function respondWithResult(_0x296c63,_0x57ae3f){_0x57ae3f=_0x57ae3f||0xc8;return function(_0x48d17a){if(_0x48d17a){return _0x296c63[_0xd2fd('0x9')](_0x57ae3f)['json'](_0x48d17a);}};}function respondWithFilteredResult(_0x35e004,_0x21a88a){return function(_0x345f7a){if(_0x345f7a){var _0x31fb1b=typeof _0x21a88a[_0xd2fd('0xa')]===_0xd2fd('0xb')&&typeof _0x21a88a['limit']===_0xd2fd('0xb');var _0x5af1ec=_0x345f7a[_0xd2fd('0xc')];var _0x9a773b=_0x31fb1b?0x0:_0x21a88a[_0xd2fd('0xa')];var _0x507bdf=_0x31fb1b?_0x345f7a[_0xd2fd('0xc')]:_0x21a88a[_0xd2fd('0xa')]+_0x21a88a[_0xd2fd('0xd')];var _0x456ec9;if(_0x507bdf>=_0x5af1ec){_0x507bdf=_0x5af1ec;_0x456ec9=0xc8;}else{_0x456ec9=0xce;}_0x35e004['status'](_0x456ec9);return _0x35e004[_0xd2fd('0xe')](_0xd2fd('0xf'),_0x9a773b+'-'+_0x507bdf+'/'+_0x5af1ec)['json'](_0x345f7a);}return null;};}function removeEntity(_0x35b324){return function(_0x5ddfa4){if(_0x5ddfa4){return _0x5ddfa4[_0xd2fd('0x10')]()[_0xd2fd('0x11')](function(){var _0x47f1d5=_0x5ddfa4['get']({'plain':!![]});var _0x3ac4d6=[{'name':'InboundRoutes','value':_0xd2fd('0x12'),'ignore':![]},{'name':_0xd2fd('0x13'),'value':_0xd2fd('0x14'),'ignore':![]},{'name':_0xd2fd('0x15'),'value':'internal','ignore':![]}];var _0xe8081d=_(_0x3ac4d6)[_0xd2fd('0x16')](_0xd2fd('0x17'))[_0xd2fd('0x18')](_0xd2fd('0x19'))[_0xd2fd('0x19')]();if(_[_0xd2fd('0x1a')](_0xe8081d,_0x47f1d5[_0xd2fd('0x1b')])){return;}var _0x3ed2ac=_[_0xd2fd('0x1c')](_0x3ac4d6,[_0xd2fd('0x19'),_0x47f1d5[_0xd2fd('0x1b')]])[_0xd2fd('0x1d')];return db[_0xd2fd('0x1e')][_0xd2fd('0x10')]({'where':{'type':_0x3ed2ac,'resourceId':_0x47f1d5['id']}})[_0xd2fd('0x11')](function(){return _0x5ddfa4;});})['then'](function(){_0x35b324[_0xd2fd('0x9')](0xcc)['end']();});}};}function handleEntityNotFound(_0xebbe7f){return function(_0x370655){if(!_0x370655){_0xebbe7f[_0xd2fd('0x8')](0x194);}return _0x370655;};}function handleError(_0x1fdc58,_0x1a2f1c){_0x1a2f1c=_0x1a2f1c||0x1f4;return function(_0x29c1fa){logger[_0xd2fd('0x1f')](_0x29c1fa[_0xd2fd('0x20')]);if(_0x29c1fa[_0xd2fd('0x1d')]){delete _0x29c1fa['name'];}_0x1fdc58[_0xd2fd('0x9')](_0x1a2f1c)[_0xd2fd('0x21')](_0x29c1fa);};}exports['index']=function(_0x8111bc,_0x39d762){var _0x255820={},_0x4e8625={},_0x54d0c7={'count':0x0,'rows':[]};var _0x1148aa=_[_0xd2fd('0x18')](db['VoiceExtension'][_0xd2fd('0x22')],function(_0x2d5e0f){return{'name':_0x2d5e0f['fieldName'],'type':_0x2d5e0f['type'][_0xd2fd('0x23')]};});_0x4e8625[_0xd2fd('0x24')]=_[_0xd2fd('0x18')](_0x1148aa,_0xd2fd('0x1d'));_0x4e8625['query']=_[_0xd2fd('0x25')](_0x8111bc[_0xd2fd('0x26')]);_0x4e8625[_0xd2fd('0x27')]=_[_0xd2fd('0x28')](_0x4e8625[_0xd2fd('0x24')],_0x4e8625['query']);_0x255820[_0xd2fd('0x29')]=_[_0xd2fd('0x28')](_0x4e8625['model'],qs[_0xd2fd('0x2a')](_0x8111bc[_0xd2fd('0x26')]['fields']));_0x255820[_0xd2fd('0x29')]=_0x255820['attributes'][_0xd2fd('0x2b')]?_0x255820[_0xd2fd('0x29')]:_0x4e8625['model'];if(!_0x8111bc[_0xd2fd('0x26')][_0xd2fd('0x2c')](_0xd2fd('0x2d'))){_0x255820[_0xd2fd('0xd')]=qs[_0xd2fd('0xd')](_0x8111bc[_0xd2fd('0x26')][_0xd2fd('0xd')]);_0x255820[_0xd2fd('0xa')]=qs[_0xd2fd('0xa')](_0x8111bc['query'][_0xd2fd('0xa')]);}_0x255820[_0xd2fd('0x2e')]=qs[_0xd2fd('0x2f')](_0x8111bc[_0xd2fd('0x26')][_0xd2fd('0x2f')]);_0x255820[_0xd2fd('0x30')]=qs[_0xd2fd('0x27')](_[_0xd2fd('0x31')](_0x8111bc[_0xd2fd('0x26')],_0x4e8625[_0xd2fd('0x27')]),_0x1148aa);if(_0x8111bc[_0xd2fd('0x26')]['filter']){_0x255820['where']=_[_0xd2fd('0x32')](_0x255820['where'],{'$or':_['map'](_0x1148aa,function(_0x3ebb33){if(_0x3ebb33[_0xd2fd('0x1b')]!=='VIRTUAL'){var _0x4b1bef={};_0x4b1bef[_0x3ebb33[_0xd2fd('0x1d')]]={'$like':'%'+_0x8111bc[_0xd2fd('0x26')][_0xd2fd('0x16')]+'%'};return _0x4b1bef;}})});}_0x255820=_[_0xd2fd('0x32')]({},_0x255820,_0x8111bc[_0xd2fd('0x33')]);var _0x1570b0={'where':_0x255820[_0xd2fd('0x30')]};return db[_0xd2fd('0x34')][_0xd2fd('0xc')](_0x1570b0)[_0xd2fd('0x11')](function(_0x6db260){_0x54d0c7[_0xd2fd('0xc')]=_0x6db260;if(_0x8111bc[_0xd2fd('0x26')][_0xd2fd('0x35')]){_0x255820['include']=[{'all':!![]}];}return db[_0xd2fd('0x34')][_0xd2fd('0x36')](_0x255820);})['then'](function(_0x1d344f){_0x54d0c7['rows']=_0x1d344f;return _0x54d0c7;})[_0xd2fd('0x11')](respondWithFilteredResult(_0x39d762,_0x255820))[_0xd2fd('0x37')](handleError(_0x39d762,null));};exports[_0xd2fd('0x38')]=function(_0x3b651b,_0x320016){var _0x53be0a={'raw':![],'where':{'id':_0x3b651b[_0xd2fd('0x39')]['id']}},_0x22a1be={};_0x22a1be[_0xd2fd('0x24')]=_['keys'](db[_0xd2fd('0x34')][_0xd2fd('0x22')]);_0x22a1be['query']=_['keys'](_0x3b651b[_0xd2fd('0x26')]);_0x22a1be[_0xd2fd('0x27')]=_[_0xd2fd('0x28')](_0x22a1be[_0xd2fd('0x24')],_0x22a1be[_0xd2fd('0x26')]);_0x53be0a[_0xd2fd('0x29')]=_[_0xd2fd('0x28')](_0x22a1be[_0xd2fd('0x24')],qs[_0xd2fd('0x2a')](_0x3b651b[_0xd2fd('0x26')][_0xd2fd('0x2a')]));_0x53be0a['attributes']=_0x53be0a[_0xd2fd('0x29')][_0xd2fd('0x2b')]?_0x53be0a[_0xd2fd('0x29')]:_0x22a1be['model'];if(_0x3b651b[_0xd2fd('0x26')][_0xd2fd('0x35')]){_0x53be0a[_0xd2fd('0x3a')]=[{'all':!![]}];}_0x53be0a=_[_0xd2fd('0x32')]({},_0x53be0a,_0x3b651b['options']);return db[_0xd2fd('0x34')]['find'](_0x53be0a)[_0xd2fd('0x11')](handleEntityNotFound(_0x320016,null))[_0xd2fd('0x11')](respondWithResult(_0x320016,null))[_0xd2fd('0x37')](handleError(_0x320016,null));};exports[_0xd2fd('0x10')]=function(_0xb40418,_0x1bff3f){return db[_0xd2fd('0x34')][_0xd2fd('0x1c')]({'where':{'id':_0xb40418[_0xd2fd('0x39')]['id']}})[_0xd2fd('0x11')](handleEntityNotFound(_0x1bff3f,null))[_0xd2fd('0x11')](removeEntity(_0x1bff3f,null))[_0xd2fd('0x37')](handleError(_0x1bff3f,null));};exports[_0xd2fd('0x3b')]=function(_0x48421a,_0x40f792){if(_0x48421a['body'][_0xd2fd('0x1b')]===_0xd2fd('0x14')&&!_[_0xd2fd('0x3c')](_0x48421a[_0xd2fd('0x3d')]['exten'],'_')){_0x48421a['body'][_0xd2fd('0x3e')]='_'[_0xd2fd('0x3f')](_0x48421a['body']['exten']);}return db[_0xd2fd('0x34')][_0xd2fd('0x3b')](_0x48421a[_0xd2fd('0x3d')],{'raw':![]})[_0xd2fd('0x11')](function(_0x1293d3){var _0x5734d5=_0x48421a['user'][_0xd2fd('0x40')]({'plain':!![]});if(!_0x5734d5)throw new Error(_0xd2fd('0x41'));if(_0x5734d5[_0xd2fd('0x42')]===_0xd2fd('0x43')){var _0x1033cb=_0x1293d3[_0xd2fd('0x40')]({'plain':!![]});var _0x50b011=[{'name':'InboundRoutes','value':_0xd2fd('0x12')},{'name':_0xd2fd('0x13'),'value':_0xd2fd('0x14')},{'name':'InternalRoutes','value':_0xd2fd('0x44')}];var _0x1be6e5=_['find'](_0x50b011,[_0xd2fd('0x19'),_0x1033cb[_0xd2fd('0x1b')]])[_0xd2fd('0x1d')];return db['UserProfileSection'][_0xd2fd('0x1c')]({'where':{'name':_0x1be6e5,'userProfileId':_0x5734d5[_0xd2fd('0x45')]},'raw':!![]})[_0xd2fd('0x11')](function(_0x2cabe7){if(_0x2cabe7&&_0x2cabe7['autoAssociation']===0x0){return db[_0xd2fd('0x1e')][_0xd2fd('0x3b')]({'name':_0x1033cb[_0xd2fd('0x1d')],'resourceId':_0x1033cb['id'],'type':_0x2cabe7['name'],'sectionId':_0x2cabe7['id']},{})[_0xd2fd('0x11')](function(){return _0x1293d3;});}else{return _0x1293d3;}})[_0xd2fd('0x37')](function(_0x33b4bb){logger[_0xd2fd('0x1f')](_0xd2fd('0x46'),_0x33b4bb);throw _0x33b4bb;});}return _0x1293d3;})['then'](respondWithResult(_0x40f792,0xc9))[_0xd2fd('0x37')](handleError(_0x40f792,null));};exports['update']=function(_0xfee836,_0x78a98){if(_0xfee836[_0xd2fd('0x3d')]['id']){delete _0xfee836[_0xd2fd('0x3d')]['id'];}return db['VoiceExtension'][_0xd2fd('0x1c')]({'where':{'id':_0xfee836[_0xd2fd('0x39')]['id']}})['then'](handleEntityNotFound(_0x78a98,null))[_0xd2fd('0x11')](function(_0x126b4c){if(_0x126b4c){return db['VoiceExtension'][_0xd2fd('0x47')](_[_0xd2fd('0x31')](_0xfee836[_0xd2fd('0x3d')],['exten',_0xd2fd('0x48'),'description','recordingFormat',_0xd2fd('0x49'),_0xd2fd('0x4a'),_0xd2fd('0x4b')]),{'where':{'context':_0x126b4c[_0xd2fd('0x48')],'exten':_0x126b4c[_0xd2fd('0x3e')]},'individualHooks':!![]})[_0xd2fd('0x11')](function(_0x3d9a97){return _0x3d9a97;});}return null;})[_0xd2fd('0x11')](respondWithStatusCode(_0x78a98,null))['catch'](handleError(_0x78a98,null));};exports['addApplications']=function(_0x2966d2,_0x3182d5){var _0x550539=_0x2966d2['params']['id'];var _0x51b5fc=_0x2966d2[_0xd2fd('0x3d')];var _0x2e7550=0xc8;var _0x4c3ea3=null;return db[_0xd2fd('0x4c')][_0xd2fd('0x4d')]({'isolationLevel':db[_0xd2fd('0x4c')][_0xd2fd('0x4e')]['ISOLATION_LEVELS'][_0xd2fd('0x4f')]},function(_0x5c232f){return db['VoiceExtension'][_0xd2fd('0x50')]({'where':{'id':_0x550539},'transaction':_0x5c232f})[_0xd2fd('0x11')](function(_0x1c1a08){if(_0x1c1a08){return db[_0xd2fd('0x34')]['destroy']({'where':{'VoiceExtensionId':_0x550539},'transaction':_0x5c232f})['then'](function(){var _0x483e45=_['map'](_0x51b5fc,function(_0x440fbd){_0x440fbd[_0xd2fd('0x51')]=_0x550539;_0x440fbd['isApp']=!![];return _0x440fbd;});return _0x1c1a08[_0xd2fd('0x52')](_0x483e45);})[_0xd2fd('0x11')](function(_0x5d0c08){return db[_0xd2fd('0x34')][_0xd2fd('0x53')](_0x5d0c08,{'transaction':_0x5c232f});});}else{_0x2e7550=0x194;_0x4c3ea3=[];}});})['then'](function(){if(_0x2e7550!==0x194){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x550539},'order':_0xd2fd('0x54')})[_0xd2fd('0x11')](function(_0x372cbc){_0x4c3ea3=_0x372cbc;});}})[_0xd2fd('0x37')](function(_0x1d6a4c){_0x2e7550=0x1f4;logger[_0xd2fd('0x1f')](_0x1d6a4c[_0xd2fd('0x20')]);if(_0x1d6a4c['name']){delete _0x1d6a4c[_0xd2fd('0x1d')];}_0x4c3ea3=_0x1d6a4c;})['finally'](function(){if(_0x4c3ea3===null){_0x3182d5['sendStatus'](_0x2e7550);}else{if(_0x2e7550===0x1f4){_0x3182d5[_0xd2fd('0x9')](_0x2e7550)['send'](_0x4c3ea3);}else{_0x3182d5[_0xd2fd('0x9')](_0x2e7550)[_0xd2fd('0x55')](_0x4c3ea3);}}});};
\ No newline at end of file
index d6bdd63..5803ae1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabc8=['../../mysqldb','VoiceExtension','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x4f4277,_0x1de205){var _0x475fc4=function(_0x784416){while(--_0x784416){_0x4f4277['push'](_0x4f4277['shift']());}};_0x475fc4(++_0x1de205);}(_0xabc8,0xf9));var _0x8abc=function(_0x22868f,_0x450f48){_0x22868f=_0x22868f-0x0;var _0x97bc75=_0xabc8[_0x22868f];return _0x97bc75;};'use strict';var EventEmitter=require(_0x8abc('0x0'));var VoiceExtension=require(_0x8abc('0x1'))['db'][_0x8abc('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x8abc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8abc('0x4'),'afterDestroy':_0x8abc('0x5')};function emitEvent(_0x51ebb3){return function(_0xa29e6b,_0x57fd96,_0x5df298){VoiceExtensionEvents[_0x8abc('0x6')](_0x51ebb3+':'+_0xa29e6b['id'],_0xa29e6b);VoiceExtensionEvents[_0x8abc('0x6')](_0x51ebb3,_0xa29e6b);_0x5df298(null);};}for(var e in events){if(events[_0x8abc('0x7')](e)){var event=events[e];VoiceExtension[_0x8abc('0x8')](e,emitEvent(event));}}module[_0x8abc('0x9')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0xc855=['remove','emit','hasOwnProperty','hook','events','VoiceExtension','save','update'];(function(_0x2fd886,_0x30c2cb){var _0x1994b5=function(_0x2a3168){while(--_0x2a3168){_0x2fd886['push'](_0x2fd886['shift']());}};_0x1994b5(++_0x30c2cb);}(_0xc855,0x9c));var _0x5c85=function(_0x1b8c78,_0x416d56){_0x1b8c78=_0x1b8c78-0x0;var _0x8d1465=_0xc855[_0x1b8c78];return _0x8d1465;};'use strict';var EventEmitter=require(_0x5c85('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x5c85('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5c85('0x2'),'afterUpdate':_0x5c85('0x3'),'afterDestroy':_0x5c85('0x4')};function emitEvent(_0xc782dc){return function(_0x140111,_0x4f1af5,_0x975e17){VoiceExtensionEvents[_0x5c85('0x5')](_0xc782dc+':'+_0x140111['id'],_0x140111);VoiceExtensionEvents[_0x5c85('0x5')](_0xc782dc,_0x140111);_0x975e17(null);};}for(var e in events){if(events[_0x5c85('0x6')](e)){var event=events[e];VoiceExtension[_0x5c85('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
index 12cbd78..253acad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4148=['*,*,*,*','intervals','IntervalId','map','filter','toLowerCase','tag','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','catch','define','VoiceExtension','get','concat','lodash','./voiceExtension.attributes','exports','Set','type','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context','exten','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','length','name','phone','param','prefix','${EXTEN:','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','then'];(function(_0x13ed3a,_0x3499eb){var _0x189291=function(_0x5b520c){while(--_0x5b520c){_0x13ed3a['push'](_0x13ed3a['shift']());}};_0x189291(++_0x3499eb);}(_0x4148,0xc6));var _0x8414=function(_0x26a382,_0x3d54db){_0x26a382=_0x26a382-0x0;var _0x14f9c8=_0x4148[_0x26a382];return _0x14f9c8;};'use strict';var _=require(_0x8414('0x0'));var attributes=require(_0x8414('0x1'));module[_0x8414('0x2')]=function(_0xc19cfb){var _0x27bb22=_0xc19cfb['models'];function _0x1be902(_0x39b377){var _0x41ddde=0x2;var _0x361d0b=[{'type':_0x39b377['type'],'app':_0x8414('0x3'),'appdata':'CDR(type)='+_0x39b377[_0x8414('0x4')],'context':_0x39b377['context'],'exten':_0x39b377['exten'],'priority':_0x41ddde++,'VoiceExtensionId':_0x39b377['id']},{'type':_0x39b377[_0x8414('0x4')],'app':_0x39b377[_0x8414('0x5')]?_0x8414('0x3'):_0x8414('0x6'),'appdata':_0x39b377[_0x8414('0x5')]?_0x8414('0x7')+_0x39b377[_0x8414('0x5')]:_0x8414('0x8'),'context':_0x39b377[_0x8414('0x9')],'exten':_0x39b377[_0x8414('0xa')],'priority':_0x41ddde++,'VoiceExtensionId':_0x39b377['id']}];if(_0x39b377[_0x8414('0x4')]==='inbound'){_0x361d0b[_0x8414('0xb')]({'type':'inbound','app':_0x8414('0x3'),'appdata':_0x8414('0xc')+_0x39b377['id'],'context':_0x39b377[_0x8414('0x9')],'exten':_0x39b377[_0x8414('0xa')],'priority':_0x41ddde++,'VoiceExtensionId':_0x39b377['id']});}_0x361d0b['push']({'type':_0x39b377[_0x8414('0x4')],'app':'Set','appdata':_0x8414('0xd'),'context':_0x39b377[_0x8414('0x9')],'exten':_0x39b377[_0x8414('0xa')],'priority':_0x41ddde++,'VoiceExtensionId':_0x39b377['id']},{'type':_0x39b377['type'],'app':_0x8414('0x3'),'appdata':_0x8414('0xe'),'context':_0x39b377[_0x8414('0x9')],'exten':_0x39b377['exten'],'priority':_0x41ddde++,'VoiceExtensionId':_0x39b377['id']},{'type':_0x39b377['type'],'app':_0x8414('0x3'),'appdata':_0x8414('0xf'),'context':_0x39b377[_0x8414('0x9')],'exten':_0x39b377[_0x8414('0xa')],'priority':_0x41ddde++,'VoiceExtensionId':_0x39b377['id']});return _0x361d0b;}function _0x5b92aa(_0x43df52){var _0x350772=0x2;var _0x43e4f8=[{'type':_0x8414('0x10'),'app':'Set','appdata':'CDR(type)=outbound','context':_0x43df52[_0x8414('0x9')],'exten':_0x43df52['exten'],'priority':_0x350772++,'VoiceExtensionId':_0x43df52['id']},{'type':_0x8414('0x10'),'app':_0x43df52[_0x8414('0x5')]?_0x8414('0x3'):_0x8414('0x6'),'appdata':_0x43df52['alias']?_0x8414('0x7')+_0x43df52[_0x8414('0x5')]:_0x8414('0x8'),'context':_0x43df52[_0x8414('0x9')],'exten':_0x43df52[_0x8414('0xa')],'priority':_0x350772++,'VoiceExtensionId':_0x43df52['id']},{'type':_0x8414('0x10'),'app':_0x8414('0x3'),'appdata':_0x8414('0x11')+(_0x43df52['cutdigits']?'${EXTEN:'+_0x43df52['cutdigits']+'}':_0x8414('0x12')),'context':_0x43df52[_0x8414('0x9')],'exten':_0x43df52['exten'],'priority':_0x350772++,'VoiceExtensionId':_0x43df52['id']},{'type':_0x8414('0x10'),'app':_0x8414('0x3'),'appdata':'CDR(routeid)='+_0x43df52['id'],'context':_0x43df52[_0x8414('0x9')],'exten':_0x43df52[_0x8414('0xa')],'priority':_0x350772++,'VoiceExtensionId':_0x43df52['id']},{'type':'outbound','app':'ExecIf','appdata':_0x8414('0x13')+(_0x350772+0x2)+_0x8414('0x14')+(_0x350772+0x1)+')','context':_0x43df52[_0x8414('0x9')],'exten':_0x43df52['exten'],'priority':_0x350772++,'VoiceExtensionId':_0x43df52['id']},{'type':_0x8414('0x10'),'app':_0x8414('0x3'),'appdata':_0x43df52[_0x8414('0x15')]?_0x8414('0x16')+_0x43df52[_0x8414('0x15')]+'}':_0x8414('0x17'),'context':_0x43df52[_0x8414('0x9')],'exten':_0x43df52[_0x8414('0xa')],'priority':_0x350772++,'VoiceExtensionId':_0x43df52['id']},{'type':_0x8414('0x10'),'app':_0x8414('0x3'),'appdata':_0x8414('0xd'),'context':_0x43df52[_0x8414('0x9')],'exten':_0x43df52[_0x8414('0xa')],'priority':_0x350772++,'VoiceExtensionId':_0x43df52['id']},{'type':_0x8414('0x10'),'app':_0x8414('0x3'),'appdata':_0x8414('0xe'),'context':_0x43df52[_0x8414('0x9')],'exten':_0x43df52[_0x8414('0xa')],'priority':_0x350772++,'VoiceExtensionId':_0x43df52['id']},{'type':'outbound','app':'Set','appdata':_0x8414('0xf'),'context':_0x43df52[_0x8414('0x9')],'exten':_0x43df52[_0x8414('0xa')],'priority':_0x350772++,'VoiceExtensionId':_0x43df52['id']},{'type':_0x8414('0x10'),'app':_0x8414('0x3'),'appdata':_0x8414('0x18')+_0x43df52['id'],'context':_0x43df52['context'],'exten':_0x43df52[_0x8414('0xa')],'priority':_0x350772++,'VoiceExtensionId':_0x43df52['id']}];if(_0x43df52[_0x8414('0x19')](_0x8414('0x1a'))&&_0x43df52['recordingFormat']!==_0x8414('0x1b')){_0x43e4f8[_0x8414('0xb')]({'type':'outbound','app':_0x8414('0x3'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x43df52['context'],'exten':_0x43df52[_0x8414('0xa')],'priority':_0x350772++,'VoiceExtensionId':_0x43df52['id']},{'type':_0x8414('0x10'),'app':_0x8414('0x3'),'appdata':_0x8414('0x1c')+_0x43df52[_0x8414('0x1a')]||_0x8414('0x1d'),'context':_0x43df52[_0x8414('0x9')],'exten':_0x43df52[_0x8414('0xa')],'priority':_0x350772++,'VoiceExtensionId':_0x43df52['id']});}return _0x43e4f8;}function _0x2e3160(_0x1686b3,_0x3027ca){var _0x7c43b4=[{'name':_0x8414('0x1e'),'param':0x0},{'name':_0x8414('0x1f'),'param':0x1},{'name':_0x8414('0x20'),'param':0x2},{'name':_0x8414('0x21'),'param':0x3}];var _0x20c6ec={};var _0x5c7880=_0x3027ca[_0x8414('0x22')](',');var _0x16493d=[];for(var _0x127727=0x0;_0x127727<_0x7c43b4[_0x8414('0x23')];_0x127727++){switch(_0x7c43b4[_0x127727][_0x8414('0x24')]){case _0x8414('0x1e'):_0x20c6ec[_0x8414('0x1e')]=_0x5c7880[_0x7c43b4[_0x127727]['param']][_0x8414('0x22')]('/')[0x1];_0x20c6ec[_0x8414('0x25')]=_0x5c7880[_0x7c43b4[_0x127727][_0x8414('0x26')]][_0x8414('0x22')]('/')[0x2];_0x20c6ec[_0x8414('0x27')]=_0x20c6ec[_0x8414('0x25')]?_0x20c6ec[_0x8414('0x25')]['split']('$')[0x0]:undefined;_0x20c6ec[_0x8414('0x25')]=_0x1686b3[_0x8414('0x15')]?(_0x20c6ec[_0x8414('0x27')]||'')+_0x8414('0x28')+_0x1686b3[_0x8414('0x15')]+'}':(_0x20c6ec[_0x8414('0x27')]||'')+_0x8414('0x12');_0x16493d[_0x7c43b4[_0x127727][_0x8414('0x26')]]=[_0x8414('0x29'),_0x20c6ec[_0x8414('0x1e')],_0x20c6ec[_0x8414('0x25')]][_0x8414('0x2a')]('/');break;case _0x8414('0x20'):_0x20c6ec[_0x8414('0x20')]=_0x5c7880[_0x7c43b4[_0x127727][_0x8414('0x26')]];if(_0x1686b3[_0x8414('0x1a')]!==_0x8414('0x1b')){if(_0x20c6ec[_0x8414('0x20')][_0x8414('0x2b')](_0x8414('0x2c'))<0x0){_0x20c6ec[_0x8414('0x20')]+=_0x8414('0x2c');}}else{_0x20c6ec['options']=_0x20c6ec[_0x8414('0x20')][_0x8414('0x2d')](_0x8414('0x2c'),'');}_0x16493d[_0x7c43b4[_0x127727][_0x8414('0x26')]]=_0x20c6ec[_0x8414('0x20')];break;default:_0x16493d[_0x7c43b4[_0x127727][_0x8414('0x26')]]=_0x5c7880[_0x7c43b4[_0x127727]['param']];}}return _0x16493d[_0x8414('0x2a')](',');}function _0x2333d9(_0x2b8385,_0x6d79aa,_0x322dba){return new Promise(function(_0x3c9f43,_0x15e411){var _0x152ad6=[];if(_[_0x8414('0x2e')](_0x6d79aa))return _0x3c9f43(_0x152ad6);_0x27bb22[_0x8414('0x2f')][_0x8414('0x30')]({'attributes':['id',_0x8414('0x31'),'IntervalId'],'raw':!![]})[_0x8414('0x32')](function(_0x5e3c5f){for(var _0x4968eb=0x0,_0x3c0607=0x0;_0x4968eb<_0x6d79aa[_0x8414('0x23')];_0x4968eb++,_0x3c0607=0x0){var _0x2d6943=_0x6d79aa[_0x4968eb];var _0x1bac19=[];var _0x249ccc=[];delete _0x2d6943['id'];if(_0x2d6943[_0x8414('0x31')]!==_0x8414('0x33')){_0x2d6943[_0x8414('0x34')]=[_0x2d6943[_0x8414('0x31')]];}else{_0x2d6943[_0x8414('0x34')]=_0x2d6943[_0x8414('0x35')]?_[_0x8414('0x36')](_[_0x8414('0x37')](_0x5e3c5f,{'IntervalId':_0x2d6943[_0x8414('0x35')]}),_0x8414('0x31')):[];}_0x2d6943[_0x8414('0x9')]=_0x2b8385[_0x8414('0x9')];_0x2d6943[_0x8414('0xa')]=_0x2b8385['exten'];if(_0x2d6943[_0x8414('0x4')])_0x2d6943['type']=_0x2d6943[_0x8414('0x4')][_0x8414('0x38')]();if(_0x2b8385[_0x8414('0x4')]===_0x8414('0x10')){if(_0x2d6943[_0x8414('0x19')]('tag')&&_0x2d6943[_0x8414('0x39')]&&_0x2d6943[_0x8414('0x39')]!=='--'){_0x1bac19[_0x8414('0xb')]({'type':_0x2d6943['type'][_0x8414('0x38')](),'app':_0x8414('0x3'),'appdata':'CDR(tag)='+_0x2d6943[_0x8414('0x39')],'context':_0x2b8385[_0x8414('0x9')],'exten':_0x2b8385[_0x8414('0xa')],'priority':_0x2d6943[_0x8414('0x34')][_0x8414('0x23')]+_0x322dba+_0x3c0607++,'VoiceExtensionId':_0x2b8385['id']});}_0x1bac19[_0x8414('0xb')]({'type':_0x2d6943[_0x8414('0x4')][_0x8414('0x38')](),'app':_0x8414('0x3a'),'appdata':_0x8414('0x3b')+(_0x2d6943[_0x8414('0x3c')]?_0x8414('0x3d')+_0x2d6943[_0x8414('0x3c')]+')':_0x8414('0x3e')),'context':_0x2b8385[_0x8414('0x9')],'exten':_0x2b8385['exten'],'priority':_0x2d6943[_0x8414('0x34')][_0x8414('0x23')]+_0x322dba+_0x3c0607++,'VoiceExtensionId':_0x2b8385['id']});}else{if(_0x2d6943[_0x8414('0x19')](_0x8414('0x3f'))){if([_0x8414('0x40'),_0x8414('0x41')]['includes'](_0x2d6943['app'][_0x8414('0x38')]())&&_0x2d6943[_0x8414('0x42')]!==_0x8414('0x43')){if(_0x2d6943[_0x8414('0x3f')]){_0x1bac19['push']({'type':_0x2d6943[_0x8414('0x4')][_0x8414('0x38')](),'app':_0x8414('0x3a'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x2b8385['context'],'exten':_0x2b8385['exten'],'priority':_0x2d6943[_0x8414('0x34')][_0x8414('0x23')]+_0x322dba+_0x3c0607++,'VoiceExtensionId':_0x2b8385['id']});_0x1bac19['push']({'type':_0x2d6943['type'][_0x8414('0x38')](),'app':_0x8414('0x3'),'appdata':_0x8414('0x44'),'context':_0x2b8385['context'],'exten':_0x2b8385[_0x8414('0xa')],'priority':_0x2d6943['intervals'][_0x8414('0x23')]+_0x322dba+_0x3c0607++,'VoiceExtensionId':_0x2b8385['id']});}else{_0x1bac19[_0x8414('0xb')]({'type':_0x2d6943[_0x8414('0x4')][_0x8414('0x38')](),'app':'ExecIf','appdata':_0x8414('0x45'),'context':_0x2b8385[_0x8414('0x9')],'exten':_0x2b8385[_0x8414('0xa')],'priority':_0x2d6943[_0x8414('0x34')][_0x8414('0x23')]+_0x322dba+_0x3c0607++,'VoiceExtensionId':_0x2b8385['id']});_0x1bac19[_0x8414('0xb')]({'type':_0x2d6943[_0x8414('0x4')][_0x8414('0x38')](),'app':'Set','appdata':_0x8414('0x46'),'context':_0x2b8385[_0x8414('0x9')],'exten':_0x2b8385[_0x8414('0xa')],'priority':_0x2d6943[_0x8414('0x34')][_0x8414('0x23')]+_0x322dba+_0x3c0607++,'VoiceExtensionId':_0x2b8385['id']});}}}}for(var _0xa1d265=0x0;_0xa1d265<_0x2d6943[_0x8414('0x34')][_0x8414('0x23')];_0xa1d265++){var _0x23302a=_0x322dba+_0x2d6943[_0x8414('0x34')][_0x8414('0x23')];var _0x4844ce=_0xa1d265===_0x2d6943[_0x8414('0x34')][_0x8414('0x23')]-0x1?_0x322dba+_0x1bac19[_0x8414('0x23')]+_0x249ccc[_0x8414('0x23')]+0x2:_0x322dba+_0xa1d265+0x1;_0x1bac19[_0x8414('0x47')](_0xa1d265,0x0,{'type':_0x2b8385[_0x8414('0x4')],'app':_0x8414('0x48'),'appdata':_0x2d6943[_0x8414('0x34')][_0xa1d265]+'?'+_0x2b8385[_0x8414('0x9')]+',${EXTEN},'+_0x23302a+':'+_0x2b8385['context']+_0x8414('0x49')+_0x4844ce,'exten':_0x2b8385['exten'],'context':_0x2b8385[_0x8414('0x9')],'priority':_0x322dba+_0xa1d265,'VoiceExtensionId':_0x2b8385['id']});}if(_0x2d6943[_0x8414('0x42')]===_0x8414('0x4a'))_0x2d6943[_0x8414('0x4b')]=_0x2e3160(_0x2b8385,_0x2d6943[_0x8414('0x4b')]);_0x2d6943[_0x8414('0x4c')]=_0x1bac19['length']?_[_0x8414('0x4d')](_0x1bac19)[_0x8414('0x4c')]+0x1:_0x322dba;_0x152ad6=_['concat'](_0x152ad6,_0x1bac19,[_0x2d6943],_0x249ccc);_0x322dba=_[_0x8414('0x4d')](_0x152ad6)['priority']+0x1;}return _0x3c9f43(_0x152ad6);})[_0x8414('0x4e')](function(_0x5056db){_0x15e411(_0x5056db);});});}return _0xc19cfb[_0x8414('0x4f')](_0x8414('0x50'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x338781){var _0x10ef68=this[_0x8414('0x51')]({'plain':!![]});var _0x8c2945=_0x10ef68['type']===_0x8414('0x10')?_0x5b92aa(_0x10ef68):_0x1be902(_0x10ef68);return _0x2333d9(_0x10ef68,_0x338781,_[_0x8414('0x4d')](_0x8c2945)['priority']+0x1)[_0x8414('0x32')](function(_0x433046){var _0x162615=_[_0x8414('0x52')](_0x8c2945,_0x433046);_0x162615[_0x8414('0xb')]({'type':_0x10ef68[_0x8414('0x4')],'app':'Hangup','exten':_0x10ef68[_0x8414('0xa')],'context':_0x10ef68[_0x8414('0x9')],'priority':_[_0x8414('0x4d')](_0x162615)['priority']+0x1,'VoiceExtensionId':_0x10ef68['id']});return _0x162615;});}}});};
\ No newline at end of file
+var _0xbdb0=['outboundDial','appdata','last','priority','VoiceExtension','voice_extensions','get','concat','lodash','./voiceExtension.attributes','exports','models','type','CDR(type)=','context','exten','alias','Set','NoOp','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(destination)=','${EXTEN:','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','url','split','length','name','param','phone','prefix','${EXTEN}','join','options','none','indexOf','U(xcally-mixmonitor-context)','isEmpty','findAll','interval','then','*,*,*,*','intervals','map','IntervalId','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','custom','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','appType'];(function(_0x11d6ff,_0x15c275){var _0x34d191=function(_0x4ee86c){while(--_0x4ee86c){_0x11d6ff['push'](_0x11d6ff['shift']());}};_0x34d191(++_0x15c275);}(_0xbdb0,0x189));var _0x0bdb=function(_0x1b2422,_0x1e98d4){_0x1b2422=_0x1b2422-0x0;var _0x376573=_0xbdb0[_0x1b2422];return _0x376573;};'use strict';var _=require(_0x0bdb('0x0'));var attributes=require(_0x0bdb('0x1'));module[_0x0bdb('0x2')]=function(_0x5c3759){var _0x3867c6=_0x5c3759[_0x0bdb('0x3')];function _0xede3c3(_0x1e325e){var _0x361014=0x2;var _0x4af929=[{'type':_0x1e325e[_0x0bdb('0x4')],'app':'Set','appdata':_0x0bdb('0x5')+_0x1e325e['type'],'context':_0x1e325e[_0x0bdb('0x6')],'exten':_0x1e325e[_0x0bdb('0x7')],'priority':_0x361014++,'VoiceExtensionId':_0x1e325e['id']},{'type':_0x1e325e[_0x0bdb('0x4')],'app':_0x1e325e[_0x0bdb('0x8')]?_0x0bdb('0x9'):_0x0bdb('0xa'),'appdata':_0x1e325e[_0x0bdb('0x8')]?'CDR(routeAlias)='+_0x1e325e[_0x0bdb('0x8')]:'No\x20alias\x20set','context':_0x1e325e['context'],'exten':_0x1e325e[_0x0bdb('0x7')],'priority':_0x361014++,'VoiceExtensionId':_0x1e325e['id']}];if(_0x1e325e['type']==='inbound'){_0x4af929[_0x0bdb('0xb')]({'type':'inbound','app':'Set','appdata':_0x0bdb('0xc')+_0x1e325e['id'],'context':_0x1e325e[_0x0bdb('0x6')],'exten':_0x1e325e[_0x0bdb('0x7')],'priority':_0x361014++,'VoiceExtensionId':_0x1e325e['id']});}_0x4af929[_0x0bdb('0xb')]({'type':_0x1e325e[_0x0bdb('0x4')],'app':'Set','appdata':_0x0bdb('0xd'),'context':_0x1e325e[_0x0bdb('0x6')],'exten':_0x1e325e[_0x0bdb('0x7')],'priority':_0x361014++,'VoiceExtensionId':_0x1e325e['id']},{'type':_0x1e325e['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1e325e[_0x0bdb('0x6')],'exten':_0x1e325e[_0x0bdb('0x7')],'priority':_0x361014++,'VoiceExtensionId':_0x1e325e['id']},{'type':_0x1e325e[_0x0bdb('0x4')],'app':_0x0bdb('0x9'),'appdata':_0x0bdb('0xe'),'context':_0x1e325e[_0x0bdb('0x6')],'exten':_0x1e325e[_0x0bdb('0x7')],'priority':_0x361014++,'VoiceExtensionId':_0x1e325e['id']});return _0x4af929;}function _0x2368ee(_0x38b26d){var _0x55c641=0x2;var _0x59fddd=[{'type':_0x0bdb('0xf'),'app':'Set','appdata':'CDR(type)=outbound','context':_0x38b26d['context'],'exten':_0x38b26d[_0x0bdb('0x7')],'priority':_0x55c641++,'VoiceExtensionId':_0x38b26d['id']},{'type':_0x0bdb('0xf'),'app':_0x38b26d[_0x0bdb('0x8')]?'Set':_0x0bdb('0xa'),'appdata':_0x38b26d[_0x0bdb('0x8')]?'CDR(routeAlias)='+_0x38b26d[_0x0bdb('0x8')]:'No\x20alias\x20set','context':_0x38b26d[_0x0bdb('0x6')],'exten':_0x38b26d['exten'],'priority':_0x55c641++,'VoiceExtensionId':_0x38b26d['id']},{'type':_0x0bdb('0xf'),'app':_0x0bdb('0x9'),'appdata':_0x0bdb('0x10')+(_0x38b26d['cutdigits']?_0x0bdb('0x11')+_0x38b26d[_0x0bdb('0x12')]+'}':'${EXTEN}'),'context':_0x38b26d[_0x0bdb('0x6')],'exten':_0x38b26d[_0x0bdb('0x7')],'priority':_0x55c641++,'VoiceExtensionId':_0x38b26d['id']},{'type':_0x0bdb('0xf'),'app':_0x0bdb('0x9'),'appdata':_0x0bdb('0xc')+_0x38b26d['id'],'context':_0x38b26d[_0x0bdb('0x6')],'exten':_0x38b26d[_0x0bdb('0x7')],'priority':_0x55c641++,'VoiceExtensionId':_0x38b26d['id']},{'type':_0x0bdb('0xf'),'app':_0x0bdb('0x13'),'appdata':_0x0bdb('0x14')+(_0x55c641+0x2)+_0x0bdb('0x15')+(_0x55c641+0x1)+')','context':_0x38b26d[_0x0bdb('0x6')],'exten':_0x38b26d[_0x0bdb('0x7')],'priority':_0x55c641++,'VoiceExtensionId':_0x38b26d['id']},{'type':_0x0bdb('0xf'),'app':'Set','appdata':_0x38b26d['cutdigits']?_0x0bdb('0x16')+_0x38b26d['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x38b26d[_0x0bdb('0x6')],'exten':_0x38b26d[_0x0bdb('0x7')],'priority':_0x55c641++,'VoiceExtensionId':_0x38b26d['id']},{'type':_0x0bdb('0xf'),'app':_0x0bdb('0x9'),'appdata':_0x0bdb('0xd'),'context':_0x38b26d[_0x0bdb('0x6')],'exten':_0x38b26d['exten'],'priority':_0x55c641++,'VoiceExtensionId':_0x38b26d['id']},{'type':'outbound','app':_0x0bdb('0x9'),'appdata':_0x0bdb('0x17'),'context':_0x38b26d['context'],'exten':_0x38b26d['exten'],'priority':_0x55c641++,'VoiceExtensionId':_0x38b26d['id']},{'type':_0x0bdb('0xf'),'app':_0x0bdb('0x9'),'appdata':_0x0bdb('0xe'),'context':_0x38b26d[_0x0bdb('0x6')],'exten':_0x38b26d['exten'],'priority':_0x55c641++,'VoiceExtensionId':_0x38b26d['id']},{'type':'outbound','app':_0x0bdb('0x9'),'appdata':_0x0bdb('0x18')+_0x38b26d['id'],'context':_0x38b26d[_0x0bdb('0x6')],'exten':_0x38b26d[_0x0bdb('0x7')],'priority':_0x55c641++,'VoiceExtensionId':_0x38b26d['id']}];if(_0x38b26d[_0x0bdb('0x19')](_0x0bdb('0x1a'))&&_0x38b26d[_0x0bdb('0x1a')]!=='none'){_0x59fddd[_0x0bdb('0xb')]({'type':'outbound','app':_0x0bdb('0x9'),'appdata':_0x0bdb('0x1b'),'context':_0x38b26d[_0x0bdb('0x6')],'exten':_0x38b26d[_0x0bdb('0x7')],'priority':_0x55c641++,'VoiceExtensionId':_0x38b26d['id']},{'type':_0x0bdb('0xf'),'app':_0x0bdb('0x9'),'appdata':_0x0bdb('0x1c')+_0x38b26d['recordingFormat']||'wav','context':_0x38b26d[_0x0bdb('0x6')],'exten':_0x38b26d['exten'],'priority':_0x55c641++,'VoiceExtensionId':_0x38b26d['id']});}return _0x59fddd;}function _0x24e2cb(_0x4293fc,_0x24fd29){var _0x2fdbd8=[{'name':_0x0bdb('0x1d'),'param':0x0},{'name':_0x0bdb('0x1e'),'param':0x1},{'name':'options','param':0x2},{'name':_0x0bdb('0x1f'),'param':0x3}];var _0x3d4e6b={};var _0x103e1e=_0x24fd29[_0x0bdb('0x20')](',');var _0x5849f4=[];for(var _0x318356=0x0;_0x318356<_0x2fdbd8[_0x0bdb('0x21')];_0x318356++){switch(_0x2fdbd8[_0x318356][_0x0bdb('0x22')]){case _0x0bdb('0x1d'):_0x3d4e6b[_0x0bdb('0x1d')]=_0x103e1e[_0x2fdbd8[_0x318356][_0x0bdb('0x23')]][_0x0bdb('0x20')]('/')[0x1];_0x3d4e6b[_0x0bdb('0x24')]=_0x103e1e[_0x2fdbd8[_0x318356][_0x0bdb('0x23')]]['split']('/')[0x2];_0x3d4e6b[_0x0bdb('0x25')]=_0x3d4e6b[_0x0bdb('0x24')]?_0x3d4e6b[_0x0bdb('0x24')][_0x0bdb('0x20')]('$')[0x0]:undefined;_0x3d4e6b['phone']=_0x4293fc[_0x0bdb('0x12')]?(_0x3d4e6b[_0x0bdb('0x25')]||'')+'${EXTEN:'+_0x4293fc[_0x0bdb('0x12')]+'}':(_0x3d4e6b[_0x0bdb('0x25')]||'')+_0x0bdb('0x26');_0x5849f4[_0x2fdbd8[_0x318356][_0x0bdb('0x23')]]=['SIP',_0x3d4e6b[_0x0bdb('0x1d')],_0x3d4e6b[_0x0bdb('0x24')]][_0x0bdb('0x27')]('/');break;case _0x0bdb('0x28'):_0x3d4e6b['options']=_0x103e1e[_0x2fdbd8[_0x318356][_0x0bdb('0x23')]];if(_0x4293fc[_0x0bdb('0x1a')]!==_0x0bdb('0x29')){if(_0x3d4e6b[_0x0bdb('0x28')][_0x0bdb('0x2a')](_0x0bdb('0x2b'))<0x0){_0x3d4e6b[_0x0bdb('0x28')]+=_0x0bdb('0x2b');}}else{_0x3d4e6b['options']=_0x3d4e6b[_0x0bdb('0x28')]['replace'](_0x0bdb('0x2b'),'');}_0x5849f4[_0x2fdbd8[_0x318356][_0x0bdb('0x23')]]=_0x3d4e6b[_0x0bdb('0x28')];break;default:_0x5849f4[_0x2fdbd8[_0x318356][_0x0bdb('0x23')]]=_0x103e1e[_0x2fdbd8[_0x318356][_0x0bdb('0x23')]];}}return _0x5849f4[_0x0bdb('0x27')](',');}function _0x255eec(_0x11346d,_0x4510b9,_0x401d26){return new Promise(function(_0x563a77,_0x12d0ad){var _0x1d733f=[];if(_[_0x0bdb('0x2c')](_0x4510b9))return _0x563a77(_0x1d733f);_0x3867c6['Interval'][_0x0bdb('0x2d')]({'attributes':['id',_0x0bdb('0x2e'),'IntervalId'],'raw':!![]})[_0x0bdb('0x2f')](function(_0x246730){for(var _0xbee147=0x0,_0x5657ef=0x0;_0xbee147<_0x4510b9[_0x0bdb('0x21')];_0xbee147++,_0x5657ef=0x0){var _0x3f1f58=_0x4510b9[_0xbee147];var _0x57e128=[];var _0x5e0ed7=[];delete _0x3f1f58['id'];if(_0x3f1f58[_0x0bdb('0x2e')]!==_0x0bdb('0x30')){_0x3f1f58['intervals']=[_0x3f1f58[_0x0bdb('0x2e')]];}else{_0x3f1f58[_0x0bdb('0x31')]=_0x3f1f58['IntervalId']?_[_0x0bdb('0x32')](_['filter'](_0x246730,{'IntervalId':_0x3f1f58[_0x0bdb('0x33')]}),_0x0bdb('0x2e')):[];}_0x3f1f58[_0x0bdb('0x6')]=_0x11346d['context'];_0x3f1f58['exten']=_0x11346d[_0x0bdb('0x7')];if(_0x3f1f58['type'])_0x3f1f58[_0x0bdb('0x4')]=_0x3f1f58[_0x0bdb('0x4')][_0x0bdb('0x34')]();if(_0x11346d['type']===_0x0bdb('0xf')){if(_0x3f1f58['hasOwnProperty'](_0x0bdb('0x35'))&&_0x3f1f58[_0x0bdb('0x35')]&&_0x3f1f58['tag']!=='--'){_0x57e128[_0x0bdb('0xb')]({'type':_0x3f1f58['type']['toLowerCase'](),'app':'Set','appdata':_0x0bdb('0x36')+_0x3f1f58[_0x0bdb('0x35')],'context':_0x11346d[_0x0bdb('0x6')],'exten':_0x11346d[_0x0bdb('0x7')],'priority':_0x3f1f58[_0x0bdb('0x31')]['length']+_0x401d26+_0x5657ef++,'VoiceExtensionId':_0x11346d['id']});}_0x57e128[_0x0bdb('0xb')]({'type':_0x3f1f58[_0x0bdb('0x4')][_0x0bdb('0x34')](),'app':_0x0bdb('0x13'),'appdata':_0x0bdb('0x37')+(_0x3f1f58[_0x0bdb('0x38')]?_0x0bdb('0x39')+_0x3f1f58[_0x0bdb('0x38')]+')':_0x0bdb('0x3a')),'context':_0x11346d[_0x0bdb('0x6')],'exten':_0x11346d[_0x0bdb('0x7')],'priority':_0x3f1f58[_0x0bdb('0x31')][_0x0bdb('0x21')]+_0x401d26+_0x5657ef++,'VoiceExtensionId':_0x11346d['id']});}else{if(_0x3f1f58['hasOwnProperty'](_0x0bdb('0x3b'))){if([_0x0bdb('0x3c'),_0x0bdb('0x3d')][_0x0bdb('0x3e')](_0x3f1f58['app'][_0x0bdb('0x34')]())&&_0x3f1f58['appType']!==_0x0bdb('0x3f')){if(_0x3f1f58[_0x0bdb('0x3b')]){_0x57e128[_0x0bdb('0xb')]({'type':_0x3f1f58[_0x0bdb('0x4')]['toLowerCase'](),'app':_0x0bdb('0x13'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x11346d[_0x0bdb('0x6')],'exten':_0x11346d[_0x0bdb('0x7')],'priority':_0x3f1f58['intervals'][_0x0bdb('0x21')]+_0x401d26+_0x5657ef++,'VoiceExtensionId':_0x11346d['id']});_0x57e128['push']({'type':_0x3f1f58[_0x0bdb('0x4')][_0x0bdb('0x34')](),'app':_0x0bdb('0x9'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x11346d[_0x0bdb('0x6')],'exten':_0x11346d[_0x0bdb('0x7')],'priority':_0x3f1f58[_0x0bdb('0x31')][_0x0bdb('0x21')]+_0x401d26+_0x5657ef++,'VoiceExtensionId':_0x11346d['id']});}else{_0x57e128[_0x0bdb('0xb')]({'type':_0x3f1f58['type'][_0x0bdb('0x34')](),'app':'ExecIf','appdata':_0x0bdb('0x40'),'context':_0x11346d[_0x0bdb('0x6')],'exten':_0x11346d[_0x0bdb('0x7')],'priority':_0x3f1f58[_0x0bdb('0x31')][_0x0bdb('0x21')]+_0x401d26+_0x5657ef++,'VoiceExtensionId':_0x11346d['id']});_0x57e128[_0x0bdb('0xb')]({'type':_0x3f1f58['type'][_0x0bdb('0x34')](),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x11346d[_0x0bdb('0x6')],'exten':_0x11346d[_0x0bdb('0x7')],'priority':_0x3f1f58[_0x0bdb('0x31')][_0x0bdb('0x21')]+_0x401d26+_0x5657ef++,'VoiceExtensionId':_0x11346d['id']});}}}}for(var _0x24d5bf=0x0;_0x24d5bf<_0x3f1f58[_0x0bdb('0x31')][_0x0bdb('0x21')];_0x24d5bf++){var _0x26552a=_0x401d26+_0x3f1f58['intervals'][_0x0bdb('0x21')];var _0xa8a14a=_0x24d5bf===_0x3f1f58[_0x0bdb('0x31')][_0x0bdb('0x21')]-0x1?_0x401d26+_0x57e128[_0x0bdb('0x21')]+_0x5e0ed7['length']+0x2:_0x401d26+_0x24d5bf+0x1;_0x57e128[_0x0bdb('0x41')](_0x24d5bf,0x0,{'type':_0x11346d[_0x0bdb('0x4')],'app':_0x0bdb('0x42'),'appdata':_0x3f1f58[_0x0bdb('0x31')][_0x24d5bf]+'?'+_0x11346d[_0x0bdb('0x6')]+_0x0bdb('0x43')+_0x26552a+':'+_0x11346d[_0x0bdb('0x6')]+_0x0bdb('0x43')+_0xa8a14a,'exten':_0x11346d[_0x0bdb('0x7')],'context':_0x11346d[_0x0bdb('0x6')],'priority':_0x401d26+_0x24d5bf,'VoiceExtensionId':_0x11346d['id']});}if(_0x3f1f58[_0x0bdb('0x44')]===_0x0bdb('0x45'))_0x3f1f58[_0x0bdb('0x46')]=_0x24e2cb(_0x11346d,_0x3f1f58[_0x0bdb('0x46')]);_0x3f1f58['priority']=_0x57e128[_0x0bdb('0x21')]?_['last'](_0x57e128)['priority']+0x1:_0x401d26;_0x1d733f=_['concat'](_0x1d733f,_0x57e128,[_0x3f1f58],_0x5e0ed7);_0x401d26=_[_0x0bdb('0x47')](_0x1d733f)[_0x0bdb('0x48')]+0x1;}return _0x563a77(_0x1d733f);})['catch'](function(_0x4b1def){_0x12d0ad(_0x4b1def);});});}return _0x5c3759['define'](_0x0bdb('0x49'),attributes,{'tableName':_0x0bdb('0x4a'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x8fcc1){var _0x400cb8=this[_0x0bdb('0x4b')]({'plain':!![]});var _0x3b51da=_0x400cb8[_0x0bdb('0x4')]===_0x0bdb('0xf')?_0x2368ee(_0x400cb8):_0xede3c3(_0x400cb8);return _0x255eec(_0x400cb8,_0x8fcc1,_[_0x0bdb('0x47')](_0x3b51da)[_0x0bdb('0x48')]+0x1)[_0x0bdb('0x2f')](function(_0x1690d3){var _0xa23f45=_[_0x0bdb('0x4c')](_0x3b51da,_0x1690d3);_0xa23f45[_0x0bdb('0xb')]({'type':_0x400cb8[_0x0bdb('0x4')],'app':'Hangup','exten':_0x400cb8[_0x0bdb('0x7')],'context':_0x400cb8[_0x0bdb('0x6')],'priority':_[_0x0bdb('0x47')](_0xa23f45)[_0x0bdb('0x48')]+0x1,'VoiceExtensionId':_0x400cb8['id']});return _0xa23f45;});}}});};
\ No newline at end of file
index a3cb66d..063c6c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22ed=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','where','limit','include','map','model','attributes','GetVoiceExtension','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x22ed,0x1a9));var _0xd22e=function(_0x2ccb54,_0xb69aba){_0x2ccb54=_0x2ccb54-0x0;var _0x32a8ec=_0x22ed[_0x2ccb54];return _0x32a8ec;};'use strict';var _=require(_0xd22e('0x0'));var util=require(_0xd22e('0x1'));var moment=require(_0xd22e('0x2'));var BPromise=require(_0xd22e('0x3'));var rs=require(_0xd22e('0x4'));var fs=require('fs');var Redis=require(_0xd22e('0x5'));var db=require(_0xd22e('0x6'))['db'];var utils=require(_0xd22e('0x7'));var logger=require(_0xd22e('0x8'))(_0xd22e('0x9'));var config=require(_0xd22e('0xa'));var jayson=require(_0xd22e('0xb'));var client=jayson['client'][_0xd22e('0xc')]({'port':0x232a});config[_0xd22e('0xd')]=_['defaults'](config[_0xd22e('0xd')],{'host':_0xd22e('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd22e('0xd')]));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0xb51f40,_0x57630d,_0x4bd798){return new BPromise(function(_0x54c27d,_0x15ad97){return client[_0xd22e('0xf')](_0xb51f40,_0x4bd798)[_0xd22e('0x10')](function(_0x1c57a9){logger['info'](_0xd22e('0x11'),_0x57630d,_0xd22e('0x12'));logger[_0xd22e('0x13')](_0xd22e('0x14'),_0x57630d,_0xd22e('0x12'),JSON[_0xd22e('0x15')](_0x1c57a9));if(_0x1c57a9['error']){if(_0x1c57a9[_0xd22e('0x16')][_0xd22e('0x17')]===0x1f4){logger[_0xd22e('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x57630d,_0x1c57a9[_0xd22e('0x16')]['message']);return _0x15ad97(_0x1c57a9[_0xd22e('0x16')][_0xd22e('0x18')]);}logger[_0xd22e('0x16')](_0xd22e('0x11'),_0x57630d,_0x1c57a9[_0xd22e('0x16')][_0xd22e('0x18')]);return _0x54c27d(_0x1c57a9[_0xd22e('0x16')][_0xd22e('0x18')]);}else{logger['info'](_0xd22e('0x11'),_0x57630d,_0xd22e('0x12'));_0x54c27d(_0x1c57a9[_0xd22e('0x19')][_0xd22e('0x18')]);}})[_0xd22e('0x1a')](function(_0x2ccd36){logger['error'](_0xd22e('0x11'),_0x57630d,_0x2ccd36);_0x15ad97(_0x2ccd36);});});}exports['GetVoiceExtension']=function(_0x3a840c){var _0x4d70b6=this;return new Promise(function(_0x5898d1,_0x198189){return db['VoiceExtension']['findAll']({'raw':_0x3a840c[_0xd22e('0x1b')]?_0x3a840c[_0xd22e('0x1b')][_0xd22e('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a840c[_0xd22e('0x1b')]?_0x3a840c['options'][_0xd22e('0x1d')]||null:null,'attributes':_0x3a840c[_0xd22e('0x1b')]?_0x3a840c[_0xd22e('0x1b')]['attributes']||null:null,'limit':_0x3a840c[_0xd22e('0x1b')]?_0x3a840c[_0xd22e('0x1b')][_0xd22e('0x1e')]||null:null,'include':_0x3a840c[_0xd22e('0x1b')]?_0x3a840c['options'][_0xd22e('0x1f')]?_[_0xd22e('0x20')](_0x3a840c[_0xd22e('0x1b')][_0xd22e('0x1f')],function(_0xddb0d1){return{'model':db[_0xddb0d1[_0xd22e('0x21')]],'as':_0xddb0d1['as'],'attributes':_0xddb0d1[_0xd22e('0x22')],'include':_0xddb0d1['include']?_[_0xd22e('0x20')](_0xddb0d1[_0xd22e('0x1f')],function(_0x6f382){return{'model':db[_0x6f382[_0xd22e('0x21')]],'as':_0x6f382['as'],'attributes':_0x6f382[_0xd22e('0x22')],'include':_0x6f382[_0xd22e('0x1f')]?_[_0xd22e('0x20')](_0x6f382[_0xd22e('0x1f')],function(_0x59bc61){return{'model':db[_0x59bc61[_0xd22e('0x21')]],'as':_0x59bc61['as'],'attributes':_0x59bc61[_0xd22e('0x22')]};}):[]};}):[]};}):[]:[]})[_0xd22e('0x10')](function(_0x4532af){logger['info']('GetVoiceExtension',_0x3a840c);logger[_0xd22e('0x13')](_0xd22e('0x23'),_0x3a840c,JSON[_0xd22e('0x15')](_0x4532af));_0x5898d1(_0x4532af);})[_0xd22e('0x1a')](function(_0x3296b3){logger[_0xd22e('0x16')]('GetVoiceExtension',_0x3296b3[_0xd22e('0x18')],_0x3a840c);_0x198189(_0x4d70b6['error'](0x1f4,_0x3296b3['message']));});});};
\ No newline at end of file
+var _0x8411=['result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','model','include','map','debug','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x3f0743,_0x19c784){var _0x291c35=function(_0x4da170){while(--_0x4da170){_0x3f0743['push'](_0x3f0743['shift']());}};_0x291c35(++_0x19c784);}(_0x8411,0x118));var _0x1841=function(_0x148c3d,_0x4ede3a){_0x148c3d=_0x148c3d-0x0;var _0x4d1455=_0x8411[_0x148c3d];return _0x4d1455;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1841('0x0'));var BPromise=require(_0x1841('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1841('0x2'))['db'];var utils=require(_0x1841('0x3'));var logger=require(_0x1841('0x4'))(_0x1841('0x5'));var config=require(_0x1841('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1841('0x7')]['http']({'port':0x232a});config[_0x1841('0x8')]=_[_0x1841('0x9')](config[_0x1841('0x8')],{'host':_0x1841('0xa'),'port':0x18eb});var socket=require(_0x1841('0xb'))(new Redis(config[_0x1841('0x8')]));require(_0x1841('0xc'))[_0x1841('0xd')](socket);function respondWithRpcPromise(_0x1d967f,_0x4218ae,_0x108644){return new BPromise(function(_0x1ae8b8,_0x1a3293){return client[_0x1841('0xe')](_0x1d967f,_0x108644)[_0x1841('0xf')](function(_0xf4b1b2){logger[_0x1841('0x10')](_0x1841('0x11'),_0x4218ae,_0x1841('0x12'));logger['debug'](_0x1841('0x13'),_0x4218ae,_0x1841('0x12'),JSON[_0x1841('0x14')](_0xf4b1b2));if(_0xf4b1b2['error']){if(_0xf4b1b2['error'][_0x1841('0x15')]===0x1f4){logger[_0x1841('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x4218ae,_0xf4b1b2[_0x1841('0x16')][_0x1841('0x17')]);return _0x1a3293(_0xf4b1b2[_0x1841('0x16')][_0x1841('0x17')]);}logger[_0x1841('0x16')](_0x1841('0x11'),_0x4218ae,_0xf4b1b2['error'][_0x1841('0x17')]);return _0x1ae8b8(_0xf4b1b2[_0x1841('0x16')][_0x1841('0x17')]);}else{logger[_0x1841('0x10')](_0x1841('0x11'),_0x4218ae,_0x1841('0x12'));_0x1ae8b8(_0xf4b1b2[_0x1841('0x18')][_0x1841('0x17')]);}})[_0x1841('0x19')](function(_0x41c7ef){logger[_0x1841('0x16')](_0x1841('0x11'),_0x4218ae,_0x41c7ef);_0x1a3293(_0x41c7ef);});});}exports[_0x1841('0x1a')]=function(_0x8f6094){var _0x55f8ed=this;return new Promise(function(_0x31fbdc,_0x234fb4){return db[_0x1841('0x1b')][_0x1841('0x1c')]({'raw':_0x8f6094['options']?_0x8f6094[_0x1841('0x1d')][_0x1841('0x1e')]===undefined?!![]:![]:!![],'where':_0x8f6094[_0x1841('0x1d')]?_0x8f6094[_0x1841('0x1d')][_0x1841('0x1f')]||null:null,'attributes':_0x8f6094[_0x1841('0x1d')]?_0x8f6094[_0x1841('0x1d')][_0x1841('0x20')]||null:null,'limit':_0x8f6094[_0x1841('0x1d')]?_0x8f6094[_0x1841('0x1d')][_0x1841('0x21')]||null:null,'include':_0x8f6094[_0x1841('0x1d')]?_0x8f6094[_0x1841('0x1d')]['include']?_['map'](_0x8f6094[_0x1841('0x1d')]['include'],function(_0x1e7491){return{'model':db[_0x1e7491[_0x1841('0x22')]],'as':_0x1e7491['as'],'attributes':_0x1e7491[_0x1841('0x20')],'include':_0x1e7491[_0x1841('0x23')]?_[_0x1841('0x24')](_0x1e7491[_0x1841('0x23')],function(_0x3b2683){return{'model':db[_0x3b2683[_0x1841('0x22')]],'as':_0x3b2683['as'],'attributes':_0x3b2683[_0x1841('0x20')],'include':_0x3b2683[_0x1841('0x23')]?_['map'](_0x3b2683['include'],function(_0x2e9f75){return{'model':db[_0x2e9f75[_0x1841('0x22')]],'as':_0x2e9f75['as'],'attributes':_0x2e9f75['attributes']};}):[]};}):[]};}):[]:[]})[_0x1841('0xf')](function(_0x302824){logger[_0x1841('0x10')](_0x1841('0x1a'),_0x8f6094);logger[_0x1841('0x25')](_0x1841('0x1a'),_0x8f6094,JSON['stringify'](_0x302824));_0x31fbdc(_0x302824);})[_0x1841('0x19')](function(_0x3c952c){logger[_0x1841('0x16')](_0x1841('0x1a'),_0x3c952c[_0x1841('0x17')],_0x8f6094);_0x234fb4(_0x55f8ed[_0x1841('0x16')](0x1f4,_0x3c952c['message']));});});};
\ No newline at end of file
index 3d2c701..f029af4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0xee4273,_0x485ea5){var _0x12c912=function(_0xb865d9){while(--_0xb865d9){_0xee4273['push'](_0xee4273['shift']());}};_0x12c912(++_0x485ea5);}(_0x1261,0x144));var _0x1126=function(_0x2dfe07,_0x2b663f){_0x2dfe07=_0x2dfe07-0x0;var _0x30aee0=_0x1261[_0x2dfe07];return _0x30aee0;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}};
\ No newline at end of file
+var _0x814b=['removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x246148,_0x1358ee){var _0x453d94=function(_0x59920e){while(--_0x59920e){_0x246148['push'](_0x246148['shift']());}};_0x453d94(++_0x1358ee);}(_0x814b,0x1a2));var _0xb814=function(_0x37dbbb,_0x1909de){_0x37dbbb=_0x37dbbb-0x0;var _0x10068f=_0x814b[_0x37dbbb];return _0x10068f;};'use strict';var VoiceExtensionEvents=require(_0xb814('0x0'));var events=[_0xb814('0x1'),_0xb814('0x2'),_0xb814('0x3')];function createListener(_0xfbb64b,_0x477725){return function(_0x4a98af){_0x477725[_0xb814('0x4')](_0xfbb64b,_0x4a98af);};}function removeListener(_0x3e1e9,_0x258866){return function(){VoiceExtensionEvents[_0xb814('0x5')](_0x3e1e9,_0x258866);};}exports[_0xb814('0x6')]=function(_0x322a70){for(var _0x53e507=0x0,_0x3b0829=events[_0xb814('0x7')];_0x53e507<_0x3b0829;_0x53e507++){var _0x5c8539=events[_0x53e507];var _0x271af9=createListener(_0xb814('0x8')+_0x5c8539,_0x322a70);VoiceExtensionEvents['on'](_0x5c8539,_0x271af9);}};
\ No newline at end of file
index a7bf9b0..90bc344 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bd3=['post','create','put','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/messages','getMessages'];(function(_0x783b6b,_0x13ba68){var _0x317072=function(_0x370ae1){while(--_0x370ae1){_0x783b6b['push'](_0x783b6b['shift']());}};_0x317072(++_0x13ba68);}(_0x4bd3,0x174));var _0x34bd=function(_0x141a4c,_0x50dc53){_0x141a4c=_0x141a4c-0x0;var _0x171541=_0x4bd3[_0x141a4c];return _0x171541;};'use strict';var multer=require(_0x34bd('0x0'));var util=require('util');var path=require(_0x34bd('0x1'));var timeout=require(_0x34bd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x34bd('0x3'));var interaction=require(_0x34bd('0x4'));var config=require(_0x34bd('0x5'));var controller=require('./voiceMail.controller');router[_0x34bd('0x6')]('/',auth[_0x34bd('0x7')](),controller['index']);router[_0x34bd('0x6')](_0x34bd('0x8'),auth['isAuthenticated'](),controller[_0x34bd('0x9')]);router[_0x34bd('0x6')](_0x34bd('0xa'),auth[_0x34bd('0x7')](),controller[_0x34bd('0xb')]);router[_0x34bd('0xc')]('/',auth['isAuthenticated'](),controller[_0x34bd('0xd')]);router[_0x34bd('0xe')](_0x34bd('0x8'),auth[_0x34bd('0x7')](),controller['update']);router['delete'](_0x34bd('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x34bd('0xf')]=router;
\ No newline at end of file
+var _0x323f=['show','/:id/messages','getMessages','post','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id'];(function(_0xa780d8,_0x1b3c61){var _0x40cd3b=function(_0x553077){while(--_0x553077){_0xa780d8['push'](_0xa780d8['shift']());}};_0x40cd3b(++_0x1b3c61);}(_0x323f,0x1ee));var _0xf323=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x323f[_0x6c993a];return _0x27f547;};'use strict';var multer=require('multer');var util=require(_0xf323('0x0'));var path=require('path');var timeout=require(_0xf323('0x1'));var express=require(_0xf323('0x2'));var router=express[_0xf323('0x3')]();var fs_extra=require(_0xf323('0x4'));var auth=require(_0xf323('0x5'));var interaction=require(_0xf323('0x6'));var config=require(_0xf323('0x7'));var controller=require(_0xf323('0x8'));router[_0xf323('0x9')]('/',auth[_0xf323('0xa')](),controller['index']);router[_0xf323('0x9')](_0xf323('0xb'),auth[_0xf323('0xa')](),controller[_0xf323('0xc')]);router[_0xf323('0x9')](_0xf323('0xd'),auth[_0xf323('0xa')](),controller[_0xf323('0xe')]);router[_0xf323('0xf')]('/',auth[_0xf323('0xa')](),controller[_0xf323('0x10')]);router[_0xf323('0x11')](_0xf323('0xb'),auth[_0xf323('0xa')](),controller[_0xf323('0x12')]);router[_0xf323('0x13')](_0xf323('0xb'),auth['isAuthenticated'](),controller[_0xf323('0x14')]);module[_0xf323('0x15')]=router;
\ No newline at end of file
index 33fccb5..98e191c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96b1=['yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','email','string','trim','central'];(function(_0x3f7ac7,_0x20078e){var _0x59bf03=function(_0x13721e){while(--_0x13721e){_0x3f7ac7['push'](_0x3f7ac7['shift']());}};_0x59bf03(++_0x20078e);}(_0x96b1,0x173));var _0x196b=function(_0x5cbace,_0x33943c){_0x5cbace=_0x5cbace-0x0;var _0x6de5b8=_0x96b1[_0x5cbace];return _0x6de5b8;};'use strict';var Sequelize=require(_0x196b('0x0'));module[_0x196b('0x1')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x196b('0x2')],'defaultValue':_0x196b('0x3'),'unique':_0x196b('0x4')},'mailbox':{'type':Sequelize[_0x196b('0x2')],'defaultValue':'','allowNull':![],'unique':_0x196b('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x196b('0x2')],'validate':{'isEmail':!![]},'set':function(_0x26937a){this['setDataValue'](_0x196b('0x5'),typeof _0x26937a===_0x196b('0x6')&&_0x26937a[_0x196b('0x7')]()?_0x26937a[_0x196b('0x7')]():null);}},'pager':{'type':Sequelize[_0x196b('0x2')]},'tz':{'type':Sequelize[_0x196b('0x2')],'defaultValue':_0x196b('0x8')},'attach':{'type':Sequelize['ENUM'](_0x196b('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x196b('0xa')](_0x196b('0x9'),'no'),'defaultValue':_0x196b('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x196b('0x2')]},'callback':{'type':Sequelize[_0x196b('0x2')]},'review':{'type':Sequelize[_0x196b('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x196b('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x196b('0xa')](_0x196b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x196b('0xa')](_0x196b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x196b('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x196b('0xa')](_0x196b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x196b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x196b('0xa')](_0x196b('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x196b('0xa')](_0x196b('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x196b('0xa')](_0x196b('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x196b('0xc')},'emailsubject':{'type':Sequelize[_0x196b('0x2')]},'emailbody':{'type':Sequelize[_0x196b('0x2')]},'maxsecs':{'type':Sequelize[_0x196b('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x196b('0xe')],'get':function(){return this[_0x196b('0xf')](_0x196b('0x10'))+_0x196b('0x11')+this[_0x196b('0xf')](_0x196b('0x12'));}}};
\ No newline at end of file
+var _0x54fc=['setDataValue','email','string','trim','central','ENUM','yes','INTEGER','VIRTUAL','getDataValue','\x20-\x20','sequelize','STRING','from-voicemail','contest_mailbox'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0x54fc,0x1dc));var _0xc54f=function(_0x36e2b7,_0x12c60f){_0x36e2b7=_0x36e2b7-0x0;var _0x3e1511=_0x54fc[_0x36e2b7];return _0x3e1511;};'use strict';var Sequelize=require(_0xc54f('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0xc54f('0x1')]},'context':{'type':Sequelize[_0xc54f('0x1')],'defaultValue':_0xc54f('0x2'),'unique':_0xc54f('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xc54f('0x3')},'password':{'type':Sequelize[_0xc54f('0x1')]},'fullname':{'type':Sequelize[_0xc54f('0x1')]},'email':{'type':Sequelize[_0xc54f('0x1')],'validate':{'isEmail':!![]},'set':function(_0x170b88){this[_0xc54f('0x4')](_0xc54f('0x5'),typeof _0x170b88===_0xc54f('0x6')&&_0x170b88['trim']()?_0x170b88[_0xc54f('0x7')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xc54f('0x8')},'attach':{'type':Sequelize[_0xc54f('0x9')](_0xc54f('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0xc54f('0x9')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xc54f('0x1')]},'callback':{'type':Sequelize[_0xc54f('0x1')]},'review':{'type':Sequelize[_0xc54f('0x9')](_0xc54f('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xc54f('0x9')](_0xc54f('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xc54f('0x9')](_0xc54f('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xc54f('0x9')](_0xc54f('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xc54f('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xc54f('0x9')](_0xc54f('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xc54f('0x9')](_0xc54f('0xa'),'no'),'defaultValue':_0xc54f('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0xc54f('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xc54f('0x9')](_0xc54f('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xc54f('0x9')]('yes','no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xc54f('0x1')]},'emailbody':{'type':Sequelize[_0xc54f('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xc54f('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xc54f('0xc')],'get':function(){return this[_0xc54f('0xd')]('fullname')+_0xc54f('0xe')+this[_0xc54f('0xd')]('mailbox');}}};
\ No newline at end of file
index 0aa7822..759bb9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3f=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','get','Voicemails','UserProfileResource','destroy','error','stack','name','send','map','VoiceMail','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','show','params','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','length','mailbox','VoiceMailMessage','findAndCountAll','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x4b037f,_0x361dfe){var _0x500505=function(_0x503797){while(--_0x503797){_0x4b037f['push'](_0x4b037f['shift']());}};_0x500505(++_0x361dfe);}(_0xda3f,0xec));var _0xfda3=function(_0x3bfaa4,_0x414af8){_0x3bfaa4=_0x3bfaa4-0x0;var _0x5b2cd5=_0xda3f[_0x3bfaa4];return _0x5b2cd5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfda3('0x0'));var zipdir=require(_0xfda3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfda3('0x2'));var Mustache=require('mustache');var util=require(_0xfda3('0x3'));var path=require(_0xfda3('0x4'));var sox=require('sox');var csv=require(_0xfda3('0x5'));var ejs=require(_0xfda3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x5'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var licenseUtil=require(_0xfda3('0x15'));var db=require(_0xfda3('0x16'))['db'];function respondWithStatusCode(_0x4b77ea,_0x583125){_0x583125=_0x583125||0xcc;return function(_0x5d7d5b){if(_0x5d7d5b){return _0x4b77ea[_0xfda3('0x17')](_0x583125);}return _0x4b77ea[_0xfda3('0x18')](_0x583125)['end']();};}function respondWithResult(_0x501588,_0x587e9b){_0x587e9b=_0x587e9b||0xc8;return function(_0x227d72){if(_0x227d72){return _0x501588[_0xfda3('0x18')](_0x587e9b)['json'](_0x227d72);}};}function respondWithFilteredResult(_0x57a229,_0x533365){return function(_0x80ea80){if(_0x80ea80){var _0x474707=typeof _0x533365[_0xfda3('0x19')]===_0xfda3('0x1a')&&typeof _0x533365[_0xfda3('0x1b')]===_0xfda3('0x1a');var _0x2aadcb=_0x80ea80[_0xfda3('0x1c')];var _0x4680bf=_0x474707?0x0:_0x533365[_0xfda3('0x19')];var _0x54a7c6=_0x474707?_0x80ea80[_0xfda3('0x1c')]:_0x533365[_0xfda3('0x19')]+_0x533365[_0xfda3('0x1b')];var _0x32855a;if(_0x54a7c6>=_0x2aadcb){_0x54a7c6=_0x2aadcb;_0x32855a=0xc8;}else{_0x32855a=0xce;}_0x57a229['status'](_0x32855a);return _0x57a229[_0xfda3('0x1d')](_0xfda3('0x1e'),_0x4680bf+'-'+_0x54a7c6+'/'+_0x2aadcb)[_0xfda3('0x1f')](_0x80ea80);}return null;};}function patchUpdates(_0x51e731){return function(_0x5ad52a){try{jsonpatch[_0xfda3('0x20')](_0x5ad52a,_0x51e731,!![]);}catch(_0x38d428){return BPromise[_0xfda3('0x21')](_0x38d428);}return _0x5ad52a['save']();};}function saveUpdates(_0x3cf5a9,_0xef2535){return function(_0x1e15a8){if(_0x1e15a8){return _0x1e15a8[_0xfda3('0x22')](_0x3cf5a9)[_0xfda3('0x23')](function(_0x2b84b7){return _0x2b84b7;});}return null;};}function removeEntity(_0x2677f6,_0xc6fb9a){return function(_0x16eaa6){if(_0x16eaa6){return _0x16eaa6['destroy']()[_0xfda3('0x23')](function(){var _0x2d5b44=_0x16eaa6[_0xfda3('0x24')]({'plain':!![]});var _0x4ae9b9=_0xfda3('0x25');return db[_0xfda3('0x26')][_0xfda3('0x27')]({'where':{'type':_0x4ae9b9,'resourceId':_0x2d5b44['id']}})[_0xfda3('0x23')](function(){return _0x16eaa6;});})[_0xfda3('0x23')](function(){_0x2677f6[_0xfda3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c6d7d,_0x1e87fe){return function(_0x2bef2b){if(!_0x2bef2b){_0x3c6d7d[_0xfda3('0x17')](0x194);}return _0x2bef2b;};}function handleError(_0x33ffd4,_0x5704c7){_0x5704c7=_0x5704c7||0x1f4;return function(_0x3c1549){logger[_0xfda3('0x28')](_0x3c1549[_0xfda3('0x29')]);if(_0x3c1549[_0xfda3('0x2a')]){delete _0x3c1549[_0xfda3('0x2a')];}_0x33ffd4[_0xfda3('0x18')](_0x5704c7)[_0xfda3('0x2b')](_0x3c1549);};}exports['index']=function(_0x56ca3a,_0x3aef3c){var _0x4fd277={},_0x4b9d90={},_0x16b4a2={'count':0x0,'rows':[]};var _0x2a5971=_[_0xfda3('0x2c')](db[_0xfda3('0x2d')][_0xfda3('0x2e')],function(_0x35ec7a){return{'name':_0x35ec7a[_0xfda3('0x2f')],'type':_0x35ec7a[_0xfda3('0x30')][_0xfda3('0x31')]};});_0x4b9d90['model']=_[_0xfda3('0x2c')](_0x2a5971,_0xfda3('0x2a'));_0x4b9d90[_0xfda3('0x32')]=_[_0xfda3('0x33')](_0x56ca3a[_0xfda3('0x32')]);_0x4b9d90[_0xfda3('0x34')]=_[_0xfda3('0x35')](_0x4b9d90[_0xfda3('0x36')],_0x4b9d90[_0xfda3('0x32')]);_0x4fd277['attributes']=_['intersection'](_0x4b9d90[_0xfda3('0x36')],qs[_0xfda3('0x37')](_0x56ca3a['query'][_0xfda3('0x37')]));_0x4fd277[_0xfda3('0x38')]=_0x4fd277[_0xfda3('0x38')]['length']?_0x4fd277[_0xfda3('0x38')]:_0x4b9d90[_0xfda3('0x36')];if(!_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x39')](_0xfda3('0x3a'))){_0x4fd277['limit']=qs[_0xfda3('0x1b')](_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x1b')]);_0x4fd277['offset']=qs[_0xfda3('0x19')](_0x56ca3a['query'][_0xfda3('0x19')]);}_0x4fd277[_0xfda3('0x3b')]=qs[_0xfda3('0x3c')](_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x3c')]);_0x4fd277[_0xfda3('0x3d')]=qs[_0xfda3('0x34')](_[_0xfda3('0x3e')](_0x56ca3a['query'],_0x4b9d90[_0xfda3('0x34')]),_0x2a5971);if(_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x3f')]){_0x4fd277[_0xfda3('0x3d')]=_['merge'](_0x4fd277[_0xfda3('0x3d')],{'$or':_[_0xfda3('0x2c')](_0x2a5971,function(_0x590ba5){if(_0x590ba5['type']!=='VIRTUAL'){var _0x31b173={};_0x31b173[_0x590ba5[_0xfda3('0x2a')]]={'$like':'%'+_0x56ca3a[_0xfda3('0x32')][_0xfda3('0x3f')]+'%'};return _0x31b173;}})});}_0x4fd277=_[_0xfda3('0x40')]({},_0x4fd277,_0x56ca3a[_0xfda3('0x41')]);var _0x40b814={'where':_0x4fd277[_0xfda3('0x3d')]};return db[_0xfda3('0x2d')][_0xfda3('0x1c')](_0x40b814)['then'](function(_0x27200f){_0x16b4a2[_0xfda3('0x1c')]=_0x27200f;if(_0x56ca3a['query'][_0xfda3('0x42')]){_0x4fd277['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x4fd277);})[_0xfda3('0x23')](function(_0x107fb1){_0x16b4a2[_0xfda3('0x43')]=_0x107fb1;return _0x16b4a2;})[_0xfda3('0x23')](respondWithFilteredResult(_0x3aef3c,_0x4fd277))['catch'](handleError(_0x3aef3c,null));};exports[_0xfda3('0x44')]=function(_0x25b9a6,_0x154ae7){var _0x2ce504={'raw':!![],'where':{'id':_0x25b9a6[_0xfda3('0x45')]['id']}},_0x564ccd={};_0x564ccd[_0xfda3('0x36')]=_[_0xfda3('0x33')](db['VoiceMail']['rawAttributes']);_0x564ccd[_0xfda3('0x32')]=_[_0xfda3('0x33')](_0x25b9a6[_0xfda3('0x32')]);_0x564ccd[_0xfda3('0x34')]=_[_0xfda3('0x35')](_0x564ccd[_0xfda3('0x36')],_0x564ccd[_0xfda3('0x32')]);_0x2ce504[_0xfda3('0x38')]=_[_0xfda3('0x35')](_0x564ccd[_0xfda3('0x36')],qs[_0xfda3('0x37')](_0x25b9a6[_0xfda3('0x32')][_0xfda3('0x37')]));_0x2ce504[_0xfda3('0x38')]=_0x2ce504['attributes']['length']?_0x2ce504[_0xfda3('0x38')]:_0x564ccd[_0xfda3('0x36')];if(_0x25b9a6[_0xfda3('0x32')][_0xfda3('0x42')]){_0x2ce504[_0xfda3('0x46')]=[{'all':!![]}];}_0x2ce504=_[_0xfda3('0x40')]({},_0x2ce504,_0x25b9a6[_0xfda3('0x41')]);return db[_0xfda3('0x2d')][_0xfda3('0x47')](_0x2ce504)[_0xfda3('0x23')](handleEntityNotFound(_0x154ae7,null))['then'](respondWithResult(_0x154ae7,null))[_0xfda3('0x48')](handleError(_0x154ae7,null));};exports[_0xfda3('0x49')]=function(_0x481356,_0x36aa3a){return db[_0xfda3('0x2d')]['create'](_0x481356[_0xfda3('0x4a')],{})[_0xfda3('0x23')](function(_0x15eb87){var _0x4bcd2b=_0x481356[_0xfda3('0x4b')][_0xfda3('0x24')]({'plain':!![]});if(!_0x4bcd2b)throw new Error(_0xfda3('0x4c'));if(_0x4bcd2b['role']===_0xfda3('0x4b')){var _0x33565d=_0x15eb87[_0xfda3('0x24')]({'plain':!![]});var _0x2f6e62=_0xfda3('0x25');return db['UserProfileSection'][_0xfda3('0x47')]({'where':{'name':_0x2f6e62,'userProfileId':_0x4bcd2b['userProfileId']},'raw':!![]})[_0xfda3('0x23')](function(_0x587eef){if(_0x587eef&&_0x587eef[_0xfda3('0x4d')]===0x0){return db[_0xfda3('0x26')][_0xfda3('0x49')]({'name':_0x33565d[_0xfda3('0x2a')],'resourceId':_0x33565d['id'],'type':_0x587eef['name'],'sectionId':_0x587eef['id']},{})[_0xfda3('0x23')](function(){return _0x15eb87;});}else{return _0x15eb87;}})[_0xfda3('0x48')](function(_0x2f2c32){logger[_0xfda3('0x28')](_0xfda3('0x4e'),_0x2f2c32);throw _0x2f2c32;});}return _0x15eb87;})[_0xfda3('0x23')](respondWithResult(_0x36aa3a,0xc9))[_0xfda3('0x48')](handleError(_0x36aa3a,null));};exports['update']=function(_0x4b1410,_0x4fb214){if(_0x4b1410[_0xfda3('0x4a')]['id']){delete _0x4b1410[_0xfda3('0x4a')]['id'];}return db['VoiceMail']['find']({'where':{'id':_0x4b1410[_0xfda3('0x45')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x4fb214,null))[_0xfda3('0x23')](saveUpdates(_0x4b1410[_0xfda3('0x4a')],null))[_0xfda3('0x23')](respondWithResult(_0x4fb214,null))['catch'](handleError(_0x4fb214,null));};exports[_0xfda3('0x27')]=function(_0x2a30e8,_0x167424){return db[_0xfda3('0x2d')][_0xfda3('0x47')]({'where':{'id':_0x2a30e8[_0xfda3('0x45')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x167424,null))[_0xfda3('0x23')](removeEntity(_0x167424,null))[_0xfda3('0x48')](handleError(_0x167424,null));};exports[_0xfda3('0x4f')]=function(_0x3ed7c1,_0x1fa27a,_0x5b426b){return db[_0xfda3('0x2d')][_0xfda3('0x50')]({'where':{'id':_0x3ed7c1[_0xfda3('0x45')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x1fa27a,null))[_0xfda3('0x23')](function(_0x405d7e){var _0x42c7a1;var _0x4ce31c={},_0x5a3a6f={};_0x5a3a6f[_0xfda3('0x36')]=_[_0xfda3('0x33')](db['VoiceMailMessage'][_0xfda3('0x2e')]);_0x5a3a6f[_0xfda3('0x32')]=_[_0xfda3('0x33')](_0x3ed7c1[_0xfda3('0x32')]);_0x5a3a6f['filters']=_['intersection'](_0x5a3a6f[_0xfda3('0x36')],_0x5a3a6f[_0xfda3('0x32')]);_0x4ce31c[_0xfda3('0x38')]=_['intersection'](_0x5a3a6f[_0xfda3('0x36')],qs['fields'](_0x3ed7c1[_0xfda3('0x32')][_0xfda3('0x37')]));_0x4ce31c[_0xfda3('0x38')]=_0x4ce31c[_0xfda3('0x38')][_0xfda3('0x51')]?_0x4ce31c[_0xfda3('0x38')]:_0x5a3a6f['model'];if(!_0x3ed7c1[_0xfda3('0x32')][_0xfda3('0x39')](_0xfda3('0x3a'))){_0x4ce31c[_0xfda3('0x1b')]=qs[_0xfda3('0x1b')](_0x3ed7c1['query']['limit']);_0x4ce31c[_0xfda3('0x19')]=qs[_0xfda3('0x19')](_0x3ed7c1['query']['offset']);}_0x4ce31c['order']=qs[_0xfda3('0x3c')](_0x3ed7c1[_0xfda3('0x32')]['sort']);_0x4ce31c[_0xfda3('0x3d')]=qs[_0xfda3('0x34')](_[_0xfda3('0x3e')](_0x3ed7c1[_0xfda3('0x32')],_0x5a3a6f['filters']));if(_0x3ed7c1[_0xfda3('0x32')][_0xfda3('0x3f')]){_0x4ce31c[_0xfda3('0x3d')]=_[_0xfda3('0x40')](_0x4ce31c[_0xfda3('0x3d')],{'$or':_[_0xfda3('0x2c')](_0x4ce31c['attributes'],function(_0x4e312d){var _0x31d657={};_0x31d657[_0x4e312d]={'$like':'%'+_0x3ed7c1['query'][_0xfda3('0x3f')]+'%'};return _0x31d657;})});}_0x4ce31c[_0xfda3('0x3d')]=_[_0xfda3('0x40')](_0x4ce31c[_0xfda3('0x3d')],{'mailboxuser':_0x405d7e[_0xfda3('0x52')]});_0x4ce31c=_[_0xfda3('0x40')]({},_0x4ce31c,_0x3ed7c1[_0xfda3('0x41')]);return db[_0xfda3('0x53')][_0xfda3('0x54')](_0x4ce31c)[_0xfda3('0x23')](respondWithFilteredResult(_0x1fa27a,_0x4ce31c));})['catch'](handleError(_0x1fa27a,null));};
\ No newline at end of file
+var _0x0102=['rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','get','Voicemails','destroy','then','sendStatus','stack','name','send','index','VoiceMail'];(function(_0x55fa8d,_0x23e238){var _0x130c92=function(_0x13989e){while(--_0x13989e){_0x55fa8d['push'](_0x55fa8d['shift']());}};_0x130c92(++_0x23e238);}(_0x0102,0x186));var _0x2010=function(_0x5f5933,_0x371126){_0x5f5933=_0x5f5933-0x0;var _0x405dca=_0x0102[_0x5f5933];return _0x405dca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2010('0x0'));var zipdir=require(_0x2010('0x1'));var jsonpatch=require(_0x2010('0x2'));var rp=require(_0x2010('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x2010('0x4'));var csv=require(_0x2010('0x5'));var ejs=require(_0x2010('0x6'));var fs=require('fs');var fs_extra=require(_0x2010('0x7'));var _=require('lodash');var squel=require(_0x2010('0x8'));var crypto=require('crypto');var jsforce=require(_0x2010('0x9'));var deskjs=require(_0x2010('0xa'));var toCsv=require('to-csv');var querystring=require(_0x2010('0xb'));var Papa=require(_0x2010('0xc'));var Redis=require(_0x2010('0xd'));var authService=require(_0x2010('0xe'));var qs=require(_0x2010('0xf'));var as=require(_0x2010('0x10'));var hardwareService=require(_0x2010('0x11'));var logger=require(_0x2010('0x12'))(_0x2010('0x13'));var utils=require(_0x2010('0x14'));var config=require(_0x2010('0x15'));var licenseUtil=require(_0x2010('0x16'));var db=require(_0x2010('0x17'))['db'];function respondWithStatusCode(_0x3f307c,_0x3e8624){_0x3e8624=_0x3e8624||0xcc;return function(_0x388991){if(_0x388991){return _0x3f307c['sendStatus'](_0x3e8624);}return _0x3f307c['status'](_0x3e8624)[_0x2010('0x18')]();};}function respondWithResult(_0x385720,_0x2e8ec2){_0x2e8ec2=_0x2e8ec2||0xc8;return function(_0x10b587){if(_0x10b587){return _0x385720[_0x2010('0x19')](_0x2e8ec2)[_0x2010('0x1a')](_0x10b587);}};}function respondWithFilteredResult(_0x517ff4,_0x3195fa){return function(_0x136418){if(_0x136418){var _0x5ad412=typeof _0x3195fa[_0x2010('0x1b')]===_0x2010('0x1c')&&typeof _0x3195fa[_0x2010('0x1d')]===_0x2010('0x1c');var _0x2d0bf2=_0x136418[_0x2010('0x1e')];var _0x83cd35=_0x5ad412?0x0:_0x3195fa[_0x2010('0x1b')];var _0x309477=_0x5ad412?_0x136418['count']:_0x3195fa['offset']+_0x3195fa[_0x2010('0x1d')];var _0x38a15a;if(_0x309477>=_0x2d0bf2){_0x309477=_0x2d0bf2;_0x38a15a=0xc8;}else{_0x38a15a=0xce;}_0x517ff4[_0x2010('0x19')](_0x38a15a);return _0x517ff4[_0x2010('0x1f')]('Content-Range',_0x83cd35+'-'+_0x309477+'/'+_0x2d0bf2)['json'](_0x136418);}return null;};}function patchUpdates(_0x22c252){return function(_0x171e45){try{jsonpatch[_0x2010('0x20')](_0x171e45,_0x22c252,!![]);}catch(_0x26facc){return BPromise[_0x2010('0x21')](_0x26facc);}return _0x171e45[_0x2010('0x22')]();};}function saveUpdates(_0x4f621c,_0x3db13d){return function(_0x1cfa57){if(_0x1cfa57){return _0x1cfa57['update'](_0x4f621c)['then'](function(_0x50aecc){return _0x50aecc;});}return null;};}function removeEntity(_0x424453,_0x574719){return function(_0x277dcc){if(_0x277dcc){return _0x277dcc['destroy']()['then'](function(){var _0xdb57be=_0x277dcc[_0x2010('0x23')]({'plain':!![]});var _0x52b4fe=_0x2010('0x24');return db['UserProfileResource'][_0x2010('0x25')]({'where':{'type':_0x52b4fe,'resourceId':_0xdb57be['id']}})[_0x2010('0x26')](function(){return _0x277dcc;});})[_0x2010('0x26')](function(){_0x424453[_0x2010('0x19')](0xcc)[_0x2010('0x18')]();});}};}function handleEntityNotFound(_0x2f63bb,_0x981b65){return function(_0x3eb4dc){if(!_0x3eb4dc){_0x2f63bb[_0x2010('0x27')](0x194);}return _0x3eb4dc;};}function handleError(_0x103460,_0x122ee3){_0x122ee3=_0x122ee3||0x1f4;return function(_0x2ebdbb){logger['error'](_0x2ebdbb[_0x2010('0x28')]);if(_0x2ebdbb['name']){delete _0x2ebdbb[_0x2010('0x29')];}_0x103460[_0x2010('0x19')](_0x122ee3)[_0x2010('0x2a')](_0x2ebdbb);};}exports[_0x2010('0x2b')]=function(_0x564a64,_0x554f66){var _0x136d5f={},_0x48d9f2={},_0x2839f2={'count':0x0,'rows':[]};var _0x1d5d7a=_['map'](db[_0x2010('0x2c')][_0x2010('0x2d')],function(_0x2b1ff7){return{'name':_0x2b1ff7[_0x2010('0x2e')],'type':_0x2b1ff7[_0x2010('0x2f')]['key']};});_0x48d9f2[_0x2010('0x30')]=_[_0x2010('0x31')](_0x1d5d7a,_0x2010('0x29'));_0x48d9f2['query']=_['keys'](_0x564a64[_0x2010('0x32')]);_0x48d9f2[_0x2010('0x33')]=_[_0x2010('0x34')](_0x48d9f2['model'],_0x48d9f2['query']);_0x136d5f[_0x2010('0x35')]=_[_0x2010('0x34')](_0x48d9f2[_0x2010('0x30')],qs[_0x2010('0x36')](_0x564a64[_0x2010('0x32')]['fields']));_0x136d5f['attributes']=_0x136d5f['attributes'][_0x2010('0x37')]?_0x136d5f[_0x2010('0x35')]:_0x48d9f2[_0x2010('0x30')];if(!_0x564a64['query'][_0x2010('0x38')](_0x2010('0x39'))){_0x136d5f[_0x2010('0x1d')]=qs[_0x2010('0x1d')](_0x564a64['query'][_0x2010('0x1d')]);_0x136d5f[_0x2010('0x1b')]=qs[_0x2010('0x1b')](_0x564a64['query'][_0x2010('0x1b')]);}_0x136d5f['order']=qs[_0x2010('0x3a')](_0x564a64[_0x2010('0x32')][_0x2010('0x3a')]);_0x136d5f[_0x2010('0x3b')]=qs[_0x2010('0x33')](_[_0x2010('0x3c')](_0x564a64['query'],_0x48d9f2[_0x2010('0x33')]),_0x1d5d7a);if(_0x564a64['query'][_0x2010('0x3d')]){_0x136d5f[_0x2010('0x3b')]=_[_0x2010('0x3e')](_0x136d5f[_0x2010('0x3b')],{'$or':_[_0x2010('0x31')](_0x1d5d7a,function(_0x1f053c){if(_0x1f053c[_0x2010('0x2f')]!==_0x2010('0x3f')){var _0x2fcaef={};_0x2fcaef[_0x1f053c[_0x2010('0x29')]]={'$like':'%'+_0x564a64[_0x2010('0x32')][_0x2010('0x3d')]+'%'};return _0x2fcaef;}})});}_0x136d5f=_[_0x2010('0x3e')]({},_0x136d5f,_0x564a64[_0x2010('0x40')]);var _0x4b6251={'where':_0x136d5f['where']};return db[_0x2010('0x2c')][_0x2010('0x1e')](_0x4b6251)[_0x2010('0x26')](function(_0x35d631){_0x2839f2[_0x2010('0x1e')]=_0x35d631;if(_0x564a64[_0x2010('0x32')][_0x2010('0x41')]){_0x136d5f['include']=[{'all':!![]}];}return db[_0x2010('0x2c')]['findAll'](_0x136d5f);})[_0x2010('0x26')](function(_0x3ff496){_0x2839f2[_0x2010('0x42')]=_0x3ff496;return _0x2839f2;})[_0x2010('0x26')](respondWithFilteredResult(_0x554f66,_0x136d5f))[_0x2010('0x43')](handleError(_0x554f66,null));};exports['show']=function(_0x364338,_0x71eb35){var _0x3dd83c={'raw':!![],'where':{'id':_0x364338['params']['id']}},_0x41b3b5={};_0x41b3b5[_0x2010('0x30')]=_['keys'](db['VoiceMail']['rawAttributes']);_0x41b3b5[_0x2010('0x32')]=_[_0x2010('0x44')](_0x364338[_0x2010('0x32')]);_0x41b3b5[_0x2010('0x33')]=_[_0x2010('0x34')](_0x41b3b5[_0x2010('0x30')],_0x41b3b5['query']);_0x3dd83c[_0x2010('0x35')]=_[_0x2010('0x34')](_0x41b3b5[_0x2010('0x30')],qs['fields'](_0x364338['query'][_0x2010('0x36')]));_0x3dd83c['attributes']=_0x3dd83c[_0x2010('0x35')][_0x2010('0x37')]?_0x3dd83c[_0x2010('0x35')]:_0x41b3b5[_0x2010('0x30')];if(_0x364338['query'][_0x2010('0x41')]){_0x3dd83c[_0x2010('0x45')]=[{'all':!![]}];}_0x3dd83c=_[_0x2010('0x3e')]({},_0x3dd83c,_0x364338[_0x2010('0x40')]);return db[_0x2010('0x2c')][_0x2010('0x46')](_0x3dd83c)['then'](handleEntityNotFound(_0x71eb35,null))[_0x2010('0x26')](respondWithResult(_0x71eb35,null))[_0x2010('0x43')](handleError(_0x71eb35,null));};exports[_0x2010('0x47')]=function(_0x4dc0cf,_0x30e5d0){return db[_0x2010('0x2c')]['create'](_0x4dc0cf[_0x2010('0x48')],{})[_0x2010('0x26')](function(_0x110791){var _0x242274=_0x4dc0cf[_0x2010('0x49')][_0x2010('0x23')]({'plain':!![]});if(!_0x242274)throw new Error(_0x2010('0x4a'));if(_0x242274[_0x2010('0x4b')]==='user'){var _0x5258b9=_0x110791[_0x2010('0x23')]({'plain':!![]});var _0xe1721f='Voicemails';return db[_0x2010('0x4c')][_0x2010('0x46')]({'where':{'name':_0xe1721f,'userProfileId':_0x242274[_0x2010('0x4d')]},'raw':!![]})[_0x2010('0x26')](function(_0x1f1a59){if(_0x1f1a59&&_0x1f1a59['autoAssociation']===0x0){return db['UserProfileResource'][_0x2010('0x47')]({'name':_0x5258b9[_0x2010('0x29')],'resourceId':_0x5258b9['id'],'type':_0x1f1a59[_0x2010('0x29')],'sectionId':_0x1f1a59['id']},{})[_0x2010('0x26')](function(){return _0x110791;});}else{return _0x110791;}})[_0x2010('0x43')](function(_0x2d8164){logger[_0x2010('0x4e')](_0x2010('0x4f'),_0x2d8164);throw _0x2d8164;});}return _0x110791;})[_0x2010('0x26')](respondWithResult(_0x30e5d0,0xc9))[_0x2010('0x43')](handleError(_0x30e5d0,null));};exports[_0x2010('0x50')]=function(_0x5313b5,_0x24421a){if(_0x5313b5[_0x2010('0x48')]['id']){delete _0x5313b5['body']['id'];}return db[_0x2010('0x2c')][_0x2010('0x46')]({'where':{'id':_0x5313b5[_0x2010('0x51')]['id']}})[_0x2010('0x26')](handleEntityNotFound(_0x24421a,null))[_0x2010('0x26')](saveUpdates(_0x5313b5[_0x2010('0x48')],null))[_0x2010('0x26')](respondWithResult(_0x24421a,null))[_0x2010('0x43')](handleError(_0x24421a,null));};exports[_0x2010('0x25')]=function(_0x2dbc2c,_0x1c0b2d){return db[_0x2010('0x2c')][_0x2010('0x46')]({'where':{'id':_0x2dbc2c[_0x2010('0x51')]['id']}})[_0x2010('0x26')](handleEntityNotFound(_0x1c0b2d,null))[_0x2010('0x26')](removeEntity(_0x1c0b2d,null))[_0x2010('0x43')](handleError(_0x1c0b2d,null));};exports[_0x2010('0x52')]=function(_0x2d7765,_0x6f8565,_0x21ee87){return db[_0x2010('0x2c')][_0x2010('0x53')]({'where':{'id':_0x2d7765['params']['id']}})[_0x2010('0x26')](handleEntityNotFound(_0x6f8565,null))['then'](function(_0x5253d5){var _0x1225d7;var _0x13f33d={},_0x4fb5d5={};_0x4fb5d5[_0x2010('0x30')]=_[_0x2010('0x44')](db[_0x2010('0x54')][_0x2010('0x2d')]);_0x4fb5d5['query']=_[_0x2010('0x44')](_0x2d7765[_0x2010('0x32')]);_0x4fb5d5[_0x2010('0x33')]=_[_0x2010('0x34')](_0x4fb5d5['model'],_0x4fb5d5[_0x2010('0x32')]);_0x13f33d['attributes']=_[_0x2010('0x34')](_0x4fb5d5[_0x2010('0x30')],qs[_0x2010('0x36')](_0x2d7765[_0x2010('0x32')]['fields']));_0x13f33d['attributes']=_0x13f33d[_0x2010('0x35')][_0x2010('0x37')]?_0x13f33d['attributes']:_0x4fb5d5['model'];if(!_0x2d7765[_0x2010('0x32')][_0x2010('0x38')](_0x2010('0x39'))){_0x13f33d[_0x2010('0x1d')]=qs['limit'](_0x2d7765[_0x2010('0x32')]['limit']);_0x13f33d[_0x2010('0x1b')]=qs[_0x2010('0x1b')](_0x2d7765[_0x2010('0x32')][_0x2010('0x1b')]);}_0x13f33d['order']=qs[_0x2010('0x3a')](_0x2d7765[_0x2010('0x32')]['sort']);_0x13f33d[_0x2010('0x3b')]=qs[_0x2010('0x33')](_[_0x2010('0x3c')](_0x2d7765[_0x2010('0x32')],_0x4fb5d5[_0x2010('0x33')]));if(_0x2d7765[_0x2010('0x32')][_0x2010('0x3d')]){_0x13f33d[_0x2010('0x3b')]=_[_0x2010('0x3e')](_0x13f33d[_0x2010('0x3b')],{'$or':_[_0x2010('0x31')](_0x13f33d[_0x2010('0x35')],function(_0x4ebdca){var _0x3ca7b3={};_0x3ca7b3[_0x4ebdca]={'$like':'%'+_0x2d7765[_0x2010('0x32')][_0x2010('0x3d')]+'%'};return _0x3ca7b3;})});}_0x13f33d['where']=_['merge'](_0x13f33d[_0x2010('0x3b')],{'mailboxuser':_0x5253d5[_0x2010('0x55')]});_0x13f33d=_[_0x2010('0x3e')]({},_0x13f33d,_0x2d7765[_0x2010('0x40')]);return db[_0x2010('0x54')][_0x2010('0x56')](_0x13f33d)['then'](respondWithFilteredResult(_0x6f8565,_0x13f33d));})[_0x2010('0x43')](handleError(_0x6f8565,null));};
\ No newline at end of file
index 0597761..9556cee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f73=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./voiceMail.attributes','define','voice_voicemail','mailbox_context','mailbox','context','lodash'];(function(_0x314f55,_0x3ce0ab){var _0x49ed4e=function(_0x3533e7){while(--_0x3533e7){_0x314f55['push'](_0x314f55['shift']());}};_0x49ed4e(++_0x3ce0ab);}(_0x3f73,0x117));var _0x33f7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3f73[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x33f7('0x0'));var util=require(_0x33f7('0x1'));var logger=require(_0x33f7('0x2'))(_0x33f7('0x3'));var moment=require(_0x33f7('0x4'));var BPromise=require('bluebird');var rp=require(_0x33f7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x33f7('0x6'));var config=require(_0x33f7('0x7'));var attributes=require(_0x33f7('0x8'));module['exports']=function(_0x2fcb7c,_0xd1acf0){return _0x2fcb7c[_0x33f7('0x9')]('VoiceMail',attributes,{'tableName':_0x33f7('0xa'),'paranoid':![],'indexes':[{'name':_0x33f7('0xb'),'fields':[_0x33f7('0xc'),_0x33f7('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xad46=['../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox_context','context','lodash','../../config/logger','bluebird','path'];(function(_0x489967,_0x5da9d6){var _0x18e0ba=function(_0x3c3e15){while(--_0x3c3e15){_0x489967['push'](_0x489967['shift']());}};_0x18e0ba(++_0x5da9d6);}(_0xad46,0x130));var _0x6ad4=function(_0x22766f,_0x577e75){_0x22766f=_0x22766f-0x0;var _0x5e0773=_0xad46[_0x22766f];return _0x5e0773;};'use strict';var _=require(_0x6ad4('0x0'));var util=require('util');var logger=require(_0x6ad4('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6ad4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ad4('0x3'));var rimraf=require('rimraf');var config=require(_0x6ad4('0x4'));var attributes=require(_0x6ad4('0x5'));module[_0x6ad4('0x6')]=function(_0x5c2009,_0x32611c){return _0x5c2009['define'](_0x6ad4('0x7'),attributes,{'tableName':_0x6ad4('0x8'),'paranoid':![],'indexes':[{'name':_0x6ad4('0x9'),'fields':['mailbox',_0x6ad4('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 0511975..f5ea498 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6380=['result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','client','http','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x6380,0x145));var _0x0638=function(_0x4f328e,_0x105463){_0x4f328e=_0x4f328e-0x0;var _0x4673cb=_0x6380[_0x4f328e];return _0x4673cb;};'use strict';var _=require('lodash');var util=require(_0x0638('0x0'));var moment=require(_0x0638('0x1'));var BPromise=require(_0x0638('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0638('0x3'));var db=require(_0x0638('0x4'))['db'];var utils=require(_0x0638('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0638('0x6')][_0x0638('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ee44e,_0xd873cf,_0x10204a){return new BPromise(function(_0x3f8dbf,_0x516232){return client['request'](_0x2ee44e,_0x10204a)['then'](function(_0x181992){logger[_0x0638('0x8')](_0x0638('0x9'),_0xd873cf,_0x0638('0xa'));logger[_0x0638('0xb')](_0x0638('0xc'),_0xd873cf,_0x0638('0xa'),JSON[_0x0638('0xd')](_0x181992));if(_0x181992[_0x0638('0xe')]){if(_0x181992[_0x0638('0xe')][_0x0638('0xf')]===0x1f4){logger[_0x0638('0xe')](_0x0638('0x9'),_0xd873cf,_0x181992[_0x0638('0xe')]['message']);return _0x516232(_0x181992['error']['message']);}logger['error'](_0x0638('0x9'),_0xd873cf,_0x181992[_0x0638('0xe')][_0x0638('0x10')]);return _0x3f8dbf(_0x181992['error'][_0x0638('0x10')]);}else{logger[_0x0638('0x8')](_0x0638('0x9'),_0xd873cf,_0x0638('0xa'));_0x3f8dbf(_0x181992[_0x0638('0x11')][_0x0638('0x10')]);}})[_0x0638('0x12')](function(_0x1e1a86){logger[_0x0638('0xe')]('VoiceMail,\x20%s,\x20%s',_0xd873cf,_0x1e1a86);_0x516232(_0x1e1a86);});});}
\ No newline at end of file
+var _0xb98a=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash'];(function(_0x418ad2,_0xeae93b){var _0x4f4fe5=function(_0x424e28){while(--_0x424e28){_0x418ad2['push'](_0x418ad2['shift']());}};_0x4f4fe5(++_0xeae93b);}(_0xb98a,0x158));var _0xab98=function(_0x1abfac,_0x45ae54){_0x1abfac=_0x1abfac-0x0;var _0x2f97e6=_0xb98a[_0x1abfac];return _0x2f97e6;};'use strict';var _=require(_0xab98('0x0'));var util=require(_0xab98('0x1'));var moment=require(_0xab98('0x2'));var BPromise=require(_0xab98('0x3'));var rs=require(_0xab98('0x4'));var fs=require('fs');var Redis=require(_0xab98('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xab98('0x6'));var logger=require(_0xab98('0x7'))(_0xab98('0x8'));var config=require(_0xab98('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xab98('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c4bc9,_0x38fe56,_0x479fb4){return new BPromise(function(_0xf5cced,_0x4ba101){return client[_0xab98('0xb')](_0x3c4bc9,_0x479fb4)[_0xab98('0xc')](function(_0x1c3c0a){logger[_0xab98('0xd')](_0xab98('0xe'),_0x38fe56,_0xab98('0xf'));logger[_0xab98('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x38fe56,_0xab98('0xf'),JSON[_0xab98('0x11')](_0x1c3c0a));if(_0x1c3c0a[_0xab98('0x12')]){if(_0x1c3c0a[_0xab98('0x12')][_0xab98('0x13')]===0x1f4){logger[_0xab98('0x12')]('VoiceMail,\x20%s,\x20%s',_0x38fe56,_0x1c3c0a[_0xab98('0x12')]['message']);return _0x4ba101(_0x1c3c0a[_0xab98('0x12')][_0xab98('0x14')]);}logger[_0xab98('0x12')](_0xab98('0xe'),_0x38fe56,_0x1c3c0a[_0xab98('0x12')][_0xab98('0x14')]);return _0xf5cced(_0x1c3c0a[_0xab98('0x12')][_0xab98('0x14')]);}else{logger[_0xab98('0xd')](_0xab98('0xe'),_0x38fe56,'request\x20sent');_0xf5cced(_0x1c3c0a[_0xab98('0x15')][_0xab98('0x14')]);}})[_0xab98('0x16')](function(_0x435f82){logger[_0xab98('0x12')](_0xab98('0xe'),_0x38fe56,_0x435f82);_0x4ba101(_0x435f82);});});}
\ No newline at end of file
index 946d701..9dea922 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x407d=['post','/:id','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','/:id/download'];(function(_0x5e33f6,_0x2e18e6){var _0x20cb0f=function(_0x358e5c){while(--_0x358e5c){_0x5e33f6['push'](_0x5e33f6['shift']());}};_0x20cb0f(++_0x2e18e6);}(_0x407d,0x15b));var _0xd407=function(_0x1266a8,_0x3a9126){_0x1266a8=_0x1266a8-0x0;var _0x365468=_0x407d[_0x1266a8];return _0x365468;};'use strict';var multer=require(_0xd407('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd407('0x1'));var express=require(_0xd407('0x2'));var router=express[_0xd407('0x3')]();var fs_extra=require(_0xd407('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd407('0x5'));var config=require(_0xd407('0x6'));var controller=require(_0xd407('0x7'));router[_0xd407('0x8')]('/',auth[_0xd407('0x9')](),controller[_0xd407('0xa')]);router[_0xd407('0x8')]('/:id',auth[_0xd407('0x9')](),controller[_0xd407('0xb')]);router[_0xd407('0x8')](_0xd407('0xc'),auth[_0xd407('0x9')](),controller['download']);router[_0xd407('0xd')]('/',auth[_0xd407('0x9')](),controller['create']);router['put'](_0xd407('0xe'),auth[_0xd407('0x9')](),controller['update']);router[_0xd407('0xf')](_0xd407('0xe'),auth[_0xd407('0x9')](),controller[_0xd407('0x10')]);module[_0xd407('0x11')]=router;
\ No newline at end of file
+var _0xe735=['get','isAuthenticated','index','/:id','show','/:id/download','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xc3e74b,_0x1c3983){var _0x5e1745=function(_0x1b043e){while(--_0x1b043e){_0xc3e74b['push'](_0xc3e74b['shift']());}};_0x5e1745(++_0x1c3983);}(_0xe735,0x14e));var _0x5e73=function(_0x4c4037,_0x15054b){_0x4c4037=_0x4c4037-0x0;var _0x357862=_0xe735[_0x4c4037];return _0x357862;};'use strict';var multer=require(_0x5e73('0x0'));var util=require(_0x5e73('0x1'));var path=require(_0x5e73('0x2'));var timeout=require(_0x5e73('0x3'));var express=require(_0x5e73('0x4'));var router=express[_0x5e73('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5e73('0x6'));var interaction=require(_0x5e73('0x7'));var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router[_0x5e73('0x8')]('/',auth[_0x5e73('0x9')](),controller[_0x5e73('0xa')]);router[_0x5e73('0x8')](_0x5e73('0xb'),auth[_0x5e73('0x9')](),controller[_0x5e73('0xc')]);router['get'](_0x5e73('0xd'),auth[_0x5e73('0x9')](),controller['download']);router[_0x5e73('0xe')]('/',auth[_0x5e73('0x9')](),controller[_0x5e73('0xf')]);router['put'](_0x5e73('0xb'),auth['isAuthenticated'](),controller[_0x5e73('0x10')]);router['delete'](_0x5e73('0xb'),auth[_0x5e73('0x9')](),controller[_0x5e73('0x11')]);module[_0x5e73('0x12')]=router;
\ No newline at end of file
index 1418125..83b6fa4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfa8=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL','getDataValue','INTEGER','STRING','BLOB'];(function(_0xaaecc0,_0x52c8ab){var _0x114c06=function(_0x274f25){while(--_0x274f25){_0xaaecc0['push'](_0xaaecc0['shift']());}};_0x114c06(++_0x52c8ab);}(_0xdfa8,0x10a));var _0x8dfa=function(_0x3e601c,_0x572c00){_0x3e601c=_0x3e601c-0x0;var _0x1efaac=_0xdfa8[_0x3e601c];return _0x1efaac;};'use strict';var Sequelize=require(_0x8dfa('0x0'));module['exports']={'name':{'type':Sequelize[_0x8dfa('0x1')],'get':function(_0x2eb907){return this[_0x8dfa('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x8dfa('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x8dfa('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x8dfa('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x8dfa('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x8dfa('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x8dfa('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x8dfa('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x8dfa('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x8dfa('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x8dfa('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x8dfa('0x6')](_0x8dfa('0x7'))}};
\ No newline at end of file
+var _0xaf3b=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','TIMESTAMP','literal'];(function(_0xc51bca,_0x5a682a){var _0x5d8c3e=function(_0x568820){while(--_0x568820){_0xc51bca['push'](_0xc51bca['shift']());}};_0x5d8c3e(++_0x5a682a);}(_0xaf3b,0xd3));var _0xbaf3=function(_0x5bf0aa,_0x2c2b9d){_0x5bf0aa=_0x5bf0aa-0x0;var _0x447055=_0xaf3b[_0x5bf0aa];return _0x447055;};'use strict';var Sequelize=require(_0xbaf3('0x0'));module[_0xbaf3('0x1')]={'name':{'type':Sequelize[_0xbaf3('0x2')],'get':function(_0x109d10){return this[_0xbaf3('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xbaf3('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xbaf3('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xbaf3('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0xbaf3('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xbaf3('0x5')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xbaf3('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xbaf3('0x6')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0xbaf3('0x7'),'defaultValue':Sequelize[_0xbaf3('0x8')](_0xbaf3('0x9'))}};
\ No newline at end of file
index ae2daa7..8e9f742 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bbf=['mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','set','Content-Range','update','then','destroy','index','map','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','VIRTUAL','options','count','includeAll','include','VoiceMailMessage','rows','catch','params','rawAttributes','find','create','body','recording','msg_id','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','rimraf','request-promise','moment','bluebird'];(function(_0x4696f4,_0x3597e5){var _0x5c3575=function(_0x4295e7){while(--_0x4295e7){_0x4696f4['push'](_0x4696f4['shift']());}};_0x5c3575(++_0x3597e5);}(_0x6bbf,0x1e8));var _0xf6bb=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x6bbf[_0x397cfb];return _0x15fed9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6bb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf6bb('0x1'));var moment=require(_0xf6bb('0x2'));var BPromise=require(_0xf6bb('0x3'));var Mustache=require(_0xf6bb('0x4'));var util=require(_0xf6bb('0x5'));var path=require(_0xf6bb('0x6'));var sox=require(_0xf6bb('0x7'));var csv=require(_0xf6bb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6bb('0x9'));var _=require(_0xf6bb('0xa'));var squel=require(_0xf6bb('0xb'));var crypto=require(_0xf6bb('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf6bb('0xd'));var toCsv=require(_0xf6bb('0x8'));var querystring=require(_0xf6bb('0xe'));var Papa=require(_0xf6bb('0xf'));var Redis=require(_0xf6bb('0x10'));var authService=require(_0xf6bb('0x11'));var qs=require(_0xf6bb('0x12'));var as=require(_0xf6bb('0x13'));var hardwareService=require(_0xf6bb('0x14'));var logger=require(_0xf6bb('0x15'))(_0xf6bb('0x16'));var utils=require(_0xf6bb('0x17'));var config=require(_0xf6bb('0x18'));var licenseUtil=require(_0xf6bb('0x19'));var db=require(_0xf6bb('0x1a'))['db'];function respondWithStatusCode(_0x2a70e1,_0x393b84){_0x393b84=_0x393b84||0xcc;return function(_0x5d175a){if(_0x5d175a){return _0x2a70e1[_0xf6bb('0x1b')](_0x393b84);}return _0x2a70e1['status'](_0x393b84)[_0xf6bb('0x1c')]();};}function respondWithResult(_0x3f3108,_0x570227){_0x570227=_0x570227||0xc8;return function(_0x438a02){if(_0x438a02){return _0x3f3108[_0xf6bb('0x1d')](_0x570227)[_0xf6bb('0x1e')](_0x438a02);}};}function respondWithFilteredResult(_0x158d1e,_0x5e37d4){return function(_0x43efcd){if(_0x43efcd){var _0xc9b9e0=typeof _0x5e37d4[_0xf6bb('0x1f')]===_0xf6bb('0x20')&&typeof _0x5e37d4['limit']===_0xf6bb('0x20');var _0x203d5c=_0x43efcd['count'];var _0x24067c=_0xc9b9e0?0x0:_0x5e37d4[_0xf6bb('0x1f')];var _0x27aec7=_0xc9b9e0?_0x43efcd['count']:_0x5e37d4[_0xf6bb('0x1f')]+_0x5e37d4['limit'];var _0x1319ba;if(_0x27aec7>=_0x203d5c){_0x27aec7=_0x203d5c;_0x1319ba=0xc8;}else{_0x1319ba=0xce;}_0x158d1e[_0xf6bb('0x1d')](_0x1319ba);return _0x158d1e[_0xf6bb('0x21')](_0xf6bb('0x22'),_0x24067c+'-'+_0x27aec7+'/'+_0x203d5c)[_0xf6bb('0x1e')](_0x43efcd);}return null;};}function patchUpdates(_0x1e5cf6){return function(_0x20d07c){try{jsonpatch['apply'](_0x20d07c,_0x1e5cf6,!![]);}catch(_0x515db0){return BPromise['reject'](_0x515db0);}return _0x20d07c['save']();};}function saveUpdates(_0x37ad74,_0x34baed){return function(_0x3fb12c){if(_0x3fb12c){return _0x3fb12c[_0xf6bb('0x23')](_0x37ad74)[_0xf6bb('0x24')](function(_0x2beaff){return _0x2beaff;});}return null;};}function removeEntity(_0x4ca39e,_0x1503a1){return function(_0x26f7b8){if(_0x26f7b8){return _0x26f7b8[_0xf6bb('0x25')]()[_0xf6bb('0x24')](function(){_0x4ca39e[_0xf6bb('0x1d')](0xcc)[_0xf6bb('0x1c')]();});}};}function handleEntityNotFound(_0x444de5,_0x35e650){return function(_0x675a1b){if(!_0x675a1b){_0x444de5[_0xf6bb('0x1b')](0x194);}return _0x675a1b;};}function handleError(_0x160e0c,_0x39b8f2){_0x39b8f2=_0x39b8f2||0x1f4;return function(_0x53b39a){logger['error'](_0x53b39a['stack']);if(_0x53b39a['name']){delete _0x53b39a['name'];}_0x160e0c[_0xf6bb('0x1d')](_0x39b8f2)['send'](_0x53b39a);};}exports[_0xf6bb('0x26')]=function(_0x482089,_0x5154a0){var _0x1d8de8={},_0x3701d2={},_0x3b189a={'count':0x0,'rows':[]};var _0x3f58d4=_[_0xf6bb('0x27')](db['VoiceMailMessage']['rawAttributes'],function(_0x3869ed){return{'name':_0x3869ed[_0xf6bb('0x28')],'type':_0x3869ed[_0xf6bb('0x29')][_0xf6bb('0x2a')]};});_0x3701d2[_0xf6bb('0x2b')]=_['differenceBy'](_['map'](_0x3f58d4,_0xf6bb('0x2c')),[_0xf6bb('0x2c')]);_0x3701d2[_0xf6bb('0x2d')]=_[_0xf6bb('0x2e')](_0x482089[_0xf6bb('0x2d')]);_0x3701d2[_0xf6bb('0x2f')]=_[_0xf6bb('0x30')](_0x3701d2[_0xf6bb('0x2b')],_0x3701d2[_0xf6bb('0x2d')]);_0x1d8de8[_0xf6bb('0x31')]=_[_0xf6bb('0x30')](_0x3701d2['model'],qs['fields'](_0x482089[_0xf6bb('0x2d')][_0xf6bb('0x32')]));_0x1d8de8[_0xf6bb('0x31')]=_0x1d8de8['attributes'][_0xf6bb('0x33')]?_0x1d8de8[_0xf6bb('0x31')]:_0x3701d2[_0xf6bb('0x2b')];if(!_0x482089[_0xf6bb('0x2d')][_0xf6bb('0x34')](_0xf6bb('0x35'))){_0x1d8de8['limit']=qs[_0xf6bb('0x36')](_0x482089[_0xf6bb('0x2d')][_0xf6bb('0x36')]);_0x1d8de8[_0xf6bb('0x1f')]=qs[_0xf6bb('0x1f')](_0x482089[_0xf6bb('0x2d')][_0xf6bb('0x1f')]);}_0x1d8de8[_0xf6bb('0x37')]=qs['sort'](_0x482089[_0xf6bb('0x2d')][_0xf6bb('0x38')]);_0x1d8de8['where']=qs['filters'](_[_0xf6bb('0x39')](_0x482089[_0xf6bb('0x2d')],_0x3701d2[_0xf6bb('0x2f')]),_0x3f58d4);if(_0x482089[_0xf6bb('0x2d')][_0xf6bb('0x3a')]){_0x1d8de8['where']=_[_0xf6bb('0x3b')](_0x1d8de8[_0xf6bb('0x3c')],{'$or':_['map'](_0x3f58d4,function(_0x3d5e82){if(_0x3d5e82[_0xf6bb('0x29')]!==_0xf6bb('0x3d')){var _0x2d92f6={};_0x2d92f6[_0x3d5e82['name']]={'$like':'%'+_0x482089[_0xf6bb('0x2d')][_0xf6bb('0x3a')]+'%'};return _0x2d92f6;}})});}_0x1d8de8=_['merge']({},_0x1d8de8,_0x482089[_0xf6bb('0x3e')]);var _0xb6f12e={'where':_0x1d8de8[_0xf6bb('0x3c')]};return db['VoiceMailMessage'][_0xf6bb('0x3f')](_0xb6f12e)[_0xf6bb('0x24')](function(_0x208898){_0x3b189a['count']=_0x208898;if(_0x482089['query'][_0xf6bb('0x40')]){_0x1d8de8[_0xf6bb('0x41')]=[{'all':!![]}];}return db[_0xf6bb('0x42')]['findAll'](_0x1d8de8);})['then'](function(_0x498259){_0x3b189a[_0xf6bb('0x43')]=_0x498259;return _0x3b189a;})[_0xf6bb('0x24')](respondWithFilteredResult(_0x5154a0,_0x1d8de8))[_0xf6bb('0x44')](handleError(_0x5154a0,null));};exports['show']=function(_0x16adb2,_0x4c250e){var _0x1a3362={'raw':!![],'where':{'id':_0x16adb2[_0xf6bb('0x45')]['id']}},_0x25dc6e={};_0x25dc6e['model']=_[_0xf6bb('0x2e')](db[_0xf6bb('0x42')][_0xf6bb('0x46')]);_0x25dc6e['query']=_[_0xf6bb('0x2e')](_0x16adb2[_0xf6bb('0x2d')]);_0x25dc6e['filters']=_[_0xf6bb('0x30')](_0x25dc6e[_0xf6bb('0x2b')],_0x25dc6e[_0xf6bb('0x2d')]);_0x1a3362[_0xf6bb('0x31')]=_[_0xf6bb('0x30')](_0x25dc6e['model'],qs['fields'](_0x16adb2[_0xf6bb('0x2d')][_0xf6bb('0x32')]));_0x1a3362['attributes']=_0x1a3362[_0xf6bb('0x31')]['length']?_0x1a3362[_0xf6bb('0x31')]:_0x25dc6e['model'];if(_0x16adb2[_0xf6bb('0x2d')][_0xf6bb('0x40')]){_0x1a3362[_0xf6bb('0x41')]=[{'all':!![]}];}_0x1a3362=_[_0xf6bb('0x3b')]({},_0x1a3362,_0x16adb2[_0xf6bb('0x3e')]);return db[_0xf6bb('0x42')][_0xf6bb('0x47')](_0x1a3362)[_0xf6bb('0x24')](handleEntityNotFound(_0x4c250e,null))[_0xf6bb('0x24')](respondWithResult(_0x4c250e,null))[_0xf6bb('0x44')](handleError(_0x4c250e,null));};exports[_0xf6bb('0x48')]=function(_0xafb948,_0x237274){return db[_0xf6bb('0x42')][_0xf6bb('0x48')](_0xafb948[_0xf6bb('0x49')],{})[_0xf6bb('0x24')](respondWithResult(_0x237274,0xc9))[_0xf6bb('0x44')](handleError(_0x237274,null));};exports[_0xf6bb('0x23')]=function(_0x3eb595,_0x323ea1){if(_0x3eb595[_0xf6bb('0x49')]['id']){delete _0x3eb595[_0xf6bb('0x49')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x3eb595['params']['id']}})['then'](handleEntityNotFound(_0x323ea1,null))[_0xf6bb('0x24')](saveUpdates(_0x3eb595[_0xf6bb('0x49')],null))[_0xf6bb('0x24')](respondWithResult(_0x323ea1,null))[_0xf6bb('0x44')](handleError(_0x323ea1,null));};exports[_0xf6bb('0x25')]=function(_0x5ae517,_0x2f2d52){return db['VoiceMailMessage'][_0xf6bb('0x47')]({'where':{'id':_0x5ae517[_0xf6bb('0x45')]['id']}})['then'](handleEntityNotFound(_0x2f2d52,null))['then'](removeEntity(_0x2f2d52,null))[_0xf6bb('0x44')](handleError(_0x2f2d52,null));};exports['download']=function(_0x558bcf,_0x45e208,_0x199e20){return db[_0xf6bb('0x42')][_0xf6bb('0x47')]({'where':{'id':_0x558bcf[_0xf6bb('0x45')]['id']},'attributes':['id',_0xf6bb('0x4a'),_0xf6bb('0x4b')]})['then'](handleEntityNotFound(_0x45e208,null))['then'](function(_0x34e2c8){if(_0x34e2c8){if(!_0x34e2c8[_0xf6bb('0x4a')]){throw new db['Sequelize']['ValidationError'](_0xf6bb('0x4c'));}var _0x5702c7={'Content-Type':_0xf6bb('0x4d'),'Content-Disposition':_0xf6bb('0x4e')};if(_0x34e2c8[_0xf6bb('0x4b')]){_0x5702c7[_0xf6bb('0x4f')]=_0xf6bb('0x50')+_0x34e2c8['msg_id']+_0xf6bb('0x51');}_0x45e208[_0xf6bb('0x21')](_0x5702c7);return _0x45e208['send'](new Buffer(_0x34e2c8['recording']));}})['catch'](handleError(_0x45e208,null));};
\ No newline at end of file
+var _0xaf61=['limit','set','Content-Range','apply','update','then','error','name','send','index','map','VoiceMailMessage','rawAttributes','type','key','model','differenceBy','keys','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','options','find','create','body','destroy','download','recording','msg_id','ValidationError','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count'];(function(_0xc55559,_0x1cac3f){var _0x48d4db=function(_0x16ae44){while(--_0x16ae44){_0xc55559['push'](_0xc55559['shift']());}};_0x48d4db(++_0x1cac3f);}(_0xaf61,0x11c));var _0x1af6=function(_0x3d2678,_0x265ad1){_0x3d2678=_0x3d2678-0x0;var _0x4ba2a7=_0xaf61[_0x3d2678];return _0x4ba2a7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1af6('0x0'));var jsonpatch=require(_0x1af6('0x1'));var rp=require('request-promise');var moment=require(_0x1af6('0x2'));var BPromise=require(_0x1af6('0x3'));var Mustache=require('mustache');var util=require(_0x1af6('0x4'));var path=require(_0x1af6('0x5'));var sox=require('sox');var csv=require(_0x1af6('0x6'));var ejs=require(_0x1af6('0x7'));var fs=require('fs');var fs_extra=require(_0x1af6('0x8'));var _=require(_0x1af6('0x9'));var squel=require('squel');var crypto=require(_0x1af6('0xa'));var jsforce=require(_0x1af6('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1af6('0x6'));var querystring=require(_0x1af6('0xc'));var Papa=require(_0x1af6('0xd'));var Redis=require(_0x1af6('0xe'));var authService=require(_0x1af6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x1af6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1af6('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x1af6('0x12'));var licenseUtil=require(_0x1af6('0x13'));var db=require(_0x1af6('0x14'))['db'];function respondWithStatusCode(_0x141c43,_0x2cf054){_0x2cf054=_0x2cf054||0xcc;return function(_0xc943f1){if(_0xc943f1){return _0x141c43[_0x1af6('0x15')](_0x2cf054);}return _0x141c43['status'](_0x2cf054)[_0x1af6('0x16')]();};}function respondWithResult(_0x1073b1,_0x1f8208){_0x1f8208=_0x1f8208||0xc8;return function(_0x70cf25){if(_0x70cf25){return _0x1073b1[_0x1af6('0x17')](_0x1f8208)[_0x1af6('0x18')](_0x70cf25);}};}function respondWithFilteredResult(_0x177514,_0x11e111){return function(_0x42ea32){if(_0x42ea32){var _0x25a70d=typeof _0x11e111[_0x1af6('0x19')]===_0x1af6('0x1a')&&typeof _0x11e111['limit']==='undefined';var _0x2d7150=_0x42ea32[_0x1af6('0x1b')];var _0x15889b=_0x25a70d?0x0:_0x11e111['offset'];var _0x588ba7=_0x25a70d?_0x42ea32[_0x1af6('0x1b')]:_0x11e111[_0x1af6('0x19')]+_0x11e111[_0x1af6('0x1c')];var _0x39bbfb;if(_0x588ba7>=_0x2d7150){_0x588ba7=_0x2d7150;_0x39bbfb=0xc8;}else{_0x39bbfb=0xce;}_0x177514['status'](_0x39bbfb);return _0x177514[_0x1af6('0x1d')](_0x1af6('0x1e'),_0x15889b+'-'+_0x588ba7+'/'+_0x2d7150)[_0x1af6('0x18')](_0x42ea32);}return null;};}function patchUpdates(_0x3d161a){return function(_0x390db2){try{jsonpatch[_0x1af6('0x1f')](_0x390db2,_0x3d161a,!![]);}catch(_0x52b3d7){return BPromise['reject'](_0x52b3d7);}return _0x390db2['save']();};}function saveUpdates(_0x34b580,_0xdba7c4){return function(_0x15809c){if(_0x15809c){return _0x15809c[_0x1af6('0x20')](_0x34b580)[_0x1af6('0x21')](function(_0x351fb2){return _0x351fb2;});}return null;};}function removeEntity(_0x4d075a,_0x2ceead){return function(_0x4689c0){if(_0x4689c0){return _0x4689c0['destroy']()['then'](function(){_0x4d075a[_0x1af6('0x17')](0xcc)[_0x1af6('0x16')]();});}};}function handleEntityNotFound(_0x1654b2,_0x35fd7b){return function(_0xb0f197){if(!_0xb0f197){_0x1654b2[_0x1af6('0x15')](0x194);}return _0xb0f197;};}function handleError(_0xb90979,_0x3916f4){_0x3916f4=_0x3916f4||0x1f4;return function(_0x1d7be6){logger[_0x1af6('0x22')](_0x1d7be6['stack']);if(_0x1d7be6['name']){delete _0x1d7be6[_0x1af6('0x23')];}_0xb90979[_0x1af6('0x17')](_0x3916f4)[_0x1af6('0x24')](_0x1d7be6);};}exports[_0x1af6('0x25')]=function(_0xe69861,_0x33306a){var _0xf1c832={},_0x22efe1={},_0x2f1098={'count':0x0,'rows':[]};var _0x2c2000=_[_0x1af6('0x26')](db[_0x1af6('0x27')][_0x1af6('0x28')],function(_0x2ca855){return{'name':_0x2ca855['fieldName'],'type':_0x2ca855[_0x1af6('0x29')][_0x1af6('0x2a')]};});_0x22efe1[_0x1af6('0x2b')]=_[_0x1af6('0x2c')](_[_0x1af6('0x26')](_0x2c2000,'name'),['name']);_0x22efe1['query']=_[_0x1af6('0x2d')](_0xe69861[_0x1af6('0x2e')]);_0x22efe1[_0x1af6('0x2f')]=_['intersection'](_0x22efe1[_0x1af6('0x2b')],_0x22efe1['query']);_0xf1c832[_0x1af6('0x30')]=_[_0x1af6('0x31')](_0x22efe1[_0x1af6('0x2b')],qs['fields'](_0xe69861[_0x1af6('0x2e')]['fields']));_0xf1c832[_0x1af6('0x30')]=_0xf1c832['attributes'][_0x1af6('0x32')]?_0xf1c832[_0x1af6('0x30')]:_0x22efe1[_0x1af6('0x2b')];if(!_0xe69861[_0x1af6('0x2e')][_0x1af6('0x33')](_0x1af6('0x34'))){_0xf1c832[_0x1af6('0x1c')]=qs['limit'](_0xe69861[_0x1af6('0x2e')][_0x1af6('0x1c')]);_0xf1c832['offset']=qs[_0x1af6('0x19')](_0xe69861['query'][_0x1af6('0x19')]);}_0xf1c832[_0x1af6('0x35')]=qs['sort'](_0xe69861[_0x1af6('0x2e')]['sort']);_0xf1c832['where']=qs[_0x1af6('0x2f')](_['pick'](_0xe69861[_0x1af6('0x2e')],_0x22efe1['filters']),_0x2c2000);if(_0xe69861[_0x1af6('0x2e')]['filter']){_0xf1c832[_0x1af6('0x36')]=_[_0x1af6('0x37')](_0xf1c832[_0x1af6('0x36')],{'$or':_[_0x1af6('0x26')](_0x2c2000,function(_0x11ddb5){if(_0x11ddb5['type']!==_0x1af6('0x38')){var _0x526af2={};_0x526af2[_0x11ddb5[_0x1af6('0x23')]]={'$like':'%'+_0xe69861['query']['filter']+'%'};return _0x526af2;}})});}_0xf1c832=_['merge']({},_0xf1c832,_0xe69861['options']);var _0x2020b6={'where':_0xf1c832[_0x1af6('0x36')]};return db[_0x1af6('0x27')]['count'](_0x2020b6)[_0x1af6('0x21')](function(_0x129067){_0x2f1098[_0x1af6('0x1b')]=_0x129067;if(_0xe69861[_0x1af6('0x2e')][_0x1af6('0x39')]){_0xf1c832[_0x1af6('0x3a')]=[{'all':!![]}];}return db[_0x1af6('0x27')][_0x1af6('0x3b')](_0xf1c832);})[_0x1af6('0x21')](function(_0x5e7d85){_0x2f1098[_0x1af6('0x3c')]=_0x5e7d85;return _0x2f1098;})[_0x1af6('0x21')](respondWithFilteredResult(_0x33306a,_0xf1c832))[_0x1af6('0x3d')](handleError(_0x33306a,null));};exports[_0x1af6('0x3e')]=function(_0xa0ba73,_0x23108f){var _0x56d2aa={'raw':!![],'where':{'id':_0xa0ba73[_0x1af6('0x3f')]['id']}},_0x3f061d={};_0x3f061d[_0x1af6('0x2b')]=_[_0x1af6('0x2d')](db['VoiceMailMessage'][_0x1af6('0x28')]);_0x3f061d['query']=_[_0x1af6('0x2d')](_0xa0ba73[_0x1af6('0x2e')]);_0x3f061d['filters']=_[_0x1af6('0x31')](_0x3f061d['model'],_0x3f061d[_0x1af6('0x2e')]);_0x56d2aa[_0x1af6('0x30')]=_[_0x1af6('0x31')](_0x3f061d[_0x1af6('0x2b')],qs[_0x1af6('0x40')](_0xa0ba73[_0x1af6('0x2e')]['fields']));_0x56d2aa[_0x1af6('0x30')]=_0x56d2aa[_0x1af6('0x30')][_0x1af6('0x32')]?_0x56d2aa[_0x1af6('0x30')]:_0x3f061d[_0x1af6('0x2b')];if(_0xa0ba73[_0x1af6('0x2e')][_0x1af6('0x39')]){_0x56d2aa[_0x1af6('0x3a')]=[{'all':!![]}];}_0x56d2aa=_[_0x1af6('0x37')]({},_0x56d2aa,_0xa0ba73[_0x1af6('0x41')]);return db[_0x1af6('0x27')][_0x1af6('0x42')](_0x56d2aa)[_0x1af6('0x21')](handleEntityNotFound(_0x23108f,null))['then'](respondWithResult(_0x23108f,null))[_0x1af6('0x3d')](handleError(_0x23108f,null));};exports[_0x1af6('0x43')]=function(_0x519b70,_0xe555f){return db['VoiceMailMessage']['create'](_0x519b70['body'],{})[_0x1af6('0x21')](respondWithResult(_0xe555f,0xc9))[_0x1af6('0x3d')](handleError(_0xe555f,null));};exports[_0x1af6('0x20')]=function(_0x500ab1,_0x55db62){if(_0x500ab1[_0x1af6('0x44')]['id']){delete _0x500ab1[_0x1af6('0x44')]['id'];}return db[_0x1af6('0x27')]['find']({'where':{'id':_0x500ab1[_0x1af6('0x3f')]['id']}})[_0x1af6('0x21')](handleEntityNotFound(_0x55db62,null))[_0x1af6('0x21')](saveUpdates(_0x500ab1[_0x1af6('0x44')],null))['then'](respondWithResult(_0x55db62,null))[_0x1af6('0x3d')](handleError(_0x55db62,null));};exports[_0x1af6('0x45')]=function(_0x951c0b,_0x4a722c){return db['VoiceMailMessage'][_0x1af6('0x42')]({'where':{'id':_0x951c0b['params']['id']}})[_0x1af6('0x21')](handleEntityNotFound(_0x4a722c,null))[_0x1af6('0x21')](removeEntity(_0x4a722c,null))[_0x1af6('0x3d')](handleError(_0x4a722c,null));};exports[_0x1af6('0x46')]=function(_0x4f387a,_0x3e2fe2,_0x2d274a){return db[_0x1af6('0x27')][_0x1af6('0x42')]({'where':{'id':_0x4f387a['params']['id']},'attributes':['id',_0x1af6('0x47'),_0x1af6('0x48')]})[_0x1af6('0x21')](handleEntityNotFound(_0x3e2fe2,null))[_0x1af6('0x21')](function(_0x21dce2){if(_0x21dce2){if(!_0x21dce2[_0x1af6('0x47')]){throw new db['Sequelize'][(_0x1af6('0x49'))]('VoiceMailMessage\x20not\x20found');}var _0x18cd16={'Content-Type':_0x1af6('0x4a'),'Content-Disposition':_0x1af6('0x4b')};if(_0x21dce2['msg_id']){_0x18cd16[_0x1af6('0x4c')]=_0x1af6('0x4d')+_0x21dce2[_0x1af6('0x48')]+'.wav\x22';}_0x3e2fe2['set'](_0x18cd16);return _0x3e2fe2[_0x1af6('0x24')](new Buffer(_0x21dce2['recording']));}})[_0x1af6('0x3d')](handleError(_0x3e2fe2,null));};
\ No newline at end of file
index 0e19121..45eca6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb971=['define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./voiceMailMessage.attributes'];(function(_0x38d1c4,_0x51a1dc){var _0x4d095c=function(_0x1aec47){while(--_0x1aec47){_0x38d1c4['push'](_0x38d1c4['shift']());}};_0x4d095c(++_0x51a1dc);}(_0xb971,0x93));var _0x1b97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb971[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1b97('0x0'));var util=require(_0x1b97('0x1'));var logger=require(_0x1b97('0x2'))(_0x1b97('0x3'));var moment=require(_0x1b97('0x4'));var BPromise=require(_0x1b97('0x5'));var rp=require(_0x1b97('0x6'));var fs=require('fs');var path=require(_0x1b97('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1b97('0x8'));module['exports']=function(_0x551e66,_0x27093f){return _0x551e66[_0x1b97('0x9')](_0x1b97('0xa'),attributes,{'tableName':_0x1b97('0xb'),'paranoid':![],'indexes':[{'name':_0x1b97('0xc'),'fields':[_0x1b97('0xc')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x4cb7=['path','rimraf','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','lodash','../../config/logger','api','moment','bluebird'];(function(_0xdf3b94,_0x1e2688){var _0x4c8d00=function(_0x112ec8){while(--_0x112ec8){_0xdf3b94['push'](_0xdf3b94['shift']());}};_0x4c8d00(++_0x1e2688);}(_0x4cb7,0x193));var _0x74cb=function(_0x8f548,_0x1ced6d){_0x8f548=_0x8f548-0x0;var _0x570016=_0x4cb7[_0x8f548];return _0x570016;};'use strict';var _=require(_0x74cb('0x0'));var util=require('util');var logger=require(_0x74cb('0x1'))(_0x74cb('0x2'));var moment=require(_0x74cb('0x3'));var BPromise=require(_0x74cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x74cb('0x5'));var rimraf=require(_0x74cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x74cb('0x7'));module[_0x74cb('0x8')]=function(_0x59fd12,_0x14d893){return _0x59fd12[_0x74cb('0x9')](_0x74cb('0xa'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x74cb('0xb'),'fields':[_0x74cb('0xb')]}],'timestamps':![]});};
\ No newline at end of file
index aff903e..dd20d32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9387=['VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2d13b6,_0x376b8e){var _0x31cfe7=function(_0x7d087f){while(--_0x7d087f){_0x2d13b6['push'](_0x2d13b6['shift']());}};_0x31cfe7(++_0x376b8e);}(_0x9387,0x1ed));var _0x7938=function(_0x1890fe,_0x2ac03f){_0x1890fe=_0x1890fe-0x0;var _0x3baa40=_0x9387[_0x1890fe];return _0x3baa40;};'use strict';var _=require('lodash');var util=require(_0x7938('0x0'));var moment=require(_0x7938('0x1'));var BPromise=require('bluebird');var rs=require(_0x7938('0x2'));var fs=require('fs');var Redis=require(_0x7938('0x3'));var db=require(_0x7938('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7938('0x5'))('rpc');var config=require(_0x7938('0x6'));var jayson=require(_0x7938('0x7'));var client=jayson[_0x7938('0x8')][_0x7938('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41a17a,_0x38ded2,_0x3859d9){return new BPromise(function(_0x54bdc7,_0x27c797){return client[_0x7938('0xa')](_0x41a17a,_0x3859d9)[_0x7938('0xb')](function(_0x565b3c){logger[_0x7938('0xc')](_0x7938('0xd'),_0x38ded2,_0x7938('0xe'));logger['debug'](_0x7938('0xf'),_0x38ded2,_0x7938('0xe'),JSON[_0x7938('0x10')](_0x565b3c));if(_0x565b3c['error']){if(_0x565b3c[_0x7938('0x11')][_0x7938('0x12')]===0x1f4){logger[_0x7938('0x11')](_0x7938('0xd'),_0x38ded2,_0x565b3c[_0x7938('0x11')]['message']);return _0x27c797(_0x565b3c['error'][_0x7938('0x13')]);}logger[_0x7938('0x11')](_0x7938('0xd'),_0x38ded2,_0x565b3c[_0x7938('0x11')][_0x7938('0x13')]);return _0x54bdc7(_0x565b3c[_0x7938('0x11')][_0x7938('0x13')]);}else{logger[_0x7938('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x38ded2,_0x7938('0xe'));_0x54bdc7(_0x565b3c[_0x7938('0x14')][_0x7938('0x13')]);}})[_0x7938('0x15')](function(_0xacdd4c){logger[_0x7938('0x11')](_0x7938('0xd'),_0x38ded2,_0xacdd4c);_0x27c797(_0xacdd4c);});});}
\ No newline at end of file
+var _0xcfce=['then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xcfce,0x1c3));var _0xecfc=function(_0x2b6e53,_0x4ed0d2){_0x2b6e53=_0x2b6e53-0x0;var _0x35bab1=_0xcfce[_0x2b6e53];return _0x35bab1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xecfc('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xecfc('0x1'));var db=require(_0xecfc('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xecfc('0x3'));var config=require(_0xecfc('0x4'));var jayson=require(_0xecfc('0x5'));var client=jayson[_0xecfc('0x6')][_0xecfc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x45cd2c,_0x412094,_0x5dbfab){return new BPromise(function(_0x132fe9,_0x1526aa){return client[_0xecfc('0x8')](_0x45cd2c,_0x5dbfab)[_0xecfc('0x9')](function(_0x3d5e3e){logger[_0xecfc('0xa')](_0xecfc('0xb'),_0x412094,_0xecfc('0xc'));logger[_0xecfc('0xd')](_0xecfc('0xe'),_0x412094,_0xecfc('0xc'),JSON[_0xecfc('0xf')](_0x3d5e3e));if(_0x3d5e3e[_0xecfc('0x10')]){if(_0x3d5e3e['error'][_0xecfc('0x11')]===0x1f4){logger[_0xecfc('0x10')](_0xecfc('0xb'),_0x412094,_0x3d5e3e[_0xecfc('0x10')][_0xecfc('0x12')]);return _0x1526aa(_0x3d5e3e[_0xecfc('0x10')][_0xecfc('0x12')]);}logger['error'](_0xecfc('0xb'),_0x412094,_0x3d5e3e[_0xecfc('0x10')]['message']);return _0x132fe9(_0x3d5e3e[_0xecfc('0x10')][_0xecfc('0x12')]);}else{logger[_0xecfc('0xa')]('VoiceMailMessage,\x20%s,\x20%s',_0x412094,_0xecfc('0xc'));_0x132fe9(_0x3d5e3e[_0xecfc('0x13')][_0xecfc('0x12')]);}})['catch'](function(_0x5ec14c){logger['error'](_0xecfc('0xb'),_0x412094,_0x5ec14c);_0x1526aa(_0x5ec14c);});});}
\ No newline at end of file
index 25646d8..365c20e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36a1=['../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','create','addSound','update','delete','/:id/sounds/:id2','removeSound','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0x36a1,0x145));var _0x136a=function(_0xd9f52e,_0x1b179b){_0xd9f52e=_0xd9f52e-0x0;var _0x235e37=_0x36a1[_0xd9f52e];return _0x235e37;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x136a('0x0'));var timeout=require(_0x136a('0x1'));var express=require('express');var router=express[_0x136a('0x2')]();var fs_extra=require(_0x136a('0x3'));var auth=require(_0x136a('0x4'));var interaction=require(_0x136a('0x5'));var config=require('../../config/environment');var controller=require(_0x136a('0x6'));router[_0x136a('0x7')]('/',auth[_0x136a('0x8')](),controller[_0x136a('0x9')]);router['get'](_0x136a('0xa'),auth['isAuthenticated'](),controller[_0x136a('0xb')]);router[_0x136a('0x7')](_0x136a('0xc'),auth['isAuthenticated'](),controller[_0x136a('0xd')]);router[_0x136a('0xe')]('/',auth['isAuthenticated'](),controller[_0x136a('0xf')]);router['post'](_0x136a('0xc'),auth[_0x136a('0x8')](),controller[_0x136a('0x10')]);router['put']('/:id',auth[_0x136a('0x8')](),controller[_0x136a('0x11')]);router[_0x136a('0x12')](_0x136a('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0x136a('0x12')](_0x136a('0x13'),auth['isAuthenticated'](),controller[_0x136a('0x14')]);module[_0x136a('0x15')]=router;
\ No newline at end of file
+var _0xd797=['get','isAuthenticated','/:id','/:id/sounds','getSounds','post','create','addSound','put','update','delete','destroy','removeSound','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceMusicOnHold.controller'];(function(_0x47409a,_0x1e4537){var _0x3192bc=function(_0x189244){while(--_0x189244){_0x47409a['push'](_0x47409a['shift']());}};_0x3192bc(++_0x1e4537);}(_0xd797,0x173));var _0x7d79=function(_0x1d52d3,_0x2a0df0){_0x1d52d3=_0x1d52d3-0x0;var _0x1ad74b=_0xd797[_0x1d52d3];return _0x1ad74b;};'use strict';var multer=require('multer');var util=require(_0x7d79('0x0'));var path=require(_0x7d79('0x1'));var timeout=require(_0x7d79('0x2'));var express=require('express');var router=express[_0x7d79('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7d79('0x4'));var interaction=require(_0x7d79('0x5'));var config=require('../../config/environment');var controller=require(_0x7d79('0x6'));router[_0x7d79('0x7')]('/',auth[_0x7d79('0x8')](),controller['index']);router['get'](_0x7d79('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7d79('0xa'),auth[_0x7d79('0x8')](),controller[_0x7d79('0xb')]);router[_0x7d79('0xc')]('/',auth[_0x7d79('0x8')](),controller[_0x7d79('0xd')]);router['post'](_0x7d79('0xa'),auth['isAuthenticated'](),controller[_0x7d79('0xe')]);router[_0x7d79('0xf')](_0x7d79('0x9'),auth[_0x7d79('0x8')](),controller[_0x7d79('0x10')]);router[_0x7d79('0x11')]('/:id',auth[_0x7d79('0x8')](),controller[_0x7d79('0x12')]);router['delete']('/:id/sounds/:id2',auth['isAuthenticated'](),controller[_0x7d79('0x13')]);module[_0x7d79('0x14')]=router;
\ No newline at end of file
index 02ad487..4843bbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1e5=['files','mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','STRING','name','ENUM','custom'];(function(_0x2026a5,_0x58738e){var _0x1be5d0=function(_0x28edfd){while(--_0x28edfd){_0x2026a5['push'](_0x2026a5['shift']());}};_0x1be5d0(++_0x58738e);}(_0xa1e5,0x134));var _0x5a1e=function(_0x5e0196,_0x5600fa){_0x5e0196=_0x5e0196-0x0;var _0x4e2a55=_0xa1e5[_0x5e0196];return _0x4e2a55;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5a1e('0x0')],'allowNull':![],'unique':_0x5a1e('0x1')},'mode':{'type':Sequelize[_0x5a1e('0x2')](_0x5a1e('0x3'),_0x5a1e('0x4'),_0x5a1e('0x5'),_0x5a1e('0x6'),_0x5a1e('0x7'),_0x5a1e('0x8')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0x5a1e('0x0')],'allowNull':!![]},'application':{'type':Sequelize[_0x5a1e('0x0')],'allowNull':!![]},'digit':{'type':Sequelize[_0x5a1e('0x0')],'allowNull':!![]},'sort':{'type':Sequelize[_0x5a1e('0x0')],'allowNull':!![],'defaultValue':_0x5a1e('0x9')},'format':{'type':Sequelize[_0x5a1e('0x0')],'allowNull':!![]},'stamp':{'type':_0x5a1e('0xa')},'defaultEntry':{'type':Sequelize[_0x5a1e('0xb')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x84ea=['ENUM','custom','files','mp3nb','quietmp3','mp3','alpha','TIMESTAMP','sequelize','STRING'];(function(_0xcfeda9,_0xd418ae){var _0x4826c7=function(_0x45dc9d){while(--_0x45dc9d){_0xcfeda9['push'](_0xcfeda9['shift']());}};_0x4826c7(++_0xd418ae);}(_0x84ea,0xd0));var _0xa84e=function(_0x5b4a1b,_0x2bea1b){_0x5b4a1b=_0x5b4a1b-0x0;var _0x1d9475=_0x84ea[_0x5b4a1b];return _0x1d9475;};'use strict';var Sequelize=require(_0xa84e('0x0'));module['exports']={'name':{'type':Sequelize[_0xa84e('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xa84e('0x2')](_0xa84e('0x3'),_0xa84e('0x4'),_0xa84e('0x5'),'quietmp3nb',_0xa84e('0x6'),_0xa84e('0x7')),'allowNull':!![],'defaultValue':_0xa84e('0x4')},'directory':{'type':Sequelize[_0xa84e('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0xa84e('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xa84e('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xa84e('0x1')],'allowNull':!![],'defaultValue':_0xa84e('0x8')},'format':{'type':Sequelize[_0xa84e('0x1')],'allowNull':!![]},'stamp':{'type':_0xa84e('0x9')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
index f9e2630..af8eb97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbec2=['0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','findOne','save_name','converted_format','root','server/files/sounds/converted','%s.%s','extname','server/files/moh','symlinkSync','removeSound','id2','Sound','createdAt','message','pick','getSounds','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','get','MusicOnHolds','UserProfileResource','stack','name','send','index','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','VoiceMusicOnHold','findAll','rows','catch','params','rawAttributes','length','include','find','update','body','transaction','files','join','create','mkdirSync','directory'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xbec2,0x93));var _0x2bec=function(_0x57637f,_0x2ac1fc){_0x57637f=_0x57637f-0x0;var _0xb4b977=_0xbec2[_0x57637f];return _0xb4b977;};'use strict';var emlformat=require(_0x2bec('0x0'));var rimraf=require(_0x2bec('0x1'));var zipdir=require(_0x2bec('0x2'));var jsonpatch=require(_0x2bec('0x3'));var rp=require(_0x2bec('0x4'));var moment=require(_0x2bec('0x5'));var BPromise=require(_0x2bec('0x6'));var Mustache=require(_0x2bec('0x7'));var util=require(_0x2bec('0x8'));var path=require(_0x2bec('0x9'));var sox=require(_0x2bec('0xa'));var csv=require(_0x2bec('0xb'));var ejs=require(_0x2bec('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2bec('0xd'));var squel=require('squel');var crypto=require(_0x2bec('0xe'));var jsforce=require(_0x2bec('0xf'));var deskjs=require(_0x2bec('0x10'));var toCsv=require(_0x2bec('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2bec('0x11'));var authService=require(_0x2bec('0x12'));var qs=require(_0x2bec('0x13'));var as=require(_0x2bec('0x14'));var hardwareService=require(_0x2bec('0x15'));var logger=require(_0x2bec('0x16'))(_0x2bec('0x17'));var utils=require(_0x2bec('0x18'));var config=require(_0x2bec('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x2bec('0x1a'))['db'];function respondWithStatusCode(_0x2bc3ec,_0x3080e2){_0x3080e2=_0x3080e2||0xcc;return function(_0x584683){if(_0x584683){return _0x2bc3ec[_0x2bec('0x1b')](_0x3080e2);}return _0x2bc3ec[_0x2bec('0x1c')](_0x3080e2)[_0x2bec('0x1d')]();};}function respondWithResult(_0x1b9cc1,_0x299636){_0x299636=_0x299636||0xc8;return function(_0x474502){if(_0x474502){return _0x1b9cc1[_0x2bec('0x1c')](_0x299636)[_0x2bec('0x1e')](_0x474502);}};}function respondWithFilteredResult(_0xd4f076,_0x4666a9){return function(_0x3f1c1f){if(_0x3f1c1f){var _0x4851a3=typeof _0x4666a9[_0x2bec('0x1f')]===_0x2bec('0x20')&&typeof _0x4666a9[_0x2bec('0x21')]==='undefined';var _0x2f1b88=_0x3f1c1f['count'];var _0xa4ff6e=_0x4851a3?0x0:_0x4666a9[_0x2bec('0x1f')];var _0x1f0cdd=_0x4851a3?_0x3f1c1f[_0x2bec('0x22')]:_0x4666a9['offset']+_0x4666a9[_0x2bec('0x21')];var _0x4df44b;if(_0x1f0cdd>=_0x2f1b88){_0x1f0cdd=_0x2f1b88;_0x4df44b=0xc8;}else{_0x4df44b=0xce;}_0xd4f076[_0x2bec('0x1c')](_0x4df44b);return _0xd4f076['set'](_0x2bec('0x23'),_0xa4ff6e+'-'+_0x1f0cdd+'/'+_0x2f1b88)['json'](_0x3f1c1f);}return null;};}function patchUpdates(_0x3ecac0){return function(_0x3f2e4a){try{jsonpatch[_0x2bec('0x24')](_0x3f2e4a,_0x3ecac0,!![]);}catch(_0x3e434b){return BPromise[_0x2bec('0x25')](_0x3e434b);}return _0x3f2e4a['save']();};}function saveUpdates(_0x3e1e0c,_0x160613){return function(_0x1c864a){if(_0x1c864a){return _0x1c864a['update'](_0x3e1e0c)[_0x2bec('0x26')](function(_0x4a3083){return _0x4a3083;});}return null;};}function removeEntity(_0xbe9aad,_0x137cb9){return function(_0x186c6e){if(_0x186c6e){return _0x186c6e[_0x2bec('0x27')]()[_0x2bec('0x26')](function(){var _0x40461a=_0x186c6e[_0x2bec('0x28')]({'plain':!![]});var _0x15723e=_0x2bec('0x29');return db[_0x2bec('0x2a')][_0x2bec('0x27')]({'where':{'type':_0x15723e,'resourceId':_0x40461a['id']}})[_0x2bec('0x26')](function(){return _0x186c6e;});})[_0x2bec('0x26')](function(){_0xbe9aad[_0x2bec('0x1c')](0xcc)[_0x2bec('0x1d')]();});}};}function handleEntityNotFound(_0x5941b4,_0xb96d06){return function(_0x24e70b){if(!_0x24e70b){_0x5941b4[_0x2bec('0x1b')](0x194);}return _0x24e70b;};}function handleError(_0x36f29b,_0xec47ee){_0xec47ee=_0xec47ee||0x1f4;return function(_0x3ab40d){logger['error'](_0x3ab40d[_0x2bec('0x2b')]);if(_0x3ab40d['name']){delete _0x3ab40d[_0x2bec('0x2c')];}_0x36f29b[_0x2bec('0x1c')](_0xec47ee)[_0x2bec('0x2d')](_0x3ab40d);};}exports[_0x2bec('0x2e')]=function(_0x28096d,_0x4d863f){var _0x4d221e={},_0x1d6c48={},_0x453380={'count':0x0,'rows':[]};var _0x43ff8a=_['map'](db['VoiceMusicOnHold']['rawAttributes'],function(_0x979cb0){return{'name':_0x979cb0['fieldName'],'type':_0x979cb0[_0x2bec('0x2f')][_0x2bec('0x30')]};});_0x1d6c48[_0x2bec('0x31')]=_[_0x2bec('0x32')](_0x43ff8a,_0x2bec('0x2c'));_0x1d6c48[_0x2bec('0x33')]=_[_0x2bec('0x34')](_0x28096d[_0x2bec('0x33')]);_0x1d6c48['filters']=_[_0x2bec('0x35')](_0x1d6c48['model'],_0x1d6c48[_0x2bec('0x33')]);_0x4d221e[_0x2bec('0x36')]=_['intersection'](_0x1d6c48[_0x2bec('0x31')],qs[_0x2bec('0x37')](_0x28096d['query'][_0x2bec('0x37')]));_0x4d221e[_0x2bec('0x36')]=_0x4d221e[_0x2bec('0x36')]['length']?_0x4d221e[_0x2bec('0x36')]:_0x1d6c48[_0x2bec('0x31')];if(!_0x28096d[_0x2bec('0x33')][_0x2bec('0x38')]('nolimit')){_0x4d221e[_0x2bec('0x21')]=qs[_0x2bec('0x21')](_0x28096d['query'][_0x2bec('0x21')]);_0x4d221e[_0x2bec('0x1f')]=qs[_0x2bec('0x1f')](_0x28096d[_0x2bec('0x33')][_0x2bec('0x1f')]);}_0x4d221e[_0x2bec('0x39')]=qs[_0x2bec('0x3a')](_0x28096d[_0x2bec('0x33')][_0x2bec('0x3a')]);delete _0x28096d[_0x2bec('0x33')][_0x2bec('0x3a')];_0x4d221e[_0x2bec('0x3b')]=qs[_0x2bec('0x3c')](_['pick'](_0x28096d[_0x2bec('0x33')],_0x1d6c48[_0x2bec('0x3c')]),_0x43ff8a);if(_0x28096d['query']['filter']){_0x4d221e[_0x2bec('0x3b')]=_[_0x2bec('0x3d')](_0x4d221e['where'],{'$or':_['map'](_0x43ff8a,function(_0x51ecf6){if(_0x51ecf6[_0x2bec('0x2f')]!==_0x2bec('0x3e')){var _0x4795a6={};_0x4795a6[_0x51ecf6[_0x2bec('0x2c')]]={'$like':'%'+_0x28096d['query'][_0x2bec('0x3f')]+'%'};return _0x4795a6;}})});}_0x4d221e=_[_0x2bec('0x3d')]({},_0x4d221e,_0x28096d[_0x2bec('0x40')]);var _0x1c07ec={'where':_0x4d221e[_0x2bec('0x3b')]};return db['VoiceMusicOnHold'][_0x2bec('0x22')](_0x1c07ec)['then'](function(_0xba0c36){_0x453380['count']=_0xba0c36;if(_0x28096d[_0x2bec('0x33')][_0x2bec('0x41')]){_0x4d221e['include']=[{'all':!![]}];}return db[_0x2bec('0x42')][_0x2bec('0x43')](_0x4d221e);})[_0x2bec('0x26')](function(_0x2e60b8){_0x453380[_0x2bec('0x44')]=_0x2e60b8;return _0x453380;})[_0x2bec('0x26')](respondWithFilteredResult(_0x4d863f,_0x4d221e))[_0x2bec('0x45')](handleError(_0x4d863f,null));};exports['show']=function(_0x43d971,_0xbec26){var _0x44ccbc={'raw':![],'where':{'id':_0x43d971[_0x2bec('0x46')]['id']}},_0x3c6473={};_0x3c6473[_0x2bec('0x31')]=_[_0x2bec('0x34')](db[_0x2bec('0x42')][_0x2bec('0x47')]);_0x3c6473[_0x2bec('0x33')]=_[_0x2bec('0x34')](_0x43d971[_0x2bec('0x33')]);_0x3c6473[_0x2bec('0x3c')]=_['intersection'](_0x3c6473[_0x2bec('0x31')],_0x3c6473['query']);_0x44ccbc[_0x2bec('0x36')]=_['intersection'](_0x3c6473['model'],qs[_0x2bec('0x37')](_0x43d971[_0x2bec('0x33')][_0x2bec('0x37')]));_0x44ccbc[_0x2bec('0x36')]=_0x44ccbc[_0x2bec('0x36')][_0x2bec('0x48')]?_0x44ccbc[_0x2bec('0x36')]:_0x3c6473[_0x2bec('0x31')];if(_0x43d971[_0x2bec('0x33')]['includeAll']){_0x44ccbc[_0x2bec('0x49')]=[{'all':!![]}];}_0x44ccbc=_['merge']({},_0x44ccbc,_0x43d971['options']);return db[_0x2bec('0x42')][_0x2bec('0x4a')](_0x44ccbc)[_0x2bec('0x26')](handleEntityNotFound(_0xbec26,null))[_0x2bec('0x26')](respondWithResult(_0xbec26,null))['catch'](handleError(_0xbec26,null));};exports[_0x2bec('0x4b')]=function(_0x473601,_0x41f13a){if(_0x473601[_0x2bec('0x4c')]['id']){delete _0x473601[_0x2bec('0x4c')]['id'];}return db[_0x2bec('0x42')][_0x2bec('0x4a')]({'where':{'id':_0x473601['params']['id']}})[_0x2bec('0x26')](handleEntityNotFound(_0x41f13a,null))[_0x2bec('0x26')](saveUpdates(_0x473601['body'],null))[_0x2bec('0x26')](respondWithResult(_0x41f13a,null))[_0x2bec('0x45')](handleError(_0x41f13a,null));};exports['create']=function(_0x256159,_0x43069d,_0x4f58b6){return db['sequelize'][_0x2bec('0x4d')](function(_0x26fea0){if(_0x256159[_0x2bec('0x4c')]['mode']===_0x2bec('0x4e')){_0x256159[_0x2bec('0x4c')]['directory']=path[_0x2bec('0x4f')](config['root'],'server/files/moh',_0x256159[_0x2bec('0x4c')][_0x2bec('0x2c')]);}return db[_0x2bec('0x42')][_0x2bec('0x50')](_0x256159[_0x2bec('0x4c')],{'transaction':_0x26fea0})[_0x2bec('0x26')](function(_0x14af08){if(_0x256159[_0x2bec('0x4c')]['mode']==='files'){fs[_0x2bec('0x51')](_0x14af08[_0x2bec('0x52')],parseInt(_0x2bec('0x53'),0x8));}var _0x345264=_0x256159[_0x2bec('0x54')]['get']({'plain':!![]});if(!_0x345264)throw new Error(_0x2bec('0x55'));if(_0x345264[_0x2bec('0x56')]==='user'){var _0x2d6e39=_0x14af08[_0x2bec('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x2bec('0x4a')]({'where':{'name':_0x2bec('0x29'),'userProfileId':_0x345264[_0x2bec('0x57')]},'raw':!![]})[_0x2bec('0x26')](function(_0x4dd86e){if(_0x4dd86e&&_0x4dd86e[_0x2bec('0x58')]===0x0){return db[_0x2bec('0x2a')][_0x2bec('0x50')]({'name':_0x2d6e39[_0x2bec('0x2c')],'resourceId':_0x2d6e39['id'],'type':_0x4dd86e['name'],'sectionId':_0x4dd86e['id']},{})[_0x2bec('0x26')](function(){return _0x14af08;});}else{return _0x14af08;}})[_0x2bec('0x45')](function(_0x199129){logger['error'](_0x2bec('0x59'),_0x199129);});}return _0x14af08;});})[_0x2bec('0x26')](respondWithResult(_0x43069d,0xc9))['catch'](handleError(_0x43069d,null));};exports[_0x2bec('0x27')]=function(_0x191bda,_0xd51cc,_0x3ff37f){var _0x3f0a0b;return db[_0x2bec('0x42')][_0x2bec('0x4a')]({'where':{'id':_0x191bda[_0x2bec('0x46')]['id']}})[_0x2bec('0x26')](function(_0x2fb19a){if(_0x2fb19a){return db[_0x2bec('0x5a')][_0x2bec('0x4d')](function(_0x17085a){return _0x2fb19a[_0x2bec('0x27')]({'transaction':_0x17085a,'raw':!![]})[_0x2bec('0x26')](function(_0x5ca209){if(_0x5ca209[_0x2bec('0x52')]){fs[_0x2bec('0x5b')](_0x5ca209[_0x2bec('0x52')])[_0x2bec('0x5c')](function(_0x1ae720){fs[_0x2bec('0x5d')](path[_0x2bec('0x4f')](_0x5ca209[_0x2bec('0x52')],_0x1ae720));});fs[_0x2bec('0x5e')](_0x5ca209[_0x2bec('0x52')]);}return _0x5ca209;});})['catch'](function(_0x16a38c){throw new db[(_0x2bec('0x5f'))][(_0x2bec('0x60'))](_0x16a38c['message']);});}})['then'](handleEntityNotFound(_0xd51cc,null))['then'](removeEntity(_0xd51cc,null))[_0x2bec('0x45')](handleError(_0xd51cc,null));};exports[_0x2bec('0x61')]=function(_0x1cd74c,_0x3d9209,_0x2ba7dd){return db[_0x2bec('0x5a')][_0x2bec('0x4d')](function(_0x4d7737){var _0x51a5bc;return db[_0x2bec('0x42')][_0x2bec('0x4a')]({'where':{'id':_0x1cd74c[_0x2bec('0x46')]['id']}})[_0x2bec('0x26')](function(_0xebd483){if(_0xebd483){_0x51a5bc=_0xebd483;return _0xebd483[_0x2bec('0x61')](_0x1cd74c[_0x2bec('0x4c')]['id'],{'transaction':_0x4d7737});}})[_0x2bec('0x26')](function(_0x495805){if(_0x495805){return db['Sound'][_0x2bec('0x62')]({'where':{'id':_0x1cd74c[_0x2bec('0x4c')]['id']},'attributes':['id','name',_0x2bec('0x63'),_0x2bec('0x64'),'createdAt'],'raw':!![]});}})['then'](function(_0x464223){if(_0x464223){var _0x426c4c=path['join'](config[_0x2bec('0x65')],_0x2bec('0x66'),util['format'](_0x2bec('0x67'),path['basename'](_0x464223['save_name'],path[_0x2bec('0x68')](_0x464223[_0x2bec('0x63')])),_0x464223[_0x2bec('0x64')]));var _0x30ec43=path['join'](config[_0x2bec('0x65')],_0x2bec('0x69'),_0x51a5bc[_0x2bec('0x2c')],util['format'](_0x2bec('0x67'),_0x464223[_0x2bec('0x2c')],_0x464223['converted_format']));fs[_0x2bec('0x6a')](_0x426c4c,_0x30ec43);return _0x464223;}})[_0x2bec('0x45')](function(_0x555f6b){throw new db['Sequelize'][(_0x2bec('0x60'))](_0x555f6b['message']);});})[_0x2bec('0x26')](handleEntityNotFound(_0x3d9209,null))[_0x2bec('0x26')](respondWithResult(_0x3d9209,0xc9))[_0x2bec('0x45')](handleError(_0x3d9209,null));};exports[_0x2bec('0x6b')]=function(_0x1e5ea6,_0x12ad28,_0x2fa08a){return db[_0x2bec('0x5a')]['transaction'](function(_0x37467a){var _0x439004;return db[_0x2bec('0x42')]['findOne']({'where':{'id':_0x1e5ea6['params']['id']}})[_0x2bec('0x26')](handleEntityNotFound(_0x12ad28,null))[_0x2bec('0x26')](function(_0x8752e7){if(_0x8752e7){_0x439004=_0x8752e7;return _0x8752e7[_0x2bec('0x6b')](_0x1e5ea6[_0x2bec('0x46')][_0x2bec('0x6c')]);}})[_0x2bec('0x26')](function(_0x286d31){if(_0x286d31){return db[_0x2bec('0x6d')][_0x2bec('0x62')]({'where':{'id':_0x1e5ea6[_0x2bec('0x46')][_0x2bec('0x6c')]},'attributes':['id',_0x2bec('0x2c'),_0x2bec('0x63'),'converted_format',_0x2bec('0x6e')],'raw':!![]});}})[_0x2bec('0x26')](function(_0x3c22d3){if(_0x3c22d3){fs[_0x2bec('0x5d')](path['join'](_0x439004[_0x2bec('0x52')],util['format'](_0x2bec('0x67'),_0x3c22d3[_0x2bec('0x2c')],_0x3c22d3[_0x2bec('0x64')])));return _0x3c22d3;}})[_0x2bec('0x45')](function(_0x5e2ca8){throw new db[(_0x2bec('0x5f'))][(_0x2bec('0x60'))](_0x5e2ca8[_0x2bec('0x6f')]);});})['then'](handleEntityNotFound(_0x12ad28,null))['then'](respondWithStatusCode(_0x12ad28,0xcc))['catch'](handleError(_0x12ad28,null));};exports['getSounds']=function(_0x4a8259,_0x5d8c96,_0x475c93){var _0x1e65ab={};var _0x1186e6={};var _0x5512f2;var _0x2f94b0;return db['VoiceMusicOnHold'][_0x2bec('0x62')]({'where':{'id':_0x4a8259[_0x2bec('0x46')]['id']}})[_0x2bec('0x26')](handleEntityNotFound(_0x5d8c96,null))[_0x2bec('0x26')](function(_0xffba23){if(_0xffba23){_0x5512f2=_0xffba23;_0x1186e6['model']=_[_0x2bec('0x34')](db['Sound']['rawAttributes']);_0x1186e6[_0x2bec('0x33')]=_[_0x2bec('0x34')](_0x4a8259['query']);_0x1186e6['filters']=_['intersection'](_0x1186e6[_0x2bec('0x31')],_0x1186e6[_0x2bec('0x33')]);_0x1e65ab['attributes']=_[_0x2bec('0x35')](_0x1186e6['model'],qs[_0x2bec('0x37')](_0x4a8259['query'][_0x2bec('0x37')]));_0x1e65ab[_0x2bec('0x36')]=_0x1e65ab[_0x2bec('0x36')][_0x2bec('0x48')]?_0x1e65ab[_0x2bec('0x36')]:_0x1186e6[_0x2bec('0x31')];_0x1e65ab[_0x2bec('0x39')]=qs[_0x2bec('0x3a')](_0x4a8259['query']['sort']);_0x1e65ab['where']=qs[_0x2bec('0x3c')](_[_0x2bec('0x70')](_0x4a8259['query'],_0x1186e6['filters']));if(_0x4a8259[_0x2bec('0x33')]['filter']){_0x1e65ab['where']=_['merge'](_0x1e65ab[_0x2bec('0x3b')],{'$or':_['map'](_0x1e65ab[_0x2bec('0x36')],function(_0x4137d2){var _0x519ca5={};_0x519ca5[_0x4137d2]={'$like':'%'+_0x4a8259['query'][_0x2bec('0x3f')]+'%'};return _0x519ca5;})});}_0x1e65ab=_[_0x2bec('0x3d')]({},_0x1e65ab,_0x4a8259[_0x2bec('0x40')]);return _0x5512f2[_0x2bec('0x71')](_0x1e65ab);}})[_0x2bec('0x26')](function(_0x365efb){if(_0x365efb){_0x2f94b0=_0x365efb[_0x2bec('0x48')];if(!_0x4a8259['query']['hasOwnProperty'](_0x2bec('0x72'))){_0x1e65ab[_0x2bec('0x21')]=qs[_0x2bec('0x21')](_0x4a8259[_0x2bec('0x33')][_0x2bec('0x21')]);_0x1e65ab['offset']=qs[_0x2bec('0x1f')](_0x4a8259['query']['offset']);}return _0x5512f2['getSounds'](_0x1e65ab);}})[_0x2bec('0x26')](function(_0x39824a){if(_0x39824a){return _0x39824a?{'count':_0x2f94b0,'rows':_0x39824a}:null;}})[_0x2bec('0x26')](respondWithResult(_0x5d8c96,null))[_0x2bec('0x45')](handleError(_0x5d8c96,null));};
\ No newline at end of file
+var _0x975c=['undefined','limit','count','offset','set','apply','reject','save','update','then','MusicOnHolds','UserProfileResource','destroy','name','send','index','map','VoiceMusicOnHold','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','catch','show','params','includeAll','include','options','find','body','create','sequelize','transaction','mode','files','join','root','server/files/moh','mkdirSync','directory','0777','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','message','addSound','save_name','format','%s.%s','extname','converted_format','symlinkSync','Sequelize','ValidationError','findOne','removeSound','id2','createdAt','getSounds','Sound','sort','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x2e41e2,_0x4e7250){var _0x2844d6=function(_0x28ce24){while(--_0x28ce24){_0x2e41e2['push'](_0x2e41e2['shift']());}};_0x2844d6(++_0x4e7250);}(_0x975c,0x136));var _0xc975=function(_0x576ec7,_0x384478){_0x576ec7=_0x576ec7-0x0;var _0x1e3237=_0x975c[_0x576ec7];return _0x1e3237;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc975('0x0'));var zipdir=require(_0xc975('0x1'));var jsonpatch=require(_0xc975('0x2'));var rp=require(_0xc975('0x3'));var moment=require(_0xc975('0x4'));var BPromise=require(_0xc975('0x5'));var Mustache=require(_0xc975('0x6'));var util=require('util');var path=require(_0xc975('0x7'));var sox=require(_0xc975('0x8'));var csv=require(_0xc975('0x9'));var ejs=require(_0xc975('0xa'));var fs=require('fs');var fs_extra=require(_0xc975('0xb'));var _=require('lodash');var squel=require(_0xc975('0xc'));var crypto=require(_0xc975('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc975('0xe'));var toCsv=require(_0xc975('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc975('0xf'));var authService=require(_0xc975('0x10'));var qs=require(_0xc975('0x11'));var as=require(_0xc975('0x12'));var hardwareService=require(_0xc975('0x13'));var logger=require(_0xc975('0x14'))(_0xc975('0x15'));var utils=require('../../config/utils');var config=require(_0xc975('0x16'));var licenseUtil=require(_0xc975('0x17'));var db=require(_0xc975('0x18'))['db'];function respondWithStatusCode(_0x1d1d08,_0x55a2c6){_0x55a2c6=_0x55a2c6||0xcc;return function(_0x5682e6){if(_0x5682e6){return _0x1d1d08[_0xc975('0x19')](_0x55a2c6);}return _0x1d1d08[_0xc975('0x1a')](_0x55a2c6)[_0xc975('0x1b')]();};}function respondWithResult(_0x135b57,_0x15a8ea){_0x15a8ea=_0x15a8ea||0xc8;return function(_0x158c59){if(_0x158c59){return _0x135b57[_0xc975('0x1a')](_0x15a8ea)[_0xc975('0x1c')](_0x158c59);}};}function respondWithFilteredResult(_0x22571d,_0x2566a0){return function(_0x337815){if(_0x337815){var _0x55371d=typeof _0x2566a0['offset']===_0xc975('0x1d')&&typeof _0x2566a0[_0xc975('0x1e')]===_0xc975('0x1d');var _0xcce179=_0x337815[_0xc975('0x1f')];var _0x4ee826=_0x55371d?0x0:_0x2566a0[_0xc975('0x20')];var _0x99a499=_0x55371d?_0x337815[_0xc975('0x1f')]:_0x2566a0[_0xc975('0x20')]+_0x2566a0['limit'];var _0x31068b;if(_0x99a499>=_0xcce179){_0x99a499=_0xcce179;_0x31068b=0xc8;}else{_0x31068b=0xce;}_0x22571d[_0xc975('0x1a')](_0x31068b);return _0x22571d[_0xc975('0x21')]('Content-Range',_0x4ee826+'-'+_0x99a499+'/'+_0xcce179)[_0xc975('0x1c')](_0x337815);}return null;};}function patchUpdates(_0x2aca86){return function(_0x47f9df){try{jsonpatch[_0xc975('0x22')](_0x47f9df,_0x2aca86,!![]);}catch(_0x3aea0b){return BPromise[_0xc975('0x23')](_0x3aea0b);}return _0x47f9df[_0xc975('0x24')]();};}function saveUpdates(_0x11b5e9,_0xaabef6){return function(_0x4763f2){if(_0x4763f2){return _0x4763f2[_0xc975('0x25')](_0x11b5e9)['then'](function(_0x153a0a){return _0x153a0a;});}return null;};}function removeEntity(_0x4b2594,_0x392b45){return function(_0x32b054){if(_0x32b054){return _0x32b054['destroy']()[_0xc975('0x26')](function(){var _0x33f489=_0x32b054['get']({'plain':!![]});var _0xdd8c7b=_0xc975('0x27');return db[_0xc975('0x28')][_0xc975('0x29')]({'where':{'type':_0xdd8c7b,'resourceId':_0x33f489['id']}})['then'](function(){return _0x32b054;});})[_0xc975('0x26')](function(){_0x4b2594[_0xc975('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x478a89,_0x53d75b){return function(_0x4606d4){if(!_0x4606d4){_0x478a89[_0xc975('0x19')](0x194);}return _0x4606d4;};}function handleError(_0x37050f,_0x4e9723){_0x4e9723=_0x4e9723||0x1f4;return function(_0xd99581){logger['error'](_0xd99581['stack']);if(_0xd99581['name']){delete _0xd99581[_0xc975('0x2a')];}_0x37050f[_0xc975('0x1a')](_0x4e9723)[_0xc975('0x2b')](_0xd99581);};}exports[_0xc975('0x2c')]=function(_0x29c2c5,_0x103d7a){var _0x32ca92={},_0x336097={},_0x4b8f70={'count':0x0,'rows':[]};var _0x1a26b6=_[_0xc975('0x2d')](db[_0xc975('0x2e')][_0xc975('0x2f')],function(_0x594192){return{'name':_0x594192['fieldName'],'type':_0x594192[_0xc975('0x30')][_0xc975('0x31')]};});_0x336097[_0xc975('0x32')]=_['map'](_0x1a26b6,_0xc975('0x2a'));_0x336097['query']=_[_0xc975('0x33')](_0x29c2c5[_0xc975('0x34')]);_0x336097[_0xc975('0x35')]=_['intersection'](_0x336097['model'],_0x336097[_0xc975('0x34')]);_0x32ca92[_0xc975('0x36')]=_[_0xc975('0x37')](_0x336097[_0xc975('0x32')],qs[_0xc975('0x38')](_0x29c2c5['query']['fields']));_0x32ca92[_0xc975('0x36')]=_0x32ca92[_0xc975('0x36')][_0xc975('0x39')]?_0x32ca92[_0xc975('0x36')]:_0x336097['model'];if(!_0x29c2c5[_0xc975('0x34')][_0xc975('0x3a')](_0xc975('0x3b'))){_0x32ca92['limit']=qs[_0xc975('0x1e')](_0x29c2c5[_0xc975('0x34')][_0xc975('0x1e')]);_0x32ca92[_0xc975('0x20')]=qs[_0xc975('0x20')](_0x29c2c5['query'][_0xc975('0x20')]);}_0x32ca92[_0xc975('0x3c')]=qs['sort'](_0x29c2c5['query']['sort']);delete _0x29c2c5[_0xc975('0x34')]['sort'];_0x32ca92[_0xc975('0x3d')]=qs[_0xc975('0x35')](_[_0xc975('0x3e')](_0x29c2c5[_0xc975('0x34')],_0x336097['filters']),_0x1a26b6);if(_0x29c2c5['query'][_0xc975('0x3f')]){_0x32ca92[_0xc975('0x3d')]=_[_0xc975('0x40')](_0x32ca92[_0xc975('0x3d')],{'$or':_[_0xc975('0x2d')](_0x1a26b6,function(_0x3c7a30){if(_0x3c7a30[_0xc975('0x30')]!==_0xc975('0x41')){var _0x1bd727={};_0x1bd727[_0x3c7a30[_0xc975('0x2a')]]={'$like':'%'+_0x29c2c5[_0xc975('0x34')][_0xc975('0x3f')]+'%'};return _0x1bd727;}})});}_0x32ca92=_[_0xc975('0x40')]({},_0x32ca92,_0x29c2c5['options']);var _0x533e28={'where':_0x32ca92[_0xc975('0x3d')]};return db['VoiceMusicOnHold'][_0xc975('0x1f')](_0x533e28)['then'](function(_0x46cce5){_0x4b8f70[_0xc975('0x1f')]=_0x46cce5;if(_0x29c2c5[_0xc975('0x34')]['includeAll']){_0x32ca92['include']=[{'all':!![]}];}return db[_0xc975('0x2e')]['findAll'](_0x32ca92);})[_0xc975('0x26')](function(_0x12b048){_0x4b8f70['rows']=_0x12b048;return _0x4b8f70;})[_0xc975('0x26')](respondWithFilteredResult(_0x103d7a,_0x32ca92))[_0xc975('0x42')](handleError(_0x103d7a,null));};exports[_0xc975('0x43')]=function(_0x77bfa9,_0xe7b27c){var _0x543034={'raw':![],'where':{'id':_0x77bfa9[_0xc975('0x44')]['id']}},_0x44f807={};_0x44f807['model']=_[_0xc975('0x33')](db[_0xc975('0x2e')]['rawAttributes']);_0x44f807[_0xc975('0x34')]=_[_0xc975('0x33')](_0x77bfa9[_0xc975('0x34')]);_0x44f807[_0xc975('0x35')]=_[_0xc975('0x37')](_0x44f807[_0xc975('0x32')],_0x44f807[_0xc975('0x34')]);_0x543034[_0xc975('0x36')]=_['intersection'](_0x44f807[_0xc975('0x32')],qs[_0xc975('0x38')](_0x77bfa9['query'][_0xc975('0x38')]));_0x543034[_0xc975('0x36')]=_0x543034['attributes'][_0xc975('0x39')]?_0x543034[_0xc975('0x36')]:_0x44f807[_0xc975('0x32')];if(_0x77bfa9['query'][_0xc975('0x45')]){_0x543034[_0xc975('0x46')]=[{'all':!![]}];}_0x543034=_[_0xc975('0x40')]({},_0x543034,_0x77bfa9[_0xc975('0x47')]);return db[_0xc975('0x2e')][_0xc975('0x48')](_0x543034)[_0xc975('0x26')](handleEntityNotFound(_0xe7b27c,null))['then'](respondWithResult(_0xe7b27c,null))['catch'](handleError(_0xe7b27c,null));};exports['update']=function(_0x575cab,_0x1e7a5b){if(_0x575cab[_0xc975('0x49')]['id']){delete _0x575cab['body']['id'];}return db['VoiceMusicOnHold'][_0xc975('0x48')]({'where':{'id':_0x575cab['params']['id']}})[_0xc975('0x26')](handleEntityNotFound(_0x1e7a5b,null))[_0xc975('0x26')](saveUpdates(_0x575cab[_0xc975('0x49')],null))[_0xc975('0x26')](respondWithResult(_0x1e7a5b,null))[_0xc975('0x42')](handleError(_0x1e7a5b,null));};exports[_0xc975('0x4a')]=function(_0x2a6191,_0x3941a6,_0x3920d3){return db[_0xc975('0x4b')][_0xc975('0x4c')](function(_0x4517be){if(_0x2a6191['body'][_0xc975('0x4d')]===_0xc975('0x4e')){_0x2a6191[_0xc975('0x49')]['directory']=path[_0xc975('0x4f')](config[_0xc975('0x50')],_0xc975('0x51'),_0x2a6191[_0xc975('0x49')][_0xc975('0x2a')]);}return db[_0xc975('0x2e')][_0xc975('0x4a')](_0x2a6191[_0xc975('0x49')],{'transaction':_0x4517be})[_0xc975('0x26')](function(_0x60feda){if(_0x2a6191[_0xc975('0x49')][_0xc975('0x4d')]===_0xc975('0x4e')){fs[_0xc975('0x52')](_0x60feda[_0xc975('0x53')],parseInt(_0xc975('0x54'),0x8));}var _0x19a470=_0x2a6191['user'][_0xc975('0x55')]({'plain':!![]});if(!_0x19a470)throw new Error(_0xc975('0x56'));if(_0x19a470['role']==='user'){var _0x49fc39=_0x60feda[_0xc975('0x55')]({'plain':!![]});return db[_0xc975('0x57')]['find']({'where':{'name':_0xc975('0x27'),'userProfileId':_0x19a470[_0xc975('0x58')]},'raw':!![]})[_0xc975('0x26')](function(_0x47635d){if(_0x47635d&&_0x47635d[_0xc975('0x59')]===0x0){return db[_0xc975('0x28')][_0xc975('0x4a')]({'name':_0x49fc39['name'],'resourceId':_0x49fc39['id'],'type':_0x47635d[_0xc975('0x2a')],'sectionId':_0x47635d['id']},{})['then'](function(){return _0x60feda;});}else{return _0x60feda;}})[_0xc975('0x42')](function(_0x4495f8){logger[_0xc975('0x5a')](_0xc975('0x5b'),_0x4495f8);});}return _0x60feda;});})['then'](respondWithResult(_0x3941a6,0xc9))['catch'](handleError(_0x3941a6,null));};exports['destroy']=function(_0x5ebfb1,_0x2a5b11,_0x7ac97b){var _0xd1f840;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x5ebfb1['params']['id']}})[_0xc975('0x26')](function(_0x1990ff){if(_0x1990ff){return db[_0xc975('0x4b')][_0xc975('0x4c')](function(_0x50b4fa){return _0x1990ff['destroy']({'transaction':_0x50b4fa,'raw':!![]})[_0xc975('0x26')](function(_0x26246b){if(_0x26246b[_0xc975('0x53')]){fs[_0xc975('0x5c')](_0x26246b[_0xc975('0x53')])[_0xc975('0x5d')](function(_0x73829b){fs[_0xc975('0x5e')](path[_0xc975('0x4f')](_0x26246b[_0xc975('0x53')],_0x73829b));});fs[_0xc975('0x5f')](_0x26246b['directory']);}return _0x26246b;});})[_0xc975('0x42')](function(_0x276571){throw new db['Sequelize']['ValidationError'](_0x276571[_0xc975('0x60')]);});}})[_0xc975('0x26')](handleEntityNotFound(_0x2a5b11,null))[_0xc975('0x26')](removeEntity(_0x2a5b11,null))[_0xc975('0x42')](handleError(_0x2a5b11,null));};exports[_0xc975('0x61')]=function(_0xea3522,_0x2bad96,_0x20bfed){return db[_0xc975('0x4b')][_0xc975('0x4c')](function(_0x2727b9){var _0x159324;return db[_0xc975('0x2e')][_0xc975('0x48')]({'where':{'id':_0xea3522[_0xc975('0x44')]['id']}})[_0xc975('0x26')](function(_0x3400ea){if(_0x3400ea){_0x159324=_0x3400ea;return _0x3400ea[_0xc975('0x61')](_0xea3522[_0xc975('0x49')]['id'],{'transaction':_0x2727b9});}})[_0xc975('0x26')](function(_0xb52a5d){if(_0xb52a5d){return db['Sound']['findOne']({'where':{'id':_0xea3522[_0xc975('0x49')]['id']},'attributes':['id',_0xc975('0x2a'),_0xc975('0x62'),'converted_format','createdAt'],'raw':!![]});}})['then'](function(_0x245666){if(_0x245666){var _0x4ac399=path[_0xc975('0x4f')](config[_0xc975('0x50')],'server/files/sounds/converted',util[_0xc975('0x63')](_0xc975('0x64'),path['basename'](_0x245666[_0xc975('0x62')],path[_0xc975('0x65')](_0x245666[_0xc975('0x62')])),_0x245666[_0xc975('0x66')]));var _0x4a40f4=path[_0xc975('0x4f')](config[_0xc975('0x50')],_0xc975('0x51'),_0x159324[_0xc975('0x2a')],util[_0xc975('0x63')]('%s.%s',_0x245666[_0xc975('0x2a')],_0x245666[_0xc975('0x66')]));fs[_0xc975('0x67')](_0x4ac399,_0x4a40f4);return _0x245666;}})['catch'](function(_0x4f7795){throw new db[(_0xc975('0x68'))][(_0xc975('0x69'))](_0x4f7795[_0xc975('0x60')]);});})[_0xc975('0x26')](handleEntityNotFound(_0x2bad96,null))[_0xc975('0x26')](respondWithResult(_0x2bad96,0xc9))['catch'](handleError(_0x2bad96,null));};exports['removeSound']=function(_0x3db294,_0xf963b8,_0x5d5027){return db['sequelize']['transaction'](function(_0x20bf33){var _0x1b14ca;return db[_0xc975('0x2e')][_0xc975('0x6a')]({'where':{'id':_0x3db294[_0xc975('0x44')]['id']}})['then'](handleEntityNotFound(_0xf963b8,null))[_0xc975('0x26')](function(_0x3af0bf){if(_0x3af0bf){_0x1b14ca=_0x3af0bf;return _0x3af0bf[_0xc975('0x6b')](_0x3db294[_0xc975('0x44')][_0xc975('0x6c')]);}})[_0xc975('0x26')](function(_0x1ecb32){if(_0x1ecb32){return db['Sound'][_0xc975('0x6a')]({'where':{'id':_0x3db294[_0xc975('0x44')][_0xc975('0x6c')]},'attributes':['id',_0xc975('0x2a'),_0xc975('0x62'),'converted_format',_0xc975('0x6d')],'raw':!![]});}})['then'](function(_0xac0251){if(_0xac0251){fs['unlinkSync'](path[_0xc975('0x4f')](_0x1b14ca[_0xc975('0x53')],util['format']('%s.%s',_0xac0251[_0xc975('0x2a')],_0xac0251['converted_format'])));return _0xac0251;}})[_0xc975('0x42')](function(_0x34e00e){throw new db['Sequelize'][(_0xc975('0x69'))](_0x34e00e[_0xc975('0x60')]);});})[_0xc975('0x26')](handleEntityNotFound(_0xf963b8,null))[_0xc975('0x26')](respondWithStatusCode(_0xf963b8,0xcc))[_0xc975('0x42')](handleError(_0xf963b8,null));};exports[_0xc975('0x6e')]=function(_0x220e14,_0x334f71,_0x45a171){var _0x391023={};var _0x426ae8={};var _0x482859;var _0x12bcfa;return db[_0xc975('0x2e')][_0xc975('0x6a')]({'where':{'id':_0x220e14[_0xc975('0x44')]['id']}})[_0xc975('0x26')](handleEntityNotFound(_0x334f71,null))[_0xc975('0x26')](function(_0x285f89){if(_0x285f89){_0x482859=_0x285f89;_0x426ae8[_0xc975('0x32')]=_[_0xc975('0x33')](db[_0xc975('0x6f')]['rawAttributes']);_0x426ae8['query']=_[_0xc975('0x33')](_0x220e14[_0xc975('0x34')]);_0x426ae8[_0xc975('0x35')]=_['intersection'](_0x426ae8[_0xc975('0x32')],_0x426ae8[_0xc975('0x34')]);_0x391023[_0xc975('0x36')]=_[_0xc975('0x37')](_0x426ae8[_0xc975('0x32')],qs[_0xc975('0x38')](_0x220e14['query'][_0xc975('0x38')]));_0x391023[_0xc975('0x36')]=_0x391023[_0xc975('0x36')][_0xc975('0x39')]?_0x391023['attributes']:_0x426ae8[_0xc975('0x32')];_0x391023[_0xc975('0x3c')]=qs[_0xc975('0x70')](_0x220e14[_0xc975('0x34')][_0xc975('0x70')]);_0x391023[_0xc975('0x3d')]=qs[_0xc975('0x35')](_[_0xc975('0x3e')](_0x220e14[_0xc975('0x34')],_0x426ae8[_0xc975('0x35')]));if(_0x220e14[_0xc975('0x34')]['filter']){_0x391023[_0xc975('0x3d')]=_[_0xc975('0x40')](_0x391023[_0xc975('0x3d')],{'$or':_[_0xc975('0x2d')](_0x391023['attributes'],function(_0x150920){var _0x3a7825={};_0x3a7825[_0x150920]={'$like':'%'+_0x220e14[_0xc975('0x34')]['filter']+'%'};return _0x3a7825;})});}_0x391023=_[_0xc975('0x40')]({},_0x391023,_0x220e14[_0xc975('0x47')]);return _0x482859[_0xc975('0x6e')](_0x391023);}})[_0xc975('0x26')](function(_0x2d67f1){if(_0x2d67f1){_0x12bcfa=_0x2d67f1['length'];if(!_0x220e14[_0xc975('0x34')][_0xc975('0x3a')](_0xc975('0x3b'))){_0x391023['limit']=qs[_0xc975('0x1e')](_0x220e14[_0xc975('0x34')][_0xc975('0x1e')]);_0x391023[_0xc975('0x20')]=qs[_0xc975('0x20')](_0x220e14['query']['offset']);}return _0x482859[_0xc975('0x6e')](_0x391023);}})[_0xc975('0x26')](function(_0x923e46){if(_0x923e46){return _0x923e46?{'count':_0x12bcfa,'rows':_0x923e46}:null;}})[_0xc975('0x26')](respondWithResult(_0x334f71,null))[_0xc975('0x42')](handleError(_0x334f71,null));};
\ No newline at end of file
index ab4db53..9393b11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e9f=['./voiceMusicOnHold.attributes','define','voice_musiconhold','lodash','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x105b20,_0x388d13){var _0x357455=function(_0x5b28d7){while(--_0x5b28d7){_0x105b20['push'](_0x105b20['shift']());}};_0x357455(++_0x388d13);}(_0x7e9f,0x108));var _0xf7e9=function(_0xe4a7d8,_0xac46ab){_0xe4a7d8=_0xe4a7d8-0x0;var _0x41ac3d=_0x7e9f[_0xe4a7d8];return _0x41ac3d;};'use strict';var _=require(_0xf7e9('0x0'));var util=require('util');var logger=require(_0xf7e9('0x1'))('api');var moment=require(_0xf7e9('0x2'));var BPromise=require(_0xf7e9('0x3'));var rp=require(_0xf7e9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf7e9('0x5'));var config=require('../../config/environment');var attributes=require(_0xf7e9('0x6'));module['exports']=function(_0x444138,_0x21d653){return _0x444138[_0xf7e9('0x7')]('VoiceMusicOnHold',attributes,{'tableName':_0xf7e9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x061e=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','voice_musiconhold','lodash'];(function(_0x169ff4,_0x4113d2){var _0x1d58cc=function(_0x2c3c52){while(--_0x2c3c52){_0x169ff4['push'](_0x169ff4['shift']());}};_0x1d58cc(++_0x4113d2);}(_0x061e,0x18b));var _0xe061=function(_0x10e1fc,_0x3671d6){_0x10e1fc=_0x10e1fc-0x0;var _0x175c73=_0x061e[_0x10e1fc];return _0x175c73;};'use strict';var _=require(_0xe061('0x0'));var util=require(_0xe061('0x1'));var logger=require(_0xe061('0x2'))(_0xe061('0x3'));var moment=require('moment');var BPromise=require(_0xe061('0x4'));var rp=require(_0xe061('0x5'));var fs=require('fs');var path=require(_0xe061('0x6'));var rimraf=require(_0xe061('0x7'));var config=require(_0xe061('0x8'));var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x529a44,_0x30c6eb){return _0x529a44[_0xe061('0x9')]('VoiceMusicOnHold',attributes,{'tableName':_0xe061('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c222397..c8c5b57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x21c1d6,_0x107cb5){var _0x244431=function(_0x4e27bd){while(--_0x4e27bd){_0x21c1d6['push'](_0x21c1d6['shift']());}};_0x244431(++_0x107cb5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x48756c,_0x284fd0){var _0x4874e6=function(_0x5e5903){while(--_0x5e5903){_0x48756c['push'](_0x48756c['shift']());}};_0x4874e6(++_0x284fd0);}(_0xe706,0xa3));var _0x6e70=function(_0x3154a3,_0x45d16d){_0x3154a3=_0x3154a3-0x0;var _0x553af5=_0xe706[_0x3154a3];return _0x553af5;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}
\ No newline at end of file
index 2094296..71e93dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x397c=['/:id/teams','getTeams','post','create','/:id/users','addTeams','put','update','destroy','delete','removeAgents','removeTeams','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','/describe','describe','get','/:id','show','getAgents'];(function(_0x373e24,_0x39b6ec){var _0xc1e49a=function(_0x3daffb){while(--_0x3daffb){_0x373e24['push'](_0x373e24['shift']());}};_0xc1e49a(++_0x39b6ec);}(_0x397c,0xc1));var _0xc397=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x397c[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0xc397('0x0'));var util=require(_0xc397('0x1'));var path=require(_0xc397('0x2'));var timeout=require('connect-timeout');var express=require(_0xc397('0x3'));var router=express['Router']();var fs_extra=require(_0xc397('0x4'));var auth=require(_0xc397('0x5'));var interaction=require(_0xc397('0x6'));var config=require(_0xc397('0x7'));var controller=require(_0xc397('0x8'));router['get']('/',auth[_0xc397('0x9')](),controller[_0xc397('0xa')]);router['get'](_0xc397('0xb'),auth[_0xc397('0x9')](),controller[_0xc397('0xc')]);router[_0xc397('0xd')](_0xc397('0xe'),auth[_0xc397('0x9')](),controller[_0xc397('0xf')]);router[_0xc397('0xd')]('/:id/users',auth[_0xc397('0x9')](),controller[_0xc397('0x10')]);router[_0xc397('0xd')](_0xc397('0x11'),auth[_0xc397('0x9')](),controller[_0xc397('0x12')]);router[_0xc397('0x13')]('/',auth[_0xc397('0x9')](),controller[_0xc397('0x14')]);router[_0xc397('0x13')](_0xc397('0x15'),auth['isAuthenticated'](),controller['addAgents']);router['post'](_0xc397('0x11'),auth[_0xc397('0x9')](),controller[_0xc397('0x16')]);router[_0xc397('0x17')](_0xc397('0xe'),auth[_0xc397('0x9')](),controller[_0xc397('0x18')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc397('0x19')]);router[_0xc397('0x1a')](_0xc397('0x15'),auth['isAuthenticated'](),controller[_0xc397('0x1b')]);router[_0xc397('0x1a')](_0xc397('0x11'),auth[_0xc397('0x9')](),controller[_0xc397('0x1c')]);module[_0xc397('0x1d')]=router;
\ No newline at end of file
+var _0xcb81=['removeTeams','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','index','isAuthenticated','describe','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put','/:id','update','delete','removeAgents'];(function(_0x6d64a0,_0x5b1a77){var _0x58c119=function(_0x220dd3){while(--_0x220dd3){_0x6d64a0['push'](_0x6d64a0['shift']());}};_0x58c119(++_0x5b1a77);}(_0xcb81,0x154));var _0x1cb8=function(_0x128bef,_0xc7a0af){_0x128bef=_0x128bef-0x0;var _0x1ba862=_0xcb81[_0x128bef];return _0x1ba862;};'use strict';var multer=require(_0x1cb8('0x0'));var util=require(_0x1cb8('0x1'));var path=require('path');var timeout=require(_0x1cb8('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1cb8('0x3'));var interaction=require(_0x1cb8('0x4'));var config=require(_0x1cb8('0x5'));var controller=require(_0x1cb8('0x6'));router[_0x1cb8('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb8('0x8')]);router[_0x1cb8('0x7')]('/describe',auth[_0x1cb8('0x9')](),controller[_0x1cb8('0xa')]);router[_0x1cb8('0x7')]('/:id',auth[_0x1cb8('0x9')](),controller['show']);router['get'](_0x1cb8('0xb'),auth[_0x1cb8('0x9')](),controller[_0x1cb8('0xc')]);router[_0x1cb8('0x7')](_0x1cb8('0xd'),auth[_0x1cb8('0x9')](),controller[_0x1cb8('0xe')]);router[_0x1cb8('0xf')]('/',auth['isAuthenticated'](),controller[_0x1cb8('0x10')]);router[_0x1cb8('0xf')](_0x1cb8('0xb'),auth[_0x1cb8('0x9')](),controller[_0x1cb8('0x11')]);router['post'](_0x1cb8('0xd'),auth[_0x1cb8('0x9')](),controller[_0x1cb8('0x12')]);router[_0x1cb8('0x13')](_0x1cb8('0x14'),auth[_0x1cb8('0x9')](),controller[_0x1cb8('0x15')]);router[_0x1cb8('0x16')]('/:id',auth[_0x1cb8('0x9')](),controller['destroy']);router[_0x1cb8('0x16')](_0x1cb8('0xb'),auth[_0x1cb8('0x9')](),controller[_0x1cb8('0x17')]);router[_0x1cb8('0x16')](_0x1cb8('0xd'),auth[_0x1cb8('0x9')](),controller[_0x1cb8('0x18')]);module[_0x1cb8('0x19')]=router;
\ No newline at end of file
index 13b6034..35023d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x440d=['name','VIRTUAL','getDataValue','INTEGER','sequelize','exports','STRING'];(function(_0x44cee6,_0x187619){var _0xaae6c6=function(_0x3d12ac){while(--_0x3d12ac){_0x44cee6['push'](_0x44cee6['shift']());}};_0xaae6c6(++_0x187619);}(_0x440d,0x74));var _0xd440=function(_0x4c9d50,_0x118495){_0x4c9d50=_0x4c9d50-0x0;var _0x3f97e4=_0x440d[_0x4c9d50];return _0x3f97e4;};'use strict';var Sequelize=require(_0xd440('0x0'));module[_0xd440('0x1')]={'name':{'type':Sequelize[_0xd440('0x2')],'allowNull':![],'unique':_0xd440('0x3')},'prefix':{'type':Sequelize[_0xd440('0x4')],'get':function(_0x2407b3){return'system-'+this[_0xd440('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0xd440('0x2')]},'callerIdAll':{'type':Sequelize[_0xd440('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xd440('0x6')]}};
\ No newline at end of file
+var _0x6e71=['exports','system-','getDataValue','name','STRING','INTEGER'];(function(_0x572976,_0x3a9894){var _0x52518b=function(_0x3022d5){while(--_0x3022d5){_0x572976['push'](_0x572976['shift']());}};_0x52518b(++_0x3a9894);}(_0x6e71,0x1c8));var _0x16e7=function(_0x3821b0,_0x2761dd){_0x3821b0=_0x3821b0-0x0;var _0x16bad0=_0x6e71[_0x3821b0];return _0x16bad0;};'use strict';var Sequelize=require('sequelize');module[_0x16e7('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x3e15e9){return _0x16e7('0x1')+this[_0x16e7('0x2')](_0x16e7('0x3'))+'-';}},'description':{'type':Sequelize[_0x16e7('0x4')]},'callerIdAll':{'type':Sequelize[_0x16e7('0x4')]},'VoiceExtensionId':{'type':Sequelize[_0x16e7('0x5')]}};
\ No newline at end of file
index 59493b3..8e648d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab40=['PREFIX-CALLERIDALL=','No\x20callerid\x20available','context','${EXTEN:','charAt','findById','addAgents','omit','body','ids','spread','removeAgents','emit','userVoicePrefix:remove','getAgents','findOne','User','getTeams','Team','findAll','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','userVoicePrefix:save','removeTeams','select','field','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','all','union','compact','value','isEmpty','forEach','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','UserProfileResource','error','stack','name','VoicePrefix','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','options','includeAll','include','rows','catch','params','length','find','describe','create','sequelize','transaction','get','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','system','description','appdata','prefix','NoOp','Voice\x20Prefix','VoiceExtension','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll'];(function(_0x3d2032,_0x60f81a){var _0x378ebe=function(_0x11c72a){while(--_0x11c72a){_0x3d2032['push'](_0x3d2032['shift']());}};_0x378ebe(++_0x60f81a);}(_0xab40,0xcd));var _0x0ab4=function(_0x2288fa,_0x4285d0){_0x2288fa=_0x2288fa-0x0;var _0x4ef103=_0xab40[_0x2288fa];return _0x4ef103;};'use strict';var emlformat=require(_0x0ab4('0x0'));var rimraf=require(_0x0ab4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0ab4('0x2'));var BPromise=require(_0x0ab4('0x3'));var Mustache=require(_0x0ab4('0x4'));var util=require(_0x0ab4('0x5'));var path=require(_0x0ab4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0ab4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ab4('0x8'));var squel=require(_0x0ab4('0x9'));var crypto=require(_0x0ab4('0xa'));var jsforce=require(_0x0ab4('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ab4('0xc'));var Redis=require(_0x0ab4('0xd'));var authService=require(_0x0ab4('0xe'));var qs=require(_0x0ab4('0xf'));var as=require(_0x0ab4('0x10'));var hardwareService=require(_0x0ab4('0x11'));var logger=require(_0x0ab4('0x12'))(_0x0ab4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0ab4('0x14'));var db=require('../../mysqldb')['db'];config[_0x0ab4('0x15')]=_[_0x0ab4('0x16')](config[_0x0ab4('0x15')],{'host':_0x0ab4('0x17'),'port':0x18eb});var socket=require(_0x0ab4('0x18'))(new Redis(config[_0x0ab4('0x15')]));require(_0x0ab4('0x19'))[_0x0ab4('0x1a')](socket);function respondWithStatusCode(_0x3cb1df,_0x2033c8){_0x2033c8=_0x2033c8||0xcc;return function(_0x216a17){if(_0x216a17){return _0x3cb1df[_0x0ab4('0x1b')](_0x2033c8);}return _0x3cb1df[_0x0ab4('0x1c')](_0x2033c8)[_0x0ab4('0x1d')]();};}function respondWithResult(_0x2a83a8,_0x2403db){_0x2403db=_0x2403db||0xc8;return function(_0x283b15){if(_0x283b15){return _0x2a83a8[_0x0ab4('0x1c')](_0x2403db)['json'](_0x283b15);}};}function respondWithFilteredResult(_0x5000d4,_0x49634f){return function(_0x17422f){if(_0x17422f){var _0x30d5df=typeof _0x49634f[_0x0ab4('0x1e')]==='undefined'&&typeof _0x49634f[_0x0ab4('0x1f')]===_0x0ab4('0x20');var _0x212ebd=_0x17422f[_0x0ab4('0x21')];var _0x4e7852=_0x30d5df?0x0:_0x49634f['offset'];var _0xdb0797=_0x30d5df?_0x17422f['count']:_0x49634f[_0x0ab4('0x1e')]+_0x49634f[_0x0ab4('0x1f')];var _0x5bb1d0;if(_0xdb0797>=_0x212ebd){_0xdb0797=_0x212ebd;_0x5bb1d0=0xc8;}else{_0x5bb1d0=0xce;}_0x5000d4[_0x0ab4('0x1c')](_0x5bb1d0);return _0x5000d4[_0x0ab4('0x22')](_0x0ab4('0x23'),_0x4e7852+'-'+_0xdb0797+'/'+_0x212ebd)[_0x0ab4('0x24')](_0x17422f);}return null;};}function patchUpdates(_0x12d06d){return function(_0x52d7d3){try{jsonpatch['apply'](_0x52d7d3,_0x12d06d,!![]);}catch(_0x24b929){return BPromise[_0x0ab4('0x25')](_0x24b929);}return _0x52d7d3[_0x0ab4('0x26')]();};}function saveUpdates(_0x13c882,_0x4e4b80){return function(_0x42d2dd){if(_0x42d2dd){return _0x42d2dd[_0x0ab4('0x27')](_0x13c882)[_0x0ab4('0x28')](function(_0x4ea9aa){return _0x4ea9aa;});}return null;};}function removeEntity(_0x4c5caf,_0x176ff1){return function(_0x1c132c){if(_0x1c132c){return _0x1c132c[_0x0ab4('0x29')]()['then'](function(){var _0x519b23=_0x1c132c['get']({'plain':!![]});var _0x19ecc6='VoicePrefixes';return db[_0x0ab4('0x2a')][_0x0ab4('0x29')]({'where':{'type':_0x19ecc6,'resourceId':_0x519b23['id']}})['then'](function(){return _0x1c132c;});})['then'](function(){_0x4c5caf['status'](0xcc)[_0x0ab4('0x1d')]();});}};}function handleEntityNotFound(_0x183bac,_0x1cfdad){return function(_0x3f61cb){if(!_0x3f61cb){_0x183bac[_0x0ab4('0x1b')](0x194);}return _0x3f61cb;};}function handleError(_0x588e0d,_0x5b55c1){_0x5b55c1=_0x5b55c1||0x1f4;return function(_0x580d56){logger[_0x0ab4('0x2b')](_0x580d56[_0x0ab4('0x2c')]);if(_0x580d56[_0x0ab4('0x2d')]){delete _0x580d56[_0x0ab4('0x2d')];}_0x588e0d[_0x0ab4('0x1c')](_0x5b55c1)['send'](_0x580d56);};}exports['index']=function(_0x285a29,_0xe6682){var _0x361f7c={},_0x4819be={},_0x48e430={'count':0x0,'rows':[]};var _0x1b19db=_['map'](db[_0x0ab4('0x2e')][_0x0ab4('0x2f')],function(_0x263e5a){return{'name':_0x263e5a[_0x0ab4('0x30')],'type':_0x263e5a[_0x0ab4('0x31')][_0x0ab4('0x32')]};});_0x4819be['model']=_[_0x0ab4('0x33')](_0x1b19db,_0x0ab4('0x2d'));_0x4819be[_0x0ab4('0x34')]=_[_0x0ab4('0x35')](_0x285a29['query']);_0x4819be['filters']=_[_0x0ab4('0x36')](_0x4819be[_0x0ab4('0x37')],_0x4819be[_0x0ab4('0x34')]);_0x361f7c['attributes']=_['intersection'](_0x4819be['model'],qs[_0x0ab4('0x38')](_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x38')]));_0x361f7c['attributes']=_0x361f7c['attributes']['length']?_0x361f7c[_0x0ab4('0x39')]:_0x4819be[_0x0ab4('0x37')];if(!_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x3a')](_0x0ab4('0x3b'))){_0x361f7c[_0x0ab4('0x1f')]=qs[_0x0ab4('0x1f')](_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x1f')]);_0x361f7c[_0x0ab4('0x1e')]=qs['offset'](_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x1e')]);}_0x361f7c[_0x0ab4('0x3c')]=qs[_0x0ab4('0x3d')](_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x3d')]);_0x361f7c[_0x0ab4('0x3e')]=qs[_0x0ab4('0x3f')](_[_0x0ab4('0x40')](_0x285a29[_0x0ab4('0x34')],_0x4819be[_0x0ab4('0x3f')]),_0x1b19db);if(_0x285a29[_0x0ab4('0x34')]['filter']){_0x361f7c[_0x0ab4('0x3e')]=_[_0x0ab4('0x41')](_0x361f7c[_0x0ab4('0x3e')],{'$or':_[_0x0ab4('0x33')](_0x1b19db,function(_0x589b46){if(_0x589b46[_0x0ab4('0x31')]!=='VIRTUAL'){var _0x43e5ba={};_0x43e5ba[_0x589b46[_0x0ab4('0x2d')]]={'$like':'%'+_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x42')]+'%'};return _0x43e5ba;}})});}_0x361f7c=_[_0x0ab4('0x41')]({},_0x361f7c,_0x285a29[_0x0ab4('0x43')]);var _0x5815d1={'where':_0x361f7c[_0x0ab4('0x3e')]};return db[_0x0ab4('0x2e')][_0x0ab4('0x21')](_0x5815d1)['then'](function(_0x395e0b){_0x48e430[_0x0ab4('0x21')]=_0x395e0b;if(_0x285a29[_0x0ab4('0x34')][_0x0ab4('0x44')]){_0x361f7c[_0x0ab4('0x45')]=[{'all':!![]}];}return db['VoicePrefix']['findAll'](_0x361f7c);})['then'](function(_0x2f54dd){_0x48e430[_0x0ab4('0x46')]=_0x2f54dd;return _0x48e430;})['then'](respondWithFilteredResult(_0xe6682,_0x361f7c))[_0x0ab4('0x47')](handleError(_0xe6682,null));};exports['show']=function(_0x2d1d87,_0x562262){var _0x365be1={'raw':![],'where':{'id':_0x2d1d87[_0x0ab4('0x48')]['id']}},_0x300fd8={};_0x300fd8[_0x0ab4('0x37')]=_[_0x0ab4('0x35')](db[_0x0ab4('0x2e')]['rawAttributes']);_0x300fd8[_0x0ab4('0x34')]=_[_0x0ab4('0x35')](_0x2d1d87[_0x0ab4('0x34')]);_0x300fd8[_0x0ab4('0x3f')]=_[_0x0ab4('0x36')](_0x300fd8[_0x0ab4('0x37')],_0x300fd8['query']);_0x365be1[_0x0ab4('0x39')]=_['intersection'](_0x300fd8[_0x0ab4('0x37')],qs[_0x0ab4('0x38')](_0x2d1d87[_0x0ab4('0x34')]['fields']));_0x365be1[_0x0ab4('0x39')]=_0x365be1[_0x0ab4('0x39')][_0x0ab4('0x49')]?_0x365be1[_0x0ab4('0x39')]:_0x300fd8[_0x0ab4('0x37')];if(_0x2d1d87[_0x0ab4('0x34')]['includeAll']){_0x365be1[_0x0ab4('0x45')]=[{'all':!![]}];}_0x365be1=_[_0x0ab4('0x41')]({},_0x365be1,_0x2d1d87[_0x0ab4('0x43')]);return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')](_0x365be1)[_0x0ab4('0x28')](handleEntityNotFound(_0x562262,null))[_0x0ab4('0x28')](respondWithResult(_0x562262,null))[_0x0ab4('0x47')](handleError(_0x562262,null));};exports[_0x0ab4('0x29')]=function(_0x24bb13,_0x1a9675){return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')]({'where':{'id':_0x24bb13['params']['id']}})[_0x0ab4('0x28')](handleEntityNotFound(_0x1a9675,null))[_0x0ab4('0x28')](removeEntity(_0x1a9675,null))['catch'](handleError(_0x1a9675,null));};exports[_0x0ab4('0x4b')]=function(_0x48efa4,_0x53d66f){return db[_0x0ab4('0x2e')][_0x0ab4('0x4b')]()[_0x0ab4('0x28')](respondWithResult(_0x53d66f,null))['catch'](handleError(_0x53d66f,null));};exports[_0x0ab4('0x4c')]=function(_0xb3bd1e,_0xeddaa1){var _0xaed2d;return db[_0x0ab4('0x4d')][_0x0ab4('0x4e')](function(_0x1eea3b){return db['VoicePrefix'][_0x0ab4('0x4c')](_0xb3bd1e['body'],{'transaction':_0x1eea3b})[_0x0ab4('0x28')](function(_0x55c073){_0xaed2d=_0x55c073[_0x0ab4('0x4f')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0xaed2d[_0x0ab4('0x50')]},'raw':!![]})[_0x0ab4('0x28')](function(_0x433346){return createVoicePrefixExtensions(_0xaed2d,_0x433346,_0x1eea3b);});});})[_0x0ab4('0x28')](function(){var _0x4e2db5=_0xb3bd1e[_0x0ab4('0x51')][_0x0ab4('0x4f')]({'plain':!![]});if(!_0x4e2db5)throw new Error(_0x0ab4('0x52'));if(_0x4e2db5[_0x0ab4('0x53')]===_0x0ab4('0x51')){var _0x2354fa=_0xaed2d;return db[_0x0ab4('0x54')][_0x0ab4('0x4a')]({'where':{'name':_0x0ab4('0x55'),'userProfileId':_0x4e2db5[_0x0ab4('0x56')]},'raw':!![]})[_0x0ab4('0x28')](function(_0x355ba8){if(_0x355ba8&&_0x355ba8[_0x0ab4('0x57')]===0x0){return db[_0x0ab4('0x2a')][_0x0ab4('0x4c')]({'name':_0x2354fa[_0x0ab4('0x2d')],'resourceId':_0x2354fa['id'],'type':_0x355ba8[_0x0ab4('0x2d')],'sectionId':_0x355ba8['id']},{})[_0x0ab4('0x28')](function(){return _0xaed2d;});}else{return _0xaed2d;}})[_0x0ab4('0x47')](function(_0x59705f){logger[_0x0ab4('0x2b')](_0x0ab4('0x58'),_0x59705f);throw _0x59705f;});}return _0xaed2d;})[_0x0ab4('0x28')](respondWithResult(_0xeddaa1,null))[_0x0ab4('0x47')](handleError(_0xeddaa1,null));};function Extension(_0x32e38c,_0x3bcb90,_0x387619,_0x251e4d){this['context']=_0x0ab4('0x59');this[_0x0ab4('0x5a')]=_0x32e38c;this['app']=_0x387619;this['type']=_0x0ab4('0x5b');this[_0x0ab4('0x5c')]='Voice\x20Prefix\x20Extension';this['priority']=_0x3bcb90;this[_0x0ab4('0x5d')]=_0x251e4d;}function createVoicePrefixExtensions(_0x5b4bbe,_0x597d26,_0x427b51){return new BPromise(function(_0x3cdedf,_0x12dccd){var _0x42cbcb=new Extension(formatPrefixName(_0x5b4bbe[_0x0ab4('0x5e')]),0x1,_0x0ab4('0x5f'),_0x0ab4('0x60'));_0x42cbcb['VoicePrefixId']=_0x5b4bbe['id'];return db[_0x0ab4('0x61')][_0x0ab4('0x4c')](_0x42cbcb,{'transaction':_0x427b51})[_0x0ab4('0x28')](function(_0x406df2){var _0x194733=_0x406df2[_0x0ab4('0x4f')]({'plain':!![]});var _0x4f1847=_[_0x0ab4('0x33')](addVoicePrefixExtensions(_0x5b4bbe,_0x597d26),function(_0x1b7925){_0x1b7925['VoiceExtensionId']=_0x194733['id'];_0x1b7925[_0x0ab4('0x62')]=_0x5b4bbe['id'];return _0x1b7925;});return db['VoiceExtension'][_0x0ab4('0x63')](_0x4f1847,{'transaction':_0x427b51})['then'](function(_0x268b23){if(!_0x268b23){return _0x12dccd(_0x0ab4('0x64'));}else{return _0x3cdedf(_0x268b23);}})[_0x0ab4('0x47')](function(_0x2e728f){return _0x12dccd(_0x2e728f);});});;});};function addVoicePrefixExtensions(_0x509611,_0x581547){var _0x10dd5b=[];var _0x4477ba=formatPrefixName(_0x509611['prefix']);_0x10dd5b[_0x0ab4('0x65')](new Extension(_0x4477ba,0x2,_0x0ab4('0x66'),_0x0ab4('0x67')+_0x509611['name']));if(_0x509611[_0x0ab4('0x68')]){_0x10dd5b[_0x0ab4('0x65')](new Extension(_0x4477ba,0x3,_0x0ab4('0x66'),_0x0ab4('0x69')+_0x509611[_0x0ab4('0x68')]));}else{_0x10dd5b[_0x0ab4('0x65')](new Extension(_0x4477ba,0x3,_0x0ab4('0x5f'),_0x0ab4('0x6a')));}_0x10dd5b['push'](new Extension(_0x4477ba,0x4,'goto',_0x581547[_0x0ab4('0x6b')]+','+_0x0ab4('0x6c')+(0x8+_0x509611[_0x0ab4('0x2d')][_0x0ab4('0x49')])+'}'+','+0x1));return _0x10dd5b;}function formatPrefixName(_0x58c611){var _0x417926='_';for(var _0x5256d4=0x0;_0x5256d4<_0x58c611[_0x0ab4('0x49')];_0x5256d4++){if(_0x58c611[_0x0ab4('0x6d')](_0x5256d4)=='-'){_0x417926+=_0x58c611[_0x0ab4('0x6d')](_0x5256d4);}else{_0x417926+='['+_0x58c611[_0x0ab4('0x6d')](_0x5256d4)+']';}}_0x417926+='.';return _0x417926;}exports[_0x0ab4('0x27')]=function(_0x41b65f,_0x46a008,_0xf42b98){var _0x29cf79=_0x41b65f['body'];_0x29cf79[_0x0ab4('0x5e')]='system-'+_0x29cf79[_0x0ab4('0x2d')]+'-';return db[_0x0ab4('0x4d')][_0x0ab4('0x4e')](function(_0x1481b2){return db[_0x0ab4('0x2e')][_0x0ab4('0x27')](_0x29cf79,{'where':{'id':_0x29cf79['id']},'transaction':_0x1481b2})[_0x0ab4('0x28')](function(){return db[_0x0ab4('0x61')][_0x0ab4('0x29')]({'where':{'VoicePrefixId':_0x29cf79['id']},'transaction':_0x1481b2})['then'](function(){return db[_0x0ab4('0x61')][_0x0ab4('0x4a')]({'where':{'id':_0x29cf79['VoiceExtensionId']},'raw':!![]})[_0x0ab4('0x28')](function(_0x2d4921){return createVoicePrefixExtensions(_0x29cf79,_0x2d4921,_0x1481b2);});});});})[_0x0ab4('0x28')](function(){return db['VoicePrefix'][_0x0ab4('0x6e')](_0x29cf79['id']);})[_0x0ab4('0x28')](respondWithResult(_0x46a008,null))[_0x0ab4('0x47')](handleError(_0x46a008,null));};exports[_0x0ab4('0x6f')]=function(_0x531a07,_0x5bf57e,_0x398b3e){return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')]({'where':{'id':_0x531a07[_0x0ab4('0x48')]['id']}})['then'](handleEntityNotFound(_0x5bf57e,null))[_0x0ab4('0x28')](function(_0xa0f095){if(_0xa0f095){return _0xa0f095[_0x0ab4('0x6f')](_0x531a07['body']['ids'],_[_0x0ab4('0x70')](_0x531a07[_0x0ab4('0x71')],[_0x0ab4('0x72'),'id'])||{})[_0x0ab4('0x73')](function(_0x46f69a){for(var _0x1c8965=0x0;_0x1c8965<_0x531a07[_0x0ab4('0x71')]['ids'][_0x0ab4('0x49')];_0x1c8965+=0x1){socket['emit']('userVoicePrefix:save',{'UserId':Number(_0x531a07[_0x0ab4('0x71')]['ids'][_0x1c8965]),'VoicePrefixId':Number(_0x531a07[_0x0ab4('0x48')]['id'])});}return _0x46f69a;});}})[_0x0ab4('0x28')](respondWithResult(_0x5bf57e,null))[_0x0ab4('0x47')](handleError(_0x5bf57e,null));};exports[_0x0ab4('0x74')]=function(_0x1eec8e,_0x4bffd4,_0x586bd6){return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')]({'where':{'id':_0x1eec8e['params']['id']}})['then'](handleEntityNotFound(_0x4bffd4,null))[_0x0ab4('0x28')](function(_0x3e3ded){if(_0x3e3ded){return _0x3e3ded['removeAgents'](_0x1eec8e[_0x0ab4('0x34')][_0x0ab4('0x72')])[_0x0ab4('0x28')](function(){if(_['isArray'](_0x1eec8e[_0x0ab4('0x34')][_0x0ab4('0x72')])){for(var _0x2033fc=0x0;_0x2033fc<_0x1eec8e[_0x0ab4('0x34')]['ids'][_0x0ab4('0x49')];_0x2033fc+=0x1){socket[_0x0ab4('0x75')](_0x0ab4('0x76'),{'UserId':Number(_0x1eec8e[_0x0ab4('0x34')][_0x0ab4('0x72')][_0x2033fc]),'VoicePrefixId':Number(_0x1eec8e[_0x0ab4('0x48')]['id'])});}}else{socket[_0x0ab4('0x75')](_0x0ab4('0x76'),{'UserId':Number(_0x1eec8e[_0x0ab4('0x34')][_0x0ab4('0x72')]),'VoicePrefixId':Number(_0x1eec8e['params']['id'])});}});}})[_0x0ab4('0x28')](respondWithStatusCode(_0x4bffd4,null))[_0x0ab4('0x47')](handleError(_0x4bffd4,null));};exports[_0x0ab4('0x77')]=function(_0x78c98e,_0xb803f2,_0x5adfaa){var _0x448fcb={};var _0x88676f={};var _0xd916e0;var _0x28a722;return db[_0x0ab4('0x2e')][_0x0ab4('0x78')]({'where':{'id':_0x78c98e[_0x0ab4('0x48')]['id']}})[_0x0ab4('0x28')](handleEntityNotFound(_0xb803f2,null))[_0x0ab4('0x28')](function(_0x23968d){if(_0x23968d){_0xd916e0=_0x23968d;_0x88676f[_0x0ab4('0x37')]=_[_0x0ab4('0x35')](db[_0x0ab4('0x79')][_0x0ab4('0x2f')]);_0x88676f['query']=_[_0x0ab4('0x35')](_0x78c98e[_0x0ab4('0x34')]);_0x88676f[_0x0ab4('0x3f')]=_[_0x0ab4('0x36')](_0x88676f['model'],_0x88676f['query']);_0x448fcb[_0x0ab4('0x39')]=_[_0x0ab4('0x36')](_0x88676f['model'],qs[_0x0ab4('0x38')](_0x78c98e[_0x0ab4('0x34')][_0x0ab4('0x38')]));_0x448fcb[_0x0ab4('0x39')]=_0x448fcb[_0x0ab4('0x39')][_0x0ab4('0x49')]?_0x448fcb[_0x0ab4('0x39')]:_0x88676f['model'];_0x448fcb[_0x0ab4('0x3c')]=qs[_0x0ab4('0x3d')](_0x78c98e[_0x0ab4('0x34')][_0x0ab4('0x3d')]);_0x448fcb[_0x0ab4('0x3e')]=qs[_0x0ab4('0x3f')](_[_0x0ab4('0x40')](_0x78c98e[_0x0ab4('0x34')],_0x88676f[_0x0ab4('0x3f')]));if(_0x78c98e['query'][_0x0ab4('0x42')]){_0x448fcb['where']=_[_0x0ab4('0x41')](_0x448fcb[_0x0ab4('0x3e')],{'$or':_[_0x0ab4('0x33')](_0x448fcb[_0x0ab4('0x39')],function(_0x12ee59){var _0x76fa2={};_0x76fa2[_0x12ee59]={'$like':'%'+_0x78c98e['query']['filter']+'%'};return _0x76fa2;})});}_0x448fcb=_[_0x0ab4('0x41')]({},_0x448fcb,_0x78c98e[_0x0ab4('0x43')]);return _0xd916e0['getAgents'](_0x448fcb);}})['then'](function(_0x21f0a2){if(_0x21f0a2){_0x28a722=_0x21f0a2[_0x0ab4('0x49')];if(!_0x78c98e['query'][_0x0ab4('0x3a')](_0x0ab4('0x3b'))){_0x448fcb[_0x0ab4('0x1f')]=qs[_0x0ab4('0x1f')](_0x78c98e['query'][_0x0ab4('0x1f')]);_0x448fcb['offset']=qs['offset'](_0x78c98e[_0x0ab4('0x34')]['offset']);}return _0xd916e0[_0x0ab4('0x77')](_0x448fcb);}})[_0x0ab4('0x28')](function(_0xb1cac2){if(_0xb1cac2){return _0xb1cac2?{'count':_0x28a722,'rows':_0xb1cac2}:null;}})['then'](respondWithResult(_0xb803f2,null))[_0x0ab4('0x47')](handleError(_0xb803f2,null));};exports[_0x0ab4('0x7a')]=function(_0x840fc2,_0x2282d7,_0x2bf00c){var _0x37a592={};var _0x171969={};var _0x51f02a;var _0x2a25d5;return db['VoicePrefix'][_0x0ab4('0x78')]({'where':{'id':_0x840fc2['params']['id']}})['then'](handleEntityNotFound(_0x2282d7,null))[_0x0ab4('0x28')](function(_0x7ae8b2){if(_0x7ae8b2){_0x51f02a=_0x7ae8b2;_0x171969[_0x0ab4('0x37')]=_[_0x0ab4('0x35')](db[_0x0ab4('0x7b')]['rawAttributes']);_0x171969['query']=_[_0x0ab4('0x35')](_0x840fc2[_0x0ab4('0x34')]);_0x171969['filters']=_[_0x0ab4('0x36')](_0x171969['model'],_0x171969[_0x0ab4('0x34')]);_0x37a592[_0x0ab4('0x39')]=_['intersection'](_0x171969[_0x0ab4('0x37')],qs[_0x0ab4('0x38')](_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x38')]));_0x37a592['attributes']=_0x37a592['attributes'][_0x0ab4('0x49')]?_0x37a592[_0x0ab4('0x39')]:_0x171969[_0x0ab4('0x37')];_0x37a592['order']=qs[_0x0ab4('0x3d')](_0x840fc2['query'][_0x0ab4('0x3d')]);_0x37a592[_0x0ab4('0x3e')]=qs['filters'](_['pick'](_0x840fc2['query'],_0x171969[_0x0ab4('0x3f')]));if(_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x42')]){_0x37a592[_0x0ab4('0x3e')]=_[_0x0ab4('0x41')](_0x37a592['where'],{'$or':_[_0x0ab4('0x33')](_0x37a592[_0x0ab4('0x39')],function(_0x5e43fe){var _0xde4e2c={};_0xde4e2c[_0x5e43fe]={'$like':'%'+_0x840fc2[_0x0ab4('0x34')]['filter']+'%'};return _0xde4e2c;})});}_0x37a592=_[_0x0ab4('0x41')]({},_0x37a592,_0x840fc2[_0x0ab4('0x43')]);return _0x51f02a['getTeams'](_0x37a592);}})[_0x0ab4('0x28')](function(_0x213828){if(_0x213828){_0x2a25d5=_0x213828[_0x0ab4('0x49')];if(!_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x3a')](_0x0ab4('0x3b'))){_0x37a592[_0x0ab4('0x1f')]=qs[_0x0ab4('0x1f')](_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x1f')]);_0x37a592['offset']=qs[_0x0ab4('0x1e')](_0x840fc2[_0x0ab4('0x34')][_0x0ab4('0x1e')]);}return _0x51f02a[_0x0ab4('0x7a')](_0x37a592);}})[_0x0ab4('0x28')](function(_0x4a9e47){if(_0x4a9e47){return _0x4a9e47?{'count':_0x2a25d5,'rows':_0x4a9e47}:null;}})['then'](respondWithResult(_0x2282d7,null))[_0x0ab4('0x47')](handleError(_0x2282d7,null));};exports['addTeams']=function(_0x15e2f6,_0x3da0c1,_0x415e42){var _0x1effa7=_0x15e2f6['body'][_0x0ab4('0x72')];var _0x33c31a;return db[_0x0ab4('0x7b')][_0x0ab4('0x7c')]({'where':{'id':_0x1effa7},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0ab4('0x7d'),'attributes':['id',_0x0ab4('0x2d'),_0x0ab4('0x7e'),_0x0ab4('0x7f'),'interface'],'raw':!![]}]})['then'](function(_0x2c6284){if(_0x2c6284){_0x33c31a=_0x2c6284;var _0x272680=_[_0x0ab4('0x80')](_0x2c6284,function(_0x4e064a){var _0x29f715=_0x4e064a['get']({'plain':!![]});return _0x29f715[_0x0ab4('0x7d')];});return db[_0x0ab4('0x2e')][_0x0ab4('0x4a')]({'where':{'id':_0x15e2f6['params']['id']}})['then'](function(_0x1d9644){return db[_0x0ab4('0x4d')][_0x0ab4('0x4e')](function(_0xa094f5){return _0x1d9644['addTeams'](_0x1effa7,{'transaction':_0xa094f5})[_0x0ab4('0x28')](function(){return BPromise[_0x0ab4('0x81')](_0x33c31a,function(_0x45d3fa){return db[_0x0ab4('0x82')][_0x0ab4('0x83')]({'TeamId':_0x45d3fa['id'],'VoicePrefixId':_0x15e2f6[_0x0ab4('0x48')]['id']},{'transaction':_0xa094f5});});})[_0x0ab4('0x28')](function(){return BPromise[_0x0ab4('0x81')](_0x272680,function(_0x1d74f9){return db[_0x0ab4('0x84')][_0x0ab4('0x85')]({'where':{'UserId':_0x1d74f9['id'],'VoicePrefixId':_0x15e2f6[_0x0ab4('0x48')]['id']},'transaction':_0xa094f5});});})[_0x0ab4('0x28')](function(){_0x272680['forEach'](function(_0x3984a2){socket[_0x0ab4('0x75')](_0x0ab4('0x86'),{'UserId':_0x3984a2['id'],'VoicePrefixId':_0x1d9644['id']});});});});});}})[_0x0ab4('0x28')](respondWithStatusCode(_0x3da0c1,null))[_0x0ab4('0x47')](handleError(_0x3da0c1,null));};exports[_0x0ab4('0x87')]=function(_0x2ad3a9,_0x29f866,_0x182dfa){return db[_0x0ab4('0x7b')][_0x0ab4('0x7c')]({'where':{'id':_0x2ad3a9['query'][_0x0ab4('0x72')]},'attributes':['id'],'include':[{'model':db[_0x0ab4('0x79')],'as':_0x0ab4('0x7d'),'attributes':['id'],'raw':!![]}]})[_0x0ab4('0x28')](handleEntityNotFound(_0x29f866,null))[_0x0ab4('0x28')](function(_0x50b719){var _0x2fbbec=_['map'](_0x50b719,'id');var _0x4379f1=[];var _0x175a2a=[];var _0x332b1c=squel[_0x0ab4('0x88')]();_0x332b1c[_0x0ab4('0x89')]('tq.TeamId')[_0x0ab4('0x8a')](_0x0ab4('0x8b'),'tq')[_0x0ab4('0x8c')](_0x0ab4('0x8d'),'ut',_0x0ab4('0x8e'))['where'](_0x0ab4('0x8f'),_0x2ad3a9[_0x0ab4('0x48')]['id']);for(var _0x3acf39=0x0;_0x3acf39<_0x50b719[_0x0ab4('0x49')];_0x3acf39+=0x1){let _0x28bc17=_0x50b719[_0x3acf39];for(var _0x927d5=0x0;_0x927d5<_0x28bc17[_0x0ab4('0x7d')][_0x0ab4('0x49')];_0x927d5+=0x1){let _0x43fde8=_0x28bc17[_0x0ab4('0x7d')][_0x927d5];var _0x3791e6=_0x332b1c[_0x0ab4('0x90')]();_0x3791e6[_0x0ab4('0x3e')](_0x0ab4('0x91'),_0x43fde8['id']);_0x175a2a['push'](db['sequelize']['query'](_0x3791e6['toString'](),{'type':db[_0x0ab4('0x4d')][_0x0ab4('0x92')]['SELECT']})[_0x0ab4('0x28')](function(_0x19e3f9){if(_0x19e3f9['length']===0x1){return _0x43fde8['id'];}else{var _0x58e215=_[_0x0ab4('0x93')](_['map'](_0x19e3f9,_0x0ab4('0x94')),function(_0x22fb42){return _['includes'](_0x2fbbec,_0x22fb42);});if(_0x58e215){return _0x43fde8['id'];}}}));}}return BPromise[_0x0ab4('0x95')](_0x175a2a)[_0x0ab4('0x28')](function(_0x17fed9){_0x4379f1=_(_0x4379f1)[_0x0ab4('0x96')](_0x17fed9)[_0x0ab4('0x97')]()[_0x0ab4('0x98')]();return db['VoicePrefix'][_0x0ab4('0x4a')]({'where':{'id':_0x2ad3a9[_0x0ab4('0x48')]['id']}})[_0x0ab4('0x28')](function(_0x4148dd){return db[_0x0ab4('0x4d')]['transaction'](function(_0x1a8f36){return _0x4148dd[_0x0ab4('0x87')](_0x2ad3a9['query'][_0x0ab4('0x72')],{'transaction':_0x1a8f36})[_0x0ab4('0x28')](function(){if(!_[_0x0ab4('0x99')](_0x4379f1)){return _0x4148dd[_0x0ab4('0x74')](_0x4379f1,{'transaction':_0x1a8f36});}})[_0x0ab4('0x28')](function(){_0x4379f1[_0x0ab4('0x9a')](function(_0x4bc8ff){socket[_0x0ab4('0x75')](_0x0ab4('0x76'),{'UserId':_0x4bc8ff,'VoicePrefixId':_0x4148dd['id']});});});});});});})[_0x0ab4('0x28')](respondWithStatusCode(_0x29f866,null))[_0x0ab4('0x47')](handleError(_0x29f866,null));};
\ No newline at end of file
+var _0x757a=['create','transaction','VoiceExtension','VoiceExtensionId','user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','context','from-sip','exten','app','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','Extensions\x20creation\x20failed','push','CDR(prefix)=','Set','PREFIX-CALLERIDALL=','callerIdAll','${EXTEN:','charAt','update','body','system-','sequelize','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','findOne','User','pick','getAgents','getTeams','Team','addTeams','Agents','online','voicePause','interface','each','TeamVoicePrefix','upsert','UserVoicePrefix','forEach','removeTeams','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','get','UserProfileResource','error','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','find','destroy','params','describe'];(function(_0x50555f,_0x2a529d){var _0xe2173c=function(_0xb79f50){while(--_0xb79f50){_0x50555f['push'](_0x50555f['shift']());}};_0xe2173c(++_0x2a529d);}(_0x757a,0xde));var _0xa757=function(_0x38cf25,_0x33961d){_0x38cf25=_0x38cf25-0x0;var _0x46151c=_0x757a[_0x38cf25];return _0x46151c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa757('0x0'));var zipdir=require(_0xa757('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa757('0x2'));var Mustache=require(_0xa757('0x3'));var util=require(_0xa757('0x4'));var path=require(_0xa757('0x5'));var sox=require(_0xa757('0x6'));var csv=require(_0xa757('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa757('0x8'));var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0x7'));var querystring=require(_0xa757('0xd'));var Papa=require('papaparse');var Redis=require(_0xa757('0xe'));var authService=require(_0xa757('0xf'));var qs=require(_0xa757('0x10'));var as=require(_0xa757('0x11'));var hardwareService=require(_0xa757('0x12'));var logger=require(_0xa757('0x13'))(_0xa757('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xa757('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa757('0x16'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0xa757('0x17')](socket);function respondWithStatusCode(_0x1b670e,_0x355f0a){_0x355f0a=_0x355f0a||0xcc;return function(_0x4a0c38){if(_0x4a0c38){return _0x1b670e[_0xa757('0x18')](_0x355f0a);}return _0x1b670e[_0xa757('0x19')](_0x355f0a)[_0xa757('0x1a')]();};}function respondWithResult(_0x2f7947,_0x185011){_0x185011=_0x185011||0xc8;return function(_0x3df1f9){if(_0x3df1f9){return _0x2f7947['status'](_0x185011)[_0xa757('0x1b')](_0x3df1f9);}};}function respondWithFilteredResult(_0x44eab8,_0xde8248){return function(_0x4d9f58){if(_0x4d9f58){var _0x54b305=typeof _0xde8248[_0xa757('0x1c')]===_0xa757('0x1d')&&typeof _0xde8248[_0xa757('0x1e')]===_0xa757('0x1d');var _0x27f4ba=_0x4d9f58[_0xa757('0x1f')];var _0x4bd137=_0x54b305?0x0:_0xde8248[_0xa757('0x1c')];var _0x4fec52=_0x54b305?_0x4d9f58[_0xa757('0x1f')]:_0xde8248[_0xa757('0x1c')]+_0xde8248[_0xa757('0x1e')];var _0x2c9ec6;if(_0x4fec52>=_0x27f4ba){_0x4fec52=_0x27f4ba;_0x2c9ec6=0xc8;}else{_0x2c9ec6=0xce;}_0x44eab8['status'](_0x2c9ec6);return _0x44eab8['set'](_0xa757('0x20'),_0x4bd137+'-'+_0x4fec52+'/'+_0x27f4ba)[_0xa757('0x1b')](_0x4d9f58);}return null;};}function patchUpdates(_0x2ba923){return function(_0x8d121f){try{jsonpatch[_0xa757('0x21')](_0x8d121f,_0x2ba923,!![]);}catch(_0x40562f){return BPromise[_0xa757('0x22')](_0x40562f);}return _0x8d121f[_0xa757('0x23')]();};}function saveUpdates(_0x2bf276,_0x59fae6){return function(_0x3707c1){if(_0x3707c1){return _0x3707c1['update'](_0x2bf276)[_0xa757('0x24')](function(_0x47903b){return _0x47903b;});}return null;};}function removeEntity(_0x40551d,_0x3859ce){return function(_0x37c7e6){if(_0x37c7e6){return _0x37c7e6['destroy']()[_0xa757('0x24')](function(){var _0xcd98bd=_0x37c7e6[_0xa757('0x25')]({'plain':!![]});var _0x3bf7f3='VoicePrefixes';return db[_0xa757('0x26')]['destroy']({'where':{'type':_0x3bf7f3,'resourceId':_0xcd98bd['id']}})['then'](function(){return _0x37c7e6;});})['then'](function(){_0x40551d['status'](0xcc)[_0xa757('0x1a')]();});}};}function handleEntityNotFound(_0x596ae2,_0x2208f9){return function(_0x3bc24c){if(!_0x3bc24c){_0x596ae2['sendStatus'](0x194);}return _0x3bc24c;};}function handleError(_0x2a0c9a,_0x5119ad){_0x5119ad=_0x5119ad||0x1f4;return function(_0x2c4823){logger[_0xa757('0x27')](_0x2c4823['stack']);if(_0x2c4823[_0xa757('0x28')]){delete _0x2c4823['name'];}_0x2a0c9a[_0xa757('0x19')](_0x5119ad)[_0xa757('0x29')](_0x2c4823);};}exports[_0xa757('0x2a')]=function(_0x300dc4,_0xcc87c0){var _0x2c1885={},_0x1a44a9={},_0x2220df={'count':0x0,'rows':[]};var _0x112282=_[_0xa757('0x2b')](db[_0xa757('0x2c')][_0xa757('0x2d')],function(_0x25dfbb){return{'name':_0x25dfbb[_0xa757('0x2e')],'type':_0x25dfbb[_0xa757('0x2f')][_0xa757('0x30')]};});_0x1a44a9[_0xa757('0x31')]=_[_0xa757('0x2b')](_0x112282,_0xa757('0x28'));_0x1a44a9[_0xa757('0x32')]=_[_0xa757('0x33')](_0x300dc4[_0xa757('0x32')]);_0x1a44a9[_0xa757('0x34')]=_[_0xa757('0x35')](_0x1a44a9['model'],_0x1a44a9[_0xa757('0x32')]);_0x2c1885[_0xa757('0x36')]=_[_0xa757('0x35')](_0x1a44a9[_0xa757('0x31')],qs[_0xa757('0x37')](_0x300dc4['query'][_0xa757('0x37')]));_0x2c1885[_0xa757('0x36')]=_0x2c1885[_0xa757('0x36')][_0xa757('0x38')]?_0x2c1885[_0xa757('0x36')]:_0x1a44a9[_0xa757('0x31')];if(!_0x300dc4['query'][_0xa757('0x39')](_0xa757('0x3a'))){_0x2c1885[_0xa757('0x1e')]=qs[_0xa757('0x1e')](_0x300dc4[_0xa757('0x32')][_0xa757('0x1e')]);_0x2c1885[_0xa757('0x1c')]=qs[_0xa757('0x1c')](_0x300dc4[_0xa757('0x32')]['offset']);}_0x2c1885[_0xa757('0x3b')]=qs[_0xa757('0x3c')](_0x300dc4[_0xa757('0x32')][_0xa757('0x3c')]);_0x2c1885[_0xa757('0x3d')]=qs[_0xa757('0x34')](_['pick'](_0x300dc4[_0xa757('0x32')],_0x1a44a9[_0xa757('0x34')]),_0x112282);if(_0x300dc4['query']['filter']){_0x2c1885[_0xa757('0x3d')]=_[_0xa757('0x3e')](_0x2c1885['where'],{'$or':_['map'](_0x112282,function(_0xcff7c4){if(_0xcff7c4[_0xa757('0x2f')]!==_0xa757('0x3f')){var _0x59d699={};_0x59d699[_0xcff7c4[_0xa757('0x28')]]={'$like':'%'+_0x300dc4[_0xa757('0x32')][_0xa757('0x40')]+'%'};return _0x59d699;}})});}_0x2c1885=_[_0xa757('0x3e')]({},_0x2c1885,_0x300dc4[_0xa757('0x41')]);var _0x4c6639={'where':_0x2c1885[_0xa757('0x3d')]};return db['VoicePrefix']['count'](_0x4c6639)[_0xa757('0x24')](function(_0x57298b){_0x2220df[_0xa757('0x1f')]=_0x57298b;if(_0x300dc4[_0xa757('0x32')][_0xa757('0x42')]){_0x2c1885['include']=[{'all':!![]}];}return db['VoicePrefix'][_0xa757('0x43')](_0x2c1885);})[_0xa757('0x24')](function(_0x2b171c){_0x2220df[_0xa757('0x44')]=_0x2b171c;return _0x2220df;})[_0xa757('0x24')](respondWithFilteredResult(_0xcc87c0,_0x2c1885))[_0xa757('0x45')](handleError(_0xcc87c0,null));};exports['show']=function(_0xd61628,_0x364998){var _0x4d66d4={'raw':![],'where':{'id':_0xd61628['params']['id']}},_0x40e291={};_0x40e291[_0xa757('0x31')]=_[_0xa757('0x33')](db['VoicePrefix'][_0xa757('0x2d')]);_0x40e291[_0xa757('0x32')]=_['keys'](_0xd61628[_0xa757('0x32')]);_0x40e291[_0xa757('0x34')]=_[_0xa757('0x35')](_0x40e291[_0xa757('0x31')],_0x40e291['query']);_0x4d66d4[_0xa757('0x36')]=_[_0xa757('0x35')](_0x40e291[_0xa757('0x31')],qs[_0xa757('0x37')](_0xd61628['query'][_0xa757('0x37')]));_0x4d66d4['attributes']=_0x4d66d4['attributes'][_0xa757('0x38')]?_0x4d66d4[_0xa757('0x36')]:_0x40e291[_0xa757('0x31')];if(_0xd61628['query'][_0xa757('0x42')]){_0x4d66d4['include']=[{'all':!![]}];}_0x4d66d4=_[_0xa757('0x3e')]({},_0x4d66d4,_0xd61628[_0xa757('0x41')]);return db[_0xa757('0x2c')][_0xa757('0x46')](_0x4d66d4)[_0xa757('0x24')](handleEntityNotFound(_0x364998,null))[_0xa757('0x24')](respondWithResult(_0x364998,null))[_0xa757('0x45')](handleError(_0x364998,null));};exports[_0xa757('0x47')]=function(_0x581e95,_0x2de226){return db[_0xa757('0x2c')][_0xa757('0x46')]({'where':{'id':_0x581e95[_0xa757('0x48')]['id']}})[_0xa757('0x24')](handleEntityNotFound(_0x2de226,null))[_0xa757('0x24')](removeEntity(_0x2de226,null))[_0xa757('0x45')](handleError(_0x2de226,null));};exports[_0xa757('0x49')]=function(_0x405397,_0x1d05d7){return db[_0xa757('0x2c')][_0xa757('0x49')]()[_0xa757('0x24')](respondWithResult(_0x1d05d7,null))[_0xa757('0x45')](handleError(_0x1d05d7,null));};exports[_0xa757('0x4a')]=function(_0x23caca,_0x492e7e){var _0x3b5116;return db['sequelize'][_0xa757('0x4b')](function(_0x311c25){return db[_0xa757('0x2c')][_0xa757('0x4a')](_0x23caca['body'],{'transaction':_0x311c25})[_0xa757('0x24')](function(_0x1ee01e){_0x3b5116=_0x1ee01e[_0xa757('0x25')]({'plain':!![]});return db[_0xa757('0x4c')]['find']({'where':{'id':_0x3b5116[_0xa757('0x4d')]},'raw':!![]})[_0xa757('0x24')](function(_0x216b32){return createVoicePrefixExtensions(_0x3b5116,_0x216b32,_0x311c25);});});})[_0xa757('0x24')](function(){var _0x33666d=_0x23caca[_0xa757('0x4e')]['get']({'plain':!![]});if(!_0x33666d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x33666d['role']==='user'){var _0x1d8742=_0x3b5116;return db[_0xa757('0x4f')][_0xa757('0x46')]({'where':{'name':_0xa757('0x50'),'userProfileId':_0x33666d[_0xa757('0x51')]},'raw':!![]})[_0xa757('0x24')](function(_0x5efb32){if(_0x5efb32&&_0x5efb32[_0xa757('0x52')]===0x0){return db[_0xa757('0x26')][_0xa757('0x4a')]({'name':_0x1d8742[_0xa757('0x28')],'resourceId':_0x1d8742['id'],'type':_0x5efb32['name'],'sectionId':_0x5efb32['id']},{})[_0xa757('0x24')](function(){return _0x3b5116;});}else{return _0x3b5116;}})[_0xa757('0x45')](function(_0x4af840){logger[_0xa757('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4af840);throw _0x4af840;});}return _0x3b5116;})[_0xa757('0x24')](respondWithResult(_0x492e7e,null))['catch'](handleError(_0x492e7e,null));};function Extension(_0x51be6e,_0x58633a,_0x4badee,_0x367b48){this[_0xa757('0x53')]=_0xa757('0x54');this[_0xa757('0x55')]=_0x51be6e;this[_0xa757('0x56')]=_0x4badee;this[_0xa757('0x2f')]='system';this['description']=_0xa757('0x57');this[_0xa757('0x58')]=_0x58633a;this[_0xa757('0x59')]=_0x367b48;}function createVoicePrefixExtensions(_0x4a5ad5,_0x55a7d2,_0x18dff7){return new BPromise(function(_0x31c4cd,_0x215a80){var _0x504c4f=new Extension(formatPrefixName(_0x4a5ad5[_0xa757('0x5a')]),0x1,_0xa757('0x5b'),'Voice\x20Prefix');_0x504c4f[_0xa757('0x5c')]=_0x4a5ad5['id'];return db[_0xa757('0x4c')][_0xa757('0x4a')](_0x504c4f,{'transaction':_0x18dff7})[_0xa757('0x24')](function(_0x1291df){var _0xfbcb43=_0x1291df[_0xa757('0x25')]({'plain':!![]});var _0x13dd81=_[_0xa757('0x2b')](addVoicePrefixExtensions(_0x4a5ad5,_0x55a7d2),function(_0x3b1bb8){_0x3b1bb8['VoiceExtensionId']=_0xfbcb43['id'];_0x3b1bb8[_0xa757('0x5c')]=_0x4a5ad5['id'];return _0x3b1bb8;});return db['VoiceExtension']['bulkCreate'](_0x13dd81,{'transaction':_0x18dff7})[_0xa757('0x24')](function(_0x3da8c1){if(!_0x3da8c1){return _0x215a80(_0xa757('0x5d'));}else{return _0x31c4cd(_0x3da8c1);}})[_0xa757('0x45')](function(_0x3c3ff1){return _0x215a80(_0x3c3ff1);});});;});};function addVoicePrefixExtensions(_0x3672a7,_0x1b34ad){var _0x32e0b9=[];var _0x13e584=formatPrefixName(_0x3672a7[_0xa757('0x5a')]);_0x32e0b9[_0xa757('0x5e')](new Extension(_0x13e584,0x2,'Set',_0xa757('0x5f')+_0x3672a7[_0xa757('0x28')]));if(_0x3672a7['callerIdAll']){_0x32e0b9[_0xa757('0x5e')](new Extension(_0x13e584,0x3,_0xa757('0x60'),_0xa757('0x61')+_0x3672a7[_0xa757('0x62')]));}else{_0x32e0b9[_0xa757('0x5e')](new Extension(_0x13e584,0x3,_0xa757('0x5b'),'No\x20callerid\x20available'));}_0x32e0b9[_0xa757('0x5e')](new Extension(_0x13e584,0x4,'goto',_0x1b34ad[_0xa757('0x53')]+','+_0xa757('0x63')+(0x8+_0x3672a7[_0xa757('0x28')][_0xa757('0x38')])+'}'+','+0x1));return _0x32e0b9;}function formatPrefixName(_0x39ca41){var _0x5c0870='_';for(var _0x57ec52=0x0;_0x57ec52<_0x39ca41[_0xa757('0x38')];_0x57ec52++){if(_0x39ca41[_0xa757('0x64')](_0x57ec52)=='-'){_0x5c0870+=_0x39ca41[_0xa757('0x64')](_0x57ec52);}else{_0x5c0870+='['+_0x39ca41['charAt'](_0x57ec52)+']';}}_0x5c0870+='.';return _0x5c0870;}exports[_0xa757('0x65')]=function(_0x55bc0f,_0x34982a,_0x294165){var _0x2b0ad4=_0x55bc0f[_0xa757('0x66')];_0x2b0ad4[_0xa757('0x5a')]=_0xa757('0x67')+_0x2b0ad4['name']+'-';return db[_0xa757('0x68')][_0xa757('0x4b')](function(_0x1e15ee){return db[_0xa757('0x2c')][_0xa757('0x65')](_0x2b0ad4,{'where':{'id':_0x2b0ad4['id']},'transaction':_0x1e15ee})['then'](function(){return db[_0xa757('0x4c')][_0xa757('0x47')]({'where':{'VoicePrefixId':_0x2b0ad4['id']},'transaction':_0x1e15ee})[_0xa757('0x24')](function(){return db[_0xa757('0x4c')][_0xa757('0x46')]({'where':{'id':_0x2b0ad4['VoiceExtensionId']},'raw':!![]})[_0xa757('0x24')](function(_0x1c6287){return createVoicePrefixExtensions(_0x2b0ad4,_0x1c6287,_0x1e15ee);});});});})[_0xa757('0x24')](function(){return db['VoicePrefix'][_0xa757('0x69')](_0x2b0ad4['id']);})[_0xa757('0x24')](respondWithResult(_0x34982a,null))[_0xa757('0x45')](handleError(_0x34982a,null));};exports[_0xa757('0x6a')]=function(_0x78511f,_0x4695ef,_0x19ff32){return db[_0xa757('0x2c')][_0xa757('0x46')]({'where':{'id':_0x78511f[_0xa757('0x48')]['id']}})[_0xa757('0x24')](handleEntityNotFound(_0x4695ef,null))[_0xa757('0x24')](function(_0x47425b){if(_0x47425b){return _0x47425b[_0xa757('0x6a')](_0x78511f['body'][_0xa757('0x6b')],_[_0xa757('0x6c')](_0x78511f['body'],[_0xa757('0x6b'),'id'])||{})[_0xa757('0x6d')](function(_0x505bd6){for(var _0x29aea2=0x0;_0x29aea2<_0x78511f[_0xa757('0x66')][_0xa757('0x6b')][_0xa757('0x38')];_0x29aea2+=0x1){socket[_0xa757('0x6e')](_0xa757('0x6f'),{'UserId':Number(_0x78511f[_0xa757('0x66')][_0xa757('0x6b')][_0x29aea2]),'VoicePrefixId':Number(_0x78511f[_0xa757('0x48')]['id'])});}return _0x505bd6;});}})[_0xa757('0x24')](respondWithResult(_0x4695ef,null))[_0xa757('0x45')](handleError(_0x4695ef,null));};exports[_0xa757('0x70')]=function(_0x2c2b40,_0x46bc34,_0x27604c){return db[_0xa757('0x2c')]['find']({'where':{'id':_0x2c2b40[_0xa757('0x48')]['id']}})['then'](handleEntityNotFound(_0x46bc34,null))[_0xa757('0x24')](function(_0x20c444){if(_0x20c444){return _0x20c444[_0xa757('0x70')](_0x2c2b40[_0xa757('0x32')][_0xa757('0x6b')])['then'](function(){if(_[_0xa757('0x71')](_0x2c2b40[_0xa757('0x32')][_0xa757('0x6b')])){for(var _0x4a691d=0x0;_0x4a691d<_0x2c2b40[_0xa757('0x32')][_0xa757('0x6b')][_0xa757('0x38')];_0x4a691d+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x2c2b40[_0xa757('0x32')][_0xa757('0x6b')][_0x4a691d]),'VoicePrefixId':Number(_0x2c2b40[_0xa757('0x48')]['id'])});}}else{socket['emit'](_0xa757('0x72'),{'UserId':Number(_0x2c2b40['query']['ids']),'VoicePrefixId':Number(_0x2c2b40[_0xa757('0x48')]['id'])});}});}})[_0xa757('0x24')](respondWithStatusCode(_0x46bc34,null))[_0xa757('0x45')](handleError(_0x46bc34,null));};exports['getAgents']=function(_0x2a1c30,_0x1f85b,_0x17accd){var _0x199f75={};var _0x3e5cf5={};var _0x2d0ce0;var _0x26dcec;return db[_0xa757('0x2c')][_0xa757('0x73')]({'where':{'id':_0x2a1c30[_0xa757('0x48')]['id']}})[_0xa757('0x24')](handleEntityNotFound(_0x1f85b,null))[_0xa757('0x24')](function(_0x5a7042){if(_0x5a7042){_0x2d0ce0=_0x5a7042;_0x3e5cf5[_0xa757('0x31')]=_[_0xa757('0x33')](db[_0xa757('0x74')][_0xa757('0x2d')]);_0x3e5cf5[_0xa757('0x32')]=_[_0xa757('0x33')](_0x2a1c30[_0xa757('0x32')]);_0x3e5cf5[_0xa757('0x34')]=_[_0xa757('0x35')](_0x3e5cf5[_0xa757('0x31')],_0x3e5cf5[_0xa757('0x32')]);_0x199f75[_0xa757('0x36')]=_[_0xa757('0x35')](_0x3e5cf5[_0xa757('0x31')],qs[_0xa757('0x37')](_0x2a1c30[_0xa757('0x32')][_0xa757('0x37')]));_0x199f75[_0xa757('0x36')]=_0x199f75[_0xa757('0x36')][_0xa757('0x38')]?_0x199f75[_0xa757('0x36')]:_0x3e5cf5[_0xa757('0x31')];_0x199f75['order']=qs[_0xa757('0x3c')](_0x2a1c30[_0xa757('0x32')]['sort']);_0x199f75[_0xa757('0x3d')]=qs['filters'](_[_0xa757('0x75')](_0x2a1c30[_0xa757('0x32')],_0x3e5cf5['filters']));if(_0x2a1c30[_0xa757('0x32')][_0xa757('0x40')]){_0x199f75[_0xa757('0x3d')]=_[_0xa757('0x3e')](_0x199f75['where'],{'$or':_[_0xa757('0x2b')](_0x199f75[_0xa757('0x36')],function(_0x4bf5c2){var _0x30716a={};_0x30716a[_0x4bf5c2]={'$like':'%'+_0x2a1c30[_0xa757('0x32')]['filter']+'%'};return _0x30716a;})});}_0x199f75=_[_0xa757('0x3e')]({},_0x199f75,_0x2a1c30[_0xa757('0x41')]);return _0x2d0ce0[_0xa757('0x76')](_0x199f75);}})[_0xa757('0x24')](function(_0x7d106e){if(_0x7d106e){_0x26dcec=_0x7d106e[_0xa757('0x38')];if(!_0x2a1c30[_0xa757('0x32')][_0xa757('0x39')](_0xa757('0x3a'))){_0x199f75['limit']=qs['limit'](_0x2a1c30[_0xa757('0x32')][_0xa757('0x1e')]);_0x199f75[_0xa757('0x1c')]=qs[_0xa757('0x1c')](_0x2a1c30[_0xa757('0x32')][_0xa757('0x1c')]);}return _0x2d0ce0[_0xa757('0x76')](_0x199f75);}})['then'](function(_0x4603f3){if(_0x4603f3){return _0x4603f3?{'count':_0x26dcec,'rows':_0x4603f3}:null;}})['then'](respondWithResult(_0x1f85b,null))[_0xa757('0x45')](handleError(_0x1f85b,null));};exports[_0xa757('0x77')]=function(_0x365a0d,_0x1b8444,_0x9723da){var _0x558b86={};var _0x3fa436={};var _0x4cb547;var _0x2d1113;return db[_0xa757('0x2c')][_0xa757('0x73')]({'where':{'id':_0x365a0d[_0xa757('0x48')]['id']}})['then'](handleEntityNotFound(_0x1b8444,null))[_0xa757('0x24')](function(_0x1975a3){if(_0x1975a3){_0x4cb547=_0x1975a3;_0x3fa436[_0xa757('0x31')]=_[_0xa757('0x33')](db[_0xa757('0x78')][_0xa757('0x2d')]);_0x3fa436[_0xa757('0x32')]=_[_0xa757('0x33')](_0x365a0d['query']);_0x3fa436[_0xa757('0x34')]=_[_0xa757('0x35')](_0x3fa436[_0xa757('0x31')],_0x3fa436[_0xa757('0x32')]);_0x558b86['attributes']=_[_0xa757('0x35')](_0x3fa436[_0xa757('0x31')],qs[_0xa757('0x37')](_0x365a0d[_0xa757('0x32')][_0xa757('0x37')]));_0x558b86[_0xa757('0x36')]=_0x558b86[_0xa757('0x36')]['length']?_0x558b86['attributes']:_0x3fa436[_0xa757('0x31')];_0x558b86['order']=qs[_0xa757('0x3c')](_0x365a0d['query']['sort']);_0x558b86[_0xa757('0x3d')]=qs[_0xa757('0x34')](_[_0xa757('0x75')](_0x365a0d[_0xa757('0x32')],_0x3fa436[_0xa757('0x34')]));if(_0x365a0d[_0xa757('0x32')][_0xa757('0x40')]){_0x558b86[_0xa757('0x3d')]=_[_0xa757('0x3e')](_0x558b86[_0xa757('0x3d')],{'$or':_['map'](_0x558b86[_0xa757('0x36')],function(_0x5b37f0){var _0x221e5b={};_0x221e5b[_0x5b37f0]={'$like':'%'+_0x365a0d[_0xa757('0x32')][_0xa757('0x40')]+'%'};return _0x221e5b;})});}_0x558b86=_[_0xa757('0x3e')]({},_0x558b86,_0x365a0d['options']);return _0x4cb547[_0xa757('0x77')](_0x558b86);}})[_0xa757('0x24')](function(_0x3e097b){if(_0x3e097b){_0x2d1113=_0x3e097b[_0xa757('0x38')];if(!_0x365a0d[_0xa757('0x32')][_0xa757('0x39')](_0xa757('0x3a'))){_0x558b86[_0xa757('0x1e')]=qs[_0xa757('0x1e')](_0x365a0d[_0xa757('0x32')][_0xa757('0x1e')]);_0x558b86[_0xa757('0x1c')]=qs[_0xa757('0x1c')](_0x365a0d[_0xa757('0x32')][_0xa757('0x1c')]);}return _0x4cb547['getTeams'](_0x558b86);}})['then'](function(_0x1176d5){if(_0x1176d5){return _0x1176d5?{'count':_0x2d1113,'rows':_0x1176d5}:null;}})['then'](respondWithResult(_0x1b8444,null))[_0xa757('0x45')](handleError(_0x1b8444,null));};exports[_0xa757('0x79')]=function(_0x2edad2,_0x1d03a7,_0x48c52f){var _0x33995b=_0x2edad2[_0xa757('0x66')][_0xa757('0x6b')];var _0x2f0ec5;return db[_0xa757('0x78')][_0xa757('0x43')]({'where':{'id':_0x33995b},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa757('0x7a'),'attributes':['id',_0xa757('0x28'),_0xa757('0x7b'),_0xa757('0x7c'),_0xa757('0x7d')],'raw':!![]}]})['then'](function(_0x4b022c){if(_0x4b022c){_0x2f0ec5=_0x4b022c;var _0x26954d=_['flatMap'](_0x4b022c,function(_0x2b177c){var _0x55e4e5=_0x2b177c[_0xa757('0x25')]({'plain':!![]});return _0x55e4e5[_0xa757('0x7a')];});return db[_0xa757('0x2c')][_0xa757('0x46')]({'where':{'id':_0x2edad2[_0xa757('0x48')]['id']}})[_0xa757('0x24')](function(_0x2fb515){return db[_0xa757('0x68')][_0xa757('0x4b')](function(_0x1a4911){return _0x2fb515[_0xa757('0x79')](_0x33995b,{'transaction':_0x1a4911})['then'](function(){return BPromise[_0xa757('0x7e')](_0x2f0ec5,function(_0x38a6db){return db[_0xa757('0x7f')][_0xa757('0x80')]({'TeamId':_0x38a6db['id'],'VoicePrefixId':_0x2edad2[_0xa757('0x48')]['id']},{'transaction':_0x1a4911});});})[_0xa757('0x24')](function(){return BPromise['each'](_0x26954d,function(_0x30439a){return db[_0xa757('0x81')]['findOrCreate']({'where':{'UserId':_0x30439a['id'],'VoicePrefixId':_0x2edad2[_0xa757('0x48')]['id']},'transaction':_0x1a4911});});})[_0xa757('0x24')](function(){_0x26954d[_0xa757('0x82')](function(_0x5e6171){socket[_0xa757('0x6e')](_0xa757('0x6f'),{'UserId':_0x5e6171['id'],'VoicePrefixId':_0x2fb515['id']});});});});});}})[_0xa757('0x24')](respondWithStatusCode(_0x1d03a7,null))[_0xa757('0x45')](handleError(_0x1d03a7,null));};exports[_0xa757('0x83')]=function(_0x5b9be2,_0x16fdb7,_0x5ddcab){return db['Team'][_0xa757('0x43')]({'where':{'id':_0x5b9be2['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xa757('0x74')],'as':_0xa757('0x7a'),'attributes':['id'],'raw':!![]}]})[_0xa757('0x24')](handleEntityNotFound(_0x16fdb7,null))[_0xa757('0x24')](function(_0x168313){var _0x2ed413=_['map'](_0x168313,'id');var _0x59e5c8=[];var _0x556b78=[];var _0x4b4a87=squel['select']();_0x4b4a87['field']('tq.TeamId')[_0xa757('0x84')]('team_has_voice_prefixes','tq')[_0xa757('0x85')](_0xa757('0x86'),'ut',_0xa757('0x87'))[_0xa757('0x3d')](_0xa757('0x88'),_0x5b9be2[_0xa757('0x48')]['id']);for(var _0x399952=0x0;_0x399952<_0x168313[_0xa757('0x38')];_0x399952+=0x1){let _0x1b1524=_0x168313[_0x399952];for(var _0x49f3fe=0x0;_0x49f3fe<_0x1b1524['Agents'][_0xa757('0x38')];_0x49f3fe+=0x1){let _0x3147eb=_0x1b1524[_0xa757('0x7a')][_0x49f3fe];var _0x2a7147=_0x4b4a87['clone']();_0x2a7147[_0xa757('0x3d')](_0xa757('0x89'),_0x3147eb['id']);_0x556b78[_0xa757('0x5e')](db[_0xa757('0x68')][_0xa757('0x32')](_0x2a7147[_0xa757('0x8a')](),{'type':db[_0xa757('0x68')]['QueryTypes'][_0xa757('0x8b')]})[_0xa757('0x24')](function(_0x494735){if(_0x494735[_0xa757('0x38')]===0x1){return _0x3147eb['id'];}else{var _0x3924af=_[_0xa757('0x8c')](_[_0xa757('0x2b')](_0x494735,_0xa757('0x8d')),function(_0x5d0701){return _[_0xa757('0x8e')](_0x2ed413,_0x5d0701);});if(_0x3924af){return _0x3147eb['id'];}}}));}}return BPromise[_0xa757('0x8f')](_0x556b78)[_0xa757('0x24')](function(_0x5081a0){_0x59e5c8=_(_0x59e5c8)[_0xa757('0x90')](_0x5081a0)[_0xa757('0x91')]()[_0xa757('0x92')]();return db['VoicePrefix'][_0xa757('0x46')]({'where':{'id':_0x5b9be2[_0xa757('0x48')]['id']}})[_0xa757('0x24')](function(_0x41b710){return db[_0xa757('0x68')]['transaction'](function(_0x2dcc43){return _0x41b710['removeTeams'](_0x5b9be2['query'][_0xa757('0x6b')],{'transaction':_0x2dcc43})[_0xa757('0x24')](function(){if(!_[_0xa757('0x93')](_0x59e5c8)){return _0x41b710[_0xa757('0x70')](_0x59e5c8,{'transaction':_0x2dcc43});}})['then'](function(){_0x59e5c8[_0xa757('0x82')](function(_0x36c462){socket[_0xa757('0x6e')](_0xa757('0x72'),{'UserId':_0x36c462,'VoicePrefixId':_0x41b710['id']});});});});});});})[_0xa757('0x24')](respondWithStatusCode(_0x16fdb7,null))[_0xa757('0x45')](handleError(_0x16fdb7,null));};
\ No newline at end of file
index a9767ab..4fb9b3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac5a=['update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0xac5a,0xdd));var _0xaac5=function(_0x5ac1e5,_0x4b5012){_0x5ac1e5=_0x5ac1e5-0x0;var _0x1bccc6=_0xac5a[_0x5ac1e5];return _0x1bccc6;};'use strict';var EventEmitter=require(_0xaac5('0x0'));var VoicePrefix=require(_0xaac5('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xaac5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaac5('0x3'),'afterDestroy':_0xaac5('0x4')};function emitEvent(_0x9478de){return function(_0x5baeb6,_0x2c9f0e,_0x25e66c){VoicePrefixEvents[_0xaac5('0x5')](_0x9478de+':'+_0x5baeb6['id'],_0x5baeb6);VoicePrefixEvents['emit'](_0x9478de,_0x5baeb6);_0x25e66c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0xaac5('0x6')](e,emitEvent(event));}}module[_0xaac5('0x7')]=VoicePrefixEvents;
\ No newline at end of file
+var _0x0870=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x359bdd,_0x5a32a3){var _0x5805b9=function(_0x3e1180){while(--_0x3e1180){_0x359bdd['push'](_0x359bdd['shift']());}};_0x5805b9(++_0x5a32a3);}(_0x0870,0xd8));var _0x0087=function(_0x352e30,_0x496162){_0x352e30=_0x352e30-0x0;var _0x183096=_0x0870[_0x352e30];return _0x183096;};'use strict';var EventEmitter=require(_0x0087('0x0'));var VoicePrefix=require(_0x0087('0x1'))['db'][_0x0087('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x0087('0x3')](0x0);var events={'afterCreate':_0x0087('0x4'),'afterUpdate':_0x0087('0x5'),'afterDestroy':_0x0087('0x6')};function emitEvent(_0x38816e){return function(_0x225932,_0x4a8431,_0x2afd78){VoicePrefixEvents[_0x0087('0x7')](_0x38816e+':'+_0x225932['id'],_0x225932);VoicePrefixEvents[_0x0087('0x7')](_0x38816e,_0x225932);_0x2afd78(null);};}for(var e in events){if(events[_0x0087('0x8')](e)){var event=events[e];VoicePrefix[_0x0087('0x9')](e,emitEvent(event));}}module[_0x0087('0xa')]=VoicePrefixEvents;
\ No newline at end of file
index 6355316..fd7bb31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bfd=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash'];(function(_0x59f92b,_0x112c77){var _0x3b8d18=function(_0x16b49d){while(--_0x16b49d){_0x59f92b['push'](_0x59f92b['shift']());}};_0x3b8d18(++_0x112c77);}(_0x9bfd,0xed));var _0xd9bf=function(_0x4aa790,_0xd339d7){_0x4aa790=_0x4aa790-0x0;var _0x247a21=_0x9bfd[_0x4aa790];return _0x247a21;};'use strict';var _=require(_0xd9bf('0x0'));var util=require('util');var logger=require(_0xd9bf('0x1'))(_0xd9bf('0x2'));var moment=require(_0xd9bf('0x3'));var BPromise=require(_0xd9bf('0x4'));var rp=require(_0xd9bf('0x5'));var fs=require('fs');var path=require(_0xd9bf('0x6'));var rimraf=require(_0xd9bf('0x7'));var config=require(_0xd9bf('0x8'));var attributes=require(_0xd9bf('0x9'));module[_0xd9bf('0xa')]=function(_0x180c8b,_0x537b3b){return _0x180c8b[_0xd9bf('0xb')](_0xd9bf('0xc'),attributes,{'tableName':_0xd9bf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x76b2=['api','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0x76b2,0x1dd));var _0x276b=function(_0x203579,_0x237a5a){_0x203579=_0x203579-0x0;var _0x66dbd1=_0x76b2[_0x203579];return _0x66dbd1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x276b('0x0'));var moment=require('moment');var BPromise=require(_0x276b('0x1'));var rp=require(_0x276b('0x2'));var fs=require('fs');var path=require(_0x276b('0x3'));var rimraf=require(_0x276b('0x4'));var config=require(_0x276b('0x5'));var attributes=require(_0x276b('0x6'));module[_0x276b('0x7')]=function(_0x3c070d,_0x5a3c0c){return _0x3c070d['define'](_0x276b('0x8'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e751346..87f1aa7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cb7=['http','redis','defaults','localhost','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0x3cb7,0xcf));var _0x73cb=function(_0x3cb21e,_0x11849a){_0x3cb21e=_0x3cb21e-0x0;var _0xeacd6a=_0x3cb7[_0x3cb21e];return _0xeacd6a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x73cb('0x0'));var BPromise=require('bluebird');var rs=require(_0x73cb('0x1'));var fs=require('fs');var Redis=require(_0x73cb('0x2'));var db=require(_0x73cb('0x3'))['db'];var utils=require(_0x73cb('0x4'));var logger=require(_0x73cb('0x5'))(_0x73cb('0x6'));var config=require(_0x73cb('0x7'));var jayson=require(_0x73cb('0x8'));var client=jayson['client'][_0x73cb('0x9')]({'port':0x232a});config[_0x73cb('0xa')]=_[_0x73cb('0xb')](config[_0x73cb('0xa')],{'host':_0x73cb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73cb('0xa')]));require(_0x73cb('0xd'))[_0x73cb('0xe')](socket);function respondWithRpcPromise(_0x29deae,_0x1826dd,_0xc1a63e){return new BPromise(function(_0x43eab2,_0x501542){return client[_0x73cb('0xf')](_0x29deae,_0xc1a63e)[_0x73cb('0x10')](function(_0x35900e){logger[_0x73cb('0x11')](_0x73cb('0x12'),_0x1826dd,_0x73cb('0x13'));logger['debug'](_0x73cb('0x14'),_0x1826dd,_0x73cb('0x13'),JSON[_0x73cb('0x15')](_0x35900e));if(_0x35900e[_0x73cb('0x16')]){if(_0x35900e[_0x73cb('0x16')][_0x73cb('0x17')]===0x1f4){logger[_0x73cb('0x16')](_0x73cb('0x12'),_0x1826dd,_0x35900e[_0x73cb('0x16')][_0x73cb('0x18')]);return _0x501542(_0x35900e['error']['message']);}logger['error'](_0x73cb('0x12'),_0x1826dd,_0x35900e[_0x73cb('0x16')][_0x73cb('0x18')]);return _0x43eab2(_0x35900e[_0x73cb('0x16')][_0x73cb('0x18')]);}else{logger['info'](_0x73cb('0x12'),_0x1826dd,_0x73cb('0x13'));_0x43eab2(_0x35900e[_0x73cb('0x19')][_0x73cb('0x18')]);}})[_0x73cb('0x1a')](function(_0x28ee3b){logger[_0x73cb('0x16')](_0x73cb('0x12'),_0x1826dd,_0x28ee3b);_0x501542(_0x28ee3b);});});}
\ No newline at end of file
+var _0xf31b=['then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','request'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xf31b,0x1a0));var _0xbf31=function(_0x32a176,_0x4959ca){_0x32a176=_0x32a176-0x0;var _0x57aacd=_0xf31b[_0x32a176];return _0x57aacd;};'use strict';var _=require(_0xbf31('0x0'));var util=require(_0xbf31('0x1'));var moment=require(_0xbf31('0x2'));var BPromise=require(_0xbf31('0x3'));var rs=require(_0xbf31('0x4'));var fs=require('fs');var Redis=require(_0xbf31('0x5'));var db=require(_0xbf31('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbf31('0x7'))(_0xbf31('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbf31('0x9')]['http']({'port':0x232a});config[_0xbf31('0xa')]=_[_0xbf31('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbf31('0xc'))(new Redis(config['redis']));require(_0xbf31('0xd'))[_0xbf31('0xe')](socket);function respondWithRpcPromise(_0x11cdd6,_0x1cf8cc,_0x132946){return new BPromise(function(_0x77d991,_0x45df48){return client[_0xbf31('0xf')](_0x11cdd6,_0x132946)[_0xbf31('0x10')](function(_0x1e175d){logger[_0xbf31('0x11')](_0xbf31('0x12'),_0x1cf8cc,_0xbf31('0x13'));logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x1cf8cc,'request\x20sent',JSON['stringify'](_0x1e175d));if(_0x1e175d[_0xbf31('0x14')]){if(_0x1e175d[_0xbf31('0x14')][_0xbf31('0x15')]===0x1f4){logger[_0xbf31('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x1cf8cc,_0x1e175d['error'][_0xbf31('0x16')]);return _0x45df48(_0x1e175d[_0xbf31('0x14')][_0xbf31('0x16')]);}logger[_0xbf31('0x14')](_0xbf31('0x12'),_0x1cf8cc,_0x1e175d['error'][_0xbf31('0x16')]);return _0x77d991(_0x1e175d['error']['message']);}else{logger[_0xbf31('0x11')](_0xbf31('0x12'),_0x1cf8cc,_0xbf31('0x13'));_0x77d991(_0x1e175d[_0xbf31('0x17')][_0xbf31('0x16')]);}})['catch'](function(_0x492ac3){logger[_0xbf31('0x14')](_0xbf31('0x12'),_0x1cf8cc,_0x492ac3);_0x45df48(_0x492ac3);});});}
\ No newline at end of file
index 0d3d664..128a30a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cbd=['./voicePrefix.events','save','update','emit','register','voicePrefix:'];(function(_0x9c6bf1,_0x534a08){var _0x35c8ad=function(_0x46c4db){while(--_0x46c4db){_0x9c6bf1['push'](_0x9c6bf1['shift']());}};_0x35c8ad(++_0x534a08);}(_0x2cbd,0x19e));var _0xd2cb=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x2cbd[_0x387777];return _0x3f84c0;};'use strict';var VoicePrefixEvents=require(_0xd2cb('0x0'));var events=[_0xd2cb('0x1'),'remove',_0xd2cb('0x2')];function createListener(_0x34564b,_0x138022){return function(_0x4b1b3f){_0x138022[_0xd2cb('0x3')](_0x34564b,_0x4b1b3f);};}function removeListener(_0x3fe222,_0x480683){return function(){VoicePrefixEvents['removeListener'](_0x3fe222,_0x480683);};}exports[_0xd2cb('0x4')]=function(_0x20ff39){for(var _0x3894f9=0x0,_0x1ae725=events['length'];_0x3894f9<_0x1ae725;_0x3894f9++){var _0x2c1ead=events[_0x3894f9];var _0x5ef97c=createListener(_0xd2cb('0x5')+_0x2c1ead,_0x20ff39);VoicePrefixEvents['on'](_0x2c1ead,_0x5ef97c);}};
\ No newline at end of file
+var _0x9879=['update','emit','removeListener','register','length','save','remove'];(function(_0x43a2f7,_0x2b64fb){var _0x3b063d=function(_0x5e2d73){while(--_0x5e2d73){_0x43a2f7['push'](_0x43a2f7['shift']());}};_0x3b063d(++_0x2b64fb);}(_0x9879,0x98));var _0x9987=function(_0x1e5ef7,_0x42e0e6){_0x1e5ef7=_0x1e5ef7-0x0;var _0x24fdbb=_0x9879[_0x1e5ef7];return _0x24fdbb;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x9987('0x0'),_0x9987('0x1'),_0x9987('0x2')];function createListener(_0x1df4b1,_0x15471b){return function(_0x25f8c9){_0x15471b[_0x9987('0x3')](_0x1df4b1,_0x25f8c9);};}function removeListener(_0x2ab2a8,_0x37ebe8){return function(){VoicePrefixEvents[_0x9987('0x4')](_0x2ab2a8,_0x37ebe8);};}exports[_0x9987('0x5')]=function(_0x473510){for(var _0x15193d=0x0,_0xce52bb=events[_0x9987('0x6')];_0x15193d<_0xce52bb;_0x15193d++){var _0x555bb0=events[_0x15193d];var _0x1cf155=createListener('voicePrefix:'+_0x555bb0,_0x473510);VoicePrefixEvents['on'](_0x555bb0,_0x1cf155);}};
\ No newline at end of file
index a0abcc7..31faade 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x8a4654,_0x13e800){var _0x23bee4=function(_0x1b56f4){while(--_0x1b56f4){_0x8a4654['push'](_0x8a4654['shift']());}};_0x23bee4(++_0x13e800);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router;
\ No newline at end of file
+var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x1ea94e,_0x1045a8){var _0x1e13d6=function(_0xb9e5b9){while(--_0xb9e5b9){_0x1ea94e['push'](_0x1ea94e['shift']());}};_0x1e13d6(++_0x1045a8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router;
\ No newline at end of file
index faeefdf..1b52db4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55f3=['#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','random','linear','wrandom','rrordered','setDataValue','strategy','rrmemory','type','getDataValue','dialMethod','booked','roundrobin','predictive','power','INTEGER','yes','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','preview','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\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)','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x55f3,0x13a));var _0x355f=function(_0x45f7a5,_0x2f61b0){_0x45f7a5=_0x45f7a5-0x0;var _0x515dcc=_0x55f3[_0x45f7a5];return _0x515dcc;};'use strict';var Sequelize=require(_0x355f('0x0'));module[_0x355f('0x1')]={'name':{'type':Sequelize[_0x355f('0x2')],'allowNull':![],'unique':_0x355f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x355f('0x4')](_0x355f('0x5'),_0x355f('0x6')),'allowNull':![],'defaultValue':_0x355f('0x5')},'musiconhold':{'type':Sequelize[_0x355f('0x2')],'defaultValue':_0x355f('0x7')},'announce':{'type':Sequelize[_0x355f('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x355f('0x8'),_0x355f('0x9'),'fewestcalls',_0x355f('0xa'),'rrmemory',_0x355f('0xb'),_0x355f('0xc'),_0x355f('0xd')),'allowNull':![],'defaultValue':_0x355f('0x8'),'set':function(_0x2ce728){this[_0x355f('0xe')](_0x355f('0xf'),_0x2ce728?_0x2ce728:_0x355f('0x10'));},'get':function(){var _0x4d169d=this['getDataValue'](_0x355f('0x11'));var _0x4b1c96=this[_0x355f('0x12')](_0x355f('0x13'));var _0x12e94d=this[_0x355f('0x12')]('strategy');if(_0x4d169d===_0x355f('0x5')){return _0x12e94d;}if(_0x4b1c96===_0x355f('0x14')&&_0x12e94d===_0x355f('0x10')||_0x4b1c96===_0x355f('0x14')&&_0x12e94d===_0x355f('0x15')){return _0x12e94d;}if(_0x4b1c96==='progressive'||_0x4b1c96===_0x355f('0x16')||_0x4b1c96===_0x355f('0x17')){return _0x12e94d;}return null;}},'servicelevel':{'type':Sequelize[_0x355f('0x18')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x355f('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x355f('0x18')](0xb)},'timeout':{'type':Sequelize[_0x355f('0x18')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x355f('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x355f('0x18')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x355f('0x4')](_0x355f('0x19'),'no'),'defaultValue':_0x355f('0x19')},'autopause':{'type':Sequelize[_0x355f('0x4')]('yes','no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x355f('0x4')](_0x355f('0x19'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x355f('0x18')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x355f('0x19'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x355f('0x4')](_0x355f('0x19'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x355f('0x4')](_0x355f('0x19'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x355f('0x19'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x355f('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x355f('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x355f('0x18')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x355f('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x355f('0x4')](_0x355f('0x19'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x355f('0x4')](_0x355f('0x19'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x355f('0x4')](_0x355f('0x19'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x355f('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x355f('0x4')](_0x355f('0x19'),'no')},'announce_position_limit':{'type':Sequelize[_0x355f('0x18')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x355f('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x355f('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x355f('0x2')]},'queue_youarenext':{'type':Sequelize[_0x355f('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x355f('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x355f('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x355f('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x355f('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x355f('0x2')]},'queue_quantity1':{'type':Sequelize[_0x355f('0x2')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0x355f('0x2')]},'queue_less_than':{'type':Sequelize[_0x355f('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x4075fd){this[_0x355f('0xe')](_0x355f('0x1a'),_0x4075fd?_0x4075fd[_0x355f('0x1b')](','):[]);},'get':function(){return this[_0x355f('0x12')](_0x355f('0x1a'))?this[_0x355f('0x12')](_0x355f('0x1a'))[_0x355f('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x355f('0x2')],'defaultValue':'yes','set':function(_0x329d78){this[_0x355f('0xe')](_0x355f('0x1d'),_0x329d78?_0x329d78['join'](','):undefined);},'get':function(){return this[_0x355f('0x12')](_0x355f('0x1d'))?this[_0x355f('0x12')](_0x355f('0x1d'))[_0x355f('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x355f('0x2')],'defaultValue':'no','set':function(_0x30aa72){this[_0x355f('0xe')]('leavewhenempty',_0x30aa72?_0x30aa72[_0x355f('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0x355f('0x1e'))?this[_0x355f('0x12')](_0x355f('0x1e'))[_0x355f('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x355f('0x4')](_0x355f('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x355f('0x19'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x355f('0x18')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x355f('0x4')](_0x355f('0x19'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x355f('0x2')]},'description':{'type':Sequelize[_0x355f('0x2')]},'acw':{'type':Sequelize[_0x355f('0x1f')],'defaultValue':0x0,'set':function(_0x359fdc){this[_0x355f('0xe')]('acw',_0x359fdc);if(_0x359fdc){if(this['getDataValue']('wrapuptime')<0x2){this['setDataValue'](_0x355f('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x355f('0x18')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x355f('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x355f('0x4')](_0x355f('0x21'),_0x355f('0x22'),_0x355f('0x17'),_0x355f('0x16'),_0x355f('0x14')),'defaultValue':_0x355f('0x22'),'comment':_0x355f('0x23')},'dialLimitChannel':{'type':Sequelize[_0x355f('0x18')](0x4)[_0x355f('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x355f('0x18')](0x4)[_0x355f('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x355f('0x25')},'dialPowerLevel':{'type':Sequelize[_0x355f('0x26')](0x2)[_0x355f('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x355f('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x355f('0x4')](_0x355f('0x28'),_0x355f('0x29')),'defaultValue':_0x355f('0x29'),'comment':_0x355f('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x355f('0x26')](0x2)[_0x355f('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x355f('0x2b')},'dialPredictiveInterval':{'type':Sequelize[_0x355f('0x18')](0x3)[_0x355f('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x355f('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x355f('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x355f('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x355f('0x2c')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':_0x355f('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0x355f('0x18')](0x3)[_0x355f('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x355f('0x2e')},'dialQueueProject':{'type':Sequelize[_0x355f('0x2')],'comment':_0x355f('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x355f('0x18')](0x3)[_0x355f('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x355f('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x355f('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x355f('0x18')](0x3)[_0x355f('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x355f('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x355f('0x18')](0x5)[_0x355f('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x355f('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x355f('0x18')](0x3)[_0x355f('0x24')],'defaultValue':0x3,'comment':_0x355f('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x355f('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x355f('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0x355f('0x18')](0x3)[_0x355f('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x355f('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x355f('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x355f('0x35'),'never',_0x355f('0x36')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x355f('0x37')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x355f('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x355f('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x355f('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x355f('0x18')](0x9)[_0x355f('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x355f('0x18')](0x9)[_0x355f('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x355f('0x39')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x355f('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x355f('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x355f('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x355f('0x18')](0x9)[_0x355f('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x355f('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x355f('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x355f('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x355f('0x18')](0x9)[_0x355f('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x355f('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x355f('0x3e')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x355f('0x4')]('DESC','ASC'),'defaultValue':_0x355f('0x3f')},'dialQueueProject2':{'type':Sequelize[_0x355f('0x2')],'comment':_0x355f('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x355f('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x355f('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x355f('0x18')](0x3)[_0x355f('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x355f('0x40')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x355f('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x355f('0x41')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x355f('0x18')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x355f('0x42')},'dialDropMaxRetry':{'type':Sequelize[_0x355f('0x18')](0x3)[_0x355f('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x355f('0x43')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x355f('0x44')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x355f('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x355f('0x18')](0x5)[_0x355f('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x355f('0x45')},'dialMachineMaxRetry':{'type':Sequelize[_0x355f('0x18')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x355f('0x46')},'dialMachineRetryFrequency':{'type':Sequelize[_0x355f('0x18')](0x5)[_0x355f('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x355f('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x355f('0x47')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x355f('0x18')](0x5)[_0x355f('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x355f('0x18')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x355f('0x1f')],'defaultValue':![],'comment':_0x355f('0x48'),'set':function(_0x177791){if(!_0x177791)this[_0x355f('0xe')](_0x355f('0x49'),null);this['setDataValue'](_0x355f('0x4a'),_0x177791);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x355f('0x18')](0x3)[_0x355f('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x355f('0x18')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x355f('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x355f('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x355f('0x1f')],'defaultValue':![]}};
\ No newline at end of file
+var _0x818a=['ENUM','inbound','ringall','leastrecent','rrmemory','linear','wrandom','rrordered','setDataValue','getDataValue','type','dialMethod','strategy','booked','roundrobin','power','INTEGER','yes','all','once','periodic_announce','join','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','predictive','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\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)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name'];(function(_0x3d176a,_0x4cef14){var _0x49aa92=function(_0x1c4579){while(--_0x1c4579){_0x3d176a['push'](_0x3d176a['shift']());}};_0x49aa92(++_0x4cef14);}(_0x818a,0x174));var _0xa818=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x818a[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0xa818('0x0'));module['exports']={'name':{'type':Sequelize[_0xa818('0x1')],'allowNull':![],'unique':_0xa818('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xa818('0x3')](_0xa818('0x4'),'outbound'),'allowNull':![],'defaultValue':_0xa818('0x4')},'musiconhold':{'type':Sequelize[_0xa818('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize[_0xa818('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0xa818('0x3')]('rr',_0xa818('0x5'),_0xa818('0x6'),'fewestcalls','random',_0xa818('0x7'),_0xa818('0x8'),_0xa818('0x9'),_0xa818('0xa')),'allowNull':![],'defaultValue':_0xa818('0x5'),'set':function(_0x36d150){this[_0xa818('0xb')]('strategy',_0x36d150?_0x36d150:_0xa818('0x7'));},'get':function(){var _0x55a07b=this[_0xa818('0xc')](_0xa818('0xd'));var _0x242b19=this[_0xa818('0xc')](_0xa818('0xe'));var _0x45dad1=this['getDataValue'](_0xa818('0xf'));if(_0x55a07b==='inbound'){return _0x45dad1;}if(_0x242b19===_0xa818('0x10')&&_0x45dad1==='rrmemory'||_0x242b19===_0xa818('0x10')&&_0x45dad1===_0xa818('0x11')){return _0x45dad1;}if(_0x242b19==='progressive'||_0x242b19==='predictive'||_0x242b19===_0xa818('0x12')){return _0x45dad1;}return null;}},'servicelevel':{'type':Sequelize[_0xa818('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xa818('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xa818('0x13')](0xb)},'timeout':{'type':Sequelize[_0xa818('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xa818('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xa818('0x1')]},'weight':{'type':Sequelize[_0xa818('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xa818('0x3')](_0xa818('0x14'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xa818('0x3')](_0xa818('0x14'),'no',_0xa818('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xa818('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0xa818('0x3')](_0xa818('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xa818('0x3')](_0xa818('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xa818('0x3')](_0xa818('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xa818('0x3')](_0xa818('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xa818('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xa818('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xa818('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xa818('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xa818('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xa818('0x3')](_0xa818('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xa818('0x3')]('yes','no'),'defaultValue':_0xa818('0x14')},'announce_holdtime':{'type':Sequelize[_0xa818('0x3')](_0xa818('0x14'),'no',_0xa818('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xa818('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xa818('0x3')](_0xa818('0x14'),'no')},'announce_position_limit':{'type':Sequelize[_0xa818('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xa818('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xa818('0x1')]},'queue_youarenext':{'type':Sequelize[_0xa818('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xa818('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xa818('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xa818('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xa818('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xa818('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xa818('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xa818('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xa818('0x1')]},'queue_quantity1':{'type':Sequelize[_0xa818('0x1')]},'queue_quantity2':{'type':Sequelize[_0xa818('0x1')]},'queue_periodic_announce':{'type':Sequelize[_0xa818('0x1')]},'queue_less_than':{'type':Sequelize[_0xa818('0x1')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0xd7300f){this[_0xa818('0xb')](_0xa818('0x17'),_0xd7300f?_0xd7300f[_0xa818('0x18')](','):[]);},'get':function(){return this[_0xa818('0xc')](_0xa818('0x17'))?this[_0xa818('0xc')](_0xa818('0x17'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xa818('0x1')],'defaultValue':_0xa818('0x14'),'set':function(_0x4ab024){this[_0xa818('0xb')](_0xa818('0x19'),_0x4ab024?_0x4ab024[_0xa818('0x18')](','):undefined);},'get':function(){return this[_0xa818('0xc')](_0xa818('0x19'))?this[_0xa818('0xc')](_0xa818('0x19'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x142faf){this[_0xa818('0xb')](_0xa818('0x1a'),_0x142faf?_0x142faf[_0xa818('0x18')](','):undefined);},'get':function(){return this[_0xa818('0xc')]('leavewhenempty')?this[_0xa818('0xc')](_0xa818('0x1a'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xa818('0x3')](_0xa818('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xa818('0x3')](_0xa818('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xa818('0x3')](_0xa818('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa818('0x1')]},'acw':{'type':Sequelize[_0xa818('0x1b')],'defaultValue':0x0,'set':function(_0x22d5d6){this['setDataValue'](_0xa818('0x1c'),_0x22d5d6);if(_0x22d5d6){if(this[_0xa818('0xc')](_0xa818('0x1d'))<0x2){this[_0xa818('0xb')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xa818('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xa818('0x1b')],'defaultValue':0x0,'comment':_0xa818('0x1e')},'dialMethod':{'type':Sequelize[_0xa818('0x3')]('preview',_0xa818('0x1f'),'power',_0xa818('0x20'),_0xa818('0x10')),'defaultValue':_0xa818('0x1f'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0xa818('0x13')](0x4)[_0xa818('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa818('0x22')},'dialLimitQueue':{'type':Sequelize[_0xa818('0x13')](0x4)[_0xa818('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa818('0x23')},'dialPowerLevel':{'type':Sequelize[_0xa818('0x24')](0x2)[_0xa818('0x21')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xa818('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0xa818('0x3')]('agentBusyFactor','dropRate'),'defaultValue':'dropRate','comment':_0xa818('0x26')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0xa818('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xa818('0x27')},'dialPredictiveInterval':{'type':Sequelize[_0xa818('0x13')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0xa818('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa818('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0xa818('0x13')](0x3)[_0xa818('0x21')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa818('0x28')},'dialQueueOptions':{'type':Sequelize[_0xa818('0x1')],'defaultValue':_0xa818('0x29'),'comment':_0xa818('0x2a')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xa818('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa818('0x2b')},'dialQueueProject':{'type':Sequelize[_0xa818('0x1')],'comment':_0xa818('0x2c')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa818('0x13')](0x3)[_0xa818('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa818('0x13')](0x5)[_0xa818('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xa818('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa818('0x2d')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa818('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa818('0x2e')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa818('0x13')](0x3)[_0xa818('0x21')],'defaultValue':0x3,'comment':_0xa818('0x2f')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa818('0x13')](0x5)[_0xa818('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa818('0x30')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa818('0x21')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa818('0x31')},'dialTimezone':{'type':Sequelize[_0xa818('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa818('0x1')],'defaultValue':_0xa818('0x32')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xa818('0x3')](_0xa818('0x33'),'never',_0xa818('0x34')),'defaultValue':_0xa818('0x33')},'dialAMDActive':{'type':Sequelize[_0xa818('0x1b')],'defaultValue':0x0,'comment':_0xa818('0x35')},'dialAMDInitialSilence':{'type':Sequelize[_0xa818('0x13')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa818('0x36')},'dialAMDGreeting':{'type':Sequelize[_0xa818('0x13')](0x9)[_0xa818('0x21')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa818('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa818('0x13')](0x9)[_0xa818('0x21')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa818('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa818('0x13')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa818('0x39')},'dialAMDMinWordLength':{'type':Sequelize[_0xa818('0x13')](0x9)[_0xa818('0x21')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa818('0x3a')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa818('0x13')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa818('0x3b')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xa818('0x21')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa818('0x3c')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xa818('0x21')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa818('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa818('0x13')](0x9)[_0xa818('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xa818('0x13')](0x5)[_0xa818('0x21')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xa818('0x1b')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xa818('0x3')](_0xa818('0x3e'),_0xa818('0x3f')),'defaultValue':_0xa818('0x3e')},'dialQueueProject2':{'type':Sequelize[_0xa818('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xa818('0x1b')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xa818('0x13')](0x3)[_0xa818('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa818('0x40')},'dialCutDigit':{'type':Sequelize[_0xa818('0x13')](0x3)[_0xa818('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa818('0x41')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa818('0x13')](0x3)[_0xa818('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa818('0x13')](0x5)[_0xa818('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xa818('0x13')](0x3)[_0xa818('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa818('0x42')},'dialDropRetryFrequency':{'type':Sequelize[_0xa818('0x13')](0x5)[_0xa818('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa818('0x43')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa818('0x13')](0x3)[_0xa818('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa818('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa818('0x44')},'dialMachineMaxRetry':{'type':Sequelize[_0xa818('0x13')](0x3)[_0xa818('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa818('0x45')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa818('0x13')](0x5)[_0xa818('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa818('0x46')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa818('0x47')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa818('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa818('0x13')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa818('0x1b')],'defaultValue':![],'comment':_0xa818('0x48'),'set':function(_0x452a68){if(!_0x452a68)this[_0xa818('0xb')](_0xa818('0x49'),null);this[_0xa818('0xb')](_0xa818('0x4a'),_0x452a68);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xa818('0x13')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xa818('0x13')](0x3)[_0xa818('0x21')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xa818('0x1b')],'defaultValue':![]}};
\ No newline at end of file
index 28f0715..83d5d0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6333=['hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','VoiceQueue','includeAll','findAll','rows','catch','show','fields','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','createdAt','updatedAt','body','create','params','getHoppers','findOne','CmHopper','pick','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','isNil','format','SIP/%s','emit','removeTeams','ids','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','union','compact','isEmpty','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','omit','spread','all','isArray','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','select','phone','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','ListId\x20=\x20?','cm_hopper_additional_phones','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','join','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','deletedAt\x20IS\x20NULL','removeBlackLists','fast-json-patch','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','index','rawAttributes','fieldName','model','keys','filters','intersection','query','attributes','length'];(function(_0x6ab6fa,_0x2c6e2b){var _0xeb1ca9=function(_0x2a191e){while(--_0x2a191e){_0x6ab6fa['push'](_0x6ab6fa['shift']());}};_0xeb1ca9(++_0x2c6e2b);}(_0x6333,0x83));var _0x3633=function(_0xe5b95c,_0x41b2ec){_0xe5b95c=_0xe5b95c-0x0;var _0x5bf0ad=_0x6333[_0xe5b95c];return _0x5bf0ad;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3633('0x0'));var rp=require('request-promise');var moment=require(_0x3633('0x1'));var BPromise=require(_0x3633('0x2'));var Mustache=require('mustache');var util=require(_0x3633('0x3'));var path=require('path');var sox=require(_0x3633('0x4'));var csv=require(_0x3633('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3633('0x6'));var squel=require(_0x3633('0x7'));var crypto=require(_0x3633('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3633('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3633('0x9'));var authService=require(_0x3633('0xa'));var qs=require(_0x3633('0xb'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3633('0xc'));var logger=require(_0x3633('0xd'))('api');var utils=require('../../config/utils');var config=require(_0x3633('0xe'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x3633('0xf')]=_[_0x3633('0x10')](config[_0x3633('0xf')],{'host':_0x3633('0x11'),'port':0x18eb});var socket=require(_0x3633('0x12'))(new Redis(config['redis']));require(_0x3633('0x13'))[_0x3633('0x14')](socket);function respondWithStatusCode(_0x5bf51b,_0x57460b){_0x57460b=_0x57460b||0xcc;return function(_0x55b6cd){if(_0x55b6cd){return _0x5bf51b['sendStatus'](_0x57460b);}return _0x5bf51b[_0x3633('0x15')](_0x57460b)[_0x3633('0x16')]();};}function respondWithResult(_0x2f5eab,_0x42a894){_0x42a894=_0x42a894||0xc8;return function(_0x1acaeb){if(_0x1acaeb){return _0x2f5eab[_0x3633('0x15')](_0x42a894)['json'](_0x1acaeb);}};}function respondWithFilteredResult(_0x2d123e,_0x349ee7){return function(_0x578e08){if(_0x578e08){var _0x57961b=typeof _0x349ee7[_0x3633('0x17')]==='undefined'&&typeof _0x349ee7['limit']===_0x3633('0x18');var _0x13f7af=_0x578e08[_0x3633('0x19')];var _0x4bdb9b=_0x57961b?0x0:_0x349ee7[_0x3633('0x17')];var _0xd34aef=_0x57961b?_0x578e08[_0x3633('0x19')]:_0x349ee7['offset']+_0x349ee7[_0x3633('0x1a')];var _0x2b7f86;if(_0xd34aef>=_0x13f7af){_0xd34aef=_0x13f7af;_0x2b7f86=0xc8;}else{_0x2b7f86=0xce;}_0x2d123e[_0x3633('0x15')](_0x2b7f86);return _0x2d123e['set'](_0x3633('0x1b'),_0x4bdb9b+'-'+_0xd34aef+'/'+_0x13f7af)[_0x3633('0x1c')](_0x578e08);}return null;};}function patchUpdates(_0x4ed8e3){return function(_0x2efd9a){try{jsonpatch[_0x3633('0x1d')](_0x2efd9a,_0x4ed8e3,!![]);}catch(_0x1d5270){return BPromise[_0x3633('0x1e')](_0x1d5270);}return _0x2efd9a[_0x3633('0x1f')]();};}function saveUpdates(_0x27511a,_0x2db92e){return function(_0xedb9dc){if(_0xedb9dc){return _0xedb9dc[_0x3633('0x20')](_0x27511a)[_0x3633('0x21')](function(_0x2c781f){return _0x2c781f;});}return null;};}function removeEntity(_0x3844d5,_0x4b0ad7){return function(_0x2a1b70){if(_0x2a1b70){return _0x2a1b70[_0x3633('0x22')]()['then'](function(){var _0x19c36c=_0x2a1b70[_0x3633('0x23')]({'plain':!![]});var _0x394c0a=[{'name':_0x3633('0x24'),'value':_0x3633('0x25'),'ignore':![]},{'name':_0x3633('0x26'),'value':_0x3633('0x27'),'ignore':![]}];var _0x5b8524=_(_0x394c0a)[_0x3633('0x28')](_0x3633('0x29'))[_0x3633('0x2a')](_0x3633('0x2b'))[_0x3633('0x2b')]();if(_[_0x3633('0x2c')](_0x5b8524,_0x19c36c[_0x3633('0x2d')])){return;}var _0x1db16b=_[_0x3633('0x2e')](_0x394c0a,[_0x3633('0x2b'),_0x19c36c['type']])[_0x3633('0x2f')];return db[_0x3633('0x30')][_0x3633('0x22')]({'where':{'type':_0x1db16b,'resourceId':_0x19c36c['id']}})[_0x3633('0x21')](function(){return _0x2a1b70;});})[_0x3633('0x21')](function(){_0x3844d5[_0x3633('0x15')](0xcc)[_0x3633('0x16')]();});}};}function handleEntityNotFound(_0x4b3129,_0x44f830){return function(_0x453077){if(!_0x453077){_0x4b3129['sendStatus'](0x194);}return _0x453077;};}function handleError(_0x744adc,_0x38f2d1){_0x38f2d1=_0x38f2d1||0x1f4;return function(_0xf85582){logger[_0x3633('0x31')](_0xf85582[_0x3633('0x32')]);if(_0xf85582['name']){delete _0xf85582[_0x3633('0x2f')];}_0x744adc['status'](_0x38f2d1)['send'](_0xf85582);};}exports[_0x3633('0x33')]=function(_0x58fd9e,_0x2a49a0){var _0x29d4fc={},_0x4edba7={},_0x41a460={'count':0x0,'rows':[]};var _0x180bfd=_['map'](db['VoiceQueue'][_0x3633('0x34')],function(_0x361e31){return{'name':_0x361e31[_0x3633('0x35')],'type':_0x361e31[_0x3633('0x2d')]['key']};});_0x4edba7[_0x3633('0x36')]=_[_0x3633('0x2a')](_0x180bfd,_0x3633('0x2f'));_0x4edba7['query']=_[_0x3633('0x37')](_0x58fd9e['query']);_0x4edba7[_0x3633('0x38')]=_[_0x3633('0x39')](_0x4edba7[_0x3633('0x36')],_0x4edba7[_0x3633('0x3a')]);_0x29d4fc['attributes']=_[_0x3633('0x39')](_0x4edba7[_0x3633('0x36')],qs['fields'](_0x58fd9e[_0x3633('0x3a')]['fields']));_0x29d4fc[_0x3633('0x3b')]=_0x29d4fc[_0x3633('0x3b')][_0x3633('0x3c')]?_0x29d4fc['attributes']:_0x4edba7[_0x3633('0x36')];if(!_0x58fd9e['query'][_0x3633('0x3d')](_0x3633('0x3e'))){_0x29d4fc[_0x3633('0x1a')]=qs[_0x3633('0x1a')](_0x58fd9e['query'][_0x3633('0x1a')]);_0x29d4fc[_0x3633('0x17')]=qs[_0x3633('0x17')](_0x58fd9e[_0x3633('0x3a')][_0x3633('0x17')]);}_0x29d4fc[_0x3633('0x3f')]=qs[_0x3633('0x40')](_0x58fd9e[_0x3633('0x3a')]['sort']);_0x29d4fc['where']=qs[_0x3633('0x38')](_['pick'](_0x58fd9e[_0x3633('0x3a')],_0x4edba7[_0x3633('0x38')]),_0x180bfd);if(_0x58fd9e['query'][_0x3633('0x28')]){_0x29d4fc[_0x3633('0x41')]=_[_0x3633('0x42')](_0x29d4fc[_0x3633('0x41')],{'$or':_[_0x3633('0x2a')](_0x180bfd,function(_0x515399){if(_0x515399['type']!==_0x3633('0x43')){var _0xed1783={};_0xed1783[_0x515399[_0x3633('0x2f')]]={'$like':'%'+_0x58fd9e[_0x3633('0x3a')][_0x3633('0x28')]+'%'};return _0xed1783;}})});}_0x29d4fc=_[_0x3633('0x42')]({},_0x29d4fc,_0x58fd9e[_0x3633('0x44')]);var _0x519508={'where':_0x29d4fc[_0x3633('0x41')]};return db[_0x3633('0x45')][_0x3633('0x19')](_0x519508)['then'](function(_0x5e2ed0){_0x41a460[_0x3633('0x19')]=_0x5e2ed0;if(_0x58fd9e['query'][_0x3633('0x46')]){_0x29d4fc['include']=[{'all':!![]}];}return db[_0x3633('0x45')][_0x3633('0x47')](_0x29d4fc);})[_0x3633('0x21')](function(_0x2e3b98){_0x41a460[_0x3633('0x48')]=_0x2e3b98;return _0x41a460;})[_0x3633('0x21')](respondWithFilteredResult(_0x2a49a0,_0x29d4fc))[_0x3633('0x49')](handleError(_0x2a49a0,null));};exports[_0x3633('0x4a')]=function(_0x59f3f5,_0x5a60cd){var _0x3e2fe8={'raw':![],'where':{'id':_0x59f3f5['params']['id']}},_0x2940dd={};_0x2940dd[_0x3633('0x36')]=_[_0x3633('0x37')](db[_0x3633('0x45')]['rawAttributes']);_0x2940dd['query']=_[_0x3633('0x37')](_0x59f3f5[_0x3633('0x3a')]);_0x2940dd[_0x3633('0x38')]=_[_0x3633('0x39')](_0x2940dd[_0x3633('0x36')],_0x2940dd[_0x3633('0x3a')]);_0x3e2fe8['attributes']=_[_0x3633('0x39')](_0x2940dd[_0x3633('0x36')],qs[_0x3633('0x4b')](_0x59f3f5[_0x3633('0x3a')][_0x3633('0x4b')]));_0x3e2fe8[_0x3633('0x3b')]=_0x3e2fe8[_0x3633('0x3b')]['length']?_0x3e2fe8[_0x3633('0x3b')]:_0x2940dd['model'];if(_0x59f3f5[_0x3633('0x3a')][_0x3633('0x46')]){_0x3e2fe8['include']=[{'all':!![]}];}_0x3e2fe8=_[_0x3633('0x42')]({},_0x3e2fe8,_0x59f3f5['options']);return db[_0x3633('0x45')][_0x3633('0x2e')](_0x3e2fe8)[_0x3633('0x21')](handleEntityNotFound(_0x5a60cd,null))[_0x3633('0x21')](respondWithResult(_0x5a60cd,null))[_0x3633('0x49')](handleError(_0x5a60cd,null));};exports['create']=function(_0x42714c,_0x1c5cc4){return db[_0x3633('0x45')]['create'](_0x42714c['body'],{})[_0x3633('0x21')](function(_0x5a4567){var _0x5c3f86=_0x42714c[_0x3633('0x4c')][_0x3633('0x23')]({'plain':!![]});if(!_0x5c3f86)throw new Error(_0x3633('0x4d'));if(_0x5c3f86[_0x3633('0x4e')]==='user'){var _0xbf118b=_0x5a4567[_0x3633('0x23')]({'plain':!![]});var _0x3544bf=[{'name':_0x3633('0x24'),'value':_0x3633('0x25')},{'name':_0x3633('0x26'),'value':_0x3633('0x27')}];var _0x58fd90=_['find'](_0x3544bf,['value',_0xbf118b[_0x3633('0x2d')]])[_0x3633('0x2f')];return db[_0x3633('0x4f')]['find']({'where':{'name':_0x58fd90,'userProfileId':_0x5c3f86[_0x3633('0x50')]},'raw':!![]})[_0x3633('0x21')](function(_0x47c377){if(_0x47c377&&_0x47c377[_0x3633('0x51')]===0x0){return db[_0x3633('0x30')]['create']({'name':_0xbf118b['name'],'resourceId':_0xbf118b['id'],'type':_0x47c377['name'],'sectionId':_0x47c377['id']},{})[_0x3633('0x21')](function(){return _0x5a4567;});}else{return _0x5a4567;}})[_0x3633('0x49')](function(_0x87b288){logger[_0x3633('0x31')](_0x3633('0x52'),_0x87b288);throw _0x87b288;});}return _0x5a4567;})['then'](respondWithResult(_0x1c5cc4,0xc9))[_0x3633('0x49')](handleError(_0x1c5cc4,null));};exports[_0x3633('0x53')]=function(_0x3e5424,_0x4a03aa){var _0x24d228={'where':{'id':_0x3e5424['params']['id']}},_0x38bea1={};_0x38bea1['model']=_[_0x3633('0x37')](db[_0x3633('0x45')]['rawAttributes']);_0x24d228['attributes']=_['intersection'](_0x38bea1[_0x3633('0x36')],qs[_0x3633('0x4b')](_0x3e5424[_0x3633('0x3a')][_0x3633('0x4b')]));_0x24d228[_0x3633('0x3b')]=_0x24d228['attributes'][_0x3633('0x3c')]?_0x24d228[_0x3633('0x3b')]:_0x38bea1[_0x3633('0x36')];if(_0x3e5424[_0x3633('0x3a')][_0x3633('0x46')]){_0x24d228[_0x3633('0x54')]=[{'all':!![]}];}_0x24d228=_['merge']({},_0x24d228,_0x3e5424[_0x3633('0x44')]);return db[_0x3633('0x45')][_0x3633('0x2e')](_0x24d228)[_0x3633('0x21')](handleEntityNotFound(_0x4a03aa,null))[_0x3633('0x21')](function(_0x18b96e){if(_0x18b96e){var _0x42eddd=_0x18b96e['get']({'plain':!![]});_0x42eddd=qs['omit'](_0x42eddd,['id',_0x3633('0x55'),_0x3633('0x56')]);_0x3e5424['body']=_['omit'](_0x3e5424[_0x3633('0x57')],['id','createdAt',_0x3633('0x56')]);return db[_0x3633('0x45')][_0x3633('0x58')](_['merge'](_0x42eddd,_0x3e5424['body']),{'include':_0x3e5424['query'][_0x3633('0x46')]?[{'all':!![]}]:undefined})[_0x3633('0x21')](function(_0x4cdd72){var _0xfc959a=_0x3e5424[_0x3633('0x4c')]['get']({'plain':!![]});if(!_0xfc959a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfc959a[_0x3633('0x4e')]==='user'){var _0x201c99=_0x4cdd72[_0x3633('0x23')]({'plain':!![]});var _0x4402c6=[{'name':_0x3633('0x24'),'value':_0x3633('0x25')},{'name':_0x3633('0x26'),'value':_0x3633('0x27')}];var _0x49a462=_[_0x3633('0x2e')](_0x4402c6,[_0x3633('0x2b'),_0x201c99[_0x3633('0x2d')]])[_0x3633('0x2f')];return db['UserProfileSection'][_0x3633('0x2e')]({'where':{'name':_0x49a462,'userProfileId':_0xfc959a[_0x3633('0x50')]},'raw':!![]})[_0x3633('0x21')](function(_0x357e18){if(_0x357e18&&_0x357e18[_0x3633('0x51')]===0x0){return db['UserProfileResource'][_0x3633('0x58')]({'name':_0x201c99[_0x3633('0x2f')],'resourceId':_0x201c99['id'],'type':_0x357e18[_0x3633('0x2f')],'sectionId':_0x357e18['id']},{})['then'](function(){return _0x4cdd72;});}else{return _0x4cdd72;}})[_0x3633('0x49')](function(_0x3214f5){logger[_0x3633('0x31')](_0x3633('0x52'),_0x3214f5);throw _0x3214f5;});}return _0x4cdd72;});}})[_0x3633('0x21')](respondWithResult(_0x4a03aa,0xc9))['catch'](handleError(_0x4a03aa,null));};exports[_0x3633('0x20')]=function(_0x6b5f0a,_0x411987){if(_0x6b5f0a[_0x3633('0x57')]['id']){delete _0x6b5f0a['body']['id'];}return db[_0x3633('0x45')]['find']({'where':{'id':_0x6b5f0a[_0x3633('0x59')]['id']}})[_0x3633('0x21')](handleEntityNotFound(_0x411987,null))[_0x3633('0x21')](saveUpdates(_0x6b5f0a[_0x3633('0x57')],null))['then'](respondWithResult(_0x411987,null))[_0x3633('0x49')](handleError(_0x411987,null));};exports[_0x3633('0x22')]=function(_0x11816f,_0x72ce94){return db[_0x3633('0x45')][_0x3633('0x2e')]({'where':{'id':_0x11816f[_0x3633('0x59')]['id']}})['then'](handleEntityNotFound(_0x72ce94,null))[_0x3633('0x21')](removeEntity(_0x72ce94,null))[_0x3633('0x49')](handleError(_0x72ce94,null));};exports[_0x3633('0x5a')]=function(_0x4e4070,_0x4fc4d0,_0x3f054c){var _0x34b1a0={'raw':![],'where':{}};var _0x557911={};var _0x2a6986={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3633('0x5b')]({'where':{'id':_0x4e4070['params']['id']}})['then'](handleEntityNotFound(_0x4fc4d0,null))[_0x3633('0x21')](function(_0xc876ca){if(_0xc876ca){_0x557911[_0x3633('0x36')]=_['keys'](db[_0x3633('0x5c')][_0x3633('0x34')]);_0x557911['query']=_[_0x3633('0x37')](_0x4e4070[_0x3633('0x3a')]);_0x557911[_0x3633('0x38')]=_['intersection'](_0x557911[_0x3633('0x36')],_0x557911['query']);_0x34b1a0[_0x3633('0x3b')]=_[_0x3633('0x39')](_0x557911['model'],qs[_0x3633('0x4b')](_0x4e4070[_0x3633('0x3a')][_0x3633('0x4b')]));_0x34b1a0[_0x3633('0x3b')]=_0x34b1a0['attributes'][_0x3633('0x3c')]?_0x34b1a0[_0x3633('0x3b')]:_0x557911['model'];if(!_0x4e4070[_0x3633('0x3a')][_0x3633('0x3d')](_0x3633('0x3e'))){_0x34b1a0[_0x3633('0x1a')]=qs[_0x3633('0x1a')](_0x4e4070['query'][_0x3633('0x1a')]);_0x34b1a0[_0x3633('0x17')]=qs['offset'](_0x4e4070[_0x3633('0x3a')][_0x3633('0x17')]);}_0x34b1a0[_0x3633('0x3f')]=qs[_0x3633('0x40')](_0x4e4070['query'][_0x3633('0x40')]);_0x34b1a0[_0x3633('0x41')]=qs['filters'](_[_0x3633('0x5d')](_0x4e4070[_0x3633('0x3a')],_0x557911[_0x3633('0x38')]));_0x34b1a0[_0x3633('0x41')][_0x3633('0x5e')]=_0xc876ca['id'];if(_0x4e4070['query'][_0x3633('0x28')]){_0x34b1a0[_0x3633('0x41')]=_[_0x3633('0x42')](_0x34b1a0[_0x3633('0x41')],{'$or':_[_0x3633('0x2a')](_0x34b1a0[_0x3633('0x3b')],function(_0x2173ba){var _0x3d47be={};_0x3d47be[_0x2173ba]={'$like':'%'+_0x4e4070[_0x3633('0x3a')][_0x3633('0x28')]+'%'};return _0x3d47be;})});}_0x34b1a0=_[_0x3633('0x42')]({},_0x34b1a0,_0x4e4070['options']);return db['CmHopper'][_0x3633('0x19')]({'where':_0x34b1a0['where']})[_0x3633('0x21')](function(_0x419c3d){_0x2a6986[_0x3633('0x19')]=_0x419c3d;if(_0x4e4070[_0x3633('0x3a')][_0x3633('0x46')]){_0x34b1a0[_0x3633('0x54')]=[{'all':!![]}];}return db['CmHopper'][_0x3633('0x47')](_0x34b1a0);})[_0x3633('0x21')](function(_0x2d707b){_0x2a6986[_0x3633('0x48')]=_0x2d707b;return _0x2a6986;});}})[_0x3633('0x21')](respondWithFilteredResult(_0x4fc4d0,_0x34b1a0))[_0x3633('0x49')](handleError(_0x4fc4d0,null));};exports[_0x3633('0x5f')]=function(_0x59dc76,_0x2d4a9c,_0x41c6bb){var _0x24cddd={'raw':!![],'where':{}};var _0x57699e={};var _0x45ad80={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3633('0x5b')]({'where':{'id':_0x59dc76[_0x3633('0x59')]['id']}})[_0x3633('0x21')](handleEntityNotFound(_0x2d4a9c,null))['then'](function(_0x3d7128){if(_0x3d7128){_0x57699e[_0x3633('0x36')]=_[_0x3633('0x37')](db['CmHopperHistory'][_0x3633('0x34')]);_0x57699e[_0x3633('0x3a')]=_['keys'](_0x59dc76[_0x3633('0x3a')]);_0x57699e['filters']=_['intersection'](_0x57699e['model'],_0x57699e[_0x3633('0x3a')]);_0x24cddd[_0x3633('0x3b')]=_[_0x3633('0x39')](_0x57699e[_0x3633('0x36')],qs[_0x3633('0x4b')](_0x59dc76['query'][_0x3633('0x4b')]));_0x24cddd[_0x3633('0x3b')]=_0x24cddd['attributes']['length']?_0x24cddd[_0x3633('0x3b')]:_0x57699e[_0x3633('0x36')];if(!_0x59dc76[_0x3633('0x3a')][_0x3633('0x3d')]('nolimit')){_0x24cddd[_0x3633('0x1a')]=qs[_0x3633('0x1a')](_0x59dc76['query'][_0x3633('0x1a')]);_0x24cddd['offset']=qs[_0x3633('0x17')](_0x59dc76['query'][_0x3633('0x17')]);}_0x24cddd[_0x3633('0x3f')]=qs['sort'](_0x59dc76['query'][_0x3633('0x40')]);_0x24cddd['where']=qs['filters'](_[_0x3633('0x5d')](_0x59dc76[_0x3633('0x3a')],_0x57699e['filters']));_0x24cddd['where'][_0x3633('0x5e')]=_0x3d7128['id'];if(_0x59dc76[_0x3633('0x3a')][_0x3633('0x28')]){_0x24cddd[_0x3633('0x41')]=_['merge'](_0x24cddd[_0x3633('0x41')],{'$or':_['map'](_0x24cddd[_0x3633('0x3b')],function(_0x41c40a){var _0x9e7b00={};_0x9e7b00[_0x41c40a]={'$like':'%'+_0x59dc76['query'][_0x3633('0x28')]+'%'};return _0x9e7b00;})});}_0x24cddd=_[_0x3633('0x42')]({},_0x24cddd,_0x59dc76[_0x3633('0x44')]);return db['CmHopperHistory']['count']({'where':_0x24cddd[_0x3633('0x41')]})[_0x3633('0x21')](function(_0x14ac7c){_0x45ad80[_0x3633('0x19')]=_0x14ac7c;if(_0x59dc76[_0x3633('0x3a')][_0x3633('0x46')]){_0x24cddd['include']=[{'all':!![]}];}return db[_0x3633('0x60')][_0x3633('0x47')](_0x24cddd);})[_0x3633('0x21')](function(_0x115ad5){_0x45ad80[_0x3633('0x48')]=_0x115ad5;return _0x45ad80;});}})[_0x3633('0x21')](respondWithFilteredResult(_0x2d4a9c,_0x24cddd))[_0x3633('0x49')](handleError(_0x2d4a9c,null));};exports[_0x3633('0x61')]=function(_0xe37a00,_0x1c6b4d,_0x2e0f74){var _0x446a1c={'raw':!![],'where':{}};var _0x580f7f={};var _0x425244={'count':0x0,'rows':[]};return db[_0x3633('0x45')][_0x3633('0x5b')]({'where':{'id':_0xe37a00['params']['id']}})[_0x3633('0x21')](handleEntityNotFound(_0x1c6b4d,null))[_0x3633('0x21')](function(_0x103b93){if(_0x103b93){_0x580f7f[_0x3633('0x36')]=_[_0x3633('0x37')](db['CmHopperFinal'][_0x3633('0x34')]);_0x580f7f[_0x3633('0x3a')]=_['keys'](_0xe37a00['query']);_0x580f7f['filters']=_[_0x3633('0x39')](_0x580f7f[_0x3633('0x36')],_0x580f7f[_0x3633('0x3a')]);_0x446a1c[_0x3633('0x3b')]=_[_0x3633('0x39')](_0x580f7f[_0x3633('0x36')],qs[_0x3633('0x4b')](_0xe37a00['query'][_0x3633('0x4b')]));_0x446a1c[_0x3633('0x3b')]=_0x446a1c['attributes'][_0x3633('0x3c')]?_0x446a1c[_0x3633('0x3b')]:_0x580f7f[_0x3633('0x36')];if(!_0xe37a00[_0x3633('0x3a')][_0x3633('0x3d')](_0x3633('0x3e'))){_0x446a1c[_0x3633('0x1a')]=qs[_0x3633('0x1a')](_0xe37a00['query'][_0x3633('0x1a')]);_0x446a1c['offset']=qs[_0x3633('0x17')](_0xe37a00[_0x3633('0x3a')]['offset']);}_0x446a1c['order']=qs[_0x3633('0x40')](_0xe37a00[_0x3633('0x3a')][_0x3633('0x40')]);_0x446a1c[_0x3633('0x41')]=qs['filters'](_[_0x3633('0x5d')](_0xe37a00[_0x3633('0x3a')],_0x580f7f['filters']));_0x446a1c['where']['VoiceQueueId']=_0x103b93['id'];if(_0xe37a00['query'][_0x3633('0x28')]){_0x446a1c['where']=_[_0x3633('0x42')](_0x446a1c[_0x3633('0x41')],{'$or':_[_0x3633('0x2a')](_0x446a1c[_0x3633('0x3b')],function(_0x4222b7){var _0x47e046={};_0x47e046[_0x4222b7]={'$like':'%'+_0xe37a00[_0x3633('0x3a')][_0x3633('0x28')]+'%'};return _0x47e046;})});}_0x446a1c=_[_0x3633('0x42')]({},_0x446a1c,_0xe37a00[_0x3633('0x44')]);return db[_0x3633('0x62')]['count']({'where':_0x446a1c[_0x3633('0x41')]})[_0x3633('0x21')](function(_0xf937a){_0x425244['count']=_0xf937a;if(_0xe37a00['query'][_0x3633('0x46')]){_0x446a1c[_0x3633('0x54')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x3633('0x47')](_0x446a1c);})[_0x3633('0x21')](function(_0x5aa25f){_0x425244['rows']=_0x5aa25f;return _0x425244;});}})[_0x3633('0x21')](respondWithFilteredResult(_0x1c6b4d,_0x446a1c))[_0x3633('0x49')](handleError(_0x1c6b4d,null));};exports[_0x3633('0x63')]=function(_0x53f2ac,_0x4b680b,_0x56b6bf){var _0x38a450={'raw':!![],'where':{}};var _0x562ae4={};var _0x3c7474={'count':0x0,'rows':[]};return db[_0x3633('0x45')][_0x3633('0x5b')]({'where':{'id':_0x53f2ac[_0x3633('0x59')]['id']}})[_0x3633('0x21')](handleEntityNotFound(_0x4b680b,null))[_0x3633('0x21')](function(_0xea040e){if(_0xea040e){_0x562ae4[_0x3633('0x36')]=_['keys'](db['CmHopperBlack'][_0x3633('0x34')]);_0x562ae4[_0x3633('0x3a')]=_[_0x3633('0x37')](_0x53f2ac[_0x3633('0x3a')]);_0x562ae4[_0x3633('0x38')]=_[_0x3633('0x39')](_0x562ae4[_0x3633('0x36')],_0x562ae4[_0x3633('0x3a')]);_0x38a450[_0x3633('0x3b')]=_[_0x3633('0x39')](_0x562ae4['model'],qs[_0x3633('0x4b')](_0x53f2ac[_0x3633('0x3a')]['fields']));_0x38a450[_0x3633('0x3b')]=_0x38a450[_0x3633('0x3b')][_0x3633('0x3c')]?_0x38a450[_0x3633('0x3b')]:_0x562ae4[_0x3633('0x36')];if(!_0x53f2ac[_0x3633('0x3a')][_0x3633('0x3d')]('nolimit')){_0x38a450['limit']=qs[_0x3633('0x1a')](_0x53f2ac[_0x3633('0x3a')][_0x3633('0x1a')]);_0x38a450['offset']=qs[_0x3633('0x17')](_0x53f2ac[_0x3633('0x3a')][_0x3633('0x17')]);}_0x38a450[_0x3633('0x3f')]=qs[_0x3633('0x40')](_0x53f2ac[_0x3633('0x3a')]['sort']);_0x38a450[_0x3633('0x41')]=qs[_0x3633('0x38')](_[_0x3633('0x5d')](_0x53f2ac['query'],_0x562ae4[_0x3633('0x38')]));_0x38a450['where'][_0x3633('0x5e')]=_0xea040e['id'];if(_0x53f2ac[_0x3633('0x3a')][_0x3633('0x28')]){_0x38a450[_0x3633('0x41')]=_[_0x3633('0x42')](_0x38a450[_0x3633('0x41')],{'$or':_['map'](_0x38a450[_0x3633('0x3b')],function(_0x811e14){var _0x3be6f5={};_0x3be6f5[_0x811e14]={'$like':'%'+_0x53f2ac[_0x3633('0x3a')][_0x3633('0x28')]+'%'};return _0x3be6f5;})});}_0x38a450=_[_0x3633('0x42')]({},_0x38a450,_0x53f2ac[_0x3633('0x44')]);return db['CmHopperBlack']['count']({'where':_0x38a450[_0x3633('0x41')]})[_0x3633('0x21')](function(_0x1bcfd7){_0x3c7474[_0x3633('0x19')]=_0x1bcfd7;if(_0x53f2ac['query'][_0x3633('0x46')]){_0x38a450[_0x3633('0x54')]=[{'all':!![]}];}return db[_0x3633('0x64')]['findAll'](_0x38a450);})[_0x3633('0x21')](function(_0x2649b2){_0x3c7474[_0x3633('0x48')]=_0x2649b2;return _0x3c7474;});}})[_0x3633('0x21')](respondWithFilteredResult(_0x4b680b,_0x38a450))[_0x3633('0x49')](handleError(_0x4b680b,null));};exports[_0x3633('0x65')]=function(_0x295252,_0x5b1ff6,_0x4a0c8e){var _0x308eed={};var _0x5efd1e={};var _0x538caf;var _0x2bcf03;return db[_0x3633('0x45')][_0x3633('0x5b')]({'where':{'id':_0x295252[_0x3633('0x59')]['id']}})['then'](handleEntityNotFound(_0x5b1ff6,null))[_0x3633('0x21')](function(_0x64f035){if(_0x64f035){_0x538caf=_0x64f035;_0x5efd1e[_0x3633('0x36')]=_['keys'](db[_0x3633('0x66')][_0x3633('0x34')]);_0x5efd1e[_0x3633('0x3a')]=_[_0x3633('0x37')](_0x295252[_0x3633('0x3a')]);_0x5efd1e[_0x3633('0x38')]=_['intersection'](_0x5efd1e[_0x3633('0x36')],_0x5efd1e[_0x3633('0x3a')]);_0x308eed[_0x3633('0x3b')]=_['intersection'](_0x5efd1e['model'],qs[_0x3633('0x4b')](_0x295252[_0x3633('0x3a')][_0x3633('0x4b')]));_0x308eed[_0x3633('0x3b')]=_0x308eed[_0x3633('0x3b')][_0x3633('0x3c')]?_0x308eed[_0x3633('0x3b')]:_0x5efd1e['model'];_0x308eed[_0x3633('0x3f')]=qs[_0x3633('0x40')](_0x295252[_0x3633('0x3a')][_0x3633('0x40')]);_0x308eed[_0x3633('0x41')]=qs[_0x3633('0x38')](_[_0x3633('0x5d')](_0x295252[_0x3633('0x3a')],_0x5efd1e['filters']));if(_0x295252[_0x3633('0x3a')][_0x3633('0x28')]){_0x308eed[_0x3633('0x41')]=_['merge'](_0x308eed[_0x3633('0x41')],{'$or':_[_0x3633('0x2a')](_0x308eed[_0x3633('0x3b')],function(_0x25cca2){var _0x4f1452={};_0x4f1452[_0x25cca2]={'$like':'%'+_0x295252[_0x3633('0x3a')][_0x3633('0x28')]+'%'};return _0x4f1452;})});}_0x308eed=_[_0x3633('0x42')]({},_0x308eed,_0x295252[_0x3633('0x44')]);return _0x538caf[_0x3633('0x65')](_0x308eed);}})['then'](function(_0x5e67d1){if(_0x5e67d1){_0x2bcf03=_0x5e67d1[_0x3633('0x3c')];if(!_0x295252[_0x3633('0x3a')][_0x3633('0x3d')](_0x3633('0x3e'))){_0x308eed[_0x3633('0x1a')]=qs[_0x3633('0x1a')](_0x295252[_0x3633('0x3a')]['limit']);_0x308eed['offset']=qs[_0x3633('0x17')](_0x295252[_0x3633('0x3a')][_0x3633('0x17')]);}return _0x538caf[_0x3633('0x65')](_0x308eed);}})['then'](function(_0x8b0154){if(_0x8b0154){return _0x8b0154?{'count':_0x2bcf03,'rows':_0x8b0154}:null;}})[_0x3633('0x21')](respondWithResult(_0x5b1ff6,null))['catch'](handleError(_0x5b1ff6,null));};exports[_0x3633('0x67')]=function(_0x38ecfb,_0x252e88,_0x4d7e7f){var _0x5c3b43=_0x38ecfb[_0x3633('0x57')][_0x3633('0x68')];var _0xe3286e=_[_0x3633('0x2a')](_0x5c3b43,'id');return db['Team']['findAll']({'where':{'id':_0xe3286e},'attributes':['id'],'include':[{'model':db[_0x3633('0x69')],'as':_0x3633('0x6a'),'attributes':['id',_0x3633('0x2f'),_0x3633('0x6b'),_0x3633('0x6c'),_0x3633('0x6d')],'raw':!![]}]})[_0x3633('0x21')](function(_0x4fddaa){if(_0x4fddaa){var _0xbe4d1a=_[_0x3633('0x6e')](_0x4fddaa,function(_0x233479){var _0x2cafc7=_0x233479['get']({'plain':!![]});_0x2cafc7[_0x3633('0x6a')][_0x3633('0x6f')](function(_0x2d2a4f){_0x2d2a4f[_0x3633('0x70')]=_[_0x3633('0x2e')](_0x5c3b43,{'id':_0x2cafc7['id']})[_0x3633('0x70')];});return _0x2cafc7[_0x3633('0x6a')];});return db[_0x3633('0x45')]['find']({'where':{'id':_0x38ecfb[_0x3633('0x59')]['id']}})[_0x3633('0x21')](function(_0x302925){return db[_0x3633('0x71')][_0x3633('0x72')](function(_0x48b0a6){return _0x302925[_0x3633('0x67')](_0xe3286e,{'transaction':_0x48b0a6})[_0x3633('0x21')](function(){return BPromise[_0x3633('0x73')](_0x5c3b43,function(_0x232fe2){return db[_0x3633('0x74')][_0x3633('0x75')]({'TeamId':_0x232fe2['id'],'VoiceQueueId':_0x38ecfb[_0x3633('0x59')]['id'],'penalty':_0x232fe2[_0x3633('0x70')]},{'transaction':_0x48b0a6});});})[_0x3633('0x21')](function(){return BPromise[_0x3633('0x73')](_0xbe4d1a,function(_0x3274ac){return db[_0x3633('0x76')][_0x3633('0x77')]({'where':{'UserId':_0x3274ac['id'],'VoiceQueueId':_0x38ecfb['params']['id']},'defaults':{'penalty':_0x3274ac[_0x3633('0x70')]},'transaction':_0x48b0a6});});})[_0x3633('0x21')](function(){return BPromise[_0x3633('0x73')](_['filter'](_0xbe4d1a,{'online':!![]}),function(_0x100e8e){return db['UserVoiceQueueRt'][_0x3633('0x75')]({'membername':_0x100e8e['name'],'UserId':_0x100e8e['id'],'queue_name':_0x302925['name'],'VoiceQueueId':_0x302925['id'],'interface':_[_0x3633('0x78')](_0x100e8e[_0x3633('0x6d')])?util[_0x3633('0x79')](_0x3633('0x7a'),_0x100e8e[_0x3633('0x2f')]):_0x100e8e[_0x3633('0x6d')],'paused':_0x100e8e['voicePause']||![],'penalty':_0x100e8e[_0x3633('0x70')]},{'transaction':_0x48b0a6});});})[_0x3633('0x21')](function(){_0xbe4d1a['forEach'](function(_0x1f9d00){socket[_0x3633('0x7b')]('userVoiceQueue:save',{'UserId':_0x1f9d00['id'],'VoiceQueueId':_0x302925['id']});});});});});}})[_0x3633('0x21')](respondWithStatusCode(_0x252e88,null))['catch'](handleError(_0x252e88,null));};exports[_0x3633('0x7c')]=function(_0x1d7c1e,_0x49ae04,_0x470b6a){return db['Team'][_0x3633('0x47')]({'where':{'id':_0x1d7c1e[_0x3633('0x3a')][_0x3633('0x7d')]},'attributes':['id'],'include':[{'model':db[_0x3633('0x69')],'as':_0x3633('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x3633('0x21')](handleEntityNotFound(_0x49ae04,null))[_0x3633('0x21')](function(_0x207077){var _0x1880cf=_[_0x3633('0x2a')](_0x207077,'id');var _0x1faeba=[];var _0x152f02=[];var _0x3c4816=squel['select']();_0x3c4816[_0x3633('0x7e')](_0x3633('0x7f'))[_0x3633('0x80')](_0x3633('0x81'),'tq')['join'](_0x3633('0x82'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x3633('0x41')](_0x3633('0x83'),_0x1d7c1e[_0x3633('0x59')]['id']);for(var _0x336034=0x0;_0x336034<_0x207077[_0x3633('0x3c')];_0x336034+=0x1){let _0x474616=_0x207077[_0x336034];for(var _0x2415fc=0x0;_0x2415fc<_0x474616[_0x3633('0x6a')]['length'];_0x2415fc+=0x1){let _0x31c4c0=_0x474616[_0x3633('0x6a')][_0x2415fc];var _0x5aebf7=_0x3c4816[_0x3633('0x53')]();_0x5aebf7[_0x3633('0x41')](_0x3633('0x84'),_0x31c4c0['id']);_0x152f02[_0x3633('0x85')](db['sequelize'][_0x3633('0x3a')](_0x5aebf7[_0x3633('0x86')](),{'type':db['sequelize'][_0x3633('0x87')][_0x3633('0x88')]})[_0x3633('0x21')](function(_0x2e5fa5){if(_0x2e5fa5[_0x3633('0x3c')]===0x1){return _0x31c4c0['id'];}else{var _0x4af16a=_[_0x3633('0x89')](_[_0x3633('0x2a')](_0x2e5fa5,_0x3633('0x8a')),function(_0xe6a7ed){return _[_0x3633('0x2c')](_0x1880cf,_0xe6a7ed);});if(_0x4af16a){return _0x31c4c0['id'];}}}));}}return BPromise['all'](_0x152f02)[_0x3633('0x21')](function(_0x58a074){_0x1faeba=_(_0x1faeba)[_0x3633('0x8b')](_0x58a074)[_0x3633('0x8c')]()[_0x3633('0x2b')]();return db['VoiceQueue']['find']({'where':{'id':_0x1d7c1e['params']['id']}})[_0x3633('0x21')](function(_0x14f931){return db[_0x3633('0x71')]['transaction'](function(_0x571d37){return _0x14f931[_0x3633('0x7c')](_0x1d7c1e[_0x3633('0x3a')][_0x3633('0x7d')],{'transaction':_0x571d37})[_0x3633('0x21')](function(){if(!_[_0x3633('0x8d')](_0x1faeba)){return _0x14f931[_0x3633('0x8e')](_0x1faeba,{'transaction':_0x571d37})[_0x3633('0x21')](function(){return db[_0x3633('0x8f')][_0x3633('0x22')]({'where':{'VoiceQueueId':_0x1d7c1e[_0x3633('0x59')]['id'],'UserId':_0x1faeba},'transaction':_0x571d37});});}})['then'](function(){_0x1faeba[_0x3633('0x6f')](function(_0x337b77){socket[_0x3633('0x7b')](_0x3633('0x90'),{'UserId':_0x337b77,'VoiceQueueId':_0x14f931['id']});});});});});});})[_0x3633('0x21')](respondWithStatusCode(_0x49ae04,null))[_0x3633('0x49')](handleError(_0x49ae04,null));};exports[_0x3633('0x91')]=function(_0x7f6b8a,_0x1752f4,_0x5170e0){var _0x548836,_0x52f249;return db[_0x3633('0x45')][_0x3633('0x2e')]({'where':{'id':_0x7f6b8a['params']['id']}})[_0x3633('0x21')](handleEntityNotFound(_0x1752f4,null))[_0x3633('0x21')](function(_0x16d1ac){if(_0x16d1ac){_0x52f249=_0x16d1ac;return _0x16d1ac[_0x3633('0x91')](_0x7f6b8a[_0x3633('0x57')][_0x3633('0x7d')],_[_0x3633('0x92')](_0x7f6b8a[_0x3633('0x57')],[_0x3633('0x7d'),'id'])||{})[_0x3633('0x93')](function(_0x521e66){for(var _0x411ae4=0x0;_0x411ae4<_0x7f6b8a[_0x3633('0x57')][_0x3633('0x7d')][_0x3633('0x3c')];_0x411ae4+=0x1){socket[_0x3633('0x7b')]('userVoiceQueue:save',{'UserId':Number(_0x7f6b8a['body']['ids'][_0x411ae4]),'VoiceQueueId':Number(_0x7f6b8a[_0x3633('0x59')]['id'])});}return _0x521e66;});}})[_0x3633('0x21')](function(_0x17166b){_0x548836=_0x17166b||[];if(_0x52f249){return db[_0x3633('0x69')][_0x3633('0x47')]({'where':{'id':_0x7f6b8a[_0x3633('0x57')][_0x3633('0x7d')]},'attributes':['id',_0x3633('0x2f'),_0x3633('0x6b'),'voicePause',_0x3633('0x6d')],'raw':!![]});}})['then'](function(_0x232711){if(!_[_0x3633('0x8d')](_0x232711)){var _0x1b5a83=[];for(var _0x3bea70=0x0;_0x3bea70<_0x232711['length'];_0x3bea70++){if(_0x232711[_0x3bea70][_0x3633('0x6b')]){_0x1b5a83[_0x3633('0x85')](db[_0x3633('0x8f')][_0x3633('0x75')]({'membername':_0x232711[_0x3bea70][_0x3633('0x2f')],'UserId':_0x232711[_0x3bea70]['id'],'queue_name':_0x52f249[_0x3633('0x2f')],'VoiceQueueId':_0x52f249['id'],'interface':_[_0x3633('0x78')](_0x232711[_0x3bea70][_0x3633('0x6d')])?util[_0x3633('0x79')]('SIP/%s',_0x232711[_0x3bea70][_0x3633('0x2f')]):_0x232711[_0x3bea70][_0x3633('0x6d')],'paused':_0x232711[_0x3bea70][_0x3633('0x6c')]||![],'penalty':_0x7f6b8a[_0x3633('0x57')][_0x3633('0x70')]||0x0}));}}return BPromise[_0x3633('0x94')](_0x1b5a83);}})[_0x3633('0x21')](function(){return _0x548836;})[_0x3633('0x21')](respondWithResult(_0x1752f4,null))[_0x3633('0x49')](handleError(_0x1752f4,null));};exports[_0x3633('0x8e')]=function(_0x3e5293,_0x3099d1,_0x29ec58){return db[_0x3633('0x45')]['find']({'where':{'id':_0x3e5293[_0x3633('0x59')]['id']}})[_0x3633('0x21')](handleEntityNotFound(_0x3099d1,null))[_0x3633('0x21')](function(_0x955d21){if(_0x955d21){return _0x955d21['removeAgents'](_0x3e5293[_0x3633('0x3a')][_0x3633('0x7d')])[_0x3633('0x21')](function(){if(_[_0x3633('0x95')](_0x3e5293[_0x3633('0x3a')][_0x3633('0x7d')])){for(var _0x155d84=0x0;_0x155d84<_0x3e5293['query']['ids'][_0x3633('0x3c')];_0x155d84+=0x1){socket[_0x3633('0x7b')](_0x3633('0x90'),{'UserId':Number(_0x3e5293[_0x3633('0x3a')][_0x3633('0x7d')][_0x155d84]),'VoiceQueueId':Number(_0x3e5293[_0x3633('0x59')]['id'])});}}else{socket[_0x3633('0x7b')](_0x3633('0x90'),{'UserId':Number(_0x3e5293[_0x3633('0x3a')]['ids']),'VoiceQueueId':Number(_0x3e5293[_0x3633('0x59')]['id'])});}});}})['then'](function(_0x2b2159){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x3e5293[_0x3633('0x59')]['id'],'UserId':_0x3e5293[_0x3633('0x3a')][_0x3633('0x7d')]}})['then'](function(){return _0x2b2159;});})[_0x3633('0x21')](respondWithStatusCode(_0x3099d1,null))[_0x3633('0x49')](handleError(_0x3099d1,null));};exports['getAgents']=function(_0x146243,_0x3bc55b,_0x27fee3){var _0x53b8a8={};var _0x3ae76a={};var _0x283bce;var _0x37a537;return db[_0x3633('0x45')]['findOne']({'where':{'id':_0x146243[_0x3633('0x59')]['id']}})['then'](handleEntityNotFound(_0x3bc55b,null))[_0x3633('0x21')](function(_0x13886d){if(_0x13886d){_0x283bce=_0x13886d;_0x3ae76a['model']=_['keys'](db[_0x3633('0x69')][_0x3633('0x34')]);_0x3ae76a[_0x3633('0x3a')]=_[_0x3633('0x37')](_0x146243[_0x3633('0x3a')]);_0x3ae76a[_0x3633('0x38')]=_[_0x3633('0x39')](_0x3ae76a[_0x3633('0x36')],_0x3ae76a[_0x3633('0x3a')]);_0x53b8a8[_0x3633('0x3b')]=_[_0x3633('0x39')](_0x3ae76a[_0x3633('0x36')],qs['fields'](_0x146243[_0x3633('0x3a')][_0x3633('0x4b')]));_0x53b8a8[_0x3633('0x3b')]=_0x53b8a8[_0x3633('0x3b')][_0x3633('0x3c')]?_0x53b8a8[_0x3633('0x3b')]:_0x3ae76a[_0x3633('0x36')];_0x53b8a8[_0x3633('0x3f')]=qs[_0x3633('0x40')](_0x146243[_0x3633('0x3a')]['sort']);_0x53b8a8[_0x3633('0x41')]=qs['filters'](_[_0x3633('0x5d')](_0x146243['query'],_0x3ae76a[_0x3633('0x38')]));if(_0x146243[_0x3633('0x3a')][_0x3633('0x28')]){_0x53b8a8[_0x3633('0x41')]=_[_0x3633('0x42')](_0x53b8a8['where'],{'$or':_[_0x3633('0x2a')](_0x53b8a8[_0x3633('0x3b')],function(_0x330462){var _0x184dab={};_0x184dab[_0x330462]={'$like':'%'+_0x146243[_0x3633('0x3a')][_0x3633('0x28')]+'%'};return _0x184dab;})});}_0x53b8a8=_['merge']({},_0x53b8a8,_0x146243[_0x3633('0x44')]);return _0x283bce['getAgents'](_0x53b8a8);}})[_0x3633('0x21')](function(_0x318cba){if(_0x318cba){_0x37a537=_0x318cba[_0x3633('0x3c')];if(!_0x146243[_0x3633('0x3a')][_0x3633('0x3d')](_0x3633('0x3e'))){_0x53b8a8[_0x3633('0x1a')]=qs['limit'](_0x146243[_0x3633('0x3a')][_0x3633('0x1a')]);_0x53b8a8[_0x3633('0x17')]=qs[_0x3633('0x17')](_0x146243[_0x3633('0x3a')]['offset']);}return _0x283bce[_0x3633('0x96')](_0x53b8a8);}})[_0x3633('0x21')](function(_0x590998){if(_0x590998){return _0x590998?{'count':_0x37a537,'rows':_0x590998}:null;}})[_0x3633('0x21')](respondWithResult(_0x3bc55b,null))[_0x3633('0x49')](handleError(_0x3bc55b,null));};exports[_0x3633('0x97')]=function(_0x396221,_0x3b39b1,_0x1728e9){var _0x983b52={};var _0xb8b98e={};var _0x14c444;var _0x5a01e9;return db[_0x3633('0x45')]['findOne']({'where':{'id':_0x396221[_0x3633('0x59')]['id']}})[_0x3633('0x21')](handleEntityNotFound(_0x3b39b1,null))[_0x3633('0x21')](function(_0xac7ace){if(_0xac7ace){_0x14c444=_0xac7ace;_0xb8b98e[_0x3633('0x36')]=_[_0x3633('0x37')](db[_0x3633('0x8f')][_0x3633('0x34')]);_0xb8b98e[_0x3633('0x3a')]=_[_0x3633('0x37')](_0x396221['query']);_0xb8b98e[_0x3633('0x38')]=_['intersection'](_0xb8b98e[_0x3633('0x36')],_0xb8b98e[_0x3633('0x3a')]);_0x983b52['attributes']=_[_0x3633('0x39')](_0xb8b98e[_0x3633('0x36')],qs[_0x3633('0x4b')](_0x396221['query']['fields']));_0x983b52[_0x3633('0x3b')]=_0x983b52[_0x3633('0x3b')][_0x3633('0x3c')]?_0x983b52[_0x3633('0x3b')]:_0xb8b98e[_0x3633('0x36')];_0x983b52[_0x3633('0x3f')]=qs['sort'](_0x396221['query'][_0x3633('0x40')]);_0x983b52[_0x3633('0x41')]=qs['filters'](_[_0x3633('0x5d')](_0x396221[_0x3633('0x3a')],_0xb8b98e[_0x3633('0x38')]));if(_0x396221[_0x3633('0x3a')][_0x3633('0x28')]){_0x983b52[_0x3633('0x41')]=_[_0x3633('0x42')](_0x983b52[_0x3633('0x41')],{'$or':_['map'](_0x983b52[_0x3633('0x3b')],function(_0x172dc6){var _0x2a51e0={};_0x2a51e0[_0x172dc6]={'$like':'%'+_0x396221[_0x3633('0x3a')][_0x3633('0x28')]+'%'};return _0x2a51e0;})});}_0x983b52=_[_0x3633('0x42')]({},_0x983b52,_0x396221['options']);return _0x14c444[_0x3633('0x97')](_0x983b52);}})[_0x3633('0x21')](function(_0x145ff0){if(_0x145ff0){_0x5a01e9=_0x145ff0[_0x3633('0x3c')];if(!_0x396221['query']['hasOwnProperty']('nolimit')){_0x983b52[_0x3633('0x1a')]=qs[_0x3633('0x1a')](_0x396221[_0x3633('0x3a')][_0x3633('0x1a')]);_0x983b52['offset']=qs[_0x3633('0x17')](_0x396221[_0x3633('0x3a')]['offset']);}return _0x14c444[_0x3633('0x97')](_0x983b52);}})['then'](function(_0x1197d6){return _0x1197d6?{'count':_0x5a01e9,'rows':_0x1197d6}:null;})[_0x3633('0x21')](respondWithResult(_0x3b39b1,null))[_0x3633('0x49')](handleError(_0x3b39b1,null));};exports[_0x3633('0x98')]=function(_0x1a46bf,_0x95b8f8,_0xc4c6b6){var _0x5c4316={};var _0x1bd39b={};var _0x4c24de;var _0x1de0e1;return db[_0x3633('0x45')]['findOne']({'where':{'id':_0x1a46bf[_0x3633('0x59')]['id']}})['then'](handleEntityNotFound(_0x95b8f8,null))['then'](function(_0x4a09ef){if(_0x4a09ef){_0x4c24de=_0x4a09ef;_0x1bd39b[_0x3633('0x36')]=_['keys'](db[_0x3633('0x99')][_0x3633('0x34')]);_0x1bd39b['query']=_[_0x3633('0x37')](_0x1a46bf[_0x3633('0x3a')]);_0x1bd39b[_0x3633('0x38')]=_['intersection'](_0x1bd39b[_0x3633('0x36')],_0x1bd39b[_0x3633('0x3a')]);_0x5c4316[_0x3633('0x3b')]=_[_0x3633('0x39')](_0x1bd39b[_0x3633('0x36')],qs[_0x3633('0x4b')](_0x1a46bf['query']['fields']));_0x5c4316[_0x3633('0x3b')]=_0x5c4316[_0x3633('0x3b')][_0x3633('0x3c')]?_0x5c4316[_0x3633('0x3b')]:_0x1bd39b[_0x3633('0x36')];_0x5c4316['order']=qs['sort'](_0x1a46bf[_0x3633('0x3a')][_0x3633('0x40')]);_0x5c4316[_0x3633('0x41')]=qs[_0x3633('0x38')](_[_0x3633('0x5d')](_0x1a46bf[_0x3633('0x3a')],_0x1bd39b[_0x3633('0x38')]));if(_0x1a46bf[_0x3633('0x3a')][_0x3633('0x28')]){_0x5c4316[_0x3633('0x41')]=_[_0x3633('0x42')](_0x5c4316[_0x3633('0x41')],{'$or':_[_0x3633('0x2a')](_0x5c4316['attributes'],function(_0x6eb37f){var _0x2518ac={};_0x2518ac[_0x6eb37f]={'$like':'%'+_0x1a46bf[_0x3633('0x3a')][_0x3633('0x28')]+'%'};return _0x2518ac;})});}_0x5c4316=_[_0x3633('0x42')]({},_0x5c4316,_0x1a46bf[_0x3633('0x44')]);return _0x4c24de[_0x3633('0x98')](_0x5c4316);}})['then'](function(_0x2f9829){if(_0x2f9829){_0x1de0e1=_0x2f9829[_0x3633('0x3c')];if(!_0x1a46bf[_0x3633('0x3a')][_0x3633('0x3d')](_0x3633('0x3e'))){_0x5c4316[_0x3633('0x1a')]=qs[_0x3633('0x1a')](_0x1a46bf[_0x3633('0x3a')][_0x3633('0x1a')]);_0x5c4316[_0x3633('0x17')]=qs['offset'](_0x1a46bf['query'][_0x3633('0x17')]);}return _0x4c24de[_0x3633('0x98')](_0x5c4316);}})[_0x3633('0x21')](function(_0x21aa2c){if(_0x21aa2c){return _0x21aa2c?{'count':_0x1de0e1,'rows':_0x21aa2c}:null;}})[_0x3633('0x21')](respondWithResult(_0x95b8f8,null))[_0x3633('0x49')](handleError(_0x95b8f8,null));};exports[_0x3633('0x9a')]=function(_0x3b3ed8,_0x2d549f,_0x185649){var _0x2cc226=moment()[_0x3633('0x79')](_0x3633('0x9b'));var _0x42be19,_0x1c2dc4;return db[_0x3633('0x45')][_0x3633('0x2e')]({'where':{'id':_0x3b3ed8['params']['id']}})['then'](handleEntityNotFound(_0x2d549f,null))[_0x3633('0x21')](function(_0x5ccdaa){if(_0x5ccdaa){_0x1c2dc4=_0x5ccdaa;return _0x5ccdaa[_0x3633('0x9a')](_0x3b3ed8[_0x3633('0x57')][_0x3633('0x7d')],_[_0x3633('0x92')](_0x3b3ed8[_0x3633('0x57')],[_0x3633('0x7d'),'id'])||{});}return null;})[_0x3633('0x93')](function(_0x2be9db){var _0x3fc8ce;_0x42be19=_0x2be9db||[];var _0x1c0189=[];if(_0x2be9db){for(var _0x64813=0x0;_0x64813<_0x2be9db[_0x3633('0x3c')];_0x64813+=0x1){var _0xb3ba76=_0x2be9db[_0x64813][_0x3633('0x23')]({'plain':!![]});_0x1c2dc4[_0x3633('0x9c')]=_0x3b3ed8[_0x3633('0x57')][_0x3633('0x9c')]?_0x3b3ed8[_0x3633('0x57')][_0x3633('0x9c')]:_0x1c2dc4['dialCheckDuplicateType'];switch(_0x1c2dc4[_0x3633('0x9c')]){case _0x3633('0x9d'):_0x3fc8ce=squel[_0x3633('0x9e')]()[_0x3633('0x9f')](_0x3633('0xa0'))[_0x3633('0xa1')](['phone',_0x3633('0xa2'),_0x3633('0xa3'),_0x3633('0xa4'),'VoiceQueueId',_0x3633('0x55'),_0x3633('0x56')],squel[_0x3633('0xa5')]()[_0x3633('0x7e')]('phone',_0x3633('0xa6'))[_0x3633('0x7e')]('\x27'+_0x2cc226+'\x27',_0x3633('0xa2'))[_0x3633('0x7e')]('id','ContactId')['field'](_0xb3ba76[_0x3633('0xa7')][_0x3633('0x86')](),'ListId')['field'](_0x3b3ed8[_0x3633('0x59')]['id'][_0x3633('0x86')](),_0x3633('0x5e'))['field']('\x27'+_0x2cc226+'\x27',_0x3633('0x55'))[_0x3633('0x7e')]('\x27'+_0x2cc226+'\x27',_0x3633('0x56'))['from']('cm_contacts')[_0x3633('0x41')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0xb3ba76['CmListId'][_0x3633('0x86')]())['where'](_0x3633('0xa8'))[_0x3633('0x41')](_0x3633('0xa9'),squel['select']()['field']('COALESCE(calleridnum,\x27\x27)')['from'](_0x3633('0xaa'))[_0x3633('0x41')]('VoiceQueueId\x20=\x20?',_0x3b3ed8[_0x3633('0x59')]['id']['toString']()))[_0x3633('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3633('0xa5')]()[_0x3633('0x7e')](_0x3633('0xab'))[_0x3633('0x80')](_0x3633('0xa0'))[_0x3633('0x41')](_0x3633('0x83'),_0x3b3ed8['params']['id']['toString']())))[_0x3633('0x86')]();break;case _0x3633('0xac'):_0x3fc8ce=squel['insert']()[_0x3633('0x9f')]('cm_hopper')['fromQuery'](['phone',_0x3633('0xa2'),_0x3633('0xa3'),_0x3633('0xa4'),_0x3633('0x5e'),_0x3633('0x55'),_0x3633('0x56')],squel[_0x3633('0xa5')]()[_0x3633('0x7e')](_0x3633('0xa6'),_0x3633('0xa6'))['field']('\x27'+_0x2cc226+'\x27',_0x3633('0xa2'))['field']('id',_0x3633('0xa3'))[_0x3633('0x7e')](_0xb3ba76[_0x3633('0xa7')][_0x3633('0x86')](),'ListId')[_0x3633('0x7e')](_0x3b3ed8[_0x3633('0x59')]['id'][_0x3633('0x86')](),_0x3633('0x5e'))[_0x3633('0x7e')]('\x27'+_0x2cc226+'\x27','createdAt')[_0x3633('0x7e')]('\x27'+_0x2cc226+'\x27',_0x3633('0x56'))[_0x3633('0x80')](_0x3633('0xad'))['where']('deletedAt\x20IS\x20NULL')[_0x3633('0x41')](_0x3633('0xae'),_0xb3ba76['CmListId'][_0x3633('0x86')]())[_0x3633('0x41')](_0x3633('0xa8'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x3633('0xa5')]()[_0x3633('0x7e')]('COALESCE(phone,\x27\x27)')[_0x3633('0x80')](_0x3633('0xa0'))['where'](_0x3633('0x83'),_0x3b3ed8[_0x3633('0x59')]['id']['toString']())))[_0x3633('0x86')]();break;default:_0x3fc8ce=squel[_0x3633('0x9e')]()[_0x3633('0x9f')](_0x3633('0xa0'))[_0x3633('0xa1')](['phone',_0x3633('0xa2'),_0x3633('0xa3'),_0x3633('0xa4'),_0x3633('0x5e'),_0x3633('0x55'),_0x3633('0x56')],squel[_0x3633('0xa5')]()[_0x3633('0x7e')]('phone',_0x3633('0xa6'))[_0x3633('0x7e')]('\x27'+_0x2cc226+'\x27',_0x3633('0xa2'))['field']('id',_0x3633('0xa3'))[_0x3633('0x7e')](_0xb3ba76[_0x3633('0xa7')][_0x3633('0x86')](),_0x3633('0xa4'))[_0x3633('0x7e')](_0x3b3ed8[_0x3633('0x59')]['id'][_0x3633('0x86')](),_0x3633('0x5e'))[_0x3633('0x7e')]('\x27'+_0x2cc226+'\x27',_0x3633('0x55'))[_0x3633('0x7e')]('\x27'+_0x2cc226+'\x27','updatedAt')['from'](_0x3633('0xad'))[_0x3633('0x41')]('deletedAt\x20IS\x20NULL')[_0x3633('0x41')](_0x3633('0xae'),_0xb3ba76[_0x3633('0xa7')][_0x3633('0x86')]())[_0x3633('0x41')]('phone\x20IS\x20NOT\x20NULL'))[_0x3633('0x86')]();}_0x1c0189[_0x3633('0x85')](db[_0x3633('0x71')]['query'](_0x3fc8ce));}return BPromise[_0x3633('0x94')](_0x1c0189);}})['then'](function(){var _0x1fbd65=[];var _0x5694b9=squel['insert']()[_0x3633('0x9f')](_0x3633('0xaf'))[_0x3633('0xa1')](['CmHopperId','phone',_0x3633('0xb0'),_0x3633('0x55'),_0x3633('0x56')],squel[_0x3633('0xa5')]()['field']('h.id')['field'](_0x3633('0xb1'))['field'](_0x3633('0xb2'))['field']('\x27'+_0x2cc226+'\x27',_0x3633('0x55'))[_0x3633('0x7e')]('\x27'+_0x2cc226+'\x27',_0x3633('0x56'))['from'](_0x3633('0xb3'),'ci')[_0x3633('0xb4')](_0x3633('0xa0'),'h',_0x3633('0xb5'))[_0x3633('0x41')](_0x3633('0xb6'),_0x2cc226)[_0x3633('0x41')](_0x3633('0xb7'),_0x3633('0xb8')))['toString']();_0x1fbd65[_0x3633('0x85')](db[_0x3633('0x71')][_0x3633('0x3a')](_0x5694b9));return BPromise[_0x3633('0x94')](_0x1fbd65);})[_0x3633('0x21')](function(){return _0x42be19;})[_0x3633('0x21')](respondWithResult(_0x2d549f,null))[_0x3633('0x49')](handleError(_0x2d549f,null));};exports[_0x3633('0xb9')]=function(_0x4e5d4d,_0x4b8452,_0x3dbcf7){return db[_0x3633('0x45')]['find']({'where':{'id':_0x4e5d4d[_0x3633('0x59')]['id']}})['then'](handleEntityNotFound(_0x4b8452,null))[_0x3633('0x21')](function(_0x2baa5f){if(_0x2baa5f){return _0x2baa5f['removeLists'](_0x4e5d4d[_0x3633('0x3a')]['ids']);}})[_0x3633('0x21')](function(_0x2aa204){if(_0x2aa204){return db[_0x3633('0x5c')][_0x3633('0x22')]({'where':{'ListId':_0x4e5d4d[_0x3633('0x3a')]['ids'],'VoiceQueueId':_0x4e5d4d['params']['id']}})['then'](function(){return _0x2aa204;});}})[_0x3633('0x21')](respondWithStatusCode(_0x4b8452,null))[_0x3633('0x49')](handleError(_0x4b8452,null));};exports[_0x3633('0xba')]=function(_0x4ac614,_0x328314,_0x5f539e){var _0xcf3919={};var _0x28402a={};var _0x9137be;var _0x179c3b;return db['VoiceQueue'][_0x3633('0x5b')]({'where':{'id':_0x4ac614[_0x3633('0x59')]['id']}})[_0x3633('0x21')](handleEntityNotFound(_0x328314,null))[_0x3633('0x21')](function(_0x340722){if(_0x340722){_0x9137be=_0x340722;_0x28402a[_0x3633('0x36')]=_[_0x3633('0x37')](db['CmList']['rawAttributes']);_0x28402a[_0x3633('0x3a')]=_[_0x3633('0x37')](_0x4ac614[_0x3633('0x3a')]);_0x28402a[_0x3633('0x38')]=_['intersection'](_0x28402a[_0x3633('0x36')],_0x28402a[_0x3633('0x3a')]);_0xcf3919[_0x3633('0x3b')]=_['intersection'](_0x28402a['model'],qs[_0x3633('0x4b')](_0x4ac614[_0x3633('0x3a')][_0x3633('0x4b')]));_0xcf3919[_0x3633('0x3b')]=_0xcf3919['attributes'][_0x3633('0x3c')]?_0xcf3919['attributes']:_0x28402a[_0x3633('0x36')];_0xcf3919['order']=qs[_0x3633('0x40')](_0x4ac614['query'][_0x3633('0x40')]);_0xcf3919[_0x3633('0x41')]=qs[_0x3633('0x38')](_[_0x3633('0x5d')](_0x4ac614[_0x3633('0x3a')],_0x28402a['filters']));if(_0x4ac614['query'][_0x3633('0x28')]){_0xcf3919[_0x3633('0x41')]=_[_0x3633('0x42')](_0xcf3919['where'],{'$or':_['map'](_0xcf3919['attributes'],function(_0x1b141a){var _0x1f0997={};_0x1f0997[_0x1b141a]={'$like':'%'+_0x4ac614[_0x3633('0x3a')][_0x3633('0x28')]+'%'};return _0x1f0997;})});}_0xcf3919=_['merge']({},_0xcf3919,_0x4ac614[_0x3633('0x44')]);return _0x9137be['getBlackLists'](_0xcf3919);}})[_0x3633('0x21')](function(_0x5b8b74){if(_0x5b8b74){_0x179c3b=_0x5b8b74[_0x3633('0x3c')];if(!_0x4ac614[_0x3633('0x3a')][_0x3633('0x3d')](_0x3633('0x3e'))){_0xcf3919[_0x3633('0x1a')]=qs[_0x3633('0x1a')](_0x4ac614[_0x3633('0x3a')][_0x3633('0x1a')]);_0xcf3919[_0x3633('0x17')]=qs[_0x3633('0x17')](_0x4ac614['query'][_0x3633('0x17')]);}return _0x9137be['getBlackLists'](_0xcf3919);}})[_0x3633('0x21')](function(_0x18499a){if(_0x18499a){return _0x18499a?{'count':_0x179c3b,'rows':_0x18499a}:null;}})[_0x3633('0x21')](respondWithResult(_0x328314,null))[_0x3633('0x49')](handleError(_0x328314,null));};exports[_0x3633('0xbb')]=function(_0x15d5ae,_0x1044fe,_0x4858ca){var _0x18aeb5,_0x21e79d;return db[_0x3633('0x45')][_0x3633('0x2e')]({'where':{'id':_0x15d5ae['params']['id']}})['then'](handleEntityNotFound(_0x1044fe,null))[_0x3633('0x21')](function(_0x4243b8){if(_0x4243b8){_0x21e79d=_0x4243b8;return _0x4243b8[_0x3633('0xbb')](_0x15d5ae[_0x3633('0x57')][_0x3633('0x7d')],_[_0x3633('0x92')](_0x15d5ae['body'],[_0x3633('0x7d'),'id'])||{});}return null;})[_0x3633('0x93')](function(_0xdc1316){var _0x3b23b8;_0x18aeb5=_0xdc1316||[];var _0x4ed255=[];if(_0xdc1316){for(var _0x3e2485=0x0;_0x3e2485<_0xdc1316['length'];_0x3e2485+=0x1){var _0x2e5985=_0xdc1316[_0x3e2485]['get']({'plain':!![]});_0x3b23b8=squel[_0x3633('0x9e')]()[_0x3633('0x9f')](_0x3633('0xbc'))[_0x3633('0xa1')]([_0x3633('0xa6'),'ContactId',_0x3633('0xa4'),_0x3633('0x5e'),_0x3633('0x55'),'updatedAt'],squel[_0x3633('0xa5')]()[_0x3633('0x7e')](_0x3633('0xa6'),_0x3633('0xa6'))['field']('id',_0x3633('0xa3'))[_0x3633('0x7e')](_0x2e5985[_0x3633('0xa7')]['toString'](),'ListId')['field'](_0x15d5ae[_0x3633('0x59')]['id'][_0x3633('0x86')](),'VoiceQueueId')['field'](_0x3633('0xbd'),_0x3633('0x55'))[_0x3633('0x7e')](_0x3633('0xbd'),_0x3633('0x56'))['from'](_0x3633('0xad'))[_0x3633('0x41')](_0x3633('0xbe'))[_0x3633('0x41')](_0x3633('0xae'),_0x2e5985[_0x3633('0xa7')]['toString']())[_0x3633('0x41')](_0x3633('0xa8')))[_0x3633('0x86')]();_0x4ed255[_0x3633('0x85')](db[_0x3633('0x71')][_0x3633('0x3a')](_0x3b23b8));}return BPromise[_0x3633('0x94')](_0x4ed255);}})[_0x3633('0x21')](function(){return _0x18aeb5;})[_0x3633('0x21')](respondWithResult(_0x1044fe,null))[_0x3633('0x49')](handleError(_0x1044fe,null));};exports[_0x3633('0xbf')]=function(_0x54b734,_0x3fba89,_0x509bde){return db['VoiceQueue'][_0x3633('0x2e')]({'where':{'id':_0x54b734['params']['id']}})['then'](handleEntityNotFound(_0x3fba89,null))[_0x3633('0x21')](function(_0x227497){if(_0x227497){return _0x227497[_0x3633('0xbf')](_0x54b734[_0x3633('0x3a')][_0x3633('0x7d')]);}})['then'](function(_0x56701b){if(_0x56701b){return db[_0x3633('0x64')][_0x3633('0x22')]({'where':{'ListId':_0x54b734[_0x3633('0x3a')]['ids'],'VoiceQueueId':_0x54b734[_0x3633('0x59')]['id']}})[_0x3633('0x21')](function(){return _0x56701b;});}})[_0x3633('0x21')](respondWithStatusCode(_0x3fba89,null))[_0x3633('0x49')](handleError(_0x3fba89,null));};
\ No newline at end of file
+var _0x1b94=['rawAttributes','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','createdAt','updatedAt','body','getHoppers','findOne','CmHopper','VoiceQueueId','findAll','rows','CmHopperHistory','include','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','Agents','online','voicePause','interface','flatMap','forEach','penalty','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','isNil','format','emit','userVoiceQueue:save','User','tq.TeamId','from','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','all','union','compact','ids','isEmpty','removeAgents','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','spread','SIP/%s','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','CmListId','ListId','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','onlyIfOpen','insert','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','CmHopperId','OrderBy','h.id','ci.OrderBy+1','h.ContactId=ci.CmContactId','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','offset','undefined','limit','count','set','json','apply','save','update','then','destroy','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','includes','value','type','end','error','stack','name','send','index','VoiceQueue','fieldName','key','keys','filters','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','options','includeAll','show','params'];(function(_0x51f054,_0x21d017){var _0x241b9f=function(_0x2cec91){while(--_0x2cec91){_0x51f054['push'](_0x51f054['shift']());}};_0x241b9f(++_0x21d017);}(_0x1b94,0x1f2));var _0x41b9=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x1b94[_0x2261ce];return _0x524640;};'use strict';var emlformat=require(_0x41b9('0x0'));var rimraf=require(_0x41b9('0x1'));var zipdir=require(_0x41b9('0x2'));var jsonpatch=require(_0x41b9('0x3'));var rp=require(_0x41b9('0x4'));var moment=require('moment');var BPromise=require(_0x41b9('0x5'));var Mustache=require(_0x41b9('0x6'));var util=require(_0x41b9('0x7'));var path=require('path');var sox=require(_0x41b9('0x8'));var csv=require(_0x41b9('0x9'));var ejs=require(_0x41b9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x41b9('0xb'));var squel=require(_0x41b9('0xc'));var crypto=require(_0x41b9('0xd'));var jsforce=require(_0x41b9('0xe'));var deskjs=require(_0x41b9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x41b9('0x10'));var Papa=require(_0x41b9('0x11'));var Redis=require('ioredis');var authService=require(_0x41b9('0x12'));var qs=require(_0x41b9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x41b9('0x14'));var logger=require(_0x41b9('0x15'))('api');var utils=require(_0x41b9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x41b9('0x17'));var db=require('../../mysqldb')['db'];config[_0x41b9('0x18')]=_[_0x41b9('0x19')](config[_0x41b9('0x18')],{'host':_0x41b9('0x1a'),'port':0x18eb});var socket=require(_0x41b9('0x1b'))(new Redis(config['redis']));require(_0x41b9('0x1c'))[_0x41b9('0x1d')](socket);function respondWithStatusCode(_0x5187a8,_0x44ee18){_0x44ee18=_0x44ee18||0xcc;return function(_0x134902){if(_0x134902){return _0x5187a8[_0x41b9('0x1e')](_0x44ee18);}return _0x5187a8[_0x41b9('0x1f')](_0x44ee18)['end']();};}function respondWithResult(_0x5849aa,_0x4a6357){_0x4a6357=_0x4a6357||0xc8;return function(_0x2d7bf0){if(_0x2d7bf0){return _0x5849aa[_0x41b9('0x1f')](_0x4a6357)['json'](_0x2d7bf0);}};}function respondWithFilteredResult(_0x56bd5e,_0x2414c8){return function(_0xfb3b46){if(_0xfb3b46){var _0x17b811=typeof _0x2414c8[_0x41b9('0x20')]===_0x41b9('0x21')&&typeof _0x2414c8[_0x41b9('0x22')]==='undefined';var _0x10bfdf=_0xfb3b46[_0x41b9('0x23')];var _0x5bc794=_0x17b811?0x0:_0x2414c8[_0x41b9('0x20')];var _0x2f6b69=_0x17b811?_0xfb3b46[_0x41b9('0x23')]:_0x2414c8[_0x41b9('0x20')]+_0x2414c8[_0x41b9('0x22')];var _0x1893ca;if(_0x2f6b69>=_0x10bfdf){_0x2f6b69=_0x10bfdf;_0x1893ca=0xc8;}else{_0x1893ca=0xce;}_0x56bd5e['status'](_0x1893ca);return _0x56bd5e[_0x41b9('0x24')]('Content-Range',_0x5bc794+'-'+_0x2f6b69+'/'+_0x10bfdf)[_0x41b9('0x25')](_0xfb3b46);}return null;};}function patchUpdates(_0x14dc16){return function(_0x27b024){try{jsonpatch[_0x41b9('0x26')](_0x27b024,_0x14dc16,!![]);}catch(_0x2fe95){return BPromise['reject'](_0x2fe95);}return _0x27b024[_0x41b9('0x27')]();};}function saveUpdates(_0x50e26b,_0x5553ca){return function(_0x59f751){if(_0x59f751){return _0x59f751[_0x41b9('0x28')](_0x50e26b)[_0x41b9('0x29')](function(_0xfc833b){return _0xfc833b;});}return null;};}function removeEntity(_0x2228d8,_0x136b46){return function(_0x465280){if(_0x465280){return _0x465280[_0x41b9('0x2a')]()[_0x41b9('0x29')](function(){var _0x18ea59=_0x465280['get']({'plain':!![]});var _0x516845=[{'name':_0x41b9('0x2b'),'value':_0x41b9('0x2c'),'ignore':![]},{'name':_0x41b9('0x2d'),'value':_0x41b9('0x2e'),'ignore':![]}];var _0x3dffb2=_(_0x516845)[_0x41b9('0x2f')](_0x41b9('0x30'))[_0x41b9('0x31')]('value')['value']();if(_[_0x41b9('0x32')](_0x3dffb2,_0x18ea59['type'])){return;}var _0x6de6c5=_['find'](_0x516845,[_0x41b9('0x33'),_0x18ea59[_0x41b9('0x34')]])['name'];return db['UserProfileResource'][_0x41b9('0x2a')]({'where':{'type':_0x6de6c5,'resourceId':_0x18ea59['id']}})[_0x41b9('0x29')](function(){return _0x465280;});})['then'](function(){_0x2228d8[_0x41b9('0x1f')](0xcc)[_0x41b9('0x35')]();});}};}function handleEntityNotFound(_0x487477,_0x62770){return function(_0x4d9732){if(!_0x4d9732){_0x487477['sendStatus'](0x194);}return _0x4d9732;};}function handleError(_0x279cec,_0x56f738){_0x56f738=_0x56f738||0x1f4;return function(_0xaeeefd){logger[_0x41b9('0x36')](_0xaeeefd[_0x41b9('0x37')]);if(_0xaeeefd['name']){delete _0xaeeefd[_0x41b9('0x38')];}_0x279cec[_0x41b9('0x1f')](_0x56f738)[_0x41b9('0x39')](_0xaeeefd);};}exports[_0x41b9('0x3a')]=function(_0x699060,_0x2d7414){var _0x411e26={},_0x395c1e={},_0x341ebf={'count':0x0,'rows':[]};var _0x1434b8=_[_0x41b9('0x31')](db[_0x41b9('0x3b')]['rawAttributes'],function(_0x433b95){return{'name':_0x433b95[_0x41b9('0x3c')],'type':_0x433b95[_0x41b9('0x34')][_0x41b9('0x3d')]};});_0x395c1e['model']=_[_0x41b9('0x31')](_0x1434b8,'name');_0x395c1e['query']=_[_0x41b9('0x3e')](_0x699060['query']);_0x395c1e[_0x41b9('0x3f')]=_['intersection'](_0x395c1e[_0x41b9('0x40')],_0x395c1e[_0x41b9('0x41')]);_0x411e26[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x395c1e[_0x41b9('0x40')],qs[_0x41b9('0x44')](_0x699060['query']['fields']));_0x411e26[_0x41b9('0x42')]=_0x411e26[_0x41b9('0x42')]['length']?_0x411e26[_0x41b9('0x42')]:_0x395c1e[_0x41b9('0x40')];if(!_0x699060[_0x41b9('0x41')][_0x41b9('0x45')](_0x41b9('0x46'))){_0x411e26[_0x41b9('0x22')]=qs[_0x41b9('0x22')](_0x699060[_0x41b9('0x41')][_0x41b9('0x22')]);_0x411e26[_0x41b9('0x20')]=qs['offset'](_0x699060['query'][_0x41b9('0x20')]);}_0x411e26[_0x41b9('0x47')]=qs[_0x41b9('0x48')](_0x699060[_0x41b9('0x41')]['sort']);_0x411e26['where']=qs['filters'](_[_0x41b9('0x49')](_0x699060[_0x41b9('0x41')],_0x395c1e[_0x41b9('0x3f')]),_0x1434b8);if(_0x699060['query']['filter']){_0x411e26['where']=_[_0x41b9('0x4a')](_0x411e26[_0x41b9('0x4b')],{'$or':_[_0x41b9('0x31')](_0x1434b8,function(_0x4a221c){if(_0x4a221c[_0x41b9('0x34')]!==_0x41b9('0x4c')){var _0x2b78c5={};_0x2b78c5[_0x4a221c['name']]={'$like':'%'+_0x699060['query'][_0x41b9('0x2f')]+'%'};return _0x2b78c5;}})});}_0x411e26=_[_0x41b9('0x4a')]({},_0x411e26,_0x699060[_0x41b9('0x4d')]);var _0x5560d0={'where':_0x411e26[_0x41b9('0x4b')]};return db[_0x41b9('0x3b')][_0x41b9('0x23')](_0x5560d0)['then'](function(_0x120b34){_0x341ebf[_0x41b9('0x23')]=_0x120b34;if(_0x699060[_0x41b9('0x41')][_0x41b9('0x4e')]){_0x411e26['include']=[{'all':!![]}];}return db[_0x41b9('0x3b')]['findAll'](_0x411e26);})[_0x41b9('0x29')](function(_0x10f1dd){_0x341ebf['rows']=_0x10f1dd;return _0x341ebf;})[_0x41b9('0x29')](respondWithFilteredResult(_0x2d7414,_0x411e26))['catch'](handleError(_0x2d7414,null));};exports[_0x41b9('0x4f')]=function(_0x567c2d,_0x5427f7){var _0x411eeb={'raw':![],'where':{'id':_0x567c2d[_0x41b9('0x50')]['id']}},_0x557c94={};_0x557c94['model']=_[_0x41b9('0x3e')](db[_0x41b9('0x3b')][_0x41b9('0x51')]);_0x557c94[_0x41b9('0x41')]=_[_0x41b9('0x3e')](_0x567c2d[_0x41b9('0x41')]);_0x557c94[_0x41b9('0x3f')]=_['intersection'](_0x557c94[_0x41b9('0x40')],_0x557c94[_0x41b9('0x41')]);_0x411eeb[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x557c94[_0x41b9('0x40')],qs[_0x41b9('0x44')](_0x567c2d[_0x41b9('0x41')][_0x41b9('0x44')]));_0x411eeb[_0x41b9('0x42')]=_0x411eeb['attributes']['length']?_0x411eeb['attributes']:_0x557c94[_0x41b9('0x40')];if(_0x567c2d[_0x41b9('0x41')]['includeAll']){_0x411eeb['include']=[{'all':!![]}];}_0x411eeb=_[_0x41b9('0x4a')]({},_0x411eeb,_0x567c2d[_0x41b9('0x4d')]);return db[_0x41b9('0x3b')][_0x41b9('0x52')](_0x411eeb)[_0x41b9('0x29')](handleEntityNotFound(_0x5427f7,null))[_0x41b9('0x29')](respondWithResult(_0x5427f7,null))[_0x41b9('0x53')](handleError(_0x5427f7,null));};exports['create']=function(_0x430073,_0x1361c2){return db[_0x41b9('0x3b')][_0x41b9('0x54')](_0x430073['body'],{})['then'](function(_0x16cfd8){var _0x38904e=_0x430073[_0x41b9('0x55')]['get']({'plain':!![]});if(!_0x38904e)throw new Error(_0x41b9('0x56'));if(_0x38904e[_0x41b9('0x57')]===_0x41b9('0x55')){var _0x2da43d=_0x16cfd8[_0x41b9('0x58')]({'plain':!![]});var _0x254e90=[{'name':'VoiceQueues','value':_0x41b9('0x2c')},{'name':_0x41b9('0x2d'),'value':_0x41b9('0x2e')}];var _0x1f0ee3=_[_0x41b9('0x52')](_0x254e90,[_0x41b9('0x33'),_0x2da43d['type']])['name'];return db[_0x41b9('0x59')]['find']({'where':{'name':_0x1f0ee3,'userProfileId':_0x38904e[_0x41b9('0x5a')]},'raw':!![]})[_0x41b9('0x29')](function(_0x49aedd){if(_0x49aedd&&_0x49aedd[_0x41b9('0x5b')]===0x0){return db[_0x41b9('0x5c')][_0x41b9('0x54')]({'name':_0x2da43d['name'],'resourceId':_0x2da43d['id'],'type':_0x49aedd['name'],'sectionId':_0x49aedd['id']},{})['then'](function(){return _0x16cfd8;});}else{return _0x16cfd8;}})[_0x41b9('0x53')](function(_0x578a4f){logger[_0x41b9('0x36')](_0x41b9('0x5d'),_0x578a4f);throw _0x578a4f;});}return _0x16cfd8;})['then'](respondWithResult(_0x1361c2,0xc9))['catch'](handleError(_0x1361c2,null));};exports[_0x41b9('0x5e')]=function(_0x20699b,_0x45a58e){var _0x5600da={'where':{'id':_0x20699b[_0x41b9('0x50')]['id']}},_0x704416={};_0x704416[_0x41b9('0x40')]=_[_0x41b9('0x3e')](db['VoiceQueue'][_0x41b9('0x51')]);_0x5600da[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x704416['model'],qs[_0x41b9('0x44')](_0x20699b[_0x41b9('0x41')][_0x41b9('0x44')]));_0x5600da[_0x41b9('0x42')]=_0x5600da[_0x41b9('0x42')][_0x41b9('0x5f')]?_0x5600da[_0x41b9('0x42')]:_0x704416[_0x41b9('0x40')];if(_0x20699b[_0x41b9('0x41')][_0x41b9('0x4e')]){_0x5600da['include']=[{'all':!![]}];}_0x5600da=_[_0x41b9('0x4a')]({},_0x5600da,_0x20699b['options']);return db[_0x41b9('0x3b')][_0x41b9('0x52')](_0x5600da)[_0x41b9('0x29')](handleEntityNotFound(_0x45a58e,null))[_0x41b9('0x29')](function(_0x3f0055){if(_0x3f0055){var _0x22922c=_0x3f0055[_0x41b9('0x58')]({'plain':!![]});_0x22922c=qs[_0x41b9('0x60')](_0x22922c,['id',_0x41b9('0x61'),_0x41b9('0x62')]);_0x20699b[_0x41b9('0x63')]=_[_0x41b9('0x60')](_0x20699b[_0x41b9('0x63')],['id','createdAt',_0x41b9('0x62')]);return db[_0x41b9('0x3b')][_0x41b9('0x54')](_[_0x41b9('0x4a')](_0x22922c,_0x20699b[_0x41b9('0x63')]),{'include':_0x20699b['query'][_0x41b9('0x4e')]?[{'all':!![]}]:undefined})[_0x41b9('0x29')](function(_0x583506){var _0x29b60b=_0x20699b[_0x41b9('0x55')][_0x41b9('0x58')]({'plain':!![]});if(!_0x29b60b)throw new Error(_0x41b9('0x56'));if(_0x29b60b[_0x41b9('0x57')]===_0x41b9('0x55')){var _0x28c18b=_0x583506['get']({'plain':!![]});var _0x1a7034=[{'name':_0x41b9('0x2b'),'value':_0x41b9('0x2c')},{'name':_0x41b9('0x2d'),'value':_0x41b9('0x2e')}];var _0x1273ad=_[_0x41b9('0x52')](_0x1a7034,['value',_0x28c18b[_0x41b9('0x34')]])['name'];return db[_0x41b9('0x59')][_0x41b9('0x52')]({'where':{'name':_0x1273ad,'userProfileId':_0x29b60b[_0x41b9('0x5a')]},'raw':!![]})[_0x41b9('0x29')](function(_0x51604c){if(_0x51604c&&_0x51604c[_0x41b9('0x5b')]===0x0){return db[_0x41b9('0x5c')]['create']({'name':_0x28c18b[_0x41b9('0x38')],'resourceId':_0x28c18b['id'],'type':_0x51604c[_0x41b9('0x38')],'sectionId':_0x51604c['id']},{})[_0x41b9('0x29')](function(){return _0x583506;});}else{return _0x583506;}})['catch'](function(_0x17a7dd){logger[_0x41b9('0x36')](_0x41b9('0x5d'),_0x17a7dd);throw _0x17a7dd;});}return _0x583506;});}})[_0x41b9('0x29')](respondWithResult(_0x45a58e,0xc9))[_0x41b9('0x53')](handleError(_0x45a58e,null));};exports[_0x41b9('0x28')]=function(_0xe5099e,_0x477ba6){if(_0xe5099e[_0x41b9('0x63')]['id']){delete _0xe5099e['body']['id'];}return db[_0x41b9('0x3b')][_0x41b9('0x52')]({'where':{'id':_0xe5099e[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x477ba6,null))[_0x41b9('0x29')](saveUpdates(_0xe5099e[_0x41b9('0x63')],null))['then'](respondWithResult(_0x477ba6,null))['catch'](handleError(_0x477ba6,null));};exports[_0x41b9('0x2a')]=function(_0x21f807,_0x577d55){return db[_0x41b9('0x3b')]['find']({'where':{'id':_0x21f807[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x577d55,null))[_0x41b9('0x29')](removeEntity(_0x577d55,null))[_0x41b9('0x53')](handleError(_0x577d55,null));};exports[_0x41b9('0x64')]=function(_0x5c2ec4,_0x3c4506,_0x7cb52d){var _0xc9a5e={'raw':![],'where':{}};var _0x4e81aa={};var _0x8839c2={'count':0x0,'rows':[]};return db[_0x41b9('0x3b')][_0x41b9('0x65')]({'where':{'id':_0x5c2ec4[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x3c4506,null))[_0x41b9('0x29')](function(_0x542e2c){if(_0x542e2c){_0x4e81aa[_0x41b9('0x40')]=_[_0x41b9('0x3e')](db[_0x41b9('0x66')][_0x41b9('0x51')]);_0x4e81aa[_0x41b9('0x41')]=_['keys'](_0x5c2ec4['query']);_0x4e81aa[_0x41b9('0x3f')]=_['intersection'](_0x4e81aa['model'],_0x4e81aa[_0x41b9('0x41')]);_0xc9a5e['attributes']=_[_0x41b9('0x43')](_0x4e81aa[_0x41b9('0x40')],qs[_0x41b9('0x44')](_0x5c2ec4[_0x41b9('0x41')][_0x41b9('0x44')]));_0xc9a5e[_0x41b9('0x42')]=_0xc9a5e[_0x41b9('0x42')][_0x41b9('0x5f')]?_0xc9a5e[_0x41b9('0x42')]:_0x4e81aa[_0x41b9('0x40')];if(!_0x5c2ec4[_0x41b9('0x41')][_0x41b9('0x45')](_0x41b9('0x46'))){_0xc9a5e[_0x41b9('0x22')]=qs[_0x41b9('0x22')](_0x5c2ec4[_0x41b9('0x41')]['limit']);_0xc9a5e[_0x41b9('0x20')]=qs['offset'](_0x5c2ec4[_0x41b9('0x41')][_0x41b9('0x20')]);}_0xc9a5e[_0x41b9('0x47')]=qs['sort'](_0x5c2ec4[_0x41b9('0x41')][_0x41b9('0x48')]);_0xc9a5e[_0x41b9('0x4b')]=qs['filters'](_[_0x41b9('0x49')](_0x5c2ec4[_0x41b9('0x41')],_0x4e81aa[_0x41b9('0x3f')]));_0xc9a5e[_0x41b9('0x4b')][_0x41b9('0x67')]=_0x542e2c['id'];if(_0x5c2ec4[_0x41b9('0x41')][_0x41b9('0x2f')]){_0xc9a5e[_0x41b9('0x4b')]=_[_0x41b9('0x4a')](_0xc9a5e['where'],{'$or':_['map'](_0xc9a5e[_0x41b9('0x42')],function(_0x5f1bc2){var _0x25d07d={};_0x25d07d[_0x5f1bc2]={'$like':'%'+_0x5c2ec4[_0x41b9('0x41')][_0x41b9('0x2f')]+'%'};return _0x25d07d;})});}_0xc9a5e=_[_0x41b9('0x4a')]({},_0xc9a5e,_0x5c2ec4[_0x41b9('0x4d')]);return db[_0x41b9('0x66')]['count']({'where':_0xc9a5e[_0x41b9('0x4b')]})[_0x41b9('0x29')](function(_0x442045){_0x8839c2[_0x41b9('0x23')]=_0x442045;if(_0x5c2ec4[_0x41b9('0x41')][_0x41b9('0x4e')]){_0xc9a5e['include']=[{'all':!![]}];}return db[_0x41b9('0x66')][_0x41b9('0x68')](_0xc9a5e);})[_0x41b9('0x29')](function(_0xd553cf){_0x8839c2[_0x41b9('0x69')]=_0xd553cf;return _0x8839c2;});}})[_0x41b9('0x29')](respondWithFilteredResult(_0x3c4506,_0xc9a5e))['catch'](handleError(_0x3c4506,null));};exports['getHopperHistories']=function(_0x5a4d7f,_0x58e5df,_0x143dca){var _0x198bb2={'raw':!![],'where':{}};var _0x7cd7fe={};var _0x5183b5={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x41b9('0x65')]({'where':{'id':_0x5a4d7f[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x58e5df,null))['then'](function(_0x55d3dd){if(_0x55d3dd){_0x7cd7fe[_0x41b9('0x40')]=_['keys'](db[_0x41b9('0x6a')]['rawAttributes']);_0x7cd7fe[_0x41b9('0x41')]=_[_0x41b9('0x3e')](_0x5a4d7f[_0x41b9('0x41')]);_0x7cd7fe[_0x41b9('0x3f')]=_['intersection'](_0x7cd7fe['model'],_0x7cd7fe[_0x41b9('0x41')]);_0x198bb2[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x7cd7fe['model'],qs[_0x41b9('0x44')](_0x5a4d7f[_0x41b9('0x41')][_0x41b9('0x44')]));_0x198bb2[_0x41b9('0x42')]=_0x198bb2['attributes'][_0x41b9('0x5f')]?_0x198bb2[_0x41b9('0x42')]:_0x7cd7fe[_0x41b9('0x40')];if(!_0x5a4d7f[_0x41b9('0x41')]['hasOwnProperty'](_0x41b9('0x46'))){_0x198bb2['limit']=qs[_0x41b9('0x22')](_0x5a4d7f['query'][_0x41b9('0x22')]);_0x198bb2[_0x41b9('0x20')]=qs['offset'](_0x5a4d7f[_0x41b9('0x41')]['offset']);}_0x198bb2[_0x41b9('0x47')]=qs['sort'](_0x5a4d7f[_0x41b9('0x41')][_0x41b9('0x48')]);_0x198bb2[_0x41b9('0x4b')]=qs['filters'](_['pick'](_0x5a4d7f[_0x41b9('0x41')],_0x7cd7fe[_0x41b9('0x3f')]));_0x198bb2[_0x41b9('0x4b')]['VoiceQueueId']=_0x55d3dd['id'];if(_0x5a4d7f['query'][_0x41b9('0x2f')]){_0x198bb2[_0x41b9('0x4b')]=_['merge'](_0x198bb2[_0x41b9('0x4b')],{'$or':_['map'](_0x198bb2['attributes'],function(_0x379e5f){var _0xc2849c={};_0xc2849c[_0x379e5f]={'$like':'%'+_0x5a4d7f[_0x41b9('0x41')][_0x41b9('0x2f')]+'%'};return _0xc2849c;})});}_0x198bb2=_['merge']({},_0x198bb2,_0x5a4d7f[_0x41b9('0x4d')]);return db[_0x41b9('0x6a')]['count']({'where':_0x198bb2[_0x41b9('0x4b')]})['then'](function(_0x471dda){_0x5183b5[_0x41b9('0x23')]=_0x471dda;if(_0x5a4d7f[_0x41b9('0x41')][_0x41b9('0x4e')]){_0x198bb2[_0x41b9('0x6b')]=[{'all':!![]}];}return db[_0x41b9('0x6a')][_0x41b9('0x68')](_0x198bb2);})[_0x41b9('0x29')](function(_0x1a1829){_0x5183b5[_0x41b9('0x69')]=_0x1a1829;return _0x5183b5;});}})[_0x41b9('0x29')](respondWithFilteredResult(_0x58e5df,_0x198bb2))[_0x41b9('0x53')](handleError(_0x58e5df,null));};exports[_0x41b9('0x6c')]=function(_0x2e5845,_0x3cdfa2,_0x380366){var _0x188795={'raw':!![],'where':{}};var _0x36ab37={};var _0x3f474c={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x41b9('0x65')]({'where':{'id':_0x2e5845['params']['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x3cdfa2,null))[_0x41b9('0x29')](function(_0x127042){if(_0x127042){_0x36ab37[_0x41b9('0x40')]=_[_0x41b9('0x3e')](db['CmHopperFinal'][_0x41b9('0x51')]);_0x36ab37['query']=_['keys'](_0x2e5845['query']);_0x36ab37[_0x41b9('0x3f')]=_[_0x41b9('0x43')](_0x36ab37['model'],_0x36ab37['query']);_0x188795[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x36ab37['model'],qs['fields'](_0x2e5845[_0x41b9('0x41')][_0x41b9('0x44')]));_0x188795[_0x41b9('0x42')]=_0x188795[_0x41b9('0x42')][_0x41b9('0x5f')]?_0x188795[_0x41b9('0x42')]:_0x36ab37[_0x41b9('0x40')];if(!_0x2e5845[_0x41b9('0x41')][_0x41b9('0x45')](_0x41b9('0x46'))){_0x188795[_0x41b9('0x22')]=qs[_0x41b9('0x22')](_0x2e5845[_0x41b9('0x41')]['limit']);_0x188795[_0x41b9('0x20')]=qs[_0x41b9('0x20')](_0x2e5845[_0x41b9('0x41')]['offset']);}_0x188795[_0x41b9('0x47')]=qs[_0x41b9('0x48')](_0x2e5845[_0x41b9('0x41')][_0x41b9('0x48')]);_0x188795['where']=qs[_0x41b9('0x3f')](_[_0x41b9('0x49')](_0x2e5845[_0x41b9('0x41')],_0x36ab37[_0x41b9('0x3f')]));_0x188795[_0x41b9('0x4b')][_0x41b9('0x67')]=_0x127042['id'];if(_0x2e5845['query']['filter']){_0x188795[_0x41b9('0x4b')]=_[_0x41b9('0x4a')](_0x188795[_0x41b9('0x4b')],{'$or':_['map'](_0x188795['attributes'],function(_0x2ac50e){var _0x1ac165={};_0x1ac165[_0x2ac50e]={'$like':'%'+_0x2e5845[_0x41b9('0x41')][_0x41b9('0x2f')]+'%'};return _0x1ac165;})});}_0x188795=_[_0x41b9('0x4a')]({},_0x188795,_0x2e5845['options']);return db['CmHopperFinal'][_0x41b9('0x23')]({'where':_0x188795[_0x41b9('0x4b')]})[_0x41b9('0x29')](function(_0x570af3){_0x3f474c['count']=_0x570af3;if(_0x2e5845[_0x41b9('0x41')][_0x41b9('0x4e')]){_0x188795[_0x41b9('0x6b')]=[{'all':!![]}];}return db[_0x41b9('0x6d')][_0x41b9('0x68')](_0x188795);})['then'](function(_0x4f3484){_0x3f474c[_0x41b9('0x69')]=_0x4f3484;return _0x3f474c;});}})[_0x41b9('0x29')](respondWithFilteredResult(_0x3cdfa2,_0x188795))['catch'](handleError(_0x3cdfa2,null));};exports[_0x41b9('0x6e')]=function(_0x58e6a5,_0x5b8ddf,_0x52b18e){var _0xbd7508={'raw':!![],'where':{}};var _0x32975f={};var _0x283689={'count':0x0,'rows':[]};return db[_0x41b9('0x3b')]['findOne']({'where':{'id':_0x58e6a5[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x5b8ddf,null))[_0x41b9('0x29')](function(_0x1e2762){if(_0x1e2762){_0x32975f['model']=_[_0x41b9('0x3e')](db[_0x41b9('0x6f')][_0x41b9('0x51')]);_0x32975f[_0x41b9('0x41')]=_[_0x41b9('0x3e')](_0x58e6a5[_0x41b9('0x41')]);_0x32975f[_0x41b9('0x3f')]=_[_0x41b9('0x43')](_0x32975f['model'],_0x32975f[_0x41b9('0x41')]);_0xbd7508[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x32975f[_0x41b9('0x40')],qs[_0x41b9('0x44')](_0x58e6a5[_0x41b9('0x41')]['fields']));_0xbd7508[_0x41b9('0x42')]=_0xbd7508[_0x41b9('0x42')][_0x41b9('0x5f')]?_0xbd7508['attributes']:_0x32975f[_0x41b9('0x40')];if(!_0x58e6a5[_0x41b9('0x41')][_0x41b9('0x45')](_0x41b9('0x46'))){_0xbd7508['limit']=qs['limit'](_0x58e6a5[_0x41b9('0x41')]['limit']);_0xbd7508[_0x41b9('0x20')]=qs[_0x41b9('0x20')](_0x58e6a5[_0x41b9('0x41')]['offset']);}_0xbd7508[_0x41b9('0x47')]=qs[_0x41b9('0x48')](_0x58e6a5[_0x41b9('0x41')]['sort']);_0xbd7508[_0x41b9('0x4b')]=qs[_0x41b9('0x3f')](_['pick'](_0x58e6a5[_0x41b9('0x41')],_0x32975f[_0x41b9('0x3f')]));_0xbd7508[_0x41b9('0x4b')][_0x41b9('0x67')]=_0x1e2762['id'];if(_0x58e6a5[_0x41b9('0x41')][_0x41b9('0x2f')]){_0xbd7508[_0x41b9('0x4b')]=_[_0x41b9('0x4a')](_0xbd7508['where'],{'$or':_['map'](_0xbd7508[_0x41b9('0x42')],function(_0xdbfb22){var _0xbaceda={};_0xbaceda[_0xdbfb22]={'$like':'%'+_0x58e6a5[_0x41b9('0x41')][_0x41b9('0x2f')]+'%'};return _0xbaceda;})});}_0xbd7508=_[_0x41b9('0x4a')]({},_0xbd7508,_0x58e6a5[_0x41b9('0x4d')]);return db[_0x41b9('0x6f')]['count']({'where':_0xbd7508[_0x41b9('0x4b')]})[_0x41b9('0x29')](function(_0x8553dc){_0x283689[_0x41b9('0x23')]=_0x8553dc;if(_0x58e6a5[_0x41b9('0x41')][_0x41b9('0x4e')]){_0xbd7508[_0x41b9('0x6b')]=[{'all':!![]}];}return db[_0x41b9('0x6f')][_0x41b9('0x68')](_0xbd7508);})['then'](function(_0x1ae84c){_0x283689['rows']=_0x1ae84c;return _0x283689;});}})[_0x41b9('0x29')](respondWithFilteredResult(_0x5b8ddf,_0xbd7508))[_0x41b9('0x53')](handleError(_0x5b8ddf,null));};exports[_0x41b9('0x70')]=function(_0x7bc7eb,_0x278a0a,_0x2105c1){var _0x4a93c7={};var _0x5a3f8c={};var _0x4d3948;var _0x23786e;return db[_0x41b9('0x3b')]['findOne']({'where':{'id':_0x7bc7eb[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x278a0a,null))[_0x41b9('0x29')](function(_0x491b33){if(_0x491b33){_0x4d3948=_0x491b33;_0x5a3f8c['model']=_[_0x41b9('0x3e')](db[_0x41b9('0x71')]['rawAttributes']);_0x5a3f8c[_0x41b9('0x41')]=_[_0x41b9('0x3e')](_0x7bc7eb[_0x41b9('0x41')]);_0x5a3f8c[_0x41b9('0x3f')]=_[_0x41b9('0x43')](_0x5a3f8c[_0x41b9('0x40')],_0x5a3f8c['query']);_0x4a93c7[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x5a3f8c['model'],qs['fields'](_0x7bc7eb[_0x41b9('0x41')][_0x41b9('0x44')]));_0x4a93c7['attributes']=_0x4a93c7[_0x41b9('0x42')][_0x41b9('0x5f')]?_0x4a93c7['attributes']:_0x5a3f8c['model'];_0x4a93c7[_0x41b9('0x47')]=qs[_0x41b9('0x48')](_0x7bc7eb[_0x41b9('0x41')][_0x41b9('0x48')]);_0x4a93c7[_0x41b9('0x4b')]=qs[_0x41b9('0x3f')](_[_0x41b9('0x49')](_0x7bc7eb[_0x41b9('0x41')],_0x5a3f8c[_0x41b9('0x3f')]));if(_0x7bc7eb['query'][_0x41b9('0x2f')]){_0x4a93c7[_0x41b9('0x4b')]=_[_0x41b9('0x4a')](_0x4a93c7[_0x41b9('0x4b')],{'$or':_['map'](_0x4a93c7['attributes'],function(_0x3c2391){var _0x3242d0={};_0x3242d0[_0x3c2391]={'$like':'%'+_0x7bc7eb[_0x41b9('0x41')][_0x41b9('0x2f')]+'%'};return _0x3242d0;})});}_0x4a93c7=_[_0x41b9('0x4a')]({},_0x4a93c7,_0x7bc7eb[_0x41b9('0x4d')]);return _0x4d3948[_0x41b9('0x70')](_0x4a93c7);}})[_0x41b9('0x29')](function(_0x2c9bd2){if(_0x2c9bd2){_0x23786e=_0x2c9bd2[_0x41b9('0x5f')];if(!_0x7bc7eb[_0x41b9('0x41')]['hasOwnProperty'](_0x41b9('0x46'))){_0x4a93c7[_0x41b9('0x22')]=qs[_0x41b9('0x22')](_0x7bc7eb[_0x41b9('0x41')][_0x41b9('0x22')]);_0x4a93c7['offset']=qs[_0x41b9('0x20')](_0x7bc7eb[_0x41b9('0x41')][_0x41b9('0x20')]);}return _0x4d3948[_0x41b9('0x70')](_0x4a93c7);}})[_0x41b9('0x29')](function(_0x2bd18f){if(_0x2bd18f){return _0x2bd18f?{'count':_0x23786e,'rows':_0x2bd18f}:null;}})[_0x41b9('0x29')](respondWithResult(_0x278a0a,null))['catch'](handleError(_0x278a0a,null));};exports[_0x41b9('0x72')]=function(_0x2888fd,_0x55bc82,_0x48c58c){var _0x5ef377=_0x2888fd[_0x41b9('0x63')][_0x41b9('0x73')];var _0x1f2393=_[_0x41b9('0x31')](_0x5ef377,'id');return db['Team'][_0x41b9('0x68')]({'where':{'id':_0x1f2393},'attributes':['id'],'include':[{'model':db['User'],'as':_0x41b9('0x74'),'attributes':['id',_0x41b9('0x38'),_0x41b9('0x75'),_0x41b9('0x76'),_0x41b9('0x77')],'raw':!![]}]})[_0x41b9('0x29')](function(_0x15755c){if(_0x15755c){var _0x21d4fe=_[_0x41b9('0x78')](_0x15755c,function(_0x2468d8){var _0x37e12c=_0x2468d8[_0x41b9('0x58')]({'plain':!![]});_0x37e12c['Agents'][_0x41b9('0x79')](function(_0x51b53e){_0x51b53e[_0x41b9('0x7a')]=_[_0x41b9('0x52')](_0x5ef377,{'id':_0x37e12c['id']})['penalty'];});return _0x37e12c[_0x41b9('0x74')];});return db['VoiceQueue']['find']({'where':{'id':_0x2888fd['params']['id']}})[_0x41b9('0x29')](function(_0x4df1aa){return db['sequelize'][_0x41b9('0x7b')](function(_0x116145){return _0x4df1aa['addTeams'](_0x1f2393,{'transaction':_0x116145})[_0x41b9('0x29')](function(){return BPromise[_0x41b9('0x7c')](_0x5ef377,function(_0x53df18){return db[_0x41b9('0x7d')][_0x41b9('0x7e')]({'TeamId':_0x53df18['id'],'VoiceQueueId':_0x2888fd['params']['id'],'penalty':_0x53df18[_0x41b9('0x7a')]},{'transaction':_0x116145});});})[_0x41b9('0x29')](function(){return BPromise[_0x41b9('0x7c')](_0x21d4fe,function(_0x18d59a){return db[_0x41b9('0x7f')][_0x41b9('0x80')]({'where':{'UserId':_0x18d59a['id'],'VoiceQueueId':_0x2888fd[_0x41b9('0x50')]['id']},'defaults':{'penalty':_0x18d59a[_0x41b9('0x7a')]},'transaction':_0x116145});});})[_0x41b9('0x29')](function(){return BPromise[_0x41b9('0x7c')](_['filter'](_0x21d4fe,{'online':!![]}),function(_0x536da4){return db['UserVoiceQueueRt'][_0x41b9('0x7e')]({'membername':_0x536da4[_0x41b9('0x38')],'UserId':_0x536da4['id'],'queue_name':_0x4df1aa['name'],'VoiceQueueId':_0x4df1aa['id'],'interface':_[_0x41b9('0x81')](_0x536da4[_0x41b9('0x77')])?util[_0x41b9('0x82')]('SIP/%s',_0x536da4[_0x41b9('0x38')]):_0x536da4['interface'],'paused':_0x536da4[_0x41b9('0x76')]||![],'penalty':_0x536da4[_0x41b9('0x7a')]},{'transaction':_0x116145});});})[_0x41b9('0x29')](function(){_0x21d4fe[_0x41b9('0x79')](function(_0x53f967){socket[_0x41b9('0x83')](_0x41b9('0x84'),{'UserId':_0x53f967['id'],'VoiceQueueId':_0x4df1aa['id']});});});});});}})[_0x41b9('0x29')](respondWithStatusCode(_0x55bc82,null))[_0x41b9('0x53')](handleError(_0x55bc82,null));};exports['removeTeams']=function(_0x60bfe3,_0x49fbe4,_0x16824d){return db[_0x41b9('0x71')][_0x41b9('0x68')]({'where':{'id':_0x60bfe3[_0x41b9('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0x41b9('0x85')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x41b9('0x29')](handleEntityNotFound(_0x49fbe4,null))[_0x41b9('0x29')](function(_0x309795){var _0x39499f=_[_0x41b9('0x31')](_0x309795,'id');var _0x1e1da5=[];var _0x5c9bd6=[];var _0x4d1e41=squel['select']();_0x4d1e41['field'](_0x41b9('0x86'))[_0x41b9('0x87')]('team_has_voice_queues','tq')[_0x41b9('0x88')](_0x41b9('0x89'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x41b9('0x8a'),_0x60bfe3['params']['id']);for(var _0xbad31d=0x0;_0xbad31d<_0x309795['length'];_0xbad31d+=0x1){let _0x172804=_0x309795[_0xbad31d];for(var _0x28c085=0x0;_0x28c085<_0x172804[_0x41b9('0x74')][_0x41b9('0x5f')];_0x28c085+=0x1){let _0x200c8e=_0x172804['Agents'][_0x28c085];var _0x1bd53c=_0x4d1e41[_0x41b9('0x5e')]();_0x1bd53c['where'](_0x41b9('0x8b'),_0x200c8e['id']);_0x5c9bd6[_0x41b9('0x8c')](db[_0x41b9('0x8d')][_0x41b9('0x41')](_0x1bd53c[_0x41b9('0x8e')](),{'type':db[_0x41b9('0x8d')][_0x41b9('0x8f')]['SELECT']})[_0x41b9('0x29')](function(_0xf64bbe){if(_0xf64bbe['length']===0x1){return _0x200c8e['id'];}else{var _0xe213bc=_[_0x41b9('0x90')](_[_0x41b9('0x31')](_0xf64bbe,_0x41b9('0x91')),function(_0x5d654b){return _[_0x41b9('0x32')](_0x39499f,_0x5d654b);});if(_0xe213bc){return _0x200c8e['id'];}}}));}}return BPromise[_0x41b9('0x92')](_0x5c9bd6)[_0x41b9('0x29')](function(_0x313e4d){_0x1e1da5=_(_0x1e1da5)[_0x41b9('0x93')](_0x313e4d)[_0x41b9('0x94')]()[_0x41b9('0x33')]();return db[_0x41b9('0x3b')]['find']({'where':{'id':_0x60bfe3[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](function(_0x3d7018){return db[_0x41b9('0x8d')][_0x41b9('0x7b')](function(_0xf1e43){return _0x3d7018['removeTeams'](_0x60bfe3[_0x41b9('0x41')][_0x41b9('0x95')],{'transaction':_0xf1e43})[_0x41b9('0x29')](function(){if(!_[_0x41b9('0x96')](_0x1e1da5)){return _0x3d7018[_0x41b9('0x97')](_0x1e1da5,{'transaction':_0xf1e43})[_0x41b9('0x29')](function(){return db[_0x41b9('0x98')][_0x41b9('0x2a')]({'where':{'VoiceQueueId':_0x60bfe3[_0x41b9('0x50')]['id'],'UserId':_0x1e1da5},'transaction':_0xf1e43});});}})[_0x41b9('0x29')](function(){_0x1e1da5[_0x41b9('0x79')](function(_0x2df6ea){socket[_0x41b9('0x83')](_0x41b9('0x99'),{'UserId':_0x2df6ea,'VoiceQueueId':_0x3d7018['id']});});});});});});})[_0x41b9('0x29')](respondWithStatusCode(_0x49fbe4,null))['catch'](handleError(_0x49fbe4,null));};exports[_0x41b9('0x9a')]=function(_0x383fde,_0x1674cc,_0x30380e){var _0xb79a4b,_0x39046d;return db[_0x41b9('0x3b')][_0x41b9('0x52')]({'where':{'id':_0x383fde[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x1674cc,null))[_0x41b9('0x29')](function(_0x2d1a91){if(_0x2d1a91){_0x39046d=_0x2d1a91;return _0x2d1a91[_0x41b9('0x9a')](_0x383fde[_0x41b9('0x63')][_0x41b9('0x95')],_['omit'](_0x383fde['body'],[_0x41b9('0x95'),'id'])||{})[_0x41b9('0x9b')](function(_0x18cf01){for(var _0xdc51f7=0x0;_0xdc51f7<_0x383fde[_0x41b9('0x63')][_0x41b9('0x95')][_0x41b9('0x5f')];_0xdc51f7+=0x1){socket['emit'](_0x41b9('0x84'),{'UserId':Number(_0x383fde[_0x41b9('0x63')]['ids'][_0xdc51f7]),'VoiceQueueId':Number(_0x383fde[_0x41b9('0x50')]['id'])});}return _0x18cf01;});}})[_0x41b9('0x29')](function(_0xd1174b){_0xb79a4b=_0xd1174b||[];if(_0x39046d){return db[_0x41b9('0x85')]['findAll']({'where':{'id':_0x383fde[_0x41b9('0x63')][_0x41b9('0x95')]},'attributes':['id',_0x41b9('0x38'),_0x41b9('0x75'),_0x41b9('0x76'),_0x41b9('0x77')],'raw':!![]});}})[_0x41b9('0x29')](function(_0xa9df0c){if(!_[_0x41b9('0x96')](_0xa9df0c)){var _0x28fdbe=[];for(var _0x117a4d=0x0;_0x117a4d<_0xa9df0c[_0x41b9('0x5f')];_0x117a4d++){if(_0xa9df0c[_0x117a4d][_0x41b9('0x75')]){_0x28fdbe[_0x41b9('0x8c')](db[_0x41b9('0x98')][_0x41b9('0x7e')]({'membername':_0xa9df0c[_0x117a4d][_0x41b9('0x38')],'UserId':_0xa9df0c[_0x117a4d]['id'],'queue_name':_0x39046d[_0x41b9('0x38')],'VoiceQueueId':_0x39046d['id'],'interface':_[_0x41b9('0x81')](_0xa9df0c[_0x117a4d][_0x41b9('0x77')])?util[_0x41b9('0x82')](_0x41b9('0x9c'),_0xa9df0c[_0x117a4d]['name']):_0xa9df0c[_0x117a4d][_0x41b9('0x77')],'paused':_0xa9df0c[_0x117a4d]['voicePause']||![],'penalty':_0x383fde[_0x41b9('0x63')][_0x41b9('0x7a')]||0x0}));}}return BPromise[_0x41b9('0x92')](_0x28fdbe);}})[_0x41b9('0x29')](function(){return _0xb79a4b;})[_0x41b9('0x29')](respondWithResult(_0x1674cc,null))[_0x41b9('0x53')](handleError(_0x1674cc,null));};exports[_0x41b9('0x97')]=function(_0x47f681,_0x13fe30,_0x26aac5){return db[_0x41b9('0x3b')][_0x41b9('0x52')]({'where':{'id':_0x47f681[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x13fe30,null))['then'](function(_0x339023){if(_0x339023){return _0x339023['removeAgents'](_0x47f681[_0x41b9('0x41')][_0x41b9('0x95')])[_0x41b9('0x29')](function(){if(_[_0x41b9('0x9d')](_0x47f681[_0x41b9('0x41')][_0x41b9('0x95')])){for(var _0x1d38dc=0x0;_0x1d38dc<_0x47f681[_0x41b9('0x41')][_0x41b9('0x95')][_0x41b9('0x5f')];_0x1d38dc+=0x1){socket[_0x41b9('0x83')]('userVoiceQueue:remove',{'UserId':Number(_0x47f681[_0x41b9('0x41')]['ids'][_0x1d38dc]),'VoiceQueueId':Number(_0x47f681['params']['id'])});}}else{socket[_0x41b9('0x83')](_0x41b9('0x99'),{'UserId':Number(_0x47f681[_0x41b9('0x41')][_0x41b9('0x95')]),'VoiceQueueId':Number(_0x47f681[_0x41b9('0x50')]['id'])});}});}})[_0x41b9('0x29')](function(_0x476b9f){return db[_0x41b9('0x98')]['destroy']({'where':{'VoiceQueueId':_0x47f681[_0x41b9('0x50')]['id'],'UserId':_0x47f681[_0x41b9('0x41')][_0x41b9('0x95')]}})['then'](function(){return _0x476b9f;});})[_0x41b9('0x29')](respondWithStatusCode(_0x13fe30,null))[_0x41b9('0x53')](handleError(_0x13fe30,null));};exports[_0x41b9('0x9e')]=function(_0x41d217,_0x18e17a,_0x3a8a7b){var _0x1a1d16={};var _0x2248a4={};var _0x4d95af;var _0x1b4310;return db['VoiceQueue'][_0x41b9('0x65')]({'where':{'id':_0x41d217[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x18e17a,null))['then'](function(_0x40cea9){if(_0x40cea9){_0x4d95af=_0x40cea9;_0x2248a4[_0x41b9('0x40')]=_['keys'](db[_0x41b9('0x85')]['rawAttributes']);_0x2248a4[_0x41b9('0x41')]=_[_0x41b9('0x3e')](_0x41d217['query']);_0x2248a4[_0x41b9('0x3f')]=_[_0x41b9('0x43')](_0x2248a4[_0x41b9('0x40')],_0x2248a4[_0x41b9('0x41')]);_0x1a1d16[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x2248a4[_0x41b9('0x40')],qs[_0x41b9('0x44')](_0x41d217[_0x41b9('0x41')][_0x41b9('0x44')]));_0x1a1d16[_0x41b9('0x42')]=_0x1a1d16[_0x41b9('0x42')][_0x41b9('0x5f')]?_0x1a1d16['attributes']:_0x2248a4[_0x41b9('0x40')];_0x1a1d16[_0x41b9('0x47')]=qs[_0x41b9('0x48')](_0x41d217[_0x41b9('0x41')]['sort']);_0x1a1d16[_0x41b9('0x4b')]=qs['filters'](_[_0x41b9('0x49')](_0x41d217['query'],_0x2248a4[_0x41b9('0x3f')]));if(_0x41d217[_0x41b9('0x41')][_0x41b9('0x2f')]){_0x1a1d16[_0x41b9('0x4b')]=_[_0x41b9('0x4a')](_0x1a1d16[_0x41b9('0x4b')],{'$or':_[_0x41b9('0x31')](_0x1a1d16['attributes'],function(_0x4c1eb9){var _0x593639={};_0x593639[_0x4c1eb9]={'$like':'%'+_0x41d217['query'][_0x41b9('0x2f')]+'%'};return _0x593639;})});}_0x1a1d16=_['merge']({},_0x1a1d16,_0x41d217['options']);return _0x4d95af[_0x41b9('0x9e')](_0x1a1d16);}})[_0x41b9('0x29')](function(_0x3c72c5){if(_0x3c72c5){_0x1b4310=_0x3c72c5[_0x41b9('0x5f')];if(!_0x41d217[_0x41b9('0x41')][_0x41b9('0x45')](_0x41b9('0x46'))){_0x1a1d16['limit']=qs['limit'](_0x41d217[_0x41b9('0x41')][_0x41b9('0x22')]);_0x1a1d16[_0x41b9('0x20')]=qs[_0x41b9('0x20')](_0x41d217[_0x41b9('0x41')][_0x41b9('0x20')]);}return _0x4d95af[_0x41b9('0x9e')](_0x1a1d16);}})[_0x41b9('0x29')](function(_0x2e9936){if(_0x2e9936){return _0x2e9936?{'count':_0x1b4310,'rows':_0x2e9936}:null;}})['then'](respondWithResult(_0x18e17a,null))[_0x41b9('0x53')](handleError(_0x18e17a,null));};exports[_0x41b9('0x9f')]=function(_0x541656,_0x3899ae,_0x3a1f70){var _0x59b546={};var _0x25dc5a={};var _0x1ffb0d;var _0x57f799;return db['VoiceQueue'][_0x41b9('0x65')]({'where':{'id':_0x541656[_0x41b9('0x50')]['id']}})['then'](handleEntityNotFound(_0x3899ae,null))[_0x41b9('0x29')](function(_0x372234){if(_0x372234){_0x1ffb0d=_0x372234;_0x25dc5a[_0x41b9('0x40')]=_[_0x41b9('0x3e')](db['UserVoiceQueueRt'][_0x41b9('0x51')]);_0x25dc5a[_0x41b9('0x41')]=_[_0x41b9('0x3e')](_0x541656[_0x41b9('0x41')]);_0x25dc5a['filters']=_['intersection'](_0x25dc5a[_0x41b9('0x40')],_0x25dc5a[_0x41b9('0x41')]);_0x59b546[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x25dc5a[_0x41b9('0x40')],qs[_0x41b9('0x44')](_0x541656[_0x41b9('0x41')][_0x41b9('0x44')]));_0x59b546['attributes']=_0x59b546[_0x41b9('0x42')][_0x41b9('0x5f')]?_0x59b546[_0x41b9('0x42')]:_0x25dc5a[_0x41b9('0x40')];_0x59b546[_0x41b9('0x47')]=qs[_0x41b9('0x48')](_0x541656[_0x41b9('0x41')][_0x41b9('0x48')]);_0x59b546[_0x41b9('0x4b')]=qs[_0x41b9('0x3f')](_['pick'](_0x541656[_0x41b9('0x41')],_0x25dc5a[_0x41b9('0x3f')]));if(_0x541656[_0x41b9('0x41')][_0x41b9('0x2f')]){_0x59b546[_0x41b9('0x4b')]=_[_0x41b9('0x4a')](_0x59b546[_0x41b9('0x4b')],{'$or':_['map'](_0x59b546[_0x41b9('0x42')],function(_0x442e59){var _0x1643c3={};_0x1643c3[_0x442e59]={'$like':'%'+_0x541656[_0x41b9('0x41')][_0x41b9('0x2f')]+'%'};return _0x1643c3;})});}_0x59b546=_['merge']({},_0x59b546,_0x541656[_0x41b9('0x4d')]);return _0x1ffb0d['getMembers'](_0x59b546);}})[_0x41b9('0x29')](function(_0x14bd97){if(_0x14bd97){_0x57f799=_0x14bd97[_0x41b9('0x5f')];if(!_0x541656['query'][_0x41b9('0x45')](_0x41b9('0x46'))){_0x59b546[_0x41b9('0x22')]=qs['limit'](_0x541656[_0x41b9('0x41')][_0x41b9('0x22')]);_0x59b546['offset']=qs[_0x41b9('0x20')](_0x541656['query'][_0x41b9('0x20')]);}return _0x1ffb0d[_0x41b9('0x9f')](_0x59b546);}})['then'](function(_0x7b4eaa){return _0x7b4eaa?{'count':_0x57f799,'rows':_0x7b4eaa}:null;})[_0x41b9('0x29')](respondWithResult(_0x3899ae,null))['catch'](handleError(_0x3899ae,null));};exports[_0x41b9('0xa0')]=function(_0x5d362f,_0x29748e,_0xa6ca29){var _0x2829c4={};var _0x44d126={};var _0x349b19;var _0x356c66;return db[_0x41b9('0x3b')][_0x41b9('0x65')]({'where':{'id':_0x5d362f[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x29748e,null))[_0x41b9('0x29')](function(_0x11064f){if(_0x11064f){_0x349b19=_0x11064f;_0x44d126[_0x41b9('0x40')]=_[_0x41b9('0x3e')](db[_0x41b9('0xa1')]['rawAttributes']);_0x44d126['query']=_[_0x41b9('0x3e')](_0x5d362f[_0x41b9('0x41')]);_0x44d126[_0x41b9('0x3f')]=_[_0x41b9('0x43')](_0x44d126['model'],_0x44d126[_0x41b9('0x41')]);_0x2829c4[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x44d126[_0x41b9('0x40')],qs['fields'](_0x5d362f['query']['fields']));_0x2829c4[_0x41b9('0x42')]=_0x2829c4[_0x41b9('0x42')][_0x41b9('0x5f')]?_0x2829c4[_0x41b9('0x42')]:_0x44d126[_0x41b9('0x40')];_0x2829c4['order']=qs[_0x41b9('0x48')](_0x5d362f[_0x41b9('0x41')][_0x41b9('0x48')]);_0x2829c4['where']=qs['filters'](_[_0x41b9('0x49')](_0x5d362f[_0x41b9('0x41')],_0x44d126[_0x41b9('0x3f')]));if(_0x5d362f['query'][_0x41b9('0x2f')]){_0x2829c4['where']=_[_0x41b9('0x4a')](_0x2829c4[_0x41b9('0x4b')],{'$or':_[_0x41b9('0x31')](_0x2829c4['attributes'],function(_0x30e635){var _0x291bed={};_0x291bed[_0x30e635]={'$like':'%'+_0x5d362f[_0x41b9('0x41')][_0x41b9('0x2f')]+'%'};return _0x291bed;})});}_0x2829c4=_[_0x41b9('0x4a')]({},_0x2829c4,_0x5d362f['options']);return _0x349b19[_0x41b9('0xa0')](_0x2829c4);}})[_0x41b9('0x29')](function(_0x30c1ae){if(_0x30c1ae){_0x356c66=_0x30c1ae[_0x41b9('0x5f')];if(!_0x5d362f[_0x41b9('0x41')]['hasOwnProperty'](_0x41b9('0x46'))){_0x2829c4[_0x41b9('0x22')]=qs[_0x41b9('0x22')](_0x5d362f[_0x41b9('0x41')][_0x41b9('0x22')]);_0x2829c4['offset']=qs[_0x41b9('0x20')](_0x5d362f[_0x41b9('0x41')][_0x41b9('0x20')]);}return _0x349b19[_0x41b9('0xa0')](_0x2829c4);}})[_0x41b9('0x29')](function(_0x2f3df4){if(_0x2f3df4){return _0x2f3df4?{'count':_0x356c66,'rows':_0x2f3df4}:null;}})[_0x41b9('0x29')](respondWithResult(_0x29748e,null))[_0x41b9('0x53')](handleError(_0x29748e,null));};exports[_0x41b9('0xa2')]=function(_0x250abe,_0x3e165d,_0x33934f){var _0x28281e=moment()[_0x41b9('0x82')]('YYYY-MM-DD\x20HH:mm:ss');var _0x266df7,_0xb145ca;return db[_0x41b9('0x3b')][_0x41b9('0x52')]({'where':{'id':_0x250abe['params']['id']}})['then'](handleEntityNotFound(_0x3e165d,null))[_0x41b9('0x29')](function(_0x2aec29){if(_0x2aec29){_0xb145ca=_0x2aec29;return _0x2aec29[_0x41b9('0xa2')](_0x250abe[_0x41b9('0x63')][_0x41b9('0x95')],_[_0x41b9('0x60')](_0x250abe[_0x41b9('0x63')],[_0x41b9('0x95'),'id'])||{});}return null;})[_0x41b9('0x9b')](function(_0x5de044){var _0x80bc6c;_0x266df7=_0x5de044||[];var _0x1fc1bd=[];if(_0x5de044){for(var _0x5c9a05=0x0;_0x5c9a05<_0x5de044['length'];_0x5c9a05+=0x1){var _0x3f04ce=_0x5de044[_0x5c9a05][_0x41b9('0x58')]({'plain':!![]});_0xb145ca['dialCheckDuplicateType']=_0x250abe[_0x41b9('0x63')][_0x41b9('0xa3')]?_0x250abe[_0x41b9('0x63')]['dialCheckDuplicateType']:_0xb145ca[_0x41b9('0xa3')];switch(_0xb145ca['dialCheckDuplicateType']){case _0x41b9('0xa4'):_0x80bc6c=squel['insert']()[_0x41b9('0xa5')](_0x41b9('0xa6'))[_0x41b9('0xa7')]([_0x41b9('0xa8'),_0x41b9('0xa9'),_0x41b9('0xaa'),'ListId','VoiceQueueId',_0x41b9('0x61'),_0x41b9('0x62')],squel[_0x41b9('0xab')]()[_0x41b9('0xac')]('phone',_0x41b9('0xa8'))[_0x41b9('0xac')]('\x27'+_0x28281e+'\x27',_0x41b9('0xa9'))[_0x41b9('0xac')]('id','ContactId')[_0x41b9('0xac')](_0x3f04ce[_0x41b9('0xad')]['toString'](),_0x41b9('0xae'))[_0x41b9('0xac')](_0x250abe[_0x41b9('0x50')]['id'][_0x41b9('0x8e')](),_0x41b9('0x67'))[_0x41b9('0xac')]('\x27'+_0x28281e+'\x27','createdAt')['field']('\x27'+_0x28281e+'\x27',_0x41b9('0x62'))[_0x41b9('0x87')]('cm_contacts')[_0x41b9('0x4b')]('deletedAt\x20IS\x20NULL')[_0x41b9('0x4b')](_0x41b9('0xaf'),_0x3f04ce['CmListId'][_0x41b9('0x8e')]())[_0x41b9('0x4b')](_0x41b9('0xb0'))[_0x41b9('0x4b')](_0x41b9('0xb1'),squel['select']()['field']('COALESCE(calleridnum,\x27\x27)')[_0x41b9('0x87')]('cm_hopper_final')[_0x41b9('0x4b')](_0x41b9('0x8a'),_0x250abe[_0x41b9('0x50')]['id'][_0x41b9('0x8e')]()))['where'](_0x41b9('0xb1'),squel[_0x41b9('0xab')]()[_0x41b9('0xac')]('COALESCE(phone,\x27\x27)')[_0x41b9('0x87')](_0x41b9('0xa6'))[_0x41b9('0x4b')](_0x41b9('0x8a'),_0x250abe[_0x41b9('0x50')]['id'][_0x41b9('0x8e')]())))[_0x41b9('0x8e')]();break;case _0x41b9('0xb2'):_0x80bc6c=squel[_0x41b9('0xb3')]()['into'](_0x41b9('0xa6'))[_0x41b9('0xa7')]([_0x41b9('0xa8'),_0x41b9('0xa9'),_0x41b9('0xaa'),_0x41b9('0xae'),'VoiceQueueId',_0x41b9('0x61'),_0x41b9('0x62')],squel[_0x41b9('0xab')]()[_0x41b9('0xac')]('phone',_0x41b9('0xa8'))['field']('\x27'+_0x28281e+'\x27',_0x41b9('0xa9'))[_0x41b9('0xac')]('id',_0x41b9('0xaa'))[_0x41b9('0xac')](_0x3f04ce[_0x41b9('0xad')][_0x41b9('0x8e')](),'ListId')[_0x41b9('0xac')](_0x250abe[_0x41b9('0x50')]['id'][_0x41b9('0x8e')](),_0x41b9('0x67'))[_0x41b9('0xac')]('\x27'+_0x28281e+'\x27',_0x41b9('0x61'))['field']('\x27'+_0x28281e+'\x27','updatedAt')[_0x41b9('0x87')](_0x41b9('0xb4'))[_0x41b9('0x4b')](_0x41b9('0xb5'))[_0x41b9('0x4b')]('ListId\x20=\x20?',_0x3f04ce[_0x41b9('0xad')]['toString']())[_0x41b9('0x4b')](_0x41b9('0xb0'))[_0x41b9('0x4b')](_0x41b9('0xb1'),squel['select']()[_0x41b9('0xac')](_0x41b9('0xb6'))[_0x41b9('0x87')]('cm_hopper')[_0x41b9('0x4b')](_0x41b9('0x8a'),_0x250abe['params']['id']['toString']())))[_0x41b9('0x8e')]();break;default:_0x80bc6c=squel[_0x41b9('0xb3')]()['into'](_0x41b9('0xa6'))[_0x41b9('0xa7')]([_0x41b9('0xa8'),_0x41b9('0xa9'),_0x41b9('0xaa'),_0x41b9('0xae'),_0x41b9('0x67'),'createdAt',_0x41b9('0x62')],squel[_0x41b9('0xab')]()[_0x41b9('0xac')](_0x41b9('0xa8'),_0x41b9('0xa8'))[_0x41b9('0xac')]('\x27'+_0x28281e+'\x27',_0x41b9('0xa9'))[_0x41b9('0xac')]('id','ContactId')['field'](_0x3f04ce[_0x41b9('0xad')][_0x41b9('0x8e')](),_0x41b9('0xae'))['field'](_0x250abe['params']['id'][_0x41b9('0x8e')](),_0x41b9('0x67'))[_0x41b9('0xac')]('\x27'+_0x28281e+'\x27','createdAt')[_0x41b9('0xac')]('\x27'+_0x28281e+'\x27','updatedAt')[_0x41b9('0x87')](_0x41b9('0xb4'))['where']('deletedAt\x20IS\x20NULL')[_0x41b9('0x4b')](_0x41b9('0xaf'),_0x3f04ce[_0x41b9('0xad')][_0x41b9('0x8e')]())['where'](_0x41b9('0xb0')))[_0x41b9('0x8e')]();}_0x1fc1bd[_0x41b9('0x8c')](db['sequelize']['query'](_0x80bc6c));}return BPromise['all'](_0x1fc1bd);}})['then'](function(){var _0x99684f=[];var _0xd0795a=squel[_0x41b9('0xb3')]()['into']('cm_hopper_additional_phones')[_0x41b9('0xa7')]([_0x41b9('0xb7'),_0x41b9('0xa8'),_0x41b9('0xb8'),'createdAt',_0x41b9('0x62')],squel[_0x41b9('0xab')]()[_0x41b9('0xac')](_0x41b9('0xb9'))[_0x41b9('0xac')]('ci.item')[_0x41b9('0xac')](_0x41b9('0xba'))[_0x41b9('0xac')]('\x27'+_0x28281e+'\x27',_0x41b9('0x61'))[_0x41b9('0xac')]('\x27'+_0x28281e+'\x27',_0x41b9('0x62'))[_0x41b9('0x87')]('cm_contact_has_items','ci')[_0x41b9('0x88')]('cm_hopper','h',_0x41b9('0xbb'))['where']('h.scheduledat=?',_0x28281e)[_0x41b9('0x4b')]('ci.ItemClass=?','PHONE'))[_0x41b9('0x8e')]();_0x99684f['push'](db[_0x41b9('0x8d')][_0x41b9('0x41')](_0xd0795a));return BPromise[_0x41b9('0x92')](_0x99684f);})[_0x41b9('0x29')](function(){return _0x266df7;})[_0x41b9('0x29')](respondWithResult(_0x3e165d,null))[_0x41b9('0x53')](handleError(_0x3e165d,null));};exports['removeLists']=function(_0x7e6f37,_0x507096,_0x95157e){return db['VoiceQueue'][_0x41b9('0x52')]({'where':{'id':_0x7e6f37[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x507096,null))[_0x41b9('0x29')](function(_0xf25ea){if(_0xf25ea){return _0xf25ea['removeLists'](_0x7e6f37[_0x41b9('0x41')][_0x41b9('0x95')]);}})[_0x41b9('0x29')](function(_0x127993){if(_0x127993){return db[_0x41b9('0x66')][_0x41b9('0x2a')]({'where':{'ListId':_0x7e6f37[_0x41b9('0x41')]['ids'],'VoiceQueueId':_0x7e6f37['params']['id']}})[_0x41b9('0x29')](function(){return _0x127993;});}})[_0x41b9('0x29')](respondWithStatusCode(_0x507096,null))['catch'](handleError(_0x507096,null));};exports[_0x41b9('0xbc')]=function(_0x4fe4b1,_0x18f131,_0x2edad4){var _0x310186={};var _0x3722b7={};var _0x2a24df;var _0x1dde4b;return db['VoiceQueue'][_0x41b9('0x65')]({'where':{'id':_0x4fe4b1[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x18f131,null))[_0x41b9('0x29')](function(_0x586c94){if(_0x586c94){_0x2a24df=_0x586c94;_0x3722b7[_0x41b9('0x40')]=_[_0x41b9('0x3e')](db['CmList'][_0x41b9('0x51')]);_0x3722b7[_0x41b9('0x41')]=_[_0x41b9('0x3e')](_0x4fe4b1[_0x41b9('0x41')]);_0x3722b7[_0x41b9('0x3f')]=_[_0x41b9('0x43')](_0x3722b7[_0x41b9('0x40')],_0x3722b7[_0x41b9('0x41')]);_0x310186[_0x41b9('0x42')]=_[_0x41b9('0x43')](_0x3722b7['model'],qs[_0x41b9('0x44')](_0x4fe4b1[_0x41b9('0x41')][_0x41b9('0x44')]));_0x310186['attributes']=_0x310186[_0x41b9('0x42')][_0x41b9('0x5f')]?_0x310186['attributes']:_0x3722b7[_0x41b9('0x40')];_0x310186[_0x41b9('0x47')]=qs['sort'](_0x4fe4b1['query'][_0x41b9('0x48')]);_0x310186[_0x41b9('0x4b')]=qs[_0x41b9('0x3f')](_[_0x41b9('0x49')](_0x4fe4b1[_0x41b9('0x41')],_0x3722b7[_0x41b9('0x3f')]));if(_0x4fe4b1['query']['filter']){_0x310186['where']=_[_0x41b9('0x4a')](_0x310186[_0x41b9('0x4b')],{'$or':_[_0x41b9('0x31')](_0x310186[_0x41b9('0x42')],function(_0x24298c){var _0x4e9a3b={};_0x4e9a3b[_0x24298c]={'$like':'%'+_0x4fe4b1[_0x41b9('0x41')][_0x41b9('0x2f')]+'%'};return _0x4e9a3b;})});}_0x310186=_[_0x41b9('0x4a')]({},_0x310186,_0x4fe4b1[_0x41b9('0x4d')]);return _0x2a24df['getBlackLists'](_0x310186);}})[_0x41b9('0x29')](function(_0x2da450){if(_0x2da450){_0x1dde4b=_0x2da450[_0x41b9('0x5f')];if(!_0x4fe4b1[_0x41b9('0x41')][_0x41b9('0x45')](_0x41b9('0x46'))){_0x310186[_0x41b9('0x22')]=qs[_0x41b9('0x22')](_0x4fe4b1[_0x41b9('0x41')][_0x41b9('0x22')]);_0x310186[_0x41b9('0x20')]=qs[_0x41b9('0x20')](_0x4fe4b1[_0x41b9('0x41')][_0x41b9('0x20')]);}return _0x2a24df['getBlackLists'](_0x310186);}})[_0x41b9('0x29')](function(_0x37485a){if(_0x37485a){return _0x37485a?{'count':_0x1dde4b,'rows':_0x37485a}:null;}})[_0x41b9('0x29')](respondWithResult(_0x18f131,null))['catch'](handleError(_0x18f131,null));};exports[_0x41b9('0xbd')]=function(_0x3f71ea,_0x268d8b,_0x1fcd1f){var _0x104fe6,_0x378a8f;return db['VoiceQueue'][_0x41b9('0x52')]({'where':{'id':_0x3f71ea['params']['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x268d8b,null))[_0x41b9('0x29')](function(_0x57c802){if(_0x57c802){_0x378a8f=_0x57c802;return _0x57c802[_0x41b9('0xbd')](_0x3f71ea[_0x41b9('0x63')][_0x41b9('0x95')],_[_0x41b9('0x60')](_0x3f71ea[_0x41b9('0x63')],[_0x41b9('0x95'),'id'])||{});}return null;})[_0x41b9('0x9b')](function(_0x5e6d24){var _0x471650;_0x104fe6=_0x5e6d24||[];var _0x3dcb39=[];if(_0x5e6d24){for(var _0x48fd30=0x0;_0x48fd30<_0x5e6d24['length'];_0x48fd30+=0x1){var _0x4961c4=_0x5e6d24[_0x48fd30][_0x41b9('0x58')]({'plain':!![]});_0x471650=squel['insert']()[_0x41b9('0xa5')](_0x41b9('0xbe'))[_0x41b9('0xa7')]([_0x41b9('0xa8'),_0x41b9('0xaa'),_0x41b9('0xae'),_0x41b9('0x67'),_0x41b9('0x61'),_0x41b9('0x62')],squel[_0x41b9('0xab')]()[_0x41b9('0xac')](_0x41b9('0xa8'),_0x41b9('0xa8'))[_0x41b9('0xac')]('id',_0x41b9('0xaa'))[_0x41b9('0xac')](_0x4961c4[_0x41b9('0xad')][_0x41b9('0x8e')](),'ListId')[_0x41b9('0xac')](_0x3f71ea[_0x41b9('0x50')]['id'][_0x41b9('0x8e')](),_0x41b9('0x67'))['field']('NOW()',_0x41b9('0x61'))['field'](_0x41b9('0xbf'),_0x41b9('0x62'))['from'](_0x41b9('0xb4'))[_0x41b9('0x4b')](_0x41b9('0xb5'))[_0x41b9('0x4b')]('ListId\x20=\x20?',_0x4961c4['CmListId'][_0x41b9('0x8e')]())[_0x41b9('0x4b')]('phone\x20IS\x20NOT\x20NULL'))[_0x41b9('0x8e')]();_0x3dcb39[_0x41b9('0x8c')](db[_0x41b9('0x8d')][_0x41b9('0x41')](_0x471650));}return BPromise['all'](_0x3dcb39);}})[_0x41b9('0x29')](function(){return _0x104fe6;})[_0x41b9('0x29')](respondWithResult(_0x268d8b,null))[_0x41b9('0x53')](handleError(_0x268d8b,null));};exports[_0x41b9('0xc0')]=function(_0x2c864b,_0x178f41,_0x29c981){return db[_0x41b9('0x3b')][_0x41b9('0x52')]({'where':{'id':_0x2c864b[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](handleEntityNotFound(_0x178f41,null))[_0x41b9('0x29')](function(_0x3839c5){if(_0x3839c5){return _0x3839c5[_0x41b9('0xc0')](_0x2c864b[_0x41b9('0x41')][_0x41b9('0x95')]);}})[_0x41b9('0x29')](function(_0x25a9ec){if(_0x25a9ec){return db[_0x41b9('0x6f')]['destroy']({'where':{'ListId':_0x2c864b[_0x41b9('0x41')]['ids'],'VoiceQueueId':_0x2c864b[_0x41b9('0x50')]['id']}})[_0x41b9('0x29')](function(){return _0x25a9ec;});}})[_0x41b9('0x29')](respondWithStatusCode(_0x178f41,null))[_0x41b9('0x53')](handleError(_0x178f41,null));};
\ No newline at end of file
index 000b5e8..d5768c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c2c=['remove','emit','hasOwnProperty','hook','events'];(function(_0x21146b,_0x9b2eef){var _0x2eeb07=function(_0x4563f9){while(--_0x4563f9){_0x21146b['push'](_0x21146b['shift']());}};_0x2eeb07(++_0x9b2eef);}(_0x2c2c,0x11c));var _0xc2c2=function(_0x2de7aa,_0x161ae6){_0x2de7aa=_0x2de7aa-0x0;var _0x39cf78=_0x2c2c[_0x2de7aa];return _0x39cf78;};'use strict';var EventEmitter=require(_0xc2c2('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xc2c2('0x1')};function emitEvent(_0x1c1617){return function(_0x2e8719,_0x4a24a2,_0x5a3971){VoiceQueueEvents['emit'](_0x1c1617+':'+_0x2e8719['id'],_0x2e8719);VoiceQueueEvents[_0xc2c2('0x2')](_0x1c1617,_0x2e8719);_0x5a3971(null);};}for(var e in events){if(events[_0xc2c2('0x3')](e)){var event=events[e];VoiceQueue[_0xc2c2('0x4')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
+var _0xcf52=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueue','setMaxListeners'];(function(_0x3728bd,_0x5e31fd){var _0x5c2f0f=function(_0x188f57){while(--_0x188f57){_0x3728bd['push'](_0x3728bd['shift']());}};_0x5c2f0f(++_0x5e31fd);}(_0xcf52,0x152));var _0x2cf5=function(_0x4843fe,_0x461c62){_0x4843fe=_0x4843fe-0x0;var _0x446192=_0xcf52[_0x4843fe];return _0x446192;};'use strict';var EventEmitter=require(_0x2cf5('0x0'));var VoiceQueue=require(_0x2cf5('0x1'))['db'][_0x2cf5('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x2cf5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2cf5('0x4'),'afterDestroy':_0x2cf5('0x5')};function emitEvent(_0x10ea4c){return function(_0x1c7bc1,_0x48372d,_0x2bcae2){VoiceQueueEvents['emit'](_0x10ea4c+':'+_0x1c7bc1['id'],_0x1c7bc1);VoiceQueueEvents[_0x2cf5('0x6')](_0x10ea4c,_0x1c7bc1);_0x2bcae2(null);};}for(var e in events){if(events[_0x2cf5('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x2cf5('0x8')]=VoiceQueueEvents;
\ No newline at end of file
index d012373..8c5139c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0xbac1ec,_0x2f59dc){var _0x1d5ce9=function(_0x18c604){while(--_0x18c604){_0xbac1ec['push'](_0xbac1ec['shift']());}};_0x1d5ce9(++_0x2f59dc);}(_0x70e0,0x17b));var _0x070e=function(_0x53973a,_0x246e3d){_0x53973a=_0x53973a-0x0;var _0x3eefd4=_0x70e0[_0x53973a];return _0x3eefd4;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4ab99,_0x219ed2){var _0x29e39c=function(_0x2dd986){while(--_0x2dd986){_0x4ab99['push'](_0x4ab99['shift']());}};_0x29e39c(++_0x219ed2);}(_0x55ca,0x126));var _0xa55c=function(_0x268319,_0x53fc42){_0x268319=_0x268319-0x0;var _0x1f9479=_0x55ca[_0x268319];return _0x1f9479;};'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 fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('VoiceQueue',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 677067e..5e48242 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4282=['ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify'];(function(_0x4ae5d3,_0x3f65fe){var _0x38bb02=function(_0x2b12f8){while(--_0x2b12f8){_0x4ae5d3['push'](_0x4ae5d3['shift']());}};_0x38bb02(++_0x3f65fe);}(_0x4282,0x19d));var _0x2428=function(_0x3ef95c,_0x206af5){_0x3ef95c=_0x3ef95c-0x0;var _0x29add2=_0x4282[_0x3ef95c];return _0x29add2;};'use strict';var _=require(_0x2428('0x0'));var util=require(_0x2428('0x1'));var moment=require(_0x2428('0x2'));var BPromise=require(_0x2428('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2428('0x4'));var db=require(_0x2428('0x5'))['db'];var utils=require(_0x2428('0x6'));var logger=require('../../config/logger')(_0x2428('0x7'));var config=require(_0x2428('0x8'));var jayson=require(_0x2428('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x2428('0xa')]=_[_0x2428('0xb')](config['redis'],{'host':_0x2428('0xc'),'port':0x18eb});var socket=require(_0x2428('0xd'))(new Redis(config[_0x2428('0xa')]));require(_0x2428('0xe'))[_0x2428('0xf')](socket);function respondWithRpcPromise(_0x4fd369,_0x31f747,_0x5ee917){return new BPromise(function(_0x64a0e9,_0x50692b){return client[_0x2428('0x10')](_0x4fd369,_0x5ee917)[_0x2428('0x11')](function(_0x22019f){logger[_0x2428('0x12')](_0x2428('0x13'),_0x31f747,_0x2428('0x14'));logger[_0x2428('0x15')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x31f747,_0x2428('0x14'),JSON['stringify'](_0x22019f));if(_0x22019f[_0x2428('0x16')]){if(_0x22019f['error'][_0x2428('0x17')]===0x1f4){logger[_0x2428('0x16')](_0x2428('0x13'),_0x31f747,_0x22019f[_0x2428('0x16')][_0x2428('0x18')]);return _0x50692b(_0x22019f[_0x2428('0x16')][_0x2428('0x18')]);}logger[_0x2428('0x16')](_0x2428('0x13'),_0x31f747,_0x22019f['error']['message']);return _0x64a0e9(_0x22019f[_0x2428('0x16')]['message']);}else{logger['info'](_0x2428('0x13'),_0x31f747,_0x2428('0x14'));_0x64a0e9(_0x22019f[_0x2428('0x19')]['message']);}})[_0x2428('0x1a')](function(_0x4d8297){logger[_0x2428('0x16')](_0x2428('0x13'),_0x31f747,_0x4d8297);_0x50692b(_0x4d8297);});});}exports[_0x2428('0x1b')]=function(_0x3b5bbd){var _0x55d1de=this;return new Promise(function(_0x20883a,_0xd30244){return db['VoiceQueue'][_0x2428('0x1c')]({'raw':_0x3b5bbd[_0x2428('0x1d')]?_0x3b5bbd[_0x2428('0x1d')][_0x2428('0x1e')]===undefined?!![]:![]:!![],'where':_0x3b5bbd[_0x2428('0x1d')]?_0x3b5bbd[_0x2428('0x1d')][_0x2428('0x1f')]||null:null,'attributes':_0x3b5bbd['options']?_0x3b5bbd[_0x2428('0x1d')][_0x2428('0x20')]||null:null,'limit':_0x3b5bbd[_0x2428('0x1d')]?_0x3b5bbd['options'][_0x2428('0x21')]||null:null,'include':_0x3b5bbd[_0x2428('0x1d')]?_0x3b5bbd['options'][_0x2428('0x22')]?_[_0x2428('0x23')](_0x3b5bbd['options']['include'],function(_0x22bfde){return{'model':db[_0x22bfde[_0x2428('0x24')]],'as':_0x22bfde['as'],'attributes':_0x22bfde[_0x2428('0x20')],'include':_0x22bfde[_0x2428('0x22')]?_[_0x2428('0x23')](_0x22bfde['include'],function(_0x4262ee){return{'model':db[_0x4262ee[_0x2428('0x24')]],'as':_0x4262ee['as'],'attributes':_0x4262ee['attributes'],'include':_0x4262ee['include']?_[_0x2428('0x23')](_0x4262ee['include'],function(_0x3d0487){return{'model':db[_0x3d0487[_0x2428('0x24')]],'as':_0x3d0487['as'],'attributes':_0x3d0487[_0x2428('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2428('0x11')](function(_0x25c9f9){logger[_0x2428('0x12')](_0x2428('0x1b'),_0x3b5bbd);logger['debug'](_0x2428('0x1b'),_0x3b5bbd,JSON[_0x2428('0x25')](_0x25c9f9));_0x20883a(_0x25c9f9);})[_0x2428('0x1a')](function(_0x405831){logger['error'](_0x2428('0x1b'),_0x405831[_0x2428('0x18')],_0x3b5bbd);_0xd30244(_0x55d1de[_0x2428('0x16')](0x1f4,_0x405831[_0x2428('0x18')]));});});};exports[_0x2428('0x26')]=function(_0x528a98){var _0x48cd80=this;return new Promise(function(_0x5897d3,_0x5d6779){return db[_0x2428('0x27')][_0x2428('0x28')]({'raw':_0x528a98[_0x2428('0x1d')]?_0x528a98[_0x2428('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x528a98[_0x2428('0x1d')]?_0x528a98[_0x2428('0x1d')]['where']||null:null,'attributes':_0x528a98['options']?_0x528a98['options'][_0x2428('0x20')]||null:null,'include':_0x528a98[_0x2428('0x1d')]?_0x528a98[_0x2428('0x1d')][_0x2428('0x22')]?_['map'](_0x528a98[_0x2428('0x1d')]['include'],function(_0x47e452){return{'model':db[_0x47e452[_0x2428('0x24')]],'as':_0x47e452['as'],'attributes':_0x47e452[_0x2428('0x20')],'include':_0x47e452[_0x2428('0x22')]?_[_0x2428('0x23')](_0x47e452[_0x2428('0x22')],function(_0x23133a){return{'model':db[_0x23133a[_0x2428('0x24')]],'as':_0x23133a['as'],'attributes':_0x23133a[_0x2428('0x20')],'include':_0x23133a['include']?_[_0x2428('0x23')](_0x23133a[_0x2428('0x22')],function(_0x58e7b8){return{'model':db[_0x58e7b8[_0x2428('0x24')]],'as':_0x58e7b8['as'],'attributes':_0x58e7b8[_0x2428('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d2129){logger[_0x2428('0x12')]('ShowVoiceQueue',_0x528a98);logger[_0x2428('0x15')](_0x2428('0x26'),_0x528a98,JSON[_0x2428('0x25')](_0x5d2129));_0x5897d3(_0x5d2129);})[_0x2428('0x1a')](function(_0x17544a){logger[_0x2428('0x16')]('ShowVoiceQueue',_0x17544a[_0x2428('0x18')],_0x528a98);_0x5d6779(_0x48cd80[_0x2428('0x16')](0x1f4,_0x17544a[_0x2428('0x18')]));});});};
\ No newline at end of file
+var _0xdc1b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','limit','include','model','map','info','catch','ShowVoiceQueue','stringify','lodash','moment','bluebird','randomstring'];(function(_0x2b6309,_0x437b8f){var _0x3c09ce=function(_0xf7ef81){while(--_0xf7ef81){_0x2b6309['push'](_0x2b6309['shift']());}};_0x3c09ce(++_0x437b8f);}(_0xdc1b,0x122));var _0xbdc1=function(_0x4cce65,_0x40021e){_0x4cce65=_0x4cce65-0x0;var _0x4d1b45=_0xdc1b[_0x4cce65];return _0x4d1b45;};'use strict';var _=require(_0xbdc1('0x0'));var util=require('util');var moment=require(_0xbdc1('0x1'));var BPromise=require(_0xbdc1('0x2'));var rs=require(_0xbdc1('0x3'));var fs=require('fs');var Redis=require(_0xbdc1('0x4'));var db=require(_0xbdc1('0x5'))['db'];var utils=require(_0xbdc1('0x6'));var logger=require(_0xbdc1('0x7'))(_0xbdc1('0x8'));var config=require(_0xbdc1('0x9'));var jayson=require(_0xbdc1('0xa'));var client=jayson[_0xbdc1('0xb')][_0xbdc1('0xc')]({'port':0x232a});config['redis']=_[_0xbdc1('0xd')](config[_0xbdc1('0xe')],{'host':_0xbdc1('0xf'),'port':0x18eb});var socket=require(_0xbdc1('0x10'))(new Redis(config[_0xbdc1('0xe')]));require(_0xbdc1('0x11'))[_0xbdc1('0x12')](socket);function respondWithRpcPromise(_0x2a90e6,_0x2da29b,_0x24c99b){return new BPromise(function(_0x1a5ffb,_0x2508dc){return client[_0xbdc1('0x13')](_0x2a90e6,_0x24c99b)[_0xbdc1('0x14')](function(_0x88c261){logger['info'](_0xbdc1('0x15'),_0x2da29b,_0xbdc1('0x16'));logger[_0xbdc1('0x17')](_0xbdc1('0x18'),_0x2da29b,'request\x20sent',JSON['stringify'](_0x88c261));if(_0x88c261[_0xbdc1('0x19')]){if(_0x88c261[_0xbdc1('0x19')][_0xbdc1('0x1a')]===0x1f4){logger[_0xbdc1('0x19')](_0xbdc1('0x15'),_0x2da29b,_0x88c261[_0xbdc1('0x19')][_0xbdc1('0x1b')]);return _0x2508dc(_0x88c261[_0xbdc1('0x19')][_0xbdc1('0x1b')]);}logger[_0xbdc1('0x19')](_0xbdc1('0x15'),_0x2da29b,_0x88c261[_0xbdc1('0x19')][_0xbdc1('0x1b')]);return _0x1a5ffb(_0x88c261['error']['message']);}else{logger['info'](_0xbdc1('0x15'),_0x2da29b,_0xbdc1('0x16'));_0x1a5ffb(_0x88c261['result'][_0xbdc1('0x1b')]);}})['catch'](function(_0x404772){logger[_0xbdc1('0x19')]('VoiceQueue,\x20%s,\x20%s',_0x2da29b,_0x404772);_0x2508dc(_0x404772);});});}exports[_0xbdc1('0x1c')]=function(_0x47a3dc){var _0x49c75d=this;return new Promise(function(_0x3fbf1d,_0x3ff26b){return db[_0xbdc1('0x1d')]['findAll']({'raw':_0x47a3dc[_0xbdc1('0x1e')]?_0x47a3dc[_0xbdc1('0x1e')][_0xbdc1('0x1f')]===undefined?!![]:![]:!![],'where':_0x47a3dc[_0xbdc1('0x1e')]?_0x47a3dc[_0xbdc1('0x1e')][_0xbdc1('0x20')]||null:null,'attributes':_0x47a3dc[_0xbdc1('0x1e')]?_0x47a3dc[_0xbdc1('0x1e')][_0xbdc1('0x21')]||null:null,'limit':_0x47a3dc[_0xbdc1('0x1e')]?_0x47a3dc[_0xbdc1('0x1e')][_0xbdc1('0x22')]||null:null,'include':_0x47a3dc['options']?_0x47a3dc[_0xbdc1('0x1e')]['include']?_['map'](_0x47a3dc[_0xbdc1('0x1e')][_0xbdc1('0x23')],function(_0x39146c){return{'model':db[_0x39146c[_0xbdc1('0x24')]],'as':_0x39146c['as'],'attributes':_0x39146c[_0xbdc1('0x21')],'include':_0x39146c['include']?_[_0xbdc1('0x25')](_0x39146c[_0xbdc1('0x23')],function(_0x4dcf94){return{'model':db[_0x4dcf94['model']],'as':_0x4dcf94['as'],'attributes':_0x4dcf94[_0xbdc1('0x21')],'include':_0x4dcf94[_0xbdc1('0x23')]?_['map'](_0x4dcf94['include'],function(_0x313a9f){return{'model':db[_0x313a9f[_0xbdc1('0x24')]],'as':_0x313a9f['as'],'attributes':_0x313a9f[_0xbdc1('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbdc1('0x14')](function(_0x49a3d3){logger[_0xbdc1('0x26')](_0xbdc1('0x1c'),_0x47a3dc);logger['debug'](_0xbdc1('0x1c'),_0x47a3dc,JSON['stringify'](_0x49a3d3));_0x3fbf1d(_0x49a3d3);})[_0xbdc1('0x27')](function(_0x362ed6){logger[_0xbdc1('0x19')](_0xbdc1('0x1c'),_0x362ed6[_0xbdc1('0x1b')],_0x47a3dc);_0x3ff26b(_0x49c75d[_0xbdc1('0x19')](0x1f4,_0x362ed6[_0xbdc1('0x1b')]));});});};exports[_0xbdc1('0x28')]=function(_0x12ffcf){var _0x4d7ff2=this;return new Promise(function(_0x19cefc,_0x3906b7){return db[_0xbdc1('0x1d')]['find']({'raw':_0x12ffcf['options']?_0x12ffcf[_0xbdc1('0x1e')][_0xbdc1('0x1f')]===undefined?!![]:![]:!![],'where':_0x12ffcf[_0xbdc1('0x1e')]?_0x12ffcf[_0xbdc1('0x1e')][_0xbdc1('0x20')]||null:null,'attributes':_0x12ffcf[_0xbdc1('0x1e')]?_0x12ffcf[_0xbdc1('0x1e')]['attributes']||null:null,'include':_0x12ffcf[_0xbdc1('0x1e')]?_0x12ffcf['options'][_0xbdc1('0x23')]?_[_0xbdc1('0x25')](_0x12ffcf['options'][_0xbdc1('0x23')],function(_0x17b4f0){return{'model':db[_0x17b4f0['model']],'as':_0x17b4f0['as'],'attributes':_0x17b4f0[_0xbdc1('0x21')],'include':_0x17b4f0[_0xbdc1('0x23')]?_['map'](_0x17b4f0[_0xbdc1('0x23')],function(_0x99607e){return{'model':db[_0x99607e[_0xbdc1('0x24')]],'as':_0x99607e['as'],'attributes':_0x99607e[_0xbdc1('0x21')],'include':_0x99607e[_0xbdc1('0x23')]?_['map'](_0x99607e[_0xbdc1('0x23')],function(_0x52bf7a){return{'model':db[_0x52bf7a['model']],'as':_0x52bf7a['as'],'attributes':_0x52bf7a[_0xbdc1('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbdc1('0x14')](function(_0x1e2c72){logger['info'](_0xbdc1('0x28'),_0x12ffcf);logger[_0xbdc1('0x17')](_0xbdc1('0x28'),_0x12ffcf,JSON[_0xbdc1('0x29')](_0x1e2c72));_0x19cefc(_0x1e2c72);})[_0xbdc1('0x27')](function(_0x45825f){logger[_0xbdc1('0x19')]('ShowVoiceQueue',_0x45825f[_0xbdc1('0x1b')],_0x12ffcf);_0x3906b7(_0x4d7ff2[_0xbdc1('0x19')](0x1f4,_0x45825f[_0xbdc1('0x1b')]));});});};
\ No newline at end of file
index dfdc76d..4e08ceb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe135=['register','length','voiceQueue:','save','remove','update','emit','removeListener'];(function(_0x5013aa,_0x418af4){var _0x34a2b5=function(_0x2d59f7){while(--_0x2d59f7){_0x5013aa['push'](_0x5013aa['shift']());}};_0x34a2b5(++_0x418af4);}(_0xe135,0x113));var _0x5e13=function(_0x146edd,_0x2be255){_0x146edd=_0x146edd-0x0;var _0x46079b=_0xe135[_0x146edd];return _0x46079b;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x5e13('0x0'),_0x5e13('0x1'),_0x5e13('0x2')];function createListener(_0xa396b1,_0x4afa4c){return function(_0x2e65d0){_0x4afa4c[_0x5e13('0x3')](_0xa396b1,_0x2e65d0);};}function removeListener(_0x1114f3,_0x2fe653){return function(){VoiceQueueEvents[_0x5e13('0x4')](_0x1114f3,_0x2fe653);};}exports[_0x5e13('0x5')]=function(_0x195bb1){for(var _0x10ba13=0x0,_0x5bef0d=events[_0x5e13('0x6')];_0x10ba13<_0x5bef0d;_0x10ba13++){var _0x34f262=events[_0x10ba13];var _0x5ce24b=createListener(_0x5e13('0x7')+_0x34f262,_0x195bb1);VoiceQueueEvents['on'](_0x34f262,_0x5ce24b);}};
\ No newline at end of file
+var _0x96c1=['remove','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','save'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x96c1,0x12e));var _0x196c=function(_0x54b5ab,_0xc8231d){_0x54b5ab=_0x54b5ab-0x0;var _0x4e4b6f=_0x96c1[_0x54b5ab];return _0x4e4b6f;};'use strict';var VoiceQueueEvents=require(_0x196c('0x0'));var events=[_0x196c('0x1'),_0x196c('0x2'),'update'];function createListener(_0xbf88ca,_0x1f9a2a){return function(_0x241f41){_0x1f9a2a[_0x196c('0x3')](_0xbf88ca,_0x241f41);};}function removeListener(_0x3fc355,_0x19079e){return function(){VoiceQueueEvents[_0x196c('0x4')](_0x3fc355,_0x19079e);};}exports[_0x196c('0x5')]=function(_0x9c2f64){for(var _0x82fbb7=0x0,_0x126017=events[_0x196c('0x6')];_0x82fbb7<_0x126017;_0x82fbb7++){var _0x2b2c02=events[_0x82fbb7];var _0x510c01=createListener(_0x196c('0x7')+_0x2b2c02,_0x9c2f64);VoiceQueueEvents['on'](_0x2b2c02,_0x510c01);}};
\ No newline at end of file
index 9b2b34c..db9f302 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdbd=['util','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','/:id','show','create','put','delete','destroy','exports','multer'];(function(_0x28286e,_0xd8c672){var _0x3a253e=function(_0x1830e7){while(--_0x1830e7){_0x28286e['push'](_0x28286e['shift']());}};_0x3a253e(++_0xd8c672);}(_0xbdbd,0x153));var _0xdbdb=function(_0x3d7bf2,_0x47e903){_0x3d7bf2=_0x3d7bf2-0x0;var _0x4de1b4=_0xbdbd[_0x3d7bf2];return _0x4de1b4;};'use strict';var multer=require(_0xdbdb('0x0'));var util=require(_0xdbdb('0x1'));var path=require('path');var timeout=require(_0xdbdb('0x2'));var express=require('express');var router=express[_0xdbdb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdbdb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xdbdb('0x5'));var controller=require(_0xdbdb('0x6'));router[_0xdbdb('0x7')]('/',auth[_0xdbdb('0x8')](),controller[_0xdbdb('0x9')]);router[_0xdbdb('0x7')](_0xdbdb('0xa'),auth['isAuthenticated'](),controller[_0xdbdb('0xb')]);router[_0xdbdb('0x7')](_0xdbdb('0xc'),auth[_0xdbdb('0x8')](),controller['getVoiceQueuesReport']);router[_0xdbdb('0x7')](_0xdbdb('0xd'),auth[_0xdbdb('0x8')](),controller[_0xdbdb('0xe')]);router['post']('/',auth[_0xdbdb('0x8')](),controller[_0xdbdb('0xf')]);router[_0xdbdb('0x10')]('/:id',auth[_0xdbdb('0x8')](),controller['update']);router[_0xdbdb('0x11')](_0xdbdb('0xd'),auth[_0xdbdb('0x8')](),controller[_0xdbdb('0x12')]);module[_0xdbdb('0x13')]=router;
\ No newline at end of file
+var _0x01eb=['delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','get','index','/describe','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','post','put','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x01eb,0x1d1));var _0xb01e=function(_0x582942,_0x4c6747){_0x582942=_0x582942-0x0;var _0x3a0b75=_0x01eb[_0x582942];return _0x3a0b75;};'use strict';var multer=require(_0xb01e('0x0'));var util=require('util');var path=require(_0xb01e('0x1'));var timeout=require(_0xb01e('0x2'));var express=require(_0xb01e('0x3'));var router=express[_0xb01e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb01e('0x5'));var interaction=require(_0xb01e('0x6'));var config=require('../../config/environment');var controller=require(_0xb01e('0x7'));router[_0xb01e('0x8')]('/',auth['isAuthenticated'](),controller[_0xb01e('0x9')]);router[_0xb01e('0x8')](_0xb01e('0xa'),auth[_0xb01e('0xb')](),controller[_0xb01e('0xc')]);router[_0xb01e('0x8')](_0xb01e('0xd'),auth[_0xb01e('0xb')](),controller[_0xb01e('0xe')]);router[_0xb01e('0x8')](_0xb01e('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xb01e('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb01e('0x11')](_0xb01e('0xf'),auth[_0xb01e('0xb')](),controller[_0xb01e('0x12')]);router[_0xb01e('0x13')](_0xb01e('0xf'),auth['isAuthenticated'](),controller[_0xb01e('0x14')]);module[_0xb01e('0x15')]=router;
\ No newline at end of file
index f9d7268..5a29f4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12dc=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING'];(function(_0xefbe0c,_0x171c02){var _0x840691=function(_0x1d467d){while(--_0x1d467d){_0xefbe0c['push'](_0xefbe0c['shift']());}};_0x840691(++_0x171c02);}(_0x12dc,0xc0));var _0xc12d=function(_0x1f6f6b,_0x3bb91d){_0x1f6f6b=_0x1f6f6b-0x0;var _0x4015d1=_0x12dc[_0x1f6f6b];return _0x4015d1;};'use strict';var Sequelize=require(_0xc12d('0x0'));var moment=require(_0xc12d('0x1'));module[_0xc12d('0x2')]={'type':{'type':Sequelize[_0xc12d('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc12d('0x3')]},'calleridname':{'type':Sequelize[_0xc12d('0x3')]},'queue':{'type':Sequelize[_0xc12d('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xc12d('0x4')],'set':function(_0x34a7c9){var _0x4ef667=moment(_0x34a7c9);var _0x39f88d=moment(this['getDataValue']('queuecallerjoinAt'))[_0xc12d('0x5')](_0xc12d('0x6'));var _0x3c99e8=_0x4ef667[_0xc12d('0x7')](_0x39f88d,'seconds');this[_0xc12d('0x8')](_0xc12d('0x9'),_0x34a7c9);this[_0xc12d('0x8')](_0xc12d('0xa'),_0x3c99e8||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xc12d('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xc12d('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xc12d('0x4')]},'queuecallercomplete':{'type':Sequelize[_0xc12d('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xc12d('0x4')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xc12d('0x3')],'comment':_0xc12d('0xd')},'originalposition':{'type':Sequelize[_0xc12d('0xb')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xc12d('0x3')]},'connectedlinename':{'type':Sequelize[_0xc12d('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xc12d('0x3')]},'exten':{'type':Sequelize[_0xc12d('0x3')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0xc12d('0xb')]},'mohtime':{'type':Sequelize[_0xc12d('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc12d('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xc12d('0x3')]},'transfer':{'type':Sequelize[_0xc12d('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xc12d('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xc12d('0x3')]},'secondDisposition':{'type':Sequelize[_0xc12d('0x3')]},'thirdDisposition':{'type':Sequelize[_0xc12d('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xc12d('0xb')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x2131=['YYYY-MM-DD\x20HH:mm:ss','diff','queuecallerleaveAt','setDataValue','INTEGER','BOOLEAN','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt'];(function(_0x54a2e4,_0x1ff92c){var _0x4742d0=function(_0x147a6f){while(--_0x147a6f){_0x54a2e4['push'](_0x54a2e4['shift']());}};_0x4742d0(++_0x1ff92c);}(_0x2131,0xaf));var _0x1213=function(_0x368b19,_0xcf4ad7){_0x368b19=_0x368b19-0x0;var _0x8ec657=_0x2131[_0x368b19];return _0x8ec657;};'use strict';var Sequelize=require(_0x1213('0x0'));var moment=require(_0x1213('0x1'));module[_0x1213('0x2')]={'type':{'type':Sequelize[_0x1213('0x3')]},'uniqueid':{'type':Sequelize[_0x1213('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x1213('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x1213('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x1213('0x4')],'set':function(_0x1c9102){var _0x431c87=moment(_0x1c9102);var _0x125233=moment(this[_0x1213('0x5')](_0x1213('0x6')))['format'](_0x1213('0x7'));var _0x1ed7c2=_0x431c87[_0x1213('0x8')](_0x125233,'seconds');this['setDataValue'](_0x1213('0x9'),_0x1c9102);this[_0x1213('0xa')]('holdtime',_0x1ed7c2||null);}},'position':{'type':Sequelize[_0x1213('0xb')]},'count':{'type':Sequelize[_0x1213('0xb')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x1213('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x1213('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x1213('0x4')]},'queuecallerexit':{'type':Sequelize[_0x1213('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x1213('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x1213('0xb')]},'channel':{'type':Sequelize[_0x1213('0x3')]},'connectedlinenum':{'type':Sequelize[_0x1213('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1213('0x3')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x1213('0x3')]},'holdtime':{'type':Sequelize[_0x1213('0xb')]},'mohtime':{'type':Sequelize[_0x1213('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1213('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x1213('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x1213('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x1213('0x3')]},'transferuniqueid':{'type':Sequelize[_0x1213('0x3')]},'disposition':{'type':Sequelize[_0x1213('0x3')]},'secondDisposition':{'type':Sequelize[_0x1213('0x3')]},'thirdDisposition':{'type':Sequelize[_0x1213('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index cc2c0a5..5bf6ecf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2cc=['keys','options','find','create','body','describe','getVoiceQueuesReport','findAll','rows','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','VoiceQueueReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','VIRTUAL','filter','merge','includeAll','include','catch','show','params'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0xd2cc,0xb3));var _0xcd2c=function(_0x7815ae,_0x578f20){_0x7815ae=_0x7815ae-0x0;var _0x2af9d0=_0xd2cc[_0x7815ae];return _0x2af9d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcd2c('0x0'));var zipdir=require(_0xcd2c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcd2c('0x2'));var moment=require(_0xcd2c('0x3'));var BPromise=require(_0xcd2c('0x4'));var Mustache=require(_0xcd2c('0x5'));var util=require(_0xcd2c('0x6'));var path=require(_0xcd2c('0x7'));var sox=require(_0xcd2c('0x8'));var csv=require(_0xcd2c('0x9'));var ejs=require(_0xcd2c('0xa'));var fs=require('fs');var fs_extra=require(_0xcd2c('0xb'));var _=require(_0xcd2c('0xc'));var squel=require(_0xcd2c('0xd'));var crypto=require(_0xcd2c('0xe'));var jsforce=require(_0xcd2c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xcd2c('0x9'));var querystring=require(_0xcd2c('0x10'));var Papa=require(_0xcd2c('0x11'));var Redis=require(_0xcd2c('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcd2c('0x13'));var hardwareService=require(_0xcd2c('0x14'));var logger=require(_0xcd2c('0x15'))(_0xcd2c('0x16'));var utils=require(_0xcd2c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xcd2c('0x18'));var db=require('../../mysqldb')['db'];config[_0xcd2c('0x19')]=_['defaults'](config[_0xcd2c('0x19')],{'host':_0xcd2c('0x1a'),'port':0x18eb});var socket=require(_0xcd2c('0x1b'))(new Redis(config[_0xcd2c('0x19')]));require(_0xcd2c('0x1c'))[_0xcd2c('0x1d')](socket);function respondWithStatusCode(_0x381dcd,_0x541216){_0x541216=_0x541216||0xcc;return function(_0xe2a658){if(_0xe2a658){return _0x381dcd[_0xcd2c('0x1e')](_0x541216);}return _0x381dcd[_0xcd2c('0x1f')](_0x541216)[_0xcd2c('0x20')]();};}function respondWithResult(_0x45f472,_0x2cad15){_0x2cad15=_0x2cad15||0xc8;return function(_0x58c997){if(_0x58c997){return _0x45f472[_0xcd2c('0x1f')](_0x2cad15)[_0xcd2c('0x21')](_0x58c997);}};}function respondWithFilteredResult(_0x4f173e,_0x55c098){return function(_0x446a12){if(_0x446a12){var _0xb7173a=typeof _0x55c098['offset']===_0xcd2c('0x22')&&typeof _0x55c098[_0xcd2c('0x23')]==='undefined';var _0x381e76=_0x446a12[_0xcd2c('0x24')];var _0x48ad61=_0xb7173a?0x0:_0x55c098[_0xcd2c('0x25')];var _0x1861ad=_0xb7173a?_0x446a12[_0xcd2c('0x24')]:_0x55c098[_0xcd2c('0x25')]+_0x55c098[_0xcd2c('0x23')];var _0x5ed609;if(_0x1861ad>=_0x381e76){_0x1861ad=_0x381e76;_0x5ed609=0xc8;}else{_0x5ed609=0xce;}_0x4f173e['status'](_0x5ed609);return _0x4f173e[_0xcd2c('0x26')](_0xcd2c('0x27'),_0x48ad61+'-'+_0x1861ad+'/'+_0x381e76)['json'](_0x446a12);}return null;};}function patchUpdates(_0x4c182d){return function(_0x361f85){try{jsonpatch[_0xcd2c('0x28')](_0x361f85,_0x4c182d,!![]);}catch(_0x4c0267){return BPromise['reject'](_0x4c0267);}return _0x361f85['save']();};}function saveUpdates(_0x2eb570,_0x9bad15){return function(_0x44d43c){if(_0x44d43c){return _0x44d43c[_0xcd2c('0x29')](_0x2eb570)[_0xcd2c('0x2a')](function(_0x519db0){return _0x519db0;});}return null;};}function removeEntity(_0xc0b365,_0x202d44){return function(_0x5becc5){if(_0x5becc5){return _0x5becc5[_0xcd2c('0x2b')]()[_0xcd2c('0x2a')](function(){_0xc0b365[_0xcd2c('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x236160,_0x2a62bc){return function(_0x44d568){if(!_0x44d568){_0x236160['sendStatus'](0x194);}return _0x44d568;};}function handleError(_0x49789f,_0x307af1){_0x307af1=_0x307af1||0x1f4;return function(_0x514e12){logger[_0xcd2c('0x2c')](_0x514e12[_0xcd2c('0x2d')]);if(_0x514e12[_0xcd2c('0x2e')]){delete _0x514e12[_0xcd2c('0x2e')];}_0x49789f[_0xcd2c('0x1f')](_0x307af1)[_0xcd2c('0x2f')](_0x514e12);};}exports[_0xcd2c('0x30')]=function(_0x8f506f,_0x3c4745){var _0x19a639={},_0x5dd80a={},_0x4e6c93={'count':0x0,'rows':[]};var _0x2deff5=_['map'](db[_0xcd2c('0x31')][_0xcd2c('0x32')],function(_0x93ba87){return{'name':_0x93ba87[_0xcd2c('0x33')],'type':_0x93ba87[_0xcd2c('0x34')][_0xcd2c('0x35')]};});_0x5dd80a[_0xcd2c('0x36')]=_[_0xcd2c('0x37')](_0x2deff5,_0xcd2c('0x2e'));_0x5dd80a[_0xcd2c('0x38')]=_['keys'](_0x8f506f[_0xcd2c('0x38')]);_0x5dd80a['filters']=_[_0xcd2c('0x39')](_0x5dd80a[_0xcd2c('0x36')],_0x5dd80a['query']);_0x19a639[_0xcd2c('0x3a')]=_[_0xcd2c('0x39')](_0x5dd80a[_0xcd2c('0x36')],qs[_0xcd2c('0x3b')](_0x8f506f[_0xcd2c('0x38')]['fields']));_0x19a639[_0xcd2c('0x3a')]=_0x19a639[_0xcd2c('0x3a')][_0xcd2c('0x3c')]?_0x19a639[_0xcd2c('0x3a')]:_0x5dd80a[_0xcd2c('0x36')];if(!_0x8f506f[_0xcd2c('0x38')][_0xcd2c('0x3d')](_0xcd2c('0x3e'))){_0x19a639[_0xcd2c('0x23')]=qs['limit'](_0x8f506f[_0xcd2c('0x38')][_0xcd2c('0x23')]);_0x19a639[_0xcd2c('0x25')]=qs[_0xcd2c('0x25')](_0x8f506f[_0xcd2c('0x38')]['offset']);}_0x19a639[_0xcd2c('0x3f')]=qs[_0xcd2c('0x40')](_0x8f506f['query']['sort']);_0x19a639[_0xcd2c('0x41')]=qs['filters'](_[_0xcd2c('0x42')](_0x8f506f[_0xcd2c('0x38')],_0x5dd80a[_0xcd2c('0x43')]),_0x2deff5);if(_0x8f506f[_0xcd2c('0x38')]['filter']){_0x19a639[_0xcd2c('0x41')]=_['merge'](_0x19a639['where'],{'$or':_['map'](_0x2deff5,function(_0x4d4b3d){if(_0x4d4b3d['type']!==_0xcd2c('0x44')){var _0x22316c={};_0x22316c[_0x4d4b3d['name']]={'$like':'%'+_0x8f506f[_0xcd2c('0x38')][_0xcd2c('0x45')]+'%'};return _0x22316c;}})});}_0x19a639=_[_0xcd2c('0x46')]({},_0x19a639,_0x8f506f['options']);var _0xce7d48={'where':_0x19a639[_0xcd2c('0x41')]};return db[_0xcd2c('0x31')][_0xcd2c('0x24')](_0xce7d48)[_0xcd2c('0x2a')](function(_0x3b0a45){_0x4e6c93[_0xcd2c('0x24')]=_0x3b0a45;if(_0x8f506f[_0xcd2c('0x38')][_0xcd2c('0x47')]){_0x19a639[_0xcd2c('0x48')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x19a639);})[_0xcd2c('0x2a')](function(_0x5f4a51){_0x4e6c93['rows']=_0x5f4a51;return _0x4e6c93;})[_0xcd2c('0x2a')](respondWithFilteredResult(_0x3c4745,_0x19a639))[_0xcd2c('0x49')](handleError(_0x3c4745,null));};exports[_0xcd2c('0x4a')]=function(_0x37ad1e,_0x34b4cc){var _0x51d586={'raw':![],'where':{'id':_0x37ad1e[_0xcd2c('0x4b')]['id']}},_0xd291c5={};_0xd291c5[_0xcd2c('0x36')]=_['keys'](db[_0xcd2c('0x31')][_0xcd2c('0x32')]);_0xd291c5[_0xcd2c('0x38')]=_[_0xcd2c('0x4c')](_0x37ad1e[_0xcd2c('0x38')]);_0xd291c5['filters']=_[_0xcd2c('0x39')](_0xd291c5['model'],_0xd291c5[_0xcd2c('0x38')]);_0x51d586[_0xcd2c('0x3a')]=_[_0xcd2c('0x39')](_0xd291c5[_0xcd2c('0x36')],qs[_0xcd2c('0x3b')](_0x37ad1e[_0xcd2c('0x38')][_0xcd2c('0x3b')]));_0x51d586[_0xcd2c('0x3a')]=_0x51d586['attributes']['length']?_0x51d586['attributes']:_0xd291c5['model'];if(_0x37ad1e[_0xcd2c('0x38')][_0xcd2c('0x47')]){_0x51d586['include']=[{'all':!![]}];}_0x51d586=_['merge']({},_0x51d586,_0x37ad1e[_0xcd2c('0x4d')]);return db[_0xcd2c('0x31')][_0xcd2c('0x4e')](_0x51d586)[_0xcd2c('0x2a')](handleEntityNotFound(_0x34b4cc,null))[_0xcd2c('0x2a')](respondWithResult(_0x34b4cc,null))[_0xcd2c('0x49')](handleError(_0x34b4cc,null));};exports[_0xcd2c('0x4f')]=function(_0x445a99,_0x3f36f2){return db[_0xcd2c('0x31')]['create'](_0x445a99[_0xcd2c('0x50')],{})[_0xcd2c('0x2a')](respondWithResult(_0x3f36f2,0xc9))[_0xcd2c('0x49')](handleError(_0x3f36f2,null));};exports['update']=function(_0x57e8ad,_0x7892e6){if(_0x57e8ad[_0xcd2c('0x50')]['id']){delete _0x57e8ad[_0xcd2c('0x50')]['id'];}return db[_0xcd2c('0x31')][_0xcd2c('0x4e')]({'where':{'id':_0x57e8ad[_0xcd2c('0x4b')]['id']}})[_0xcd2c('0x2a')](handleEntityNotFound(_0x7892e6,null))['then'](saveUpdates(_0x57e8ad['body'],null))['then'](respondWithResult(_0x7892e6,null))[_0xcd2c('0x49')](handleError(_0x7892e6,null));};exports[_0xcd2c('0x2b')]=function(_0x435de9,_0x1855af){return db['VoiceQueueReport'][_0xcd2c('0x4e')]({'where':{'id':_0x435de9[_0xcd2c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1855af,null))['then'](removeEntity(_0x1855af,null))['catch'](handleError(_0x1855af,null));};exports[_0xcd2c('0x51')]=function(_0x3c70ed,_0xb00595){return db[_0xcd2c('0x31')][_0xcd2c('0x51')]()['then'](respondWithResult(_0xb00595,null))[_0xcd2c('0x49')](handleError(_0xb00595,null));};exports[_0xcd2c('0x52')]=function(_0x327eb0,_0x4b89de){var _0x577130={},_0x54e035={},_0xbbea7={'count':0x0,'rows':[]};_0x54e035[_0xcd2c('0x36')]=_['keys'](db[_0xcd2c('0x31')]['rawAttributes']);_0x54e035[_0xcd2c('0x38')]=_['keys'](_0x327eb0[_0xcd2c('0x38')]);_0x54e035[_0xcd2c('0x43')]=_[_0xcd2c('0x39')](_0x54e035[_0xcd2c('0x36')],_0x54e035['query']);_0x577130[_0xcd2c('0x3a')]=_['intersection'](_0x54e035[_0xcd2c('0x36')],qs[_0xcd2c('0x3b')](_0x327eb0[_0xcd2c('0x38')][_0xcd2c('0x3b')]));_0x577130[_0xcd2c('0x3a')]=_0x577130[_0xcd2c('0x3a')]['length']?_0x577130[_0xcd2c('0x3a')]:_0x54e035['model'];if(!_0x327eb0[_0xcd2c('0x38')]['hasOwnProperty'](_0xcd2c('0x3e'))){_0x577130[_0xcd2c('0x23')]=qs[_0xcd2c('0x23')](_0x327eb0['query'][_0xcd2c('0x23')]);_0x577130[_0xcd2c('0x25')]=qs[_0xcd2c('0x25')](_0x327eb0['query'][_0xcd2c('0x25')]);}_0x577130['order']=qs[_0xcd2c('0x40')](_0x327eb0['query']['sort']);_0x577130[_0xcd2c('0x41')]=qs['filters'](_['pick'](_0x327eb0[_0xcd2c('0x38')],_0x54e035[_0xcd2c('0x43')]));if(_0x327eb0[_0xcd2c('0x38')][_0xcd2c('0x45')]){_0x577130[_0xcd2c('0x41')]=_[_0xcd2c('0x46')](_0x577130[_0xcd2c('0x41')],{'$or':_[_0xcd2c('0x37')](_0x577130['attributes'],function(_0xdabdfe){var _0x185973={};_0x185973[_0xdabdfe]={'$like':'%'+_0x327eb0[_0xcd2c('0x38')]['filter']+'%'};return _0x185973;})});}_0x577130=_['merge']({},_0x577130,_0x327eb0[_0xcd2c('0x4d')]);var _0x19690d={'where':_0x577130['where']};return db[_0xcd2c('0x31')][_0xcd2c('0x24')](_0x19690d)[_0xcd2c('0x2a')](function(_0x56bc4c){_0xbbea7[_0xcd2c('0x24')]=_0x56bc4c;if(_0x327eb0[_0xcd2c('0x38')][_0xcd2c('0x47')]){_0x577130['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0xcd2c('0x53')](_0x577130);})[_0xcd2c('0x2a')](function(_0x449df0){_0xbbea7[_0xcd2c('0x54')]=_0x449df0;return _0xbbea7;})[_0xcd2c('0x2a')](respondWithFilteredResult(_0x4b89de,_0x577130,_0xcd2c('0x52')))[_0xcd2c('0x49')](handleError(_0x4b89de,null,_0xcd2c('0x52')));};
\ No newline at end of file
+var _0x4186=['apply','reject','update','then','destroy','end','error','name','index','map','VoiceQueueReport','rawAttributes','type','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','show','params','options','find','create','body','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','defaults','redis','localhost','./voiceQueueReport.socket','sendStatus','status','json','count','offset','set','Content-Range'];(function(_0x3af5f5,_0x33e0c8){var _0x5d4d5b=function(_0x9fad77){while(--_0x9fad77){_0x3af5f5['push'](_0x3af5f5['shift']());}};_0x5d4d5b(++_0x33e0c8);}(_0x4186,0x7c));var _0x6418=function(_0x5db657,_0x2f40b3){_0x5db657=_0x5db657-0x0;var _0x2d6e70=_0x4186[_0x5db657];return _0x2d6e70;};'use strict';var emlformat=require(_0x6418('0x0'));var rimraf=require(_0x6418('0x1'));var zipdir=require(_0x6418('0x2'));var jsonpatch=require(_0x6418('0x3'));var rp=require(_0x6418('0x4'));var moment=require(_0x6418('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6418('0x6'));var util=require(_0x6418('0x7'));var path=require('path');var sox=require(_0x6418('0x8'));var csv=require(_0x6418('0x9'));var ejs=require(_0x6418('0xa'));var fs=require('fs');var fs_extra=require(_0x6418('0xb'));var _=require(_0x6418('0xc'));var squel=require(_0x6418('0xd'));var crypto=require('crypto');var jsforce=require(_0x6418('0xe'));var deskjs=require(_0x6418('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6418('0x10'));var Papa=require(_0x6418('0x11'));var Redis=require(_0x6418('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6418('0x13'));var as=require(_0x6418('0x14'));var hardwareService=require(_0x6418('0x15'));var logger=require(_0x6418('0x16'))(_0x6418('0x17'));var utils=require(_0x6418('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x6418('0x19')](config[_0x6418('0x1a')],{'host':_0x6418('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6418('0x1c'))['register'](socket);function respondWithStatusCode(_0x52a98d,_0x395bca){_0x395bca=_0x395bca||0xcc;return function(_0x4fa98c){if(_0x4fa98c){return _0x52a98d[_0x6418('0x1d')](_0x395bca);}return _0x52a98d['status'](_0x395bca)['end']();};}function respondWithResult(_0x3babc3,_0x48298c){_0x48298c=_0x48298c||0xc8;return function(_0x3c73b7){if(_0x3c73b7){return _0x3babc3[_0x6418('0x1e')](_0x48298c)[_0x6418('0x1f')](_0x3c73b7);}};}function respondWithFilteredResult(_0x26a184,_0x4e7b00){return function(_0x359a15){if(_0x359a15){var _0x4e443f=typeof _0x4e7b00['offset']==='undefined'&&typeof _0x4e7b00['limit']==='undefined';var _0x21c7d9=_0x359a15[_0x6418('0x20')];var _0x39ed86=_0x4e443f?0x0:_0x4e7b00[_0x6418('0x21')];var _0x4423fc=_0x4e443f?_0x359a15[_0x6418('0x20')]:_0x4e7b00['offset']+_0x4e7b00['limit'];var _0x5e84ce;if(_0x4423fc>=_0x21c7d9){_0x4423fc=_0x21c7d9;_0x5e84ce=0xc8;}else{_0x5e84ce=0xce;}_0x26a184[_0x6418('0x1e')](_0x5e84ce);return _0x26a184[_0x6418('0x22')](_0x6418('0x23'),_0x39ed86+'-'+_0x4423fc+'/'+_0x21c7d9)['json'](_0x359a15);}return null;};}function patchUpdates(_0x249753){return function(_0x594d3a){try{jsonpatch[_0x6418('0x24')](_0x594d3a,_0x249753,!![]);}catch(_0x2d3fbe){return BPromise[_0x6418('0x25')](_0x2d3fbe);}return _0x594d3a['save']();};}function saveUpdates(_0x1bd5dd,_0x99a88a){return function(_0x49acf4){if(_0x49acf4){return _0x49acf4[_0x6418('0x26')](_0x1bd5dd)[_0x6418('0x27')](function(_0x1cb408){return _0x1cb408;});}return null;};}function removeEntity(_0x42d2fa,_0x20bd2c){return function(_0x2e43c3){if(_0x2e43c3){return _0x2e43c3[_0x6418('0x28')]()[_0x6418('0x27')](function(){_0x42d2fa[_0x6418('0x1e')](0xcc)[_0x6418('0x29')]();});}};}function handleEntityNotFound(_0x25826f,_0x5843bd){return function(_0xcba43c){if(!_0xcba43c){_0x25826f['sendStatus'](0x194);}return _0xcba43c;};}function handleError(_0x457e9a,_0x3ee807){_0x3ee807=_0x3ee807||0x1f4;return function(_0x1b8dbf){logger[_0x6418('0x2a')](_0x1b8dbf['stack']);if(_0x1b8dbf[_0x6418('0x2b')]){delete _0x1b8dbf[_0x6418('0x2b')];}_0x457e9a['status'](_0x3ee807)['send'](_0x1b8dbf);};}exports[_0x6418('0x2c')]=function(_0x1aa906,_0x26960a){var _0x63c861={},_0x776117={},_0x3ab868={'count':0x0,'rows':[]};var _0x190152=_[_0x6418('0x2d')](db[_0x6418('0x2e')][_0x6418('0x2f')],function(_0x427232){return{'name':_0x427232['fieldName'],'type':_0x427232[_0x6418('0x30')][_0x6418('0x31')]};});_0x776117['model']=_[_0x6418('0x2d')](_0x190152,'name');_0x776117['query']=_[_0x6418('0x32')](_0x1aa906[_0x6418('0x33')]);_0x776117[_0x6418('0x34')]=_[_0x6418('0x35')](_0x776117['model'],_0x776117[_0x6418('0x33')]);_0x63c861[_0x6418('0x36')]=_[_0x6418('0x35')](_0x776117['model'],qs[_0x6418('0x37')](_0x1aa906[_0x6418('0x33')]['fields']));_0x63c861['attributes']=_0x63c861['attributes'][_0x6418('0x38')]?_0x63c861[_0x6418('0x36')]:_0x776117[_0x6418('0x39')];if(!_0x1aa906[_0x6418('0x33')][_0x6418('0x3a')](_0x6418('0x3b'))){_0x63c861['limit']=qs[_0x6418('0x3c')](_0x1aa906[_0x6418('0x33')]['limit']);_0x63c861['offset']=qs[_0x6418('0x21')](_0x1aa906['query'][_0x6418('0x21')]);}_0x63c861[_0x6418('0x3d')]=qs[_0x6418('0x3e')](_0x1aa906[_0x6418('0x33')][_0x6418('0x3e')]);_0x63c861[_0x6418('0x3f')]=qs[_0x6418('0x34')](_[_0x6418('0x40')](_0x1aa906[_0x6418('0x33')],_0x776117[_0x6418('0x34')]),_0x190152);if(_0x1aa906[_0x6418('0x33')]['filter']){_0x63c861[_0x6418('0x3f')]=_[_0x6418('0x41')](_0x63c861[_0x6418('0x3f')],{'$or':_[_0x6418('0x2d')](_0x190152,function(_0x5c1eee){if(_0x5c1eee[_0x6418('0x30')]!==_0x6418('0x42')){var _0x41e67d={};_0x41e67d[_0x5c1eee[_0x6418('0x2b')]]={'$like':'%'+_0x1aa906[_0x6418('0x33')][_0x6418('0x43')]+'%'};return _0x41e67d;}})});}_0x63c861=_[_0x6418('0x41')]({},_0x63c861,_0x1aa906['options']);var _0x2cac64={'where':_0x63c861[_0x6418('0x3f')]};return db['VoiceQueueReport'][_0x6418('0x20')](_0x2cac64)[_0x6418('0x27')](function(_0x943993){_0x3ab868[_0x6418('0x20')]=_0x943993;if(_0x1aa906[_0x6418('0x33')][_0x6418('0x44')]){_0x63c861[_0x6418('0x45')]=[{'all':!![]}];}return db[_0x6418('0x2e')]['findAll'](_0x63c861);})['then'](function(_0x18dec6){_0x3ab868[_0x6418('0x46')]=_0x18dec6;return _0x3ab868;})['then'](respondWithFilteredResult(_0x26960a,_0x63c861))[_0x6418('0x47')](handleError(_0x26960a,null));};exports[_0x6418('0x48')]=function(_0x40e8d3,_0x5a681d){var _0x367273={'raw':![],'where':{'id':_0x40e8d3[_0x6418('0x49')]['id']}},_0x4ffbe5={};_0x4ffbe5[_0x6418('0x39')]=_[_0x6418('0x32')](db[_0x6418('0x2e')][_0x6418('0x2f')]);_0x4ffbe5[_0x6418('0x33')]=_[_0x6418('0x32')](_0x40e8d3[_0x6418('0x33')]);_0x4ffbe5[_0x6418('0x34')]=_[_0x6418('0x35')](_0x4ffbe5[_0x6418('0x39')],_0x4ffbe5[_0x6418('0x33')]);_0x367273[_0x6418('0x36')]=_[_0x6418('0x35')](_0x4ffbe5['model'],qs[_0x6418('0x37')](_0x40e8d3['query'][_0x6418('0x37')]));_0x367273[_0x6418('0x36')]=_0x367273[_0x6418('0x36')][_0x6418('0x38')]?_0x367273[_0x6418('0x36')]:_0x4ffbe5['model'];if(_0x40e8d3[_0x6418('0x33')][_0x6418('0x44')]){_0x367273[_0x6418('0x45')]=[{'all':!![]}];}_0x367273=_[_0x6418('0x41')]({},_0x367273,_0x40e8d3[_0x6418('0x4a')]);return db[_0x6418('0x2e')][_0x6418('0x4b')](_0x367273)[_0x6418('0x27')](handleEntityNotFound(_0x5a681d,null))[_0x6418('0x27')](respondWithResult(_0x5a681d,null))[_0x6418('0x47')](handleError(_0x5a681d,null));};exports[_0x6418('0x4c')]=function(_0x12645a,_0x30f194){return db[_0x6418('0x2e')][_0x6418('0x4c')](_0x12645a[_0x6418('0x4d')],{})[_0x6418('0x27')](respondWithResult(_0x30f194,0xc9))[_0x6418('0x47')](handleError(_0x30f194,null));};exports[_0x6418('0x26')]=function(_0xbd9c05,_0x1981f8){if(_0xbd9c05[_0x6418('0x4d')]['id']){delete _0xbd9c05['body']['id'];}return db[_0x6418('0x2e')][_0x6418('0x4b')]({'where':{'id':_0xbd9c05[_0x6418('0x49')]['id']}})[_0x6418('0x27')](handleEntityNotFound(_0x1981f8,null))[_0x6418('0x27')](saveUpdates(_0xbd9c05[_0x6418('0x4d')],null))[_0x6418('0x27')](respondWithResult(_0x1981f8,null))[_0x6418('0x47')](handleError(_0x1981f8,null));};exports[_0x6418('0x28')]=function(_0x1999fc,_0x56d5ac){return db[_0x6418('0x2e')]['find']({'where':{'id':_0x1999fc['params']['id']}})[_0x6418('0x27')](handleEntityNotFound(_0x56d5ac,null))[_0x6418('0x27')](removeEntity(_0x56d5ac,null))[_0x6418('0x47')](handleError(_0x56d5ac,null));};exports[_0x6418('0x4e')]=function(_0x163986,_0x3a5c4b){return db[_0x6418('0x2e')]['describe']()[_0x6418('0x27')](respondWithResult(_0x3a5c4b,null))[_0x6418('0x47')](handleError(_0x3a5c4b,null));};exports[_0x6418('0x4f')]=function(_0x15f966,_0x3a0711){var _0x538859={},_0x94c984={},_0xa2f330={'count':0x0,'rows':[]};_0x94c984[_0x6418('0x39')]=_[_0x6418('0x32')](db['VoiceQueueReport']['rawAttributes']);_0x94c984['query']=_[_0x6418('0x32')](_0x15f966[_0x6418('0x33')]);_0x94c984[_0x6418('0x34')]=_[_0x6418('0x35')](_0x94c984['model'],_0x94c984[_0x6418('0x33')]);_0x538859['attributes']=_[_0x6418('0x35')](_0x94c984['model'],qs[_0x6418('0x37')](_0x15f966[_0x6418('0x33')]['fields']));_0x538859[_0x6418('0x36')]=_0x538859[_0x6418('0x36')]['length']?_0x538859[_0x6418('0x36')]:_0x94c984['model'];if(!_0x15f966[_0x6418('0x33')][_0x6418('0x3a')](_0x6418('0x3b'))){_0x538859[_0x6418('0x3c')]=qs[_0x6418('0x3c')](_0x15f966['query'][_0x6418('0x3c')]);_0x538859[_0x6418('0x21')]=qs[_0x6418('0x21')](_0x15f966['query'][_0x6418('0x21')]);}_0x538859[_0x6418('0x3d')]=qs[_0x6418('0x3e')](_0x15f966[_0x6418('0x33')][_0x6418('0x3e')]);_0x538859['where']=qs['filters'](_[_0x6418('0x40')](_0x15f966[_0x6418('0x33')],_0x94c984[_0x6418('0x34')]));if(_0x15f966[_0x6418('0x33')][_0x6418('0x43')]){_0x538859[_0x6418('0x3f')]=_[_0x6418('0x41')](_0x538859[_0x6418('0x3f')],{'$or':_[_0x6418('0x2d')](_0x538859[_0x6418('0x36')],function(_0x52a967){var _0x4ea77e={};_0x4ea77e[_0x52a967]={'$like':'%'+_0x15f966[_0x6418('0x33')][_0x6418('0x43')]+'%'};return _0x4ea77e;})});}_0x538859=_[_0x6418('0x41')]({},_0x538859,_0x15f966[_0x6418('0x4a')]);var _0xe6c1b9={'where':_0x538859[_0x6418('0x3f')]};return db['VoiceQueueReport'][_0x6418('0x20')](_0xe6c1b9)[_0x6418('0x27')](function(_0x301e41){_0xa2f330[_0x6418('0x20')]=_0x301e41;if(_0x15f966[_0x6418('0x33')][_0x6418('0x44')]){_0x538859[_0x6418('0x45')]=[{'all':!![]}];}return db[_0x6418('0x2e')]['findAll'](_0x538859);})[_0x6418('0x27')](function(_0x3f8755){_0xa2f330[_0x6418('0x46')]=_0x3f8755;return _0xa2f330;})[_0x6418('0x27')](respondWithFilteredResult(_0x3a0711,_0x538859,'getVoiceQueuesReport'))['catch'](handleError(_0x3a0711,null,'getVoiceQueuesReport'));};
\ No newline at end of file
index 75e6576..22544b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8a5=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove'];(function(_0x2a8489,_0x3732e6){var _0x431556=function(_0x4ef7e6){while(--_0x4ef7e6){_0x2a8489['push'](_0x2a8489['shift']());}};_0x431556(++_0x3732e6);}(_0xc8a5,0x111));var _0x5c8a=function(_0x2d69b4,_0x11503a){_0x2d69b4=_0x2d69b4-0x0;var _0x52300c=_0xc8a5[_0x2d69b4];return _0x52300c;};'use strict';var EventEmitter=require(_0x5c8a('0x0'));var VoiceQueueReport=require(_0x5c8a('0x1'))['db'][_0x5c8a('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x5c8a('0x3')](0x0);var events={'afterCreate':_0x5c8a('0x4'),'afterUpdate':_0x5c8a('0x5'),'afterDestroy':_0x5c8a('0x6')};function emitEvent(_0x348e8c){return function(_0x235560,_0x558438,_0x9cd17d){VoiceQueueReportEvents['emit'](_0x348e8c+':'+_0x235560['id'],_0x235560);VoiceQueueReportEvents['emit'](_0x348e8c,_0x235560);_0x9cd17d(null);};}for(var e in events){if(events[_0x5c8a('0x7')](e)){var event=events[e];VoiceQueueReport[_0x5c8a('0x8')](e,emitEvent(event));}}module[_0x5c8a('0x9')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0x25de=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x25de,0x188));var _0xe25d=function(_0x44039a,_0x2ac8a8){_0x44039a=_0x44039a-0x0;var _0x525de5=_0x25de[_0x44039a];return _0x525de5;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xe25d('0x0'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xe25d('0x1')](0x0);var events={'afterCreate':_0xe25d('0x2'),'afterUpdate':_0xe25d('0x3'),'afterDestroy':_0xe25d('0x4')};function emitEvent(_0x33bd10){return function(_0x41bff6,_0x8a63d8,_0x20006b){VoiceQueueReportEvents['emit'](_0x33bd10+':'+_0x41bff6['id'],_0x41bff6);VoiceQueueReportEvents[_0xe25d('0x5')](_0x33bd10,_0x41bff6);_0x20006b(null);};}for(var e in events){if(events[_0xe25d('0x6')](e)){var event=events[e];VoiceQueueReport[_0xe25d('0x7')](e,emitEvent(event));}}module[_0xe25d('0x8')]=VoiceQueueReportEvents;
\ No newline at end of file
index cef7279..aed1581 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc66=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','uniqueid','calleridnum','lodash','util'];(function(_0x51be7f,_0xd159f3){var _0x58f88c=function(_0x29c5d7){while(--_0x29c5d7){_0x51be7f['push'](_0x51be7f['shift']());}};_0x58f88c(++_0xd159f3);}(_0xfc66,0x1a2));var _0x6fc6=function(_0x326a5a,_0x5790d4){_0x326a5a=_0x326a5a-0x0;var _0x361c20=_0xfc66[_0x326a5a];return _0x361c20;};'use strict';var _=require(_0x6fc6('0x0'));var util=require(_0x6fc6('0x1'));var logger=require(_0x6fc6('0x2'))(_0x6fc6('0x3'));var moment=require(_0x6fc6('0x4'));var BPromise=require('bluebird');var rp=require(_0x6fc6('0x5'));var fs=require('fs');var path=require(_0x6fc6('0x6'));var rimraf=require(_0x6fc6('0x7'));var config=require(_0x6fc6('0x8'));var attributes=require(_0x6fc6('0x9'));module['exports']=function(_0x2ee01e,_0x3fc985){return _0x2ee01e[_0x6fc6('0xa')](_0x6fc6('0xb'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x6fc6('0xc')]},{'fields':[_0x6fc6('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3f50=['./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4c19d9,_0x3ae606){var _0x2b7a5e=function(_0x38c17c){while(--_0x38c17c){_0x4c19d9['push'](_0x4c19d9['shift']());}};_0x2b7a5e(++_0x3ae606);}(_0x3f50,0x7e));var _0x03f5=function(_0x45c273,_0x301844){_0x45c273=_0x45c273-0x0;var _0x1622d6=_0x3f50[_0x45c273];return _0x1622d6;};'use strict';var _=require(_0x03f5('0x0'));var util=require(_0x03f5('0x1'));var logger=require(_0x03f5('0x2'))(_0x03f5('0x3'));var moment=require(_0x03f5('0x4'));var BPromise=require(_0x03f5('0x5'));var rp=require(_0x03f5('0x6'));var fs=require('fs');var path=require(_0x03f5('0x7'));var rimraf=require(_0x03f5('0x8'));var config=require(_0x03f5('0x9'));var attributes=require(_0x03f5('0xa'));module[_0x03f5('0xb')]=function(_0x497d53,_0x3366e2){return _0x497d53[_0x03f5('0xc')](_0x03f5('0xd'),attributes,{'tableName':_0x03f5('0xe'),'paranoid':![],'indexes':[{'fields':[_0x03f5('0xf')]},{'fields':[_0x03f5('0x10')]}],'timestamps':!![]});};
\ No newline at end of file
index b5ff0c8..6f44042 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc253=['stringify','error','code','message','info','result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','map','include','model','attributes','catch','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x34efa5,_0x5bcf05){var _0x4a4afe=function(_0x1ef4d0){while(--_0x1ef4d0){_0x34efa5['push'](_0x34efa5['shift']());}};_0x4a4afe(++_0x5bcf05);}(_0xc253,0x12b));var _0x3c25=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xc253[_0x75f869];return _0x10af8b;};'use strict';var _=require(_0x3c25('0x0'));var util=require(_0x3c25('0x1'));var moment=require(_0x3c25('0x2'));var BPromise=require(_0x3c25('0x3'));var rs=require(_0x3c25('0x4'));var fs=require('fs');var Redis=require(_0x3c25('0x5'));var db=require(_0x3c25('0x6'))['db'];var utils=require(_0x3c25('0x7'));var logger=require(_0x3c25('0x8'))(_0x3c25('0x9'));var config=require(_0x3c25('0xa'));var jayson=require(_0x3c25('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0x3c25('0xc')]=_[_0x3c25('0xd')](config['redis'],{'host':_0x3c25('0xe'),'port':0x18eb});var socket=require(_0x3c25('0xf'))(new Redis(config[_0x3c25('0xc')]));require('./voiceQueueReport.socket')[_0x3c25('0x10')](socket);function respondWithRpcPromise(_0x46d50d,_0x3ed962,_0x1cb4a1){return new BPromise(function(_0x1c5d71,_0x2e9cd3){return client[_0x3c25('0x11')](_0x46d50d,_0x1cb4a1)[_0x3c25('0x12')](function(_0x4bcf98){logger['info'](_0x3c25('0x13'),_0x3ed962,_0x3c25('0x14'));logger[_0x3c25('0x15')](_0x3c25('0x16'),_0x3ed962,'request\x20sent',JSON[_0x3c25('0x17')](_0x4bcf98));if(_0x4bcf98[_0x3c25('0x18')]){if(_0x4bcf98['error'][_0x3c25('0x19')]===0x1f4){logger['error'](_0x3c25('0x13'),_0x3ed962,_0x4bcf98['error'][_0x3c25('0x1a')]);return _0x2e9cd3(_0x4bcf98[_0x3c25('0x18')][_0x3c25('0x1a')]);}logger[_0x3c25('0x18')](_0x3c25('0x13'),_0x3ed962,_0x4bcf98[_0x3c25('0x18')][_0x3c25('0x1a')]);return _0x1c5d71(_0x4bcf98[_0x3c25('0x18')]['message']);}else{logger[_0x3c25('0x1b')]('VoiceQueueReport,\x20%s,\x20%s',_0x3ed962,_0x3c25('0x14'));_0x1c5d71(_0x4bcf98[_0x3c25('0x1c')][_0x3c25('0x1a')]);}})['catch'](function(_0x579630){logger[_0x3c25('0x18')](_0x3c25('0x13'),_0x3ed962,_0x579630);_0x2e9cd3(_0x579630);});});}exports[_0x3c25('0x1d')]=function(_0x36ab73){var _0x53e79a=this;return new Promise(function(_0x5e1a8e,_0x2cd0f1){return db[_0x3c25('0x1e')][_0x3c25('0x1f')]({'raw':_0x36ab73[_0x3c25('0x20')]?_0x36ab73[_0x3c25('0x20')][_0x3c25('0x21')]===undefined?!![]:![]:!![],'where':_0x36ab73[_0x3c25('0x20')]?_0x36ab73[_0x3c25('0x20')][_0x3c25('0x22')]||null:null,'attributes':_0x36ab73[_0x3c25('0x20')]?_0x36ab73[_0x3c25('0x20')]['attributes']||null:null,'limit':_0x36ab73[_0x3c25('0x20')]?_0x36ab73[_0x3c25('0x20')]['limit']||null:null,'include':_0x36ab73['options']?_0x36ab73[_0x3c25('0x20')]['include']?_[_0x3c25('0x23')](_0x36ab73['options'][_0x3c25('0x24')],function(_0x1f2ded){return{'model':db[_0x1f2ded[_0x3c25('0x25')]],'as':_0x1f2ded['as'],'attributes':_0x1f2ded[_0x3c25('0x26')],'include':_0x1f2ded[_0x3c25('0x24')]?_[_0x3c25('0x23')](_0x1f2ded[_0x3c25('0x24')],function(_0x1cc6fe){return{'model':db[_0x1cc6fe[_0x3c25('0x25')]],'as':_0x1cc6fe['as'],'attributes':_0x1cc6fe[_0x3c25('0x26')],'include':_0x1cc6fe[_0x3c25('0x24')]?_['map'](_0x1cc6fe[_0x3c25('0x24')],function(_0x1325da){return{'model':db[_0x1325da[_0x3c25('0x25')]],'as':_0x1325da['as'],'attributes':_0x1325da[_0x3c25('0x26')]};}):[]};}):[]};}):[]:[]})[_0x3c25('0x12')](function(_0x1444cb){logger['info'](_0x3c25('0x1d'),_0x36ab73);logger[_0x3c25('0x15')](_0x3c25('0x1d'),_0x36ab73,JSON[_0x3c25('0x17')](_0x1444cb));_0x5e1a8e(_0x1444cb);})[_0x3c25('0x27')](function(_0x22094e){logger[_0x3c25('0x18')](_0x3c25('0x1d'),_0x22094e[_0x3c25('0x1a')],_0x36ab73);_0x2cd0f1(_0x53e79a[_0x3c25('0x18')](0x1f4,_0x22094e[_0x3c25('0x1a')]));});});};exports[_0x3c25('0x28')]=function(_0x4f27d4){var _0x2cd49b=this;return new Promise(function(_0x3f2625,_0x3bba69){return db[_0x3c25('0x1e')][_0x3c25('0x29')](_0x4f27d4[_0x3c25('0x2a')],{'raw':_0x4f27d4[_0x3c25('0x20')]?_0x4f27d4[_0x3c25('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x3c25('0x12')](function(_0x3e4ee6){logger['info'](_0x3c25('0x28'),_0x4f27d4);logger[_0x3c25('0x15')](_0x3c25('0x28'),_0x4f27d4,JSON[_0x3c25('0x17')](_0x3e4ee6));_0x3f2625(_0x3e4ee6);})['catch'](function(_0x283648){logger[_0x3c25('0x18')](_0x3c25('0x28'),_0x283648['message'],_0x4f27d4);_0x3bba69(_0x2cd49b[_0x3c25('0x18')](0x1f4,_0x283648[_0x3c25('0x1a')]));});});};exports[_0x3c25('0x2b')]=function(_0x36f9e5){var _0x3ba774=this;return new Promise(function(_0x46aadb,_0x47ed9a){return db[_0x3c25('0x1e')][_0x3c25('0x2c')](_0x36f9e5[_0x3c25('0x2a')],{'raw':_0x36f9e5[_0x3c25('0x20')]?_0x36f9e5['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36f9e5[_0x3c25('0x20')]?_0x36f9e5['options']['where']||null:null,'attributes':_0x36f9e5[_0x3c25('0x20')]?_0x36f9e5['options'][_0x3c25('0x26')]||null:null,'limit':_0x36f9e5[_0x3c25('0x20')]?_0x36f9e5[_0x3c25('0x20')][_0x3c25('0x2d')]||null:null})[_0x3c25('0x12')](function(_0x2f65c3){logger[_0x3c25('0x1b')](_0x3c25('0x2b'),_0x36f9e5);logger[_0x3c25('0x15')](_0x3c25('0x2b'),_0x36f9e5,JSON[_0x3c25('0x17')](_0x2f65c3));_0x46aadb(_0x2f65c3);})[_0x3c25('0x27')](function(_0x45ce0b){logger[_0x3c25('0x18')](_0x3c25('0x2b'),_0x45ce0b[_0x3c25('0x1a')],_0x36f9e5);_0x47ed9a(_0x3ba774['error'](0x1f4,_0x45ce0b[_0x3c25('0x1a')]));});});};
\ No newline at end of file
+var _0x200f=['where','limit','include','model','attributes','catch','CreateVoiceQueueReport','VoiceQueueReport','create','body','debug','UpdateVoiceQueueReport','update','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','defaults','localhost','socket.io-emitter','redis','./voiceQueueReport.socket','register','request','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetVoiceQueueReport','findAll','options','raw'];(function(_0x38a3d6,_0x52e305){var _0x3768d7=function(_0x1af8a9){while(--_0x1af8a9){_0x38a3d6['push'](_0x38a3d6['shift']());}};_0x3768d7(++_0x52e305);}(_0x200f,0xdf));var _0xf200=function(_0x405fe8,_0xa55e2f){_0x405fe8=_0x405fe8-0x0;var _0x50e490=_0x200f[_0x405fe8];return _0x50e490;};'use strict';var _=require(_0xf200('0x0'));var util=require('util');var moment=require(_0xf200('0x1'));var BPromise=require('bluebird');var rs=require(_0xf200('0x2'));var fs=require('fs');var Redis=require(_0xf200('0x3'));var db=require(_0xf200('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf200('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf200('0x6')][_0xf200('0x7')]({'port':0x232a});config['redis']=_[_0xf200('0x8')](config['redis'],{'host':_0xf200('0x9'),'port':0x18eb});var socket=require(_0xf200('0xa'))(new Redis(config[_0xf200('0xb')]));require(_0xf200('0xc'))[_0xf200('0xd')](socket);function respondWithRpcPromise(_0x54d2ff,_0x3ffad4,_0x48c654){return new BPromise(function(_0x487c50,_0x54b27f){return client[_0xf200('0xe')](_0x54d2ff,_0x48c654)[_0xf200('0xf')](function(_0x2227a4){logger['info'](_0xf200('0x10'),_0x3ffad4,_0xf200('0x11'));logger['debug'](_0xf200('0x12'),_0x3ffad4,'request\x20sent',JSON[_0xf200('0x13')](_0x2227a4));if(_0x2227a4[_0xf200('0x14')]){if(_0x2227a4[_0xf200('0x14')][_0xf200('0x15')]===0x1f4){logger[_0xf200('0x14')](_0xf200('0x10'),_0x3ffad4,_0x2227a4[_0xf200('0x14')][_0xf200('0x16')]);return _0x54b27f(_0x2227a4[_0xf200('0x14')]['message']);}logger[_0xf200('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x3ffad4,_0x2227a4[_0xf200('0x14')][_0xf200('0x16')]);return _0x487c50(_0x2227a4[_0xf200('0x14')]['message']);}else{logger[_0xf200('0x17')](_0xf200('0x10'),_0x3ffad4,_0xf200('0x11'));_0x487c50(_0x2227a4[_0xf200('0x18')][_0xf200('0x16')]);}})['catch'](function(_0xe7298b){logger[_0xf200('0x14')](_0xf200('0x10'),_0x3ffad4,_0xe7298b);_0x54b27f(_0xe7298b);});});}exports[_0xf200('0x19')]=function(_0x18abd9){var _0x2c07a5=this;return new Promise(function(_0x411ad0,_0x3e443d){return db['VoiceQueueReport'][_0xf200('0x1a')]({'raw':_0x18abd9[_0xf200('0x1b')]?_0x18abd9[_0xf200('0x1b')][_0xf200('0x1c')]===undefined?!![]:![]:!![],'where':_0x18abd9[_0xf200('0x1b')]?_0x18abd9[_0xf200('0x1b')][_0xf200('0x1d')]||null:null,'attributes':_0x18abd9[_0xf200('0x1b')]?_0x18abd9[_0xf200('0x1b')]['attributes']||null:null,'limit':_0x18abd9[_0xf200('0x1b')]?_0x18abd9[_0xf200('0x1b')][_0xf200('0x1e')]||null:null,'include':_0x18abd9[_0xf200('0x1b')]?_0x18abd9[_0xf200('0x1b')][_0xf200('0x1f')]?_['map'](_0x18abd9['options'][_0xf200('0x1f')],function(_0x819c53){return{'model':db[_0x819c53[_0xf200('0x20')]],'as':_0x819c53['as'],'attributes':_0x819c53[_0xf200('0x21')],'include':_0x819c53[_0xf200('0x1f')]?_['map'](_0x819c53[_0xf200('0x1f')],function(_0x2baad0){return{'model':db[_0x2baad0[_0xf200('0x20')]],'as':_0x2baad0['as'],'attributes':_0x2baad0[_0xf200('0x21')],'include':_0x2baad0[_0xf200('0x1f')]?_['map'](_0x2baad0[_0xf200('0x1f')],function(_0x2be6d0){return{'model':db[_0x2be6d0[_0xf200('0x20')]],'as':_0x2be6d0['as'],'attributes':_0x2be6d0[_0xf200('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf200('0xf')](function(_0xbea015){logger[_0xf200('0x17')](_0xf200('0x19'),_0x18abd9);logger['debug'](_0xf200('0x19'),_0x18abd9,JSON[_0xf200('0x13')](_0xbea015));_0x411ad0(_0xbea015);})[_0xf200('0x22')](function(_0x576f1){logger['error']('GetVoiceQueueReport',_0x576f1['message'],_0x18abd9);_0x3e443d(_0x2c07a5[_0xf200('0x14')](0x1f4,_0x576f1[_0xf200('0x16')]));});});};exports[_0xf200('0x23')]=function(_0x2e4ece){var _0x3a0013=this;return new Promise(function(_0x535649,_0x334675){return db[_0xf200('0x24')][_0xf200('0x25')](_0x2e4ece[_0xf200('0x26')],{'raw':_0x2e4ece[_0xf200('0x1b')]?_0x2e4ece[_0xf200('0x1b')][_0xf200('0x1c')]===undefined?!![]:![]:!![]})[_0xf200('0xf')](function(_0x59bc6c){logger[_0xf200('0x17')]('CreateVoiceQueueReport',_0x2e4ece);logger[_0xf200('0x27')]('CreateVoiceQueueReport',_0x2e4ece,JSON[_0xf200('0x13')](_0x59bc6c));_0x535649(_0x59bc6c);})['catch'](function(_0x119394){logger['error'](_0xf200('0x23'),_0x119394[_0xf200('0x16')],_0x2e4ece);_0x334675(_0x3a0013[_0xf200('0x14')](0x1f4,_0x119394[_0xf200('0x16')]));});});};exports[_0xf200('0x28')]=function(_0x29817a){var _0x394f2c=this;return new Promise(function(_0x298cf0,_0x2d07db){return db[_0xf200('0x24')][_0xf200('0x29')](_0x29817a['body'],{'raw':_0x29817a[_0xf200('0x1b')]?_0x29817a[_0xf200('0x1b')][_0xf200('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29817a[_0xf200('0x1b')]?_0x29817a['options'][_0xf200('0x1d')]||null:null,'attributes':_0x29817a['options']?_0x29817a[_0xf200('0x1b')]['attributes']||null:null,'limit':_0x29817a[_0xf200('0x1b')]?_0x29817a[_0xf200('0x1b')][_0xf200('0x1e')]||null:null})[_0xf200('0xf')](function(_0x408395){logger[_0xf200('0x17')]('UpdateVoiceQueueReport',_0x29817a);logger['debug'](_0xf200('0x28'),_0x29817a,JSON['stringify'](_0x408395));_0x298cf0(_0x408395);})['catch'](function(_0x3d98ee){logger['error'](_0xf200('0x28'),_0x3d98ee[_0xf200('0x16')],_0x29817a);_0x2d07db(_0x394f2c[_0xf200('0x14')](0x1f4,_0x3d98ee[_0xf200('0x16')]));});});};
\ No newline at end of file
index 62db384..d7f45d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ed2=['./voiceQueueReport.events','remove','update','removeListener','register','length'];(function(_0x21c103,_0x1f8e42){var _0xc23fff=function(_0x5b5067){while(--_0x5b5067){_0x21c103['push'](_0x21c103['shift']());}};_0xc23fff(++_0x1f8e42);}(_0x5ed2,0x114));var _0x25ed=function(_0x52ac27,_0x8776c8){_0x52ac27=_0x52ac27-0x0;var _0x40732e=_0x5ed2[_0x52ac27];return _0x40732e;};'use strict';var VoiceQueueReportEvents=require(_0x25ed('0x0'));var events=['save',_0x25ed('0x1'),_0x25ed('0x2')];function createListener(_0x5330f1,_0x468494){return function(_0xb12505){_0x468494['emit'](_0x5330f1,_0xb12505);};}function removeListener(_0x1ce8d8,_0x2e6fb6){return function(){VoiceQueueReportEvents[_0x25ed('0x3')](_0x1ce8d8,_0x2e6fb6);};}exports[_0x25ed('0x4')]=function(_0x509ca3){for(var _0x3650fd=0x0,_0x3c499f=events[_0x25ed('0x5')];_0x3650fd<_0x3c499f;_0x3650fd++){var _0x8f0fac=events[_0x3650fd];var _0x5921bb=createListener('voiceQueueReport:'+_0x8f0fac,_0x509ca3);VoiceQueueReportEvents['on'](_0x8f0fac,_0x5921bb);}};
\ No newline at end of file
+var _0x7e81=['update','emit','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove'];(function(_0x1eecdf,_0x5cbd37){var _0x39a960=function(_0x222ebb){while(--_0x222ebb){_0x1eecdf['push'](_0x1eecdf['shift']());}};_0x39a960(++_0x5cbd37);}(_0x7e81,0xc5));var _0x17e8=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x7e81[_0x491a7f];return _0x3d8f44;};'use strict';var VoiceQueueReportEvents=require(_0x17e8('0x0'));var events=[_0x17e8('0x1'),_0x17e8('0x2'),_0x17e8('0x3')];function createListener(_0x5272db,_0x789de0){return function(_0x150fc3){_0x789de0[_0x17e8('0x4')](_0x5272db,_0x150fc3);};}function removeListener(_0x766c9e,_0x364a73){return function(){VoiceQueueReportEvents['removeListener'](_0x766c9e,_0x364a73);};}exports[_0x17e8('0x5')]=function(_0x2b4f2f){for(var _0x382bb2=0x0,_0x176238=events[_0x17e8('0x6')];_0x382bb2<_0x176238;_0x382bb2++){var _0x574402=events[_0x382bb2];var _0x54ee7e=createListener(_0x17e8('0x7')+_0x574402,_0x2b4f2f);VoiceQueueReportEvents['on'](_0x574402,_0x54ee7e);}};
\ No newline at end of file
index f87092d..1d1e463 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ec2=['index','/:id','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated'];(function(_0x3b9cdd,_0x5d2313){var _0x28051d=function(_0x342633){while(--_0x342633){_0x3b9cdd['push'](_0x3b9cdd['shift']());}};_0x28051d(++_0x5d2313);}(_0x0ec2,0x72));var _0x20ec=function(_0x8bb4c1,_0x2d6e53){_0x8bb4c1=_0x8bb4c1-0x0;var _0x67a6e1=_0x0ec2[_0x8bb4c1];return _0x67a6e1;};'use strict';var multer=require(_0x20ec('0x0'));var util=require('util');var path=require(_0x20ec('0x1'));var timeout=require(_0x20ec('0x2'));var express=require(_0x20ec('0x3'));var router=express[_0x20ec('0x4')]();var fs_extra=require(_0x20ec('0x5'));var auth=require(_0x20ec('0x6'));var interaction=require(_0x20ec('0x7'));var config=require(_0x20ec('0x8'));var controller=require(_0x20ec('0x9'));router[_0x20ec('0xa')]('/',auth[_0x20ec('0xb')](),controller[_0x20ec('0xc')]);router[_0x20ec('0xa')](_0x20ec('0xd'),auth[_0x20ec('0xb')](),controller['show']);router[_0x20ec('0xe')]('/',auth['isAuthenticated'](),controller[_0x20ec('0xf')]);router[_0x20ec('0x10')](_0x20ec('0xd'),auth[_0x20ec('0xb')](),controller[_0x20ec('0x11')]);router[_0x20ec('0x12')](_0x20ec('0xd'),auth[_0x20ec('0xb')](),controller[_0x20ec('0x13')]);module[_0x20ec('0x14')]=router;
\ No newline at end of file
+var _0x3140=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','post','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra'];(function(_0x2fdee1,_0x466858){var _0x2c5533=function(_0x1f34de){while(--_0x1f34de){_0x2fdee1['push'](_0x2fdee1['shift']());}};_0x2c5533(++_0x466858);}(_0x3140,0xaf));var _0x0314=function(_0xc77819,_0x139fdc){_0xc77819=_0xc77819-0x0;var _0x1c9434=_0x3140[_0xc77819];return _0x1c9434;};'use strict';var multer=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var path=require(_0x0314('0x2'));var timeout=require(_0x0314('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0314('0x4'));var auth=require(_0x0314('0x5'));var interaction=require(_0x0314('0x6'));var config=require(_0x0314('0x7'));var controller=require(_0x0314('0x8'));router[_0x0314('0x9')]('/',auth[_0x0314('0xa')](),controller[_0x0314('0xb')]);router[_0x0314('0x9')](_0x0314('0xc'),auth[_0x0314('0xa')](),controller['show']);router[_0x0314('0xd')]('/',auth[_0x0314('0xa')](),controller['create']);router['put'](_0x0314('0xc'),auth['isAuthenticated'](),controller[_0x0314('0xe')]);router[_0x0314('0xf')](_0x0314('0xc'),auth[_0x0314('0xa')](),controller[_0x0314('0x10')]);module[_0x0314('0x11')]=router;
\ No newline at end of file
index d03080b..7955320 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06f8=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','exports'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x06f8,0x178));var _0x806f=function(_0x214c21,_0x545f27){_0x214c21=_0x214c21-0x0;var _0x34b2cf=_0x06f8[_0x214c21];return _0x34b2cf;};'use strict';var Sequelize=require(_0x806f('0x0'));var moment=require('moment');module[_0x806f('0x1')]={'time':{'type':Sequelize[_0x806f('0x2')]},'callid':{'type':Sequelize[_0x806f('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x806f('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x806f('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x806f('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x806f('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x806f('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x806f('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x806f('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x806f('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x806f('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x806f('0x3')],'allowNull':![],'defaultValue':moment()[_0x806f('0x4')](_0x806f('0x5'))}};
\ No newline at end of file
+var _0xf8fa=['moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2e3fd5,_0x1586d6){var _0x22843c=function(_0x3ca854){while(--_0x3ca854){_0x2e3fd5['push'](_0x2e3fd5['shift']());}};_0x22843c(++_0x1586d6);}(_0xf8fa,0x13e));var _0xaf8f=function(_0x1a422a,_0x3468fd){_0x1a422a=_0x1a422a-0x0;var _0x4dcab4=_0xf8fa[_0x1a422a];return _0x4dcab4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xaf8f('0x0'));module[_0xaf8f('0x1')]={'time':{'type':Sequelize[_0xaf8f('0x2')]},'callid':{'type':Sequelize[_0xaf8f('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xaf8f('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xaf8f('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xaf8f('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xaf8f('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xaf8f('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xaf8f('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xaf8f('0x3')],'allowNull':![],'defaultValue':moment()[_0xaf8f('0x4')](_0xaf8f('0x5'))}};
\ No newline at end of file
index 75e22ce..03a99fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x189e=['lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','update','then','name','send','index','VoiceQueuesLog','type','query','filters','intersection','model','attributes','fields','length','order','sort','pick','filter','where','map','VIRTUAL','merge','count','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x189e,0x1ec));var _0xe189=function(_0xc3eb16,_0x73d3f1){_0xc3eb16=_0xc3eb16-0x0;var _0x30cf6a=_0x189e[_0xc3eb16];return _0x30cf6a;};'use strict';var emlformat=require(_0xe189('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe189('0x1'));var jsonpatch=require(_0xe189('0x2'));var rp=require(_0xe189('0x3'));var moment=require(_0xe189('0x4'));var BPromise=require(_0xe189('0x5'));var Mustache=require('mustache');var util=require(_0xe189('0x6'));var path=require(_0xe189('0x7'));var sox=require(_0xe189('0x8'));var csv=require(_0xe189('0x9'));var ejs=require(_0xe189('0xa'));var fs=require('fs');var fs_extra=require(_0xe189('0xb'));var _=require(_0xe189('0xc'));var squel=require(_0xe189('0xd'));var crypto=require(_0xe189('0xe'));var jsforce=require(_0xe189('0xf'));var deskjs=require(_0xe189('0x10'));var toCsv=require(_0xe189('0x9'));var querystring=require('querystring');var Papa=require(_0xe189('0x11'));var Redis=require(_0xe189('0x12'));var authService=require(_0xe189('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe189('0x14'));var logger=require(_0xe189('0x15'))(_0xe189('0x16'));var utils=require(_0xe189('0x17'));var config=require(_0xe189('0x18'));var licenseUtil=require(_0xe189('0x19'));var db=require(_0xe189('0x1a'))['db'];function respondWithStatusCode(_0x5f3d00,_0x22512e){_0x22512e=_0x22512e||0xcc;return function(_0x58770a){if(_0x58770a){return _0x5f3d00[_0xe189('0x1b')](_0x22512e);}return _0x5f3d00[_0xe189('0x1c')](_0x22512e)[_0xe189('0x1d')]();};}function respondWithResult(_0x3f1208,_0xa4195c){_0xa4195c=_0xa4195c||0xc8;return function(_0x333606){if(_0x333606){return _0x3f1208[_0xe189('0x1c')](_0xa4195c)[_0xe189('0x1e')](_0x333606);}};}function respondWithFilteredResult(_0x259523,_0x3ec17c){return function(_0x1fbcd5){if(_0x1fbcd5){var _0x31b099=typeof _0x3ec17c[_0xe189('0x1f')]===_0xe189('0x20')&&typeof _0x3ec17c[_0xe189('0x21')]===_0xe189('0x20');var _0x5933c7=_0x1fbcd5['count'];var _0x37c50d=_0x31b099?0x0:_0x3ec17c[_0xe189('0x1f')];var _0x145b10=_0x31b099?_0x1fbcd5['count']:_0x3ec17c[_0xe189('0x1f')]+_0x3ec17c['limit'];var _0x5f4195;if(_0x145b10>=_0x5933c7){_0x145b10=_0x5933c7;_0x5f4195=0xc8;}else{_0x5f4195=0xce;}_0x259523['status'](_0x5f4195);return _0x259523[_0xe189('0x22')](_0xe189('0x23'),_0x37c50d+'-'+_0x145b10+'/'+_0x5933c7)[_0xe189('0x1e')](_0x1fbcd5);}return null;};}function patchUpdates(_0xc4bcfe){return function(_0x1f11a2){try{jsonpatch[_0xe189('0x24')](_0x1f11a2,_0xc4bcfe,!![]);}catch(_0x125d2d){return BPromise['reject'](_0x125d2d);}return _0x1f11a2['save']();};}function saveUpdates(_0x3fbfa6,_0x42915d){return function(_0x2e911e){if(_0x2e911e){return _0x2e911e[_0xe189('0x25')](_0x3fbfa6)['then'](function(_0x20fe93){return _0x20fe93;});}return null;};}function removeEntity(_0x21502d,_0x392c29){return function(_0x4731f5){if(_0x4731f5){return _0x4731f5['destroy']()[_0xe189('0x26')](function(){_0x21502d[_0xe189('0x1c')](0xcc)[_0xe189('0x1d')]();});}};}function handleEntityNotFound(_0xfd6cb0,_0x75ab58){return function(_0x34d75e){if(!_0x34d75e){_0xfd6cb0[_0xe189('0x1b')](0x194);}return _0x34d75e;};}function handleError(_0x112921,_0x306f0e){_0x306f0e=_0x306f0e||0x1f4;return function(_0x589ecc){logger['error'](_0x589ecc['stack']);if(_0x589ecc[_0xe189('0x27')]){delete _0x589ecc['name'];}_0x112921[_0xe189('0x1c')](_0x306f0e)[_0xe189('0x28')](_0x589ecc);};}exports[_0xe189('0x29')]=function(_0x3ab9d6,_0x4ae31d){var _0x44f669={},_0x89c808={},_0x43daa5={'count':0x0,'rows':[]};var _0x4eee4f=_['map'](db[_0xe189('0x2a')]['rawAttributes'],function(_0x18be24){return{'name':_0x18be24['fieldName'],'type':_0x18be24[_0xe189('0x2b')]['key']};});_0x89c808['model']=_['map'](_0x4eee4f,_0xe189('0x27'));_0x89c808[_0xe189('0x2c')]=_['keys'](_0x3ab9d6[_0xe189('0x2c')]);_0x89c808[_0xe189('0x2d')]=_[_0xe189('0x2e')](_0x89c808[_0xe189('0x2f')],_0x89c808['query']);_0x44f669[_0xe189('0x30')]=_[_0xe189('0x2e')](_0x89c808['model'],qs[_0xe189('0x31')](_0x3ab9d6[_0xe189('0x2c')][_0xe189('0x31')]));_0x44f669[_0xe189('0x30')]=_0x44f669[_0xe189('0x30')][_0xe189('0x32')]?_0x44f669[_0xe189('0x30')]:_0x89c808[_0xe189('0x2f')];if(!_0x3ab9d6[_0xe189('0x2c')]['hasOwnProperty']('nolimit')){_0x44f669[_0xe189('0x21')]=qs[_0xe189('0x21')](_0x3ab9d6[_0xe189('0x2c')][_0xe189('0x21')]);_0x44f669[_0xe189('0x1f')]=qs['offset'](_0x3ab9d6['query'][_0xe189('0x1f')]);}_0x44f669[_0xe189('0x33')]=qs[_0xe189('0x34')](_0x3ab9d6[_0xe189('0x2c')]['sort']);_0x44f669['where']=qs['filters'](_[_0xe189('0x35')](_0x3ab9d6[_0xe189('0x2c')],_0x89c808['filters']),_0x4eee4f);if(_0x3ab9d6[_0xe189('0x2c')][_0xe189('0x36')]){_0x44f669['where']=_['merge'](_0x44f669[_0xe189('0x37')],{'$or':_[_0xe189('0x38')](_0x4eee4f,function(_0x4f62c6){if(_0x4f62c6['type']!==_0xe189('0x39')){var _0xb99b42={};_0xb99b42[_0x4f62c6[_0xe189('0x27')]]={'$like':'%'+_0x3ab9d6[_0xe189('0x2c')][_0xe189('0x36')]+'%'};return _0xb99b42;}})});}_0x44f669=_[_0xe189('0x3a')]({},_0x44f669,_0x3ab9d6['options']);var _0x47c57b={'where':_0x44f669[_0xe189('0x37')]};return db['VoiceQueuesLog'][_0xe189('0x3b')](_0x47c57b)['then'](function(_0x28550e){_0x43daa5[_0xe189('0x3b')]=_0x28550e;if(_0x3ab9d6['query'][_0xe189('0x3c')]){_0x44f669[_0xe189('0x3d')]=[{'all':!![]}];}return db[_0xe189('0x2a')][_0xe189('0x3e')](_0x44f669);})[_0xe189('0x26')](function(_0x467243){_0x43daa5[_0xe189('0x3f')]=_0x467243;return _0x43daa5;})[_0xe189('0x26')](respondWithFilteredResult(_0x4ae31d,_0x44f669))[_0xe189('0x40')](handleError(_0x4ae31d,null));};exports[_0xe189('0x41')]=function(_0x5895c8,_0x49fe1d){var _0x141618={'raw':!![],'where':{'id':_0x5895c8[_0xe189('0x42')]['id']}},_0x11db8d={};_0x11db8d[_0xe189('0x2f')]=_[_0xe189('0x43')](db['VoiceQueuesLog'][_0xe189('0x44')]);_0x11db8d[_0xe189('0x2c')]=_[_0xe189('0x43')](_0x5895c8['query']);_0x11db8d[_0xe189('0x2d')]=_[_0xe189('0x2e')](_0x11db8d[_0xe189('0x2f')],_0x11db8d[_0xe189('0x2c')]);_0x141618[_0xe189('0x30')]=_[_0xe189('0x2e')](_0x11db8d[_0xe189('0x2f')],qs['fields'](_0x5895c8['query'][_0xe189('0x31')]));_0x141618[_0xe189('0x30')]=_0x141618[_0xe189('0x30')][_0xe189('0x32')]?_0x141618[_0xe189('0x30')]:_0x11db8d[_0xe189('0x2f')];if(_0x5895c8['query'][_0xe189('0x3c')]){_0x141618[_0xe189('0x3d')]=[{'all':!![]}];}_0x141618=_[_0xe189('0x3a')]({},_0x141618,_0x5895c8['options']);return db['VoiceQueuesLog'][_0xe189('0x45')](_0x141618)['then'](handleEntityNotFound(_0x49fe1d,null))[_0xe189('0x26')](respondWithResult(_0x49fe1d,null))[_0xe189('0x40')](handleError(_0x49fe1d,null));};exports['create']=function(_0x125550,_0x3c1cf4){return db[_0xe189('0x2a')]['create'](_0x125550[_0xe189('0x46')],{})['then'](respondWithResult(_0x3c1cf4,0xc9))[_0xe189('0x40')](handleError(_0x3c1cf4,null));};exports[_0xe189('0x25')]=function(_0x4d3b0c,_0x5e889c){if(_0x4d3b0c[_0xe189('0x46')]['id']){delete _0x4d3b0c['body']['id'];}return db[_0xe189('0x2a')]['find']({'where':{'id':_0x4d3b0c[_0xe189('0x42')]['id']}})[_0xe189('0x26')](handleEntityNotFound(_0x5e889c,null))[_0xe189('0x26')](saveUpdates(_0x4d3b0c[_0xe189('0x46')],null))[_0xe189('0x26')](respondWithResult(_0x5e889c,null))[_0xe189('0x40')](handleError(_0x5e889c,null));};exports[_0xe189('0x47')]=function(_0x2a52e0,_0x62998){return db[_0xe189('0x2a')]['find']({'where':{'id':_0x2a52e0[_0xe189('0x42')]['id']}})[_0xe189('0x26')](handleEntityNotFound(_0x62998,null))[_0xe189('0x26')](removeEntity(_0x62998,null))['catch'](handleError(_0x62998,null));};
\ No newline at end of file
+var _0x59ef=['type','VIRTUAL','options','includeAll','findAll','rows','catch','show','fields','include','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','VoiceQueuesLog','rawAttributes','key','map','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x136bbb,_0x2ccb28){var _0x40bc15=function(_0x460526){while(--_0x460526){_0x136bbb['push'](_0x136bbb['shift']());}};_0x40bc15(++_0x2ccb28);}(_0x59ef,0xfe));var _0xf59e=function(_0x513644,_0x5a72f8){_0x513644=_0x513644-0x0;var _0x1668f2=_0x59ef[_0x513644];return _0x1668f2;};'use strict';var emlformat=require(_0xf59e('0x0'));var rimraf=require(_0xf59e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf59e('0x2'));var rp=require(_0xf59e('0x3'));var moment=require(_0xf59e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf59e('0x5'));var util=require(_0xf59e('0x6'));var path=require(_0xf59e('0x7'));var sox=require(_0xf59e('0x8'));var csv=require(_0xf59e('0x9'));var ejs=require(_0xf59e('0xa'));var fs=require('fs');var fs_extra=require(_0xf59e('0xb'));var _=require(_0xf59e('0xc'));var squel=require('squel');var crypto=require(_0xf59e('0xd'));var jsforce=require(_0xf59e('0xe'));var deskjs=require(_0xf59e('0xf'));var toCsv=require(_0xf59e('0x9'));var querystring=require(_0xf59e('0x10'));var Papa=require(_0xf59e('0x11'));var Redis=require(_0xf59e('0x12'));var authService=require(_0xf59e('0x13'));var qs=require(_0xf59e('0x14'));var as=require(_0xf59e('0x15'));var hardwareService=require(_0xf59e('0x16'));var logger=require(_0xf59e('0x17'))(_0xf59e('0x18'));var utils=require(_0xf59e('0x19'));var config=require(_0xf59e('0x1a'));var licenseUtil=require(_0xf59e('0x1b'));var db=require(_0xf59e('0x1c'))['db'];function respondWithStatusCode(_0xfe607f,_0x100938){_0x100938=_0x100938||0xcc;return function(_0x5ec97f){if(_0x5ec97f){return _0xfe607f[_0xf59e('0x1d')](_0x100938);}return _0xfe607f[_0xf59e('0x1e')](_0x100938)[_0xf59e('0x1f')]();};}function respondWithResult(_0x25e176,_0x17b5e5){_0x17b5e5=_0x17b5e5||0xc8;return function(_0x47f003){if(_0x47f003){return _0x25e176['status'](_0x17b5e5)[_0xf59e('0x20')](_0x47f003);}};}function respondWithFilteredResult(_0x238de5,_0x173577){return function(_0x1db913){if(_0x1db913){var _0x17541a=typeof _0x173577[_0xf59e('0x21')]==='undefined'&&typeof _0x173577[_0xf59e('0x22')]==='undefined';var _0x33d899=_0x1db913['count'];var _0x19ce51=_0x17541a?0x0:_0x173577[_0xf59e('0x21')];var _0x408ebf=_0x17541a?_0x1db913[_0xf59e('0x23')]:_0x173577[_0xf59e('0x21')]+_0x173577[_0xf59e('0x22')];var _0x299642;if(_0x408ebf>=_0x33d899){_0x408ebf=_0x33d899;_0x299642=0xc8;}else{_0x299642=0xce;}_0x238de5[_0xf59e('0x1e')](_0x299642);return _0x238de5[_0xf59e('0x24')](_0xf59e('0x25'),_0x19ce51+'-'+_0x408ebf+'/'+_0x33d899)['json'](_0x1db913);}return null;};}function patchUpdates(_0x50b360){return function(_0x2a8ac8){try{jsonpatch[_0xf59e('0x26')](_0x2a8ac8,_0x50b360,!![]);}catch(_0x65f1f0){return BPromise[_0xf59e('0x27')](_0x65f1f0);}return _0x2a8ac8[_0xf59e('0x28')]();};}function saveUpdates(_0x4f424c,_0x53744d){return function(_0x27b48e){if(_0x27b48e){return _0x27b48e[_0xf59e('0x29')](_0x4f424c)[_0xf59e('0x2a')](function(_0x46e8e5){return _0x46e8e5;});}return null;};}function removeEntity(_0x4839cb,_0x5aa99b){return function(_0x28c7d8){if(_0x28c7d8){return _0x28c7d8[_0xf59e('0x2b')]()['then'](function(){_0x4839cb['status'](0xcc)[_0xf59e('0x1f')]();});}};}function handleEntityNotFound(_0x2cc100,_0x1e4cda){return function(_0x3fcbee){if(!_0x3fcbee){_0x2cc100['sendStatus'](0x194);}return _0x3fcbee;};}function handleError(_0x4002cc,_0x29e135){_0x29e135=_0x29e135||0x1f4;return function(_0xd241dc){logger['error'](_0xd241dc[_0xf59e('0x2c')]);if(_0xd241dc[_0xf59e('0x2d')]){delete _0xd241dc['name'];}_0x4002cc['status'](_0x29e135)[_0xf59e('0x2e')](_0xd241dc);};}exports[_0xf59e('0x2f')]=function(_0x4ad782,_0x3a75dd){var _0x22ed5f={},_0x1553cf={},_0x1815c0={'count':0x0,'rows':[]};var _0x2046d0=_['map'](db[_0xf59e('0x30')][_0xf59e('0x31')],function(_0x8980fa){return{'name':_0x8980fa['fieldName'],'type':_0x8980fa['type'][_0xf59e('0x32')]};});_0x1553cf['model']=_[_0xf59e('0x33')](_0x2046d0,_0xf59e('0x2d'));_0x1553cf['query']=_[_0xf59e('0x34')](_0x4ad782[_0xf59e('0x35')]);_0x1553cf[_0xf59e('0x36')]=_[_0xf59e('0x37')](_0x1553cf[_0xf59e('0x38')],_0x1553cf['query']);_0x22ed5f['attributes']=_[_0xf59e('0x37')](_0x1553cf[_0xf59e('0x38')],qs['fields'](_0x4ad782[_0xf59e('0x35')]['fields']));_0x22ed5f[_0xf59e('0x39')]=_0x22ed5f[_0xf59e('0x39')][_0xf59e('0x3a')]?_0x22ed5f[_0xf59e('0x39')]:_0x1553cf[_0xf59e('0x38')];if(!_0x4ad782[_0xf59e('0x35')][_0xf59e('0x3b')](_0xf59e('0x3c'))){_0x22ed5f[_0xf59e('0x22')]=qs[_0xf59e('0x22')](_0x4ad782[_0xf59e('0x35')]['limit']);_0x22ed5f[_0xf59e('0x21')]=qs['offset'](_0x4ad782['query'][_0xf59e('0x21')]);}_0x22ed5f['order']=qs[_0xf59e('0x3d')](_0x4ad782[_0xf59e('0x35')][_0xf59e('0x3d')]);_0x22ed5f[_0xf59e('0x3e')]=qs['filters'](_[_0xf59e('0x3f')](_0x4ad782[_0xf59e('0x35')],_0x1553cf[_0xf59e('0x36')]),_0x2046d0);if(_0x4ad782['query'][_0xf59e('0x40')]){_0x22ed5f[_0xf59e('0x3e')]=_[_0xf59e('0x41')](_0x22ed5f[_0xf59e('0x3e')],{'$or':_[_0xf59e('0x33')](_0x2046d0,function(_0x14d2ae){if(_0x14d2ae[_0xf59e('0x42')]!==_0xf59e('0x43')){var _0x5bfaba={};_0x5bfaba[_0x14d2ae[_0xf59e('0x2d')]]={'$like':'%'+_0x4ad782[_0xf59e('0x35')][_0xf59e('0x40')]+'%'};return _0x5bfaba;}})});}_0x22ed5f=_[_0xf59e('0x41')]({},_0x22ed5f,_0x4ad782[_0xf59e('0x44')]);var _0xb94507={'where':_0x22ed5f[_0xf59e('0x3e')]};return db['VoiceQueuesLog']['count'](_0xb94507)[_0xf59e('0x2a')](function(_0x1f4dc4){_0x1815c0['count']=_0x1f4dc4;if(_0x4ad782[_0xf59e('0x35')][_0xf59e('0x45')]){_0x22ed5f['include']=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xf59e('0x46')](_0x22ed5f);})[_0xf59e('0x2a')](function(_0x23ae72){_0x1815c0[_0xf59e('0x47')]=_0x23ae72;return _0x1815c0;})[_0xf59e('0x2a')](respondWithFilteredResult(_0x3a75dd,_0x22ed5f))[_0xf59e('0x48')](handleError(_0x3a75dd,null));};exports[_0xf59e('0x49')]=function(_0x369f42,_0xfe5ea6){var _0x506374={'raw':!![],'where':{'id':_0x369f42['params']['id']}},_0x12463f={};_0x12463f[_0xf59e('0x38')]=_[_0xf59e('0x34')](db[_0xf59e('0x30')][_0xf59e('0x31')]);_0x12463f[_0xf59e('0x35')]=_[_0xf59e('0x34')](_0x369f42[_0xf59e('0x35')]);_0x12463f[_0xf59e('0x36')]=_['intersection'](_0x12463f['model'],_0x12463f[_0xf59e('0x35')]);_0x506374[_0xf59e('0x39')]=_['intersection'](_0x12463f[_0xf59e('0x38')],qs[_0xf59e('0x4a')](_0x369f42['query'][_0xf59e('0x4a')]));_0x506374['attributes']=_0x506374[_0xf59e('0x39')][_0xf59e('0x3a')]?_0x506374[_0xf59e('0x39')]:_0x12463f[_0xf59e('0x38')];if(_0x369f42[_0xf59e('0x35')][_0xf59e('0x45')]){_0x506374[_0xf59e('0x4b')]=[{'all':!![]}];}_0x506374=_['merge']({},_0x506374,_0x369f42['options']);return db[_0xf59e('0x30')][_0xf59e('0x4c')](_0x506374)[_0xf59e('0x2a')](handleEntityNotFound(_0xfe5ea6,null))[_0xf59e('0x2a')](respondWithResult(_0xfe5ea6,null))[_0xf59e('0x48')](handleError(_0xfe5ea6,null));};exports['create']=function(_0x3d51f0,_0xdcefe0){return db[_0xf59e('0x30')][_0xf59e('0x4d')](_0x3d51f0[_0xf59e('0x4e')],{})[_0xf59e('0x2a')](respondWithResult(_0xdcefe0,0xc9))[_0xf59e('0x48')](handleError(_0xdcefe0,null));};exports[_0xf59e('0x29')]=function(_0x148690,_0x599f02){if(_0x148690[_0xf59e('0x4e')]['id']){delete _0x148690['body']['id'];}return db[_0xf59e('0x30')][_0xf59e('0x4c')]({'where':{'id':_0x148690['params']['id']}})['then'](handleEntityNotFound(_0x599f02,null))[_0xf59e('0x2a')](saveUpdates(_0x148690[_0xf59e('0x4e')],null))[_0xf59e('0x2a')](respondWithResult(_0x599f02,null))[_0xf59e('0x48')](handleError(_0x599f02,null));};exports['destroy']=function(_0x7756cf,_0x2f8f7b){return db[_0xf59e('0x30')][_0xf59e('0x4c')]({'where':{'id':_0x7756cf[_0xf59e('0x4f')]['id']}})[_0xf59e('0x2a')](handleEntityNotFound(_0x2f8f7b,null))['then'](removeEntity(_0x2f8f7b,null))[_0xf59e('0x48')](handleError(_0x2f8f7b,null));};
\ No newline at end of file
index f90371d..ba1d6d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92df=['./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','path','../../config/environment'];(function(_0x541263,_0x34a778){var _0x53edaf=function(_0x4c7ab2){while(--_0x4c7ab2){_0x541263['push'](_0x541263['shift']());}};_0x53edaf(++_0x34a778);}(_0x92df,0xcb));var _0xf92d=function(_0x387156,_0x9a8023){_0x387156=_0x387156-0x0;var _0x57ba23=_0x92df[_0x387156];return _0x57ba23;};'use strict';var _=require(_0xf92d('0x0'));var util=require(_0xf92d('0x1'));var logger=require(_0xf92d('0x2'))(_0xf92d('0x3'));var moment=require(_0xf92d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf92d('0x5'));var rimraf=require('rimraf');var config=require(_0xf92d('0x6'));var attributes=require(_0xf92d('0x7'));module[_0xf92d('0x8')]=function(_0x990c37,_0x43ce70){return _0x990c37[_0xf92d('0x9')](_0xf92d('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xf92d('0xb'),'fields':[_0xf92d('0xc'),_0xf92d('0xd')]}],'timestamps':![]});};
\ No newline at end of file
+var _0xa1fd=['exports','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3ae2b2,_0x2d936f){var _0x1dbf00=function(_0x4072e9){while(--_0x4072e9){_0x3ae2b2['push'](_0x3ae2b2['shift']());}};_0x1dbf00(++_0x2d936f);}(_0xa1fd,0x1b9));var _0xda1f=function(_0x3566d0,_0x34a49f){_0x3566d0=_0x3566d0-0x0;var _0x3fd4da=_0xa1fd[_0x3566d0];return _0x3fd4da;};'use strict';var _=require(_0xda1f('0x0'));var util=require(_0xda1f('0x1'));var logger=require(_0xda1f('0x2'))(_0xda1f('0x3'));var moment=require('moment');var BPromise=require(_0xda1f('0x4'));var rp=require(_0xda1f('0x5'));var fs=require('fs');var path=require(_0xda1f('0x6'));var rimraf=require(_0xda1f('0x7'));var config=require(_0xda1f('0x8'));var attributes=require('./voiceQueuesLog.attributes');module[_0xda1f('0x9')]=function(_0x3b9463,_0x362dee){return _0x3b9463['define'](_0xda1f('0xa'),attributes,{'tableName':_0xda1f('0xb'),'paranoid':![],'indexes':[{'name':_0xda1f('0xc'),'fields':[_0xda1f('0xd'),_0xda1f('0xe')]}],'timestamps':![]});};
\ No newline at end of file
index 75c5436..6cbce34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c99=['debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent'];(function(_0x4ddc5a,_0x5e319b){var _0x499313=function(_0x5aab52){while(--_0x5aab52){_0x4ddc5a['push'](_0x4ddc5a['shift']());}};_0x499313(++_0x5e319b);}(_0x8c99,0x1a8));var _0x98c9=function(_0x412c8f,_0x11ec94){_0x412c8f=_0x412c8f-0x0;var _0x27c005=_0x8c99[_0x412c8f];return _0x27c005;};'use strict';var _=require(_0x98c9('0x0'));var util=require(_0x98c9('0x1'));var moment=require(_0x98c9('0x2'));var BPromise=require(_0x98c9('0x3'));var rs=require(_0x98c9('0x4'));var fs=require('fs');var Redis=require(_0x98c9('0x5'));var db=require(_0x98c9('0x6'))['db'];var utils=require(_0x98c9('0x7'));var logger=require(_0x98c9('0x8'))(_0x98c9('0x9'));var config=require(_0x98c9('0xa'));var jayson=require(_0x98c9('0xb'));var client=jayson['client'][_0x98c9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ed2b6,_0x538465,_0x4af8a6){return new BPromise(function(_0x5b983e,_0xc789b1){return client[_0x98c9('0xd')](_0x2ed2b6,_0x4af8a6)[_0x98c9('0xe')](function(_0x4052cf){logger[_0x98c9('0xf')](_0x98c9('0x10'),_0x538465,_0x98c9('0x11'));logger[_0x98c9('0x12')](_0x98c9('0x13'),_0x538465,_0x98c9('0x11'),JSON[_0x98c9('0x14')](_0x4052cf));if(_0x4052cf['error']){if(_0x4052cf[_0x98c9('0x15')][_0x98c9('0x16')]===0x1f4){logger[_0x98c9('0x15')](_0x98c9('0x10'),_0x538465,_0x4052cf['error'][_0x98c9('0x17')]);return _0xc789b1(_0x4052cf[_0x98c9('0x15')][_0x98c9('0x17')]);}logger[_0x98c9('0x15')](_0x98c9('0x10'),_0x538465,_0x4052cf['error'][_0x98c9('0x17')]);return _0x5b983e(_0x4052cf[_0x98c9('0x15')][_0x98c9('0x17')]);}else{logger[_0x98c9('0xf')](_0x98c9('0x10'),_0x538465,_0x98c9('0x11'));_0x5b983e(_0x4052cf[_0x98c9('0x18')][_0x98c9('0x17')]);}})[_0x98c9('0x19')](function(_0x2bb8b6){logger[_0x98c9('0x15')](_0x98c9('0x10'),_0x538465,_0x2bb8b6);_0xc789b1(_0x2bb8b6);});});}
\ No newline at end of file
+var _0xadf7=['catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x31b5b2,_0x5ab927){var _0x364f13=function(_0x163bd0){while(--_0x163bd0){_0x31b5b2['push'](_0x31b5b2['shift']());}};_0x364f13(++_0x5ab927);}(_0xadf7,0xb5));var _0x7adf=function(_0x365949,_0x33d3b1){_0x365949=_0x365949-0x0;var _0x2a00d9=_0xadf7[_0x365949];return _0x2a00d9;};'use strict';var _=require(_0x7adf('0x0'));var util=require('util');var moment=require(_0x7adf('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7adf('0x2'));var db=require(_0x7adf('0x3'))['db'];var utils=require(_0x7adf('0x4'));var logger=require(_0x7adf('0x5'))(_0x7adf('0x6'));var config=require(_0x7adf('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7adf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x570722,_0x1c3d08,_0xa6c76f){return new BPromise(function(_0x18ef38,_0x239caa){return client[_0x7adf('0x9')](_0x570722,_0xa6c76f)[_0x7adf('0xa')](function(_0x56ebff){logger[_0x7adf('0xb')](_0x7adf('0xc'),_0x1c3d08,_0x7adf('0xd'));logger['debug'](_0x7adf('0xe'),_0x1c3d08,_0x7adf('0xd'),JSON['stringify'](_0x56ebff));if(_0x56ebff[_0x7adf('0xf')]){if(_0x56ebff[_0x7adf('0xf')]['code']===0x1f4){logger[_0x7adf('0xf')](_0x7adf('0xc'),_0x1c3d08,_0x56ebff[_0x7adf('0xf')][_0x7adf('0x10')]);return _0x239caa(_0x56ebff['error'][_0x7adf('0x10')]);}logger[_0x7adf('0xf')](_0x7adf('0xc'),_0x1c3d08,_0x56ebff['error'][_0x7adf('0x10')]);return _0x18ef38(_0x56ebff[_0x7adf('0xf')][_0x7adf('0x10')]);}else{logger[_0x7adf('0xb')](_0x7adf('0xc'),_0x1c3d08,_0x7adf('0xd'));_0x18ef38(_0x56ebff['result'][_0x7adf('0x10')]);}})[_0x7adf('0x11')](function(_0x56acb2){logger['error'](_0x7adf('0xc'),_0x1c3d08,_0x56acb2);_0x239caa(_0x56acb2);});});}
\ No newline at end of file
index c1780e0..780064f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe332=['put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe'];(function(_0x47565e,_0x1b677e){var _0x115bec=function(_0x4c35a4){while(--_0x4c35a4){_0x47565e['push'](_0x47565e['shift']());}};_0x115bec(++_0x1b677e);}(_0xe332,0xc7));var _0x2e33=function(_0x100d4c,_0x1d1e60){_0x100d4c=_0x100d4c-0x0;var _0x1bce92=_0xe332[_0x100d4c];return _0x1bce92;};'use strict';var multer=require(_0x2e33('0x0'));var util=require(_0x2e33('0x1'));var path=require(_0x2e33('0x2'));var timeout=require(_0x2e33('0x3'));var express=require(_0x2e33('0x4'));var router=express[_0x2e33('0x5')]();var fs_extra=require(_0x2e33('0x6'));var auth=require(_0x2e33('0x7'));var interaction=require(_0x2e33('0x8'));var config=require('../../config/environment');var controller=require(_0x2e33('0x9'));router[_0x2e33('0xa')]('/',auth[_0x2e33('0xb')](),controller[_0x2e33('0xc')]);router[_0x2e33('0xa')](_0x2e33('0xd'),auth[_0x2e33('0xb')](),controller[_0x2e33('0xe')]);router[_0x2e33('0xa')](_0x2e33('0xf'),auth['isAuthenticated'](),controller[_0x2e33('0x10')]);router[_0x2e33('0xa')](_0x2e33('0x11'),auth['isAuthenticated'](),controller[_0x2e33('0x12')]);router[_0x2e33('0xa')](_0x2e33('0x13'),controller['downloads']);router[_0x2e33('0xa')](_0x2e33('0x14'),auth[_0x2e33('0xb')](),controller[_0x2e33('0x15')]);router[_0x2e33('0x16')]('/',auth['isAuthenticated'](),controller[_0x2e33('0x17')]);router[_0x2e33('0x16')](_0x2e33('0x14'),auth[_0x2e33('0xb')](),controller[_0x2e33('0x18')]);router[_0x2e33('0x19')](_0x2e33('0xf'),auth[_0x2e33('0xb')](),controller[_0x2e33('0x1a')]);router['delete'](_0x2e33('0xf'),auth[_0x2e33('0xb')](),controller[_0x2e33('0x1b')]);module['exports']=router;
\ No newline at end of file
+var _0xa0d0=['/:id/downloads','downloads','/:id/transcribe','post','create','runTranscribe','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','index','isAuthenticated','describe','/:id','show','download'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xa0d0,0xd9));var _0x0a0d=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa0d0[_0x24237f];return _0x48298e;};'use strict';var multer=require('multer');var util=require(_0x0a0d('0x0'));var path=require(_0x0a0d('0x1'));var timeout=require(_0x0a0d('0x2'));var express=require(_0x0a0d('0x3'));var router=express[_0x0a0d('0x4')]();var fs_extra=require(_0x0a0d('0x5'));var auth=require(_0x0a0d('0x6'));var interaction=require(_0x0a0d('0x7'));var config=require(_0x0a0d('0x8'));var controller=require(_0x0a0d('0x9'));router[_0x0a0d('0xa')]('/',auth['isAuthenticated'](),controller[_0x0a0d('0xb')]);router[_0x0a0d('0xa')]('/describe',auth[_0x0a0d('0xc')](),controller[_0x0a0d('0xd')]);router[_0x0a0d('0xa')](_0x0a0d('0xe'),auth[_0x0a0d('0xc')](),controller[_0x0a0d('0xf')]);router[_0x0a0d('0xa')]('/:id/download',auth[_0x0a0d('0xc')](),controller[_0x0a0d('0x10')]);router[_0x0a0d('0xa')](_0x0a0d('0x11'),controller[_0x0a0d('0x12')]);router['get'](_0x0a0d('0x13'),auth[_0x0a0d('0xc')](),controller['downloadTranscribe']);router[_0x0a0d('0x14')]('/',auth['isAuthenticated'](),controller[_0x0a0d('0x15')]);router[_0x0a0d('0x14')](_0x0a0d('0x13'),auth['isAuthenticated'](),controller[_0x0a0d('0x16')]);router['put'](_0x0a0d('0xe'),auth[_0x0a0d('0xc')](),controller[_0x0a0d('0x17')]);router['delete'](_0x0a0d('0xe'),auth[_0x0a0d('0xc')](),controller[_0x0a0d('0x18')]);module[_0x0a0d('0x19')]=router;
\ No newline at end of file
index 1b76176..77ca481 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}};
\ No newline at end of file
+var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}};
\ No newline at end of file
index e5056c8..9fe2fac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5db=['unlink','message','Not\x20found','downloads','sequelize','col','uniqueid','token','$and','push','%s.cypher','extname','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','squel','jsforce','to-csv','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','end','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','format','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','pick','filters','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','../../components/encryptor','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download'];(function(_0x1f453a,_0x5768bc){var _0x108538=function(_0xf8490c){while(--_0xf8490c){_0x1f453a['push'](_0x1f453a['shift']());}};_0x108538(++_0x5768bc);}(_0xa5db,0x17c));var _0xba5d=function(_0x144cee,_0x34fd0d){_0x144cee=_0x144cee-0x0;var _0x1dadd8=_0xa5db[_0x144cee];return _0x1dadd8;};'use strict';var emlformat=require(_0xba5d('0x0'));var rimraf=require(_0xba5d('0x1'));var zipdir=require(_0xba5d('0x2'));var jsonpatch=require(_0xba5d('0x3'));var rp=require(_0xba5d('0x4'));var moment=require('moment');var BPromise=require(_0xba5d('0x5'));var Mustache=require(_0xba5d('0x6'));var util=require(_0xba5d('0x7'));var path=require('path');var sox=require(_0xba5d('0x8'));var csv=require('to-csv');var ejs=require(_0xba5d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xba5d('0xa'));var crypto=require('crypto');var jsforce=require(_0xba5d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xba5d('0xc'));var querystring=require(_0xba5d('0xd'));var Papa=require(_0xba5d('0xe'));var AWS=require(_0xba5d('0xf'));var uuidv4=require(_0xba5d('0x10'));var Redis=require(_0xba5d('0x11'));var authService=require(_0xba5d('0x12'));var qs=require(_0xba5d('0x13'));var as=require(_0xba5d('0x14'));var hardwareService=require(_0xba5d('0x15'));var logger=require(_0xba5d('0x16'))('api');var utils=require(_0xba5d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xba5d('0x18'));var db=require(_0xba5d('0x19'))['db'];function respondWithStatusCode(_0x18e8d4,_0x4c92a2){_0x4c92a2=_0x4c92a2||0xcc;return function(_0x2aa4ac){if(_0x2aa4ac){return _0x18e8d4[_0xba5d('0x1a')](_0x4c92a2);}return _0x18e8d4[_0xba5d('0x1b')](_0x4c92a2)['end']();};}function respondWithResult(_0xb3a88c,_0x4cecd6){_0x4cecd6=_0x4cecd6||0xc8;return function(_0xb58ba6){if(_0xb58ba6){return _0xb3a88c['status'](_0x4cecd6)[_0xba5d('0x1c')](_0xb58ba6);}};}function respondWithFilteredResult(_0xc3c50d,_0x1d80dc){return function(_0xd6c661){if(_0xd6c661){var _0x31f15c=typeof _0x1d80dc['offset']===_0xba5d('0x1d')&&typeof _0x1d80dc['limit']===_0xba5d('0x1d');var _0x2132d0=_0xd6c661[_0xba5d('0x1e')];var _0x3cd333=_0x31f15c?0x0:_0x1d80dc[_0xba5d('0x1f')];var _0x1e9b61=_0x31f15c?_0xd6c661[_0xba5d('0x1e')]:_0x1d80dc[_0xba5d('0x1f')]+_0x1d80dc[_0xba5d('0x20')];var _0x3fb977;if(_0x1e9b61>=_0x2132d0){_0x1e9b61=_0x2132d0;_0x3fb977=0xc8;}else{_0x3fb977=0xce;}_0xc3c50d[_0xba5d('0x1b')](_0x3fb977);return _0xc3c50d[_0xba5d('0x21')](_0xba5d('0x22'),_0x3cd333+'-'+_0x1e9b61+'/'+_0x2132d0)['json'](_0xd6c661);}return null;};}function patchUpdates(_0x48607a){return function(_0x297405){try{jsonpatch[_0xba5d('0x23')](_0x297405,_0x48607a,!![]);}catch(_0xff5608){return BPromise['reject'](_0xff5608);}return _0x297405[_0xba5d('0x24')]();};}function saveUpdates(_0x217d28,_0x3ee083){return function(_0x7dfde2){if(_0x7dfde2){return _0x7dfde2[_0xba5d('0x25')](_0x217d28)['then'](function(_0x1aac90){return _0x1aac90;});}return null;};}function removeEntity(_0x1b4c22,_0x3b3e9b){return function(_0x3b6e35){if(_0x3b6e35){return _0x3b6e35[_0xba5d('0x26')]()[_0xba5d('0x27')](function(){_0x1b4c22[_0xba5d('0x1b')](0xcc)[_0xba5d('0x28')]();});}};}function handleEntityNotFound(_0x136a3d,_0x415811){return function(_0x26b9c1){if(!_0x26b9c1){_0x136a3d[_0xba5d('0x1a')](0x194);}return _0x26b9c1;};}function handleError(_0x499c37,_0x336159){_0x336159=_0x336159||0x1f4;return function(_0x160eab){logger[_0xba5d('0x29')](_0x160eab[_0xba5d('0x2a')]);if(_0x160eab[_0xba5d('0x2b')]){delete _0x160eab[_0xba5d('0x2b')];}_0x499c37[_0xba5d('0x1b')](_0x336159)[_0xba5d('0x2c')](_0x160eab);};}exports[_0xba5d('0x2d')]=function(_0x1ee17d,_0xbc6a12){var _0x47b631={},_0x245db3={},_0x40f366={'count':0x0,'rows':[]};var _0x2f57d9=_[_0xba5d('0x2e')](db[_0xba5d('0x2f')][_0xba5d('0x30')],function(_0x54187c){return{'name':_0x54187c[_0xba5d('0x31')],'type':_0x54187c[_0xba5d('0x32')][_0xba5d('0x33')]};});_0x245db3[_0xba5d('0x34')]=_['differenceBy'](_[_0xba5d('0x2e')](_0x2f57d9,_0xba5d('0x2b')),[_0xba5d('0x35')]);_0x245db3[_0xba5d('0x36')]=_[_0xba5d('0x37')](_0x1ee17d[_0xba5d('0x36')]);_0x245db3['filters']=_['intersection'](_0x245db3[_0xba5d('0x34')],_0x245db3[_0xba5d('0x36')]);_0x47b631[_0xba5d('0x38')]=_[_0xba5d('0x39')](_0x245db3[_0xba5d('0x34')],qs[_0xba5d('0x3a')](_0x1ee17d[_0xba5d('0x36')][_0xba5d('0x3a')]));_0x47b631[_0xba5d('0x38')]=_0x47b631[_0xba5d('0x38')][_0xba5d('0x3b')]?_0x47b631['attributes']:_0x245db3[_0xba5d('0x34')];if(!_0x1ee17d[_0xba5d('0x36')][_0xba5d('0x3c')]('nolimit')){_0x47b631[_0xba5d('0x20')]=qs[_0xba5d('0x20')](_0x1ee17d[_0xba5d('0x36')][_0xba5d('0x20')]);_0x47b631[_0xba5d('0x1f')]=qs[_0xba5d('0x1f')](_0x1ee17d['query'][_0xba5d('0x1f')]);}_0x47b631[_0xba5d('0x3d')]=qs['sort'](_0x1ee17d[_0xba5d('0x36')]['sort']);_0x47b631['where']=qs['filters'](_[_0xba5d('0x3e')](_0x1ee17d[_0xba5d('0x36')],_0x245db3[_0xba5d('0x3f')]),_0x2f57d9);if(_0x1ee17d['query'][_0xba5d('0x40')]){_0x47b631[_0xba5d('0x41')]=_['merge'](_0x47b631['where'],{'$or':_[_0xba5d('0x2e')](_0x2f57d9,function(_0x22b16){if(_0x22b16[_0xba5d('0x32')]!==_0xba5d('0x42')){var _0x3386bc={};_0x3386bc[_0x22b16[_0xba5d('0x2b')]]={'$like':'%'+_0x1ee17d['query']['filter']+'%'};return _0x3386bc;}})});}_0x47b631=_[_0xba5d('0x43')]({},_0x47b631,_0x1ee17d[_0xba5d('0x44')]);var _0x5149bd={'where':_0x47b631[_0xba5d('0x41')]};return db[_0xba5d('0x2f')][_0xba5d('0x1e')](_0x5149bd)['then'](function(_0x465659){_0x40f366[_0xba5d('0x1e')]=_0x465659;if(_0x1ee17d[_0xba5d('0x36')][_0xba5d('0x45')]){_0x47b631[_0xba5d('0x46')]=[{'all':!![]}];}return db[_0xba5d('0x2f')][_0xba5d('0x47')](_0x47b631);})[_0xba5d('0x27')](function(_0x306eee){_0x40f366[_0xba5d('0x48')]=_0x306eee;return _0x40f366;})[_0xba5d('0x27')](respondWithFilteredResult(_0xbc6a12,_0x47b631))['catch'](handleError(_0xbc6a12,null));};exports[_0xba5d('0x49')]=function(_0x2f9e42,_0x23edcb){var _0x9e9293={'raw':![],'where':{'id':_0x2f9e42[_0xba5d('0x4a')]['id']}},_0x1b31e2={};_0x1b31e2[_0xba5d('0x34')]=_[_0xba5d('0x37')](db[_0xba5d('0x2f')]['rawAttributes']);_0x1b31e2[_0xba5d('0x36')]=_[_0xba5d('0x37')](_0x2f9e42[_0xba5d('0x36')]);_0x1b31e2[_0xba5d('0x3f')]=_[_0xba5d('0x39')](_0x1b31e2[_0xba5d('0x34')],_0x1b31e2['query']);_0x9e9293['attributes']=_[_0xba5d('0x39')](_0x1b31e2[_0xba5d('0x34')],qs[_0xba5d('0x3a')](_0x2f9e42[_0xba5d('0x36')][_0xba5d('0x3a')]));_0x9e9293[_0xba5d('0x38')]=_0x9e9293[_0xba5d('0x38')][_0xba5d('0x3b')]?_0x9e9293[_0xba5d('0x38')]:_0x1b31e2[_0xba5d('0x34')];if(_0x2f9e42[_0xba5d('0x36')][_0xba5d('0x45')]){_0x9e9293['include']=[{'all':!![]}];}_0x9e9293=_[_0xba5d('0x43')]({},_0x9e9293,_0x2f9e42[_0xba5d('0x44')]);return db[_0xba5d('0x2f')][_0xba5d('0x4b')](_0x9e9293)[_0xba5d('0x27')](handleEntityNotFound(_0x23edcb,null))[_0xba5d('0x27')](respondWithResult(_0x23edcb,null))[_0xba5d('0x4c')](handleError(_0x23edcb,null));};exports[_0xba5d('0x4d')]=function(_0x5bdab4,_0x5de481){return db['VoiceRecording'][_0xba5d('0x4d')](_0x5bdab4[_0xba5d('0x4e')],{})[_0xba5d('0x27')](respondWithResult(_0x5de481,0xc9))['catch'](handleError(_0x5de481,null));};exports[_0xba5d('0x25')]=function(_0x576def,_0x35d6be){if(_0x576def[_0xba5d('0x4e')]['id']){delete _0x576def['body']['id'];}return db['VoiceRecording'][_0xba5d('0x4b')]({'where':{'id':_0x576def[_0xba5d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x35d6be,null))[_0xba5d('0x27')](saveUpdates(_0x576def[_0xba5d('0x4e')],null))['then'](respondWithResult(_0x35d6be,null))[_0xba5d('0x4c')](handleError(_0x35d6be,null));};exports[_0xba5d('0x4f')]=function(_0x3581db,_0x52c44b){return db[_0xba5d('0x2f')][_0xba5d('0x4f')]()[_0xba5d('0x27')](respondWithResult(_0x52c44b,null))[_0xba5d('0x4c')](handleError(_0x52c44b,null));};exports['download']=function(_0x3d00ac,_0x5ae6d2,_0x3ac4e3){var _0x39943e=require(_0xba5d('0x50'));var _0x5e0ee6=![];var _0x384b43={};if(_0x3d00ac[_0xba5d('0x36')][_0xba5d('0x32')]&&_0x3d00ac[_0xba5d('0x36')][_0xba5d('0x32')]==='uniqueid'){_0x384b43['uniqueid']=_0x3d00ac[_0xba5d('0x4a')]['id'];}else{_0x384b43['id']=_0x3d00ac['params']['id'];}return db['VoiceRecording'][_0xba5d('0x4b')]({'where':_0x384b43,'attributes':['id',_0xba5d('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x5ae6d2,null))[_0xba5d('0x27')](function(_0x171bff){if(_0x171bff){var _0x589020=_0x171bff[_0xba5d('0x51')];var _0x3456f2=util[_0xba5d('0x35')]('%s.cypher',_0x589020);if(fs[_0xba5d('0x52')](_0x3456f2)){_0x5e0ee6=!![];return _0x39943e[_0xba5d('0x53')](_0x3456f2,_0x589020,config[_0xba5d('0x54')][_0xba5d('0x55')])[_0xba5d('0x27')](function(){return _0x171bff;});}return _0x171bff;}})[_0xba5d('0x27')](function(_0x1d0c5e){if(_0x1d0c5e){var _0x12d365=_0x1d0c5e['value'];if(!fs['existsSync'](_0x12d365)){throw new db[(_0xba5d('0x56'))][(_0xba5d('0x57'))](_0xba5d('0x58'));}if(_0x1d0c5e[_0xba5d('0x59')]){return _0x5ae6d2[_0xba5d('0x5a')](_0x12d365,_0x1d0c5e[_0xba5d('0x59')]+path['extname'](_0x12d365),function(){if(_0x5e0ee6){fs[_0xba5d('0x5b')](_0x12d365);}});}else{return _0x5ae6d2[_0xba5d('0x5a')](_0x12d365,function(_0x5975ac){if(_0x5e0ee6){fs['unlink'](_0x12d365);}});}}})[_0xba5d('0x4c')](function(_0x352a6f){if(_0x352a6f[_0xba5d('0x5c')]==='VoiceRecording\x20not\x20found'){_0x5ae6d2[_0xba5d('0x1b')](0x194)['send'](_0xba5d('0x5d'));}else{return handleError(_0x5ae6d2,null);}});};exports[_0xba5d('0x5e')]=function(_0x457efc,_0x4abb22,_0x3ad4f4){var _0x2cbc85=require(_0xba5d('0x50'));var _0x387c6f=![];var _0x138f27={'$and':[db['sequelize'][_0xba5d('0x41')](db['sequelize']['fn']('MD5',db[_0xba5d('0x5f')][_0xba5d('0x60')](_0xba5d('0x61'))),_0x457efc[_0xba5d('0x36')][_0xba5d('0x62')])]};if(_0x457efc[_0xba5d('0x36')][_0xba5d('0x32')]&&_0x457efc[_0xba5d('0x36')][_0xba5d('0x32')]===_0xba5d('0x61')){_0x138f27['$and']['push']({'uniqueid':_0x457efc['params']['id']});}else{_0x138f27[_0xba5d('0x63')][_0xba5d('0x64')]({'id':_0x457efc[_0xba5d('0x4a')]['id']});}return db[_0xba5d('0x2f')]['find']({'where':_0x138f27,'attributes':['id',_0xba5d('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x4abb22,null))[_0xba5d('0x27')](function(_0x113c54){if(_0x113c54){var _0x5be28d=util['format'](_0xba5d('0x65'),_0x113c54['value']);if(fs['existsSync'](_0x5be28d)){_0x387c6f=!![];return _0x2cbc85['decryptFile'](_0x5be28d,_0x113c54[_0xba5d('0x51')],config[_0xba5d('0x54')][_0xba5d('0x55')])[_0xba5d('0x27')](function(){return _0x113c54;});}return _0x113c54;}})['then'](function(_0x44e105){if(_0x44e105){if(!fs[_0xba5d('0x52')](_0x44e105[_0xba5d('0x51')])){throw new db['Sequelize'][(_0xba5d('0x57'))](_0xba5d('0x58'));}if(_0x44e105[_0xba5d('0x59')]){return _0x4abb22[_0xba5d('0x5a')](_0x44e105[_0xba5d('0x51')],_0x44e105[_0xba5d('0x59')]+path[_0xba5d('0x66')](_0x44e105[_0xba5d('0x51')]),function(){if(_0x387c6f){fs[_0xba5d('0x5b')](_0x44e105[_0xba5d('0x51')]);}});}else{return _0x4abb22[_0xba5d('0x5a')](_0x44e105['value'],function(_0xb59c53){if(_0x387c6f){fs[_0xba5d('0x5b')](_0x44e105[_0xba5d('0x51')]);}});}}})['catch'](handleError(_0x4abb22,null));};exports[_0xba5d('0x26')]=function(_0x1cecbe,_0x34f4f4){return db['VoiceRecording'][_0xba5d('0x4b')]({'where':{'id':_0x1cecbe[_0xba5d('0x4a')]['id']}})[_0xba5d('0x27')](function(_0x216de0){if(_[_0xba5d('0x67')](_0x216de0)){throw new ReferenceError('Entity\x20not\x20found');}return _0x216de0;})[_0xba5d('0x27')](function(_0x385056){var _0x343b8f=_0x385056['value'];logger[_0xba5d('0x68')](_0xba5d('0x69'),_0x343b8f);if(!_[_0xba5d('0x67')](_0x385056[_0xba5d('0x51')])&&fs[_0xba5d('0x52')](_0x343b8f)){logger['info'](_0xba5d('0x6a')+_0x343b8f+_0xba5d('0x6b'));fs[_0xba5d('0x6c')](_0x343b8f);}_0x343b8f=_0x343b8f+'.cypher';if(!_[_0xba5d('0x67')](_0x385056[_0xba5d('0x51')])&&fs['existsSync'](_0x343b8f)){logger[_0xba5d('0x68')]('File:\x20\x22'+_0x343b8f+_0xba5d('0x6b'));fs[_0xba5d('0x6c')](_0x343b8f);}return _0x385056;})[_0xba5d('0x27')](function(_0x47ce4d){if(!_0x47ce4d)throw new InternalError();return _0x47ce4d['destroy']();})[_0xba5d('0x27')](function(){_0x34f4f4[_0xba5d('0x1b')](0xcc)[_0xba5d('0x28')]();})['catch'](handleError(_0x34f4f4,null));};function getBucketslist(_0x27de87,_0x4ee0e8,_0x53b704){return new Promise(function(_0x114a90,_0x433e57){var _0x325790=new AWS['S3']({'accessKeyId':_0x4ee0e8,'secretAccessKey':_0x27de87,'region':_0x53b704});_0x325790[_0xba5d('0x6d')]({},function(_0x1112d7,_0x35899e){if(_0x1112d7){return _0x433e57(_0x1112d7);}else{return _0x114a90(_0x35899e);}});});}function createBucket(_0x46d7ac,_0x272cdf,_0x480b18,_0x5b227f){return new Promise(function(_0x199778,_0x531f02){var _0x16f3de=new AWS['S3']({'accessKeyId':_0x272cdf,'secretAccessKey':_0x46d7ac,'region':_0x480b18});_0x16f3de[_0xba5d('0x6e')]({'Bucket':_0x5b227f},function(_0x574bc6,_0x5441cc){if(_0x574bc6){return _0x531f02(_0x574bc6);}else{return _0x199778(_0x5441cc);}});});}function uploadFile(_0x5245ea,_0x617097,_0x184a70,_0x39ddc3,_0x1ab7e0,_0x38dbcd){return new Promise(function(_0x17d458,_0x464148){var _0x270b0b=new AWS['S3']({'accessKeyId':_0x617097,'secretAccessKey':_0x5245ea,'region':_0x184a70});_0x270b0b[_0xba5d('0x6f')]({'Bucket':_0x39ddc3,'Key':_0x1ab7e0,'Body':_0x38dbcd},function(_0x4b1a4e,_0x49948e){if(_0x4b1a4e){return _0x464148(_0x4b1a4e);}else{return _0x17d458(_0x49948e);}});});}function startTranscribe(_0x283939,_0x7c2d47,_0x3e89cc,_0x400882,_0x561664,_0x41124b){return new Promise(function(_0x525ce1,_0x13d8d1){var _0x2857e6=new AWS[(_0xba5d('0x70'))]({'accessKeyId':_0x7c2d47,'secretAccessKey':_0x283939,'region':_0x3e89cc});_0x2857e6[_0xba5d('0x71')]({'TranscriptionJobName':_0x400882,'LanguageCode':_0x561664,'Media':{'MediaFileUri':_0x41124b}},function(_0x4934c6,_0x167161){if(_0x4934c6){return _0x13d8d1(_0x4934c6);}else{return _0x525ce1(_0x167161);}});});}function transcribe(_0x3f6b81,_0x345498,_0x1bb21e,_0x3df967,_0x2253c2,_0x24f06f,_0x10edea){return new Promise(function(_0x5041fd,_0x38305f){var _0x554178={};logger[_0xba5d('0x68')](util[_0xba5d('0x35')](_0xba5d('0x72'),_0x3f6b81,_0x2253c2));return uploadFile(_0x345498,_0x1bb21e,_0x3df967,_0x2253c2,path[_0xba5d('0x73')](_0x24f06f),fs['readFileSync'](_0x24f06f))['then'](function(_0x24ef21){logger[_0xba5d('0x68')](util[_0xba5d('0x35')](_0xba5d('0x74'),_0x3f6b81,_0x2253c2,_0x24ef21[_0xba5d('0x75')]));_0x554178[_0xba5d('0x76')]=_0x24ef21[_0xba5d('0x77')];_0x554178[_0xba5d('0x78')]=_0x24ef21[_0xba5d('0x75')];logger[_0xba5d('0x68')](util['format'](_0xba5d('0x79'),_0x3f6b81));return startTranscribe(_0x345498,_0x1bb21e,_0x3df967,uuidv4(),_0x10edea,_0x24ef21[_0xba5d('0x75')]);})[_0xba5d('0x27')](function(_0xc7e17d){logger[_0xba5d('0x68')](util[_0xba5d('0x35')](_0xba5d('0x7a'),_0x3f6b81,_0xc7e17d['TranscriptionJob'][_0xba5d('0x7b')]));_0x554178[_0xba5d('0x7c')]=_0xc7e17d[_0xba5d('0x7d')][_0xba5d('0x7b')];_0x554178['transcribeStatus']=_0xc7e17d[_0xba5d('0x7d')]['TranscriptionJobStatus'];return _0x5041fd(_0x554178);})[_0xba5d('0x4c')](function(_0x42b239){return _0x38305f(_0x42b239);});});}exports[_0xba5d('0x7e')]=function(_0x1c1f4e,_0x219504,_0x470d38){var _0x203993;var _0x18a2e2;var _0xe7cf66;var _0x16e96e=require(_0xba5d('0x50'));return db[_0xba5d('0x2f')][_0xba5d('0x7f')]({'where':{'id':_0x1c1f4e[_0xba5d('0x4a')]['id']}})[_0xba5d('0x27')](function(_0x403348){if(_0x403348){var _0x1014dc=util[_0xba5d('0x35')](_0xba5d('0x65'),_0x403348[_0xba5d('0x51')]);if(fs[_0xba5d('0x52')](_0x1014dc)){cypher=!![];return _0x16e96e[_0xba5d('0x53')](_0x1014dc,_0x403348[_0xba5d('0x51')],config[_0xba5d('0x54')][_0xba5d('0x55')])['then'](function(){return _0x403348;});}return _0x403348;}})[_0xba5d('0x27')](function(_0x1b7417){if(!_0x1b7417){throw new db[(_0xba5d('0x56'))][(_0xba5d('0x57'))](_0xba5d('0x80'));}_0x18a2e2=_0x1b7417;return db[_0xba5d('0x81')]['findOne']({'where':{'id':0x1}});})[_0xba5d('0x27')](handleEntityNotFound(_0x219504,null))['then'](function(_0x4da0eb){if(_0x4da0eb){_0x203993=_0x4da0eb;if(!_0x203993['transcribe']||!_0x203993[_0xba5d('0x82')]||!_0x203993[_0xba5d('0x83')]||!_0x203993['language']||!_0x203993[_0xba5d('0x76')]){throw new db[(_0xba5d('0x56'))]['ValidationError'](_0xba5d('0x84'));}if(_0x1c1f4e[_0xba5d('0x4e')][_0xba5d('0x85')]&&(!_0x203993[_0xba5d('0x86')]||!_0x203993[_0xba5d('0x87')]||!_0x203993[_0xba5d('0x88')]||!_0x203993[_0xba5d('0x89')]||!_0x203993[_0xba5d('0x76')])){throw new db['Sequelize'][(_0xba5d('0x57'))](_0xba5d('0x8a'));}return db[_0xba5d('0x8b')]['findOne']({'where':{'id':_0x203993[_0xba5d('0x82')]}});}})['then'](function(_0x469410){if(!_0x469410){throw new db['Sequelize'][(_0xba5d('0x57'))](_0xba5d('0x8c'));}if(!_0x469410['data1']||!_0x469410[_0xba5d('0x8d')]){throw new db[(_0xba5d('0x56'))]['ValidationError'](_0xba5d('0x8e'));}_0xe7cf66=_0x469410;return getBucketslist(_0xe7cf66[_0xba5d('0x8f')],_0xe7cf66[_0xba5d('0x8d')],_0x203993[_0xba5d('0x83')]);})[_0xba5d('0x27')](function(_0xbb14f1){if(_0xbb14f1&&_0xbb14f1['Buckets']){var _0x1c793d=_[_0xba5d('0x4b')](_0xbb14f1[_0xba5d('0x90')],function(_0x25fa83){return _0x25fa83[_0xba5d('0x91')]===_0x203993[_0xba5d('0x76')];});if(!_0x1c793d){logger['info'](util[_0xba5d('0x35')](_0xba5d('0x92'),_0x1c1f4e[_0xba5d('0x4a')]['id'],_0x203993[_0xba5d('0x76')]));return createBucket(_0xe7cf66[_0xba5d('0x8f')],_0xe7cf66[_0xba5d('0x8d')],_0x203993[_0xba5d('0x83')],_0x203993[_0xba5d('0x76')]);}logger[_0xba5d('0x68')](util[_0xba5d('0x35')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x1c1f4e['params']['id'],_0x203993['bucket']));return;}})[_0xba5d('0x27')](function(_0x1d43ac){if(_0x18a2e2[_0xba5d('0x93')]===_0xba5d('0x94')){return transcribe(_0x1c1f4e['params']['id'],_0xe7cf66['data1'],_0xe7cf66[_0xba5d('0x8d')],_0x203993[_0xba5d('0x83')],_0x203993[_0xba5d('0x76')],_0x18a2e2[_0xba5d('0x51')],_0x203993['language']);}else{logger['info'](util[_0xba5d('0x35')](_0xba5d('0x95'),_0x1c1f4e[_0xba5d('0x4a')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xba5d('0x27')](function(_0xe16647){if(_0xe16647){_0xe16647[_0xba5d('0x96')]=_0x1c1f4e['body'][_0xba5d('0x85')];return _0x18a2e2[_0xba5d('0x97')](_0xe16647);}})[_0xba5d('0x27')](respondWithResult(_0x219504,null))[_0xba5d('0x4c')](handleError(_0x219504,null));};function writeFile(_0x153d87,_0x1242fc){return new Promise(function(_0x38965c,_0xbc84db){fs[_0xba5d('0x98')](_0x1242fc,_0x153d87,function(_0x44b213,_0x119cda){if(_0x44b213){return _0xbc84db(_0x44b213);}else{return _0x38965c(_0x119cda);}});});}exports[_0xba5d('0x99')]=function(_0x3764f1,_0xcb3cd8,_0x4abe3d){return db[_0xba5d('0x2f')]['findOne']({'where':{'id':_0x3764f1['params']['id']}})['then'](handleEntityNotFound(_0xcb3cd8))[_0xba5d('0x27')](function(_0x4d1f5d){if(_0x4d1f5d&&_0x4d1f5d[_0xba5d('0x9a')]){var _0x48a81e=_0x4d1f5d[_0xba5d('0x9a')];var _0x353847=config['root']+'/server/files/transcribes/transcribe_'+_0x4d1f5d['id']+_0xba5d('0x9b');if(fs[_0xba5d('0x52')](_0x353847)){return _0x353847;}return writeFile(_0x48a81e,_0x353847)['then'](function(){return _0x353847;});}else{throw new db[(_0xba5d('0x56'))]['ValidationError'](_0xba5d('0x9c'));}})['then'](function(_0x2bed11){return _0xcb3cd8[_0xba5d('0x5a')](_0x2bed11);})[_0xba5d('0x4c')](handleError(_0xcb3cd8));};
\ No newline at end of file
+var _0x80d9=['attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','include','find','create','body','describe','download','../../components/encryptor','uniqueid','value','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','unlinkSync','listBuckets','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','%s.cypher','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','bucket','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','tempSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','reject','save','update','then','destroy','error','send','index','VoiceRecording','rawAttributes','fieldName','type','model','map','name','format','query','keys','filters','intersection'];(function(_0x4c3f7d,_0x56ce39){var _0x48c013=function(_0x49e4ef){while(--_0x49e4ef){_0x4c3f7d['push'](_0x4c3f7d['shift']());}};_0x48c013(++_0x56ce39);}(_0x80d9,0xf8));var _0x980d=function(_0x2dad2a,_0xd3b06d){_0x2dad2a=_0x2dad2a-0x0;var _0x7c74e6=_0x80d9[_0x2dad2a];return _0x7c74e6;};'use strict';var emlformat=require(_0x980d('0x0'));var rimraf=require(_0x980d('0x1'));var zipdir=require(_0x980d('0x2'));var jsonpatch=require(_0x980d('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x980d('0x4'));var Mustache=require(_0x980d('0x5'));var util=require(_0x980d('0x6'));var path=require(_0x980d('0x7'));var sox=require(_0x980d('0x8'));var csv=require(_0x980d('0x9'));var ejs=require(_0x980d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x980d('0xb'));var squel=require('squel');var crypto=require(_0x980d('0xc'));var jsforce=require(_0x980d('0xd'));var deskjs=require(_0x980d('0xe'));var toCsv=require(_0x980d('0x9'));var querystring=require(_0x980d('0xf'));var Papa=require('papaparse');var AWS=require(_0x980d('0x10'));var uuidv4=require(_0x980d('0x11'));var Redis=require(_0x980d('0x12'));var authService=require(_0x980d('0x13'));var qs=require(_0x980d('0x14'));var as=require(_0x980d('0x15'));var hardwareService=require(_0x980d('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x980d('0x17'));var licenseUtil=require(_0x980d('0x18'));var db=require(_0x980d('0x19'))['db'];function respondWithStatusCode(_0x2c5770,_0xbc6574){_0xbc6574=_0xbc6574||0xcc;return function(_0x493de2){if(_0x493de2){return _0x2c5770[_0x980d('0x1a')](_0xbc6574);}return _0x2c5770[_0x980d('0x1b')](_0xbc6574)[_0x980d('0x1c')]();};}function respondWithResult(_0xa8a4ae,_0x1cd243){_0x1cd243=_0x1cd243||0xc8;return function(_0xd449ec){if(_0xd449ec){return _0xa8a4ae[_0x980d('0x1b')](_0x1cd243)[_0x980d('0x1d')](_0xd449ec);}};}function respondWithFilteredResult(_0x1e39ac,_0xae40bc){return function(_0x1bccd3){if(_0x1bccd3){var _0x6f562b=typeof _0xae40bc['offset']==='undefined'&&typeof _0xae40bc[_0x980d('0x1e')]===_0x980d('0x1f');var _0x396044=_0x1bccd3[_0x980d('0x20')];var _0xaa08fe=_0x6f562b?0x0:_0xae40bc['offset'];var _0x4e6c27=_0x6f562b?_0x1bccd3['count']:_0xae40bc[_0x980d('0x21')]+_0xae40bc[_0x980d('0x1e')];var _0x7b6c88;if(_0x4e6c27>=_0x396044){_0x4e6c27=_0x396044;_0x7b6c88=0xc8;}else{_0x7b6c88=0xce;}_0x1e39ac['status'](_0x7b6c88);return _0x1e39ac['set']('Content-Range',_0xaa08fe+'-'+_0x4e6c27+'/'+_0x396044)[_0x980d('0x1d')](_0x1bccd3);}return null;};}function patchUpdates(_0x56386b){return function(_0x57cf7c){try{jsonpatch['apply'](_0x57cf7c,_0x56386b,!![]);}catch(_0x51dffa){return BPromise[_0x980d('0x22')](_0x51dffa);}return _0x57cf7c[_0x980d('0x23')]();};}function saveUpdates(_0x4edeb4,_0xf9e634){return function(_0x58fd41){if(_0x58fd41){return _0x58fd41[_0x980d('0x24')](_0x4edeb4)[_0x980d('0x25')](function(_0x4f0525){return _0x4f0525;});}return null;};}function removeEntity(_0x112b91,_0x2e6463){return function(_0x10a543){if(_0x10a543){return _0x10a543[_0x980d('0x26')]()[_0x980d('0x25')](function(){_0x112b91['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x341a50,_0x22960e){return function(_0x22e643){if(!_0x22e643){_0x341a50[_0x980d('0x1a')](0x194);}return _0x22e643;};}function handleError(_0x14df4c,_0x277f71){_0x277f71=_0x277f71||0x1f4;return function(_0x5132a8){logger[_0x980d('0x27')](_0x5132a8['stack']);if(_0x5132a8['name']){delete _0x5132a8['name'];}_0x14df4c[_0x980d('0x1b')](_0x277f71)[_0x980d('0x28')](_0x5132a8);};}exports[_0x980d('0x29')]=function(_0x12df55,_0x31c071){var _0x25eb38={},_0x2c069f={},_0x1bbb90={'count':0x0,'rows':[]};var _0x14d6c9=_['map'](db[_0x980d('0x2a')][_0x980d('0x2b')],function(_0x20fa1a){return{'name':_0x20fa1a[_0x980d('0x2c')],'type':_0x20fa1a[_0x980d('0x2d')]['key']};});_0x2c069f[_0x980d('0x2e')]=_['differenceBy'](_[_0x980d('0x2f')](_0x14d6c9,_0x980d('0x30')),[_0x980d('0x31')]);_0x2c069f[_0x980d('0x32')]=_[_0x980d('0x33')](_0x12df55[_0x980d('0x32')]);_0x2c069f[_0x980d('0x34')]=_[_0x980d('0x35')](_0x2c069f[_0x980d('0x2e')],_0x2c069f['query']);_0x25eb38[_0x980d('0x36')]=_['intersection'](_0x2c069f['model'],qs[_0x980d('0x37')](_0x12df55[_0x980d('0x32')][_0x980d('0x37')]));_0x25eb38[_0x980d('0x36')]=_0x25eb38[_0x980d('0x36')]['length']?_0x25eb38['attributes']:_0x2c069f[_0x980d('0x2e')];if(!_0x12df55[_0x980d('0x32')][_0x980d('0x38')](_0x980d('0x39'))){_0x25eb38[_0x980d('0x1e')]=qs['limit'](_0x12df55[_0x980d('0x32')][_0x980d('0x1e')]);_0x25eb38[_0x980d('0x21')]=qs[_0x980d('0x21')](_0x12df55[_0x980d('0x32')]['offset']);}_0x25eb38['order']=qs['sort'](_0x12df55[_0x980d('0x32')][_0x980d('0x3a')]);_0x25eb38[_0x980d('0x3b')]=qs['filters'](_[_0x980d('0x3c')](_0x12df55[_0x980d('0x32')],_0x2c069f[_0x980d('0x34')]),_0x14d6c9);if(_0x12df55[_0x980d('0x32')][_0x980d('0x3d')]){_0x25eb38['where']=_[_0x980d('0x3e')](_0x25eb38['where'],{'$or':_[_0x980d('0x2f')](_0x14d6c9,function(_0x13abba){if(_0x13abba[_0x980d('0x2d')]!==_0x980d('0x3f')){var _0x2c8a93={};_0x2c8a93[_0x13abba['name']]={'$like':'%'+_0x12df55[_0x980d('0x32')][_0x980d('0x3d')]+'%'};return _0x2c8a93;}})});}_0x25eb38=_['merge']({},_0x25eb38,_0x12df55[_0x980d('0x40')]);var _0x568afb={'where':_0x25eb38[_0x980d('0x3b')]};return db[_0x980d('0x2a')]['count'](_0x568afb)[_0x980d('0x25')](function(_0x1dad13){_0x1bbb90['count']=_0x1dad13;if(_0x12df55['query'][_0x980d('0x41')]){_0x25eb38['include']=[{'all':!![]}];}return db[_0x980d('0x2a')]['findAll'](_0x25eb38);})['then'](function(_0x380488){_0x1bbb90[_0x980d('0x42')]=_0x380488;return _0x1bbb90;})['then'](respondWithFilteredResult(_0x31c071,_0x25eb38))[_0x980d('0x43')](handleError(_0x31c071,null));};exports['show']=function(_0x4263c7,_0x18d82f){var _0x1f4817={'raw':![],'where':{'id':_0x4263c7[_0x980d('0x44')]['id']}},_0x3af660={};_0x3af660[_0x980d('0x2e')]=_['keys'](db[_0x980d('0x2a')][_0x980d('0x2b')]);_0x3af660['query']=_[_0x980d('0x33')](_0x4263c7[_0x980d('0x32')]);_0x3af660[_0x980d('0x34')]=_['intersection'](_0x3af660[_0x980d('0x2e')],_0x3af660[_0x980d('0x32')]);_0x1f4817['attributes']=_['intersection'](_0x3af660[_0x980d('0x2e')],qs['fields'](_0x4263c7['query'][_0x980d('0x37')]));_0x1f4817[_0x980d('0x36')]=_0x1f4817['attributes']['length']?_0x1f4817[_0x980d('0x36')]:_0x3af660[_0x980d('0x2e')];if(_0x4263c7['query']['includeAll']){_0x1f4817[_0x980d('0x45')]=[{'all':!![]}];}_0x1f4817=_['merge']({},_0x1f4817,_0x4263c7['options']);return db[_0x980d('0x2a')][_0x980d('0x46')](_0x1f4817)[_0x980d('0x25')](handleEntityNotFound(_0x18d82f,null))[_0x980d('0x25')](respondWithResult(_0x18d82f,null))[_0x980d('0x43')](handleError(_0x18d82f,null));};exports[_0x980d('0x47')]=function(_0x13b37e,_0x23233d){return db['VoiceRecording'][_0x980d('0x47')](_0x13b37e['body'],{})[_0x980d('0x25')](respondWithResult(_0x23233d,0xc9))[_0x980d('0x43')](handleError(_0x23233d,null));};exports[_0x980d('0x24')]=function(_0x29a047,_0x3b8633){if(_0x29a047[_0x980d('0x48')]['id']){delete _0x29a047[_0x980d('0x48')]['id'];}return db[_0x980d('0x2a')][_0x980d('0x46')]({'where':{'id':_0x29a047[_0x980d('0x44')]['id']}})[_0x980d('0x25')](handleEntityNotFound(_0x3b8633,null))[_0x980d('0x25')](saveUpdates(_0x29a047[_0x980d('0x48')],null))['then'](respondWithResult(_0x3b8633,null))[_0x980d('0x43')](handleError(_0x3b8633,null));};exports[_0x980d('0x49')]=function(_0x8d8207,_0x4bf7c4){return db[_0x980d('0x2a')][_0x980d('0x49')]()['then'](respondWithResult(_0x4bf7c4,null))[_0x980d('0x43')](handleError(_0x4bf7c4,null));};exports[_0x980d('0x4a')]=function(_0x7853a1,_0x43fa0b,_0x53536b){var _0x15ed24=require(_0x980d('0x4b'));var _0x2e831f=![];var _0x5b009a={};if(_0x7853a1[_0x980d('0x32')][_0x980d('0x2d')]&&_0x7853a1[_0x980d('0x32')]['type']===_0x980d('0x4c')){_0x5b009a['uniqueid']=_0x7853a1['params']['id'];}else{_0x5b009a['id']=_0x7853a1[_0x980d('0x44')]['id'];}return db['VoiceRecording'][_0x980d('0x46')]({'where':_0x5b009a,'attributes':['id',_0x980d('0x4d')],'raw':!![]})[_0x980d('0x25')](handleEntityNotFound(_0x43fa0b,null))[_0x980d('0x25')](function(_0x5b4c2f){if(_0x5b4c2f){var _0x24803d=_0x5b4c2f[_0x980d('0x4d')];var _0x3e1544=util[_0x980d('0x31')]('%s.cypher',_0x24803d);if(fs['existsSync'](_0x3e1544)){_0x2e831f=!![];return _0x15ed24[_0x980d('0x4e')](_0x3e1544,_0x24803d,config[_0x980d('0x4f')][_0x980d('0x50')])[_0x980d('0x25')](function(){return _0x5b4c2f;});}return _0x5b4c2f;}})['then'](function(_0x28a326){if(_0x28a326){var _0x4a57d5=_0x28a326[_0x980d('0x4d')];if(!fs[_0x980d('0x51')](_0x4a57d5)){throw new db[(_0x980d('0x52'))][(_0x980d('0x53'))](_0x980d('0x54'));}if(_0x28a326['filename']){return _0x43fa0b[_0x980d('0x4a')](_0x4a57d5,_0x28a326[_0x980d('0x55')]+path[_0x980d('0x56')](_0x4a57d5),function(){if(_0x2e831f){fs[_0x980d('0x57')](_0x4a57d5);}});}else{return _0x43fa0b[_0x980d('0x4a')](_0x4a57d5,function(_0x4f744b){if(_0x2e831f){fs[_0x980d('0x57')](_0x4a57d5);}});}}})['catch'](function(_0x586299){if(_0x586299[_0x980d('0x58')]===_0x980d('0x54')){_0x43fa0b[_0x980d('0x1b')](0x194)[_0x980d('0x28')](_0x980d('0x59'));}else{return handleError(_0x43fa0b,null);}});};exports[_0x980d('0x5a')]=function(_0x54359a,_0x53f04c,_0x409334){var _0x4ef7a6=require('../../components/encryptor');var _0x2af8e8=![];var _0x34f784={'$and':[db[_0x980d('0x5b')]['where'](db[_0x980d('0x5b')]['fn'](_0x980d('0x5c'),db['sequelize'][_0x980d('0x5d')](_0x980d('0x4c'))),_0x54359a[_0x980d('0x32')][_0x980d('0x5e')])]};if(_0x54359a[_0x980d('0x32')]['type']&&_0x54359a['query'][_0x980d('0x2d')]===_0x980d('0x4c')){_0x34f784[_0x980d('0x5f')][_0x980d('0x60')]({'uniqueid':_0x54359a[_0x980d('0x44')]['id']});}else{_0x34f784[_0x980d('0x5f')][_0x980d('0x60')]({'id':_0x54359a[_0x980d('0x44')]['id']});}return db['VoiceRecording'][_0x980d('0x46')]({'where':_0x34f784,'attributes':['id',_0x980d('0x4d')],'raw':!![]})['then'](handleEntityNotFound(_0x53f04c,null))[_0x980d('0x25')](function(_0x3b5940){if(_0x3b5940){var _0x384aa0=util['format']('%s.cypher',_0x3b5940['value']);if(fs[_0x980d('0x51')](_0x384aa0)){_0x2af8e8=!![];return _0x4ef7a6[_0x980d('0x4e')](_0x384aa0,_0x3b5940[_0x980d('0x4d')],config[_0x980d('0x4f')][_0x980d('0x50')])[_0x980d('0x25')](function(){return _0x3b5940;});}return _0x3b5940;}})['then'](function(_0x504bcc){if(_0x504bcc){if(!fs[_0x980d('0x51')](_0x504bcc['value'])){throw new db['Sequelize']['ValidationError'](_0x980d('0x54'));}if(_0x504bcc['filename']){return _0x53f04c[_0x980d('0x4a')](_0x504bcc['value'],_0x504bcc[_0x980d('0x55')]+path[_0x980d('0x56')](_0x504bcc[_0x980d('0x4d')]),function(){if(_0x2af8e8){fs[_0x980d('0x57')](_0x504bcc['value']);}});}else{return _0x53f04c['download'](_0x504bcc[_0x980d('0x4d')],function(_0x92b926){if(_0x2af8e8){fs[_0x980d('0x57')](_0x504bcc[_0x980d('0x4d')]);}});}}})['catch'](handleError(_0x53f04c,null));};exports[_0x980d('0x26')]=function(_0x2107ce,_0x544b2c){return db[_0x980d('0x2a')][_0x980d('0x46')]({'where':{'id':_0x2107ce['params']['id']}})[_0x980d('0x25')](function(_0x54e943){if(_[_0x980d('0x61')](_0x54e943)){throw new ReferenceError(_0x980d('0x62'));}return _0x54e943;})[_0x980d('0x25')](function(_0x2f975f){var _0x3659cd=_0x2f975f[_0x980d('0x4d')];logger['info'](_0x980d('0x63'),_0x3659cd);if(!_[_0x980d('0x61')](_0x2f975f[_0x980d('0x4d')])&&fs[_0x980d('0x51')](_0x3659cd)){logger[_0x980d('0x64')]('File:\x20\x22'+_0x3659cd+_0x980d('0x65'));fs['unlinkSync'](_0x3659cd);}_0x3659cd=_0x3659cd+_0x980d('0x66');if(!_[_0x980d('0x61')](_0x2f975f['value'])&&fs['existsSync'](_0x3659cd)){logger[_0x980d('0x64')](_0x980d('0x67')+_0x3659cd+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x980d('0x68')](_0x3659cd);}return _0x2f975f;})['then'](function(_0x4ff5bd){if(!_0x4ff5bd)throw new InternalError();return _0x4ff5bd[_0x980d('0x26')]();})[_0x980d('0x25')](function(){_0x544b2c[_0x980d('0x1b')](0xcc)[_0x980d('0x1c')]();})['catch'](handleError(_0x544b2c,null));};function getBucketslist(_0x1861fa,_0x1f7d69,_0x2e56db){return new Promise(function(_0x461603,_0x18a175){var _0x3936bb=new AWS['S3']({'accessKeyId':_0x1f7d69,'secretAccessKey':_0x1861fa,'region':_0x2e56db});_0x3936bb[_0x980d('0x69')]({},function(_0x3cff8a,_0x4cd0f2){if(_0x3cff8a){return _0x18a175(_0x3cff8a);}else{return _0x461603(_0x4cd0f2);}});});}function createBucket(_0xc24b29,_0x3944a2,_0x598931,_0x1be551){return new Promise(function(_0x39372d,_0x127899){var _0x48445b=new AWS['S3']({'accessKeyId':_0x3944a2,'secretAccessKey':_0xc24b29,'region':_0x598931});_0x48445b[_0x980d('0x6a')]({'Bucket':_0x1be551},function(_0x2c0dfe,_0x34bd5d){if(_0x2c0dfe){return _0x127899(_0x2c0dfe);}else{return _0x39372d(_0x34bd5d);}});});}function uploadFile(_0x4193b0,_0x163fea,_0x1d84ce,_0x4a095a,_0x21a774,_0xde4bd9){return new Promise(function(_0x20b209,_0x262117){var _0x14f299=new AWS['S3']({'accessKeyId':_0x163fea,'secretAccessKey':_0x4193b0,'region':_0x1d84ce});_0x14f299['upload']({'Bucket':_0x4a095a,'Key':_0x21a774,'Body':_0xde4bd9},function(_0x4e492a,_0x4a510c){if(_0x4e492a){return _0x262117(_0x4e492a);}else{return _0x20b209(_0x4a510c);}});});}function startTranscribe(_0x2ad9a6,_0x416b85,_0x426694,_0x281df3,_0x581036,_0x5330dc){return new Promise(function(_0x16ad00,_0x2d692a){var _0xfb9f22=new AWS[(_0x980d('0x6b'))]({'accessKeyId':_0x416b85,'secretAccessKey':_0x2ad9a6,'region':_0x426694});_0xfb9f22[_0x980d('0x6c')]({'TranscriptionJobName':_0x281df3,'LanguageCode':_0x581036,'Media':{'MediaFileUri':_0x5330dc}},function(_0x282bbc,_0x38a8a8){if(_0x282bbc){return _0x2d692a(_0x282bbc);}else{return _0x16ad00(_0x38a8a8);}});});}function transcribe(_0x29adfd,_0x224e4b,_0x178dcb,_0x4a4fbc,_0x4ce7e6,_0x1b74d1,_0xe5f4bd){return new Promise(function(_0x5c9d88,_0x51dbf6){var _0x47b04c={};logger[_0x980d('0x64')](util[_0x980d('0x31')](_0x980d('0x6d'),_0x29adfd,_0x4ce7e6));return uploadFile(_0x224e4b,_0x178dcb,_0x4a4fbc,_0x4ce7e6,path[_0x980d('0x6e')](_0x1b74d1),fs[_0x980d('0x6f')](_0x1b74d1))[_0x980d('0x25')](function(_0x54f544){logger[_0x980d('0x64')](util[_0x980d('0x31')](_0x980d('0x70'),_0x29adfd,_0x4ce7e6,_0x54f544['Location']));_0x47b04c['bucket']=_0x54f544[_0x980d('0x71')];_0x47b04c[_0x980d('0x72')]=_0x54f544[_0x980d('0x73')];logger['info'](util[_0x980d('0x31')](_0x980d('0x74'),_0x29adfd));return startTranscribe(_0x224e4b,_0x178dcb,_0x4a4fbc,uuidv4(),_0xe5f4bd,_0x54f544['Location']);})[_0x980d('0x25')](function(_0x150573){logger['info'](util[_0x980d('0x31')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x29adfd,_0x150573[_0x980d('0x75')][_0x980d('0x76')]));_0x47b04c[_0x980d('0x77')]=_0x150573[_0x980d('0x75')]['TranscriptionJobName'];_0x47b04c[_0x980d('0x78')]=_0x150573[_0x980d('0x75')][_0x980d('0x79')];return _0x5c9d88(_0x47b04c);})[_0x980d('0x43')](function(_0x269d9f){return _0x51dbf6(_0x269d9f);});});}exports[_0x980d('0x7a')]=function(_0x41f9a4,_0x3187d9,_0x45bf28){var _0x1f682b;var _0xd3aed2;var _0x267edf;var _0x461a04=require(_0x980d('0x4b'));return db[_0x980d('0x2a')][_0x980d('0x7b')]({'where':{'id':_0x41f9a4[_0x980d('0x44')]['id']}})[_0x980d('0x25')](function(_0x5ea5a1){if(_0x5ea5a1){var _0x52e6ad=util['format'](_0x980d('0x7c'),_0x5ea5a1[_0x980d('0x4d')]);if(fs[_0x980d('0x51')](_0x52e6ad)){cypher=!![];return _0x461a04[_0x980d('0x4e')](_0x52e6ad,_0x5ea5a1[_0x980d('0x4d')],config[_0x980d('0x4f')]['recording'])[_0x980d('0x25')](function(){return _0x5ea5a1;});}return _0x5ea5a1;}})[_0x980d('0x25')](function(_0x46206f){if(!_0x46206f){throw new db[(_0x980d('0x52'))][(_0x980d('0x53'))](_0x980d('0x7d'));}_0xd3aed2=_0x46206f;return db[_0x980d('0x7e')][_0x980d('0x7b')]({'where':{'id':0x1}});})[_0x980d('0x25')](handleEntityNotFound(_0x3187d9,null))[_0x980d('0x25')](function(_0x2c7349){if(_0x2c7349){_0x1f682b=_0x2c7349;if(!_0x1f682b[_0x980d('0x7f')]||!_0x1f682b[_0x980d('0x80')]||!_0x1f682b[_0x980d('0x81')]||!_0x1f682b[_0x980d('0x82')]||!_0x1f682b[_0x980d('0x83')]){throw new db[(_0x980d('0x52'))][(_0x980d('0x53'))]('Transcribe\x20not\x20configured');}if(_0x41f9a4['body'][_0x980d('0x84')]&&(!_0x1f682b[_0x980d('0x85')]||!_0x1f682b[_0x980d('0x86')]||!_0x1f682b[_0x980d('0x87')]||!_0x1f682b[_0x980d('0x82')]||!_0x1f682b[_0x980d('0x83')])){throw new db[(_0x980d('0x52'))]['ValidationError'](_0x980d('0x88'));}return db['CloudProvider'][_0x980d('0x7b')]({'where':{'id':_0x1f682b[_0x980d('0x80')]}});}})[_0x980d('0x25')](function(_0x3ca5e8){if(!_0x3ca5e8){throw new db[(_0x980d('0x52'))][(_0x980d('0x53'))](_0x980d('0x89'));}if(!_0x3ca5e8[_0x980d('0x8a')]||!_0x3ca5e8[_0x980d('0x8b')]){throw new db[(_0x980d('0x52'))][(_0x980d('0x53'))](_0x980d('0x8c'));}_0x267edf=_0x3ca5e8;return getBucketslist(_0x267edf['data1'],_0x267edf['data2'],_0x1f682b[_0x980d('0x81')]);})[_0x980d('0x25')](function(_0xedca5e){if(_0xedca5e&&_0xedca5e[_0x980d('0x8d')]){var _0x130808=_[_0x980d('0x46')](_0xedca5e[_0x980d('0x8d')],function(_0x47929a){return _0x47929a[_0x980d('0x8e')]===_0x1f682b[_0x980d('0x83')];});if(!_0x130808){logger[_0x980d('0x64')](util[_0x980d('0x31')](_0x980d('0x8f'),_0x41f9a4[_0x980d('0x44')]['id'],_0x1f682b['bucket']));return createBucket(_0x267edf['data1'],_0x267edf[_0x980d('0x8b')],_0x1f682b[_0x980d('0x81')],_0x1f682b[_0x980d('0x83')]);}logger[_0x980d('0x64')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x41f9a4['params']['id'],_0x1f682b['bucket']));return;}})['then'](function(_0x1b4991){if(_0xd3aed2[_0x980d('0x78')]==='NEW'){return transcribe(_0x41f9a4[_0x980d('0x44')]['id'],_0x267edf[_0x980d('0x8a')],_0x267edf[_0x980d('0x8b')],_0x1f682b[_0x980d('0x81')],_0x1f682b[_0x980d('0x83')],_0xd3aed2['value'],_0x1f682b['language']);}else{logger[_0x980d('0x64')](util[_0x980d('0x31')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x41f9a4[_0x980d('0x44')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x980d('0x25')](function(_0x3353c0){if(_0x3353c0){_0x3353c0[_0x980d('0x90')]=_0x41f9a4['body'][_0x980d('0x84')];return _0xd3aed2['updateAttributes'](_0x3353c0);}})['then'](respondWithResult(_0x3187d9,null))['catch'](handleError(_0x3187d9,null));};function writeFile(_0x6faba0,_0x5f50b0){return new Promise(function(_0x44cddb,_0x4f5412){fs[_0x980d('0x91')](_0x5f50b0,_0x6faba0,function(_0xa10dd7,_0x514546){if(_0xa10dd7){return _0x4f5412(_0xa10dd7);}else{return _0x44cddb(_0x514546);}});});}exports[_0x980d('0x92')]=function(_0x161ffd,_0x12691c,_0x3683d3){return db['VoiceRecording'][_0x980d('0x7b')]({'where':{'id':_0x161ffd[_0x980d('0x44')]['id']}})[_0x980d('0x25')](handleEntityNotFound(_0x12691c))['then'](function(_0x26ea30){if(_0x26ea30&&_0x26ea30[_0x980d('0x93')]){var _0x2e569e=_0x26ea30[_0x980d('0x93')];var _0x2646ff=config[_0x980d('0x94')]+_0x980d('0x95')+_0x26ea30['id']+_0x980d('0x96');if(fs[_0x980d('0x51')](_0x2646ff)){return _0x2646ff;}return writeFile(_0x2e569e,_0x2646ff)[_0x980d('0x25')](function(){return _0x2646ff;});}else{throw new db[(_0x980d('0x52'))][(_0x980d('0x53'))]('Transcript\x20not\x20available');}})['then'](function(_0x3cc102){return _0x12691c['download'](_0x3cc102);})['catch'](handleError(_0x12691c));};
\ No newline at end of file
index f92c167..2091a33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6f9=['request-promise','path','../../config/environment','./voiceRecording.attributes','exports','voice_recordings','uniqueid','lodash','util','moment','bluebird'];(function(_0x52f1e6,_0xf70489){var _0x21f104=function(_0xb89f9e){while(--_0xb89f9e){_0x52f1e6['push'](_0x52f1e6['shift']());}};_0x21f104(++_0xf70489);}(_0xd6f9,0x1ca));var _0x9d6f=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0xd6f9[_0x2d9c6a];return _0xf3c918;};'use strict';var _=require(_0x9d6f('0x0'));var util=require(_0x9d6f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9d6f('0x2'));var BPromise=require(_0x9d6f('0x3'));var rp=require(_0x9d6f('0x4'));var fs=require('fs');var path=require(_0x9d6f('0x5'));var rimraf=require('rimraf');var config=require(_0x9d6f('0x6'));var attributes=require(_0x9d6f('0x7'));module[_0x9d6f('0x8')]=function(_0x5ec60d,_0x12d741){return _0x5ec60d['define']('VoiceRecording',attributes,{'tableName':_0x9d6f('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9d6f('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe354=['../../config/environment','./voiceRecording.attributes','exports','define','voice_recordings','uniqueid','../../config/logger','api','bluebird','path','rimraf'];(function(_0x4b8a07,_0x325eeb){var _0x805316=function(_0x1c8eec){while(--_0x1c8eec){_0x4b8a07['push'](_0x4b8a07['shift']());}};_0x805316(++_0x325eeb);}(_0xe354,0x187));var _0x4e35=function(_0x412cd8,_0x5b8bfe){_0x412cd8=_0x412cd8-0x0;var _0x336d1e=_0xe354[_0x412cd8];return _0x336d1e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4e35('0x0'))(_0x4e35('0x1'));var moment=require('moment');var BPromise=require(_0x4e35('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e35('0x3'));var rimraf=require(_0x4e35('0x4'));var config=require(_0x4e35('0x5'));var attributes=require(_0x4e35('0x6'));module[_0x4e35('0x7')]=function(_0x985806,_0x2429b3){return _0x985806[_0x4e35('0x8')]('VoiceRecording',attributes,{'tableName':_0x4e35('0x9'),'paranoid':![],'indexes':[{'name':_0x4e35('0xa'),'fields':[_0x4e35('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index bc6054b..64dafab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x323f=['UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','catch','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x2af4a0,_0x1f29e7){var _0x56bf44=function(_0x36c38f){while(--_0x36c38f){_0x2af4a0['push'](_0x2af4a0['shift']());}};_0x56bf44(++_0x1f29e7);}(_0x323f,0x1ee));var _0xf323=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x323f[_0x5bd426];return _0x23a7eb;};'use strict';var _=require('lodash');var util=require(_0xf323('0x0'));var moment=require('moment');var BPromise=require(_0xf323('0x1'));var rs=require(_0xf323('0x2'));var fs=require('fs');var Redis=require(_0xf323('0x3'));var db=require(_0xf323('0x4'))['db'];var utils=require(_0xf323('0x5'));var logger=require(_0xf323('0x6'))(_0xf323('0x7'));var config=require(_0xf323('0x8'));var jayson=require(_0xf323('0x9'));var client=jayson[_0xf323('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb9a667,_0x444cba,_0x1af70d){return new BPromise(function(_0x2c8271,_0x8abeac){return client[_0xf323('0xb')](_0xb9a667,_0x1af70d)[_0xf323('0xc')](function(_0x2b24a2){logger[_0xf323('0xd')](_0xf323('0xe'),_0x444cba,_0xf323('0xf'));logger[_0xf323('0x10')](_0xf323('0x11'),_0x444cba,_0xf323('0xf'),JSON[_0xf323('0x12')](_0x2b24a2));if(_0x2b24a2[_0xf323('0x13')]){if(_0x2b24a2[_0xf323('0x13')]['code']===0x1f4){logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0x2b24a2[_0xf323('0x13')]['message']);return _0x8abeac(_0x2b24a2[_0xf323('0x13')][_0xf323('0x14')]);}logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0x2b24a2[_0xf323('0x13')][_0xf323('0x14')]);return _0x2c8271(_0x2b24a2['error']['message']);}else{logger[_0xf323('0xd')](_0xf323('0xe'),_0x444cba,_0xf323('0xf'));_0x2c8271(_0x2b24a2[_0xf323('0x15')][_0xf323('0x14')]);}})['catch'](function(_0xd6c25){logger[_0xf323('0x13')](_0xf323('0xe'),_0x444cba,_0xd6c25);_0x8abeac(_0xd6c25);});});}exports[_0xf323('0x16')]=function(_0x49b115){var _0x2db977=this;return new Promise(function(_0x272aec,_0x1a459d){return db[_0xf323('0x17')]['update'](_0x49b115[_0xf323('0x18')],{'raw':_0x49b115[_0xf323('0x19')]?_0x49b115['options'][_0xf323('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49b115[_0xf323('0x19')]?_0x49b115[_0xf323('0x19')][_0xf323('0x1b')]||null:null,'attributes':_0x49b115['options']?_0x49b115[_0xf323('0x19')][_0xf323('0x1c')]||null:null,'limit':_0x49b115[_0xf323('0x19')]?_0x49b115['options'][_0xf323('0x1d')]||null:null})[_0xf323('0xc')](function(_0x3e1c49){logger[_0xf323('0xd')](_0xf323('0x16'),_0x49b115);logger[_0xf323('0x10')](_0xf323('0x16'),_0x49b115,JSON[_0xf323('0x12')](_0x3e1c49));_0x272aec(_0x3e1c49);})[_0xf323('0x1e')](function(_0x47fb15){logger[_0xf323('0x13')](_0xf323('0x16'),_0x47fb15[_0xf323('0x14')],_0x49b115);_0x1a459d(_0x2db977[_0xf323('0x13')](0x1f4,_0x47fb15[_0xf323('0x14')]));});});};exports[_0xf323('0x1f')]=function(_0x4d737d){var _0x30ed93=this;return new Promise(function(_0x56ce33,_0x1570d4){var _0x3902eb=require('../../components/encryptor');var _0x46663b;return db[_0xf323('0x20')][_0xf323('0x21')]({'attributes':['id',_0xf323('0x22')],'where':{'id':0x1},'raw':!![]})[_0xf323('0xc')](function(_0x5b8b60){_0x46663b=_0x5b8b60;return db[_0xf323('0x17')][_0xf323('0x23')](_0x4d737d[_0xf323('0x18')]);})[_0xf323('0xc')](function(_0x4260f3){if(_0x46663b[_0xf323('0x22')]&&fs[_0xf323('0x24')](_0x4260f3[_0xf323('0x25')])){var _0x139adc=util['format'](_0xf323('0x26'),_0x4260f3[_0xf323('0x25')]);return _0x3902eb[_0xf323('0x27')](_0x4260f3[_0xf323('0x25')],_0x139adc,config[_0xf323('0x28')]['recording'])[_0xf323('0xc')](function(){fs[_0xf323('0x29')](_0x4260f3[_0xf323('0x25')]);logger[_0xf323('0xd')](_0xf323('0x2a'));return _0x4260f3;});}return _0x4260f3;})['then'](function(_0x33487c){logger[_0xf323('0xd')](_0xf323('0x1f'),_0x4d737d);logger[_0xf323('0x10')]('CreateVoiceRecording',_0x4d737d,JSON[_0xf323('0x12')](_0x33487c));_0x56ce33(_0x33487c);})['catch'](function(_0x372c47){logger[_0xf323('0x13')]('CreateVoiceRecording',_0x372c47[_0xf323('0x14')],_0x4d737d);_0x1570d4(_0x30ed93['error'](0x1f4,_0x372c47[_0xf323('0x14')]));});});};
\ No newline at end of file
+var _0x0120=['attributes','limit','then','debug','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','format','value','encryptFile','secrets','recording','unlink','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateVoiceRecording','update','body','options','raw'];(function(_0x18544c,_0x1b72c3){var _0x20a99c=function(_0x4dc9a7){while(--_0x4dc9a7){_0x18544c['push'](_0x18544c['shift']());}};_0x20a99c(++_0x1b72c3);}(_0x0120,0x6f));var _0x0012=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0120[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var moment=require(_0x0012('0x2'));var BPromise=require(_0x0012('0x3'));var rs=require(_0x0012('0x4'));var fs=require('fs');var Redis=require(_0x0012('0x5'));var db=require(_0x0012('0x6'))['db'];var utils=require(_0x0012('0x7'));var logger=require(_0x0012('0x8'))(_0x0012('0x9'));var config=require(_0x0012('0xa'));var jayson=require(_0x0012('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59980a,_0x95d441,_0x436af8){return new BPromise(function(_0x3d4c64,_0x30176d){return client[_0x0012('0xc')](_0x59980a,_0x436af8)['then'](function(_0x14991f){logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));logger['debug'](_0x0012('0x10'),_0x95d441,'request\x20sent',JSON[_0x0012('0x11')](_0x14991f));if(_0x14991f[_0x0012('0x12')]){if(_0x14991f[_0x0012('0x12')][_0x0012('0x13')]===0x1f4){logger[_0x0012('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x95d441,_0x14991f[_0x0012('0x12')]['message']);return _0x30176d(_0x14991f['error']['message']);}logger['error'](_0x0012('0xe'),_0x95d441,_0x14991f['error'][_0x0012('0x14')]);return _0x3d4c64(_0x14991f[_0x0012('0x12')]['message']);}else{logger[_0x0012('0xd')](_0x0012('0xe'),_0x95d441,_0x0012('0xf'));_0x3d4c64(_0x14991f[_0x0012('0x15')]['message']);}})['catch'](function(_0x1e7fbe){logger[_0x0012('0x12')](_0x0012('0xe'),_0x95d441,_0x1e7fbe);_0x30176d(_0x1e7fbe);});});}exports[_0x0012('0x16')]=function(_0x1d0423){var _0x22ded1=this;return new Promise(function(_0x1e78ee,_0x2eb3fa){return db['VoiceRecording'][_0x0012('0x17')](_0x1d0423[_0x0012('0x18')],{'raw':_0x1d0423['options']?_0x1d0423[_0x0012('0x19')][_0x0012('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d0423[_0x0012('0x19')]?_0x1d0423[_0x0012('0x19')]['where']||null:null,'attributes':_0x1d0423['options']?_0x1d0423[_0x0012('0x19')][_0x0012('0x1b')]||null:null,'limit':_0x1d0423[_0x0012('0x19')]?_0x1d0423[_0x0012('0x19')][_0x0012('0x1c')]||null:null})[_0x0012('0x1d')](function(_0x2c9a96){logger[_0x0012('0xd')]('UpdateVoiceRecording',_0x1d0423);logger[_0x0012('0x1e')](_0x0012('0x16'),_0x1d0423,JSON['stringify'](_0x2c9a96));_0x1e78ee(_0x2c9a96);})[_0x0012('0x1f')](function(_0x13a78e){logger[_0x0012('0x12')](_0x0012('0x16'),_0x13a78e[_0x0012('0x14')],_0x1d0423);_0x2eb3fa(_0x22ded1['error'](0x1f4,_0x13a78e[_0x0012('0x14')]));});});};exports[_0x0012('0x20')]=function(_0xbb5b55){var _0x2a0302=this;return new Promise(function(_0x173cb3,_0xb37ef5){var _0x15d48a=require(_0x0012('0x21'));var _0x300e13;return db[_0x0012('0x22')][_0x0012('0x23')]({'attributes':['id',_0x0012('0x24')],'where':{'id':0x1},'raw':!![]})[_0x0012('0x1d')](function(_0x3ce788){_0x300e13=_0x3ce788;return db[_0x0012('0x25')][_0x0012('0x26')](_0xbb5b55[_0x0012('0x18')]);})[_0x0012('0x1d')](function(_0x1c23e0){if(_0x300e13[_0x0012('0x24')]&&fs[_0x0012('0x27')](_0x1c23e0['value'])){var _0x283134=util[_0x0012('0x28')]('%s.cypher',_0x1c23e0[_0x0012('0x29')]);return _0x15d48a[_0x0012('0x2a')](_0x1c23e0[_0x0012('0x29')],_0x283134,config[_0x0012('0x2b')][_0x0012('0x2c')])['then'](function(){fs[_0x0012('0x2d')](_0x1c23e0[_0x0012('0x29')]);logger[_0x0012('0xd')]('CreateVoiceRecording\x20file\x20encrypted');return _0x1c23e0;});}return _0x1c23e0;})[_0x0012('0x1d')](function(_0x31225a){logger[_0x0012('0xd')](_0x0012('0x20'),_0xbb5b55);logger[_0x0012('0x1e')](_0x0012('0x20'),_0xbb5b55,JSON['stringify'](_0x31225a));_0x173cb3(_0x31225a);})[_0x0012('0x1f')](function(_0x30dfd8){logger[_0x0012('0x12')](_0x0012('0x20'),_0x30dfd8['message'],_0xbb5b55);_0xb37ef5(_0x2a0302['error'](0x1f4,_0x30dfd8[_0x0012('0x14')]));});});};
\ No newline at end of file
index 3a7b47d..8a942b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c5c=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe'];(function(_0x5c3d84,_0x7ab920){var _0x33484c=function(_0x551551){while(--_0x551551){_0x5c3d84['push'](_0x5c3d84['shift']());}};_0x33484c(++_0x7ab920);}(_0x8c5c,0x14a));var _0xc8c5=function(_0x3b44ac,_0x1d18a6){_0x3b44ac=_0x3b44ac-0x0;var _0xf68329=_0x8c5c[_0x3b44ac];return _0xf68329;};'use strict';var multer=require(_0xc8c5('0x0'));var util=require(_0xc8c5('0x1'));var path=require(_0xc8c5('0x2'));var timeout=require('connect-timeout');var express=require(_0xc8c5('0x3'));var router=express['Router']();var fs_extra=require(_0xc8c5('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc8c5('0x5'));var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router[_0xc8c5('0x6')]('/',auth[_0xc8c5('0x7')](),controller[_0xc8c5('0x8')]);router[_0xc8c5('0x6')](_0xc8c5('0x9'),auth[_0xc8c5('0x7')](),controller[_0xc8c5('0xa')]);router[_0xc8c5('0x6')](_0xc8c5('0xb'),auth['isAuthenticated'](),controller[_0xc8c5('0xc')]);router[_0xc8c5('0xd')]('/',auth[_0xc8c5('0x7')](),controller[_0xc8c5('0xe')]);router[_0xc8c5('0xf')](_0xc8c5('0xb'),auth['isAuthenticated'](),controller[_0xc8c5('0x10')]);router[_0xc8c5('0x11')](_0xc8c5('0xb'),auth['isAuthenticated'](),controller[_0xc8c5('0x12')]);module[_0xc8c5('0x13')]=router;
\ No newline at end of file
+var _0xe5cc=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','destroy','exports'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0xe5cc,0xdc));var _0xce5c=function(_0x5a1613,_0x370b1b){_0x5a1613=_0x5a1613-0x0;var _0x2197d8=_0xe5cc[_0x5a1613];return _0x2197d8;};'use strict';var multer=require(_0xce5c('0x0'));var util=require(_0xce5c('0x1'));var path=require('path');var timeout=require(_0xce5c('0x2'));var express=require(_0xce5c('0x3'));var router=express[_0xce5c('0x4')]();var fs_extra=require(_0xce5c('0x5'));var auth=require(_0xce5c('0x6'));var interaction=require(_0xce5c('0x7'));var config=require(_0xce5c('0x8'));var controller=require('./voiceTransferReport.controller');router[_0xce5c('0x9')]('/',auth[_0xce5c('0xa')](),controller[_0xce5c('0xb')]);router[_0xce5c('0x9')](_0xce5c('0xc'),auth[_0xce5c('0xa')](),controller[_0xce5c('0xd')]);router[_0xce5c('0x9')]('/:id',auth[_0xce5c('0xa')](),controller[_0xce5c('0xe')]);router[_0xce5c('0xf')]('/',auth[_0xce5c('0xa')](),controller[_0xce5c('0x10')]);router[_0xce5c('0x11')](_0xce5c('0x12'),auth[_0xce5c('0xa')](),controller[_0xce5c('0x13')]);router['delete'](_0xce5c('0x12'),auth['isAuthenticated'](),controller[_0xce5c('0x14')]);module[_0xce5c('0x15')]=router;
\ No newline at end of file
index cdf49a4..9d616e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca65=['exports','blind','STRING','ENUM','Yes','sequelize','moment'];(function(_0xd34630,_0xb606e3){var _0x4ae5ce=function(_0x28a75e){while(--_0x28a75e){_0xd34630['push'](_0xd34630['shift']());}};_0x4ae5ce(++_0xb606e3);}(_0xca65,0x171));var _0x5ca6=function(_0x52dc2e,_0x5ebbf2){_0x52dc2e=_0x52dc2e-0x0;var _0x5ad894=_0xca65[_0x52dc2e];return _0x5ad894;};'use strict';var Sequelize=require(_0x5ca6('0x0'));var moment=require(_0x5ca6('0x1'));module[_0x5ca6('0x2')]={'type':{'type':Sequelize['ENUM'](_0x5ca6('0x3'),'attended')},'result':{'type':Sequelize[_0x5ca6('0x4')]},'transfererchannel':{'type':Sequelize[_0x5ca6('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x5ca6('0x4')]},'transferercalleridname':{'type':Sequelize[_0x5ca6('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x5ca6('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x5ca6('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0x5ca6('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x5ca6('0x4')]},'transfereechannel':{'type':Sequelize[_0x5ca6('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x5ca6('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x5ca6('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x5ca6('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x5ca6('0x4')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x5ca6('0x4')]},'transfereeexten':{'type':Sequelize[_0x5ca6('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x5ca6('0x4')]},'isexternal':{'type':Sequelize[_0x5ca6('0x5')](_0x5ca6('0x6'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x5ca6('0x4')]}};
\ No newline at end of file
+var _0x3a6f=['STRING','sequelize','moment','exports','ENUM','attended'];(function(_0x45be4f,_0x436816){var _0x1ee59c=function(_0x42f662){while(--_0x42f662){_0x45be4f['push'](_0x45be4f['shift']());}};_0x1ee59c(++_0x436816);}(_0x3a6f,0x1db));var _0xf3a6=function(_0x5401d2,_0x473162){_0x5401d2=_0x5401d2-0x0;var _0x1f6477=_0x3a6f[_0x5401d2];return _0x1f6477;};'use strict';var Sequelize=require(_0xf3a6('0x0'));var moment=require(_0xf3a6('0x1'));module[_0xf3a6('0x2')]={'type':{'type':Sequelize[_0xf3a6('0x3')]('blind',_0xf3a6('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xf3a6('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xf3a6('0x5')]},'transferercalleridname':{'type':Sequelize[_0xf3a6('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xf3a6('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xf3a6('0x5')]},'transferercontext':{'type':Sequelize[_0xf3a6('0x5')]},'transfererexten':{'type':Sequelize[_0xf3a6('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xf3a6('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xf3a6('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xf3a6('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xf3a6('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xf3a6('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0xf3a6('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xf3a6('0x5')]},'isexternal':{'type':Sequelize[_0xf3a6('0x3')]('Yes','No')},'context':{'type':Sequelize[_0xf3a6('0x5')]},'extension':{'type':Sequelize[_0xf3a6('0x5')]}};
\ No newline at end of file
index cd5cd54..0ae7148 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1407=['destroy','sendStatus','name','send','index','VoiceTransferReport','fieldName','type','key','map','query','attributes','intersection','model','fields','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','params','rawAttributes','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','end','undefined','limit','count','offset','status','set','Content-Range','reject','save','update','then'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1407,0xf9));var _0x7140=function(_0x82ecb2,_0x1b608b){_0x82ecb2=_0x82ecb2-0x0;var _0x3840bd=_0x1407[_0x82ecb2];return _0x3840bd;};'use strict';var emlformat=require(_0x7140('0x0'));var rimraf=require(_0x7140('0x1'));var zipdir=require(_0x7140('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7140('0x3'));var moment=require(_0x7140('0x4'));var BPromise=require(_0x7140('0x5'));var Mustache=require(_0x7140('0x6'));var util=require('util');var path=require(_0x7140('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7140('0x8'));var fs=require('fs');var fs_extra=require(_0x7140('0x9'));var _=require('lodash');var squel=require(_0x7140('0xa'));var crypto=require(_0x7140('0xb'));var jsforce=require(_0x7140('0xc'));var deskjs=require(_0x7140('0xd'));var toCsv=require(_0x7140('0xe'));var querystring=require(_0x7140('0xf'));var Papa=require(_0x7140('0x10'));var Redis=require(_0x7140('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7140('0x12'));var hardwareService=require(_0x7140('0x13'));var logger=require(_0x7140('0x14'))('api');var utils=require(_0x7140('0x15'));var config=require(_0x7140('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb882f8,_0x10f380){_0x10f380=_0x10f380||0xcc;return function(_0x32f58b){if(_0x32f58b){return _0xb882f8['sendStatus'](_0x10f380);}return _0xb882f8['status'](_0x10f380)[_0x7140('0x17')]();};}function respondWithResult(_0x571cfc,_0x3060a7){_0x3060a7=_0x3060a7||0xc8;return function(_0x159377){if(_0x159377){return _0x571cfc['status'](_0x3060a7)['json'](_0x159377);}};}function respondWithFilteredResult(_0x220dfe,_0x1013f1){return function(_0x2717d0){if(_0x2717d0){var _0x520aa7=typeof _0x1013f1['offset']===_0x7140('0x18')&&typeof _0x1013f1[_0x7140('0x19')]===_0x7140('0x18');var _0x272e70=_0x2717d0[_0x7140('0x1a')];var _0x56fea9=_0x520aa7?0x0:_0x1013f1[_0x7140('0x1b')];var _0x25fe28=_0x520aa7?_0x2717d0[_0x7140('0x1a')]:_0x1013f1[_0x7140('0x1b')]+_0x1013f1['limit'];var _0xbb31a3;if(_0x25fe28>=_0x272e70){_0x25fe28=_0x272e70;_0xbb31a3=0xc8;}else{_0xbb31a3=0xce;}_0x220dfe[_0x7140('0x1c')](_0xbb31a3);return _0x220dfe[_0x7140('0x1d')](_0x7140('0x1e'),_0x56fea9+'-'+_0x25fe28+'/'+_0x272e70)['json'](_0x2717d0);}return null;};}function patchUpdates(_0x234235){return function(_0x5b947f){try{jsonpatch['apply'](_0x5b947f,_0x234235,!![]);}catch(_0x288015){return BPromise[_0x7140('0x1f')](_0x288015);}return _0x5b947f[_0x7140('0x20')]();};}function saveUpdates(_0x1ac776,_0x563fe2){return function(_0x324313){if(_0x324313){return _0x324313[_0x7140('0x21')](_0x1ac776)[_0x7140('0x22')](function(_0x6fe0ad){return _0x6fe0ad;});}return null;};}function removeEntity(_0x4a3038,_0x18cfba){return function(_0x3ea641){if(_0x3ea641){return _0x3ea641[_0x7140('0x23')]()[_0x7140('0x22')](function(){_0x4a3038[_0x7140('0x1c')](0xcc)[_0x7140('0x17')]();});}};}function handleEntityNotFound(_0x413b99,_0x214a45){return function(_0xfb99f4){if(!_0xfb99f4){_0x413b99[_0x7140('0x24')](0x194);}return _0xfb99f4;};}function handleError(_0x2ab73b,_0xcb2dcd){_0xcb2dcd=_0xcb2dcd||0x1f4;return function(_0x1cb95a){logger['error'](_0x1cb95a['stack']);if(_0x1cb95a['name']){delete _0x1cb95a[_0x7140('0x25')];}_0x2ab73b[_0x7140('0x1c')](_0xcb2dcd)[_0x7140('0x26')](_0x1cb95a);};}exports[_0x7140('0x27')]=function(_0x38ca27,_0x48933f){var _0xb09106={},_0x177a74={},_0xfd4cfa={'count':0x0,'rows':[]};var _0x273071=_['map'](db[_0x7140('0x28')]['rawAttributes'],function(_0x4e043b){return{'name':_0x4e043b[_0x7140('0x29')],'type':_0x4e043b[_0x7140('0x2a')][_0x7140('0x2b')]};});_0x177a74['model']=_[_0x7140('0x2c')](_0x273071,_0x7140('0x25'));_0x177a74[_0x7140('0x2d')]=_['keys'](_0x38ca27[_0x7140('0x2d')]);_0x177a74['filters']=_['intersection'](_0x177a74['model'],_0x177a74[_0x7140('0x2d')]);_0xb09106[_0x7140('0x2e')]=_[_0x7140('0x2f')](_0x177a74[_0x7140('0x30')],qs[_0x7140('0x31')](_0x38ca27[_0x7140('0x2d')]['fields']));_0xb09106[_0x7140('0x2e')]=_0xb09106[_0x7140('0x2e')]['length']?_0xb09106[_0x7140('0x2e')]:_0x177a74[_0x7140('0x30')];if(!_0x38ca27[_0x7140('0x2d')]['hasOwnProperty'](_0x7140('0x32'))){_0xb09106[_0x7140('0x19')]=qs['limit'](_0x38ca27[_0x7140('0x2d')]['limit']);_0xb09106[_0x7140('0x1b')]=qs['offset'](_0x38ca27[_0x7140('0x2d')][_0x7140('0x1b')]);}_0xb09106[_0x7140('0x33')]=qs[_0x7140('0x34')](_0x38ca27['query'][_0x7140('0x34')]);_0xb09106['where']=qs[_0x7140('0x35')](_[_0x7140('0x36')](_0x38ca27[_0x7140('0x2d')],_0x177a74[_0x7140('0x35')]),_0x273071);if(_0x38ca27[_0x7140('0x2d')][_0x7140('0x37')]){_0xb09106[_0x7140('0x38')]=_[_0x7140('0x39')](_0xb09106[_0x7140('0x38')],{'$or':_[_0x7140('0x2c')](_0x273071,function(_0x4b6cf1){if(_0x4b6cf1[_0x7140('0x2a')]!==_0x7140('0x3a')){var _0x48c6b1={};_0x48c6b1[_0x4b6cf1['name']]={'$like':'%'+_0x38ca27[_0x7140('0x2d')][_0x7140('0x37')]+'%'};return _0x48c6b1;}})});}_0xb09106=_['merge']({},_0xb09106,_0x38ca27['options']);var _0x167ad0={'where':_0xb09106[_0x7140('0x38')]};return db['VoiceTransferReport'][_0x7140('0x1a')](_0x167ad0)[_0x7140('0x22')](function(_0xdcdba8){_0xfd4cfa['count']=_0xdcdba8;if(_0x38ca27[_0x7140('0x2d')][_0x7140('0x3b')]){_0xb09106['include']=[{'all':!![]}];}return db[_0x7140('0x28')][_0x7140('0x3c')](_0xb09106);})[_0x7140('0x22')](function(_0x32448e){_0xfd4cfa['rows']=_0x32448e;return _0xfd4cfa;})[_0x7140('0x22')](respondWithFilteredResult(_0x48933f,_0xb09106))[_0x7140('0x3d')](handleError(_0x48933f,null));};exports[_0x7140('0x3e')]=function(_0x1194bd,_0x3e75dd){var _0x4c6b0a={'raw':!![],'where':{'id':_0x1194bd[_0x7140('0x3f')]['id']}},_0x16ae31={};_0x16ae31[_0x7140('0x30')]=_['keys'](db[_0x7140('0x28')][_0x7140('0x40')]);_0x16ae31[_0x7140('0x2d')]=_['keys'](_0x1194bd['query']);_0x16ae31['filters']=_[_0x7140('0x2f')](_0x16ae31[_0x7140('0x30')],_0x16ae31[_0x7140('0x2d')]);_0x4c6b0a['attributes']=_[_0x7140('0x2f')](_0x16ae31[_0x7140('0x30')],qs['fields'](_0x1194bd['query'][_0x7140('0x31')]));_0x4c6b0a[_0x7140('0x2e')]=_0x4c6b0a[_0x7140('0x2e')]['length']?_0x4c6b0a[_0x7140('0x2e')]:_0x16ae31['model'];if(_0x1194bd['query'][_0x7140('0x3b')]){_0x4c6b0a[_0x7140('0x41')]=[{'all':!![]}];}_0x4c6b0a=_['merge']({},_0x4c6b0a,_0x1194bd[_0x7140('0x42')]);return db[_0x7140('0x28')][_0x7140('0x43')](_0x4c6b0a)['then'](handleEntityNotFound(_0x3e75dd,null))[_0x7140('0x22')](respondWithResult(_0x3e75dd,null))['catch'](handleError(_0x3e75dd,null));};exports[_0x7140('0x44')]=function(_0x2b2331,_0x2f513f){return db['VoiceTransferReport'][_0x7140('0x44')](_0x2b2331[_0x7140('0x45')],{})[_0x7140('0x22')](respondWithResult(_0x2f513f,0xc9))[_0x7140('0x3d')](handleError(_0x2f513f,null));};exports[_0x7140('0x21')]=function(_0x2a3be5,_0x9d29aa){if(_0x2a3be5[_0x7140('0x45')]['id']){delete _0x2a3be5[_0x7140('0x45')]['id'];}return db[_0x7140('0x28')]['find']({'where':{'id':_0x2a3be5[_0x7140('0x3f')]['id']}})[_0x7140('0x22')](handleEntityNotFound(_0x9d29aa,null))['then'](saveUpdates(_0x2a3be5[_0x7140('0x45')],null))['then'](respondWithResult(_0x9d29aa,null))[_0x7140('0x3d')](handleError(_0x9d29aa,null));};exports[_0x7140('0x23')]=function(_0xb8b1bf,_0xc5d666){return db['VoiceTransferReport']['find']({'where':{'id':_0xb8b1bf[_0x7140('0x3f')]['id']}})['then'](handleEntityNotFound(_0xc5d666,null))['then'](removeEntity(_0xc5d666,null))[_0x7140('0x3d')](handleError(_0xc5d666,null));};exports[_0x7140('0x46')]=function(_0x5bc832,_0x472de5){return db['VoiceTransferReport'][_0x7140('0x46')]()[_0x7140('0x22')](respondWithResult(_0x472de5,null))[_0x7140('0x3d')](handleError(_0x472de5,null));};
\ No newline at end of file
+var _0x6dc5=['create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','VoiceTransferReport','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','include','catch','show','params','rawAttributes','includeAll','find'];(function(_0xfeddf5,_0x2b4e4c){var _0x1240dd=function(_0x22d3b4){while(--_0x22d3b4){_0xfeddf5['push'](_0xfeddf5['shift']());}};_0x1240dd(++_0x2b4e4c);}(_0x6dc5,0xed));var _0x56dc=function(_0xc0c8bd,_0x42455d){_0xc0c8bd=_0xc0c8bd-0x0;var _0x344a19=_0x6dc5[_0xc0c8bd];return _0x344a19;};'use strict';var emlformat=require(_0x56dc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x56dc('0x1'));var jsonpatch=require(_0x56dc('0x2'));var rp=require(_0x56dc('0x3'));var moment=require(_0x56dc('0x4'));var BPromise=require(_0x56dc('0x5'));var Mustache=require(_0x56dc('0x6'));var util=require(_0x56dc('0x7'));var path=require(_0x56dc('0x8'));var sox=require(_0x56dc('0x9'));var csv=require(_0x56dc('0xa'));var ejs=require(_0x56dc('0xb'));var fs=require('fs');var fs_extra=require(_0x56dc('0xc'));var _=require(_0x56dc('0xd'));var squel=require(_0x56dc('0xe'));var crypto=require(_0x56dc('0xf'));var jsforce=require(_0x56dc('0x10'));var deskjs=require(_0x56dc('0x11'));var toCsv=require(_0x56dc('0xa'));var querystring=require(_0x56dc('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x56dc('0x13'));var qs=require(_0x56dc('0x14'));var as=require(_0x56dc('0x15'));var hardwareService=require(_0x56dc('0x16'));var logger=require(_0x56dc('0x17'))(_0x56dc('0x18'));var utils=require(_0x56dc('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x56dc('0x1a'));var db=require(_0x56dc('0x1b'))['db'];function respondWithStatusCode(_0x156f16,_0x1c032c){_0x1c032c=_0x1c032c||0xcc;return function(_0xfa998a){if(_0xfa998a){return _0x156f16[_0x56dc('0x1c')](_0x1c032c);}return _0x156f16[_0x56dc('0x1d')](_0x1c032c)[_0x56dc('0x1e')]();};}function respondWithResult(_0x575625,_0x1294c8){_0x1294c8=_0x1294c8||0xc8;return function(_0x324210){if(_0x324210){return _0x575625[_0x56dc('0x1d')](_0x1294c8)['json'](_0x324210);}};}function respondWithFilteredResult(_0x423b34,_0x2de6c7){return function(_0x385f98){if(_0x385f98){var _0x4d0321=typeof _0x2de6c7[_0x56dc('0x1f')]==='undefined'&&typeof _0x2de6c7[_0x56dc('0x20')]==='undefined';var _0x547631=_0x385f98['count'];var _0x54bd45=_0x4d0321?0x0:_0x2de6c7[_0x56dc('0x1f')];var _0x374301=_0x4d0321?_0x385f98[_0x56dc('0x21')]:_0x2de6c7[_0x56dc('0x1f')]+_0x2de6c7[_0x56dc('0x20')];var _0x3a3318;if(_0x374301>=_0x547631){_0x374301=_0x547631;_0x3a3318=0xc8;}else{_0x3a3318=0xce;}_0x423b34[_0x56dc('0x1d')](_0x3a3318);return _0x423b34[_0x56dc('0x22')](_0x56dc('0x23'),_0x54bd45+'-'+_0x374301+'/'+_0x547631)[_0x56dc('0x24')](_0x385f98);}return null;};}function patchUpdates(_0x377ea1){return function(_0x28a4a4){try{jsonpatch[_0x56dc('0x25')](_0x28a4a4,_0x377ea1,!![]);}catch(_0x530117){return BPromise[_0x56dc('0x26')](_0x530117);}return _0x28a4a4[_0x56dc('0x27')]();};}function saveUpdates(_0x20c1b6,_0x4041b4){return function(_0x33d700){if(_0x33d700){return _0x33d700[_0x56dc('0x28')](_0x20c1b6)[_0x56dc('0x29')](function(_0x402d7d){return _0x402d7d;});}return null;};}function removeEntity(_0x45db19,_0xb17545){return function(_0x479892){if(_0x479892){return _0x479892[_0x56dc('0x2a')]()[_0x56dc('0x29')](function(){_0x45db19['status'](0xcc)[_0x56dc('0x1e')]();});}};}function handleEntityNotFound(_0x1f11cf,_0x3509ea){return function(_0x5c2bd6){if(!_0x5c2bd6){_0x1f11cf['sendStatus'](0x194);}return _0x5c2bd6;};}function handleError(_0x4102e9,_0x19ff03){_0x19ff03=_0x19ff03||0x1f4;return function(_0x72bc46){logger['error'](_0x72bc46[_0x56dc('0x2b')]);if(_0x72bc46[_0x56dc('0x2c')]){delete _0x72bc46[_0x56dc('0x2c')];}_0x4102e9['status'](_0x19ff03)[_0x56dc('0x2d')](_0x72bc46);};}exports[_0x56dc('0x2e')]=function(_0x2cb440,_0x26277e){var _0x10d69b={},_0x133467={},_0x4d9fe4={'count':0x0,'rows':[]};var _0x5d045b=_[_0x56dc('0x2f')](db[_0x56dc('0x30')]['rawAttributes'],function(_0x3eabfb){return{'name':_0x3eabfb[_0x56dc('0x31')],'type':_0x3eabfb[_0x56dc('0x32')][_0x56dc('0x33')]};});_0x133467['model']=_['map'](_0x5d045b,_0x56dc('0x2c'));_0x133467['query']=_[_0x56dc('0x34')](_0x2cb440['query']);_0x133467[_0x56dc('0x35')]=_[_0x56dc('0x36')](_0x133467[_0x56dc('0x37')],_0x133467[_0x56dc('0x38')]);_0x10d69b[_0x56dc('0x39')]=_['intersection'](_0x133467[_0x56dc('0x37')],qs[_0x56dc('0x3a')](_0x2cb440[_0x56dc('0x38')][_0x56dc('0x3a')]));_0x10d69b[_0x56dc('0x39')]=_0x10d69b[_0x56dc('0x39')][_0x56dc('0x3b')]?_0x10d69b['attributes']:_0x133467[_0x56dc('0x37')];if(!_0x2cb440[_0x56dc('0x38')][_0x56dc('0x3c')]('nolimit')){_0x10d69b[_0x56dc('0x20')]=qs[_0x56dc('0x20')](_0x2cb440[_0x56dc('0x38')][_0x56dc('0x20')]);_0x10d69b[_0x56dc('0x1f')]=qs[_0x56dc('0x1f')](_0x2cb440[_0x56dc('0x38')]['offset']);}_0x10d69b[_0x56dc('0x3d')]=qs['sort'](_0x2cb440['query'][_0x56dc('0x3e')]);_0x10d69b[_0x56dc('0x3f')]=qs[_0x56dc('0x35')](_['pick'](_0x2cb440['query'],_0x133467['filters']),_0x5d045b);if(_0x2cb440[_0x56dc('0x38')][_0x56dc('0x40')]){_0x10d69b[_0x56dc('0x3f')]=_[_0x56dc('0x41')](_0x10d69b[_0x56dc('0x3f')],{'$or':_['map'](_0x5d045b,function(_0x1b3aa6){if(_0x1b3aa6[_0x56dc('0x32')]!==_0x56dc('0x42')){var _0x4737be={};_0x4737be[_0x1b3aa6[_0x56dc('0x2c')]]={'$like':'%'+_0x2cb440[_0x56dc('0x38')][_0x56dc('0x40')]+'%'};return _0x4737be;}})});}_0x10d69b=_[_0x56dc('0x41')]({},_0x10d69b,_0x2cb440[_0x56dc('0x43')]);var _0x9859bc={'where':_0x10d69b[_0x56dc('0x3f')]};return db[_0x56dc('0x30')]['count'](_0x9859bc)[_0x56dc('0x29')](function(_0x52184e){_0x4d9fe4['count']=_0x52184e;if(_0x2cb440[_0x56dc('0x38')]['includeAll']){_0x10d69b[_0x56dc('0x44')]=[{'all':!![]}];}return db[_0x56dc('0x30')]['findAll'](_0x10d69b);})[_0x56dc('0x29')](function(_0x4b64d9){_0x4d9fe4['rows']=_0x4b64d9;return _0x4d9fe4;})[_0x56dc('0x29')](respondWithFilteredResult(_0x26277e,_0x10d69b))[_0x56dc('0x45')](handleError(_0x26277e,null));};exports[_0x56dc('0x46')]=function(_0x93e853,_0x28d61d){var _0x5b5428={'raw':!![],'where':{'id':_0x93e853[_0x56dc('0x47')]['id']}},_0x2593c2={};_0x2593c2[_0x56dc('0x37')]=_[_0x56dc('0x34')](db['VoiceTransferReport'][_0x56dc('0x48')]);_0x2593c2['query']=_['keys'](_0x93e853[_0x56dc('0x38')]);_0x2593c2[_0x56dc('0x35')]=_[_0x56dc('0x36')](_0x2593c2['model'],_0x2593c2[_0x56dc('0x38')]);_0x5b5428[_0x56dc('0x39')]=_['intersection'](_0x2593c2[_0x56dc('0x37')],qs[_0x56dc('0x3a')](_0x93e853[_0x56dc('0x38')][_0x56dc('0x3a')]));_0x5b5428[_0x56dc('0x39')]=_0x5b5428[_0x56dc('0x39')][_0x56dc('0x3b')]?_0x5b5428[_0x56dc('0x39')]:_0x2593c2['model'];if(_0x93e853[_0x56dc('0x38')][_0x56dc('0x49')]){_0x5b5428[_0x56dc('0x44')]=[{'all':!![]}];}_0x5b5428=_[_0x56dc('0x41')]({},_0x5b5428,_0x93e853[_0x56dc('0x43')]);return db[_0x56dc('0x30')][_0x56dc('0x4a')](_0x5b5428)[_0x56dc('0x29')](handleEntityNotFound(_0x28d61d,null))['then'](respondWithResult(_0x28d61d,null))[_0x56dc('0x45')](handleError(_0x28d61d,null));};exports['create']=function(_0x562f1c,_0x487079){return db[_0x56dc('0x30')][_0x56dc('0x4b')](_0x562f1c[_0x56dc('0x4c')],{})['then'](respondWithResult(_0x487079,0xc9))[_0x56dc('0x45')](handleError(_0x487079,null));};exports[_0x56dc('0x28')]=function(_0x5b396d,_0x5ae9b4){if(_0x5b396d['body']['id']){delete _0x5b396d[_0x56dc('0x4c')]['id'];}return db['VoiceTransferReport'][_0x56dc('0x4a')]({'where':{'id':_0x5b396d[_0x56dc('0x47')]['id']}})[_0x56dc('0x29')](handleEntityNotFound(_0x5ae9b4,null))[_0x56dc('0x29')](saveUpdates(_0x5b396d['body'],null))[_0x56dc('0x29')](respondWithResult(_0x5ae9b4,null))[_0x56dc('0x45')](handleError(_0x5ae9b4,null));};exports[_0x56dc('0x2a')]=function(_0x267b91,_0x50a34d){return db[_0x56dc('0x30')]['find']({'where':{'id':_0x267b91[_0x56dc('0x47')]['id']}})[_0x56dc('0x29')](handleEntityNotFound(_0x50a34d,null))[_0x56dc('0x29')](removeEntity(_0x50a34d,null))[_0x56dc('0x45')](handleError(_0x50a34d,null));};exports[_0x56dc('0x4d')]=function(_0x1e217b,_0x3faeee){return db[_0x56dc('0x30')][_0x56dc('0x4d')]()['then'](respondWithResult(_0x3faeee,null))[_0x56dc('0x45')](handleError(_0x3faeee,null));};
\ No newline at end of file
index 38ca7ed..25e9d99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3a3=['moment','bluebird','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api'];(function(_0x19b981,_0x50edd4){var _0x1cd2d3=function(_0x15324c){while(--_0x15324c){_0x19b981['push'](_0x19b981['shift']());}};_0x1cd2d3(++_0x50edd4);}(_0xe3a3,0x1a0));var _0x3e3a=function(_0x56ab7d,_0x1487c7){_0x56ab7d=_0x56ab7d-0x0;var _0x2f9616=_0xe3a3[_0x56ab7d];return _0x2f9616;};'use strict';var _=require(_0x3e3a('0x0'));var util=require(_0x3e3a('0x1'));var logger=require(_0x3e3a('0x2'))(_0x3e3a('0x3'));var moment=require(_0x3e3a('0x4'));var BPromise=require(_0x3e3a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e3a('0x6'));var rimraf=require(_0x3e3a('0x7'));var config=require(_0x3e3a('0x8'));var attributes=require(_0x3e3a('0x9'));module[_0x3e3a('0xa')]=function(_0x43611c,_0x1e2c8e){return _0x43611c[_0x3e3a('0xb')](_0x3e3a('0xc'),attributes,{'tableName':_0x3e3a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbb22=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api'];(function(_0xd34c38,_0x455c59){var _0xd180d6=function(_0x4a9cd4){while(--_0x4a9cd4){_0xd34c38['push'](_0xd34c38['shift']());}};_0xd180d6(++_0x455c59);}(_0xbb22,0xb2));var _0x2bb2=function(_0xafaa48,_0x18c85a){_0xafaa48=_0xafaa48-0x0;var _0x25c528=_0xbb22[_0xafaa48];return _0x25c528;};'use strict';var _=require(_0x2bb2('0x0'));var util=require(_0x2bb2('0x1'));var logger=require(_0x2bb2('0x2'))(_0x2bb2('0x3'));var moment=require(_0x2bb2('0x4'));var BPromise=require(_0x2bb2('0x5'));var rp=require(_0x2bb2('0x6'));var fs=require('fs');var path=require(_0x2bb2('0x7'));var rimraf=require(_0x2bb2('0x8'));var config=require(_0x2bb2('0x9'));var attributes=require(_0x2bb2('0xa'));module['exports']=function(_0x11063f,_0x30ed14){return _0x11063f[_0x2bb2('0xb')](_0x2bb2('0xc'),attributes,{'tableName':_0x2bb2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4b755b5..b521e03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0bd=['request\x20sent','stringify','error','code','message','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s'];(function(_0x5e5184,_0x4963b0){var _0x3a170d=function(_0x488b21){while(--_0x488b21){_0x5e5184['push'](_0x5e5184['shift']());}};_0x3a170d(++_0x4963b0);}(_0xa0bd,0x169));var _0xda0b=function(_0x35117b,_0x520423){_0x35117b=_0x35117b-0x0;var _0x33a51f=_0xa0bd[_0x35117b];return _0x33a51f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xda0b('0x0'));var BPromise=require(_0xda0b('0x1'));var rs=require(_0xda0b('0x2'));var fs=require('fs');var Redis=require(_0xda0b('0x3'));var db=require(_0xda0b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xda0b('0x5'))(_0xda0b('0x6'));var config=require(_0xda0b('0x7'));var jayson=require(_0xda0b('0x8'));var client=jayson[_0xda0b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ffa2a,_0x1285e2,_0x356d67){return new BPromise(function(_0x2448b4,_0x2d135a){return client[_0xda0b('0xa')](_0x2ffa2a,_0x356d67)[_0xda0b('0xb')](function(_0xa4df7a){logger[_0xda0b('0xc')](_0xda0b('0xd'),_0x1285e2,_0xda0b('0xe'));logger['debug']('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x1285e2,'request\x20sent',JSON[_0xda0b('0xf')](_0xa4df7a));if(_0xa4df7a[_0xda0b('0x10')]){if(_0xa4df7a[_0xda0b('0x10')][_0xda0b('0x11')]===0x1f4){logger[_0xda0b('0x10')](_0xda0b('0xd'),_0x1285e2,_0xa4df7a[_0xda0b('0x10')]['message']);return _0x2d135a(_0xa4df7a['error'][_0xda0b('0x12')]);}logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x1285e2,_0xa4df7a[_0xda0b('0x10')][_0xda0b('0x12')]);return _0x2448b4(_0xa4df7a[_0xda0b('0x10')]['message']);}else{logger[_0xda0b('0xc')](_0xda0b('0xd'),_0x1285e2,_0xda0b('0xe'));_0x2448b4(_0xa4df7a['result'][_0xda0b('0x12')]);}})[_0xda0b('0x13')](function(_0x505eb9){logger[_0xda0b('0x10')](_0xda0b('0xd'),_0x1285e2,_0x505eb9);_0x2d135a(_0x505eb9);});});}exports[_0xda0b('0x14')]=function(_0x3d6bdf){var _0xeb43e8=this;return new Promise(function(_0x2f01fb,_0x4d1cf7){return db[_0xda0b('0x15')]['create'](_0x3d6bdf[_0xda0b('0x16')],{'raw':_0x3d6bdf[_0xda0b('0x17')]?_0x3d6bdf[_0xda0b('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1dcd01){logger[_0xda0b('0xc')](_0xda0b('0x14'),_0x3d6bdf);logger[_0xda0b('0x18')](_0xda0b('0x14'),_0x3d6bdf,JSON[_0xda0b('0xf')](_0x1dcd01));_0x2f01fb(_0x1dcd01);})['catch'](function(_0x51470f){logger[_0xda0b('0x10')](_0xda0b('0x14'),_0x51470f[_0xda0b('0x12')],_0x3d6bdf);_0x4d1cf7(_0xeb43e8[_0xda0b('0x10')](0x1f4,_0x51470f[_0xda0b('0x12')]));});});};
\ No newline at end of file
+var _0x90e4=['catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1f0779,_0xfe38a7){var _0xd0be08=function(_0x3f4b62){while(--_0x3f4b62){_0x1f0779['push'](_0x1f0779['shift']());}};_0xd0be08(++_0xfe38a7);}(_0x90e4,0x1b7));var _0x490e=function(_0x44a329,_0x45f280){_0x44a329=_0x44a329-0x0;var _0x45f2a3=_0x90e4[_0x44a329];return _0x45f2a3;};'use strict';var _=require(_0x490e('0x0'));var util=require(_0x490e('0x1'));var moment=require(_0x490e('0x2'));var BPromise=require(_0x490e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x490e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x490e('0x5'));var logger=require('../../config/logger')(_0x490e('0x6'));var config=require(_0x490e('0x7'));var jayson=require(_0x490e('0x8'));var client=jayson[_0x490e('0x9')][_0x490e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x120750,_0xf93d2f,_0x46df4d){return new BPromise(function(_0x26e793,_0x2a28a2){return client['request'](_0x120750,_0x46df4d)['then'](function(_0xffde69){logger[_0x490e('0xb')](_0x490e('0xc'),_0xf93d2f,_0x490e('0xd'));logger[_0x490e('0xe')](_0x490e('0xf'),_0xf93d2f,'request\x20sent',JSON[_0x490e('0x10')](_0xffde69));if(_0xffde69[_0x490e('0x11')]){if(_0xffde69[_0x490e('0x11')][_0x490e('0x12')]===0x1f4){logger[_0x490e('0x11')](_0x490e('0xc'),_0xf93d2f,_0xffde69['error'][_0x490e('0x13')]);return _0x2a28a2(_0xffde69[_0x490e('0x11')]['message']);}logger[_0x490e('0x11')](_0x490e('0xc'),_0xf93d2f,_0xffde69[_0x490e('0x11')][_0x490e('0x13')]);return _0x26e793(_0xffde69['error'][_0x490e('0x13')]);}else{logger[_0x490e('0xb')](_0x490e('0xc'),_0xf93d2f,_0x490e('0xd'));_0x26e793(_0xffde69['result'][_0x490e('0x13')]);}})[_0x490e('0x14')](function(_0x19e11a){logger[_0x490e('0x11')](_0x490e('0xc'),_0xf93d2f,_0x19e11a);_0x2a28a2(_0x19e11a);});});}exports[_0x490e('0x15')]=function(_0x3ce58f){var _0x59b4e0=this;return new Promise(function(_0x5b208b,_0x51b6ac){return db[_0x490e('0x16')][_0x490e('0x17')](_0x3ce58f[_0x490e('0x18')],{'raw':_0x3ce58f[_0x490e('0x19')]?_0x3ce58f[_0x490e('0x19')][_0x490e('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x5232e4){logger[_0x490e('0xb')](_0x490e('0x15'),_0x3ce58f);logger['debug'](_0x490e('0x15'),_0x3ce58f,JSON[_0x490e('0x10')](_0x5232e4));_0x5b208b(_0x5232e4);})[_0x490e('0x14')](function(_0x16c9ae){logger['error'](_0x490e('0x15'),_0x16c9ae['message'],_0x3ce58f);_0x51b6ac(_0x59b4e0[_0x490e('0x11')](0x1f4,_0x16c9ae[_0x490e('0x13')]));});});};
\ No newline at end of file
index 7651521..c95d729 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f62=['/hangup','isAuthenticated','hangup','/answer','isWebrtcLicence','hold','/calls','/transfer','transfer','exports','Router','./webbar.controller','post','/originate','originate'];(function(_0x59067b,_0x4d2872){var _0x351bd8=function(_0x33aa18){while(--_0x33aa18){_0x59067b['push'](_0x59067b['shift']());}};_0x351bd8(++_0x4d2872);}(_0x9f62,0x154));var _0x29f6=function(_0x216e11,_0x39cf81){_0x216e11=_0x216e11-0x0;var _0x304120=_0x9f62[_0x216e11];return _0x304120;};'use strict';var express=require('express');var router=express[_0x29f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x29f6('0x1'));router[_0x29f6('0x2')](_0x29f6('0x3'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0x29f6('0x4')]);router[_0x29f6('0x2')](_0x29f6('0x5'),auth[_0x29f6('0x6')](),auth['isWebrtcLicence'](),controller[_0x29f6('0x7')]);router[_0x29f6('0x2')](_0x29f6('0x8'),auth[_0x29f6('0x6')](),auth[_0x29f6('0x9')](),controller['answer']);router['post']('/hold',auth['isAuthenticated'](),auth[_0x29f6('0x9')](),controller[_0x29f6('0xa')]);router['post']('/unhold',auth[_0x29f6('0x6')](),auth[_0x29f6('0x9')](),controller['unhold']);router[_0x29f6('0x2')](_0x29f6('0xb'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller['calls']);router['post'](_0x29f6('0xc'),auth[_0x29f6('0x6')](),auth[_0x29f6('0x9')](),controller[_0x29f6('0xd')]);module[_0x29f6('0xe')]=router;
\ No newline at end of file
+var _0xe14d=['hangup','answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','originate','post','/hangup','isWebrtcLicence'];(function(_0x701566,_0x7de6cb){var _0x64b6c9=function(_0x7481f7){while(--_0x7481f7){_0x701566['push'](_0x701566['shift']());}};_0x64b6c9(++_0x7de6cb);}(_0xe14d,0x1ee));var _0xde14=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xe14d[_0x397e5f];return _0x5302b8;};'use strict';var express=require(_0xde14('0x0'));var router=express[_0xde14('0x1')]();var auth=require(_0xde14('0x2'));var controller=require(_0xde14('0x3'));router['post'](_0xde14('0x4'),auth[_0xde14('0x5')](),auth['isWebrtcLicence'](),controller[_0xde14('0x6')]);router[_0xde14('0x7')](_0xde14('0x8'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xa')]);router['post']('/answer',auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xb')]);router[_0xde14('0x7')](_0xde14('0xc'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xd')]);router['post'](_0xde14('0xe'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0xf')]);router[_0xde14('0x7')](_0xde14('0x10'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x11')]);router[_0xde14('0x7')](_0xde14('0x12'),auth[_0xde14('0x5')](),auth[_0xde14('0x9')](),controller[_0xde14('0x13')]);module[_0xde14('0x14')]=router;
\ No newline at end of file
index d040d96..feaaa1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcea2=['result','catch','findOne','agent','all','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','VoiceChannels','filter','UserId','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','../../mysqldb','util','bluebird','jayson/promise','http','../../config/logger','webbarapi','redis','localhost','socket.io-emitter','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','info','stringify','emit','log','handleError:','error','stack','name','status','NotFound','then','code','message'];(function(_0x482986,_0x218651){var _0x56b818=function(_0x39ab83){while(--_0x39ab83){_0x482986['push'](_0x482986['shift']());}};_0x56b818(++_0x218651);}(_0xcea2,0x15a));var _0x2cea=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xcea2[_0x525c7b];return _0x27b33e;};'use strict';var path=require(_0x2cea('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x2cea('0x1'))['db'];var config=require('../../config/environment');var util=require(_0x2cea('0x2'));var BPromise=require(_0x2cea('0x3'));var jayson=require(_0x2cea('0x4'));var amiClient=jayson['client'][_0x2cea('0x5')]({'port':0x232a});var logger=require(_0x2cea('0x6'))(_0x2cea('0x7'));var Redis=require('ioredis');config[_0x2cea('0x8')]=_['defaults'](config[_0x2cea('0x8')],{'host':_0x2cea('0x9'),'port':0x18eb});var io=require(_0x2cea('0xa'))(new Redis(config[_0x2cea('0x8')]));var Schema=require(_0x2cea('0xb'));var originateValidation=new Schema({'userId':{'type':_0x2cea('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x2cea('0xd'),'required':[!![],_0x2cea('0xe')]},'callerId':{'type':_0x2cea('0xd')},'callbackUrl':{'type':_0x2cea('0xd')}});var hangupValidation=new Schema({'userId':{'type':_0x2cea('0xc'),'required':[!![],_0x2cea('0xf')]},'sessionId':{'type':_0x2cea('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x2cea('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x2cea('0xc'),'required':[!![],_0x2cea('0xf')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x2cea('0xd'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x2cea('0xc'),'required':[!![],_0x2cea('0xf')]},'sessionId':{'type':_0x2cea('0xd'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x2cea('0xc'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x2cea('0xc'),'required':[!![],_0x2cea('0xf')]}});function emit(_0x981e3f,_0x17322c,_0x232dad){logger[_0x2cea('0x10')](_0x981e3f,_0x17322c,JSON[_0x2cea('0x11')](_0x232dad));io['to'](_0x981e3f)[_0x2cea('0x12')](_0x17322c,_0x232dad);}function handleError(_0x5eee09){return function(_0x19927a){console[_0x2cea('0x13')](_0x2cea('0x14'),_0x19927a,_0x19927a instanceof RangeError);logger[_0x2cea('0x15')](_0x19927a[_0x2cea('0x16')]);if(_0x19927a instanceof RangeError){if(_0x19927a[_0x2cea('0x17')]){delete _0x19927a['name'];}_0x5eee09[_0x2cea('0x18')](0x194)['send'](_0x19927a);}else{if(_0x19927a[_0x2cea('0x17')]){delete _0x19927a[_0x2cea('0x17')];}_0x5eee09[_0x2cea('0x18')](0x1f4)['send'](_0x19927a);}};}function checkError(){return function(_0x46a112){if(!_0x46a112){throw new RangeError(_0x2cea('0x19'));}return _0x46a112;};}function respondWithRpcPromise(_0x210d7e,_0x1b389b){return new BPromise(function(_0x3246bc,_0x3f6f0e){var _0x10f13a=amiClient;return _0x10f13a['request'](_0x210d7e,_0x1b389b)[_0x2cea('0x1a')](function(_0x5e5b46){if(_0x5e5b46[_0x2cea('0x15')]){if(_0x5e5b46['error'][_0x2cea('0x1b')]===0x1f4){return _0x3f6f0e(_0x5e5b46[_0x2cea('0x15')]['message']);}return _0x3246bc(_0x5e5b46[_0x2cea('0x15')][_0x2cea('0x1c')]);}else{_0x3246bc(_0x5e5b46[_0x2cea('0x1d')]);}})[_0x2cea('0x1e')](function(_0x3f3ee0){_0x3f6f0e(_0x3f3ee0);});});}function getAgent(_0x79529b){return db['User'][_0x2cea('0x1f')]({'where':{'id':_0x79529b,'role':_0x2cea('0x20')}})[_0x2cea('0x1a')](checkError());}function getAgentCheckSession(_0x32af98,_0x46ef5a){return new BPromise(function(_0x3ea40c,_0xe99cca){var _0x2741cb=respondWithRpcPromise('VoiceChannels');var _0xff69ad=getAgent(_0x32af98);Promise[_0x2cea('0x21')]([_0x2741cb,_0xff69ad])['then'](function(_0xfeb8bd){var _0xc398c5=_0xfeb8bd[0x0];var _0x271b2f=_0xfeb8bd[0x1];var _0x16cf9f=_['filter'](_0xc398c5[_0x2cea('0x22')],function(_0x128934){return _0x128934['UserId']==_0x271b2f['id']&&_0x128934[_0x2cea('0x23')]==_0x46ef5a;});if(_0x16cf9f[_0x2cea('0x24')]==0x1){_0x3ea40c(_0x271b2f);}else{_0xe99cca(new RangeError(_0x2cea('0x25')+_0x46ef5a+_0x2cea('0x26')));}});});}exports[_0x2cea('0x27')]=function(_0x35b37e,_0x10e7c5){logger[_0x2cea('0x10')](_0x2cea('0x28'),_0x35b37e[_0x2cea('0x29')]);var _0x107472=originateValidation['validate'](_0x35b37e[_0x2cea('0x29')]);if(_0x107472[_0x2cea('0x24')]>0x0){return _0x10e7c5[_0x2cea('0x18')](0x190)[_0x2cea('0x2a')](_0x107472);}var _0x5a0061=_0x35b37e['body'][_0x2cea('0x2b')];var _0x1451f2=_0x35b37e['body'][_0x2cea('0x2c')];var _0x49d851=_0x35b37e[_0x2cea('0x29')]['callerId'];var _0x510d66=_0x35b37e['body'][_0x2cea('0x2d')];return getAgent(_0x5a0061)[_0x2cea('0x1a')](function(_0x5d254d){logger[_0x2cea('0x10')](_0x2cea('0x2e'),_0x5d254d['name']);emit(util[_0x2cea('0x2f')](_0x2cea('0x30'),_0x5d254d[_0x2cea('0x17')]),_0x2cea('0x31'),{'callNumber':_0x1451f2,'callerId':_0x49d851,'callbackUrl':_0x510d66});return _0x10e7c5[_0x2cea('0x18')](0xc8)['json']({'error':![],'message':_0x2cea('0x32')});})[_0x2cea('0x1e')](handleError(_0x10e7c5));};exports['hangup']=function(_0x53c088,_0x1913a2){logger['info']('hangup\x20fired:',_0x53c088['body']);var _0x50f632=hangupValidation[_0x2cea('0xb')](_0x53c088[_0x2cea('0x29')]);if(_0x50f632['length']>0x0){return _0x1913a2[_0x2cea('0x18')](0x190)[_0x2cea('0x2a')](_0x50f632);}var _0x249aaa=_0x53c088['body'][_0x2cea('0x2b')];var _0xcc11b6=_0x53c088[_0x2cea('0x29')][_0x2cea('0x23')];return getAgent(_0x249aaa)[_0x2cea('0x1a')](function(_0x2cb62b){logger[_0x2cea('0x10')](_0x2cea('0x2e'),_0x2cb62b[_0x2cea('0x17')]);emit(util[_0x2cea('0x2f')](_0x2cea('0x30'),_0x2cb62b[_0x2cea('0x17')]),_0x2cea('0x33'),{'sessionId':_0xcc11b6});return _0x1913a2[_0x2cea('0x18')](0xc8)[_0x2cea('0x2a')]({'error':![],'message':_0x2cea('0x34')});})[_0x2cea('0x1e')](handleError(_0x1913a2));};exports[_0x2cea('0x35')]=function(_0x49fcfa,_0x294057){logger['info'](_0x2cea('0x36'),_0x49fcfa[_0x2cea('0x29')]);var _0x22ce6b=answerValidation[_0x2cea('0xb')](_0x49fcfa[_0x2cea('0x29')]);if(_0x22ce6b[_0x2cea('0x24')]>0x0){return _0x294057[_0x2cea('0x18')](0x190)[_0x2cea('0x2a')](_0x22ce6b);}var _0x608740=_0x49fcfa[_0x2cea('0x29')]['userId'];var _0x515494=_0x49fcfa[_0x2cea('0x29')][_0x2cea('0x23')];return getAgent(_0x608740)['then'](function(_0x2d22db){logger['info'](_0x2cea('0x2e'),_0x2d22db['name']);emit(util[_0x2cea('0x2f')](_0x2cea('0x30'),_0x2d22db[_0x2cea('0x17')]),_0x2cea('0x37'),{'sessionId':_0x515494});return _0x294057[_0x2cea('0x18')](0xc8)[_0x2cea('0x2a')]({'error':![],'message':_0x2cea('0x38')});})[_0x2cea('0x1e')](handleError(_0x294057));};exports[_0x2cea('0x39')]=function(_0x1ce60a,_0x5a55ed){logger[_0x2cea('0x10')](_0x2cea('0x3a'),_0x1ce60a[_0x2cea('0x29')]);var _0x348baf=holdValidation['validate'](_0x1ce60a['body']);if(_0x348baf[_0x2cea('0x24')]>0x0){return _0x5a55ed[_0x2cea('0x18')](0x190)[_0x2cea('0x2a')](_0x348baf);}var _0x510e0f=_0x1ce60a[_0x2cea('0x29')][_0x2cea('0x2b')];var _0x4223d8=_0x1ce60a[_0x2cea('0x29')]['sessionId'];return getAgent(_0x510e0f)[_0x2cea('0x1a')](function(_0x526e92){logger['info'](_0x2cea('0x2e'),_0x526e92[_0x2cea('0x17')]);emit(util[_0x2cea('0x2f')](_0x2cea('0x30'),_0x526e92['name']),'webbar:hold',{'sessionId':_0x4223d8});return _0x5a55ed[_0x2cea('0x18')](0xc8)[_0x2cea('0x2a')]({'error':![],'message':_0x2cea('0x3b')});})[_0x2cea('0x1e')](handleError(_0x5a55ed));};exports['unhold']=function(_0x4ec462,_0x5d7cb6){logger[_0x2cea('0x10')](_0x2cea('0x3c'),_0x4ec462[_0x2cea('0x29')]);var _0x25dc12=unholdValidation[_0x2cea('0xb')](_0x4ec462[_0x2cea('0x29')]);if(_0x25dc12[_0x2cea('0x24')]>0x0){return _0x5d7cb6['status'](0x190)[_0x2cea('0x2a')](_0x25dc12);}var _0x39937e=_0x4ec462[_0x2cea('0x29')]['userId'];var _0x103f18=_0x4ec462['body'][_0x2cea('0x23')];return getAgent(_0x39937e)[_0x2cea('0x1a')](function(_0x21851a){logger[_0x2cea('0x10')](_0x2cea('0x2e'),_0x21851a[_0x2cea('0x17')]);emit(util[_0x2cea('0x2f')](_0x2cea('0x30'),_0x21851a['name']),_0x2cea('0x3d'),{'sessionId':_0x103f18});return _0x5d7cb6['status'](0xc8)[_0x2cea('0x2a')]({'error':![],'message':_0x2cea('0x3e')});})[_0x2cea('0x1e')](handleError(_0x5d7cb6));};exports['calls']=function(_0x3b27f4,_0x4c4db6){logger['info'](_0x2cea('0x3f'),_0x4c4db6[_0x2cea('0x29')]);var _0x28e720=callsValidation[_0x2cea('0xb')](_0x3b27f4[_0x2cea('0x29')]);if(_0x28e720['length']>0x0){return _0x4c4db6['status'](0x190)[_0x2cea('0x2a')](_0x28e720);}var _0x160755=_0x3b27f4[_0x2cea('0x29')][_0x2cea('0x2b')];var _0x526269=respondWithRpcPromise(_0x2cea('0x40'));var _0x5ae31b=getAgent(_0x160755);return Promise[_0x2cea('0x21')]([_0x526269,_0x5ae31b])[_0x2cea('0x1a')](function(_0x35d64b){var _0x3f06d1=_0x35d64b[0x0];var _0x221c16=_0x35d64b[0x1];var _0x50adbe=_[_0x2cea('0x41')](_0x3f06d1[_0x2cea('0x22')],function(_0x2c6dd4){return _0x2c6dd4[_0x2cea('0x42')]==_0x221c16['id'];});return _0x4c4db6[_0x2cea('0x18')](0xc8)['json']({'count':_0x50adbe[_0x2cea('0x24')],'rows':_0x50adbe});})[_0x2cea('0x1e')](handleError(_0x4c4db6));};exports['conference']=function(_0x548912,_0x820317){logger[_0x2cea('0x10')](_0x2cea('0x43'),_0x548912['body']);var _0x5806b8=conferenceValidation[_0x2cea('0xb')](_0x548912[_0x2cea('0x29')]);if(_0x5806b8['length']>0x0){return _0x820317[_0x2cea('0x18')](0x190)[_0x2cea('0x2a')](_0x5806b8);}var _0x589682=_0x548912[_0x2cea('0x29')][_0x2cea('0x2b')];return getAgent(_0x589682)[_0x2cea('0x1a')](function(_0x42881c){logger[_0x2cea('0x10')]('entityFound:',_0x42881c[_0x2cea('0x17')]);emit(util[_0x2cea('0x2f')]('user:%s',_0x42881c[_0x2cea('0x17')]),_0x2cea('0x44'));return _0x820317[_0x2cea('0x18')](0xc8)[_0x2cea('0x2a')]({'error':![],'message':_0x2cea('0x45')});})[_0x2cea('0x1e')](handleError(_0x820317));};exports[_0x2cea('0x46')]=function(_0xb9ef65,_0x3708c8){logger[_0x2cea('0x10')](_0x2cea('0x47'),_0xb9ef65[_0x2cea('0x29')]);var _0x400459=transferValidation['validate'](_0xb9ef65['body']);if(_0x400459[_0x2cea('0x24')]>0x0){return _0x3708c8[_0x2cea('0x18')](0x190)[_0x2cea('0x2a')](_0x400459);}var _0x104051=_0xb9ef65[_0x2cea('0x29')][_0x2cea('0x2b')];var _0x354c42=_0xb9ef65['body']['sessionId'];var _0x1dfeaf=_0xb9ef65[_0x2cea('0x29')][_0x2cea('0x48')];return getAgent(_0x104051)['then'](function(_0x4e00b6){logger['info'](_0x2cea('0x2e'),_0x4e00b6[_0x2cea('0x17')]);emit(util['format']('user:%s',_0x4e00b6[_0x2cea('0x17')]),_0x2cea('0x49'),{'sessionId':_0x354c42,'transferNumber':_0x1dfeaf});return _0x3708c8[_0x2cea('0x18')](0xc8)[_0x2cea('0x2a')]({'error':![],'message':_0x2cea('0x4a')});})[_0x2cea('0x1e')](handleError(_0x3708c8));};
\ No newline at end of file
+var _0x1752=['originate','info','body','length','userId','callNumber','callerId','entityFound:','user:%s','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','validate','hangup\x20executed!','format','webbar:answer','answer\x20executed!','webbar:hold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','filter','rows','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','webbar:transfer','transfer\x20executed!','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','error','stack','name','status','request','then','code','message','result','catch','User','VoiceChannels','all','sessionId'];(function(_0x113cf9,_0x358825){var _0x5842ad=function(_0x1b55da){while(--_0x1b55da){_0x113cf9['push'](_0x113cf9['shift']());}};_0x5842ad(++_0x358825);}(_0x1752,0xa5));var _0x2175=function(_0x470b3c,_0x5cbef9){_0x470b3c=_0x470b3c-0x0;var _0x8b1fac=_0x1752[_0x470b3c];return _0x8b1fac;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x2175('0x0'));var db=require(_0x2175('0x1'))['db'];var config=require(_0x2175('0x2'));var util=require(_0x2175('0x3'));var BPromise=require(_0x2175('0x4'));var jayson=require(_0x2175('0x5'));var amiClient=jayson['client'][_0x2175('0x6')]({'port':0x232a});var logger=require(_0x2175('0x7'))(_0x2175('0x8'));var Redis=require(_0x2175('0x9'));config[_0x2175('0xa')]=_[_0x2175('0xb')](config[_0x2175('0xa')],{'host':_0x2175('0xc'),'port':0x18eb});var io=require(_0x2175('0xd'))(new Redis(config[_0x2175('0xa')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x2175('0xe'),'required':[!![],_0x2175('0xf')]},'callNumber':{'type':_0x2175('0x10'),'required':[!![],_0x2175('0x11')]},'callerId':{'type':_0x2175('0x10')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x2175('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x2175('0xf')]},'sessionId':{'type':'string','required':[!![],_0x2175('0x12')]},'transferNumber':{'type':_0x2175('0x10'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x2175('0xe'),'required':[!![],_0x2175('0xf')]},'sessionId':{'type':_0x2175('0x10'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x2175('0xe'),'required':[!![],_0x2175('0xf')]},'sessionId':{'type':_0x2175('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x2175('0xe'),'required':[!![],_0x2175('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});function emit(_0x371b42,_0x22cd42,_0x22fde9){logger['info'](_0x371b42,_0x22cd42,JSON['stringify'](_0x22fde9));io['to'](_0x371b42)['emit'](_0x22cd42,_0x22fde9);}function handleError(_0x366e37){return function(_0x377586){console['log']('handleError:',_0x377586,_0x377586 instanceof RangeError);logger[_0x2175('0x13')](_0x377586[_0x2175('0x14')]);if(_0x377586 instanceof RangeError){if(_0x377586[_0x2175('0x15')]){delete _0x377586['name'];}_0x366e37[_0x2175('0x16')](0x194)['send'](_0x377586);}else{if(_0x377586[_0x2175('0x15')]){delete _0x377586['name'];}_0x366e37[_0x2175('0x16')](0x1f4)['send'](_0x377586);}};}function checkError(){return function(_0x5366e3){if(!_0x5366e3){throw new RangeError('NotFound');}return _0x5366e3;};}function respondWithRpcPromise(_0x278851,_0x583a1d){return new BPromise(function(_0x28c4b8,_0x46ea57){var _0x2dd77b=amiClient;return _0x2dd77b[_0x2175('0x17')](_0x278851,_0x583a1d)[_0x2175('0x18')](function(_0x12d150){if(_0x12d150['error']){if(_0x12d150[_0x2175('0x13')][_0x2175('0x19')]===0x1f4){return _0x46ea57(_0x12d150[_0x2175('0x13')][_0x2175('0x1a')]);}return _0x28c4b8(_0x12d150['error']['message']);}else{_0x28c4b8(_0x12d150[_0x2175('0x1b')]);}})[_0x2175('0x1c')](function(_0x2204cd){_0x46ea57(_0x2204cd);});});}function getAgent(_0x542273){return db[_0x2175('0x1d')]['findOne']({'where':{'id':_0x542273,'role':'agent'}})[_0x2175('0x18')](checkError());}function getAgentCheckSession(_0x183221,_0x475d6e){return new BPromise(function(_0x3c8986,_0xaa64ce){var _0x31cc46=respondWithRpcPromise(_0x2175('0x1e'));var _0x40d8c8=getAgent(_0x183221);Promise[_0x2175('0x1f')]([_0x31cc46,_0x40d8c8])[_0x2175('0x18')](function(_0x7b6edb){var _0x56dcf9=_0x7b6edb[0x0];var _0x20fccf=_0x7b6edb[0x1];var _0x1e91a6=_['filter'](_0x56dcf9['rows'],function(_0x3d64ac){return _0x3d64ac['UserId']==_0x20fccf['id']&&_0x3d64ac[_0x2175('0x20')]==_0x475d6e;});if(_0x1e91a6['length']==0x1){_0x3c8986(_0x20fccf);}else{_0xaa64ce(new RangeError('sessionId\x20'+_0x475d6e+'\x20not\x20found!'));}});});}exports[_0x2175('0x21')]=function(_0x2811b6,_0x3ba86e){logger[_0x2175('0x22')]('originate\x20fired:',_0x2811b6[_0x2175('0x23')]);var _0x2d9526=originateValidation['validate'](_0x2811b6[_0x2175('0x23')]);if(_0x2d9526[_0x2175('0x24')]>0x0){return _0x3ba86e['status'](0x190)['json'](_0x2d9526);}var _0x4f2cfb=_0x2811b6['body'][_0x2175('0x25')];var _0x1c28da=_0x2811b6[_0x2175('0x23')][_0x2175('0x26')];var _0x3f7bf3=_0x2811b6[_0x2175('0x23')][_0x2175('0x27')];var _0x325731=_0x2811b6['body']['callbackUrl'];return getAgent(_0x4f2cfb)['then'](function(_0x5c232a){logger['info'](_0x2175('0x28'),_0x5c232a[_0x2175('0x15')]);emit(util['format'](_0x2175('0x29'),_0x5c232a[_0x2175('0x15')]),_0x2175('0x2a'),{'callNumber':_0x1c28da,'callerId':_0x3f7bf3,'callbackUrl':_0x325731});return _0x3ba86e[_0x2175('0x16')](0xc8)[_0x2175('0x2b')]({'error':![],'message':_0x2175('0x2c')});})['catch'](handleError(_0x3ba86e));};exports[_0x2175('0x2d')]=function(_0x465ed5,_0x304e18){logger[_0x2175('0x22')](_0x2175('0x2e'),_0x465ed5[_0x2175('0x23')]);var _0x3f1812=hangupValidation[_0x2175('0x2f')](_0x465ed5[_0x2175('0x23')]);if(_0x3f1812[_0x2175('0x24')]>0x0){return _0x304e18[_0x2175('0x16')](0x190)['json'](_0x3f1812);}var _0x398015=_0x465ed5[_0x2175('0x23')][_0x2175('0x25')];var _0x4f5744=_0x465ed5['body'][_0x2175('0x20')];return getAgent(_0x398015)['then'](function(_0x724d49){logger[_0x2175('0x22')](_0x2175('0x28'),_0x724d49['name']);emit(util['format'](_0x2175('0x29'),_0x724d49[_0x2175('0x15')]),'webbar:hangup',{'sessionId':_0x4f5744});return _0x304e18['status'](0xc8)[_0x2175('0x2b')]({'error':![],'message':_0x2175('0x30')});})[_0x2175('0x1c')](handleError(_0x304e18));};exports['answer']=function(_0x2b2f32,_0x4343f9){logger[_0x2175('0x22')]('answer\x20fired:',_0x2b2f32['body']);var _0x459cee=answerValidation['validate'](_0x2b2f32[_0x2175('0x23')]);if(_0x459cee[_0x2175('0x24')]>0x0){return _0x4343f9['status'](0x190)['json'](_0x459cee);}var _0x4d8a30=_0x2b2f32[_0x2175('0x23')]['userId'];var _0x48688c=_0x2b2f32[_0x2175('0x23')]['sessionId'];return getAgent(_0x4d8a30)[_0x2175('0x18')](function(_0x18826a){logger[_0x2175('0x22')](_0x2175('0x28'),_0x18826a[_0x2175('0x15')]);emit(util[_0x2175('0x31')]('user:%s',_0x18826a[_0x2175('0x15')]),_0x2175('0x32'),{'sessionId':_0x48688c});return _0x4343f9[_0x2175('0x16')](0xc8)[_0x2175('0x2b')]({'error':![],'message':_0x2175('0x33')});})[_0x2175('0x1c')](handleError(_0x4343f9));};exports['hold']=function(_0x18bc16,_0x382f5c){logger[_0x2175('0x22')]('hold\x20fired:',_0x18bc16[_0x2175('0x23')]);var _0x522b4f=holdValidation['validate'](_0x18bc16[_0x2175('0x23')]);if(_0x522b4f[_0x2175('0x24')]>0x0){return _0x382f5c[_0x2175('0x16')](0x190)['json'](_0x522b4f);}var _0x32d6eb=_0x18bc16[_0x2175('0x23')][_0x2175('0x25')];var _0x2e5cfc=_0x18bc16[_0x2175('0x23')]['sessionId'];return getAgent(_0x32d6eb)['then'](function(_0xdb0a97){logger[_0x2175('0x22')](_0x2175('0x28'),_0xdb0a97[_0x2175('0x15')]);emit(util[_0x2175('0x31')]('user:%s',_0xdb0a97[_0x2175('0x15')]),_0x2175('0x34'),{'sessionId':_0x2e5cfc});return _0x382f5c[_0x2175('0x16')](0xc8)['json']({'error':![],'message':'hold\x20executed!'});})[_0x2175('0x1c')](handleError(_0x382f5c));};exports['unhold']=function(_0x5af419,_0x5bab81){logger['info'](_0x2175('0x35'),_0x5af419[_0x2175('0x23')]);var _0x4d0b79=unholdValidation['validate'](_0x5af419['body']);if(_0x4d0b79['length']>0x0){return _0x5bab81[_0x2175('0x16')](0x190)[_0x2175('0x2b')](_0x4d0b79);}var _0x5d18c2=_0x5af419['body'][_0x2175('0x25')];var _0x17705c=_0x5af419[_0x2175('0x23')][_0x2175('0x20')];return getAgent(_0x5d18c2)[_0x2175('0x18')](function(_0x4cd703){logger[_0x2175('0x22')]('entityFound:',_0x4cd703[_0x2175('0x15')]);emit(util[_0x2175('0x31')](_0x2175('0x29'),_0x4cd703[_0x2175('0x15')]),_0x2175('0x36'),{'sessionId':_0x17705c});return _0x5bab81[_0x2175('0x16')](0xc8)[_0x2175('0x2b')]({'error':![],'message':_0x2175('0x37')});})[_0x2175('0x1c')](handleError(_0x5bab81));};exports[_0x2175('0x38')]=function(_0x1f967d,_0x172844){logger[_0x2175('0x22')](_0x2175('0x39'),_0x172844[_0x2175('0x23')]);var _0x5e6d93=callsValidation[_0x2175('0x2f')](_0x1f967d[_0x2175('0x23')]);if(_0x5e6d93[_0x2175('0x24')]>0x0){return _0x172844[_0x2175('0x16')](0x190)['json'](_0x5e6d93);}var _0x10bd47=_0x1f967d['body'][_0x2175('0x25')];var _0xfd4b02=respondWithRpcPromise(_0x2175('0x1e'));var _0x1b26cc=getAgent(_0x10bd47);return Promise[_0x2175('0x1f')]([_0xfd4b02,_0x1b26cc])[_0x2175('0x18')](function(_0x177b5f){var _0xa2e4fb=_0x177b5f[0x0];var _0x5dfcf2=_0x177b5f[0x1];var _0x4f138b=_[_0x2175('0x3a')](_0xa2e4fb[_0x2175('0x3b')],function(_0x4ec9dc){return _0x4ec9dc['UserId']==_0x5dfcf2['id'];});return _0x172844[_0x2175('0x16')](0xc8)[_0x2175('0x2b')]({'count':_0x4f138b[_0x2175('0x24')],'rows':_0x4f138b});})[_0x2175('0x1c')](handleError(_0x172844));};exports['conference']=function(_0x3368be,_0x5a93b7){logger[_0x2175('0x22')](_0x2175('0x3c'),_0x3368be['body']);var _0x3e5b50=conferenceValidation[_0x2175('0x2f')](_0x3368be[_0x2175('0x23')]);if(_0x3e5b50[_0x2175('0x24')]>0x0){return _0x5a93b7[_0x2175('0x16')](0x190)['json'](_0x3e5b50);}var _0x209691=_0x3368be[_0x2175('0x23')]['userId'];return getAgent(_0x209691)[_0x2175('0x18')](function(_0x584439){logger[_0x2175('0x22')]('entityFound:',_0x584439[_0x2175('0x15')]);emit(util[_0x2175('0x31')](_0x2175('0x29'),_0x584439[_0x2175('0x15')]),_0x2175('0x3d'));return _0x5a93b7['status'](0xc8)[_0x2175('0x2b')]({'error':![],'message':_0x2175('0x3e')});})[_0x2175('0x1c')](handleError(_0x5a93b7));};exports[_0x2175('0x3f')]=function(_0x2747aa,_0x36d67e){logger['info']('transfer\x20fired:',_0x2747aa[_0x2175('0x23')]);var _0x12c327=transferValidation[_0x2175('0x2f')](_0x2747aa[_0x2175('0x23')]);if(_0x12c327[_0x2175('0x24')]>0x0){return _0x36d67e[_0x2175('0x16')](0x190)[_0x2175('0x2b')](_0x12c327);}var _0x2cae7b=_0x2747aa['body'][_0x2175('0x25')];var _0x318afb=_0x2747aa[_0x2175('0x23')]['sessionId'];var _0x57c5a9=_0x2747aa['body']['transferNumber'];return getAgent(_0x2cae7b)[_0x2175('0x18')](function(_0x17c15e){logger[_0x2175('0x22')](_0x2175('0x28'),_0x17c15e[_0x2175('0x15')]);emit(util[_0x2175('0x31')](_0x2175('0x29'),_0x17c15e[_0x2175('0x15')]),_0x2175('0x40'),{'sessionId':_0x318afb,'transferNumber':_0x57c5a9});return _0x36d67e['status'](0xc8)['json']({'error':![],'message':_0x2175('0x41')});})[_0x2175('0x1c')](handleError(_0x36d67e));};
\ No newline at end of file
index 546fa83..064027d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7880=['/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','notify','put','update','delete','removeDispositions','removeAnswers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x16af15,_0x55bc76){var _0xfeda8a=function(_0x13ad56){while(--_0x13ad56){_0x16af15['push'](_0x16af15['shift']());}};_0xfeda8a(++_0x55bc76);}(_0x7880,0x1f4));var _0x0788=function(_0x11bc40,_0x537bbc){_0x11bc40=_0x11bc40-0x0;var _0x2b7a99=_0x7880[_0x11bc40];return _0x2b7a99;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['get'](_0x0788('0x10'),auth[_0x0788('0xa')](),controller[_0x0788('0x11')]);router[_0x0788('0x9')](_0x0788('0x12'),auth['isAuthenticated'](),controller[_0x0788('0x13')]);router[_0x0788('0x9')](_0x0788('0x14'),auth[_0x0788('0xa')](),controller[_0x0788('0x15')]);router[_0x0788('0x9')](_0x0788('0x16'),auth['isAuthenticated'](),controller[_0x0788('0x17')]);router[_0x0788('0x18')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0x19')]);router['post'](_0x0788('0x10'),auth['isAuthenticated'](),controller[_0x0788('0x1a')]);router[_0x0788('0x18')](_0x0788('0x12'),auth[_0x0788('0xa')](),controller[_0x0788('0x1b')]);router[_0x0788('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0x0788('0x1c')]);router[_0x0788('0x18')]('/:id/applications',auth[_0x0788('0xa')](),controller[_0x0788('0x1d')]);router[_0x0788('0x18')]('/:id/notify',controller[_0x0788('0x1e')]);router[_0x0788('0x18')]('/:id/send',auth[_0x0788('0xa')](),controller['send']);router[_0x0788('0x1f')]('/:id',auth[_0x0788('0xa')](),controller[_0x0788('0x20')]);router[_0x0788('0x21')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['destroy']);router['delete'](_0x0788('0x10'),auth[_0x0788('0xa')](),controller[_0x0788('0x22')]);router[_0x0788('0x21')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x0788('0x23')]);router[_0x0788('0x21')](_0x0788('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x0788('0x24')]=router;
\ No newline at end of file
+var _0x14a0=['update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappAccount.controller','get','isAuthenticated','/describe','describe','getDispositions','/:id/canned_answers','/:id/users','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAgents','addApplications','/:id/notify','notify','/:id/send','put','/:id'];(function(_0x55ba29,_0x205216){var _0x56302d=function(_0x5ae62c){while(--_0x5ae62c){_0x55ba29['push'](_0x55ba29['shift']());}};_0x56302d(++_0x205216);}(_0x14a0,0x8e));var _0x014a=function(_0x59d581,_0x4a6a97){_0x59d581=_0x59d581-0x0;var _0x47c61b=_0x14a0[_0x59d581];return _0x47c61b;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['get']('/:id',auth[_0x014a('0x9')](),controller['show']);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['get'](_0x014a('0xd'),auth[_0x014a('0x9')](),controller['getAnswers']);router[_0x014a('0x8')](_0x014a('0xe'),auth[_0x014a('0x9')](),controller[_0x014a('0xf')]);router[_0x014a('0x8')](_0x014a('0x10'),auth[_0x014a('0x9')](),controller[_0x014a('0x11')]);router[_0x014a('0x12')]('/',auth[_0x014a('0x9')](),controller[_0x014a('0x13')]);router[_0x014a('0x12')]('/:id/dispositions',auth[_0x014a('0x9')](),controller[_0x014a('0x14')]);router['post'](_0x014a('0xd'),auth[_0x014a('0x9')](),controller['addAnswer']);router[_0x014a('0x12')](_0x014a('0xe'),auth[_0x014a('0x9')](),controller[_0x014a('0x15')]);router[_0x014a('0x12')](_0x014a('0x10'),auth[_0x014a('0x9')](),controller[_0x014a('0x16')]);router[_0x014a('0x12')](_0x014a('0x17'),controller[_0x014a('0x18')]);router[_0x014a('0x12')](_0x014a('0x19'),auth[_0x014a('0x9')](),controller['send']);router[_0x014a('0x1a')](_0x014a('0x1b'),auth[_0x014a('0x9')](),controller[_0x014a('0x1c')]);router[_0x014a('0x1d')](_0x014a('0x1b'),auth[_0x014a('0x9')](),controller[_0x014a('0x1e')]);router[_0x014a('0x1d')]('/:id/dispositions',auth[_0x014a('0x9')](),controller['removeDispositions']);router[_0x014a('0x1d')](_0x014a('0xd'),auth[_0x014a('0x9')](),controller[_0x014a('0x1f')]);router[_0x014a('0x1d')](_0x014a('0xe'),auth[_0x014a('0x9')](),controller[_0x014a('0x20')]);module[_0x014a('0x21')]=router;
\ No newline at end of file
index 833a356..c2daefb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf51f=['name','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xf51f,0xe6));var _0xff51=function(_0x2338fa,_0x80579a){_0x2338fa=_0x2338fa-0x0;var _0x42df9b=_0xf51f[_0x2338fa];return _0x42df9b;};'use strict';var Sequelize=require(_0xff51('0x0'));var rs=require(_0xff51('0x1'));module[_0xff51('0x2')]={'name':{'type':Sequelize[_0xff51('0x3')],'unique':_0xff51('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xff51('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xff51('0x3')],'defaultValue':function(){return rs[_0xff51('0x5')]();}},'phone':{'type':Sequelize[_0xff51('0x3')]},'type':{'type':Sequelize[_0xff51('0x6')](_0xff51('0x7'),_0xff51('0x8'))},'accountSid':{'type':Sequelize[_0xff51('0x3')]},'baseUrl':{'type':Sequelize[_0xff51('0x3')]},'authToken':{'type':Sequelize[_0xff51('0x3')]},'notificationTemplate':{'type':Sequelize[_0xff51('0x9')],'defaultValue':function(){return _0xff51('0xa');}},'notificationSound':{'type':Sequelize[_0xff51('0xb')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xff51('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xff51('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xff51('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xff51('0xc')],'comment':_0xff51('0xd')},'mandatoryDisposition':{'type':Sequelize[_0xff51('0xb')],'defaultValue':![],'comment':_0xff51('0xe'),'set':function(_0x1aee1d){if(!_0x1aee1d){this[_0xff51('0xf')](_0xff51('0x10'),null);}this[_0xff51('0xf')](_0xff51('0x11'),_0x1aee1d);}},'description':{'type':Sequelize[_0xff51('0x3')]}};
\ No newline at end of file
+var _0x0452=['sequelize','randomstring','exports','name','STRING','generate','twilio','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x41d995,_0xa30e68){var _0x45d4c4=function(_0x26289b){while(--_0x26289b){_0x41d995['push'](_0x41d995['shift']());}};_0x45d4c4(++_0xa30e68);}(_0x0452,0x186));var _0x2045=function(_0x1449f6,_0x52c6a7){_0x1449f6=_0x1449f6-0x0;var _0xe8f765=_0x0452[_0x1449f6];return _0xe8f765;};'use strict';var Sequelize=require(_0x2045('0x0'));var rs=require(_0x2045('0x1'));module[_0x2045('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x2045('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x2045('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x2045('0x4')],'allowNull':![]},'token':{'type':Sequelize[_0x2045('0x4')],'defaultValue':function(){return rs[_0x2045('0x5')]();}},'phone':{'type':Sequelize[_0x2045('0x4')]},'type':{'type':Sequelize['ENUM'](_0x2045('0x6'),'sinch')},'accountSid':{'type':Sequelize[_0x2045('0x4')]},'baseUrl':{'type':Sequelize[_0x2045('0x4')]},'authToken':{'type':Sequelize[_0x2045('0x4')]},'notificationTemplate':{'type':Sequelize[_0x2045('0x7')],'defaultValue':function(){return _0x2045('0x8');}},'notificationSound':{'type':Sequelize[_0x2045('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x2045('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2045('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2045('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2045('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2045('0xa')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x2045('0x9')],'defaultValue':![],'comment':_0x2045('0xb'),'set':function(_0x59624b){if(!_0x59624b){this[_0x2045('0xc')]('mandatoryDispositionPauseId',null);}this[_0x2045('0xc')]('mandatoryDisposition',_0x59624b);}},'description':{'type':Sequelize[_0x2045('0x4')]}};
\ No newline at end of file
index 85613a8..586e70f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4f8=['waitForTheAssignedAgent','*,*,*,*','Start','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','List','DESC','out','spread','dataValues','Messages','push','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','request','then','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','destroy','get','WhatsappAccounts','stack','name','mandatoryDispositionPause','WhatsappAccount','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','Pause','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addDisposition','WhatsappAccountId','getDispositions','findOne','Disposition','order','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','notify','whatsapp','account','statuses','state','read','WhatsappMessage','applications','orderBy','asc','Applications','CmContact','describe','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','MessageSid','sinch','notifications','messageId','message_id','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','defaults','contact','WhatsappInteraction','interaction','autoclose','close','unmanaged','created','ContactId','UserId','User','agent'];(function(_0x148fa1,_0x13eb86){var _0x52ed56=function(_0x421b18){while(--_0x421b18){_0x148fa1['push'](_0x148fa1['shift']());}};_0x52ed56(++_0x13eb86);}(_0xe4f8,0xcb));var _0x8e4f=function(_0x4a82ac,_0x1fb931){_0x4a82ac=_0x4a82ac-0x0;var _0x58ee97=_0xe4f8[_0x4a82ac];return _0x58ee97;};'use strict';var emlformat=require(_0x8e4f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8e4f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8e4f('0x2'));var moment=require(_0x8e4f('0x3'));var BPromise=require(_0x8e4f('0x4'));var Mustache=require(_0x8e4f('0x5'));var util=require(_0x8e4f('0x6'));var path=require(_0x8e4f('0x7'));var sox=require('sox');var csv=require(_0x8e4f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8e4f('0x9'));var _=require('lodash');var squel=require(_0x8e4f('0xa'));var crypto=require(_0x8e4f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8e4f('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8e4f('0xd'));var Papa=require(_0x8e4f('0xe'));var Redis=require(_0x8e4f('0xf'));var authService=require(_0x8e4f('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8e4f('0x11'));var logger=require(_0x8e4f('0x12'))('api');var utils=require(_0x8e4f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8e4f('0x14'));var db=require(_0x8e4f('0x15'))['db'];config[_0x8e4f('0x16')]=_['defaults'](config['redis'],{'host':_0x8e4f('0x17'),'port':0x18eb});var socket=require(_0x8e4f('0x18'))(new Redis(config[_0x8e4f('0x16')]));require(_0x8e4f('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x37409a,_0xfc3efd,_0x44002e,_0xcdc6d2){return new BPromise(function(_0x56d797,_0xd63606){var _0x25979f=_0xcdc6d2||client;return _0x25979f[_0x8e4f('0x1a')](_0x37409a,_0x44002e)[_0x8e4f('0x1b')](function(_0x379f74){logger['info'](_0x8e4f('0x1c'),_0xfc3efd,'request\x20sent');logger[_0x8e4f('0x1d')](_0x8e4f('0x1e'),_0xfc3efd,_0x8e4f('0x1f'),JSON[_0x8e4f('0x20')](_0x379f74));if(_0x379f74['error']){if(_0x379f74[_0x8e4f('0x21')]['code']===0x1f4){logger[_0x8e4f('0x21')](_0x8e4f('0x1c'),_0xfc3efd,_0x379f74[_0x8e4f('0x21')][_0x8e4f('0x22')]);return _0xd63606(_0x379f74['error'][_0x8e4f('0x22')]);}logger[_0x8e4f('0x21')](_0x8e4f('0x1c'),_0xfc3efd,_0x379f74[_0x8e4f('0x21')][_0x8e4f('0x22')]);return _0x56d797(_0x379f74[_0x8e4f('0x21')]['message']);}else{logger[_0x8e4f('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0xfc3efd,'request\x20sent');_0x56d797(_0x379f74[_0x8e4f('0x24')][_0x8e4f('0x22')]);}})[_0x8e4f('0x25')](function(_0x4006ec){logger['error'](_0x8e4f('0x1c'),_0xfc3efd,_0x4006ec);_0xd63606(_0x4006ec);});});}function respondWithStatusCode(_0x1fc937,_0x26c6e7){_0x26c6e7=_0x26c6e7||0xcc;return function(_0xdf7c80){if(_0xdf7c80){return _0x1fc937[_0x8e4f('0x26')](_0x26c6e7);}return _0x1fc937[_0x8e4f('0x27')](_0x26c6e7)[_0x8e4f('0x28')]();};}function respondWithResult(_0x431d81,_0x404ab5){_0x404ab5=_0x404ab5||0xc8;return function(_0x3c1ebf){if(_0x3c1ebf){return _0x431d81[_0x8e4f('0x27')](_0x404ab5)[_0x8e4f('0x29')](_0x3c1ebf);}};}function respondWithFilteredResult(_0x411e07,_0x5dbc6c){return function(_0xb7253){if(_0xb7253){var _0x5cc04b=typeof _0x5dbc6c[_0x8e4f('0x2a')]===_0x8e4f('0x2b')&&typeof _0x5dbc6c[_0x8e4f('0x2c')]==='undefined';var _0x1ece59=_0xb7253['count'];var _0x1a85e=_0x5cc04b?0x0:_0x5dbc6c[_0x8e4f('0x2a')];var _0x96ff14=_0x5cc04b?_0xb7253[_0x8e4f('0x2d')]:_0x5dbc6c['offset']+_0x5dbc6c[_0x8e4f('0x2c')];var _0x7e2a96;if(_0x96ff14>=_0x1ece59){_0x96ff14=_0x1ece59;_0x7e2a96=0xc8;}else{_0x7e2a96=0xce;}_0x411e07[_0x8e4f('0x27')](_0x7e2a96);return _0x411e07[_0x8e4f('0x2e')]('Content-Range',_0x1a85e+'-'+_0x96ff14+'/'+_0x1ece59)['json'](_0xb7253);}return null;};}function patchUpdates(_0x2fdd85){return function(_0x2c70e7){try{jsonpatch['apply'](_0x2c70e7,_0x2fdd85,!![]);}catch(_0x3494c7){return BPromise[_0x8e4f('0x2f')](_0x3494c7);}return _0x2c70e7[_0x8e4f('0x30')]();};}function saveUpdates(_0x1873ee,_0x1963aa){return function(_0x12814c){if(_0x12814c){return _0x12814c['update'](_0x1873ee)[_0x8e4f('0x1b')](function(_0x4dbc76){return _0x4dbc76;});}return null;};}function removeEntity(_0x1fd377,_0x5bc2d1){return function(_0x280c4d){if(_0x280c4d){return _0x280c4d[_0x8e4f('0x31')]()[_0x8e4f('0x1b')](function(){var _0x322643=_0x280c4d[_0x8e4f('0x32')]({'plain':!![]});var _0x4635af=_0x8e4f('0x33');return db['UserProfileResource'][_0x8e4f('0x31')]({'where':{'type':_0x4635af,'resourceId':_0x322643['id']}})[_0x8e4f('0x1b')](function(){return _0x280c4d;});})[_0x8e4f('0x1b')](function(){_0x1fd377[_0x8e4f('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x94034a,_0x37c979){return function(_0x141ba4){if(!_0x141ba4){_0x94034a['sendStatus'](0x194);}return _0x141ba4;};}function handleError(_0x500b60,_0x2b7603){_0x2b7603=_0x2b7603||0x1f4;return function(_0x3defdd){logger['error'](_0x3defdd[_0x8e4f('0x34')]);if(_0x3defdd[_0x8e4f('0x35')]){delete _0x3defdd[_0x8e4f('0x35')];}_0x500b60[_0x8e4f('0x27')](_0x2b7603)['send'](_0x3defdd);};}exports['index']=function(_0x554708,_0x1e3e6c){var _0x3f8086={'include':[{'model':db['Pause'],'as':_0x8e4f('0x36')}]},_0x3af1ac={},_0xf08ef4={'count':0x0,'rows':[]};var _0x19367c=_['map'](db[_0x8e4f('0x37')][_0x8e4f('0x38')],function(_0x2e7999){return{'name':_0x2e7999['fieldName'],'type':_0x2e7999['type'][_0x8e4f('0x39')]};});_0x3af1ac[_0x8e4f('0x3a')]=_['map'](_0x19367c,_0x8e4f('0x35'));_0x3af1ac['query']=_[_0x8e4f('0x3b')](_0x554708[_0x8e4f('0x3c')]);_0x3af1ac[_0x8e4f('0x3d')]=_['intersection'](_0x3af1ac[_0x8e4f('0x3a')],_0x3af1ac[_0x8e4f('0x3c')]);_0x3f8086['attributes']=_[_0x8e4f('0x3e')](_0x3af1ac[_0x8e4f('0x3a')],qs['fields'](_0x554708[_0x8e4f('0x3c')][_0x8e4f('0x3f')]));_0x3f8086['attributes']=_0x3f8086[_0x8e4f('0x40')][_0x8e4f('0x41')]?_0x3f8086[_0x8e4f('0x40')]:_0x3af1ac[_0x8e4f('0x3a')];if(!_0x554708[_0x8e4f('0x3c')][_0x8e4f('0x42')](_0x8e4f('0x43'))){_0x3f8086[_0x8e4f('0x2c')]=qs[_0x8e4f('0x2c')](_0x554708[_0x8e4f('0x3c')][_0x8e4f('0x2c')]);_0x3f8086['offset']=qs[_0x8e4f('0x2a')](_0x554708['query']['offset']);}_0x3f8086['order']=qs[_0x8e4f('0x44')](_0x554708[_0x8e4f('0x3c')][_0x8e4f('0x44')]);_0x3f8086[_0x8e4f('0x45')]=qs[_0x8e4f('0x3d')](_[_0x8e4f('0x46')](_0x554708['query'],_0x3af1ac[_0x8e4f('0x3d')]),_0x19367c);if(_0x554708[_0x8e4f('0x3c')]['filter']){_0x3f8086['where']=_[_0x8e4f('0x47')](_0x3f8086[_0x8e4f('0x45')],{'$or':_[_0x8e4f('0x48')](_0x19367c,function(_0x3b3cf8){if(_0x3b3cf8[_0x8e4f('0x49')]!==_0x8e4f('0x4a')){var _0x5c4253={};_0x5c4253[_0x3b3cf8[_0x8e4f('0x35')]]={'$like':'%'+_0x554708[_0x8e4f('0x3c')][_0x8e4f('0x4b')]+'%'};return _0x5c4253;}})});}_0x3f8086=_[_0x8e4f('0x47')]({},_0x3f8086,_0x554708[_0x8e4f('0x4c')]);var _0x5cca02={'where':_0x3f8086[_0x8e4f('0x45')]};return db['WhatsappAccount'][_0x8e4f('0x2d')](_0x5cca02)['then'](function(_0x534522){_0xf08ef4['count']=_0x534522;if(_0x554708['query'][_0x8e4f('0x4d')]){_0x3f8086[_0x8e4f('0x4e')]=[{'all':!![]}];}return db[_0x8e4f('0x37')][_0x8e4f('0x4f')](_0x3f8086);})['then'](function(_0x5c6c2f){_0xf08ef4[_0x8e4f('0x50')]=_0x5c6c2f;return _0xf08ef4;})['then'](respondWithFilteredResult(_0x1e3e6c,_0x3f8086))['catch'](handleError(_0x1e3e6c,null));};exports[_0x8e4f('0x51')]=function(_0x32f3ab,_0x3542d5){var _0x4c8056={'raw':![],'where':{'id':_0x32f3ab[_0x8e4f('0x52')]['id']},'include':[{'model':db[_0x8e4f('0x53')],'as':'mandatoryDispositionPause'}]},_0x4cf7ef={};_0x4cf7ef[_0x8e4f('0x3a')]=_[_0x8e4f('0x3b')](db[_0x8e4f('0x37')][_0x8e4f('0x38')]);_0x4cf7ef[_0x8e4f('0x3c')]=_[_0x8e4f('0x3b')](_0x32f3ab[_0x8e4f('0x3c')]);_0x4cf7ef['filters']=_[_0x8e4f('0x3e')](_0x4cf7ef[_0x8e4f('0x3a')],_0x4cf7ef[_0x8e4f('0x3c')]);_0x4c8056[_0x8e4f('0x40')]=_['intersection'](_0x4cf7ef[_0x8e4f('0x3a')],qs['fields'](_0x32f3ab[_0x8e4f('0x3c')][_0x8e4f('0x3f')]));_0x4c8056['attributes']=_0x4c8056[_0x8e4f('0x40')][_0x8e4f('0x41')]?_0x4c8056['attributes']:_0x4cf7ef['model'];if(_0x32f3ab[_0x8e4f('0x3c')][_0x8e4f('0x4d')]){_0x4c8056['include']=[{'all':!![]}];}_0x4c8056=_[_0x8e4f('0x47')]({},_0x4c8056,_0x32f3ab['options']);return db['WhatsappAccount'][_0x8e4f('0x54')](_0x4c8056)[_0x8e4f('0x1b')](handleEntityNotFound(_0x3542d5,null))[_0x8e4f('0x1b')](respondWithResult(_0x3542d5,null))[_0x8e4f('0x25')](handleError(_0x3542d5,null));};exports['create']=function(_0x41824d,_0x4fd9ee){return db['WhatsappAccount'][_0x8e4f('0x55')](_0x41824d[_0x8e4f('0x56')],{})['then'](function(_0x29071b){var _0x7266e8=_0x41824d[_0x8e4f('0x57')][_0x8e4f('0x32')]({'plain':!![]});if(!_0x7266e8)throw new Error(_0x8e4f('0x58'));if(_0x7266e8['role']==='user'){var _0x2507a5=_0x29071b['get']({'plain':!![]});var _0x39c1d1='WhatsappAccounts';return db[_0x8e4f('0x59')][_0x8e4f('0x54')]({'where':{'name':_0x39c1d1,'userProfileId':_0x7266e8['userProfileId']},'raw':!![]})['then'](function(_0x2fca18){if(_0x2fca18&&_0x2fca18['autoAssociation']===0x0){return db[_0x8e4f('0x5a')][_0x8e4f('0x55')]({'name':_0x2507a5[_0x8e4f('0x35')],'resourceId':_0x2507a5['id'],'type':_0x2fca18[_0x8e4f('0x35')],'sectionId':_0x2fca18['id']},{})['then'](function(){return _0x29071b;});}else{return _0x29071b;}})[_0x8e4f('0x25')](function(_0x4bf394){logger[_0x8e4f('0x21')](_0x8e4f('0x5b'),_0x4bf394);throw _0x4bf394;});}return _0x29071b;})[_0x8e4f('0x1b')](respondWithResult(_0x4fd9ee,0xc9))['catch'](handleError(_0x4fd9ee,null));};exports[_0x8e4f('0x5c')]=function(_0x530b26,_0x2db3a4){if(_0x530b26[_0x8e4f('0x56')]['id']){delete _0x530b26['body']['id'];}return db['WhatsappAccount'][_0x8e4f('0x54')]({'where':{'id':_0x530b26[_0x8e4f('0x52')]['id']},'include':[{'model':db[_0x8e4f('0x53')],'as':_0x8e4f('0x36')}]})[_0x8e4f('0x1b')](handleEntityNotFound(_0x2db3a4,null))[_0x8e4f('0x1b')](saveUpdates(_0x530b26[_0x8e4f('0x56')],null))[_0x8e4f('0x1b')](respondWithResult(_0x2db3a4,null))[_0x8e4f('0x25')](handleError(_0x2db3a4,null));};exports[_0x8e4f('0x31')]=function(_0x19c572,_0x2f7b18){return db['WhatsappAccount'][_0x8e4f('0x54')]({'where':{'id':_0x19c572['params']['id']}})[_0x8e4f('0x1b')](handleEntityNotFound(_0x2f7b18,null))[_0x8e4f('0x1b')](removeEntity(_0x2f7b18,null))['catch'](handleError(_0x2f7b18,null));};exports['describe']=function(_0x37bd9d,_0x534d40){return db[_0x8e4f('0x37')]['describe']()[_0x8e4f('0x1b')](respondWithResult(_0x534d40,null))[_0x8e4f('0x25')](handleError(_0x534d40,null));};exports[_0x8e4f('0x5d')]=function(_0x555b27,_0x4c207a,_0x5d219d){if(_0x555b27[_0x8e4f('0x56')]['id']){delete _0x555b27['body']['id'];}return db[_0x8e4f('0x37')][_0x8e4f('0x54')]({'where':{'id':_0x555b27[_0x8e4f('0x52')]['id']}})[_0x8e4f('0x1b')](handleEntityNotFound(_0x4c207a,null))['then'](function(_0x56474e){if(_0x56474e){_0x555b27[_0x8e4f('0x56')][_0x8e4f('0x5e')]=_0x56474e['id'];return db['Disposition']['create'](_0x555b27[_0x8e4f('0x56')]);}})[_0x8e4f('0x1b')](respondWithResult(_0x4c207a,null))[_0x8e4f('0x25')](handleError(_0x4c207a,null));};exports[_0x8e4f('0x5f')]=function(_0x4aab29,_0x274abf,_0x53fab9){var _0x147a80={'raw':![],'where':{}};var _0x31615f={};var _0x33f96f={'count':0x0,'rows':[]};return db[_0x8e4f('0x37')][_0x8e4f('0x60')]({'where':{'id':_0x4aab29[_0x8e4f('0x52')]['id']}})[_0x8e4f('0x1b')](handleEntityNotFound(_0x274abf,null))['then'](function(_0x1c40ac){if(_0x1c40ac){_0x31615f[_0x8e4f('0x3a')]=_[_0x8e4f('0x3b')](db[_0x8e4f('0x61')][_0x8e4f('0x38')]);_0x31615f[_0x8e4f('0x3c')]=_[_0x8e4f('0x3b')](_0x4aab29['query']);_0x31615f[_0x8e4f('0x3d')]=_['intersection'](_0x31615f[_0x8e4f('0x3a')],_0x31615f[_0x8e4f('0x3c')]);_0x147a80[_0x8e4f('0x40')]=_[_0x8e4f('0x3e')](_0x31615f[_0x8e4f('0x3a')],qs[_0x8e4f('0x3f')](_0x4aab29['query'][_0x8e4f('0x3f')]));_0x147a80['attributes']=_0x147a80[_0x8e4f('0x40')][_0x8e4f('0x41')]?_0x147a80[_0x8e4f('0x40')]:_0x31615f[_0x8e4f('0x3a')];if(!_0x4aab29[_0x8e4f('0x3c')]['hasOwnProperty'](_0x8e4f('0x43'))){_0x147a80[_0x8e4f('0x2c')]=qs[_0x8e4f('0x2c')](_0x4aab29[_0x8e4f('0x3c')][_0x8e4f('0x2c')]);_0x147a80[_0x8e4f('0x2a')]=qs[_0x8e4f('0x2a')](_0x4aab29['query'][_0x8e4f('0x2a')]);}_0x147a80[_0x8e4f('0x62')]=qs[_0x8e4f('0x44')](_0x4aab29[_0x8e4f('0x3c')]['sort']);_0x147a80[_0x8e4f('0x45')]=qs[_0x8e4f('0x3d')](_[_0x8e4f('0x46')](_0x4aab29['query'],_0x31615f[_0x8e4f('0x3d')]));_0x147a80[_0x8e4f('0x45')][_0x8e4f('0x5e')]=_0x1c40ac['id'];if(_0x4aab29[_0x8e4f('0x3c')]['filter']){_0x147a80['where']=_['merge'](_0x147a80['where'],{'$or':_[_0x8e4f('0x48')](_0x147a80['attributes'],function(_0x507226){var _0x479a7d={};_0x479a7d[_0x507226]={'$like':'%'+_0x4aab29[_0x8e4f('0x3c')][_0x8e4f('0x4b')]+'%'};return _0x479a7d;})});}_0x147a80=_[_0x8e4f('0x47')]({},_0x147a80,_0x4aab29[_0x8e4f('0x4c')]);return db[_0x8e4f('0x61')]['count']({'where':_0x147a80[_0x8e4f('0x45')]})[_0x8e4f('0x1b')](function(_0x5f2a2f){_0x33f96f[_0x8e4f('0x2d')]=_0x5f2a2f;if(_0x4aab29['query']['includeAll']){_0x147a80['include']=[{'all':!![]}];}return db[_0x8e4f('0x61')][_0x8e4f('0x4f')](_0x147a80);})['then'](function(_0x26f47a){_0x33f96f[_0x8e4f('0x50')]=_0x26f47a;return _0x33f96f;});}})[_0x8e4f('0x1b')](respondWithFilteredResult(_0x274abf,_0x147a80))[_0x8e4f('0x25')](handleError(_0x274abf,null));};exports[_0x8e4f('0x63')]=function(_0x23ff3a,_0x4087f3,_0x4babd7){return db['WhatsappAccount']['find']({'where':{'id':_0x23ff3a[_0x8e4f('0x52')]['id']}})[_0x8e4f('0x1b')](handleEntityNotFound(_0x4087f3,null))[_0x8e4f('0x1b')](function(_0xc9b94d){if(_0xc9b94d){return _0xc9b94d[_0x8e4f('0x63')](_0x23ff3a['query'][_0x8e4f('0x64')]);}})[_0x8e4f('0x1b')](respondWithStatusCode(_0x4087f3,null))[_0x8e4f('0x25')](handleError(_0x4087f3,null));};exports[_0x8e4f('0x65')]=function(_0x522c87,_0x4f9abf,_0xb5d6c){if(_0x522c87[_0x8e4f('0x56')]['id']){delete _0x522c87['body']['id'];}return db[_0x8e4f('0x37')][_0x8e4f('0x54')]({'where':{'id':_0x522c87[_0x8e4f('0x52')]['id']}})[_0x8e4f('0x1b')](handleEntityNotFound(_0x4f9abf,null))[_0x8e4f('0x1b')](function(_0x4870c9){if(_0x4870c9){_0x522c87[_0x8e4f('0x56')]['WhatsappAccountId']=_0x4870c9['id'];return db['CannedAnswer'][_0x8e4f('0x55')](_0x522c87[_0x8e4f('0x56')]);}})[_0x8e4f('0x1b')](respondWithResult(_0x4f9abf,null))[_0x8e4f('0x25')](handleError(_0x4f9abf,null));};exports['getAnswers']=function(_0x531113,_0x520ce5,_0xce540d){var _0x44c5a1={'raw':![],'where':{}};var _0x847157={};var _0x9d74e={'count':0x0,'rows':[]};return db[_0x8e4f('0x37')]['findOne']({'where':{'id':_0x531113['params']['id']}})[_0x8e4f('0x1b')](handleEntityNotFound(_0x520ce5,null))['then'](function(_0x2cc4d5){if(_0x2cc4d5){_0x847157[_0x8e4f('0x3a')]=_[_0x8e4f('0x3b')](db['CannedAnswer'][_0x8e4f('0x38')]);_0x847157[_0x8e4f('0x3c')]=_[_0x8e4f('0x3b')](_0x531113['query']);_0x847157['filters']=_['intersection'](_0x847157[_0x8e4f('0x3a')],_0x847157[_0x8e4f('0x3c')]);_0x44c5a1[_0x8e4f('0x40')]=_['intersection'](_0x847157[_0x8e4f('0x3a')],qs[_0x8e4f('0x3f')](_0x531113[_0x8e4f('0x3c')][_0x8e4f('0x3f')]));_0x44c5a1[_0x8e4f('0x40')]=_0x44c5a1[_0x8e4f('0x40')]['length']?_0x44c5a1[_0x8e4f('0x40')]:_0x847157[_0x8e4f('0x3a')];if(!_0x531113['query'][_0x8e4f('0x42')]('nolimit')){_0x44c5a1[_0x8e4f('0x2c')]=qs[_0x8e4f('0x2c')](_0x531113[_0x8e4f('0x3c')][_0x8e4f('0x2c')]);_0x44c5a1[_0x8e4f('0x2a')]=qs[_0x8e4f('0x2a')](_0x531113['query'][_0x8e4f('0x2a')]);}_0x44c5a1[_0x8e4f('0x62')]=qs[_0x8e4f('0x44')](_0x531113[_0x8e4f('0x3c')]['sort']);_0x44c5a1['where']=qs[_0x8e4f('0x3d')](_[_0x8e4f('0x46')](_0x531113[_0x8e4f('0x3c')],_0x847157[_0x8e4f('0x3d')]));_0x44c5a1[_0x8e4f('0x45')][_0x8e4f('0x5e')]=_0x2cc4d5['id'];if(_0x531113[_0x8e4f('0x3c')][_0x8e4f('0x4b')]){_0x44c5a1[_0x8e4f('0x45')]=_[_0x8e4f('0x47')](_0x44c5a1['where'],{'$or':_[_0x8e4f('0x48')](_0x44c5a1['attributes'],function(_0xf0d4fb){var _0x330eec={};_0x330eec[_0xf0d4fb]={'$like':'%'+_0x531113[_0x8e4f('0x3c')]['filter']+'%'};return _0x330eec;})});}_0x44c5a1=_[_0x8e4f('0x47')]({},_0x44c5a1,_0x531113[_0x8e4f('0x4c')]);return db[_0x8e4f('0x66')][_0x8e4f('0x2d')]({'where':_0x44c5a1['where']})['then'](function(_0x174958){_0x9d74e[_0x8e4f('0x2d')]=_0x174958;if(_0x531113[_0x8e4f('0x3c')]['includeAll']){_0x44c5a1[_0x8e4f('0x4e')]=[{'all':!![]}];}return db[_0x8e4f('0x66')][_0x8e4f('0x4f')](_0x44c5a1);})['then'](function(_0x257e33){_0x9d74e[_0x8e4f('0x50')]=_0x257e33;return _0x9d74e;});}})['then'](respondWithFilteredResult(_0x520ce5,_0x44c5a1))[_0x8e4f('0x25')](handleError(_0x520ce5,null));};exports[_0x8e4f('0x67')]=function(_0x306931,_0x13bf1a,_0x440800){return db[_0x8e4f('0x37')][_0x8e4f('0x54')]({'where':{'id':_0x306931['params']['id']}})[_0x8e4f('0x1b')](handleEntityNotFound(_0x13bf1a,null))[_0x8e4f('0x1b')](function(_0x1312aa){if(_0x1312aa){return _0x1312aa['removeAnswers'](_0x306931[_0x8e4f('0x3c')]['ids']);}})[_0x8e4f('0x1b')](respondWithStatusCode(_0x13bf1a,null))['catch'](handleError(_0x13bf1a,null));};exports['addAgents']=function(_0x3d26e5,_0x2a95ae,_0x10f71f){return db[_0x8e4f('0x37')][_0x8e4f('0x54')]({'where':{'id':_0x3d26e5[_0x8e4f('0x52')]['id']}})[_0x8e4f('0x1b')](handleEntityNotFound(_0x2a95ae,null))[_0x8e4f('0x1b')](function(_0xa183b0){if(_0xa183b0){return _0xa183b0[_0x8e4f('0x68')](_0x3d26e5[_0x8e4f('0x56')]['ids'],_[_0x8e4f('0x69')](_0x3d26e5['body'],[_0x8e4f('0x64'),'id'])||{})['spread'](function(_0x2dad59){for(var _0x24c677=0x0;_0x24c677<_0x3d26e5[_0x8e4f('0x56')][_0x8e4f('0x64')][_0x8e4f('0x41')];_0x24c677+=0x1){socket[_0x8e4f('0x6a')](_0x8e4f('0x6b'),{'UserId':Number(_0x3d26e5['body'][_0x8e4f('0x64')][_0x24c677]),'WhatsappAccountId':Number(_0x3d26e5['params']['id'])});}return _0x2dad59;});}})[_0x8e4f('0x1b')](respondWithResult(_0x2a95ae,null))[_0x8e4f('0x25')](handleError(_0x2a95ae,null));};exports[_0x8e4f('0x6c')]=function(_0x132e04,_0x46c121,_0x52c3ef){return db[_0x8e4f('0x37')][_0x8e4f('0x54')]({'where':{'id':_0x132e04[_0x8e4f('0x52')]['id']}})['then'](handleEntityNotFound(_0x46c121,null))['then'](function(_0x4228e3){if(_0x4228e3){return _0x4228e3[_0x8e4f('0x6c')](_0x132e04[_0x8e4f('0x3c')]['ids'])[_0x8e4f('0x1b')](function(){if(_[_0x8e4f('0x6d')](_0x132e04[_0x8e4f('0x3c')][_0x8e4f('0x64')])){for(var _0x1405ee=0x0;_0x1405ee<_0x132e04[_0x8e4f('0x3c')]['ids']['length'];_0x1405ee+=0x1){socket['emit'](_0x8e4f('0x6e'),{'UserId':Number(_0x132e04[_0x8e4f('0x3c')][_0x8e4f('0x64')][_0x1405ee]),'WhatsappAccountId':Number(_0x132e04[_0x8e4f('0x52')]['id'])});}}else{socket['emit'](_0x8e4f('0x6e'),{'UserId':Number(_0x132e04['query'][_0x8e4f('0x64')]),'WhatsappAccountId':Number(_0x132e04['params']['id'])});}});}})['then'](respondWithStatusCode(_0x46c121,null))[_0x8e4f('0x25')](handleError(_0x46c121,null));};exports['getAgents']=function(_0x36fe20,_0x4e531c,_0x1f54df){var _0xf2f2cc={};var _0x4a1c7d={};var _0x26ffdd;var _0x5b3f10;return db[_0x8e4f('0x37')][_0x8e4f('0x60')]({'where':{'id':_0x36fe20[_0x8e4f('0x52')]['id']}})[_0x8e4f('0x1b')](handleEntityNotFound(_0x4e531c,null))[_0x8e4f('0x1b')](function(_0x105b8a){if(_0x105b8a){_0x26ffdd=_0x105b8a;_0x4a1c7d['model']=_['keys'](db['User'][_0x8e4f('0x38')]);_0x4a1c7d['query']=_[_0x8e4f('0x3b')](_0x36fe20[_0x8e4f('0x3c')]);_0x4a1c7d[_0x8e4f('0x3d')]=_['intersection'](_0x4a1c7d[_0x8e4f('0x3a')],_0x4a1c7d[_0x8e4f('0x3c')]);_0xf2f2cc[_0x8e4f('0x40')]=_[_0x8e4f('0x3e')](_0x4a1c7d[_0x8e4f('0x3a')],qs[_0x8e4f('0x3f')](_0x36fe20[_0x8e4f('0x3c')][_0x8e4f('0x3f')]));_0xf2f2cc[_0x8e4f('0x40')]=_0xf2f2cc[_0x8e4f('0x40')][_0x8e4f('0x41')]?_0xf2f2cc[_0x8e4f('0x40')]:_0x4a1c7d[_0x8e4f('0x3a')];_0xf2f2cc[_0x8e4f('0x62')]=qs[_0x8e4f('0x44')](_0x36fe20[_0x8e4f('0x3c')][_0x8e4f('0x44')]);_0xf2f2cc[_0x8e4f('0x45')]=qs[_0x8e4f('0x3d')](_[_0x8e4f('0x46')](_0x36fe20[_0x8e4f('0x3c')],_0x4a1c7d[_0x8e4f('0x3d')]));if(_0x36fe20[_0x8e4f('0x3c')][_0x8e4f('0x4b')]){_0xf2f2cc[_0x8e4f('0x45')]=_[_0x8e4f('0x47')](_0xf2f2cc[_0x8e4f('0x45')],{'$or':_[_0x8e4f('0x48')](_0xf2f2cc[_0x8e4f('0x40')],function(_0x2c127a){var _0x2a2707={};_0x2a2707[_0x2c127a]={'$like':'%'+_0x36fe20[_0x8e4f('0x3c')]['filter']+'%'};return _0x2a2707;})});}_0xf2f2cc=_[_0x8e4f('0x47')]({},_0xf2f2cc,_0x36fe20['options']);return _0x26ffdd[_0x8e4f('0x6f')](_0xf2f2cc);}})['then'](function(_0x2ec183){if(_0x2ec183){_0x5b3f10=_0x2ec183[_0x8e4f('0x41')];if(!_0x36fe20[_0x8e4f('0x3c')]['hasOwnProperty'](_0x8e4f('0x43'))){_0xf2f2cc[_0x8e4f('0x2c')]=qs[_0x8e4f('0x2c')](_0x36fe20[_0x8e4f('0x3c')][_0x8e4f('0x2c')]);_0xf2f2cc[_0x8e4f('0x2a')]=qs[_0x8e4f('0x2a')](_0x36fe20[_0x8e4f('0x3c')][_0x8e4f('0x2a')]);}return _0x26ffdd[_0x8e4f('0x6f')](_0xf2f2cc);}})[_0x8e4f('0x1b')](function(_0x26e588){if(_0x26e588){return _0x26e588?{'count':_0x5b3f10,'rows':_0x26e588}:null;}})[_0x8e4f('0x1b')](respondWithResult(_0x4e531c,null))[_0x8e4f('0x25')](handleError(_0x4e531c,null));};exports[_0x8e4f('0x70')]=function(_0x35f5fe,_0x490c89){var _0x5a9df1=_0x35f5fe[_0x8e4f('0x52')]['id'];var _0x233a66=_0x35f5fe[_0x8e4f('0x56')];var _0x1db5a1=0xc8;var _0x472a9d=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x8e4f('0x71')][_0x8e4f('0x72')][_0x8e4f('0x73')][_0x8e4f('0x74')]},function(_0x459f3f){return db[_0x8e4f('0x37')][_0x8e4f('0x60')]({'where':{'id':_0x5a9df1},'transaction':_0x459f3f})['then'](function(_0x49fcc5){if(_0x49fcc5){return db[_0x8e4f('0x75')][_0x8e4f('0x31')]({'where':{'WhatsappAccountId':_0x5a9df1},'transaction':_0x459f3f})[_0x8e4f('0x1b')](function(){var _0x144140=_['map'](_0x233a66,function(_0x2c404b){_0x2c404b[_0x8e4f('0x5e')]=_0x5a9df1;return _0x2c404b;});return db[_0x8e4f('0x75')][_0x8e4f('0x76')](_0x144140,{'transaction':_0x459f3f});});}else{_0x1db5a1=0x194;_0x472a9d=[];}});})[_0x8e4f('0x1b')](function(){if(_0x1db5a1!==0x194){return db['WhatsappApplication'][_0x8e4f('0x77')]({'where':{'WhatsappAccountId':_0x5a9df1},'order':_0x8e4f('0x78')})['then'](function(_0x1cc4d1){_0x472a9d=_0x1cc4d1;});}})[_0x8e4f('0x25')](function(_0x587ef7){_0x1db5a1=0x1f4;logger[_0x8e4f('0x21')](_0x587ef7['stack']);if(_0x587ef7[_0x8e4f('0x35')]){delete _0x587ef7[_0x8e4f('0x35')];}_0x472a9d=_0x587ef7;})[_0x8e4f('0x79')](function(){if(_0x472a9d===null){_0x490c89['sendStatus'](_0x1db5a1);}else{if(_0x1db5a1===0x1f4){_0x490c89['status'](_0x1db5a1)['send'](_0x472a9d);}else{_0x490c89[_0x8e4f('0x27')](_0x1db5a1)[_0x8e4f('0x29')](_0x472a9d);}}});};exports['getApplications']=function(_0x16e3e7,_0x565752,_0x58f5cb){var _0x21b3ed={};var _0x3c7c91={};var _0x2bbabe;var _0x5ef73a;return db[_0x8e4f('0x37')][_0x8e4f('0x60')]({'where':{'id':_0x16e3e7['params']['id']}})[_0x8e4f('0x1b')](handleEntityNotFound(_0x565752,null))[_0x8e4f('0x1b')](function(_0x1e5b1c){if(_0x1e5b1c){_0x2bbabe=_0x1e5b1c;_0x3c7c91[_0x8e4f('0x3a')]=_[_0x8e4f('0x3b')](db[_0x8e4f('0x75')][_0x8e4f('0x38')]);_0x3c7c91[_0x8e4f('0x3c')]=_[_0x8e4f('0x3b')](_0x16e3e7['query']);_0x3c7c91[_0x8e4f('0x3d')]=_[_0x8e4f('0x3e')](_0x3c7c91['model'],_0x3c7c91['query']);_0x21b3ed[_0x8e4f('0x40')]=_[_0x8e4f('0x3e')](_0x3c7c91[_0x8e4f('0x3a')],qs[_0x8e4f('0x3f')](_0x16e3e7['query'][_0x8e4f('0x3f')]));_0x21b3ed['attributes']=_0x21b3ed[_0x8e4f('0x40')]['length']?_0x21b3ed['attributes']:_0x3c7c91[_0x8e4f('0x3a')];_0x21b3ed[_0x8e4f('0x62')]=qs[_0x8e4f('0x44')](_0x16e3e7[_0x8e4f('0x3c')][_0x8e4f('0x44')]);_0x21b3ed['where']=qs[_0x8e4f('0x3d')](_['pick'](_0x16e3e7[_0x8e4f('0x3c')],_0x3c7c91[_0x8e4f('0x3d')]));if(_0x16e3e7[_0x8e4f('0x3c')][_0x8e4f('0x4b')]){_0x21b3ed[_0x8e4f('0x45')]=_['merge'](_0x21b3ed[_0x8e4f('0x45')],{'$or':_['map'](_0x21b3ed[_0x8e4f('0x40')],function(_0x3d9410){var _0x4f9365={};_0x4f9365[_0x3d9410]={'$like':'%'+_0x16e3e7[_0x8e4f('0x3c')][_0x8e4f('0x4b')]+'%'};return _0x4f9365;})});}_0x21b3ed=_[_0x8e4f('0x47')]({},_0x21b3ed,_0x16e3e7['options']);return _0x2bbabe[_0x8e4f('0x7a')](_0x21b3ed);}})[_0x8e4f('0x1b')](function(_0x5b3cef){if(_0x5b3cef){_0x5ef73a=_0x5b3cef[_0x8e4f('0x41')];if(!_0x16e3e7['query']['hasOwnProperty'](_0x8e4f('0x43'))){_0x21b3ed['limit']=qs[_0x8e4f('0x2c')](_0x16e3e7[_0x8e4f('0x3c')][_0x8e4f('0x2c')]);_0x21b3ed[_0x8e4f('0x2a')]=qs['offset'](_0x16e3e7['query']['offset']);}return _0x2bbabe['getApplications'](_0x21b3ed);}})[_0x8e4f('0x1b')](function(_0x5135fc){if(_0x5135fc){return _0x5135fc?{'count':_0x5ef73a,'rows':_0x5135fc}:null;}})[_0x8e4f('0x1b')](respondWithResult(_0x565752,null))[_0x8e4f('0x25')](handleError(_0x565752,null));};exports[_0x8e4f('0x7b')]=function(_0x54e020,_0x559e57,_0x51b13f){var _0x244b27={'channel':_0x8e4f('0x7c')};var _0xf05955=[];var _0x3fb3b7=[];var _0x113a55={};return db[_0x8e4f('0x37')][_0x8e4f('0x54')]({'where':{'id':_0x54e020[_0x8e4f('0x52')]['id']},'include':[{'model':db[_0x8e4f('0x75')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x559e57,null))[_0x8e4f('0x1b')](function(_0x2d32f9){_0x244b27[_0x8e4f('0x7d')]=_0x2d32f9;if(_0x244b27[_0x8e4f('0x7d')]&&_0x244b27[_0x8e4f('0x7d')][_0x8e4f('0x49')]==='sinch'&&_0x54e020[_0x8e4f('0x56')][_0x8e4f('0x7e')]){if(_0x54e020[_0x8e4f('0x56')][_0x8e4f('0x7e')][_0x8e4f('0x41')]===0x0)return;if(_0x54e020['body'][_0x8e4f('0x7e')][0x0][_0x8e4f('0x7f')]!==_0x8e4f('0x80'))return;return db[_0x8e4f('0x81')][_0x8e4f('0x5c')]({'read':!![],'readAt':_0x54e020[_0x8e4f('0x56')][_0x8e4f('0x7e')][0x0]['timestamp']},{'where':{'messageId':_0x54e020[_0x8e4f('0x56')][_0x8e4f('0x7e')][0x0]['message_id']},'individualHooks':!![]})[_0x8e4f('0x1b')](function(_0x3c0c40){return _0x559e57[_0x8e4f('0x27')](0xc8)[_0x8e4f('0x29')](_0x3c0c40);});}_0x244b27[_0x8e4f('0x82')]=_[_0x8e4f('0x83')](_0x2d32f9['Applications'],[_0x8e4f('0x78')],[_0x8e4f('0x84')]);if(_0x244b27['account'][_0x8e4f('0x85')]){delete _0x244b27[_0x8e4f('0x7d')]['Applications'];}return db[_0x8e4f('0x86')][_0x8e4f('0x87')]()['then'](function(_0x1f7451){if(!_0x1f7451){throw new db['Sequelize'][(_0x8e4f('0x88'))]('no\x20available\x20attributes');}_0xf05955=_[_0x8e4f('0x89')](_[_0x8e4f('0x3b')](_0x1f7451),[_0x8e4f('0x8a'),'updatedAt']);_0x3fb3b7=_[_0x8e4f('0x89')](_[_0x8e4f('0x3b')](_0x1f7451),[_0x8e4f('0x8a'),_0x8e4f('0x8b'),_0x8e4f('0x8c'),_0x8e4f('0x8d')]);_0x244b27['body']={'mapKey':_0x8e4f('0x8e')};if(_0x244b27[_0x8e4f('0x7d')]&&_0x244b27[_0x8e4f('0x7d')][_0x8e4f('0x49')]===_0x8e4f('0x8f')){_0x244b27[_0x8e4f('0x56')][_0x8e4f('0x90')]=_0x54e020[_0x8e4f('0x56')][_0x8e4f('0x91')][_0x8e4f('0x92')]('whatsapp:','');_0x244b27[_0x8e4f('0x56')]['body']=_0x54e020[_0x8e4f('0x56')]['Body'];_0x244b27[_0x8e4f('0x56')]['messageId']=_0x54e020['body'][_0x8e4f('0x93')];}if(_0x244b27[_0x8e4f('0x7d')]&&_0x244b27[_0x8e4f('0x7d')]['type']===_0x8e4f('0x94')){_0x244b27[_0x8e4f('0x56')][_0x8e4f('0x90')]=_0x54e020[_0x8e4f('0x56')][_0x8e4f('0x95')][0x0][_0x8e4f('0x90')];_0x244b27[_0x8e4f('0x56')][_0x8e4f('0x56')]=_0x54e020[_0x8e4f('0x56')][_0x8e4f('0x95')][0x0][_0x8e4f('0x22')][_0x8e4f('0x56')];_0x244b27[_0x8e4f('0x56')][_0x8e4f('0x96')]=_0x54e020[_0x8e4f('0x56')][_0x8e4f('0x95')][0x0][_0x8e4f('0x97')];}if(_0x244b27['body']['id']){delete _0x244b27[_0x8e4f('0x56')]['id'];}if(_[_0x8e4f('0x98')](_0x244b27['body'][_0x8e4f('0x90')])){throw new db[(_0x8e4f('0x99'))][(_0x8e4f('0x88'))](_0x8e4f('0x9a'));}if(_[_0x8e4f('0x98')](_0x244b27[_0x8e4f('0x56')]['body'])||_0x244b27[_0x8e4f('0x56')][_0x8e4f('0x56')]===''){throw new db[(_0x8e4f('0x99'))][(_0x8e4f('0x88'))](_0x8e4f('0x9b'));}if(_[_0x8e4f('0x98')](_0x244b27[_0x8e4f('0x56')]['mapKey'])){throw new db['Sequelize'][(_0x8e4f('0x88'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3fb3b7);}if(!_['includes'](_0x3fb3b7,_0x244b27['body'][_0x8e4f('0x9c')])){throw new db[(_0x8e4f('0x99'))][(_0x8e4f('0x88'))](_0x8e4f('0x9d')+_0x3fb3b7);}_0x113a55[_0x244b27['body'][_0x8e4f('0x9c')]]=_0x244b27['body'][_0x8e4f('0x90')];return db[_0x8e4f('0x9e')][_0x8e4f('0x54')]({'where':{'id':_0x244b27[_0x8e4f('0x7d')][_0x8e4f('0x8d')]},'include':[{'model':db['CmContact'],'as':_0x8e4f('0x9f'),'where':_0x113a55,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x8e4f('0x1b')](handleEntityNotFound(_0x559e57,null))[_0x8e4f('0x1b')](function(_0x2aa207){if(_0x2aa207){_0x244b27[_0x8e4f('0xa0')]=_[_0x8e4f('0x69')](_0x2aa207,[_0x8e4f('0x9f')]);if(_0x2aa207[_0x8e4f('0x9f')][_0x8e4f('0x41')]){return _0x2aa207['Contacts'][0x0];}var _0x3e40b7=_[_0x8e4f('0xa1')](_0x244b27[_0x8e4f('0x56')],{'firstName':_0x244b27[_0x8e4f('0x56')][_0x8e4f('0x90')],'ListId':_0x2aa207['id']});_0x3e40b7[_0x244b27[_0x8e4f('0x56')][_0x8e4f('0x9c')]]=_0x244b27[_0x8e4f('0x56')][_0x8e4f('0x90')];return db[_0x8e4f('0x86')][_0x8e4f('0x55')](_0x3e40b7,{'fields':_0xf05955,'raw':!![]});}})['then'](handleEntityNotFound(_0x559e57,null))[_0x8e4f('0x1b')](function(_0xe6a097){if(_0xe6a097){_0x244b27[_0x8e4f('0xa2')]=_0xe6a097;var _0x542fa5={'ContactId':_0xe6a097['id'],'phone':_0x244b27[_0x8e4f('0x56')][_0x8e4f('0x90')],'WhatsappAccountId':_0x54e020[_0x8e4f('0x52')]['id']};var _0x5c031f={'ContactId':_0xe6a097['id'],'WhatsappAccountId':_0x54e020['params']['id'],'closed':![]};return db[_0x8e4f('0xa3')][_0x8e4f('0x54')]({'where':_0x5c031f})[_0x8e4f('0x1b')](function(_0x4e48c3){if(_0x4e48c3){return[_0x4e48c3,![]];}return db[_0x8e4f('0xa3')]['create'](_0x542fa5)[_0x8e4f('0x1b')](function(_0x5e7f98){return[_0x5e7f98,!![]];});});}})['spread'](function(_0x4f7fdd,_0xae6db7){_0x244b27[_0x8e4f('0xa4')]=_0x4f7fdd[_0x8e4f('0x32')]({'plain':!![]});_0x244b27[_0x8e4f('0xa4')]['created']=![];if(_0xae6db7){if(_0x244b27[_0x8e4f('0x7d')][_0x8e4f('0xa5')]){_0x244b27[_0x8e4f('0x82')]['push']({'id':0x0,'priority':_0x244b27[_0x8e4f('0x82')]['length']+0x1,'app':_0x8e4f('0xa6'),'appdata':_0x8e4f('0xa7'),'interval':'*,*,*,*'});}_0x244b27['interaction'][_0x8e4f('0xa8')]=!![];}return db['WhatsappMessage'][_0x8e4f('0x55')]({'phone':_0x244b27['body'][_0x8e4f('0x90')],'messageId':_0x244b27[_0x8e4f('0x56')][_0x8e4f('0x96')],'body':_0x244b27[_0x8e4f('0x56')][_0x8e4f('0x56')],'WhatsappAccountId':_0x54e020[_0x8e4f('0x52')]['id'],'WhatsappInteractionId':_0x4f7fdd['id'],'direction':'in','ContactId':_0x4f7fdd[_0x8e4f('0xa9')],'AttachmentId':_0x244b27['body']['AttachmentId']});})[_0x8e4f('0x1b')](function(_0x16146f){_0x244b27[_0x8e4f('0x22')]=_0x16146f;if(_0x244b27[_0x8e4f('0xa4')][_0x8e4f('0xaa')]){return db[_0x8e4f('0xab')][_0x8e4f('0x54')]({'attributes':['id',_0x8e4f('0x35')],'where':{'id':_0x244b27[_0x8e4f('0xa4')][_0x8e4f('0xaa')]}})['then'](function(_0x250cf6){if(_0x250cf6){_0x244b27[_0x8e4f('0x82')]['unshift']({'id':0x0,'priority':0x0,'app':_0x8e4f('0xac'),'appdata':_0x250cf6[_0x8e4f('0x35')]+','+(_0x244b27['account'][_0x8e4f('0xad')]||0xa),'interval':_0x8e4f('0xae')});}return respondWithRpcPromise('Start','startRouting',_0x244b27);});}return respondWithRpcPromise(_0x8e4f('0xaf'),'startRouting',_0x244b27);})[_0x8e4f('0x1b')](function(_0x1584b7){if(_0x1584b7){var _0x26a061=0xc8;var _0x306af3=_0x8e4f('0xb0');logger['info'](_0x8e4f('0x1e'),_0x306af3,_0x26a061,'entity\x20found');logger['debug'](_0x8e4f('0xb1'),_0x306af3,_0x26a061,_0x8e4f('0xb2'),JSON[_0x8e4f('0x20')](_0x1584b7));if(_0x244b27[_0x8e4f('0x7d')][_0x8e4f('0x49')]===_0x8e4f('0x8f')){return _0x559e57['status'](_0x26a061)[_0x8e4f('0x2e')]('Content-Type',_0x8e4f('0xb3'))['send'](_0x8e4f('0xb4'));}else{return _0x559e57[_0x8e4f('0x27')](_0x26a061)['json'](_0x1584b7);}}});})['catch'](handleError(_0x559e57,null));};exports['send']=function(_0x1be999,_0xbd9425,_0x1fcdd8){var _0x56a088,_0x4f0d30,_0x57af2e;if(_[_0x8e4f('0x98')](_0x1be999[_0x8e4f('0x56')][_0x8e4f('0x56')])||_0x1be999['body'][_0x8e4f('0x56')]===''){throw new db[(_0x8e4f('0x99'))][(_0x8e4f('0x88'))](_0x8e4f('0x9b'));}if(_['isNil'](_0x1be999[_0x8e4f('0x56')]['to'])){throw new db[(_0x8e4f('0x99'))][(_0x8e4f('0x88'))]('to\x20is\x20mandatory');}_0x56a088=_0x1be999['body']['to'];return db['WhatsappAccount'][_0x8e4f('0x54')]({'where':{'id':_0x1be999[_0x8e4f('0x52')]['id']},'include':[{'model':db[_0x8e4f('0x9e')],'as':_0x8e4f('0xb5'),'include':[{'model':db['CmContact'],'as':_0x8e4f('0x9f'),'where':{'mobile':_0x56a088},'limit':0x1,'order':[['updatedAt',_0x8e4f('0xb6')]]}]}]})[_0x8e4f('0x1b')](handleEntityNotFound(_0xbd9425,null))[_0x8e4f('0x1b')](function(_0x5423ca){if(_0x5423ca&&_0x5423ca['List']){_0x4f0d30=_0x5423ca[_0x8e4f('0x32')]({'plain':!![]});if(_0x4f0d30[_0x8e4f('0xb5')]&&_0x4f0d30[_0x8e4f('0xb5')]['Contacts']['length']){return _0x4f0d30[_0x8e4f('0xb5')][_0x8e4f('0x9f')][0x0];}return db[_0x8e4f('0x86')][_0x8e4f('0x55')](_[_0x8e4f('0xa1')](_0x1be999[_0x8e4f('0x56')],{'firstName':_0x56a088,'mobile':_0x56a088,'phone':_0x56a088,'ListId':_0x4f0d30['ListId']}));}})[_0x8e4f('0x1b')](handleEntityNotFound(_0xbd9425,null))[_0x8e4f('0x1b')](function(_0x4f480f){if(_0x4f480f){_0x57af2e=_0x4f480f;return db[_0x8e4f('0xa3')][_0x8e4f('0x54')]({'where':{'ContactId':_0x57af2e['id'],'closed':![],'WhatsappAccountId':_0x4f0d30['id']}})[_0x8e4f('0x1b')](function(_0x5ae507){if(_0x5ae507){return[_0x5ae507,![]];}return db[_0x8e4f('0xa3')][_0x8e4f('0x55')]({'UserId':_0x1be999[_0x8e4f('0x57')]['id'],'ContactId':_0x57af2e['id'],'WhatsappAccountId':_0x4f0d30['id'],'phone':_0x56a088,'firstMsgDirection':_0x8e4f('0xb7'),'Messages':[_[_0x8e4f('0x47')](_0x1be999[_0x8e4f('0x56')],{'read':![],'body':_0x1be999[_0x8e4f('0x56')]['body'],'phone':_0x56a088,'WhatsappAccountId':_0x4f0d30['id'],'UserId':_0x1be999[_0x8e4f('0x57')]['id'],'ContactId':_0x57af2e['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':'Messages'}]})[_0x8e4f('0x1b')](function(_0x3bdd0c){return[_0x3bdd0c,!![]];});});}})[_0x8e4f('0xb8')](function(_0x5f1fd3,_0x34af86){if(_0x34af86){return _0x5f1fd3;}return db[_0x8e4f('0x81')][_0x8e4f('0x55')](_[_0x8e4f('0x47')](_0x1be999['body'],{'read':![],'body':_0x1be999[_0x8e4f('0x56')][_0x8e4f('0x56')],'phone':_0x56a088,'WhatsappAccountId':_0x4f0d30['id'],'WhatsappInteractionId':_0x5f1fd3['id'],'UserId':_0x1be999[_0x8e4f('0x57')]['id'],'ContactId':_0x57af2e['id']}))['then'](function(_0x4f1b69){_0x5f1fd3[_0x8e4f('0xb9')][_0x8e4f('0xba')]=[];_0x5f1fd3[_0x8e4f('0xb9')][_0x8e4f('0xba')][_0x8e4f('0xbb')](_0x4f1b69['dataValues']);return _0x5f1fd3;});})[_0x8e4f('0x1b')](respondWithResult(_0xbd9425,null))[_0x8e4f('0x25')](handleError(_0xbd9425,null));};
\ No newline at end of file
+var _0xca7d=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','include','find','create','body','user','role','get','WhatsappAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','nolimit','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','omit','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','priority','finally','getApplications','whatsapp','Applications','account','statuses','state','read','WhatsappMessage','timestamp','orderBy','asc','CmContact','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','sinch','notifications','isNil','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','Contacts','defaults','contact','WhatsappInteraction','interaction','autoclose','applications','push','close','*,*,*,*','created','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','List','out','Messages','dataValues','eml-format','zip-dir','request-promise'];(function(_0x41cda5,_0x3d62e8){var _0x5890a1=function(_0x22f8e7){while(--_0x22f8e7){_0x41cda5['push'](_0x41cda5['shift']());}};_0x5890a1(++_0x3d62e8);}(_0xca7d,0x195));var _0xdca7=function(_0x9b275c,_0x4ba410){_0x9b275c=_0x9b275c-0x0;var _0x2e90f1=_0xca7d[_0x9b275c];return _0x2e90f1;};'use strict';var emlformat=require(_0xdca7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdca7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdca7('0x2'));var moment=require(_0xdca7('0x3'));var BPromise=require(_0xdca7('0x4'));var Mustache=require(_0xdca7('0x5'));var util=require(_0xdca7('0x6'));var path=require(_0xdca7('0x7'));var sox=require(_0xdca7('0x8'));var csv=require(_0xdca7('0x9'));var ejs=require(_0xdca7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdca7('0xb'));var squel=require('squel');var crypto=require(_0xdca7('0xc'));var jsforce=require(_0xdca7('0xd'));var deskjs=require(_0xdca7('0xe'));var toCsv=require(_0xdca7('0x9'));var querystring=require(_0xdca7('0xf'));var Papa=require(_0xdca7('0x10'));var Redis=require(_0xdca7('0x11'));var authService=require(_0xdca7('0x12'));var qs=require(_0xdca7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdca7('0x14'));var logger=require(_0xdca7('0x15'))(_0xdca7('0x16'));var utils=require(_0xdca7('0x17'));var config=require(_0xdca7('0x18'));var licenseUtil=require(_0xdca7('0x19'));var db=require('../../mysqldb')['db'];config[_0xdca7('0x1a')]=_['defaults'](config[_0xdca7('0x1a')],{'host':_0xdca7('0x1b'),'port':0x18eb});var socket=require(_0xdca7('0x1c'))(new Redis(config[_0xdca7('0x1a')]));require(_0xdca7('0x1d'))[_0xdca7('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdca7('0x1f')][_0xdca7('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x224011,_0x5bcf62,_0x1ba08b,_0x4517f2){return new BPromise(function(_0x5bcbcf,_0x48124e){var _0x37975f=_0x4517f2||client;return _0x37975f[_0xdca7('0x21')](_0x224011,_0x1ba08b)[_0xdca7('0x22')](function(_0x4fe5b7){logger[_0xdca7('0x23')](_0xdca7('0x24'),_0x5bcf62,'request\x20sent');logger[_0xdca7('0x25')](_0xdca7('0x26'),_0x5bcf62,_0xdca7('0x27'),JSON[_0xdca7('0x28')](_0x4fe5b7));if(_0x4fe5b7['error']){if(_0x4fe5b7[_0xdca7('0x29')][_0xdca7('0x2a')]===0x1f4){logger[_0xdca7('0x29')](_0xdca7('0x24'),_0x5bcf62,_0x4fe5b7['error'][_0xdca7('0x2b')]);return _0x48124e(_0x4fe5b7['error'][_0xdca7('0x2b')]);}logger[_0xdca7('0x29')](_0xdca7('0x24'),_0x5bcf62,_0x4fe5b7['error'][_0xdca7('0x2b')]);return _0x5bcbcf(_0x4fe5b7[_0xdca7('0x29')][_0xdca7('0x2b')]);}else{logger['info'](_0xdca7('0x24'),_0x5bcf62,_0xdca7('0x27'));_0x5bcbcf(_0x4fe5b7[_0xdca7('0x2c')][_0xdca7('0x2b')]);}})['catch'](function(_0x36f527){logger[_0xdca7('0x29')](_0xdca7('0x24'),_0x5bcf62,_0x36f527);_0x48124e(_0x36f527);});});}function respondWithStatusCode(_0x41a20e,_0x3a372e){_0x3a372e=_0x3a372e||0xcc;return function(_0x3fc8ab){if(_0x3fc8ab){return _0x41a20e[_0xdca7('0x2d')](_0x3a372e);}return _0x41a20e[_0xdca7('0x2e')](_0x3a372e)[_0xdca7('0x2f')]();};}function respondWithResult(_0x542505,_0x400a0c){_0x400a0c=_0x400a0c||0xc8;return function(_0x2176ad){if(_0x2176ad){return _0x542505['status'](_0x400a0c)[_0xdca7('0x30')](_0x2176ad);}};}function respondWithFilteredResult(_0x5bfbf1,_0x39b301){return function(_0x359b07){if(_0x359b07){var _0xed7f1e=typeof _0x39b301[_0xdca7('0x31')]===_0xdca7('0x32')&&typeof _0x39b301[_0xdca7('0x33')]===_0xdca7('0x32');var _0x5dfd24=_0x359b07[_0xdca7('0x34')];var _0x5e9f6c=_0xed7f1e?0x0:_0x39b301[_0xdca7('0x31')];var _0x2a5c2f=_0xed7f1e?_0x359b07[_0xdca7('0x34')]:_0x39b301[_0xdca7('0x31')]+_0x39b301[_0xdca7('0x33')];var _0x3e8ed9;if(_0x2a5c2f>=_0x5dfd24){_0x2a5c2f=_0x5dfd24;_0x3e8ed9=0xc8;}else{_0x3e8ed9=0xce;}_0x5bfbf1[_0xdca7('0x2e')](_0x3e8ed9);return _0x5bfbf1[_0xdca7('0x35')](_0xdca7('0x36'),_0x5e9f6c+'-'+_0x2a5c2f+'/'+_0x5dfd24)[_0xdca7('0x30')](_0x359b07);}return null;};}function patchUpdates(_0x11a5e5){return function(_0x51d1f8){try{jsonpatch[_0xdca7('0x37')](_0x51d1f8,_0x11a5e5,!![]);}catch(_0x58d2a7){return BPromise['reject'](_0x58d2a7);}return _0x51d1f8[_0xdca7('0x38')]();};}function saveUpdates(_0x23b627,_0x5e80d0){return function(_0x4e6ad5){if(_0x4e6ad5){return _0x4e6ad5[_0xdca7('0x39')](_0x23b627)[_0xdca7('0x22')](function(_0x56eb33){return _0x56eb33;});}return null;};}function removeEntity(_0x14739c,_0x4ba111){return function(_0x21e86a){if(_0x21e86a){return _0x21e86a['destroy']()['then'](function(){var _0x1d8865=_0x21e86a['get']({'plain':!![]});var _0x4deed4='WhatsappAccounts';return db[_0xdca7('0x3a')][_0xdca7('0x3b')]({'where':{'type':_0x4deed4,'resourceId':_0x1d8865['id']}})['then'](function(){return _0x21e86a;});})[_0xdca7('0x22')](function(){_0x14739c[_0xdca7('0x2e')](0xcc)[_0xdca7('0x2f')]();});}};}function handleEntityNotFound(_0xc76c1a,_0x5713f1){return function(_0x1a1258){if(!_0x1a1258){_0xc76c1a[_0xdca7('0x2d')](0x194);}return _0x1a1258;};}function handleError(_0x3ac2e6,_0x116357){_0x116357=_0x116357||0x1f4;return function(_0x2d578d){logger[_0xdca7('0x29')](_0x2d578d[_0xdca7('0x3c')]);if(_0x2d578d['name']){delete _0x2d578d[_0xdca7('0x3d')];}_0x3ac2e6[_0xdca7('0x2e')](_0x116357)[_0xdca7('0x3e')](_0x2d578d);};}exports[_0xdca7('0x3f')]=function(_0x246de9,_0x22c2fe){var _0x469488={'include':[{'model':db[_0xdca7('0x40')],'as':_0xdca7('0x41')}]},_0x82d1e8={},_0x37035d={'count':0x0,'rows':[]};var _0x27f586=_[_0xdca7('0x42')](db[_0xdca7('0x43')][_0xdca7('0x44')],function(_0xe571d4){return{'name':_0xe571d4[_0xdca7('0x45')],'type':_0xe571d4[_0xdca7('0x46')]['key']};});_0x82d1e8[_0xdca7('0x47')]=_[_0xdca7('0x42')](_0x27f586,_0xdca7('0x3d'));_0x82d1e8['query']=_[_0xdca7('0x48')](_0x246de9['query']);_0x82d1e8[_0xdca7('0x49')]=_['intersection'](_0x82d1e8['model'],_0x82d1e8[_0xdca7('0x4a')]);_0x469488[_0xdca7('0x4b')]=_[_0xdca7('0x4c')](_0x82d1e8['model'],qs[_0xdca7('0x4d')](_0x246de9['query'][_0xdca7('0x4d')]));_0x469488[_0xdca7('0x4b')]=_0x469488[_0xdca7('0x4b')][_0xdca7('0x4e')]?_0x469488[_0xdca7('0x4b')]:_0x82d1e8[_0xdca7('0x47')];if(!_0x246de9['query'][_0xdca7('0x4f')]('nolimit')){_0x469488[_0xdca7('0x33')]=qs[_0xdca7('0x33')](_0x246de9[_0xdca7('0x4a')][_0xdca7('0x33')]);_0x469488[_0xdca7('0x31')]=qs['offset'](_0x246de9['query']['offset']);}_0x469488[_0xdca7('0x50')]=qs[_0xdca7('0x51')](_0x246de9[_0xdca7('0x4a')][_0xdca7('0x51')]);_0x469488[_0xdca7('0x52')]=qs['filters'](_[_0xdca7('0x53')](_0x246de9[_0xdca7('0x4a')],_0x82d1e8[_0xdca7('0x49')]),_0x27f586);if(_0x246de9[_0xdca7('0x4a')]['filter']){_0x469488['where']=_[_0xdca7('0x54')](_0x469488[_0xdca7('0x52')],{'$or':_['map'](_0x27f586,function(_0x4d6448){if(_0x4d6448['type']!==_0xdca7('0x55')){var _0x14cd9c={};_0x14cd9c[_0x4d6448['name']]={'$like':'%'+_0x246de9[_0xdca7('0x4a')][_0xdca7('0x56')]+'%'};return _0x14cd9c;}})});}_0x469488=_[_0xdca7('0x54')]({},_0x469488,_0x246de9[_0xdca7('0x57')]);var _0x405311={'where':_0x469488[_0xdca7('0x52')]};return db[_0xdca7('0x43')]['count'](_0x405311)[_0xdca7('0x22')](function(_0xdd65cb){_0x37035d[_0xdca7('0x34')]=_0xdd65cb;if(_0x246de9[_0xdca7('0x4a')][_0xdca7('0x58')]){_0x469488['include']=[{'all':!![]}];}return db[_0xdca7('0x43')][_0xdca7('0x59')](_0x469488);})[_0xdca7('0x22')](function(_0x263844){_0x37035d[_0xdca7('0x5a')]=_0x263844;return _0x37035d;})[_0xdca7('0x22')](respondWithFilteredResult(_0x22c2fe,_0x469488))[_0xdca7('0x5b')](handleError(_0x22c2fe,null));};exports['show']=function(_0x55bec8,_0x24fee2){var _0x3bb608={'raw':![],'where':{'id':_0x55bec8[_0xdca7('0x5c')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x229186={};_0x229186[_0xdca7('0x47')]=_[_0xdca7('0x48')](db['WhatsappAccount']['rawAttributes']);_0x229186[_0xdca7('0x4a')]=_['keys'](_0x55bec8[_0xdca7('0x4a')]);_0x229186[_0xdca7('0x49')]=_[_0xdca7('0x4c')](_0x229186[_0xdca7('0x47')],_0x229186[_0xdca7('0x4a')]);_0x3bb608[_0xdca7('0x4b')]=_[_0xdca7('0x4c')](_0x229186[_0xdca7('0x47')],qs['fields'](_0x55bec8[_0xdca7('0x4a')]['fields']));_0x3bb608['attributes']=_0x3bb608[_0xdca7('0x4b')][_0xdca7('0x4e')]?_0x3bb608['attributes']:_0x229186[_0xdca7('0x47')];if(_0x55bec8[_0xdca7('0x4a')][_0xdca7('0x58')]){_0x3bb608[_0xdca7('0x5d')]=[{'all':!![]}];}_0x3bb608=_['merge']({},_0x3bb608,_0x55bec8[_0xdca7('0x57')]);return db[_0xdca7('0x43')][_0xdca7('0x5e')](_0x3bb608)[_0xdca7('0x22')](handleEntityNotFound(_0x24fee2,null))[_0xdca7('0x22')](respondWithResult(_0x24fee2,null))[_0xdca7('0x5b')](handleError(_0x24fee2,null));};exports['create']=function(_0x2bf0d9,_0x3befd0){return db[_0xdca7('0x43')][_0xdca7('0x5f')](_0x2bf0d9[_0xdca7('0x60')],{})[_0xdca7('0x22')](function(_0x2b4ceb){var _0x5808a0=_0x2bf0d9[_0xdca7('0x61')]['get']({'plain':!![]});if(!_0x5808a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5808a0[_0xdca7('0x62')]===_0xdca7('0x61')){var _0x4c2238=_0x2b4ceb[_0xdca7('0x63')]({'plain':!![]});var _0x4e00d4=_0xdca7('0x64');return db[_0xdca7('0x65')][_0xdca7('0x5e')]({'where':{'name':_0x4e00d4,'userProfileId':_0x5808a0[_0xdca7('0x66')]},'raw':!![]})['then'](function(_0x1e7989){if(_0x1e7989&&_0x1e7989[_0xdca7('0x67')]===0x0){return db[_0xdca7('0x3a')][_0xdca7('0x5f')]({'name':_0x4c2238[_0xdca7('0x3d')],'resourceId':_0x4c2238['id'],'type':_0x1e7989[_0xdca7('0x3d')],'sectionId':_0x1e7989['id']},{})[_0xdca7('0x22')](function(){return _0x2b4ceb;});}else{return _0x2b4ceb;}})[_0xdca7('0x5b')](function(_0x1e99fd){logger[_0xdca7('0x29')](_0xdca7('0x68'),_0x1e99fd);throw _0x1e99fd;});}return _0x2b4ceb;})['then'](respondWithResult(_0x3befd0,0xc9))['catch'](handleError(_0x3befd0,null));};exports[_0xdca7('0x39')]=function(_0x16032f,_0x5ff035){if(_0x16032f[_0xdca7('0x60')]['id']){delete _0x16032f[_0xdca7('0x60')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x16032f[_0xdca7('0x5c')]['id']},'include':[{'model':db[_0xdca7('0x40')],'as':_0xdca7('0x41')}]})[_0xdca7('0x22')](handleEntityNotFound(_0x5ff035,null))['then'](saveUpdates(_0x16032f[_0xdca7('0x60')],null))['then'](respondWithResult(_0x5ff035,null))[_0xdca7('0x5b')](handleError(_0x5ff035,null));};exports['destroy']=function(_0x12a31c,_0x17ce35){return db[_0xdca7('0x43')][_0xdca7('0x5e')]({'where':{'id':_0x12a31c['params']['id']}})[_0xdca7('0x22')](handleEntityNotFound(_0x17ce35,null))[_0xdca7('0x22')](removeEntity(_0x17ce35,null))['catch'](handleError(_0x17ce35,null));};exports['describe']=function(_0x94d458,_0x2beb41){return db[_0xdca7('0x43')][_0xdca7('0x69')]()[_0xdca7('0x22')](respondWithResult(_0x2beb41,null))['catch'](handleError(_0x2beb41,null));};exports[_0xdca7('0x6a')]=function(_0x50e411,_0x10fa58,_0x14ab51){if(_0x50e411[_0xdca7('0x60')]['id']){delete _0x50e411[_0xdca7('0x60')]['id'];}return db[_0xdca7('0x43')][_0xdca7('0x5e')]({'where':{'id':_0x50e411['params']['id']}})['then'](handleEntityNotFound(_0x10fa58,null))[_0xdca7('0x22')](function(_0x2de986){if(_0x2de986){_0x50e411[_0xdca7('0x60')][_0xdca7('0x6b')]=_0x2de986['id'];return db[_0xdca7('0x6c')][_0xdca7('0x5f')](_0x50e411['body']);}})[_0xdca7('0x22')](respondWithResult(_0x10fa58,null))['catch'](handleError(_0x10fa58,null));};exports[_0xdca7('0x6d')]=function(_0x1be22f,_0x534d9b,_0x4c648f){var _0x2b402a={'raw':![],'where':{}};var _0x527dbc={};var _0x50d41a={'count':0x0,'rows':[]};return db[_0xdca7('0x43')][_0xdca7('0x6e')]({'where':{'id':_0x1be22f[_0xdca7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x534d9b,null))[_0xdca7('0x22')](function(_0x4f3b7b){if(_0x4f3b7b){_0x527dbc['model']=_[_0xdca7('0x48')](db[_0xdca7('0x6c')][_0xdca7('0x44')]);_0x527dbc[_0xdca7('0x4a')]=_[_0xdca7('0x48')](_0x1be22f['query']);_0x527dbc['filters']=_[_0xdca7('0x4c')](_0x527dbc[_0xdca7('0x47')],_0x527dbc['query']);_0x2b402a['attributes']=_[_0xdca7('0x4c')](_0x527dbc[_0xdca7('0x47')],qs['fields'](_0x1be22f[_0xdca7('0x4a')][_0xdca7('0x4d')]));_0x2b402a[_0xdca7('0x4b')]=_0x2b402a[_0xdca7('0x4b')][_0xdca7('0x4e')]?_0x2b402a['attributes']:_0x527dbc[_0xdca7('0x47')];if(!_0x1be22f[_0xdca7('0x4a')][_0xdca7('0x4f')](_0xdca7('0x6f'))){_0x2b402a[_0xdca7('0x33')]=qs[_0xdca7('0x33')](_0x1be22f['query'][_0xdca7('0x33')]);_0x2b402a[_0xdca7('0x31')]=qs[_0xdca7('0x31')](_0x1be22f[_0xdca7('0x4a')][_0xdca7('0x31')]);}_0x2b402a[_0xdca7('0x50')]=qs[_0xdca7('0x51')](_0x1be22f[_0xdca7('0x4a')]['sort']);_0x2b402a[_0xdca7('0x52')]=qs[_0xdca7('0x49')](_['pick'](_0x1be22f['query'],_0x527dbc[_0xdca7('0x49')]));_0x2b402a[_0xdca7('0x52')][_0xdca7('0x6b')]=_0x4f3b7b['id'];if(_0x1be22f['query'][_0xdca7('0x56')]){_0x2b402a[_0xdca7('0x52')]=_[_0xdca7('0x54')](_0x2b402a['where'],{'$or':_['map'](_0x2b402a[_0xdca7('0x4b')],function(_0x2f56d1){var _0x572787={};_0x572787[_0x2f56d1]={'$like':'%'+_0x1be22f[_0xdca7('0x4a')]['filter']+'%'};return _0x572787;})});}_0x2b402a=_['merge']({},_0x2b402a,_0x1be22f[_0xdca7('0x57')]);return db[_0xdca7('0x6c')][_0xdca7('0x34')]({'where':_0x2b402a[_0xdca7('0x52')]})[_0xdca7('0x22')](function(_0x2990ca){_0x50d41a[_0xdca7('0x34')]=_0x2990ca;if(_0x1be22f['query']['includeAll']){_0x2b402a['include']=[{'all':!![]}];}return db[_0xdca7('0x6c')][_0xdca7('0x59')](_0x2b402a);})[_0xdca7('0x22')](function(_0xfa7d2e){_0x50d41a['rows']=_0xfa7d2e;return _0x50d41a;});}})[_0xdca7('0x22')](respondWithFilteredResult(_0x534d9b,_0x2b402a))[_0xdca7('0x5b')](handleError(_0x534d9b,null));};exports[_0xdca7('0x70')]=function(_0x2613e6,_0x315825,_0x234b31){return db[_0xdca7('0x43')][_0xdca7('0x5e')]({'where':{'id':_0x2613e6[_0xdca7('0x5c')]['id']}})[_0xdca7('0x22')](handleEntityNotFound(_0x315825,null))['then'](function(_0x15bcd7){if(_0x15bcd7){return _0x15bcd7[_0xdca7('0x70')](_0x2613e6[_0xdca7('0x4a')]['ids']);}})['then'](respondWithStatusCode(_0x315825,null))[_0xdca7('0x5b')](handleError(_0x315825,null));};exports[_0xdca7('0x71')]=function(_0x6284d5,_0x480dfa,_0x7b4e3f){if(_0x6284d5[_0xdca7('0x60')]['id']){delete _0x6284d5[_0xdca7('0x60')]['id'];}return db[_0xdca7('0x43')][_0xdca7('0x5e')]({'where':{'id':_0x6284d5[_0xdca7('0x5c')]['id']}})['then'](handleEntityNotFound(_0x480dfa,null))[_0xdca7('0x22')](function(_0x5a7a3f){if(_0x5a7a3f){_0x6284d5[_0xdca7('0x60')][_0xdca7('0x6b')]=_0x5a7a3f['id'];return db[_0xdca7('0x72')][_0xdca7('0x5f')](_0x6284d5[_0xdca7('0x60')]);}})[_0xdca7('0x22')](respondWithResult(_0x480dfa,null))[_0xdca7('0x5b')](handleError(_0x480dfa,null));};exports[_0xdca7('0x73')]=function(_0x329601,_0x4febc1,_0x567ec3){var _0x217a25={'raw':![],'where':{}};var _0x4ba90a={};var _0x29311a={'count':0x0,'rows':[]};return db[_0xdca7('0x43')][_0xdca7('0x6e')]({'where':{'id':_0x329601['params']['id']}})['then'](handleEntityNotFound(_0x4febc1,null))['then'](function(_0x196859){if(_0x196859){_0x4ba90a['model']=_[_0xdca7('0x48')](db[_0xdca7('0x72')][_0xdca7('0x44')]);_0x4ba90a[_0xdca7('0x4a')]=_[_0xdca7('0x48')](_0x329601[_0xdca7('0x4a')]);_0x4ba90a[_0xdca7('0x49')]=_['intersection'](_0x4ba90a[_0xdca7('0x47')],_0x4ba90a['query']);_0x217a25[_0xdca7('0x4b')]=_[_0xdca7('0x4c')](_0x4ba90a[_0xdca7('0x47')],qs[_0xdca7('0x4d')](_0x329601[_0xdca7('0x4a')][_0xdca7('0x4d')]));_0x217a25['attributes']=_0x217a25[_0xdca7('0x4b')]['length']?_0x217a25[_0xdca7('0x4b')]:_0x4ba90a[_0xdca7('0x47')];if(!_0x329601[_0xdca7('0x4a')][_0xdca7('0x4f')](_0xdca7('0x6f'))){_0x217a25['limit']=qs[_0xdca7('0x33')](_0x329601[_0xdca7('0x4a')][_0xdca7('0x33')]);_0x217a25[_0xdca7('0x31')]=qs[_0xdca7('0x31')](_0x329601['query']['offset']);}_0x217a25[_0xdca7('0x50')]=qs['sort'](_0x329601[_0xdca7('0x4a')][_0xdca7('0x51')]);_0x217a25[_0xdca7('0x52')]=qs[_0xdca7('0x49')](_[_0xdca7('0x53')](_0x329601['query'],_0x4ba90a[_0xdca7('0x49')]));_0x217a25[_0xdca7('0x52')][_0xdca7('0x6b')]=_0x196859['id'];if(_0x329601[_0xdca7('0x4a')][_0xdca7('0x56')]){_0x217a25[_0xdca7('0x52')]=_[_0xdca7('0x54')](_0x217a25[_0xdca7('0x52')],{'$or':_[_0xdca7('0x42')](_0x217a25[_0xdca7('0x4b')],function(_0x339645){var _0x1e782e={};_0x1e782e[_0x339645]={'$like':'%'+_0x329601[_0xdca7('0x4a')][_0xdca7('0x56')]+'%'};return _0x1e782e;})});}_0x217a25=_[_0xdca7('0x54')]({},_0x217a25,_0x329601[_0xdca7('0x57')]);return db[_0xdca7('0x72')][_0xdca7('0x34')]({'where':_0x217a25[_0xdca7('0x52')]})[_0xdca7('0x22')](function(_0x1ff2da){_0x29311a[_0xdca7('0x34')]=_0x1ff2da;if(_0x329601['query'][_0xdca7('0x58')]){_0x217a25[_0xdca7('0x5d')]=[{'all':!![]}];}return db['CannedAnswer'][_0xdca7('0x59')](_0x217a25);})[_0xdca7('0x22')](function(_0x5762db){_0x29311a[_0xdca7('0x5a')]=_0x5762db;return _0x29311a;});}})['then'](respondWithFilteredResult(_0x4febc1,_0x217a25))[_0xdca7('0x5b')](handleError(_0x4febc1,null));};exports[_0xdca7('0x74')]=function(_0x205c1b,_0x59e491,_0x4584fb){return db[_0xdca7('0x43')]['find']({'where':{'id':_0x205c1b[_0xdca7('0x5c')]['id']}})[_0xdca7('0x22')](handleEntityNotFound(_0x59e491,null))[_0xdca7('0x22')](function(_0x2e0910){if(_0x2e0910){return _0x2e0910['removeAnswers'](_0x205c1b['query'][_0xdca7('0x75')]);}})[_0xdca7('0x22')](respondWithStatusCode(_0x59e491,null))[_0xdca7('0x5b')](handleError(_0x59e491,null));};exports['addAgents']=function(_0x39365b,_0x1221f4,_0x1b7ad0){return db[_0xdca7('0x43')][_0xdca7('0x5e')]({'where':{'id':_0x39365b[_0xdca7('0x5c')]['id']}})[_0xdca7('0x22')](handleEntityNotFound(_0x1221f4,null))[_0xdca7('0x22')](function(_0xb7a641){if(_0xb7a641){return _0xb7a641['addAgents'](_0x39365b[_0xdca7('0x60')]['ids'],_[_0xdca7('0x76')](_0x39365b['body'],['ids','id'])||{})[_0xdca7('0x77')](function(_0x5dc81b){for(var _0x528c09=0x0;_0x528c09<_0x39365b[_0xdca7('0x60')][_0xdca7('0x75')][_0xdca7('0x4e')];_0x528c09+=0x1){socket[_0xdca7('0x78')](_0xdca7('0x79'),{'UserId':Number(_0x39365b['body'][_0xdca7('0x75')][_0x528c09]),'WhatsappAccountId':Number(_0x39365b[_0xdca7('0x5c')]['id'])});}return _0x5dc81b;});}})['then'](respondWithResult(_0x1221f4,null))[_0xdca7('0x5b')](handleError(_0x1221f4,null));};exports[_0xdca7('0x7a')]=function(_0x3142ab,_0x40be76,_0x45211f){return db[_0xdca7('0x43')][_0xdca7('0x5e')]({'where':{'id':_0x3142ab['params']['id']}})[_0xdca7('0x22')](handleEntityNotFound(_0x40be76,null))['then'](function(_0x49bb22){if(_0x49bb22){return _0x49bb22[_0xdca7('0x7a')](_0x3142ab[_0xdca7('0x4a')][_0xdca7('0x75')])[_0xdca7('0x22')](function(){if(_['isArray'](_0x3142ab['query']['ids'])){for(var _0x1c58e3=0x0;_0x1c58e3<_0x3142ab['query']['ids'][_0xdca7('0x4e')];_0x1c58e3+=0x1){socket[_0xdca7('0x78')](_0xdca7('0x7b'),{'UserId':Number(_0x3142ab[_0xdca7('0x4a')]['ids'][_0x1c58e3]),'WhatsappAccountId':Number(_0x3142ab[_0xdca7('0x5c')]['id'])});}}else{socket[_0xdca7('0x78')](_0xdca7('0x7b'),{'UserId':Number(_0x3142ab[_0xdca7('0x4a')][_0xdca7('0x75')]),'WhatsappAccountId':Number(_0x3142ab[_0xdca7('0x5c')]['id'])});}});}})[_0xdca7('0x22')](respondWithStatusCode(_0x40be76,null))['catch'](handleError(_0x40be76,null));};exports['getAgents']=function(_0x21f328,_0x456b88,_0x80f5c4){var _0x3ceb9e={};var _0xec3359={};var _0x1366d0;var _0x2a535c;return db[_0xdca7('0x43')]['findOne']({'where':{'id':_0x21f328[_0xdca7('0x5c')]['id']}})[_0xdca7('0x22')](handleEntityNotFound(_0x456b88,null))[_0xdca7('0x22')](function(_0x4b9e06){if(_0x4b9e06){_0x1366d0=_0x4b9e06;_0xec3359[_0xdca7('0x47')]=_[_0xdca7('0x48')](db[_0xdca7('0x7c')][_0xdca7('0x44')]);_0xec3359[_0xdca7('0x4a')]=_[_0xdca7('0x48')](_0x21f328[_0xdca7('0x4a')]);_0xec3359[_0xdca7('0x49')]=_[_0xdca7('0x4c')](_0xec3359[_0xdca7('0x47')],_0xec3359['query']);_0x3ceb9e[_0xdca7('0x4b')]=_[_0xdca7('0x4c')](_0xec3359['model'],qs['fields'](_0x21f328[_0xdca7('0x4a')][_0xdca7('0x4d')]));_0x3ceb9e[_0xdca7('0x4b')]=_0x3ceb9e[_0xdca7('0x4b')][_0xdca7('0x4e')]?_0x3ceb9e['attributes']:_0xec3359[_0xdca7('0x47')];_0x3ceb9e[_0xdca7('0x50')]=qs[_0xdca7('0x51')](_0x21f328[_0xdca7('0x4a')][_0xdca7('0x51')]);_0x3ceb9e[_0xdca7('0x52')]=qs[_0xdca7('0x49')](_[_0xdca7('0x53')](_0x21f328[_0xdca7('0x4a')],_0xec3359['filters']));if(_0x21f328[_0xdca7('0x4a')][_0xdca7('0x56')]){_0x3ceb9e[_0xdca7('0x52')]=_[_0xdca7('0x54')](_0x3ceb9e[_0xdca7('0x52')],{'$or':_[_0xdca7('0x42')](_0x3ceb9e[_0xdca7('0x4b')],function(_0x5d7367){var _0x16968d={};_0x16968d[_0x5d7367]={'$like':'%'+_0x21f328[_0xdca7('0x4a')]['filter']+'%'};return _0x16968d;})});}_0x3ceb9e=_[_0xdca7('0x54')]({},_0x3ceb9e,_0x21f328[_0xdca7('0x57')]);return _0x1366d0['getAgents'](_0x3ceb9e);}})['then'](function(_0x3992d8){if(_0x3992d8){_0x2a535c=_0x3992d8['length'];if(!_0x21f328[_0xdca7('0x4a')][_0xdca7('0x4f')]('nolimit')){_0x3ceb9e[_0xdca7('0x33')]=qs[_0xdca7('0x33')](_0x21f328[_0xdca7('0x4a')][_0xdca7('0x33')]);_0x3ceb9e[_0xdca7('0x31')]=qs[_0xdca7('0x31')](_0x21f328[_0xdca7('0x4a')][_0xdca7('0x31')]);}return _0x1366d0[_0xdca7('0x7d')](_0x3ceb9e);}})[_0xdca7('0x22')](function(_0x462c89){if(_0x462c89){return _0x462c89?{'count':_0x2a535c,'rows':_0x462c89}:null;}})['then'](respondWithResult(_0x456b88,null))[_0xdca7('0x5b')](handleError(_0x456b88,null));};exports[_0xdca7('0x7e')]=function(_0xa1e770,_0x2d4bdd){var _0x379f2d=_0xa1e770['params']['id'];var _0x233a72=_0xa1e770[_0xdca7('0x60')];var _0x3353a6=0xc8;var _0x292efb=null;return db[_0xdca7('0x7f')][_0xdca7('0x80')]({'isolationLevel':db[_0xdca7('0x7f')][_0xdca7('0x81')][_0xdca7('0x82')][_0xdca7('0x83')]},function(_0x574472){return db[_0xdca7('0x43')][_0xdca7('0x6e')]({'where':{'id':_0x379f2d},'transaction':_0x574472})['then'](function(_0x29c279){if(_0x29c279){return db[_0xdca7('0x84')]['destroy']({'where':{'WhatsappAccountId':_0x379f2d},'transaction':_0x574472})[_0xdca7('0x22')](function(){var _0xf45f0f=_[_0xdca7('0x42')](_0x233a72,function(_0x1a3b2b){_0x1a3b2b[_0xdca7('0x6b')]=_0x379f2d;return _0x1a3b2b;});return db[_0xdca7('0x84')][_0xdca7('0x85')](_0xf45f0f,{'transaction':_0x574472});});}else{_0x3353a6=0x194;_0x292efb=[];}});})[_0xdca7('0x22')](function(){if(_0x3353a6!==0x194){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x379f2d},'order':_0xdca7('0x86')})[_0xdca7('0x22')](function(_0x2e539c){_0x292efb=_0x2e539c;});}})[_0xdca7('0x5b')](function(_0x3a8f6f){_0x3353a6=0x1f4;logger[_0xdca7('0x29')](_0x3a8f6f[_0xdca7('0x3c')]);if(_0x3a8f6f[_0xdca7('0x3d')]){delete _0x3a8f6f[_0xdca7('0x3d')];}_0x292efb=_0x3a8f6f;})[_0xdca7('0x87')](function(){if(_0x292efb===null){_0x2d4bdd[_0xdca7('0x2d')](_0x3353a6);}else{if(_0x3353a6===0x1f4){_0x2d4bdd[_0xdca7('0x2e')](_0x3353a6)[_0xdca7('0x3e')](_0x292efb);}else{_0x2d4bdd['status'](_0x3353a6)[_0xdca7('0x30')](_0x292efb);}}});};exports[_0xdca7('0x88')]=function(_0x3f79ee,_0xc2eea3,_0x1739cf){var _0x1784d6={};var _0x8b49b8={};var _0xd5d4fe;var _0x521df5;return db[_0xdca7('0x43')][_0xdca7('0x6e')]({'where':{'id':_0x3f79ee[_0xdca7('0x5c')]['id']}})[_0xdca7('0x22')](handleEntityNotFound(_0xc2eea3,null))[_0xdca7('0x22')](function(_0x5c87ff){if(_0x5c87ff){_0xd5d4fe=_0x5c87ff;_0x8b49b8[_0xdca7('0x47')]=_[_0xdca7('0x48')](db[_0xdca7('0x84')][_0xdca7('0x44')]);_0x8b49b8['query']=_[_0xdca7('0x48')](_0x3f79ee[_0xdca7('0x4a')]);_0x8b49b8[_0xdca7('0x49')]=_[_0xdca7('0x4c')](_0x8b49b8[_0xdca7('0x47')],_0x8b49b8[_0xdca7('0x4a')]);_0x1784d6[_0xdca7('0x4b')]=_[_0xdca7('0x4c')](_0x8b49b8['model'],qs[_0xdca7('0x4d')](_0x3f79ee[_0xdca7('0x4a')][_0xdca7('0x4d')]));_0x1784d6[_0xdca7('0x4b')]=_0x1784d6[_0xdca7('0x4b')][_0xdca7('0x4e')]?_0x1784d6['attributes']:_0x8b49b8[_0xdca7('0x47')];_0x1784d6[_0xdca7('0x50')]=qs['sort'](_0x3f79ee[_0xdca7('0x4a')]['sort']);_0x1784d6[_0xdca7('0x52')]=qs[_0xdca7('0x49')](_[_0xdca7('0x53')](_0x3f79ee[_0xdca7('0x4a')],_0x8b49b8['filters']));if(_0x3f79ee['query'][_0xdca7('0x56')]){_0x1784d6[_0xdca7('0x52')]=_[_0xdca7('0x54')](_0x1784d6[_0xdca7('0x52')],{'$or':_[_0xdca7('0x42')](_0x1784d6[_0xdca7('0x4b')],function(_0x24f37b){var _0x58816d={};_0x58816d[_0x24f37b]={'$like':'%'+_0x3f79ee[_0xdca7('0x4a')][_0xdca7('0x56')]+'%'};return _0x58816d;})});}_0x1784d6=_[_0xdca7('0x54')]({},_0x1784d6,_0x3f79ee[_0xdca7('0x57')]);return _0xd5d4fe['getApplications'](_0x1784d6);}})['then'](function(_0xae021){if(_0xae021){_0x521df5=_0xae021[_0xdca7('0x4e')];if(!_0x3f79ee['query'][_0xdca7('0x4f')]('nolimit')){_0x1784d6[_0xdca7('0x33')]=qs[_0xdca7('0x33')](_0x3f79ee[_0xdca7('0x4a')]['limit']);_0x1784d6[_0xdca7('0x31')]=qs[_0xdca7('0x31')](_0x3f79ee['query']['offset']);}return _0xd5d4fe[_0xdca7('0x88')](_0x1784d6);}})[_0xdca7('0x22')](function(_0x338ba4){if(_0x338ba4){return _0x338ba4?{'count':_0x521df5,'rows':_0x338ba4}:null;}})[_0xdca7('0x22')](respondWithResult(_0xc2eea3,null))[_0xdca7('0x5b')](handleError(_0xc2eea3,null));};exports['notify']=function(_0x1073cd,_0x4599ee,_0x48b696){var _0x2c09c3={'channel':_0xdca7('0x89')};var _0x2c8f32=[];var _0x325318=[];var _0xd60b4d={};return db[_0xdca7('0x43')][_0xdca7('0x5e')]({'where':{'id':_0x1073cd['params']['id']},'include':[{'model':db[_0xdca7('0x84')],'as':_0xdca7('0x8a')}]})[_0xdca7('0x22')](handleEntityNotFound(_0x4599ee,null))[_0xdca7('0x22')](function(_0x2182f0){_0x2c09c3[_0xdca7('0x8b')]=_0x2182f0;if(_0x2c09c3['account']&&_0x2c09c3[_0xdca7('0x8b')][_0xdca7('0x46')]==='sinch'&&_0x1073cd['body'][_0xdca7('0x8c')]){if(_0x1073cd['body'][_0xdca7('0x8c')][_0xdca7('0x4e')]===0x0)return;if(_0x1073cd[_0xdca7('0x60')][_0xdca7('0x8c')][0x0][_0xdca7('0x8d')]!==_0xdca7('0x8e'))return;return db[_0xdca7('0x8f')]['update']({'read':!![],'readAt':_0x1073cd['body'][_0xdca7('0x8c')][0x0][_0xdca7('0x90')]},{'where':{'messageId':_0x1073cd[_0xdca7('0x60')][_0xdca7('0x8c')][0x0]['message_id']},'individualHooks':!![]})['then'](function(_0x1ae235){return _0x4599ee[_0xdca7('0x2e')](0xc8)[_0xdca7('0x30')](_0x1ae235);});}_0x2c09c3['applications']=_[_0xdca7('0x91')](_0x2182f0[_0xdca7('0x8a')],[_0xdca7('0x86')],[_0xdca7('0x92')]);if(_0x2c09c3[_0xdca7('0x8b')][_0xdca7('0x8a')]){delete _0x2c09c3[_0xdca7('0x8b')][_0xdca7('0x8a')];}return db[_0xdca7('0x93')][_0xdca7('0x69')]()[_0xdca7('0x22')](function(_0x2db928){if(!_0x2db928){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x2c8f32=_[_0xdca7('0x94')](_['keys'](_0x2db928),['createdAt',_0xdca7('0x95')]);_0x325318=_[_0xdca7('0x94')](_[_0xdca7('0x48')](_0x2db928),[_0xdca7('0x96'),_0xdca7('0x95'),_0xdca7('0x97'),_0xdca7('0x98')]);_0x2c09c3[_0xdca7('0x60')]={'mapKey':_0xdca7('0x99')};if(_0x2c09c3[_0xdca7('0x8b')]&&_0x2c09c3[_0xdca7('0x8b')][_0xdca7('0x46')]===_0xdca7('0x9a')){_0x2c09c3['body'][_0xdca7('0x9b')]=_0x1073cd[_0xdca7('0x60')][_0xdca7('0x9c')][_0xdca7('0x9d')](_0xdca7('0x9e'),'');_0x2c09c3[_0xdca7('0x60')][_0xdca7('0x60')]=_0x1073cd[_0xdca7('0x60')][_0xdca7('0x9f')];_0x2c09c3['body'][_0xdca7('0xa0')]=_0x1073cd['body'][_0xdca7('0xa1')];}if(_0x2c09c3[_0xdca7('0x8b')]&&_0x2c09c3[_0xdca7('0x8b')]['type']===_0xdca7('0xa2')){_0x2c09c3['body'][_0xdca7('0x9b')]=_0x1073cd['body']['notifications'][0x0][_0xdca7('0x9b')];_0x2c09c3[_0xdca7('0x60')]['body']=_0x1073cd[_0xdca7('0x60')][_0xdca7('0xa3')][0x0][_0xdca7('0x2b')][_0xdca7('0x60')];_0x2c09c3[_0xdca7('0x60')]['messageId']=_0x1073cd[_0xdca7('0x60')][_0xdca7('0xa3')][0x0]['message_id'];}if(_0x2c09c3[_0xdca7('0x60')]['id']){delete _0x2c09c3[_0xdca7('0x60')]['id'];}if(_[_0xdca7('0xa4')](_0x2c09c3[_0xdca7('0x60')]['from'])){throw new db[(_0xdca7('0xa5'))][(_0xdca7('0xa6'))](_0xdca7('0xa7'));}if(_['isNil'](_0x2c09c3[_0xdca7('0x60')][_0xdca7('0x60')])||_0x2c09c3[_0xdca7('0x60')][_0xdca7('0x60')]===''){throw new db[(_0xdca7('0xa5'))][(_0xdca7('0xa6'))](_0xdca7('0xa8'));}if(_['isNil'](_0x2c09c3[_0xdca7('0x60')][_0xdca7('0xa9')])){throw new db['Sequelize'][(_0xdca7('0xa6'))](_0xdca7('0xaa')+_0x325318);}if(!_[_0xdca7('0xab')](_0x325318,_0x2c09c3['body'][_0xdca7('0xa9')])){throw new db[(_0xdca7('0xa5'))]['ValidationError'](_0xdca7('0xac')+_0x325318);}_0xd60b4d[_0x2c09c3['body']['mapKey']]=_0x2c09c3[_0xdca7('0x60')][_0xdca7('0x9b')];return db[_0xdca7('0xad')][_0xdca7('0x5e')]({'where':{'id':_0x2c09c3[_0xdca7('0x8b')][_0xdca7('0x98')]},'include':[{'model':db[_0xdca7('0x93')],'as':'Contacts','where':_0xd60b4d,'limit':0x1,'order':[['updatedAt',_0xdca7('0xae')]]}]});})[_0xdca7('0x22')](handleEntityNotFound(_0x4599ee,null))[_0xdca7('0x22')](function(_0x56dc0c){if(_0x56dc0c){_0x2c09c3[_0xdca7('0xaf')]=_[_0xdca7('0x76')](_0x56dc0c,[_0xdca7('0xb0')]);if(_0x56dc0c[_0xdca7('0xb0')][_0xdca7('0x4e')]){return _0x56dc0c['Contacts'][0x0];}var _0x457e7b=_[_0xdca7('0xb1')](_0x2c09c3[_0xdca7('0x60')],{'firstName':_0x2c09c3['body'][_0xdca7('0x9b')],'ListId':_0x56dc0c['id']});_0x457e7b[_0x2c09c3[_0xdca7('0x60')]['mapKey']]=_0x2c09c3[_0xdca7('0x60')][_0xdca7('0x9b')];return db[_0xdca7('0x93')]['create'](_0x457e7b,{'fields':_0x2c8f32,'raw':!![]});}})[_0xdca7('0x22')](handleEntityNotFound(_0x4599ee,null))[_0xdca7('0x22')](function(_0x117713){if(_0x117713){_0x2c09c3[_0xdca7('0xb2')]=_0x117713;var _0x413d2a={'ContactId':_0x117713['id'],'phone':_0x2c09c3['body'][_0xdca7('0x9b')],'WhatsappAccountId':_0x1073cd['params']['id']};var _0x227bd1={'ContactId':_0x117713['id'],'WhatsappAccountId':_0x1073cd[_0xdca7('0x5c')]['id'],'closed':![]};return db[_0xdca7('0xb3')][_0xdca7('0x5e')]({'where':_0x227bd1})[_0xdca7('0x22')](function(_0xfc93b){if(_0xfc93b){return[_0xfc93b,![]];}return db[_0xdca7('0xb3')][_0xdca7('0x5f')](_0x413d2a)[_0xdca7('0x22')](function(_0x54c7a4){return[_0x54c7a4,!![]];});});}})[_0xdca7('0x77')](function(_0x40818a,_0x4f0c3c){_0x2c09c3[_0xdca7('0xb4')]=_0x40818a[_0xdca7('0x63')]({'plain':!![]});_0x2c09c3[_0xdca7('0xb4')]['created']=![];if(_0x4f0c3c){if(_0x2c09c3[_0xdca7('0x8b')][_0xdca7('0xb5')]){_0x2c09c3[_0xdca7('0xb6')][_0xdca7('0xb7')]({'id':0x0,'priority':_0x2c09c3[_0xdca7('0xb6')][_0xdca7('0x4e')]+0x1,'app':_0xdca7('0xb8'),'appdata':'unmanaged','interval':_0xdca7('0xb9')});}_0x2c09c3[_0xdca7('0xb4')][_0xdca7('0xba')]=!![];}return db[_0xdca7('0x8f')][_0xdca7('0x5f')]({'phone':_0x2c09c3['body'][_0xdca7('0x9b')],'messageId':_0x2c09c3[_0xdca7('0x60')][_0xdca7('0xa0')],'body':_0x2c09c3[_0xdca7('0x60')][_0xdca7('0x60')],'WhatsappAccountId':_0x1073cd[_0xdca7('0x5c')]['id'],'WhatsappInteractionId':_0x40818a['id'],'direction':'in','ContactId':_0x40818a[_0xdca7('0xbb')],'AttachmentId':_0x2c09c3[_0xdca7('0x60')][_0xdca7('0xbc')]});})['then'](function(_0x4080db){_0x2c09c3[_0xdca7('0x2b')]=_0x4080db;if(_0x2c09c3[_0xdca7('0xb4')][_0xdca7('0xbd')]){return db[_0xdca7('0x7c')]['find']({'attributes':['id',_0xdca7('0x3d')],'where':{'id':_0x2c09c3[_0xdca7('0xb4')]['UserId']}})[_0xdca7('0x22')](function(_0x4a107f){if(_0x4a107f){_0x2c09c3[_0xdca7('0xb6')][_0xdca7('0xbe')]({'id':0x0,'priority':0x0,'app':_0xdca7('0xbf'),'appdata':_0x4a107f[_0xdca7('0x3d')]+','+(_0x2c09c3[_0xdca7('0x8b')][_0xdca7('0xc0')]||0xa),'interval':_0xdca7('0xb9')});}return respondWithRpcPromise(_0xdca7('0xc1'),_0xdca7('0xc2'),_0x2c09c3);});}return respondWithRpcPromise(_0xdca7('0xc1'),_0xdca7('0xc2'),_0x2c09c3);})[_0xdca7('0x22')](function(_0xc33d55){if(_0xc33d55){var _0xc7a2a9=0xc8;var _0x47df6c=_0xdca7('0xc3');logger[_0xdca7('0x23')](_0xdca7('0x26'),_0x47df6c,_0xc7a2a9,'entity\x20found');logger['debug'](_0xdca7('0xc4'),_0x47df6c,_0xc7a2a9,_0xdca7('0xc5'),JSON[_0xdca7('0x28')](_0xc33d55));if(_0x2c09c3[_0xdca7('0x8b')][_0xdca7('0x46')]===_0xdca7('0x9a')){return _0x4599ee[_0xdca7('0x2e')](_0xc7a2a9)[_0xdca7('0x35')](_0xdca7('0xc6'),'text/xml')[_0xdca7('0x3e')](_0xdca7('0xc7'));}else{return _0x4599ee[_0xdca7('0x2e')](_0xc7a2a9)[_0xdca7('0x30')](_0xc33d55);}}});})[_0xdca7('0x5b')](handleError(_0x4599ee,null));};exports[_0xdca7('0x3e')]=function(_0x25eba4,_0x1d3a41,_0x3479a5){var _0x5864e2,_0x4f6dbb,_0x259ce1;if(_[_0xdca7('0xa4')](_0x25eba4['body']['body'])||_0x25eba4['body']['body']===''){throw new db[(_0xdca7('0xa5'))][(_0xdca7('0xa6'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xdca7('0xa4')](_0x25eba4[_0xdca7('0x60')]['to'])){throw new db[(_0xdca7('0xa5'))]['ValidationError']('to\x20is\x20mandatory');}_0x5864e2=_0x25eba4['body']['to'];return db[_0xdca7('0x43')]['find']({'where':{'id':_0x25eba4['params']['id']},'include':[{'model':db[_0xdca7('0xad')],'as':_0xdca7('0xc8'),'include':[{'model':db[_0xdca7('0x93')],'as':_0xdca7('0xb0'),'where':{'mobile':_0x5864e2},'limit':0x1,'order':[[_0xdca7('0x95'),_0xdca7('0xae')]]}]}]})['then'](handleEntityNotFound(_0x1d3a41,null))[_0xdca7('0x22')](function(_0xe8f5af){if(_0xe8f5af&&_0xe8f5af['List']){_0x4f6dbb=_0xe8f5af['get']({'plain':!![]});if(_0x4f6dbb['List']&&_0x4f6dbb[_0xdca7('0xc8')]['Contacts']['length']){return _0x4f6dbb[_0xdca7('0xc8')][_0xdca7('0xb0')][0x0];}return db[_0xdca7('0x93')][_0xdca7('0x5f')](_[_0xdca7('0xb1')](_0x25eba4[_0xdca7('0x60')],{'firstName':_0x5864e2,'mobile':_0x5864e2,'phone':_0x5864e2,'ListId':_0x4f6dbb[_0xdca7('0x98')]}));}})[_0xdca7('0x22')](handleEntityNotFound(_0x1d3a41,null))[_0xdca7('0x22')](function(_0x417cdd){if(_0x417cdd){_0x259ce1=_0x417cdd;return db[_0xdca7('0xb3')]['find']({'where':{'ContactId':_0x259ce1['id'],'closed':![],'WhatsappAccountId':_0x4f6dbb['id']}})[_0xdca7('0x22')](function(_0x203066){if(_0x203066){return[_0x203066,![]];}return db['WhatsappInteraction']['create']({'UserId':_0x25eba4[_0xdca7('0x61')]['id'],'ContactId':_0x259ce1['id'],'WhatsappAccountId':_0x4f6dbb['id'],'phone':_0x5864e2,'firstMsgDirection':_0xdca7('0xc9'),'Messages':[_[_0xdca7('0x54')](_0x25eba4[_0xdca7('0x60')],{'read':![],'body':_0x25eba4[_0xdca7('0x60')][_0xdca7('0x60')],'phone':_0x5864e2,'WhatsappAccountId':_0x4f6dbb['id'],'UserId':_0x25eba4[_0xdca7('0x61')]['id'],'ContactId':_0x259ce1['id']})]},{'include':[{'model':db[_0xdca7('0x8f')],'as':_0xdca7('0xca')}]})[_0xdca7('0x22')](function(_0x526abe){return[_0x526abe,!![]];});});}})['spread'](function(_0x56f188,_0x4ae76f){if(_0x4ae76f){return _0x56f188;}return db[_0xdca7('0x8f')][_0xdca7('0x5f')](_[_0xdca7('0x54')](_0x25eba4['body'],{'read':![],'body':_0x25eba4['body']['body'],'phone':_0x5864e2,'WhatsappAccountId':_0x4f6dbb['id'],'WhatsappInteractionId':_0x56f188['id'],'UserId':_0x25eba4['user']['id'],'ContactId':_0x259ce1['id']}))[_0xdca7('0x22')](function(_0x1a8aa0){_0x56f188[_0xdca7('0xcb')]['Messages']=[];_0x56f188[_0xdca7('0xcb')]['Messages'][_0xdca7('0xb7')](_0x1a8aa0[_0xdca7('0xcb')]);return _0x56f188;});})['then'](respondWithResult(_0x1d3a41,null))[_0xdca7('0x5b')](handleError(_0x1d3a41,null));};
\ No newline at end of file
index f4b72e9..f61eb1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3565=['emit','../../mysqldb','WhatsappAccount','setMaxListeners','save'];(function(_0x2273b2,_0x386a9d){var _0x5bd09e=function(_0x1d0fc4){while(--_0x1d0fc4){_0x2273b2['push'](_0x2273b2['shift']());}};_0x5bd09e(++_0x386a9d);}(_0x3565,0xc4));var _0x5356=function(_0x586aa4,_0x8b35d6){_0x586aa4=_0x586aa4-0x0;var _0x2562e4=_0x3565[_0x586aa4];return _0x2562e4;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x5356('0x0'))['db'][_0x5356('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x5356('0x2')](0x0);var events={'afterCreate':_0x5356('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4f6d09){return function(_0x5c9dd1,_0x614e0c,_0xb285d2){WhatsappAccountEvents[_0x5356('0x4')](_0x4f6d09+':'+_0x5c9dd1['id'],_0x5c9dd1);WhatsappAccountEvents['emit'](_0x4f6d09,_0x5c9dd1);_0xb285d2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;
\ No newline at end of file
+var _0x2a50=['events','../../mysqldb','WhatsappAccount','setMaxListeners','emit','hasOwnProperty','hook','exports'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x2a50,0x168));var _0x02a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a50[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x02a5('0x0'));var WhatsappAccount=require(_0x02a5('0x1'))['db'][_0x02a5('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x02a5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2561cb){return function(_0x438c25,_0x5ac1d0,_0x467116){WhatsappAccountEvents[_0x02a5('0x4')](_0x2561cb+':'+_0x438c25['id'],_0x438c25);WhatsappAccountEvents[_0x02a5('0x4')](_0x2561cb,_0x438c25);_0x467116(null);};}for(var e in events){if(events[_0x02a5('0x5')](e)){var event=events[e];WhatsappAccount[_0x02a5('0x6')](e,emitEvent(event));}}module[_0x02a5('0x7')]=WhatsappAccountEvents;
\ No newline at end of file
index b1f2a94..c540096 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17e9=['bluebird','request-promise','path','rimraf','./whatsappAccount.attributes','exports','WhatsappAccount','whatsapp_accounts','util','../../config/logger','moment'];(function(_0x4c9708,_0x1b263f){var _0x4991d7=function(_0x2f533a){while(--_0x2f533a){_0x4c9708['push'](_0x4c9708['shift']());}};_0x4991d7(++_0x1b263f);}(_0x17e9,0x189));var _0x917e=function(_0x59c907,_0x127b40){_0x59c907=_0x59c907-0x0;var _0x24fcb8=_0x17e9[_0x59c907];return _0x24fcb8;};'use strict';var _=require('lodash');var util=require(_0x917e('0x0'));var logger=require(_0x917e('0x1'))('api');var moment=require(_0x917e('0x2'));var BPromise=require(_0x917e('0x3'));var rp=require(_0x917e('0x4'));var fs=require('fs');var path=require(_0x917e('0x5'));var rimraf=require(_0x917e('0x6'));var config=require('../../config/environment');var attributes=require(_0x917e('0x7'));module[_0x917e('0x8')]=function(_0x1b3421,_0x2c92a7){return _0x1b3421['define'](_0x917e('0x9'),attributes,{'tableName':_0x917e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8fe5=['bluebird','request-promise','rimraf','../../config/environment','exports','define','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','api','moment'];(function(_0x516923,_0x172451){var _0x3f9bfe=function(_0x4f1709){while(--_0x4f1709){_0x516923['push'](_0x516923['shift']());}};_0x3f9bfe(++_0x172451);}(_0x8fe5,0x74));var _0x58fe=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8fe5[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x58fe('0x0'));var util=require('util');var logger=require(_0x58fe('0x1'))(_0x58fe('0x2'));var moment=require(_0x58fe('0x3'));var BPromise=require(_0x58fe('0x4'));var rp=require(_0x58fe('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58fe('0x6'));var config=require(_0x58fe('0x7'));var attributes=require('./whatsappAccount.attributes');module[_0x58fe('0x8')]=function(_0x1851e5,_0x45a5be){return _0x1851e5[_0x58fe('0x9')](_0x58fe('0xa'),attributes,{'tableName':_0x58fe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d32e45a..8c9d9c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd6e=['defaults','redis','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','WhatsappAccount,\x20%s,\x20%s','message','ShowWhatsappAccount','find','options','raw','where','attributes','include','model','map','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x1de37b,_0x129ca8){var _0x681dc2=function(_0x58ef83){while(--_0x58ef83){_0x1de37b['push'](_0x1de37b['shift']());}};_0x681dc2(++_0x129ca8);}(_0xdd6e,0xa5));var _0xedd6=function(_0x2691dd,_0x2b3041){_0x2691dd=_0x2691dd-0x0;var _0x27c7a3=_0xdd6e[_0x2691dd];return _0x27c7a3;};'use strict';var _=require(_0xedd6('0x0'));var util=require(_0xedd6('0x1'));var moment=require(_0xedd6('0x2'));var BPromise=require(_0xedd6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xedd6('0x4'));var db=require(_0xedd6('0x5'))['db'];var utils=require(_0xedd6('0x6'));var logger=require(_0xedd6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xedd6('0x8')][_0xedd6('0x9')]({'port':0x232a});config['redis']=_[_0xedd6('0xa')](config[_0xedd6('0xb')],{'host':_0xedd6('0xc'),'port':0x18eb});var socket=require(_0xedd6('0xd'))(new Redis(config[_0xedd6('0xb')]));require('./whatsappAccount.socket')['register'](socket);function respondWithRpcPromise(_0x213920,_0x15b11c,_0x56961e){return new BPromise(function(_0x398d63,_0x25703e){return client[_0xedd6('0xe')](_0x213920,_0x56961e)[_0xedd6('0xf')](function(_0x5e2a3a){logger[_0xedd6('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x15b11c,_0xedd6('0x11'));logger[_0xedd6('0x12')](_0xedd6('0x13'),_0x15b11c,_0xedd6('0x11'),JSON['stringify'](_0x5e2a3a));if(_0x5e2a3a[_0xedd6('0x14')]){if(_0x5e2a3a[_0xedd6('0x14')][_0xedd6('0x15')]===0x1f4){logger[_0xedd6('0x14')](_0xedd6('0x16'),_0x15b11c,_0x5e2a3a[_0xedd6('0x14')][_0xedd6('0x17')]);return _0x25703e(_0x5e2a3a[_0xedd6('0x14')][_0xedd6('0x17')]);}logger[_0xedd6('0x14')](_0xedd6('0x16'),_0x15b11c,_0x5e2a3a[_0xedd6('0x14')]['message']);return _0x398d63(_0x5e2a3a[_0xedd6('0x14')][_0xedd6('0x17')]);}else{logger[_0xedd6('0x10')](_0xedd6('0x16'),_0x15b11c,'request\x20sent');_0x398d63(_0x5e2a3a['result'][_0xedd6('0x17')]);}})['catch'](function(_0x4649e6){logger[_0xedd6('0x14')](_0xedd6('0x16'),_0x15b11c,_0x4649e6);_0x25703e(_0x4649e6);});});}exports[_0xedd6('0x18')]=function(_0x3cf748){var _0x28de20=this;return new Promise(function(_0x3e5443,_0x3440c4){return db['WhatsappAccount'][_0xedd6('0x19')]({'raw':_0x3cf748[_0xedd6('0x1a')]?_0x3cf748['options'][_0xedd6('0x1b')]===undefined?!![]:![]:!![],'where':_0x3cf748['options']?_0x3cf748[_0xedd6('0x1a')][_0xedd6('0x1c')]||null:null,'attributes':_0x3cf748[_0xedd6('0x1a')]?_0x3cf748['options'][_0xedd6('0x1d')]||null:null,'include':_0x3cf748[_0xedd6('0x1a')]?_0x3cf748[_0xedd6('0x1a')][_0xedd6('0x1e')]?_['map'](_0x3cf748[_0xedd6('0x1a')][_0xedd6('0x1e')],function(_0x1b0e60){return{'model':db[_0x1b0e60[_0xedd6('0x1f')]],'as':_0x1b0e60['as'],'attributes':_0x1b0e60['attributes'],'include':_0x1b0e60['include']?_['map'](_0x1b0e60['include'],function(_0x129758){return{'model':db[_0x129758[_0xedd6('0x1f')]],'as':_0x129758['as'],'attributes':_0x129758[_0xedd6('0x1d')],'include':_0x129758[_0xedd6('0x1e')]?_[_0xedd6('0x20')](_0x129758[_0xedd6('0x1e')],function(_0x3bb0b1){return{'model':db[_0x3bb0b1[_0xedd6('0x1f')]],'as':_0x3bb0b1['as'],'attributes':_0x3bb0b1['attributes']};}):[]};}):[]};}):[]:[]})[_0xedd6('0xf')](function(_0x25e146){logger['info'](_0xedd6('0x18'),_0x3cf748);logger[_0xedd6('0x12')](_0xedd6('0x18'),_0x3cf748,JSON[_0xedd6('0x21')](_0x25e146));_0x3e5443(_0x25e146);})[_0xedd6('0x22')](function(_0x2f7afa){logger[_0xedd6('0x14')](_0xedd6('0x18'),_0x2f7afa[_0xedd6('0x17')],_0x3cf748);_0x3440c4(_0x28de20[_0xedd6('0x14')](0x1f4,_0x2f7afa[_0xedd6('0x17')]));});});};
\ No newline at end of file
+var _0xaace=['then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','ShowWhatsappAccount','WhatsappAccount','find','raw','options','where','attributes','include','map','model','stringify','catch','lodash','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./whatsappAccount.socket','register','request'];(function(_0x5e3388,_0x4c9dab){var _0x325ee3=function(_0x505d4d){while(--_0x505d4d){_0x5e3388['push'](_0x5e3388['shift']());}};_0x325ee3(++_0x4c9dab);}(_0xaace,0xf4));var _0xeaac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaace[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xeaac('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xeaac('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeaac('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xeaac('0x3'));var logger=require(_0xeaac('0x4'))(_0xeaac('0x5'));var config=require(_0xeaac('0x6'));var jayson=require(_0xeaac('0x7'));var client=jayson[_0xeaac('0x8')][_0xeaac('0x9')]({'port':0x232a});config['redis']=_[_0xeaac('0xa')](config[_0xeaac('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeaac('0xb')]));require(_0xeaac('0xc'))[_0xeaac('0xd')](socket);function respondWithRpcPromise(_0x169cf4,_0x5a9be7,_0x2a3099){return new BPromise(function(_0xfd14b0,_0x15c68a){return client[_0xeaac('0xe')](_0x169cf4,_0x2a3099)[_0xeaac('0xf')](function(_0x45eccc){logger[_0xeaac('0x10')](_0xeaac('0x11'),_0x5a9be7,_0xeaac('0x12'));logger[_0xeaac('0x13')](_0xeaac('0x14'),_0x5a9be7,_0xeaac('0x12'),JSON['stringify'](_0x45eccc));if(_0x45eccc[_0xeaac('0x15')]){if(_0x45eccc[_0xeaac('0x15')][_0xeaac('0x16')]===0x1f4){logger[_0xeaac('0x15')](_0xeaac('0x11'),_0x5a9be7,_0x45eccc[_0xeaac('0x15')]['message']);return _0x15c68a(_0x45eccc[_0xeaac('0x15')]['message']);}logger[_0xeaac('0x15')](_0xeaac('0x11'),_0x5a9be7,_0x45eccc[_0xeaac('0x15')][_0xeaac('0x17')]);return _0xfd14b0(_0x45eccc[_0xeaac('0x15')][_0xeaac('0x17')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x5a9be7,_0xeaac('0x12'));_0xfd14b0(_0x45eccc[_0xeaac('0x18')][_0xeaac('0x17')]);}})['catch'](function(_0x3e4c5f){logger['error'](_0xeaac('0x11'),_0x5a9be7,_0x3e4c5f);_0x15c68a(_0x3e4c5f);});});}exports[_0xeaac('0x19')]=function(_0x3f88af){var _0x25957e=this;return new Promise(function(_0x1925c5,_0x3052e4){return db[_0xeaac('0x1a')][_0xeaac('0x1b')]({'raw':_0x3f88af['options']?_0x3f88af['options'][_0xeaac('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f88af[_0xeaac('0x1d')]?_0x3f88af[_0xeaac('0x1d')][_0xeaac('0x1e')]||null:null,'attributes':_0x3f88af[_0xeaac('0x1d')]?_0x3f88af[_0xeaac('0x1d')][_0xeaac('0x1f')]||null:null,'include':_0x3f88af['options']?_0x3f88af[_0xeaac('0x1d')][_0xeaac('0x20')]?_[_0xeaac('0x21')](_0x3f88af[_0xeaac('0x1d')]['include'],function(_0x373210){return{'model':db[_0x373210[_0xeaac('0x22')]],'as':_0x373210['as'],'attributes':_0x373210[_0xeaac('0x1f')],'include':_0x373210[_0xeaac('0x20')]?_[_0xeaac('0x21')](_0x373210[_0xeaac('0x20')],function(_0x4a746b){return{'model':db[_0x4a746b[_0xeaac('0x22')]],'as':_0x4a746b['as'],'attributes':_0x4a746b[_0xeaac('0x1f')],'include':_0x4a746b['include']?_[_0xeaac('0x21')](_0x4a746b[_0xeaac('0x20')],function(_0x40b656){return{'model':db[_0x40b656[_0xeaac('0x22')]],'as':_0x40b656['as'],'attributes':_0x40b656[_0xeaac('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xeaac('0xf')](function(_0x299c05){logger[_0xeaac('0x10')]('ShowWhatsappAccount',_0x3f88af);logger[_0xeaac('0x13')]('ShowWhatsappAccount',_0x3f88af,JSON[_0xeaac('0x23')](_0x299c05));_0x1925c5(_0x299c05);})[_0xeaac('0x24')](function(_0x12831a){logger[_0xeaac('0x15')](_0xeaac('0x19'),_0x12831a[_0xeaac('0x17')],_0x3f88af);_0x3052e4(_0x25957e[_0xeaac('0x15')](0x1f4,_0x12831a[_0xeaac('0x17')]));});});};
\ No newline at end of file
index 113bf33..4bb8e86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd81=['emit','removeListener','length','whatsappAccount:','./whatsappAccount.events','save','remove'];(function(_0xa7b308,_0x389435){var _0x2c7e3a=function(_0x2f89f7){while(--_0x2f89f7){_0xa7b308['push'](_0xa7b308['shift']());}};_0x2c7e3a(++_0x389435);}(_0xbd81,0x123));var _0x1bd8=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xbd81[_0x3d42d8];return _0x27fc41;};'use strict';var WhatsappAccountEvents=require(_0x1bd8('0x0'));var events=[_0x1bd8('0x1'),_0x1bd8('0x2'),'update'];function createListener(_0x38f509,_0x21b0dd){return function(_0x4b7d86){_0x21b0dd[_0x1bd8('0x3')](_0x38f509,_0x4b7d86);};}function removeListener(_0x5de5c5,_0x3694ff){return function(){WhatsappAccountEvents[_0x1bd8('0x4')](_0x5de5c5,_0x3694ff);};}exports['register']=function(_0x3d248f){for(var _0x5ef6b5=0x0,_0x417abd=events[_0x1bd8('0x5')];_0x5ef6b5<_0x417abd;_0x5ef6b5++){var _0x555559=events[_0x5ef6b5];var _0x56aaeb=createListener(_0x1bd8('0x6')+_0x555559,_0x3d248f);WhatsappAccountEvents['on'](_0x555559,_0x56aaeb);}};
\ No newline at end of file
+var _0xfd56=['whatsappAccount:','save','update','emit','removeListener','length'];(function(_0x4d0710,_0x4597ba){var _0x5cc545=function(_0x506066){while(--_0x506066){_0x4d0710['push'](_0x4d0710['shift']());}};_0x5cc545(++_0x4597ba);}(_0xfd56,0x17b));var _0x6fd5=function(_0x509c6e,_0x21b267){_0x509c6e=_0x509c6e-0x0;var _0x3b5cfe=_0xfd56[_0x509c6e];return _0x3b5cfe;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x6fd5('0x0'),'remove',_0x6fd5('0x1')];function createListener(_0x126afe,_0xf4896d){return function(_0x37ca71){_0xf4896d[_0x6fd5('0x2')](_0x126afe,_0x37ca71);};}function removeListener(_0x685c1b,_0x421926){return function(){WhatsappAccountEvents[_0x6fd5('0x3')](_0x685c1b,_0x421926);};}exports['register']=function(_0x12bd94){for(var _0x2dc59e=0x0,_0x302de3=events[_0x6fd5('0x4')];_0x2dc59e<_0x302de3;_0x2dc59e++){var _0x2d2df9=events[_0x2dc59e];var _0x58a96d=createListener(_0x6fd5('0x5')+_0x2d2df9,_0x12bd94);WhatsappAccountEvents['on'](_0x2d2df9,_0x58a96d);}};
\ No newline at end of file
index 134287f..f68c316 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b36=['show','post','create','update','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','/:id'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x3b36,0x86));var _0x63b3=function(_0x221051,_0x45b1ca){_0x221051=_0x221051-0x0;var _0x3cc9cb=_0x3b36[_0x221051];return _0x3cc9cb;};'use strict';var multer=require(_0x63b3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x63b3('0x1'));var express=require(_0x63b3('0x2'));var router=express['Router']();var fs_extra=require(_0x63b3('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x63b3('0x4'));var config=require(_0x63b3('0x5'));var controller=require(_0x63b3('0x6'));router['get']('/',auth[_0x63b3('0x7')](),controller[_0x63b3('0x8')]);router['get'](_0x63b3('0x9'),auth[_0x63b3('0x7')](),controller[_0x63b3('0xa')]);router[_0x63b3('0xb')]('/',auth[_0x63b3('0x7')](),controller[_0x63b3('0xc')]);router['put']('/:id',auth[_0x63b3('0x7')](),controller[_0x63b3('0xd')]);router['delete'](_0x63b3('0x9'),auth[_0x63b3('0x7')](),controller[_0x63b3('0xe')]);module[_0x63b3('0xf')]=router;
\ No newline at end of file
+var _0x78b1=['show','post','create','put','isAuthenticated','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappApplication.controller','index','get','/:id'];(function(_0x84856c,_0x41f099){var _0x3f05a3=function(_0x5b300f){while(--_0x5b300f){_0x84856c['push'](_0x84856c['shift']());}};_0x3f05a3(++_0x41f099);}(_0x78b1,0x1d0));var _0x178b=function(_0x252e07,_0x4ae3cd){_0x252e07=_0x252e07-0x0;var _0x1dfae3=_0x78b1[_0x252e07];return _0x1dfae3;};'use strict';var multer=require('multer');var util=require(_0x178b('0x0'));var path=require(_0x178b('0x1'));var timeout=require(_0x178b('0x2'));var express=require('express');var router=express[_0x178b('0x3')]();var fs_extra=require(_0x178b('0x4'));var auth=require(_0x178b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x178b('0x6'));var controller=require(_0x178b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x178b('0x8')]);router[_0x178b('0x9')](_0x178b('0xa'),auth['isAuthenticated'](),controller[_0x178b('0xb')]);router[_0x178b('0xc')]('/',auth['isAuthenticated'](),controller[_0x178b('0xd')]);router[_0x178b('0xe')](_0x178b('0xa'),auth[_0x178b('0xf')](),controller[_0x178b('0x10')]);router[_0x178b('0x11')](_0x178b('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x178b('0x12')]=router;
\ No newline at end of file
index f756668..ba328eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x664e=['noop','STRING','*,*,*,*','sequelize'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x664e,0x143));var _0xe664=function(_0x5e43f4,_0x47ea74){_0x5e43f4=_0x5e43f4-0x0;var _0x3bcd34=_0x664e[_0x5e43f4];return _0x3bcd34;};'use strict';var Sequelize=require(_0xe664('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe664('0x1')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe664('0x2')]},'interval':{'type':Sequelize[_0xe664('0x2')],'defaultValue':_0xe664('0x3')}};
\ No newline at end of file
+var _0x89fb=['sequelize','exports','STRING','noop','TEXT'];(function(_0x511089,_0x47474e){var _0x21fbc7=function(_0x2302e9){while(--_0x2302e9){_0x511089['push'](_0x511089['shift']());}};_0x21fbc7(++_0x47474e);}(_0x89fb,0x1d1));var _0xb89f=function(_0x35d711,_0x41309f){_0x35d711=_0x35d711-0x0;var _0x2d5e13=_0x89fb[_0x35d711];return _0x2d5e13;};'use strict';var Sequelize=require(_0xb89f('0x0'));module[_0xb89f('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb89f('0x2')],'allowNull':![],'defaultValue':_0xb89f('0x3')},'appdata':{'type':Sequelize[_0xb89f('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb89f('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index c2141f7..3ceb296 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd991=['limit','count','json','apply','save','update','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','intersection','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined'];(function(_0x1f73c9,_0x439a05){var _0x32ebad=function(_0x50d1df){while(--_0x50d1df){_0x1f73c9['push'](_0x1f73c9['shift']());}};_0x32ebad(++_0x439a05);}(_0xd991,0x115));var _0x1d99=function(_0x55be53,_0x2b2d68){_0x55be53=_0x55be53-0x0;var _0x56c6a4=_0xd991[_0x55be53];return _0x56c6a4;};'use strict';var emlformat=require(_0x1d99('0x0'));var rimraf=require(_0x1d99('0x1'));var zipdir=require(_0x1d99('0x2'));var jsonpatch=require(_0x1d99('0x3'));var rp=require(_0x1d99('0x4'));var moment=require('moment');var BPromise=require(_0x1d99('0x5'));var Mustache=require(_0x1d99('0x6'));var util=require(_0x1d99('0x7'));var path=require(_0x1d99('0x8'));var sox=require(_0x1d99('0x9'));var csv=require(_0x1d99('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d99('0xb'));var _=require(_0x1d99('0xc'));var squel=require('squel');var crypto=require(_0x1d99('0xd'));var jsforce=require(_0x1d99('0xe'));var deskjs=require(_0x1d99('0xf'));var toCsv=require(_0x1d99('0xa'));var querystring=require(_0x1d99('0x10'));var Papa=require(_0x1d99('0x11'));var Redis=require(_0x1d99('0x12'));var authService=require(_0x1d99('0x13'));var qs=require(_0x1d99('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d99('0x15'));var logger=require(_0x1d99('0x16'))('api');var utils=require(_0x1d99('0x17'));var config=require(_0x1d99('0x18'));var licenseUtil=require(_0x1d99('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x442843,_0xf7b799){_0xf7b799=_0xf7b799||0xcc;return function(_0x3c87e3){if(_0x3c87e3){return _0x442843[_0x1d99('0x1a')](_0xf7b799);}return _0x442843[_0x1d99('0x1b')](_0xf7b799)[_0x1d99('0x1c')]();};}function respondWithResult(_0x5f57a8,_0x35dd66){_0x35dd66=_0x35dd66||0xc8;return function(_0x5ad75d){if(_0x5ad75d){return _0x5f57a8[_0x1d99('0x1b')](_0x35dd66)['json'](_0x5ad75d);}};}function respondWithFilteredResult(_0x2f8738,_0x1b2c78){return function(_0x3ac89a){if(_0x3ac89a){var _0x8903f2=typeof _0x1b2c78[_0x1d99('0x1d')]===_0x1d99('0x1e')&&typeof _0x1b2c78[_0x1d99('0x1f')]===_0x1d99('0x1e');var _0x5c31c3=_0x3ac89a[_0x1d99('0x20')];var _0x4da463=_0x8903f2?0x0:_0x1b2c78[_0x1d99('0x1d')];var _0x1a51a4=_0x8903f2?_0x3ac89a[_0x1d99('0x20')]:_0x1b2c78[_0x1d99('0x1d')]+_0x1b2c78[_0x1d99('0x1f')];var _0x5044a7;if(_0x1a51a4>=_0x5c31c3){_0x1a51a4=_0x5c31c3;_0x5044a7=0xc8;}else{_0x5044a7=0xce;}_0x2f8738['status'](_0x5044a7);return _0x2f8738['set']('Content-Range',_0x4da463+'-'+_0x1a51a4+'/'+_0x5c31c3)[_0x1d99('0x21')](_0x3ac89a);}return null;};}function patchUpdates(_0x20af77){return function(_0x234b4b){try{jsonpatch[_0x1d99('0x22')](_0x234b4b,_0x20af77,!![]);}catch(_0x1863c0){return BPromise['reject'](_0x1863c0);}return _0x234b4b[_0x1d99('0x23')]();};}function saveUpdates(_0x2e6c35,_0x4a72ac){return function(_0x25bd22){if(_0x25bd22){return _0x25bd22[_0x1d99('0x24')](_0x2e6c35)[_0x1d99('0x25')](function(_0x3e7160){return _0x3e7160;});}return null;};}function removeEntity(_0x42e482,_0x8273bb){return function(_0x54a295){if(_0x54a295){return _0x54a295[_0x1d99('0x26')]()[_0x1d99('0x25')](function(){_0x42e482['status'](0xcc)[_0x1d99('0x1c')]();});}};}function handleEntityNotFound(_0x31e70e,_0x5b5fd){return function(_0x30a1ef){if(!_0x30a1ef){_0x31e70e['sendStatus'](0x194);}return _0x30a1ef;};}function handleError(_0x27d9d9,_0x50c51e){_0x50c51e=_0x50c51e||0x1f4;return function(_0x150569){logger[_0x1d99('0x27')](_0x150569[_0x1d99('0x28')]);if(_0x150569[_0x1d99('0x29')]){delete _0x150569['name'];}_0x27d9d9[_0x1d99('0x1b')](_0x50c51e)[_0x1d99('0x2a')](_0x150569);};}exports[_0x1d99('0x2b')]=function(_0x37f7b1,_0x11bff3){var _0x1aaf2b={},_0x5c0c0a={},_0x273f41={'count':0x0,'rows':[]};var _0x16cc9f=_[_0x1d99('0x2c')](db[_0x1d99('0x2d')][_0x1d99('0x2e')],function(_0x4b5c90){return{'name':_0x4b5c90[_0x1d99('0x2f')],'type':_0x4b5c90[_0x1d99('0x30')][_0x1d99('0x31')]};});_0x5c0c0a[_0x1d99('0x32')]=_[_0x1d99('0x2c')](_0x16cc9f,_0x1d99('0x29'));_0x5c0c0a[_0x1d99('0x33')]=_[_0x1d99('0x34')](_0x37f7b1[_0x1d99('0x33')]);_0x5c0c0a[_0x1d99('0x35')]=_['intersection'](_0x5c0c0a[_0x1d99('0x32')],_0x5c0c0a[_0x1d99('0x33')]);_0x1aaf2b[_0x1d99('0x36')]=_['intersection'](_0x5c0c0a[_0x1d99('0x32')],qs[_0x1d99('0x37')](_0x37f7b1['query'][_0x1d99('0x37')]));_0x1aaf2b[_0x1d99('0x36')]=_0x1aaf2b[_0x1d99('0x36')][_0x1d99('0x38')]?_0x1aaf2b[_0x1d99('0x36')]:_0x5c0c0a['model'];if(!_0x37f7b1[_0x1d99('0x33')][_0x1d99('0x39')](_0x1d99('0x3a'))){_0x1aaf2b[_0x1d99('0x1f')]=qs[_0x1d99('0x1f')](_0x37f7b1[_0x1d99('0x33')][_0x1d99('0x1f')]);_0x1aaf2b['offset']=qs['offset'](_0x37f7b1[_0x1d99('0x33')][_0x1d99('0x1d')]);}_0x1aaf2b[_0x1d99('0x3b')]=qs[_0x1d99('0x3c')](_0x37f7b1[_0x1d99('0x33')]['sort']);_0x1aaf2b[_0x1d99('0x3d')]=qs[_0x1d99('0x35')](_[_0x1d99('0x3e')](_0x37f7b1[_0x1d99('0x33')],_0x5c0c0a[_0x1d99('0x35')]),_0x16cc9f);if(_0x37f7b1[_0x1d99('0x33')][_0x1d99('0x3f')]){_0x1aaf2b[_0x1d99('0x3d')]=_['merge'](_0x1aaf2b[_0x1d99('0x3d')],{'$or':_[_0x1d99('0x2c')](_0x16cc9f,function(_0x43b5cb){if(_0x43b5cb['type']!==_0x1d99('0x40')){var _0x478624={};_0x478624[_0x43b5cb['name']]={'$like':'%'+_0x37f7b1[_0x1d99('0x33')][_0x1d99('0x3f')]+'%'};return _0x478624;}})});}_0x1aaf2b=_[_0x1d99('0x41')]({},_0x1aaf2b,_0x37f7b1[_0x1d99('0x42')]);var _0x59c119={'where':_0x1aaf2b[_0x1d99('0x3d')]};return db[_0x1d99('0x2d')][_0x1d99('0x20')](_0x59c119)[_0x1d99('0x25')](function(_0x17d969){_0x273f41['count']=_0x17d969;if(_0x37f7b1[_0x1d99('0x33')][_0x1d99('0x43')]){_0x1aaf2b[_0x1d99('0x44')]=[{'all':!![]}];}return db[_0x1d99('0x2d')][_0x1d99('0x45')](_0x1aaf2b);})[_0x1d99('0x25')](function(_0x107f3c){_0x273f41['rows']=_0x107f3c;return _0x273f41;})[_0x1d99('0x25')](respondWithFilteredResult(_0x11bff3,_0x1aaf2b))[_0x1d99('0x46')](handleError(_0x11bff3,null));};exports[_0x1d99('0x47')]=function(_0x41dc0e,_0x16a423){var _0x3b6b66={'raw':!![],'where':{'id':_0x41dc0e[_0x1d99('0x48')]['id']}},_0x280937={};_0x280937[_0x1d99('0x32')]=_[_0x1d99('0x34')](db[_0x1d99('0x2d')]['rawAttributes']);_0x280937['query']=_[_0x1d99('0x34')](_0x41dc0e['query']);_0x280937[_0x1d99('0x35')]=_[_0x1d99('0x49')](_0x280937[_0x1d99('0x32')],_0x280937[_0x1d99('0x33')]);_0x3b6b66[_0x1d99('0x36')]=_[_0x1d99('0x49')](_0x280937[_0x1d99('0x32')],qs['fields'](_0x41dc0e['query']['fields']));_0x3b6b66[_0x1d99('0x36')]=_0x3b6b66[_0x1d99('0x36')][_0x1d99('0x38')]?_0x3b6b66[_0x1d99('0x36')]:_0x280937[_0x1d99('0x32')];if(_0x41dc0e['query'][_0x1d99('0x43')]){_0x3b6b66[_0x1d99('0x44')]=[{'all':!![]}];}_0x3b6b66=_[_0x1d99('0x41')]({},_0x3b6b66,_0x41dc0e['options']);return db[_0x1d99('0x2d')]['find'](_0x3b6b66)[_0x1d99('0x25')](handleEntityNotFound(_0x16a423,null))[_0x1d99('0x25')](respondWithResult(_0x16a423,null))[_0x1d99('0x46')](handleError(_0x16a423,null));};exports[_0x1d99('0x4a')]=function(_0x9e43b6,_0x437f13){return db['WhatsappApplication'][_0x1d99('0x4a')](_0x9e43b6[_0x1d99('0x4b')],{})[_0x1d99('0x25')](respondWithResult(_0x437f13,0xc9))[_0x1d99('0x46')](handleError(_0x437f13,null));};exports[_0x1d99('0x24')]=function(_0x5e458b,_0x48affc){if(_0x5e458b['body']['id']){delete _0x5e458b[_0x1d99('0x4b')]['id'];}return db[_0x1d99('0x2d')]['find']({'where':{'id':_0x5e458b['params']['id']}})[_0x1d99('0x25')](handleEntityNotFound(_0x48affc,null))[_0x1d99('0x25')](saveUpdates(_0x5e458b[_0x1d99('0x4b')],null))[_0x1d99('0x25')](respondWithResult(_0x48affc,null))[_0x1d99('0x46')](handleError(_0x48affc,null));};exports[_0x1d99('0x26')]=function(_0x10d644,_0x184f0e){return db[_0x1d99('0x2d')][_0x1d99('0x4c')]({'where':{'id':_0x10d644[_0x1d99('0x48')]['id']}})[_0x1d99('0x25')](handleEntityNotFound(_0x184f0e,null))[_0x1d99('0x25')](removeEntity(_0x184f0e,null))[_0x1d99('0x46')](handleError(_0x184f0e,null));};
\ No newline at end of file
+var _0xb90a=['intersection','model','fields','attributes','length','nolimit','limit','sort','where','pick','filter','type','VIRTUAL','options','findAll','rows','catch','params','include','merge','find','body','eml-format','rimraf','fast-json-patch','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','WhatsappApplication','rawAttributes','key','query','keys','filters'];(function(_0x167683,_0x34404c){var _0x42f56a=function(_0x518db7){while(--_0x518db7){_0x167683['push'](_0x167683['shift']());}};_0x42f56a(++_0x34404c);}(_0xb90a,0x12a));var _0xab90=function(_0x59a24c,_0x370f28){_0x59a24c=_0x59a24c-0x0;var _0x447e2f=_0xb90a[_0x59a24c];return _0x447e2f;};'use strict';var emlformat=require(_0xab90('0x0'));var rimraf=require(_0xab90('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xab90('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xab90('0x3'));var sox=require(_0xab90('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xab90('0x5'));var _=require(_0xab90('0x6'));var squel=require(_0xab90('0x7'));var crypto=require('crypto');var jsforce=require(_0xab90('0x8'));var deskjs=require(_0xab90('0x9'));var toCsv=require(_0xab90('0xa'));var querystring=require(_0xab90('0xb'));var Papa=require(_0xab90('0xc'));var Redis=require(_0xab90('0xd'));var authService=require(_0xab90('0xe'));var qs=require(_0xab90('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab90('0x10'));var logger=require(_0xab90('0x11'))(_0xab90('0x12'));var utils=require(_0xab90('0x13'));var config=require(_0xab90('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xab90('0x15'))['db'];function respondWithStatusCode(_0x97ab00,_0x35346a){_0x35346a=_0x35346a||0xcc;return function(_0x34d615){if(_0x34d615){return _0x97ab00[_0xab90('0x16')](_0x35346a);}return _0x97ab00[_0xab90('0x17')](_0x35346a)[_0xab90('0x18')]();};}function respondWithResult(_0x11e95a,_0xd485f5){_0xd485f5=_0xd485f5||0xc8;return function(_0x3dc022){if(_0x3dc022){return _0x11e95a[_0xab90('0x17')](_0xd485f5)[_0xab90('0x19')](_0x3dc022);}};}function respondWithFilteredResult(_0x1c3d44,_0x556828){return function(_0x282723){if(_0x282723){var _0x5b68bd=typeof _0x556828[_0xab90('0x1a')]===_0xab90('0x1b')&&typeof _0x556828['limit']===_0xab90('0x1b');var _0x2e0cf0=_0x282723[_0xab90('0x1c')];var _0x58cc79=_0x5b68bd?0x0:_0x556828[_0xab90('0x1a')];var _0x18323a=_0x5b68bd?_0x282723[_0xab90('0x1c')]:_0x556828[_0xab90('0x1a')]+_0x556828['limit'];var _0x2f6904;if(_0x18323a>=_0x2e0cf0){_0x18323a=_0x2e0cf0;_0x2f6904=0xc8;}else{_0x2f6904=0xce;}_0x1c3d44['status'](_0x2f6904);return _0x1c3d44[_0xab90('0x1d')]('Content-Range',_0x58cc79+'-'+_0x18323a+'/'+_0x2e0cf0)[_0xab90('0x19')](_0x282723);}return null;};}function patchUpdates(_0x143d54){return function(_0x2e8255){try{jsonpatch[_0xab90('0x1e')](_0x2e8255,_0x143d54,!![]);}catch(_0x5d5c1c){return BPromise[_0xab90('0x1f')](_0x5d5c1c);}return _0x2e8255[_0xab90('0x20')]();};}function saveUpdates(_0x2fa268,_0x3b1244){return function(_0x2195cc){if(_0x2195cc){return _0x2195cc[_0xab90('0x21')](_0x2fa268)[_0xab90('0x22')](function(_0x210b5e){return _0x210b5e;});}return null;};}function removeEntity(_0x84eb68,_0x2cdc7f){return function(_0x4757ba){if(_0x4757ba){return _0x4757ba[_0xab90('0x23')]()[_0xab90('0x22')](function(){_0x84eb68[_0xab90('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x7e141c,_0x39e8a5){return function(_0x167f84){if(!_0x167f84){_0x7e141c[_0xab90('0x16')](0x194);}return _0x167f84;};}function handleError(_0x4a37de,_0x205b63){_0x205b63=_0x205b63||0x1f4;return function(_0x2cad38){logger[_0xab90('0x24')](_0x2cad38[_0xab90('0x25')]);if(_0x2cad38['name']){delete _0x2cad38[_0xab90('0x26')];}_0x4a37de[_0xab90('0x17')](_0x205b63)['send'](_0x2cad38);};}exports[_0xab90('0x27')]=function(_0x16be33,_0x146cf7){var _0x2f81e2={},_0x24e562={},_0x209807={'count':0x0,'rows':[]};var _0x44a7a0=_[_0xab90('0x28')](db[_0xab90('0x29')][_0xab90('0x2a')],function(_0x581cc6){return{'name':_0x581cc6['fieldName'],'type':_0x581cc6['type'][_0xab90('0x2b')]};});_0x24e562['model']=_[_0xab90('0x28')](_0x44a7a0,_0xab90('0x26'));_0x24e562[_0xab90('0x2c')]=_[_0xab90('0x2d')](_0x16be33['query']);_0x24e562[_0xab90('0x2e')]=_[_0xab90('0x2f')](_0x24e562[_0xab90('0x30')],_0x24e562['query']);_0x2f81e2['attributes']=_[_0xab90('0x2f')](_0x24e562[_0xab90('0x30')],qs[_0xab90('0x31')](_0x16be33[_0xab90('0x2c')][_0xab90('0x31')]));_0x2f81e2[_0xab90('0x32')]=_0x2f81e2[_0xab90('0x32')][_0xab90('0x33')]?_0x2f81e2[_0xab90('0x32')]:_0x24e562[_0xab90('0x30')];if(!_0x16be33[_0xab90('0x2c')]['hasOwnProperty'](_0xab90('0x34'))){_0x2f81e2[_0xab90('0x35')]=qs[_0xab90('0x35')](_0x16be33[_0xab90('0x2c')][_0xab90('0x35')]);_0x2f81e2['offset']=qs[_0xab90('0x1a')](_0x16be33[_0xab90('0x2c')][_0xab90('0x1a')]);}_0x2f81e2['order']=qs[_0xab90('0x36')](_0x16be33[_0xab90('0x2c')][_0xab90('0x36')]);_0x2f81e2[_0xab90('0x37')]=qs[_0xab90('0x2e')](_[_0xab90('0x38')](_0x16be33['query'],_0x24e562[_0xab90('0x2e')]),_0x44a7a0);if(_0x16be33['query'][_0xab90('0x39')]){_0x2f81e2[_0xab90('0x37')]=_['merge'](_0x2f81e2[_0xab90('0x37')],{'$or':_['map'](_0x44a7a0,function(_0x43a828){if(_0x43a828[_0xab90('0x3a')]!==_0xab90('0x3b')){var _0x196de2={};_0x196de2[_0x43a828[_0xab90('0x26')]]={'$like':'%'+_0x16be33['query'][_0xab90('0x39')]+'%'};return _0x196de2;}})});}_0x2f81e2=_['merge']({},_0x2f81e2,_0x16be33[_0xab90('0x3c')]);var _0x1fadc9={'where':_0x2f81e2['where']};return db[_0xab90('0x29')][_0xab90('0x1c')](_0x1fadc9)[_0xab90('0x22')](function(_0x5557a4){_0x209807[_0xab90('0x1c')]=_0x5557a4;if(_0x16be33[_0xab90('0x2c')]['includeAll']){_0x2f81e2['include']=[{'all':!![]}];}return db[_0xab90('0x29')][_0xab90('0x3d')](_0x2f81e2);})[_0xab90('0x22')](function(_0x1c3328){_0x209807[_0xab90('0x3e')]=_0x1c3328;return _0x209807;})[_0xab90('0x22')](respondWithFilteredResult(_0x146cf7,_0x2f81e2))[_0xab90('0x3f')](handleError(_0x146cf7,null));};exports['show']=function(_0x291b47,_0x5563eb){var _0x1f7ef9={'raw':!![],'where':{'id':_0x291b47[_0xab90('0x40')]['id']}},_0x5f0491={};_0x5f0491[_0xab90('0x30')]=_[_0xab90('0x2d')](db[_0xab90('0x29')][_0xab90('0x2a')]);_0x5f0491[_0xab90('0x2c')]=_[_0xab90('0x2d')](_0x291b47[_0xab90('0x2c')]);_0x5f0491['filters']=_['intersection'](_0x5f0491['model'],_0x5f0491['query']);_0x1f7ef9[_0xab90('0x32')]=_['intersection'](_0x5f0491[_0xab90('0x30')],qs[_0xab90('0x31')](_0x291b47[_0xab90('0x2c')][_0xab90('0x31')]));_0x1f7ef9[_0xab90('0x32')]=_0x1f7ef9['attributes'][_0xab90('0x33')]?_0x1f7ef9['attributes']:_0x5f0491[_0xab90('0x30')];if(_0x291b47[_0xab90('0x2c')]['includeAll']){_0x1f7ef9[_0xab90('0x41')]=[{'all':!![]}];}_0x1f7ef9=_[_0xab90('0x42')]({},_0x1f7ef9,_0x291b47[_0xab90('0x3c')]);return db[_0xab90('0x29')][_0xab90('0x43')](_0x1f7ef9)[_0xab90('0x22')](handleEntityNotFound(_0x5563eb,null))['then'](respondWithResult(_0x5563eb,null))[_0xab90('0x3f')](handleError(_0x5563eb,null));};exports['create']=function(_0x1b7e3a,_0x488666){return db[_0xab90('0x29')]['create'](_0x1b7e3a[_0xab90('0x44')],{})['then'](respondWithResult(_0x488666,0xc9))['catch'](handleError(_0x488666,null));};exports['update']=function(_0x1bd4bd,_0x1bb19f){if(_0x1bd4bd[_0xab90('0x44')]['id']){delete _0x1bd4bd[_0xab90('0x44')]['id'];}return db[_0xab90('0x29')][_0xab90('0x43')]({'where':{'id':_0x1bd4bd[_0xab90('0x40')]['id']}})[_0xab90('0x22')](handleEntityNotFound(_0x1bb19f,null))[_0xab90('0x22')](saveUpdates(_0x1bd4bd['body'],null))[_0xab90('0x22')](respondWithResult(_0x1bb19f,null))[_0xab90('0x3f')](handleError(_0x1bb19f,null));};exports[_0xab90('0x23')]=function(_0x592ea4,_0x4b9cbc){return db[_0xab90('0x29')][_0xab90('0x43')]({'where':{'id':_0x592ea4[_0xab90('0x40')]['id']}})['then'](handleEntityNotFound(_0x4b9cbc,null))[_0xab90('0x22')](removeEntity(_0x4b9cbc,null))[_0xab90('0x3f')](handleError(_0x4b9cbc,null));};
\ No newline at end of file
index 673f1bb..0c90ea8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce50=['whatsapp_applications','utf8mb4','util','../../config/logger','api','moment','bluebird','rimraf','exports','define'];(function(_0x1305b7,_0x3ee487){var _0x1fec24=function(_0x3d7728){while(--_0x3d7728){_0x1305b7['push'](_0x1305b7['shift']());}};_0x1fec24(++_0x3ee487);}(_0xce50,0x1d8));var _0x0ce5=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xce50[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var util=require(_0x0ce5('0x0'));var logger=require(_0x0ce5('0x1'))(_0x0ce5('0x2'));var moment=require(_0x0ce5('0x3'));var BPromise=require(_0x0ce5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0ce5('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappApplication.attributes');module[_0x0ce5('0x6')]=function(_0x42fadd,_0x69892c){return _0x42fadd[_0x0ce5('0x7')]('WhatsappApplication',attributes,{'tableName':_0x0ce5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0ce5('0x9'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8ece=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x128a73,_0x26c676){var _0x210caa=function(_0x47ac0f){while(--_0x47ac0f){_0x128a73['push'](_0x128a73['shift']());}};_0x210caa(++_0x26c676);}(_0x8ece,0x195));var _0xe8ec=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x8ece[_0x3a73bc];return _0x32891b;};'use strict';var _=require(_0xe8ec('0x0'));var util=require(_0xe8ec('0x1'));var logger=require(_0xe8ec('0x2'))(_0xe8ec('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe8ec('0x4'));var fs=require('fs');var path=require(_0xe8ec('0x5'));var rimraf=require(_0xe8ec('0x6'));var config=require(_0xe8ec('0x7'));var attributes=require(_0xe8ec('0x8'));module['exports']=function(_0x346577,_0x23fa35){return _0x346577[_0xe8ec('0x9')](_0xe8ec('0xa'),attributes,{'tableName':_0xe8ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe8ec('0xc'),'collate':_0xe8ec('0xd')});};
\ No newline at end of file
index 185e91d..bd9475f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81bd=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x3bf7e5,_0xc51291){var _0x3cfc0a=function(_0x109761){while(--_0x109761){_0x3bf7e5['push'](_0x3bf7e5['shift']());}};_0x3cfc0a(++_0xc51291);}(_0x81bd,0x7c));var _0xd81b=function(_0x3e3d0a,_0x4745dd){_0x3e3d0a=_0x3e3d0a-0x0;var _0x3fc765=_0x81bd[_0x3e3d0a];return _0x3fc765;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var moment=require(_0xd81b('0x2'));var BPromise=require(_0xd81b('0x3'));var rs=require(_0xd81b('0x4'));var fs=require('fs');var Redis=require(_0xd81b('0x5'));var db=require(_0xd81b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd81b('0x7'))(_0xd81b('0x8'));var config=require(_0xd81b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd81b('0xa')][_0xd81b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f3f2c,_0x562084,_0x5e14e8){return new BPromise(function(_0xa4cf97,_0x5468d5){return client[_0xd81b('0xc')](_0x1f3f2c,_0x5e14e8)[_0xd81b('0xd')](function(_0x3420a7){logger[_0xd81b('0xe')](_0xd81b('0xf'),_0x562084,_0xd81b('0x10'));logger[_0xd81b('0x11')](_0xd81b('0x12'),_0x562084,_0xd81b('0x10'),JSON[_0xd81b('0x13')](_0x3420a7));if(_0x3420a7[_0xd81b('0x14')]){if(_0x3420a7[_0xd81b('0x14')][_0xd81b('0x15')]===0x1f4){logger['error'](_0xd81b('0xf'),_0x562084,_0x3420a7['error'][_0xd81b('0x16')]);return _0x5468d5(_0x3420a7[_0xd81b('0x14')]['message']);}logger[_0xd81b('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x562084,_0x3420a7[_0xd81b('0x14')][_0xd81b('0x16')]);return _0xa4cf97(_0x3420a7[_0xd81b('0x14')][_0xd81b('0x16')]);}else{logger[_0xd81b('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x562084,_0xd81b('0x10'));_0xa4cf97(_0x3420a7[_0xd81b('0x17')]['message']);}})[_0xd81b('0x18')](function(_0x26df61){logger[_0xd81b('0x14')](_0xd81b('0xf'),_0x562084,_0x26df61);_0x5468d5(_0x26df61);});});}
\ No newline at end of file
+var _0x668b=['bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x13c58b,_0x1eb3a3){var _0x1173af=function(_0x2df0ef){while(--_0x2df0ef){_0x13c58b['push'](_0x13c58b['shift']());}};_0x1173af(++_0x1eb3a3);}(_0x668b,0x140));var _0xb668=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x668b[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var moment=require('moment');var BPromise=require(_0xb668('0x2'));var rs=require(_0xb668('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb668('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb668('0x5'))(_0xb668('0x6'));var config=require(_0xb668('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb668('0x8')][_0xb668('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3be92e,_0x2778e9,_0x20b749){return new BPromise(function(_0x3f01bc,_0x517fc5){return client[_0xb668('0xa')](_0x3be92e,_0x20b749)[_0xb668('0xb')](function(_0x128cf5){logger[_0xb668('0xc')](_0xb668('0xd'),_0x2778e9,_0xb668('0xe'));logger[_0xb668('0xf')](_0xb668('0x10'),_0x2778e9,'request\x20sent',JSON[_0xb668('0x11')](_0x128cf5));if(_0x128cf5[_0xb668('0x12')]){if(_0x128cf5[_0xb668('0x12')][_0xb668('0x13')]===0x1f4){logger[_0xb668('0x12')](_0xb668('0xd'),_0x2778e9,_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);return _0x517fc5(_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);}logger[_0xb668('0x12')](_0xb668('0xd'),_0x2778e9,_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);return _0x3f01bc(_0x128cf5[_0xb668('0x12')][_0xb668('0x14')]);}else{logger[_0xb668('0xc')](_0xb668('0xd'),_0x2778e9,_0xb668('0xe'));_0x3f01bc(_0x128cf5[_0xb668('0x15')][_0xb668('0x14')]);}})[_0xb668('0x16')](function(_0x4ab137){logger[_0xb668('0x12')]('WhatsappApplication,\x20%s,\x20%s',_0x2778e9,_0x4ab137);_0x517fc5(_0x4ab137);});});}
\ No newline at end of file
index fe1bcc1..1a4fb23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c09=['whatsapp','whatsappinteraction:addtags','put','/:id','whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','/describe','isAuthenticated','describe','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked'];(function(_0x1c06f4,_0x2feba6){var _0x1a727e=function(_0x2e83af){while(--_0x2e83af){_0x1c06f4['push'](_0x1c06f4['shift']());}};_0x1a727e(++_0x2feba6);}(_0x7c09,0x102));var _0x97c0=function(_0x26f2d6,_0x412198){_0x26f2d6=_0x26f2d6-0x0;var _0xca4e6f=_0x7c09[_0x26f2d6];return _0xca4e6f;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x97c0('0x9')](_0x97c0('0xa'),auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0x9')]('/:id',auth[_0x97c0('0xb')](),controller['show']);router[_0x97c0('0x9')](_0x97c0('0xd'),auth['isAuthenticated'](),controller['getMessages']);router[_0x97c0('0x9')](_0x97c0('0xe'),auth[_0x97c0('0xb')](),controller[_0x97c0('0xf')]);router[_0x97c0('0x10')]('/',auth[_0x97c0('0xb')](),controller[_0x97c0('0x11')]);router[_0x97c0('0x10')](_0x97c0('0xd'),auth[_0x97c0('0xb')](),controller[_0x97c0('0x12')]);router[_0x97c0('0x10')](_0x97c0('0x13'),auth['isAuthenticated'](),interaction[_0x97c0('0x14')](_0x97c0('0x15'),_0x97c0('0x16')),controller['addTags']);router[_0x97c0('0x17')](_0x97c0('0x18'),auth[_0x97c0('0xb')](),interaction[_0x97c0('0x14')](_0x97c0('0x15'),_0x97c0('0x19')),controller['update']);router[_0x97c0('0x1a')](_0x97c0('0x18'),auth['isAuthenticated'](),interaction[_0x97c0('0x14')](_0x97c0('0x15'),_0x97c0('0x1b')),controller[_0x97c0('0x1c')]);router[_0x97c0('0x1a')](_0x97c0('0x13'),auth[_0x97c0('0xb')](),controller[_0x97c0('0x1d')]);module[_0x97c0('0x1e')]=router;
\ No newline at end of file
+var _0x2b83=['getMessages','/:id/download','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','whatsappinteraction:update','removeTags','exports','util','path','express','Router','fs-extra','../../config/environment','./whatsappInteraction.controller','isAuthenticated','get','/describe','describe','/:id','/:id/messages'];(function(_0x24f273,_0x349aa5){var _0x3f864d=function(_0x583d9a){while(--_0x583d9a){_0x24f273['push'](_0x24f273['shift']());}};_0x3f864d(++_0x349aa5);}(_0x2b83,0x1d3));var _0x32b8=function(_0x448ecb,_0x7aa8fb){_0x448ecb=_0x448ecb-0x0;var _0x3582cb=_0x2b83[_0x448ecb];return _0x3582cb;};'use strict';var multer=require('multer');var util=require(_0x32b8('0x0'));var path=require(_0x32b8('0x1'));var timeout=require('connect-timeout');var express=require(_0x32b8('0x2'));var router=express[_0x32b8('0x3')]();var fs_extra=require(_0x32b8('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x32b8('0x5'));var controller=require(_0x32b8('0x6'));router['get']('/',auth[_0x32b8('0x7')](),controller['index']);router[_0x32b8('0x8')](_0x32b8('0x9'),auth[_0x32b8('0x7')](),controller[_0x32b8('0xa')]);router['get'](_0x32b8('0xb'),auth[_0x32b8('0x7')](),controller['show']);router['get'](_0x32b8('0xc'),auth['isAuthenticated'](),controller[_0x32b8('0xd')]);router[_0x32b8('0x8')](_0x32b8('0xe'),auth[_0x32b8('0x7')](),controller['download']);router[_0x32b8('0xf')]('/',auth[_0x32b8('0x7')](),controller['create']);router['post'](_0x32b8('0xc'),auth['isAuthenticated'](),controller[_0x32b8('0x10')]);router['post'](_0x32b8('0x11'),auth[_0x32b8('0x7')](),interaction[_0x32b8('0x12')](_0x32b8('0x13'),_0x32b8('0x14')),controller['addTags']);router['put'](_0x32b8('0xb'),auth['isAuthenticated'](),interaction['tracked']('whatsapp',_0x32b8('0x15')),controller['update']);router['delete'](_0x32b8('0xb'),auth[_0x32b8('0x7')](),interaction[_0x32b8('0x12')](_0x32b8('0x13'),'whatsappinteraction:destroy'),controller['destroy']);router['delete'](_0x32b8('0x11'),auth[_0x32b8('0x7')](),controller[_0x32b8('0x16')]);module[_0x32b8('0x17')]=router;
\ No newline at end of file
index 7b89853..4e381b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2bb=['DATE','STRING','ENUM','out','moment','BOOLEAN'];(function(_0x2ef608,_0x53a7b1){var _0x56aa07=function(_0x318e2b){while(--_0x318e2b){_0x2ef608['push'](_0x2ef608['shift']());}};_0x56aa07(++_0x53a7b1);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x3190bb,_0x15a8e1){_0x3190bb=_0x3190bb-0x0;var _0xd6a206=_0xd2bb[_0x3190bb];return _0xd6a206;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xbd2b('0x0'));module['exports']={'closed':{'type':Sequelize[_0xbd2b('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbd2b('0x2')]},'disposition':{'type':Sequelize[_0xbd2b('0x3')]},'secondDisposition':{'type':Sequelize[_0xbd2b('0x3')]},'thirdDisposition':{'type':Sequelize[_0xbd2b('0x3')]},'note':{'type':Sequelize[_0xbd2b('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xbd2b('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xbd2b('0x4')]('in',_0xbd2b('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbd2b('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xbd2b('0x4')]('in',_0xbd2b('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xbd2b('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0x91c6=['STRING','ENUM','out','sequelize','BOOLEAN','DATE'];(function(_0x49ec46,_0x5d96ee){var _0x3b9e42=function(_0x3847c5){while(--_0x3847c5){_0x49ec46['push'](_0x49ec46['shift']());}};_0x3b9e42(++_0x5d96ee);}(_0x91c6,0xf9));var _0x691c=function(_0x41e19d,_0x59214f){_0x41e19d=_0x41e19d-0x0;var _0x31fb13=_0x91c6[_0x41e19d];return _0x31fb13;};'use strict';var Sequelize=require(_0x691c('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x691c('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x691c('0x2')]},'disposition':{'type':Sequelize[_0x691c('0x3')]},'secondDisposition':{'type':Sequelize[_0x691c('0x3')]},'thirdDisposition':{'type':Sequelize[_0x691c('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x691c('0x3')]},'read1stAt':{'type':Sequelize[_0x691c('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x691c('0x4')]('in',_0x691c('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x691c('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x691c('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x691c('0x1')],'defaultValue':![]}};
\ No newline at end of file
index 25b04d3..114e858 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c9a=['cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','length','find','unreadMessages','having','`\x20=\x200','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','body','some','compact','isEmpty','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','agent','i.WhatsappAccountId\x20IS\x20NULL','role','toString','sequelize','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','push','all','rows','catch','params','includeAll','include','options','create','describe','addMessage','ids','omit','getMessages','findOne','WhatsappMessage','WhatsappInteractionId','format','findAll','addTags','setTags','spread','color','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','attachments','User','CmContact','Contact','lastName','Attachment','direction','secret','WhatsappAccount','Account','Owner','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','Messages','createReadStream','pipe','createWriteStream','basename','out','firstName','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','update','then','destroy','stack','name','send','map','fullname','TagIds','Tags','split','forEach','waiting','talking','answered','unmanaged','total','closed','UserId','WhatsappInteraction','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','select','field','from','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions'];(function(_0x184759,_0x1cc38a){var _0xf26d5f=function(_0x1010c8){while(--_0x1010c8){_0x184759['push'](_0x184759['shift']());}};_0xf26d5f(++_0x1cc38a);}(_0x1c9a,0x98));var _0xa1c9=function(_0x4458a4,_0x3d5faa){_0x4458a4=_0x4458a4-0x0;var _0x1fc238=_0x1c9a[_0x4458a4];return _0x1fc238;};'use strict';var emlformat=require(_0xa1c9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa1c9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1c9('0x2'));var moment=require(_0xa1c9('0x3'));var BPromise=require(_0xa1c9('0x4'));var Mustache=require('mustache');var util=require(_0xa1c9('0x5'));var path=require(_0xa1c9('0x6'));var sox=require(_0xa1c9('0x7'));var csv=require(_0xa1c9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa1c9('0x9'));var _=require('lodash');var squel=require(_0xa1c9('0xa'));var crypto=require(_0xa1c9('0xb'));var jsforce=require(_0xa1c9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa1c9('0x8'));var querystring=require(_0xa1c9('0xd'));var Papa=require(_0xa1c9('0xe'));var Redis=require(_0xa1c9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa1c9('0x10'));var as=require(_0xa1c9('0x11'));var pdf=require(_0xa1c9('0x12'));var hardwareService=require(_0xa1c9('0x13'));var logger=require(_0xa1c9('0x14'))(_0xa1c9('0x15'));var utils=require(_0xa1c9('0x16'));var config=require(_0xa1c9('0x17'));var licenseUtil=require(_0xa1c9('0x18'));var db=require(_0xa1c9('0x19'))['db'];config['redis']=_[_0xa1c9('0x1a')](config[_0xa1c9('0x1b')],{'host':_0xa1c9('0x1c'),'port':0x18eb});var socket=require(_0xa1c9('0x1d'))(new Redis(config[_0xa1c9('0x1b')]));require('./whatsappInteraction.socket')[_0xa1c9('0x1e')](socket);function respondWithStatusCode(_0x4b2fa5,_0x2cba13){_0x2cba13=_0x2cba13||0xcc;return function(_0xd9bca1){if(_0xd9bca1){return _0x4b2fa5[_0xa1c9('0x1f')](_0x2cba13);}return _0x4b2fa5[_0xa1c9('0x20')](_0x2cba13)[_0xa1c9('0x21')]();};}function respondWithResult(_0x3b51f5,_0x1f6d26){_0x1f6d26=_0x1f6d26||0xc8;return function(_0x373f5d){if(_0x373f5d){return _0x3b51f5['status'](_0x1f6d26)[_0xa1c9('0x22')](_0x373f5d);}};}function respondWithFilteredResult(_0x1084d2,_0x224ae4){return function(_0x50db9b){if(_0x50db9b){var _0x2fb81e=typeof _0x224ae4['offset']===_0xa1c9('0x23')&&typeof _0x224ae4[_0xa1c9('0x24')]===_0xa1c9('0x23');var _0x5121a7=_0x50db9b[_0xa1c9('0x25')];var _0x46b1e4=_0x2fb81e?0x0:_0x224ae4[_0xa1c9('0x26')];var _0x4edf37=_0x2fb81e?_0x50db9b[_0xa1c9('0x25')]:_0x224ae4[_0xa1c9('0x26')]+_0x224ae4['limit'];var _0x2c0703;if(_0x4edf37>=_0x5121a7){_0x4edf37=_0x5121a7;_0x2c0703=0xc8;}else{_0x2c0703=0xce;}_0x1084d2[_0xa1c9('0x20')](_0x2c0703);return _0x1084d2[_0xa1c9('0x27')]('Content-Range',_0x46b1e4+'-'+_0x4edf37+'/'+_0x5121a7)[_0xa1c9('0x22')](_0x50db9b);}return null;};}function patchUpdates(_0x3dcec5){return function(_0x15f754){try{jsonpatch[_0xa1c9('0x28')](_0x15f754,_0x3dcec5,!![]);}catch(_0x24a5da){return BPromise['reject'](_0x24a5da);}return _0x15f754['save']();};}function saveUpdates(_0x200749,_0x50b16d){return function(_0x380f31){if(_0x380f31){return _0x380f31[_0xa1c9('0x29')](_0x200749)[_0xa1c9('0x2a')](function(_0x3059eb){return _0x3059eb;});}return null;};}function removeEntity(_0x339ed1,_0x522dc0){return function(_0x1925e7){if(_0x1925e7){return _0x1925e7[_0xa1c9('0x2b')]()[_0xa1c9('0x2a')](function(){_0x339ed1['status'](0xcc)[_0xa1c9('0x21')]();});}};}function handleEntityNotFound(_0x1e7a97,_0x1ca443){return function(_0x4ca1d7){if(!_0x4ca1d7){_0x1e7a97[_0xa1c9('0x1f')](0x194);}return _0x4ca1d7;};}function handleError(_0x2a2e9c,_0x594137){_0x594137=_0x594137||0x1f4;return function(_0x38936f){logger['error'](_0x38936f[_0xa1c9('0x2c')]);if(_0x38936f[_0xa1c9('0x2d')]){delete _0x38936f[_0xa1c9('0x2d')];}_0x2a2e9c[_0xa1c9('0x20')](_0x594137)[_0xa1c9('0x2e')](_0x38936f);};}function getInteractionUsers(_0xe8523b,_0x42fcb2){return new BPromise(function(_0x58b900,_0x5648b8){try{if(_0x42fcb2[_0xe8523b['id']]){_0xe8523b['Users']=_[_0xa1c9('0x2f')](_0x42fcb2[_0xe8523b['id']],function(_0x6912ec){return{'id':_0x6912ec['id'],'fullname':_0x6912ec[_0xa1c9('0x30')]};});}}catch(_0xf419d0){_0x5648b8(_0xf419d0);}_0x58b900(_0xe8523b);});}function getInteractionTags(_0x3161b0,_0x5b67c3){return new BPromise(function(_0x53f325,_0x5aecd7){try{if(_0x3161b0[_0xa1c9('0x31')]){_0x3161b0[_0xa1c9('0x32')]=[];_0x3161b0[_0xa1c9('0x31')][_0xa1c9('0x33')](',')[_0xa1c9('0x34')](function(_0x33e858){_0x3161b0[_0xa1c9('0x32')]['push'](_0x5b67c3[_0x33e858]);});}delete _0x3161b0[_0xa1c9('0x31')];}catch(_0x58d81a){_0x5aecd7(_0x58d81a);}_0x53f325(_0x3161b0);});}function updateWhatsappInteraction(_0x1b8707,_0x585a3a,_0xc63f93){return new BPromise(function(_0x27b5b2,_0x701ce9){return getInteractionUsers(_0x1b8707,_0xc63f93)['then'](function(_0x39818f){return getInteractionTags(_0x39818f,_0x585a3a);})[_0xa1c9('0x2a')](function(_0x24b739){return getStateInteraction(_0x24b739);})[_0xa1c9('0x2a')](function(_0x5f1c71){_0x27b5b2(_0x5f1c71);})['catch'](function(_0x1f1612){_0x701ce9(_0x1f1612);});});}function getStateInteraction(_0x1c56e2){return new BPromise(function(_0xe0ae3f){_0x1c56e2[_0xa1c9('0x35')]=0x0;_0x1c56e2[_0xa1c9('0x36')]=0x0;_0x1c56e2[_0xa1c9('0x37')]=0x0;_0x1c56e2[_0xa1c9('0x38')]=0x0;_0x1c56e2[_0xa1c9('0x39')]=0x0;if(!_0x1c56e2[_0xa1c9('0x3a')]&&!_0x1c56e2[_0xa1c9('0x3b')]){_0x1c56e2['waiting']+=0x1;}if(!_0x1c56e2[_0xa1c9('0x3a')]&&_0x1c56e2[_0xa1c9('0x3b')]){_0x1c56e2[_0xa1c9('0x36')]+=0x1;if(_0x1c56e2[_0xa1c9('0x35')]){_0x1c56e2[_0xa1c9('0x35')]-=0x1;}}if(_0x1c56e2[_0xa1c9('0x3a')]&&_0x1c56e2['UserId']){_0x1c56e2[_0xa1c9('0x37')]+=0x1;if(_0x1c56e2[_0xa1c9('0x36')]){_0x1c56e2[_0xa1c9('0x36')]-=0x1;}}if(_0x1c56e2['closed']&&!_0x1c56e2[_0xa1c9('0x3b')]){_0x1c56e2[_0xa1c9('0x38')]+=0x1;if(_0x1c56e2['waiting']){_0x1c56e2[_0xa1c9('0x35')]-=0x1;}}_0x1c56e2[_0xa1c9('0x39')]+=0x1;_0xe0ae3f(_0x1c56e2);});}exports['index']=function(_0x4dc34a,_0xdfdd44){var _0x1de580={},_0x34a6b8={},_0x125096={'count':0x0,'rows':[]};var _0xd9e67=_[_0xa1c9('0x2f')](db[_0xa1c9('0x3c')][_0xa1c9('0x3d')],function(_0x2ba991){return{'name':_0x2ba991[_0xa1c9('0x3e')],'type':_0x2ba991['type']['key']};});_0x34a6b8[_0xa1c9('0x3f')]=_[_0xa1c9('0x2f')](_0xd9e67,'name');_0x34a6b8[_0xa1c9('0x40')]=_[_0xa1c9('0x41')](_0x4dc34a[_0xa1c9('0x40')]);_0x34a6b8[_0xa1c9('0x42')]=_[_0xa1c9('0x43')](_0x34a6b8[_0xa1c9('0x3f')],_0x34a6b8[_0xa1c9('0x40')]);_0x1de580[_0xa1c9('0x44')]=_[_0xa1c9('0x43')](_0x34a6b8[_0xa1c9('0x3f')],qs[_0xa1c9('0x45')](_0x4dc34a['query'][_0xa1c9('0x45')]));_0x1de580['attributes']=_0x1de580[_0xa1c9('0x44')]['length']?_0x1de580[_0xa1c9('0x44')]:_0x34a6b8['model'];if(!_0x4dc34a[_0xa1c9('0x40')][_0xa1c9('0x46')]('nolimit')){_0x1de580[_0xa1c9('0x24')]=qs[_0xa1c9('0x24')](_0x4dc34a['query'][_0xa1c9('0x24')]);_0x1de580[_0xa1c9('0x26')]=qs[_0xa1c9('0x26')](_0x4dc34a[_0xa1c9('0x40')][_0xa1c9('0x26')]);}_0x1de580[_0xa1c9('0x47')]=qs['sort'](_0x4dc34a[_0xa1c9('0x40')][_0xa1c9('0x48')]);_0x1de580[_0xa1c9('0x49')]=qs[_0xa1c9('0x42')](_[_0xa1c9('0x4a')](_0x4dc34a['query'],_0x34a6b8['filters']),_0xd9e67);var _0x4cf00a=[];var _0x15329c=squel[_0xa1c9('0x4b')]()[_0xa1c9('0x4c')]('id')['field'](_0xa1c9('0x2d'))[_0xa1c9('0x4c')]('color')[_0xa1c9('0x4d')]('tools_tags');var _0x4f50ea=squel[_0xa1c9('0x4b')]()[_0xa1c9('0x4c')](_0xa1c9('0x4e'))[_0xa1c9('0x4c')](_0xa1c9('0x4f'))[_0xa1c9('0x4c')](_0xa1c9('0x50'))[_0xa1c9('0x4d')](_0xa1c9('0x51'),'ui')[_0xa1c9('0x52')](_0xa1c9('0x53'),'u',_0xa1c9('0x54'));var _0x2cd053=squel[_0xa1c9('0x4b')]()[_0xa1c9('0x4d')](_0xa1c9('0x55'),'i')[_0xa1c9('0x52')](_0xa1c9('0x56'),'c',_0xa1c9('0x57'))['left_join']('users','o',_0xa1c9('0x58'))[_0xa1c9('0x52')](_0xa1c9('0x59'),'a',_0xa1c9('0x5a'))['left_join'](_0xa1c9('0x5b'),'me',_0xa1c9('0x5c'))[_0xa1c9('0x52')]('whatsapp_interaction_has_tags','it',_0xa1c9('0x5d'))[_0xa1c9('0x52')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x14e630=squel['expr']();var _0x1b4edb=[];var _0x1bd5c7=squel[_0xa1c9('0x5e')]();var _0x4c1165;if(_0x4dc34a['query'][_0xa1c9('0x5f')]){_0x4c1165=as['parseSearch'](_0x4dc34a[_0xa1c9('0x40')]['search']);var _0x3334ad=_0x4c1165[_0xa1c9('0x60')];for(var _0x420291=0x0;_0x420291<_0x4c1165[_0xa1c9('0x61')][_0xa1c9('0x62')];_0x420291++){var _0x17086a=_0x4c1165[_0xa1c9('0x61')][_0x420291];var _0x59e235='i';var _0x22d2bf=_[_0xa1c9('0x63')](_0xd9e67,['name',_0x17086a['field']]);if(!_0x22d2bf){switch(_0x17086a['field']){case _0xa1c9('0x64'):if(_0x17086a['value']==0x1){_0x2cd053[_0xa1c9('0x65')]('`'+_0x17086a[_0xa1c9('0x4c')]+_0xa1c9('0x66'));}else{_0x2cd053[_0xa1c9('0x65')]('`'+_0x17086a[_0xa1c9('0x4c')]+'`\x20>\x200');}break;case'Contact':if(_0x17086a['operator']==='$substring'){if(_0x17086a[_0xa1c9('0x67')][_0xa1c9('0x33')]('\x20')[_0xa1c9('0x62')]>0x1){_0x14e630[_0x3334ad](_0xa1c9('0x68'),qs[_0xa1c9('0x69')](_0x17086a[_0xa1c9('0x67')]),null);}else{var _0x6489a5='%'+_0x17086a[_0xa1c9('0x67')]+'%';_0x14e630[_0x3334ad](_0xa1c9('0x6a'),_0x6489a5,_0x6489a5,_0x6489a5);}}else{_0x22d2bf=_[_0xa1c9('0x63')](_0xd9e67,[_0xa1c9('0x2d'),_0xa1c9('0x6b')]);_0x17086a[_0xa1c9('0x4c')]=_0xa1c9('0x6b');_0x5a980b=as['buildExpression'](_0x59e235,_0x22d2bf[_0xa1c9('0x6c')],_0x17086a);_0x14e630[_0x3334ad](_0x5a980b[_0xa1c9('0x6d')],_0x5a980b[_0xa1c9('0x67')][_0xa1c9('0x6e')],_0x5a980b['value'][_0xa1c9('0x21')]);}break;case _0xa1c9('0x6f'):var _0x1b2cff=_0x17086a[_0xa1c9('0x67')]['split'](',')['map'](function(_0x118bef){return Number(_0x118bef);});_0x1b2cff[_0xa1c9('0x34')](function(_0x3be723){_0x1bd5c7['or'](_0xa1c9('0x70'),'%,'+_0x3be723+',%');});_0x1b4edb=_[_0xa1c9('0x71')](_0x1b4edb,_0x1b2cff);break;case'User':if(_0x17086a[_0xa1c9('0x72')]===_0xa1c9('0x73')){_0x14e630[_0x3334ad](_0xa1c9('0x74'),'%'+_0x17086a[_0xa1c9('0x67')]+'%',null);}else{_0x22d2bf=_['find'](_0xd9e67,[_0xa1c9('0x2d'),_0xa1c9('0x3b')]);_0x17086a[_0xa1c9('0x4c')]='UserId';_0x5a980b=as[_0xa1c9('0x75')](_0x59e235,_0x22d2bf[_0xa1c9('0x6c')],_0x17086a);_0x14e630[_0x3334ad](_0x5a980b['text'],_0x5a980b[_0xa1c9('0x67')][_0xa1c9('0x6e')],_0x5a980b[_0xa1c9('0x67')][_0xa1c9('0x21')]);}break;case _0xa1c9('0x76'):_0x5a980b=as[_0xa1c9('0x75')]('me',null,_0x17086a);_0x14e630[_0x3334ad](_0x5a980b[_0xa1c9('0x6d')],_0x5a980b[_0xa1c9('0x67')][_0xa1c9('0x6e')],_0x5a980b[_0xa1c9('0x67')][_0xa1c9('0x21')]);break;}}else{var _0x5a980b=as[_0xa1c9('0x75')](_0x59e235,_0x22d2bf[_0xa1c9('0x6c')],_0x17086a);_0x14e630[_0x3334ad](_0x5a980b[_0xa1c9('0x6d')],_0x5a980b[_0xa1c9('0x67')]['start'],_0x5a980b[_0xa1c9('0x67')][_0xa1c9('0x21')]);}}}else{var _0x35bbe9=_(_0x4dc34a[_0xa1c9('0x40')])[_0xa1c9('0x41')]()[_0xa1c9('0x2f')](function(_0x460c86){return _[_0xa1c9('0x77')](_0xd9e67,[_0xa1c9('0x2d'),_0x460c86])?_0x460c86:undefined;})[_0xa1c9('0x78')]()[_0xa1c9('0x67')]();if(!_[_0xa1c9('0x79')](_0x35bbe9)){_0x35bbe9[_0xa1c9('0x34')](function(_0x3cbf59){if(_0x3cbf59==='WhatsappAccountId'){_0x2cd053[_0xa1c9('0x49')](_0xa1c9('0x7a'),[][_0xa1c9('0x7b')](_0x4dc34a[_0xa1c9('0x40')][_0x3cbf59]));}else if(_0x3cbf59===_0xa1c9('0x7c')){var _0x1976a3=JSON[_0xa1c9('0x7d')](_0x4dc34a['query'][_0x3cbf59])[_0xa1c9('0x7e')];var _0x2d6792=JSON['parse'](_0x4dc34a[_0xa1c9('0x40')][_0x3cbf59])[_0xa1c9('0x7f')];_0x2cd053[_0xa1c9('0x49')](_0xa1c9('0x80'),_0x1976a3,_0x2d6792);}else{if(_0x4dc34a['query'][_0x3cbf59]===_0xa1c9('0x81')){_0x2cd053['where']('i.'+_0x3cbf59+'\x20IS\x20NULL');}else{_0x2cd053[_0xa1c9('0x49')]('i.'+_0x3cbf59+_0xa1c9('0x82'),_0x4dc34a[_0xa1c9('0x40')][_0x3cbf59]);}}});}if(_0x4dc34a[_0xa1c9('0x40')]['read']){if(_0x4dc34a[_0xa1c9('0x40')][_0xa1c9('0x83')]==0x1){_0x2cd053['having'](_0xa1c9('0x84'));}else{_0x2cd053[_0xa1c9('0x65')](_0xa1c9('0x85'));}}if(_0x4dc34a[_0xa1c9('0x40')][_0xa1c9('0x86')]){_0x1b4edb=_[_0xa1c9('0x87')](_0x4dc34a['query']['tag'])?_0x4dc34a[_0xa1c9('0x40')]['tag']:new Array(_0x4dc34a[_0xa1c9('0x40')][_0xa1c9('0x86')]);_0x1b4edb[_0xa1c9('0x34')](function(_0x2b2c6c){_0x1bd5c7['or'](_0xa1c9('0x70'),'%,'+_0x2b2c6c+',%');});}if(_0x4dc34a[_0xa1c9('0x40')][_0xa1c9('0x88')]){var _0x3c9792=_0x4dc34a[_0xa1c9('0x40')]['filter'][_0xa1c9('0x89')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3c9792)){_0x14e630['or'](_0xa1c9('0x8a'),_0x3c9792+'%')['or']('i.phone\x20LIKE\x20?',_0x3c9792+'%');}else{_0x14e630['or'](_0xa1c9('0x8b'),qs[_0xa1c9('0x69')](_0x3c9792))['or'](_0xa1c9('0x8c'),_0x3c9792+'%');}}}_0x2cd053[_0xa1c9('0x49')](_0x14e630);_0x2cd053[_0xa1c9('0x8d')](_0xa1c9('0x8e'));var _0x1a8418={'type':db['Sequelize'][_0xa1c9('0x8f')][_0xa1c9('0x90')],'raw':!![]};var _0x2d5861=_0x2cd053['clone']();_0x2d5861['field'](_0xa1c9('0x8e'));_0x2d5861['field'](_0xa1c9('0x91'),_0xa1c9('0x64'));if(_0x1de580[_0xa1c9('0x47')]){_0x1de580[_0xa1c9('0x47')]['forEach'](function(_0x3b7165){var _0x2229af=_0x3b7165[0x0]===_0xa1c9('0x92')?_0x3b7165[0x0]:'i.'+_0x3b7165[0x0];_0x2cd053[_0xa1c9('0x47')](_0x2229af,_0x3b7165[0x1]===_0xa1c9('0x93')?![]:!![]);});}if(!_['isEmpty'](_0x1b4edb)){_0x2cd053[_0xa1c9('0x65')](_0x1bd5c7);_0x2d5861[_0xa1c9('0x49')](_0xa1c9('0x94'),_0x1b4edb);}BPromise['resolve']()[_0xa1c9('0x2a')](function(){if(!_0x4c1165){if(_0x4dc34a[_0xa1c9('0x40')][_0xa1c9('0x95')])return;_0x2d5861[_0xa1c9('0x49')](_0xa1c9('0x96'));_0x2cd053[_0xa1c9('0x49')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x4dc34a[_0xa1c9('0x97')]['role']!==_0xa1c9('0x98'))return;return _0x4dc34a[_0xa1c9('0x97')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0xa1c9('0x2a')](function(_0x5adc36){if(_[_0xa1c9('0x79')](_0x5adc36)){_0x2d5861[_0xa1c9('0x49')](_0xa1c9('0x99'));_0x2cd053[_0xa1c9('0x49')](_0xa1c9('0x99'));}else{_0x2d5861[_0xa1c9('0x49')](_0xa1c9('0x7a'),_[_0xa1c9('0x2f')](_0x5adc36,'id'));_0x2cd053[_0xa1c9('0x49')](_0xa1c9('0x7a'),_[_0xa1c9('0x2f')](_0x5adc36,'id'));}});})[_0xa1c9('0x2a')](function(){if(_0x4dc34a[_0xa1c9('0x97')][_0xa1c9('0x9a')]===_0xa1c9('0x98')&&!_0x4c1165&&!_0x4dc34a[_0xa1c9('0x40')]['WhatsappAccountId'])return[];return db['sequelize'][_0xa1c9('0x40')](_0x2d5861[_0xa1c9('0x9b')](),_0x1a8418);})[_0xa1c9('0x2a')](function(_0x54ec05){_0x125096[_0xa1c9('0x25')]=_0x54ec05['length'];if(_0x125096['count']===0x0)return[];return db[_0xa1c9('0x9c')][_0xa1c9('0x40')](_0x15329c['toString'](),_0x1a8418)[_0xa1c9('0x2a')](function(_0x5f257a){_0x4cf00a=_['keyBy'](_0x5f257a,'id');_0x1a8418=_[_0xa1c9('0x9d')](_0x1a8418,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4dc34a[_0xa1c9('0x40')][_0xa1c9('0x45')]){_0x1de580['attributes'][_0xa1c9('0x34')](function(_0x1277eb){_0x2cd053[_0xa1c9('0x4c')]('i.'+_0x1277eb);});}else{_0x2cd053[_0xa1c9('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa1c9('0x64'));_0x2cd053[_0xa1c9('0x4c')](_0xa1c9('0x9e'),_0xa1c9('0x9f'));_0x2cd053[_0xa1c9('0x4c')](_0xa1c9('0xa0'),'Account.mandatoryDisposition');_0x2cd053[_0xa1c9('0x4c')](_0xa1c9('0xa1'),'contactName');_0x2cd053['field'](_0xa1c9('0xa2'));_0x2cd053[_0xa1c9('0x4c')](_0xa1c9('0xa3'),_0xa1c9('0xa4'));_0x2cd053[_0xa1c9('0x4c')](_0xa1c9('0xa5'),'Contact.lastName');_0x2cd053[_0xa1c9('0x4c')]('c.email',_0xa1c9('0xa6'));_0x2cd053[_0xa1c9('0x4c')](_0xa1c9('0xa7'),'Contact.phone');_0x2cd053[_0xa1c9('0x4c')](_0xa1c9('0xa8'),_0xa1c9('0xa9'));_0x2cd053['field']('c.fax',_0xa1c9('0xaa'));_0x2cd053['field'](_0xa1c9('0xab'),'Owner.fullname');_0x2cd053[_0xa1c9('0x4c')](_0xa1c9('0xac'),_0xa1c9('0xad'));_0x2cd053['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x1de580[_0xa1c9('0x24')])_0x2cd053[_0xa1c9('0x24')](_0x1de580[_0xa1c9('0x24')]);if(_0x1de580[_0xa1c9('0x26')])_0x2cd053['offset'](_0x1de580['offset']);return db[_0xa1c9('0x9c')]['query'](_0x2cd053[_0xa1c9('0x9b')](),_0x1a8418);})[_0xa1c9('0x2a')](function(_0x1e8e97){if(_0x1e8e97['length']>0x0)_0x4f50ea[_0xa1c9('0x49')](_0xa1c9('0xae'),_[_0xa1c9('0x2f')](_0x1e8e97,'id'));return db[_0xa1c9('0x9c')][_0xa1c9('0x40')](_0x4f50ea[_0xa1c9('0x9b')](),_0x1a8418)[_0xa1c9('0x2a')](function(_0x2e22eb){var _0x7dcd44=_[_0xa1c9('0xaf')](_0x2e22eb,'WhatsappInteractionId');var _0x41cf88=[];_0x1e8e97[_0xa1c9('0x34')](function(_0x55a873){_0x41cf88[_0xa1c9('0xb0')](updateWhatsappInteraction(_0x55a873,_0x4cf00a,_0x7dcd44));});return BPromise[_0xa1c9('0xb1')](_0x41cf88);});});})[_0xa1c9('0x2a')](function(_0x1960fd){_0x125096[_0xa1c9('0xb2')]=_0x1960fd;return _0x125096;})['then'](respondWithFilteredResult(_0xdfdd44,_0x1de580))[_0xa1c9('0xb3')](handleError(_0xdfdd44,null));};exports['show']=function(_0x30ff0b,_0x2c04c5){var _0x137a58={'raw':![],'where':{'id':_0x30ff0b[_0xa1c9('0xb4')]['id']}},_0x5d8c8e={};_0x5d8c8e[_0xa1c9('0x3f')]=_[_0xa1c9('0x41')](db[_0xa1c9('0x3c')][_0xa1c9('0x3d')]);_0x5d8c8e[_0xa1c9('0x40')]=_[_0xa1c9('0x41')](_0x30ff0b['query']);_0x5d8c8e[_0xa1c9('0x42')]=_[_0xa1c9('0x43')](_0x5d8c8e[_0xa1c9('0x3f')],_0x5d8c8e['query']);_0x137a58[_0xa1c9('0x44')]=_[_0xa1c9('0x43')](_0x5d8c8e['model'],qs[_0xa1c9('0x45')](_0x30ff0b['query'][_0xa1c9('0x45')]));_0x137a58[_0xa1c9('0x44')]=_0x137a58[_0xa1c9('0x44')][_0xa1c9('0x62')]?_0x137a58[_0xa1c9('0x44')]:_0x5d8c8e['model'];if(_0x30ff0b[_0xa1c9('0x40')][_0xa1c9('0xb5')]){_0x137a58[_0xa1c9('0xb6')]=[{'all':!![]}];}_0x137a58=_[_0xa1c9('0x9d')]({},_0x137a58,_0x30ff0b[_0xa1c9('0xb7')]);return db[_0xa1c9('0x3c')][_0xa1c9('0x63')](_0x137a58)['then'](handleEntityNotFound(_0x2c04c5,null))[_0xa1c9('0x2a')](respondWithResult(_0x2c04c5,null))[_0xa1c9('0xb3')](handleError(_0x2c04c5,null));};exports[_0xa1c9('0xb8')]=function(_0x377aeb,_0x499aaa){return db[_0xa1c9('0x3c')][_0xa1c9('0xb8')](_0x377aeb['body'],{})[_0xa1c9('0x2a')](respondWithResult(_0x499aaa,0xc9))[_0xa1c9('0xb3')](handleError(_0x499aaa,null));};exports[_0xa1c9('0x29')]=function(_0x21ce1d,_0x51884d){if(_0x21ce1d['body']['id']){delete _0x21ce1d[_0xa1c9('0x76')]['id'];}return db['WhatsappInteraction'][_0xa1c9('0x63')]({'where':{'id':_0x21ce1d['params']['id']}})['then'](handleEntityNotFound(_0x51884d,null))[_0xa1c9('0x2a')](saveUpdates(_0x21ce1d['body'],null))[_0xa1c9('0x2a')](respondWithResult(_0x51884d,null))[_0xa1c9('0xb3')](handleError(_0x51884d,null));};exports[_0xa1c9('0x2b')]=function(_0x35838b,_0x28a7f7){return db[_0xa1c9('0x3c')]['find']({'where':{'id':_0x35838b[_0xa1c9('0xb4')]['id']}})['then'](handleEntityNotFound(_0x28a7f7,null))[_0xa1c9('0x2a')](removeEntity(_0x28a7f7,null))[_0xa1c9('0xb3')](handleError(_0x28a7f7,null));};exports['describe']=function(_0x110617,_0x3f8f51){return db[_0xa1c9('0x3c')][_0xa1c9('0xb9')]()[_0xa1c9('0x2a')](respondWithResult(_0x3f8f51,null))[_0xa1c9('0xb3')](handleError(_0x3f8f51,null));};exports['addMessage']=function(_0x2c756e,_0xb3163b,_0x45c0f1){return db['WhatsappMessage'][_0xa1c9('0x63')]({'where':{'id':_0x2c756e['params']['id']}})[_0xa1c9('0x2a')](handleEntityNotFound(_0xb3163b,null))['then'](function(_0x54bce4){if(_0x54bce4){return _0x54bce4[_0xa1c9('0xba')](_0x2c756e['body'][_0xa1c9('0xbb')],_[_0xa1c9('0xbc')](_0x2c756e[_0xa1c9('0x76')],[_0xa1c9('0xbb'),'id'])||{});}})['then'](respondWithResult(_0xb3163b,null))[_0xa1c9('0xb3')](handleError(_0xb3163b,null));};exports[_0xa1c9('0xbd')]=function(_0x5b5239,_0x163589,_0x5f3e31){var _0x6e0efe={'raw':![],'where':{}};var _0x1b86ab={};var _0x1ba0fb={'count':0x0,'rows':[]};return db[_0xa1c9('0x3c')][_0xa1c9('0xbe')]({'where':{'id':_0x5b5239[_0xa1c9('0xb4')]['id']}})[_0xa1c9('0x2a')](handleEntityNotFound(_0x163589,null))[_0xa1c9('0x2a')](function(_0x235eaf){if(_0x235eaf){_0x1b86ab[_0xa1c9('0x3f')]=_[_0xa1c9('0x41')](db[_0xa1c9('0xbf')][_0xa1c9('0x3d')]);_0x1b86ab['query']=_[_0xa1c9('0x41')](_0x5b5239[_0xa1c9('0x40')]);_0x1b86ab['filters']=_[_0xa1c9('0x43')](_0x1b86ab[_0xa1c9('0x3f')],_0x1b86ab[_0xa1c9('0x40')]);_0x6e0efe[_0xa1c9('0x44')]=_[_0xa1c9('0x43')](_0x1b86ab[_0xa1c9('0x3f')],qs[_0xa1c9('0x45')](_0x5b5239[_0xa1c9('0x40')]['fields']));_0x6e0efe['attributes']=_0x6e0efe[_0xa1c9('0x44')][_0xa1c9('0x62')]?_0x6e0efe['attributes']:_0x1b86ab['model'];if(!_0x5b5239['query']['hasOwnProperty']('nolimit')){_0x6e0efe['limit']=qs[_0xa1c9('0x24')](_0x5b5239[_0xa1c9('0x40')][_0xa1c9('0x24')]);_0x6e0efe[_0xa1c9('0x26')]=qs[_0xa1c9('0x26')](_0x5b5239[_0xa1c9('0x40')]['offset']);}_0x6e0efe[_0xa1c9('0x47')]=qs[_0xa1c9('0x48')](_0x5b5239[_0xa1c9('0x40')]['sort']);_0x6e0efe[_0xa1c9('0x49')]=qs['filters'](_['pick'](_0x5b5239[_0xa1c9('0x40')],_0x1b86ab[_0xa1c9('0x42')]));_0x6e0efe[_0xa1c9('0x49')][_0xa1c9('0xc0')]=_0x235eaf['id'];if(_0x5b5239['query'][_0xa1c9('0x88')]){_0x6e0efe[_0xa1c9('0x49')]=_[_0xa1c9('0x9d')](_0x6e0efe[_0xa1c9('0x49')],{'$or':_[_0xa1c9('0x2f')](_0x6e0efe['attributes'],function(_0x381f0b){var _0x5eacf2={};_0x5eacf2[_0x381f0b]={'$like':'%'+_0x5b5239[_0xa1c9('0x40')][_0xa1c9('0x88')]+'%'};return _0x5eacf2;})});}if(_0x5b5239['query'][_0xa1c9('0x7e')]){var _0x23268e=_0x5b5239[_0xa1c9('0x40')]['$gte']['split'](',');var _0x58facc={};_0x58facc[_0x23268e[0x0]]={'$gte':moment(_0x23268e[0x1])[_0xa1c9('0xc1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x6e0efe[_0xa1c9('0x49')]=_['merge'](_0x6e0efe[_0xa1c9('0x49')],_0x58facc);}_0x6e0efe=_['merge']({},_0x6e0efe,_0x5b5239[_0xa1c9('0xb7')]);return db[_0xa1c9('0xbf')][_0xa1c9('0x25')]({'where':_0x6e0efe[_0xa1c9('0x49')]})['then'](function(_0x27df58){_0x1ba0fb[_0xa1c9('0x25')]=_0x27df58;if(_0x5b5239[_0xa1c9('0x40')][_0xa1c9('0xb5')]){_0x6e0efe[_0xa1c9('0xb6')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xa1c9('0xc2')](_0x6e0efe);})[_0xa1c9('0x2a')](function(_0x45435c){_0x1ba0fb[_0xa1c9('0xb2')]=_0x45435c;return _0x1ba0fb;});}})['then'](respondWithFilteredResult(_0x163589,_0x6e0efe))[_0xa1c9('0xb3')](handleError(_0x163589,null));};exports[_0xa1c9('0xc3')]=function(_0x3f53a3,_0x23fb24,_0x3b89c8){return db[_0xa1c9('0x3c')][_0xa1c9('0x63')]({'where':{'id':_0x3f53a3['params']['id']}})[_0xa1c9('0x2a')](handleEntityNotFound(_0x23fb24,null))['then'](function(_0x5eb0a6){if(_0x5eb0a6){return _0x5eb0a6[_0xa1c9('0xc4')](_0x3f53a3[_0xa1c9('0x76')][_0xa1c9('0xbb')],_[_0xa1c9('0xbc')](_0x3f53a3[_0xa1c9('0x76')],[_0xa1c9('0xbb'),'id'])||{})[_0xa1c9('0xc5')](function(){return db['Tag'][_0xa1c9('0xc2')]({'attributes':['id','name',_0xa1c9('0xc6')],'where':{'id':_0x3f53a3[_0xa1c9('0x76')][_0xa1c9('0xbb')]}});})[_0xa1c9('0x2a')](function(_0x25d9d5){socket[_0xa1c9('0xc7')](_0xa1c9('0xc8'),{'id':Number(_0x3f53a3[_0xa1c9('0xb4')]['id']),'tags':_0x25d9d5||[]});return{'id':Number(_0x3f53a3[_0xa1c9('0xb4')]['id']),'tags':_0x25d9d5||[]};});}})[_0xa1c9('0x2a')](respondWithResult(_0x23fb24,null))[_0xa1c9('0xb3')](handleError(_0x23fb24,null));};exports[_0xa1c9('0xc9')]=function(_0x35919d,_0x11335b,_0x351335){return db['WhatsappInteraction'][_0xa1c9('0x63')]({'where':{'id':_0x35919d[_0xa1c9('0xb4')]['id']}})[_0xa1c9('0x2a')](handleEntityNotFound(_0x11335b,null))[_0xa1c9('0x2a')](function(_0x4e9ee7){if(_0x4e9ee7){return _0x4e9ee7[_0xa1c9('0xc9')](_0x35919d[_0xa1c9('0x40')][_0xa1c9('0xbb')]);}})[_0xa1c9('0x2a')](respondWithStatusCode(_0x11335b,null))[_0xa1c9('0xb3')](handleError(_0x11335b,null));};exports[_0xa1c9('0xca')]=function(_0x38c14e,_0x2f2315){var _0x29b578=moment()[_0xa1c9('0xcb')]()[_0xa1c9('0x9b')]();var _0x42f59c=path[_0xa1c9('0xcc')](config[_0xa1c9('0xcd')],_0xa1c9('0xce'),'files',_0xa1c9('0xcf'));var _0x52f488=path[_0xa1c9('0xcc')](config['root'],_0xa1c9('0xce'),_0xa1c9('0xd0'),_0xa1c9('0xd1'));var _0x2ae889=path[_0xa1c9('0xcc')](_0x42f59c,_0x29b578);var _0x3f707c=util[_0xa1c9('0xc1')]('transcript-%d-%s.zip',_0x38c14e[_0xa1c9('0xb4')]['id'],_0x29b578);var _0x54c932=path[_0xa1c9('0xcc')](_0x42f59c,_0x3f707c);var _0x27f2c7=[];_0x27f2c7[_0xa1c9('0xb0')]({'model':db[_0xa1c9('0xd2')],'as':_0xa1c9('0xd2'),'attributes':['id',_0xa1c9('0x30')],'raw':!![]});_0x27f2c7[_0xa1c9('0xb0')]({'model':db[_0xa1c9('0xd3')],'as':_0xa1c9('0xd4'),'attributes':['id','firstName',_0xa1c9('0xd5')],'raw':!![]});if(_0x38c14e[_0xa1c9('0x40')][_0xa1c9('0xd1')]){_0x27f2c7[_0xa1c9('0xb0')]({'model':db[_0xa1c9('0xd6')],'as':_0xa1c9('0xd6'),'raw':!![]});}var _0x473a4f=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id',_0xa1c9('0x76'),_0xa1c9('0x7c'),_0xa1c9('0xd7'),_0xa1c9('0xd8'),_0xa1c9('0x83')],'include':_0x27f2c7}];_0x473a4f['push']({'model':db[_0xa1c9('0xd9')],'as':_0xa1c9('0xda'),'attributes':['id',_0xa1c9('0x2d')]});_0x473a4f[_0xa1c9('0xb0')]({'model':db[_0xa1c9('0xd2')],'as':_0xa1c9('0xdb'),'attributes':['id',_0xa1c9('0x30')]});return db[_0xa1c9('0x3c')][_0xa1c9('0x63')]({'where':{'id':_0x38c14e[_0xa1c9('0xb4')]['id']},'include':_0x473a4f})[_0xa1c9('0x2a')](handleEntityNotFound(_0x2f2315,null))[_0xa1c9('0x2a')](function(_0x2e26e8){if(_0x2e26e8){var _0x428c27=_0x2e26e8['get']({'plain':!![]});fs['mkdirSync'](_0x2ae889);var _0x102f84={'channel':_0xa1c9('0xdc'),'account':_0x428c27[_0xa1c9('0xda')]['name'],'agent':_0x428c27[_0xa1c9('0xdb')]?_0x428c27[_0xa1c9('0xdb')][_0xa1c9('0x30')]:_0xa1c9('0xdd'),'createdAt':moment(_0x428c27[_0xa1c9('0x7c')])[_0xa1c9('0xc1')](_0xa1c9('0xde'))[_0xa1c9('0x9b')](),'closedAt':_0x428c27['closed']?moment(_0x428c27[_0xa1c9('0xdf')])['format'](_0xa1c9('0xde'))[_0xa1c9('0x9b')]():'','disposition':_0x428c27[_0xa1c9('0xe0')],'messages':_(_0x428c27[_0xa1c9('0xe1')])['filter']({'secret':![]})[_0xa1c9('0x2f')](function(_0x4c4cba){if(_0x4c4cba['Attachment']){var _0x517134=path[_0xa1c9('0xcc')](_0x52f488,_0x4c4cba[_0xa1c9('0xd6')]['basename']);if(fs['existsSync'](_0x517134)){fs[_0xa1c9('0xe2')](_0x517134)[_0xa1c9('0xe3')](fs[_0xa1c9('0xe4')](path['join'](_0x2ae889,_0x4c4cba[_0xa1c9('0xd6')][_0xa1c9('0xe5')])));}}return{'date':moment(_0x4c4cba[_0xa1c9('0x7c')])[_0xa1c9('0xc1')](_0xa1c9('0xde'))[_0xa1c9('0x9b')](),'sender':_0x4c4cba[_0xa1c9('0xd7')]===_0xa1c9('0xe6')?_0x4c4cba[_0xa1c9('0xd2')]?_0x4c4cba[_0xa1c9('0xd2')]['fullname']:'System':_0x4c4cba[_0xa1c9('0xd4')][_0xa1c9('0xe7')]+(_0x4c4cba[_0xa1c9('0xd4')]['lastName']?'\x20'+_0x4c4cba['Contact']['lastName']:''),'body':_0x4c4cba['Attachment']?_0x4c4cba[_0xa1c9('0xd6')][_0xa1c9('0xe5')]:_0x4c4cba['body'],'direction':_0x4c4cba[_0xa1c9('0xd7')]===_0xa1c9('0xe6')?'A':'C','secret':_0x4c4cba[_0xa1c9('0xd8')],'read':_0x4c4cba[_0xa1c9('0x83')],'attachment':_0x4c4cba[_0xa1c9('0xd6')]};})[_0xa1c9('0x67')]()};return ejs[_0xa1c9('0xe8')](path['join'](config[_0xa1c9('0xcd')],_0xa1c9('0xce'),'views',_0xa1c9('0xe9')),{'interaction':_0x102f84})[_0xa1c9('0x2a')](function(_0x155ee1){var _0x299afc=path[_0xa1c9('0xcc')](_0x2ae889,'transcript-'+_0x428c27['id']+'-'+_0x29b578+_0xa1c9('0xea'));var _0x3ca074={'path':_0x299afc,'channel':_0xa1c9('0xdc'),'interactionId':_0x428c27['id']};return pdf[_0xa1c9('0xeb')](_0x155ee1,_0x3ca074);})[_0xa1c9('0x2a')](function(){return new BPromise(function(_0x331e25,_0x1f7513){zipdir(_0x2ae889,{'saveTo':_0x54c932},function(_0x2fa2dc,_0x49820d){if(_0x2fa2dc)return _0x1f7513(_0x2fa2dc);return _0x331e25(_0x49820d);});})[_0xa1c9('0x2a')](function(){return new BPromise(function(_0xcd8e34,_0x9bcdf4){rimraf(_0x2ae889,function(_0x997889){if(_0x997889)_0x9bcdf4(_0x997889);return _0xcd8e34();});});})[_0xa1c9('0x2a')](function(){return _0x2f2315[_0xa1c9('0xca')](_0x54c932,_0x3f707c,function(_0x5a0328){if(_0x5a0328){console[_0xa1c9('0xec')](_0xa1c9('0xed'),_0x5a0328);}else{fs['unlinkSync'](_0x54c932);}});});});}else{return _0x2f2315[_0xa1c9('0x1f')](0xc8);}})['catch'](handleError(_0x2f2315,null));};
\ No newline at end of file
+var _0xb4b6=['body','some','compact','isEmpty','i.WhatsappAccountId\x20IN\x20?','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','QueryTypes','SELECT','clone','unreadMessages','contactName','t.id\x20IN\x20?','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','catch','show','params','includeAll','include','merge','options','create','describe','addMessage','WhatsappMessage','omit','ids','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','whatsappInteractionTags:save','removeTags','unix','root','server','files','join','transcript-%d-%s.zip','push','User','Contact','lastName','Messages','createdAt','direction','WhatsappAccount','Owner','mkdirSync','Whatsapp','Account','N.A.','closedAt','disposition','Attachment','basename','createReadStream','pipe','createWriteStream','System','out','secret','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','download','log','err','unlinkSync','sendStatus','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','error','stack','name','send','fullname','TagIds','forEach','then','answered','unmanaged','total','closed','UserId','waiting','talking','index','map','WhatsappInteraction','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','value','having','`\x20=\x200','$substring','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb4b6,0x7e));var _0x6b4b=function(_0x53284a,_0x339498){_0x53284a=_0x53284a-0x0;var _0x214fb6=_0xb4b6[_0x53284a];return _0x214fb6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b4b('0x0'));var zipdir=require(_0x6b4b('0x1'));var jsonpatch=require(_0x6b4b('0x2'));var rp=require(_0x6b4b('0x3'));var moment=require(_0x6b4b('0x4'));var BPromise=require(_0x6b4b('0x5'));var Mustache=require(_0x6b4b('0x6'));var util=require(_0x6b4b('0x7'));var path=require(_0x6b4b('0x8'));var sox=require('sox');var csv=require(_0x6b4b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6b4b('0xa'));var _=require(_0x6b4b('0xb'));var squel=require(_0x6b4b('0xc'));var crypto=require(_0x6b4b('0xd'));var jsforce=require(_0x6b4b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6b4b('0x9'));var querystring=require(_0x6b4b('0xf'));var Papa=require(_0x6b4b('0x10'));var Redis=require(_0x6b4b('0x11'));var authService=require(_0x6b4b('0x12'));var qs=require(_0x6b4b('0x13'));var as=require(_0x6b4b('0x14'));var pdf=require(_0x6b4b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b4b('0x16'))('api');var utils=require(_0x6b4b('0x17'));var config=require(_0x6b4b('0x18'));var licenseUtil=require(_0x6b4b('0x19'));var db=require(_0x6b4b('0x1a'))['db'];config[_0x6b4b('0x1b')]=_[_0x6b4b('0x1c')](config[_0x6b4b('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x6b4b('0x1d'))(new Redis(config[_0x6b4b('0x1b')]));require(_0x6b4b('0x1e'))['register'](socket);function respondWithStatusCode(_0x5ca0d8,_0x39390c){_0x39390c=_0x39390c||0xcc;return function(_0x2bf3fe){if(_0x2bf3fe){return _0x5ca0d8['sendStatus'](_0x39390c);}return _0x5ca0d8[_0x6b4b('0x1f')](_0x39390c)[_0x6b4b('0x20')]();};}function respondWithResult(_0x26ac10,_0x3954d9){_0x3954d9=_0x3954d9||0xc8;return function(_0x22a176){if(_0x22a176){return _0x26ac10[_0x6b4b('0x1f')](_0x3954d9)[_0x6b4b('0x21')](_0x22a176);}};}function respondWithFilteredResult(_0xc3e02c,_0x15333b){return function(_0x5308da){if(_0x5308da){var _0x5a1afc=typeof _0x15333b[_0x6b4b('0x22')]==='undefined'&&typeof _0x15333b[_0x6b4b('0x23')]===_0x6b4b('0x24');var _0x475072=_0x5308da[_0x6b4b('0x25')];var _0x4d52c2=_0x5a1afc?0x0:_0x15333b[_0x6b4b('0x22')];var _0x6235eb=_0x5a1afc?_0x5308da['count']:_0x15333b['offset']+_0x15333b['limit'];var _0x4735eb;if(_0x6235eb>=_0x475072){_0x6235eb=_0x475072;_0x4735eb=0xc8;}else{_0x4735eb=0xce;}_0xc3e02c[_0x6b4b('0x1f')](_0x4735eb);return _0xc3e02c[_0x6b4b('0x26')](_0x6b4b('0x27'),_0x4d52c2+'-'+_0x6235eb+'/'+_0x475072)[_0x6b4b('0x21')](_0x5308da);}return null;};}function patchUpdates(_0x5e7ad1){return function(_0x1313cf){try{jsonpatch[_0x6b4b('0x28')](_0x1313cf,_0x5e7ad1,!![]);}catch(_0x3a0376){return BPromise[_0x6b4b('0x29')](_0x3a0376);}return _0x1313cf['save']();};}function saveUpdates(_0x571920,_0x524ac4){return function(_0x4c4ecc){if(_0x4c4ecc){return _0x4c4ecc[_0x6b4b('0x2a')](_0x571920)['then'](function(_0x5df887){return _0x5df887;});}return null;};}function removeEntity(_0x24e78a,_0x2cbe79){return function(_0x46580b){if(_0x46580b){return _0x46580b[_0x6b4b('0x2b')]()['then'](function(){_0x24e78a['status'](0xcc)[_0x6b4b('0x20')]();});}};}function handleEntityNotFound(_0x3ce6b8,_0x2973f){return function(_0x17a0c1){if(!_0x17a0c1){_0x3ce6b8['sendStatus'](0x194);}return _0x17a0c1;};}function handleError(_0x364b29,_0x5e6096){_0x5e6096=_0x5e6096||0x1f4;return function(_0x1c2f42){logger[_0x6b4b('0x2c')](_0x1c2f42[_0x6b4b('0x2d')]);if(_0x1c2f42['name']){delete _0x1c2f42[_0x6b4b('0x2e')];}_0x364b29[_0x6b4b('0x1f')](_0x5e6096)[_0x6b4b('0x2f')](_0x1c2f42);};}function getInteractionUsers(_0x1681ee,_0x102305){return new BPromise(function(_0x1ab7de,_0x4bea7a){try{if(_0x102305[_0x1681ee['id']]){_0x1681ee['Users']=_['map'](_0x102305[_0x1681ee['id']],function(_0x139be){return{'id':_0x139be['id'],'fullname':_0x139be[_0x6b4b('0x30')]};});}}catch(_0x319b4e){_0x4bea7a(_0x319b4e);}_0x1ab7de(_0x1681ee);});}function getInteractionTags(_0x467446,_0x3eb067){return new BPromise(function(_0x44788f,_0x50d8c3){try{if(_0x467446['TagIds']){_0x467446['Tags']=[];_0x467446[_0x6b4b('0x31')]['split'](',')[_0x6b4b('0x32')](function(_0x4e4bc3){_0x467446['Tags']['push'](_0x3eb067[_0x4e4bc3]);});}delete _0x467446[_0x6b4b('0x31')];}catch(_0x3a59e6){_0x50d8c3(_0x3a59e6);}_0x44788f(_0x467446);});}function updateWhatsappInteraction(_0x2cb4ff,_0x39d2aa,_0x20d81a){return new BPromise(function(_0x59015c,_0x201492){return getInteractionUsers(_0x2cb4ff,_0x20d81a)['then'](function(_0x5b0252){return getInteractionTags(_0x5b0252,_0x39d2aa);})['then'](function(_0x4b5601){return getStateInteraction(_0x4b5601);})[_0x6b4b('0x33')](function(_0x4254a4){_0x59015c(_0x4254a4);})['catch'](function(_0x273521){_0x201492(_0x273521);});});}function getStateInteraction(_0x14b8d7){return new BPromise(function(_0x3eec2b){_0x14b8d7['waiting']=0x0;_0x14b8d7['talking']=0x0;_0x14b8d7[_0x6b4b('0x34')]=0x0;_0x14b8d7[_0x6b4b('0x35')]=0x0;_0x14b8d7[_0x6b4b('0x36')]=0x0;if(!_0x14b8d7[_0x6b4b('0x37')]&&!_0x14b8d7[_0x6b4b('0x38')]){_0x14b8d7[_0x6b4b('0x39')]+=0x1;}if(!_0x14b8d7['closed']&&_0x14b8d7[_0x6b4b('0x38')]){_0x14b8d7['talking']+=0x1;if(_0x14b8d7[_0x6b4b('0x39')]){_0x14b8d7[_0x6b4b('0x39')]-=0x1;}}if(_0x14b8d7['closed']&&_0x14b8d7['UserId']){_0x14b8d7['answered']+=0x1;if(_0x14b8d7[_0x6b4b('0x3a')]){_0x14b8d7[_0x6b4b('0x3a')]-=0x1;}}if(_0x14b8d7[_0x6b4b('0x37')]&&!_0x14b8d7[_0x6b4b('0x38')]){_0x14b8d7[_0x6b4b('0x35')]+=0x1;if(_0x14b8d7[_0x6b4b('0x39')]){_0x14b8d7[_0x6b4b('0x39')]-=0x1;}}_0x14b8d7[_0x6b4b('0x36')]+=0x1;_0x3eec2b(_0x14b8d7);});}exports[_0x6b4b('0x3b')]=function(_0x47bd53,_0x21a3ae){var _0x32b632={},_0x5d6612={},_0x5ead0d={'count':0x0,'rows':[]};var _0x4213e7=_[_0x6b4b('0x3c')](db[_0x6b4b('0x3d')][_0x6b4b('0x3e')],function(_0x11dfed){return{'name':_0x11dfed[_0x6b4b('0x3f')],'type':_0x11dfed['type']['key']};});_0x5d6612[_0x6b4b('0x40')]=_[_0x6b4b('0x3c')](_0x4213e7,_0x6b4b('0x2e'));_0x5d6612[_0x6b4b('0x41')]=_[_0x6b4b('0x42')](_0x47bd53[_0x6b4b('0x41')]);_0x5d6612['filters']=_[_0x6b4b('0x43')](_0x5d6612[_0x6b4b('0x40')],_0x5d6612[_0x6b4b('0x41')]);_0x32b632[_0x6b4b('0x44')]=_[_0x6b4b('0x43')](_0x5d6612[_0x6b4b('0x40')],qs[_0x6b4b('0x45')](_0x47bd53[_0x6b4b('0x41')]['fields']));_0x32b632[_0x6b4b('0x44')]=_0x32b632[_0x6b4b('0x44')][_0x6b4b('0x46')]?_0x32b632['attributes']:_0x5d6612['model'];if(!_0x47bd53[_0x6b4b('0x41')][_0x6b4b('0x47')](_0x6b4b('0x48'))){_0x32b632['limit']=qs[_0x6b4b('0x23')](_0x47bd53['query'][_0x6b4b('0x23')]);_0x32b632[_0x6b4b('0x22')]=qs['offset'](_0x47bd53[_0x6b4b('0x41')]['offset']);}_0x32b632[_0x6b4b('0x49')]=qs['sort'](_0x47bd53['query'][_0x6b4b('0x4a')]);_0x32b632[_0x6b4b('0x4b')]=qs[_0x6b4b('0x4c')](_[_0x6b4b('0x4d')](_0x47bd53['query'],_0x5d6612[_0x6b4b('0x4c')]),_0x4213e7);var _0x136785=[];var _0x2f58d3=squel['select']()['field']('id')[_0x6b4b('0x4e')]('name')['field'](_0x6b4b('0x4f'))[_0x6b4b('0x50')](_0x6b4b('0x51'));var _0x1543ab=squel['select']()[_0x6b4b('0x4e')](_0x6b4b('0x52'))[_0x6b4b('0x4e')](_0x6b4b('0x53'))[_0x6b4b('0x4e')](_0x6b4b('0x54'))[_0x6b4b('0x50')](_0x6b4b('0x55'),'ui')[_0x6b4b('0x56')](_0x6b4b('0x57'),'u',_0x6b4b('0x58'));var _0x243595=squel['select']()[_0x6b4b('0x50')](_0x6b4b('0x59'),'i')['left_join']('cm_contacts','c',_0x6b4b('0x5a'))[_0x6b4b('0x56')](_0x6b4b('0x57'),'o',_0x6b4b('0x5b'))[_0x6b4b('0x56')](_0x6b4b('0x5c'),'a',_0x6b4b('0x5d'))[_0x6b4b('0x56')]('whatsapp_messages','me',_0x6b4b('0x5e'))['left_join'](_0x6b4b('0x5f'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x6b4b('0x56')]('tools_tags','t',_0x6b4b('0x60'));var _0x4bf6cb=squel[_0x6b4b('0x61')]();var _0x28ccca=[];var _0x3b45aa=squel[_0x6b4b('0x61')]();var _0x21d9cd;if(_0x47bd53[_0x6b4b('0x41')][_0x6b4b('0x62')]){_0x21d9cd=as['parseSearch'](_0x47bd53[_0x6b4b('0x41')]['search']);var _0x475b3e=_0x21d9cd[_0x6b4b('0x63')];for(var _0x234194=0x0;_0x234194<_0x21d9cd['conditions'][_0x6b4b('0x46')];_0x234194++){var _0x4dc4b7=_0x21d9cd[_0x6b4b('0x64')][_0x234194];var _0x23446b='i';var _0x27675e=_[_0x6b4b('0x65')](_0x4213e7,['name',_0x4dc4b7['field']]);if(!_0x27675e){switch(_0x4dc4b7[_0x6b4b('0x4e')]){case'unreadMessages':if(_0x4dc4b7[_0x6b4b('0x66')]==0x1){_0x243595[_0x6b4b('0x67')]('`'+_0x4dc4b7['field']+_0x6b4b('0x68'));}else{_0x243595[_0x6b4b('0x67')]('`'+_0x4dc4b7[_0x6b4b('0x4e')]+'`\x20>\x200');}break;case'Contact':if(_0x4dc4b7['operator']===_0x6b4b('0x69')){if(_0x4dc4b7[_0x6b4b('0x66')][_0x6b4b('0x6a')]('\x20')[_0x6b4b('0x46')]>0x1){_0x4bf6cb[_0x475b3e]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6b4b('0x6b')](_0x4dc4b7[_0x6b4b('0x66')]),null);}else{var _0x301731='%'+_0x4dc4b7['value']+'%';_0x4bf6cb[_0x475b3e](_0x6b4b('0x6c'),_0x301731,_0x301731,_0x301731);}}else{_0x27675e=_['find'](_0x4213e7,[_0x6b4b('0x2e'),_0x6b4b('0x6d')]);_0x4dc4b7['field']=_0x6b4b('0x6d');_0x157138=as[_0x6b4b('0x6e')](_0x23446b,_0x27675e[_0x6b4b('0x6f')],_0x4dc4b7);_0x4bf6cb[_0x475b3e](_0x157138[_0x6b4b('0x70')],_0x157138[_0x6b4b('0x66')][_0x6b4b('0x71')],_0x157138['value']['end']);}break;case _0x6b4b('0x72'):var _0x141a2f=_0x4dc4b7[_0x6b4b('0x66')][_0x6b4b('0x6a')](',')[_0x6b4b('0x3c')](function(_0x785d7e){return Number(_0x785d7e);});_0x141a2f[_0x6b4b('0x32')](function(_0x5dbe32){_0x3b45aa['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5dbe32+',%');});_0x28ccca=_[_0x6b4b('0x73')](_0x28ccca,_0x141a2f);break;case'User':if(_0x4dc4b7[_0x6b4b('0x74')]===_0x6b4b('0x69')){_0x4bf6cb[_0x475b3e](_0x6b4b('0x75'),'%'+_0x4dc4b7[_0x6b4b('0x66')]+'%',null);}else{_0x27675e=_['find'](_0x4213e7,[_0x6b4b('0x2e'),_0x6b4b('0x38')]);_0x4dc4b7['field']=_0x6b4b('0x38');_0x157138=as['buildExpression'](_0x23446b,_0x27675e[_0x6b4b('0x6f')],_0x4dc4b7);_0x4bf6cb[_0x475b3e](_0x157138[_0x6b4b('0x70')],_0x157138[_0x6b4b('0x66')]['start'],_0x157138[_0x6b4b('0x66')][_0x6b4b('0x20')]);}break;case _0x6b4b('0x76'):_0x157138=as[_0x6b4b('0x6e')]('me',null,_0x4dc4b7);_0x4bf6cb[_0x475b3e](_0x157138[_0x6b4b('0x70')],_0x157138[_0x6b4b('0x66')][_0x6b4b('0x71')],_0x157138['value']['end']);break;}}else{var _0x157138=as[_0x6b4b('0x6e')](_0x23446b,_0x27675e[_0x6b4b('0x6f')],_0x4dc4b7);_0x4bf6cb[_0x475b3e](_0x157138[_0x6b4b('0x70')],_0x157138[_0x6b4b('0x66')][_0x6b4b('0x71')],_0x157138[_0x6b4b('0x66')][_0x6b4b('0x20')]);}}}else{var _0x157f4c=_(_0x47bd53['query'])[_0x6b4b('0x42')]()['map'](function(_0x3492cd){return _[_0x6b4b('0x77')](_0x4213e7,['name',_0x3492cd])?_0x3492cd:undefined;})[_0x6b4b('0x78')]()[_0x6b4b('0x66')]();if(!_[_0x6b4b('0x79')](_0x157f4c)){_0x157f4c['forEach'](function(_0x46f680){if(_0x46f680==='WhatsappAccountId'){_0x243595[_0x6b4b('0x4b')](_0x6b4b('0x7a'),[][_0x6b4b('0x7b')](_0x47bd53[_0x6b4b('0x41')][_0x46f680]));}else if(_0x46f680==='createdAt'){var _0x1bb0a6=JSON[_0x6b4b('0x7c')](_0x47bd53[_0x6b4b('0x41')][_0x46f680])['$gte'];var _0x461da9=JSON['parse'](_0x47bd53['query'][_0x46f680])[_0x6b4b('0x7d')];_0x243595[_0x6b4b('0x4b')](_0x6b4b('0x7e'),_0x1bb0a6,_0x461da9);}else{if(_0x47bd53[_0x6b4b('0x41')][_0x46f680]===_0x6b4b('0x7f')){_0x243595[_0x6b4b('0x4b')]('i.'+_0x46f680+_0x6b4b('0x80'));}else{_0x243595[_0x6b4b('0x4b')]('i.'+_0x46f680+_0x6b4b('0x81'),_0x47bd53['query'][_0x46f680]);}}});}if(_0x47bd53['query'][_0x6b4b('0x82')]){if(_0x47bd53[_0x6b4b('0x41')][_0x6b4b('0x82')]==0x1){_0x243595[_0x6b4b('0x67')](_0x6b4b('0x83'));}else{_0x243595[_0x6b4b('0x67')](_0x6b4b('0x84'));}}if(_0x47bd53[_0x6b4b('0x41')][_0x6b4b('0x85')]){_0x28ccca=_['isArray'](_0x47bd53[_0x6b4b('0x41')][_0x6b4b('0x85')])?_0x47bd53[_0x6b4b('0x41')][_0x6b4b('0x85')]:new Array(_0x47bd53[_0x6b4b('0x41')][_0x6b4b('0x85')]);_0x28ccca[_0x6b4b('0x32')](function(_0x49b801){_0x3b45aa['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x49b801+',%');});}if(_0x47bd53[_0x6b4b('0x41')][_0x6b4b('0x86')]){var _0x77d039=_0x47bd53['query'][_0x6b4b('0x86')][_0x6b4b('0x87')]('\x5c','\x5c\x5c')[_0x6b4b('0x87')](/'/g,'\x27\x27');if(qs[_0x6b4b('0x88')](_0x77d039)){_0x4bf6cb['or'](_0x6b4b('0x89'),_0x77d039+'%')['or'](_0x6b4b('0x8a'),_0x77d039+'%');}else{_0x4bf6cb['or'](_0x6b4b('0x8b'),qs[_0x6b4b('0x6b')](_0x77d039))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x77d039+'%');}}}_0x243595[_0x6b4b('0x4b')](_0x4bf6cb);_0x243595[_0x6b4b('0x8c')]('i.id');var _0x2ee826={'type':db['Sequelize'][_0x6b4b('0x8d')][_0x6b4b('0x8e')],'raw':!![]};var _0x2c5d7b=_0x243595[_0x6b4b('0x8f')]();_0x2c5d7b[_0x6b4b('0x4e')]('i.id');_0x2c5d7b['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x6b4b('0x90'));if(_0x32b632[_0x6b4b('0x49')]){_0x32b632['order'][_0x6b4b('0x32')](function(_0x487a35){var _0x1ee2f3=_0x487a35[0x0]===_0x6b4b('0x91')?_0x487a35[0x0]:'i.'+_0x487a35[0x0];_0x243595[_0x6b4b('0x49')](_0x1ee2f3,_0x487a35[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x28ccca)){_0x243595[_0x6b4b('0x67')](_0x3b45aa);_0x2c5d7b[_0x6b4b('0x4b')](_0x6b4b('0x92'),_0x28ccca);}BPromise[_0x6b4b('0x93')]()[_0x6b4b('0x33')](function(){if(!_0x21d9cd){if(_0x47bd53['query'][_0x6b4b('0x94')])return;_0x2c5d7b[_0x6b4b('0x4b')](_0x6b4b('0x95'));_0x243595[_0x6b4b('0x4b')](_0x6b4b('0x95'));return;}if(_0x47bd53[_0x6b4b('0x96')]['role']!==_0x6b4b('0x97'))return;return _0x47bd53['user'][_0x6b4b('0x98')]({'attributes':['id'],'raw':!![]})['then'](function(_0x59dd52){if(_[_0x6b4b('0x79')](_0x59dd52)){_0x2c5d7b['where'](_0x6b4b('0x99'));_0x243595['where'](_0x6b4b('0x99'));}else{_0x2c5d7b[_0x6b4b('0x4b')](_0x6b4b('0x7a'),_[_0x6b4b('0x3c')](_0x59dd52,'id'));_0x243595['where'](_0x6b4b('0x7a'),_[_0x6b4b('0x3c')](_0x59dd52,'id'));}});})[_0x6b4b('0x33')](function(){if(_0x47bd53[_0x6b4b('0x96')][_0x6b4b('0x9a')]===_0x6b4b('0x97')&&!_0x21d9cd&&!_0x47bd53[_0x6b4b('0x41')]['WhatsappAccountId'])return[];return db['sequelize'][_0x6b4b('0x41')](_0x2c5d7b['toString'](),_0x2ee826);})[_0x6b4b('0x33')](function(_0x57b154){_0x5ead0d['count']=_0x57b154['length'];if(_0x5ead0d[_0x6b4b('0x25')]===0x0)return[];return db[_0x6b4b('0x9b')][_0x6b4b('0x41')](_0x2f58d3[_0x6b4b('0x9c')](),_0x2ee826)[_0x6b4b('0x33')](function(_0x4e0cda){_0x136785=_[_0x6b4b('0x9d')](_0x4e0cda,'id');_0x2ee826=_['merge'](_0x2ee826,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x47bd53[_0x6b4b('0x41')][_0x6b4b('0x45')]){_0x32b632[_0x6b4b('0x44')][_0x6b4b('0x32')](function(_0x5dfb12){_0x243595['field']('i.'+_0x5dfb12);});}else{_0x243595[_0x6b4b('0x4e')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x6b4b('0x90'));_0x243595['field'](_0x6b4b('0x9e'),'Account.key');_0x243595[_0x6b4b('0x4e')](_0x6b4b('0x9f'),_0x6b4b('0xa0'));_0x243595['field'](_0x6b4b('0xa1'),_0x6b4b('0x91'));_0x243595['field'](_0x6b4b('0xa2'));_0x243595['field'](_0x6b4b('0xa3'),_0x6b4b('0xa4'));_0x243595[_0x6b4b('0x4e')](_0x6b4b('0xa5'),_0x6b4b('0xa6'));_0x243595[_0x6b4b('0x4e')]('c.email',_0x6b4b('0xa7'));_0x243595['field'](_0x6b4b('0xa8'),_0x6b4b('0xa9'));_0x243595[_0x6b4b('0x4e')](_0x6b4b('0xaa'),_0x6b4b('0xab'));_0x243595[_0x6b4b('0x4e')](_0x6b4b('0xac'),'Contact.fax');_0x243595['field'](_0x6b4b('0xad'),_0x6b4b('0xae'));_0x243595[_0x6b4b('0x4e')](_0x6b4b('0xaf'),_0x6b4b('0xb0'));_0x243595[_0x6b4b('0x4e')](_0x6b4b('0xb1'),_0x6b4b('0x31'));}if(_0x32b632[_0x6b4b('0x23')])_0x243595[_0x6b4b('0x23')](_0x32b632[_0x6b4b('0x23')]);if(_0x32b632[_0x6b4b('0x22')])_0x243595[_0x6b4b('0x22')](_0x32b632[_0x6b4b('0x22')]);return db[_0x6b4b('0x9b')][_0x6b4b('0x41')](_0x243595[_0x6b4b('0x9c')](),_0x2ee826);})['then'](function(_0x222188){if(_0x222188[_0x6b4b('0x46')]>0x0)_0x1543ab[_0x6b4b('0x4b')](_0x6b4b('0xb2'),_[_0x6b4b('0x3c')](_0x222188,'id'));return db['sequelize'][_0x6b4b('0x41')](_0x1543ab['toString'](),_0x2ee826)[_0x6b4b('0x33')](function(_0x57bdf3){var _0x45db83=_[_0x6b4b('0xb3')](_0x57bdf3,_0x6b4b('0xb4'));var _0xb4cd5e=[];_0x222188[_0x6b4b('0x32')](function(_0x3dc1b0){_0xb4cd5e['push'](updateWhatsappInteraction(_0x3dc1b0,_0x136785,_0x45db83));});return BPromise[_0x6b4b('0xb5')](_0xb4cd5e);});});})[_0x6b4b('0x33')](function(_0x38ea2f){_0x5ead0d[_0x6b4b('0xb6')]=_0x38ea2f;return _0x5ead0d;})[_0x6b4b('0x33')](respondWithFilteredResult(_0x21a3ae,_0x32b632))[_0x6b4b('0xb7')](handleError(_0x21a3ae,null));};exports[_0x6b4b('0xb8')]=function(_0x55f3fa,_0x1730a3){var _0x20fdf3={'raw':![],'where':{'id':_0x55f3fa[_0x6b4b('0xb9')]['id']}},_0x157b0c={};_0x157b0c[_0x6b4b('0x40')]=_['keys'](db['WhatsappInteraction']['rawAttributes']);_0x157b0c[_0x6b4b('0x41')]=_[_0x6b4b('0x42')](_0x55f3fa[_0x6b4b('0x41')]);_0x157b0c[_0x6b4b('0x4c')]=_[_0x6b4b('0x43')](_0x157b0c[_0x6b4b('0x40')],_0x157b0c[_0x6b4b('0x41')]);_0x20fdf3[_0x6b4b('0x44')]=_[_0x6b4b('0x43')](_0x157b0c[_0x6b4b('0x40')],qs['fields'](_0x55f3fa[_0x6b4b('0x41')][_0x6b4b('0x45')]));_0x20fdf3[_0x6b4b('0x44')]=_0x20fdf3[_0x6b4b('0x44')][_0x6b4b('0x46')]?_0x20fdf3[_0x6b4b('0x44')]:_0x157b0c[_0x6b4b('0x40')];if(_0x55f3fa['query'][_0x6b4b('0xba')]){_0x20fdf3[_0x6b4b('0xbb')]=[{'all':!![]}];}_0x20fdf3=_[_0x6b4b('0xbc')]({},_0x20fdf3,_0x55f3fa[_0x6b4b('0xbd')]);return db[_0x6b4b('0x3d')][_0x6b4b('0x65')](_0x20fdf3)[_0x6b4b('0x33')](handleEntityNotFound(_0x1730a3,null))['then'](respondWithResult(_0x1730a3,null))[_0x6b4b('0xb7')](handleError(_0x1730a3,null));};exports[_0x6b4b('0xbe')]=function(_0x4eec20,_0x241d59){return db[_0x6b4b('0x3d')][_0x6b4b('0xbe')](_0x4eec20['body'],{})['then'](respondWithResult(_0x241d59,0xc9))[_0x6b4b('0xb7')](handleError(_0x241d59,null));};exports[_0x6b4b('0x2a')]=function(_0x392cef,_0x406854){if(_0x392cef[_0x6b4b('0x76')]['id']){delete _0x392cef[_0x6b4b('0x76')]['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0x392cef[_0x6b4b('0xb9')]['id']}})['then'](handleEntityNotFound(_0x406854,null))['then'](saveUpdates(_0x392cef[_0x6b4b('0x76')],null))[_0x6b4b('0x33')](respondWithResult(_0x406854,null))[_0x6b4b('0xb7')](handleError(_0x406854,null));};exports[_0x6b4b('0x2b')]=function(_0x12e975,_0x20bdbe){return db[_0x6b4b('0x3d')][_0x6b4b('0x65')]({'where':{'id':_0x12e975[_0x6b4b('0xb9')]['id']}})[_0x6b4b('0x33')](handleEntityNotFound(_0x20bdbe,null))[_0x6b4b('0x33')](removeEntity(_0x20bdbe,null))[_0x6b4b('0xb7')](handleError(_0x20bdbe,null));};exports[_0x6b4b('0xbf')]=function(_0x4d620f,_0x195eb8){return db[_0x6b4b('0x3d')][_0x6b4b('0xbf')]()[_0x6b4b('0x33')](respondWithResult(_0x195eb8,null))[_0x6b4b('0xb7')](handleError(_0x195eb8,null));};exports[_0x6b4b('0xc0')]=function(_0x26263d,_0x430df7,_0x593556){return db[_0x6b4b('0xc1')][_0x6b4b('0x65')]({'where':{'id':_0x26263d['params']['id']}})['then'](handleEntityNotFound(_0x430df7,null))[_0x6b4b('0x33')](function(_0x4fa981){if(_0x4fa981){return _0x4fa981[_0x6b4b('0xc0')](_0x26263d[_0x6b4b('0x76')]['ids'],_[_0x6b4b('0xc2')](_0x26263d[_0x6b4b('0x76')],[_0x6b4b('0xc3'),'id'])||{});}})[_0x6b4b('0x33')](respondWithResult(_0x430df7,null))[_0x6b4b('0xb7')](handleError(_0x430df7,null));};exports[_0x6b4b('0xc4')]=function(_0x3f2f1d,_0x22c234,_0x150be0){var _0x5c3be2={'raw':![],'where':{}};var _0x11be47={};var _0x2bf128={'count':0x0,'rows':[]};return db[_0x6b4b('0x3d')]['findOne']({'where':{'id':_0x3f2f1d[_0x6b4b('0xb9')]['id']}})[_0x6b4b('0x33')](handleEntityNotFound(_0x22c234,null))[_0x6b4b('0x33')](function(_0x177b66){if(_0x177b66){_0x11be47['model']=_[_0x6b4b('0x42')](db[_0x6b4b('0xc1')][_0x6b4b('0x3e')]);_0x11be47[_0x6b4b('0x41')]=_[_0x6b4b('0x42')](_0x3f2f1d['query']);_0x11be47['filters']=_[_0x6b4b('0x43')](_0x11be47['model'],_0x11be47[_0x6b4b('0x41')]);_0x5c3be2[_0x6b4b('0x44')]=_[_0x6b4b('0x43')](_0x11be47['model'],qs['fields'](_0x3f2f1d[_0x6b4b('0x41')][_0x6b4b('0x45')]));_0x5c3be2[_0x6b4b('0x44')]=_0x5c3be2[_0x6b4b('0x44')]['length']?_0x5c3be2[_0x6b4b('0x44')]:_0x11be47['model'];if(!_0x3f2f1d['query'][_0x6b4b('0x47')](_0x6b4b('0x48'))){_0x5c3be2[_0x6b4b('0x23')]=qs[_0x6b4b('0x23')](_0x3f2f1d[_0x6b4b('0x41')][_0x6b4b('0x23')]);_0x5c3be2['offset']=qs[_0x6b4b('0x22')](_0x3f2f1d[_0x6b4b('0x41')]['offset']);}_0x5c3be2[_0x6b4b('0x49')]=qs['sort'](_0x3f2f1d[_0x6b4b('0x41')][_0x6b4b('0x4a')]);_0x5c3be2['where']=qs['filters'](_[_0x6b4b('0x4d')](_0x3f2f1d[_0x6b4b('0x41')],_0x11be47[_0x6b4b('0x4c')]));_0x5c3be2['where'][_0x6b4b('0xb4')]=_0x177b66['id'];if(_0x3f2f1d['query'][_0x6b4b('0x86')]){_0x5c3be2[_0x6b4b('0x4b')]=_[_0x6b4b('0xbc')](_0x5c3be2['where'],{'$or':_[_0x6b4b('0x3c')](_0x5c3be2[_0x6b4b('0x44')],function(_0x103cf7){var _0x152121={};_0x152121[_0x103cf7]={'$like':'%'+_0x3f2f1d[_0x6b4b('0x41')][_0x6b4b('0x86')]+'%'};return _0x152121;})});}if(_0x3f2f1d[_0x6b4b('0x41')][_0x6b4b('0xc5')]){var _0x562219=_0x3f2f1d[_0x6b4b('0x41')][_0x6b4b('0xc5')][_0x6b4b('0x6a')](',');var _0x479680={};_0x479680[_0x562219[0x0]]={'$gte':moment(_0x562219[0x1])[_0x6b4b('0xc6')](_0x6b4b('0xc7'))};_0x5c3be2[_0x6b4b('0x4b')]=_[_0x6b4b('0xbc')](_0x5c3be2[_0x6b4b('0x4b')],_0x479680);}_0x5c3be2=_['merge']({},_0x5c3be2,_0x3f2f1d['options']);return db['WhatsappMessage']['count']({'where':_0x5c3be2['where']})[_0x6b4b('0x33')](function(_0x529974){_0x2bf128[_0x6b4b('0x25')]=_0x529974;if(_0x3f2f1d['query'][_0x6b4b('0xba')]){_0x5c3be2[_0x6b4b('0xbb')]=[{'all':!![]}];}return db[_0x6b4b('0xc1')][_0x6b4b('0xc8')](_0x5c3be2);})['then'](function(_0x5061f9){_0x2bf128['rows']=_0x5061f9;return _0x2bf128;});}})['then'](respondWithFilteredResult(_0x22c234,_0x5c3be2))[_0x6b4b('0xb7')](handleError(_0x22c234,null));};exports[_0x6b4b('0xc9')]=function(_0x345926,_0x39b588,_0x3c527b){return db[_0x6b4b('0x3d')][_0x6b4b('0x65')]({'where':{'id':_0x345926[_0x6b4b('0xb9')]['id']}})[_0x6b4b('0x33')](handleEntityNotFound(_0x39b588,null))[_0x6b4b('0x33')](function(_0x23de56){if(_0x23de56){return _0x23de56[_0x6b4b('0xca')](_0x345926[_0x6b4b('0x76')][_0x6b4b('0xc3')],_[_0x6b4b('0xc2')](_0x345926[_0x6b4b('0x76')],[_0x6b4b('0xc3'),'id'])||{})[_0x6b4b('0xcb')](function(){return db[_0x6b4b('0x72')][_0x6b4b('0xc8')]({'attributes':['id','name',_0x6b4b('0x4f')],'where':{'id':_0x345926['body'][_0x6b4b('0xc3')]}});})[_0x6b4b('0x33')](function(_0x36db91){socket['emit'](_0x6b4b('0xcc'),{'id':Number(_0x345926['params']['id']),'tags':_0x36db91||[]});return{'id':Number(_0x345926[_0x6b4b('0xb9')]['id']),'tags':_0x36db91||[]};});}})[_0x6b4b('0x33')](respondWithResult(_0x39b588,null))[_0x6b4b('0xb7')](handleError(_0x39b588,null));};exports[_0x6b4b('0xcd')]=function(_0x19413f,_0x47385f,_0x5aa5fe){return db[_0x6b4b('0x3d')]['find']({'where':{'id':_0x19413f['params']['id']}})[_0x6b4b('0x33')](handleEntityNotFound(_0x47385f,null))[_0x6b4b('0x33')](function(_0x3fad53){if(_0x3fad53){return _0x3fad53[_0x6b4b('0xcd')](_0x19413f[_0x6b4b('0x41')]['ids']);}})[_0x6b4b('0x33')](respondWithStatusCode(_0x47385f,null))[_0x6b4b('0xb7')](handleError(_0x47385f,null));};exports['download']=function(_0x4ab59c,_0x509b43){var _0x9c65c6=moment()[_0x6b4b('0xce')]()[_0x6b4b('0x9c')]();var _0x4eb402=path['join'](config[_0x6b4b('0xcf')],_0x6b4b('0xd0'),_0x6b4b('0xd1'),'tmp');var _0x5df743=path[_0x6b4b('0xd2')](config[_0x6b4b('0xcf')],_0x6b4b('0xd0'),_0x6b4b('0xd1'),'attachments');var _0x1d7646=path[_0x6b4b('0xd2')](_0x4eb402,_0x9c65c6);var _0x401456=util[_0x6b4b('0xc6')](_0x6b4b('0xd3'),_0x4ab59c[_0x6b4b('0xb9')]['id'],_0x9c65c6);var _0x44f3c6=path['join'](_0x4eb402,_0x401456);var _0x5cf51c=[];_0x5cf51c[_0x6b4b('0xd4')]({'model':db[_0x6b4b('0xd5')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x5cf51c[_0x6b4b('0xd4')]({'model':db['CmContact'],'as':_0x6b4b('0xd6'),'attributes':['id','firstName',_0x6b4b('0xd7')],'raw':!![]});if(_0x4ab59c[_0x6b4b('0x41')]['attachments']){_0x5cf51c[_0x6b4b('0xd4')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x56ecf4=[{'model':db[_0x6b4b('0xc1')],'as':_0x6b4b('0xd8'),'attributes':['id','body',_0x6b4b('0xd9'),_0x6b4b('0xda'),'secret',_0x6b4b('0x82')],'include':_0x5cf51c}];_0x56ecf4[_0x6b4b('0xd4')]({'model':db[_0x6b4b('0xdb')],'as':'Account','attributes':['id',_0x6b4b('0x2e')]});_0x56ecf4[_0x6b4b('0xd4')]({'model':db[_0x6b4b('0xd5')],'as':_0x6b4b('0xdc'),'attributes':['id',_0x6b4b('0x30')]});return db[_0x6b4b('0x3d')]['find']({'where':{'id':_0x4ab59c[_0x6b4b('0xb9')]['id']},'include':_0x56ecf4})[_0x6b4b('0x33')](handleEntityNotFound(_0x509b43,null))[_0x6b4b('0x33')](function(_0x5eaa58){if(_0x5eaa58){var _0x3a9029=_0x5eaa58['get']({'plain':!![]});fs[_0x6b4b('0xdd')](_0x1d7646);var _0x5bda32={'channel':_0x6b4b('0xde'),'account':_0x3a9029[_0x6b4b('0xdf')][_0x6b4b('0x2e')],'agent':_0x3a9029[_0x6b4b('0xdc')]?_0x3a9029['Owner']['fullname']:_0x6b4b('0xe0'),'createdAt':moment(_0x3a9029[_0x6b4b('0xd9')])[_0x6b4b('0xc6')](_0x6b4b('0xc7'))[_0x6b4b('0x9c')](),'closedAt':_0x3a9029[_0x6b4b('0x37')]?moment(_0x3a9029[_0x6b4b('0xe1')])['format'](_0x6b4b('0xc7'))['toString']():'','disposition':_0x3a9029[_0x6b4b('0xe2')],'messages':_(_0x3a9029['Messages'])[_0x6b4b('0x86')]({'secret':![]})[_0x6b4b('0x3c')](function(_0x4c37db){if(_0x4c37db[_0x6b4b('0xe3')]){var _0x529758=path[_0x6b4b('0xd2')](_0x5df743,_0x4c37db[_0x6b4b('0xe3')][_0x6b4b('0xe4')]);if(fs['existsSync'](_0x529758)){fs[_0x6b4b('0xe5')](_0x529758)[_0x6b4b('0xe6')](fs[_0x6b4b('0xe7')](path[_0x6b4b('0xd2')](_0x1d7646,_0x4c37db[_0x6b4b('0xe3')][_0x6b4b('0xe4')])));}}return{'date':moment(_0x4c37db[_0x6b4b('0xd9')])[_0x6b4b('0xc6')](_0x6b4b('0xc7'))[_0x6b4b('0x9c')](),'sender':_0x4c37db[_0x6b4b('0xda')]==='out'?_0x4c37db[_0x6b4b('0xd5')]?_0x4c37db[_0x6b4b('0xd5')][_0x6b4b('0x30')]:_0x6b4b('0xe8'):_0x4c37db[_0x6b4b('0xd6')]['firstName']+(_0x4c37db[_0x6b4b('0xd6')]['lastName']?'\x20'+_0x4c37db[_0x6b4b('0xd6')]['lastName']:''),'body':_0x4c37db[_0x6b4b('0xe3')]?_0x4c37db[_0x6b4b('0xe3')][_0x6b4b('0xe4')]:_0x4c37db[_0x6b4b('0x76')],'direction':_0x4c37db[_0x6b4b('0xda')]===_0x6b4b('0xe9')?'A':'C','secret':_0x4c37db[_0x6b4b('0xea')],'read':_0x4c37db[_0x6b4b('0x82')],'attachment':_0x4c37db[_0x6b4b('0xe3')]};})[_0x6b4b('0x66')]()};return ejs['renderFile'](path[_0x6b4b('0xd2')](config[_0x6b4b('0xcf')],_0x6b4b('0xd0'),_0x6b4b('0xeb'),_0x6b4b('0xec')),{'interaction':_0x5bda32})['then'](function(_0x5758fa){var _0x5b462d=path[_0x6b4b('0xd2')](_0x1d7646,_0x6b4b('0xed')+_0x3a9029['id']+'-'+_0x9c65c6+'.pdf');var _0x15c483={'path':_0x5b462d,'channel':_0x6b4b('0xde'),'interactionId':_0x3a9029['id']};return pdf[_0x6b4b('0xee')](_0x5758fa,_0x15c483);})[_0x6b4b('0x33')](function(){return new BPromise(function(_0x20c0eb,_0x55dcaf){zipdir(_0x1d7646,{'saveTo':_0x44f3c6},function(_0xf9fa46,_0x55430b){if(_0xf9fa46)return _0x55dcaf(_0xf9fa46);return _0x20c0eb(_0x55430b);});})[_0x6b4b('0x33')](function(){return new BPromise(function(_0x5ad72a,_0x5139e3){rimraf(_0x1d7646,function(_0x441cf1){if(_0x441cf1)_0x5139e3(_0x441cf1);return _0x5ad72a();});});})[_0x6b4b('0x33')](function(){return _0x509b43[_0x6b4b('0xef')](_0x44f3c6,_0x401456,function(_0x3fd816){if(_0x3fd816){console[_0x6b4b('0xf0')](_0x6b4b('0xf1'),_0x3fd816);}else{fs[_0x6b4b('0xf2')](_0x44f3c6);}});});});}else{return _0x509b43[_0x6b4b('0xf3')](0xc8);}})[_0x6b4b('0xb7')](handleError(_0x509b43,null));};
\ No newline at end of file
index 47c9935..1d2a106 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x063c=['getUsers','setDataValue','Users','map','findAll','then','unreadMessages','emit','hook','exports','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','remove'];(function(_0x5e3264,_0xd97bfc){var _0x46c2a6=function(_0x356bbb){while(--_0x356bbb){_0x5e3264['push'](_0x5e3264['shift']());}};_0x46c2a6(++_0xd97bfc);}(_0x063c,0xba));var _0xc063=function(_0x16ed4b,_0xaf236e){_0x16ed4b=_0x16ed4b-0x0;var _0x41eaa3=_0x063c[_0x16ed4b];return _0x41eaa3;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xc063('0x0'))['db'][_0xc063('0x1')];var WhatsappMessage=require(_0xc063('0x0'))['db'][_0xc063('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xc063('0x3')](0x0);var events={'afterCreate':_0xc063('0x4'),'afterUpdate':'update','afterDestroy':_0xc063('0x5')};function emitEvent(_0x5ec48e){return function(_0x590831,_0x59b81f,_0x182d20){_0x590831[_0xc063('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3dbe7c){_0x590831[_0xc063('0x7')](_0xc063('0x8'),_0x3dbe7c[_0xc063('0x9')](function(_0x4ac472){return{'id':_0x4ac472['id']};}));return WhatsappMessage[_0xc063('0xa')]({'where':{'WhatsappInteractionId':_0x590831['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc063('0xb')](function(_0x4e788f){_0x590831[_0xc063('0x7')](_0xc063('0xc'),_0x4e788f['length']);WhatsappInteractionEvents[_0xc063('0xd')](_0x5ec48e+':'+_0x590831['id'],_0x590831);WhatsappInteractionEvents['emit'](_0x5ec48e,_0x590831);_0x182d20(null);})['catch'](_0x182d20(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0xc063('0xe')](e,emitEvent(event));}}module[_0xc063('0xf')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0x0490=['findAll','unreadMessages','length','emit','catch','hook','exports','../../mysqldb','save','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x34c027,_0x123688){var _0x47bff0=function(_0x19c4a9){while(--_0x19c4a9){_0x34c027['push'](_0x34c027['shift']());}};_0x47bff0(++_0x123688);}(_0x0490,0x147));var _0x0049=function(_0x35c0ad,_0x4b5e6e){_0x35c0ad=_0x35c0ad-0x0;var _0x5ee84c=_0x0490[_0x35c0ad];return _0x5ee84c;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x0049('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0049('0x1'),'afterUpdate':_0x0049('0x2'),'afterDestroy':_0x0049('0x3')};function emitEvent(_0x1f3b3c){return function(_0x2872ec,_0x4a59b9,_0x2957b6){_0x2872ec[_0x0049('0x4')]({'attributes':['id'],'raw':!![]})[_0x0049('0x5')](function(_0x57fca5){_0x2872ec[_0x0049('0x6')](_0x0049('0x7'),_0x57fca5[_0x0049('0x8')](function(_0x58f233){return{'id':_0x58f233['id']};}));return WhatsappMessage[_0x0049('0x9')]({'where':{'WhatsappInteractionId':_0x2872ec['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0049('0x5')](function(_0x4165c2){_0x2872ec[_0x0049('0x6')](_0x0049('0xa'),_0x4165c2[_0x0049('0xb')]);WhatsappInteractionEvents[_0x0049('0xc')](_0x1f3b3c+':'+_0x2872ec['id'],_0x2872ec);WhatsappInteractionEvents[_0x0049('0xc')](_0x1f3b3c,_0x2872ec);_0x2957b6(null);})[_0x0049('0xd')](_0x2957b6(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x0049('0xe')](e,emitEvent(event));}}module[_0x0049('0xf')]=WhatsappInteractionEvents;
\ No newline at end of file
index 4c0c8f1..47310c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb3e=['exports','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes'];(function(_0x3fe90c,_0x231b20){var _0x12c302=function(_0x5f5cb6){while(--_0x5f5cb6){_0x3fe90c['push'](_0x3fe90c['shift']());}};_0x12c302(++_0x231b20);}(_0xfb3e,0x150));var _0xefb3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xfb3e[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xefb3('0x0'));var util=require(_0xefb3('0x1'));var logger=require('../../config/logger')(_0xefb3('0x2'));var moment=require(_0xefb3('0x3'));var BPromise=require(_0xefb3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xefb3('0x5'));var rimraf=require(_0xefb3('0x6'));var config=require(_0xefb3('0x7'));var attributes=require(_0xefb3('0x8'));module[_0xefb3('0x9')]=function(_0x2428b3,_0x5b76b4){return _0x2428b3['define']('WhatsappInteraction',attributes,{'tableName':_0xefb3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x41c3af,_0x3ceff5,_0x51a53c){if(_0x41c3af[_0xefb3('0xb')](_0xefb3('0xc'))){_0x41c3af['closedAt']=moment()[_0xefb3('0xd')](_0xefb3('0xe'));}_0x51a53c(null,_0x41c3af);}}});};
\ No newline at end of file
+var _0x91d3=['closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed'];(function(_0xd47441,_0x586a48){var _0x166a60=function(_0x470410){while(--_0x470410){_0xd47441['push'](_0xd47441['shift']());}};_0x166a60(++_0x586a48);}(_0x91d3,0x113));var _0x391d=function(_0x1ec191,_0x326fdd){_0x1ec191=_0x1ec191-0x0;var _0x5c7b3d=_0x91d3[_0x1ec191];return _0x5c7b3d;};'use strict';var _=require('lodash');var util=require(_0x391d('0x0'));var logger=require(_0x391d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x391d('0x2'));var rp=require(_0x391d('0x3'));var fs=require('fs');var path=require(_0x391d('0x4'));var rimraf=require(_0x391d('0x5'));var config=require(_0x391d('0x6'));var attributes=require(_0x391d('0x7'));module[_0x391d('0x8')]=function(_0x16101f,_0x13fe66){return _0x16101f[_0x391d('0x9')](_0x391d('0xa'),attributes,{'tableName':_0x391d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a3896,_0x120a78,_0x4abbb8){if(_0x2a3896[_0x391d('0xc')](_0x391d('0xd'))){_0x2a3896[_0x391d('0xe')]=moment()['format'](_0x391d('0xf'));}_0x4abbb8(null,_0x2a3896);}}});};
\ No newline at end of file
index 7430e11..bd82a1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8763=['stringify','error','code','message','catch','WhatsappInteraction','update','options','attributes','limit','then','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','where','addTags','body','ids','omit','spread','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','./whatsappInteraction.socket','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x44c5c1,_0x4d9d55){var _0x467172=function(_0x584e24){while(--_0x584e24){_0x44c5c1['push'](_0x44c5c1['shift']());}};_0x467172(++_0x4d9d55);}(_0x8763,0x1a3));var _0x3876=function(_0x800a17,_0x10c50f){_0x800a17=_0x800a17-0x0;var _0x185c86=_0x8763[_0x800a17];return _0x185c86;};'use strict';var _=require(_0x3876('0x0'));var util=require(_0x3876('0x1'));var moment=require(_0x3876('0x2'));var BPromise=require(_0x3876('0x3'));var rs=require(_0x3876('0x4'));var fs=require('fs');var Redis=require(_0x3876('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3876('0x6'));var logger=require(_0x3876('0x7'))(_0x3876('0x8'));var config=require(_0x3876('0x9'));var jayson=require(_0x3876('0xa'));var client=jayson[_0x3876('0xb')]['http']({'port':0x232a});config[_0x3876('0xc')]=_[_0x3876('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3876('0xe'))['register'](socket);function respondWithRpcPromise(_0x2a1603,_0x158357,_0x9af929){return new BPromise(function(_0x107d2e,_0x5aed50){return client[_0x3876('0xf')](_0x2a1603,_0x9af929)['then'](function(_0x172e9a){logger[_0x3876('0x10')](_0x3876('0x11'),_0x158357,_0x3876('0x12'));logger[_0x3876('0x13')](_0x3876('0x14'),_0x158357,_0x3876('0x12'),JSON[_0x3876('0x15')](_0x172e9a));if(_0x172e9a[_0x3876('0x16')]){if(_0x172e9a[_0x3876('0x16')][_0x3876('0x17')]===0x1f4){logger[_0x3876('0x16')]('WhatsappInteraction,\x20%s,\x20%s',_0x158357,_0x172e9a[_0x3876('0x16')][_0x3876('0x18')]);return _0x5aed50(_0x172e9a[_0x3876('0x16')]['message']);}logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x158357,_0x172e9a['error'][_0x3876('0x18')]);return _0x107d2e(_0x172e9a[_0x3876('0x16')][_0x3876('0x18')]);}else{logger['info'](_0x3876('0x11'),_0x158357,_0x3876('0x12'));_0x107d2e(_0x172e9a['result'][_0x3876('0x18')]);}})[_0x3876('0x19')](function(_0x5bf9da){logger[_0x3876('0x16')](_0x3876('0x11'),_0x158357,_0x5bf9da);_0x5aed50(_0x5bf9da);});});}exports['UpdateWhatsappInteraction']=function(_0x5104ca){var _0x34932a=this;return new Promise(function(_0x2ca9ca,_0x330e1a){return db[_0x3876('0x1a')][_0x3876('0x1b')](_0x5104ca['body'],{'raw':_0x5104ca[_0x3876('0x1c')]?_0x5104ca['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5104ca[_0x3876('0x1c')]?_0x5104ca[_0x3876('0x1c')]['where']||null:null,'attributes':_0x5104ca['options']?_0x5104ca[_0x3876('0x1c')][_0x3876('0x1d')]||null:null,'limit':_0x5104ca[_0x3876('0x1c')]?_0x5104ca[_0x3876('0x1c')][_0x3876('0x1e')]||null:null})[_0x3876('0x1f')](function(_0x2c8ec1){logger[_0x3876('0x10')](_0x3876('0x20'),_0x5104ca);logger[_0x3876('0x13')](_0x3876('0x20'),_0x5104ca,JSON['stringify'](_0x2c8ec1));_0x2ca9ca(_0x2c8ec1);})[_0x3876('0x19')](function(_0x179de4){logger['error']('UpdateWhatsappInteraction',_0x179de4['message'],_0x5104ca);_0x330e1a(_0x34932a[_0x3876('0x16')](0x1f4,_0x179de4[_0x3876('0x18')]));});});};exports[_0x3876('0x21')]=function(_0x4cc588){return new Promise(function(_0x4e1146,_0x53509e){return db['WhatsappInteraction']['find']({'where':_0x4cc588[_0x3876('0x1c')]?_0x4cc588[_0x3876('0x1c')][_0x3876('0x22')]||null:null})[_0x3876('0x1f')](function(_0xa0808e){if(_0xa0808e){return _0xa0808e[_0x3876('0x23')](_0x4cc588[_0x3876('0x24')][_0x3876('0x25')],_[_0x3876('0x26')](_0x4cc588['body'],['ids','id'])||{});}})[_0x3876('0x27')](function(_0x89ccfa){logger[_0x3876('0x10')]('AddTags',_0x4cc588);logger[_0x3876('0x13')]('AddTags',_0x4cc588,JSON[_0x3876('0x15')](_0x89ccfa));_0x4e1146(_0x89ccfa);})[_0x3876('0x19')](function(_0x3c849b){logger[_0x3876('0x16')]('AddTags',_0x3c849b[_0x3876('0x18')],_0x4cc588);_0x53509e(_this[_0x3876('0x16')](0x1f4,_0x3c849b[_0x3876('0x18')]));});});};
\ No newline at end of file
+var _0x513e=['moment','randomstring','../../config/utils','../../config/logger','client','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','info','WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToWhatsappInteraction','addTags','omit','ids','spread','AddTags','util'];(function(_0x24fc2c,_0x47b500){var _0x483de4=function(_0x1c5da5){while(--_0x1c5da5){_0x24fc2c['push'](_0x24fc2c['shift']());}};_0x483de4(++_0x47b500);}(_0x513e,0x18b));var _0xe513=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x513e[_0x2fc012];return _0x2891f9;};'use strict';var _=require('lodash');var util=require(_0xe513('0x0'));var moment=require(_0xe513('0x1'));var BPromise=require('bluebird');var rs=require(_0xe513('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe513('0x3'));var logger=require(_0xe513('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe513('0x5')]['http']({'port':0x232a});config[_0xe513('0x6')]=_['defaults'](config['redis'],{'host':_0xe513('0x7'),'port':0x18eb});var socket=require(_0xe513('0x8'))(new Redis(config['redis']));require(_0xe513('0x9'))['register'](socket);function respondWithRpcPromise(_0x141150,_0x10260d,_0x5c7199){return new BPromise(function(_0x149a0d,_0x1d3b28){return client['request'](_0x141150,_0x5c7199)['then'](function(_0x38699e){logger[_0xe513('0xa')](_0xe513('0xb'),_0x10260d,'request\x20sent');logger[_0xe513('0xc')](_0xe513('0xd'),_0x10260d,'request\x20sent',JSON['stringify'](_0x38699e));if(_0x38699e[_0xe513('0xe')]){if(_0x38699e[_0xe513('0xe')][_0xe513('0xf')]===0x1f4){logger[_0xe513('0xe')](_0xe513('0xb'),_0x10260d,_0x38699e['error']['message']);return _0x1d3b28(_0x38699e[_0xe513('0xe')]['message']);}logger[_0xe513('0xe')](_0xe513('0xb'),_0x10260d,_0x38699e[_0xe513('0xe')]['message']);return _0x149a0d(_0x38699e[_0xe513('0xe')][_0xe513('0x10')]);}else{logger[_0xe513('0xa')](_0xe513('0xb'),_0x10260d,_0xe513('0x11'));_0x149a0d(_0x38699e[_0xe513('0x12')][_0xe513('0x10')]);}})[_0xe513('0x13')](function(_0x5caf8f){logger[_0xe513('0xe')](_0xe513('0xb'),_0x10260d,_0x5caf8f);_0x1d3b28(_0x5caf8f);});});}exports[_0xe513('0x14')]=function(_0x26525a){var _0x207892=this;return new Promise(function(_0x4b6499,_0x51c56f){return db[_0xe513('0x15')][_0xe513('0x16')](_0x26525a[_0xe513('0x17')],{'raw':_0x26525a[_0xe513('0x18')]?_0x26525a[_0xe513('0x18')][_0xe513('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26525a[_0xe513('0x18')]?_0x26525a[_0xe513('0x18')][_0xe513('0x1a')]||null:null,'attributes':_0x26525a[_0xe513('0x18')]?_0x26525a[_0xe513('0x18')][_0xe513('0x1b')]||null:null,'limit':_0x26525a[_0xe513('0x18')]?_0x26525a[_0xe513('0x18')][_0xe513('0x1c')]||null:null})[_0xe513('0x1d')](function(_0x2af41b){logger['info'](_0xe513('0x14'),_0x26525a);logger[_0xe513('0xc')]('UpdateWhatsappInteraction',_0x26525a,JSON['stringify'](_0x2af41b));_0x4b6499(_0x2af41b);})['catch'](function(_0x1513b7){logger[_0xe513('0xe')]('UpdateWhatsappInteraction',_0x1513b7[_0xe513('0x10')],_0x26525a);_0x51c56f(_0x207892[_0xe513('0xe')](0x1f4,_0x1513b7[_0xe513('0x10')]));});});};exports[_0xe513('0x1e')]=function(_0x4c065b){return new Promise(function(_0x5e5ddd,_0x20e575){return db['WhatsappInteraction']['find']({'where':_0x4c065b[_0xe513('0x18')]?_0x4c065b[_0xe513('0x18')][_0xe513('0x1a')]||null:null})[_0xe513('0x1d')](function(_0xecdbe7){if(_0xecdbe7){return _0xecdbe7[_0xe513('0x1f')](_0x4c065b[_0xe513('0x17')]['ids'],_[_0xe513('0x20')](_0x4c065b[_0xe513('0x17')],[_0xe513('0x21'),'id'])||{});}})[_0xe513('0x22')](function(_0x2f2d81){logger[_0xe513('0xa')](_0xe513('0x23'),_0x4c065b);logger[_0xe513('0xc')](_0xe513('0x23'),_0x4c065b,JSON['stringify'](_0x2f2d81));_0x5e5ddd(_0x2f2d81);})['catch'](function(_0x22e3c8){logger['error'](_0xe513('0x23'),_0x22e3c8[_0xe513('0x10')],_0x4c065b);_0x20e575(_this[_0xe513('0xe')](0x1f4,_0x22e3c8[_0xe513('0x10')]));});});};
\ No newline at end of file
index 0146acc..05ecaf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x588f=['register','length','whatsappInteraction:','./whatsappInteraction.events','save','update','removeListener'];(function(_0x35a56d,_0x30d2c1){var _0x49ce52=function(_0x494e07){while(--_0x494e07){_0x35a56d['push'](_0x35a56d['shift']());}};_0x49ce52(++_0x30d2c1);}(_0x588f,0x130));var _0xf588=function(_0x2c1fc6,_0x292eab){_0x2c1fc6=_0x2c1fc6-0x0;var _0x59335b=_0x588f[_0x2c1fc6];return _0x59335b;};'use strict';var WhatsappInteractionEvents=require(_0xf588('0x0'));var events=[_0xf588('0x1'),'remove',_0xf588('0x2')];function createListener(_0x396fbe,_0x4fc78f){return function(_0x36050b){_0x4fc78f['emit'](_0x396fbe,_0x36050b);};}function removeListener(_0x1a0567,_0x1be4e9){return function(){WhatsappInteractionEvents[_0xf588('0x3')](_0x1a0567,_0x1be4e9);};}exports[_0xf588('0x4')]=function(_0x59bb5a){for(var _0x117198=0x0,_0x348849=events[_0xf588('0x5')];_0x117198<_0x348849;_0x117198++){var _0x3d24ab=events[_0x117198];var _0x2ef76c=createListener(_0xf588('0x6')+_0x3d24ab,_0x59bb5a);WhatsappInteractionEvents['on'](_0x3d24ab,_0x2ef76c);}};
\ No newline at end of file
+var _0xd07f=['length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x339d45,_0x5b91d4){var _0x5e4a60=function(_0x4de526){while(--_0x4de526){_0x339d45['push'](_0x339d45['shift']());}};_0x5e4a60(++_0x5b91d4);}(_0xd07f,0x122));var _0xfd07=function(_0x4a1462,_0x1943cd){_0x4a1462=_0x4a1462-0x0;var _0x28de18=_0xd07f[_0x4a1462];return _0x28de18;};'use strict';var WhatsappInteractionEvents=require(_0xfd07('0x0'));var events=[_0xfd07('0x1'),_0xfd07('0x2'),_0xfd07('0x3')];function createListener(_0x17744d,_0x5845e5){return function(_0x586bed){_0x5845e5[_0xfd07('0x4')](_0x17744d,_0x586bed);};}function removeListener(_0x427cf0,_0x461855){return function(){WhatsappInteractionEvents[_0xfd07('0x5')](_0x427cf0,_0x461855);};}exports[_0xfd07('0x6')]=function(_0x38fa7e){for(var _0x311bb4=0x0,_0x3a6fd3=events[_0xfd07('0x7')];_0x311bb4<_0x3a6fd3;_0x311bb4++){var _0x834daf=events[_0x311bb4];var _0x391c30=createListener(_0xfd07('0x8')+_0x834daf,_0x38fa7e);WhatsappInteractionEvents['on'](_0x834daf,_0x391c30);}};
\ No newline at end of file
index 3fbd315..bdc6bb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf184=['show','post','tracked','whatsapp','whatsappmessage:create','create','status','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf184,0x16d));var _0x4f18=function(_0x75267d,_0x5d286c){_0x75267d=_0x75267d-0x0;var _0x21ccec=_0xf184[_0x75267d];return _0x21ccec;};'use strict';var multer=require(_0x4f18('0x0'));var util=require(_0x4f18('0x1'));var path=require(_0x4f18('0x2'));var timeout=require(_0x4f18('0x3'));var express=require(_0x4f18('0x4'));var router=express[_0x4f18('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4f18('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f18('0x7'));var controller=require('./whatsappMessage.controller');router[_0x4f18('0x8')]('/',auth[_0x4f18('0x9')](),controller['index']);router[_0x4f18('0x8')](_0x4f18('0xa'),auth[_0x4f18('0x9')](),controller[_0x4f18('0xb')]);router[_0x4f18('0x8')]('/:id',auth[_0x4f18('0x9')](),controller[_0x4f18('0xc')]);router[_0x4f18('0xd')]('/',auth['isAuthenticated'](),interaction[_0x4f18('0xe')](_0x4f18('0xf'),_0x4f18('0x10')),controller[_0x4f18('0x11')]);router['post']('/:id/status',controller[_0x4f18('0x12')]);router[_0x4f18('0x13')](_0x4f18('0x14'),auth['isAuthenticated'](),controller[_0x4f18('0x15')]);router[_0x4f18('0x13')](_0x4f18('0x16'),auth[_0x4f18('0x9')](),controller[_0x4f18('0x17')]);router[_0x4f18('0x13')](_0x4f18('0x18'),auth[_0x4f18('0x9')](),controller[_0x4f18('0x19')]);router[_0x4f18('0x1a')](_0x4f18('0x14'),auth['isAuthenticated'](),controller[_0x4f18('0x1b')]);module[_0x4f18('0x1c')]=router;
\ No newline at end of file
+var _0x2dee=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','/:id','update','put','/:id/accept','accept','delete','destroy','multer','util'];(function(_0x4c5f3e,_0x3c6f97){var _0x31ca51=function(_0x110c29){while(--_0x110c29){_0x4c5f3e['push'](_0x4c5f3e['shift']());}};_0x31ca51(++_0x3c6f97);}(_0x2dee,0x9a));var _0xe2de=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x2dee[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require(_0xe2de('0x0'));var util=require(_0xe2de('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe2de('0x2'));var router=express['Router']();var fs_extra=require(_0xe2de('0x3'));var auth=require(_0xe2de('0x4'));var interaction=require(_0xe2de('0x5'));var config=require(_0xe2de('0x6'));var controller=require('./whatsappMessage.controller');router[_0xe2de('0x7')]('/',auth[_0xe2de('0x8')](),controller[_0xe2de('0x9')]);router[_0xe2de('0x7')](_0xe2de('0xa'),auth[_0xe2de('0x8')](),controller['describe']);router[_0xe2de('0x7')]('/:id',auth[_0xe2de('0x8')](),controller[_0xe2de('0xb')]);router[_0xe2de('0xc')]('/',auth['isAuthenticated'](),interaction[_0xe2de('0xd')](_0xe2de('0xe'),_0xe2de('0xf')),controller[_0xe2de('0x10')]);router[_0xe2de('0xc')](_0xe2de('0x11'),controller[_0xe2de('0x12')]);router['put'](_0xe2de('0x13'),auth[_0xe2de('0x8')](),controller[_0xe2de('0x14')]);router[_0xe2de('0x15')](_0xe2de('0x16'),auth[_0xe2de('0x8')](),controller[_0xe2de('0x17')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller['reject']);router[_0xe2de('0x18')](_0xe2de('0x13'),auth['isAuthenticated'](),controller[_0xe2de('0x19')]);module['exports']=router;
\ No newline at end of file
index 58ba649..0a90611 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2265=['medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT'];(function(_0x33c71e,_0xa31735){var _0x45e8f2=function(_0xfc2dff){while(--_0xfc2dff){_0x33c71e['push'](_0x33c71e['shift']());}};_0x45e8f2(++_0xa31735);}(_0x2265,0x114));var _0x5226=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x2265[_0x580576];return _0x3f55a0;};'use strict';var Sequelize=require(_0x5226('0x0'));module[_0x5226('0x1')]={'body':{'type':Sequelize[_0x5226('0x2')](_0x5226('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5226('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x5226('0x5')]('in','out'),'defaultValue':_0x5226('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x5226('0x7')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x5226('0x8')]},'secret':{'type':Sequelize[_0x5226('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x5226('0x2')]}};
\ No newline at end of file
+var _0xe303=['STRING','DATE','TEXT','sequelize','exports','medium','BOOLEAN','out'];(function(_0x528497,_0x147e87){var _0x392d59=function(_0x47d9ec){while(--_0x47d9ec){_0x528497['push'](_0x528497['shift']());}};_0x392d59(++_0x147e87);}(_0xe303,0x11b));var _0x3e30=function(_0x424d73,_0x412247){_0x424d73=_0x424d73-0x0;var _0x4367df=_0xe303[_0x424d73];return _0x4367df;};'use strict';var Sequelize=require(_0x3e30('0x0'));module[_0x3e30('0x1')]={'body':{'type':Sequelize['TEXT'](_0x3e30('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3e30('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3e30('0x4')),'defaultValue':_0x3e30('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3e30('0x5')](0xbe)},'phone':{'type':Sequelize[_0x3e30('0x5')]},'readAt':{'type':Sequelize[_0x3e30('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x3e30('0x7')]}};
\ No newline at end of file
index 4287c40..efe9da1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x371f=['SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','SIP/%s','channel','event','EventManager','acceptmessage','WhatsappInteractionId','interaction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','contact','motionChannel','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','stack','name','send','index','WhatsappMessage','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','length','merge','find','create','body','params','describe','accept','whatsapp','read','readAt','format','UserId','user','agent','get','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage'];(function(_0x17a329,_0x5d2f43){var _0x761387=function(_0x2e1ad3){while(--_0x2e1ad3){_0x17a329['push'](_0x17a329['shift']());}};_0x761387(++_0x5d2f43);}(_0x371f,0x1cb));var _0xf371=function(_0x1cc8ce,_0x280a59){_0x1cc8ce=_0x1cc8ce-0x0;var _0x40b73a=_0x371f[_0x1cc8ce];return _0x40b73a;};'use strict';var emlformat=require(_0xf371('0x0'));var rimraf=require(_0xf371('0x1'));var zipdir=require(_0xf371('0x2'));var jsonpatch=require(_0xf371('0x3'));var rp=require(_0xf371('0x4'));var moment=require(_0xf371('0x5'));var BPromise=require(_0xf371('0x6'));var Mustache=require(_0xf371('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf371('0x8'));var ejs=require(_0xf371('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf371('0xa'));var squel=require(_0xf371('0xb'));var crypto=require(_0xf371('0xc'));var jsforce=require(_0xf371('0xd'));var deskjs=require(_0xf371('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf371('0xf'));var Papa=require(_0xf371('0x10'));var Redis=require(_0xf371('0x11'));var authService=require(_0xf371('0x12'));var qs=require(_0xf371('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf371('0x14'));var logger=require(_0xf371('0x15'))(_0xf371('0x16'));var utils=require(_0xf371('0x17'));var config=require(_0xf371('0x18'));var licenseUtil=require(_0xf371('0x19'));var db=require(_0xf371('0x1a'))['db'];config[_0xf371('0x1b')]=_[_0xf371('0x1c')](config[_0xf371('0x1b')],{'host':_0xf371('0x1d'),'port':0x18eb});var socket=require(_0xf371('0x1e'))(new Redis(config[_0xf371('0x1b')]));require(_0xf371('0x1f'))[_0xf371('0x20')](socket);var jayson=require(_0xf371('0x21'));var client=jayson[_0xf371('0x22')][_0xf371('0x23')]({'port':0x232c});var client9002=jayson[_0xf371('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15ae00,_0x296774,_0x5642b5,_0x5ec834){return new BPromise(function(_0x2890de,_0x1e1926){var _0xd174b3=_0x5ec834||client;return _0xd174b3['request'](_0x15ae00,_0x5642b5)[_0xf371('0x24')](function(_0x3aa9f6){logger[_0xf371('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x296774,_0xf371('0x26'));logger[_0xf371('0x27')](_0xf371('0x28'),_0x296774,_0xf371('0x26'),JSON['stringify'](_0x3aa9f6));if(_0x3aa9f6['error']){if(_0x3aa9f6[_0xf371('0x29')][_0xf371('0x2a')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x296774,_0x3aa9f6[_0xf371('0x29')]['message']);return _0x1e1926(_0x3aa9f6[_0xf371('0x29')][_0xf371('0x2b')]);}logger['error'](_0xf371('0x2c'),_0x296774,_0x3aa9f6[_0xf371('0x29')][_0xf371('0x2b')]);return _0x2890de(_0x3aa9f6[_0xf371('0x29')]['message']);}else{logger[_0xf371('0x25')](_0xf371('0x2c'),_0x296774,'request\x20sent');_0x2890de(_0x3aa9f6[_0xf371('0x2d')][_0xf371('0x2b')]);}})[_0xf371('0x2e')](function(_0x3831e3){logger[_0xf371('0x29')](_0xf371('0x2c'),_0x296774,_0x3831e3);_0x1e1926(_0x3831e3);});});}function respondWithStatusCode(_0x4cb5ea,_0x4f58d1){_0x4f58d1=_0x4f58d1||0xcc;return function(_0x374fe7){if(_0x374fe7){return _0x4cb5ea[_0xf371('0x2f')](_0x4f58d1);}return _0x4cb5ea[_0xf371('0x30')](_0x4f58d1)[_0xf371('0x31')]();};}function respondWithResult(_0x4a3ec3,_0x54acd1){_0x54acd1=_0x54acd1||0xc8;return function(_0x5bee92){if(_0x5bee92){return _0x4a3ec3[_0xf371('0x30')](_0x54acd1)['json'](_0x5bee92);}};}function respondWithFilteredResult(_0x4c122d,_0x493265){return function(_0x26718d){if(_0x26718d){var _0x34e32f=typeof _0x493265[_0xf371('0x32')]===_0xf371('0x33')&&typeof _0x493265[_0xf371('0x34')]==='undefined';var _0x380693=_0x26718d[_0xf371('0x35')];var _0x451fa2=_0x34e32f?0x0:_0x493265[_0xf371('0x32')];var _0x1f711c=_0x34e32f?_0x26718d['count']:_0x493265[_0xf371('0x32')]+_0x493265[_0xf371('0x34')];var _0x4ce4d0;if(_0x1f711c>=_0x380693){_0x1f711c=_0x380693;_0x4ce4d0=0xc8;}else{_0x4ce4d0=0xce;}_0x4c122d[_0xf371('0x30')](_0x4ce4d0);return _0x4c122d[_0xf371('0x36')](_0xf371('0x37'),_0x451fa2+'-'+_0x1f711c+'/'+_0x380693)[_0xf371('0x38')](_0x26718d);}return null;};}function patchUpdates(_0x24b0ac){return function(_0x12e41b){try{jsonpatch[_0xf371('0x39')](_0x12e41b,_0x24b0ac,!![]);}catch(_0x68112d){return BPromise[_0xf371('0x3a')](_0x68112d);}return _0x12e41b[_0xf371('0x3b')]();};}function saveUpdates(_0x384353,_0x2520a6){return function(_0x48d55c){if(_0x48d55c){return _0x48d55c[_0xf371('0x3c')](_0x384353)[_0xf371('0x24')](function(_0x1abbd3){return _0x1abbd3;});}return null;};}function removeEntity(_0x135da6,_0x2acdd4){return function(_0x4f18ad){if(_0x4f18ad){return _0x4f18ad['destroy']()[_0xf371('0x24')](function(){_0x135da6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x557005,_0x185171){return function(_0xb05d40){if(!_0xb05d40){_0x557005['sendStatus'](0x194);}return _0xb05d40;};}function handleError(_0x48b600,_0x16dc75){_0x16dc75=_0x16dc75||0x1f4;return function(_0x57c754){logger[_0xf371('0x29')](_0x57c754[_0xf371('0x3d')]);if(_0x57c754[_0xf371('0x3e')]){delete _0x57c754[_0xf371('0x3e')];}_0x48b600[_0xf371('0x30')](_0x16dc75)[_0xf371('0x3f')](_0x57c754);};}exports[_0xf371('0x40')]=function(_0x2a6bd5,_0xe0222){var _0x4dfb5d={},_0xc83d6e={},_0x5b8986={'count':0x0,'rows':[]};var _0x568efb=_['map'](db[_0xf371('0x41')]['rawAttributes'],function(_0x6e8f21){return{'name':_0x6e8f21[_0xf371('0x42')],'type':_0x6e8f21[_0xf371('0x43')]['key']};});_0xc83d6e[_0xf371('0x44')]=_[_0xf371('0x45')](_0x568efb,_0xf371('0x3e'));_0xc83d6e[_0xf371('0x46')]=_[_0xf371('0x47')](_0x2a6bd5['query']);_0xc83d6e[_0xf371('0x48')]=_[_0xf371('0x49')](_0xc83d6e[_0xf371('0x44')],_0xc83d6e[_0xf371('0x46')]);_0x4dfb5d['attributes']=_[_0xf371('0x49')](_0xc83d6e[_0xf371('0x44')],qs['fields'](_0x2a6bd5[_0xf371('0x46')][_0xf371('0x4a')]));_0x4dfb5d[_0xf371('0x4b')]=_0x4dfb5d[_0xf371('0x4b')]['length']?_0x4dfb5d[_0xf371('0x4b')]:_0xc83d6e[_0xf371('0x44')];if(!_0x2a6bd5[_0xf371('0x46')]['hasOwnProperty'](_0xf371('0x4c'))){_0x4dfb5d[_0xf371('0x34')]=qs['limit'](_0x2a6bd5[_0xf371('0x46')][_0xf371('0x34')]);_0x4dfb5d['offset']=qs[_0xf371('0x32')](_0x2a6bd5['query'][_0xf371('0x32')]);}_0x4dfb5d['order']=qs[_0xf371('0x4d')](_0x2a6bd5['query'][_0xf371('0x4d')]);_0x4dfb5d[_0xf371('0x4e')]=qs['filters'](_['pick'](_0x2a6bd5[_0xf371('0x46')],_0xc83d6e[_0xf371('0x48')]),_0x568efb);if(_0x2a6bd5[_0xf371('0x46')][_0xf371('0x4f')]){_0x4dfb5d[_0xf371('0x4e')]=_['merge'](_0x4dfb5d[_0xf371('0x4e')],{'$or':_[_0xf371('0x45')](_0x568efb,function(_0x4ac6f6){if(_0x4ac6f6[_0xf371('0x43')]!==_0xf371('0x50')){var _0x379f60={};_0x379f60[_0x4ac6f6[_0xf371('0x3e')]]={'$like':'%'+_0x2a6bd5['query']['filter']+'%'};return _0x379f60;}})});}_0x4dfb5d=_['merge']({},_0x4dfb5d,_0x2a6bd5[_0xf371('0x51')]);var _0x29a930={'where':_0x4dfb5d['where']};return db[_0xf371('0x41')][_0xf371('0x35')](_0x29a930)[_0xf371('0x24')](function(_0x3adf0f){_0x5b8986['count']=_0x3adf0f;if(_0x2a6bd5[_0xf371('0x46')][_0xf371('0x52')]){_0x4dfb5d[_0xf371('0x53')]=[{'all':!![]}];}return db[_0xf371('0x41')][_0xf371('0x54')](_0x4dfb5d);})[_0xf371('0x24')](function(_0x306295){_0x5b8986[_0xf371('0x55')]=_0x306295;return _0x5b8986;})[_0xf371('0x24')](respondWithFilteredResult(_0xe0222,_0x4dfb5d))[_0xf371('0x2e')](handleError(_0xe0222,null));};exports[_0xf371('0x56')]=function(_0x472a41,_0x534378){var _0x320dc9={'raw':!![],'where':{'id':_0x472a41['params']['id']}},_0x3e04f1={};_0x3e04f1[_0xf371('0x44')]=_[_0xf371('0x47')](db[_0xf371('0x41')][_0xf371('0x57')]);_0x3e04f1[_0xf371('0x46')]=_[_0xf371('0x47')](_0x472a41[_0xf371('0x46')]);_0x3e04f1[_0xf371('0x48')]=_[_0xf371('0x49')](_0x3e04f1[_0xf371('0x44')],_0x3e04f1[_0xf371('0x46')]);_0x320dc9['attributes']=_[_0xf371('0x49')](_0x3e04f1['model'],qs[_0xf371('0x4a')](_0x472a41[_0xf371('0x46')][_0xf371('0x4a')]));_0x320dc9[_0xf371('0x4b')]=_0x320dc9[_0xf371('0x4b')][_0xf371('0x58')]?_0x320dc9['attributes']:_0x3e04f1[_0xf371('0x44')];if(_0x472a41['query'][_0xf371('0x52')]){_0x320dc9['include']=[{'all':!![]}];}_0x320dc9=_[_0xf371('0x59')]({},_0x320dc9,_0x472a41[_0xf371('0x51')]);return db[_0xf371('0x41')][_0xf371('0x5a')](_0x320dc9)[_0xf371('0x24')](handleEntityNotFound(_0x534378,null))['then'](respondWithResult(_0x534378,null))[_0xf371('0x2e')](handleError(_0x534378,null));};exports[_0xf371('0x5b')]=function(_0x2cafb3,_0x5df475){return db[_0xf371('0x41')]['create'](_0x2cafb3['body'],{})[_0xf371('0x24')](respondWithResult(_0x5df475,0xc9))[_0xf371('0x2e')](handleError(_0x5df475,null));};exports[_0xf371('0x3c')]=function(_0x236ad4,_0x569a8b){if(_0x236ad4[_0xf371('0x5c')]['id']){delete _0x236ad4[_0xf371('0x5c')]['id'];}return db[_0xf371('0x41')][_0xf371('0x5a')]({'where':{'id':_0x236ad4['params']['id']}})[_0xf371('0x24')](handleEntityNotFound(_0x569a8b,null))[_0xf371('0x24')](saveUpdates(_0x236ad4[_0xf371('0x5c')],null))[_0xf371('0x24')](respondWithResult(_0x569a8b,null))['catch'](handleError(_0x569a8b,null));};exports['destroy']=function(_0x30e7c1,_0x101472){return db['WhatsappMessage'][_0xf371('0x5a')]({'where':{'id':_0x30e7c1[_0xf371('0x5d')]['id']}})[_0xf371('0x24')](handleEntityNotFound(_0x101472,null))[_0xf371('0x24')](removeEntity(_0x101472,null))[_0xf371('0x2e')](handleError(_0x101472,null));};exports[_0xf371('0x5e')]=function(_0x5027aa,_0x42e21b){return db[_0xf371('0x41')][_0xf371('0x5e')]()[_0xf371('0x24')](respondWithResult(_0x42e21b,null))[_0xf371('0x2e')](handleError(_0x42e21b,null));};var interaction_log=require(_0xf371('0x15'))('whatsapp-interactions');exports[_0xf371('0x5f')]=function(_0x36a3f2,_0x4afc40,_0x22071a){var _0x27d09b={'agent':{},'channel':_0xf371('0x60')};if(_0x36a3f2[_0xf371('0x5c')]['id']){delete _0x36a3f2[_0xf371('0x5c')]['id'];}_0x36a3f2[_0xf371('0x5c')][_0xf371('0x61')]=!![];_0x36a3f2[_0xf371('0x5c')][_0xf371('0x62')]=moment()[_0xf371('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x36a3f2[_0xf371('0x5c')]['UserId']=_0x36a3f2['body'][_0xf371('0x64')]||_0x36a3f2[_0xf371('0x65')]['id'];_0x27d09b[_0xf371('0x66')]['id']=_0x36a3f2[_0xf371('0x5c')][_0xf371('0x64')];return db[_0xf371('0x41')][_0xf371('0x5a')]({'where':{'id':_0x36a3f2[_0xf371('0x5d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4afc40,null))[_0xf371('0x24')](saveUpdates(_0x36a3f2['body'],null))['then'](function(_0x927fe0){if(_0x927fe0){_0x27d09b['message']=_0x927fe0[_0xf371('0x67')]({'plain':!![]});return db['WhatsappInteraction'][_0xf371('0x5a')]({'where':{'id':_0x927fe0['WhatsappInteractionId']}});}return null;})[_0xf371('0x24')](handleEntityNotFound(_0x4afc40,null))[_0xf371('0x24')](function(_0x22c41b){if(_0x22c41b){return _0x22c41b['update']({'UserId':_0x36a3f2[_0xf371('0x5c')][_0xf371('0x64')],'read1stAt':_[_0xf371('0x68')](_0x22c41b[_0xf371('0x69')])?moment()['format'](_0xf371('0x6a')):undefined});}return null;})[_0xf371('0x24')](function(_0x45d64d){if(_0x45d64d){_0x27d09b['interaction']=_0x45d64d['get']({'plain':!![]});interaction_log[_0xf371('0x25')](_0xf371('0x6b'),_0x36a3f2[_0xf371('0x65')]['id'],_0x36a3f2[_0xf371('0x65')]['name'],_0x36a3f2[_0xf371('0x65')][_0xf371('0x6c')],_0x27d09b['interaction']['id'],_0x36a3f2[_0xf371('0x5c')]?JSON[_0xf371('0x6d')](_0x36a3f2['body']):_0xf371('0x6e'));return respondWithRpcPromise(_0xf371('0x6f'),_0xf371('0x70'),_0x27d09b);}return null;})[_0xf371('0x24')](function(_0x517273){var _0x53ca2f=_0xf371('0x71')+_0x517273[_0xf371('0x2b')][_0xf371('0x72')];return db[_0xf371('0x73')][_0xf371('0x46')](_0x53ca2f,{'type':db[_0xf371('0x74')][_0xf371('0x75')][_0xf371('0x76')],'raw':!![]})[_0xf371('0x24')](function(_0x56d2fe){return _0x56d2fe;});})[_0xf371('0x24')](function(_0xcb6977){if(_0xcb6977){_0x27d09b['message']['contact']=_0xcb6977[0x0];if(!_0x36a3f2[_0xf371('0x5c')][_0xf371('0x64')])return;return db[_0xf371('0x77')]['find']({'where':{'id':_0x36a3f2[_0xf371('0x5c')][_0xf371('0x64')],'role':_0xf371('0x66')},'attributes':['id','name',_0xf371('0x78'),_0xf371('0x79'),_0xf371('0x7a')],'raw':!![]});}return null;})[_0xf371('0x24')](function(_0x58214c){if(!_0x58214c)return null;_0x27d09b[_0xf371('0x2b')][_0xf371('0x66')]=_0x58214c;return _0x27d09b;})[_0xf371('0x24')](function(_0x496c2e){if(_0x496c2e){if(_0x36a3f2['body']['manual']){_0x27d09b['message']['interface']=util['format'](_0xf371('0x7b'),_0x36a3f2[_0xf371('0x65')][_0xf371('0x3e')]);_0x27d09b[_0xf371('0x2b')][_0xf371('0x7c')]=_0x27d09b[_0xf371('0x7c')];_0x27d09b[_0xf371('0x2b')]['motionChannel']=_0x27d09b[_0xf371('0x7c')];_0x27d09b[_0xf371('0x2b')][_0xf371('0x7d')]='accept';return respondWithRpcPromise(_0xf371('0x7e'),_0xf371('0x7e'),{'event':_0xf371('0x7f'),'message':_0x27d09b[_0xf371('0x2b')]},client9002)[_0xf371('0x24')](function(){return _0x27d09b;});}return _0x27d09b;}return null;})[_0xf371('0x24')](respondWithResult(_0x4afc40,null))['catch'](handleError(_0x4afc40,null));};var interaction_log=require(_0xf371('0x15'))('whatsapp-interactions');exports[_0xf371('0x3a')]=function(_0x21155f,_0x403f17,_0x3c8cae){var _0x76d7b6={'agent':{},'channel':_0xf371('0x60')};if(_0x21155f[_0xf371('0x5c')]['id']){delete _0x21155f[_0xf371('0x5c')]['id'];}_0x21155f[_0xf371('0x5c')]['UserId']=_0x21155f['body'][_0xf371('0x64')]||_0x21155f[_0xf371('0x65')]['id'];_0x76d7b6[_0xf371('0x66')]['id']=_0x21155f[_0xf371('0x5c')][_0xf371('0x64')];return db['WhatsappMessage'][_0xf371('0x5a')]({'where':{'id':_0x21155f['params']['id'],'UserId':null}})[_0xf371('0x24')](handleEntityNotFound(_0x403f17,null))[_0xf371('0x24')](function(_0x311e22){if(_0x311e22){_0x76d7b6[_0xf371('0x2b')]=_0x311e22['get']({'plain':!![]});return db['WhatsappInteraction'][_0xf371('0x5a')]({'where':{'id':_0x311e22[_0xf371('0x80')]}});}return null;})[_0xf371('0x24')](handleEntityNotFound(_0x403f17,null))[_0xf371('0x24')](function(_0x4a445c){if(_0x4a445c){_0x76d7b6[_0xf371('0x81')]=_0x4a445c[_0xf371('0x67')]({'plain':!![]});interaction_log['info'](_0xf371('0x82'),_0x21155f['user']['id'],_0x21155f[_0xf371('0x65')][_0xf371('0x3e')],_0x21155f[_0xf371('0x65')][_0xf371('0x6c')],_0x76d7b6['interaction']['id'],_0x21155f['body']?JSON[_0xf371('0x6d')](_0x21155f[_0xf371('0x5c')]):_0xf371('0x6e'));return respondWithRpcPromise('RejectMessage',_0xf371('0x83'),_0x76d7b6);}return null;})[_0xf371('0x24')](function(_0x4d3718){var _0x2dc377='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4d3718[_0xf371('0x2b')][_0xf371('0x72')];return db[_0xf371('0x73')][_0xf371('0x46')](_0x2dc377,{'type':db['Sequelize'][_0xf371('0x75')][_0xf371('0x76')],'raw':!![]})[_0xf371('0x24')](function(_0x2384e5){return _0x2384e5;});})['then'](function(_0x28293a){if(_0x28293a){_0x76d7b6[_0xf371('0x2b')][_0xf371('0x84')]=_0x28293a[0x0];if(!_0x21155f[_0xf371('0x5c')][_0xf371('0x64')])return;return db[_0xf371('0x77')]['find']({'where':{'id':_0x21155f['body'][_0xf371('0x64')],'role':_0xf371('0x66')},'attributes':['id',_0xf371('0x3e'),'fullname',_0xf371('0x79'),_0xf371('0x7a')],'raw':!![]});}return null;})[_0xf371('0x24')](function(_0x31b7cb){if(!_0x31b7cb)return null;_0x76d7b6[_0xf371('0x2b')][_0xf371('0x66')]=_0x31b7cb;return _0x76d7b6;})['then'](function(_0x3a24ac){if(_0x3a24ac){_0x3a24ac['message']['interface']=util[_0xf371('0x63')](_0xf371('0x7b'),_0x21155f[_0xf371('0x65')]['name']);_0x3a24ac[_0xf371('0x2b')]['channel']=_0x76d7b6[_0xf371('0x7c')];_0x3a24ac[_0xf371('0x2b')][_0xf371('0x85')]=_0x76d7b6[_0xf371('0x7c')];_0x3a24ac[_0xf371('0x2b')][_0xf371('0x7d')]='reject';respondWithRpcPromise(_0xf371('0x7e'),_0xf371('0x7e'),{'event':_0xf371('0x86'),'message':_0x3a24ac[_0xf371('0x2b')]},client9002);return _0x76d7b6;}return null;})['then'](respondWithResult(_0x403f17,null))[_0xf371('0x2e')](handleError(_0x403f17,null));};exports[_0xf371('0x30')]=function(_0x211c6c,_0xb3f7dc,_0x4da097){if(_0x211c6c['body']['id']){delete _0x211c6c[_0xf371('0x5c')]['id'];}var _0x10dc29;return db[_0xf371('0x41')][_0xf371('0x5a')]({'where':{'id':_0x211c6c['params']['id']}})[_0xf371('0x24')](handleEntityNotFound(_0xb3f7dc,null))[_0xf371('0x24')](function(_0x2b7c04){if(_0x2b7c04){_0x10dc29=_0x2b7c04;return db[_0xf371('0x87')][_0xf371('0x5a')]({'where':{'id':_0x2b7c04[_0xf371('0x88')]}});}})[_0xf371('0x24')](handleEntityNotFound(_0xb3f7dc,null))['then'](function(_0x48e905){if(_0x48e905){logger[_0xf371('0x27')](_0xf371('0x89'),_0xf371('0x30'),'received\x20delivery\x20report\x20from',_0x48e905[_0xf371('0x43')],util[_0xf371('0x8a')](_0x211c6c[_0xf371('0x5c')],{'showHidden':![],'depth':null}));switch(_0x48e905[_0xf371('0x43')]){case _0xf371('0x8b'):if(_0x211c6c[_0xf371('0x5c')][_0xf371('0x8c')]&&_0x211c6c[_0xf371('0x5c')][_0xf371('0x8c')]===_0x10dc29['messageId']&&_0x211c6c[_0xf371('0x5c')][_0xf371('0x8d')]&&_0x211c6c[_0xf371('0x5c')][_0xf371('0x8d')]===_0xf371('0x61')){return _0x10dc29['update']({'read':!![]});}else{logger[_0xf371('0x29')](_0xf371('0x8e'),_0xf371('0x30'),_0xf371('0x8b'),util[_0xf371('0x8a')](_0x211c6c[_0xf371('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x10dc29;}})[_0xf371('0x24')](respondWithResult(_0xb3f7dc,null))[_0xf371('0x2e')](handleError(_0xb3f7dc,null));};
\ No newline at end of file
+var _0x45c3=['register','jayson/promise','client','http','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','stack','name','send','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','length','find','create','body','update','destroy','describe','whatsapp-interactions','accept','readAt','UserId','user','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','Sequelize','QueryTypes','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0x45c3,0xfd));var _0x345c=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x45c3[_0xc8a931];return _0x28bd27;};'use strict';var emlformat=require(_0x345c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x345c('0x1'));var jsonpatch=require(_0x345c('0x2'));var rp=require('request-promise');var moment=require(_0x345c('0x3'));var BPromise=require(_0x345c('0x4'));var Mustache=require('mustache');var util=require(_0x345c('0x5'));var path=require(_0x345c('0x6'));var sox=require('sox');var csv=require(_0x345c('0x7'));var ejs=require(_0x345c('0x8'));var fs=require('fs');var fs_extra=require(_0x345c('0x9'));var _=require(_0x345c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x345c('0xb'));var deskjs=require(_0x345c('0xc'));var toCsv=require(_0x345c('0x7'));var querystring=require('querystring');var Papa=require(_0x345c('0xd'));var Redis=require(_0x345c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x345c('0xf'));var as=require(_0x345c('0x10'));var hardwareService=require(_0x345c('0x11'));var logger=require(_0x345c('0x12'))(_0x345c('0x13'));var utils=require(_0x345c('0x14'));var config=require(_0x345c('0x15'));var licenseUtil=require(_0x345c('0x16'));var db=require(_0x345c('0x17'))['db'];config['redis']=_['defaults'](config[_0x345c('0x18')],{'host':_0x345c('0x19'),'port':0x18eb});var socket=require(_0x345c('0x1a'))(new Redis(config[_0x345c('0x18')]));require('./whatsappMessage.socket')[_0x345c('0x1b')](socket);var jayson=require(_0x345c('0x1c'));var client=jayson[_0x345c('0x1d')][_0x345c('0x1e')]({'port':0x232c});var client9002=jayson[_0x345c('0x1d')][_0x345c('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x4fe59a,_0x3d1208,_0x5c2763,_0x466289){return new BPromise(function(_0x5a95dd,_0x296d8b){var _0x3a0277=_0x466289||client;return _0x3a0277['request'](_0x4fe59a,_0x5c2763)[_0x345c('0x1f')](function(_0x389268){logger['info'](_0x345c('0x20'),_0x3d1208,'request\x20sent');logger[_0x345c('0x21')](_0x345c('0x22'),_0x3d1208,'request\x20sent',JSON['stringify'](_0x389268));if(_0x389268[_0x345c('0x23')]){if(_0x389268[_0x345c('0x23')][_0x345c('0x24')]===0x1f4){logger['error'](_0x345c('0x20'),_0x3d1208,_0x389268[_0x345c('0x23')][_0x345c('0x25')]);return _0x296d8b(_0x389268[_0x345c('0x23')][_0x345c('0x25')]);}logger[_0x345c('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x3d1208,_0x389268[_0x345c('0x23')][_0x345c('0x25')]);return _0x5a95dd(_0x389268[_0x345c('0x23')][_0x345c('0x25')]);}else{logger[_0x345c('0x26')](_0x345c('0x20'),_0x3d1208,_0x345c('0x27'));_0x5a95dd(_0x389268[_0x345c('0x28')]['message']);}})[_0x345c('0x29')](function(_0x16bdc8){logger[_0x345c('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x3d1208,_0x16bdc8);_0x296d8b(_0x16bdc8);});});}function respondWithStatusCode(_0x4f5801,_0x4b82f3){_0x4b82f3=_0x4b82f3||0xcc;return function(_0x2cfd59){if(_0x2cfd59){return _0x4f5801[_0x345c('0x2a')](_0x4b82f3);}return _0x4f5801['status'](_0x4b82f3)[_0x345c('0x2b')]();};}function respondWithResult(_0x2217d4,_0x5b2413){_0x5b2413=_0x5b2413||0xc8;return function(_0x183c25){if(_0x183c25){return _0x2217d4[_0x345c('0x2c')](_0x5b2413)[_0x345c('0x2d')](_0x183c25);}};}function respondWithFilteredResult(_0x570907,_0x2c57e6){return function(_0x1fff92){if(_0x1fff92){var _0x1a6d98=typeof _0x2c57e6[_0x345c('0x2e')]===_0x345c('0x2f')&&typeof _0x2c57e6[_0x345c('0x30')]===_0x345c('0x2f');var _0x1d69c3=_0x1fff92[_0x345c('0x31')];var _0x3b1c20=_0x1a6d98?0x0:_0x2c57e6['offset'];var _0x10736c=_0x1a6d98?_0x1fff92[_0x345c('0x31')]:_0x2c57e6[_0x345c('0x2e')]+_0x2c57e6['limit'];var _0x35aea5;if(_0x10736c>=_0x1d69c3){_0x10736c=_0x1d69c3;_0x35aea5=0xc8;}else{_0x35aea5=0xce;}_0x570907[_0x345c('0x2c')](_0x35aea5);return _0x570907['set'](_0x345c('0x32'),_0x3b1c20+'-'+_0x10736c+'/'+_0x1d69c3)[_0x345c('0x2d')](_0x1fff92);}return null;};}function patchUpdates(_0x4f8c34){return function(_0x3ab909){try{jsonpatch[_0x345c('0x33')](_0x3ab909,_0x4f8c34,!![]);}catch(_0x59676f){return BPromise[_0x345c('0x34')](_0x59676f);}return _0x3ab909['save']();};}function saveUpdates(_0x430d94,_0x5dd858){return function(_0x1eb1c6){if(_0x1eb1c6){return _0x1eb1c6['update'](_0x430d94)[_0x345c('0x1f')](function(_0x346a1d){return _0x346a1d;});}return null;};}function removeEntity(_0x3ece0d,_0x49c9e3){return function(_0x4089ec){if(_0x4089ec){return _0x4089ec['destroy']()[_0x345c('0x1f')](function(){_0x3ece0d[_0x345c('0x2c')](0xcc)[_0x345c('0x2b')]();});}};}function handleEntityNotFound(_0x1cdcb2,_0x2e0383){return function(_0x4096cf){if(!_0x4096cf){_0x1cdcb2[_0x345c('0x2a')](0x194);}return _0x4096cf;};}function handleError(_0x3e78c3,_0x41cc9e){_0x41cc9e=_0x41cc9e||0x1f4;return function(_0x71dc78){logger[_0x345c('0x23')](_0x71dc78[_0x345c('0x35')]);if(_0x71dc78[_0x345c('0x36')]){delete _0x71dc78[_0x345c('0x36')];}_0x3e78c3[_0x345c('0x2c')](_0x41cc9e)[_0x345c('0x37')](_0x71dc78);};}exports['index']=function(_0x2d2ef2,_0x115203){var _0x243825={},_0x54d78f={},_0x54c703={'count':0x0,'rows':[]};var _0x304430=_[_0x345c('0x38')](db[_0x345c('0x39')][_0x345c('0x3a')],function(_0x16271a){return{'name':_0x16271a[_0x345c('0x3b')],'type':_0x16271a[_0x345c('0x3c')][_0x345c('0x3d')]};});_0x54d78f[_0x345c('0x3e')]=_['map'](_0x304430,_0x345c('0x36'));_0x54d78f[_0x345c('0x3f')]=_[_0x345c('0x40')](_0x2d2ef2[_0x345c('0x3f')]);_0x54d78f['filters']=_[_0x345c('0x41')](_0x54d78f[_0x345c('0x3e')],_0x54d78f[_0x345c('0x3f')]);_0x243825[_0x345c('0x42')]=_['intersection'](_0x54d78f[_0x345c('0x3e')],qs[_0x345c('0x43')](_0x2d2ef2['query'][_0x345c('0x43')]));_0x243825[_0x345c('0x42')]=_0x243825[_0x345c('0x42')]['length']?_0x243825[_0x345c('0x42')]:_0x54d78f['model'];if(!_0x2d2ef2[_0x345c('0x3f')]['hasOwnProperty'](_0x345c('0x44'))){_0x243825[_0x345c('0x30')]=qs[_0x345c('0x30')](_0x2d2ef2[_0x345c('0x3f')][_0x345c('0x30')]);_0x243825[_0x345c('0x2e')]=qs[_0x345c('0x2e')](_0x2d2ef2['query'][_0x345c('0x2e')]);}_0x243825[_0x345c('0x45')]=qs[_0x345c('0x46')](_0x2d2ef2[_0x345c('0x3f')][_0x345c('0x46')]);_0x243825[_0x345c('0x47')]=qs[_0x345c('0x48')](_[_0x345c('0x49')](_0x2d2ef2[_0x345c('0x3f')],_0x54d78f[_0x345c('0x48')]),_0x304430);if(_0x2d2ef2[_0x345c('0x3f')][_0x345c('0x4a')]){_0x243825[_0x345c('0x47')]=_[_0x345c('0x4b')](_0x243825[_0x345c('0x47')],{'$or':_[_0x345c('0x38')](_0x304430,function(_0x237a54){if(_0x237a54[_0x345c('0x3c')]!==_0x345c('0x4c')){var _0x1c9310={};_0x1c9310[_0x237a54[_0x345c('0x36')]]={'$like':'%'+_0x2d2ef2[_0x345c('0x3f')][_0x345c('0x4a')]+'%'};return _0x1c9310;}})});}_0x243825=_[_0x345c('0x4b')]({},_0x243825,_0x2d2ef2[_0x345c('0x4d')]);var _0x16b625={'where':_0x243825['where']};return db[_0x345c('0x39')][_0x345c('0x31')](_0x16b625)['then'](function(_0xb2f3cd){_0x54c703[_0x345c('0x31')]=_0xb2f3cd;if(_0x2d2ef2['query'][_0x345c('0x4e')]){_0x243825[_0x345c('0x4f')]=[{'all':!![]}];}return db[_0x345c('0x39')][_0x345c('0x50')](_0x243825);})[_0x345c('0x1f')](function(_0x2f9a29){_0x54c703['rows']=_0x2f9a29;return _0x54c703;})[_0x345c('0x1f')](respondWithFilteredResult(_0x115203,_0x243825))[_0x345c('0x29')](handleError(_0x115203,null));};exports['show']=function(_0x5c521f,_0x2f9393){var _0x49dd2c={'raw':!![],'where':{'id':_0x5c521f[_0x345c('0x51')]['id']}},_0x3f9080={};_0x3f9080[_0x345c('0x3e')]=_[_0x345c('0x40')](db[_0x345c('0x39')][_0x345c('0x3a')]);_0x3f9080[_0x345c('0x3f')]=_['keys'](_0x5c521f[_0x345c('0x3f')]);_0x3f9080[_0x345c('0x48')]=_['intersection'](_0x3f9080[_0x345c('0x3e')],_0x3f9080[_0x345c('0x3f')]);_0x49dd2c[_0x345c('0x42')]=_[_0x345c('0x41')](_0x3f9080[_0x345c('0x3e')],qs[_0x345c('0x43')](_0x5c521f[_0x345c('0x3f')][_0x345c('0x43')]));_0x49dd2c[_0x345c('0x42')]=_0x49dd2c[_0x345c('0x42')][_0x345c('0x52')]?_0x49dd2c['attributes']:_0x3f9080['model'];if(_0x5c521f[_0x345c('0x3f')][_0x345c('0x4e')]){_0x49dd2c[_0x345c('0x4f')]=[{'all':!![]}];}_0x49dd2c=_[_0x345c('0x4b')]({},_0x49dd2c,_0x5c521f[_0x345c('0x4d')]);return db['WhatsappMessage'][_0x345c('0x53')](_0x49dd2c)['then'](handleEntityNotFound(_0x2f9393,null))[_0x345c('0x1f')](respondWithResult(_0x2f9393,null))[_0x345c('0x29')](handleError(_0x2f9393,null));};exports[_0x345c('0x54')]=function(_0x2545d5,_0x102061){return db[_0x345c('0x39')][_0x345c('0x54')](_0x2545d5[_0x345c('0x55')],{})[_0x345c('0x1f')](respondWithResult(_0x102061,0xc9))[_0x345c('0x29')](handleError(_0x102061,null));};exports[_0x345c('0x56')]=function(_0xf78290,_0x15372e){if(_0xf78290[_0x345c('0x55')]['id']){delete _0xf78290[_0x345c('0x55')]['id'];}return db[_0x345c('0x39')][_0x345c('0x53')]({'where':{'id':_0xf78290['params']['id']}})[_0x345c('0x1f')](handleEntityNotFound(_0x15372e,null))['then'](saveUpdates(_0xf78290['body'],null))[_0x345c('0x1f')](respondWithResult(_0x15372e,null))[_0x345c('0x29')](handleError(_0x15372e,null));};exports[_0x345c('0x57')]=function(_0x2f909e,_0xe564ca){return db[_0x345c('0x39')][_0x345c('0x53')]({'where':{'id':_0x2f909e[_0x345c('0x51')]['id']}})[_0x345c('0x1f')](handleEntityNotFound(_0xe564ca,null))[_0x345c('0x1f')](removeEntity(_0xe564ca,null))[_0x345c('0x29')](handleError(_0xe564ca,null));};exports[_0x345c('0x58')]=function(_0xc22e52,_0x11c2b7){return db[_0x345c('0x39')][_0x345c('0x58')]()[_0x345c('0x1f')](respondWithResult(_0x11c2b7,null))[_0x345c('0x29')](handleError(_0x11c2b7,null));};var interaction_log=require(_0x345c('0x12'))(_0x345c('0x59'));exports[_0x345c('0x5a')]=function(_0x53df75,_0x2e0dca,_0x149e49){var _0x514167={'agent':{},'channel':'whatsapp'};if(_0x53df75[_0x345c('0x55')]['id']){delete _0x53df75['body']['id'];}_0x53df75[_0x345c('0x55')]['read']=!![];_0x53df75['body'][_0x345c('0x5b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x53df75['body'][_0x345c('0x5c')]=_0x53df75[_0x345c('0x55')][_0x345c('0x5c')]||_0x53df75[_0x345c('0x5d')]['id'];_0x514167['agent']['id']=_0x53df75[_0x345c('0x55')][_0x345c('0x5c')];return db[_0x345c('0x39')][_0x345c('0x53')]({'where':{'id':_0x53df75['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2e0dca,null))[_0x345c('0x1f')](saveUpdates(_0x53df75[_0x345c('0x55')],null))[_0x345c('0x1f')](function(_0x48b1a7){if(_0x48b1a7){_0x514167['message']=_0x48b1a7[_0x345c('0x5e')]({'plain':!![]});return db[_0x345c('0x5f')][_0x345c('0x53')]({'where':{'id':_0x48b1a7[_0x345c('0x60')]}});}return null;})[_0x345c('0x1f')](handleEntityNotFound(_0x2e0dca,null))[_0x345c('0x1f')](function(_0x80ebb0){if(_0x80ebb0){return _0x80ebb0[_0x345c('0x56')]({'UserId':_0x53df75[_0x345c('0x55')][_0x345c('0x5c')],'read1stAt':_[_0x345c('0x61')](_0x80ebb0[_0x345c('0x62')])?moment()[_0x345c('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x345c('0x1f')](function(_0x999cea){if(_0x999cea){_0x514167[_0x345c('0x64')]=_0x999cea[_0x345c('0x5e')]({'plain':!![]});interaction_log[_0x345c('0x26')](_0x345c('0x65'),_0x53df75[_0x345c('0x5d')]['id'],_0x53df75[_0x345c('0x5d')][_0x345c('0x36')],_0x53df75[_0x345c('0x5d')][_0x345c('0x66')],_0x514167['interaction']['id'],_0x53df75[_0x345c('0x55')]?JSON[_0x345c('0x67')](_0x53df75['body']):_0x345c('0x68'));return respondWithRpcPromise(_0x345c('0x69'),_0x345c('0x6a'),_0x514167);}return null;})[_0x345c('0x1f')](function(_0xd92643){var _0x2304fc=_0x345c('0x6b')+_0xd92643[_0x345c('0x25')][_0x345c('0x6c')];return db[_0x345c('0x6d')][_0x345c('0x3f')](_0x2304fc,{'type':db['Sequelize']['QueryTypes'][_0x345c('0x6e')],'raw':!![]})[_0x345c('0x1f')](function(_0x3f95d3){return _0x3f95d3;});})[_0x345c('0x1f')](function(_0x49dae5){if(_0x49dae5){_0x514167[_0x345c('0x25')][_0x345c('0x6f')]=_0x49dae5[0x0];if(!_0x53df75[_0x345c('0x55')]['UserId'])return;return db[_0x345c('0x70')]['find']({'where':{'id':_0x53df75[_0x345c('0x55')][_0x345c('0x5c')],'role':_0x345c('0x71')},'attributes':['id',_0x345c('0x36'),_0x345c('0x72'),_0x345c('0x73'),_0x345c('0x74')],'raw':!![]});}return null;})[_0x345c('0x1f')](function(_0x2e2932){if(!_0x2e2932)return null;_0x514167[_0x345c('0x25')][_0x345c('0x71')]=_0x2e2932;return _0x514167;})['then'](function(_0x100035){if(_0x100035){if(_0x53df75[_0x345c('0x55')][_0x345c('0x75')]){_0x514167['message'][_0x345c('0x76')]=util[_0x345c('0x63')](_0x345c('0x77'),_0x53df75[_0x345c('0x5d')][_0x345c('0x36')]);_0x514167[_0x345c('0x25')][_0x345c('0x78')]=_0x514167[_0x345c('0x78')];_0x514167[_0x345c('0x25')][_0x345c('0x79')]=_0x514167[_0x345c('0x78')];_0x514167[_0x345c('0x25')][_0x345c('0x7a')]=_0x345c('0x5a');return respondWithRpcPromise(_0x345c('0x7b'),_0x345c('0x7b'),{'event':_0x345c('0x7c'),'message':_0x514167[_0x345c('0x25')]},client9002)[_0x345c('0x1f')](function(){return _0x514167;});}return _0x514167;}return null;})['then'](respondWithResult(_0x2e0dca,null))['catch'](handleError(_0x2e0dca,null));};var interaction_log=require(_0x345c('0x12'))(_0x345c('0x59'));exports['reject']=function(_0x132fe5,_0x38b9b9,_0x275ee1){var _0x3c5d48={'agent':{},'channel':_0x345c('0x7d')};if(_0x132fe5['body']['id']){delete _0x132fe5['body']['id'];}_0x132fe5[_0x345c('0x55')][_0x345c('0x5c')]=_0x132fe5['body'][_0x345c('0x5c')]||_0x132fe5['user']['id'];_0x3c5d48['agent']['id']=_0x132fe5[_0x345c('0x55')][_0x345c('0x5c')];return db['WhatsappMessage']['find']({'where':{'id':_0x132fe5[_0x345c('0x51')]['id'],'UserId':null}})[_0x345c('0x1f')](handleEntityNotFound(_0x38b9b9,null))[_0x345c('0x1f')](function(_0x5a74d1){if(_0x5a74d1){_0x3c5d48['message']=_0x5a74d1['get']({'plain':!![]});return db[_0x345c('0x5f')][_0x345c('0x53')]({'where':{'id':_0x5a74d1['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x38b9b9,null))[_0x345c('0x1f')](function(_0x370e04){if(_0x370e04){_0x3c5d48['interaction']=_0x370e04['get']({'plain':!![]});interaction_log['info'](_0x345c('0x7e'),_0x132fe5[_0x345c('0x5d')]['id'],_0x132fe5[_0x345c('0x5d')][_0x345c('0x36')],_0x132fe5[_0x345c('0x5d')]['role'],_0x3c5d48[_0x345c('0x64')]['id'],_0x132fe5[_0x345c('0x55')]?JSON[_0x345c('0x67')](_0x132fe5['body']):_0x345c('0x68'));return respondWithRpcPromise(_0x345c('0x7f'),'rejectMessage',_0x3c5d48);}return null;})['then'](function(_0x14e3a4){var _0x3e65a7=_0x345c('0x6b')+_0x14e3a4[_0x345c('0x25')][_0x345c('0x6c')];return db[_0x345c('0x6d')]['query'](_0x3e65a7,{'type':db[_0x345c('0x80')][_0x345c('0x81')][_0x345c('0x6e')],'raw':!![]})[_0x345c('0x1f')](function(_0x2e21ca){return _0x2e21ca;});})[_0x345c('0x1f')](function(_0x1ff755){if(_0x1ff755){_0x3c5d48['message'][_0x345c('0x6f')]=_0x1ff755[0x0];if(!_0x132fe5[_0x345c('0x55')][_0x345c('0x5c')])return;return db['User'][_0x345c('0x53')]({'where':{'id':_0x132fe5[_0x345c('0x55')][_0x345c('0x5c')],'role':'agent'},'attributes':['id',_0x345c('0x36'),_0x345c('0x72'),_0x345c('0x73'),_0x345c('0x74')],'raw':!![]});}return null;})[_0x345c('0x1f')](function(_0xce9a34){if(!_0xce9a34)return null;_0x3c5d48[_0x345c('0x25')][_0x345c('0x71')]=_0xce9a34;return _0x3c5d48;})['then'](function(_0x33f50e){if(_0x33f50e){_0x33f50e[_0x345c('0x25')][_0x345c('0x76')]=util[_0x345c('0x63')]('SIP/%s',_0x132fe5[_0x345c('0x5d')]['name']);_0x33f50e[_0x345c('0x25')][_0x345c('0x78')]=_0x3c5d48[_0x345c('0x78')];_0x33f50e[_0x345c('0x25')][_0x345c('0x79')]=_0x3c5d48['channel'];_0x33f50e[_0x345c('0x25')][_0x345c('0x7a')]=_0x345c('0x34');respondWithRpcPromise(_0x345c('0x7b'),_0x345c('0x7b'),{'event':'rejectmessage','message':_0x33f50e['message']},client9002);return _0x3c5d48;}return null;})[_0x345c('0x1f')](respondWithResult(_0x38b9b9,null))['catch'](handleError(_0x38b9b9,null));};exports['status']=function(_0x5b0ebf,_0x39fa2f,_0x41bbcb){if(_0x5b0ebf[_0x345c('0x55')]['id']){delete _0x5b0ebf[_0x345c('0x55')]['id'];}var _0x35d7be;return db[_0x345c('0x39')][_0x345c('0x53')]({'where':{'id':_0x5b0ebf[_0x345c('0x51')]['id']}})[_0x345c('0x1f')](handleEntityNotFound(_0x39fa2f,null))[_0x345c('0x1f')](function(_0x2aede9){if(_0x2aede9){_0x35d7be=_0x2aede9;return db[_0x345c('0x82')][_0x345c('0x53')]({'where':{'id':_0x2aede9[_0x345c('0x83')]}});}})[_0x345c('0x1f')](handleEntityNotFound(_0x39fa2f,null))[_0x345c('0x1f')](function(_0x42da8b){if(_0x42da8b){logger['debug'](_0x345c('0x84'),_0x345c('0x2c'),_0x345c('0x85'),_0x42da8b[_0x345c('0x3c')],util['inspect'](_0x5b0ebf[_0x345c('0x55')],{'showHidden':![],'depth':null}));switch(_0x42da8b['type']){case _0x345c('0x86'):if(_0x5b0ebf['body']['MessageSid']&&_0x5b0ebf[_0x345c('0x55')][_0x345c('0x87')]===_0x35d7be['messageId']&&_0x5b0ebf['body'][_0x345c('0x88')]&&_0x5b0ebf['body']['MessageStatus']===_0x345c('0x89')){return _0x35d7be['update']({'read':!![]});}else{logger[_0x345c('0x23')](_0x345c('0x8a'),_0x345c('0x2c'),_0x345c('0x86'),util[_0x345c('0x8b')](_0x5b0ebf[_0x345c('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x35d7be;}})[_0x345c('0x1f')](respondWithResult(_0x39fa2f,null))[_0x345c('0x29')](handleError(_0x39fa2f,null));};
\ No newline at end of file
index 114cdd5..0253829 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c76=['update','emit','hook','events','../../mysqldb','WhatsappMessage','save'];(function(_0x3ff05b,_0xa1d469){var _0x56868d=function(_0x1bdd39){while(--_0x1bdd39){_0x3ff05b['push'](_0x3ff05b['shift']());}};_0x56868d(++_0xa1d469);}(_0x6c76,0x184));var _0x66c7=function(_0x3b62e4,_0x5272e9){_0x3b62e4=_0x3b62e4-0x0;var _0x2b81c8=_0x6c76[_0x3b62e4];return _0x2b81c8;};'use strict';var EventEmitter=require(_0x66c7('0x0'));var WhatsappMessage=require(_0x66c7('0x1'))['db'][_0x66c7('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x66c7('0x3'),'afterUpdate':_0x66c7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x572a2b){return function(_0x2f6db7,_0x2b7cf3,_0x49d437){WhatsappMessageEvents[_0x66c7('0x5')](_0x572a2b+':'+_0x2f6db7['id'],_0x2f6db7);WhatsappMessageEvents[_0x66c7('0x5')](_0x572a2b,_0x2f6db7);_0x49d437(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x66c7('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
+var _0x51c5=['events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5d0b53,_0x468e95){var _0x26cc5c=function(_0x2a9b1c){while(--_0x2a9b1c){_0x5d0b53['push'](_0x5d0b53['shift']());}};_0x26cc5c(++_0x468e95);}(_0x51c5,0x8f));var _0x551c=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0x51c5[_0x1b4b23];return _0x2a325b;};'use strict';var EventEmitter=require(_0x551c('0x0'));var WhatsappMessage=require(_0x551c('0x1'))['db'][_0x551c('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x551c('0x3')](0x0);var events={'afterCreate':_0x551c('0x4'),'afterUpdate':_0x551c('0x5'),'afterDestroy':_0x551c('0x6')};function emitEvent(_0x5add80){return function(_0x230657,_0x1639d0,_0x28e608){WhatsappMessageEvents[_0x551c('0x7')](_0x5add80+':'+_0x230657['id'],_0x230657);WhatsappMessageEvents[_0x551c('0x7')](_0x5add80,_0x230657);_0x28e608(null);};}for(var e in events){if(events[_0x551c('0x8')](e)){var event=events[e];WhatsappMessage[_0x551c('0x9')](e,emitEvent(event));}}module[_0x551c('0xa')]=WhatsappMessageEvents;
\ No newline at end of file
index ae3500c..9503350 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x886d=['api','moment','bluebird','request-promise','node-fetch','rimraf','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','createdAt','error','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','create','whatsapp:','token','sid','update','catch','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','/whatsapp/v1/','/messages/','text','POST','application/json','statuses','message_id','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x458ba0,_0x47e4d9){var _0x59efd2=function(_0x35b760){while(--_0x35b760){_0x458ba0['push'](_0x458ba0['shift']());}};_0x59efd2(++_0x47e4d9);}(_0x886d,0xe9));var _0xd886=function(_0x263a16,_0x489c01){_0x263a16=_0x263a16-0x0;var _0x251824=_0x886d[_0x263a16];return _0x251824;};'use strict';var _=require(_0xd886('0x0'));var util=require(_0xd886('0x1'));var logger=require(_0xd886('0x2'))(_0xd886('0x3'));var moment=require(_0xd886('0x4'));var BPromise=require(_0xd886('0x5'));var rp=require(_0xd886('0x6'));var fetch=require(_0xd886('0x7'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd886('0x8'));var config=require(_0xd886('0x9'));var attributes=require('./whatsappMessage.attributes');module[_0xd886('0xa')]=function(_0xc6d2dd,_0xfd3ad){return _0xc6d2dd[_0xd886('0xb')](_0xd886('0xc'),attributes,{'tableName':_0xd886('0xd'),'paranoid':![],'indexes':[{'name':_0xd886('0xe'),'fields':['messageId']},{'name':'fti_whatsapp_messages','fields':[_0xd886('0xf')],'type':_0xd886('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2448a9,_0x503bb9,_0x25bdd6){var _0x419d71=_0xc6d2dd[_0xd886('0x11')];var _0x427543=_0x2448a9[_0xd886('0x12')]({'plain':!![]});if(_0x427543[_0xd886('0x13')][_0xd886('0x14')]()==='in'||_0x427543[_0xd886('0x13')]['toLowerCase']()===_0xd886('0x15')&&!_0x427543[_0xd886('0x16')]&&!_[_0xd886('0x17')](_0x427543[_0xd886('0x18')])){_0x419d71[_0xd886('0x19')][_0xd886('0x1a')]({'where':{'id':_0x427543[_0xd886('0x1b')]}})['then'](function(_0x487970){if(_0x487970){_0x487970['update']({'lastMsgAt':_0x427543[_0xd886('0x1c')],'lastMsgDirection':_0x427543[_0xd886('0x13')][_0xd886('0x14')]()});}})['catch'](function(_0x5b7ada){console[_0xd886('0x1d')](_0x5b7ada);});}if(_0x427543[_0xd886('0x13')]===_0xd886('0x15')&&!_0x427543['secret']){var _0x29fa96;_0x419d71[_0xd886('0x1e')][_0xd886('0x1f')]({'where':{'id':_0x427543[_0xd886('0x20')]},'raw':!![]})[_0xd886('0x21')](function(_0x4fd7bb){_0x29fa96=_0x4fd7bb;if(_0x29fa96&&_0x29fa96['type']){switch(_0x29fa96[_0xd886('0x22')]){case'twilio':var _0x20e0b9=require(_0xd886('0x23'));if(_0x29fa96[_0xd886('0x24')]&&_0x29fa96[_0xd886('0x25')]&&_0x29fa96[_0xd886('0x26')]){var _0x2e91df=new _0x20e0b9(_0x29fa96['accountSid'],_0x29fa96['authToken']);_0x2e91df['messages'][_0xd886('0x27')]({'body':_0x427543[_0xd886('0xf')],'to':_0xd886('0x28')+_0x427543['phone'],'from':_0xd886('0x28')+_0x29fa96[_0xd886('0x26')],'statusCallback':_0x29fa96['remote']+'/api/whatsapp/messages/'+_0x427543['id']+'/status?token='+_0x29fa96[_0xd886('0x29')]})[_0xd886('0x21')](function(_0x1f10a1){if(_0x1f10a1[_0xd886('0x2a')]){return _0x2448a9[_0xd886('0x2b')]({'messageId':_0x1f10a1['sid']});}})[_0xd886('0x2c')](function(_0x27c5da){logger[_0xd886('0x1d')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xd886('0x2d'),_0xd886('0x23'),util[_0xd886('0x2e')](_0x27c5da,{'showHidden':![],'depth':null}));});}else{logger[_0xd886('0x1d')](_0xd886('0x2f'),_0xd886('0x2d'),_0xd886('0x23'),_0xd886('0x30'));}break;case'sinch':var _0x28185f=_0x29fa96['accountSid'];var _0x86cb4a=_0x29fa96['authToken'];var _0x29fac3=_0x29fa96['baseUrl']+_0xd886('0x31')+_0x28185f+_0xd886('0x32');var _0x3ebdb2={'to':[_0x427543['phone']],'message':{'type':_0xd886('0x33'),'text':_0x427543[_0xd886('0xf')]}};var _0xfc7325={'method':_0xd886('0x34'),'uri':_0x29fac3,'headers':{'Authorization':'Bearer\x20'+_0x86cb4a,'Content-Type':_0xd886('0x35')},'body':_0x3ebdb2,'json':!![]};rp(_0xfc7325)['then'](function(_0x22f4fa){if(_0x22f4fa[_0xd886('0x36')][0x0][_0xd886('0x37')]){return _0x2448a9[_0xd886('0x2b')]({'messageId':_0x22f4fa[_0xd886('0x36')][0x0][_0xd886('0x37')]});}})['catch'](function(_0x168a4e){logger['err'](_0xd886('0x38'),_0x168a4e);});break;}}})['finally'](function(){_0x25bdd6();});}else{_0x25bdd6();}}},'charset':_0xd886('0x39'),'collate':_0xd886('0x3a')});};
\ No newline at end of file
+var _0x4520=['authToken','phone','messages','create','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','then','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/messages/','POST','Bearer\x20','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','lodash','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','WhatsappInteractionId','update','catch','error','out','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid'];(function(_0x46c5c0,_0x2e8062){var _0x3234b9=function(_0x3dd293){while(--_0x3dd293){_0x46c5c0['push'](_0x46c5c0['shift']());}};_0x3234b9(++_0x2e8062);}(_0x4520,0x8e));var _0x0452=function(_0x450689,_0x3b857c){_0x450689=_0x450689-0x0;var _0x46ffb0=_0x4520[_0x450689];return _0x46ffb0;};'use strict';var _=require(_0x0452('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x0452('0x1'));var BPromise=require(_0x0452('0x2'));var rp=require(_0x0452('0x3'));var fetch=require(_0x0452('0x4'));var fs=require('fs');var path=require(_0x0452('0x5'));var rimraf=require(_0x0452('0x6'));var config=require(_0x0452('0x7'));var attributes=require('./whatsappMessage.attributes');module[_0x0452('0x8')]=function(_0x4e1028,_0x236a63){return _0x4e1028[_0x0452('0x9')]('WhatsappMessage',attributes,{'tableName':_0x0452('0xa'),'paranoid':![],'indexes':[{'name':_0x0452('0xb'),'fields':['messageId']},{'name':_0x0452('0xc'),'fields':['body'],'type':_0x0452('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1958e1,_0x1bf150,_0x39e8bb){var _0x50ead2=_0x4e1028[_0x0452('0xe')];var _0x128403=_0x1958e1[_0x0452('0xf')]({'plain':!![]});if(_0x128403[_0x0452('0x10')][_0x0452('0x11')]()==='in'||_0x128403[_0x0452('0x10')]['toLowerCase']()==='out'&&!_0x128403[_0x0452('0x12')]&&!_[_0x0452('0x13')](_0x128403[_0x0452('0x14')])){_0x50ead2['WhatsappInteraction']['findOne']({'where':{'id':_0x128403[_0x0452('0x15')]}})['then'](function(_0xbc2e26){if(_0xbc2e26){_0xbc2e26[_0x0452('0x16')]({'lastMsgAt':_0x128403['createdAt'],'lastMsgDirection':_0x128403['direction']['toLowerCase']()});}})[_0x0452('0x17')](function(_0x8f047a){console[_0x0452('0x18')](_0x8f047a);});}if(_0x128403[_0x0452('0x10')]===_0x0452('0x19')&&!_0x128403[_0x0452('0x12')]){var _0x11029a;_0x50ead2[_0x0452('0x1a')][_0x0452('0x1b')]({'where':{'id':_0x128403[_0x0452('0x1c')]},'raw':!![]})['then'](function(_0x159b2b){_0x11029a=_0x159b2b;if(_0x11029a&&_0x11029a[_0x0452('0x1d')]){switch(_0x11029a[_0x0452('0x1d')]){case _0x0452('0x1e'):var _0x309ee9=require('twilio');if(_0x11029a[_0x0452('0x1f')]&&_0x11029a[_0x0452('0x20')]&&_0x11029a[_0x0452('0x21')]){var _0x212d45=new _0x309ee9(_0x11029a[_0x0452('0x1f')],_0x11029a[_0x0452('0x20')]);_0x212d45[_0x0452('0x22')][_0x0452('0x23')]({'body':_0x128403[_0x0452('0x24')],'to':_0x0452('0x25')+_0x128403[_0x0452('0x21')],'from':_0x0452('0x25')+_0x11029a[_0x0452('0x21')],'statusCallback':_0x11029a[_0x0452('0x26')]+_0x0452('0x27')+_0x128403['id']+_0x0452('0x28')+_0x11029a[_0x0452('0x29')]})[_0x0452('0x2a')](function(_0x57e82){if(_0x57e82[_0x0452('0x2b')]){return _0x1958e1[_0x0452('0x16')]({'messageId':_0x57e82[_0x0452('0x2b')]});}})[_0x0452('0x17')](function(_0x50f3e8){logger[_0x0452('0x18')](_0x0452('0x2c'),_0x0452('0x2d'),_0x0452('0x1e'),util['inspect'](_0x50f3e8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x0452('0x2c'),'afterCreate',_0x0452('0x1e'),_0x0452('0x2e'));}break;case _0x0452('0x2f'):var _0x142bcb=_0x11029a[_0x0452('0x1f')];var _0x224e9e=_0x11029a[_0x0452('0x20')];var _0x39c514=_0x11029a[_0x0452('0x30')]+'/whatsapp/v1/'+_0x142bcb+_0x0452('0x31');var _0x5b1f11={'to':[_0x128403[_0x0452('0x21')]],'message':{'type':'text','text':_0x128403[_0x0452('0x24')]}};var _0x1e54a1={'method':_0x0452('0x32'),'uri':_0x39c514,'headers':{'Authorization':_0x0452('0x33')+_0x224e9e,'Content-Type':'application/json'},'body':_0x5b1f11,'json':!![]};rp(_0x1e54a1)['then'](function(_0x5ee4a8){if(_0x5ee4a8[_0x0452('0x34')][0x0][_0x0452('0x35')]){return _0x1958e1[_0x0452('0x16')]({'messageId':_0x5ee4a8[_0x0452('0x34')][0x0][_0x0452('0x35')]});}})['catch'](function(_0x4de4f6){logger[_0x0452('0x36')](_0x0452('0x37'),_0x4de4f6);});break;}}})[_0x0452('0x38')](function(){_0x39e8bb();});}else{_0x39e8bb();}}},'charset':'utf8mb4','collate':_0x0452('0x39')});};
\ No newline at end of file
index f5a5589..8b2f0c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a0d=['WhatsappMessage,\x20%s,\x20%s','message','result','CreateWhatsappMessage','WhatsappMessage','body','options','raw','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./whatsappMessage.socket','register','request','then','info','request\x20sent','debug','stringify','code','error'];(function(_0x442742,_0x48b721){var _0xbbcc18=function(_0x21a463){while(--_0x21a463){_0x442742['push'](_0x442742['shift']());}};_0xbbcc18(++_0x48b721);}(_0x3a0d,0x69));var _0xd3a0=function(_0x284814,_0x2b42cd){_0x284814=_0x284814-0x0;var _0x566cde=_0x3a0d[_0x284814];return _0x566cde;};'use strict';var _=require(_0xd3a0('0x0'));var util=require('util');var moment=require(_0xd3a0('0x1'));var BPromise=require('bluebird');var rs=require(_0xd3a0('0x2'));var fs=require('fs');var Redis=require(_0xd3a0('0x3'));var db=require(_0xd3a0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd3a0('0x5'))(_0xd3a0('0x6'));var config=require(_0xd3a0('0x7'));var jayson=require(_0xd3a0('0x8'));var client=jayson[_0xd3a0('0x9')][_0xd3a0('0xa')]({'port':0x232a});config[_0xd3a0('0xb')]=_['defaults'](config[_0xd3a0('0xb')],{'host':_0xd3a0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd3a0('0xb')]));require(_0xd3a0('0xd'))[_0xd3a0('0xe')](socket);function respondWithRpcPromise(_0x2fc45f,_0x923041,_0x2b48cb){return new BPromise(function(_0x14ef18,_0x10f578){return client[_0xd3a0('0xf')](_0x2fc45f,_0x2b48cb)[_0xd3a0('0x10')](function(_0x3e95fb){logger[_0xd3a0('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x923041,_0xd3a0('0x12'));logger[_0xd3a0('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x923041,'request\x20sent',JSON[_0xd3a0('0x14')](_0x3e95fb));if(_0x3e95fb['error']){if(_0x3e95fb['error'][_0xd3a0('0x15')]===0x1f4){logger[_0xd3a0('0x16')](_0xd3a0('0x17'),_0x923041,_0x3e95fb[_0xd3a0('0x16')][_0xd3a0('0x18')]);return _0x10f578(_0x3e95fb[_0xd3a0('0x16')][_0xd3a0('0x18')]);}logger[_0xd3a0('0x16')](_0xd3a0('0x17'),_0x923041,_0x3e95fb[_0xd3a0('0x16')]['message']);return _0x14ef18(_0x3e95fb['error'][_0xd3a0('0x18')]);}else{logger[_0xd3a0('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x923041,_0xd3a0('0x12'));_0x14ef18(_0x3e95fb[_0xd3a0('0x19')][_0xd3a0('0x18')]);}})['catch'](function(_0x3f8202){logger['error'](_0xd3a0('0x17'),_0x923041,_0x3f8202);_0x10f578(_0x3f8202);});});}exports[_0xd3a0('0x1a')]=function(_0x547c84){var _0x373d9d=this;return new Promise(function(_0x1b398c,_0x2fe670){return db[_0xd3a0('0x1b')]['create'](_0x547c84[_0xd3a0('0x1c')],{'raw':_0x547c84[_0xd3a0('0x1d')]?_0x547c84[_0xd3a0('0x1d')][_0xd3a0('0x1e')]===undefined?!![]:![]:!![]})[_0xd3a0('0x10')](function(_0x508d0d){logger['info'](_0xd3a0('0x1a'),_0x547c84);logger[_0xd3a0('0x13')](_0xd3a0('0x1a'),_0x547c84,JSON[_0xd3a0('0x14')](_0x508d0d));_0x1b398c(_0x508d0d);})[_0xd3a0('0x1f')](function(_0x1ec4ce){logger[_0xd3a0('0x16')](_0xd3a0('0x1a'),_0x1ec4ce[_0xd3a0('0x18')],_0x547c84);_0x2fe670(_0x373d9d[_0xd3a0('0x16')](0x1f4,_0x1ec4ce['message']));});});};
\ No newline at end of file
+var _0xb81c=['CreateWhatsappMessage','WhatsappMessage','create','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb81c,0x15a));var _0xcb81=function(_0xe37b9e,_0x358311){_0xe37b9e=_0xe37b9e-0x0;var _0x3f9512=_0xb81c[_0xe37b9e];return _0x3f9512;};'use strict';var _=require('lodash');var util=require(_0xcb81('0x0'));var moment=require(_0xcb81('0x1'));var BPromise=require(_0xcb81('0x2'));var rs=require(_0xcb81('0x3'));var fs=require('fs');var Redis=require(_0xcb81('0x4'));var db=require(_0xcb81('0x5'))['db'];var utils=require(_0xcb81('0x6'));var logger=require(_0xcb81('0x7'))(_0xcb81('0x8'));var config=require(_0xcb81('0x9'));var jayson=require(_0xcb81('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xcb81('0xb')]=_[_0xcb81('0xc')](config['redis'],{'host':_0xcb81('0xd'),'port':0x18eb});var socket=require(_0xcb81('0xe'))(new Redis(config[_0xcb81('0xb')]));require('./whatsappMessage.socket')[_0xcb81('0xf')](socket);function respondWithRpcPromise(_0x202d26,_0x4ce134,_0x39d994){return new BPromise(function(_0x4bfc64,_0x2694a7){return client['request'](_0x202d26,_0x39d994)[_0xcb81('0x10')](function(_0xb0938c){logger['info'](_0xcb81('0x11'),_0x4ce134,'request\x20sent');logger[_0xcb81('0x12')](_0xcb81('0x13'),_0x4ce134,'request\x20sent',JSON[_0xcb81('0x14')](_0xb0938c));if(_0xb0938c['error']){if(_0xb0938c['error']['code']===0x1f4){logger[_0xcb81('0x15')](_0xcb81('0x11'),_0x4ce134,_0xb0938c[_0xcb81('0x15')][_0xcb81('0x16')]);return _0x2694a7(_0xb0938c[_0xcb81('0x15')]['message']);}logger[_0xcb81('0x15')](_0xcb81('0x11'),_0x4ce134,_0xb0938c[_0xcb81('0x15')][_0xcb81('0x16')]);return _0x4bfc64(_0xb0938c['error']['message']);}else{logger[_0xcb81('0x17')](_0xcb81('0x11'),_0x4ce134,_0xcb81('0x18'));_0x4bfc64(_0xb0938c['result'][_0xcb81('0x16')]);}})[_0xcb81('0x19')](function(_0x35ccc4){logger['error'](_0xcb81('0x11'),_0x4ce134,_0x35ccc4);_0x2694a7(_0x35ccc4);});});}exports[_0xcb81('0x1a')]=function(_0x3a93fe){var _0x3ba098=this;return new Promise(function(_0x10c7e2,_0x14c0df){return db[_0xcb81('0x1b')][_0xcb81('0x1c')](_0x3a93fe['body'],{'raw':_0x3a93fe[_0xcb81('0x1d')]?_0x3a93fe[_0xcb81('0x1d')][_0xcb81('0x1e')]===undefined?!![]:![]:!![]})[_0xcb81('0x10')](function(_0x3dac2e){logger[_0xcb81('0x17')](_0xcb81('0x1a'),_0x3a93fe);logger[_0xcb81('0x12')]('CreateWhatsappMessage',_0x3a93fe,JSON[_0xcb81('0x14')](_0x3dac2e));_0x10c7e2(_0x3dac2e);})[_0xcb81('0x19')](function(_0x54f6ba){logger['error'](_0xcb81('0x1a'),_0x54f6ba['message'],_0x3a93fe);_0x14c0df(_0x3ba098['error'](0x1f4,_0x54f6ba['message']));});});};
\ No newline at end of file
index 99d38f0..af7bf17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55c2=['length','./whatsappMessage.events','save','remove','emit','removeListener','register'];(function(_0xb89d17,_0x6dce23){var _0x6a4b8a=function(_0x4de8a7){while(--_0x4de8a7){_0xb89d17['push'](_0xb89d17['shift']());}};_0x6a4b8a(++_0x6dce23);}(_0x55c2,0xc5));var _0x255c=function(_0x51ea1b,_0x1c5a3b){_0x51ea1b=_0x51ea1b-0x0;var _0x56d914=_0x55c2[_0x51ea1b];return _0x56d914;};'use strict';var WhatsappMessageEvents=require(_0x255c('0x0'));var events=[_0x255c('0x1'),_0x255c('0x2'),'update'];function createListener(_0x2cb02e,_0x9428e5){return function(_0x574d8c){_0x9428e5[_0x255c('0x3')](_0x2cb02e,_0x574d8c);};}function removeListener(_0x3bf628,_0x3829a5){return function(){WhatsappMessageEvents[_0x255c('0x4')](_0x3bf628,_0x3829a5);};}exports[_0x255c('0x5')]=function(_0x3fdb1b){for(var _0x4edb23=0x0,_0x58e670=events[_0x255c('0x6')];_0x4edb23<_0x58e670;_0x4edb23++){var _0x355030=events[_0x4edb23];var _0x5a36c1=createListener('whatsappMessage:'+_0x355030,_0x3fdb1b);WhatsappMessageEvents['on'](_0x355030,_0x5a36c1);}};
\ No newline at end of file
+var _0x47d0=['register','./whatsappMessage.events','save','update','removeListener'];(function(_0x56d728,_0x1e0c30){var _0x5c6a0f=function(_0xc6b380){while(--_0xc6b380){_0x56d728['push'](_0x56d728['shift']());}};_0x5c6a0f(++_0x1e0c30);}(_0x47d0,0x11e));var _0x047d=function(_0x3b48a0,_0x21ad3f){_0x3b48a0=_0x3b48a0-0x0;var _0x2b3a2c=_0x47d0[_0x3b48a0];return _0x2b3a2c;};'use strict';var WhatsappMessageEvents=require(_0x047d('0x0'));var events=[_0x047d('0x1'),'remove',_0x047d('0x2')];function createListener(_0xc8f77d,_0x5b1e43){return function(_0x307c37){_0x5b1e43['emit'](_0xc8f77d,_0x307c37);};}function removeListener(_0x233a39,_0x6ca9f8){return function(){WhatsappMessageEvents[_0x047d('0x3')](_0x233a39,_0x6ca9f8);};}exports[_0x047d('0x4')]=function(_0x1ccadf){for(var _0xbd268d=0x0,_0x599e17=events['length'];_0xbd268d<_0x599e17;_0xbd268d++){var _0x2f8e99=events[_0xbd268d];var _0x1d009b=createListener('whatsappMessage:'+_0x2f8e99,_0x1ccadf);WhatsappMessageEvents['on'](_0x2f8e99,_0x1d009b);}};
\ No newline at end of file
index ee04e40..a057d3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd40d=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','put','delete','destroy','removeTeams','/:id/users','removeAgents','util'];(function(_0x3dddb9,_0x3b2f73){var _0x4df584=function(_0x1b839f){while(--_0x1b839f){_0x3dddb9['push'](_0x3dddb9['shift']());}};_0x4df584(++_0x3b2f73);}(_0xd40d,0x179));var _0xdd40=function(_0x150d9b,_0x4b5dd2){_0x150d9b=_0x150d9b-0x0;var _0x435aee=_0xd40d[_0x150d9b];return _0x435aee;};'use strict';var multer=require('multer');var util=require(_0xdd40('0x0'));var path=require(_0xdd40('0x1'));var timeout=require(_0xdd40('0x2'));var express=require('express');var router=express[_0xdd40('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdd40('0x4'));var interaction=require(_0xdd40('0x5'));var config=require('../../config/environment');var controller=require('./whatsappQueue.controller');router[_0xdd40('0x6')]('/',auth[_0xdd40('0x7')](),controller[_0xdd40('0x8')]);router[_0xdd40('0x6')](_0xdd40('0x9'),auth[_0xdd40('0x7')](),controller[_0xdd40('0xa')]);router[_0xdd40('0x6')](_0xdd40('0xb'),auth[_0xdd40('0x7')](),controller[_0xdd40('0xc')]);router[_0xdd40('0x6')](_0xdd40('0xd'),auth[_0xdd40('0x7')](),controller[_0xdd40('0xe')]);router['get'](_0xdd40('0xf'),auth[_0xdd40('0x7')](),controller[_0xdd40('0x10')]);router[_0xdd40('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0xdd40('0x11')]);router[_0xdd40('0x12')]('/',auth[_0xdd40('0x7')](),controller[_0xdd40('0x13')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0xdd40('0x14')]);router[_0xdd40('0x12')]('/:id/users',auth[_0xdd40('0x7')](),controller['addAgents']);router[_0xdd40('0x15')](_0xdd40('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xdd40('0x16')](_0xdd40('0xb'),auth[_0xdd40('0x7')](),controller[_0xdd40('0x17')]);router['delete'](_0xdd40('0xf'),auth[_0xdd40('0x7')](),controller[_0xdd40('0x18')]);router[_0xdd40('0x16')](_0xdd40('0x19'),auth['isAuthenticated'](),controller[_0xdd40('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x3b7e=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','index','isAuthenticated','/:id','show'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x3b7e,0xd7));var _0xe3b7=function(_0x44d873,_0x5b93f3){_0x44d873=_0x44d873-0x0;var _0x49631c=_0x3b7e[_0x44d873];return _0x49631c;};'use strict';var multer=require(_0xe3b7('0x0'));var util=require(_0xe3b7('0x1'));var path=require(_0xe3b7('0x2'));var timeout=require(_0xe3b7('0x3'));var express=require(_0xe3b7('0x4'));var router=express[_0xe3b7('0x5')]();var fs_extra=require(_0xe3b7('0x6'));var auth=require(_0xe3b7('0x7'));var interaction=require(_0xe3b7('0x8'));var config=require(_0xe3b7('0x9'));var controller=require(_0xe3b7('0xa'));router[_0xe3b7('0xb')]('/',auth['isAuthenticated'](),controller[_0xe3b7('0xc')]);router[_0xe3b7('0xb')]('/describe',auth[_0xe3b7('0xd')](),controller['describe']);router[_0xe3b7('0xb')](_0xe3b7('0xe'),auth[_0xe3b7('0xd')](),controller[_0xe3b7('0xf')]);router[_0xe3b7('0xb')](_0xe3b7('0x10'),auth[_0xe3b7('0xd')](),controller[_0xe3b7('0x11')]);router['get'](_0xe3b7('0x12'),auth[_0xe3b7('0xd')](),controller[_0xe3b7('0x13')]);router[_0xe3b7('0xb')](_0xe3b7('0x14'),auth['isAuthenticated'](),controller[_0xe3b7('0x15')]);router[_0xe3b7('0x16')]('/',auth[_0xe3b7('0xd')](),controller[_0xe3b7('0x17')]);router[_0xe3b7('0x16')](_0xe3b7('0x12'),auth[_0xe3b7('0xd')](),controller[_0xe3b7('0x18')]);router['post'](_0xe3b7('0x14'),auth[_0xe3b7('0xd')](),controller[_0xe3b7('0x19')]);router[_0xe3b7('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0xe3b7('0x1b')]);router[_0xe3b7('0x1c')](_0xe3b7('0xe'),auth[_0xe3b7('0xd')](),controller[_0xe3b7('0x1d')]);router[_0xe3b7('0x1c')](_0xe3b7('0x12'),auth['isAuthenticated'](),controller[_0xe3b7('0x1e')]);router[_0xe3b7('0x1c')](_0xe3b7('0x14'),auth[_0xe3b7('0xd')](),controller[_0xe3b7('0x1f')]);module[_0xe3b7('0x20')]=router;
\ No newline at end of file
index 9a1cc5f..4d8fe31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3b4=['ENUM','rrmemory','roundrobin','sequelize','name','INTEGER'];(function(_0x13669a,_0xafff9d){var _0x57e0c0=function(_0x37c3bf){while(--_0x37c3bf){_0x13669a['push'](_0x13669a['shift']());}};_0x57e0c0(++_0xafff9d);}(_0xd3b4,0x1e9));var _0x4d3b=function(_0x5d2f68,_0x369501){_0x5d2f68=_0x5d2f68-0x0;var _0x1e7027=_0xd3b4[_0x5d2f68];return _0x1e7027;};'use strict';var Sequelize=require(_0x4d3b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4d3b('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x4d3b('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4d3b('0x3')](_0x4d3b('0x4'),'beepall',_0x4d3b('0x5'))},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xbefe=['exports','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','STRING'];(function(_0x24bac6,_0x410c64){var _0x2fed43=function(_0x10b8d0){while(--_0x10b8d0){_0x24bac6['push'](_0x24bac6['shift']());}};_0x2fed43(++_0x410c64);}(_0xbefe,0x168));var _0xebef=function(_0x1a2ac5,_0x431ac7){_0x1a2ac5=_0x1a2ac5-0x0;var _0x2cedd0=_0xbefe[_0x1a2ac5];return _0x2cedd0;};'use strict';var Sequelize=require('sequelize');module[_0xebef('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xebef('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xebef('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xebef('0x3')](_0xebef('0x4'),_0xebef('0x5'),_0xebef('0x6'))},'description':{'type':Sequelize[_0xebef('0x7')]}};
\ No newline at end of file
index 240379a..0397bbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc90=['request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','UserProfileResource','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','WhatsappQueue','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','WhatsappQueues','UserProfileSection','userProfileId','describe','findOne','sort','WhatsappQueueId','UserWhatsappQueue','findAll','User','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','compact','value','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf'];(function(_0x53b049,_0x56fa0b){var _0x54302b=function(_0x37c88e){while(--_0x37c88e){_0x53b049['push'](_0x53b049['shift']());}};_0x54302b(++_0x56fa0b);}(_0xfc90,0x196));var _0x0fc9=function(_0x34de22,_0x59cba7){_0x34de22=_0x34de22-0x0;var _0x40434c=_0xfc90[_0x34de22];return _0x40434c;};'use strict';var emlformat=require(_0x0fc9('0x0'));var rimraf=require(_0x0fc9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0fc9('0x2'));var moment=require(_0x0fc9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0fc9('0x4'));var util=require(_0x0fc9('0x5'));var path=require(_0x0fc9('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0fc9('0x7'));var fs=require('fs');var fs_extra=require(_0x0fc9('0x8'));var _=require(_0x0fc9('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0fc9('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0fc9('0xb'));var querystring=require('querystring');var Papa=require(_0x0fc9('0xc'));var Redis=require(_0x0fc9('0xd'));var authService=require(_0x0fc9('0xe'));var qs=require(_0x0fc9('0xf'));var as=require(_0x0fc9('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0fc9('0x11'));var utils=require(_0x0fc9('0x12'));var config=require(_0x0fc9('0x13'));var licenseUtil=require(_0x0fc9('0x14'));var db=require(_0x0fc9('0x15'))['db'];config['redis']=_[_0x0fc9('0x16')](config[_0x0fc9('0x17')],{'host':_0x0fc9('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0fc9('0x17')]));require('./whatsappQueue.socket')[_0x0fc9('0x19')](socket);function respondWithStatusCode(_0x284978,_0x337447){_0x337447=_0x337447||0xcc;return function(_0x5eb0cd){if(_0x5eb0cd){return _0x284978['sendStatus'](_0x337447);}return _0x284978[_0x0fc9('0x1a')](_0x337447)[_0x0fc9('0x1b')]();};}function respondWithResult(_0x58b860,_0x4335c2){_0x4335c2=_0x4335c2||0xc8;return function(_0x3f128a){if(_0x3f128a){return _0x58b860[_0x0fc9('0x1a')](_0x4335c2)[_0x0fc9('0x1c')](_0x3f128a);}};}function respondWithFilteredResult(_0x204936,_0x279ddb){return function(_0x5bed26){if(_0x5bed26){var _0x434fc6=typeof _0x279ddb['offset']==='undefined'&&typeof _0x279ddb[_0x0fc9('0x1d')]==='undefined';var _0x5520f7=_0x5bed26['count'];var _0x294594=_0x434fc6?0x0:_0x279ddb['offset'];var _0x2a97f9=_0x434fc6?_0x5bed26[_0x0fc9('0x1e')]:_0x279ddb[_0x0fc9('0x1f')]+_0x279ddb[_0x0fc9('0x1d')];var _0x47979b;if(_0x2a97f9>=_0x5520f7){_0x2a97f9=_0x5520f7;_0x47979b=0xc8;}else{_0x47979b=0xce;}_0x204936[_0x0fc9('0x1a')](_0x47979b);return _0x204936[_0x0fc9('0x20')](_0x0fc9('0x21'),_0x294594+'-'+_0x2a97f9+'/'+_0x5520f7)['json'](_0x5bed26);}return null;};}function patchUpdates(_0x294f94){return function(_0x3a9cca){try{jsonpatch[_0x0fc9('0x22')](_0x3a9cca,_0x294f94,!![]);}catch(_0x22a645){return BPromise[_0x0fc9('0x23')](_0x22a645);}return _0x3a9cca[_0x0fc9('0x24')]();};}function saveUpdates(_0x11c78c,_0x2cb4a5){return function(_0x16f845){if(_0x16f845){return _0x16f845[_0x0fc9('0x25')](_0x11c78c)['then'](function(_0x221d48){return _0x221d48;});}return null;};}function removeEntity(_0xa8cdd4,_0x26e81e){return function(_0x1917db){if(_0x1917db){return _0x1917db[_0x0fc9('0x26')]()['then'](function(){var _0x3f57c0=_0x1917db['get']({'plain':!![]});var _0x47645f='WhatsappQueues';return db[_0x0fc9('0x27')]['destroy']({'where':{'type':_0x47645f,'resourceId':_0x3f57c0['id']}})[_0x0fc9('0x28')](function(){return _0x1917db;});})['then'](function(){_0xa8cdd4[_0x0fc9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53c6ef,_0x16ea75){return function(_0x384654){if(!_0x384654){_0x53c6ef[_0x0fc9('0x29')](0x194);}return _0x384654;};}function handleError(_0x50c79c,_0x5ca87b){_0x5ca87b=_0x5ca87b||0x1f4;return function(_0x5e3722){logger[_0x0fc9('0x2a')](_0x5e3722[_0x0fc9('0x2b')]);if(_0x5e3722[_0x0fc9('0x2c')]){delete _0x5e3722[_0x0fc9('0x2c')];}_0x50c79c[_0x0fc9('0x1a')](_0x5ca87b)[_0x0fc9('0x2d')](_0x5e3722);};}exports[_0x0fc9('0x2e')]=function(_0xb71dc,_0x2485c7){var _0x367b82={},_0x551c3e={},_0x599e4c={'count':0x0,'rows':[]};var _0x441248=_[_0x0fc9('0x2f')](db['WhatsappQueue'][_0x0fc9('0x30')],function(_0x27f079){return{'name':_0x27f079['fieldName'],'type':_0x27f079[_0x0fc9('0x31')][_0x0fc9('0x32')]};});_0x551c3e['model']=_[_0x0fc9('0x2f')](_0x441248,'name');_0x551c3e[_0x0fc9('0x33')]=_[_0x0fc9('0x34')](_0xb71dc[_0x0fc9('0x33')]);_0x551c3e[_0x0fc9('0x35')]=_[_0x0fc9('0x36')](_0x551c3e[_0x0fc9('0x37')],_0x551c3e[_0x0fc9('0x33')]);_0x367b82[_0x0fc9('0x38')]=_[_0x0fc9('0x36')](_0x551c3e[_0x0fc9('0x37')],qs[_0x0fc9('0x39')](_0xb71dc['query'][_0x0fc9('0x39')]));_0x367b82[_0x0fc9('0x38')]=_0x367b82[_0x0fc9('0x38')][_0x0fc9('0x3a')]?_0x367b82['attributes']:_0x551c3e[_0x0fc9('0x37')];if(!_0xb71dc[_0x0fc9('0x33')][_0x0fc9('0x3b')](_0x0fc9('0x3c'))){_0x367b82[_0x0fc9('0x1d')]=qs[_0x0fc9('0x1d')](_0xb71dc[_0x0fc9('0x33')]['limit']);_0x367b82[_0x0fc9('0x1f')]=qs[_0x0fc9('0x1f')](_0xb71dc[_0x0fc9('0x33')][_0x0fc9('0x1f')]);}_0x367b82[_0x0fc9('0x3d')]=qs['sort'](_0xb71dc[_0x0fc9('0x33')]['sort']);_0x367b82['where']=qs[_0x0fc9('0x35')](_[_0x0fc9('0x3e')](_0xb71dc[_0x0fc9('0x33')],_0x551c3e[_0x0fc9('0x35')]),_0x441248);if(_0xb71dc[_0x0fc9('0x33')][_0x0fc9('0x3f')]){_0x367b82[_0x0fc9('0x40')]=_[_0x0fc9('0x41')](_0x367b82[_0x0fc9('0x40')],{'$or':_['map'](_0x441248,function(_0x215243){if(_0x215243[_0x0fc9('0x31')]!=='VIRTUAL'){var _0x16e1b9={};_0x16e1b9[_0x215243[_0x0fc9('0x2c')]]={'$like':'%'+_0xb71dc[_0x0fc9('0x33')]['filter']+'%'};return _0x16e1b9;}})});}_0x367b82=_[_0x0fc9('0x41')]({},_0x367b82,_0xb71dc[_0x0fc9('0x42')]);var _0x35c1a8={'where':_0x367b82['where']};return db['WhatsappQueue'][_0x0fc9('0x1e')](_0x35c1a8)[_0x0fc9('0x28')](function(_0x2540fd){_0x599e4c['count']=_0x2540fd;if(_0xb71dc[_0x0fc9('0x33')][_0x0fc9('0x43')]){_0x367b82[_0x0fc9('0x44')]=[{'all':!![]}];}return db['WhatsappQueue']['findAll'](_0x367b82);})[_0x0fc9('0x28')](function(_0x153af0){_0x599e4c[_0x0fc9('0x45')]=_0x153af0;return _0x599e4c;})[_0x0fc9('0x28')](respondWithFilteredResult(_0x2485c7,_0x367b82))[_0x0fc9('0x46')](handleError(_0x2485c7,null));};exports[_0x0fc9('0x47')]=function(_0x40e903,_0x20455e){var _0x98f1f={'raw':!![],'where':{'id':_0x40e903[_0x0fc9('0x48')]['id']}},_0x44db02={};_0x44db02['model']=_[_0x0fc9('0x34')](db[_0x0fc9('0x49')][_0x0fc9('0x30')]);_0x44db02[_0x0fc9('0x33')]=_[_0x0fc9('0x34')](_0x40e903[_0x0fc9('0x33')]);_0x44db02[_0x0fc9('0x35')]=_[_0x0fc9('0x36')](_0x44db02[_0x0fc9('0x37')],_0x44db02['query']);_0x98f1f[_0x0fc9('0x38')]=_[_0x0fc9('0x36')](_0x44db02[_0x0fc9('0x37')],qs[_0x0fc9('0x39')](_0x40e903[_0x0fc9('0x33')][_0x0fc9('0x39')]));_0x98f1f[_0x0fc9('0x38')]=_0x98f1f['attributes'][_0x0fc9('0x3a')]?_0x98f1f['attributes']:_0x44db02[_0x0fc9('0x37')];if(_0x40e903['query'][_0x0fc9('0x43')]){_0x98f1f[_0x0fc9('0x44')]=[{'all':!![]}];}_0x98f1f=_['merge']({},_0x98f1f,_0x40e903[_0x0fc9('0x42')]);return db[_0x0fc9('0x49')][_0x0fc9('0x4a')](_0x98f1f)['then'](handleEntityNotFound(_0x20455e,null))[_0x0fc9('0x28')](respondWithResult(_0x20455e,null))[_0x0fc9('0x46')](handleError(_0x20455e,null));};exports[_0x0fc9('0x4b')]=function(_0x4725ed,_0x1b8546){return db[_0x0fc9('0x49')][_0x0fc9('0x4b')](_0x4725ed[_0x0fc9('0x4c')],{})[_0x0fc9('0x28')](function(_0x374c24){var _0x4e195e=_0x4725ed['user'][_0x0fc9('0x4d')]({'plain':!![]});if(!_0x4e195e)throw new Error(_0x0fc9('0x4e'));if(_0x4e195e['role']===_0x0fc9('0x4f')){var _0x2f8d37=_0x374c24[_0x0fc9('0x4d')]({'plain':!![]});var _0x3116f4=_0x0fc9('0x50');return db[_0x0fc9('0x51')][_0x0fc9('0x4a')]({'where':{'name':_0x3116f4,'userProfileId':_0x4e195e[_0x0fc9('0x52')]},'raw':!![]})['then'](function(_0x4e1c5b){if(_0x4e1c5b&&_0x4e1c5b['autoAssociation']===0x0){return db[_0x0fc9('0x27')]['create']({'name':_0x2f8d37[_0x0fc9('0x2c')],'resourceId':_0x2f8d37['id'],'type':_0x4e1c5b[_0x0fc9('0x2c')],'sectionId':_0x4e1c5b['id']},{})[_0x0fc9('0x28')](function(){return _0x374c24;});}else{return _0x374c24;}})[_0x0fc9('0x46')](function(_0x262b63){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x262b63);throw _0x262b63;});}return _0x374c24;})[_0x0fc9('0x28')](respondWithResult(_0x1b8546,0xc9))[_0x0fc9('0x46')](handleError(_0x1b8546,null));};exports['update']=function(_0x8fcb0b,_0x12593e){if(_0x8fcb0b[_0x0fc9('0x4c')]['id']){delete _0x8fcb0b[_0x0fc9('0x4c')]['id'];}return db['WhatsappQueue'][_0x0fc9('0x4a')]({'where':{'id':_0x8fcb0b['params']['id']}})[_0x0fc9('0x28')](handleEntityNotFound(_0x12593e,null))[_0x0fc9('0x28')](saveUpdates(_0x8fcb0b[_0x0fc9('0x4c')],null))[_0x0fc9('0x28')](respondWithResult(_0x12593e,null))['catch'](handleError(_0x12593e,null));};exports[_0x0fc9('0x26')]=function(_0x39d120,_0x5dbc0c){return db[_0x0fc9('0x49')][_0x0fc9('0x4a')]({'where':{'id':_0x39d120[_0x0fc9('0x48')]['id']}})[_0x0fc9('0x28')](handleEntityNotFound(_0x5dbc0c,null))[_0x0fc9('0x28')](removeEntity(_0x5dbc0c,null))[_0x0fc9('0x46')](handleError(_0x5dbc0c,null));};exports[_0x0fc9('0x53')]=function(_0x4fa9ad,_0x2da7ca){return db[_0x0fc9('0x49')]['describe']()['then'](respondWithResult(_0x2da7ca,null))[_0x0fc9('0x46')](handleError(_0x2da7ca,null));};exports['getMembers']=function(_0x4d543f,_0x263ba8,_0x46a57f){var _0x461485={'raw':!![],'where':{}},_0x5ae8fd={},_0x43fe5f;return db['WhatsappQueue'][_0x0fc9('0x54')]({'where':{'id':_0x4d543f[_0x0fc9('0x48')]['id']}})[_0x0fc9('0x28')](handleEntityNotFound(_0x263ba8,null))[_0x0fc9('0x28')](function(_0x1220ad){if(_0x1220ad){_0x43fe5f=_0x1220ad[_0x0fc9('0x4d')]({'plain':!![]});_0x5ae8fd[_0x0fc9('0x37')]=_[_0x0fc9('0x34')](db['UserWhatsappQueue'][_0x0fc9('0x30')]);_0x5ae8fd[_0x0fc9('0x33')]=_['keys'](_0x4d543f[_0x0fc9('0x33')]);_0x5ae8fd[_0x0fc9('0x35')]=_[_0x0fc9('0x36')](_0x5ae8fd['model'],_0x5ae8fd['query']);_0x461485[_0x0fc9('0x38')]=_[_0x0fc9('0x36')](_0x5ae8fd[_0x0fc9('0x37')],qs['fields'](_0x4d543f[_0x0fc9('0x33')][_0x0fc9('0x39')]));_0x461485['attributes']=_0x461485[_0x0fc9('0x38')][_0x0fc9('0x3a')]?_0x461485['attributes']:_0x5ae8fd[_0x0fc9('0x37')];if(!_0x4d543f[_0x0fc9('0x33')][_0x0fc9('0x3b')](_0x0fc9('0x3c'))){_0x461485[_0x0fc9('0x1d')]=qs[_0x0fc9('0x1d')](_0x4d543f[_0x0fc9('0x33')]['limit']);_0x461485[_0x0fc9('0x1f')]=qs[_0x0fc9('0x1f')](_0x4d543f[_0x0fc9('0x33')]['offset']);}_0x461485[_0x0fc9('0x3d')]=qs[_0x0fc9('0x55')](_0x4d543f[_0x0fc9('0x33')][_0x0fc9('0x55')]);_0x461485['where']=qs[_0x0fc9('0x35')](_[_0x0fc9('0x3e')](_0x4d543f[_0x0fc9('0x33')],_0x5ae8fd[_0x0fc9('0x35')]));_0x461485[_0x0fc9('0x40')][_0x0fc9('0x56')]=_0x1220ad['id'];if(_0x4d543f[_0x0fc9('0x33')]['filter']){_0x461485[_0x0fc9('0x40')]=_[_0x0fc9('0x41')](_0x461485[_0x0fc9('0x40')],{'$or':_[_0x0fc9('0x2f')](_0x461485[_0x0fc9('0x38')],function(_0x5c043d){var _0x53cfd8={};_0x53cfd8[_0x5c043d]={'$like':'%'+_0x4d543f['query'][_0x0fc9('0x3f')]+'%'};return _0x53cfd8;})});}_0x461485=_[_0x0fc9('0x41')]({},_0x461485,_0x4d543f[_0x0fc9('0x42')]);return db[_0x0fc9('0x57')][_0x0fc9('0x58')](_0x461485);}})[_0x0fc9('0x28')](function(_0x4de86d){if(_0x4de86d){return db[_0x0fc9('0x59')][_0x0fc9('0x5a')]({'where':{'id':_[_0x0fc9('0x2f')](_0x4de86d,_0x0fc9('0x5b')),'role':_0x0fc9('0x5c')},'attributes':['id',_0x0fc9('0x2c'),'whatsappPause',_0x0fc9('0x5d'),'createdAt']});}})['then'](function(_0x444cce){if(_0x444cce){return{'count':_0x444cce[_0x0fc9('0x1e')],'rows':_[_0x0fc9('0x2f')](_0x444cce[_0x0fc9('0x45')],function(_0x22d4cf){return{'membername':_0x22d4cf['name'],'UserId':_0x22d4cf['id'],'queue_name':_0x43fe5f[_0x0fc9('0x2c')],'WhatsappQueueId':_0x43fe5f['id'],'interface':util[_0x0fc9('0x5e')](_0x0fc9('0x5f'),_0x0fc9('0x60'),_0x22d4cf['name']),'penalty':0x0,'paused':_0x22d4cf['whatsappPause'],'createdAt':_0x22d4cf['createdAt'],'updatedAt':_0x22d4cf[_0x0fc9('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0fc9('0x28')](respondWithFilteredResult(_0x263ba8,_0x461485))[_0x0fc9('0x46')](handleError(_0x263ba8,null));};exports['getTeams']=function(_0x326925,_0xc9f771,_0x4712d4){var _0x4aaa55={};var _0x506b53={};var _0x520543;var _0x19b916;return db[_0x0fc9('0x49')]['findOne']({'where':{'id':_0x326925['params']['id']}})[_0x0fc9('0x28')](handleEntityNotFound(_0xc9f771,null))['then'](function(_0x8de050){if(_0x8de050){_0x520543=_0x8de050;_0x506b53[_0x0fc9('0x37')]=_[_0x0fc9('0x34')](db[_0x0fc9('0x61')][_0x0fc9('0x30')]);_0x506b53[_0x0fc9('0x33')]=_[_0x0fc9('0x34')](_0x326925['query']);_0x506b53['filters']=_[_0x0fc9('0x36')](_0x506b53['model'],_0x506b53['query']);_0x4aaa55[_0x0fc9('0x38')]=_[_0x0fc9('0x36')](_0x506b53[_0x0fc9('0x37')],qs[_0x0fc9('0x39')](_0x326925[_0x0fc9('0x33')]['fields']));_0x4aaa55[_0x0fc9('0x38')]=_0x4aaa55[_0x0fc9('0x38')][_0x0fc9('0x3a')]?_0x4aaa55[_0x0fc9('0x38')]:_0x506b53[_0x0fc9('0x37')];_0x4aaa55[_0x0fc9('0x3d')]=qs['sort'](_0x326925['query'][_0x0fc9('0x55')]);_0x4aaa55[_0x0fc9('0x40')]=qs[_0x0fc9('0x35')](_[_0x0fc9('0x3e')](_0x326925[_0x0fc9('0x33')],_0x506b53[_0x0fc9('0x35')]));if(_0x326925[_0x0fc9('0x33')][_0x0fc9('0x3f')]){_0x4aaa55[_0x0fc9('0x40')]=_[_0x0fc9('0x41')](_0x4aaa55[_0x0fc9('0x40')],{'$or':_[_0x0fc9('0x2f')](_0x4aaa55[_0x0fc9('0x38')],function(_0x18dc5e){var _0x2b5dea={};_0x2b5dea[_0x18dc5e]={'$like':'%'+_0x326925[_0x0fc9('0x33')][_0x0fc9('0x3f')]+'%'};return _0x2b5dea;})});}_0x4aaa55=_[_0x0fc9('0x41')]({},_0x4aaa55,_0x326925['options']);return _0x520543[_0x0fc9('0x62')](_0x4aaa55);}})[_0x0fc9('0x28')](function(_0x3ada2b){if(_0x3ada2b){_0x19b916=_0x3ada2b[_0x0fc9('0x3a')];if(!_0x326925[_0x0fc9('0x33')][_0x0fc9('0x3b')](_0x0fc9('0x3c'))){_0x4aaa55[_0x0fc9('0x1d')]=qs[_0x0fc9('0x1d')](_0x326925[_0x0fc9('0x33')][_0x0fc9('0x1d')]);_0x4aaa55[_0x0fc9('0x1f')]=qs[_0x0fc9('0x1f')](_0x326925[_0x0fc9('0x33')][_0x0fc9('0x1f')]);}return _0x520543[_0x0fc9('0x62')](_0x4aaa55);}})[_0x0fc9('0x28')](function(_0x1c31ab){if(_0x1c31ab){return _0x1c31ab?{'count':_0x19b916,'rows':_0x1c31ab}:null;}})[_0x0fc9('0x28')](respondWithResult(_0xc9f771,null))['catch'](handleError(_0xc9f771,null));};exports[_0x0fc9('0x63')]=function(_0x1c0897,_0x51406d,_0x22e165){var _0x537411=_0x1c0897[_0x0fc9('0x4c')][_0x0fc9('0x64')];return db['Team']['findAll']({'where':{'id':_0x537411},'attributes':['id'],'include':[{'model':db[_0x0fc9('0x59')],'as':'Agents','attributes':['id',_0x0fc9('0x2c'),'online',_0x0fc9('0x65'),_0x0fc9('0x66')],'raw':!![]}]})[_0x0fc9('0x28')](function(_0x4100e7){if(_0x4100e7){var _0x5b64eb=_[_0x0fc9('0x67')](_0x4100e7,function(_0x26be3c){var _0x30e00b=_0x26be3c['get']({'plain':!![]});return _0x30e00b[_0x0fc9('0x68')];});return db['WhatsappQueue'][_0x0fc9('0x4a')]({'where':{'id':_0x1c0897[_0x0fc9('0x48')]['id']}})[_0x0fc9('0x28')](function(_0x301e08){return db[_0x0fc9('0x69')][_0x0fc9('0x6a')](function(_0x320bf5){return _0x301e08['addTeams'](_0x537411,{'transaction':_0x320bf5})['then'](function(){return BPromise[_0x0fc9('0x6b')](_0x5b64eb,function(_0x34a353){return db[_0x0fc9('0x57')]['findOrCreate']({'where':{'UserId':_0x34a353['id'],'WhatsappQueueId':_0x1c0897[_0x0fc9('0x48')]['id']},'transaction':_0x320bf5});});})[_0x0fc9('0x28')](function(){_0x5b64eb[_0x0fc9('0x6c')](function(_0x5ae78b){socket[_0x0fc9('0x6d')](_0x0fc9('0x6e'),{'UserId':_0x5ae78b['id'],'WhatsappQueueId':_0x301e08['id']});});});});});}})['then'](respondWithStatusCode(_0x51406d,null))[_0x0fc9('0x46')](handleError(_0x51406d,null));};exports[_0x0fc9('0x6f')]=function(_0x49b5fb,_0x433dd1,_0x5bb286){return db[_0x0fc9('0x61')][_0x0fc9('0x58')]({'where':{'id':_0x49b5fb[_0x0fc9('0x33')][_0x0fc9('0x64')]},'attributes':['id'],'include':[{'model':db[_0x0fc9('0x59')],'as':_0x0fc9('0x68'),'attributes':['id'],'raw':!![]}]})[_0x0fc9('0x28')](handleEntityNotFound(_0x433dd1,null))[_0x0fc9('0x28')](function(_0x16a79f){var _0x21152e=_[_0x0fc9('0x2f')](_0x16a79f,'id');var _0x2f179d=[];var _0x452a98=[];var _0x44dbba=squel[_0x0fc9('0x70')]();_0x44dbba[_0x0fc9('0x71')](_0x0fc9('0x72'))[_0x0fc9('0x73')]('team_has_whatsapp_queues','tq')['join'](_0x0fc9('0x74'),'ut',_0x0fc9('0x75'))[_0x0fc9('0x40')](_0x0fc9('0x76'),_0x49b5fb['params']['id']);for(var _0x5d3540=0x0;_0x5d3540<_0x16a79f['length'];_0x5d3540+=0x1){let _0x4b8776=_0x16a79f[_0x5d3540];for(var _0x59ffca=0x0;_0x59ffca<_0x4b8776[_0x0fc9('0x68')]['length'];_0x59ffca+=0x1){let _0x5ea805=_0x4b8776['Agents'][_0x59ffca];var _0x1e7a79=_0x44dbba[_0x0fc9('0x77')]();_0x1e7a79[_0x0fc9('0x40')](_0x0fc9('0x78'),_0x5ea805['id']);_0x452a98[_0x0fc9('0x79')](db[_0x0fc9('0x69')]['query'](_0x1e7a79[_0x0fc9('0x7a')](),{'type':db[_0x0fc9('0x69')][_0x0fc9('0x7b')][_0x0fc9('0x7c')]})[_0x0fc9('0x28')](function(_0x69a17b){if(_0x69a17b[_0x0fc9('0x3a')]===0x1){return _0x5ea805['id'];}else{var _0x11698b=_[_0x0fc9('0x7d')](_[_0x0fc9('0x2f')](_0x69a17b,'TeamId'),function(_0x4220fa){return _['includes'](_0x21152e,_0x4220fa);});if(_0x11698b){return _0x5ea805['id'];}}}));}}return BPromise[_0x0fc9('0x7e')](_0x452a98)['then'](function(_0x20acd2){_0x2f179d=_(_0x2f179d)[_0x0fc9('0x7f')](_0x20acd2)[_0x0fc9('0x80')]()[_0x0fc9('0x81')]();return db[_0x0fc9('0x49')]['find']({'where':{'id':_0x49b5fb[_0x0fc9('0x48')]['id']}})['then'](function(_0x9a8b03){return db['sequelize'][_0x0fc9('0x6a')](function(_0xfa660f){return _0x9a8b03[_0x0fc9('0x6f')](_0x49b5fb[_0x0fc9('0x33')][_0x0fc9('0x64')],{'transaction':_0xfa660f})['then'](function(){if(!_['isEmpty'](_0x2f179d)){return _0x9a8b03[_0x0fc9('0x82')](_0x2f179d,{'transaction':_0xfa660f});}})[_0x0fc9('0x28')](function(){_0x2f179d[_0x0fc9('0x6c')](function(_0x1201ae){socket[_0x0fc9('0x6d')](_0x0fc9('0x83'),{'UserId':_0x1201ae,'WhatsappQueueId':_0x9a8b03['id']});});});});});});})['then'](respondWithStatusCode(_0x433dd1,null))['catch'](handleError(_0x433dd1,null));};exports[_0x0fc9('0x84')]=function(_0x332f13,_0x5b85d7,_0x54be58){return db[_0x0fc9('0x49')][_0x0fc9('0x4a')]({'where':{'id':_0x332f13[_0x0fc9('0x48')]['id']}})[_0x0fc9('0x28')](handleEntityNotFound(_0x5b85d7,null))[_0x0fc9('0x28')](function(_0x46bd18){if(_0x46bd18){return _0x46bd18[_0x0fc9('0x84')](_0x332f13[_0x0fc9('0x4c')]['ids'],_[_0x0fc9('0x85')](_0x332f13[_0x0fc9('0x4c')],[_0x0fc9('0x64'),'id'])||{})[_0x0fc9('0x86')](function(_0x24eb7c){for(var _0x5884b1=0x0;_0x5884b1<_0x332f13[_0x0fc9('0x4c')][_0x0fc9('0x64')][_0x0fc9('0x3a')];_0x5884b1+=0x1){socket[_0x0fc9('0x6d')]('userWhatsappQueue:save',{'UserId':Number(_0x332f13[_0x0fc9('0x4c')][_0x0fc9('0x64')][_0x5884b1]),'WhatsappQueueId':Number(_0x332f13[_0x0fc9('0x48')]['id'])});}return _0x24eb7c;});}})[_0x0fc9('0x28')](respondWithResult(_0x5b85d7,null))['catch'](handleError(_0x5b85d7,null));};exports[_0x0fc9('0x82')]=function(_0xf2c2b3,_0x71c92,_0x3ce443){return db[_0x0fc9('0x49')][_0x0fc9('0x4a')]({'where':{'id':_0xf2c2b3[_0x0fc9('0x48')]['id']}})[_0x0fc9('0x28')](handleEntityNotFound(_0x71c92,null))[_0x0fc9('0x28')](function(_0x382a47){if(_0x382a47){return _0x382a47[_0x0fc9('0x82')](_0xf2c2b3['query'][_0x0fc9('0x64')])['then'](function(){if(_['isArray'](_0xf2c2b3[_0x0fc9('0x33')][_0x0fc9('0x64')])){for(var _0x20ea3d=0x0;_0x20ea3d<_0xf2c2b3[_0x0fc9('0x33')][_0x0fc9('0x64')][_0x0fc9('0x3a')];_0x20ea3d+=0x1){socket[_0x0fc9('0x6d')](_0x0fc9('0x83'),{'UserId':Number(_0xf2c2b3[_0x0fc9('0x33')][_0x0fc9('0x64')][_0x20ea3d]),'WhatsappQueueId':Number(_0xf2c2b3[_0x0fc9('0x48')]['id'])});}}else{socket[_0x0fc9('0x6d')]('userWhatsappQueue:remove',{'UserId':Number(_0xf2c2b3['query'][_0x0fc9('0x64')]),'WhatsappQueueId':Number(_0xf2c2b3[_0x0fc9('0x48')]['id'])});}});}})[_0x0fc9('0x28')](respondWithStatusCode(_0x71c92,null))[_0x0fc9('0x46')](handleError(_0x71c92,null));};exports[_0x0fc9('0x87')]=function(_0x280195,_0x40e244,_0x463753){var _0xa4a66c={};var _0x1eda40={};var _0x44a85d;var _0x33d068;return db['WhatsappQueue'][_0x0fc9('0x54')]({'where':{'id':_0x280195[_0x0fc9('0x48')]['id']}})['then'](handleEntityNotFound(_0x40e244,null))[_0x0fc9('0x28')](function(_0x301662){if(_0x301662){_0x44a85d=_0x301662;_0x1eda40['model']=_[_0x0fc9('0x34')](db[_0x0fc9('0x59')][_0x0fc9('0x30')]);_0x1eda40[_0x0fc9('0x33')]=_[_0x0fc9('0x34')](_0x280195[_0x0fc9('0x33')]);_0x1eda40['filters']=_['intersection'](_0x1eda40[_0x0fc9('0x37')],_0x1eda40['query']);_0xa4a66c['attributes']=_[_0x0fc9('0x36')](_0x1eda40[_0x0fc9('0x37')],qs[_0x0fc9('0x39')](_0x280195[_0x0fc9('0x33')][_0x0fc9('0x39')]));_0xa4a66c[_0x0fc9('0x38')]=_0xa4a66c[_0x0fc9('0x38')][_0x0fc9('0x3a')]?_0xa4a66c[_0x0fc9('0x38')]:_0x1eda40[_0x0fc9('0x37')];_0xa4a66c[_0x0fc9('0x3d')]=qs[_0x0fc9('0x55')](_0x280195[_0x0fc9('0x33')][_0x0fc9('0x55')]);_0xa4a66c['where']=qs['filters'](_['pick'](_0x280195[_0x0fc9('0x33')],_0x1eda40['filters']));if(_0x280195['query'][_0x0fc9('0x3f')]){_0xa4a66c[_0x0fc9('0x40')]=_[_0x0fc9('0x41')](_0xa4a66c['where'],{'$or':_[_0x0fc9('0x2f')](_0xa4a66c['attributes'],function(_0x22d51a){var _0x46b972={};_0x46b972[_0x22d51a]={'$like':'%'+_0x280195[_0x0fc9('0x33')]['filter']+'%'};return _0x46b972;})});}_0xa4a66c=_[_0x0fc9('0x41')]({},_0xa4a66c,_0x280195['options']);return _0x44a85d[_0x0fc9('0x87')](_0xa4a66c);}})['then'](function(_0x9ff050){if(_0x9ff050){_0x33d068=_0x9ff050[_0x0fc9('0x3a')];if(!_0x280195['query'][_0x0fc9('0x3b')](_0x0fc9('0x3c'))){_0xa4a66c['limit']=qs['limit'](_0x280195['query'][_0x0fc9('0x1d')]);_0xa4a66c[_0x0fc9('0x1f')]=qs[_0x0fc9('0x1f')](_0x280195['query'][_0x0fc9('0x1f')]);}return _0x44a85d[_0x0fc9('0x87')](_0xa4a66c);}})[_0x0fc9('0x28')](function(_0x2a77c6){if(_0x2a77c6){return _0x2a77c6?{'count':_0x33d068,'rows':_0x2a77c6}:null;}})[_0x0fc9('0x28')](respondWithResult(_0x40e244,null))[_0x0fc9('0x46')](handleError(_0x40e244,null));};
\ No newline at end of file
+var _0x38d7=['find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','order','pick','WhatsappQueueId','User','findAndCountAll','UserId','agent','whatsappPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','select','field','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','value','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','getAgents','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','undefined','offset','set','Content-Range','apply','reject','save','update','then','get','WhatsappQueues','UserProfileResource','destroy','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','merge','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0x38d7,0xd8));var _0x738d=function(_0x277c93,_0x33a8bb){_0x277c93=_0x277c93-0x0;var _0x1bc988=_0x38d7[_0x277c93];return _0x1bc988;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x738d('0x0'));var zipdir=require(_0x738d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x738d('0x2'));var moment=require(_0x738d('0x3'));var BPromise=require(_0x738d('0x4'));var Mustache=require(_0x738d('0x5'));var util=require(_0x738d('0x6'));var path=require(_0x738d('0x7'));var sox=require(_0x738d('0x8'));var csv=require('to-csv');var ejs=require(_0x738d('0x9'));var fs=require('fs');var fs_extra=require(_0x738d('0xa'));var _=require(_0x738d('0xb'));var squel=require(_0x738d('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x738d('0xd'));var toCsv=require(_0x738d('0xe'));var querystring=require(_0x738d('0xf'));var Papa=require(_0x738d('0x10'));var Redis=require(_0x738d('0x11'));var authService=require(_0x738d('0x12'));var qs=require(_0x738d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x738d('0x14'));var logger=require(_0x738d('0x15'))(_0x738d('0x16'));var utils=require(_0x738d('0x17'));var config=require(_0x738d('0x18'));var licenseUtil=require(_0x738d('0x19'));var db=require(_0x738d('0x1a'))['db'];config['redis']=_[_0x738d('0x1b')](config['redis'],{'host':_0x738d('0x1c'),'port':0x18eb});var socket=require(_0x738d('0x1d'))(new Redis(config['redis']));require(_0x738d('0x1e'))[_0x738d('0x1f')](socket);function respondWithStatusCode(_0x3745e3,_0x4905d2){_0x4905d2=_0x4905d2||0xcc;return function(_0x162438){if(_0x162438){return _0x3745e3[_0x738d('0x20')](_0x4905d2);}return _0x3745e3[_0x738d('0x21')](_0x4905d2)['end']();};}function respondWithResult(_0x115cb1,_0x5bbc87){_0x5bbc87=_0x5bbc87||0xc8;return function(_0x226b4b){if(_0x226b4b){return _0x115cb1[_0x738d('0x21')](_0x5bbc87)[_0x738d('0x22')](_0x226b4b);}};}function respondWithFilteredResult(_0x5e6ba6,_0x37243e){return function(_0x44c785){if(_0x44c785){var _0x3f2fc5=typeof _0x37243e['offset']==='undefined'&&typeof _0x37243e['limit']===_0x738d('0x23');var _0x386585=_0x44c785['count'];var _0x384e07=_0x3f2fc5?0x0:_0x37243e['offset'];var _0x405f4b=_0x3f2fc5?_0x44c785['count']:_0x37243e[_0x738d('0x24')]+_0x37243e['limit'];var _0x48abf8;if(_0x405f4b>=_0x386585){_0x405f4b=_0x386585;_0x48abf8=0xc8;}else{_0x48abf8=0xce;}_0x5e6ba6[_0x738d('0x21')](_0x48abf8);return _0x5e6ba6[_0x738d('0x25')](_0x738d('0x26'),_0x384e07+'-'+_0x405f4b+'/'+_0x386585)[_0x738d('0x22')](_0x44c785);}return null;};}function patchUpdates(_0x5c77bf){return function(_0x3890db){try{jsonpatch[_0x738d('0x27')](_0x3890db,_0x5c77bf,!![]);}catch(_0x5c0337){return BPromise[_0x738d('0x28')](_0x5c0337);}return _0x3890db[_0x738d('0x29')]();};}function saveUpdates(_0xf78270,_0x2e298c){return function(_0x56ab1d){if(_0x56ab1d){return _0x56ab1d[_0x738d('0x2a')](_0xf78270)[_0x738d('0x2b')](function(_0x5d2c92){return _0x5d2c92;});}return null;};}function removeEntity(_0x8e4070,_0x360f86){return function(_0x3a2386){if(_0x3a2386){return _0x3a2386['destroy']()[_0x738d('0x2b')](function(){var _0x156d4e=_0x3a2386[_0x738d('0x2c')]({'plain':!![]});var _0x3c78e9=_0x738d('0x2d');return db[_0x738d('0x2e')][_0x738d('0x2f')]({'where':{'type':_0x3c78e9,'resourceId':_0x156d4e['id']}})['then'](function(){return _0x3a2386;});})[_0x738d('0x2b')](function(){_0x8e4070['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x27cf9b,_0x26bb81){return function(_0x2b3e33){if(!_0x2b3e33){_0x27cf9b[_0x738d('0x20')](0x194);}return _0x2b3e33;};}function handleError(_0x28ccd3,_0x29e4cc){_0x29e4cc=_0x29e4cc||0x1f4;return function(_0x3dd3d3){logger['error'](_0x3dd3d3[_0x738d('0x30')]);if(_0x3dd3d3[_0x738d('0x31')]){delete _0x3dd3d3['name'];}_0x28ccd3['status'](_0x29e4cc)[_0x738d('0x32')](_0x3dd3d3);};}exports[_0x738d('0x33')]=function(_0x364441,_0x568ecc){var _0x1e3adb={},_0xc3c410={},_0x23dcdd={'count':0x0,'rows':[]};var _0x591d36=_[_0x738d('0x34')](db[_0x738d('0x35')][_0x738d('0x36')],function(_0x5ef931){return{'name':_0x5ef931[_0x738d('0x37')],'type':_0x5ef931[_0x738d('0x38')]['key']};});_0xc3c410[_0x738d('0x39')]=_['map'](_0x591d36,_0x738d('0x31'));_0xc3c410[_0x738d('0x3a')]=_[_0x738d('0x3b')](_0x364441[_0x738d('0x3a')]);_0xc3c410[_0x738d('0x3c')]=_[_0x738d('0x3d')](_0xc3c410[_0x738d('0x39')],_0xc3c410[_0x738d('0x3a')]);_0x1e3adb['attributes']=_[_0x738d('0x3d')](_0xc3c410[_0x738d('0x39')],qs[_0x738d('0x3e')](_0x364441[_0x738d('0x3a')][_0x738d('0x3e')]));_0x1e3adb[_0x738d('0x3f')]=_0x1e3adb[_0x738d('0x3f')][_0x738d('0x40')]?_0x1e3adb[_0x738d('0x3f')]:_0xc3c410['model'];if(!_0x364441[_0x738d('0x3a')][_0x738d('0x41')](_0x738d('0x42'))){_0x1e3adb[_0x738d('0x43')]=qs[_0x738d('0x43')](_0x364441[_0x738d('0x3a')][_0x738d('0x43')]);_0x1e3adb[_0x738d('0x24')]=qs['offset'](_0x364441[_0x738d('0x3a')]['offset']);}_0x1e3adb['order']=qs['sort'](_0x364441['query'][_0x738d('0x44')]);_0x1e3adb[_0x738d('0x45')]=qs['filters'](_['pick'](_0x364441[_0x738d('0x3a')],_0xc3c410[_0x738d('0x3c')]),_0x591d36);if(_0x364441['query']['filter']){_0x1e3adb[_0x738d('0x45')]=_[_0x738d('0x46')](_0x1e3adb[_0x738d('0x45')],{'$or':_[_0x738d('0x34')](_0x591d36,function(_0x14f25f){if(_0x14f25f['type']!==_0x738d('0x47')){var _0x210f7e={};_0x210f7e[_0x14f25f[_0x738d('0x31')]]={'$like':'%'+_0x364441[_0x738d('0x3a')][_0x738d('0x48')]+'%'};return _0x210f7e;}})});}_0x1e3adb=_[_0x738d('0x46')]({},_0x1e3adb,_0x364441['options']);var _0x5c6e5f={'where':_0x1e3adb[_0x738d('0x45')]};return db[_0x738d('0x35')][_0x738d('0x49')](_0x5c6e5f)['then'](function(_0x274b90){_0x23dcdd[_0x738d('0x49')]=_0x274b90;if(_0x364441[_0x738d('0x3a')][_0x738d('0x4a')]){_0x1e3adb[_0x738d('0x4b')]=[{'all':!![]}];}return db[_0x738d('0x35')][_0x738d('0x4c')](_0x1e3adb);})[_0x738d('0x2b')](function(_0x5361ab){_0x23dcdd[_0x738d('0x4d')]=_0x5361ab;return _0x23dcdd;})[_0x738d('0x2b')](respondWithFilteredResult(_0x568ecc,_0x1e3adb))[_0x738d('0x4e')](handleError(_0x568ecc,null));};exports[_0x738d('0x4f')]=function(_0x4a7432,_0x4dde9c){var _0x16ae45={'raw':!![],'where':{'id':_0x4a7432[_0x738d('0x50')]['id']}},_0x3ce877={};_0x3ce877[_0x738d('0x39')]=_[_0x738d('0x3b')](db[_0x738d('0x35')][_0x738d('0x36')]);_0x3ce877[_0x738d('0x3a')]=_[_0x738d('0x3b')](_0x4a7432[_0x738d('0x3a')]);_0x3ce877[_0x738d('0x3c')]=_[_0x738d('0x3d')](_0x3ce877['model'],_0x3ce877[_0x738d('0x3a')]);_0x16ae45['attributes']=_[_0x738d('0x3d')](_0x3ce877[_0x738d('0x39')],qs['fields'](_0x4a7432['query']['fields']));_0x16ae45[_0x738d('0x3f')]=_0x16ae45['attributes'][_0x738d('0x40')]?_0x16ae45[_0x738d('0x3f')]:_0x3ce877[_0x738d('0x39')];if(_0x4a7432[_0x738d('0x3a')][_0x738d('0x4a')]){_0x16ae45[_0x738d('0x4b')]=[{'all':!![]}];}_0x16ae45=_[_0x738d('0x46')]({},_0x16ae45,_0x4a7432[_0x738d('0x51')]);return db[_0x738d('0x35')]['find'](_0x16ae45)[_0x738d('0x2b')](handleEntityNotFound(_0x4dde9c,null))['then'](respondWithResult(_0x4dde9c,null))[_0x738d('0x4e')](handleError(_0x4dde9c,null));};exports[_0x738d('0x52')]=function(_0x11c150,_0x1fc602){return db[_0x738d('0x35')]['create'](_0x11c150[_0x738d('0x53')],{})[_0x738d('0x2b')](function(_0x201664){var _0x15e5b0=_0x11c150[_0x738d('0x54')][_0x738d('0x2c')]({'plain':!![]});if(!_0x15e5b0)throw new Error(_0x738d('0x55'));if(_0x15e5b0[_0x738d('0x56')]===_0x738d('0x54')){var _0x4b9d0a=_0x201664[_0x738d('0x2c')]({'plain':!![]});var _0x3662b4='WhatsappQueues';return db[_0x738d('0x57')][_0x738d('0x58')]({'where':{'name':_0x3662b4,'userProfileId':_0x15e5b0[_0x738d('0x59')]},'raw':!![]})['then'](function(_0x18444f){if(_0x18444f&&_0x18444f[_0x738d('0x5a')]===0x0){return db[_0x738d('0x2e')]['create']({'name':_0x4b9d0a['name'],'resourceId':_0x4b9d0a['id'],'type':_0x18444f['name'],'sectionId':_0x18444f['id']},{})['then'](function(){return _0x201664;});}else{return _0x201664;}})[_0x738d('0x4e')](function(_0x307a07){logger[_0x738d('0x5b')](_0x738d('0x5c'),_0x307a07);throw _0x307a07;});}return _0x201664;})[_0x738d('0x2b')](respondWithResult(_0x1fc602,0xc9))[_0x738d('0x4e')](handleError(_0x1fc602,null));};exports['update']=function(_0x4a0a86,_0x568095){if(_0x4a0a86['body']['id']){delete _0x4a0a86['body']['id'];}return db[_0x738d('0x35')][_0x738d('0x58')]({'where':{'id':_0x4a0a86[_0x738d('0x50')]['id']}})[_0x738d('0x2b')](handleEntityNotFound(_0x568095,null))[_0x738d('0x2b')](saveUpdates(_0x4a0a86[_0x738d('0x53')],null))[_0x738d('0x2b')](respondWithResult(_0x568095,null))[_0x738d('0x4e')](handleError(_0x568095,null));};exports['destroy']=function(_0x47dc1b,_0x364366){return db[_0x738d('0x35')][_0x738d('0x58')]({'where':{'id':_0x47dc1b['params']['id']}})[_0x738d('0x2b')](handleEntityNotFound(_0x364366,null))['then'](removeEntity(_0x364366,null))[_0x738d('0x4e')](handleError(_0x364366,null));};exports[_0x738d('0x5d')]=function(_0x1cd0be,_0x1e72f1){return db[_0x738d('0x35')]['describe']()['then'](respondWithResult(_0x1e72f1,null))['catch'](handleError(_0x1e72f1,null));};exports[_0x738d('0x5e')]=function(_0x5a70ec,_0x1bd59d,_0x183390){var _0x2ea50b={'raw':!![],'where':{}},_0x3d5e90={},_0x11cf2a;return db[_0x738d('0x35')][_0x738d('0x5f')]({'where':{'id':_0x5a70ec[_0x738d('0x50')]['id']}})[_0x738d('0x2b')](handleEntityNotFound(_0x1bd59d,null))[_0x738d('0x2b')](function(_0x1a9c7f){if(_0x1a9c7f){_0x11cf2a=_0x1a9c7f[_0x738d('0x2c')]({'plain':!![]});_0x3d5e90[_0x738d('0x39')]=_[_0x738d('0x3b')](db[_0x738d('0x60')][_0x738d('0x36')]);_0x3d5e90[_0x738d('0x3a')]=_[_0x738d('0x3b')](_0x5a70ec['query']);_0x3d5e90['filters']=_[_0x738d('0x3d')](_0x3d5e90['model'],_0x3d5e90[_0x738d('0x3a')]);_0x2ea50b[_0x738d('0x3f')]=_[_0x738d('0x3d')](_0x3d5e90[_0x738d('0x39')],qs['fields'](_0x5a70ec['query'][_0x738d('0x3e')]));_0x2ea50b[_0x738d('0x3f')]=_0x2ea50b[_0x738d('0x3f')][_0x738d('0x40')]?_0x2ea50b['attributes']:_0x3d5e90[_0x738d('0x39')];if(!_0x5a70ec[_0x738d('0x3a')][_0x738d('0x41')]('nolimit')){_0x2ea50b[_0x738d('0x43')]=qs[_0x738d('0x43')](_0x5a70ec[_0x738d('0x3a')]['limit']);_0x2ea50b[_0x738d('0x24')]=qs[_0x738d('0x24')](_0x5a70ec[_0x738d('0x3a')][_0x738d('0x24')]);}_0x2ea50b[_0x738d('0x61')]=qs[_0x738d('0x44')](_0x5a70ec['query']['sort']);_0x2ea50b[_0x738d('0x45')]=qs[_0x738d('0x3c')](_[_0x738d('0x62')](_0x5a70ec[_0x738d('0x3a')],_0x3d5e90[_0x738d('0x3c')]));_0x2ea50b[_0x738d('0x45')][_0x738d('0x63')]=_0x1a9c7f['id'];if(_0x5a70ec[_0x738d('0x3a')][_0x738d('0x48')]){_0x2ea50b[_0x738d('0x45')]=_[_0x738d('0x46')](_0x2ea50b[_0x738d('0x45')],{'$or':_['map'](_0x2ea50b[_0x738d('0x3f')],function(_0x3e8355){var _0x2b39cc={};_0x2b39cc[_0x3e8355]={'$like':'%'+_0x5a70ec['query'][_0x738d('0x48')]+'%'};return _0x2b39cc;})});}_0x2ea50b=_[_0x738d('0x46')]({},_0x2ea50b,_0x5a70ec['options']);return db[_0x738d('0x60')][_0x738d('0x4c')](_0x2ea50b);}})[_0x738d('0x2b')](function(_0x34df3c){if(_0x34df3c){return db[_0x738d('0x64')][_0x738d('0x65')]({'where':{'id':_[_0x738d('0x34')](_0x34df3c,_0x738d('0x66')),'role':_0x738d('0x67')},'attributes':['id',_0x738d('0x31'),_0x738d('0x68'),'updatedAt',_0x738d('0x69')]});}})[_0x738d('0x2b')](function(_0xf695a7){if(_0xf695a7){return{'count':_0xf695a7['count'],'rows':_[_0x738d('0x34')](_0xf695a7[_0x738d('0x4d')],function(_0x56694c){return{'membername':_0x56694c[_0x738d('0x31')],'UserId':_0x56694c['id'],'queue_name':_0x11cf2a[_0x738d('0x31')],'WhatsappQueueId':_0x11cf2a['id'],'interface':util[_0x738d('0x6a')](_0x738d('0x6b'),_0x738d('0x6c'),_0x56694c[_0x738d('0x31')]),'penalty':0x0,'paused':_0x56694c[_0x738d('0x68')],'createdAt':_0x56694c[_0x738d('0x69')],'updatedAt':_0x56694c[_0x738d('0x6d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x738d('0x2b')](respondWithFilteredResult(_0x1bd59d,_0x2ea50b))[_0x738d('0x4e')](handleError(_0x1bd59d,null));};exports['getTeams']=function(_0x5387cd,_0x51b27e,_0x235d8b){var _0x1a4cde={};var _0x41212c={};var _0x4ccc01;var _0x287cfb;return db[_0x738d('0x35')][_0x738d('0x5f')]({'where':{'id':_0x5387cd[_0x738d('0x50')]['id']}})[_0x738d('0x2b')](handleEntityNotFound(_0x51b27e,null))['then'](function(_0x66a55c){if(_0x66a55c){_0x4ccc01=_0x66a55c;_0x41212c[_0x738d('0x39')]=_['keys'](db[_0x738d('0x6e')]['rawAttributes']);_0x41212c[_0x738d('0x3a')]=_['keys'](_0x5387cd['query']);_0x41212c['filters']=_[_0x738d('0x3d')](_0x41212c[_0x738d('0x39')],_0x41212c[_0x738d('0x3a')]);_0x1a4cde[_0x738d('0x3f')]=_['intersection'](_0x41212c['model'],qs[_0x738d('0x3e')](_0x5387cd[_0x738d('0x3a')][_0x738d('0x3e')]));_0x1a4cde['attributes']=_0x1a4cde[_0x738d('0x3f')][_0x738d('0x40')]?_0x1a4cde[_0x738d('0x3f')]:_0x41212c['model'];_0x1a4cde[_0x738d('0x61')]=qs[_0x738d('0x44')](_0x5387cd[_0x738d('0x3a')][_0x738d('0x44')]);_0x1a4cde['where']=qs[_0x738d('0x3c')](_[_0x738d('0x62')](_0x5387cd[_0x738d('0x3a')],_0x41212c[_0x738d('0x3c')]));if(_0x5387cd['query']['filter']){_0x1a4cde[_0x738d('0x45')]=_[_0x738d('0x46')](_0x1a4cde[_0x738d('0x45')],{'$or':_['map'](_0x1a4cde['attributes'],function(_0xdd5e65){var _0x39a53c={};_0x39a53c[_0xdd5e65]={'$like':'%'+_0x5387cd[_0x738d('0x3a')][_0x738d('0x48')]+'%'};return _0x39a53c;})});}_0x1a4cde=_[_0x738d('0x46')]({},_0x1a4cde,_0x5387cd['options']);return _0x4ccc01['getTeams'](_0x1a4cde);}})[_0x738d('0x2b')](function(_0x377b92){if(_0x377b92){_0x287cfb=_0x377b92[_0x738d('0x40')];if(!_0x5387cd[_0x738d('0x3a')]['hasOwnProperty']('nolimit')){_0x1a4cde['limit']=qs[_0x738d('0x43')](_0x5387cd['query'][_0x738d('0x43')]);_0x1a4cde['offset']=qs['offset'](_0x5387cd[_0x738d('0x3a')]['offset']);}return _0x4ccc01[_0x738d('0x6f')](_0x1a4cde);}})['then'](function(_0x1dbad4){if(_0x1dbad4){return _0x1dbad4?{'count':_0x287cfb,'rows':_0x1dbad4}:null;}})[_0x738d('0x2b')](respondWithResult(_0x51b27e,null))[_0x738d('0x4e')](handleError(_0x51b27e,null));};exports[_0x738d('0x70')]=function(_0xc7edf0,_0x4e4ecc,_0x5b1f6c){var _0x1f0900=_0xc7edf0['body'][_0x738d('0x71')];return db[_0x738d('0x6e')][_0x738d('0x4c')]({'where':{'id':_0x1f0900},'attributes':['id'],'include':[{'model':db[_0x738d('0x64')],'as':_0x738d('0x72'),'attributes':['id','name',_0x738d('0x73'),_0x738d('0x74'),_0x738d('0x75')],'raw':!![]}]})[_0x738d('0x2b')](function(_0x39467c){if(_0x39467c){var _0x1d0c8b=_[_0x738d('0x76')](_0x39467c,function(_0x1b4008){var _0x4a51b1=_0x1b4008[_0x738d('0x2c')]({'plain':!![]});return _0x4a51b1[_0x738d('0x72')];});return db['WhatsappQueue'][_0x738d('0x58')]({'where':{'id':_0xc7edf0['params']['id']}})[_0x738d('0x2b')](function(_0x22ad86){return db[_0x738d('0x77')][_0x738d('0x78')](function(_0x193668){return _0x22ad86[_0x738d('0x70')](_0x1f0900,{'transaction':_0x193668})['then'](function(){return BPromise[_0x738d('0x79')](_0x1d0c8b,function(_0x272ba8){return db[_0x738d('0x60')][_0x738d('0x7a')]({'where':{'UserId':_0x272ba8['id'],'WhatsappQueueId':_0xc7edf0['params']['id']},'transaction':_0x193668});});})[_0x738d('0x2b')](function(){_0x1d0c8b[_0x738d('0x7b')](function(_0x41f867){socket[_0x738d('0x7c')](_0x738d('0x7d'),{'UserId':_0x41f867['id'],'WhatsappQueueId':_0x22ad86['id']});});});});});}})['then'](respondWithStatusCode(_0x4e4ecc,null))[_0x738d('0x4e')](handleError(_0x4e4ecc,null));};exports['removeTeams']=function(_0x291222,_0x1687f7,_0x53abda){return db[_0x738d('0x6e')][_0x738d('0x4c')]({'where':{'id':_0x291222[_0x738d('0x3a')][_0x738d('0x71')]},'attributes':['id'],'include':[{'model':db[_0x738d('0x64')],'as':_0x738d('0x72'),'attributes':['id'],'raw':!![]}]})[_0x738d('0x2b')](handleEntityNotFound(_0x1687f7,null))[_0x738d('0x2b')](function(_0x154218){var _0x3b5368=_[_0x738d('0x34')](_0x154218,'id');var _0xb89f3e=[];var _0x34c498=[];var _0xba6d22=squel[_0x738d('0x7e')]();_0xba6d22[_0x738d('0x7f')]('tq.TeamId')[_0x738d('0x80')](_0x738d('0x81'),'tq')[_0x738d('0x82')](_0x738d('0x83'),'ut',_0x738d('0x84'))[_0x738d('0x45')]('WhatsappQueueId\x20=\x20?',_0x291222['params']['id']);for(var _0x5b22f0=0x0;_0x5b22f0<_0x154218[_0x738d('0x40')];_0x5b22f0+=0x1){let _0x71e321=_0x154218[_0x5b22f0];for(var _0x615e3c=0x0;_0x615e3c<_0x71e321[_0x738d('0x72')][_0x738d('0x40')];_0x615e3c+=0x1){let _0x42bb1d=_0x71e321['Agents'][_0x615e3c];var _0x128d24=_0xba6d22[_0x738d('0x85')]();_0x128d24['where']('ut.UserId\x20=\x20?',_0x42bb1d['id']);_0x34c498[_0x738d('0x86')](db[_0x738d('0x77')][_0x738d('0x3a')](_0x128d24[_0x738d('0x87')](),{'type':db['sequelize'][_0x738d('0x88')][_0x738d('0x89')]})[_0x738d('0x2b')](function(_0x44f553){if(_0x44f553['length']===0x1){return _0x42bb1d['id'];}else{var _0x19c9a6=_[_0x738d('0x8a')](_[_0x738d('0x34')](_0x44f553,_0x738d('0x8b')),function(_0x2897f0){return _[_0x738d('0x8c')](_0x3b5368,_0x2897f0);});if(_0x19c9a6){return _0x42bb1d['id'];}}}));}}return BPromise[_0x738d('0x8d')](_0x34c498)[_0x738d('0x2b')](function(_0x1ae2fa){_0xb89f3e=_(_0xb89f3e)[_0x738d('0x8e')](_0x1ae2fa)['compact']()[_0x738d('0x8f')]();return db[_0x738d('0x35')][_0x738d('0x58')]({'where':{'id':_0x291222[_0x738d('0x50')]['id']}})[_0x738d('0x2b')](function(_0xeb7228){return db[_0x738d('0x77')][_0x738d('0x78')](function(_0x5396db){return _0xeb7228[_0x738d('0x90')](_0x291222[_0x738d('0x3a')][_0x738d('0x71')],{'transaction':_0x5396db})['then'](function(){if(!_[_0x738d('0x91')](_0xb89f3e)){return _0xeb7228[_0x738d('0x92')](_0xb89f3e,{'transaction':_0x5396db});}})[_0x738d('0x2b')](function(){_0xb89f3e['forEach'](function(_0x413378){socket['emit'](_0x738d('0x93'),{'UserId':_0x413378,'WhatsappQueueId':_0xeb7228['id']});});});});});});})[_0x738d('0x2b')](respondWithStatusCode(_0x1687f7,null))[_0x738d('0x4e')](handleError(_0x1687f7,null));};exports['addAgents']=function(_0x31d777,_0x5d352a,_0x31b659){return db[_0x738d('0x35')][_0x738d('0x58')]({'where':{'id':_0x31d777[_0x738d('0x50')]['id']}})[_0x738d('0x2b')](handleEntityNotFound(_0x5d352a,null))['then'](function(_0x36aa46){if(_0x36aa46){return _0x36aa46[_0x738d('0x94')](_0x31d777['body'][_0x738d('0x71')],_[_0x738d('0x95')](_0x31d777[_0x738d('0x53')],[_0x738d('0x71'),'id'])||{})[_0x738d('0x96')](function(_0x2b8b70){for(var _0x17b82c=0x0;_0x17b82c<_0x31d777[_0x738d('0x53')][_0x738d('0x71')][_0x738d('0x40')];_0x17b82c+=0x1){socket['emit'](_0x738d('0x7d'),{'UserId':Number(_0x31d777[_0x738d('0x53')][_0x738d('0x71')][_0x17b82c]),'WhatsappQueueId':Number(_0x31d777[_0x738d('0x50')]['id'])});}return _0x2b8b70;});}})[_0x738d('0x2b')](respondWithResult(_0x5d352a,null))[_0x738d('0x4e')](handleError(_0x5d352a,null));};exports[_0x738d('0x92')]=function(_0x1ccc24,_0x4f7d3a,_0x2f5b6b){return db[_0x738d('0x35')][_0x738d('0x58')]({'where':{'id':_0x1ccc24['params']['id']}})[_0x738d('0x2b')](handleEntityNotFound(_0x4f7d3a,null))[_0x738d('0x2b')](function(_0x4aee04){if(_0x4aee04){return _0x4aee04[_0x738d('0x92')](_0x1ccc24['query'][_0x738d('0x71')])['then'](function(){if(_['isArray'](_0x1ccc24[_0x738d('0x3a')]['ids'])){for(var _0x5dde94=0x0;_0x5dde94<_0x1ccc24[_0x738d('0x3a')]['ids'][_0x738d('0x40')];_0x5dde94+=0x1){socket[_0x738d('0x7c')](_0x738d('0x93'),{'UserId':Number(_0x1ccc24['query']['ids'][_0x5dde94]),'WhatsappQueueId':Number(_0x1ccc24['params']['id'])});}}else{socket[_0x738d('0x7c')](_0x738d('0x93'),{'UserId':Number(_0x1ccc24[_0x738d('0x3a')][_0x738d('0x71')]),'WhatsappQueueId':Number(_0x1ccc24[_0x738d('0x50')]['id'])});}});}})[_0x738d('0x2b')](respondWithStatusCode(_0x4f7d3a,null))[_0x738d('0x4e')](handleError(_0x4f7d3a,null));};exports[_0x738d('0x97')]=function(_0x54e887,_0x517602,_0x1fb374){var _0x177606={};var _0x2f1723={};var _0x1fc056;var _0x4e6c56;return db[_0x738d('0x35')]['findOne']({'where':{'id':_0x54e887[_0x738d('0x50')]['id']}})['then'](handleEntityNotFound(_0x517602,null))[_0x738d('0x2b')](function(_0x3200d3){if(_0x3200d3){_0x1fc056=_0x3200d3;_0x2f1723[_0x738d('0x39')]=_['keys'](db['User'][_0x738d('0x36')]);_0x2f1723[_0x738d('0x3a')]=_[_0x738d('0x3b')](_0x54e887[_0x738d('0x3a')]);_0x2f1723[_0x738d('0x3c')]=_[_0x738d('0x3d')](_0x2f1723[_0x738d('0x39')],_0x2f1723[_0x738d('0x3a')]);_0x177606['attributes']=_[_0x738d('0x3d')](_0x2f1723[_0x738d('0x39')],qs[_0x738d('0x3e')](_0x54e887[_0x738d('0x3a')][_0x738d('0x3e')]));_0x177606[_0x738d('0x3f')]=_0x177606[_0x738d('0x3f')][_0x738d('0x40')]?_0x177606[_0x738d('0x3f')]:_0x2f1723[_0x738d('0x39')];_0x177606[_0x738d('0x61')]=qs[_0x738d('0x44')](_0x54e887[_0x738d('0x3a')][_0x738d('0x44')]);_0x177606[_0x738d('0x45')]=qs[_0x738d('0x3c')](_[_0x738d('0x62')](_0x54e887[_0x738d('0x3a')],_0x2f1723['filters']));if(_0x54e887[_0x738d('0x3a')]['filter']){_0x177606[_0x738d('0x45')]=_[_0x738d('0x46')](_0x177606[_0x738d('0x45')],{'$or':_[_0x738d('0x34')](_0x177606['attributes'],function(_0x2ca991){var _0x2bb887={};_0x2bb887[_0x2ca991]={'$like':'%'+_0x54e887['query']['filter']+'%'};return _0x2bb887;})});}_0x177606=_['merge']({},_0x177606,_0x54e887['options']);return _0x1fc056[_0x738d('0x97')](_0x177606);}})[_0x738d('0x2b')](function(_0x96580a){if(_0x96580a){_0x4e6c56=_0x96580a[_0x738d('0x40')];if(!_0x54e887[_0x738d('0x3a')][_0x738d('0x41')](_0x738d('0x42'))){_0x177606[_0x738d('0x43')]=qs['limit'](_0x54e887[_0x738d('0x3a')][_0x738d('0x43')]);_0x177606['offset']=qs[_0x738d('0x24')](_0x54e887[_0x738d('0x3a')]['offset']);}return _0x1fc056[_0x738d('0x97')](_0x177606);}})[_0x738d('0x2b')](function(_0x146ca5){if(_0x146ca5){return _0x146ca5?{'count':_0x4e6c56,'rows':_0x146ca5}:null;}})['then'](respondWithResult(_0x517602,null))[_0x738d('0x4e')](handleError(_0x517602,null));};
\ No newline at end of file
index 71da7aa..01089d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72b6=['remove','emit','hook','exports','WhatsappQueue','setMaxListeners','update'];(function(_0x2ceeb0,_0x508ece){var _0xeca5d9=function(_0x33cde2){while(--_0x33cde2){_0x2ceeb0['push'](_0x2ceeb0['shift']());}};_0xeca5d9(++_0x508ece);}(_0x72b6,0x1ee));var _0x672b=function(_0x722b1f,_0x17ccde){_0x722b1f=_0x722b1f-0x0;var _0x358e6c=_0x72b6[_0x722b1f];return _0x358e6c;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require('../../mysqldb')['db'][_0x672b('0x0')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x672b('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x672b('0x2'),'afterDestroy':_0x672b('0x3')};function emitEvent(_0xb56b6d){return function(_0xe96901,_0x5ee3dc,_0x2d06b1){WhatsappQueueEvents[_0x672b('0x4')](_0xb56b6d+':'+_0xe96901['id'],_0xe96901);WhatsappQueueEvents[_0x672b('0x4')](_0xb56b6d,_0xe96901);_0x2d06b1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x672b('0x5')](e,emitEvent(event));}}module[_0x672b('0x6')]=WhatsappQueueEvents;
\ No newline at end of file
+var _0x84c1=['WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0xa71d23,_0xa1701){var _0x2aa9ff=function(_0x392b15){while(--_0x392b15){_0xa71d23['push'](_0xa71d23['shift']());}};_0x2aa9ff(++_0xa1701);}(_0x84c1,0x106));var _0x184c=function(_0x491efa,_0x336a99){_0x491efa=_0x491efa-0x0;var _0x207c62=_0x84c1[_0x491efa];return _0x207c62;};'use strict';var EventEmitter=require(_0x184c('0x0'));var WhatsappQueue=require(_0x184c('0x1'))['db'][_0x184c('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x184c('0x3')](0x0);var events={'afterCreate':_0x184c('0x4'),'afterUpdate':_0x184c('0x5'),'afterDestroy':_0x184c('0x6')};function emitEvent(_0x1fc184){return function(_0x4b0fd3,_0x2e8b87,_0x3850ee){WhatsappQueueEvents[_0x184c('0x7')](_0x1fc184+':'+_0x4b0fd3['id'],_0x4b0fd3);WhatsappQueueEvents[_0x184c('0x7')](_0x1fc184,_0x4b0fd3);_0x3850ee(null);};}for(var e in events){if(events[_0x184c('0x8')](e)){var event=events[e];WhatsappQueue[_0x184c('0x9')](e,emitEvent(event));}}module[_0x184c('0xa')]=WhatsappQueueEvents;
\ No newline at end of file
index edf79d0..c9a32f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4797=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','whatsapp_queues','util','../../config/logger'];(function(_0x28ef5b,_0xa37852){var _0x174016=function(_0x9bc1d0){while(--_0x9bc1d0){_0x28ef5b['push'](_0x28ef5b['shift']());}};_0x174016(++_0xa37852);}(_0x4797,0x196));var _0x7479=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4797[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x7479('0x0'));var logger=require(_0x7479('0x1'))(_0x7479('0x2'));var moment=require(_0x7479('0x3'));var BPromise=require(_0x7479('0x4'));var rp=require(_0x7479('0x5'));var fs=require('fs');var path=require(_0x7479('0x6'));var rimraf=require(_0x7479('0x7'));var config=require(_0x7479('0x8'));var attributes=require('./whatsappQueue.attributes');module[_0x7479('0x9')]=function(_0x29b68e,_0x2f174a){return _0x29b68e[_0x7479('0xa')]('WhatsappQueue',attributes,{'tableName':_0x7479('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0767=['path','./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2193dd,_0x22ddea){var _0x520d14=function(_0x363e8){while(--_0x363e8){_0x2193dd['push'](_0x2193dd['shift']());}};_0x520d14(++_0x22ddea);}(_0x0767,0xe1));var _0x7076=function(_0x1e90f5,_0x58fcfd){_0x1e90f5=_0x1e90f5-0x0;var _0x1799fd=_0x0767[_0x1e90f5];return _0x1799fd;};'use strict';var _=require(_0x7076('0x0'));var util=require(_0x7076('0x1'));var logger=require(_0x7076('0x2'))(_0x7076('0x3'));var moment=require('moment');var BPromise=require(_0x7076('0x4'));var rp=require(_0x7076('0x5'));var fs=require('fs');var path=require(_0x7076('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7076('0x7'));module[_0x7076('0x8')]=function(_0x43bcd4,_0x3619b7){return _0x43bcd4['define'](_0x7076('0x9'),attributes,{'tableName':_0x7076('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d321b8f..50433dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf780=['client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowWhatsappQueue','find','debug','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x36af1d,_0x5a2569){var _0x4477d3=function(_0x1aafe5){while(--_0x1aafe5){_0x36af1d['push'](_0x36af1d['shift']());}};_0x4477d3(++_0x5a2569);}(_0xf780,0x1b1));var _0x0f78=function(_0x5f0287,_0x53539d){_0x5f0287=_0x5f0287-0x0;var _0x4e4feb=_0xf780[_0x5f0287];return _0x4e4feb;};'use strict';var _=require('lodash');var util=require(_0x0f78('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f78('0x1'))['db'];var utils=require(_0x0f78('0x2'));var logger=require(_0x0f78('0x3'))(_0x0f78('0x4'));var config=require(_0x0f78('0x5'));var jayson=require(_0x0f78('0x6'));var client=jayson[_0x0f78('0x7')][_0x0f78('0x8')]({'port':0x232a});config[_0x0f78('0x9')]=_['defaults'](config['redis'],{'host':_0x0f78('0xa'),'port':0x18eb});var socket=require(_0x0f78('0xb'))(new Redis(config[_0x0f78('0x9')]));require(_0x0f78('0xc'))[_0x0f78('0xd')](socket);function respondWithRpcPromise(_0x374e41,_0x1a550a,_0x5d4337){return new BPromise(function(_0x5c7f68,_0x1c1db4){return client[_0x0f78('0xe')](_0x374e41,_0x5d4337)[_0x0f78('0xf')](function(_0x42ab67){logger[_0x0f78('0x10')](_0x0f78('0x11'),_0x1a550a,_0x0f78('0x12'));logger['debug'](_0x0f78('0x13'),_0x1a550a,'request\x20sent',JSON[_0x0f78('0x14')](_0x42ab67));if(_0x42ab67[_0x0f78('0x15')]){if(_0x42ab67[_0x0f78('0x15')][_0x0f78('0x16')]===0x1f4){logger[_0x0f78('0x15')](_0x0f78('0x11'),_0x1a550a,_0x42ab67[_0x0f78('0x15')][_0x0f78('0x17')]);return _0x1c1db4(_0x42ab67[_0x0f78('0x15')][_0x0f78('0x17')]);}logger[_0x0f78('0x15')](_0x0f78('0x11'),_0x1a550a,_0x42ab67['error'][_0x0f78('0x17')]);return _0x5c7f68(_0x42ab67[_0x0f78('0x15')][_0x0f78('0x17')]);}else{logger[_0x0f78('0x10')](_0x0f78('0x11'),_0x1a550a,_0x0f78('0x12'));_0x5c7f68(_0x42ab67[_0x0f78('0x18')]['message']);}})[_0x0f78('0x19')](function(_0x41952f){logger[_0x0f78('0x15')]('WhatsappQueue,\x20%s,\x20%s',_0x1a550a,_0x41952f);_0x1c1db4(_0x41952f);});});}exports[_0x0f78('0x1a')]=function(_0x5f0040){var _0x3cb16d=this;return new Promise(function(_0x1d1c91,_0x404bc3){return db[_0x0f78('0x1b')][_0x0f78('0x1c')]({'raw':_0x5f0040[_0x0f78('0x1d')]?_0x5f0040[_0x0f78('0x1d')][_0x0f78('0x1e')]===undefined?!![]:![]:!![],'where':_0x5f0040['options']?_0x5f0040[_0x0f78('0x1d')][_0x0f78('0x1f')]||null:null,'attributes':_0x5f0040[_0x0f78('0x1d')]?_0x5f0040['options'][_0x0f78('0x20')]||null:null,'limit':_0x5f0040[_0x0f78('0x1d')]?_0x5f0040['options'][_0x0f78('0x21')]||null:null,'include':_0x5f0040[_0x0f78('0x1d')]?_0x5f0040[_0x0f78('0x1d')][_0x0f78('0x22')]?_[_0x0f78('0x23')](_0x5f0040[_0x0f78('0x1d')][_0x0f78('0x22')],function(_0x3a87f9){return{'model':db[_0x3a87f9[_0x0f78('0x24')]],'as':_0x3a87f9['as'],'attributes':_0x3a87f9[_0x0f78('0x20')],'include':_0x3a87f9[_0x0f78('0x22')]?_['map'](_0x3a87f9[_0x0f78('0x22')],function(_0x428e22){return{'model':db[_0x428e22[_0x0f78('0x24')]],'as':_0x428e22['as'],'attributes':_0x428e22[_0x0f78('0x20')],'include':_0x428e22[_0x0f78('0x22')]?_[_0x0f78('0x23')](_0x428e22['include'],function(_0x306f80){return{'model':db[_0x306f80[_0x0f78('0x24')]],'as':_0x306f80['as'],'attributes':_0x306f80[_0x0f78('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0f78('0xf')](function(_0x427a89){logger['info'](_0x0f78('0x1a'),_0x5f0040);logger['debug'](_0x0f78('0x1a'),_0x5f0040,JSON[_0x0f78('0x14')](_0x427a89));_0x1d1c91(_0x427a89);})[_0x0f78('0x19')](function(_0x42d3a0){logger[_0x0f78('0x15')](_0x0f78('0x1a'),_0x42d3a0[_0x0f78('0x17')],_0x5f0040);_0x404bc3(_0x3cb16d[_0x0f78('0x15')](0x1f4,_0x42d3a0[_0x0f78('0x17')]));});});};exports[_0x0f78('0x25')]=function(_0xe2ff46){var _0x195a33=this;return new Promise(function(_0x55a85d,_0x450aa8){return db[_0x0f78('0x1b')][_0x0f78('0x26')]({'raw':_0xe2ff46[_0x0f78('0x1d')]?_0xe2ff46[_0x0f78('0x1d')][_0x0f78('0x1e')]===undefined?!![]:![]:!![],'where':_0xe2ff46['options']?_0xe2ff46['options'][_0x0f78('0x1f')]||null:null,'attributes':_0xe2ff46[_0x0f78('0x1d')]?_0xe2ff46[_0x0f78('0x1d')][_0x0f78('0x20')]||null:null,'include':_0xe2ff46[_0x0f78('0x1d')]?_0xe2ff46[_0x0f78('0x1d')][_0x0f78('0x22')]?_[_0x0f78('0x23')](_0xe2ff46[_0x0f78('0x1d')]['include'],function(_0x175238){return{'model':db[_0x175238['model']],'as':_0x175238['as'],'attributes':_0x175238[_0x0f78('0x20')],'include':_0x175238[_0x0f78('0x22')]?_[_0x0f78('0x23')](_0x175238[_0x0f78('0x22')],function(_0x26d262){return{'model':db[_0x26d262[_0x0f78('0x24')]],'as':_0x26d262['as'],'attributes':_0x26d262[_0x0f78('0x20')],'include':_0x26d262['include']?_['map'](_0x26d262['include'],function(_0x46d8cc){return{'model':db[_0x46d8cc['model']],'as':_0x46d8cc['as'],'attributes':_0x46d8cc[_0x0f78('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0f78('0xf')](function(_0x134538){logger[_0x0f78('0x10')](_0x0f78('0x25'),_0xe2ff46);logger[_0x0f78('0x27')](_0x0f78('0x25'),_0xe2ff46,JSON[_0x0f78('0x14')](_0x134538));_0x55a85d(_0x134538);})[_0x0f78('0x19')](function(_0x56995a){logger[_0x0f78('0x15')](_0x0f78('0x25'),_0x56995a[_0x0f78('0x17')],_0xe2ff46);_0x450aa8(_0x195a33['error'](0x1f4,_0x56995a[_0x0f78('0x17')]));});});};
\ No newline at end of file
+var _0x18c2=['error','code','message','result','catch','WhatsappQueue','options','raw','attributes','limit','map','include','model','GetWhatsappQueue','find','ShowWhatsappQueue','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappQueue.socket','request','then','info','WhatsappQueue,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x31c482,_0x1430bd){var _0x12ac82=function(_0x3e4f14){while(--_0x3e4f14){_0x31c482['push'](_0x31c482['shift']());}};_0x12ac82(++_0x1430bd);}(_0x18c2,0x121));var _0x218c=function(_0x242be3,_0x5de68d){_0x242be3=_0x242be3-0x0;var _0x4db2e3=_0x18c2[_0x242be3];return _0x4db2e3;};'use strict';var _=require(_0x218c('0x0'));var util=require(_0x218c('0x1'));var moment=require(_0x218c('0x2'));var BPromise=require('bluebird');var rs=require(_0x218c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x218c('0x4'))['db'];var utils=require(_0x218c('0x5'));var logger=require(_0x218c('0x6'))(_0x218c('0x7'));var config=require(_0x218c('0x8'));var jayson=require(_0x218c('0x9'));var client=jayson[_0x218c('0xa')][_0x218c('0xb')]({'port':0x232a});config[_0x218c('0xc')]=_[_0x218c('0xd')](config['redis'],{'host':_0x218c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x218c('0xf'))['register'](socket);function respondWithRpcPromise(_0x26128e,_0x2c8ec6,_0x273a28){return new BPromise(function(_0x2dd75b,_0x5f1c19){return client[_0x218c('0x10')](_0x26128e,_0x273a28)[_0x218c('0x11')](function(_0xc0ff67){logger[_0x218c('0x12')](_0x218c('0x13'),_0x2c8ec6,'request\x20sent');logger[_0x218c('0x14')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x2c8ec6,_0x218c('0x15'),JSON[_0x218c('0x16')](_0xc0ff67));if(_0xc0ff67[_0x218c('0x17')]){if(_0xc0ff67['error'][_0x218c('0x18')]===0x1f4){logger[_0x218c('0x17')](_0x218c('0x13'),_0x2c8ec6,_0xc0ff67['error'][_0x218c('0x19')]);return _0x5f1c19(_0xc0ff67['error'][_0x218c('0x19')]);}logger[_0x218c('0x17')](_0x218c('0x13'),_0x2c8ec6,_0xc0ff67[_0x218c('0x17')][_0x218c('0x19')]);return _0x2dd75b(_0xc0ff67['error'][_0x218c('0x19')]);}else{logger[_0x218c('0x12')]('WhatsappQueue,\x20%s,\x20%s',_0x2c8ec6,'request\x20sent');_0x2dd75b(_0xc0ff67[_0x218c('0x1a')][_0x218c('0x19')]);}})[_0x218c('0x1b')](function(_0x514136){logger[_0x218c('0x17')](_0x218c('0x13'),_0x2c8ec6,_0x514136);_0x5f1c19(_0x514136);});});}exports['GetWhatsappQueue']=function(_0x4b6c29){var _0x537f6e=this;return new Promise(function(_0x1468fd,_0x15c3af){return db[_0x218c('0x1c')]['findAll']({'raw':_0x4b6c29[_0x218c('0x1d')]?_0x4b6c29[_0x218c('0x1d')][_0x218c('0x1e')]===undefined?!![]:![]:!![],'where':_0x4b6c29[_0x218c('0x1d')]?_0x4b6c29[_0x218c('0x1d')]['where']||null:null,'attributes':_0x4b6c29[_0x218c('0x1d')]?_0x4b6c29['options'][_0x218c('0x1f')]||null:null,'limit':_0x4b6c29[_0x218c('0x1d')]?_0x4b6c29[_0x218c('0x1d')][_0x218c('0x20')]||null:null,'include':_0x4b6c29[_0x218c('0x1d')]?_0x4b6c29[_0x218c('0x1d')]['include']?_[_0x218c('0x21')](_0x4b6c29[_0x218c('0x1d')][_0x218c('0x22')],function(_0x371246){return{'model':db[_0x371246[_0x218c('0x23')]],'as':_0x371246['as'],'attributes':_0x371246[_0x218c('0x1f')],'include':_0x371246[_0x218c('0x22')]?_[_0x218c('0x21')](_0x371246['include'],function(_0xa25b76){return{'model':db[_0xa25b76[_0x218c('0x23')]],'as':_0xa25b76['as'],'attributes':_0xa25b76[_0x218c('0x1f')],'include':_0xa25b76[_0x218c('0x22')]?_['map'](_0xa25b76['include'],function(_0x5a2cc5){return{'model':db[_0x5a2cc5['model']],'as':_0x5a2cc5['as'],'attributes':_0x5a2cc5[_0x218c('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x218c('0x11')](function(_0x645a7e){logger[_0x218c('0x12')](_0x218c('0x24'),_0x4b6c29);logger[_0x218c('0x14')](_0x218c('0x24'),_0x4b6c29,JSON[_0x218c('0x16')](_0x645a7e));_0x1468fd(_0x645a7e);})[_0x218c('0x1b')](function(_0x235d64){logger[_0x218c('0x17')](_0x218c('0x24'),_0x235d64[_0x218c('0x19')],_0x4b6c29);_0x15c3af(_0x537f6e[_0x218c('0x17')](0x1f4,_0x235d64['message']));});});};exports['ShowWhatsappQueue']=function(_0x50fb1a){var _0x1b3fe4=this;return new Promise(function(_0x5763a7,_0x225bad){return db[_0x218c('0x1c')][_0x218c('0x25')]({'raw':_0x50fb1a[_0x218c('0x1d')]?_0x50fb1a[_0x218c('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x50fb1a[_0x218c('0x1d')]?_0x50fb1a['options']['where']||null:null,'attributes':_0x50fb1a[_0x218c('0x1d')]?_0x50fb1a[_0x218c('0x1d')][_0x218c('0x1f')]||null:null,'include':_0x50fb1a['options']?_0x50fb1a[_0x218c('0x1d')][_0x218c('0x22')]?_[_0x218c('0x21')](_0x50fb1a[_0x218c('0x1d')][_0x218c('0x22')],function(_0x1b3360){return{'model':db[_0x1b3360['model']],'as':_0x1b3360['as'],'attributes':_0x1b3360[_0x218c('0x1f')],'include':_0x1b3360[_0x218c('0x22')]?_[_0x218c('0x21')](_0x1b3360[_0x218c('0x22')],function(_0x51486c){return{'model':db[_0x51486c[_0x218c('0x23')]],'as':_0x51486c['as'],'attributes':_0x51486c[_0x218c('0x1f')],'include':_0x51486c[_0x218c('0x22')]?_[_0x218c('0x21')](_0x51486c[_0x218c('0x22')],function(_0x6b084c){return{'model':db[_0x6b084c[_0x218c('0x23')]],'as':_0x6b084c['as'],'attributes':_0x6b084c[_0x218c('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a2ca6){logger[_0x218c('0x12')](_0x218c('0x26'),_0x50fb1a);logger['debug']('ShowWhatsappQueue',_0x50fb1a,JSON[_0x218c('0x16')](_0x3a2ca6));_0x5763a7(_0x3a2ca6);})[_0x218c('0x1b')](function(_0x471653){logger[_0x218c('0x17')](_0x218c('0x26'),_0x471653[_0x218c('0x19')],_0x50fb1a);_0x225bad(_0x1b3fe4[_0x218c('0x17')](0x1f4,_0x471653['message']));});});};
\ No newline at end of file
index 00d798a..c1a0c2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b2e=['./whatsappQueue.events','save','update','emit','register','length','whatsappQueue:'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x9b2e,0x150));var _0xe9b2=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x9b2e[_0x53ccf2];return _0x5a2964;};'use strict';var WhatsappQueueEvents=require(_0xe9b2('0x0'));var events=[_0xe9b2('0x1'),'remove',_0xe9b2('0x2')];function createListener(_0x18cd66,_0x1a43cd){return function(_0x141b32){_0x1a43cd[_0xe9b2('0x3')](_0x18cd66,_0x141b32);};}function removeListener(_0x514e2b,_0x2075fe){return function(){WhatsappQueueEvents['removeListener'](_0x514e2b,_0x2075fe);};}exports[_0xe9b2('0x4')]=function(_0x1b26f8){for(var _0x548384=0x0,_0x143aa2=events[_0xe9b2('0x5')];_0x548384<_0x143aa2;_0x548384++){var _0x26ce99=events[_0x548384];var _0x59c28c=createListener(_0xe9b2('0x6')+_0x26ce99,_0x1b26f8);WhatsappQueueEvents['on'](_0x26ce99,_0x59c28c);}};
\ No newline at end of file
+var _0x8b57=['removeListener','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit'];(function(_0x399ec4,_0x171506){var _0xe80142=function(_0x32cbd2){while(--_0x32cbd2){_0x399ec4['push'](_0x399ec4['shift']());}};_0xe80142(++_0x171506);}(_0x8b57,0x64));var _0x78b5=function(_0x2ffc14,_0x572e46){_0x2ffc14=_0x2ffc14-0x0;var _0x59e838=_0x8b57[_0x2ffc14];return _0x59e838;};'use strict';var WhatsappQueueEvents=require(_0x78b5('0x0'));var events=[_0x78b5('0x1'),_0x78b5('0x2'),_0x78b5('0x3')];function createListener(_0x476456,_0x259359){return function(_0x51c3c0){_0x259359[_0x78b5('0x4')](_0x476456,_0x51c3c0);};}function removeListener(_0x12fd2e,_0x50e27a){return function(){WhatsappQueueEvents[_0x78b5('0x5')](_0x12fd2e,_0x50e27a);};}exports['register']=function(_0x29fa68){for(var _0x5cbddf=0x0,_0x5ebf11=events['length'];_0x5cbddf<_0x5ebf11;_0x5cbddf++){var _0x1ff144=events[_0x5cbddf];var _0x4c527d=createListener(_0x78b5('0x6')+_0x1ff144,_0x29fa68);WhatsappQueueEvents['on'](_0x1ff144,_0x4c527d);}};
\ No newline at end of file
index b324069..b18aa1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb3f=['../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5e53be,_0x28ffa5){var _0x370496=function(_0x2d8d59){while(--_0x2d8d59){_0x5e53be['push'](_0x5e53be['shift']());}};_0x370496(++_0x28ffa5);}(_0xbb3f,0xfe));var _0xfbb3=function(_0x470995,_0x3671cf){_0x470995=_0x470995-0x0;var _0x1f67f9=_0xbb3f[_0x470995];return _0x1f67f9;};'use strict';var multer=require(_0xfbb3('0x0'));var util=require(_0xfbb3('0x1'));var path=require('path');var timeout=require(_0xfbb3('0x2'));var express=require(_0xfbb3('0x3'));var router=express['Router']();var fs_extra=require(_0xfbb3('0x4'));var auth=require(_0xfbb3('0x5'));var interaction=require(_0xfbb3('0x6'));var config=require(_0xfbb3('0x7'));var controller=require(_0xfbb3('0x8'));router['get']('/',auth[_0xfbb3('0x9')](),controller[_0xfbb3('0xa')]);router[_0xfbb3('0xb')](_0xfbb3('0xc'),auth[_0xfbb3('0x9')](),controller[_0xfbb3('0xd')]);router['get'](_0xfbb3('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xfbb3('0xf')]('/',auth[_0xfbb3('0x9')](),controller[_0xfbb3('0x10')]);router['put']('/:id',auth[_0xfbb3('0x9')](),controller['update']);router[_0xfbb3('0x11')](_0xfbb3('0xe'),auth[_0xfbb3('0x9')](),controller[_0xfbb3('0x12')]);module[_0xfbb3('0x13')]=router;
\ No newline at end of file
+var _0x954c=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update'];(function(_0x1f3850,_0x1792a2){var _0x53f2b9=function(_0x1c4bf3){while(--_0x1c4bf3){_0x1f3850['push'](_0x1f3850['shift']());}};_0x53f2b9(++_0x1792a2);}(_0x954c,0xbe));var _0xc954=function(_0x480b1e,_0x30422e){_0x480b1e=_0x480b1e-0x0;var _0x337b64=_0x954c[_0x480b1e];return _0x337b64;};'use strict';var multer=require(_0xc954('0x0'));var util=require(_0xc954('0x1'));var path=require(_0xc954('0x2'));var timeout=require(_0xc954('0x3'));var express=require('express');var router=express[_0xc954('0x4')]();var fs_extra=require(_0xc954('0x5'));var auth=require(_0xc954('0x6'));var interaction=require(_0xc954('0x7'));var config=require(_0xc954('0x8'));var controller=require('./whatsappQueueReport.controller');router[_0xc954('0x9')]('/',auth['isAuthenticated'](),controller[_0xc954('0xa')]);router['get'](_0xc954('0xb'),auth[_0xc954('0xc')](),controller[_0xc954('0xd')]);router[_0xc954('0x9')](_0xc954('0xe'),auth[_0xc954('0xc')](),controller[_0xc954('0xf')]);router[_0xc954('0x10')]('/',auth[_0xc954('0xc')](),controller[_0xc954('0x11')]);router[_0xc954('0x12')](_0xc954('0xe'),auth[_0xc954('0xc')](),controller[_0xc954('0x13')]);router['delete'](_0xc954('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0xc954('0x14')]=router;
\ No newline at end of file
index db365f6..bafaaa7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x5c43d5,_0x49ba17){var _0x5cd97f=function(_0x188c4f){while(--_0x188c4f){_0x5c43d5['push'](_0x5c43d5['shift']());}};_0x5cd97f(++_0x49ba17);}(_0x7a54,0x106));var _0x47a5=function(_0x28def9,_0x2a123a){_0x28def9=_0x28def9-0x0;var _0x52b654=_0x7a54[_0x28def9];return _0x52b654;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
+var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x4d7eaa,_0x3241b3){var _0x1cdf48=function(_0x4f7c59){while(--_0x4f7c59){_0x4d7eaa['push'](_0x4d7eaa['shift']());}};_0x1cdf48(++_0x3241b3);}(_0x7a54,0x106));var _0x47a5=function(_0x4bc34c,_0x98375b){_0x4bc34c=_0x4bc34c-0x0;var _0x2273bf=_0x7a54[_0x4bc34c];return _0x2273bf;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
index 28d98e7..fff0b76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e6c=['reject','save','update','then','destroy','end','error','stack','name','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x55e97e,_0x588911){var _0x5915a8=function(_0x19f35c){while(--_0x19f35c){_0x55e97e['push'](_0x55e97e['shift']());}};_0x5915a8(++_0x588911);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xc6e6('0x0'));var rimraf=require(_0xc6e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc6e6('0x2'));var rp=require(_0xc6e6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc6e6('0x4'));var util=require('util');var path=require(_0xc6e6('0x5'));var sox=require('sox');var csv=require(_0xc6e6('0x6'));var ejs=require(_0xc6e6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc6e6('0x8'));var squel=require(_0xc6e6('0x9'));var crypto=require('crypto');var jsforce=require(_0xc6e6('0xa'));var deskjs=require(_0xc6e6('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc6e6('0xc'));var Papa=require('papaparse');var Redis=require(_0xc6e6('0xd'));var authService=require(_0xc6e6('0xe'));var qs=require(_0xc6e6('0xf'));var as=require(_0xc6e6('0x10'));var hardwareService=require(_0xc6e6('0x11'));var logger=require(_0xc6e6('0x12'))(_0xc6e6('0x13'));var utils=require(_0xc6e6('0x14'));var config=require(_0xc6e6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc6e6('0x16'))['db'];function respondWithStatusCode(_0x525d60,_0x3a30ce){_0x3a30ce=_0x3a30ce||0xcc;return function(_0x314d0f){if(_0x314d0f){return _0x525d60[_0xc6e6('0x17')](_0x3a30ce);}return _0x525d60[_0xc6e6('0x18')](_0x3a30ce)['end']();};}function respondWithResult(_0x149ac6,_0x2bfe7d){_0x2bfe7d=_0x2bfe7d||0xc8;return function(_0x13be73){if(_0x13be73){return _0x149ac6[_0xc6e6('0x18')](_0x2bfe7d)[_0xc6e6('0x19')](_0x13be73);}};}function respondWithFilteredResult(_0x4cdf15,_0x413cf8){return function(_0x178b34){if(_0x178b34){var _0x569474=typeof _0x413cf8[_0xc6e6('0x1a')]===_0xc6e6('0x1b')&&typeof _0x413cf8[_0xc6e6('0x1c')]==='undefined';var _0x51fd7c=_0x178b34['count'];var _0x3a1ccc=_0x569474?0x0:_0x413cf8['offset'];var _0x46e58f=_0x569474?_0x178b34[_0xc6e6('0x1d')]:_0x413cf8[_0xc6e6('0x1a')]+_0x413cf8[_0xc6e6('0x1c')];var _0x19e1e4;if(_0x46e58f>=_0x51fd7c){_0x46e58f=_0x51fd7c;_0x19e1e4=0xc8;}else{_0x19e1e4=0xce;}_0x4cdf15[_0xc6e6('0x18')](_0x19e1e4);return _0x4cdf15[_0xc6e6('0x1e')](_0xc6e6('0x1f'),_0x3a1ccc+'-'+_0x46e58f+'/'+_0x51fd7c)[_0xc6e6('0x19')](_0x178b34);}return null;};}function patchUpdates(_0x3d734d){return function(_0x4a36b6){try{jsonpatch[_0xc6e6('0x20')](_0x4a36b6,_0x3d734d,!![]);}catch(_0x4ad70e){return BPromise[_0xc6e6('0x21')](_0x4ad70e);}return _0x4a36b6[_0xc6e6('0x22')]();};}function saveUpdates(_0x2be6fc,_0x2f69f1){return function(_0x4f1d68){if(_0x4f1d68){return _0x4f1d68[_0xc6e6('0x23')](_0x2be6fc)[_0xc6e6('0x24')](function(_0x3a96df){return _0x3a96df;});}return null;};}function removeEntity(_0x36ebfa,_0x107561){return function(_0x4c35ae){if(_0x4c35ae){return _0x4c35ae[_0xc6e6('0x25')]()['then'](function(){_0x36ebfa[_0xc6e6('0x18')](0xcc)[_0xc6e6('0x26')]();});}};}function handleEntityNotFound(_0x2e5e0e,_0x64e1dc){return function(_0x53a1bf){if(!_0x53a1bf){_0x2e5e0e[_0xc6e6('0x17')](0x194);}return _0x53a1bf;};}function handleError(_0x5a5e47,_0x28577b){_0x28577b=_0x28577b||0x1f4;return function(_0x534745){logger[_0xc6e6('0x27')](_0x534745[_0xc6e6('0x28')]);if(_0x534745[_0xc6e6('0x29')]){delete _0x534745[_0xc6e6('0x29')];}_0x5a5e47[_0xc6e6('0x18')](_0x28577b)['send'](_0x534745);};}exports[_0xc6e6('0x2a')]=function(_0x1501bd,_0x166313){var _0x1af05c={},_0x4d1284={},_0x34ae96={'count':0x0,'rows':[]};var _0x50b735=_[_0xc6e6('0x2b')](db[_0xc6e6('0x2c')][_0xc6e6('0x2d')],function(_0xc578b3){return{'name':_0xc578b3[_0xc6e6('0x2e')],'type':_0xc578b3[_0xc6e6('0x2f')][_0xc6e6('0x30')]};});_0x4d1284[_0xc6e6('0x31')]=_[_0xc6e6('0x2b')](_0x50b735,_0xc6e6('0x29'));_0x4d1284[_0xc6e6('0x32')]=_[_0xc6e6('0x33')](_0x1501bd[_0xc6e6('0x32')]);_0x4d1284[_0xc6e6('0x34')]=_[_0xc6e6('0x35')](_0x4d1284[_0xc6e6('0x31')],_0x4d1284[_0xc6e6('0x32')]);_0x1af05c['attributes']=_[_0xc6e6('0x35')](_0x4d1284[_0xc6e6('0x31')],qs['fields'](_0x1501bd['query'][_0xc6e6('0x36')]));_0x1af05c[_0xc6e6('0x37')]=_0x1af05c[_0xc6e6('0x37')][_0xc6e6('0x38')]?_0x1af05c[_0xc6e6('0x37')]:_0x4d1284[_0xc6e6('0x31')];if(!_0x1501bd['query'][_0xc6e6('0x39')](_0xc6e6('0x3a'))){_0x1af05c[_0xc6e6('0x1c')]=qs['limit'](_0x1501bd['query'][_0xc6e6('0x1c')]);_0x1af05c[_0xc6e6('0x1a')]=qs[_0xc6e6('0x1a')](_0x1501bd[_0xc6e6('0x32')]['offset']);}_0x1af05c['order']=qs[_0xc6e6('0x3b')](_0x1501bd['query'][_0xc6e6('0x3b')]);_0x1af05c['where']=qs[_0xc6e6('0x34')](_[_0xc6e6('0x3c')](_0x1501bd[_0xc6e6('0x32')],_0x4d1284[_0xc6e6('0x34')]),_0x50b735);if(_0x1501bd['query']['filter']){_0x1af05c[_0xc6e6('0x3d')]=_[_0xc6e6('0x3e')](_0x1af05c[_0xc6e6('0x3d')],{'$or':_[_0xc6e6('0x2b')](_0x50b735,function(_0x4bb732){if(_0x4bb732['type']!==_0xc6e6('0x3f')){var _0x1326c7={};_0x1326c7[_0x4bb732[_0xc6e6('0x29')]]={'$like':'%'+_0x1501bd[_0xc6e6('0x32')]['filter']+'%'};return _0x1326c7;}})});}_0x1af05c=_[_0xc6e6('0x3e')]({},_0x1af05c,_0x1501bd[_0xc6e6('0x40')]);var _0x5ddab4={'where':_0x1af05c['where']};return db[_0xc6e6('0x2c')]['count'](_0x5ddab4)[_0xc6e6('0x24')](function(_0x3817fc){_0x34ae96['count']=_0x3817fc;if(_0x1501bd[_0xc6e6('0x32')]['includeAll']){_0x1af05c[_0xc6e6('0x41')]=[{'all':!![]}];}return db['WhatsappQueueReport'][_0xc6e6('0x42')](_0x1af05c);})[_0xc6e6('0x24')](function(_0x247076){_0x34ae96[_0xc6e6('0x43')]=_0x247076;return _0x34ae96;})[_0xc6e6('0x24')](respondWithFilteredResult(_0x166313,_0x1af05c))[_0xc6e6('0x44')](handleError(_0x166313,null));};exports[_0xc6e6('0x45')]=function(_0x69766,_0x5ecf6c){var _0x5722db={'raw':!![],'where':{'id':_0x69766[_0xc6e6('0x46')]['id']}},_0x3e3da6={};_0x3e3da6[_0xc6e6('0x31')]=_[_0xc6e6('0x33')](db['WhatsappQueueReport'][_0xc6e6('0x2d')]);_0x3e3da6[_0xc6e6('0x32')]=_[_0xc6e6('0x33')](_0x69766[_0xc6e6('0x32')]);_0x3e3da6['filters']=_[_0xc6e6('0x35')](_0x3e3da6[_0xc6e6('0x31')],_0x3e3da6[_0xc6e6('0x32')]);_0x5722db[_0xc6e6('0x37')]=_[_0xc6e6('0x35')](_0x3e3da6['model'],qs[_0xc6e6('0x36')](_0x69766['query'][_0xc6e6('0x36')]));_0x5722db['attributes']=_0x5722db[_0xc6e6('0x37')][_0xc6e6('0x38')]?_0x5722db[_0xc6e6('0x37')]:_0x3e3da6[_0xc6e6('0x31')];if(_0x69766[_0xc6e6('0x32')][_0xc6e6('0x47')]){_0x5722db[_0xc6e6('0x41')]=[{'all':!![]}];}_0x5722db=_[_0xc6e6('0x3e')]({},_0x5722db,_0x69766['options']);return db[_0xc6e6('0x2c')][_0xc6e6('0x48')](_0x5722db)[_0xc6e6('0x24')](handleEntityNotFound(_0x5ecf6c,null))['then'](respondWithResult(_0x5ecf6c,null))[_0xc6e6('0x44')](handleError(_0x5ecf6c,null));};exports[_0xc6e6('0x49')]=function(_0x38ecc3,_0x42ed90){return db[_0xc6e6('0x2c')][_0xc6e6('0x49')](_0x38ecc3[_0xc6e6('0x4a')],{})[_0xc6e6('0x24')](respondWithResult(_0x42ed90,0xc9))[_0xc6e6('0x44')](handleError(_0x42ed90,null));};exports[_0xc6e6('0x23')]=function(_0x3bfe85,_0x470167){if(_0x3bfe85[_0xc6e6('0x4a')]['id']){delete _0x3bfe85[_0xc6e6('0x4a')]['id'];}return db['WhatsappQueueReport'][_0xc6e6('0x48')]({'where':{'id':_0x3bfe85['params']['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x470167,null))[_0xc6e6('0x24')](saveUpdates(_0x3bfe85['body'],null))['then'](respondWithResult(_0x470167,null))['catch'](handleError(_0x470167,null));};exports['destroy']=function(_0x531dca,_0x3edc16){return db[_0xc6e6('0x2c')][_0xc6e6('0x48')]({'where':{'id':_0x531dca[_0xc6e6('0x46')]['id']}})[_0xc6e6('0x24')](handleEntityNotFound(_0x3edc16,null))['then'](removeEntity(_0x3edc16,null))['catch'](handleError(_0x3edc16,null));};exports[_0xc6e6('0x4b')]=function(_0x2d5e44,_0x1aa872){return db[_0xc6e6('0x2c')]['describe']()[_0xc6e6('0x24')](respondWithResult(_0x1aa872,null))[_0xc6e6('0x44')](handleError(_0x1aa872,null));};
\ No newline at end of file
+var _0xdb94=['length','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','type','model','query','keys','intersection','attributes','fields'];(function(_0x104bef,_0xa01c4f){var _0x162107=function(_0x26b3d5){while(--_0x26b3d5){_0x104bef['push'](_0x104bef['shift']());}};_0x162107(++_0xa01c4f);}(_0xdb94,0xab));var _0x4db9=function(_0x3e6cfb,_0x452880){_0x3e6cfb=_0x3e6cfb-0x0;var _0x72a2cd=_0xdb94[_0x3e6cfb];return _0x72a2cd;};'use strict';var emlformat=require(_0x4db9('0x0'));var rimraf=require(_0x4db9('0x1'));var zipdir=require(_0x4db9('0x2'));var jsonpatch=require(_0x4db9('0x3'));var rp=require(_0x4db9('0x4'));var moment=require('moment');var BPromise=require(_0x4db9('0x5'));var Mustache=require(_0x4db9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4db9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4db9('0x8'));var _=require('lodash');var squel=require(_0x4db9('0x9'));var crypto=require('crypto');var jsforce=require(_0x4db9('0xa'));var deskjs=require(_0x4db9('0xb'));var toCsv=require(_0x4db9('0xc'));var querystring=require(_0x4db9('0xd'));var Papa=require(_0x4db9('0xe'));var Redis=require(_0x4db9('0xf'));var authService=require(_0x4db9('0x10'));var qs=require(_0x4db9('0x11'));var as=require(_0x4db9('0x12'));var hardwareService=require(_0x4db9('0x13'));var logger=require(_0x4db9('0x14'))('api');var utils=require(_0x4db9('0x15'));var config=require(_0x4db9('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31222b,_0x5e644c){_0x5e644c=_0x5e644c||0xcc;return function(_0x571685){if(_0x571685){return _0x31222b[_0x4db9('0x17')](_0x5e644c);}return _0x31222b[_0x4db9('0x18')](_0x5e644c)['end']();};}function respondWithResult(_0xd37d63,_0x1f9638){_0x1f9638=_0x1f9638||0xc8;return function(_0x452896){if(_0x452896){return _0xd37d63[_0x4db9('0x18')](_0x1f9638)['json'](_0x452896);}};}function respondWithFilteredResult(_0x5e04ab,_0x102274){return function(_0x34de1a){if(_0x34de1a){var _0x4a037f=typeof _0x102274[_0x4db9('0x19')]===_0x4db9('0x1a')&&typeof _0x102274['limit']==='undefined';var _0x250a80=_0x34de1a[_0x4db9('0x1b')];var _0x462af3=_0x4a037f?0x0:_0x102274[_0x4db9('0x19')];var _0x1d3c33=_0x4a037f?_0x34de1a['count']:_0x102274[_0x4db9('0x19')]+_0x102274[_0x4db9('0x1c')];var _0x11012e;if(_0x1d3c33>=_0x250a80){_0x1d3c33=_0x250a80;_0x11012e=0xc8;}else{_0x11012e=0xce;}_0x5e04ab['status'](_0x11012e);return _0x5e04ab[_0x4db9('0x1d')](_0x4db9('0x1e'),_0x462af3+'-'+_0x1d3c33+'/'+_0x250a80)[_0x4db9('0x1f')](_0x34de1a);}return null;};}function patchUpdates(_0x4c92e8){return function(_0x46b522){try{jsonpatch[_0x4db9('0x20')](_0x46b522,_0x4c92e8,!![]);}catch(_0x4553c2){return BPromise[_0x4db9('0x21')](_0x4553c2);}return _0x46b522[_0x4db9('0x22')]();};}function saveUpdates(_0x159d9b,_0x3585d5){return function(_0x5aef3b){if(_0x5aef3b){return _0x5aef3b[_0x4db9('0x23')](_0x159d9b)[_0x4db9('0x24')](function(_0xcde40c){return _0xcde40c;});}return null;};}function removeEntity(_0x319475,_0x4aaa84){return function(_0x213daa){if(_0x213daa){return _0x213daa[_0x4db9('0x25')]()['then'](function(){_0x319475[_0x4db9('0x18')](0xcc)[_0x4db9('0x26')]();});}};}function handleEntityNotFound(_0x2987c6,_0x4dbb1b){return function(_0x3c8237){if(!_0x3c8237){_0x2987c6[_0x4db9('0x17')](0x194);}return _0x3c8237;};}function handleError(_0x43b95e,_0x2d330e){_0x2d330e=_0x2d330e||0x1f4;return function(_0x3f9f7e){logger[_0x4db9('0x27')](_0x3f9f7e[_0x4db9('0x28')]);if(_0x3f9f7e[_0x4db9('0x29')]){delete _0x3f9f7e[_0x4db9('0x29')];}_0x43b95e[_0x4db9('0x18')](_0x2d330e)[_0x4db9('0x2a')](_0x3f9f7e);};}exports[_0x4db9('0x2b')]=function(_0x2d646d,_0x20f133){var _0x583861={},_0x5031fe={},_0x3951b2={'count':0x0,'rows':[]};var _0x331279=_[_0x4db9('0x2c')](db[_0x4db9('0x2d')][_0x4db9('0x2e')],function(_0x459131){return{'name':_0x459131['fieldName'],'type':_0x459131[_0x4db9('0x2f')]['key']};});_0x5031fe[_0x4db9('0x30')]=_[_0x4db9('0x2c')](_0x331279,_0x4db9('0x29'));_0x5031fe[_0x4db9('0x31')]=_[_0x4db9('0x32')](_0x2d646d['query']);_0x5031fe['filters']=_[_0x4db9('0x33')](_0x5031fe['model'],_0x5031fe[_0x4db9('0x31')]);_0x583861[_0x4db9('0x34')]=_['intersection'](_0x5031fe[_0x4db9('0x30')],qs[_0x4db9('0x35')](_0x2d646d[_0x4db9('0x31')]['fields']));_0x583861[_0x4db9('0x34')]=_0x583861['attributes'][_0x4db9('0x36')]?_0x583861[_0x4db9('0x34')]:_0x5031fe[_0x4db9('0x30')];if(!_0x2d646d['query']['hasOwnProperty'](_0x4db9('0x37'))){_0x583861[_0x4db9('0x1c')]=qs[_0x4db9('0x1c')](_0x2d646d[_0x4db9('0x31')][_0x4db9('0x1c')]);_0x583861[_0x4db9('0x19')]=qs[_0x4db9('0x19')](_0x2d646d[_0x4db9('0x31')][_0x4db9('0x19')]);}_0x583861['order']=qs[_0x4db9('0x38')](_0x2d646d[_0x4db9('0x31')][_0x4db9('0x38')]);_0x583861[_0x4db9('0x39')]=qs['filters'](_[_0x4db9('0x3a')](_0x2d646d[_0x4db9('0x31')],_0x5031fe[_0x4db9('0x3b')]),_0x331279);if(_0x2d646d['query'][_0x4db9('0x3c')]){_0x583861[_0x4db9('0x39')]=_[_0x4db9('0x3d')](_0x583861[_0x4db9('0x39')],{'$or':_['map'](_0x331279,function(_0x5a78b4){if(_0x5a78b4[_0x4db9('0x2f')]!==_0x4db9('0x3e')){var _0x32e62b={};_0x32e62b[_0x5a78b4[_0x4db9('0x29')]]={'$like':'%'+_0x2d646d[_0x4db9('0x31')]['filter']+'%'};return _0x32e62b;}})});}_0x583861=_[_0x4db9('0x3d')]({},_0x583861,_0x2d646d[_0x4db9('0x3f')]);var _0x23affc={'where':_0x583861[_0x4db9('0x39')]};return db[_0x4db9('0x2d')]['count'](_0x23affc)[_0x4db9('0x24')](function(_0x324765){_0x3951b2[_0x4db9('0x1b')]=_0x324765;if(_0x2d646d['query'][_0x4db9('0x40')]){_0x583861[_0x4db9('0x41')]=[{'all':!![]}];}return db[_0x4db9('0x2d')][_0x4db9('0x42')](_0x583861);})[_0x4db9('0x24')](function(_0x24aa2a){_0x3951b2[_0x4db9('0x43')]=_0x24aa2a;return _0x3951b2;})[_0x4db9('0x24')](respondWithFilteredResult(_0x20f133,_0x583861))[_0x4db9('0x44')](handleError(_0x20f133,null));};exports[_0x4db9('0x45')]=function(_0x4bb740,_0x56bd68){var _0x48aaf5={'raw':!![],'where':{'id':_0x4bb740[_0x4db9('0x46')]['id']}},_0x22a021={};_0x22a021['model']=_[_0x4db9('0x32')](db[_0x4db9('0x2d')]['rawAttributes']);_0x22a021['query']=_[_0x4db9('0x32')](_0x4bb740['query']);_0x22a021[_0x4db9('0x3b')]=_[_0x4db9('0x33')](_0x22a021['model'],_0x22a021[_0x4db9('0x31')]);_0x48aaf5[_0x4db9('0x34')]=_['intersection'](_0x22a021[_0x4db9('0x30')],qs[_0x4db9('0x35')](_0x4bb740[_0x4db9('0x31')]['fields']));_0x48aaf5['attributes']=_0x48aaf5[_0x4db9('0x34')][_0x4db9('0x36')]?_0x48aaf5[_0x4db9('0x34')]:_0x22a021[_0x4db9('0x30')];if(_0x4bb740[_0x4db9('0x31')][_0x4db9('0x40')]){_0x48aaf5[_0x4db9('0x41')]=[{'all':!![]}];}_0x48aaf5=_[_0x4db9('0x3d')]({},_0x48aaf5,_0x4bb740[_0x4db9('0x3f')]);return db[_0x4db9('0x2d')][_0x4db9('0x47')](_0x48aaf5)[_0x4db9('0x24')](handleEntityNotFound(_0x56bd68,null))[_0x4db9('0x24')](respondWithResult(_0x56bd68,null))['catch'](handleError(_0x56bd68,null));};exports[_0x4db9('0x48')]=function(_0x2faacf,_0x3852f0){return db[_0x4db9('0x2d')][_0x4db9('0x48')](_0x2faacf[_0x4db9('0x49')],{})[_0x4db9('0x24')](respondWithResult(_0x3852f0,0xc9))[_0x4db9('0x44')](handleError(_0x3852f0,null));};exports[_0x4db9('0x23')]=function(_0x2d6094,_0x10dccb){if(_0x2d6094['body']['id']){delete _0x2d6094['body']['id'];}return db[_0x4db9('0x2d')][_0x4db9('0x47')]({'where':{'id':_0x2d6094[_0x4db9('0x46')]['id']}})[_0x4db9('0x24')](handleEntityNotFound(_0x10dccb,null))[_0x4db9('0x24')](saveUpdates(_0x2d6094[_0x4db9('0x49')],null))[_0x4db9('0x24')](respondWithResult(_0x10dccb,null))[_0x4db9('0x44')](handleError(_0x10dccb,null));};exports['destroy']=function(_0xd8eae3,_0xcb832e){return db[_0x4db9('0x2d')][_0x4db9('0x47')]({'where':{'id':_0xd8eae3[_0x4db9('0x46')]['id']}})[_0x4db9('0x24')](handleEntityNotFound(_0xcb832e,null))[_0x4db9('0x24')](removeEntity(_0xcb832e,null))[_0x4db9('0x44')](handleError(_0xcb832e,null));};exports['describe']=function(_0x45bc79,_0xd6701a){return db[_0x4db9('0x2d')][_0x4db9('0x4a')]()[_0x4db9('0x24')](respondWithResult(_0xd6701a,null))[_0x4db9('0x44')](handleError(_0xd6701a,null));};
\ No newline at end of file
index ee4e9f6..c9326e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7a5=['define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','./whatsappQueueReport.attributes','exports'];(function(_0x3662c2,_0x48c0f9){var _0x35ae9a=function(_0x17caf2){while(--_0x17caf2){_0x3662c2['push'](_0x3662c2['shift']());}};_0x35ae9a(++_0x48c0f9);}(_0xb7a5,0x108));var _0x5b7a=function(_0x3df673,_0x330669){_0x3df673=_0x3df673-0x0;var _0xacf136=_0xb7a5[_0x3df673];return _0xacf136;};'use strict';var _=require(_0x5b7a('0x0'));var util=require(_0x5b7a('0x1'));var logger=require(_0x5b7a('0x2'))(_0x5b7a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5b7a('0x4'));var fs=require('fs');var path=require(_0x5b7a('0x5'));var rimraf=require(_0x5b7a('0x6'));var config=require('../../config/environment');var attributes=require(_0x5b7a('0x7'));module[_0x5b7a('0x8')]=function(_0x331b96,_0x4b1900){return _0x331b96[_0x5b7a('0x9')](_0x5b7a('0xa'),attributes,{'tableName':_0x5b7a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5b7a('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc254=['api','bluebird','path','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x56d970,_0x42c6e6){var _0x9180e6=function(_0x38b9d9){while(--_0x38b9d9){_0x56d970['push'](_0x56d970['shift']());}};_0x9180e6(++_0x42c6e6);}(_0xc254,0x194));var _0x4c25=function(_0x1206f1,_0x532d60){_0x1206f1=_0x1206f1-0x0;var _0x5e59e8=_0xc254[_0x1206f1];return _0x5e59e8;};'use strict';var _=require(_0x4c25('0x0'));var util=require(_0x4c25('0x1'));var logger=require(_0x4c25('0x2'))(_0x4c25('0x3'));var moment=require('moment');var BPromise=require(_0x4c25('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c25('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappQueueReport.attributes');module[_0x4c25('0x6')]=function(_0x4177f,_0x4294a7){return _0x4177f[_0x4c25('0x7')](_0x4c25('0x8'),attributes,{'tableName':_0x4c25('0x9'),'paranoid':![],'indexes':[{'name':_0x4c25('0xa'),'fields':[_0x4c25('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 969a1cc..5d4db57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e8f=['lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','options','raw','where','attributes','limit','UpdateWhatsappQueueReport'];(function(_0x15430f,_0x484a4c){var _0x3e839b=function(_0x46d596){while(--_0x46d596){_0x15430f['push'](_0x15430f['shift']());}};_0x3e839b(++_0x484a4c);}(_0x2e8f,0x1ad));var _0xf2e8=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x2e8f[_0x20a558];return _0x53d3f7;};'use strict';var _=require(_0xf2e8('0x0'));var util=require(_0xf2e8('0x1'));var moment=require(_0xf2e8('0x2'));var BPromise=require('bluebird');var rs=require(_0xf2e8('0x3'));var fs=require('fs');var Redis=require(_0xf2e8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf2e8('0x5'));var logger=require(_0xf2e8('0x6'))(_0xf2e8('0x7'));var config=require(_0xf2e8('0x8'));var jayson=require(_0xf2e8('0x9'));var client=jayson[_0xf2e8('0xa')][_0xf2e8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17c60d,_0x98a52f,_0x4e324d){return new BPromise(function(_0x45ed6b,_0x420e75){return client[_0xf2e8('0xc')](_0x17c60d,_0x4e324d)[_0xf2e8('0xd')](function(_0x28b1e8){logger[_0xf2e8('0xe')](_0xf2e8('0xf'),_0x98a52f,_0xf2e8('0x10'));logger[_0xf2e8('0x11')](_0xf2e8('0x12'),_0x98a52f,_0xf2e8('0x10'),JSON[_0xf2e8('0x13')](_0x28b1e8));if(_0x28b1e8[_0xf2e8('0x14')]){if(_0x28b1e8[_0xf2e8('0x14')][_0xf2e8('0x15')]===0x1f4){logger[_0xf2e8('0x14')](_0xf2e8('0xf'),_0x98a52f,_0x28b1e8['error'][_0xf2e8('0x16')]);return _0x420e75(_0x28b1e8['error']['message']);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x98a52f,_0x28b1e8[_0xf2e8('0x14')][_0xf2e8('0x16')]);return _0x45ed6b(_0x28b1e8[_0xf2e8('0x14')][_0xf2e8('0x16')]);}else{logger[_0xf2e8('0xe')](_0xf2e8('0xf'),_0x98a52f,'request\x20sent');_0x45ed6b(_0x28b1e8[_0xf2e8('0x17')][_0xf2e8('0x16')]);}})[_0xf2e8('0x18')](function(_0x54d838){logger[_0xf2e8('0x14')](_0xf2e8('0xf'),_0x98a52f,_0x54d838);_0x420e75(_0x54d838);});});}exports[_0xf2e8('0x19')]=function(_0x3dbdc5){var _0x3d1fb5=this;return new Promise(function(_0x14574e,_0x36c523){return db[_0xf2e8('0x1a')]['create'](_0x3dbdc5['body'],{'raw':_0x3dbdc5[_0xf2e8('0x1b')]?_0x3dbdc5[_0xf2e8('0x1b')][_0xf2e8('0x1c')]===undefined?!![]:![]:!![]})[_0xf2e8('0xd')](function(_0x48334c){logger[_0xf2e8('0xe')](_0xf2e8('0x19'),_0x3dbdc5);logger[_0xf2e8('0x11')](_0xf2e8('0x19'),_0x3dbdc5,JSON['stringify'](_0x48334c));_0x14574e(_0x48334c);})[_0xf2e8('0x18')](function(_0x286307){logger[_0xf2e8('0x14')](_0xf2e8('0x19'),_0x286307[_0xf2e8('0x16')],_0x3dbdc5);_0x36c523(_0x3d1fb5[_0xf2e8('0x14')](0x1f4,_0x286307[_0xf2e8('0x16')]));});});};exports['UpdateWhatsappQueueReport']=function(_0xe95b2b){var _0x33a30b=this;return new Promise(function(_0x59e786,_0x122d8a){return db['WhatsappQueueReport']['update'](_0xe95b2b['body'],{'raw':_0xe95b2b[_0xf2e8('0x1b')]?_0xe95b2b[_0xf2e8('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe95b2b[_0xf2e8('0x1b')]?_0xe95b2b[_0xf2e8('0x1b')][_0xf2e8('0x1d')]||null:null,'attributes':_0xe95b2b[_0xf2e8('0x1b')]?_0xe95b2b[_0xf2e8('0x1b')][_0xf2e8('0x1e')]||null:null,'limit':_0xe95b2b['options']?_0xe95b2b[_0xf2e8('0x1b')][_0xf2e8('0x1f')]||null:null})[_0xf2e8('0xd')](function(_0x346f05){logger[_0xf2e8('0xe')](_0xf2e8('0x20'),_0xe95b2b);logger[_0xf2e8('0x11')](_0xf2e8('0x20'),_0xe95b2b,JSON['stringify'](_0x346f05));_0x59e786(_0x346f05);})[_0xf2e8('0x18')](function(_0x16568f){logger[_0xf2e8('0x14')]('UpdateWhatsappQueueReport',_0x16568f[_0xf2e8('0x16')],_0xe95b2b);_0x122d8a(_0x33a30b[_0xf2e8('0x14')](0x1f4,_0x16568f[_0xf2e8('0x16')]));});});};
\ No newline at end of file
+var _0x8161=['jayson/promise','client','http','request','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','then','debug','stringify','UpdateWhatsappQueueReport','update','raw','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4ff00b,_0x44feb3){var _0x5d87d8=function(_0x2bdece){while(--_0x2bdece){_0x4ff00b['push'](_0x4ff00b['shift']());}};_0x5d87d8(++_0x44feb3);}(_0x8161,0x182));var _0x1816=function(_0x3595fe,_0x593373){_0x3595fe=_0x3595fe-0x0;var _0x334a88=_0x8161[_0x3595fe];return _0x334a88;};'use strict';var _=require(_0x1816('0x0'));var util=require(_0x1816('0x1'));var moment=require(_0x1816('0x2'));var BPromise=require('bluebird');var rs=require(_0x1816('0x3'));var fs=require('fs');var Redis=require(_0x1816('0x4'));var db=require(_0x1816('0x5'))['db'];var utils=require(_0x1816('0x6'));var logger=require(_0x1816('0x7'))(_0x1816('0x8'));var config=require(_0x1816('0x9'));var jayson=require(_0x1816('0xa'));var client=jayson[_0x1816('0xb')][_0x1816('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c4c32,_0x30d1ca,_0x2d8a09){return new BPromise(function(_0x2c479f,_0x13733d){return client[_0x1816('0xd')](_0x4c4c32,_0x2d8a09)['then'](function(_0x1d61e2){logger['info'](_0x1816('0xe'),_0x30d1ca,'request\x20sent');logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x30d1ca,_0x1816('0xf'),JSON['stringify'](_0x1d61e2));if(_0x1d61e2[_0x1816('0x10')]){if(_0x1d61e2['error'][_0x1816('0x11')]===0x1f4){logger[_0x1816('0x10')](_0x1816('0xe'),_0x30d1ca,_0x1d61e2[_0x1816('0x10')][_0x1816('0x12')]);return _0x13733d(_0x1d61e2['error'][_0x1816('0x12')]);}logger[_0x1816('0x10')](_0x1816('0xe'),_0x30d1ca,_0x1d61e2[_0x1816('0x10')][_0x1816('0x12')]);return _0x2c479f(_0x1d61e2['error']['message']);}else{logger[_0x1816('0x13')](_0x1816('0xe'),_0x30d1ca,'request\x20sent');_0x2c479f(_0x1d61e2[_0x1816('0x14')]['message']);}})[_0x1816('0x15')](function(_0x26b227){logger[_0x1816('0x10')](_0x1816('0xe'),_0x30d1ca,_0x26b227);_0x13733d(_0x26b227);});});}exports[_0x1816('0x16')]=function(_0x57f81b){var _0x8a8d13=this;return new Promise(function(_0x2f43e1,_0x60c10d){return db[_0x1816('0x17')][_0x1816('0x18')](_0x57f81b[_0x1816('0x19')],{'raw':_0x57f81b[_0x1816('0x1a')]?_0x57f81b[_0x1816('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x1816('0x1b')](function(_0x240189){logger['info'](_0x1816('0x16'),_0x57f81b);logger[_0x1816('0x1c')](_0x1816('0x16'),_0x57f81b,JSON[_0x1816('0x1d')](_0x240189));_0x2f43e1(_0x240189);})[_0x1816('0x15')](function(_0xc6c09e){logger[_0x1816('0x10')](_0x1816('0x16'),_0xc6c09e['message'],_0x57f81b);_0x60c10d(_0x8a8d13[_0x1816('0x10')](0x1f4,_0xc6c09e[_0x1816('0x12')]));});});};exports[_0x1816('0x1e')]=function(_0xa3351a){var _0x4db1a2=this;return new Promise(function(_0x3b85eb,_0x5a7f61){return db[_0x1816('0x17')][_0x1816('0x1f')](_0xa3351a[_0x1816('0x19')],{'raw':_0xa3351a[_0x1816('0x1a')]?_0xa3351a[_0x1816('0x1a')][_0x1816('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa3351a['options']?_0xa3351a['options'][_0x1816('0x21')]||null:null,'attributes':_0xa3351a[_0x1816('0x1a')]?_0xa3351a[_0x1816('0x1a')][_0x1816('0x22')]||null:null,'limit':_0xa3351a[_0x1816('0x1a')]?_0xa3351a[_0x1816('0x1a')][_0x1816('0x23')]||null:null})[_0x1816('0x1b')](function(_0x2a9cfa){logger['info'](_0x1816('0x1e'),_0xa3351a);logger[_0x1816('0x1c')]('UpdateWhatsappQueueReport',_0xa3351a,JSON['stringify'](_0x2a9cfa));_0x3b85eb(_0x2a9cfa);})['catch'](function(_0x34542e){logger[_0x1816('0x10')](_0x1816('0x1e'),_0x34542e['message'],_0xa3351a);_0x5a7f61(_0x4db1a2[_0x1816('0x10')](0x1f4,_0x34542e[_0x1816('0x12')]));});});};
\ No newline at end of file
index 67b1d3b..34a02ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x244b=['describe','show','post','create','put','/:id','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller','get','index','/describe','isAuthenticated'];(function(_0x410d91,_0x58b926){var _0x3077f3=function(_0xcae58c){while(--_0xcae58c){_0x410d91['push'](_0x410d91['shift']());}};_0x3077f3(++_0x58b926);}(_0x244b,0x1ab));var _0xb244=function(_0x5642bd,_0x5dbcc2){_0x5642bd=_0x5642bd-0x0;var _0x366ca1=_0x244b[_0x5642bd];return _0x366ca1;};'use strict';var multer=require(_0xb244('0x0'));var util=require(_0xb244('0x1'));var path=require(_0xb244('0x2'));var timeout=require(_0xb244('0x3'));var express=require('express');var router=express[_0xb244('0x4')]();var fs_extra=require(_0xb244('0x5'));var auth=require(_0xb244('0x6'));var interaction=require(_0xb244('0x7'));var config=require('../../config/environment');var controller=require(_0xb244('0x8'));router[_0xb244('0x9')]('/',auth['isAuthenticated'](),controller[_0xb244('0xa')]);router[_0xb244('0x9')](_0xb244('0xb'),auth[_0xb244('0xc')](),controller[_0xb244('0xd')]);router[_0xb244('0x9')]('/:id',auth[_0xb244('0xc')](),controller[_0xb244('0xe')]);router[_0xb244('0xf')]('/',auth[_0xb244('0xc')](),controller[_0xb244('0x10')]);router[_0xb244('0x11')](_0xb244('0x12'),auth[_0xb244('0xc')](),controller['update']);router[_0xb244('0x13')](_0xb244('0x12'),auth[_0xb244('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x3fb7=['path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','destroy','multer','util'];(function(_0x5be075,_0x242533){var _0xd702f=function(_0x420f60){while(--_0x420f60){_0x5be075['push'](_0x5be075['shift']());}};_0xd702f(++_0x242533);}(_0x3fb7,0x13e));var _0x73fb=function(_0x41082c,_0x43aa1d){_0x41082c=_0x41082c-0x0;var _0x2edb55=_0x3fb7[_0x41082c];return _0x2edb55;};'use strict';var multer=require(_0x73fb('0x0'));var util=require(_0x73fb('0x1'));var path=require(_0x73fb('0x2'));var timeout=require(_0x73fb('0x3'));var express=require(_0x73fb('0x4'));var router=express[_0x73fb('0x5')]();var fs_extra=require(_0x73fb('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x73fb('0x7'));var controller=require('./whatsappTransferReport.controller');router[_0x73fb('0x8')]('/',auth[_0x73fb('0x9')](),controller['index']);router[_0x73fb('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x73fb('0x8')](_0x73fb('0xa'),auth[_0x73fb('0x9')](),controller[_0x73fb('0xb')]);router[_0x73fb('0xc')]('/',auth[_0x73fb('0x9')](),controller[_0x73fb('0xd')]);router[_0x73fb('0xe')](_0x73fb('0xa'),auth[_0x73fb('0x9')](),controller['update']);router['delete'](_0x73fb('0xa'),auth[_0x73fb('0x9')](),controller[_0x73fb('0xf')]);module['exports']=router;
\ No newline at end of file
index 83f4c5b..c12c5c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa413=['agent','sequelize','STRING','account'];(function(_0x3df001,_0x3c0f1b){var _0x1e32bf=function(_0xe60900){while(--_0xe60900){_0x3df001['push'](_0x3df001['shift']());}};_0x1e32bf(++_0x3c0f1b);}(_0xa413,0x1e5));var _0x3a41=function(_0x3260bb,_0x3c8f6f){_0x3260bb=_0x3260bb-0x0;var _0x179157=_0xa413[_0x3260bb];return _0x179157;};'use strict';var Sequelize=require(_0x3a41('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x3a41('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x3a41('0x2'),_0x3a41('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0xcabe=['sequelize','STRING','ENUM','agent','queue'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0xcabe,0x1ef));var _0xecab=function(_0x33249f,_0x3b1775){_0x33249f=_0x33249f-0x0;var _0x4cc674=_0xcabe[_0x33249f];return _0x4cc674;};'use strict';var Sequelize=require(_0xecab('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xecab('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xecab('0x2')]('account',_0xecab('0x3'),_0xecab('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
index 93c901f..d514589 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ed0=['reject','save','update','destroy','then','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappTransferReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5ed0,0xcb));var _0x05ed=function(_0x267078,_0x5d7329){_0x267078=_0x267078-0x0;var _0x321789=_0x5ed0[_0x267078];return _0x321789;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x05ed('0x0'));var zipdir=require(_0x05ed('0x1'));var jsonpatch=require(_0x05ed('0x2'));var rp=require(_0x05ed('0x3'));var moment=require(_0x05ed('0x4'));var BPromise=require(_0x05ed('0x5'));var Mustache=require(_0x05ed('0x6'));var util=require(_0x05ed('0x7'));var path=require('path');var sox=require(_0x05ed('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x05ed('0x9'));var _=require(_0x05ed('0xa'));var squel=require(_0x05ed('0xb'));var crypto=require(_0x05ed('0xc'));var jsforce=require(_0x05ed('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x05ed('0xe'));var querystring=require('querystring');var Papa=require(_0x05ed('0xf'));var Redis=require(_0x05ed('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x05ed('0x11'));var as=require(_0x05ed('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x05ed('0x13'))(_0x05ed('0x14'));var utils=require(_0x05ed('0x15'));var config=require(_0x05ed('0x16'));var licenseUtil=require(_0x05ed('0x17'));var db=require(_0x05ed('0x18'))['db'];function respondWithStatusCode(_0x2dec9f,_0x5b9170){_0x5b9170=_0x5b9170||0xcc;return function(_0x53eef1){if(_0x53eef1){return _0x2dec9f['sendStatus'](_0x5b9170);}return _0x2dec9f[_0x05ed('0x19')](_0x5b9170)[_0x05ed('0x1a')]();};}function respondWithResult(_0x38f438,_0x555079){_0x555079=_0x555079||0xc8;return function(_0x227853){if(_0x227853){return _0x38f438[_0x05ed('0x19')](_0x555079)[_0x05ed('0x1b')](_0x227853);}};}function respondWithFilteredResult(_0x396c5f,_0x5cc174){return function(_0x3b901f){if(_0x3b901f){var _0x3ccf0b=typeof _0x5cc174[_0x05ed('0x1c')]==='undefined'&&typeof _0x5cc174[_0x05ed('0x1d')]===_0x05ed('0x1e');var _0x56617e=_0x3b901f[_0x05ed('0x1f')];var _0x59f0ce=_0x3ccf0b?0x0:_0x5cc174[_0x05ed('0x1c')];var _0x2b459d=_0x3ccf0b?_0x3b901f[_0x05ed('0x1f')]:_0x5cc174['offset']+_0x5cc174['limit'];var _0xac60ea;if(_0x2b459d>=_0x56617e){_0x2b459d=_0x56617e;_0xac60ea=0xc8;}else{_0xac60ea=0xce;}_0x396c5f[_0x05ed('0x19')](_0xac60ea);return _0x396c5f[_0x05ed('0x20')](_0x05ed('0x21'),_0x59f0ce+'-'+_0x2b459d+'/'+_0x56617e)[_0x05ed('0x1b')](_0x3b901f);}return null;};}function patchUpdates(_0x3b023c){return function(_0xd0e6ba){try{jsonpatch['apply'](_0xd0e6ba,_0x3b023c,!![]);}catch(_0x1cc4fb){return BPromise[_0x05ed('0x22')](_0x1cc4fb);}return _0xd0e6ba[_0x05ed('0x23')]();};}function saveUpdates(_0x5002b0,_0x2a3302){return function(_0x52aa1a){if(_0x52aa1a){return _0x52aa1a[_0x05ed('0x24')](_0x5002b0)['then'](function(_0x48a8b1){return _0x48a8b1;});}return null;};}function removeEntity(_0x52fece,_0x534041){return function(_0x26e6b1){if(_0x26e6b1){return _0x26e6b1[_0x05ed('0x25')]()[_0x05ed('0x26')](function(){_0x52fece[_0x05ed('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f76cb,_0x3eceda){return function(_0x307321){if(!_0x307321){_0x4f76cb[_0x05ed('0x27')](0x194);}return _0x307321;};}function handleError(_0x992708,_0x20ff35){_0x20ff35=_0x20ff35||0x1f4;return function(_0x3c8516){logger[_0x05ed('0x28')](_0x3c8516[_0x05ed('0x29')]);if(_0x3c8516[_0x05ed('0x2a')]){delete _0x3c8516['name'];}_0x992708['status'](_0x20ff35)['send'](_0x3c8516);};}exports[_0x05ed('0x2b')]=function(_0x5854cc,_0x23e3e1){var _0x350c15={},_0x47384f={},_0x4db7f4={'count':0x0,'rows':[]};var _0x48c4d0=_[_0x05ed('0x2c')](db['WhatsappTransferReport'][_0x05ed('0x2d')],function(_0x215288){return{'name':_0x215288[_0x05ed('0x2e')],'type':_0x215288[_0x05ed('0x2f')][_0x05ed('0x30')]};});_0x47384f[_0x05ed('0x31')]=_['map'](_0x48c4d0,'name');_0x47384f[_0x05ed('0x32')]=_[_0x05ed('0x33')](_0x5854cc[_0x05ed('0x32')]);_0x47384f[_0x05ed('0x34')]=_[_0x05ed('0x35')](_0x47384f[_0x05ed('0x31')],_0x47384f[_0x05ed('0x32')]);_0x350c15[_0x05ed('0x36')]=_[_0x05ed('0x35')](_0x47384f[_0x05ed('0x31')],qs[_0x05ed('0x37')](_0x5854cc['query']['fields']));_0x350c15['attributes']=_0x350c15[_0x05ed('0x36')][_0x05ed('0x38')]?_0x350c15['attributes']:_0x47384f[_0x05ed('0x31')];if(!_0x5854cc[_0x05ed('0x32')][_0x05ed('0x39')](_0x05ed('0x3a'))){_0x350c15[_0x05ed('0x1d')]=qs[_0x05ed('0x1d')](_0x5854cc[_0x05ed('0x32')][_0x05ed('0x1d')]);_0x350c15[_0x05ed('0x1c')]=qs[_0x05ed('0x1c')](_0x5854cc['query']['offset']);}_0x350c15[_0x05ed('0x3b')]=qs[_0x05ed('0x3c')](_0x5854cc['query']['sort']);_0x350c15[_0x05ed('0x3d')]=qs[_0x05ed('0x34')](_[_0x05ed('0x3e')](_0x5854cc[_0x05ed('0x32')],_0x47384f[_0x05ed('0x34')]),_0x48c4d0);if(_0x5854cc[_0x05ed('0x32')][_0x05ed('0x3f')]){_0x350c15[_0x05ed('0x3d')]=_[_0x05ed('0x40')](_0x350c15[_0x05ed('0x3d')],{'$or':_[_0x05ed('0x2c')](_0x48c4d0,function(_0x373a8d){if(_0x373a8d[_0x05ed('0x2f')]!==_0x05ed('0x41')){var _0x584e27={};_0x584e27[_0x373a8d[_0x05ed('0x2a')]]={'$like':'%'+_0x5854cc[_0x05ed('0x32')][_0x05ed('0x3f')]+'%'};return _0x584e27;}})});}_0x350c15=_[_0x05ed('0x40')]({},_0x350c15,_0x5854cc[_0x05ed('0x42')]);var _0x2d51e7={'where':_0x350c15[_0x05ed('0x3d')]};return db[_0x05ed('0x43')][_0x05ed('0x1f')](_0x2d51e7)['then'](function(_0x7423d0){_0x4db7f4[_0x05ed('0x1f')]=_0x7423d0;if(_0x5854cc[_0x05ed('0x32')][_0x05ed('0x44')]){_0x350c15[_0x05ed('0x45')]=[{'all':!![]}];}return db[_0x05ed('0x43')][_0x05ed('0x46')](_0x350c15);})[_0x05ed('0x26')](function(_0x30c836){_0x4db7f4[_0x05ed('0x47')]=_0x30c836;return _0x4db7f4;})[_0x05ed('0x26')](respondWithFilteredResult(_0x23e3e1,_0x350c15))[_0x05ed('0x48')](handleError(_0x23e3e1,null));};exports[_0x05ed('0x49')]=function(_0x43b8c8,_0x1b65ca){var _0x4dc982={'raw':!![],'where':{'id':_0x43b8c8[_0x05ed('0x4a')]['id']}},_0xc6bee3={};_0xc6bee3[_0x05ed('0x31')]=_[_0x05ed('0x33')](db[_0x05ed('0x43')][_0x05ed('0x2d')]);_0xc6bee3[_0x05ed('0x32')]=_[_0x05ed('0x33')](_0x43b8c8[_0x05ed('0x32')]);_0xc6bee3[_0x05ed('0x34')]=_[_0x05ed('0x35')](_0xc6bee3[_0x05ed('0x31')],_0xc6bee3['query']);_0x4dc982['attributes']=_[_0x05ed('0x35')](_0xc6bee3['model'],qs[_0x05ed('0x37')](_0x43b8c8[_0x05ed('0x32')][_0x05ed('0x37')]));_0x4dc982[_0x05ed('0x36')]=_0x4dc982[_0x05ed('0x36')][_0x05ed('0x38')]?_0x4dc982[_0x05ed('0x36')]:_0xc6bee3[_0x05ed('0x31')];if(_0x43b8c8[_0x05ed('0x32')][_0x05ed('0x44')]){_0x4dc982[_0x05ed('0x45')]=[{'all':!![]}];}_0x4dc982=_[_0x05ed('0x40')]({},_0x4dc982,_0x43b8c8['options']);return db[_0x05ed('0x43')][_0x05ed('0x4b')](_0x4dc982)[_0x05ed('0x26')](handleEntityNotFound(_0x1b65ca,null))[_0x05ed('0x26')](respondWithResult(_0x1b65ca,null))[_0x05ed('0x48')](handleError(_0x1b65ca,null));};exports[_0x05ed('0x4c')]=function(_0x566da3,_0x268d39){return db['WhatsappTransferReport'][_0x05ed('0x4c')](_0x566da3[_0x05ed('0x4d')],{})[_0x05ed('0x26')](respondWithResult(_0x268d39,0xc9))[_0x05ed('0x48')](handleError(_0x268d39,null));};exports[_0x05ed('0x24')]=function(_0x39d033,_0x14d66f){if(_0x39d033[_0x05ed('0x4d')]['id']){delete _0x39d033[_0x05ed('0x4d')]['id'];}return db[_0x05ed('0x43')]['find']({'where':{'id':_0x39d033[_0x05ed('0x4a')]['id']}})[_0x05ed('0x26')](handleEntityNotFound(_0x14d66f,null))['then'](saveUpdates(_0x39d033[_0x05ed('0x4d')],null))['then'](respondWithResult(_0x14d66f,null))[_0x05ed('0x48')](handleError(_0x14d66f,null));};exports['destroy']=function(_0x264880,_0x4274fc){return db[_0x05ed('0x43')][_0x05ed('0x4b')]({'where':{'id':_0x264880['params']['id']}})[_0x05ed('0x26')](handleEntityNotFound(_0x4274fc,null))[_0x05ed('0x26')](removeEntity(_0x4274fc,null))[_0x05ed('0x48')](handleError(_0x4274fc,null));};exports[_0x05ed('0x4e')]=function(_0x4e8e25,_0x55b8e3){return db[_0x05ed('0x43')]['describe']()[_0x05ed('0x26')](respondWithResult(_0x55b8e3,null))[_0x05ed('0x48')](handleError(_0x55b8e3,null));};
\ No newline at end of file
+var _0x0f03=['../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','apply','update','destroy','then','error','stack','name','send','index','WhatsappTransferReport','fieldName','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x1e5331,_0xf63732){var _0x3538ea=function(_0x39af0a){while(--_0x39af0a){_0x1e5331['push'](_0x1e5331['shift']());}};_0x3538ea(++_0xf63732);}(_0x0f03,0x113));var _0x30f0=function(_0x403b87,_0x88a5a5){_0x403b87=_0x403b87-0x0;var _0x1cbf17=_0x0f03[_0x403b87];return _0x1cbf17;};'use strict';var emlformat=require(_0x30f0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x30f0('0x1'));var jsonpatch=require(_0x30f0('0x2'));var rp=require(_0x30f0('0x3'));var moment=require(_0x30f0('0x4'));var BPromise=require(_0x30f0('0x5'));var Mustache=require(_0x30f0('0x6'));var util=require(_0x30f0('0x7'));var path=require('path');var sox=require(_0x30f0('0x8'));var csv=require(_0x30f0('0x9'));var ejs=require(_0x30f0('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x30f0('0xb'));var squel=require(_0x30f0('0xc'));var crypto=require(_0x30f0('0xd'));var jsforce=require(_0x30f0('0xe'));var deskjs=require(_0x30f0('0xf'));var toCsv=require(_0x30f0('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x30f0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x30f0('0x11'));var as=require(_0x30f0('0x12'));var hardwareService=require(_0x30f0('0x13'));var logger=require(_0x30f0('0x14'))('api');var utils=require(_0x30f0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x30f0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25b10c,_0x5b2e26){_0x5b2e26=_0x5b2e26||0xcc;return function(_0x3d1873){if(_0x3d1873){return _0x25b10c[_0x30f0('0x17')](_0x5b2e26);}return _0x25b10c[_0x30f0('0x18')](_0x5b2e26)[_0x30f0('0x19')]();};}function respondWithResult(_0x261f37,_0x1f868d){_0x1f868d=_0x1f868d||0xc8;return function(_0x4aaae4){if(_0x4aaae4){return _0x261f37[_0x30f0('0x18')](_0x1f868d)[_0x30f0('0x1a')](_0x4aaae4);}};}function respondWithFilteredResult(_0xb9cddd,_0x57b180){return function(_0x277c1f){if(_0x277c1f){var _0x24eb10=typeof _0x57b180[_0x30f0('0x1b')]===_0x30f0('0x1c')&&typeof _0x57b180['limit']===_0x30f0('0x1c');var _0x1e104a=_0x277c1f['count'];var _0x45793c=_0x24eb10?0x0:_0x57b180['offset'];var _0x1120cd=_0x24eb10?_0x277c1f[_0x30f0('0x1d')]:_0x57b180[_0x30f0('0x1b')]+_0x57b180[_0x30f0('0x1e')];var _0x2bad8d;if(_0x1120cd>=_0x1e104a){_0x1120cd=_0x1e104a;_0x2bad8d=0xc8;}else{_0x2bad8d=0xce;}_0xb9cddd[_0x30f0('0x18')](_0x2bad8d);return _0xb9cddd['set']('Content-Range',_0x45793c+'-'+_0x1120cd+'/'+_0x1e104a)['json'](_0x277c1f);}return null;};}function patchUpdates(_0x2f7bd3){return function(_0x2be50b){try{jsonpatch[_0x30f0('0x1f')](_0x2be50b,_0x2f7bd3,!![]);}catch(_0x543dd6){return BPromise['reject'](_0x543dd6);}return _0x2be50b['save']();};}function saveUpdates(_0x120863,_0x89c328){return function(_0x1887d7){if(_0x1887d7){return _0x1887d7[_0x30f0('0x20')](_0x120863)['then'](function(_0x2a14b2){return _0x2a14b2;});}return null;};}function removeEntity(_0x2ff628,_0x48128b){return function(_0x148504){if(_0x148504){return _0x148504[_0x30f0('0x21')]()[_0x30f0('0x22')](function(){_0x2ff628[_0x30f0('0x18')](0xcc)[_0x30f0('0x19')]();});}};}function handleEntityNotFound(_0x453f9e,_0x5c1db0){return function(_0xccfd9a){if(!_0xccfd9a){_0x453f9e[_0x30f0('0x17')](0x194);}return _0xccfd9a;};}function handleError(_0x11a8aa,_0x45f665){_0x45f665=_0x45f665||0x1f4;return function(_0x3a271a){logger[_0x30f0('0x23')](_0x3a271a[_0x30f0('0x24')]);if(_0x3a271a['name']){delete _0x3a271a[_0x30f0('0x25')];}_0x11a8aa[_0x30f0('0x18')](_0x45f665)[_0x30f0('0x26')](_0x3a271a);};}exports[_0x30f0('0x27')]=function(_0x4d8795,_0x4a2975){var _0xf61ca8={},_0x1c4e1c={},_0x57ded9={'count':0x0,'rows':[]};var _0x54ff50=_['map'](db[_0x30f0('0x28')]['rawAttributes'],function(_0x225a54){return{'name':_0x225a54[_0x30f0('0x29')],'type':_0x225a54['type'][_0x30f0('0x2a')]};});_0x1c4e1c[_0x30f0('0x2b')]=_[_0x30f0('0x2c')](_0x54ff50,'name');_0x1c4e1c[_0x30f0('0x2d')]=_[_0x30f0('0x2e')](_0x4d8795[_0x30f0('0x2d')]);_0x1c4e1c[_0x30f0('0x2f')]=_['intersection'](_0x1c4e1c[_0x30f0('0x2b')],_0x1c4e1c['query']);_0xf61ca8[_0x30f0('0x30')]=_['intersection'](_0x1c4e1c[_0x30f0('0x2b')],qs[_0x30f0('0x31')](_0x4d8795[_0x30f0('0x2d')][_0x30f0('0x31')]));_0xf61ca8[_0x30f0('0x30')]=_0xf61ca8[_0x30f0('0x30')][_0x30f0('0x32')]?_0xf61ca8['attributes']:_0x1c4e1c['model'];if(!_0x4d8795[_0x30f0('0x2d')][_0x30f0('0x33')](_0x30f0('0x34'))){_0xf61ca8[_0x30f0('0x1e')]=qs['limit'](_0x4d8795['query'][_0x30f0('0x1e')]);_0xf61ca8[_0x30f0('0x1b')]=qs[_0x30f0('0x1b')](_0x4d8795[_0x30f0('0x2d')][_0x30f0('0x1b')]);}_0xf61ca8[_0x30f0('0x35')]=qs['sort'](_0x4d8795[_0x30f0('0x2d')][_0x30f0('0x36')]);_0xf61ca8['where']=qs[_0x30f0('0x2f')](_[_0x30f0('0x37')](_0x4d8795[_0x30f0('0x2d')],_0x1c4e1c['filters']),_0x54ff50);if(_0x4d8795['query'][_0x30f0('0x38')]){_0xf61ca8[_0x30f0('0x39')]=_[_0x30f0('0x3a')](_0xf61ca8[_0x30f0('0x39')],{'$or':_[_0x30f0('0x2c')](_0x54ff50,function(_0x818ee4){if(_0x818ee4[_0x30f0('0x3b')]!==_0x30f0('0x3c')){var _0x3f009d={};_0x3f009d[_0x818ee4[_0x30f0('0x25')]]={'$like':'%'+_0x4d8795['query'][_0x30f0('0x38')]+'%'};return _0x3f009d;}})});}_0xf61ca8=_[_0x30f0('0x3a')]({},_0xf61ca8,_0x4d8795[_0x30f0('0x3d')]);var _0x3c1892={'where':_0xf61ca8[_0x30f0('0x39')]};return db[_0x30f0('0x28')]['count'](_0x3c1892)['then'](function(_0x86c54a){_0x57ded9[_0x30f0('0x1d')]=_0x86c54a;if(_0x4d8795[_0x30f0('0x2d')][_0x30f0('0x3e')]){_0xf61ca8['include']=[{'all':!![]}];}return db[_0x30f0('0x28')]['findAll'](_0xf61ca8);})[_0x30f0('0x22')](function(_0x5182ec){_0x57ded9[_0x30f0('0x3f')]=_0x5182ec;return _0x57ded9;})['then'](respondWithFilteredResult(_0x4a2975,_0xf61ca8))[_0x30f0('0x40')](handleError(_0x4a2975,null));};exports[_0x30f0('0x41')]=function(_0xadae05,_0x56f1b5){var _0x2d964d={'raw':!![],'where':{'id':_0xadae05[_0x30f0('0x42')]['id']}},_0x1cdc2a={};_0x1cdc2a[_0x30f0('0x2b')]=_[_0x30f0('0x2e')](db[_0x30f0('0x28')][_0x30f0('0x43')]);_0x1cdc2a[_0x30f0('0x2d')]=_[_0x30f0('0x2e')](_0xadae05[_0x30f0('0x2d')]);_0x1cdc2a['filters']=_[_0x30f0('0x44')](_0x1cdc2a[_0x30f0('0x2b')],_0x1cdc2a[_0x30f0('0x2d')]);_0x2d964d[_0x30f0('0x30')]=_[_0x30f0('0x44')](_0x1cdc2a[_0x30f0('0x2b')],qs[_0x30f0('0x31')](_0xadae05[_0x30f0('0x2d')][_0x30f0('0x31')]));_0x2d964d[_0x30f0('0x30')]=_0x2d964d[_0x30f0('0x30')]['length']?_0x2d964d[_0x30f0('0x30')]:_0x1cdc2a[_0x30f0('0x2b')];if(_0xadae05[_0x30f0('0x2d')][_0x30f0('0x3e')]){_0x2d964d[_0x30f0('0x45')]=[{'all':!![]}];}_0x2d964d=_[_0x30f0('0x3a')]({},_0x2d964d,_0xadae05[_0x30f0('0x3d')]);return db[_0x30f0('0x28')][_0x30f0('0x46')](_0x2d964d)[_0x30f0('0x22')](handleEntityNotFound(_0x56f1b5,null))[_0x30f0('0x22')](respondWithResult(_0x56f1b5,null))[_0x30f0('0x40')](handleError(_0x56f1b5,null));};exports[_0x30f0('0x47')]=function(_0x3cc55a,_0x599809){return db['WhatsappTransferReport'][_0x30f0('0x47')](_0x3cc55a[_0x30f0('0x48')],{})['then'](respondWithResult(_0x599809,0xc9))[_0x30f0('0x40')](handleError(_0x599809,null));};exports[_0x30f0('0x20')]=function(_0x4d6e5d,_0x1769a7){if(_0x4d6e5d[_0x30f0('0x48')]['id']){delete _0x4d6e5d[_0x30f0('0x48')]['id'];}return db['WhatsappTransferReport'][_0x30f0('0x46')]({'where':{'id':_0x4d6e5d['params']['id']}})[_0x30f0('0x22')](handleEntityNotFound(_0x1769a7,null))['then'](saveUpdates(_0x4d6e5d[_0x30f0('0x48')],null))['then'](respondWithResult(_0x1769a7,null))[_0x30f0('0x40')](handleError(_0x1769a7,null));};exports[_0x30f0('0x21')]=function(_0x31ee4b,_0x1b2071){return db[_0x30f0('0x28')][_0x30f0('0x46')]({'where':{'id':_0x31ee4b['params']['id']}})['then'](handleEntityNotFound(_0x1b2071,null))['then'](removeEntity(_0x1b2071,null))[_0x30f0('0x40')](handleError(_0x1b2071,null));};exports[_0x30f0('0x49')]=function(_0x56d5,_0x905a7){return db[_0x30f0('0x28')][_0x30f0('0x49')]()[_0x30f0('0x22')](respondWithResult(_0x905a7,null))['catch'](handleError(_0x905a7,null));};
\ No newline at end of file
index e6e6c99..8e271d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6c3=['path','../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x1992ba,_0x10c9bd){var _0xd65756=function(_0x772862){while(--_0x772862){_0x1992ba['push'](_0x1992ba['shift']());}};_0xd65756(++_0x10c9bd);}(_0xe6c3,0x7c));var _0x3e6c=function(_0x38be2d,_0x467a01){_0x38be2d=_0x38be2d-0x0;var _0x44a7c5=_0xe6c3[_0x38be2d];return _0x44a7c5;};'use strict';var _=require(_0x3e6c('0x0'));var util=require(_0x3e6c('0x1'));var logger=require(_0x3e6c('0x2'))('api');var moment=require(_0x3e6c('0x3'));var BPromise=require(_0x3e6c('0x4'));var rp=require(_0x3e6c('0x5'));var fs=require('fs');var path=require(_0x3e6c('0x6'));var rimraf=require('rimraf');var config=require(_0x3e6c('0x7'));var attributes=require(_0x3e6c('0x8'));module['exports']=function(_0x47e6f9,_0x5b0984){return _0x47e6f9[_0x3e6c('0x9')](_0x3e6c('0xa'),attributes,{'tableName':_0x3e6c('0xb'),'paranoid':![],'indexes':[{'name':_0x3e6c('0xc'),'fields':[_0x3e6c('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x523e=['api','bluebird','rimraf','../../config/environment','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x74018b,_0xd5422d){var _0x4e2675=function(_0xd4df0f){while(--_0xd4df0f){_0x74018b['push'](_0x74018b['shift']());}};_0x4e2675(++_0xd5422d);}(_0x523e,0x110));var _0xe523=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x523e[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xe523('0x0'));var util=require(_0xe523('0x1'));var logger=require(_0xe523('0x2'))(_0xe523('0x3'));var moment=require('moment');var BPromise=require(_0xe523('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe523('0x5'));var config=require(_0xe523('0x6'));var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x7ea6e7,_0x13a0e0){return _0x7ea6e7[_0xe523('0x7')](_0xe523('0x8'),attributes,{'tableName':_0xe523('0x9'),'paranoid':![],'indexes':[{'name':_0xe523('0xa'),'fields':[_0xe523('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 1dba4d9..2a0fc94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9820=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x30d954,_0x2b28c5){var _0x37463c=function(_0x426c93){while(--_0x426c93){_0x30d954['push'](_0x30d954['shift']());}};_0x37463c(++_0x2b28c5);}(_0x9820,0x137));var _0x0982=function(_0x176989,_0xe83cb2){_0x176989=_0x176989-0x0;var _0x5880ff=_0x9820[_0x176989];return _0x5880ff;};'use strict';var _=require(_0x0982('0x0'));var util=require(_0x0982('0x1'));var moment=require(_0x0982('0x2'));var BPromise=require(_0x0982('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0982('0x4'));var db=require(_0x0982('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0982('0x6'))(_0x0982('0x7'));var config=require('../../config/environment');var jayson=require(_0x0982('0x8'));var client=jayson[_0x0982('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37a527,_0x236fcf,_0x2684a3){return new BPromise(function(_0xb9be50,_0x4c6c1b){return client[_0x0982('0xa')](_0x37a527,_0x2684a3)[_0x0982('0xb')](function(_0x46604b){logger[_0x0982('0xc')](_0x0982('0xd'),_0x236fcf,_0x0982('0xe'));logger['debug'](_0x0982('0xf'),_0x236fcf,_0x0982('0xe'),JSON[_0x0982('0x10')](_0x46604b));if(_0x46604b[_0x0982('0x11')]){if(_0x46604b['error'][_0x0982('0x12')]===0x1f4){logger[_0x0982('0x11')](_0x0982('0xd'),_0x236fcf,_0x46604b[_0x0982('0x11')][_0x0982('0x13')]);return _0x4c6c1b(_0x46604b[_0x0982('0x11')][_0x0982('0x13')]);}logger[_0x0982('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x236fcf,_0x46604b[_0x0982('0x11')][_0x0982('0x13')]);return _0xb9be50(_0x46604b[_0x0982('0x11')][_0x0982('0x13')]);}else{logger[_0x0982('0xc')](_0x0982('0xd'),_0x236fcf,_0x0982('0xe'));_0xb9be50(_0x46604b[_0x0982('0x14')][_0x0982('0x13')]);}})[_0x0982('0x15')](function(_0x177c5e){logger[_0x0982('0x11')](_0x0982('0xd'),_0x236fcf,_0x177c5e);_0x4c6c1b(_0x177c5e);});});}
\ No newline at end of file
+var _0xa4c2=['client','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xa2bba0,_0x5b0493){var _0xcf1d86=function(_0x15774d){while(--_0x15774d){_0xa2bba0['push'](_0xa2bba0['shift']());}};_0xcf1d86(++_0x5b0493);}(_0xa4c2,0x186));var _0x2a4c=function(_0x1c61e7,_0x58db3f){_0x1c61e7=_0x1c61e7-0x0;var _0x2cd778=_0xa4c2[_0x1c61e7];return _0x2cd778;};'use strict';var _=require('lodash');var util=require(_0x2a4c('0x0'));var moment=require(_0x2a4c('0x1'));var BPromise=require(_0x2a4c('0x2'));var rs=require(_0x2a4c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a4c('0x4'))['db'];var utils=require(_0x2a4c('0x5'));var logger=require(_0x2a4c('0x6'))(_0x2a4c('0x7'));var config=require(_0x2a4c('0x8'));var jayson=require(_0x2a4c('0x9'));var client=jayson[_0x2a4c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bf78d,_0x19d451,_0x2168e){return new BPromise(function(_0x57efca,_0x222c76){return client[_0x2a4c('0xb')](_0x2bf78d,_0x2168e)[_0x2a4c('0xc')](function(_0x5a4389){logger[_0x2a4c('0xd')](_0x2a4c('0xe'),_0x19d451,_0x2a4c('0xf'));logger['debug'](_0x2a4c('0x10'),_0x19d451,_0x2a4c('0xf'),JSON['stringify'](_0x5a4389));if(_0x5a4389[_0x2a4c('0x11')]){if(_0x5a4389[_0x2a4c('0x11')]['code']===0x1f4){logger['error'](_0x2a4c('0xe'),_0x19d451,_0x5a4389['error']['message']);return _0x222c76(_0x5a4389[_0x2a4c('0x11')]['message']);}logger[_0x2a4c('0x11')](_0x2a4c('0xe'),_0x19d451,_0x5a4389[_0x2a4c('0x11')][_0x2a4c('0x12')]);return _0x57efca(_0x5a4389[_0x2a4c('0x11')]['message']);}else{logger['info'](_0x2a4c('0xe'),_0x19d451,_0x2a4c('0xf'));_0x57efca(_0x5a4389['result']['message']);}})[_0x2a4c('0x13')](function(_0x214c68){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x19d451,_0x214c68);_0x222c76(_0x214c68);});});}
\ No newline at end of file
index 310689a..97fa85e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15c6=['./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','seedDB','listen','start','filter','exitCode','length','map','pm2_env','name','info','Online\x20apps:','Offline\x20apps:','online','join','log','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash'];(function(_0x3f1d11,_0x5e3836){var _0x38755f=function(_0x2d3dfe){while(--_0x2d3dfe){_0x3f1d11['push'](_0x3f1d11['shift']());}};_0x38755f(++_0x5e3836);}(_0x15c6,0x1cd));var _0x615c=function(_0x3124f8,_0x1a8b23){_0x3124f8=_0x3124f8-0x0;var _0x5bab5f=_0x15c6[_0x3124f8];return _0x5bab5f;};'use strict';var _=require(_0x615c('0x0'));var db=require(_0x615c('0x1'))['db'];var seedDb=require(_0x615c('0x2'));var checkLicense=require(_0x615c('0x3'));var rpc=require(_0x615c('0x4'));var config=require(_0x615c('0x5'));var logger=require(_0x615c('0x6'))(_0x615c('0x7'));var pm2=require('./config/pm2');var pm2Config=require('./config/pm2/config');var schedule=require('./config/schedule');var chat=require(_0x615c('0x8'));var whatsapp=require(_0x615c('0x9'));var transcribe=require(_0x615c('0xa'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x615c('0xb')][_0x615c('0xc')]()[_0x615c('0xd')](function(){if(config[_0x615c('0xe')]){return seedDb['default']();}})[_0x615c('0xd')](function(){return checkLicense['default']();})[_0x615c('0xd')](function(){return rpc[_0x615c('0xf')]();})[_0x615c('0xd')](function(_0x8f4a1e){logger['info'](_0x8f4a1e);return chat['start']();})[_0x615c('0xd')](function(){return whatsapp[_0x615c('0x10')]();})[_0x615c('0xd')](function(){return schedule[_0x615c('0x10')]();})['then'](function(){return transcribe['start']();})[_0x615c('0xd')](function(){return provider[_0x615c('0x10')]();})['then'](function(_0x247cc8){logger['info'](_0x247cc8);return pm2['start'](pm2Config);})[_0x615c('0xd')](function(_0x11d751){var _0x2e9dd9=_0x11d751[_0x615c('0x11')](function(_0x146659){return typeof _0x146659[_0x615c('0x12')]==='number'&&_0x146659[_0x615c('0x12')]>=0x0;});if(_0x2e9dd9[_0x615c('0x13')]>0x0){throw new Error(_0x2e9dd9[_0x615c('0x13')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x615c('0x14')](_0x2e9dd9,function(_0x3953aa){return'\x22'+_0x3953aa[_0x615c('0x15')][_0x615c('0x16')]+'\x22';}));}logger[_0x615c('0x17')](_0x615c('0x18'),_[_0x615c('0x14')](_[_0x615c('0x11')](_0x11d751,{'status':'online'}),'name')['join']());logger[_0x615c('0x17')](_0x615c('0x19'),_[_0x615c('0x14')](_[_0x615c('0x11')](_0x11d751,function(_0x5c6e16){return _0x5c6e16['status']!==_0x615c('0x1a');}),'name')[_0x615c('0x1b')]()||'None');console[_0x615c('0x1c')]('App\x20Ready!');})[_0x615c('0x1d')](function(_0x31514f){console['log']('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x31514f);logger[_0x615c('0x1e')](_0x615c('0x1f'),_0x31514f);process[_0x615c('0x20')](0x1);});}main();
\ No newline at end of file
+var _0xaa3f=['None','log','App\x20Ready!','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','info','start','filter','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','online','name','join','Offline\x20apps:','status'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x6be560,_0x220909){_0x6be560=_0x6be560-0x0;var _0x12f484=_0xaa3f[_0x6be560];return _0x12f484;};'use strict';var _=require(_0xfaa3('0x0'));var db=require(_0xfaa3('0x1'))['db'];var seedDb=require(_0xfaa3('0x2'));var checkLicense=require(_0xfaa3('0x3'));var rpc=require(_0xfaa3('0x4'));var config=require(_0xfaa3('0x5'));var logger=require(_0xfaa3('0x6'))(_0xfaa3('0x7'));var pm2=require(_0xfaa3('0x8'));var pm2Config=require('./config/pm2/config');var schedule=require('./config/schedule');var chat=require(_0xfaa3('0x9'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xfaa3('0xa'));var provider=require(_0xfaa3('0xb'));function main(){return db[_0xfaa3('0xc')][_0xfaa3('0xd')]()[_0xfaa3('0xe')](function(){if(config[_0xfaa3('0xf')]){return seedDb[_0xfaa3('0x10')]();}})['then'](function(){return checkLicense[_0xfaa3('0x10')]();})[_0xfaa3('0xe')](function(){return rpc['listen']();})['then'](function(_0x44d88e){logger[_0xfaa3('0x11')](_0x44d88e);return chat[_0xfaa3('0x12')]();})[_0xfaa3('0xe')](function(){return whatsapp[_0xfaa3('0x12')]();})[_0xfaa3('0xe')](function(){return schedule['start']();})[_0xfaa3('0xe')](function(){return transcribe['start']();})[_0xfaa3('0xe')](function(){return provider[_0xfaa3('0x12')]();})[_0xfaa3('0xe')](function(_0x58f71b){logger[_0xfaa3('0x11')](_0x58f71b);return pm2['start'](pm2Config);})[_0xfaa3('0xe')](function(_0x84b465){var _0x2361a9=_0x84b465[_0xfaa3('0x13')](function(_0x1243ed){return typeof _0x1243ed[_0xfaa3('0x14')]==='number'&&_0x1243ed['exitCode']>=0x0;});if(_0x2361a9[_0xfaa3('0x15')]>0x0){throw new Error(_0x2361a9[_0xfaa3('0x15')]+_0xfaa3('0x16')+_[_0xfaa3('0x17')](_0x2361a9,function(_0x4e54e4){return'\x22'+_0x4e54e4['pm2_env']['name']+'\x22';}));}logger['info']('Online\x20apps:',_[_0xfaa3('0x17')](_['filter'](_0x84b465,{'status':_0xfaa3('0x18')}),_0xfaa3('0x19'))[_0xfaa3('0x1a')]());logger[_0xfaa3('0x11')](_0xfaa3('0x1b'),_[_0xfaa3('0x17')](_[_0xfaa3('0x13')](_0x84b465,function(_0x1ab9cc){return _0x1ab9cc[_0xfaa3('0x1c')]!==_0xfaa3('0x18');}),'name')[_0xfaa3('0x1a')]()||_0xfaa3('0x1d'));console[_0xfaa3('0x1e')](_0xfaa3('0x1f'));})['catch'](function(_0x1f7324){console[_0xfaa3('0x1e')](_0xfaa3('0x20'),_0x1f7324);logger[_0xfaa3('0x21')](_0xfaa3('0x22'),_0x1f7324);process[_0xfaa3('0x23')](0x1);});}main();
\ No newline at end of file
index 7f7902b..0d0bd19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['express-jwt','composable-middleware','crypto','util','role','fullname','name','internal','email','userpic','permissions','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','isAuthenticated','use','user','ChatInteraction','findOne','closed','disposition','then','unmanaged','json','Unmanaged.','catch','headers','authorization','startsWith','Basic','User','authenticate','Bearer','status','query','apikey','getUuid','find','sub','Setting','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','getLicense','update','Forbidden','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','decryptString','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','split','splice','encryptString','promisify','sign','secret','secrets','session','options','verify','randomBytes','hex','floor','now','toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken'];(function(_0x2c47e6,_0x5aba0){var _0x4022b3=function(_0x202604){while(--_0x202604){_0x2c47e6['push'](_0x2c47e6['shift']());}};_0x4022b3(++_0x5aba0);}(_0x70e0,0x17b));var _0x070e=function(_0x7a10c9,_0x42e2a2){_0x7a10c9=_0x7a10c9-0x0;var _0x5341a1=_0x70e0[_0x7a10c9];return _0x5341a1;};'use strict';var db=require(_0x070e('0x0'))['db'];var config=require(_0x070e('0x1'));var hardwareConf=require(_0x070e('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0x070e('0x3'));var jwt=require(_0x070e('0x4'));var expressJwt=require(_0x070e('0x5'));var compose=require(_0x070e('0x6'));var basicAuth=require('basic-auth');var crypto=require(_0x070e('0x7'));var BPromise=require('bluebird');var util=require(_0x070e('0x8'));var moment=require('moment');var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0x070e('0x9'),_0x070e('0xa'),_0x070e('0xb'),_0x070e('0xc'),_0x070e('0xd'),_0x070e('0xe'),_0x070e('0xf'),'md5secret','voicePause',_0x070e('0x10'),_0x070e('0x11'),_0x070e('0x12'),_0x070e('0x13'),_0x070e('0x14'),_0x070e('0x15'),_0x070e('0x16'),_0x070e('0x17'),_0x070e('0x18'),_0x070e('0x19'),_0x070e('0x1a'),'passwordResetAt','alias',_0x070e('0x1b'),'phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording',_0x070e('0x1c'),_0x070e('0x1d'),'phoneBarExpires','phoneBarPrefixRequired',_0x070e('0x1e'),_0x070e('0x1f'),_0x070e('0x20'),_0x070e('0x21'),'userProfileId','privacyEnabled',_0x070e('0x22'),_0x070e('0x23'),_0x070e('0x24'),_0x070e('0x25'),_0x070e('0x26'),'ignorePauseForPreviewCalls',_0x070e('0x27'),_0x070e('0x28'),_0x070e('0x29'),_0x070e('0x2a'),_0x070e('0x2b'),'smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer',_0x070e('0x2c'),_0x070e('0x2d'),_0x070e('0x2e'),'whatsappAutoanswer',_0x070e('0x2f')];exports['isChatInteractionAuthorized']=function(){return this[_0x070e('0x30')](!![])[_0x070e('0x31')](function(_0x27a01e,_0x33e8c6,_0x28a1c3){if(_0x27a01e[_0x070e('0x32')]){_0x28a1c3();}else{return db[_0x070e('0x33')][_0x070e('0x34')]({'where':{'id':_0x27a01e['params']['id']},'attributes':['id',_0x070e('0x35'),_0x070e('0x36')],'raw':!![]})[_0x070e('0x37')](function(_0x503f4d){if(_0x503f4d&&_0x503f4d[_0x070e('0x35')]){return _0x33e8c6['status'](_0x503f4d['disposition']===_0x070e('0x38')?0x195:0x193)[_0x070e('0x39')]({'message':_0x503f4d[_0x070e('0x36')]===_0x070e('0x38')?_0x070e('0x3a'):'Forbidden.'});}else{_0x28a1c3();}})[_0x070e('0x3b')](function(_0x219e48){_0x28a1c3(_0x219e48);});}});};exports[_0x070e('0x30')]=function isAuthenticated(_0x1d2a34){return compose()[_0x070e('0x31')](function(_0x28d7f2,_0x1a1892,_0x26373b){var _0x5e8326;if(_0x28d7f2[_0x070e('0x3c')][_0x070e('0x3d')]){if(_[_0x070e('0x3e')](_0x28d7f2['headers']['authorization'],_0x070e('0x3f'))){var _0x46065c=basicAuth(_0x28d7f2);db[_0x070e('0x40')]['find']({'where':{'name':_0x46065c[_0x070e('0xb')]}})[_0x070e('0x37')](function(_0x3a9425){if(!_0x3a9425||!_0x3a9425[_0x070e('0x41')](_0x46065c['pass'])){return _0x1a1892['status'](0x191)['json']({'message':'Wrong\x20credentials.'});}_0x28d7f2[_0x070e('0x32')]={'id':_0x3a9425['id']};_0x26373b();})['catch'](function(_0x1dff97){_0x26373b(_0x1dff97);});}else if(_[_0x070e('0x3e')](_0x28d7f2['headers']['authorization'],_0x070e('0x42'))){validateJwt(_0x28d7f2,_0x1a1892,_0x26373b);}else{if(_0x1d2a34){_0x26373b();}else{return _0x1a1892[_0x070e('0x43')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x28d7f2[_0x070e('0x44')][_0x070e('0x45')]){try{var _0x444d02={'audience':hardwareConf[_0x070e('0x46')](),'issuer':hardwareConf[_0x070e('0x46')]()};verifyJwt(_0x28d7f2['query']['apikey'],_0x444d02)[_0x070e('0x37')](function(_0x3011c4){return db[_0x070e('0x40')][_0x070e('0x47')]({'where':{'id':_0x3011c4[_0x070e('0x48')]}})['then'](function(_0x22f3a9){_0x5e8326=_0x22f3a9;return db[_0x070e('0x49')]['findOne']({'where':{'id':0x1},'attributes':[_0x070e('0x4a'),_0x070e('0x4b')],'raw':!![]});})['then'](function(_0x4d4ee8){if(!_0x5e8326||!_['isEqual'](_0x5e8326[_0x070e('0x4c')],_0x3011c4[_0x070e('0x4d')])){return _0x1a1892[_0x070e('0x43')](0x191)[_0x070e('0x39')]({'message':_0x070e('0x4e')});}if(_0x5e8326['disabled']){return _0x1a1892[_0x070e('0x43')](0x191)[_0x070e('0x39')]({'message':_0x070e('0x4f')});}if(_0x5e8326['blocked']){if(_0x4d4ee8[_0x070e('0x4b')]>0x0){if(moment(_0x5e8326[_0x070e('0x50')])[_0x070e('0x51')](_0x4d4ee8['blockDuration'],_0x070e('0x52'))>moment()){return _0x1a1892[_0x070e('0x43')](0x191)['json']({'message':_0x070e('0x4f')});}}else{return _0x1a1892['status'](0x191)[_0x070e('0x39')]({'message':_0x070e('0x4f')});}}_0x28d7f2[_0x070e('0x32')]={'id':_0x5e8326['id']};_0x26373b();});})[_0x070e('0x3b')](function(){return _0x1a1892[_0x070e('0x43')](0x191)['json']({'message':_0x070e('0x4f')});});}catch(_0x5db2ce){_0x26373b(_0x5db2ce);}}else if(_0x1d2a34){_0x26373b();}else{return _0x1a1892['status'](0x193)[_0x070e('0x39')]({'message':_0x070e('0x53')});}})[_0x070e('0x31')](function(_0x4d52ff,_0x2ad56c,_0x1223be){if(_0x4d52ff[_0x070e('0x32')]){db[_0x070e('0x40')]['find']({'where':{'id':_0x4d52ff[_0x070e('0x32')]['id']},'attributes':userAttributes})['then'](function(_0x544b53){if(!_0x544b53){return _0x2ad56c['status'](0x194)[_0x070e('0x39')]({'message':_0x070e('0x54')});}_0x4d52ff[_0x070e('0x32')]=_0x544b53;_0x1223be();})[_0x070e('0x3b')](function(_0x34f23e){_0x1223be(_0x34f23e);});}else if(_0x1d2a34){_0x1223be();}else{return _0x2ad56c['status'](0x194)[_0x070e('0x39')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x070e('0x55')]=function canUpdate(){return compose()[_0x070e('0x31')](function(_0xff760c,_0x52fcea,_0x54285a){return licenseUtil[_0x070e('0x56')]()['then'](function(_0x35349f){if(_0x35349f[_0x070e('0x57')]){_0x54285a();}else{return _0x52fcea[_0x070e('0x43')](0x193)['json']({'message':_0x070e('0x58')});}})[_0x070e('0x3b')](function(_0x48d836){_0x54285a(_0x48d836);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0x070e('0x31')](function(_0x945901,_0x2d43ce,_0x1fc7c4){return licenseUtil[_0x070e('0x56')]()['then'](function(_0x20b80e){if(_0x20b80e[_0x070e('0x59')]){_0x1fc7c4();}else{return _0x2d43ce[_0x070e('0x43')](0x193)[_0x070e('0x39')]({'message':_0x070e('0x58')});}})[_0x070e('0x3b')](function(_0x1f54d5){_0x1fc7c4(_0x1f54d5);});});};exports[_0x070e('0x5a')]=function(_0xd67987,_0x66a3f3,_0x210c4d){_0xd67987[_0x070e('0x5a')]=!![];return _0x210c4d();};exports[_0x070e('0x5b')]=function signToken(_0x216d27){return signJwt(_0x216d27);};exports[_0x070e('0x5c')]=function(_0x5e051a,_0x171621){if(!_0x5e051a[_0x070e('0x32')]){return _0x171621[_0x070e('0x43')](0x194)[_0x070e('0x39')]({'message':_0x070e('0x5d')});}var _0x3bd738={'payload':{'id':_0x5e051a[_0x070e('0x32')]['id'],'role':_0x5e051a[_0x070e('0x32')][_0x070e('0x9')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3bd738)['then'](function(_0x251696){_0x171621['cookie'](_0x070e('0x5e'),_0x251696);_0x171621[_0x070e('0x5f')]('/dashboards/general');})[_0x070e('0x3b')](function(_0x130a50){return _0x171621[_0x070e('0x43')](0x1f4)[_0x070e('0x60')](_0x130a50);});};exports[_0x070e('0x61')]=function(_0x1e8a4f){if(_[_0x070e('0x62')](_0x1e8a4f['apiKeyNonce'])||_[_0x070e('0x62')](_0x1e8a4f['apiKeyIat'])){return null;}else{return createJwt(_0x1e8a4f);}};exports['generateApiKey']=function(_0x3a06c6){_0x3a06c6[_0x070e('0x4c')]=generateNonce();_0x3a06c6[_0x070e('0x63')]=generateIssuedAt();return createJwt(_0x3a06c6);};exports[_0x070e('0x64')]=function(_0x202015,_0x7948ed){var _0x440fa1=_0x202015[_0x070e('0x44')]['apikey'];if(_0x440fa1){var _0x477e69={'nonce':_0x7948ed['apiKeyNonce'],'iat':_0x7948ed['apiKeyIat'],'audience':hardwareConf[_0x070e('0x46')](),'issuer':hardwareConf[_0x070e('0x46')]()};return verifyJwt(_0x440fa1,_0x477e69)['then'](function(){return generateApiKey(_0x7948ed);});}else{throw{'message':_0x070e('0x65')};}};exports[_0x070e('0x66')]=function(_0x210f4a){var _0x2f8104=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2f8104[_0x070e('0x67')](_0x210f4a))throw new db[(_0x070e('0x68'))][(_0x070e('0x69'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports['validatePasswordHistory']=function(_0x5943e3,_0x3087e5,_0x1948a5){var _0x29f497=encryptor[_0x070e('0x6a')](_0x3087e5)['split'](',');for(var _0x25f34c=0x0;_0x25f34c<_0x1948a5;_0x25f34c++){if(!_0x29f497[_0x25f34c])break;if(_0x5943e3['toLowerCase']()===_0x29f497[_0x25f34c][_0x070e('0x6b')]()){var _0x1cbb7e=util[_0x070e('0x6c')](_0x070e('0x6d'),_0x1948a5);if(_0x1948a5===0x1){_0x1cbb7e=_0x070e('0x6e');}throw new db[(_0x070e('0x68'))]['ValidationError'](_0x1cbb7e);}}return;};exports[_0x070e('0x6f')]=function(_0x18e8d0,_0x8aaf00){var _0x533431=_0x8aaf00?encryptor[_0x070e('0x6a')](_0x8aaf00)[_0x070e('0x70')](','):[];if(_0x533431['length']===0x5){_0x533431[_0x070e('0x71')](-0x1,0x1);}_0x533431['unshift'](_0x18e8d0);return encryptor[_0x070e('0x72')](_0x533431['join'](','));};function signJwt(_0x4cb86f){var _0x4b354d=BPromise[_0x070e('0x73')](jwt[_0x070e('0x74')],{'context':jwt});var _0x1100d8=_0x4cb86f[_0x070e('0x75')]||config[_0x070e('0x76')][_0x070e('0x77')];return new BPromise(function(_0x498bc6,_0x841c89){_0x4b354d(_0x4cb86f['payload'],_0x1100d8,_0x4cb86f[_0x070e('0x78')])['then'](function(_0x2e10f7){_0x498bc6(_0x2e10f7);})[_0x070e('0x3b')](function(_0x5b0b46){_0x841c89(_0x5b0b46);});});}function verifyJwt(_0x1bcdc3,_0x50399e,_0x1a9e25){var _0x139630=BPromise[_0x070e('0x73')](jwt[_0x070e('0x79')],{'context':jwt});var _0x764b06=_0x1a9e25||config[_0x070e('0x76')][_0x070e('0x77')];return new BPromise(function(_0x148f1d,_0x3ef9cc){_0x139630(_0x1bcdc3,_0x764b06,_0x50399e)[_0x070e('0x37')](function(_0x40c560){_0x148f1d(_0x40c560);})[_0x070e('0x3b')](function(_0x455bf2){_0x3ef9cc(_0x455bf2);});});}function generateNonce(){return crypto[_0x070e('0x7a')](0x10)['toString'](_0x070e('0x7b'));}function generateIssuedAt(){return Math[_0x070e('0x7c')](Date[_0x070e('0x7d')]()/0x3e8)[_0x070e('0x7e')]();}function createJwt(_0x5712d1){var _0x2ccd8d={'payload':{'iat':_0x5712d1[_0x070e('0x63')],'nonce':_0x5712d1[_0x070e('0x4c')]},'options':{'algorithm':_0x070e('0x7f'),'subject':_0x5712d1['id'][_0x070e('0x7e')](),'issuer':hardwareConf[_0x070e('0x46')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x2ccd8d)[_0x070e('0x37')](function(_0x7d154){return{'iat':_0x5712d1[_0x070e('0x63')],'nonce':_0x5712d1[_0x070e('0x4c')],'token':_0x7d154};});}
\ No newline at end of file
+var _0x9bde=['whatsappAutoanswerDelay','isChatInteractionAuthorized','use','user','ChatInteraction','params','closed','disposition','then','status','unmanaged','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','User','find','authenticate','pass','json','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','send','isNil','generateApiKey','regenerateApiKey','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','sign','secret','payload','options','promisify','verify','randomBytes','toString','hex','floor','now','HS512','../../config/environment','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','secrets','session','role','fullname','name','internal','email','userpic','permissions','chatPause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3151eb,_0x3214dd){_0x3151eb=_0x3151eb-0x0;var _0x27c5ea=_0x9bde[_0x3151eb];return _0x27c5ea;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xe9bd('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xe9bd('0x1'));var encryptor=require('../encryptor');var _=require(_0xe9bd('0x2'));var jwt=require(_0xe9bd('0x3'));var expressJwt=require(_0xe9bd('0x4'));var compose=require(_0xe9bd('0x5'));var basicAuth=require(_0xe9bd('0x6'));var crypto=require(_0xe9bd('0x7'));var BPromise=require(_0xe9bd('0x8'));var util=require('util');var moment=require(_0xe9bd('0x9'));var validateJwt=expressJwt({'secret':config[_0xe9bd('0xa')][_0xe9bd('0xb')]});var userAttributes=['id',_0xe9bd('0xc'),_0xe9bd('0xd'),_0xe9bd('0xe'),_0xe9bd('0xf'),_0xe9bd('0x10'),_0xe9bd('0x11'),_0xe9bd('0x12'),'md5secret','voicePause',_0xe9bd('0x13'),_0xe9bd('0x14'),_0xe9bd('0x15'),'smsPause',_0xe9bd('0x16'),_0xe9bd('0x17'),_0xe9bd('0x18'),_0xe9bd('0x19'),'lastPauseAt',_0xe9bd('0x1a'),'allowmessenger',_0xe9bd('0x1b'),_0xe9bd('0x1c'),_0xe9bd('0x1d'),'phoneBarAutoAnswerDelay','phoneBarDnd',_0xe9bd('0x1e'),_0xe9bd('0x1f'),_0xe9bd('0x20'),_0xe9bd('0x21'),_0xe9bd('0x22'),_0xe9bd('0x23'),_0xe9bd('0x24'),'hotdesk',_0xe9bd('0x25'),_0xe9bd('0x26'),_0xe9bd('0x27'),'settingsEnabled',_0xe9bd('0x28'),_0xe9bd('0x29'),_0xe9bd('0x2a'),_0xe9bd('0x2b'),'ignorePauseForPreviewCalls',_0xe9bd('0x2c'),'chatAutoanswer',_0xe9bd('0x2d'),'emailAutoanswer',_0xe9bd('0x2e'),_0xe9bd('0x2f'),_0xe9bd('0x30'),_0xe9bd('0x31'),_0xe9bd('0x32'),_0xe9bd('0x33'),_0xe9bd('0x34'),'whatsappAutoanswer',_0xe9bd('0x35')];exports[_0xe9bd('0x36')]=function(){return this['isAuthenticated'](!![])[_0xe9bd('0x37')](function(_0x505c23,_0x238ab1,_0x1b9cc9){if(_0x505c23[_0xe9bd('0x38')]){_0x1b9cc9();}else{return db[_0xe9bd('0x39')]['findOne']({'where':{'id':_0x505c23[_0xe9bd('0x3a')]['id']},'attributes':['id',_0xe9bd('0x3b'),_0xe9bd('0x3c')],'raw':!![]})[_0xe9bd('0x3d')](function(_0x2641be){if(_0x2641be&&_0x2641be[_0xe9bd('0x3b')]){return _0x238ab1[_0xe9bd('0x3e')](_0x2641be[_0xe9bd('0x3c')]===_0xe9bd('0x3f')?0x195:0x193)['json']({'message':_0x2641be[_0xe9bd('0x3c')]===_0xe9bd('0x3f')?'Unmanaged.':_0xe9bd('0x40')});}else{_0x1b9cc9();}})[_0xe9bd('0x41')](function(_0x119672){_0x1b9cc9(_0x119672);});}});};exports[_0xe9bd('0x42')]=function isAuthenticated(_0x141b95){return compose()[_0xe9bd('0x37')](function(_0x519f48,_0x5b7f1d,_0x1de54c){var _0x56e409;if(_0x519f48[_0xe9bd('0x43')][_0xe9bd('0x44')]){if(_[_0xe9bd('0x45')](_0x519f48[_0xe9bd('0x43')][_0xe9bd('0x44')],'Basic')){var _0x4b7bc2=basicAuth(_0x519f48);db[_0xe9bd('0x46')][_0xe9bd('0x47')]({'where':{'name':_0x4b7bc2[_0xe9bd('0xe')]}})[_0xe9bd('0x3d')](function(_0xe2436){if(!_0xe2436||!_0xe2436[_0xe9bd('0x48')](_0x4b7bc2[_0xe9bd('0x49')])){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':'Wrong\x20credentials.'});}_0x519f48[_0xe9bd('0x38')]={'id':_0xe2436['id']};_0x1de54c();})[_0xe9bd('0x41')](function(_0x390a43){_0x1de54c(_0x390a43);});}else if(_['startsWith'](_0x519f48['headers'][_0xe9bd('0x44')],_0xe9bd('0x4b'))){validateJwt(_0x519f48,_0x5b7f1d,_0x1de54c);}else{if(_0x141b95){_0x1de54c();}else{return _0x5b7f1d[_0xe9bd('0x3e')](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x4c')});}}}else if(_0x519f48[_0xe9bd('0x4d')][_0xe9bd('0x4e')]){try{var _0x1c6173={'audience':hardwareConf[_0xe9bd('0x4f')](),'issuer':hardwareConf[_0xe9bd('0x4f')]()};verifyJwt(_0x519f48[_0xe9bd('0x4d')][_0xe9bd('0x4e')],_0x1c6173)[_0xe9bd('0x3d')](function(_0x199477){return db[_0xe9bd('0x46')][_0xe9bd('0x47')]({'where':{'id':_0x199477[_0xe9bd('0x50')]}})[_0xe9bd('0x3d')](function(_0x4c689d){_0x56e409=_0x4c689d;return db[_0xe9bd('0x51')][_0xe9bd('0x52')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe9bd('0x53')],'raw':!![]});})[_0xe9bd('0x3d')](function(_0x4c7d47){if(!_0x56e409||!_['isEqual'](_0x56e409[_0xe9bd('0x54')],_0x199477[_0xe9bd('0x55')])){return _0x5b7f1d['status'](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x56')});}if(_0x56e409[_0xe9bd('0x57')]){return _0x5b7f1d['status'](0x191)[_0xe9bd('0x4a')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x56e409[_0xe9bd('0x58')]){if(_0x4c7d47[_0xe9bd('0x53')]>0x0){if(moment(_0x56e409[_0xe9bd('0x59')])[_0xe9bd('0x5a')](_0x4c7d47['blockDuration'],_0xe9bd('0x5b'))>moment()){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5c')});}}else{return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5c')});}}_0x519f48[_0xe9bd('0x38')]={'id':_0x56e409['id']};_0x1de54c();});})[_0xe9bd('0x41')](function(){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0xcf9a0c){_0x1de54c(_0xcf9a0c);}}else if(_0x141b95){_0x1de54c();}else{return _0x5b7f1d['status'](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x4c')});}})[_0xe9bd('0x37')](function(_0x480797,_0x1ba613,_0x2923cf){if(_0x480797[_0xe9bd('0x38')]){db['User'][_0xe9bd('0x47')]({'where':{'id':_0x480797[_0xe9bd('0x38')]['id']},'attributes':userAttributes})[_0xe9bd('0x3d')](function(_0x388132){if(!_0x388132){return _0x1ba613[_0xe9bd('0x3e')](0x194)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5d')});}_0x480797[_0xe9bd('0x38')]=_0x388132;_0x2923cf();})[_0xe9bd('0x41')](function(_0x300e07){_0x2923cf(_0x300e07);});}else if(_0x141b95){_0x2923cf();}else{return _0x1ba613[_0xe9bd('0x3e')](0x194)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5e')});}});};exports[_0xe9bd('0x5f')]=function canUpdate(){return compose()[_0xe9bd('0x37')](function(_0x5b70d3,_0x5a86fd,_0x283e67){return licenseUtil[_0xe9bd('0x60')]()[_0xe9bd('0x3d')](function(_0x58828b){if(_0x58828b['update']){_0x283e67();}else{return _0x5a86fd[_0xe9bd('0x3e')](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x61')});}})[_0xe9bd('0x41')](function(_0x39fb61){_0x283e67(_0x39fb61);});});};exports[_0xe9bd('0x62')]=function isWebrtcLicence(){return compose()[_0xe9bd('0x37')](function(_0x512899,_0x1e45fc,_0x4cc146){return licenseUtil[_0xe9bd('0x60')]()[_0xe9bd('0x3d')](function(_0x33ba69){if(_0x33ba69[_0xe9bd('0x63')]){_0x4cc146();}else{return _0x1e45fc[_0xe9bd('0x3e')](0x193)['json']({'message':_0xe9bd('0x61')});}})[_0xe9bd('0x41')](function(_0xe14fa4){_0x4cc146(_0xe14fa4);});});};exports['isMiddleware']=function(_0xff4e14,_0x476f23,_0x34f787){_0xff4e14['isMiddleware']=!![];return _0x34f787();};exports[_0xe9bd('0x64')]=function signToken(_0x27e7b0){return signJwt(_0x27e7b0);};exports[_0xe9bd('0x65')]=function(_0x10ec29,_0x1ee09c){if(!_0x10ec29['user']){return _0x1ee09c[_0xe9bd('0x3e')](0x194)['json']({'message':_0xe9bd('0x66')});}var _0x239be9={'payload':{'id':_0x10ec29[_0xe9bd('0x38')]['id'],'role':_0x10ec29[_0xe9bd('0x38')][_0xe9bd('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x239be9)['then'](function(_0x15d1d0){_0x1ee09c['cookie'](_0xe9bd('0x67'),_0x15d1d0);_0x1ee09c[_0xe9bd('0x68')]('/dashboards/general');})['catch'](function(_0x1ce539){return _0x1ee09c['status'](0x1f4)[_0xe9bd('0x69')](_0x1ce539);});};exports['retrieveApiKey']=function(_0x26b25a){if(_[_0xe9bd('0x6a')](_0x26b25a['apiKeyNonce'])||_[_0xe9bd('0x6a')](_0x26b25a['apiKeyIat'])){return null;}else{return createJwt(_0x26b25a);}};exports[_0xe9bd('0x6b')]=function(_0x2d9a94){_0x2d9a94[_0xe9bd('0x54')]=generateNonce();_0x2d9a94['apiKeyIat']=generateIssuedAt();return createJwt(_0x2d9a94);};exports[_0xe9bd('0x6c')]=function(_0x1d703f,_0x45b69e){var _0x232a36=_0x1d703f['query']['apikey'];if(_0x232a36){var _0x441f89={'nonce':_0x45b69e['apiKeyNonce'],'iat':_0x45b69e[_0xe9bd('0x6d')],'audience':hardwareConf[_0xe9bd('0x4f')](),'issuer':hardwareConf[_0xe9bd('0x4f')]()};return verifyJwt(_0x232a36,_0x441f89)[_0xe9bd('0x3d')](function(){return generateApiKey(_0x45b69e);});}else{throw{'message':_0xe9bd('0x6e')};}};exports[_0xe9bd('0x6f')]=function(_0x373057){var _0x3381ee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3381ee[_0xe9bd('0x70')](_0x373057))throw new db[(_0xe9bd('0x71'))][(_0xe9bd('0x72'))](_0xe9bd('0x73'));return;};exports['validatePasswordHistory']=function(_0x596a7d,_0x566dd8,_0x10e685){var _0x5a516e=encryptor[_0xe9bd('0x74')](_0x566dd8)[_0xe9bd('0x75')](',');for(var _0x90db01=0x0;_0x90db01<_0x10e685;_0x90db01++){if(!_0x5a516e[_0x90db01])break;if(_0x596a7d[_0xe9bd('0x76')]()===_0x5a516e[_0x90db01][_0xe9bd('0x76')]()){var _0xaf6ffd=util[_0xe9bd('0x77')](_0xe9bd('0x78'),_0x10e685);if(_0x10e685===0x1){_0xaf6ffd=_0xe9bd('0x79');}throw new db['Sequelize'][(_0xe9bd('0x72'))](_0xaf6ffd);}}return;};exports[_0xe9bd('0x7a')]=function(_0x3d3e74,_0x3f848d){var _0x4d58c1=_0x3f848d?encryptor[_0xe9bd('0x74')](_0x3f848d)[_0xe9bd('0x75')](','):[];if(_0x4d58c1[_0xe9bd('0x7b')]===0x5){_0x4d58c1['splice'](-0x1,0x1);}_0x4d58c1[_0xe9bd('0x7c')](_0x3d3e74);return encryptor[_0xe9bd('0x7d')](_0x4d58c1[_0xe9bd('0x7e')](','));};function signJwt(_0xfe82f7){var _0x4ee26a=BPromise['promisify'](jwt[_0xe9bd('0x7f')],{'context':jwt});var _0x188891=_0xfe82f7[_0xe9bd('0x80')]||config[_0xe9bd('0xa')]['session'];return new BPromise(function(_0x49add9,_0x305efa){_0x4ee26a(_0xfe82f7[_0xe9bd('0x81')],_0x188891,_0xfe82f7[_0xe9bd('0x82')])[_0xe9bd('0x3d')](function(_0x1fd2b5){_0x49add9(_0x1fd2b5);})[_0xe9bd('0x41')](function(_0x4870f8){_0x305efa(_0x4870f8);});});}function verifyJwt(_0x179c8d,_0x5681ab,_0x27e07c){var _0x28dd03=BPromise[_0xe9bd('0x83')](jwt[_0xe9bd('0x84')],{'context':jwt});var _0x5bc1f8=_0x27e07c||config[_0xe9bd('0xa')][_0xe9bd('0xb')];return new BPromise(function(_0x3b0190,_0x4f35c4){_0x28dd03(_0x179c8d,_0x5bc1f8,_0x5681ab)[_0xe9bd('0x3d')](function(_0x1a9d0c){_0x3b0190(_0x1a9d0c);})[_0xe9bd('0x41')](function(_0x3e3e05){_0x4f35c4(_0x3e3e05);});});}function generateNonce(){return crypto[_0xe9bd('0x85')](0x10)[_0xe9bd('0x86')](_0xe9bd('0x87'));}function generateIssuedAt(){return Math[_0xe9bd('0x88')](Date[_0xe9bd('0x89')]()/0x3e8)[_0xe9bd('0x86')]();}function createJwt(_0x14c599){var _0x37d07a={'payload':{'iat':_0x14c599['apiKeyIat'],'nonce':_0x14c599[_0xe9bd('0x54')]},'options':{'algorithm':_0xe9bd('0x8a'),'subject':_0x14c599['id']['toString'](),'issuer':hardwareConf[_0xe9bd('0x4f')](),'audience':hardwareConf[_0xe9bd('0x4f')]()}};return signJwt(_0x37d07a)['then'](function(_0x561165){return{'iat':_0x14c599[_0xe9bd('0x6d')],'nonce':_0x14c599[_0xe9bd('0x54')],'token':_0x561165};});}
\ No newline at end of file
index 5fb8241..0ffc5e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8cc=['error','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','write','end','final','binary','unlink','createDecipher','encryptString','secret','utf8','base64','crypto','bluebird','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','join'];(function(_0x2ab13b,_0x3e302e){var _0x415e8b=function(_0x3b4c45){while(--_0x3b4c45){_0x2ab13b['push'](_0x2ab13b['shift']());}};_0x415e8b(++_0x3e302e);}(_0xc8cc,0x135));var _0xcc8c=function(_0x5c468f,_0x2e5c25){_0x5c468f=_0x5c468f-0x0;var _0x2136b0=_0xc8cc[_0x5c468f];return _0x2136b0;};'use strict';var crypto=require(_0xcc8c('0x0'));var fs=require('fs');var BPromise=require(_0xcc8c('0x1'));var _=require('lodash');var config=require(_0xcc8c('0x2'));var logger=require(_0xcc8c('0x3'))(_0xcc8c('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xcc8c('0x5')][_0xcc8c('0x6')],'algorithm':_0xcc8c('0x7')};const fileOptions={'algorithm':'aes192'};if(config['encrypt']&&config[_0xcc8c('0x8')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0xcc8c('0x8')][_0xcc8c('0x9')]);if(isSupported){fileOptions[_0xcc8c('0x9')]=config[_0xcc8c('0x8')][_0xcc8c('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xcc8c('0xa')](',\x20');logger[_0xcc8c('0xb')](config[_0xcc8c('0x8')]['algorithm'],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x33eb12){return AES_SUPPORTED_RX['test'](_0x33eb12);}function getSupportedCiphers(){return crypto[_0xcc8c('0xc')]()[_0xcc8c('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x1f77e7){return getSupportedCiphers()[_0xcc8c('0xe')](_0x1f77e7)>-0x1;}function combineOptions(_0x415d1d){var _0x222f0a={};for(var _0x4eb694 in fileOptions){if(fileOptions[_0xcc8c('0xf')](_0x4eb694)){_0x222f0a[_0x4eb694]=fileOptions[_0x4eb694];}}if(_0x415d1d){for(var _0x35a50c in _0x415d1d){if(_0x415d1d[_0xcc8c('0xf')](_0x35a50c)){_0x222f0a[_0x35a50c]=_0x415d1d[_0x35a50c];}}}return _0x222f0a;}exports[_0xcc8c('0x10')]=function(_0x53bb20,_0x46ffd6,_0x55589f,_0x9b41b7){return new BPromise(function(_0x5ca429,_0x344bb9){_0x9b41b7=combineOptions(_0x9b41b7);var _0x47f373=new Buffer(_0x55589f);var _0x505417=fs[_0xcc8c('0x11')](_0x53bb20);var _0x4ad780=fs[_0xcc8c('0x12')](_0x46ffd6);var _0x57f2e9=crypto[_0xcc8c('0x13')](_0x9b41b7[_0xcc8c('0x9')],_0x47f373);_0x505417['on'](_0xcc8c('0x14'),function(_0x4975e7){var _0x228ac2=new Buffer(_0x57f2e9[_0xcc8c('0x15')](_0x4975e7),'binary');_0x4ad780[_0xcc8c('0x16')](_0x228ac2);});_0x505417['on'](_0xcc8c('0x17'),function(){try{var _0x56e9d1=new Buffer(_0x57f2e9[_0xcc8c('0x18')]('binary'),_0xcc8c('0x19'));_0x4ad780['write'](_0x56e9d1);_0x4ad780['end']();_0x4ad780['on']('close',function(){return _0x5ca429(_0x46ffd6);});}catch(_0x39ea68){fs[_0xcc8c('0x1a')](_0x46ffd6);return _0x344bb9(_0x39ea68);}});});};exports['decryptFile']=function(_0x47b45b,_0x15fa3d,_0x5beb95,_0x500699){return new BPromise(function(_0x5d5afa,_0x40494d){_0x500699=combineOptions(_0x500699);var _0x25eb7b=new Buffer(_0x5beb95);var _0x38463a=fs[_0xcc8c('0x11')](_0x47b45b);var _0x4d073d=fs[_0xcc8c('0x12')](_0x15fa3d);var _0x369d02=crypto[_0xcc8c('0x1b')](_0x500699[_0xcc8c('0x9')],_0x25eb7b);_0x38463a['on'](_0xcc8c('0x14'),function(_0x1b313a){var _0xde8d3a=new Buffer(_0x369d02[_0xcc8c('0x15')](_0x1b313a),_0xcc8c('0x19'));_0x4d073d[_0xcc8c('0x16')](_0xde8d3a);});_0x38463a['on'](_0xcc8c('0x17'),function(){try{var _0x2dca4d=new Buffer(_0x369d02[_0xcc8c('0x18')](_0xcc8c('0x19')),_0xcc8c('0x19'));_0x4d073d['write'](_0x2dca4d);_0x4d073d[_0xcc8c('0x17')]();_0x4d073d['on']('close',function(){return _0x5d5afa(_0x15fa3d);});}catch(_0x3b796b){fs['unlink'](_0x15fa3d);return _0x40494d(_0x3b796b);}});});};exports[_0xcc8c('0x1c')]=function(_0x15113b,_0x24a62a,_0x3ced7b){var _0x355931=_0x3ced7b||stringOptions['algorithm'];var _0x8f13ae=_0x24a62a||stringOptions[_0xcc8c('0x1d')];var _0x42becd=crypto['createCipher'](_0x355931,_0x8f13ae);var _0x1854cb=_0x42becd[_0xcc8c('0x15')](_0x15113b,_0xcc8c('0x1e'),_0xcc8c('0x1f'));_0x1854cb+=_0x42becd[_0xcc8c('0x18')](_0xcc8c('0x1f'));return _0x1854cb;};exports['decryptString']=function(_0xa60d27,_0x56503f,_0x21217d){var _0x9f8b0b=_0x21217d||stringOptions[_0xcc8c('0x9')];var _0x5946e6=_0x56503f||stringOptions[_0xcc8c('0x1d')];var _0x18d67f=crypto[_0xcc8c('0x1b')](_0x9f8b0b,_0x5946e6);var _0x2aec79=_0x18d67f[_0xcc8c('0x15')](_0xa60d27,'base64',_0xcc8c('0x1e'));_0x2aec79+=_0x18d67f[_0xcc8c('0x18')](_0xcc8c('0x1e'));return _0x2aec79;};
\ No newline at end of file
+var _0x1ba4=['createReadStream','final','secret','base64','utf8','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','indexOf','hasOwnProperty','encryptFile','createWriteStream','createCipher','data','update','binary','write','end','close','unlink','decryptFile'];(function(_0x433813,_0x3607e6){var _0x2d7ef7=function(_0x472ab7){while(--_0x472ab7){_0x433813['push'](_0x433813['shift']());}};_0x2d7ef7(++_0x3607e6);}(_0x1ba4,0x8d));var _0x41ba=function(_0x3b3879,_0x5eeb7f){_0x3b3879=_0x3b3879-0x0;var _0x8ddb6a=_0x1ba4[_0x3b3879];return _0x8ddb6a;};'use strict';var crypto=require(_0x41ba('0x0'));var fs=require('fs');var BPromise=require(_0x41ba('0x1'));var _=require(_0x41ba('0x2'));var config=require(_0x41ba('0x3'));var logger=require(_0x41ba('0x4'))(_0x41ba('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x41ba('0x6')][_0x41ba('0x7')],'algorithm':_0x41ba('0x8')};const fileOptions={'algorithm':_0x41ba('0x9')};if(config[_0x41ba('0xa')]&&config[_0x41ba('0xa')]['algorithm']){var isSupported=isAlgorithmSupported(config['encrypt'][_0x41ba('0xb')]);if(isSupported){fileOptions[_0x41ba('0xb')]=config[_0x41ba('0xa')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x41ba('0xc')](config['encrypt'][_0x41ba('0xb')],_0x41ba('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x2cbed2){return AES_SUPPORTED_RX[_0x41ba('0xe')](_0x2cbed2);}function getSupportedCiphers(){return crypto[_0x41ba('0xf')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x4359a1){return getSupportedCiphers()[_0x41ba('0x10')](_0x4359a1)>-0x1;}function combineOptions(_0x372349){var _0x1809e3={};for(var _0x44bb04 in fileOptions){if(fileOptions[_0x41ba('0x11')](_0x44bb04)){_0x1809e3[_0x44bb04]=fileOptions[_0x44bb04];}}if(_0x372349){for(var _0x329f74 in _0x372349){if(_0x372349[_0x41ba('0x11')](_0x329f74)){_0x1809e3[_0x329f74]=_0x372349[_0x329f74];}}}return _0x1809e3;}exports[_0x41ba('0x12')]=function(_0x108995,_0x38f26a,_0x49e0c2,_0x556236){return new BPromise(function(_0x44a759,_0x5e2fcb){_0x556236=combineOptions(_0x556236);var _0x32463b=new Buffer(_0x49e0c2);var _0x37cc4a=fs['createReadStream'](_0x108995);var _0x4f87a0=fs[_0x41ba('0x13')](_0x38f26a);var _0x25fba7=crypto[_0x41ba('0x14')](_0x556236[_0x41ba('0xb')],_0x32463b);_0x37cc4a['on'](_0x41ba('0x15'),function(_0x5616c5){var _0x6a10e8=new Buffer(_0x25fba7[_0x41ba('0x16')](_0x5616c5),_0x41ba('0x17'));_0x4f87a0[_0x41ba('0x18')](_0x6a10e8);});_0x37cc4a['on'](_0x41ba('0x19'),function(){try{var _0x53b87e=new Buffer(_0x25fba7['final']('binary'),_0x41ba('0x17'));_0x4f87a0['write'](_0x53b87e);_0x4f87a0[_0x41ba('0x19')]();_0x4f87a0['on'](_0x41ba('0x1a'),function(){return _0x44a759(_0x38f26a);});}catch(_0x1ec8e6){fs[_0x41ba('0x1b')](_0x38f26a);return _0x5e2fcb(_0x1ec8e6);}});});};exports[_0x41ba('0x1c')]=function(_0x1d3e92,_0x85bb06,_0x4a336b,_0x527688){return new BPromise(function(_0x26e096,_0x3f44de){_0x527688=combineOptions(_0x527688);var _0x2895a7=new Buffer(_0x4a336b);var _0x1a5d32=fs[_0x41ba('0x1d')](_0x1d3e92);var _0x322b48=fs['createWriteStream'](_0x85bb06);var _0x10b9b9=crypto['createDecipher'](_0x527688['algorithm'],_0x2895a7);_0x1a5d32['on'](_0x41ba('0x15'),function(_0x4e15b3){var _0x1c7ece=new Buffer(_0x10b9b9[_0x41ba('0x16')](_0x4e15b3),_0x41ba('0x17'));_0x322b48[_0x41ba('0x18')](_0x1c7ece);});_0x1a5d32['on']('end',function(){try{var _0x12b49a=new Buffer(_0x10b9b9[_0x41ba('0x1e')](_0x41ba('0x17')),_0x41ba('0x17'));_0x322b48[_0x41ba('0x18')](_0x12b49a);_0x322b48[_0x41ba('0x19')]();_0x322b48['on'](_0x41ba('0x1a'),function(){return _0x26e096(_0x85bb06);});}catch(_0x4e73d0){fs['unlink'](_0x85bb06);return _0x3f44de(_0x4e73d0);}});});};exports['encryptString']=function(_0x5ce680,_0x29951c,_0x4a2ddb){var _0x2b09d2=_0x4a2ddb||stringOptions[_0x41ba('0xb')];var _0x4c741b=_0x29951c||stringOptions[_0x41ba('0x1f')];var _0x56d5a4=crypto['createCipher'](_0x2b09d2,_0x4c741b);var _0x4d104f=_0x56d5a4['update'](_0x5ce680,'utf8',_0x41ba('0x20'));_0x4d104f+=_0x56d5a4[_0x41ba('0x1e')]('base64');return _0x4d104f;};exports['decryptString']=function(_0x45d1f5,_0x4a843a,_0x302f69){var _0x43ece5=_0x302f69||stringOptions[_0x41ba('0xb')];var _0x16c4df=_0x4a843a||stringOptions[_0x41ba('0x1f')];var _0x30d642=crypto['createDecipher'](_0x43ece5,_0x16c4df);var _0xc7b400=_0x30d642[_0x41ba('0x16')](_0x45d1f5,'base64',_0x41ba('0x21'));_0xc7b400+=_0x30d642['final'](_0x41ba('0x21'));return _0xc7b400;};
\ No newline at end of file
index 85ec083..857df97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63ae=['dirname','basename','.csv','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','inspect','Failed','exit','util','path','lodash','to-csv','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','Empty','length','range','num','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push'];(function(_0x3e6886,_0x522f84){var _0x221caa=function(_0x1913c9){while(--_0x1913c9){_0x3e6886['push'](_0x3e6886['shift']());}};_0x221caa(++_0x522f84);}(_0x63ae,0x17e));var _0xe63a=function(_0x36feb7,_0xca93f4){_0x36feb7=_0x36feb7-0x0;var _0x33f781=_0x63ae[_0x36feb7];return _0x33f781;};'use strict';var util=require(_0xe63a('0x0'));var path=require(_0xe63a('0x1'));var _=require(_0xe63a('0x2'));var csv=require(_0xe63a('0x3'));var fs=require('fs');var BPromise=require(_0xe63a('0x4'));var zipdir=require(_0xe63a('0x5'));var rimraf=require('rimraf');var db=require(_0xe63a('0x6'))['db'];var dbH=require(_0xe63a('0x6'))[_0xe63a('0x7')];var logger=require(_0xe63a('0x8'))(_0xe63a('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xe63a('0xa')][0x2]);var QUERY=process[_0xe63a('0xa')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x24c76d,_0x59a358){var _0x1e2fc9={'status':_0x24c76d};var _0x27ae5c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x59a358){_0x1e2fc9[_0xe63a('0xb')]=_0x59a358;}return db[_0xe63a('0xc')][_0xe63a('0xd')](_0x1e2fc9,_0x27ae5c);}function main(){var _0x1fe287=0x1388;var _0x3b8177;logger['info'](util[_0xe63a('0xe')](_0xe63a('0xf'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xe63a('0x10')][_0xe63a('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe63a('0x12'),_0xe63a('0x13')]})[_0xe63a('0x14')](function(_0x24edba){if(_0x24edba){_0x3b8177=_0x24edba;_0x1fe287=_0x3b8177[_0xe63a('0x13')]||0x1388;}})['then'](function(){return dbH['sequelize']['query'](util[_0xe63a('0xe')](_0xe63a('0x15'),QUERY),{'type':dbH[_0xe63a('0x16')][_0xe63a('0x17')]['SELECT']});})['then'](function(_0x161860){if(!_0x161860[0x0]['num']){return analyticExtractedReport(_0xe63a('0x18'));}var _0x3d0b28=[];var _0x4524a4=0x0;if(_0x3b8177[_0xe63a('0x12')]){if(_0x161860&&_0x161860[_0xe63a('0x19')]){var _0x27ac1a=_[_0xe63a('0x1a')](_0x161860[0x0][_0xe63a('0x1b')]/_0x1fe287);var _0x34ab30=Number[_0xe63a('0x1c')](_0x161860[0x0][_0xe63a('0x1b')]/_0x1fe287)?_0x161860[0x0][_0xe63a('0x1b')]%_0x1fe287:0x0;_0x27ac1a[_0xe63a('0x1d')](function(_0xf8e7db){if(_0xf8e7db>0x0){_0x4524a4+=_0x1fe287;}_0x3d0b28['push'](dbH[_0xe63a('0x16')][_0xe63a('0x1e')](util[_0xe63a('0xe')](_0xe63a('0x1f'),QUERY,_0x1fe287,_0x4524a4),{'type':dbH['sequelize']['QueryTypes'][_0xe63a('0x20')]}));});if(_0x34ab30>0x0){_0x4524a4+=_0x1fe287;_0x3d0b28[_0xe63a('0x21')](dbH[_0xe63a('0x16')][_0xe63a('0x1e')](util[_0xe63a('0xe')](_0xe63a('0x1f'),QUERY,_0x34ab30,_0x4524a4),{'type':dbH[_0xe63a('0x16')][_0xe63a('0x17')][_0xe63a('0x20')]}));}}}else{_0x3d0b28[_0xe63a('0x21')](dbH['sequelize'][_0xe63a('0x1e')](QUERY,{'type':dbH[_0xe63a('0x16')][_0xe63a('0x17')]['SELECT']}));}var _0x4c25b7=path[_0xe63a('0x22')](PATH);var _0x25ab64=path[_0xe63a('0x23')](PATH,_0xe63a('0x24'));var _0x9f533=_0x3b8177[_0xe63a('0x12')]&&_0x3d0b28[_0xe63a('0x19')]>0x1;var _0x2f6995=[];if(!fs['existsSync'](path['join'](_0x4c25b7,_0x25ab64))&&_0x9f533){fs['mkdirSync'](path[_0xe63a('0x25')](_0x4c25b7,_0x25ab64));}return BPromise[_0xe63a('0x26')](_0x3d0b28,function(_0x11ea05){_0x2f6995[_0xe63a('0x21')](_0x11ea05);})[_0xe63a('0x14')](function(){for(var _0x2cccad=0x0;_0x2cccad<_0x2f6995['length'];_0x2cccad+=0x1){var _0x54d474;var _0x1d1f9a=_0x2f6995[_0x2cccad];if(_0x9f533){_0x54d474=path['join'](_0x4c25b7,_0x25ab64,util[_0xe63a('0xe')](_0xe63a('0x27'),_0x25ab64,_0x2cccad,_0xe63a('0x28')));}else{_0x54d474=path[_0xe63a('0x25')](_0x4c25b7,util[_0xe63a('0xe')](_0xe63a('0x29'),_0x25ab64,_0xe63a('0x28')));}fs[_0xe63a('0x2a')](_0x54d474,csv(_0x1d1f9a));}})['then'](function(){if(_0x9f533){return new Promise(function(_0x2a46d5){zipdir(path['join'](_0x4c25b7,_0x25ab64),{'saveTo':path[_0xe63a('0x25')](_0x4c25b7,util[_0xe63a('0xe')](_0xe63a('0x29'),_0x25ab64,_0xe63a('0x2b')))},function(_0x3e078a,_0x21f02d){rimraf(path[_0xe63a('0x25')](_0x4c25b7,_0x25ab64),function(){});_0x2a46d5(_0xe63a('0x2c'));});});}})[_0xe63a('0x14')](function(){logger[_0xe63a('0x2d')](util[_0xe63a('0xe')](_0xe63a('0x2e'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x9f533?util[_0xe63a('0xe')](_0xe63a('0x29'),_0x25ab64,_0x9f533?_0xe63a('0x2b'):_0xe63a('0x28')):null);});})['catch'](function(_0x1ba10f){logger[_0xe63a('0x2d')](util[_0xe63a('0xe')](_0xe63a('0x2f'),EXTRACTED_REPORT_ID,_0xe63a('0x30')),util[_0xe63a('0x31')](_0x1ba10f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe63a('0x32'));})['finally'](function(){process[_0xe63a('0x33')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x74ee=['%s%d.%s','writeFileSync','%s.%s','zip\x20finished','CSV','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','length','existsSync','join','each'];(function(_0x4ec7eb,_0x19a24f){var _0x5a18ef=function(_0x592c6f){while(--_0x592c6f){_0x4ec7eb['push'](_0x4ec7eb['shift']());}};_0x5a18ef(++_0x19a24f);}(_0x74ee,0x6a));var _0xe74e=function(_0x392215,_0x25511a){_0x392215=_0x392215-0x0;var _0x35ecd5=_0x74ee[_0x392215];return _0x35ecd5;};'use strict';var util=require(_0xe74e('0x0'));var path=require('path');var _=require(_0xe74e('0x1'));var csv=require(_0xe74e('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xe74e('0x3'));var rimraf=require(_0xe74e('0x4'));var db=require(_0xe74e('0x5'))['db'];var dbH=require(_0xe74e('0x5'))[_0xe74e('0x6')];var logger=require('../../config/logger')(_0xe74e('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xe74e('0x8')][0x2]);var QUERY=process[_0xe74e('0x8')][0x3];var PATH=process[_0xe74e('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2caba5,_0x25a473){var _0x33d27f={'status':_0x2caba5};var _0x55caa1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x25a473){_0x33d27f[_0xe74e('0x9')]=_0x25a473;}return db[_0xe74e('0xa')]['update'](_0x33d27f,_0x55caa1);}function main(){var _0x596804=0x1388;var _0x4a079e;logger[_0xe74e('0xb')](util[_0xe74e('0xc')](_0xe74e('0xd'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xe74e('0xe')][_0xe74e('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe74e('0x10'),_0xe74e('0x11')]})['then'](function(_0x5dfe1a){if(_0x5dfe1a){_0x4a079e=_0x5dfe1a;_0x596804=_0x4a079e[_0xe74e('0x11')]||0x1388;}})[_0xe74e('0x12')](function(){return dbH[_0xe74e('0x13')][_0xe74e('0x14')](util[_0xe74e('0xc')](_0xe74e('0x15'),QUERY),{'type':dbH['sequelize'][_0xe74e('0x16')][_0xe74e('0x17')]});})[_0xe74e('0x12')](function(_0x1e39c5){if(!_0x1e39c5[0x0][_0xe74e('0x18')]){return analyticExtractedReport(_0xe74e('0x19'));}var _0x439772=[];var _0x6e8f58=0x0;if(_0x4a079e['split']){if(_0x1e39c5&&_0x1e39c5['length']){var _0x5644ca=_['range'](_0x1e39c5[0x0]['num']/_0x596804);var _0x38cc1b=Number[_0xe74e('0x1a')](_0x1e39c5[0x0][_0xe74e('0x18')]/_0x596804)?_0x1e39c5[0x0][_0xe74e('0x18')]%_0x596804:0x0;_0x5644ca['forEach'](function(_0x4c74ea){if(_0x4c74ea>0x0){_0x6e8f58+=_0x596804;}_0x439772[_0xe74e('0x1b')](dbH[_0xe74e('0x13')][_0xe74e('0x14')](util[_0xe74e('0xc')](_0xe74e('0x1c'),QUERY,_0x596804,_0x6e8f58),{'type':dbH[_0xe74e('0x13')][_0xe74e('0x16')][_0xe74e('0x17')]}));});if(_0x38cc1b>0x0){_0x6e8f58+=_0x596804;_0x439772[_0xe74e('0x1b')](dbH[_0xe74e('0x13')][_0xe74e('0x14')](util[_0xe74e('0xc')](_0xe74e('0x1c'),QUERY,_0x38cc1b,_0x6e8f58),{'type':dbH[_0xe74e('0x13')][_0xe74e('0x16')][_0xe74e('0x17')]}));}}}else{_0x439772[_0xe74e('0x1b')](dbH[_0xe74e('0x13')][_0xe74e('0x14')](QUERY,{'type':dbH[_0xe74e('0x13')][_0xe74e('0x16')][_0xe74e('0x17')]}));}var _0x2133e1=path[_0xe74e('0x1d')](PATH);var _0x33b7aa=path[_0xe74e('0x1e')](PATH,'.csv');var _0x194ed6=_0x4a079e[_0xe74e('0x10')]&&_0x439772[_0xe74e('0x1f')]>0x1;var _0x3fcbcf=[];if(!fs[_0xe74e('0x20')](path['join'](_0x2133e1,_0x33b7aa))&&_0x194ed6){fs['mkdirSync'](path[_0xe74e('0x21')](_0x2133e1,_0x33b7aa));}return BPromise[_0xe74e('0x22')](_0x439772,function(_0x5e08c1){_0x3fcbcf[_0xe74e('0x1b')](_0x5e08c1);})['then'](function(){for(var _0x1cccba=0x0;_0x1cccba<_0x3fcbcf[_0xe74e('0x1f')];_0x1cccba+=0x1){var _0x4cab9e;var _0x1a52f1=_0x3fcbcf[_0x1cccba];if(_0x194ed6){_0x4cab9e=path[_0xe74e('0x21')](_0x2133e1,_0x33b7aa,util[_0xe74e('0xc')](_0xe74e('0x23'),_0x33b7aa,_0x1cccba,'csv'));}else{_0x4cab9e=path['join'](_0x2133e1,util['format']('%s.%s',_0x33b7aa,'csv'));}fs[_0xe74e('0x24')](_0x4cab9e,csv(_0x1a52f1));}})[_0xe74e('0x12')](function(){if(_0x194ed6){return new Promise(function(_0x3d5c87){zipdir(path[_0xe74e('0x21')](_0x2133e1,_0x33b7aa),{'saveTo':path[_0xe74e('0x21')](_0x2133e1,util[_0xe74e('0xc')](_0xe74e('0x25'),_0x33b7aa,'zip'))},function(_0x537492,_0xf85795){rimraf(path[_0xe74e('0x21')](_0x2133e1,_0x33b7aa),function(){});_0x3d5c87(_0xe74e('0x26'));});});}})[_0xe74e('0x12')](function(){logger[_0xe74e('0xb')](util[_0xe74e('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xe74e('0x27')));return analyticExtractedReport(_0xe74e('0x28'),_0x194ed6?util[_0xe74e('0xc')](_0xe74e('0x25'),_0x33b7aa,_0x194ed6?_0xe74e('0x29'):'csv'):null);});})[_0xe74e('0x2a')](function(_0x137620){logger[_0xe74e('0xb')](util[_0xe74e('0xc')](_0xe74e('0x2b'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x137620,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xe74e('0x2c'));})[_0xe74e('0x2d')](function(){process[_0xe74e('0x2e')](EXIT_CODE);});}main();
\ No newline at end of file
index f0bcec6..9a3cdb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a80=['Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','catch','util','path','moment','html-to-pdfmake','pdfmake/src/printer','jsdom','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','length','auto','push','body','concat','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','Arial','black','right','num','Empty','find','splitSizePdf','then','range','sequelize','query','QueryTypes','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.pdf','split','existsSync','join','mkdirSync','each','%s%d.%s','pdf','all','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','%s.%s','zip','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','center'];(function(_0x1956aa,_0x26d6ba){var _0x220eac=function(_0x2eaaef){while(--_0x2eaaef){_0x1956aa['push'](_0x1956aa['shift']());}};_0x220eac(++_0x26d6ba);}(_0x2a80,0x1e1));var _0x02a8=function(_0x281dc1,_0x4d81f9){_0x281dc1=_0x281dc1-0x0;var _0x53a71e=_0x2a80[_0x281dc1];return _0x53a71e;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x02a8('0x0'));var path=require(_0x02a8('0x1'));var moment=require(_0x02a8('0x2'));var htmlToPdfmake=require(_0x02a8('0x3'));var PdfPrinter=require(_0x02a8('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require(_0x02a8('0x5'))['JSDOM'];var window=new JSDOM('')[_0x02a8('0x6')];var BPromise=require(_0x02a8('0x7'));var db=require('../../mysqldb')['db'];var dbH=require(_0x02a8('0x8'))[_0x02a8('0x9')];var logger=require(_0x02a8('0xa'))(_0x02a8('0xb'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x02a8('0xc')][0x3];var PATH=process[_0x02a8('0xc')][0x4];var NAME=process[_0x02a8('0xc')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x31b895,_0x31cbf2){var _0x198dc6={'status':_0x31b895};var _0x418e3c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x31cbf2){_0x198dc6['savename']=_0x31cbf2;}return db[_0x02a8('0xd')][_0x02a8('0xe')](_0x198dc6,_0x418e3c);}function getHeaders(_0x237cdc){return _[_0x02a8('0xf')](_0x237cdc,function(_0x435d7c){return{'text':_0x435d7c,'style':_0x02a8('0x10')};});}function getRows(_0x26f068,_0x53de41){return _[_0x02a8('0xf')](_0x53de41,function(_0x147f06){return _(_0x147f06)[_0x02a8('0x11')](_0x26f068)[_0x02a8('0xf')](function(_0xda0e7b){return _0xda0e7b?_[_0x02a8('0x12')](_0xda0e7b):'';})[_0x02a8('0x13')]();});}function createTable(_0x3d8c22,_0x4ed093){var _0x34ab70={'widths':_['fill'](Array(_0x3d8c22[_0x02a8('0x14')]),0x91),'heights':function(_0x28c4b4){return _0x28c4b4===0x0?_0x02a8('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x561f06=getHeaders(_0x3d8c22);_0x34ab70['body'][_0x02a8('0x16')](_0x561f06);var _0x2d7a32=getRows(_0x3d8c22,_0x4ed093);_0x34ab70[_0x02a8('0x17')]=_0x34ab70[_0x02a8('0x17')][_0x02a8('0x18')](_0x2d7a32);return _0x34ab70;}function createTables(_0x208384){var _0x40acf2=[];var _0x399646=_['chunk'](Object[_0x02a8('0x19')](_0x208384[0x0]),0x5);_0x399646[_0x02a8('0x1a')](function(_0x5a51fb){_0x40acf2[_0x02a8('0x16')](createTable(_0x5a51fb,_0x208384));});return _0x40acf2;}function getPDFDocDefinition(_0x25dc6c){var _0x48edad=util[_0x02a8('0x1b')](_0x02a8('0x1c'),NAME,EXTRACTED_REPORT[_0x02a8('0x1d')],moment(EXTRACTED_REPORT[_0x02a8('0x1e')])[_0x02a8('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0x02a8('0x1f')])[_0x02a8('0x1b')](FORMAT));var _0x853437=[];for(var _0x585045=0x0;_0x585045<_0x25dc6c[_0x02a8('0x14')];_0x585045++){var _0x4aa1f7=[];if(_0x585045===0x0){_0x4aa1f7[_0x02a8('0x16')]({'text':_0x48edad,'style':_0x02a8('0x20')});}var _0x29affe={'table':_0x25dc6c[_0x585045]};if(_0x585045>0x0){_0x29affe[_0x02a8('0x21')]=_0x02a8('0x22');_0x29affe[_0x02a8('0x23')]=[0x0,0x46,0x0,0x0];}_0x4aa1f7['push'](_0x29affe);_0x853437[_0x02a8('0x16')](_0x4aa1f7);}return{'pageSize':'A4','pageOrientation':_0x02a8('0x24'),'content':_0x853437,'footer':function(_0x4f80c0,_0x5d1087){return{'text':_0x4f80c0[_0x02a8('0x12')]()+_0x02a8('0x25')+_0x5d1087,'style':'footer'};},'defaultStyle':{'font':_0x02a8('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x02a8('0x27')},'footer':{'alignment':_0x02a8('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x59b3ca){var _0x56a98e=0x1388;var _0x11c58e;if(!_0x59b3ca[0x0][_0x02a8('0x29')]){return analyticExtractedReport(_0x02a8('0x2a'));}return db['Setting'][_0x02a8('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x02a8('0x2c')]})[_0x02a8('0x2d')](function(_0x29f5a9){if(_0x29f5a9){_0x11c58e=_0x29f5a9;_0x56a98e=_0x11c58e[_0x02a8('0x2c')]||0x3e8;}})['then'](function(){var _0xa36fb7=[];var _0x54b924=0x0;if(_0x11c58e['split']){if(_0x59b3ca&&_0x59b3ca[_0x02a8('0x14')]){var _0x4c85c3=_[_0x02a8('0x2e')](_0x59b3ca[0x0]['num']/_0x56a98e);var _0x5db1de=Number['isInteger'](_0x59b3ca[0x0]['num']/_0x56a98e)?_0x59b3ca[0x0][_0x02a8('0x29')]%_0x56a98e:0x0;_0x4c85c3['forEach'](function(_0x51c409){if(_0x51c409>0x0){_0x54b924+=_0x56a98e;}_0xa36fb7[_0x02a8('0x16')](dbH[_0x02a8('0x2f')][_0x02a8('0x30')](util[_0x02a8('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x56a98e,_0x54b924),{'type':dbH['sequelize'][_0x02a8('0x31')][_0x02a8('0x32')]}));});if(_0x5db1de>0x0){_0x54b924+=_0x56a98e;_0xa36fb7['push'](dbH[_0x02a8('0x2f')][_0x02a8('0x30')](util[_0x02a8('0x1b')](_0x02a8('0x33'),QUERY,_0x5db1de,_0x54b924),{'type':dbH['sequelize']['QueryTypes'][_0x02a8('0x32')]}));}}}else{_0xa36fb7[_0x02a8('0x16')](dbH['sequelize'][_0x02a8('0x30')](QUERY,{'type':dbH[_0x02a8('0x2f')][_0x02a8('0x31')]['SELECT']}));}var _0x4b9bbd=path[_0x02a8('0x34')](PATH);var _0x3efc3f=path[_0x02a8('0x35')](PATH,_0x02a8('0x36'));var _0x454585=_0x11c58e[_0x02a8('0x37')]&&_0xa36fb7[_0x02a8('0x14')]>0x1;var _0x2e273a=[];if(!fs[_0x02a8('0x38')](path[_0x02a8('0x39')](_0x4b9bbd,_0x3efc3f))&&_0x454585){fs[_0x02a8('0x3a')](path[_0x02a8('0x39')](_0x4b9bbd,_0x3efc3f));}return BPromise[_0x02a8('0x3b')](_0xa36fb7,function(_0x3f9f45){_0x2e273a['push'](_0x3f9f45);})[_0x02a8('0x2d')](function(){var _0x4648c2=[];for(var _0xc71697=0x0;_0xc71697<_0x2e273a[_0x02a8('0x14')];_0xc71697+=0x1){var _0x2499ce=_0x2e273a[_0xc71697];var _0x5546a2=createTables(_['flatten'](_0x2499ce));var _0x152c51;var _0x34d967=getPDFDocDefinition(_0x5546a2);var _0x5b6ab4=getPDFPrinter();var _0x2efe1c=_0x5b6ab4['createPdfKitDocument'](_0x34d967);if(_0x454585){_0x152c51=path['join'](_0x4b9bbd,_0x3efc3f,util[_0x02a8('0x1b')](_0x02a8('0x3c'),_0x3efc3f,_0xc71697,'pdf'));}else{_0x152c51=path['join'](_0x4b9bbd,util['format']('%s.%s',_0x3efc3f,_0x02a8('0x3d')));}_0x4648c2[_0x02a8('0x16')](writePDFDocument(_0x2efe1c,_0x152c51));}return Promise[_0x02a8('0x3e')](_0x4648c2);})['then'](function(){if(_0x454585){return new Promise(function(_0x5c88a0){zipdir(path[_0x02a8('0x39')](_0x4b9bbd,_0x3efc3f),{'saveTo':path[_0x02a8('0x39')](_0x4b9bbd,util[_0x02a8('0x1b')]('%s.%s',_0x3efc3f,'zip'))},function(){rimraf(path['join'](_0x4b9bbd,_0x3efc3f),function(){});_0x5c88a0(_0x02a8('0x3f'));});});}})[_0x02a8('0x2d')](function(){if(!_0x454585)return;rimraf(path[_0x02a8('0x39')](_0x4b9bbd,_0x3efc3f),function(){});})[_0x02a8('0x2d')](function(){logger[_0x02a8('0x40')](util[_0x02a8('0x1b')](_0x02a8('0x41'),EXTRACTED_REPORT_ID,_0x02a8('0x42')));return analyticExtractedReport(_0x02a8('0x43'),_0x454585?util[_0x02a8('0x1b')](_0x02a8('0x44'),_0x3efc3f,_0x454585?_0x02a8('0x45'):_0x02a8('0x3d')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x02a8('0x40')](util[_0x02a8('0x1b')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x02a8('0x42')));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x02a8('0x2d')](function(_0x9a30da){EXTRACTED_REPORT=_0x9a30da;return dbH['sequelize'][_0x02a8('0x30')](util[_0x02a8('0x1b')](_0x02a8('0x46'),QUERY),{'type':dbH[_0x02a8('0x2f')]['QueryTypes'][_0x02a8('0x32')]});})[_0x02a8('0x2d')](extractReport)['catch'](function(_0x58cae7){logger[_0x02a8('0x40')](util['format'](_0x02a8('0x47'),EXTRACTED_REPORT_ID,_0x02a8('0x42')),util[_0x02a8('0x48')](_0x58cae7,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x02a8('0x49'));})[_0x02a8('0x4a')](function(){process[_0x02a8('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3bf90d=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x02a8('0x4c'),'italics':__dirname+_0x02a8('0x4d'),'bolditalics':__dirname+_0x02a8('0x4e')}});return _0x3bf90d;}function getPDFDocDefinitionFromHTML(_0x351625,_0xa55832){var _0x569258=util['format'](_0x02a8('0x4f'),_0xa55832[_0x02a8('0x50')],_0xa55832[_0x02a8('0x51')]);var _0x24f797=moment()[_0x02a8('0x1b')]('YYYY-MM-DD')[_0x02a8('0x12')]();var _0x452ee1=htmlToPdfmake(_0x351625,{'window':window,'tableAutoSize':!![]});return{'content':[_0x452ee1],'defaultStyle':{'font':_0x02a8('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x02a8('0x52'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x02a8('0x53'),'style':_0x02a8('0x20')}];},'footer':function(_0x4a1c83,_0x48616e){return[{'text':util[_0x02a8('0x1b')](_0x02a8('0x54'),_0x569258,_0x4a1c83,_0x48616e,_0x24f797),'style':_0x02a8('0x55')}];}};}function writePDFDocument(_0x1aa49a,_0x2971a2){return new Promise(function(_0x3d8a76,_0x5fe2f8){var _0xe1a118=_0x1aa49a[_0x02a8('0x56')](fs[_0x02a8('0x57')](_0x2971a2));_0xe1a118['on'](_0x02a8('0x58'),function(){_0x3d8a76(_0x02a8('0x58'));});_0xe1a118['on'](_0x02a8('0x59'),function(_0x4f70a9){_0x5fe2f8(_0x4f70a9);});_0x1aa49a[_0x02a8('0x5a')]();});}exports[_0x02a8('0x5b')]=function(_0x4a5f9c,_0x35327a){var _0x5c1409=getPDFPrinter();var _0x58d53f=getPDFDocDefinitionFromHTML(_0x4a5f9c,_0x35327a);var _0x429f77=_0x5c1409[_0x02a8('0x5c')](_0x58d53f);return writePDFDocument(_0x429f77,_0x35327a[_0x02a8('0x1')])[_0x02a8('0x5d')](function(_0x451d6a){throw _0x451d6a;});};
\ No newline at end of file
+var _0x5561=['all','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','error','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','tableHeader','map','pick','toString','value','fill','auto','body','push','concat','chunk','keys','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','format','endDate','length','header','pageBreak','before','landscape','\x20/\x20','footer','right','num','Empty','find','split','splitSizePdf','then','range','isInteger','forEach','query','%s\x20limit\x20%d\x20OFFSET\x20%d','sequelize','QueryTypes','SELECT','dirname','.pdf','existsSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x5561,0x6f));var _0x1556=function(_0x13583b,_0x59f026){_0x13583b=_0x13583b-0x0;var _0x5a3cda=_0x5561[_0x13583b];return _0x5a3cda;};'use strict';var _=require(_0x1556('0x0'));var fs=require('fs');var util=require(_0x1556('0x1'));var path=require(_0x1556('0x2'));var moment=require(_0x1556('0x3'));var htmlToPdfmake=require(_0x1556('0x4'));var PdfPrinter=require(_0x1556('0x5'));var zipdir=require(_0x1556('0x6'));var rimraf=require('rimraf');var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')[_0x1556('0x7')];var BPromise=require(_0x1556('0x8'));var db=require('../../mysqldb')['db'];var dbH=require(_0x1556('0x9'))[_0x1556('0xa')];var logger=require(_0x1556('0xb'))(_0x1556('0xc'));var EXTRACTED_REPORT_ID=Number(process[_0x1556('0xd')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x1556('0xd')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x1556('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x297a03,_0x13da09){var _0x37cfe9={'status':_0x297a03};var _0x435e27={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x13da09){_0x37cfe9[_0x1556('0xf')]=_0x13da09;}return db[_0x1556('0x10')]['update'](_0x37cfe9,_0x435e27);}function getHeaders(_0x12d314){return _['map'](_0x12d314,function(_0x2ca14){return{'text':_0x2ca14,'style':_0x1556('0x11')};});}function getRows(_0x4ddd42,_0x55348f){return _[_0x1556('0x12')](_0x55348f,function(_0x3fc479){return _(_0x3fc479)[_0x1556('0x13')](_0x4ddd42)[_0x1556('0x12')](function(_0x517e6a){return _0x517e6a?_[_0x1556('0x14')](_0x517e6a):'';})[_0x1556('0x15')]();});}function createTable(_0x1dbc87,_0x442dfc){var _0x37cd7a={'widths':_[_0x1556('0x16')](Array(_0x1dbc87['length']),0x91),'heights':function(_0x52a37e){return _0x52a37e===0x0?_0x1556('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x47bc35=getHeaders(_0x1dbc87);_0x37cd7a[_0x1556('0x18')][_0x1556('0x19')](_0x47bc35);var _0x19ba53=getRows(_0x1dbc87,_0x442dfc);_0x37cd7a[_0x1556('0x18')]=_0x37cd7a['body'][_0x1556('0x1a')](_0x19ba53);return _0x37cd7a;}function createTables(_0xa2a920){var _0xe12635=[];var _0x2d9a1a=_[_0x1556('0x1b')](Object[_0x1556('0x1c')](_0xa2a920[0x0]),0x5);_0x2d9a1a['forEach'](function(_0x1076f3){_0xe12635[_0x1556('0x19')](createTable(_0x1076f3,_0xa2a920));});return _0xe12635;}function getPDFDocDefinition(_0x591247){var _0x399122=util['format'](_0x1556('0x1d'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x1556('0x1e')])[_0x1556('0x1f')](FORMAT),moment(EXTRACTED_REPORT[_0x1556('0x20')])[_0x1556('0x1f')](FORMAT));var _0x1c73ce=[];for(var _0x1159e4=0x0;_0x1159e4<_0x591247[_0x1556('0x21')];_0x1159e4++){var _0x5d35f2=[];if(_0x1159e4===0x0){_0x5d35f2[_0x1556('0x19')]({'text':_0x399122,'style':_0x1556('0x22')});}var _0x22284c={'table':_0x591247[_0x1159e4]};if(_0x1159e4>0x0){_0x22284c[_0x1556('0x23')]=_0x1556('0x24');_0x22284c['margin']=[0x0,0x46,0x0,0x0];}_0x5d35f2[_0x1556('0x19')](_0x22284c);_0x1c73ce[_0x1556('0x19')](_0x5d35f2);}return{'pageSize':'A4','pageOrientation':_0x1556('0x25'),'content':_0x1c73ce,'footer':function(_0x4a886e,_0x3cd2ea){return{'text':_0x4a886e[_0x1556('0x14')]()+_0x1556('0x26')+_0x3cd2ea,'style':_0x1556('0x27')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x1556('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x6d86e1){var _0x20bc58=0x1388;var _0x25de8b;if(!_0x6d86e1[0x0][_0x1556('0x29')]){return analyticExtractedReport(_0x1556('0x2a'));}return db['Setting'][_0x1556('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1556('0x2c'),_0x1556('0x2d')]})[_0x1556('0x2e')](function(_0x3747b1){if(_0x3747b1){_0x25de8b=_0x3747b1;_0x20bc58=_0x25de8b['splitSizePdf']||0x3e8;}})[_0x1556('0x2e')](function(){var _0x59270d=[];var _0x2e07b1=0x0;if(_0x25de8b[_0x1556('0x2c')]){if(_0x6d86e1&&_0x6d86e1['length']){var _0x41e2db=_[_0x1556('0x2f')](_0x6d86e1[0x0][_0x1556('0x29')]/_0x20bc58);var _0x35517d=Number[_0x1556('0x30')](_0x6d86e1[0x0][_0x1556('0x29')]/_0x20bc58)?_0x6d86e1[0x0][_0x1556('0x29')]%_0x20bc58:0x0;_0x41e2db[_0x1556('0x31')](function(_0xd23fe0){if(_0xd23fe0>0x0){_0x2e07b1+=_0x20bc58;}_0x59270d[_0x1556('0x19')](dbH['sequelize'][_0x1556('0x32')](util[_0x1556('0x1f')](_0x1556('0x33'),QUERY,_0x20bc58,_0x2e07b1),{'type':dbH[_0x1556('0x34')][_0x1556('0x35')][_0x1556('0x36')]}));});if(_0x35517d>0x0){_0x2e07b1+=_0x20bc58;_0x59270d[_0x1556('0x19')](dbH[_0x1556('0x34')][_0x1556('0x32')](util[_0x1556('0x1f')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x35517d,_0x2e07b1),{'type':dbH[_0x1556('0x34')][_0x1556('0x35')][_0x1556('0x36')]}));}}}else{_0x59270d[_0x1556('0x19')](dbH[_0x1556('0x34')][_0x1556('0x32')](QUERY,{'type':dbH[_0x1556('0x34')][_0x1556('0x35')]['SELECT']}));}var _0x4bedd7=path[_0x1556('0x37')](PATH);var _0x163f51=path['basename'](PATH,_0x1556('0x38'));var _0x128594=_0x25de8b[_0x1556('0x2c')]&&_0x59270d[_0x1556('0x21')]>0x1;var _0xa45a34=[];if(!fs[_0x1556('0x39')](path[_0x1556('0x3a')](_0x4bedd7,_0x163f51))&&_0x128594){fs['mkdirSync'](path['join'](_0x4bedd7,_0x163f51));}return BPromise[_0x1556('0x3b')](_0x59270d,function(_0x5e055c){_0xa45a34[_0x1556('0x19')](_0x5e055c);})[_0x1556('0x2e')](function(){var _0x3899c5=[];for(var _0x371deb=0x0;_0x371deb<_0xa45a34[_0x1556('0x21')];_0x371deb+=0x1){var _0x5b6694=_0xa45a34[_0x371deb];var _0x3ddab9=createTables(_[_0x1556('0x3c')](_0x5b6694));var _0x152554;var _0x32121c=getPDFDocDefinition(_0x3ddab9);var _0x1e6242=getPDFPrinter();var _0x5af0f0=_0x1e6242[_0x1556('0x3d')](_0x32121c);if(_0x128594){_0x152554=path[_0x1556('0x3a')](_0x4bedd7,_0x163f51,util[_0x1556('0x1f')](_0x1556('0x3e'),_0x163f51,_0x371deb,_0x1556('0x3f')));}else{_0x152554=path[_0x1556('0x3a')](_0x4bedd7,util[_0x1556('0x1f')](_0x1556('0x40'),_0x163f51,_0x1556('0x3f')));}_0x3899c5[_0x1556('0x19')](writePDFDocument(_0x5af0f0,_0x152554));}return Promise[_0x1556('0x41')](_0x3899c5);})[_0x1556('0x2e')](function(){if(_0x128594){return new Promise(function(_0x3e8c90){zipdir(path['join'](_0x4bedd7,_0x163f51),{'saveTo':path[_0x1556('0x3a')](_0x4bedd7,util[_0x1556('0x1f')](_0x1556('0x40'),_0x163f51,_0x1556('0x42')))},function(){rimraf(path['join'](_0x4bedd7,_0x163f51),function(){});_0x3e8c90('zip\x20finished');});});}})['then'](function(){if(!_0x128594)return;rimraf(path[_0x1556('0x3a')](_0x4bedd7,_0x163f51),function(){});})[_0x1556('0x2e')](function(){logger[_0x1556('0x43')](util[_0x1556('0x1f')](_0x1556('0x44'),EXTRACTED_REPORT_ID,_0x1556('0x45')));return analyticExtractedReport(_0x1556('0x46'),_0x128594?util['format'](_0x1556('0x40'),_0x163f51,_0x128594?_0x1556('0x42'):_0x1556('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x1556('0x45')));return db[_0x1556('0x10')][_0x1556('0x47')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x1556('0x2e')](function(_0x48e543){EXTRACTED_REPORT=_0x48e543;return dbH[_0x1556('0x34')]['query'](util[_0x1556('0x1f')](_0x1556('0x48'),QUERY),{'type':dbH[_0x1556('0x34')][_0x1556('0x35')][_0x1556('0x36')]});})[_0x1556('0x2e')](extractReport)[_0x1556('0x49')](function(_0x280b58){logger[_0x1556('0x43')](util[_0x1556('0x1f')](_0x1556('0x4a'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x280b58,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1556('0x4b'));})[_0x1556('0x4c')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0xdc17ab=new PdfPrinter({'Arial':{'normal':__dirname+_0x1556('0x4d'),'bold':__dirname+_0x1556('0x4e'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x1556('0x4f')}});return _0xdc17ab;}function getPDFDocDefinitionFromHTML(_0x2eef18,_0x511b49){var _0x1e4ea8=util[_0x1556('0x1f')](_0x1556('0x50'),_0x511b49[_0x1556('0x51')],_0x511b49['interactionId']);var _0x36ee52=moment()[_0x1556('0x1f')]('YYYY-MM-DD')[_0x1556('0x14')]();var _0x5434b5=htmlToPdfmake(_0x2eef18,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5434b5],'defaultStyle':{'font':_0x1556('0x52')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x1556('0x53'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x1556('0x53'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x1556('0x54'),'style':_0x1556('0x22')}];},'footer':function(_0x1c671a,_0x37434c){return[{'text':util[_0x1556('0x1f')](_0x1556('0x55'),_0x1e4ea8,_0x1c671a,_0x37434c,_0x36ee52),'style':'footer'}];}};}function writePDFDocument(_0x259640,_0x5bedc4){return new Promise(function(_0x1a2e80,_0x3477d8){var _0x29b84c=_0x259640[_0x1556('0x56')](fs['createWriteStream'](_0x5bedc4));_0x29b84c['on']('finish',function(){_0x1a2e80('finish');});_0x29b84c['on'](_0x1556('0x57'),function(_0x55f898){_0x3477d8(_0x55f898);});_0x259640['end']();});}exports['createPdfFromHTML']=function(_0x3c6024,_0x4b86ca){var _0x3ea028=getPDFPrinter();var _0x34d3aa=getPDFDocDefinitionFromHTML(_0x3c6024,_0x4b86ca);var _0x5adb8a=_0x3ea028[_0x1556('0x3d')](_0x34d3aa);return writePDFDocument(_0x5adb8a,_0x4b86ca[_0x1556('0x2')])[_0x1556('0x49')](function(_0x42af19){throw _0x42af19;});};
\ No newline at end of file
index 6367396..742a760 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01d3=['existsSync','join','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','path','lodash','json2xls','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','split','length','range','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','.xlsx'];(function(_0x178afc,_0x2aeb30){var _0x57614f=function(_0x701a67){while(--_0x701a67){_0x178afc['push'](_0x178afc['shift']());}};_0x57614f(++_0x2aeb30);}(_0x01d3,0xa2));var _0x301d=function(_0x4a890a,_0x27a853){_0x4a890a=_0x4a890a-0x0;var _0x1860ba=_0x01d3[_0x4a890a];return _0x1860ba;};'use strict';var util=require(_0x301d('0x0'));var path=require(_0x301d('0x1'));var _=require(_0x301d('0x2'));var fs=require('fs');var json2xls=require(_0x301d('0x3'));var BPromise=require('bluebird');var zipdir=require(_0x301d('0x4'));var rimraf=require(_0x301d('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x301d('0x6'))[_0x301d('0x7')];var logger=require(_0x301d('0x8'))(_0x301d('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x301d('0xa')][0x3];var PATH=process[_0x301d('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xe2b2d8,_0x3bbbde){var _0x35e760={'status':_0xe2b2d8};var _0x3ba019={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3bbbde){_0x35e760[_0x301d('0xb')]=_0x3bbbde;}return db[_0x301d('0xc')][_0x301d('0xd')](_0x35e760,_0x3ba019);}function main(){var _0x18b853=0x1388;var _0x4c2760;logger[_0x301d('0xe')](util[_0x301d('0xf')](_0x301d('0x10'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x301d('0x11')][_0x301d('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})['then'](function(_0x36a891){if(_0x36a891){_0x4c2760=_0x36a891;_0x18b853=_0x4c2760[_0x301d('0x13')]||0x1388;}})[_0x301d('0x14')](function(){return dbH[_0x301d('0x15')][_0x301d('0x16')](util[_0x301d('0xf')](_0x301d('0x17'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0x301d('0x18')]});})[_0x301d('0x14')](function(_0x4777e9){if(!_0x4777e9[0x0]['num']){return analyticExtractedReport('Empty');}var _0x4f0f10=[];var _0x5a1583=0x0;if(_0x4c2760[_0x301d('0x19')]){if(_0x4777e9&&_0x4777e9[_0x301d('0x1a')]){var _0x395ff3=_[_0x301d('0x1b')](_0x4777e9[0x0][_0x301d('0x1c')]/_0x18b853);var _0x39e505=Number['isInteger'](_0x4777e9[0x0][_0x301d('0x1c')]/_0x18b853)?_0x4777e9[0x0]['num']%_0x18b853:0x0;_0x395ff3['forEach'](function(_0x1a4358){if(_0x1a4358>0x0){_0x5a1583+=_0x18b853;}_0x4f0f10[_0x301d('0x1d')](dbH['sequelize'][_0x301d('0x16')](util['format'](_0x301d('0x1e'),QUERY,_0x18b853,_0x5a1583),{'type':dbH[_0x301d('0x15')][_0x301d('0x1f')]['SELECT']}));});if(_0x39e505>0x0){_0x5a1583+=_0x18b853;_0x4f0f10[_0x301d('0x1d')](dbH['sequelize'][_0x301d('0x16')](util[_0x301d('0xf')](_0x301d('0x1e'),QUERY,_0x39e505,_0x5a1583),{'type':dbH['sequelize'][_0x301d('0x1f')][_0x301d('0x18')]}));}}}else{_0x4f0f10[_0x301d('0x1d')](dbH[_0x301d('0x15')][_0x301d('0x16')](QUERY,{'type':dbH[_0x301d('0x15')][_0x301d('0x1f')]['SELECT']}));}var _0x2f3b71=path[_0x301d('0x20')](PATH);var _0x45e7e3=path['basename'](PATH,_0x301d('0x21'));var _0x3d9dc6=_0x4c2760['split']&&_0x4f0f10[_0x301d('0x1a')]>0x1;var _0x58d54b=[];if(!fs[_0x301d('0x22')](path[_0x301d('0x23')](_0x2f3b71,_0x45e7e3))&&_0x3d9dc6){fs['mkdirSync'](path[_0x301d('0x23')](_0x2f3b71,_0x45e7e3));}return BPromise['each'](_0x4f0f10,function(_0x561ffc){_0x58d54b[_0x301d('0x1d')](_0x561ffc);})[_0x301d('0x14')](function(){for(var _0x2a6652=0x0;_0x2a6652<_0x58d54b['length'];_0x2a6652+=0x1){var _0x361940;var _0x532d59=_0x58d54b[_0x2a6652];if(_0x3d9dc6){_0x361940=path['join'](_0x2f3b71,_0x45e7e3,util['format'](_0x301d('0x24'),_0x45e7e3,_0x2a6652,'xlsx'));}else{_0x361940=path[_0x301d('0x23')](_0x2f3b71,util[_0x301d('0xf')](_0x301d('0x25'),_0x45e7e3,_0x301d('0x26')));}fs[_0x301d('0x27')](_0x361940,json2xls(_0x532d59),_0x301d('0x28'));}})[_0x301d('0x14')](function(){if(_0x3d9dc6){return new Promise(function(_0x1b1d83){zipdir(path['join'](_0x2f3b71,_0x45e7e3),{'saveTo':path[_0x301d('0x23')](_0x2f3b71,util['format'](_0x301d('0x25'),_0x45e7e3,_0x301d('0x29')))},function(_0x586f7d,_0x47c6a3){rimraf(path[_0x301d('0x23')](_0x2f3b71,_0x45e7e3),function(){});_0x1b1d83('zip\x20finished');});});}})[_0x301d('0x14')](function(){logger[_0x301d('0xe')](util[_0x301d('0xf')](_0x301d('0x2a'),EXTRACTED_REPORT_ID,_0x301d('0x2b')));return analyticExtractedReport(_0x301d('0x2c'),_0x3d9dc6?util[_0x301d('0xf')](_0x301d('0x25'),_0x45e7e3,_0x3d9dc6?_0x301d('0x29'):_0x301d('0x26')):null);});})['catch'](function(_0x5f0ca9){logger['info'](util[_0x301d('0xf')](_0x301d('0x2d'),EXTRACTED_REPORT_ID,_0x301d('0x2b')),util['inspect'](_0x5f0ca9,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x301d('0x2e'));})[_0x301d('0x2f')](function(){process[_0x301d('0x30')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x0796=['forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','query','dirname','join','mkdirSync','%s%d.%s','xlsx','binary','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x0796,0x12d));var _0x6079=function(_0x2dbc8e,_0x11bf02){_0x2dbc8e=_0x2dbc8e-0x0;var _0x486053=_0x0796[_0x2dbc8e];return _0x486053;};'use strict';var util=require(_0x6079('0x0'));var path=require(_0x6079('0x1'));var _=require(_0x6079('0x2'));var fs=require('fs');var json2xls=require(_0x6079('0x3'));var BPromise=require(_0x6079('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x6079('0x5'));var db=require(_0x6079('0x6'))['db'];var dbH=require(_0x6079('0x6'))[_0x6079('0x7')];var logger=require(_0x6079('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x559ac5,_0x3e30e6){var _0x38a209={'status':_0x559ac5};var _0x1993fe={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3e30e6){_0x38a209[_0x6079('0x9')]=_0x3e30e6;}return db['AnalyticExtractedReport'][_0x6079('0xa')](_0x38a209,_0x1993fe);}function main(){var _0x257ab9=0x1388;var _0x482991;logger[_0x6079('0xb')](util[_0x6079('0xc')](_0x6079('0xd'),EXTRACTED_REPORT_ID,_0x6079('0xe')));return db[_0x6079('0xf')][_0x6079('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x6079('0x11')]})[_0x6079('0x12')](function(_0xdb22da){if(_0xdb22da){_0x482991=_0xdb22da;_0x257ab9=_0x482991[_0x6079('0x11')]||0x1388;}})[_0x6079('0x12')](function(){return dbH[_0x6079('0x13')]['query'](util[_0x6079('0xc')](_0x6079('0x14'),QUERY),{'type':dbH[_0x6079('0x13')][_0x6079('0x15')][_0x6079('0x16')]});})[_0x6079('0x12')](function(_0x4dd8e1){if(!_0x4dd8e1[0x0][_0x6079('0x17')]){return analyticExtractedReport(_0x6079('0x18'));}var _0x1a2849=[];var _0x80c234=0x0;if(_0x482991['split']){if(_0x4dd8e1&&_0x4dd8e1[_0x6079('0x19')]){var _0x2027c7=_[_0x6079('0x1a')](_0x4dd8e1[0x0][_0x6079('0x17')]/_0x257ab9);var _0x3c1392=Number[_0x6079('0x1b')](_0x4dd8e1[0x0]['num']/_0x257ab9)?_0x4dd8e1[0x0]['num']%_0x257ab9:0x0;_0x2027c7[_0x6079('0x1c')](function(_0x21c5a1){if(_0x21c5a1>0x0){_0x80c234+=_0x257ab9;}_0x1a2849[_0x6079('0x1d')](dbH[_0x6079('0x13')]['query'](util[_0x6079('0xc')](_0x6079('0x1e'),QUERY,_0x257ab9,_0x80c234),{'type':dbH[_0x6079('0x13')]['QueryTypes'][_0x6079('0x16')]}));});if(_0x3c1392>0x0){_0x80c234+=_0x257ab9;_0x1a2849[_0x6079('0x1d')](dbH[_0x6079('0x13')]['query'](util[_0x6079('0xc')](_0x6079('0x1e'),QUERY,_0x3c1392,_0x80c234),{'type':dbH['sequelize'][_0x6079('0x15')][_0x6079('0x16')]}));}}}else{_0x1a2849[_0x6079('0x1d')](dbH[_0x6079('0x13')][_0x6079('0x1f')](QUERY,{'type':dbH[_0x6079('0x13')][_0x6079('0x15')]['SELECT']}));}var _0x163e1b=path[_0x6079('0x20')](PATH);var _0x5a298d=path['basename'](PATH,'.xlsx');var _0x44d0fb=_0x482991['split']&&_0x1a2849[_0x6079('0x19')]>0x1;var _0x184403=[];if(!fs['existsSync'](path[_0x6079('0x21')](_0x163e1b,_0x5a298d))&&_0x44d0fb){fs[_0x6079('0x22')](path[_0x6079('0x21')](_0x163e1b,_0x5a298d));}return BPromise['each'](_0x1a2849,function(_0x2c63c1){_0x184403[_0x6079('0x1d')](_0x2c63c1);})['then'](function(){for(var _0x8c411a=0x0;_0x8c411a<_0x184403[_0x6079('0x19')];_0x8c411a+=0x1){var _0x149bab;var _0x22416c=_0x184403[_0x8c411a];if(_0x44d0fb){_0x149bab=path['join'](_0x163e1b,_0x5a298d,util['format'](_0x6079('0x23'),_0x5a298d,_0x8c411a,_0x6079('0x24')));}else{_0x149bab=path[_0x6079('0x21')](_0x163e1b,util[_0x6079('0xc')]('%s.%s',_0x5a298d,_0x6079('0x24')));}fs['writeFileSync'](_0x149bab,json2xls(_0x22416c),_0x6079('0x25'));}})[_0x6079('0x12')](function(){if(_0x44d0fb){return new Promise(function(_0x1a30ac){zipdir(path[_0x6079('0x21')](_0x163e1b,_0x5a298d),{'saveTo':path[_0x6079('0x21')](_0x163e1b,util[_0x6079('0xc')](_0x6079('0x26'),_0x5a298d,_0x6079('0x27')))},function(_0x508881,_0x5c6cdf){rimraf(path['join'](_0x163e1b,_0x5a298d),function(){});_0x1a30ac(_0x6079('0x28'));});});}})[_0x6079('0x12')](function(){logger['info'](util[_0x6079('0xc')](_0x6079('0x29'),EXTRACTED_REPORT_ID,_0x6079('0xe')));return analyticExtractedReport(_0x6079('0x2a'),_0x44d0fb?util[_0x6079('0xc')](_0x6079('0x26'),_0x5a298d,_0x44d0fb?'zip':_0x6079('0x24')):null);});})[_0x6079('0x2b')](function(_0x1d645d){logger[_0x6079('0xb')](util[_0x6079('0xc')](_0x6079('0x2c'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x6079('0x2d')](_0x1d645d,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6079('0x2e'));})['finally'](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
index 11dc6c2..040a6ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06fe=['extensions','extension','push','Set','format','VoiceExtensionId','type','inbound','CDR(routeid)=','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','context','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','createdAt','updatedAt','*,*,*,*','interval','tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','error','rewrite','lodash','util','Interval','findAll','intervals','models','IntervalId','then','VoiceExtension','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','exten','queue','playback','hasOwnProperty','priority'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x06fe,0x1e6));var _0xe06f=function(_0x46ef1d,_0x24926){_0x46ef1d=_0x46ef1d-0x0;var _0x49ce69=_0x06fe[_0x46ef1d];return _0x49ce69;};'use strict';var _=require(_0xe06f('0x0'));var util=require(_0xe06f('0x1'));function rewrite(_0x1e8d88,_0xfb2ac1){var _0x4d0b04=this;return _0x1e8d88['models'][_0xe06f('0x2')][_0xe06f('0x3')]({'raw':!![]})['then'](function(_0xf56412){_0x4d0b04[_0xe06f('0x4')]=_0xf56412;return _0x1e8d88[_0xe06f('0x5')]['VoiceExtension'][_0xe06f('0x3')]({'where':{'IntervalId':_0xfb2ac1[_0xe06f('0x6')]},'raw':!![]});})[_0xe06f('0x7')](function(_0x4cb131){return _0x1e8d88[_0xe06f('0x5')][_0xe06f('0x8')]['findAll']({'where':{'exten':{'$in':_[_0xe06f('0x9')](_[_0xe06f('0xa')](_0x4cb131,'exten'))}},'order':[{'raw':_0xe06f('0xb')}],'raw':!![]});})[_0xe06f('0x7')](function(_0x544104){var _0x22adc7=_[_0xe06f('0xc')](_0x544104,{'priority':'1'});var _0x509eba=_[_0xe06f('0xc')](_0x544104,{'isApp':0x1});var _0x5859c7=_['groupBy'](_0x509eba,_0xe06f('0xd'));var _0x43b642=[_0xe06f('0xe'),_0xe06f('0xf')];var _0x2ac6f3=[];var _0x5558e0=[];for(var _0x286624 in _0x5859c7){if(_0x5859c7[_0xe06f('0x10')](_0x286624)){_0x4d0b04[_0xe06f('0x11')]=0x2;_0x4d0b04[_0xe06f('0x12')]=[];_0x4d0b04[_0xe06f('0x13')]=_['find'](_0x22adc7,{'exten':_0x5859c7[_0x286624][0x0][_0xe06f('0xd')]});_0x4d0b04[_0xe06f('0x12')][_0xe06f('0x14')]({'type':_0x5859c7[_0x286624][0x0]['type'],'app':_0xe06f('0x15'),'appdata':util[_0xe06f('0x16')]('CDR(type)=%s',_0x5859c7[_0x286624][0x0]['type']),'context':_0x5859c7[_0x286624][0x0]['context'],'exten':_0x5859c7[_0x286624][0x0][_0xe06f('0xd')],'priority':_0x4d0b04['priority']++,'VoiceExtensionId':_0x5859c7[_0x286624][0x0][_0xe06f('0x17')]});if(_0x5859c7[_0x286624][0x0][_0xe06f('0x18')]===_0xe06f('0x19')){_0x4d0b04[_0xe06f('0x12')][_0xe06f('0x14')]({'type':_0x5859c7[_0x286624][0x0][_0xe06f('0x18')],'app':_0xe06f('0x15'),'appdata':_0xe06f('0x1a')+_0x5859c7[_0x286624][0x0]['VoiceExtensionId'],'context':_0x5859c7[_0x286624][0x0]['context'],'exten':_0x5859c7[_0x286624][0x0][_0xe06f('0xd')],'priority':_0x4d0b04['priority']++,'VoiceExtensionId':_0x5859c7[_0x286624][0x0][_0xe06f('0x17')]});}else if(_0x5859c7[_0x286624][0x0][_0xe06f('0x18')]===_0xe06f('0x1b')){if(_0x4d0b04['extension']){_0x4d0b04[_0xe06f('0x12')]['push']({'type':_0x5859c7[_0x286624][0x0][_0xe06f('0x18')],'app':'Set','appdata':_0xe06f('0x1c')+(_0x4d0b04[_0xe06f('0x13')][_0xe06f('0x1d')]?_0xe06f('0x1e')+_0x4d0b04[_0xe06f('0x13')][_0xe06f('0x1d')]+'}':_0xe06f('0x1f')),'context':_0x5859c7[_0x286624][0x0][_0xe06f('0x20')],'exten':_0x5859c7[_0x286624][0x0][_0xe06f('0xd')],'priority':_0x4d0b04[_0xe06f('0x11')]++,'VoiceExtensionId':_0x5859c7[_0x286624][0x0][_0xe06f('0x17')]});}_0x4d0b04['extensions']['push']({'type':_0x5859c7[_0x286624][0x0][_0xe06f('0x18')],'app':_0xe06f('0x15'),'appdata':_0xe06f('0x1a')+_0x5859c7[_0x286624][0x0][_0xe06f('0x17')],'context':_0x5859c7[_0x286624][0x0][_0xe06f('0x20')],'exten':_0x5859c7[_0x286624][0x0]['exten'],'priority':_0x4d0b04['priority']++,'VoiceExtensionId':_0x5859c7[_0x286624][0x0]['VoiceExtensionId']});var _0x35a5aa=_0x4d0b04[_0xe06f('0x11')]++;_0x4d0b04[_0xe06f('0x12')][_0xe06f('0x14')]({'type':_0x5859c7[_0x286624][0x0]['type'],'app':_0xe06f('0x21'),'appdata':_0xe06f('0x22')+(_0x35a5aa+0x2)+_0xe06f('0x23')+(_0x35a5aa+0x1)+')','context':_0x5859c7[_0x286624][0x0][_0xe06f('0x20')],'exten':_0x5859c7[_0x286624][0x0][_0xe06f('0xd')],'priority':_0x35a5aa,'VoiceExtensionId':_0x5859c7[_0x286624][0x0]['VoiceExtensionId']});if(_0x4d0b04[_0xe06f('0x13')]){_0x4d0b04['extensions'][_0xe06f('0x14')]({'type':_0x5859c7[_0x286624][0x0][_0xe06f('0x18')],'app':'Set','appdata':_0x4d0b04[_0xe06f('0x13')]['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x4d0b04[_0xe06f('0x13')][_0xe06f('0x1d')]+'}':'CDR(prefix)=noprefix','context':_0x5859c7[_0x286624][0x0][_0xe06f('0x20')],'exten':_0x5859c7[_0x286624][0x0][_0xe06f('0xd')],'priority':_0x4d0b04[_0xe06f('0x11')]++,'VoiceExtensionId':_0x5859c7[_0x286624][0x0][_0xe06f('0x17')]});}_0x4d0b04[_0xe06f('0x12')][_0xe06f('0x14')]({'type':_0x5859c7[_0x286624][0x0][_0xe06f('0x18')],'app':_0xe06f('0x15'),'appdata':_0xe06f('0x24')+_0x5859c7[_0x286624][0x0][_0xe06f('0x17')],'context':_0x5859c7[_0x286624][0x0][_0xe06f('0x20')],'exten':_0x5859c7[_0x286624][0x0][_0xe06f('0xd')],'priority':_0x4d0b04['priority']++,'VoiceExtensionId':_0x5859c7[_0x286624][0x0]['VoiceExtensionId']});if(_0x4d0b04[_0xe06f('0x13')]&&_0x4d0b04[_0xe06f('0x13')][_0xe06f('0x10')](_0xe06f('0x25'))&&_0x4d0b04[_0xe06f('0x13')][_0xe06f('0x25')]!==_0xe06f('0x26')){_0x4d0b04[_0xe06f('0x12')][_0xe06f('0x14')]({'type':_0x5859c7[_0x286624][0x0]['type'],'app':'Set','appdata':_0xe06f('0x27'),'context':_0x5859c7[_0x286624][0x0][_0xe06f('0x20')],'exten':_0x5859c7[_0x286624][0x0][_0xe06f('0xd')],'priority':_0x4d0b04[_0xe06f('0x11')]++,'VoiceExtensionId':_0x5859c7[_0x286624][0x0][_0xe06f('0x17')]});_0x4d0b04[_0xe06f('0x12')]['push']({'type':_0x5859c7[_0x286624][0x0][_0xe06f('0x18')],'app':'Set','appdata':_0xe06f('0x28')+_0x4d0b04[_0xe06f('0x13')]['recordingFormat']||_0xe06f('0x29'),'context':_0x5859c7[_0x286624][0x0]['context'],'exten':_0x5859c7[_0x286624][0x0][_0xe06f('0xd')],'priority':_0x4d0b04[_0xe06f('0x11')]++,'VoiceExtensionId':_0x5859c7[_0x286624][0x0][_0xe06f('0x17')]});}}_0x4d0b04['extensions'][_0xe06f('0x14')]({'type':_0x5859c7[_0x286624][0x0]['type'],'app':'Set','appdata':_0xe06f('0x2a'),'context':_0x5859c7[_0x286624][0x0][_0xe06f('0x20')],'exten':_0x5859c7[_0x286624][0x0][_0xe06f('0xd')],'priority':_0x4d0b04[_0xe06f('0x11')]++,'VoiceExtensionId':_0x5859c7[_0x286624][0x0]['VoiceExtensionId']});_0x4d0b04[_0xe06f('0x12')][_0xe06f('0x14')]({'type':_0x5859c7[_0x286624][0x0][_0xe06f('0x18')],'app':_0xe06f('0x15'),'appdata':_0xe06f('0x2b'),'context':_0x5859c7[_0x286624][0x0]['context'],'exten':_0x5859c7[_0x286624][0x0][_0xe06f('0xd')],'priority':_0x4d0b04['priority']++,'VoiceExtensionId':_0x5859c7[_0x286624][0x0]['VoiceExtensionId']});_0x4d0b04['extensions'][_0xe06f('0x14')]({'type':_0x5859c7[_0x286624][0x0][_0xe06f('0x18')],'app':_0xe06f('0x15'),'appdata':'MONITOR_OPTIONS=ab','context':_0x5859c7[_0x286624][0x0]['context'],'exten':_0x5859c7[_0x286624][0x0][_0xe06f('0xd')],'priority':_0x4d0b04[_0xe06f('0x11')]++,'VoiceExtensionId':_0x5859c7[_0x286624][0x0][_0xe06f('0x17')]});for(var _0x2a3697=0x0,_0x446559=0x0;_0x2a3697<_0x5859c7[_0x286624]['length'];_0x2a3697+=0x1,_0x446559=0x0){var _0x270b45=_0x5859c7[_0x286624][_0x2a3697];if(_0x270b45[_0xe06f('0x18')]){_0x270b45[_0xe06f('0x18')]=_0x270b45[_0xe06f('0x18')]['toLowerCase']();}var _0x3113f7=[];var _0x2b710d=[];delete _0x270b45['id'];delete _0x270b45[_0xe06f('0x2c')];delete _0x270b45[_0xe06f('0x2d')];var _0x348ba0=_0x270b45['interval']!==_0xe06f('0x2e')?[_0x270b45[_0xe06f('0x2f')]]:_0x270b45[_0xe06f('0x6')]?_[_0xe06f('0xa')](_[_0xe06f('0xc')](_0x4d0b04[_0xe06f('0x4')],{'IntervalId':_0x270b45[_0xe06f('0x6')]}),_0xe06f('0x2f')):[];if(_0x270b45[_0xe06f('0x10')]('tag')){if(_0x270b45[_0xe06f('0x30')]&&_0x270b45[_0xe06f('0x30')]!=='--'){_0x3113f7[_0xe06f('0x14')]({'type':_0x270b45[_0xe06f('0x18')],'app':_0xe06f('0x15'),'appdata':_0xe06f('0x31')+_0x270b45[_0xe06f('0x30')],'context':_0x270b45[_0xe06f('0x20')],'exten':_0x270b45[_0xe06f('0xd')],'priority':_0x348ba0[_0xe06f('0x32')]+_0x4d0b04[_0xe06f('0x11')]+_0x446559++,'VoiceExtensionId':_0x270b45[_0xe06f('0x17')]});}}if(_0x270b45[_0xe06f('0x18')]===_0xe06f('0x1b')&&_0x270b45[_0xe06f('0x10')](_0xe06f('0x33'))){if(_0x270b45[_0xe06f('0x33')]){_0x3113f7[_0xe06f('0x14')]({'type':_0x270b45[_0xe06f('0x18')],'app':_0xe06f('0x21'),'appdata':_0xe06f('0x34')+_0x270b45[_0xe06f('0x33')]+')','context':_0x270b45[_0xe06f('0x20')],'exten':_0x270b45[_0xe06f('0xd')],'priority':_0x348ba0['length']+_0x4d0b04[_0xe06f('0x11')]+_0x446559++,'VoiceExtensionId':_0x270b45['VoiceExtensionId']});}else{_0x3113f7['push']({'type':_0x270b45[_0xe06f('0x18')],'app':_0xe06f('0x21'),'appdata':_0xe06f('0x35'),'context':_0x270b45[_0xe06f('0x20')],'exten':_0x270b45['exten'],'priority':_0x348ba0['length']+_0x4d0b04[_0xe06f('0x11')]+_0x446559++,'VoiceExtensionId':_0x270b45[_0xe06f('0x17')]});}}if(_0x270b45['hasOwnProperty']('answer')){if(_0x43b642[_0xe06f('0x36')](_0x270b45[_0xe06f('0x37')]['toLowerCase']())>=0x0&&_0x270b45[_0xe06f('0x38')]!==_0xe06f('0x39')){if(_0x270b45[_0xe06f('0x3a')]){_0x3113f7[_0xe06f('0x14')]({'type':_0x270b45[_0xe06f('0x18')],'app':'ExecIf','appdata':_0xe06f('0x3b'),'context':_0x270b45[_0xe06f('0x20')],'exten':_0x270b45[_0xe06f('0xd')],'priority':_0x348ba0['length']+_0x4d0b04['priority']+_0x446559++,'VoiceExtensionId':_0x270b45[_0xe06f('0x17')]});_0x3113f7[_0xe06f('0x14')]({'type':_0x270b45[_0xe06f('0x18')],'app':_0xe06f('0x15'),'appdata':_0xe06f('0x3c'),'context':_0x270b45['context'],'exten':_0x270b45[_0xe06f('0xd')],'priority':_0x348ba0[_0xe06f('0x32')]+_0x4d0b04[_0xe06f('0x11')]+_0x446559++,'VoiceExtensionId':_0x270b45[_0xe06f('0x17')]});}else{_0x3113f7[_0xe06f('0x14')]({'type':_0x270b45[_0xe06f('0x18')],'app':'ExecIf','appdata':_0xe06f('0x3d'),'context':_0x270b45[_0xe06f('0x20')],'exten':_0x270b45[_0xe06f('0xd')],'priority':_0x348ba0[_0xe06f('0x32')]+_0x4d0b04[_0xe06f('0x11')]+_0x446559++,'VoiceExtensionId':_0x270b45['VoiceExtensionId']});_0x3113f7[_0xe06f('0x14')]({'type':_0x270b45[_0xe06f('0x18')],'app':'Set','appdata':_0xe06f('0x3e'),'context':_0x270b45[_0xe06f('0x20')],'exten':_0x270b45['exten'],'priority':_0x348ba0[_0xe06f('0x32')]+_0x4d0b04[_0xe06f('0x11')]+_0x446559++,'VoiceExtensionId':_0x270b45['VoiceExtensionId']});}}}for(var _0x3766a5=0x0;_0x3766a5<_0x348ba0[_0xe06f('0x32')];_0x3766a5+=0x1){var _0x49950c=_0x4d0b04['priority']+_0x348ba0['length'];var _0x45b631=_0x3766a5===_0x348ba0[_0xe06f('0x32')]-0x1?_0x4d0b04[_0xe06f('0x11')]+_0x3113f7[_0xe06f('0x32')]+_0x2b710d[_0xe06f('0x32')]+0x2:_0x4d0b04[_0xe06f('0x11')]+_0x3766a5+0x1;_0x3113f7['splice'](_0x3766a5,0x0,{'type':_0x270b45[_0xe06f('0x18')],'app':_0xe06f('0x3f'),'appdata':_0x348ba0[_0x3766a5]+'?'+_0x270b45['context']+_0xe06f('0x40')+_0x49950c+':'+_0x270b45[_0xe06f('0x20')]+_0xe06f('0x40')+_0x45b631,'exten':_0x270b45[_0xe06f('0xd')],'context':_0x270b45[_0xe06f('0x20')],'priority':_0x4d0b04['priority']+_0x3766a5,'VoiceExtensionId':_0x5859c7[_0x286624][0x0]['VoiceExtensionId']});}_0x270b45[_0xe06f('0x11')]=_0x3113f7[_0xe06f('0x32')]?_[_0xe06f('0x41')](_0x3113f7)[_0xe06f('0x11')]+0x1:_0x4d0b04[_0xe06f('0x11')];_0x4d0b04['priority']=(_0x2b710d[_0xe06f('0x32')]?_[_0xe06f('0x41')](_0x2b710d)[_0xe06f('0x11')]:_0x270b45[_0xe06f('0x11')])+0x1;_0x4d0b04[_0xe06f('0x12')]=_[_0xe06f('0x42')](_0x4d0b04[_0xe06f('0x12')],_0x3113f7,[_0x270b45],_0x2b710d);}_0x4d0b04[_0xe06f('0x12')]['push']({'type':_0x5859c7[_0x286624][0x0][_0xe06f('0x18')],'app':_0xe06f('0x43'),'exten':_0x5859c7[_0x286624][0x0]['exten'],'context':_0x5859c7[_0x286624][0x0][_0xe06f('0x20')],'priority':_0x4d0b04['priority'],'VoiceExtensionId':_0x5859c7[_0x286624][0x0]['VoiceExtensionId']});_0x2ac6f3[_0xe06f('0x14')](_0x5859c7[_0x286624][0x0]['VoiceExtensionId']);_0x5558e0=_['concat'](_0x5558e0,_0x4d0b04[_0xe06f('0x12')]);}}return _0x1e8d88[_0xe06f('0x44')](function(_0x1d1e51){return _0x1e8d88['models'][_0xe06f('0x8')][_0xe06f('0x45')]({'where':{'VoiceExtensionId':{'$in':_0x2ac6f3}},'transaction':_0x1d1e51})[_0xe06f('0x7')](function(_0x11a4c9){return _0x1e8d88[_0xe06f('0x5')]['VoiceExtension']['bulkCreate'](_['sortBy'](_0x5558e0,'priority'),{'transaction':_0x1d1e51});});});})['catch'](function(_0x1bbeca){console[_0xe06f('0x46')](_0x1bbeca);});}exports[_0xe06f('0x47')]=rewrite;
\ No newline at end of file
+var _0xfc46=['IntervalId','hasOwnProperty','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','models','destroy','bulkCreate','sortBy','error','rewrite','lodash','util','Interval','then','intervals','VoiceExtension','findAll','uniq','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','extensions','extension','find','push','type','Set','CDR(type)=%s','context','priority','inbound','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval'];(function(_0x5107bc,_0x57a2e3){var _0x42bed1=function(_0x209ced){while(--_0x209ced){_0x5107bc['push'](_0x5107bc['shift']());}};_0x42bed1(++_0x57a2e3);}(_0xfc46,0x182));var _0x6fc4=function(_0xadde88,_0x58ad47){_0xadde88=_0xadde88-0x0;var _0x3b8eb6=_0xfc46[_0xadde88];return _0x3b8eb6;};'use strict';var _=require(_0x6fc4('0x0'));var util=require(_0x6fc4('0x1'));function rewrite(_0x5a5974,_0x391a13){var _0x59706c=this;return _0x5a5974['models'][_0x6fc4('0x2')]['findAll']({'raw':!![]})[_0x6fc4('0x3')](function(_0x5e6a77){_0x59706c[_0x6fc4('0x4')]=_0x5e6a77;return _0x5a5974['models'][_0x6fc4('0x5')][_0x6fc4('0x6')]({'where':{'IntervalId':_0x391a13['IntervalId']},'raw':!![]});})['then'](function(_0x116d76){return _0x5a5974['models'][_0x6fc4('0x5')][_0x6fc4('0x6')]({'where':{'exten':{'$in':_[_0x6fc4('0x7')](_['map'](_0x116d76,'exten'))}},'order':[{'raw':_0x6fc4('0x8')}],'raw':!![]});})[_0x6fc4('0x3')](function(_0x362f51){var _0x1c048d=_[_0x6fc4('0x9')](_0x362f51,{'priority':'1'});var _0x3ba104=_[_0x6fc4('0x9')](_0x362f51,{'isApp':0x1});var _0x38306f=_[_0x6fc4('0xa')](_0x3ba104,_0x6fc4('0xb'));var _0x3dd6da=[_0x6fc4('0xc'),'playback'];var _0x329606=[];var _0x898eab=[];for(var _0x5e1309 in _0x38306f){if(_0x38306f['hasOwnProperty'](_0x5e1309)){_0x59706c['priority']=0x2;_0x59706c[_0x6fc4('0xd')]=[];_0x59706c[_0x6fc4('0xe')]=_[_0x6fc4('0xf')](_0x1c048d,{'exten':_0x38306f[_0x5e1309][0x0][_0x6fc4('0xb')]});_0x59706c[_0x6fc4('0xd')][_0x6fc4('0x10')]({'type':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x11')],'app':_0x6fc4('0x12'),'appdata':util['format'](_0x6fc4('0x13'),_0x38306f[_0x5e1309][0x0]['type']),'context':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x14')],'exten':_0x38306f[_0x5e1309][0x0][_0x6fc4('0xb')],'priority':_0x59706c[_0x6fc4('0x15')]++,'VoiceExtensionId':_0x38306f[_0x5e1309][0x0]['VoiceExtensionId']});if(_0x38306f[_0x5e1309][0x0][_0x6fc4('0x11')]===_0x6fc4('0x16')){_0x59706c[_0x6fc4('0xd')]['push']({'type':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x11')],'app':_0x6fc4('0x12'),'appdata':_0x6fc4('0x17')+_0x38306f[_0x5e1309][0x0][_0x6fc4('0x18')],'context':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x14')],'exten':_0x38306f[_0x5e1309][0x0]['exten'],'priority':_0x59706c['priority']++,'VoiceExtensionId':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x18')]});}else if(_0x38306f[_0x5e1309][0x0]['type']===_0x6fc4('0x19')){if(_0x59706c[_0x6fc4('0xe')]){_0x59706c[_0x6fc4('0xd')][_0x6fc4('0x10')]({'type':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x11')],'app':'Set','appdata':_0x6fc4('0x1a')+(_0x59706c[_0x6fc4('0xe')]['cutdigits']?_0x6fc4('0x1b')+_0x59706c[_0x6fc4('0xe')][_0x6fc4('0x1c')]+'}':_0x6fc4('0x1d')),'context':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x14')],'exten':_0x38306f[_0x5e1309][0x0][_0x6fc4('0xb')],'priority':_0x59706c['priority']++,'VoiceExtensionId':_0x38306f[_0x5e1309][0x0]['VoiceExtensionId']});}_0x59706c['extensions']['push']({'type':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x11')],'app':_0x6fc4('0x12'),'appdata':_0x6fc4('0x17')+_0x38306f[_0x5e1309][0x0]['VoiceExtensionId'],'context':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x14')],'exten':_0x38306f[_0x5e1309][0x0][_0x6fc4('0xb')],'priority':_0x59706c[_0x6fc4('0x15')]++,'VoiceExtensionId':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x18')]});var _0x441edf=_0x59706c[_0x6fc4('0x15')]++;_0x59706c[_0x6fc4('0xd')]['push']({'type':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x11')],'app':_0x6fc4('0x1e'),'appdata':_0x6fc4('0x1f')+(_0x441edf+0x2)+'):Goto('+(_0x441edf+0x1)+')','context':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x14')],'exten':_0x38306f[_0x5e1309][0x0][_0x6fc4('0xb')],'priority':_0x441edf,'VoiceExtensionId':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x18')]});if(_0x59706c['extension']){_0x59706c[_0x6fc4('0xd')]['push']({'type':_0x38306f[_0x5e1309][0x0]['type'],'app':'Set','appdata':_0x59706c[_0x6fc4('0xe')][_0x6fc4('0x1c')]?_0x6fc4('0x20')+_0x59706c[_0x6fc4('0xe')][_0x6fc4('0x1c')]+'}':_0x6fc4('0x21'),'context':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x14')],'exten':_0x38306f[_0x5e1309][0x0][_0x6fc4('0xb')],'priority':_0x59706c[_0x6fc4('0x15')]++,'VoiceExtensionId':_0x38306f[_0x5e1309][0x0]['VoiceExtensionId']});}_0x59706c[_0x6fc4('0xd')]['push']({'type':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x11')],'app':_0x6fc4('0x12'),'appdata':'outboundrouteid='+_0x38306f[_0x5e1309][0x0][_0x6fc4('0x18')],'context':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x14')],'exten':_0x38306f[_0x5e1309][0x0]['exten'],'priority':_0x59706c['priority']++,'VoiceExtensionId':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x18')]});if(_0x59706c['extension']&&_0x59706c[_0x6fc4('0xe')]['hasOwnProperty'](_0x6fc4('0x22'))&&_0x59706c[_0x6fc4('0xe')]['recordingFormat']!==_0x6fc4('0x23')){_0x59706c['extensions'][_0x6fc4('0x10')]({'type':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x11')],'app':'Set','appdata':_0x6fc4('0x24'),'context':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x14')],'exten':_0x38306f[_0x5e1309][0x0][_0x6fc4('0xb')],'priority':_0x59706c[_0x6fc4('0x15')]++,'VoiceExtensionId':_0x38306f[_0x5e1309][0x0]['VoiceExtensionId']});_0x59706c['extensions'][_0x6fc4('0x10')]({'type':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x11')],'app':'Set','appdata':_0x6fc4('0x25')+_0x59706c[_0x6fc4('0xe')][_0x6fc4('0x22')]||_0x6fc4('0x26'),'context':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x14')],'exten':_0x38306f[_0x5e1309][0x0][_0x6fc4('0xb')],'priority':_0x59706c[_0x6fc4('0x15')]++,'VoiceExtensionId':_0x38306f[_0x5e1309][0x0]['VoiceExtensionId']});}}_0x59706c[_0x6fc4('0xd')][_0x6fc4('0x10')]({'type':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x11')],'app':'Set','appdata':_0x6fc4('0x27'),'context':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x14')],'exten':_0x38306f[_0x5e1309][0x0]['exten'],'priority':_0x59706c[_0x6fc4('0x15')]++,'VoiceExtensionId':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x18')]});_0x59706c[_0x6fc4('0xd')][_0x6fc4('0x10')]({'type':_0x38306f[_0x5e1309][0x0]['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x14')],'exten':_0x38306f[_0x5e1309][0x0][_0x6fc4('0xb')],'priority':_0x59706c['priority']++,'VoiceExtensionId':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x18')]});_0x59706c['extensions'][_0x6fc4('0x10')]({'type':_0x38306f[_0x5e1309][0x0]['type'],'app':'Set','appdata':_0x6fc4('0x28'),'context':_0x38306f[_0x5e1309][0x0]['context'],'exten':_0x38306f[_0x5e1309][0x0][_0x6fc4('0xb')],'priority':_0x59706c[_0x6fc4('0x15')]++,'VoiceExtensionId':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x18')]});for(var _0x21d5d5=0x0,_0x1dee26=0x0;_0x21d5d5<_0x38306f[_0x5e1309][_0x6fc4('0x29')];_0x21d5d5+=0x1,_0x1dee26=0x0){var _0x2bf471=_0x38306f[_0x5e1309][_0x21d5d5];if(_0x2bf471[_0x6fc4('0x11')]){_0x2bf471[_0x6fc4('0x11')]=_0x2bf471[_0x6fc4('0x11')][_0x6fc4('0x2a')]();}var _0x491f43=[];var _0x34066f=[];delete _0x2bf471['id'];delete _0x2bf471[_0x6fc4('0x2b')];delete _0x2bf471[_0x6fc4('0x2c')];var _0x31d39c=_0x2bf471[_0x6fc4('0x2d')]!=='*,*,*,*'?[_0x2bf471[_0x6fc4('0x2d')]]:_0x2bf471[_0x6fc4('0x2e')]?_['map'](_['filter'](_0x59706c[_0x6fc4('0x4')],{'IntervalId':_0x2bf471[_0x6fc4('0x2e')]}),_0x6fc4('0x2d')):[];if(_0x2bf471[_0x6fc4('0x2f')](_0x6fc4('0x30'))){if(_0x2bf471[_0x6fc4('0x30')]&&_0x2bf471[_0x6fc4('0x30')]!=='--'){_0x491f43[_0x6fc4('0x10')]({'type':_0x2bf471[_0x6fc4('0x11')],'app':_0x6fc4('0x12'),'appdata':_0x6fc4('0x31')+_0x2bf471[_0x6fc4('0x30')],'context':_0x2bf471[_0x6fc4('0x14')],'exten':_0x2bf471[_0x6fc4('0xb')],'priority':_0x31d39c['length']+_0x59706c[_0x6fc4('0x15')]+_0x1dee26++,'VoiceExtensionId':_0x2bf471[_0x6fc4('0x18')]});}}if(_0x2bf471['type']===_0x6fc4('0x19')&&_0x2bf471[_0x6fc4('0x2f')](_0x6fc4('0x32'))){if(_0x2bf471[_0x6fc4('0x32')]){_0x491f43[_0x6fc4('0x10')]({'type':_0x2bf471[_0x6fc4('0x11')],'app':_0x6fc4('0x1e'),'appdata':_0x6fc4('0x33')+_0x2bf471['callerID']+')','context':_0x2bf471[_0x6fc4('0x14')],'exten':_0x2bf471['exten'],'priority':_0x31d39c[_0x6fc4('0x29')]+_0x59706c[_0x6fc4('0x15')]+_0x1dee26++,'VoiceExtensionId':_0x2bf471['VoiceExtensionId']});}else{_0x491f43[_0x6fc4('0x10')]({'type':_0x2bf471[_0x6fc4('0x11')],'app':_0x6fc4('0x1e'),'appdata':_0x6fc4('0x34'),'context':_0x2bf471['context'],'exten':_0x2bf471[_0x6fc4('0xb')],'priority':_0x31d39c[_0x6fc4('0x29')]+_0x59706c[_0x6fc4('0x15')]+_0x1dee26++,'VoiceExtensionId':_0x2bf471[_0x6fc4('0x18')]});}}if(_0x2bf471[_0x6fc4('0x2f')](_0x6fc4('0x35'))){if(_0x3dd6da[_0x6fc4('0x36')](_0x2bf471[_0x6fc4('0x37')][_0x6fc4('0x2a')]())>=0x0&&_0x2bf471['appType']!==_0x6fc4('0x38')){if(_0x2bf471[_0x6fc4('0x35')]){_0x491f43['push']({'type':_0x2bf471['type'],'app':_0x6fc4('0x1e'),'appdata':_0x6fc4('0x39'),'context':_0x2bf471[_0x6fc4('0x14')],'exten':_0x2bf471[_0x6fc4('0xb')],'priority':_0x31d39c[_0x6fc4('0x29')]+_0x59706c[_0x6fc4('0x15')]+_0x1dee26++,'VoiceExtensionId':_0x2bf471[_0x6fc4('0x18')]});_0x491f43[_0x6fc4('0x10')]({'type':_0x2bf471[_0x6fc4('0x11')],'app':_0x6fc4('0x12'),'appdata':_0x6fc4('0x3a'),'context':_0x2bf471[_0x6fc4('0x14')],'exten':_0x2bf471['exten'],'priority':_0x31d39c[_0x6fc4('0x29')]+_0x59706c[_0x6fc4('0x15')]+_0x1dee26++,'VoiceExtensionId':_0x2bf471[_0x6fc4('0x18')]});}else{_0x491f43[_0x6fc4('0x10')]({'type':_0x2bf471[_0x6fc4('0x11')],'app':_0x6fc4('0x1e'),'appdata':_0x6fc4('0x3b'),'context':_0x2bf471[_0x6fc4('0x14')],'exten':_0x2bf471[_0x6fc4('0xb')],'priority':_0x31d39c[_0x6fc4('0x29')]+_0x59706c[_0x6fc4('0x15')]+_0x1dee26++,'VoiceExtensionId':_0x2bf471[_0x6fc4('0x18')]});_0x491f43[_0x6fc4('0x10')]({'type':_0x2bf471[_0x6fc4('0x11')],'app':'Set','appdata':_0x6fc4('0x3c'),'context':_0x2bf471[_0x6fc4('0x14')],'exten':_0x2bf471[_0x6fc4('0xb')],'priority':_0x31d39c[_0x6fc4('0x29')]+_0x59706c[_0x6fc4('0x15')]+_0x1dee26++,'VoiceExtensionId':_0x2bf471['VoiceExtensionId']});}}}for(var _0x926ee3=0x0;_0x926ee3<_0x31d39c[_0x6fc4('0x29')];_0x926ee3+=0x1){var _0x3b1bdb=_0x59706c[_0x6fc4('0x15')]+_0x31d39c[_0x6fc4('0x29')];var _0x33146d=_0x926ee3===_0x31d39c[_0x6fc4('0x29')]-0x1?_0x59706c['priority']+_0x491f43[_0x6fc4('0x29')]+_0x34066f[_0x6fc4('0x29')]+0x2:_0x59706c[_0x6fc4('0x15')]+_0x926ee3+0x1;_0x491f43[_0x6fc4('0x3d')](_0x926ee3,0x0,{'type':_0x2bf471[_0x6fc4('0x11')],'app':'GotoIfTime','appdata':_0x31d39c[_0x926ee3]+'?'+_0x2bf471[_0x6fc4('0x14')]+_0x6fc4('0x3e')+_0x3b1bdb+':'+_0x2bf471['context']+_0x6fc4('0x3e')+_0x33146d,'exten':_0x2bf471['exten'],'context':_0x2bf471['context'],'priority':_0x59706c['priority']+_0x926ee3,'VoiceExtensionId':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x18')]});}_0x2bf471['priority']=_0x491f43[_0x6fc4('0x29')]?_[_0x6fc4('0x3f')](_0x491f43)[_0x6fc4('0x15')]+0x1:_0x59706c['priority'];_0x59706c['priority']=(_0x34066f[_0x6fc4('0x29')]?_[_0x6fc4('0x3f')](_0x34066f)['priority']:_0x2bf471[_0x6fc4('0x15')])+0x1;_0x59706c[_0x6fc4('0xd')]=_[_0x6fc4('0x40')](_0x59706c[_0x6fc4('0xd')],_0x491f43,[_0x2bf471],_0x34066f);}_0x59706c[_0x6fc4('0xd')][_0x6fc4('0x10')]({'type':_0x38306f[_0x5e1309][0x0]['type'],'app':_0x6fc4('0x41'),'exten':_0x38306f[_0x5e1309][0x0][_0x6fc4('0xb')],'context':_0x38306f[_0x5e1309][0x0]['context'],'priority':_0x59706c[_0x6fc4('0x15')],'VoiceExtensionId':_0x38306f[_0x5e1309][0x0][_0x6fc4('0x18')]});_0x329606['push'](_0x38306f[_0x5e1309][0x0][_0x6fc4('0x18')]);_0x898eab=_[_0x6fc4('0x40')](_0x898eab,_0x59706c['extensions']);}}return _0x5a5974['transaction'](function(_0x3dfe93){return _0x5a5974[_0x6fc4('0x42')][_0x6fc4('0x5')][_0x6fc4('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x329606}},'transaction':_0x3dfe93})[_0x6fc4('0x3')](function(_0x116a7f){return _0x5a5974[_0x6fc4('0x42')][_0x6fc4('0x5')][_0x6fc4('0x44')](_[_0x6fc4('0x45')](_0x898eab,_0x6fc4('0x15')),{'transaction':_0x3dfe93});});});})['catch'](function(_0x129458){console[_0x6fc4('0x46')](_0x129458);});}exports[_0x6fc4('0x47')]=rewrite;
\ No newline at end of file
index 64f5617..9111382 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e2b=['isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','Duplicate\x20Contact','CmContact','create','keys','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','phone','scheduledAt','createdAt','select','field','NOW()','ContactId','toString','from','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','into','fromQuery','updatedAt','cm_contacts','id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','deletedAt\x20IS\x20NULL','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','then','always','push','query','VoiceQueueId','onlyIfOpen','sequelize','all','BlackLists','get','CampaignId','Campaign','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','papaparse','../../../mysqldb','api','redis','localhost','socket.io-emitter','register','argv','null','undefined','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test'];(function(_0x38cd55,_0xb9e73b){var _0x583546=function(_0x5e31d0){while(--_0x5e31d0){_0x38cd55['push'](_0x38cd55['shift']());}};_0x583546(++_0xb9e73b);}(_0x7e2b,0x131));var _0xb7e2=function(_0x487ec9,_0x351700){_0x487ec9=_0x487ec9-0x0;var _0x5224f1=_0x7e2b[_0x487ec9];return _0x5224f1;};'use strict';var BPromise=require(_0xb7e2('0x0'));var util=require(_0xb7e2('0x1'));var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0xb7e2('0x2'));var Redis=require('ioredis');var db=require(_0xb7e2('0x3'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xb7e2('0x4'));config[_0xb7e2('0x5')]=_['defaults'](config[_0xb7e2('0x5')],{'host':_0xb7e2('0x6'),'port':0x18eb});var socket=require(_0xb7e2('0x7'))(new Redis(config[_0xb7e2('0x5')]));require('../../../api/cmContact/cmContact.socket')[_0xb7e2('0x8')](socket);try{if(!process[_0xb7e2('0x9')][0x2]||process[_0xb7e2('0x9')][0x2]==='undefined'||process[_0xb7e2('0x9')][0x2]===_0xb7e2('0xa')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xb7e2('0x9')][0x2];if(!process[_0xb7e2('0x9')][0x3]||process[_0xb7e2('0x9')][0x3]===_0xb7e2('0xb')||process[_0xb7e2('0x9')][0x3]===_0xb7e2('0xa')||!process[_0xb7e2('0x9')][0x4]||process[_0xb7e2('0x9')][0x4]===_0xb7e2('0xb')||process['argv'][0x4]===_0xb7e2('0xa')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_['zipObject'](process[_0xb7e2('0x9')][0x3]['split'](','),process[_0xb7e2('0x9')][0x4][_0xb7e2('0xc')](','));if(!process[_0xb7e2('0x9')][0x5]||process[_0xb7e2('0x9')][0x5]===_0xb7e2('0xb')||process[_0xb7e2('0x9')][0x5]===_0xb7e2('0xa')){throw new Error(_0xb7e2('0xd'));}var LISTID=process[_0xb7e2('0x9')][0x5];var COMPANYID=process[_0xb7e2('0x9')][0x6]&&process['argv'][0x6]!==_0xb7e2('0xb')&&process[_0xb7e2('0x9')][0x6]!==_0xb7e2('0xa')?process[_0xb7e2('0x9')][0x6]:null;var DUPLICATES=process[_0xb7e2('0x9')][0x7]&&process[_0xb7e2('0x9')][0x7]!=='undefined'&&process[_0xb7e2('0x9')][0x7]!==_0xb7e2('0xa')?process[_0xb7e2('0x9')][0x7]:null;if(!process[_0xb7e2('0x9')][0x8]||process[_0xb7e2('0x9')][0x8]===_0xb7e2('0xb')||process[_0xb7e2('0x9')][0x8]==='null'){throw new Error(_0xb7e2('0xe'));}var SOCKET_TIMESTAMP=process[_0xb7e2('0x9')][0x8];}catch(_0x36f267){logger[_0xb7e2('0xf')](_0x36f267);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(_0x37070f,_0x24848d,_0x1b18e7,_0x25a801){var _0x5d71b0={'message':_0x24848d};_0x5d71b0[_0x37070f]=!![];if(_0x1b18e7){_0x5d71b0[_0xb7e2('0x10')]=_0x1b18e7;}if(_0x25a801){_0x5d71b0[_0xb7e2('0x11')]=_0x25a801;}return _0x5d71b0;}function isEmail(_0x44f83d){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))*$/[_0xb7e2('0x12')](_0x44f83d);}function checkRow(_0x4d988e,_0xdc8ad5,_0x4e043c){return new BPromise(function(_0x53f0d9,_0x5c3efa){if(_[_0xb7e2('0x13')](_0x4d988e)){return _0x5c3efa(handleCheckRowError(_0xb7e2('0xf'),_0xb7e2('0x14'),null,_0x4e043c));}if(_0x4d988e[_0xb7e2('0x15')]&&_0x4d988e[_0xb7e2('0x15')][_0xb7e2('0x16')]){var _0x32004c=_[_0xb7e2('0x17')](_0x4d988e[_0xb7e2('0x15')],_0xb7e2('0x18'))[_0xb7e2('0x19')](';');return _0x5c3efa(handleCheckRowError(_0xb7e2('0xf'),_0x32004c,null,_0x4e043c));}var _0x2d702d={};for(var _0x53469a in FIELDS){if(FIELDS[_0xb7e2('0x1a')](_0x53469a)&&FIELDS[_0x53469a]){_0x2d702d[_0x53469a]=_0x4d988e[_0xb7e2('0x1b')][0x0][FIELDS[_0x53469a]]||_0x4d988e[_0xb7e2('0x1b')][0x0]['\ufeff'+FIELDS[_0x53469a]];}}if(!_0x2d702d['firstName']){return _0x5c3efa(handleCheckRowError(_0xb7e2('0xf'),_0xb7e2('0x1c'),null,_0x4e043c));}if(!_0x2d702d['phone']){return _0x5c3efa(handleCheckRowError(_0xb7e2('0xf'),_0xb7e2('0x1d'),null,_0x4e043c));}if(_0x2d702d[_0xb7e2('0x1e')]){var _0x13d0f3=moment(_0x2d702d[_0xb7e2('0x1e')],'YYYY-MM-DD');if(!_0x13d0f3['isValid']()){return _0x5c3efa(handleCheckRowError('error',_0xb7e2('0x1f'),null,_0x4e043c));}}if(_0x2d702d[_0xb7e2('0x20')]){if(!isEmail(_0x2d702d[_0xb7e2('0x20')])){return _0x5c3efa(handleCheckRowError('error','email\x20format\x20is\x20not\x20valid!',null,_0x4e043c));}}_0x2d702d[_0xb7e2('0x21')]=LISTID;_0x2d702d[_0xb7e2('0x22')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0xdc8ad5){var _0x28035e={};for(var _0x1d887a=0x0,_0x454152=DUPLICATES['length'];_0x1d887a<_0x454152;_0x1d887a+=0x1){_0x28035e[DUPLICATES[_0x1d887a]]=_0x2d702d[DUPLICATES[_0x1d887a]];}var _0x7e9302=_[_0xb7e2('0x23')](_0xdc8ad5,_0x28035e);if(_0x7e9302){return _0x5c3efa(handleCheckRowError('duplicate',_0xb7e2('0x24'),_0x7e9302,_0x4e043c));}}return db[_0xb7e2('0x25')][_0xb7e2('0x26')](_0x2d702d,{'raw':!![],'hooks':![],'fields':_[_0xb7e2('0x27')](_0x2d702d)})['then'](function(_0x522d4a){if(DUPLICATES&&DUPLICATES['length']&&_0xdc8ad5){_0xdc8ad5['push'](_[_0xb7e2('0x28')](_0x2d702d,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x522d4a['id'];return _0x53f0d9();})[_0xb7e2('0x29')](function(_0x19bc16){return _0x5c3efa(handleCheckRowError(_0xb7e2('0xf'),_0xb7e2('0x2a')+(_0x19bc16[_0xb7e2('0x18')]||JSON[_0xb7e2('0x2b')](_0x19bc16)),null,_0x4e043c));});});}function checkHopper(){function _0x3ba652(){return function(_0x426213){logger['error'](_0xb7e2('0x2c'),_0xb7e2('0x2d'),util[_0xb7e2('0x2e')](_0x426213,{'showHidden':![],'depth':null}));};}var _0x3de611=function(_0x475d0c,_0x5d808d){var _0x46a8bd=squel[_0xb7e2('0x2f')]()['into'](_0xb7e2('0x30'))['fromQuery']([_0xb7e2('0x31'),_0xb7e2('0x32'),'ContactId',_0xb7e2('0x21'),_0x5d808d,_0xb7e2('0x33'),'updatedAt'],squel[_0xb7e2('0x34')]()[_0xb7e2('0x35')](_0xb7e2('0x31'),_0xb7e2('0x31'))[_0xb7e2('0x35')](_0xb7e2('0x36'),_0xb7e2('0x32'))['field']('id',_0xb7e2('0x37'))[_0xb7e2('0x35')](LISTID[_0xb7e2('0x38')](),_0xb7e2('0x21'))[_0xb7e2('0x35')](_0x475d0c['id'][_0xb7e2('0x38')](),_0x5d808d)[_0xb7e2('0x35')]('NOW()',_0xb7e2('0x33'))[_0xb7e2('0x35')]('NOW()','updatedAt')[_0xb7e2('0x39')]('cm_contacts')[_0xb7e2('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0xb7e2('0x3b'),LISTID[_0xb7e2('0x38')]())[_0xb7e2('0x3a')](_0xb7e2('0x3c'))['where'](_0xb7e2('0x3d'),squel[_0xb7e2('0x34')]()[_0xb7e2('0x35')](_0xb7e2('0x31'))[_0xb7e2('0x39')](_0xb7e2('0x30'))[_0xb7e2('0x3a')](_0x5d808d+'\x20=\x20?',_0x475d0c['id'][_0xb7e2('0x38')]())))[_0xb7e2('0x38')]();return _0x46a8bd;};var _0x32e4e7=function(_0x32a938,_0x2b0340){var _0x2b2086=squel[_0xb7e2('0x2f')]()[_0xb7e2('0x3e')]('cm_hopper')[_0xb7e2('0x3f')](['phone',_0xb7e2('0x32'),'ContactId',_0xb7e2('0x21'),_0x2b0340,'createdAt','updatedAt'],squel['select']()[_0xb7e2('0x35')](_0xb7e2('0x31'),_0xb7e2('0x31'))[_0xb7e2('0x35')](_0xb7e2('0x36'),'scheduledAt')[_0xb7e2('0x35')]('id',_0xb7e2('0x37'))['field'](LISTID['toString'](),'ListId')[_0xb7e2('0x35')](_0x32a938['id'][_0xb7e2('0x38')](),_0x2b0340)[_0xb7e2('0x35')](_0xb7e2('0x36'),_0xb7e2('0x33'))[_0xb7e2('0x35')](_0xb7e2('0x36'),_0xb7e2('0x40'))['from'](_0xb7e2('0x41'))[_0xb7e2('0x3a')]('deletedAt\x20IS\x20NULL')[_0xb7e2('0x3a')](_0xb7e2('0x3b'),LISTID[_0xb7e2('0x38')]())[_0xb7e2('0x3a')](_0xb7e2('0x42'),squel[_0xb7e2('0x43')](hopperContacts))[_0xb7e2('0x3a')](_0xb7e2('0x3c'))['where'](_0xb7e2('0x3d'),squel[_0xb7e2('0x34')]()[_0xb7e2('0x35')](_0xb7e2('0x44'))[_0xb7e2('0x39')](_0xb7e2('0x45'))['where'](_0x2b0340+_0xb7e2('0x46'),_0x32a938['id'][_0xb7e2('0x38')]()))[_0xb7e2('0x3a')](_0xb7e2('0x3d'),squel['select']()['field'](_0xb7e2('0x31'))['from'](_0xb7e2('0x30'))[_0xb7e2('0x3a')](_0x2b0340+_0xb7e2('0x46'),_0x32a938['id'][_0xb7e2('0x38')]())))['toString']();return _0x2b2086;};function _0x133072(_0x3fe6ba,_0x4542a2){var _0x3e567a=squel['insert']()[_0xb7e2('0x3e')](_0xb7e2('0x30'))[_0xb7e2('0x3f')]([_0xb7e2('0x31'),_0xb7e2('0x32'),_0xb7e2('0x37'),_0xb7e2('0x21'),_0x4542a2,_0xb7e2('0x33'),_0xb7e2('0x40')],squel[_0xb7e2('0x34')]()['field'](_0xb7e2('0x31'),_0xb7e2('0x31'))[_0xb7e2('0x35')]('NOW()',_0xb7e2('0x32'))[_0xb7e2('0x35')]('id','ContactId')[_0xb7e2('0x35')](LISTID[_0xb7e2('0x38')](),'ListId')['field'](_0x3fe6ba['id'][_0xb7e2('0x38')](),_0x4542a2)['field'](_0xb7e2('0x36'),'createdAt')[_0xb7e2('0x35')](_0xb7e2('0x36'),_0xb7e2('0x40'))[_0xb7e2('0x39')](_0xb7e2('0x41'))['where']('deletedAt\x20IS\x20NULL')[_0xb7e2('0x3a')](_0xb7e2('0x3b'),LISTID[_0xb7e2('0x38')]())[_0xb7e2('0x3a')](_0xb7e2('0x42'),squel[_0xb7e2('0x43')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x3e567a;}function _0x336b12(_0x2bd97f,_0x1afa6c){var _0x43e764=squel['insert']()['into'](_0xb7e2('0x47'))[_0xb7e2('0x3f')](['phone','ContactId','ListId',_0x1afa6c,_0xb7e2('0x33'),_0xb7e2('0x40')],squel['select']()['field'](_0xb7e2('0x31'),'phone')[_0xb7e2('0x35')]('id',_0xb7e2('0x37'))[_0xb7e2('0x35')](LISTID[_0xb7e2('0x38')](),_0xb7e2('0x21'))[_0xb7e2('0x35')](_0x2bd97f['id'][_0xb7e2('0x38')](),_0x1afa6c)[_0xb7e2('0x35')]('NOW()',_0xb7e2('0x33'))[_0xb7e2('0x35')](_0xb7e2('0x36'),_0xb7e2('0x40'))[_0xb7e2('0x39')](_0xb7e2('0x41'))['where'](_0xb7e2('0x48'))[_0xb7e2('0x3a')]('ListId\x20=\x20?',LISTID['toString']())[_0xb7e2('0x3a')](_0xb7e2('0x42'),squel[_0xb7e2('0x43')](hopperContacts))[_0xb7e2('0x3a')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x43e764;}return db[_0xb7e2('0x49')][_0xb7e2('0x4a')]({'where':{'type':_0xb7e2('0x4b')},'attributes':['id',_0xb7e2('0x4c')],'include':[{'model':db[_0xb7e2('0x4d')],'as':_0xb7e2('0x4e'),'where':{'id':LISTID}}]})[_0xb7e2('0x4f')](function(_0x5b343b){var _0x4b8ae8=[];if(_0x5b343b){var _0x4d9fb8;for(var _0x551516=0x0,_0x43c0b6;_0x551516<_0x5b343b[_0xb7e2('0x16')];_0x551516+=0x1){_0x43c0b6=_0x5b343b[_0x551516]['get']({'plain':!![]});switch(_0x43c0b6[_0xb7e2('0x4c')]){case _0xb7e2('0x50'):_0x4b8ae8[_0xb7e2('0x51')](db['sequelize'][_0xb7e2('0x52')](_0x32e4e7(_0x43c0b6,_0xb7e2('0x53')))[_0xb7e2('0x4f')](function(){})[_0xb7e2('0x29')](_0x3ba652()));break;case _0xb7e2('0x54'):_0x4b8ae8['push'](db[_0xb7e2('0x55')][_0xb7e2('0x52')](_0x3de611(_0x43c0b6,_0xb7e2('0x53')))['then'](function(){})[_0xb7e2('0x29')](_0x3ba652()));break;default:_0x4b8ae8[_0xb7e2('0x51')](db[_0xb7e2('0x55')]['query'](_0x133072(_0x43c0b6,_0xb7e2('0x53')))[_0xb7e2('0x4f')](function(){})[_0xb7e2('0x29')](_0x3ba652()));}}}return _0x4b8ae8;})[_0xb7e2('0x56')]()[_0xb7e2('0x4f')](function(){return db[_0xb7e2('0x49')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xb7e2('0x57'),'where':{'id':LISTID}}]})[_0xb7e2('0x4f')](function(_0x3c00fd){var _0x3d349b=[];if(_0x3c00fd){var _0x444947;for(var _0x34fa62=0x0,_0xdc8b95;_0x34fa62<_0x3c00fd[_0xb7e2('0x16')];_0x34fa62+=0x1){_0xdc8b95=_0x3c00fd[_0x34fa62]['get']({'plain':!![]});_0x3d349b['push'](db[_0xb7e2('0x55')][_0xb7e2('0x52')](_0x336b12(_0xdc8b95,_0xb7e2('0x53')))[_0xb7e2('0x4f')](function(){})[_0xb7e2('0x29')](_0x3ba652()));}}return _0x3d349b;})[_0xb7e2('0x56')]();})['then'](function(){return db['Campaign'][_0xb7e2('0x4a')]({'attributes':['id',_0xb7e2('0x4c')],'include':[{'model':db[_0xb7e2('0x4d')],'as':_0xb7e2('0x4e'),'where':{'id':LISTID}}]})[_0xb7e2('0x4f')](function(_0x532768){var _0x4b2653=[];if(_0x532768){for(var _0x4d328d=0x0,_0xbb6184;_0x4d328d<_0x532768['length'];_0x4d328d+=0x1){_0xbb6184=_0x532768[_0x4d328d][_0xb7e2('0x58')]({'plain':!![]});switch(_0xbb6184[_0xb7e2('0x4c')]){case _0xb7e2('0x50'):_0x4b2653[_0xb7e2('0x51')](db[_0xb7e2('0x55')][_0xb7e2('0x52')](_0x32e4e7(_0xbb6184,'CampaignId'))[_0xb7e2('0x4f')](function(){})[_0xb7e2('0x29')](_0x3ba652()));break;case _0xb7e2('0x54'):_0x4b2653['push'](db['sequelize']['query'](_0x3de611(_0xbb6184,_0xb7e2('0x59')))['then'](function(){})['catch'](_0x3ba652()));break;default:_0x4b2653[_0xb7e2('0x51')](db['sequelize'][_0xb7e2('0x52')](_0x133072(_0xbb6184,_0xb7e2('0x59')))[_0xb7e2('0x4f')](function(){})[_0xb7e2('0x29')](_0x3ba652()));}}}return _0x4b2653;})[_0xb7e2('0x56')]();})[_0xb7e2('0x4f')](function(){return db[_0xb7e2('0x5a')]['findAll']({'attributes':['id'],'include':[{'model':db[_0xb7e2('0x4d')],'as':_0xb7e2('0x57'),'where':{'id':LISTID}}]})[_0xb7e2('0x4f')](function(_0x17393d){var _0xaf90de=[];if(_0x17393d){for(var _0x48b536=0x0,_0x5e0a1d;_0x48b536<_0x17393d[_0xb7e2('0x16')];_0x48b536+=0x1){_0x5e0a1d=_0x17393d[_0x48b536][_0xb7e2('0x58')]({'plain':!![]});_0xaf90de[_0xb7e2('0x51')](db['sequelize']['query'](_0x336b12(_0x5e0a1d,_0xb7e2('0x59')))[_0xb7e2('0x4f')](function(){})['catch'](_0x3ba652()));}}return _0xaf90de;})[_0xb7e2('0x56')]();})['catch'](function(_0x29e570){logger[_0xb7e2('0xf')](_0xb7e2('0x5b'),'generalCheckHopper',_0x29e570[_0xb7e2('0x18')]);});}var processPromises=function(_0x25c0d9){return BPromise['all'](promises)['then'](function(_0x1b2ee9){})[_0xb7e2('0x29')](function(_0x8d54b1){logger[_0xb7e2('0xf')](_0xb7e2('0x5c'),JSON[_0xb7e2('0x2b')](_0x8d54b1));})[_0xb7e2('0x5d')](function(){socket[_0xb7e2('0x5e')](_0xb7e2('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x25c0d9){return _0x25c0d9[_0xb7e2('0x60')]();}});};var endCsv=function(){return BPromise[_0xb7e2('0x61')]()[_0xb7e2('0x4f')](function(){if(hopperContacts){return checkHopper();}})[_0xb7e2('0x4f')](function(){socket[_0xb7e2('0x5e')](_0xb7e2('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xb7e2('0x62')](FILEPATH);}catch(_0x19e06a){logger[_0xb7e2('0xf')](_0xb7e2('0x63'),JSON['stringify'](_0x19e06a));}finally{process['exit'](0x0);}});};process['on'](_0xb7e2('0x64'),function(){logger[_0xb7e2('0x65')](_0xb7e2('0x66'));endCsv();});function main(){return BPromise['resolve']()[_0xb7e2('0x4f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xb7e2('0xc')](',');return db[_0xb7e2('0x25')][_0xb7e2('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x5392f0){var _0x459cf9=fs[_0xb7e2('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xb7e2('0x68')](_0x459cf9,{'header':!![],'skipEmptyLines':!![],'step':function(_0x51e4a2,_0x55ad86){total+=0x1;var _0x50cc05=total;promises[_0xb7e2('0x51')](checkRow(_0x51e4a2,_0x5392f0,_0x50cc05)[_0xb7e2('0x4f')](function(){success+=0x1;})[_0xb7e2('0x29')](function(_0x2229f8){if(_0x2229f8[_0xb7e2('0xf')]){errors+=0x1;delete _0x2229f8[_0xb7e2('0xf')];}else if(_0x2229f8[_0xb7e2('0x69')]){duplicates+=0x1;delete _0x2229f8[_0xb7e2('0x69')];}rows[_0xb7e2('0x51')](_0x2229f8);}));if(total%0xc8===0x0){_0x55ad86['pause']();return processPromises(_0x55ad86);}},'complete':function(){return processPromises()[_0xb7e2('0x4f')](function(){logger[_0xb7e2('0x65')](_0xb7e2('0x6a'));endCsv();});},'error':function(_0x523edc,_0x1ea9a9){logger[_0xb7e2('0x65')](_0xb7e2('0x6b'),JSON[_0xb7e2('0x2b')](_0x523edc));endCsv();}});})['catch'](function(_0x40577b){logger[_0xb7e2('0xf')]('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x40577b));});}main();
\ No newline at end of file
+var _0x9974=['Campaign','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','exit','CSV\x20import\x20process\x20stopped!','resolve','parse','pause','info','CSV\x20parsed\x20correctly!','bluebird','util','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','zipObject','split','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','duplicate','Duplicate\x20Contact','CmContact','create','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','insert','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','field','NOW()','toString','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','into','id\x20IN\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','get','always','push','query','sequelize','VoiceQueueId','outbound','BlackLists','all'];(function(_0x11eba6,_0x41470e){var _0x23d37f=function(_0x40a89b){while(--_0x40a89b){_0x11eba6['push'](_0x11eba6['shift']());}};_0x23d37f(++_0x41470e);}(_0x9974,0xf2));var _0x4997=function(_0x4b716a,_0x395154){_0x4b716a=_0x4b716a-0x0;var _0x560ebb=_0x9974[_0x4b716a];return _0x560ebb;};'use strict';var BPromise=require(_0x4997('0x0'));var util=require(_0x4997('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0x4997('0x2'));var Papa=require(_0x4997('0x3'));var Redis=require('ioredis');var db=require(_0x4997('0x4'))['db'];var config=require(_0x4997('0x5'));var logger=require(_0x4997('0x6'))(_0x4997('0x7'));config['redis']=_[_0x4997('0x8')](config[_0x4997('0x9')],{'host':_0x4997('0xa'),'port':0x18eb});var socket=require(_0x4997('0xb'))(new Redis(config[_0x4997('0x9')]));require(_0x4997('0xc'))[_0x4997('0xd')](socket);try{if(!process['argv'][0x2]||process[_0x4997('0xe')][0x2]===_0x4997('0xf')||process[_0x4997('0xe')][0x2]==='null'){throw new Error(_0x4997('0x10'));}var FILEPATH=process[_0x4997('0xe')][0x2];if(!process[_0x4997('0xe')][0x3]||process[_0x4997('0xe')][0x3]===_0x4997('0xf')||process[_0x4997('0xe')][0x3]==='null'||!process[_0x4997('0xe')][0x4]||process[_0x4997('0xe')][0x4]===_0x4997('0xf')||process['argv'][0x4]===_0x4997('0x11')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x4997('0x12')](process[_0x4997('0xe')][0x3]['split'](','),process['argv'][0x4][_0x4997('0x13')](','));if(!process[_0x4997('0xe')][0x5]||process[_0x4997('0xe')][0x5]===_0x4997('0xf')||process[_0x4997('0xe')][0x5]===_0x4997('0x11')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x4997('0xe')][0x5];var COMPANYID=process[_0x4997('0xe')][0x6]&&process[_0x4997('0xe')][0x6]!==_0x4997('0xf')&&process[_0x4997('0xe')][0x6]!==_0x4997('0x11')?process['argv'][0x6]:null;var DUPLICATES=process[_0x4997('0xe')][0x7]&&process[_0x4997('0xe')][0x7]!==_0x4997('0xf')&&process['argv'][0x7]!==_0x4997('0x11')?process[_0x4997('0xe')][0x7]:null;if(!process[_0x4997('0xe')][0x8]||process[_0x4997('0xe')][0x8]===_0x4997('0xf')||process[_0x4997('0xe')][0x8]===_0x4997('0x11')){throw new Error(_0x4997('0x14'));}var SOCKET_TIMESTAMP=process[_0x4997('0xe')][0x8];}catch(_0xfd32f){logger['error'](_0xfd32f);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(_0x4be48f,_0x5efa30,_0x1c98e7,_0x3551e7){var _0x40ec4c={'message':_0x5efa30};_0x40ec4c[_0x4be48f]=!![];if(_0x1c98e7){_0x40ec4c[_0x4997('0x15')]=_0x1c98e7;}if(_0x3551e7){_0x40ec4c[_0x4997('0x16')]=_0x3551e7;}return _0x40ec4c;}function isEmail(_0x3c5920){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))*$/[_0x4997('0x17')](_0x3c5920);}function checkRow(_0x1ada56,_0x27c560,_0x56cf12){return new BPromise(function(_0x3e22b3,_0x162eed){if(_[_0x4997('0x18')](_0x1ada56)){return _0x162eed(handleCheckRowError(_0x4997('0x19'),_0x4997('0x1a'),null,_0x56cf12));}if(_0x1ada56[_0x4997('0x1b')]&&_0x1ada56[_0x4997('0x1b')][_0x4997('0x1c')]){var _0x37a4f5=_[_0x4997('0x1d')](_0x1ada56[_0x4997('0x1b')],_0x4997('0x1e'))[_0x4997('0x1f')](';');return _0x162eed(handleCheckRowError(_0x4997('0x19'),_0x37a4f5,null,_0x56cf12));}var _0x5572a7={};for(var _0x4f9a02 in FIELDS){if(FIELDS[_0x4997('0x20')](_0x4f9a02)&&FIELDS[_0x4f9a02]){_0x5572a7[_0x4f9a02]=_0x1ada56[_0x4997('0x21')][0x0][FIELDS[_0x4f9a02]]||_0x1ada56[_0x4997('0x21')][0x0]['\ufeff'+FIELDS[_0x4f9a02]];}}if(!_0x5572a7[_0x4997('0x22')]){return _0x162eed(handleCheckRowError('error','firstName\x20not\x20specified!',null,_0x56cf12));}if(!_0x5572a7[_0x4997('0x23')]){return _0x162eed(handleCheckRowError(_0x4997('0x19'),_0x4997('0x24'),null,_0x56cf12));}if(_0x5572a7[_0x4997('0x25')]){var _0x51eb57=moment(_0x5572a7['birthDate'],_0x4997('0x26'));if(!_0x51eb57[_0x4997('0x27')]()){return _0x162eed(handleCheckRowError(_0x4997('0x19'),_0x4997('0x28'),null,_0x56cf12));}}if(_0x5572a7[_0x4997('0x29')]){if(!isEmail(_0x5572a7[_0x4997('0x29')])){return _0x162eed(handleCheckRowError(_0x4997('0x19'),'email\x20format\x20is\x20not\x20valid!',null,_0x56cf12));}}_0x5572a7[_0x4997('0x2a')]=LISTID;_0x5572a7[_0x4997('0x2b')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x27c560){var _0x20269b={};for(var _0xa234da=0x0,_0x3aefa4=DUPLICATES['length'];_0xa234da<_0x3aefa4;_0xa234da+=0x1){_0x20269b[DUPLICATES[_0xa234da]]=_0x5572a7[DUPLICATES[_0xa234da]];}var _0x5765c9=_['find'](_0x27c560,_0x20269b);if(_0x5765c9){return _0x162eed(handleCheckRowError(_0x4997('0x2c'),_0x4997('0x2d'),_0x5765c9,_0x56cf12));}}return db[_0x4997('0x2e')][_0x4997('0x2f')](_0x5572a7,{'raw':!![],'hooks':![],'fields':_['keys'](_0x5572a7)})[_0x4997('0x30')](function(_0x21ae49){if(DUPLICATES&&DUPLICATES[_0x4997('0x1c')]&&_0x27c560){_0x27c560['push'](_[_0x4997('0x31')](_0x5572a7,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x21ae49['id'];return _0x3e22b3();})[_0x4997('0x32')](function(_0x5c7ba8){return _0x162eed(handleCheckRowError('error',_0x4997('0x33')+(_0x5c7ba8[_0x4997('0x1e')]||JSON[_0x4997('0x34')](_0x5c7ba8)),null,_0x56cf12));});});}function checkHopper(){function _0x3e5724(){return function(_0x1bb04d){logger['error'](_0x4997('0x35'),_0x4997('0x36'),util['inspect'](_0x1bb04d,{'showHidden':![],'depth':null}));};}var _0xb99a68=function(_0x142f70,_0x41b797){var _0x4bc76f=squel[_0x4997('0x37')]()['into'](_0x4997('0x38'))[_0x4997('0x39')](['phone',_0x4997('0x3a'),_0x4997('0x3b'),_0x4997('0x2a'),_0x41b797,_0x4997('0x3c'),'updatedAt'],squel['select']()[_0x4997('0x3d')]('phone',_0x4997('0x23'))[_0x4997('0x3d')](_0x4997('0x3e'),_0x4997('0x3a'))[_0x4997('0x3d')]('id',_0x4997('0x3b'))[_0x4997('0x3d')](LISTID[_0x4997('0x3f')](),'ListId')[_0x4997('0x3d')](_0x142f70['id']['toString'](),_0x41b797)[_0x4997('0x3d')]('NOW()',_0x4997('0x3c'))[_0x4997('0x3d')]('NOW()',_0x4997('0x40'))[_0x4997('0x41')](_0x4997('0x42'))[_0x4997('0x43')](_0x4997('0x44'))[_0x4997('0x43')](_0x4997('0x45'),LISTID[_0x4997('0x3f')]())['where'](_0x4997('0x46'))[_0x4997('0x43')](_0x4997('0x47'),squel[_0x4997('0x48')]()[_0x4997('0x3d')](_0x4997('0x23'))[_0x4997('0x41')](_0x4997('0x38'))[_0x4997('0x43')](_0x41b797+'\x20=\x20?',_0x142f70['id'][_0x4997('0x3f')]())))[_0x4997('0x3f')]();return _0x4bc76f;};var _0x4bcc76=function(_0x127153,_0x2ad8a5){var _0x4d2851=squel[_0x4997('0x37')]()[_0x4997('0x49')](_0x4997('0x38'))[_0x4997('0x39')]([_0x4997('0x23'),_0x4997('0x3a'),_0x4997('0x3b'),_0x4997('0x2a'),_0x2ad8a5,_0x4997('0x3c'),'updatedAt'],squel['select']()[_0x4997('0x3d')](_0x4997('0x23'),'phone')[_0x4997('0x3d')]('NOW()',_0x4997('0x3a'))['field']('id',_0x4997('0x3b'))['field'](LISTID[_0x4997('0x3f')](),_0x4997('0x2a'))['field'](_0x127153['id'][_0x4997('0x3f')](),_0x2ad8a5)[_0x4997('0x3d')]('NOW()',_0x4997('0x3c'))['field'](_0x4997('0x3e'),_0x4997('0x40'))[_0x4997('0x41')](_0x4997('0x42'))['where'](_0x4997('0x44'))['where'](_0x4997('0x45'),LISTID[_0x4997('0x3f')]())[_0x4997('0x43')](_0x4997('0x4a'),squel[_0x4997('0x4b')](hopperContacts))[_0x4997('0x43')](_0x4997('0x46'))['where'](_0x4997('0x47'),squel[_0x4997('0x48')]()[_0x4997('0x3d')](_0x4997('0x4c'))['from'](_0x4997('0x4d'))[_0x4997('0x43')](_0x2ad8a5+_0x4997('0x4e'),_0x127153['id'][_0x4997('0x3f')]()))[_0x4997('0x43')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x4997('0x3d')]('phone')['from'](_0x4997('0x38'))[_0x4997('0x43')](_0x2ad8a5+_0x4997('0x4e'),_0x127153['id'][_0x4997('0x3f')]())))['toString']();return _0x4d2851;};function _0x2a92c1(_0x45b4c1,_0x57bc59){var _0x6e75a7=squel[_0x4997('0x37')]()[_0x4997('0x49')](_0x4997('0x38'))[_0x4997('0x39')]([_0x4997('0x23'),_0x4997('0x3a'),'ContactId','ListId',_0x57bc59,'createdAt',_0x4997('0x40')],squel[_0x4997('0x48')]()[_0x4997('0x3d')](_0x4997('0x23'),_0x4997('0x23'))[_0x4997('0x3d')](_0x4997('0x3e'),'scheduledAt')[_0x4997('0x3d')]('id',_0x4997('0x3b'))[_0x4997('0x3d')](LISTID['toString'](),_0x4997('0x2a'))[_0x4997('0x3d')](_0x45b4c1['id']['toString'](),_0x57bc59)['field'](_0x4997('0x3e'),_0x4997('0x3c'))[_0x4997('0x3d')](_0x4997('0x3e'),_0x4997('0x40'))[_0x4997('0x41')](_0x4997('0x42'))[_0x4997('0x43')](_0x4997('0x44'))[_0x4997('0x43')](_0x4997('0x45'),LISTID[_0x4997('0x3f')]())[_0x4997('0x43')]('id\x20IN\x20?',squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x4997('0x3f')]();return _0x6e75a7;}function _0x3551c6(_0x472847,_0x47a26b){var _0x53bc71=squel['insert']()[_0x4997('0x49')](_0x4997('0x4f'))[_0x4997('0x39')]([_0x4997('0x23'),_0x4997('0x3b'),'ListId',_0x47a26b,_0x4997('0x3c'),'updatedAt'],squel[_0x4997('0x48')]()[_0x4997('0x3d')](_0x4997('0x23'),_0x4997('0x23'))[_0x4997('0x3d')]('id','ContactId')['field'](LISTID[_0x4997('0x3f')](),_0x4997('0x2a'))['field'](_0x472847['id'][_0x4997('0x3f')](),_0x47a26b)[_0x4997('0x3d')]('NOW()',_0x4997('0x3c'))[_0x4997('0x3d')](_0x4997('0x3e'),'updatedAt')[_0x4997('0x41')](_0x4997('0x42'))[_0x4997('0x43')](_0x4997('0x44'))[_0x4997('0x43')](_0x4997('0x45'),LISTID[_0x4997('0x3f')]())[_0x4997('0x43')]('id\x20IN\x20?',squel[_0x4997('0x4b')](hopperContacts))[_0x4997('0x43')](_0x4997('0x46')))[_0x4997('0x3f')]();return _0x53bc71;}return db[_0x4997('0x50')][_0x4997('0x51')]({'where':{'type':'outbound'},'attributes':['id',_0x4997('0x52')],'include':[{'model':db[_0x4997('0x53')],'as':_0x4997('0x54'),'where':{'id':LISTID}}]})[_0x4997('0x30')](function(_0x5107e4){var _0x33b1e3=[];if(_0x5107e4){var _0x57c23e;for(var _0x2d5f26=0x0,_0x1076b3;_0x2d5f26<_0x5107e4['length'];_0x2d5f26+=0x1){_0x1076b3=_0x5107e4[_0x2d5f26][_0x4997('0x55')]({'plain':!![]});switch(_0x1076b3[_0x4997('0x52')]){case _0x4997('0x56'):_0x33b1e3[_0x4997('0x57')](db['sequelize'][_0x4997('0x58')](_0x4bcc76(_0x1076b3,'VoiceQueueId'))[_0x4997('0x30')](function(){})[_0x4997('0x32')](_0x3e5724()));break;case'onlyIfOpen':_0x33b1e3['push'](db[_0x4997('0x59')][_0x4997('0x58')](_0xb99a68(_0x1076b3,_0x4997('0x5a')))[_0x4997('0x30')](function(){})['catch'](_0x3e5724()));break;default:_0x33b1e3['push'](db[_0x4997('0x59')][_0x4997('0x58')](_0x2a92c1(_0x1076b3,_0x4997('0x5a')))[_0x4997('0x30')](function(){})['catch'](_0x3e5724()));}}}return _0x33b1e3;})['all']()[_0x4997('0x30')](function(){return db['VoiceQueue'][_0x4997('0x51')]({'where':{'type':_0x4997('0x5b')},'attributes':['id'],'include':[{'model':db[_0x4997('0x53')],'as':_0x4997('0x5c'),'where':{'id':LISTID}}]})['then'](function(_0x41eb4b){var _0x438da2=[];if(_0x41eb4b){var _0x2751ad;for(var _0x2cb350=0x0,_0x28ccf8;_0x2cb350<_0x41eb4b[_0x4997('0x1c')];_0x2cb350+=0x1){_0x28ccf8=_0x41eb4b[_0x2cb350][_0x4997('0x55')]({'plain':!![]});_0x438da2[_0x4997('0x57')](db[_0x4997('0x59')][_0x4997('0x58')](_0x3551c6(_0x28ccf8,_0x4997('0x5a')))[_0x4997('0x30')](function(){})['catch'](_0x3e5724()));}}return _0x438da2;})[_0x4997('0x5d')]();})[_0x4997('0x30')](function(){return db[_0x4997('0x5e')]['findAll']({'attributes':['id',_0x4997('0x52')],'include':[{'model':db[_0x4997('0x53')],'as':'Lists','where':{'id':LISTID}}]})[_0x4997('0x30')](function(_0x1702d8){var _0x3ae6f1=[];if(_0x1702d8){for(var _0x2f340a=0x0,_0x8334f4;_0x2f340a<_0x1702d8[_0x4997('0x1c')];_0x2f340a+=0x1){_0x8334f4=_0x1702d8[_0x2f340a][_0x4997('0x55')]({'plain':!![]});switch(_0x8334f4['dialCheckDuplicateType']){case _0x4997('0x56'):_0x3ae6f1[_0x4997('0x57')](db[_0x4997('0x59')][_0x4997('0x58')](_0x4bcc76(_0x8334f4,_0x4997('0x5f')))[_0x4997('0x30')](function(){})[_0x4997('0x32')](_0x3e5724()));break;case _0x4997('0x60'):_0x3ae6f1[_0x4997('0x57')](db[_0x4997('0x59')][_0x4997('0x58')](_0xb99a68(_0x8334f4,_0x4997('0x5f')))[_0x4997('0x30')](function(){})['catch'](_0x3e5724()));break;default:_0x3ae6f1[_0x4997('0x57')](db[_0x4997('0x59')]['query'](_0x2a92c1(_0x8334f4,_0x4997('0x5f')))[_0x4997('0x30')](function(){})[_0x4997('0x32')](_0x3e5724()));}}}return _0x3ae6f1;})[_0x4997('0x5d')]();})[_0x4997('0x30')](function(){return db[_0x4997('0x5e')][_0x4997('0x51')]({'attributes':['id'],'include':[{'model':db[_0x4997('0x53')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x4997('0x30')](function(_0x39f5dc){var _0x56e063=[];if(_0x39f5dc){for(var _0x807eed=0x0,_0x6c665a;_0x807eed<_0x39f5dc[_0x4997('0x1c')];_0x807eed+=0x1){_0x6c665a=_0x39f5dc[_0x807eed][_0x4997('0x55')]({'plain':!![]});_0x56e063[_0x4997('0x57')](db[_0x4997('0x59')]['query'](_0x3551c6(_0x6c665a,_0x4997('0x5f')))[_0x4997('0x30')](function(){})[_0x4997('0x32')](_0x3e5724()));}}return _0x56e063;})[_0x4997('0x5d')]();})['catch'](function(_0x4a155f){logger[_0x4997('0x19')](_0x4997('0x61'),_0x4997('0x62'),_0x4a155f['message']);});}var processPromises=function(_0xbf23af){return BPromise['all'](promises)[_0x4997('0x30')](function(_0x4a5ca2){})[_0x4997('0x32')](function(_0x3990ac){logger['error'](_0x4997('0x63'),JSON[_0x4997('0x34')](_0x3990ac));})[_0x4997('0x64')](function(){socket[_0x4997('0x65')](_0x4997('0x66')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xbf23af){return _0xbf23af[_0x4997('0x67')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x4997('0x30')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x4997('0x65')](_0x4997('0x66')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x4997('0x68')](FILEPATH);}catch(_0xa6d154){logger[_0x4997('0x19')]('Unable\x20to\x20delete\x20temp\x20file:',JSON['stringify'](_0xa6d154));}finally{process[_0x4997('0x69')](0x0);}});};process['on']('SIGINT',function(){logger['info'](_0x4997('0x6a'));endCsv();});function main(){return BPromise[_0x4997('0x6b')]()[_0x4997('0x30')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x4997('0x13')](',');return db[_0x4997('0x2e')][_0x4997('0x51')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x4997('0x30')](function(_0x51f72c){var _0x2c51aa=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x4997('0x6c')](_0x2c51aa,{'header':!![],'skipEmptyLines':!![],'step':function(_0x23fc8f,_0x29bb6d){total+=0x1;var _0x3c0575=total;promises['push'](checkRow(_0x23fc8f,_0x51f72c,_0x3c0575)[_0x4997('0x30')](function(){success+=0x1;})[_0x4997('0x32')](function(_0x4b5894){if(_0x4b5894[_0x4997('0x19')]){errors+=0x1;delete _0x4b5894[_0x4997('0x19')];}else if(_0x4b5894[_0x4997('0x2c')]){duplicates+=0x1;delete _0x4b5894[_0x4997('0x2c')];}rows[_0x4997('0x57')](_0x4b5894);}));if(total%0xc8===0x0){_0x29bb6d[_0x4997('0x6d')]();return processPromises(_0x29bb6d);}},'complete':function(){return processPromises()[_0x4997('0x30')](function(){logger[_0x4997('0x6e')](_0x4997('0x6f'));endCsv();});},'error':function(_0x2c2a34,_0x50d98a){logger[_0x4997('0x6e')]('CSV\x20parse\x20error',JSON[_0x4997('0x34')](_0x2c2a34));endCsv();}});})[_0x4997('0x32')](function(_0x572ab8){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x572ab8));});}main();
\ No newline at end of file
index 34e7d17..398ebc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4049=['voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns_has_cm_blacklists','CampaignId','finish','affectedRows','emit','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','root','file\x20doesn\x27t\x20exists','binding','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','moment','squel','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','findAll','then','push','all','AdditionalPhones','length','split','CmContactHasItem','update','create','PHONE','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','priority','UserId','fields','cm_contacts','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','updatedAt','cm_contacts.ListId\x20=\x20','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','recallme','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','code','sequelize','query','spread','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','catch','voice_queues.id','voice_queues.dialTimezone','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','isNil','set','offset','main','send','start','clone','socket_timestamp','server/files/tmp','.csv','includes','name','writeFileSync','parse','createReadStream','data','rows','find','_description','hasOwnProperty','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','YYYY-MM-DD','isValid','timezones','firstName','itemTypeId','SystemRow','contact:import:','Abort\x20parser','abort','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','voice_queues_has_cm_lists','VoiceQueueId'];(function(_0x2d6a1e,_0x4b2640){var _0x47dd18=function(_0x5e99da){while(--_0x5e99da){_0x2d6a1e['push'](_0x2d6a1e['shift']());}};_0x47dd18(++_0x4b2640);}(_0x4049,0x177));var _0x9404=function(_0x90c561,_0x36c4b9){_0x90c561=_0x90c561-0x0;var _0x4fe8d4=_0x4049[_0x90c561];return _0x4fe8d4;};'use strict';var fs=require('fs');var path=require(_0x9404('0x0'));var _=require(_0x9404('0x1'));var Papa=require(_0x9404('0x2'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0x9404('0x3'));var squel=require(_0x9404('0x4'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0x9404('0x5'));var shared=require('../../../config/environment/shared');var logger=require(_0x9404('0x6'))(_0x9404('0x7'));config[_0x9404('0x8')]=_[_0x9404('0x9')](config[_0x9404('0x8')],{'host':_0x9404('0xa'),'port':0x18eb});var socket=require(_0x9404('0xb'))(new Redis(config[_0x9404('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x9404('0xc')](_0x9404('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x9404('0xc')](_0x9404('0xd'));function isEmail(_0x15481c){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))*$/[_0x9404('0xe')](_0x15481c);}function selectNotIn(_0x3f1463,_0x1d7a6c,_0x174d56,_0x4e58d7,_0x5b8d04){return squel[_0x9404('0xf')]()[_0x9404('0x10')](_0x9404('0x11'))[_0x9404('0x12')](_0x4e58d7)[_0x9404('0x13')](_0x1d7a6c,null,_0x1d7a6c+'.id\x20=\x20'+_0x4e58d7+'.'+_0x174d56)['where'](_0x4e58d7+'.'+_0x174d56+_0x9404('0x14')+_0x3f1463+'.'+_0x174d56)[_0x9404('0x15')](_0x1d7a6c+_0x9404('0x16')+_0x5b8d04[_0x9404('0x13')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x3d13e8,_0x30ea71){promisesAdditionalPhones=[];return db['CmContact'][_0x9404('0x17')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x9404('0x18')](function(_0x5e42c0){if(_0x5e42c0!==null){var _0x5574c2=[];for(var _0xf43e8e=0x0;_0xf43e8e<_0x5e42c0['length'];_0xf43e8e++){var _0x585504=_0x5e42c0[_0xf43e8e];_0x5574c2[_0x9404('0x19')](insertAdditionalPhones(_0x585504));}}Promise[_0x9404('0x1a')](_0x5574c2)[_0x9404('0x18')](function(){_0x3d13e8({'val':0x1});});});});}function insertAdditionalPhones(_0x1ab4b6){return new Promise(function(_0x34068f,_0x26c8a0){var _0x3b634d=_0x1ab4b6[_0x9404('0x1b')];var _0x122231=_0x3b634d['split'](';');var _0xda37ac=[];orderBy=0x0;for(var _0x456619=0x0;_0x456619<_0x122231[_0x9404('0x1c')];_0x456619++){_0xda37ac[_0x9404('0x19')](splitAdditionalPhone(_0x1ab4b6['id'],_0x122231[_0x456619]));}Promise[_0x9404('0x1a')](_0xda37ac)[_0x9404('0x18')](function(){_0x34068f({'val':_0x122231[_0x9404('0x1c')]});});});}function splitAdditionalPhone(_0x1db956,_0x4faf2f){return new Promise(function(_0x3ea676,_0x241182){var _0x4e0953=_0x4faf2f['split'](':');var _0x3b68ef=_0x4e0953[0x0];var _0x59eabb=_0x4e0953[0x1];if(!_['isNil'](_0x59eabb)){var _0x36ab65=_0x59eabb['split']('|');var _0x4742db=[];for(var _0x5c0e93=0x0;_0x5c0e93<_0x36ab65[_0x9404('0x1c')];_0x5c0e93++){if(_0x36ab65[_0x5c0e93]!==''){var _0x16d4fd=_['filter'](promisesAdditionalPhones,{'contactId':_0x1db956,'phone':_0x36ab65[_0x5c0e93]});if(_0x16d4fd[_0x9404('0x1c')]==0x0){orderBy++;promisesAdditionalPhones[_0x9404('0x19')]({'contactId':_0x1db956,'contactTypeId':_0x3b68ef,'phone':_0x36ab65[_0x5c0e93],'orderBy':orderBy});}}}_0x3ea676({'ok':0x1});}else _0x3ea676({'res':0x0});});}function createAdditionalPhone(_0x322cfc,_0x224c67,_0x4173bb,_0x419221){var _0x411bab='';var _0x504e8b='';var _0x193536=_0x4173bb[_0x9404('0x1d')]('§');_0x411bab=_0x193536[0x0];if(_0x193536[_0x9404('0x1c')]==0x2)_0x504e8b=_0x193536[0x1];return new Promise(function(_0x2c13c0,_0x5595f2){return db[_0x9404('0x1e')]['findOne']({'where':{'CmContactId':_0x322cfc,'item':_0x411bab}})['then'](function(_0x1c2169){if(_0x1c2169){return db[_0x9404('0x1e')][_0x9404('0x1f')]({'ItemTypeId':_0x224c67,'description':_0x504e8b,'OrderBy':_0x419221},{'where':{'CmContactId':_0x322cfc,'item':_0x411bab}})['then'](function(_0x4a098c){_0x2c13c0({'res':'updated'});});}else{return db[_0x9404('0x1e')][_0x9404('0x20')]({'CmContactId':_0x322cfc,'item':_0x411bab,'description':_0x504e8b,'ItemTypeId':_0x224c67,'OrderBy':_0x419221,'ItemClass':_0x9404('0x21')})['then'](function(_0x44db92){_0x2c13c0({'res':'inserted'});});}});});}function insertCmHopper(_0xcbaa9c,_0x3f5a05,_0x41edc1,_0x440526,_0x25aecf){var _0x53038c=[_0x9404('0x22'),'cm_contacts.scheduledat',_0x9404('0x23'),_0x9404('0x24'),_0x3f5a05+'.'+_0x440526,_0x9404('0x25'),_0x9404('0x26'),_0x9404('0x27'),_0x9404('0x28'),'\x22'+_0x25aecf+'\x22'];return squel[_0x9404('0x29')]()[_0x9404('0x2a')](_0x9404('0x2b'))[_0x9404('0x2c')](['phone',_0x9404('0x2d'),_0x9404('0x2e'),_0x9404('0x2f'),_0x440526,_0x9404('0x30'),'updatedAt',_0x9404('0x31'),_0x9404('0x32'),'recallme'],squel[_0x9404('0xf')]()[_0x9404('0x33')](_0x53038c)[_0x9404('0x12')](_0x3f5a05)[_0x9404('0x13')](_0x9404('0x34'),null,'cm_contacts.ListId\x20=\x20'+_0x3f5a05+_0x9404('0x35'))[_0x9404('0x13')](_0x41edc1,null,_0x41edc1+_0x9404('0x36')+_0x3f5a05+'.'+_0x440526)[_0x9404('0x15')](_0x3f5a05+_0x9404('0x37'),_0xcbaa9c)['where'](_0x9404('0x38'),NOW)[_0x9404('0x15')](_0x9404('0x39'),selectNotIn(_0x3f5a05,_0x41edc1,_0x440526,_0x9404('0x2b'),[_0x9404('0x3a'),_0x9404('0x3b')]))[_0x9404('0x15')](_0x9404('0x39'),selectNotIn(_0x3f5a05,_0x41edc1,_0x440526,_0x9404('0x2b'),[_0x9404('0x3a')])))[_0x9404('0x3c')]();}function insertCmHopperBlack(_0x59ddc4,_0x23f427,_0x23b6d5,_0x9d8b54){var _0x35c313=[_0x9404('0x22'),'cm_contacts.id',_0x9404('0x24'),_0x23f427+'.'+_0x9d8b54,_0x9404('0x25'),_0x9404('0x26')];return squel[_0x9404('0x29')]()[_0x9404('0x2a')](_0x9404('0x3d'))[_0x9404('0x2c')]([_0x9404('0x11'),_0x9404('0x2e'),'ListId',_0x9d8b54,_0x9404('0x30'),_0x9404('0x3e')],squel['select']()[_0x9404('0x33')](_0x35c313)[_0x9404('0x12')](_0x23f427)['join'](_0x9404('0x34'),null,_0x9404('0x3f')+_0x23f427+_0x9404('0x35'))[_0x9404('0x13')](_0x23b6d5,null,_0x23b6d5+_0x9404('0x36')+_0x23f427+'.'+_0x9d8b54)[_0x9404('0x15')](_0x23f427+'.CmListId\x20=\x20?',_0x59ddc4)[_0x9404('0x15')](_0x9404('0x38'),NOW)[_0x9404('0x15')](_0x9404('0x39'),squel[_0x9404('0xf')]()['field'](_0x9404('0x11'))[_0x9404('0x12')](_0x9404('0x3d'))['where']('ListId\x20=\x20?',_0x59ddc4)[_0x9404('0x15')](_0x9d8b54+_0x9404('0x14')+_0x23f427+'.'+_0x9d8b54)))[_0x9404('0x3c')]();}function insertTzCmHopper(_0x37811a,_0x57e45c,_0x38fec9,_0x1dda84,_0x58c1d5,_0x24ce97){var _0x46c368=[_0x9404('0x22'),_0x9404('0x40')+_0x24ce97+_0x9404('0x41'),_0x9404('0x23'),_0x9404('0x24'),_0x57e45c+'.'+_0x1dda84,'cm_contacts.createdAt','cm_contacts.updatedAt',_0x9404('0x27'),'cm_contacts.UserId','\x22'+_0x58c1d5+'\x22'];var _0x501a3d=squel[_0x9404('0x29')]()[_0x9404('0x2a')]('cm_hopper')[_0x9404('0x2c')](['phone',_0x9404('0x2d'),'ContactId',_0x9404('0x2f'),_0x1dda84,_0x9404('0x30'),'updatedAt',_0x9404('0x31'),_0x9404('0x32'),_0x9404('0x42')],squel[_0x9404('0xf')]()[_0x9404('0x33')](_0x46c368)[_0x9404('0x12')](_0x57e45c)['join'](_0x9404('0x34'),null,_0x9404('0x3f')+_0x57e45c+_0x9404('0x35'))[_0x9404('0x13')](_0x38fec9,null,_0x38fec9+_0x9404('0x36')+_0x57e45c+'.'+_0x1dda84)[_0x9404('0x13')](_0x24ce97,null,_0x24ce97+_0x9404('0x36')+_0x57e45c+'.'+_0x1dda84)[_0x9404('0x15')](_0x57e45c+_0x9404('0x37'),_0x37811a)['where'](_0x9404('0x38'),NOW)[_0x9404('0x15')](_0x9404('0x39'),selectNotIn(_0x57e45c,_0x38fec9,_0x1dda84,_0x9404('0x2b'),[_0x9404('0x3a'),_0x9404('0x3b')]))['where'](_0x9404('0x39'),selectNotIn(_0x57e45c,_0x38fec9,_0x1dda84,_0x9404('0x2b'),[_0x9404('0x3a')])))[_0x9404('0x3c')]();return _0x501a3d;}function insertTzCmHopperBlack(_0x5d9bd1,_0x416888,_0x23856b,_0x15fb8f){var _0x5b7f07=[_0x9404('0x22'),'cm_contacts.id',_0x9404('0x24'),_0x416888+'.'+_0x15fb8f,'cm_contacts.createdAt',_0x9404('0x26')];return squel[_0x9404('0x29')]()[_0x9404('0x2a')](_0x9404('0x3d'))[_0x9404('0x2c')]([_0x9404('0x11'),_0x9404('0x2e'),_0x9404('0x2f'),_0x15fb8f,_0x9404('0x30'),_0x9404('0x3e')],squel[_0x9404('0xf')]()['fields'](_0x5b7f07)[_0x9404('0x12')](_0x416888)[_0x9404('0x13')](_0x9404('0x34'),null,_0x9404('0x3f')+_0x416888+_0x9404('0x35'))[_0x9404('0x13')](_0x23856b,null,_0x23856b+_0x9404('0x36')+_0x416888+'.'+_0x15fb8f)[_0x9404('0x15')](_0x416888+'.CmListId\x20=\x20?',_0x5d9bd1)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x9404('0x15')](_0x9404('0x39'),squel['select']()[_0x9404('0x10')](_0x9404('0x11'))[_0x9404('0x12')](_0x9404('0x3d'))[_0x9404('0x15')](_0x9404('0x43'),_0x5d9bd1)[_0x9404('0x15')](_0x15fb8f+_0x9404('0x14')+_0x416888+'.'+_0x15fb8f)))['toString']();}function insertCmHopperAdditionalPhones(_0x91af23){var _0x3e7f77=[_0x9404('0x44'),_0x9404('0x45'),_0x9404('0x46'),_0x9404('0x47'),'cm_contact_has_items.updatedAt'];return squel[_0x9404('0x29')]()[_0x9404('0x2a')](_0x9404('0x48'))[_0x9404('0x2c')](['CmHopperId','phone',_0x9404('0x49'),'createdAt',_0x9404('0x3e')],squel[_0x9404('0xf')]()['fields'](_0x3e7f77)[_0x9404('0x12')]('cm_hopper')[_0x9404('0x13')](_0x9404('0x34'),null,_0x9404('0x4a'))[_0x9404('0x13')](_0x9404('0x4b'),null,_0x9404('0x4c'))[_0x9404('0x15')](_0x9404('0x4d'),_0x91af23)[_0x9404('0x15')](_0x9404('0x38'),NOW))[_0x9404('0x3c')]();}function insertCmContact(_0x4a9f40,_0x59ad28,_0x13aadc,_0x4b4e7e){var _0x3bd128=_['concat'](_[_0x9404('0x4e')](_0x4b4e7e),[_0x9404('0x2f'),_0x9404('0x4f'),'createdAt',_0x9404('0x3e')]);return squel['insert']()[_0x9404('0x2a')](_0x9404('0x34'))[_0x9404('0x2c')](_0x3bd128,squel[_0x9404('0xf')]()[_0x9404('0x33')](_0x3bd128)['from'](_0x59ad28)['where']('('+_0x13aadc[_0x9404('0x13')](',')+_0x9404('0x50'),squel[_0x9404('0xf')]()[_0x9404('0x33')](_0x13aadc)[_0x9404('0x12')]('cm_contacts')[_0x9404('0x15')](_0x9404('0x43'),_0x4a9f40)[_0x9404('0x15')](_0x9404('0x51')))['where']('id\x20IN\x20?',squel[_0x9404('0xf')]()[_0x9404('0x10')](_0x9404('0x52'),_0x9404('0x53'))[_0x9404('0x12')](_0x59ad28)[_0x9404('0x54')](_0x13aadc[_0x9404('0x13')](','))))[_0x9404('0x3c')]();}function handleStop(){logger[_0x9404('0x55')](_0x9404('0x56'));stopped=!![];}function handleUncaughtException(_0x14f10d){logger[_0x9404('0x57')](_0x14f10d[_0x9404('0x58')]);process[_0x9404('0x59')](0x1);}function handleError(_0x37e13f,_0x11e2ac){stats[_0x9404('0x5a')][_0x9404('0x19')]({'name':_0x11e2ac[_0x9404('0x5b')],'message':_0x11e2ac[_0x9404('0x58')],'row':_0x37e13f});}function handleQuery(_0x448873){logger[_0x9404('0x55')](_0x448873);return db[_0x9404('0x5c')][_0x9404('0x5d')](_0x448873)[_0x9404('0x5e')](function(_0x2670be){results[_0x9404('0x19')](_0x2670be);})['catch'](function(_0x4b08f2){logger[_0x9404('0x57')](_0x4b08f2[_0x9404('0x58')]);});}function updateTzCampaigns(_0x9484a3){return new Promise(function(_0x574562,_0x1dd2ab){var _0x15fe5b=squel[_0x9404('0xf')]()['fields']([_0x9404('0x5f'),_0x9404('0x60')])[_0x9404('0x12')](_0x9404('0x61'))[_0x9404('0x13')]('campaigns_has_cm_lists',null,_0x9404('0x62'))[_0x9404('0x15')](_0x9404('0x63')+_0x9484a3);db['sequelize'][_0x9404('0x5d')](_0x15fe5b[_0x9404('0x3c')]())['spread'](function(_0x1e8652){var _0x2a8bd9=[];for(var _0x57ecf8=0x0;_0x57ecf8<_0x1e8652[_0x9404('0x1c')];_0x57ecf8++){_0x2a8bd9[_0x9404('0x19')](getTimezoneData(_0x1e8652[_0x57ecf8],tmp_campaigns));}BPromise['all'](_0x2a8bd9)[_0x9404('0x18')](function(){_0x574562({'val':0x1});});})[_0x9404('0x64')](function(_0x547fb8){logger[_0x9404('0x57')](_0x547fb8[_0x9404('0x58')]);_0x574562({'val':0x0});});});}function updateTzVoiceQueues(_0x1aca27){return new Promise(function(_0x29b203,_0x2dd55f){var _0x5a0f74=squel[_0x9404('0xf')]()[_0x9404('0x33')]([_0x9404('0x65'),_0x9404('0x66')])[_0x9404('0x12')](_0x9404('0x67'))[_0x9404('0x13')]('voice_queues_has_cm_lists',null,_0x9404('0x68'))[_0x9404('0x15')](_0x9404('0x69')+_0x1aca27);db[_0x9404('0x5c')][_0x9404('0x5d')](_0x5a0f74[_0x9404('0x3c')]())[_0x9404('0x5e')](function(_0x362bf4){var _0x1aa42e=[];for(var _0xadf5b0=0x0;_0xadf5b0<_0x362bf4['length'];_0xadf5b0++){_0x1aa42e[_0x9404('0x19')](getTimezoneData(_0x362bf4[_0xadf5b0],tmp_voice_queues));}BPromise[_0x9404('0x1a')](_0x1aa42e)[_0x9404('0x18')](function(){_0x29b203({'val':0x1});});})[_0x9404('0x64')](function(_0x384943){logger[_0x9404('0x57')](_0x384943[_0x9404('0x58')]);_0x29b203({'val':0x0});});});}function getTimezoneData(_0x812a19,_0x431ff8){return new Promise(function(_0x44c539,_0x2f306f){var _0x4727fd=shared['timezones'];var _0x4790c6=_0x4727fd[_0x812a19[_0x9404('0x6a')]];if(_[_0x9404('0x6b')](_0x4790c6)){_0x44c539({'ret':0x1});}else{var _0x24b0fb=_0x4790c6['utcOffset'];var _0x5924db=squel['insert']()[_0x9404('0x2a')](_0x431ff8)[_0x9404('0x6c')]('id',_0x812a19['id'])['set'](_0x9404('0x6d'),_0x24b0fb)['set'](_0x9404('0x6a'),_0x812a19[_0x9404('0x6a')])[_0x9404('0x3c')]();return db[_0x9404('0x5c')][_0x9404('0x5d')](_0x5924db)['spread'](function(_0x51cf9e){_0x44c539({'ret':0x1});})['catch'](function(_0x59f6fb){logger['error'](_0x59f6fb[_0x9404('0x58')]);_0x2f306f({'ret':0x1});});}});}function handleTZQuery(_0x54246c){logger[_0x9404('0x55')](_0x54246c);return db[_0x9404('0x5c')][_0x9404('0x5d')](_0x54246c)[_0x9404('0x5e')](function(_0x4fa232){})['catch'](function(_0x14fc99){logger[_0x9404('0x57')](_0x14fc99[_0x9404('0x58')]);});}function main(_0x257740,_0x52a1ac,_0x7e3295,_0x2f238c){logger['info'](_0x9404('0x6e'),_0x257740,JSON['stringify'](_0x52a1ac));process[_0x9404('0x6f')](_0x9404('0x70'));var _0x2c746c=_0x52a1ac['binding'];var _0x438ab1=_[_0x9404('0x71')](_0x2c746c);var _0x4b5fd5=_0x52a1ac[_0x9404('0x72')];var _0x4e36d8=path['join'](config['root'],_0x9404('0x73'),_0x4b5fd5+_0x9404('0x74'));hasTZ=_['keys'](_0x2c746c)[_0x9404('0x75')](_0x9404('0x6a'));var _0x552b30=_[_0x9404('0x4e')](_0x2c746c)['join']();logger[_0x9404('0x55')]('header',_0x552b30);db['ContactItemType'][_0x9404('0x17')]({'raw':!![],'attributes':['id','name']})[_0x9404('0x18')](function(_0x39ec13){for(var _0x285d98=0x0;_0x285d98<_0x39ec13[_0x9404('0x1c')];_0x285d98++){if(_0x39ec13[_0x285d98][_0x9404('0x76')]in _0x2c746c){contactItemTypes[_0x9404('0x19')](_0x39ec13[_0x285d98]);delete _0x438ab1[_0x39ec13[_0x285d98]['name']];hasAdditionalPhones=!![];}for(var _0x4d745f in _0x2c746c){if(_0x39ec13[_0x285d98][_0x9404('0x76')]+'_description'===_0x4d745f){phoneDescriptions[_0x9404('0x19')]({'itemTypeId':_0x39ec13[_0x285d98]['id'],'description':_0x4d745f});delete _0x438ab1[_0x4d745f];}}}if(hasAdditionalPhones)_0x438ab1[_0x9404('0x1b')]='';var _0x3b97dd=_[_0x9404('0x4e')](_0x438ab1)[_0x9404('0x13')]();logger[_0x9404('0x55')]('header',_0x3b97dd);fs[_0x9404('0x77')](_0x4e36d8,_0x3b97dd+'\x0a');Papa[_0x9404('0x78')](fs[_0x9404('0x79')](_0x257740),{'header':!![],'skipEmptyLines':!![],'step':function(_0x35738f,_0x18810d){try{for(var _0x3c210f=0x0,_0x2d1766=[];_0x3c210f<_0x35738f[_0x9404('0x7a')][_0x9404('0x1c')];_0x3c210f++){stats[_0x9404('0x7b')]+=0x1;if(_0x35738f[_0x9404('0x5a')][_0x3c210f]){handleError(_0x35738f['data'][_0x3c210f],_0x35738f['errors'][_0x3c210f]);}else{var _0x4c7bfe=[];var _0x443ade=[];var _0x33872d={};for(var _0x90f401 in _0x2c746c){let _0xbd7798=contactItemTypes['find'](_0x59d528=>_0x59d528[_0x9404('0x76')]===_0x90f401);let _0x3dddc4=contactItemTypes[_0x9404('0x7c')](_0x595f75=>_0x595f75[_0x9404('0x76')]+_0x9404('0x7d')===_0x90f401);if(_[_0x9404('0x6b')](_0xbd7798)&&_[_0x9404('0x6b')](_0x3dddc4)){if(_0x2c746c[_0x9404('0x7e')](_0x90f401)){if(_0x35738f['data'][_0x3c210f][_0x2c746c[_0x90f401]]){var _0x294380=_[_0x9404('0x7f')](_0x35738f[_0x9404('0x7a')][_0x3c210f][_0x2c746c[_0x90f401]][_0x9404('0x80')](/"/g,'\x27'));switch(_0x90f401){case _0x9404('0x2d'):var _0x39c8be=moment(_0x294380,_0x9404('0xd'),!![]);if(_0x39c8be['isValid']()){_0x2d1766[_0x9404('0x19')]('\x22'+_0x294380+'\x22');}else{_0x4c7bfe[_0x9404('0x19')](_0x9404('0x81'));}break;case'priority':var _0x30c585=parseInt(_0x294380);_0x294380=_[_0x9404('0x82')](_0x30c585)||_0x30c585<0x0||_0x30c585>0x4?_0x2f238c?0x3:0x2:_0x30c585;_0x2d1766['push']('\x22'+_0x294380+'\x22');break;case _0x9404('0x32'):var _0x48c197=parseInt(_0x294380);if(_[_0x9404('0x83')](_0x48c197)&&_[_0x9404('0x75')](_0x7e3295,_0x48c197)){_0x2d1766['push']('\x22'+_0x48c197+'\x22');}else{_0x4c7bfe[_0x9404('0x19')](_0x9404('0x84'));}break;case _0x9404('0x85'):if(isEmail(_0x294380)){_0x2d1766['push']('\x22'+_0x294380+'\x22');}else{_0x4c7bfe[_0x9404('0x19')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x322d3f=moment(_0x294380,_0x9404('0x86'),!![]);if(_0x322d3f[_0x9404('0x87')]()){_0x2d1766['push']('\x22'+_0x294380+'\x22');}else{_0x4c7bfe[_0x9404('0x19')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x9404('0x6a'):var _0x36dbfd=shared[_0x9404('0x88')];var _0x4ff5cd=_0x36dbfd[_0x294380];if(!_[_0x9404('0x6b')](_0x4ff5cd)){var _0x5c5347=_0x4ff5cd['utcOffset'];_0x2d1766[_0x9404('0x19')]('\x22'+_0x294380+'\x22');_0x2d1766[_0x9404('0x19')]('\x22'+_0x5c5347+'\x22');}break;default:_0x2d1766[_0x9404('0x19')]('\x22'+_0x294380+'\x22');}}else{switch(_0x90f401){case _0x9404('0x89'):case _0x9404('0x11'):_0x4c7bfe[_0x9404('0x19')](_0x90f401+'\x20not\x20specified');break;default:_0x2d1766[_0x9404('0x19')]('\x22\x22');}}}}else{var _0x1cdfc4='';if(!_['isNil'](_0xbd7798)){if(!_0x33872d[_0x9404('0x7e')](_0xbd7798['id'])){if(!_[_0x9404('0x6b')](_0x35738f[_0x9404('0x7a')][_0x3c210f][_0x2c746c[_0x90f401]])){var _0x294380=_[_0x9404('0x7f')](_0x35738f['data'][_0x3c210f][_0x2c746c[_0x90f401]][_0x9404('0x80')](/"/g,'\x27'));var _0x315c37=phoneDescriptions[_0x9404('0x7c')](_0x12addf=>_0x12addf[_0x9404('0x8a')]===_0xbd7798['id']);if(!_[_0x9404('0x6b')](_0x315c37)){var _0x36e548=_[_0x9404('0x7f')](_0x35738f['data'][_0x3c210f][_0x2c746c[_0x315c37['description']]][_0x9404('0x80')](/"/g,'\x27'));if(!_['isNil'](_0x36e548))_0x294380=_0x294380+'§'+_0x36e548;}if(_0x1cdfc4=='')_0x1cdfc4=_0x294380;else _0x1cdfc4+='|'+_0x294380;}_0x443ade[_0x9404('0x19')](_0xbd7798['id']+':'+_0x1cdfc4);_0x33872d[_0xbd7798['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2d1766[_0x9404('0x19')]('\x22'+_0x443ade[_0x9404('0x13')](';')+'\x22');}if(_0x4c7bfe[_0x9404('0x1c')]){handleError(_0x35738f[_0x9404('0x7a')][_0x3c210f],{'code':_0x9404('0x8b'),'message':_0x4c7bfe[_0x9404('0x13')]()});}else{fs['appendFileSync'](_0x4e36d8,_0x2d1766['join']()+'\x0a');}_0x2d1766=[];}if(!(stats[_0x9404('0x7b')]%0xc8)){socket['emit'](_0x9404('0x8c')+_0x4b5fd5,stats);stats[_0x9404('0x5a')]=[];}}if(stopped){logger[_0x9404('0x55')](_0x9404('0x8d'));_0x18810d[_0x9404('0x8e')]();}}catch(_0x3b3688){handleError(_0x35738f['data'][_0x3c210f],{'code':'SystemError','message':_0x3b3688[_0x9404('0x58')]});logger[_0x9404('0x57')]('step',_0x3b3688[_0x9404('0x58')]);}},'complete':function(){try{var _0x5e9048=[];var _0x4084a4=[];var _0x5381a3=_0x9404('0x34');if(_0x52a1ac[_0x9404('0x8f')]&&_0x52a1ac[_0x9404('0x8f')][_0x9404('0x1c')]){_0x5381a3=_0x9404('0x90')+_0x4b5fd5;_0x5e9048[_0x9404('0x19')](_0x9404('0x91')+_0x5381a3+_0x9404('0x92'));}tmp_campaigns='campaigns_'+_0x4b5fd5;tmp_voice_queues='voice_queues_'+_0x4b5fd5;_0x4084a4[_0x9404('0x19')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x9404('0x93'));_0x4084a4[_0x9404('0x19')](_0x9404('0x91')+tmp_voice_queues+_0x9404('0x93'));BPromise['each'](_0x4084a4,handleTZQuery)[_0x9404('0x18')](function(_0x271ba0){updateTzCampaigns(_0x52a1ac['ListId'])[_0x9404('0x18')](function(_0x1e1d64){updateTzVoiceQueues(_0x52a1ac[_0x9404('0x2f')])[_0x9404('0x18')](function(_0x1374cc){if(hasTZ)_0x3b97dd=_0x3b97dd['replace'](_0x9404('0x6a'),'dialTimezone,utcOffset');var _0x5840db=util['format'](_0x9404('0x94'),_0x4e36d8,_0x5381a3,_0x3b97dd,_0x52a1ac[_0x9404('0x2f')],_0x52a1ac[_0x9404('0x4f')]||null,NOW,NOW);if(_['isNil'](_0x2c746c[_0x9404('0x2d')])){_0x5840db+=_0x9404('0x95');}_0x5e9048['push'](_0x5840db);if(_0x52a1ac[_0x9404('0x8f')]&&_0x52a1ac[_0x9404('0x8f')][_0x9404('0x1c')]){_0x5e9048[_0x9404('0x19')](insertCmContact(_0x52a1ac['ListId'],_0x5381a3,_0x52a1ac[_0x9404('0x8f')],_0x2c746c));_0x5e9048[_0x9404('0x19')](_0x9404('0x96')+_0x5381a3+';');}BPromise['each'](_0x5e9048,handleQuery)[_0x9404('0x18')](function(_0x2f5e98){BPromise[_0x9404('0x1a')]([handleAdditionalPhones()])['then'](function(){_0x5e9048=[];for(var _0x37edd5=0x0;_0x37edd5<promisesAdditionalPhones[_0x9404('0x1c')];_0x37edd5++){if(promisesAdditionalPhones[_0x37edd5]['phone']!='§'){_0x5e9048[_0x9404('0x19')](createAdditionalPhone(promisesAdditionalPhones[_0x37edd5][_0x9404('0x97')],promisesAdditionalPhones[_0x37edd5][_0x9404('0x98')],promisesAdditionalPhones[_0x37edd5][_0x9404('0x11')],promisesAdditionalPhones[_0x37edd5][_0x9404('0x99')]));}}BPromise[_0x9404('0x1a')](_0x5e9048)['then'](function(){_0x5e9048=[];if(hasTZ){_0x5e9048[_0x9404('0x19')](insertTzCmHopper(_0x52a1ac[_0x9404('0x2f')],_0x9404('0x9a'),'voice_queues',_0x9404('0x9b'),_0x2f238c,tmp_voice_queues));_0x5e9048[_0x9404('0x19')](insertTzCmHopperBlack(_0x52a1ac[_0x9404('0x2f')],_0x9404('0x9c'),'voice_queues',_0x9404('0x9b')));_0x5e9048[_0x9404('0x19')](insertTzCmHopper(_0x52a1ac[_0x9404('0x2f')],_0x9404('0x9d'),_0x9404('0x61'),'CampaignId',_0x2f238c,tmp_campaigns));_0x5e9048['push'](insertTzCmHopperBlack(_0x52a1ac[_0x9404('0x2f')],_0x9404('0x9e'),_0x9404('0x61'),_0x9404('0x9f')));_0x5e9048[_0x9404('0x19')](insertCmHopperAdditionalPhones(_0x52a1ac[_0x9404('0x2f')]));}else{_0x5e9048['push'](insertCmHopper(_0x52a1ac['ListId'],_0x9404('0x9a'),_0x9404('0x67'),_0x9404('0x9b'),_0x2f238c));_0x5e9048['push'](insertCmHopperBlack(_0x52a1ac[_0x9404('0x2f')],'voice_queues_has_cm_blacklists',_0x9404('0x67'),_0x9404('0x9b')));_0x5e9048[_0x9404('0x19')](insertCmHopper(_0x52a1ac['ListId'],_0x9404('0x9d'),_0x9404('0x61'),_0x9404('0x9f'),_0x2f238c));_0x5e9048[_0x9404('0x19')](insertCmHopperBlack(_0x52a1ac[_0x9404('0x2f')],_0x9404('0x9e'),_0x9404('0x61'),'CampaignId'));_0x5e9048[_0x9404('0x19')](insertCmHopperAdditionalPhones(_0x52a1ac['ListId']));}_0x5e9048[_0x9404('0x19')](_0x9404('0x96')+tmp_campaigns+';');_0x5e9048[_0x9404('0x19')]('DROP\x20TABLE\x20'+tmp_voice_queues+';');BPromise['each'](_0x5e9048,handleQuery)[_0x9404('0x18')](function(_0x4f7246){stats[_0x9404('0xa0')]=!![];stats[_0x9404('0xa1')]=_0x52a1ac[_0x9404('0x8f')]&&_0x52a1ac['duplicates'][_0x9404('0x1c')]?results[0x2][_0x9404('0xa1')]:results[0x0]['affectedRows'];socket[_0x9404('0xa2')](_0x9404('0x8c')+_0x4b5fd5,stats);fs[_0x9404('0xa3')](_0x257740);fs[_0x9404('0xa3')](_0x4e36d8);process[_0x9404('0x59')](0x0);})['catch'](function(_0x2e8f5f){logger['error'](_0x2e8f5f[_0x9404('0x58')]);process[_0x9404('0x59')](0x1);});});});})[_0x9404('0x64')](function(_0x1245d9){logger[_0x9404('0x57')](_0x1245d9['message']);process[_0x9404('0x59')](0x1);});});});});}catch(_0x1ec576){logger[_0x9404('0x57')](_0x9404('0xa4'),_0x1ec576[_0x9404('0x58')]);process[_0x9404('0x59')](0x1);}},'error':function(_0x2ddf8c,_0x2d3718,_0x51275c,_0x3615c3){throw new Error(_0x3615c3);}});});}function validate(){if(process['argv']&&process[_0x9404('0xa5')][_0x9404('0x1c')]<0x4){throw new Error(_0x9404('0xa6'));}var _0x54e5ac=path[_0x9404('0x13')](config[_0x9404('0xa7')],_0x9404('0x73'),process[_0x9404('0xa5')][0x2]);if(!fs['existsSync'](_0x54e5ac)){throw new Error(_0x9404('0xa8'));}var _0xb4d4f7={};try{_0xb4d4f7=JSON['parse'](process[_0x9404('0xa5')][0x3]);if(!_0xb4d4f7[_0x9404('0xa9')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0xb4d4f7['binding']['phone']){throw new Error(_0x9404('0xaa'));}if(!_0xb4d4f7[_0x9404('0xa9')][_0x9404('0x89')]){throw new Error(_0x9404('0xab'));}var _0xe6d2ac=0x0;if(_0xb4d4f7[_0x9404('0xa9')][_0x9404('0x32')]){_0xe6d2ac=0x1;}if(!_0xb4d4f7['ListId']){throw new Error(_0x9404('0xac'));}}catch(_0x4b80d6){throw new Error('body\x20id\x20mandatory');}var _0x14f7f0=[];try{_0x14f7f0=_[_0x9404('0xad')](JSON[_0x9404('0x78')](process[_0x9404('0xa5')][0x4]),'id');}catch(_0x130095){logger[_0x9404('0x55')](_0x9404('0xae'));}main(_0x54e5ac,_0xb4d4f7,_0x14f7f0,_0xe6d2ac);}validate();process['on'](_0x9404('0xaf'),handleStop);process['on'](_0x9404('0xb0'),handleUncaughtException);
\ No newline at end of file
+var _0xbc00=['code','sequelize','query','spread','campaigns.id','campaigns','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','catch','dialTimezone','utcOffset','set','main','start','socket_timestamp','root','.csv','header','ContactItemType','name','_description','createReadStream','data','rows','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','firstName','\x20not\x20specified','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','campaigns_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink','exit','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','server/files/tmp','parse','binding\x20doesn\x27t\x20exists','binding','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','util','moment','squel','ioredis','../../../config/environment','../../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','field','from','join','.id\x20=\x20','where','CmContact','findAll','AdditionalPhones','length','push','all','then','split','isNil','CmContactHasItem','findOne','update','updated','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','cm_hopper','fromQuery','phone','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','into','cm_hopper_black','fields','cm_contacts','.CmListId','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','\x20=\x20','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','min_id','group','info','Received\x20SIGINT','error','message','errors'];(function(_0x353bf6,_0x16239b){var _0xd1511c=function(_0x261058){while(--_0x261058){_0x353bf6['push'](_0x353bf6['shift']());}};_0xd1511c(++_0x16239b);}(_0xbc00,0x107));var _0x0bc0=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0xbc00[_0x469a3c];return _0x968f4;};'use strict';var fs=require('fs');var path=require(_0x0bc0('0x0'));var _=require(_0x0bc0('0x1'));var Papa=require('papaparse');var util=require(_0x0bc0('0x2'));var BPromise=require('bluebird');var moment=require(_0x0bc0('0x3'));var squel=require(_0x0bc0('0x4'));var Redis=require(_0x0bc0('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x0bc0('0x6'));var shared=require(_0x0bc0('0x7'));var logger=require('../../../config/logger')('import');config[_0x0bc0('0x8')]=_[_0x0bc0('0x9')](config[_0x0bc0('0x8')],{'host':_0x0bc0('0xa'),'port':0x18eb});var socket=require(_0x0bc0('0xb'))(new Redis(config[_0x0bc0('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x0bc0('0xc')](_0x0bc0('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x0bc0('0xc')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0xf20ed5){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'](_0xf20ed5);}function selectNotIn(_0x235ceb,_0x2883b7,_0x28e259,_0x3a60d1,_0x2b6f55){return squel[_0x0bc0('0xe')]()[_0x0bc0('0xf')]('phone')[_0x0bc0('0x10')](_0x3a60d1)[_0x0bc0('0x11')](_0x2883b7,null,_0x2883b7+_0x0bc0('0x12')+_0x3a60d1+'.'+_0x28e259)[_0x0bc0('0x13')](_0x3a60d1+'.'+_0x28e259+'\x20=\x20'+_0x235ceb+'.'+_0x28e259)[_0x0bc0('0x13')](_0x2883b7+'.dialCheckDuplicateType\x20IN\x20('+_0x2b6f55[_0x0bc0('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x211047,_0x3335d9){promisesAdditionalPhones=[];return db[_0x0bc0('0x14')][_0x0bc0('0x15')]({'raw':!![],'attributes':['id',_0x0bc0('0x16')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x3cd7ee){if(_0x3cd7ee!==null){var _0xa4eb65=[];for(var _0x516be4=0x0;_0x516be4<_0x3cd7ee[_0x0bc0('0x17')];_0x516be4++){var _0x1a8bd6=_0x3cd7ee[_0x516be4];_0xa4eb65[_0x0bc0('0x18')](insertAdditionalPhones(_0x1a8bd6));}}Promise[_0x0bc0('0x19')](_0xa4eb65)[_0x0bc0('0x1a')](function(){_0x211047({'val':0x1});});});});}function insertAdditionalPhones(_0x160395){return new Promise(function(_0x361a7b,_0x528ca0){var _0x378b25=_0x160395[_0x0bc0('0x16')];var _0x3d5ccf=_0x378b25[_0x0bc0('0x1b')](';');var _0x5d91f0=[];orderBy=0x0;for(var _0x2ed752=0x0;_0x2ed752<_0x3d5ccf[_0x0bc0('0x17')];_0x2ed752++){_0x5d91f0[_0x0bc0('0x18')](splitAdditionalPhone(_0x160395['id'],_0x3d5ccf[_0x2ed752]));}Promise['all'](_0x5d91f0)[_0x0bc0('0x1a')](function(){_0x361a7b({'val':_0x3d5ccf[_0x0bc0('0x17')]});});});}function splitAdditionalPhone(_0x38bdee,_0xa61eaf){return new Promise(function(_0x45cdc3,_0xc7eba4){var _0x4d86eb=_0xa61eaf[_0x0bc0('0x1b')](':');var _0x1888f7=_0x4d86eb[0x0];var _0x300599=_0x4d86eb[0x1];if(!_[_0x0bc0('0x1c')](_0x300599)){var _0x3ac96c=_0x300599[_0x0bc0('0x1b')]('|');var _0x223cc7=[];for(var _0xa94c49=0x0;_0xa94c49<_0x3ac96c[_0x0bc0('0x17')];_0xa94c49++){if(_0x3ac96c[_0xa94c49]!==''){var _0x21e844=_['filter'](promisesAdditionalPhones,{'contactId':_0x38bdee,'phone':_0x3ac96c[_0xa94c49]});if(_0x21e844[_0x0bc0('0x17')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x38bdee,'contactTypeId':_0x1888f7,'phone':_0x3ac96c[_0xa94c49],'orderBy':orderBy});}}}_0x45cdc3({'ok':0x1});}else _0x45cdc3({'res':0x0});});}function createAdditionalPhone(_0x412309,_0x17ba34,_0x3dcc08,_0x382f2e){var _0x40c5f5='';var _0x4cd7d1='';var _0x1a11ed=_0x3dcc08[_0x0bc0('0x1b')]('§');_0x40c5f5=_0x1a11ed[0x0];if(_0x1a11ed[_0x0bc0('0x17')]==0x2)_0x4cd7d1=_0x1a11ed[0x1];return new Promise(function(_0x2b03f9,_0x704469){return db[_0x0bc0('0x1d')][_0x0bc0('0x1e')]({'where':{'CmContactId':_0x412309,'item':_0x40c5f5}})[_0x0bc0('0x1a')](function(_0x314a52){if(_0x314a52){return db[_0x0bc0('0x1d')][_0x0bc0('0x1f')]({'ItemTypeId':_0x17ba34,'description':_0x4cd7d1,'OrderBy':_0x382f2e},{'where':{'CmContactId':_0x412309,'item':_0x40c5f5}})['then'](function(_0x1c4e43){_0x2b03f9({'res':_0x0bc0('0x20')});});}else{return db[_0x0bc0('0x1d')]['create']({'CmContactId':_0x412309,'item':_0x40c5f5,'description':_0x4cd7d1,'ItemTypeId':_0x17ba34,'OrderBy':_0x382f2e,'ItemClass':_0x0bc0('0x21')})[_0x0bc0('0x1a')](function(_0x13ecc5){_0x2b03f9({'res':_0x0bc0('0x22')});});}});});}function insertCmHopper(_0x56e9dd,_0x2fbfad,_0x1c378e,_0x2fa4e1,_0x72a5a9){var _0x1733d6=[_0x0bc0('0x23'),_0x0bc0('0x24'),'cm_contacts.id','cm_contacts.ListId',_0x2fbfad+'.'+_0x2fa4e1,'cm_contacts.createdAt',_0x0bc0('0x25'),_0x0bc0('0x26'),_0x0bc0('0x27'),'\x22'+_0x72a5a9+'\x22'];return squel[_0x0bc0('0x28')]()['into'](_0x0bc0('0x29'))[_0x0bc0('0x2a')]([_0x0bc0('0x2b'),_0x0bc0('0x2c'),_0x0bc0('0x2d'),_0x0bc0('0x2e'),_0x2fa4e1,_0x0bc0('0x2f'),_0x0bc0('0x30'),_0x0bc0('0x31'),_0x0bc0('0x32'),_0x0bc0('0x33')],squel[_0x0bc0('0xe')]()['fields'](_0x1733d6)['from'](_0x2fbfad)[_0x0bc0('0x11')]('cm_contacts',null,_0x0bc0('0x34')+_0x2fbfad+'.CmListId')['join'](_0x1c378e,null,_0x1c378e+_0x0bc0('0x12')+_0x2fbfad+'.'+_0x2fa4e1)[_0x0bc0('0x13')](_0x2fbfad+'.CmListId\x20=\x20?',_0x56e9dd)[_0x0bc0('0x13')](_0x0bc0('0x35'),NOW)['where'](_0x0bc0('0x36'),selectNotIn(_0x2fbfad,_0x1c378e,_0x2fa4e1,'cm_hopper',[_0x0bc0('0x37'),_0x0bc0('0x38')]))[_0x0bc0('0x13')](_0x0bc0('0x36'),selectNotIn(_0x2fbfad,_0x1c378e,_0x2fa4e1,_0x0bc0('0x29'),[_0x0bc0('0x37')])))[_0x0bc0('0x39')]();}function insertCmHopperBlack(_0x187883,_0x31d7a3,_0x3b0fd0,_0x4bbbd8){var _0x5ed9ab=[_0x0bc0('0x23'),_0x0bc0('0x3a'),_0x0bc0('0x3b'),_0x31d7a3+'.'+_0x4bbbd8,_0x0bc0('0x3c'),_0x0bc0('0x25')];return squel[_0x0bc0('0x28')]()[_0x0bc0('0x3d')](_0x0bc0('0x3e'))[_0x0bc0('0x2a')]([_0x0bc0('0x2b'),'ContactId',_0x0bc0('0x2e'),_0x4bbbd8,_0x0bc0('0x2f'),_0x0bc0('0x30')],squel['select']()[_0x0bc0('0x3f')](_0x5ed9ab)['from'](_0x31d7a3)['join'](_0x0bc0('0x40'),null,_0x0bc0('0x34')+_0x31d7a3+_0x0bc0('0x41'))[_0x0bc0('0x11')](_0x3b0fd0,null,_0x3b0fd0+_0x0bc0('0x12')+_0x31d7a3+'.'+_0x4bbbd8)[_0x0bc0('0x13')](_0x31d7a3+'.CmListId\x20=\x20?',_0x187883)[_0x0bc0('0x13')](_0x0bc0('0x35'),NOW)[_0x0bc0('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x0bc0('0xe')]()[_0x0bc0('0xf')](_0x0bc0('0x2b'))['from'](_0x0bc0('0x3e'))[_0x0bc0('0x13')](_0x0bc0('0x42'),_0x187883)[_0x0bc0('0x13')](_0x4bbbd8+'\x20=\x20'+_0x31d7a3+'.'+_0x4bbbd8)))[_0x0bc0('0x39')]();}function insertTzCmHopper(_0x202df9,_0x58b63c,_0x3a354f,_0x40278c,_0x567b9b,_0x16425e){var _0x4f9eb9=[_0x0bc0('0x23'),_0x0bc0('0x43')+_0x16425e+_0x0bc0('0x44'),_0x0bc0('0x3a'),_0x0bc0('0x3b'),_0x58b63c+'.'+_0x40278c,_0x0bc0('0x3c'),'cm_contacts.updatedAt',_0x0bc0('0x26'),_0x0bc0('0x27'),'\x22'+_0x567b9b+'\x22'];var _0x55fbc1=squel['insert']()[_0x0bc0('0x3d')](_0x0bc0('0x29'))[_0x0bc0('0x2a')]([_0x0bc0('0x2b'),_0x0bc0('0x2c'),_0x0bc0('0x2d'),_0x0bc0('0x2e'),_0x40278c,'createdAt','updatedAt',_0x0bc0('0x31'),_0x0bc0('0x32'),_0x0bc0('0x33')],squel[_0x0bc0('0xe')]()[_0x0bc0('0x3f')](_0x4f9eb9)['from'](_0x58b63c)['join'](_0x0bc0('0x40'),null,_0x0bc0('0x34')+_0x58b63c+_0x0bc0('0x41'))[_0x0bc0('0x11')](_0x3a354f,null,_0x3a354f+_0x0bc0('0x12')+_0x58b63c+'.'+_0x40278c)[_0x0bc0('0x11')](_0x16425e,null,_0x16425e+_0x0bc0('0x12')+_0x58b63c+'.'+_0x40278c)['where'](_0x58b63c+'.CmListId\x20=\x20?',_0x202df9)[_0x0bc0('0x13')](_0x0bc0('0x35'),NOW)['where'](_0x0bc0('0x36'),selectNotIn(_0x58b63c,_0x3a354f,_0x40278c,_0x0bc0('0x29'),['\x22always\x22',_0x0bc0('0x38')]))[_0x0bc0('0x13')](_0x0bc0('0x36'),selectNotIn(_0x58b63c,_0x3a354f,_0x40278c,_0x0bc0('0x29'),[_0x0bc0('0x37')])))['toString']();return _0x55fbc1;}function insertTzCmHopperBlack(_0x298ff7,_0x5d1645,_0x232818,_0x3217a5){var _0x242389=[_0x0bc0('0x23'),_0x0bc0('0x3a'),'cm_contacts.ListId',_0x5d1645+'.'+_0x3217a5,'cm_contacts.createdAt',_0x0bc0('0x25')];return squel[_0x0bc0('0x28')]()[_0x0bc0('0x3d')](_0x0bc0('0x3e'))[_0x0bc0('0x2a')]([_0x0bc0('0x2b'),_0x0bc0('0x2d'),_0x0bc0('0x2e'),_0x3217a5,_0x0bc0('0x2f'),_0x0bc0('0x30')],squel[_0x0bc0('0xe')]()[_0x0bc0('0x3f')](_0x242389)[_0x0bc0('0x10')](_0x5d1645)[_0x0bc0('0x11')](_0x0bc0('0x40'),null,_0x0bc0('0x34')+_0x5d1645+_0x0bc0('0x41'))['join'](_0x232818,null,_0x232818+'.id\x20=\x20'+_0x5d1645+'.'+_0x3217a5)['where'](_0x5d1645+'.CmListId\x20=\x20?',_0x298ff7)['where'](_0x0bc0('0x35'),NOW)[_0x0bc0('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x0bc0('0xe')]()[_0x0bc0('0xf')]('phone')['from'](_0x0bc0('0x3e'))[_0x0bc0('0x13')]('ListId\x20=\x20?',_0x298ff7)[_0x0bc0('0x13')](_0x3217a5+_0x0bc0('0x45')+_0x5d1645+'.'+_0x3217a5)))[_0x0bc0('0x39')]();}function insertCmHopperAdditionalPhones(_0x3549bd){var _0x4350b6=[_0x0bc0('0x46'),_0x0bc0('0x47'),'cm_contact_has_items.OrderBy',_0x0bc0('0x48'),_0x0bc0('0x49')];return squel[_0x0bc0('0x28')]()[_0x0bc0('0x3d')](_0x0bc0('0x4a'))[_0x0bc0('0x2a')]([_0x0bc0('0x4b'),_0x0bc0('0x2b'),_0x0bc0('0x4c'),_0x0bc0('0x2f'),_0x0bc0('0x30')],squel['select']()['fields'](_0x4350b6)[_0x0bc0('0x10')](_0x0bc0('0x29'))['join']('cm_contacts',null,_0x0bc0('0x4d'))['join'](_0x0bc0('0x4e'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x0bc0('0x13')]('cm_hopper.ListId\x20=\x20?',_0x3549bd)[_0x0bc0('0x13')](_0x0bc0('0x35'),NOW))[_0x0bc0('0x39')]();}function insertCmContact(_0x4a23b6,_0x190aa6,_0x54ca1d,_0x21e556){var _0x475acb=_[_0x0bc0('0x4f')](_[_0x0bc0('0x50')](_0x21e556),['ListId',_0x0bc0('0x51'),_0x0bc0('0x2f'),'updatedAt']);return squel['insert']()[_0x0bc0('0x3d')]('cm_contacts')[_0x0bc0('0x2a')](_0x475acb,squel[_0x0bc0('0xe')]()[_0x0bc0('0x3f')](_0x475acb)[_0x0bc0('0x10')](_0x190aa6)[_0x0bc0('0x13')]('('+_0x54ca1d[_0x0bc0('0x11')](',')+_0x0bc0('0x52'),squel[_0x0bc0('0xe')]()['fields'](_0x54ca1d)[_0x0bc0('0x10')](_0x0bc0('0x40'))[_0x0bc0('0x13')](_0x0bc0('0x42'),_0x4a23b6)[_0x0bc0('0x13')](_0x0bc0('0x53')))[_0x0bc0('0x13')]('id\x20IN\x20?',squel['select']()[_0x0bc0('0xf')]('MIN(id)',_0x0bc0('0x54'))[_0x0bc0('0x10')](_0x190aa6)[_0x0bc0('0x55')](_0x54ca1d[_0x0bc0('0x11')](','))))[_0x0bc0('0x39')]();}function handleStop(){logger[_0x0bc0('0x56')](_0x0bc0('0x57'));stopped=!![];}function handleUncaughtException(_0x5aca22){logger[_0x0bc0('0x58')](_0x5aca22[_0x0bc0('0x59')]);process['exit'](0x1);}function handleError(_0xd85ee2,_0xcce619){stats[_0x0bc0('0x5a')][_0x0bc0('0x18')]({'name':_0xcce619[_0x0bc0('0x5b')],'message':_0xcce619[_0x0bc0('0x59')],'row':_0xd85ee2});}function handleQuery(_0xf71d37){logger['info'](_0xf71d37);return db[_0x0bc0('0x5c')][_0x0bc0('0x5d')](_0xf71d37)[_0x0bc0('0x5e')](function(_0x491f99){results['push'](_0x491f99);})['catch'](function(_0x36c9ba){logger[_0x0bc0('0x58')](_0x36c9ba[_0x0bc0('0x59')]);});}function updateTzCampaigns(_0x40c87f){return new Promise(function(_0x3de507,_0x365c08){var _0x53a763=squel[_0x0bc0('0xe')]()['fields']([_0x0bc0('0x5f'),'campaigns.dialTimezone'])['from'](_0x0bc0('0x60'))['join'](_0x0bc0('0x61'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x0bc0('0x13')](_0x0bc0('0x62')+_0x40c87f);db['sequelize']['query'](_0x53a763[_0x0bc0('0x39')]())[_0x0bc0('0x5e')](function(_0x13492b){var _0x416bb7=[];for(var _0x249ec7=0x0;_0x249ec7<_0x13492b['length'];_0x249ec7++){_0x416bb7[_0x0bc0('0x18')](getTimezoneData(_0x13492b[_0x249ec7],tmp_campaigns));}BPromise[_0x0bc0('0x19')](_0x416bb7)[_0x0bc0('0x1a')](function(){_0x3de507({'val':0x1});});})['catch'](function(_0x5981d7){logger[_0x0bc0('0x58')](_0x5981d7[_0x0bc0('0x59')]);_0x3de507({'val':0x0});});});}function updateTzVoiceQueues(_0x3c26fb){return new Promise(function(_0x271bdb,_0x439cb1){var _0x544131=squel[_0x0bc0('0xe')]()['fields'](['voice_queues.id',_0x0bc0('0x63')])[_0x0bc0('0x10')](_0x0bc0('0x64'))[_0x0bc0('0x11')](_0x0bc0('0x65'),null,_0x0bc0('0x66'))['where'](_0x0bc0('0x67')+_0x3c26fb);db[_0x0bc0('0x5c')]['query'](_0x544131[_0x0bc0('0x39')]())[_0x0bc0('0x5e')](function(_0x440b0d){var _0x4e63c5=[];for(var _0x56dd34=0x0;_0x56dd34<_0x440b0d['length'];_0x56dd34++){_0x4e63c5[_0x0bc0('0x18')](getTimezoneData(_0x440b0d[_0x56dd34],tmp_voice_queues));}BPromise[_0x0bc0('0x19')](_0x4e63c5)[_0x0bc0('0x1a')](function(){_0x271bdb({'val':0x1});});})[_0x0bc0('0x68')](function(_0x5f3b39){logger[_0x0bc0('0x58')](_0x5f3b39[_0x0bc0('0x59')]);_0x271bdb({'val':0x0});});});}function getTimezoneData(_0x5cd706,_0x34fafa){return new Promise(function(_0x8ee42b,_0x37ce2f){var _0x3e1077=shared['timezones'];var _0xca9f6e=_0x3e1077[_0x5cd706[_0x0bc0('0x69')]];if(_[_0x0bc0('0x1c')](_0xca9f6e)){_0x8ee42b({'ret':0x1});}else{var _0x100519=_0xca9f6e[_0x0bc0('0x6a')];var _0x1d684c=squel[_0x0bc0('0x28')]()['into'](_0x34fafa)['set']('id',_0x5cd706['id'])[_0x0bc0('0x6b')]('offset',_0x100519)['set'](_0x0bc0('0x69'),_0x5cd706['dialTimezone'])['toString']();return db[_0x0bc0('0x5c')][_0x0bc0('0x5d')](_0x1d684c)[_0x0bc0('0x5e')](function(_0x5b8cf5){_0x8ee42b({'ret':0x1});})[_0x0bc0('0x68')](function(_0x4758fd){logger['error'](_0x4758fd['message']);_0x37ce2f({'ret':0x1});});}});}function handleTZQuery(_0x53e46d){logger[_0x0bc0('0x56')](_0x53e46d);return db['sequelize'][_0x0bc0('0x5d')](_0x53e46d)['spread'](function(_0x54f88d){})['catch'](function(_0x23577f){logger[_0x0bc0('0x58')](_0x23577f['message']);});}function main(_0x21e261,_0x571b7d,_0x285125,_0x318026){logger[_0x0bc0('0x56')](_0x0bc0('0x6c'),_0x21e261,JSON['stringify'](_0x571b7d));process['send'](_0x0bc0('0x6d'));var _0x4d60c0=_0x571b7d['binding'];var _0x51f43a=_['clone'](_0x4d60c0);var _0x128097=_0x571b7d[_0x0bc0('0x6e')];var _0x5e3d4b=path[_0x0bc0('0x11')](config[_0x0bc0('0x6f')],'server/files/tmp',_0x128097+_0x0bc0('0x70'));hasTZ=_['keys'](_0x4d60c0)['includes'](_0x0bc0('0x69'));var _0x55e1fb=_[_0x0bc0('0x50')](_0x4d60c0)[_0x0bc0('0x11')]();logger[_0x0bc0('0x56')](_0x0bc0('0x71'),_0x55e1fb);db[_0x0bc0('0x72')][_0x0bc0('0x15')]({'raw':!![],'attributes':['id',_0x0bc0('0x73')]})[_0x0bc0('0x1a')](function(_0x1822c4){for(var _0x2cf4ee=0x0;_0x2cf4ee<_0x1822c4['length'];_0x2cf4ee++){if(_0x1822c4[_0x2cf4ee][_0x0bc0('0x73')]in _0x4d60c0){contactItemTypes['push'](_0x1822c4[_0x2cf4ee]);delete _0x51f43a[_0x1822c4[_0x2cf4ee]['name']];hasAdditionalPhones=!![];}for(var _0x511d99 in _0x4d60c0){if(_0x1822c4[_0x2cf4ee][_0x0bc0('0x73')]+_0x0bc0('0x74')===_0x511d99){phoneDescriptions['push']({'itemTypeId':_0x1822c4[_0x2cf4ee]['id'],'description':_0x511d99});delete _0x51f43a[_0x511d99];}}}if(hasAdditionalPhones)_0x51f43a[_0x0bc0('0x16')]='';var _0x3c9b05=_['keys'](_0x51f43a)[_0x0bc0('0x11')]();logger['info'](_0x0bc0('0x71'),_0x3c9b05);fs['writeFileSync'](_0x5e3d4b,_0x3c9b05+'\x0a');Papa['parse'](fs[_0x0bc0('0x75')](_0x21e261),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5173f4,_0x289fca){try{for(var _0x101f92=0x0,_0x1f7bcb=[];_0x101f92<_0x5173f4[_0x0bc0('0x76')][_0x0bc0('0x17')];_0x101f92++){stats[_0x0bc0('0x77')]+=0x1;if(_0x5173f4['errors'][_0x101f92]){handleError(_0x5173f4[_0x0bc0('0x76')][_0x101f92],_0x5173f4['errors'][_0x101f92]);}else{var _0x426b76=[];var _0x4d21ed=[];var _0x598dca={};for(var _0x57c5e8 in _0x4d60c0){let _0x198ffb=contactItemTypes[_0x0bc0('0x78')](_0x1372a2=>_0x1372a2[_0x0bc0('0x73')]===_0x57c5e8);let _0x297380=contactItemTypes[_0x0bc0('0x78')](_0x8143ee=>_0x8143ee[_0x0bc0('0x73')]+_0x0bc0('0x74')===_0x57c5e8);if(_['isNil'](_0x198ffb)&&_['isNil'](_0x297380)){if(_0x4d60c0[_0x0bc0('0x79')](_0x57c5e8)){if(_0x5173f4['data'][_0x101f92][_0x4d60c0[_0x57c5e8]]){var _0x181abf=_[_0x0bc0('0x7a')](_0x5173f4[_0x0bc0('0x76')][_0x101f92][_0x4d60c0[_0x57c5e8]][_0x0bc0('0x7b')](/"/g,'\x27'));switch(_0x57c5e8){case _0x0bc0('0x2c'):var _0x4d0dab=moment(_0x181abf,_0x0bc0('0xd'),!![]);if(_0x4d0dab[_0x0bc0('0x7c')]()){_0x1f7bcb[_0x0bc0('0x18')]('\x22'+_0x181abf+'\x22');}else{_0x426b76['push'](_0x0bc0('0x7d'));}break;case'priority':var _0x2ec166=parseInt(_0x181abf);_0x181abf=_['isNaN'](_0x2ec166)||_0x2ec166<0x0||_0x2ec166>0x4?_0x318026?0x3:0x2:_0x2ec166;_0x1f7bcb[_0x0bc0('0x18')]('\x22'+_0x181abf+'\x22');break;case _0x0bc0('0x32'):var _0x1f86f7=parseInt(_0x181abf);if(_[_0x0bc0('0x7e')](_0x1f86f7)&&_[_0x0bc0('0x7f')](_0x285125,_0x1f86f7)){_0x1f7bcb[_0x0bc0('0x18')]('\x22'+_0x1f86f7+'\x22');}else{_0x426b76[_0x0bc0('0x18')](_0x0bc0('0x80'));}break;case _0x0bc0('0x81'):if(isEmail(_0x181abf)){_0x1f7bcb[_0x0bc0('0x18')]('\x22'+_0x181abf+'\x22');}else{_0x426b76['push'](_0x0bc0('0x82'));}break;case _0x0bc0('0x83'):var _0x4e60cf=moment(_0x181abf,_0x0bc0('0x84'),!![]);if(_0x4e60cf[_0x0bc0('0x7c')]()){_0x1f7bcb[_0x0bc0('0x18')]('\x22'+_0x181abf+'\x22');}else{_0x426b76[_0x0bc0('0x18')](_0x0bc0('0x85'));}break;case'dialTimezone':var _0x11870d=shared[_0x0bc0('0x86')];var _0x433e91=_0x11870d[_0x181abf];if(!_[_0x0bc0('0x1c')](_0x433e91)){var _0x51423a=_0x433e91[_0x0bc0('0x6a')];_0x1f7bcb[_0x0bc0('0x18')]('\x22'+_0x181abf+'\x22');_0x1f7bcb['push']('\x22'+_0x51423a+'\x22');}break;default:_0x1f7bcb[_0x0bc0('0x18')]('\x22'+_0x181abf+'\x22');}}else{switch(_0x57c5e8){case _0x0bc0('0x87'):case _0x0bc0('0x2b'):_0x426b76[_0x0bc0('0x18')](_0x57c5e8+_0x0bc0('0x88'));break;default:_0x1f7bcb[_0x0bc0('0x18')]('\x22\x22');}}}}else{var _0x51871a='';if(!_[_0x0bc0('0x1c')](_0x198ffb)){if(!_0x598dca['hasOwnProperty'](_0x198ffb['id'])){if(!_[_0x0bc0('0x1c')](_0x5173f4['data'][_0x101f92][_0x4d60c0[_0x57c5e8]])){var _0x181abf=_[_0x0bc0('0x7a')](_0x5173f4[_0x0bc0('0x76')][_0x101f92][_0x4d60c0[_0x57c5e8]][_0x0bc0('0x7b')](/"/g,'\x27'));var _0x110b7c=phoneDescriptions[_0x0bc0('0x78')](_0x3513fc=>_0x3513fc[_0x0bc0('0x89')]===_0x198ffb['id']);if(!_['isNil'](_0x110b7c)){var _0x2c91ba=_[_0x0bc0('0x7a')](_0x5173f4[_0x0bc0('0x76')][_0x101f92][_0x4d60c0[_0x110b7c[_0x0bc0('0x8a')]]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x2c91ba))_0x181abf=_0x181abf+'§'+_0x2c91ba;}if(_0x51871a=='')_0x51871a=_0x181abf;else _0x51871a+='|'+_0x181abf;}_0x4d21ed['push'](_0x198ffb['id']+':'+_0x51871a);_0x598dca[_0x198ffb['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1f7bcb[_0x0bc0('0x18')]('\x22'+_0x4d21ed[_0x0bc0('0x11')](';')+'\x22');}if(_0x426b76['length']){handleError(_0x5173f4[_0x0bc0('0x76')][_0x101f92],{'code':_0x0bc0('0x8b'),'message':_0x426b76['join']()});}else{fs[_0x0bc0('0x8c')](_0x5e3d4b,_0x1f7bcb['join']()+'\x0a');}_0x1f7bcb=[];}if(!(stats[_0x0bc0('0x77')]%0xc8)){socket[_0x0bc0('0x8d')](_0x0bc0('0x8e')+_0x128097,stats);stats['errors']=[];}}if(stopped){logger[_0x0bc0('0x56')](_0x0bc0('0x8f'));_0x289fca['abort']();}}catch(_0x18bef6){handleError(_0x5173f4['data'][_0x101f92],{'code':'SystemError','message':_0x18bef6['message']});logger[_0x0bc0('0x58')](_0x0bc0('0x90'),_0x18bef6[_0x0bc0('0x59')]);}},'complete':function(){try{var _0x4a8014=[];var _0x3dd51b=[];var _0x36a3f2=_0x0bc0('0x40');if(_0x571b7d[_0x0bc0('0x91')]&&_0x571b7d[_0x0bc0('0x91')][_0x0bc0('0x17')]){_0x36a3f2=_0x0bc0('0x92')+_0x128097;_0x4a8014[_0x0bc0('0x18')](_0x0bc0('0x93')+_0x36a3f2+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x0bc0('0x94')+_0x128097;tmp_voice_queues='voice_queues_'+_0x128097;_0x3dd51b[_0x0bc0('0x18')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x0bc0('0x95'));_0x3dd51b[_0x0bc0('0x18')](_0x0bc0('0x93')+tmp_voice_queues+_0x0bc0('0x95'));BPromise[_0x0bc0('0x96')](_0x3dd51b,handleTZQuery)[_0x0bc0('0x1a')](function(_0x217f8f){updateTzCampaigns(_0x571b7d[_0x0bc0('0x2e')])[_0x0bc0('0x1a')](function(_0x460e55){updateTzVoiceQueues(_0x571b7d['ListId'])[_0x0bc0('0x1a')](function(_0x140ca9){if(hasTZ)_0x3c9b05=_0x3c9b05[_0x0bc0('0x7b')](_0x0bc0('0x69'),_0x0bc0('0x97'));var _0x309698=util[_0x0bc0('0xc')](_0x0bc0('0x98'),_0x5e3d4b,_0x36a3f2,_0x3c9b05,_0x571b7d[_0x0bc0('0x2e')],_0x571b7d[_0x0bc0('0x51')]||null,NOW,NOW);if(_['isNil'](_0x4d60c0[_0x0bc0('0x2c')])){_0x309698+=_0x0bc0('0x99');}_0x4a8014['push'](_0x309698);if(_0x571b7d[_0x0bc0('0x91')]&&_0x571b7d['duplicates'][_0x0bc0('0x17')]){_0x4a8014[_0x0bc0('0x18')](insertCmContact(_0x571b7d[_0x0bc0('0x2e')],_0x36a3f2,_0x571b7d['duplicates'],_0x4d60c0));_0x4a8014[_0x0bc0('0x18')](_0x0bc0('0x9a')+_0x36a3f2+';');}BPromise['each'](_0x4a8014,handleQuery)['then'](function(_0x2deee2){BPromise[_0x0bc0('0x19')]([handleAdditionalPhones()])[_0x0bc0('0x1a')](function(){_0x4a8014=[];for(var _0x259144=0x0;_0x259144<promisesAdditionalPhones[_0x0bc0('0x17')];_0x259144++){if(promisesAdditionalPhones[_0x259144][_0x0bc0('0x2b')]!='§'){_0x4a8014[_0x0bc0('0x18')](createAdditionalPhone(promisesAdditionalPhones[_0x259144][_0x0bc0('0x9b')],promisesAdditionalPhones[_0x259144]['contactTypeId'],promisesAdditionalPhones[_0x259144][_0x0bc0('0x2b')],promisesAdditionalPhones[_0x259144]['orderBy']));}}BPromise[_0x0bc0('0x19')](_0x4a8014)['then'](function(){_0x4a8014=[];if(hasTZ){_0x4a8014[_0x0bc0('0x18')](insertTzCmHopper(_0x571b7d[_0x0bc0('0x2e')],_0x0bc0('0x65'),'voice_queues',_0x0bc0('0x9c'),_0x318026,tmp_voice_queues));_0x4a8014['push'](insertTzCmHopperBlack(_0x571b7d[_0x0bc0('0x2e')],_0x0bc0('0x9d'),_0x0bc0('0x64'),_0x0bc0('0x9c')));_0x4a8014[_0x0bc0('0x18')](insertTzCmHopper(_0x571b7d[_0x0bc0('0x2e')],_0x0bc0('0x61'),_0x0bc0('0x60'),_0x0bc0('0x9e'),_0x318026,tmp_campaigns));_0x4a8014[_0x0bc0('0x18')](insertTzCmHopperBlack(_0x571b7d['ListId'],_0x0bc0('0x9f'),_0x0bc0('0x60'),_0x0bc0('0x9e')));_0x4a8014[_0x0bc0('0x18')](insertCmHopperAdditionalPhones(_0x571b7d[_0x0bc0('0x2e')]));}else{_0x4a8014[_0x0bc0('0x18')](insertCmHopper(_0x571b7d[_0x0bc0('0x2e')],_0x0bc0('0x65'),_0x0bc0('0x64'),'VoiceQueueId',_0x318026));_0x4a8014[_0x0bc0('0x18')](insertCmHopperBlack(_0x571b7d[_0x0bc0('0x2e')],_0x0bc0('0x9d'),_0x0bc0('0x64'),_0x0bc0('0x9c')));_0x4a8014[_0x0bc0('0x18')](insertCmHopper(_0x571b7d[_0x0bc0('0x2e')],_0x0bc0('0x61'),_0x0bc0('0x60'),_0x0bc0('0x9e'),_0x318026));_0x4a8014['push'](insertCmHopperBlack(_0x571b7d['ListId'],_0x0bc0('0x9f'),_0x0bc0('0x60'),'CampaignId'));_0x4a8014[_0x0bc0('0x18')](insertCmHopperAdditionalPhones(_0x571b7d[_0x0bc0('0x2e')]));}_0x4a8014[_0x0bc0('0x18')](_0x0bc0('0x9a')+tmp_campaigns+';');_0x4a8014[_0x0bc0('0x18')](_0x0bc0('0x9a')+tmp_voice_queues+';');BPromise['each'](_0x4a8014,handleQuery)['then'](function(_0x318f73){stats[_0x0bc0('0xa0')]=!![];stats[_0x0bc0('0xa1')]=_0x571b7d[_0x0bc0('0x91')]&&_0x571b7d['duplicates'][_0x0bc0('0x17')]?results[0x2][_0x0bc0('0xa1')]:results[0x0]['affectedRows'];socket[_0x0bc0('0x8d')](_0x0bc0('0x8e')+_0x128097,stats);fs[_0x0bc0('0xa2')](_0x21e261);fs['unlink'](_0x5e3d4b);process[_0x0bc0('0xa3')](0x0);})[_0x0bc0('0x68')](function(_0x28d2b7){logger[_0x0bc0('0x58')](_0x28d2b7[_0x0bc0('0x59')]);process['exit'](0x1);});});});})[_0x0bc0('0x68')](function(_0x1c34f1){logger['error'](_0x1c34f1[_0x0bc0('0x59')]);process[_0x0bc0('0xa3')](0x1);});});});});}catch(_0x189c61){logger[_0x0bc0('0x58')](_0x0bc0('0xa4'),_0x189c61['message']);process[_0x0bc0('0xa3')](0x1);}},'error':function(_0x2cf303,_0xeedd69,_0x17682e,_0x43e903){throw new Error(_0x43e903);}});});}function validate(){if(process[_0x0bc0('0xa5')]&&process[_0x0bc0('0xa5')][_0x0bc0('0x17')]<0x4){throw new Error(_0x0bc0('0xa6'));}var _0x37ec03=path[_0x0bc0('0x11')](config[_0x0bc0('0x6f')],_0x0bc0('0xa7'),process[_0x0bc0('0xa5')][0x2]);if(!fs['existsSync'](_0x37ec03)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x313061={};try{_0x313061=JSON[_0x0bc0('0xa8')](process[_0x0bc0('0xa5')][0x3]);if(!_0x313061['binding']){throw new Error(_0x0bc0('0xa9'));}if(!_0x313061[_0x0bc0('0xaa')]['phone']){throw new Error(_0x0bc0('0xab'));}if(!_0x313061[_0x0bc0('0xaa')][_0x0bc0('0x87')]){throw new Error(_0x0bc0('0xac'));}var _0x263563=0x0;if(_0x313061[_0x0bc0('0xaa')][_0x0bc0('0x32')]){_0x263563=0x1;}if(!_0x313061['ListId']){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x5c6a1c){throw new Error(_0x0bc0('0xad'));}var _0x1c582c=[];try{_0x1c582c=_[_0x0bc0('0xae')](JSON['parse'](process[_0x0bc0('0xa5')][0x4]),'id');}catch(_0x1e2372){logger[_0x0bc0('0x56')](_0x0bc0('0xaf'));}main(_0x37ec03,_0x313061,_0x1c582c,_0x263563);}validate();process['on']('SIGINT',handleStop);process['on'](_0x0bc0('0xb0'),handleUncaughtException);
\ No newline at end of file
index d34da4c..e9a705c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48ac=['toString','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_hopper_additional_phones','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','insert',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','id\x20IN\x20?','info','Received\x20SIGINT','message','exit','code','spread','catch','main','stringify','start','binding','clone','socket_timestamp','root','.csv','body','ContactItemType','name','_description','header','parse','createReadStream','rows','data','errors','find','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','description','SystemRow','appendFileSync','emit','contact:import:','abort','SystemError','step','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','contactTypeId','orderBy','finish','affectedRows','unlink','complete','argv','existsSync','binding\x20doesn\x27t\x20exists','No\x20agent\x20available','SIGINT','lodash','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','socket.io-emitter','redis','format','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','isNil','AdditionalPhones','push','all','then','error','split','length','filter','findOne','update','updated','CmContactHasItem','create','PHONE','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.UserId','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','priority','UserId','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','into','cm_hopper_black','updatedAt','fields','.CmListId\x20=\x20?','field','\x20=\x20?'];(function(_0x538c70,_0x3387ec){var _0x303e34=function(_0x240875){while(--_0x240875){_0x538c70['push'](_0x538c70['shift']());}};_0x303e34(++_0x3387ec);}(_0x48ac,0xe0));var _0xc48a=function(_0x3eb524,_0x6e0ecc){_0x3eb524=_0x3eb524-0x0;var _0x2a6977=_0x48ac[_0x3eb524];return _0x2a6977;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0xc48a('0x0'));var Papa=require('papaparse');var util=require(_0xc48a('0x1'));var BPromise=require(_0xc48a('0x2'));var moment=require(_0xc48a('0x3'));var squel=require('squel');var Redis=require(_0xc48a('0x4'));var db=require(_0xc48a('0x5'))['db'];var config=require(_0xc48a('0x6'));var logger=require(_0xc48a('0x7'))(_0xc48a('0x8'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc48a('0x9'))(new Redis(config[_0xc48a('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xc48a('0xb')]('YYYY-MM-DD\x20HH:mm:ss');var tempTableName=_0xc48a('0xc')+moment()[_0xc48a('0xb')](_0xc48a('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0xcefd1e){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))*$/[_0xc48a('0xe')](_0xcefd1e);}function selectNotIn(_0x1c96ae,_0x1c4ce9,_0x286633,_0x2b7650,_0x6d74f3){return squel[_0xc48a('0xf')]()['field'](_0xc48a('0x10'))[_0xc48a('0x11')](_0x2b7650)[_0xc48a('0x12')](_0x1c4ce9,null,_0x1c4ce9+'.id\x20=\x20'+_0x2b7650+'.'+_0x286633)[_0xc48a('0x13')](_0x2b7650+'.'+_0x286633+_0xc48a('0x14')+_0x1c96ae+'.'+_0x286633)['where'](_0x1c4ce9+_0xc48a('0x15')+_0x6d74f3[_0xc48a('0x12')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x286f42,_0x4e0d3c){promisesAdditionalPhones=[];promisesContact=[];return db[_0xc48a('0x16')][_0xc48a('0x17')](_0xc48a('0x18')+tempTableName)['spread'](function(_0x38abb3){if(_0x38abb3!==null){var _0x2172f5=[];for(var _0x53bfc3=0x0;_0x53bfc3<_0x38abb3['length'];_0x53bfc3++){var _0x4d1dfa=_0x38abb3[_0x53bfc3];if(!_['isNil'](_0x4d1dfa[_0xc48a('0x10')])){if(!_[_0xc48a('0x19')](_0x4d1dfa[_0xc48a('0x1a')]))_0x2172f5[_0xc48a('0x1b')](insertAdditionalPhones(_0x4d1dfa));promisesContact[_0xc48a('0x1b')]({'contact':_0x4d1dfa});}}}Promise[_0xc48a('0x1c')](_0x2172f5)[_0xc48a('0x1d')](function(){_0x286f42({'val':0x1});});})['catch'](function(_0x308703){logger[_0xc48a('0x1e')](_0x308703['message']);});});}function insertAdditionalPhones(_0x259bc2){return new Promise(function(_0x4e6e15,_0x2b7dfa){var _0x5a47d2=_0x259bc2[_0xc48a('0x1a')];if(_[_0xc48a('0x19')](_0x5a47d2))_0x2b7dfa({'val':0x0});else{var _0x241aac=_0x5a47d2[_0xc48a('0x1f')](';');var _0x2a3380=[];orderBy=0x0;for(var _0x3e24f5=0x0;_0x3e24f5<_0x241aac[_0xc48a('0x20')];_0x3e24f5++){_0x2a3380[_0xc48a('0x1b')](splitAdditionalPhone(_0x259bc2['id'],_0x241aac[_0x3e24f5]));}Promise[_0xc48a('0x1c')](_0x2a3380)[_0xc48a('0x1d')](function(){_0x4e6e15({'val':_0x241aac[_0xc48a('0x20')]});});}});}function splitAdditionalPhone(_0x4bc55b,_0x53fab0){return new Promise(function(_0x351b72,_0x16d41a){var _0x428344=_0x53fab0[_0xc48a('0x1f')](':');var _0x5b63aa=_0x428344[0x0];var _0x5c5d61=_0x428344[0x1];if(_0x5c5d61!==''){var _0x34cad3=_0x5c5d61[_0xc48a('0x1f')]('|');var _0x20709c=[];for(var _0x4ecdaf=0x0;_0x4ecdaf<_0x34cad3[_0xc48a('0x20')];_0x4ecdaf++){if(_0x34cad3[_0x4ecdaf]!==''){var _0x4077f7=_[_0xc48a('0x21')](promisesAdditionalPhones,{'contactId':_0x4bc55b,'phone':_0x34cad3[_0x4ecdaf]});if(_0x4077f7[_0xc48a('0x20')]==0x0){orderBy++;promisesAdditionalPhones[_0xc48a('0x1b')]({'contactId':_0x4bc55b,'contactTypeId':_0x5b63aa,'phone':_0x34cad3[_0x4ecdaf],'orderBy':orderBy});}}}_0x351b72({'ok':0x1});}else _0x351b72({'res':0x0});});}function createAdditionalPhone(_0x163205,_0x1a2b28,_0x335532,_0x3b75db){var _0x45747f='';var _0x5da24d='';var _0x5bf78a=_0x335532[_0xc48a('0x1f')]('§');_0x45747f=_0x5bf78a[0x0];if(_0x5bf78a['length']==0x2)_0x5da24d=_0x5bf78a[0x1];return new Promise(function(_0xab328e,_0x10e450){return db['CmContactHasItem'][_0xc48a('0x22')]({'where':{'CmContactId':_0x163205,'item':_0x45747f}})[_0xc48a('0x1d')](function(_0x22e62a){if(_0x22e62a){return db['CmContactHasItem'][_0xc48a('0x23')]({'ItemTypeId':_0x1a2b28,'description':_0x5da24d,'OrderBy':_0x3b75db},{'where':{'CmContactId':_0x163205,'item':_0x45747f}})[_0xc48a('0x1d')](function(_0x5da25c){_0xab328e({'res':_0xc48a('0x24')});});}else{return db[_0xc48a('0x25')][_0xc48a('0x26')]({'CmContactId':_0x163205,'item':_0x45747f,'ItemTypeId':_0x1a2b28,'description':_0x5da24d,'OrderBy':_0x3b75db,'ItemClass':_0xc48a('0x27')})[_0xc48a('0x1d')](function(_0x4cc11b){_0xab328e({'res':_0xc48a('0x28')});});}});});}function updateContact(_0x2c93f9){return new Promise(function(_0x2c6cbd,_0x2ad597){var _0x3557e6=_0x2c93f9['id'];delete _0x2c93f9['id'];return db[_0xc48a('0x29')][_0xc48a('0x23')](_0x2c93f9,{'where':{'id':_0x3557e6}})[_0xc48a('0x1d')](function(_0x57d803){updatedRows+=0x1;return db[_0xc48a('0x2a')][_0xc48a('0x23')]({'phone':_0x2c93f9[_0xc48a('0x10')]},{'where':{'ContactId':_0x3557e6}})[_0xc48a('0x1d')](function(_0x3e2568){_0x2c6cbd({'ret':'OK'});});});});}function insertCmHopper(_0x35c259,_0x4447c4,_0x52b449,_0x248e92,_0xa26b55){var _0x21e6ac=[_0xc48a('0x2b'),'cm_contacts.scheduledat',_0xc48a('0x2c'),_0xc48a('0x2d'),_0x4447c4+'.'+_0x248e92,'cm_contacts.createdAt',_0xc48a('0x2e'),'cm_contacts.priority',_0xc48a('0x2f'),'\x22'+_0xa26b55+'\x22'];return squel['insert']()['into'](_0xc48a('0x30'))[_0xc48a('0x31')](['phone',_0xc48a('0x32'),_0xc48a('0x33'),_0xc48a('0x34'),_0x248e92,_0xc48a('0x35'),'updatedAt',_0xc48a('0x36'),_0xc48a('0x37'),_0xc48a('0x38')],squel[_0xc48a('0xf')]()['fields'](_0x21e6ac)[_0xc48a('0x11')](_0x4447c4)['join'](_0xc48a('0x39'),null,_0xc48a('0x3a')+_0x4447c4+_0xc48a('0x3b'))[_0xc48a('0x12')](_0x52b449,null,_0x52b449+_0xc48a('0x3c')+_0x4447c4+'.'+_0x248e92)[_0xc48a('0x13')](_0x4447c4+'.CmListId\x20=\x20?',_0x35c259)[_0xc48a('0x13')](_0xc48a('0x3d'),NOW)[_0xc48a('0x13')](_0xc48a('0x3e'),selectNotIn(_0x4447c4,_0x52b449,_0x248e92,_0xc48a('0x30'),['\x22always\x22',_0xc48a('0x3f')]))[_0xc48a('0x13')](_0xc48a('0x3e'),selectNotIn(_0x4447c4,_0x52b449,_0x248e92,'cm_hopper',[_0xc48a('0x40')])))['toString']();}function insertCmHopperBlack(_0x5caf9a,_0x373ef3,_0x4631f3,_0x32d7e3){var _0x3884f3=[_0xc48a('0x2b'),_0xc48a('0x2c'),_0xc48a('0x2d'),_0x373ef3+'.'+_0x32d7e3,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel['insert']()[_0xc48a('0x41')](_0xc48a('0x42'))[_0xc48a('0x31')]([_0xc48a('0x10'),_0xc48a('0x33'),_0xc48a('0x34'),_0x32d7e3,_0xc48a('0x35'),_0xc48a('0x43')],squel[_0xc48a('0xf')]()[_0xc48a('0x44')](_0x3884f3)[_0xc48a('0x11')](_0x373ef3)['join'](_0xc48a('0x39'),null,_0xc48a('0x3a')+_0x373ef3+_0xc48a('0x3b'))[_0xc48a('0x12')](_0x4631f3,null,_0x4631f3+_0xc48a('0x3c')+_0x373ef3+'.'+_0x32d7e3)[_0xc48a('0x13')](_0x373ef3+_0xc48a('0x45'),_0x5caf9a)[_0xc48a('0x13')](_0xc48a('0x3d'),NOW)['where'](_0xc48a('0x3e'),squel[_0xc48a('0xf')]()[_0xc48a('0x46')](_0xc48a('0x10'))['from'](_0xc48a('0x42'))[_0xc48a('0x13')]('ListId\x20=\x20?',_0x5caf9a)[_0xc48a('0x13')](_0x32d7e3+_0xc48a('0x47'),_0x373ef3+'.'+_0x32d7e3)))[_0xc48a('0x48')]();}function insertCmHopperAdditionalPhones(_0x11eba7){var _0x553028=[_0xc48a('0x49'),_0xc48a('0x4a'),_0xc48a('0x4b'),_0xc48a('0x4c'),'cm_contact_has_items.updatedAt'];return squel['insert']()['into'](_0xc48a('0x4d'))[_0xc48a('0x31')](['CmHopperId',_0xc48a('0x10'),'OrderBy',_0xc48a('0x35'),_0xc48a('0x43')],squel[_0xc48a('0xf')]()[_0xc48a('0x44')](_0x553028)[_0xc48a('0x11')](_0xc48a('0x30'))[_0xc48a('0x12')](_0xc48a('0x39'),null,_0xc48a('0x4e'))['join'](_0xc48a('0x4f'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xc48a('0x13')](_0xc48a('0x50'),_0x11eba7)[_0xc48a('0x13')](_0xc48a('0x3d'),NOW))[_0xc48a('0x48')]();}function insertCmContact(_0x5bf6e8,_0x2ce6d2,_0x4d2ac8,_0x94456){var _0x2b9f44=_[_0xc48a('0x51')](_[_0xc48a('0x52')](_0x94456),[_0xc48a('0x34'),_0xc48a('0x53'),'createdAt',_0xc48a('0x43')]);return squel[_0xc48a('0x54')]()[_0xc48a('0x41')]('cm_contacts')[_0xc48a('0x31')](_0x2b9f44,squel[_0xc48a('0xf')]()[_0xc48a('0x44')](_0x2b9f44)['from'](_0x2ce6d2)[_0xc48a('0x13')]('('+_0x4d2ac8['join'](',')+_0xc48a('0x55'),squel['select']()[_0xc48a('0x44')](_0x4d2ac8)[_0xc48a('0x11')](_0xc48a('0x39'))[_0xc48a('0x13')](_0xc48a('0x56'),_0x5bf6e8))[_0xc48a('0x13')](_0xc48a('0x57'),squel[_0xc48a('0xf')]()[_0xc48a('0x46')]('MIN(id)','min_id')[_0xc48a('0x11')](_0x2ce6d2)['group'](_0x4d2ac8[_0xc48a('0x12')](','))))[_0xc48a('0x48')]();}function handleStop(){logger[_0xc48a('0x58')](_0xc48a('0x59'));stopped=!![];}function handleUncaughtException(_0x482456){logger['error'](_0x482456[_0xc48a('0x5a')]);process[_0xc48a('0x5b')](0x1);}function handleError(_0x12c3f4,_0x30a368){stats['errors'][_0xc48a('0x1b')]({'name':_0x30a368[_0xc48a('0x5c')],'message':_0x30a368['message'],'row':_0x12c3f4});}function handleQuery(_0x11b099){logger[_0xc48a('0x58')](_0x11b099);return db[_0xc48a('0x16')][_0xc48a('0x17')](_0x11b099)[_0xc48a('0x5d')](function(_0x39f686){results[_0xc48a('0x1b')](_0x39f686);})[_0xc48a('0x5e')](function(_0x1c9986){logger['error'](_0x1c9986['message']);});}function main(_0x40fba6,_0x324f30,_0x440207,_0x14bb68){logger[_0xc48a('0x58')](_0xc48a('0x5f'),_0x40fba6,JSON[_0xc48a('0x60')](_0x324f30));process['send'](_0xc48a('0x61'));var _0x192cd3=_0x324f30[_0xc48a('0x62')];var _0x42a5ec=_[_0xc48a('0x63')](_0x192cd3);var _0x1fc702=_0x324f30[_0xc48a('0x64')];var _0x4e9077=path[_0xc48a('0x12')](config[_0xc48a('0x65')],'server/files/tmp',_0x1fc702+_0xc48a('0x66'));logger[_0xc48a('0x58')](_0xc48a('0x67'),_0x324f30);db[_0xc48a('0x68')]['findAll']({'raw':!![],'attributes':['id',_0xc48a('0x69')]})[_0xc48a('0x1d')](function(_0x1188f0){for(var _0x104ac2=0x0;_0x104ac2<_0x1188f0[_0xc48a('0x20')];_0x104ac2++){if(_0x1188f0[_0x104ac2][_0xc48a('0x69')]in _0x192cd3){contactItemTypes[_0xc48a('0x1b')](_0x1188f0[_0x104ac2]);delete _0x42a5ec[_0x1188f0[_0x104ac2]['name']];hasAdditionalPhones=!![];}for(var _0x133863 in _0x192cd3){if(_0x1188f0[_0x104ac2][_0xc48a('0x69')]+_0xc48a('0x6a')===_0x133863){phoneDescriptions[_0xc48a('0x1b')]({'itemTypeId':_0x1188f0[_0x104ac2]['id'],'description':_0x133863});delete _0x42a5ec[_0x133863];}}}if(hasAdditionalPhones)_0x42a5ec[_0xc48a('0x1a')]='';var _0x525ee2=_[_0xc48a('0x52')](_0x42a5ec)[_0xc48a('0x12')]();logger['info'](_0xc48a('0x6b'),_0x525ee2);fs['writeFileSync'](_0x4e9077,_0x525ee2+'\x0a');Papa[_0xc48a('0x6c')](fs[_0xc48a('0x6d')](_0x40fba6),{'header':!![],'skipEmptyLines':!![],'step':function(_0x261de1,_0x11fb19){try{for(var _0x16d868=0x0,_0xc1f1da=[];_0x16d868<_0x261de1['data']['length'];_0x16d868++){stats[_0xc48a('0x6e')]+=0x1;if(_0x261de1['errors'][_0x16d868]){handleError(_0x261de1[_0xc48a('0x6f')][_0x16d868],_0x261de1[_0xc48a('0x70')][_0x16d868]);}else{var _0x2d2f99=[];var _0x2de49b=[];var _0x4f40e2={};for(var _0x52562c in _0x192cd3){let _0x5e0dca=contactItemTypes['find'](_0x4eb415=>_0x4eb415[_0xc48a('0x69')]===_0x52562c);let _0x5a2232=contactItemTypes[_0xc48a('0x71')](_0x413c8a=>_0x413c8a[_0xc48a('0x69')]+_0xc48a('0x6a')===_0x52562c);if(_[_0xc48a('0x19')](_0x5e0dca)&&_[_0xc48a('0x19')](_0x5a2232)){if(_0x192cd3[_0xc48a('0x72')](_0x52562c)){if(_0x261de1[_0xc48a('0x6f')][_0x16d868][_0x192cd3[_0x52562c]]){var _0x493968=_[_0xc48a('0x73')](_0x261de1[_0xc48a('0x6f')][_0x16d868][_0x192cd3[_0x52562c]][_0xc48a('0x74')](/"/g,'\x27'));switch(_0x52562c){case _0xc48a('0x32'):var _0xb5daad=moment(_0x493968,_0xc48a('0x75'),!![]);if(_0xb5daad[_0xc48a('0x76')]()){_0xc1f1da[_0xc48a('0x1b')]('\x22'+_0x493968+'\x22');}else{_0x2d2f99[_0xc48a('0x1b')](_0xc48a('0x77'));}break;case _0xc48a('0x36'):var _0x462c8f=parseInt(_0x493968);_0x493968=_[_0xc48a('0x78')](_0x462c8f)||_0x462c8f<0x0||_0x462c8f>0x4?_0x14bb68?0x3:0x2:_0x462c8f;_0xc1f1da[_0xc48a('0x1b')]('\x22'+_0x493968+'\x22');break;case _0xc48a('0x37'):var _0x386abf=parseInt(_0x493968);if(_['isNumber'](_0x386abf)&&_['includes'](_0x440207,_0x386abf)){_0xc1f1da[_0xc48a('0x1b')]('\x22'+_0x386abf+'\x22');}else{_0x2d2f99[_0xc48a('0x1b')]('agent\x20not\x20exists');}break;case _0xc48a('0x79'):if(isEmail(_0x493968)){_0xc1f1da['push']('\x22'+_0x493968+'\x22');}else{_0x2d2f99[_0xc48a('0x1b')](_0xc48a('0x7a'));}break;case _0xc48a('0x7b'):var _0x1084a3=moment(_0x493968,_0xc48a('0x7c'),!![]);if(_0x1084a3[_0xc48a('0x76')]()){_0xc1f1da[_0xc48a('0x1b')]('\x22'+_0x493968+'\x22');}else{_0x2d2f99[_0xc48a('0x1b')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0xc1f1da[_0xc48a('0x1b')]('\x22'+_0x493968+'\x22');}}else{switch(_0x52562c){case'firstName':case'phone':_0x2d2f99['push'](_0x52562c+'\x20not\x20specified');break;default:_0xc1f1da[_0xc48a('0x1b')]('\x22\x22');}}}}else{var _0x27548e='';if(!_[_0xc48a('0x19')](_0x5e0dca)){if(!_0x4f40e2[_0xc48a('0x72')](_0x5e0dca['id'])){for(var _0x2653c0=0x0;_0x2653c0<_0x192cd3[_0x52562c][_0xc48a('0x20')];_0x2653c0++){var _0x493968=_['trim'](_0x261de1[_0xc48a('0x6f')][_0x16d868][_0x192cd3[_0x52562c][_0x2653c0]][_0xc48a('0x74')](/"/g,'\x27'));var _0x3c6aad=phoneDescriptions[_0xc48a('0x71')](_0x23ebcf=>_0x23ebcf['itemTypeId']===_0x5e0dca['id']);if(!_[_0xc48a('0x19')](_0x3c6aad)){var _0x342a28=_[_0xc48a('0x73')](_0x261de1['data'][_0x16d868][_0x192cd3[_0x3c6aad[_0xc48a('0x7d')]][0x0]][_0xc48a('0x74')](/"/g,'\x27'));if(!_[_0xc48a('0x19')](_0x342a28))_0x493968=_0x493968+'§'+_0x342a28;}if(_0x27548e=='')_0x27548e=_0x493968;else _0x27548e+='|'+_0x493968;}_0x2de49b[_0xc48a('0x1b')](_0x5e0dca['id']+':'+_0x27548e);_0x4f40e2[_0x5e0dca['id']]=0x1;}}}}if(hasAdditionalPhones){_0xc1f1da['push']('\x22'+_0x2de49b[_0xc48a('0x12')](';')+'\x22');}if(_0x2d2f99[_0xc48a('0x20')]){handleError(_0x261de1[_0xc48a('0x6f')][_0x16d868],{'code':_0xc48a('0x7e'),'message':_0x2d2f99[_0xc48a('0x12')]()});}else{fs[_0xc48a('0x7f')](_0x4e9077,_0xc1f1da[_0xc48a('0x12')]()+'\x0a');}_0xc1f1da=[];}if(!(stats[_0xc48a('0x6e')]%0xc8)){socket[_0xc48a('0x80')](_0xc48a('0x81')+_0x1fc702,stats);stats[_0xc48a('0x70')]=[];}}if(stopped){logger[_0xc48a('0x58')]('Abort\x20parser');_0x11fb19[_0xc48a('0x82')]();}}catch(_0x53d9f3){handleError(_0x261de1[_0xc48a('0x6f')][_0x16d868],{'code':_0xc48a('0x83'),'message':_0x53d9f3['message']});logger['error'](_0xc48a('0x84'),_0x53d9f3[_0xc48a('0x5a')]);}},'complete':function(){try{var _0x553552=[];var _0x2c5ad1=tempTableName;_0x553552[_0xc48a('0x1b')](_0xc48a('0x85')+_0x2c5ad1+_0xc48a('0x86'));logger[_0xc48a('0x58')]('CIS\x20len',contactItemTypes[_0xc48a('0x20')]);var _0x17bf53=util['format'](_0xc48a('0x87'),_0x4e9077,_0x2c5ad1,_0x525ee2,_0x324f30[_0xc48a('0x34')],_0x324f30[_0xc48a('0x53')]||null,NOW,NOW);if(_[_0xc48a('0x19')](_0x192cd3[_0xc48a('0x32')])){_0x17bf53+=_0xc48a('0x88');}_0x553552[_0xc48a('0x1b')](_0x17bf53);BPromise['each'](_0x553552,handleQuery)['then'](function(_0x35c238){BPromise[_0xc48a('0x1c')]([handleAdditionalPhones()])[_0xc48a('0x1d')](function(){_0x553552=[];for(var _0x1dc87a=0x0;_0x1dc87a<promisesContact[_0xc48a('0x20')];_0x1dc87a++){_0x553552['push'](updateContact(promisesContact[_0x1dc87a]['contact']));}BPromise[_0xc48a('0x1c')](_0x553552)['then'](function(){_0x553552=[];for(var _0x5273c4=0x0;_0x5273c4<promisesAdditionalPhones['length'];_0x5273c4++){_0x553552['push'](createAdditionalPhone(promisesAdditionalPhones[_0x5273c4]['contactId'],promisesAdditionalPhones[_0x5273c4][_0xc48a('0x89')],promisesAdditionalPhones[_0x5273c4]['phone'],promisesAdditionalPhones[_0x5273c4][_0xc48a('0x8a')]));}BPromise[_0xc48a('0x1c')](_0x553552)[_0xc48a('0x1d')](function(){_0x553552=[];_0x553552[_0xc48a('0x1b')](insertCmHopperAdditionalPhones(_0x324f30['ListId']));_0x553552[_0xc48a('0x1b')]('DROP\x20TABLE\x20'+_0x2c5ad1+';');BPromise['each'](_0x553552,handleQuery)[_0xc48a('0x1d')](function(_0xf4651b){stats[_0xc48a('0x8b')]=!![];stats[_0xc48a('0x8c')]=updatedRows;socket[_0xc48a('0x80')](_0xc48a('0x81')+_0x1fc702,stats);fs['unlink'](_0x40fba6);fs[_0xc48a('0x8d')](_0x4e9077);process[_0xc48a('0x5b')](0x0);})['catch'](function(_0x184fe0){logger[_0xc48a('0x1e')](_0x184fe0['message']);process['exit'](0x1);});});});});})[_0xc48a('0x5e')](function(_0x4e3f63){logger[_0xc48a('0x1e')](_0x4e3f63[_0xc48a('0x5a')]);process[_0xc48a('0x5b')](0x1);});}catch(_0x55968c){logger['error'](_0xc48a('0x8e'),_0x55968c[_0xc48a('0x5a')]);process[_0xc48a('0x5b')](0x1);}},'error':function(_0x4534ae,_0x3d362c,_0x4c8cac,_0x237038){throw new Error(_0x237038);}});});}function validate(){if(process[_0xc48a('0x8f')]&&process[_0xc48a('0x8f')][_0xc48a('0x20')]<0x4){throw new Error('arguments\x20<filename>\x20<parameters>\x20<agents>');}var _0x17320e=path[_0xc48a('0x12')](config[_0xc48a('0x65')],'server/files/tmp',process[_0xc48a('0x8f')][0x2]);if(!fs[_0xc48a('0x90')](_0x17320e)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x27e3e8={};try{_0x27e3e8=JSON[_0xc48a('0x6c')](process[_0xc48a('0x8f')][0x3]);if(!_0x27e3e8[_0xc48a('0x62')]){throw new Error(_0xc48a('0x91'));}var _0x20bd64=0x0;if(_0x27e3e8['binding'][_0xc48a('0x37')]){_0x20bd64=0x1;}if(!_0x27e3e8[_0xc48a('0x34')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x2cfa95){throw new Error('body\x20id\x20mandatory');}var _0xb7e138=[];try{_0xb7e138=_['map'](JSON[_0xc48a('0x6c')](process[_0xc48a('0x8f')][0x4]),'id');}catch(_0x3b94a4){logger['info'](_0xc48a('0x92'));}main(_0x17320e,_0x27e3e8,_0xb7e138,_0x20bd64);}validate();process['on'](_0xc48a('0x93'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
+var _0x2396=['isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','firstName','itemTypeId','description','SystemRow','rows','abort','SystemError','step','\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\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','contact','contactTypeId','orderBy','DROP\x20TABLE\x20','each','affectedRows','contact:import:','complete','arguments\x20<filename>\x20<parameters>\x20<agents>','argv','file\x20doesn\x27t\x20exists','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','from','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','spread','length','isNil','push','all','then','catch','error','message','split','CmContactHasItem','findOne','update','updated','create','CmContact','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','into','fromQuery','scheduledat','ListId','updatedAt','priority','UserId','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22onlyIfOpen\x22','\x22always\x22','toString','insert','cm_hopper_black','ContactId','createdAt','fields','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','CmHopperId','OrderBy','cm_contacts','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','exit','code','stringify','send','binding','clone','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','_description','AdditionalPhones','header','writeFileSync','parse','createReadStream','data','errors','find','hasOwnProperty','trim','replace'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x2396,0xb9));var _0x6239=function(_0x5ca644,_0x3d2165){_0x5ca644=_0x5ca644-0x0;var _0x5c87a2=_0x2396[_0x5ca644];return _0x5c87a2;};'use strict';var fs=require('fs');var path=require(_0x6239('0x0'));var _=require('lodash');var Papa=require(_0x6239('0x1'));var util=require(_0x6239('0x2'));var BPromise=require(_0x6239('0x3'));var moment=require(_0x6239('0x4'));var squel=require('squel');var Redis=require(_0x6239('0x5'));var db=require(_0x6239('0x6'))['db'];var config=require(_0x6239('0x7'));var logger=require(_0x6239('0x8'))(_0x6239('0x9'));config['redis']=_[_0x6239('0xa')](config[_0x6239('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6239('0xc'))(new Redis(config[_0x6239('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x6239('0xd')](_0x6239('0xe'));var tempTableName=_0x6239('0xf')+moment()[_0x6239('0xd')](_0x6239('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x589b81){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))*$/[_0x6239('0x11')](_0x589b81);}function selectNotIn(_0x32b908,_0x3cf444,_0x502c43,_0x46e1d2,_0xedac08){return squel[_0x6239('0x12')]()[_0x6239('0x13')](_0x6239('0x14'))[_0x6239('0x15')](_0x46e1d2)[_0x6239('0x16')](_0x3cf444,null,_0x3cf444+'.id\x20=\x20'+_0x46e1d2+'.'+_0x502c43)[_0x6239('0x17')](_0x46e1d2+'.'+_0x502c43+_0x6239('0x18')+_0x32b908+'.'+_0x502c43)['where'](_0x3cf444+_0x6239('0x19')+_0xedac08[_0x6239('0x16')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x156283,_0x19dba1){promisesAdditionalPhones=[];promisesContact=[];return db[_0x6239('0x1a')][_0x6239('0x1b')]('select\x20*\x20from\x20'+tempTableName)[_0x6239('0x1c')](function(_0xb5ea1b){if(_0xb5ea1b!==null){var _0x13c80f=[];for(var _0x48899c=0x0;_0x48899c<_0xb5ea1b[_0x6239('0x1d')];_0x48899c++){var _0x2f3b6=_0xb5ea1b[_0x48899c];if(!_['isNil'](_0x2f3b6[_0x6239('0x14')])){if(!_[_0x6239('0x1e')](_0x2f3b6['AdditionalPhones']))_0x13c80f['push'](insertAdditionalPhones(_0x2f3b6));promisesContact[_0x6239('0x1f')]({'contact':_0x2f3b6});}}}Promise[_0x6239('0x20')](_0x13c80f)[_0x6239('0x21')](function(){_0x156283({'val':0x1});});})[_0x6239('0x22')](function(_0x42a9be){logger[_0x6239('0x23')](_0x42a9be[_0x6239('0x24')]);});});}function insertAdditionalPhones(_0x148f3d){return new Promise(function(_0xa58b49,_0x3076d0){var _0x2a1eaa=_0x148f3d['AdditionalPhones'];if(_[_0x6239('0x1e')](_0x2a1eaa))_0x3076d0({'val':0x0});else{var _0x471960=_0x2a1eaa['split'](';');var _0x568ce4=[];orderBy=0x0;for(var _0x26ecc1=0x0;_0x26ecc1<_0x471960[_0x6239('0x1d')];_0x26ecc1++){_0x568ce4[_0x6239('0x1f')](splitAdditionalPhone(_0x148f3d['id'],_0x471960[_0x26ecc1]));}Promise['all'](_0x568ce4)[_0x6239('0x21')](function(){_0xa58b49({'val':_0x471960[_0x6239('0x1d')]});});}});}function splitAdditionalPhone(_0xca5c8b,_0x4f278b){return new Promise(function(_0x26bd05,_0x185a5f){var _0x3e78f3=_0x4f278b[_0x6239('0x25')](':');var _0x4ecad0=_0x3e78f3[0x0];var _0x503fa5=_0x3e78f3[0x1];if(_0x503fa5!==''){var _0x202caf=_0x503fa5[_0x6239('0x25')]('|');var _0x189087=[];for(var _0x56bac0=0x0;_0x56bac0<_0x202caf[_0x6239('0x1d')];_0x56bac0++){if(_0x202caf[_0x56bac0]!==''){var _0x5ca2d6=_['filter'](promisesAdditionalPhones,{'contactId':_0xca5c8b,'phone':_0x202caf[_0x56bac0]});if(_0x5ca2d6[_0x6239('0x1d')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0xca5c8b,'contactTypeId':_0x4ecad0,'phone':_0x202caf[_0x56bac0],'orderBy':orderBy});}}}_0x26bd05({'ok':0x1});}else _0x26bd05({'res':0x0});});}function createAdditionalPhone(_0x2c4832,_0xa7a68d,_0x262c52,_0x512653){var _0x29054c='';var _0x253ced='';var _0x13e1e5=_0x262c52[_0x6239('0x25')]('§');_0x29054c=_0x13e1e5[0x0];if(_0x13e1e5['length']==0x2)_0x253ced=_0x13e1e5[0x1];return new Promise(function(_0x252824,_0x7e5aaf){return db[_0x6239('0x26')][_0x6239('0x27')]({'where':{'CmContactId':_0x2c4832,'item':_0x29054c}})[_0x6239('0x21')](function(_0x1c9014){if(_0x1c9014){return db[_0x6239('0x26')][_0x6239('0x28')]({'ItemTypeId':_0xa7a68d,'description':_0x253ced,'OrderBy':_0x512653},{'where':{'CmContactId':_0x2c4832,'item':_0x29054c}})[_0x6239('0x21')](function(_0x51172e){_0x252824({'res':_0x6239('0x29')});});}else{return db[_0x6239('0x26')][_0x6239('0x2a')]({'CmContactId':_0x2c4832,'item':_0x29054c,'ItemTypeId':_0xa7a68d,'description':_0x253ced,'OrderBy':_0x512653,'ItemClass':'PHONE'})[_0x6239('0x21')](function(_0xef6b96){_0x252824({'res':'inserted'});});}});});}function updateContact(_0x3e8feb){return new Promise(function(_0x46cbde,_0x42523f){var _0x34549f=_0x3e8feb['id'];delete _0x3e8feb['id'];return db[_0x6239('0x2b')]['update'](_0x3e8feb,{'where':{'id':_0x34549f}})['then'](function(_0x23e1cd){updatedRows+=0x1;return db['CmHopper']['update']({'phone':_0x3e8feb[_0x6239('0x14')]},{'where':{'ContactId':_0x34549f}})[_0x6239('0x21')](function(_0x26188b){_0x46cbde({'ret':'OK'});});});});}function insertCmHopper(_0x2414fd,_0x48c3af,_0x1155bf,_0x5c76ab,_0x2e91cc){var _0x57bb1a=[_0x6239('0x2c'),'cm_contacts.scheduledat',_0x6239('0x2d'),_0x6239('0x2e'),_0x48c3af+'.'+_0x5c76ab,_0x6239('0x2f'),_0x6239('0x30'),'cm_contacts.priority',_0x6239('0x31'),'\x22'+_0x2e91cc+'\x22'];return squel['insert']()[_0x6239('0x32')]('cm_hopper')[_0x6239('0x33')]([_0x6239('0x14'),_0x6239('0x34'),'ContactId',_0x6239('0x35'),_0x5c76ab,'createdAt',_0x6239('0x36'),_0x6239('0x37'),_0x6239('0x38'),'recallme'],squel['select']()['fields'](_0x57bb1a)[_0x6239('0x15')](_0x48c3af)[_0x6239('0x16')]('cm_contacts',null,_0x6239('0x39')+_0x48c3af+_0x6239('0x3a'))[_0x6239('0x16')](_0x1155bf,null,_0x1155bf+_0x6239('0x3b')+_0x48c3af+'.'+_0x5c76ab)[_0x6239('0x17')](_0x48c3af+_0x6239('0x3c'),_0x2414fd)[_0x6239('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x6239('0x17')](_0x6239('0x3d'),selectNotIn(_0x48c3af,_0x1155bf,_0x5c76ab,_0x6239('0x3e'),['\x22always\x22',_0x6239('0x3f')]))[_0x6239('0x17')](_0x6239('0x3d'),selectNotIn(_0x48c3af,_0x1155bf,_0x5c76ab,_0x6239('0x3e'),[_0x6239('0x40')])))[_0x6239('0x41')]();}function insertCmHopperBlack(_0x3c7e18,_0x1a263b,_0x4ac922,_0x199556){var _0x2ecade=[_0x6239('0x2c'),'cm_contacts.id','cm_contacts.ListId',_0x1a263b+'.'+_0x199556,'cm_contacts.createdAt',_0x6239('0x30')];return squel[_0x6239('0x42')]()[_0x6239('0x32')](_0x6239('0x43'))['fromQuery']([_0x6239('0x14'),_0x6239('0x44'),_0x6239('0x35'),_0x199556,_0x6239('0x45'),'updatedAt'],squel['select']()[_0x6239('0x46')](_0x2ecade)[_0x6239('0x15')](_0x1a263b)[_0x6239('0x16')]('cm_contacts',null,_0x6239('0x39')+_0x1a263b+_0x6239('0x3a'))[_0x6239('0x16')](_0x4ac922,null,_0x4ac922+'.id\x20=\x20'+_0x1a263b+'.'+_0x199556)['where'](_0x1a263b+'.CmListId\x20=\x20?',_0x3c7e18)['where'](_0x6239('0x47'),NOW)[_0x6239('0x17')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x6239('0x12')]()[_0x6239('0x13')](_0x6239('0x14'))[_0x6239('0x15')](_0x6239('0x43'))[_0x6239('0x17')](_0x6239('0x48'),_0x3c7e18)[_0x6239('0x17')](_0x199556+_0x6239('0x49'),_0x1a263b+'.'+_0x199556)))[_0x6239('0x41')]();}function insertCmHopperAdditionalPhones(_0x2d1d00){var _0x2ce7ba=[_0x6239('0x4a'),'cm_contact_has_items.item',_0x6239('0x4b'),_0x6239('0x4c'),_0x6239('0x4d')];return squel[_0x6239('0x42')]()[_0x6239('0x32')]('cm_hopper_additional_phones')['fromQuery']([_0x6239('0x4e'),'phone',_0x6239('0x4f'),_0x6239('0x45'),_0x6239('0x36')],squel[_0x6239('0x12')]()[_0x6239('0x46')](_0x2ce7ba)[_0x6239('0x15')](_0x6239('0x3e'))[_0x6239('0x16')](_0x6239('0x50'),null,_0x6239('0x51'))[_0x6239('0x16')](_0x6239('0x52'),null,_0x6239('0x53'))[_0x6239('0x17')]('cm_hopper.ListId\x20=\x20?',_0x2d1d00)[_0x6239('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0x6239('0x41')]();}function insertCmContact(_0x5996ca,_0x5b8db0,_0x3c3e1c,_0x175f31){var _0x4de393=_['concat'](_['keys'](_0x175f31),[_0x6239('0x35'),_0x6239('0x54'),'createdAt',_0x6239('0x36')]);return squel[_0x6239('0x42')]()[_0x6239('0x32')](_0x6239('0x50'))[_0x6239('0x33')](_0x4de393,squel[_0x6239('0x12')]()[_0x6239('0x46')](_0x4de393)['from'](_0x5b8db0)[_0x6239('0x17')]('('+_0x3c3e1c[_0x6239('0x16')](',')+_0x6239('0x55'),squel[_0x6239('0x12')]()[_0x6239('0x46')](_0x3c3e1c)[_0x6239('0x15')](_0x6239('0x50'))['where'](_0x6239('0x48'),_0x5996ca))[_0x6239('0x17')](_0x6239('0x56'),squel['select']()[_0x6239('0x13')](_0x6239('0x57'),_0x6239('0x58'))[_0x6239('0x15')](_0x5b8db0)[_0x6239('0x59')](_0x3c3e1c[_0x6239('0x16')](','))))[_0x6239('0x41')]();}function handleStop(){logger[_0x6239('0x5a')](_0x6239('0x5b'));stopped=!![];}function handleUncaughtException(_0x4c34a5){logger[_0x6239('0x23')](_0x4c34a5[_0x6239('0x24')]);process[_0x6239('0x5c')](0x1);}function handleError(_0xf8386,_0x2510ef){stats['errors'][_0x6239('0x1f')]({'name':_0x2510ef[_0x6239('0x5d')],'message':_0x2510ef[_0x6239('0x24')],'row':_0xf8386});}function handleQuery(_0xed2b41){logger['info'](_0xed2b41);return db['sequelize'][_0x6239('0x1b')](_0xed2b41)[_0x6239('0x1c')](function(_0xa96cf){results[_0x6239('0x1f')](_0xa96cf);})[_0x6239('0x22')](function(_0x49b9e4){logger['error'](_0x49b9e4['message']);});}function main(_0x3015d4,_0x45e875,_0x111d44,_0x1f21d2){logger[_0x6239('0x5a')]('main',_0x3015d4,JSON[_0x6239('0x5e')](_0x45e875));process[_0x6239('0x5f')]('start');var _0x3baecb=_0x45e875[_0x6239('0x60')];var _0x28c0ec=_[_0x6239('0x61')](_0x3baecb);var _0x3ac3c7=_0x45e875['socket_timestamp'];var _0xd3310d=path[_0x6239('0x16')](config[_0x6239('0x62')],_0x6239('0x63'),_0x3ac3c7+_0x6239('0x64'));logger[_0x6239('0x5a')](_0x6239('0x65'),_0x45e875);db[_0x6239('0x66')][_0x6239('0x67')]({'raw':!![],'attributes':['id',_0x6239('0x68')]})[_0x6239('0x21')](function(_0x90d36e){for(var _0x5a58a9=0x0;_0x5a58a9<_0x90d36e[_0x6239('0x1d')];_0x5a58a9++){if(_0x90d36e[_0x5a58a9]['name']in _0x3baecb){contactItemTypes['push'](_0x90d36e[_0x5a58a9]);delete _0x28c0ec[_0x90d36e[_0x5a58a9][_0x6239('0x68')]];hasAdditionalPhones=!![];}for(var _0x4a2b64 in _0x3baecb){if(_0x90d36e[_0x5a58a9][_0x6239('0x68')]+_0x6239('0x69')===_0x4a2b64){phoneDescriptions['push']({'itemTypeId':_0x90d36e[_0x5a58a9]['id'],'description':_0x4a2b64});delete _0x28c0ec[_0x4a2b64];}}}if(hasAdditionalPhones)_0x28c0ec[_0x6239('0x6a')]='';var _0x41233d=_['keys'](_0x28c0ec)['join']();logger[_0x6239('0x5a')](_0x6239('0x6b'),_0x41233d);fs[_0x6239('0x6c')](_0xd3310d,_0x41233d+'\x0a');Papa[_0x6239('0x6d')](fs[_0x6239('0x6e')](_0x3015d4),{'header':!![],'skipEmptyLines':!![],'step':function(_0x41a53d,_0x5e6834){try{for(var _0x146840=0x0,_0x2c41a5=[];_0x146840<_0x41a53d[_0x6239('0x6f')][_0x6239('0x1d')];_0x146840++){stats['rows']+=0x1;if(_0x41a53d['errors'][_0x146840]){handleError(_0x41a53d[_0x6239('0x6f')][_0x146840],_0x41a53d[_0x6239('0x70')][_0x146840]);}else{var _0x5f2174=[];var _0x14a8b1=[];var _0x403b11={};for(var _0x47a9c6 in _0x3baecb){let _0x1dd871=contactItemTypes[_0x6239('0x71')](_0x50ab74=>_0x50ab74[_0x6239('0x68')]===_0x47a9c6);let _0x26304e=contactItemTypes[_0x6239('0x71')](_0x536779=>_0x536779['name']+_0x6239('0x69')===_0x47a9c6);if(_[_0x6239('0x1e')](_0x1dd871)&&_[_0x6239('0x1e')](_0x26304e)){if(_0x3baecb[_0x6239('0x72')](_0x47a9c6)){if(_0x41a53d['data'][_0x146840][_0x3baecb[_0x47a9c6]]){var _0x3704d1=_[_0x6239('0x73')](_0x41a53d[_0x6239('0x6f')][_0x146840][_0x3baecb[_0x47a9c6]][_0x6239('0x74')](/"/g,'\x27'));switch(_0x47a9c6){case _0x6239('0x34'):var _0x17a0b6=moment(_0x3704d1,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x17a0b6[_0x6239('0x75')]()){_0x2c41a5[_0x6239('0x1f')]('\x22'+_0x3704d1+'\x22');}else{_0x5f2174[_0x6239('0x1f')](_0x6239('0x76'));}break;case'priority':var _0x46f11f=parseInt(_0x3704d1);_0x3704d1=_[_0x6239('0x77')](_0x46f11f)||_0x46f11f<0x0||_0x46f11f>0x4?_0x1f21d2?0x3:0x2:_0x46f11f;_0x2c41a5[_0x6239('0x1f')]('\x22'+_0x3704d1+'\x22');break;case _0x6239('0x38'):var _0x4d9219=parseInt(_0x3704d1);if(_['isNumber'](_0x4d9219)&&_['includes'](_0x111d44,_0x4d9219)){_0x2c41a5[_0x6239('0x1f')]('\x22'+_0x4d9219+'\x22');}else{_0x5f2174['push'](_0x6239('0x78'));}break;case _0x6239('0x79'):if(isEmail(_0x3704d1)){_0x2c41a5['push']('\x22'+_0x3704d1+'\x22');}else{_0x5f2174[_0x6239('0x1f')]('email\x20wrong\x20format');}break;case _0x6239('0x7a'):var _0x4ec6e6=moment(_0x3704d1,_0x6239('0x7b'),!![]);if(_0x4ec6e6[_0x6239('0x75')]()){_0x2c41a5['push']('\x22'+_0x3704d1+'\x22');}else{_0x5f2174[_0x6239('0x1f')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x2c41a5['push']('\x22'+_0x3704d1+'\x22');}}else{switch(_0x47a9c6){case _0x6239('0x7c'):case'phone':_0x5f2174[_0x6239('0x1f')](_0x47a9c6+'\x20not\x20specified');break;default:_0x2c41a5[_0x6239('0x1f')]('\x22\x22');}}}}else{var _0x4f0275='';if(!_[_0x6239('0x1e')](_0x1dd871)){if(!_0x403b11[_0x6239('0x72')](_0x1dd871['id'])){for(var _0x1a30df=0x0;_0x1a30df<_0x3baecb[_0x47a9c6][_0x6239('0x1d')];_0x1a30df++){var _0x3704d1=_[_0x6239('0x73')](_0x41a53d['data'][_0x146840][_0x3baecb[_0x47a9c6][_0x1a30df]][_0x6239('0x74')](/"/g,'\x27'));var _0x3c4c92=phoneDescriptions[_0x6239('0x71')](_0x219f6c=>_0x219f6c[_0x6239('0x7d')]===_0x1dd871['id']);if(!_[_0x6239('0x1e')](_0x3c4c92)){var _0x1c9b12=_[_0x6239('0x73')](_0x41a53d[_0x6239('0x6f')][_0x146840][_0x3baecb[_0x3c4c92[_0x6239('0x7e')]][0x0]][_0x6239('0x74')](/"/g,'\x27'));if(!_[_0x6239('0x1e')](_0x1c9b12))_0x3704d1=_0x3704d1+'§'+_0x1c9b12;}if(_0x4f0275=='')_0x4f0275=_0x3704d1;else _0x4f0275+='|'+_0x3704d1;}_0x14a8b1[_0x6239('0x1f')](_0x1dd871['id']+':'+_0x4f0275);_0x403b11[_0x1dd871['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2c41a5[_0x6239('0x1f')]('\x22'+_0x14a8b1[_0x6239('0x16')](';')+'\x22');}if(_0x5f2174[_0x6239('0x1d')]){handleError(_0x41a53d[_0x6239('0x6f')][_0x146840],{'code':_0x6239('0x7f'),'message':_0x5f2174[_0x6239('0x16')]()});}else{fs['appendFileSync'](_0xd3310d,_0x2c41a5['join']()+'\x0a');}_0x2c41a5=[];}if(!(stats[_0x6239('0x80')]%0xc8)){socket['emit']('contact:import:'+_0x3ac3c7,stats);stats[_0x6239('0x70')]=[];}}if(stopped){logger[_0x6239('0x5a')]('Abort\x20parser');_0x5e6834[_0x6239('0x81')]();}}catch(_0x5b7e03){handleError(_0x41a53d['data'][_0x146840],{'code':_0x6239('0x82'),'message':_0x5b7e03[_0x6239('0x24')]});logger[_0x6239('0x23')](_0x6239('0x83'),_0x5b7e03['message']);}},'complete':function(){try{var _0x3f3885=[];var _0x3dcabf=tempTableName;_0x3f3885[_0x6239('0x1f')]('CREATE\x20TABLE\x20'+_0x3dcabf+_0x6239('0x84'));logger[_0x6239('0x5a')]('CIS\x20len',contactItemTypes[_0x6239('0x1d')]);var _0x3109df=util[_0x6239('0xd')](_0x6239('0x85'),_0xd3310d,_0x3dcabf,_0x41233d,_0x45e875['ListId'],_0x45e875[_0x6239('0x54')]||null,NOW,NOW);if(_[_0x6239('0x1e')](_0x3baecb[_0x6239('0x34')])){_0x3109df+=_0x6239('0x86');}_0x3f3885['push'](_0x3109df);BPromise['each'](_0x3f3885,handleQuery)[_0x6239('0x21')](function(_0x2c5dac){BPromise[_0x6239('0x20')]([handleAdditionalPhones()])[_0x6239('0x21')](function(){_0x3f3885=[];for(var _0x32436c=0x0;_0x32436c<promisesContact[_0x6239('0x1d')];_0x32436c++){_0x3f3885[_0x6239('0x1f')](updateContact(promisesContact[_0x32436c][_0x6239('0x87')]));}BPromise[_0x6239('0x20')](_0x3f3885)[_0x6239('0x21')](function(){_0x3f3885=[];for(var _0x2c0de9=0x0;_0x2c0de9<promisesAdditionalPhones[_0x6239('0x1d')];_0x2c0de9++){_0x3f3885[_0x6239('0x1f')](createAdditionalPhone(promisesAdditionalPhones[_0x2c0de9]['contactId'],promisesAdditionalPhones[_0x2c0de9][_0x6239('0x88')],promisesAdditionalPhones[_0x2c0de9][_0x6239('0x14')],promisesAdditionalPhones[_0x2c0de9][_0x6239('0x89')]));}BPromise[_0x6239('0x20')](_0x3f3885)[_0x6239('0x21')](function(){_0x3f3885=[];_0x3f3885['push'](insertCmHopperAdditionalPhones(_0x45e875['ListId']));_0x3f3885[_0x6239('0x1f')](_0x6239('0x8a')+_0x3dcabf+';');BPromise[_0x6239('0x8b')](_0x3f3885,handleQuery)[_0x6239('0x21')](function(_0x569724){stats['finish']=!![];stats[_0x6239('0x8c')]=updatedRows;socket['emit'](_0x6239('0x8d')+_0x3ac3c7,stats);fs['unlink'](_0x3015d4);fs['unlink'](_0xd3310d);process['exit'](0x0);})[_0x6239('0x22')](function(_0x59d453){logger[_0x6239('0x23')](_0x59d453[_0x6239('0x24')]);process['exit'](0x1);});});});});})[_0x6239('0x22')](function(_0x1987b1){logger['error'](_0x1987b1[_0x6239('0x24')]);process[_0x6239('0x5c')](0x1);});}catch(_0x1b704e){logger[_0x6239('0x23')](_0x6239('0x8e'),_0x1b704e[_0x6239('0x24')]);process[_0x6239('0x5c')](0x1);}},'error':function(_0x490d55,_0x36dc02,_0x52d6e5,_0x12cb0e){throw new Error(_0x12cb0e);}});});}function validate(){if(process['argv']&&process['argv'][_0x6239('0x1d')]<0x4){throw new Error(_0x6239('0x8f'));}var _0x3d9100=path[_0x6239('0x16')](config[_0x6239('0x62')],_0x6239('0x63'),process[_0x6239('0x90')][0x2]);if(!fs['existsSync'](_0x3d9100)){throw new Error(_0x6239('0x91'));}var _0x51d854={};try{_0x51d854=JSON['parse'](process['argv'][0x3]);if(!_0x51d854[_0x6239('0x60')]){throw new Error('binding\x20doesn\x27t\x20exists');}var _0xd69168=0x0;if(_0x51d854[_0x6239('0x60')][_0x6239('0x38')]){_0xd69168=0x1;}if(!_0x51d854[_0x6239('0x35')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x5c79ae){throw new Error(_0x6239('0x92'));}var _0x3e72a2=[];try{_0x3e72a2=_[_0x6239('0x93')](JSON[_0x6239('0x6d')](process['argv'][0x4]),'id');}catch(_0x38cc84){logger[_0x6239('0x5a')](_0x6239('0x94'));}main(_0x3d9100,_0x51d854,_0x3e72a2,_0xd69168);}validate();process['on'](_0x6239('0x95'),handleStop);process['on'](_0x6239('0x96'),handleUncaughtException);
\ No newline at end of file
index 7c3b67b..f602f58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c2e=['calleridnum','Outbound\x20Call','destcalleridnum','getDescriptions','toLowerCase','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','talktime','membername','Answer\x20Time','Complete\x20Time','endtime','Duration','billableseconds','string','voice','push','variable'];(function(_0x2dc53c,_0x4a29ce){var _0x32ea88=function(_0x159135){while(--_0x159135){_0x2dc53c['push'](_0x2dc53c['shift']());}};_0x32ea88(++_0x4a29ce);}(_0x8c2e,0x178));var _0xe8c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8c2e[_0x3dd15e];return _0x231fd0;};'use strict';exports['getSubjects']=function(_0x1a35e0,_0x2d6049){var _0x5bfa9e=[{'type':_0xe8c2('0x0'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x1a35e0['toLowerCase']()){case _0xe8c2('0x1'):switch(_0x2d6049['toLowerCase']()){case'inbound':_0x5bfa9e[_0xe8c2('0x2')]({'type':_0xe8c2('0x3'),'content':'','variableName':'queue'});_0x5bfa9e[_0xe8c2('0x2')]({'type':_0xe8c2('0x3'),'content':'','variableName':_0xe8c2('0x4')});break;case'outbound':_0x5bfa9e['push']({'type':_0xe8c2('0x0'),'content':_0xe8c2('0x5'),'variableName':null});_0x5bfa9e[_0xe8c2('0x2')]({'type':_0xe8c2('0x3'),'content':'','variableName':_0xe8c2('0x6')});break;}}return _0x5bfa9e;};exports[_0xe8c2('0x7')]=function(_0x2d7d2d,_0xf01493){var _0x29aaf2=[];switch(_0x2d7d2d[_0xe8c2('0x8')]()){case _0xe8c2('0x1'):switch(_0xf01493['toLowerCase']()){case _0xe8c2('0x9'):_0x29aaf2=[{'type':_0xe8c2('0x0'),'content':_0xe8c2('0xa'),'key':null,'keyType':null,'variableName':null},{'type':_0xe8c2('0xb'),'content':'','key':_0xe8c2('0xc'),'keyType':_0xe8c2('0x3'),'variableName':_0xe8c2('0x4')},{'type':_0xe8c2('0xb'),'content':'','key':_0xe8c2('0xd'),'keyType':_0xe8c2('0x3'),'variableName':_0xe8c2('0xe')},{'type':_0xe8c2('0xb'),'content':'','key':'Call\x20To','keyType':_0xe8c2('0x3'),'variableName':'destexten'},{'type':'keyValue','content':'','key':_0xe8c2('0xf'),'keyType':_0xe8c2('0x3'),'variableName':'queue'},{'type':_0xe8c2('0xb'),'content':'','key':_0xe8c2('0x10'),'keyType':'variable','variableName':_0xe8c2('0x11')},{'type':_0xe8c2('0xb'),'content':'','key':_0xe8c2('0x12'),'keyType':_0xe8c2('0x3'),'variableName':_0xe8c2('0x13')},{'type':_0xe8c2('0x0'),'content':_0xe8c2('0x14'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xe8c2('0x15'),'keyType':_0xe8c2('0x3'),'variableName':_0xe8c2('0x16')},{'type':_0xe8c2('0xb'),'content':'','key':_0xe8c2('0x17'),'keyType':_0xe8c2('0x3'),'variableName':_0xe8c2('0x6')},{'type':_0xe8c2('0x0'),'content':_0xe8c2('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xe8c2('0xb'),'content':'','key':_0xe8c2('0x19'),'keyType':_0xe8c2('0x3'),'variableName':_0xe8c2('0x13')},{'type':'keyValue','content':'','key':_0xe8c2('0x1a'),'keyType':_0xe8c2('0x3'),'variableName':_0xe8c2('0x1b')},{'type':_0xe8c2('0xb'),'content':'','key':_0xe8c2('0x1c'),'keyType':_0xe8c2('0x3'),'variableName':_0xe8c2('0x1d')},{'type':'keyValue','content':'','key':_0xe8c2('0x1e'),'keyType':_0xe8c2('0x3'),'variableName':'holdtime'},{'type':_0xe8c2('0xb'),'content':'','key':'Talk\x20Time','keyType':_0xe8c2('0x3'),'variableName':_0xe8c2('0x1f')}];break;case'outbound':_0x29aaf2=[{'type':'string','content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0xe8c2('0xb'),'content':'','key':'Called\x20Number','keyType':_0xe8c2('0x3'),'keyContent':'','variableName':_0xe8c2('0x6')},{'type':_0xe8c2('0xb'),'content':'','key':'Member\x20Name','keyType':_0xe8c2('0x3'),'keyContent':'','variableName':_0xe8c2('0x20')},{'type':'keyValue','content':'','key':_0xe8c2('0x10'),'keyType':_0xe8c2('0x3'),'keyContent':'','variableName':_0xe8c2('0x11')},{'type':_0xe8c2('0xb'),'content':'','key':_0xe8c2('0x12'),'keyType':'variable','keyContent':'','variableName':'starttime'},{'type':_0xe8c2('0x0'),'content':'***\x20Time\x20Info\x20***'},{'type':_0xe8c2('0xb'),'content':'','key':_0xe8c2('0x21'),'keyType':'variable','keyContent':'','variableName':'answertime'},{'type':_0xe8c2('0xb'),'content':'','key':_0xe8c2('0x22'),'keyType':_0xe8c2('0x3'),'keyContent':'','variableName':_0xe8c2('0x23')},{'type':'keyValue','content':'','key':_0xe8c2('0x24'),'keyType':'variable','keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':'Billable\x20Time','keyType':_0xe8c2('0x3'),'keyContent':'','variableName':_0xe8c2('0x25')}];break;}}return _0x29aaf2;};
\ No newline at end of file
+var _0x30e8=['Call\x20To','destexten','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','talktime','Called\x20Number','Member\x20Name','membername','UniqueId','starttime','***\x20Time\x20Info\x20***','answertime','Complete\x20Time','Duration','duration','Billable\x20Time','billableseconds','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','calleridname'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x30e8,0xcf));var _0x830e=function(_0x1a98af,_0x401414){_0x1a98af=_0x1a98af-0x0;var _0x498c1e=_0x30e8[_0x1a98af];return _0x498c1e;};'use strict';exports[_0x830e('0x0')]=function(_0x510512,_0x2eebb0){var _0x1447c7=[{'type':'string','content':_0x830e('0x1'),'variableName':null}];switch(_0x510512[_0x830e('0x2')]()){case _0x830e('0x3'):switch(_0x2eebb0[_0x830e('0x2')]()){case _0x830e('0x4'):_0x1447c7[_0x830e('0x5')]({'type':_0x830e('0x6'),'content':'','variableName':_0x830e('0x7')});_0x1447c7[_0x830e('0x5')]({'type':_0x830e('0x6'),'content':'','variableName':_0x830e('0x8')});break;case _0x830e('0x9'):_0x1447c7[_0x830e('0x5')]({'type':_0x830e('0xa'),'content':_0x830e('0xb'),'variableName':null});_0x1447c7[_0x830e('0x5')]({'type':_0x830e('0x6'),'content':'','variableName':_0x830e('0xc')});break;}}return _0x1447c7;};exports[_0x830e('0xd')]=function(_0x5da1f3,_0x7d9916){var _0x290f1b=[];switch(_0x5da1f3[_0x830e('0x2')]()){case _0x830e('0x3'):switch(_0x7d9916[_0x830e('0x2')]()){case _0x830e('0x4'):_0x290f1b=[{'type':'string','content':_0x830e('0xe'),'key':null,'keyType':null,'variableName':null},{'type':_0x830e('0xf'),'content':'','key':'Caller\x20Number','keyType':_0x830e('0x6'),'variableName':'calleridnum'},{'type':_0x830e('0xf'),'content':'','key':_0x830e('0x10'),'keyType':_0x830e('0x6'),'variableName':_0x830e('0x11')},{'type':_0x830e('0xf'),'content':'','key':_0x830e('0x12'),'keyType':_0x830e('0x6'),'variableName':_0x830e('0x13')},{'type':_0x830e('0xf'),'content':'','key':'Queue','keyType':_0x830e('0x6'),'variableName':_0x830e('0x7')},{'type':'keyValue','content':'','key':'UniqueId','keyType':'variable','variableName':_0x830e('0x14')},{'type':_0x830e('0xf'),'content':'','key':_0x830e('0x15'),'keyType':'variable','variableName':_0x830e('0x16')},{'type':'string','content':_0x830e('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0x830e('0xf'),'content':'','key':_0x830e('0x18'),'keyType':_0x830e('0x6'),'variableName':'destcalleridname'},{'type':'keyValue','content':'','key':'Agent\x20Number','keyType':_0x830e('0x6'),'variableName':_0x830e('0xc')},{'type':_0x830e('0xa'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x830e('0xf'),'content':'','key':_0x830e('0x19'),'keyType':_0x830e('0x6'),'variableName':'agentcalledAt'},{'type':_0x830e('0xf'),'content':'','key':_0x830e('0x1a'),'keyType':'variable','variableName':_0x830e('0x1b')},{'type':_0x830e('0xf'),'content':'','key':_0x830e('0x1c'),'keyType':_0x830e('0x6'),'variableName':_0x830e('0x1d')},{'type':_0x830e('0xf'),'content':'','key':_0x830e('0x1e'),'keyType':'variable','variableName':_0x830e('0x1f')},{'type':_0x830e('0xf'),'content':'','key':'Talk\x20Time','keyType':'variable','variableName':_0x830e('0x20')}];break;case _0x830e('0x9'):_0x290f1b=[{'type':_0x830e('0xa'),'content':_0x830e('0xe'),'variableName':null},{'type':_0x830e('0xf'),'content':'','key':_0x830e('0x21'),'keyType':_0x830e('0x6'),'keyContent':'','variableName':_0x830e('0xc')},{'type':_0x830e('0xf'),'content':'','key':_0x830e('0x22'),'keyType':_0x830e('0x6'),'keyContent':'','variableName':_0x830e('0x23')},{'type':_0x830e('0xf'),'content':'','key':_0x830e('0x24'),'keyType':_0x830e('0x6'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0x830e('0x15'),'keyType':_0x830e('0x6'),'keyContent':'','variableName':_0x830e('0x25')},{'type':_0x830e('0xa'),'content':_0x830e('0x26')},{'type':_0x830e('0xf'),'content':'','key':'Answer\x20Time','keyType':_0x830e('0x6'),'keyContent':'','variableName':_0x830e('0x27')},{'type':_0x830e('0xf'),'content':'','key':_0x830e('0x28'),'keyType':_0x830e('0x6'),'keyContent':'','variableName':'endtime'},{'type':_0x830e('0xf'),'content':'','key':_0x830e('0x29'),'keyType':_0x830e('0x6'),'keyContent':'','variableName':_0x830e('0x2a')},{'type':_0x830e('0xf'),'content':'','key':_0x830e('0x2b'),'keyType':_0x830e('0x6'),'keyContent':'','variableName':_0x830e('0x2c')}];break;}}return _0x290f1b;};
\ No newline at end of file
index b6d416d..10a4f8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a40=['catch','error','tracked','user','query','clone','body','omit','html','phone','fax','mobile','lodash','openchannel-interactions','../../config/logger','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','then','update','info'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8a40,0xec));var _0x08a4=function(_0x2a3dd1,_0x533329){_0x2a3dd1=_0x2a3dd1-0x0;var _0x1b0001=_0x8a40[_0x2a3dd1];return _0x1b0001;};'use strict';var _=require(_0x08a4('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')(_0x08a4('0x1')),'mail':require(_0x08a4('0x2'))('mail-interactions'),'fax':require(_0x08a4('0x2'))('fax-interactions'),'sms':require(_0x08a4('0x2'))('sms-interactions'),'chat':require(_0x08a4('0x2'))('chat-interactions'),'whatsapp':require('../../config/logger')(_0x08a4('0x3'))};function getInteractionId(_0x3798dd,_0xd20bea,_0x2bd71d){if(_0x3798dd&&_0x3798dd[_[_0x08a4('0x4')](_0x2bd71d)+_0x08a4('0x5')]){return _0x3798dd[_[_0x08a4('0x4')](_0x2bd71d)+_0x08a4('0x5')];}else if(_0x3798dd&&_0x3798dd['id']){return _0x3798dd['id'];}else if(_0xd20bea&&_0xd20bea['id']){return _0xd20bea['id'];}else{return _0x08a4('0x6');}}function log(_0x2c9c78,_0x121c5e,_0x26c63d,_0x5e5310,_0x5a7a97,_0x5ae424){loggers[_0x5a7a97[_0x08a4('0x7')]()][_0x2c9c78](_0x08a4('0x8'),_0x5ae424['toUpperCase'](),_0x121c5e?_0x121c5e['id']:null,_0x121c5e?_0x121c5e[_0x08a4('0x9')]:null,_0x121c5e?_0x121c5e[_0x08a4('0xa')]:null,getInteractionId(_0x26c63d,_0x5e5310,_0x5a7a97),_0x26c63d?JSON[_0x08a4('0xb')](_0x26c63d):_0x08a4('0xc'));}function updateUser(_0x300ca2,_0x5971ed,_0x293a25,_0x4511c2,_0x81ea07){db[_[_0x08a4('0x4')](_0x4511c2)+'Interaction']['findOne']({'where':{'id':getInteractionId(_0x5971ed,_0x293a25,_0x4511c2)}})[_0x08a4('0xd')](function(_0x5ca641){if(_0x5ca641){return _0x5ca641[_0x08a4('0xe')]({'UserId':_0x300ca2?_0x300ca2['id']:null});}})['then'](function(_0x3c3304){if(_0x3c3304){log(_0x08a4('0xf'),_0x300ca2,_0x5971ed,_0x293a25,_0x4511c2,_0x81ea07);}})[_0x08a4('0x10')](function(){log(_0x08a4('0x11'),_0x300ca2,_0x5971ed,_0x293a25,_0x4511c2,_0x81ea07);});}exports[_0x08a4('0x12')]=function(_0xdafad7,_0x17c4c4){return function(_0x47b703,_0x28d72d,_0x1b988c){var _0x1e3ff2=_0x47b703[_0x08a4('0x13')];var _0xde1ea6={};var _0x29a504=_0x47b703[_0x08a4('0x14')];if(_0xde1ea6){_0xde1ea6=_[_0x08a4('0x15')](_0x47b703[_0x08a4('0x16')]);_0xde1ea6=_[_0x08a4('0x17')](_0xde1ea6,[_0x08a4('0x16'),_0x08a4('0x18'),_0x08a4('0x19'),_0x08a4('0x1a'),_0x08a4('0x1b')]);}updateUser(_0x1e3ff2,_0xde1ea6,_0x29a504,_0xdafad7,_0x17c4c4);_0x1b988c(null);};};
\ No newline at end of file
+var _0x08e4=['body','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','role','stringify','null','findOne','then','info','catch','error','tracked','query','clone'];(function(_0x906e88,_0x2b5046){var _0x551acb=function(_0x450171){while(--_0x450171){_0x906e88['push'](_0x906e88['shift']());}};_0x551acb(++_0x2b5046);}(_0x08e4,0x1d8));var _0x408e=function(_0x559f53,_0x13a72){_0x559f53=_0x559f53-0x0;var _0x436356=_0x08e4[_0x559f53];return _0x436356;};'use strict';var _=require(_0x408e('0x0'));var db=require(_0x408e('0x1'))['db'];var loggers={'openchannel':require(_0x408e('0x2'))(_0x408e('0x3')),'mail':require(_0x408e('0x2'))('mail-interactions'),'fax':require('../../config/logger')('fax-interactions'),'sms':require('../../config/logger')(_0x408e('0x4')),'chat':require(_0x408e('0x2'))(_0x408e('0x5')),'whatsapp':require('../../config/logger')('whatsapp-interactions')};function getInteractionId(_0x561557,_0xc5de14,_0x1362c3){if(_0x561557&&_0x561557[_[_0x408e('0x6')](_0x1362c3)+_0x408e('0x7')]){return _0x561557[_[_0x408e('0x6')](_0x1362c3)+_0x408e('0x7')];}else if(_0x561557&&_0x561557['id']){return _0x561557['id'];}else if(_0xc5de14&&_0xc5de14['id']){return _0xc5de14['id'];}else{return _0x408e('0x8');}}function log(_0x3fd78f,_0x173e95,_0x3c4788,_0x2ba942,_0xbc3f88,_0x31bfb4){loggers[_0xbc3f88[_0x408e('0x9')]()][_0x3fd78f]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x31bfb4[_0x408e('0xa')](),_0x173e95?_0x173e95['id']:null,_0x173e95?_0x173e95['name']:null,_0x173e95?_0x173e95[_0x408e('0xb')]:null,getInteractionId(_0x3c4788,_0x2ba942,_0xbc3f88),_0x3c4788?JSON[_0x408e('0xc')](_0x3c4788):_0x408e('0xd'));}function updateUser(_0x535914,_0x2c5eb8,_0x539628,_0x45387b,_0x57f634){db[_[_0x408e('0x6')](_0x45387b)+'Interaction'][_0x408e('0xe')]({'where':{'id':getInteractionId(_0x2c5eb8,_0x539628,_0x45387b)}})[_0x408e('0xf')](function(_0x10e4af){if(_0x10e4af){return _0x10e4af['update']({'UserId':_0x535914?_0x535914['id']:null});}})['then'](function(_0x182b15){if(_0x182b15){log(_0x408e('0x10'),_0x535914,_0x2c5eb8,_0x539628,_0x45387b,_0x57f634);}})[_0x408e('0x11')](function(){log(_0x408e('0x12'),_0x535914,_0x2c5eb8,_0x539628,_0x45387b,_0x57f634);});}exports[_0x408e('0x13')]=function(_0x5c6e8e,_0x4251ed){return function(_0x155e54,_0x573ba6,_0x35f343){var _0x11c0d0=_0x155e54['user'];var _0xa2e5c9={};var _0x58dafb=_0x155e54[_0x408e('0x14')];if(_0xa2e5c9){_0xa2e5c9=_[_0x408e('0x15')](_0x155e54[_0x408e('0x16')]);_0xa2e5c9=_['omit'](_0xa2e5c9,[_0x408e('0x16'),'html',_0x408e('0x17'),_0x408e('0x18'),_0x408e('0x19')]);}updateUser(_0x11c0d0,_0xa2e5c9,_0x58dafb,_0x5c6e8e,_0x4251ed);_0x35f343(null);};};
\ No newline at end of file
index 91d15a7..2865bbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc421=['aes-256-ctr','format','%s:%s:%s','base64','utf8','parse','hasOwnProperty','use','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','user','isUserLimit','composable-middleware','../../config/environment','data1','license','split','createDecipher'];(function(_0xeac089,_0x2652e2){var _0x4c886c=function(_0x45eb08){while(--_0x45eb08){_0xeac089['push'](_0xeac089['shift']());}};_0x4c886c(++_0x2652e2);}(_0xc421,0x18a));var _0x1c42=function(_0x221149,_0x508cfe){_0x221149=_0x221149-0x0;var _0x18b7dc=_0xc421[_0x221149];return _0x18b7dc;};'use strict';var crypto=require('crypto');var util=require('util');var compose=require(_0x1c42('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0x1c42('0x1'));function getValueFromLicense(_0x2d28cf,_0x54b0fe){if(_0x2d28cf&&_0x54b0fe){if(_0x54b0fe[_0x1c42('0x2')]&&_0x54b0fe[_0x1c42('0x3')]){var _0x2bfe24=_0x54b0fe[_0x1c42('0x2')];var _0x54d7d2=_0x54b0fe[_0x1c42('0x3')];var _0x4d17f8=_0x2bfe24['split']('-')[0x4];var _0x5d251d=_0x2bfe24[_0x1c42('0x4')]('-')[0x0];var _0x12ae80=crypto[_0x1c42('0x5')](_0x1c42('0x6'),util[_0x1c42('0x7')](_0x1c42('0x8'),_0x4d17f8,_0x2bfe24,_0x5d251d));var _0x207e54=_0x12ae80['update'](_0x54d7d2,_0x1c42('0x9'),_0x1c42('0xa'));_0x207e54+=_0x12ae80['final'](_0x1c42('0xa'));var _0x15355c=JSON[_0x1c42('0xb')](_0x207e54);return _0x15355c[_0x1c42('0xc')](_0x2d28cf)?_0x15355c[_0x2d28cf]:null;}}return null;}function isLimit(_0x3d4389,_0x29ebdf,_0x6b7096,_0x46442f){var _0xe2cff=_0x29ebdf;return compose()[_0x1c42('0xd')](function(_0x46f876,_0x313707,_0x42bca){return db['License'][_0x1c42('0xe')]({'where':{'id':0x1},'raw':!![]})[_0x1c42('0xf')](function(_0x2fcd85){var _0x522e77=getValueFromLicense(_0x3d4389,_0x2fcd85);return _0x522e77?_0x522e77:_0xe2cff;})['then'](function(_0x5e5558){_0xe2cff=_0x5e5558;return _0x6b7096[_0x1c42('0x10')](_0x46442f);})[_0x1c42('0xf')](function(_0x522c03){if(_0x522c03>=_0xe2cff){return _0x313707[_0x1c42('0x11')](0x193)[_0x1c42('0x12')]({'message':util[_0x1c42('0x7')](_0x1c42('0x13'),_0x3d4389)});}_0x42bca();})['catch'](function(_0x3348b3){_0x42bca(_0x3348b3);});});}function isUserLimit(){return isLimit(_0x1c42('0x14'),0x1,db[_0x1c42('0x15')],{'where':{'$or':[{'role':_0x1c42('0x16')},{'role':_0x1c42('0x17')}]}});}exports[_0x1c42('0x18')]=isUserLimit;
\ No newline at end of file
+var _0xd8fe=['parse','hasOwnProperty','License','findOne','then','count','status','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','user','crypto','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final'];(function(_0x51b169,_0x5efbc2){var _0x12605a=function(_0x570f5e){while(--_0x570f5e){_0x51b169['push'](_0x51b169['shift']());}};_0x12605a(++_0x5efbc2);}(_0xd8fe,0x10f));var _0xed8f=function(_0x1cd47d,_0x55bc75){_0x1cd47d=_0x1cd47d-0x0;var _0x29d52f=_0xd8fe[_0x1cd47d];return _0x29d52f;};'use strict';var crypto=require(_0xed8f('0x0'));var util=require('util');var compose=require(_0xed8f('0x1'));var db=require(_0xed8f('0x2'))['db'];var config=require(_0xed8f('0x3'));function getValueFromLicense(_0x292226,_0x1bda38){if(_0x292226&&_0x1bda38){if(_0x1bda38[_0xed8f('0x4')]&&_0x1bda38[_0xed8f('0x5')]){var _0x458137=_0x1bda38[_0xed8f('0x4')];var _0x2bfb06=_0x1bda38[_0xed8f('0x5')];var _0xea333e=_0x458137[_0xed8f('0x6')]('-')[0x4];var _0x1bb466=_0x458137[_0xed8f('0x6')]('-')[0x0];var _0x8d3f=crypto[_0xed8f('0x7')](_0xed8f('0x8'),util[_0xed8f('0x9')](_0xed8f('0xa'),_0xea333e,_0x458137,_0x1bb466));var _0x37f9d2=_0x8d3f[_0xed8f('0xb')](_0x2bfb06,_0xed8f('0xc'),_0xed8f('0xd'));_0x37f9d2+=_0x8d3f[_0xed8f('0xe')](_0xed8f('0xd'));var _0x2d04bb=JSON[_0xed8f('0xf')](_0x37f9d2);return _0x2d04bb[_0xed8f('0x10')](_0x292226)?_0x2d04bb[_0x292226]:null;}}return null;}function isLimit(_0x37d6f7,_0x634728,_0x373890,_0x4d3558){var _0x61f86f=_0x634728;return compose()['use'](function(_0x5c5ed9,_0x1a6d5c,_0x361b84){return db[_0xed8f('0x11')][_0xed8f('0x12')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x1fb473){var _0x37c94d=getValueFromLicense(_0x37d6f7,_0x1fb473);return _0x37c94d?_0x37c94d:_0x61f86f;})[_0xed8f('0x13')](function(_0x13545a){_0x61f86f=_0x13545a;return _0x373890[_0xed8f('0x14')](_0x4d3558);})[_0xed8f('0x13')](function(_0x1b4d46){if(_0x1b4d46>=_0x61f86f){return _0x1a6d5c[_0xed8f('0x15')](0x193)['json']({'message':util['format'](_0xed8f('0x16'),_0x37d6f7)});}_0x361b84();})[_0xed8f('0x17')](function(_0x1dcfca){_0x361b84(_0x1dcfca);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xed8f('0x18')],{'where':{'$or':[{'role':'admin'},{'role':_0xed8f('0x19')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file
index 9ad3a11..ade18be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0be3=['sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','forEach','match','filter','conditions','push','$eq','operator','$between','value','includes','$gt','$lte','format','YYYY-MM-DD','castTo','CAST(','field','\x20AS\x20','text','$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','<=\x20?','$gte','>=\x20?','start','$substring','shift','pop','DATE','utcOffset','add','hours','minutes','seconds','lodash','parseSearch'];(function(_0x31055b,_0x112394){var _0xb3e22f=function(_0x33973f){while(--_0x33973f){_0x31055b['push'](_0x31055b['shift']());}};_0xb3e22f(++_0x112394);}(_0x0be3,0x10c));var _0x30be=function(_0x4cd22f,_0x57c3ea){_0x4cd22f=_0x4cd22f-0x0;var _0x2342d3=_0x0be3[_0x4cd22f];return _0x2342d3;};'use strict';var _=require(_0x30be('0x0'));var moment=require('moment');exports[_0x30be('0x1')]=function(_0x50961c){var _0x436d20={'conditions':[]};_0x436d20[_0x30be('0x2')]=_[_0x30be('0x3')](_0x50961c,_0x30be('0x4'))?'or':_0x30be('0x5');var _0x44b06d=_0x50961c[_0x30be('0x6')](_0x30be('0x7'),'')['replace']('[$or]','')[_0x30be('0x8')]('||');for(var _0x129ef0=0x0;_0x129ef0<_0x44b06d[_0x30be('0x9')];_0x129ef0++){var _0x1250d3=_0x44b06d[_0x129ef0][_0x30be('0x8')](':=');var _0x49b422=_0x1250d3[0x0];var _0x30db6e=_0x1250d3[_0x30be('0xa')](0x1);_0x30db6e[_0x30be('0xb')](function(_0x1c99f8){var _0x41f70c=_0x1c99f8[_0x30be('0x8')]('[')['shift']();var _0x1255bf=_0x1c99f8[_0x30be('0xc')](/\[(.*?)\]/g);_0x1255bf[_0x30be('0xb')](function(_0x2c4fb3){var _0x3d6e85=_0x2c4fb3[_0x30be('0x8')]('[')[_0x30be('0xd')](function(_0x4fb69d){return _0x4fb69d['indexOf'](']')>-0x1;})['map'](function(_0x118e7a){return _0x118e7a['split'](']')[0x0];})[0x0];_0x436d20[_0x30be('0xe')][_0x30be('0xf')]({'field':_0x49b422,'operator':_0x41f70c,'value':_0x3d6e85});});});}return _0x436d20;};exports['buildExpression']=function(_0x54ac40,_0x2bf90a,_0x261a90){var _0x126abe={};if(_0x2bf90a==='DATE'){if(_0x261a90['operator']===_0x30be('0x10')){_0x261a90[_0x30be('0x11')]=_0x30be('0x12');_0x261a90[_0x30be('0x13')]+=','+_0x261a90[_0x30be('0x13')];}else if(_[_0x30be('0x14')]([_0x30be('0x15'),_0x30be('0x16')],_0x261a90['operator'])){_0x261a90['value']=moment(_0x261a90[_0x30be('0x13')])['add'](0x1,'days')[_0x30be('0x17')](_0x30be('0x18'));}}if(_0x261a90[_0x30be('0x19')]){_0x2bf90a=_0x261a90[_0x30be('0x19')];_0x126abe['text']=_0x30be('0x1a')+_0x54ac40+'.'+_0x261a90[_0x30be('0x1b')]+_0x30be('0x1c')+_0x261a90['castTo']+')\x20'+parseOperator(_0x261a90[_0x30be('0x11')]);}else{_0x126abe[_0x30be('0x1d')]=_0x54ac40+'.'+_0x261a90['field']+'\x20'+parseOperator(_0x261a90[_0x30be('0x11')]);}if(_[_0x30be('0x14')]([_0x30be('0x1e'),_0x30be('0x1f')],_0x261a90['operator']))_0x126abe['text']='('+_0x126abe['text']+'\x20OR\x20'+_0x54ac40+'.'+_0x261a90[_0x30be('0x1b')]+_0x30be('0x20');_0x126abe[_0x30be('0x13')]=parseValue(_0x2bf90a,_0x261a90[_0x30be('0x11')],_0x261a90['value']);return _0x126abe;};function parseOperator(_0x50a2aa){var _0xf7de57;switch(_0x50a2aa){case _0x30be('0x21'):_0xf7de57=_0x30be('0x22');break;case'$notIn':_0xf7de57=_0x30be('0x23');break;case _0x30be('0x10'):_0xf7de57=_0x30be('0x24');break;case'$ne':_0xf7de57='<>\x20?';break;case'$substring':case _0x30be('0x25'):case _0x30be('0x26'):_0xf7de57=_0x30be('0x27');break;case _0x30be('0x28'):_0xf7de57='<\x20?';break;case _0x30be('0x15'):_0xf7de57='>\x20?';break;case _0x30be('0x16'):_0xf7de57=_0x30be('0x29');break;case _0x30be('0x2a'):_0xf7de57=_0x30be('0x2b');break;case _0x30be('0x12'):_0xf7de57='BETWEEN\x20?\x20AND\x20?';break;}return _0xf7de57;}function parseValue(_0x4b0bab,_0x5cea05,_0x5b51e9){var _0x5d5d05={'start':undefined,'end':undefined};switch(_0x5cea05){case'$in':case _0x30be('0x1f'):_0x5d5d05[_0x30be('0x2c')]=_0x5b51e9['split'](',');break;case _0x30be('0x2d'):_0x5d5d05['start']='%'+_0x5b51e9+'%';break;case _0x30be('0x25'):_0x5d5d05[_0x30be('0x2c')]=_0x5b51e9+'%';break;case'$endsWith':_0x5d5d05['start']='%'+_0x5b51e9;break;case _0x30be('0x12'):var _0xfcd417=_0x5b51e9[_0x30be('0x8')](',');var _0x5b51e9=_0xfcd417[_0x30be('0x2e')]();var _0x28e801=_0xfcd417[_0x30be('0x2f')]();if(_0x4b0bab===_0x30be('0x30')){_0x5b51e9=moment(_0x5b51e9)[_0x30be('0x31')](0x0,!![])[_0x30be('0x17')]();_0x28e801=moment(_0x28e801)[_0x30be('0x31')](0x0,!![])[_0x30be('0x32')](0x17,_0x30be('0x33'))['add'](0x3b,_0x30be('0x34'))[_0x30be('0x32')](0x3b,_0x30be('0x35'))[_0x30be('0x17')]();}_0x5d5d05={'start':_0x5b51e9,'end':_0x28e801};break;default:_0x5d5d05[_0x30be('0x2c')]=_0x5b51e9;break;}return _0x5d5d05;}
\ No newline at end of file
+var _0x24a1=['slice','forEach','shift','match','indexOf','conditions','buildExpression','DATE','operator','$between','value','$gt','$lte','days','format','YYYY-MM-DD','castTo','text','field','\x20AS\x20','includes','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$startsWith','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','add','minutes','seconds','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length'];(function(_0x2abf2a,_0x253b08){var _0x5aba30=function(_0xab22f7){while(--_0xab22f7){_0x2abf2a['push'](_0x2abf2a['shift']());}};_0x5aba30(++_0x253b08);}(_0x24a1,0x1ae));var _0x124a=function(_0x496562,_0x41b8ef){_0x496562=_0x496562-0x0;var _0x2a0227=_0x24a1[_0x496562];return _0x2a0227;};'use strict';var _=require('lodash');var moment=require(_0x124a('0x0'));exports[_0x124a('0x1')]=function(_0x55d17f){var _0x14d83d={'conditions':[]};_0x14d83d[_0x124a('0x2')]=_[_0x124a('0x3')](_0x55d17f,_0x124a('0x4'))?'or':_0x124a('0x5');var _0x11bfaa=_0x55d17f[_0x124a('0x6')](_0x124a('0x7'),'')[_0x124a('0x6')](_0x124a('0x4'),'')[_0x124a('0x8')]('||');for(var _0x37f0d8=0x0;_0x37f0d8<_0x11bfaa[_0x124a('0x9')];_0x37f0d8++){var _0x5cf945=_0x11bfaa[_0x37f0d8]['split'](':=');var _0x4e7c4a=_0x5cf945[0x0];var _0x5ab533=_0x5cf945[_0x124a('0xa')](0x1);_0x5ab533[_0x124a('0xb')](function(_0x38de75){var _0x43dca4=_0x38de75['split']('[')[_0x124a('0xc')]();var _0x2d858c=_0x38de75[_0x124a('0xd')](/\[(.*?)\]/g);_0x2d858c[_0x124a('0xb')](function(_0x19bd87){var _0x16f4b7=_0x19bd87['split']('[')['filter'](function(_0x5188f4){return _0x5188f4[_0x124a('0xe')](']')>-0x1;})['map'](function(_0x2f8130){return _0x2f8130['split'](']')[0x0];})[0x0];_0x14d83d[_0x124a('0xf')]['push']({'field':_0x4e7c4a,'operator':_0x43dca4,'value':_0x16f4b7});});});}return _0x14d83d;};exports[_0x124a('0x10')]=function(_0x49c0b0,_0x5a77b9,_0x491ff5){var _0x373ad8={};if(_0x5a77b9===_0x124a('0x11')){if(_0x491ff5[_0x124a('0x12')]==='$eq'){_0x491ff5[_0x124a('0x12')]=_0x124a('0x13');_0x491ff5['value']+=','+_0x491ff5[_0x124a('0x14')];}else if(_['includes']([_0x124a('0x15'),_0x124a('0x16')],_0x491ff5[_0x124a('0x12')])){_0x491ff5[_0x124a('0x14')]=moment(_0x491ff5[_0x124a('0x14')])['add'](0x1,_0x124a('0x17'))[_0x124a('0x18')](_0x124a('0x19'));}}if(_0x491ff5[_0x124a('0x1a')]){_0x5a77b9=_0x491ff5[_0x124a('0x1a')];_0x373ad8[_0x124a('0x1b')]='CAST('+_0x49c0b0+'.'+_0x491ff5[_0x124a('0x1c')]+_0x124a('0x1d')+_0x491ff5[_0x124a('0x1a')]+')\x20'+parseOperator(_0x491ff5[_0x124a('0x12')]);}else{_0x373ad8[_0x124a('0x1b')]=_0x49c0b0+'.'+_0x491ff5[_0x124a('0x1c')]+'\x20'+parseOperator(_0x491ff5[_0x124a('0x12')]);}if(_[_0x124a('0x1e')]([_0x124a('0x1f'),_0x124a('0x20')],_0x491ff5[_0x124a('0x12')]))_0x373ad8[_0x124a('0x1b')]='('+_0x373ad8[_0x124a('0x1b')]+_0x124a('0x21')+_0x49c0b0+'.'+_0x491ff5[_0x124a('0x1c')]+_0x124a('0x22');_0x373ad8[_0x124a('0x14')]=parseValue(_0x5a77b9,_0x491ff5['operator'],_0x491ff5['value']);return _0x373ad8;};function parseOperator(_0x39f725){var _0x24639d;switch(_0x39f725){case _0x124a('0x23'):_0x24639d='IN\x20?';break;case'$notIn':_0x24639d=_0x124a('0x24');break;case _0x124a('0x25'):_0x24639d=_0x124a('0x26');break;case _0x124a('0x1f'):_0x24639d=_0x124a('0x27');break;case _0x124a('0x28'):case _0x124a('0x29'):case'$endsWith':_0x24639d='LIKE\x20?';break;case _0x124a('0x2a'):_0x24639d=_0x124a('0x2b');break;case _0x124a('0x15'):_0x24639d=_0x124a('0x2c');break;case _0x124a('0x16'):_0x24639d=_0x124a('0x2d');break;case _0x124a('0x2e'):_0x24639d=_0x124a('0x2f');break;case'$between':_0x24639d=_0x124a('0x30');break;}return _0x24639d;}function parseValue(_0x308cdd,_0x1bf00f,_0x28adbe){var _0x5815e6={'start':undefined,'end':undefined};switch(_0x1bf00f){case _0x124a('0x23'):case _0x124a('0x20'):_0x5815e6[_0x124a('0x31')]=_0x28adbe[_0x124a('0x8')](',');break;case _0x124a('0x28'):_0x5815e6[_0x124a('0x31')]='%'+_0x28adbe+'%';break;case _0x124a('0x29'):_0x5815e6[_0x124a('0x31')]=_0x28adbe+'%';break;case'$endsWith':_0x5815e6[_0x124a('0x31')]='%'+_0x28adbe;break;case _0x124a('0x13'):var _0x302f1e=_0x28adbe[_0x124a('0x8')](',');var _0x28adbe=_0x302f1e['shift']();var _0x5164d8=_0x302f1e[_0x124a('0x32')]();if(_0x308cdd===_0x124a('0x11')){_0x28adbe=moment(_0x28adbe)['utcOffset'](0x0,!![])[_0x124a('0x18')]();_0x5164d8=moment(_0x5164d8)[_0x124a('0x33')](0x0,!![])[_0x124a('0x34')](0x17,'hours')['add'](0x3b,_0x124a('0x35'))[_0x124a('0x34')](0x3b,_0x124a('0x36'))[_0x124a('0x18')]();}_0x5815e6={'start':_0x28adbe,'end':_0x5164d8};break;default:_0x5815e6[_0x124a('0x31')]=_0x28adbe;break;}return _0x5815e6;}
\ No newline at end of file
index 993ffd6..2625a8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2ca=['isArray','split','limit','offset','sort','map','indexOf','priority','cast','unsigned','substr','col','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','getOptions','query','$id','model','attributes','nolimit','order','where','pick','filter','object','value','VIRTUAL','lower','merge','options','lodash','sequelize','moment','parse','keys','includes','fields','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid'];(function(_0xc7fab1,_0x4a3c37){var _0x258fd5=function(_0x4ef3fb){while(--_0x4ef3fb){_0xc7fab1['push'](_0xc7fab1['shift']());}};_0x258fd5(++_0x4a3c37);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x5c846d,_0x5c02ce){_0x5c846d=_0x5c846d-0x0;var _0xd064e4=_0xf2ca[_0x5c846d];return _0xd064e4;};'use strict';var _=require(_0xaf2c('0x0'));var sequelize=require(_0xaf2c('0x1'));var moment=require(_0xaf2c('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x598667){var _0xbb7f52=['ne'];try{var _0x2102e2=JSON[_0xaf2c('0x3')](_0x598667);var _0x219511=Object[_0xaf2c('0x4')](_0x2102e2)[0x0];return _0xbb7f52[_0xaf2c('0x5')](_0x219511);}catch(_0x5b8c81){return![];}}function getOperatorValue(_0x1fd101){var _0x100d17=JSON[_0xaf2c('0x3')](_0x1fd101);var _0x1f9531=Object['keys'](_0x100d17)[0x0];var _0x37fedd=_0x100d17[_0x1f9531];return{['$'+_0x1f9531]:_0x37fedd};}exports[_0xaf2c('0x6')]=function(_0x4a7397){var _0x2a011d=null;if(_0x4a7397){_0x2a011d=_0x4a7397['split'](',');}return _0x2a011d;};exports[_0xaf2c('0x7')]=function(_0x4a0064,_0x2f5099){var _0x144a7a={};if(!_[_0xaf2c('0x8')](_0x4a0064)){_[_0xaf2c('0x9')](_0x4a0064,function(_0x5ad9b0,_0x4adc8c){try{if(_0x2f5099){var _0x2c0d88=_[_0xaf2c('0xa')](_0x2f5099,{'name':_0x4adc8c})||{};if(hasSequelizeOperator(_0x5ad9b0)){_0x144a7a[_0x4adc8c]=getOperatorValue(_0x5ad9b0);}else if(_0x2c0d88[_0xaf2c('0xb')]===_0xaf2c('0xc')&&_[_0xaf2c('0xd')](_0x5ad9b0)){var _0x59a59b=JSON['parse'](_0x5ad9b0);var _0x15ccb4={'$gte':moment(moment(_0x59a59b[_0xaf2c('0xe')])[_0xaf2c('0xf')](_0xaf2c('0x10')))[_0xaf2c('0x11')]()[_0xaf2c('0xf')](),'$lte':moment(moment(_0x59a59b[_0xaf2c('0x12')])[_0xaf2c('0xf')](_0xaf2c('0x10')))[_0xaf2c('0x11')]()[_0xaf2c('0x13')](0x1,'s')[_0xaf2c('0xf')]()};_0x144a7a[_0x4adc8c]=_0x15ccb4;}else if(_0x2c0d88[_0xaf2c('0x14')]===_0xaf2c('0x15')){_0x144a7a[_0x4adc8c]=_0x5ad9b0;}else{_0x144a7a[_0x4adc8c]=_[_0xaf2c('0x16')](_0x5ad9b0)?_0x5ad9b0:JSON['parse'](_0x5ad9b0);}}else{_0x144a7a[_0x4adc8c]=_[_0xaf2c('0x16')](_0x5ad9b0)?_0x5ad9b0:JSON['parse'](_0x5ad9b0);}}catch(_0x278a28){_0x144a7a[_0x4adc8c]=_0x5ad9b0[_0xaf2c('0x17')](',');}});}return _0x144a7a;};exports[_0xaf2c('0x18')]=function(_0x578492){_0x578492=parseInt(_0x578492,0xa);if(!_0x578492||_0x578492<0x0){_0x578492=LIMIT_VALUE;}return _0x578492;};exports[_0xaf2c('0x19')]=function(_0x297bcd){_0x297bcd=parseInt(_0x297bcd,0xa);if(!_0x297bcd||_0x297bcd<0x0){_0x297bcd=0x0;}return _0x297bcd;};exports[_0xaf2c('0x1a')]=function(_0x20000b){var _0x3f977c,_0x1b7f07=null;if(_0x20000b){_0x3f977c=_0x20000b['split'](',');_0x1b7f07=_[_0xaf2c('0x1b')](_0x3f977c,function(_0x164bcb){if(_0x164bcb[_0xaf2c('0x1c')]('-')===0x0){return[_0x164bcb===_0xaf2c('0x1d')?sequelize[_0xaf2c('0x1e')](sequelize['col'](_0xaf2c('0x1d')),_0xaf2c('0x1f')):_0x164bcb[_0xaf2c('0x20')](0x1),'DESC'];}else{return[_0x164bcb==='priority'?sequelize[_0xaf2c('0x1e')](sequelize[_0xaf2c('0x21')](_0xaf2c('0x1d')),_0xaf2c('0x1f')):_0x164bcb,'ASC'];}});}return _0x1b7f07;};exports[_0xaf2c('0x22')]=function(_0xf1a7cf,_0x3a0145){if(_[_0xaf2c('0x8')](_0xf1a7cf)){return _0xf1a7cf;}if(_[_0xaf2c('0x16')](_0xf1a7cf)){for(var _0xff396f=0x0;_0xff396f<_0xf1a7cf[_0xaf2c('0x23')];_0xff396f+=0x1){_0xf1a7cf[_0xff396f]=this['omit'](_0xf1a7cf[_0xff396f],_0x3a0145);}return _0xf1a7cf;}if(!_[_0xaf2c('0x24')](_0xf1a7cf)){return _0xf1a7cf;}if(_[_0xaf2c('0x25')](_0x3a0145)){_0x3a0145=[_0x3a0145];}if(!_[_0xaf2c('0x16')](_0x3a0145)){return _0xf1a7cf;}for(var _0x410536=0x0;_0x410536<_0x3a0145['length'];_0x410536+=0x1){_[_0xaf2c('0x26')](_0xf1a7cf,_0x3a0145[_0x410536]);}for(var _0x589d47 in _0xf1a7cf){if(_0xf1a7cf[_0xaf2c('0x27')](_0x589d47)){_0xf1a7cf[_0x589d47]=this[_0xaf2c('0x22')](_0xf1a7cf[_0x589d47],_0x3a0145);}}return _0xf1a7cf;};exports[_0xaf2c('0x28')]=function(_0x5d685a){return _0x5d685a[_0xaf2c('0x29')](RegExp(_0xaf2c('0x2a')))?!![]:![];};exports[_0xaf2c('0x2b')]=function(_0x4a96d2){return _0x4a96d2[_0xaf2c('0x29')](/^\S+@\S+$/)?!![]:![];};exports[_0xaf2c('0x2c')]=function(_0x42e2a5){var _0x19364e=[];_0x42e2a5['split'](/[ ,]+/)[_0xaf2c('0x2d')](function(_0x4072ff){_0x4072ff=_0x4072ff[_0xaf2c('0x2e')](/([^:]")"+/g,'$1');_0x4072ff='+'+_0x4072ff+'*';var _0x51a49c=/[ `!@#$%^&*()_\-?~]/;if(_0x4072ff['match'](_0x51a49c))_0x4072ff='\x22'+_0x4072ff+'\x22';_0x19364e[_0xaf2c('0x2f')](_0x4072ff);});return _0x19364e['join']('\x20');};exports[_0xaf2c('0x30')]=function(_0x5e7247,_0x337cea,_0x1e4de2){var _0x4ffbb9={},_0x1408e3={};if(_0x337cea[_0xaf2c('0x31')]['$id']){_0x337cea[_0xaf2c('0x31')]['id']=_0x337cea[_0xaf2c('0x31')][_0xaf2c('0x32')];delete _0x337cea[_0xaf2c('0x31')][_0xaf2c('0x32')];}_0x4ffbb9[_0xaf2c('0x33')]=_['map'](_0x5e7247,_0xaf2c('0x14'));_0x4ffbb9['query']=_[_0xaf2c('0x4')](_0x337cea['query']);_0x4ffbb9[_0xaf2c('0x7')]=_['intersection'](_0x4ffbb9[_0xaf2c('0x33')],_0x4ffbb9['query']);_0x1408e3[_0xaf2c('0x34')]=_['intersection'](_0x4ffbb9[_0xaf2c('0x33')],this[_0xaf2c('0x6')](_0x337cea[_0xaf2c('0x31')][_0xaf2c('0x6')]));_0x1408e3[_0xaf2c('0x34')]=_0x1408e3['attributes']['length']?_0x1408e3[_0xaf2c('0x34')]:_0x4ffbb9[_0xaf2c('0x33')];if(!_0x337cea[_0xaf2c('0x31')][_0xaf2c('0x27')](_0xaf2c('0x35'))){_0x1408e3[_0xaf2c('0x18')]=this['limit'](_0x337cea[_0xaf2c('0x31')][_0xaf2c('0x18')]);_0x1408e3['offset']=this[_0xaf2c('0x19')](_0x337cea[_0xaf2c('0x31')][_0xaf2c('0x19')]);}_0x1408e3[_0xaf2c('0x36')]=this[_0xaf2c('0x1a')](_0x337cea[_0xaf2c('0x31')][_0xaf2c('0x1a')]);_0x1408e3[_0xaf2c('0x37')]=this[_0xaf2c('0x7')](_[_0xaf2c('0x38')](_0x337cea[_0xaf2c('0x31')],_0x4ffbb9[_0xaf2c('0x7')]),_0x5e7247);if(_0x337cea[_0xaf2c('0x31')]['filter']){var _0x54a953=_0x5e7247;var _0x4db7d0=_0x337cea[_0xaf2c('0x31')][_0xaf2c('0x39')];if(typeof _0x4db7d0===_0xaf2c('0x3a')){_0x54a953=_[_0xaf2c('0x39')](_0x5e7247,function(_0x715f39){return _[_0xaf2c('0x5')](_0x4db7d0['columns'],_0x715f39[_0xaf2c('0x14')]);});_0x4db7d0=_0x4db7d0[_0xaf2c('0x3b')];}_0x1408e3[_0xaf2c('0x37')]=_['merge'](_0x1408e3['where'],{'$or':_[_0xaf2c('0x1b')](_0x54a953,function(_0x4f8440){if(_0x4f8440[_0xaf2c('0xb')]!==_0xaf2c('0x3c')){if(_0x1e4de2){return sequelize[_0xaf2c('0x37')](sequelize['fn'](_0xaf2c('0x3d'),sequelize['col'](_0x4f8440[_0xaf2c('0x14')])),{'$like':sequelize['fn']('lower','%'+_0x337cea[_0xaf2c('0x31')][_0xaf2c('0x39')]+'%')});}else{var _0x58bd9b={};_0x58bd9b[_0x4f8440[_0xaf2c('0x14')]]={'$like':'%'+_0x337cea['query'][_0xaf2c('0x39')]+'%'};return _0x58bd9b;}}})});}_0x1408e3=_[_0xaf2c('0x3e')]({},_0x1408e3,_0x337cea[_0xaf2c('0x3f')]);return _0x1408e3;};
\ No newline at end of file
+var _0x8958=['$gte','format','YYYY-MM-DD','utc','subtract','uniqueid','isArray','limit','offset','sort','map','indexOf','priority','cast','col','unsigned','DESC','omit','length','unset','hasOwnProperty','match','^[+]?[0-9]*$','isEmail','forEach','replace','join','$id','query','model','name','intersection','attributes','fields','order','pick','filter','object','columns','lower','options','sequelize','parse','keys','includes','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject'];(function(_0x10cdf9,_0x3cde1c){var _0x82fcc9=function(_0x10e78d){while(--_0x10e78d){_0x10cdf9['push'](_0x10cdf9['shift']());}};_0x82fcc9(++_0x3cde1c);}(_0x8958,0x93));var _0x8895=function(_0x2804fa,_0x3100db){_0x2804fa=_0x2804fa-0x0;var _0x4cf40d=_0x8958[_0x2804fa];return _0x4cf40d;};'use strict';var _=require('lodash');var sequelize=require(_0x8895('0x0'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4eda63){var _0x5baab1=['ne'];try{var _0x4cea64=JSON[_0x8895('0x1')](_0x4eda63);var _0x56e738=Object[_0x8895('0x2')](_0x4cea64)[0x0];return _0x5baab1[_0x8895('0x3')](_0x56e738);}catch(_0x26d8e3){return![];}}function getOperatorValue(_0x59e641){var _0x22fa52=JSON[_0x8895('0x1')](_0x59e641);var _0x124e1e=Object[_0x8895('0x2')](_0x22fa52)[0x0];var _0x33013a=_0x22fa52[_0x124e1e];return{['$'+_0x124e1e]:_0x33013a};}exports['fields']=function(_0xe018b8){var _0xc2be9f=null;if(_0xe018b8){_0xc2be9f=_0xe018b8[_0x8895('0x4')](',');}return _0xc2be9f;};exports[_0x8895('0x5')]=function(_0x6eab1e,_0x29c126){var _0x22a12b={};if(!_[_0x8895('0x6')](_0x6eab1e)){_[_0x8895('0x7')](_0x6eab1e,function(_0x107d86,_0x4d1358){try{if(_0x29c126){var _0x1cf600=_[_0x8895('0x8')](_0x29c126,{'name':_0x4d1358})||{};if(hasSequelizeOperator(_0x107d86)){_0x22a12b[_0x4d1358]=getOperatorValue(_0x107d86);}else if(_0x1cf600[_0x8895('0x9')]===_0x8895('0xa')&&_[_0x8895('0xb')](_0x107d86)){var _0xaf93bc=JSON['parse'](_0x107d86);var _0x24c53d={'$gte':moment(moment(_0xaf93bc[_0x8895('0xc')])[_0x8895('0xd')]('YYYY-MM-DD'))['utc']()[_0x8895('0xd')](),'$lte':moment(moment(_0xaf93bc['$lte'])[_0x8895('0xd')](_0x8895('0xe')))[_0x8895('0xf')]()[_0x8895('0x10')](0x1,'s')[_0x8895('0xd')]()};_0x22a12b[_0x4d1358]=_0x24c53d;}else if(_0x1cf600['name']===_0x8895('0x11')){_0x22a12b[_0x4d1358]=_0x107d86;}else{_0x22a12b[_0x4d1358]=_[_0x8895('0x12')](_0x107d86)?_0x107d86:JSON[_0x8895('0x1')](_0x107d86);}}else{_0x22a12b[_0x4d1358]=_[_0x8895('0x12')](_0x107d86)?_0x107d86:JSON[_0x8895('0x1')](_0x107d86);}}catch(_0x1b5c82){_0x22a12b[_0x4d1358]=_0x107d86[_0x8895('0x4')](',');}});}return _0x22a12b;};exports[_0x8895('0x13')]=function(_0x135c11){_0x135c11=parseInt(_0x135c11,0xa);if(!_0x135c11||_0x135c11<0x0){_0x135c11=LIMIT_VALUE;}return _0x135c11;};exports[_0x8895('0x14')]=function(_0x24fef0){_0x24fef0=parseInt(_0x24fef0,0xa);if(!_0x24fef0||_0x24fef0<0x0){_0x24fef0=0x0;}return _0x24fef0;};exports[_0x8895('0x15')]=function(_0x2df795){var _0x54e6d4,_0x522a4e=null;if(_0x2df795){_0x54e6d4=_0x2df795['split'](',');_0x522a4e=_[_0x8895('0x16')](_0x54e6d4,function(_0x456282){if(_0x456282[_0x8895('0x17')]('-')===0x0){return[_0x456282===_0x8895('0x18')?sequelize[_0x8895('0x19')](sequelize[_0x8895('0x1a')](_0x8895('0x18')),_0x8895('0x1b')):_0x456282['substr'](0x1),_0x8895('0x1c')];}else{return[_0x456282===_0x8895('0x18')?sequelize[_0x8895('0x19')](sequelize[_0x8895('0x1a')](_0x8895('0x18')),'unsigned'):_0x456282,'ASC'];}});}return _0x522a4e;};exports[_0x8895('0x1d')]=function(_0x398382,_0x38f7ad){if(_[_0x8895('0x6')](_0x398382)){return _0x398382;}if(_['isArray'](_0x398382)){for(var _0x25da11=0x0;_0x25da11<_0x398382[_0x8895('0x1e')];_0x25da11+=0x1){_0x398382[_0x25da11]=this[_0x8895('0x1d')](_0x398382[_0x25da11],_0x38f7ad);}return _0x398382;}if(!_['isObject'](_0x398382)){return _0x398382;}if(_['isString'](_0x38f7ad)){_0x38f7ad=[_0x38f7ad];}if(!_[_0x8895('0x12')](_0x38f7ad)){return _0x398382;}for(var _0x555e60=0x0;_0x555e60<_0x38f7ad[_0x8895('0x1e')];_0x555e60+=0x1){_[_0x8895('0x1f')](_0x398382,_0x38f7ad[_0x555e60]);}for(var _0x10b48f in _0x398382){if(_0x398382[_0x8895('0x20')](_0x10b48f)){_0x398382[_0x10b48f]=this[_0x8895('0x1d')](_0x398382[_0x10b48f],_0x38f7ad);}}return _0x398382;};exports['isNumeric']=function(_0x4d567a){return _0x4d567a[_0x8895('0x21')](RegExp(_0x8895('0x22')))?!![]:![];};exports[_0x8895('0x23')]=function(_0x16b65b){return _0x16b65b[_0x8895('0x21')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x4ce759){var _0x46ae32=[];_0x4ce759[_0x8895('0x4')](/[ ,]+/)[_0x8895('0x24')](function(_0x29f565){_0x29f565=_0x29f565[_0x8895('0x25')](/([^:]")"+/g,'$1');_0x29f565='+'+_0x29f565+'*';var _0x52f2ac=/[ `!@#$%^&*()_\-?~]/;if(_0x29f565[_0x8895('0x21')](_0x52f2ac))_0x29f565='\x22'+_0x29f565+'\x22';_0x46ae32['push'](_0x29f565);});return _0x46ae32[_0x8895('0x26')]('\x20');};exports['getOptions']=function(_0x40ba14,_0x1a3fe5,_0x233473){var _0x3e71fa={},_0x1dca3d={};if(_0x1a3fe5['query'][_0x8895('0x27')]){_0x1a3fe5[_0x8895('0x28')]['id']=_0x1a3fe5[_0x8895('0x28')][_0x8895('0x27')];delete _0x1a3fe5[_0x8895('0x28')]['$id'];}_0x3e71fa[_0x8895('0x29')]=_['map'](_0x40ba14,_0x8895('0x2a'));_0x3e71fa['query']=_[_0x8895('0x2')](_0x1a3fe5[_0x8895('0x28')]);_0x3e71fa[_0x8895('0x5')]=_[_0x8895('0x2b')](_0x3e71fa[_0x8895('0x29')],_0x3e71fa['query']);_0x1dca3d[_0x8895('0x2c')]=_['intersection'](_0x3e71fa[_0x8895('0x29')],this[_0x8895('0x2d')](_0x1a3fe5[_0x8895('0x28')][_0x8895('0x2d')]));_0x1dca3d[_0x8895('0x2c')]=_0x1dca3d[_0x8895('0x2c')]['length']?_0x1dca3d[_0x8895('0x2c')]:_0x3e71fa[_0x8895('0x29')];if(!_0x1a3fe5['query'][_0x8895('0x20')]('nolimit')){_0x1dca3d[_0x8895('0x13')]=this[_0x8895('0x13')](_0x1a3fe5['query'][_0x8895('0x13')]);_0x1dca3d[_0x8895('0x14')]=this['offset'](_0x1a3fe5['query'][_0x8895('0x14')]);}_0x1dca3d[_0x8895('0x2e')]=this[_0x8895('0x15')](_0x1a3fe5[_0x8895('0x28')][_0x8895('0x15')]);_0x1dca3d['where']=this[_0x8895('0x5')](_[_0x8895('0x2f')](_0x1a3fe5[_0x8895('0x28')],_0x3e71fa[_0x8895('0x5')]),_0x40ba14);if(_0x1a3fe5[_0x8895('0x28')][_0x8895('0x30')]){var _0x4a7e22=_0x40ba14;var _0x174be1=_0x1a3fe5['query'][_0x8895('0x30')];if(typeof _0x174be1===_0x8895('0x31')){_0x4a7e22=_['filter'](_0x40ba14,function(_0x1ca234){return _['includes'](_0x174be1[_0x8895('0x32')],_0x1ca234['name']);});_0x174be1=_0x174be1['value'];}_0x1dca3d['where']=_['merge'](_0x1dca3d['where'],{'$or':_['map'](_0x4a7e22,function(_0x447ed6){if(_0x447ed6[_0x8895('0x9')]!=='VIRTUAL'){if(_0x233473){return sequelize['where'](sequelize['fn'](_0x8895('0x33'),sequelize[_0x8895('0x1a')](_0x447ed6['name'])),{'$like':sequelize['fn'](_0x8895('0x33'),'%'+_0x1a3fe5[_0x8895('0x28')][_0x8895('0x30')]+'%')});}else{var _0x3b873b={};_0x3b873b[_0x447ed6[_0x8895('0x2a')]]={'$like':'%'+_0x1a3fe5['query']['filter']+'%'};return _0x3b873b;}}})});}_0x1dca3d=_['merge']({},_0x1dca3d,_0x1a3fe5[_0x8895('0x34')]);return _0x1dca3d;};
\ No newline at end of file
index 3323c36..e2638cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x4aa662,_0x1cc90c){var _0x336478=function(_0x18b6ef){while(--_0x18b6ef){_0x4aa662['push'](_0x4aa662['shift']());}};_0x336478(++_0x1cc90c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());};
\ No newline at end of file
+var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x57c380,_0x4cdaae){var _0x201cbf=function(_0x792e4f){while(--_0x792e4f){_0x57c380['push'](_0x57c380['shift']());}};_0x201cbf(++_0x4cdaae);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());};
\ No newline at end of file
index f473cde..3166817 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ad6=['head','mac','00:00:00:00:00:00','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','dmidecode\x20--string\x20system-uuid','replace','hostname','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','keys','length','filter','family','IPv4'];(function(_0x99ff94,_0x47a1b1){var _0x1b5bc0=function(_0x25821f){while(--_0x25821f){_0x99ff94['push'](_0x99ff94['shift']());}};_0x1b5bc0(++_0x47a1b1);}(_0x8ad6,0x104));var _0x68ad=function(_0x5646ba,_0x486da7){_0x5646ba=_0x5646ba-0x0;var _0x5bda3c=_0x8ad6[_0x5646ba];return _0x5bda3c;};'use strict';var _=require(_0x68ad('0x0'));var os=require('os');var crypto=require(_0x68ad('0x1'));var machine=require(_0x68ad('0x2'));var exec=require(_0x68ad('0x3'))['execSync'];var config=require(_0x68ad('0x4'));function getInterfaces(){var _0x218bd8=[];var _0x4ca0bf=os[_0x68ad('0x5')]();var _0x3ebe01=_[_0x68ad('0x6')](_[_0x68ad('0x7')](_0x4ca0bf));for(var _0x4eeae3=0x0;_0x4eeae3<_0x3ebe01[_0x68ad('0x8')];_0x4eeae3++){var _0x2f0cd5=_0x4ca0bf[_0x3ebe01[_0x4eeae3]][_0x68ad('0x9')](function(_0x309e77){return _0x309e77[_0x68ad('0xa')]===_0x68ad('0xb')&&_0x309e77['internal']===![];});_0x218bd8=_0x218bd8['concat'](_0x2f0cd5);}return _0x218bd8;}function getFirstInterface(){var _0x3465a7=_[_0x68ad('0xc')](getInterfaces());return{'macAddress':_0x3465a7&&_0x3465a7[_0x68ad('0xd')]?_0x3465a7['mac']:_0x68ad('0xe'),'ipAddress':_0x3465a7&&_0x3465a7['address']?_0x3465a7['address']:_0x68ad('0xf')};}exports[_0x68ad('0x10')]=getFirstInterface;function getCPUhash(){var _0x7d3858=_[_0x68ad('0x6')](os[_0x68ad('0x11')]()[_0x68ad('0x12')](function(_0x5e2e60){return _0x5e2e60[_0x68ad('0x13')];}))[_0x68ad('0x14')](':');return crypto[_0x68ad('0x15')](_0x68ad('0x16'))[_0x68ad('0x17')](_0x7d3858)[_0x68ad('0x18')](_0x68ad('0x19'));}exports[_0x68ad('0x1a')]=function(){var _0x4b866c=os[_0x68ad('0x1b')]();var _0x317ca0=/[0-9a-f-]{36}/;if(config[_0x68ad('0x1c')]&&_0x317ca0['test'](config[_0x68ad('0x1c')])){return config['licenseToken'];}else if(_0x4b866c==='win32'){return exec(_0x68ad('0x1d'),{'encoding':'utf8'})[_0x68ad('0x1e')]('\x0d\x0a','');}else{var _0xd5909e=getFirstInterface();var _0x222631=getCPUhash();var _0x47af0f=_0x222631+'|'+os[_0x68ad('0x1f')]()+'|'+_0xd5909e['macAddress']+'|'+_0xd5909e[_0x68ad('0x20')];var _0x3084c2=crypto[_0x68ad('0x15')](_0x68ad('0x16'))[_0x68ad('0x17')](_0x47af0f)[_0x68ad('0x18')](_0x68ad('0x19'));return _0x3084c2[_0x68ad('0x21')](0x0,0x8)+'-'+_0x3084c2[_0x68ad('0x21')](0x8,0xc)+'-'+_0x3084c2[_0x68ad('0x21')](0xc,0x10)+'-'+_0x3084c2[_0x68ad('0x21')](0x10,0x14)+'-'+_0x3084c2['substring'](0x14);}};
\ No newline at end of file
+var _0x3679=['cpus','map','model','join','createHash','md5','update','hex','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','hostname','macAddress','ipAddress','digest','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','length','family','IPv4','mac','address','getFirstInterface'];(function(_0x181708,_0x48264d){var _0x5ddf57=function(_0x984480){while(--_0x984480){_0x181708['push'](_0x181708['shift']());}};_0x5ddf57(++_0x48264d);}(_0x3679,0x92));var _0x9367=function(_0x523257,_0x563b1a){_0x523257=_0x523257-0x0;var _0x558a77=_0x3679[_0x523257];return _0x558a77;};'use strict';var _=require(_0x9367('0x0'));var os=require('os');var crypto=require(_0x9367('0x1'));var machine=require(_0x9367('0x2'));var exec=require(_0x9367('0x3'))[_0x9367('0x4')];var config=require(_0x9367('0x5'));function getInterfaces(){var _0x42ad5d=[];var _0x2c2564=os[_0x9367('0x6')]();var _0x15b52f=_[_0x9367('0x7')](_['keys'](_0x2c2564));for(var _0x55225b=0x0;_0x55225b<_0x15b52f[_0x9367('0x8')];_0x55225b++){var _0x39310d=_0x2c2564[_0x15b52f[_0x55225b]]['filter'](function(_0x281cd3){return _0x281cd3[_0x9367('0x9')]===_0x9367('0xa')&&_0x281cd3['internal']===![];});_0x42ad5d=_0x42ad5d['concat'](_0x39310d);}return _0x42ad5d;}function getFirstInterface(){var _0x580575=_['head'](getInterfaces());return{'macAddress':_0x580575&&_0x580575[_0x9367('0xb')]?_0x580575[_0x9367('0xb')]:'00:00:00:00:00:00','ipAddress':_0x580575&&_0x580575['address']?_0x580575[_0x9367('0xc')]:'127.0.0.1'};}exports[_0x9367('0xd')]=getFirstInterface;function getCPUhash(){var _0xe3b78a=_['orderBy'](os[_0x9367('0xe')]()[_0x9367('0xf')](function(_0x3db9da){return _0x3db9da[_0x9367('0x10')];}))[_0x9367('0x11')](':');return crypto[_0x9367('0x12')](_0x9367('0x13'))[_0x9367('0x14')](_0xe3b78a)['digest'](_0x9367('0x15'));}exports['getUuid']=function(){var _0x212014=os[_0x9367('0x16')]();var _0x155245=/[0-9a-f-]{36}/;if(config[_0x9367('0x17')]&&_0x155245[_0x9367('0x18')](config['licenseToken'])){return config[_0x9367('0x17')];}else if(_0x212014===_0x9367('0x19')){return exec(_0x9367('0x1a'),{'encoding':'utf8'})['replace']('\x0d\x0a','');}else{var _0x5c2876=getFirstInterface();var _0x580981=getCPUhash();var _0x4694b7=_0x580981+'|'+os[_0x9367('0x1b')]()+'|'+_0x5c2876[_0x9367('0x1c')]+'|'+_0x5c2876[_0x9367('0x1d')];var _0x5a41b8=crypto[_0x9367('0x12')](_0x9367('0x13'))['update'](_0x4694b7)[_0x9367('0x1e')](_0x9367('0x15'));return _0x5a41b8[_0x9367('0x1f')](0x0,0x8)+'-'+_0x5a41b8[_0x9367('0x1f')](0x8,0xc)+'-'+_0x5a41b8[_0x9367('0x1f')](0xc,0x10)+'-'+_0x5a41b8[_0x9367('0x1f')](0x10,0x14)+'-'+_0x5a41b8[_0x9367('0x1f')](0x14);}};
\ No newline at end of file
index 402cfa0..0f0dc67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c32=['version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','decryptString','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','finally','getUuid','License','findOrCreate','message','util','moment','request-promise'];(function(_0x55d8cd,_0x5487e7){var _0x3e0358=function(_0x4f7e6f){while(--_0x4f7e6f){_0x55d8cd['push'](_0x55d8cd['shift']());}};_0x3e0358(++_0x5487e7);}(_0x2c32,0x195));var _0x22c3=function(_0xdbcf66,_0x353b0f){_0xdbcf66=_0xdbcf66-0x0;var _0x105c15=_0x2c32[_0xdbcf66];return _0x105c15;};'use strict';var util=require(_0x22c3('0x0'));var moment=require(_0x22c3('0x1'));var rp=require(_0x22c3('0x2'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0x22c3('0x3'));var db=require(_0x22c3('0x4'))['db'];var encryptor=require(_0x22c3('0x5'));var hardware=require(_0x22c3('0x6'));var logger=require(_0x22c3('0x7'))(_0x22c3('0x8'));var HOST=_0x22c3('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x24bd09){return new BPromise(function(_0x3b5596,_0x598fc6){var _0x5cca66=util[_0x22c3('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0x24bd09,module[_0x22c3('0xb')][_0x22c3('0x3')]);if(oldToken){_0x5cca66=util[_0x22c3('0xa')](_0x22c3('0xc'),HOST,_0x24bd09,module['exports'][_0x22c3('0x3')],oldToken);}var _0x45d5cb={'uri':_0x5cca66,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x45d5cb)[_0x22c3('0xd')](function(_0x489a47){_0x3b5596(_0x489a47);})[_0x22c3('0xe')](function(_0x29936e){_0x598fc6(_0x29936e);});});}function manageLicense(_0x34b081,_0x10d96d){var _0x56bed2=_0x10d96d[_0x22c3('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x56bed2[_0x22c3('0x10')]!==_0x34b081&&!_0x56bed2[_0x22c3('0x11')]){oldToken=_0x56bed2['data1'];}httpRequest(_0x34b081)['then'](function(_0xdfb7f3){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0xdfb7f3[_0x22c3('0x12')]){isOldTokenSent=![];if(!_0x56bed2['license']&&_0x56bed2[_0x22c3('0x8')]!=_0xdfb7f3[_0x22c3('0x8')]||_0x56bed2['license']&&_0x56bed2[_0x22c3('0x11')]){logger[_0x22c3('0x13')](_0x22c3('0x14'));}if(_0x56bed2[_0x22c3('0x8')]&&!_0x56bed2['data2']&&_0x56bed2['license']!=_0xdfb7f3[_0x22c3('0x8')]){logger[_0x22c3('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x56bed2['license']&&!_0x56bed2[_0x22c3('0x11')]&&_0x56bed2[_0x22c3('0x8')]==_0xdfb7f3[_0x22c3('0x8')]){return _0x10d96d;}return _0x10d96d[_0x22c3('0x15')]({'data1':_0x34b081,'data2':null,'license':_0xdfb7f3['license']});}else{if(_0xdfb7f3[_0x22c3('0x8')]||_0x56bed2[_0x22c3('0x8')]){if(!_0x56bed2[_0x22c3('0x11')]){if(_0x56bed2[_0x22c3('0x10')]==_0x34b081){GRAY_PERIOD_REASON='Disabled';logger[_0x22c3('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';logger[_0x22c3('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x56bed2[_0x22c3('0x10')],_0x34b081);}logger[_0x22c3('0x13')](_0x22c3('0x16'),GRAY_PERIOD_REASON[_0x22c3('0x17')](),moment()[_0x22c3('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x10d96d[_0x22c3('0x15')]({'data2':encryptor[_0x22c3('0x18')](moment()[_0x22c3('0xa')](_0x22c3('0x19')))});}else{if(moment()['diff'](encryptor[_0x22c3('0x1a')](_0x56bed2[_0x22c3('0x11')]),'days')>DAYS){logger[_0x22c3('0x13')]('DEMO\x20START\x20AT\x20%s',moment()[_0x22c3('0xa')](_0x22c3('0x19')));isOldTokenSent=![];return _0x10d96d[_0x22c3('0x15')]({'data1':_0x34b081,'data2':null,'license':null});}}}else{if(_0x56bed2[_0x22c3('0x10')]!=_0x34b081){logger[_0x22c3('0x13')](_0x22c3('0x1b'),_0x56bed2[_0x22c3('0x10')],_0x34b081);return _0x10d96d[_0x22c3('0x15')]({'data1':_0x34b081,'data2':null,'license':null});}}}return _0x10d96d;})['then'](function(_0xaad05c){_0x10d96d=_0xaad05c;})['catch'](function(_0x53904f){logger[_0x22c3('0x1c')](_0x53904f['message']);})[_0x22c3('0x1d')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x10d96d);},TIME);});}function defaultLicense(){var _0x1fd58a=hardware[_0x22c3('0x1e')]();if(_0x1fd58a){return db[_0x22c3('0x1f')][_0x22c3('0x20')]({'where':{'id':0x1},'defaults':{'data1':_0x1fd58a}})['spread'](function(_0x3b4c30,_0x248ec3){logger[_0x22c3('0x13')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x1fd58a);manageLicense(_0x1fd58a,_0x3b4c30);})[_0x22c3('0xe')](function(_0x362c8c){logger[_0x22c3('0x1c')](_0x362c8c[_0x22c3('0x21')]);});}}exports['default']=defaultLicense;
\ No newline at end of file
+var _0xa586=['exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data1','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','decryptString','days','DEMO\x20START\x20AT\x20%s','error','finally','getUuid','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s'];(function(_0x90a471,_0x44befa){var _0x32fc50=function(_0x249494){while(--_0x249494){_0x90a471['push'](_0x90a471['shift']());}};_0x32fc50(++_0x44befa);}(_0xa586,0x16c));var _0x6a58=function(_0xffa198,_0x5a8940){_0xffa198=_0xffa198-0x0;var _0x1e4b50=_0xa586[_0xffa198];return _0x1e4b50;};'use strict';var util=require('util');var moment=require('moment');var rp=require(_0x6a58('0x0'));var BPromise=require(_0x6a58('0x1'));var pkginfo=require(_0x6a58('0x2'))(module,_0x6a58('0x3'));var db=require(_0x6a58('0x4'))['db'];var encryptor=require(_0x6a58('0x5'));var hardware=require('./hardware');var logger=require('../logger')(_0x6a58('0x6'));var HOST=_0x6a58('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x434cbd){return new BPromise(function(_0x105d03,_0xa8a1c5){var _0x4ff728=util[_0x6a58('0x8')](_0x6a58('0x9'),HOST,_0x434cbd,module[_0x6a58('0xa')][_0x6a58('0x3')]);if(oldToken){_0x4ff728=util[_0x6a58('0x8')](_0x6a58('0xb'),HOST,_0x434cbd,module[_0x6a58('0xa')][_0x6a58('0x3')],oldToken);}var _0x130392={'uri':_0x4ff728,'method':_0x6a58('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x130392)['then'](function(_0x2b2134){_0x105d03(_0x2b2134);})[_0x6a58('0xd')](function(_0x5394b2){_0xa8a1c5(_0x5394b2);});});}function manageLicense(_0x3032be,_0x5ce664){var _0xd29d64=_0x5ce664[_0x6a58('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0xd29d64[_0x6a58('0xf')]!==_0x3032be&&!_0xd29d64['data2']){oldToken=_0xd29d64[_0x6a58('0xf')];}httpRequest(_0x3032be)['then'](function(_0x1e4007){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1e4007[_0x6a58('0x10')]){isOldTokenSent=![];if(!_0xd29d64[_0x6a58('0x6')]&&_0xd29d64[_0x6a58('0x6')]!=_0x1e4007[_0x6a58('0x6')]||_0xd29d64[_0x6a58('0x6')]&&_0xd29d64[_0x6a58('0x11')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0xd29d64[_0x6a58('0x6')]&&!_0xd29d64['data2']&&_0xd29d64[_0x6a58('0x6')]!=_0x1e4007[_0x6a58('0x6')]){logger[_0x6a58('0x12')](_0x6a58('0x13'));}if(_0xd29d64[_0x6a58('0x6')]&&!_0xd29d64[_0x6a58('0x11')]&&_0xd29d64[_0x6a58('0x6')]==_0x1e4007[_0x6a58('0x6')]){return _0x5ce664;}return _0x5ce664[_0x6a58('0x14')]({'data1':_0x3032be,'data2':null,'license':_0x1e4007[_0x6a58('0x6')]});}else{if(_0x1e4007[_0x6a58('0x6')]||_0xd29d64[_0x6a58('0x6')]){if(!_0xd29d64[_0x6a58('0x11')]){if(_0xd29d64['data1']==_0x3032be){GRAY_PERIOD_REASON=_0x6a58('0x15');logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x6a58('0x16');logger[_0x6a58('0x12')](_0x6a58('0x17'),_0xd29d64[_0x6a58('0xf')],_0x3032be);}logger[_0x6a58('0x12')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x6a58('0x8')](_0x6a58('0x18')));return _0x5ce664['update']({'data2':encryptor[_0x6a58('0x19')](moment()[_0x6a58('0x8')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](encryptor[_0x6a58('0x1a')](_0xd29d64['data2']),_0x6a58('0x1b'))>DAYS){logger['info'](_0x6a58('0x1c'),moment()['format'](_0x6a58('0x18')));isOldTokenSent=![];return _0x5ce664['update']({'data1':_0x3032be,'data2':null,'license':null});}}}else{if(_0xd29d64['data1']!=_0x3032be){logger[_0x6a58('0x12')](_0x6a58('0x17'),_0xd29d64[_0x6a58('0xf')],_0x3032be);return _0x5ce664['update']({'data1':_0x3032be,'data2':null,'license':null});}}}return _0x5ce664;})['then'](function(_0x4f4046){_0x5ce664=_0x4f4046;})[_0x6a58('0xd')](function(_0x4d40b4){logger[_0x6a58('0x1d')](_0x4d40b4['message']);})[_0x6a58('0x1e')](function(){setTimeout(function(){manageLicense(hardware[_0x6a58('0x1f')](),_0x5ce664);},TIME);});}function defaultLicense(){var _0x4e1e3f=hardware[_0x6a58('0x1f')]();if(_0x4e1e3f){return db['License'][_0x6a58('0x20')]({'where':{'id':0x1},'defaults':{'data1':_0x4e1e3f}})['spread'](function(_0x3b8326,_0x2a516f){logger['info'](_0x6a58('0x21'),_0x4e1e3f);manageLicense(_0x4e1e3f,_0x3b8326);})[_0x6a58('0xd')](function(_0x311a03){logger['error'](_0x311a03['message']);});}}exports['default']=defaultLicense;
\ No newline at end of file
index a102697..b9f3fae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49ee=['sequelize','col','telephone','users','telephones','admin','user','count','catch','pick','countBy','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','uuid','isEmpty','License\x20key\x20value\x20not\x20found','data1','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','grayReason','changed','disabled','message','User','findAll','role'];(function(_0x593d89,_0x45145f){var _0x4aa403=function(_0x21f674){while(--_0x21f674){_0x593d89['push'](_0x593d89['shift']());}};_0x4aa403(++_0x45145f);}(_0x49ee,0x164));var _0xe49e=function(_0xae7489,_0x44ea0a){_0xae7489=_0xae7489-0x0;var _0x27e890=_0x49ee[_0xae7489];return _0x27e890;};'use strict';var util=require(_0xe49e('0x0'));var _=require(_0xe49e('0x1'));var moment=require(_0xe49e('0x2'));var BPromise=require(_0xe49e('0x3'));var hardware=require(_0xe49e('0x4'));var encryptor=require(_0xe49e('0x5'));var db=require(_0xe49e('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xe49e('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xe49e('0x8'),'machineUuid':hardware[_0xe49e('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xe49e('0xa'),'machineUuid':hardware[_0xe49e('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x2f3612){return new BPromise(function(_0x57d093,_0x10abb4){return db[_0xe49e('0xb')][_0xe49e('0xc')](_[_0xe49e('0xd')](_0x2f3612,{'raw':!![],'where':{'id':0x1}}))[_0xe49e('0xe')](function(_0x1539e8){return checkLicense(_0x1539e8,null);})[_0xe49e('0xe')](function(_0x139633){_0x57d093(_0x139633);return;})['catch'](function(_0xa9b958){_0x10abb4(_0xa9b958);});});}function checkLicense(_0x526c5a,_0xfb5b1d){if(!_0x526c5a){demoLicense[_0xe49e('0xf')]=_0x526c5a['data1'];return demoLicense;}try{var _0x733a62=_0xfb5b1d||_0x526c5a['license'];if(_[_0xe49e('0x10')](_0x733a62)){throw new Error(_0xe49e('0x11'));}var _0x224196=_0x526c5a[_0xe49e('0x12')];var _0x549887=_0x526c5a['data2'];var _0x6e7054=_0x224196[_0xe49e('0x13')]('-')[0x4];var _0x57095c=_0x224196[_0xe49e('0x13')]('-')[0x0];var _0x517eee=encryptor[_0xe49e('0x14')](_0x733a62,util[_0xe49e('0x15')](_0xe49e('0x16'),_0x6e7054,_0x224196,_0x57095c));var _0xe49072=JSON[_0xe49e('0x17')](_0x517eee);_0xe49072[_0xe49e('0x18')]=![];_0xe49072[_0xe49e('0xf')]=_0x224196;_0xe49072[_0xe49e('0x19')]=hardware[_0xe49e('0x9')]();if(_0x549887){var _0x3db592=encryptor[_0xe49e('0x14')](_0x549887);_0xe49072[_0xe49e('0x1a')]=_0x3db592;_0xe49072[_0xe49e('0x1b')]=moment(_0x3db592)[_0xe49e('0x1c')](0x7,'days')[_0xe49e('0x15')]();_0xe49072[_0xe49e('0x1d')]=_0xe49072[_0xe49e('0xf')]!=_0xe49072[_0xe49e('0x19')]?_0xe49e('0x1e'):_0xe49e('0x1f');}return _0xe49072;}catch(_0x5e18ac){breakingLicense[_0xe49e('0xf')]=_0x526c5a[_0xe49e('0x12')];breakingLicense[_0xe49e('0x20')]=_0x5e18ac[_0xe49e('0x20')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x32dc6d,_0x1f5586){getLicense()[_0xe49e('0xe')](function(_0x29f1bb){return db[_0xe49e('0x21')][_0xe49e('0x22')]({'attributes':[_0xe49e('0x23'),[db[_0xe49e('0x24')]['fn']('COUNT',db[_0xe49e('0x24')][_0xe49e('0x25')](_0xe49e('0x23'))),'count']],'group':_0xe49e('0x23'),'where':{'role':{'$or':['admin','user',_0xe49e('0x26')]}},'raw':!![]})[_0xe49e('0xe')](function(_0x3f6b5e){var _0x36f14b={'user':_0x29f1bb[_0xe49e('0x27')]||0x0,'telephone':_0x29f1bb[_0xe49e('0x28')]||0x0};_0x3f6b5e['forEach'](function(_0x1deca0){var _0x22bdc8=_0x1deca0['role']===_0xe49e('0x29')?_0xe49e('0x2a'):_0x1deca0[_0xe49e('0x23')];_0x36f14b[_0x22bdc8]-=_0x1deca0[_0xe49e('0x2b')];if(_0x36f14b[_0x22bdc8]<0x0)_0x36f14b[_0x22bdc8]=0x0;});_0x32dc6d(_0x36f14b);return;});})[_0xe49e('0x2c')](function(_0x443e57){_0x1f5586(_0x443e57);});});}function checkUserLimits(_0x118d19){return new BPromise(function(_0x2a5ad9,_0x57fe60){getLimits()[_0xe49e('0xe')](function(_0x115c48){var _0x218d1b=_[_0xe49e('0x2d')](_[_0xe49e('0x2e')](_0x118d19,_0xe49e('0x23')),[_0xe49e('0x29'),_0xe49e('0x2a'),_0xe49e('0x26')]);var _0x2ce219=(_0x218d1b['admin']||0x0)+(_0x218d1b[_0xe49e('0x2a')]||0x0);var _0xf113de=_0x218d1b['telephone']||0x0;if(_0x2ce219>_0x115c48[_0xe49e('0x2a')])return _0x57fe60('License\x20limit\x20reached\x20for\x20users');if(_0xf113de>_0x115c48[_0xe49e('0x26')])return _0x57fe60(_0xe49e('0x2f'));return _0x2a5ad9();})[_0xe49e('0x2c')](function(_0x4a1556){_0x57fe60(_0x4a1556);});});}module[_0xe49e('0x30')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0x5357=['user','telephone','users','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users','util','lodash','moment','bluebird','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','find','defaults','then','catch','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','split','decryptString','%s:%s:%s','demo','uuid','machineUuid','gray','days','format','grayReason','changed','message','User','col','role','count','admin'];(function(_0x51865e,_0x36c1fa){var _0x2a6364=function(_0x12842f){while(--_0x12842f){_0x51865e['push'](_0x51865e['shift']());}};_0x2a6364(++_0x36c1fa);}(_0x5357,0xb4));var _0x7535=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x5357[_0x2a6809];return _0x11c371;};'use strict';var util=require(_0x7535('0x0'));var _=require(_0x7535('0x1'));var moment=require(_0x7535('0x2'));var BPromise=require(_0x7535('0x3'));var hardware=require(_0x7535('0x4'));var encryptor=require(_0x7535('0x5'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7535('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x7535('0x7'),'machineUuid':hardware[_0x7535('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7535('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x7535('0x9'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x252751){return new BPromise(function(_0x5ee444,_0x426198){return db['License'][_0x7535('0xa')](_[_0x7535('0xb')](_0x252751,{'raw':!![],'where':{'id':0x1}}))[_0x7535('0xc')](function(_0x11522f){return checkLicense(_0x11522f,null);})[_0x7535('0xc')](function(_0x200041){_0x5ee444(_0x200041);return;})[_0x7535('0xd')](function(_0x40fa7f){_0x426198(_0x40fa7f);});});}function checkLicense(_0x571986,_0x2eb5df){if(!_0x571986){demoLicense['uuid']=_0x571986[_0x7535('0xe')];return demoLicense;}try{var _0x3cd96d=_0x2eb5df||_0x571986[_0x7535('0xf')];if(_[_0x7535('0x10')](_0x3cd96d)){throw new Error(_0x7535('0x11'));}var _0x4bf9a0=_0x571986[_0x7535('0xe')];var _0x128aeb=_0x571986['data2'];var _0x477853=_0x4bf9a0[_0x7535('0x12')]('-')[0x4];var _0x19a48e=_0x4bf9a0[_0x7535('0x12')]('-')[0x0];var _0x9cf272=encryptor[_0x7535('0x13')](_0x3cd96d,util['format'](_0x7535('0x14'),_0x477853,_0x4bf9a0,_0x19a48e));var _0x5d8ba0=JSON['parse'](_0x9cf272);_0x5d8ba0[_0x7535('0x15')]=![];_0x5d8ba0[_0x7535('0x16')]=_0x4bf9a0;_0x5d8ba0[_0x7535('0x17')]=hardware[_0x7535('0x8')]();if(_0x128aeb){var _0x4d8f24=encryptor[_0x7535('0x13')](_0x128aeb);_0x5d8ba0[_0x7535('0x18')]=_0x4d8f24;_0x5d8ba0['deadline']=moment(_0x4d8f24)['add'](0x7,_0x7535('0x19'))[_0x7535('0x1a')]();_0x5d8ba0[_0x7535('0x1b')]=_0x5d8ba0['uuid']!=_0x5d8ba0[_0x7535('0x17')]?_0x7535('0x1c'):'disabled';}return _0x5d8ba0;}catch(_0x5e0853){breakingLicense['uuid']=_0x571986[_0x7535('0xe')];breakingLicense[_0x7535('0x1d')]=_0x5e0853['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x26c2af,_0x150cd8){getLicense()[_0x7535('0xc')](function(_0x4883af){return db[_0x7535('0x1e')]['findAll']({'attributes':['role',[db['sequelize']['fn']('COUNT',db['sequelize'][_0x7535('0x1f')](_0x7535('0x20'))),_0x7535('0x21')]],'group':_0x7535('0x20'),'where':{'role':{'$or':[_0x7535('0x22'),_0x7535('0x23'),_0x7535('0x24')]}},'raw':!![]})['then'](function(_0x419c50){var _0x4a8469={'user':_0x4883af[_0x7535('0x25')]||0x0,'telephone':_0x4883af[_0x7535('0x26')]||0x0};_0x419c50[_0x7535('0x27')](function(_0x44feb6){var _0xd72277=_0x44feb6[_0x7535('0x20')]==='admin'?_0x7535('0x23'):_0x44feb6['role'];_0x4a8469[_0xd72277]-=_0x44feb6[_0x7535('0x21')];if(_0x4a8469[_0xd72277]<0x0)_0x4a8469[_0xd72277]=0x0;});_0x26c2af(_0x4a8469);return;});})[_0x7535('0xd')](function(_0x4abe5a){_0x150cd8(_0x4abe5a);});});}function checkUserLimits(_0x92ad67){return new BPromise(function(_0x22a1e7,_0xff6d42){getLimits()[_0x7535('0xc')](function(_0x25279d){var _0x5288b0=_[_0x7535('0x28')](_[_0x7535('0x29')](_0x92ad67,_0x7535('0x20')),[_0x7535('0x22'),_0x7535('0x23'),'telephone']);var _0x4c9951=(_0x5288b0['admin']||0x0)+(_0x5288b0[_0x7535('0x23')]||0x0);var _0x22da12=_0x5288b0['telephone']||0x0;if(_0x4c9951>_0x25279d[_0x7535('0x23')])return _0xff6d42(_0x7535('0x2a'));if(_0x22da12>_0x25279d[_0x7535('0x24')])return _0xff6d42('License\x20limit\x20reached\x20for\x20telephones');return _0x22a1e7();})['catch'](function(_0x3aaeb4){_0xff6d42(_0x3aaeb4);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index e079057..05cf1cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4991=['secret','exports','myappanuglar-secret'];(function(_0x283172,_0x19b821){var _0x5e67a8=function(_0x1d03e4){while(--_0x1d03e4){_0x283172['push'](_0x283172['shift']());}};_0x5e67a8(++_0x19b821);}(_0x4991,0xf7));var _0x1499=function(_0x3ecdd3,_0x5128c4){_0x3ecdd3=_0x3ecdd3-0x0;var _0x17273c=_0x4991[_0x3ecdd3];return _0x17273c;};'use strict';module[_0x1499('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x1499('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x1499('0x2'),'DEBUG':''};
\ No newline at end of file
+var _0x1eba=['secret','exports','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x44fc10,_0x57306d){var _0x41a72f=function(_0x3bac26){while(--_0x3bac26){_0x44fc10['push'](_0x44fc10['shift']());}};_0x41a72f(++_0x57306d);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x4d0662,_0x145963){_0x4d0662=_0x4d0662-0x0;var _0x6eea6d=_0x1eba[_0x4d0662];return _0x6eea6d;};'use strict';module[_0xa1eb('0x0')]={'DOMAIN':_0xa1eb('0x1'),'SESSION_SECRET':_0xa1eb('0x2'),'GOOGLE_ID':_0xa1eb('0x3'),'GOOGLE_SECRET':_0xa1eb('0x4'),'DEBUG':''};
\ No newline at end of file
index 2cc2b84..0bc25dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9763=['../utils/loggers','fileLogger','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9763,0x15f));var _0x3976=function(_0x4e7639,_0x5e4fb7){_0x4e7639=_0x4e7639-0x0;var _0x463aa4=_0x9763[_0x4e7639];return _0x463aa4;};'use strict';var fileLogger=require(_0x3976('0x0'))[_0x3976('0x1')];module[_0x3976('0x2')]=fileLogger;
\ No newline at end of file
+var _0x8613=['fileLogger','exports'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0x8613,0x110));var _0x3861=function(_0x6d91a,_0x3c06dc){_0x6d91a=_0x6d91a-0x0;var _0x405faf=_0x8613[_0x6d91a];return _0x405faf;};'use strict';var fileLogger=require('../utils/loggers')[_0x3861('0x0')];module[_0x3861('0x1')]=fileLogger;
\ No newline at end of file
index 4bab833..c6e0c51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a6a=['../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','exports','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi'];(function(_0x108a76,_0x160eee){var _0x495260=function(_0x1e9008){while(--_0x1e9008){_0x108a76['push'](_0x108a76['shift']());}};_0x495260(++_0x160eee);}(_0x2a6a,0x123));var _0xa2a6=function(_0xacabb,_0x1fbcd9){_0xacabb=_0xacabb-0x0;var _0x2b4a14=_0x2a6a[_0xacabb];return _0x2b4a14;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xa2a6('0x0'),'script':path[_0xa2a6('0x1')](__dirname,_0xa2a6('0x2'))},{'name':_0xa2a6('0x3'),'script':path[_0xa2a6('0x1')](__dirname,_0xa2a6('0x4'))},{'name':_0xa2a6('0x5'),'script':path['join'](__dirname,_0xa2a6('0x6'))},{'name':'email','script':path[_0xa2a6('0x1')](__dirname,_0xa2a6('0x7'))},{'name':_0xa2a6('0x8'),'script':path[_0xa2a6('0x1')](__dirname,_0xa2a6('0x9'))},{'name':'xdr','script':path[_0xa2a6('0x1')](__dirname,'../../services/xdr/index.js')}]};module[_0xa2a6('0xa')]=config;
\ No newline at end of file
+var _0xf8fb=['../../services/ami/index.js','../../services/agi/index.js','email','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','ami'];(function(_0x517a39,_0x32b791){var _0x5514a8=function(_0x482b3c){while(--_0x482b3c){_0x517a39['push'](_0x517a39['shift']());}};_0x5514a8(++_0x32b791);}(_0xf8fb,0x193));var _0xbf8f=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf8fb[_0x3ab51d];return _0x29a04e;};'use strict';var path=require(_0xbf8f('0x0'));var os=require('os');var config={'apps':[{'name':_0xbf8f('0x1'),'script':path[_0xbf8f('0x2')](__dirname,_0xbf8f('0x3'))},{'name':_0xbf8f('0x4'),'script':path['join'](__dirname,_0xbf8f('0x5'))},{'name':'agi','script':path[_0xbf8f('0x2')](__dirname,_0xbf8f('0x6'))},{'name':_0xbf8f('0x7'),'script':path[_0xbf8f('0x2')](__dirname,'../../services/email/index.js')},{'name':'routing','script':path[_0xbf8f('0x2')](__dirname,_0xbf8f('0x8'))},{'name':_0xbf8f('0x9'),'script':path[_0xbf8f('0x2')](__dirname,_0xbf8f('0xa'))}]};module[_0xbf8f('0xb')]=config;
\ No newline at end of file
index bdfa5a3..46cc803 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29a4=['then','stop','disconnect','restart','list','describe','delete','dump','saved','bluebird','./config','connect','start'];(function(_0x1c8724,_0x58d750){var _0x5bd554=function(_0x1e7947){while(--_0x1e7947){_0x1c8724['push'](_0x1c8724['shift']());}};_0x5bd554(++_0x58d750);}(_0x29a4,0xf3));var _0x429a=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x29a4[_0x1d24eb];return _0x1dc576;};'use strict';var pm2=require('pm2');var BPromise=require(_0x429a('0x0'));var config=require(_0x429a('0x1'));function connect(){return new BPromise(function(_0x186381,_0x2249d3){return pm2[_0x429a('0x2')](function(_0x148c62){if(_0x148c62){return _0x2249d3(_0x148c62);}return _0x186381('connected');});});};exports[_0x429a('0x3')]=function(_0xdb188c){return connect()[_0x429a('0x4')](function(){return new BPromise(function(_0x1fc890,_0x427b4b){return pm2[_0x429a('0x3')](_0xdb188c,function(_0x44dbb4,_0x365aa1){if(_0x44dbb4){return _0x427b4b(_0x44dbb4);}pm2['disconnect']();return _0x1fc890(_0x365aa1);});});});};exports[_0x429a('0x5')]=function(_0x35f761){return connect()[_0x429a('0x4')](function(){return new BPromise(function(_0x22fd56,_0x1a6821){return pm2[_0x429a('0x5')](_0x35f761,function(_0x460f9a,_0x4e5d90){if(_0x460f9a){return _0x1a6821(_0x460f9a);}pm2[_0x429a('0x6')]();return _0x22fd56(_0x4e5d90);});});});};exports[_0x429a('0x7')]=function(_0x126983){return connect()[_0x429a('0x4')](function(){return new BPromise(function(_0x2f3234,_0x286758){return pm2['restart'](_0x126983,function(_0x14fb0d,_0x47870a){if(_0x14fb0d){return _0x286758(_0x14fb0d);}pm2[_0x429a('0x6')]();return _0x2f3234(_0x47870a);});});});};exports[_0x429a('0x8')]=function(){return connect()[_0x429a('0x4')](function(){return new BPromise(function(_0x558aa0,_0x4ddf6b){return pm2[_0x429a('0x8')](function(_0x2ed3d2,_0x427b0f){if(_0x2ed3d2){return _0x4ddf6b(_0x2ed3d2);}pm2['disconnect']();return _0x558aa0(_0x427b0f);});});});};exports[_0x429a('0x9')]=function(_0x491d7f){return connect()[_0x429a('0x4')](function(){return new BPromise(function(_0x2358c9,_0x33ee45){return pm2['describe'](_0x491d7f,function(_0x88ac66,_0x2c7359){if(_0x88ac66){return _0x33ee45(_0x88ac66);}pm2[_0x429a('0x6')]();return _0x2358c9(_0x2c7359);});});});};exports[_0x429a('0xa')]=function(_0x435197){return connect()['then'](function(){return new BPromise(function(_0x5c0a9d,_0x368910){return pm2['delete'](_0x435197,function(_0x4ee716,_0x1009c0){if(_0x4ee716){return _0x368910(_0x4ee716);}pm2[_0x429a('0x6')]();return _0x5c0a9d(_0x1009c0);});});});};exports[_0x429a('0xb')]=function(){return connect()[_0x429a('0x4')](function(){return new BPromise(function(_0x3a99b2,_0x330a0a){return pm2[_0x429a('0xb')](function(_0x5898ea){if(_0x5898ea){return _0x330a0a(_0x5898ea);}return _0x3a99b2(_0x429a('0xc'));});});});};
\ No newline at end of file
+var _0x1207=['delete','dump','saved','pm2','connected','start','then','disconnect','stop','restart','list','describe'];(function(_0xaf6ec7,_0x30d645){var _0x360e68=function(_0x212f47){while(--_0x212f47){_0xaf6ec7['push'](_0xaf6ec7['shift']());}};_0x360e68(++_0x30d645);}(_0x1207,0x1cb));var _0x7120=function(_0xe275d7,_0x77976b){_0xe275d7=_0xe275d7-0x0;var _0x20ae38=_0x1207[_0xe275d7];return _0x20ae38;};'use strict';var pm2=require(_0x7120('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0xa6361c,_0x2ae5ce){return pm2['connect'](function(_0x4d97d3){if(_0x4d97d3){return _0x2ae5ce(_0x4d97d3);}return _0xa6361c(_0x7120('0x1'));});});};exports[_0x7120('0x2')]=function(_0x89ae8c){return connect()[_0x7120('0x3')](function(){return new BPromise(function(_0x312169,_0x2ba08d){return pm2[_0x7120('0x2')](_0x89ae8c,function(_0x4b8176,_0x42afe6){if(_0x4b8176){return _0x2ba08d(_0x4b8176);}pm2[_0x7120('0x4')]();return _0x312169(_0x42afe6);});});});};exports[_0x7120('0x5')]=function(_0x10a952){return connect()['then'](function(){return new BPromise(function(_0x3ee705,_0x817b58){return pm2['stop'](_0x10a952,function(_0x172028,_0x548ff8){if(_0x172028){return _0x817b58(_0x172028);}pm2[_0x7120('0x4')]();return _0x3ee705(_0x548ff8);});});});};exports[_0x7120('0x6')]=function(_0x18fa34){return connect()['then'](function(){return new BPromise(function(_0x263b0f,_0xd44c57){return pm2[_0x7120('0x6')](_0x18fa34,function(_0x285493,_0x1af67e){if(_0x285493){return _0xd44c57(_0x285493);}pm2['disconnect']();return _0x263b0f(_0x1af67e);});});});};exports[_0x7120('0x7')]=function(){return connect()[_0x7120('0x3')](function(){return new BPromise(function(_0x520f22,_0x303340){return pm2[_0x7120('0x7')](function(_0x3ac419,_0x262009){if(_0x3ac419){return _0x303340(_0x3ac419);}pm2['disconnect']();return _0x520f22(_0x262009);});});});};exports['describe']=function(_0x20e956){return connect()[_0x7120('0x3')](function(){return new BPromise(function(_0x137786,_0x1c140a){return pm2[_0x7120('0x8')](_0x20e956,function(_0x5d5148,_0x24bccd){if(_0x5d5148){return _0x1c140a(_0x5d5148);}pm2[_0x7120('0x4')]();return _0x137786(_0x24bccd);});});});};exports[_0x7120('0x9')]=function(_0x56be42){return connect()[_0x7120('0x3')](function(){return new BPromise(function(_0x2cf066,_0x2d6daa){return pm2['delete'](_0x56be42,function(_0x5ac55f,_0x48ee73){if(_0x5ac55f){return _0x2d6daa(_0x5ac55f);}pm2[_0x7120('0x4')]();return _0x2cf066(_0x48ee73);});});});};exports[_0x7120('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5dc766,_0x3cb9e4){return pm2['dump'](function(_0x225494){if(_0x225494){return _0x3cb9e4(_0x225494);}return _0x5dc766(_0x7120('0xb'));});});});};
\ No newline at end of file
index b19654f..071cba3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdacf=['then','lastMsgAt','minutes','length','map','info','join','update','timeout','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xdacf,0x172));var _0xfdac=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xdacf[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xfdac('0x0'));var moment=require(_0xfdac('0x1'));var Redis=require(_0xfdac('0x2'));var util=require('util');var config=require(_0xfdac('0x3'));var db=require(_0xfdac('0x4'))['db'];var logger=require(_0xfdac('0x5'))(_0xfdac('0x6'));config[_0xfdac('0x7')]=_[_0xfdac('0x8')](config[_0xfdac('0x7')],{'host':_0xfdac('0x9'),'port':0x18eb});var io=require(_0xfdac('0xa'))(new Redis(config[_0xfdac('0x7')]));function closeInteractions(){var _0x5bd666=0x0;var _0x53a026=[];return db[_0xfdac('0xb')][_0xfdac('0xc')]({'raw':!![],'attributes':['id',_0xfdac('0xd')],'where':{'id':0x1}})[_0xfdac('0xe')](function(_0x2245d3){_0x5bd666=_0x2245d3[_0xfdac('0xd')];if(_0x5bd666){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id',_0xfdac('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x2245d3['chatTimeout'],_0xfdac('0x10'))}}});}else{return[];}})[_0xfdac('0xe')](function(_0x19e52a){if(_0x19e52a&&_0x19e52a[_0xfdac('0x11')]){_0x53a026=_[_0xfdac('0x12')](_0x19e52a||[],'id');logger[_0xfdac('0x13')]('[CHAT]\x20Interactions\x20to\x20close:',_0x53a026[_0xfdac('0x14')]());return db['ChatInteraction'][_0xfdac('0x15')]({'closeReason':'system','disposition':_0xfdac('0x16'),'closed':!![],'closedAt':moment()['format'](_0xfdac('0x17'))},{'where':{'id':_0x53a026}});}})[_0xfdac('0xe')](function(){if(_0x53a026&&_0x53a026[_0xfdac('0x11')]){logger[_0xfdac('0x13')](_0xfdac('0x18'),_0x53a026[_0xfdac('0x14')]());for(var _0x3f212b=0x0;_0x3f212b<_0x53a026['length'];_0x3f212b++){io[_0xfdac('0x19')](_0xfdac('0x1a'),{'id':_0x53a026[_0x3f212b],'closed':!![]});}}})[_0xfdac('0x1b')](function(_0x707045){logger[_0xfdac('0x1c')](_0xfdac('0x1d'),_0x707045?util[_0xfdac('0x1e')](_0x707045,{'showHidden':![],'depth':null}):'');});}exports[_0xfdac('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x2ab7=['Setting','find','then','chatTimeout','findAll','lastMsgAt','subtract','length','map','info','join','ChatInteraction','update','system','timeout','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../mysqldb','../logger','defaults','redis','localhost','socket.io-emitter'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0x2ab7,0xa0));var _0x72ab=function(_0x58d803,_0x2cb29d){_0x58d803=_0x58d803-0x0;var _0x5517f8=_0x2ab7[_0x58d803];return _0x5517f8;};'use strict';var _=require(_0x72ab('0x0'));var moment=require(_0x72ab('0x1'));var Redis=require(_0x72ab('0x2'));var util=require(_0x72ab('0x3'));var config=require('../../config/environment');var db=require(_0x72ab('0x4'))['db'];var logger=require(_0x72ab('0x5'))('schedule');config['redis']=_[_0x72ab('0x6')](config[_0x72ab('0x7')],{'host':_0x72ab('0x8'),'port':0x18eb});var io=require(_0x72ab('0x9'))(new Redis(config[_0x72ab('0x7')]));function closeInteractions(){var _0x285f36=0x0;var _0x3aa800=[];return db[_0x72ab('0xa')][_0x72ab('0xb')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x72ab('0xc')](function(_0x49f127){_0x285f36=_0x49f127[_0x72ab('0xd')];if(_0x285f36){return db['ChatInteraction'][_0x72ab('0xe')]({'raw':!![],'attributes':['id',_0x72ab('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x72ab('0x10')](_0x49f127[_0x72ab('0xd')],'minutes')}}});}else{return[];}})['then'](function(_0xd0df65){if(_0xd0df65&&_0xd0df65[_0x72ab('0x11')]){_0x3aa800=_[_0x72ab('0x12')](_0xd0df65||[],'id');logger[_0x72ab('0x13')]('[CHAT]\x20Interactions\x20to\x20close:',_0x3aa800[_0x72ab('0x14')]());return db[_0x72ab('0x15')][_0x72ab('0x16')]({'closeReason':_0x72ab('0x17'),'disposition':_0x72ab('0x18'),'closed':!![],'closedAt':moment()[_0x72ab('0x19')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x3aa800}});}})[_0x72ab('0xc')](function(){if(_0x3aa800&&_0x3aa800[_0x72ab('0x11')]){logger[_0x72ab('0x13')](_0x72ab('0x1a'),_0x3aa800['join']());for(var _0x15ee5a=0x0;_0x15ee5a<_0x3aa800[_0x72ab('0x11')];_0x15ee5a++){io[_0x72ab('0x1b')](_0x72ab('0x1c'),{'id':_0x3aa800[_0x15ee5a],'closed':!![]});}}})[_0x72ab('0x1d')](function(_0x3da3e8){logger[_0x72ab('0x1e')](_0x72ab('0x1f'),_0x3da3e8?util[_0x72ab('0x20')](_0x3da3e8,{'showHidden':![],'depth':null}):'');});}exports[_0x72ab('0x21')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index acb4cf0..b2cb6c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6989=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x6989,0x169));var _0x9698=function(_0x4c1cb6,_0x3e1050){_0x4c1cb6=_0x4c1cb6-0x0;var _0x9233e4=_0x6989[_0x4c1cb6];return _0x9233e4;};'use strict';function start(){var _0x4c4c5c=require(_0x9698('0x0'));return _0x4c4c5c[_0x9698('0x1')]();}module[_0x9698('0x2')]={'intervals':{},'start':start};
\ No newline at end of file
+var _0x4b2a=['exports'];(function(_0x274a6e,_0x3f9be3){var _0x157091=function(_0x2408b1){while(--_0x2408b1){_0x274a6e['push'](_0x274a6e['shift']());}};_0x157091(++_0x3f9be3);}(_0x4b2a,0x105));var _0xa4b2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4b2a[_0x2641f9];return _0x585741;};'use strict';function start(){var _0x291e3e=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x291e3e['startAllRefreshIntervals']();}module[_0xa4b2('0x0')]={'intervals':{},'start':start};
\ No newline at end of file
index 7aa7875..cc607f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c9b=['lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','email','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','savename','%s.%s','basename','extname','zip','existsSync','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','isNil','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','MailServerOut','CloudProvider','keys','map','keyBy','toString','difference','intersection','exists','stop','deleteJob','delete\x20cron','length','index','resolve','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update','run','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c9b,0x109));var _0xb0c9=function(_0x1195fe,_0xf68a2e){_0x1195fe=_0x1195fe-0x0;var _0xc51a3c=_0x0c9b[_0x1195fe];return _0xc51a3c;};'use strict';var fs=require('fs');var util=require(_0xb0c9('0x0'));var path=require(_0xb0c9('0x1'));var _=require(_0xb0c9('0x2'));var moment=require(_0xb0c9('0x3'));var CronJobManager=require(_0xb0c9('0x4'));var jayson=require(_0xb0c9('0x5'));var BPromise=require(_0xb0c9('0x6'));var logger=require(_0xb0c9('0x7'))(_0xb0c9('0x8'));var db=require(_0xb0c9('0x9'))['db'];var analyticCustomReportController=require(_0xb0c9('0xa'));var analyticDefaultReportController=require(_0xb0c9('0xb'));var client=jayson[_0xb0c9('0xc')][_0xb0c9('0xd')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x321a04,_0x591d47){return function(){logger[_0xb0c9('0xe')](_0xb0c9('0xf'),_0x321a04['email']);var _0x21f455=!![];var _0x294cea=_0x321a04[_0xb0c9('0x10')][_0xb0c9('0x11')]();var _0x17b25a={'account':_0x294cea,'message':{'from':util[_0xb0c9('0x12')](_0xb0c9('0x13'),_0x321a04[_0xb0c9('0x10')][_0xb0c9('0x14')],_0x321a04[_0xb0c9('0x10')][_0xb0c9('0x15')]||_0x321a04[_0xb0c9('0x10')][_0xb0c9('0x16')]['user']),'to':_0x321a04[_0xb0c9('0x15')],'cc':_0x321a04['cc'],'bcc':_0x321a04[_0xb0c9('0x17')],'subject':util['format'](_0xb0c9('0x18'),_0x591d47[_0xb0c9('0x14')],_0x321a04['subtractNumber'],_0x321a04[_0xb0c9('0x19')])}};var _0xa497f8=path[_0xb0c9('0x1a')](__dirname,'../../files/reports');var _0x4dd09e=_0x591d47[_0xb0c9('0x1b')];var _0x3a27fc=util[_0xb0c9('0x12')](_0xb0c9('0x1c'),path[_0xb0c9('0x1d')](_0x591d47[_0xb0c9('0x1b')],path[_0xb0c9('0x1e')](_0x591d47[_0xb0c9('0x1b')])),_0xb0c9('0x1f'));var _0x4a8052=path['join'](_0xa497f8,_0x4dd09e);var _0x4787c5=path[_0xb0c9('0x1a')](_0xa497f8,_0x3a27fc);if(fs[_0xb0c9('0x20')](_0x4a8052)){_0x591d47['status']=_0xb0c9('0x21');_0x17b25a[_0xb0c9('0x22')][_0xb0c9('0x23')]=[{'filename':_0x4dd09e,'path':_0x4a8052}];_0x17b25a[_0xb0c9('0x22')][_0xb0c9('0x24')]=util[_0xb0c9('0x12')](_0xb0c9('0x25'),JSON[_0xb0c9('0x26')](_0x591d47,null,0x2));}else if(fs[_0xb0c9('0x20')](_0x4787c5)){_0x591d47[_0xb0c9('0x27')]=_0xb0c9('0x21');_0x17b25a[_0xb0c9('0x22')]['attachments']=[{'filename':_0x3a27fc,'path':_0x4787c5}];}else{_0x17b25a['message'][_0xb0c9('0x24')]=_0xb0c9('0x28');if(!_0x321a04['sendIfEmpty']){_0x21f455=![];logger[_0xb0c9('0xe')](_0xb0c9('0x29'));}}if(_0x21f455){return client[_0xb0c9('0x2a')](_0xb0c9('0x2b'),_0x17b25a)[_0xb0c9('0x2c')](function(_0x3616fb){if(_0x3616fb[_0xb0c9('0x2d')]){return logger[_0xb0c9('0x2d')](_0xb0c9('0x2e'),JSON[_0xb0c9('0x26')](_0x3616fb));}return logger['info'](_0xb0c9('0x2f'));})[_0xb0c9('0x30')](function(_0x5059bb){return logger[_0xb0c9('0x2d')](_0xb0c9('0x2e'),JSON['stringify'](_0x5059bb));});}};}function handleError(){return function(_0x1c166d){return logger['error'](JSON[_0xb0c9('0x26')](_0x1c166d));};}function handleResult(_0x58bfe0){return function(_0x20b8fb){logger['info'](_0xb0c9('0x31'),JSON[_0xb0c9('0x26')](_0x20b8fb));if(_0x58bfe0['MailAccount']&&_0x58bfe0[_0xb0c9('0x10')][_0xb0c9('0x16')]&&!_['isNil'](_0x58bfe0['email'])){setTimeout(handleSendEmail(_0x58bfe0,_0x20b8fb),0x3c*0x3e8);}};}function handleJob(_0x33f8b8){return function(){try{if(_['isNil'](_0x33f8b8[_0xb0c9('0x32')])){return logger[_0xb0c9('0xe')](_0xb0c9('0x33'));}if(_['isNil'](_0x33f8b8['subtractUnit'])){return logger['info'](_0xb0c9('0x34'));}var _0x1024d6={'startDate':moment()[_0xb0c9('0x35')](_0x33f8b8[_0xb0c9('0x32')],_0x33f8b8[_0xb0c9('0x19')])[_0xb0c9('0x12')](_0xb0c9('0x36')),'endDate':moment()[_0xb0c9('0x12')](_0xb0c9('0x36')),'type':_0xb0c9('0x37'),'output':_0x33f8b8[_0xb0c9('0x38')],'name':_0x33f8b8[_0xb0c9('0x14')]};if(!_[_0xb0c9('0x39')](_0x33f8b8[_0xb0c9('0x3a')])){logger[_0xb0c9('0xe')]('exec\x20defaul\x20report\x20id:%s',_0x33f8b8[_0xb0c9('0x3a')]);return analyticDefaultReportController[_0xb0c9('0x3b')]({'id':_0x33f8b8['DefaultReportId']},_0x1024d6)['then'](handleResult(_0x33f8b8))[_0xb0c9('0x30')](handleError());}if(!_['isNil'](_0x33f8b8[_0xb0c9('0x3c')])){logger['info'](_0xb0c9('0x3d'),_0x33f8b8[_0xb0c9('0x3c')]);return analyticCustomReportController[_0xb0c9('0x3b')]({'id':_0x33f8b8['CustomReportId']},_0x1024d6)[_0xb0c9('0x2c')](handleResult(_0x33f8b8))[_0xb0c9('0x30')](handleError());}}catch(_0x4267d6){logger[_0xb0c9('0x2d')](JSON[_0xb0c9('0x26')](_0x4267d6));}return logger[_0xb0c9('0xe')]('no\x20report\x20id');};}function getJobs(_0x435f7d){var _0x5d12a1={};if(_0x435f7d){_0x5d12a1['id']=_0x435f7d;}return db[_0xb0c9('0x3e')]['findAll']({'where':_0x5d12a1,'include':[{'model':db[_0xb0c9('0x10')],'attributes':['id','name',_0xb0c9('0x15')],'include':[{'model':db[_0xb0c9('0x3f')],'as':_0xb0c9('0x16'),'include':[{'model':db[_0xb0c9('0x40')],'as':'CloudProvider'}]}]}]})[_0xb0c9('0x2c')](function(_0x3c4bb2){var _0x32bdd4=_[_0xb0c9('0x41')](manager['jobs']);var _0x47974c=_[_0xb0c9('0x42')](_0x3c4bb2,function(_0x31c090){return _0x31c090['id']['toString']();});var _0x26c787=_[_0xb0c9('0x43')](_0x3c4bb2,function(_0x4d0ae3){return _0x4d0ae3['id'][_0xb0c9('0x44')]();});var _0x2cc5b2=_0x435f7d?_0x47974c:_[_0xb0c9('0x45')](_0x47974c,_0x32bdd4);var _0x31b5c1=_[_0xb0c9('0x46')](_0x47974c,_0x32bdd4);var _0x2fd629=_[_0xb0c9('0x45')](_0x32bdd4,_0x47974c);var _0x2a4c44;var _0x103402;for(_0x2a4c44=0x0;_0x2a4c44<_0x2fd629['length']&&!_0x435f7d;_0x2a4c44+=0x1){_0x103402=_0x2fd629[_0x2a4c44][_0xb0c9('0x44')]();if(manager[_0xb0c9('0x47')](_0x103402)){manager[_0xb0c9('0x48')](_0x103402);manager[_0xb0c9('0x49')](_0x103402);logger[_0xb0c9('0xe')](_0xb0c9('0x4a'),_0x103402);}}logger[_0xb0c9('0xe')]('toRun',JSON[_0xb0c9('0x26')](_0x2cc5b2));for(_0x2a4c44=0x0;_0x2a4c44<_0x2cc5b2[_0xb0c9('0x4b')];_0x2a4c44+=0x1){_0x103402=_0x2cc5b2[_0x2a4c44][_0xb0c9('0x44')]();logger[_0xb0c9('0xe')](_0xb0c9('0x4c'),_0x103402);if(_0x435f7d){logger[_0xb0c9('0xe')]('my\x20id',_0x435f7d);logger[_0xb0c9('0xe')](JSON[_0xb0c9('0x26')](_0x26c787[_0x103402]));BPromise[_0xb0c9('0x4d')]()[_0xb0c9('0x2c')](handleJob(_0x26c787[_0x103402]));logger[_0xb0c9('0xe')]('run\x20job',_0x26c787[_0x103402][_0xb0c9('0x14')],_0x26c787[_0x103402][_0xb0c9('0x4e')]);}else if(_0x26c787[_0x103402][_0xb0c9('0x4e')]&&_0x26c787[_0x103402][_0xb0c9('0x4f')]&&moment()[_0xb0c9('0x50')](_0x26c787[_0x103402][_0xb0c9('0x51')],_0x26c787[_0x103402][_0xb0c9('0x52')])){manager[_0xb0c9('0x53')](_0x103402,_0x26c787[_0x103402][_0xb0c9('0x4e')],handleJob(_0x26c787[_0x103402]));manager[_0xb0c9('0x54')](_0x103402);logger[_0xb0c9('0xe')](_0xb0c9('0x55'),_0x26c787[_0x103402][_0xb0c9('0x14')],_0x26c787[_0x103402][_0xb0c9('0x4e')]);}else if(manager[_0xb0c9('0x47')](_0x103402)){manager['stop'](_0x103402);manager[_0xb0c9('0x49')](_0x103402);logger[_0xb0c9('0xe')](_0xb0c9('0x56'),_0x26c787[_0x103402][_0xb0c9('0x14')],_0x26c787[_0x103402][_0xb0c9('0x4e')]);}}for(_0x2a4c44=0x0,_0x103402;_0x2a4c44<_0x31b5c1[_0xb0c9('0x4b')]&&!_0x435f7d;_0x2a4c44+=0x1){_0x103402=_0x31b5c1[_0x2a4c44][_0xb0c9('0x44')]();if(manager['exists'](_0x103402)){if(_0x26c787[_0x103402]['cron']&&_0x26c787[_0x103402][_0xb0c9('0x4f')]&&moment()['isBetween'](_0x26c787[_0x103402][_0xb0c9('0x51')],_0x26c787[_0x103402]['endAt'])){manager[_0xb0c9('0x57')](_0x103402,_0x26c787[_0x103402]['cron'],handleJob(_0x26c787[_0x103402]));logger[_0xb0c9('0xe')]('update\x20cron',_0x26c787[_0x103402][_0xb0c9('0x14')],_0x26c787[_0x103402][_0xb0c9('0x4e')]);}else{manager[_0xb0c9('0x48')](_0x103402);manager[_0xb0c9('0x49')](_0x103402);logger[_0xb0c9('0xe')](_0xb0c9('0x56'),_0x26c787[_0x103402][_0xb0c9('0x14')],_0x26c787[_0x103402][_0xb0c9('0x4e')]);}}}})[_0xb0c9('0x30')](function(_0x310389){logger['error'](JSON[_0xb0c9('0x26')](_0x310389));});}exports[_0xb0c9('0x58')]=function(_0x1c15ab){return getJobs(_0x1c15ab);};exports[_0xb0c9('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x7162=['email','Smtp','user','bcc','name','subtractNumber','subtractUnit','join','../../files/reports','savename','%s.%s','extname','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','stringify','email\x20sent','catch','data','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','isNil','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','map','toString','keyBy','difference','intersection','exists','stop','delete\x20cron','toRun','length','index','my\x20id','run\x20job','cron','active','isBetween','startAt','endAt','add','add\x20cron','deleteJob','stop\x20cron','update','update\x20cron','run','start','util','path','lodash','moment','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','getSmtpOptions','format','MailAccount'];(function(_0x328f7e,_0x442dfb){var _0x588bad=function(_0x2ff4e5){while(--_0x2ff4e5){_0x328f7e['push'](_0x328f7e['shift']());}};_0x588bad(++_0x442dfb);}(_0x7162,0xff));var _0x2716=function(_0x3c154f,_0x13ba7e){_0x3c154f=_0x3c154f-0x0;var _0x157712=_0x7162[_0x3c154f];return _0x157712;};'use strict';var fs=require('fs');var util=require(_0x2716('0x0'));var path=require(_0x2716('0x1'));var _=require(_0x2716('0x2'));var moment=require(_0x2716('0x3'));var CronJobManager=require(_0x2716('0x4'));var jayson=require(_0x2716('0x5'));var BPromise=require('bluebird');var logger=require(_0x2716('0x6'))(_0x2716('0x7'));var db=require(_0x2716('0x8'))['db'];var analyticCustomReportController=require(_0x2716('0x9'));var analyticDefaultReportController=require(_0x2716('0xa'));var client=jayson[_0x2716('0xb')][_0x2716('0xc')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1e4165,_0x38e078){return function(){logger[_0x2716('0xd')](_0x2716('0xe'),_0x1e4165['email']);var _0x36a6e0=!![];var _0x5f2316=_0x1e4165['MailAccount'][_0x2716('0xf')]();var _0x3f8485={'account':_0x5f2316,'message':{'from':util[_0x2716('0x10')]('\x22%s\x22\x20<%s>',_0x1e4165[_0x2716('0x11')]['name'],_0x1e4165[_0x2716('0x11')][_0x2716('0x12')]||_0x1e4165[_0x2716('0x11')][_0x2716('0x13')][_0x2716('0x14')]),'to':_0x1e4165[_0x2716('0x12')],'cc':_0x1e4165['cc'],'bcc':_0x1e4165[_0x2716('0x15')],'subject':util[_0x2716('0x10')]('Report\x20%s\x20last\x20%s\x20%s',_0x38e078[_0x2716('0x16')],_0x1e4165[_0x2716('0x17')],_0x1e4165[_0x2716('0x18')])}};var _0x14dc05=path[_0x2716('0x19')](__dirname,_0x2716('0x1a'));var _0x3e019d=_0x38e078[_0x2716('0x1b')];var _0x203627=util[_0x2716('0x10')](_0x2716('0x1c'),path['basename'](_0x38e078[_0x2716('0x1b')],path[_0x2716('0x1d')](_0x38e078[_0x2716('0x1b')])),_0x2716('0x1e'));var _0x50e7a7=path[_0x2716('0x19')](_0x14dc05,_0x3e019d);var _0x3c2a70=path[_0x2716('0x19')](_0x14dc05,_0x203627);if(fs[_0x2716('0x1f')](_0x50e7a7)){_0x38e078[_0x2716('0x20')]=_0x2716('0x21');_0x3f8485[_0x2716('0x22')][_0x2716('0x23')]=[{'filename':_0x3e019d,'path':_0x50e7a7}];_0x3f8485[_0x2716('0x22')][_0x2716('0x24')]=util[_0x2716('0x10')](_0x2716('0x25'),JSON['stringify'](_0x38e078,null,0x2));}else if(fs['existsSync'](_0x3c2a70)){_0x38e078[_0x2716('0x20')]='Sent';_0x3f8485['message'][_0x2716('0x23')]=[{'filename':_0x203627,'path':_0x3c2a70}];}else{_0x3f8485[_0x2716('0x22')][_0x2716('0x24')]=_0x2716('0x26');if(!_0x1e4165['sendIfEmpty']){_0x36a6e0=![];logger[_0x2716('0xd')](_0x2716('0x27'));}}if(_0x36a6e0){return client['request'](_0x2716('0x28'),_0x3f8485)[_0x2716('0x29')](function(_0x2da397){if(_0x2da397['error']){return logger[_0x2716('0x2a')](_0x2716('0x2b'),JSON[_0x2716('0x2c')](_0x2da397));}return logger['info'](_0x2716('0x2d'));})[_0x2716('0x2e')](function(_0x50b51c){return logger[_0x2716('0x2a')]('error\x20mail',JSON[_0x2716('0x2c')](_0x50b51c));});}};}function handleError(){return function(_0x29f54c){return logger['error'](JSON[_0x2716('0x2c')](_0x29f54c));};}function handleResult(_0x3b0067){return function(_0x2f161c){logger[_0x2716('0xd')](_0x2716('0x2f'),JSON['stringify'](_0x2f161c));if(_0x3b0067['MailAccount']&&_0x3b0067[_0x2716('0x11')][_0x2716('0x13')]&&!_['isNil'](_0x3b0067['email'])){setTimeout(handleSendEmail(_0x3b0067,_0x2f161c),0x3c*0x3e8);}};}function handleJob(_0x1de2e5){return function(){try{if(_['isNil'](_0x1de2e5[_0x2716('0x17')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0x1de2e5['subtractUnit'])){return logger['info'](_0x2716('0x30'));}var _0x211c74={'startDate':moment()[_0x2716('0x31')](_0x1de2e5[_0x2716('0x17')],_0x1de2e5['subtractUnit'])[_0x2716('0x10')](_0x2716('0x32')),'endDate':moment()['format'](_0x2716('0x32')),'type':_0x2716('0x33'),'output':_0x1de2e5[_0x2716('0x34')],'name':_0x1de2e5[_0x2716('0x16')]};if(!_['isNil'](_0x1de2e5['DefaultReportId'])){logger['info'](_0x2716('0x35'),_0x1de2e5[_0x2716('0x36')]);return analyticDefaultReportController['runReport']({'id':_0x1de2e5[_0x2716('0x36')]},_0x211c74)['then'](handleResult(_0x1de2e5))['catch'](handleError());}if(!_[_0x2716('0x37')](_0x1de2e5[_0x2716('0x38')])){logger[_0x2716('0xd')](_0x2716('0x39'),_0x1de2e5[_0x2716('0x38')]);return analyticCustomReportController[_0x2716('0x3a')]({'id':_0x1de2e5[_0x2716('0x38')]},_0x211c74)['then'](handleResult(_0x1de2e5))['catch'](handleError());}}catch(_0x21796e){logger[_0x2716('0x2a')](JSON[_0x2716('0x2c')](_0x21796e));}return logger[_0x2716('0xd')](_0x2716('0x3b'));};}function getJobs(_0x3a7673){var _0x1872ba={};if(_0x3a7673){_0x1872ba['id']=_0x3a7673;}return db[_0x2716('0x3c')][_0x2716('0x3d')]({'where':_0x1872ba,'include':[{'model':db[_0x2716('0x11')],'attributes':['id',_0x2716('0x16'),_0x2716('0x12')],'include':[{'model':db[_0x2716('0x3e')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x2716('0x3f')}]}]}]})[_0x2716('0x29')](function(_0x878e4c){var _0x311896=_[_0x2716('0x40')](manager['jobs']);var _0x1bc62a=_[_0x2716('0x41')](_0x878e4c,function(_0x77a19b){return _0x77a19b['id'][_0x2716('0x42')]();});var _0x346754=_[_0x2716('0x43')](_0x878e4c,function(_0x546f84){return _0x546f84['id'][_0x2716('0x42')]();});var _0x4f5ce2=_0x3a7673?_0x1bc62a:_[_0x2716('0x44')](_0x1bc62a,_0x311896);var _0x3a8b3a=_[_0x2716('0x45')](_0x1bc62a,_0x311896);var _0x557235=_[_0x2716('0x44')](_0x311896,_0x1bc62a);var _0x5a7db2;var _0x34b1e6;for(_0x5a7db2=0x0;_0x5a7db2<_0x557235['length']&&!_0x3a7673;_0x5a7db2+=0x1){_0x34b1e6=_0x557235[_0x5a7db2][_0x2716('0x42')]();if(manager[_0x2716('0x46')](_0x34b1e6)){manager[_0x2716('0x47')](_0x34b1e6);manager['deleteJob'](_0x34b1e6);logger[_0x2716('0xd')](_0x2716('0x48'),_0x34b1e6);}}logger[_0x2716('0xd')](_0x2716('0x49'),JSON['stringify'](_0x4f5ce2));for(_0x5a7db2=0x0;_0x5a7db2<_0x4f5ce2[_0x2716('0x4a')];_0x5a7db2+=0x1){_0x34b1e6=_0x4f5ce2[_0x5a7db2][_0x2716('0x42')]();logger[_0x2716('0xd')](_0x2716('0x4b'),_0x34b1e6);if(_0x3a7673){logger['info'](_0x2716('0x4c'),_0x3a7673);logger['info'](JSON[_0x2716('0x2c')](_0x346754[_0x34b1e6]));BPromise['resolve']()[_0x2716('0x29')](handleJob(_0x346754[_0x34b1e6]));logger[_0x2716('0xd')](_0x2716('0x4d'),_0x346754[_0x34b1e6][_0x2716('0x16')],_0x346754[_0x34b1e6][_0x2716('0x4e')]);}else if(_0x346754[_0x34b1e6][_0x2716('0x4e')]&&_0x346754[_0x34b1e6][_0x2716('0x4f')]&&moment()[_0x2716('0x50')](_0x346754[_0x34b1e6][_0x2716('0x51')],_0x346754[_0x34b1e6][_0x2716('0x52')])){manager[_0x2716('0x53')](_0x34b1e6,_0x346754[_0x34b1e6][_0x2716('0x4e')],handleJob(_0x346754[_0x34b1e6]));manager['start'](_0x34b1e6);logger[_0x2716('0xd')](_0x2716('0x54'),_0x346754[_0x34b1e6][_0x2716('0x16')],_0x346754[_0x34b1e6][_0x2716('0x4e')]);}else if(manager[_0x2716('0x46')](_0x34b1e6)){manager[_0x2716('0x47')](_0x34b1e6);manager[_0x2716('0x55')](_0x34b1e6);logger['info'](_0x2716('0x56'),_0x346754[_0x34b1e6][_0x2716('0x16')],_0x346754[_0x34b1e6][_0x2716('0x4e')]);}}for(_0x5a7db2=0x0,_0x34b1e6;_0x5a7db2<_0x3a8b3a['length']&&!_0x3a7673;_0x5a7db2+=0x1){_0x34b1e6=_0x3a8b3a[_0x5a7db2][_0x2716('0x42')]();if(manager[_0x2716('0x46')](_0x34b1e6)){if(_0x346754[_0x34b1e6][_0x2716('0x4e')]&&_0x346754[_0x34b1e6][_0x2716('0x4f')]&&moment()[_0x2716('0x50')](_0x346754[_0x34b1e6]['startAt'],_0x346754[_0x34b1e6]['endAt'])){manager[_0x2716('0x57')](_0x34b1e6,_0x346754[_0x34b1e6][_0x2716('0x4e')],handleJob(_0x346754[_0x34b1e6]));logger[_0x2716('0xd')](_0x2716('0x58'),_0x346754[_0x34b1e6]['name'],_0x346754[_0x34b1e6][_0x2716('0x4e')]);}else{manager[_0x2716('0x47')](_0x34b1e6);manager[_0x2716('0x55')](_0x34b1e6);logger['info'](_0x2716('0x56'),_0x346754[_0x34b1e6]['name'],_0x346754[_0x34b1e6]['cron']);}}}})['catch'](function(_0x1c995f){logger[_0x2716('0x2a')](JSON[_0x2716('0x2c')](_0x1c995f));});}exports[_0x2716('0x59')]=function(_0x2b85d7){return getJobs(_0x2b85d7);};exports[_0x2716('0x5a')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index 0f7c82a..f2a51c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefe2=['start','lodash','aws-sdk','util','bluebird','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data2','transcribeName','then','info','fileText','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','data1','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentimentRegion','Sentiment','name','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribe','transcribeRegion','transcribeAccountId','forEach','push','all','SequelizeValidationError'];(function(_0x343e5a,_0x438aa6){var _0x37e87f=function(_0x5308a7){while(--_0x5308a7){_0x343e5a['push'](_0x343e5a['shift']());}};_0x37e87f(++_0x438aa6);}(_0xefe2,0xd9));var _0x2efe=function(_0x3736bd,_0x26f90d){_0x3736bd=_0x3736bd-0x0;var _0x5d03cf=_0xefe2[_0x3736bd];return _0x5d03cf;};var _=require(_0x2efe('0x0'));var AWS=require(_0x2efe('0x1'));var rp=require('request-promise');var util=require(_0x2efe('0x2'));var BPromise=require(_0x2efe('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x2efe('0x4'))('transcribe');function getTranscriptionJob(_0x470efc,_0x4553a6,_0x2d3c97,_0x300cb7){return new Promise(function(_0x3a7cd3,_0x570264){var _0xabb4e3=new AWS[(_0x2efe('0x5'))]({'accessKeyId':_0x4553a6,'secretAccessKey':_0x470efc,'region':_0x2d3c97});_0xabb4e3[_0x2efe('0x6')]({'TranscriptionJobName':_0x300cb7},function(_0x14cd14,_0x5f0008){if(_0x14cd14){return _0x570264(_0x14cd14);}else{return _0x3a7cd3(_0x5f0008);}});});}function sentiment(_0x163c06,_0x37ebdd,_0x3a8f02,_0x54c846,_0x498eb4){return new Promise(function(_0x28f5c9,_0x5a17d3){var _0x58ba63=new AWS[(_0x2efe('0x7'))]({'accessKeyId':_0x37ebdd,'secretAccessKey':_0x163c06,'region':_0x3a8f02});_0x58ba63[_0x2efe('0x8')]({'Text':_0x54c846,'LanguageCode':_0x498eb4[_0x2efe('0x9')](0x0,0x2)},function(_0x22e98f,_0xea35bb){if(_0x22e98f){return _0x5a17d3(_0x22e98f);}else{return _0x28f5c9(_0xea35bb);}});});}function checkTranscribeJob(_0x32fda9,_0x39a93b,_0x250023){var _0x41039a;return new BPromise(function(_0x3c8910,_0x4cd723){logger['info'](util[_0x2efe('0xa')](_0x2efe('0xb'),_0x32fda9['id'],_0x32fda9['transcribeName']));return getTranscriptionJob(_0x250023['data1'],_0x250023[_0x2efe('0xc')],_0x39a93b['transcribeRegion'],_0x32fda9[_0x2efe('0xd')])[_0x2efe('0xe')](function(_0x51cbf3){logger[_0x2efe('0xf')](util[_0x2efe('0xa')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x32fda9['id'],_0x32fda9[_0x2efe('0xd')],_0x51cbf3['TranscriptionJob']['TranscriptionJobStatus']));if(!_0x32fda9[_0x2efe('0x10')]){switch(_0x51cbf3[_0x2efe('0x11')][_0x2efe('0x12')]){case _0x2efe('0x13'):var _0x40fa2e={'transcribeStatus':_0x51cbf3[_0x2efe('0x11')][_0x2efe('0x12')],'fileUri':_0x51cbf3[_0x2efe('0x11')][_0x2efe('0x14')][_0x2efe('0x15')]};logger[_0x2efe('0xf')](util[_0x2efe('0xa')]('[RECORDING:%d]\x20Get\x20transcript',_0x32fda9['id']));return rp({'uri':_0x51cbf3[_0x2efe('0x11')]['Transcript'][_0x2efe('0x15')],'json':!![]})[_0x2efe('0xe')](function(_0x30ed16){logger['info'](util[_0x2efe('0xa')](_0x2efe('0x16'),_0x32fda9['id']));if(_0x30ed16&&_0x30ed16['results']&&_0x30ed16[_0x2efe('0x17')][_0x2efe('0x18')]&&_0x30ed16[_0x2efe('0x17')][_0x2efe('0x18')][_0x2efe('0x19')]){_0x40fa2e[_0x2efe('0x10')]='';for(var _0x2a9b20=0x0;_0x2a9b20<_0x30ed16[_0x2efe('0x17')][_0x2efe('0x18')][_0x2efe('0x19')];_0x2a9b20++){_0x40fa2e[_0x2efe('0x10')]+=_0x30ed16[_0x2efe('0x17')][_0x2efe('0x18')][_0x2a9b20][_0x2efe('0x1a')]+'';}}return _0x32fda9['update'](_0x40fa2e);})[_0x2efe('0xe')](function(){logger[_0x2efe('0xf')](util[_0x2efe('0xa')](_0x2efe('0x1b'),_0x32fda9['id']));if(!_0x32fda9[_0x2efe('0x1c')]){throw new db[(_0x2efe('0x1d'))][(_0x2efe('0x1e'))](_0x2efe('0x1f'));}if(!_0x39a93b[_0x2efe('0x20')]||!_0x39a93b[_0x2efe('0x21')]||!_0x39a93b['sentimentRegion']||!_0x39a93b[_0x2efe('0x22')]||!_0x39a93b[_0x2efe('0x23')]){throw new db[(_0x2efe('0x1d'))][(_0x2efe('0x1e'))](_0x2efe('0x24'));}if(!_0x40fa2e['fileText']){throw new Error(_0x2efe('0x25'));}if(_0x39a93b[_0x2efe('0x21')]===_0x250023['id']){return _0x250023;}else{return db[_0x2efe('0x26')][_0x2efe('0x27')]({'where':{'id':_settings[_0x2efe('0x21')]}});}})[_0x2efe('0xe')](function(_0x1d88a6){if(!_0x1d88a6){throw new db[(_0x2efe('0x1d'))][(_0x2efe('0x1e'))](_0x2efe('0x28'));}if(!_0x1d88a6['data1']||!_0x1d88a6[_0x2efe('0xc')]){throw new db[(_0x2efe('0x1d'))][(_0x2efe('0x1e'))](_0x2efe('0x29'));}_0x41039a=_0x1d88a6;logger[_0x2efe('0xf')](util[_0x2efe('0xa')](_0x2efe('0x2a'),_0x32fda9['id']));return sentiment(_0x41039a[_0x2efe('0x2b')],_0x41039a[_0x2efe('0xc')],_0x39a93b['sentimentRegion'],_0x40fa2e[_0x2efe('0x10')],_0x39a93b[_0x2efe('0x22')]);})['then'](function(_0x50a412){logger['info'](util[_0x2efe('0xa')](_0x2efe('0x2c'),_0x32fda9['id']));return _0x32fda9[_0x2efe('0x2d')]({'sentiment':_0x50a412['Sentiment'],'sPositive':_0x50a412[_0x2efe('0x2e')][_0x2efe('0x2f')],'sNegative':_0x50a412[_0x2efe('0x2e')]['Negative'],'sMixed':_0x50a412['SentimentScore'][_0x2efe('0x30')],'sNeutral':_0x50a412['SentimentScore'][_0x2efe('0x31')]});})[_0x2efe('0xe')](function(){logger[_0x2efe('0xf')](util['format'](_0x2efe('0x1b'),_0x32fda9['id']));_0x3c8910();});case _0x2efe('0x32'):return _0x32fda9[_0x2efe('0x2d')]({'transcribeStatus':_0x2efe('0x32'),'failureReason':_0x51cbf3[_0x2efe('0x11')][_0x2efe('0x33')]})[_0x2efe('0xe')](function(){logger['info'](util[_0x2efe('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x32fda9['id']));_0x3c8910();});default:logger[_0x2efe('0xf')](util[_0x2efe('0xa')](_0x2efe('0x34'),_0x32fda9['id']));break;}}else{return BPromise[_0x2efe('0x35')]()[_0x2efe('0xe')](function(){if(!_0x32fda9['tempSentiment']){throw new db[(_0x2efe('0x1d'))][(_0x2efe('0x1e'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x39a93b[_0x2efe('0x20')]||!_0x39a93b[_0x2efe('0x21')]||!_0x39a93b['sentimentRegion']||!_0x39a93b[_0x2efe('0x22')]||!_0x39a93b[_0x2efe('0x23')]){throw new db[(_0x2efe('0x1d'))][(_0x2efe('0x1e'))](_0x2efe('0x24'));}if(!_0x32fda9[_0x2efe('0x10')]){throw new Error(_0x2efe('0x25'));}if(_0x39a93b[_0x2efe('0x21')]===_0x250023['id']){return _0x250023;}else{return db[_0x2efe('0x26')][_0x2efe('0x27')]({'where':{'id':_settings[_0x2efe('0x21')]}});}})[_0x2efe('0xe')](function(_0x1c9032){if(!_0x1c9032){throw new db[(_0x2efe('0x1d'))][(_0x2efe('0x1e'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1c9032[_0x2efe('0x2b')]||!_0x1c9032[_0x2efe('0xc')]){throw new db[(_0x2efe('0x1d'))][(_0x2efe('0x1e'))](_0x2efe('0x29'));}_0x41039a=_0x1c9032;logger[_0x2efe('0xf')](util[_0x2efe('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x32fda9['id']));return sentiment(_0x41039a[_0x2efe('0x2b')],_0x41039a[_0x2efe('0xc')],_0x39a93b[_0x2efe('0x36')],_0x32fda9[_0x2efe('0x10')],_0x39a93b[_0x2efe('0x22')]);})['then'](function(_0xa22b48){logger[_0x2efe('0xf')](util[_0x2efe('0xa')](_0x2efe('0x2c'),_0x32fda9['id']));return _0x32fda9[_0x2efe('0x2d')]({'sentiment':_0xa22b48[_0x2efe('0x37')],'sPositive':_0xa22b48[_0x2efe('0x2e')][_0x2efe('0x2f')],'sNegative':_0xa22b48[_0x2efe('0x2e')]['Negative'],'sMixed':_0xa22b48['SentimentScore']['Mixed'],'sNeutral':_0xa22b48[_0x2efe('0x2e')][_0x2efe('0x31')],'transcribeStatus':'COMPLETED'});})[_0x2efe('0xe')](function(){logger['info'](util['format'](_0x2efe('0x1b'),_0x32fda9['id']));_0x3c8910();});}})['catch'](function(_0x1e3000){if(_0x1e3000){if(!_0x1e3000[_0x2efe('0x38')]||_0x1e3000[_0x2efe('0x38')]!=='SequelizeValidationError'){logger[_0x2efe('0x39')](util[_0x2efe('0xa')](_0x2efe('0x3a'),_0x32fda9['id']),util[_0x2efe('0x3b')](_0x1e3000,{'showHidden':![],'depth':null}));}}_0x3c8910();});});}function checkTranscribe(){var _0x4afa37;var _0x26886b;var _0x9a5118;return db['VoiceRecording'][_0x2efe('0x3c')]({'where':{'transcribeStatus':_0x2efe('0x3d')}})[_0x2efe('0xe')](function(_0x3a78f5){if(!_0x3a78f5||!_0x3a78f5[_0x2efe('0x19')]){throw new db['Sequelize'][(_0x2efe('0x1e'))](_0x2efe('0x3e'));}_0x4afa37=_0x3a78f5;return db[_0x2efe('0x3f')]['findOne']({'where':{'id':0x1}});})[_0x2efe('0xe')](function(_0x3fe2c0){if(!_0x3fe2c0){throw new db[(_0x2efe('0x1d'))][(_0x2efe('0x1e'))]('Settings\x20not\x20available');}_0x26886b=_0x3fe2c0;if(!_0x26886b[_0x2efe('0x40')]||!_0x26886b['transcribeAccountId']||!_0x26886b[_0x2efe('0x41')]||!_0x26886b[_0x2efe('0x22')]||!_0x26886b[_0x2efe('0x23')]){throw new db['Sequelize']['ValidationError']('Transcribe\x20not\x20configured');}return db[_0x2efe('0x26')]['findOne']({'where':{'id':_0x26886b[_0x2efe('0x42')]}});})['then'](function(_0x327a10){if(!_0x327a10){throw new db[(_0x2efe('0x1d'))][(_0x2efe('0x1e'))](_0x2efe('0x28'));}if(!_0x327a10[_0x2efe('0x2b')]||!_0x327a10[_0x2efe('0xc')]){throw new db[(_0x2efe('0x1d'))]['ValidationError'](_0x2efe('0x29'));}_0x9a5118=_0x327a10;var _0x3b1da4=[];_0x4afa37[_0x2efe('0x43')](function(_0x41d1b0){_0x3b1da4[_0x2efe('0x44')](checkTranscribeJob(_0x41d1b0,_0x26886b,_0x9a5118));});return BPromise[_0x2efe('0x45')](_0x3b1da4);})['catch'](function(_0x4659ce){if(_0x4659ce){if(!_0x4659ce[_0x2efe('0x38')]||_0x4659ce[_0x2efe('0x38')]!==_0x2efe('0x46')){logger[_0x2efe('0x39')](util['inspect'](_0x4659ce,{'showHidden':![],'depth':null}));}}});}exports[_0x2efe('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0xa0a3=['Transcribe\x20not\x20configured','forEach','push','start','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','bucket','Sequelize','Transcript\x20not\x20available','sentimentAccountId','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','resolve','tempSentiment','CloudProvider','catch','name','SequelizeValidationError','error','inspect','VoiceRecording','IN_PROGRESS','transcribeAccountId'];(function(_0xaa9dc4,_0x8e8318){var _0x48b712=function(_0x4c16f8){while(--_0x4c16f8){_0xaa9dc4['push'](_0xaa9dc4['shift']());}};_0x48b712(++_0x8e8318);}(_0xa0a3,0x1e0));var _0x3a0a=function(_0x6fce8b,_0x557e45){_0x6fce8b=_0x6fce8b-0x0;var _0x2b6f81=_0xa0a3[_0x6fce8b];return _0x2b6f81;};var _=require('lodash');var AWS=require(_0x3a0a('0x0'));var rp=require(_0x3a0a('0x1'));var util=require('util');var BPromise=require(_0x3a0a('0x2'));var db=require(_0x3a0a('0x3'))['db'];var logger=require(_0x3a0a('0x4'))(_0x3a0a('0x5'));function getTranscriptionJob(_0x4f9090,_0x7f2ad7,_0xded829,_0x2569ba){return new Promise(function(_0xa047cf,_0x3d7dc7){var _0x4719d=new AWS[(_0x3a0a('0x6'))]({'accessKeyId':_0x7f2ad7,'secretAccessKey':_0x4f9090,'region':_0xded829});_0x4719d[_0x3a0a('0x7')]({'TranscriptionJobName':_0x2569ba},function(_0x5d98d3,_0x56ee1b){if(_0x5d98d3){return _0x3d7dc7(_0x5d98d3);}else{return _0xa047cf(_0x56ee1b);}});});}function sentiment(_0x3a2d8e,_0x3baf7c,_0x29207e,_0x3460be,_0x43e9ec){return new Promise(function(_0x272435,_0x42235e){var _0x53f366=new AWS['Comprehend']({'accessKeyId':_0x3baf7c,'secretAccessKey':_0x3a2d8e,'region':_0x29207e});_0x53f366[_0x3a0a('0x8')]({'Text':_0x3460be,'LanguageCode':_0x43e9ec[_0x3a0a('0x9')](0x0,0x2)},function(_0x47a1c3,_0x4f284b){if(_0x47a1c3){return _0x42235e(_0x47a1c3);}else{return _0x272435(_0x4f284b);}});});}function checkTranscribeJob(_0x477aa2,_0x1db53c,_0x52cb58){var _0x2243d2;return new BPromise(function(_0x3b0a9c,_0xc86db){logger[_0x3a0a('0xa')](util[_0x3a0a('0xb')](_0x3a0a('0xc'),_0x477aa2['id'],_0x477aa2[_0x3a0a('0xd')]));return getTranscriptionJob(_0x52cb58[_0x3a0a('0xe')],_0x52cb58[_0x3a0a('0xf')],_0x1db53c[_0x3a0a('0x10')],_0x477aa2[_0x3a0a('0xd')])[_0x3a0a('0x11')](function(_0x52f629){logger[_0x3a0a('0xa')](util['format'](_0x3a0a('0x12'),_0x477aa2['id'],_0x477aa2['transcribeName'],_0x52f629[_0x3a0a('0x13')][_0x3a0a('0x14')]));if(!_0x477aa2[_0x3a0a('0x15')]){switch(_0x52f629['TranscriptionJob'][_0x3a0a('0x14')]){case _0x3a0a('0x16'):var _0x4f0372={'transcribeStatus':_0x52f629[_0x3a0a('0x13')][_0x3a0a('0x14')],'fileUri':_0x52f629[_0x3a0a('0x13')][_0x3a0a('0x17')][_0x3a0a('0x18')]};logger[_0x3a0a('0xa')](util[_0x3a0a('0xb')](_0x3a0a('0x19'),_0x477aa2['id']));return rp({'uri':_0x52f629[_0x3a0a('0x13')][_0x3a0a('0x17')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x483039){logger[_0x3a0a('0xa')](util[_0x3a0a('0xb')](_0x3a0a('0x1a'),_0x477aa2['id']));if(_0x483039&&_0x483039[_0x3a0a('0x1b')]&&_0x483039[_0x3a0a('0x1b')]['transcripts']&&_0x483039[_0x3a0a('0x1b')][_0x3a0a('0x1c')][_0x3a0a('0x1d')]){_0x4f0372['fileText']='';for(var _0x3a5955=0x0;_0x3a5955<_0x483039[_0x3a0a('0x1b')]['transcripts']['length'];_0x3a5955++){_0x4f0372[_0x3a0a('0x15')]+=_0x483039[_0x3a0a('0x1b')][_0x3a0a('0x1c')][_0x3a5955]['transcript']+'';}}return _0x477aa2[_0x3a0a('0x1e')](_0x4f0372);})[_0x3a0a('0x11')](function(){logger[_0x3a0a('0xa')](util[_0x3a0a('0xb')](_0x3a0a('0x1f'),_0x477aa2['id']));if(!_0x477aa2['tempSentiment']){throw new db['Sequelize'][(_0x3a0a('0x20'))](_0x3a0a('0x21'));}if(!_0x1db53c['sentiment']||!_0x1db53c['sentimentAccountId']||!_0x1db53c[_0x3a0a('0x22')]||!_0x1db53c[_0x3a0a('0x23')]||!_0x1db53c[_0x3a0a('0x24')]){throw new db[(_0x3a0a('0x25'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x4f0372[_0x3a0a('0x15')]){throw new Error(_0x3a0a('0x26'));}if(_0x1db53c[_0x3a0a('0x27')]===_0x52cb58['id']){return _0x52cb58;}else{return db['CloudProvider'][_0x3a0a('0x28')]({'where':{'id':_settings[_0x3a0a('0x27')]}});}})[_0x3a0a('0x11')](function(_0x39b341){if(!_0x39b341){throw new db[(_0x3a0a('0x25'))][(_0x3a0a('0x20'))](_0x3a0a('0x29'));}if(!_0x39b341[_0x3a0a('0xe')]||!_0x39b341[_0x3a0a('0xf')]){throw new db['Sequelize'][(_0x3a0a('0x20'))](_0x3a0a('0x2a'));}_0x2243d2=_0x39b341;logger[_0x3a0a('0xa')](util[_0x3a0a('0xb')](_0x3a0a('0x2b'),_0x477aa2['id']));return sentiment(_0x2243d2['data1'],_0x2243d2[_0x3a0a('0xf')],_0x1db53c[_0x3a0a('0x22')],_0x4f0372[_0x3a0a('0x15')],_0x1db53c[_0x3a0a('0x23')]);})[_0x3a0a('0x11')](function(_0x451dc5){logger['info'](util[_0x3a0a('0xb')](_0x3a0a('0x2c'),_0x477aa2['id']));return _0x477aa2[_0x3a0a('0x1e')]({'sentiment':_0x451dc5[_0x3a0a('0x2d')],'sPositive':_0x451dc5[_0x3a0a('0x2e')][_0x3a0a('0x2f')],'sNegative':_0x451dc5[_0x3a0a('0x2e')][_0x3a0a('0x30')],'sMixed':_0x451dc5['SentimentScore'][_0x3a0a('0x31')],'sNeutral':_0x451dc5[_0x3a0a('0x2e')][_0x3a0a('0x32')]});})[_0x3a0a('0x11')](function(){logger[_0x3a0a('0xa')](util[_0x3a0a('0xb')](_0x3a0a('0x1f'),_0x477aa2['id']));_0x3b0a9c();});case _0x3a0a('0x33'):return _0x477aa2['update']({'transcribeStatus':_0x3a0a('0x33'),'failureReason':_0x52f629[_0x3a0a('0x13')][_0x3a0a('0x34')]})[_0x3a0a('0x11')](function(){logger[_0x3a0a('0xa')](util[_0x3a0a('0xb')](_0x3a0a('0x1f'),_0x477aa2['id']));_0x3b0a9c();});default:logger[_0x3a0a('0xa')](util[_0x3a0a('0xb')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x477aa2['id']));break;}}else{return BPromise[_0x3a0a('0x35')]()['then'](function(){if(!_0x477aa2[_0x3a0a('0x36')]){throw new db[(_0x3a0a('0x25'))][(_0x3a0a('0x20'))](_0x3a0a('0x21'));}if(!_0x1db53c['sentiment']||!_0x1db53c[_0x3a0a('0x27')]||!_0x1db53c['sentimentRegion']||!_0x1db53c[_0x3a0a('0x23')]||!_0x1db53c[_0x3a0a('0x24')]){throw new db[(_0x3a0a('0x25'))][(_0x3a0a('0x20'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x477aa2[_0x3a0a('0x15')]){throw new Error('Transcript\x20not\x20available');}if(_0x1db53c['sentimentAccountId']===_0x52cb58['id']){return _0x52cb58;}else{return db[_0x3a0a('0x37')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0x3a0a('0x11')](function(_0xe5fba8){if(!_0xe5fba8){throw new db['Sequelize'][(_0x3a0a('0x20'))](_0x3a0a('0x29'));}if(!_0xe5fba8[_0x3a0a('0xe')]||!_0xe5fba8[_0x3a0a('0xf')]){throw new db[(_0x3a0a('0x25'))]['ValidationError'](_0x3a0a('0x2a'));}_0x2243d2=_0xe5fba8;logger[_0x3a0a('0xa')](util[_0x3a0a('0xb')](_0x3a0a('0x2b'),_0x477aa2['id']));return sentiment(_0x2243d2[_0x3a0a('0xe')],_0x2243d2[_0x3a0a('0xf')],_0x1db53c[_0x3a0a('0x22')],_0x477aa2[_0x3a0a('0x15')],_0x1db53c['language']);})['then'](function(_0x3666b8){logger[_0x3a0a('0xa')](util[_0x3a0a('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x477aa2['id']));return _0x477aa2[_0x3a0a('0x1e')]({'sentiment':_0x3666b8[_0x3a0a('0x2d')],'sPositive':_0x3666b8[_0x3a0a('0x2e')][_0x3a0a('0x2f')],'sNegative':_0x3666b8['SentimentScore'][_0x3a0a('0x30')],'sMixed':_0x3666b8['SentimentScore'][_0x3a0a('0x31')],'sNeutral':_0x3666b8['SentimentScore'][_0x3a0a('0x32')],'transcribeStatus':'COMPLETED'});})[_0x3a0a('0x11')](function(){logger[_0x3a0a('0xa')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x477aa2['id']));_0x3b0a9c();});}})[_0x3a0a('0x38')](function(_0x1464d5){if(_0x1464d5){if(!_0x1464d5[_0x3a0a('0x39')]||_0x1464d5[_0x3a0a('0x39')]!==_0x3a0a('0x3a')){logger[_0x3a0a('0x3b')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x477aa2['id']),util[_0x3a0a('0x3c')](_0x1464d5,{'showHidden':![],'depth':null}));}}_0x3b0a9c();});});}function checkTranscribe(){var _0x42da7d;var _0x598d46;var _0x48aa92;return db[_0x3a0a('0x3d')]['findAll']({'where':{'transcribeStatus':_0x3a0a('0x3e')}})[_0x3a0a('0x11')](function(_0x42663d){if(!_0x42663d||!_0x42663d[_0x3a0a('0x1d')]){throw new db[(_0x3a0a('0x25'))][(_0x3a0a('0x20'))]('No\x20transcribe\x20job\x20to\x20check');}_0x42da7d=_0x42663d;return db['Setting'][_0x3a0a('0x28')]({'where':{'id':0x1}});})[_0x3a0a('0x11')](function(_0x201dca){if(!_0x201dca){throw new db[(_0x3a0a('0x25'))][(_0x3a0a('0x20'))]('Settings\x20not\x20available');}_0x598d46=_0x201dca;if(!_0x598d46[_0x3a0a('0x5')]||!_0x598d46[_0x3a0a('0x3f')]||!_0x598d46['transcribeRegion']||!_0x598d46['language']||!_0x598d46[_0x3a0a('0x24')]){throw new db[(_0x3a0a('0x25'))][(_0x3a0a('0x20'))](_0x3a0a('0x40'));}return db[_0x3a0a('0x37')][_0x3a0a('0x28')]({'where':{'id':_0x598d46[_0x3a0a('0x3f')]}});})['then'](function(_0x2905b7){if(!_0x2905b7){throw new db[(_0x3a0a('0x25'))][(_0x3a0a('0x20'))](_0x3a0a('0x29'));}if(!_0x2905b7[_0x3a0a('0xe')]||!_0x2905b7[_0x3a0a('0xf')]){throw new db[(_0x3a0a('0x25'))][(_0x3a0a('0x20'))](_0x3a0a('0x2a'));}_0x48aa92=_0x2905b7;var _0x3fe96a=[];_0x42da7d[_0x3a0a('0x41')](function(_0x1715e1){_0x3fe96a[_0x3a0a('0x42')](checkTranscribeJob(_0x1715e1,_0x598d46,_0x48aa92));});return BPromise['all'](_0x3fe96a);})[_0x3a0a('0x38')](function(_0x32b740){if(_0x32b740){if(!_0x32b740[_0x3a0a('0x39')]||_0x32b740['name']!=='SequelizeValidationError'){logger[_0x3a0a('0x3b')](util[_0x3a0a('0x3c')](_0x32b740,{'showHidden':![],'depth':null}));}}});}exports[_0x3a0a('0x43')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index 80dd056..fd939dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5386=['then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','WhatsappInteraction','update','system','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','whatsappInteraction:update','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','findAll','lastMsgAt','subtract','hours'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x5386,0x1e1));var _0x6538=function(_0x320dd0,_0x266a5b){_0x320dd0=_0x320dd0-0x0;var _0x1ffb02=_0x5386[_0x320dd0];return _0x1ffb02;};'use strict';var _=require(_0x6538('0x0'));var moment=require(_0x6538('0x1'));var Redis=require(_0x6538('0x2'));var util=require(_0x6538('0x3'));var config=require('../../config/environment');var db=require(_0x6538('0x4'))['db'];var logger=require(_0x6538('0x5'))(_0x6538('0x6'));config[_0x6538('0x7')]=_[_0x6538('0x8')](config[_0x6538('0x7')],{'host':_0x6538('0x9'),'port':0x18eb});var io=require(_0x6538('0xa'))(new Redis(config['redis']));function closeInteractions(){var _0x16c291=[];return db['WhatsappInteraction'][_0x6538('0xb')]({'raw':!![],'attributes':['id',_0x6538('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x6538('0xd')](0x18,_0x6538('0xe'))}}})[_0x6538('0xf')](function(_0x2bce05){if(_0x2bce05&&_0x2bce05[_0x6538('0x10')]){_0x16c291=_[_0x6538('0x11')](_0x2bce05||[],'id');logger[_0x6538('0x12')](_0x6538('0x13'),_0x16c291['join']());return db[_0x6538('0x14')][_0x6538('0x15')]({'closeReason':_0x6538('0x16'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x6538('0x17')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x16c291}});}})[_0x6538('0xf')](function(){if(_0x16c291&&_0x16c291[_0x6538('0x10')]){logger['info'](_0x6538('0x18'),_0x16c291[_0x6538('0x19')]());for(var _0x59d064=0x0;_0x59d064<_0x16c291[_0x6538('0x10')];_0x59d064++){io[_0x6538('0x1a')](_0x6538('0x1b'),{'id':_0x16c291[_0x59d064],'closed':!![]});}}})['catch'](function(_0x406b0c){logger['error'](_0x6538('0x1c'),_0x406b0c?util[_0x6538('0x1d')](_0x406b0c,{'showHidden':![],'depth':null}):'');});}exports[_0x6538('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xcc97=['then','length','map','info','join','update','timeout','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','redis','defaults','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract'];(function(_0x39609a,_0x28a563){var _0xecd92=function(_0x57241a){while(--_0x57241a){_0x39609a['push'](_0x39609a['shift']());}};_0xecd92(++_0x28a563);}(_0xcc97,0x1b3));var _0x7cc9=function(_0x77f68,_0xcb0ab){_0x77f68=_0x77f68-0x0;var _0x452431=_0xcc97[_0x77f68];return _0x452431;};'use strict';var _=require(_0x7cc9('0x0'));var moment=require(_0x7cc9('0x1'));var Redis=require('ioredis');var util=require(_0x7cc9('0x2'));var config=require(_0x7cc9('0x3'));var db=require(_0x7cc9('0x4'))['db'];var logger=require(_0x7cc9('0x5'))('schedule');config[_0x7cc9('0x6')]=_[_0x7cc9('0x7')](config[_0x7cc9('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x7cc9('0x8'))(new Redis(config[_0x7cc9('0x6')]));function closeInteractions(){var _0x582b23=[];return db[_0x7cc9('0x9')][_0x7cc9('0xa')]({'raw':!![],'attributes':['id',_0x7cc9('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x7cc9('0xc')](0x18,'hours')}}})[_0x7cc9('0xd')](function(_0x2c6c6e){if(_0x2c6c6e&&_0x2c6c6e[_0x7cc9('0xe')]){_0x582b23=_[_0x7cc9('0xf')](_0x2c6c6e||[],'id');logger[_0x7cc9('0x10')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x582b23[_0x7cc9('0x11')]());return db[_0x7cc9('0x9')][_0x7cc9('0x12')]({'closeReason':'system','disposition':_0x7cc9('0x13'),'closed':!![],'closedAt':moment()['format'](_0x7cc9('0x14'))},{'where':{'id':_0x582b23}});}})[_0x7cc9('0xd')](function(){if(_0x582b23&&_0x582b23[_0x7cc9('0xe')]){logger[_0x7cc9('0x10')](_0x7cc9('0x15'),_0x582b23['join']());for(var _0x48a9a6=0x0;_0x48a9a6<_0x582b23[_0x7cc9('0xe')];_0x48a9a6++){io[_0x7cc9('0x16')](_0x7cc9('0x17'),{'id':_0x582b23[_0x48a9a6],'closed':!![]});}}})[_0x7cc9('0x18')](function(_0xfec93c){logger[_0x7cc9('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0xfec93c?util[_0x7cc9('0x1a')](_0xfec93c,{'showHidden':![],'depth':null}):'');});}exports[_0x7cc9('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 68f2be5..d50508c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94fd=['then','CmContact','bulkCreate','log','contacts1','CmHopper','hopper1','finished\x20populating','contacts2','catch','util','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','destroy'];(function(_0x1ccbcc,_0x5c948b){var _0x1e873f=function(_0x4f232e){while(--_0x4f232e){_0x1ccbcc['push'](_0x1ccbcc['shift']());}};_0x1e873f(++_0x5c948b);}(_0x94fd,0xd0));var _0xd94f=function(_0x3696ef,_0xc701a4){_0x3696ef=_0x3696ef-0x0;var _0x4d4297=_0x94fd[_0x3696ef];return _0x4d4297;};'use strict';var util=require(_0xd94f('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xd94f('0x1')]({'id':i,'firstName':_0xd94f('0x2')+i,'lastName':_0xd94f('0x3')+i,'phone':0xf879fb460+i,'email':_0xd94f('0x4')+i+_0xd94f('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xd94f('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xd94f('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xd94f('0x6')](),'updatedAt':Date[_0xd94f('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xd94f('0x1')]({'id':i,'firstName':_0xd94f('0x2')+i,'lastName':_0xd94f('0x3')+i,'phone':0xf879fb460+i,'email':_0xd94f('0x4')+i+_0xd94f('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xd94f('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xd94f('0x6')]()});}db['CmContact'][_0xd94f('0x7')]({'where':{}})[_0xd94f('0x8')](function(){return db[_0xd94f('0x9')][_0xd94f('0xa')](contacts);})[_0xd94f('0x8')](function(){console[_0xd94f('0xb')]('finished\x20populating',_0xd94f('0xc'));return db['CmHopper'][_0xd94f('0x7')]({'where':{}});})[_0xd94f('0x8')](function(){return db[_0xd94f('0xd')][_0xd94f('0xa')](hopper);})['then'](function(){console['log']('finished\x20populating',_0xd94f('0xe'));return db['CmContact'][_0xd94f('0xa')](contacts2);})['then'](function(){console[_0xd94f('0xb')](_0xd94f('0xf'),_0xd94f('0x10'));return db['CmHopper']['bulkCreate'](hopper2);})[_0xd94f('0x8')](function(){console[_0xd94f('0xb')](_0xd94f('0xf'),'hopper2');})[_0xd94f('0x11')](function(_0x36fe8c){console[_0xd94f('0xb')](_0x36fe8c);});
\ No newline at end of file
+var _0x734b=['now','innocenzo.biondo','CmContact','destroy','bulkCreate','log','contacts1','then','CmHopper','hopper1','finished\x20populating','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','@xcally.com'];(function(_0xee8188,_0x4cd944){var _0x282408=function(_0xf69119){while(--_0xf69119){_0xee8188['push'](_0xee8188['shift']());}};_0x282408(++_0x4cd944);}(_0x734b,0x1e8));var _0xb734=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x734b[_0x2b9b7f];return _0x4ed19a;};'use strict';var util=require(_0xb734('0x0'));var db=require(_0xb734('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xb734('0x2')]({'id':i,'firstName':_0xb734('0x3')+i,'lastName':_0xb734('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xb734('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xb734('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xb734('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xb734('0x3')+i,'lastName':_0xb734('0x4')+i,'phone':0xf879fb460+i,'email':_0xb734('0x7')+i+_0xb734('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xb734('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xb734('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0xb734('0x8')][_0xb734('0x9')]({'where':{}})['then'](function(){return db[_0xb734('0x8')][_0xb734('0xa')](contacts);})['then'](function(){console[_0xb734('0xb')]('finished\x20populating',_0xb734('0xc'));return db['CmHopper']['destroy']({'where':{}});})[_0xb734('0xd')](function(){return db[_0xb734('0xe')][_0xb734('0xa')](hopper);})[_0xb734('0xd')](function(){console[_0xb734('0xb')]('finished\x20populating',_0xb734('0xf'));return db['CmContact'][_0xb734('0xa')](contacts2);})['then'](function(){console['log'](_0xb734('0x10'),'contacts2');return db[_0xb734('0xe')][_0xb734('0xa')](hopper2);})['then'](function(){console['log'](_0xb734('0x10'),_0xb734('0x11'));})[_0xb734('0x12')](function(_0x51e530){console[_0xb734('0xb')](_0x51e530);});
\ No newline at end of file
index 40daac1..73ef36c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01ce=['then','log','add\x20user','catch','util','../mysqldb','push','%s%s','agent','format','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate'];(function(_0x1c62aa,_0x191f90){var _0x1a643b=function(_0x115df6){while(--_0x115df6){_0x1c62aa['push'](_0x1c62aa['shift']());}};_0x1a643b(++_0x191f90);}(_0x01ce,0xeb));var _0xe01c=function(_0x1dae75,_0x2a9f5d){_0x1dae75=_0x1dae75-0x0;var _0x1325bd=_0x01ce[_0x1dae75];return _0x1325bd;};'use strict';var util=require(_0xe01c('0x0'));var db=require(_0xe01c('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xe01c('0x2')]({'name':util['format'](_0xe01c('0x3'),_0xe01c('0x4'),i),'fullname':util['format'](_0xe01c('0x3'),'agent',i),'email':util[_0xe01c('0x5')]('%s%s@xcally.com','agent',i),'role':_0xe01c('0x4'),'password':'password','internal':0xfa0+i,'type':_0xe01c('0x6'),'transport':[_0xe01c('0x7'),'ws',_0xe01c('0x8')],'disallow':[_0xe01c('0x9')],'allow':[_0xe01c('0xa')],'defaultuser':util[_0xe01c('0x5')]('%s%s',_0xe01c('0x4'),i),'encryption':_0xe01c('0xb'),'avpf':_0xe01c('0xb'),'force_avp':_0xe01c('0xb'),'icesupport':_0xe01c('0xb'),'dtlsenable':_0xe01c('0xb'),'dtlsverify':'no','dtlscertfile':_0xe01c('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xe01c('0xd'),'callerid':util['format'](_0xe01c('0xe'),util[_0xe01c('0x5')]('%s%s',_0xe01c('0x4'),i),0xfa0+i)});}db[_0xe01c('0xf')][_0xe01c('0x10')](users)[_0xe01c('0x11')](function(){console[_0xe01c('0x12')](_0xe01c('0x13'));})[_0xe01c('0x14')](function(_0x2dfdbe){console[_0xe01c('0x12')](_0x2dfdbe);});
\ No newline at end of file
+var _0x8b3f=['../mysqldb','push','format','%s%s','agent','password','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','catch','util'];(function(_0x113982,_0x597be2){var _0x13ff92=function(_0x344be9){while(--_0x344be9){_0x113982['push'](_0x113982['shift']());}};_0x13ff92(++_0x597be2);}(_0x8b3f,0xdb));var _0xf8b3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b3f[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xf8b3('0x0'));var db=require(_0xf8b3('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xf8b3('0x2')]({'name':util[_0xf8b3('0x3')](_0xf8b3('0x4'),_0xf8b3('0x5'),i),'fullname':util['format'](_0xf8b3('0x4'),_0xf8b3('0x5'),i),'email':util[_0xf8b3('0x3')]('%s%s@xcally.com',_0xf8b3('0x5'),i),'role':_0xf8b3('0x5'),'password':_0xf8b3('0x6'),'internal':0xfa0+i,'type':'friend','transport':[_0xf8b3('0x7'),'ws',_0xf8b3('0x8')],'disallow':[_0xf8b3('0x9')],'allow':[_0xf8b3('0xa')],'defaultuser':util[_0xf8b3('0x3')](_0xf8b3('0x4'),_0xf8b3('0x5'),i),'encryption':_0xf8b3('0xb'),'avpf':'yes','force_avp':_0xf8b3('0xb'),'icesupport':_0xf8b3('0xb'),'dtlsenable':_0xf8b3('0xb'),'dtlsverify':'no','dtlscertfile':_0xf8b3('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xf8b3('0xd'),'callerid':util[_0xf8b3('0x3')](_0xf8b3('0xe'),util[_0xf8b3('0x3')](_0xf8b3('0x4'),_0xf8b3('0x5'),i),0xfa0+i)});}db['User'][_0xf8b3('0xf')](users)[_0xf8b3('0x10')](function(){console[_0xf8b3('0x11')](_0xf8b3('0x12'));})[_0xf8b3('0x13')](function(_0x2064c3){console[_0xf8b3('0x11')](_0x2064c3);});
\ No newline at end of file
index 712f88b..cd39304 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41d0=['Campaign','ivr','%s:queue:%s','length','format','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:outbound','include','VoiceQueue','ChatQueue','push','FaxQueue','SmsQueue','MailQueue','Trunk','user','VoiceQueues','OpenchannelQueue','WhatsappQueue','Trunks','getVoiceQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','voice','chat','mail','telephone:%s','trunk:%s','campaign:%s:%s','leave','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','log','default','setMaxListeners','request','connection','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash','util','bluebird','../mysqldb','name','Agents','User','role','agent','telephone','type','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','map','where'];(function(_0x10d359,_0x89ca6f){var _0x25b60b=function(_0x5a0a4d){while(--_0x5a0a4d){_0x10d359['push'](_0x10d359['shift']());}};_0x25b60b(++_0x89ca6f);}(_0x41d0,0x1c6));var _0x041d=function(_0x1bc762,_0x523eb3){_0x1bc762=_0x1bc762-0x0;var _0x40f70c=_0x41d0[_0x1bc762];return _0x40f70c;};'use strict';var _=require(_0x041d('0x0'));var util=require(_0x041d('0x1'));var BPromise=require(_0x041d('0x2'));var db=require(_0x041d('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x041d('0x4')],'include':[{'as':_0x041d('0x5'),'model':db[_0x041d('0x6')],'attributes':['id',_0x041d('0x4'),_0x041d('0x7')],'raw':!![],'where':{'role':_0x041d('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x041d('0x4')],'where':{'role':_0x041d('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x041d('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x041d('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x041d('0xa')],'where':{'type':'ivr'}};function getAssociatedResources(_0xd7e3b6,_0x965a31,_0x556017){return db['UserProfileSection']['findOne']({'where':{'name':_0xd7e3b6,'userProfileId':_0x965a31},'raw':!![]})[_0x041d('0xb')](function(_0x5b41a0){if(_0x5b41a0){if(_0x5b41a0[_0x041d('0xc')]){switch(_0xd7e3b6){case'VoiceQueues':case _0x041d('0xd'):case _0x041d('0xe'):case _0x041d('0xf'):case _0x041d('0x10'):case _0x041d('0x11'):case _0x041d('0x12'):return db[_0x556017][_0x041d('0x13')](queryQueues);case _0x041d('0x14'):return db[_0x556017][_0x041d('0x13')](queryTelephones);case'Trunks':return db[_0x556017][_0x041d('0x13')](queryTrunks);case _0x041d('0x15'):return db[_0x556017][_0x041d('0x13')](queryCampaigns);}}else{return db[_0x041d('0x16')][_0x041d('0x13')]({'attributes':[_0x041d('0x17')],'where':{'sectionId':_0x5b41a0['id']},'raw':!![]})['then'](function(_0xaadc6f){if(_0xaadc6f){var _0x167cfe={'where':{'id':_[_0x041d('0x18')](_0xaadc6f,_0x041d('0x17'))},'raw':!![]};switch(_0x556017){case _0x041d('0x6'):_0x167cfe[_0x041d('0x19')]['role']='telephone';break;case _0x041d('0x1a'):_0x167cfe[_0x041d('0x19')]['type']=_0x041d('0x1b');break;}return db[_0x556017]['findAll'](_0x167cfe);}else{return[];}});}}else{return[];}})[_0x041d('0xb')](function(_0x2d51dc){return _0x2d51dc;});}function joinOrLeaveQueues(_0x137878,_0x56e031,_0x3505e7,_0x4c5ebe){_0x137878[_0x56e031](util['format'](_0x041d('0x1c'),_0x3505e7,_0x4c5ebe['name']));if(_0x4c5ebe[_0x041d('0x5')]){for(var _0x339d10=0x0;_0x339d10<_0x4c5ebe[_0x041d('0x5')][_0x041d('0x1d')];_0x339d10+=0x1){_0x137878[_0x56e031](util[_0x041d('0x1e')](_0x041d('0x1f'),_0x4c5ebe[_0x041d('0x5')][_0x339d10][_0x041d('0x4')]));}}}function joinOrLeave(_0x489e10,_0x1fee9a,_0x302aaa){var _0x6058d7;if(_0x489e10[_0x041d('0x20')][_0x041d('0x21')]['id']){db['User'][_0x041d('0x22')]({'attributes':['id',_0x041d('0x4'),_0x041d('0x7'),_0x041d('0x23')],'where':{'id':_0x489e10[_0x041d('0x20')][_0x041d('0x21')]['id']},'include':[{'model':db[_0x041d('0x24')],'as':_0x041d('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x041d('0x26')],'as':_0x041d('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x041d('0x28')],'as':_0x041d('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x041d('0x2a')],'as':_0x041d('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x041d('0x2c')],'as':_0x041d('0x2d'),'attributes':['id'],'raw':!![]},{'model':db[_0x041d('0x2e')],'as':_0x041d('0x2f'),'attributes':['id'],'raw':!![]}]})[_0x041d('0xb')](function(_0x18b06b){if(_0x18b06b){_0x6058d7=_0x18b06b;_0x489e10[_0x1fee9a](util[_0x041d('0x1e')](_0x041d('0x1f'),_0x18b06b[_0x041d('0x4')]));var _0x555462=[];switch(_0x18b06b[_0x041d('0x7')]){case _0x041d('0x30'):_0x489e10[_0x1fee9a]('voice:inbound');_0x489e10[_0x1fee9a](_0x041d('0x31'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x041d('0x32')];}_0x555462['push'](db[_0x041d('0x33')][_0x041d('0x13')](queryQueues));_0x555462['push'](db[_0x041d('0x34')][_0x041d('0x13')](queryQueues));_0x555462[_0x041d('0x35')](db[_0x041d('0x36')]['findAll'](queryQueues));_0x555462[_0x041d('0x35')](db[_0x041d('0x37')][_0x041d('0x13')](queryQueues));_0x555462[_0x041d('0x35')](db[_0x041d('0x38')]['findAll'](queryQueues));_0x555462[_0x041d('0x35')](db['OpenchannelQueue'][_0x041d('0x13')](queryQueues));_0x555462[_0x041d('0x35')](db['WhatsappQueue']['findAll'](queryQueues));_0x555462[_0x041d('0x35')](db[_0x041d('0x6')][_0x041d('0x13')](queryTelephones));_0x555462['push'](db[_0x041d('0x39')][_0x041d('0x13')](queryTrunks));_0x555462[_0x041d('0x35')](db[_0x041d('0x1a')]['findAll'](queryCampaigns));_0x555462[_0x041d('0x35')](db['User'][_0x041d('0x13')](queryAgents));break;case _0x041d('0x3a'):_0x489e10[_0x1fee9a]('voice:inbound');_0x489e10[_0x1fee9a](_0x041d('0x31'));_0x555462['push'](getAssociatedResources(_0x041d('0x3b'),_0x18b06b[_0x041d('0x23')],'VoiceQueue'));_0x555462[_0x041d('0x35')](getAssociatedResources(_0x041d('0xd'),_0x18b06b['userProfileId'],_0x041d('0x34')));_0x555462[_0x041d('0x35')](getAssociatedResources(_0x041d('0xe'),_0x18b06b[_0x041d('0x23')],_0x041d('0x36')));_0x555462[_0x041d('0x35')](getAssociatedResources(_0x041d('0xf'),_0x18b06b[_0x041d('0x23')],_0x041d('0x37')));_0x555462[_0x041d('0x35')](getAssociatedResources(_0x041d('0x10'),_0x18b06b[_0x041d('0x23')],'MailQueue'));_0x555462[_0x041d('0x35')](getAssociatedResources(_0x041d('0x11'),_0x18b06b[_0x041d('0x23')],_0x041d('0x3c')));_0x555462['push'](getAssociatedResources(_0x041d('0x12'),_0x18b06b[_0x041d('0x23')],_0x041d('0x3d')));_0x555462[_0x041d('0x35')](getAssociatedResources(_0x041d('0x14'),_0x18b06b[_0x041d('0x23')],_0x041d('0x6')));_0x555462[_0x041d('0x35')](getAssociatedResources(_0x041d('0x3e'),_0x18b06b['userProfileId'],_0x041d('0x39')));_0x555462[_0x041d('0x35')](getAssociatedResources('IvrCampaigns',_0x18b06b['userProfileId'],'Campaign'));_0x555462['push'](db['User'][_0x041d('0x13')](queryAgents));break;case _0x041d('0x8'):_0x489e10[_0x1fee9a]('voice:inbound');_0x489e10[_0x1fee9a]('voice:outbound');_0x555462[_0x041d('0x35')](_0x18b06b[_0x041d('0x3f')]({'attributes':['id',_0x041d('0x4')]}));_0x555462[_0x041d('0x35')](_0x18b06b['getChatQueues']({'attributes':['id','name']}));_0x555462[_0x041d('0x35')](_0x18b06b[_0x041d('0x40')]({'attributes':['id',_0x041d('0x4')]}));_0x555462[_0x041d('0x35')](_0x18b06b[_0x041d('0x41')]({'attributes':['id',_0x041d('0x4')]}));_0x555462[_0x041d('0x35')](_0x18b06b['getMailQueues']({'attributes':['id',_0x041d('0x4')]}));_0x555462[_0x041d('0x35')](_0x18b06b[_0x041d('0x42')]({'attributes':['id',_0x041d('0x4')]}));_0x555462[_0x041d('0x35')](_0x18b06b['getWhatsappQueues']({'attributes':['id','name']}));break;}return BPromise['all'](_0x555462);}})['then'](function(_0x1b761b){if(_0x1b761b&&_0x1b761b[_0x041d('0x1d')]){for(var _0x42f71=0x0;_0x42f71<_0x1b761b['length'];_0x42f71+=0x1){for(var _0x5be9f7=0x0;_0x5be9f7<_0x1b761b[_0x42f71][_0x041d('0x1d')];_0x5be9f7+=0x1){switch(_0x42f71){case 0x0:joinOrLeaveQueues(_0x489e10,_0x1fee9a,_0x041d('0x43'),_0x1b761b[_0x42f71][_0x5be9f7]);break;case 0x1:joinOrLeaveQueues(_0x489e10,_0x1fee9a,_0x041d('0x44'),_0x1b761b[_0x42f71][_0x5be9f7]);break;case 0x2:joinOrLeaveQueues(_0x489e10,_0x1fee9a,'fax',_0x1b761b[_0x42f71][_0x5be9f7]);break;case 0x3:joinOrLeaveQueues(_0x489e10,_0x1fee9a,'sms',_0x1b761b[_0x42f71][_0x5be9f7]);break;case 0x4:joinOrLeaveQueues(_0x489e10,_0x1fee9a,_0x041d('0x45'),_0x1b761b[_0x42f71][_0x5be9f7]);break;case 0x5:joinOrLeaveQueues(_0x489e10,_0x1fee9a,'openchannel',_0x1b761b[_0x42f71][_0x5be9f7]);break;case 0x6:joinOrLeaveQueues(_0x489e10,_0x1fee9a,'whatsapp',_0x1b761b[_0x42f71][_0x5be9f7]);break;case 0x7:if(_0x6058d7['role']!==_0x041d('0x8'))_0x489e10[_0x1fee9a](util[_0x041d('0x1e')](_0x041d('0x46'),_0x1b761b[_0x42f71][_0x5be9f7][_0x041d('0x4')]));break;case 0x8:if(_0x6058d7[_0x041d('0x7')]!=='agent')_0x489e10[_0x1fee9a](util['format'](_0x041d('0x47'),_0x1b761b[_0x42f71][_0x5be9f7][_0x041d('0x4')]));break;case 0x9:if(_0x6058d7[_0x041d('0x7')]!==_0x041d('0x8'))_0x489e10[_0x1fee9a](util['format'](_0x041d('0x48'),_0x1b761b[_0x42f71][_0x5be9f7][_0x041d('0xa')],_0x1b761b[_0x42f71][_0x5be9f7]['name']));break;case 0xa:_0x489e10[_0x1fee9a](util[_0x041d('0x1e')]('user:%s',_0x1b761b[_0x42f71][_0x5be9f7][_0x041d('0x4')]));break;}}}}})['then'](function(){if(_0x1fee9a===_0x041d('0x49')){var _0x5bd011=_[_0x041d('0x18')](_0x6058d7[_0x041d('0x25')],'id');return _0x6058d7['removeChatInteractions'](_0x5bd011)[_0x041d('0xb')](function(){for(var _0x57e726=0x0;_0x57e726<_0x5bd011[_0x041d('0x1d')];_0x57e726+=0x1){_0x302aaa[_0x041d('0x4a')](_0x041d('0x4b'),{'ChatInteractionId':Number(_0x5bd011[_0x57e726]),'UserId':Number(_0x6058d7['id'])});}});}})['then'](function(){if(_0x1fee9a===_0x041d('0x49')){var _0x2c6041=_[_0x041d('0x18')](_0x6058d7[_0x041d('0x27')],'id');return _0x6058d7[_0x041d('0x4c')](_0x2c6041)[_0x041d('0xb')](function(){for(var _0x3055f7=0x0;_0x3055f7<_0x2c6041[_0x041d('0x1d')];_0x3055f7+=0x1){_0x302aaa[_0x041d('0x4a')](_0x041d('0x4d'),{'MailInteractionId':Number(_0x2c6041[_0x3055f7]),'UserId':Number(_0x6058d7['id'])});}});}})['then'](function(){if(_0x1fee9a===_0x041d('0x49')){var _0x34693f=_[_0x041d('0x18')](_0x6058d7[_0x041d('0x29')],'id');return _0x6058d7['removeFaxInteractions'](_0x34693f)[_0x041d('0xb')](function(){for(var _0x34cd0e=0x0;_0x34cd0e<_0x34693f['length'];_0x34cd0e+=0x1){_0x302aaa['emit'](_0x041d('0x4e'),{'FaxInteractionId':Number(_0x34693f[_0x34cd0e]),'UserId':Number(_0x6058d7['id'])});}});}})[_0x041d('0xb')](function(){if(_0x1fee9a==='leave'){var _0x181d4f=_[_0x041d('0x18')](_0x6058d7[_0x041d('0x2b')],'id');return _0x6058d7[_0x041d('0x4f')](_0x181d4f)[_0x041d('0xb')](function(){for(var _0x60b2c5=0x0;_0x60b2c5<_0x181d4f['length'];_0x60b2c5+=0x1){_0x302aaa[_0x041d('0x4a')](_0x041d('0x50'),{'SmsInteractionId':Number(_0x181d4f[_0x60b2c5]),'UserId':Number(_0x6058d7['id'])});}});}})['then'](function(){if(_0x1fee9a==='leave'){var _0x322f08=_[_0x041d('0x18')](_0x6058d7[_0x041d('0x2d')],'id');return _0x6058d7[_0x041d('0x51')](_0x322f08)[_0x041d('0xb')](function(){for(var _0x22db88=0x0;_0x22db88<_0x322f08['length'];_0x22db88+=0x1){_0x302aaa['emit'](_0x041d('0x52'),{'OpenchannelInteractionId':Number(_0x322f08[_0x22db88]),'UserId':Number(_0x6058d7['id'])});}});}})[_0x041d('0xb')](function(){if(_0x1fee9a===_0x041d('0x49')){var _0x530ad0=_[_0x041d('0x18')](_0x6058d7[_0x041d('0x2f')],'id');return _0x6058d7['removeWhatsappInteractions'](_0x530ad0)[_0x041d('0xb')](function(){for(var _0x1cee66=0x0;_0x1cee66<_0x530ad0[_0x041d('0x1d')];_0x1cee66+=0x1){_0x302aaa[_0x041d('0x4a')](_0x041d('0x53'),{'WhatsappInteractionId':Number(_0x530ad0[_0x1cee66]),'UserId':Number(_0x6058d7['id'])});}});}})['catch'](function(_0x4b440c){_0x489e10[_0x041d('0x54')](_0x4b440c);});}}function onDisconnect(_0x5e2939,_0x430f90){joinOrLeave(_0x5e2939,_0x041d('0x49'),_0x430f90);}function onConnect(_0x5eaaff){joinOrLeave(_0x5eaaff,'join');}exports[_0x041d('0x55')]=function(_0x5880f9){_0x5880f9['on']('connection',function(_0x1ebc5e){_0x1ebc5e[_0x041d('0x56')](0x0);_0x1ebc5e['address']=_0x1ebc5e[_0x041d('0x57')][_0x041d('0x58')][_0x041d('0x59')]+':'+_0x1ebc5e['request'][_0x041d('0x58')][_0x041d('0x5a')];_0x1ebc5e[_0x041d('0x5b')]=new Date();_0x1ebc5e[_0x041d('0x54')]=function(_0x3a4ca7){console['log'](_0x041d('0x5c')+_0x1ebc5e[_0x041d('0x5d')][_0x041d('0x4')]+'['+_0x1ebc5e['address']+']',_0x3a4ca7);};_0x1ebc5e['on'](_0x041d('0x5e'),function(){onDisconnect(_0x1ebc5e,_0x5880f9);_0x1ebc5e[_0x041d('0x54')](_0x041d('0x5f'));});onConnect(_0x1ebc5e);_0x1ebc5e['log']('CONNECTED');});};
\ No newline at end of file
+var _0x15b8=['log','nsp','disconnect','DISCONNECTED','CONNECTED','util','bluebird','../mysqldb','./environment','name','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','findAll','Telephones','IvrCampaigns','resourceId','map','where','Campaign','format','%s:queue:%s','Agents','user:%s','find','userProfileId','handshake','query','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','SmsQueue','Trunk','user','FaxQueue','MailQueue','OpenchannelQueues','OpenchannelQueue','WhatsappQueues','WhatsappQueue','Trunks','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','chat','fax','mail','openchannel','whatsapp','campaign:%s:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','FaxInteractions','removeFaxInteractions','emit','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','connection','setMaxListeners','address','remoteAddress','request','remotePort','connectedAt'];(function(_0x27f803,_0x16ee64){var _0x320baa=function(_0x3766ae){while(--_0x3766ae){_0x27f803['push'](_0x27f803['shift']());}};_0x320baa(++_0x16ee64);}(_0x15b8,0xcd));var _0x815b=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x15b8[_0x565c49];return _0x20ca34;};'use strict';var _=require('lodash');var util=require(_0x815b('0x0'));var BPromise=require(_0x815b('0x1'));var db=require(_0x815b('0x2'))['db'];var config=require(_0x815b('0x3'));var queryQueues={'attributes':['id',_0x815b('0x4')],'include':[{'as':'Agents','model':db[_0x815b('0x5')],'attributes':['id',_0x815b('0x4'),_0x815b('0x6')],'raw':!![],'where':{'role':_0x815b('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x815b('0x4')],'where':{'role':_0x815b('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x815b('0x4')],'where':{'role':_0x815b('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x815b('0x4'),_0x815b('0x9')],'where':{'type':_0x815b('0xa')}};function getAssociatedResources(_0xfc3ec9,_0x474f37,_0x221ce4){return db[_0x815b('0xb')][_0x815b('0xc')]({'where':{'name':_0xfc3ec9,'userProfileId':_0x474f37},'raw':!![]})[_0x815b('0xd')](function(_0x27092e){if(_0x27092e){if(_0x27092e[_0x815b('0xe')]){switch(_0xfc3ec9){case _0x815b('0xf'):case _0x815b('0x10'):case _0x815b('0x11'):case _0x815b('0x12'):case _0x815b('0x13'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x221ce4][_0x815b('0x14')](queryQueues);case _0x815b('0x15'):return db[_0x221ce4]['findAll'](queryTelephones);case'Trunks':return db[_0x221ce4]['findAll'](queryTrunks);case _0x815b('0x16'):return db[_0x221ce4]['findAll'](queryCampaigns);}}else{return db['UserProfileResource'][_0x815b('0x14')]({'attributes':[_0x815b('0x17')],'where':{'sectionId':_0x27092e['id']},'raw':!![]})[_0x815b('0xd')](function(_0x59ea04){if(_0x59ea04){var _0x495431={'where':{'id':_[_0x815b('0x18')](_0x59ea04,_0x815b('0x17'))},'raw':!![]};switch(_0x221ce4){case _0x815b('0x5'):_0x495431[_0x815b('0x19')][_0x815b('0x6')]=_0x815b('0x8');break;case _0x815b('0x1a'):_0x495431[_0x815b('0x19')][_0x815b('0x9')]=_0x815b('0xa');break;}return db[_0x221ce4][_0x815b('0x14')](_0x495431);}else{return[];}});}}else{return[];}})[_0x815b('0xd')](function(_0x3daa0d){return _0x3daa0d;});}function joinOrLeaveQueues(_0x4cd48b,_0x4313a9,_0x348faa,_0x119bc8){_0x4cd48b[_0x4313a9](util[_0x815b('0x1b')](_0x815b('0x1c'),_0x348faa,_0x119bc8['name']));if(_0x119bc8[_0x815b('0x1d')]){for(var _0x2f7f8b=0x0;_0x2f7f8b<_0x119bc8[_0x815b('0x1d')]['length'];_0x2f7f8b+=0x1){_0x4cd48b[_0x4313a9](util['format'](_0x815b('0x1e'),_0x119bc8[_0x815b('0x1d')][_0x2f7f8b][_0x815b('0x4')]));}}}function joinOrLeave(_0xef3b1d,_0xe36d21,_0x31ab20){var _0x11f1c1;if(_0xef3b1d['handshake']['query']['id']){db[_0x815b('0x5')][_0x815b('0x1f')]({'attributes':['id',_0x815b('0x4'),_0x815b('0x6'),_0x815b('0x20')],'where':{'id':_0xef3b1d[_0x815b('0x21')][_0x815b('0x22')]['id']},'include':[{'model':db[_0x815b('0x23')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x815b('0x24')],'as':_0x815b('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x815b('0x26')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x815b('0x27')],'as':_0x815b('0x28'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x815b('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x815b('0x2a')],'as':_0x815b('0x2b'),'attributes':['id'],'raw':!![]}]})[_0x815b('0xd')](function(_0xb04f){if(_0xb04f){_0x11f1c1=_0xb04f;_0xef3b1d[_0xe36d21](util[_0x815b('0x1b')](_0x815b('0x1e'),_0xb04f[_0x815b('0x4')]));var _0x315d2b=[];switch(_0xb04f[_0x815b('0x6')]){case'admin':_0xef3b1d[_0xe36d21](_0x815b('0x2c'));_0xef3b1d[_0xe36d21](_0x815b('0x2d'));if(queryQueues[_0x815b('0x2e')](_0x815b('0x2f'))){delete queryQueues[_0x815b('0x2f')];}_0x315d2b[_0x815b('0x30')](db['VoiceQueue'][_0x815b('0x14')](queryQueues));_0x315d2b[_0x815b('0x30')](db[_0x815b('0x31')][_0x815b('0x14')](queryQueues));_0x315d2b[_0x815b('0x30')](db['FaxQueue'][_0x815b('0x14')](queryQueues));_0x315d2b['push'](db[_0x815b('0x32')][_0x815b('0x14')](queryQueues));_0x315d2b[_0x815b('0x30')](db['MailQueue'][_0x815b('0x14')](queryQueues));_0x315d2b['push'](db['OpenchannelQueue']['findAll'](queryQueues));_0x315d2b[_0x815b('0x30')](db['WhatsappQueue'][_0x815b('0x14')](queryQueues));_0x315d2b['push'](db[_0x815b('0x5')][_0x815b('0x14')](queryTelephones));_0x315d2b['push'](db[_0x815b('0x33')]['findAll'](queryTrunks));_0x315d2b['push'](db[_0x815b('0x1a')][_0x815b('0x14')](queryCampaigns));_0x315d2b[_0x815b('0x30')](db['User'][_0x815b('0x14')](queryAgents));break;case _0x815b('0x34'):_0xef3b1d[_0xe36d21](_0x815b('0x2c'));_0xef3b1d[_0xe36d21]('voice:outbound');_0x315d2b[_0x815b('0x30')](getAssociatedResources(_0x815b('0xf'),_0xb04f[_0x815b('0x20')],'VoiceQueue'));_0x315d2b[_0x815b('0x30')](getAssociatedResources(_0x815b('0x10'),_0xb04f[_0x815b('0x20')],_0x815b('0x31')));_0x315d2b[_0x815b('0x30')](getAssociatedResources('FaxQueues',_0xb04f['userProfileId'],_0x815b('0x35')));_0x315d2b['push'](getAssociatedResources('SmsQueues',_0xb04f[_0x815b('0x20')],_0x815b('0x32')));_0x315d2b['push'](getAssociatedResources(_0x815b('0x13'),_0xb04f[_0x815b('0x20')],_0x815b('0x36')));_0x315d2b[_0x815b('0x30')](getAssociatedResources(_0x815b('0x37'),_0xb04f[_0x815b('0x20')],_0x815b('0x38')));_0x315d2b['push'](getAssociatedResources(_0x815b('0x39'),_0xb04f[_0x815b('0x20')],_0x815b('0x3a')));_0x315d2b[_0x815b('0x30')](getAssociatedResources(_0x815b('0x15'),_0xb04f[_0x815b('0x20')],'User'));_0x315d2b[_0x815b('0x30')](getAssociatedResources(_0x815b('0x3b'),_0xb04f[_0x815b('0x20')],_0x815b('0x33')));_0x315d2b[_0x815b('0x30')](getAssociatedResources('IvrCampaigns',_0xb04f[_0x815b('0x20')],_0x815b('0x1a')));_0x315d2b[_0x815b('0x30')](db[_0x815b('0x5')][_0x815b('0x14')](queryAgents));break;case'agent':_0xef3b1d[_0xe36d21](_0x815b('0x2c'));_0xef3b1d[_0xe36d21](_0x815b('0x2d'));_0x315d2b[_0x815b('0x30')](_0xb04f[_0x815b('0x3c')]({'attributes':['id',_0x815b('0x4')]}));_0x315d2b[_0x815b('0x30')](_0xb04f[_0x815b('0x3d')]({'attributes':['id','name']}));_0x315d2b[_0x815b('0x30')](_0xb04f['getFaxQueues']({'attributes':['id',_0x815b('0x4')]}));_0x315d2b[_0x815b('0x30')](_0xb04f[_0x815b('0x3e')]({'attributes':['id',_0x815b('0x4')]}));_0x315d2b[_0x815b('0x30')](_0xb04f[_0x815b('0x3f')]({'attributes':['id',_0x815b('0x4')]}));_0x315d2b['push'](_0xb04f[_0x815b('0x40')]({'attributes':['id',_0x815b('0x4')]}));_0x315d2b['push'](_0xb04f[_0x815b('0x41')]({'attributes':['id',_0x815b('0x4')]}));break;}return BPromise[_0x815b('0x42')](_0x315d2b);}})[_0x815b('0xd')](function(_0x27b5d3){if(_0x27b5d3&&_0x27b5d3[_0x815b('0x43')]){for(var _0x1aa92a=0x0;_0x1aa92a<_0x27b5d3[_0x815b('0x43')];_0x1aa92a+=0x1){for(var _0x5e604c=0x0;_0x5e604c<_0x27b5d3[_0x1aa92a][_0x815b('0x43')];_0x5e604c+=0x1){switch(_0x1aa92a){case 0x0:joinOrLeaveQueues(_0xef3b1d,_0xe36d21,_0x815b('0x44'),_0x27b5d3[_0x1aa92a][_0x5e604c]);break;case 0x1:joinOrLeaveQueues(_0xef3b1d,_0xe36d21,_0x815b('0x45'),_0x27b5d3[_0x1aa92a][_0x5e604c]);break;case 0x2:joinOrLeaveQueues(_0xef3b1d,_0xe36d21,_0x815b('0x46'),_0x27b5d3[_0x1aa92a][_0x5e604c]);break;case 0x3:joinOrLeaveQueues(_0xef3b1d,_0xe36d21,'sms',_0x27b5d3[_0x1aa92a][_0x5e604c]);break;case 0x4:joinOrLeaveQueues(_0xef3b1d,_0xe36d21,_0x815b('0x47'),_0x27b5d3[_0x1aa92a][_0x5e604c]);break;case 0x5:joinOrLeaveQueues(_0xef3b1d,_0xe36d21,_0x815b('0x48'),_0x27b5d3[_0x1aa92a][_0x5e604c]);break;case 0x6:joinOrLeaveQueues(_0xef3b1d,_0xe36d21,_0x815b('0x49'),_0x27b5d3[_0x1aa92a][_0x5e604c]);break;case 0x7:if(_0x11f1c1[_0x815b('0x6')]!==_0x815b('0x7'))_0xef3b1d[_0xe36d21](util[_0x815b('0x1b')]('telephone:%s',_0x27b5d3[_0x1aa92a][_0x5e604c][_0x815b('0x4')]));break;case 0x8:if(_0x11f1c1[_0x815b('0x6')]!==_0x815b('0x7'))_0xef3b1d[_0xe36d21](util['format']('trunk:%s',_0x27b5d3[_0x1aa92a][_0x5e604c]['name']));break;case 0x9:if(_0x11f1c1['role']!==_0x815b('0x7'))_0xef3b1d[_0xe36d21](util['format'](_0x815b('0x4a'),_0x27b5d3[_0x1aa92a][_0x5e604c][_0x815b('0x9')],_0x27b5d3[_0x1aa92a][_0x5e604c]['name']));break;case 0xa:_0xef3b1d[_0xe36d21](util[_0x815b('0x1b')](_0x815b('0x1e'),_0x27b5d3[_0x1aa92a][_0x5e604c][_0x815b('0x4')]));break;}}}}})[_0x815b('0xd')](function(){if(_0xe36d21===_0x815b('0x4b')){var _0x1f68b2=_[_0x815b('0x18')](_0x11f1c1['ChatInteractions'],'id');return _0x11f1c1[_0x815b('0x4c')](_0x1f68b2)[_0x815b('0xd')](function(){for(var _0x3c9c87=0x0;_0x3c9c87<_0x1f68b2[_0x815b('0x43')];_0x3c9c87+=0x1){_0x31ab20['emit'](_0x815b('0x4d'),{'ChatInteractionId':Number(_0x1f68b2[_0x3c9c87]),'UserId':Number(_0x11f1c1['id'])});}});}})[_0x815b('0xd')](function(){if(_0xe36d21===_0x815b('0x4b')){var _0xcdac0d=_[_0x815b('0x18')](_0x11f1c1['MailInteractions'],'id');return _0x11f1c1['removeMailInteractions'](_0xcdac0d)['then'](function(){for(var _0x1a9291=0x0;_0x1a9291<_0xcdac0d['length'];_0x1a9291+=0x1){_0x31ab20['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0xcdac0d[_0x1a9291]),'UserId':Number(_0x11f1c1['id'])});}});}})[_0x815b('0xd')](function(){if(_0xe36d21===_0x815b('0x4b')){var _0x3d3a91=_[_0x815b('0x18')](_0x11f1c1[_0x815b('0x4e')],'id');return _0x11f1c1[_0x815b('0x4f')](_0x3d3a91)['then'](function(){for(var _0x28bdf6=0x0;_0x28bdf6<_0x3d3a91[_0x815b('0x43')];_0x28bdf6+=0x1){_0x31ab20[_0x815b('0x50')](_0x815b('0x51'),{'FaxInteractionId':Number(_0x3d3a91[_0x28bdf6]),'UserId':Number(_0x11f1c1['id'])});}});}})['then'](function(){if(_0xe36d21===_0x815b('0x4b')){var _0x5b2404=_[_0x815b('0x18')](_0x11f1c1[_0x815b('0x28')],'id');return _0x11f1c1['removeSmsInteractions'](_0x5b2404)[_0x815b('0xd')](function(){for(var _0x29dc62=0x0;_0x29dc62<_0x5b2404[_0x815b('0x43')];_0x29dc62+=0x1){_0x31ab20[_0x815b('0x50')](_0x815b('0x52'),{'SmsInteractionId':Number(_0x5b2404[_0x29dc62]),'UserId':Number(_0x11f1c1['id'])});}});}})['then'](function(){if(_0xe36d21===_0x815b('0x4b')){var _0x156d6c=_[_0x815b('0x18')](_0x11f1c1[_0x815b('0x29')],'id');return _0x11f1c1[_0x815b('0x53')](_0x156d6c)[_0x815b('0xd')](function(){for(var _0x3ba48a=0x0;_0x3ba48a<_0x156d6c[_0x815b('0x43')];_0x3ba48a+=0x1){_0x31ab20[_0x815b('0x50')](_0x815b('0x54'),{'OpenchannelInteractionId':Number(_0x156d6c[_0x3ba48a]),'UserId':Number(_0x11f1c1['id'])});}});}})[_0x815b('0xd')](function(){if(_0xe36d21===_0x815b('0x4b')){var _0x244202=_[_0x815b('0x18')](_0x11f1c1[_0x815b('0x2b')],'id');return _0x11f1c1[_0x815b('0x55')](_0x244202)['then'](function(){for(var _0xa7f471=0x0;_0xa7f471<_0x244202[_0x815b('0x43')];_0xa7f471+=0x1){_0x31ab20['emit'](_0x815b('0x56'),{'WhatsappInteractionId':Number(_0x244202[_0xa7f471]),'UserId':Number(_0x11f1c1['id'])});}});}})[_0x815b('0x57')](function(_0x353598){_0xef3b1d['log'](_0x353598);});}}function onDisconnect(_0x28f860,_0x27ecff){joinOrLeave(_0x28f860,_0x815b('0x4b'),_0x27ecff);}function onConnect(_0x28f0dc){joinOrLeave(_0x28f0dc,'join');}exports['default']=function(_0x27fff5){_0x27fff5['on'](_0x815b('0x58'),function(_0x2e9182){_0x2e9182[_0x815b('0x59')](0x0);_0x2e9182[_0x815b('0x5a')]=_0x2e9182['request'][_0x815b('0x58')][_0x815b('0x5b')]+':'+_0x2e9182[_0x815b('0x5c')][_0x815b('0x58')][_0x815b('0x5d')];_0x2e9182[_0x815b('0x5e')]=new Date();_0x2e9182[_0x815b('0x5f')]=function(_0x1feeff){console['log']('SocketIO\x20'+_0x2e9182[_0x815b('0x60')][_0x815b('0x4')]+'['+_0x2e9182[_0x815b('0x5a')]+']',_0x1feeff);};_0x2e9182['on'](_0x815b('0x61'),function(){onDisconnect(_0x2e9182,_0x27fff5);_0x2e9182[_0x815b('0x5f')](_0x815b('0x62'));});onConnect(_0x2e9182);_0x2e9182[_0x815b('0x5f')](_0x815b('0x63'));});};
\ No newline at end of file
index b65b51f..93631e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c74=['direction','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','QueryTypes','SELECT','contact','UserId','interface','format','SIP/%s','name','incomingmessage','offlineMessage','motionChannel','ContactId','closed','changed','substatus','AfterUpdate','find','fullname','internal','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','../../mysqldb','jayson/promise','../logger','triggers','client','http','ChatInteraction','afterCreate','afterUpdate','closedinteraction','Chat','ChatMessage','newmessage','SmsInteraction','newinteraction','Sms','WhatsappInteraction','Whatsapp','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','Trigger,\x20%s','error','code','catch','get','channel','event'];(function(_0x2021c8,_0x1440de){var _0x3f17b7=function(_0x4bef56){while(--_0x4bef56){_0x2021c8['push'](_0x2021c8['shift']());}};_0x3f17b7(++_0x1440de);}(_0x9c74,0x65));var _0x49c7=function(_0x38c274,_0x3f0678){_0x38c274=_0x38c274-0x0;var _0x2930e2=_0x9c74[_0x38c274];return _0x2930e2;};'use strict';var util=require('util');var db=require(_0x49c7('0x0'))['db'];var jayson=require(_0x49c7('0x1'));var logger=require(_0x49c7('0x2'))(_0x49c7('0x3'));var client=jayson[_0x49c7('0x4')][_0x49c7('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x49c7('0x6'),'event':_0x49c7('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':'Chat','model':_0x49c7('0x6'),'event':_0x49c7('0x8'),'condition':_0x49c7('0x9'),'callback':afterUpdate},{'channel':_0x49c7('0xa'),'model':_0x49c7('0xb'),'event':_0x49c7('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x49c7('0xa'),'model':'ChatOfflineMessage','event':_0x49c7('0x7'),'condition':_0x49c7('0xc'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x49c7('0xd'),'event':_0x49c7('0x7'),'condition':_0x49c7('0xe'),'callback':afterCreate},{'channel':'Sms','model':_0x49c7('0xd'),'event':_0x49c7('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x49c7('0xf'),'model':'SmsMessage','event':_0x49c7('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x49c7('0x10'),'event':_0x49c7('0x7'),'condition':_0x49c7('0xe'),'callback':afterCreate},{'channel':_0x49c7('0x11'),'model':'WhatsappInteraction','event':_0x49c7('0x8'),'condition':_0x49c7('0x9'),'callback':afterUpdate},{'channel':_0x49c7('0x11'),'model':_0x49c7('0x12'),'event':_0x49c7('0x7'),'condition':_0x49c7('0xc'),'callback':afterCreateMessage},{'channel':_0x49c7('0x13'),'model':_0x49c7('0x14'),'event':_0x49c7('0x7'),'condition':_0x49c7('0xe'),'callback':afterCreate},{'channel':'Fax','model':_0x49c7('0x14'),'event':_0x49c7('0x8'),'condition':_0x49c7('0x9'),'callback':afterUpdate},{'channel':_0x49c7('0x13'),'model':_0x49c7('0x15'),'event':_0x49c7('0x7'),'condition':_0x49c7('0xc'),'callback':afterCreateMessage},{'channel':_0x49c7('0x16'),'model':'MailInteraction','event':'afterCreate','condition':_0x49c7('0xe'),'callback':afterCreate},{'channel':'Mail','model':_0x49c7('0x17'),'event':_0x49c7('0x8'),'condition':_0x49c7('0x9'),'callback':afterUpdate},{'channel':_0x49c7('0x16'),'model':'MailMessage','event':_0x49c7('0x7'),'condition':_0x49c7('0xc'),'callback':afterCreateMessage},{'channel':_0x49c7('0x18'),'model':_0x49c7('0x19'),'event':_0x49c7('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':'Openchannel','model':_0x49c7('0x19'),'event':_0x49c7('0x8'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Openchannel','model':_0x49c7('0x1a'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage}];function request(_0x38c2eb){return client[_0x49c7('0x1b')](_0x49c7('0x1c'),_0x38c2eb)[_0x49c7('0x1d')](function(_0x136cea){logger['info'](_0x49c7('0x1e'),_0x49c7('0x1c'),_0x136cea);if(_0x136cea['error']){if(_0x136cea[_0x49c7('0x1f')][_0x49c7('0x20')]===0x1f4){logger['error'](_0x49c7('0x1e'),_0x49c7('0x1c'),_0x136cea['error']);}}})[_0x49c7('0x21')](function(_0x48b96d){logger[_0x49c7('0x1f')](_0x49c7('0x1e'),_0x49c7('0x1c'),_0x48b96d);});}function afterCreateMessage(_0x38f8cb){return function(_0x1ba7fc){_0x1ba7fc=_0x1ba7fc[_0x49c7('0x22')]({'plain':!![]});_0x1ba7fc[_0x49c7('0x23')]=_0x38f8cb;_0x1ba7fc['motionChannel']=_0x38f8cb;_0x1ba7fc[_0x49c7('0x24')]=_0x1ba7fc[_0x49c7('0x25')];Promise['resolve']()['then'](function(){if(typeof _0x1ba7fc['ContactId']===_0x49c7('0x26'))return null;var _0x55c7aa=_0x49c7('0x27')+_0x1ba7fc['ContactId'];return db[_0x49c7('0x28')][_0x49c7('0x29')](_0x55c7aa,{'type':db[_0x49c7('0x2a')][_0x49c7('0x2b')][_0x49c7('0x2c')],'raw':!![]});})[_0x49c7('0x1d')](function(_0x32fdd2){if(_0x32fdd2){_0x1ba7fc[_0x49c7('0x2d')]=_0x32fdd2[0x0];}if(typeof _0x1ba7fc[_0x49c7('0x2e')]===_0x49c7('0x26'))return;return getAgent(_0x1ba7fc[_0x49c7('0x2e')]);})[_0x49c7('0x1d')](function(_0x4ed213){if(_0x4ed213){_0x1ba7fc[_0x49c7('0x2f')]=util[_0x49c7('0x30')](_0x49c7('0x31'),_0x4ed213[_0x49c7('0x32')]);_0x1ba7fc['agent']=_0x4ed213;_0x1ba7fc['channel']=_0x38f8cb;return request({'event':_0x49c7('0x33'),'message':_0x1ba7fc});}else{return request({'event':'outgoingmessage','message':_0x1ba7fc});}})[_0x49c7('0x21')](function(_0x1df197){logger[_0x49c7('0x1f')](_0x49c7('0x1e'),'AfterCreateMessage',_0x1df197);});};}function afterCreateOfflineMessage(_0x504190){return function(_0x5e3f0d){_0x5e3f0d=_0x5e3f0d['get']({'plain':!![]});_0x5e3f0d[_0x49c7('0x23')]=_0x504190;_0x5e3f0d['motionChannel']=_0x504190;_0x5e3f0d[_0x49c7('0x24')]=_0x49c7('0x34');return request({'event':_0x5e3f0d[_0x49c7('0x24')],'message':_0x5e3f0d});};}function afterCreate(_0x1f524f,_0x51ba16){return function(_0x54cef9){_0x54cef9=_0x54cef9[_0x49c7('0x22')]({'plain':!![]});_0x54cef9[_0x49c7('0x23')]=_0x1f524f;_0x54cef9[_0x49c7('0x35')]=_0x1f524f;_0x54cef9[_0x49c7('0x24')]='opened';Promise['resolve']()['then'](function(){var _0x257431=_0x49c7('0x27')+_0x54cef9[_0x49c7('0x36')];return db['sequelize'][_0x49c7('0x29')](_0x257431,{'type':db[_0x49c7('0x2a')][_0x49c7('0x2b')][_0x49c7('0x2c')],'raw':!![]});})[_0x49c7('0x1d')](function(_0xe95dfe){if(_0xe95dfe){_0x54cef9['contact']=_0xe95dfe[0x0];}if(typeof _0x54cef9[_0x49c7('0x2e')]==='undefined')return;return getAgent(_0x54cef9[_0x49c7('0x2e')]);})[_0x49c7('0x1d')](function(_0x4b1aa9){if(_0x4b1aa9){_0x54cef9[_0x49c7('0x2f')]=util[_0x49c7('0x30')](_0x49c7('0x31'),_0x4b1aa9['name']);_0x54cef9['agent']=_0x4b1aa9;}return request({'event':_0x51ba16,'message':_0x54cef9});})[_0x49c7('0x21')](function(_0x1e80c4){logger[_0x49c7('0x1f')](_0x49c7('0x1e'),'AfterCreate',_0x1e80c4);});};}function afterUpdate(_0x1b4085){return function(_0x234cc2){var _0x19b1b1=_0x234cc2['changed']('closed')&&_0x234cc2[_0x49c7('0x37')];var _0x4ddfc6=_0x234cc2[_0x49c7('0x38')](_0x49c7('0x39'));if(_0x19b1b1||_0x4ddfc6){var _0x2581e8=_0x19b1b1?_0x49c7('0x9'):_0x49c7('0x39');var _0x4bb91f=_0x234cc2['get']({'plain':!![]});_0x4bb91f['channel']=_0x1b4085;_0x4bb91f[_0x49c7('0x35')]=_0x1b4085;_0x4bb91f[_0x49c7('0x24')]=_0x19b1b1?_0x49c7('0x37'):_0x49c7('0x39');var _0x51214a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4bb91f[_0x49c7('0x36')];return db['sequelize']['query'](_0x51214a,{'type':db[_0x49c7('0x2a')][_0x49c7('0x2b')][_0x49c7('0x2c')],'raw':!![]})[_0x49c7('0x1d')](function(_0x220238){if(_0x220238){_0x4bb91f[_0x49c7('0x2d')]=_0x220238[0x0];}if(typeof _0x4bb91f[_0x49c7('0x2e')]===_0x49c7('0x26'))return;return getAgent(_0x4bb91f[_0x49c7('0x2e')]);})['then'](function(_0x1f7b28){if(_0x1f7b28){_0x4bb91f[_0x49c7('0x2f')]=util[_0x49c7('0x30')](_0x49c7('0x31'),_0x1f7b28[_0x49c7('0x32')]);_0x4bb91f['agent']=_0x1f7b28;}return request({'event':_0x2581e8,'message':_0x4bb91f});})[_0x49c7('0x21')](function(_0x251a88){logger[_0x49c7('0x1f')](_0x49c7('0x1e'),_0x49c7('0x3a'),_0x251a88);});}};}function getAgent(_0x376741){return db['User'][_0x49c7('0x3b')]({'where':{'id':_0x376741},'attributes':['id',_0x49c7('0x32'),_0x49c7('0x3c'),'email',_0x49c7('0x3d')],'raw':!![]})[_0x49c7('0x1d')](function(_0x5176cb){return _0x5176cb;});}exports['default']=function(){for(var _0x37afd9=0x0;_0x37afd9<triggers[_0x49c7('0x3e')];_0x37afd9+=0x1){if(db[_0x49c7('0x3f')](triggers[_0x37afd9][_0x49c7('0x40')])){db[triggers[_0x37afd9][_0x49c7('0x40')]][_0x49c7('0x41')](triggers[_0x37afd9][_0x49c7('0x24')],triggers[_0x37afd9][_0x49c7('0x42')](triggers[_0x37afd9][_0x49c7('0x23')][_0x49c7('0x43')](),triggers[_0x37afd9][_0x49c7('0x44')]));}}};
\ No newline at end of file
+var _0x8178=['closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','FaxInteraction','Fax','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelMessage','EventManager','then','info','error','Trigger,\x20%s','catch','get','channel','motionChannel','direction','resolve','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','UserId','format','SIP/%s','name','agent','incomingmessage','outgoingmessage','AfterCreateMessage','offlineMessage','opened','QueryTypes','SELECT','AfterCreate','changed','closed','substatus','contact','interface','AfterUpdate','User','find','fullname','email','internal','default','length','hasOwnProperty','model','hook','event','callback','condition','util','../../mysqldb','jayson/promise','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x8178,0x172));var _0x8817=function(_0xb93732,_0x3ad6b9){_0xb93732=_0xb93732-0x0;var _0x1f1316=_0x8178[_0xb93732];return _0x1f1316;};'use strict';var util=require(_0x8817('0x0'));var db=require(_0x8817('0x1'))['db'];var jayson=require(_0x8817('0x2'));var logger=require('../logger')('triggers');var client=jayson[_0x8817('0x3')][_0x8817('0x4')]({'port':0x232a});var triggers=[{'channel':_0x8817('0x5'),'model':_0x8817('0x6'),'event':_0x8817('0x7'),'condition':_0x8817('0x8'),'callback':afterCreate},{'channel':_0x8817('0x5'),'model':'ChatInteraction','event':_0x8817('0x9'),'condition':_0x8817('0xa'),'callback':afterUpdate},{'channel':_0x8817('0x5'),'model':_0x8817('0xb'),'event':_0x8817('0x7'),'condition':_0x8817('0xc'),'callback':afterCreateMessage},{'channel':_0x8817('0x5'),'model':_0x8817('0xd'),'event':'afterCreate','condition':_0x8817('0xc'),'callback':afterCreateOfflineMessage},{'channel':_0x8817('0xe'),'model':_0x8817('0xf'),'event':_0x8817('0x7'),'condition':_0x8817('0x8'),'callback':afterCreate},{'channel':_0x8817('0xe'),'model':_0x8817('0xf'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x8817('0xe'),'model':_0x8817('0x10'),'event':_0x8817('0x7'),'condition':_0x8817('0xc'),'callback':afterCreateMessage},{'channel':_0x8817('0x11'),'model':_0x8817('0x12'),'event':'afterCreate','condition':_0x8817('0x8'),'callback':afterCreate},{'channel':_0x8817('0x11'),'model':_0x8817('0x12'),'event':_0x8817('0x9'),'condition':_0x8817('0xa'),'callback':afterUpdate},{'channel':_0x8817('0x11'),'model':_0x8817('0x13'),'event':_0x8817('0x7'),'condition':_0x8817('0xc'),'callback':afterCreateMessage},{'channel':'Fax','model':_0x8817('0x14'),'event':_0x8817('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x8817('0x15'),'model':'FaxInteraction','event':_0x8817('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x8817('0x15'),'model':_0x8817('0x16'),'event':_0x8817('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x8817('0x17'),'model':_0x8817('0x18'),'event':_0x8817('0x7'),'condition':_0x8817('0x8'),'callback':afterCreate},{'channel':_0x8817('0x17'),'model':_0x8817('0x18'),'event':'afterUpdate','condition':_0x8817('0xa'),'callback':afterUpdate},{'channel':_0x8817('0x17'),'model':_0x8817('0x19'),'event':_0x8817('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x8817('0x1a'),'model':'OpenchannelInteraction','event':_0x8817('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x8817('0x1a'),'model':'OpenchannelInteraction','event':'afterUpdate','condition':_0x8817('0xa'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x8817('0x1b'),'event':_0x8817('0x7'),'condition':_0x8817('0xc'),'callback':afterCreateMessage}];function request(_0x4152e9){return client['request'](_0x8817('0x1c'),_0x4152e9)[_0x8817('0x1d')](function(_0x1af16d){logger[_0x8817('0x1e')]('Trigger,\x20%s',_0x8817('0x1c'),_0x1af16d);if(_0x1af16d['error']){if(_0x1af16d[_0x8817('0x1f')]['code']===0x1f4){logger[_0x8817('0x1f')](_0x8817('0x20'),_0x8817('0x1c'),_0x1af16d['error']);}}})[_0x8817('0x21')](function(_0x576641){logger[_0x8817('0x1f')](_0x8817('0x20'),_0x8817('0x1c'),_0x576641);});}function afterCreateMessage(_0x9dc1db){return function(_0x35c289){_0x35c289=_0x35c289[_0x8817('0x22')]({'plain':!![]});_0x35c289[_0x8817('0x23')]=_0x9dc1db;_0x35c289[_0x8817('0x24')]=_0x9dc1db;_0x35c289['event']=_0x35c289[_0x8817('0x25')];Promise[_0x8817('0x26')]()[_0x8817('0x1d')](function(){if(typeof _0x35c289['ContactId']===_0x8817('0x27'))return null;var _0xd90e02=_0x8817('0x28')+_0x35c289[_0x8817('0x29')];return db[_0x8817('0x2a')][_0x8817('0x2b')](_0xd90e02,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]});})['then'](function(_0x5e1e7f){if(_0x5e1e7f){_0x35c289['contact']=_0x5e1e7f[0x0];}if(typeof _0x35c289['UserId']===_0x8817('0x27'))return;return getAgent(_0x35c289[_0x8817('0x2c')]);})[_0x8817('0x1d')](function(_0x5a922d){if(_0x5a922d){_0x35c289['interface']=util[_0x8817('0x2d')](_0x8817('0x2e'),_0x5a922d[_0x8817('0x2f')]);_0x35c289[_0x8817('0x30')]=_0x5a922d;_0x35c289['channel']=_0x9dc1db;return request({'event':_0x8817('0x31'),'message':_0x35c289});}else{return request({'event':_0x8817('0x32'),'message':_0x35c289});}})['catch'](function(_0x667a8f){logger[_0x8817('0x1f')](_0x8817('0x20'),_0x8817('0x33'),_0x667a8f);});};}function afterCreateOfflineMessage(_0x4f4970){return function(_0x35610a){_0x35610a=_0x35610a[_0x8817('0x22')]({'plain':!![]});_0x35610a[_0x8817('0x23')]=_0x4f4970;_0x35610a[_0x8817('0x24')]=_0x4f4970;_0x35610a['event']=_0x8817('0x34');return request({'event':_0x35610a['event'],'message':_0x35610a});};}function afterCreate(_0x3ee912,_0x21a25c){return function(_0xfb4fc4){_0xfb4fc4=_0xfb4fc4[_0x8817('0x22')]({'plain':!![]});_0xfb4fc4[_0x8817('0x23')]=_0x3ee912;_0xfb4fc4[_0x8817('0x24')]=_0x3ee912;_0xfb4fc4['event']=_0x8817('0x35');Promise[_0x8817('0x26')]()['then'](function(){var _0x422187=_0x8817('0x28')+_0xfb4fc4[_0x8817('0x29')];return db[_0x8817('0x2a')][_0x8817('0x2b')](_0x422187,{'type':db['Sequelize'][_0x8817('0x36')][_0x8817('0x37')],'raw':!![]});})[_0x8817('0x1d')](function(_0x4e3e83){if(_0x4e3e83){_0xfb4fc4['contact']=_0x4e3e83[0x0];}if(typeof _0xfb4fc4[_0x8817('0x2c')]===_0x8817('0x27'))return;return getAgent(_0xfb4fc4[_0x8817('0x2c')]);})['then'](function(_0x307ce5){if(_0x307ce5){_0xfb4fc4['interface']=util[_0x8817('0x2d')]('SIP/%s',_0x307ce5['name']);_0xfb4fc4['agent']=_0x307ce5;}return request({'event':_0x21a25c,'message':_0xfb4fc4});})[_0x8817('0x21')](function(_0x1708ed){logger[_0x8817('0x1f')](_0x8817('0x20'),_0x8817('0x38'),_0x1708ed);});};}function afterUpdate(_0x579a7c){return function(_0x4cf788){var _0x4b6293=_0x4cf788[_0x8817('0x39')](_0x8817('0x3a'))&&_0x4cf788[_0x8817('0x3a')];var _0x36ddd8=_0x4cf788[_0x8817('0x39')]('substatus');if(_0x4b6293||_0x36ddd8){var _0x1568ee=_0x4b6293?'closedinteraction':_0x8817('0x3b');var _0xe4295d=_0x4cf788[_0x8817('0x22')]({'plain':!![]});_0xe4295d['channel']=_0x579a7c;_0xe4295d[_0x8817('0x24')]=_0x579a7c;_0xe4295d['event']=_0x4b6293?_0x8817('0x3a'):_0x8817('0x3b');var _0x112331=_0x8817('0x28')+_0xe4295d['ContactId'];return db[_0x8817('0x2a')][_0x8817('0x2b')](_0x112331,{'type':db['Sequelize'][_0x8817('0x36')]['SELECT'],'raw':!![]})[_0x8817('0x1d')](function(_0x39e9df){if(_0x39e9df){_0xe4295d[_0x8817('0x3c')]=_0x39e9df[0x0];}if(typeof _0xe4295d[_0x8817('0x2c')]==='undefined')return;return getAgent(_0xe4295d['UserId']);})[_0x8817('0x1d')](function(_0x50139e){if(_0x50139e){_0xe4295d[_0x8817('0x3d')]=util['format']('SIP/%s',_0x50139e[_0x8817('0x2f')]);_0xe4295d['agent']=_0x50139e;}return request({'event':_0x1568ee,'message':_0xe4295d});})['catch'](function(_0x505238){logger['error']('Trigger,\x20%s',_0x8817('0x3e'),_0x505238);});}};}function getAgent(_0x4cfbb1){return db[_0x8817('0x3f')][_0x8817('0x40')]({'where':{'id':_0x4cfbb1},'attributes':['id',_0x8817('0x2f'),_0x8817('0x41'),_0x8817('0x42'),_0x8817('0x43')],'raw':!![]})['then'](function(_0x2b733e){return _0x2b733e;});}exports[_0x8817('0x44')]=function(){for(var _0x142859=0x0;_0x142859<triggers[_0x8817('0x45')];_0x142859+=0x1){if(db[_0x8817('0x46')](triggers[_0x142859][_0x8817('0x47')])){db[triggers[_0x142859][_0x8817('0x47')]][_0x8817('0x48')](triggers[_0x142859][_0x8817('0x49')],triggers[_0x142859][_0x8817('0x4a')](triggers[_0x142859]['channel']['toLowerCase'](),triggers[_0x142859][_0x8817('0x4b')]));}}};
\ No newline at end of file
index 0cbdb90..a24a007 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1580=['bluebird','../mysqldb','./license/util','voice','mail','fax','sms','whatsapp','openchannel','getChannels','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','role','agent','User','count','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash'];(function(_0x5bc5ab,_0xcd8512){var _0x36ddc5=function(_0x3923b0){while(--_0x3923b0){_0x5bc5ab['push'](_0x5bc5ab['shift']());}};_0x36ddc5(++_0xcd8512);}(_0x1580,0xe0));var _0x0158=function(_0x973d0f,_0x591136){_0x973d0f=_0x973d0f-0x0;var _0x5d308f=_0x1580[_0x973d0f];return _0x5d308f;};'use strict';var _=require(_0x0158('0x0'));var BPromise=require(_0x0158('0x1'));var db=require(_0x0158('0x2'))['db'];var util=require(_0x0158('0x3'));var channels=[_0x0158('0x4'),_0x0158('0x5'),'chat',_0x0158('0x6'),_0x0158('0x7'),_0x0158('0x8'),_0x0158('0x9')];exports[_0x0158('0xa')]=function(){return channels;};exports['isValidChannel']=function(_0x2f06ea){_0x2f06ea=_0x2f06ea[_0x0158('0xb')]();return _[_0x0158('0xc')](channels,_0x2f06ea);};exports[_0x0158('0xd')]=function(_0x40ecd9,_0x17892a,_0x266f26,_0xd54f8c){var _0x37d8a8={'loginAttempts':_0x17892a,'blocked':_0x266f26};if(!_[_0x0158('0xe')](_0xd54f8c)){_0x37d8a8[_0x0158('0xf')]=_0xd54f8c;}return _0x40ecd9['updateAttributes'](_0x37d8a8);};exports['getLicense']=function(_0x2b03cf){return new BPromise(function(_0x4ac4e8,_0xfec7c6){var _0x7a5dd3=0x0;if(_0x2b03cf[_0x0158('0x10')]!==_0x0158('0x11')){_0x4ac4e8(_0x2b03cf);}db[_0x0158('0x12')][_0x0158('0x13')]({'where':{'role':_0x0158('0x11'),'online':!![],'id':{'$ne':_0x2b03cf['id']}}})[_0x0158('0x14')](function(_0x9d2517){_0x7a5dd3=_0x9d2517;return util[_0x0158('0x15')]();})[_0x0158('0x14')](function(_0x97d9c8){if(_0x97d9c8&&_0x97d9c8[_0x0158('0x16')]&&_0x7a5dd3>=_0x97d9c8['agents']){throw Error(_0x0158('0x17'));}_0x4ac4e8(_0x2b03cf);})[_0x0158('0x18')](function(_0x22c06f){_0xfec7c6(_0x22c06f);});});};
\ No newline at end of file
+var _0xc89e=['then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','./license/util','voice','mail','chat','fax','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','blockedAt','updateAttributes','getLicense','role','agent','User','count'];(function(_0x28952f,_0x1e541f){var _0x8493b1=function(_0x95e7a9){while(--_0x95e7a9){_0x28952f['push'](_0x28952f['shift']());}};_0x8493b1(++_0x1e541f);}(_0xc89e,0x149));var _0xec89=function(_0x3c14d2,_0x38515b){_0x3c14d2=_0x3c14d2-0x0;var _0x3247dd=_0xc89e[_0x3c14d2];return _0x3247dd;};'use strict';var _=require(_0xec89('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require(_0xec89('0x1'));var channels=[_0xec89('0x2'),_0xec89('0x3'),_0xec89('0x4'),_0xec89('0x5'),_0xec89('0x6'),_0xec89('0x7'),_0xec89('0x8')];exports[_0xec89('0x9')]=function(){return channels;};exports[_0xec89('0xa')]=function(_0x3e8391){_0x3e8391=_0x3e8391[_0xec89('0xb')]();return _[_0xec89('0xc')](channels,_0x3e8391);};exports[_0xec89('0xd')]=function(_0x353419,_0x224d20,_0x2f3137,_0x4047cf){var _0x275146={'loginAttempts':_0x224d20,'blocked':_0x2f3137};if(!_['isUndefined'](_0x4047cf)){_0x275146[_0xec89('0xe')]=_0x4047cf;}return _0x353419[_0xec89('0xf')](_0x275146);};exports[_0xec89('0x10')]=function(_0x5cdb24){return new BPromise(function(_0x1436c4,_0x324889){var _0x233a1b=0x0;if(_0x5cdb24[_0xec89('0x11')]!==_0xec89('0x12')){_0x1436c4(_0x5cdb24);}db[_0xec89('0x13')][_0xec89('0x14')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x5cdb24['id']}}})[_0xec89('0x15')](function(_0x2d9cbc){_0x233a1b=_0x2d9cbc;return util['getLicense']();})[_0xec89('0x15')](function(_0x46d129){if(_0x46d129&&_0x46d129[_0xec89('0x16')]&&_0x233a1b>=_0x46d129['agents']){throw Error(_0xec89('0x17'));}_0x1436c4(_0x5cdb24);})[_0xec89('0x18')](function(_0x2a3d8d){_0x324889(_0x2a3d8d);});});};
\ No newline at end of file
index 6733a41..9af2ebc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x153f=['inherits','Forbidden','OutOfInterval','error','status','send','exports','util','../config/logger','api','message','Internal\x20Server\x20Error','Error','Bad\x20Request','name','Entity\x20not\x20found','Not\x20Found'];(function(_0xa2aecc,_0x5c326b){var _0x6992fc=function(_0x204673){while(--_0x204673){_0xa2aecc['push'](_0xa2aecc['shift']());}};_0x6992fc(++_0x5c326b);}(_0x153f,0x15b));var _0xf153=function(_0x1f2bc5,_0x3ed586){_0x1f2bc5=_0x1f2bc5-0x0;var _0x4b30ea=_0x153f[_0x1f2bc5];return _0x4b30ea;};'use strict';var util=require(_0xf153('0x0'));var logger=require(_0xf153('0x1'))(_0xf153('0x2'));var APIError=function(_0x44cea3,_0x2afb9a){this[_0xf153('0x3')]=_0x44cea3||_0xf153('0x4');this['name']=_0x2afb9a||_0xf153('0x5');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x1f9ead){this[_0xf153('0x3')]=_0x1f9ead||_0xf153('0x6');this[_0xf153('0x7')]=_0xf153('0x6');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x17ba96){this[_0xf153('0x3')]=_0x17ba96||_0xf153('0x8');this[_0xf153('0x7')]=_0xf153('0x9');util[_0xf153('0xa')](APINotFoundError,APIError);};function getStatusCode(_0x44845c){switch(_0x44845c){case _0xf153('0x6'):return 0x190;case _0xf153('0xb'),_0xf153('0xc'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x2b76eb){return function(_0x1c8de7){logger[_0xf153('0xd')](_0x1c8de7['stack']);var _0x3a8838=getStatusCode(_0x1c8de7[_0xf153('0x7')]);if(_0x1c8de7[_0xf153('0x7')])delete _0x1c8de7[_0xf153('0x7')];return _0x2b76eb[_0xf153('0xe')](_0x3a8838)[_0xf153('0xf')](_0x1c8de7);};}module[_0xf153('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file
+var _0xdace=['send','exports','util','api','Internal\x20Server\x20Error','name','Error','inherits','message','Bad\x20Request','Not\x20Found','Forbidden','OutOfInterval','error','status'];(function(_0x11162d,_0x3c7e4f){var _0x5f4aeb=function(_0x25dc99){while(--_0x25dc99){_0x11162d['push'](_0x11162d['shift']());}};_0x5f4aeb(++_0x3c7e4f);}(_0xdace,0xc5));var _0xedac=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xdace[_0x465028];return _0xb783d4;};'use strict';var util=require(_0xedac('0x0'));var logger=require('../config/logger')(_0xedac('0x1'));var APIError=function(_0x13adb5,_0x46eba0){this['message']=_0x13adb5||_0xedac('0x2');this[_0xedac('0x3')]=_0x46eba0||_0xedac('0x4');util[_0xedac('0x5')](APIError,Error);};var APIBadRequestError=function(_0x5a97c0){this[_0xedac('0x6')]=_0x5a97c0||_0xedac('0x7');this[_0xedac('0x3')]='Bad\x20Request';util[_0xedac('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x21440e){this[_0xedac('0x6')]=_0x21440e||'Entity\x20not\x20found';this[_0xedac('0x3')]=_0xedac('0x8');util[_0xedac('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x4af030){switch(_0x4af030){case'Bad\x20Request':return 0x190;case _0xedac('0x9'),_0xedac('0xa'):return 0x193;case'Not\x20Found':return 0x194;default:return 0x1f4;}}function handleError(_0x4d6a29){return function(_0x4db2ad){logger[_0xedac('0xb')](_0x4db2ad['stack']);var _0x261401=getStatusCode(_0x4db2ad['name']);if(_0x4db2ad[_0xedac('0x3')])delete _0x4db2ad[_0xedac('0x3')];return _0x4d6a29[_0xedac('0xc')](_0x261401)[_0xedac('0xd')](_0x4db2ad);};}module[_0xedac('0xe')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file
index 02d7e5c..d2fee10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x637b=['status','json','send','exports'];(function(_0x167b10,_0x5999f0){var _0x2d9cc3=function(_0xe7473e){while(--_0xe7473e){_0x167b10['push'](_0x167b10['shift']());}};_0x2d9cc3(++_0x5999f0);}(_0x637b,0x133));var _0xb637=function(_0x1ea5f1,_0x4b4765){_0x1ea5f1=_0x1ea5f1-0x0;var _0x5b0a7a=_0x637b[_0x1ea5f1];return _0x5b0a7a;};'use strict';module[_0xb637('0x0')][0x194]=function pageNotFound(_0x4d71a1,_0x22f97d){var _0x5adef5='404';var _0x430ad5=0x194;var _0xc9417f={'status':_0x430ad5};_0x22f97d[_0xb637('0x1')](_0xc9417f['status']);_0x22f97d['render'](_0x5adef5,{},function(_0xa26207,_0x134e57){if(_0xa26207){return _0x22f97d[_0xb637('0x1')](_0xc9417f[_0xb637('0x1')])[_0xb637('0x2')](_0xc9417f);}_0x22f97d[_0xb637('0x3')](_0x134e57);});};
\ No newline at end of file
+var _0x6802=['render','json','send','exports','404','status'];(function(_0x57f5c1,_0x324985){var _0x1f2f4a=function(_0x4fd537){while(--_0x4fd537){_0x57f5c1['push'](_0x57f5c1['shift']());}};_0x1f2f4a(++_0x324985);}(_0x6802,0x123));var _0x2680=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6802[_0x3bf83f];return _0x22c4a9;};'use strict';module[_0x2680('0x0')][0x194]=function pageNotFound(_0xde4a7f,_0x43116e){var _0x4e5bc1=_0x2680('0x1');var _0x3f50aa=0x194;var _0x2dbe34={'status':_0x3f50aa};_0x43116e[_0x2680('0x2')](_0x2dbe34['status']);_0x43116e[_0x2680('0x3')](_0x4e5bc1,{},function(_0x20becf,_0x43aa25){if(_0x20becf){return _0x43116e[_0x2680('0x2')](_0x2dbe34['status'])[_0x2680('0x4')](_0x2dbe34);}_0x43116e[_0x2680('0x5')](_0x43aa25);});};
\ No newline at end of file
index 6a7670a..db6d031 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc88=['../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/contactItemType/contactItemType.model','CmContactHasItem','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptySessionReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','../api/setting/setting.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','userSetting','UserId','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','Extensions','HopperHistory','OpenchannelInteractions','SmsInteractions','MailInteraction','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','MailInteractions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_whatsapp_interactions','VoiceQueues','UserVoiceQueue','MailQueues','ChatQueues','UserChatQueue','SmsQueues','OpenchannelQueue','UserOpenchannelQueue','UserWhatsappQueue','ChatWebsite','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','mailboxuser','mailbox','VoiceCallReport','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Interactions','MailApplication','TemplateId','user_has_mail_accounts','team_has_mail_queues','Messages','MailInteractionId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','Account','ChatWebsiteId','IntervalId','TagId','ListId','Dashboard','Dispositions','FaxAccountId','Answers','Exntensions','List','FaxMessage','fax_interaction_has_tags','AttachmentId','FaxQueueReport','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','ProactiveActions','Agent','Queue','ChatInteractionId','ChatOfflineMessageId','ChatQueue','team_has_chat_queues','ChatGroupId','Website','CompanyId','Phones','CmContactId','FaxInteractions','Company','AdditionalPhones','CampaignId','Automation','Condition','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','chat_interaction_has_tags','whatsapp_interaction_has_tags','ContactItemType','ItemType','ItemTypeId','Hopper','CmHopperId','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','AnalyticMetric','MetricId','Configurations','AccountId','Subjects','Descriptions','FieldId','Subject','DescriptionId','Variable','VariableId','Description','Field','SubjectId','int_desk_configuration_has_tags','FreshdeskAccount','int_freshdesk_configuration_has_tags','VtigerAccount','ToId','SessionId','SmsQueueReport','ProjectId','JscriptyQuestionReport','JscriptyAnswerReport','user_has_square_projects','FaxQueues','team_has_openchannel_queues','OpenchannelQueues','team_has_whatsapp_queues','VoicePrefixes','SquareProjectId','campaigns_has_cm_lists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToAccount','FromAccount','ToChatQueueId','ToQueue','ToChatWebsiteId','FromFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','voice_queues_has_cm_lists','UserProfileSections','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','UserSetting','user','exports','sequelize','jstz','determine','defaultsDeep','motion2','xcall','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','xC@LL1234','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailMessage','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc88,0x19f));var _0x8fc8=function(_0x2bc5ae,_0x102b2a){_0x2bc5ae=_0x2bc5ae-0x0;var _0x2e19ac=_0xfc88[_0x2bc5ae];return _0x2e19ac;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x8fc8('0x0'));var _=require('lodash');var jstz=require(_0x8fc8('0x1'));var timezone=jstz[_0x8fc8('0x2')]();config[_0x8fc8('0x0')]=_[_0x8fc8('0x3')](config['sequelize'],{'database':_0x8fc8('0x4'),'username':_0x8fc8('0x5'),'password':'xC@LL1234','options':{'host':_0x8fc8('0x6'),'port':0xcea,'dialect':_0x8fc8('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x8fc8('0x8')](),'define':{'charset':_0x8fc8('0x9'),'collate':_0x8fc8('0xa')}}});config[_0x8fc8('0xb')]=_[_0x8fc8('0x3')](config[_0x8fc8('0xb')],{'database':'motion2','username':_0x8fc8('0x5'),'password':_0x8fc8('0xc'),'options':{'host':_0x8fc8('0x6'),'port':0xcea,'dialect':_0x8fc8('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x8fc8('0x8')](),'define':{'charset':_0x8fc8('0x9'),'collate':_0x8fc8('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8fc8('0x0')][_0x8fc8('0xd')],config[_0x8fc8('0x0')][_0x8fc8('0xe')],config[_0x8fc8('0x0')][_0x8fc8('0xf')],config[_0x8fc8('0x0')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8fc8('0xb')]['database'],config[_0x8fc8('0xb')][_0x8fc8('0xe')],config[_0x8fc8('0xb')][_0x8fc8('0xf')],config['sequelizeHistory'][_0x8fc8('0x10')])};db[_0x8fc8('0x11')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x13'));db[_0x8fc8('0x14')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x8fc8('0x15')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0x16'));db['VoiceExtension']=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/voiceExtension/voiceExtension.model');db[_0x8fc8('0x17')]=db['sequelize']['import'](_0x8fc8('0x18'));db[_0x8fc8('0x19')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x1a'));db[_0x8fc8('0x1b')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x1c'));db[_0x8fc8('0x1d')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x1e'));db[_0x8fc8('0x1f')]=db[_0x8fc8('0x0')]['import']('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x20'));db['VoiceCallReport']=db['sequelize']['import']('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0x21'));db[_0x8fc8('0x22')]=db[_0x8fc8('0x0')]['import'](_0x8fc8('0x23'));db['VoiceQueueReport']=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x8fc8('0x24')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x25'));db[_0x8fc8('0x26')]=db[_0x8fc8('0x0')]['import'](_0x8fc8('0x27'));db[_0x8fc8('0x28')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x29'));db[_0x8fc8('0x2a')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db['UserVoiceQueue']=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x2b'));db['UserChatQueue']=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0x2c'));db[_0x8fc8('0x2d')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0x2e'));db[_0x8fc8('0x2f')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/userFaxQueue/userFaxQueue.model');db[_0x8fc8('0x30')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x31'));db['UserOpenchannelQueue']=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x32'));db['UserWhatsappQueue']=db[_0x8fc8('0x0')]['import'](_0x8fc8('0x33'));db[_0x8fc8('0x34')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0x35'));db[_0x8fc8('0x36')]=db[_0x8fc8('0x0')]['import'](_0x8fc8('0x37'));db[_0x8fc8('0x38')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/mailAccount/mailAccount.model');db[_0x8fc8('0x39')]=db[_0x8fc8('0x0')]['import'](_0x8fc8('0x3a'));db['MailSubstatus']=db[_0x8fc8('0x0')]['import'](_0x8fc8('0x3b'));db['MailInteraction']=db[_0x8fc8('0x0')]['import']('../api/mailInteraction/mailInteraction.model');db[_0x8fc8('0x3c')]=db[_0x8fc8('0x0')]['import']('../api/mailMessage/mailMessage.model');db['MailApplication']=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x3d'));db[_0x8fc8('0x3e')]=db[_0x8fc8('0x0')]['import'](_0x8fc8('0x3f'));db['Dashboard']=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/dashboard/dashboard.model');db[_0x8fc8('0x40')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x41'));db[_0x8fc8('0x42')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x43'));db[_0x8fc8('0x44')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x45'));db[_0x8fc8('0x46')]=db[_0x8fc8('0x0')]['import'](_0x8fc8('0x47'));db['FaxMessage']=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/faxMessage/faxMessage.model');db[_0x8fc8('0x48')]=db[_0x8fc8('0x0')]['import'](_0x8fc8('0x49'));db['FaxQueueReport']=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0x4a'));db[_0x8fc8('0x4b')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x4c'));db[_0x8fc8('0x4d')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x4e'));db[_0x8fc8('0x4f')]=db[_0x8fc8('0x0')]['import']('../api/smsInteraction/smsInteraction.model');db[_0x8fc8('0x50')]=db['sequelize'][_0x8fc8('0x12')]('../api/smsMessage/smsMessage.model');db[_0x8fc8('0x51')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x52'));db[_0x8fc8('0x53')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0x54'));db[_0x8fc8('0x55')]=db[_0x8fc8('0x0')]['import'](_0x8fc8('0x56'));db[_0x8fc8('0x57')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0x58'));db[_0x8fc8('0x59')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0x5a'));db['OpenchannelQueue']=db[_0x8fc8('0x0')]['import'](_0x8fc8('0x5b'));db['ChatWebsite']=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x5c'));db[_0x8fc8('0x5d')]=db['sequelize'][_0x8fc8('0x12')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x8fc8('0x5e')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/chatApplication/chatApplication.model');db[_0x8fc8('0x5f')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/chatInteraction/chatInteraction.model');db[_0x8fc8('0x60')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0x61'));db[_0x8fc8('0x62')]=db['sequelize'][_0x8fc8('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db['ChatQueue']=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x63'));db[_0x8fc8('0x64')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0x65'));db[_0x8fc8('0x66')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x8fc8('0x67')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0x68'));db[_0x8fc8('0x69')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x6a'));db[_0x8fc8('0x6b')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x6c'));db[_0x8fc8('0x6d')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x8fc8('0x6e')]=db[_0x8fc8('0x0')]['import'](_0x8fc8('0x6f'));db[_0x8fc8('0x70')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x8fc8('0x71')]=db['sequelize']['import'](_0x8fc8('0x72'));db[_0x8fc8('0x73')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/cmCustomField/cmCustomField.model');db[_0x8fc8('0x74')]=db[_0x8fc8('0x0')]['import'](_0x8fc8('0x75'));db['Automation']=db[_0x8fc8('0x0')]['import']('../api/automation/automation.model');db[_0x8fc8('0x76')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x77'));db[_0x8fc8('0x78')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x79'));db['Condition']=db[_0x8fc8('0x0')]['import']('../api/condition/condition.model');db[_0x8fc8('0x7a')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0x7b'));db[_0x8fc8('0x7c')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x7d'));db['Cdr']=db['sequelize']['import'](_0x8fc8('0x7e'));db[_0x8fc8('0x7f')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0x80'));db[_0x8fc8('0x81')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0x82'));db[_0x8fc8('0x83')]=db[_0x8fc8('0x0')]['import'](_0x8fc8('0x84'));db[_0x8fc8('0x85')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x86'));db['ContactItemType']=db[_0x8fc8('0x0')]['import'](_0x8fc8('0x87'));db[_0x8fc8('0x88')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/cmContactHasItem/cmContactHasItem.model');db[_0x8fc8('0x89')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x8a'));db[_0x8fc8('0x8b')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x8c'));db[_0x8fc8('0x8d')]=db[_0x8fc8('0x0')]['import'](_0x8fc8('0x8e'));db['Variable']=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x8f'));db[_0x8fc8('0x90')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x91'));db[_0x8fc8('0x92')]=db['sequelize']['import'](_0x8fc8('0x93'));db[_0x8fc8('0x94')]=db['sequelize'][_0x8fc8('0x12')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x8fc8('0x95')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x8fc8('0x96')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x97'));db['AnalyticMetric']=db[_0x8fc8('0x0')]['import'](_0x8fc8('0x98'));db[_0x8fc8('0x99')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x9a'));db['AnalyticTreeReport']=db[_0x8fc8('0x0')]['import']('../api/analyticTreeReport/analyticTreeReport.model');db[_0x8fc8('0x9b')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0x9c'));db[_0x8fc8('0x9d')]=db[_0x8fc8('0x0')]['import'](_0x8fc8('0x9e'));db[_0x8fc8('0x9f')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xa0'));db[_0x8fc8('0xa1')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xa2'));db[_0x8fc8('0xa3')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xa4'));db[_0x8fc8('0xa5')]=db['sequelize']['import'](_0x8fc8('0xa6'));db[_0x8fc8('0xa7')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/intDeskAccount/intDeskAccount.model');db[_0x8fc8('0xa8')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xa9'));db[_0x8fc8('0xaa')]=db['sequelize']['import'](_0x8fc8('0xab'));db[_0x8fc8('0xac')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xad'));db[_0x8fc8('0xae')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0xaf'));db[_0x8fc8('0xb0')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xb1'));db[_0x8fc8('0xb2')]=db[_0x8fc8('0x0')]['import'](_0x8fc8('0xb3'));db[_0x8fc8('0xb4')]=db['sequelize'][_0x8fc8('0x12')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x8fc8('0xb5')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xb6'));db[_0x8fc8('0xb7')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xb8'));db[_0x8fc8('0xb9')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xba'));db['VtigerAccount']=db[_0x8fc8('0x0')]['import']('../api/intVtigerAccount/intVtigerAccount.model');db[_0x8fc8('0xbb')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xbc'));db[_0x8fc8('0xbd')]=db[_0x8fc8('0x0')]['import'](_0x8fc8('0xbe'));db[_0x8fc8('0xbf')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xc0'));db[_0x8fc8('0xc1')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xc2'));db[_0x8fc8('0xc3')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xc4'));db[_0x8fc8('0xc5')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0xc6'));db[_0x8fc8('0xc7')]=db[_0x8fc8('0x0')]['import'](_0x8fc8('0xc8'));db[_0x8fc8('0xc9')]=db[_0x8fc8('0x0')]['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0x8fc8('0xca')]=db['sequelize']['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x8fc8('0xcb')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xcc'));db[_0x8fc8('0xcd')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0xce'));db['Integration']=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x91'));db[_0x8fc8('0xcf')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0xd0'));db[_0x8fc8('0xd1')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/chatQueueReport/chatQueueReport.model');db[_0x8fc8('0xd2')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xd3'));db['JscriptyAnswerReport']=db['sequelize']['import'](_0x8fc8('0xd4'));db['JscriptyQuestionReport']=db['sequelize'][_0x8fc8('0x12')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x8fc8('0xd5')]=db['sequelize']['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0x8fc8('0x0')]['import']('../api/smsQueueReport/smsQueueReport.model');db['SquareReport']=db[_0x8fc8('0x0')]['import']('../api/squareReport/squareReport.model');db[_0x8fc8('0xd6')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xd7'));db[_0x8fc8('0xd8')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xd9'));db['Setting']=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0xda'));db['SquareOdbc']=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/squareOdbc/squareOdbc.model');db[_0x8fc8('0xdb')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xdc'));db[_0x8fc8('0xdd')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0xde'));db['SquareMessage']=db[_0x8fc8('0x0')]['import']('../api/squareMessage/squareMessage.model');db[_0x8fc8('0xdf')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xe0'));db[_0x8fc8('0xe1')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xe2'));db[_0x8fc8('0xe3')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xe4'));db[_0x8fc8('0xe5')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0xe6'));db[_0x8fc8('0xe7')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xe8'));db[_0x8fc8('0xe9')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xea'));db[_0x8fc8('0xeb')]=db[_0x8fc8('0x0')]['import'](_0x8fc8('0xec'));db[_0x8fc8('0xed')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0xee'));db[_0x8fc8('0xef')]=db['sequelize']['import'](_0x8fc8('0xf0'));db[_0x8fc8('0xf1')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xf2'));db['SmsTransferReport']=db['sequelize'][_0x8fc8('0x12')]('../api/smsTransferReport/smsTransferReport.model');db[_0x8fc8('0xf3')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0xf4'));db[_0x8fc8('0xf5')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xf6'));db[_0x8fc8('0xf7')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xf8'));db[_0x8fc8('0xf9')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xfa'));db[_0x8fc8('0xfb')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xfc'));db['UserNotification']=db[_0x8fc8('0x0')]['import'](_0x8fc8('0xfd'));db['WhatsappAccount']=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0xfe'));db['WhatsappApplication']=db[_0x8fc8('0x0')]['import'](_0x8fc8('0xff'));db[_0x8fc8('0x100')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0x101'));db[_0x8fc8('0x102')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x103'));db[_0x8fc8('0x104')]=db['sequelize'][_0x8fc8('0x12')](_0x8fc8('0x105'));db[_0x8fc8('0x106')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x107'));db[_0x8fc8('0x108')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x109'));db[_0x8fc8('0x10a')]=db['sequelize'][_0x8fc8('0x12')]('../api/cloudProvider/cloudProvider.model');db['TeamVoiceQueue']=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x10b'));db[_0x8fc8('0x10c')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x10d'));db[_0x8fc8('0x10e')]=db[_0x8fc8('0x0')][_0x8fc8('0x12')](_0x8fc8('0x10f'));db['UserSetting']=db[_0x8fc8('0x0')][_0x8fc8('0x12')]('../api/user-setting/user-setting.model');db['User'][_0x8fc8('0x110')](db[_0x8fc8('0x1f')],{'as':_0x8fc8('0x1f'),'onDelete':_0x8fc8('0x111'),'foreignKey':'UserId'});db[_0x8fc8('0x11')]['hasOne'](db['UserSetting'],{'as':_0x8fc8('0x112'),'onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x113')});db[_0x8fc8('0x11')][_0x8fc8('0x114')](db[_0x8fc8('0x1b')],{'as':_0x8fc8('0x115'),'foreignKey':_0x8fc8('0x113')});db[_0x8fc8('0x11')][_0x8fc8('0x114')](db['UserVoiceQueueRt'],{'as':_0x8fc8('0x116'),'foreignKey':_0x8fc8('0x113')});db[_0x8fc8('0x11')][_0x8fc8('0x114')](db[_0x8fc8('0x117')],{'as':_0x8fc8('0x118'),'onDelete':_0x8fc8('0x111'),'hooks':!![]});db[_0x8fc8('0x11')][_0x8fc8('0x114')](db[_0x8fc8('0x6e')],{'as':'HopperFinals','foreignKey':'UserId'});db[_0x8fc8('0x11')][_0x8fc8('0x114')](db['CmHopperHistory'],{'as':_0x8fc8('0x119'),'foreignKey':_0x8fc8('0x113')});db[_0x8fc8('0x11')][_0x8fc8('0x114')](db[_0x8fc8('0x71')],{'as':'ReportAgentPreview','foreignKey':_0x8fc8('0x113')});db[_0x8fc8('0x11')][_0x8fc8('0x114')](db[_0x8fc8('0x57')],{'as':_0x8fc8('0x11a'),'foreignKey':_0x8fc8('0x113')});db[_0x8fc8('0x11')][_0x8fc8('0x114')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':'UserId'});db[_0x8fc8('0x11')][_0x8fc8('0x114')](db[_0x8fc8('0x4f')],{'as':_0x8fc8('0x11b'),'foreignKey':'UserId'});db['User'][_0x8fc8('0x114')](db[_0x8fc8('0x46')],{'as':'FaxInteractions','foreignKey':_0x8fc8('0x113')});db[_0x8fc8('0x11')]['hasMany'](db[_0x8fc8('0x11c')],{'as':'MailInteractions','foreignKey':_0x8fc8('0x113')});db[_0x8fc8('0x11')][_0x8fc8('0x114')](db[_0x8fc8('0x100')],{'as':_0x8fc8('0x11d'),'foreignKey':_0x8fc8('0x113')});db[_0x8fc8('0x11')][_0x8fc8('0x114')](db['UserNotification'],{'as':_0x8fc8('0x11e'),'foreignKey':_0x8fc8('0x11f')});db[_0x8fc8('0x11')][_0x8fc8('0x120')](db[_0x8fc8('0xf7')],{'as':_0x8fc8('0xf7'),'foreignKey':_0x8fc8('0x121')});db[_0x8fc8('0x11')][_0x8fc8('0x122')](db[_0x8fc8('0x64')],{'as':_0x8fc8('0x123'),'through':_0x8fc8('0x124')});db[_0x8fc8('0x11')]['belongsToMany'](db[_0x8fc8('0x69')],{'as':_0x8fc8('0x125'),'through':_0x8fc8('0x126')});db[_0x8fc8('0x11')][_0x8fc8('0x122')](db['CmList'],{'as':_0x8fc8('0x127'),'through':_0x8fc8('0x128')});db[_0x8fc8('0x11')]['belongsToMany'](db[_0x8fc8('0xdf')],{'through':_0x8fc8('0x129')});db[_0x8fc8('0x11')][_0x8fc8('0x122')](db[_0x8fc8('0x11c')],{'as':_0x8fc8('0x12a'),'through':'user_has_mail_interactions'});db['User'][_0x8fc8('0x122')](db[_0x8fc8('0x5f')],{'as':_0x8fc8('0x12b'),'through':_0x8fc8('0x12c')});db['User'][_0x8fc8('0x122')](db[_0x8fc8('0x46')],{'as':'FaxInteractions','through':_0x8fc8('0x12d')});db[_0x8fc8('0x11')][_0x8fc8('0x122')](db['SmsInteraction'],{'as':_0x8fc8('0x11b'),'through':'user_has_sms_interactions'});db[_0x8fc8('0x11')][_0x8fc8('0x122')](db[_0x8fc8('0x57')],{'as':_0x8fc8('0x11a'),'through':'user_has_openchannel_interactions'});db[_0x8fc8('0x11')][_0x8fc8('0x122')](db[_0x8fc8('0x100')],{'as':_0x8fc8('0x11d'),'through':_0x8fc8('0x12e')});db[_0x8fc8('0x11')][_0x8fc8('0x122')](db[_0x8fc8('0x19')],{'as':_0x8fc8('0x12f'),'through':_0x8fc8('0x130'),'required':![]});db[_0x8fc8('0x11')][_0x8fc8('0x122')](db[_0x8fc8('0xf5')],{'as':'VoicePrefixes','through':_0x8fc8('0x10e'),'required':![]});db['User'][_0x8fc8('0x122')](db['MailQueue'],{'as':_0x8fc8('0x131'),'through':_0x8fc8('0x2d'),'required':![]});db[_0x8fc8('0x11')][_0x8fc8('0x122')](db['ChatQueue'],{'as':_0x8fc8('0x132'),'through':_0x8fc8('0x133'),'required':![],'hooks':!![]});db[_0x8fc8('0x11')][_0x8fc8('0x122')](db['FaxQueue'],{'as':'FaxQueues','through':_0x8fc8('0x2f'),'required':![]});db[_0x8fc8('0x11')][_0x8fc8('0x122')](db[_0x8fc8('0x51')],{'as':_0x8fc8('0x134'),'through':_0x8fc8('0x30'),'required':![]});db[_0x8fc8('0x11')][_0x8fc8('0x122')](db[_0x8fc8('0x135')],{'as':'OpenchannelQueues','through':_0x8fc8('0x136'),'required':![]});db['User']['belongsToMany'](db['WhatsappQueue'],{'as':'WhatsappQueues','through':_0x8fc8('0x137'),'required':![]});db['User'][_0x8fc8('0x122')](db['CmList'],{'through':_0x8fc8('0x128')});db[_0x8fc8('0x11')][_0x8fc8('0x122')](db[_0x8fc8('0x138')],{'as':_0x8fc8('0x139'),'through':'user_has_chat_websites'});db['User'][_0x8fc8('0x122')](db[_0x8fc8('0x42')],{'as':_0x8fc8('0x13a'),'through':_0x8fc8('0x13b')});db[_0x8fc8('0x11')][_0x8fc8('0x122')](db[_0x8fc8('0x38')],{'as':_0x8fc8('0x13c'),'through':'user_has_mail_accounts'});db[_0x8fc8('0x11')]['belongsToMany'](db['OpenchannelAccount'],{'as':_0x8fc8('0x13d'),'through':'user_has_openchannel_accounts'});db[_0x8fc8('0x11')][_0x8fc8('0x122')](db[_0x8fc8('0x4b')],{'as':_0x8fc8('0x13e'),'through':_0x8fc8('0x13f')});db[_0x8fc8('0x11')]['belongsToMany'](db[_0x8fc8('0x140')],{'as':_0x8fc8('0x141'),'through':_0x8fc8('0x142')});db[_0x8fc8('0x11')][_0x8fc8('0x122')](db['SquareProject'],{'as':_0x8fc8('0x143'),'through':'user_has_square_projects'});db[_0x8fc8('0x14')]['hasMany'](db['VoiceExtension'],{'as':_0x8fc8('0x144'),'onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x145')});db[_0x8fc8('0x15')][_0x8fc8('0x114')](db[_0x8fc8('0x117')],{'onDelete':_0x8fc8('0x111')});db[_0x8fc8('0x117')][_0x8fc8('0x114')](db[_0x8fc8('0x117')],{'as':_0x8fc8('0x146'),'onDelete':_0x8fc8('0x111')});db[_0x8fc8('0x17')][_0x8fc8('0x122')](db[_0x8fc8('0x83')],{'as':_0x8fc8('0x147'),'through':_0x8fc8('0x148')});db[_0x8fc8('0x19')]['hasMany'](db[_0x8fc8('0x2a')],{'as':_0x8fc8('0x149'),'foreignKey':_0x8fc8('0x14a')});db[_0x8fc8('0x19')]['hasMany'](db[_0x8fc8('0x6b')],{'as':_0x8fc8('0x14b'),'foreignKey':_0x8fc8('0x14a')});db[_0x8fc8('0x19')][_0x8fc8('0x114')](db[_0x8fc8('0x6e')],{'as':_0x8fc8('0x14c'),'foreignKey':_0x8fc8('0x14a')});db[_0x8fc8('0x19')][_0x8fc8('0x114')](db['CmHopperHistory'],{'as':_0x8fc8('0x14d'),'foreignKey':_0x8fc8('0x14a')});db[_0x8fc8('0x19')][_0x8fc8('0x114')](db[_0x8fc8('0x71')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0x8fc8('0x19')][_0x8fc8('0x114')](db['CmHopperBlack'],{'as':_0x8fc8('0x14e'),'foreignKey':_0x8fc8('0x14a')});db[_0x8fc8('0x19')][_0x8fc8('0x114')](db[_0x8fc8('0xd5')],{'as':_0x8fc8('0x14f'),'foreignKey':_0x8fc8('0x14a')});db[_0x8fc8('0x19')][_0x8fc8('0x120')](db[_0x8fc8('0x26')],{'as':_0x8fc8('0x26'),'foreignKey':_0x8fc8('0x150')});db[_0x8fc8('0x19')][_0x8fc8('0x120')](db[_0x8fc8('0x26')],{'as':_0x8fc8('0x151'),'foreignKey':_0x8fc8('0x152')});db['VoiceQueue'][_0x8fc8('0x120')](db[_0x8fc8('0x7a')],{'as':_0x8fc8('0x7a'),'foreignKey':'IntervalId'});db[_0x8fc8('0x19')][_0x8fc8('0x120')](db[_0x8fc8('0x7c')],{'as':_0x8fc8('0x153'),'foreignKey':_0x8fc8('0x154')});db[_0x8fc8('0x19')][_0x8fc8('0x122')](db[_0x8fc8('0xf3')],{'as':_0x8fc8('0x127'),'through':'voice_queues_has_cm_lists'});db['VoiceQueue']['belongsToMany'](db['User'],{'as':_0x8fc8('0x155'),'through':_0x8fc8('0x130')});db[_0x8fc8('0x19')][_0x8fc8('0x122')](db['Team'],{'as':_0x8fc8('0x156'),'through':_0x8fc8('0x157')});db[_0x8fc8('0x19')][_0x8fc8('0x122')](db[_0x8fc8('0xf3')],{'as':_0x8fc8('0x158'),'through':_0x8fc8('0x159')});db[_0x8fc8('0x1b')][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x11'),'foreignKey':'UserId'});db['ScreenRecording'][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x11'),'foreignKey':'UserId'});db['VoiceMail'][_0x8fc8('0x114')](db[_0x8fc8('0x15a')],{'as':'Messages','onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x15b'),'sourceKey':_0x8fc8('0x15c')});db['VoiceMailMessage'][_0x8fc8('0x120')](db[_0x8fc8('0x1f')],{'foreignKey':_0x8fc8('0x15b'),'targetKey':_0x8fc8('0x15c')});db[_0x8fc8('0x15d')][_0x8fc8('0x114')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0x8fc8('0x15e'),'constraints':![]});db['VoiceCallReport']['hasMany'](db[_0x8fc8('0x22')],{'as':_0x8fc8('0x15f'),'foreignKey':_0x8fc8('0x15e'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x11'),'foreignKey':_0x8fc8('0x113')});db[_0x8fc8('0x15d')][_0x8fc8('0x120')](db[_0x8fc8('0x69')],{'as':_0x8fc8('0x160'),'foreignKey':_0x8fc8('0x161')});db[_0x8fc8('0x34')][_0x8fc8('0x120')](db[_0x8fc8('0x38')],{'as':_0x8fc8('0x38'),'foreignKey':_0x8fc8('0x162')});db[_0x8fc8('0x34')][_0x8fc8('0x120')](db[_0x8fc8('0x10a')],{'as':'CloudProvider','foreignKey':_0x8fc8('0x163'),'onDelete':_0x8fc8('0x164')});db['MailServerOut'][_0x8fc8('0x120')](db[_0x8fc8('0x38')],{'as':'MailAccount','foreignKey':_0x8fc8('0x162')});db[_0x8fc8('0x36')][_0x8fc8('0x120')](db[_0x8fc8('0x10a')],{'as':'CloudProvider','foreignKey':'CloudProviderId','onDelete':_0x8fc8('0x164')});db[_0x8fc8('0x38')][_0x8fc8('0x110')](db[_0x8fc8('0x34')],{'as':_0x8fc8('0x165'),'onDelete':_0x8fc8('0x111')});db['MailAccount'][_0x8fc8('0x110')](db[_0x8fc8('0x36')],{'as':_0x8fc8('0x166'),'onDelete':_0x8fc8('0x111')});db[_0x8fc8('0x38')][_0x8fc8('0x114')](db[_0x8fc8('0x78')],{'as':'Dispositions','foreignKey':_0x8fc8('0x162'),'onDelete':_0x8fc8('0x111')});db[_0x8fc8('0x38')]['hasMany'](db[_0x8fc8('0x76')],{'as':'Answers','foreignKey':_0x8fc8('0x162')});db[_0x8fc8('0x38')][_0x8fc8('0x114')](db['MailMessage'],{'as':'Messages','foreignKey':_0x8fc8('0x162')});db[_0x8fc8('0x38')]['hasMany'](db[_0x8fc8('0x11c')],{'as':_0x8fc8('0x167')});db['MailAccount'][_0x8fc8('0x114')](db[_0x8fc8('0x168')],{'as':_0x8fc8('0x146')});db['MailAccount'][_0x8fc8('0x120')](db[_0x8fc8('0xf3')],{'as':'List','foreignKey':'ListId'});db['MailAccount'][_0x8fc8('0x120')](db[_0x8fc8('0x8b')],{'as':_0x8fc8('0x8b'),'foreignKey':_0x8fc8('0x169')});db['MailAccount'][_0x8fc8('0x120')](db[_0x8fc8('0x7c')],{'as':_0x8fc8('0x153'),'foreignKey':_0x8fc8('0x154')});db['MailAccount'][_0x8fc8('0x122')](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x155'),'through':_0x8fc8('0x16a')});db[_0x8fc8('0x39')][_0x8fc8('0x122')](db[_0x8fc8('0x11')],{'as':'Agents','through':_0x8fc8('0x2d')});db[_0x8fc8('0x39')][_0x8fc8('0x122')](db[_0x8fc8('0xdf')],{'through':_0x8fc8('0x16b'),'as':_0x8fc8('0x156')});db[_0x8fc8('0x11c')][_0x8fc8('0x114')](db[_0x8fc8('0x3c')],{'as':_0x8fc8('0x16c'),'onDelete':'cascade','foreignKey':_0x8fc8('0x16d')});db['MailInteraction'][_0x8fc8('0x120')](db[_0x8fc8('0x38')],{'as':'Account','foreignKey':_0x8fc8('0x162')});db[_0x8fc8('0x11c')][_0x8fc8('0x120')](db['CmContact'],{'as':_0x8fc8('0x160'),'foreignKey':_0x8fc8('0x161')});db[_0x8fc8('0x11c')]['belongsTo'](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x16e'),'foreignKey':_0x8fc8('0x113')});db[_0x8fc8('0x11c')][_0x8fc8('0x122')](db[_0x8fc8('0x85')],{'through':_0x8fc8('0x16f'),'as':_0x8fc8('0x170')});db[_0x8fc8('0x11c')]['belongsToMany'](db[_0x8fc8('0x85')],{'through':_0x8fc8('0x16f'),'as':_0x8fc8('0x171')});db[_0x8fc8('0x11c')]['belongsToMany'](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x172'),'through':'user_has_mail_interactions','foreignKey':_0x8fc8('0x16d')});db[_0x8fc8('0x3c')][_0x8fc8('0x114')](db['Attachment'],{'as':_0x8fc8('0x173'),'onDelete':_0x8fc8('0x111')});db[_0x8fc8('0x3c')]['belongsTo'](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x11')});db[_0x8fc8('0x3c')]['belongsTo'](db[_0x8fc8('0x69')],{'onDelete':_0x8fc8('0x111'),'as':'Contact'});db[_0x8fc8('0x3c')][_0x8fc8('0x120')](db['MailInteraction'],{'as':_0x8fc8('0x174'),'foreignKey':_0x8fc8('0x16d')});db['MailMessage'][_0x8fc8('0x120')](db['MailAccount'],{'as':_0x8fc8('0x175'),'foreignKey':_0x8fc8('0x162')});db[_0x8fc8('0x3c')][_0x8fc8('0x120')](db[_0x8fc8('0x138')],{'as':_0x8fc8('0x138'),'foreignKey':_0x8fc8('0x176')});db[_0x8fc8('0x3c')][_0x8fc8('0x120')](db[_0x8fc8('0x62')],{'as':_0x8fc8('0x62'),'foreignKey':'ChatOfflineMessageId'});db[_0x8fc8('0x168')]['belongsTo'](db[_0x8fc8('0x11')],{'onDelete':'restrict'});db[_0x8fc8('0x168')]['belongsTo'](db['MailQueue'],{'onDelete':'restrict'});db[_0x8fc8('0x168')][_0x8fc8('0x120')](db[_0x8fc8('0x38')],{'onDelete':'restrict'});db[_0x8fc8('0x168')][_0x8fc8('0x120')](db[_0x8fc8('0x7a')],{'onDelete':'restrict','foreignKey':_0x8fc8('0x177')});db[_0x8fc8('0x168')][_0x8fc8('0x120')](db[_0x8fc8('0x85')],{'onDelete':_0x8fc8('0x164'),'foreignKey':_0x8fc8('0x178')});db[_0x8fc8('0x3e')]['belongsTo'](db[_0x8fc8('0x38')],{});db[_0x8fc8('0x3e')][_0x8fc8('0x120')](db[_0x8fc8('0xf3')],{'as':'List','foreignKey':_0x8fc8('0x179')});db[_0x8fc8('0x3e')][_0x8fc8('0x120')](db[_0x8fc8('0x69')],{'as':_0x8fc8('0x160'),'foreignKey':_0x8fc8('0x161')});db['MailQueueReport'][_0x8fc8('0x120')](db[_0x8fc8('0x11c')],{});db[_0x8fc8('0x3e')]['belongsTo'](db['MailMessage'],{});db[_0x8fc8('0x3e')][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{});db['MailQueueReport'][_0x8fc8('0x120')](db[_0x8fc8('0x39')],{});db[_0x8fc8('0x17a')]['hasMany'](db[_0x8fc8('0x40')],{'as':'Items','onDelete':_0x8fc8('0x111')});db[_0x8fc8('0x42')]['hasMany'](db[_0x8fc8('0x78')],{'as':_0x8fc8('0x17b'),'foreignKey':_0x8fc8('0x17c'),'onDelete':_0x8fc8('0x111')});db[_0x8fc8('0x42')]['hasMany'](db[_0x8fc8('0x76')],{'as':_0x8fc8('0x17d'),'foreignKey':'FaxAccountId'});db[_0x8fc8('0x42')][_0x8fc8('0x114')](db[_0x8fc8('0x46')],{'as':_0x8fc8('0x167')});db['FaxAccount']['hasMany'](db[_0x8fc8('0x44')],{'as':_0x8fc8('0x146')});db[_0x8fc8('0x42')][_0x8fc8('0x114')](db[_0x8fc8('0x117')],{'as':_0x8fc8('0x17e'),'onDelete':'cascade'});db[_0x8fc8('0x42')][_0x8fc8('0x114')](db['FaxMessage'],{'as':'Messages'});db['FaxAccount'][_0x8fc8('0x120')](db[_0x8fc8('0x26')],{'as':_0x8fc8('0x26')});db['FaxAccount']['belongsTo'](db[_0x8fc8('0xf3')],{'as':_0x8fc8('0x17f'),'foreignKey':_0x8fc8('0x179')});db['FaxAccount'][_0x8fc8('0x120')](db[_0x8fc8('0x7c')],{'as':_0x8fc8('0x153'),'foreignKey':_0x8fc8('0x154')});db['FaxAccount'][_0x8fc8('0x122')](db[_0x8fc8('0x11')],{'as':'Agents','through':'user_has_fax_accounts'});db[_0x8fc8('0x44')][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'onDelete':_0x8fc8('0x164')});db['FaxApplication'][_0x8fc8('0x120')](db[_0x8fc8('0x48')],{'onDelete':_0x8fc8('0x164')});db[_0x8fc8('0x44')][_0x8fc8('0x120')](db[_0x8fc8('0x42')],{'onDelete':_0x8fc8('0x164')});db[_0x8fc8('0x44')]['belongsTo'](db['Tag'],{'onDelete':_0x8fc8('0x164'),'foreignKey':'TagId'});db['FaxInteraction'][_0x8fc8('0x114')](db[_0x8fc8('0x180')],{'as':_0x8fc8('0x16c'),'onDelete':_0x8fc8('0x111'),'foreignKey':'FaxInteractionId'});db[_0x8fc8('0x46')][_0x8fc8('0x120')](db[_0x8fc8('0x42')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x8fc8('0x46')][_0x8fc8('0x120')](db[_0x8fc8('0x69')],{'as':'Contact','foreignKey':'ContactId'});db[_0x8fc8('0x46')][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x16e'),'foreignKey':_0x8fc8('0x113')});db[_0x8fc8('0x46')][_0x8fc8('0x122')](db[_0x8fc8('0x85')],{'through':'fax_interaction_has_tags','as':'Tags'});db['FaxInteraction'][_0x8fc8('0x122')](db[_0x8fc8('0x85')],{'through':_0x8fc8('0x181'),'as':_0x8fc8('0x171')});db[_0x8fc8('0x46')]['belongsToMany'](db['User'],{'as':_0x8fc8('0x172'),'through':_0x8fc8('0x12d'),'foreignKey':'FaxInteractionId'});db[_0x8fc8('0x180')]['belongsTo'](db[_0x8fc8('0x11')],{'onDelete':_0x8fc8('0x111'),'as':_0x8fc8('0x11')});db['FaxMessage'][_0x8fc8('0x120')](db[_0x8fc8('0x46')],{'as':_0x8fc8('0x174'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x8fc8('0x120')](db['CmContact'],{'onDelete':'cascade','as':_0x8fc8('0x160')});db[_0x8fc8('0x180')][_0x8fc8('0x120')](db[_0x8fc8('0xe7')],{'as':_0x8fc8('0xe7'),'foreignKey':_0x8fc8('0x182')});db[_0x8fc8('0x180')][_0x8fc8('0x120')](db['FaxAccount'],{'as':_0x8fc8('0x175'),'foreignKey':_0x8fc8('0x17c')});db[_0x8fc8('0x48')][_0x8fc8('0x122')](db['User'],{'as':_0x8fc8('0x155'),'through':_0x8fc8('0x2f')});db[_0x8fc8('0x48')][_0x8fc8('0x122')](db[_0x8fc8('0xdf')],{'through':'team_has_fax_queues','as':'Teams'});db[_0x8fc8('0x183')][_0x8fc8('0x120')](db['FaxAccount'],{});db[_0x8fc8('0x183')][_0x8fc8('0x120')](db[_0x8fc8('0xf3')],{'as':_0x8fc8('0x17f'),'foreignKey':_0x8fc8('0x179')});db[_0x8fc8('0x183')][_0x8fc8('0x120')](db[_0x8fc8('0x69')],{'as':'Contact','foreignKey':_0x8fc8('0x161')});db[_0x8fc8('0x183')]['belongsTo'](db['FaxInteraction'],{});db[_0x8fc8('0x183')][_0x8fc8('0x120')](db[_0x8fc8('0x180')],{});db[_0x8fc8('0x183')][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{});db['FaxQueueReport'][_0x8fc8('0x120')](db[_0x8fc8('0x48')],{});db[_0x8fc8('0x4b')][_0x8fc8('0x114')](db['Disposition'],{'as':_0x8fc8('0x17b'),'foreignKey':_0x8fc8('0x184'),'onDelete':'cascade'});db[_0x8fc8('0x4b')][_0x8fc8('0x114')](db[_0x8fc8('0x76')],{'as':'Answers','foreignKey':_0x8fc8('0x184')});db[_0x8fc8('0x4b')][_0x8fc8('0x114')](db['SmsMessage'],{'as':_0x8fc8('0x16c'),'foreignKey':_0x8fc8('0x184')});db['SmsAccount']['hasMany'](db[_0x8fc8('0x4f')],{'as':_0x8fc8('0x167')});db[_0x8fc8('0x4b')][_0x8fc8('0x114')](db[_0x8fc8('0x4d')],{'as':_0x8fc8('0x146')});db[_0x8fc8('0x4b')]['belongsTo'](db[_0x8fc8('0xf3')],{'as':_0x8fc8('0x17f'),'foreignKey':_0x8fc8('0x179')});db['SmsAccount'][_0x8fc8('0x120')](db[_0x8fc8('0x7c')],{'as':_0x8fc8('0x153'),'foreignKey':_0x8fc8('0x154')});db['SmsAccount']['belongsToMany'](db[_0x8fc8('0x11')],{'as':'Agents','through':_0x8fc8('0x13f')});db['SmsApplication'][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'onDelete':_0x8fc8('0x164')});db[_0x8fc8('0x4d')][_0x8fc8('0x120')](db[_0x8fc8('0x51')],{'onDelete':_0x8fc8('0x164')});db['SmsApplication'][_0x8fc8('0x120')](db[_0x8fc8('0x4b')],{'onDelete':_0x8fc8('0x164')});db[_0x8fc8('0x4d')][_0x8fc8('0x120')](db[_0x8fc8('0x7a')],{'onDelete':_0x8fc8('0x164'),'foreignKey':_0x8fc8('0x177')});db[_0x8fc8('0x4d')][_0x8fc8('0x120')](db['Tag'],{'onDelete':_0x8fc8('0x164'),'foreignKey':_0x8fc8('0x178')});db[_0x8fc8('0x4f')][_0x8fc8('0x114')](db['SmsMessage'],{'as':_0x8fc8('0x16c'),'onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x185')});db[_0x8fc8('0x4f')][_0x8fc8('0x120')](db[_0x8fc8('0x4b')],{'as':_0x8fc8('0x175'),'foreignKey':_0x8fc8('0x184')});db[_0x8fc8('0x4f')][_0x8fc8('0x120')](db[_0x8fc8('0x69')],{'as':_0x8fc8('0x160'),'foreignKey':_0x8fc8('0x161')});db['SmsInteraction'][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x16e'),'foreignKey':_0x8fc8('0x113')});db['SmsInteraction'][_0x8fc8('0x122')](db[_0x8fc8('0x85')],{'through':_0x8fc8('0x186'),'as':_0x8fc8('0x170')});db[_0x8fc8('0x4f')][_0x8fc8('0x122')](db['Tag'],{'through':_0x8fc8('0x186'),'as':_0x8fc8('0x171')});db[_0x8fc8('0x4f')][_0x8fc8('0x122')](db['User'],{'as':_0x8fc8('0x172'),'through':_0x8fc8('0x187'),'foreignKey':_0x8fc8('0x185')});db[_0x8fc8('0x50')][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x11')});db[_0x8fc8('0x50')]['belongsTo'](db['CmContact'],{'onDelete':_0x8fc8('0x111'),'as':_0x8fc8('0x160')});db[_0x8fc8('0x50')][_0x8fc8('0x120')](db[_0x8fc8('0x4f')],{'onDelete':_0x8fc8('0x111'),'as':_0x8fc8('0x174'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0x8fc8('0x120')](db['SmsAccount'],{'as':'Account','foreignKey':_0x8fc8('0x184')});db[_0x8fc8('0x51')][_0x8fc8('0x122')](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x155'),'through':'UserSmsQueue','foreignKey':_0x8fc8('0x188')});db[_0x8fc8('0x51')]['belongsToMany'](db[_0x8fc8('0xdf')],{'through':_0x8fc8('0x189'),'as':_0x8fc8('0x156')});db[_0x8fc8('0x53')][_0x8fc8('0x114')](db['Disposition'],{'as':_0x8fc8('0x17b'),'foreignKey':_0x8fc8('0x18a'),'onDelete':'cascade'});db[_0x8fc8('0x53')][_0x8fc8('0x114')](db['CannedAnswer'],{'as':_0x8fc8('0x17d'),'foreignKey':_0x8fc8('0x18a')});db[_0x8fc8('0x53')]['hasMany'](db[_0x8fc8('0x57')],{'as':_0x8fc8('0x167'),'foreignKey':_0x8fc8('0x18a')});db[_0x8fc8('0x53')][_0x8fc8('0x114')](db[_0x8fc8('0x59')],{'as':'Messages','foreignKey':_0x8fc8('0x18a')});db[_0x8fc8('0x53')][_0x8fc8('0x114')](db[_0x8fc8('0x55')],{'as':_0x8fc8('0x146'),'foreignKey':_0x8fc8('0x18a')});db[_0x8fc8('0x53')]['belongsTo'](db[_0x8fc8('0xf3')],{'as':_0x8fc8('0x17f'),'foreignKey':'ListId'});db[_0x8fc8('0x53')][_0x8fc8('0x120')](db[_0x8fc8('0x7c')],{'as':_0x8fc8('0x153'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8fc8('0x53')][_0x8fc8('0x122')](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x155'),'through':_0x8fc8('0x18b')});db['OpenchannelApplication'][_0x8fc8('0x120')](db['User'],{'onDelete':_0x8fc8('0x164')});db['OpenchannelApplication'][_0x8fc8('0x120')](db[_0x8fc8('0x135')],{'onDelete':_0x8fc8('0x164'),'foreignKey':_0x8fc8('0x18c')});db[_0x8fc8('0x55')][_0x8fc8('0x120')](db[_0x8fc8('0x53')],{'onDelete':_0x8fc8('0x164'),'foreignKey':_0x8fc8('0x18a')});db[_0x8fc8('0x55')]['belongsTo'](db[_0x8fc8('0x7a')],{'onDelete':_0x8fc8('0x164'),'foreignKey':_0x8fc8('0x177')});db[_0x8fc8('0x55')][_0x8fc8('0x120')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x8fc8('0x178')});db[_0x8fc8('0x57')]['hasMany'](db[_0x8fc8('0x59')],{'as':_0x8fc8('0x16c'),'onDelete':'cascade','foreignKey':_0x8fc8('0x18d')});db[_0x8fc8('0x57')][_0x8fc8('0x120')](db['OpenchannelAccount'],{'as':_0x8fc8('0x175'),'foreignKey':_0x8fc8('0x18a')});db[_0x8fc8('0x57')][_0x8fc8('0x120')](db[_0x8fc8('0x69')],{'as':_0x8fc8('0x160'),'foreignKey':'ContactId'});db[_0x8fc8('0x57')][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x16e'),'foreignKey':_0x8fc8('0x113')});db[_0x8fc8('0x57')][_0x8fc8('0x122')](db[_0x8fc8('0x85')],{'through':_0x8fc8('0x18e'),'as':_0x8fc8('0x170')});db[_0x8fc8('0x57')][_0x8fc8('0x122')](db['Tag'],{'through':_0x8fc8('0x18e'),'as':_0x8fc8('0x171')});db[_0x8fc8('0x57')][_0x8fc8('0x122')](db[_0x8fc8('0x11')],{'as':'Users','through':_0x8fc8('0x18f'),'foreignKey':_0x8fc8('0x18d')});db[_0x8fc8('0x59')][_0x8fc8('0x120')](db['User'],{'onDelete':_0x8fc8('0x111'),'as':_0x8fc8('0x11')});db['OpenchannelMessage'][_0x8fc8('0x120')](db[_0x8fc8('0x69')],{'onDelete':'cascade','as':_0x8fc8('0x160')});db[_0x8fc8('0x59')][_0x8fc8('0x120')](db[_0x8fc8('0x57')],{'onDelete':_0x8fc8('0x111'),'as':'Interaction','foreignKey':'OpenchannelInteractionId'});db[_0x8fc8('0x59')][_0x8fc8('0x120')](db[_0x8fc8('0xe7')],{'as':_0x8fc8('0xe7'),'foreignKey':_0x8fc8('0x182')});db[_0x8fc8('0x59')][_0x8fc8('0x120')](db['OpenchannelAccount'],{'as':_0x8fc8('0x175'),'foreignKey':_0x8fc8('0x18a')});db[_0x8fc8('0x135')]['belongsToMany'](db['User'],{'as':_0x8fc8('0x155'),'through':_0x8fc8('0x136'),'foreignKey':'OpenchannelQueueId'});db[_0x8fc8('0x135')][_0x8fc8('0x122')](db[_0x8fc8('0xdf')],{'through':'team_has_openchannel_queues','as':_0x8fc8('0x156')});db[_0x8fc8('0x138')]['hasMany'](db[_0x8fc8('0x78')],{'as':_0x8fc8('0x17b'),'foreignKey':_0x8fc8('0x176'),'onDelete':_0x8fc8('0x111')});db['ChatWebsite'][_0x8fc8('0x114')](db[_0x8fc8('0x76')],{'as':_0x8fc8('0x17d'),'foreignKey':_0x8fc8('0x176')});db[_0x8fc8('0x138')][_0x8fc8('0x114')](db['ChatProactiveAction'],{'as':_0x8fc8('0x190')});db['ChatWebsite']['hasMany'](db[_0x8fc8('0x5f')],{'as':_0x8fc8('0x167')});db['ChatWebsite'][_0x8fc8('0x114')](db[_0x8fc8('0x5e')],{'as':_0x8fc8('0x146')});db[_0x8fc8('0x138')][_0x8fc8('0x114')](db['ChatMessage'],{'as':_0x8fc8('0x16c')});db[_0x8fc8('0x138')][_0x8fc8('0x120')](db['CmList'],{'as':'List','foreignKey':_0x8fc8('0x179')});db['ChatWebsite'][_0x8fc8('0x120')](db[_0x8fc8('0x7a')],{'as':_0x8fc8('0x7a'),'foreignKey':_0x8fc8('0x177')});db[_0x8fc8('0x138')][_0x8fc8('0x120')](db['MailAccount'],{'as':_0x8fc8('0x38'),'foreignKey':_0x8fc8('0x162')});db[_0x8fc8('0x138')][_0x8fc8('0x120')](db[_0x8fc8('0x7c')],{'as':_0x8fc8('0x153'),'foreignKey':_0x8fc8('0x154')});db[_0x8fc8('0x138')]['belongsToMany'](db['User'],{'as':'Agents','through':'user_has_chat_websites'});db[_0x8fc8('0x5d')][_0x8fc8('0x120')](db[_0x8fc8('0x53')],{});db[_0x8fc8('0x5d')][_0x8fc8('0x120')](db['CmList'],{'as':_0x8fc8('0x17f'),'foreignKey':_0x8fc8('0x179')});db[_0x8fc8('0x5d')]['belongsTo'](db['CmContact'],{'as':_0x8fc8('0x160'),'foreignKey':_0x8fc8('0x161')});db[_0x8fc8('0x5d')][_0x8fc8('0x120')](db[_0x8fc8('0x57')],{});db[_0x8fc8('0x5d')][_0x8fc8('0x120')](db[_0x8fc8('0x59')],{});db[_0x8fc8('0x5d')]['belongsTo'](db[_0x8fc8('0x11')],{});db[_0x8fc8('0x5d')][_0x8fc8('0x120')](db[_0x8fc8('0x135')],{});db[_0x8fc8('0x5e')][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x191'),'foreignKey':_0x8fc8('0x113'),'onDelete':'restrict'});db[_0x8fc8('0x5e')][_0x8fc8('0x120')](db['ChatQueue'],{'as':_0x8fc8('0x192'),'foreignKey':'ChatQueueId','onDelete':_0x8fc8('0x164')});db[_0x8fc8('0x5e')]['belongsTo'](db['ChatWebsite'],{'as':'Website','foreignKey':_0x8fc8('0x176'),'onDelete':_0x8fc8('0x164')});db[_0x8fc8('0x5e')][_0x8fc8('0x120')](db[_0x8fc8('0x85')],{'onDelete':'restrict','foreignKey':_0x8fc8('0x178')});db[_0x8fc8('0x5f')][_0x8fc8('0x114')](db[_0x8fc8('0x60')],{'as':_0x8fc8('0x16c'),'onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x193')});db['ChatInteraction'][_0x8fc8('0x120')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x8fc8('0x176')});db['ChatInteraction']['belongsTo'](db[_0x8fc8('0x69')],{'as':_0x8fc8('0x160'),'foreignKey':_0x8fc8('0x161')});db['ChatInteraction']['belongsTo'](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x16e'),'foreignKey':_0x8fc8('0x113')});db['ChatInteraction'][_0x8fc8('0x122')](db[_0x8fc8('0x85')],{'through':'chat_interaction_has_tags','as':_0x8fc8('0x170')});db['ChatInteraction'][_0x8fc8('0x122')](db[_0x8fc8('0x85')],{'through':'chat_interaction_has_tags','as':_0x8fc8('0x171')});db[_0x8fc8('0x5f')][_0x8fc8('0x122')](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x172'),'through':_0x8fc8('0x12c'),'foreignKey':'ChatInteractionId'});db['ChatMessage'][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'onDelete':'cascade','as':_0x8fc8('0x11')});db['ChatMessage'][_0x8fc8('0x120')](db['CmContact'],{'onDelete':'cascade','as':_0x8fc8('0x160'),'foreignKey':_0x8fc8('0x161')});db[_0x8fc8('0x60')]['belongsTo'](db['ChatInteraction'],{'onDelete':_0x8fc8('0x111'),'as':_0x8fc8('0x174'),'foreignKey':_0x8fc8('0x193')});db['ChatMessage'][_0x8fc8('0x120')](db[_0x8fc8('0xe7')],{'as':_0x8fc8('0xe7'),'foreignKey':_0x8fc8('0x182')});db[_0x8fc8('0x60')][_0x8fc8('0x120')](db[_0x8fc8('0x138')],{'as':_0x8fc8('0x175'),'foreignKey':'ChatWebsiteId'});db[_0x8fc8('0x62')][_0x8fc8('0x114')](db[_0x8fc8('0xe7')],{'as':'Attachments','foreignKey':_0x8fc8('0x194'),'onDelete':_0x8fc8('0x111'),'hooks':!![]});db[_0x8fc8('0x62')][_0x8fc8('0x120')](db[_0x8fc8('0x69')],{'onDelete':'cascade','as':_0x8fc8('0x160'),'foreignKey':_0x8fc8('0x161')});db[_0x8fc8('0x62')][_0x8fc8('0x120')](db[_0x8fc8('0x138')],{'as':_0x8fc8('0x175'),'foreignKey':_0x8fc8('0x176')});db[_0x8fc8('0x195')][_0x8fc8('0x122')](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x155'),'through':'UserChatQueue','hooks':!![]});db[_0x8fc8('0x195')][_0x8fc8('0x122')](db['Team'],{'through':_0x8fc8('0x196'),'as':_0x8fc8('0x156')});db[_0x8fc8('0x64')][_0x8fc8('0x114')](db[_0x8fc8('0xd2')],{'as':_0x8fc8('0x16c'),'foreignKey':_0x8fc8('0x197'),'onDelete':_0x8fc8('0x111')});db[_0x8fc8('0x64')][_0x8fc8('0x122')](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x149'),'through':_0x8fc8('0x124')});db[_0x8fc8('0x66')]['belongsTo'](db[_0x8fc8('0x138')],{'as':_0x8fc8('0x198'),'foreignKey':_0x8fc8('0x176')});db[_0x8fc8('0x67')][_0x8fc8('0x114')](db[_0x8fc8('0x69')],{'as':'Contacts','foreignKey':_0x8fc8('0x199')});db[_0x8fc8('0x69')][_0x8fc8('0x114')](db[_0x8fc8('0x88')],{'as':_0x8fc8('0x19a'),'foreignKey':_0x8fc8('0x19b')});db[_0x8fc8('0x69')][_0x8fc8('0x114')](db[_0x8fc8('0x6b')],{'as':_0x8fc8('0x14b'),'foreignKey':_0x8fc8('0x161')});db[_0x8fc8('0x69')]['hasMany'](db[_0x8fc8('0x6e')],{'as':'HopperFinals','foreignKey':_0x8fc8('0x161')});db['CmContact'][_0x8fc8('0x114')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x8fc8('0x161')});db['CmContact'][_0x8fc8('0x114')](db['ReportAgentPreview'],{'as':_0x8fc8('0x71'),'foreignKey':_0x8fc8('0x161')});db[_0x8fc8('0x69')]['hasMany'](db[_0x8fc8('0xd5')],{'as':_0x8fc8('0x14f'),'foreignKey':_0x8fc8('0x161')});db[_0x8fc8('0x69')][_0x8fc8('0x114')](db['OpenchannelInteraction'],{'as':_0x8fc8('0x11a'),'foreignKey':_0x8fc8('0x161'),'onDelete':_0x8fc8('0x164')});db[_0x8fc8('0x69')]['hasMany'](db['ChatInteraction'],{'as':_0x8fc8('0x12b'),'foreignKey':_0x8fc8('0x161'),'onDelete':'restrict'});db['CmContact'][_0x8fc8('0x114')](db[_0x8fc8('0x4f')],{'as':_0x8fc8('0x11b'),'foreignKey':_0x8fc8('0x161'),'onDelete':_0x8fc8('0x164')});db[_0x8fc8('0x69')][_0x8fc8('0x114')](db[_0x8fc8('0x46')],{'as':_0x8fc8('0x19c'),'foreignKey':_0x8fc8('0x161'),'onDelete':_0x8fc8('0x164')});db[_0x8fc8('0x69')][_0x8fc8('0x114')](db[_0x8fc8('0x11c')],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':_0x8fc8('0x164')});db[_0x8fc8('0x69')][_0x8fc8('0x120')](db['CmCompany'],{'as':_0x8fc8('0x19d'),'foreignKey':_0x8fc8('0x199')});db[_0x8fc8('0x69')][_0x8fc8('0x120')](db[_0x8fc8('0xf3')],{'as':'List','foreignKey':_0x8fc8('0x179'),'onDelete':_0x8fc8('0x111')});db[_0x8fc8('0x69')][_0x8fc8('0x122')](db[_0x8fc8('0x11')],{'as':'Users','through':_0x8fc8('0x126')});db[_0x8fc8('0x69')][_0x8fc8('0x122')](db[_0x8fc8('0x85')],{'as':_0x8fc8('0x170'),'through':'cm_contact_has_tags'});db['CmContact'][_0x8fc8('0x122')](db[_0x8fc8('0x85')],{'through':'cm_contact_has_tags','as':_0x8fc8('0x171')});db[_0x8fc8('0x6b')][_0x8fc8('0x114')](db['CmHopperAdditionalPhone'],{'as':_0x8fc8('0x19e'),'foreignKey':'CmHopperId'});db[_0x8fc8('0x6b')][_0x8fc8('0x120')](db[_0x8fc8('0x69')],{'as':_0x8fc8('0x160'),'foreignKey':_0x8fc8('0x161'),'onDelete':_0x8fc8('0x111')});db[_0x8fc8('0x6b')][_0x8fc8('0x120')](db[_0x8fc8('0xf3')],{'as':_0x8fc8('0x17f'),'foreignKey':_0x8fc8('0x179'),'onDelete':_0x8fc8('0x111')});db['CmHopper'][_0x8fc8('0x120')](db['User'],{'as':_0x8fc8('0x191'),'foreignKey':_0x8fc8('0x113')});db['CmHopper'][_0x8fc8('0x120')](db['VoiceQueue'],{'as':_0x8fc8('0x192'),'foreignKey':_0x8fc8('0x14a'),'onDelete':_0x8fc8('0x111')});db[_0x8fc8('0x6b')]['belongsTo'](db[_0x8fc8('0xe3')],{'as':_0x8fc8('0xe3'),'foreignKey':_0x8fc8('0x19f'),'onDelete':_0x8fc8('0x111')});db[_0x8fc8('0x6b')][_0x8fc8('0x120')](db['User'],{'as':_0x8fc8('0x16e'),'foreignKey':'OwnerId'});db['CmHopperBlack'][_0x8fc8('0x120')](db[_0x8fc8('0x69')],{'as':_0x8fc8('0x160'),'foreignKey':'ContactId','onDelete':_0x8fc8('0x111')});db[_0x8fc8('0x6d')][_0x8fc8('0x120')](db[_0x8fc8('0xf3')],{'as':_0x8fc8('0x17f'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x8fc8('0x6d')][_0x8fc8('0x120')](db[_0x8fc8('0x19')],{'as':_0x8fc8('0x192'),'foreignKey':'VoiceQueueId','onDelete':_0x8fc8('0x111')});db[_0x8fc8('0x6d')][_0x8fc8('0x120')](db['Campaign'],{'as':_0x8fc8('0xe3'),'foreignKey':'CampaignId','onDelete':_0x8fc8('0x111')});db[_0x8fc8('0x1a0')][_0x8fc8('0x114')](db[_0x8fc8('0x1a1')],{'as':{'plural':_0x8fc8('0x1a2'),'singular':_0x8fc8('0x1a3')},'foreignKey':_0x8fc8('0x1a4'),'onDelete':_0x8fc8('0x111'),'hooks':!![]});db[_0x8fc8('0x1a0')]['hasMany'](db['Condition'],{'as':{'plural':_0x8fc8('0x1a5'),'singular':_0x8fc8('0x1a6')},'foreignKey':_0x8fc8('0x1a7'),'onDelete':_0x8fc8('0x111'),'hooks':!![]});db[_0x8fc8('0x1a0')][_0x8fc8('0x114')](db['Action'],{'as':_0x8fc8('0x1a8'),'foreignKey':_0x8fc8('0x1a9'),'onDelete':_0x8fc8('0x111'),'hooks':!![]});db[_0x8fc8('0x78')][_0x8fc8('0x114')](db[_0x8fc8('0x78')],{'as':_0x8fc8('0x17b'),'foreignKey':_0x8fc8('0x1aa'),'onDelete':_0x8fc8('0x111')});db[_0x8fc8('0x7a')][_0x8fc8('0x114')](db[_0x8fc8('0x7a')],{'as':_0x8fc8('0x1ab'),'foreignKey':'IntervalId','onDelete':_0x8fc8('0x111'),'hooks':!![],'required':![]});db[_0x8fc8('0x7a')][_0x8fc8('0x114')](db[_0x8fc8('0x117')],{'as':_0x8fc8('0x118'),'foreignKey':_0x8fc8('0x177'),'onDelete':_0x8fc8('0x164')});db[_0x8fc8('0x7a')][_0x8fc8('0x114')](db[_0x8fc8('0x168')],{'as':_0x8fc8('0x1ac'),'foreignKey':_0x8fc8('0x177')});db[_0x8fc8('0x7a')][_0x8fc8('0x114')](db['ChatApplication'],{'as':_0x8fc8('0x1ad'),'foreignKey':_0x8fc8('0x177')});db[_0x8fc8('0x7a')][_0x8fc8('0x114')](db['FaxApplication'],{'as':_0x8fc8('0x1ae'),'foreignKey':_0x8fc8('0x177')});db['Interval'][_0x8fc8('0x114')](db['SmsApplication'],{'as':_0x8fc8('0x1af'),'foreignKey':_0x8fc8('0x177')});db[_0x8fc8('0x81')]['belongsTo'](db[_0x8fc8('0x38')],{});db[_0x8fc8('0x81')]['belongsTo'](db[_0x8fc8('0x95')],{'foreignKey':_0x8fc8('0x1b0')});db['Schedule'][_0x8fc8('0x120')](db[_0x8fc8('0x94')],{'foreignKey':_0x8fc8('0x1b1')});db[_0x8fc8('0x83')]['belongsToMany'](db[_0x8fc8('0x17')],{'as':_0x8fc8('0x1b2'),'through':'moh_has_sounds','onDelete':_0x8fc8('0x164')});db[_0x8fc8('0x85')][_0x8fc8('0x122')](db[_0x8fc8('0x69')],{'through':'cm_contact_has_tags'});db['Tag'][_0x8fc8('0x122')](db['ChatInteraction'],{'through':_0x8fc8('0x1b3')});db[_0x8fc8('0x85')][_0x8fc8('0x122')](db[_0x8fc8('0x11c')],{'through':_0x8fc8('0x16f')});db[_0x8fc8('0x85')]['belongsToMany'](db[_0x8fc8('0x4f')],{'through':'sms_interaction_has_tags'});db[_0x8fc8('0x85')]['belongsToMany'](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0x8fc8('0x85')]['belongsToMany'](db[_0x8fc8('0x57')],{'through':_0x8fc8('0x18e')});db['Tag'][_0x8fc8('0x122')](db['WhatsappInteraction'],{'through':_0x8fc8('0x1b4')});db['CmContactHasItem'][_0x8fc8('0x120')](db[_0x8fc8('0x1b5')],{'as':_0x8fc8('0x1b6'),'foreignKey':_0x8fc8('0x1b7')});db['CmHopperAdditionalPhone'][_0x8fc8('0x120')](db[_0x8fc8('0x6b')],{'as':_0x8fc8('0x1b8'),'foreignKey':_0x8fc8('0x1b9')});db[_0x8fc8('0x88')]['belongsTo'](db[_0x8fc8('0x69')],{'as':_0x8fc8('0x160'),'foreignKey':_0x8fc8('0x19b')});db['Trigger'][_0x8fc8('0x114')](db[_0x8fc8('0x1a1')],{'as':{'plural':_0x8fc8('0x1ba'),'singular':_0x8fc8('0x1bb')},'foreignKey':_0x8fc8('0x1bc'),'onDelete':'cascade','hooks':!![]});db[_0x8fc8('0x8d')][_0x8fc8('0x114')](db['Condition'],{'as':{'plural':_0x8fc8('0x1bd'),'singular':_0x8fc8('0x1be')},'foreignKey':_0x8fc8('0x1bf'),'onDelete':_0x8fc8('0x111'),'hooks':!![]});db[_0x8fc8('0x8d')][_0x8fc8('0x114')](db[_0x8fc8('0x74')],{'as':'Actions','foreignKey':_0x8fc8('0x1c0'),'onDelete':_0x8fc8('0x111'),'hooks':!![]});db[_0x8fc8('0x94')][_0x8fc8('0x114')](db['AnalyticFieldReport'],{'as':_0x8fc8('0x1c1'),'onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1b1'),'hooks':!![]});db[_0x8fc8('0x95')][_0x8fc8('0x114')](db[_0x8fc8('0x99')],{'as':_0x8fc8('0x1c1'),'onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1b0')});db['AnalyticMetric'][_0x8fc8('0x114')](db['AnalyticFieldReport'],{'as':_0x8fc8('0x1c1'),'onDelete':_0x8fc8('0x111'),'foreignKey':'MetricId'});db[_0x8fc8('0x99')][_0x8fc8('0x120')](db[_0x8fc8('0x1c2')],{'foreignKey':_0x8fc8('0x1c3')});db[_0x8fc8('0x9b')][_0x8fc8('0x114')](db[_0x8fc8('0x9d')],{'as':_0x8fc8('0x1c4'),'onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1c5')});db[_0x8fc8('0x9d')][_0x8fc8('0x114')](db[_0x8fc8('0x9f')],{'as':_0x8fc8('0x1c6'),'onDelete':_0x8fc8('0x111'),'foreignKey':'SubjectId'});db[_0x8fc8('0x9d')][_0x8fc8('0x114')](db[_0x8fc8('0x9f')],{'as':_0x8fc8('0x1c7'),'onDelete':_0x8fc8('0x111'),'foreignKey':'DescriptionId'});db[_0x8fc8('0x9d')][_0x8fc8('0x114')](db['SalesforceField'],{'as':_0x8fc8('0x1c1'),'onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1c8')});db['SalesforceConfiguration']['belongsTo'](db[_0x8fc8('0x9b')],{'as':_0x8fc8('0x175'),'foreignKey':'AccountId'});db[_0x8fc8('0x9f')]['hasMany'](db[_0x8fc8('0x9f')],{'as':_0x8fc8('0x1c9'),'foreignKey':'SubjectId'});db['SalesforceField'][_0x8fc8('0x114')](db[_0x8fc8('0x9f')],{'as':'Description','foreignKey':_0x8fc8('0x1ca')});db['SalesforceField'][_0x8fc8('0x114')](db['SalesforceField'],{'as':'Field','foreignKey':_0x8fc8('0x1c8')});db[_0x8fc8('0x9f')]['belongsTo'](db[_0x8fc8('0x1cb')],{'as':_0x8fc8('0x1cb'),'foreignKey':_0x8fc8('0x1cc')});db[_0x8fc8('0xa1')][_0x8fc8('0x114')](db[_0x8fc8('0xa3')],{'as':'Configurations','onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1c5')});db[_0x8fc8('0xa3')]['hasMany'](db[_0x8fc8('0xa5')],{'as':_0x8fc8('0x1c6'),'onDelete':_0x8fc8('0x111'),'foreignKey':'SubjectId'});db['SugarcrmConfiguration']['hasMany'](db['SugarcrmField'],{'as':_0x8fc8('0x1c7'),'onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1ca')});db[_0x8fc8('0xa3')][_0x8fc8('0x114')](db['SugarcrmField'],{'as':_0x8fc8('0x1c1'),'onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1c8')});db[_0x8fc8('0xa3')][_0x8fc8('0x120')](db['SugarcrmAccount'],{'as':_0x8fc8('0x175'),'foreignKey':_0x8fc8('0x1c5')});db[_0x8fc8('0xa5')]['hasMany'](db[_0x8fc8('0xa5')],{'as':_0x8fc8('0x1c9'),'foreignKey':'SubjectId'});db[_0x8fc8('0xa5')]['hasMany'](db[_0x8fc8('0xa5')],{'as':_0x8fc8('0x1cd'),'foreignKey':_0x8fc8('0x1ca')});db[_0x8fc8('0xa5')][_0x8fc8('0x114')](db[_0x8fc8('0xa5')],{'as':_0x8fc8('0x1ce'),'foreignKey':_0x8fc8('0x1c8')});db['SugarcrmField'][_0x8fc8('0x120')](db[_0x8fc8('0x1cb')],{'as':'Variable','foreignKey':_0x8fc8('0x1cc')});db[_0x8fc8('0xa7')][_0x8fc8('0x114')](db['DeskConfiguration'],{'as':_0x8fc8('0x1c4'),'onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1c5')});db[_0x8fc8('0xa8')][_0x8fc8('0x114')](db[_0x8fc8('0xaa')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0x8fc8('0x1cf')});db[_0x8fc8('0xa8')][_0x8fc8('0x114')](db[_0x8fc8('0xaa')],{'as':_0x8fc8('0x1c7'),'onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1ca')});db[_0x8fc8('0xa8')]['hasMany'](db[_0x8fc8('0xaa')],{'as':_0x8fc8('0x1c1'),'onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1c8')});db[_0x8fc8('0xa8')][_0x8fc8('0x120')](db[_0x8fc8('0xa7')],{'as':_0x8fc8('0x175'),'foreignKey':'AccountId'});db[_0x8fc8('0xa8')][_0x8fc8('0x122')](db['Tag'],{'through':_0x8fc8('0x1d0')});db[_0x8fc8('0xaa')][_0x8fc8('0x114')](db[_0x8fc8('0xaa')],{'as':_0x8fc8('0x1c9'),'foreignKey':_0x8fc8('0x1cf')});db['DeskField'][_0x8fc8('0x114')](db[_0x8fc8('0xaa')],{'as':_0x8fc8('0x1cd'),'foreignKey':_0x8fc8('0x1ca')});db[_0x8fc8('0xaa')][_0x8fc8('0x114')](db[_0x8fc8('0xaa')],{'as':'Field','foreignKey':'FieldId'});db[_0x8fc8('0xaa')][_0x8fc8('0x120')](db[_0x8fc8('0x1cb')],{'as':'Variable','foreignKey':_0x8fc8('0x1cc')});db[_0x8fc8('0xac')][_0x8fc8('0x114')](db['ZohoConfiguration'],{'as':_0x8fc8('0x1c4'),'onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1c5')});db[_0x8fc8('0xae')][_0x8fc8('0x114')](db[_0x8fc8('0xb0')],{'as':'Subjects','onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1cf')});db[_0x8fc8('0xae')][_0x8fc8('0x114')](db[_0x8fc8('0xb0')],{'as':_0x8fc8('0x1c7'),'onDelete':_0x8fc8('0x111'),'foreignKey':'DescriptionId'});db[_0x8fc8('0xae')][_0x8fc8('0x114')](db[_0x8fc8('0xb0')],{'as':_0x8fc8('0x1c1'),'onDelete':'cascade','foreignKey':_0x8fc8('0x1c8')});db[_0x8fc8('0xae')][_0x8fc8('0x120')](db[_0x8fc8('0xac')],{'as':'Account','foreignKey':_0x8fc8('0x1c5')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':_0x8fc8('0x1c9'),'foreignKey':_0x8fc8('0x1cf')});db[_0x8fc8('0xb0')][_0x8fc8('0x114')](db['ZohoField'],{'as':_0x8fc8('0x1cd'),'foreignKey':'DescriptionId'});db[_0x8fc8('0xb0')][_0x8fc8('0x114')](db['ZohoField'],{'as':_0x8fc8('0x1ce'),'foreignKey':'FieldId'});db[_0x8fc8('0xb0')][_0x8fc8('0x120')](db['Variable'],{'as':_0x8fc8('0x1cb'),'foreignKey':_0x8fc8('0x1cc')});db[_0x8fc8('0xb2')][_0x8fc8('0x114')](db[_0x8fc8('0xb4')],{'as':_0x8fc8('0x1c4'),'onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1c5')});db[_0x8fc8('0xb4')][_0x8fc8('0x114')](db[_0x8fc8('0xb5')],{'as':_0x8fc8('0x1c6'),'foreignKey':'SubjectId'});db[_0x8fc8('0xb4')][_0x8fc8('0x114')](db['ZendeskField'],{'as':_0x8fc8('0x1c7'),'foreignKey':_0x8fc8('0x1ca')});db['ZendeskConfiguration'][_0x8fc8('0x114')](db[_0x8fc8('0xb5')],{'as':_0x8fc8('0x1c1'),'foreignKey':_0x8fc8('0x1c8')});db[_0x8fc8('0xb4')][_0x8fc8('0x120')](db[_0x8fc8('0xb2')],{'as':'Account','foreignKey':_0x8fc8('0x1c5')});db[_0x8fc8('0xb4')]['belongsToMany'](db['Tag'],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0x8fc8('0x114')](db[_0x8fc8('0xb5')],{'as':'Subject','foreignKey':_0x8fc8('0x1cf')});db[_0x8fc8('0xb5')][_0x8fc8('0x114')](db[_0x8fc8('0xb5')],{'as':_0x8fc8('0x1cd'),'foreignKey':_0x8fc8('0x1ca')});db['ZendeskField']['hasMany'](db['ZendeskField'],{'as':_0x8fc8('0x1ce'),'foreignKey':_0x8fc8('0x1c8')});db[_0x8fc8('0xb5')][_0x8fc8('0x120')](db[_0x8fc8('0x1cb')],{'as':_0x8fc8('0x1cb'),'foreignKey':'VariableId'});db[_0x8fc8('0x1d1')][_0x8fc8('0x114')](db['FreshdeskConfiguration'],{'as':'Configurations','onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1c5')});db['FreshdeskConfiguration'][_0x8fc8('0x114')](db[_0x8fc8('0xb9')],{'as':_0x8fc8('0x1c6'),'onDelete':_0x8fc8('0x111'),'foreignKey':'SubjectId'});db[_0x8fc8('0xb7')][_0x8fc8('0x114')](db[_0x8fc8('0xb9')],{'as':'Descriptions','onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1ca')});db[_0x8fc8('0xb7')][_0x8fc8('0x114')](db[_0x8fc8('0xb9')],{'as':_0x8fc8('0x1c1'),'onDelete':'cascade','foreignKey':_0x8fc8('0x1c8')});db[_0x8fc8('0xb7')]['belongsTo'](db['FreshdeskAccount'],{'as':_0x8fc8('0x175'),'foreignKey':_0x8fc8('0x1c5')});db[_0x8fc8('0xb7')]['belongsToMany'](db[_0x8fc8('0x85')],{'through':_0x8fc8('0x1d2')});db[_0x8fc8('0xb9')]['hasMany'](db[_0x8fc8('0xb9')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x8fc8('0xb9')][_0x8fc8('0x114')](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x8fc8('0xb9')]['hasMany'](db[_0x8fc8('0xb9')],{'as':_0x8fc8('0x1ce'),'foreignKey':'FieldId'});db[_0x8fc8('0xb9')][_0x8fc8('0x120')](db[_0x8fc8('0x1cb')],{'as':_0x8fc8('0x1cb'),'foreignKey':_0x8fc8('0x1cc')});db['VtigerAccount']['hasMany'](db[_0x8fc8('0xbb')],{'as':_0x8fc8('0x1c4'),'onDelete':'cascade','foreignKey':_0x8fc8('0x1c5')});db[_0x8fc8('0xbb')][_0x8fc8('0x114')](db[_0x8fc8('0xbd')],{'as':_0x8fc8('0x1c6'),'foreignKey':_0x8fc8('0x1cf')});db[_0x8fc8('0xbb')][_0x8fc8('0x114')](db['VtigerField'],{'as':_0x8fc8('0x1c7'),'foreignKey':_0x8fc8('0x1ca')});db[_0x8fc8('0xbb')]['hasMany'](db[_0x8fc8('0xbd')],{'as':_0x8fc8('0x1c1'),'foreignKey':_0x8fc8('0x1c8')});db['VtigerConfiguration'][_0x8fc8('0x120')](db[_0x8fc8('0x1d3')],{'as':'Account','foreignKey':_0x8fc8('0x1c5')});db[_0x8fc8('0xbd')]['hasMany'](db[_0x8fc8('0xbd')],{'as':_0x8fc8('0x1c9'),'foreignKey':_0x8fc8('0x1cf')});db[_0x8fc8('0xbd')][_0x8fc8('0x114')](db['VtigerField'],{'as':_0x8fc8('0x1cd'),'foreignKey':'DescriptionId'});db['VtigerField'][_0x8fc8('0x114')](db[_0x8fc8('0xbd')],{'as':_0x8fc8('0x1ce'),'foreignKey':_0x8fc8('0x1c8')});db['VtigerField'][_0x8fc8('0x120')](db[_0x8fc8('0x1cb')],{'as':_0x8fc8('0x1cb'),'foreignKey':_0x8fc8('0x1cc')});db[_0x8fc8('0xbf')][_0x8fc8('0x114')](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1c5')});db[_0x8fc8('0xc1')]['hasMany'](db['ServicenowField'],{'as':_0x8fc8('0x1c6'),'foreignKey':'SubjectId'});db['ServicenowConfiguration'][_0x8fc8('0x114')](db[_0x8fc8('0xc3')],{'as':'Descriptions','foreignKey':_0x8fc8('0x1ca')});db[_0x8fc8('0xc1')]['hasMany'](db[_0x8fc8('0xc3')],{'as':'Fields','foreignKey':'FieldId'});db['ServicenowConfiguration'][_0x8fc8('0x120')](db['ServicenowAccount'],{'as':_0x8fc8('0x175'),'foreignKey':_0x8fc8('0x1c5')});db[_0x8fc8('0xc3')][_0x8fc8('0x114')](db[_0x8fc8('0xc3')],{'as':'Subject','foreignKey':_0x8fc8('0x1cf')});db[_0x8fc8('0xc3')]['hasMany'](db['ServicenowField'],{'as':_0x8fc8('0x1cd'),'foreignKey':_0x8fc8('0x1ca')});db['ServicenowField'][_0x8fc8('0x114')](db[_0x8fc8('0xc3')],{'as':_0x8fc8('0x1ce'),'foreignKey':'FieldId'});db[_0x8fc8('0xc3')][_0x8fc8('0x120')](db['Variable'],{'as':_0x8fc8('0x1cb'),'foreignKey':'VariableId'});db['Dynamics365Account'][_0x8fc8('0x114')](db['Dynamics365Configuration'],{'as':_0x8fc8('0x1c4'),'onDelete':_0x8fc8('0x111'),'foreignKey':'AccountId'});db['Dynamics365Account'][_0x8fc8('0x120')](db[_0x8fc8('0x10a')],{'as':_0x8fc8('0x10a'),'foreignKey':_0x8fc8('0x163')});db[_0x8fc8('0xc7')][_0x8fc8('0x114')](db[_0x8fc8('0xc9')],{'as':_0x8fc8('0x1c6'),'onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1cf')});db['Dynamics365Configuration']['hasMany'](db[_0x8fc8('0xc9')],{'as':_0x8fc8('0x1c7'),'onDelete':_0x8fc8('0x111'),'foreignKey':'DescriptionId'});db[_0x8fc8('0xc7')][_0x8fc8('0x114')](db[_0x8fc8('0xc9')],{'as':'Fields','onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1c8')});db['Dynamics365Configuration']['belongsTo'](db[_0x8fc8('0xc5')],{'as':_0x8fc8('0x175'),'foreignKey':_0x8fc8('0x1c5')});db[_0x8fc8('0xc9')]['hasMany'](db['Dynamics365Field'],{'as':_0x8fc8('0x1c9'),'foreignKey':_0x8fc8('0x1cf')});db['Dynamics365Field'][_0x8fc8('0x114')](db[_0x8fc8('0xc9')],{'as':'Description','foreignKey':_0x8fc8('0x1ca')});db[_0x8fc8('0xc9')][_0x8fc8('0x114')](db[_0x8fc8('0xc9')],{'as':_0x8fc8('0x1ce'),'foreignKey':_0x8fc8('0x1c8')});db[_0x8fc8('0xc9')][_0x8fc8('0x120')](db[_0x8fc8('0x1cb')],{'as':_0x8fc8('0x1cb'),'foreignKey':_0x8fc8('0x1cc')});db[_0x8fc8('0xca')][_0x8fc8('0x114')](db[_0x8fc8('0xcb')],{'as':'Configurations','onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1c5')});db[_0x8fc8('0xcb')][_0x8fc8('0x114')](db[_0x8fc8('0xcd')],{'as':_0x8fc8('0x1c6'),'foreignKey':'SubjectId'});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0x8fc8('0x1c7'),'foreignKey':'DescriptionId'});db[_0x8fc8('0xcb')][_0x8fc8('0x114')](db[_0x8fc8('0xcd')],{'as':_0x8fc8('0x1c1'),'foreignKey':_0x8fc8('0x1c8')});db[_0x8fc8('0xcb')][_0x8fc8('0x120')](db[_0x8fc8('0xca')],{'as':'Account','foreignKey':_0x8fc8('0x1c5')});db[_0x8fc8('0xcd')]['hasMany'](db[_0x8fc8('0xcd')],{'as':_0x8fc8('0x1c9'),'foreignKey':_0x8fc8('0x1cf')});db[_0x8fc8('0xcd')][_0x8fc8('0x114')](db['FreshsalesField'],{'as':_0x8fc8('0x1cd'),'foreignKey':_0x8fc8('0x1ca')});db[_0x8fc8('0xcd')][_0x8fc8('0x114')](db[_0x8fc8('0xcd')],{'as':_0x8fc8('0x1ce'),'foreignKey':_0x8fc8('0x1c8')});db[_0x8fc8('0xcd')][_0x8fc8('0x120')](db[_0x8fc8('0x1cb')],{'as':_0x8fc8('0x1cb'),'foreignKey':'VariableId'});db[_0x8fc8('0xd1')][_0x8fc8('0x120')](db[_0x8fc8('0x138')],{});db['ChatQueueReport']['belongsTo'](db[_0x8fc8('0xf3')],{'as':_0x8fc8('0x17f'),'foreignKey':_0x8fc8('0x179')});db[_0x8fc8('0xd1')][_0x8fc8('0x120')](db[_0x8fc8('0x69')],{'as':_0x8fc8('0x160'),'foreignKey':'ContactId'});db[_0x8fc8('0xd1')][_0x8fc8('0x120')](db[_0x8fc8('0x5f')],{});db[_0x8fc8('0xd1')][_0x8fc8('0x120')](db[_0x8fc8('0x60')],{});db[_0x8fc8('0xd1')][_0x8fc8('0x120')](db['User'],{});db['ChatQueueReport'][_0x8fc8('0x120')](db[_0x8fc8('0x195')],{});db['ChatInternalMessage'][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'onDelete':'cascade','foreignKey':'FromId'});db[_0x8fc8('0xd2')]['belongsTo'](db[_0x8fc8('0x11')],{'onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1d4')});db[_0x8fc8('0xd5')][_0x8fc8('0x114')](db['JscriptyQuestionReport'],{'foreignKey':_0x8fc8('0x1d5'),'onDelete':_0x8fc8('0x111')});db[_0x8fc8('0xd5')][_0x8fc8('0x114')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':_0x8fc8('0x111')});db['SmsQueueReport'][_0x8fc8('0x120')](db['SmsAccount'],{});db['SmsQueueReport']['belongsTo'](db[_0x8fc8('0xf3')],{'as':_0x8fc8('0x17f'),'foreignKey':'ListId'});db[_0x8fc8('0x1d6')][_0x8fc8('0x120')](db['CmContact'],{'as':_0x8fc8('0x160'),'foreignKey':_0x8fc8('0x161')});db['SmsQueueReport'][_0x8fc8('0x120')](db[_0x8fc8('0x4f')],{});db[_0x8fc8('0x1d6')][_0x8fc8('0x120')](db[_0x8fc8('0x50')],{});db[_0x8fc8('0x1d6')][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{});db[_0x8fc8('0x1d6')]['belongsTo'](db[_0x8fc8('0x51')],{});db[_0x8fc8('0xd8')][_0x8fc8('0x114')](db[_0x8fc8('0xd5')],{'foreignKey':_0x8fc8('0x1d7')});db[_0x8fc8('0xd8')][_0x8fc8('0x114')](db[_0x8fc8('0x1d8')],{'foreignKey':'ProjectId'});db[_0x8fc8('0xd8')][_0x8fc8('0x114')](db[_0x8fc8('0x1d9')],{'foreignKey':_0x8fc8('0x1d7')});db[_0x8fc8('0xdb')][_0x8fc8('0x122')](db[_0x8fc8('0x11')],{'as':'Users','through':_0x8fc8('0x1da')});db[_0x8fc8('0xdf')][_0x8fc8('0x122')](db[_0x8fc8('0x11')],{'as':'Agents','through':_0x8fc8('0x129')});db['Team']['belongsToMany'](db[_0x8fc8('0x19')],{'through':_0x8fc8('0x157'),'as':_0x8fc8('0x12f')});db[_0x8fc8('0xdf')]['belongsToMany'](db[_0x8fc8('0x39')],{'through':'team_has_mail_queues','as':'MailQueues'});db[_0x8fc8('0xdf')][_0x8fc8('0x122')](db[_0x8fc8('0x195')],{'through':_0x8fc8('0x196'),'as':'ChatQueues'});db[_0x8fc8('0xdf')]['belongsToMany'](db[_0x8fc8('0x48')],{'through':'team_has_fax_queues','as':_0x8fc8('0x1db')});db[_0x8fc8('0xdf')]['belongsToMany'](db['SmsQueue'],{'through':'team_has_sms_queues','as':_0x8fc8('0x134')});db[_0x8fc8('0xdf')][_0x8fc8('0x122')](db['OpenchannelQueue'],{'through':_0x8fc8('0x1dc'),'as':_0x8fc8('0x1dd')});db['Team']['belongsToMany'](db[_0x8fc8('0x108')],{'through':_0x8fc8('0x1de'),'as':'WhatsappQueues'});db[_0x8fc8('0xdf')]['belongsToMany'](db['VoicePrefix'],{'through':_0x8fc8('0x10c'),'as':_0x8fc8('0x1df')});db['Campaign'][_0x8fc8('0x114')](db[_0x8fc8('0x6b')],{'as':_0x8fc8('0x14b'),'foreignKey':'CampaignId'});db['Campaign'][_0x8fc8('0x114')](db['CmHopperFinal'],{'as':_0x8fc8('0x14c'),'foreignKey':_0x8fc8('0x19f')});db['Campaign'][_0x8fc8('0x114')](db['CmHopperHistory'],{'as':_0x8fc8('0x14d'),'foreignKey':_0x8fc8('0x19f')});db[_0x8fc8('0xe3')][_0x8fc8('0x114')](db[_0x8fc8('0x6d')],{'as':_0x8fc8('0x14e'),'foreignKey':_0x8fc8('0x19f')});db[_0x8fc8('0xe3')][_0x8fc8('0x120')](db[_0x8fc8('0x26')],{'as':_0x8fc8('0x26'),'foreignKey':_0x8fc8('0x150')});db[_0x8fc8('0xe3')][_0x8fc8('0x120')](db[_0x8fc8('0x26')],{'as':_0x8fc8('0x151'),'foreignKey':_0x8fc8('0x152')});db['Campaign'][_0x8fc8('0x120')](db['Interval'],{'as':_0x8fc8('0x7a'),'foreignKey':_0x8fc8('0x177')});db[_0x8fc8('0xe3')][_0x8fc8('0x120')](db[_0x8fc8('0xdb')],{'as':_0x8fc8('0xdb'),'foreignKey':_0x8fc8('0x1e0')});db[_0x8fc8('0xe3')][_0x8fc8('0x122')](db[_0x8fc8('0xf3')],{'as':_0x8fc8('0x127'),'through':_0x8fc8('0x1e1')});db['Campaign'][_0x8fc8('0x122')](db['CmList'],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db[_0x8fc8('0xe7')][_0x8fc8('0x120')](db[_0x8fc8('0x62')],{'as':_0x8fc8('0x62'),'foreignKey':_0x8fc8('0x194')});db[_0x8fc8('0xeb')][_0x8fc8('0x120')](db['MailMessage'],{});db[_0x8fc8('0xeb')]['belongsTo'](db[_0x8fc8('0x11c')],{});db[_0x8fc8('0xeb')][_0x8fc8('0x120')](db[_0x8fc8('0x38')],{'foreignKey':_0x8fc8('0x1e2'),'as':'FromAccount'});db[_0x8fc8('0xeb')][_0x8fc8('0x120')](db['User'],{'foreignKey':_0x8fc8('0x1e3'),'as':_0x8fc8('0x1e4')});db[_0x8fc8('0xeb')][_0x8fc8('0x120')](db['User'],{'foreignKey':_0x8fc8('0x1e5'),'as':_0x8fc8('0x1e6')});db[_0x8fc8('0xeb')][_0x8fc8('0x120')](db[_0x8fc8('0x39')],{'foreignKey':_0x8fc8('0x1e7'),'as':'ToQueue'});db[_0x8fc8('0xeb')]['belongsTo'](db[_0x8fc8('0x38')],{'foreignKey':'ToMailAccountId','as':_0x8fc8('0x1e8')});db[_0x8fc8('0xed')][_0x8fc8('0x120')](db[_0x8fc8('0x60')],{});db[_0x8fc8('0xed')][_0x8fc8('0x120')](db[_0x8fc8('0x5f')],{});db[_0x8fc8('0xed')]['belongsTo'](db[_0x8fc8('0x138')],{'foreignKey':'FromChatWebsiteId','as':_0x8fc8('0x1e9')});db[_0x8fc8('0xed')][_0x8fc8('0x120')](db['User'],{'foreignKey':_0x8fc8('0x1e3'),'as':_0x8fc8('0x1e4')});db['ChatTransferReport']['belongsTo'](db[_0x8fc8('0x11')],{'foreignKey':_0x8fc8('0x1e5'),'as':_0x8fc8('0x1e6')});db[_0x8fc8('0xed')]['belongsTo'](db[_0x8fc8('0x195')],{'foreignKey':_0x8fc8('0x1ea'),'as':_0x8fc8('0x1eb')});db[_0x8fc8('0xed')][_0x8fc8('0x120')](db['ChatWebsite'],{'foreignKey':_0x8fc8('0x1ec'),'as':_0x8fc8('0x1e8')});db[_0x8fc8('0xef')][_0x8fc8('0x120')](db[_0x8fc8('0x180')],{});db[_0x8fc8('0xef')][_0x8fc8('0x120')](db['FaxInteraction'],{});db['FaxTransferReport'][_0x8fc8('0x120')](db['FaxAccount'],{'foreignKey':_0x8fc8('0x1ed'),'as':_0x8fc8('0x1e9')});db[_0x8fc8('0xef')][_0x8fc8('0x120')](db['User'],{'foreignKey':_0x8fc8('0x1e3'),'as':_0x8fc8('0x1e4')});db[_0x8fc8('0xef')][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'foreignKey':_0x8fc8('0x1e5'),'as':_0x8fc8('0x1e6')});db[_0x8fc8('0xef')][_0x8fc8('0x120')](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':_0x8fc8('0x1eb')});db[_0x8fc8('0xef')][_0x8fc8('0x120')](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':_0x8fc8('0x1e8')});db[_0x8fc8('0xf1')][_0x8fc8('0x120')](db[_0x8fc8('0x59')],{});db[_0x8fc8('0xf1')][_0x8fc8('0x120')](db[_0x8fc8('0x57')],{});db[_0x8fc8('0xf1')][_0x8fc8('0x120')](db[_0x8fc8('0x53')],{'foreignKey':_0x8fc8('0x1ee'),'as':_0x8fc8('0x1e9')});db[_0x8fc8('0xf1')][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'foreignKey':_0x8fc8('0x1e3'),'as':_0x8fc8('0x1e4')});db[_0x8fc8('0xf1')][_0x8fc8('0x120')](db['User'],{'foreignKey':_0x8fc8('0x1e5'),'as':_0x8fc8('0x1e6')});db[_0x8fc8('0xf1')][_0x8fc8('0x120')](db[_0x8fc8('0x135')],{'foreignKey':'ToOpenchannelQueueId','as':_0x8fc8('0x1eb')});db['OpenchannelTransferReport'][_0x8fc8('0x120')](db['OpenchannelAccount'],{'foreignKey':_0x8fc8('0x1ef'),'as':_0x8fc8('0x1e8')});db[_0x8fc8('0x1f0')][_0x8fc8('0x120')](db[_0x8fc8('0x50')],{});db[_0x8fc8('0x1f0')][_0x8fc8('0x120')](db['SmsInteraction'],{});db[_0x8fc8('0x1f0')][_0x8fc8('0x120')](db[_0x8fc8('0x4b')],{'foreignKey':_0x8fc8('0x1f1'),'as':'FromAccount'});db['SmsTransferReport'][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'foreignKey':_0x8fc8('0x1e3'),'as':_0x8fc8('0x1e4')});db['SmsTransferReport'][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'foreignKey':_0x8fc8('0x1e5'),'as':_0x8fc8('0x1e6')});db['SmsTransferReport'][_0x8fc8('0x120')](db[_0x8fc8('0x51')],{'foreignKey':_0x8fc8('0x1f2'),'as':'ToQueue'});db[_0x8fc8('0x1f0')]['belongsTo'](db['SmsAccount'],{'foreignKey':_0x8fc8('0x1f3'),'as':_0x8fc8('0x1e8')});db[_0x8fc8('0xf3')][_0x8fc8('0x114')](db[_0x8fc8('0x78')],{'as':_0x8fc8('0x17b'),'foreignKey':'ListId','onDelete':_0x8fc8('0x111')});db[_0x8fc8('0xf3')][_0x8fc8('0x114')](db[_0x8fc8('0x73')],{'as':_0x8fc8('0x1f4'),'foreignKey':_0x8fc8('0x179')});db[_0x8fc8('0xf3')][_0x8fc8('0x114')](db[_0x8fc8('0x69')],{'as':_0x8fc8('0x125'),'onDelete':_0x8fc8('0x111'),'foreignKey':'ListId'});db[_0x8fc8('0xf3')][_0x8fc8('0x114')](db['CmHopperFinal'],{'as':_0x8fc8('0x14c'),'foreignKey':'ListId'});db['CmList'][_0x8fc8('0x114')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0x8fc8('0x179')});db[_0x8fc8('0xf3')][_0x8fc8('0x114')](db[_0x8fc8('0x71')],{'as':_0x8fc8('0x71'),'foreignKey':'ListId'});db['CmList'][_0x8fc8('0x122')](db['VoiceQueue'],{'as':'Queues','through':_0x8fc8('0x1f5')});db[_0x8fc8('0xf3')][_0x8fc8('0x122')](db['User'],{'as':_0x8fc8('0x155'),'through':_0x8fc8('0x128')});db[_0x8fc8('0xf5')][_0x8fc8('0x114')](db['VoiceExtension'],{'as':_0x8fc8('0x118'),'onDelete':_0x8fc8('0x111')});db[_0x8fc8('0xf5')]['belongsToMany'](db[_0x8fc8('0x11')],{'as':'Agents','through':_0x8fc8('0x10e')});db['VoicePrefix']['belongsToMany'](db[_0x8fc8('0xdf')],{'through':'TeamVoicePrefix','as':_0x8fc8('0x156')});db[_0x8fc8('0xf7')][_0x8fc8('0x114')](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x172'),'foreignKey':_0x8fc8('0x121')});db[_0x8fc8('0xf7')]['hasMany'](db[_0x8fc8('0xf9')],{'as':_0x8fc8('0x1f6'),'foreignKey':_0x8fc8('0x121'),'onDelete':_0x8fc8('0x111')});db['UserProfileSection'][_0x8fc8('0x114')](db[_0x8fc8('0xfb')],{'as':'Resources','foreignKey':_0x8fc8('0x1f7'),'onDelete':_0x8fc8('0x111')});db['WhatsappAccount']['hasMany'](db[_0x8fc8('0x78')],{'as':'Dispositions','foreignKey':_0x8fc8('0x1f8'),'onDelete':'cascade'});db[_0x8fc8('0x140')][_0x8fc8('0x114')](db[_0x8fc8('0x76')],{'as':_0x8fc8('0x17d'),'foreignKey':_0x8fc8('0x1f8')});db['WhatsappAccount']['hasMany'](db[_0x8fc8('0x102')],{'as':_0x8fc8('0x16c'),'foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0x8fc8('0x114')](db[_0x8fc8('0x100')],{'as':'Interactions'});db[_0x8fc8('0x140')][_0x8fc8('0x114')](db[_0x8fc8('0x1f9')],{'as':_0x8fc8('0x146')});db[_0x8fc8('0x140')]['belongsTo'](db[_0x8fc8('0xf3')],{'as':'List','foreignKey':_0x8fc8('0x179')});db[_0x8fc8('0x140')][_0x8fc8('0x120')](db[_0x8fc8('0x7c')],{'as':'mandatoryDispositionPause','foreignKey':_0x8fc8('0x154')});db[_0x8fc8('0x140')][_0x8fc8('0x122')](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x155'),'through':_0x8fc8('0x142')});db[_0x8fc8('0x1f9')][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'onDelete':_0x8fc8('0x164')});db[_0x8fc8('0x1f9')]['belongsTo'](db[_0x8fc8('0x108')],{'onDelete':_0x8fc8('0x164')});db['WhatsappApplication']['belongsTo'](db[_0x8fc8('0x140')],{'onDelete':'restrict'});db[_0x8fc8('0x1f9')][_0x8fc8('0x120')](db[_0x8fc8('0x7a')],{'onDelete':_0x8fc8('0x164'),'foreignKey':_0x8fc8('0x177')});db[_0x8fc8('0x1f9')][_0x8fc8('0x120')](db[_0x8fc8('0x85')],{'onDelete':_0x8fc8('0x164'),'foreignKey':_0x8fc8('0x178')});db[_0x8fc8('0x100')][_0x8fc8('0x114')](db['WhatsappMessage'],{'as':'Messages','onDelete':_0x8fc8('0x111'),'foreignKey':_0x8fc8('0x1fa')});db[_0x8fc8('0x100')][_0x8fc8('0x120')](db[_0x8fc8('0x140')],{'as':'Account','foreignKey':_0x8fc8('0x1f8')});db[_0x8fc8('0x100')]['belongsTo'](db[_0x8fc8('0x69')],{'as':_0x8fc8('0x160'),'foreignKey':_0x8fc8('0x161')});db[_0x8fc8('0x100')][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x16e'),'foreignKey':_0x8fc8('0x113')});db[_0x8fc8('0x100')][_0x8fc8('0x122')](db[_0x8fc8('0x85')],{'through':'whatsapp_interaction_has_tags','as':_0x8fc8('0x170')});db[_0x8fc8('0x100')]['belongsToMany'](db[_0x8fc8('0x85')],{'through':_0x8fc8('0x1b4'),'as':_0x8fc8('0x171')});db[_0x8fc8('0x100')]['belongsToMany'](db['User'],{'as':_0x8fc8('0x172'),'through':_0x8fc8('0x12e'),'foreignKey':_0x8fc8('0x1fa')});db[_0x8fc8('0x102')][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x11')});db['WhatsappMessage'][_0x8fc8('0x120')](db[_0x8fc8('0x69')],{'onDelete':_0x8fc8('0x111'),'as':_0x8fc8('0x160')});db[_0x8fc8('0x102')]['belongsTo'](db[_0x8fc8('0x100')],{'onDelete':_0x8fc8('0x111'),'as':_0x8fc8('0x174'),'foreignKey':_0x8fc8('0x1fa')});db[_0x8fc8('0x102')][_0x8fc8('0x120')](db['WhatsappAccount'],{'as':_0x8fc8('0x175'),'foreignKey':_0x8fc8('0x1f8')});db[_0x8fc8('0x104')][_0x8fc8('0x120')](db[_0x8fc8('0x140')],{});db[_0x8fc8('0x104')]['belongsTo'](db[_0x8fc8('0xf3')],{'as':_0x8fc8('0x17f'),'foreignKey':_0x8fc8('0x179')});db[_0x8fc8('0x104')][_0x8fc8('0x120')](db['CmContact'],{'as':_0x8fc8('0x160'),'foreignKey':_0x8fc8('0x161')});db[_0x8fc8('0x104')][_0x8fc8('0x120')](db[_0x8fc8('0x100')],{});db[_0x8fc8('0x104')][_0x8fc8('0x120')](db['WhatsappQueue'],{});db[_0x8fc8('0x104')][_0x8fc8('0x120')](db[_0x8fc8('0x102')],{});db[_0x8fc8('0x104')][_0x8fc8('0x120')](db['User'],{});db[_0x8fc8('0x106')][_0x8fc8('0x120')](db['WhatsappMessage'],{});db[_0x8fc8('0x106')][_0x8fc8('0x120')](db[_0x8fc8('0x100')],{});db['WhatsappTransferReport'][_0x8fc8('0x120')](db['WhatsappAccount'],{'foreignKey':_0x8fc8('0x1fb'),'as':'FromAccount'});db[_0x8fc8('0x106')][_0x8fc8('0x120')](db[_0x8fc8('0x140')],{'foreignKey':_0x8fc8('0x1fc'),'as':_0x8fc8('0x1e8')});db[_0x8fc8('0x106')][_0x8fc8('0x120')](db['WhatsappQueue'],{'foreignKey':_0x8fc8('0x1fd'),'as':'ToQueue'});db[_0x8fc8('0x106')][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'foreignKey':'FromUserId','as':_0x8fc8('0x1e4')});db[_0x8fc8('0x106')][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'foreignKey':_0x8fc8('0x1e5'),'as':_0x8fc8('0x1e6')});db[_0x8fc8('0x108')][_0x8fc8('0x122')](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x155'),'through':'UserWhatsappQueue','foreignKey':_0x8fc8('0x1fe')});db[_0x8fc8('0x108')][_0x8fc8('0x122')](db[_0x8fc8('0xdf')],{'through':_0x8fc8('0x1de'),'as':_0x8fc8('0x156')});db[_0x8fc8('0x1ff')][_0x8fc8('0x120')](db[_0x8fc8('0x11')],{'as':_0x8fc8('0x200'),'foreignKey':_0x8fc8('0x113'),'onDelete':'cascade','hooks':!![]});db[_0x8fc8('0x10a')][_0x8fc8('0x110')](db[_0x8fc8('0xc5')],{'as':_0x8fc8('0xc5'),'onDelete':_0x8fc8('0x164')});db['CloudProvider'][_0x8fc8('0x110')](db[_0x8fc8('0x34')],{'as':'Imap','onDelete':_0x8fc8('0x164')});db['CloudProvider']['hasOne'](db[_0x8fc8('0x36')],{'as':_0x8fc8('0x166'),'onDelete':_0x8fc8('0x164')});module[_0x8fc8('0x201')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x9b90=['MailQueues','ChatQueues','SmsQueues','WhatsappQueues','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','VoiceChanSpy','Applications','moh_has_sounds','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','BlackLists','ScreenRecording','VoiceMailMessage','Messages','mailboxuser','mailbox','VoiceCallReport','QueueCalls','AgentReports','uniqueid','Contact','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','Interactions','List','ListId','Template','TemplateId','mandatoryDispositionPauseId','team_has_mail_queues','MailInteractionId','Account','mail_interaction_has_tags','Tags','ThroughTags','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','ContactId','DashboardItem','Items','FaxAccountId','Answers','FaxApplication','FaxInteractionId','Owner','fax_interaction_has_tags','Users','AttachmentId','team_has_fax_queues','Teams','FaxQueueReport','SmsAccountId','SmsAccount','SmsInteractionId','sms_interaction_has_tags','UserSmsQueue','SmsQueueId','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelMessage','openchannel_interaction_has_tags','OpenchannelInteractionId','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatGroupId','Members','CompanyId','Phones','CmCompany','cm_contact_has_tags','AdditionalPhones','CmHopperId','Agent','Campaign','OwnerId','CampaignId','All','Any','OneAny','AutomationId','ParentId','Intervals','MailApplications','FaxApplications','SmsApplications','DefaultReportId','Mohs','CmContactHasItem','ItemType','CmContactId','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','AnalyticFieldReport','Fields','CustomReportId','AnalyticDefaultReport','MetricId','SalesforceAccount','Configurations','AccountId','Subjects','SubjectId','DescriptionId','FieldId','Subject','Description','Field','VariableId','SugarcrmField','Descriptions','DeskConfiguration','DeskField','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','ChatQueueReport','FromId','ToId','SessionId','ProjectId','VoiceQueues','team_has_chat_queues','FaxQueues','team_has_sms_queues','team_has_openchannel_queues','OpenchannelQueues','team_has_whatsapp_queues','TeamVoicePrefix','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','whatsapp_interaction_has_tags','user_has_whatsapp_interactions','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','exports','../config/environment','lodash','jstz','determine','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','mysql','utf8','utf8_general_ci','sequelizeHistory','utf8mb4','name','database','username','password','options','User','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','UserId','Recordings','hasMany','VoiceQueuesRt','Extensions','CmHopperFinal','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','belongsTo','UserProfile','userProfileId','belongsToMany','ChatGroup','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteraction','user_has_openchannel_interactions','VoicePrefixes','UserVoicePrefix'];(function(_0x64205f,_0x560e73){var _0x409d80=function(_0x1f6e9a){while(--_0x1f6e9a){_0x64205f['push'](_0x64205f['shift']());}};_0x409d80(++_0x560e73);}(_0x9b90,0xcf));var _0x09b9=function(_0x41236c,_0x5ce215){_0x41236c=_0x41236c-0x0;var _0x446f98=_0x9b90[_0x41236c];return _0x446f98;};'use strict';var config=require(_0x09b9('0x0'));var Sequelize=require('sequelize');var _=require(_0x09b9('0x1'));var jstz=require(_0x09b9('0x2'));var timezone=jstz[_0x09b9('0x3')]();config[_0x09b9('0x4')]=_[_0x09b9('0x5')](config[_0x09b9('0x4')],{'database':_0x09b9('0x6'),'username':_0x09b9('0x7'),'password':_0x09b9('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x09b9('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x09b9('0xa'),'collate':_0x09b9('0xb')}}});config[_0x09b9('0xc')]=_[_0x09b9('0x5')](config[_0x09b9('0xc')],{'database':_0x09b9('0x6'),'username':_0x09b9('0x7'),'password':_0x09b9('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x09b9('0xd')},'logging':![],'timezone':timezone[_0x09b9('0xe')](),'define':{'charset':'utf8','collate':_0x09b9('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x09b9('0x4')][_0x09b9('0xf')],config[_0x09b9('0x4')][_0x09b9('0x10')],config['sequelize'][_0x09b9('0x11')],config[_0x09b9('0x4')][_0x09b9('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x09b9('0xf')],config['sequelizeHistory'][_0x09b9('0x10')],config[_0x09b9('0xc')][_0x09b9('0x11')],config['sequelizeHistory'][_0x09b9('0x12')])};db[_0x09b9('0x13')]=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/user/user.model');db['VoiceChanSpy']=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x15'));db[_0x09b9('0x16')]=db[_0x09b9('0x4')]['import']('../api/voiceContext/voiceContext.model');db[_0x09b9('0x17')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x18'));db[_0x09b9('0x19')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x1a'));db[_0x09b9('0x1b')]=db['sequelize'][_0x09b9('0x14')](_0x09b9('0x1c'));db[_0x09b9('0x1d')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x1e'));db['ScreenRecording']=db[_0x09b9('0x4')]['import']('../api/screenRecording/screenRecording.model');db[_0x09b9('0x1f')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x20'));db['VoiceMailMessage']=db['sequelize']['import'](_0x09b9('0x21'));db['VoiceCallReport']=db['sequelize'][_0x09b9('0x14')]('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/voiceDialReport/voiceDialReport.model');db[_0x09b9('0x22')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x23'));db[_0x09b9('0x24')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x25'));db[_0x09b9('0x26')]=db[_0x09b9('0x4')]['import'](_0x09b9('0x27'));db['Trunk']=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x28'));db['VoiceTransferReport']=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x09b9('0x29')]=db[_0x09b9('0x4')]['import']('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x09b9('0x2a')]=db[_0x09b9('0x4')]['import'](_0x09b9('0x2b'));db[_0x09b9('0x2c')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x2d'));db[_0x09b9('0x2e')]=db[_0x09b9('0x4')]['import'](_0x09b9('0x2f'));db[_0x09b9('0x30')]=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/userFaxQueue/userFaxQueue.model');db['UserSmsQueue']=db['sequelize'][_0x09b9('0x14')](_0x09b9('0x31'));db[_0x09b9('0x32')]=db[_0x09b9('0x4')]['import'](_0x09b9('0x33'));db[_0x09b9('0x34')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x35'));db[_0x09b9('0x36')]=db['sequelize']['import']('../api/mailServerIn/mailServerIn.model');db[_0x09b9('0x37')]=db['sequelize']['import'](_0x09b9('0x38'));db[_0x09b9('0x39')]=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/mailAccount/mailAccount.model');db[_0x09b9('0x3a')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x3b'));db[_0x09b9('0x3c')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x3d'));db[_0x09b9('0x3e')]=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/mailInteraction/mailInteraction.model');db[_0x09b9('0x3f')]=db[_0x09b9('0x4')]['import']('../api/mailMessage/mailMessage.model');db[_0x09b9('0x40')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x41'));db[_0x09b9('0x42')]=db['sequelize']['import'](_0x09b9('0x43'));db['Dashboard']=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x44'));db['DashboardItem']=db[_0x09b9('0x4')]['import'](_0x09b9('0x45'));db[_0x09b9('0x46')]=db['sequelize']['import'](_0x09b9('0x47'));db['FaxApplication']=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x48'));db[_0x09b9('0x49')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x4a'));db[_0x09b9('0x4b')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x4c'));db[_0x09b9('0x4d')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x4e'));db['FaxQueueReport']=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x4f'));db[_0x09b9('0x50')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x51'));db[_0x09b9('0x52')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x53'));db[_0x09b9('0x54')]=db[_0x09b9('0x4')]['import']('../api/smsMessage/smsMessage.model');db[_0x09b9('0x55')]=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/smsQueue/smsQueue.model');db[_0x09b9('0x56')]=db[_0x09b9('0x4')]['import'](_0x09b9('0x57'));db['OpenchannelApplication']=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/openchannelApplication/openchannelApplication.model');db['OpenchannelInteraction']=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x58'));db['OpenchannelMessage']=db[_0x09b9('0x4')]['import'](_0x09b9('0x59'));db[_0x09b9('0x5a')]=db['sequelize']['import'](_0x09b9('0x5b'));db[_0x09b9('0x5c')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x5d'));db[_0x09b9('0x5e')]=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x09b9('0x5f')]=db['sequelize'][_0x09b9('0x14')](_0x09b9('0x60'));db['ChatInteraction']=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x61'));db[_0x09b9('0x62')]=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/chatMessage/chatMessage.model');db[_0x09b9('0x63')]=db[_0x09b9('0x4')]['import'](_0x09b9('0x64'));db[_0x09b9('0x65')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x66'));db['ChatGroup']=db[_0x09b9('0x4')]['import']('../api/chatGroup/chatGroup.model');db[_0x09b9('0x67')]=db[_0x09b9('0x4')]['import'](_0x09b9('0x68'));db['CmCompany']=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x69'));db['CmContact']=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x6a'));db[_0x09b9('0x6b')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x6c'));db[_0x09b9('0x6d')]=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/cmHopperFinal/cmHopperFinal.model');db['CmHopperHistory']=db[_0x09b9('0x4')]['import']('../api/cmHopperHistory/cmHopperHistory.model');db[_0x09b9('0x6e')]=db['sequelize'][_0x09b9('0x14')](_0x09b9('0x6f'));db[_0x09b9('0x70')]=db['sequelize'][_0x09b9('0x14')](_0x09b9('0x71'));db[_0x09b9('0x72')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x73'));db[_0x09b9('0x74')]=db[_0x09b9('0x4')]['import'](_0x09b9('0x75'));db[_0x09b9('0x76')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x77'));db[_0x09b9('0x78')]=db['sequelize']['import']('../api/disposition/disposition.model');db[_0x09b9('0x79')]=db[_0x09b9('0x4')]['import'](_0x09b9('0x7a'));db[_0x09b9('0x7b')]=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/interval/interval.model');db[_0x09b9('0x7c')]=db['sequelize']['import'](_0x09b9('0x7d'));db[_0x09b9('0x7e')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x7f'));db[_0x09b9('0x80')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x81'));db[_0x09b9('0x82')]=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/schedule/schedule.model');db[_0x09b9('0x83')]=db['sequelize']['import'](_0x09b9('0x84'));db[_0x09b9('0x85')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x86'));db[_0x09b9('0x87')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x88'));db['CmContactHasItem']=db['sequelize'][_0x09b9('0x14')](_0x09b9('0x89'));db[_0x09b9('0x8a')]=db['sequelize'][_0x09b9('0x14')](_0x09b9('0x8b'));db['Template']=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/template/template.model');db[_0x09b9('0x8c')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x8d'));db[_0x09b9('0x8e')]=db['sequelize'][_0x09b9('0x14')](_0x09b9('0x8f'));db[_0x09b9('0x90')]=db['sequelize']['import']('../api/integration/integration.model');db[_0x09b9('0x91')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x92'));db['AnalyticCustomReport']=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/analyticCustomReport/analyticCustomReport.model');db['AnalyticDefaultReport']=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x09b9('0x93')]=db[_0x09b9('0x4')]['import'](_0x09b9('0x94'));db[_0x09b9('0x95')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x96'));db['AnalyticFieldReport']=db[_0x09b9('0x4')]['import'](_0x09b9('0x97'));db['AnalyticTreeReport']=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x98'));db['SalesforceAccount']=db['sequelize'][_0x09b9('0x14')](_0x09b9('0x99'));db[_0x09b9('0x9a')]=db['sequelize']['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x09b9('0x9b')]=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/intSalesforceField/intSalesforceField.model');db[_0x09b9('0x9c')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x9d'));db[_0x09b9('0x9e')]=db[_0x09b9('0x4')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db['SugarcrmField']=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x9f'));db[_0x09b9('0xa0')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xa1'));db['DeskConfiguration']=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db['sequelize'][_0x09b9('0x14')](_0x09b9('0xa2'));db[_0x09b9('0xa3')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xa4'));db[_0x09b9('0xa5')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xa6'));db[_0x09b9('0xa7')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xa8'));db[_0x09b9('0xa9')]=db['sequelize'][_0x09b9('0x14')](_0x09b9('0xaa'));db[_0x09b9('0xab')]=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x09b9('0xac')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xad'));db[_0x09b9('0xae')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xaf'));db[_0x09b9('0xb0')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xb1'));db[_0x09b9('0xb2')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xb3'));db[_0x09b9('0xb4')]=db[_0x09b9('0x4')]['import'](_0x09b9('0xb5'));db['VtigerConfiguration']=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xb6'));db[_0x09b9('0xb7')]=db['sequelize'][_0x09b9('0x14')]('../api/intVtigerField/intVtigerField.model');db[_0x09b9('0xb8')]=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0x09b9('0xb9')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xba'));db[_0x09b9('0xbb')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xbc'));db[_0x09b9('0xbd')]=db['sequelize']['import'](_0x09b9('0xbe'));db[_0x09b9('0xbf')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xc0'));db[_0x09b9('0xc1')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xc2'));db[_0x09b9('0xc3')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xc4'));db[_0x09b9('0xc5')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xc6'));db[_0x09b9('0xc7')]=db['sequelize'][_0x09b9('0x14')](_0x09b9('0xc8'));db[_0x09b9('0x90')]=db['sequelize'][_0x09b9('0x14')](_0x09b9('0xc9'));db[_0x09b9('0xca')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xcb'));db['ChatQueueReport']=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xcc'));db[_0x09b9('0xcd')]=db['sequelize']['import'](_0x09b9('0xce'));db[_0x09b9('0xcf')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xd0'));db[_0x09b9('0xd1')]=db['sequelize'][_0x09b9('0x14')](_0x09b9('0xd2'));db[_0x09b9('0xd3')]=db[_0x09b9('0x4')]['import'](_0x09b9('0xd4'));db[_0x09b9('0xd5')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xd6'));db[_0x09b9('0xd7')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xd8'));db['SquareDetailsReport']=db[_0x09b9('0x4')]['import'](_0x09b9('0xd9'));db[_0x09b9('0xda')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xdb'));db[_0x09b9('0xdc')]=db[_0x09b9('0x4')]['import']('../api/setting/setting.model');db[_0x09b9('0xdd')]=db[_0x09b9('0x4')]['import']('../api/squareOdbc/squareOdbc.model');db[_0x09b9('0xde')]=db[_0x09b9('0x4')]['import'](_0x09b9('0xdf'));db[_0x09b9('0xe0')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xe1'));db['SquareMessage']=db[_0x09b9('0x4')]['import'](_0x09b9('0xe2'));db[_0x09b9('0xe3')]=db[_0x09b9('0x4')]['import'](_0x09b9('0xe4'));db[_0x09b9('0xe5')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xe6'));db['Campaign']=db['sequelize'][_0x09b9('0x14')](_0x09b9('0xe7'));db[_0x09b9('0xe8')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xe9'));db[_0x09b9('0xea')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xeb'));db['Plugin']=db['sequelize'][_0x09b9('0x14')](_0x09b9('0xec'));db[_0x09b9('0xed')]=db['sequelize'][_0x09b9('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0x09b9('0xee')]=db['sequelize'][_0x09b9('0x14')]('../api/chatTransferReport/chatTransferReport.model');db[_0x09b9('0xef')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xf0'));db[_0x09b9('0xf1')]=db['sequelize'][_0x09b9('0x14')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x09b9('0xf2')]=db['sequelize'][_0x09b9('0x14')]('../api/smsTransferReport/smsTransferReport.model');db[_0x09b9('0xf3')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xf4'));db[_0x09b9('0xf5')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xf6'));db['UserProfile']=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xf7'));db[_0x09b9('0xf8')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0xf9'));db[_0x09b9('0xfa')]=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/userProfileResource/userProfileResource.model');db['UserNotification']=db[_0x09b9('0x4')]['import'](_0x09b9('0xfb'));db[_0x09b9('0xfc')]=db['sequelize'][_0x09b9('0x14')](_0x09b9('0xfd'));db['WhatsappApplication']=db['sequelize'][_0x09b9('0x14')](_0x09b9('0xfe'));db[_0x09b9('0xff')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x100'));db[_0x09b9('0x101')]=db['sequelize'][_0x09b9('0x14')](_0x09b9('0x102'));db[_0x09b9('0x103')]=db['sequelize']['import'](_0x09b9('0x104'));db[_0x09b9('0x105')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x106'));db[_0x09b9('0x107')]=db['sequelize'][_0x09b9('0x14')]('../api/whatsappQueue/whatsappQueue.model');db[_0x09b9('0x108')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x109'));db[_0x09b9('0x10a')]=db[_0x09b9('0x4')][_0x09b9('0x14')]('../api/teamVoiceQueue/teamVoiceQueue.model');db['TeamVoicePrefix']=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x10b'));db['UserVoicePrefix']=db[_0x09b9('0x4')]['import'](_0x09b9('0x10c'));db[_0x09b9('0x10d')]=db[_0x09b9('0x4')][_0x09b9('0x14')](_0x09b9('0x10e'));db['User'][_0x09b9('0x10f')](db[_0x09b9('0x1f')],{'as':_0x09b9('0x1f'),'onDelete':_0x09b9('0x110'),'foreignKey':'UserId'});db[_0x09b9('0x13')][_0x09b9('0x10f')](db[_0x09b9('0x10d')],{'as':'userSetting','onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x111')});db[_0x09b9('0x13')]['hasMany'](db[_0x09b9('0x1d')],{'as':_0x09b9('0x112'),'foreignKey':_0x09b9('0x111')});db[_0x09b9('0x13')][_0x09b9('0x113')](db[_0x09b9('0x29')],{'as':_0x09b9('0x114'),'foreignKey':_0x09b9('0x111')});db[_0x09b9('0x13')][_0x09b9('0x113')](db[_0x09b9('0x17')],{'as':_0x09b9('0x115'),'onDelete':_0x09b9('0x110'),'hooks':!![]});db['User'][_0x09b9('0x113')](db[_0x09b9('0x116')],{'as':_0x09b9('0x117'),'foreignKey':_0x09b9('0x111')});db[_0x09b9('0x13')][_0x09b9('0x113')](db[_0x09b9('0x118')],{'as':_0x09b9('0x119'),'foreignKey':_0x09b9('0x111')});db[_0x09b9('0x13')][_0x09b9('0x113')](db[_0x09b9('0x6e')],{'as':'ReportAgentPreview','foreignKey':_0x09b9('0x111')});db[_0x09b9('0x13')][_0x09b9('0x113')](db['OpenchannelInteraction'],{'as':_0x09b9('0x11a'),'foreignKey':_0x09b9('0x111')});db[_0x09b9('0x13')]['hasMany'](db[_0x09b9('0x11b')],{'as':_0x09b9('0x11c'),'foreignKey':_0x09b9('0x111')});db[_0x09b9('0x13')]['hasMany'](db[_0x09b9('0x52')],{'as':_0x09b9('0x11d'),'foreignKey':_0x09b9('0x111')});db['User'][_0x09b9('0x113')](db[_0x09b9('0x49')],{'as':_0x09b9('0x11e'),'foreignKey':'UserId'});db[_0x09b9('0x13')][_0x09b9('0x113')](db['MailInteraction'],{'as':_0x09b9('0x11f'),'foreignKey':_0x09b9('0x111')});db[_0x09b9('0x13')]['hasMany'](db[_0x09b9('0xff')],{'as':_0x09b9('0x120'),'foreignKey':'UserId'});db[_0x09b9('0x13')][_0x09b9('0x113')](db[_0x09b9('0x121')],{'as':_0x09b9('0x122'),'foreignKey':'SenderId'});db[_0x09b9('0x13')][_0x09b9('0x123')](db[_0x09b9('0x124')],{'as':_0x09b9('0x124'),'foreignKey':_0x09b9('0x125')});db[_0x09b9('0x13')][_0x09b9('0x126')](db[_0x09b9('0x127')],{'as':_0x09b9('0x128'),'through':_0x09b9('0x129')});db[_0x09b9('0x13')][_0x09b9('0x126')](db[_0x09b9('0x12a')],{'as':_0x09b9('0x12b'),'through':_0x09b9('0x12c')});db['User']['belongsToMany'](db[_0x09b9('0xf3')],{'as':_0x09b9('0x12d'),'through':_0x09b9('0x12e')});db[_0x09b9('0x13')][_0x09b9('0x126')](db['Team'],{'through':_0x09b9('0x12f')});db[_0x09b9('0x13')][_0x09b9('0x126')](db[_0x09b9('0x3e')],{'as':_0x09b9('0x11f'),'through':_0x09b9('0x130')});db[_0x09b9('0x13')]['belongsToMany'](db['ChatInteraction'],{'as':_0x09b9('0x11c'),'through':_0x09b9('0x131')});db[_0x09b9('0x13')]['belongsToMany'](db[_0x09b9('0x49')],{'as':_0x09b9('0x11e'),'through':_0x09b9('0x132')});db['User'][_0x09b9('0x126')](db[_0x09b9('0x52')],{'as':'SmsInteractions','through':_0x09b9('0x133')});db['User']['belongsToMany'](db[_0x09b9('0x134')],{'as':_0x09b9('0x11a'),'through':_0x09b9('0x135')});db[_0x09b9('0x13')][_0x09b9('0x126')](db[_0x09b9('0xff')],{'as':_0x09b9('0x120'),'through':'user_has_whatsapp_interactions'});db[_0x09b9('0x13')][_0x09b9('0x126')](db['VoiceQueue'],{'as':'VoiceQueues','through':_0x09b9('0x2a'),'required':![]});db['User'][_0x09b9('0x126')](db[_0x09b9('0xf5')],{'as':_0x09b9('0x136'),'through':_0x09b9('0x137'),'required':![]});db[_0x09b9('0x13')]['belongsToMany'](db[_0x09b9('0x3a')],{'as':_0x09b9('0x138'),'through':_0x09b9('0x2e'),'required':![]});db[_0x09b9('0x13')][_0x09b9('0x126')](db[_0x09b9('0x65')],{'as':_0x09b9('0x139'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x09b9('0x13')]['belongsToMany'](db[_0x09b9('0x4d')],{'as':'FaxQueues','through':_0x09b9('0x30'),'required':![]});db[_0x09b9('0x13')][_0x09b9('0x126')](db[_0x09b9('0x55')],{'as':_0x09b9('0x13a'),'through':'UserSmsQueue','required':![]});db[_0x09b9('0x13')][_0x09b9('0x126')](db[_0x09b9('0x5a')],{'as':'OpenchannelQueues','through':_0x09b9('0x32'),'required':![]});db[_0x09b9('0x13')]['belongsToMany'](db[_0x09b9('0x107')],{'as':_0x09b9('0x13b'),'through':_0x09b9('0x34'),'required':![]});db[_0x09b9('0x13')][_0x09b9('0x126')](db['CmList'],{'through':_0x09b9('0x12e')});db[_0x09b9('0x13')][_0x09b9('0x126')](db[_0x09b9('0x5c')],{'as':'ChatWebsites','through':_0x09b9('0x13c')});db[_0x09b9('0x13')]['belongsToMany'](db[_0x09b9('0x46')],{'as':_0x09b9('0x13d'),'through':_0x09b9('0x13e')});db['User']['belongsToMany'](db[_0x09b9('0x39')],{'as':_0x09b9('0x13f'),'through':_0x09b9('0x140')});db[_0x09b9('0x13')]['belongsToMany'](db[_0x09b9('0x56')],{'as':_0x09b9('0x141'),'through':_0x09b9('0x142')});db[_0x09b9('0x13')][_0x09b9('0x126')](db['SmsAccount'],{'as':_0x09b9('0x143'),'through':_0x09b9('0x144')});db['User']['belongsToMany'](db[_0x09b9('0xfc')],{'as':_0x09b9('0x145'),'through':_0x09b9('0x146')});db['User'][_0x09b9('0x126')](db[_0x09b9('0xde')],{'as':_0x09b9('0x147'),'through':_0x09b9('0x148')});db[_0x09b9('0x149')][_0x09b9('0x113')](db[_0x09b9('0x17')],{'as':'SpiedAgents','onDelete':_0x09b9('0x110'),'foreignKey':'ChanSpyId'});db[_0x09b9('0x16')][_0x09b9('0x113')](db['VoiceExtension'],{'onDelete':_0x09b9('0x110')});db['VoiceExtension'][_0x09b9('0x113')](db[_0x09b9('0x17')],{'as':_0x09b9('0x14a'),'onDelete':'cascade'});db[_0x09b9('0x19')][_0x09b9('0x126')](db['Sound'],{'as':'Sounds','through':_0x09b9('0x14b')});db[_0x09b9('0x1b')]['hasMany'](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':_0x09b9('0x14c')});db[_0x09b9('0x1b')][_0x09b9('0x113')](db[_0x09b9('0x6b')],{'as':_0x09b9('0x14d'),'foreignKey':_0x09b9('0x14c')});db[_0x09b9('0x1b')][_0x09b9('0x113')](db['CmHopperFinal'],{'as':_0x09b9('0x117'),'foreignKey':'VoiceQueueId'});db[_0x09b9('0x1b')]['hasMany'](db[_0x09b9('0x118')],{'as':_0x09b9('0x14e'),'foreignKey':_0x09b9('0x14c')});db['VoiceQueue'][_0x09b9('0x113')](db[_0x09b9('0x6e')],{'as':_0x09b9('0x6e'),'foreignKey':_0x09b9('0x14c')});db[_0x09b9('0x1b')][_0x09b9('0x113')](db[_0x09b9('0x6d')],{'as':_0x09b9('0x14f'),'foreignKey':_0x09b9('0x14c')});db[_0x09b9('0x1b')][_0x09b9('0x113')](db[_0x09b9('0xd3')],{'as':_0x09b9('0x150'),'foreignKey':_0x09b9('0x14c')});db['VoiceQueue'][_0x09b9('0x123')](db[_0x09b9('0x151')],{'as':_0x09b9('0x151'),'foreignKey':_0x09b9('0x152')});db['VoiceQueue']['belongsTo'](db[_0x09b9('0x151')],{'as':_0x09b9('0x153'),'foreignKey':_0x09b9('0x154')});db[_0x09b9('0x1b')][_0x09b9('0x123')](db[_0x09b9('0x7b')],{'as':_0x09b9('0x7b'),'foreignKey':_0x09b9('0x155')});db[_0x09b9('0x1b')]['belongsTo'](db['Pause'],{'as':_0x09b9('0x156'),'foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0x09b9('0x126')](db['CmList'],{'as':_0x09b9('0x12d'),'through':_0x09b9('0x157')});db[_0x09b9('0x1b')][_0x09b9('0x126')](db[_0x09b9('0x13')],{'as':_0x09b9('0x158'),'through':_0x09b9('0x2a')});db[_0x09b9('0x1b')][_0x09b9('0x126')](db['Team'],{'as':'Teams','through':_0x09b9('0x10a')});db[_0x09b9('0x1b')]['belongsToMany'](db[_0x09b9('0xf3')],{'as':_0x09b9('0x159'),'through':'voice_queues_has_cm_blacklists'});db[_0x09b9('0x1d')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'as':_0x09b9('0x13'),'foreignKey':_0x09b9('0x111')});db[_0x09b9('0x15a')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'as':_0x09b9('0x13'),'foreignKey':'UserId'});db[_0x09b9('0x1f')][_0x09b9('0x113')](db[_0x09b9('0x15b')],{'as':_0x09b9('0x15c'),'onDelete':'cascade','foreignKey':_0x09b9('0x15d'),'sourceKey':_0x09b9('0x15e')});db[_0x09b9('0x15b')]['belongsTo'](db['VoiceMail'],{'foreignKey':_0x09b9('0x15d'),'targetKey':_0x09b9('0x15e')});db[_0x09b9('0x15f')][_0x09b9('0x113')](db[_0x09b9('0x24')],{'as':_0x09b9('0x160'),'foreignKey':'uniqueid','constraints':![]});db[_0x09b9('0x15f')][_0x09b9('0x113')](db['VoiceAgentReport'],{'as':_0x09b9('0x161'),'foreignKey':_0x09b9('0x162'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x09b9('0x13')],{'as':_0x09b9('0x13'),'foreignKey':_0x09b9('0x111')});db[_0x09b9('0x15f')][_0x09b9('0x123')](db['CmContact'],{'as':_0x09b9('0x163'),'foreignKey':'ContactId'});db[_0x09b9('0x36')][_0x09b9('0x123')](db[_0x09b9('0x39')],{'as':_0x09b9('0x39'),'foreignKey':_0x09b9('0x164')});db['MailServerIn'][_0x09b9('0x123')](db[_0x09b9('0x108')],{'as':_0x09b9('0x108'),'foreignKey':_0x09b9('0x165'),'onDelete':_0x09b9('0x166')});db[_0x09b9('0x37')]['belongsTo'](db[_0x09b9('0x39')],{'as':_0x09b9('0x39'),'foreignKey':_0x09b9('0x164')});db[_0x09b9('0x37')]['belongsTo'](db[_0x09b9('0x108')],{'as':_0x09b9('0x108'),'foreignKey':_0x09b9('0x165'),'onDelete':'restrict'});db[_0x09b9('0x39')][_0x09b9('0x10f')](db['MailServerIn'],{'as':_0x09b9('0x167'),'onDelete':_0x09b9('0x110')});db[_0x09b9('0x39')][_0x09b9('0x10f')](db[_0x09b9('0x37')],{'as':_0x09b9('0x168'),'onDelete':_0x09b9('0x110')});db[_0x09b9('0x39')][_0x09b9('0x113')](db[_0x09b9('0x78')],{'as':_0x09b9('0x169'),'foreignKey':_0x09b9('0x164'),'onDelete':_0x09b9('0x110')});db[_0x09b9('0x39')][_0x09b9('0x113')](db[_0x09b9('0x76')],{'as':'Answers','foreignKey':_0x09b9('0x164')});db[_0x09b9('0x39')][_0x09b9('0x113')](db[_0x09b9('0x3f')],{'as':_0x09b9('0x15c'),'foreignKey':_0x09b9('0x164')});db[_0x09b9('0x39')]['hasMany'](db[_0x09b9('0x3e')],{'as':_0x09b9('0x16a')});db['MailAccount'][_0x09b9('0x113')](db[_0x09b9('0x40')],{'as':'Applications'});db['MailAccount'][_0x09b9('0x123')](db['CmList'],{'as':_0x09b9('0x16b'),'foreignKey':_0x09b9('0x16c')});db[_0x09b9('0x39')][_0x09b9('0x123')](db['Template'],{'as':_0x09b9('0x16d'),'foreignKey':_0x09b9('0x16e')});db[_0x09b9('0x39')]['belongsTo'](db[_0x09b9('0x7c')],{'as':'mandatoryDispositionPause','foreignKey':_0x09b9('0x16f')});db['MailAccount'][_0x09b9('0x126')](db[_0x09b9('0x13')],{'as':'Agents','through':_0x09b9('0x140')});db['MailQueue'][_0x09b9('0x126')](db['User'],{'as':_0x09b9('0x158'),'through':'UserMailQueue'});db['MailQueue']['belongsToMany'](db[_0x09b9('0xe3')],{'through':_0x09b9('0x170'),'as':'Teams'});db[_0x09b9('0x3e')]['hasMany'](db[_0x09b9('0x3f')],{'as':_0x09b9('0x15c'),'onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x171')});db[_0x09b9('0x3e')][_0x09b9('0x123')](db['MailAccount'],{'as':_0x09b9('0x172'),'foreignKey':'MailAccountId'});db['MailInteraction']['belongsTo'](db['CmContact'],{'as':_0x09b9('0x163'),'foreignKey':'ContactId'});db[_0x09b9('0x3e')]['belongsTo'](db[_0x09b9('0x13')],{'as':'Owner','foreignKey':_0x09b9('0x111')});db['MailInteraction']['belongsToMany'](db[_0x09b9('0x85')],{'through':_0x09b9('0x173'),'as':_0x09b9('0x174')});db[_0x09b9('0x3e')][_0x09b9('0x126')](db[_0x09b9('0x85')],{'through':_0x09b9('0x173'),'as':_0x09b9('0x175')});db[_0x09b9('0x3e')][_0x09b9('0x126')](db[_0x09b9('0x13')],{'as':'Users','through':'user_has_mail_interactions','foreignKey':'MailInteractionId'});db[_0x09b9('0x3f')][_0x09b9('0x113')](db[_0x09b9('0xea')],{'as':_0x09b9('0x176'),'onDelete':_0x09b9('0x110')});db[_0x09b9('0x3f')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'as':'User'});db[_0x09b9('0x3f')]['belongsTo'](db[_0x09b9('0x12a')],{'onDelete':_0x09b9('0x110'),'as':_0x09b9('0x163')});db['MailMessage'][_0x09b9('0x123')](db[_0x09b9('0x3e')],{'as':_0x09b9('0x177'),'foreignKey':_0x09b9('0x171')});db['MailMessage'][_0x09b9('0x123')](db[_0x09b9('0x39')],{'as':'Account','foreignKey':_0x09b9('0x164')});db[_0x09b9('0x3f')][_0x09b9('0x123')](db[_0x09b9('0x5c')],{'as':'ChatWebsite','foreignKey':_0x09b9('0x178')});db[_0x09b9('0x3f')][_0x09b9('0x123')](db[_0x09b9('0x63')],{'as':'ChatOfflineMessage','foreignKey':_0x09b9('0x179')});db['MailApplication']['belongsTo'](db[_0x09b9('0x13')],{'onDelete':_0x09b9('0x166')});db['MailApplication'][_0x09b9('0x123')](db['MailQueue'],{'onDelete':_0x09b9('0x166')});db[_0x09b9('0x40')][_0x09b9('0x123')](db[_0x09b9('0x39')],{'onDelete':_0x09b9('0x166')});db[_0x09b9('0x40')][_0x09b9('0x123')](db['Interval'],{'onDelete':_0x09b9('0x166'),'foreignKey':_0x09b9('0x155')});db[_0x09b9('0x40')][_0x09b9('0x123')](db[_0x09b9('0x85')],{'onDelete':_0x09b9('0x166'),'foreignKey':_0x09b9('0x17a')});db[_0x09b9('0x42')][_0x09b9('0x123')](db[_0x09b9('0x39')],{});db[_0x09b9('0x42')][_0x09b9('0x123')](db[_0x09b9('0xf3')],{'as':_0x09b9('0x16b'),'foreignKey':'ListId'});db[_0x09b9('0x42')][_0x09b9('0x123')](db[_0x09b9('0x12a')],{'as':_0x09b9('0x163'),'foreignKey':_0x09b9('0x17b')});db[_0x09b9('0x42')][_0x09b9('0x123')](db[_0x09b9('0x3e')],{});db['MailQueueReport'][_0x09b9('0x123')](db['MailMessage'],{});db['MailQueueReport'][_0x09b9('0x123')](db[_0x09b9('0x13')],{});db['MailQueueReport'][_0x09b9('0x123')](db[_0x09b9('0x3a')],{});db['Dashboard'][_0x09b9('0x113')](db[_0x09b9('0x17c')],{'as':_0x09b9('0x17d'),'onDelete':_0x09b9('0x110')});db['FaxAccount'][_0x09b9('0x113')](db[_0x09b9('0x78')],{'as':_0x09b9('0x169'),'foreignKey':_0x09b9('0x17e'),'onDelete':'cascade'});db['FaxAccount'][_0x09b9('0x113')](db[_0x09b9('0x76')],{'as':_0x09b9('0x17f'),'foreignKey':'FaxAccountId'});db[_0x09b9('0x46')][_0x09b9('0x113')](db[_0x09b9('0x49')],{'as':_0x09b9('0x16a')});db[_0x09b9('0x46')][_0x09b9('0x113')](db[_0x09b9('0x180')],{'as':'Applications'});db[_0x09b9('0x46')][_0x09b9('0x113')](db[_0x09b9('0x17')],{'as':'Exntensions','onDelete':'cascade'});db[_0x09b9('0x46')]['hasMany'](db[_0x09b9('0x4b')],{'as':_0x09b9('0x15c')});db[_0x09b9('0x46')][_0x09b9('0x123')](db['Trunk'],{'as':'Trunk'});db['FaxAccount'][_0x09b9('0x123')](db[_0x09b9('0xf3')],{'as':'List','foreignKey':_0x09b9('0x16c')});db['FaxAccount'][_0x09b9('0x123')](db[_0x09b9('0x7c')],{'as':_0x09b9('0x156'),'foreignKey':_0x09b9('0x16f')});db['FaxAccount'][_0x09b9('0x126')](db[_0x09b9('0x13')],{'as':'Agents','through':_0x09b9('0x13e')});db[_0x09b9('0x180')]['belongsTo'](db['User'],{'onDelete':_0x09b9('0x166')});db['FaxApplication'][_0x09b9('0x123')](db[_0x09b9('0x4d')],{'onDelete':_0x09b9('0x166')});db['FaxApplication'][_0x09b9('0x123')](db[_0x09b9('0x46')],{'onDelete':_0x09b9('0x166')});db[_0x09b9('0x180')]['belongsTo'](db[_0x09b9('0x85')],{'onDelete':'restrict','foreignKey':_0x09b9('0x17a')});db[_0x09b9('0x49')][_0x09b9('0x113')](db[_0x09b9('0x4b')],{'as':_0x09b9('0x15c'),'onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x181')});db[_0x09b9('0x49')]['belongsTo'](db['FaxAccount'],{'as':'Account','foreignKey':_0x09b9('0x17e')});db[_0x09b9('0x49')][_0x09b9('0x123')](db['CmContact'],{'as':'Contact','foreignKey':_0x09b9('0x17b')});db[_0x09b9('0x49')]['belongsTo'](db[_0x09b9('0x13')],{'as':_0x09b9('0x182'),'foreignKey':_0x09b9('0x111')});db[_0x09b9('0x49')][_0x09b9('0x126')](db[_0x09b9('0x85')],{'through':_0x09b9('0x183'),'as':'Tags'});db['FaxInteraction']['belongsToMany'](db[_0x09b9('0x85')],{'through':'fax_interaction_has_tags','as':_0x09b9('0x175')});db['FaxInteraction'][_0x09b9('0x126')](db['User'],{'as':_0x09b9('0x184'),'through':_0x09b9('0x132'),'foreignKey':_0x09b9('0x181')});db[_0x09b9('0x4b')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'onDelete':_0x09b9('0x110'),'as':_0x09b9('0x13')});db[_0x09b9('0x4b')][_0x09b9('0x123')](db[_0x09b9('0x49')],{'as':_0x09b9('0x177'),'foreignKey':'FaxInteractionId'});db[_0x09b9('0x4b')]['belongsTo'](db[_0x09b9('0x12a')],{'onDelete':_0x09b9('0x110'),'as':_0x09b9('0x163')});db[_0x09b9('0x4b')][_0x09b9('0x123')](db[_0x09b9('0xea')],{'as':'Attachment','foreignKey':_0x09b9('0x185')});db[_0x09b9('0x4b')]['belongsTo'](db['FaxAccount'],{'as':'Account','foreignKey':_0x09b9('0x17e')});db[_0x09b9('0x4d')][_0x09b9('0x126')](db[_0x09b9('0x13')],{'as':_0x09b9('0x158'),'through':'UserFaxQueue'});db[_0x09b9('0x4d')]['belongsToMany'](db[_0x09b9('0xe3')],{'through':_0x09b9('0x186'),'as':_0x09b9('0x187')});db['FaxQueueReport'][_0x09b9('0x123')](db[_0x09b9('0x46')],{});db[_0x09b9('0x188')]['belongsTo'](db[_0x09b9('0xf3')],{'as':_0x09b9('0x16b'),'foreignKey':_0x09b9('0x16c')});db['FaxQueueReport']['belongsTo'](db[_0x09b9('0x12a')],{'as':_0x09b9('0x163'),'foreignKey':_0x09b9('0x17b')});db[_0x09b9('0x188')][_0x09b9('0x123')](db[_0x09b9('0x49')],{});db[_0x09b9('0x188')][_0x09b9('0x123')](db[_0x09b9('0x4b')],{});db[_0x09b9('0x188')][_0x09b9('0x123')](db[_0x09b9('0x13')],{});db[_0x09b9('0x188')][_0x09b9('0x123')](db[_0x09b9('0x4d')],{});db['SmsAccount'][_0x09b9('0x113')](db['Disposition'],{'as':_0x09b9('0x169'),'foreignKey':'SmsAccountId','onDelete':_0x09b9('0x110')});db['SmsAccount'][_0x09b9('0x113')](db['CannedAnswer'],{'as':_0x09b9('0x17f'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0x09b9('0x113')](db[_0x09b9('0x54')],{'as':_0x09b9('0x15c'),'foreignKey':_0x09b9('0x189')});db[_0x09b9('0x18a')][_0x09b9('0x113')](db[_0x09b9('0x52')],{'as':_0x09b9('0x16a')});db[_0x09b9('0x18a')]['hasMany'](db[_0x09b9('0x50')],{'as':_0x09b9('0x14a')});db[_0x09b9('0x18a')][_0x09b9('0x123')](db[_0x09b9('0xf3')],{'as':_0x09b9('0x16b'),'foreignKey':_0x09b9('0x16c')});db[_0x09b9('0x18a')][_0x09b9('0x123')](db[_0x09b9('0x7c')],{'as':_0x09b9('0x156'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x09b9('0x18a')][_0x09b9('0x126')](db['User'],{'as':_0x09b9('0x158'),'through':_0x09b9('0x144')});db[_0x09b9('0x50')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'onDelete':'restrict'});db[_0x09b9('0x50')]['belongsTo'](db['SmsQueue'],{'onDelete':'restrict'});db[_0x09b9('0x50')][_0x09b9('0x123')](db[_0x09b9('0x18a')],{'onDelete':_0x09b9('0x166')});db[_0x09b9('0x50')][_0x09b9('0x123')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x09b9('0x155')});db[_0x09b9('0x50')][_0x09b9('0x123')](db[_0x09b9('0x85')],{'onDelete':_0x09b9('0x166'),'foreignKey':_0x09b9('0x17a')});db['SmsInteraction'][_0x09b9('0x113')](db[_0x09b9('0x54')],{'as':'Messages','onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x18b')});db['SmsInteraction'][_0x09b9('0x123')](db[_0x09b9('0x18a')],{'as':_0x09b9('0x172'),'foreignKey':_0x09b9('0x189')});db[_0x09b9('0x52')][_0x09b9('0x123')](db[_0x09b9('0x12a')],{'as':'Contact','foreignKey':_0x09b9('0x17b')});db[_0x09b9('0x52')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'as':_0x09b9('0x182'),'foreignKey':_0x09b9('0x111')});db['SmsInteraction'][_0x09b9('0x126')](db['Tag'],{'through':_0x09b9('0x18c'),'as':_0x09b9('0x174')});db['SmsInteraction'][_0x09b9('0x126')](db[_0x09b9('0x85')],{'through':_0x09b9('0x18c'),'as':'ThroughTags'});db[_0x09b9('0x52')][_0x09b9('0x126')](db['User'],{'as':_0x09b9('0x184'),'through':'user_has_sms_interactions','foreignKey':_0x09b9('0x18b')});db[_0x09b9('0x54')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'as':_0x09b9('0x13')});db[_0x09b9('0x54')][_0x09b9('0x123')](db[_0x09b9('0x12a')],{'onDelete':_0x09b9('0x110'),'as':'Contact'});db[_0x09b9('0x54')][_0x09b9('0x123')](db['SmsInteraction'],{'onDelete':_0x09b9('0x110'),'as':_0x09b9('0x177'),'foreignKey':_0x09b9('0x18b')});db['SmsMessage'][_0x09b9('0x123')](db[_0x09b9('0x18a')],{'as':'Account','foreignKey':_0x09b9('0x189')});db[_0x09b9('0x55')][_0x09b9('0x126')](db[_0x09b9('0x13')],{'as':_0x09b9('0x158'),'through':_0x09b9('0x18d'),'foreignKey':_0x09b9('0x18e')});db[_0x09b9('0x55')][_0x09b9('0x126')](db[_0x09b9('0xe3')],{'through':'team_has_sms_queues','as':_0x09b9('0x187')});db[_0x09b9('0x56')][_0x09b9('0x113')](db[_0x09b9('0x78')],{'as':_0x09b9('0x169'),'foreignKey':'OpenchannelAccountId','onDelete':_0x09b9('0x110')});db[_0x09b9('0x56')]['hasMany'](db[_0x09b9('0x76')],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0x09b9('0x56')][_0x09b9('0x113')](db['OpenchannelInteraction'],{'as':_0x09b9('0x16a'),'foreignKey':_0x09b9('0x18f')});db['OpenchannelAccount'][_0x09b9('0x113')](db['OpenchannelMessage'],{'as':_0x09b9('0x15c'),'foreignKey':_0x09b9('0x18f')});db[_0x09b9('0x56')][_0x09b9('0x113')](db[_0x09b9('0x190')],{'as':_0x09b9('0x14a'),'foreignKey':_0x09b9('0x18f')});db[_0x09b9('0x56')][_0x09b9('0x123')](db[_0x09b9('0xf3')],{'as':_0x09b9('0x16b'),'foreignKey':_0x09b9('0x16c')});db[_0x09b9('0x56')][_0x09b9('0x123')](db[_0x09b9('0x7c')],{'as':_0x09b9('0x156'),'foreignKey':_0x09b9('0x16f')});db[_0x09b9('0x56')][_0x09b9('0x126')](db[_0x09b9('0x13')],{'as':'Agents','through':_0x09b9('0x142')});db[_0x09b9('0x190')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'onDelete':_0x09b9('0x166')});db[_0x09b9('0x190')]['belongsTo'](db[_0x09b9('0x5a')],{'onDelete':_0x09b9('0x166'),'foreignKey':_0x09b9('0x191')});db[_0x09b9('0x190')][_0x09b9('0x123')](db[_0x09b9('0x56')],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db['OpenchannelApplication'][_0x09b9('0x123')](db[_0x09b9('0x7b')],{'onDelete':_0x09b9('0x166'),'foreignKey':'IntervalId'});db['OpenchannelApplication'][_0x09b9('0x123')](db[_0x09b9('0x85')],{'onDelete':'restrict','foreignKey':'TagId'});db['OpenchannelInteraction']['hasMany'](db[_0x09b9('0x192')],{'as':_0x09b9('0x15c'),'onDelete':_0x09b9('0x110'),'foreignKey':'OpenchannelInteractionId'});db[_0x09b9('0x134')]['belongsTo'](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0x09b9('0x18f')});db[_0x09b9('0x134')][_0x09b9('0x123')](db[_0x09b9('0x12a')],{'as':'Contact','foreignKey':_0x09b9('0x17b')});db[_0x09b9('0x134')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'as':_0x09b9('0x182'),'foreignKey':_0x09b9('0x111')});db[_0x09b9('0x134')]['belongsToMany'](db[_0x09b9('0x85')],{'through':_0x09b9('0x193'),'as':_0x09b9('0x174')});db[_0x09b9('0x134')][_0x09b9('0x126')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x09b9('0x175')});db['OpenchannelInteraction'][_0x09b9('0x126')](db[_0x09b9('0x13')],{'as':'Users','through':'user_has_openchannel_interactions','foreignKey':_0x09b9('0x194')});db[_0x09b9('0x192')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'onDelete':_0x09b9('0x110'),'as':_0x09b9('0x13')});db[_0x09b9('0x192')][_0x09b9('0x123')](db[_0x09b9('0x12a')],{'onDelete':'cascade','as':_0x09b9('0x163')});db['OpenchannelMessage'][_0x09b9('0x123')](db[_0x09b9('0x134')],{'onDelete':_0x09b9('0x110'),'as':_0x09b9('0x177'),'foreignKey':_0x09b9('0x194')});db[_0x09b9('0x192')][_0x09b9('0x123')](db[_0x09b9('0xea')],{'as':_0x09b9('0xea'),'foreignKey':_0x09b9('0x185')});db[_0x09b9('0x192')][_0x09b9('0x123')](db[_0x09b9('0x56')],{'as':'Account','foreignKey':_0x09b9('0x18f')});db[_0x09b9('0x5a')][_0x09b9('0x126')](db[_0x09b9('0x13')],{'as':_0x09b9('0x158'),'through':_0x09b9('0x32'),'foreignKey':_0x09b9('0x191')});db[_0x09b9('0x5a')][_0x09b9('0x126')](db[_0x09b9('0xe3')],{'through':'team_has_openchannel_queues','as':_0x09b9('0x187')});db[_0x09b9('0x5c')][_0x09b9('0x113')](db[_0x09b9('0x78')],{'as':_0x09b9('0x169'),'foreignKey':_0x09b9('0x178'),'onDelete':_0x09b9('0x110')});db[_0x09b9('0x5c')][_0x09b9('0x113')](db[_0x09b9('0x76')],{'as':'Answers','foreignKey':_0x09b9('0x178')});db[_0x09b9('0x5c')]['hasMany'](db[_0x09b9('0x67')],{'as':'ProactiveActions'});db[_0x09b9('0x5c')][_0x09b9('0x113')](db['ChatInteraction'],{'as':_0x09b9('0x16a')});db[_0x09b9('0x5c')][_0x09b9('0x113')](db[_0x09b9('0x5f')],{'as':_0x09b9('0x14a')});db['ChatWebsite'][_0x09b9('0x113')](db[_0x09b9('0x62')],{'as':_0x09b9('0x15c')});db[_0x09b9('0x5c')][_0x09b9('0x123')](db[_0x09b9('0xf3')],{'as':_0x09b9('0x16b'),'foreignKey':'ListId'});db[_0x09b9('0x5c')][_0x09b9('0x123')](db[_0x09b9('0x7b')],{'as':_0x09b9('0x7b'),'foreignKey':_0x09b9('0x155')});db['ChatWebsite'][_0x09b9('0x123')](db[_0x09b9('0x39')],{'as':_0x09b9('0x39'),'foreignKey':_0x09b9('0x164')});db[_0x09b9('0x5c')][_0x09b9('0x123')](db[_0x09b9('0x7c')],{'as':_0x09b9('0x156'),'foreignKey':_0x09b9('0x16f')});db[_0x09b9('0x5c')][_0x09b9('0x126')](db['User'],{'as':_0x09b9('0x158'),'through':'user_has_chat_websites'});db[_0x09b9('0x5e')][_0x09b9('0x123')](db[_0x09b9('0x56')],{});db[_0x09b9('0x5e')][_0x09b9('0x123')](db['CmList'],{'as':_0x09b9('0x16b'),'foreignKey':'ListId'});db[_0x09b9('0x5e')][_0x09b9('0x123')](db[_0x09b9('0x12a')],{'as':_0x09b9('0x163'),'foreignKey':_0x09b9('0x17b')});db['OpenchannelQueueReport'][_0x09b9('0x123')](db[_0x09b9('0x134')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x09b9('0x192')],{});db[_0x09b9('0x5e')][_0x09b9('0x123')](db[_0x09b9('0x13')],{});db[_0x09b9('0x5e')][_0x09b9('0x123')](db[_0x09b9('0x5a')],{});db[_0x09b9('0x5f')][_0x09b9('0x123')](db['User'],{'as':'Agent','foreignKey':'UserId','onDelete':'restrict'});db[_0x09b9('0x5f')][_0x09b9('0x123')](db['ChatQueue'],{'as':_0x09b9('0x195'),'foreignKey':_0x09b9('0x196'),'onDelete':_0x09b9('0x166')});db[_0x09b9('0x5f')][_0x09b9('0x123')](db['ChatWebsite'],{'as':_0x09b9('0x197'),'foreignKey':_0x09b9('0x178'),'onDelete':'restrict'});db[_0x09b9('0x5f')][_0x09b9('0x123')](db[_0x09b9('0x85')],{'onDelete':_0x09b9('0x166'),'foreignKey':_0x09b9('0x17a')});db[_0x09b9('0x11b')][_0x09b9('0x113')](db[_0x09b9('0x62')],{'as':_0x09b9('0x15c'),'onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x198')});db[_0x09b9('0x11b')][_0x09b9('0x123')](db['ChatWebsite'],{'as':_0x09b9('0x172'),'foreignKey':_0x09b9('0x178')});db['ChatInteraction'][_0x09b9('0x123')](db[_0x09b9('0x12a')],{'as':'Contact','foreignKey':'ContactId'});db[_0x09b9('0x11b')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'as':'Owner','foreignKey':_0x09b9('0x111')});db[_0x09b9('0x11b')][_0x09b9('0x126')](db['Tag'],{'through':_0x09b9('0x199'),'as':_0x09b9('0x174')});db[_0x09b9('0x11b')][_0x09b9('0x126')](db[_0x09b9('0x85')],{'through':_0x09b9('0x199'),'as':'ThroughTags'});db[_0x09b9('0x11b')]['belongsToMany'](db[_0x09b9('0x13')],{'as':_0x09b9('0x184'),'through':_0x09b9('0x131'),'foreignKey':_0x09b9('0x198')});db[_0x09b9('0x62')][_0x09b9('0x123')](db['User'],{'onDelete':'cascade','as':_0x09b9('0x13')});db[_0x09b9('0x62')][_0x09b9('0x123')](db['CmContact'],{'onDelete':_0x09b9('0x110'),'as':'Contact','foreignKey':'ContactId'});db[_0x09b9('0x62')][_0x09b9('0x123')](db[_0x09b9('0x11b')],{'onDelete':_0x09b9('0x110'),'as':_0x09b9('0x177'),'foreignKey':_0x09b9('0x198')});db[_0x09b9('0x62')]['belongsTo'](db[_0x09b9('0xea')],{'as':_0x09b9('0xea'),'foreignKey':_0x09b9('0x185')});db['ChatMessage'][_0x09b9('0x123')](db[_0x09b9('0x5c')],{'as':_0x09b9('0x172'),'foreignKey':_0x09b9('0x178')});db['ChatOfflineMessage'][_0x09b9('0x113')](db[_0x09b9('0xea')],{'as':_0x09b9('0x176'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x09b9('0x110'),'hooks':!![]});db[_0x09b9('0x63')][_0x09b9('0x123')](db[_0x09b9('0x12a')],{'onDelete':_0x09b9('0x110'),'as':'Contact','foreignKey':_0x09b9('0x17b')});db['ChatOfflineMessage'][_0x09b9('0x123')](db['ChatWebsite'],{'as':_0x09b9('0x172'),'foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0x09b9('0x126')](db[_0x09b9('0x13')],{'as':_0x09b9('0x158'),'through':_0x09b9('0x2c'),'hooks':!![]});db['ChatQueue'][_0x09b9('0x126')](db[_0x09b9('0xe3')],{'through':'team_has_chat_queues','as':_0x09b9('0x187')});db[_0x09b9('0x127')]['hasMany'](db['ChatInternalMessage'],{'as':_0x09b9('0x15c'),'foreignKey':_0x09b9('0x19a'),'onDelete':_0x09b9('0x110')});db[_0x09b9('0x127')][_0x09b9('0x126')](db[_0x09b9('0x13')],{'as':_0x09b9('0x19b'),'through':_0x09b9('0x129')});db['ChatProactiveAction'][_0x09b9('0x123')](db['ChatWebsite'],{'as':'Website','foreignKey':_0x09b9('0x178')});db['CmCompany'][_0x09b9('0x113')](db['CmContact'],{'as':'Contacts','foreignKey':_0x09b9('0x19c')});db[_0x09b9('0x12a')][_0x09b9('0x113')](db['CmContactHasItem'],{'as':_0x09b9('0x19d'),'foreignKey':'CmContactId'});db[_0x09b9('0x12a')][_0x09b9('0x113')](db[_0x09b9('0x6b')],{'as':_0x09b9('0x14d'),'foreignKey':_0x09b9('0x17b')});db[_0x09b9('0x12a')][_0x09b9('0x113')](db[_0x09b9('0x116')],{'as':_0x09b9('0x117'),'foreignKey':_0x09b9('0x17b')});db[_0x09b9('0x12a')][_0x09b9('0x113')](db[_0x09b9('0x118')],{'as':_0x09b9('0x14e'),'foreignKey':_0x09b9('0x17b')});db[_0x09b9('0x12a')][_0x09b9('0x113')](db[_0x09b9('0x6e')],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db[_0x09b9('0x12a')]['hasMany'](db[_0x09b9('0xd3')],{'as':_0x09b9('0x150'),'foreignKey':_0x09b9('0x17b')});db[_0x09b9('0x12a')][_0x09b9('0x113')](db[_0x09b9('0x134')],{'as':_0x09b9('0x11a'),'foreignKey':'ContactId','onDelete':_0x09b9('0x166')});db['CmContact'][_0x09b9('0x113')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x09b9('0x17b'),'onDelete':_0x09b9('0x166')});db[_0x09b9('0x12a')]['hasMany'](db[_0x09b9('0x52')],{'as':_0x09b9('0x11d'),'foreignKey':_0x09b9('0x17b'),'onDelete':_0x09b9('0x166')});db[_0x09b9('0x12a')][_0x09b9('0x113')](db[_0x09b9('0x49')],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':_0x09b9('0x166')});db['CmContact']['hasMany'](db[_0x09b9('0x3e')],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':_0x09b9('0x166')});db['CmContact']['belongsTo'](db[_0x09b9('0x19e')],{'as':'Company','foreignKey':_0x09b9('0x19c')});db[_0x09b9('0x12a')][_0x09b9('0x123')](db[_0x09b9('0xf3')],{'as':_0x09b9('0x16b'),'foreignKey':'ListId','onDelete':_0x09b9('0x110')});db['CmContact'][_0x09b9('0x126')](db[_0x09b9('0x13')],{'as':_0x09b9('0x184'),'through':_0x09b9('0x12c')});db[_0x09b9('0x12a')][_0x09b9('0x126')](db[_0x09b9('0x85')],{'as':'Tags','through':'cm_contact_has_tags'});db[_0x09b9('0x12a')][_0x09b9('0x126')](db[_0x09b9('0x85')],{'through':_0x09b9('0x19f'),'as':_0x09b9('0x175')});db[_0x09b9('0x6b')][_0x09b9('0x113')](db[_0x09b9('0x8a')],{'as':_0x09b9('0x1a0'),'foreignKey':_0x09b9('0x1a1')});db[_0x09b9('0x6b')]['belongsTo'](db[_0x09b9('0x12a')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0x09b9('0x110')});db[_0x09b9('0x6b')][_0x09b9('0x123')](db[_0x09b9('0xf3')],{'as':_0x09b9('0x16b'),'foreignKey':_0x09b9('0x16c'),'onDelete':_0x09b9('0x110')});db[_0x09b9('0x6b')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'as':_0x09b9('0x1a2'),'foreignKey':_0x09b9('0x111')});db[_0x09b9('0x6b')][_0x09b9('0x123')](db['VoiceQueue'],{'as':_0x09b9('0x195'),'foreignKey':'VoiceQueueId','onDelete':_0x09b9('0x110')});db[_0x09b9('0x6b')][_0x09b9('0x123')](db[_0x09b9('0x1a3')],{'as':_0x09b9('0x1a3'),'foreignKey':'CampaignId','onDelete':_0x09b9('0x110')});db[_0x09b9('0x6b')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'as':_0x09b9('0x182'),'foreignKey':_0x09b9('0x1a4')});db[_0x09b9('0x6d')][_0x09b9('0x123')](db[_0x09b9('0x12a')],{'as':_0x09b9('0x163'),'foreignKey':'ContactId','onDelete':_0x09b9('0x110')});db[_0x09b9('0x6d')][_0x09b9('0x123')](db[_0x09b9('0xf3')],{'as':'List','foreignKey':'ListId','onDelete':_0x09b9('0x110')});db[_0x09b9('0x6d')][_0x09b9('0x123')](db[_0x09b9('0x1b')],{'as':_0x09b9('0x195'),'foreignKey':_0x09b9('0x14c'),'onDelete':_0x09b9('0x110')});db[_0x09b9('0x6d')][_0x09b9('0x123')](db[_0x09b9('0x1a3')],{'as':_0x09b9('0x1a3'),'foreignKey':_0x09b9('0x1a5'),'onDelete':_0x09b9('0x110')});db['Automation']['hasMany'](db[_0x09b9('0x79')],{'as':{'plural':_0x09b9('0x1a6'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x09b9('0x74')][_0x09b9('0x113')](db[_0x09b9('0x79')],{'as':{'plural':_0x09b9('0x1a7'),'singular':_0x09b9('0x1a8')},'foreignKey':'AutomationAnyId','onDelete':_0x09b9('0x110'),'hooks':!![]});db[_0x09b9('0x74')][_0x09b9('0x113')](db['Action'],{'as':'Actions','foreignKey':_0x09b9('0x1a9'),'onDelete':_0x09b9('0x110'),'hooks':!![]});db[_0x09b9('0x78')][_0x09b9('0x113')](db[_0x09b9('0x78')],{'as':'Dispositions','foreignKey':_0x09b9('0x1aa'),'onDelete':'cascade'});db[_0x09b9('0x7b')][_0x09b9('0x113')](db[_0x09b9('0x7b')],{'as':_0x09b9('0x1ab'),'foreignKey':_0x09b9('0x155'),'onDelete':_0x09b9('0x110'),'hooks':!![],'required':![]});db[_0x09b9('0x7b')][_0x09b9('0x113')](db[_0x09b9('0x17')],{'as':_0x09b9('0x115'),'foreignKey':_0x09b9('0x155'),'onDelete':'restrict'});db[_0x09b9('0x7b')][_0x09b9('0x113')](db[_0x09b9('0x40')],{'as':_0x09b9('0x1ac'),'foreignKey':_0x09b9('0x155')});db['Interval']['hasMany'](db[_0x09b9('0x5f')],{'as':'ChatApplications','foreignKey':_0x09b9('0x155')});db[_0x09b9('0x7b')][_0x09b9('0x113')](db[_0x09b9('0x180')],{'as':_0x09b9('0x1ad'),'foreignKey':_0x09b9('0x155')});db[_0x09b9('0x7b')]['hasMany'](db[_0x09b9('0x50')],{'as':_0x09b9('0x1ae'),'foreignKey':_0x09b9('0x155')});db[_0x09b9('0x82')][_0x09b9('0x123')](db[_0x09b9('0x39')],{});db['Schedule']['belongsTo'](db['AnalyticDefaultReport'],{'foreignKey':_0x09b9('0x1af')});db[_0x09b9('0x82')]['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':'CustomReportId'});db[_0x09b9('0x83')][_0x09b9('0x126')](db[_0x09b9('0x19')],{'as':_0x09b9('0x1b0'),'through':_0x09b9('0x14b'),'onDelete':'restrict'});db[_0x09b9('0x85')]['belongsToMany'](db['CmContact'],{'through':_0x09b9('0x19f')});db[_0x09b9('0x85')]['belongsToMany'](db[_0x09b9('0x11b')],{'through':_0x09b9('0x199')});db[_0x09b9('0x85')]['belongsToMany'](db['MailInteraction'],{'through':_0x09b9('0x173')});db[_0x09b9('0x85')][_0x09b9('0x126')](db[_0x09b9('0x52')],{'through':_0x09b9('0x18c')});db[_0x09b9('0x85')]['belongsToMany'](db[_0x09b9('0x49')],{'through':_0x09b9('0x183')});db[_0x09b9('0x85')][_0x09b9('0x126')](db[_0x09b9('0x134')],{'through':'openchannel_interaction_has_tags'});db['Tag'][_0x09b9('0x126')](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db[_0x09b9('0x1b1')][_0x09b9('0x123')](db[_0x09b9('0x87')],{'as':_0x09b9('0x1b2'),'foreignKey':'ItemTypeId'});db[_0x09b9('0x8a')]['belongsTo'](db[_0x09b9('0x6b')],{'as':'Hopper','foreignKey':'CmHopperId'});db[_0x09b9('0x1b1')][_0x09b9('0x123')](db[_0x09b9('0x12a')],{'as':_0x09b9('0x163'),'foreignKey':_0x09b9('0x1b3')});db[_0x09b9('0x8c')]['hasMany'](db[_0x09b9('0x79')],{'as':{'plural':_0x09b9('0x1b4'),'singular':_0x09b9('0x1b5')},'foreignKey':_0x09b9('0x1b6'),'onDelete':_0x09b9('0x110'),'hooks':!![]});db[_0x09b9('0x8c')][_0x09b9('0x113')](db[_0x09b9('0x79')],{'as':{'plural':_0x09b9('0x1b7'),'singular':_0x09b9('0x1b8')},'foreignKey':_0x09b9('0x1b9'),'onDelete':_0x09b9('0x110'),'hooks':!![]});db[_0x09b9('0x8c')]['hasMany'](db[_0x09b9('0x72')],{'as':_0x09b9('0x1ba'),'foreignKey':_0x09b9('0x1bb'),'onDelete':_0x09b9('0x110'),'hooks':!![]});db['AnalyticCustomReport']['hasMany'](db[_0x09b9('0x1bc')],{'as':_0x09b9('0x1bd'),'onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x1be'),'hooks':!![]});db[_0x09b9('0x1bf')][_0x09b9('0x113')](db[_0x09b9('0x1bc')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x09b9('0x1af')});db[_0x09b9('0x95')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x09b9('0x1bd'),'onDelete':'cascade','foreignKey':_0x09b9('0x1c0')});db[_0x09b9('0x1bc')][_0x09b9('0x123')](db[_0x09b9('0x95')],{'foreignKey':_0x09b9('0x1c0')});db[_0x09b9('0x1c1')][_0x09b9('0x113')](db['SalesforceConfiguration'],{'as':_0x09b9('0x1c2'),'onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x1c3')});db[_0x09b9('0x9a')][_0x09b9('0x113')](db[_0x09b9('0x9b')],{'as':_0x09b9('0x1c4'),'onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x1c5')});db[_0x09b9('0x9a')]['hasMany'](db[_0x09b9('0x9b')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x09b9('0x1c6')});db['SalesforceConfiguration'][_0x09b9('0x113')](db['SalesforceField'],{'as':'Fields','onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x1c7')});db['SalesforceConfiguration'][_0x09b9('0x123')](db[_0x09b9('0x1c1')],{'as':_0x09b9('0x172'),'foreignKey':'AccountId'});db[_0x09b9('0x9b')][_0x09b9('0x113')](db[_0x09b9('0x9b')],{'as':_0x09b9('0x1c8'),'foreignKey':_0x09b9('0x1c5')});db[_0x09b9('0x9b')][_0x09b9('0x113')](db[_0x09b9('0x9b')],{'as':_0x09b9('0x1c9'),'foreignKey':'DescriptionId'});db['SalesforceField']['hasMany'](db[_0x09b9('0x9b')],{'as':_0x09b9('0x1ca'),'foreignKey':_0x09b9('0x1c7')});db[_0x09b9('0x9b')][_0x09b9('0x123')](db[_0x09b9('0x8e')],{'as':_0x09b9('0x8e'),'foreignKey':_0x09b9('0x1cb')});db[_0x09b9('0x9c')]['hasMany'](db[_0x09b9('0x9e')],{'as':'Configurations','onDelete':_0x09b9('0x110'),'foreignKey':'AccountId'});db[_0x09b9('0x9e')]['hasMany'](db[_0x09b9('0x1cc')],{'as':'Subjects','onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x1c5')});db['SugarcrmConfiguration']['hasMany'](db[_0x09b9('0x1cc')],{'as':_0x09b9('0x1cd'),'onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x1c6')});db['SugarcrmConfiguration'][_0x09b9('0x113')](db[_0x09b9('0x1cc')],{'as':_0x09b9('0x1bd'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x09b9('0x9e')]['belongsTo'](db[_0x09b9('0x9c')],{'as':_0x09b9('0x172'),'foreignKey':'AccountId'});db[_0x09b9('0x1cc')][_0x09b9('0x113')](db[_0x09b9('0x1cc')],{'as':_0x09b9('0x1c8'),'foreignKey':_0x09b9('0x1c5')});db[_0x09b9('0x1cc')]['hasMany'](db[_0x09b9('0x1cc')],{'as':_0x09b9('0x1c9'),'foreignKey':_0x09b9('0x1c6')});db['SugarcrmField'][_0x09b9('0x113')](db['SugarcrmField'],{'as':_0x09b9('0x1ca'),'foreignKey':_0x09b9('0x1c7')});db[_0x09b9('0x1cc')][_0x09b9('0x123')](db[_0x09b9('0x8e')],{'as':_0x09b9('0x8e'),'foreignKey':'VariableId'});db['DeskAccount']['hasMany'](db[_0x09b9('0x1ce')],{'as':'Configurations','onDelete':_0x09b9('0x110'),'foreignKey':'AccountId'});db[_0x09b9('0x1ce')]['hasMany'](db[_0x09b9('0x1cf')],{'as':_0x09b9('0x1c4'),'onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x1c5')});db[_0x09b9('0x1ce')][_0x09b9('0x113')](db[_0x09b9('0x1cf')],{'as':_0x09b9('0x1cd'),'onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x1c6')});db['DeskConfiguration'][_0x09b9('0x113')](db[_0x09b9('0x1cf')],{'as':_0x09b9('0x1bd'),'onDelete':'cascade','foreignKey':_0x09b9('0x1c7')});db[_0x09b9('0x1ce')][_0x09b9('0x123')](db['DeskAccount'],{'as':_0x09b9('0x172'),'foreignKey':_0x09b9('0x1c3')});db[_0x09b9('0x1ce')][_0x09b9('0x126')](db['Tag'],{'through':_0x09b9('0x1d0')});db['DeskField'][_0x09b9('0x113')](db[_0x09b9('0x1cf')],{'as':_0x09b9('0x1c8'),'foreignKey':'SubjectId'});db['DeskField']['hasMany'](db[_0x09b9('0x1cf')],{'as':'Description','foreignKey':_0x09b9('0x1c6')});db[_0x09b9('0x1cf')][_0x09b9('0x113')](db[_0x09b9('0x1cf')],{'as':_0x09b9('0x1ca'),'foreignKey':_0x09b9('0x1c7')});db[_0x09b9('0x1cf')][_0x09b9('0x123')](db[_0x09b9('0x8e')],{'as':'Variable','foreignKey':_0x09b9('0x1cb')});db[_0x09b9('0xa3')]['hasMany'](db[_0x09b9('0xa5')],{'as':_0x09b9('0x1c2'),'onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x1c3')});db[_0x09b9('0xa5')][_0x09b9('0x113')](db['ZohoField'],{'as':_0x09b9('0x1c4'),'onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x1c5')});db['ZohoConfiguration'][_0x09b9('0x113')](db[_0x09b9('0xa7')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x09b9('0x1c6')});db['ZohoConfiguration'][_0x09b9('0x113')](db[_0x09b9('0xa7')],{'as':_0x09b9('0x1bd'),'onDelete':_0x09b9('0x110'),'foreignKey':'FieldId'});db['ZohoConfiguration'][_0x09b9('0x123')](db['ZohoAccount'],{'as':_0x09b9('0x172'),'foreignKey':_0x09b9('0x1c3')});db[_0x09b9('0xa7')]['hasMany'](db[_0x09b9('0xa7')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x09b9('0xa7')][_0x09b9('0x113')](db[_0x09b9('0xa7')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x09b9('0xa7')]['hasMany'](db['ZohoField'],{'as':_0x09b9('0x1ca'),'foreignKey':'FieldId'});db[_0x09b9('0xa7')][_0x09b9('0x123')](db[_0x09b9('0x8e')],{'as':'Variable','foreignKey':'VariableId'});db[_0x09b9('0xa9')][_0x09b9('0x113')](db[_0x09b9('0xab')],{'as':_0x09b9('0x1c2'),'onDelete':_0x09b9('0x110'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x09b9('0x113')](db['ZendeskField'],{'as':'Subjects','foreignKey':_0x09b9('0x1c5')});db[_0x09b9('0xab')][_0x09b9('0x113')](db[_0x09b9('0xac')],{'as':_0x09b9('0x1cd'),'foreignKey':_0x09b9('0x1c6')});db['ZendeskConfiguration']['hasMany'](db[_0x09b9('0xac')],{'as':_0x09b9('0x1bd'),'foreignKey':'FieldId'});db[_0x09b9('0xab')][_0x09b9('0x123')](db[_0x09b9('0xa9')],{'as':_0x09b9('0x172'),'foreignKey':_0x09b9('0x1c3')});db[_0x09b9('0xab')][_0x09b9('0x126')](db[_0x09b9('0x85')],{'through':_0x09b9('0x1d1')});db['ZendeskField']['hasMany'](db[_0x09b9('0xac')],{'as':_0x09b9('0x1c8'),'foreignKey':'SubjectId'});db['ZendeskField']['hasMany'](db[_0x09b9('0xac')],{'as':_0x09b9('0x1c9'),'foreignKey':_0x09b9('0x1c6')});db[_0x09b9('0xac')][_0x09b9('0x113')](db[_0x09b9('0xac')],{'as':'Field','foreignKey':_0x09b9('0x1c7')});db[_0x09b9('0xac')][_0x09b9('0x123')](db[_0x09b9('0x8e')],{'as':_0x09b9('0x8e'),'foreignKey':_0x09b9('0x1cb')});db[_0x09b9('0xae')][_0x09b9('0x113')](db[_0x09b9('0xb0')],{'as':'Configurations','onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x1c3')});db['FreshdeskConfiguration']['hasMany'](db[_0x09b9('0xb2')],{'as':'Subjects','onDelete':_0x09b9('0x110'),'foreignKey':'SubjectId'});db[_0x09b9('0xb0')][_0x09b9('0x113')](db['FreshdeskField'],{'as':_0x09b9('0x1cd'),'onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x1c6')});db['FreshdeskConfiguration']['hasMany'](db[_0x09b9('0xb2')],{'as':_0x09b9('0x1bd'),'onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x1c7')});db[_0x09b9('0xb0')]['belongsTo'](db[_0x09b9('0xae')],{'as':_0x09b9('0x172'),'foreignKey':_0x09b9('0x1c3')});db[_0x09b9('0xb0')][_0x09b9('0x126')](db[_0x09b9('0x85')],{'through':_0x09b9('0x1d2')});db['FreshdeskField'][_0x09b9('0x113')](db[_0x09b9('0xb2')],{'as':_0x09b9('0x1c8'),'foreignKey':_0x09b9('0x1c5')});db['FreshdeskField'][_0x09b9('0x113')](db[_0x09b9('0xb2')],{'as':_0x09b9('0x1c9'),'foreignKey':_0x09b9('0x1c6')});db['FreshdeskField'][_0x09b9('0x113')](db[_0x09b9('0xb2')],{'as':_0x09b9('0x1ca'),'foreignKey':_0x09b9('0x1c7')});db['FreshdeskField'][_0x09b9('0x123')](db[_0x09b9('0x8e')],{'as':_0x09b9('0x8e'),'foreignKey':_0x09b9('0x1cb')});db['VtigerAccount']['hasMany'](db['VtigerConfiguration'],{'as':_0x09b9('0x1c2'),'onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x1c3')});db[_0x09b9('0x1d3')]['hasMany'](db[_0x09b9('0xb7')],{'as':'Subjects','foreignKey':_0x09b9('0x1c5')});db[_0x09b9('0x1d3')]['hasMany'](db[_0x09b9('0xb7')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x09b9('0x1d3')]['hasMany'](db[_0x09b9('0xb7')],{'as':_0x09b9('0x1bd'),'foreignKey':_0x09b9('0x1c7')});db[_0x09b9('0x1d3')]['belongsTo'](db[_0x09b9('0xb4')],{'as':'Account','foreignKey':_0x09b9('0x1c3')});db[_0x09b9('0xb7')][_0x09b9('0x113')](db['VtigerField'],{'as':_0x09b9('0x1c8'),'foreignKey':_0x09b9('0x1c5')});db['VtigerField']['hasMany'](db[_0x09b9('0xb7')],{'as':'Description','foreignKey':_0x09b9('0x1c6')});db[_0x09b9('0xb7')][_0x09b9('0x113')](db[_0x09b9('0xb7')],{'as':_0x09b9('0x1ca'),'foreignKey':_0x09b9('0x1c7')});db['VtigerField']['belongsTo'](db[_0x09b9('0x8e')],{'as':_0x09b9('0x8e'),'foreignKey':'VariableId'});db[_0x09b9('0xb8')][_0x09b9('0x113')](db[_0x09b9('0xb9')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0x09b9('0xb9')][_0x09b9('0x113')](db['ServicenowField'],{'as':_0x09b9('0x1c4'),'foreignKey':_0x09b9('0x1c5')});db[_0x09b9('0xb9')][_0x09b9('0x113')](db[_0x09b9('0xbb')],{'as':_0x09b9('0x1cd'),'foreignKey':_0x09b9('0x1c6')});db[_0x09b9('0xb9')][_0x09b9('0x113')](db['ServicenowField'],{'as':'Fields','foreignKey':_0x09b9('0x1c7')});db[_0x09b9('0xb9')][_0x09b9('0x123')](db[_0x09b9('0xb8')],{'as':_0x09b9('0x172'),'foreignKey':_0x09b9('0x1c3')});db[_0x09b9('0xbb')][_0x09b9('0x113')](db[_0x09b9('0xbb')],{'as':'Subject','foreignKey':_0x09b9('0x1c5')});db[_0x09b9('0xbb')][_0x09b9('0x113')](db[_0x09b9('0xbb')],{'as':'Description','foreignKey':_0x09b9('0x1c6')});db[_0x09b9('0xbb')][_0x09b9('0x113')](db[_0x09b9('0xbb')],{'as':'Field','foreignKey':_0x09b9('0x1c7')});db['ServicenowField'][_0x09b9('0x123')](db[_0x09b9('0x8e')],{'as':_0x09b9('0x8e'),'foreignKey':_0x09b9('0x1cb')});db[_0x09b9('0xbd')][_0x09b9('0x113')](db[_0x09b9('0xbf')],{'as':_0x09b9('0x1c2'),'onDelete':_0x09b9('0x110'),'foreignKey':'AccountId'});db['Dynamics365Account'][_0x09b9('0x123')](db[_0x09b9('0x108')],{'as':_0x09b9('0x108'),'foreignKey':'CloudProviderId'});db[_0x09b9('0xbf')][_0x09b9('0x113')](db[_0x09b9('0xc1')],{'as':'Subjects','onDelete':_0x09b9('0x110'),'foreignKey':'SubjectId'});db[_0x09b9('0xbf')]['hasMany'](db[_0x09b9('0xc1')],{'as':'Descriptions','onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x1c6')});db[_0x09b9('0xbf')][_0x09b9('0x113')](db['Dynamics365Field'],{'as':_0x09b9('0x1bd'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x09b9('0xbf')][_0x09b9('0x123')](db[_0x09b9('0xbd')],{'as':'Account','foreignKey':_0x09b9('0x1c3')});db[_0x09b9('0xc1')]['hasMany'](db['Dynamics365Field'],{'as':_0x09b9('0x1c8'),'foreignKey':_0x09b9('0x1c5')});db[_0x09b9('0xc1')]['hasMany'](db['Dynamics365Field'],{'as':_0x09b9('0x1c9'),'foreignKey':_0x09b9('0x1c6')});db[_0x09b9('0xc1')][_0x09b9('0x113')](db[_0x09b9('0xc1')],{'as':'Field','foreignKey':_0x09b9('0x1c7')});db[_0x09b9('0xc1')][_0x09b9('0x123')](db['Variable'],{'as':_0x09b9('0x8e'),'foreignKey':_0x09b9('0x1cb')});db[_0x09b9('0xc3')][_0x09b9('0x113')](db[_0x09b9('0xc5')],{'as':'Configurations','onDelete':_0x09b9('0x110'),'foreignKey':'AccountId'});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0x09b9('0x1c4'),'foreignKey':_0x09b9('0x1c5')});db[_0x09b9('0xc5')][_0x09b9('0x113')](db[_0x09b9('0xc7')],{'as':_0x09b9('0x1cd'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0x09b9('0x1bd'),'foreignKey':_0x09b9('0x1c7')});db[_0x09b9('0xc5')][_0x09b9('0x123')](db[_0x09b9('0xc3')],{'as':_0x09b9('0x172'),'foreignKey':_0x09b9('0x1c3')});db['FreshsalesField']['hasMany'](db['FreshsalesField'],{'as':_0x09b9('0x1c8'),'foreignKey':_0x09b9('0x1c5')});db[_0x09b9('0xc7')][_0x09b9('0x113')](db[_0x09b9('0xc7')],{'as':_0x09b9('0x1c9'),'foreignKey':_0x09b9('0x1c6')});db[_0x09b9('0xc7')][_0x09b9('0x113')](db[_0x09b9('0xc7')],{'as':_0x09b9('0x1ca'),'foreignKey':'FieldId'});db[_0x09b9('0xc7')][_0x09b9('0x123')](db[_0x09b9('0x8e')],{'as':_0x09b9('0x8e'),'foreignKey':_0x09b9('0x1cb')});db[_0x09b9('0x1d4')][_0x09b9('0x123')](db[_0x09b9('0x5c')],{});db['ChatQueueReport']['belongsTo'](db[_0x09b9('0xf3')],{'as':_0x09b9('0x16b'),'foreignKey':_0x09b9('0x16c')});db['ChatQueueReport'][_0x09b9('0x123')](db[_0x09b9('0x12a')],{'as':_0x09b9('0x163'),'foreignKey':_0x09b9('0x17b')});db[_0x09b9('0x1d4')]['belongsTo'](db[_0x09b9('0x11b')],{});db['ChatQueueReport'][_0x09b9('0x123')](db['ChatMessage'],{});db['ChatQueueReport'][_0x09b9('0x123')](db[_0x09b9('0x13')],{});db['ChatQueueReport']['belongsTo'](db[_0x09b9('0x65')],{});db[_0x09b9('0xcd')][_0x09b9('0x123')](db['User'],{'onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x1d5')});db['ChatInternalMessage'][_0x09b9('0x123')](db['User'],{'onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x1d6')});db[_0x09b9('0xd3')]['hasMany'](db[_0x09b9('0xd1')],{'foreignKey':_0x09b9('0x1d7'),'onDelete':_0x09b9('0x110')});db['JscriptySessionReport'][_0x09b9('0x113')](db[_0x09b9('0xcf')],{'foreignKey':_0x09b9('0x1d7'),'onDelete':_0x09b9('0x110')});db[_0x09b9('0xd5')][_0x09b9('0x123')](db['SmsAccount'],{});db['SmsQueueReport'][_0x09b9('0x123')](db['CmList'],{'as':_0x09b9('0x16b'),'foreignKey':'ListId'});db[_0x09b9('0xd5')][_0x09b9('0x123')](db[_0x09b9('0x12a')],{'as':'Contact','foreignKey':'ContactId'});db[_0x09b9('0xd5')][_0x09b9('0x123')](db[_0x09b9('0x52')],{});db[_0x09b9('0xd5')][_0x09b9('0x123')](db[_0x09b9('0x54')],{});db['SmsQueueReport'][_0x09b9('0x123')](db['User'],{});db['SmsQueueReport']['belongsTo'](db[_0x09b9('0x55')],{});db[_0x09b9('0xda')][_0x09b9('0x113')](db[_0x09b9('0xd3')],{'foreignKey':_0x09b9('0x1d8')});db[_0x09b9('0xda')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x09b9('0x1d8')});db[_0x09b9('0xda')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x09b9('0x1d8')});db[_0x09b9('0xde')][_0x09b9('0x126')](db[_0x09b9('0x13')],{'as':_0x09b9('0x184'),'through':_0x09b9('0x148')});db[_0x09b9('0xe3')]['belongsToMany'](db[_0x09b9('0x13')],{'as':_0x09b9('0x158'),'through':'user_has_teams'});db[_0x09b9('0xe3')][_0x09b9('0x126')](db[_0x09b9('0x1b')],{'through':_0x09b9('0x10a'),'as':_0x09b9('0x1d9')});db[_0x09b9('0xe3')]['belongsToMany'](db[_0x09b9('0x3a')],{'through':_0x09b9('0x170'),'as':_0x09b9('0x138')});db['Team'][_0x09b9('0x126')](db[_0x09b9('0x65')],{'through':_0x09b9('0x1da'),'as':_0x09b9('0x139')});db['Team']['belongsToMany'](db['FaxQueue'],{'through':'team_has_fax_queues','as':_0x09b9('0x1db')});db[_0x09b9('0xe3')][_0x09b9('0x126')](db[_0x09b9('0x55')],{'through':_0x09b9('0x1dc'),'as':'SmsQueues'});db[_0x09b9('0xe3')][_0x09b9('0x126')](db[_0x09b9('0x5a')],{'through':_0x09b9('0x1dd'),'as':_0x09b9('0x1de')});db['Team'][_0x09b9('0x126')](db[_0x09b9('0x107')],{'through':_0x09b9('0x1df'),'as':'WhatsappQueues'});db[_0x09b9('0xe3')]['belongsToMany'](db['VoicePrefix'],{'through':_0x09b9('0x1e0'),'as':_0x09b9('0x136')});db[_0x09b9('0x1a3')][_0x09b9('0x113')](db['CmHopper'],{'as':_0x09b9('0x14d'),'foreignKey':_0x09b9('0x1a5')});db[_0x09b9('0x1a3')][_0x09b9('0x113')](db[_0x09b9('0x116')],{'as':'HopperFinals','foreignKey':_0x09b9('0x1a5')});db[_0x09b9('0x1a3')][_0x09b9('0x113')](db[_0x09b9('0x118')],{'as':_0x09b9('0x14e'),'foreignKey':_0x09b9('0x1a5')});db[_0x09b9('0x1a3')][_0x09b9('0x113')](db['CmHopperBlack'],{'as':_0x09b9('0x14f'),'foreignKey':_0x09b9('0x1a5')});db[_0x09b9('0x1a3')][_0x09b9('0x123')](db[_0x09b9('0x151')],{'as':_0x09b9('0x151'),'foreignKey':_0x09b9('0x152')});db[_0x09b9('0x1a3')]['belongsTo'](db['Trunk'],{'as':_0x09b9('0x153'),'foreignKey':_0x09b9('0x154')});db[_0x09b9('0x1a3')][_0x09b9('0x123')](db[_0x09b9('0x7b')],{'as':_0x09b9('0x7b'),'foreignKey':_0x09b9('0x155')});db[_0x09b9('0x1a3')]['belongsTo'](db[_0x09b9('0xde')],{'as':_0x09b9('0xde'),'foreignKey':_0x09b9('0x1e1')});db[_0x09b9('0x1a3')][_0x09b9('0x126')](db[_0x09b9('0xf3')],{'as':_0x09b9('0x12d'),'through':_0x09b9('0x1e2')});db[_0x09b9('0x1a3')]['belongsToMany'](db[_0x09b9('0xf3')],{'as':'BlackLists','through':_0x09b9('0x1e3')});db['Attachment'][_0x09b9('0x123')](db[_0x09b9('0x63')],{'as':_0x09b9('0x63'),'foreignKey':_0x09b9('0x179')});db[_0x09b9('0xed')][_0x09b9('0x123')](db[_0x09b9('0x3f')],{});db[_0x09b9('0xed')][_0x09b9('0x123')](db[_0x09b9('0x3e')],{});db[_0x09b9('0xed')][_0x09b9('0x123')](db['MailAccount'],{'foreignKey':_0x09b9('0x1e4'),'as':_0x09b9('0x1e5')});db[_0x09b9('0xed')]['belongsTo'](db[_0x09b9('0x13')],{'foreignKey':'FromUserId','as':_0x09b9('0x1e6')});db[_0x09b9('0xed')]['belongsTo'](db[_0x09b9('0x13')],{'foreignKey':_0x09b9('0x1e7'),'as':_0x09b9('0x1e8')});db[_0x09b9('0xed')]['belongsTo'](db['MailQueue'],{'foreignKey':_0x09b9('0x1e9'),'as':_0x09b9('0x1ea')});db[_0x09b9('0xed')][_0x09b9('0x123')](db[_0x09b9('0x39')],{'foreignKey':_0x09b9('0x1eb'),'as':_0x09b9('0x1ec')});db[_0x09b9('0xee')][_0x09b9('0x123')](db['ChatMessage'],{});db[_0x09b9('0xee')][_0x09b9('0x123')](db[_0x09b9('0x11b')],{});db[_0x09b9('0xee')]['belongsTo'](db[_0x09b9('0x5c')],{'foreignKey':_0x09b9('0x1ed'),'as':'FromAccount'});db[_0x09b9('0xee')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'foreignKey':_0x09b9('0x1ee'),'as':_0x09b9('0x1e6')});db[_0x09b9('0xee')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'foreignKey':_0x09b9('0x1e7'),'as':_0x09b9('0x1e8')});db[_0x09b9('0xee')]['belongsTo'](db[_0x09b9('0x65')],{'foreignKey':_0x09b9('0x1ef'),'as':'ToQueue'});db[_0x09b9('0xee')][_0x09b9('0x123')](db['ChatWebsite'],{'foreignKey':_0x09b9('0x1f0'),'as':_0x09b9('0x1ec')});db[_0x09b9('0xef')]['belongsTo'](db[_0x09b9('0x4b')],{});db[_0x09b9('0xef')][_0x09b9('0x123')](db[_0x09b9('0x49')],{});db[_0x09b9('0xef')][_0x09b9('0x123')](db[_0x09b9('0x46')],{'foreignKey':_0x09b9('0x1f1'),'as':_0x09b9('0x1e5')});db[_0x09b9('0xef')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'foreignKey':_0x09b9('0x1ee'),'as':_0x09b9('0x1e6')});db[_0x09b9('0xef')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x09b9('0xef')]['belongsTo'](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':_0x09b9('0x1ea')});db[_0x09b9('0xef')]['belongsTo'](db[_0x09b9('0x46')],{'foreignKey':_0x09b9('0x1f2'),'as':_0x09b9('0x1ec')});db[_0x09b9('0xf1')][_0x09b9('0x123')](db[_0x09b9('0x192')],{});db[_0x09b9('0xf1')][_0x09b9('0x123')](db[_0x09b9('0x134')],{});db[_0x09b9('0xf1')][_0x09b9('0x123')](db[_0x09b9('0x56')],{'foreignKey':_0x09b9('0x1f3'),'as':_0x09b9('0x1e5')});db[_0x09b9('0xf1')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'foreignKey':_0x09b9('0x1ee'),'as':'FromAgent'});db[_0x09b9('0xf1')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'foreignKey':_0x09b9('0x1e7'),'as':_0x09b9('0x1e8')});db['OpenchannelTransferReport'][_0x09b9('0x123')](db[_0x09b9('0x5a')],{'foreignKey':_0x09b9('0x1f4'),'as':'ToQueue'});db['OpenchannelTransferReport'][_0x09b9('0x123')](db[_0x09b9('0x56')],{'foreignKey':'ToOpenchannelAccountId','as':_0x09b9('0x1ec')});db['SmsTransferReport']['belongsTo'](db['SmsMessage'],{});db[_0x09b9('0xf2')][_0x09b9('0x123')](db['SmsInteraction'],{});db[_0x09b9('0xf2')]['belongsTo'](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':_0x09b9('0x1e5')});db['SmsTransferReport'][_0x09b9('0x123')](db[_0x09b9('0x13')],{'foreignKey':_0x09b9('0x1ee'),'as':'FromAgent'});db[_0x09b9('0xf2')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'foreignKey':'ToUserId','as':_0x09b9('0x1e8')});db[_0x09b9('0xf2')]['belongsTo'](db[_0x09b9('0x55')],{'foreignKey':_0x09b9('0x1f5'),'as':_0x09b9('0x1ea')});db[_0x09b9('0xf2')]['belongsTo'](db[_0x09b9('0x18a')],{'foreignKey':_0x09b9('0x1f6'),'as':_0x09b9('0x1ec')});db['CmList'][_0x09b9('0x113')](db[_0x09b9('0x78')],{'as':_0x09b9('0x169'),'foreignKey':'ListId','onDelete':_0x09b9('0x110')});db[_0x09b9('0xf3')]['hasMany'](db[_0x09b9('0x70')],{'as':_0x09b9('0x1f7'),'foreignKey':_0x09b9('0x16c')});db[_0x09b9('0xf3')]['hasMany'](db['CmContact'],{'as':_0x09b9('0x12b'),'onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x16c')});db[_0x09b9('0xf3')]['hasMany'](db['CmHopperFinal'],{'as':_0x09b9('0x117'),'foreignKey':_0x09b9('0x16c')});db['CmList'][_0x09b9('0x113')](db[_0x09b9('0x118')],{'as':_0x09b9('0x119'),'foreignKey':_0x09b9('0x16c')});db[_0x09b9('0xf3')]['hasMany'](db[_0x09b9('0x6e')],{'as':'ReportAgentPreview','foreignKey':_0x09b9('0x16c')});db['CmList']['belongsToMany'](db[_0x09b9('0x1b')],{'as':_0x09b9('0x1f8'),'through':_0x09b9('0x157')});db['CmList'][_0x09b9('0x126')](db[_0x09b9('0x13')],{'as':'Agents','through':_0x09b9('0x12e')});db[_0x09b9('0xf5')][_0x09b9('0x113')](db['VoiceExtension'],{'as':'Extensions','onDelete':_0x09b9('0x110')});db[_0x09b9('0xf5')][_0x09b9('0x126')](db[_0x09b9('0x13')],{'as':_0x09b9('0x158'),'through':_0x09b9('0x137')});db[_0x09b9('0xf5')][_0x09b9('0x126')](db[_0x09b9('0xe3')],{'through':_0x09b9('0x1e0'),'as':'Teams'});db['UserProfile']['hasMany'](db[_0x09b9('0x13')],{'as':_0x09b9('0x184'),'foreignKey':_0x09b9('0x125')});db[_0x09b9('0x124')]['hasMany'](db[_0x09b9('0xf8')],{'as':_0x09b9('0x1f9'),'foreignKey':_0x09b9('0x125'),'onDelete':_0x09b9('0x110')});db[_0x09b9('0xf8')]['hasMany'](db['UserProfileResource'],{'as':_0x09b9('0x1fa'),'foreignKey':_0x09b9('0x1fb'),'onDelete':_0x09b9('0x110')});db['WhatsappAccount'][_0x09b9('0x113')](db['Disposition'],{'as':_0x09b9('0x169'),'foreignKey':_0x09b9('0x1fc'),'onDelete':_0x09b9('0x110')});db[_0x09b9('0xfc')][_0x09b9('0x113')](db[_0x09b9('0x76')],{'as':_0x09b9('0x17f'),'foreignKey':_0x09b9('0x1fc')});db[_0x09b9('0xfc')][_0x09b9('0x113')](db['WhatsappMessage'],{'as':'Messages','foreignKey':_0x09b9('0x1fc')});db[_0x09b9('0xfc')][_0x09b9('0x113')](db['WhatsappInteraction'],{'as':_0x09b9('0x16a')});db[_0x09b9('0xfc')]['hasMany'](db[_0x09b9('0x1fd')],{'as':_0x09b9('0x14a')});db['WhatsappAccount'][_0x09b9('0x123')](db[_0x09b9('0xf3')],{'as':_0x09b9('0x16b'),'foreignKey':_0x09b9('0x16c')});db[_0x09b9('0xfc')][_0x09b9('0x123')](db[_0x09b9('0x7c')],{'as':'mandatoryDispositionPause','foreignKey':_0x09b9('0x16f')});db[_0x09b9('0xfc')]['belongsToMany'](db[_0x09b9('0x13')],{'as':_0x09b9('0x158'),'through':_0x09b9('0x146')});db[_0x09b9('0x1fd')][_0x09b9('0x123')](db['User'],{'onDelete':_0x09b9('0x166')});db['WhatsappApplication'][_0x09b9('0x123')](db[_0x09b9('0x107')],{'onDelete':_0x09b9('0x166')});db[_0x09b9('0x1fd')][_0x09b9('0x123')](db[_0x09b9('0xfc')],{'onDelete':_0x09b9('0x166')});db['WhatsappApplication'][_0x09b9('0x123')](db[_0x09b9('0x7b')],{'onDelete':_0x09b9('0x166'),'foreignKey':'IntervalId'});db[_0x09b9('0x1fd')][_0x09b9('0x123')](db[_0x09b9('0x85')],{'onDelete':_0x09b9('0x166'),'foreignKey':_0x09b9('0x17a')});db['WhatsappInteraction'][_0x09b9('0x113')](db[_0x09b9('0x101')],{'as':_0x09b9('0x15c'),'onDelete':_0x09b9('0x110'),'foreignKey':_0x09b9('0x1fe')});db['WhatsappInteraction'][_0x09b9('0x123')](db[_0x09b9('0xfc')],{'as':_0x09b9('0x172'),'foreignKey':'WhatsappAccountId'});db[_0x09b9('0xff')][_0x09b9('0x123')](db[_0x09b9('0x12a')],{'as':_0x09b9('0x163'),'foreignKey':'ContactId'});db[_0x09b9('0xff')][_0x09b9('0x123')](db['User'],{'as':_0x09b9('0x182'),'foreignKey':_0x09b9('0x111')});db[_0x09b9('0xff')][_0x09b9('0x126')](db[_0x09b9('0x85')],{'through':_0x09b9('0x1ff'),'as':_0x09b9('0x174')});db[_0x09b9('0xff')][_0x09b9('0x126')](db[_0x09b9('0x85')],{'through':_0x09b9('0x1ff'),'as':_0x09b9('0x175')});db['WhatsappInteraction'][_0x09b9('0x126')](db['User'],{'as':'Users','through':_0x09b9('0x200'),'foreignKey':_0x09b9('0x1fe')});db[_0x09b9('0x101')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'as':_0x09b9('0x13')});db[_0x09b9('0x101')]['belongsTo'](db[_0x09b9('0x12a')],{'onDelete':'cascade','as':_0x09b9('0x163')});db[_0x09b9('0x101')][_0x09b9('0x123')](db[_0x09b9('0xff')],{'onDelete':_0x09b9('0x110'),'as':_0x09b9('0x177'),'foreignKey':_0x09b9('0x1fe')});db['WhatsappMessage'][_0x09b9('0x123')](db[_0x09b9('0xfc')],{'as':_0x09b9('0x172'),'foreignKey':_0x09b9('0x1fc')});db[_0x09b9('0x103')][_0x09b9('0x123')](db['WhatsappAccount'],{});db['WhatsappQueueReport'][_0x09b9('0x123')](db[_0x09b9('0xf3')],{'as':_0x09b9('0x16b'),'foreignKey':'ListId'});db[_0x09b9('0x103')][_0x09b9('0x123')](db[_0x09b9('0x12a')],{'as':_0x09b9('0x163'),'foreignKey':_0x09b9('0x17b')});db[_0x09b9('0x103')][_0x09b9('0x123')](db['WhatsappInteraction'],{});db['WhatsappQueueReport']['belongsTo'](db['WhatsappQueue'],{});db[_0x09b9('0x103')]['belongsTo'](db[_0x09b9('0x101')],{});db[_0x09b9('0x103')][_0x09b9('0x123')](db['User'],{});db[_0x09b9('0x105')][_0x09b9('0x123')](db[_0x09b9('0x101')],{});db[_0x09b9('0x105')][_0x09b9('0x123')](db[_0x09b9('0xff')],{});db['WhatsappTransferReport'][_0x09b9('0x123')](db[_0x09b9('0xfc')],{'foreignKey':_0x09b9('0x201'),'as':_0x09b9('0x1e5')});db[_0x09b9('0x105')]['belongsTo'](db[_0x09b9('0xfc')],{'foreignKey':_0x09b9('0x202'),'as':_0x09b9('0x1ec')});db[_0x09b9('0x105')][_0x09b9('0x123')](db[_0x09b9('0x107')],{'foreignKey':_0x09b9('0x203'),'as':_0x09b9('0x1ea')});db[_0x09b9('0x105')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'foreignKey':_0x09b9('0x1ee'),'as':_0x09b9('0x1e6')});db[_0x09b9('0x105')][_0x09b9('0x123')](db['User'],{'foreignKey':_0x09b9('0x1e7'),'as':_0x09b9('0x1e8')});db[_0x09b9('0x107')][_0x09b9('0x126')](db[_0x09b9('0x13')],{'as':_0x09b9('0x158'),'through':_0x09b9('0x34'),'foreignKey':_0x09b9('0x204')});db[_0x09b9('0x107')][_0x09b9('0x126')](db['Team'],{'through':_0x09b9('0x1df'),'as':_0x09b9('0x187')});db[_0x09b9('0x10d')][_0x09b9('0x123')](db[_0x09b9('0x13')],{'as':_0x09b9('0x205'),'foreignKey':_0x09b9('0x111'),'onDelete':_0x09b9('0x110'),'hooks':!![]});db[_0x09b9('0x108')][_0x09b9('0x10f')](db[_0x09b9('0xbd')],{'as':_0x09b9('0xbd'),'onDelete':_0x09b9('0x166')});db[_0x09b9('0x108')][_0x09b9('0x10f')](db[_0x09b9('0x36')],{'as':_0x09b9('0x167'),'onDelete':_0x09b9('0x166')});db[_0x09b9('0x108')][_0x09b9('0x10f')](db[_0x09b9('0x37')],{'as':_0x09b9('0x168'),'onDelete':_0x09b9('0x166')});module[_0x09b9('0x206')]={'db':db,'dbH':dbH};
\ No newline at end of file
index cfd420f..6c3fe3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ad9=['./api/contactItemType','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','./api/trigger','/api/variables','./api/variable','./api/integration','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','./api/intZendeskConfiguration','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','/api/teams','./api/team','/api/license','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','/api/rpc','./api/rpc','/api/version','/api/system','/api/pm2','./api/pm2','./api/webbar','/api/logs','/apidoc','static','root','/demo','join','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','express','./errors','./config/environment','./api/client-side-logs','default','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','./api/mailMessage','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/contact_item_types'];(function(_0x1dfa63,_0x362bd4){var _0x26f2a9=function(_0x31cc52){while(--_0x31cc52){_0x1dfa63['push'](_0x1dfa63['shift']());}};_0x26f2a9(++_0x362bd4);}(_0x3ad9,0x1b9));var _0x93ad=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x3ad9[_0x2b5eae];return _0x5f3ac9;};'use strict';var path=require('path');var express=require(_0x93ad('0x0'));var errors=require(_0x93ad('0x1'));var config=require(_0x93ad('0x2'));var setupLoggers=require('./utils/client-side-logger')['setupLoggers'];var clientSideLogs=require(_0x93ad('0x3'));exports[_0x93ad('0x4')]=function(_0x2b7978){return setupLoggers(_0x2b7978)['then'](function(){_0x2b7978[_0x93ad('0x5')](_0x93ad('0x6'),require(_0x93ad('0x7')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x8'),require(_0x93ad('0x9')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xa'),require(_0x93ad('0xb')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xc'),require(_0x93ad('0xd')));_0x2b7978[_0x93ad('0x5')]('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x2b7978[_0x93ad('0x5')]('/api/voice/queues',require(_0x93ad('0xe')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xf'),require(_0x93ad('0x10')));_0x2b7978['use'](_0x93ad('0x11'),require('./api/screenRecording'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x12'),require(_0x93ad('0x13')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x14'),require(_0x93ad('0x15')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x16'),require(_0x93ad('0x17')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x18'),require(_0x93ad('0x19')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x1a'),require('./api/voiceAgentReport'));_0x2b7978['use'](_0x93ad('0x1b'),require('./api/voiceQueueReport'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x1c'),require(_0x93ad('0x1d')));_0x2b7978[_0x93ad('0x5')]('/api/trunks',require(_0x93ad('0x1e')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x1f'),require('./api/voiceTransferReport'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x20'),require('./api/mailServerOut'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x21'),require(_0x93ad('0x22')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x23'),require(_0x93ad('0x24')));_0x2b7978['use']('/api/mail/substatuses',require(_0x93ad('0x25')));_0x2b7978['use'](_0x93ad('0x26'),require(_0x93ad('0x27')));_0x2b7978[_0x93ad('0x5')]('/api/mail/messages',require(_0x93ad('0x28')));_0x2b7978[_0x93ad('0x5')]('/api/mail/applications',require(_0x93ad('0x29')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x2a'),require(_0x93ad('0x2b')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x2c'),require(_0x93ad('0x2d')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x2e'),require(_0x93ad('0x2f')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x30'),require(_0x93ad('0x31')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x32'),require('./api/faxApplication'));_0x2b7978['use'](_0x93ad('0x33'),require('./api/faxInteraction'));_0x2b7978['use'](_0x93ad('0x34'),require(_0x93ad('0x35')));_0x2b7978['use'](_0x93ad('0x36'),require('./api/faxQueue'));_0x2b7978['use']('/api/fax/reports/queue',require(_0x93ad('0x37')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x38'),require(_0x93ad('0x39')));_0x2b7978[_0x93ad('0x5')]('/api/sms/applications',require(_0x93ad('0x3a')));_0x2b7978['use'](_0x93ad('0x3b'),require(_0x93ad('0x3c')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x3d'),require(_0x93ad('0x3e')));_0x2b7978['use'](_0x93ad('0x3f'),require(_0x93ad('0x40')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x41'),require('./api/openchannelAccount'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x42'),require(_0x93ad('0x43')));_0x2b7978['use']('/api/openchannel/interactions',require('./api/openchannelInteraction'));_0x2b7978['use'](_0x93ad('0x44'),require(_0x93ad('0x45')));_0x2b7978['use'](_0x93ad('0x46'),require(_0x93ad('0x47')));_0x2b7978[_0x93ad('0x5')]('/api/chat/websites',require(_0x93ad('0x48')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x49'),require('./api/openchannelQueueReport'));_0x2b7978['use'](_0x93ad('0x4a'),require(_0x93ad('0x4b')));_0x2b7978['use'](_0x93ad('0x4c'),require(_0x93ad('0x4d')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x4e'),require(_0x93ad('0x4f')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x50'),require('./api/chatOfflineMessage'));_0x2b7978[_0x93ad('0x5')]('/api/chat/queues',require('./api/chatQueue'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x51'),require('./api/chatGroup'));_0x2b7978['use'](_0x93ad('0x52'),require(_0x93ad('0x53')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x54'),require(_0x93ad('0x55')));_0x2b7978[_0x93ad('0x5')]('/api/cm/contacts',require(_0x93ad('0x56')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x57'),require(_0x93ad('0x58')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x59'),require(_0x93ad('0x5a')));_0x2b7978['use'](_0x93ad('0x5b'),require('./api/cmHopperFinal'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x5c'),require(_0x93ad('0x5d')));_0x2b7978['use'](_0x93ad('0x5e'),require(_0x93ad('0x5f')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x60'),require(_0x93ad('0x61')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x62'),require(_0x93ad('0x63')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x64'),require(_0x93ad('0x65')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x66'),require('./api/disposition'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x67'),require(_0x93ad('0x68')));_0x2b7978[_0x93ad('0x5')]('/api/intervals',require(_0x93ad('0x69')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x6a'),require(_0x93ad('0x6b')));_0x2b7978['use'](_0x93ad('0x6c'),require(_0x93ad('0x6d')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x6e'),require(_0x93ad('0x6f')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x70'),require(_0x93ad('0x71')));_0x2b7978['use'](_0x93ad('0x72'),require(_0x93ad('0x73')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x74'),require(_0x93ad('0x75')));_0x2b7978['use'](_0x93ad('0x76'),require(_0x93ad('0x77')));_0x2b7978[_0x93ad('0x5')]('/api/cm_contact_has_items',require(_0x93ad('0x78')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x79'),require(_0x93ad('0x7a')));_0x2b7978['use']('/api/templates',require(_0x93ad('0x7b')));_0x2b7978[_0x93ad('0x5')]('/api/triggers',require(_0x93ad('0x7c')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x7d'),require(_0x93ad('0x7e')));_0x2b7978['use']('/api/integrations',require(_0x93ad('0x7f')));_0x2b7978[_0x93ad('0x5')]('/api/integrations/reports',require('./api/integrationReport'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x80'),require(_0x93ad('0x81')));_0x2b7978[_0x93ad('0x5')]('/api/analytics/default_reports',require(_0x93ad('0x82')));_0x2b7978['use'](_0x93ad('0x83'),require(_0x93ad('0x84')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x85'),require(_0x93ad('0x86')));_0x2b7978['use'](_0x93ad('0x87'),require(_0x93ad('0x88')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x89'),require('./api/analyticTreeReport'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x8a'),require(_0x93ad('0x8b')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x8c'),require(_0x93ad('0x8d')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x8e'),require(_0x93ad('0x8f')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x90'),require('./api/intSugarcrmAccount'));_0x2b7978['use'](_0x93ad('0x91'),require(_0x93ad('0x92')));_0x2b7978['use'](_0x93ad('0x93'),require(_0x93ad('0x94')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x95'),require('./api/intDeskAccount'));_0x2b7978['use'](_0x93ad('0x96'),require('./api/intDeskConfiguration'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x97'),require(_0x93ad('0x98')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x99'),require(_0x93ad('0x9a')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x9b'),require(_0x93ad('0x9c')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x9d'),require(_0x93ad('0x9e')));_0x2b7978[_0x93ad('0x5')]('/api/integrations/zendesk/accounts',require(_0x93ad('0x9f')));_0x2b7978['use']('/api/integrations/zendesk/configurations',require(_0x93ad('0xa0')));_0x2b7978[_0x93ad('0x5')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x2b7978[_0x93ad('0x5')]('/api/integrations/freshdesk/accounts',require(_0x93ad('0xa1')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xa2'),require(_0x93ad('0xa3')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xa4'),require(_0x93ad('0xa5')));_0x2b7978[_0x93ad('0x5')]('/api/integrations/vtiger/accounts',require(_0x93ad('0xa6')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xa7'),require(_0x93ad('0xa8')));_0x2b7978['use'](_0x93ad('0xa9'),require(_0x93ad('0xaa')));_0x2b7978[_0x93ad('0x5')]('/api/integrations/servicenow/accounts',require(_0x93ad('0xab')));_0x2b7978[_0x93ad('0x5')]('/api/integrations/servicenow/configurations',require(_0x93ad('0xac')));_0x2b7978['use']('/api/integrations/servicenow/fields',require(_0x93ad('0xad')));_0x2b7978['use'](_0x93ad('0xae'),require(_0x93ad('0xaf')));_0x2b7978[_0x93ad('0x5')]('/api/integrations/dynamics365/configurations',require(_0x93ad('0xb0')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xb1'),require(_0x93ad('0xb2')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xb3'),require('./api/intFreshsalesAccount'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xb4'),require(_0x93ad('0xb5')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xb6'),require(_0x93ad('0xb7')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xb8'),require('./api/network'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xb9'),require(_0x93ad('0xba')));_0x2b7978['use'](_0x93ad('0xbb'),require(_0x93ad('0xbc')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xbd'),require(_0x93ad('0xbe')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xbf'),require(_0x93ad('0xc0')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xc1'),require(_0x93ad('0xc2')));_0x2b7978['use'](_0x93ad('0xc3'),require('./api/smsQueueReport'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xc4'),require(_0x93ad('0xc5')));_0x2b7978['use'](_0x93ad('0xc6'),require(_0x93ad('0xc7')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xc8'),require(_0x93ad('0xc9')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xca'),require(_0x93ad('0xcb')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xcc'),require(_0x93ad('0xcd')));_0x2b7978['use'](_0x93ad('0xce'),require(_0x93ad('0xcf')));_0x2b7978['use'](_0x93ad('0xd0'),require('./api/squareRecording'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xd1'),require('./api/squareMessage'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xd2'),require(_0x93ad('0xd3')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xd4'),require('./api/license'));_0x2b7978['use']('/api/campaigns',require('./api/campaign'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xd5'),require(_0x93ad('0xd6')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xd7'),require(_0x93ad('0xd8')));_0x2b7978['use'](_0x93ad('0xd9'),require(_0x93ad('0xda')));_0x2b7978[_0x93ad('0x5')]('/api/mail/reports/transfer',require(_0x93ad('0xdb')));_0x2b7978['use'](_0x93ad('0xdc'),require(_0x93ad('0xdd')));_0x2b7978['use'](_0x93ad('0xde'),require('./api/faxTransferReport'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xdf'),require(_0x93ad('0xe0')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xe1'),require(_0x93ad('0xe2')));_0x2b7978[_0x93ad('0x5')]('/api/cm/lists',require(_0x93ad('0xe3')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xe4'),require('./api/voicePrefix'));_0x2b7978[_0x93ad('0x5')]('/api/userProfiles',require(_0x93ad('0xe5')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xe6'),require(_0x93ad('0xe7')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xe8'),require(_0x93ad('0xe9')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xea'),require(_0x93ad('0xeb')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xec'),require('./api/whatsappAccount'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xed'),require(_0x93ad('0xee')));_0x2b7978['use'](_0x93ad('0xef'),require(_0x93ad('0xf0')));_0x2b7978['use']('/api/whatsapp/messages',require(_0x93ad('0xf1')));_0x2b7978['use'](_0x93ad('0xf2'),require(_0x93ad('0xf3')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xf4'),require('./api/whatsappTransferReport'));_0x2b7978['use'](_0x93ad('0xf5'),require(_0x93ad('0xf6')));_0x2b7978[_0x93ad('0x5')]('/api/cloudProviders',require('./api/cloudProvider'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xf7'),require(_0x93ad('0xf8')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xf9'),require(_0x93ad('0xfa')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xfb'),require(_0x93ad('0xfc')));_0x2b7978[_0x93ad('0x5')]('/api/auth/google',require('./api/authGoogle'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xfd'),require(_0x93ad('0xfe')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0xff'),require('./api/jira'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x100'),require(_0x93ad('0x101')));_0x2b7978['use'](_0x93ad('0x102'),require('./api/version'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x103'),require('./api/system'));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x104'),require(_0x93ad('0x105')));_0x2b7978[_0x93ad('0x5')]('/api/webbar',require(_0x93ad('0x106')));_0x2b7978['use'](_0x93ad('0x107'),clientSideLogs);_0x2b7978[_0x93ad('0x5')](_0x93ad('0x108'),express[_0x93ad('0x109')](path['join'](config[_0x93ad('0x10a')],'/apidoc')));_0x2b7978[_0x93ad('0x5')]('/www',express['static'](path['join'](config[_0x93ad('0x10a')],'/www')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x10b'),express['static'](path[_0x93ad('0x10c')](config[_0x93ad('0x10a')],'/demo')));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x10d'),express[_0x93ad('0x109')](path[_0x93ad('0x10c')](config[_0x93ad('0x10a')],_0x93ad('0x10e'),_0x93ad('0x10f'))));_0x2b7978[_0x93ad('0x5')](_0x93ad('0x110'),express[_0x93ad('0x109')](path[_0x93ad('0x10c')](config[_0x93ad('0x10a')],_0x93ad('0x111'))));_0x2b7978[_0x93ad('0x112')](_0x93ad('0x113'))[_0x93ad('0x114')](errors[0x194]);_0x2b7978['route']('/*')[_0x93ad('0x114')](function(_0x11eeba,_0x36e99a){_0x36e99a['sendFile'](path[_0x93ad('0x115')](_0x2b7978[_0x93ad('0x114')](_0x93ad('0x116'))+_0x93ad('0x117')));});return _0x2b7978;});};
\ No newline at end of file
+var _0xf687=['./api/authActiveDirectory','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','resolve','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','/api/users','./api/user','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/mailServerOut','/api/mail/accounts','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/messages','./api/mailMessage','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/smsAccount','/api/sms/applications','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatGroup','/api/cm/companies','./api/cmCompany','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','/api/actions','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','./api/license','./api/campaign','/api/migrations','./api/migration','/api/plugins','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/smsTransferReport','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google'];(function(_0x1f02fa,_0x328cad){var _0x16d648=function(_0x7c1a62){while(--_0x7c1a62){_0x1f02fa['push'](_0x1f02fa['shift']());}};_0x16d648(++_0x328cad);}(_0xf687,0x120));var _0x7f68=function(_0x3e2d17,_0x3f5495){_0x3e2d17=_0x3e2d17-0x0;var _0x18836e=_0xf687[_0x3e2d17];return _0x18836e;};'use strict';var path=require(_0x7f68('0x0'));var express=require(_0x7f68('0x1'));var errors=require(_0x7f68('0x2'));var config=require(_0x7f68('0x3'));var setupLoggers=require(_0x7f68('0x4'))[_0x7f68('0x5')];var clientSideLogs=require(_0x7f68('0x6'));exports[_0x7f68('0x7')]=function(_0x175247){return setupLoggers(_0x175247)['then'](function(){_0x175247['use'](_0x7f68('0x8'),require(_0x7f68('0x9')));_0x175247[_0x7f68('0xa')](_0x7f68('0xb'),require(_0x7f68('0xc')));_0x175247['use'](_0x7f68('0xd'),require('./api/voiceContext'));_0x175247[_0x7f68('0xa')](_0x7f68('0xe'),require(_0x7f68('0xf')));_0x175247[_0x7f68('0xa')](_0x7f68('0x10'),require(_0x7f68('0x11')));_0x175247[_0x7f68('0xa')](_0x7f68('0x12'),require(_0x7f68('0x13')));_0x175247[_0x7f68('0xa')](_0x7f68('0x14'),require(_0x7f68('0x15')));_0x175247[_0x7f68('0xa')]('/api/screen/recordings',require('./api/screenRecording'));_0x175247['use'](_0x7f68('0x16'),require(_0x7f68('0x17')));_0x175247['use']('/api/voice/mails/messages',require(_0x7f68('0x18')));_0x175247[_0x7f68('0xa')](_0x7f68('0x19'),require(_0x7f68('0x1a')));_0x175247[_0x7f68('0xa')]('/api/voice/dials/reports',require(_0x7f68('0x1b')));_0x175247['use']('/api/voice/agents/reports',require(_0x7f68('0x1c')));_0x175247[_0x7f68('0xa')]('/api/voice/queues/reports',require(_0x7f68('0x1d')));_0x175247[_0x7f68('0xa')](_0x7f68('0x1e'),require(_0x7f68('0x1f')));_0x175247[_0x7f68('0xa')](_0x7f68('0x20'),require(_0x7f68('0x21')));_0x175247[_0x7f68('0xa')]('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x175247[_0x7f68('0xa')]('/api/mail/out_servers',require(_0x7f68('0x22')));_0x175247[_0x7f68('0xa')](_0x7f68('0x23'),require('./api/mailAccount'));_0x175247['use'](_0x7f68('0x24'),require('./api/mailQueue'));_0x175247[_0x7f68('0xa')](_0x7f68('0x25'),require(_0x7f68('0x26')));_0x175247['use']('/api/mail/interactions',require('./api/mailInteraction'));_0x175247[_0x7f68('0xa')](_0x7f68('0x27'),require(_0x7f68('0x28')));_0x175247[_0x7f68('0xa')]('/api/mail/applications',require('./api/mailApplication'));_0x175247[_0x7f68('0xa')](_0x7f68('0x29'),require(_0x7f68('0x2a')));_0x175247['use'](_0x7f68('0x2b'),require('./api/dashboard'));_0x175247[_0x7f68('0xa')](_0x7f68('0x2c'),require('./api/dashboardItem'));_0x175247[_0x7f68('0xa')](_0x7f68('0x2d'),require(_0x7f68('0x2e')));_0x175247['use']('/api/fax/applications',require('./api/faxApplication'));_0x175247['use'](_0x7f68('0x2f'),require(_0x7f68('0x30')));_0x175247['use'](_0x7f68('0x31'),require(_0x7f68('0x32')));_0x175247['use'](_0x7f68('0x33'),require(_0x7f68('0x34')));_0x175247['use']('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x175247[_0x7f68('0xa')]('/api/sms/accounts',require(_0x7f68('0x35')));_0x175247[_0x7f68('0xa')](_0x7f68('0x36'),require('./api/smsApplication'));_0x175247[_0x7f68('0xa')](_0x7f68('0x37'),require('./api/smsInteraction'));_0x175247[_0x7f68('0xa')](_0x7f68('0x38'),require(_0x7f68('0x39')));_0x175247[_0x7f68('0xa')](_0x7f68('0x3a'),require('./api/smsQueue'));_0x175247[_0x7f68('0xa')](_0x7f68('0x3b'),require(_0x7f68('0x3c')));_0x175247['use'](_0x7f68('0x3d'),require(_0x7f68('0x3e')));_0x175247['use'](_0x7f68('0x3f'),require(_0x7f68('0x40')));_0x175247[_0x7f68('0xa')](_0x7f68('0x41'),require(_0x7f68('0x42')));_0x175247[_0x7f68('0xa')](_0x7f68('0x43'),require(_0x7f68('0x44')));_0x175247[_0x7f68('0xa')](_0x7f68('0x45'),require(_0x7f68('0x46')));_0x175247[_0x7f68('0xa')](_0x7f68('0x47'),require(_0x7f68('0x48')));_0x175247[_0x7f68('0xa')](_0x7f68('0x49'),require(_0x7f68('0x4a')));_0x175247[_0x7f68('0xa')]('/api/chat/interactions',require(_0x7f68('0x4b')));_0x175247[_0x7f68('0xa')]('/api/chat/messages',require(_0x7f68('0x4c')));_0x175247[_0x7f68('0xa')](_0x7f68('0x4d'),require(_0x7f68('0x4e')));_0x175247[_0x7f68('0xa')](_0x7f68('0x4f'),require('./api/chatQueue'));_0x175247[_0x7f68('0xa')]('/api/chat/groups',require(_0x7f68('0x50')));_0x175247[_0x7f68('0xa')]('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x175247['use'](_0x7f68('0x51'),require(_0x7f68('0x52')));_0x175247['use']('/api/cm/contacts',require('./api/cmContact'));_0x175247['use'](_0x7f68('0x53'),require(_0x7f68('0x54')));_0x175247[_0x7f68('0xa')](_0x7f68('0x55'),require(_0x7f68('0x56')));_0x175247[_0x7f68('0xa')](_0x7f68('0x57'),require('./api/cmHopperFinal'));_0x175247['use'](_0x7f68('0x58'),require('./api/cmHopperHistory'));_0x175247[_0x7f68('0xa')]('/api/cm/custom_fields',require('./api/cmCustomField'));_0x175247[_0x7f68('0xa')](_0x7f68('0x59'),require('./api/action'));_0x175247[_0x7f68('0xa')](_0x7f68('0x5a'),require(_0x7f68('0x5b')));_0x175247['use'](_0x7f68('0x5c'),require('./api/cannedAnswer'));_0x175247[_0x7f68('0xa')](_0x7f68('0x5d'),require(_0x7f68('0x5e')));_0x175247[_0x7f68('0xa')](_0x7f68('0x5f'),require(_0x7f68('0x60')));_0x175247['use'](_0x7f68('0x61'),require(_0x7f68('0x62')));_0x175247[_0x7f68('0xa')](_0x7f68('0x63'),require(_0x7f68('0x64')));_0x175247[_0x7f68('0xa')]('/api/cdr',require(_0x7f68('0x65')));_0x175247[_0x7f68('0xa')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x175247[_0x7f68('0xa')](_0x7f68('0x66'),require(_0x7f68('0x67')));_0x175247[_0x7f68('0xa')](_0x7f68('0x68'),require(_0x7f68('0x69')));_0x175247[_0x7f68('0xa')](_0x7f68('0x6a'),require(_0x7f68('0x6b')));_0x175247[_0x7f68('0xa')]('/api/contact_item_types',require(_0x7f68('0x6c')));_0x175247[_0x7f68('0xa')](_0x7f68('0x6d'),require(_0x7f68('0x6e')));_0x175247['use'](_0x7f68('0x6f'),require(_0x7f68('0x70')));_0x175247['use'](_0x7f68('0x71'),require(_0x7f68('0x72')));_0x175247[_0x7f68('0xa')](_0x7f68('0x73'),require(_0x7f68('0x74')));_0x175247[_0x7f68('0xa')](_0x7f68('0x75'),require(_0x7f68('0x76')));_0x175247['use'](_0x7f68('0x77'),require(_0x7f68('0x78')));_0x175247[_0x7f68('0xa')]('/api/integrations/reports',require('./api/integrationReport'));_0x175247[_0x7f68('0xa')](_0x7f68('0x79'),require('./api/analyticCustomReport'));_0x175247[_0x7f68('0xa')](_0x7f68('0x7a'),require(_0x7f68('0x7b')));_0x175247[_0x7f68('0xa')](_0x7f68('0x7c'),require(_0x7f68('0x7d')));_0x175247[_0x7f68('0xa')]('/api/analytics/metrics',require(_0x7f68('0x7e')));_0x175247[_0x7f68('0xa')]('/api/analytics/field_reports',require(_0x7f68('0x7f')));_0x175247['use'](_0x7f68('0x80'),require(_0x7f68('0x81')));_0x175247[_0x7f68('0xa')](_0x7f68('0x82'),require(_0x7f68('0x83')));_0x175247['use'](_0x7f68('0x84'),require('./api/intSalesforceConfiguration'));_0x175247[_0x7f68('0xa')]('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x175247['use']('/api/integrations/sugarcrm/accounts',require(_0x7f68('0x85')));_0x175247[_0x7f68('0xa')](_0x7f68('0x86'),require('./api/intSugarcrmConfiguration'));_0x175247[_0x7f68('0xa')](_0x7f68('0x87'),require('./api/intSugarcrmField'));_0x175247[_0x7f68('0xa')](_0x7f68('0x88'),require(_0x7f68('0x89')));_0x175247[_0x7f68('0xa')](_0x7f68('0x8a'),require(_0x7f68('0x8b')));_0x175247[_0x7f68('0xa')](_0x7f68('0x8c'),require(_0x7f68('0x8d')));_0x175247[_0x7f68('0xa')](_0x7f68('0x8e'),require(_0x7f68('0x8f')));_0x175247[_0x7f68('0xa')](_0x7f68('0x90'),require('./api/intZohoConfiguration'));_0x175247['use'](_0x7f68('0x91'),require(_0x7f68('0x92')));_0x175247['use'](_0x7f68('0x93'),require('./api/intZendeskAccount'));_0x175247[_0x7f68('0xa')](_0x7f68('0x94'),require('./api/intZendeskConfiguration'));_0x175247['use'](_0x7f68('0x95'),require(_0x7f68('0x96')));_0x175247[_0x7f68('0xa')](_0x7f68('0x97'),require(_0x7f68('0x98')));_0x175247['use'](_0x7f68('0x99'),require('./api/intFreshdeskConfiguration'));_0x175247[_0x7f68('0xa')]('/api/integrations/freshdesk/fields',require(_0x7f68('0x9a')));_0x175247['use'](_0x7f68('0x9b'),require(_0x7f68('0x9c')));_0x175247['use'](_0x7f68('0x9d'),require(_0x7f68('0x9e')));_0x175247[_0x7f68('0xa')](_0x7f68('0x9f'),require(_0x7f68('0xa0')));_0x175247[_0x7f68('0xa')](_0x7f68('0xa1'),require(_0x7f68('0xa2')));_0x175247['use']('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x175247[_0x7f68('0xa')](_0x7f68('0xa3'),require('./api/intServicenowField'));_0x175247['use'](_0x7f68('0xa4'),require(_0x7f68('0xa5')));_0x175247[_0x7f68('0xa')](_0x7f68('0xa6'),require(_0x7f68('0xa7')));_0x175247[_0x7f68('0xa')](_0x7f68('0xa8'),require(_0x7f68('0xa9')));_0x175247[_0x7f68('0xa')](_0x7f68('0xaa'),require(_0x7f68('0xab')));_0x175247[_0x7f68('0xa')](_0x7f68('0xac'),require('./api/intFreshsalesConfiguration'));_0x175247['use'](_0x7f68('0xad'),require(_0x7f68('0xae')));_0x175247[_0x7f68('0xa')](_0x7f68('0xaf'),require(_0x7f68('0xb0')));_0x175247['use'](_0x7f68('0xb1'),require(_0x7f68('0xb2')));_0x175247[_0x7f68('0xa')]('/api/chat/internal/messages',require(_0x7f68('0xb3')));_0x175247[_0x7f68('0xa')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x175247['use'](_0x7f68('0xb4'),require(_0x7f68('0xb5')));_0x175247['use']('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x175247[_0x7f68('0xa')](_0x7f68('0xb6'),require(_0x7f68('0xb7')));_0x175247[_0x7f68('0xa')](_0x7f68('0xb8'),require(_0x7f68('0xb9')));_0x175247[_0x7f68('0xa')](_0x7f68('0xba'),require('./api/squareReportDetail'));_0x175247[_0x7f68('0xa')]('/api/jscripty/projects',require(_0x7f68('0xbb')));_0x175247['use']('/api/settings',require(_0x7f68('0xbc')));_0x175247[_0x7f68('0xa')](_0x7f68('0xbd'),require(_0x7f68('0xbe')));_0x175247['use']('/api/square/projects',require(_0x7f68('0xbf')));_0x175247[_0x7f68('0xa')](_0x7f68('0xc0'),require('./api/squareRecording'));_0x175247[_0x7f68('0xa')](_0x7f68('0xc1'),require(_0x7f68('0xc2')));_0x175247[_0x7f68('0xa')]('/api/teams',require('./api/team'));_0x175247['use']('/api/license',require(_0x7f68('0xc3')));_0x175247[_0x7f68('0xa')]('/api/campaigns',require(_0x7f68('0xc4')));_0x175247[_0x7f68('0xa')](_0x7f68('0xc5'),require(_0x7f68('0xc6')));_0x175247['use']('/api/attachments',require('./api/attachment'));_0x175247[_0x7f68('0xa')](_0x7f68('0xc7'),require('./api/plugin'));_0x175247[_0x7f68('0xa')](_0x7f68('0xc8'),require('./api/mailTransferReport'));_0x175247[_0x7f68('0xa')](_0x7f68('0xc9'),require(_0x7f68('0xca')));_0x175247[_0x7f68('0xa')](_0x7f68('0xcb'),require('./api/faxTransferReport'));_0x175247[_0x7f68('0xa')](_0x7f68('0xcc'),require('./api/openchannelTransferReport'));_0x175247[_0x7f68('0xa')]('/api/sms/reports/transfer',require(_0x7f68('0xcd')));_0x175247[_0x7f68('0xa')]('/api/cm/lists',require('./api/cmList'));_0x175247['use'](_0x7f68('0xce'),require(_0x7f68('0xcf')));_0x175247['use'](_0x7f68('0xd0'),require(_0x7f68('0xd1')));_0x175247[_0x7f68('0xa')](_0x7f68('0xd2'),require(_0x7f68('0xd3')));_0x175247['use'](_0x7f68('0xd4'),require(_0x7f68('0xd5')));_0x175247[_0x7f68('0xa')](_0x7f68('0xd6'),require('./api/userNotification'));_0x175247[_0x7f68('0xa')]('/api/whatsapp/accounts',require(_0x7f68('0xd7')));_0x175247[_0x7f68('0xa')](_0x7f68('0xd8'),require('./api/whatsappApplication'));_0x175247['use'](_0x7f68('0xd9'),require(_0x7f68('0xda')));_0x175247[_0x7f68('0xa')](_0x7f68('0xdb'),require(_0x7f68('0xdc')));_0x175247[_0x7f68('0xa')](_0x7f68('0xdd'),require(_0x7f68('0xde')));_0x175247['use'](_0x7f68('0xdf'),require('./api/whatsappTransferReport'));_0x175247[_0x7f68('0xa')](_0x7f68('0xe0'),require(_0x7f68('0xe1')));_0x175247[_0x7f68('0xa')](_0x7f68('0xe2'),require('./api/cloudProvider'));_0x175247[_0x7f68('0xa')](_0x7f68('0xe3'),require(_0x7f68('0xe4')));_0x175247[_0x7f68('0xa')](_0x7f68('0xe5'),require(_0x7f68('0xe6')));_0x175247[_0x7f68('0xa')](_0x7f68('0xe7'),require(_0x7f68('0xe8')));_0x175247[_0x7f68('0xa')](_0x7f68('0xe9'),require('./api/authGoogle'));_0x175247[_0x7f68('0xa')]('/api/auth/activedirectory',require(_0x7f68('0xea')));_0x175247[_0x7f68('0xa')]('/api/jira',require(_0x7f68('0xeb')));_0x175247[_0x7f68('0xa')](_0x7f68('0xec'),require(_0x7f68('0xed')));_0x175247[_0x7f68('0xa')](_0x7f68('0xee'),require(_0x7f68('0xef')));_0x175247[_0x7f68('0xa')](_0x7f68('0xf0'),require(_0x7f68('0xf1')));_0x175247['use'](_0x7f68('0xf2'),require('./api/pm2'));_0x175247[_0x7f68('0xa')](_0x7f68('0xf3'),require(_0x7f68('0xf4')));_0x175247[_0x7f68('0xa')](_0x7f68('0xf5'),clientSideLogs);_0x175247[_0x7f68('0xa')](_0x7f68('0xf6'),express[_0x7f68('0xf7')](path[_0x7f68('0xf8')](config[_0x7f68('0xf9')],_0x7f68('0xf6'))));_0x175247[_0x7f68('0xa')](_0x7f68('0xfa'),express['static'](path['join'](config[_0x7f68('0xf9')],'/www')));_0x175247[_0x7f68('0xa')](_0x7f68('0xfb'),express[_0x7f68('0xf7')](path[_0x7f68('0xf8')](config[_0x7f68('0xf9')],'/demo')));_0x175247['use'](_0x7f68('0xfc'),express[_0x7f68('0xf7')](path['join'](config[_0x7f68('0xf9')],'snippet','3.0.0')));_0x175247[_0x7f68('0xa')](_0x7f68('0xfd'),express['static'](path['join'](config[_0x7f68('0xf9')],_0x7f68('0xfe'))));_0x175247['route'](_0x7f68('0xff'))[_0x7f68('0x100')](errors[0x194]);_0x175247[_0x7f68('0x101')]('/*')[_0x7f68('0x100')](function(_0x33080a,_0x1ee2d2){_0x1ee2d2[_0x7f68('0x102')](path[_0x7f68('0x103')](_0x175247[_0x7f68('0x100')]('appPath')+_0x7f68('0x104')));});return _0x175247;});};
\ No newline at end of file
index ce2adcf..e4e98fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ca8=['../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/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','RPC\x20listening\x20on\x20','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueueReport/faxQueueReport.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/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7ca8,0xf5));var _0x87ca=function(_0x2a0e73,_0x4cbb8b){_0x2a0e73=_0x2a0e73-0x0;var _0x52a3cd=_0x7ca8[_0x2a0e73];return _0x52a3cd;};'use strict';var jayson=require('jayson/promise');var _=require(_0x87ca('0x0'));var config=require(_0x87ca('0x1'));exports[_0x87ca('0x2')]=function(){return new Promise(function(_0x4549d9,_0x2968b3){var _0x17faf2={};_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x4')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x5')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x6')));_0x17faf2=_['merge'](_0x17faf2,require('../api/voiceRecording/voiceRecording.rpc'));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x7')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x8')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x9')));_0x17faf2=_['merge'](_0x17faf2,require(_0x87ca('0xa')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require('../api/memberReport/memberReport.rpc'));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require('../api/trunk/trunk.rpc'));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0xb')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0xc')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0xd')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0xe')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require('../api/mailInteraction/mailInteraction.rpc'));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require('../api/mailMessage/mailMessage.rpc'));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0xf')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x10')));_0x17faf2=_['merge'](_0x17faf2,require(_0x87ca('0x11')));_0x17faf2=_['merge'](_0x17faf2,require(_0x87ca('0x12')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x13')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require('../api/faxMessage/faxMessage.rpc'));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require('../api/faxQueue/faxQueue.rpc'));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x14')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require('../api/smsAccount/smsAccount.rpc'));_0x17faf2=_['merge'](_0x17faf2,require(_0x87ca('0x15')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x16')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x17')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x18')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x19')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x1a')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x1b')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require('../api/chatInteraction/chatInteraction.rpc'));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x1c')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x1d')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require('../api/cmContact/cmContact.rpc'));_0x17faf2=_['merge'](_0x17faf2,require(_0x87ca('0x1e')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x1f')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x20')));_0x17faf2=_['merge'](_0x17faf2,require(_0x87ca('0x21')));_0x17faf2=_['merge'](_0x17faf2,require(_0x87ca('0x22')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x23')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x24')));_0x17faf2=_['merge'](_0x17faf2,require(_0x87ca('0x25')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x26')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x27')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x28')));_0x17faf2=_['merge'](_0x17faf2,require(_0x87ca('0x29')));_0x17faf2=_['merge'](_0x17faf2,require(_0x87ca('0x2a')));_0x17faf2=_['merge'](_0x17faf2,require(_0x87ca('0x2b')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x2c')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x2d')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x2e')));_0x17faf2=_['merge'](_0x17faf2,require(_0x87ca('0x2f')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x17faf2=_['merge'](_0x17faf2,require(_0x87ca('0x30')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x31')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x32')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x33')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x34')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x35')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x36')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x37')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x38')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x39')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require('../api/squareMessage/squareMessage.rpc'));_0x17faf2=_['merge'](_0x17faf2,require(_0x87ca('0x3a')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x3b')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x3c')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x3d')));_0x17faf2=_['merge'](_0x17faf2,require(_0x87ca('0x3e')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x3f')));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x17faf2=_[_0x87ca('0x3')](_0x17faf2,require(_0x87ca('0x40')));var _0x1ae303=jayson['server'](_0x17faf2)[_0x87ca('0x41')]();var _0x46df97=config[_0x87ca('0x42')][_0x87ca('0x43')]||config[_0x87ca('0x43')]+0x1;var _0x571b4c=config[_0x87ca('0x42')]['ip']||'localhost';_0x1ae303['on']('error',function(_0x3d7d7f){return _0x2968b3(_0x3d7d7f);});_0x1ae303['listen'](_0x46df97,_0x571b4c,function(){console[_0x87ca('0x44')](_0x87ca('0x45'),_0x571b4c,_0x46df97);require('../config/triggers')['default']();return _0x4549d9(_0x87ca('0x46')+_0x571b4c+':'+_0x46df97);});});};
\ No newline at end of file
+var _0x3955=['../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc'];(function(_0x222c9f,_0x515cd0){var _0x3e74b5=function(_0x1597c4){while(--_0x1597c4){_0x222c9f['push'](_0x222c9f['shift']());}};_0x3e74b5(++_0x515cd0);}(_0x3955,0x7b));var _0x5395=function(_0x1b8759,_0x372c67){_0x1b8759=_0x1b8759-0x0;var _0x52ecb4=_0x3955[_0x1b8759];return _0x52ecb4;};'use strict';var jayson=require(_0x5395('0x0'));var _=require('lodash');var config=require(_0x5395('0x1'));exports['listen']=function(){return new Promise(function(_0x41316f,_0x178842){var _0x1c7553={};_0x1c7553=_['merge'](_0x1c7553,require('../api/user/user.rpc'));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x3')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x4')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x5')));_0x1c7553=_['merge'](_0x1c7553,require(_0x5395('0x6')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x7')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x8')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x9')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0xa')));_0x1c7553=_['merge'](_0x1c7553,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0xb')));_0x1c7553=_['merge'](_0x1c7553,require(_0x5395('0xc')));_0x1c7553=_['merge'](_0x1c7553,require(_0x5395('0xd')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0xe')));_0x1c7553=_['merge'](_0x1c7553,require(_0x5395('0xf')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x10')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x11')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x12')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x13')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require('../api/faxApplication/faxApplication.rpc'));_0x1c7553=_['merge'](_0x1c7553,require(_0x5395('0x14')));_0x1c7553=_['merge'](_0x1c7553,require('../api/faxMessage/faxMessage.rpc'));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require('../api/faxQueue/faxQueue.rpc'));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x15')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require('../api/smsAccount/smsAccount.rpc'));_0x1c7553=_['merge'](_0x1c7553,require(_0x5395('0x16')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x17')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require('../api/smsQueue/smsQueue.rpc'));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x18')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x19')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x1a')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x1b')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require('../api/chatInteraction/chatInteraction.rpc'));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require('../api/chatMessage/chatMessage.rpc'));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x1c')));_0x1c7553=_['merge'](_0x1c7553,require('../api/cmContact/cmContact.rpc'));_0x1c7553=_['merge'](_0x1c7553,require(_0x5395('0x1d')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x1e')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x1f')));_0x1c7553=_['merge'](_0x1c7553,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x20')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x21')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require('../api/pause/pause.rpc'));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require('../api/sound/sound.rpc'));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x22')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require('../api/template/template.rpc'));_0x1c7553=_['merge'](_0x1c7553,require('../api/trigger/trigger.rpc'));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require('../api/variable/variable.rpc'));_0x1c7553=_['merge'](_0x1c7553,require(_0x5395('0x23')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x24')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x25')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x26')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x27')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x28')));_0x1c7553=_['merge'](_0x1c7553,require(_0x5395('0x29')));_0x1c7553=_['merge'](_0x1c7553,require(_0x5395('0x2a')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x2b')));_0x1c7553=_['merge'](_0x1c7553,require(_0x5395('0x2c')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x2d')));_0x1c7553=_['merge'](_0x1c7553,require(_0x5395('0x2e')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x2f')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x30')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x31')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x32')));_0x1c7553=_['merge'](_0x1c7553,require(_0x5395('0x33')));_0x1c7553=_['merge'](_0x1c7553,require(_0x5395('0x34')));_0x1c7553=_['merge'](_0x1c7553,require('../api/attachment/attachment.rpc'));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x35')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x36')));_0x1c7553=_['merge'](_0x1c7553,require(_0x5395('0x37')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x38')));_0x1c7553=_['merge'](_0x1c7553,require(_0x5395('0x39')));_0x1c7553=_[_0x5395('0x2')](_0x1c7553,require(_0x5395('0x3a')));var _0x12e86f=jayson['server'](_0x1c7553)[_0x5395('0x3b')]();var _0x17055d=config[_0x5395('0x3c')][_0x5395('0x3d')]||config['port']+0x1;var _0x1fc272=config[_0x5395('0x3c')]['ip']||_0x5395('0x3e');_0x12e86f['on'](_0x5395('0x3f'),function(_0x1ff7fb){return _0x178842(_0x1ff7fb);});_0x12e86f[_0x5395('0x40')](_0x17055d,_0x1fc272,function(){console[_0x5395('0x41')](_0x5395('0x42'),_0x1fc272,_0x17055d);require(_0x5395('0x43'))[_0x5395('0x44')]();return _0x41316f(_0x5395('0x45')+_0x1fc272+':'+_0x17055d);});});};
\ No newline at end of file
index ba1fe1f..2014dd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf70f=['util','lodash','events','./reply','./error','call','setEncoding','utf8','headers','ready','line','toLowerCase','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','replace','substr','indexOf','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','function','write','inherits','prototype','command','sync','sendRequest','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','WAIT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf70f,0x9c));var _0xff70=function(_0x193266,_0x37c379){_0x193266=_0x193266-0x0;var _0x2a9bde=_0xf70f[_0x193266];return _0x2a9bde;};'use strict';var util=require(_0xff70('0x0'));var _=require(_0xff70('0x1'));var EventEmitter=require(_0xff70('0x2'))['EventEmitter'];var AGIReply=require(_0xff70('0x3'));var AGIError=require(_0xff70('0x4'));function AGIChannel(_0x4b1a6a){var _0x24744b=this,_0x1064d9=new AGIReply(),_0x15334b=![],_0x241c38={};EventEmitter[_0xff70('0x5')](_0x24744b);_0x4b1a6a[_0xff70('0x6')](_0xff70('0x7'));_0x4b1a6a['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x1064d9[_0xff70('0x6')](_0xff70('0x7'));_0x1064d9['on'](_0xff70('0x8'),function(_0x9fba00){for(var _0x26f525 in _0x9fba00){_0x24744b[_0x26f525]=_0x9fba00[_0x26f525];}_0x24744b['emit'](_0xff70('0x9'));});_0x1064d9['on'](_0xff70('0xa'),function(_0x4e76db){if(_0x4e76db[_0xff70('0xb')]()==_0xff70('0xc')){_0x24744b[_0xff70('0xd')](_0xff70('0xc'));return;}if(_0x4e76db[_0xff70('0xe')](0x0,0xb)==_0xff70('0xf')){_0x15334b=!![];}if(_0x15334b){_0x241c38['rx']+=_0x4e76db+'\x0a';if(_0x4e76db[_0xff70('0x10')](_0xff70('0x11'))!=-0x1){_0x15334b=![];}}else{_0x241c38['rx']=_0x4e76db;}if(_0x15334b){return;}if(typeof _0x241c38['cb']=='function'){var _0xb32668=_0x241c38['rx']['substring'](0x0,0x3),_0x5e4651=null,_0x415c80=null;_0xb32668=parseInt(_0xb32668);if(isNaN(_0xb32668)){_0x241c38['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0xb32668!=0xc8){_0x241c38['cb'](null,{'code':_0xb32668,'result':-0x1,'extra':'KO'});return;}_0x5e4651=_0x241c38['rx'][_0xff70('0xe')](0x4)[_0xff70('0x12')]('result=','');if(_0x5e4651['indexOf']('\x20')!=-0x1){_0x5e4651=_0x5e4651[_0xff70('0x13')](0x0,_0x5e4651[_0xff70('0x14')]('\x20'));}if(_['startsWith'](_0x5e4651,'-1')){_0x5e4651=parseInt(_0x5e4651);}_0x415c80=_0x241c38['rx']['split']('\x20');if(_0x415c80[_0xff70('0x15')]==0x3){_0x415c80=_0x415c80[0x2][_0xff70('0xe')](0x1,_0x415c80[0x2][_0xff70('0x15')]-0x1);}else if(_0x415c80['length']>0x3){var _0x5840d0=/\((.+)\)/;var _0x2d09a2=_0x241c38['rx'][_0xff70('0x16')](_0x5840d0);if(_0x2d09a2){_0x415c80=_0x2d09a2[0x1];}else{_0x415c80=null;}}else{_0x415c80=null;}_0x241c38['cb'](null,{'code':_0xb32668,'result':_0x5e4651,'extra':_0x415c80});}});_0x4b1a6a['on'](_0xff70('0x17'),function(_0x5f0c5a){_0x24744b[_0xff70('0xd')](_0xff70('0x17'),new AGIError(_0xff70('0x18'),_0x5f0c5a[_0xff70('0x19')]));});_0x4b1a6a['on'](_0xff70('0x1a'),function(){_0x24744b[_0xff70('0xd')](_0xff70('0x1a'),new AGIError(_0xff70('0x1b')));});_0x4b1a6a['on'](_0xff70('0x1c'),function(){_0x24744b[_0xff70('0xd')](_0xff70('0x1c'),new AGIError(_0xff70('0x1d')));_0x4b1a6a[_0xff70('0x1e')]();});_0x4b1a6a[_0xff70('0x1f')](_0x1064d9);this['command']=function(_0x4a8f69,_0x448a82){var _0x4a8f69=_0x4a8f69||'',_0x448a82=typeof _0x448a82==_0xff70('0x20')?_0x448a82:new Function();_0x241c38={'tx':_0x4a8f69,'rx':'','cb':_0x448a82};_0x4b1a6a[_0xff70('0x21')](_0x4a8f69+'\x0a');},this[_0xff70('0x1a')]=function(){_0x4b1a6a[_0xff70('0x1e')]();};}util[_0xff70('0x22')](AGIChannel,EventEmitter);AGIChannel[_0xff70('0x23')]['sendRequest']=function(_0x555162){return this[_0xff70('0x24')][_0xff70('0x25')](this,_0x555162);};AGIChannel['prototype']['answer']=function(){return this[_0xff70('0x26')](_0xff70('0x27'));};AGIChannel['prototype'][_0xff70('0x28')]=function(_0x575378,_0x3c81a0,_0x227fc5){_0x575378=_0x575378===undefined?_0xff70('0x29'):_0x575378;_0x3c81a0=_0x3c81a0===undefined?'5':_0x3c81a0;_0x227fc5=_0x227fc5===undefined?'1':_0x227fc5;return this[_0xff70('0x26')](util[_0xff70('0x2a')](_0xff70('0x2b'),_0x575378,_0x3c81a0*0x3e8,_0x227fc5));};AGIChannel[_0xff70('0x23')]['noop']=function(_0x4121b6){_0x4121b6=_0x4121b6||_0xff70('0x2c');return this[_0xff70('0x26')](util['format'](_0xff70('0x2d'),_0x4121b6));};AGIChannel[_0xff70('0x23')][_0xff70('0x2e')]=function(_0x2869a2,_0x3a3251){if(_[_0xff70('0x2f')](_0x3a3251)){return this[_0xff70('0x26')](util[_0xff70('0x2a')]('EXEC\x20%s\x20%s',_0x2869a2,_0x3a3251['join'](',')));}return this[_0xff70('0x26')](util['format'](_0xff70('0x30'),_0x2869a2,_0x3a3251));};AGIChannel[_0xff70('0x23')][_0xff70('0x31')]=function(_0x537672){return this[_0xff70('0x26')](util[_0xff70('0x2a')](_0xff70('0x32'),_0x537672));};AGIChannel[_0xff70('0x23')][_0xff70('0x33')]=function(_0x55a2f3){return this['sendRequest'](util[_0xff70('0x2a')]('SET\x20EXTENSION\x20%s',_0x55a2f3));};AGIChannel['prototype']['setPriority']=function(_0x4fd076){return this[_0xff70('0x26')](util['format']('SET\x20PRIORITY\x20%s',_0x4fd076));};AGIChannel['prototype'][_0xff70('0xc')]=function(){return this[_0xff70('0x26')](_0xff70('0x34'));};AGIChannel[_0xff70('0x23')][_0xff70('0x35')]=function(_0x3038f8,_0x330bc0){var _0xd76d04=_[_0xff70('0x36')](_0x330bc0)||_[_0xff70('0x37')](_0x330bc0)?_0x330bc0[_0xff70('0x38')]():_0x330bc0;return this['sendRequest'](util[_0xff70('0x2a')](_0xff70('0x39'),_0x3038f8,_0xd76d04?_0xd76d04[_0xff70('0x38')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xff70('0x23')][_0xff70('0x3a')]=function(_0x46492e,_0x57dacf){return this[_0xff70('0x26')](util['format'](_0xff70('0x3b'),_0x46492e,_0x57dacf));};AGIChannel[_0xff70('0x23')][_0xff70('0x3c')]=function(_0x4115ac,_0x59deeb){return this[_0xff70('0x26')](util[_0xff70('0x2a')](_0xff70('0x3d'),_0x4115ac,_0x59deeb));};AGIChannel[_0xff70('0x23')][_0xff70('0x3e')]=function(_0x4b676c,_0x54d2fd){return this[_0xff70('0x26')](util[_0xff70('0x2a')](_0xff70('0x3f'),_0x4b676c,_0x54d2fd));};AGIChannel[_0xff70('0x23')][_0xff70('0x40')]=function(_0x2b8ad9,_0x3dcb05,_0x18a77c){_0x3dcb05=_0x3dcb05||this[_0xff70('0x41')];_0x18a77c=_0x18a77c||0x1;this[_0xff70('0x31')](_0x2b8ad9);this[_0xff70('0x33')](_0x3dcb05);this[_0xff70('0x42')](_0x18a77c);return this[_0xff70('0x43')](util[_0xff70('0x2a')](_0xff70('0x44'),_0x2b8ad9,_0x3dcb05,_0x18a77c));};AGIChannel[_0xff70('0x23')][_0xff70('0x45')]=function(_0x36e6d7){return this[_0xff70('0x26')](util[_0xff70('0x2a')](_0xff70('0x46'),_0x36e6d7));};AGIChannel['prototype']['recordFile']=function(_0x35bc5b,_0x48b436,_0x3eb93c,_0x81b606,_0x1d65d2,_0x5788f9){_0x48b436=_0x48b436||_0xff70('0x47');_0x3eb93c=_0x3eb93c||'';_0x81b606=_0x81b606===undefined?-0x1:_0x81b606==='-1'?-0x1:_0x81b606*0x3e8;_0x1d65d2=_0x1d65d2===undefined?'':'s='+_0x1d65d2;_0x5788f9=_0x5788f9?_0xff70('0x48'):'';return this[_0xff70('0x26')](util[_0xff70('0x2a')](_0xff70('0x49'),_0x35bc5b,_0x48b436,_0x3eb93c,_0x81b606,_0x5788f9,_0x1d65d2));};AGIChannel[_0xff70('0x23')][_0xff70('0x4a')]=function(_0xf9f805,_0x27e97f){_0x27e97f=_0x27e97f||'';return this[_0xff70('0x26')](util[_0xff70('0x2a')](_0xff70('0x4b'),_0xf9f805,_0x27e97f));};AGIChannel[_0xff70('0x23')]['agi']=function(_0x1504d2){return this[_0xff70('0x2e')](_0xff70('0x4c'),_0x1504d2);};AGIChannel[_0xff70('0x23')]['wait']=function(_0x5a4b90){return this['exec'](_0xff70('0x4d'),_0x5a4b90);};AGIChannel[_0xff70('0x23')][_0xff70('0x17')]=function(_0x5c2254,_0x4d472b){this[_0xff70('0x43')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x5c2254['id'],_0x5c2254['label'],_0x4d472b));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel;
\ No newline at end of file
+var _0xd0da=['close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','function','write','prototype','sendRequest','sync','answer','ANSWER','getData','beep','format','noop','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','streamFile','label','exports','util','lodash','events','EventEmitter','./reply','call','setTimeout','setEncoding','utf8','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','replace','result=','substr','indexOf','split','length','match','error','code'];(function(_0x27e704,_0x4d5b7d){var _0x138299=function(_0x3f22db){while(--_0x3f22db){_0x27e704['push'](_0x27e704['shift']());}};_0x138299(++_0x4d5b7d);}(_0xd0da,0x1b1));var _0xad0d=function(_0x4b5c23,_0x101faa){_0x4b5c23=_0x4b5c23-0x0;var _0x262cfd=_0xd0da[_0x4b5c23];return _0x262cfd;};'use strict';var util=require(_0xad0d('0x0'));var _=require(_0xad0d('0x1'));var EventEmitter=require(_0xad0d('0x2'))[_0xad0d('0x3')];var AGIReply=require(_0xad0d('0x4'));var AGIError=require('./error');function AGIChannel(_0x5a0c5b){var _0x3b33a5=this,_0x2bfd67=new AGIReply(),_0x5316e1=![],_0x4eb225={};EventEmitter[_0xad0d('0x5')](_0x3b33a5);_0x5a0c5b['setEncoding']('utf8');_0x5a0c5b[_0xad0d('0x6')](0x8*0x3c*0x3c*0x3e8);_0x2bfd67[_0xad0d('0x7')](_0xad0d('0x8'));_0x2bfd67['on'](_0xad0d('0x9'),function(_0x5b99a9){for(var _0x3ef616 in _0x5b99a9){_0x3b33a5[_0x3ef616]=_0x5b99a9[_0x3ef616];}_0x3b33a5[_0xad0d('0xa')](_0xad0d('0xb'));});_0x2bfd67['on'](_0xad0d('0xc'),function(_0x16b3ff){if(_0x16b3ff[_0xad0d('0xd')]()==_0xad0d('0xe')){_0x3b33a5[_0xad0d('0xa')](_0xad0d('0xe'));return;}if(_0x16b3ff[_0xad0d('0xf')](0x0,0xb)==_0xad0d('0x10')){_0x5316e1=!![];}if(_0x5316e1){_0x4eb225['rx']+=_0x16b3ff+'\x0a';if(_0x16b3ff[_0xad0d('0x11')](_0xad0d('0x12'))!=-0x1){_0x5316e1=![];}}else{_0x4eb225['rx']=_0x16b3ff;}if(_0x5316e1){return;}if(typeof _0x4eb225['cb']=='function'){var _0x45c7ea=_0x4eb225['rx'][_0xad0d('0xf')](0x0,0x3),_0x3b62bf=null,_0x552370=null;_0x45c7ea=parseInt(_0x45c7ea);if(isNaN(_0x45c7ea)){_0x4eb225['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xad0d('0x13')});return;}if(_0x45c7ea!=0xc8){_0x4eb225['cb'](null,{'code':_0x45c7ea,'result':-0x1,'extra':'KO'});return;}_0x3b62bf=_0x4eb225['rx']['substring'](0x4)[_0xad0d('0x14')](_0xad0d('0x15'),'');if(_0x3b62bf['indexOf']('\x20')!=-0x1){_0x3b62bf=_0x3b62bf[_0xad0d('0x16')](0x0,_0x3b62bf[_0xad0d('0x17')]('\x20'));}if(_['startsWith'](_0x3b62bf,'-1')){_0x3b62bf=parseInt(_0x3b62bf);}_0x552370=_0x4eb225['rx'][_0xad0d('0x18')]('\x20');if(_0x552370['length']==0x3){_0x552370=_0x552370[0x2]['substring'](0x1,_0x552370[0x2][_0xad0d('0x19')]-0x1);}else if(_0x552370[_0xad0d('0x19')]>0x3){var _0x1cde0d=/\((.+)\)/;var _0x4ac4a4=_0x4eb225['rx'][_0xad0d('0x1a')](_0x1cde0d);if(_0x4ac4a4){_0x552370=_0x4ac4a4[0x1];}else{_0x552370=null;}}else{_0x552370=null;}_0x4eb225['cb'](null,{'code':_0x45c7ea,'result':_0x3b62bf,'extra':_0x552370});}});_0x5a0c5b['on'](_0xad0d('0x1b'),function(_0x5862bd){_0x3b33a5[_0xad0d('0xa')]('error',new AGIError('E_AGI_SOCKET_ERROR',_0x5862bd[_0xad0d('0x1c')]));});_0x5a0c5b['on']('close',function(){_0x3b33a5[_0xad0d('0xa')](_0xad0d('0x1d'),new AGIError(_0xad0d('0x1e')));});_0x5a0c5b['on']('timeout',function(){_0x3b33a5['emit'](_0xad0d('0x1f'),new AGIError(_0xad0d('0x20')));_0x5a0c5b[_0xad0d('0x21')]();});_0x5a0c5b['pipe'](_0x2bfd67);this['command']=function(_0x971569,_0x48333a){var _0x971569=_0x971569||'',_0x48333a=typeof _0x48333a==_0xad0d('0x22')?_0x48333a:new Function();_0x4eb225={'tx':_0x971569,'rx':'','cb':_0x48333a};_0x5a0c5b[_0xad0d('0x23')](_0x971569+'\x0a');},this[_0xad0d('0x1d')]=function(){_0x5a0c5b[_0xad0d('0x21')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xad0d('0x24')][_0xad0d('0x25')]=function(_0x59499a){return this['command'][_0xad0d('0x26')](this,_0x59499a);};AGIChannel[_0xad0d('0x24')][_0xad0d('0x27')]=function(){return this['sendRequest'](_0xad0d('0x28'));};AGIChannel['prototype'][_0xad0d('0x29')]=function(_0xddf172,_0x4d45a9,_0x481e1a){_0xddf172=_0xddf172===undefined?_0xad0d('0x2a'):_0xddf172;_0x4d45a9=_0x4d45a9===undefined?'5':_0x4d45a9;_0x481e1a=_0x481e1a===undefined?'1':_0x481e1a;return this[_0xad0d('0x25')](util[_0xad0d('0x2b')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0xddf172,_0x4d45a9*0x3e8,_0x481e1a));};AGIChannel[_0xad0d('0x24')][_0xad0d('0x2c')]=function(_0xc2bddb){_0xc2bddb=_0xc2bddb||'NO\x20MESSAGE';return this[_0xad0d('0x25')](util[_0xad0d('0x2b')]('VERBOSE\x20\x22%s\x22',_0xc2bddb));};AGIChannel[_0xad0d('0x24')][_0xad0d('0x2d')]=function(_0x20bb3d,_0x11c203){if(_[_0xad0d('0x2e')](_0x11c203)){return this[_0xad0d('0x25')](util[_0xad0d('0x2b')](_0xad0d('0x2f'),_0x20bb3d,_0x11c203[_0xad0d('0x30')](',')));}return this[_0xad0d('0x25')](util[_0xad0d('0x2b')]('EXEC\x20%s\x20%s',_0x20bb3d,_0x11c203));};AGIChannel[_0xad0d('0x24')]['setContext']=function(_0x1cfb95){return this[_0xad0d('0x25')](util[_0xad0d('0x2b')](_0xad0d('0x31'),_0x1cfb95));};AGIChannel['prototype'][_0xad0d('0x32')]=function(_0x1a4bb9){return this['sendRequest'](util[_0xad0d('0x2b')](_0xad0d('0x33'),_0x1a4bb9));};AGIChannel[_0xad0d('0x24')][_0xad0d('0x34')]=function(_0x2dc5b0){return this['sendRequest'](util[_0xad0d('0x2b')](_0xad0d('0x35'),_0x2dc5b0));};AGIChannel[_0xad0d('0x24')][_0xad0d('0xe')]=function(){return this['sendRequest'](_0xad0d('0x36'));};AGIChannel['prototype'][_0xad0d('0x37')]=function(_0xf2b22d,_0xf762ac){var _0x58f59b=_[_0xad0d('0x38')](_0xf762ac)||_[_0xad0d('0x39')](_0xf762ac)?_0xf762ac[_0xad0d('0x3a')]():_0xf762ac;return this[_0xad0d('0x25')](util[_0xad0d('0x2b')](_0xad0d('0x3b'),_0xf2b22d,_0x58f59b?_0x58f59b[_0xad0d('0x3a')]()[_0xad0d('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0xad0d('0x3c')]=function(_0x1b1b87,_0x74929e){return this[_0xad0d('0x25')](util['format'](_0xad0d('0x3d'),_0x1b1b87,_0x74929e));};AGIChannel[_0xad0d('0x24')][_0xad0d('0x3e')]=function(_0x1bb3ba,_0x18527b){return this['sendRequest'](util['format'](_0xad0d('0x3f'),_0x1bb3ba,_0x18527b));};AGIChannel['prototype'][_0xad0d('0x40')]=function(_0x1d996f,_0x1a4fca){return this[_0xad0d('0x25')](util[_0xad0d('0x2b')](_0xad0d('0x41'),_0x1d996f,_0x1a4fca));};AGIChannel[_0xad0d('0x24')][_0xad0d('0x42')]=function(_0x2ab33b,_0x539d55,_0x469c13){_0x539d55=_0x539d55||this[_0xad0d('0x43')];_0x469c13=_0x469c13||0x1;this[_0xad0d('0x44')](_0x2ab33b);this[_0xad0d('0x32')](_0x539d55);this[_0xad0d('0x34')](_0x469c13);return this[_0xad0d('0x2c')](util[_0xad0d('0x2b')](_0xad0d('0x45'),_0x2ab33b,_0x539d55,_0x469c13));};AGIChannel[_0xad0d('0x24')][_0xad0d('0x46')]=function(_0x3674dd){return this[_0xad0d('0x25')](util[_0xad0d('0x2b')](_0xad0d('0x47'),_0x3674dd));};AGIChannel[_0xad0d('0x24')]['recordFile']=function(_0x3e2d29,_0x8816f0,_0x20f0f6,_0xb9ba8c,_0x416b6e,_0xa59e68){_0x8816f0=_0x8816f0||_0xad0d('0x48');_0x20f0f6=_0x20f0f6||'';_0xb9ba8c=_0xb9ba8c===undefined?-0x1:_0xb9ba8c==='-1'?-0x1:_0xb9ba8c*0x3e8;_0x416b6e=_0x416b6e===undefined?'':'s='+_0x416b6e;_0xa59e68=_0xa59e68?_0xad0d('0x49'):'';return this[_0xad0d('0x25')](util[_0xad0d('0x2b')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x3e2d29,_0x8816f0,_0x20f0f6,_0xb9ba8c,_0xa59e68,_0x416b6e));};AGIChannel[_0xad0d('0x24')][_0xad0d('0x4a')]=function(_0x72480c,_0x5c43b2){_0x5c43b2=_0x5c43b2||'';return this[_0xad0d('0x25')](util[_0xad0d('0x2b')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x72480c,_0x5c43b2));};AGIChannel[_0xad0d('0x24')]['agi']=function(_0x16e11e){return this['exec']('AGI',_0x16e11e);};AGIChannel['prototype']['wait']=function(_0x3a8b00){return this['exec']('WAIT',_0x3a8b00);};AGIChannel['prototype'][_0xad0d('0x1b')]=function(_0x4cade8,_0x4e4bb9){this[_0xad0d('0x2c')](util[_0xad0d('0x2b')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x4cade8['id'],_0x4cade8[_0xad0d('0x4b')],_0x4e4bb9));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xad0d('0x4c')]=AGIChannel;
\ No newline at end of file
index ca794fb..19807bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7f7=['apply','message','name','exports','util','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format'];(function(_0x20c9d4,_0x2a7b8a){var _0x9f0072=function(_0x24f4ed){while(--_0x24f4ed){_0x20c9d4['push'](_0x20c9d4['shift']());}};_0x9f0072(++_0x2a7b8a);}(_0xb7f7,0xbf));var _0x7b7f=function(_0x1dbc0f,_0x539e0f){_0x1dbc0f=_0x1dbc0f-0x0;var _0x49e92e=_0xb7f7[_0x1dbc0f];return _0x49e92e;};'use strict';var util=require(_0x7b7f('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x7b7f('0x1'),'E_AGI_SERVER_CLOSE':_0x7b7f('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x7b7f('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x7b7f('0x4'),'E_AGI_SOCKET_ERROR':_0x7b7f('0x5'),'E_AGI_SOCKET_CLOSE':_0x7b7f('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x7b7f('0x7'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x7b7f('0x8'),'E_AGI_IVR_ENTRY':_0x7b7f('0x9')};function AGIError(_0x29b6dc){var _0x29b6dc=_0x29b6dc||null,_0x50765d=_0x50765d||[],_0x5c4cde=0x1,_0x4332cc='';if(!error[_0x29b6dc]){_0x29b6dc=_0x7b7f('0xa');}_0x50765d[_0x7b7f('0xb')](error[_0x29b6dc]);while(arguments[_0x5c4cde]){_0x50765d[_0x7b7f('0xb')](arguments[_0x5c4cde]);_0x5c4cde++;}_0x4332cc=util[_0x7b7f('0xc')][_0x7b7f('0xd')](util,_0x50765d);this[_0x7b7f('0xe')]=_0x4332cc;this[_0x7b7f('0xf')]=_0x29b6dc;}module[_0x7b7f('0x10')]=AGIError;
\ No newline at end of file
+var _0x5383=['Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x56c421,_0x183305){var _0x39e044=function(_0x3a2eff){while(--_0x3a2eff){_0x56c421['push'](_0x56c421['shift']());}};_0x39e044(++_0x183305);}(_0x5383,0x1d5));var _0x3538=function(_0x1a94c0,_0x5b0775){_0x1a94c0=_0x1a94c0-0x0;var _0x549ca3=_0x5383[_0x1a94c0];return _0x549ca3;};'use strict';var util=require(_0x3538('0x0'));var error={'E_AGI_UNDEFINED':_0x3538('0x1'),'E_AGI_ARGUMENT_PORT':_0x3538('0x2'),'E_AGI_SERVER_ERROR':_0x3538('0x3'),'E_AGI_SERVER_CLOSE':_0x3538('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x3538('0x5'),'E_AGI_SOCKET_ERROR':_0x3538('0x6'),'E_AGI_SOCKET_CLOSE':_0x3538('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x3538('0x8'),'E_AGI_COMMAND_EMPTY':_0x3538('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x3538('0xa'),'E_AGI_IVR_ENTRY':_0x3538('0xb')};function AGIError(_0xf59fbf){var _0xf59fbf=_0xf59fbf||null,_0x52c607=_0x52c607||[],_0x52ea19=0x1,_0x41cc1c='';if(!error[_0xf59fbf]){_0xf59fbf=_0x3538('0xc');}_0x52c607['push'](error[_0xf59fbf]);while(arguments[_0x52ea19]){_0x52c607[_0x3538('0xd')](arguments[_0x52ea19]);_0x52ea19++;}_0x41cc1c=util[_0x3538('0xe')][_0x3538('0xf')](util,_0x52c607);this[_0x3538('0x10')]=_0x41cc1c;this[_0x3538('0x11')]=_0xf59fbf;}module[_0x3538('0x12')]=AGIError;
\ No newline at end of file
index 1ca8e9a..38df752 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ffe=['../../config/environment','redis','defaults','localhost','error','message','agi','emit','projectUpdate','E_AGI_SERVER_ERROR','exports','events','EventEmitter','ioredis'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0x7ffe,0x1bd));var _0xe7ff=function(_0x5b9c45,_0x67677){_0x5b9c45=_0x5b9c45-0x0;var _0x2ef3c6=_0x7ffe[_0x5b9c45];return _0x2ef3c6;};'use strict';var _=require('lodash');var EventEmitter=require(_0xe7ff('0x0'))[_0xe7ff('0x1')];var Redis=require(_0xe7ff('0x2'));var AGIError=require('./error');var config=require(_0xe7ff('0x3'));config[_0xe7ff('0x4')]=_[_0xe7ff('0x5')](config[_0xe7ff('0x4')],{'host':_0xe7ff('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xe7ff('0x4')]);sub['subscribe']('agi',function(_0x24fb9f){if(_0x24fb9f)return eventEmitter['emit'](_0xe7ff('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x24fb9f));});sub['on'](_0xe7ff('0x8'),function(_0x44252a,_0x5c3c32){if(_0x44252a!==_0xe7ff('0x9'))return;try{var _0x2c0e41=JSON['parse'](_0x5c3c32);eventEmitter[_0xe7ff('0xa')](_0xe7ff('0xb'),_0x2c0e41);}catch(_0x4b2973){eventEmitter['emit'](_0xe7ff('0x7'),new AGIError(_0xe7ff('0xc'),_0x4b2973));}});module[_0xe7ff('0xd')]={'EventEmitter':eventEmitter};
\ No newline at end of file
+var _0xa5e8=['E_AGI_SERVER_ERROR','message','projectUpdate','lodash','events','EventEmitter','ioredis','./error','redis','localhost','subscribe','agi','emit','error'];(function(_0x53cd33,_0x597082){var _0x302e2c=function(_0x2f24d1){while(--_0x2f24d1){_0x53cd33['push'](_0x53cd33['shift']());}};_0x302e2c(++_0x597082);}(_0xa5e8,0x129));var _0x8a5e=function(_0x5e25c9,_0x3dd817){_0x5e25c9=_0x5e25c9-0x0;var _0x35c8d0=_0xa5e8[_0x5e25c9];return _0x35c8d0;};'use strict';var _=require(_0x8a5e('0x0'));var EventEmitter=require(_0x8a5e('0x1'))[_0x8a5e('0x2')];var Redis=require(_0x8a5e('0x3'));var AGIError=require(_0x8a5e('0x4'));var config=require('../../config/environment');config[_0x8a5e('0x5')]=_['defaults'](config[_0x8a5e('0x5')],{'host':_0x8a5e('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x8a5e('0x5')]);sub[_0x8a5e('0x7')](_0x8a5e('0x8'),function(_0xf3a098){if(_0xf3a098)return eventEmitter[_0x8a5e('0x9')](_0x8a5e('0xa'),new AGIError(_0x8a5e('0xb'),_0xf3a098));});sub['on'](_0x8a5e('0xc'),function(_0x281021,_0x216b02){if(_0x281021!==_0x8a5e('0x8'))return;try{var _0x5a2ef7=JSON['parse'](_0x216b02);eventEmitter['emit'](_0x8a5e('0xd'),_0x5a2ef7);}catch(_0xa1e250){eventEmitter[_0x8a5e('0x9')](_0x8a5e('0xa'),new AGIError(_0x8a5e('0xb'),_0xa1e250));}});module['exports']={'EventEmitter':eventEmitter};
\ No newline at end of file
index 8526b6c..7080388 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e0f=['traverseBFS','info','no\x20edge/s\x20available','length','condition','agicommand','default','invalid','target','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','menu','getdigits','getsecretdigits','vertices','edges','prototype','addVertex','addEdge','push','size'];(function(_0x23d66c,_0x3215b3){var _0x1e9c80=function(_0x349cef){while(--_0x349cef){_0x23d66c['push'](_0x23d66c['shift']());}};_0x1e9c80(++_0x3215b3);}(_0x0e0f,0xe5));var _0xf0e0=function(_0x543e3f,_0x4a6f6d){_0x543e3f=_0x543e3f-0x0;var _0x3a6a3d=_0x0e0f[_0x543e3f];return _0x3a6a3d;};'use strict';var _=require(_0xf0e0('0x0'));var logger=require('../../../config/logger')('agi');var verticesWithRetry=[_0xf0e0('0x1'),_0xf0e0('0x2'),_0xf0e0('0x3')];var Graph=function(){this[_0xf0e0('0x4')]={};this[_0xf0e0('0x5')]={};this['numberOfEdges']=0x0;};Graph[_0xf0e0('0x6')][_0xf0e0('0x7')]=function(_0x4a6540){this[_0xf0e0('0x4')][_0x4a6540['id']]=_0x4a6540;this[_0xf0e0('0x5')][_0x4a6540['id']]=[];};Graph[_0xf0e0('0x6')][_0xf0e0('0x8')]=function(_0x2f02a1,_0xd26614,_0x9c1146){this[_0xf0e0('0x5')][_0x2f02a1][_0xf0e0('0x9')]({'target':_0xd26614,'condition':_0x9c1146});this['numberOfEdges']+=0x1;};Graph[_0xf0e0('0x6')]['size']=function(){return _[_0xf0e0('0xa')](this[_0xf0e0('0x4')]);};Graph[_0xf0e0('0x6')]['relations']=function(){return this['numberOfEdges'];};Graph['prototype']['getVertex']=function(_0x10e087){return this['vertices'][_0x10e087];};Graph['prototype'][_0xf0e0('0xb')]=function(_0x5bd0ab,_0x387f7d){if(!this[_0xf0e0('0x4')][_0x5bd0ab]){return logger['info']('no\x20vertex\x20found');}var _0x457bfc=_0x387f7d(this['vertices'][_0x5bd0ab]);if(!_0x457bfc){return logger[_0xf0e0('0xc')]('stop\x20traverse');}if(this[_0xf0e0('0x5')][_0x5bd0ab]['length']===0x0){return logger[_0xf0e0('0xc')](_0xf0e0('0xd'));}for(var _0x583506=0x0,_0x276aaa=[],_0x21235c=![];_0x583506<this[_0xf0e0('0x5')][_0x5bd0ab][_0xf0e0('0xe')];_0x583506+=0x1){if(this['edges'][_0x5bd0ab][_0x583506][_0xf0e0('0xf')]){_0x276aaa=this[_0xf0e0('0x5')][_0x5bd0ab][_0x583506]['condition']['split'](',');for(var _0x155a21=0x0;_0x155a21<_0x276aaa[_0xf0e0('0xe')];_0x155a21+=0x1){if(this['vertices'][_0x5bd0ab][_0xf0e0('0x10')]==='vswitch'&&_0x276aaa[_0x155a21]==='-'){_0x21235c=this['edges'][_0x5bd0ab][_0x583506]['target'];logger[_0xf0e0('0xc')](_0xf0e0('0x11'),_0x276aaa[_0x155a21],this['edges'][_0x5bd0ab][_0x583506]['target']);}else if(this['vertices'][_0x5bd0ab][_0xf0e0('0x10')]==='menu'&&_0x276aaa[_0x155a21]==='i'){_0x21235c=this['edges'][_0x5bd0ab][_0x583506]['target'];logger['info'](_0xf0e0('0x12'),_0x276aaa[_0x155a21],this[_0xf0e0('0x5')][_0x5bd0ab][_0x583506][_0xf0e0('0x13')]);}if(_0x276aaa[_0x155a21]===_0x457bfc){return this[_0xf0e0('0xb')](this['edges'][_0x5bd0ab][_0x583506][_0xf0e0('0x13')],_0x387f7d);}}}else{return this[_0xf0e0('0xb')](this['edges'][_0x5bd0ab][_0x583506][_0xf0e0('0x13')],_0x387f7d);}}if(_0x276aaa['length']){if(this[_0xf0e0('0x4')][_0x5bd0ab][_0xf0e0('0x10')]==='vswitch'){if(_0x21235c){return this[_0xf0e0('0xb')](_0x21235c,_0x387f7d);}return logger[_0xf0e0('0xc')]('default\x20on\x20switch\x20not\x20found');}else if(_[_0xf0e0('0x14')](verticesWithRetry,this[_0xf0e0('0x4')][_0x5bd0ab][_0xf0e0('0x10')])){if(_0x457bfc==='-'){return logger[_0xf0e0('0xc')](_0xf0e0('0x15'));}if(_0x21235c&&_0x457bfc!=='t'){return this[_0xf0e0('0xb')](_0x21235c,_0x387f7d);}return this[_0xf0e0('0xb')](_0x5bd0ab,_0x387f7d);}return logger[_0xf0e0('0xc')](_0xf0e0('0x16'));}};module[_0xf0e0('0x17')]=Graph;
\ No newline at end of file
+var _0x0185=['getsecretdigits','vertices','numberOfEdges','prototype','addVertex','edges','push','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','no\x20edge/s\x20available','length','split','vswitch','target','default','agicommand','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','menu','getdigits'];(function(_0x35af23,_0x9190f6){var _0x340506=function(_0xd4c26b){while(--_0xd4c26b){_0x35af23['push'](_0x35af23['shift']());}};_0x340506(++_0x9190f6);}(_0x0185,0x10c));var _0x5018=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x0185[_0x1e3671];return _0x48d5f5;};'use strict';var _=require('lodash');var logger=require('../../../config/logger')('agi');var verticesWithRetry=[_0x5018('0x0'),_0x5018('0x1'),_0x5018('0x2')];var Graph=function(){this[_0x5018('0x3')]={};this['edges']={};this[_0x5018('0x4')]=0x0;};Graph[_0x5018('0x5')][_0x5018('0x6')]=function(_0x141ebd){this['vertices'][_0x141ebd['id']]=_0x141ebd;this[_0x5018('0x7')][_0x141ebd['id']]=[];};Graph[_0x5018('0x5')]['addEdge']=function(_0x544c65,_0x13c79b,_0x5011a0){this['edges'][_0x544c65][_0x5018('0x8')]({'target':_0x13c79b,'condition':_0x5011a0});this[_0x5018('0x4')]+=0x1;};Graph[_0x5018('0x5')][_0x5018('0x9')]=function(){return _['size'](this['vertices']);};Graph[_0x5018('0x5')][_0x5018('0xa')]=function(){return this['numberOfEdges'];};Graph['prototype'][_0x5018('0xb')]=function(_0x5c6889){return this[_0x5018('0x3')][_0x5c6889];};Graph[_0x5018('0x5')][_0x5018('0xc')]=function(_0x3c6c31,_0x2b1479){if(!this[_0x5018('0x3')][_0x3c6c31]){return logger[_0x5018('0xd')](_0x5018('0xe'));}var _0x2f494e=_0x2b1479(this['vertices'][_0x3c6c31]);if(!_0x2f494e){return logger['info'](_0x5018('0xf'));}if(this[_0x5018('0x7')][_0x3c6c31]['length']===0x0){return logger[_0x5018('0xd')](_0x5018('0x10'));}for(var _0x900e8e=0x0,_0xa9688b=[],_0x1c404e=![];_0x900e8e<this[_0x5018('0x7')][_0x3c6c31][_0x5018('0x11')];_0x900e8e+=0x1){if(this[_0x5018('0x7')][_0x3c6c31][_0x900e8e]['condition']){_0xa9688b=this[_0x5018('0x7')][_0x3c6c31][_0x900e8e]['condition'][_0x5018('0x12')](',');for(var _0x103b2e=0x0;_0x103b2e<_0xa9688b['length'];_0x103b2e+=0x1){if(this[_0x5018('0x3')][_0x3c6c31]['agicommand']===_0x5018('0x13')&&_0xa9688b[_0x103b2e]==='-'){_0x1c404e=this['edges'][_0x3c6c31][_0x900e8e][_0x5018('0x14')];logger[_0x5018('0xd')](_0x5018('0x15'),_0xa9688b[_0x103b2e],this[_0x5018('0x7')][_0x3c6c31][_0x900e8e][_0x5018('0x14')]);}else if(this[_0x5018('0x3')][_0x3c6c31][_0x5018('0x16')]===_0x5018('0x0')&&_0xa9688b[_0x103b2e]==='i'){_0x1c404e=this[_0x5018('0x7')][_0x3c6c31][_0x900e8e]['target'];logger[_0x5018('0xd')](_0x5018('0x17'),_0xa9688b[_0x103b2e],this[_0x5018('0x7')][_0x3c6c31][_0x900e8e]['target']);}if(_0xa9688b[_0x103b2e]===_0x2f494e){return this[_0x5018('0xc')](this['edges'][_0x3c6c31][_0x900e8e]['target'],_0x2b1479);}}}else{return this['traverseBFS'](this[_0x5018('0x7')][_0x3c6c31][_0x900e8e]['target'],_0x2b1479);}}if(_0xa9688b[_0x5018('0x11')]){if(this[_0x5018('0x3')][_0x3c6c31]['agicommand']===_0x5018('0x13')){if(_0x1c404e){return this['traverseBFS'](_0x1c404e,_0x2b1479);}return logger['info']('default\x20on\x20switch\x20not\x20found');}else if(_[_0x5018('0x18')](verticesWithRetry,this[_0x5018('0x3')][_0x3c6c31][_0x5018('0x16')])){if(_0x2f494e==='-'){return logger[_0x5018('0xd')](_0x5018('0x19'));}if(_0x1c404e&&_0x2f494e!=='t'){return this['traverseBFS'](_0x1c404e,_0x2b1479);}return this[_0x5018('0xc')](_0x3c6c31,_0x2b1479);}return logger[_0x5018('0xd')](_0x5018('0x1a'));}};module['exports']=Graph;
\ No newline at end of file
index faa668d..28a3032 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe25a=['EventEmitter','127.0.0.1','projectUpdate','nextTick','error','stack','deleted','splice','push','log','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','then','catch','hasOwnProperty','agi_','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','hangup','find','handleNotFound','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','./server','close','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./project'];(function(_0x2042a3,_0x865e62){var _0x596f0d=function(_0x412bc4){while(--_0x412bc4){_0x2042a3['push'](_0x2042a3['shift']());}};_0x596f0d(++_0x865e62);}(_0xe25a,0x1d0));var _0xae25=function(_0x2fbb17,_0x134719){_0x2fbb17=_0x2fbb17-0x0;var _0x4e7e0f=_0xe25a[_0x2fbb17];return _0x4e7e0f;};'use strict';var _=require(_0xae25('0x0'));var syncho=require(_0xae25('0x1'));var util=require(_0xae25('0x2'));var config=require(_0xae25('0x3'));var logger=require(_0xae25('0x4'))(_0xae25('0x5'));var utilLicense=require(_0xae25('0x6'));var rpc=require('./rpc');var Project=require(_0xae25('0x7'));var AGIEmitter=require('./events')[_0xae25('0x8')];var projects=[];config[_0xae25('0x5')]=_['defaults'](config['agi'],{'ip':_0xae25('0x9'),'port':0x11dd});AGIEmitter['on'](_0xae25('0xa'),projectUpdateHandler);function connectionHandler(_0x11a678){process[_0xae25('0xb')](function(){syncho(function(){try{setChannelVariables(_0x11a678);agiHandler(_0x11a678);}catch(_0x5c7e5d){logger[_0xae25('0xc')](_0x5c7e5d[_0xae25('0xd')]);}});});}function projectUpdateHandler(_0x1dc7a8){try{var _0x20a63f=_['findIndex'](projects,['id',_0x1dc7a8['id']]);if(_0x20a63f>-0x1){if(_0x1dc7a8[_0xae25('0xe')]===!![]){projects[_0xae25('0xf')](_0x20a63f,0x1);}else{projects[_0x20a63f]=_0x1dc7a8;}}else{projects[_0xae25('0x10')](_0x1dc7a8);}}catch(_0x521448){logger[_0xae25('0xc')](_0x521448[_0xae25('0xd')]);}}function listeningHandler(){console[_0xae25('0x11')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi'][_0xae25('0x12')]);logger[_0xae25('0x13')](util[_0xae25('0x14')](_0xae25('0x15'),config[_0xae25('0x5')]['ip'],config['agi']['port']));}function errorHandler(_0x1652d1){if(_0x1652d1&&_0x1652d1[_0xae25('0x16')]&&_0x1652d1[_0xae25('0x17')]){logger['error'](util[_0xae25('0x14')](_0xae25('0x18'),_0x1652d1[_0xae25('0x16')],_0x1652d1[_0xae25('0x17')]));}else{logger[_0xae25('0xc')](util[_0xae25('0x14')](_0xae25('0x19'),_0x1652d1[_0xae25('0xd')]));}}function closeHandler(){logger[_0xae25('0x13')](util[_0xae25('0x14')](_0xae25('0x1a'),this[_0xae25('0x1b')],this[_0xae25('0x1c')],this[_0xae25('0x1d')],this[_0xae25('0x1e')],this['uniqueid']));try{createSquareReport(this);}catch(_0x2df5a2){logger['error'](_0x2df5a2['stack']);}}function timeoutHandler(){logger[_0xae25('0x13')](util['format'](_0xae25('0x1f'),this['arg_1'],this['calleridname'],this[_0xae25('0x1d')],this['dnid'],this[_0xae25('0x20')]));}function hangupHandler(){logger[_0xae25('0x13')](util[_0xae25('0x14')](_0xae25('0x21'),this[_0xae25('0x1b')],this[_0xae25('0x1c')],this['callerid'],this['dnid'],this[_0xae25('0x20')]));this[_0xae25('0x22')]=!![];}function createSquareReport(_0x49cd20,_0x5eddba){rpc['createSquareReport'](_0x49cd20)[_0xae25('0x23')](function(_0x582dcc){if(_0x5eddba){_0x5eddba(null,_0x582dcc);}})[_0xae25('0x24')](function(_0x58ee11){if(_0x5eddba){_0x5eddba(null,_0x58ee11);}});}function setChannelVariables(_0x3f1e65){for(var _0x58dfa8 in _0x3f1e65){if(_0x3f1e65[_0xae25('0x25')](_0x58dfa8)){if(_0x58dfa8['indexOf'](_0xae25('0x26'))===0x0){_0x3f1e65[_0x58dfa8[_0xae25('0x27')](0x4)]=_0x3f1e65[_0x58dfa8];delete _0x3f1e65[_0x58dfa8];}}}}function agiHandler(_0x5e4539){logger[_0xae25('0x28')](_0xae25('0x29'),JSON[_0xae25('0x2a')](_0x5e4539,null,0x2));logger[_0xae25('0x13')](util[_0xae25('0x14')](_0xae25('0x2b'),_0x5e4539[_0xae25('0x1b')],_0x5e4539[_0xae25('0x1c')],_0x5e4539[_0xae25('0x1d')],_0x5e4539['dnid'],_0x5e4539[_0xae25('0x20')]));_0x5e4539['on'](_0xae25('0xc'),errorHandler);_0x5e4539['on']('close',closeHandler);_0x5e4539['on']('timeout',timeoutHandler);_0x5e4539[_0xae25('0x22')]=![];_0x5e4539['on'](_0xae25('0x2c'),hangupHandler);var _0x341ff5=_[_0xae25('0x2d')](projects,[_0xae25('0x16'),_0x5e4539[_0xae25('0x1b')]]);if(!_0x341ff5)return Project[_0xae25('0x2e')](_0x5e4539);if(!_0x341ff5['production'])return Project[_0xae25('0x2f')](_0x5e4539);return Project[_0xae25('0x30')](_0x341ff5,_0x5e4539);}function main(){var _0x1980ac;return utilLicense[_0xae25('0x31')]()[_0xae25('0x23')](function(_0x53203f){if(!_0x53203f)return;if(_0x53203f[_0xae25('0x32')]){if(_0x53203f[_0xae25('0x33')]&&_0x53203f[_0xae25('0x33')]>0x0){logger['info'](util[_0xae25('0x14')](_0xae25('0x34'),_0x53203f[_0xae25('0x33')]));_0x1980ac=_0x53203f[_0xae25('0x33')];}else{logger[_0xae25('0x13')](_0xae25('0x35'));}}else{logger[_0xae25('0x13')](_0xae25('0x36'));_0x1980ac=-0x1;}})[_0xae25('0x23')](function(){return Project[_0xae25('0x37')]();})['then'](function(_0x9a11ed){projects=_0x9a11ed;return;})['catch'](function(_0x2ddf3a){logger['error'](_0xae25('0x38'),_0x2ddf3a[_0xae25('0xd')]);})['finally'](function(){var _0x1a59c5=require(_0xae25('0x39'))(config[_0xae25('0x5')]['port'],config[_0xae25('0x5')]['ip'],_0x1980ac);_0x1a59c5['on'](_0xae25('0xc'),errorHandler);_0x1a59c5['on']('listening',listeningHandler);_0x1a59c5['on']('connection',connectionHandler);_0x1a59c5['on'](_0xae25('0x3a'),closeHandler);});}main();
\ No newline at end of file
+var _0x699b=['calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','substring','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','connection','lodash','syncho','util','../../config/logger','agi','./rpc','./project','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick','findIndex','splice','push','error','stack','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1'];(function(_0x3e0964,_0x3f98f9){var _0x21a6e8=function(_0x183308){while(--_0x183308){_0x3e0964['push'](_0x3e0964['shift']());}};_0x21a6e8(++_0x3f98f9);}(_0x699b,0x11f));var _0xb699=function(_0x52ee9e,_0xc5afea){_0x52ee9e=_0x52ee9e-0x0;var _0x5d9d69=_0x699b[_0x52ee9e];return _0x5d9d69;};'use strict';var _=require(_0xb699('0x0'));var syncho=require(_0xb699('0x1'));var util=require(_0xb699('0x2'));var config=require('../../config/environment');var logger=require(_0xb699('0x3'))(_0xb699('0x4'));var utilLicense=require('../../config/license/util');var rpc=require(_0xb699('0x5'));var Project=require(_0xb699('0x6'));var AGIEmitter=require(_0xb699('0x7'))[_0xb699('0x8')];var projects=[];config[_0xb699('0x4')]=_[_0xb699('0x9')](config[_0xb699('0x4')],{'ip':_0xb699('0xa'),'port':0x11dd});AGIEmitter['on'](_0xb699('0xb'),projectUpdateHandler);function connectionHandler(_0x480b99){process[_0xb699('0xc')](function(){syncho(function(){try{setChannelVariables(_0x480b99);agiHandler(_0x480b99);}catch(_0x6c5412){logger['error'](_0x6c5412['stack']);}});});}function projectUpdateHandler(_0x507e2b){try{var _0x4f7042=_[_0xb699('0xd')](projects,['id',_0x507e2b['id']]);if(_0x4f7042>-0x1){if(_0x507e2b['deleted']===!![]){projects[_0xb699('0xe')](_0x4f7042,0x1);}else{projects[_0x4f7042]=_0x507e2b;}}else{projects[_0xb699('0xf')](_0x507e2b);}}catch(_0x560fdb){logger[_0xb699('0x10')](_0x560fdb[_0xb699('0x11')]);}}function listeningHandler(){console['log']('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xb699('0x4')][_0xb699('0x12')]);logger[_0xb699('0x13')](util[_0xb699('0x14')](_0xb699('0x15'),config[_0xb699('0x4')]['ip'],config[_0xb699('0x4')][_0xb699('0x12')]));}function errorHandler(_0xa651f3){if(_0xa651f3&&_0xa651f3[_0xb699('0x16')]&&_0xa651f3[_0xb699('0x17')]){logger['error'](util[_0xb699('0x14')](_0xb699('0x18'),_0xa651f3['name'],_0xa651f3[_0xb699('0x17')]));}else{logger[_0xb699('0x10')](util['format'](_0xb699('0x19'),_0xa651f3[_0xb699('0x11')]));}}function closeHandler(){logger['info'](util['format'](_0xb699('0x1a'),this[_0xb699('0x1b')],this[_0xb699('0x1c')],this[_0xb699('0x1d')],this[_0xb699('0x1e')],this[_0xb699('0x1f')]));try{createSquareReport(this);}catch(_0x24af1d){logger[_0xb699('0x10')](_0x24af1d[_0xb699('0x11')]);}}function timeoutHandler(){logger[_0xb699('0x13')](util[_0xb699('0x14')](_0xb699('0x20'),this[_0xb699('0x1b')],this[_0xb699('0x1c')],this[_0xb699('0x1d')],this[_0xb699('0x1e')],this[_0xb699('0x1f')]));}function hangupHandler(){logger['info'](util[_0xb699('0x14')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xb699('0x1b')],this[_0xb699('0x1c')],this[_0xb699('0x1d')],this[_0xb699('0x1e')],this[_0xb699('0x1f')]));this[_0xb699('0x21')]=!![];}function createSquareReport(_0x109ef4,_0x8c8cb2){rpc[_0xb699('0x22')](_0x109ef4)[_0xb699('0x23')](function(_0x2a8ce6){if(_0x8c8cb2){_0x8c8cb2(null,_0x2a8ce6);}})[_0xb699('0x24')](function(_0x49716b){if(_0x8c8cb2){_0x8c8cb2(null,_0x49716b);}});}function setChannelVariables(_0xeea0fd){for(var _0xd867df in _0xeea0fd){if(_0xeea0fd[_0xb699('0x25')](_0xd867df)){if(_0xd867df[_0xb699('0x26')](_0xb699('0x27'))===0x0){_0xeea0fd[_0xd867df[_0xb699('0x28')](0x4)]=_0xeea0fd[_0xd867df];delete _0xeea0fd[_0xd867df];}}}}function agiHandler(_0x5511eb){logger[_0xb699('0x29')]('variables',JSON[_0xb699('0x2a')](_0x5511eb,null,0x2));logger[_0xb699('0x13')](util[_0xb699('0x14')](_0xb699('0x2b'),_0x5511eb['arg_1'],_0x5511eb['calleridname'],_0x5511eb[_0xb699('0x1d')],_0x5511eb[_0xb699('0x1e')],_0x5511eb[_0xb699('0x1f')]));_0x5511eb['on'](_0xb699('0x10'),errorHandler);_0x5511eb['on'](_0xb699('0x2c'),closeHandler);_0x5511eb['on'](_0xb699('0x2d'),timeoutHandler);_0x5511eb[_0xb699('0x21')]=![];_0x5511eb['on'](_0xb699('0x2e'),hangupHandler);var _0x2945fc=_[_0xb699('0x2f')](projects,[_0xb699('0x16'),_0x5511eb['arg_1']]);if(!_0x2945fc)return Project[_0xb699('0x30')](_0x5511eb);if(!_0x2945fc[_0xb699('0x31')])return Project[_0xb699('0x32')](_0x5511eb);return Project[_0xb699('0x33')](_0x2945fc,_0x5511eb);}function main(){var _0x2577b0;return utilLicense[_0xb699('0x34')]()[_0xb699('0x23')](function(_0x53a44a){if(!_0x53a44a)return;if(_0x53a44a[_0xb699('0x35')]){if(_0x53a44a[_0xb699('0x36')]&&_0x53a44a[_0xb699('0x36')]>0x0){logger[_0xb699('0x13')](util[_0xb699('0x14')]('[LICENSE]\x20CHANNELS:\x20%s',_0x53a44a[_0xb699('0x36')]));_0x2577b0=_0x53a44a[_0xb699('0x36')];}else{logger['info'](_0xb699('0x37'));}}else{logger['info'](_0xb699('0x38'));_0x2577b0=-0x1;}})[_0xb699('0x23')](function(){return Project[_0xb699('0x39')]();})[_0xb699('0x23')](function(_0x791633){projects=_0x791633;return;})['catch'](function(_0x3c1576){logger[_0xb699('0x10')](_0xb699('0x3a'),_0x3c1576['stack']);})[_0xb699('0x3b')](function(){var _0x2856cd=require(_0xb699('0x3c'))(config[_0xb699('0x4')][_0xb699('0x12')],config['agi']['ip'],_0x2577b0);_0x2856cd['on'](_0xb699('0x10'),errorHandler);_0x2856cd['on'](_0xb699('0x3d'),listeningHandler);_0x2856cd['on'](_0xb699('0x3e'),connectionHandler);_0x2856cd['on'](_0xb699('0x2c'),closeHandler);});}main();
\ No newline at end of file
index 555be0c..bf14136 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x634e=['SendMail','bluebird','http','result','catch'];(function(_0x44d62b,_0x5dd1c8){var _0x579d47=function(_0x27ebba){while(--_0x27ebba){_0x44d62b['push'](_0x44d62b['shift']());}};_0x579d47(++_0x5dd1c8);}(_0x634e,0x196));var _0xe634=function(_0x22df9f,_0x9ec477){_0x22df9f=_0x22df9f-0x0;var _0x4ed906=_0x634e[_0x22df9f];return _0x4ed906;};'use strict';var BPromise=require(_0xe634('0x0'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe634('0x1')]({'port':0x232b});function request(_0x370879,_0x8ba379){return new BPromise(function(_0x5640ed,_0x4b7480){return client['request'](_0x370879,_0x8ba379)['then'](function(_0x24e6d5){if(_0x24e6d5['error']){return _0x4b7480(_0x24e6d5['error']['message']);}else{return _0x5640ed(_0x24e6d5[_0xe634('0x2')]);}})[_0xe634('0x3')](function(_0xd57ca1){return _0x4b7480(_0xd57ca1);});});}exports['sendMailMessage']=function(_0x31714b,_0x1a4b66){return request(_0xe634('0x4'),{'account':_0x31714b,'message':_0x1a4b66});};
\ No newline at end of file
+var _0x35f2=['sendMailMessage','SendMail','bluebird','jayson/promise','http','request','error','message','result','catch'];(function(_0x5cd192,_0x5d0925){var _0x3b2547=function(_0x966d23){while(--_0x966d23){_0x5cd192['push'](_0x5cd192['shift']());}};_0x3b2547(++_0x5d0925);}(_0x35f2,0xe8));var _0x235f=function(_0x79eeae,_0x4be496){_0x79eeae=_0x79eeae-0x0;var _0x4a7717=_0x35f2[_0x79eeae];return _0x4a7717;};'use strict';var BPromise=require(_0x235f('0x0'));var jayson=require(_0x235f('0x1'));var client=jayson['client'][_0x235f('0x2')]({'port':0x232b});function request(_0x4efe16,_0x24f384){return new BPromise(function(_0x13b0cc,_0x23a3b3){return client[_0x235f('0x3')](_0x4efe16,_0x24f384)['then'](function(_0x18c766){if(_0x18c766[_0x235f('0x4')]){return _0x23a3b3(_0x18c766[_0x235f('0x4')][_0x235f('0x5')]);}else{return _0x13b0cc(_0x18c766[_0x235f('0x6')]);}})[_0x235f('0x7')](function(_0x5abb1a){return _0x23a3b3(_0x5abb1a);});});}exports[_0x235f('0x8')]=function(_0x143183,_0x36d30f){return request(_0x235f('0x9'),{'account':_0x143183,'message':_0x36d30f});};
\ No newline at end of file
index a6a588e..8cf68e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dd1=['finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','traverseBFS','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','exports','lodash','moment','xml2json','util','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','toJson','mxGraphModel','root','inspect','production','start','debug','stringify','joinAt','format','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','arg_1','callerid','uniqueid','clear','vertex','info','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','evtHangup','result','toString','error','agicommand\x20not\x20found'];(function(_0x14e8ef,_0x5279b3){var _0x425d11=function(_0x456a66){while(--_0x456a66){_0x14e8ef['push'](_0x14e8ef['shift']());}};_0x425d11(++_0x5279b3);}(_0x7dd1,0x10b));var _0x17dd=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x7dd1[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require(_0x17dd('0x0'));var moment=require(_0x17dd('0x1'));var parser=require(_0x17dd('0x2'));var util=require(_0x17dd('0x3'));var logger=require('../../config/logger')(_0x17dd('0x4'));var rpc=require(_0x17dd('0x5'));var mailRpc=require(_0x17dd('0x6'));var Graph=require(_0x17dd('0x7'));var Vertices=require(_0x17dd('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x17dd('0x9')]()['catch'](function(_0x441389){logger['error'](_0x17dd('0xa'),_0x441389[_0x17dd('0xb')]);return[];});}function addVertex(_0x237569,_0x1e96a1,_0x7f7102){_0x1e96a1[_0x17dd('0xc')]=_0x7f7102;if(_0x1e96a1[_0x17dd('0xd')](_0x17dd('0xe'))){_0x1e96a1['maxRetry']=parseInt(_0x1e96a1[_0x17dd('0xe')],0xa);}_0x237569[_0x17dd('0xf')](_[_0x17dd('0x10')](_0x1e96a1,_0x17dd('0x11')));}function initGraph(_0x2b7484,_0x48d45b){var _0x2c8d05=new Graph();for(var _0x104691 in _0x2b7484){if(_0x2b7484[_0x17dd('0xd')](_0x104691)){if(_[_0x17dd('0x12')](_0x2b7484[_0x104691])){for(var _0x4fffc3=0x0;_0x4fffc3<_0x2b7484[_0x104691][_0x17dd('0x13')];_0x4fffc3+=0x1){addVertex(_0x2c8d05,_0x2b7484[_0x104691][_0x4fffc3],_0x104691);}}else{addVertex(_0x2c8d05,_0x2b7484[_0x104691],_0x104691);}}}for(var _0x4e8e28=0x0;_0x4e8e28<_0x48d45b['length'];_0x4e8e28+=0x1){if(_0x48d45b[_0x4e8e28][_0x17dd('0x14')]&&_0x48d45b[_0x4e8e28][_0x17dd('0x15')]){_0x2c8d05[_0x17dd('0x16')](_0x48d45b[_0x4e8e28][_0x17dd('0x14')],_0x48d45b[_0x4e8e28][_0x17dd('0x15')],_0x48d45b[_0x4e8e28][_0x17dd('0x17')]);}}return _0x2c8d05;}function getRoot(_0x3bf928){return parser[_0x17dd('0x18')](_0x3bf928,{'object':!![]})[_0x17dd('0x19')][_0x17dd('0x1a')];}function inspect(_0x3f49d3){return util[_0x17dd('0x1b')](_0x3f49d3,{'showHidden':![],'depth':null});}function initialize(_0xfe0724,_0x10aaf2){var _0x41cc71=getRoot(_0xfe0724[_0x17dd('0x1c')]);if(!_0x41cc71||!_0x41cc71[_0x17dd('0x1d')])return;var _0x49f6c4,_0x13a08a,_0x1defb0;logger[_0x17dd('0x1e')](_0x17dd('0x1a'),JSON[_0x17dd('0x1f')](_0x41cc71,null,0x2));_0x10aaf2[_0x17dd('0x20')]=moment()[_0x17dd('0x21')](_0x17dd('0x22'));_0x49f6c4=initGraph(_['omit'](_0x41cc71,_0x17dd('0x11')),_0x41cc71['mxCell']);_0x13a08a=new Vertices(_0x10aaf2,rpc,mailRpc);logger['info'](util[_0x17dd('0x21')](_0x17dd('0x23'),_0x10aaf2[_0x17dd('0x24')],_0x10aaf2['calleridname'],_0x10aaf2[_0x17dd('0x25')],_0x10aaf2['dnid'],_0x10aaf2[_0x17dd('0x26')]));_0x49f6c4['traverseBFS'](_0x41cc71['start']['id'],function(_0x12fd13){try{_0x12fd13=_0x13a08a[_0x17dd('0x27')](_0x12fd13);logger[_0x17dd('0x1e')](_0x17dd('0x28'),JSON[_0x17dd('0x1f')](_0x12fd13,null,0x2));if(_0x12fd13[_0x17dd('0xc')]==='gotoc'){logger[_0x17dd('0x29')](_0x17dd('0x2a'));_0x10aaf2['context']=_0x12fd13[_0x17dd('0x2b')]||_0x10aaf2[_0x17dd('0x2b')];_0x10aaf2[_0x17dd('0x2c')]=_0x12fd13[_0x17dd('0x2c')];_0x10aaf2[_0x17dd('0x2d')]=_0x12fd13[_0x17dd('0x2d')]?_0x12fd13[_0x17dd('0x2d')]-0x1:0x1;return null;}else if(_0x12fd13&&_0x13a08a[_0x12fd13[_0x17dd('0xc')]]){_0x1defb0=_0x13a08a[_0x12fd13['agicommand']](_0x12fd13);logger[_0x17dd('0x29')](_0x17dd('0x2e'),JSON['stringify'](_0x1defb0,null,0x2));if(_0x1defb0&&_0x1defb0[_0x17dd('0x2f')]===AGI_CODE_SUCCESS&&_0x1defb0['result']!==AGI_RESULT_ERROR&&!_0x10aaf2[_0x17dd('0x30')]){logger['debug'](_0x17dd('0x2e'),inspect(_0x1defb0));return _['isUndefined'](_0x1defb0[_0x17dd('0x31')])?null:_0x1defb0['result'][_0x17dd('0x32')]();}else{logger[_0x17dd('0x33')](_0x17dd('0x2e'),inspect(_0x1defb0));return null;}}else{logger[_0x17dd('0x33')](_0x17dd('0x34'));return null;}}catch(_0x4f3a05){logger[_0x17dd('0x33')](_0x4f3a05['stack']);return null;}});if(_0x41cc71[_0x17dd('0x35')]){logger[_0x17dd('0x29')](util[_0x17dd('0x21')](_0x17dd('0x36'),_0x10aaf2[_0x17dd('0x24')],_0x10aaf2[_0x17dd('0x37')],_0x10aaf2[_0x17dd('0x25')],_0x10aaf2['dnid'],_0x10aaf2[_0x17dd('0x26')]));_0x49f6c4[_0x17dd('0x38')](_0x41cc71[_0x17dd('0x35')]['id'],function(_0x4814b5){try{_0x4814b5=_0x13a08a[_0x17dd('0x27')](_0x4814b5);logger[_0x17dd('0x1e')](_0x17dd('0x28'),JSON['stringify'](_0x4814b5,null,0x2));if(_0x4814b5&&_0x13a08a[_0x4814b5['agicommand']]){_0x1defb0=_0x13a08a[_0x4814b5[_0x17dd('0xc')]](_0x4814b5);if(_0x1defb0){logger[_0x17dd('0x1e')](_0x17dd('0x2e'),inspect(_0x1defb0));return _[_0x17dd('0x39')](_0x1defb0[_0x17dd('0x31')])?null:_0x1defb0[_0x17dd('0x31')][_0x17dd('0x32')]();}else{logger[_0x17dd('0x33')]('response',inspect(_0x1defb0));return null;}}else{logger['error'](_0x17dd('0x34'));return null;}}catch(_0x34ca87){logger[_0x17dd('0x33')](_0x34ca87[_0x17dd('0xb')]);return null;}});}logger[_0x17dd('0x29')](util[_0x17dd('0x21')](_0x17dd('0x3a'),_0x10aaf2['arg_1'],_0x10aaf2[_0x17dd('0x37')],_0x10aaf2['callerid'],_0x10aaf2[_0x17dd('0x3b')],_0x10aaf2['uniqueid']));logger['info'](util[_0x17dd('0x21')](_0x17dd('0x3c'),_0x10aaf2[_0x17dd('0x2b')],_0x10aaf2[_0x17dd('0x2c')],parseInt(_0x10aaf2['priority'],0xa)+0x1));_0x10aaf2[_0x17dd('0x3d')](_0x10aaf2[_0x17dd('0x2b')],_0x10aaf2[_0x17dd('0x2c')],parseInt(_0x10aaf2[_0x17dd('0x2d')],0xa)+0x1);_0x10aaf2[_0x17dd('0x3e')]();}function handleNotFound(_0x4774cd){logger[_0x17dd('0x33')](util[_0x17dd('0x21')]('Project\x20%s\x20not\x20found',_0x4774cd['arg_1']));_0x4774cd[_0x17dd('0x3d')](_0x4774cd[_0x17dd('0x2b')],_0x4774cd[_0x17dd('0x2c')],parseInt(_0x4774cd[_0x17dd('0x2d')],0xa)+0x1);_0x4774cd[_0x17dd('0x3e')]();}function handleUnpublished(_0x3cd084){logger['error'](util[_0x17dd('0x21')]('Project\x20%s\x20not\x20published',_0x3cd084['arg_1']));_0x3cd084['continueAt'](_0x3cd084[_0x17dd('0x2b')],_0x3cd084[_0x17dd('0x2c')],parseInt(_0x3cd084[_0x17dd('0x2d')],0xa)+0x1);_0x3cd084[_0x17dd('0x3e')]();}module[_0x17dd('0x3f')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file
+var _0xe8ae=['start','debug','stringify','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','traverseBFS','clear','vertex','gotoc','info','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','evtHangup','toString','error','stack','finally','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','moment','util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','Unable\x20to\x20download\x20CallySquare\x20projects','agicommand','hasOwnProperty','retry','omit','mxCell','isArray','length','source','target','addEdge','toJson','mxGraphModel','root','inspect','production'];(function(_0x3b8b03,_0x49ff54){var _0xefe7ae=function(_0x4b57c8){while(--_0x4b57c8){_0x3b8b03['push'](_0x3b8b03['shift']());}};_0xefe7ae(++_0x49ff54);}(_0xe8ae,0x9c));var _0xee8a=function(_0x4baad9,_0x232a0b){_0x4baad9=_0x4baad9-0x0;var _0x2b11e9=_0xe8ae[_0x4baad9];return _0x2b11e9;};'use strict';var _=require(_0xee8a('0x0'));var moment=require(_0xee8a('0x1'));var parser=require('xml2json');var util=require(_0xee8a('0x2'));var logger=require(_0xee8a('0x3'))(_0xee8a('0x4'));var rpc=require(_0xee8a('0x5'));var mailRpc=require(_0xee8a('0x6'));var Graph=require(_0xee8a('0x7'));var Vertices=require(_0xee8a('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xee8a('0x9')]()[_0xee8a('0xa')](function(_0x2fc157){logger['error'](_0xee8a('0xb'),_0x2fc157['stack']);return[];});}function addVertex(_0x135175,_0x5b21c5,_0x31991c){_0x5b21c5[_0xee8a('0xc')]=_0x31991c;if(_0x5b21c5[_0xee8a('0xd')]('retry')){_0x5b21c5['maxRetry']=parseInt(_0x5b21c5[_0xee8a('0xe')],0xa);}_0x135175['addVertex'](_[_0xee8a('0xf')](_0x5b21c5,_0xee8a('0x10')));}function initGraph(_0x146ae6,_0x283c7d){var _0x2b6281=new Graph();for(var _0x207af3 in _0x146ae6){if(_0x146ae6[_0xee8a('0xd')](_0x207af3)){if(_[_0xee8a('0x11')](_0x146ae6[_0x207af3])){for(var _0x3d6015=0x0;_0x3d6015<_0x146ae6[_0x207af3][_0xee8a('0x12')];_0x3d6015+=0x1){addVertex(_0x2b6281,_0x146ae6[_0x207af3][_0x3d6015],_0x207af3);}}else{addVertex(_0x2b6281,_0x146ae6[_0x207af3],_0x207af3);}}}for(var _0x15126a=0x0;_0x15126a<_0x283c7d['length'];_0x15126a+=0x1){if(_0x283c7d[_0x15126a][_0xee8a('0x13')]&&_0x283c7d[_0x15126a][_0xee8a('0x14')]){_0x2b6281[_0xee8a('0x15')](_0x283c7d[_0x15126a][_0xee8a('0x13')],_0x283c7d[_0x15126a][_0xee8a('0x14')],_0x283c7d[_0x15126a]['value']);}}return _0x2b6281;}function getRoot(_0x10cfde){return parser[_0xee8a('0x16')](_0x10cfde,{'object':!![]})[_0xee8a('0x17')][_0xee8a('0x18')];}function inspect(_0x2df86b){return util[_0xee8a('0x19')](_0x2df86b,{'showHidden':![],'depth':null});}function initialize(_0x1eb60e,_0x53de08){var _0x3a52ef=getRoot(_0x1eb60e[_0xee8a('0x1a')]);if(!_0x3a52ef||!_0x3a52ef[_0xee8a('0x1b')])return;var _0x1efa20,_0x41fdc8,_0x3c9c25;logger[_0xee8a('0x1c')](_0xee8a('0x18'),JSON[_0xee8a('0x1d')](_0x3a52ef,null,0x2));_0x53de08['joinAt']=moment()[_0xee8a('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');_0x1efa20=initGraph(_[_0xee8a('0xf')](_0x3a52ef,_0xee8a('0x10')),_0x3a52ef['mxCell']);_0x41fdc8=new Vertices(_0x53de08,rpc,mailRpc);logger['info'](util[_0xee8a('0x1e')](_0xee8a('0x1f'),_0x53de08[_0xee8a('0x20')],_0x53de08[_0xee8a('0x21')],_0x53de08[_0xee8a('0x22')],_0x53de08[_0xee8a('0x23')],_0x53de08['uniqueid']));_0x1efa20[_0xee8a('0x24')](_0x3a52ef[_0xee8a('0x1b')]['id'],function(_0x194a79){try{_0x194a79=_0x41fdc8[_0xee8a('0x25')](_0x194a79);logger[_0xee8a('0x1c')](_0xee8a('0x26'),JSON[_0xee8a('0x1d')](_0x194a79,null,0x2));if(_0x194a79['agicommand']===_0xee8a('0x27')){logger[_0xee8a('0x28')](_0xee8a('0x29'));_0x53de08[_0xee8a('0x2a')]=_0x194a79[_0xee8a('0x2a')]||_0x53de08['context'];_0x53de08[_0xee8a('0x2b')]=_0x194a79[_0xee8a('0x2b')];_0x53de08[_0xee8a('0x2c')]=_0x194a79[_0xee8a('0x2c')]?_0x194a79[_0xee8a('0x2c')]-0x1:0x1;return null;}else if(_0x194a79&&_0x41fdc8[_0x194a79[_0xee8a('0xc')]]){_0x3c9c25=_0x41fdc8[_0x194a79[_0xee8a('0xc')]](_0x194a79);logger['info'](_0xee8a('0x2d'),JSON[_0xee8a('0x1d')](_0x3c9c25,null,0x2));if(_0x3c9c25&&_0x3c9c25['code']===AGI_CODE_SUCCESS&&_0x3c9c25[_0xee8a('0x2e')]!==AGI_RESULT_ERROR&&!_0x53de08[_0xee8a('0x2f')]){logger[_0xee8a('0x1c')]('response',inspect(_0x3c9c25));return _['isUndefined'](_0x3c9c25[_0xee8a('0x2e')])?null:_0x3c9c25[_0xee8a('0x2e')][_0xee8a('0x30')]();}else{logger[_0xee8a('0x31')]('response',inspect(_0x3c9c25));return null;}}else{logger[_0xee8a('0x31')]('agicommand\x20not\x20found');return null;}}catch(_0x521ec8){logger[_0xee8a('0x31')](_0x521ec8[_0xee8a('0x32')]);return null;}});if(_0x3a52ef[_0xee8a('0x33')]){logger[_0xee8a('0x28')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x53de08[_0xee8a('0x20')],_0x53de08[_0xee8a('0x21')],_0x53de08[_0xee8a('0x22')],_0x53de08['dnid'],_0x53de08['uniqueid']));_0x1efa20[_0xee8a('0x24')](_0x3a52ef[_0xee8a('0x33')]['id'],function(_0x686de){try{_0x686de=_0x41fdc8[_0xee8a('0x25')](_0x686de);logger['debug']('vertex',JSON[_0xee8a('0x1d')](_0x686de,null,0x2));if(_0x686de&&_0x41fdc8[_0x686de['agicommand']]){_0x3c9c25=_0x41fdc8[_0x686de[_0xee8a('0xc')]](_0x686de);if(_0x3c9c25){logger[_0xee8a('0x1c')](_0xee8a('0x2d'),inspect(_0x3c9c25));return _['isUndefined'](_0x3c9c25['result'])?null:_0x3c9c25[_0xee8a('0x2e')][_0xee8a('0x30')]();}else{logger[_0xee8a('0x31')](_0xee8a('0x2d'),inspect(_0x3c9c25));return null;}}else{logger[_0xee8a('0x31')](_0xee8a('0x34'));return null;}}catch(_0x4fae48){logger[_0xee8a('0x31')](_0x4fae48[_0xee8a('0x32')]);return null;}});}logger['info'](util[_0xee8a('0x1e')](_0xee8a('0x35'),_0x53de08[_0xee8a('0x20')],_0x53de08[_0xee8a('0x21')],_0x53de08[_0xee8a('0x22')],_0x53de08[_0xee8a('0x23')],_0x53de08[_0xee8a('0x36')]));logger[_0xee8a('0x28')](util['format'](_0xee8a('0x37'),_0x53de08[_0xee8a('0x2a')],_0x53de08[_0xee8a('0x2b')],parseInt(_0x53de08[_0xee8a('0x2c')],0xa)+0x1));_0x53de08[_0xee8a('0x38')](_0x53de08[_0xee8a('0x2a')],_0x53de08['extension'],parseInt(_0x53de08['priority'],0xa)+0x1);_0x53de08[_0xee8a('0x39')]();}function handleNotFound(_0x249f63){logger['error'](util[_0xee8a('0x1e')](_0xee8a('0x3a'),_0x249f63[_0xee8a('0x20')]));_0x249f63['continueAt'](_0x249f63[_0xee8a('0x2a')],_0x249f63[_0xee8a('0x2b')],parseInt(_0x249f63['priority'],0xa)+0x1);_0x249f63['close']();}function handleUnpublished(_0x438441){logger[_0xee8a('0x31')](util[_0xee8a('0x1e')](_0xee8a('0x3b'),_0x438441[_0xee8a('0x20')]));_0x438441[_0xee8a('0x38')](_0x438441[_0xee8a('0x2a')],_0x438441['extension'],parseInt(_0x438441['priority'],0xa)+0x1);_0x438441[_0xee8a('0x39')]();}module[_0xee8a('0x3c')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file
index 7f2a5d4..d077f26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e32=['toString','indexOf','substring','slice','trim','length','emit','headers','line','exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a'];(function(_0x337c33,_0x508d9a){var _0x23f2da=function(_0x4f4030){while(--_0x4f4030){_0x337c33['push'](_0x337c33['shift']());}};_0x23f2da(++_0x508d9a);}(_0x2e32,0x186));var _0x22e3=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x2e32[_0x1b6c6d];return _0x290d9d;};'use strict';var util=require(_0x22e3('0x0'));var Transform=require(_0x22e3('0x1'))[_0x22e3('0x2')];function AGIReply(_0x40e1f5){Transform[_0x22e3('0x3')](this,_0x40e1f5);this[_0x22e3('0x4')]='';this[_0x22e3('0x5')]=![];}util[_0x22e3('0x6')](AGIReply,Transform);AGIReply[_0x22e3('0x7')][_0x22e3('0x8')]=function(_0x1d187e,_0x249a4d,_0x52b88b){var _0x1aa8b4='\x0a',_0x56a2c5=['\x0a\x0a',_0x22e3('0x9')],_0x512e3b=-0x1,_0x30a19b=-0x1,_0x2de007='',_0x372093=0x0,_0xbd0686='',_0x3b0df2='';this[_0x22e3('0x4')]+=_0x1d187e[_0x22e3('0xa')]();_0xbd0686=this['_localBuffer'];if(!this[_0x22e3('0x5')]){_0x372093=0x0;while(_0x56a2c5[_0x372093]){while((_0x30a19b=_0xbd0686[_0x22e3('0xb')](_0x56a2c5[_0x372093]))!=-0x1){_0x2de007=_0x56a2c5[_0x372093];_0x3b0df2=_0xbd0686['substring'](0x0,_0x30a19b);_0xbd0686=_0xbd0686[_0x22e3('0xc')](_0x30a19b+_0x2de007['length']);var _0x4fe06d=_0x3b0df2['split'](_0x1aa8b4),_0x2c47c4=0x0,_0x54bd0d={},_0x4323ba='',_0x374f3f='',_0x46e312=-0x1;while(_0x4fe06d[_0x2c47c4]){_0x46e312=_0x4fe06d[_0x2c47c4][_0x22e3('0xb')](':');if(_0x46e312!=-0x1){_0x4323ba=_0x4fe06d[_0x2c47c4][_0x22e3('0xd')](0x0,_0x46e312)[_0x22e3('0xe')]();_0x374f3f=_0x4fe06d[_0x2c47c4][_0x22e3('0xd')](_0x46e312+0x1)[_0x22e3('0xe')]();if(_0x4323ba[_0x22e3('0xf')]>0x0){_0x54bd0d[_0x4323ba]=_0x374f3f;}}else{}_0x2c47c4++;}this[_0x22e3('0x10')](_0x22e3('0x11'),_0x54bd0d);this[_0x22e3('0x5')]=!![];}_0x372093++;}this['_localBuffer']=_0xbd0686;}else{while((_0x512e3b=_0xbd0686[_0x22e3('0xb')](_0x1aa8b4))!=-0x1){_0x3b0df2=_0xbd0686[_0x22e3('0xc')](0x0,_0x512e3b);this[_0x22e3('0x10')](_0x22e3('0x12'),_0x3b0df2);_0xbd0686=_0xbd0686[_0x22e3('0xc')](_0x512e3b+_0x1aa8b4[_0x22e3('0xf')]);}this[_0x22e3('0x4')]=_0xbd0686;}_0x52b88b();};module[_0x22e3('0x13')]=AGIReply;
\ No newline at end of file
+var _0xef36=['util','stream','Transform','call','_localBuffer','_inBody','inherits','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','slice','trim','emit','headers','exports'];(function(_0x59e64a,_0x298faa){var _0x217497=function(_0x569988){while(--_0x569988){_0x59e64a['push'](_0x59e64a['shift']());}};_0x217497(++_0x298faa);}(_0xef36,0x18c));var _0x6ef3=function(_0x33bce2,_0x7a0af8){_0x33bce2=_0x33bce2-0x0;var _0x5d0b98=_0xef36[_0x33bce2];return _0x5d0b98;};'use strict';var util=require(_0x6ef3('0x0'));var Transform=require(_0x6ef3('0x1'))[_0x6ef3('0x2')];function AGIReply(_0x2f6059){Transform[_0x6ef3('0x3')](this,_0x2f6059);this[_0x6ef3('0x4')]='';this[_0x6ef3('0x5')]=![];}util[_0x6ef3('0x6')](AGIReply,Transform);AGIReply['prototype'][_0x6ef3('0x7')]=function(_0x1cd05a,_0x263a6c,_0x151187){var _0x25c67e='\x0a',_0x21b4b9=['\x0a\x0a',_0x6ef3('0x8')],_0x1ed7e0=-0x1,_0x4a3076=-0x1,_0x45b6eb='',_0x3e5218=0x0,_0x26ec6f='',_0x32ec26='';this[_0x6ef3('0x4')]+=_0x1cd05a[_0x6ef3('0x9')]();_0x26ec6f=this[_0x6ef3('0x4')];if(!this[_0x6ef3('0x5')]){_0x3e5218=0x0;while(_0x21b4b9[_0x3e5218]){while((_0x4a3076=_0x26ec6f[_0x6ef3('0xa')](_0x21b4b9[_0x3e5218]))!=-0x1){_0x45b6eb=_0x21b4b9[_0x3e5218];_0x32ec26=_0x26ec6f[_0x6ef3('0xb')](0x0,_0x4a3076);_0x26ec6f=_0x26ec6f[_0x6ef3('0xb')](_0x4a3076+_0x45b6eb[_0x6ef3('0xc')]);var _0x30e5e3=_0x32ec26['split'](_0x25c67e),_0x5d69fc=0x0,_0x3d40e4={},_0xddf664='',_0x1c3505='',_0x2a2e5f=-0x1;while(_0x30e5e3[_0x5d69fc]){_0x2a2e5f=_0x30e5e3[_0x5d69fc][_0x6ef3('0xa')](':');if(_0x2a2e5f!=-0x1){_0xddf664=_0x30e5e3[_0x5d69fc][_0x6ef3('0xd')](0x0,_0x2a2e5f)[_0x6ef3('0xe')]();_0x1c3505=_0x30e5e3[_0x5d69fc]['slice'](_0x2a2e5f+0x1)['trim']();if(_0xddf664[_0x6ef3('0xc')]>0x0){_0x3d40e4[_0xddf664]=_0x1c3505;}}else{}_0x5d69fc++;}this[_0x6ef3('0xf')](_0x6ef3('0x10'),_0x3d40e4);this['_inBody']=!![];}_0x3e5218++;}this[_0x6ef3('0x4')]=_0x26ec6f;}else{while((_0x1ed7e0=_0x26ec6f[_0x6ef3('0xa')](_0x25c67e))!=-0x1){_0x32ec26=_0x26ec6f[_0x6ef3('0xb')](0x0,_0x1ed7e0);this['emit']('line',_0x32ec26);_0x26ec6f=_0x26ec6f[_0x6ef3('0xb')](_0x1ed7e0+_0x25c67e['length']);}this[_0x6ef3('0x4')]=_0x26ec6f;}_0x151187();};module[_0x6ef3('0x11')]=AGIReply;
\ No newline at end of file
index 2133a75..bcb98e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcee8=['ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentUnpause','agentLogout','LogoutUser','lodash','moment','jayson/promise','client','http','request','then','error','catch','getSquareProjects','GetSquareProjects','name','production','ShowSquareProject','getMailAccountById','MailServerOut','CloudProvider','email','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','GetContactByPhone','phone','getTrunkById','getSoundById','save_name','getIntervalById','Interval','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper'];(function(_0x46d1d6,_0xa290e7){var _0x46ac8f=function(_0x27594c){while(--_0x27594c){_0x46d1d6['push'](_0x46d1d6['shift']());}};_0x46ac8f(++_0xa290e7);}(_0xcee8,0xb1));var _0x8cee=function(_0x1ddea0,_0x2d5231){_0x1ddea0=_0x1ddea0-0x0;var _0x2daa0c=_0xcee8[_0x1ddea0];return _0x2daa0c;};'use strict';var _=require(_0x8cee('0x0'));var moment=require(_0x8cee('0x1'));var jayson=require(_0x8cee('0x2'));var client=jayson[_0x8cee('0x3')][_0x8cee('0x4')]({'port':0x2329});function request(_0x6608db,_0x5b82bd){return new Promise(function(_0x127360,_0x4e4143){return client[_0x8cee('0x5')](_0x6608db,_0x5b82bd)[_0x8cee('0x6')](function(_0x482900){if(_0x482900[_0x8cee('0x7')]){return _0x4e4143(_0x482900[_0x8cee('0x7')]['message']);}else{return _0x127360(_0x482900['result']);}})[_0x8cee('0x8')](function(_0x49a070){return _0x4e4143(_0x49a070);});});}exports[_0x8cee('0x9')]=function(){return request(_0x8cee('0xa'),{'options':{'raw':![],'attributes':['id',_0x8cee('0xb'),_0x8cee('0xc')]}});};exports['getSquareProject']=function(_0x17d67a){return request(_0x8cee('0xd'),{'options':{'raw':![],'where':{'name':_0x17d67a},'attributes':['production']}});};exports[_0x8cee('0xe')]=function(_0x16a4b9){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x16a4b9},'include':[{'model':_0x8cee('0xf'),'as':'Smtp','include':[{'model':_0x8cee('0x10'),'as':_0x8cee('0x10')}]}],'attributes':['id',_0x8cee('0xb'),_0x8cee('0x11')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x5d4de3){return request(_0x8cee('0xd'),{'options':{'where':{'id':_0x5d4de3},'attributes':[_0x8cee('0xb')]}});};exports[_0x8cee('0x12')]=function(_0x227762){return request(_0x8cee('0x13'),{'options':{'where':{'id':_0x227762},'attributes':[_0x8cee('0xb')]}});};exports[_0x8cee('0x14')]=function(_0x3c3694){return request(_0x8cee('0x15'),{'options':{'where':{'id':_0x3c3694},'attributes':[_0x8cee('0xb')]}});};exports[_0x8cee('0x16')]=function(_0x39213b){return request(_0x8cee('0x17'),{'options':{'where':{'id':_0x39213b},'attributes':[_0x8cee('0x18')]}});};exports[_0x8cee('0x19')]=function(_0x5f53e3){return request(_0x8cee('0x1a'),{'options':{'where':{'id':_0x5f53e3},'attributes':['name']}});};exports['getContactByPhone']=function(_0x8e242b){return request(_0x8cee('0x1b'),{'options':{'where':{'phone':_0x8e242b[_0x8cee('0x1c')]},'attributes':['id']}});};exports[_0x8cee('0x1d')]=function(_0x42d863){return request('ShowTrunk',{'options':{'where':{'id':_0x42d863},'attributes':[_0x8cee('0xb')]}});};exports[_0x8cee('0x1e')]=function(_0x1f110c){return request('ShowSound',{'options':{'where':{'id':_0x1f110c},'attributes':[_0x8cee('0x1f')]}});};exports[_0x8cee('0x20')]=function(_0x52262a){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x52262a},'include':[{'model':_0x8cee('0x21'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x51a93f){return request('ShowSmsAccount',{'options':{'where':{'id':_0x51a93f},'attributes':['id',_0x8cee('0xb')]}});};exports['createSmsMessage']=function(_0x117bc6){return request('CreateSmsMessage',{'body':_0x117bc6});};exports[_0x8cee('0x22')]=function(_0x27e8fb){return request(_0x8cee('0x23'),{'body':_0x27e8fb});};exports[_0x8cee('0x24')]=function(_0x38fcd6){return request(_0x8cee('0x25'),{'body':_[_0x8cee('0x26')](_0x38fcd6,{'project_name':_0x38fcd6[_0x8cee('0x27')],'prev_project_name':_0x38fcd6['arg_2']||'','is_subproject':_0x38fcd6[_0x8cee('0x28')]?!![]:![],'leaveAt':moment()[_0x8cee('0x29')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x17c2ad){return request(_0x8cee('0x2a'),{'body':_0x17c2ad});};exports[_0x8cee('0x2b')]=function(_0x8b5e32){return request(_0x8cee('0x2c'),{'body':_0x8b5e32});};exports[_0x8cee('0x2d')]=function(_0x51003d){return request(_0x8cee('0x2e'),{'options':{'raw':![],'where':{'phone':_0x51003d['phone'],'ListId':_0x51003d[_0x8cee('0x2f')]}}})[_0x8cee('0x6')](function(_0x16f571){if(_0x16f571){return _0x16f571;}return request(_0x8cee('0x30'),{'body':_0x51003d});});};exports[_0x8cee('0x31')]=function(_0x513759){return request(_0x8cee('0x32'),{'options':{'where':{'id':_0x513759},'attributes':['name']}});};exports[_0x8cee('0x33')]=function(_0xcd691,_0x22adea){return request(_0x8cee('0x34'),{'body':{'interface':_0x22adea},'options':{'where':_0xcd691}});};exports['agentPause']=function(_0x3df58f,_0x5aab70,_0x2ede52){return request('PauseUser',{'body':{'type':_0x5aab70,'uniqueid':_0x2ede52},'options':{'where':_0x3df58f}});};exports[_0x8cee('0x35')]=function(_0x495100){return request('UnpauseUser',{'body':{},'options':{'where':_0x495100}});};exports[_0x8cee('0x36')]=function(_0xebb76e){return request(_0x8cee('0x37'),{'body':{},'options':{'where':_0xebb76e}});};
\ No newline at end of file
+var _0x3561=['getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','format','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','jayson/promise','client','http','request','then','error','message','catch','getSquareProjects','production','getSquareProject','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','CloudProvider','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Interval','Intervals'];(function(_0x1663ae,_0x10484a){var _0x30ffb8=function(_0x21e006){while(--_0x21e006){_0x1663ae['push'](_0x1663ae['shift']());}};_0x30ffb8(++_0x10484a);}(_0x3561,0x94));var _0x1356=function(_0x3691fc,_0x47ea9b){_0x3691fc=_0x3691fc-0x0;var _0x531514=_0x3561[_0x3691fc];return _0x531514;};'use strict';var _=require(_0x1356('0x0'));var moment=require('moment');var jayson=require(_0x1356('0x1'));var client=jayson[_0x1356('0x2')][_0x1356('0x3')]({'port':0x2329});function request(_0x14465e,_0x442fbc){return new Promise(function(_0x313999,_0x1634de){return client[_0x1356('0x4')](_0x14465e,_0x442fbc)[_0x1356('0x5')](function(_0x23a659){if(_0x23a659[_0x1356('0x6')]){return _0x1634de(_0x23a659[_0x1356('0x6')][_0x1356('0x7')]);}else{return _0x313999(_0x23a659['result']);}})[_0x1356('0x8')](function(_0x33529f){return _0x1634de(_0x33529f);});});}exports[_0x1356('0x9')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id','name',_0x1356('0xa')]}});};exports[_0x1356('0xb')]=function(_0x4f2abe){return request(_0x1356('0xc'),{'options':{'raw':![],'where':{'name':_0x4f2abe},'attributes':['production']}});};exports[_0x1356('0xd')]=function(_0x2d5865){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x2d5865},'include':[{'model':_0x1356('0xe'),'as':_0x1356('0xf'),'include':[{'model':'CloudProvider','as':_0x1356('0x10')}]}],'attributes':['id',_0x1356('0x11'),_0x1356('0x12')],'smtp':!![]}});};exports[_0x1356('0x13')]=function(_0x319af1){return request(_0x1356('0xc'),{'options':{'where':{'id':_0x319af1},'attributes':[_0x1356('0x11')]}});};exports[_0x1356('0x14')]=function(_0x365fb0){return request(_0x1356('0x15'),{'options':{'where':{'id':_0x365fb0},'attributes':[_0x1356('0x11')]}});};exports[_0x1356('0x16')]=function(_0x58975b){return request('ShowVariable',{'options':{'where':{'id':_0x58975b},'attributes':['name']}});};exports[_0x1356('0x17')]=function(_0x3c2adc){return request(_0x1356('0x18'),{'options':{'where':{'id':_0x3c2adc},'attributes':['dsn']}});};exports[_0x1356('0x19')]=function(_0x3645c0){return request(_0x1356('0x1a'),{'options':{'where':{'id':_0x3645c0},'attributes':[_0x1356('0x11')]}});};exports[_0x1356('0x1b')]=function(_0x36655c){return request(_0x1356('0x1c'),{'options':{'where':{'phone':_0x36655c[_0x1356('0x1d')]},'attributes':['id']}});};exports[_0x1356('0x1e')]=function(_0x370a91){return request(_0x1356('0x1f'),{'options':{'where':{'id':_0x370a91},'attributes':[_0x1356('0x11')]}});};exports[_0x1356('0x20')]=function(_0x54c1a6){return request(_0x1356('0x21'),{'options':{'where':{'id':_0x54c1a6},'attributes':['save_name']}});};exports[_0x1356('0x22')]=function(_0x57b864){return request(_0x1356('0x23'),{'options':{'raw':![],'where':{'id':_0x57b864},'include':[{'model':_0x1356('0x24'),'as':_0x1356('0x25')}]}});};exports[_0x1356('0x26')]=function(_0x10d756){return request(_0x1356('0x27'),{'options':{'where':{'id':_0x10d756},'attributes':['id','name']}});};exports[_0x1356('0x28')]=function(_0x2c26be){return request('CreateSmsMessage',{'body':_0x2c26be});};exports[_0x1356('0x29')]=function(_0x13d30b){return request(_0x1356('0x2a'),{'body':_0x13d30b});};exports['createSquareReport']=function(_0xc153ed){return request(_0x1356('0x2b'),{'body':_[_0x1356('0x2c')](_0xc153ed,{'project_name':_0xc153ed[_0x1356('0x2d')],'prev_project_name':_0xc153ed['arg_2']||'','is_subproject':_0xc153ed['arg_2']?!![]:![],'leaveAt':moment()[_0x1356('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x1356('0x2f')]=function(_0x3967f9){return request(_0x1356('0x30'),{'body':_0x3967f9});};exports[_0x1356('0x31')]=function(_0x39796b){return request('CreateSquareMessage',{'body':_0x39796b});};exports[_0x1356('0x32')]=function(_0x29ede4){return request(_0x1356('0x33'),{'options':{'raw':![],'where':{'phone':_0x29ede4[_0x1356('0x1d')],'ListId':_0x29ede4[_0x1356('0x34')]}}})[_0x1356('0x5')](function(_0x4bb4a9){if(_0x4bb4a9){return _0x4bb4a9;}return request(_0x1356('0x35'),{'body':_0x29ede4});});};exports['getPauseById']=function(_0x28dadc){return request('ShowPause',{'options':{'where':{'id':_0x28dadc},'attributes':['name']}});};exports[_0x1356('0x36')]=function(_0x406ca5,_0x5806c0){return request(_0x1356('0x37'),{'body':{'interface':_0x5806c0},'options':{'where':_0x406ca5}});};exports[_0x1356('0x38')]=function(_0x307c88,_0x31cc14,_0x353268){return request(_0x1356('0x39'),{'body':{'type':_0x31cc14,'uniqueid':_0x353268},'options':{'where':_0x307c88}});};exports[_0x1356('0x3a')]=function(_0x5150a0){return request(_0x1356('0x3b'),{'body':{},'options':{'where':_0x5150a0}});};exports[_0x1356('0x3c')]=function(_0x3480ad){return request(_0x1356('0x3d'),{'body':{},'options':{'where':_0x3480ad}});};
\ No newline at end of file
index 40b26b6..1455c37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e47=['exports'];(function(_0x546a47,_0x5dc342){var _0x3f6f1a=function(_0x38e67c){while(--_0x38e67c){_0x546a47['push'](_0x546a47['shift']());}};_0x3f6f1a(++_0x5dc342);}(_0x4e47,0x17f));var _0x74e4=function(_0x1cb101,_0x5529dd){_0x1cb101=_0x1cb101-0x0;var _0x170044=_0x4e47[_0x1cb101];return _0x170044;};var polly=require('./polly');var lex=require('./lex');module[_0x74e4('0x0')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x6869=['exports','./polly','./lex'];(function(_0x876a6d,_0x561a74){var _0x1c80cb=function(_0x39206b){while(--_0x39206b){_0x876a6d['push'](_0x876a6d['shift']());}};_0x1c80cb(++_0x561a74);}(_0x6869,0xe2));var _0x9686=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6869[_0x502c7d];return _0x30b7ed;};var polly=require(_0x9686('0x0'));var lex=require(_0x9686('0x1'));module[_0x9686('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
index c04d2f9..02e7596 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ea3=['./lib/api','exports'];(function(_0x3bb671,_0x1ad41a){var _0x40e2fc=function(_0x1abae3){while(--_0x1abae3){_0x3bb671['push'](_0x3bb671['shift']());}};_0x40e2fc(++_0x1ad41a);}(_0x4ea3,0x70));var _0x34ea=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4ea3[_0x3b380d];return _0x54502b;};'use strict';var lex=require(_0x34ea('0x0'));module[_0x34ea('0x1')]=function(_0x324f65,_0x3ab582,_0x588172,_0x374ec1,_0x494b56,_0x269d4c){return lex(_0x324f65,_0x3ab582,_0x588172,_0x374ec1,_0x494b56,_0x269d4c);};
\ No newline at end of file
+var _0xaa88=['exports','./lib/api'];(function(_0x181dc5,_0x35a142){var _0x4d9f74=function(_0x31c1e6){while(--_0x31c1e6){_0x181dc5['push'](_0x181dc5['shift']());}};_0x4d9f74(++_0x35a142);}(_0xaa88,0x137));var _0x8aa8=function(_0x365be9,_0x3c88b9){_0x365be9=_0x365be9-0x0;var _0x185c12=_0xaa88[_0x365be9];return _0x185c12;};'use strict';var lex=require(_0x8aa8('0x0'));module[_0x8aa8('0x1')]=function(_0x1643a6,_0x51c79b,_0x4aee38,_0x4ba9dd,_0x3a5b12,_0x43f7e4){return lex(_0x1643a6,_0x51c79b,_0x4aee38,_0x4ba9dd,_0x3a5b12,_0x43f7e4);};
\ No newline at end of file
index 0c1e559..57bb9b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x5abb9c,_0x13434c){var _0xde6af5=function(_0x4852b1){while(--_0x4852b1){_0x5abb9c['push'](_0x5abb9c['shift']());}};_0xde6af5(++_0x13434c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);};
\ No newline at end of file
+var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x44166e,_0x23dd85){var _0x4ed754=function(_0x7ddaee){while(--_0x7ddaee){_0x44166e['push'](_0x44166e['shift']());}};_0x4ed754(++_0x23dd85);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);};
\ No newline at end of file
index 854b674..266ff17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8226=['exports'];(function(_0x26e490,_0x2b69de){var _0x3b43c3=function(_0x400217){while(--_0x400217){_0x26e490['push'](_0x26e490['shift']());}};_0x3b43c3(++_0x2b69de);}(_0x8226,0x8f));var _0x6822=function(_0x4a2995,_0x3644c9){_0x4a2995=_0x4a2995-0x0;var _0x5141dd=_0x8226[_0x4a2995];return _0x5141dd;};'use strict';var polly=require('./lib/api');module[_0x6822('0x0')]=function(_0x15507d,_0x591b5b,_0x2b7720,_0x1b3f87,_0x1c7ffd,_0x5e6e16,_0x2669ab){return polly(_0x15507d,_0x591b5b,_0x2b7720,_0x1b3f87,_0x1c7ffd,_0x5e6e16,_0x2669ab);};
\ No newline at end of file
+var _0xa52c=['./lib/api'];(function(_0x174951,_0x255a3f){var _0x1010ec=function(_0x3c299f){while(--_0x3c299f){_0x174951['push'](_0x174951['shift']());}};_0x1010ec(++_0x255a3f);}(_0xa52c,0x1bf));var _0xca52=function(_0x5c7b83,_0x348552){_0x5c7b83=_0x5c7b83-0x0;var _0x11541b=_0xa52c[_0x5c7b83];return _0x11541b;};'use strict';var polly=require(_0xca52('0x0'));module['exports']=function(_0x2c9657,_0x34f455,_0x1be6e4,_0x3f0bd6,_0x52ed98,_0x5d3746,_0x128ab5){return polly(_0x2c9657,_0x34f455,_0x1be6e4,_0x3f0bd6,_0x52ed98,_0x5d3746,_0x128ab5);};
\ No newline at end of file
index 7e7679c..b7c61f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2af=['No\x20data\x20response\x20from\x20aws\x20Polly!','exports','path','bluebird','randomstring','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0xcca2a3,_0x11ac86){var _0x412684=function(_0x924ca9){while(--_0x924ca9){_0xcca2a3['push'](_0xcca2a3['shift']());}};_0x412684(++_0x11ac86);}(_0xe2af,0x173));var _0xfe2a=function(_0x1077e1,_0x3e5b47){_0x1077e1=_0x1077e1-0x0;var _0x50074c=_0xe2af[_0x1077e1];return _0x50074c;};'use strict';var fs=require('fs');var path=require(_0xfe2a('0x0'));var BPromise=require(_0xfe2a('0x1'));var rs=require(_0xfe2a('0x2'));var AWS=require(_0xfe2a('0x3'));function pollyResult(_0x4c8d5b,_0x1a1974,_0x49424b){return new BPromise(function(_0x587117,_0x25332a){_0x4c8d5b['synthesizeSpeech'](_0x1a1974,function(_0x40793e,_0x3bdabf){if(_0x40793e){_0x25332a(_0x40793e);}else if(_0x3bdabf){if(_0x3bdabf[_0xfe2a('0x4')]instanceof Buffer){fs[_0xfe2a('0x5')](_0x49424b,_0x3bdabf[_0xfe2a('0x4')],function(_0xd14bc1){if(_0xd14bc1){_0x25332a(_0xd14bc1);}else{_0x587117();}});}else{_0x25332a(new Error(_0xfe2a('0x6')));}}else{_0x25332a(new Error(_0xfe2a('0x7')));}});});}module[_0xfe2a('0x8')]=function(_0x4e3856,_0x211630,_0x554d21,_0x1749af,_0x5b30af,_0xe61675,_0xf94f01){var _0x127a57=new AWS['Polly']({'accessKeyId':_0x4e3856,'secretAccessKey':_0x211630,'region':_0x554d21});var _0x48ea28={'Text':_0x5b30af,'TextType':_0xe61675||'text','OutputFormat':'mp3','VoiceId':_0x1749af};return pollyResult(_0x127a57,_0x48ea28,_0xf94f01);};
\ No newline at end of file
+var _0x24fb=['AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','mp3','path','aws-sdk','synthesizeSpeech'];(function(_0x3623d8,_0x4e89df){var _0x25faed=function(_0x285f9f){while(--_0x285f9f){_0x3623d8['push'](_0x3623d8['shift']());}};_0x25faed(++_0x4e89df);}(_0x24fb,0x8d));var _0xb24f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x24fb[_0x20a584];return _0x4b41a8;};'use strict';var fs=require('fs');var path=require(_0xb24f('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require(_0xb24f('0x1'));function pollyResult(_0x1f1bb1,_0x373e3c,_0x3a2c53){return new BPromise(function(_0x15b819,_0x348794){_0x1f1bb1[_0xb24f('0x2')](_0x373e3c,function(_0x4eb2e3,_0x257b0d){if(_0x4eb2e3){_0x348794(_0x4eb2e3);}else if(_0x257b0d){if(_0x257b0d[_0xb24f('0x3')]instanceof Buffer){fs[_0xb24f('0x4')](_0x3a2c53,_0x257b0d['AudioStream'],function(_0x3d112d){if(_0x3d112d){_0x348794(_0x3d112d);}else{_0x15b819();}});}else{_0x348794(new Error(_0xb24f('0x5')));}}else{_0x348794(new Error(_0xb24f('0x6')));}});});}module[_0xb24f('0x7')]=function(_0xee5ea8,_0x284153,_0x5d6ed0,_0x4ff6c5,_0x1931dd,_0x11744a,_0x31c0bb){var _0x52a810=new AWS['Polly']({'accessKeyId':_0xee5ea8,'secretAccessKey':_0x284153,'region':_0x5d6ed0});var _0x127f0a={'Text':_0x1931dd,'TextType':_0x11744a||'text','OutputFormat':_0xb24f('0x8'),'VoiceId':_0x4ff6c5};return pollyResult(_0x52a810,_0x127f0a,_0x31c0bb);};
\ No newline at end of file
index e807882..e901b91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x545d=['exports','./lib/api'];(function(_0x1b470a,_0x3a7d57){var _0xad953a=function(_0x2a55d3){while(--_0x2a55d3){_0x1b470a['push'](_0x1b470a['shift']());}};_0xad953a(++_0x3a7d57);}(_0x545d,0xa5));var _0xd545=function(_0x485092,_0x50c62a){_0x485092=_0x485092-0x0;var _0x55ab8c=_0x545d[_0x485092];return _0x55ab8c;};'use strict';var asr=require(_0xd545('0x0'));module[_0xd545('0x1')]=function(_0x4d8482,_0x4b35c3,_0x529d55,_0x18b932){return asr(_0x4d8482,_0x4b35c3,_0x529d55);};
\ No newline at end of file
+var _0xa801=['./lib/api','exports'];(function(_0x4fa951,_0x175dbe){var _0x28c75f=function(_0x3c889d){while(--_0x3c889d){_0x4fa951['push'](_0x4fa951['shift']());}};_0x28c75f(++_0x175dbe);}(_0xa801,0x1d0));var _0x1a80=function(_0x3b26f2,_0x22cace){_0x3b26f2=_0x3b26f2-0x0;var _0x50ff0b=_0xa801[_0x3b26f2];return _0x50ff0b;};'use strict';var asr=require(_0x1a80('0x0'));module[_0x1a80('0x1')]=function(_0x55dbfa,_0x4b1b5e,_0x30fe47,_0x305e69){return asr(_0x55dbfa,_0x4b1b5e,_0x30fe47);};
\ No newline at end of file
index 3746bd6..967855f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d9b=['string','length','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','LINEAR16','url','bluebird','https://speech.googleapis.com','exports'];(function(_0x3713f5,_0x14b969){var _0x501c8e=function(_0x5f5c81){while(--_0x5f5c81){_0x3713f5['push'](_0x3713f5['shift']());}};_0x501c8e(++_0x14b969);}(_0x8d9b,0x104));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var url=require(_0xb8d9('0x0'));var BPromise=require(_0xb8d9('0x1'));var fs=require('fs');var host=_0xb8d9('0x2');module[_0xb8d9('0x3')]=function(_0x44ddd9,_0x5d3b29,_0x4daeb1){return new BPromise(function(_0x3f763a,_0x47b650){var _0x2192ff;if(typeof _0x44ddd9!==_0xb8d9('0x4')||_0x44ddd9['length']===0x0){return _0x47b650('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x5d3b29!=='string'||_0x5d3b29[_0xb8d9('0x5')]===0x0){return _0x47b650('key\x20should\x20be\x20a\x20string');}if(typeof _0x4daeb1!=='undefined'&&(typeof _0x4daeb1!=='string'||_0x4daeb1[_0xb8d9('0x5')]===0x0)){return _0x47b650(_0xb8d9('0x6'));}try{_0x2192ff=fs[_0xb8d9('0x7')](_0x44ddd9)[_0xb8d9('0x8')](_0xb8d9('0x9'));}catch(_0x31d887){return _0x47b650(_0x31d887);}return _0x3f763a({'method':_0xb8d9('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x5d3b29,'body':{'config':{'encoding':_0xb8d9('0xb'),'sampleRateHertz':'8000','languageCode':_0x4daeb1},'audio':{'content':_0x2192ff}},'json':!![]});});};
\ No newline at end of file
+var _0x80d9=['url','https://speech.googleapis.com','exports','string','undefined','length','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','LINEAR16','8000'];(function(_0x188d31,_0x576e87){var _0x30ed33=function(_0x15f9a5){while(--_0x15f9a5){_0x188d31['push'](_0x188d31['shift']());}};_0x30ed33(++_0x576e87);}(_0x80d9,0x15c));var _0x980d=function(_0x59feb2,_0x59a8b4){_0x59feb2=_0x59feb2-0x0;var _0x408b03=_0x80d9[_0x59feb2];return _0x408b03;};'use strict';var url=require(_0x980d('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0x980d('0x1');module[_0x980d('0x2')]=function(_0xac96e5,_0x5d4b87,_0x358d0a){return new BPromise(function(_0x3a9d1e,_0x38d1b9){var _0x279d93;if(typeof _0xac96e5!==_0x980d('0x3')||_0xac96e5['length']===0x0){return _0x38d1b9('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x5d4b87!==_0x980d('0x3')||_0x5d4b87['length']===0x0){return _0x38d1b9('key\x20should\x20be\x20a\x20string');}if(typeof _0x358d0a!==_0x980d('0x4')&&(typeof _0x358d0a!==_0x980d('0x3')||_0x358d0a[_0x980d('0x5')]===0x0)){return _0x38d1b9(_0x980d('0x6'));}try{_0x279d93=fs[_0x980d('0x7')](_0xac96e5)[_0x980d('0x8')](_0x980d('0x9'));}catch(_0x5e7ecb){return _0x38d1b9(_0x5e7ecb);}return _0x3a9d1e({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x5d4b87,'body':{'config':{'encoding':_0x980d('0xa'),'sampleRateHertz':_0x980d('0xb'),'languageCode':_0x358d0a},'audio':{'content':_0x279d93}},'json':!![]});});};
\ No newline at end of file
index 35538e8..f127cbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a84=['exports','./asr'];(function(_0x251d5c,_0x58073c){var _0x323ff6=function(_0x5740ac){while(--_0x5740ac){_0x251d5c['push'](_0x251d5c['shift']());}};_0x323ff6(++_0x58073c);}(_0x5a84,0x1cb));var _0x45a8=function(_0x56958e,_0x412662){_0x56958e=_0x56958e-0x0;var _0x464351=_0x5a84[_0x56958e];return _0x464351;};var asr=require(_0x45a8('0x0'));module[_0x45a8('0x1')]={'asr':asr};
\ No newline at end of file
+var _0xf31d=['exports','./asr'];(function(_0x4a6c93,_0x3cc6a3){var _0x5a40e1=function(_0x36544c){while(--_0x36544c){_0x4a6c93['push'](_0x4a6c93['shift']());}};_0x5a40e1(++_0x3cc6a3);}(_0xf31d,0x7d));var _0xdf31=function(_0x4b2cc6,_0x29ef43){_0x4b2cc6=_0x4b2cc6-0x0;var _0x3e0b08=_0xf31d[_0x4b2cc6];return _0x3e0b08;};var asr=require(_0xdf31('0x0'));module[_0xdf31('0x1')]={'asr':asr};
\ No newline at end of file
index 0886965..d86682d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2475=['dirName','bluebird','dialogflow','https','md5','path','querystring','randomstring','sox','google-tts-api','url','parse','util','./sestek','./tilde','../../../config/logger','agi','get','statusCode','error','statusMessage','createWriteStream','finish','finish\x20download\x20file','unlink','download\x20error','pipe','end','protocol','https:','host','WHAT_EVER','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','data','wav','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','then','777','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','.mp3','from','audioContent','writeFile','chmodSync','info','googleCloudTTS\x20path','googleTTS','POST','application/x-www-form-urlencoded','f.req=','stringify','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','googleASR','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','textRequest','result','source','action','fulfillment','speech','score','status','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','intent','name','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts'];(function(_0x2de0ec,_0x38812f){var _0x13aa7b=function(_0x340176){while(--_0x340176){_0x2de0ec['push'](_0x2de0ec['shift']());}};_0x13aa7b(++_0x38812f);}(_0x2475,0x10d));var _0x5247=function(_0x4decc,_0x1a39ca){_0x4decc=_0x4decc-0x0;var _0x280234=_0x2475[_0x4decc];return _0x280234;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x5247('0x0'));var dialogflow=require(_0x5247('0x1'));var fs=require('fs');var http=require('http');var https=require(_0x5247('0x2'));var md5=require(_0x5247('0x3'));var path=require(_0x5247('0x4'));var querystring=require(_0x5247('0x5'));var rp=require('request-promise');var rs=require(_0x5247('0x6'));var sox=require(_0x5247('0x7'));var tts=require(_0x5247('0x8'));var urlParse=require(_0x5247('0x9'))[_0x5247('0xa')];var util=require(_0x5247('0xb'));var aws=require('./aws');var google=require('./google');var sestek=require(_0x5247('0xc'));var tilde=require(_0x5247('0xd'));var logger=require(_0x5247('0xe'))(_0x5247('0xf'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x5e79a8,_0x269452){return new BPromise(function(_0x4e376f,_0x3bd512){var _0x4af77f=urlParse(_0x5e79a8);var _0x310c13=_0x4af77f['protocol']==='https:'?https:http;var _0x3e76be={'host':_0x4af77f['host'],'path':_0x4af77f[_0x5247('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x310c13[_0x5247('0x10')](_0x3e76be,function(_0x1724a6){if(_0x1724a6[_0x5247('0x11')]!==0xc8){logger[_0x5247('0x12')]('request\x20to\x20'+_0x5e79a8+'\x20failed,\x20status\x20code\x20=\x20'+_0x1724a6['statusCode']+'\x20('+_0x1724a6[_0x5247('0x13')]+')');_0x3bd512(new Error('request\x20to\x20'+_0x5e79a8+'\x20failed,\x20status\x20code\x20=\x20'+_0x1724a6[_0x5247('0x11')]+'\x20('+_0x1724a6[_0x5247('0x13')]+')'));return;}var _0x46a313=fs[_0x5247('0x14')](_0x269452);_0x46a313['on'](_0x5247('0x15'),function(){logger['info'](_0x5247('0x16'));_0x46a313['close'](_0x4e376f);});_0x46a313['on'](_0x5247('0x12'),function(_0x509fe9){fs[_0x5247('0x17')](_0x269452);logger[_0x5247('0x12')](_0x5247('0x18'),_0x509fe9);_0x3bd512(_0x509fe9);});_0x1724a6[_0x5247('0x19')](_0x46a313);})['on'](_0x5247('0x12'),function(_0x5647c9){logger['error'](_0x5647c9);_0x3bd512(_0x5647c9);})[_0x5247('0x1a')]();});}function uploadFile(_0x103f53){return new BPromise(function(_0x20d392,_0x1c86bf){var _0x392379=urlParse(_0x103f53);var _0x1daf46=_0x392379[_0x5247('0x1b')]===_0x5247('0x1c')?https:http;var _0x170e6d={'host':_0x392379[_0x5247('0x1d')],'path':_0x392379[_0x5247('0x4')],'headers':{'user-agent':_0x5247('0x1e')}};_0x1daf46[_0x5247('0x10')](_0x170e6d,function(_0x1aa1c2){if(_0x1aa1c2[_0x5247('0x11')]!==0xc8){_0x1c86bf(new Error(_0x5247('0x1f')+_0x103f53+_0x5247('0x20')+_0x1aa1c2[_0x5247('0x11')]+'\x20('+_0x1aa1c2[_0x5247('0x13')]+')'));return;}var _0x16b2ea='';_0x1aa1c2['on'](_0x5247('0x21'),function(_0x220543){_0x16b2ea+=_0x220543;});_0x1aa1c2['on'](_0x5247('0x1a'),function(){_0x20d392(_0x16b2ea);});})['on'](_0x5247('0x12'),function(_0x3f81c0){_0x1c86bf(_0x3f81c0);})['end']();});}function convertFile(_0x5cd706,_0x7297b2){return new BPromise(function(_0x263d19,_0x1936fb){var _0x39a209=sox['transcode'](_0x5cd706,_0x7297b2,{'sampleRate':0x1f40,'format':_0x5247('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x39a209['on'](_0x5247('0x12'),function(_0x257a52){logger['error']('error\x20convert',_0x257a52);_0x1936fb(_0x257a52);});_0x39a209['on'](_0x5247('0x1a'),function(){logger['info'](_0x5247('0x23'));_0x263d19();});_0x39a209['start']();});}function base64Decode(_0x41b912,_0x46ad4c){var _0x151c1b=path[_0x5247('0x24')](__dirname,_0x5247('0x25'),rs[_0x5247('0x26')](0x4)+_0x5247('0x27'));fs[_0x5247('0x28')](_0x151c1b,_0x41b912,_0x5247('0x29'));return convertFile(_0x151c1b,_0x46ad4c)[_0x5247('0x2a')](function(){try{fs[_0x5247('0x17')](_0x151c1b);fs['chmodSync'](_0x46ad4c,_0x5247('0x2b'));}catch(_0x67df31){logger[_0x5247('0x12')](_0x67df31);}return _0x46ad4c[_0x5247('0x2c')]('.')[0x0];});}function base64Encode(_0x34a66e){var _0x3c2fa6=fs[_0x5247('0x2d')](_0x34a66e);return new Buffer(_0x3c2fa6)[_0x5247('0x2e')](_0x5247('0x29'));}exports['googleCloudTTS']=function(_0x160903,_0x50f006,_0x3bee31,_0x2d3aed,_0x24998d,_0x157456){var _0x357916,_0x5bd1d9;var _0x261552=_0x5247('0x2f');var _0x23c13a=_0x5247('0x30')+_0x160903;var _0x489dc8={};if(_0x50f006==='ssml'){_0x489dc8[_0x5247('0x31')]={'ssml':_0x3bee31};}else{_0x489dc8[_0x5247('0x31')]={'text':_0x3bee31};};_0x489dc8[_0x5247('0x32')]={'languageCode':_0x2d3aed,'ssmlGender':_0x24998d};_0x489dc8[_0x5247('0x33')]={'audioEncoding':_0x5247('0x34'),'sampleRateHertz':0x1f40};var _0x1e0875={'url':_0x261552+'text:synthesize'+_0x23c13a,'method':'POST','json':!![],'body':_0x489dc8};return rp(_0x1e0875)[_0x5247('0x2a')](function(_0x43b405){return new BPromise(function(_0x54e47a,_0x3aebb6){_0x357916=path[_0x5247('0x24')](__dirname,_0x5247('0x25'),rs[_0x5247('0x26')](0x4)+_0x5247('0x35'));var _0x33ccfe=Buffer[_0x5247('0x36')](_0x43b405[_0x5247('0x37')],_0x5247('0x29'));return fs[_0x5247('0x38')](_0x357916,_0x33ccfe,function(_0x41d91e){_0x3aebb6(_0x41d91e);},function(_0x304880){fs['chmodSync'](_0x357916,_0x5247('0x2b'));_0x54e47a(_0x304880);});});})['then'](function(_0x17add4){_0x5bd1d9=path[_0x5247('0x24')](__dirname,_0x5247('0x25'),rs[_0x5247('0x26')](0x4)+_0x5247('0x27'));return convertFile(_0x357916,_0x5bd1d9);})['then'](function(){try{fs[_0x5247('0x17')](_0x357916);fs[_0x5247('0x39')](_0x5bd1d9,_0x5247('0x2b'));}catch(_0xa44288){logger[_0x5247('0x12')](_0xa44288);}logger[_0x5247('0x3a')](_0x5247('0x3b'),_0x5bd1d9[_0x5247('0x2c')]('.')[0x0]);return _0x5bd1d9[_0x5247('0x2c')]('.')[0x0];});};exports[_0x5247('0x3c')]=function(_0xfa16c0,_0x57189f){var _0x2fbe5f='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x259849,_0x11ab7e;var _0x438e7c;var _0x440d7d={'encoding':'utf8','method':_0x5247('0x3d'),'timeout':0x2710,'url':_0x2fbe5f,'headers':{'Content-Type':_0x5247('0x3e')},'body':_0x5247('0x3f')+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON[_0x5247('0x40')]([_0xfa16c0,_0x57189f||'en',![],'null']),null,_0x5247('0x41')]]]))};return rp(_0x440d7d)['then'](function(_0x52c150){try{_0x438e7c=eval(_0x52c150[_0x5247('0x42')](0x5))[0x0][0x2];}catch(_0x519986){throw new Error(_0x5247('0x43')+_0x52c150[_0x5247('0x21')]);}if(!_0x438e7c){if(_0xfa16c0[_0x5247('0x44')]>0xc8){throw new Error(_0x5247('0x45'));}else{throw new Error(_0x5247('0x46')+_0x57189f+_0x5247('0x47'));}}try{_0x438e7c=eval(_0x438e7c)[0x0];}catch(_0x51f627){throw new Error(_0x5247('0x43')+res[_0x5247('0x21')]);}const _0x3537dc=_0x438e7c;_0x259849=path[_0x5247('0x24')](__dirname,_0x5247('0x25'),rs[_0x5247('0x26')](0x4)+_0x5247('0x35'));fs[_0x5247('0x28')](_0x259849,_0x438e7c,{'encoding':_0x5247('0x29')});_0x11ab7e=path[_0x5247('0x24')](__dirname,_0x5247('0x25'),rs[_0x5247('0x26')](0x4)+_0x5247('0x27'));return convertFile(_0x259849,_0x11ab7e);})['then'](function(){try{fs[_0x5247('0x17')](_0x259849);fs['chmodSync'](_0x11ab7e,_0x5247('0x2b'));}catch(_0x5514d6){logger['error'](_0x5514d6);}logger[_0x5247('0x3a')]('goggleTTS\x20path',_0x11ab7e['split']('.')[0x0]);return _0x11ab7e[_0x5247('0x2c')]('.')[0x0];});};exports[_0x5247('0x48')]=function(_0x1a4db9,_0x250039,_0x2c6745){return google[_0x5247('0x49')](_0x1a4db9,_0x250039,_0x2c6745)[_0x5247('0x2a')](function(_0xb0986a){logger[_0x5247('0x3a')](_0xb0986a[_0x5247('0x4a')]);return rp(_0xb0986a);})[_0x5247('0x2a')](function(_0x2c7b98){var _0x3e57d0='';var _0x3a2f92=0x0;try{fs[_0x5247('0x17')](_0x1a4db9);}catch(_0x19e00b){logger[_0x5247('0x12')](_0x19e00b);}if(_0x2c7b98&&_0x2c7b98[_0x5247('0x4b')]){_0x3e57d0=_0x2c7b98[_0x5247('0x4b')]['map'](function(_0x1a0a6e){return _0x1a0a6e&&_0x1a0a6e[_0x5247('0x4c')][0x0]&&_0x1a0a6e[_0x5247('0x4c')][0x0][_0x5247('0x4d')]?_0x1a0a6e[_0x5247('0x4c')][0x0][_0x5247('0x4d')]:'';})[_0x5247('0x4e')]('\x0a');_0x3a2f92=_0x2c7b98[_0x5247('0x4b')][_0x5247('0x4f')](function(_0x9412){return _0x9412&&_0x9412[_0x5247('0x4c')][0x0]&&_0x9412[_0x5247('0x4c')][0x0][_0x5247('0x50')]?_0x9412[_0x5247('0x4c')][0x0][_0x5247('0x50')]:0x0;})[_0x5247('0x4e')]('\x0a');}logger[_0x5247('0x3a')](_0x5247('0x51'),_0x3e57d0);logger[_0x5247('0x3a')](_0x5247('0x52'),_0x3a2f92);return{'transcript':_0x3e57d0,'confidence':_0x3a2f92};})[_0x5247('0x53')](function(_0x447fe6){logger[_0x5247('0x12')](_0x5247('0x54'),_0x447fe6[_0x5247('0x11')],_0x447fe6['name'],_0x447fe6[_0x5247('0x55')]);});};exports['googleDialogflow']=function(_0x561567,_0xab170b,_0x4827f5,_0x1a72b5){var _0x35f88c=apiai(_0xab170b,{'language':_0x1a72b5||'en'});return _0x35f88c[_0x5247('0x56')](_0x4827f5,{'sessionId':md5(_0x561567)})[_0x5247('0x2a')](function(_0x4e904f){logger[_0x5247('0x3a')](JSON[_0x5247('0x40')](_0x4e904f));return{'source':_0x4e904f[_0x5247('0x57')][_0x5247('0x58')],'resolvedQuery':_0x4e904f[_0x5247('0x57')]['resolvedQuery'],'action':_0x4e904f['result'][_0x5247('0x59')],'actionIncomplete':_0x4e904f[_0x5247('0x57')]['actionIncomplete'],'speech':_0x4e904f[_0x5247('0x57')][_0x5247('0x5a')][_0x5247('0x5b')],'score':_0x4e904f[_0x5247('0x57')][_0x5247('0x5c')],'statusCode':_0x4e904f[_0x5247('0x5d')]['code'],'endConversation':_0x4e904f['result'][_0x5247('0x5e')][_0x5247('0x5f')]||![],'isFallbackIntent':_0x4e904f[_0x5247('0x57')][_0x5247('0x5e')][_0x5247('0x60')]};});};exports[_0x5247('0x61')]=function(_0xca9dd7,_0x26bbc1,_0x53ce34,_0xdb75e5,_0x28da08,_0x3814f0){var _0x4a2d49=_0xdb75e5[_0x5247('0x62')](/\\n/g,'\x0a');var _0x16e466={'credentials':{'private_key':_0x4a2d49,'client_email':_0x53ce34}};var _0x405b2c=new dialogflow[(_0x5247('0x63'))](_0x16e466);var _0x22430c=_0x405b2c[_0x5247('0x64')](_0x26bbc1,md5(_0xca9dd7));var _0x51d803={'session':_0x22430c,'queryInput':{'text':{'text':_0x28da08,'languageCode':_0x3814f0}}};return _0x405b2c[_0x5247('0x65')](_0x51d803)['then'](function(_0x4f5dd3){if(_0x4f5dd3&&_0x4f5dd3['length']){logger[_0x5247('0x3a')](_0x5247('0x66'),JSON['stringify'](_0x4f5dd3));var _0x1e33ff=_0x4f5dd3[0x0];if(_0x1e33ff){var _0x36f870={'action':_0x1e33ff[_0x5247('0x67')][_0x5247('0x59')],'allRequiredParamsPresent':_0x1e33ff['queryResult'][_0x5247('0x68')],'endConversation':_0x1e33ff[_0x5247('0x67')][_0x5247('0x69')]&&_0x1e33ff[_0x5247('0x67')][_0x5247('0x69')][_0x5247('0x6a')]?_0x1e33ff[_0x5247('0x67')][_0x5247('0x69')][_0x5247('0x6a')]['end_conversation']['boolValue']:![],'fulfillmentText':_0x1e33ff['queryResult']['fulfillmentText'],'intentName':_0x1e33ff['queryResult'][_0x5247('0x6b')][_0x5247('0x6c')],'intentDisplayName':_0x1e33ff['queryResult'][_0x5247('0x6b')][_0x5247('0x6d')],'isFallbackIntent':_0x1e33ff[_0x5247('0x67')]['intent'][_0x5247('0x6e')],'languageCode':_0x1e33ff[_0x5247('0x67')][_0x5247('0x6f')],'queryText':_0x1e33ff['queryResult'][_0x5247('0x70')],'responseId':_0x1e33ff[_0x5247('0x71')],'score':_0x1e33ff[_0x5247('0x67')][_0x5247('0x72')],'speech':_0x1e33ff[_0x5247('0x67')][_0x5247('0x73')],'providerResponse':JSON['stringify'](_0x4f5dd3)};return _0x36f870;}}});};exports['tildeASR']=function(_0x3a83e2,_0x3867bf,_0x539b68,_0x40294e){return tilde[_0x5247('0x49')](_0x3a83e2,_0x3867bf,_0x539b68,_0x40294e)['then'](function(_0x358b44){try{fs['unlink'](_0x3a83e2);}catch(_0x12dd61){logger[_0x5247('0x12')](_0x12dd61);}logger['info'](_0x5247('0x74'),_0x358b44[_0x5247('0x4d')]);logger[_0x5247('0x3a')]('Tilde\x20ASR\x20confidence',_0x358b44[_0x5247('0x50')]);return _0x358b44;});};exports[_0x5247('0x75')]=function(_0x1df48d,_0x267c11,_0x3f8ad3,_0x2fc82c,_0x57876c,_0x2bc972){var _0x40e654=path[_0x5247('0x24')](__dirname,_0x5247('0x25'),rs[_0x5247('0x26')](0x4)+'.mp3');var _0x144b07;return aws[_0x5247('0x76')](_0x1df48d,_0x267c11,_0x3f8ad3,_0x2fc82c,_0x57876c,_0x2bc972,_0x40e654)[_0x5247('0x2a')](function(){_0x144b07=path[_0x5247('0x24')](__dirname,_0x5247('0x25'),rs[_0x5247('0x26')](0x4)+_0x5247('0x27'));return convertFile(_0x40e654,_0x144b07);})[_0x5247('0x2a')](function(){try{fs['unlink'](_0x40e654);fs[_0x5247('0x39')](_0x144b07,_0x5247('0x2b'));}catch(_0x3cd10e){logger[_0x5247('0x12')](_0x3cd10e);}return _0x144b07['split']('.')[0x0];});};exports[_0x5247('0x77')]=function(_0x1a829e,_0x594f5c,_0x2e7eee,_0x17990e,_0x2eeac8,_0x4ac70a){return aws['lex'](_0x1a829e,_0x594f5c,_0x2e7eee,_0x17990e,_0x2eeac8,_0x4ac70a)[_0x5247('0x2a')](function(_0x12bce1){logger['info'](JSON['stringify'](_0x12bce1));return _0x12bce1;});};exports[_0x5247('0x78')]=function(_0x553d26,_0x1a7187,_0x3411f4,_0x1b1c49){var _0x2ef9f2=util[_0x5247('0x79')](_0x5247('0x7a'),ISPEECH_API,_0x553d26,encodeURIComponent(_0x1a7187),_0x3411f4,_0x1b1c49);var _0x566fe1=path['resolve'](__dirname,_0x5247('0x25'),rs[_0x5247('0x26')](0x4)+_0x5247('0x35'));var _0x1ee654;return downloadFile(_0x2ef9f2,_0x566fe1)[_0x5247('0x2a')](function(){_0x1ee654=path[_0x5247('0x24')](__dirname,_0x5247('0x25'),rs[_0x5247('0x26')](0x4)+'.wav');return convertFile(_0x566fe1,_0x1ee654);})[_0x5247('0x2a')](function(){try{fs[_0x5247('0x17')](_0x566fe1);fs[_0x5247('0x39')](_0x1ee654,_0x5247('0x2b'));}catch(_0x399c95){logger[_0x5247('0x12')](_0x399c95);}return _0x1ee654[_0x5247('0x2c')]('.')[0x0];});};exports[_0x5247('0x7b')]=function(_0x5cd82b,_0x398109,_0x1a6663,_0x20f174){var _0x5ba181=util[_0x5247('0x79')](_0x5247('0x7c'),ISPEECH_API,_0x398109,_0x1a6663,base64Encode(_0x5cd82b),_0x20f174?util['format'](_0x5247('0x7d'),encodeURIComponent(_0x20f174)):_0x5247('0x7e'));return uploadFile(_0x5ba181)[_0x5247('0x2a')](function(_0xa0efb4){return querystring['parse'](_0xa0efb4);});};exports[_0x5247('0x7f')]=function(_0x259ead,_0x39778f){return sestek[_0x5247('0x80')](_0x259ead,_0x39778f)[_0x5247('0x2a')](function(_0x46eb86){logger[_0x5247('0x3a')](JSON['stringify'](_0x46eb86));var _0x3c3d9a={'speech':_0x46eb86[_0x5247('0x81')],'action':_0x46eb86[_0x5247('0x82')]?_0x46eb86[_0x5247('0x82')][_0x5247('0x83')]:undefined,'actiondata':_0x46eb86[_0x5247('0x82')]?_0x46eb86[_0x5247('0x82')]['CustomActionData']:undefined};if(_0x46eb86[_0x5247('0x82')]&&_0x46eb86[_0x5247('0x82')][_0x5247('0x84')]){return base64Decode(_0x46eb86[_0x5247('0x82')][_0x5247('0x84')]['Data'],path[_0x5247('0x24')](__dirname,_0x5247('0x25'),rs[_0x5247('0x26')](0x4)+'.wav'))[_0x5247('0x2a')](function(_0xc9c8a){_0x3c3d9a['audiofile']=_0xc9c8a;return _0x3c3d9a;});}return _0x3c3d9a;});};exports[_0x5247('0x85')]=function(){return __dirname;};
\ No newline at end of file
+var _0x6afd=['777','split','toString','googleCloudTTS','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','tmp','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','null','generic','slice','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','writeFileSync','.wav','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','result','source','action','actionIncomplete','fulfillment','score','status','metadata','endConversation','isFallbackIntent','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','nda','text','channelData','CustomAction','AudioFromTts','Data','dirName','bluebird','dialogflow','https','md5','path','querystring','request-promise','sox','google-tts-api','url','parse','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','finish','info','finish\x20download\x20file','unlink','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','generate','base64','then','chmodSync'];(function(_0x5e0c74,_0x379142){var _0x1df578=function(_0x28e480){while(--_0x28e480){_0x5e0c74['push'](_0x5e0c74['shift']());}};_0x1df578(++_0x379142);}(_0x6afd,0x163));var _0xd6af=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x6afd[_0x187ee1];return _0x388160;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xd6af('0x0'));var dialogflow=require(_0xd6af('0x1'));var fs=require('fs');var http=require('http');var https=require(_0xd6af('0x2'));var md5=require(_0xd6af('0x3'));var path=require(_0xd6af('0x4'));var querystring=require(_0xd6af('0x5'));var rp=require(_0xd6af('0x6'));var rs=require('randomstring');var sox=require(_0xd6af('0x7'));var tts=require(_0xd6af('0x8'));var urlParse=require(_0xd6af('0x9'))[_0xd6af('0xa')];var util=require('util');var aws=require('./aws');var google=require('./google');var sestek=require(_0xd6af('0xb'));var tilde=require('./tilde');var logger=require(_0xd6af('0xc'))(_0xd6af('0xd'));var ISPEECH_API=_0xd6af('0xe');function downloadFile(_0x458be6,_0x2a6f30){return new BPromise(function(_0x316c45,_0x4507af){var _0x200c74=urlParse(_0x458be6);var _0x1b66e2=_0x200c74[_0xd6af('0xf')]===_0xd6af('0x10')?https:http;var _0x22a4c4={'host':_0x200c74[_0xd6af('0x11')],'path':_0x200c74[_0xd6af('0x4')],'headers':{'user-agent':_0xd6af('0x12')}};_0x1b66e2[_0xd6af('0x13')](_0x22a4c4,function(_0x10fc79){if(_0x10fc79[_0xd6af('0x14')]!==0xc8){logger[_0xd6af('0x15')](_0xd6af('0x16')+_0x458be6+'\x20failed,\x20status\x20code\x20=\x20'+_0x10fc79['statusCode']+'\x20('+_0x10fc79[_0xd6af('0x17')]+')');_0x4507af(new Error(_0xd6af('0x16')+_0x458be6+_0xd6af('0x18')+_0x10fc79[_0xd6af('0x14')]+'\x20('+_0x10fc79['statusMessage']+')'));return;}var _0x2ee3c3=fs['createWriteStream'](_0x2a6f30);_0x2ee3c3['on'](_0xd6af('0x19'),function(){logger[_0xd6af('0x1a')](_0xd6af('0x1b'));_0x2ee3c3['close'](_0x316c45);});_0x2ee3c3['on'](_0xd6af('0x15'),function(_0x467073){fs[_0xd6af('0x1c')](_0x2a6f30);logger['error']('download\x20error',_0x467073);_0x4507af(_0x467073);});_0x10fc79['pipe'](_0x2ee3c3);})['on'](_0xd6af('0x15'),function(_0x511be3){logger['error'](_0x511be3);_0x4507af(_0x511be3);})[_0xd6af('0x1d')]();});}function uploadFile(_0x5257c0){return new BPromise(function(_0xbb9dbf,_0x5a3b71){var _0x191e1c=urlParse(_0x5257c0);var _0x5db0f2=_0x191e1c['protocol']===_0xd6af('0x10')?https:http;var _0x43b07c={'host':_0x191e1c[_0xd6af('0x11')],'path':_0x191e1c[_0xd6af('0x4')],'headers':{'user-agent':_0xd6af('0x12')}};_0x5db0f2[_0xd6af('0x13')](_0x43b07c,function(_0x316503){if(_0x316503['statusCode']!==0xc8){_0x5a3b71(new Error(_0xd6af('0x16')+_0x5257c0+'\x20failed,\x20status\x20code\x20=\x20'+_0x316503[_0xd6af('0x14')]+'\x20('+_0x316503[_0xd6af('0x17')]+')'));return;}var _0xd318e0='';_0x316503['on'](_0xd6af('0x1e'),function(_0x5f3174){_0xd318e0+=_0x5f3174;});_0x316503['on'](_0xd6af('0x1d'),function(){_0xbb9dbf(_0xd318e0);});})['on']('error',function(_0x4f3f94){_0x5a3b71(_0x4f3f94);})[_0xd6af('0x1d')]();});}function convertFile(_0x188419,_0x5aa896){return new BPromise(function(_0x59016,_0x202193){var _0x872766=sox[_0xd6af('0x1f')](_0x188419,_0x5aa896,{'sampleRate':0x1f40,'format':_0xd6af('0x20'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x872766['on'](_0xd6af('0x15'),function(_0x46ddaf){logger['error'](_0xd6af('0x21'),_0x46ddaf);_0x202193(_0x46ddaf);});_0x872766['on'](_0xd6af('0x1d'),function(){logger[_0xd6af('0x1a')](_0xd6af('0x22'));_0x59016();});_0x872766[_0xd6af('0x23')]();});}function base64Decode(_0x11cd93,_0x4b0ffb){var _0x1d6ad1=path[_0xd6af('0x24')](__dirname,'tmp',rs[_0xd6af('0x25')](0x4)+'.wav');fs['writeFileSync'](_0x1d6ad1,_0x11cd93,_0xd6af('0x26'));return convertFile(_0x1d6ad1,_0x4b0ffb)[_0xd6af('0x27')](function(){try{fs[_0xd6af('0x1c')](_0x1d6ad1);fs[_0xd6af('0x28')](_0x4b0ffb,_0xd6af('0x29'));}catch(_0x2e7428){logger[_0xd6af('0x15')](_0x2e7428);}return _0x4b0ffb[_0xd6af('0x2a')]('.')[0x0];});}function base64Encode(_0xd5298f){var _0x50f4cb=fs['readFileSync'](_0xd5298f);return new Buffer(_0x50f4cb)[_0xd6af('0x2b')](_0xd6af('0x26'));}exports[_0xd6af('0x2c')]=function(_0x323d30,_0xc4a4dd,_0x2756fd,_0xe5a440,_0xe843f5,_0x161db5){var _0x409f3d,_0x2a8d20;var _0x5c74d8='https://texttospeech.googleapis.com/v1/';var _0x34ce3f='?key='+_0x323d30;var _0x172495={};if(_0xc4a4dd==='ssml'){_0x172495[_0xd6af('0x2d')]={'ssml':_0x2756fd};}else{_0x172495[_0xd6af('0x2d')]={'text':_0x2756fd};};_0x172495[_0xd6af('0x2e')]={'languageCode':_0xe5a440,'ssmlGender':_0xe843f5};_0x172495[_0xd6af('0x2f')]={'audioEncoding':_0xd6af('0x30'),'sampleRateHertz':0x1f40};var _0x3c7307={'url':_0x5c74d8+_0xd6af('0x31')+_0x34ce3f,'method':_0xd6af('0x32'),'json':!![],'body':_0x172495};return rp(_0x3c7307)[_0xd6af('0x27')](function(_0x39f661){return new BPromise(function(_0x666f6b,_0x16a31f){_0x409f3d=path[_0xd6af('0x24')](__dirname,'tmp',rs[_0xd6af('0x25')](0x4)+_0xd6af('0x33'));var _0x5575c6=Buffer[_0xd6af('0x34')](_0x39f661[_0xd6af('0x35')],_0xd6af('0x26'));return fs['writeFile'](_0x409f3d,_0x5575c6,function(_0x8408d0){_0x16a31f(_0x8408d0);},function(_0x29fa7e){fs[_0xd6af('0x28')](_0x409f3d,_0xd6af('0x29'));_0x666f6b(_0x29fa7e);});});})[_0xd6af('0x27')](function(_0x27f3a7){_0x2a8d20=path[_0xd6af('0x24')](__dirname,_0xd6af('0x36'),rs['generate'](0x4)+'.wav');return convertFile(_0x409f3d,_0x2a8d20);})['then'](function(){try{fs['unlink'](_0x409f3d);fs[_0xd6af('0x28')](_0x2a8d20,'777');}catch(_0x1a817f){logger['error'](_0x1a817f);}logger[_0xd6af('0x1a')](_0xd6af('0x37'),_0x2a8d20['split']('.')[0x0]);return _0x2a8d20[_0xd6af('0x2a')]('.')[0x0];});};exports[_0xd6af('0x38')]=function(_0x2feb4c,_0x492321){var _0x4d95f0=_0xd6af('0x39');var _0x13f110,_0x13dc69;var _0x1214bc;var _0x288a8b={'encoding':_0xd6af('0x3a'),'method':_0xd6af('0x32'),'timeout':0x2710,'url':_0x4d95f0,'headers':{'Content-Type':_0xd6af('0x3b')},'body':'f.req='+encodeURIComponent(JSON[_0xd6af('0x3c')]([[[_0xd6af('0x3d'),JSON[_0xd6af('0x3c')]([_0x2feb4c,_0x492321||'en',![],_0xd6af('0x3e')]),null,_0xd6af('0x3f')]]]))};return rp(_0x288a8b)[_0xd6af('0x27')](function(_0x1363cd){try{_0x1214bc=eval(_0x1363cd[_0xd6af('0x40')](0x5))[0x0][0x2];}catch(_0x186e75){throw new Error('parse\x20response\x20failed:\x0a'+_0x1363cd['data']);}if(!_0x1214bc){if(_0x2feb4c[_0xd6af('0x41')]>0xc8){throw new Error(_0xd6af('0x42'));}else{throw new Error(_0xd6af('0x43')+_0x492321+_0xd6af('0x44'));}}try{_0x1214bc=eval(_0x1214bc)[0x0];}catch(_0x226b93){throw new Error(_0xd6af('0x45')+res[_0xd6af('0x1e')]);}const _0xb59e28=_0x1214bc;_0x13f110=path[_0xd6af('0x24')](__dirname,_0xd6af('0x36'),rs[_0xd6af('0x25')](0x4)+_0xd6af('0x33'));fs[_0xd6af('0x46')](_0x13f110,_0x1214bc,{'encoding':'base64'});_0x13dc69=path[_0xd6af('0x24')](__dirname,_0xd6af('0x36'),rs[_0xd6af('0x25')](0x4)+_0xd6af('0x47'));return convertFile(_0x13f110,_0x13dc69);})['then'](function(){try{fs[_0xd6af('0x1c')](_0x13f110);fs[_0xd6af('0x28')](_0x13dc69,'777');}catch(_0x5d91ac){logger[_0xd6af('0x15')](_0x5d91ac);}logger['info'](_0xd6af('0x48'),_0x13dc69[_0xd6af('0x2a')]('.')[0x0]);return _0x13dc69[_0xd6af('0x2a')]('.')[0x0];});};exports[_0xd6af('0x49')]=function(_0x385908,_0x32b7cd,_0x502bdc){return google['asr'](_0x385908,_0x32b7cd,_0x502bdc)['then'](function(_0x4ff5d0){logger['info'](_0x4ff5d0[_0xd6af('0x4a')]);return rp(_0x4ff5d0);})[_0xd6af('0x27')](function(_0x561c0d){var _0x167540='';var _0x51989c=0x0;try{fs[_0xd6af('0x1c')](_0x385908);}catch(_0x476f3d){logger[_0xd6af('0x15')](_0x476f3d);}if(_0x561c0d&&_0x561c0d[_0xd6af('0x4b')]){_0x167540=_0x561c0d['results'][_0xd6af('0x4c')](function(_0x1f5d15){return _0x1f5d15&&_0x1f5d15[_0xd6af('0x4d')][0x0]&&_0x1f5d15[_0xd6af('0x4d')][0x0][_0xd6af('0x4e')]?_0x1f5d15[_0xd6af('0x4d')][0x0][_0xd6af('0x4e')]:'';})[_0xd6af('0x4f')]('\x0a');_0x51989c=_0x561c0d['results'][_0xd6af('0x4c')](function(_0x4635fb){return _0x4635fb&&_0x4635fb['alternatives'][0x0]&&_0x4635fb['alternatives'][0x0][_0xd6af('0x50')]?_0x4635fb[_0xd6af('0x4d')][0x0][_0xd6af('0x50')]:0x0;})[_0xd6af('0x4f')]('\x0a');}logger[_0xd6af('0x1a')](_0xd6af('0x51'),_0x167540);logger[_0xd6af('0x1a')](_0xd6af('0x52'),_0x51989c);return{'transcript':_0x167540,'confidence':_0x51989c};})[_0xd6af('0x53')](function(_0x31fd5e){logger[_0xd6af('0x15')](_0xd6af('0x54'),_0x31fd5e['statusCode'],_0x31fd5e['name'],_0x31fd5e[_0xd6af('0x55')]);});};exports[_0xd6af('0x56')]=function(_0x15eb47,_0x2c0d9f,_0x3a3c43,_0xadb0d6){var _0x45a767=apiai(_0x2c0d9f,{'language':_0xadb0d6||'en'});return _0x45a767[_0xd6af('0x57')](_0x3a3c43,{'sessionId':md5(_0x15eb47)})[_0xd6af('0x27')](function(_0x3751e8){logger[_0xd6af('0x1a')](JSON[_0xd6af('0x3c')](_0x3751e8));return{'source':_0x3751e8[_0xd6af('0x58')][_0xd6af('0x59')],'resolvedQuery':_0x3751e8['result']['resolvedQuery'],'action':_0x3751e8[_0xd6af('0x58')][_0xd6af('0x5a')],'actionIncomplete':_0x3751e8[_0xd6af('0x58')][_0xd6af('0x5b')],'speech':_0x3751e8[_0xd6af('0x58')][_0xd6af('0x5c')]['speech'],'score':_0x3751e8[_0xd6af('0x58')][_0xd6af('0x5d')],'statusCode':_0x3751e8[_0xd6af('0x5e')]['code'],'endConversation':_0x3751e8[_0xd6af('0x58')][_0xd6af('0x5f')][_0xd6af('0x60')]||![],'isFallbackIntent':_0x3751e8[_0xd6af('0x58')][_0xd6af('0x5f')][_0xd6af('0x61')]};});};exports['googleDialogflowV2']=function(_0x204025,_0x42f324,_0x1c74fe,_0x1247d3,_0x4a9a36,_0x11c8f2){var _0x28d763=_0x1247d3[_0xd6af('0x62')](/\\n/g,'\x0a');var _0x378e59={'credentials':{'private_key':_0x28d763,'client_email':_0x1c74fe}};var _0x309943=new dialogflow[(_0xd6af('0x63'))](_0x378e59);var _0xa467b=_0x309943['sessionPath'](_0x42f324,md5(_0x204025));var _0x28b4a9={'session':_0xa467b,'queryInput':{'text':{'text':_0x4a9a36,'languageCode':_0x11c8f2}}};return _0x309943[_0xd6af('0x64')](_0x28b4a9)[_0xd6af('0x27')](function(_0x6e99bc){if(_0x6e99bc&&_0x6e99bc['length']){logger['info'](_0xd6af('0x65'),JSON[_0xd6af('0x3c')](_0x6e99bc));var _0x2dfa73=_0x6e99bc[0x0];if(_0x2dfa73){var _0x3e8b2b={'action':_0x2dfa73['queryResult'][_0xd6af('0x5a')],'allRequiredParamsPresent':_0x2dfa73['queryResult']['allRequiredParamsPresent'],'endConversation':_0x2dfa73[_0xd6af('0x66')][_0xd6af('0x67')]&&_0x2dfa73[_0xd6af('0x66')][_0xd6af('0x67')][_0xd6af('0x68')]?_0x2dfa73[_0xd6af('0x66')]['diagnosticInfo'][_0xd6af('0x68')]['end_conversation'][_0xd6af('0x69')]:![],'fulfillmentText':_0x2dfa73['queryResult'][_0xd6af('0x6a')],'intentName':_0x2dfa73[_0xd6af('0x66')][_0xd6af('0x6b')]['name'],'intentDisplayName':_0x2dfa73[_0xd6af('0x66')]['intent'][_0xd6af('0x6c')],'isFallbackIntent':_0x2dfa73['queryResult'][_0xd6af('0x6b')][_0xd6af('0x6d')],'languageCode':_0x2dfa73['queryResult'][_0xd6af('0x6e')],'queryText':_0x2dfa73[_0xd6af('0x66')][_0xd6af('0x6f')],'responseId':_0x2dfa73[_0xd6af('0x70')],'score':_0x2dfa73[_0xd6af('0x66')][_0xd6af('0x71')],'speech':_0x2dfa73['queryResult']['fulfillmentText'],'providerResponse':JSON[_0xd6af('0x3c')](_0x6e99bc)};return _0x3e8b2b;}}});};exports['tildeASR']=function(_0x57b639,_0x32e951,_0x20687d,_0x53b5eb){return tilde[_0xd6af('0x72')](_0x57b639,_0x32e951,_0x20687d,_0x53b5eb)[_0xd6af('0x27')](function(_0xcc0d20){try{fs[_0xd6af('0x1c')](_0x57b639);}catch(_0x3d7f21){logger['error'](_0x3d7f21);}logger[_0xd6af('0x1a')](_0xd6af('0x73'),_0xcc0d20[_0xd6af('0x4e')]);logger[_0xd6af('0x1a')](_0xd6af('0x74'),_0xcc0d20['confidence']);return _0xcc0d20;});};exports[_0xd6af('0x75')]=function(_0x4a4463,_0x1d5777,_0x4caad2,_0x5624f5,_0xb4c15,_0x228496){var _0xb366b1=path[_0xd6af('0x24')](__dirname,_0xd6af('0x36'),rs[_0xd6af('0x25')](0x4)+'.mp3');var _0x1a5c69;return aws[_0xd6af('0x76')](_0x4a4463,_0x1d5777,_0x4caad2,_0x5624f5,_0xb4c15,_0x228496,_0xb366b1)[_0xd6af('0x27')](function(){_0x1a5c69=path[_0xd6af('0x24')](__dirname,'tmp',rs[_0xd6af('0x25')](0x4)+_0xd6af('0x47'));return convertFile(_0xb366b1,_0x1a5c69);})[_0xd6af('0x27')](function(){try{fs['unlink'](_0xb366b1);fs[_0xd6af('0x28')](_0x1a5c69,_0xd6af('0x29'));}catch(_0x2f2010){logger[_0xd6af('0x15')](_0x2f2010);}return _0x1a5c69[_0xd6af('0x2a')]('.')[0x0];});};exports[_0xd6af('0x77')]=function(_0x2858f8,_0x447f61,_0x513e5d,_0x249b6b,_0x1a980c,_0x14e105){return aws[_0xd6af('0x78')](_0x2858f8,_0x447f61,_0x513e5d,_0x249b6b,_0x1a980c,_0x14e105)[_0xd6af('0x27')](function(_0x2a0165){logger['info'](JSON[_0xd6af('0x3c')](_0x2a0165));return _0x2a0165;});};exports['ispeechTTS']=function(_0x2022a4,_0x20f650,_0x101b74,_0x46b4b2){var _0x3ef63d=util[_0xd6af('0x79')](_0xd6af('0x7a'),ISPEECH_API,_0x2022a4,encodeURIComponent(_0x20f650),_0x101b74,_0x46b4b2);var _0x19f57d=path[_0xd6af('0x24')](__dirname,_0xd6af('0x36'),rs[_0xd6af('0x25')](0x4)+_0xd6af('0x33'));var _0x5ebeed;return downloadFile(_0x3ef63d,_0x19f57d)['then'](function(){_0x5ebeed=path[_0xd6af('0x24')](__dirname,'tmp',rs[_0xd6af('0x25')](0x4)+_0xd6af('0x47'));return convertFile(_0x19f57d,_0x5ebeed);})[_0xd6af('0x27')](function(){try{fs[_0xd6af('0x1c')](_0x19f57d);fs[_0xd6af('0x28')](_0x5ebeed,_0xd6af('0x29'));}catch(_0x56c348){logger[_0xd6af('0x15')](_0x56c348);}return _0x5ebeed[_0xd6af('0x2a')]('.')[0x0];});};exports['ispeechASR']=function(_0x12bb09,_0x244ae1,_0x5d5b03,_0x5a2d97){var _0x4ffb99=util[_0xd6af('0x79')](_0xd6af('0x7b'),ISPEECH_API,_0x244ae1,_0x5d5b03,base64Encode(_0x12bb09),_0x5a2d97?util[_0xd6af('0x79')]('model=%s',encodeURIComponent(_0x5a2d97)):_0xd6af('0x7c'));return uploadFile(_0x4ffb99)[_0xd6af('0x27')](function(_0xb94c92){return querystring[_0xd6af('0xa')](_0xb94c92);});};exports['sestekNDA']=function(_0x82df3e,_0x17c3a9){return sestek[_0xd6af('0x7d')](_0x82df3e,_0x17c3a9)['then'](function(_0x6a7a3d){logger[_0xd6af('0x1a')](JSON[_0xd6af('0x3c')](_0x6a7a3d));var _0x5eec2c={'speech':_0x6a7a3d[_0xd6af('0x7e')],'action':_0x6a7a3d[_0xd6af('0x7f')]?_0x6a7a3d[_0xd6af('0x7f')][_0xd6af('0x80')]:undefined,'actiondata':_0x6a7a3d[_0xd6af('0x7f')]?_0x6a7a3d['channelData']['CustomActionData']:undefined};if(_0x6a7a3d[_0xd6af('0x7f')]&&_0x6a7a3d[_0xd6af('0x7f')][_0xd6af('0x81')]){return base64Decode(_0x6a7a3d[_0xd6af('0x7f')][_0xd6af('0x81')][_0xd6af('0x82')],path[_0xd6af('0x24')](__dirname,_0xd6af('0x36'),rs[_0xd6af('0x25')](0x4)+_0xd6af('0x47')))[_0xd6af('0x27')](function(_0x23dc7b){_0x5eec2c['audiofile']=_0x23dc7b;return _0x5eec2c;});}return _0x5eec2c;});};exports[_0xd6af('0x83')]=function(){return __dirname;};
\ No newline at end of file
index be60fb2..03b2499 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f7d=['exports','./nda'];(function(_0x3aa7fb,_0x252d62){var _0x150998=function(_0x5f2ae0){while(--_0x5f2ae0){_0x3aa7fb['push'](_0x3aa7fb['shift']());}};_0x150998(++_0x252d62);}(_0x5f7d,0x6d));var _0xd5f7=function(_0x1bbb96,_0x5b689f){_0x1bbb96=_0x1bbb96-0x0;var _0x3c622d=_0x5f7d[_0x1bbb96];return _0x3c622d;};var nda=require(_0xd5f7('0x0'));module[_0xd5f7('0x1')]={'nda':nda};
\ No newline at end of file
+var _0x379b=['exports'];(function(_0x28b413,_0x33fbf7){var _0x47172b=function(_0x3636db){while(--_0x3636db){_0x28b413['push'](_0x28b413['shift']());}};_0x47172b(++_0x33fbf7);}(_0x379b,0x127));var _0xb379=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x379b[_0x4f9b18];return _0x29f20c;};var nda=require('./nda');module[_0xb379('0x0')]={'nda':nda};
\ No newline at end of file
index de2fe34..ebc4efe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa900=['body','channelData','ProjectName','ndagenerate_audio','custom_action','CustomAction','custom_action_data','CustomActionData','stringify','request-promise','url','../../../../../config/logger','agi','exports','ndauth_url','/token','password','username','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','uniqueid','callerid','dnid','extension','text','Bearer\x20','access_token','project'];(function(_0x4e0d61,_0xbc271){var _0x49fd9d=function(_0x36e2e2){while(--_0x36e2e2){_0x4e0d61['push'](_0x4e0d61['shift']());}};_0x49fd9d(++_0xbc271);}(_0xa900,0x101));var _0x0a90=function(_0x1ca122,_0x5cab7c){_0x1ca122=_0x1ca122-0x0;var _0x50d1ba=_0xa900[_0x1ca122];return _0x50d1ba;};'use strict';var rp=require(_0x0a90('0x0'));var url=require(_0x0a90('0x1'));var logger=require(_0x0a90('0x2'))(_0x0a90('0x3'));module[_0x0a90('0x4')]=function(_0x4e133b,_0x55f0b7){var _0x439f70={'method':'POST','uri':url['resolve'](_0x55f0b7[_0x0a90('0x5')],_0x0a90('0x6')),'form':{'grant_type':_0x0a90('0x7'),'username':_0x55f0b7[_0x0a90('0x8')],'password':_0x55f0b7['password']},'json':!![]};return rp(_0x439f70)[_0x0a90('0x9')](function(_0x4718e9){var _0x33e3cf={'method':'POST','uri':url[_0x0a90('0xa')](_0x55f0b7[_0x0a90('0xb')],_0x0a90('0xc')),'body':{'type':_0x55f0b7['ndaactivity_type']||_0x0a90('0xd'),'channelId':'Nda','conversation':{'id':_0x4e133b[_0x0a90('0xe')]},'from':{'id':_0x4e133b[_0x0a90('0xf')],'name':_0x4e133b['calleridname']},'recipient':{'id':_0x4e133b[_0x0a90('0x10')],'name':_0x4e133b[_0x0a90('0x11')]},'text':_0x55f0b7[_0x0a90('0x12')],'channelData':{}},'headers':{'Authorization':_0x0a90('0x13')+_0x4718e9[_0x0a90('0x14')]},'json':!![]};if(_0x55f0b7[_0x0a90('0x15')]){_0x33e3cf[_0x0a90('0x16')][_0x0a90('0x17')][_0x0a90('0x18')]=_0x55f0b7[_0x0a90('0x15')];}if(_0x55f0b7[_0x0a90('0x19')]=='1'){_0x33e3cf[_0x0a90('0x16')][_0x0a90('0x17')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x55f0b7[_0x0a90('0x1a')]){_0x33e3cf[_0x0a90('0x16')][_0x0a90('0x17')][_0x0a90('0x1b')]=_0x55f0b7[_0x0a90('0x1a')];if(_0x55f0b7[_0x0a90('0x1c')]){_0x33e3cf[_0x0a90('0x16')]['channelData'][_0x0a90('0x1d')]=_0x55f0b7[_0x0a90('0x1c')];}}logger['info'](JSON[_0x0a90('0x1e')](_0x33e3cf));return rp(_0x33e3cf);});};
\ No newline at end of file
+var _0x584a=['callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','body','channelData','ProjectName','project','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','info','stringify','request-promise','url','agi','exports','resolve','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid'];(function(_0x3a4912,_0x3b64be){var _0xb50964=function(_0x2c364c){while(--_0x2c364c){_0x3a4912['push'](_0x3a4912['shift']());}};_0xb50964(++_0x3b64be);}(_0x584a,0x1c0));var _0xa584=function(_0x106214,_0x454b8d){_0x106214=_0x106214-0x0;var _0x5f5cea=_0x584a[_0x106214];return _0x5f5cea;};'use strict';var rp=require(_0xa584('0x0'));var url=require(_0xa584('0x1'));var logger=require('../../../../../config/logger')(_0xa584('0x2'));module[_0xa584('0x3')]=function(_0x3b03cf,_0x1a6922){var _0x5beb3d={'method':'POST','uri':url[_0xa584('0x4')](_0x1a6922['ndauth_url'],'/token'),'form':{'grant_type':_0xa584('0x5'),'username':_0x1a6922[_0xa584('0x6')],'password':_0x1a6922['password']},'json':!![]};return rp(_0x5beb3d)[_0xa584('0x7')](function(_0x1fada0){var _0x56be83={'method':'POST','uri':url['resolve'](_0x1a6922[_0xa584('0x8')],_0xa584('0x9')),'body':{'type':_0x1a6922[_0xa584('0xa')]||_0xa584('0xb'),'channelId':_0xa584('0xc'),'conversation':{'id':_0x3b03cf[_0xa584('0xd')]},'from':{'id':_0x3b03cf[_0xa584('0xe')],'name':_0x3b03cf[_0xa584('0xf')]},'recipient':{'id':_0x3b03cf[_0xa584('0x10')],'name':_0x3b03cf[_0xa584('0x11')]},'text':_0x1a6922[_0xa584('0x12')],'channelData':{}},'headers':{'Authorization':_0xa584('0x13')+_0x1fada0[_0xa584('0x14')]},'json':!![]};if(_0x1a6922['project']){_0x56be83[_0xa584('0x15')][_0xa584('0x16')][_0xa584('0x17')]=_0x1a6922[_0xa584('0x18')];}if(_0x1a6922[_0xa584('0x19')]=='1'){_0x56be83['body'][_0xa584('0x16')][_0xa584('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xa584('0x1b')};}if(_0x1a6922[_0xa584('0x1c')]){_0x56be83[_0xa584('0x15')]['channelData'][_0xa584('0x1d')]=_0x1a6922['custom_action'];if(_0x1a6922[_0xa584('0x1e')]){_0x56be83[_0xa584('0x15')][_0xa584('0x16')]['CustomActionData']=_0x1a6922[_0xa584('0x1e')];}}logger[_0xa584('0x1f')](JSON[_0xa584('0x20')](_0x56be83));return rp(_0x56be83);});};
\ No newline at end of file
index 78563d0..359d9cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf18=['./lib/api'];(function(_0x58cb6b,_0x2f2cba){var _0x33d724=function(_0x76c383){while(--_0x76c383){_0x58cb6b['push'](_0x58cb6b['shift']());}};_0x33d724(++_0x2f2cba);}(_0xaf18,0x154));var _0x8af1=function(_0x22b62e,_0x5d9fe3){_0x22b62e=_0x22b62e-0x0;var _0x48801e=_0xaf18[_0x22b62e];return _0x48801e;};'use strict';var asr=require(_0x8af1('0x0'));module['exports']=function(_0x4c970f,_0x3e43da,_0x1b02fe,_0x517599){return asr(_0x4c970f,_0x3e43da,_0x1b02fe,_0x517599);};
\ No newline at end of file
+var _0x9b97=['exports'];(function(_0x10e92a,_0x271e60){var _0x4157a8=function(_0x1c6cea){while(--_0x1c6cea){_0x10e92a['push'](_0x10e92a['shift']());}};_0x4157a8(++_0x271e60);}(_0x9b97,0xe7));var _0x79b9=function(_0x37db52,_0x215ca7){_0x37db52=_0x37db52-0x0;var _0x329297=_0x9b97[_0x37db52];return _0x329297;};'use strict';var asr=require('./lib/api');module[_0x79b9('0x0')]=function(_0x49987d,_0x357587,_0x4406d7,_0x299454){return asr(_0x49987d,_0x357587,_0x4406d7,_0x299454);};
\ No newline at end of file
index 2264f29..6d2847d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb671=['terminate','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','lodash','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error'];(function(_0x3b8363,_0x46d82b){var _0x4174ce=function(_0x21cf29){while(--_0x21cf29){_0x3b8363['push'](_0x3b8363['shift']());}};_0x4174ce(++_0x46d82b);}(_0xb671,0x18d));var _0x1b67=function(_0x56d73b,_0x43ba12){_0x56d73b=_0x56d73b-0x0;var _0xed302e=_0xb671[_0x56d73b];return _0xed302e;};'use strict';var BPromise=require('bluebird');var _=require(_0x1b67('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0x1b67('0x1'))(_0x1b67('0x2'));module[_0x1b67('0x3')]=function(_0x1e58e9,_0x49680e,_0x110913,_0x4c0c72){return new BPromise(function(_0x28639e,_0x5a84b6){logger[_0x1b67('0x4')]('Tilde\x20URI',_0x4c0c72||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x126f5c=new WebSocket(_0x4c0c72||_0x1b67('0x5'),{'perMessageDeflate':![]});var _0x4340d7='';var _0x2317a1='0';var _0x5beec6='1';var _0x3db736=_0x1b67('0x6');function _0x58e75e(_0x4eac82){var _0x1a0fa6=crypto[_0x1b67('0x7')](_0x1b67('0x8'));_0x1a0fa6['update'](_0x4eac82);return _0x1a0fa6[_0x1b67('0x9')](_0x1b67('0xa'));}function _0x263630(){try{logger[_0x1b67('0x4')](_0x1b67('0xb'));var _0x159129=moment()[_0x1b67('0xc')]();var _0x5d2148=_0x58e75e(_0x159129+_0x49680e+_0x110913);_0x126f5c[_0x1b67('0xd')](JSON[_0x1b67('0xe')]({'appID':_0x49680e,'timestamp':_0x159129,'appKey':_0x5d2148}));var _0x303353=fs[_0x1b67('0xf')](_0x1e58e9);_0x303353['on'](_0x1b67('0x10'),function(_0x20ed5c){_0x126f5c[_0x1b67('0xd')](_0x20ed5c);});_0x303353['on'](_0x1b67('0x11'),function(){_0x126f5c[_0x1b67('0xd')](_0x1b67('0x12'));});}catch(_0x5714ca){logger[_0x1b67('0x13')](_0x1b67('0x14'),JSON[_0x1b67('0xe')](_0x5714ca));_0x126f5c[_0x1b67('0x15')]();}}function _0x35e0dc(_0x7028f){try{if(_0x7028f){var _0x3d8aa4=JSON[_0x1b67('0x16')](_0x7028f);switch(_0x3d8aa4[_0x1b67('0x17')]){case 0x0:if(_0x3d8aa4['result']){if(_0x3d8aa4[_0x1b67('0x18')]['final']){logger[_0x1b67('0x4')](_0x1b67('0x19'),JSON[_0x1b67('0xe')](_0x3d8aa4['result'][_0x1b67('0x1a')]));_0x4340d7=_0x3d8aa4[_0x1b67('0x18')][_0x1b67('0x1a')][0x0][_0x1b67('0x1b')];_0x2317a1=_0x3d8aa4['result']['hypotheses'][0x0][_0x1b67('0x1c')];_0x5beec6='0';_0x3db736='Success.';_0x126f5c[_0x1b67('0x15')]();}}break;case 0x1:logger[_0x1b67('0x4')](_0x1b67('0x6'));_0x5beec6='1';_0x3db736=_0x1b67('0x6');break;case 0x2:logger['info'](_0x1b67('0x1d'));_0x5beec6='2';_0x3db736='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x1b67('0x4')](_0x1b67('0x1e'));_0x5beec6='9';_0x3db736=_0x1b67('0x1e');break;case 0xa:logger[_0x1b67('0x4')]('Authentication\x20failed.');_0x5beec6='10';_0x3db736=_0x1b67('0x1f');break;case 0xb:logger['info'](_0x1b67('0x20'));_0x5beec6='11';_0x3db736='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x135092){logger[_0x1b67('0x13')]('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x135092));_0x126f5c[_0x1b67('0x15')]();}}function _0x3b432a(){logger[_0x1b67('0x4')](_0x1b67('0x21'));_0x28639e({'transcript':_0x4340d7,'confidence':_0x2317a1,'status':_0x5beec6,'status_message':_0x3db736});}function _0x5a882c(_0x33faa0){logger[_0x1b67('0x13')](_0x1b67('0x22'));if(!_['isNil'](_0x33faa0)){logger[_0x1b67('0x13')](_[_0x1b67('0x23')](_0x33faa0)?JSON[_0x1b67('0xe')](_0x33faa0):_0x33faa0);}}_0x126f5c['on'](_0x1b67('0x24'),_0x263630);_0x126f5c['on'](_0x1b67('0x25'),_0x35e0dc);_0x126f5c['on'](_0x1b67('0x11'),_0x3b432a);_0x126f5c['on']('error',_0x5a882c);});};
\ No newline at end of file
+var _0xc5b9=['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','isNil','isObject','open','message','lodash','crypto','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','stringify','createReadStream','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','parse','result','final','info','Tilde\x20ASR\x20hypoteses','hypotheses','transcript'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xc5b9,0x161));var _0x9c5b=function(_0x129b27,_0x1fbfba){_0x129b27=_0x129b27-0x0;var _0x1086cc=_0xc5b9[_0x129b27];return _0x1086cc;};'use strict';var BPromise=require('bluebird');var _=require(_0x9c5b('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x9c5b('0x1'));var logger=require(_0x9c5b('0x2'))(_0x9c5b('0x3'));module[_0x9c5b('0x4')]=function(_0x5332ca,_0x580f28,_0x2ba8c6,_0x2afe60){return new BPromise(function(_0x9adbc9,_0x553099){logger['info'](_0x9c5b('0x5'),_0x2afe60||_0x9c5b('0x6'));var _0x48003b=new WebSocket(_0x2afe60||_0x9c5b('0x6'),{'perMessageDeflate':![]});var _0x53ef01='';var _0x2958b8='0';var _0x5bbab7='1';var _0x3e7649=_0x9c5b('0x7');function _0x2d1c51(_0x3572de){var _0x9493e4=crypto[_0x9c5b('0x8')]('sha1');_0x9493e4[_0x9c5b('0x9')](_0x3572de);return _0x9493e4[_0x9c5b('0xa')]('hex');}function _0x4eeae5(){try{logger['info'](_0x9c5b('0xb'));var _0x3e6582=moment()[_0x9c5b('0xc')]();var _0xd873b9=_0x2d1c51(_0x3e6582+_0x580f28+_0x2ba8c6);_0x48003b['send'](JSON[_0x9c5b('0xd')]({'appID':_0x580f28,'timestamp':_0x3e6582,'appKey':_0xd873b9}));var _0x322071=fs[_0x9c5b('0xe')](_0x5332ca);_0x322071['on']('data',function(_0x54e345){_0x48003b[_0x9c5b('0xf')](_0x54e345);});_0x322071['on'](_0x9c5b('0x10'),function(){_0x48003b[_0x9c5b('0xf')](_0x9c5b('0x11'));});}catch(_0x26174a){logger[_0x9c5b('0x12')](_0x9c5b('0x13'),JSON[_0x9c5b('0xd')](_0x26174a));_0x48003b['terminate']();}}function _0x2649f2(_0x3ccdff){try{if(_0x3ccdff){var _0x443d80=JSON[_0x9c5b('0x14')](_0x3ccdff);switch(_0x443d80['status']){case 0x0:if(_0x443d80[_0x9c5b('0x15')]){if(_0x443d80['result'][_0x9c5b('0x16')]){logger[_0x9c5b('0x17')](_0x9c5b('0x18'),JSON[_0x9c5b('0xd')](_0x443d80[_0x9c5b('0x15')][_0x9c5b('0x19')]));_0x53ef01=_0x443d80['result'][_0x9c5b('0x19')][0x0][_0x9c5b('0x1a')];_0x2958b8=_0x443d80[_0x9c5b('0x15')][_0x9c5b('0x19')][0x0][_0x9c5b('0x1b')];_0x5bbab7='0';_0x3e7649='Success.';_0x48003b[_0x9c5b('0x1c')]();}}break;case 0x1:logger[_0x9c5b('0x17')](_0x9c5b('0x7'));_0x5bbab7='1';_0x3e7649=_0x9c5b('0x7');break;case 0x2:logger[_0x9c5b('0x17')](_0x9c5b('0x1d'));_0x5bbab7='2';_0x3e7649=_0x9c5b('0x1d');break;case 0x9:logger[_0x9c5b('0x17')](_0x9c5b('0x1e'));_0x5bbab7='9';_0x3e7649=_0x9c5b('0x1e');break;case 0xa:logger[_0x9c5b('0x17')](_0x9c5b('0x1f'));_0x5bbab7='10';_0x3e7649=_0x9c5b('0x1f');break;case 0xb:logger[_0x9c5b('0x17')](_0x9c5b('0x20'));_0x5bbab7='11';_0x3e7649=_0x9c5b('0x20');}}}catch(_0x3c392d){logger['error'](_0x9c5b('0x21'),JSON[_0x9c5b('0xd')](_0x3c392d));_0x48003b[_0x9c5b('0x1c')]();}}function _0x47408b(){logger[_0x9c5b('0x17')]('Close\x20Tilde\x20ASR\x20socket');_0x9adbc9({'transcript':_0x53ef01,'confidence':_0x2958b8,'status':_0x5bbab7,'status_message':_0x3e7649});}function _0x4c73f1(_0x384016){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_[_0x9c5b('0x22')](_0x384016)){logger['error'](_[_0x9c5b('0x23')](_0x384016)?JSON['stringify'](_0x384016):_0x384016);}}_0x48003b['on'](_0x9c5b('0x24'),_0x4eeae5);_0x48003b['on'](_0x9c5b('0x25'),_0x2649f2);_0x48003b['on'](_0x9c5b('0x10'),_0x47408b);_0x48003b['on'](_0x9c5b('0x12'),_0x4c73f1);});};
\ No newline at end of file
index 23cb39a..d5865ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x033f=['exports','./asr'];(function(_0x150c34,_0x763034){var _0x3aa958=function(_0x2e633b){while(--_0x2e633b){_0x150c34['push'](_0x150c34['shift']());}};_0x3aa958(++_0x763034);}(_0x033f,0x65));var _0xf033=function(_0x2c80c1,_0xf479b3){_0x2c80c1=_0x2c80c1-0x0;var _0x375cd8=_0x033f[_0x2c80c1];return _0x375cd8;};var asr=require(_0xf033('0x0'));module[_0xf033('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x5138=['./asr'];(function(_0x44426d,_0x315c0e){var _0xca36b8=function(_0x4734b3){while(--_0x4734b3){_0x44426d['push'](_0x44426d['shift']());}};_0xca36b8(++_0x315c0e);}(_0x5138,0x13d));var _0x8513=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x5138[_0x256b72];return _0x2183e3;};var asr=require(_0x8513('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
index 515cc0a..d0c3c2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x1488cd,_0x25a893){var _0x63fa13=function(_0x57dd1c){while(--_0x57dd1c){_0x1488cd['push'](_0x1488cd['shift']());}};_0x63fa13(++_0x25a893);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);};
\ No newline at end of file
+var _0xe706=['connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','close','nextTick','exports','util','net','events','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening'];(function(_0x3fd50c,_0x1b41ed){var _0x4cebb2=function(_0x56a546){while(--_0x56a546){_0x3fd50c['push'](_0x3fd50c['shift']());}};_0x4cebb2(++_0x1b41ed);}(_0xe706,0xa3));var _0x6e70=function(_0x2d580b,_0x2b11f3){_0x2d580b=_0x2d580b-0x0;var _0x7c1374=_0xe706[_0x2d580b];return _0x7c1374;};'use strict';var util=require(_0x6e70('0x0'));var net=require(_0x6e70('0x1'));var EventEmitter=require(_0x6e70('0x2'))['EventEmitter'];var AGIError=require(_0x6e70('0x3'));var AGIChannel=require(_0x6e70('0x4'));var AGIServer=function(_0x2ca810,_0x7dfbc3,_0x142c27){var _0x2164a4=this;var _0x376a8d=null;var _0x506db9=0x0;if(!_0x2ca810)_0x2ca810=0x11dd;if(!_0x7dfbc3)_0x7dfbc3=_0x6e70('0x5');EventEmitter[_0x6e70('0x6')](_0x2164a4);function _0x36357b(){if(!_0x2ca810){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x9')));return![];}_0x376a8d=net[_0x6e70('0xa')]();_0x376a8d[_0x6e70('0xb')](_0x2ca810,_0x7dfbc3);_0x376a8d['on'](_0x6e70('0xc'),function(){_0x2164a4[_0x6e70('0x7')](_0x6e70('0xc'));});_0x376a8d['on'](_0x6e70('0xd'),function(_0x743eb5){_0x376a8d[_0x6e70('0xe')](function(_0x37b3e0,_0x4600f9){if(_0x37b3e0){_0x2164a4['emit']('error',new AGIError(_0x6e70('0xf'),_0x37b3e0));}else if(_0x142c27&&_0x142c27<0x0){_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x10')));_0x743eb5[_0x6e70('0x11')]();}else if(_0x142c27&&_0x142c27>0x0&&_0x142c27<_0x4600f9){_0x506db9+=0x1;_0x2164a4[_0x6e70('0x7')](_0x6e70('0x8'),new AGIError(_0x6e70('0x12'),_0x506db9));_0x743eb5['destroy']();}else{var _0x52737e=new AGIChannel(_0x743eb5);_0x52737e['on']('ready',function(){_0x2164a4[_0x6e70('0x7')]('connection',_0x52737e);});}});});_0x376a8d['on']('error',function(_0x304716){_0x2164a4[_0x6e70('0x7')]('error',new AGIError(_0x6e70('0xf'),_0x304716['code']));});_0x376a8d['on'](_0x6e70('0x13'),function(){_0x2164a4[_0x6e70('0x7')]('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x6e70('0x14')](function(){_0x36357b();});};util['inherits'](AGIServer,EventEmitter);module[_0x6e70('0x15')]=function(_0x173afe,_0x53acdc,_0x497d61){return new AGIServer(_0x173afe,_0x53acdc,_0x497d61);};
\ No newline at end of file
index e63eefd..910fcc0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69d3=['Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','toUpperCase','speech','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','no\x20anguage\x20configured','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','username','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','end','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','getSound','no\x20file\x20audio\x20found','getData','response','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','no\x20file\x20audio\x20selected','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','QUEUE','macro','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','restAPI','Response:','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','replace','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','number','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','answer','yes','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','agentUnpause','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','shelljs','randomstring','moment','../../config/logger','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariableById','then','name','getVoiceQueue','catch','getSquareProject','getSquareProjectById','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','createSquareRecording','callerid','calleridname','context','extension','priority','accountcode','arg_1','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','callback_priority','getPause','getPauseById','agentPause','agent','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','audioEncoding','googleTTS','url','method','timeout','includes','POST','PUT','body','headers','computedVariables','sync','uri','render','parse','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','hasOwnProperty','replaceObjectAllVariables','isPlainObject','recursiveNodeIndex','isArray','isString','saveRestApiResult','%s.%s','setVariable','replaceAllVariables','length','split','replaceAll','getVariable','extra','toString','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','retry','maxRetry','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','RECOG_INPUT()','result','Executed\x20command\x20MRCPRecog\x20%s','agi','command','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','RECOG_INSTANCE()','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','dialogflow'];(function(_0x3a928f,_0x199534){var _0x3e530d=function(_0x40551c){while(--_0x40551c){_0x3a928f['push'](_0x3a928f['shift']());}};_0x3e530d(++_0x199534);}(_0x69d3,0xda));var _0x369d=function(_0x45cc2d,_0x66066b){_0x45cc2d=_0x45cc2d-0x0;var _0x4c60ee=_0x69d3[_0x45cc2d];return _0x4c60ee;};'use strict';var fs=require('fs');var util=require(_0x369d('0x0'));var _=require(_0x369d('0x1'));var sh=require(_0x369d('0x2'));var odbc=require('odbc')();var rs=require(_0x369d('0x3'));var moment=require(_0x369d('0x4'));var Mustache=require('mustache');var rp=require('request-promise');var logger=require(_0x369d('0x5'))('agi');var config=require('../../config/environment');var shared=require(_0x369d('0x6'));var scripts=require(_0x369d('0x7'));var FILES_PATH=_0x369d('0x8');var recursiveMapAttributes=[_0x369d('0x9'),_0x369d('0xa')];var verticesWithRetry=[_0x369d('0xb'),_0x369d('0xc'),_0x369d('0xd')];var AGIVertices=function(_0xbe80fc,_0x580727,_0x5d2ded){this[_0x369d('0xe')]=_0xbe80fc;this[_0x369d('0xf')]=_0x580727;this[_0x369d('0x10')]=_0x5d2ded;};AGIVertices[_0x369d('0x11')]['getVariable']=function(_0x5ba2d0,_0x2c95eb){this[_0x369d('0xf')][_0x369d('0x12')](_0x5ba2d0)[_0x369d('0x13')](function(_0x21ed6b){_0x2c95eb(null,_0x21ed6b?_0x21ed6b[_0x369d('0x14')]:![]);})['catch'](function(_0x15b417){_0x2c95eb(_0x15b417);});};AGIVertices[_0x369d('0x11')][_0x369d('0x15')]=function(_0x10d7a5,_0x121307){this['rpc']['getVoiceQueueById'](_0x10d7a5)['then'](function(_0x2dcc39){_0x121307(null,_0x2dcc39?_0x2dcc39[_0x369d('0x14')]:![]);})[_0x369d('0x16')](function(_0x5b4f55){_0x121307(_0x5b4f55);});};AGIVertices[_0x369d('0x11')][_0x369d('0x17')]=function(_0x435c2f,_0x4e234e){this[_0x369d('0xf')][_0x369d('0x18')](_0x435c2f)['then'](function(_0x572513){_0x4e234e(null,_0x572513?_0x572513['name']:![]);})[_0x369d('0x16')](function(_0x4494b3){_0x4e234e(_0x4494b3);});};AGIVertices[_0x369d('0x11')]['getSquareOdbc']=function(_0x410dbe,_0x24dfff){this[_0x369d('0xf')][_0x369d('0x19')](_0x410dbe)[_0x369d('0x13')](function(_0x538ca4){_0x24dfff(null,_0x538ca4?_0x538ca4[_0x369d('0x1a')]:![]);})[_0x369d('0x16')](function(_0x1edcd5){_0x24dfff(_0x1edcd5);});};AGIVertices[_0x369d('0x11')][_0x369d('0x1b')]=function(_0x84cc0f,_0x15fbef){this[_0x369d('0xf')]['getUserById'](_0x84cc0f)['then'](function(_0x32ef9a){_0x15fbef(null,_0x32ef9a?_0x32ef9a[_0x369d('0x14')]:![]);})[_0x369d('0x16')](function(_0xcae58){_0x15fbef(_0xcae58);});};AGIVertices[_0x369d('0x11')][_0x369d('0x1c')]=function(_0x36cf04,_0x566c96){this['rpc'][_0x369d('0x1d')](_0x36cf04)[_0x369d('0x13')](function(_0x15cd81){_0x566c96(null,_0x15cd81?_0x15cd81[_0x369d('0x14')]:![]);})[_0x369d('0x16')](function(_0x41e0cf){_0x566c96(_0x41e0cf);});};AGIVertices[_0x369d('0x11')]['getSound']=function(_0x23656b,_0xe95742){var _0x357e94=this;this[_0x369d('0xf')][_0x369d('0x1e')](_0x23656b)[_0x369d('0x13')](function(_0x3d1ce0){_0xe95742(null,_0x3d1ce0?_0x357e94['getSoundPath'](_0x3d1ce0[_0x369d('0x1f')]):![]);})['catch'](function(_0x57b94c){_0xe95742(_0x57b94c);});};AGIVertices[_0x369d('0x11')][_0x369d('0x20')]=function(_0x5844c7,_0x104540){this['rpc'][_0x369d('0x21')](_0x5844c7)[_0x369d('0x13')](function(_0xe45219){_0x104540(null,_0xe45219?_0xe45219:![]);})[_0x369d('0x16')](function(_0x327072){_0x104540(_0x327072);});};AGIVertices[_0x369d('0x11')][_0x369d('0x22')]=function(_0x47f60c,_0x3f79c0,_0xecd4d0){this[_0x369d('0x10')][_0x369d('0x22')](_0x47f60c,_0x3f79c0)[_0x369d('0x13')](function(){_0xecd4d0(null);})[_0x369d('0x16')](function(_0x26c0e4){_0xecd4d0(_0x26c0e4);});};AGIVertices[_0x369d('0x11')]['getIntervals']=function(_0x128703,_0x2ba308){this[_0x369d('0xf')][_0x369d('0x23')](_0x128703)[_0x369d('0x13')](function(_0x54ce2b){if(_0x54ce2b){if(_0x54ce2b[_0x369d('0x24')]){_0x2ba308(null,[_0x54ce2b[_0x369d('0x25')]]);}else{_0x2ba308(null,_[_0x369d('0x26')](_0x54ce2b[_0x369d('0x27')],_0x369d('0x25')));}}else{_0x2ba308(null,![]);}})[_0x369d('0x16')](function(_0x50c033){_0x2ba308(_0x50c033);});};AGIVertices[_0x369d('0x11')][_0x369d('0x28')]=function(_0x40afb2){return util[_0x369d('0x29')](_0x369d('0x2a'),FILES_PATH,_0x40afb2);};AGIVertices[_0x369d('0x11')][_0x369d('0x2b')]=function(_0x22c498,_0x1cf374,_0x273d8b){odbc[_0x369d('0x2c')](_0x22c498,function(_0x1edb38){if(_0x1edb38){logger[_0x369d('0x2d')](_0x369d('0x2e'),_0x1edb38);_0x273d8b(_0x1edb38);}else{logger[_0x369d('0x2f')](_0x369d('0x30'));odbc[_0x369d('0x31')](_0x1cf374,function(_0x69c7af,_0x410974){if(_0x69c7af){logger[_0x369d('0x2f')](_0x369d('0x32'),_0x1cf374);_0x273d8b(_0x69c7af);}else{logger[_0x369d('0x2f')](_0x369d('0x33'),_0x1cf374);odbc[_0x369d('0x34')](function(_0x4c09ff){if(_0x4c09ff){logger['error'](_0x369d('0x35'),_0x4c09ff);}_0x273d8b(null,_0x410974);});}});}});};AGIVertices[_0x369d('0x11')][_0x369d('0x36')]=function(_0x401bc7,_0x3afa89){this[_0x369d('0xf')][_0x369d('0x37')](_0x401bc7)[_0x369d('0x13')](function(_0x46c940){_0x3afa89(null,_0x46c940?_0x46c940:![]);})['catch'](function(_0x322b13){_0x3afa89(_0x322b13);});};AGIVertices[_0x369d('0x11')][_0x369d('0x38')]=function(_0x10f5a0,_0xd88839){this[_0x369d('0xf')][_0x369d('0x38')](_0x10f5a0)[_0x369d('0x13')](function(_0x574deb){_0xd88839(null,_0x574deb);})['catch'](function(_0x20b351){_0xd88839(_0x20b351);});};AGIVertices[_0x369d('0x11')][_0x369d('0x39')]=function(_0x4dad71,_0x4d07ac,_0x4d29bf){this[_0x369d('0xf')][_0x369d('0x39')]({'uniqueid':this['channel'][_0x369d('0x3a')],'node':_0x4dad71[_0x369d('0x3b')],'application':_0x4dad71[_0x369d('0x3c')],'data':_0x4d07ac||null,'project_name':this[_0x369d('0xe')]['arg_1'],'callerid':this[_0x369d('0xe')]['callerid']})[_0x369d('0x13')](function(_0x52658b){if(_0x4d29bf){_0x4d29bf(null,_0x52658b);}})[_0x369d('0x16')](function(_0x30d6c8){if(_0x4d29bf){_0x4d29bf(_0x30d6c8);}});};AGIVertices[_0x369d('0x11')]['createSquareRecording']=function(_0x4e5df6,_0x3be075,_0x4635ce,_0x2a0be7){this['rpc'][_0x369d('0x3d')]({'uniqueid':this[_0x369d('0xe')][_0x369d('0x3a')],'callerid':this[_0x369d('0xe')][_0x369d('0x3e')],'calleridname':this[_0x369d('0xe')][_0x369d('0x3f')],'context':this[_0x369d('0xe')][_0x369d('0x40')],'extension':this['channel'][_0x369d('0x41')],'priority':this[_0x369d('0xe')][_0x369d('0x42')],'accountcode':this[_0x369d('0xe')][_0x369d('0x43')],'dnid':this[_0x369d('0xe')]['dnid'],'projectName':this[_0x369d('0xe')][_0x369d('0x44')],'saveName':_0x3be075,'filename':_0x4e5df6[_0x369d('0x45')]||_0x3be075,'savePath':_0x4635ce})[_0x369d('0x13')](function(_0x1b04d9){_0x2a0be7(null,_0x1b04d9);})[_0x369d('0x16')](function(_0x8a0406){_0x2a0be7(_0x8a0406);});};AGIVertices[_0x369d('0x11')][_0x369d('0x46')]=function(_0x3c15cb,_0x12afb2,_0x1b1e4c,_0x573774,_0x268661){this[_0x369d('0xf')][_0x369d('0x46')]({'uniqueid':this[_0x369d('0xe')][_0x369d('0x3a')],'body':_0x3c15cb,'direction':_0x12afb2,'providerName':_0x1b1e4c,'providerResponse':_0x573774})['then'](function(_0x2d811b){if(_0x268661){_0x268661(null,_0x2d811b);}})['catch'](function(_0x103e9e){if(_0x268661){_0x268661(_0x103e9e);}});};AGIVertices[_0x369d('0x11')][_0x369d('0x47')]=function(_0x851746,_0x46c62c){this[_0x369d('0xf')][_0x369d('0x47')]({'firstName':_[_0x369d('0x48')](_0x851746[_0x369d('0x14')])||_[_0x369d('0x49')](_0x851746['name'])?'callback_'+Math[_0x369d('0x4a')]():_0x851746[_0x369d('0x14')],'lastName':_[_0x369d('0x48')](_0x851746[_0x369d('0x4b')])||_[_0x369d('0x49')](_0x851746['lastName'])?null:_0x851746['lastName'],'phone':_0x851746[_0x369d('0x4c')],'ListId':_0x851746[_0x369d('0x4d')],'scheduledat':_0x851746['scheduledAt'],'callbackUniqueid':this[_0x369d('0xe')]['uniqueid'],'tags':_0x369d('0x4e'),'description':_0x369d('0x4f')+_0x851746[_0x369d('0x50')]['toString'](),'priority':_0x851746[_0x369d('0x51')]})[_0x369d('0x13')](function(_0x45ac3c){_0x46c62c(null,_0x45ac3c);})[_0x369d('0x16')](function(_0x589dac){_0x46c62c(_0x589dac);});};AGIVertices['prototype'][_0x369d('0x52')]=function(_0x476ee8,_0x35667d){this['rpc'][_0x369d('0x53')](_0x476ee8)[_0x369d('0x13')](function(_0x402aae){_0x35667d(null,_0x402aae?_0x402aae['name']:![]);})['catch'](function(_0xa5d485){_0x35667d(_0xa5d485);});};AGIVertices[_0x369d('0x11')][_0x369d('0x54')]=function(_0x158ce7,_0x5408b3,_0x33bba6){var _0x1fa6bb={'role':_0x369d('0x55')};_0x1fa6bb[_0x158ce7]=this[_0x369d('0xe')][_0x369d('0x3e')];this['rpc'][_0x369d('0x54')](_0x1fa6bb,_0x5408b3,this[_0x369d('0xe')][_0x369d('0x3a')])['then'](function(_0xfcd6e3){_0x33bba6(null,_['isNil'](_0xfcd6e3)?![]:!![]);})[_0x369d('0x16')](function(_0x49d3f1){logger['error'](_0x49d3f1);_0x33bba6(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x2416f5,_0x51b143){var _0x2f92b3={'role':'agent'};_0x2f92b3[_0x2416f5]=this[_0x369d('0xe')][_0x369d('0x3e')];this[_0x369d('0xf')]['agentUnpause'](_0x2f92b3)[_0x369d('0x13')](function(_0x1895c1){_0x51b143(null,_[_0x369d('0x49')](_0x1895c1)?![]:!![]);})[_0x369d('0x16')](function(_0xcbc380){logger[_0x369d('0x2d')](_0xcbc380);_0x51b143(null,![]);});};AGIVertices['prototype'][_0x369d('0x56')]=function(_0x4bd395,_0x5706be){var _0x56c98e={'role':_0x369d('0x55')};_0x56c98e[_0x4bd395]=this[_0x369d('0xe')][_0x369d('0x3e')];this[_0x369d('0xf')][_0x369d('0x56')](_0x56c98e)[_0x369d('0x13')](function(_0xc6476f){_0x5706be(null,_[_0x369d('0x49')](_0xc6476f)?![]:!![]);})[_0x369d('0x16')](function(_0x152952){logger[_0x369d('0x2d')](_0x152952);_0x5706be(null,![]);});};AGIVertices[_0x369d('0x11')][_0x369d('0x57')]=function(_0x7ba3e5,_0x1440bb){var _0x46f58a={'role':'agent'};_0x46f58a[_0x7ba3e5]=this[_0x369d('0xe')]['callerid'];var _0x282219=_0x7ba3e5!=_0x369d('0x58')?util[_0x369d('0x29')](_0x369d('0x59'),_0x369d('0x5a'),this['channel'][_0x369d('0x3e')]):undefined;this['rpc']['agentLogin'](_0x46f58a,_0x282219)[_0x369d('0x13')](function(_0x1e65af){_0x1440bb(null,_[_0x369d('0x49')](_0x1e65af)?![]:!![]);})[_0x369d('0x16')](function(_0x2a42a1){logger[_0x369d('0x2d')](_0x2a42a1);_0x1440bb(null,![]);});};AGIVertices[_0x369d('0x11')][_0x369d('0x5b')]=function(_0x55a811,_0x461782){sh[_0x369d('0x5c')](_['trim'](_0x55a811),function(_0x2ef007,_0x37075c){var _0x41e4a2=_0x37075c['replace'](/(\r\n|\n|\r)/gm,'');_0x461782(null,_0x41e4a2);});};AGIVertices[_0x369d('0x11')]['googleCloudTTS']=function(_0x2a8152,_0x441d3b){scripts[_0x369d('0x5d')](_0x2a8152[_0x369d('0x5e')],_0x2a8152[_0x369d('0x5f')]||_0x369d('0x60'),_0x2a8152[_0x369d('0x60')],_0x2a8152['languageCode']||_0x369d('0x61'),_0x2a8152[_0x369d('0x62')]||'MALE',_0x2a8152[_0x369d('0x63')]||'MP3')[_0x369d('0x13')](function(_0x1133d4){_0x441d3b(null,_0x1133d4);})[_0x369d('0x16')](function(_0x5f2f34){_0x441d3b(_0x5f2f34);});};AGIVertices[_0x369d('0x11')][_0x369d('0x64')]=function(_0x4f6c45,_0x8740ed){scripts[_0x369d('0x64')](_0x4f6c45[_0x369d('0x60')],_0x4f6c45['google_tts_language']||'en',0x1)[_0x369d('0x13')](function(_0x1a16bb){_0x8740ed(null,_0x1a16bb);})[_0x369d('0x16')](function(_0x31444d){_0x8740ed(_0x31444d);});};AGIVertices[_0x369d('0x11')]['restAPI']=function(_0x2c64d1,_0xa05657){var _0x45fadd={'uri':_0x2c64d1[_0x369d('0x65')],'method':_0x2c64d1[_0x369d('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x2c64d1['timeout'])==='number'&&parseInt(_0x2c64d1[_0x369d('0x67')])>=0x1?parseInt(_0x2c64d1[_0x369d('0x67')])*0x3e8:0x5*0x3e8};if(_[_0x369d('0x68')]([_0x369d('0x69'),_0x369d('0x6a')],_0x45fadd[_0x369d('0x66')]['toUpperCase']())){try{_0x45fadd[_0x369d('0x6b')]=_0x2c64d1[_0x369d('0xa')]?JSON['parse'](_0x2c64d1[_0x369d('0xa')]):{};}catch(_0x484b5e){logger[_0x369d('0x2d')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x484b5e);}}try{_0x45fadd[_0x369d('0x6c')]=_0x2c64d1[_0x369d('0x9')]?JSON['parse'](_0x2c64d1[_0x369d('0x9')]):{};}catch(_0x57bcdb){logger[_0x369d('0x2d')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x57bcdb);}if(_0x2c64d1['computedVariables']){try{var _0x235b4d=require(_0x2c64d1[_0x369d('0x6d')])[_0x369d('0x6e')](this,_0x45fadd);_0x45fadd[_0x369d('0x6f')]=Mustache[_0x369d('0x70')](_0x2c64d1['url'],_0x235b4d,{},['$$','$$']);if(_0x45fadd[_0x369d('0x6c')]){_0x45fadd[_0x369d('0x6c')]=JSON[_0x369d('0x71')](Mustache[_0x369d('0x70')](JSON[_0x369d('0x72')](_0x45fadd[_0x369d('0x6c')]),_0x235b4d,{},['$$','$$']));}if(_0x45fadd[_0x369d('0x6b')]){_0x45fadd[_0x369d('0x6b')]=JSON[_0x369d('0x71')](Mustache['render'](JSON[_0x369d('0x72')](_0x45fadd[_0x369d('0x6b')]),_0x235b4d,{},['$$','$$']));}}catch(_0x19f04a){logger[_0x369d('0x2d')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x19f04a);}}rp(_0x45fadd)[_0x369d('0x13')](function(_0x528c40){var _0x36b7c5={'statusCode':_0x528c40[_0x369d('0x73')]||0xc8,'statusMessage':_0x528c40[_0x369d('0x74')]||'OK','headers':_0x528c40[_0x369d('0x6c')]||{},'body':_0x528c40[_0x369d('0x6b')]||{}};_0xa05657(null,_0x36b7c5);})[_0x369d('0x16')](function(_0x3fa663){var _0x3582fe={'statusCode':_0x3fa663[_0x369d('0x73')]||0x1f4,'statusMessage':_0x3fa663[_0x369d('0x75')]||_0x369d('0x76'),'headers':_0x3fa663[_0x369d('0x77')][_0x369d('0x6c')]||{},'body':_0x3fa663[_0x369d('0x77')]['body']||{}};_0xa05657(null,_0x3582fe);});};AGIVertices[_0x369d('0x11')]['googleDialogflow']=function(_0x512df7,_0x1c7dc9){scripts[_0x369d('0x78')](this[_0x369d('0xe')][_0x369d('0x3a')],_0x512df7[_0x369d('0x79')],_0x512df7[_0x369d('0x60')],_0x512df7[_0x369d('0x7a')]||'en')[_0x369d('0x13')](function(_0x17abe9){_0x1c7dc9(null,_0x17abe9);})[_0x369d('0x16')](function(_0x3dd7a3){_0x1c7dc9(_0x3dd7a3);});};AGIVertices[_0x369d('0x11')][_0x369d('0x7b')]=function(_0x1282c9,_0x3d7f75){scripts[_0x369d('0x7b')](this[_0x369d('0xe')][_0x369d('0x3a')],_0x1282c9[_0x369d('0x7c')],_0x1282c9['client_email'],_0x1282c9[_0x369d('0x7d')],_0x1282c9['text'],_0x1282c9[_0x369d('0x7e')]||'en')['then'](function(_0x4503bc){_0x3d7f75(null,_0x4503bc);})[_0x369d('0x16')](function(_0x544fc6){_0x3d7f75(_0x544fc6);});};AGIVertices[_0x369d('0x11')][_0x369d('0x7f')]=function(_0x223aa4,_0x206bd1){scripts[_0x369d('0x7f')](this['channel'],_0x223aa4)['then'](function(_0x3b4af4){_0x206bd1(null,_0x3b4af4);})[_0x369d('0x16')](function(_0xe6e663){_0x206bd1(_0xe6e663);});};AGIVertices[_0x369d('0x11')][_0x369d('0x80')]=function(_0x21191f,_0x2cfc24){scripts[_0x369d('0x80')](_0x21191f[_0x369d('0x79')],_0x21191f[_0x369d('0x60')],_0x21191f['ispeech_tts_language']||_0x369d('0x61'),_0x21191f['speed'])[_0x369d('0x13')](function(_0x5c3ad7){_0x2cfc24(null,_0x5c3ad7);})[_0x369d('0x16')](function(_0x891a6e){_0x2cfc24(_0x891a6e);});};AGIVertices['prototype'][_0x369d('0x81')]=function(_0x3bc012,_0x337b05,_0x4e9780){scripts[_0x369d('0x81')](_0x337b05,_0x3bc012['key'],_0x3bc012[_0x369d('0x82')]||_0x369d('0x61'),this['isConfigured'](_0x3bc012['model'])?_0x3bc012[_0x369d('0x83')]:undefined)[_0x369d('0x13')](function(_0x2d1305){_0x4e9780(null,_0x2d1305);})['catch'](function(_0x3cdcc4){_0x4e9780(_0x3cdcc4);});};AGIVertices['prototype'][_0x369d('0x84')]=function(_0x5e0187,_0x419124){scripts[_0x369d('0x84')](_0x5e0187[_0x369d('0x85')],_0x5e0187[_0x369d('0x86')],_0x5e0187[_0x369d('0x87')],_0x5e0187['aws_polly_voice']||_0x369d('0x88'),_0x5e0187[_0x369d('0x60')],_0x5e0187['aws_text_type']||_0x369d('0x60'))[_0x369d('0x13')](function(_0x551211){_0x419124(null,_0x551211);})[_0x369d('0x16')](function(_0x3a61f2){_0x419124(_0x3a61f2);});};AGIVertices[_0x369d('0x11')][_0x369d('0x89')]=function(_0x24f4da,_0x22b122){scripts['awsLex'](this[_0x369d('0xe')][_0x369d('0x3a')],_0x24f4da[_0x369d('0x85')],_0x24f4da[_0x369d('0x86')],_0x24f4da[_0x369d('0x8a')],_0x24f4da[_0x369d('0x60')],_0x24f4da['aws_bot_name'])[_0x369d('0x13')](function(_0x2bad22){_0x22b122(null,_0x2bad22);})[_0x369d('0x16')](function(_0x31b71f){_0x22b122(_0x31b71f);});};AGIVertices[_0x369d('0x11')]['googleASR']=function(_0x4a8253,_0x4b1b80,_0x50f884){scripts[_0x369d('0x8b')](_0x4b1b80,_0x4a8253[_0x369d('0x79')],_0x4a8253[_0x369d('0x8c')]||_0x369d('0x61'))[_0x369d('0x13')](function(_0x58013c){_0x50f884(null,_0x58013c);})[_0x369d('0x16')](function(_0x5f21db){_0x50f884(_0x5f21db);});};AGIVertices[_0x369d('0x11')][_0x369d('0x8d')]=function(_0x5dd1d2,_0x5edb81,_0x34ac69){scripts[_0x369d('0x8d')](_0x5edb81,_0x5dd1d2[_0x369d('0x8e')],_0x5dd1d2[_0x369d('0x8f')],_0x5dd1d2['uri'])[_0x369d('0x13')](function(_0x4b403c){_0x34ac69(null,_0x4b403c);})['catch'](function(_0x3d9286){_0x34ac69(_0x3d9286);});};AGIVertices[_0x369d('0x11')]['clear']=function(_0x5770d2){var _0x3c1103=_[_0x369d('0x68')](verticesWithRetry,_0x5770d2[_0x369d('0x3c')])?_0x5770d2:_['clone'](_0x5770d2);for(var _0x3969e6 in _0x3c1103){if(_0x3c1103[_0x369d('0x90')](_0x3969e6)){if(_0x3c1103[_0x3969e6]&&_['isString'](_0x3c1103[_0x3969e6])){if(_['includes'](recursiveMapAttributes,_0x3969e6)){_0x3c1103[_0x3969e6]=this[_0x369d('0x91')](_0x3c1103[_0x3969e6]);}else{_0x3c1103[_0x3969e6]=this['replaceAllVariables'](_0x3c1103[_0x3969e6]);}}}}return _0x3c1103;};AGIVertices['prototype']['recursiveNodeIndex']=function(_0xe93a05){for(var _0x5f52b2 in _0xe93a05){if(_0xe93a05[_0x369d('0x90')](_0x5f52b2)){if(_[_0x369d('0x92')](_0xe93a05[_0x5f52b2])){this[_0x369d('0x93')](_0xe93a05[_0x5f52b2]);}else if(_[_0x369d('0x94')](_0xe93a05[_0x5f52b2])){for(var _0x51486c=0x0;_0x51486c<_0xe93a05[_0x5f52b2]['length'];_0x51486c++){this['recursiveNodeIndex'](_0xe93a05[_0x5f52b2][_0x51486c]);}}else if(_[_0x369d('0x95')](_0xe93a05[_0x5f52b2])){_0xe93a05[_0x5f52b2]=this['replaceAllVariables'](_0xe93a05[_0x5f52b2]);}}}};AGIVertices[_0x369d('0x11')][_0x369d('0x96')]=function(_0x3a481a,_0x2572fe){for(var _0x2a6c79 in _0x3a481a){if(_0x3a481a['hasOwnProperty'](_0x2a6c79)){if(_[_0x369d('0x92')](_0x3a481a[_0x2a6c79])){if(!_[_0x369d('0x48')](_0x3a481a[_0x2a6c79])){this[_0x369d('0x96')](_0x3a481a[_0x2a6c79],util[_0x369d('0x29')](_0x369d('0x97'),_0x2572fe,_0x2a6c79));}}else if(_['isArray'](_0x3a481a[_0x2a6c79])){for(var _0x567097=0x0;_0x567097<_0x3a481a[_0x2a6c79]['length'];_0x567097++){this[_0x369d('0x96')](_0x3a481a[_0x2a6c79][_0x567097],util[_0x369d('0x29')](_0x369d('0x97'),_0x2572fe,_0x2a6c79+'['+_0x567097+']'));}}else{if(!_[_0x369d('0x49')](_0x3a481a[_0x2a6c79])){this[_0x369d('0xe')][_0x369d('0x98')](util['format'](_0x369d('0x97'),_0x2572fe,_0x2a6c79),_0x3a481a[_0x2a6c79]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x174710){try{var _0x54228f=JSON[_0x369d('0x71')](_0x174710);this[_0x369d('0x93')](_0x54228f);return JSON[_0x369d('0x72')](_0x54228f);}catch(_0x19534b){return this[_0x369d('0x99')](_0x174710);}};AGIVertices['prototype'][_0x369d('0x99')]=function(_0x5b7f05){var _0x34c13c=_0x5b7f05['split']('{');for(var _0x37275e=0x1;_0x37275e<_0x34c13c[_0x369d('0x9a')];_0x37275e+=0x1){var _0x2b7bc7=_0x34c13c[_0x37275e][_0x369d('0x9b')]('}');if(_0x2b7bc7['length']>0x1){_0x5b7f05=_0x5b7f05[_0x369d('0x9c')]('{'+_0x2b7bc7[0x0]+'}',this['channel'][_0x369d('0x9d')](_0x2b7bc7[0x0])[_0x369d('0x9e')]||_0x2b7bc7[0x0]);}}if(_0x34c13c[_0x369d('0x9a')]===0x1){return _0x5b7f05[_0x369d('0x9f')]();}return this[_0x369d('0x99')](_0x5b7f05);};AGIVertices[_0x369d('0x11')][_0x369d('0xa0')]=function(_0x58ee04,_0x181ec2){var _0x4e963f=this['channel'][_0x369d('0x9d')](_0x58ee04);if(_0x4e963f['result']===-0x1){return _0x4e963f;}logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0xa1'),_0x181ec2,_0x4e963f[_0x369d('0x9e')]));return this[_0x369d('0xe')]['setVariable'](_0x181ec2,_0x4e963f[_0x369d('0x9e')]);};AGIVertices[_0x369d('0x11')][_0x369d('0xa2')]=function(_0x4b336b){return _0x4b336b&&_0x4b336b!=='0'&&_0x4b336b!=='-1'&&_0x4b336b!=='';};AGIVertices[_0x369d('0x11')]['maxRetry']=function(_0x234547){this['createSquareDetailsReport']['sync'](this,_0x234547,'-');_0x234547[_0x369d('0xa3')]=_0x234547[_0x369d('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x1ed603){logger[_0x369d('0x2f')](util[_0x369d('0x29')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x1ed603[_0x369d('0x3b')]));if(!this['isConfigured'](_0x1ed603[_0x369d('0x60')])){return this['channel'][_0x369d('0xa5')](_0x369d('0xa6'));}var _0x2b9326='\x22'+_0x1ed603['text']+'\x22';if(this[_0x369d('0xa2')](_0x1ed603['options'])){_0x2b9326+=','+_0x1ed603['options'];}var _0x5ee896=this['channel']['exec'](_0x369d('0xa7'),_0x2b9326);if(_0x5ee896['result']===-0x1){return _0x5ee896;}return this[_0x369d('0xe')]['noop'](util['format'](_0x369d('0xa8'),_0x2b9326));};AGIVertices['prototype'][_0x369d('0xa9')]=function(_0x3f7476){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0xaa'),_0x3f7476['label']));if(!this[_0x369d('0xa2')](_0x3f7476[_0x369d('0xab')])){return this['channel'][_0x369d('0xa5')](_0x369d('0xac'));}var _0x6affd4=_0x3f7476[_0x369d('0xab')];if(this[_0x369d('0xa2')](_0x3f7476['options'])){_0x6affd4+=','+_0x3f7476['options'];}var _0x16968f=this['channel'][_0x369d('0x5c')]('MRCPRecog',_0x6affd4);if(_0x16968f['result']===-0x1){return _0x16968f;}var _0x1fa90f=this[_0x369d('0xa0')]('RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE');if(_0x1fa90f['result']===-0x1){return _0x1fa90f;}var _0x4130f7=this[_0x369d('0xa0')](_0x369d('0xad'),'MRCP_RECOG_TRANSCRIPT');if(_0x4130f7[_0x369d('0xae')]===-0x1){return _0x4130f7;}var _0x3430a1=this[_0x369d('0xa0')]('RECOG_INSTANCE()','MRCP_RECOG_INSTANCE');if(_0x3430a1[_0x369d('0xae')]===-0x1){return _0x3430a1;}return this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0xaf'),_0x6affd4));};AGIVertices['prototype'][_0x369d('0xb0')]=function(_0x23d2ab){logger[_0x369d('0x2f')](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x23d2ab[_0x369d('0x3b')]));return this[_0x369d('0xe')]['agi']([_0x23d2ab[_0x369d('0xb1')],_0x23d2ab['args']]);};AGIVertices[_0x369d('0x11')]['answer']=function(_0x9cd20e){logger['info'](util[_0x369d('0x29')](_0x369d('0xb2'),_0x9cd20e['label']));if(this[_0x369d('0xa2')](_0x9cd20e[_0x369d('0x67')])){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0xb3'),_0x9cd20e[_0x369d('0x67')]));var _0x206af5=this[_0x369d('0xe')][_0x369d('0xb4')](_0x9cd20e[_0x369d('0x67')]);if(_0x206af5['result']===-0x1){return _0x206af5;}}return this[_0x369d('0xe')]['answer']();};AGIVertices[_0x369d('0x11')][_0x369d('0x4e')]=function(_0x524c74){logger['info'](util['format'](_0x369d('0xb5'),_0x524c74[_0x369d('0x3b')]));if(!this['isConfigured'](_0x524c74[_0x369d('0x4d')])){return this[_0x369d('0xe')]['error'](_0x524c74,_0x369d('0xb6'));}_0x524c74[_0x369d('0x50')]=moment();if(this[_0x369d('0xa2')](_0x524c74['delay'])){_0x524c74[_0x369d('0x50')]=moment()['add'](_0x524c74[_0x369d('0xb7')],_0x369d('0xb8'));}if(!this[_0x369d('0xa2')](_0x524c74[_0x369d('0x51')])){_0x524c74[_0x369d('0x51')]=0x2;}this[_0x369d('0x47')][_0x369d('0x6e')](this,_0x524c74);return this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x524c74[_0x369d('0x4c')],_0x524c74[_0x369d('0x4d')],_0x524c74[_0x369d('0x50')]));};AGIVertices[_0x369d('0x11')][_0x369d('0xb9')]=function(_0x3bf0ed){logger['info'](util[_0x369d('0x29')](_0x369d('0xba'),_0x3bf0ed['label']));var _0x156f3b=this[_0x369d('0xe')][_0x369d('0x5c')](_0x3bf0ed['application'],_0x3bf0ed[_0x369d('0x77')]);if(_0x156f3b[_0x369d('0xae')]===-0x1){return _0x156f3b;}return this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0xbb'),_0x3bf0ed[_0x369d('0xbc')],_0x3bf0ed['options']));};AGIVertices['prototype'][_0x369d('0xbd')]=function(_0x318713){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0xbe'),_0x318713[_0x369d('0x3b')]));if(!this[_0x369d('0xa2')](_0x318713[_0x369d('0x60')])){return this[_0x369d('0xe')]['noop']('no\x20text\x20configured');}var _0x148bd9='\x22'+_0x318713[_0x369d('0x60')]+'\x22';if(this[_0x369d('0xa2')](_0x318713[_0x369d('0x77')])){_0x148bd9+=','+_0x318713['options'];}var _0x298ac7=this[_0x369d('0xe')]['exec']('MRCPSynth',_0x148bd9);if(_0x298ac7[_0x369d('0xae')]===-0x1){return _0x298ac7;}return this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')]('Executed\x20command\x20MRCPSynth\x20%s',_0x148bd9));};AGIVertices['prototype'][_0x369d('0xbf')]=function(_0x41c18f){logger['info'](util['format'](_0x369d('0xc0'),_0x41c18f[_0x369d('0x3b')]));if(!this[_0x369d('0xa2')](_0x41c18f[_0x369d('0x60')])){return this[_0x369d('0xe')][_0x369d('0xa5')](_0x369d('0xa6'));}var _0x1b5825='\x22'+_0x41c18f[_0x369d('0x60')]+'\x22';if(this[_0x369d('0xa2')](_0x41c18f['options'])){_0x1b5825+=','+_0x41c18f[_0x369d('0x77')];}var _0x1c6c57=this[_0x369d('0xe')][_0x369d('0x5c')](_0x369d('0xa7'),_0x1b5825);if(_0x1c6c57['result']===-0x1){return _0x1c6c57;}return this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0xa8'),_0x1b5825));};AGIVertices[_0x369d('0x11')][_0x369d('0xc1')]=function(_0x50cd33){logger[_0x369d('0x2f')](util[_0x369d('0x29')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x50cd33['label']));if(!this['isConfigured'](_0x50cd33[_0x369d('0xab')])){return this[_0x369d('0xe')][_0x369d('0xa5')](_0x369d('0xac'));}var _0x5c7e4e=_0x50cd33[_0x369d('0xab')];if(this[_0x369d('0xa2')](_0x50cd33['options'])){_0x5c7e4e+=','+_0x50cd33[_0x369d('0x77')];}var _0x581fca=this[_0x369d('0xe')][_0x369d('0x5c')](_0x369d('0xc2'),_0x5c7e4e);if(_0x581fca[_0x369d('0xae')]===-0x1){return _0x581fca;}var _0x33f597=this[_0x369d('0xa0')](_0x369d('0xc3'),_0x369d('0xc4'));if(_0x33f597[_0x369d('0xae')]===-0x1){return _0x33f597;}var _0x1a670a=this[_0x369d('0xa0')](_0x369d('0xad'),_0x369d('0xc5'));if(_0x1a670a[_0x369d('0xae')]===-0x1){return _0x1a670a;}var _0x29ee69=this[_0x369d('0xa0')]('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x29ee69[_0x369d('0xae')]===-0x1){return _0x29ee69;}return this[_0x369d('0xe')]['noop'](util[_0x369d('0x29')]('Executed\x20command\x20MRCPRecog\x20%s',_0x5c7e4e));};AGIVertices[_0x369d('0x11')][_0x369d('0xc6')]=function(_0x2b0aa7){logger[_0x369d('0x2f')](util['format'](_0x369d('0xc7'),_0x2b0aa7[_0x369d('0x3b')]));if(!this[_0x369d('0xa2')](_0x2b0aa7[_0x369d('0xab')])){return this[_0x369d('0xe')]['noop'](_0x369d('0xac'));}var _0x20d5b3=_0x2b0aa7[_0x369d('0xab')];if(this[_0x369d('0xa2')](_0x2b0aa7[_0x369d('0x77')])){_0x20d5b3+=','+_0x2b0aa7['options'];}var _0x3579d9=this[_0x369d('0xe')][_0x369d('0x5c')](_0x369d('0xc2'),_0x20d5b3);if(_0x3579d9[_0x369d('0xae')]===-0x1){return _0x3579d9;}var _0x292311=this[_0x369d('0xa0')](_0x369d('0xc3'),_0x369d('0xc8'));if(_0x292311[_0x369d('0xae')]===-0x1){return _0x292311;}var _0xad2475=this[_0x369d('0xa0')]('RECOG_INPUT()',_0x369d('0xc9'));if(_0xad2475[_0x369d('0xae')]===-0x1){return _0xad2475;}var _0x5ad034=this[_0x369d('0xa0')](_0x369d('0xca'),_0x369d('0xcb'));if(_0x5ad034[_0x369d('0xae')]===-0x1){return _0x5ad034;}return this['channel'][_0x369d('0xa5')](util['format'](_0x369d('0xaf'),_0x20d5b3));};AGIVertices['prototype'][_0x369d('0xcc')]=function(_0x29402f){logger[_0x369d('0x2f')](util[_0x369d('0x29')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x29402f[_0x369d('0x3b')]));if(!this[_0x369d('0xa2')](_0x29402f[_0x369d('0xcd')])){return this[_0x369d('0xe')][_0x369d('0x2d')](_0x29402f,_0x369d('0xce'));}var _0x477ab2=this[_0x369d('0xcf')]['sync'](this,_0x29402f['odbc_id']);if(!_0x477ab2){return this[_0x369d('0xe')][_0x369d('0x2d')](_0x29402f,_0x369d('0xd0'));}if(!this['isConfigured'](_0x29402f[_0x369d('0x31')])){return this[_0x369d('0xe')][_0x369d('0x2d')](_0x29402f,'no\x20query\x20configured');}var _0x2771df=_0x29402f['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0xd1'),_0x2771df));var _0x31b546=this[_0x369d('0x2b')][_0x369d('0x6e')](this,_0x477ab2,_0x2771df);this[_0x369d('0x39')][_0x369d('0x6e')](this,_0x29402f,_0x2771df);if(!this[_0x369d('0xa2')](_0x29402f[_0x369d('0xd2')])){return this[_0x369d('0xe')][_0x369d('0xa5')](_0x369d('0xd3'));}var _0x3cf390=this[_0x369d('0x9d')][_0x369d('0x6e')](this,_0x29402f['variable_id']);if(!_0x3cf390){return this[_0x369d('0xe')][_0x369d('0x2d')](_0x29402f,_0x369d('0xd4'));}var _0x15ce05=this;_0x31b546[_0x369d('0xd5')](function(_0x5b978a,_0x45ea72){Object[_0x369d('0xd6')](_0x5b978a)[_0x369d('0xd5')](function(_0x2d58a2){_0x15ce05[_0x369d('0xe')]['setVariable'](util['format'](_0x369d('0xd7'),_0x3cf390,_0x45ea72,_0x2d58a2),_0x5b978a[_0x2d58a2]);});});this[_0x369d('0xe')][_0x369d('0x98')](util[_0x369d('0x29')](_0x369d('0xd8'),_0x3cf390),_0x31b546[_0x369d('0x9a')]);return this[_0x369d('0xe')][_0x369d('0xa5')](util['format'](_0x369d('0xd9'),_0x3cf390));};AGIVertices[_0x369d('0x11')][_0x369d('0xda')]=function(_0x2a4869){logger[_0x369d('0xdb')](util[_0x369d('0x29')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x2a4869['label']));if(!this[_0x369d('0xa2')](_0x2a4869[_0x369d('0xdc')])){return this[_0x369d('0xe')][_0x369d('0x2d')](_0x2a4869,_0x369d('0xdd'));}var _0x40f545=this[_0x369d('0x1b')][_0x369d('0x6e')](this,_0x2a4869[_0x369d('0xdc')]);if(!_0x40f545){return this[_0x369d('0xe')][_0x369d('0x2d')](_0x2a4869,_0x369d('0xde'));}var _0x3be990=this[_0x369d('0xe')][_0x369d('0x5c')](_0x369d('0xdf'),[util[_0x369d('0x29')](_0x369d('0xe0'),_0x40f545),_0x2a4869['timeout'],_0x2a4869[_0x369d('0xe1')],_0x2a4869[_0x369d('0x65')]]);if(_0x3be990[_0x369d('0xae')]===-0x1){return _0x3be990;}return this[_0x369d('0xe')][_0x369d('0xa5')](util['format']('Executed\x20command\x20%s',_0x369d('0xdf')));};AGIVertices[_0x369d('0x11')][_0x369d('0xe2')]=function(_0x35d8c6){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0xe3'),_0x35d8c6['label']));if(!this[_0x369d('0xa2')](_0x35d8c6[_0x369d('0x79')])){return this[_0x369d('0xe')][_0x369d('0xa5')](_0x369d('0xe4'));}if(!this[_0x369d('0xa2')](_0x35d8c6[_0x369d('0x60')])){return this['channel'][_0x369d('0xa5')](_0x369d('0xa6'));}this['channel'][_0x369d('0xe5')]=!![];this['createSquareDetailsReport'](_0x35d8c6);this['createSquareMessage'](_0x35d8c6[_0x369d('0x60')],'in','','');this['channel'][_0x369d('0xa5')](util['format'](_0x369d('0xe6'),_0x35d8c6[_0x369d('0x60')]));var _0x1a220f=this[_0x369d('0x78')][_0x369d('0x6e')](this,_0x35d8c6);if(_0x1a220f){for(var _0x4060f9 in _0x1a220f){if(_0x1a220f['hasOwnProperty'](_0x4060f9)){this[_0x369d('0xe')][_0x369d('0x98')](util[_0x369d('0x29')]('DIALOGFLOW_%s',_0x4060f9[_0x369d('0xe7')]()),_0x1a220f[_0x4060f9]);}}this[_0x369d('0x46')](_0x1a220f[_0x369d('0xe8')],'out',_0x369d('0xe2'),'');return this[_0x369d('0xe')][_0x369d('0xa5')](util['format']('Dialogflow\x20Result\x20%s',_0x1a220f[_0x369d('0xe8')]));}return this[_0x369d('0xe')]['error'](_0x35d8c6,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x369d('0x11')]['dialogflowV2']=function(_0x75012d){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0xe9'),_0x75012d['label']));if(!this[_0x369d('0xa2')](_0x75012d[_0x369d('0x7c')])){return this['channel'][_0x369d('0xa5')](_0x369d('0xea'));}if(!this[_0x369d('0xa2')](_0x75012d[_0x369d('0xeb')])){return this[_0x369d('0xe')][_0x369d('0xa5')]('no\x20client_email\x20configured');}if(!this[_0x369d('0xa2')](_0x75012d['private_key'])){return this['channel']['noop']('no\x20private_key\x20configured');}if(!this[_0x369d('0xa2')](_0x75012d[_0x369d('0x7e')])){return this[_0x369d('0xe')]['noop'](_0x369d('0xec'));}if(!this[_0x369d('0xa2')](_0x75012d[_0x369d('0x60')])){return this['channel']['noop'](_0x369d('0xa6'));}this[_0x369d('0xe')][_0x369d('0xe5')]=!![];this[_0x369d('0x39')](_0x75012d);this['createSquareMessage'](_0x75012d['text'],'in','','');this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')]('Trying\x20DialogflowV2:\x20%s',_0x75012d[_0x369d('0x60')]));var _0x3ad4af=this[_0x369d('0x7b')]['sync'](this,_0x75012d);if(_0x3ad4af){for(var _0x2fb4ea in _0x3ad4af){if(_0x3ad4af['hasOwnProperty'](_0x2fb4ea)){if(_0x2fb4ea!==_0x369d('0xed')){this['channel'][_0x369d('0x98')](util['format']('DIALOGFLOW_%s',_0x2fb4ea[_0x369d('0xe7')]()),_0x3ad4af[_0x2fb4ea]);}}}this[_0x369d('0x46')](_0x3ad4af['speech'],'out','dialogflowV2',_0x3ad4af[_0x369d('0xed')]);return this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')]('DialogflowV2\x20Result\x20%s',_0x3ad4af[_0x369d('0xe8')]));}return this[_0x369d('0xe')][_0x369d('0x2d')](_0x75012d,_0x369d('0xee'));};AGIVertices[_0x369d('0x11')][_0x369d('0xef')]=function(_0x581015){logger['info'](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x581015[_0x369d('0x3b')]));if(!this[_0x369d('0xa2')](_0x581015[_0x369d('0xf0')])){return this[_0x369d('0xe')][_0x369d('0xa5')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x369d('0xa2')](_0x581015[_0x369d('0xf1')])){return this['channel'][_0x369d('0xa5')]('no\x20username\x20configured');}if(!this['isConfigured'](_0x581015[_0x369d('0xf2')])){return this[_0x369d('0xe')][_0x369d('0xa5')](_0x369d('0xf3'));}if(!this[_0x369d('0xa2')](_0x581015[_0x369d('0xf4')])){return this[_0x369d('0xe')]['noop'](_0x369d('0xa6'));}this['channel'][_0x369d('0xe5')]=!![];this[_0x369d('0x39')](_0x581015);this[_0x369d('0x46')](_0x581015[_0x369d('0x60')],'in','','');this[_0x369d('0xe')][_0x369d('0xa5')](util['format'](_0x369d('0xf5'),_0x581015[_0x369d('0x60')]));var _0x2ddf26=this[_0x369d('0x7f')]['sync'](this,_0x581015);if(_0x2ddf26){for(var _0x1afac5 in _0x2ddf26){if(_0x2ddf26[_0x369d('0x90')](_0x1afac5)){this[_0x369d('0xe')][_0x369d('0x98')](util[_0x369d('0x29')](_0x369d('0xf6'),_0x1afac5[_0x369d('0xe7')]()),_0x2ddf26[_0x1afac5]);}}this[_0x369d('0x46')](_0x2ddf26[_0x369d('0xe8')],_0x369d('0xf7'),_0x369d('0xef'),'');if(_0x2ddf26[_0x369d('0xf8')]){this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0xf9'),_0x2ddf26[_0x369d('0xf8')]));var _0xc10a38=this[_0x369d('0xe')][_0x369d('0xfa')](_0x2ddf26['audiofile']);try{fs[_0x369d('0xfb')](_0x2ddf26[_0x369d('0xf8')]+_0x369d('0xfc'));}catch(_0x13fd3c){logger['error'](_0x13fd3c);}return _0xc10a38;}else{return this[_0x369d('0xe')][_0x369d('0xa5')](util['format'](_0x369d('0xfd'),_0x2ddf26['speech']));}}return this['channel']['error'](_0x581015,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x369d('0x11')]['end']=function(_0xad8fa6){logger[_0x369d('0x2f')](util[_0x369d('0x29')]('Enter\x20in\x20END\x20(%s)\x20block',_0xad8fa6[_0x369d('0x3b')]));return this[_0x369d('0xe')]['noop'](_0x369d('0xfe'));};AGIVertices[_0x369d('0x11')][_0x369d('0xff')]=function(_0x31f8ed){logger['info'](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x31f8ed['label']));var _0x51e74e='';if(_0x31f8ed[_0x369d('0x100')]){if(!this[_0x369d('0xa2')](_0x31f8ed[_0x369d('0x100')])){return this[_0x369d('0xe')][_0x369d('0x2d')](_0x31f8ed,_0x369d('0x101'));}else{var _0x1dbb39=parseInt(_0x31f8ed[_0x369d('0x100')],0xa);if(isNaN(_0x1dbb39)){_0x51e74e=_0x31f8ed[_0x369d('0x100')];}else{_0x51e74e=this[_0x369d('0x1c')][_0x369d('0x6e')](this,_0x31f8ed[_0x369d('0x100')]);if(!_0x51e74e){return this[_0x369d('0xe')][_0x369d('0x2d')](_0x31f8ed,_0x369d('0x102'));}}}}else if(_0x31f8ed[_0x369d('0x103')]){_0x51e74e=_0x31f8ed[_0x369d('0x103')];}else{return this['channel'][_0x369d('0x2d')](_0x31f8ed,_0x369d('0x101'));}var _0x34178c=this['channel'][_0x369d('0x5c')](_0x369d('0xdf'),[util['format'](_0x369d('0x104'),_0x51e74e,_0x31f8ed[_0x369d('0x4c')]),_0x31f8ed[_0x369d('0x67')],_0x31f8ed['opts'],_0x31f8ed['url']]);if(_0x34178c[_0x369d('0xae')]===-0x1){return _0x34178c;}return this[_0x369d('0xe')]['noop'](util['format'](_0x369d('0x105'),_0x369d('0xdf')));};AGIVertices[_0x369d('0x11')][_0x369d('0x106')]=function(_0x1e7895){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x107'),_0x1e7895['label']));return this[_0x369d('0xe')][_0x369d('0xa5')](_0x369d('0x106'));};AGIVertices[_0x369d('0x11')]['getdigits']=function(_0x35dcc2){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x108'),_0x35dcc2[_0x369d('0x3b')]));if(_0x35dcc2[_0x369d('0xa3')]===0x0){return this[_0x369d('0xa4')](_0x35dcc2);}_0x35dcc2['retry']-=0x1;if(!this['isConfigured'](_0x35dcc2[_0x369d('0x109')])){return this[_0x369d('0xe')][_0x369d('0x2d')](_0x35dcc2,'no\x20file\x20audio\x20selected');}var _0x115424=this[_0x369d('0x10a')][_0x369d('0x6e')](this,_0x35dcc2[_0x369d('0x109')]);if(!_0x115424){return this[_0x369d('0xe')]['error'](_0x35dcc2,_0x369d('0x10b'));}if(!this[_0x369d('0xa2')](_0x35dcc2[_0x369d('0xd2')])){return this[_0x369d('0xe')][_0x369d('0x2d')](_0x369d('0xd3'));}var _0x381af0=this[_0x369d('0xe')][_0x369d('0x10c')](_0x115424,_0x35dcc2[_0x369d('0x10d')],_0x35dcc2['maxdigit']);var _0x57bca5=_0x381af0['result']?_0x381af0[_0x369d('0xae')][_0x369d('0x9f')]():'';logger[_0x369d('0x2f')]('test',JSON[_0x369d('0x72')](_0x381af0));if(_0x381af0[_0x369d('0xae')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x35dcc2,_0x57bca5);return _0x381af0;}else if(_0x381af0[_0x369d('0x9e')]===_0x369d('0x67')){_0x381af0['result']=_0x57bca5[_0x369d('0x9a')]>=parseInt(_0x35dcc2[_0x369d('0x10e')])?'x':'i';}else{_0x381af0[_0x369d('0xae')]=_0x57bca5[_0x369d('0x9a')]>=parseInt(_0x35dcc2[_0x369d('0x10e')])&&_0x57bca5[_0x369d('0x9a')]<=parseInt(_0x35dcc2['maxdigit'])?'x':'i';}var _0x300005=this[_0x369d('0x9d')][_0x369d('0x6e')](this,_0x35dcc2[_0x369d('0xd2')]);if(!_0x300005){return this['channel']['error'](_0x35dcc2,_0x369d('0xd4'));}this[_0x369d('0xe')][_0x369d('0x98')](_0x300005,_0x57bca5);if(this['isConfigured'](_0x35dcc2[_0x369d('0x10f')])){var _0xc9ec47=parseInt(_0x35dcc2[_0x369d('0x10f')],0xa);var _0x2eb877=rs[_0x369d('0x110')]({'charset':'*','length':_0xc9ec47});var _0x1642a=_0x57bca5[_0x369d('0x9a')];if(_0x1642a>0x0){if(_0x1642a>_0xc9ec47){this['createSquareDetailsReport'][_0x369d('0x6e')](this,_0x35dcc2,_0x35dcc2[_0x369d('0x111')]==='first'?_0x2eb877+_0x57bca5[_0x369d('0x112')](_0xc9ec47):_0x57bca5['substr'](0x0,_0x1642a-_0xc9ec47)+_0x2eb877);}else{this[_0x369d('0x39')]['sync'](this,_0x35dcc2,rs['generate']({'charset':'*','length':_0x1642a}));}}else{this[_0x369d('0x39')][_0x369d('0x6e')](this,_0x35dcc2,'');}}else{this[_0x369d('0x39')][_0x369d('0x6e')](this,_0x35dcc2,_0x57bca5);}return _0x381af0;};AGIVertices[_0x369d('0x11')][_0x369d('0xd')]=function(_0x2ed048){logger[_0x369d('0x2f')](util[_0x369d('0x29')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x2ed048['label']));return this[_0x369d('0xc')](_0x2ed048);};AGIVertices[_0x369d('0x11')]['goal']=function(_0x444b96){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x113'),_0x444b96[_0x369d('0x3b')]));this[_0x369d('0x39')][_0x369d('0x6e')](this,_0x444b96,_0x444b96[_0x369d('0x114')]);return this['channel'][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0x115'),_0x444b96[_0x369d('0x114')]));};AGIVertices[_0x369d('0x11')][_0x369d('0x116')]=function(_0x2fe2ed){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x117'),_0x2fe2ed['label']));if(!this[_0x369d('0xa2')](_0x2fe2ed[_0x369d('0x85')])||!this['isConfigured'](_0x2fe2ed[_0x369d('0x86')])){return this[_0x369d('0xe')][_0x369d('0xa5')](_0x369d('0x118'));}if(!this[_0x369d('0xa2')](_0x2fe2ed[_0x369d('0x60')])){return this[_0x369d('0xe')]['noop'](_0x369d('0xa6'));}this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0x119'),_0x2fe2ed[_0x369d('0x60')]));var _0x2adaa9=this[_0x369d('0x84')][_0x369d('0x6e')](this,_0x2fe2ed);if(_0x2adaa9){this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')]('aws\x20Polly\x20%s\x20file\x20created',_0x2adaa9));var _0x49d036=this[_0x369d('0xe')]['streamFile'](_0x2adaa9);try{fs[_0x369d('0xfb')](_0x2adaa9+_0x369d('0xfc'));}catch(_0x100d89){logger['error'](_0x100d89);}return _0x49d036;}return this[_0x369d('0xe')]['error'](_0x2fe2ed,_0x369d('0x11a'));};AGIVertices['prototype'][_0x369d('0x11b')]=function(_0x166973){logger['info'](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x166973[_0x369d('0x3b')]));if(!this[_0x369d('0xa2')](_0x166973[_0x369d('0x85')])||!this[_0x369d('0xa2')](_0x166973[_0x369d('0x86')])){return this[_0x369d('0xe')][_0x369d('0xa5')](_0x369d('0x118'));}if(!this[_0x369d('0xa2')](_0x166973['aws_bot_name'])){return this[_0x369d('0xe')][_0x369d('0xa5')](_0x369d('0x11c'));}if(!this[_0x369d('0xa2')](_0x166973[_0x369d('0x60')])){return this[_0x369d('0xe')]['noop'](_0x369d('0xa6'));}this[_0x369d('0xe')][_0x369d('0xe5')]=!![];this[_0x369d('0x39')](_0x166973);this[_0x369d('0x46')](_0x166973['text'],'in','','');this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')]('Trying\x20Amazon\x20Lex:\x20%s',_0x166973[_0x369d('0x60')]));var _0x331863=this['awsLex']['sync'](this,_0x166973);if(_0x331863){for(var _0x3e5018 in _0x331863){if(_0x331863[_0x369d('0x90')](_0x3e5018)&&_['isString'](_0x331863[_0x3e5018])){this[_0x369d('0xe')][_0x369d('0x98')](util[_0x369d('0x29')]('AWS_LEX_%s',_0x3e5018[_0x369d('0xe7')]()),_0x331863[_0x3e5018]);}}if(_['isNil'](_0x331863[_0x369d('0x75')])){return this[_0x369d('0xe')][_0x369d('0xa5')](_0x369d('0x11d'));}else{this[_0x369d('0x46')](_0x331863[_0x369d('0x75')],_0x369d('0xf7'),_0x369d('0x11e'),'');return this[_0x369d('0xe')][_0x369d('0xa5')](util['format']('Amazon\x20Lex\x20Result\x20%s',_0x331863[_0x369d('0x75')]));}}return this['channel'][_0x369d('0x2d')](_0x166973,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x369d('0x11')][_0x369d('0x11f')]=function(_0x42db0d){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x120'),_0x42db0d['label'],_0x42db0d['timeout']));if(!this['isConfigured'](_0x42db0d[_0x369d('0x79')])){return this[_0x369d('0xe')][_0x369d('0xa5')](_0x369d('0xe4'));}var _0x5717f0=_0x369d('0x121');var _0x54def6=util[_0x369d('0x29')](_0x369d('0x122'),FILES_PATH,rs[_0x369d('0x110')](0x4));var _0x1660dc=util[_0x369d('0x29')](_0x369d('0x97'),_0x54def6,_0x5717f0);var _0x396eab=!![];if(_0x42db0d[_0x369d('0x123')]===_0x369d('0x124')){_0x396eab=![];}var _0xce441a=this[_0x369d('0xe')][_0x369d('0x125')](_0x54def6,_0x5717f0,_0x42db0d['intKey'],_0x42db0d[_0x369d('0x67')],undefined,_0x396eab);if(_0xce441a['result']!==-0x1){this[_0x369d('0xe')][_0x369d('0xa5')](util['format']('google\x20%s\x20file\x20created',_0x1660dc));var _0x3a6b79=this[_0x369d('0x8b')][_0x369d('0x6e')](this,_0x42db0d,_0x1660dc);if(_0x3a6b79){for(var _0x9fa51 in _0x3a6b79){if(_0x3a6b79[_0x369d('0x90')](_0x9fa51)){this[_0x369d('0xe')][_0x369d('0x98')](util[_0x369d('0x29')](_0x369d('0x126'),_0x9fa51[_0x369d('0xe7')]()),_0x3a6b79[_0x9fa51]);}}return this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0x127'),JSON[_0x369d('0x72')](_0x3a6b79)));}}return _0xce441a;};AGIVertices[_0x369d('0x11')][_0x369d('0x128')]=function(_0x4ee43f){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x129'),_0x4ee43f[_0x369d('0x3b')]));if(!this[_0x369d('0xa2')](_0x4ee43f[_0x369d('0x8e')])){return this[_0x369d('0xe')][_0x369d('0xa5')](_0x369d('0x12a'));}if(!this['isConfigured'](_0x4ee43f['appsecret'])){return this[_0x369d('0xe')][_0x369d('0xa5')](_0x369d('0x12b'));}var _0x39682d=_0x369d('0x121');var _0x3cade3=util[_0x369d('0x29')](_0x369d('0x122'),FILES_PATH,rs[_0x369d('0x110')](0x4));var _0xbb9b48=util[_0x369d('0x29')](_0x369d('0x97'),_0x3cade3,_0x39682d);var _0x13a30c=!![];if(_0x4ee43f[_0x369d('0x123')]===_0x369d('0x124')){_0x13a30c=![];}var _0x1ef86d=this[_0x369d('0xe')][_0x369d('0x125')](_0x3cade3,_0x39682d,_0x4ee43f[_0x369d('0x12c')],_0x4ee43f['timeout'],undefined,_0x13a30c);if(_0x1ef86d[_0x369d('0xae')]!==-0x1){this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0x12d'),_0xbb9b48));var _0x322ee3=this[_0x369d('0x8d')][_0x369d('0x6e')](this,_0x4ee43f,_0xbb9b48);if(_0x322ee3){for(var _0x5957d9 in _0x322ee3){if(_0x322ee3[_0x369d('0x90')](_0x5957d9)){this[_0x369d('0xe')]['setVariable'](util['format'](_0x369d('0x12e'),_0x5957d9['toUpperCase']()),_0x322ee3[_0x5957d9]);}}return this['channel'][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0x12f'),JSON['stringify'](_0x322ee3)));}}return _0x1ef86d;};AGIVertices[_0x369d('0x11')][_0x369d('0x130')]=function(_0x6c2a79){logger['info'](util[_0x369d('0x29')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x6c2a79['label']));return this['channel'][_0x369d('0x131')](_0x6c2a79[_0x369d('0x40')],_0x6c2a79[_0x369d('0x41')],_0x6c2a79[_0x369d('0x42')]);};AGIVertices[_0x369d('0x11')][_0x369d('0x132')]=function(_0x5460fa){logger['info'](util[_0x369d('0x29')](_0x369d('0x133'),_0x5460fa[_0x369d('0x3b')]));if(!this[_0x369d('0xa2')](_0x5460fa[_0x369d('0x134')])){return this['channel'][_0x369d('0x2d')](_0x5460fa,'no\x20condition\x20configured');}try{var _0xd632c5=eval(_0x5460fa[_0x369d('0x134')])?_0x369d('0x135'):_0x369d('0x136');this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0x137'),_0x5460fa[_0x369d('0x134')],_0xd632c5));return{'code':0xc8,'result':_0xd632c5};}catch(_0x3f1629){return{'code':0xc8,'result':_0x369d('0x136')};}};AGIVertices['prototype'][_0x369d('0x138')]=function(_0xbcf60c){logger[_0x369d('0x2f')](util['format'](_0x369d('0x139'),_0xbcf60c[_0x369d('0x3b')]));if(!this[_0x369d('0xa2')](_0xbcf60c[_0x369d('0x13a')])){return this[_0x369d('0xe')][_0x369d('0x2d')](_0xbcf60c,'no\x20interval\x20configured');}var _0x3ba123=this['getIntervals'][_0x369d('0x6e')](this,_0xbcf60c[_0x369d('0x13a')]);if(!_0x3ba123){return this['channel'][_0x369d('0x2d')](_0xbcf60c,_0x369d('0x13b'));}for(var _0x545b14=0x0;_0x545b14<_0x3ba123['length'];_0x545b14+=0x1){var _0x56ed75=this[_0x369d('0xe')][_0x369d('0x9d')](util['format'](_0x369d('0x13c'),_0x3ba123[_0x545b14]));if(_0x56ed75[_0x369d('0xae')]===-0x1){return _0x56ed75;}logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x13d'),_0x3ba123[_0x545b14],_0x56ed75[_0x369d('0x9e')]));if(_0x56ed75[_0x369d('0x9e')]===_0x369d('0x135')){logger[_0x369d('0x2f')](util['format'](_0x369d('0x13d'),_0x3ba123[_0x545b14],'true'));this[_0x369d('0xe')][_0x369d('0xa5')](util['format']('IFTIME\x20%s\x20%s',_0x3ba123[_0x545b14],_0x369d('0x135')));return{'code':0xc8,'result':'true'};}else{logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x13d'),_0x3ba123[_0x545b14],_0x369d('0x136')));this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0x13d'),_0x3ba123[_0x545b14],_0x369d('0x136')));}}return{'code':0xc8,'result':_0x369d('0x136')};};AGIVertices['prototype'][_0x369d('0x13e')]=function(_0x355c26){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x13f'),_0x355c26[_0x369d('0x3b')]));return this[_0x369d('0xe')]['hangup']();};AGIVertices[_0x369d('0x11')]['ispeechasr']=function(_0x4192fb){logger[_0x369d('0x2f')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x4192fb[_0x369d('0x3b')]));if(!this['isConfigured'](_0x4192fb[_0x369d('0x79')])){return this['channel'][_0x369d('0xa5')]('no\x20key\x20configured');}var _0x43cd66='wav';var _0x1c6e7c=util[_0x369d('0x29')](_0x369d('0x122'),FILES_PATH,rs[_0x369d('0x110')](0x4));var _0x586a88=util[_0x369d('0x29')]('%s.%s',_0x1c6e7c,_0x43cd66);var _0x3444b1=!![];if(_0x4192fb[_0x369d('0x123')]===_0x369d('0x124')){_0x3444b1=![];}var _0x284230=this[_0x369d('0xe')][_0x369d('0x125')](_0x1c6e7c,_0x43cd66,_0x4192fb['intKey'],_0x4192fb[_0x369d('0x67')],undefined,_0x3444b1);if(_0x284230[_0x369d('0xae')]!==-0x1){this['channel']['noop'](util[_0x369d('0x29')](_0x369d('0x140'),_0x586a88));var _0x398e08=this[_0x369d('0x81')][_0x369d('0x6e')](this,_0x4192fb,_0x586a88);if(_0x398e08){for(var _0x4eac91 in _0x398e08){if(_0x398e08[_0x369d('0x90')](_0x4eac91)){this[_0x369d('0xe')][_0x369d('0x98')](util[_0x369d('0x29')](_0x369d('0x141'),_0x4eac91[_0x369d('0xe7')]()),_0x398e08[_0x4eac91]);}}return this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0x142'),JSON[_0x369d('0x72')](_0x398e08)));}}return _0x284230;};AGIVertices[_0x369d('0x11')][_0x369d('0x143')]=function(_0x12eddf){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x144'),_0x12eddf[_0x369d('0x3b')]));if(!this[_0x369d('0xa2')](_0x12eddf['key'])){return this['channel']['noop'](_0x369d('0xe4'));}if(!this[_0x369d('0xa2')](_0x12eddf[_0x369d('0x60')])){return this[_0x369d('0xe')]['noop']('no\x20text\x20configured');}this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')]('Trying\x20ispeech\x20TTS\x20%s',_0x12eddf[_0x369d('0x60')]));var _0xf919c4=this[_0x369d('0x80')][_0x369d('0x6e')](this,_0x12eddf);if(_0xf919c4){this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0x140'),_0xf919c4));var _0x3d6e49=this[_0x369d('0xe')][_0x369d('0xfa')](_0xf919c4,_0x12eddf[_0x369d('0x12c')]);try{fs[_0x369d('0xfb')](_0xf919c4+_0x369d('0xfc'));}catch(_0x522a18){logger[_0x369d('0x2d')](_0x522a18);}return _0x3d6e49;}return this[_0x369d('0xe')][_0x369d('0x2d')](_0x12eddf,_0x369d('0x145'));};AGIVertices[_0x369d('0x11')][_0x369d('0x146')]=function(_0xbd6635){logger['info'](util['format']('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0xbd6635['label']));if(!this[_0x369d('0xa2')](_0xbd6635[_0x369d('0x147')])){return this[_0x369d('0xe')][_0x369d('0x2d')](_0xbd6635,_0x369d('0x148'));}logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x149'),this[_0x369d('0xe')][_0x369d('0x3e')],_0xbd6635['findBy']));var _0x401d2a=this[_0x369d('0x57')]['sync'](this,_0xbd6635[_0x369d('0x147')]);if(_0x401d2a){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x369d('0xe')][_0x369d('0x3e')],_0xbd6635[_0x369d('0x147')]));this[_0x369d('0xe')][_0x369d('0xa5')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x369d('0xe')]['callerid'],_0xbd6635['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x369d('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x369d('0xe')][_0x369d('0x3e')],_0xbd6635[_0x369d('0x147')]));this[_0x369d('0xe')][_0x369d('0xa5')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x369d('0xe')][_0x369d('0x3e')],_0xbd6635['findBy']));return{'code':0xc8,'result':_0x369d('0x14a')};}};AGIVertices[_0x369d('0x11')][_0x369d('0x14b')]=function(_0x44074f){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x14c'),_0x44074f['label']));if(!this['isConfigured'](_0x44074f[_0x369d('0x147')])){return this[_0x369d('0xe')]['error'](_0x44074f,_0x369d('0x148'));}logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x149'),this['channel'][_0x369d('0x3e')],_0x44074f[_0x369d('0x147')]));var _0x434a24=this[_0x369d('0x56')][_0x369d('0x6e')](this,_0x44074f[_0x369d('0x147')]);if(_0x434a24){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x14d'),this[_0x369d('0xe')]['callerid'],_0x44074f['findBy']));this['channel'][_0x369d('0xa5')](util['format'](_0x369d('0x14d'),this[_0x369d('0xe')]['callerid'],_0x44074f[_0x369d('0x147')]));return{'code':0xc8,'result':_0x369d('0x14e')};}else{logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x14f'),this[_0x369d('0xe')][_0x369d('0x3e')],_0x44074f['findBy']));this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x369d('0xe')]['callerid'],_0x44074f[_0x369d('0x147')]));return{'code':0xc8,'result':_0x369d('0x14a')};}};AGIVertices[_0x369d('0x11')][_0x369d('0x150')]=function(_0x41c993){logger[_0x369d('0x2f')](util['format'](_0x369d('0x151'),_0x41c993[_0x369d('0x3b')]));if(!this[_0x369d('0xa2')](_0x41c993[_0x369d('0x152')])){return this[_0x369d('0xe')][_0x369d('0x2d')](_0x41c993,_0x369d('0x153'));}this[_0x369d('0xe')][_0x369d('0xa5')](util['format'](_0x369d('0x154'),_0x41c993['operation']));var _0x464be4=eval(_0x41c993[_0x369d('0x152')]);if(!this[_0x369d('0xa2')](_0x41c993[_0x369d('0xd2')])){return this['channel'][_0x369d('0xa5')](_0x369d('0xd3'));}var _0x5ebccf=this[_0x369d('0x9d')][_0x369d('0x6e')](this,_0x41c993[_0x369d('0xd2')]);if(!_0x5ebccf){return this['channel'][_0x369d('0x2d')](_0x41c993,_0x369d('0xd4'));}if(_[_0x369d('0x94')](_0x464be4)){var _0xc643ee=this;_0x464be4[_0x369d('0xd5')](function(_0x3ae75c,_0x3c0784){_0xc643ee[_0x369d('0xe')]['setVariable'](util[_0x369d('0x29')]('%s[%s]',_0x5ebccf,_0x3c0784),_0x3ae75c);});return this[_0x369d('0xe')][_0x369d('0xa5')](util['format'](_0x369d('0x155'),_0x5ebccf));}else{return this[_0x369d('0xe')][_0x369d('0x98')](_0x5ebccf,_0x464be4);}};AGIVertices[_0x369d('0x11')]['menu']=function(_0x7cf772){logger['info'](util[_0x369d('0x29')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x7cf772[_0x369d('0x3b')]));if(_0x7cf772[_0x369d('0xa3')]===0x0){return this['maxRetry'](_0x7cf772);}_0x7cf772[_0x369d('0xa3')]-=0x1;if(!this[_0x369d('0xa2')](_0x7cf772['file_id'])){return this[_0x369d('0xe')]['error'](_0x7cf772,_0x369d('0x156'));}var _0x31a3a4=this[_0x369d('0x10a')][_0x369d('0x6e')](this,_0x7cf772[_0x369d('0x109')]);if(!_0x31a3a4){return this[_0x369d('0xe')]['error'](_0x7cf772,_0x369d('0x10b'));}var _0x44a626=this['channel'][_0x369d('0x10c')](_0x31a3a4,_0x7cf772[_0x369d('0x10d')],_0x7cf772[_0x369d('0x157')]);var _0x358e0f=_0x44a626[_0x369d('0xae')];if(_0x44a626[_0x369d('0xae')]===-0x1){this[_0x369d('0x39')][_0x369d('0x6e')](this,_0x7cf772,'-1');return _0x44a626;}else if(_0x44a626[_0x369d('0x9e')]===_0x369d('0x67')){_0x44a626[_0x369d('0xae')]=_0x44a626[_0x369d('0xae')][_0x369d('0x9a')]>0x0?_0x44a626[_0x369d('0xae')]:'t';}else if(_['isEmpty'](_0x44a626[_0x369d('0xae')])){_0x44a626[_0x369d('0xae')]='#';_0x358e0f='#';}if(!this[_0x369d('0xa2')](_0x7cf772[_0x369d('0xd2')])){this[_0x369d('0xe')]['noop'](_0x369d('0xd3'));}else{var _0x2397d8=this[_0x369d('0x9d')][_0x369d('0x6e')](this,_0x7cf772[_0x369d('0xd2')]);if(!_0x2397d8){return this[_0x369d('0xe')][_0x369d('0x2d')](_0x7cf772,'no\x20variable\x20found');}this['channel'][_0x369d('0x98')](_0x2397d8,_0x358e0f);}this[_0x369d('0x39')]['sync'](this,_0x7cf772,_0x358e0f);return _0x44a626;};AGIVertices[_0x369d('0x11')][_0x369d('0xa5')]=function(_0x5be488){logger[_0x369d('0x2f')](util['format'](_0x369d('0x158'),_0x5be488['label']));return this[_0x369d('0xe')][_0x369d('0xa5')](_0x5be488[_0x369d('0x159')]||_0x5be488[_0x369d('0x3b')]);};AGIVertices['prototype'][_0x369d('0x15a')]=function(_0x1f7f2c){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x15b'),_0x1f7f2c[_0x369d('0x3b')]));if(!this[_0x369d('0xa2')](_0x1f7f2c[_0x369d('0x147')])){return this[_0x369d('0xe')]['error'](_0x1f7f2c,_0x369d('0x148'));}logger[_0x369d('0x2f')](util['format'](_0x369d('0x149'),this[_0x369d('0xe')]['callerid'],_0x1f7f2c['findBy']));var _0x1124bd=this[_0x369d('0x52')][_0x369d('0x6e')](this,_0x1f7f2c[_0x369d('0x15c')]);var _0x5ad68f=this[_0x369d('0x54')]['sync'](this,_0x1f7f2c[_0x369d('0x147')],_0x1124bd);if(_0x5ad68f){logger[_0x369d('0x2f')](util[_0x369d('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x369d('0xe')]['callerid'],_0x1f7f2c[_0x369d('0x147')]));this[_0x369d('0xe')]['noop'](util['format'](_0x369d('0x14d'),this['channel'][_0x369d('0x3e')],_0x1f7f2c[_0x369d('0x147')]));return{'code':0xc8,'result':_0x369d('0x14e')};}else{logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x14f'),this['channel']['callerid'],_0x1f7f2c[_0x369d('0x147')]));this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0x14d'),this[_0x369d('0xe')]['callerid'],_0x1f7f2c[_0x369d('0x147')]));return{'code':0xc8,'result':_0x369d('0x14a')};}};AGIVertices[_0x369d('0x11')]['playback']=function(_0x5e5833){logger[_0x369d('0x2f')](util['format'](_0x369d('0x15d'),_0x5e5833[_0x369d('0x3b')]));if(!this[_0x369d('0xa2')](_0x5e5833[_0x369d('0x109')])){return this['channel']['error'](_0x5e5833,_0x369d('0x156'));}var _0x5cd65b=this[_0x369d('0x10a')]['sync'](this,_0x5e5833[_0x369d('0x109')]);if(!_0x5cd65b){return this[_0x369d('0xe')][_0x369d('0x2d')](_0x5e5833,'no\x20file\x20audio\x20found');}var _0x26a645=this[_0x369d('0xe')][_0x369d('0x5c')](_0x369d('0x15e'),[_0x5cd65b,_0x5e5833[_0x369d('0xe1')]]);if(_0x26a645['result']===-0x1){return _0x26a645;}return this[_0x369d('0xe')]['noop'](util[_0x369d('0x29')](_0x369d('0xbb'),'PLAYBACK',_0x5cd65b));};AGIVertices['prototype'][_0x369d('0x15f')]=function(_0x27c944){logger[_0x369d('0x2f')](util[_0x369d('0x29')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x27c944['label']));if(!this[_0x369d('0xa2')](_0x27c944[_0x369d('0x160')])){return this[_0x369d('0xe')][_0x369d('0x2d')](_0x27c944,_0x369d('0x161'));}var _0x5aaaac='';var _0x18b443=parseInt(_0x27c944['queue_id'],0xa);if(isNaN(_0x18b443)){_0x5aaaac=_0x27c944['queue_id'];}else{_0x5aaaac=this['getVoiceQueue'][_0x369d('0x6e')](this,_0x27c944['queue_id']);if(!_0x5aaaac){return this[_0x369d('0xe')]['error'](_0x27c944,'no\x20queue\x20found');}}var _0x86ace4='';if(this[_0x369d('0xa2')](_0x27c944[_0x369d('0x109')])){var _0x5d7912=this[_0x369d('0x10a')][_0x369d('0x6e')](this,_0x27c944['file_id']);if(_0x5d7912){_0x86ace4=_0x5d7912;}}this[_0x369d('0x39')][_0x369d('0x6e')](this,_0x27c944,_0x5aaaac);if(_0x27c944[_0x369d('0xe1')][_0x369d('0x162')]('x')<0x0){_0x27c944[_0x369d('0xe1')]+='x';}if(_0x27c944[_0x369d('0xe1')][_0x369d('0x162')]('X')<0x0){_0x27c944[_0x369d('0xe1')]+='X';}this[_0x369d('0xe')]['setVariable'](_0x369d('0x163'),_0x5aaaac?_0x5aaaac['toLowerCase']():'');var _0x1b661d=this['channel']['exec'](_0x369d('0x164'),[_0x5aaaac,_0x27c944[_0x369d('0xe1')],_0x27c944[_0x369d('0x65')],_0x86ace4,_0x27c944[_0x369d('0x67')],_0x27c944[_0x369d('0xb0')],_0x27c944[_0x369d('0x165')],_0x27c944['gosub'],'',_0x27c944[_0x369d('0x166')]]);if(_0x1b661d['result']===-0x1){return _0x1b661d;}return this[_0x369d('0xe')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x369d('0x164'),_0x5aaaac));};AGIVertices[_0x369d('0x11')]['record']=function(_0x2aa1a3){logger[_0x369d('0x2f')](util['format'](_0x369d('0x167'),_0x2aa1a3[_0x369d('0x3b')]));var _0x1da7b2=_0x2aa1a3[_0x369d('0x168')]||_0x369d('0x121');var _0x573913=util[_0x369d('0x29')](_0x369d('0x169'),this[_0x369d('0xe')]['uniqueid'],rs[_0x369d('0x110')](0x5));var _0x3cb087=util[_0x369d('0x29')](_0x369d('0x16a'),FILES_PATH,_0x573913,_0x1da7b2);var _0x5f33a9=util[_0x369d('0x29')]('%s/recordings/%s',FILES_PATH,_0x573913);this[_0x369d('0x3d')]['sync'](this,_0x2aa1a3,_0x573913,_0x3cb087);this[_0x369d('0xe')]['setVariable'](_0x369d('0x16b'),_0x573913);logger[_0x369d('0x2f')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x5f33a9,_0x1da7b2,_0x2aa1a3[_0x369d('0x16c')],_0x2aa1a3[_0x369d('0x67')]);return this[_0x369d('0xe')]['recordFile'](_0x5f33a9,_0x1da7b2,_0x2aa1a3['escape_digits'],_0x2aa1a3[_0x369d('0x67')],undefined,!![]);};AGIVertices[_0x369d('0x11')]['restapi']=function(_0x1ddf64){logger['info'](util[_0x369d('0x29')](_0x369d('0x16d'),_0x1ddf64[_0x369d('0x3b')]));if(!this['isConfigured'](_0x1ddf64[_0x369d('0x65')])){return this[_0x369d('0xe')][_0x369d('0xa5')]('no\x20url\x20configured');}var _0x48bcf5=this[_0x369d('0x16e')][_0x369d('0x6e')](this,_0x1ddf64);logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x16f'),util['inspect'](_0x48bcf5,{'showHidden':![],'depth':null})));if(!this[_0x369d('0xa2')](_0x1ddf64[_0x369d('0xd2')])){return this['channel'][_0x369d('0xa5')](_0x369d('0x170'));}var _0x393580=this['getVariable'][_0x369d('0x6e')](this,_0x1ddf64['variable_id']);if(!_0x393580){return this['channel'][_0x369d('0x2d')](_0x1ddf64,'no\x20variable\x20found');}this[_0x369d('0xe')][_0x369d('0x98')](util[_0x369d('0x29')](_0x369d('0x171'),_0x393580),_0x48bcf5[_0x369d('0x73')]?_0x48bcf5[_0x369d('0x73')]:_0x369d('0x172'));this['channel'][_0x369d('0x98')](util[_0x369d('0x29')]('%s_STATUS_MESSAGE',_0x393580),_0x48bcf5[_0x369d('0x74')]?_0x48bcf5['statusMessage']:'OK');if(_0x48bcf5[_0x369d('0x6b')]){try{this['saveRestApiResult'](_0x48bcf5[_0x369d('0x6b')],_0x393580);}catch(_0x2a8f6b){logger[_0x369d('0x2d')](util['format'](_0x369d('0x173'),_0x393580));}}return this['channel'][_0x369d('0xa5')](util[_0x369d('0x29')]('variable\x20%s\x20set',_0x393580));};AGIVertices[_0x369d('0x11')][_0x369d('0x174')]=function(_0x892698){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x175'),_0x892698[_0x369d('0x3b')]));return this[_0x369d('0xe')][_0x369d('0x176')](_0x892698[_0x369d('0x177')][_0x369d('0x178')](/\s+/g,''),_0x892698['escape_digits']);};AGIVertices[_0x369d('0x11')][_0x369d('0x179')]=function(_0x130f1f){logger['info'](util[_0x369d('0x29')](_0x369d('0x17a'),_0x130f1f[_0x369d('0x3b')]));return this[_0x369d('0xe')]['sayNumber'](_0x130f1f[_0x369d('0x17b')][_0x369d('0x178')](/\s+/g,''),_0x130f1f['escape_digits']);};AGIVertices[_0x369d('0x11')][_0x369d('0x17c')]=function(_0x151240){logger['info'](util['format']('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x151240['label']));return this[_0x369d('0xe')][_0x369d('0x17d')](_0x151240[_0x369d('0x60')],_0x151240[_0x369d('0x16c')]);};AGIVertices[_0x369d('0x11')][_0x369d('0x17e')]=function(_0x495fc9){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x17f'),_0x495fc9['label']));if(!this['isConfigured'](_0x495fc9[_0x369d('0x180')])){return this['channel'][_0x369d('0xa5')](_0x369d('0x181'));}var _0xd163fa=this['getMailAccount'][_0x369d('0x6e')](this,_0x495fc9[_0x369d('0x180')]);if(!_0xd163fa||!_0xd163fa['Smtp']){return this[_0x369d('0xe')][_0x369d('0x2d')](_0x495fc9,'no\x20mail\x20account\x20found');}var _0x45ff30={'from':util[_0x369d('0x29')]('\x22%s\x22\x20<%s>',_0xd163fa[_0x369d('0x14')],_0xd163fa['email']||_0xd163fa[_0x369d('0x182')]['user']),'to':_0x495fc9['to']||'','cc':_0x495fc9['cc']||'','bcc':_0x495fc9['bcc']||'','subject':_0x495fc9[_0x369d('0x183')],'html':_0x495fc9['text'],'text':_0x495fc9[_0x369d('0x60')]};if(this[_0x369d('0xa2')](_0x495fc9[_0x369d('0x184')])){}logger['debug'](_0x369d('0x185'),JSON[_0x369d('0x72')](_0x45ff30));this[_0x369d('0x39')][_0x369d('0x6e')](this,_0x495fc9,_0x495fc9[_0x369d('0x180')]);this['channel'][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0x186'),_0xd163fa[_0x369d('0x14')]));this[_0x369d('0x22')][_0x369d('0x6e')](this,_0xd163fa['smtpOptions'],_0x45ff30);return this['channel'][_0x369d('0xa5')](_0x369d('0x187'));};AGIVertices[_0x369d('0x11')]['sendFax']=function(_0x5ade17){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x188'),_0x5ade17[_0x369d('0x3b')]));return this[_0x369d('0xe')][_0x369d('0xa5')](_0x369d('0x189'));};AGIVertices[_0x369d('0x11')][_0x369d('0x18a')]=function(_0xa19d0c){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x18b'),_0xa19d0c[_0x369d('0x3b')]));if(!this[_0x369d('0xa2')](_0xa19d0c['sms_account_id'])){return this['channel'][_0x369d('0xa5')](_0x369d('0x18c'));}var _0x86e2d0=this[_0x369d('0x36')][_0x369d('0x6e')](this,_0xa19d0c[_0x369d('0x18d')]);if(!_0x86e2d0){return this[_0x369d('0xe')][_0x369d('0x2d')](_0xa19d0c,_0x369d('0x18e'));}var _0x147c95={'body':_0xa19d0c[_0x369d('0x18f')],'phone':_0xa19d0c['to']||'','SmsAccountId':_0x86e2d0['id']};logger[_0x369d('0xdb')](_0x369d('0x190'),JSON[_0x369d('0x72')](_0x147c95));this['createSquareDetailsReport'][_0x369d('0x6e')](this,_0xa19d0c,_0xa19d0c[_0x369d('0x18d')]);this['channel'][_0x369d('0xa5')](util['format'](_0x369d('0x191'),_0x86e2d0[_0x369d('0x14')]));this[_0x369d('0x38')]['sync'](this,_0x147c95);return this[_0x369d('0xe')][_0x369d('0xa5')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype']['set']=function(_0x47a3f3){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x192'),_0x47a3f3['label']));if(!this[_0x369d('0xa2')](_0x47a3f3['variable_id'])){return this[_0x369d('0xe')]['error'](_0x47a3f3,_0x369d('0x193'));}var _0x2f0766=this[_0x369d('0x9d')][_0x369d('0x6e')](this,_0x47a3f3['variable_id']);if(!_0x2f0766){return this[_0x369d('0xe')][_0x369d('0x2d')](_0x47a3f3,_0x369d('0xd4'));}return this[_0x369d('0xe')][_0x369d('0x98')](_0x2f0766,_0x47a3f3[_0x369d('0x194')]);};AGIVertices[_0x369d('0x11')][_0x369d('0x195')]=function(_0x257680){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x196'),_0x257680[_0x369d('0x3b')]));this[_0x369d('0xe')][_0x369d('0xa5')](_0x369d('0x197'));if(_0x257680[_0x369d('0x198')]===_0x369d('0x199')){this[_0x369d('0xe')][_0x369d('0xa5')]('Answer');return this[_0x369d('0xe')]['answer']();}return this[_0x369d('0xe')][_0x369d('0xa5')](_0x369d('0x19a'));};AGIVertices[_0x369d('0x11')]['subproject']=function(_0x273751){logger['info'](util[_0x369d('0x29')](_0x369d('0x19b'),_0x273751[_0x369d('0x3b')]));if(!this[_0x369d('0xa2')](_0x273751[_0x369d('0x19c')])){return this[_0x369d('0xe')]['error'](_0x273751,_0x369d('0x19d'));}var _0x3cabbf=this[_0x369d('0x17')][_0x369d('0x6e')](this,_0x273751[_0x369d('0x19c')]);if(!this[_0x369d('0xa2')](_0x3cabbf)){return this[_0x369d('0xe')][_0x369d('0x2d')](_0x273751,util[_0x369d('0x29')](_0x369d('0x19e'),_0x273751[_0x369d('0x19c')]));}if(_0x3cabbf===this[_0x369d('0xe')][_0x369d('0x44')]){return this['channel']['error'](_0x273751,_0x369d('0x19f'));}this[_0x369d('0x39')][_0x369d('0x6e')](this,_0x273751,_0x3cabbf);var _0x48cc6d=this[_0x369d('0xe')][_0x369d('0x5c')](_0x369d('0x1a0'),util[_0x369d('0x29')](_0x369d('0x1a1'),config['agi'][_0x369d('0x1a2')]||_0x369d('0x1a3'),_0x3cabbf,this['channel'][_0x369d('0x44')]));if(_0x48cc6d[_0x369d('0xae')]===-0x1){return _0x48cc6d;}return this['channel']['noop'](util[_0x369d('0x29')]('Executed\x20command\x20%s\x20%s','AGI',_0x3cabbf));};AGIVertices[_0x369d('0x11')][_0x369d('0x1a4')]=function(_0x123f82){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x1a5'),_0x123f82[_0x369d('0x3b')]));var _0x34782b=this[_0x369d('0x5b')][_0x369d('0x6e')](this,_0x123f82[_0x369d('0xb1')]);this[_0x369d('0x39')][_0x369d('0x6e')](this,_0x123f82,_0x123f82['command']);if(this['isConfigured'](_0x123f82[_0x369d('0xd2')])){var _0x16fcd4=this[_0x369d('0x9d')]['sync'](this,_0x123f82[_0x369d('0xd2')]);if(_0x16fcd4){this[_0x369d('0xe')][_0x369d('0x98')](_0x16fcd4,_0x34782b);return this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x123f82[_0x369d('0xb1')],_0x16fcd4));}}return this['channel'][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0x1a6'),_0x123f82[_0x369d('0xb1')]));};AGIVertices[_0x369d('0x11')][_0x369d('0x1a7')]=function(_0xfc643a){logger[_0x369d('0x2f')](util['format'](_0x369d('0x1a8'),_0xfc643a[_0x369d('0x3b')]));_0xfc643a['text']=_0xfc643a[_0x369d('0x60')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x369d('0xa2')](_0xfc643a[_0x369d('0x5e')])){return this[_0x369d('0xe')][_0x369d('0xa5')](_0x369d('0x1a9'));}if(!this[_0x369d('0xa2')](_0xfc643a[_0x369d('0x60')])){return this[_0x369d('0xe')]['noop']('no\x20text\x20configured');}this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0x1aa'),_0xfc643a['text']));var _0x21ad26=this[_0x369d('0x5d')]['sync'](this,_0xfc643a);if(_0x21ad26){this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0x1ab'),_0x21ad26));var _0x2fc786=this[_0x369d('0xe')][_0x369d('0xfa')](_0x21ad26);try{fs[_0x369d('0xfb')](_0x21ad26+_0x369d('0xfc'));}catch(_0x1d3206){logger[_0x369d('0x2d')](_0x1d3206);}return _0x2fc786;}return this['channel'][_0x369d('0x2d')](_0xfc643a,_0x369d('0x1ac'));};AGIVertices[_0x369d('0x11')][_0x369d('0x1ad')]=function(_0x5e83a0){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x1ae'),_0x5e83a0[_0x369d('0x3b')]));_0x5e83a0['text']=_0x5e83a0['text'][_0x369d('0x178')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x369d('0xa2')](_0x5e83a0['text'])){return this[_0x369d('0xe')]['noop']('no\x20text\x20configured');}this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0x1af'),_0x5e83a0[_0x369d('0x60')]));var _0x4c8bf5=this[_0x369d('0x64')][_0x369d('0x6e')](this,_0x5e83a0);if(_0x4c8bf5){this['channel'][_0x369d('0xa5')](util[_0x369d('0x29')](_0x369d('0x1b0'),_0x4c8bf5));var _0x32122a=this[_0x369d('0xe')][_0x369d('0xfa')](_0x4c8bf5);try{fs[_0x369d('0xfb')](_0x4c8bf5+_0x369d('0xfc'));}catch(_0x91587e){logger[_0x369d('0x2d')](_0x91587e);}return _0x32122a;}return this[_0x369d('0xe')]['error'](_0x5e83a0,_0x369d('0x1b1'));};AGIVertices[_0x369d('0x11')][_0x369d('0x1b2')]=function(_0x517266){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x1b3'),_0x517266[_0x369d('0x3b')]));if(!this[_0x369d('0xa2')](_0x517266['findBy'])){return this[_0x369d('0xe')][_0x369d('0x2d')](_0x517266,'no\x20find\x20by\x20configured');}logger['info'](util[_0x369d('0x29')](_0x369d('0x149'),this['channel']['callerid'],_0x517266[_0x369d('0x147')]));var _0x2c2c9e=this[_0x369d('0x1b4')]['sync'](this,_0x517266[_0x369d('0x147')]);if(_0x2c2c9e){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x369d('0xe')]['callerid'],_0x517266[_0x369d('0x147')]));this['channel'][_0x369d('0xa5')](util[_0x369d('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x369d('0xe')]['callerid'],_0x517266[_0x369d('0x147')]));return{'code':0xc8,'result':_0x369d('0x14e')};}else{logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x14f'),this[_0x369d('0xe')][_0x369d('0x3e')],_0x517266[_0x369d('0x147')]));this['channel'][_0x369d('0xa5')](util['format'](_0x369d('0x14f'),this['channel'][_0x369d('0x3e')],_0x517266[_0x369d('0x147')]));return{'code':0xc8,'result':_0x369d('0x14a')};}};AGIVertices['prototype'][_0x369d('0x1b5')]=function(_0x235165){logger[_0x369d('0x2f')](util['format'](_0x369d('0x1b6'),_0x235165[_0x369d('0x3b')]));var _0x411411=this['channel'][_0x369d('0x5c')](_0x369d('0x1b7'),[_0x235165[_0x369d('0x1b8')],_0x235165['options']]);if(_0x411411[_0x369d('0xae')]===-0x1){return _0x411411;}return this[_0x369d('0xe')][_0x369d('0xa5')](util[_0x369d('0x29')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x235165['mailbox']));};AGIVertices[_0x369d('0x11')][_0x369d('0x1b9')]=function(_0x3e04e2){logger[_0x369d('0x2f')](util[_0x369d('0x29')](_0x369d('0x1ba'),_0x3e04e2[_0x369d('0x3b')]));if(!this[_0x369d('0xa2')](_0x3e04e2[_0x369d('0xd2')])){return this[_0x369d('0xe')]['error'](_0x3e04e2,_0x369d('0x193'));}var _0xaa1f39=this[_0x369d('0x9d')][_0x369d('0x6e')](this,_0x3e04e2[_0x369d('0xd2')]);if(!_0xaa1f39){return this[_0x369d('0xe')]['error'](_0x3e04e2,'no\x20variable\x20found');}var _0xe089f6=this[_0x369d('0xe')][_0x369d('0x9d')](_0xaa1f39);return{'code':0xc8,'result':_0xe089f6[_0x369d('0x9e')]?_0xe089f6[_0x369d('0x9e')]:'-'};};String[_0x369d('0x11')][_0x369d('0x9c')]=function(_0x6d06fd,_0x497beb){return this[_0x369d('0x9b')](_0x6d06fd)[_0x369d('0x1bb')](_0x497beb);};module[_0x369d('0x1bc')]=AGIVertices;
\ No newline at end of file
+var _0xc7ea=['google_tts_language','restAPI','url','method','timeout','number','includes','PUT','toUpperCase','body','parse','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_access_key_id','aws_bot_name','googleASR','google_asr_language','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','isArray','length','saveRestApiResult','%s.%s','setVariable','split','toString','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','retry','noop','no\x20text\x20configured','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','getSound','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','mindigit','hiddendigitsnum','generate','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','AWS_LEX_%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','%s/recordings/%s','tilde\x20%s\x20file\x20created','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','EVAL\x20CONDITION\x20%s\x20%s','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','no\x20file\x20audio\x20selected','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','failure','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','opts','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','toLowerCase','gosub','position','QUEUE','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','no\x20mail\x20account\x20configured','account_id','Smtp','email','user','bcc','subject','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','replaceAll','join','exports','util','lodash','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','name','getVoiceQueue','getVoiceQueueById','then','catch','getSquareProject','getSquareProjectById','getSquareOdbcById','getUser','getUserById','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','callerid','createSquareRecording','uniqueid','calleridname','extension','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','callback','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS'];(function(_0x245a27,_0x362a44){var _0xc214c6=function(_0x5c9ce4){while(--_0x5c9ce4){_0x245a27['push'](_0x245a27['shift']());}};_0xc214c6(++_0x362a44);}(_0xc7ea,0x171));var _0xac7e=function(_0x4bb1b3,_0x446a44){_0x4bb1b3=_0x4bb1b3-0x0;var _0x6b3651=_0xc7ea[_0x4bb1b3];return _0x6b3651;};'use strict';var fs=require('fs');var util=require(_0xac7e('0x0'));var _=require(_0xac7e('0x1'));var sh=require('shelljs');var odbc=require(_0xac7e('0x2'))();var rs=require(_0xac7e('0x3'));var moment=require(_0xac7e('0x4'));var Mustache=require(_0xac7e('0x5'));var rp=require('request-promise');var logger=require(_0xac7e('0x6'))(_0xac7e('0x7'));var config=require(_0xac7e('0x8'));var shared=require(_0xac7e('0x9'));var scripts=require(_0xac7e('0xa'));var FILES_PATH=_0xac7e('0xb');var recursiveMapAttributes=[_0xac7e('0xc'),_0xac7e('0xd')];var verticesWithRetry=[_0xac7e('0xe'),_0xac7e('0xf'),'getsecretdigits'];var AGIVertices=function(_0x114e82,_0x446f88,_0x2efbf4){this[_0xac7e('0x10')]=_0x114e82;this[_0xac7e('0x11')]=_0x446f88;this[_0xac7e('0x12')]=_0x2efbf4;};AGIVertices[_0xac7e('0x13')][_0xac7e('0x14')]=function(_0x21e998,_0x209e91){this[_0xac7e('0x11')][_0xac7e('0x15')](_0x21e998)['then'](function(_0x9cd7c){_0x209e91(null,_0x9cd7c?_0x9cd7c[_0xac7e('0x16')]:![]);})['catch'](function(_0x617cf9){_0x209e91(_0x617cf9);});};AGIVertices[_0xac7e('0x13')][_0xac7e('0x17')]=function(_0x145382,_0x31a8e7){this['rpc'][_0xac7e('0x18')](_0x145382)[_0xac7e('0x19')](function(_0x3ef8fe){_0x31a8e7(null,_0x3ef8fe?_0x3ef8fe[_0xac7e('0x16')]:![]);})[_0xac7e('0x1a')](function(_0x232ce5){_0x31a8e7(_0x232ce5);});};AGIVertices[_0xac7e('0x13')][_0xac7e('0x1b')]=function(_0x5f08f1,_0x3f4869){this[_0xac7e('0x11')][_0xac7e('0x1c')](_0x5f08f1)[_0xac7e('0x19')](function(_0x242889){_0x3f4869(null,_0x242889?_0x242889['name']:![]);})[_0xac7e('0x1a')](function(_0x5c4939){_0x3f4869(_0x5c4939);});};AGIVertices[_0xac7e('0x13')]['getSquareOdbc']=function(_0xa048e9,_0x406f0a){this[_0xac7e('0x11')][_0xac7e('0x1d')](_0xa048e9)[_0xac7e('0x19')](function(_0x2ad784){_0x406f0a(null,_0x2ad784?_0x2ad784['dsn']:![]);})[_0xac7e('0x1a')](function(_0x3c177d){_0x406f0a(_0x3c177d);});};AGIVertices['prototype'][_0xac7e('0x1e')]=function(_0x2ebc78,_0x2c3b6e){this[_0xac7e('0x11')][_0xac7e('0x1f')](_0x2ebc78)[_0xac7e('0x19')](function(_0x45f7b6){_0x2c3b6e(null,_0x45f7b6?_0x45f7b6[_0xac7e('0x16')]:![]);})[_0xac7e('0x1a')](function(_0x32ef52){_0x2c3b6e(_0x32ef52);});};AGIVertices[_0xac7e('0x13')]['getTrunk']=function(_0x57c945,_0x320272){this[_0xac7e('0x11')][_0xac7e('0x20')](_0x57c945)['then'](function(_0xd491fd){_0x320272(null,_0xd491fd?_0xd491fd[_0xac7e('0x16')]:![]);})[_0xac7e('0x1a')](function(_0x3e0f1a){_0x320272(_0x3e0f1a);});};AGIVertices['prototype']['getSound']=function(_0x240ffa,_0x5a79d6){var _0x541a8d=this;this[_0xac7e('0x11')][_0xac7e('0x21')](_0x240ffa)[_0xac7e('0x19')](function(_0x4864d1){_0x5a79d6(null,_0x4864d1?_0x541a8d[_0xac7e('0x22')](_0x4864d1[_0xac7e('0x23')]):![]);})[_0xac7e('0x1a')](function(_0x195c9f){_0x5a79d6(_0x195c9f);});};AGIVertices['prototype'][_0xac7e('0x24')]=function(_0x1d0e1a,_0x18e3f4){this['rpc'][_0xac7e('0x25')](_0x1d0e1a)[_0xac7e('0x19')](function(_0x332205){_0x18e3f4(null,_0x332205?_0x332205:![]);})[_0xac7e('0x1a')](function(_0x4b4dee){_0x18e3f4(_0x4b4dee);});};AGIVertices[_0xac7e('0x13')]['sendMailMessage']=function(_0x10b2b1,_0xfa9f6,_0x3c08f6){this['mailRpc'][_0xac7e('0x26')](_0x10b2b1,_0xfa9f6)[_0xac7e('0x19')](function(){_0x3c08f6(null);})['catch'](function(_0x4d5e30){_0x3c08f6(_0x4d5e30);});};AGIVertices[_0xac7e('0x13')][_0xac7e('0x27')]=function(_0x119a15,_0x2133c7){this[_0xac7e('0x11')][_0xac7e('0x28')](_0x119a15)[_0xac7e('0x19')](function(_0x286c75){if(_0x286c75){if(_0x286c75[_0xac7e('0x29')]){_0x2133c7(null,[_0x286c75['interval']]);}else{_0x2133c7(null,_[_0xac7e('0x2a')](_0x286c75[_0xac7e('0x2b')],_0xac7e('0x2c')));}}else{_0x2133c7(null,![]);}})[_0xac7e('0x1a')](function(_0x3b08b3){_0x2133c7(_0x3b08b3);});};AGIVertices[_0xac7e('0x13')]['getSoundPath']=function(_0x54118f){return util[_0xac7e('0x2d')](_0xac7e('0x2e'),FILES_PATH,_0x54118f);};AGIVertices[_0xac7e('0x13')][_0xac7e('0x2f')]=function(_0xadc329,_0x128298,_0x278848){odbc[_0xac7e('0x30')](_0xadc329,function(_0xacc6b9){if(_0xacc6b9){logger['error'](_0xac7e('0x31'),_0xacc6b9);_0x278848(_0xacc6b9);}else{logger[_0xac7e('0x32')]('ODBC\x20connection\x20successfully');odbc[_0xac7e('0x33')](_0x128298,function(_0x15aa54,_0x4e1291){if(_0x15aa54){logger[_0xac7e('0x32')](_0xac7e('0x34'),_0x128298);_0x278848(_0x15aa54);}else{logger[_0xac7e('0x32')](_0xac7e('0x35'),_0x128298);odbc[_0xac7e('0x36')](function(_0x30ce41){if(_0x30ce41){logger[_0xac7e('0x37')](_0xac7e('0x38'),_0x30ce41);}_0x278848(null,_0x4e1291);});}});}});};AGIVertices['prototype'][_0xac7e('0x39')]=function(_0x43e44a,_0x569515){this[_0xac7e('0x11')][_0xac7e('0x3a')](_0x43e44a)[_0xac7e('0x19')](function(_0x488da5){_0x569515(null,_0x488da5?_0x488da5:![]);})['catch'](function(_0x8f7095){_0x569515(_0x8f7095);});};AGIVertices[_0xac7e('0x13')]['createSmsMessage']=function(_0x15d95c,_0x26fe05){this[_0xac7e('0x11')][_0xac7e('0x3b')](_0x15d95c)[_0xac7e('0x19')](function(_0x21e628){_0x26fe05(null,_0x21e628);})[_0xac7e('0x1a')](function(_0x27147b){_0x26fe05(_0x27147b);});};AGIVertices[_0xac7e('0x13')][_0xac7e('0x3c')]=function(_0x3c4fb9,_0x26f779,_0x8821db){this['rpc'][_0xac7e('0x3c')]({'uniqueid':this[_0xac7e('0x10')]['uniqueid'],'node':_0x3c4fb9[_0xac7e('0x3d')],'application':_0x3c4fb9[_0xac7e('0x3e')],'data':_0x26f779||null,'project_name':this[_0xac7e('0x10')][_0xac7e('0x3f')],'callerid':this['channel'][_0xac7e('0x40')]})[_0xac7e('0x19')](function(_0x57433f){if(_0x8821db){_0x8821db(null,_0x57433f);}})['catch'](function(_0x4c5880){if(_0x8821db){_0x8821db(_0x4c5880);}});};AGIVertices[_0xac7e('0x13')]['createSquareRecording']=function(_0x2dcd32,_0x2da34b,_0x4aecc1,_0x340e59){this[_0xac7e('0x11')][_0xac7e('0x41')]({'uniqueid':this[_0xac7e('0x10')][_0xac7e('0x42')],'callerid':this[_0xac7e('0x10')]['callerid'],'calleridname':this[_0xac7e('0x10')][_0xac7e('0x43')],'context':this[_0xac7e('0x10')]['context'],'extension':this[_0xac7e('0x10')][_0xac7e('0x44')],'priority':this['channel']['priority'],'accountcode':this['channel']['accountcode'],'dnid':this[_0xac7e('0x10')]['dnid'],'projectName':this['channel']['arg_1'],'saveName':_0x2da34b,'filename':_0x2dcd32['file']||_0x2da34b,'savePath':_0x4aecc1})[_0xac7e('0x19')](function(_0x50c814){_0x340e59(null,_0x50c814);})[_0xac7e('0x1a')](function(_0x2de1a3){_0x340e59(_0x2de1a3);});};AGIVertices[_0xac7e('0x13')]['createSquareMessage']=function(_0x4ce6f9,_0x703faa,_0x5777f7,_0x4d2788,_0x238495){this[_0xac7e('0x11')][_0xac7e('0x45')]({'uniqueid':this['channel']['uniqueid'],'body':_0x4ce6f9,'direction':_0x703faa,'providerName':_0x5777f7,'providerResponse':_0x4d2788})['then'](function(_0x5d5004){if(_0x238495){_0x238495(null,_0x5d5004);}})[_0xac7e('0x1a')](function(_0x4645bc){if(_0x238495){_0x238495(_0x4645bc);}});};AGIVertices[_0xac7e('0x13')][_0xac7e('0x46')]=function(_0x3a6458,_0x456377){this[_0xac7e('0x11')][_0xac7e('0x46')]({'firstName':_[_0xac7e('0x47')](_0x3a6458['name'])||_[_0xac7e('0x48')](_0x3a6458[_0xac7e('0x16')])?_0xac7e('0x49')+Math['random']():_0x3a6458[_0xac7e('0x16')],'lastName':_[_0xac7e('0x47')](_0x3a6458[_0xac7e('0x4a')])||_[_0xac7e('0x48')](_0x3a6458[_0xac7e('0x4a')])?null:_0x3a6458[_0xac7e('0x4a')],'phone':_0x3a6458[_0xac7e('0x4b')],'ListId':_0x3a6458[_0xac7e('0x4c')],'scheduledat':_0x3a6458[_0xac7e('0x4d')],'callbackUniqueid':this[_0xac7e('0x10')][_0xac7e('0x42')],'tags':_0xac7e('0x4e'),'description':'Callback\x20scheduled\x20at\x20'+_0x3a6458[_0xac7e('0x4d')]['toString'](),'priority':_0x3a6458[_0xac7e('0x4f')]})['then'](function(_0x79a678){_0x456377(null,_0x79a678);})[_0xac7e('0x1a')](function(_0xdb2143){_0x456377(_0xdb2143);});};AGIVertices['prototype']['getPause']=function(_0x118dfc,_0x4db4e9){this[_0xac7e('0x11')][_0xac7e('0x50')](_0x118dfc)[_0xac7e('0x19')](function(_0x34dd23){_0x4db4e9(null,_0x34dd23?_0x34dd23[_0xac7e('0x16')]:![]);})[_0xac7e('0x1a')](function(_0x4902a2){_0x4db4e9(_0x4902a2);});};AGIVertices[_0xac7e('0x13')][_0xac7e('0x51')]=function(_0x10bf0a,_0x52cde4,_0x5a10d3){var _0x67410e={'role':_0xac7e('0x52')};_0x67410e[_0x10bf0a]=this[_0xac7e('0x10')][_0xac7e('0x40')];this[_0xac7e('0x11')]['agentPause'](_0x67410e,_0x52cde4,this[_0xac7e('0x10')]['uniqueid'])[_0xac7e('0x19')](function(_0x34bf98){_0x5a10d3(null,_[_0xac7e('0x48')](_0x34bf98)?![]:!![]);})[_0xac7e('0x1a')](function(_0xeaf6a6){logger[_0xac7e('0x37')](_0xeaf6a6);_0x5a10d3(null,![]);});};AGIVertices[_0xac7e('0x13')][_0xac7e('0x53')]=function(_0x5329db,_0x4b4158){var _0x3a8595={'role':'agent'};_0x3a8595[_0x5329db]=this[_0xac7e('0x10')]['callerid'];this[_0xac7e('0x11')][_0xac7e('0x53')](_0x3a8595)[_0xac7e('0x19')](function(_0x74366b){_0x4b4158(null,_['isNil'](_0x74366b)?![]:!![]);})[_0xac7e('0x1a')](function(_0x38122f){logger['error'](_0x38122f);_0x4b4158(null,![]);});};AGIVertices[_0xac7e('0x13')]['agentLogout']=function(_0x3fd99c,_0x40491e){var _0x2eded1={'role':'agent'};_0x2eded1[_0x3fd99c]=this[_0xac7e('0x10')][_0xac7e('0x40')];this['rpc'][_0xac7e('0x54')](_0x2eded1)['then'](function(_0x2da908){_0x40491e(null,_[_0xac7e('0x48')](_0x2da908)?![]:!![]);})[_0xac7e('0x1a')](function(_0x590ab0){logger[_0xac7e('0x37')](_0x590ab0);_0x40491e(null,![]);});};AGIVertices[_0xac7e('0x13')][_0xac7e('0x55')]=function(_0x2c8c69,_0x45853c){var _0x35dd64={'role':'agent'};_0x35dd64[_0x2c8c69]=this['channel']['callerid'];var _0x10cbb7=_0x2c8c69!=_0xac7e('0x56')?util[_0xac7e('0x2d')](_0xac7e('0x57'),'LOCAL',this['channel'][_0xac7e('0x40')]):undefined;this[_0xac7e('0x11')][_0xac7e('0x55')](_0x35dd64,_0x10cbb7)[_0xac7e('0x19')](function(_0x2fd70d){_0x45853c(null,_[_0xac7e('0x48')](_0x2fd70d)?![]:!![]);})[_0xac7e('0x1a')](function(_0xfb07dc){logger[_0xac7e('0x37')](_0xfb07dc);_0x45853c(null,![]);});};AGIVertices[_0xac7e('0x13')][_0xac7e('0x58')]=function(_0x362189,_0x2040db){sh[_0xac7e('0x59')](_[_0xac7e('0x5a')](_0x362189),function(_0xb152cc,_0x1ade4d){var _0x1e34c6=_0x1ade4d[_0xac7e('0x5b')](/(\r\n|\n|\r)/gm,'');_0x2040db(null,_0x1e34c6);});};AGIVertices[_0xac7e('0x13')][_0xac7e('0x5c')]=function(_0x575d0b,_0x31e1de){scripts['googleCloudTTS'](_0x575d0b[_0xac7e('0x5d')],_0x575d0b[_0xac7e('0x5e')]||_0xac7e('0x5f'),_0x575d0b[_0xac7e('0x5f')],_0x575d0b[_0xac7e('0x60')]||_0xac7e('0x61'),_0x575d0b[_0xac7e('0x62')]||'MALE',_0x575d0b[_0xac7e('0x63')]||_0xac7e('0x64'))['then'](function(_0x4788c7){_0x31e1de(null,_0x4788c7);})[_0xac7e('0x1a')](function(_0x153cc5){_0x31e1de(_0x153cc5);});};AGIVertices[_0xac7e('0x13')][_0xac7e('0x65')]=function(_0x5eeff2,_0x82f72a){scripts[_0xac7e('0x65')](_0x5eeff2[_0xac7e('0x5f')],_0x5eeff2[_0xac7e('0x66')]||'en',0x1)['then'](function(_0x14dbfd){_0x82f72a(null,_0x14dbfd);})['catch'](function(_0x51e9a1){_0x82f72a(_0x51e9a1);});};AGIVertices[_0xac7e('0x13')][_0xac7e('0x67')]=function(_0xf8dfb8,_0x2df1f2){var _0x101f54={'uri':_0xf8dfb8[_0xac7e('0x68')],'method':_0xf8dfb8[_0xac7e('0x69')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xf8dfb8[_0xac7e('0x6a')])===_0xac7e('0x6b')&&parseInt(_0xf8dfb8[_0xac7e('0x6a')])>=0x1?parseInt(_0xf8dfb8['timeout'])*0x3e8:0x5*0x3e8};if(_[_0xac7e('0x6c')](['POST',_0xac7e('0x6d')],_0x101f54[_0xac7e('0x69')][_0xac7e('0x6e')]())){try{_0x101f54[_0xac7e('0x6f')]=_0xf8dfb8[_0xac7e('0xd')]?JSON[_0xac7e('0x70')](_0xf8dfb8[_0xac7e('0xd')]):{};}catch(_0x17974d){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x17974d);}}try{_0x101f54[_0xac7e('0x71')]=_0xf8dfb8[_0xac7e('0xc')]?JSON[_0xac7e('0x70')](_0xf8dfb8[_0xac7e('0xc')]):{};}catch(_0x47429a){logger[_0xac7e('0x37')](_0xac7e('0x72'),_0x47429a);}if(_0xf8dfb8[_0xac7e('0x73')]){try{var _0x522fe8=require(_0xf8dfb8[_0xac7e('0x73')])[_0xac7e('0x74')](this,_0x101f54);_0x101f54[_0xac7e('0x75')]=Mustache[_0xac7e('0x76')](_0xf8dfb8[_0xac7e('0x68')],_0x522fe8,{},['$$','$$']);if(_0x101f54[_0xac7e('0x71')]){_0x101f54[_0xac7e('0x71')]=JSON[_0xac7e('0x70')](Mustache[_0xac7e('0x76')](JSON[_0xac7e('0x77')](_0x101f54['headers']),_0x522fe8,{},['$$','$$']));}if(_0x101f54[_0xac7e('0x6f')]){_0x101f54[_0xac7e('0x6f')]=JSON['parse'](Mustache['render'](JSON['stringify'](_0x101f54['body']),_0x522fe8,{},['$$','$$']));}}catch(_0xd40016){logger[_0xac7e('0x37')](_0xac7e('0x78'),_0xd40016);}}rp(_0x101f54)['then'](function(_0x26639b){var _0x246fbe={'statusCode':_0x26639b[_0xac7e('0x79')]||0xc8,'statusMessage':_0x26639b[_0xac7e('0x7a')]||'OK','headers':_0x26639b[_0xac7e('0x71')]||{},'body':_0x26639b[_0xac7e('0x6f')]||{}};_0x2df1f2(null,_0x246fbe);})[_0xac7e('0x1a')](function(_0xb46bbe){var _0xe10f21={'statusCode':_0xb46bbe[_0xac7e('0x79')]||0x1f4,'statusMessage':_0xb46bbe['message']||'500\x20-\x20Internal\x20Server\x20Error','headers':_0xb46bbe[_0xac7e('0x7b')][_0xac7e('0x71')]||{},'body':_0xb46bbe[_0xac7e('0x7b')][_0xac7e('0x6f')]||{}};_0x2df1f2(null,_0xe10f21);});};AGIVertices[_0xac7e('0x13')][_0xac7e('0x7c')]=function(_0xa9a42b,_0x2afd16){scripts[_0xac7e('0x7c')](this['channel'][_0xac7e('0x42')],_0xa9a42b[_0xac7e('0x7d')],_0xa9a42b['text'],_0xa9a42b[_0xac7e('0x7e')]||'en')['then'](function(_0x14e261){_0x2afd16(null,_0x14e261);})[_0xac7e('0x1a')](function(_0x16a3aa){_0x2afd16(_0x16a3aa);});};AGIVertices[_0xac7e('0x13')][_0xac7e('0x7f')]=function(_0x580a24,_0x9dda97){scripts[_0xac7e('0x7f')](this[_0xac7e('0x10')][_0xac7e('0x42')],_0x580a24[_0xac7e('0x80')],_0x580a24['client_email'],_0x580a24[_0xac7e('0x81')],_0x580a24[_0xac7e('0x5f')],_0x580a24[_0xac7e('0x82')]||'en')[_0xac7e('0x19')](function(_0x361a2c){_0x9dda97(null,_0x361a2c);})['catch'](function(_0x42095d){_0x9dda97(_0x42095d);});};AGIVertices[_0xac7e('0x13')]['sestekNDA']=function(_0x5d8ad0,_0x5526a2){scripts[_0xac7e('0x83')](this[_0xac7e('0x10')],_0x5d8ad0)[_0xac7e('0x19')](function(_0x460847){_0x5526a2(null,_0x460847);})[_0xac7e('0x1a')](function(_0x5f12c5){_0x5526a2(_0x5f12c5);});};AGIVertices[_0xac7e('0x13')][_0xac7e('0x84')]=function(_0x15468e,_0x23d469){scripts[_0xac7e('0x84')](_0x15468e[_0xac7e('0x7d')],_0x15468e[_0xac7e('0x5f')],_0x15468e[_0xac7e('0x85')]||_0xac7e('0x61'),_0x15468e[_0xac7e('0x86')])['then'](function(_0x20a4be){_0x23d469(null,_0x20a4be);})[_0xac7e('0x1a')](function(_0x6123fa){_0x23d469(_0x6123fa);});};AGIVertices[_0xac7e('0x13')][_0xac7e('0x87')]=function(_0x34644c,_0x5e1a0b,_0x4b8336){scripts[_0xac7e('0x87')](_0x5e1a0b,_0x34644c[_0xac7e('0x7d')],_0x34644c[_0xac7e('0x88')]||_0xac7e('0x61'),this[_0xac7e('0x89')](_0x34644c[_0xac7e('0x8a')])?_0x34644c['model']:undefined)['then'](function(_0x56e56e){_0x4b8336(null,_0x56e56e);})[_0xac7e('0x1a')](function(_0x17b018){_0x4b8336(_0x17b018);});};AGIVertices[_0xac7e('0x13')]['awsPolly']=function(_0x8cd7bb,_0x2a5e20){scripts[_0xac7e('0x8b')](_0x8cd7bb['aws_access_key_id'],_0x8cd7bb[_0xac7e('0x8c')],_0x8cd7bb[_0xac7e('0x8d')],_0x8cd7bb[_0xac7e('0x8e')]||_0xac7e('0x8f'),_0x8cd7bb['text'],_0x8cd7bb['aws_text_type']||'text')[_0xac7e('0x19')](function(_0x127787){_0x2a5e20(null,_0x127787);})['catch'](function(_0x36f45b){_0x2a5e20(_0x36f45b);});};AGIVertices[_0xac7e('0x13')]['awsLex']=function(_0x297fa5,_0x2018ac){scripts['awsLex'](this[_0xac7e('0x10')]['uniqueid'],_0x297fa5[_0xac7e('0x90')],_0x297fa5[_0xac7e('0x8c')],_0x297fa5['aws_lex_region'],_0x297fa5['text'],_0x297fa5[_0xac7e('0x91')])['then'](function(_0x286c8f){_0x2018ac(null,_0x286c8f);})['catch'](function(_0x582446){_0x2018ac(_0x582446);});};AGIVertices['prototype']['googleASR']=function(_0x943b4d,_0x257612,_0x11b7c8){scripts[_0xac7e('0x92')](_0x257612,_0x943b4d[_0xac7e('0x7d')],_0x943b4d[_0xac7e('0x93')]||_0xac7e('0x61'))[_0xac7e('0x19')](function(_0x3877b8){_0x11b7c8(null,_0x3877b8);})[_0xac7e('0x1a')](function(_0x4e0e05){_0x11b7c8(_0x4e0e05);});};AGIVertices['prototype']['tildeASR']=function(_0x5d5294,_0x206493,_0x11eeeb){scripts['tildeASR'](_0x206493,_0x5d5294[_0xac7e('0x94')],_0x5d5294[_0xac7e('0x95')],_0x5d5294[_0xac7e('0x75')])[_0xac7e('0x19')](function(_0x2bc71b){_0x11eeeb(null,_0x2bc71b);})['catch'](function(_0x1564f6){_0x11eeeb(_0x1564f6);});};AGIVertices[_0xac7e('0x13')][_0xac7e('0x96')]=function(_0x12a5be){var _0x16b3df=_[_0xac7e('0x6c')](verticesWithRetry,_0x12a5be[_0xac7e('0x3e')])?_0x12a5be:_[_0xac7e('0x97')](_0x12a5be);for(var _0x1e15a2 in _0x16b3df){if(_0x16b3df[_0xac7e('0x98')](_0x1e15a2)){if(_0x16b3df[_0x1e15a2]&&_[_0xac7e('0x99')](_0x16b3df[_0x1e15a2])){if(_[_0xac7e('0x6c')](recursiveMapAttributes,_0x1e15a2)){_0x16b3df[_0x1e15a2]=this[_0xac7e('0x9a')](_0x16b3df[_0x1e15a2]);}else{_0x16b3df[_0x1e15a2]=this[_0xac7e('0x9b')](_0x16b3df[_0x1e15a2]);}}}}return _0x16b3df;};AGIVertices['prototype']['recursiveNodeIndex']=function(_0x2da086){for(var _0x2a8aff in _0x2da086){if(_0x2da086['hasOwnProperty'](_0x2a8aff)){if(_[_0xac7e('0x9c')](_0x2da086[_0x2a8aff])){this[_0xac7e('0x9d')](_0x2da086[_0x2a8aff]);}else if(_[_0xac7e('0x9e')](_0x2da086[_0x2a8aff])){for(var _0x2e1635=0x0;_0x2e1635<_0x2da086[_0x2a8aff][_0xac7e('0x9f')];_0x2e1635++){this[_0xac7e('0x9d')](_0x2da086[_0x2a8aff][_0x2e1635]);}}else if(_[_0xac7e('0x99')](_0x2da086[_0x2a8aff])){_0x2da086[_0x2a8aff]=this[_0xac7e('0x9b')](_0x2da086[_0x2a8aff]);}}}};AGIVertices[_0xac7e('0x13')][_0xac7e('0xa0')]=function(_0x465c8f,_0x88c87a){for(var _0x2d17ff in _0x465c8f){if(_0x465c8f['hasOwnProperty'](_0x2d17ff)){if(_[_0xac7e('0x9c')](_0x465c8f[_0x2d17ff])){if(!_[_0xac7e('0x47')](_0x465c8f[_0x2d17ff])){this[_0xac7e('0xa0')](_0x465c8f[_0x2d17ff],util[_0xac7e('0x2d')](_0xac7e('0xa1'),_0x88c87a,_0x2d17ff));}}else if(_[_0xac7e('0x9e')](_0x465c8f[_0x2d17ff])){for(var _0x4e24fc=0x0;_0x4e24fc<_0x465c8f[_0x2d17ff][_0xac7e('0x9f')];_0x4e24fc++){this[_0xac7e('0xa0')](_0x465c8f[_0x2d17ff][_0x4e24fc],util[_0xac7e('0x2d')](_0xac7e('0xa1'),_0x88c87a,_0x2d17ff+'['+_0x4e24fc+']'));}}else{if(!_[_0xac7e('0x48')](_0x465c8f[_0x2d17ff])){this['channel'][_0xac7e('0xa2')](util[_0xac7e('0x2d')](_0xac7e('0xa1'),_0x88c87a,_0x2d17ff),_0x465c8f[_0x2d17ff]);}}}}};AGIVertices[_0xac7e('0x13')][_0xac7e('0x9a')]=function(_0x3e2008){try{var _0x7d338b=JSON[_0xac7e('0x70')](_0x3e2008);this[_0xac7e('0x9d')](_0x7d338b);return JSON[_0xac7e('0x77')](_0x7d338b);}catch(_0x2d9337){return this[_0xac7e('0x9b')](_0x3e2008);}};AGIVertices['prototype'][_0xac7e('0x9b')]=function(_0x4050a6){var _0x5dfa84=_0x4050a6[_0xac7e('0xa3')]('{');for(var _0x3432ef=0x1;_0x3432ef<_0x5dfa84[_0xac7e('0x9f')];_0x3432ef+=0x1){var _0x6d71ef=_0x5dfa84[_0x3432ef]['split']('}');if(_0x6d71ef[_0xac7e('0x9f')]>0x1){_0x4050a6=_0x4050a6['replaceAll']('{'+_0x6d71ef[0x0]+'}',this['channel']['getVariable'](_0x6d71ef[0x0])['extra']||_0x6d71ef[0x0]);}}if(_0x5dfa84[_0xac7e('0x9f')]===0x1){return _0x4050a6[_0xac7e('0xa4')]();}return this[_0xac7e('0x9b')](_0x4050a6);};AGIVertices['prototype'][_0xac7e('0xa5')]=function(_0x34685e,_0x5141f4){var _0xb29efd=this[_0xac7e('0x10')][_0xac7e('0x14')](_0x34685e);if(_0xb29efd['result']===-0x1){return _0xb29efd;}logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0xa6'),_0x5141f4,_0xb29efd[_0xac7e('0xa7')]));return this[_0xac7e('0x10')][_0xac7e('0xa2')](_0x5141f4,_0xb29efd['extra']);};AGIVertices[_0xac7e('0x13')][_0xac7e('0x89')]=function(_0x403a5a){return _0x403a5a&&_0x403a5a!=='0'&&_0x403a5a!=='-1'&&_0x403a5a!=='';};AGIVertices['prototype'][_0xac7e('0xa8')]=function(_0x32f3e0){this[_0xac7e('0x3c')][_0xac7e('0x74')](this,_0x32f3e0,'-');_0x32f3e0[_0xac7e('0xa9')]=_0x32f3e0[_0xac7e('0xa8')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x3c8ede){logger['info'](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x3c8ede[_0xac7e('0x3d')]));if(!this[_0xac7e('0x89')](_0x3c8ede[_0xac7e('0x5f')])){return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0xab'));}var _0x3dd686='\x22'+_0x3c8ede[_0xac7e('0x5f')]+'\x22';if(this[_0xac7e('0x89')](_0x3c8ede['options'])){_0x3dd686+=','+_0x3c8ede[_0xac7e('0x7b')];}var _0x3f2dd8=this[_0xac7e('0x10')][_0xac7e('0x59')](_0xac7e('0xac'),_0x3dd686);if(_0x3f2dd8[_0xac7e('0xad')]===-0x1){return _0x3f2dd8;}return this[_0xac7e('0x10')][_0xac7e('0xaa')](util['format'](_0xac7e('0xae'),_0x3dd686));};AGIVertices['prototype']['mrcprecog']=function(_0x24a8f4){logger['info'](util['format']('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x24a8f4['label']));if(!this['isConfigured'](_0x24a8f4[_0xac7e('0xaf')])){return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0xb0'));}var _0xad53bd=_0x24a8f4[_0xac7e('0xaf')];if(this[_0xac7e('0x89')](_0x24a8f4['options'])){_0xad53bd+=','+_0x24a8f4[_0xac7e('0x7b')];}var _0x4d48ca=this['channel']['exec'](_0xac7e('0xb1'),_0xad53bd);if(_0x4d48ca[_0xac7e('0xad')]===-0x1){return _0x4d48ca;}var _0x2ed09e=this[_0xac7e('0xa5')](_0xac7e('0xb2'),_0xac7e('0xb3'));if(_0x2ed09e[_0xac7e('0xad')]===-0x1){return _0x2ed09e;}var _0x49cb87=this[_0xac7e('0xa5')](_0xac7e('0xb4'),_0xac7e('0xb5'));if(_0x49cb87[_0xac7e('0xad')]===-0x1){return _0x49cb87;}var _0x2d3444=this[_0xac7e('0xa5')]('RECOG_INSTANCE()',_0xac7e('0xb6'));if(_0x2d3444['result']===-0x1){return _0x2d3444;}return this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')]('Executed\x20command\x20MRCPRecog\x20%s',_0xad53bd));};AGIVertices['prototype'][_0xac7e('0x7')]=function(_0xcab5df){logger['info'](util[_0xac7e('0x2d')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0xcab5df[_0xac7e('0x3d')]));return this[_0xac7e('0x10')][_0xac7e('0x7')]([_0xcab5df[_0xac7e('0xb7')],_0xcab5df[_0xac7e('0xb8')]]);};AGIVertices[_0xac7e('0x13')][_0xac7e('0xb9')]=function(_0x58023b){logger['info'](util['format'](_0xac7e('0xba'),_0x58023b[_0xac7e('0x3d')]));if(this[_0xac7e('0x89')](_0x58023b[_0xac7e('0x6a')])){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x58023b['timeout']));var _0x1642e0=this['channel'][_0xac7e('0xbb')](_0x58023b[_0xac7e('0x6a')]);if(_0x1642e0['result']===-0x1){return _0x1642e0;}}return this['channel'][_0xac7e('0xb9')]();};AGIVertices[_0xac7e('0x13')][_0xac7e('0x4e')]=function(_0x1cce86){logger[_0xac7e('0x32')](util['format'](_0xac7e('0xbc'),_0x1cce86[_0xac7e('0x3d')]));if(!this[_0xac7e('0x89')](_0x1cce86['list_id'])){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x1cce86,_0xac7e('0xbd'));}_0x1cce86[_0xac7e('0x4d')]=moment();if(this[_0xac7e('0x89')](_0x1cce86[_0xac7e('0xbe')])){_0x1cce86[_0xac7e('0x4d')]=moment()[_0xac7e('0xbf')](_0x1cce86[_0xac7e('0xbe')],'minutes');}if(!this[_0xac7e('0x89')](_0x1cce86[_0xac7e('0x4f')])){_0x1cce86[_0xac7e('0x4f')]=0x2;}this['createCmContact'][_0xac7e('0x74')](this,_0x1cce86);return this[_0xac7e('0x10')]['noop'](util[_0xac7e('0x2d')](_0xac7e('0xc0'),_0x1cce86[_0xac7e('0x4b')],_0x1cce86[_0xac7e('0x4c')],_0x1cce86[_0xac7e('0x4d')]));};AGIVertices[_0xac7e('0x13')][_0xac7e('0xc1')]=function(_0x4c1c49){logger['info'](util[_0xac7e('0x2d')](_0xac7e('0xc2'),_0x4c1c49[_0xac7e('0x3d')]));var _0x3fb996=this[_0xac7e('0x10')][_0xac7e('0x59')](_0x4c1c49[_0xac7e('0xc3')],_0x4c1c49['options']);if(_0x3fb996[_0xac7e('0xad')]===-0x1){return _0x3fb996;}return this['channel']['noop'](util[_0xac7e('0x2d')](_0xac7e('0xc4'),_0x4c1c49[_0xac7e('0xc3')],_0x4c1c49[_0xac7e('0x7b')]));};AGIVertices['prototype'][_0xac7e('0xc5')]=function(_0x638ee8){logger['info'](util['format'](_0xac7e('0xc6'),_0x638ee8[_0xac7e('0x3d')]));if(!this['isConfigured'](_0x638ee8[_0xac7e('0x5f')])){return this[_0xac7e('0x10')][_0xac7e('0xaa')]('no\x20text\x20configured');}var _0x426ec2='\x22'+_0x638ee8['text']+'\x22';if(this[_0xac7e('0x89')](_0x638ee8['options'])){_0x426ec2+=','+_0x638ee8[_0xac7e('0x7b')];}var _0x4123a4=this['channel'][_0xac7e('0x59')](_0xac7e('0xac'),_0x426ec2);if(_0x4123a4[_0xac7e('0xad')]===-0x1){return _0x4123a4;}return this[_0xac7e('0x10')][_0xac7e('0xaa')](util['format'](_0xac7e('0xae'),_0x426ec2));};AGIVertices[_0xac7e('0x13')][_0xac7e('0xc7')]=function(_0x5a2372){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0xc8'),_0x5a2372[_0xac7e('0x3d')]));if(!this['isConfigured'](_0x5a2372['text'])){return this[_0xac7e('0x10')]['noop'](_0xac7e('0xab'));}var _0x15344b='\x22'+_0x5a2372[_0xac7e('0x5f')]+'\x22';if(this['isConfigured'](_0x5a2372['options'])){_0x15344b+=','+_0x5a2372[_0xac7e('0x7b')];}var _0x1805fc=this[_0xac7e('0x10')][_0xac7e('0x59')](_0xac7e('0xac'),_0x15344b);if(_0x1805fc[_0xac7e('0xad')]===-0x1){return _0x1805fc;}return this[_0xac7e('0x10')][_0xac7e('0xaa')](util['format'](_0xac7e('0xae'),_0x15344b));};AGIVertices[_0xac7e('0x13')][_0xac7e('0xc9')]=function(_0x4820ce){logger['info'](util[_0xac7e('0x2d')](_0xac7e('0xca'),_0x4820ce[_0xac7e('0x3d')]));if(!this[_0xac7e('0x89')](_0x4820ce[_0xac7e('0xaf')])){return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0xb0'));}var _0x181c50=_0x4820ce[_0xac7e('0xaf')];if(this['isConfigured'](_0x4820ce[_0xac7e('0x7b')])){_0x181c50+=','+_0x4820ce[_0xac7e('0x7b')];}var _0x3739ab=this['channel'][_0xac7e('0x59')](_0xac7e('0xb1'),_0x181c50);if(_0x3739ab[_0xac7e('0xad')]===-0x1){return _0x3739ab;}var _0x373982=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xac7e('0xcb'));if(_0x373982[_0xac7e('0xad')]===-0x1){return _0x373982;}var _0x509e10=this['getAndSetVariable'](_0xac7e('0xb4'),_0xac7e('0xcc'));if(_0x509e10['result']===-0x1){return _0x509e10;}var _0x326364=this[_0xac7e('0xa5')](_0xac7e('0xcd'),_0xac7e('0xce'));if(_0x326364['result']===-0x1){return _0x326364;}return this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0xcf'),_0x181c50));};AGIVertices[_0xac7e('0x13')][_0xac7e('0xd0')]=function(_0x26af56){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0xd1'),_0x26af56[_0xac7e('0x3d')]));if(!this[_0xac7e('0x89')](_0x26af56[_0xac7e('0xaf')])){return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0xb0'));}var _0x52169b=_0x26af56[_0xac7e('0xaf')];if(this[_0xac7e('0x89')](_0x26af56['options'])){_0x52169b+=','+_0x26af56[_0xac7e('0x7b')];}var _0x2e3076=this['channel'][_0xac7e('0x59')](_0xac7e('0xb1'),_0x52169b);if(_0x2e3076[_0xac7e('0xad')]===-0x1){return _0x2e3076;}var _0x541752=this[_0xac7e('0xa5')](_0xac7e('0xb2'),_0xac7e('0xd2'));if(_0x541752[_0xac7e('0xad')]===-0x1){return _0x541752;}var _0x229623=this['getAndSetVariable'](_0xac7e('0xb4'),'SESTEK_ASR_TRANSCRIPT');if(_0x229623['result']===-0x1){return _0x229623;}var _0x42cd5b=this[_0xac7e('0xa5')](_0xac7e('0xcd'),_0xac7e('0xd3'));if(_0x42cd5b[_0xac7e('0xad')]===-0x1){return _0x42cd5b;}return this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0xcf'),_0x52169b));};AGIVertices['prototype'][_0xac7e('0xd4')]=function(_0x154d57){logger['info'](util[_0xac7e('0x2d')](_0xac7e('0xd5'),_0x154d57[_0xac7e('0x3d')]));if(!this['isConfigured'](_0x154d57[_0xac7e('0xd6')])){return this['channel'][_0xac7e('0x37')](_0x154d57,_0xac7e('0xd7'));}var _0x29761d=this['getSquareOdbc'][_0xac7e('0x74')](this,_0x154d57[_0xac7e('0xd6')]);if(!_0x29761d){return this[_0xac7e('0x10')]['error'](_0x154d57,'no\x20odbc\x20database\x20found');}if(!this[_0xac7e('0x89')](_0x154d57[_0xac7e('0x33')])){return this['channel'][_0xac7e('0x37')](_0x154d57,_0xac7e('0xd8'));}var _0x2efa89=_0x154d57[_0xac7e('0x33')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xac7e('0xaa')](util['format'](_0xac7e('0xd9'),_0x2efa89));var _0x191239=this[_0xac7e('0x2f')][_0xac7e('0x74')](this,_0x29761d,_0x2efa89);this[_0xac7e('0x3c')]['sync'](this,_0x154d57,_0x2efa89);if(!this[_0xac7e('0x89')](_0x154d57['variable_id'])){return this[_0xac7e('0x10')][_0xac7e('0xaa')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1313d1=this['getVariable'][_0xac7e('0x74')](this,_0x154d57[_0xac7e('0xda')]);if(!_0x1313d1){return this['channel']['error'](_0x154d57,_0xac7e('0xdb'));}var _0x7c9227=this;_0x191239['forEach'](function(_0x2169f8,_0x327f5a){Object[_0xac7e('0xdc')](_0x2169f8)[_0xac7e('0xdd')](function(_0x1c1fea){_0x7c9227[_0xac7e('0x10')][_0xac7e('0xa2')](util[_0xac7e('0x2d')](_0xac7e('0xde'),_0x1313d1,_0x327f5a,_0x1c1fea),_0x2169f8[_0x1c1fea]);});});this['channel'][_0xac7e('0xa2')](util[_0xac7e('0x2d')](_0xac7e('0xdf'),_0x1313d1),_0x191239[_0xac7e('0x9f')]);return this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0xe0'),_0x1313d1));};AGIVertices[_0xac7e('0x13')][_0xac7e('0xe1')]=function(_0x1bc78a){logger[_0xac7e('0xe2')](util[_0xac7e('0x2d')](_0xac7e('0xe3'),_0x1bc78a['label']));if(!this[_0xac7e('0x89')](_0x1bc78a['sip_id'])){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x1bc78a,'no\x20user\x20selected');}var _0x248a80=this['getUser'][_0xac7e('0x74')](this,_0x1bc78a[_0xac7e('0xe4')]);if(!_0x248a80){return this[_0xac7e('0x10')]['error'](_0x1bc78a,_0xac7e('0xe5'));}var _0x414aae=this[_0xac7e('0x10')]['exec'](_0xac7e('0xe6'),[util[_0xac7e('0x2d')]('SIP/%s',_0x248a80),_0x1bc78a[_0xac7e('0x6a')],_0x1bc78a['opts'],_0x1bc78a['url']]);if(_0x414aae['result']===-0x1){return _0x414aae;}return this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0xe7'),_0xac7e('0xe6')));};AGIVertices[_0xac7e('0x13')][_0xac7e('0xe8')]=function(_0x670126){logger['info'](util['format'](_0xac7e('0xe9'),_0x670126[_0xac7e('0x3d')]));if(!this[_0xac7e('0x89')](_0x670126[_0xac7e('0x7d')])){return this['channel'][_0xac7e('0xaa')](_0xac7e('0xea'));}if(!this[_0xac7e('0x89')](_0x670126[_0xac7e('0x5f')])){return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0xab'));}this['channel'][_0xac7e('0xeb')]=!![];this[_0xac7e('0x3c')](_0x670126);this[_0xac7e('0x45')](_0x670126[_0xac7e('0x5f')],'in','','');this['channel'][_0xac7e('0xaa')](util['format'](_0xac7e('0xec'),_0x670126[_0xac7e('0x5f')]));var _0x1143b3=this[_0xac7e('0x7c')]['sync'](this,_0x670126);if(_0x1143b3){for(var _0x22deca in _0x1143b3){if(_0x1143b3[_0xac7e('0x98')](_0x22deca)){this[_0xac7e('0x10')]['setVariable'](util['format'](_0xac7e('0xed'),_0x22deca[_0xac7e('0x6e')]()),_0x1143b3[_0x22deca]);}}this['createSquareMessage'](_0x1143b3[_0xac7e('0xee')],_0xac7e('0xef'),_0xac7e('0xe8'),'');return this['channel']['noop'](util[_0xac7e('0x2d')](_0xac7e('0xf0'),_0x1143b3[_0xac7e('0xee')]));}return this['channel']['error'](_0x670126,_0xac7e('0xf1'));};AGIVertices[_0xac7e('0x13')]['dialogflowV2']=function(_0x514d0e){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0xf2'),_0x514d0e[_0xac7e('0x3d')]));if(!this[_0xac7e('0x89')](_0x514d0e[_0xac7e('0x80')])){return this['channel']['noop'](_0xac7e('0xf3'));}if(!this[_0xac7e('0x89')](_0x514d0e['client_email'])){return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0xf4'));}if(!this[_0xac7e('0x89')](_0x514d0e[_0xac7e('0x81')])){return this[_0xac7e('0x10')][_0xac7e('0xaa')]('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x514d0e[_0xac7e('0x82')])){return this[_0xac7e('0x10')][_0xac7e('0xaa')]('no\x20anguage\x20configured');}if(!this[_0xac7e('0x89')](_0x514d0e[_0xac7e('0x5f')])){return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0xab'));}this[_0xac7e('0x10')][_0xac7e('0xeb')]=!![];this['createSquareDetailsReport'](_0x514d0e);this['createSquareMessage'](_0x514d0e[_0xac7e('0x5f')],'in','','');this[_0xac7e('0x10')]['noop'](util['format']('Trying\x20DialogflowV2:\x20%s',_0x514d0e[_0xac7e('0x5f')]));var _0x48a080=this[_0xac7e('0x7f')]['sync'](this,_0x514d0e);if(_0x48a080){for(var _0x33eb5d in _0x48a080){if(_0x48a080[_0xac7e('0x98')](_0x33eb5d)){if(_0x33eb5d!==_0xac7e('0xf5')){this['channel']['setVariable'](util[_0xac7e('0x2d')](_0xac7e('0xed'),_0x33eb5d[_0xac7e('0x6e')]()),_0x48a080[_0x33eb5d]);}}}this[_0xac7e('0x45')](_0x48a080[_0xac7e('0xee')],_0xac7e('0xef'),_0xac7e('0xf6'),_0x48a080[_0xac7e('0xf5')]);return this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0xf7'),_0x48a080[_0xac7e('0xee')]));}return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x514d0e,_0xac7e('0xf8'));};AGIVertices[_0xac7e('0x13')]['sesteknda']=function(_0x4cd9ff){logger[_0xac7e('0x32')](util['format'](_0xac7e('0xf9'),_0x4cd9ff[_0xac7e('0x3d')]));if(!this[_0xac7e('0x89')](_0x4cd9ff[_0xac7e('0xfa')])){return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0xfb'));}if(!this['isConfigured'](_0x4cd9ff[_0xac7e('0xfc')])){return this[_0xac7e('0x10')]['noop']('no\x20username\x20configured');}if(!this[_0xac7e('0x89')](_0x4cd9ff['password'])){return this[_0xac7e('0x10')]['noop'](_0xac7e('0xfd'));}if(!this[_0xac7e('0x89')](_0x4cd9ff[_0xac7e('0xfe')])){return this['channel'][_0xac7e('0xaa')](_0xac7e('0xab'));}this[_0xac7e('0x10')][_0xac7e('0xeb')]=!![];this[_0xac7e('0x3c')](_0x4cd9ff);this[_0xac7e('0x45')](_0x4cd9ff[_0xac7e('0x5f')],'in','','');this[_0xac7e('0x10')][_0xac7e('0xaa')](util['format'](_0xac7e('0xff'),_0x4cd9ff[_0xac7e('0x5f')]));var _0x546366=this[_0xac7e('0x83')][_0xac7e('0x74')](this,_0x4cd9ff);if(_0x546366){for(var _0x4f2a59 in _0x546366){if(_0x546366[_0xac7e('0x98')](_0x4f2a59)){this['channel'][_0xac7e('0xa2')](util[_0xac7e('0x2d')]('SESTEK_NDA_%s',_0x4f2a59[_0xac7e('0x6e')]()),_0x546366[_0x4f2a59]);}}this[_0xac7e('0x45')](_0x546366['speech'],_0xac7e('0xef'),_0xac7e('0x100'),'');if(_0x546366[_0xac7e('0x101')]){this[_0xac7e('0x10')]['noop'](util[_0xac7e('0x2d')](_0xac7e('0x102'),_0x546366[_0xac7e('0x101')]));var _0x1ffdb3=this['channel'][_0xac7e('0x103')](_0x546366[_0xac7e('0x101')]);try{fs[_0xac7e('0x104')](_0x546366['audiofile']+_0xac7e('0x105'));}catch(_0x58af2c){logger['error'](_0x58af2c);}return _0x1ffdb3;}else{return this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0x106'),_0x546366[_0xac7e('0xee')]));}}return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x4cd9ff,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xac7e('0x13')]['end']=function(_0x8eaf92){logger['info'](util[_0xac7e('0x2d')](_0xac7e('0x107'),_0x8eaf92['label']));return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0x108'));};AGIVertices[_0xac7e('0x13')][_0xac7e('0x109')]=function(_0x70e1b){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x10a'),_0x70e1b['label']));var _0x4e54f9='';if(_0x70e1b[_0xac7e('0x10b')]){if(!this[_0xac7e('0x89')](_0x70e1b[_0xac7e('0x10b')])){return this[_0xac7e('0x10')]['error'](_0x70e1b,_0xac7e('0x10c'));}else{var _0x2eccff=parseInt(_0x70e1b[_0xac7e('0x10b')],0xa);if(isNaN(_0x2eccff)){_0x4e54f9=_0x70e1b['trunk_id'];}else{_0x4e54f9=this[_0xac7e('0x10d')]['sync'](this,_0x70e1b[_0xac7e('0x10b')]);if(!_0x4e54f9){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x70e1b,_0xac7e('0x10e'));}}}}else if(_0x70e1b[_0xac7e('0x10f')]){_0x4e54f9=_0x70e1b[_0xac7e('0x10f')];}else{return this[_0xac7e('0x10')]['error'](_0x70e1b,'no\x20trunk\x20selected');}var _0x3ef183=this['channel']['exec'](_0xac7e('0xe6'),[util[_0xac7e('0x2d')](_0xac7e('0x110'),_0x4e54f9,_0x70e1b[_0xac7e('0x4b')]),_0x70e1b['timeout'],_0x70e1b['opts'],_0x70e1b[_0xac7e('0x68')]]);if(_0x3ef183['result']===-0x1){return _0x3ef183;}return this[_0xac7e('0x10')]['noop'](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices['prototype'][_0xac7e('0x111')]=function(_0x206ed5){logger[_0xac7e('0x32')](util['format'](_0xac7e('0x112'),_0x206ed5[_0xac7e('0x3d')]));return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0x111'));};AGIVertices['prototype'][_0xac7e('0xf')]=function(_0x6388e1){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x113'),_0x6388e1[_0xac7e('0x3d')]));if(_0x6388e1['retry']===0x0){return this[_0xac7e('0xa8')](_0x6388e1);}_0x6388e1['retry']-=0x1;if(!this[_0xac7e('0x89')](_0x6388e1[_0xac7e('0x114')])){return this[_0xac7e('0x10')]['error'](_0x6388e1,'no\x20file\x20audio\x20selected');}var _0x52ff5f=this[_0xac7e('0x115')][_0xac7e('0x74')](this,_0x6388e1['file_id']);if(!_0x52ff5f){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x6388e1,_0xac7e('0x116'));}if(!this[_0xac7e('0x89')](_0x6388e1[_0xac7e('0xda')])){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0xac7e('0x117'));}var _0x42c505=this[_0xac7e('0x10')][_0xac7e('0x118')](_0x52ff5f,_0x6388e1[_0xac7e('0x119')],_0x6388e1['maxdigit']);var _0x412e50=_0x42c505['result']?_0x42c505[_0xac7e('0xad')]['toString']():'';logger[_0xac7e('0x32')]('test',JSON[_0xac7e('0x77')](_0x42c505));if(_0x42c505[_0xac7e('0xad')]===-0x1){this[_0xac7e('0x3c')][_0xac7e('0x74')](this,_0x6388e1,_0x412e50);return _0x42c505;}else if(_0x42c505[_0xac7e('0xa7')]===_0xac7e('0x6a')){_0x42c505['result']=_0x412e50[_0xac7e('0x9f')]>=parseInt(_0x6388e1[_0xac7e('0x11a')])?'x':'i';}else{_0x42c505[_0xac7e('0xad')]=_0x412e50['length']>=parseInt(_0x6388e1['mindigit'])&&_0x412e50[_0xac7e('0x9f')]<=parseInt(_0x6388e1['maxdigit'])?'x':'i';}var _0x2274c7=this[_0xac7e('0x14')][_0xac7e('0x74')](this,_0x6388e1[_0xac7e('0xda')]);if(!_0x2274c7){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x6388e1,_0xac7e('0xdb'));}this[_0xac7e('0x10')][_0xac7e('0xa2')](_0x2274c7,_0x412e50);if(this[_0xac7e('0x89')](_0x6388e1[_0xac7e('0x11b')])){var _0x32d2c2=parseInt(_0x6388e1[_0xac7e('0x11b')],0xa);var _0x1a82f8=rs[_0xac7e('0x11c')]({'charset':'*','length':_0x32d2c2});var _0x39d72a=_0x412e50[_0xac7e('0x9f')];if(_0x39d72a>0x0){if(_0x39d72a>_0x32d2c2){this[_0xac7e('0x3c')][_0xac7e('0x74')](this,_0x6388e1,_0x6388e1['hiddendigitspos']===_0xac7e('0x11d')?_0x1a82f8+_0x412e50[_0xac7e('0x11e')](_0x32d2c2):_0x412e50['substr'](0x0,_0x39d72a-_0x32d2c2)+_0x1a82f8);}else{this['createSquareDetailsReport']['sync'](this,_0x6388e1,rs[_0xac7e('0x11c')]({'charset':'*','length':_0x39d72a}));}}else{this['createSquareDetailsReport'][_0xac7e('0x74')](this,_0x6388e1,'');}}else{this[_0xac7e('0x3c')][_0xac7e('0x74')](this,_0x6388e1,_0x412e50);}return _0x42c505;};AGIVertices[_0xac7e('0x13')][_0xac7e('0x11f')]=function(_0x4aba57){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x120'),_0x4aba57['label']));return this['getdigits'](_0x4aba57);};AGIVertices['prototype'][_0xac7e('0x121')]=function(_0x5e2dd9){logger['info'](util[_0xac7e('0x2d')](_0xac7e('0x122'),_0x5e2dd9['label']));this[_0xac7e('0x3c')]['sync'](this,_0x5e2dd9,_0x5e2dd9[_0xac7e('0x123')]);return this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')]('GOAL\x20%s',_0x5e2dd9['goalname']));};AGIVertices['prototype'][_0xac7e('0x124')]=function(_0xe73310){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x125'),_0xe73310[_0xac7e('0x3d')]));if(!this[_0xac7e('0x89')](_0xe73310[_0xac7e('0x90')])||!this[_0xac7e('0x89')](_0xe73310[_0xac7e('0x8c')])){return this['channel'][_0xac7e('0xaa')](_0xac7e('0x126'));}if(!this[_0xac7e('0x89')](_0xe73310[_0xac7e('0x5f')])){return this[_0xac7e('0x10')]['noop'](_0xac7e('0xab'));}this[_0xac7e('0x10')]['noop'](util[_0xac7e('0x2d')](_0xac7e('0x127'),_0xe73310[_0xac7e('0x5f')]));var _0x4f0bec=this[_0xac7e('0x8b')][_0xac7e('0x74')](this,_0xe73310);if(_0x4f0bec){this['channel'][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0x128'),_0x4f0bec));var _0x57ba93=this[_0xac7e('0x10')]['streamFile'](_0x4f0bec);try{fs[_0xac7e('0x104')](_0x4f0bec+_0xac7e('0x105'));}catch(_0xf25223){logger['error'](_0xf25223);}return _0x57ba93;}return this[_0xac7e('0x10')][_0xac7e('0x37')](_0xe73310,_0xac7e('0x129'));};AGIVertices['prototype'][_0xac7e('0x12a')]=function(_0x75a10c){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x12b'),_0x75a10c[_0xac7e('0x3d')]));if(!this[_0xac7e('0x89')](_0x75a10c[_0xac7e('0x90')])||!this[_0xac7e('0x89')](_0x75a10c[_0xac7e('0x8c')])){return this[_0xac7e('0x10')][_0xac7e('0xaa')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xac7e('0x89')](_0x75a10c[_0xac7e('0x91')])){return this['channel'][_0xac7e('0xaa')]('no\x20bot\x20name\x20configured');}if(!this[_0xac7e('0x89')](_0x75a10c[_0xac7e('0x5f')])){return this['channel'][_0xac7e('0xaa')](_0xac7e('0xab'));}this[_0xac7e('0x10')][_0xac7e('0xeb')]=!![];this[_0xac7e('0x3c')](_0x75a10c);this[_0xac7e('0x45')](_0x75a10c[_0xac7e('0x5f')],'in','','');this['channel'][_0xac7e('0xaa')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x75a10c[_0xac7e('0x5f')]));var _0x16d734=this['awsLex'][_0xac7e('0x74')](this,_0x75a10c);if(_0x16d734){for(var _0x178c55 in _0x16d734){if(_0x16d734[_0xac7e('0x98')](_0x178c55)&&_[_0xac7e('0x99')](_0x16d734[_0x178c55])){this[_0xac7e('0x10')][_0xac7e('0xa2')](util[_0xac7e('0x2d')](_0xac7e('0x12c'),_0x178c55['toUpperCase']()),_0x16d734[_0x178c55]);}}if(_[_0xac7e('0x48')](_0x16d734[_0xac7e('0x12d')])){return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0x12e'));}else{this['createSquareMessage'](_0x16d734[_0xac7e('0x12d')],_0xac7e('0xef'),_0xac7e('0x12f'),'');return this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0x130'),_0x16d734[_0xac7e('0x12d')]));}}return this['channel'][_0xac7e('0x37')](_0x75a10c,_0xac7e('0x131'));};AGIVertices[_0xac7e('0x13')]['googleasr']=function(_0x56cd34){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x132'),_0x56cd34[_0xac7e('0x3d')],_0x56cd34[_0xac7e('0x6a')]));if(!this[_0xac7e('0x89')](_0x56cd34['key'])){return this[_0xac7e('0x10')][_0xac7e('0xaa')]('no\x20key\x20configured');}var _0x1dc162=_0xac7e('0x133');var _0x51d505=util[_0xac7e('0x2d')]('%s/recordings/%s',FILES_PATH,rs[_0xac7e('0x11c')](0x4));var _0x158a9a=util[_0xac7e('0x2d')]('%s.%s',_0x51d505,_0x1dc162);var _0x162e34=!![];if(_0x56cd34[_0xac7e('0x134')]===_0xac7e('0x135')){_0x162e34=![];}var _0x394f97=this[_0xac7e('0x10')][_0xac7e('0x136')](_0x51d505,_0x1dc162,_0x56cd34[_0xac7e('0x137')],_0x56cd34[_0xac7e('0x6a')],undefined,_0x162e34);if(_0x394f97[_0xac7e('0xad')]!==-0x1){this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0x138'),_0x158a9a));var _0xfd07a6=this[_0xac7e('0x92')]['sync'](this,_0x56cd34,_0x158a9a);if(_0xfd07a6){for(var _0x204dd4 in _0xfd07a6){if(_0xfd07a6['hasOwnProperty'](_0x204dd4)){this[_0xac7e('0x10')]['setVariable'](util[_0xac7e('0x2d')](_0xac7e('0x139'),_0x204dd4[_0xac7e('0x6e')]()),_0xfd07a6[_0x204dd4]);}}return this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0x13a'),JSON['stringify'](_0xfd07a6)));}}return _0x394f97;};AGIVertices[_0xac7e('0x13')][_0xac7e('0x13b')]=function(_0x1e70d1){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x13c'),_0x1e70d1[_0xac7e('0x3d')]));if(!this[_0xac7e('0x89')](_0x1e70d1[_0xac7e('0x94')])){return this['channel']['noop'](_0xac7e('0x13d'));}if(!this[_0xac7e('0x89')](_0x1e70d1[_0xac7e('0x95')])){return this[_0xac7e('0x10')]['noop']('no\x20appsecret\x20configured');}var _0x330a97=_0xac7e('0x133');var _0x1b65da=util[_0xac7e('0x2d')](_0xac7e('0x13e'),FILES_PATH,rs[_0xac7e('0x11c')](0x4));var _0x361e59=util[_0xac7e('0x2d')](_0xac7e('0xa1'),_0x1b65da,_0x330a97);var _0x65ad55=!![];if(_0x1e70d1[_0xac7e('0x134')]===_0xac7e('0x135')){_0x65ad55=![];}var _0x2ab5e5=this[_0xac7e('0x10')][_0xac7e('0x136')](_0x1b65da,_0x330a97,_0x1e70d1[_0xac7e('0x137')],_0x1e70d1[_0xac7e('0x6a')],undefined,_0x65ad55);if(_0x2ab5e5[_0xac7e('0xad')]!==-0x1){this[_0xac7e('0x10')]['noop'](util[_0xac7e('0x2d')](_0xac7e('0x13f'),_0x361e59));var _0x10cc2d=this['tildeASR'][_0xac7e('0x74')](this,_0x1e70d1,_0x361e59);if(_0x10cc2d){for(var _0x56a12d in _0x10cc2d){if(_0x10cc2d[_0xac7e('0x98')](_0x56a12d)){this[_0xac7e('0x10')]['setVariable'](util[_0xac7e('0x2d')]('TILDE_ASR_%s',_0x56a12d[_0xac7e('0x6e')]()),_0x10cc2d[_0x56a12d]);}}return this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0x140'),JSON[_0xac7e('0x77')](_0x10cc2d)));}}return _0x2ab5e5;};AGIVertices[_0xac7e('0x13')][_0xac7e('0x141')]=function(_0x432c20){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x142'),_0x432c20[_0xac7e('0x3d')]));return this[_0xac7e('0x10')][_0xac7e('0x143')](_0x432c20[_0xac7e('0x144')],_0x432c20['extension'],_0x432c20[_0xac7e('0x145')]);};AGIVertices['prototype'][_0xac7e('0x146')]=function(_0x1f8bbf){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x147'),_0x1f8bbf[_0xac7e('0x3d')]));if(!this['isConfigured'](_0x1f8bbf[_0xac7e('0x148')])){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x1f8bbf,_0xac7e('0x149'));}try{var _0xcdee66=eval(_0x1f8bbf[_0xac7e('0x148')])?_0xac7e('0x14a'):'false';this['channel'][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0x14b'),_0x1f8bbf[_0xac7e('0x148')],_0xcdee66));return{'code':0xc8,'result':_0xcdee66};}catch(_0xea7041){return{'code':0xc8,'result':_0xac7e('0x14c')};}};AGIVertices[_0xac7e('0x13')]['gotoiftime']=function(_0x2b7517){logger['info'](util[_0xac7e('0x2d')](_0xac7e('0x14d'),_0x2b7517[_0xac7e('0x3d')]));if(!this[_0xac7e('0x89')](_0x2b7517[_0xac7e('0x14e')])){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x2b7517,_0xac7e('0x14f'));}var _0x2b5781=this['getIntervals'][_0xac7e('0x74')](this,_0x2b7517[_0xac7e('0x14e')]);if(!_0x2b5781){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x2b7517,_0xac7e('0x150'));}for(var _0x3975fb=0x0;_0x3975fb<_0x2b5781[_0xac7e('0x9f')];_0x3975fb+=0x1){var _0x5f1dbb=this[_0xac7e('0x10')]['getVariable'](util['format'](_0xac7e('0x151'),_0x2b5781[_0x3975fb]));if(_0x5f1dbb[_0xac7e('0xad')]===-0x1){return _0x5f1dbb;}logger[_0xac7e('0x32')](util[_0xac7e('0x2d')]('IFTIME\x20%s\x20%s',_0x2b5781[_0x3975fb],_0x5f1dbb[_0xac7e('0xa7')]));if(_0x5f1dbb['extra']===_0xac7e('0x14a')){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x152'),_0x2b5781[_0x3975fb],_0xac7e('0x14a')));this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0x152'),_0x2b5781[_0x3975fb],_0xac7e('0x14a')));return{'code':0xc8,'result':_0xac7e('0x14a')};}else{logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x152'),_0x2b5781[_0x3975fb],'false'));this['channel'][_0xac7e('0xaa')](util['format'](_0xac7e('0x152'),_0x2b5781[_0x3975fb],_0xac7e('0x14c')));}}return{'code':0xc8,'result':_0xac7e('0x14c')};};AGIVertices[_0xac7e('0x13')][_0xac7e('0x153')]=function(_0x85074e){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x154'),_0x85074e[_0xac7e('0x3d')]));return this[_0xac7e('0x10')][_0xac7e('0x153')]();};AGIVertices[_0xac7e('0x13')][_0xac7e('0x155')]=function(_0x1b6c19){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x156'),_0x1b6c19[_0xac7e('0x3d')]));if(!this['isConfigured'](_0x1b6c19['key'])){return this[_0xac7e('0x10')]['noop'](_0xac7e('0xea'));}var _0x2ac7ef=_0xac7e('0x133');var _0x3704ec=util[_0xac7e('0x2d')](_0xac7e('0x13e'),FILES_PATH,rs[_0xac7e('0x11c')](0x4));var _0x5a8b27=util[_0xac7e('0x2d')](_0xac7e('0xa1'),_0x3704ec,_0x2ac7ef);var _0x4f790a=!![];if(_0x1b6c19['beep']==='NOBEEP'){_0x4f790a=![];}var _0x4b0d81=this[_0xac7e('0x10')][_0xac7e('0x136')](_0x3704ec,_0x2ac7ef,_0x1b6c19[_0xac7e('0x137')],_0x1b6c19[_0xac7e('0x6a')],undefined,_0x4f790a);if(_0x4b0d81[_0xac7e('0xad')]!==-0x1){this[_0xac7e('0x10')]['noop'](util[_0xac7e('0x2d')](_0xac7e('0x157'),_0x5a8b27));var _0x329f83=this['ispeechASR'][_0xac7e('0x74')](this,_0x1b6c19,_0x5a8b27);if(_0x329f83){for(var _0x3c3d79 in _0x329f83){if(_0x329f83['hasOwnProperty'](_0x3c3d79)){this[_0xac7e('0x10')][_0xac7e('0xa2')](util[_0xac7e('0x2d')](_0xac7e('0x158'),_0x3c3d79[_0xac7e('0x6e')]()),_0x329f83[_0x3c3d79]);}}return this[_0xac7e('0x10')][_0xac7e('0xaa')](util['format']('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x329f83)));}}return _0x4b0d81;};AGIVertices[_0xac7e('0x13')][_0xac7e('0x159')]=function(_0x2e6b45){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x15a'),_0x2e6b45[_0xac7e('0x3d')]));if(!this[_0xac7e('0x89')](_0x2e6b45['key'])){return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0xea'));}if(!this[_0xac7e('0x89')](_0x2e6b45[_0xac7e('0x5f')])){return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0xab'));}this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0x15b'),_0x2e6b45['text']));var _0x23e84a=this[_0xac7e('0x84')][_0xac7e('0x74')](this,_0x2e6b45);if(_0x23e84a){this[_0xac7e('0x10')][_0xac7e('0xaa')](util['format'](_0xac7e('0x157'),_0x23e84a));var _0x5bd59c=this[_0xac7e('0x10')]['streamFile'](_0x23e84a,_0x2e6b45['intKey']);try{fs[_0xac7e('0x104')](_0x23e84a+_0xac7e('0x105'));}catch(_0x4eb07e){logger[_0xac7e('0x37')](_0x4eb07e);}return _0x5bd59c;}return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x2e6b45,_0xac7e('0x15c'));};AGIVertices[_0xac7e('0x13')][_0xac7e('0x15d')]=function(_0x503374){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x15e'),_0x503374['label']));if(!this[_0xac7e('0x89')](_0x503374['findBy'])){return this[_0xac7e('0x10')]['error'](_0x503374,_0xac7e('0x15f'));}logger[_0xac7e('0x32')](util['format'](_0xac7e('0x160'),this['channel']['callerid'],_0x503374[_0xac7e('0x161')]));var _0x5b7675=this[_0xac7e('0x55')]['sync'](this,_0x503374[_0xac7e('0x161')]);if(_0x5b7675){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x162'),this[_0xac7e('0x10')][_0xac7e('0x40')],_0x503374['findBy']));this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0x162'),this[_0xac7e('0x10')][_0xac7e('0x40')],_0x503374[_0xac7e('0x161')]));return{'code':0xc8,'result':'success'};}else{logger[_0xac7e('0x32')](util[_0xac7e('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xac7e('0x40')],_0x503374[_0xac7e('0x161')]));this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xac7e('0x40')],_0x503374[_0xac7e('0x161')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xac7e('0x13')][_0xac7e('0x163')]=function(_0xe27e1b){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x164'),_0xe27e1b['label']));if(!this[_0xac7e('0x89')](_0xe27e1b[_0xac7e('0x161')])){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0xe27e1b,_0xac7e('0x15f'));}logger['info'](util[_0xac7e('0x2d')](_0xac7e('0x160'),this[_0xac7e('0x10')][_0xac7e('0x40')],_0xe27e1b[_0xac7e('0x161')]));var _0x5d490c=this['agentLogout'][_0xac7e('0x74')](this,_0xe27e1b[_0xac7e('0x161')]);if(_0x5d490c){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x162'),this[_0xac7e('0x10')][_0xac7e('0x40')],_0xe27e1b[_0xac7e('0x161')]));this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0x162'),this[_0xac7e('0x10')][_0xac7e('0x40')],_0xe27e1b[_0xac7e('0x161')]));return{'code':0xc8,'result':_0xac7e('0x165')};}else{logger[_0xac7e('0x32')](util[_0xac7e('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xac7e('0x10')][_0xac7e('0x40')],_0xe27e1b[_0xac7e('0x161')]));this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0x166'),this[_0xac7e('0x10')][_0xac7e('0x40')],_0xe27e1b['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xac7e('0x13')][_0xac7e('0x167')]=function(_0x51ecaf){logger['info'](util[_0xac7e('0x2d')](_0xac7e('0x168'),_0x51ecaf[_0xac7e('0x3d')]));if(!this[_0xac7e('0x89')](_0x51ecaf['operation'])){return this[_0xac7e('0x10')]['error'](_0x51ecaf,_0xac7e('0x169'));}this[_0xac7e('0x10')]['noop'](util[_0xac7e('0x2d')](_0xac7e('0x16a'),_0x51ecaf[_0xac7e('0x16b')]));var _0x561250=eval(_0x51ecaf[_0xac7e('0x16b')]);if(!this[_0xac7e('0x89')](_0x51ecaf[_0xac7e('0xda')])){return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0x117'));}var _0x4ed738=this[_0xac7e('0x14')][_0xac7e('0x74')](this,_0x51ecaf[_0xac7e('0xda')]);if(!_0x4ed738){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x51ecaf,_0xac7e('0xdb'));}if(_[_0xac7e('0x9e')](_0x561250)){var _0x4acac9=this;_0x561250[_0xac7e('0xdd')](function(_0x4b177e,_0x4be38e){_0x4acac9[_0xac7e('0x10')][_0xac7e('0xa2')](util[_0xac7e('0x2d')](_0xac7e('0x16c'),_0x4ed738,_0x4be38e),_0x4b177e);});return this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0x16d'),_0x4ed738));}else{return this['channel'][_0xac7e('0xa2')](_0x4ed738,_0x561250);}};AGIVertices[_0xac7e('0x13')][_0xac7e('0xe')]=function(_0x248b4e){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x248b4e[_0xac7e('0x3d')]));if(_0x248b4e[_0xac7e('0xa9')]===0x0){return this[_0xac7e('0xa8')](_0x248b4e);}_0x248b4e[_0xac7e('0xa9')]-=0x1;if(!this['isConfigured'](_0x248b4e[_0xac7e('0x114')])){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x248b4e,_0xac7e('0x16e'));}var _0x2ff82d=this['getSound'][_0xac7e('0x74')](this,_0x248b4e['file_id']);if(!_0x2ff82d){return this['channel']['error'](_0x248b4e,'no\x20file\x20audio\x20found');}var _0x201054=this['channel'][_0xac7e('0x118')](_0x2ff82d,_0x248b4e[_0xac7e('0x119')],_0x248b4e[_0xac7e('0x16f')]);var _0x4247cf=_0x201054[_0xac7e('0xad')];if(_0x201054[_0xac7e('0xad')]===-0x1){this[_0xac7e('0x3c')][_0xac7e('0x74')](this,_0x248b4e,'-1');return _0x201054;}else if(_0x201054[_0xac7e('0xa7')]===_0xac7e('0x6a')){_0x201054[_0xac7e('0xad')]=_0x201054[_0xac7e('0xad')][_0xac7e('0x9f')]>0x0?_0x201054[_0xac7e('0xad')]:'t';}else if(_['isEmpty'](_0x201054[_0xac7e('0xad')])){_0x201054[_0xac7e('0xad')]='#';_0x4247cf='#';}if(!this['isConfigured'](_0x248b4e[_0xac7e('0xda')])){this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0x117'));}else{var _0x1f0998=this[_0xac7e('0x14')][_0xac7e('0x74')](this,_0x248b4e['variable_id']);if(!_0x1f0998){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x248b4e,_0xac7e('0xdb'));}this['channel']['setVariable'](_0x1f0998,_0x4247cf);}this[_0xac7e('0x3c')][_0xac7e('0x74')](this,_0x248b4e,_0x4247cf);return _0x201054;};AGIVertices[_0xac7e('0x13')][_0xac7e('0xaa')]=function(_0x554590){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x170'),_0x554590['label']));return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0x554590[_0xac7e('0x171')]||_0x554590[_0xac7e('0x3d')]);};AGIVertices['prototype'][_0xac7e('0x172')]=function(_0x462d67){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x173'),_0x462d67[_0xac7e('0x3d')]));if(!this[_0xac7e('0x89')](_0x462d67[_0xac7e('0x161')])){return this['channel'][_0xac7e('0x37')](_0x462d67,'no\x20find\x20by\x20configured');}logger[_0xac7e('0x32')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel']['callerid'],_0x462d67['findBy']));var _0x29d05a=this[_0xac7e('0x174')][_0xac7e('0x74')](this,_0x462d67[_0xac7e('0x175')]);var _0x2aba67=this[_0xac7e('0x51')][_0xac7e('0x74')](this,_0x462d67[_0xac7e('0x161')],_0x29d05a);if(_0x2aba67){logger[_0xac7e('0x32')](util['format'](_0xac7e('0x162'),this[_0xac7e('0x10')][_0xac7e('0x40')],_0x462d67[_0xac7e('0x161')]));this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0x162'),this['channel'][_0xac7e('0x40')],_0x462d67['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xac7e('0x32')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xac7e('0x10')][_0xac7e('0x40')],_0x462d67[_0xac7e('0x161')]));this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xac7e('0x10')][_0xac7e('0x40')],_0x462d67[_0xac7e('0x161')]));return{'code':0xc8,'result':_0xac7e('0x176')};}};AGIVertices[_0xac7e('0x13')][_0xac7e('0x177')]=function(_0x304ef6){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x178'),_0x304ef6[_0xac7e('0x3d')]));if(!this[_0xac7e('0x89')](_0x304ef6[_0xac7e('0x114')])){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x304ef6,'no\x20file\x20audio\x20selected');}var _0x52d84b=this[_0xac7e('0x115')][_0xac7e('0x74')](this,_0x304ef6[_0xac7e('0x114')]);if(!_0x52d84b){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x304ef6,'no\x20file\x20audio\x20found');}var _0x1a0e85=this[_0xac7e('0x10')][_0xac7e('0x59')](_0xac7e('0x179'),[_0x52d84b,_0x304ef6[_0xac7e('0x17a')]]);if(_0x1a0e85['result']===-0x1){return _0x1a0e85;}return this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')]('Executed\x20command\x20%s\x20%s',_0xac7e('0x179'),_0x52d84b));};AGIVertices[_0xac7e('0x13')][_0xac7e('0x17b')]=function(_0x1cbc9f){logger['info'](util[_0xac7e('0x2d')](_0xac7e('0x17c'),_0x1cbc9f[_0xac7e('0x3d')]));if(!this['isConfigured'](_0x1cbc9f[_0xac7e('0x17d')])){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x1cbc9f,_0xac7e('0x17e'));}var _0x59d756='';var _0x578857=parseInt(_0x1cbc9f[_0xac7e('0x17d')],0xa);if(isNaN(_0x578857)){_0x59d756=_0x1cbc9f[_0xac7e('0x17d')];}else{_0x59d756=this[_0xac7e('0x17')][_0xac7e('0x74')](this,_0x1cbc9f[_0xac7e('0x17d')]);if(!_0x59d756){return this['channel']['error'](_0x1cbc9f,_0xac7e('0x17f'));}}var _0x49dae7='';if(this['isConfigured'](_0x1cbc9f[_0xac7e('0x114')])){var _0xd5eac1=this[_0xac7e('0x115')]['sync'](this,_0x1cbc9f[_0xac7e('0x114')]);if(_0xd5eac1){_0x49dae7=_0xd5eac1;}}this[_0xac7e('0x3c')][_0xac7e('0x74')](this,_0x1cbc9f,_0x59d756);if(_0x1cbc9f[_0xac7e('0x17a')]['indexOf']('x')<0x0){_0x1cbc9f[_0xac7e('0x17a')]+='x';}if(_0x1cbc9f[_0xac7e('0x17a')]['indexOf']('X')<0x0){_0x1cbc9f[_0xac7e('0x17a')]+='X';}this['channel']['setVariable']('XMCS-QUEUE',_0x59d756?_0x59d756[_0xac7e('0x180')]():'');var _0x62293c=this[_0xac7e('0x10')][_0xac7e('0x59')]('QUEUE',[_0x59d756,_0x1cbc9f[_0xac7e('0x17a')],_0x1cbc9f[_0xac7e('0x68')],_0x49dae7,_0x1cbc9f[_0xac7e('0x6a')],_0x1cbc9f[_0xac7e('0x7')],_0x1cbc9f['macro'],_0x1cbc9f[_0xac7e('0x181')],'',_0x1cbc9f[_0xac7e('0x182')]]);if(_0x62293c[_0xac7e('0xad')]===-0x1){return _0x62293c;}return this[_0xac7e('0x10')][_0xac7e('0xaa')](util['format'](_0xac7e('0xc4'),_0xac7e('0x183'),_0x59d756));};AGIVertices[_0xac7e('0x13')]['record']=function(_0x440dfb){logger['info'](util[_0xac7e('0x2d')](_0xac7e('0x184'),_0x440dfb[_0xac7e('0x3d')]));var _0x4bcead=_0x440dfb[_0xac7e('0x185')]||'wav';var _0x2d387b=util[_0xac7e('0x2d')](_0xac7e('0x186'),this['channel'][_0xac7e('0x42')],rs['generate'](0x5));var _0x5c0a59=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x2d387b,_0x4bcead);var _0x212ad3=util[_0xac7e('0x2d')](_0xac7e('0x13e'),FILES_PATH,_0x2d387b);this[_0xac7e('0x41')]['sync'](this,_0x440dfb,_0x2d387b,_0x5c0a59);this[_0xac7e('0x10')][_0xac7e('0xa2')](_0xac7e('0x187'),_0x2d387b);logger[_0xac7e('0x32')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x212ad3,_0x4bcead,_0x440dfb[_0xac7e('0x188')],_0x440dfb[_0xac7e('0x6a')]);return this[_0xac7e('0x10')][_0xac7e('0x136')](_0x212ad3,_0x4bcead,_0x440dfb['escape_digits'],_0x440dfb[_0xac7e('0x6a')],undefined,!![]);};AGIVertices[_0xac7e('0x13')][_0xac7e('0x189')]=function(_0x1799ba){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x18a'),_0x1799ba[_0xac7e('0x3d')]));if(!this[_0xac7e('0x89')](_0x1799ba[_0xac7e('0x68')])){return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0x18b'));}var _0xeb5468=this[_0xac7e('0x67')][_0xac7e('0x74')](this,_0x1799ba);logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x18c'),util[_0xac7e('0x18d')](_0xeb5468,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x1799ba[_0xac7e('0xda')])){return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0x18e'));}var _0x528bb8=this[_0xac7e('0x14')][_0xac7e('0x74')](this,_0x1799ba[_0xac7e('0xda')]);if(!_0x528bb8){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x1799ba,'no\x20variable\x20found');}this['channel']['setVariable'](util[_0xac7e('0x2d')](_0xac7e('0x18f'),_0x528bb8),_0xeb5468['statusCode']?_0xeb5468[_0xac7e('0x79')]:_0xac7e('0x190'));this['channel'][_0xac7e('0xa2')](util[_0xac7e('0x2d')]('%s_STATUS_MESSAGE',_0x528bb8),_0xeb5468[_0xac7e('0x7a')]?_0xeb5468[_0xac7e('0x7a')]:'OK');if(_0xeb5468[_0xac7e('0x6f')]){try{this[_0xac7e('0xa0')](_0xeb5468[_0xac7e('0x6f')],_0x528bb8);}catch(_0x45b814){logger[_0xac7e('0x37')](util[_0xac7e('0x2d')](_0xac7e('0x191'),_0x528bb8));}}return this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')]('variable\x20%s\x20set',_0x528bb8));};AGIVertices[_0xac7e('0x13')]['saydigits']=function(_0x53258a){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x53258a['label']));return this['channel'][_0xac7e('0x192')](_0x53258a['digits'][_0xac7e('0x5b')](/\s+/g,''),_0x53258a[_0xac7e('0x188')]);};AGIVertices['prototype'][_0xac7e('0x193')]=function(_0x39c06e){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x194'),_0x39c06e[_0xac7e('0x3d')]));return this['channel'][_0xac7e('0x195')](_0x39c06e[_0xac7e('0x6b')][_0xac7e('0x5b')](/\s+/g,''),_0x39c06e[_0xac7e('0x188')]);};AGIVertices[_0xac7e('0x13')][_0xac7e('0x196')]=function(_0x494d5b){logger['info'](util[_0xac7e('0x2d')](_0xac7e('0x197'),_0x494d5b[_0xac7e('0x3d')]));return this[_0xac7e('0x10')][_0xac7e('0x198')](_0x494d5b[_0xac7e('0x5f')],_0x494d5b[_0xac7e('0x188')]);};AGIVertices[_0xac7e('0x13')][_0xac7e('0x199')]=function(_0x2228f3){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x2228f3[_0xac7e('0x3d')]));if(!this[_0xac7e('0x89')](_0x2228f3['account_id'])){return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0x19a'));}var _0x401e56=this[_0xac7e('0x24')][_0xac7e('0x74')](this,_0x2228f3[_0xac7e('0x19b')]);if(!_0x401e56||!_0x401e56[_0xac7e('0x19c')]){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x2228f3,'no\x20mail\x20account\x20found');}var _0x2cf4bc={'from':util['format']('\x22%s\x22\x20<%s>',_0x401e56['name'],_0x401e56[_0xac7e('0x19d')]||_0x401e56[_0xac7e('0x19c')][_0xac7e('0x19e')]),'to':_0x2228f3['to']||'','cc':_0x2228f3['cc']||'','bcc':_0x2228f3[_0xac7e('0x19f')]||'','subject':_0x2228f3[_0xac7e('0x1a0')],'html':_0x2228f3[_0xac7e('0x5f')],'text':_0x2228f3[_0xac7e('0x5f')]};if(this[_0xac7e('0x89')](_0x2228f3[_0xac7e('0x1a1')])){}logger[_0xac7e('0xe2')](_0xac7e('0x1a2'),JSON[_0xac7e('0x77')](_0x2cf4bc));this[_0xac7e('0x3c')][_0xac7e('0x74')](this,_0x2228f3,_0x2228f3[_0xac7e('0x19b')]);this[_0xac7e('0x10')]['noop'](util[_0xac7e('0x2d')](_0xac7e('0x1a3'),_0x401e56[_0xac7e('0x16')]));this['sendMailMessage']['sync'](this,_0x401e56[_0xac7e('0x1a4')],_0x2cf4bc);return this[_0xac7e('0x10')]['noop'](_0xac7e('0x1a5'));};AGIVertices['prototype'][_0xac7e('0x1a6')]=function(_0x26b2c5){logger['info'](util[_0xac7e('0x2d')](_0xac7e('0x1a7'),_0x26b2c5['label']));return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0x1a8'));};AGIVertices['prototype'][_0xac7e('0x1a9')]=function(_0x3a041b){logger['info'](util[_0xac7e('0x2d')](_0xac7e('0x1aa'),_0x3a041b['label']));if(!this['isConfigured'](_0x3a041b['sms_account_id'])){return this[_0xac7e('0x10')]['noop'](_0xac7e('0x1ab'));}var _0x4d7688=this[_0xac7e('0x39')]['sync'](this,_0x3a041b[_0xac7e('0x1ac')]);if(!_0x4d7688){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x3a041b,_0xac7e('0x1ad'));}var _0x28f98b={'body':_0x3a041b[_0xac7e('0x1ae')],'phone':_0x3a041b['to']||'','SmsAccountId':_0x4d7688['id']};logger[_0xac7e('0xe2')]('sendSMS\x20message',JSON[_0xac7e('0x77')](_0x28f98b));this[_0xac7e('0x3c')][_0xac7e('0x74')](this,_0x3a041b,_0x3a041b[_0xac7e('0x1ac')]);this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0x1af'),_0x4d7688[_0xac7e('0x16')]));this['createSmsMessage'][_0xac7e('0x74')](this,_0x28f98b);return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0x1b0'));};AGIVertices['prototype'][_0xac7e('0x1b1')]=function(_0x17c5c4){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x1b2'),_0x17c5c4[_0xac7e('0x3d')]));if(!this[_0xac7e('0x89')](_0x17c5c4['variable_id'])){return this['channel'][_0xac7e('0x37')](_0x17c5c4,'no\x20variable\x20selected');}var _0x5aa7d9=this[_0xac7e('0x14')][_0xac7e('0x74')](this,_0x17c5c4[_0xac7e('0xda')]);if(!_0x5aa7d9){return this[_0xac7e('0x10')]['error'](_0x17c5c4,_0xac7e('0xdb'));}return this[_0xac7e('0x10')]['setVariable'](_0x5aa7d9,_0x17c5c4[_0xac7e('0x1b3')]);};AGIVertices['prototype'][_0xac7e('0x1b4')]=function(_0x5d9bf7){logger['info'](util[_0xac7e('0x2d')](_0xac7e('0x1b5'),_0x5d9bf7[_0xac7e('0x3d')]));this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0x1b6'));if(_0x5d9bf7[_0xac7e('0xb9')]===_0xac7e('0x1b7')){this[_0xac7e('0x10')][_0xac7e('0xaa')]('Answer');return this[_0xac7e('0x10')]['answer']();}return this[_0xac7e('0x10')][_0xac7e('0xaa')](_0xac7e('0x1b8'));};AGIVertices[_0xac7e('0x13')][_0xac7e('0x1b9')]=function(_0x3c3b6f){logger['info'](util['format'](_0xac7e('0x1ba'),_0x3c3b6f[_0xac7e('0x3d')]));if(!this[_0xac7e('0x89')](_0x3c3b6f[_0xac7e('0x1bb')])){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x3c3b6f,_0xac7e('0x1bc'));}var _0x1f1a95=this[_0xac7e('0x1b')]['sync'](this,_0x3c3b6f[_0xac7e('0x1bb')]);if(!this[_0xac7e('0x89')](_0x1f1a95)){return this['channel'][_0xac7e('0x37')](_0x3c3b6f,util[_0xac7e('0x2d')](_0xac7e('0x1bd'),_0x3c3b6f[_0xac7e('0x1bb')]));}if(_0x1f1a95===this[_0xac7e('0x10')][_0xac7e('0x3f')]){return this['channel'][_0xac7e('0x37')](_0x3c3b6f,_0xac7e('0x1be'));}this[_0xac7e('0x3c')][_0xac7e('0x74')](this,_0x3c3b6f,_0x1f1a95);var _0x4b6944=this[_0xac7e('0x10')][_0xac7e('0x59')](_0xac7e('0x1bf'),util[_0xac7e('0x2d')](_0xac7e('0x1c0'),config[_0xac7e('0x7')][_0xac7e('0x1c1')]||_0xac7e('0x1c2'),_0x1f1a95,this[_0xac7e('0x10')]['arg_1']));if(_0x4b6944[_0xac7e('0xad')]===-0x1){return _0x4b6944;}return this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0xc4'),_0xac7e('0x1bf'),_0x1f1a95));};AGIVertices['prototype'][_0xac7e('0x1c3')]=function(_0x3b8683){logger['info'](util[_0xac7e('0x2d')](_0xac7e('0x1c4'),_0x3b8683[_0xac7e('0x3d')]));var _0x704375=this['shellCommand'][_0xac7e('0x74')](this,_0x3b8683[_0xac7e('0xb7')]);this[_0xac7e('0x3c')]['sync'](this,_0x3b8683,_0x3b8683[_0xac7e('0xb7')]);if(this[_0xac7e('0x89')](_0x3b8683[_0xac7e('0xda')])){var _0x271097=this[_0xac7e('0x14')][_0xac7e('0x74')](this,_0x3b8683['variable_id']);if(_0x271097){this[_0xac7e('0x10')][_0xac7e('0xa2')](_0x271097,_0x704375);return this[_0xac7e('0x10')]['noop'](util[_0xac7e('0x2d')](_0xac7e('0x1c5'),_0x3b8683[_0xac7e('0xb7')],_0x271097));}}return this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x3b8683[_0xac7e('0xb7')]));};AGIVertices[_0xac7e('0x13')][_0xac7e('0x1c6')]=function(_0x11235e){logger[_0xac7e('0x32')](util['format'](_0xac7e('0x1c7'),_0x11235e[_0xac7e('0x3d')]));_0x11235e[_0xac7e('0x5f')]=_0x11235e[_0xac7e('0x5f')][_0xac7e('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xac7e('0x89')](_0x11235e[_0xac7e('0x5d')])){return this[_0xac7e('0x10')]['noop'](_0xac7e('0x1c8'));}if(!this[_0xac7e('0x89')](_0x11235e[_0xac7e('0x5f')])){return this[_0xac7e('0x10')][_0xac7e('0xaa')]('no\x20text\x20configured');}this['channel'][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0x1c9'),_0x11235e[_0xac7e('0x5f')]));var _0x424adf=this[_0xac7e('0x5c')][_0xac7e('0x74')](this,_0x11235e);if(_0x424adf){this['channel'][_0xac7e('0xaa')](util[_0xac7e('0x2d')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x424adf));var _0x4ffb1b=this[_0xac7e('0x10')][_0xac7e('0x103')](_0x424adf);try{fs[_0xac7e('0x104')](_0x424adf+_0xac7e('0x105'));}catch(_0x419ed){logger[_0xac7e('0x37')](_0x419ed);}return _0x4ffb1b;}return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x11235e,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xac7e('0x13')]['tts']=function(_0x3a3aa1){logger[_0xac7e('0x32')](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x3a3aa1[_0xac7e('0x3d')]));_0x3a3aa1['text']=_0x3a3aa1[_0xac7e('0x5f')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xac7e('0x89')](_0x3a3aa1[_0xac7e('0x5f')])){return this[_0xac7e('0x10')][_0xac7e('0xaa')]('no\x20text\x20configured');}this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0x1ca'),_0x3a3aa1[_0xac7e('0x5f')]));var _0x13337d=this[_0xac7e('0x65')][_0xac7e('0x74')](this,_0x3a3aa1);if(_0x13337d){this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0x1cb'),_0x13337d));var _0x25ad1c=this[_0xac7e('0x10')][_0xac7e('0x103')](_0x13337d);try{fs['unlink'](_0x13337d+_0xac7e('0x105'));}catch(_0x412830){logger[_0xac7e('0x37')](_0x412830);}return _0x25ad1c;}return this['channel'][_0xac7e('0x37')](_0x3a3aa1,_0xac7e('0x1cc'));};AGIVertices[_0xac7e('0x13')][_0xac7e('0x1cd')]=function(_0x1a81cb){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x1a81cb['label']));if(!this[_0xac7e('0x89')](_0x1a81cb[_0xac7e('0x161')])){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x1a81cb,'no\x20find\x20by\x20configured');}logger[_0xac7e('0x32')](util[_0xac7e('0x2d')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xac7e('0x10')][_0xac7e('0x40')],_0x1a81cb[_0xac7e('0x161')]));var _0x4fbc2d=this['agentUnpause'][_0xac7e('0x74')](this,_0x1a81cb[_0xac7e('0x161')]);if(_0x4fbc2d){logger[_0xac7e('0x32')](util['format'](_0xac7e('0x162'),this[_0xac7e('0x10')][_0xac7e('0x40')],_0x1a81cb[_0xac7e('0x161')]));this[_0xac7e('0x10')][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0x162'),this[_0xac7e('0x10')]['callerid'],_0x1a81cb[_0xac7e('0x161')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format'](_0xac7e('0x166'),this[_0xac7e('0x10')][_0xac7e('0x40')],_0x1a81cb[_0xac7e('0x161')]));this['channel']['noop'](util[_0xac7e('0x2d')](_0xac7e('0x166'),this[_0xac7e('0x10')][_0xac7e('0x40')],_0x1a81cb['findBy']));return{'code':0xc8,'result':_0xac7e('0x176')};}};AGIVertices['prototype']['voicemail']=function(_0x2b3fdd){logger[_0xac7e('0x32')](util['format'](_0xac7e('0x1ce'),_0x2b3fdd[_0xac7e('0x3d')]));var _0x5b39be=this[_0xac7e('0x10')][_0xac7e('0x59')](_0xac7e('0x1cf'),[_0x2b3fdd['mailbox'],_0x2b3fdd[_0xac7e('0x7b')]]);if(_0x5b39be[_0xac7e('0xad')]===-0x1){return _0x5b39be;}return this['channel'][_0xac7e('0xaa')](util[_0xac7e('0x2d')](_0xac7e('0xc4'),_0xac7e('0x1cf'),_0x2b3fdd[_0xac7e('0x1d0')]));};AGIVertices[_0xac7e('0x13')][_0xac7e('0x1d1')]=function(_0x55b9b2){logger[_0xac7e('0x32')](util[_0xac7e('0x2d')](_0xac7e('0x1d2'),_0x55b9b2['label']));if(!this[_0xac7e('0x89')](_0x55b9b2[_0xac7e('0xda')])){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x55b9b2,_0xac7e('0x1d3'));}var _0x22f6c1=this['getVariable'][_0xac7e('0x74')](this,_0x55b9b2[_0xac7e('0xda')]);if(!_0x22f6c1){return this[_0xac7e('0x10')][_0xac7e('0x37')](_0x55b9b2,_0xac7e('0xdb'));}var _0x1375f2=this[_0xac7e('0x10')][_0xac7e('0x14')](_0x22f6c1);return{'code':0xc8,'result':_0x1375f2['extra']?_0x1375f2['extra']:'-'};};String['prototype'][_0xac7e('0x1d4')]=function(_0x23adbb,_0xdcb993){return this[_0xac7e('0xa3')](_0x23adbb)[_0xac7e('0x1d5')](_0xdcb993);};module[_0xac7e('0x1d6')]=AGIVertices;
\ No newline at end of file
index 95abe2c..c19c156 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e6c=['message','prototype','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','syncAgentConnect','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','syncHangupRequest','bind','hangup','syncHangup','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','seconds','startAcw','interface','ACW','mandatoryDispositionPause','name','Action','QueuePause','getAgent','voicePause','info','attended','destlinkedid','savePause','then','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x0e6c,0x151));var _0xc0e6=function(_0x1390aa,_0x4f397b){_0x1390aa=_0x1390aa-0x0;var _0x5e0a83=_0x0e6c[_0x1390aa];return _0x5e0a83;};'use strict';var util=require('util');var _=require(_0xc0e6('0x0'));var moment=require(_0xc0e6('0x1'));var ami=require(_0xc0e6('0x2'));var logger=require(_0xc0e6('0x3'))(_0xc0e6('0x4'));var RpcUser=require(_0xc0e6('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0xb6ad31){this[_0xc0e6('0x6')]=_0xb6ad31['voiceQueues'];this[_0xc0e6('0x7')]=_0xb6ad31[_0xc0e6('0x7')];this[_0xc0e6('0x8')]=_0xb6ad31[_0xc0e6('0x8')];this[_0xc0e6('0x9')]={};ami['on']('agentconnect',this['syncAgentConnect']['bind'](this));ami['on']('hanguprequest',this[_0xc0e6('0xa')][_0xc0e6('0xb')](this));ami['on'](_0xc0e6('0xc'),this[_0xc0e6('0xd')][_0xc0e6('0xb')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0xc0e6('0xb')](this));ami['on']('attendedtransfer',this[_0xc0e6('0xe')]['bind'](this));ami['on'](_0xc0e6('0xf'),this[_0xc0e6('0x10')][_0xc0e6('0xb')](this));ami['on'](_0xc0e6('0x11'),this['syncAgentConnectPreview'][_0xc0e6('0xb')](this));}function getDiff(_0x27c1d0){var _0x31ff30=moment()[_0xc0e6('0x12')](0x0);var _0x2ada0f=moment(_0x27c1d0)['milliseconds'](0x0);return _0x31ff30['diff'](_0x2ada0f,_0xc0e6('0x13'));}Acw['prototype'][_0xc0e6('0x14')]=function(_0x4bd13f){try{var _0x31cab9=this;var _0x45a701=this['channels'][_0x4bd13f][_0xc0e6('0x15')];var _0x493830=this['channels'][_0x4bd13f]['queue'];var _0x4936b3=this['voiceQueues'][_0x493830];var _0xf9bb12=![];var _0x189d1e=_0xc0e6('0x16');if(_0x4936b3['mandatoryDisposition']){if(_0x4936b3[_0xc0e6('0x17')][_0xc0e6('0x18')]){_0xf9bb12=!![];_0x189d1e=_0x4936b3[_0xc0e6('0x17')][_0xc0e6('0x18')];}}ami[_0xc0e6('0x19')]({'action':_0xc0e6('0x1a'),'interface':_0x45a701,'paused':!![],'reason':_0x189d1e})['then'](function(_0x10b539){if(_0x31cab9['agents'][_0x45a701]){return RpcUser[_0xc0e6('0x1b')](_0x31cab9[_0xc0e6('0x7')][_0x45a701]['id'])['then'](function(_0x41eda3){if(_0x41eda3&&!_0x41eda3[_0xc0e6('0x1c')]){logger[_0xc0e6('0x1d')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x4bd13f,_0x45a701,_0x493830);var _0x501255=_0x31cab9[_0xc0e6('0x9')][_0x4bd13f][_0xc0e6('0x1e')]&&_0x31cab9[_0xc0e6('0x9')][_0x4bd13f][_0xc0e6('0x1f')]?_0x31cab9[_0xc0e6('0x9')][_0x4bd13f][_0xc0e6('0x1f')]:_0x4bd13f;return RpcUser[_0xc0e6('0x20')](_0x31cab9['agents'][_0x45a701],_0x189d1e,_0x501255)[_0xc0e6('0x21')](function(_0x391c16){if(!_0xf9bb12){_0x31cab9[_0xc0e6('0x8')][_0x45a701]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x4bd13f,_0x31cab9[_0xc0e6('0x6')][_0x493830][_0xc0e6('0x22')],_0x45a701,_0x493830);_0x31cab9[_0xc0e6('0x8')][_0x45a701][_0xc0e6('0x23')]=setTimeout(_0x31cab9[_0xc0e6('0x24')][_0xc0e6('0xb')](_0x31cab9,_0x45a701),_0x31cab9[_0xc0e6('0x6')][_0x493830][_0xc0e6('0x22')]*0x3e8);_0x31cab9[_0xc0e6('0x8')][_0x45a701][_0xc0e6('0x25')]=moment()[_0xc0e6('0x26')](_0xc0e6('0x27'));_0x31cab9[_0xc0e6('0x8')][_0x45a701][_0xc0e6('0x28')]=_0x4bd13f;_0x31cab9[_0xc0e6('0x8')][_0x45a701][_0xc0e6('0x29')]=_0x493830;_0x31cab9[_0xc0e6('0x8')][_0x45a701]['updateAcw']=function(){var _0x1d94d0=getDiff(_0x31cab9[_0xc0e6('0x8')][_0x45a701][_0xc0e6('0x25')]);clearTimeout(_0x31cab9[_0xc0e6('0x8')][_0x45a701][_0xc0e6('0x23')]);_0x31cab9[_0xc0e6('0x8')][_0x45a701]['timer']=![];RpcVoiceAgentReport[_0xc0e6('0x2a')]({'acwtime':_0x1d94d0},_0x31cab9['timers'][_0x45a701]['uniqueid'],_0x45a701)['then'](function(_0x53254d){logger[_0xc0e6('0x1d')](_0xc0e6('0x2b'),_0x4bd13f,_0x1d94d0,_0x53254d);})['catch'](function(_0x2517b9){logger[_0xc0e6('0x2c')]('[%s][UPDATE][ERRORS:%s]',_0x4bd13f,_0x2517b9);});delete _0x31cab9[_0xc0e6('0x8')][_0x45a701];};}});}else{logger[_0xc0e6('0x1d')](_0xc0e6('0x2d'),_0x4bd13f,_0x45a701,_0x493830);}});}})[_0xc0e6('0x2e')](function(_0x249924){logger['error'](_0xc0e6('0x2f'),_0x4bd13f,_0x31cab9[_0xc0e6('0x6')][_0x493830][_0xc0e6('0x22')],_0x45a701,_0x493830);})['finally'](function(){delete _0x31cab9[_0xc0e6('0x9')][_0x4bd13f];});}catch(_0x28faed){logger[_0xc0e6('0x2c')]('[ACW][START]\x20%s',_0x28faed[_0xc0e6('0x30')]);}};Acw[_0xc0e6('0x31')][_0xc0e6('0x24')]=function(_0x39efcd){try{var _0x3a98c2=this;if(_0x3a98c2[_0xc0e6('0x8')][_0x39efcd]){_0x3a98c2[_0xc0e6('0x8')][_0x39efcd]['timer']=![];var _0x3578b3=_0x3a98c2[_0xc0e6('0x8')][_0x39efcd]['uniqueid'];var _0x49e0c0=_0x3a98c2[_0xc0e6('0x8')][_0x39efcd][_0xc0e6('0x29')];var _0x249183=_0x3a98c2[_0xc0e6('0x6')][_0x49e0c0][_0xc0e6('0x22')];logger[_0xc0e6('0x1d')](_0xc0e6('0x32'),_0x3578b3,_0x39efcd);RpcUser['saveUnpause'](this[_0xc0e6('0x7')][_0x39efcd]);RpcVoiceAgentReport[_0xc0e6('0x2a')]({'acwtime':_0x249183,'agentacw':!![]},_0x3578b3,_0x39efcd)[_0xc0e6('0x21')](function(_0x562ab8){logger[_0xc0e6('0x1d')](_0xc0e6('0x2b'),_0x3578b3,_0x249183,_0x562ab8);})[_0xc0e6('0x2e')](function(_0x7f5fd3){logger[_0xc0e6('0x2c')](_0xc0e6('0x33'),_0x3578b3,_0x7f5fd3);});}else{logger['error'](_0xc0e6('0x34'),_0x39efcd);if(_0x3a98c2[_0xc0e6('0x8')]){logger[_0xc0e6('0x1d')]('[ACW][TIMERS]',JSON[_0xc0e6('0x35')](_0x3a98c2[_0xc0e6('0x8')]));}}}catch(_0x3c01d0){logger[_0xc0e6('0x2c')]('[ACW][STOP]\x20%s',_0x3c01d0[_0xc0e6('0x30')]);}};Acw['prototype'][_0xc0e6('0x36')]=function(_0xa0d0ed){try{if(this[_0xc0e6('0x6')][_0xa0d0ed[_0xc0e6('0x29')]]&&(this[_0xc0e6('0x6')][_0xa0d0ed['queue']][_0xc0e6('0x4')]||this[_0xc0e6('0x6')][_0xa0d0ed[_0xc0e6('0x29')]][_0xc0e6('0x37')])){if(this[_0xc0e6('0x7')][_0xa0d0ed['interface']]){this[_0xc0e6('0x9')][_0xa0d0ed['uniqueid']]={'queue':_0xa0d0ed[_0xc0e6('0x29')],'interface':_0xa0d0ed[_0xc0e6('0x15')],'destlinkedid':_0xa0d0ed[_0xc0e6('0x1f')]};}}}catch(_0x30f6e9){logger[_0xc0e6('0x2c')](_0xc0e6('0x38'),_0x30f6e9[_0xc0e6('0x30')]);}};Acw[_0xc0e6('0x31')][_0xc0e6('0x39')]=function(_0x19c869){try{if(this['voiceQueues'][_0x19c869[_0xc0e6('0x29')]]&&(this[_0xc0e6('0x6')][_0x19c869[_0xc0e6('0x29')]][_0xc0e6('0x4')]||this[_0xc0e6('0x6')][_0x19c869['queue']]['mandatoryDisposition'])){if(this[_0xc0e6('0x7')][_0x19c869[_0xc0e6('0x15')]]){this['channels'][_0x19c869[_0xc0e6('0x28')]]={'queue':_0x19c869[_0xc0e6('0x29')],'interface':_0x19c869[_0xc0e6('0x15')]};}}}catch(_0x2945d7){logger[_0xc0e6('0x2c')]('[ACW][syncAgentConnectPreview]\x20%s',_0x2945d7[_0xc0e6('0x30')]);}};Acw['prototype'][_0xc0e6('0xa')]=function(_0x2d02ef){try{if(this[_0xc0e6('0x9')][_0x2d02ef[_0xc0e6('0x28')]]&&_[_0xc0e6('0x3a')](this[_0xc0e6('0x9')][_0x2d02ef[_0xc0e6('0x28')]][_0xc0e6('0x1e')])){logger[_0xc0e6('0x1d')](_0xc0e6('0x3b'),_0x2d02ef[_0xc0e6('0x28')]);this[_0xc0e6('0x14')](_0x2d02ef['uniqueid']);}else if(this[_0xc0e6('0x9')][_0x2d02ef[_0xc0e6('0x3c')]]&&_[_0xc0e6('0x3a')](this[_0xc0e6('0x9')][_0x2d02ef[_0xc0e6('0x3c')]]['attended'])){logger['info'](_0xc0e6('0x3d'),_0x2d02ef[_0xc0e6('0x3c')]);this[_0xc0e6('0x14')](_0x2d02ef['linkedid']);}}catch(_0x3322b8){logger[_0xc0e6('0x2c')]('[ACW][syncHangupRequest]\x20%s',_0x3322b8[_0xc0e6('0x30')]);}};Acw[_0xc0e6('0x31')][_0xc0e6('0xd')]=function(_0x4fc47c){try{if(this[_0xc0e6('0x9')][_0x4fc47c['uniqueid']]&&this[_0xc0e6('0x9')][_0x4fc47c[_0xc0e6('0x28')]][_0xc0e6('0x1e')]){logger[_0xc0e6('0x1d')](_0xc0e6('0x3e'),_0x4fc47c[_0xc0e6('0x28')]);this[_0xc0e6('0x14')](_0x4fc47c[_0xc0e6('0x28')]);}else if(this['channels'][_0x4fc47c['linkedid']]&&this['channels'][_0x4fc47c[_0xc0e6('0x3c')]][_0xc0e6('0x1e')]){logger[_0xc0e6('0x1d')](_0xc0e6('0x3f'),_0x4fc47c[_0xc0e6('0x3c')]);this[_0xc0e6('0x14')](_0x4fc47c[_0xc0e6('0x3c')]);}}catch(_0x4d0a3c){logger['error']('[ACW][syncHangup]\x20%s',_0x4d0a3c['message']);}};Acw['prototype'][_0xc0e6('0xe')]=function(_0x12926c){try{if(!_[_0xc0e6('0x40')](this[_0xc0e6('0x9')][_0x12926c[_0xc0e6('0x41')]])){this[_0xc0e6('0x14')](_0x12926c[_0xc0e6('0x41')]);if(this['channels'][_0x12926c[_0xc0e6('0x42')]]){this[_0xc0e6('0x9')][_0x12926c[_0xc0e6('0x42')]][_0xc0e6('0x1e')]=!![];this[_0xc0e6('0x9')][_0x12926c[_0xc0e6('0x43')]]=this[_0xc0e6('0x9')][_0x12926c[_0xc0e6('0x42')]];delete this[_0xc0e6('0x9')][_0x12926c['secondtransfereruniqueid']];}}else if(!_[_0xc0e6('0x40')](this[_0xc0e6('0x9')][_0x12926c[_0xc0e6('0x43')]])){this[_0xc0e6('0x14')](_0x12926c[_0xc0e6('0x43')]);if(this[_0xc0e6('0x9')][_0x12926c[_0xc0e6('0x44')]]){this[_0xc0e6('0x9')][_0x12926c[_0xc0e6('0x44')]][_0xc0e6('0x1e')]=!![];this['channels'][_0x12926c[_0xc0e6('0x41')]]=this[_0xc0e6('0x9')][_0x12926c[_0xc0e6('0x44')]];delete this['channels'][_0x12926c[_0xc0e6('0x44')]];}}}catch(_0x4cf2c8){logger[_0xc0e6('0x2c')](_0xc0e6('0x45'),_0x4cf2c8['message']);}};Acw[_0xc0e6('0x31')][_0xc0e6('0x10')]=function(_0x176f53){try{if(this[_0xc0e6('0x9')][_0x176f53[_0xc0e6('0x46')]]){logger[_0xc0e6('0x1d')](_0xc0e6('0x47'),JSON[_0xc0e6('0x35')](_0x176f53[_0xc0e6('0x46')]));this['startAcw'](_0x176f53[_0xc0e6('0x46')]);}else if(this[_0xc0e6('0x9')][_0x176f53[_0xc0e6('0x48')]]){logger[_0xc0e6('0x1d')]('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x176f53[_0xc0e6('0x48')]));this[_0xc0e6('0x14')](_0x176f53[_0xc0e6('0x48')]);}}catch(_0x3b1655){logger['error'](_0xc0e6('0x49'),_0x3b1655['message']);}};Acw[_0xc0e6('0x31')][_0xc0e6('0x4a')]=function(_0x288437){try{if(this['voiceQueues'][_0x288437['queue']]&&this[_0xc0e6('0x6')][_0x288437['queue']]['autopause']==='all'){if(this[_0xc0e6('0x7')][_0x288437[_0xc0e6('0x15')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x288437['uniqueid'],_0x288437[_0xc0e6('0x15')],_0x288437[_0xc0e6('0x29')]);return RpcUser['savePause'](this[_0xc0e6('0x7')][_0x288437['interface']],'Auto-Pause',_0x288437['uniqueid']);}}}catch(_0x17903f){logger['error'](_0xc0e6('0x4b'),_0x17903f[_0xc0e6('0x30')]);}};module[_0xc0e6('0x4c')]=Acw;
\ No newline at end of file
+var _0x6ed6=['voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','lastPauseAt','queue','updateAcw','update','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','finally','[ACW][START]\x20%s','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent'];(function(_0x5eb496,_0x25bc44){var _0x4f513a=function(_0x4e2351){while(--_0x4e2351){_0x5eb496['push'](_0x5eb496['shift']());}};_0x4f513a(++_0x25bc44);}(_0x6ed6,0x139));var _0x66ed=function(_0x377cd8,_0x3aaabf){_0x377cd8=_0x377cd8-0x0;var _0x2685e1=_0x6ed6[_0x377cd8];return _0x2685e1;};'use strict';var util=require(_0x66ed('0x0'));var _=require(_0x66ed('0x1'));var moment=require(_0x66ed('0x2'));var ami=require(_0x66ed('0x3'));var logger=require(_0x66ed('0x4'))('acw');var RpcUser=require(_0x66ed('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x40b8a5){this[_0x66ed('0x6')]=_0x40b8a5['voiceQueues'];this[_0x66ed('0x7')]=_0x40b8a5[_0x66ed('0x7')];this[_0x66ed('0x8')]=_0x40b8a5[_0x66ed('0x8')];this[_0x66ed('0x9')]={};ami['on'](_0x66ed('0xa'),this[_0x66ed('0xb')][_0x66ed('0xc')](this));ami['on'](_0x66ed('0xd'),this[_0x66ed('0xe')][_0x66ed('0xc')](this));ami['on']('hangup',this[_0x66ed('0xf')][_0x66ed('0xc')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0x66ed('0x10'),this[_0x66ed('0x11')][_0x66ed('0xc')](this));ami['on'](_0x66ed('0x12'),this[_0x66ed('0x13')][_0x66ed('0xc')](this));ami['on']('custom:agentConnectPreview',this[_0x66ed('0x14')][_0x66ed('0xc')](this));}function getDiff(_0x28b576){var _0x558c9b=moment()[_0x66ed('0x15')](0x0);var _0x57690f=moment(_0x28b576)[_0x66ed('0x15')](0x0);return _0x558c9b[_0x66ed('0x16')](_0x57690f,_0x66ed('0x17'));}Acw[_0x66ed('0x18')][_0x66ed('0x19')]=function(_0x32a4e4){try{var _0x26869e=this;var _0x50539e=this['channels'][_0x32a4e4][_0x66ed('0x1a')];var _0x330fb9=this[_0x66ed('0x9')][_0x32a4e4]['queue'];var _0x4122cd=this[_0x66ed('0x6')][_0x330fb9];var _0x4a39a6=![];var _0x53d0e7=_0x66ed('0x1b');if(_0x4122cd[_0x66ed('0x1c')]){if(_0x4122cd[_0x66ed('0x1d')]['name']){_0x4a39a6=!![];_0x53d0e7=_0x4122cd['mandatoryDispositionPause'][_0x66ed('0x1e')];}}ami[_0x66ed('0x1f')]({'action':_0x66ed('0x20'),'interface':_0x50539e,'paused':!![],'reason':_0x53d0e7})[_0x66ed('0x21')](function(_0x12d351){if(_0x26869e[_0x66ed('0x7')][_0x50539e]){return RpcUser[_0x66ed('0x22')](_0x26869e[_0x66ed('0x7')][_0x50539e]['id'])['then'](function(_0x28a196){if(_0x28a196&&!_0x28a196[_0x66ed('0x23')]){logger[_0x66ed('0x24')](_0x66ed('0x25'),_0x32a4e4,_0x50539e,_0x330fb9);var _0x58b04a=_0x26869e[_0x66ed('0x9')][_0x32a4e4][_0x66ed('0x26')]&&_0x26869e[_0x66ed('0x9')][_0x32a4e4][_0x66ed('0x27')]?_0x26869e[_0x66ed('0x9')][_0x32a4e4][_0x66ed('0x27')]:_0x32a4e4;return RpcUser[_0x66ed('0x28')](_0x26869e[_0x66ed('0x7')][_0x50539e],_0x53d0e7,_0x58b04a)[_0x66ed('0x21')](function(_0x4cd095){if(!_0x4a39a6){_0x26869e[_0x66ed('0x8')][_0x50539e]={};logger[_0x66ed('0x24')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x32a4e4,_0x26869e[_0x66ed('0x6')][_0x330fb9]['acwTimeout'],_0x50539e,_0x330fb9);_0x26869e[_0x66ed('0x8')][_0x50539e]['timer']=setTimeout(_0x26869e['stopAcw'][_0x66ed('0xc')](_0x26869e,_0x50539e),_0x26869e[_0x66ed('0x6')][_0x330fb9]['acwTimeout']*0x3e8);_0x26869e[_0x66ed('0x8')][_0x50539e][_0x66ed('0x29')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x26869e[_0x66ed('0x8')][_0x50539e]['uniqueid']=_0x32a4e4;_0x26869e[_0x66ed('0x8')][_0x50539e][_0x66ed('0x2a')]=_0x330fb9;_0x26869e[_0x66ed('0x8')][_0x50539e][_0x66ed('0x2b')]=function(){var _0x2b2b40=getDiff(_0x26869e[_0x66ed('0x8')][_0x50539e][_0x66ed('0x29')]);clearTimeout(_0x26869e[_0x66ed('0x8')][_0x50539e]['timer']);_0x26869e[_0x66ed('0x8')][_0x50539e]['timer']=![];RpcVoiceAgentReport[_0x66ed('0x2c')]({'acwtime':_0x2b2b40},_0x26869e[_0x66ed('0x8')][_0x50539e][_0x66ed('0x2d')],_0x50539e)[_0x66ed('0x21')](function(_0xe616a5){logger[_0x66ed('0x24')](_0x66ed('0x2e'),_0x32a4e4,_0x2b2b40,_0xe616a5);})[_0x66ed('0x2f')](function(_0x2aec6e){logger[_0x66ed('0x30')]('[%s][UPDATE][ERRORS:%s]',_0x32a4e4,_0x2aec6e);});delete _0x26869e[_0x66ed('0x8')][_0x50539e];};}});}else{logger[_0x66ed('0x24')](_0x66ed('0x31'),_0x32a4e4,_0x50539e,_0x330fb9);}});}})[_0x66ed('0x2f')](function(_0x11760f){logger[_0x66ed('0x30')](_0x66ed('0x32'),_0x32a4e4,_0x26869e[_0x66ed('0x6')][_0x330fb9][_0x66ed('0x33')],_0x50539e,_0x330fb9);})[_0x66ed('0x34')](function(){delete _0x26869e['channels'][_0x32a4e4];});}catch(_0x450b7e){logger[_0x66ed('0x30')](_0x66ed('0x35'),_0x450b7e[_0x66ed('0x36')]);}};Acw[_0x66ed('0x18')][_0x66ed('0x37')]=function(_0x199f8d){try{var _0x1027fa=this;if(_0x1027fa[_0x66ed('0x8')][_0x199f8d]){_0x1027fa[_0x66ed('0x8')][_0x199f8d]['timer']=![];var _0x1d0d6b=_0x1027fa[_0x66ed('0x8')][_0x199f8d][_0x66ed('0x2d')];var _0x2b3d46=_0x1027fa['timers'][_0x199f8d]['queue'];var _0x4b6c54=_0x1027fa[_0x66ed('0x6')][_0x2b3d46]['acwTimeout'];logger[_0x66ed('0x24')](_0x66ed('0x38'),_0x1d0d6b,_0x199f8d);RpcUser[_0x66ed('0x39')](this[_0x66ed('0x7')][_0x199f8d]);RpcVoiceAgentReport[_0x66ed('0x2c')]({'acwtime':_0x4b6c54,'agentacw':!![]},_0x1d0d6b,_0x199f8d)[_0x66ed('0x21')](function(_0x311fa3){logger[_0x66ed('0x24')](_0x66ed('0x2e'),_0x1d0d6b,_0x4b6c54,_0x311fa3);})[_0x66ed('0x2f')](function(_0x1f4134){logger[_0x66ed('0x30')](_0x66ed('0x3a'),_0x1d0d6b,_0x1f4134);});}else{logger['error'](_0x66ed('0x3b'),_0x199f8d);if(_0x1027fa['timers']){logger[_0x66ed('0x24')]('[ACW][TIMERS]',JSON[_0x66ed('0x3c')](_0x1027fa[_0x66ed('0x8')]));}}}catch(_0x454b70){logger['error']('[ACW][STOP]\x20%s',_0x454b70[_0x66ed('0x36')]);}};Acw['prototype']['syncAgentConnect']=function(_0x2604fd){try{if(this['voiceQueues'][_0x2604fd[_0x66ed('0x2a')]]&&(this[_0x66ed('0x6')][_0x2604fd[_0x66ed('0x2a')]][_0x66ed('0x3d')]||this[_0x66ed('0x6')][_0x2604fd[_0x66ed('0x2a')]]['mandatoryDisposition'])){if(this[_0x66ed('0x7')][_0x2604fd[_0x66ed('0x1a')]]){this[_0x66ed('0x9')][_0x2604fd[_0x66ed('0x2d')]]={'queue':_0x2604fd['queue'],'interface':_0x2604fd[_0x66ed('0x1a')],'destlinkedid':_0x2604fd[_0x66ed('0x27')]};}}}catch(_0x293897){logger['error'](_0x66ed('0x3e'),_0x293897['message']);}};Acw['prototype'][_0x66ed('0x14')]=function(_0x2aba88){try{if(this[_0x66ed('0x6')][_0x2aba88[_0x66ed('0x2a')]]&&(this[_0x66ed('0x6')][_0x2aba88[_0x66ed('0x2a')]][_0x66ed('0x3d')]||this[_0x66ed('0x6')][_0x2aba88[_0x66ed('0x2a')]][_0x66ed('0x1c')])){if(this[_0x66ed('0x7')][_0x2aba88[_0x66ed('0x1a')]]){this[_0x66ed('0x9')][_0x2aba88['uniqueid']]={'queue':_0x2aba88[_0x66ed('0x2a')],'interface':_0x2aba88[_0x66ed('0x1a')]};}}}catch(_0x19a36d){logger[_0x66ed('0x30')](_0x66ed('0x3f'),_0x19a36d['message']);}};Acw[_0x66ed('0x18')][_0x66ed('0xe')]=function(_0x426a2f){try{if(this[_0x66ed('0x9')][_0x426a2f['uniqueid']]&&_[_0x66ed('0x40')](this['channels'][_0x426a2f[_0x66ed('0x2d')]][_0x66ed('0x26')])){logger[_0x66ed('0x24')](_0x66ed('0x41'),_0x426a2f[_0x66ed('0x2d')]);this[_0x66ed('0x19')](_0x426a2f[_0x66ed('0x2d')]);}else if(this[_0x66ed('0x9')][_0x426a2f[_0x66ed('0x42')]]&&_['isUndefined'](this[_0x66ed('0x9')][_0x426a2f[_0x66ed('0x42')]][_0x66ed('0x26')])){logger['info'](_0x66ed('0x43'),_0x426a2f[_0x66ed('0x42')]);this[_0x66ed('0x19')](_0x426a2f['linkedid']);}}catch(_0x15a111){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x15a111[_0x66ed('0x36')]);}};Acw[_0x66ed('0x18')]['syncHangup']=function(_0x307d0e){try{if(this[_0x66ed('0x9')][_0x307d0e[_0x66ed('0x2d')]]&&this[_0x66ed('0x9')][_0x307d0e['uniqueid']][_0x66ed('0x26')]){logger[_0x66ed('0x24')](_0x66ed('0x44'),_0x307d0e[_0x66ed('0x2d')]);this[_0x66ed('0x19')](_0x307d0e[_0x66ed('0x2d')]);}else if(this[_0x66ed('0x9')][_0x307d0e[_0x66ed('0x42')]]&&this['channels'][_0x307d0e[_0x66ed('0x42')]][_0x66ed('0x26')]){logger[_0x66ed('0x24')](_0x66ed('0x45'),_0x307d0e[_0x66ed('0x42')]);this[_0x66ed('0x19')](_0x307d0e[_0x66ed('0x42')]);}}catch(_0x275684){logger[_0x66ed('0x30')](_0x66ed('0x46'),_0x275684['message']);}};Acw[_0x66ed('0x18')][_0x66ed('0x11')]=function(_0x3b2631){try{if(!_['isNil'](this[_0x66ed('0x9')][_0x3b2631[_0x66ed('0x47')]])){this[_0x66ed('0x19')](_0x3b2631['transfereeuniqueid']);if(this[_0x66ed('0x9')][_0x3b2631[_0x66ed('0x48')]]){this[_0x66ed('0x9')][_0x3b2631[_0x66ed('0x48')]][_0x66ed('0x26')]=!![];this['channels'][_0x3b2631[_0x66ed('0x49')]]=this[_0x66ed('0x9')][_0x3b2631['secondtransfereruniqueid']];delete this[_0x66ed('0x9')][_0x3b2631['secondtransfereruniqueid']];}}else if(!_[_0x66ed('0x4a')](this[_0x66ed('0x9')][_0x3b2631[_0x66ed('0x49')]])){this[_0x66ed('0x19')](_0x3b2631[_0x66ed('0x49')]);if(this[_0x66ed('0x9')][_0x3b2631[_0x66ed('0x4b')]]){this[_0x66ed('0x9')][_0x3b2631[_0x66ed('0x4b')]][_0x66ed('0x26')]=!![];this['channels'][_0x3b2631[_0x66ed('0x47')]]=this[_0x66ed('0x9')][_0x3b2631['origtransfereruniqueid']];delete this[_0x66ed('0x9')][_0x3b2631[_0x66ed('0x4b')]];}}}catch(_0x1b68ad){logger[_0x66ed('0x30')](_0x66ed('0x4c'),_0x1b68ad[_0x66ed('0x36')]);}};Acw[_0x66ed('0x18')][_0x66ed('0x13')]=function(_0x5b5ee6){try{if(this[_0x66ed('0x9')][_0x5b5ee6[_0x66ed('0x4d')]]){logger['info'](_0x66ed('0x4e'),JSON[_0x66ed('0x3c')](_0x5b5ee6[_0x66ed('0x4d')]));this[_0x66ed('0x19')](_0x5b5ee6[_0x66ed('0x4d')]);}else if(this[_0x66ed('0x9')][_0x5b5ee6['transfererlinkedid']]){logger[_0x66ed('0x24')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x66ed('0x3c')](_0x5b5ee6['transfererlinkedid']));this['startAcw'](_0x5b5ee6[_0x66ed('0x4f')]);}}catch(_0xdb055e){logger[_0x66ed('0x30')](_0x66ed('0x50'),_0xdb055e['message']);}};Acw['prototype']['syncAgentRingNoAnswer']=function(_0x33ce9f){try{if(this[_0x66ed('0x6')][_0x33ce9f[_0x66ed('0x2a')]]&&this[_0x66ed('0x6')][_0x33ce9f['queue']][_0x66ed('0x51')]===_0x66ed('0x52')){if(this[_0x66ed('0x7')][_0x33ce9f['interface']]){logger['info'](_0x66ed('0x53'),_0x33ce9f[_0x66ed('0x2d')],_0x33ce9f[_0x66ed('0x1a')],_0x33ce9f['queue']);return RpcUser[_0x66ed('0x28')](this['agents'][_0x33ce9f[_0x66ed('0x1a')]],_0x66ed('0x54'),_0x33ce9f[_0x66ed('0x2d')]);}}}catch(_0x4bbdc8){logger['error'](_0x66ed('0x55'),_0x4bbdc8[_0x66ed('0x36')]);}};module[_0x66ed('0x56')]=Acw;
\ No newline at end of file
index f17fa9c..18dc187 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','then','actionSipShowRegistry','catch','[ami.js][fullybooted]','exports','bluebird','moment','util','lodash','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s'];(function(_0x158ad4,_0x512023){var _0x5d7d78=function(_0x21286c){while(--_0x21286c){_0x158ad4['push'](_0x158ad4['shift']());}};_0x5d7d78(++_0x512023);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var _=require(_0x0baf('0x3'));var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x0baf('0x6')][_0x0baf('0x7')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')][_0x0baf('0x9')],!![]);ami[_0x0baf('0xa')]();ami[_0x0baf('0xb')]=BPromise['promisify'](ami[_0x0baf('0xc')]);function error(_0x5f20aa){logger[_0x0baf('0xd')](util[_0x0baf('0xe')](_0x0baf('0xf'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')],util[_0x0baf('0x10')](_0x5f20aa,![],null)));}function close(){logger[_0x0baf('0xd')](util[_0x0baf('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk'][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x0baf('0xb')]({'action':'sipshowregistry'});};};ami[_0x0baf('0x11')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x12')});};};ami[_0x0baf('0x13')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x14')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x0baf('0x15')});};};ami[_0x0baf('0x16')]=function(){return function(){return ami[_0x0baf('0xb')]({'action':_0x0baf('0x17')});};};function connect(_0x2cf7da){logger[_0x0baf('0x18')](util['format'](_0x0baf('0x19'),config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));ami['once']('error',error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);}ami['on'](_0x0baf('0x1c'),connect);ami['on'](_0x0baf('0x1d'),function(_0x1fa92b){logger[_0x0baf('0x18')](util[_0x0baf('0xe')](_0x0baf('0x1e'),config[_0x0baf('0x6')][_0x0baf('0x8')],config['asterisk']['ip'],config[_0x0baf('0x6')]['port'],util[_0x0baf('0x10')](_0x1fa92b,![],null)));});ami['on']('fullybooted',function(_0x4de74c){logger[_0x0baf('0x18')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x0baf('0x6')][_0x0baf('0x8')],config[_0x0baf('0x6')]['ip'],config[_0x0baf('0x6')][_0x0baf('0x7')]));return BPromise['resolve']()[_0x0baf('0x1f')](ami[_0x0baf('0x20')]())[_0x0baf('0x1f')](ami[_0x0baf('0x11')]())[_0x0baf('0x1f')](ami[_0x0baf('0x13')]())[_0x0baf('0x1f')](ami['actionQueueSummary']())[_0x0baf('0x1f')](ami[_0x0baf('0x16')]())[_0x0baf('0x21')](function(_0x265915){logger['error'](_0x0baf('0x22'),util[_0x0baf('0x10')](_0x265915,{'showHidden':![],'depth':null}));});});ami['once'](_0x0baf('0xd'),error);ami[_0x0baf('0x1a')](_0x0baf('0x1b'),close);module[_0x0baf('0x23')]=ami;
\ No newline at end of file
+var _0xd8b0=['actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus'];(function(_0x5ed208,_0x11d4bf){var _0x553ff7=function(_0x34a087){while(--_0x34a087){_0x5ed208['push'](_0x5ed208['shift']());}};_0x553ff7(++_0x11d4bf);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Manager=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var moment=require('moment');var util=require('util');var _=require('lodash');var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var ami=new Manager(config[_0x0d8b('0x5')][_0x0d8b('0x6')],config['asterisk']['ip'],config['asterisk'][_0x0d8b('0x7')],config[_0x0d8b('0x5')][_0x0d8b('0x8')],!![]);ami['keepConnected']();ami[_0x0d8b('0x9')]=BPromise[_0x0d8b('0xa')](ami['action']);function error(_0x129310){logger[_0x0d8b('0xb')](util[_0x0d8b('0xc')](_0x0d8b('0xd'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port'],util[_0x0d8b('0xe')](_0x129310,![],null)));}function close(){logger['error'](util[_0x0d8b('0xc')](_0x0d8b('0xf'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')]));}ami[_0x0d8b('0x10')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x11')});};};ami[_0x0d8b('0x12')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x13')});};};ami[_0x0d8b('0x14')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x15')});};};ami[_0x0d8b('0x16')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x17')});};};ami[_0x0d8b('0x18')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x19')});};};function connect(_0x4586c2){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x1b'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config['asterisk'][_0x0d8b('0x6')]));ami[_0x0d8b('0x1c')](_0x0d8b('0xb'),error);ami[_0x0d8b('0x1c')](_0x0d8b('0x1d'),close);}ami['on'](_0x0d8b('0x1e'),connect);ami['on'](_0x0d8b('0x1f'),function(_0x352c17){logger['info'](util['format'](_0x0d8b('0x20'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')],util[_0x0d8b('0xe')](_0x352c17,![],null)));});ami['on'](_0x0d8b('0x21'),function(_0x221071){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x22'),config[_0x0d8b('0x5')]['username'],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port']));return BPromise[_0x0d8b('0x23')]()['then'](ami[_0x0d8b('0x10')]())[_0x0d8b('0x24')](ami[_0x0d8b('0x12')]())['then'](ami['actionSipPeerStatus']())[_0x0d8b('0x24')](ami[_0x0d8b('0x16')]())['then'](ami[_0x0d8b('0x18')]())['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x25'),util['inspect'](_0x1b2b59,{'showHidden':![],'depth':null}));});});ami[_0x0d8b('0x1c')]('error',error);ami[_0x0d8b('0x1c')]('close',close);module[_0x0d8b('0x26')]=ami;
\ No newline at end of file
index 881e6d7..4ee80c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['rpc','memberReport','error','message','result','catch','exports','../../config/logger','ami','client','http','Request','request','then','debug'];(function(_0x5235ca,_0x5b37fd){var _0x5273c8=function(_0x6fd056){while(--_0x6fd056){_0x5235ca['push'](_0x5235ca['shift']());}};_0x5273c8(++_0x5b37fd);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var client=jayson[_0x3071('0x2')][_0x3071('0x3')]({'port':0x2329});client[_0x3071('0x4')]=function(_0x52b5fb,_0x2c547f){return new BPromise(function(_0x7b18a4,_0x33a70c){return client[_0x3071('0x5')](_0x52b5fb,_0x2c547f)[_0x3071('0x6')](function(_0x41cf76){logger[_0x3071('0x7')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x2c547f,_0x41cf76);if(_0x41cf76[_0x3071('0xa')]){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x41cf76['error'][_0x3071('0xb')],_0x2c547f);return _0x33a70c(_0x41cf76[_0x3071('0xa')][_0x3071('0xb')]);}else{return _0x7b18a4(_0x41cf76[_0x3071('0xc')]);}})[_0x3071('0xd')](function(_0x4a470a){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x4a470a,_0x2c547f);return _0x33a70c(_0x4a470a);});});};module[_0x3071('0xe')]=client;
\ No newline at end of file
+var _0xf4eb=['rpc','error','message','result','exports','jayson/promise','http','request','then','debug','memberReport'];(function(_0x57408b,_0xb7cbc5){var _0x31a897=function(_0x5810ac){while(--_0x5810ac){_0x57408b['push'](_0x57408b['shift']());}};_0x31a897(++_0xb7cbc5);}(_0xf4eb,0xec));var _0xbf4e=function(_0x3028f3,_0x4afc0d){_0x3028f3=_0x3028f3-0x0;var _0x541dc7=_0xf4eb[_0x3028f3];return _0x541dc7;};'use strict';var jayson=require(_0xbf4e('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('ami');var client=jayson['client'][_0xbf4e('0x1')]({'port':0x2329});client['Request']=function(_0x4e7fa7,_0x2e3070){return new BPromise(function(_0x1c7606,_0x32d1d7){return client[_0xbf4e('0x2')](_0x4e7fa7,_0x2e3070)[_0xbf4e('0x3')](function(_0x2fcfed){logger[_0xbf4e('0x4')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x2e3070,_0x2fcfed);if(_0x2fcfed['error']){logger['error'](_0xbf4e('0x6'),_0xbf4e('0x5'),_0x4e7fa7,_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')],_0x2e3070);return _0x32d1d7(_0x2fcfed[_0xbf4e('0x7')][_0xbf4e('0x8')]);}else{return _0x1c7606(_0x2fcfed[_0xbf4e('0x9')]);}})['catch'](function(_0x4d9a07){logger[_0xbf4e('0x7')]('rpc',_0xbf4e('0x5'),_0x4e7fa7,_0x4d9a07,_0x2e3070);return _0x32d1d7(_0x4d9a07);});});};module[_0xbf4e('0xa')]=client;
\ No newline at end of file
index b8cf3bf..6e5cfa8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x381f=['type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','format','\x22%s\x22\x20<%s>','substring','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','number','queue','active'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0x381f,0xc9));var _0xf381=function(_0x1eb3d6,_0x18c4f9){_0x1eb3d6=_0x1eb3d6-0x0;var _0x1b5614=_0x381f[_0x1eb3d6];return _0x1b5614;};'use strict';var util=require(_0xf381('0x0'));var _=require(_0xf381('0x1'));var moment=require(_0xf381('0x2'));function checkNameSurname(_0x1216c5,_0x148cb6,_0x4bc605){var _0x50b636='';if(!_[_0xf381('0x3')](_0x148cb6)&&_0xf381('0x4')===typeof _0x148cb6){_0x50b636+=_0x148cb6;}if(!_['isNil'](_0x4bc605)&&_0xf381('0x4')===typeof _0x4bc605){_0x50b636+='\x20'+_0x4bc605;}if(_0x50b636!==''){return _0x50b636;}return _0x1216c5;}function Action(_0x517ca2,_0x2cffe9,_0x5234a1){this[_0xf381('0x5')]=_0x517ca2;this[_0xf381('0x6')]=_0x5234a1||undefined;this[_0xf381('0x7')]=checkNameSurname(_0x2cffe9[_0xf381('0x8')][_0xf381('0x9')],_0x2cffe9[_0xf381('0x8')][_0xf381('0xa')],_0x2cffe9[_0xf381('0x8')]['lastName']);this[_0xf381('0xb')]=_0x2cffe9[_0xf381('0x9')];this[_0xf381('0xc')]=_0x517ca2[_0xf381('0x7')];this[_0xf381('0xd')]=_0x2cffe9[_0xf381('0xd')]||![];this[_0xf381('0xe')]=_0x517ca2[_0xf381('0xe')];this[_0xf381('0xf')]=_0x517ca2['dialQueueTimeout']||0x3;this['scheduledat']=_0x2cffe9[_0xf381('0x10')];this[_0xf381('0x11')]=_0x2cffe9[_0xf381('0x11')];this[_0xf381('0x12')]=_0x2cffe9[_0xf381('0x12')];this[_0xf381('0x13')]=_0x2cffe9[_0xf381('0x13')];this['countnosuchnumberretry']=_0x2cffe9[_0xf381('0x14')];this[_0xf381('0x15')]=_0x2cffe9[_0xf381('0x15')];this[_0xf381('0x16')]=_0x2cffe9[_0xf381('0x16')];this['countmachineretry']=_0x2cffe9[_0xf381('0x17')];this[_0xf381('0x18')]=_0x2cffe9['countagentrejectretry'];this[_0xf381('0x19')]=_0x2cffe9['ContactId'];this[_0xf381('0x1a')]=_0x2cffe9[_0xf381('0x1a')];this[_0xf381('0x1b')]=_0x2cffe9[_0xf381('0x1b')];this[_0xf381('0x1c')]=_0x2cffe9[_0xf381('0x1c')];this[_0xf381('0x1d')]=_0x2cffe9['CampaignId'];this[_0xf381('0x1e')]=_0x2cffe9['id'];this[_0xf381('0x1f')]=_0x2cffe9['Contact'][_0xf381('0xa')]||'';this['starttime']=moment()['format'](_0xf381('0x20'));this[_0xf381('0x21')]=_0x2cffe9['callback'];this[_0xf381('0x22')]=_0x2cffe9['callbackuniqueid'];this[_0xf381('0x23')]=_0x2cffe9[_0xf381('0x23')];this[_0xf381('0x24')]=_0x2cffe9['recallme'];this[_0xf381('0x25')]='';this[_0xf381('0x26')]='';}Action[_0xf381('0x27')]['getCaller']=function(){return util[_0xf381('0x28')](_0xf381('0x29'),this[_0xf381('0x7')],this['voiceQueue']['dialCutDigit']>0x0?this['number'][_0xf381('0x2a')](this[_0xf381('0x5')]['dialCutDigit']):this[_0xf381('0xb')]);};Action['prototype']['getQueue']=function(){return this[_0xf381('0xc')];};module['exports']=Action;
\ No newline at end of file
+var _0x18f4=['moment','isNil','string','voiceQueue','uniqueid','phone','Contact','firstName','lastName','number','queue','name','active','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','prototype','getQueue','exports','util'];(function(_0x22d667,_0x4ab6f6){var _0xc8eba0=function(_0x217df2){while(--_0x217df2){_0x22d667['push'](_0x22d667['shift']());}};_0xc8eba0(++_0x4ab6f6);}(_0x18f4,0x18b));var _0x418f=function(_0x35b38d,_0x362b45){_0x35b38d=_0x35b38d-0x0;var _0x5097ba=_0x18f4[_0x35b38d];return _0x5097ba;};'use strict';var util=require(_0x418f('0x0'));var _=require('lodash');var moment=require(_0x418f('0x1'));function checkNameSurname(_0x81ca4d,_0xcdcf20,_0x3a40cc){var _0x2426eb='';if(!_[_0x418f('0x2')](_0xcdcf20)&&_0x418f('0x3')===typeof _0xcdcf20){_0x2426eb+=_0xcdcf20;}if(!_['isNil'](_0x3a40cc)&&_0x418f('0x3')===typeof _0x3a40cc){_0x2426eb+='\x20'+_0x3a40cc;}if(_0x2426eb!==''){return _0x2426eb;}return _0x81ca4d;}function Action(_0x22875f,_0x164696,_0x1b082f){this[_0x418f('0x4')]=_0x22875f;this[_0x418f('0x5')]=_0x1b082f||undefined;this['name']=checkNameSurname(_0x164696['Contact'][_0x418f('0x6')],_0x164696[_0x418f('0x7')][_0x418f('0x8')],_0x164696['Contact'][_0x418f('0x9')]);this[_0x418f('0xa')]=_0x164696[_0x418f('0x6')];this[_0x418f('0xb')]=_0x22875f[_0x418f('0xc')];this[_0x418f('0xd')]=_0x164696[_0x418f('0xd')]||![];this[_0x418f('0xe')]=_0x22875f[_0x418f('0xe')];this['dialQueueTimeout']=_0x22875f['dialQueueTimeout']||0x3;this[_0x418f('0xf')]=_0x164696[_0x418f('0xf')];this[_0x418f('0x10')]=_0x164696[_0x418f('0x10')];this[_0x418f('0x11')]=_0x164696[_0x418f('0x11')];this[_0x418f('0x12')]=_0x164696['countnoanswerretry'];this['countnosuchnumberretry']=_0x164696[_0x418f('0x13')];this[_0x418f('0x14')]=_0x164696['countdropretry'];this[_0x418f('0x15')]=_0x164696[_0x418f('0x15')];this[_0x418f('0x16')]=_0x164696[_0x418f('0x16')];this[_0x418f('0x17')]=_0x164696[_0x418f('0x17')];this['ContactId']=_0x164696[_0x418f('0x18')];this[_0x418f('0x19')]=_0x164696[_0x418f('0x19')];this[_0x418f('0x1a')]=_0x164696[_0x418f('0x1a')];this['VoiceQueueId']=_0x164696[_0x418f('0x1b')];this['CampaignId']=_0x164696[_0x418f('0x1c')];this[_0x418f('0x1d')]=_0x164696['id'];this[_0x418f('0x1e')]=_0x164696[_0x418f('0x7')]['firstName']||'';this['starttime']=moment()['format'](_0x418f('0x1f'));this[_0x418f('0x20')]=_0x164696[_0x418f('0x20')];this[_0x418f('0x21')]=_0x164696['callbackuniqueid'];this[_0x418f('0x22')]=_0x164696['callbackat'];this[_0x418f('0x23')]=_0x164696[_0x418f('0x23')];this[_0x418f('0x24')]='';this['originatecalleridname']='';}Action['prototype'][_0x418f('0x25')]=function(){return util['format'](_0x418f('0x26'),this['name'],this[_0x418f('0x4')][_0x418f('0x27')]>0x0?this[_0x418f('0xa')][_0x418f('0x28')](this[_0x418f('0x4')]['dialCutDigit']):this[_0x418f('0xa')]);};Action[_0x418f('0x29')][_0x418f('0x2a')]=function(){return this['queue'];};module[_0x418f('0x2b')]=Action;
\ No newline at end of file
index 04de6fa..31f718b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7249=['countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','diff','seconds','state','Answer','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x24dd98,_0x298319){var _0xbe065c=function(_0x306943){while(--_0x306943){_0x24dd98['push'](_0x24dd98['shift']());}};_0xbe065c(++_0x298319);}(_0x7249,0x15b));var _0x9724=function(_0xabac04,_0x2c5106){_0xabac04=_0xabac04-0x0;var _0x6d7694=_0x7249[_0xabac04];return _0x6d7694;};'use strict';var util=require(_0x9724('0x0'));var _=require(_0x9724('0x1'));var moment=require(_0x9724('0x2'));function getSeconds(_0x23d320,_0x2854a2){var _0x392c1a=moment(_0x23d320)['milliseconds'](0x0);var _0x1c95ca=moment(_0x2854a2)['milliseconds'](0x0);return _0x392c1a[_0x9724('0x3')](_0x1c95ca,_0x9724('0x4'));}function AgentComplete(_0x169e26,_0x1ff125){this[_0x9724('0x5')]=0x4;this['statedesc']=_0x9724('0x6');this['scheduledat']=_0x169e26['scheduledat'];this[_0x9724('0x7')]=_0x169e26[_0x9724('0x7')];this[_0x9724('0x8')]=_0x169e26[_0x9724('0x7')]===_0x9724('0x9')?_0x9724('0xa'):_0x169e26['type'];this[_0x9724('0xb')]=_0x169e26[_0x9724('0xb')];this[_0x9724('0xc')]=_0x169e26[_0x9724('0xc')];this['countnoanswerretry']=_0x169e26[_0x9724('0xd')];this['countglobal']=_0x169e26['countbusyretry']+_0x169e26[_0x9724('0xc')]+_0x169e26[_0x9724('0xd')]+_0x169e26[_0x9724('0xe')]+_0x169e26[_0x9724('0xf')]+_0x169e26[_0x9724('0x10')]+_0x169e26['countmachineretry']+_0x169e26['countagentrejectretry'];this[_0x9724('0xe')]=_0x169e26[_0x9724('0xe')];this[_0x9724('0xf')]=_0x169e26[_0x9724('0xf')];this[_0x9724('0x10')]=_0x169e26[_0x9724('0x10')];this['countmachineretry']=_0x169e26[_0x9724('0x11')];this[_0x9724('0x12')]=_0x169e26[_0x9724('0x12')];this['uniqueid']=_0x1ff125['uniqueid'];this[_0x9724('0x13')]=_0x169e26[_0x9724('0x14')];this['calleridnum']=_0x169e26[_0x9724('0x15')];this['starttime']=_0x169e26[_0x9724('0x16')];this[_0x9724('0x17')]=_0x169e26['responsetime'];this[_0x9724('0x18')]=_0x169e26[_0x9724('0x18')];this['endtime']=moment()[_0x9724('0x19')](_0x9724('0x1a'));this[_0x9724('0x1b')]=getSeconds(_0x169e26[_0x9724('0x17')],_0x169e26['starttime']);this[_0x9724('0x1c')]=getSeconds(_0x169e26[_0x9724('0x18')],_0x169e26[_0x9724('0x17')]);this[_0x9724('0x1d')]=getSeconds(this[_0x9724('0x1e')],_0x169e26[_0x9724('0x18')]);this['queue']=_0x1ff125['queue'];this[_0x9724('0x1f')]=_0x1ff125[_0x9724('0x1f')];this['reason']=_0x1ff125[_0x9724('0x20')];this[_0x9724('0x21')]=_0x169e26[_0x9724('0x21')];this[_0x9724('0x22')]=_0x169e26[_0x9724('0x22')];this[_0x9724('0x23')]=_0x169e26[_0x9724('0x23')];this[_0x9724('0x24')]=_0x169e26[_0x9724('0x24')];this[_0x9724('0x25')]=_0x169e26['ContactId'];this[_0x9724('0x26')]=_0x169e26['ListId'];this[_0x9724('0x27')]=_0x169e26[_0x9724('0x27')];this[_0x9724('0x28')]=_0x169e26['VoiceQueueId'];this['CampaignId']=_0x169e26[_0x9724('0x29')];this[_0x9724('0x2a')]=_0x169e26[_0x9724('0x2a')]||'';this[_0x9724('0x2b')]=_0x169e26['originatecalleridname']||'';}module[_0x9724('0x2c')]=AgentComplete;
\ No newline at end of file
+var _0xf53e=['countagentrejectretry','countabandonedretry','uniqueid','calleridname','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry'];(function(_0x5568e2,_0x452e19){var _0x1688a8=function(_0x4da9e7){while(--_0x4da9e7){_0x5568e2['push'](_0x5568e2['shift']());}};_0x1688a8(++_0x452e19);}(_0xf53e,0xce));var _0xef53=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf53e[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xef53('0x0'));var _=require(_0xef53('0x1'));var moment=require(_0xef53('0x2'));function getSeconds(_0x5c949d,_0x13cb1e){var _0x2519f8=moment(_0x5c949d)[_0xef53('0x3')](0x0);var _0x2766a5=moment(_0x13cb1e)[_0xef53('0x3')](0x0);return _0x2519f8[_0xef53('0x4')](_0x2766a5,_0xef53('0x5'));}function AgentComplete(_0x7f0bf0,_0x15ed58){this[_0xef53('0x6')]=0x4;this['statedesc']=_0xef53('0x7');this['scheduledat']=_0x7f0bf0[_0xef53('0x8')];this[_0xef53('0x9')]=_0x7f0bf0[_0xef53('0x9')];this['campaigntype']=_0x7f0bf0[_0xef53('0x9')]===_0xef53('0xa')?_0xef53('0xb'):_0x7f0bf0[_0xef53('0x9')];this[_0xef53('0xc')]=_0x7f0bf0[_0xef53('0xc')];this['countcongestionretry']=_0x7f0bf0[_0xef53('0xd')];this[_0xef53('0xe')]=_0x7f0bf0[_0xef53('0xe')];this[_0xef53('0xf')]=_0x7f0bf0['countbusyretry']+_0x7f0bf0[_0xef53('0xd')]+_0x7f0bf0[_0xef53('0xe')]+_0x7f0bf0[_0xef53('0x10')]+_0x7f0bf0[_0xef53('0x11')]+_0x7f0bf0['countabandonedretry']+_0x7f0bf0[_0xef53('0x12')]+_0x7f0bf0[_0xef53('0x13')];this[_0xef53('0x10')]=_0x7f0bf0[_0xef53('0x10')];this[_0xef53('0x11')]=_0x7f0bf0[_0xef53('0x11')];this[_0xef53('0x14')]=_0x7f0bf0[_0xef53('0x14')];this[_0xef53('0x12')]=_0x7f0bf0['countmachineretry'];this['countagentrejectretry']=_0x7f0bf0[_0xef53('0x13')];this['uniqueid']=_0x15ed58[_0xef53('0x15')];this[_0xef53('0x16')]=_0x7f0bf0['name'];this['calleridnum']=_0x7f0bf0[_0xef53('0x17')];this['starttime']=_0x7f0bf0[_0xef53('0x18')];this['responsetime']=_0x7f0bf0[_0xef53('0x19')];this[_0xef53('0x1a')]=_0x7f0bf0['answertime'];this[_0xef53('0x1b')]=moment()['format'](_0xef53('0x1c'));this['ringtime']=getSeconds(_0x7f0bf0[_0xef53('0x19')],_0x7f0bf0['starttime']);this[_0xef53('0x1d')]=getSeconds(_0x7f0bf0[_0xef53('0x1a')],_0x7f0bf0['responsetime']);this[_0xef53('0x1e')]=getSeconds(this['endtime'],_0x7f0bf0['answertime']);this[_0xef53('0xb')]=_0x15ed58[_0xef53('0xb')];this[_0xef53('0x1f')]=_0x15ed58[_0xef53('0x1f')];this[_0xef53('0x20')]=_0x15ed58[_0xef53('0x20')];this[_0xef53('0x21')]=_0x7f0bf0['callback'];this[_0xef53('0x22')]=_0x7f0bf0[_0xef53('0x22')];this[_0xef53('0x23')]=_0x7f0bf0['callbackat'];this[_0xef53('0x24')]=_0x7f0bf0[_0xef53('0x24')];this[_0xef53('0x25')]=_0x7f0bf0[_0xef53('0x25')];this['ListId']=_0x7f0bf0[_0xef53('0x26')];this[_0xef53('0x27')]=_0x7f0bf0[_0xef53('0x27')];this[_0xef53('0x28')]=_0x7f0bf0[_0xef53('0x28')];this[_0xef53('0x29')]=_0x7f0bf0[_0xef53('0x29')];this[_0xef53('0x2a')]=_0x7f0bf0['originatecalleridnum']||'';this[_0xef53('0x2b')]=_0x7f0bf0['originatecalleridname']||'';}module[_0xef53('0x2c')]=AgentComplete;
\ No newline at end of file
index df88004..d511fd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbeea=['campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type'];(function(_0x1cfe2e,_0x1ebbcd){var _0x39233f=function(_0x48831a){while(--_0x48831a){_0x1cfe2e['push'](_0x1cfe2e['shift']());}};_0x39233f(++_0x1ebbcd);}(_0xbeea,0xb1));var _0xabee=function(_0x1831b2,_0x53532c){_0x1831b2=_0x1831b2-0x0;var _0x98e069=_0xbeea[_0x1831b2];return _0x98e069;};'use strict';var util=require(_0xabee('0x0'));var _=require('lodash');var moment=require(_0xabee('0x1'));function getSeconds(_0x3b377b,_0x35ca8b){var _0x48a420=moment(_0x3b377b)[_0xabee('0x2')](0x0);var _0x59e264=moment(_0x35ca8b)[_0xabee('0x2')](0x0);return _0x48a420[_0xabee('0x3')](_0x59e264,_0xabee('0x4'));}function Final(_0x49631e){this[_0xabee('0x5')]=_0x49631e['uniqueid'];this['scheduledat']=_0x49631e[_0xabee('0x6')];this[_0xabee('0x7')]=_0x49631e['type'];this[_0xabee('0x8')]=_0x49631e['type']===_0xabee('0x9')?_0xabee('0xa'):_0x49631e[_0xabee('0x7')];this[_0xabee('0xb')]=_0x49631e[_0xabee('0xb')];this[_0xabee('0xc')]=_0x49631e['countcongestionretry'];this[_0xabee('0xd')]=_0x49631e[_0xabee('0xd')];this[_0xabee('0xe')]=_0x49631e['countbusyretry']+_0x49631e[_0xabee('0xc')]+_0x49631e[_0xabee('0xd')]+_0x49631e[_0xabee('0xf')]+_0x49631e['countdropretry']+_0x49631e['countabandonedretry']+_0x49631e['countmachineretry']+_0x49631e['countagentrejectretry'];this['countnosuchnumberretry']=_0x49631e[_0xabee('0xf')];this[_0xabee('0x10')]=_0x49631e[_0xabee('0x10')];this[_0xabee('0x11')]=_0x49631e[_0xabee('0x11')];this['countmachineretry']=_0x49631e[_0xabee('0x12')];this[_0xabee('0x13')]=_0x49631e[_0xabee('0x13')];this[_0xabee('0xa')]=_0x49631e[_0xabee('0xa')];this[_0xabee('0x14')]=_0x49631e[_0xabee('0x14')];this['calleridnum']=_0x49631e[_0xabee('0x15')];this[_0xabee('0x16')]=_0x49631e[_0xabee('0x16')];this[_0xabee('0x17')]=_0x49631e[_0xabee('0x17')];this[_0xabee('0x18')]=_0x49631e['responsetime'];this['ringtime']=_0x49631e[_0xabee('0x19')]||0x0;this['holdtime']=_0x49631e['holdtime']||0x0;this[_0xabee('0x1a')]=_0x49631e[_0xabee('0x1a')]||0x0;this[_0xabee('0x1b')]=_0x49631e[_0xabee('0x1b')];this[_0xabee('0x1c')]=_0x49631e['callbackuniqueid'];this[_0xabee('0x1d')]=_0x49631e['callbackat'];this['recallme']=_0x49631e['recallme'];this[_0xabee('0x1e')]=_0x49631e['ContactId'];this[_0xabee('0x1f')]=_0x49631e[_0xabee('0x1f')];this[_0xabee('0x20')]=_0x49631e[_0xabee('0x20')];this[_0xabee('0x21')]=_0x49631e[_0xabee('0x21')];this[_0xabee('0x22')]=_0x49631e['CampaignId'];this[_0xabee('0x23')]=_0x49631e[_0xabee('0x23')]||'';this[_0xabee('0x24')]=_0x49631e[_0xabee('0x24')]||'';}module['exports']=Final;
\ No newline at end of file
+var _0xf69d=['starttime','responsetime','endtime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xf69d,0xd3));var _0xdf69=function(_0x430433,_0xe2b59e){_0x430433=_0x430433-0x0;var _0x2f4b8f=_0xf69d[_0x430433];return _0x2f4b8f;};'use strict';var util=require(_0xdf69('0x0'));var _=require(_0xdf69('0x1'));var moment=require(_0xdf69('0x2'));function getSeconds(_0xe063fc,_0xf89475){var _0x4e4bdd=moment(_0xe063fc)[_0xdf69('0x3')](0x0);var _0x342114=moment(_0xf89475)[_0xdf69('0x3')](0x0);return _0x4e4bdd[_0xdf69('0x4')](_0x342114,_0xdf69('0x5'));}function Final(_0x18ce2b){this[_0xdf69('0x6')]=_0x18ce2b[_0xdf69('0x6')];this[_0xdf69('0x7')]=_0x18ce2b[_0xdf69('0x7')];this[_0xdf69('0x8')]=_0x18ce2b[_0xdf69('0x8')];this[_0xdf69('0x9')]=_0x18ce2b[_0xdf69('0x8')]===_0xdf69('0xa')?_0xdf69('0xb'):_0x18ce2b[_0xdf69('0x8')];this['countbusyretry']=_0x18ce2b[_0xdf69('0xc')];this[_0xdf69('0xd')]=_0x18ce2b[_0xdf69('0xd')];this[_0xdf69('0xe')]=_0x18ce2b[_0xdf69('0xe')];this[_0xdf69('0xf')]=_0x18ce2b['countbusyretry']+_0x18ce2b['countcongestionretry']+_0x18ce2b['countnoanswerretry']+_0x18ce2b['countnosuchnumberretry']+_0x18ce2b[_0xdf69('0x10')]+_0x18ce2b[_0xdf69('0x11')]+_0x18ce2b[_0xdf69('0x12')]+_0x18ce2b[_0xdf69('0x13')];this[_0xdf69('0x14')]=_0x18ce2b[_0xdf69('0x14')];this['countdropretry']=_0x18ce2b[_0xdf69('0x10')];this[_0xdf69('0x11')]=_0x18ce2b[_0xdf69('0x11')];this[_0xdf69('0x12')]=_0x18ce2b['countmachineretry'];this[_0xdf69('0x13')]=_0x18ce2b['countagentrejectretry'];this[_0xdf69('0xb')]=_0x18ce2b[_0xdf69('0xb')];this['calleridname']=_0x18ce2b[_0xdf69('0x15')];this[_0xdf69('0x16')]=_0x18ce2b[_0xdf69('0x16')];this[_0xdf69('0x17')]=_0x18ce2b['starttime'];this['responsetime']=_0x18ce2b[_0xdf69('0x18')];this[_0xdf69('0x19')]=_0x18ce2b['responsetime'];this[_0xdf69('0x1a')]=_0x18ce2b[_0xdf69('0x1a')]||0x0;this[_0xdf69('0x1b')]=_0x18ce2b['holdtime']||0x0;this[_0xdf69('0x1c')]=_0x18ce2b[_0xdf69('0x1c')]||0x0;this['callback']=_0x18ce2b['callback'];this[_0xdf69('0x1d')]=_0x18ce2b[_0xdf69('0x1d')];this[_0xdf69('0x1e')]=_0x18ce2b['callbackat'];this['recallme']=_0x18ce2b['recallme'];this[_0xdf69('0x1f')]=_0x18ce2b['ContactId'];this[_0xdf69('0x20')]=_0x18ce2b[_0xdf69('0x20')];this[_0xdf69('0x21')]=_0x18ce2b['UserId'];this['VoiceQueueId']=_0x18ce2b[_0xdf69('0x22')];this[_0xdf69('0x23')]=_0x18ce2b[_0xdf69('0x23')];this[_0xdf69('0x24')]=_0x18ce2b['originatecalleridnum']||'';this[_0xdf69('0x25')]=_0x18ce2b[_0xdf69('0x25')]||'';}module[_0xdf69('0x26')]=Final;
\ No newline at end of file
index f8b20eb..ace67ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27bb=['countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x5de021,_0x279bee){var _0x50c057=function(_0x5c9d2d){while(--_0x5c9d2d){_0x5de021['push'](_0x5de021['shift']());}};_0x50c057(++_0x279bee);}(_0x27bb,0x110));var _0xb27b=function(_0x183851,_0x45b859){_0x183851=_0x183851-0x0;var _0x34fd8b=_0x27bb[_0x183851];return _0x34fd8b;};'use strict';var util=require(_0xb27b('0x0'));var _=require(_0xb27b('0x1'));var moment=require(_0xb27b('0x2'));function getSeconds(_0x162f68,_0x2194c4){var _0x40771c=moment(_0x162f68)[_0xb27b('0x3')](0x0);var _0x38b169=moment(_0x2194c4)[_0xb27b('0x3')](0x0);return _0x40771c[_0xb27b('0x4')](_0x38b169,_0xb27b('0x5'));}function Hangup(_0x77d297,_0x2953e2){this[_0xb27b('0x6')]=0x4;this['statedesc']=_0xb27b('0x7');this['scheduledat']=_0x77d297[_0xb27b('0x8')];this[_0xb27b('0x9')]=_0x77d297[_0xb27b('0x9')];this[_0xb27b('0xa')]=_0x77d297[_0xb27b('0x9')]==='outbound'?_0xb27b('0xb'):_0x77d297['type'];this[_0xb27b('0xc')]=_0x77d297['countbusyretry'];this[_0xb27b('0xd')]=_0x77d297['countcongestionretry'];this[_0xb27b('0xe')]=_0x77d297[_0xb27b('0xe')];this[_0xb27b('0xf')]=_0x77d297[_0xb27b('0xc')]+_0x77d297[_0xb27b('0xd')]+_0x77d297[_0xb27b('0xe')]+_0x77d297[_0xb27b('0x10')]+_0x77d297[_0xb27b('0x11')]+_0x77d297['countabandonedretry']+_0x77d297[_0xb27b('0x12')]+_0x77d297['countagentrejectretry'];this[_0xb27b('0x10')]=_0x77d297[_0xb27b('0x10')];this[_0xb27b('0x11')]=_0x77d297['countdropretry'];this[_0xb27b('0x13')]=_0x77d297[_0xb27b('0x13')];this[_0xb27b('0x12')]=_0x77d297[_0xb27b('0x12')];this[_0xb27b('0x14')]=_0x77d297[_0xb27b('0x14')];this[_0xb27b('0x15')]=_0x2953e2[_0xb27b('0x15')];this[_0xb27b('0x16')]=_0x77d297[_0xb27b('0x17')];this[_0xb27b('0x18')]=_0x77d297['number'];this[_0xb27b('0x19')]=_0x77d297[_0xb27b('0x19')];this['responsetime']=_0x77d297[_0xb27b('0x1a')];this[_0xb27b('0x1b')]=moment()['format'](_0xb27b('0x1c'));this['ringtime']=getSeconds(_0x77d297[_0xb27b('0x1a')],_0x77d297[_0xb27b('0x19')]);this['holdtime']=0x0;this[_0xb27b('0x1d')]=getSeconds(this['endtime'],_0x77d297[_0xb27b('0x1a')]);this[_0xb27b('0xb')]=_0x77d297[_0xb27b('0xb')];this[_0xb27b('0x1e')]=_0xb27b('0x1f');this[_0xb27b('0x20')]=_0x2953e2['cause-txt'];this[_0xb27b('0x21')]=_0x77d297['callback'];this[_0xb27b('0x22')]=_0x77d297[_0xb27b('0x22')];this[_0xb27b('0x23')]=_0x77d297[_0xb27b('0x23')];this['recallme']=_0x77d297['recallme'];this['ContactId']=_0x77d297[_0xb27b('0x24')];this[_0xb27b('0x25')]=_0x77d297[_0xb27b('0x25')];this['UserId']=_0x77d297[_0xb27b('0x26')];this['VoiceQueueId']=_0x77d297['VoiceQueueId'];this[_0xb27b('0x27')]=_0x77d297[_0xb27b('0x27')];}module[_0xb27b('0x28')]=Hangup;
\ No newline at end of file
+var _0xefb8=['responsetime','format','holdtime','talktime','endtime','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','seconds','state','statedesc','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','starttime'];(function(_0xc59127,_0x5f080e){var _0x3d8d95=function(_0x48daa1){while(--_0x48daa1){_0xc59127['push'](_0xc59127['shift']());}};_0x3d8d95(++_0x5f080e);}(_0xefb8,0x162));var _0x8efb=function(_0x3a5c9b,_0x26460d){_0x3a5c9b=_0x3a5c9b-0x0;var _0x236ded=_0xefb8[_0x3a5c9b];return _0x236ded;};'use strict';var util=require(_0x8efb('0x0'));var _=require('lodash');var moment=require(_0x8efb('0x1'));function getSeconds(_0x573a36,_0x7b521d){var _0x3b1912=moment(_0x573a36)[_0x8efb('0x2')](0x0);var _0x38cae6=moment(_0x7b521d)[_0x8efb('0x2')](0x0);return _0x3b1912['diff'](_0x38cae6,_0x8efb('0x3'));}function Hangup(_0x320e50,_0x5556c5){this[_0x8efb('0x4')]=0x4;this[_0x8efb('0x5')]=_0x8efb('0x6');this[_0x8efb('0x7')]=_0x320e50[_0x8efb('0x7')];this[_0x8efb('0x8')]=_0x320e50[_0x8efb('0x8')];this['campaigntype']=_0x320e50['type']===_0x8efb('0x9')?_0x8efb('0xa'):_0x320e50[_0x8efb('0x8')];this['countbusyretry']=_0x320e50[_0x8efb('0xb')];this[_0x8efb('0xc')]=_0x320e50[_0x8efb('0xc')];this[_0x8efb('0xd')]=_0x320e50['countnoanswerretry'];this[_0x8efb('0xe')]=_0x320e50['countbusyretry']+_0x320e50[_0x8efb('0xc')]+_0x320e50['countnoanswerretry']+_0x320e50[_0x8efb('0xf')]+_0x320e50[_0x8efb('0x10')]+_0x320e50[_0x8efb('0x11')]+_0x320e50['countmachineretry']+_0x320e50[_0x8efb('0x12')];this['countnosuchnumberretry']=_0x320e50[_0x8efb('0xf')];this[_0x8efb('0x10')]=_0x320e50[_0x8efb('0x10')];this[_0x8efb('0x11')]=_0x320e50[_0x8efb('0x11')];this[_0x8efb('0x13')]=_0x320e50[_0x8efb('0x13')];this[_0x8efb('0x12')]=_0x320e50[_0x8efb('0x12')];this[_0x8efb('0x14')]=_0x5556c5['uniqueid'];this[_0x8efb('0x15')]=_0x320e50[_0x8efb('0x16')];this['calleridnum']=_0x320e50['number'];this[_0x8efb('0x17')]=_0x320e50[_0x8efb('0x17')];this[_0x8efb('0x18')]=_0x320e50[_0x8efb('0x18')];this['endtime']=moment()[_0x8efb('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x320e50[_0x8efb('0x18')],_0x320e50[_0x8efb('0x17')]);this[_0x8efb('0x1a')]=0x0;this[_0x8efb('0x1b')]=getSeconds(this[_0x8efb('0x1c')],_0x320e50[_0x8efb('0x18')]);this[_0x8efb('0xa')]=_0x320e50[_0x8efb('0xa')];this[_0x8efb('0x1d')]=_0x8efb('0x1e');this[_0x8efb('0x1f')]=_0x5556c5['cause-txt'];this[_0x8efb('0x20')]=_0x320e50[_0x8efb('0x20')];this['callbackuniqueid']=_0x320e50[_0x8efb('0x21')];this[_0x8efb('0x22')]=_0x320e50[_0x8efb('0x22')];this[_0x8efb('0x23')]=_0x320e50[_0x8efb('0x23')];this[_0x8efb('0x24')]=_0x320e50['ContactId'];this[_0x8efb('0x25')]=_0x320e50[_0x8efb('0x25')];this[_0x8efb('0x26')]=_0x320e50['UserId'];this[_0x8efb('0x27')]=_0x320e50[_0x8efb('0x27')];this[_0x8efb('0x28')]=_0x320e50[_0x8efb('0x28')];}module[_0x8efb('0x29')]=Hangup;
\ No newline at end of file
index 50af3c2..27016fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb382=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat'];(function(_0x16aaef,_0x410651){var _0x1c82ef=function(_0x3d802b){while(--_0x3d802b){_0x16aaef['push'](_0x16aaef['shift']());}};_0x1c82ef(++_0x410651);}(_0xb382,0x1c1));var _0x2b38=function(_0x45e60e,_0x529bef){_0x45e60e=_0x45e60e-0x0;var _0x5717a5=_0xb382[_0x45e60e];return _0x5717a5;};'use strict';var util=require(_0x2b38('0x0'));var _=require(_0x2b38('0x1'));var moment=require('moment');function getSeconds(_0x34fdcd,_0x186d61){var _0x2afd78=moment(_0x34fdcd)['milliseconds'](0x0);var _0x200303=moment(_0x186d61)[_0x2b38('0x2')](0x0);return _0x2afd78[_0x2b38('0x3')](_0x200303,_0x2b38('0x4'));}function History(_0x476099){this[_0x2b38('0x5')]=_0x476099[_0x2b38('0x5')];this[_0x2b38('0x6')]=_0x476099['scheduledat']||undefined;this[_0x2b38('0x7')]=_0x476099[_0x2b38('0x7')];this[_0x2b38('0x8')]=_0x476099[_0x2b38('0x7')]===_0x2b38('0x9')?_0x2b38('0xa'):_0x476099[_0x2b38('0x7')];this[_0x2b38('0xb')]=_0x476099[_0x2b38('0xb')];this[_0x2b38('0xc')]=_0x476099[_0x2b38('0xc')];this[_0x2b38('0xd')]=_0x476099[_0x2b38('0xd')];this['countglobal']=_0x476099[_0x2b38('0xb')]+_0x476099[_0x2b38('0xc')]+_0x476099[_0x2b38('0xd')]+_0x476099['countnosuchnumberretry']+_0x476099[_0x2b38('0xe')]+_0x476099[_0x2b38('0xf')]+_0x476099[_0x2b38('0x10')]+_0x476099[_0x2b38('0x11')];this[_0x2b38('0x12')]=_0x476099[_0x2b38('0x12')];this[_0x2b38('0xe')]=_0x476099['countdropretry'];this['countabandonedretry']=_0x476099['countabandonedretry'];this[_0x2b38('0x10')]=_0x476099[_0x2b38('0x10')];this[_0x2b38('0x11')]=_0x476099[_0x2b38('0x11')];this[_0x2b38('0xa')]=_0x476099[_0x2b38('0xa')];this[_0x2b38('0x13')]=_0x476099[_0x2b38('0x14')];this[_0x2b38('0x15')]=_0x476099[_0x2b38('0x16')];this['starttime']=_0x476099[_0x2b38('0x17')];this['responsetime']=_0x476099[_0x2b38('0x18')];this[_0x2b38('0x19')]=_0x476099[_0x2b38('0x18')];this['ringtime']=getSeconds(_0x476099['responsetime'],_0x476099['starttime']);this[_0x2b38('0x1a')]=0x0;this[_0x2b38('0x1b')]=0x0;this[_0x2b38('0x1c')]=_0x476099[_0x2b38('0x1c')];this['callbackuniqueid']=_0x476099[_0x2b38('0x1d')];this['callbackat']=_0x476099[_0x2b38('0x1e')];this[_0x2b38('0x1f')]=_0x476099[_0x2b38('0x1f')];this[_0x2b38('0x20')]=_0x476099[_0x2b38('0x20')];this[_0x2b38('0x21')]=_0x476099[_0x2b38('0x21')];this[_0x2b38('0x22')]=_0x476099[_0x2b38('0x22')];this[_0x2b38('0x23')]=_0x476099[_0x2b38('0x23')];this[_0x2b38('0x24')]=_0x476099[_0x2b38('0x24')];this[_0x2b38('0x25')]=_0x476099[_0x2b38('0x25')]||'';this['originatecalleridname']=_0x476099[_0x2b38('0x26')]||'';}module[_0x2b38('0x27')]=History;
\ No newline at end of file
+var _0x2a57=['calleridname','number','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','queue'];(function(_0x4f8ef7,_0x1d3cc8){var _0x268ac4=function(_0x19e0af){while(--_0x19e0af){_0x4f8ef7['push'](_0x4f8ef7['shift']());}};_0x268ac4(++_0x1d3cc8);}(_0x2a57,0x84));var _0x72a5=function(_0x48c615,_0x4cc757){_0x48c615=_0x48c615-0x0;var _0x3d9e22=_0x2a57[_0x48c615];return _0x3d9e22;};'use strict';var util=require(_0x72a5('0x0'));var _=require(_0x72a5('0x1'));var moment=require(_0x72a5('0x2'));function getSeconds(_0x40f207,_0x24ed57){var _0x237bed=moment(_0x40f207)[_0x72a5('0x3')](0x0);var _0x31a9ac=moment(_0x24ed57)[_0x72a5('0x3')](0x0);return _0x237bed['diff'](_0x31a9ac,_0x72a5('0x4'));}function History(_0x382acc){this[_0x72a5('0x5')]=_0x382acc[_0x72a5('0x5')];this[_0x72a5('0x6')]=_0x382acc[_0x72a5('0x6')]||undefined;this[_0x72a5('0x7')]=_0x382acc[_0x72a5('0x7')];this[_0x72a5('0x8')]=_0x382acc[_0x72a5('0x7')]===_0x72a5('0x9')?'queue':_0x382acc[_0x72a5('0x7')];this[_0x72a5('0xa')]=_0x382acc[_0x72a5('0xa')];this[_0x72a5('0xb')]=_0x382acc[_0x72a5('0xb')];this[_0x72a5('0xc')]=_0x382acc[_0x72a5('0xc')];this[_0x72a5('0xd')]=_0x382acc['countbusyretry']+_0x382acc[_0x72a5('0xb')]+_0x382acc['countnoanswerretry']+_0x382acc['countnosuchnumberretry']+_0x382acc[_0x72a5('0xe')]+_0x382acc[_0x72a5('0xf')]+_0x382acc[_0x72a5('0x10')]+_0x382acc[_0x72a5('0x11')];this[_0x72a5('0x12')]=_0x382acc['countnosuchnumberretry'];this[_0x72a5('0xe')]=_0x382acc[_0x72a5('0xe')];this['countabandonedretry']=_0x382acc[_0x72a5('0xf')];this[_0x72a5('0x10')]=_0x382acc[_0x72a5('0x10')];this[_0x72a5('0x11')]=_0x382acc[_0x72a5('0x11')];this['queue']=_0x382acc[_0x72a5('0x13')];this[_0x72a5('0x14')]=_0x382acc['name'];this['calleridnum']=_0x382acc[_0x72a5('0x15')];this[_0x72a5('0x16')]=_0x382acc[_0x72a5('0x16')];this[_0x72a5('0x17')]=_0x382acc[_0x72a5('0x17')];this[_0x72a5('0x18')]=_0x382acc[_0x72a5('0x17')];this[_0x72a5('0x19')]=getSeconds(_0x382acc['responsetime'],_0x382acc[_0x72a5('0x16')]);this[_0x72a5('0x1a')]=0x0;this['talktime']=0x0;this[_0x72a5('0x1b')]=_0x382acc[_0x72a5('0x1b')];this[_0x72a5('0x1c')]=_0x382acc['callbackuniqueid'];this['callbackat']=_0x382acc[_0x72a5('0x1d')];this[_0x72a5('0x1e')]=_0x382acc[_0x72a5('0x1e')];this[_0x72a5('0x1f')]=_0x382acc[_0x72a5('0x1f')];this['ListId']=_0x382acc[_0x72a5('0x20')];this[_0x72a5('0x21')]=_0x382acc[_0x72a5('0x21')];this['VoiceQueueId']=_0x382acc['VoiceQueueId'];this['CampaignId']=_0x382acc[_0x72a5('0x22')];this['originatecalleridnum']=_0x382acc[_0x72a5('0x23')]||'';this[_0x72a5('0x24')]=_0x382acc[_0x72a5('0x24')]||'';}module[_0x72a5('0x25')]=History;
\ No newline at end of file
index 53f20a2..d2c815c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x151b=['[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','merge','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','active','SIP/%s','unmonitored','isNil','variable','xcally-motion-dialer','dialAMDActive','value','uniqueid','outboundAnswerCallsDay','HangupInAMD','membername','AMD','buildObj','[syncHangupInAMD]','MACHINE','Machine','countglobal','amd','custom:amd','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','dialGlobalMaxRetry','countmachineretry','dialMachineMaxRetry','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countbusyretry','countagentrejectretry','stateGlobal','reason19\x20machine....','createStateFinal','add','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','syncAgentComplete','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','droptime','responsetime','dialQueueTimeout','dropreason','dialQueueProject2','countdropretry','dialDropRetryFrequency','additional','dialDropMaxRetry','[rescheduleContact][Drop]','Drop','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','voiceQueue','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','push','pick','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','finally','[unlock][syncQueueStatusComplete]','_rr','[booked][RR]','Agent:\x20','unlockRR','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTimeIntervals','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','iftime\x20%s,%s','interval','timezones','content','indexOf','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','checkIfTime','dialTimezone','[syncQueueSummary]','filter','dialPreviewRecallmeReminder','online','reachable','handlePreviewRecallNotifications','map','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','syncCampaigns','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','pow','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','getCaller','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','phone','trim','dialCutDigit','substring','OriginateError','[originate][error]','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','callAdditionalPhoneAfterMin','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','dialAbandonedMaxRetry','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','outboundQueuePauses','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','[booked][checkContactBlack]','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','[Originate][historyBlacklist]','handleIvr','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','booked','dialLimitQueue','RUNNING','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','busyFactor','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','exports','util','uuid','md5','ioredis','../preview/util/util','dialer','../../../config/logger','predictiveCalls','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperFinal','../rpc/cmHopperAdditionalPhone','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/setting','./action','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','syncQueueSummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncNewExten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','message','\x20INTERVAL_IS_NULL','Interval','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','seconds','emit','type','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','callerid','format','voice_queue:save','ivr','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','outbound','\x22%s\x22\x20<%s>','string','\x22\x22\x20<>','inspect','error','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','debug','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','sequence','enqueue','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','[countReScheduled]\x20','checkIsBlackList','resolve','[checkIsBlackList]\x20','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20'];(function(_0x437657,_0x137e36){var _0x5d01b3=function(_0x225cb5){while(--_0x225cb5){_0x437657['push'](_0x437657['shift']());}};_0x5d01b3(++_0x137e36);}(_0x151b,0x153));var _0xb151=function(_0x7cd8ff,_0x5e4219){_0x7cd8ff=_0x7cd8ff-0x0;var _0x57a7d1=_0x151b[_0x7cd8ff];return _0x57a7d1;};'use strict';var util=require(_0xb151('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xb151('0x1'));var moment=require('moment');var rr=require('rr');var md5=require(_0xb151('0x2'));var Redis=require(_0xb151('0x3'));var ut=require(_0xb151('0x4'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0xb151('0x5'));var loggerBooked=require(_0xb151('0x6'))('booked');var loggerPredictive=require(_0xb151('0x6'))('predictive');var loggerPredictiveCalls=require(_0xb151('0x6'))(_0xb151('0x7'));var loggerSyncQueueSummary=require(_0xb151('0x6'))('syncQueueSummary');var ami=require('../ami');config[_0xb151('0x8')]=_[_0xb151('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb151('0xa'))(new Redis(config[_0xb151('0x8')]));var cmHopper=require(_0xb151('0xb'));var cmHopperHistory=require(_0xb151('0xc'));var cmHopperFinal=require(_0xb151('0xd'));var cmHopperAdditionalPhone=require(_0xb151('0xe'));var cmHopperBlack=require(_0xb151('0xf'));var voiceQueueRt=require(_0xb151('0x10'));var RpcSetting=require(_0xb151('0x11'));var Action=require(_0xb151('0x12'));var History=require('./history');var Final=require(_0xb151('0x13'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xb151('0x14'));var Hangup=require(_0xb151('0x15'));var ipAgi=process[_0xb151('0x16')][_0xb151('0x17')]||'127.0.0.1';var strategy={'rrmemory':_0xb151('0x18'),'roundrobin':_0xb151('0x19')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xb151('0x1a')]['enqueue']=function(_0x56ea81){this[_0xb151('0x1b')]=this['tail']?this[_0xb151('0x1b')]['finally'](_0x56ea81):_0x56ea81();};function Dialer(_0x251c8d,_0x4b21c0){this['sequence']=new Sequence();this[_0xb151('0x1c')]=_0x4b21c0;this[_0xb151('0x1d')]=_0x251c8d[_0xb151('0x1d')];this[_0xb151('0x1e')]=_0x251c8d[_0xb151('0x1e')];this[_0xb151('0x1f')]=_0x251c8d[_0xb151('0x1f')];this['trunks']=_0x251c8d[_0xb151('0x20')];this[_0xb151('0x21')]=config['maxNumberOriginate']||0x2;this[_0xb151('0x22')]={};this[_0xb151('0x23')]={};this[_0xb151('0x24')]={};this[_0xb151('0x25')]={};this[_0xb151('0x26')]={};this[_0xb151('0x27')]={};this[_0xb151('0x28')]={};this[_0xb151('0x29')]={};this[_0xb151('0x2a')]={};this[_0xb151('0x2b')]={};ami['on']('agentconnect',this[_0xb151('0x2c')][_0xb151('0x2d')](this));ami['on'](_0xb151('0x2e'),this[_0xb151('0x2f')][_0xb151('0x2d')](this));ami['on'](_0xb151('0x30'),this[_0xb151('0x31')][_0xb151('0x2d')](this));ami['on'](_0xb151('0x32'),this['syncAgentComplete'][_0xb151('0x2d')](this));ami['on'](_0xb151('0x33'),this[_0xb151('0x34')][_0xb151('0x2d')](this));ami['on'](_0xb151('0x35'),this[_0xb151('0x36')][_0xb151('0x2d')](this));ami['on'](_0xb151('0x37'),this['syncHangup'][_0xb151('0x2d')](this));ami['on']('newexten',this[_0xb151('0x38')][_0xb151('0x2d')](this));ami['on']('varset',this[_0xb151('0x39')]['bind'](this));ami['on'](_0xb151('0x3a'),this[_0xb151('0x3b')][_0xb151('0x2d')](this));ami['on'](_0xb151('0x3c'),this[_0xb151('0x3d')][_0xb151('0x2d')](this));this[_0xb151('0x3e')]();this[_0xb151('0x3f')]();RpcSetting['getSettings']()[_0xb151('0x40')](function(_0x2c920e){previewRecallmeReminderInterval=_0x2c920e[_0xb151('0x41')];});}function isNotNull(_0x2f3c45){return _0x2f3c45!==null&&!_[_0xb151('0x42')](_0x2f3c45);}function checkIsLoggedIn(_0x438888,_0xc363d2){return function(){if(_0xc363d2<=0x0){_0x438888['message']=_0xb151('0x43');throw _0x438888[_0xb151('0x44')]+_0xb151('0x45');}};}function isActive(_0x378176){return _0x378176;}function checkIsActive(_0x2fdd66,_0x4fc9da){return function(){if(!isActive(_0x4fc9da)){_0x2fdd66['message']=_0xb151('0x46');throw _0x2fdd66[_0xb151('0x44')]+_0xb151('0x47');}};}function checkInterval(_0x3c21e3){return function(){if(!isNotNull(_0x3c21e3['Interval'])){_0x3c21e3[_0xb151('0x48')]='INTERVAL_IS_NULL';throw _0x3c21e3[_0xb151('0x44')]+_0xb151('0x49');}if(!isNotNull(_0x3c21e3[_0xb151('0x4a')][_0xb151('0x4b')])){_0x3c21e3[_0xb151('0x48')]=_0xb151('0x4c');throw _0x3c21e3[_0xb151('0x44')]+_0xb151('0x49');}if(!isNotNull(_[_0xb151('0x4d')](_0x3c21e3[_0xb151('0x4a')][_0xb151('0x4b')]))){_0x3c21e3['message']=_0xb151('0x4c');throw _0x3c21e3[_0xb151('0x44')]+_0xb151('0x49');}};}function msgResponse(_0x5f22dd,_0x233633,_0x2f9f48){return{'action':_0x5f22dd,'response':_0x233633,'message':_0x2f9f48,'stack':_0x2f9f48};}function myreject(_0x41fcb6){return function(_0x1a53e7){return _0x41fcb6(msgResponse(_0xb151('0x4e'),_0xb151('0x4f'),JSON[_0xb151('0x50')](_0x1a53e7)));};}function getSeconds(_0x39dc3d,_0x76fc6){var _0x2af98f=moment(_0x39dc3d)[_0xb151('0x51')](0x0);var _0x484195=moment(_0x76fc6)[_0xb151('0x51')](0x0);return _0x2af98f['diff'](_0x484195,_0xb151('0x52'));}function emit(_0x37fe7c,_0x3a4ff1,_0x38558c){io['to'](_0x37fe7c)[_0xb151('0x53')](_0x3a4ff1,_0x38558c);}function emitVoiceQueueSummary(_0x47035e){if(_0x47035e[_0xb151('0x54')]==='outbound'){var _0x9f15a7={'id':_0x47035e['id'],'name':_0x47035e[_0xb151('0x44')],'strategy':_0x47035e[_0xb151('0x55')],'answered':_0x47035e[_0xb151('0x56')],'available':_0x47035e[_0xb151('0x57')],'loggedIn':_0x47035e[_0xb151('0x58')],'pTalking':_0x47035e[_0xb151('0x59')],'sumBillable':_0x47035e[_0xb151('0x5a')],'sumDuration':_0x47035e[_0xb151('0x5b')],'sumHoldTime':_0x47035e[_0xb151('0x5c')]||0x0,'talking':_0x47035e[_0xb151('0x5d')],'total':_0x47035e[_0xb151('0x5e')],'type':_0x47035e[_0xb151('0x54')],'unmanaged':_0x47035e[_0xb151('0x5f')],'abandoned':_0x47035e[_0xb151('0x60')],'waiting':_0x47035e[_0xb151('0x61')],'loggedInDb':_0x47035e[_0xb151('0x62')],'dialActive':_0x47035e[_0xb151('0x63')],'dialMethod':_0x47035e[_0xb151('0x64')],'dialOriginateCallerIdName':_0x47035e[_0xb151('0x65')],'dialOriginateCallerIdNumber':_0x47035e[_0xb151('0x66')],'dialOriginateTimeout':_0x47035e[_0xb151('0x67')],'dialPrefix':_0x47035e[_0xb151('0x68')],'outboundAnswerAgiCallsDay':_0x47035e[_0xb151('0x69')],'outboundAnswerCallsDay':_0x47035e['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x47035e[_0xb151('0x6a')],'outboundBusyCallsDay':_0x47035e[_0xb151('0x6b')],'outboundCongestionCallsDay':_0x47035e[_0xb151('0x6c')],'outboundDropCallsDayACS':_0x47035e[_0xb151('0x6d')],'outboundDropCallsDayCallersExit':_0x47035e[_0xb151('0x6e')],'outboundDropCallsDayTimeout':_0x47035e[_0xb151('0x6f')],'outboundNoAnswerCallsDay':_0x47035e['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x47035e[_0xb151('0x70')],'outboundOriginateFailureCallsDay':_0x47035e[_0xb151('0x71')],'outboundReCallsDay':_0x47035e[_0xb151('0x72')],'outboundRejectCallsDay':_0x47035e[_0xb151('0x73')],'outboundUnknownCallsDay':_0x47035e[_0xb151('0x74')],'predictiveIntervalAnsweredCalls':_0x47035e[_0xb151('0x75')],'predictiveIntervalAvgHoldtime':_0x47035e[_0xb151('0x76')],'predictiveIntervalAvgTalktime':_0x47035e[_0xb151('0x77')],'predictiveIntervalDroppedCallsCallersExit':_0x47035e[_0xb151('0x78')],'predictiveIntervalDroppedCallsTimeout':_0x47035e[_0xb151('0x79')],'predictiveIntervalErlangCalls':_0x47035e['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x47035e[_0xb151('0x7a')],'predictiveIntervalHitRate':_0x47035e['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x47035e[_0xb151('0x7b')],'predictiveIntervalPauses':_0x47035e[_0xb151('0x7c')],'predictiveIntervalAvailable':_0x47035e[_0xb151('0x7d')],'predictiveIntervalTotalCalls':_0x47035e['predictiveIntervalTotalCalls'],'message':_0x47035e[_0xb151('0x48')],'originated':_0x47035e['originated'],'erlangCalls':_0x47035e[_0xb151('0x7e')],'erlangCallToSecond':_0x47035e[_0xb151('0x7f')],'erlangAbandonmentRate':_0x47035e[_0xb151('0x80')],'erlangBusyFactor':_0x47035e[_0xb151('0x81')],'startPredictive':_0x47035e[_0xb151('0x27')],'startProgressive':_0x47035e['startProgressive']};if(_0x47035e[_0xb151('0x82')]){_0x9f15a7['Trunk']={'id':_0x47035e[_0xb151('0x82')]['id'],'name':_0x47035e[_0xb151('0x82')][_0xb151('0x44')],'active':_0x47035e[_0xb151('0x82')]['active'],'callerid':_0x47035e[_0xb151('0x82')][_0xb151('0x83')]};}if(_0x47035e[_0xb151('0x4a')]){_0x9f15a7[_0xb151('0x4a')]={'id':_0x47035e['Interval']['id'],'name':_0x47035e[_0xb151('0x4a')]['name']};}var _0x3d67aa=md5(JSON[_0xb151('0x50')](_0x9f15a7));if(_0x47035e[_0xb151('0x2')]!==_0x3d67aa){_0x47035e[_0xb151('0x2')]=_0x3d67aa;emit(util[_0xb151('0x84')]('voice:queue:%s',_0x9f15a7['name']),_0xb151('0x85'),_0x9f15a7);}}}function emitCampaignSummary(_0x261aa5){if(_0x261aa5[_0xb151('0x54')]===_0xb151('0x86')){emit(util[_0xb151('0x84')]('campaign:ivr:%s',_0x261aa5[_0xb151('0x44')]),'campaign:save',_0x261aa5);}}function checkGetDataPredictive(_0x3ba19f){if(isNotNull(_0x3ba19f)&&!_['isEmpty'](_0x3ba19f)){loggerPredictive[_0xb151('0x87')](_0xb151('0x88'));loggerPredictive['info'](_0xb151('0x89'),_0x3ba19f[_0xb151('0x8a')]);loggerPredictive[_0xb151('0x87')](_0xb151('0x8b'),_0x3ba19f[_0xb151('0x75')]);loggerPredictive[_0xb151('0x87')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3ba19f['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0xb151('0x8c'),_0x3ba19f[_0xb151('0x78')]);loggerPredictive[_0xb151('0x87')](_0xb151('0x8d'),_0x3ba19f[_0xb151('0x76')]);loggerPredictive['info'](_0xb151('0x8e'),_0x3ba19f['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0xb151('0x8f'));if(_0x3ba19f[_0xb151('0x8a')]>0x0){if(!_['isUndefined'](_0x3ba19f['predictiveIntervalAvgTalktime'])&&_0x3ba19f[_0xb151('0x77')]>0x0){return!![];}loggerPredictive[_0xb151('0x87')](_0xb151('0x90'));if(!_[_0xb151('0x42')](_0x3ba19f[_0xb151('0x76')])&&_0x3ba19f[_0xb151('0x76')]>0x0){return!![];}loggerPredictive[_0xb151('0x87')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0xb151('0x87')](_0xb151('0x91'));}}else{loggerPredictive[_0xb151('0x87')](_0xb151('0x92'));}return![];}function mergeDataErlangB(_0x4ca0fc){return function(_0x1754b2){loggerPredictive[_0xb151('0x87')](_0xb151('0x93'));loggerPredictive[_0xb151('0x87')](_0xb151('0x94'),_0x1754b2[_0xb151('0x7e')]);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1754b2[_0xb151('0x7f')]);loggerPredictive[_0xb151('0x87')](_0xb151('0x95'),_0x1754b2[_0xb151('0x80')]);loggerPredictive[_0xb151('0x87')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1754b2[_0xb151('0x81')]);loggerPredictive[_0xb151('0x87')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1754b2[_0xb151('0x80')]);loggerPredictive[_0xb151('0x87')](_0xb151('0x8f'));_['merge'](_0x4ca0fc,_0x1754b2);};}function getDiff(_0x2bfe63){var _0x4ea1dd=moment()[_0xb151('0x51')](0x0);var _0x19328a=moment(_0x2bfe63)[_0xb151('0x51')](0x0);return _0x4ea1dd[_0xb151('0x96')](_0x19328a,_0xb151('0x52'));}function ifInterval(_0x37e99f,_0x3104da){if(_[_0xb151('0x42')](_0x3104da)){return![];}return getDiff(_0x3104da)<_0x37e99f*0x3c;}function freeVariablesPredictive(_0x1cfc6e){if(isNotNull(_0x1cfc6e)){if(!_[_0xb151('0x42')](_0x1cfc6e[_0xb151('0x28')])){_0x1cfc6e[_0xb151('0x28')]=undefined;loggerPredictive['info'](_0x1cfc6e[_0xb151('0x44')],_0xb151('0x97'));}if(!_['isUndefined'](_0x1cfc6e[_0xb151('0x27')])){_0x1cfc6e[_0xb151('0x27')]=undefined;loggerPredictive['info'](_0x1cfc6e[_0xb151('0x44')],_0xb151('0x98'));}if(!_[_0xb151('0x42')](_0x1cfc6e[_0xb151('0x99')])){clearInterval(_0x1cfc6e['handlePredictive']);_0x1cfc6e[_0xb151('0x99')]=undefined;loggerPredictive[_0xb151('0x87')](_0x1cfc6e[_0xb151('0x44')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x1723cb,_0x197e73){if(_0x197e73===0x0){return 0x0;}var _0x2f3f6f=0x1;for(var _0x52a248=0x1;_0x52a248<=_0x197e73;_0x52a248+=0x1){_0x2f3f6f=0x1+_0x2f3f6f*_0x52a248/_0x1723cb;}return 0x1/_0x2f3f6f;}function isVoiceQueueOutbound(_0x35c40f){return _0x35c40f===_0xb151('0x9a');}function isNotPreview(_0x48d931){return _0x48d931!==_0xb151('0x1c');}function isCampaignIvr(_0x3b4c87){return _0x3b4c87===_0xb151('0x86');}function getCallerId(_0x12b97e,_0x1979bb,_0x12242e){if(!_[_0xb151('0x42')](_0x12242e)&&typeof _0x12242e==='string'&&!_[_0xb151('0x4d')](_0x12242e)){if(!_[_0xb151('0x42')](_0x1979bb)&&typeof _0x1979bb==='string'&&!_['isEmpty'](_0x1979bb)){return util[_0xb151('0x84')](_0xb151('0x9b'),_0x1979bb,_0x12242e);}return util[_0xb151('0x84')](_0xb151('0x9b'),_0x12242e,_0x12242e);}if(!_['isUndefined'](_0x12b97e)&&typeof _0x12b97e===_0xb151('0x9c')&&!_[_0xb151('0x4d')](_0x12b97e)){return _0x12b97e;}return _0xb151('0x9d');}function loggerCatchQueueSummary(_0x49e2fc,_0x420b0c){return function(_0x2ff255){freeVariablesPredictive(_0x420b0c);emitVoiceQueueSummary(_0x420b0c);emitCampaignSummary(_0x420b0c);loggerSyncQueueSummary['debug'](_0x49e2fc,util[_0xb151('0x9e')](_0x2ff255,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x42a051,_0x326423){return function(_0x4900bb){loggerPredictive['error'](_0x326423[_0xb151('0x44')],_0x42a051);loggerPredictive[_0xb151('0x9f')](_0x4900bb['stack']);freeVariablesPredictive(_0x326423);};}function loggerCatch(_0x332e14){return function(_0x51f183){logger[_0xb151('0x9f')](_0x332e14,util[_0xb151('0x9e')](_0x51f183,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x88af53){return _0x88af53&&!_[_0xb151('0x42')](_0x88af53)&&_0x88af53[_0xb151('0xa0')]>0x0;}function decremetOriginate(_0x961666){if(!_['isUndefined'](_0x961666)&&_0x961666!==null){if(typeof _0x961666[_0xb151('0xa1')]!==_0xb151('0xa2')){if(_0x961666[_0xb151('0xa1')]>0x0){_0x961666[_0xb151('0xa1')]-=0x1;}else{logger[_0xb151('0x9f')](_0xb151('0xa3'));}}}else{logger['error']('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x563b0a,_0x2ec1d9,_0x4c0179){if(_0x2ec1d9>_0x4c0179){for(var _0x238faa=0x0;_0x238faa<_0x2ec1d9-_0x4c0179;_0x238faa+=0x1){decremetOriginate(_0x563b0a);}}}function loggerGetContactDialer(_0x56a31e,_0x4f9783,_0x5f5c24){return function(_0x145b10){checkContactLowerLimitOriginate(_0x4f9783,_0x5f5c24,0x0);logger[_0xb151('0x9f')](_0x56a31e,util[_0xb151('0x9e')](_0x145b10,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x38e6e6){return function(_0x2d786e){if(isNotNull(_0x2d786e)&&isNotNull(_0x2d786e[0x0])){if(_0x2d786e[0x0][_0xb151('0xa4')]>0x0){_0x38e6e6[_0xb151('0x48')]='RESCHEDULED_CONTACTS';logger['info']('[getContactDialer2][ReScheduled]'+_0x38e6e6['name'],_0x2d786e[0x0][_0xb151('0xa4')],_0xb151('0xa5'));}else{_0x38e6e6[_0xb151('0x48')]=_0xb151('0xa6');logger[_0xb151('0x87')](_0xb151('0xa7')+_0x38e6e6[_0xb151('0x44')]);}}};}function notSendMessagesQueue(_0x3ccc70){if(_0x3ccc70[_0xb151('0xa8')]){freeVariablesPredictive(_0x3ccc70);if(_0x3ccc70[_0xb151('0xa1')]===0x0&&_0x3ccc70['talking']===0x0&&_0x3ccc70[_0xb151('0x61')]===0x0&&(_0x3ccc70['pTalking']||0x0)===0x0){_0x3ccc70[_0xb151('0xa8')]=![];_0x3ccc70['available']=0x0;_0x3ccc70[_0xb151('0x48')]='NOT_ACTIVE';loggerSyncQueueSummary['debug'](_0xb151('0xa9'),_0x3ccc70[_0xb151('0x44')],'is\x20not\x20active');}else{_0x3ccc70[_0xb151('0x48')]=_0xb151('0xaa');loggerSyncQueueSummary[_0xb151('0xab')](_0xb151('0xa9'),_0x3ccc70[_0xb151('0x44')],'is\x20disactive');}emitVoiceQueueSummary(_0x3ccc70);}}function notSendMessagesCampaign(_0x484d30){if(_0x484d30['sendMessageOneNotActive']){if(_0x484d30[_0xb151('0xa1')]===0x0){_0x484d30['sendMessageOneNotActive']=![];_0x484d30['message']=_0xb151('0x46');loggerSyncQueueSummary['debug'](_0xb151('0xac'),_0x484d30[_0xb151('0x44')],_0xb151('0xad'));}else{_0x484d30[_0xb151('0x48')]=_0xb151('0xaa');loggerSyncQueueSummary['debug']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x484d30[_0xb151('0x44')],_0xb151('0xae'));}emitCampaignSummary(_0x484d30);}}function createObjHistory(_0x59cefe,_0x1c9165,_0x4f4dcc,_0x3cd8cb,_0xfc2254){_0x59cefe[_0xb151('0x48')]=_0x4f4dcc;var _0xb4b9c2=new Action(_0x59cefe,_0x1c9165);var _0x316cff=new History(_0xb4b9c2);_0x316cff[_0xb151('0xaf')]=_0x3cd8cb;_0x316cff[_0xb151('0xb0')]=_0xfc2254;_0x316cff[_0xb151('0xb1')]=_0xb4b9c2[_0xb151('0xb2')];return _0x316cff;}Dialer[_0xb151('0x1a')]['loopClearZombieChannels']=function(){var _0xd4ff2c=this;setInterval(function(){_0xd4ff2c[_0xb151('0xb3')](_0xd4ff2c[_0xb151('0x25')],_0xb151('0xb4'));_0xd4ff2c[_0xb151('0xb3')](_0xd4ff2c[_0xb151('0x23')],_0xb151('0xb5'));},0x32c8);};Dialer['prototype']['clearZombieChannels']=function(_0x5622b7,_0x4ff1fa){var _0x45bcd1=this;for(var _0x19bd5c in _0x5622b7){if(typeof _0x5622b7[_0x19bd5c]!==_0xb151('0xa2')){this[_0xb151('0xb6')][_0xb151('0xb7')](function(){if(!_['isNil'](_0x5622b7[_0x19bd5c])){return ami[_0xb151('0xb8')]({'action':_0xb151('0xb9'),'channel':_0x5622b7[_0x19bd5c][_0xb151('0xba')]})[_0xb151('0xbb')](function(_0x37faed){if(_0x37faed['message']===_0xb151('0xbc')){setTimeout(function(){if(_0x5622b7[_0x19bd5c]&&_0x5622b7[_0x19bd5c][_0xb151('0x54')]!==_0xb151('0x86')){_0x45bcd1[_0xb151('0xbd')](_0x45bcd1[_0xb151('0x1d')][_0x5622b7[_0x19bd5c]['queue']]);logger['error'](_0xb151('0xbe'),_0x4ff1fa,_0x19bd5c,_0x5622b7[_0x19bd5c]['queue']);delete _0x5622b7[_0x19bd5c];}if(_0x5622b7[_0x19bd5c]&&_0x5622b7[_0x19bd5c]['type']===_0xb151('0x86')){_0x45bcd1[_0xb151('0xbd')](_0x45bcd1[_0xb151('0x1e')][_0x5622b7[_0x19bd5c][_0xb151('0xbf')]]);logger[_0xb151('0x9f')](_0xb151('0xc0'),_0x4ff1fa,_0x19bd5c,_0x5622b7[_0x19bd5c]['queue']);delete _0x5622b7[_0x19bd5c];}},0x2328);}});}});}}};Dialer[_0xb151('0x1a')]['countReScheduled']=function(_0x55ebfc){return BPromise['resolve']()[_0xb151('0x40')](cmHopper[_0xb151('0xc1')](_0x55ebfc))['catch'](loggerCatch(_0xb151('0xc2')));};Dialer['prototype'][_0xb151('0xc3')]=function(_0x214189){return BPromise[_0xb151('0xc4')]()[_0xb151('0x40')](cmHopperBlack['checkIsBlackList'](_0x214189))[_0xb151('0xbb')](loggerCatch(_0xb151('0xc5')));};Dialer['prototype'][_0xb151('0xc6')]=function(_0x563673,_0xc6bbb4,_0x2d027c){return BPromise[_0xb151('0xc4')]()[_0xb151('0x40')](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x563673,_0xc6bbb4,_0x2d027c))[_0xb151('0xbb')](loggerCatch(_0xb151('0xc7')));};Dialer[_0xb151('0x1a')][_0xb151('0xc8')]=function(_0x404eb9,_0x2d9815,_0x51951d){return BPromise[_0xb151('0xc4')]()[_0xb151('0x40')](cmHopperAdditionalPhone[_0xb151('0xc8')](_0x404eb9,_0x2d9815,_0x51951d))['catch'](loggerCatch(_0xb151('0xc9')));};Dialer[_0xb151('0x1a')][_0xb151('0xca')]=function(_0x24b431){return BPromise[_0xb151('0xc4')]()['then'](cmHopperBlack[_0xb151('0xca')](_0x24b431))[_0xb151('0xbb')](loggerCatch(_0xb151('0xcb')));};Dialer[_0xb151('0x1a')][_0xb151('0xcc')]=function(_0x1b85ff){return BPromise[_0xb151('0xc4')]()[_0xb151('0x40')](cmHopperHistory[_0xb151('0xcd')](_0x1b85ff))['catch'](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xb151('0x1a')][_0xb151('0xce')]=function(_0x579778){return BPromise['resolve']()[_0xb151('0x40')](cmHopper['rescheduleContact'](_0x579778))[_0xb151('0xbb')](loggerCatch(_0xb151('0xcf')));};Dialer['prototype'][_0xb151('0xd0')]=function(_0x3fa531,_0x558630,_0x57e182){return BPromise[_0xb151('0xc4')]()[_0xb151('0x40')](cmHopper[_0xb151('0xd0')](_0x3fa531,_0x558630,_0x57e182))[_0xb151('0xbb')](loggerCatch(_0xb151('0xd1')));};Dialer['prototype'][_0xb151('0xd2')]=function(_0x20d2b1,_0x1e547d,_0x88bb14,_0xdbc86f,_0x119fcf){return BPromise[_0xb151('0xc4')]()[_0xb151('0x40')](cmHopper[_0xb151('0xd2')](_0x20d2b1,_0x1e547d,_0x88bb14,_0xdbc86f))[_0xb151('0xbb')](function(_0x22c360){_0x119fcf['temp']-=_0x88bb14;_0x119fcf[_0xb151('0xd3')]=_0x119fcf[_0xb151('0xd3')]>0x0?_0x119fcf[_0xb151('0xd3')]:0x0;loggerCatch(_0xb151('0xd4'))(_0x22c360);});};Dialer[_0xb151('0x1a')][_0xb151('0xd5')]=function(_0x197f3d,_0x5d87da,_0x4dcbf2,_0x4bfbd7){return BPromise[_0xb151('0xc4')]()[_0xb151('0x40')](cmHopper[_0xb151('0xd5')](_0x197f3d,_0x5d87da,_0x4dcbf2))[_0xb151('0xbb')](function(_0x426efc){_0x4bfbd7[_0xb151('0xd3')]-=_0x5d87da;_0x4bfbd7['temp']=_0x4bfbd7[_0xb151('0xd3')]>0x0?_0x4bfbd7['temp']:0x0;loggerCatch(_0xb151('0xd6'))(_0x426efc);});};Dialer[_0xb151('0x1a')][_0xb151('0xd7')]=function(_0x9fb88f){return BPromise['resolve']()['then'](voiceQueueRt[_0xb151('0xd7')](_0x9fb88f))[_0xb151('0xbb')](loggerCatch(_0xb151('0xd8')));};Dialer[_0xb151('0x1a')][_0xb151('0xd9')]=function(_0x3cfdd5){return BPromise[_0xb151('0xc4')]()[_0xb151('0x40')](cmHopper[_0xb151('0xd9')](_0x3cfdd5))[_0xb151('0xbb')](loggerCatch(_0xb151('0xda')));};Dialer[_0xb151('0x1a')][_0xb151('0xdb')]=function(_0x15f3b6){return BPromise[_0xb151('0xc4')]()[_0xb151('0x40')](cmHopperHistory[_0xb151('0xdb')](_0x15f3b6))[_0xb151('0xbb')](loggerCatch(_0xb151('0xdc')));};Dialer[_0xb151('0x1a')][_0xb151('0xbd')]=function(_0x122448){if(!_['isUndefined'](_0x122448)&&_0x122448!==null){if(typeof _0x122448[_0xb151('0xa1')]!==_0xb151('0xa2')){if(_0x122448[_0xb151('0xa1')]>0x0){_0x122448[_0xb151('0xa1')]-=0x1;}else{logger[_0xb151('0x9f')](_0xb151('0xdd'));}}}else{logger['error'](_0xb151('0xde'));}};Dialer[_0xb151('0x1a')][_0xb151('0xdf')]=function(_0x3df0f1,_0x143afa){var _0x5e4527=this;return function(_0x5c643d){_0x5e4527[_0xb151('0xbd')](_0x143afa);logger['error'](_0x3df0f1,util[_0xb151('0x9e')](_0x5c643d,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xb151('0xe0')]=function(_0x2411a9,_0x1d222e,_0x412946){var _0x124f72={'state':0x19,'statedesc':_0xb151('0xe1')};this[_0xb151('0xbd')](_0x1d222e);this[_0xb151('0xe2')](_[_0xb151('0xe3')](_0x124f72,_['pick'](_0x412946,[_0xb151('0xe4'),_0xb151('0xe5'),'UserId',_0xb151('0xe6'),_0xb151('0xe7')])),_0xb151('0xe8'),_0xb151('0xe9'));logger[_0xb151('0x9f')](_0x2411a9);};Dialer[_0xb151('0x1a')][_0xb151('0xea')]=function(_0x558fe9){return _0x558fe9===_0xb151('0xeb');};Dialer[_0xb151('0x1a')]['isTrunkReachable']=function(_0x441dd0){return!_['isUndefined'](_0x441dd0)&&_0x441dd0&&!_['isUndefined'](_0x441dd0['name'])&&!_[_0xb151('0x42')](_0x441dd0[_0xb151('0xec')])&&_0x441dd0[_0xb151('0xec')]&&(this[_0xb151('0x20')][util['format'](_0xb151('0xed'),_0x441dd0[_0xb151('0x44')])][_0xb151('0xb9')]==='reachable'||this[_0xb151('0x20')][util[_0xb151('0x84')]('SIP/%s',_0x441dd0[_0xb151('0x44')])][_0xb151('0xb9')]===_0xb151('0xee'));};Dialer['prototype'][_0xb151('0xe2')]=function(_0x23aa17,_0x3a5ed5,_0x1a1002){this[_0xb151('0xdb')](_0x23aa17)[_0xb151('0xbb')](loggerCatch(_0x3a5ed5));this[_0xb151('0xd9')](_0x23aa17)[_0xb151('0xbb')](loggerCatch(_0x1a1002));};Dialer['prototype']['syncVarSet']=function(_0x410870){var _0x3c4cf2=this[_0xb151('0x25')][_0x410870['uniqueid']];var _0x2caf3a;if(!_[_0xb151('0xef')](_0x410870)&&!_[_0xb151('0xef')](_0x410870[_0xb151('0xf0')])&&!_['isNil'](_0x410870[_0xb151('0xf0')]['amdstatus'])&&_0x410870['exten']===_0xb151('0xf1')&&_0x3c4cf2){if(_0x3c4cf2[_0xb151('0x54')]!=='ivr'&&this[_0xb151('0x1d')][_0x3c4cf2['queue']][_0xb151('0xf2')]&&_0x410870[_0xb151('0xf3')]==='HANGUP'){delete this[_0xb151('0x25')][_0x410870[_0xb151('0xf4')]];this[_0xb151('0xbd')](this['voiceQueues'][_0x3c4cf2['queue']]);this[_0xb151('0x1d')][_0x3c4cf2[_0xb151('0xbf')]][_0xb151('0xf5')]+=0x1;this['voiceQueues'][_0x3c4cf2[_0xb151('0xbf')]][_0xb151('0x69')]+=0x1;_0x2caf3a=new Hangup(_0x3c4cf2,_0x410870);_0x2caf3a[_0xb151('0xaf')]=0x12;_0x2caf3a[_0xb151('0xb0')]=_0xb151('0xf6');_0x2caf3a[_0xb151('0xf7')]=_0xb151('0xf8');ami[_0xb151('0x53')]('custom:amd',ut[_0xb151('0xf9')](_0x2caf3a,'amd'));this[_0xb151('0xe2')](_0x2caf3a,'[syncHangupInAMD][createHistory]',_0xb151('0xfa'));}if(_0x3c4cf2[_0xb151('0x54')]!=='ivr'&&this[_0xb151('0x1d')][_0x3c4cf2['queue']][_0xb151('0xf2')]&&_0x410870[_0xb151('0xf3')]===_0xb151('0xfb')){var _0x52ef0c=this;return new BPromise(function(_0x301fbc,_0x1206e1){delete _0x52ef0c[_0xb151('0x25')][_0x410870[_0xb151('0xf4')]];_0x52ef0c['updateOriginated'](_0x52ef0c[_0xb151('0x1d')][_0x3c4cf2[_0xb151('0xbf')]]);_0x52ef0c[_0xb151('0x1d')][_0x3c4cf2[_0xb151('0xbf')]][_0xb151('0xf5')]+=0x1;_0x52ef0c[_0xb151('0x1d')][_0x3c4cf2[_0xb151('0xbf')]][_0xb151('0x69')]+=0x1;var _0x503b8c=_0x52ef0c[_0xb151('0x1d')][_0x3c4cf2[_0xb151('0xbf')]];var _0x18f8b9=new Hangup(_0x3c4cf2,_0x410870);_0x18f8b9[_0xb151('0xaf')]=0x13;_0x18f8b9[_0xb151('0xb0')]=_0xb151('0xfc');_0x18f8b9[_0xb151('0xf7')]='AMD';_0x18f8b9['countmachineretry']+=0x1;_0x18f8b9[_0xb151('0xfd')]+=0x1;_0x18f8b9[_0xb151('0xfe')]=!![];ami[_0xb151('0x53')](_0xb151('0xff'),ut['buildObj'](_0x18f8b9,_0xb151('0xfe')));_0x52ef0c[_0xb151('0xdb')](_0x18f8b9)[_0xb151('0xbb')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x18f8b9['countbusyretry']+_0x18f8b9[_0xb151('0x100')]+_0x18f8b9[_0xb151('0x101')]+_0x18f8b9[_0xb151('0x102')]+_0x18f8b9['countdropretry']+_0x18f8b9[_0xb151('0x103')]+_0x18f8b9['countmachineretry']+_0x18f8b9['countagentrejectretry']>=_0x503b8c[_0xb151('0x104')]){_0x52ef0c['stateGlobal'](_0x18f8b9,_0x301fbc,_0x1206e1,'reason19\x20machine....');}else{if(_0x18f8b9[_0xb151('0x105')]>=_0x503b8c[_0xb151('0x106')]){_0x52ef0c['createStateFinal'](_0x18f8b9,_0x301fbc,_0x1206e1,_0xb151('0x107'));}else{_0x52ef0c[_0xb151('0xce')]({'active':![],'countmachineretry':_0x18f8b9[_0xb151('0x105')],'scheduledat':moment()['add'](_0x503b8c[_0xb151('0x108')],_0xb151('0x109'))[_0xb151('0x84')](_0xb151('0x10a')),'ContactId':_0x18f8b9[_0xb151('0xe4')],'ListId':_0x18f8b9['ListId'],'VoiceQueueId':_0x18f8b9[_0xb151('0xe6')]||undefined,'CampaignId':_0x18f8b9[_0xb151('0xe7')]||undefined})[_0xb151('0xbb')](loggerCatch(_0xb151('0x10b')));_0x301fbc({'reschedule':0x1});}}});}if(_0x3c4cf2[_0xb151('0x54')]===_0xb151('0x86')&&this['campaigns'][_0x3c4cf2[_0xb151('0xbf')]][_0xb151('0xf2')]&&_0x410870[_0xb151('0xf3')]==='HANGUP'){delete this[_0xb151('0x25')][_0x410870[_0xb151('0xf4')]];this[_0xb151('0xbd')](this[_0xb151('0x1e')][_0x3c4cf2[_0xb151('0xbf')]]);_0x2caf3a=new Hangup(_0x3c4cf2,_0x410870);_0x2caf3a[_0xb151('0xaf')]=0x12;_0x2caf3a[_0xb151('0xb0')]=_0xb151('0xf6');_0x2caf3a[_0xb151('0xf7')]=_0xb151('0xf8');ami[_0xb151('0x53')](_0xb151('0xff'),ut['buildObj'](_0x2caf3a,_0xb151('0xfe')));this[_0xb151('0xe2')](_0x2caf3a,_0xb151('0x10c'),_0xb151('0x10d'));}if(_0x3c4cf2[_0xb151('0x54')]===_0xb151('0x86')&&this[_0xb151('0x1e')][_0x3c4cf2['queue']][_0xb151('0xf2')]&&_0x410870[_0xb151('0xf3')]===_0xb151('0xfb')){var _0x52ef0c=this;return new BPromise(function(_0x3cc2c2,_0x257731){delete _0x52ef0c[_0xb151('0x25')][_0x410870[_0xb151('0xf4')]];_0x52ef0c['updateOriginated'](_0x52ef0c['campaigns'][_0x3c4cf2['queue']]);_0x52ef0c[_0xb151('0x1e')][_0x3c4cf2[_0xb151('0xbf')]]['outboundAnswerCallsDay']+=0x1;_0x52ef0c[_0xb151('0x1e')][_0x3c4cf2[_0xb151('0xbf')]][_0xb151('0x69')]+=0x1;var _0x798658=_0x52ef0c[_0xb151('0x1e')][_0x3c4cf2['queue']];var _0x4218f1=new Hangup(_0x3c4cf2,_0x410870);_0x4218f1['state']=0x13;_0x4218f1[_0xb151('0xb0')]=_0xb151('0xfc');_0x4218f1[_0xb151('0xf7')]=_0xb151('0xf8');_0x4218f1['countmachineretry']+=0x1;_0x4218f1[_0xb151('0xfd')]+=0x1;_0x4218f1['amd']=!![];ami[_0xb151('0x53')]('custom:amd',ut[_0xb151('0xf9')](_0x4218f1,_0xb151('0xfe')));_0x52ef0c[_0xb151('0xdb')](_0x4218f1)[_0xb151('0xbb')](loggerCatch(_0xb151('0x10e')));if(_0x4218f1[_0xb151('0x10f')]+_0x4218f1[_0xb151('0x100')]+_0x4218f1['countnoanswerretry']+_0x4218f1[_0xb151('0x102')]+_0x4218f1['countdropretry']+_0x4218f1[_0xb151('0x103')]+_0x4218f1[_0xb151('0x105')]+_0x4218f1[_0xb151('0x110')]>=_0x798658[_0xb151('0x104')]){_0x52ef0c[_0xb151('0x111')](_0x4218f1,_0x3cc2c2,_0x257731,_0xb151('0x112'));}else{if(_0x4218f1[_0xb151('0x105')]>=_0x798658[_0xb151('0x106')]){_0x52ef0c[_0xb151('0x113')](_0x4218f1,_0x3cc2c2,_0x257731,_0xb151('0x107'));}else{_0x52ef0c['rescheduleContact']({'active':![],'countmachineretry':_0x4218f1[_0xb151('0x105')],'scheduledat':moment()[_0xb151('0x114')](_0x798658['dialMachineRetryFrequency'],'minutes')[_0xb151('0x84')](_0xb151('0x10a')),'ContactId':_0x4218f1[_0xb151('0xe4')],'ListId':_0x4218f1['ListId'],'VoiceQueueId':_0x4218f1[_0xb151('0xe6')]||undefined,'CampaignId':_0x4218f1[_0xb151('0xe7')]||undefined})[_0xb151('0xbb')](loggerCatch(_0xb151('0x10b')));_0x3cc2c2({'reschedule':0x1});}}});}}};Dialer[_0xb151('0x1a')][_0xb151('0x115')]=function(_0x5c8547){var _0x51cd8a=this[_0xb151('0x25')][_0x5c8547['uniqueid']];var _0x33ac46=this;var _0x161211;if(_0x51cd8a&&_0x51cd8a[_0xb151('0x54')]===_0xb151('0x86')){delete this[_0xb151('0x25')][_0x5c8547['uniqueid']];this[_0xb151('0xbd')](this[_0xb151('0x1e')][_0x51cd8a[_0xb151('0xbf')]]);this[_0xb151('0x1e')][_0x51cd8a[_0xb151('0xbf')]][_0xb151('0x116')]+=0x1;_0x161211=new Hangup(_0x51cd8a,_0x5c8547);this[_0xb151('0xdb')](_0x161211)[_0xb151('0xbb')](loggerCatch(_0xb151('0x117')));this[_0xb151('0xd9')](_0x161211)['catch'](loggerCatch(_0xb151('0x118')));}if(_0x51cd8a&&_0x51cd8a[_0xb151('0x54')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x51cd8a[_0xb151('0xbf')]][_0xb151('0x119')])){delete this['uniqueId'][_0x5c8547[_0xb151('0xf4')]];this[_0xb151('0xbd')](this[_0xb151('0x1d')][_0x51cd8a['queue']]);this[_0xb151('0x1d')][_0x51cd8a[_0xb151('0xbf')]][_0xb151('0xf5')]+=0x1;this[_0xb151('0x1d')][_0x51cd8a['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x161211=new Hangup(_0x51cd8a,_0x5c8547);_0x161211[_0xb151('0xaf')]=0x10;_0x161211[_0xb151('0xb0')]=_0xb151('0x11a');_0x161211[_0xb151('0xf7')]=_0xb151('0x11b');this['createHistory'](_0x161211)[_0xb151('0xbb')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x161211)['catch'](loggerCatch(_0xb151('0x118')));}if(_0x51cd8a&&_0x51cd8a[_0xb151('0x54')]!=='ivr'&&!isNotNull(this['voiceQueues'][_0x51cd8a[_0xb151('0xbf')]][_0xb151('0x119')])){delete this['uniqueId'][_0x5c8547[_0xb151('0xf4')]];this['updateOriginated'](this[_0xb151('0x1d')][_0x51cd8a[_0xb151('0xbf')]]);this[_0xb151('0x1d')][_0x51cd8a[_0xb151('0xbf')]]['outboundUnknownCallsDay']+=0x1;_0x161211=new Hangup(_0x51cd8a,_0x5c8547);_0x161211[_0xb151('0xaf')]=0xc;_0x161211[_0xb151('0xb0')]=_0x5c8547[_0xb151('0x11c')];_0x161211[_0xb151('0xf7')]='Unknow';this['createHistory'](_0x161211)[_0xb151('0xbb')](loggerCatch(_0xb151('0x117')));this[_0xb151('0xd9')](_0x161211)['catch'](loggerCatch(_0xb151('0x118')));}};Dialer['prototype'][_0xb151('0x11d')]=function(_0x2c67e7){var _0x1d9db0=this[_0xb151('0x25')][_0x2c67e7[_0xb151('0xf4')]];var _0x60394c=this;if(this[_0xb151('0x1d')][_0x2c67e7[_0xb151('0xbf')]]){if(_0x1d9db0&&_0x1d9db0[_0xb151('0x54')]!==_0xb151('0x86')){delete this[_0xb151('0x25')][_0x2c67e7[_0xb151('0xf4')]];this['voiceQueues'][_0x2c67e7['queue']]['outboundAnswerCallsDay']+=0x1;var _0x5caed2=new AgentComplete(_0x1d9db0,_0x2c67e7);if(_0x2c67e7[_0xb151('0x11e')]===_0xb151('0x11f')){_0x5caed2[_0xb151('0x120')]=this[_0xb151('0x1d')][_0x2c67e7['queue']]['dialQueueProject2']&&this[_0xb151('0x1d')][_0x2c67e7[_0xb151('0xbf')]][_0xb151('0x121')]?moment()[_0xb151('0x84')](_0xb151('0x10a')):undefined;}this['createHistory'](_0x5caed2)[_0xb151('0xbb')](loggerCatch(_0xb151('0x122')));this[_0xb151('0xd9')](_0x5caed2)[_0xb151('0xbb')](loggerCatch(_0xb151('0x123')));}}};Dialer['prototype']['syncAgentConnect']=function(_0xbcc4e6){if(this[_0xb151('0x1d')][_0xbcc4e6[_0xb151('0xbf')]]){if(this[_0xb151('0x25')][_0xbcc4e6['uniqueid']]&&this['uniqueId'][_0xbcc4e6[_0xb151('0xf4')]][_0xb151('0x54')]!==_0xb151('0x86')){this[_0xb151('0xbd')](this[_0xb151('0x1d')][_0xbcc4e6[_0xb151('0xbf')]]);this[_0xb151('0x25')][_0xbcc4e6['uniqueid']][_0xb151('0x124')]=moment()[_0xb151('0x84')](_0xb151('0x10a'));}}};Dialer[_0xb151('0x1a')][_0xb151('0x125')]=function(_0x4bc145,_0x3a9a6f){this[_0xb151('0xdb')](_0x4bc145)[_0xb151('0xbb')](loggerCatch(_0xb151('0x122')));if(_0x3a9a6f==0x0){this[_0xb151('0xd9')](_0x4bc145)[_0xb151('0xbb')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer['prototype'][_0xb151('0x2f')]=function(_0x22f79d){var _0x55e556=this[_0xb151('0x25')][_0x22f79d[_0xb151('0xf4')]];var _0x562dc1=this;var _0xf49d8c=![];var _0x126032;var _0x4689be;if(this[_0xb151('0x1d')][_0x22f79d[_0xb151('0xbf')]]){if(_0x55e556&&_0x55e556[_0xb151('0x54')]!==_0xb151('0x86')){delete this['uniqueId'][_0x22f79d['uniqueid']];this[_0xb151('0xbd')](this[_0xb151('0x1d')][_0x22f79d[_0xb151('0xbf')]]);_0x55e556[_0xb151('0x126')]=moment()[_0xb151('0x84')](_0xb151('0x10a'));var _0x743fb4=new QueueCallerAbandon(_0x55e556,_0x22f79d);if(getSeconds(_0x55e556[_0xb151('0x126')],_0x55e556[_0xb151('0x127')])>=_0x55e556[_0xb151('0x128')]){this[_0xb151('0x1d')][_0x22f79d[_0xb151('0xbf')]][_0xb151('0x79')]+=0x1;this[_0xb151('0x1d')][_0x22f79d[_0xb151('0xbf')]][_0xb151('0x6f')]+=0x1;this[_0xb151('0x1d')][_0x22f79d[_0xb151('0xbf')]][_0xb151('0x7a')]+=0x1;_0x743fb4[_0xb151('0xaf')]=0xa;_0x743fb4[_0xb151('0xb0')]='Drop';_0x743fb4[_0xb151('0x129')]='TIMEOUT';_0x743fb4['agiafterat']=this[_0xb151('0x1d')][_0x22f79d[_0xb151('0xbf')]][_0xb151('0x12a')]?moment()['format'](_0xb151('0x10a')):undefined;_0x743fb4[_0xb151('0x12b')]+=0x1;_0x743fb4[_0xb151('0xfd')]+=0x1;_0x126032=this['voiceQueues'][_0x22f79d[_0xb151('0xbf')]][_0xb151('0x12c')];_0x4689be=this[_0xb151('0x1d')][_0x22f79d[_0xb151('0xbf')]]['callAdditionalPhoneAfterMin'];_0x562dc1[_0xb151('0xc6')](_0x743fb4,_0x743fb4[_0xb151('0xaf')],_0x55e556['voiceQueue'])[_0xb151('0x40')](function(_0xa6944f){_0xf49d8c=_0xa6944f[_0xb151('0x12d')]==0x1;if(_0x743fb4[_0xb151('0x12b')]>=_0x562dc1[_0xb151('0x1d')][_0x22f79d['queue']][_0xb151('0x12e')]){_0x562dc1[_0xb151('0x125')](_0x743fb4,_0xa6944f[_0xb151('0x12d')]);}else{_0x562dc1['rescheduleContact']({'active':![],'countdropretry':_0x743fb4[_0xb151('0x12b')],'scheduledat':moment()[_0xb151('0x114')](_0x562dc1['voiceQueues'][_0x22f79d[_0xb151('0xbf')]]['dialDropRetryFrequency'],_0xb151('0x109'))[_0xb151('0x84')](_0xb151('0x10a')),'ContactId':_0x55e556['ContactId'],'ListId':_0x55e556[_0xb151('0xe5')],'VoiceQueueId':_0x55e556[_0xb151('0xe6')]||undefined,'CampaignId':_0x55e556[_0xb151('0xe7')]||undefined})[_0xb151('0xbb')](loggerCatch(_0xb151('0x12f')));var _0x58f61d=new History(_0x743fb4);_0x58f61d[_0xb151('0xaf')]=0xa;_0x58f61d[_0xb151('0xb0')]=_0xb151('0x130');_0x58f61d[_0xb151('0xb2')]=moment()[_0xb151('0x84')](_0xb151('0x10a'));_0x58f61d[_0xb151('0xb1')]=_0x58f61d[_0xb151('0xb2')];_0x58f61d['calleridname']=_0x743fb4[_0xb151('0x131')];_0x58f61d[_0xb151('0x132')]=_0x743fb4[_0xb151('0x132')];_0x562dc1['createHistory'](_0x58f61d)[_0xb151('0xbb')](loggerCatch(_0xb151('0x133')));}})[_0xb151('0x40')](function(_0x2a22ee){if(_0xf49d8c)_0x562dc1[_0xb151('0xc8')](_0x743fb4,_0x126032,_0x4689be)[_0xb151('0x40')](function(_0x477253){return 0x1;});});}else{this[_0xb151('0x1d')][_0x22f79d[_0xb151('0xbf')]][_0xb151('0x78')]+=0x1;this[_0xb151('0x1d')][_0x22f79d[_0xb151('0xbf')]][_0xb151('0x6e')]+=0x1;_0x743fb4[_0xb151('0xaf')]=0xb;_0x743fb4[_0xb151('0xb0')]=_0xb151('0x134');_0x743fb4[_0xb151('0x129')]=_0xb151('0x135');_0x743fb4[_0xb151('0x103')]+=0x1;_0x743fb4[_0xb151('0xfd')]+=0x1;_0x126032=this['voiceQueues'][_0x22f79d[_0xb151('0xbf')]][_0xb151('0x136')];_0x4689be=this['voiceQueues'][_0x22f79d[_0xb151('0xbf')]]['callAdditionalPhoneAfterMin'];_0x562dc1['verifyAdditionalPhones'](_0x743fb4,_0x743fb4[_0xb151('0xaf')],_0x55e556[_0xb151('0x137')])['then'](function(_0xd422d0){if(_0x743fb4[_0xb151('0x103')]>=_0x562dc1[_0xb151('0x1d')][_0x22f79d[_0xb151('0xbf')]]['dialAbandonedMaxRetry']){_0x562dc1[_0xb151('0x125')](_0x743fb4,_0xd422d0['additional']);}else{_0x562dc1['rescheduleContact']({'active':![],'countabandonedretry':_0x743fb4[_0xb151('0x103')],'scheduledat':moment()[_0xb151('0x114')](_0x562dc1[_0xb151('0x1d')][_0x22f79d[_0xb151('0xbf')]][_0xb151('0x136')],_0xb151('0x109'))[_0xb151('0x84')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x55e556[_0xb151('0xe4')],'ListId':_0x55e556[_0xb151('0xe5')],'VoiceQueueId':_0x55e556['VoiceQueueId']||undefined,'CampaignId':_0x55e556['CampaignId']||undefined})[_0xb151('0xbb')](loggerCatch(_0xb151('0x138')));var _0x2e98bb=new History(_0x743fb4);_0x2e98bb[_0xb151('0xaf')]=0xb;_0x2e98bb['statedesc']=_0xb151('0x134');_0x2e98bb['starttime']=moment()[_0xb151('0x84')]('YYYY-MM-DD\x20HH:mm:ss');_0x2e98bb['endtime']=_0x2e98bb[_0xb151('0xb2')];_0x2e98bb[_0xb151('0x131')]=_0x743fb4[_0xb151('0x131')];_0x2e98bb['calleridnum']=_0x743fb4['calleridnum'];_0x562dc1['createHistory'](_0x2e98bb)[_0xb151('0xbb')](loggerCatch(_0xb151('0x139')));}})[_0xb151('0x40')](function(_0x1e3214){if(_0xf49d8c)_0x562dc1[_0xb151('0xc8')](_0x743fb4,_0x126032,_0x4689be)[_0xb151('0x40')](function(_0x21e091){return 0x1;});});}}}};Dialer[_0xb151('0x1a')][_0xb151('0x38')]=function(_0x314bcc){if(this['actions'][_0x314bcc['uniqueid']]){this['actions'][_0x314bcc[_0xb151('0xf4')]][_0xb151('0xba')]=_0x314bcc[_0xb151('0xba')];}if(this['uniqueId'][_0x314bcc[_0xb151('0xf4')]]){this['uniqueId'][_0x314bcc[_0xb151('0xf4')]]['channel']=_0x314bcc[_0xb151('0xba')];}};Dialer[_0xb151('0x1a')][_0xb151('0x3b')]=function(_0x83769c){if(strategy[this[_0xb151('0x1d')][this[_0xb151('0x23')][_0x83769c[_0xb151('0x13a')]][_0xb151('0xbf')]][_0xb151('0x55')]]===_0xb151('0x19')){if(this[_0xb151('0x23')][_0x83769c[_0xb151('0x13a')]]&&_[_0xb151('0xef')](this[_0xb151('0x23')][_0x83769c['actionid']][_0xb151('0x13b')])&&_0x83769c['status']==='1'&&_0x83769c[_0xb151('0x13c')]==='0'){if(this['agents'][_0x83769c[_0xb151('0x13d')]]){if(!this['agents'][_0x83769c[_0xb151('0x13d')]]['locked']){this['agents'][_0x83769c[_0xb151('0x13d')]][_0xb151('0x13b')]=!![];this[_0xb151('0x23')][_0x83769c[_0xb151('0x13a')]][_0xb151('0x13b')]=!![];this[_0xb151('0x23')][_0x83769c['actionid']]['stateinterface']=_0x83769c[_0xb151('0x13d')];}}}}else if((strategy[this['voiceQueues'][this[_0xb151('0x23')][_0x83769c[_0xb151('0x13a')]][_0xb151('0xbf')]][_0xb151('0x55')]]||_0xb151('0x18'))===_0xb151('0x18')){if(this['actions'][_0x83769c[_0xb151('0x13a')]]){if(this[_0xb151('0x1f')][_0x83769c['stateinterface']]){this['actions'][_0x83769c[_0xb151('0x13a')]]['stateinterface']=_0x83769c[_0xb151('0x13d')];if(_[_0xb151('0xef')](this[_0xb151('0x2a')][this[_0xb151('0x23')][_0x83769c['actionid']]['queue']])){this[_0xb151('0x2a')][this[_0xb151('0x23')][_0x83769c[_0xb151('0x13a')]][_0xb151('0xbf')]]=[];}this[_0xb151('0x2a')][this[_0xb151('0x23')][_0x83769c[_0xb151('0x13a')]][_0xb151('0xbf')]][_0xb151('0x13e')](_[_0xb151('0xe3')](_[_0xb151('0x13f')](this[_0xb151('0x23')][_0x83769c[_0xb151('0x13a')]],[_0xb151('0x140'),_0xb151('0x13d')]),{'status':_0x83769c[_0xb151('0xb9')],'paused':_0x83769c[_0xb151('0x13c')]}));}}}};function unlockQueueStatus(_0x563ef5,_0x2839d0){setTimeout(function(){if(_['isUndefined'](_0x563ef5[_0xb151('0x141')])){loggerBooked[_0xb151('0x9f')](_0xb151('0x142'),_0x2839d0);}_0x563ef5['queueStatusComplete']=!![];loggerBooked['info'](_0xb151('0x143'),_0x2839d0,JSON[_0xb151('0x50')](_[_0xb151('0x13f')](_0x563ef5,['name',_0xb151('0x141')])));},0x1f3);}Dialer[_0xb151('0x1a')][_0xb151('0x3d')]=function(_0x2c0e78){var _0x53c000=this;var _0x54e4d4=_0x53c000[_0xb151('0x1d')][_0x53c000[_0xb151('0x23')][_0x2c0e78['actionid']][_0xb151('0xbf')]];if(strategy[this['voiceQueues'][this[_0xb151('0x23')][_0x2c0e78['actionid']][_0xb151('0xbf')]]['strategy']]===_0xb151('0x19')){if(this['actions'][_0x2c0e78[_0xb151('0x13a')]]&&this[_0xb151('0x23')][_0x2c0e78['actionid']][_0xb151('0x13d')]){this[_0xb151('0x1c')][_0xb151('0x144')](this['actions'][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0x140')],this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0x13d')])[_0xb151('0xbb')](function(_0x2b7776){logger[_0xb151('0x9f')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xb151('0x9e')](_0x2b7776,{'showHidden':![],'depth':null}));})[_0xb151('0x145')](function(){_0x53c000[_0xb151('0xbd')](_0x53c000[_0xb151('0x1d')][_0x53c000[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]]['queue']]);_0x53c000[_0xb151('0x1f')][_0x53c000[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0x13d')]][_0xb151('0x13b')]=![];delete _0x53c000[_0xb151('0x23')][_0x2c0e78['actionid']];unlockQueueStatus(_0x54e4d4);});}else{this[_0xb151('0xbd')](this[_0xb151('0x1d')][this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0xbf')]]);this[_0xb151('0xce')]({'active':![],'ContactId':this['actions'][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0xe4')],'ListId':this[_0xb151('0x23')][_0x2c0e78['actionid']][_0xb151('0xe5')],'VoiceQueueId':this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0xe7')]||undefined})[_0xb151('0xbb')](loggerCatch(_0xb151('0x146')));delete this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]];unlockQueueStatus(_0x54e4d4);}}else if((strategy[this[_0xb151('0x1d')][this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]]['queue']]['strategy']]||_0xb151('0x18'))==='rrmemory'){var _0x433e20;if(this['actions'][_0x2c0e78['actionid']]&&!_[_0xb151('0x4d')](this[_0xb151('0x2a')][this[_0xb151('0x23')][_0x2c0e78['actionid']][_0xb151('0xbf')]])){if(this[_0xb151('0x2b')][_0x53c000[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0xbf')]]){this['queueBookedRR'][_0x53c000[_0xb151('0x23')][_0x2c0e78['actionid']][_0xb151('0xbf')]]=this['queueBookedRR'][this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0xbf')]]?this[_0xb151('0x2b')][this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0xbf')]]:this[_0xb151('0x2a')][this[_0xb151('0x23')][_0x2c0e78['actionid']][_0xb151('0xbf')]]?this['queueBooked'][this[_0xb151('0x23')][_0x2c0e78['actionid']][_0xb151('0xbf')]][_0xb151('0x147')]||0x0:0x0;}this[_0xb151('0x2a')][this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]]['queue']][_0xb151('0x147')]=this[_0xb151('0x2b')][this['actions'][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0xbf')]];for(var _0x3e0b71=0x0;_0x3e0b71<this[_0xb151('0x2a')][this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0xbf')]][_0xb151('0xa0')];_0x3e0b71+=0x1){_0x433e20=rr(this[_0xb151('0x2a')][this['actions'][_0x2c0e78[_0xb151('0x13a')]]['queue']]);this[_0xb151('0x2b')][_0x53c000[_0xb151('0x23')][_0x2c0e78['actionid']][_0xb151('0xbf')]]=this[_0xb151('0x2a')][this['actions'][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0xbf')]]['_rr'];if(_0x433e20[_0xb151('0xb9')]==='1'&&_0x433e20['paused']==='0'){break;}}if(!_['isNil'](_0x433e20)){this[_0xb151('0x1f')][_0x433e20[_0xb151('0x13d')]]['unlockRR']=_[_0xb151('0x42')](this[_0xb151('0x1f')][_0x433e20['stateinterface']]['unlockRR'])?!![]:this['agents'][_0x433e20['stateinterface']]['unlockRR'];}loggerBooked[_0xb151('0x87')](_0xb151('0x148'),_0x2c0e78[_0xb151('0x13a')],_0xb151('0x149'),JSON['stringify'](_[_0xb151('0x13f')](this[_0xb151('0x1f')][_0x433e20['stateinterface']],['name',_0xb151('0x14a')])),_0xb151('0x14b'),JSON[_0xb151('0x50')](_0x433e20[_0xb151('0x140')]));if(!_[_0xb151('0xef')](_0x433e20)&&_0x433e20[_0xb151('0xb9')]==='1'&&_0x433e20[_0xb151('0x13c')]==='0'&&this[_0xb151('0x1f')][_0x433e20[_0xb151('0x13d')]][_0xb151('0x14a')]){this['agents'][_0x433e20[_0xb151('0x13d')]][_0xb151('0x14a')]=![];this[_0xb151('0x2a')][_0x53c000['actions'][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0xbf')]]=[];this[_0xb151('0x1c')]['run'](_0x433e20['idHopper'],_0x433e20[_0xb151('0x13d')])[_0xb151('0xbb')](function(_0x30b482){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0xb151('0x9e')](_0x30b482,{'showHidden':![],'depth':null}));})[_0xb151('0x145')](function(){_0x53c000[_0xb151('0xbd')](_0x53c000[_0xb151('0x1d')][_0x53c000[_0xb151('0x23')][_0x2c0e78['actionid']][_0xb151('0xbf')]]);setTimeout(function(){_0x53c000[_0xb151('0x1f')][_0x433e20[_0xb151('0x13d')]]['unlockRR']=!![];loggerBooked[_0xb151('0x87')](_0xb151('0x14c'),_0x2c0e78['actionid'],'Agent:\x20',JSON[_0xb151('0x50')](_[_0xb151('0x13f')](_0x53c000['agents'][_0x433e20[_0xb151('0x13d')]],[_0xb151('0x44'),_0xb151('0x14a')])),'contactAgent-idHopper:\x20',JSON[_0xb151('0x50')](_0x433e20['idHopper']));},0xc7);delete _0x53c000[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]];unlockQueueStatus(_0x54e4d4,_0x2c0e78[_0xb151('0x13a')]);});}else{loggerBooked['info']('[booked][unlock]');this[_0xb151('0xbd')](this[_0xb151('0x1d')][this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0xbf')]]);this[_0xb151('0xce')]({'active':![],'ContactId':this['actions'][_0x2c0e78[_0xb151('0x13a')]]['ContactId'],'ListId':this['actions'][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0xe5')],'VoiceQueueId':this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0xe6')]||undefined,'CampaignId':this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]]['CampaignId']||undefined})[_0xb151('0xbb')](loggerCatch(_0xb151('0x146')));delete this['actions'][_0x2c0e78[_0xb151('0x13a')]];unlockQueueStatus(_0x54e4d4);}}else{loggerBooked[_0xb151('0x87')](_0xb151('0x14d'));this['updateOriginated'](this['voiceQueues'][this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0xbf')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0xe4')],'ListId':this[_0xb151('0x23')][_0x2c0e78['actionid']]['ListId'],'VoiceQueueId':this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0xe7')]||undefined})['catch'](loggerCatch(_0xb151('0x14e')));delete this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]];unlockQueueStatus(_0x54e4d4);}}else{loggerBooked['info']('[booked][unlock3]');this[_0xb151('0xbd')](this[_0xb151('0x1d')][this[_0xb151('0x23')][_0x2c0e78['actionid']][_0xb151('0xbf')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0xe4')],'ListId':this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0xe5')],'VoiceQueueId':this[_0xb151('0x23')][_0x2c0e78['actionid']][_0xb151('0xe6')]||undefined,'CampaignId':this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]][_0xb151('0xe7')]||undefined})[_0xb151('0xbb')](loggerCatch(_0xb151('0x14f')));delete this[_0xb151('0x23')][_0x2c0e78[_0xb151('0x13a')]];unlockQueueStatus(_0x54e4d4);}};Dialer[_0xb151('0x1a')][_0xb151('0x3e')]=function(){var _0x4c672a=this;return BPromise[_0xb151('0xc4')]()['then'](cmHopper['resetActiveCalls']({}))[_0xb151('0x40')](function(){setInterval(function(){_0x4c672a['syncCampaigns']();},0x3e8);});};Dialer[_0xb151('0x1a')][_0xb151('0x150')]=function(_0x596d23){var _0x11199b=this;return function(){if(!_0x11199b[_0xb151('0x151')](_0x596d23[_0xb151('0x82')])){if(!_0x11199b[_0xb151('0x151')](_0x596d23[_0xb151('0x152')])){_0x596d23[_0xb151('0x48')]=_0xb151('0x153');throw _0x596d23[_0xb151('0x44')]+_0xb151('0x154');}}};};Dialer[_0xb151('0x1a')]['checkIfTime']=function(_0x3a3c19,_0x167444,_0x2c22a9,_0x2a0cf2){var _0x5bee78=this;return function(){var _0x1a74c2=!![];return _0x5bee78['ifTime'](_0x3a3c19,_0x167444,_0x2c22a9,_0x2a0cf2,_0x1a74c2);};};Dialer['prototype'][_0xb151('0x155')]=function(_0xb2db23,_0xb9a4ad,_0x13a425,_0x1b0d37){var _0x1e469c=this;return function(){var _0x22ad31=![];return _0x1e469c[_0xb151('0x156')](_0xb2db23['Intervals'],_0xb9a4ad,_0x13a425,_0x1b0d37,_0x22ad31);};};Dialer[_0xb151('0x1a')][_0xb151('0x156')]=function(_0x1fcfcc,_0x25c411,_0x2f0afc,_0x42c630,_0x518ed2){var _0x4c655e=[];return new BPromise(function(_0x542da1,_0x3be3e0){if(!isNotNull(_0x1fcfcc)){_0x42c630[_0xb151('0x48')]=_0xb151('0x4c');return _0x3be3e0(msgResponse(_0xb151('0x156'),_0xb151('0x157'),_0x2f0afc+_0xb151('0x158')));}if(_[_0xb151('0x4d')](_0x1fcfcc)){_0x42c630[_0xb151('0x48')]=_0xb151('0x159');return _0x3be3e0(msgResponse(_0xb151('0x156'),_0xb151('0x157'),_0x2f0afc+_0xb151('0x15a')));}if(_0x25c411&&_[_0xb151('0x42')](config['timezones'][_0x25c411])){_0x42c630[_0xb151('0x48')]=_0xb151('0x15b');return _0x3be3e0(msgResponse('ifTime',_0xb151('0x157'),_0x2f0afc+_0xb151('0x15c')+_0x25c411));}if(_[_0xb151('0x15d')](_0x1fcfcc)){for(var _0x3a3f4c=0x0;_0x3a3f4c<_0x1fcfcc[_0xb151('0xa0')];_0x3a3f4c+=0x1){_0x4c655e[_0xb151('0x13e')](ami['Action']({'action':'command','command':util['format'](_0xb151('0x15e'),_0x1fcfcc[_0x3a3f4c][_0xb151('0x15f')],!_['isUndefined'](config[_0xb151('0x160')][_0x25c411])?_0x25c411:'')})['then'](function(_0x23ae83){return _0x23ae83[_0xb151('0x161')][_0xb151('0x162')](_0xb151('0x163'))>=0x0;})[_0xb151('0xbb')](myreject(_0x3be3e0)));}}else{_0x4c655e[_0xb151('0x13e')](ami[_0xb151('0xb8')]({'action':'command','command':util[_0xb151('0x84')](_0xb151('0x15e'),_0x1fcfcc,!_[_0xb151('0x42')](config[_0xb151('0x160')][_0x25c411])?_0x25c411:'')})[_0xb151('0x40')](function(_0x5280bb){return _0x5280bb['content'][_0xb151('0x162')](_0xb151('0x163'))>=0x0;})['catch'](myreject(_0x3be3e0)));}BPromise[_0xb151('0x164')](_0x4c655e)[_0xb151('0x40')](function(_0xeb9550){var _0x56c938=_['some'](_0xeb9550);if(_0x56c938){return _0x542da1(_0x56c938);}else{_0x42c630[_0xb151('0x48')]=_0x518ed2?_0xb151('0x165'):_0xb151('0x166');return _0x3be3e0(msgResponse('[ifTime][promiseAll]',_0xb151('0x157'),_0xb151('0x167')+_0x518ed2+'\x20'+_0x2f0afc+_0xb151('0x168')+util['inspect'](_0x1fcfcc,{'showHidden':![],'depth':null})+_0xb151('0x169')+_0x25c411));}})[_0xb151('0xbb')](function(_0x2ead90){return _0x3be3e0(msgResponse(_0xb151('0x156'),_0xb151('0x157'),JSON['stringify'](_0x2ead90)));});});};Dialer[_0xb151('0x1a')][_0xb151('0x16a')]=function(_0x3eec93){var _0x1eefb6=this;return function(){switch(_0x3eec93['dialMethod']){case _0xb151('0x16b'):freeVariablesPredictive(_0x3eec93);_0x1eefb6[_0xb151('0x16c')](_0x3eec93,0x1);break;case _0xb151('0x16d'):freeVariablesPredictive(_0x3eec93);_0x1eefb6['handlePower'](_0x3eec93,_0x3eec93[_0xb151('0x16e')]);break;case'predictive':_0x1eefb6['predictive'](_0x3eec93);break;case'booked':freeVariablesPredictive(_0x3eec93);_0x1eefb6[_0xb151('0x16c')](_0x3eec93,0x1);break;default:freeVariablesPredictive(_0x3eec93);logger[_0xb151('0x9f')](_0xb151('0x16f'),_0x3eec93[_0xb151('0x44')],_0xb151('0x170'));}};};Dialer['prototype'][_0xb151('0x171')]=function(_0x5687ba){var _0x48ab8e=this;return function(){_0x48ab8e['handleIvr'](_0x5687ba);};};Dialer['prototype']['syncQueueSummary']=function(_0x57f4af){var _0x210052=this;if(isNotPreview(_0x57f4af[_0xb151('0x64')])){if(isVoiceQueueOutbound(_0x57f4af[_0xb151('0x54')])&&isActive(_0x57f4af[_0xb151('0x63')])){_0x57f4af[_0xb151('0xa8')]=!![];BPromise[_0xb151('0xc4')]()['then'](checkIsLoggedIn(_0x57f4af,_0x57f4af[_0xb151('0x58')]))[_0xb151('0x40')](checkIsActive(_0x57f4af,_0x57f4af[_0xb151('0x63')]))[_0xb151('0x40')](checkInterval(_0x57f4af))[_0xb151('0x40')](_0x210052[_0xb151('0x150')](_0x57f4af))[_0xb151('0x40')](_0x210052[_0xb151('0x172')](_0x57f4af['dialGlobalInterval'],_0x57f4af[_0xb151('0x173')],_0x57f4af[_0xb151('0x44')],_0x57f4af))[_0xb151('0x40')](_0x210052['checkIfTimeIntervals'](_0x57f4af[_0xb151('0x4a')],_0x57f4af[_0xb151('0x173')],_0x57f4af[_0xb151('0x44')],_0x57f4af))[_0xb151('0x40')](_0x210052['checkDialMethod'](_0x57f4af))[_0xb151('0xbb')](loggerCatchQueueSummary(_0xb151('0x174'),_0x57f4af));}else{notSendMessagesQueue(_0x57f4af);}}else{freeVariablesPredictive(_0x57f4af);}};Dialer[_0xb151('0x1a')]['syncQueueSummaryComplete']=_['throttle'](function(){var _0x6ec158=_[_0xb151('0x175')](this['voiceQueues'],function(_0x26a9d0){return _0x26a9d0[_0xb151('0x176')];});var _0x419575=_[_0xb151('0x175')](this[_0xb151('0x1f')],function(_0x59a407){return _0x59a407[_0xb151('0x177')]&&_0x59a407[_0xb151('0xb9')]===_0xb151('0x178');});if(_0x6ec158['length']>0x0&&_0x419575[_0xb151('0xa0')]>0x0){return BPromise['resolve']()[_0xb151('0x40')](cmHopper[_0xb151('0x179')](_[_0xb151('0x17a')](_0x6ec158,'id'),previewRecallmeReminderInterval,_[_0xb151('0x17a')](_0x419575,'id')))['then'](function(_0x313646){for(var _0x3a1b93=0x0;_0x3a1b93<_0x313646['length'];_0x3a1b93++){var _0x863726=_0x313646[_0x3a1b93]['Agent']['name'];if(_0x863726)io['to'](util[_0xb151('0x84')](_0xb151('0x17b'),_0x863726))[_0xb151('0x53')](_0xb151('0x17c'),{'hopper':_0x313646[_0x3a1b93]});}})[_0xb151('0xbb')](function(_0x31328d){logger['error'](_0xb151('0x17d'),_0x31328d);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xb151('0x1a')][_0xb151('0x17e')]=function(){var _0xe83353=this;var _0x32786a;for(var _0x2a2379 in this[_0xb151('0x1e')]){if(typeof this[_0xb151('0x1e')][_0x2a2379]!==_0xb151('0xa2')){_0x32786a=this[_0xb151('0x1e')][_0x2a2379];if(isCampaignIvr(_0x32786a[_0xb151('0x54')])&&isActive(_0x32786a[_0xb151('0xec')])){_0x32786a[_0xb151('0xa8')]=!![];BPromise['resolve']()[_0xb151('0x40')](checkIsActive(_0x32786a,_0x32786a[_0xb151('0xec')]))[_0xb151('0x40')](checkInterval(_0x32786a))[_0xb151('0x40')](_0xe83353[_0xb151('0x150')](_0x32786a))['then'](_0xe83353[_0xb151('0x172')](_0x32786a[_0xb151('0x17f')],_0x32786a[_0xb151('0x173')],_0x32786a[_0xb151('0x44')],_0x32786a))[_0xb151('0x40')](_0xe83353[_0xb151('0x155')](_0x32786a['Interval'],_0x32786a[_0xb151('0x173')],_0x32786a[_0xb151('0x44')],_0x32786a))['then'](_0xe83353['launchHandleIvr'](_0x32786a))[_0xb151('0xbb')](loggerCatchQueueSummary(_0xb151('0x180'),_0x32786a));}else{notSendMessagesCampaign(_0x32786a);}}}};function getCallerIdRandom(_0x379fdc,_0x17cb14){var _0x1be163;var _0x53cbbb;var _0x53bb60;if(_0x17cb14<=0x0){_0x17cb14=0x1;}_0x1be163=new RegExp(_0xb151('0x181')+_0x17cb14+'}$');_0x53cbbb=Math[_0xb151('0x182')](0xa,_0x17cb14-0x1);_0x53bb60=Math[_0xb151('0x182')](0xa,_0x17cb14)-0x1;return util[_0xb151('0x84')]('%s',_['replace'](_0x379fdc,_0x1be163,_[_0xb151('0x183')](_0x53cbbb,_0x53bb60)));}function extractCalleridName(_0x44680e){var _0x210ae4=_0x44680e[_0xb151('0x184')](/"(.*?)"/);return _0x210ae4?_0x210ae4[0x1]:_0x44680e;}function extractCalleridNumber(_0xc7b6d5){var _0x436970=_0xc7b6d5['match'](/<(.*?)>/);return _0x436970?_0x436970[0x1]:_0xc7b6d5;}Dialer[_0xb151('0x1a')][_0xb151('0x185')]=function(_0xd15c52,_0x250070){var _0x4c53cd=this;var _0x1dd7f7=uuid['v4']();this['actions'][_0x1dd7f7]=new Action(_0xd15c52,_0x250070,_0x1dd7f7);return new BPromise(function(_0x4056b6,_0x300979){if(_['isUndefined'](_0xd15c52)&&typeof _0xd15c52!==_0xb151('0x186')){return _0x300979(msgResponse(_0xb151('0x187'),_0xb151('0x157'),_0xb151('0x188')));}if(_['isUndefined'](_0x250070['phone'])||_0x250070['phone']===null){return _0x300979(msgResponse(_0xb151('0x187'),'Failure',_0xb151('0x189')));}var _0x9079a={'XMD-CALLERID':_0x4c53cd['actions'][_0x1dd7f7]['getCaller'](),'XMD-AGI':_0xd15c52['dialQueueProject']?util[_0xb151('0x84')](_0xb151('0x18a'),ipAgi,_0xd15c52[_0xb151('0x119')]):_0xb151('0x18b'),'XMD-AGIAFTER':_0xd15c52['dialQueueProject2']?util[_0xb151('0x84')]('\x22agi://%s/square,%s\x22',ipAgi,_0xd15c52[_0xb151('0x12a')]):'NONE','XMD-QUEUE':_0xd15c52[_0xb151('0x54')]==='outbound'?util[_0xb151('0x84')]('\x22%s,%s%s,,,%s\x22',_0xd15c52[_0xb151('0x44')],_0xd15c52['dialQueueOptions']||'',_0xd15c52[_0xb151('0x121')]?'c':'',_0xd15c52[_0xb151('0x128')]||0x3):_0xb151('0x18b'),'XMD-CONTACTID':_0x250070['ContactId'],'XMD-CDRTYPE':_0xb151('0x5'),'CALLERID(all)':_0x4c53cd[_0xb151('0x23')][_0x1dd7f7][_0xb151('0x18c')](),'XMD-AMD':_0xd15c52[_0xb151('0xf2')]?_0xb151('0x18d'):_0xb151('0x18b'),'XMD-DESTINATION':_0xb151('0xf1')};if(_0xd15c52[_0xb151('0xf2')]){_0x9079a[_0xb151('0x18e')]=_0xd15c52[_0xb151('0x18f')]||0x9c4;_0x9079a[_0xb151('0x190')]=_0xd15c52[_0xb151('0x191')]||0x5dc;_0x9079a[_0xb151('0x192')]=_0xd15c52[_0xb151('0x193')]||0x320;_0x9079a[_0xb151('0x194')]=_0xd15c52['dialAMDTotalAnalysisTime']||0x1388;_0x9079a[_0xb151('0x195')]=_0xd15c52[_0xb151('0x196')]||0x64;_0x9079a[_0xb151('0x197')]=_0xd15c52['dialAMDBetweenWordsSilence']||0x32;_0x9079a[_0xb151('0x198')]=_0xd15c52[_0xb151('0x199')]||0x3;_0x9079a[_0xb151('0x19a')]=_0xd15c52[_0xb151('0x19b')]||0x100;_0x9079a['XMD-AMDMAXIMUMWORDLENGTH']=_0xd15c52[_0xb151('0x19c')]||0x1388;}if(_0xd15c52[_0xb151('0x54')]===_0xb151('0x9a')){_0x9079a[_0xb151('0x19d')]=_0x250070[_0xb151('0xe6')];}else{_0x9079a[_0xb151('0x19e')]=_0x250070['CampaignId'];}for(var _0x3f24a0 in _0x250070[_0xb151('0x19f')]){if(typeof _0x250070[_0xb151('0x19f')][_0x3f24a0]!=='undefined'){if(isNotNull(_0x250070[_0xb151('0x19f')][_0x3f24a0])&&_0x3f24a0!=='id'&&_0x3f24a0!==_0xb151('0x1a0')&&_0x3f24a0!==_0xb151('0x1a1')&&_0x3f24a0!==_0xb151('0x1a2')){_0x9079a[util['format'](_0xb151('0x1a3'),'XMD-',_['toUpper'](_0x3f24a0))]=_0x250070[_0xb151('0x19f')][_0x3f24a0];}}}var _0x88087b=_0x4c53cd[_0xb151('0x151')](_0xd15c52['Trunk'])?getCallerId(_0xd15c52['Trunk'][_0xb151('0x83')],_0xd15c52[_0xb151('0x65')],_0xd15c52['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0xd15c52[_0xb151('0x66')],_0xd15c52[_0xb151('0x1a4')]):_0xd15c52[_0xb151('0x66')]):getCallerId(_[_0xb151('0xef')](_0xd15c52[_0xb151('0x152')])?_0xd15c52[_0xb151('0x82')][_0xb151('0x83')]:_0xd15c52[_0xb151('0x152')]['callerid'],_0xd15c52['dialOriginateCallerIdName'],_0xd15c52['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0xd15c52[_0xb151('0x66')],_0xd15c52[_0xb151('0x1a4')]):_0xd15c52[_0xb151('0x66')]);if(_0x88087b){_0x9079a[_0xb151('0x1a5')]=_0x4c53cd['actions'][_0x1dd7f7][_0xb151('0x1a6')]=extractCalleridName(_0x88087b);_0x9079a[_0xb151('0x1a7')]=_0x250070[_0xb151('0x1a8')];}return ami[_0xb151('0xb8')]({'actionid':_0x1dd7f7,'action':_0xb151('0x187'),'channel':_0x4c53cd[_0xb151('0x151')](_0xd15c52[_0xb151('0x82')])?util[_0xb151('0x84')]('SIP/%s/%s%s',_0xd15c52['Trunk'][_0xb151('0x44')],isNotNull(_0xd15c52['dialPrefix'])?_0xd15c52['dialPrefix'][_0xb151('0x1a9')]()||'':'',_0xd15c52[_0xb151('0x1aa')]>0x0?_0x250070[_0xb151('0x1a8')][_0xb151('0x1ab')](_0xd15c52['dialCutDigit']):_0x250070[_0xb151('0x1a8')]):util[_0xb151('0x84')]('SIP/%s/%s%s',_[_0xb151('0xef')](_0xd15c52[_0xb151('0x152')])?_0xd15c52[_0xb151('0x82')][_0xb151('0x44')]:_0xd15c52[_0xb151('0x152')][_0xb151('0x44')],isNotNull(_0xd15c52[_0xb151('0x68')])?_0xd15c52['dialPrefix'][_0xb151('0x1a9')]()||'':'',_0xd15c52[_0xb151('0x1aa')]>0x0?_0x250070[_0xb151('0x1a8')]['substring'](_0xd15c52['dialCutDigit']):_0x250070[_0xb151('0x1a8')]),'callerid':_0x88087b,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x9079a,'timeout':(_0xd15c52[_0xb151('0x67')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1dd7f7})[_0xb151('0x40')](function(_0x24e62b){return _0x4056b6(_0x24e62b);})['catch'](function(_0x421bcf){_0xd15c52[_0xb151('0x71')]+=0x1;var _0x10f014=new History(_0x4c53cd['actions'][_0x1dd7f7]);logger[_0xb151('0x9f')](util[_0xb151('0x84')]('[originateError]:\x20%s',JSON[_0xb151('0x50')](_0x421bcf)));_0x10f014[_0xb151('0xaf')]=0xe;_0x10f014['statedesc']=_0xb151('0x1ac');_0x10f014[_0xb151('0xb2')]=moment()[_0xb151('0x84')](_0xb151('0x10a'));_0x10f014[_0xb151('0xb1')]=_0x10f014[_0xb151('0xb2')];_0x4c53cd[_0xb151('0xdb')](_0x10f014)[_0xb151('0xbb')](loggerCatch(_0xb151('0x1ad')));_0x4c53cd[_0xb151('0xd9')](_0x10f014)[_0xb151('0xbb')](loggerCatch(_0xb151('0x1ad')))[_0xb151('0x145')](function(){delete _0x4c53cd[_0xb151('0x23')][_0x1dd7f7];return _0x300979(msgResponse(_0xb151('0x187'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0xb151('0x1a')][_0xb151('0x31')]=function(_0x12bba0){var _0x2a775c=this[_0xb151('0x23')][_0x12bba0[_0xb151('0x13a')]];if(_0x2a775c){delete this[_0xb151('0x23')][_0x12bba0['actionid']];_0x2a775c['responsetime']=moment()[_0xb151('0x84')](_0xb151('0x10a'));var _0x3f5402=_0x2a775c[_0xb151('0x54')]==='ivr'?this[_0xb151('0x1e')][_0x2a775c[_0xb151('0xbf')]]:this[_0xb151('0x1d')][_0x2a775c['getQueue']()];if(!this[_0xb151('0xea')](_0x12bba0['response'])){this['updateOriginated'](_0x3f5402);return this['callProgressDetecting'](_0x2a775c,_0x3f5402,_0x12bba0)[_0xb151('0xbb')](loggerCatch(_0xb151('0x1ae')));}this[_0xb151('0x25')][_0x12bba0[_0xb151('0xf4')]]=_0x2a775c;}};Dialer['prototype'][_0xb151('0x1af')]=function(_0x470eb4,_0x110197,_0x58fb5e){var _0x3ef661=new History(_0x110197);if(_0x3ef661[_0xb151('0x10f')]+_0x3ef661['countcongestionretry']+_0x3ef661[_0xb151('0x101')]+_0x3ef661[_0xb151('0x102')]+_0x3ef661[_0xb151('0x12b')]+_0x3ef661[_0xb151('0x103')]+_0x3ef661['countmachineretry']+_0x3ef661[_0xb151('0x110')]>=_0x58fb5e[_0xb151('0x104')]-0x1){return!![];}switch(_0x470eb4){case 0x3:if(_0x3ef661[_0xb151('0x101')]>=_0x58fb5e[_0xb151('0x1b0')]-0x1){return!![];}this[_0xb151('0xce')]({'active':![],'countnoanswerretry':_0x3ef661[_0xb151('0x101')]+=0x1,'scheduledat':moment()[_0xb151('0x114')](_0x58fb5e[_0xb151('0x1b1')],_0xb151('0x109'))['format'](_0xb151('0x10a')),'ContactId':_0x3ef661[_0xb151('0xe4')],'ListId':_0x3ef661[_0xb151('0xe5')],'VoiceQueueId':_0x3ef661[_0xb151('0xe6')]||undefined,'CampaignId':_0x3ef661[_0xb151('0xe7')]||undefined})['catch'](loggerCatch(_0xb151('0x1b2')));break;case 0x5:if(_0x3ef661['countbusyretry']>=_0x58fb5e[_0xb151('0x1b3')]-0x1){return!![];}this[_0xb151('0xce')]({'active':![],'countbusyretry':_0x3ef661['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x58fb5e[_0xb151('0x1b4')],_0xb151('0x109'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ef661['ContactId'],'ListId':_0x3ef661[_0xb151('0xe5')],'VoiceQueueId':_0x3ef661[_0xb151('0xe6')]||undefined,'CampaignId':_0x3ef661[_0xb151('0xe7')]||undefined})['catch'](loggerCatch(_0xb151('0x1b5')));break;case 0x8:if(_0x3ef661[_0xb151('0x100')]>=_0x58fb5e['dialCongestionMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x3ef661[_0xb151('0x100')]+=0x1,'scheduledat':moment()[_0xb151('0x114')](_0x58fb5e[_0xb151('0x1b6')],'minutes')[_0xb151('0x84')](_0xb151('0x10a')),'ContactId':_0x3ef661[_0xb151('0xe4')],'ListId':_0x3ef661['ListId'],'VoiceQueueId':_0x3ef661[_0xb151('0xe6')]||undefined,'CampaignId':_0x3ef661[_0xb151('0xe7')]||undefined})[_0xb151('0xbb')](loggerCatch(_0xb151('0x1b7')));break;case 0x0:if(_0x3ef661['countnosuchnumberretry']>=_0x58fb5e[_0xb151('0x1b8')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x3ef661[_0xb151('0x102')]+=0x1,'scheduledat':moment()[_0xb151('0x114')](_0x58fb5e[_0xb151('0x1b9')],_0xb151('0x109'))[_0xb151('0x84')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ef661['ContactId'],'ListId':_0x3ef661['ListId'],'VoiceQueueId':_0x3ef661[_0xb151('0xe6')]||undefined,'CampaignId':_0x3ef661[_0xb151('0xe7')]||undefined})[_0xb151('0xbb')](loggerCatch(_0xb151('0x1ba')));}break;case 0xa:if(_0x3ef661[_0xb151('0x12b')]>=_0x58fb5e['dialDropMaxRetry']-0x1){return!![];}this[_0xb151('0xce')]({'active':![],'countdropretry':_0x3ef661['countdropretry']+=0x1,'scheduledat':moment()[_0xb151('0x114')](_0x58fb5e[_0xb151('0x12c')],_0xb151('0x109'))[_0xb151('0x84')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ef661[_0xb151('0xe4')],'ListId':_0x3ef661[_0xb151('0xe5')],'VoiceQueueId':_0x3ef661[_0xb151('0xe6')]||undefined,'CampaignId':_0x3ef661[_0xb151('0xe7')]||undefined})[_0xb151('0xbb')](loggerCatch(_0xb151('0x12f')));break;case 0xb:if(_0x3ef661['countabandonedretry']>=_0x58fb5e['dialAbandonedMaxRetry']-0x1){return!![];}this[_0xb151('0xce')]({'active':![],'countabandonedretry':_0x3ef661[_0xb151('0x103')]+=0x1,'scheduledat':moment()[_0xb151('0x114')](_0x58fb5e['dialAbandonedRetryFrequency'],_0xb151('0x109'))[_0xb151('0x84')](_0xb151('0x10a')),'ContactId':_0x3ef661[_0xb151('0xe4')],'ListId':_0x3ef661[_0xb151('0xe5')],'VoiceQueueId':_0x3ef661[_0xb151('0xe6')]||undefined,'CampaignId':_0x3ef661[_0xb151('0xe7')]||undefined})['catch'](loggerCatch(_0xb151('0x138')));break;case 0x13:if(_0x3ef661[_0xb151('0x105')]>=_0x58fb5e['dialMachineMaxRetry']-0x1){return!![];}this[_0xb151('0xce')]({'active':![],'countmachineretry':_0x3ef661['countmachineretry']+=0x1,'scheduledat':moment()[_0xb151('0x114')](_0x58fb5e[_0xb151('0x108')],_0xb151('0x109'))[_0xb151('0x84')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ef661[_0xb151('0xe4')],'ListId':_0x3ef661[_0xb151('0xe5')],'VoiceQueueId':_0x3ef661['VoiceQueueId']||undefined,'CampaignId':_0x3ef661['CampaignId']||undefined})['catch'](loggerCatch(_0xb151('0x10b')));break;case 0x14:if(_0x3ef661[_0xb151('0x110')]>=_0x58fb5e[_0xb151('0x1bb')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x3ef661['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xb151('0x114')](_0x58fb5e[_0xb151('0x1bc')],_0xb151('0x109'))['format'](_0xb151('0x10a')),'ContactId':_0x3ef661[_0xb151('0xe4')],'ListId':_0x3ef661[_0xb151('0xe5')],'VoiceQueueId':_0x3ef661[_0xb151('0xe6')]||undefined,'CampaignId':_0x3ef661[_0xb151('0xe7')]||undefined})[_0xb151('0xbb')](loggerCatch(_0xb151('0x1bd')));break;default:return!![];}};Dialer[_0xb151('0x1a')]['callProgressDetecting']=function(_0x2d5301,_0x59d36f,_0x511be7){var _0x49abe6=this;var _0x4980ba=new History(_0x2d5301);var _0x533f2a=![];var _0x22cf08;var _0x464bcc;return new BPromise(function(_0x3adff3,_0x2c2262){if(_[_0xb151('0x42')](_0x59d36f)&&typeof _0x59d36f!==_0xb151('0x186')){return _0x2c2262(msgResponse('[callProgressDetecting]',_0xb151('0x157'),'entity\x20is\x20undefine'));}if(_[_0xb151('0x42')](_0x511be7)&&typeof _0x511be7!==_0xb151('0x186')){return _0x2c2262(msgResponse(_0xb151('0x1be'),_0xb151('0x157'),_0xb151('0x1bf')));}_0x49abe6[_0xb151('0xc6')](_0x4980ba,_0x511be7['reason'],_0x59d36f)[_0xb151('0x40')](function(_0x2df97b){if(_0x2df97b['additional']==0x1)_0x533f2a=!![];switch(_0x511be7[_0xb151('0x11e')]){case'0':_0x59d36f[_0xb151('0x70')]+=0x1;_0x4980ba[_0xb151('0xaf')]=0x0;_0x4980ba['statedesc']=_0xb151('0x1c0');_0x4980ba[_0xb151('0x102')]+=0x1;_0x4980ba[_0xb151('0xfd')]+=0x1;ami[_0xb151('0x53')](_0xb151('0x1c1'),ut[_0xb151('0xf9')](_0x2d5301,_0xb151('0x1c2')));_0x22cf08=_0x59d36f['dialNoSuchNumberRetryFrequency'];_0x464bcc=_0x59d36f[_0xb151('0x1c3')];_0x49abe6[_0xb151('0xdb')](_0x4980ba)[_0xb151('0xbb')](loggerCatch(_0xb151('0x10e')));if(_0x49abe6[_0xb151('0x1af')](0x0,_0x2d5301,_0x59d36f)&&!_0x533f2a){if(_0x4980ba[_0xb151('0x102')]>=_0x59d36f[_0xb151('0x1b8')]){_0x49abe6['createStateFinal'](_0x4980ba,_0x3adff3,_0x2c2262,_0xb151('0x1c4'));}else{_0x49abe6[_0xb151('0x111')](_0x4980ba,_0x3adff3,_0x2c2262,_0xb151('0x1c4'));}}break;case'3':_0x59d36f[_0xb151('0x1c5')]+=0x1;_0x4980ba['state']=0x3;_0x4980ba[_0xb151('0xb0')]=_0xb151('0x1c6');_0x4980ba[_0xb151('0x101')]+=0x1;_0x4980ba['countglobal']+=0x1;ami[_0xb151('0x53')](_0xb151('0x1c7'),ut[_0xb151('0xf9')](_0x2d5301,_0xb151('0x1c8')));_0x22cf08=_0x59d36f[_0xb151('0x1b1')];_0x464bcc=_0x59d36f[_0xb151('0x1c3')];_0x49abe6[_0xb151('0xdb')](_0x4980ba)['catch'](loggerCatch(_0xb151('0x1c9')));if(_0x49abe6[_0xb151('0x1af')](0x3,_0x2d5301,_0x59d36f)&&!_0x533f2a){if(_0x4980ba['countnoanswerretry']>=_0x59d36f[_0xb151('0x1b0')]){_0x49abe6['createStateFinal'](_0x4980ba,_0x3adff3,_0x2c2262,_0xb151('0x1ca'));}else{_0x49abe6[_0xb151('0x111')](_0x4980ba,_0x3adff3,_0x2c2262,_0xb151('0x1ca'));}}break;case'5':_0x59d36f[_0xb151('0x6b')]+=0x1;_0x4980ba[_0xb151('0xaf')]=0x5;_0x4980ba[_0xb151('0xb0')]='Busy';_0x4980ba['countbusyretry']+=0x1;_0x4980ba['countglobal']+=0x1;ami[_0xb151('0x53')](_0xb151('0x1cb'),ut[_0xb151('0xf9')](_0x2d5301,'busy'));_0x22cf08=_0x59d36f[_0xb151('0x1b4')];_0x464bcc=_0x59d36f['callAdditionalPhoneAfterMin'];_0x49abe6['createHistory'](_0x4980ba)[_0xb151('0xbb')](loggerCatch(_0xb151('0x1cc')));if(_0x49abe6['checkRetriveMax'](0x5,_0x2d5301,_0x59d36f)&&!_0x533f2a){if(_0x4980ba[_0xb151('0x10f')]>=_0x59d36f['dialBusyMaxRetry']){_0x49abe6[_0xb151('0x113')](_0x4980ba,_0x3adff3,_0x2c2262,_0xb151('0x1cd'));}else{_0x49abe6['stateGlobal'](_0x4980ba,_0x3adff3,_0x2c2262,_0xb151('0x1cd'));}}break;case'8':_0x59d36f[_0xb151('0x6c')]+=0x1;_0x4980ba['state']=0x8;_0x4980ba[_0xb151('0xb0')]=_0xb151('0x1ce');_0x4980ba[_0xb151('0x100')]+=0x1;_0x4980ba[_0xb151('0xfd')]+=0x1;_0x22cf08=_0x59d36f[_0xb151('0x1b6')];_0x464bcc=_0x59d36f['callAdditionalPhoneAfterMin'];ami[_0xb151('0x53')](_0xb151('0x1cf'),ut['buildObj'](_0x2d5301,_0xb151('0x1d0')));_0x49abe6['createHistory'](_0x4980ba)['catch'](loggerCatch(_0xb151('0x1d1')));if(_0x49abe6[_0xb151('0x1af')](0x8,_0x2d5301,_0x59d36f)&&!_0x533f2a){if(_0x4980ba[_0xb151('0x100')]>=_0x59d36f['dialCongestionMaxRetry']){_0x49abe6[_0xb151('0x113')](_0x4980ba,_0x3adff3,_0x2c2262,_0xb151('0x1d2'));}else{_0x49abe6[_0xb151('0x111')](_0x4980ba,_0x3adff3,_0x2c2262,_0xb151('0x1d2'));}}break;case'11':_0x59d36f[_0xb151('0x1d3')]+=0x1;_0x4980ba[_0xb151('0xaf')]=0xb;_0x4980ba['statedesc']='Abandoned';_0x4980ba[_0xb151('0x103')]+=0x1;_0x4980ba[_0xb151('0xfd')]+=0x1;_0x22cf08=_0x59d36f[_0xb151('0x136')];_0x464bcc=_0x59d36f[_0xb151('0x1c3')];_0x49abe6['createHistory'](_0x4980ba)[_0xb151('0xbb')](loggerCatch(_0xb151('0x139')));if(_0x49abe6[_0xb151('0x1af')](0xb,_0x2d5301,_0x59d36f)&&!_0x533f2a){if(_0x4980ba['countabandonedretry']>=_0x59d36f[_0xb151('0x1d4')]){_0x49abe6[_0xb151('0x113')](_0x4980ba,_0x3adff3,_0x2c2262,'reason\x2011\x20abandoned');}else{_0x49abe6[_0xb151('0x111')](_0x4980ba,_0x3adff3,_0x2c2262,'reason\x2011\x20abandoned');}}break;case'20':_0x59d36f[_0xb151('0x73')]+=0x1;_0x4980ba[_0xb151('0xaf')]=0x14;_0x4980ba[_0xb151('0xb0')]='AgentReject';_0x4980ba[_0xb151('0x110')]+=0x1;_0x4980ba[_0xb151('0xfd')]+=0x1;_0x22cf08=_0x59d36f[_0xb151('0x1bc')];_0x464bcc=_0x59d36f[_0xb151('0x1c3')];ami[_0xb151('0x53')](_0xb151('0x1d5'),ut[_0xb151('0xf9')](_0x2d5301,'agentreject'));_0x49abe6[_0xb151('0xdb')](_0x4980ba)['catch'](loggerCatch(_0xb151('0x1d6')));if(_0x49abe6['checkRetriveMax'](0x14,_0x2d5301,_0x59d36f)&&!_0x533f2a){if(_0x4980ba[_0xb151('0x110')]>=_0x59d36f[_0xb151('0x1bb')]){_0x49abe6[_0xb151('0x113')](_0x4980ba,_0x3adff3,_0x2c2262,_0xb151('0x1d7'));}else{_0x49abe6['stateGlobal'](_0x4980ba,_0x3adff3,_0x2c2262,_0xb151('0x1d7'));}}break;default:_0x59d36f[_0xb151('0x74')]+=0x1;_0x4980ba[_0xb151('0xaf')]=0xc;_0x4980ba[_0xb151('0xb0')]=_0x511be7[_0xb151('0x11e')];_0x22cf08=_0x59d36f[_0xb151('0x1bc')];_0x464bcc=_0x59d36f['callAdditionalPhoneAfterMin'];_0x49abe6[_0xb151('0xdb')](_0x4980ba)[_0xb151('0xbb')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x49abe6[_0xb151('0x1af')](_0x511be7[_0xb151('0x11e')],_0x2d5301,_0x59d36f)&&!_0x533f2a){if(_0x4980ba[_0xb151('0x10f')]+_0x4980ba[_0xb151('0x100')]+_0x4980ba[_0xb151('0x101')]+_0x4980ba['countnosuchnumberretry']+_0x4980ba['countdropretry']+_0x4980ba[_0xb151('0x103')]+_0x4980ba[_0xb151('0x105')]+_0x4980ba[_0xb151('0x110')]>=_0x59d36f[_0xb151('0x104')]){_0x49abe6[_0xb151('0x111')](_0x4980ba,_0x3adff3,_0x2c2262,_0x511be7[_0xb151('0x11e')]);}else{_0x49abe6['createStateFinal'](_0x4980ba,_0x3adff3,_0x2c2262,_0x511be7[_0xb151('0x11e')]);}}}})[_0xb151('0x40')](function(_0x42cbc9){if(_0x533f2a){_0x49abe6[_0xb151('0xc8')](_0x4980ba,_0x22cf08,_0x464bcc)[_0xb151('0x40')](function(_0x14c1a0){return _0x3adff3(0x1);});}});});};Dialer[_0xb151('0x1a')][_0xb151('0x111')]=function(_0xaa1ee9,_0x219380,_0x12f0ae,_0x589f96){var _0x2fcbe0=new Final(_0xaa1ee9);_0x2fcbe0[_0xb151('0xaf')]=0xf;_0x2fcbe0['statedesc']=_0xb151('0x1d8');this[_0xb151('0x113')](_0x2fcbe0,_0x219380,_0x12f0ae,_0x589f96);};Dialer[_0xb151('0x1a')][_0xb151('0x113')]=function(_0xb62af3,_0x249e99,_0x116acc,_0x5457f1){this[_0xb151('0xd9')](_0xb62af3)[_0xb151('0x40')](function(){return _0x249e99(msgResponse(_0xb151('0x1be'),_0xb151('0xeb'),_0x5457f1));})['catch'](function(){return _0x116acc(msgResponse(_0xb151('0x1d9'),_0xb151('0x157'),'contact\x20not\x20moved'));});};Dialer[_0xb151('0x1a')]['predictive']=function(_0x27a18d){var _0x25561b=_0x27a18d[_0xb151('0x1da')]/0x64;var _0x11e1aa=_0x27a18d['outboundDropCallsDayTimeout']/(_0x27a18d['outboundDropCallsDayTimeout']+_0x27a18d[_0xb151('0xf5')]);var _0x1da21e=Math[_0xb151('0x1db')](_0x27a18d[_0xb151('0x7d')]*(_0x27a18d[_0xb151('0x1dc')]/0x64));var _0x143323=Math[_0xb151('0x1db')](_0x27a18d[_0xb151('0x7d')]*(_0x27a18d[_0xb151('0x1dd')]/0x64));var _0x332e9e=_0x27a18d['available']+_0x27a18d[_0xb151('0x5d')];var _0x4befb9=Math[_0xb151('0x1de')](_0x27a18d[_0xb151('0x7e')]*_0x27a18d['erlangAbandonmentRate']*_0x27a18d[_0xb151('0x1df')]*_0x27a18d[_0xb151('0x7b')]);if(_[_0xb151('0x42')](_0x27a18d['startProgressive'])){if(!_['isUndefined'](_0x27a18d['startPredictive'])){_0x27a18d[_0xb151('0x27')]=undefined;loggerPredictive['error'](_0xb151('0x1e0'),_0xb151('0x1e1'));}if(!_[_0xb151('0x42')](_0x27a18d[_0xb151('0x99')])){loggerPredictive[_0xb151('0x9f')](_0xb151('0x1e0'),_0xb151('0x1e2'));clearInterval(_0x27a18d[_0xb151('0x99')]);_0x27a18d[_0xb151('0x99')]=undefined;}_0x27a18d[_0xb151('0x28')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xb151('0x87')](_0x27a18d['name'],'collection\x20data\x20in\x20progressive\x20at',_0x27a18d[_0xb151('0x28')]);this['handlePower'](_0x27a18d,0x1);}else if(ifInterval(_0x27a18d[_0xb151('0x1e3')],_0x27a18d['startProgressive'])){this[_0xb151('0x16c')](_0x27a18d,0x1);loggerPredictiveCalls[_0xb151('0x87')](_0xb151('0x1e4'),_0x27a18d[_0xb151('0x28')],_0x27a18d[_0xb151('0x44')]);_0x27a18d[_0xb151('0x7e')]=0x0;_0x27a18d[_0xb151('0x7a')]=0x0;}else if(_0x25561b<_0x11e1aa&&_0x27a18d[_0xb151('0x1e5')]===_0xb151('0x1e6')){freeVariablesPredictive(_0x27a18d);loggerPredictive[_0xb151('0x87')](_0xb151('0x1e7'),_0xb151('0x1e8'),_0x11e1aa,_0xb151('0x28'),_0x27a18d[_0xb151('0x44')]);}else if(_0x4befb9<_0x27a18d[_0xb151('0x7a')]&&_0x27a18d[_0xb151('0x1e5')]==='dropRate'){freeVariablesPredictive(_0x27a18d);loggerPredictive[_0xb151('0x87')](_0xb151('0x1e9'),_0xb151('0x1ea'),_0x4befb9,_0xb151('0x1eb'),_0x27a18d[_0xb151('0x7a')],_0xb151('0x28'),_0x27a18d['name']);}else if(!ifInterval(_0x27a18d[_0xb151('0x1e3')],_0x27a18d['startProgressive'])&&_[_0xb151('0x42')](_0x27a18d[_0xb151('0x27')])&&!_[_0xb151('0x42')](_0x27a18d[_0xb151('0x28')])){_0x27a18d[_0xb151('0x27')]=moment()[_0xb151('0x84')](_0xb151('0x10a'));loggerPredictive[_0xb151('0x87')](_0x27a18d['name'],_0xb151('0x1ec'),_0x27a18d[_0xb151('0x27')]);this['averageHandleTime'](_0x27a18d[_0xb151('0x1e3')])['then'](this[_0xb151('0x1ed')](_0x27a18d))['then'](mergeDataErlangB(_0x27a18d))[_0xb151('0x40')](this[_0xb151('0x1ee')](_0x27a18d))[_0xb151('0xbb')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x27a18d));}else if(!ifInterval(_0x27a18d[_0xb151('0x1e3')],_0x27a18d['startPredictive'])){_0x27a18d['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x27a18d[_0xb151('0x27')]=moment()['format'](_0xb151('0x10a'));loggerPredictive['info'](_0x27a18d['name'],_0xb151('0x1ef'),_0x27a18d['startPredictive']);clearInterval(_0x27a18d[_0xb151('0x99')]);_0x27a18d[_0xb151('0x99')]=undefined;this[_0xb151('0xcc')](_0x27a18d[_0xb151('0x1e3')])[_0xb151('0x40')](this['getDataPredictive'](_0x27a18d))[_0xb151('0x40')](mergeDataErlangB(_0x27a18d))[_0xb151('0x40')](this[_0xb151('0x1ee')](_0x27a18d))[_0xb151('0xbb')](loggerCatchPredictive(_0xb151('0x1f0'),_0x27a18d));}else if(_0x27a18d['predictiveIntervalAvailable']&&_0x332e9e<_0x27a18d['predictiveIntervalAvailable']-_0x143323){freeVariablesPredictive(_0x27a18d);loggerPredictive[_0xb151('0x87')](_0x27a18d[_0xb151('0x44')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x332e9e,_0xb151('0x1f1'),_0x27a18d[_0xb151('0x7d')],'-',_0x143323,'=',_0x27a18d[_0xb151('0x7d')]-_0x143323,')');}else if(_0x27a18d[_0xb151('0x7d')]&&_0x332e9e>_0x27a18d['predictiveIntervalAvailable']+_0x1da21e){freeVariablesPredictive(_0x27a18d);loggerPredictive[_0xb151('0x87')](_0x27a18d['name'],_0xb151('0x1f2'),_0x332e9e,_0xb151('0x1f3'),_0x27a18d[_0xb151('0x7d')],'+',_0x1da21e,'=',_0x27a18d['predictiveIntervalAvailable']+_0x1da21e,')');}};Dialer[_0xb151('0x1a')][_0xb151('0x1ed')]=function(_0x1f708b){var _0x570770=this;return function(_0x1a8d94){return new BPromise(function(_0x1ca4e6,_0x3eada9){_[_0xb151('0xe3')](_0x1f708b,_0x1a8d94[0x0]);if(checkGetDataPredictive(_0x1a8d94[0x0])){var _0x519fdf=_0x1f708b[_0xb151('0x7d')]=_0x1f708b[_0xb151('0x5d')]+_0x1f708b[_0xb151('0x57')];var _0x5784d4=_0x1f708b[_0xb151('0x1e3')]*0x3c;var _0x148662=_0x1a8d94[0x0]['predictiveIntervalAvgTalktime']+_0x1a8d94[0x0][_0xb151('0x76')];var _0x51c3ad=(_0x1a8d94[0x0][_0xb151('0x75')]+_0x1a8d94[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1a8d94[0x0][_0xb151('0x78')])/_0x1a8d94[0x0]['predictiveIntervalTotalCalls'];_0x1f708b['predictiveIntervalHitRate']=_0x51c3ad>0x0?_0x51c3ad:0x1;switch(_0x1f708b[_0xb151('0x1e5')]){case _0xb151('0x1e6'):var _0x4d8072=_0x1f708b['dialPredictiveOptimizationPercentage']/0x64;return _0x570770[_0xb151('0x1f4')](_0x519fdf,_0x5784d4,_0x148662,_0x51c3ad,_0x4d8072)['then'](function(_0x5c6276){return _0x1ca4e6(_0x5c6276);});case _0xb151('0x1f5'):var _0x4b6ada=_0x1f708b['dialPredictiveOptimizationPercentage']/0x64;return _0x570770['busyFactor'](_0x519fdf,_0x5784d4,_0x148662,_0x51c3ad,_0x4b6ada)[_0xb151('0x40')](function(_0x1025d5){return _0x1ca4e6(_0x1025d5);});default:return _0x3eada9(msgResponse('[getDataPredictive]',_0xb151('0x157'),_0xb151('0x1f6')));}}else{return _0x3eada9(msgResponse(_0xb151('0x1f7'),_0xb151('0x157'),_0xb151('0x1f8')));}});};};Dialer[_0xb151('0x1a')]['getDataPredictiveOld']=function(_0x4201c9){var _0x359b76=this;return function(_0x3c3cbf){return new BPromise(function(_0x296bce,_0x4e7a27){_[_0xb151('0xe3')](_0x4201c9,_0x3c3cbf[0x0]);if(checkGetDataPredictive(_0x3c3cbf[0x0])){loggerPredictive['info'](JSON[_0xb151('0x50')](_0x3c3cbf[0x0]));if(_0x4201c9['dialPredictiveOptimization']===_0xb151('0x1e6')){return _0x359b76[_0xb151('0xd7')](_0x4201c9['id'])[_0xb151('0x40')](function(_0x3ac143){var _0x10aa08=_0x4201c9[_0xb151('0x58')]-_0x3ac143[0x0][_0xb151('0x1f9')];var _0x4c9343=_0x4201c9[_0xb151('0x1e3')]*0x3c;var _0x232cf0=_0x3c3cbf[0x0][_0xb151('0x77')]+_0x3c3cbf[0x0][_0xb151('0x76')];var _0x316e8b=(_0x3c3cbf[0x0][_0xb151('0x75')]+_0x3c3cbf[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x3c3cbf[0x0][_0xb151('0x78')])/_0x3c3cbf[0x0][_0xb151('0x8a')];var _0x38b1b6=_0x4201c9[_0xb151('0x1da')]/0x64;_0x4201c9[_0xb151('0x7c')]=_0x3ac143[0x0]['outboundQueuePauses']||0x0;_0x4201c9[_0xb151('0x1df')]=_0x316e8b>0x0?_0x316e8b:0x1;return _0x359b76[_0xb151('0x1f4')](_0x10aa08,_0x4c9343,_0x232cf0,_0x316e8b,_0x38b1b6);})[_0xb151('0x40')](function(_0x185841){return _0x296bce(_0x185841);})[_0xb151('0xbb')](function(_0x1e7912){return _0x4e7a27(msgResponse(_0xb151('0x1fa'),'Failure',JSON[_0xb151('0x50')](_0x1e7912)));});}if(_0x4201c9[_0xb151('0x1e5')]===_0xb151('0x1f5')){return _0x359b76['getVoiceQueueRtPauses'](_0x4201c9['id'])['then'](function(_0xb2e367){var _0x16d3aa=_0x4201c9[_0xb151('0x58')]-_0xb2e367[0x0][_0xb151('0x1f9')];var _0x380c70=_0x4201c9[_0xb151('0x1e3')]*0x3c;var _0x138c5a=_0x3c3cbf[0x0]['predictiveIntervalAvgTalktime']+_0x3c3cbf[0x0][_0xb151('0x76')];var _0x37b721=(_0x3c3cbf[0x0][_0xb151('0x75')]+_0x3c3cbf[0x0][_0xb151('0x79')]+_0x3c3cbf[0x0][_0xb151('0x78')])/_0x3c3cbf[0x0][_0xb151('0x8a')];var _0x2c3215=_0x4201c9['dialPredictiveOptimizationPercentage']/0x64;_0x4201c9[_0xb151('0x7c')]=_0xb2e367[0x0]['outboundQueuePauses']||0x0;_0x4201c9[_0xb151('0x1df')]=_0x37b721>0x0?_0x37b721:0x1;return _0x359b76['busyFactor'](_0x16d3aa,_0x380c70,_0x138c5a,_0x37b721,_0x2c3215);})[_0xb151('0x40')](function(_0x12ee34){return _0x296bce(_0x12ee34);})[_0xb151('0xbb')](function(_0x31a5b7){return _0x4e7a27(msgResponse(_0xb151('0x1fa'),_0xb151('0x157'),JSON[_0xb151('0x50')](_0x31a5b7)));});}}else{return _0x4e7a27(msgResponse(_0xb151('0x1f7'),_0xb151('0x157'),'check\x20failure'));}});};};Dialer[_0xb151('0x1a')][_0xb151('0x1ee')]=function(_0x31f210){var _0x266e17=this;return function(){var _0x430990=0x0;var _0x3e7277=Math['floor'](_0x31f210[_0xb151('0x7f')]*0x3e8);if(_0x3e7277>0x0){_0x3e7277=_0x3e7277<0x64?0x64:_0x3e7277;loggerPredictive['info'](_0x31f210[_0xb151('0x44')],'one\x20call\x20every:',_0x3e7277,_0xb151('0x51'));_0x31f210[_0xb151('0x99')]=setInterval(function(){_0x266e17[_0xb151('0x99')](_0x31f210);loggerPredictiveCalls['info'](_0xb151('0x1fb'),_0x430990+=0x1);},_0x3e7277);}else{loggerPredictive[_0xb151('0x87')](_0x31f210[_0xb151('0x44')],_0xb151('0x1fc'));}};};Dialer[_0xb151('0x1a')][_0xb151('0x1fd')]=function(_0xf84950,_0x5d70a1){var _0x14e7ec=this;return function(_0xd37eb1){if(_['isEmpty'](_0xd37eb1)){if(_[_0xb151('0xef')](_0x5d70a1[_0xb151('0x1fe')])||!_0x5d70a1['recallme']){if(_0xf84950[_0xb151('0x64')]==='booked'){_0xf84950[_0xb151('0x141')]=_[_0xb151('0x42')](_0xf84950[_0xb151('0x141')])?!![]:_0xf84950[_0xb151('0x141')];var _0x47ea29=uuid['v4']();_0x14e7ec[_0xb151('0x23')][_0x47ea29]=new Action(_0xf84950,_0x5d70a1,_0x47ea29);loggerBooked[_0xb151('0x87')](_0xb151('0x1ff'),_0x47ea29,'queueStatusComplete:\x20',JSON[_0xb151('0x50')](_0xf84950[_0xb151('0x141')]),'Queue:\x20',_0xf84950[_0xb151('0x44')]);if(_0xf84950[_0xb151('0x141')]){_0xf84950[_0xb151('0x141')]=![];_0x14e7ec[_0xb151('0x2a')][_0x14e7ec['actions'][_0x47ea29][_0xb151('0xbf')]]=[];ami[_0xb151('0xb8')]({'actionid':_0x47ea29,'action':_0xb151('0x200'),'queue':_0xf84950[_0xb151('0x44')]})[_0xb151('0xbb')](function(){_0x14e7ec[_0xb151('0xbd')](_0xf84950);_0x14e7ec[_0xb151('0xce')]({'active':![],'ContactId':_0x14e7ec[_0xb151('0x23')][_0x47ea29][_0xb151('0xe4')],'ListId':_0x14e7ec[_0xb151('0x23')][_0x47ea29][_0xb151('0xe5')],'VoiceQueueId':_0x14e7ec[_0xb151('0x23')][_0x47ea29][_0xb151('0xe6')]||undefined,'CampaignId':_0x14e7ec['actions'][_0x47ea29][_0xb151('0xe7')]||undefined})[_0xb151('0xbb')](loggerCatch(_0xb151('0x201')));delete _0x14e7ec[_0xb151('0x23')][_0x47ea29];});}else{loggerBooked[_0xb151('0x87')](_0xb151('0x202'),JSON['stringify'](_0xf84950[_0xb151('0x141')]),_0xb151('0x203'),_0xf84950[_0xb151('0x44')]);_0x14e7ec[_0xb151('0xbd')](_0xf84950);_0x14e7ec[_0xb151('0xce')]({'active':![],'ContactId':_0x14e7ec['actions'][_0x47ea29][_0xb151('0xe4')],'ListId':_0x14e7ec['actions'][_0x47ea29][_0xb151('0xe5')],'VoiceQueueId':_0x14e7ec[_0xb151('0x23')][_0x47ea29][_0xb151('0xe6')]||undefined,'CampaignId':_0x14e7ec[_0xb151('0x23')][_0x47ea29]['CampaignId']||undefined})[_0xb151('0xbb')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x14e7ec[_0xb151('0x23')][_0x47ea29];}}else{return _0x14e7ec['actionOriginate'](_0xf84950,_0x5d70a1);}}else{if(getDiff(_0x5d70a1[_0xb151('0x204')])<_0xf84950[_0xb151('0x205')]*0x3c){if(_0x5d70a1['Agent']&&!_0x5d70a1['Agent'][_0xb151('0x206')]){_0x14e7ec['preview'][_0xb151('0x144')](_0x5d70a1['id'])['finally'](function(){_0x14e7ec[_0xb151('0xbd')](_0xf84950);});}else{_0x14e7ec['unlockContact']({'active':![]},_0x5d70a1['id'],0x1)[_0xb151('0x145')](function(){_0x14e7ec[_0xb151('0xbd')](_0xf84950);});}}else{_0xf84950[_0xb151('0x72')]+=0x1;_0x14e7ec[_0xb151('0xbd')](_0xf84950);if(_0xf84950[_0xb151('0x207')]){_0x14e7ec[_0xb151('0xce')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5d70a1[_0xb151('0xe4')],'ListId':_0x5d70a1['ListId'],'VoiceQueueId':_0x5d70a1[_0xb151('0xe6')]||undefined,'CampaignId':_0x5d70a1[_0xb151('0xe7')]||undefined})[_0xb151('0xbb')](loggerCatch(_0xb151('0x208')));_0x14e7ec[_0xb151('0xdb')](createObjHistory(_0xf84950,_0x5d70a1,_0xb151('0x209'),0x17,'RecallInQueue'))['catch'](loggerCatch(_0xb151('0x20a')));}else{_0x14e7ec['saveInDb'](createObjHistory(_0xf84950,_0x5d70a1,_0xb151('0x20b'),0x16,_0xb151('0x20c')),_0xb151('0x20d'),_0xb151('0x20e'));}}}}else{_0xf84950[_0xb151('0x6a')]+=0x1;_0x14e7ec[_0xb151('0xe2')](createObjHistory(_0xf84950,_0x5d70a1,'BLACKLIST',0xd,'Blacklist'),_0xb151('0x20f'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer[_0xb151('0x1a')][_0xb151('0x210')]=function(_0x13560e){var _0x4ed1c6=this;var _0x1d9109=_0x13560e[_0xb151('0x211')]-_0x13560e[_0xb151('0xa1')]-_0x13560e[_0xb151('0xd3')];emitCampaignSummary(_0x13560e);if(_0x1d9109>0x0){if(_0x1d9109>this['maxNumberOriginate']){_0x1d9109=this[_0xb151('0x21')];}_0x13560e[_0xb151('0xd3')]+=_0x1d9109;this[_0xb151('0xd5')](_0x13560e['id'],_0x1d9109,_0x13560e[_0xb151('0x212')],_0x13560e)[_0xb151('0x40')](function(_0x3a0741){_0x13560e[_0xb151('0xd3')]-=_0x1d9109;_0x13560e[_0xb151('0xd3')]=_0x13560e[_0xb151('0xd3')]>0x0?_0x13560e[_0xb151('0xd3')]:0x0;if(!checkContactEmpty(_0x3a0741)){_0x13560e[_0xb151('0x48')]=_0xb151('0xa6');logger[_0xb151('0x87')](_0xb151('0x213')+_0x13560e[_0xb151('0x44')]);}else{_0x13560e[_0xb151('0xa1')]+=_0x3a0741[_0xb151('0xa0')];_0x13560e[_0xb151('0x48')]='RUNNING';for(var _0x195ec0=0x0;_0x195ec0<_0x3a0741[_0xb151('0xa0')];_0x195ec0+=0x1){_0x13560e[_0xb151('0x214')]+=0x1;if(_[_0xb151('0xef')](_0x3a0741[_0x195ec0])||_[_0xb151('0xef')](_0x3a0741[_0x195ec0][_0xb151('0x19f')])||_[_0xb151('0xef')](_0x3a0741[_0x195ec0]['phone'])){_0x4ed1c6[_0xb151('0xe0')](_0xb151('0x215'),_0x13560e,_0x3a0741[_0x195ec0]);}else{_0x4ed1c6[_0xb151('0xca')](_['pick'](_0x3a0741[_0x195ec0],['CampaignId',_0xb151('0x216')]))[_0xb151('0x40')](_0x4ed1c6[_0xb151('0x1fd')](_0x13560e,_0x3a0741[_0x195ec0]))['catch'](_0x4ed1c6[_0xb151('0xdf')](_0xb151('0x217'),_0x13560e));}}}})[_0xb151('0xbb')](loggerGetContactDialer(_0xb151('0x218'),_0x13560e,_0x1d9109));}};Dialer[_0xb151('0x1a')][_0xb151('0x16c')]=function(_0x16c0d3,_0x118633){var _0x616f65=this;var _0x2ed0a9=[];var _0x1067b5=_0x118633>=0x1?_0x118633:0x1;if(_0x16c0d3['dialMethod']===_0xb151('0x219')){_0x1067b5=0x1;}var _0x1196be=Math[_0xb151('0x1de')](_0x16c0d3[_0xb151('0x57')]*_0x1067b5)-_0x16c0d3[_0xb151('0xa1')]-_0x16c0d3[_0xb151('0xd3')];emitVoiceQueueSummary(_0x16c0d3);if(_0x16c0d3[_0xb151('0x21a')]>0x0){var _0x27925f=_0x16c0d3[_0xb151('0x21a')]-_0x16c0d3[_0xb151('0xa1')]-_0x16c0d3['talking']-_0x16c0d3[_0xb151('0xd3')]-_0x16c0d3[_0xb151('0x59')];if(_0x1196be>_0x27925f){_0x1196be=_0x27925f;}}if(_0x1196be>0x0){if(_0x16c0d3[_0xb151('0x64')]===_0xb151('0x219')){_0x1196be=0x1;}if(_0x1196be>this[_0xb151('0x21')]){_0x1196be=this[_0xb151('0x21')];}_0x16c0d3[_0xb151('0xd3')]+=_0x1196be;for(var _0x342fbd in this['agents']){if(typeof this[_0xb151('0x1f')][_0x342fbd]!=='undefined'){if(this[_0xb151('0x1f')][_0x342fbd][_0xb151('0xaf')]==='not_inuse'&&this[_0xb151('0x1f')][_0x342fbd][_0xb151('0xb9')]===_0xb151('0x178')){_0x2ed0a9['push'](this[_0xb151('0x1f')][_0x342fbd]['id']);}}}this['getContactDialer'](_0x16c0d3['id'],_0x2ed0a9,_0x1196be,_0x16c0d3[_0xb151('0x212')],_0x16c0d3)['then'](function(_0x132350){_0x16c0d3[_0xb151('0xd3')]-=_0x1196be;_0x16c0d3[_0xb151('0xd3')]=_0x16c0d3[_0xb151('0xd3')]>0x0?_0x16c0d3['temp']:0x0;if(!checkContactEmpty(_0x132350)){_0x616f65['countReScheduled'](_0x16c0d3)[_0xb151('0x40')](sendMessageReschedule(_0x16c0d3))[_0xb151('0xbb')](loggerCatch(_0xb151('0xc2')));}else{_0x16c0d3[_0xb151('0xa1')]+=_0x132350[_0xb151('0xa0')];_0x16c0d3[_0xb151('0x48')]=_0x16c0d3[_0xb151('0x64')]===_0xb151('0x219')?'ACTIVE':_0xb151('0x21b');for(var _0x2cd505=0x0;_0x2cd505<_0x132350['length'];_0x2cd505+=0x1){if(_['isNil'](_0x132350[_0x2cd505])||_[_0xb151('0xef')](_0x132350[_0x2cd505][_0xb151('0x19f')])||_['isNil'](_0x132350[_0x2cd505][_0xb151('0x1a8')])){_0x616f65[_0xb151('0xe0')](_0xb151('0x215'),_0x16c0d3,_0x132350[_0x2cd505]);}else{_0x616f65[_0xb151('0xc3')](_[_0xb151('0x13f')](_0x132350[_0x2cd505],['VoiceQueueId',_0xb151('0x216')]))[_0xb151('0x40')](_0x616f65[_0xb151('0x1fd')](_0x16c0d3,_0x132350[_0x2cd505]))[_0xb151('0xbb')](_0x616f65[_0xb151('0xdf')](_0xb151('0x215'),_0x16c0d3));}}}})['catch'](loggerGetContactDialer(_0xb151('0x21c'),_0x16c0d3,_0x1196be));}};Dialer[_0xb151('0x1a')][_0xb151('0x99')]=function(_0x1a100a){if(_0x1a100a[_0xb151('0x21a')]>0x0){var _0x2293ea=_0x1a100a[_0xb151('0x21a')]-_0x1a100a[_0xb151('0xa1')]-_0x1a100a['talking'];if(_0x2293ea>0x0){this['tryOriginatePredictive'](_0x1a100a);}else{loggerPredictiveCalls['info'](_0xb151('0x21d'));}}else{this[_0xb151('0x21e')](_0x1a100a);}};Dialer[_0xb151('0x1a')][_0xb151('0x21e')]=function(_0x1b42e0){var _0x4d6dd1=this;var _0x393607=[];_0x1b42e0['originated']+=0x1;for(var _0x351581 in this[_0xb151('0x1f')]){if(typeof this['agents'][_0x351581]!==_0xb151('0xa2')){if(this['agents'][_0x351581][_0xb151('0xaf')]==='not_inuse'&&this[_0xb151('0x1f')][_0x351581]['status']==='reachable'){_0x393607[_0xb151('0x13e')](this[_0xb151('0x1f')][_0x351581]['id']);}}}this[_0xb151('0xd2')](_0x1b42e0['id'],_0x393607,0x1,_0x1b42e0[_0xb151('0x212')],_0x1b42e0)[_0xb151('0x40')](function(_0x31bdf9){if(!checkContactEmpty(_0x31bdf9)){checkContactLowerLimitOriginate(_0x1b42e0,0x1,0x0);_0x4d6dd1[_0xb151('0xc1')](_0x1b42e0)['then'](sendMessageReschedule(_0x1b42e0))[_0xb151('0xbb')](loggerCatch(_0xb151('0xc2')));}else{_0x1b42e0[_0xb151('0x48')]=_0xb151('0x21b');if(_[_0xb151('0xef')](_0x31bdf9[0x0])||_[_0xb151('0xef')](_0x31bdf9[0x0]['Contact'])||_[_0xb151('0xef')](_0x31bdf9[0x0][_0xb151('0x1a8')])){_0x4d6dd1[_0xb151('0xe0')](_0xb151('0x215'),_0x1b42e0,_0x31bdf9[0x0]);}else{_0x4d6dd1[_0xb151('0xc3')](_['pick'](_0x31bdf9[0x0],[_0xb151('0xe6'),_0xb151('0x216')]))[_0xb151('0x40')](_0x4d6dd1[_0xb151('0x1fd')](_0x1b42e0,_0x31bdf9[0x0]))[_0xb151('0xbb')](_0x4d6dd1['loggerHandler'](_0xb151('0x21f'),_0x1b42e0));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x1b42e0,0x1));emitVoiceQueueSummary(_0x1b42e0);};Dialer[_0xb151('0x1a')]['abandonmentRate']=function(_0x374480,_0x56d4ee,_0x2e06ff,_0xd48997,_0x499da0,_0x1a18fe){loggerPredictive[_0xb151('0x87')](_0xb151('0x220'));loggerPredictive[_0xb151('0x87')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x374480);loggerPredictive['info'](_0xb151('0x221'),_0x56d4ee);loggerPredictive['info'](_0xb151('0x222'),_0x2e06ff);loggerPredictive[_0xb151('0x87')](_0xb151('0x223'),_0xd48997);loggerPredictive[_0xb151('0x87')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x499da0);loggerPredictive[_0xb151('0x87')](_0xb151('0x8f'));return new BPromise(function(_0x5a92bb,_0x22b5b3){if(_0x374480<=0x0||isNaN(_0x374480)){return _0x22b5b3(msgResponse(_0xb151('0x224'),_0xb151('0x4f'),_0xb151('0x225')+_0x374480));}if(_0x2e06ff<=0x0||isNaN(_0x2e06ff)){return _0x22b5b3(msgResponse(_0xb151('0x224'),_0xb151('0x4f'),_0xb151('0x226')+_0x2e06ff));}if(_0xd48997<=0x0||isNaN(_0xd48997)){return _0x22b5b3(msgResponse(_0xb151('0x224'),'Error',_0xb151('0x227')+_0xd48997));}if(_0x56d4ee<=0x0||isNaN(_0x56d4ee)){return _0x22b5b3(msgResponse(_0xb151('0x224'),'Error',_0xb151('0x228')+_0x56d4ee));}if(_0x499da0<=0x0||isNaN(_0x499da0)){return _0x22b5b3(msgResponse(_0xb151('0x224'),_0xb151('0x4f'),_0xb151('0x229')+_0x499da0));}_0x1a18fe=_0x1a18fe||0x0;var _0x582a4f=0x1/_0x2e06ff;var _0x1f52d3=0x0;var _0x4ea182=0x0;var _0x3d0547=0x0;var _0x57259d=0x0;for(var _0x21e97f=0x0;_0x3d0547<_0x499da0;_0x21e97f+=0x1){_0x4ea182=_0x21e97f/_0x56d4ee;_0x1f52d3=(_0xd48997*_0x4ea182+_0x1a18fe)/_0x582a4f;_0x3d0547=erlangb(_0x1f52d3,_0x374480);_0x57259d=_0x1f52d3/_0x374480*(0x1-erlangb(_0x1f52d3,_0x374480));}return _0x5a92bb({'erlangCalls':_0x21e97f,'erlangCallToSecond':_0x56d4ee/_0x21e97f,'erlangAbandonmentRate':_0x3d0547,'erlangBusyFactor':_0x57259d});});};Dialer[_0xb151('0x1a')][_0xb151('0x22a')]=function(_0x387ce2,_0x4fb721,_0x403f91,_0x2f609b,_0x38a6f7,_0x2280bf){loggerPredictive[_0xb151('0x87')](_0xb151('0x22b'));loggerPredictive[_0xb151('0x87')](_0xb151('0x22c'),_0x387ce2);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4fb721);loggerPredictive[_0xb151('0x87')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x403f91);loggerPredictive[_0xb151('0x87')]('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2f609b);loggerPredictive['info'](_0xb151('0x22d'),_0x38a6f7);loggerPredictive[_0xb151('0x87')](_0xb151('0x8f'));return new BPromise(function(_0x47431a,_0x366925){if(_0x387ce2<=0x0||isNaN(_0x387ce2)){return _0x366925(msgResponse(_0xb151('0x22e'),_0xb151('0x4f'),_0xb151('0x225')+_0x387ce2));}if(_0x403f91<=0x0||isNaN(_0x403f91)){return _0x366925(msgResponse(_0xb151('0x22e'),_0xb151('0x4f'),_0xb151('0x226')+_0x403f91));}if(_0x2f609b<=0x0||isNaN(_0x2f609b)){return _0x366925(msgResponse(_0xb151('0x22e'),_0xb151('0x4f'),_0xb151('0x227')+_0x2f609b));}if(_0x4fb721<=0x0||isNaN(_0x4fb721)){return _0x366925(msgResponse('[busyFactor]',_0xb151('0x4f'),_0xb151('0x228')+_0x4fb721));}if(_0x38a6f7<=0x0||isNaN(_0x38a6f7)){return _0x366925(msgResponse(_0xb151('0x22e'),'Error','Umin\x20=\x20'+_0x38a6f7));}_0x2280bf=_0x2280bf||0x0;var _0x171935=0x1/_0x403f91;var _0x496576=0x0;var _0x22c3ac=0x0;var _0x1fe478=0x0;var _0x3b2a5a=0x0;for(var _0x24f159=0x0;_0x3b2a5a<_0x38a6f7;_0x24f159+=0x1){_0x22c3ac=_0x24f159/_0x4fb721;_0x496576=(_0x2f609b*_0x22c3ac+_0x2280bf)/_0x171935;_0x1fe478=erlangb(_0x496576,_0x387ce2);_0x3b2a5a=_0x496576/_0x387ce2*(0x1-erlangb(_0x496576,_0x387ce2));}return _0x47431a({'erlangCalls':_0x24f159,'erlangCallToSecond':_0x4fb721/_0x24f159,'erlangAbandonmentRate':_0x1fe478,'erlangBusyFactor':_0x3b2a5a});});};module[_0xb151('0x22f')]=Dialer;
\ No newline at end of file
+var _0xde13=['pick','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','isTrunkReachable','SIP/%s','unmonitored','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','uniqueid','outboundAnswerCallsDay','HangupInAMD','membername','emit','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','statedesc','Machine','AMD','countmachineretry','countglobal','amd','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','ContactId','ListId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countnosuchnumberretry','countdropretry','countagentrejectretry','reason\x2019\x20machine....','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','outboundUnknownCallsDay','cause-txt','Unknow','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2','voiceQueue','additional','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','Abandoned','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','add','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','locked','paused','stateinterface','queueBooked','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','syncQueueStatusComplete','[unlock][syncQueueStatusComplete]','rrmemory','_rr','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','run','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','loopCampaigns','syncCampaigns','checkIsTrunkReachable','TrunkBackup','checkIfTime','ifTime','checkIfTimeIntervals','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','iftime\x20%s,%s','interval','true','content','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','power','dialPowerLevel','launchHandleIvr','handleIvr','dialActive','dialTimezone','syncQueueSummaryComplete','throttle','filter','dialPreviewRecallmeReminder','handlePreviewRecallNotifications','map','Agent','user:%s','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','Contact','tags','createdAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','SIP/%s/%s%s','dialCutDigit','substring','trim','outboundOriginateFailureCallsDay','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','response','callProgressDetecting','[callProgressDetecting]\x20','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','dialNoSuchNumberRetryFrequency','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','checkRetriveMax','Busy','custom:agentbusy','busy','dialBusyRetryFrequency','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','dialAgentRejectRetryFrequency','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','[CatchErlangB]','[handlePredictive]','checkContactBlack','UserId','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','voicePause','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','push','dialOrderByScheduledAt','[countReScheduled]\x20','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','util','lodash','bluebird','uuid','moment','ioredis','../preview/util/util','../../../config/environment/','dialer','booked','../../../config/logger','predictive','syncQueueSummary','../ami','localhost','socket.io-emitter','redis','../rpc/cmHopperHistory','../rpc/cmHopperFinal','../rpc/cmHopperAdditionalPhone','../rpc/setting','./agentComplete','./queueCallerAbandon','./hangup','env','127.0.0.1','roundrobin','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','startPredictive','startProgressive','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','INTERVAL_IS_NULL','isEmpty','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','Trunk','active','callerid','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','info','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22\x22\x20<>','debug','inspect','error','stack','length','undefined','contactsRescheduled','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','endtime','clearZombieChannels','[actions]','prototype','isNil','Action','status','catch','No\x20such\x20channel','updateOriginated','queue','resolve','countReScheduled','checkIsBlackList','[checkIsBlackList]\x20','verifyAdditionalPhones','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','merge'];(function(_0x4a5f32,_0x5b12b9){var _0x57b347=function(_0x269b0c){while(--_0x269b0c){_0x4a5f32['push'](_0x4a5f32['shift']());}};_0x57b347(++_0x5b12b9);}(_0xde13,0x146));var _0x3de1=function(_0x4f5ca4,_0x41d63b){_0x4f5ca4=_0x4f5ca4-0x0;var _0x295f87=_0xde13[_0x4f5ca4];return _0x295f87;};'use strict';var util=require(_0x3de1('0x0'));var _=require(_0x3de1('0x1'));var BPromise=require(_0x3de1('0x2'));var uuid=require(_0x3de1('0x3'));var moment=require(_0x3de1('0x4'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x3de1('0x5'));var ut=require(_0x3de1('0x6'));var config=require(_0x3de1('0x7'));var logger=require('../../../config/logger')(_0x3de1('0x8'));var loggerBooked=require('../../../config/logger')(_0x3de1('0x9'));var loggerPredictive=require(_0x3de1('0xa'))(_0x3de1('0xb'));var loggerPredictiveCalls=require(_0x3de1('0xa'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x3de1('0xa'))(_0x3de1('0xc'));var ami=require(_0x3de1('0xd'));config['redis']=_['defaults'](config['redis'],{'host':_0x3de1('0xe'),'port':0x18eb});var io=require(_0x3de1('0xf'))(new Redis(config[_0x3de1('0x10')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x3de1('0x11'));var cmHopperFinal=require(_0x3de1('0x12'));var cmHopperAdditionalPhone=require(_0x3de1('0x13'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require(_0x3de1('0x14'));var Action=require('./action');var History=require('./history');var Final=require('./final');var AgentComplete=require(_0x3de1('0x15'));var QueueCallerAbandon=require(_0x3de1('0x16'));var Hangup=require(_0x3de1('0x17'));var ipAgi=process[_0x3de1('0x18')]['XCALLY_IP_AGI']||_0x3de1('0x19');var strategy={'rrmemory':'rrmemory','roundrobin':_0x3de1('0x1a')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0x3de1('0x1b')]=function(_0x14156f){this[_0x3de1('0x1c')]=this['tail']?this[_0x3de1('0x1c')][_0x3de1('0x1d')](_0x14156f):_0x14156f();};function Dialer(_0x114d62,_0x2cf3e1){this[_0x3de1('0x1e')]=new Sequence();this['preview']=_0x2cf3e1;this[_0x3de1('0x1f')]=_0x114d62['voiceQueues'];this[_0x3de1('0x20')]=_0x114d62[_0x3de1('0x20')];this['agents']=_0x114d62[_0x3de1('0x21')];this['trunks']=_0x114d62[_0x3de1('0x22')];this[_0x3de1('0x23')]=config[_0x3de1('0x23')]||0x2;this['channels']={};this[_0x3de1('0x24')]={};this[_0x3de1('0x25')]={};this[_0x3de1('0x26')]={};this['optionPredictive']={};this[_0x3de1('0x27')]={};this[_0x3de1('0x28')]={};this['ivrOriginated']={};this['queueBooked']={};this[_0x3de1('0x29')]={};ami['on'](_0x3de1('0x2a'),this[_0x3de1('0x2b')][_0x3de1('0x2c')](this));ami['on'](_0x3de1('0x2d'),this[_0x3de1('0x2e')][_0x3de1('0x2c')](this));ami['on'](_0x3de1('0x2f'),this['syncOriginateResponse']['bind'](this));ami['on'](_0x3de1('0x30'),this[_0x3de1('0x31')][_0x3de1('0x2c')](this));ami['on'](_0x3de1('0x32'),this[_0x3de1('0xc')]['bind'](this));ami['on'](_0x3de1('0x33'),this['syncQueueSummaryComplete']['bind'](this));ami['on'](_0x3de1('0x34'),this[_0x3de1('0x35')][_0x3de1('0x2c')](this));ami['on'](_0x3de1('0x36'),this[_0x3de1('0x37')][_0x3de1('0x2c')](this));ami['on'](_0x3de1('0x38'),this[_0x3de1('0x39')][_0x3de1('0x2c')](this));ami['on'](_0x3de1('0x3a'),this[_0x3de1('0x3b')][_0x3de1('0x2c')](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0x3de1('0x2c')](this));this['loopCampaigns']();this[_0x3de1('0x3c')]();RpcSetting[_0x3de1('0x3d')]()[_0x3de1('0x3e')](function(_0x57ce4a){previewRecallmeReminderInterval=_0x57ce4a[_0x3de1('0x3f')];});}function isNotNull(_0x228195){return _0x228195!==null&&!_[_0x3de1('0x40')](_0x228195);}function checkIsLoggedIn(_0x370087,_0x43496a){return function(){if(_0x43496a<=0x0){_0x370087[_0x3de1('0x41')]=_0x3de1('0x42');throw _0x370087[_0x3de1('0x43')]+_0x3de1('0x44');}};}function isActive(_0x2cf815){return _0x2cf815;}function checkIsActive(_0x24fa5b,_0x28e1d2){return function(){if(!isActive(_0x28e1d2)){_0x24fa5b['message']='NOT_ACTIVE';throw _0x24fa5b['name']+_0x3de1('0x45');}};}function checkInterval(_0x1eef72){return function(){if(!isNotNull(_0x1eef72[_0x3de1('0x46')])){_0x1eef72[_0x3de1('0x41')]='INTERVAL_IS_NULL';throw _0x1eef72['name']+_0x3de1('0x47');}if(!isNotNull(_0x1eef72['Interval']['Intervals'])){_0x1eef72[_0x3de1('0x41')]=_0x3de1('0x48');throw _0x1eef72['name']+_0x3de1('0x47');}if(!isNotNull(_[_0x3de1('0x49')](_0x1eef72[_0x3de1('0x46')][_0x3de1('0x4a')]))){_0x1eef72[_0x3de1('0x41')]='INTERVAL_IS_NULL';throw _0x1eef72[_0x3de1('0x43')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x23cc71,_0x336480,_0x324df5){return{'action':_0x23cc71,'response':_0x336480,'message':_0x324df5,'stack':_0x324df5};}function myreject(_0x2036d1){return function(_0xce13d8){return _0x2036d1(msgResponse(_0x3de1('0x4b'),_0x3de1('0x4c'),JSON[_0x3de1('0x4d')](_0xce13d8)));};}function getSeconds(_0x643035,_0x5e5e12){var _0x27d15f=moment(_0x643035)['milliseconds'](0x0);var _0x17b1ee=moment(_0x5e5e12)[_0x3de1('0x4e')](0x0);return _0x27d15f[_0x3de1('0x4f')](_0x17b1ee,_0x3de1('0x50'));}function emit(_0x1abf54,_0x40f7fa,_0x363556){io['to'](_0x1abf54)['emit'](_0x40f7fa,_0x363556);}function emitVoiceQueueSummary(_0x2f2883){if(_0x2f2883[_0x3de1('0x51')]===_0x3de1('0x52')){var _0x17d742={'id':_0x2f2883['id'],'name':_0x2f2883[_0x3de1('0x43')],'strategy':_0x2f2883[_0x3de1('0x53')],'answered':_0x2f2883['answered'],'available':_0x2f2883[_0x3de1('0x54')],'loggedIn':_0x2f2883[_0x3de1('0x55')],'pTalking':_0x2f2883[_0x3de1('0x56')],'sumBillable':_0x2f2883[_0x3de1('0x57')],'sumDuration':_0x2f2883[_0x3de1('0x58')],'sumHoldTime':_0x2f2883[_0x3de1('0x59')]||0x0,'talking':_0x2f2883[_0x3de1('0x5a')],'total':_0x2f2883[_0x3de1('0x5b')],'type':_0x2f2883[_0x3de1('0x51')],'unmanaged':_0x2f2883['unmanaged'],'abandoned':_0x2f2883[_0x3de1('0x5c')],'waiting':_0x2f2883[_0x3de1('0x5d')],'loggedInDb':_0x2f2883['loggedInDb'],'dialActive':_0x2f2883['dialActive'],'dialMethod':_0x2f2883[_0x3de1('0x5e')],'dialOriginateCallerIdName':_0x2f2883[_0x3de1('0x5f')],'dialOriginateCallerIdNumber':_0x2f2883['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x2f2883['dialOriginateTimeout'],'dialPrefix':_0x2f2883[_0x3de1('0x60')],'outboundAnswerAgiCallsDay':_0x2f2883[_0x3de1('0x61')],'outboundAnswerCallsDay':_0x2f2883['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x2f2883[_0x3de1('0x62')],'outboundBusyCallsDay':_0x2f2883[_0x3de1('0x63')],'outboundCongestionCallsDay':_0x2f2883[_0x3de1('0x64')],'outboundDropCallsDayACS':_0x2f2883['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x2f2883[_0x3de1('0x65')],'outboundDropCallsDayTimeout':_0x2f2883[_0x3de1('0x66')],'outboundNoAnswerCallsDay':_0x2f2883[_0x3de1('0x67')],'outboundNoSuchCallsDay':_0x2f2883['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x2f2883['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x2f2883[_0x3de1('0x68')],'outboundRejectCallsDay':_0x2f2883[_0x3de1('0x69')],'outboundUnknownCallsDay':_0x2f2883['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x2f2883[_0x3de1('0x6a')],'predictiveIntervalAvgHoldtime':_0x2f2883[_0x3de1('0x6b')],'predictiveIntervalAvgTalktime':_0x2f2883[_0x3de1('0x6c')],'predictiveIntervalDroppedCallsCallersExit':_0x2f2883[_0x3de1('0x6d')],'predictiveIntervalDroppedCallsTimeout':_0x2f2883[_0x3de1('0x6e')],'predictiveIntervalErlangCalls':_0x2f2883[_0x3de1('0x6f')],'predictiveIntervalErlangCallsDroppedCalls':_0x2f2883[_0x3de1('0x70')],'predictiveIntervalHitRate':_0x2f2883[_0x3de1('0x71')],'predictiveIntervalMultiplicativeFactor':_0x2f2883['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x2f2883[_0x3de1('0x72')],'predictiveIntervalAvailable':_0x2f2883[_0x3de1('0x73')],'predictiveIntervalTotalCalls':_0x2f2883['predictiveIntervalTotalCalls'],'message':_0x2f2883['message'],'originated':_0x2f2883[_0x3de1('0x74')],'erlangCalls':_0x2f2883[_0x3de1('0x75')],'erlangCallToSecond':_0x2f2883[_0x3de1('0x76')],'erlangAbandonmentRate':_0x2f2883[_0x3de1('0x77')],'erlangBusyFactor':_0x2f2883['erlangBusyFactor'],'startPredictive':_0x2f2883['startPredictive'],'startProgressive':_0x2f2883['startProgressive']};if(_0x2f2883[_0x3de1('0x78')]){_0x17d742[_0x3de1('0x78')]={'id':_0x2f2883[_0x3de1('0x78')]['id'],'name':_0x2f2883['Trunk'][_0x3de1('0x43')],'active':_0x2f2883[_0x3de1('0x78')][_0x3de1('0x79')],'callerid':_0x2f2883[_0x3de1('0x78')][_0x3de1('0x7a')]};}if(_0x2f2883['Interval']){_0x17d742[_0x3de1('0x46')]={'id':_0x2f2883[_0x3de1('0x46')]['id'],'name':_0x2f2883[_0x3de1('0x46')][_0x3de1('0x43')]};}var _0x75ab6c=md5(JSON[_0x3de1('0x4d')](_0x17d742));if(_0x2f2883[_0x3de1('0x7b')]!==_0x75ab6c){_0x2f2883[_0x3de1('0x7b')]=_0x75ab6c;emit(util[_0x3de1('0x7c')](_0x3de1('0x7d'),_0x17d742[_0x3de1('0x43')]),_0x3de1('0x7e'),_0x17d742);}}}function emitCampaignSummary(_0x101fd7){if(_0x101fd7[_0x3de1('0x51')]===_0x3de1('0x7f')){emit(util[_0x3de1('0x7c')](_0x3de1('0x80'),_0x101fd7[_0x3de1('0x43')]),_0x3de1('0x81'),_0x101fd7);}}function checkGetDataPredictive(_0x38306e){if(isNotNull(_0x38306e)&&!_[_0x3de1('0x49')](_0x38306e)){loggerPredictive['info'](_0x3de1('0x82'));loggerPredictive[_0x3de1('0x83')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x38306e[_0x3de1('0x84')]);loggerPredictive[_0x3de1('0x83')](_0x3de1('0x85'),_0x38306e[_0x3de1('0x6a')]);loggerPredictive[_0x3de1('0x83')](_0x3de1('0x86'),_0x38306e[_0x3de1('0x6e')]);loggerPredictive[_0x3de1('0x83')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x38306e[_0x3de1('0x6d')]);loggerPredictive[_0x3de1('0x83')](_0x3de1('0x87'),_0x38306e[_0x3de1('0x6b')]);loggerPredictive[_0x3de1('0x83')](_0x3de1('0x88'),_0x38306e[_0x3de1('0x6c')]);loggerPredictive[_0x3de1('0x83')](_0x3de1('0x89'));if(_0x38306e[_0x3de1('0x84')]>0x0){if(!_[_0x3de1('0x40')](_0x38306e['predictiveIntervalAvgTalktime'])&&_0x38306e[_0x3de1('0x6c')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x3de1('0x40')](_0x38306e[_0x3de1('0x6b')])&&_0x38306e['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info'](_0x3de1('0x8a'));}else{loggerPredictive[_0x3de1('0x83')](_0x3de1('0x8b'));}}else{loggerPredictive[_0x3de1('0x83')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x4fa704){return function(_0x33c34d){loggerPredictive[_0x3de1('0x83')](_0x3de1('0x8c'));loggerPredictive[_0x3de1('0x83')](_0x3de1('0x8d'),_0x33c34d['erlangCalls']);loggerPredictive[_0x3de1('0x83')](_0x3de1('0x8e'),_0x33c34d['erlangCallToSecond']);loggerPredictive[_0x3de1('0x83')](_0x3de1('0x8f'),_0x33c34d[_0x3de1('0x77')]);loggerPredictive[_0x3de1('0x83')](_0x3de1('0x90'),_0x33c34d[_0x3de1('0x91')]);loggerPredictive[_0x3de1('0x83')](_0x3de1('0x8f'),_0x33c34d[_0x3de1('0x77')]);loggerPredictive['info']('---------------------------');_['merge'](_0x4fa704,_0x33c34d);};}function getDiff(_0x5b24a6){var _0x228eed=moment()[_0x3de1('0x4e')](0x0);var _0x3d116a=moment(_0x5b24a6)[_0x3de1('0x4e')](0x0);return _0x228eed[_0x3de1('0x4f')](_0x3d116a,_0x3de1('0x50'));}function ifInterval(_0x283730,_0x5b5942){if(_[_0x3de1('0x40')](_0x5b5942)){return![];}return getDiff(_0x5b5942)<_0x283730*0x3c;}function freeVariablesPredictive(_0xc7cd08){if(isNotNull(_0xc7cd08)){if(!_[_0x3de1('0x40')](_0xc7cd08['startProgressive'])){_0xc7cd08[_0x3de1('0x28')]=undefined;loggerPredictive[_0x3de1('0x83')](_0xc7cd08[_0x3de1('0x43')],'clearing\x20variable\x20start\x20progressive');}if(!_['isUndefined'](_0xc7cd08[_0x3de1('0x27')])){_0xc7cd08[_0x3de1('0x27')]=undefined;loggerPredictive[_0x3de1('0x83')](_0xc7cd08[_0x3de1('0x43')],'clearing\x20variable\x20start\x20predictive');}if(!_['isUndefined'](_0xc7cd08[_0x3de1('0x92')])){clearInterval(_0xc7cd08[_0x3de1('0x92')]);_0xc7cd08[_0x3de1('0x92')]=undefined;loggerPredictive['info'](_0xc7cd08[_0x3de1('0x43')],_0x3de1('0x93'));}}}function erlangb(_0x41b7f5,_0x1b9c81){if(_0x1b9c81===0x0){return 0x0;}var _0x4b1c12=0x1;for(var _0x249945=0x1;_0x249945<=_0x1b9c81;_0x249945+=0x1){_0x4b1c12=0x1+_0x4b1c12*_0x249945/_0x41b7f5;}return 0x1/_0x4b1c12;}function isVoiceQueueOutbound(_0x172ec7){return _0x172ec7===_0x3de1('0x52');}function isNotPreview(_0xfae98e){return _0xfae98e!==_0x3de1('0x94');}function isCampaignIvr(_0x28edf4){return _0x28edf4===_0x3de1('0x7f');}function getCallerId(_0x3da1ed,_0x5a1559,_0x53c39d){if(!_['isUndefined'](_0x53c39d)&&typeof _0x53c39d==='string'&&!_['isEmpty'](_0x53c39d)){if(!_[_0x3de1('0x40')](_0x5a1559)&&typeof _0x5a1559===_0x3de1('0x95')&&!_['isEmpty'](_0x5a1559)){return util[_0x3de1('0x7c')]('\x22%s\x22\x20<%s>',_0x5a1559,_0x53c39d);}return util[_0x3de1('0x7c')]('\x22%s\x22\x20<%s>',_0x53c39d,_0x53c39d);}if(!_[_0x3de1('0x40')](_0x3da1ed)&&typeof _0x3da1ed===_0x3de1('0x95')&&!_[_0x3de1('0x49')](_0x3da1ed)){return _0x3da1ed;}return _0x3de1('0x96');}function loggerCatchQueueSummary(_0x52e7e1,_0x25c87c){return function(_0x5ef96d){freeVariablesPredictive(_0x25c87c);emitVoiceQueueSummary(_0x25c87c);emitCampaignSummary(_0x25c87c);loggerSyncQueueSummary[_0x3de1('0x97')](_0x52e7e1,util[_0x3de1('0x98')](_0x5ef96d,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x56d32c,_0x5dadb1){return function(_0x13d9e4){loggerPredictive['error'](_0x5dadb1[_0x3de1('0x43')],_0x56d32c);loggerPredictive[_0x3de1('0x99')](_0x13d9e4[_0x3de1('0x9a')]);freeVariablesPredictive(_0x5dadb1);};}function loggerCatch(_0x36f711){return function(_0x236683){logger['error'](_0x36f711,util[_0x3de1('0x98')](_0x236683,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5443b1){return _0x5443b1&&!_['isUndefined'](_0x5443b1)&&_0x5443b1[_0x3de1('0x9b')]>0x0;}function decremetOriginate(_0x5cf192){if(!_[_0x3de1('0x40')](_0x5cf192)&&_0x5cf192!==null){if(typeof _0x5cf192[_0x3de1('0x74')]!==_0x3de1('0x9c')){if(_0x5cf192[_0x3de1('0x74')]>0x0){_0x5cf192[_0x3de1('0x74')]-=0x1;}else{logger[_0x3de1('0x99')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x3de1('0x99')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x14e4f1,_0x16c891,_0xa3be2e){if(_0x16c891>_0xa3be2e){for(var _0x203ca3=0x0;_0x203ca3<_0x16c891-_0xa3be2e;_0x203ca3+=0x1){decremetOriginate(_0x14e4f1);}}}function loggerGetContactDialer(_0x7d233e,_0x1b8097,_0x10bdfc){return function(_0xeb8598){checkContactLowerLimitOriginate(_0x1b8097,_0x10bdfc,0x0);logger[_0x3de1('0x99')](_0x7d233e,util['inspect'](_0xeb8598,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x170078){return function(_0x406a56){if(isNotNull(_0x406a56)&&isNotNull(_0x406a56[0x0])){if(_0x406a56[0x0][_0x3de1('0x9d')]>0x0){_0x170078[_0x3de1('0x41')]='RESCHEDULED_CONTACTS';logger['info']('[getContactDialer2][ReScheduled]'+_0x170078[_0x3de1('0x43')],_0x406a56[0x0][_0x3de1('0x9d')],'contacts');}else{_0x170078[_0x3de1('0x41')]=_0x3de1('0x9e');logger[_0x3de1('0x83')](_0x3de1('0x9f')+_0x170078['name']);}}};}function notSendMessagesQueue(_0x26d7df){if(_0x26d7df[_0x3de1('0xa0')]){freeVariablesPredictive(_0x26d7df);if(_0x26d7df[_0x3de1('0x74')]===0x0&&_0x26d7df['talking']===0x0&&_0x26d7df[_0x3de1('0x5d')]===0x0&&(_0x26d7df[_0x3de1('0x56')]||0x0)===0x0){_0x26d7df[_0x3de1('0xa0')]=![];_0x26d7df[_0x3de1('0x54')]=0x0;_0x26d7df[_0x3de1('0x41')]=_0x3de1('0xa1');loggerSyncQueueSummary[_0x3de1('0x97')](_0x3de1('0xa2'),_0x26d7df[_0x3de1('0x43')],_0x3de1('0xa3'));}else{_0x26d7df['message']=_0x3de1('0xa4');loggerSyncQueueSummary[_0x3de1('0x97')](_0x3de1('0xa2'),_0x26d7df[_0x3de1('0x43')],_0x3de1('0xa5'));}emitVoiceQueueSummary(_0x26d7df);}}function notSendMessagesCampaign(_0xbb22a5){if(_0xbb22a5[_0x3de1('0xa0')]){if(_0xbb22a5[_0x3de1('0x74')]===0x0){_0xbb22a5[_0x3de1('0xa0')]=![];_0xbb22a5[_0x3de1('0x41')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x3de1('0x97')](_0x3de1('0xa6'),_0xbb22a5[_0x3de1('0x43')],'is\x20not\x20active');}else{_0xbb22a5[_0x3de1('0x41')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x3de1('0x97')](_0x3de1('0xa6'),_0xbb22a5[_0x3de1('0x43')],_0x3de1('0xa5'));}emitCampaignSummary(_0xbb22a5);}}function createObjHistory(_0x12c56c,_0xc1566e,_0xd2e955,_0x593153,_0x5800d8){_0x12c56c[_0x3de1('0x41')]=_0xd2e955;var _0x5441eb=new Action(_0x12c56c,_0xc1566e);var _0x278a69=new History(_0x5441eb);_0x278a69[_0x3de1('0xa7')]=_0x593153;_0x278a69['statedesc']=_0x5800d8;_0x278a69[_0x3de1('0xa8')]=_0x5441eb['starttime'];return _0x278a69;}Dialer['prototype'][_0x3de1('0x3c')]=function(){var _0x5b02f1=this;setInterval(function(){_0x5b02f1[_0x3de1('0xa9')](_0x5b02f1['uniqueId'],'[uniqueid]');_0x5b02f1[_0x3de1('0xa9')](_0x5b02f1[_0x3de1('0x24')],_0x3de1('0xaa'));},0x32c8);};Dialer[_0x3de1('0xab')][_0x3de1('0xa9')]=function(_0x4aff44,_0x46616e){var _0x56931b=this;for(var _0x3e5970 in _0x4aff44){if(typeof _0x4aff44[_0x3e5970]!==_0x3de1('0x9c')){this[_0x3de1('0x1e')][_0x3de1('0x1b')](function(){if(!_[_0x3de1('0xac')](_0x4aff44[_0x3e5970])){return ami[_0x3de1('0xad')]({'action':_0x3de1('0xae'),'channel':_0x4aff44[_0x3e5970]['channel']})[_0x3de1('0xaf')](function(_0x5bab14){if(_0x5bab14[_0x3de1('0x41')]===_0x3de1('0xb0')){setTimeout(function(){if(_0x4aff44[_0x3e5970]&&_0x4aff44[_0x3e5970][_0x3de1('0x51')]!=='ivr'){_0x56931b[_0x3de1('0xb1')](_0x56931b[_0x3de1('0x1f')][_0x4aff44[_0x3e5970][_0x3de1('0xb2')]]);logger[_0x3de1('0x99')]('[Dialer][checkChannel]',_0x46616e,_0x3e5970,_0x4aff44[_0x3e5970][_0x3de1('0xb2')]);delete _0x4aff44[_0x3e5970];}if(_0x4aff44[_0x3e5970]&&_0x4aff44[_0x3e5970]['type']==='ivr'){_0x56931b['updateOriginated'](_0x56931b[_0x3de1('0x20')][_0x4aff44[_0x3e5970][_0x3de1('0xb2')]]);logger[_0x3de1('0x99')]('[Dialer][checkChannel][ivr]',_0x46616e,_0x3e5970,_0x4aff44[_0x3e5970][_0x3de1('0xb2')]);delete _0x4aff44[_0x3e5970];}},0x2328);}});}});}}};Dialer[_0x3de1('0xab')]['countReScheduled']=function(_0xaaedbc){return BPromise[_0x3de1('0xb3')]()[_0x3de1('0x3e')](cmHopper[_0x3de1('0xb4')](_0xaaedbc))['catch'](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x3de1('0xab')][_0x3de1('0xb5')]=function(_0x2ee3e2){return BPromise[_0x3de1('0xb3')]()['then'](cmHopperBlack[_0x3de1('0xb5')](_0x2ee3e2))[_0x3de1('0xaf')](loggerCatch(_0x3de1('0xb6')));};Dialer['prototype'][_0x3de1('0xb7')]=function(_0x1acfe0,_0x492946,_0xa13a11){return BPromise['resolve']()[_0x3de1('0x3e')](cmHopperAdditionalPhone[_0x3de1('0xb7')](_0x1acfe0,_0x492946,_0xa13a11))[_0x3de1('0xaf')](loggerCatch('[verifyAdditionalPhone]\x20'));};Dialer[_0x3de1('0xab')]['swapAdditionalPhones']=function(_0x1d9afb,_0x750f87,_0x34dfbb){return BPromise[_0x3de1('0xb3')]()[_0x3de1('0x3e')](cmHopperAdditionalPhone[_0x3de1('0xb8')](_0x1d9afb,_0x750f87,_0x34dfbb))['catch'](loggerCatch(_0x3de1('0xb9')));};Dialer[_0x3de1('0xab')][_0x3de1('0xba')]=function(_0x393c56){return BPromise[_0x3de1('0xb3')]()['then'](cmHopperBlack[_0x3de1('0xba')](_0x393c56))['catch'](loggerCatch(_0x3de1('0xbb')));};Dialer[_0x3de1('0xab')][_0x3de1('0xbc')]=function(_0x29d368){return BPromise[_0x3de1('0xb3')]()['then'](cmHopperHistory[_0x3de1('0xbd')](_0x29d368))[_0x3de1('0xaf')](loggerCatch(_0x3de1('0xbe')));};Dialer[_0x3de1('0xab')][_0x3de1('0xbf')]=function(_0x344052){return BPromise['resolve']()['then'](cmHopper[_0x3de1('0xbf')](_0x344052))['catch'](loggerCatch(_0x3de1('0xc0')));};Dialer[_0x3de1('0xab')][_0x3de1('0xc1')]=function(_0x263cf8,_0x6538c1,_0x552d3f){return BPromise[_0x3de1('0xb3')]()['then'](cmHopper['unlockContact'](_0x263cf8,_0x6538c1,_0x552d3f))[_0x3de1('0xaf')](loggerCatch(_0x3de1('0xc2')));};Dialer[_0x3de1('0xab')][_0x3de1('0xc3')]=function(_0x19f0f0,_0x5d1e42,_0x36ebe3,_0x25253c,_0x18b5f3){return BPromise[_0x3de1('0xb3')]()['then'](cmHopper[_0x3de1('0xc3')](_0x19f0f0,_0x5d1e42,_0x36ebe3,_0x25253c))['catch'](function(_0x4746a7){_0x18b5f3[_0x3de1('0xc4')]-=_0x36ebe3;_0x18b5f3['temp']=_0x18b5f3[_0x3de1('0xc4')]>0x0?_0x18b5f3[_0x3de1('0xc4')]:0x0;loggerCatch(_0x3de1('0xc5'))(_0x4746a7);});};Dialer[_0x3de1('0xab')]['getContactDialerIvr']=function(_0x5ac4f8,_0x5c0987,_0x2823d0,_0x273292){return BPromise[_0x3de1('0xb3')]()[_0x3de1('0x3e')](cmHopper[_0x3de1('0xc6')](_0x5ac4f8,_0x5c0987,_0x2823d0))[_0x3de1('0xaf')](function(_0x513f6b){_0x273292[_0x3de1('0xc4')]-=_0x5c0987;_0x273292[_0x3de1('0xc4')]=_0x273292[_0x3de1('0xc4')]>0x0?_0x273292[_0x3de1('0xc4')]:0x0;loggerCatch(_0x3de1('0xc7'))(_0x513f6b);});};Dialer[_0x3de1('0xab')][_0x3de1('0xc8')]=function(_0x188f84){return BPromise['resolve']()[_0x3de1('0x3e')](voiceQueueRt['getVoiceQueueRtPauses'](_0x188f84))[_0x3de1('0xaf')](loggerCatch(_0x3de1('0xc9')));};Dialer[_0x3de1('0xab')]['moveContactManagedDialer']=function(_0x51ba3a){return BPromise[_0x3de1('0xb3')]()[_0x3de1('0x3e')](cmHopper[_0x3de1('0xca')](_0x51ba3a))[_0x3de1('0xaf')](loggerCatch(_0x3de1('0xcb')));};Dialer[_0x3de1('0xab')]['createHistory']=function(_0xc88892){return BPromise[_0x3de1('0xb3')]()[_0x3de1('0x3e')](cmHopperHistory[_0x3de1('0xcc')](_0xc88892))[_0x3de1('0xaf')](loggerCatch(_0x3de1('0xcd')));};Dialer[_0x3de1('0xab')][_0x3de1('0xb1')]=function(_0x35c211){if(!_[_0x3de1('0x40')](_0x35c211)&&_0x35c211!==null){if(typeof _0x35c211[_0x3de1('0x74')]!==_0x3de1('0x9c')){if(_0x35c211[_0x3de1('0x74')]>0x0){_0x35c211[_0x3de1('0x74')]-=0x1;}else{logger[_0x3de1('0x99')](_0x3de1('0xce'));}}}else{logger[_0x3de1('0x99')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0x3de1('0xab')][_0x3de1('0xcf')]=function(_0x5c4d35,_0x795439){var _0x27a16f=this;return function(_0x1f1651){_0x27a16f[_0x3de1('0xb1')](_0x795439);logger[_0x3de1('0x99')](_0x5c4d35,util[_0x3de1('0x98')](_0x1f1651,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x3de1('0xd0')]=function(_0x1d0764,_0x272a01,_0x1c0ac5){var _0x22bce7={'state':0x19,'statedesc':'notFound'};this[_0x3de1('0xb1')](_0x272a01);this['saveInDb'](_[_0x3de1('0xd1')](_0x22bce7,_[_0x3de1('0xd2')](_0x1c0ac5,['ContactId','ListId','UserId',_0x3de1('0xd3'),_0x3de1('0xd4')])),_0x3de1('0xd5'),'[emptyContact]');logger[_0x3de1('0x99')](_0x1d0764);};Dialer[_0x3de1('0xab')][_0x3de1('0xd6')]=function(_0x27c1f8){return _0x27c1f8===_0x3de1('0xd7');};Dialer[_0x3de1('0xab')][_0x3de1('0xd8')]=function(_0x5202d1){return!_['isUndefined'](_0x5202d1)&&_0x5202d1&&!_['isUndefined'](_0x5202d1[_0x3de1('0x43')])&&!_[_0x3de1('0x40')](_0x5202d1[_0x3de1('0x79')])&&_0x5202d1['active']&&(this['trunks'][util[_0x3de1('0x7c')](_0x3de1('0xd9'),_0x5202d1[_0x3de1('0x43')])][_0x3de1('0xae')]==='reachable'||this['trunks'][util[_0x3de1('0x7c')](_0x3de1('0xd9'),_0x5202d1['name'])][_0x3de1('0xae')]===_0x3de1('0xda'));};Dialer[_0x3de1('0xab')]['saveInDb']=function(_0x6ca5d7,_0x59e494,_0x17b2be){this[_0x3de1('0xcc')](_0x6ca5d7)[_0x3de1('0xaf')](loggerCatch(_0x59e494));this['moveContactManagedDialer'](_0x6ca5d7)['catch'](loggerCatch(_0x17b2be));};Dialer[_0x3de1('0xab')][_0x3de1('0x39')]=function(_0x352c6d){var _0x396d47=this['uniqueId'][_0x352c6d['uniqueid']];var _0x4058e1;if(!_['isNil'](_0x352c6d)&&!_[_0x3de1('0xac')](_0x352c6d[_0x3de1('0xdb')])&&!_[_0x3de1('0xac')](_0x352c6d[_0x3de1('0xdb')][_0x3de1('0xdc')])&&_0x352c6d[_0x3de1('0xdd')]===_0x3de1('0xde')&&_0x396d47){if(_0x396d47[_0x3de1('0x51')]!==_0x3de1('0x7f')&&this['voiceQueues'][_0x396d47[_0x3de1('0xb2')]][_0x3de1('0xdf')]&&_0x352c6d[_0x3de1('0xe0')]==='HANGUP'){delete this['uniqueId'][_0x352c6d[_0x3de1('0xe1')]];this[_0x3de1('0xb1')](this[_0x3de1('0x1f')][_0x396d47[_0x3de1('0xb2')]]);this[_0x3de1('0x1f')][_0x396d47[_0x3de1('0xb2')]][_0x3de1('0xe2')]+=0x1;this[_0x3de1('0x1f')][_0x396d47['queue']][_0x3de1('0x61')]+=0x1;_0x4058e1=new Hangup(_0x396d47,_0x352c6d);_0x4058e1[_0x3de1('0xa7')]=0x12;_0x4058e1['statedesc']=_0x3de1('0xe3');_0x4058e1[_0x3de1('0xe4')]='AMD';ami[_0x3de1('0xe5')](_0x3de1('0xe6'),ut[_0x3de1('0xe7')](_0x4058e1,'amd'));this[_0x3de1('0xe8')](_0x4058e1,_0x3de1('0xe9'),_0x3de1('0xea'));}if(_0x396d47[_0x3de1('0x51')]!==_0x3de1('0x7f')&&this[_0x3de1('0x1f')][_0x396d47[_0x3de1('0xb2')]]['dialAMDActive']&&_0x352c6d[_0x3de1('0xe0')]===_0x3de1('0xeb')){var _0x4ffef8=this;return new BPromise(function(_0x4aa84f,_0x4e956c){delete _0x4ffef8['uniqueId'][_0x352c6d[_0x3de1('0xe1')]];_0x4ffef8[_0x3de1('0xb1')](_0x4ffef8[_0x3de1('0x1f')][_0x396d47['queue']]);_0x4ffef8['voiceQueues'][_0x396d47[_0x3de1('0xb2')]][_0x3de1('0xe2')]+=0x1;_0x4ffef8['voiceQueues'][_0x396d47[_0x3de1('0xb2')]][_0x3de1('0x61')]+=0x1;var _0x4ba4e7=_0x4ffef8[_0x3de1('0x1f')][_0x396d47[_0x3de1('0xb2')]];var _0x29028a=new Hangup(_0x396d47,_0x352c6d);_0x29028a[_0x3de1('0xa7')]=0x13;_0x29028a[_0x3de1('0xec')]=_0x3de1('0xed');_0x29028a[_0x3de1('0xe4')]=_0x3de1('0xee');_0x29028a[_0x3de1('0xef')]+=0x1;_0x29028a[_0x3de1('0xf0')]+=0x1;_0x29028a[_0x3de1('0xf1')]=!![];ami[_0x3de1('0xe5')](_0x3de1('0xe6'),ut[_0x3de1('0xe7')](_0x29028a,_0x3de1('0xf1')));_0x4ffef8[_0x3de1('0xcc')](_0x29028a)[_0x3de1('0xaf')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x29028a[_0x3de1('0xf2')]+_0x29028a[_0x3de1('0xf3')]+_0x29028a[_0x3de1('0xf4')]+_0x29028a['countnosuchnumberretry']+_0x29028a['countdropretry']+_0x29028a[_0x3de1('0xf5')]+_0x29028a[_0x3de1('0xef')]+_0x29028a['countagentrejectretry']>=_0x4ba4e7[_0x3de1('0xf6')]){_0x4ffef8[_0x3de1('0xf7')](_0x29028a,_0x4aa84f,_0x4e956c,_0x3de1('0xf8'));}else{if(_0x29028a['countmachineretry']>=_0x4ba4e7[_0x3de1('0xf9')]){_0x4ffef8[_0x3de1('0xfa')](_0x29028a,_0x4aa84f,_0x4e956c,'reason\x2019\x20machine....');}else{_0x4ffef8[_0x3de1('0xbf')]({'active':![],'countmachineretry':_0x29028a['countmachineretry'],'scheduledat':moment()['add'](_0x4ba4e7[_0x3de1('0xfb')],_0x3de1('0xfc'))[_0x3de1('0x7c')](_0x3de1('0xfd')),'ContactId':_0x29028a[_0x3de1('0xfe')],'ListId':_0x29028a[_0x3de1('0xff')],'VoiceQueueId':_0x29028a[_0x3de1('0xd3')]||undefined,'CampaignId':_0x29028a[_0x3de1('0xd4')]||undefined})[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x100')));_0x4aa84f({'reschedule':0x1});}}});}if(_0x396d47['type']===_0x3de1('0x7f')&&this[_0x3de1('0x20')][_0x396d47[_0x3de1('0xb2')]]['dialAMDActive']&&_0x352c6d['value']==='HANGUP'){delete this[_0x3de1('0x26')][_0x352c6d[_0x3de1('0xe1')]];this[_0x3de1('0xb1')](this[_0x3de1('0x20')][_0x396d47[_0x3de1('0xb2')]]);_0x4058e1=new Hangup(_0x396d47,_0x352c6d);_0x4058e1[_0x3de1('0xa7')]=0x12;_0x4058e1['statedesc']=_0x3de1('0xe3');_0x4058e1[_0x3de1('0xe4')]=_0x3de1('0xee');ami[_0x3de1('0xe5')](_0x3de1('0xe6'),ut[_0x3de1('0xe7')](_0x4058e1,_0x3de1('0xf1')));this[_0x3de1('0xe8')](_0x4058e1,_0x3de1('0x101'),_0x3de1('0x102'));}if(_0x396d47[_0x3de1('0x51')]===_0x3de1('0x7f')&&this['campaigns'][_0x396d47[_0x3de1('0xb2')]]['dialAMDActive']&&_0x352c6d[_0x3de1('0xe0')]===_0x3de1('0xeb')){var _0x4ffef8=this;return new BPromise(function(_0x1493c7,_0x43bdd7){delete _0x4ffef8[_0x3de1('0x26')][_0x352c6d[_0x3de1('0xe1')]];_0x4ffef8[_0x3de1('0xb1')](_0x4ffef8[_0x3de1('0x20')][_0x396d47[_0x3de1('0xb2')]]);_0x4ffef8[_0x3de1('0x20')][_0x396d47[_0x3de1('0xb2')]][_0x3de1('0xe2')]+=0x1;_0x4ffef8[_0x3de1('0x20')][_0x396d47[_0x3de1('0xb2')]][_0x3de1('0x61')]+=0x1;var _0x4fd77b=_0x4ffef8[_0x3de1('0x20')][_0x396d47['queue']];var _0x2b9329=new Hangup(_0x396d47,_0x352c6d);_0x2b9329[_0x3de1('0xa7')]=0x13;_0x2b9329[_0x3de1('0xec')]=_0x3de1('0xed');_0x2b9329['membername']='AMD';_0x2b9329[_0x3de1('0xef')]+=0x1;_0x2b9329['countglobal']+=0x1;_0x2b9329[_0x3de1('0xf1')]=!![];ami[_0x3de1('0xe5')](_0x3de1('0xe6'),ut['buildObj'](_0x2b9329,_0x3de1('0xf1')));_0x4ffef8['createHistory'](_0x2b9329)['catch'](loggerCatch(_0x3de1('0x103')));if(_0x2b9329[_0x3de1('0xf2')]+_0x2b9329[_0x3de1('0xf3')]+_0x2b9329[_0x3de1('0xf4')]+_0x2b9329[_0x3de1('0x104')]+_0x2b9329[_0x3de1('0x105')]+_0x2b9329[_0x3de1('0xf5')]+_0x2b9329['countmachineretry']+_0x2b9329[_0x3de1('0x106')]>=_0x4fd77b[_0x3de1('0xf6')]){_0x4ffef8[_0x3de1('0xf7')](_0x2b9329,_0x1493c7,_0x43bdd7,_0x3de1('0xf8'));}else{if(_0x2b9329['countmachineretry']>=_0x4fd77b['dialMachineMaxRetry']){_0x4ffef8[_0x3de1('0xfa')](_0x2b9329,_0x1493c7,_0x43bdd7,_0x3de1('0x107'));}else{_0x4ffef8['rescheduleContact']({'active':![],'countmachineretry':_0x2b9329['countmachineretry'],'scheduledat':moment()['add'](_0x4fd77b[_0x3de1('0xfb')],_0x3de1('0xfc'))[_0x3de1('0x7c')](_0x3de1('0xfd')),'ContactId':_0x2b9329[_0x3de1('0xfe')],'ListId':_0x2b9329[_0x3de1('0xff')],'VoiceQueueId':_0x2b9329[_0x3de1('0xd3')]||undefined,'CampaignId':_0x2b9329['CampaignId']||undefined})[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x100')));_0x1493c7({'reschedule':0x1});}}});}}};Dialer[_0x3de1('0xab')][_0x3de1('0x35')]=function(_0x3e595f){var _0x8f5325=this['uniqueId'][_0x3e595f[_0x3de1('0xe1')]];var _0x3eefd4=this;var _0x171844;if(_0x8f5325&&_0x8f5325[_0x3de1('0x51')]===_0x3de1('0x7f')){delete this['uniqueId'][_0x3e595f[_0x3de1('0xe1')]];this[_0x3de1('0xb1')](this['campaigns'][_0x8f5325[_0x3de1('0xb2')]]);this[_0x3de1('0x20')][_0x8f5325[_0x3de1('0xb2')]][_0x3de1('0x108')]+=0x1;_0x171844=new Hangup(_0x8f5325,_0x3e595f);this[_0x3de1('0xcc')](_0x171844)[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x109')));this[_0x3de1('0xca')](_0x171844)[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x10a')));}if(_0x8f5325&&_0x8f5325[_0x3de1('0x51')]!==_0x3de1('0x7f')&&isNotNull(this['voiceQueues'][_0x8f5325['queue']][_0x3de1('0x10b')])){delete this[_0x3de1('0x26')][_0x3e595f[_0x3de1('0xe1')]];this['updateOriginated'](this[_0x3de1('0x1f')][_0x8f5325[_0x3de1('0xb2')]]);this[_0x3de1('0x1f')][_0x8f5325[_0x3de1('0xb2')]][_0x3de1('0xe2')]+=0x1;this['voiceQueues'][_0x8f5325['queue']][_0x3de1('0x61')]+=0x1;_0x171844=new Hangup(_0x8f5325,_0x3e595f);_0x171844[_0x3de1('0xa7')]=0x10;_0x171844[_0x3de1('0xec')]='AnswerAGI';_0x171844[_0x3de1('0xe4')]='AGI';this[_0x3de1('0xcc')](_0x171844)['catch'](loggerCatch(_0x3de1('0x109')));this[_0x3de1('0xca')](_0x171844)[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x10a')));}if(_0x8f5325&&_0x8f5325[_0x3de1('0x51')]!==_0x3de1('0x7f')&&!isNotNull(this[_0x3de1('0x1f')][_0x8f5325[_0x3de1('0xb2')]]['dialQueueProject'])){delete this['uniqueId'][_0x3e595f[_0x3de1('0xe1')]];this[_0x3de1('0xb1')](this[_0x3de1('0x1f')][_0x8f5325[_0x3de1('0xb2')]]);this[_0x3de1('0x1f')][_0x8f5325['queue']][_0x3de1('0x10c')]+=0x1;_0x171844=new Hangup(_0x8f5325,_0x3e595f);_0x171844['state']=0xc;_0x171844['statedesc']=_0x3e595f[_0x3de1('0x10d')];_0x171844['membername']=_0x3de1('0x10e');this['createHistory'](_0x171844)[_0x3de1('0xaf')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x3de1('0xca')](_0x171844)[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x10a')));}};Dialer[_0x3de1('0xab')][_0x3de1('0x31')]=function(_0x4a40a0){var _0x17eb05=this[_0x3de1('0x26')][_0x4a40a0['uniqueid']];var _0x17abbc=this;if(this['voiceQueues'][_0x4a40a0[_0x3de1('0xb2')]]){if(_0x17eb05&&_0x17eb05[_0x3de1('0x51')]!==_0x3de1('0x7f')){delete this[_0x3de1('0x26')][_0x4a40a0['uniqueid']];this[_0x3de1('0x1f')][_0x4a40a0[_0x3de1('0xb2')]][_0x3de1('0xe2')]+=0x1;var _0x2980b9=new AgentComplete(_0x17eb05,_0x4a40a0);if(_0x4a40a0[_0x3de1('0x10f')]===_0x3de1('0x110')){_0x2980b9[_0x3de1('0x111')]=this[_0x3de1('0x1f')][_0x4a40a0[_0x3de1('0xb2')]]['dialQueueProject2']&&this['voiceQueues'][_0x4a40a0['queue']][_0x3de1('0x112')]?moment()[_0x3de1('0x7c')](_0x3de1('0xfd')):undefined;}this['createHistory'](_0x2980b9)[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x113')));this[_0x3de1('0xca')](_0x2980b9)[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x114')));}}};Dialer[_0x3de1('0xab')][_0x3de1('0x2b')]=function(_0x351fd4){if(this['voiceQueues'][_0x351fd4['queue']]){if(this[_0x3de1('0x26')][_0x351fd4[_0x3de1('0xe1')]]&&this[_0x3de1('0x26')][_0x351fd4[_0x3de1('0xe1')]][_0x3de1('0x51')]!==_0x3de1('0x7f')){this[_0x3de1('0xb1')](this[_0x3de1('0x1f')][_0x351fd4[_0x3de1('0xb2')]]);this[_0x3de1('0x26')][_0x351fd4[_0x3de1('0xe1')]][_0x3de1('0x115')]=moment()['format'](_0x3de1('0xfd'));}}};Dialer[_0x3de1('0xab')][_0x3de1('0x116')]=function(_0x1cd67a,_0x5452d0){this[_0x3de1('0xcc')](_0x1cd67a)['catch'](loggerCatch(_0x3de1('0x113')));if(_0x5452d0==0x0){this['moveContactManagedDialer'](_0x1cd67a)[_0x3de1('0xaf')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x3de1('0xab')][_0x3de1('0x2e')]=function(_0x5d2aed){var _0x42d171=this['uniqueId'][_0x5d2aed[_0x3de1('0xe1')]];var _0x2c09a5=this;var _0x36fa81=![];var _0x17f1b3;var _0x917145;if(this[_0x3de1('0x1f')][_0x5d2aed[_0x3de1('0xb2')]]){if(_0x42d171&&_0x42d171['type']!==_0x3de1('0x7f')){delete this['uniqueId'][_0x5d2aed[_0x3de1('0xe1')]];this[_0x3de1('0xb1')](this[_0x3de1('0x1f')][_0x5d2aed[_0x3de1('0xb2')]]);_0x42d171['droptime']=moment()[_0x3de1('0x7c')](_0x3de1('0xfd'));var _0x44c788=new QueueCallerAbandon(_0x42d171,_0x5d2aed);if(getSeconds(_0x42d171[_0x3de1('0x117')],_0x42d171[_0x3de1('0x118')])>=_0x42d171[_0x3de1('0x119')]){this['voiceQueues'][_0x5d2aed['queue']][_0x3de1('0x6e')]+=0x1;this[_0x3de1('0x1f')][_0x5d2aed[_0x3de1('0xb2')]][_0x3de1('0x66')]+=0x1;this[_0x3de1('0x1f')][_0x5d2aed['queue']][_0x3de1('0x70')]+=0x1;_0x44c788['state']=0xa;_0x44c788[_0x3de1('0xec')]=_0x3de1('0x11a');_0x44c788[_0x3de1('0x11b')]=_0x3de1('0x11c');_0x44c788[_0x3de1('0x111')]=this[_0x3de1('0x1f')][_0x5d2aed['queue']][_0x3de1('0x11d')]?moment()[_0x3de1('0x7c')](_0x3de1('0xfd')):undefined;_0x44c788['countdropretry']+=0x1;_0x44c788[_0x3de1('0xf0')]+=0x1;_0x17f1b3=this[_0x3de1('0x1f')][_0x5d2aed[_0x3de1('0xb2')]]['dialDropRetryFrequency'];_0x917145=this['voiceQueues'][_0x5d2aed['queue']]['callAdditionalPhoneAfterMin'];_0x2c09a5[_0x3de1('0xb7')](_0x44c788,_0x44c788['state'],_0x42d171[_0x3de1('0x11e')])['then'](function(_0x39d738){_0x36fa81=_0x39d738[_0x3de1('0x11f')]==0x1;if(_0x44c788[_0x3de1('0x105')]>=_0x2c09a5[_0x3de1('0x1f')][_0x5d2aed[_0x3de1('0xb2')]][_0x3de1('0x120')]){_0x2c09a5[_0x3de1('0x116')](_0x44c788,_0x39d738['additional']);}else{_0x2c09a5[_0x3de1('0xbf')]({'active':![],'countdropretry':_0x44c788[_0x3de1('0x105')],'scheduledat':moment()['add'](_0x2c09a5['voiceQueues'][_0x5d2aed['queue']][_0x3de1('0x121')],'minutes')[_0x3de1('0x7c')](_0x3de1('0xfd')),'ContactId':_0x42d171['ContactId'],'ListId':_0x42d171['ListId'],'VoiceQueueId':_0x42d171[_0x3de1('0xd3')]||undefined,'CampaignId':_0x42d171[_0x3de1('0xd4')]||undefined})['catch'](loggerCatch(_0x3de1('0x122')));var _0x54e263=new History(_0x44c788);_0x54e263[_0x3de1('0xa7')]=0xa;_0x54e263[_0x3de1('0xec')]=_0x3de1('0x11a');_0x54e263['starttime']=moment()[_0x3de1('0x7c')](_0x3de1('0xfd'));_0x54e263[_0x3de1('0xa8')]=_0x54e263[_0x3de1('0x123')];_0x54e263[_0x3de1('0x124')]=_0x44c788['calleridname'];_0x54e263[_0x3de1('0x125')]=_0x44c788[_0x3de1('0x125')];_0x2c09a5[_0x3de1('0xcc')](_0x54e263)[_0x3de1('0xaf')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0x3de1('0x3e')](function(_0x4f7909){if(_0x36fa81)_0x2c09a5[_0x3de1('0xb8')](_0x44c788,_0x17f1b3,_0x917145)[_0x3de1('0x3e')](function(_0x1c1963){return 0x1;});});}else{this[_0x3de1('0x1f')][_0x5d2aed[_0x3de1('0xb2')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x3de1('0x1f')][_0x5d2aed['queue']][_0x3de1('0x65')]+=0x1;_0x44c788[_0x3de1('0xa7')]=0xb;_0x44c788['statedesc']=_0x3de1('0x126');_0x44c788[_0x3de1('0x11b')]='CALLEREXIT';_0x44c788[_0x3de1('0xf5')]+=0x1;_0x44c788[_0x3de1('0xf0')]+=0x1;_0x17f1b3=this[_0x3de1('0x1f')][_0x5d2aed[_0x3de1('0xb2')]][_0x3de1('0x127')];_0x917145=this[_0x3de1('0x1f')][_0x5d2aed['queue']][_0x3de1('0x128')];_0x2c09a5['verifyAdditionalPhones'](_0x44c788,_0x44c788[_0x3de1('0xa7')],_0x42d171['voiceQueue'])[_0x3de1('0x3e')](function(_0xecb9d2){if(_0x44c788['countabandonedretry']>=_0x2c09a5[_0x3de1('0x1f')][_0x5d2aed['queue']]['dialAbandonedMaxRetry']){_0x2c09a5['queueCallerAbandonCreateState'](_0x44c788,_0xecb9d2[_0x3de1('0x11f')]);}else{_0x2c09a5['rescheduleContact']({'active':![],'countabandonedretry':_0x44c788['countabandonedretry'],'scheduledat':moment()[_0x3de1('0x129')](_0x2c09a5[_0x3de1('0x1f')][_0x5d2aed[_0x3de1('0xb2')]][_0x3de1('0x127')],'minutes')[_0x3de1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x42d171['ContactId'],'ListId':_0x42d171[_0x3de1('0xff')],'VoiceQueueId':_0x42d171[_0x3de1('0xd3')]||undefined,'CampaignId':_0x42d171[_0x3de1('0xd4')]||undefined})[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x12a')));var _0x46ce71=new History(_0x44c788);_0x46ce71['state']=0xb;_0x46ce71['statedesc']='Abandoned';_0x46ce71[_0x3de1('0x123')]=moment()[_0x3de1('0x7c')](_0x3de1('0xfd'));_0x46ce71['endtime']=_0x46ce71[_0x3de1('0x123')];_0x46ce71[_0x3de1('0x124')]=_0x44c788[_0x3de1('0x124')];_0x46ce71[_0x3de1('0x125')]=_0x44c788[_0x3de1('0x125')];_0x2c09a5[_0x3de1('0xcc')](_0x46ce71)[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x12b')));}})[_0x3de1('0x3e')](function(_0x19ba3f){if(_0x36fa81)_0x2c09a5[_0x3de1('0xb8')](_0x44c788,_0x17f1b3,_0x917145)['then'](function(_0x188692){return 0x1;});});}}}};Dialer[_0x3de1('0xab')]['syncNewExten']=function(_0x254294){if(this[_0x3de1('0x24')][_0x254294[_0x3de1('0xe1')]]){this[_0x3de1('0x24')][_0x254294['uniqueid']][_0x3de1('0x12c')]=_0x254294[_0x3de1('0x12c')];}if(this[_0x3de1('0x26')][_0x254294['uniqueid']]){this[_0x3de1('0x26')][_0x254294['uniqueid']][_0x3de1('0x12c')]=_0x254294['channel'];}};Dialer['prototype']['syncQueueMember']=function(_0x9a35e8){if(strategy[this[_0x3de1('0x1f')][this[_0x3de1('0x24')][_0x9a35e8[_0x3de1('0x12d')]][_0x3de1('0xb2')]][_0x3de1('0x53')]]===_0x3de1('0x1a')){if(this[_0x3de1('0x24')][_0x9a35e8['actionid']]&&_[_0x3de1('0xac')](this[_0x3de1('0x24')][_0x9a35e8[_0x3de1('0x12d')]][_0x3de1('0x12e')])&&_0x9a35e8[_0x3de1('0xae')]==='1'&&_0x9a35e8[_0x3de1('0x12f')]==='0'){if(this['agents'][_0x9a35e8['stateinterface']]){if(!this[_0x3de1('0x21')][_0x9a35e8[_0x3de1('0x130')]][_0x3de1('0x12e')]){this[_0x3de1('0x21')][_0x9a35e8[_0x3de1('0x130')]][_0x3de1('0x12e')]=!![];this[_0x3de1('0x24')][_0x9a35e8[_0x3de1('0x12d')]][_0x3de1('0x12e')]=!![];this[_0x3de1('0x24')][_0x9a35e8[_0x3de1('0x12d')]][_0x3de1('0x130')]=_0x9a35e8[_0x3de1('0x130')];}}}}else if((strategy[this[_0x3de1('0x1f')][this[_0x3de1('0x24')][_0x9a35e8['actionid']][_0x3de1('0xb2')]]['strategy']]||'rrmemory')==='rrmemory'){if(this[_0x3de1('0x24')][_0x9a35e8[_0x3de1('0x12d')]]){if(this['agents'][_0x9a35e8[_0x3de1('0x130')]]){this[_0x3de1('0x24')][_0x9a35e8[_0x3de1('0x12d')]][_0x3de1('0x130')]=_0x9a35e8['stateinterface'];if(_[_0x3de1('0xac')](this[_0x3de1('0x131')][this[_0x3de1('0x24')][_0x9a35e8[_0x3de1('0x12d')]][_0x3de1('0xb2')]])){this[_0x3de1('0x131')][this[_0x3de1('0x24')][_0x9a35e8[_0x3de1('0x12d')]][_0x3de1('0xb2')]]=[];}this['queueBooked'][this['actions'][_0x9a35e8['actionid']][_0x3de1('0xb2')]]['push'](_[_0x3de1('0xd1')](_[_0x3de1('0xd2')](this[_0x3de1('0x24')][_0x9a35e8[_0x3de1('0x12d')]],[_0x3de1('0x132'),_0x3de1('0x130')]),{'status':_0x9a35e8[_0x3de1('0xae')],'paused':_0x9a35e8['paused']}));}}}};function unlockQueueStatus(_0x3560b2,_0x44f77c){setTimeout(function(){if(_['isUndefined'](_0x3560b2[_0x3de1('0x133')])){loggerBooked[_0x3de1('0x99')](_0x3de1('0x134'),_0x44f77c);}_0x3560b2[_0x3de1('0x133')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x44f77c,JSON['stringify'](_[_0x3de1('0xd2')](_0x3560b2,[_0x3de1('0x43'),_0x3de1('0x133')])));},0x1f3);}Dialer[_0x3de1('0xab')][_0x3de1('0x135')]=function(_0x5402ac){var _0x5850d0=this;var _0x2519bb=_0x5850d0[_0x3de1('0x1f')][_0x5850d0[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0xb2')]];if(strategy[this[_0x3de1('0x1f')][this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0xb2')]][_0x3de1('0x53')]]===_0x3de1('0x1a')){if(this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]]&&this[_0x3de1('0x24')][_0x5402ac['actionid']][_0x3de1('0x130')]){this[_0x3de1('0x94')]['run'](this[_0x3de1('0x24')][_0x5402ac['actionid']]['idHopper'],this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0x130')])[_0x3de1('0xaf')](function(_0x58fb0d){logger[_0x3de1('0x99')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x3de1('0x98')](_0x58fb0d,{'showHidden':![],'depth':null}));})[_0x3de1('0x1d')](function(){_0x5850d0[_0x3de1('0xb1')](_0x5850d0[_0x3de1('0x1f')][_0x5850d0['actions'][_0x5402ac[_0x3de1('0x12d')]]['queue']]);_0x5850d0[_0x3de1('0x21')][_0x5850d0['actions'][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0x130')]][_0x3de1('0x12e')]=![];delete _0x5850d0['actions'][_0x5402ac[_0x3de1('0x12d')]];unlockQueueStatus(_0x2519bb);});}else{this[_0x3de1('0xb1')](this[_0x3de1('0x1f')][this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0xb2')]]);this[_0x3de1('0xbf')]({'active':![],'ContactId':this[_0x3de1('0x24')][_0x5402ac['actionid']]['ContactId'],'ListId':this['actions'][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0xff')],'VoiceQueueId':this[_0x3de1('0x24')][_0x5402ac['actionid']]['VoiceQueueId']||undefined,'CampaignId':this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0xd4')]||undefined})['catch'](loggerCatch(_0x3de1('0x136')));delete this['actions'][_0x5402ac[_0x3de1('0x12d')]];unlockQueueStatus(_0x2519bb);}}else if((strategy[this[_0x3de1('0x1f')][this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]]['queue']][_0x3de1('0x53')]]||_0x3de1('0x137'))===_0x3de1('0x137')){var _0x3114b7;if(this['actions'][_0x5402ac[_0x3de1('0x12d')]]&&!_[_0x3de1('0x49')](this[_0x3de1('0x131')][this['actions'][_0x5402ac['actionid']][_0x3de1('0xb2')]])){if(this[_0x3de1('0x29')][_0x5850d0[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0xb2')]]){this[_0x3de1('0x29')][_0x5850d0[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0xb2')]]=this[_0x3de1('0x29')][this['actions'][_0x5402ac[_0x3de1('0x12d')]]['queue']]?this['queueBookedRR'][this['actions'][_0x5402ac[_0x3de1('0x12d')]]['queue']]:this[_0x3de1('0x131')][this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0xb2')]]?this[_0x3de1('0x131')][this[_0x3de1('0x24')][_0x5402ac['actionid']][_0x3de1('0xb2')]]['_rr']||0x0:0x0;}this[_0x3de1('0x131')][this[_0x3de1('0x24')][_0x5402ac['actionid']][_0x3de1('0xb2')]][_0x3de1('0x138')]=this[_0x3de1('0x29')][this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]]['queue']];for(var _0x5cdd9c=0x0;_0x5cdd9c<this[_0x3de1('0x131')][this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0xb2')]][_0x3de1('0x9b')];_0x5cdd9c+=0x1){_0x3114b7=rr(this[_0x3de1('0x131')][this['actions'][_0x5402ac[_0x3de1('0x12d')]]['queue']]);this[_0x3de1('0x29')][_0x5850d0['actions'][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0xb2')]]=this[_0x3de1('0x131')][this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0xb2')]]['_rr'];if(_0x3114b7[_0x3de1('0xae')]==='1'&&_0x3114b7[_0x3de1('0x12f')]==='0'){break;}}if(!_[_0x3de1('0xac')](_0x3114b7)){this[_0x3de1('0x21')][_0x3114b7[_0x3de1('0x130')]][_0x3de1('0x139')]=_[_0x3de1('0x40')](this['agents'][_0x3114b7[_0x3de1('0x130')]][_0x3de1('0x139')])?!![]:this[_0x3de1('0x21')][_0x3114b7[_0x3de1('0x130')]][_0x3de1('0x139')];}loggerBooked[_0x3de1('0x83')](_0x3de1('0x13a'),_0x5402ac['actionid'],'Agent:\x20',JSON[_0x3de1('0x4d')](_['pick'](this[_0x3de1('0x21')][_0x3114b7['stateinterface']],[_0x3de1('0x43'),'unlockRR'])),_0x3de1('0x13b'),JSON[_0x3de1('0x4d')](_0x3114b7[_0x3de1('0x132')]));if(!_[_0x3de1('0xac')](_0x3114b7)&&_0x3114b7[_0x3de1('0xae')]==='1'&&_0x3114b7['paused']==='0'&&this[_0x3de1('0x21')][_0x3114b7[_0x3de1('0x130')]][_0x3de1('0x139')]){this[_0x3de1('0x21')][_0x3114b7[_0x3de1('0x130')]][_0x3de1('0x139')]=![];this['queueBooked'][_0x5850d0['actions'][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0xb2')]]=[];this[_0x3de1('0x94')][_0x3de1('0x13c')](_0x3114b7[_0x3de1('0x132')],_0x3114b7['stateinterface'])['catch'](function(_0x2f52e1){logger[_0x3de1('0x99')](_0x3de1('0x13d'),util['inspect'](_0x2f52e1,{'showHidden':![],'depth':null}));})[_0x3de1('0x1d')](function(){_0x5850d0['updateOriginated'](_0x5850d0[_0x3de1('0x1f')][_0x5850d0[_0x3de1('0x24')][_0x5402ac['actionid']][_0x3de1('0xb2')]]);setTimeout(function(){_0x5850d0[_0x3de1('0x21')][_0x3114b7[_0x3de1('0x130')]][_0x3de1('0x139')]=!![];loggerBooked[_0x3de1('0x83')](_0x3de1('0x13e'),_0x5402ac[_0x3de1('0x12d')],'Agent:\x20',JSON[_0x3de1('0x4d')](_[_0x3de1('0xd2')](_0x5850d0[_0x3de1('0x21')][_0x3114b7[_0x3de1('0x130')]],[_0x3de1('0x43'),_0x3de1('0x139')])),_0x3de1('0x13b'),JSON[_0x3de1('0x4d')](_0x3114b7[_0x3de1('0x132')]));},0xc7);delete _0x5850d0[_0x3de1('0x24')][_0x5402ac['actionid']];unlockQueueStatus(_0x2519bb,_0x5402ac[_0x3de1('0x12d')]);});}else{loggerBooked[_0x3de1('0x83')](_0x3de1('0x13f'));this[_0x3de1('0xb1')](this[_0x3de1('0x1f')][this[_0x3de1('0x24')][_0x5402ac['actionid']][_0x3de1('0xb2')]]);this[_0x3de1('0xbf')]({'active':![],'ContactId':this[_0x3de1('0x24')][_0x5402ac['actionid']][_0x3de1('0xfe')],'ListId':this['actions'][_0x5402ac[_0x3de1('0x12d')]]['ListId'],'VoiceQueueId':this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x5402ac['actionid']][_0x3de1('0xd4')]||undefined})[_0x3de1('0xaf')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]];unlockQueueStatus(_0x2519bb);}}else{loggerBooked[_0x3de1('0x83')](_0x3de1('0x140'));this['updateOriginated'](this[_0x3de1('0x1f')][this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0xb2')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0xfe')],'ListId':this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0xff')],'VoiceQueueId':this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0xd4')]||undefined})['catch'](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]];unlockQueueStatus(_0x2519bb);}}else{loggerBooked[_0x3de1('0x83')](_0x3de1('0x141'));this['updateOriginated'](this[_0x3de1('0x1f')][this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]]['queue']]);this[_0x3de1('0xbf')]({'active':![],'ContactId':this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0xfe')],'ListId':this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]]['ListId'],'VoiceQueueId':this[_0x3de1('0x24')][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0xd3')]||undefined,'CampaignId':this['actions'][_0x5402ac[_0x3de1('0x12d')]][_0x3de1('0xd4')]||undefined})['catch'](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this[_0x3de1('0x24')][_0x5402ac['actionid']];unlockQueueStatus(_0x2519bb);}};Dialer['prototype'][_0x3de1('0x142')]=function(){var _0x1e393a=this;return BPromise[_0x3de1('0xb3')]()[_0x3de1('0x3e')](cmHopper['resetActiveCalls']({}))['then'](function(){setInterval(function(){_0x1e393a[_0x3de1('0x143')]();},0x3e8);});};Dialer[_0x3de1('0xab')][_0x3de1('0x144')]=function(_0x173e98){var _0x1fc473=this;return function(){if(!_0x1fc473[_0x3de1('0xd8')](_0x173e98['Trunk'])){if(!_0x1fc473['isTrunkReachable'](_0x173e98[_0x3de1('0x145')])){_0x173e98[_0x3de1('0x41')]='TRUNK_IS_NOT_REACHABLE';throw _0x173e98[_0x3de1('0x43')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer['prototype'][_0x3de1('0x146')]=function(_0xcc8914,_0x207a2b,_0x5e0319,_0x5afbe8){var _0x496fd0=this;return function(){var _0x8566cc=!![];return _0x496fd0[_0x3de1('0x147')](_0xcc8914,_0x207a2b,_0x5e0319,_0x5afbe8,_0x8566cc);};};Dialer[_0x3de1('0xab')][_0x3de1('0x148')]=function(_0x4fda3b,_0x255cbc,_0x35b1eb,_0x4ccd5d){var _0x17a25e=this;return function(){var _0x4e9eec=![];return _0x17a25e[_0x3de1('0x147')](_0x4fda3b[_0x3de1('0x4a')],_0x255cbc,_0x35b1eb,_0x4ccd5d,_0x4e9eec);};};Dialer[_0x3de1('0xab')][_0x3de1('0x147')]=function(_0x247dac,_0xdde423,_0x44d024,_0x3186be,_0x1f3bb3){var _0x581b51=[];return new BPromise(function(_0x281f4a,_0x1a8dcd){if(!isNotNull(_0x247dac)){_0x3186be['message']=_0x3de1('0x48');return _0x1a8dcd(msgResponse('ifTime','Failure',_0x44d024+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x3de1('0x49')](_0x247dac)){_0x3186be[_0x3de1('0x41')]=_0x3de1('0x149');return _0x1a8dcd(msgResponse(_0x3de1('0x147'),_0x3de1('0x14a'),_0x44d024+_0x3de1('0x14b')));}if(_0xdde423&&_[_0x3de1('0x40')](config[_0x3de1('0x14c')][_0xdde423])){_0x3186be[_0x3de1('0x41')]=_0x3de1('0x14d');return _0x1a8dcd(msgResponse('ifTime','Failure',_0x44d024+_0x3de1('0x14e')+_0xdde423));}if(_[_0x3de1('0x14f')](_0x247dac)){for(var _0x60ef60=0x0;_0x60ef60<_0x247dac[_0x3de1('0x9b')];_0x60ef60+=0x1){_0x581b51['push'](ami[_0x3de1('0xad')]({'action':'command','command':util[_0x3de1('0x7c')](_0x3de1('0x150'),_0x247dac[_0x60ef60][_0x3de1('0x151')],!_['isUndefined'](config['timezones'][_0xdde423])?_0xdde423:'')})[_0x3de1('0x3e')](function(_0x2764e2){return _0x2764e2['content']['indexOf'](_0x3de1('0x152'))>=0x0;})['catch'](myreject(_0x1a8dcd)));}}else{_0x581b51['push'](ami[_0x3de1('0xad')]({'action':'command','command':util['format'](_0x3de1('0x150'),_0x247dac,!_[_0x3de1('0x40')](config[_0x3de1('0x14c')][_0xdde423])?_0xdde423:'')})[_0x3de1('0x3e')](function(_0x314b7e){return _0x314b7e[_0x3de1('0x153')][_0x3de1('0x154')](_0x3de1('0x152'))>=0x0;})[_0x3de1('0xaf')](myreject(_0x1a8dcd)));}BPromise[_0x3de1('0x155')](_0x581b51)[_0x3de1('0x3e')](function(_0x234395){var _0x2363a4=_[_0x3de1('0x156')](_0x234395);if(_0x2363a4){return _0x281f4a(_0x2363a4);}else{_0x3186be['message']=_0x1f3bb3?_0x3de1('0x157'):_0x3de1('0x158');return _0x1a8dcd(msgResponse(_0x3de1('0x159'),_0x3de1('0x14a'),'Global:\x20'+_0x1f3bb3+'\x20'+_0x44d024+_0x3de1('0x15a')+util[_0x3de1('0x98')](_0x247dac,{'showHidden':![],'depth':null})+_0x3de1('0x15b')+_0xdde423));}})[_0x3de1('0xaf')](function(_0x5f313a){return _0x1a8dcd(msgResponse(_0x3de1('0x147'),_0x3de1('0x14a'),JSON['stringify'](_0x5f313a)));});});};Dialer[_0x3de1('0xab')][_0x3de1('0x15c')]=function(_0x15213b){var _0x2cb616=this;return function(){switch(_0x15213b[_0x3de1('0x5e')]){case'progressive':freeVariablesPredictive(_0x15213b);_0x2cb616[_0x3de1('0x15d')](_0x15213b,0x1);break;case _0x3de1('0x15e'):freeVariablesPredictive(_0x15213b);_0x2cb616[_0x3de1('0x15d')](_0x15213b,_0x15213b[_0x3de1('0x15f')]);break;case _0x3de1('0xb'):_0x2cb616[_0x3de1('0xb')](_0x15213b);break;case _0x3de1('0x9'):freeVariablesPredictive(_0x15213b);_0x2cb616[_0x3de1('0x15d')](_0x15213b,0x1);break;default:freeVariablesPredictive(_0x15213b);logger[_0x3de1('0x99')]('Queue',_0x15213b[_0x3de1('0x43')],'method\x20not\x20recognized');}};};Dialer[_0x3de1('0xab')][_0x3de1('0x160')]=function(_0x5bfcbb){var _0x1d6ef1=this;return function(){_0x1d6ef1[_0x3de1('0x161')](_0x5bfcbb);};};Dialer[_0x3de1('0xab')]['syncQueueSummary']=function(_0x304797){var _0x34ac6e=this;if(isNotPreview(_0x304797[_0x3de1('0x5e')])){if(isVoiceQueueOutbound(_0x304797[_0x3de1('0x51')])&&isActive(_0x304797[_0x3de1('0x162')])){_0x304797[_0x3de1('0xa0')]=!![];BPromise[_0x3de1('0xb3')]()[_0x3de1('0x3e')](checkIsLoggedIn(_0x304797,_0x304797[_0x3de1('0x55')]))[_0x3de1('0x3e')](checkIsActive(_0x304797,_0x304797[_0x3de1('0x162')]))[_0x3de1('0x3e')](checkInterval(_0x304797))['then'](_0x34ac6e['checkIsTrunkReachable'](_0x304797))[_0x3de1('0x3e')](_0x34ac6e['checkIfTime'](_0x304797['dialGlobalInterval'],_0x304797[_0x3de1('0x163')],_0x304797[_0x3de1('0x43')],_0x304797))[_0x3de1('0x3e')](_0x34ac6e[_0x3de1('0x148')](_0x304797[_0x3de1('0x46')],_0x304797[_0x3de1('0x163')],_0x304797[_0x3de1('0x43')],_0x304797))[_0x3de1('0x3e')](_0x34ac6e[_0x3de1('0x15c')](_0x304797))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0x304797));}else{notSendMessagesQueue(_0x304797);}}else{freeVariablesPredictive(_0x304797);}};Dialer[_0x3de1('0xab')][_0x3de1('0x164')]=_[_0x3de1('0x165')](function(){var _0x52069b=_[_0x3de1('0x166')](this[_0x3de1('0x1f')],function(_0xff595f){return _0xff595f[_0x3de1('0x167')];});var _0xc37220=_[_0x3de1('0x166')](this[_0x3de1('0x21')],function(_0x4d3b8f){return _0x4d3b8f['online']&&_0x4d3b8f[_0x3de1('0xae')]==='reachable';});if(_0x52069b[_0x3de1('0x9b')]>0x0&&_0xc37220[_0x3de1('0x9b')]>0x0){return BPromise[_0x3de1('0xb3')]()[_0x3de1('0x3e')](cmHopper[_0x3de1('0x168')](_[_0x3de1('0x169')](_0x52069b,'id'),previewRecallmeReminderInterval,_[_0x3de1('0x169')](_0xc37220,'id')))[_0x3de1('0x3e')](function(_0x5bdcb0){for(var _0x3b7879=0x0;_0x3b7879<_0x5bdcb0[_0x3de1('0x9b')];_0x3b7879++){var _0x238d8c=_0x5bdcb0[_0x3b7879][_0x3de1('0x16a')][_0x3de1('0x43')];if(_0x238d8c)io['to'](util[_0x3de1('0x7c')](_0x3de1('0x16b'),_0x238d8c))[_0x3de1('0xe5')]('user:dialPreviewRecallReminder',{'hopper':_0x5bdcb0[_0x3b7879]});}})[_0x3de1('0xaf')](function(_0x65be43){logger['error']('checkPreviewRecallReminder',_0x65be43);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x3de1('0xab')][_0x3de1('0x143')]=function(){var _0x35e30e=this;var _0x461b03;for(var _0x54dbf4 in this['campaigns']){if(typeof this['campaigns'][_0x54dbf4]!==_0x3de1('0x9c')){_0x461b03=this[_0x3de1('0x20')][_0x54dbf4];if(isCampaignIvr(_0x461b03['type'])&&isActive(_0x461b03[_0x3de1('0x79')])){_0x461b03[_0x3de1('0xa0')]=!![];BPromise[_0x3de1('0xb3')]()['then'](checkIsActive(_0x461b03,_0x461b03[_0x3de1('0x79')]))[_0x3de1('0x3e')](checkInterval(_0x461b03))['then'](_0x35e30e[_0x3de1('0x144')](_0x461b03))['then'](_0x35e30e[_0x3de1('0x146')](_0x461b03[_0x3de1('0x16c')],_0x461b03[_0x3de1('0x163')],_0x461b03[_0x3de1('0x43')],_0x461b03))[_0x3de1('0x3e')](_0x35e30e['checkIfTimeIntervals'](_0x461b03['Interval'],_0x461b03['dialTimezone'],_0x461b03[_0x3de1('0x43')],_0x461b03))['then'](_0x35e30e[_0x3de1('0x160')](_0x461b03))[_0x3de1('0xaf')](loggerCatchQueueSummary(_0x3de1('0x16d'),_0x461b03));}else{notSendMessagesCampaign(_0x461b03);}}}};function getCallerIdRandom(_0x28a3a9,_0x526299){var _0x554407;var _0x427beb;var _0x315169;if(_0x526299<=0x0){_0x526299=0x1;}_0x554407=new RegExp(_0x3de1('0x16e')+_0x526299+'}$');_0x427beb=Math[_0x3de1('0x16f')](0xa,_0x526299-0x1);_0x315169=Math['pow'](0xa,_0x526299)-0x1;return util[_0x3de1('0x7c')]('%s',_[_0x3de1('0x170')](_0x28a3a9,_0x554407,_[_0x3de1('0x171')](_0x427beb,_0x315169)));}function extractCalleridName(_0x56f9a0){var _0x3b49a0=_0x56f9a0[_0x3de1('0x172')](/"(.*?)"/);return _0x3b49a0?_0x3b49a0[0x1]:_0x56f9a0;}function extractCalleridNumber(_0x50ae83){var _0x4033bf=_0x50ae83[_0x3de1('0x172')](/<(.*?)>/);return _0x4033bf?_0x4033bf[0x1]:_0x50ae83;}Dialer[_0x3de1('0xab')][_0x3de1('0x173')]=function(_0x22c23a,_0x5fee49){var _0x1fc48c=this;var _0x1458e1=uuid['v4']();this['actions'][_0x1458e1]=new Action(_0x22c23a,_0x5fee49,_0x1458e1);return new BPromise(function(_0x20343a,_0x70593c){if(_['isUndefined'](_0x22c23a)&&typeof _0x22c23a!=='object'){return _0x70593c(msgResponse(_0x3de1('0x174'),_0x3de1('0x14a'),_0x3de1('0x175')));}if(_[_0x3de1('0x40')](_0x5fee49[_0x3de1('0x176')])||_0x5fee49[_0x3de1('0x176')]===null){return _0x70593c(msgResponse('originate',_0x3de1('0x14a'),_0x3de1('0x177')));}var _0x1620b3={'XMD-CALLERID':_0x1fc48c[_0x3de1('0x24')][_0x1458e1][_0x3de1('0x178')](),'XMD-AGI':_0x22c23a[_0x3de1('0x10b')]?util['format'](_0x3de1('0x179'),ipAgi,_0x22c23a['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x22c23a['dialQueueProject2']?util[_0x3de1('0x7c')]('\x22agi://%s/square,%s\x22',ipAgi,_0x22c23a[_0x3de1('0x11d')]):_0x3de1('0x17a'),'XMD-QUEUE':_0x22c23a[_0x3de1('0x51')]===_0x3de1('0x52')?util['format'](_0x3de1('0x17b'),_0x22c23a['name'],_0x22c23a[_0x3de1('0x17c')]||'',_0x22c23a[_0x3de1('0x112')]?'c':'',_0x22c23a[_0x3de1('0x119')]||0x3):_0x3de1('0x17a'),'XMD-CONTACTID':_0x5fee49['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1fc48c[_0x3de1('0x24')][_0x1458e1][_0x3de1('0x178')](),'XMD-AMD':_0x22c23a[_0x3de1('0xdf')]?_0x3de1('0x17d'):'NONE','XMD-DESTINATION':_0x3de1('0xde')};if(_0x22c23a[_0x3de1('0xdf')]){_0x1620b3[_0x3de1('0x17e')]=_0x22c23a[_0x3de1('0x17f')]||0x9c4;_0x1620b3[_0x3de1('0x180')]=_0x22c23a[_0x3de1('0x181')]||0x5dc;_0x1620b3['XMD-AMDAFTERGREETINGSILENCE']=_0x22c23a['dialAMDAfterGreetingSilence']||0x320;_0x1620b3['XMD-AMDTOTALANALYSISTIME']=_0x22c23a[_0x3de1('0x182')]||0x1388;_0x1620b3['XMD-AMDMINWORDLENGTH']=_0x22c23a[_0x3de1('0x183')]||0x64;_0x1620b3['XMD-AMDBETWEENWORDSSILENCE']=_0x22c23a['dialAMDBetweenWordsSilence']||0x32;_0x1620b3['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x22c23a[_0x3de1('0x184')]||0x3;_0x1620b3[_0x3de1('0x185')]=_0x22c23a[_0x3de1('0x186')]||0x100;_0x1620b3[_0x3de1('0x187')]=_0x22c23a[_0x3de1('0x188')]||0x1388;}if(_0x22c23a[_0x3de1('0x51')]===_0x3de1('0x52')){_0x1620b3['XMD-VOICEQUEUEID']=_0x5fee49[_0x3de1('0xd3')];}else{_0x1620b3['XMD-CAMPAIGNID']=_0x5fee49[_0x3de1('0xd4')];}for(var _0x44860f in _0x5fee49[_0x3de1('0x189')]){if(typeof _0x5fee49[_0x3de1('0x189')][_0x44860f]!=='undefined'){if(isNotNull(_0x5fee49[_0x3de1('0x189')][_0x44860f])&&_0x44860f!=='id'&&_0x44860f!==_0x3de1('0x18a')&&_0x44860f!==_0x3de1('0x18b')&&_0x44860f!=='updatedAt'){_0x1620b3[util['format'](_0x3de1('0x18c'),_0x3de1('0x18d'),_[_0x3de1('0x18e')](_0x44860f))]=_0x5fee49[_0x3de1('0x189')][_0x44860f];}}}var _0xf4150=_0x1fc48c[_0x3de1('0xd8')](_0x22c23a[_0x3de1('0x78')])?getCallerId(_0x22c23a['Trunk'][_0x3de1('0x7a')],_0x22c23a[_0x3de1('0x5f')],_0x22c23a[_0x3de1('0x18f')]>0x0?getCallerIdRandom(_0x22c23a[_0x3de1('0x190')],_0x22c23a['dialRandomLastDigitCallerIdNumber']):_0x22c23a[_0x3de1('0x190')]):getCallerId(_[_0x3de1('0xac')](_0x22c23a[_0x3de1('0x145')])?_0x22c23a['Trunk'][_0x3de1('0x7a')]:_0x22c23a[_0x3de1('0x145')][_0x3de1('0x7a')],_0x22c23a[_0x3de1('0x5f')],_0x22c23a[_0x3de1('0x18f')]>0x0?getCallerIdRandom(_0x22c23a[_0x3de1('0x190')],_0x22c23a[_0x3de1('0x18f')]):_0x22c23a['dialOriginateCallerIdNumber']);if(_0xf4150){_0x1620b3[_0x3de1('0x191')]=_0x1fc48c[_0x3de1('0x24')][_0x1458e1]['originatecalleridname']=extractCalleridName(_0xf4150);_0x1620b3['XMD-ORIGINATECALLERIDNUM']=_0x5fee49[_0x3de1('0x176')];}return ami[_0x3de1('0xad')]({'actionid':_0x1458e1,'action':_0x3de1('0x174'),'channel':_0x1fc48c[_0x3de1('0xd8')](_0x22c23a[_0x3de1('0x78')])?util['format'](_0x3de1('0x192'),_0x22c23a[_0x3de1('0x78')][_0x3de1('0x43')],isNotNull(_0x22c23a['dialPrefix'])?_0x22c23a[_0x3de1('0x60')]['trim']()||'':'',_0x22c23a[_0x3de1('0x193')]>0x0?_0x5fee49['phone'][_0x3de1('0x194')](_0x22c23a[_0x3de1('0x193')]):_0x5fee49[_0x3de1('0x176')]):util[_0x3de1('0x7c')]('SIP/%s/%s%s',_[_0x3de1('0xac')](_0x22c23a[_0x3de1('0x145')])?_0x22c23a[_0x3de1('0x78')][_0x3de1('0x43')]:_0x22c23a['TrunkBackup']['name'],isNotNull(_0x22c23a[_0x3de1('0x60')])?_0x22c23a[_0x3de1('0x60')][_0x3de1('0x195')]()||'':'',_0x22c23a[_0x3de1('0x193')]>0x0?_0x5fee49['phone'][_0x3de1('0x194')](_0x22c23a[_0x3de1('0x193')]):_0x5fee49[_0x3de1('0x176')]),'callerid':_0xf4150,'Exten':_0x3de1('0xde'),'Context':'from-sip','Priority':'1','variable':_0x1620b3,'timeout':(_0x22c23a['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x1458e1})['then'](function(_0x4d8bc0){return _0x20343a(_0x4d8bc0);})['catch'](function(_0x25e2a6){_0x22c23a[_0x3de1('0x196')]+=0x1;var _0x596aa1=new History(_0x1fc48c[_0x3de1('0x24')][_0x1458e1]);logger[_0x3de1('0x99')](util['format'](_0x3de1('0x197'),JSON[_0x3de1('0x4d')](_0x25e2a6)));_0x596aa1[_0x3de1('0xa7')]=0xe;_0x596aa1[_0x3de1('0xec')]='OriginateError';_0x596aa1['starttime']=moment()[_0x3de1('0x7c')](_0x3de1('0xfd'));_0x596aa1['endtime']=_0x596aa1['starttime'];_0x1fc48c['createHistory'](_0x596aa1)[_0x3de1('0xaf')](loggerCatch('[originate][error]'));_0x1fc48c[_0x3de1('0xca')](_0x596aa1)[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x198')))[_0x3de1('0x1d')](function(){delete _0x1fc48c[_0x3de1('0x24')][_0x1458e1];return _0x70593c(msgResponse(_0x3de1('0x174'),'Error',_0x3de1('0x199')));});});});};Dialer[_0x3de1('0xab')][_0x3de1('0x19a')]=function(_0x5cb688){var _0x26d1e9=this[_0x3de1('0x24')][_0x5cb688[_0x3de1('0x12d')]];if(_0x26d1e9){delete this[_0x3de1('0x24')][_0x5cb688[_0x3de1('0x12d')]];_0x26d1e9[_0x3de1('0x118')]=moment()[_0x3de1('0x7c')](_0x3de1('0xfd'));var _0x6360da=_0x26d1e9['type']===_0x3de1('0x7f')?this['campaigns'][_0x26d1e9[_0x3de1('0xb2')]]:this[_0x3de1('0x1f')][_0x26d1e9['getQueue']()];if(!this[_0x3de1('0xd6')](_0x5cb688[_0x3de1('0x19b')])){this[_0x3de1('0xb1')](_0x6360da);return this[_0x3de1('0x19c')](_0x26d1e9,_0x6360da,_0x5cb688)[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x19d')));}this['uniqueId'][_0x5cb688['uniqueid']]=_0x26d1e9;}};Dialer[_0x3de1('0xab')]['checkRetriveMax']=function(_0x16bf70,_0xa9ddbd,_0x429a09){var _0x510e28=new History(_0xa9ddbd);if(_0x510e28[_0x3de1('0xf2')]+_0x510e28[_0x3de1('0xf3')]+_0x510e28[_0x3de1('0xf4')]+_0x510e28[_0x3de1('0x104')]+_0x510e28['countdropretry']+_0x510e28[_0x3de1('0xf5')]+_0x510e28[_0x3de1('0xef')]+_0x510e28[_0x3de1('0x106')]>=_0x429a09[_0x3de1('0xf6')]-0x1){return!![];}switch(_0x16bf70){case 0x3:if(_0x510e28[_0x3de1('0xf4')]>=_0x429a09[_0x3de1('0x19e')]-0x1){return!![];}this[_0x3de1('0xbf')]({'active':![],'countnoanswerretry':_0x510e28[_0x3de1('0xf4')]+=0x1,'scheduledat':moment()['add'](_0x429a09[_0x3de1('0x19f')],_0x3de1('0xfc'))['format'](_0x3de1('0xfd')),'ContactId':_0x510e28[_0x3de1('0xfe')],'ListId':_0x510e28[_0x3de1('0xff')],'VoiceQueueId':_0x510e28['VoiceQueueId']||undefined,'CampaignId':_0x510e28[_0x3de1('0xd4')]||undefined})[_0x3de1('0xaf')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x510e28[_0x3de1('0xf2')]>=_0x429a09['dialBusyMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x510e28[_0x3de1('0xf2')]+=0x1,'scheduledat':moment()[_0x3de1('0x129')](_0x429a09['dialBusyRetryFrequency'],'minutes')[_0x3de1('0x7c')](_0x3de1('0xfd')),'ContactId':_0x510e28['ContactId'],'ListId':_0x510e28['ListId'],'VoiceQueueId':_0x510e28[_0x3de1('0xd3')]||undefined,'CampaignId':_0x510e28[_0x3de1('0xd4')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x510e28[_0x3de1('0xf3')]>=_0x429a09[_0x3de1('0x1a0')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x510e28[_0x3de1('0xf3')]+=0x1,'scheduledat':moment()[_0x3de1('0x129')](_0x429a09[_0x3de1('0x1a1')],_0x3de1('0xfc'))[_0x3de1('0x7c')](_0x3de1('0xfd')),'ContactId':_0x510e28[_0x3de1('0xfe')],'ListId':_0x510e28['ListId'],'VoiceQueueId':_0x510e28[_0x3de1('0xd3')]||undefined,'CampaignId':_0x510e28[_0x3de1('0xd4')]||undefined})[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x1a2')));break;case 0x0:if(_0x510e28['countnosuchnumberretry']>=_0x429a09[_0x3de1('0x1a3')]-0x1){return!![];}else{this[_0x3de1('0xbf')]({'active':![],'countnosuchnumberretry':_0x510e28[_0x3de1('0x104')]+=0x1,'scheduledat':moment()[_0x3de1('0x129')](_0x429a09['dialNoSuchNumberRetryFrequency'],_0x3de1('0xfc'))[_0x3de1('0x7c')](_0x3de1('0xfd')),'ContactId':_0x510e28[_0x3de1('0xfe')],'ListId':_0x510e28[_0x3de1('0xff')],'VoiceQueueId':_0x510e28[_0x3de1('0xd3')]||undefined,'CampaignId':_0x510e28['CampaignId']||undefined})[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x1a4')));}break;case 0xa:if(_0x510e28[_0x3de1('0x105')]>=_0x429a09[_0x3de1('0x120')]-0x1){return!![];}this[_0x3de1('0xbf')]({'active':![],'countdropretry':_0x510e28[_0x3de1('0x105')]+=0x1,'scheduledat':moment()[_0x3de1('0x129')](_0x429a09[_0x3de1('0x121')],_0x3de1('0xfc'))[_0x3de1('0x7c')](_0x3de1('0xfd')),'ContactId':_0x510e28[_0x3de1('0xfe')],'ListId':_0x510e28['ListId'],'VoiceQueueId':_0x510e28[_0x3de1('0xd3')]||undefined,'CampaignId':_0x510e28['CampaignId']||undefined})['catch'](loggerCatch(_0x3de1('0x122')));break;case 0xb:if(_0x510e28[_0x3de1('0xf5')]>=_0x429a09[_0x3de1('0x1a5')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x510e28[_0x3de1('0xf5')]+=0x1,'scheduledat':moment()[_0x3de1('0x129')](_0x429a09[_0x3de1('0x127')],'minutes')[_0x3de1('0x7c')](_0x3de1('0xfd')),'ContactId':_0x510e28[_0x3de1('0xfe')],'ListId':_0x510e28[_0x3de1('0xff')],'VoiceQueueId':_0x510e28['VoiceQueueId']||undefined,'CampaignId':_0x510e28[_0x3de1('0xd4')]||undefined})[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x12a')));break;case 0x13:if(_0x510e28[_0x3de1('0xef')]>=_0x429a09['dialMachineMaxRetry']-0x1){return!![];}this[_0x3de1('0xbf')]({'active':![],'countmachineretry':_0x510e28[_0x3de1('0xef')]+=0x1,'scheduledat':moment()['add'](_0x429a09[_0x3de1('0xfb')],'minutes')[_0x3de1('0x7c')](_0x3de1('0xfd')),'ContactId':_0x510e28['ContactId'],'ListId':_0x510e28[_0x3de1('0xff')],'VoiceQueueId':_0x510e28['VoiceQueueId']||undefined,'CampaignId':_0x510e28['CampaignId']||undefined})['catch'](loggerCatch(_0x3de1('0x100')));break;case 0x14:if(_0x510e28[_0x3de1('0x106')]>=_0x429a09['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x3de1('0xbf')]({'active':![],'countagentrejectretry':_0x510e28[_0x3de1('0x106')]+=0x1,'scheduledat':moment()[_0x3de1('0x129')](_0x429a09['dialAgentRejectRetryFrequency'],_0x3de1('0xfc'))[_0x3de1('0x7c')](_0x3de1('0xfd')),'ContactId':_0x510e28[_0x3de1('0xfe')],'ListId':_0x510e28[_0x3de1('0xff')],'VoiceQueueId':_0x510e28[_0x3de1('0xd3')]||undefined,'CampaignId':_0x510e28[_0x3de1('0xd4')]||undefined})['catch'](loggerCatch(_0x3de1('0x1a6')));break;default:return!![];}};Dialer[_0x3de1('0xab')][_0x3de1('0x19c')]=function(_0x26d8db,_0x443626,_0x309615){var _0x596df2=this;var _0x1b4a55=new History(_0x26d8db);var _0x44b6d1=![];var _0x3d89b0;var _0x245750;return new BPromise(function(_0x50d895,_0x140b2e){if(_[_0x3de1('0x40')](_0x443626)&&typeof _0x443626!==_0x3de1('0x1a7')){return _0x140b2e(msgResponse(_0x3de1('0x1a8'),_0x3de1('0x14a'),'entity\x20is\x20undefine'));}if(_[_0x3de1('0x40')](_0x309615)&&typeof _0x309615!==_0x3de1('0x1a7')){return _0x140b2e(msgResponse('[callProgressDetecting]',_0x3de1('0x14a'),_0x3de1('0x1a9')));}_0x596df2['verifyAdditionalPhones'](_0x1b4a55,_0x309615[_0x3de1('0x10f')],_0x443626)[_0x3de1('0x3e')](function(_0x47d762){if(_0x47d762[_0x3de1('0x11f')]==0x1)_0x44b6d1=!![];switch(_0x309615[_0x3de1('0x10f')]){case'0':_0x443626[_0x3de1('0x1aa')]+=0x1;_0x1b4a55['state']=0x0;_0x1b4a55['statedesc']=_0x3de1('0x1ab');_0x1b4a55['countnosuchnumberretry']+=0x1;_0x1b4a55[_0x3de1('0xf0')]+=0x1;ami[_0x3de1('0xe5')]('custom:agentnosuchnumber',ut[_0x3de1('0xe7')](_0x26d8db,_0x3de1('0x1ac')));_0x3d89b0=_0x443626[_0x3de1('0x1ad')];_0x245750=_0x443626[_0x3de1('0x128')];_0x596df2[_0x3de1('0xcc')](_0x1b4a55)[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x103')));if(_0x596df2['checkRetriveMax'](0x0,_0x26d8db,_0x443626)&&!_0x44b6d1){if(_0x1b4a55[_0x3de1('0x104')]>=_0x443626[_0x3de1('0x1a3')]){_0x596df2[_0x3de1('0xfa')](_0x1b4a55,_0x50d895,_0x140b2e,_0x3de1('0x1ae'));}else{_0x596df2[_0x3de1('0xf7')](_0x1b4a55,_0x50d895,_0x140b2e,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x443626['outboundNoAnswerCallsDay']+=0x1;_0x1b4a55[_0x3de1('0xa7')]=0x3;_0x1b4a55[_0x3de1('0xec')]=_0x3de1('0x1af');_0x1b4a55['countnoanswerretry']+=0x1;_0x1b4a55[_0x3de1('0xf0')]+=0x1;ami[_0x3de1('0xe5')]('custom:agentnoanswer',ut[_0x3de1('0xe7')](_0x26d8db,_0x3de1('0x1b0')));_0x3d89b0=_0x443626[_0x3de1('0x19f')];_0x245750=_0x443626[_0x3de1('0x128')];_0x596df2[_0x3de1('0xcc')](_0x1b4a55)[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x1b1')));if(_0x596df2[_0x3de1('0x1b2')](0x3,_0x26d8db,_0x443626)&&!_0x44b6d1){if(_0x1b4a55[_0x3de1('0xf4')]>=_0x443626['dialNoAnswerMaxRetry']){_0x596df2[_0x3de1('0xfa')](_0x1b4a55,_0x50d895,_0x140b2e,'reason\x203\x20ringing\x20no\x20answer');}else{_0x596df2['stateGlobal'](_0x1b4a55,_0x50d895,_0x140b2e,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x443626['outboundBusyCallsDay']+=0x1;_0x1b4a55[_0x3de1('0xa7')]=0x5;_0x1b4a55['statedesc']=_0x3de1('0x1b3');_0x1b4a55[_0x3de1('0xf2')]+=0x1;_0x1b4a55[_0x3de1('0xf0')]+=0x1;ami[_0x3de1('0xe5')](_0x3de1('0x1b4'),ut[_0x3de1('0xe7')](_0x26d8db,_0x3de1('0x1b5')));_0x3d89b0=_0x443626[_0x3de1('0x1b6')];_0x245750=_0x443626[_0x3de1('0x128')];_0x596df2[_0x3de1('0xcc')](_0x1b4a55)[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x1b7')));if(_0x596df2[_0x3de1('0x1b2')](0x5,_0x26d8db,_0x443626)&&!_0x44b6d1){if(_0x1b4a55[_0x3de1('0xf2')]>=_0x443626[_0x3de1('0x1b8')]){_0x596df2['createStateFinal'](_0x1b4a55,_0x50d895,_0x140b2e,_0x3de1('0x1b9'));}else{_0x596df2['stateGlobal'](_0x1b4a55,_0x50d895,_0x140b2e,_0x3de1('0x1b9'));}}break;case'8':_0x443626[_0x3de1('0x64')]+=0x1;_0x1b4a55[_0x3de1('0xa7')]=0x8;_0x1b4a55[_0x3de1('0xec')]=_0x3de1('0x1ba');_0x1b4a55['countcongestionretry']+=0x1;_0x1b4a55['countglobal']+=0x1;_0x3d89b0=_0x443626[_0x3de1('0x1a1')];_0x245750=_0x443626['callAdditionalPhoneAfterMin'];ami[_0x3de1('0xe5')]('custom:agentcongestion',ut[_0x3de1('0xe7')](_0x26d8db,_0x3de1('0x1bb')));_0x596df2[_0x3de1('0xcc')](_0x1b4a55)[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x1bc')));if(_0x596df2[_0x3de1('0x1b2')](0x8,_0x26d8db,_0x443626)&&!_0x44b6d1){if(_0x1b4a55[_0x3de1('0xf3')]>=_0x443626[_0x3de1('0x1a0')]){_0x596df2[_0x3de1('0xfa')](_0x1b4a55,_0x50d895,_0x140b2e,_0x3de1('0x1bd'));}else{_0x596df2['stateGlobal'](_0x1b4a55,_0x50d895,_0x140b2e,_0x3de1('0x1bd'));}}break;case'11':_0x443626[_0x3de1('0x1be')]+=0x1;_0x1b4a55[_0x3de1('0xa7')]=0xb;_0x1b4a55[_0x3de1('0xec')]='Abandoned';_0x1b4a55['countabandonedretry']+=0x1;_0x1b4a55['countglobal']+=0x1;_0x3d89b0=_0x443626[_0x3de1('0x127')];_0x245750=_0x443626[_0x3de1('0x128')];_0x596df2[_0x3de1('0xcc')](_0x1b4a55)[_0x3de1('0xaf')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x596df2[_0x3de1('0x1b2')](0xb,_0x26d8db,_0x443626)&&!_0x44b6d1){if(_0x1b4a55[_0x3de1('0xf5')]>=_0x443626[_0x3de1('0x1a5')]){_0x596df2[_0x3de1('0xfa')](_0x1b4a55,_0x50d895,_0x140b2e,_0x3de1('0x1bf'));}else{_0x596df2[_0x3de1('0xf7')](_0x1b4a55,_0x50d895,_0x140b2e,_0x3de1('0x1bf'));}}break;case'20':_0x443626[_0x3de1('0x69')]+=0x1;_0x1b4a55[_0x3de1('0xa7')]=0x14;_0x1b4a55[_0x3de1('0xec')]='AgentReject';_0x1b4a55[_0x3de1('0x106')]+=0x1;_0x1b4a55['countglobal']+=0x1;_0x3d89b0=_0x443626['dialAgentRejectRetryFrequency'];_0x245750=_0x443626[_0x3de1('0x128')];ami[_0x3de1('0xe5')](_0x3de1('0x1c0'),ut['buildObj'](_0x26d8db,_0x3de1('0x1c1')));_0x596df2[_0x3de1('0xcc')](_0x1b4a55)[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x1c2')));if(_0x596df2[_0x3de1('0x1b2')](0x14,_0x26d8db,_0x443626)&&!_0x44b6d1){if(_0x1b4a55[_0x3de1('0x106')]>=_0x443626[_0x3de1('0x1c3')]){_0x596df2['createStateFinal'](_0x1b4a55,_0x50d895,_0x140b2e,_0x3de1('0x1c4'));}else{_0x596df2['stateGlobal'](_0x1b4a55,_0x50d895,_0x140b2e,_0x3de1('0x1c4'));}}break;default:_0x443626['outboundUnknownCallsDay']+=0x1;_0x1b4a55[_0x3de1('0xa7')]=0xc;_0x1b4a55[_0x3de1('0xec')]=_0x309615[_0x3de1('0x10f')];_0x3d89b0=_0x443626[_0x3de1('0x1c5')];_0x245750=_0x443626[_0x3de1('0x128')];_0x596df2[_0x3de1('0xcc')](_0x1b4a55)[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x1c6')));if(_0x596df2[_0x3de1('0x1b2')](_0x309615[_0x3de1('0x10f')],_0x26d8db,_0x443626)&&!_0x44b6d1){if(_0x1b4a55['countbusyretry']+_0x1b4a55[_0x3de1('0xf3')]+_0x1b4a55[_0x3de1('0xf4')]+_0x1b4a55[_0x3de1('0x104')]+_0x1b4a55[_0x3de1('0x105')]+_0x1b4a55['countabandonedretry']+_0x1b4a55[_0x3de1('0xef')]+_0x1b4a55[_0x3de1('0x106')]>=_0x443626[_0x3de1('0xf6')]){_0x596df2[_0x3de1('0xf7')](_0x1b4a55,_0x50d895,_0x140b2e,_0x309615[_0x3de1('0x10f')]);}else{_0x596df2[_0x3de1('0xfa')](_0x1b4a55,_0x50d895,_0x140b2e,_0x309615['reason']);}}}})[_0x3de1('0x3e')](function(_0x2f96f0){if(_0x44b6d1){_0x596df2[_0x3de1('0xb8')](_0x1b4a55,_0x3d89b0,_0x245750)[_0x3de1('0x3e')](function(_0x406340){return _0x50d895(0x1);});}});});};Dialer[_0x3de1('0xab')]['stateGlobal']=function(_0x2311c6,_0x21794f,_0x3d7d8c,_0x29468f){var _0x3c7834=new Final(_0x2311c6);_0x3c7834['state']=0xf;_0x3c7834['statedesc']=_0x3de1('0x1c7');this['createStateFinal'](_0x3c7834,_0x21794f,_0x3d7d8c,_0x29468f);};Dialer[_0x3de1('0xab')][_0x3de1('0xfa')]=function(_0x46dd31,_0x37f7b1,_0x73aaa1,_0x3d44c3){this['moveContactManagedDialer'](_0x46dd31)[_0x3de1('0x3e')](function(){return _0x37f7b1(msgResponse(_0x3de1('0x1a8'),_0x3de1('0xd7'),_0x3d44c3));})[_0x3de1('0xaf')](function(){return _0x73aaa1(msgResponse(_0x3de1('0x1c8'),_0x3de1('0x14a'),_0x3de1('0x1c9')));});};Dialer[_0x3de1('0xab')][_0x3de1('0xb')]=function(_0x3ac572){var _0x105dfa=_0x3ac572[_0x3de1('0x1ca')]/0x64;var _0x125874=_0x3ac572[_0x3de1('0x66')]/(_0x3ac572[_0x3de1('0x66')]+_0x3ac572[_0x3de1('0xe2')]);var _0x196c5f=Math[_0x3de1('0x1cb')](_0x3ac572[_0x3de1('0x73')]*(_0x3ac572['predictiveIntervalMaxThreshold']/0x64));var _0xd89cde=Math[_0x3de1('0x1cb')](_0x3ac572[_0x3de1('0x73')]*(_0x3ac572[_0x3de1('0x1cc')]/0x64));var _0x49e0dc=_0x3ac572['available']+_0x3ac572[_0x3de1('0x5a')];var _0x97e5a6=Math[_0x3de1('0x1cd')](_0x3ac572[_0x3de1('0x75')]*_0x3ac572[_0x3de1('0x77')]*_0x3ac572[_0x3de1('0x71')]*_0x3ac572['predictiveIntervalMultiplicativeFactor']);if(_[_0x3de1('0x40')](_0x3ac572[_0x3de1('0x28')])){if(!_['isUndefined'](_0x3ac572['startPredictive'])){_0x3ac572[_0x3de1('0x27')]=undefined;loggerPredictive['error'](_0x3de1('0x1ce'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x3de1('0x40')](_0x3ac572['handlePredictive'])){loggerPredictive['error'](_0x3de1('0x1ce'),_0x3de1('0x1cf'));clearInterval(_0x3ac572['handlePredictive']);_0x3ac572[_0x3de1('0x92')]=undefined;}_0x3ac572[_0x3de1('0x28')]=moment()[_0x3de1('0x7c')](_0x3de1('0xfd'));loggerPredictive[_0x3de1('0x83')](_0x3ac572['name'],'collection\x20data\x20in\x20progressive\x20at',_0x3ac572['startProgressive']);this[_0x3de1('0x15d')](_0x3ac572,0x1);}else if(ifInterval(_0x3ac572[_0x3de1('0x1d0')],_0x3ac572[_0x3de1('0x28')])){this[_0x3de1('0x15d')](_0x3ac572,0x1);loggerPredictiveCalls[_0x3de1('0x83')](_0x3de1('0x1d1'),_0x3ac572[_0x3de1('0x28')],_0x3ac572[_0x3de1('0x43')]);_0x3ac572[_0x3de1('0x75')]=0x0;_0x3ac572[_0x3de1('0x70')]=0x0;}else if(_0x105dfa<_0x125874&&_0x3ac572[_0x3de1('0x1d2')]===_0x3de1('0x1d3')){freeVariablesPredictive(_0x3ac572);loggerPredictive[_0x3de1('0x83')](_0x3de1('0x1d4'),_0x3de1('0x1d5'),_0x125874,_0x3de1('0x28'),_0x3ac572[_0x3de1('0x43')]);}else if(_0x97e5a6<_0x3ac572[_0x3de1('0x70')]&&_0x3ac572[_0x3de1('0x1d2')]==='dropRate'){freeVariablesPredictive(_0x3ac572);loggerPredictive[_0x3de1('0x83')](_0x3de1('0x1d6'),'Max\x20Drop\x20',_0x97e5a6,'Drop\x20in\x20this\x20interval',_0x3ac572[_0x3de1('0x70')],'startProgressive',_0x3ac572[_0x3de1('0x43')]);}else if(!ifInterval(_0x3ac572[_0x3de1('0x1d0')],_0x3ac572[_0x3de1('0x28')])&&_['isUndefined'](_0x3ac572[_0x3de1('0x27')])&&!_[_0x3de1('0x40')](_0x3ac572[_0x3de1('0x28')])){_0x3ac572[_0x3de1('0x27')]=moment()[_0x3de1('0x7c')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x3de1('0x83')](_0x3ac572[_0x3de1('0x43')],_0x3de1('0x1d7'),_0x3ac572['startPredictive']);this[_0x3de1('0xbc')](_0x3ac572[_0x3de1('0x1d0')])[_0x3de1('0x3e')](this[_0x3de1('0x1d8')](_0x3ac572))['then'](mergeDataErlangB(_0x3ac572))[_0x3de1('0x3e')](this[_0x3de1('0x1d9')](_0x3ac572))['catch'](loggerCatchPredictive(_0x3de1('0x1da'),_0x3ac572));}else if(!ifInterval(_0x3ac572['dialPredictiveInterval'],_0x3ac572['startPredictive'])){_0x3ac572[_0x3de1('0x70')]=0x0;_0x3ac572[_0x3de1('0x27')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x3de1('0x83')](_0x3ac572[_0x3de1('0x43')],_0x3de1('0x1db'),_0x3ac572['startPredictive']);clearInterval(_0x3ac572[_0x3de1('0x92')]);_0x3ac572['handlePredictive']=undefined;this[_0x3de1('0xbc')](_0x3ac572[_0x3de1('0x1d0')])['then'](this[_0x3de1('0x1d8')](_0x3ac572))[_0x3de1('0x3e')](mergeDataErlangB(_0x3ac572))['then'](this[_0x3de1('0x1d9')](_0x3ac572))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x3ac572));}else if(_0x3ac572[_0x3de1('0x73')]&&_0x49e0dc<_0x3ac572[_0x3de1('0x73')]-_0xd89cde){freeVariablesPredictive(_0x3ac572);loggerPredictive['info'](_0x3ac572[_0x3de1('0x43')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x49e0dc,_0x3de1('0x1dc'),_0x3ac572['predictiveIntervalAvailable'],'-',_0xd89cde,'=',_0x3ac572[_0x3de1('0x73')]-_0xd89cde,')');}else if(_0x3ac572[_0x3de1('0x73')]&&_0x49e0dc>_0x3ac572[_0x3de1('0x73')]+_0x196c5f){freeVariablesPredictive(_0x3ac572);loggerPredictive[_0x3de1('0x83')](_0x3ac572[_0x3de1('0x43')],_0x3de1('0x1dd'),_0x49e0dc,_0x3de1('0x1de'),_0x3ac572[_0x3de1('0x73')],'+',_0x196c5f,'=',_0x3ac572[_0x3de1('0x73')]+_0x196c5f,')');}};Dialer[_0x3de1('0xab')][_0x3de1('0x1d8')]=function(_0x5f0233){var _0x1870ce=this;return function(_0x2864a7){return new BPromise(function(_0xaee66f,_0x245bf4){_['merge'](_0x5f0233,_0x2864a7[0x0]);if(checkGetDataPredictive(_0x2864a7[0x0])){var _0x395be3=_0x5f0233[_0x3de1('0x73')]=_0x5f0233['talking']+_0x5f0233[_0x3de1('0x54')];var _0x3d08a0=_0x5f0233[_0x3de1('0x1d0')]*0x3c;var _0x184fab=_0x2864a7[0x0][_0x3de1('0x6c')]+_0x2864a7[0x0]['predictiveIntervalAvgHoldtime'];var _0x3ff85e=(_0x2864a7[0x0][_0x3de1('0x6a')]+_0x2864a7[0x0][_0x3de1('0x6e')]+_0x2864a7[0x0][_0x3de1('0x6d')])/_0x2864a7[0x0]['predictiveIntervalTotalCalls'];_0x5f0233[_0x3de1('0x71')]=_0x3ff85e>0x0?_0x3ff85e:0x1;switch(_0x5f0233[_0x3de1('0x1d2')]){case _0x3de1('0x1d3'):var _0x1521ab=_0x5f0233['dialPredictiveOptimizationPercentage']/0x64;return _0x1870ce[_0x3de1('0x1df')](_0x395be3,_0x3d08a0,_0x184fab,_0x3ff85e,_0x1521ab)[_0x3de1('0x3e')](function(_0x19c676){return _0xaee66f(_0x19c676);});case _0x3de1('0x1e0'):var _0x51023c=_0x5f0233[_0x3de1('0x1ca')]/0x64;return _0x1870ce[_0x3de1('0x1e1')](_0x395be3,_0x3d08a0,_0x184fab,_0x3ff85e,_0x51023c)[_0x3de1('0x3e')](function(_0x56b725){return _0xaee66f(_0x56b725);});default:return _0x245bf4(msgResponse(_0x3de1('0x1e2'),'Failure',_0x3de1('0x1e3')));}}else{return _0x245bf4(msgResponse(_0x3de1('0x1e2'),_0x3de1('0x14a'),_0x3de1('0x1e4')));}});};};Dialer[_0x3de1('0xab')]['getDataPredictiveOld']=function(_0x3b6c0c){var _0x3a208a=this;return function(_0x239fea){return new BPromise(function(_0x503410,_0x1464b1){_[_0x3de1('0xd1')](_0x3b6c0c,_0x239fea[0x0]);if(checkGetDataPredictive(_0x239fea[0x0])){loggerPredictive['info'](JSON[_0x3de1('0x4d')](_0x239fea[0x0]));if(_0x3b6c0c[_0x3de1('0x1d2')]==='dropRate'){return _0x3a208a[_0x3de1('0xc8')](_0x3b6c0c['id'])['then'](function(_0x48232c){var _0x142856=_0x3b6c0c['loggedIn']-_0x48232c[0x0]['outboundQueuePauses'];var _0x848028=_0x3b6c0c['dialPredictiveInterval']*0x3c;var _0xffb574=_0x239fea[0x0][_0x3de1('0x6c')]+_0x239fea[0x0]['predictiveIntervalAvgHoldtime'];var _0x47b448=(_0x239fea[0x0][_0x3de1('0x6a')]+_0x239fea[0x0][_0x3de1('0x6e')]+_0x239fea[0x0][_0x3de1('0x6d')])/_0x239fea[0x0][_0x3de1('0x84')];var _0x5840d9=_0x3b6c0c[_0x3de1('0x1ca')]/0x64;_0x3b6c0c[_0x3de1('0x72')]=_0x48232c[0x0]['outboundQueuePauses']||0x0;_0x3b6c0c[_0x3de1('0x71')]=_0x47b448>0x0?_0x47b448:0x1;return _0x3a208a[_0x3de1('0x1df')](_0x142856,_0x848028,_0xffb574,_0x47b448,_0x5840d9);})[_0x3de1('0x3e')](function(_0x46fbc1){return _0x503410(_0x46fbc1);})[_0x3de1('0xaf')](function(_0x16dc2b){return _0x1464b1(msgResponse(_0x3de1('0x1e5'),'Failure',JSON[_0x3de1('0x4d')](_0x16dc2b)));});}if(_0x3b6c0c[_0x3de1('0x1d2')]===_0x3de1('0x1e0')){return _0x3a208a[_0x3de1('0xc8')](_0x3b6c0c['id'])[_0x3de1('0x3e')](function(_0x48855e){var _0x465ae7=_0x3b6c0c[_0x3de1('0x55')]-_0x48855e[0x0]['outboundQueuePauses'];var _0x30767e=_0x3b6c0c[_0x3de1('0x1d0')]*0x3c;var _0x176a2d=_0x239fea[0x0][_0x3de1('0x6c')]+_0x239fea[0x0]['predictiveIntervalAvgHoldtime'];var _0x3e2ce0=(_0x239fea[0x0][_0x3de1('0x6a')]+_0x239fea[0x0][_0x3de1('0x6e')]+_0x239fea[0x0][_0x3de1('0x6d')])/_0x239fea[0x0]['predictiveIntervalTotalCalls'];var _0x555f28=_0x3b6c0c[_0x3de1('0x1ca')]/0x64;_0x3b6c0c['predictiveIntervalPauses']=_0x48855e[0x0]['outboundQueuePauses']||0x0;_0x3b6c0c[_0x3de1('0x71')]=_0x3e2ce0>0x0?_0x3e2ce0:0x1;return _0x3a208a[_0x3de1('0x1e1')](_0x465ae7,_0x30767e,_0x176a2d,_0x3e2ce0,_0x555f28);})['then'](function(_0x5a20a4){return _0x503410(_0x5a20a4);})['catch'](function(_0xd7f94d){return _0x1464b1(msgResponse('[CatchErlangB]',_0x3de1('0x14a'),JSON[_0x3de1('0x4d')](_0xd7f94d)));});}}else{return _0x1464b1(msgResponse('[getDataPredictive]',_0x3de1('0x14a'),_0x3de1('0x1e4')));}});};};Dialer['prototype'][_0x3de1('0x1d9')]=function(_0x53c4c1){var _0x462bae=this;return function(){var _0x521dd3=0x0;var _0x122f52=Math[_0x3de1('0x1cd')](_0x53c4c1[_0x3de1('0x76')]*0x3e8);if(_0x122f52>0x0){_0x122f52=_0x122f52<0x64?0x64:_0x122f52;loggerPredictive[_0x3de1('0x83')](_0x53c4c1['name'],'one\x20call\x20every:',_0x122f52,_0x3de1('0x4e'));_0x53c4c1[_0x3de1('0x92')]=setInterval(function(){_0x462bae[_0x3de1('0x92')](_0x53c4c1);loggerPredictiveCalls[_0x3de1('0x83')](_0x3de1('0x1e6'),_0x521dd3+=0x1);},_0x122f52);}else{loggerPredictive[_0x3de1('0x83')](_0x53c4c1[_0x3de1('0x43')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x3de1('0xab')][_0x3de1('0x1e7')]=function(_0x25355d,_0x2f8db3){var _0xe07914=this;return function(_0x28cc21){if(_['isEmpty'](_0x28cc21)){if(_[_0x3de1('0xac')](_0x2f8db3[_0x3de1('0x1e8')])||!_0x2f8db3['recallme']){if(_0x25355d[_0x3de1('0x5e')]===_0x3de1('0x9')){_0x25355d['queueStatusComplete']=_[_0x3de1('0x40')](_0x25355d['queueStatusComplete'])?!![]:_0x25355d[_0x3de1('0x133')];var _0xbd41c9=uuid['v4']();_0xe07914[_0x3de1('0x24')][_0xbd41c9]=new Action(_0x25355d,_0x2f8db3,_0xbd41c9);loggerBooked['info']('[booked][checkContactBlack]',_0xbd41c9,_0x3de1('0x1e9'),JSON['stringify'](_0x25355d['queueStatusComplete']),_0x3de1('0x1ea'),_0x25355d['name']);if(_0x25355d[_0x3de1('0x133')]){_0x25355d[_0x3de1('0x133')]=![];_0xe07914[_0x3de1('0x131')][_0xe07914['actions'][_0xbd41c9]['queue']]=[];ami[_0x3de1('0xad')]({'actionid':_0xbd41c9,'action':_0x3de1('0x1eb'),'queue':_0x25355d[_0x3de1('0x43')]})['catch'](function(){_0xe07914[_0x3de1('0xb1')](_0x25355d);_0xe07914[_0x3de1('0xbf')]({'active':![],'ContactId':_0xe07914['actions'][_0xbd41c9][_0x3de1('0xfe')],'ListId':_0xe07914[_0x3de1('0x24')][_0xbd41c9][_0x3de1('0xff')],'VoiceQueueId':_0xe07914[_0x3de1('0x24')][_0xbd41c9]['VoiceQueueId']||undefined,'CampaignId':_0xe07914['actions'][_0xbd41c9][_0x3de1('0xd4')]||undefined})['catch'](loggerCatch(_0x3de1('0x1ec')));delete _0xe07914[_0x3de1('0x24')][_0xbd41c9];});}else{loggerBooked[_0x3de1('0x83')](_0x3de1('0x1ed'),JSON['stringify'](_0x25355d[_0x3de1('0x133')]),_0x3de1('0x1ea'),_0x25355d[_0x3de1('0x43')]);_0xe07914[_0x3de1('0xb1')](_0x25355d);_0xe07914['rescheduleContact']({'active':![],'ContactId':_0xe07914[_0x3de1('0x24')][_0xbd41c9][_0x3de1('0xfe')],'ListId':_0xe07914[_0x3de1('0x24')][_0xbd41c9][_0x3de1('0xff')],'VoiceQueueId':_0xe07914['actions'][_0xbd41c9][_0x3de1('0xd3')]||undefined,'CampaignId':_0xe07914[_0x3de1('0x24')][_0xbd41c9]['CampaignId']||undefined})[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x1ec')));delete _0xe07914[_0x3de1('0x24')][_0xbd41c9];}}else{return _0xe07914[_0x3de1('0x173')](_0x25355d,_0x2f8db3);}}else{if(getDiff(_0x2f8db3[_0x3de1('0x1ee')])<_0x25355d[_0x3de1('0x1ef')]*0x3c){if(_0x2f8db3['Agent']&&!_0x2f8db3[_0x3de1('0x16a')][_0x3de1('0x1f0')]){_0xe07914[_0x3de1('0x94')][_0x3de1('0x13c')](_0x2f8db3['id'])[_0x3de1('0x1d')](function(){_0xe07914[_0x3de1('0xb1')](_0x25355d);});}else{_0xe07914[_0x3de1('0xc1')]({'active':![]},_0x2f8db3['id'],0x1)[_0x3de1('0x1d')](function(){_0xe07914[_0x3de1('0xb1')](_0x25355d);});}}else{_0x25355d[_0x3de1('0x68')]+=0x1;_0xe07914[_0x3de1('0xb1')](_0x25355d);if(_0x25355d['dialRecallInQueue']){_0xe07914[_0x3de1('0xbf')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x2f8db3['ContactId'],'ListId':_0x2f8db3[_0x3de1('0xff')],'VoiceQueueId':_0x2f8db3['VoiceQueueId']||undefined,'CampaignId':_0x2f8db3[_0x3de1('0xd4')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0xe07914['createHistory'](createObjHistory(_0x25355d,_0x2f8db3,_0x3de1('0x1f1'),0x17,'RecallInQueue'))[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x1f2')));}else{_0xe07914[_0x3de1('0xe8')](createObjHistory(_0x25355d,_0x2f8db3,_0x3de1('0x1f3'),0x16,_0x3de1('0x1f4')),_0x3de1('0x1f5'),'[Originate][HistoryRecallClose]');}}}}else{_0x25355d['outboundBlacklistCallsDay']+=0x1;_0xe07914[_0x3de1('0xe8')](createObjHistory(_0x25355d,_0x2f8db3,'BLACKLIST',0xd,_0x3de1('0x1f6')),_0x3de1('0x1f7'),_0x3de1('0x1f8'));throw'inBlackList';}};};Dialer['prototype'][_0x3de1('0x161')]=function(_0x25a41d){var _0x47d940=this;var _0x5b94ea=_0x25a41d[_0x3de1('0x1f9')]-_0x25a41d[_0x3de1('0x74')]-_0x25a41d[_0x3de1('0xc4')];emitCampaignSummary(_0x25a41d);if(_0x5b94ea>0x0){if(_0x5b94ea>this['maxNumberOriginate']){_0x5b94ea=this[_0x3de1('0x23')];}_0x25a41d[_0x3de1('0xc4')]+=_0x5b94ea;this[_0x3de1('0xc6')](_0x25a41d['id'],_0x5b94ea,_0x25a41d['dialOrderByScheduledAt'],_0x25a41d)[_0x3de1('0x3e')](function(_0x1e8638){_0x25a41d[_0x3de1('0xc4')]-=_0x5b94ea;_0x25a41d[_0x3de1('0xc4')]=_0x25a41d['temp']>0x0?_0x25a41d['temp']:0x0;if(!checkContactEmpty(_0x1e8638)){_0x25a41d[_0x3de1('0x41')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0x3de1('0x1fa')+_0x25a41d['name']);}else{_0x25a41d[_0x3de1('0x74')]+=_0x1e8638[_0x3de1('0x9b')];_0x25a41d[_0x3de1('0x41')]=_0x3de1('0x1fb');for(var _0x45051b=0x0;_0x45051b<_0x1e8638[_0x3de1('0x9b')];_0x45051b+=0x1){_0x25a41d[_0x3de1('0x1fc')]+=0x1;if(_[_0x3de1('0xac')](_0x1e8638[_0x45051b])||_[_0x3de1('0xac')](_0x1e8638[_0x45051b]['Contact'])||_['isNil'](_0x1e8638[_0x45051b][_0x3de1('0x176')])){_0x47d940['emptyContact'](_0x3de1('0x1fd'),_0x25a41d,_0x1e8638[_0x45051b]);}else{_0x47d940[_0x3de1('0xba')](_[_0x3de1('0xd2')](_0x1e8638[_0x45051b],[_0x3de1('0xd4'),_0x3de1('0x1fe')]))['then'](_0x47d940[_0x3de1('0x1e7')](_0x25a41d,_0x1e8638[_0x45051b]))['catch'](_0x47d940[_0x3de1('0xcf')](_0x3de1('0x1ff'),_0x25a41d));}}}})[_0x3de1('0xaf')](loggerGetContactDialer(_0x3de1('0x200'),_0x25a41d,_0x5b94ea));}};Dialer['prototype'][_0x3de1('0x15d')]=function(_0x22ef2d,_0x28838a){var _0x35b5fe=this;var _0x440557=[];var _0xa46a89=_0x28838a>=0x1?_0x28838a:0x1;if(_0x22ef2d[_0x3de1('0x5e')]===_0x3de1('0x9')){_0xa46a89=0x1;}var _0x5e0c42=Math[_0x3de1('0x1cd')](_0x22ef2d[_0x3de1('0x54')]*_0xa46a89)-_0x22ef2d[_0x3de1('0x74')]-_0x22ef2d[_0x3de1('0xc4')];emitVoiceQueueSummary(_0x22ef2d);if(_0x22ef2d[_0x3de1('0x201')]>0x0){var _0xe15c78=_0x22ef2d[_0x3de1('0x201')]-_0x22ef2d[_0x3de1('0x74')]-_0x22ef2d[_0x3de1('0x5a')]-_0x22ef2d[_0x3de1('0xc4')]-_0x22ef2d[_0x3de1('0x56')];if(_0x5e0c42>_0xe15c78){_0x5e0c42=_0xe15c78;}}if(_0x5e0c42>0x0){if(_0x22ef2d[_0x3de1('0x5e')]===_0x3de1('0x9')){_0x5e0c42=0x1;}if(_0x5e0c42>this[_0x3de1('0x23')]){_0x5e0c42=this[_0x3de1('0x23')];}_0x22ef2d[_0x3de1('0xc4')]+=_0x5e0c42;for(var _0x26636f in this[_0x3de1('0x21')]){if(typeof this[_0x3de1('0x21')][_0x26636f]!==_0x3de1('0x9c')){if(this['agents'][_0x26636f][_0x3de1('0xa7')]===_0x3de1('0x202')&&this['agents'][_0x26636f][_0x3de1('0xae')]===_0x3de1('0x203')){_0x440557[_0x3de1('0x204')](this[_0x3de1('0x21')][_0x26636f]['id']);}}}this['getContactDialer'](_0x22ef2d['id'],_0x440557,_0x5e0c42,_0x22ef2d[_0x3de1('0x205')],_0x22ef2d)['then'](function(_0x2077d){_0x22ef2d['temp']-=_0x5e0c42;_0x22ef2d['temp']=_0x22ef2d[_0x3de1('0xc4')]>0x0?_0x22ef2d[_0x3de1('0xc4')]:0x0;if(!checkContactEmpty(_0x2077d)){_0x35b5fe[_0x3de1('0xb4')](_0x22ef2d)[_0x3de1('0x3e')](sendMessageReschedule(_0x22ef2d))[_0x3de1('0xaf')](loggerCatch(_0x3de1('0x206')));}else{_0x22ef2d[_0x3de1('0x74')]+=_0x2077d['length'];_0x22ef2d[_0x3de1('0x41')]=_0x22ef2d['dialMethod']===_0x3de1('0x9')?'ACTIVE':_0x3de1('0x1fb');for(var _0x16e029=0x0;_0x16e029<_0x2077d[_0x3de1('0x9b')];_0x16e029+=0x1){if(_['isNil'](_0x2077d[_0x16e029])||_[_0x3de1('0xac')](_0x2077d[_0x16e029]['Contact'])||_[_0x3de1('0xac')](_0x2077d[_0x16e029]['phone'])){_0x35b5fe[_0x3de1('0xd0')](_0x3de1('0x1fd'),_0x22ef2d,_0x2077d[_0x16e029]);}else{_0x35b5fe[_0x3de1('0xb5')](_['pick'](_0x2077d[_0x16e029],[_0x3de1('0xd3'),_0x3de1('0x1fe')]))[_0x3de1('0x3e')](_0x35b5fe[_0x3de1('0x1e7')](_0x22ef2d,_0x2077d[_0x16e029]))[_0x3de1('0xaf')](_0x35b5fe[_0x3de1('0xcf')](_0x3de1('0x1fd'),_0x22ef2d));}}}})[_0x3de1('0xaf')](loggerGetContactDialer(_0x3de1('0x207'),_0x22ef2d,_0x5e0c42));}};Dialer[_0x3de1('0xab')]['handlePredictive']=function(_0x2c035b){if(_0x2c035b[_0x3de1('0x201')]>0x0){var _0x2f03ec=_0x2c035b[_0x3de1('0x201')]-_0x2c035b['originated']-_0x2c035b['talking'];if(_0x2f03ec>0x0){this[_0x3de1('0x208')](_0x2c035b);}else{loggerPredictiveCalls[_0x3de1('0x83')]('[handlePredictive][limitChannel]');}}else{this[_0x3de1('0x208')](_0x2c035b);}};Dialer[_0x3de1('0xab')]['tryOriginatePredictive']=function(_0x624fb2){var _0xe7f2a3=this;var _0x46f1dd=[];_0x624fb2['originated']+=0x1;for(var _0x2009f8 in this['agents']){if(typeof this[_0x3de1('0x21')][_0x2009f8]!==_0x3de1('0x9c')){if(this['agents'][_0x2009f8]['state']===_0x3de1('0x202')&&this[_0x3de1('0x21')][_0x2009f8][_0x3de1('0xae')]===_0x3de1('0x203')){_0x46f1dd[_0x3de1('0x204')](this[_0x3de1('0x21')][_0x2009f8]['id']);}}}this[_0x3de1('0xc3')](_0x624fb2['id'],_0x46f1dd,0x1,_0x624fb2['dialOrderByScheduledAt'],_0x624fb2)['then'](function(_0x37fe39){if(!checkContactEmpty(_0x37fe39)){checkContactLowerLimitOriginate(_0x624fb2,0x1,0x0);_0xe7f2a3[_0x3de1('0xb4')](_0x624fb2)[_0x3de1('0x3e')](sendMessageReschedule(_0x624fb2))['catch'](loggerCatch(_0x3de1('0x206')));}else{_0x624fb2[_0x3de1('0x41')]=_0x3de1('0x1fb');if(_[_0x3de1('0xac')](_0x37fe39[0x0])||_[_0x3de1('0xac')](_0x37fe39[0x0]['Contact'])||_['isNil'](_0x37fe39[0x0][_0x3de1('0x176')])){_0xe7f2a3[_0x3de1('0xd0')](_0x3de1('0x1fd'),_0x624fb2,_0x37fe39[0x0]);}else{_0xe7f2a3[_0x3de1('0xb5')](_['pick'](_0x37fe39[0x0],[_0x3de1('0xd3'),'Contact.phone']))['then'](_0xe7f2a3['checkContactBlack'](_0x624fb2,_0x37fe39[0x0]))[_0x3de1('0xaf')](_0xe7f2a3[_0x3de1('0xcf')](_0x3de1('0x209'),_0x624fb2));}}})[_0x3de1('0xaf')](loggerGetContactDialer(_0x3de1('0x20a'),_0x624fb2,0x1));emitVoiceQueueSummary(_0x624fb2);};Dialer[_0x3de1('0xab')]['abandonmentRate']=function(_0x3d5cde,_0x1d1e67,_0xddd895,_0x37acb4,_0x1db265,_0x3e98bc){loggerPredictive['info'](_0x3de1('0x20b'));loggerPredictive[_0x3de1('0x83')]('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3d5cde);loggerPredictive['info'](_0x3de1('0x20c'),_0x1d1e67);loggerPredictive[_0x3de1('0x83')](_0x3de1('0x20d'),_0xddd895);loggerPredictive[_0x3de1('0x83')](_0x3de1('0x20e'),_0x37acb4);loggerPredictive[_0x3de1('0x83')](_0x3de1('0x20f'),_0x1db265);loggerPredictive[_0x3de1('0x83')]('---------------------------');return new BPromise(function(_0x3a279b,_0x7c9e29){if(_0x3d5cde<=0x0||isNaN(_0x3d5cde)){return _0x7c9e29(msgResponse(_0x3de1('0x210'),'Error',_0x3de1('0x211')+_0x3d5cde));}if(_0xddd895<=0x0||isNaN(_0xddd895)){return _0x7c9e29(msgResponse(_0x3de1('0x210'),_0x3de1('0x4c'),'Ts\x20=\x20'+_0xddd895));}if(_0x37acb4<=0x0||isNaN(_0x37acb4)){return _0x7c9e29(msgResponse(_0x3de1('0x210'),_0x3de1('0x4c'),_0x3de1('0x212')+_0x37acb4));}if(_0x1d1e67<=0x0||isNaN(_0x1d1e67)){return _0x7c9e29(msgResponse('[abandonmentRate]',_0x3de1('0x4c'),_0x3de1('0x213')+_0x1d1e67));}if(_0x1db265<=0x0||isNaN(_0x1db265)){return _0x7c9e29(msgResponse('[abandonmentRate]',_0x3de1('0x4c'),_0x3de1('0x214')+_0x1db265));}_0x3e98bc=_0x3e98bc||0x0;var _0x1a76a9=0x1/_0xddd895;var _0x4f1901=0x0;var _0x5eac94=0x0;var _0x5d4a25=0x0;var _0x4e1703=0x0;for(var _0x72b847=0x0;_0x5d4a25<_0x1db265;_0x72b847+=0x1){_0x5eac94=_0x72b847/_0x1d1e67;_0x4f1901=(_0x37acb4*_0x5eac94+_0x3e98bc)/_0x1a76a9;_0x5d4a25=erlangb(_0x4f1901,_0x3d5cde);_0x4e1703=_0x4f1901/_0x3d5cde*(0x1-erlangb(_0x4f1901,_0x3d5cde));}return _0x3a279b({'erlangCalls':_0x72b847,'erlangCallToSecond':_0x1d1e67/_0x72b847,'erlangAbandonmentRate':_0x5d4a25,'erlangBusyFactor':_0x4e1703});});};Dialer[_0x3de1('0xab')][_0x3de1('0x1e1')]=function(_0xbb70a6,_0xcea02,_0x1e2c36,_0x4f456e,_0x433d5c,_0x10a588){loggerPredictive[_0x3de1('0x83')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x3de1('0x83')](_0x3de1('0x215'),_0xbb70a6);loggerPredictive[_0x3de1('0x83')](_0x3de1('0x20c'),_0xcea02);loggerPredictive[_0x3de1('0x83')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e2c36);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4f456e);loggerPredictive[_0x3de1('0x83')](_0x3de1('0x216'),_0x433d5c);loggerPredictive[_0x3de1('0x83')]('---------------------------');return new BPromise(function(_0x1cb993,_0x2014f2){if(_0xbb70a6<=0x0||isNaN(_0xbb70a6)){return _0x2014f2(msgResponse(_0x3de1('0x217'),_0x3de1('0x4c'),_0x3de1('0x211')+_0xbb70a6));}if(_0x1e2c36<=0x0||isNaN(_0x1e2c36)){return _0x2014f2(msgResponse('[busyFactor]',_0x3de1('0x4c'),'Ts\x20=\x20'+_0x1e2c36));}if(_0x4f456e<=0x0||isNaN(_0x4f456e)){return _0x2014f2(msgResponse(_0x3de1('0x217'),_0x3de1('0x4c'),_0x3de1('0x212')+_0x4f456e));}if(_0xcea02<=0x0||isNaN(_0xcea02)){return _0x2014f2(msgResponse(_0x3de1('0x217'),_0x3de1('0x4c'),_0x3de1('0x213')+_0xcea02));}if(_0x433d5c<=0x0||isNaN(_0x433d5c)){return _0x2014f2(msgResponse(_0x3de1('0x217'),_0x3de1('0x4c'),'Umin\x20=\x20'+_0x433d5c));}_0x10a588=_0x10a588||0x0;var _0x58f068=0x1/_0x1e2c36;var _0x1e28bc=0x0;var _0x5c4397=0x0;var _0x3cfee1=0x0;var _0x5a772b=0x0;for(var _0x50a5a2=0x0;_0x5a772b<_0x433d5c;_0x50a5a2+=0x1){_0x5c4397=_0x50a5a2/_0xcea02;_0x1e28bc=(_0x4f456e*_0x5c4397+_0x10a588)/_0x58f068;_0x3cfee1=erlangb(_0x1e28bc,_0xbb70a6);_0x5a772b=_0x1e28bc/_0xbb70a6*(0x1-erlangb(_0x1e28bc,_0xbb70a6));}return _0x1cb993({'erlangCalls':_0x50a5a2,'erlangCallToSecond':_0xcea02/_0x50a5a2,'erlangAbandonmentRate':_0x3cfee1,'erlangBusyFactor':_0x5a772b});});};module['exports']=Dialer;
\ No newline at end of file
index 71344ff..4a0e863 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03b7=['responsetime','droptime','ringtime','holdtime','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x03b7,0x85));var _0x703b=function(_0x4faf34,_0x2063a2){_0x4faf34=_0x4faf34-0x0;var _0x32e8b4=_0x03b7[_0x4faf34];return _0x32e8b4;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x703b('0x0'));function getSeconds(_0x552697,_0x5df495){var _0x2082cd=moment(_0x552697)[_0x703b('0x1')](0x0);var _0x36dfc2=moment(_0x5df495)[_0x703b('0x1')](0x0);return _0x2082cd[_0x703b('0x2')](_0x36dfc2,_0x703b('0x3'));}function QueueCallerAbandon(_0x1768dd,_0xa56f42){this[_0x703b('0x4')]=_0x1768dd[_0x703b('0x4')];this[_0x703b('0x5')]=_0x1768dd[_0x703b('0x5')];this[_0x703b('0x6')]=_0x1768dd[_0x703b('0x5')]===_0x703b('0x7')?_0x703b('0x8'):_0x1768dd[_0x703b('0x5')];this[_0x703b('0x9')]=_0x1768dd[_0x703b('0x9')];this[_0x703b('0xa')]=_0x1768dd[_0x703b('0xa')];this[_0x703b('0xb')]=_0x1768dd[_0x703b('0xb')];this[_0x703b('0xc')]=_0x1768dd[_0x703b('0x9')]+_0x1768dd['countcongestionretry']+_0x1768dd[_0x703b('0xb')]+_0x1768dd[_0x703b('0xd')]+_0x1768dd['countdropretry']+_0x1768dd[_0x703b('0xe')]+_0x1768dd[_0x703b('0xf')]+_0x1768dd[_0x703b('0x10')];this[_0x703b('0xd')]=_0x1768dd[_0x703b('0xd')];this['countdropretry']=_0x1768dd['countdropretry'];this[_0x703b('0xe')]=_0x1768dd[_0x703b('0xe')];this['countmachineretry']=_0x1768dd['countmachineretry'];this[_0x703b('0x10')]=_0x1768dd[_0x703b('0x10')];this[_0x703b('0x11')]=_0xa56f42[_0x703b('0x11')];this[_0x703b('0x12')]=_0x1768dd[_0x703b('0x13')];this[_0x703b('0x14')]=_0x1768dd[_0x703b('0x15')];this['starttime']=_0x1768dd[_0x703b('0x16')];this['responsetime']=_0x1768dd[_0x703b('0x17')];this[_0x703b('0x18')]=_0x1768dd['droptime'];this['endtime']=this['droptime'];this[_0x703b('0x19')]=getSeconds(_0x1768dd[_0x703b('0x17')],_0x1768dd[_0x703b('0x16')]);this[_0x703b('0x1a')]=getSeconds(this[_0x703b('0x18')],_0x1768dd[_0x703b('0x17')]);this['talktime']=0x0;this[_0x703b('0x8')]=_0xa56f42[_0x703b('0x8')];this['membername']=_0xa56f42['connectedlinename'];this[_0x703b('0x1b')]=_0xa56f42[_0x703b('0x1b')];this['callback']=_0x1768dd[_0x703b('0x1c')];this[_0x703b('0x1d')]=_0x1768dd[_0x703b('0x1d')];this['callbackat']=_0x1768dd[_0x703b('0x1e')];this['recallme']=_0x1768dd['recallme'];this[_0x703b('0x1f')]=_0x1768dd[_0x703b('0x1f')];this[_0x703b('0x20')]=_0x1768dd[_0x703b('0x20')];this[_0x703b('0x21')]=_0x1768dd[_0x703b('0x21')];this[_0x703b('0x22')]=_0x1768dd[_0x703b('0x22')];this[_0x703b('0x23')]=_0x1768dd[_0x703b('0x23')];this['originatecalleridnum']=_0x1768dd[_0x703b('0x24')]||'';this['originatecalleridname']=_0x1768dd[_0x703b('0x25')]||'';}module[_0x703b('0x26')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x14c8=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','diff','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x1b4f7c,_0x1eb951){var _0x4987dc=function(_0xe81f29){while(--_0xe81f29){_0x1b4f7c['push'](_0x1b4f7c['shift']());}};_0x4987dc(++_0x1eb951);}(_0x14c8,0x180));var _0x814c=function(_0x46b3a0,_0x4703f3){_0x46b3a0=_0x46b3a0-0x0;var _0x59cbbe=_0x14c8[_0x46b3a0];return _0x59cbbe;};'use strict';var util=require(_0x814c('0x0'));var _=require(_0x814c('0x1'));var moment=require(_0x814c('0x2'));function getSeconds(_0x3eed36,_0x26da31){var _0x299054=moment(_0x3eed36)['milliseconds'](0x0);var _0x467469=moment(_0x26da31)['milliseconds'](0x0);return _0x299054[_0x814c('0x3')](_0x467469,'seconds');}function QueueCallerAbandon(_0x5c6dc6,_0x2d9d1c){this['scheduledat']=_0x5c6dc6[_0x814c('0x4')];this['type']=_0x5c6dc6[_0x814c('0x5')];this[_0x814c('0x6')]=_0x5c6dc6['type']===_0x814c('0x7')?'queue':_0x5c6dc6[_0x814c('0x5')];this[_0x814c('0x8')]=_0x5c6dc6[_0x814c('0x8')];this[_0x814c('0x9')]=_0x5c6dc6['countcongestionretry'];this['countnoanswerretry']=_0x5c6dc6[_0x814c('0xa')];this[_0x814c('0xb')]=_0x5c6dc6[_0x814c('0x8')]+_0x5c6dc6[_0x814c('0x9')]+_0x5c6dc6[_0x814c('0xa')]+_0x5c6dc6[_0x814c('0xc')]+_0x5c6dc6[_0x814c('0xd')]+_0x5c6dc6[_0x814c('0xe')]+_0x5c6dc6[_0x814c('0xf')]+_0x5c6dc6[_0x814c('0x10')];this['countnosuchnumberretry']=_0x5c6dc6[_0x814c('0xc')];this[_0x814c('0xd')]=_0x5c6dc6[_0x814c('0xd')];this['countabandonedretry']=_0x5c6dc6[_0x814c('0xe')];this['countmachineretry']=_0x5c6dc6[_0x814c('0xf')];this[_0x814c('0x10')]=_0x5c6dc6[_0x814c('0x10')];this[_0x814c('0x11')]=_0x2d9d1c[_0x814c('0x11')];this[_0x814c('0x12')]=_0x5c6dc6[_0x814c('0x13')];this[_0x814c('0x14')]=_0x5c6dc6[_0x814c('0x15')];this[_0x814c('0x16')]=_0x5c6dc6[_0x814c('0x16')];this[_0x814c('0x17')]=_0x5c6dc6['responsetime'];this[_0x814c('0x18')]=_0x5c6dc6[_0x814c('0x18')];this[_0x814c('0x19')]=this[_0x814c('0x18')];this[_0x814c('0x1a')]=getSeconds(_0x5c6dc6[_0x814c('0x17')],_0x5c6dc6['starttime']);this[_0x814c('0x1b')]=getSeconds(this[_0x814c('0x18')],_0x5c6dc6['responsetime']);this['talktime']=0x0;this[_0x814c('0x1c')]=_0x2d9d1c[_0x814c('0x1c')];this[_0x814c('0x1d')]=_0x2d9d1c['connectedlinename'];this[_0x814c('0x1e')]=_0x2d9d1c[_0x814c('0x1e')];this[_0x814c('0x1f')]=_0x5c6dc6['callback'];this[_0x814c('0x20')]=_0x5c6dc6[_0x814c('0x20')];this[_0x814c('0x21')]=_0x5c6dc6[_0x814c('0x21')];this[_0x814c('0x22')]=_0x5c6dc6[_0x814c('0x22')];this['ContactId']=_0x5c6dc6[_0x814c('0x23')];this[_0x814c('0x24')]=_0x5c6dc6[_0x814c('0x24')];this[_0x814c('0x25')]=_0x5c6dc6[_0x814c('0x25')];this['VoiceQueueId']=_0x5c6dc6[_0x814c('0x26')];this[_0x814c('0x27')]=_0x5c6dc6[_0x814c('0x27')];this[_0x814c('0x28')]=_0x5c6dc6['originatecalleridnum']||'';this[_0x814c('0x29')]=_0x5c6dc6[_0x814c('0x29')]||'';}module['exports']=QueueCallerAbandon;
\ No newline at end of file
index 85825a5..38bb4a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x53fd59,_0x401c05){var _0x450ab9=function(_0x51f899){while(--_0x51f899){_0x53fd59['push'](_0x53fd59['shift']());}};_0x450ab9(++_0x401c05);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action;
\ No newline at end of file
+var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x2e0bd8,_0x11e41d){var _0x5cb4b5=function(_0x416739){while(--_0x416739){_0x2e0bd8['push'](_0x2e0bd8['shift']());}};_0x5cb4b5(++_0x11e41d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action;
\ No newline at end of file
index 6930d3b..2087460 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7294=['variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','unmonitored','\x20Trunk\x20is\x20not\x20active','Is\x20Valid','exports','util','lodash','bluebird','moment','tiff2pdf','./util/gs','../../../config/logger','./channel','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','uniqueid','channel','name','actions','info','variable','value','channelstate','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','notify','calleridnum','fax','.pdf','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','then','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x7294,0x1db));var _0x4729=function(_0x1a170c,_0x120c51){_0x1a170c=_0x1a170c-0x0;var _0xbb5e7c=_0x7294[_0x1a170c];return _0xbb5e7c;};'use strict';var util=require(_0x4729('0x0'));var _=require(_0x4729('0x1'));var BPromise=require(_0x4729('0x2'));var uuid=require('uuid');var moment=require(_0x4729('0x3'));var path=require('path');var tiff2pdf=require(_0x4729('0x4'));var gs=require(_0x4729('0x5'));var logger=require(_0x4729('0x6'))('fax');var ami=require('../ami');var rpcDb=require('./rpcDb');var Channel=require(_0x4729('0x7'));var ut=require('./util/util');var Action=require('./action');var faxAccount=require(_0x4729('0x8'));var attachment=require(_0x4729('0x9'));var faxMessage=require(_0x4729('0xa'));function Fax(_0x4063fa){this[_0x4729('0xb')]={};this[_0x4729('0xc')]=_0x4063fa['faxAccounts'];this[_0x4729('0xd')]=_0x4063fa['trunks'];this['actions']={};ami['on'](_0x4729('0xe'),this[_0x4729('0xf')]['bind'](this));ami['on'](_0x4729('0x10'),this[_0x4729('0x11')][_0x4729('0x12')](this));ami['on'](_0x4729('0x13'),this[_0x4729('0x14')]['bind'](this));ami['on'](_0x4729('0x15'),this[_0x4729('0x16')][_0x4729('0x12')](this));ami['on'](_0x4729('0x17'),this[_0x4729('0x18')][_0x4729('0x12')](this));ami['on'](_0x4729('0x19'),this[_0x4729('0x1a')][_0x4729('0x12')](this));ami['on']('hangup',this[_0x4729('0x1b')][_0x4729('0x12')](this));ami['on'](_0x4729('0x1c'),this[_0x4729('0x1d')]['bind'](this));}Fax[_0x4729('0x1e')][_0x4729('0xf')]=function(_0x460263){if(_0x460263[_0x4729('0x1f')]===_0x4729('0x20')){for(var _0x28d069 in this[_0x4729('0xc')]){if(this[_0x4729('0xc')][_0x4729('0x21')](_0x28d069)){if(_0x460263['exten']===this[_0x4729('0xc')][_0x28d069]['localstationid']){this[_0x4729('0xb')][_0x460263[_0x4729('0x22')]]={};this['channels'][_0x460263['uniqueid']]['channel']=_0x460263[_0x4729('0x23')];this['channels'][_0x460263[_0x4729('0x22')]]['id']=this[_0x4729('0xc')][_0x28d069]['id'];this[_0x4729('0xb')][_0x460263['uniqueid']][_0x4729('0x24')]=this[_0x4729('0xc')][_0x28d069][_0x4729('0x24')];logger['info'](_0x460263[_0x4729('0x22')],'\x20syncNewchannel\x20');}}}}if(this[_0x4729('0x25')][_0x460263[_0x4729('0x22')]]){this[_0x4729('0xb')][_0x460263['uniqueid']]={};this[_0x4729('0xb')][_0x460263['uniqueid']][_0x4729('0x23')]=_0x460263[_0x4729('0x23')];logger[_0x4729('0x26')](_0x460263[_0x4729('0x22')],'\x20syncNewchannel\x20');}};Fax[_0x4729('0x1e')]['syncVarSet']=function(_0x188ffb){if(this[_0x4729('0xb')][_0x188ffb[_0x4729('0x22')]]){for(var _0x4143e8 in _0x188ffb[_0x4729('0x27')]){if(_0x188ffb[_0x4729('0x27')][_0x4729('0x21')](_0x4143e8)){this['channels'][_0x188ffb[_0x4729('0x22')]][_0x4143e8]=_0x188ffb[_0x4729('0x28')];}}}};Fax['prototype']['syncNewState']=function(_0x242c9c){if(this[_0x4729('0xb')][_0x242c9c[_0x4729('0x22')]]){this[_0x4729('0xb')][_0x242c9c[_0x4729('0x22')]][_0x4729('0x29')]=_0x242c9c['channelstate'];this[_0x4729('0xb')][_0x242c9c[_0x4729('0x22')]][_0x4729('0x2a')]=_0x242c9c[_0x4729('0x2a')];}};Fax[_0x4729('0x1e')]['syncNewExten']=function(_0x4cf479){if(this[_0x4729('0xb')][_0x4cf479[_0x4729('0x22')]]){for(var _0x4754c3 in _0x4cf479['variable']){if(_0x4cf479[_0x4729('0x27')][_0x4729('0x21')](_0x4754c3)){this[_0x4729('0xb')][_0x4cf479['uniqueid']][_0x4754c3]=_0x4cf479[_0x4729('0x28')];}}}};Fax[_0x4729('0x1e')][_0x4729('0x18')]=function(_0x5f0e9c){if(this['channels'][_0x5f0e9c[_0x4729('0x22')]]){this[_0x4729('0xb')][_0x5f0e9c[_0x4729('0x22')]][_0x4729('0x2b')]=_0x5f0e9c['operation'];this[_0x4729('0xb')][_0x5f0e9c[_0x4729('0x22')]][_0x4729('0x2c')]=_0x5f0e9c[_0x4729('0x2c')];this[_0x4729('0xb')][_0x5f0e9c[_0x4729('0x22')]][_0x4729('0x2d')]=_0x5f0e9c['localstationid'];this[_0x4729('0xb')][_0x5f0e9c[_0x4729('0x22')]][_0x4729('0x2e')]=_0x5f0e9c['filename'];logger[_0x4729('0x26')](_0x5f0e9c[_0x4729('0x22')],_0x4729('0x2f'));}};Fax['prototype'][_0x4729('0x1a')]=function(_0x2c5f77){var _0x56a799=this;if(this['channels'][_0x2c5f77[_0x4729('0x22')]]){var _0x2074a5=this[_0x4729('0xb')][_0x2c5f77[_0x4729('0x22')]]['id'];this[_0x4729('0xb')][_0x2c5f77[_0x4729('0x22')]][_0x4729('0x30')]=_0x2c5f77[_0x4729('0x30')];this[_0x4729('0xb')][_0x2c5f77[_0x4729('0x22')]]['pagestransferred']=_0x2c5f77[_0x4729('0x31')];this[_0x4729('0xb')][_0x2c5f77[_0x4729('0x22')]][_0x4729('0x2d')]=_0x2c5f77[_0x4729('0x2d')];this['channels'][_0x2c5f77[_0x4729('0x22')]][_0x4729('0x32')]=_0x2c5f77[_0x4729('0x32')];this[_0x4729('0xb')][_0x2c5f77[_0x4729('0x22')]][_0x4729('0x33')]=_0x2c5f77[_0x4729('0x33')];this['channels'][_0x2c5f77[_0x4729('0x22')]][_0x4729('0x2e')]=_0x2c5f77[_0x4729('0x2e')];this[_0x4729('0xb')][_0x2c5f77[_0x4729('0x22')]]['calleridnum']=_0x2c5f77['calleridnum'];if(this[_0x4729('0xb')][_0x2c5f77[_0x4729('0x22')]][_0x4729('0x31')]>0x0){tiff2pdf(_0x2c5f77[_0x4729('0x2e')],_0x4729('0x34'),function(_0x522b8b){logger[_0x4729('0x26')](_0x2c5f77[_0x4729('0x22')],_0x4729('0x35'),_0x522b8b[_0x4729('0x36')]);attachment[_0x4729('0x37')]({'name':path[_0x4729('0x38')](_0x2c5f77['filename'])[_0x4729('0x24')],'basename':path[_0x4729('0x38')](_0x2c5f77['filename'])['name']+'.pdf','type':'application/pdf'})['then'](function(_0x4f1d7a){faxAccount[_0x4729('0x39')](_0x2074a5,{'from':_0x2c5f77[_0x4729('0x3a')],'mapKey':_0x4729('0x3b'),'body':path[_0x4729('0x38')](_0x2c5f77[_0x4729('0x2e')])['name']+_0x4729('0x3c'),'AttachmentId':_0x4f1d7a['id']})[_0x4729('0x3d')](function(_0x284dab){logger[_0x4729('0x3e')](_0x2c5f77[_0x4729('0x22')],_0x4729('0x3f'),JSON[_0x4729('0x40')](_0x284dab));});})[_0x4729('0x3d')](function(_0x46408a){logger[_0x4729('0x3e')](_0x2c5f77[_0x4729('0x22')],_0x4729('0x41'),JSON[_0x4729('0x40')](_0x46408a));});});}logger[_0x4729('0x26')](_0x2c5f77[_0x4729('0x22')],_0x4729('0x41'));}};Fax['prototype']['syncOriginateResponse']=function(_0x16c11b){if(this[_0x4729('0x25')][_0x16c11b['uniqueid']]){_[_0x4729('0x42')](this[_0x4729('0xb')][_0x16c11b['uniqueid']],_[_0x4729('0x43')](_0x16c11b,[_0x4729('0x44'),_0x4729('0x45')]));}};function updateStatus(_0x5d70e2){if(_0x5d70e2['AttachmentId']){faxMessage['update'](_0x5d70e2[_0x4729('0x46')],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x11c4e1){ut[_0x4729('0x47')](_0x4729('0x48'),_0x11c4e1);})[_0x4729('0x3d')](function(_0x3e0fe6){ut[_0x4729('0x47')](_0x4729('0x49'),_0x3e0fe6);});}else{ut[_0x4729('0x47')](_0x4729('0x4a'));}}Fax[_0x4729('0x1e')][_0x4729('0x4b')]=function(_0x34104e,_0x2c22fc,_0x519dc9){var _0x135a5a=this;var _0x53e7f9={};if(_0x2c22fc){_0x53e7f9={'read':_0x2c22fc};}else{_0x53e7f9={'failMessage':_0x519dc9};}if(this[_0x4729('0x25')][_0x34104e][_0x4729('0x46')]){faxMessage[_0x4729('0x4c')](this[_0x4729('0x25')][_0x34104e]['AttachmentId'],_0x53e7f9)['then'](function(_0x5b8fea){ut[_0x4729('0x47')]('[Fax][Message][Updated]',_0x5b8fea);})[_0x4729('0x3d')](function(_0x2abfb0){ut[_0x4729('0x47')](_0x4729('0x4d'),_0x2abfb0);})[_0x4729('0x4e')](function(){delete _0x135a5a[_0x4729('0xb')][_0x34104e];delete _0x135a5a[_0x4729('0x25')][_0x34104e];});}else{ut[_0x4729('0x47')](_0x4729('0x4f'));delete this[_0x4729('0xb')][_0x34104e];delete this[_0x4729('0x25')][_0x34104e];}};Fax[_0x4729('0x1e')][_0x4729('0x1b')]=function(_0x416e30){var _0x297453=this;if(this[_0x4729('0xb')][_0x416e30['uniqueid']]){if(this[_0x4729('0x25')][_0x416e30[_0x4729('0x22')]]){this[_0x4729('0xb')][_0x416e30[_0x4729('0x22')]]['id']=this[_0x4729('0x25')][_0x416e30[_0x4729('0x22')]]['id'];this[_0x4729('0xb')][_0x416e30[_0x4729('0x22')]][_0x4729('0x24')]=this[_0x4729('0x25')][_0x416e30[_0x4729('0x22')]][_0x4729('0x24')];}logger['info'](_0x416e30[_0x4729('0x22')],this[_0x4729('0x25')][_0x416e30['uniqueid']]?_0x4729('0x50'):_0x4729('0x51'),JSON[_0x4729('0x40')](this[_0x4729('0xb')][_0x416e30['uniqueid']]));if(this[_0x4729('0x25')][_0x416e30[_0x4729('0x22')]]){if(this['channels'][_0x416e30['uniqueid']][_0x4729('0x52')]>0x0&&this['channels'][_0x416e30[_0x4729('0x22')]]['faxstatus']===_0x4729('0x53')){this[_0x4729('0x4b')](_0x416e30[_0x4729('0x22')],!![]);}else{this[_0x4729('0x4b')](_0x416e30[_0x4729('0x22')],![],this[_0x4729('0xb')][_0x416e30[_0x4729('0x22')]]['faxstatusstring']?_0x4729('0x54')+this[_0x4729('0xb')][_0x416e30[_0x4729('0x22')]]['faxstatusstring']:'SENDING\x20FAILED');}}}};Fax['prototype'][_0x4729('0x55')]=function(_0x1e57c3){var _0x588e88=this;return new BPromise(function(_0x2e443c,_0x15704a){_0x588e88[_0x4729('0x56')](_0x1e57c3,_0x588e88[_0x4729('0xc')][_0x1e57c3[_0x4729('0x57')]])[_0x4729('0x58')](function(_0x2801b4){ut[_0x4729('0x47')](_0x4729('0x59'),_0x2801b4);_0x2e443c(ut[_0x4729('0x36')]('Fax\x20received'));})[_0x4729('0x3d')](function(_0x118233){ut['logger'](_0x4729('0x5a'),_0x118233);updateStatus(_0x1e57c3);_0x15704a(ut[_0x4729('0x36')](_0x4729('0x5b')));});});};Fax[_0x4729('0x1e')][_0x4729('0x5c')]=function(_0x42cdce){var _0x21befb=this;return new BPromise(function(_0x161402,_0x2fe06f){var _0x4e8cda=_0x21befb[_0x4729('0x5d')](_0x21befb[_0x4729('0xc')][_0x42cdce[_0x4729('0x57')]][_0x4729('0x5e')],_0x42cdce);if(_0x4e8cda[_0x4729('0x5f')]){_0x161402(ut[_0x4729('0x36')](_0x4729('0x60')));}else{_0x2fe06f(ut['message'](_0x4e8cda[_0x4729('0x36')]));}});};function originate(_0x22641b,_0x370843,_0x33efec){return new BPromise(function(_0x55697a,_0x3e93ca){if(_0x33efec){var _0x3d2a2f=util[_0x4729('0x61')](_0x4729('0x62'),path[_0x4729('0x38')](_0x22641b[_0x4729('0x63')])['name'],_0x22641b[_0x4729('0x63')]);gs[_0x4729('0x64')](_0x3d2a2f)[_0x4729('0x58')](function(){_0x22641b[_0x4729('0x63')]=util[_0x4729('0x61')](_0x4729('0x65'),path[_0x4729('0x38')](_0x22641b[_0x4729('0x63')])[_0x4729('0x66')],path[_0x4729('0x38')](_0x22641b[_0x4729('0x63')])['name']);_0x370843[_0x4729('0x67')]=_0x22641b['path'];ut[_0x4729('0x47')](_0x4729('0x68'),'');ami['Action'](ut[_0x4729('0x69')](_0x22641b,_0x370843))[_0x4729('0x58')](function(_0xeec3b1){_0x55697a(_0xeec3b1);})['catch'](function(_0x4f5f87){_0x3e93ca(_0x4f5f87);});})[_0x4729('0x3d')](function(_0x249082){_0x3e93ca(_0x249082);});}else{ami['Action'](ut['variablesAction'](_0x22641b,_0x370843))[_0x4729('0x58')](function(_0x2e8033){_0x55697a(_0x2e8033);})[_0x4729('0x3d')](function(_0x9d32c0){_0x3e93ca(_0x9d32c0);});}});}Fax[_0x4729('0x1e')][_0x4729('0x56')]=function(_0x3da847,_0x2902c2){var _0x40f9e0=this;return new BPromise(function(_0x145de1,_0xbccf56){var _0x135ef3=uuid['v4']();var _0x11e740=ut[_0x4729('0x6a')](_0x3da847,_0x2902c2);_0x40f9e0['actions'][_0x135ef3]=new Action(_0x135ef3,_0x2902c2,_0x3da847);var _0x3b44b7=_0x40f9e0[_0x4729('0x25')][_0x135ef3];if(path[_0x4729('0x38')](_0x3da847[_0x4729('0x63')])[_0x4729('0x6b')]==='.pdf'){originate(_0x3b44b7,_0x11e740,!![])['then'](function(_0x338654){_0x145de1(_0x338654);})[_0x4729('0x3d')](function(_0x36f9fd){_0xbccf56(_0x36f9fd);});}else{originate(_0x3b44b7,_0x11e740,![])[_0x4729('0x58')](function(_0x1a08d1){_0x145de1(_0x1a08d1);})[_0x4729('0x3d')](function(_0x3f7dbd){_0xbccf56(_0x3f7dbd);});}});};Fax['prototype'][_0x4729('0x6c')]=function(_0x65e26e){return!_[_0x4729('0x6d')](_0x65e26e)&&!_[_0x4729('0x6d')](_0x65e26e[_0x4729('0x24')])&&!_[_0x4729('0x6d')](_0x65e26e[_0x4729('0x6e')])&&_0x65e26e[_0x4729('0x6e')]&&!_[_0x4729('0x6d')](this['trunks'][util[_0x4729('0x61')](_0x4729('0x6f'),_0x65e26e['name'])])&&!_[_0x4729('0x6d')](this[_0x4729('0xd')][util['format'](_0x4729('0x6f'),_0x65e26e[_0x4729('0x24')])]['status'])&&(this[_0x4729('0xd')][util[_0x4729('0x61')](_0x4729('0x6f'),_0x65e26e[_0x4729('0x24')])][_0x4729('0x2c')]==='reachable'||this['trunks'][util[_0x4729('0x61')](_0x4729('0x6f'),_0x65e26e[_0x4729('0x24')])][_0x4729('0x2c')]===_0x4729('0x70'));};Fax[_0x4729('0x1e')][_0x4729('0x5d')]=function(_0x34e00f,_0x3d55e3){if(!this[_0x4729('0x6c')](_0x34e00f)){ut[_0x4729('0x47')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x4729('0x6d')](_0x34e00f)?'':_0x34e00f[_0x4729('0x24')]+_0x4729('0x71'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_['isNil'](_0x3d55e3[_0x4729('0x3b')])){ut[_0x4729('0x47')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x4729('0x40')](_0x3d55e3));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x4729('0x6d')](_0x3d55e3['path'])){ut[_0x4729('0x47')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x3d55e3));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x4729('0x72')};};module[_0x4729('0x73')]=Fax;
\ No newline at end of file
+var _0x4855=['../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','bind','varset','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','notify','catch','error','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','stringify','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','format','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','active','isNil','SIP/%s','reachable','unmonitored','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird','uuid','moment','path','../../../config/logger','fax','../ami','./channel','./action','../rpc/attachment'];(function(_0x13fdf7,_0x18a607){var _0x23e80b=function(_0x45ada2){while(--_0x45ada2){_0x13fdf7['push'](_0x13fdf7['shift']());}};_0x23e80b(++_0x18a607);}(_0x4855,0xe8));var _0x5485=function(_0xb18b17,_0x121eb1){_0xb18b17=_0xb18b17-0x0;var _0xd1ff7c=_0x4855[_0xb18b17];return _0xd1ff7c;};'use strict';var util=require(_0x5485('0x0'));var _=require(_0x5485('0x1'));var BPromise=require(_0x5485('0x2'));var uuid=require(_0x5485('0x3'));var moment=require(_0x5485('0x4'));var path=require(_0x5485('0x5'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x5485('0x6'))(_0x5485('0x7'));var ami=require(_0x5485('0x8'));var rpcDb=require('./rpcDb');var Channel=require(_0x5485('0x9'));var ut=require('./util/util');var Action=require(_0x5485('0xa'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x5485('0xb'));var faxMessage=require(_0x5485('0xc'));function Fax(_0x309f9d){this[_0x5485('0xd')]={};this['faxAccounts']=_0x309f9d[_0x5485('0xe')];this[_0x5485('0xf')]=_0x309f9d[_0x5485('0xf')];this[_0x5485('0x10')]={};ami['on'](_0x5485('0x11'),this['syncNewchannel'][_0x5485('0x12')](this));ami['on'](_0x5485('0x13'),this['syncVarSet'][_0x5485('0x12')](this));ami['on'](_0x5485('0x14'),this[_0x5485('0x15')][_0x5485('0x12')](this));ami['on'](_0x5485('0x16'),this[_0x5485('0x17')][_0x5485('0x12')](this));ami['on'](_0x5485('0x18'),this[_0x5485('0x19')][_0x5485('0x12')](this));ami['on'](_0x5485('0x1a'),this[_0x5485('0x1b')][_0x5485('0x12')](this));ami['on'](_0x5485('0x1c'),this[_0x5485('0x1d')]['bind'](this));ami['on'](_0x5485('0x1e'),this[_0x5485('0x1f')][_0x5485('0x12')](this));}Fax[_0x5485('0x20')][_0x5485('0x21')]=function(_0x5c29e4){if(_0x5c29e4[_0x5485('0x22')]===_0x5485('0x23')){for(var _0x49a29f in this[_0x5485('0xe')]){if(this[_0x5485('0xe')][_0x5485('0x24')](_0x49a29f)){if(_0x5c29e4[_0x5485('0x25')]===this[_0x5485('0xe')][_0x49a29f][_0x5485('0x26')]){this[_0x5485('0xd')][_0x5c29e4[_0x5485('0x27')]]={};this['channels'][_0x5c29e4[_0x5485('0x27')]]['channel']=_0x5c29e4[_0x5485('0x28')];this[_0x5485('0xd')][_0x5c29e4[_0x5485('0x27')]]['id']=this['faxAccounts'][_0x49a29f]['id'];this['channels'][_0x5c29e4['uniqueid']][_0x5485('0x29')]=this[_0x5485('0xe')][_0x49a29f]['name'];logger[_0x5485('0x2a')](_0x5c29e4[_0x5485('0x27')],_0x5485('0x2b'));}}}}if(this[_0x5485('0x10')][_0x5c29e4[_0x5485('0x27')]]){this[_0x5485('0xd')][_0x5c29e4[_0x5485('0x27')]]={};this['channels'][_0x5c29e4[_0x5485('0x27')]][_0x5485('0x28')]=_0x5c29e4[_0x5485('0x28')];logger[_0x5485('0x2a')](_0x5c29e4['uniqueid'],_0x5485('0x2b'));}};Fax['prototype']['syncVarSet']=function(_0x222c6b){if(this[_0x5485('0xd')][_0x222c6b[_0x5485('0x27')]]){for(var _0x4e8f4d in _0x222c6b[_0x5485('0x2c')]){if(_0x222c6b['variable'][_0x5485('0x24')](_0x4e8f4d)){this[_0x5485('0xd')][_0x222c6b['uniqueid']][_0x4e8f4d]=_0x222c6b[_0x5485('0x2d')];}}}};Fax['prototype'][_0x5485('0x15')]=function(_0xe6fe38){if(this[_0x5485('0xd')][_0xe6fe38[_0x5485('0x27')]]){this[_0x5485('0xd')][_0xe6fe38[_0x5485('0x27')]][_0x5485('0x2e')]=_0xe6fe38[_0x5485('0x2e')];this[_0x5485('0xd')][_0xe6fe38[_0x5485('0x27')]]['channelstatedesc']=_0xe6fe38['channelstatedesc'];}};Fax[_0x5485('0x20')][_0x5485('0x17')]=function(_0x3bfa85){if(this[_0x5485('0xd')][_0x3bfa85['uniqueid']]){for(var _0xa1f654 in _0x3bfa85[_0x5485('0x2c')]){if(_0x3bfa85[_0x5485('0x2c')][_0x5485('0x24')](_0xa1f654)){this[_0x5485('0xd')][_0x3bfa85[_0x5485('0x27')]][_0xa1f654]=_0x3bfa85['value'];}}}};Fax['prototype'][_0x5485('0x19')]=function(_0xbefae3){if(this[_0x5485('0xd')][_0xbefae3['uniqueid']]){this[_0x5485('0xd')][_0xbefae3[_0x5485('0x27')]][_0x5485('0x2f')]=_0xbefae3[_0x5485('0x2f')];this['channels'][_0xbefae3[_0x5485('0x27')]][_0x5485('0x30')]=_0xbefae3[_0x5485('0x30')];this[_0x5485('0xd')][_0xbefae3[_0x5485('0x27')]][_0x5485('0x26')]=_0xbefae3['localstationid'];this['channels'][_0xbefae3[_0x5485('0x27')]][_0x5485('0x31')]=_0xbefae3[_0x5485('0x31')];logger[_0x5485('0x2a')](_0xbefae3['uniqueid'],_0x5485('0x32'));}};Fax['prototype']['syncReceiveFax']=function(_0x41b6ea){var _0x423a8b=this;if(this[_0x5485('0xd')][_0x41b6ea['uniqueid']]){var _0x232f6d=this['channels'][_0x41b6ea[_0x5485('0x27')]]['id'];this[_0x5485('0xd')][_0x41b6ea[_0x5485('0x27')]][_0x5485('0x33')]=_0x41b6ea[_0x5485('0x33')];this['channels'][_0x41b6ea['uniqueid']][_0x5485('0x34')]=_0x41b6ea[_0x5485('0x34')];this[_0x5485('0xd')][_0x41b6ea[_0x5485('0x27')]][_0x5485('0x26')]=_0x41b6ea[_0x5485('0x26')];this[_0x5485('0xd')][_0x41b6ea[_0x5485('0x27')]][_0x5485('0x35')]=_0x41b6ea[_0x5485('0x35')];this[_0x5485('0xd')][_0x41b6ea[_0x5485('0x27')]][_0x5485('0x36')]=_0x41b6ea[_0x5485('0x36')];this[_0x5485('0xd')][_0x41b6ea['uniqueid']][_0x5485('0x31')]=_0x41b6ea[_0x5485('0x31')];this['channels'][_0x41b6ea[_0x5485('0x27')]][_0x5485('0x37')]=_0x41b6ea[_0x5485('0x37')];if(this['channels'][_0x41b6ea[_0x5485('0x27')]]['pagestransferred']>0x0){tiff2pdf(_0x41b6ea[_0x5485('0x31')],_0x5485('0x38'),function(_0x21da73){logger[_0x5485('0x2a')](_0x41b6ea[_0x5485('0x27')],_0x5485('0x39'),_0x21da73[_0x5485('0x3a')]);attachment['create']({'name':path[_0x5485('0x3b')](_0x41b6ea[_0x5485('0x31')])[_0x5485('0x29')],'basename':path[_0x5485('0x3b')](_0x41b6ea[_0x5485('0x31')])[_0x5485('0x29')]+_0x5485('0x3c'),'type':_0x5485('0x3d')})[_0x5485('0x3e')](function(_0x4f2bde){faxAccount[_0x5485('0x3f')](_0x232f6d,{'from':_0x41b6ea['calleridnum'],'mapKey':'fax','body':path[_0x5485('0x3b')](_0x41b6ea[_0x5485('0x31')])['name']+_0x5485('0x3c'),'AttachmentId':_0x4f2bde['id']})[_0x5485('0x40')](function(_0x15f1f6){logger[_0x5485('0x41')](_0x41b6ea['uniqueid'],'\x20notify\x20',JSON['stringify'](_0x15f1f6));});})['catch'](function(_0x167ee0){logger[_0x5485('0x41')](_0x41b6ea[_0x5485('0x27')],_0x5485('0x42'),JSON['stringify'](_0x167ee0));});});}logger[_0x5485('0x2a')](_0x41b6ea[_0x5485('0x27')],_0x5485('0x42'));}};Fax[_0x5485('0x20')][_0x5485('0x1f')]=function(_0x22d651){if(this[_0x5485('0x10')][_0x22d651[_0x5485('0x27')]]){_[_0x5485('0x43')](this[_0x5485('0xd')][_0x22d651[_0x5485('0x27')]],_[_0x5485('0x44')](_0x22d651,[_0x5485('0x45'),_0x5485('0x46')]));}};function updateStatus(_0x6679e0){if(_0x6679e0[_0x5485('0x47')]){faxMessage[_0x5485('0x48')](_0x6679e0[_0x5485('0x47')],{'failMessage':_0x5485('0x49')})['then'](function(_0x4fb8a3){ut[_0x5485('0x4a')](_0x5485('0x4b'),_0x4fb8a3);})[_0x5485('0x40')](function(_0xc6695d){ut[_0x5485('0x4a')]('[Fax][Message][Error][NoUpdate1]',_0xc6695d);});}else{ut[_0x5485('0x4a')](_0x5485('0x4c'));}}Fax[_0x5485('0x20')][_0x5485('0x4d')]=function(_0x1d0a0b,_0xa5f352,_0x2842b4){var _0x37e5fc=this;var _0x1a6e04={};if(_0xa5f352){_0x1a6e04={'read':_0xa5f352};}else{_0x1a6e04={'failMessage':_0x2842b4};}if(this['actions'][_0x1d0a0b][_0x5485('0x47')]){faxMessage[_0x5485('0x48')](this[_0x5485('0x10')][_0x1d0a0b]['AttachmentId'],_0x1a6e04)[_0x5485('0x3e')](function(_0x25df63){ut[_0x5485('0x4a')](_0x5485('0x4e'),_0x25df63);})['catch'](function(_0x1e6534){ut[_0x5485('0x4a')](_0x5485('0x4f'),_0x1e6534);})[_0x5485('0x50')](function(){delete _0x37e5fc['channels'][_0x1d0a0b];delete _0x37e5fc[_0x5485('0x10')][_0x1d0a0b];});}else{ut['logger'](_0x5485('0x51'));delete this[_0x5485('0xd')][_0x1d0a0b];delete this[_0x5485('0x10')][_0x1d0a0b];}};Fax[_0x5485('0x20')][_0x5485('0x1d')]=function(_0x4753f7){var _0x682f41=this;if(this[_0x5485('0xd')][_0x4753f7[_0x5485('0x27')]]){if(this[_0x5485('0x10')][_0x4753f7[_0x5485('0x27')]]){this['channels'][_0x4753f7['uniqueid']]['id']=this[_0x5485('0x10')][_0x4753f7[_0x5485('0x27')]]['id'];this[_0x5485('0xd')][_0x4753f7[_0x5485('0x27')]][_0x5485('0x29')]=this[_0x5485('0x10')][_0x4753f7[_0x5485('0x27')]][_0x5485('0x29')];}logger[_0x5485('0x2a')](_0x4753f7['uniqueid'],this[_0x5485('0x10')][_0x4753f7[_0x5485('0x27')]]?_0x5485('0x52'):'\x20hangup\x20faxRiceive\x20',JSON[_0x5485('0x53')](this[_0x5485('0xd')][_0x4753f7[_0x5485('0x27')]]));if(this['actions'][_0x4753f7[_0x5485('0x27')]]){if(this[_0x5485('0xd')][_0x4753f7[_0x5485('0x27')]][_0x5485('0x54')]>0x0&&this[_0x5485('0xd')][_0x4753f7[_0x5485('0x27')]]['faxstatus']===_0x5485('0x55')){this[_0x5485('0x4d')](_0x4753f7['uniqueid'],!![]);}else{this[_0x5485('0x4d')](_0x4753f7[_0x5485('0x27')],![],this[_0x5485('0xd')][_0x4753f7[_0x5485('0x27')]][_0x5485('0x56')]?_0x5485('0x57')+this[_0x5485('0xd')][_0x4753f7[_0x5485('0x27')]][_0x5485('0x56')]:'SENDING\x20FAILED');}}}};Fax[_0x5485('0x20')][_0x5485('0x58')]=function(_0x1ab7a0){var _0x6693f0=this;return new BPromise(function(_0xfd49c4,_0x2c9cad){_0x6693f0[_0x5485('0x59')](_0x1ab7a0,_0x6693f0[_0x5485('0xe')][_0x1ab7a0['FaxAccountId']])[_0x5485('0x3e')](function(_0x2e5149){ut[_0x5485('0x4a')](_0x5485('0x5a'),_0x2e5149);_0xfd49c4(ut[_0x5485('0x3a')](_0x5485('0x5b')));})[_0x5485('0x40')](function(_0x3a8c34){ut[_0x5485('0x4a')](_0x5485('0x5c'),_0x3a8c34);updateStatus(_0x1ab7a0);_0x2c9cad(ut['message'](_0x5485('0x5d')));});});};Fax[_0x5485('0x20')][_0x5485('0x5e')]=function(_0x3ca5e5){var _0x2d7700=this;return new BPromise(function(_0x13b186,_0x9240e0){var _0x466e04=_0x2d7700[_0x5485('0x5f')](_0x2d7700['faxAccounts'][_0x3ca5e5[_0x5485('0x60')]][_0x5485('0x61')],_0x3ca5e5);if(_0x466e04[_0x5485('0x62')]){_0x13b186(ut[_0x5485('0x3a')](_0x5485('0x63')));}else{_0x9240e0(ut['message'](_0x466e04['message']));}});};function originate(_0x55fc95,_0xf0bfdc,_0x23e6a9){return new BPromise(function(_0x351979,_0x38518d){if(_0x23e6a9){var _0x1226a6=util['format'](_0x5485('0x64'),path['parse'](_0x55fc95[_0x5485('0x5')])[_0x5485('0x29')],_0x55fc95[_0x5485('0x5')]);gs[_0x5485('0x65')](_0x1226a6)[_0x5485('0x3e')](function(){_0x55fc95[_0x5485('0x5')]=util[_0x5485('0x66')](_0x5485('0x67'),path[_0x5485('0x3b')](_0x55fc95['path'])['dir'],path[_0x5485('0x3b')](_0x55fc95[_0x5485('0x5')])[_0x5485('0x29')]);_0xf0bfdc[_0x5485('0x68')]=_0x55fc95[_0x5485('0x5')];ut['logger'](_0x5485('0x69'),'');ami[_0x5485('0x6a')](ut[_0x5485('0x6b')](_0x55fc95,_0xf0bfdc))[_0x5485('0x3e')](function(_0x25572a){_0x351979(_0x25572a);})[_0x5485('0x40')](function(_0x35650e){_0x38518d(_0x35650e);});})['catch'](function(_0x1b7b60){_0x38518d(_0x1b7b60);});}else{ami['Action'](ut[_0x5485('0x6b')](_0x55fc95,_0xf0bfdc))[_0x5485('0x3e')](function(_0x40ed81){_0x351979(_0x40ed81);})[_0x5485('0x40')](function(_0x5bc447){_0x38518d(_0x5bc447);});}});}Fax[_0x5485('0x20')]['execOriginate']=function(_0x35250e,_0x291e62){var _0x15a822=this;return new BPromise(function(_0x31aa9b,_0x3a111c){var _0x7d5917=uuid['v4']();var _0x2aaa51=ut[_0x5485('0x6c')](_0x35250e,_0x291e62);_0x15a822[_0x5485('0x10')][_0x7d5917]=new Action(_0x7d5917,_0x291e62,_0x35250e);var _0xa41cf9=_0x15a822[_0x5485('0x10')][_0x7d5917];if(path['parse'](_0x35250e[_0x5485('0x5')])[_0x5485('0x6d')]===_0x5485('0x3c')){originate(_0xa41cf9,_0x2aaa51,!![])[_0x5485('0x3e')](function(_0x30431e){_0x31aa9b(_0x30431e);})[_0x5485('0x40')](function(_0x3b360a){_0x3a111c(_0x3b360a);});}else{originate(_0xa41cf9,_0x2aaa51,![])['then'](function(_0x1d8658){_0x31aa9b(_0x1d8658);})['catch'](function(_0x15e672){_0x3a111c(_0x15e672);});}});};Fax['prototype'][_0x5485('0x6e')]=function(_0x1a9ff9){return!_['isNil'](_0x1a9ff9)&&!_['isNil'](_0x1a9ff9['name'])&&!_['isNil'](_0x1a9ff9[_0x5485('0x6f')])&&_0x1a9ff9[_0x5485('0x6f')]&&!_[_0x5485('0x70')](this['trunks'][util[_0x5485('0x66')](_0x5485('0x71'),_0x1a9ff9['name'])])&&!_[_0x5485('0x70')](this['trunks'][util['format'](_0x5485('0x71'),_0x1a9ff9['name'])]['status'])&&(this[_0x5485('0xf')][util['format'](_0x5485('0x71'),_0x1a9ff9['name'])][_0x5485('0x30')]===_0x5485('0x72')||this[_0x5485('0xf')][util[_0x5485('0x66')](_0x5485('0x71'),_0x1a9ff9[_0x5485('0x29')])][_0x5485('0x30')]===_0x5485('0x73'));};Fax['prototype'][_0x5485('0x5f')]=function(_0x435470,_0x45abf2){if(!this[_0x5485('0x6e')](_0x435470)){ut[_0x5485('0x4a')]('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x5485('0x70')](_0x435470)?'':_0x435470[_0x5485('0x29')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x5485('0x74')};}if(_[_0x5485('0x70')](_0x45abf2[_0x5485('0x7')])){ut['logger'](_0x5485('0x75'),JSON[_0x5485('0x53')](_0x45abf2));return{'isValid':![],'message':_0x5485('0x76')};}if(_['isNil'](_0x45abf2[_0x5485('0x5')])){ut[_0x5485('0x4a')](_0x5485('0x77'),JSON[_0x5485('0x53')](_0x45abf2));return{'isValid':![],'message':_0x5485('0x78')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x5485('0x79')]=Fax;
\ No newline at end of file
index 8fda63d..eacc027 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x559d=['error','inspect','notify','resolve','catch','[Notify]\x20','util','bluebird','preview','lodash','../rpc/faxAccount'];(function(_0x34755e,_0x564e61){var _0x9831d=function(_0x4748ed){while(--_0x4748ed){_0x34755e['push'](_0x34755e['shift']());}};_0x9831d(++_0x564e61);}(_0x559d,0xc1));var _0xd559=function(_0x44f353,_0x5b6c2f){_0x44f353=_0x44f353-0x0;var _0x26a635=_0x559d[_0x44f353];return _0x26a635;};'use strict';var util=require(_0xd559('0x0'));var BPromise=require(_0xd559('0x1'));var logger=require('../../../config/logger')(_0xd559('0x2'));var _=require(_0xd559('0x3'));var faxAccount=require(_0xd559('0x4'));function loggerCatch(_0x232401){return function(_0x53f6fc){logger[_0xd559('0x5')](_0x232401,util[_0xd559('0x6')](_0x53f6fc,{'showHidden':![],'depth':null}));};}exports[_0xd559('0x7')]=function(_0x428a2f,_0x5ee500){return BPromise[_0xd559('0x8')]()['then'](faxAccount[_0xd559('0x7')](_0x428a2f,_0x5ee500))[_0xd559('0x9')](loggerCatch(_0xd559('0xa')));};
\ No newline at end of file
+var _0xe4a5=['catch','util','../../../config/logger','lodash','../rpc/faxAccount','inspect','resolve','then','notify'];(function(_0x15b932,_0x39ba3f){var _0x28fa64=function(_0x479c8a){while(--_0x479c8a){_0x15b932['push'](_0x15b932['shift']());}};_0x28fa64(++_0x39ba3f);}(_0xe4a5,0x10f));var _0x5e4a=function(_0xbd4746,_0x9ca2c8){_0xbd4746=_0xbd4746-0x0;var _0x2afcef=_0xe4a5[_0xbd4746];return _0x2afcef;};'use strict';var util=require(_0x5e4a('0x0'));var BPromise=require('bluebird');var logger=require(_0x5e4a('0x1'))('preview');var _=require(_0x5e4a('0x2'));var faxAccount=require(_0x5e4a('0x3'));function loggerCatch(_0x1c55cb){return function(_0x545a11){logger['error'](_0x1c55cb,util[_0x5e4a('0x4')](_0x545a11,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x4367c9,_0x70cbfa){return BPromise[_0x5e4a('0x5')]()[_0x5e4a('0x6')](faxAccount[_0x5e4a('0x7')](_0x4367c9,_0x70cbfa))[_0x5e4a('0x8')](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
index e4e7aa9..d09788e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8497=['info','Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','fax','child_process','exec','execute'];(function(_0x232147,_0x241aaa){var _0x462788=function(_0x448b24){while(--_0x448b24){_0x232147['push'](_0x232147['shift']());}};_0x462788(++_0x241aaa);}(_0x8497,0x112));var _0x7849=function(_0x545390,_0x3cde3f){_0x545390=_0x545390-0x0;var _0x8052eb=_0x8497[_0x545390];return _0x8052eb;};'use strict';var util=require('util');var logger=require(_0x7849('0x0'))(_0x7849('0x1'));var BPromise=require('bluebird');var exec=require(_0x7849('0x2'))[_0x7849('0x3')];exports[_0x7849('0x4')]=function(_0x2dd265){return new BPromise(function(_0x54ee01,_0x101bde){exec(_0x2dd265,function(_0x153943,_0x878686,_0x132c98){logger[_0x7849('0x5')](_0x7849('0x6'),_0x878686);if(_0x153943){logger['info'](_0x7849('0x6'),_0x7849('0x7'),util[_0x7849('0x8')](_0x153943,{'showHidden':![],'depth':null}),_0x878686,_0x132c98);_0x101bde(_0x153943);}_0x54ee01(_0x878686);});});};
\ No newline at end of file
+var _0x4487=['info','Exec\x20gs','\x20Error\x20:','inspect','util','../../../../config/logger','child_process'];(function(_0x2ffe5c,_0x2b27a1){var _0x3cbb33=function(_0x1b00ce){while(--_0x1b00ce){_0x2ffe5c['push'](_0x2ffe5c['shift']());}};_0x3cbb33(++_0x2b27a1);}(_0x4487,0x1a8));var _0x7448=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x4487[_0xfae23b];return _0x200640;};'use strict';var util=require(_0x7448('0x0'));var logger=require(_0x7448('0x1'))('fax');var BPromise=require('bluebird');var exec=require(_0x7448('0x2'))['exec'];exports['execute']=function(_0xfddf12){return new BPromise(function(_0x4d521b,_0x27a0da){exec(_0xfddf12,function(_0x49ab7b,_0x4544cf,_0x8a229){logger[_0x7448('0x3')]('Exec\x20gs',_0x4544cf);if(_0x49ab7b){logger[_0x7448('0x3')](_0x7448('0x4'),_0x7448('0x5'),util[_0x7448('0x6')](_0x49ab7b,{'showHidden':![],'depth':null}),_0x4544cf,_0x8a229);_0x27a0da(_0x49ab7b);}_0x4d521b(_0x4544cf);});});};
\ No newline at end of file
index df8cc59..a5ffe70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea2f=['moment','../../../../config/logger','message','logger','ecm','minrate','maxrate','format','modem','gateway','faxdetect','localstationid','path','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','headerinfo','util'];(function(_0x5b8e2d,_0x3513f4){var _0x547ad8=function(_0x50ea52){while(--_0x50ea52){_0x5b8e2d['push'](_0x5b8e2d['shift']());}};_0x547ad8(++_0x3513f4);}(_0xea2f,0x117));var _0xfea2=function(_0x111ed4,_0x47adcd){_0x111ed4=_0x111ed4-0x0;var _0x2fab73=_0xea2f[_0x111ed4];return _0x2fab73;};'use strict';var util=require(_0xfea2('0x0'));var _=require('lodash');var moment=require(_0xfea2('0x1'));var logger=require(_0xfea2('0x2'))('fax');exports[_0xfea2('0x3')]=function(_0x5545ba){return{'message':_0x5545ba};};exports[_0xfea2('0x4')]=function(_0x2e5640,_0x43a40c){logger['info'](_0x2e5640,util['inspect'](_0x43a40c,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x8d8f8a,_0x11746d){var _0x1175b0={'XMF-ECM':_0x11746d[_0xfea2('0x5')],'XMF-HEADERINFO':_0x11746d['headerinfo'],'XMF-MINRATE':_0x11746d[_0xfea2('0x6')],'XMF-MAXRATE':_0x11746d[_0xfea2('0x7')],'XMF-MODEM':util[_0xfea2('0x8')]('\x22%s\x22',_0x11746d[_0xfea2('0x9')]),'XMF-GATEWAY':_0x11746d[_0xfea2('0xa')],'XMF-FAXDETECT':_0x11746d[_0xfea2('0xb')],'XMF-T38TIMEOUT':_0x11746d['t38timeout'],'XMF-LOCALSTATIONID':_0x11746d[_0xfea2('0xc')],'XMF-PATH':_0x8d8f8a[_0xfea2('0xd')]};return _0x1175b0;};exports['variablesAction']=function(_0x26e99d,_0x43d0ba){return{'actionid':_0x26e99d[_0xfea2('0xe')],'action':_0xfea2('0xf'),'channel':_0x26e99d[_0xfea2('0x10')],'Exten':'xcally-motion-fax','Context':_0xfea2('0x11'),'Priority':'1','callerid':util[_0xfea2('0x8')](_0xfea2('0x12'),_0x26e99d[_0xfea2('0x13')]?_0x26e99d[_0xfea2('0x13')]:'',_0x26e99d['localstationid']),'variable':_0x43d0ba,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x26e99d['uniqueid']};};
\ No newline at end of file
+var _0xabb2=['ecm','headerinfo','minrate','format','\x22%s\x22','modem','gateway','faxdetect','localstationid','path','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','lodash','moment','fax','message','logger','info','inspect','addVariables'];(function(_0x4cd86b,_0x1f2904){var _0x3f43af=function(_0x2f0684){while(--_0x2f0684){_0x4cd86b['push'](_0x4cd86b['shift']());}};_0x3f43af(++_0x1f2904);}(_0xabb2,0x82));var _0x2abb=function(_0x7a112,_0x2eb4a0){_0x7a112=_0x7a112-0x0;var _0x136dc5=_0xabb2[_0x7a112];return _0x136dc5;};'use strict';var util=require('util');var _=require(_0x2abb('0x0'));var moment=require(_0x2abb('0x1'));var logger=require('../../../../config/logger')(_0x2abb('0x2'));exports[_0x2abb('0x3')]=function(_0x150067){return{'message':_0x150067};};exports[_0x2abb('0x4')]=function(_0x29ec40,_0x4480b7){logger[_0x2abb('0x5')](_0x29ec40,util[_0x2abb('0x6')](_0x4480b7,{'showHidden':![],'depth':null}));};exports[_0x2abb('0x7')]=function(_0x4c4a24,_0x1fd8bd){var _0x5ac9e6={'XMF-ECM':_0x1fd8bd[_0x2abb('0x8')],'XMF-HEADERINFO':_0x1fd8bd[_0x2abb('0x9')],'XMF-MINRATE':_0x1fd8bd[_0x2abb('0xa')],'XMF-MAXRATE':_0x1fd8bd['maxrate'],'XMF-MODEM':util[_0x2abb('0xb')](_0x2abb('0xc'),_0x1fd8bd[_0x2abb('0xd')]),'XMF-GATEWAY':_0x1fd8bd[_0x2abb('0xe')],'XMF-FAXDETECT':_0x1fd8bd[_0x2abb('0xf')],'XMF-T38TIMEOUT':_0x1fd8bd['t38timeout'],'XMF-LOCALSTATIONID':_0x1fd8bd[_0x2abb('0x10')],'XMF-PATH':_0x4c4a24[_0x2abb('0x11')]};return _0x5ac9e6;};exports['variablesAction']=function(_0x2e0160,_0x9b4a06){return{'actionid':_0x2e0160['uniqueid'],'action':_0x2abb('0x12'),'channel':_0x2e0160[_0x2abb('0x13')],'Exten':_0x2abb('0x14'),'Context':_0x2abb('0x15'),'Priority':'1','callerid':util[_0x2abb('0xb')](_0x2abb('0x16'),_0x2e0160[_0x2abb('0x9')]?_0x2e0160[_0x2abb('0x9')]:'',_0x2e0160['localstationid']),'variable':_0x9b4a06,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2e0160['uniqueid']};};
\ No newline at end of file
index 2cebfe3..c4bab4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1688=['ami','get','resolve','getAgents','then','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','error','[index.js][initParams]','inspect','listen','[index.js][main]','bluebird','util','./server','./realtime','./report','./acw','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow'];(function(_0x4291dd,_0x95d82){var _0x152462=function(_0x2f7bb6){while(--_0x2f7bb6){_0x4291dd['push'](_0x4291dd['shift']());}};_0x152462(++_0x95d82);}(_0x1688,0xf2));var _0x8168=function(_0x41d375,_0x4d42f8){_0x41d375=_0x41d375-0x0;var _0x5d5757=_0x1688[_0x41d375];return _0x5d5757;};'use strict';var BPromise=require(_0x8168('0x0'));var util=require(_0x8168('0x1'));var moment=require('moment');var server=require(_0x8168('0x2'));var Realtime=require(_0x8168('0x3'));var Report=require(_0x8168('0x4'));var Acw=require(_0x8168('0x5'));var Trigger=require('./trigger');var Dialer=require(_0x8168('0x6'));var Preview=require(_0x8168('0x7'));var Fax=require('./fax');var user=require(_0x8168('0x8'));var voiceQueue=require(_0x8168('0x9'));var voiceQueueReport=require(_0x8168('0xa'));var voiceCallReport=require(_0x8168('0xb'));var trunk=require(_0x8168('0xc'));var trigger=require(_0x8168('0xd'));var template=require(_0x8168('0xe'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0x8168('0xf'));var voiceExtension=require(_0x8168('0x10'));var faxAccount=require(_0x8168('0x11'));var zendesk=require(_0x8168('0x12'));var salesforce=require(_0x8168('0x13'));var sugarcrm=require(_0x8168('0x14'));var freshdesk=require(_0x8168('0x15'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x8168('0x16'));var vtiger=require(_0x8168('0x17'));var freshsales=require(_0x8168('0x18'));var servicenow=require(_0x8168('0x19'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x8168('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x8168('0x1b')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x8168('0x1c')]()['then'](user[_0x8168('0x1d')]())['then'](realtime['initAgents']())['then'](user['getTelephones']())[_0x8168('0x1e')](realtime['initTelephones']())['then'](trunk['getTrunks']())[_0x8168('0x1e')](realtime[_0x8168('0x1f')]())['then'](voiceQueue[_0x8168('0x20')]())['then'](realtime[_0x8168('0x21')]())[_0x8168('0x1e')](trigger[_0x8168('0x22')]())['then'](realtime[_0x8168('0x23')]())[_0x8168('0x1e')](template[_0x8168('0x24')]())[_0x8168('0x1e')](realtime['initTemplates']())[_0x8168('0x1e')](zendesk[_0x8168('0x25')]())['then'](realtime['initZendeskAccounts']())[_0x8168('0x1e')](salesforce['getSalesforceAccounts']())[_0x8168('0x1e')](realtime[_0x8168('0x26')]())[_0x8168('0x1e')](sugarcrm['getSugarcrmAccounts']())[_0x8168('0x1e')](realtime[_0x8168('0x27')]())[_0x8168('0x1e')](freshdesk[_0x8168('0x28')]())[_0x8168('0x1e')](realtime['initFreshdeskAccounts']())[_0x8168('0x1e')](desk[_0x8168('0x29')]())[_0x8168('0x1e')](realtime[_0x8168('0x2a')]())[_0x8168('0x1e')](zoho[_0x8168('0x2b')]())[_0x8168('0x1e')](realtime['initZohoAccounts']())[_0x8168('0x1e')](vtiger[_0x8168('0x2c')]())[_0x8168('0x1e')](realtime[_0x8168('0x2d')]())['then'](freshsales[_0x8168('0x2e')]())[_0x8168('0x1e')](realtime[_0x8168('0x2f')]())[_0x8168('0x1e')](servicenow['getServicenowAccounts']())[_0x8168('0x1e')](realtime[_0x8168('0x30')]())[_0x8168('0x1e')](dynamics365[_0x8168('0x31')]())['then'](realtime['initDynamics365Accounts']())[_0x8168('0x1e')](campaign[_0x8168('0x32')]())[_0x8168('0x1e')](realtime[_0x8168('0x33')]())[_0x8168('0x1e')](voiceExtension[_0x8168('0x34')]())[_0x8168('0x1e')](realtime[_0x8168('0x35')]())['then'](faxAccount[_0x8168('0x36')]())[_0x8168('0x1e')](realtime[_0x8168('0x37')]())[_0x8168('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0x8168('0x1c')]()[_0x8168('0x1e')](voiceQueueReport[_0x8168('0x38')]())[_0x8168('0x1e')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory[_0x8168('0x39')]())[_0x8168('0x1e')](realtime[_0x8168('0x3a')]())['then'](cmHopperHistory[_0x8168('0x3b')]())[_0x8168('0x1e')](realtime[_0x8168('0x3c')]())[_0x8168('0x1e')](voiceCallReport[_0x8168('0x3d')]())['then'](realtime['initVoiceCallReports']())['catch'](function(_0xc495c6){logger[_0x8168('0x3e')](_0x8168('0x3f'),util[_0x8168('0x40')](_0xc495c6,{'showHidden':![],'depth':null}));});}function main(){return server[_0x8168('0x41')](realtime,preview,fax)[_0x8168('0x1e')](function(_0xaef11d){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x193edc){logger[_0x8168('0x3e')](_0x8168('0x42'),util[_0x8168('0x40')](_0x193edc,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
+var _0x9872=['catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','get','then','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','resolve','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports'];(function(_0x27c24e,_0x5db1c7){var _0x39004a=function(_0x44286d){while(--_0x44286d){_0x27c24e['push'](_0x27c24e['shift']());}};_0x39004a(++_0x5db1c7);}(_0x9872,0x9f));var _0x2987=function(_0x30f9d2,_0xac9471){_0x30f9d2=_0x30f9d2-0x0;var _0x2ad3a4=_0x9872[_0x30f9d2];return _0x2ad3a4;};'use strict';var BPromise=require(_0x2987('0x0'));var util=require(_0x2987('0x1'));var moment=require(_0x2987('0x2'));var server=require(_0x2987('0x3'));var Realtime=require(_0x2987('0x4'));var Report=require(_0x2987('0x5'));var Acw=require(_0x2987('0x6'));var Trigger=require(_0x2987('0x7'));var Dialer=require(_0x2987('0x8'));var Preview=require('./preview');var Fax=require(_0x2987('0x9'));var user=require(_0x2987('0xa'));var voiceQueue=require(_0x2987('0xb'));var voiceQueueReport=require(_0x2987('0xc'));var voiceCallReport=require(_0x2987('0xd'));var trunk=require(_0x2987('0xe'));var trigger=require(_0x2987('0xf'));var template=require(_0x2987('0x10'));var cmHopperHistory=require(_0x2987('0x11'));var campaign=require(_0x2987('0x12'));var voiceExtension=require(_0x2987('0x13'));var faxAccount=require(_0x2987('0x14'));var zendesk=require(_0x2987('0x15'));var salesforce=require(_0x2987('0x16'));var sugarcrm=require(_0x2987('0x17'));var freshdesk=require(_0x2987('0x18'));var desk=require(_0x2987('0x19'));var zoho=require(_0x2987('0x1a'));var vtiger=require(_0x2987('0x1b'));var freshsales=require(_0x2987('0x1c'));var servicenow=require(_0x2987('0x1d'));var dynamics365=require(_0x2987('0x1e'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')(_0x2987('0x1f'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x2987('0x20')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x2987('0x21')](user['getAgents']())[_0x2987('0x21')](realtime['initAgents']())[_0x2987('0x21')](user['getTelephones']())[_0x2987('0x21')](realtime[_0x2987('0x22')]())[_0x2987('0x21')](trunk[_0x2987('0x23')]())['then'](realtime[_0x2987('0x24')]())['then'](voiceQueue[_0x2987('0x25')]())[_0x2987('0x21')](realtime[_0x2987('0x26')]())['then'](trigger['getTriggers']())['then'](realtime[_0x2987('0x27')]())[_0x2987('0x21')](template[_0x2987('0x28')]())[_0x2987('0x21')](realtime[_0x2987('0x29')]())['then'](zendesk[_0x2987('0x2a')]())[_0x2987('0x21')](realtime[_0x2987('0x2b')]())[_0x2987('0x21')](salesforce[_0x2987('0x2c')]())[_0x2987('0x21')](realtime[_0x2987('0x2d')]())[_0x2987('0x21')](sugarcrm[_0x2987('0x2e')]())[_0x2987('0x21')](realtime[_0x2987('0x2f')]())['then'](freshdesk['getFreshdeskAccounts']())[_0x2987('0x21')](realtime[_0x2987('0x30')]())[_0x2987('0x21')](desk['getDeskAccounts']())[_0x2987('0x21')](realtime[_0x2987('0x31')]())[_0x2987('0x21')](zoho[_0x2987('0x32')]())['then'](realtime['initZohoAccounts']())['then'](vtiger[_0x2987('0x33')]())[_0x2987('0x21')](realtime[_0x2987('0x34')]())[_0x2987('0x21')](freshsales[_0x2987('0x35')]())[_0x2987('0x21')](realtime['initFreshsalesAccounts']())[_0x2987('0x21')](servicenow[_0x2987('0x36')]())[_0x2987('0x21')](realtime[_0x2987('0x37')]())[_0x2987('0x21')](dynamics365['getDynamics365Accounts']())['then'](realtime[_0x2987('0x38')]())[_0x2987('0x21')](campaign[_0x2987('0x39')]())[_0x2987('0x21')](realtime[_0x2987('0x3a')]())['then'](voiceExtension[_0x2987('0x3b')]())['then'](realtime[_0x2987('0x3c')]())['then'](faxAccount['getFaxAccounts']())['then'](realtime[_0x2987('0x3d')]())[_0x2987('0x21')](function(){return realtime;});}function initParams(){return BPromise[_0x2987('0x3e')]()[_0x2987('0x21')](voiceQueueReport['getVoiceQueueReports']())['then'](realtime[_0x2987('0x3f')]())['then'](cmHopperHistory[_0x2987('0x40')]())[_0x2987('0x21')](realtime[_0x2987('0x41')]())[_0x2987('0x21')](cmHopperHistory[_0x2987('0x42')]())[_0x2987('0x21')](realtime[_0x2987('0x43')]())['then'](voiceCallReport['getVoiceCallReports']())[_0x2987('0x21')](realtime[_0x2987('0x44')]())[_0x2987('0x45')](function(_0x615406){logger[_0x2987('0x46')](_0x2987('0x47'),util[_0x2987('0x48')](_0x615406,{'showHidden':![],'depth':null}));});}function main(){return server[_0x2987('0x49')](realtime,preview,fax)[_0x2987('0x21')](function(_0x599d9b){return initRealtime();})['then'](function(){return initParams();})[_0x2987('0x21')](function(){report[_0x2987('0x4a')]();setInterval(initRealtime,0x1388);})[_0x2987('0x45')](function(_0x50d50c){logger[_0x2987('0x46')](_0x2987('0x4b'),util[_0x2987('0x48')](_0x50d50c,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
index 956dc1a..021bbb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x2c4a1f,_0x1ed0ea){var _0x1b5760=function(_0x1beaae){while(--_0x1beaae){_0x2c4a1f['push'](_0x2c4a1f['shift']());}};_0x1b5760(++_0x1ed0ea);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1faaa1,_0x1568dd){_0x1faaa1=_0x1faaa1-0x0;var _0x994ec=_0xcb91[_0x1faaa1];return _0x994ec;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent;
\ No newline at end of file
+var _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x12e6e5,_0x39855b){var _0x4ef6ce=function(_0x3e06f3){while(--_0x3e06f3){_0x12e6e5['push'](_0x12e6e5['shift']());}};_0x4ef6ce(++_0x39855b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent;
\ No newline at end of file
index 3f44f46..6d96ba4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fab=['dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency'];(function(_0x409fb8,_0x5ab3d3){var _0x278270=function(_0x58849c){while(--_0x58849c){_0x409fb8['push'](_0x409fb8['shift']());}};_0x278270(++_0x5ab3d3);}(_0x0fab,0xdd));var _0xb0fa=function(_0x35cc58,_0x3cd035){_0x35cc58=_0x35cc58-0x0;var _0x5c522f=_0x0fab[_0x35cc58];return _0x5c522f;};'use strict';function Campaign(_0x2d7f22){this['id']=_0x2d7f22['id']||0x0;this[_0xb0fa('0x0')]=_0x2d7f22[_0xb0fa('0x0')]||'';this['type']=_0x2d7f22['type']||_0xb0fa('0x1');this['originated']=0x0;this[_0xb0fa('0x2')]=0x0;this[_0xb0fa('0x3')]=0x0;this[_0xb0fa('0x4')]=0x0;this[_0xb0fa('0x5')]='';this[_0xb0fa('0x6')]=!![];this[_0xb0fa('0x7')]=_0x2d7f22[_0xb0fa('0x7')];this['limitCalls']=_0x2d7f22[_0xb0fa('0x8')];this['dialTimezone']=_0x2d7f22['dialTimezone']||null;this['dialGlobalInterval']=_0x2d7f22[_0xb0fa('0x9')]?_0x2d7f22[_0xb0fa('0x9')]:null;this[_0xb0fa('0xa')]=_0x2d7f22[_0xb0fa('0xa')];this[_0xb0fa('0xb')]=_0x2d7f22['dialOriginateCallerIdNumber'];this[_0xb0fa('0xc')]=_0x2d7f22[_0xb0fa('0xc')]||0x1e;this[_0xb0fa('0xd')]=_0x2d7f22['dialCongestionMaxRetry'];this[_0xb0fa('0xe')]=_0x2d7f22[_0xb0fa('0xe')];this[_0xb0fa('0xf')]=_0x2d7f22[_0xb0fa('0xf')];this[_0xb0fa('0x10')]=_0x2d7f22[_0xb0fa('0x10')];this[_0xb0fa('0x11')]=_0x2d7f22[_0xb0fa('0x11')];this[_0xb0fa('0x12')]=_0x2d7f22[_0xb0fa('0x12')];this[_0xb0fa('0x13')]=_0x2d7f22[_0xb0fa('0x13')];this[_0xb0fa('0x14')]=_0x2d7f22[_0xb0fa('0x14')]||0x3;this[_0xb0fa('0x15')]=_0x2d7f22[_0xb0fa('0x15')]||0x96;this['dialDropMaxRetry']=_0x2d7f22[_0xb0fa('0x16')]||0x3;this[_0xb0fa('0x17')]=_0x2d7f22['dialDropRetryFrequency']||0x96;this[_0xb0fa('0x18')]=_0x2d7f22[_0xb0fa('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0x2d7f22[_0xb0fa('0x19')]||0x96;this[_0xb0fa('0x1a')]=_0x2d7f22[_0xb0fa('0x1a')]||0x3;this['dialMachineRetryFrequency']=_0x2d7f22[_0xb0fa('0x1b')]||0x96;this[_0xb0fa('0x1c')]=_0x2d7f22[_0xb0fa('0x1c')]||0x3;this[_0xb0fa('0x1d')]=_0x2d7f22[_0xb0fa('0x1d')]||0x96;this[_0xb0fa('0x1e')]=_0x2d7f22[_0xb0fa('0x1e')]||_0xb0fa('0x1f');this[_0xb0fa('0x20')]=_0x2d7f22[_0xb0fa('0x20')]||undefined;this[_0xb0fa('0x21')]=_0x2d7f22[_0xb0fa('0x21')]||undefined;this[_0xb0fa('0x22')]=_0x2d7f22[_0xb0fa('0x22')]||undefined;this[_0xb0fa('0x23')]=_0x2d7f22[_0xb0fa('0x23')]?_0x2d7f22[_0xb0fa('0x23')]:undefined;this[_0xb0fa('0x24')]=_0x2d7f22['Trunk']?_0x2d7f22['Trunk']:undefined;this[_0xb0fa('0x25')]=_0x2d7f22['Interval']?_0x2d7f22[_0xb0fa('0x25')]:undefined;this[_0xb0fa('0x26')]=_0x2d7f22[_0xb0fa('0x26')]?_0x2d7f22[_0xb0fa('0x26')]:undefined;this['dialQueueProject']=_0x2d7f22[_0xb0fa('0x26')]?_0x2d7f22[_0xb0fa('0x26')]['name']:undefined;this[_0xb0fa('0x27')]=_0x2d7f22[_0xb0fa('0x27')]||![];this[_0xb0fa('0x28')]=_0x2d7f22[_0xb0fa('0x28')];this[_0xb0fa('0x29')]=_0x2d7f22['dialAMDGreeting'];this[_0xb0fa('0x2a')]=_0x2d7f22[_0xb0fa('0x2a')];this['dialAMDTotalAnalysisTime']=_0x2d7f22[_0xb0fa('0x2b')];this['dialAMDMinWordLength']=_0x2d7f22['dialAMDMinWordLength'];this[_0xb0fa('0x2c')]=_0x2d7f22[_0xb0fa('0x2c')];this['dialAMDMaximumNumberOfWords']=_0x2d7f22['dialAMDMaximumNumberOfWords'];this[_0xb0fa('0x2d')]=_0x2d7f22[_0xb0fa('0x2d')];this[_0xb0fa('0x2e')]=_0x2d7f22[_0xb0fa('0x2e')];}module[_0xb0fa('0x2f')]=Campaign;
\ No newline at end of file
+var _0x2753=['dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','name','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry'];(function(_0x4cda09,_0x40fe85){var _0x32873e=function(_0x535967){while(--_0x535967){_0x4cda09['push'](_0x4cda09['shift']());}};_0x32873e(++_0x40fe85);}(_0x2753,0xb5));var _0x3275=function(_0x9d9d58,_0x7bf873){_0x9d9d58=_0x9d9d58-0x0;var _0x51d4d3=_0x2753[_0x9d9d58];return _0x51d4d3;};'use strict';function Campaign(_0x24867d){this['id']=_0x24867d['id']||0x0;this['name']=_0x24867d['name']||'';this[_0x3275('0x0')]=_0x24867d[_0x3275('0x0')]||_0x3275('0x1');this[_0x3275('0x2')]=0x0;this[_0x3275('0x3')]=0x0;this[_0x3275('0x4')]=0x0;this[_0x3275('0x5')]=0x0;this[_0x3275('0x6')]='';this[_0x3275('0x7')]=!![];this['active']=_0x24867d[_0x3275('0x8')];this[_0x3275('0x9')]=_0x24867d[_0x3275('0x9')];this[_0x3275('0xa')]=_0x24867d[_0x3275('0xa')]||null;this[_0x3275('0xb')]=_0x24867d[_0x3275('0xb')]?_0x24867d[_0x3275('0xb')]:null;this[_0x3275('0xc')]=_0x24867d[_0x3275('0xc')];this[_0x3275('0xd')]=_0x24867d[_0x3275('0xd')];this[_0x3275('0xe')]=_0x24867d['dialOriginateTimeout']||0x1e;this[_0x3275('0xf')]=_0x24867d[_0x3275('0xf')];this['dialCongestionRetryFrequency']=_0x24867d[_0x3275('0x10')];this['dialBusyMaxRetry']=_0x24867d[_0x3275('0x11')];this['dialBusyRetryFrequency']=_0x24867d[_0x3275('0x12')];this[_0x3275('0x13')]=_0x24867d[_0x3275('0x13')];this[_0x3275('0x14')]=_0x24867d['dialNoAnswerRetryFrequency'];this[_0x3275('0x15')]=_0x24867d[_0x3275('0x15')];this['dialNoSuchNumberMaxRetry']=_0x24867d[_0x3275('0x16')]||0x3;this[_0x3275('0x17')]=_0x24867d['dialNoSuchNumberRetryFrequency']||0x96;this[_0x3275('0x18')]=_0x24867d[_0x3275('0x18')]||0x3;this['dialDropRetryFrequency']=_0x24867d[_0x3275('0x19')]||0x96;this['dialAbandonedMaxRetry']=_0x24867d[_0x3275('0x1a')]||0x3;this['dialAbandonedRetryFrequency']=_0x24867d[_0x3275('0x1b')]||0x96;this['dialMachineMaxRetry']=_0x24867d[_0x3275('0x1c')]||0x3;this['dialMachineRetryFrequency']=_0x24867d[_0x3275('0x1d')]||0x96;this[_0x3275('0x1e')]=_0x24867d[_0x3275('0x1e')]||0x3;this['dialAgentRejectRetryFrequency']=_0x24867d['dialAgentRejectRetryFrequency']||0x96;this[_0x3275('0x1f')]=_0x24867d['dialOrderByScheduledAt']||'DESC';this[_0x3275('0x20')]=_0x24867d[_0x3275('0x20')]||undefined;this[_0x3275('0x21')]=_0x24867d['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x3275('0x22')]=_0x24867d[_0x3275('0x22')]||undefined;this[_0x3275('0x23')]=_0x24867d['TrunkBackup']?_0x24867d[_0x3275('0x23')]:undefined;this['Trunk']=_0x24867d[_0x3275('0x24')]?_0x24867d[_0x3275('0x24')]:undefined;this[_0x3275('0x25')]=_0x24867d[_0x3275('0x25')]?_0x24867d[_0x3275('0x25')]:undefined;this[_0x3275('0x26')]=_0x24867d[_0x3275('0x26')]?_0x24867d[_0x3275('0x26')]:undefined;this[_0x3275('0x27')]=_0x24867d[_0x3275('0x26')]?_0x24867d['SquareProject'][_0x3275('0x28')]:undefined;this[_0x3275('0x29')]=_0x24867d[_0x3275('0x29')]||![];this[_0x3275('0x2a')]=_0x24867d[_0x3275('0x2a')];this[_0x3275('0x2b')]=_0x24867d[_0x3275('0x2b')];this['dialAMDAfterGreetingSilence']=_0x24867d[_0x3275('0x2c')];this[_0x3275('0x2d')]=_0x24867d[_0x3275('0x2d')];this[_0x3275('0x2e')]=_0x24867d[_0x3275('0x2e')];this[_0x3275('0x2f')]=_0x24867d[_0x3275('0x2f')];this[_0x3275('0x30')]=_0x24867d[_0x3275('0x30')];this[_0x3275('0x31')]=_0x24867d[_0x3275('0x31')];this[_0x3275('0x32')]=_0x24867d[_0x3275('0x32')];}module[_0x3275('0x33')]=Campaign;
\ No newline at end of file
index 4c71e6a..d50005b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17a7=['context','linkedid','exten','answertime','endtime','unmanaged','abandoned','lastdata','billableseconds','type','tag','disposition','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','exports','calleridnum','calleridname','connectedlinenum','connectedlinename'];(function(_0x2116e5,_0x284ea7){var _0x3cb275=function(_0x2ee7c9){while(--_0x2ee7c9){_0x2116e5['push'](_0x2116e5['shift']());}};_0x3cb275(++_0x284ea7);}(_0x17a7,0xc2));var _0x717a=function(_0xd91e0b,_0x348e6d){_0xd91e0b=_0xd91e0b-0x0;var _0x5074ce=_0x17a7[_0xd91e0b];return _0x5074ce;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this['destinationchannel']='';this[_0x717a('0x0')]=0x0;this[_0x717a('0x1')]='';this[_0x717a('0x2')]=undefined;this[_0x717a('0x3')]=undefined;this['accountcode']=0x0;this[_0x717a('0x4')]='';this['uniqueid']=0x0;this[_0x717a('0x5')]=0x0;this[_0x717a('0x6')]=0x0;this['answered']=![];this[_0x717a('0x7')]=null;this[_0x717a('0x8')]=null;this[_0x717a('0x9')]=![];this[_0x717a('0xa')]=![];this['lastapplication']='';this[_0x717a('0xb')]='';this['duration']=0x0;this[_0x717a('0xc')]=0x0;this['holdtime']=0x0;this[_0x717a('0xd')]=null;this[_0x717a('0xe')]=null;this[_0x717a('0xf')]=null;this['monitor']=![];this['monitorFilename']=null;this[_0x717a('0x10')]=null;this[_0x717a('0x11')]=[];this[_0x717a('0x12')]=undefined;this[_0x717a('0x13')]=undefined;this[_0x717a('0x14')]=undefined;this['mohtime']=0x0;}module[_0x717a('0x15')]=Channel;
\ No newline at end of file
+var _0x578c=['uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','disposition','monitorFilename','queue','monitors','transferconnectedlinenum','transferType','mohtime','starttime','channel','destinationchannel','calleridname','connectedlinenum','connectedlinename','context'];(function(_0x2d9cf6,_0x367647){var _0x63c30b=function(_0x405365){while(--_0x405365){_0x2d9cf6['push'](_0x2d9cf6['shift']());}};_0x63c30b(++_0x367647);}(_0x578c,0x158));var _0xc578=function(_0x122b9d,_0x15958c){_0x122b9d=_0x122b9d-0x0;var _0x3c296d=_0x578c[_0x122b9d];return _0x3c296d;};'use strict';function Channel(){this[_0xc578('0x0')]=null;this[_0xc578('0x1')]='';this[_0xc578('0x2')]='';this['calleridnum']=0x0;this[_0xc578('0x3')]='';this[_0xc578('0x4')]=undefined;this[_0xc578('0x5')]=undefined;this['accountcode']=0x0;this[_0xc578('0x6')]='';this[_0xc578('0x7')]=0x0;this[_0xc578('0x8')]=0x0;this[_0xc578('0x9')]=0x0;this[_0xc578('0xa')]=![];this[_0xc578('0xb')]=null;this[_0xc578('0xc')]=null;this[_0xc578('0xd')]=![];this[_0xc578('0xe')]=![];this[_0xc578('0xf')]='';this[_0xc578('0x10')]='';this[_0xc578('0x11')]=0x0;this[_0xc578('0x12')]=0x0;this[_0xc578('0x13')]=0x0;this['type']=null;this['tag']=null;this[_0xc578('0x14')]=null;this['monitor']=![];this[_0xc578('0x15')]=null;this[_0xc578('0x16')]=null;this[_0xc578('0x17')]=[];this['transfercalleridnum']=undefined;this[_0xc578('0x18')]=undefined;this[_0xc578('0x19')]=undefined;this[_0xc578('0x1a')]=0x0;}module['exports']=Channel;
\ No newline at end of file
index d29023c..01e0905 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc61a=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType'];(function(_0x4aa838,_0x4aa14f){var _0x3abff0=function(_0x402d55){while(--_0x402d55){_0x4aa838['push'](_0x4aa838['shift']());}};_0x3abff0(++_0x4aa14f);}(_0xc61a,0x158));var _0xac61=function(_0x572438,_0x1b94fe){_0x572438=_0x572438-0x0;var _0xc6e9a7=_0xc61a[_0x572438];return _0xc6e9a7;};'use strict';function DeskAccount(_0x4a4df3){this['id']=_0x4a4df3['id']||0x0;this[_0xac61('0x0')]=_0x4a4df3['name']||'';this['username']=_0x4a4df3[_0xac61('0x1')]||'';this[_0xac61('0x2')]=_0x4a4df3[_0xac61('0x2')]||'';this[_0xac61('0x3')]=_0x4a4df3[_0xac61('0x3')]||'';this[_0xac61('0x4')]=_0x4a4df3[_0xac61('0x4')]||'';this[_0xac61('0x5')]=_0x4a4df3[_0xac61('0x5')]||'';this[_0xac61('0x6')]=_0x4a4df3[_0xac61('0x6')]||'';this[_0xac61('0x7')]=_0x4a4df3['token']||'';this[_0xac61('0x8')]=_0x4a4df3[_0xac61('0x8')]||'';this[_0xac61('0x9')]=_0x4a4df3[_0xac61('0x9')]||'';this['serverUrl']=_0x4a4df3[_0xac61('0xa')]||'';this[_0xac61('0xb')]=_0x4a4df3[_0xac61('0xb')]||{};}module['exports']=DeskAccount;
\ No newline at end of file
+var _0x5528=['serverUrl','Configurations','exports','name','username','remoteUri','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x1c9ce8,_0x5f4a9f){var _0x265023=function(_0x52b54d){while(--_0x52b54d){_0x1c9ce8['push'](_0x1c9ce8['shift']());}};_0x265023(++_0x5f4a9f);}(_0x5528,0x19b));var _0x8552=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0x5528[_0x55ff3e];return _0x2709eb;};'use strict';function DeskAccount(_0x2a2a17){this['id']=_0x2a2a17['id']||0x0;this[_0x8552('0x0')]=_0x2a2a17[_0x8552('0x0')]||'';this[_0x8552('0x1')]=_0x2a2a17[_0x8552('0x1')]||'';this['remoteUri']=_0x2a2a17[_0x8552('0x2')]||'';this['authType']=_0x2a2a17['authType']||'';this[_0x8552('0x3')]=_0x2a2a17['password']||'';this['consumerKey']=_0x2a2a17[_0x8552('0x4')]||'';this[_0x8552('0x5')]=_0x2a2a17[_0x8552('0x5')]||'';this[_0x8552('0x6')]=_0x2a2a17[_0x8552('0x6')]||'';this[_0x8552('0x7')]=_0x2a2a17[_0x8552('0x7')]||'';this[_0x8552('0x8')]=_0x2a2a17['type']||'';this[_0x8552('0x9')]=_0x2a2a17[_0x8552('0x9')]||'';this[_0x8552('0xa')]=_0x2a2a17[_0x8552('0xa')]||{};}module[_0x8552('0xb')]=DeskAccount;
\ No newline at end of file
index 6667a46..85cd28a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcf1=['CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication'];(function(_0x5c7da1,_0x4b1d04){var _0x176fe6=function(_0x4e5937){while(--_0x4e5937){_0x5c7da1['push'](_0x5c7da1['shift']());}};_0x176fe6(++_0x4b1d04);}(_0xdcf1,0x70));var _0x1dcf=function(_0x174fc1,_0x384973){_0x174fc1=_0x174fc1-0x0;var _0x41b79a=_0xdcf1[_0x174fc1];return _0x41b79a;};'use strict';function Dynamics365Account(_0x37bb61){this['id']=_0x37bb61['id']||0x0;this[_0x1dcf('0x0')]=_0x37bb61[_0x1dcf('0x0')]||'';this['username']=_0x37bb61[_0x1dcf('0x1')]||'';this[_0x1dcf('0x2')]=_0x37bb61['password']||'';this[_0x1dcf('0x3')]=_0x37bb61['remoteUri']||'';this[_0x1dcf('0x4')]=_0x37bb61[_0x1dcf('0x4')]||'';this[_0x1dcf('0x5')]=_0x37bb61['clientId']||'';this[_0x1dcf('0x6')]=_0x37bb61[_0x1dcf('0x6')]||{};this['serverUrl']=_0x37bb61[_0x1dcf('0x7')]||'';this[_0x1dcf('0x8')]=_0x37bb61[_0x1dcf('0x8')]||![];this['Configurations']=_0x37bb61['Configurations']||{};this[_0x1dcf('0x9')]=_0x37bb61[_0x1dcf('0x9')]||{};}module[_0x1dcf('0xa')]=Dynamics365Account;
\ No newline at end of file
+var _0x6ca3=['Configurations','CloudProvider','exports','username','password','remoteUri','clientId','clientSecret','serverUrl','modernAuthentication'];(function(_0x560dc3,_0x530226){var _0x5cb7d5=function(_0x14ccd3){while(--_0x14ccd3){_0x560dc3['push'](_0x560dc3['shift']());}};_0x5cb7d5(++_0x530226);}(_0x6ca3,0x8f));var _0x36ca=function(_0x434467,_0x2c6a75){_0x434467=_0x434467-0x0;var _0x5248ba=_0x6ca3[_0x434467];return _0x5248ba;};'use strict';function Dynamics365Account(_0x598f29){this['id']=_0x598f29['id']||0x0;this['name']=_0x598f29['name']||'';this['username']=_0x598f29[_0x36ca('0x0')]||'';this[_0x36ca('0x1')]=_0x598f29['password']||'';this['remoteUri']=_0x598f29[_0x36ca('0x2')]||'';this['tenantId']=_0x598f29['tenantId']||'';this[_0x36ca('0x3')]=_0x598f29[_0x36ca('0x3')]||'';this[_0x36ca('0x4')]=_0x598f29[_0x36ca('0x4')]||{};this[_0x36ca('0x5')]=_0x598f29[_0x36ca('0x5')]||'';this[_0x36ca('0x6')]=_0x598f29['modernAuthentication']||![];this[_0x36ca('0x7')]=_0x598f29[_0x36ca('0x7')]||{};this[_0x36ca('0x8')]=_0x598f29['CloudProvider']||{};}module[_0x36ca('0x9')]=Dynamics365Account;
\ No newline at end of file
index 1cde8fd..b344df9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d48=['localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo'];(function(_0x1675bd,_0x329983){var _0x793cfe=function(_0x2e2c27){while(--_0x2e2c27){_0x1675bd['push'](_0x1675bd['shift']());}};_0x793cfe(++_0x329983);}(_0x8d48,0xdc));var _0x88d4=function(_0x364a36,_0x1e2677){_0x364a36=_0x364a36-0x0;var _0x5cd6fa=_0x8d48[_0x364a36];return _0x5cd6fa;};'use strict';function FaxAccount(_0x3e07f7){this['id']=_0x3e07f7['id']||0x0;this[_0x88d4('0x0')]=_0x3e07f7['name']||'';this[_0x88d4('0x1')]=_0x3e07f7[_0x88d4('0x1')];this[_0x88d4('0x2')]=_0x3e07f7['ecm'];this[_0x88d4('0x3')]=_0x3e07f7[_0x88d4('0x3')];this[_0x88d4('0x4')]=_0x3e07f7[_0x88d4('0x4')];this[_0x88d4('0x5')]=_0x3e07f7['minrate']||0x960;this[_0x88d4('0x6')]=_0x3e07f7['maxrate']||0x3840;this['modem']=_0x3e07f7[_0x88d4('0x7')]||'v17,v27,v29';this[_0x88d4('0x8')]=_0x3e07f7[_0x88d4('0x8')]||'no';this['faxdetect']=_0x3e07f7[_0x88d4('0x9')]||'no';this[_0x88d4('0xa')]=_0x3e07f7[_0x88d4('0xa')]||0x1388;this[_0x88d4('0xb')]=_0x3e07f7[_0x88d4('0xb')]||'SIP';this['Trunk']=_0x3e07f7[_0x88d4('0xc')]?_0x3e07f7[_0x88d4('0xc')]:undefined;this[_0x88d4('0xd')]=_0x3e07f7['ListId'];this[_0x88d4('0xe')]=_0x3e07f7[_0x88d4('0xe')];}module[_0x88d4('0xf')]=FaxAccount;
\ No newline at end of file
+var _0x65cd=['v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem'];(function(_0x24cad0,_0x5df90d){var _0xecdecf=function(_0x436103){while(--_0x436103){_0x24cad0['push'](_0x24cad0['shift']());}};_0xecdecf(++_0x5df90d);}(_0x65cd,0x1cc));var _0xd65c=function(_0x592eeb,_0x10ef82){_0x592eeb=_0x592eeb-0x0;var _0x3ea777=_0x65cd[_0x592eeb];return _0x3ea777;};'use strict';function FaxAccount(_0x1873e9){this['id']=_0x1873e9['id']||0x0;this[_0xd65c('0x0')]=_0x1873e9['name']||'';this['description']=_0x1873e9[_0xd65c('0x1')];this[_0xd65c('0x2')]=_0x1873e9[_0xd65c('0x2')];this[_0xd65c('0x3')]=_0x1873e9[_0xd65c('0x3')];this[_0xd65c('0x4')]=_0x1873e9['localstationid'];this[_0xd65c('0x5')]=_0x1873e9[_0xd65c('0x5')]||0x960;this[_0xd65c('0x6')]=_0x1873e9[_0xd65c('0x6')]||0x3840;this[_0xd65c('0x7')]=_0x1873e9['modem']||_0xd65c('0x8');this['gateway']=_0x1873e9[_0xd65c('0x9')]||'no';this[_0xd65c('0xa')]=_0x1873e9[_0xd65c('0xa')]||'no';this[_0xd65c('0xb')]=_0x1873e9[_0xd65c('0xb')]||0x1388;this[_0xd65c('0xc')]=_0x1873e9[_0xd65c('0xc')]||_0xd65c('0xd');this['Trunk']=_0x1873e9[_0xd65c('0xe')]?_0x1873e9[_0xd65c('0xe')]:undefined;this['ListId']=_0x1873e9[_0xd65c('0xf')];this[_0xd65c('0x10')]=_0x1873e9[_0xd65c('0x10')];}module[_0xd65c('0x11')]=FaxAccount;
\ No newline at end of file
index 2ce19a3..c224c2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c5d=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x5c5d,0xe1));var _0xd5c5=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x5c5d[_0x618414];return _0x21c19a;};'use strict';function FreshdeskAccount(_0x12cb14){this['id']=_0x12cb14['id']||0x0;this[_0xd5c5('0x0')]=_0x12cb14[_0xd5c5('0x0')]||'';this['username']=_0x12cb14[_0xd5c5('0x1')]||'';this[_0xd5c5('0x2')]=_0x12cb14[_0xd5c5('0x3')]||'';this['remoteUri']=_0x12cb14[_0xd5c5('0x4')]||'';this[_0xd5c5('0x5')]=_0x12cb14[_0xd5c5('0x5')]||'';this['Configurations']=_0x12cb14[_0xd5c5('0x6')]||{};}module[_0xd5c5('0x7')]=FreshdeskAccount;
\ No newline at end of file
+var _0xed7d=['serverUrl','Configurations','name','username','apiKey','remoteUri'];(function(_0x31a2c8,_0x5d3c03){var _0x2e802e=function(_0x524271){while(--_0x524271){_0x31a2c8['push'](_0x31a2c8['shift']());}};_0x2e802e(++_0x5d3c03);}(_0xed7d,0xce));var _0xded7=function(_0x38aa3d,_0x5ed191){_0x38aa3d=_0x38aa3d-0x0;var _0x8936ba=_0xed7d[_0x38aa3d];return _0x8936ba;};'use strict';function FreshdeskAccount(_0x5cfc21){this['id']=_0x5cfc21['id']||0x0;this[_0xded7('0x0')]=_0x5cfc21[_0xded7('0x0')]||'';this[_0xded7('0x1')]=_0x5cfc21[_0xded7('0x1')]||'';this[_0xded7('0x2')]=_0x5cfc21['token']||'';this[_0xded7('0x3')]=_0x5cfc21[_0xded7('0x3')]||'';this[_0xded7('0x4')]=_0x5cfc21[_0xded7('0x4')]||'';this[_0xded7('0x5')]=_0x5cfc21['Configurations']||{};}module['exports']=FreshdeskAccount;
\ No newline at end of file
index 6992937..9388c43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4350=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x23b941,_0x16c9d3){var _0x128522=function(_0x4ba26c){while(--_0x4ba26c){_0x23b941['push'](_0x23b941['shift']());}};_0x128522(++_0x16c9d3);}(_0x4350,0x1d0));var _0x0435=function(_0x5477c7,_0x4140b8){_0x5477c7=_0x5477c7-0x0;var _0x3ff5c4=_0x4350[_0x5477c7];return _0x3ff5c4;};'use strict';function FreshsalesAccount(_0x2d5ec8){this['id']=_0x2d5ec8['id']||0x0;this[_0x0435('0x0')]=_0x2d5ec8['name']||'';this[_0x0435('0x1')]=_0x2d5ec8['username']||'';this[_0x0435('0x2')]=_0x2d5ec8[_0x0435('0x3')]||'';this['remoteUri']=_0x2d5ec8[_0x0435('0x4')]||'';this[_0x0435('0x5')]=_0x2d5ec8[_0x0435('0x5')]||'';this[_0x0435('0x6')]=_0x2d5ec8['Configurations']||{};}module[_0x0435('0x7')]=FreshsalesAccount;
\ No newline at end of file
+var _0xafa5=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x35c7a9,_0x5e6bab){var _0x38d56b=function(_0x5de4f8){while(--_0x5de4f8){_0x35c7a9['push'](_0x35c7a9['shift']());}};_0x38d56b(++_0x5e6bab);}(_0xafa5,0x1af));var _0x5afa=function(_0x180d65,_0xd523e9){_0x180d65=_0x180d65-0x0;var _0x3d365e=_0xafa5[_0x180d65];return _0x3d365e;};'use strict';function FreshsalesAccount(_0x3458cc){this['id']=_0x3458cc['id']||0x0;this[_0x5afa('0x0')]=_0x3458cc[_0x5afa('0x0')]||'';this[_0x5afa('0x1')]=_0x3458cc[_0x5afa('0x1')]||'';this[_0x5afa('0x2')]=_0x3458cc[_0x5afa('0x3')]||'';this[_0x5afa('0x4')]=_0x3458cc[_0x5afa('0x4')]||'';this[_0x5afa('0x5')]=_0x3458cc[_0x5afa('0x5')]||'';this[_0x5afa('0x6')]=_0x3458cc['Configurations']||{};}module[_0x5afa('0x7')]=FreshsalesAccount;
\ No newline at end of file
index adcebdb..5011af5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ca0=['queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten','priority','assigned','lastAssignedTo','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridname','queue'];(function(_0x8e624d,_0x2da1f6){var _0x12bd8d=function(_0x48cf6b){while(--_0x48cf6b){_0x8e624d['push'](_0x8e624d['shift']());}};_0x12bd8d(++_0x2da1f6);}(_0x5ca0,0x19b));var _0x05ca=function(_0x2c62de,_0x567da1){_0x2c62de=_0x2c62de-0x0;var _0x1bd64e=_0x5ca0[_0x2c62de];return _0x1bd64e;};'use strict';function QueueReport(){this[_0x05ca('0x0')]=_0x05ca('0x1');this[_0x05ca('0x2')]='';this['calleridnum']='';this[_0x05ca('0x3')]='';this[_0x05ca('0x4')]='';this['queuecallerjoinAt']=null;this[_0x05ca('0x5')]=null;this[_0x05ca('0x6')]=0x1;this[_0x05ca('0x7')]=0x1;this[_0x05ca('0x8')]=![];this[_0x05ca('0x9')]=null;this['queuecallercomplete']=![];this[_0x05ca('0xa')]=null;this[_0x05ca('0xb')]=![];this[_0x05ca('0xc')]=null;this[_0x05ca('0xd')]=0x1;this[_0x05ca('0xe')]='';this[_0x05ca('0xf')]='';this[_0x05ca('0x10')]='';this[_0x05ca('0x11')]='';this['context']='';this[_0x05ca('0x12')]='';this[_0x05ca('0x13')]='';this['holdtime']=0x0;this[_0x05ca('0x14')]=![];this[_0x05ca('0x15')]='';this['motionChannel']=_0x05ca('0x16');this[_0x05ca('0x17')]=0x0;this[_0x05ca('0x18')]={};}module[_0x05ca('0x19')]=QueueReport;
\ No newline at end of file
+var _0xfa56=['voice','variables','exports','type','uniqueid','calleridnum','queue','queuecallerjoinAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','lastAssignedTo','motionChannel'];(function(_0x1b09aa,_0x17a81a){var _0x29c69f=function(_0x477588){while(--_0x477588){_0x1b09aa['push'](_0x1b09aa['shift']());}};_0x29c69f(++_0x17a81a);}(_0xfa56,0x1cb));var _0x6fa5=function(_0x2edbd5,_0x5d48e6){_0x2edbd5=_0x2edbd5-0x0;var _0x461480=_0xfa56[_0x2edbd5];return _0x461480;};'use strict';function QueueReport(){this[_0x6fa5('0x0')]='inbound';this[_0x6fa5('0x1')]='';this[_0x6fa5('0x2')]='';this['calleridname']='';this[_0x6fa5('0x3')]='';this[_0x6fa5('0x4')]=null;this['queuecallerleaveAt']=null;this['position']=0x1;this[_0x6fa5('0x5')]=0x1;this[_0x6fa5('0x6')]=![];this[_0x6fa5('0x7')]=null;this[_0x6fa5('0x8')]=![];this[_0x6fa5('0x9')]=null;this['queuecallerexit']=![];this[_0x6fa5('0xa')]=null;this[_0x6fa5('0xb')]=0x1;this[_0x6fa5('0xc')]='';this[_0x6fa5('0xd')]='';this[_0x6fa5('0xe')]='';this[_0x6fa5('0xf')]='';this[_0x6fa5('0x10')]='';this[_0x6fa5('0x11')]='';this[_0x6fa5('0x12')]='';this['holdtime']=0x0;this['assigned']=![];this[_0x6fa5('0x13')]='';this[_0x6fa5('0x14')]=_0x6fa5('0x15');this['mohtime']=0x0;this[_0x6fa5('0x16')]={};}module[_0x6fa5('0x17')]=QueueReport;
\ No newline at end of file
index f67f855..a2c716e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40cb=['exports','name','username','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl'];(function(_0x461c12,_0x54589e){var _0x9f849a=function(_0x2e19ed){while(--_0x2e19ed){_0x461c12['push'](_0x461c12['shift']());}};_0x9f849a(++_0x54589e);}(_0x40cb,0x105));var _0xb40c=function(_0x320686,_0x42bbdc){_0x320686=_0x320686-0x0;var _0x2e3e13=_0x40cb[_0x320686];return _0x2e3e13;};'use strict';function SalesforceAccount(_0xcb05d0){this['id']=_0xcb05d0['id']||0x0;this[_0xb40c('0x0')]=_0xcb05d0[_0xb40c('0x0')]||'';this[_0xb40c('0x1')]=_0xcb05d0[_0xb40c('0x1')]||'';this['remoteUri']=_0xcb05d0['remoteUri']||'';this['password']=_0xcb05d0[_0xb40c('0x2')]||'';this['clientId']=_0xcb05d0[_0xb40c('0x3')]||'';this[_0xb40c('0x4')]=_0xcb05d0[_0xb40c('0x4')]||'';this[_0xb40c('0x5')]=_0xcb05d0[_0xb40c('0x5')]||'';this[_0xb40c('0x6')]=_0xcb05d0[_0xb40c('0x6')]||_0xb40c('0x7');this[_0xb40c('0x8')]=_0xcb05d0[_0xb40c('0x8')]||'';this['Configurations']=_0xcb05d0['Configurations']||{};}module[_0xb40c('0x9')]=SalesforceAccount;
\ No newline at end of file
+var _0xe16e=['password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x3c2485,_0x558b6f){var _0xdd4511=function(_0x59ad0f){while(--_0x59ad0f){_0x3c2485['push'](_0x3c2485['shift']());}};_0xdd4511(++_0x558b6f);}(_0xe16e,0x81));var _0xee16=function(_0x178f52,_0x5d9675){_0x178f52=_0x178f52-0x0;var _0x556f99=_0xe16e[_0x178f52];return _0x556f99;};'use strict';function SalesforceAccount(_0x5bdb8a){this['id']=_0x5bdb8a['id']||0x0;this[_0xee16('0x0')]=_0x5bdb8a[_0xee16('0x0')]||'';this['username']=_0x5bdb8a[_0xee16('0x1')]||'';this[_0xee16('0x2')]=_0x5bdb8a['remoteUri']||'';this[_0xee16('0x3')]=_0x5bdb8a[_0xee16('0x3')]||'';this['clientId']=_0x5bdb8a[_0xee16('0x4')]||'';this[_0xee16('0x5')]=_0x5bdb8a['clientSecret']||'';this['securityToken']=_0x5bdb8a[_0xee16('0x6')]||'';this['type']=_0x5bdb8a[_0xee16('0x7')]||_0xee16('0x8');this[_0xee16('0x9')]=_0x5bdb8a[_0xee16('0x9')]||'';this['Configurations']=_0x5bdb8a[_0xee16('0xa')]||{};}module[_0xee16('0xb')]=SalesforceAccount;
\ No newline at end of file
index 3211775..2f9b863 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d8b=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x25c044,_0xbd05f8){var _0x558ee5=function(_0x5de5d2){while(--_0x5de5d2){_0x25c044['push'](_0x25c044['shift']());}};_0x558ee5(++_0xbd05f8);}(_0x9d8b,0xe4));var _0xb9d8=function(_0x14c8ee,_0x34d4fb){_0x14c8ee=_0x14c8ee-0x0;var _0x51acc2=_0x9d8b[_0x14c8ee];return _0x51acc2;};'use strict';function ServicenowAccount(_0x43c626){this['id']=_0x43c626['id']||0x0;this['name']=_0x43c626[_0xb9d8('0x0')]||'';this[_0xb9d8('0x1')]=_0x43c626['username']||'';this[_0xb9d8('0x2')]=_0x43c626[_0xb9d8('0x2')]||'';this['remoteUri']=_0x43c626[_0xb9d8('0x3')]||'';this[_0xb9d8('0x4')]=_0x43c626[_0xb9d8('0x4')]||'';this[_0xb9d8('0x5')]=_0x43c626[_0xb9d8('0x5')]||{};}module[_0xb9d8('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0xb320=['password','serverUrl','exports','name','username'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb320,0x1de));var _0x0b32=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0xb320[_0x235482];return _0x5f5bea;};'use strict';function ServicenowAccount(_0xebe67f){this['id']=_0xebe67f['id']||0x0;this[_0x0b32('0x0')]=_0xebe67f[_0x0b32('0x0')]||'';this[_0x0b32('0x1')]=_0xebe67f['username']||'';this[_0x0b32('0x2')]=_0xebe67f[_0x0b32('0x2')]||'';this['remoteUri']=_0xebe67f['remoteUri']||'';this[_0x0b32('0x3')]=_0xebe67f[_0x0b32('0x3')]||'';this['Configurations']=_0xebe67f['Configurations']||{};}module[_0x0b32('0x4')]=ServicenowAccount;
\ No newline at end of file
index 22ea4cb..12dddbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd10=['password','remoteUri','serverUrl','Configurations','name','username'];(function(_0x55e95e,_0x43d917){var _0x47b71d=function(_0x599308){while(--_0x599308){_0x55e95e['push'](_0x55e95e['shift']());}};_0x47b71d(++_0x43d917);}(_0xbd10,0x1e4));var _0x0bd1=function(_0xfc77b9,_0x4bd5e7){_0xfc77b9=_0xfc77b9-0x0;var _0x4ba0af=_0xbd10[_0xfc77b9];return _0x4ba0af;};'use strict';function SugarcrmAccount(_0x2f9563){this['id']=_0x2f9563['id']||0x0;this[_0x0bd1('0x0')]=_0x2f9563[_0x0bd1('0x0')]||'';this[_0x0bd1('0x1')]=_0x2f9563[_0x0bd1('0x1')]||'';this[_0x0bd1('0x2')]=_0x2f9563[_0x0bd1('0x2')]||'';this[_0x0bd1('0x3')]=_0x2f9563[_0x0bd1('0x3')]||'';this['serverUrl']=_0x2f9563[_0x0bd1('0x4')]||'';this['Configurations']=_0x2f9563[_0x0bd1('0x5')]||{};}module['exports']=SugarcrmAccount;
\ No newline at end of file
+var _0x14af=['password','serverUrl','Configurations','exports','username'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0x14af,0xef));var _0xf14a=function(_0x2cc8a2,_0x2b6dce){_0x2cc8a2=_0x2cc8a2-0x0;var _0x18ffdb=_0x14af[_0x2cc8a2];return _0x18ffdb;};'use strict';function SugarcrmAccount(_0x26f43f){this['id']=_0x26f43f['id']||0x0;this['name']=_0x26f43f['name']||'';this[_0xf14a('0x0')]=_0x26f43f[_0xf14a('0x0')]||'';this[_0xf14a('0x1')]=_0x26f43f[_0xf14a('0x1')]||'';this['remoteUri']=_0x26f43f['remoteUri']||'';this['serverUrl']=_0x26f43f[_0xf14a('0x2')]||'';this[_0xf14a('0x3')]=_0x26f43f[_0xf14a('0x3')]||{};}module[_0xf14a('0x4')]=SugarcrmAccount;
\ No newline at end of file
index 5e839b0..a9d8581 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc288=['accountcode','state','stateTime','status','unknown','address','exports','name'];(function(_0x486ad1,_0x593710){var _0x131cb7=function(_0x4a6fdf){while(--_0x4a6fdf){_0x486ad1['push'](_0x486ad1['shift']());}};_0x131cb7(++_0x593710);}(_0xc288,0x197));var _0x8c28=function(_0x2790be,_0x60545){_0x2790be=_0x2790be-0x0;var _0x262595=_0xc288[_0x2790be];return _0x262595;};'use strict';function Telephone(_0xccbe4e){this['id']=_0xccbe4e['id']||0x0;this[_0x8c28('0x0')]=_0xccbe4e[_0x8c28('0x0')]||'';this[_0x8c28('0x1')]=_0xccbe4e[_0x8c28('0x1')]||'';this[_0x8c28('0x2')]='unknown';this[_0x8c28('0x3')]=0x0;this[_0x8c28('0x4')]=_0x8c28('0x5');this[_0x8c28('0x6')]='';}module[_0x8c28('0x7')]=Telephone;
\ No newline at end of file
+var _0x57e9=['name','accountcode','state','unknown','stateTime','address','exports'];(function(_0x5e4b35,_0x4d0efd){var _0x220bde=function(_0xa4f167){while(--_0xa4f167){_0x5e4b35['push'](_0x5e4b35['shift']());}};_0x220bde(++_0x4d0efd);}(_0x57e9,0x150));var _0x957e=function(_0x27f13a,_0x437e5f){_0x27f13a=_0x27f13a-0x0;var _0x4e1d50=_0x57e9[_0x27f13a];return _0x4e1d50;};'use strict';function Telephone(_0x195b2a){this['id']=_0x195b2a['id']||0x0;this[_0x957e('0x0')]=_0x195b2a[_0x957e('0x0')]||'';this['accountcode']=_0x195b2a[_0x957e('0x1')]||'';this[_0x957e('0x2')]=_0x957e('0x3');this[_0x957e('0x4')]=0x0;this['status']=_0x957e('0x3');this[_0x957e('0x5')]='';}module[_0x957e('0x6')]=Telephone;
\ No newline at end of file
index 4b7417a..446d656 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','html'];(function(_0x55444e,_0x1bf843){var _0x151981=function(_0xd60db4){while(--_0xd60db4){_0x55444e['push'](_0x55444e['shift']());}};_0x151981(++_0x1bf843);}(_0xb10b,0x12a));var _0xbb10=function(_0x113dd1,_0x15aaa1){_0x113dd1=_0x113dd1-0x0;var _0x1605e0=_0xb10b[_0x113dd1];return _0x1605e0;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template;
\ No newline at end of file
+var _0xa9e0=['exports','name'];(function(_0x138d6e,_0x16e478){var _0x219855=function(_0x137bb7){while(--_0x137bb7){_0x138d6e['push'](_0x138d6e['shift']());}};_0x219855(++_0x16e478);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template;
\ No newline at end of file
index 3ca8f79..6c009e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x4232d8,_0x13fd09){var _0x324de2=function(_0x167ad5){while(--_0x167ad5){_0x4232d8['push'](_0x4232d8['shift']());}};_0x324de2(++_0x13fd09);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['Actions']||[];}module['exports']=Trigger;
\ No newline at end of file
+var _0xb10b=['AllConditions','AnyConditions','Actions','exports','name','channel','status'];(function(_0x412181,_0xf7ac80){var _0x42aefc=function(_0x311db0){while(--_0x311db0){_0x412181['push'](_0x412181['shift']());}};_0x42aefc(++_0xf7ac80);}(_0xb10b,0x12a));var _0xbb10=function(_0x5efbd0,_0x299553){_0x5efbd0=_0x5efbd0-0x0;var _0x475ec9=_0xb10b[_0x5efbd0];return _0x475ec9;};'use strict';function Trigger(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'voice';this[_0xbb10('0x2')]=_0x13ce8d[_0xbb10('0x2')]||![];this[_0xbb10('0x3')]=_0x13ce8d[_0xbb10('0x3')]||[];this[_0xbb10('0x4')]=_0x13ce8d[_0xbb10('0x4')]||[];this['Actions']=_0x13ce8d[_0xbb10('0x5')]||[];}module[_0xbb10('0x6')]=Trigger;
\ No newline at end of file
index c2fede7..0a27580 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd07b=['unknown','registry','indexOf','split','host','port','domain','refresh','stateRegistry','registrationtime','address','defaultuser','active','name','stateTime'];(function(_0x534fa8,_0x2cf2d3){var _0x4b3dc1=function(_0x4b571d){while(--_0x4b571d){_0x534fa8['push'](_0x534fa8['shift']());}};_0x4b3dc1(++_0x2cf2d3);}(_0xd07b,0x192));var _0xbd07=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd07b[_0x2dafbe];return _0x58a45a;};'use strict';function Trunk(_0x2540da){this['id']=_0x2540da['id']||0x0;this[_0xbd07('0x0')]=_0x2540da[_0xbd07('0x0')]||![];this[_0xbd07('0x1')]=_0x2540da[_0xbd07('0x1')]||'';this['state']='unknown';this[_0xbd07('0x2')]=0x0;this['status']=_0xbd07('0x3');this['registry']=_0x2540da[_0xbd07('0x4')]&&_0x2540da[_0xbd07('0x4')][_0xbd07('0x5')](':')?_0x2540da[_0xbd07('0x4')][_0xbd07('0x6')](':')[0x0]:'';this[_0xbd07('0x7')]='';this[_0xbd07('0x8')]='';this[_0xbd07('0x9')]='';this['domainport']='';this[_0xbd07('0xa')]='';this[_0xbd07('0xb')]='unknown';this[_0xbd07('0xc')]='';this[_0xbd07('0xd')]='';this[_0xbd07('0xe')]=_0x2540da['defaultuser']||'';}module['exports']=Trunk;
\ No newline at end of file
+var _0x0abb=['name','unknown','status','registry','split','port','domain','refresh','stateRegistry','registrationtime','address','defaultuser','active'];(function(_0x495b3d,_0x4d3da4){var _0x4cb329=function(_0xdef9f0){while(--_0xdef9f0){_0x495b3d['push'](_0x495b3d['shift']());}};_0x4cb329(++_0x4d3da4);}(_0x0abb,0xa8));var _0xb0ab=function(_0x2909ea,_0x5439e6){_0x2909ea=_0x2909ea-0x0;var _0x53fd9e=_0x0abb[_0x2909ea];return _0x53fd9e;};'use strict';function Trunk(_0x4cde03){this['id']=_0x4cde03['id']||0x0;this[_0xb0ab('0x0')]=_0x4cde03['active']||![];this[_0xb0ab('0x1')]=_0x4cde03['name']||'';this['state']=_0xb0ab('0x2');this['stateTime']=0x0;this[_0xb0ab('0x3')]=_0xb0ab('0x2');this[_0xb0ab('0x4')]=_0x4cde03[_0xb0ab('0x4')]&&_0x4cde03[_0xb0ab('0x4')]['indexOf'](':')?_0x4cde03[_0xb0ab('0x4')][_0xb0ab('0x5')](':')[0x0]:'';this['host']='';this[_0xb0ab('0x6')]='';this[_0xb0ab('0x7')]='';this['domainport']='';this[_0xb0ab('0x8')]='';this[_0xb0ab('0x9')]=_0xb0ab('0x2');this[_0xb0ab('0xa')]='';this[_0xb0ab('0xb')]='';this[_0xb0ab('0xc')]=_0x4cde03[_0xb0ab('0xc')]||'';}module['exports']=Trunk;
\ No newline at end of file
index dfca603..99b2350 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0f4=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x2a1514,_0x45d71b){var _0x171620=function(_0x4de0da){while(--_0x4de0da){_0x2a1514['push'](_0x2a1514['shift']());}};_0x171620(++_0x45d71b);}(_0xf0f4,0xda));var _0x4f0f=function(_0x54db81,_0x4e0c60){_0x54db81=_0x54db81-0x0;var _0x417678=_0xf0f4[_0x54db81];return _0x417678;};'use strict';function voiceExtension(_0xf132fa){this['id']=_0xf132fa['id']||0x0;this[_0x4f0f('0x0')]=_0xf132fa[_0x4f0f('0x0')]||'';this['recordingFormat']=_0xf132fa[_0x4f0f('0x1')]||'none';this[_0x4f0f('0x2')]=_0xf132fa[_0x4f0f('0x2')]||![];}module[_0x4f0f('0x3')]=voiceExtension;
\ No newline at end of file
+var _0xfa1b=['exten','recordingFormat','mandatoryDisposition'];(function(_0x4d5d38,_0x13e744){var _0x2a170d=function(_0x395f6b){while(--_0x395f6b){_0x4d5d38['push'](_0x4d5d38['shift']());}};_0x2a170d(++_0x13e744);}(_0xfa1b,0xd2));var _0xbfa1=function(_0x50ca25,_0x579da9){_0x50ca25=_0x50ca25-0x0;var _0x46b1d6=_0xfa1b[_0x50ca25];return _0x46b1d6;};'use strict';function voiceExtension(_0x1a3c70){this['id']=_0x1a3c70['id']||0x0;this['exten']=_0x1a3c70[_0xbfa1('0x0')]||'';this[_0xbfa1('0x1')]=_0x1a3c70[_0xbfa1('0x1')]||'none';this[_0xbfa1('0x2')]=_0x1a3c70[_0xbfa1('0x2')]||![];}module['exports']=voiceExtension;
\ No newline at end of file
index d033927..a053cf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94d5=['dialGlobalInterval','dialActive','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','busy','invalid','ringing','onhold','wav','gsm','rrmemory','name','monitor_format','type','inbound','waiting','talking','total','answered','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','dialTimezone'];(function(_0x53ec76,_0x394d0d){var _0x3919e4=function(_0x1b58ae){while(--_0x1b58ae){_0x53ec76['push'](_0x53ec76['shift']());}};_0x3919e4(++_0x394d0d);}(_0x94d5,0xcf));var _0x594d=function(_0x543d31,_0x54700b){_0x543d31=_0x543d31-0x0;var _0x5c857d=_0x94d5[_0x543d31];return _0x5c857d;};'use strict';var statusDesc=['unknown','not_inuse','inuse',_0x594d('0x0'),_0x594d('0x1'),'unavailable',_0x594d('0x2'),'ringinuse',_0x594d('0x3')];var monitorFormat={'wav':_0x594d('0x4'),'wav49':'wav49','gsm':_0x594d('0x5')};var strategy={'rrmemory':_0x594d('0x6'),'roundrobin':'roundrobin'};function VoiceQueue(_0x4bf41a){this['id']=_0x4bf41a['id']||0x0;this[_0x594d('0x7')]=_0x4bf41a['name']||'';this[_0x594d('0x8')]=_0x4bf41a[_0x594d('0x8')]||'';this[_0x594d('0x9')]=_0x4bf41a[_0x594d('0x9')]||_0x594d('0xa');this[_0x594d('0xb')]=0x0;this[_0x594d('0xc')]=0x0;this[_0x594d('0xd')]=0x0;this[_0x594d('0xe')]=0x0;this['sumDuration']=0x0;this[_0x594d('0xf')]=0x0;this[_0x594d('0x10')]=0x0;this[_0x594d('0x11')]=0x0;this[_0x594d('0x12')]=0x0;this[_0x594d('0x13')]=0x0;this[_0x594d('0x14')]=0x0;this[_0x594d('0x15')]=_0x4bf41a[_0x594d('0x15')]||![];this['acwTimeout']=_0x4bf41a[_0x594d('0x16')]||0xa;this[_0x594d('0x17')]=_0x4bf41a['autopause']||'no';this[_0x594d('0x18')]=!![];this[_0x594d('0x19')]='';this['originated']=0x0;this['temp']=0x0;this[_0x594d('0x1a')]=_0x4bf41a[_0x594d('0x1a')]||null;this[_0x594d('0x1b')]=_0x4bf41a[_0x594d('0x1b')]?_0x4bf41a[_0x594d('0x1b')]:null;this[_0x594d('0x1c')]=_0x4bf41a[_0x594d('0x1c')];this['dialMethod']=_0x4bf41a['dialMethod']||_0x594d('0x1d');this[_0x594d('0x1e')]=_0x4bf41a[_0x594d('0x1e')]||0x0;this[_0x594d('0x1f')]=_0x4bf41a[_0x594d('0x1f')]||0x0;this[_0x594d('0x20')]=_0x4bf41a[_0x594d('0x20')]||0x1;this[_0x594d('0x21')]=_0x4bf41a[_0x594d('0x21')]||_0x594d('0x22');this[_0x594d('0x23')]=_0x4bf41a['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x4bf41a[_0x594d('0x24')]||0x258;this['dialOriginateCallerIdName']=_0x4bf41a[_0x594d('0x25')]||_0x594d('0x26');this['dialOriginateCallerIdNumber']=_0x4bf41a['dialOriginateCallerIdNumber']||_0x594d('0x26');this[_0x594d('0x27')]=_0x4bf41a[_0x594d('0x27')]||0x1e;this[_0x594d('0x28')]=_0x4bf41a[_0x594d('0x28')]||_0x594d('0x29');this[_0x594d('0x2a')]=_0x4bf41a[_0x594d('0x2a')]||0x3;this['dialQueueProject']=_0x4bf41a[_0x594d('0x2b')]||undefined;this[_0x594d('0x2c')]=_0x4bf41a['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x4bf41a['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x4bf41a[_0x594d('0x2d')]||0x3;this[_0x594d('0x2e')]=_0x4bf41a[_0x594d('0x2e')]||0x96;this['dialNoAnswerMaxRetry']=_0x4bf41a[_0x594d('0x2f')]||0x3;this[_0x594d('0x30')]=_0x4bf41a[_0x594d('0x30')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x4bf41a[_0x594d('0x31')]||0x3;this[_0x594d('0x32')]=_0x4bf41a[_0x594d('0x32')]||0x96;this[_0x594d('0x33')]=_0x4bf41a['dialDropMaxRetry']||0x3;this[_0x594d('0x34')]=_0x4bf41a[_0x594d('0x34')]||0x96;this[_0x594d('0x35')]=_0x4bf41a[_0x594d('0x35')]||0x3;this[_0x594d('0x36')]=_0x4bf41a[_0x594d('0x36')]||0x96;this[_0x594d('0x37')]=_0x4bf41a[_0x594d('0x37')]||0x3;this[_0x594d('0x38')]=_0x4bf41a[_0x594d('0x38')]||0x96;this[_0x594d('0x39')]=_0x4bf41a[_0x594d('0x39')]||0x3;this[_0x594d('0x3a')]=_0x4bf41a[_0x594d('0x3a')]||0x96;this[_0x594d('0x3b')]=_0x4bf41a[_0x594d('0x3b')]||0x3;this[_0x594d('0x3c')]=_0x4bf41a['dialGlobalMaxRetry']||0x4;this[_0x594d('0x3d')]=_0x4bf41a['Trunk']?_0x4bf41a[_0x594d('0x3d')]:undefined;this['TrunkBackup']=_0x4bf41a[_0x594d('0x3e')]?_0x4bf41a[_0x594d('0x3e')]:undefined;this[_0x594d('0x3f')]=_0x4bf41a['dialPrefix']||undefined;this[_0x594d('0x40')]=_0x4bf41a[_0x594d('0x40')]?_0x4bf41a['Interval']:undefined;this[_0x594d('0x41')]=_0x4bf41a[_0x594d('0x41')]||_0x594d('0x42');this[_0x594d('0x43')]=_0x4bf41a['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x594d('0x44')]=_0x4bf41a[_0x594d('0x44')]||undefined;this['strategy']=strategy[_0x4bf41a[_0x594d('0x45')]]||_0x594d('0x6');this[_0x594d('0x46')]=!![];this['dialAMDActive']=_0x4bf41a['dialAMDActive']||![];this[_0x594d('0x47')]=_0x4bf41a[_0x594d('0x47')];this[_0x594d('0x48')]=_0x4bf41a['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x4bf41a[_0x594d('0x49')];this[_0x594d('0x4a')]=_0x4bf41a[_0x594d('0x4a')];this['dialAMDMinWordLength']=_0x4bf41a[_0x594d('0x4b')];this[_0x594d('0x4c')]=_0x4bf41a[_0x594d('0x4c')];this['dialAMDMaximumNumberOfWords']=_0x4bf41a[_0x594d('0x4d')];this[_0x594d('0x4e')]=_0x4bf41a[_0x594d('0x4e')];this[_0x594d('0x4f')]=_0x4bf41a[_0x594d('0x4f')];this['outboundRejectCallsDay']=0x0;this['pTalking']=0x0;this[_0x594d('0x50')]=_0x4bf41a[_0x594d('0x50')];this[_0x594d('0x51')]=0x0;this[_0x594d('0x52')]=0x0;this[_0x594d('0x53')]=0x0;this[_0x594d('0x54')]=0x0;this[_0x594d('0x55')]=0x0;this[_0x594d('0x56')]=0x0;this[_0x594d('0x57')]=0x0;this[_0x594d('0x58')]=0x0;this[_0x594d('0x59')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0x594d('0x5a')]=0x0;this[_0x594d('0x5b')]=0x0;this[_0x594d('0x5c')]=0x0;this[_0x594d('0x5d')]=undefined;this[_0x594d('0x5e')]=undefined;this['handlePredictive']=undefined;this[_0x594d('0x5f')]=1.05;this[_0x594d('0x60')]=0x0;this[_0x594d('0x61')]=0x0;this[_0x594d('0x62')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x594d('0x63')]=0x0;this[_0x594d('0x64')]=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x594d('0x65')]=_0x4bf41a['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x594d('0x66')]=_0x4bf41a[_0x594d('0x67')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x594d('0x68')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x594d('0x69')]=0x0;this['erlangCallToSecond']=0x0;this[_0x594d('0x6a')]=0x0;this[_0x594d('0x6b')]=0x0;this[_0x594d('0x6c')]=_0x4bf41a[_0x594d('0x6c')]||0x1e;this['dialRecallInQueue']=_0x4bf41a[_0x594d('0x6d')]||![];this[_0x594d('0x6e')]=!!_0x4bf41a[_0x594d('0x6e')]||![];this[_0x594d('0x6f')]=!!_0x4bf41a[_0x594d('0x6f')]||![];this[_0x594d('0x70')]=_0x4bf41a[_0x594d('0x70')]||undefined;this[_0x594d('0x71')]=_0x4bf41a[_0x594d('0x71')]||![];this['dialAgiAfterHangupAgent']=_0x4bf41a[_0x594d('0x72')]||![];this['monitor_format']=monitorFormat[_0x4bf41a[_0x594d('0x8')]]?monitorFormat[_0x4bf41a[_0x594d('0x8')]]:undefined;this['mandatoryDisposition']=_0x4bf41a[_0x594d('0x73')]||![];this[_0x594d('0x74')]=_0x4bf41a[_0x594d('0x74')]?_0x4bf41a[_0x594d('0x74')]:undefined;}module['exports']=VoiceQueue;
\ No newline at end of file
+var _0x1de8=['outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1de8,0x193));var _0x81de=function(_0x496333,_0x1c47d6){_0x496333=_0x496333-0x0;var _0x44256e=_0x1de8[_0x496333];return _0x44256e;};'use strict';var statusDesc=[_0x81de('0x0'),_0x81de('0x1'),'inuse',_0x81de('0x2'),_0x81de('0x3'),_0x81de('0x4'),_0x81de('0x5'),_0x81de('0x6'),_0x81de('0x7')];var monitorFormat={'wav':_0x81de('0x8'),'wav49':'wav49','gsm':_0x81de('0x9')};var strategy={'rrmemory':_0x81de('0xa'),'roundrobin':_0x81de('0xb')};function VoiceQueue(_0x42c84b){this['id']=_0x42c84b['id']||0x0;this[_0x81de('0xc')]=_0x42c84b[_0x81de('0xc')]||'';this[_0x81de('0xd')]=_0x42c84b['monitor_format']||'';this['type']=_0x42c84b[_0x81de('0xe')]||_0x81de('0xf');this[_0x81de('0x10')]=0x0;this[_0x81de('0x11')]=0x0;this[_0x81de('0x12')]=0x0;this['answered']=0x0;this[_0x81de('0x13')]=0x0;this[_0x81de('0x14')]=0x0;this[_0x81de('0x15')]=0x0;this[_0x81de('0x16')]=0x0;this[_0x81de('0x17')]=0x0;this[_0x81de('0x18')]=0x0;this['available']=0x0;this[_0x81de('0x19')]=_0x42c84b['acw']||![];this[_0x81de('0x1a')]=_0x42c84b[_0x81de('0x1a')]||0xa;this[_0x81de('0x1b')]=_0x42c84b['autopause']||'no';this[_0x81de('0x1c')]=!![];this['message']='';this[_0x81de('0x1d')]=0x0;this[_0x81de('0x1e')]=0x0;this[_0x81de('0x1f')]=_0x42c84b[_0x81de('0x1f')]||null;this[_0x81de('0x20')]=_0x42c84b[_0x81de('0x20')]?_0x42c84b[_0x81de('0x20')]:null;this[_0x81de('0x21')]=_0x42c84b[_0x81de('0x21')];this['dialMethod']=_0x42c84b[_0x81de('0x22')]||_0x81de('0x23');this[_0x81de('0x24')]=_0x42c84b['dialLimitChannel']||0x0;this[_0x81de('0x25')]=_0x42c84b[_0x81de('0x25')]||0x0;this[_0x81de('0x26')]=_0x42c84b[_0x81de('0x26')]||0x1;this['dialPredictiveOptimization']=_0x42c84b[_0x81de('0x27')]||'dropRate';this[_0x81de('0x28')]=_0x42c84b['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x42c84b[_0x81de('0x29')]||0x258;this[_0x81de('0x2a')]=_0x42c84b[_0x81de('0x2a')]||_0x81de('0x2b');this[_0x81de('0x2c')]=_0x42c84b['dialOriginateCallerIdNumber']||_0x81de('0x2b');this[_0x81de('0x2d')]=_0x42c84b['dialOriginateTimeout']||0x1e;this[_0x81de('0x2e')]=_0x42c84b[_0x81de('0x2e')]||_0x81de('0x2f');this[_0x81de('0x30')]=_0x42c84b[_0x81de('0x30')]||0x3;this[_0x81de('0x31')]=_0x42c84b['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x42c84b['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x42c84b[_0x81de('0x32')]||0x96;this['dialBusyMaxRetry']=_0x42c84b['dialBusyMaxRetry']||0x3;this[_0x81de('0x33')]=_0x42c84b[_0x81de('0x33')]||0x96;this[_0x81de('0x34')]=_0x42c84b[_0x81de('0x34')]||0x3;this[_0x81de('0x35')]=_0x42c84b[_0x81de('0x35')]||0x96;this[_0x81de('0x36')]=_0x42c84b[_0x81de('0x36')]||0x3;this[_0x81de('0x37')]=_0x42c84b['dialNoSuchNumberRetryFrequency']||0x96;this[_0x81de('0x38')]=_0x42c84b[_0x81de('0x38')]||0x3;this['dialDropRetryFrequency']=_0x42c84b[_0x81de('0x39')]||0x96;this[_0x81de('0x3a')]=_0x42c84b['dialAbandonedMaxRetry']||0x3;this['dialAbandonedRetryFrequency']=_0x42c84b[_0x81de('0x3b')]||0x96;this[_0x81de('0x3c')]=_0x42c84b['dialMachineMaxRetry']||0x3;this[_0x81de('0x3d')]=_0x42c84b[_0x81de('0x3d')]||0x96;this[_0x81de('0x3e')]=_0x42c84b[_0x81de('0x3e')]||0x3;this[_0x81de('0x3f')]=_0x42c84b[_0x81de('0x3f')]||0x96;this[_0x81de('0x40')]=_0x42c84b[_0x81de('0x40')]||0x3;this['dialGlobalMaxRetry']=_0x42c84b['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x42c84b[_0x81de('0x41')]?_0x42c84b[_0x81de('0x41')]:undefined;this[_0x81de('0x42')]=_0x42c84b[_0x81de('0x42')]?_0x42c84b[_0x81de('0x42')]:undefined;this[_0x81de('0x43')]=_0x42c84b['dialPrefix']||undefined;this[_0x81de('0x44')]=_0x42c84b[_0x81de('0x44')]?_0x42c84b['Interval']:undefined;this[_0x81de('0x45')]=_0x42c84b[_0x81de('0x45')]||'DESC';this['dialRandomLastDigitCallerIdNumber']=_0x42c84b[_0x81de('0x46')]||undefined;this[_0x81de('0x47')]=_0x42c84b[_0x81de('0x47')]||undefined;this['strategy']=strategy[_0x42c84b[_0x81de('0x48')]]||_0x81de('0xa');this['queueStatusComplete']=!![];this[_0x81de('0x49')]=_0x42c84b[_0x81de('0x49')]||![];this[_0x81de('0x4a')]=_0x42c84b[_0x81de('0x4a')];this[_0x81de('0x4b')]=_0x42c84b[_0x81de('0x4b')];this['dialAMDAfterGreetingSilence']=_0x42c84b[_0x81de('0x4c')];this['dialAMDTotalAnalysisTime']=_0x42c84b[_0x81de('0x4d')];this[_0x81de('0x4e')]=_0x42c84b[_0x81de('0x4e')];this[_0x81de('0x4f')]=_0x42c84b['dialAMDBetweenWordsSilence'];this[_0x81de('0x50')]=_0x42c84b[_0x81de('0x50')];this[_0x81de('0x51')]=_0x42c84b[_0x81de('0x51')];this[_0x81de('0x52')]=_0x42c84b['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0x81de('0x53')]=0x0;this[_0x81de('0x54')]=_0x42c84b[_0x81de('0x54')];this[_0x81de('0x55')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x81de('0x56')]=0x0;this[_0x81de('0x57')]=0x0;this[_0x81de('0x58')]=0x0;this[_0x81de('0x59')]=0x0;this[_0x81de('0x5a')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x81de('0x5b')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x81de('0x5c')]=0x0;this[_0x81de('0x5d')]=0x0;this[_0x81de('0x5e')]=0x0;this[_0x81de('0x5f')]=0x0;this['startProgressive']=undefined;this[_0x81de('0x60')]=undefined;this['handlePredictive']=undefined;this[_0x81de('0x61')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x81de('0x62')]=0x0;this[_0x81de('0x63')]=0x0;this[_0x81de('0x64')]=0x0;this[_0x81de('0x65')]=0x0;this[_0x81de('0x66')]=0x0;this[_0x81de('0x67')]=0x0;this[_0x81de('0x68')]=0x0;this[_0x81de('0x69')]=_0x42c84b['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x81de('0x6a')]=_0x42c84b['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x81de('0x6b')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x81de('0x6c')]=0x1;this[_0x81de('0x6d')]=0x0;this['erlangCallToSecond']=0x0;this[_0x81de('0x6e')]=0x0;this[_0x81de('0x6f')]=0x0;this[_0x81de('0x70')]=_0x42c84b[_0x81de('0x70')]||0x1e;this[_0x81de('0x71')]=_0x42c84b[_0x81de('0x71')]||![];this[_0x81de('0x72')]=!!_0x42c84b[_0x81de('0x72')]||![];this[_0x81de('0x73')]=!!_0x42c84b['dialPreviewRecallmeReminder']||![];this[_0x81de('0x74')]=_0x42c84b[_0x81de('0x74')]||undefined;this[_0x81de('0x75')]=_0x42c84b[_0x81de('0x75')]||![];this[_0x81de('0x76')]=_0x42c84b[_0x81de('0x76')]||![];this[_0x81de('0xd')]=monitorFormat[_0x42c84b[_0x81de('0xd')]]?monitorFormat[_0x42c84b[_0x81de('0xd')]]:undefined;this[_0x81de('0x77')]=_0x42c84b[_0x81de('0x77')]||![];this[_0x81de('0x78')]=_0x42c84b[_0x81de('0x78')]?_0x42c84b[_0x81de('0x78')]:undefined;}module[_0x81de('0x79')]=VoiceQueue;
\ No newline at end of file
index a9c7b0f..3f04aba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74af=['accessKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0xb58bc2,_0x3fff5f){var _0x3902d6=function(_0x3e3855){while(--_0x3e3855){_0xb58bc2['push'](_0xb58bc2['shift']());}};_0x3902d6(++_0x3fff5f);}(_0x74af,0x178));var _0xf74a=function(_0x58394a,_0x3a3496){_0x58394a=_0x58394a-0x0;var _0x3bebf6=_0x74af[_0x58394a];return _0x3bebf6;};'use strict';function VtigerAccount(_0x3c12ac){this['id']=_0x3c12ac['id']||0x0;this[_0xf74a('0x0')]=_0x3c12ac[_0xf74a('0x0')]||'';this[_0xf74a('0x1')]=_0x3c12ac[_0xf74a('0x1')]||'';this[_0xf74a('0x2')]=_0x3c12ac['accessKey']||'';this[_0xf74a('0x3')]=_0x3c12ac[_0xf74a('0x3')]||'';this[_0xf74a('0x4')]=_0x3c12ac[_0xf74a('0x4')]||'';this[_0xf74a('0x5')]=_0x3c12ac[_0xf74a('0x5')]||{};}module[_0xf74a('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0x1bc8=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x59073f,_0x2cc379){var _0x5c0d28=function(_0x28cb9d){while(--_0x28cb9d){_0x59073f['push'](_0x59073f['shift']());}};_0x5c0d28(++_0x2cc379);}(_0x1bc8,0xf2));var _0x81bc=function(_0x24487f,_0x9b3ea0){_0x24487f=_0x24487f-0x0;var _0x456456=_0x1bc8[_0x24487f];return _0x456456;};'use strict';function VtigerAccount(_0x158fec){this['id']=_0x158fec['id']||0x0;this[_0x81bc('0x0')]=_0x158fec[_0x81bc('0x0')]||'';this['username']=_0x158fec[_0x81bc('0x1')]||'';this[_0x81bc('0x2')]=_0x158fec[_0x81bc('0x2')]||'';this[_0x81bc('0x3')]=_0x158fec[_0x81bc('0x3')]||'';this[_0x81bc('0x4')]=_0x158fec[_0x81bc('0x4')]||'';this['Configurations']=_0x158fec[_0x81bc('0x5')]||{};}module[_0x81bc('0x6')]=VtigerAccount;
\ No newline at end of file
index a3dde52..69effd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd8b=['username','password','token','remoteUri','authType','type','serverUrl','Configurations','exports','name'];(function(_0x5e8829,_0x2cc8f5){var _0xb40daa=function(_0x280100){while(--_0x280100){_0x5e8829['push'](_0x5e8829['shift']());}};_0xb40daa(++_0x2cc8f5);}(_0xfd8b,0x10d));var _0xbfd8=function(_0x36ccf0,_0x3fa6a6){_0x36ccf0=_0x36ccf0-0x0;var _0x416aed=_0xfd8b[_0x36ccf0];return _0x416aed;};'use strict';function ZendeskAccount(_0xf55c01){this['id']=_0xf55c01['id']||0x0;this[_0xbfd8('0x0')]=_0xf55c01[_0xbfd8('0x0')]||'';this[_0xbfd8('0x1')]=_0xf55c01['username']||'';this[_0xbfd8('0x2')]=_0xf55c01['password']||'';this['token']=_0xf55c01[_0xbfd8('0x3')]||'';this['remoteUri']=_0xf55c01[_0xbfd8('0x4')]||'';this['authType']=_0xf55c01[_0xbfd8('0x5')]||'';this[_0xbfd8('0x6')]=_0xf55c01[_0xbfd8('0x6')]||'integrationTab';this[_0xbfd8('0x7')]=_0xf55c01['serverUrl']||'';this[_0xbfd8('0x8')]=_0xf55c01[_0xbfd8('0x8')]||{};}module[_0xbfd8('0x9')]=ZendeskAccount;
\ No newline at end of file
+var _0xaaea=['type','integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri','authType'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xaaea,0x1d0));var _0xaaae=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xaaea[_0x126558];return _0x1f6d14;};'use strict';function ZendeskAccount(_0x76a432){this['id']=_0x76a432['id']||0x0;this['name']=_0x76a432[_0xaaae('0x0')]||'';this[_0xaaae('0x1')]=_0x76a432['username']||'';this[_0xaaae('0x2')]=_0x76a432['password']||'';this[_0xaaae('0x3')]=_0x76a432['token']||'';this[_0xaaae('0x4')]=_0x76a432[_0xaaae('0x4')]||'';this[_0xaaae('0x5')]=_0x76a432[_0xaaae('0x5')]||'';this[_0xaaae('0x6')]=_0x76a432['type']||_0xaaae('0x7');this[_0xaaae('0x8')]=_0x76a432[_0xaaae('0x8')]||'';this[_0xaaae('0x9')]=_0x76a432[_0xaaae('0x9')]||{};}module['exports']=ZendeskAccount;
\ No newline at end of file
index bb567a9..b3c2b32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8de9=['name','description','host','zone','clientId','clientSecret','code','refreshToken','Configurations','exports'];(function(_0x5ba837,_0x371cb7){var _0x25221c=function(_0x50b260){while(--_0x50b260){_0x5ba837['push'](_0x5ba837['shift']());}};_0x25221c(++_0x371cb7);}(_0x8de9,0x1c2));var _0x98de=function(_0x1d4aa7,_0x5909b0){_0x1d4aa7=_0x1d4aa7-0x0;var _0x446c98=_0x8de9[_0x1d4aa7];return _0x446c98;};'use strict';function ZohoAccount(_0x57d69d){this['id']=_0x57d69d['id']||0x0;this['name']=_0x57d69d[_0x98de('0x0')]||'';this[_0x98de('0x1')]=_0x57d69d['description']||'';this[_0x98de('0x2')]=_0x57d69d['host']||'';this[_0x98de('0x3')]=_0x57d69d[_0x98de('0x3')]||'';this[_0x98de('0x4')]=_0x57d69d[_0x98de('0x4')]||'';this[_0x98de('0x5')]=_0x57d69d[_0x98de('0x5')]||'';this['serverUrl']=_0x57d69d['serverUrl']||'';this[_0x98de('0x6')]=_0x57d69d[_0x98de('0x6')]||'';this[_0x98de('0x7')]=_0x57d69d[_0x98de('0x7')]||'';this[_0x98de('0x8')]=_0x57d69d[_0x98de('0x8')]||{};}module[_0x98de('0x9')]=ZohoAccount;
\ No newline at end of file
+var _0xc97e=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','host','zone'];(function(_0x5121bd,_0x594f87){var _0x49bfdd=function(_0x36036c){while(--_0x36036c){_0x5121bd['push'](_0x5121bd['shift']());}};_0x49bfdd(++_0x594f87);}(_0xc97e,0x6a));var _0xec97=function(_0x1e1e9f,_0x3b01bc){_0x1e1e9f=_0x1e1e9f-0x0;var _0x58d02d=_0xc97e[_0x1e1e9f];return _0x58d02d;};'use strict';function ZohoAccount(_0x50edd7){this['id']=_0x50edd7['id']||0x0;this['name']=_0x50edd7['name']||'';this['description']=_0x50edd7['description']||'';this[_0xec97('0x0')]=_0x50edd7['host']||'';this[_0xec97('0x1')]=_0x50edd7['zone']||'';this[_0xec97('0x2')]=_0x50edd7[_0xec97('0x2')]||'';this[_0xec97('0x3')]=_0x50edd7[_0xec97('0x3')]||'';this[_0xec97('0x4')]=_0x50edd7['serverUrl']||'';this[_0xec97('0x5')]=_0x50edd7['code']||'';this['refreshToken']=_0x50edd7[_0xec97('0x6')]||'';this[_0xec97('0x7')]=_0x50edd7[_0xec97('0x7')]||{};}module[_0xec97('0x8')]=ZohoAccount;
\ No newline at end of file
index c1982b8..e8d2291 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36ee=['callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','exports','moment','isNil','string','idContact','name','type','queue','membername','Agent','channelAgent','format','calleridname','Contact','phone','firstName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xe36e('0x0'));function checkNameSurname(_0x521ff3,_0xf6b517,_0x4018bf){var _0x36c9f6='';if(!_[_0xe36e('0x1')](_0xf6b517)&&_0xe36e('0x2')===typeof _0xf6b517){_0x36c9f6+=_0xf6b517;}if(!_[_0xe36e('0x1')](_0x4018bf)&&_0xe36e('0x2')===typeof _0x4018bf){_0x36c9f6+='\x20'+_0x4018bf;}if(_0x36c9f6!==''){return _0x36c9f6;}return _0x521ff3;}function Action(_0x3f29e1,_0x25a07d,_0x190404,_0x21be0b,_0x1aa596){this['uniqueid']=_0x190404||undefined;this[_0xe36e('0x3')]=_0x3f29e1['id'];this['queue']=_0x25a07d[_0xe36e('0x4')];this[_0xe36e('0x5')]=_0x25a07d[_0xe36e('0x5')];this['campaigntype']=_0xe36e('0x6');this['dialAnswer']=![];this[_0xe36e('0x7')]=_[_0xe36e('0x1')](_0x3f29e1[_0xe36e('0x8')])?undefined:_0x3f29e1[_0xe36e('0x8')][_0xe36e('0x4')];this[_0xe36e('0x9')]=this[_0xe36e('0x7')]?util[_0xe36e('0xa')]('SIP/%s',this[_0xe36e('0x7')]):_0x21be0b||undefined;this[_0xe36e('0xb')]=checkNameSurname(_0x3f29e1[_0xe36e('0xc')][_0xe36e('0xd')],_0x3f29e1['Contact'][_0xe36e('0xe')],_0x3f29e1['Contact']['lastName']);this[_0xe36e('0xf')]=_0x3f29e1[_0xe36e('0xf')]||![];this[_0xe36e('0x10')]=_0x3f29e1[_0xe36e('0xd')];this[_0xe36e('0x11')]=_0x3f29e1[_0xe36e('0x11')];this[_0xe36e('0x12')]=_0x3f29e1[_0xe36e('0x12')]||0x0;this[_0xe36e('0x13')]=_0x3f29e1[_0xe36e('0x13')]||0x0;this['countnoanswerretry']=_0x3f29e1[_0xe36e('0x14')]||0x0;this[_0xe36e('0x15')]=(_0x3f29e1['countbusyretry']||0x0)+(_0x3f29e1[_0xe36e('0x13')]||0x0)+(_0x3f29e1['countnoanswerretry']||0x0)+(_0x3f29e1[_0xe36e('0x16')]||0x0)+(_0x3f29e1[_0xe36e('0x17')]||0x0)+(_0x3f29e1['countabandonedretry']||0x0)+(_0x3f29e1[_0xe36e('0x18')]||0x0)+(_0x3f29e1[_0xe36e('0x19')]||0x0);this[_0xe36e('0x16')]=_0x3f29e1['countnosuchnumberretry']||0x0;this[_0xe36e('0x17')]=_0x3f29e1[_0xe36e('0x17')]||0x0;this[_0xe36e('0x1a')]=_0x3f29e1[_0xe36e('0x1a')]||0x0;this[_0xe36e('0x18')]=_0x3f29e1[_0xe36e('0x18')]||0x0;this['countagentrejectretry']=_0x3f29e1[_0xe36e('0x19')]||0x0;this[_0xe36e('0x1b')]=_0x3f29e1[_0xe36e('0x1b')];this[_0xe36e('0x1c')]=_0x3f29e1[_0xe36e('0x1c')];this['callbackat']=_0x3f29e1['callbackat'];this[_0xe36e('0x1d')]=_0x3f29e1[_0xe36e('0x1d')];this[_0xe36e('0x1e')]=_0x3f29e1[_0xe36e('0x1e')];this[_0xe36e('0x1f')]=_0x3f29e1[_0xe36e('0x1f')];this[_0xe36e('0x20')]=_['isNil'](_0x3f29e1[_0xe36e('0x8')])?_0x3f29e1[_0xe36e('0x20')]:_0x3f29e1[_0xe36e('0x8')]['id'];this[_0xe36e('0x21')]=_0x3f29e1['VoiceQueueId'];this[_0xe36e('0x22')]='';this['originatecalleridname']='';}Action[_0xe36e('0x23')]['getCaller']=function(){return util[_0xe36e('0xa')]('\x22%s\x22\x20<%s>',this[_0xe36e('0xb')],this['number']);};module[_0xe36e('0x24')]=Action;
\ No newline at end of file
+var _0x8aad=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','number','exports','util','lodash','isNil','uniqueid','idContact','queue','name','campaigntype','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x1bf6df,_0x55b9bd){var _0x20b0fc=function(_0x134927){while(--_0x134927){_0x1bf6df['push'](_0x1bf6df['shift']());}};_0x20b0fc(++_0x55b9bd);}(_0x8aad,0x146));var _0xd8aa=function(_0x44931f,_0x5d2085){_0x44931f=_0x44931f-0x0;var _0x556418=_0x8aad[_0x44931f];return _0x556418;};'use strict';var util=require(_0xd8aa('0x0'));var _=require(_0xd8aa('0x1'));var moment=require('moment');function checkNameSurname(_0x11554c,_0x5bcfd1,_0x276f03){var _0xb610c0='';if(!_['isNil'](_0x5bcfd1)&&'string'===typeof _0x5bcfd1){_0xb610c0+=_0x5bcfd1;}if(!_[_0xd8aa('0x2')](_0x276f03)&&'string'===typeof _0x276f03){_0xb610c0+='\x20'+_0x276f03;}if(_0xb610c0!==''){return _0xb610c0;}return _0x11554c;}function Action(_0x53248c,_0x16b648,_0x43ddeb,_0x16ea12,_0x4a4b10){this[_0xd8aa('0x3')]=_0x43ddeb||undefined;this[_0xd8aa('0x4')]=_0x53248c['id'];this[_0xd8aa('0x5')]=_0x16b648[_0xd8aa('0x6')];this['type']=_0x16b648['type'];this[_0xd8aa('0x7')]=_0xd8aa('0x5');this[_0xd8aa('0x8')]=![];this[_0xd8aa('0x9')]=_[_0xd8aa('0x2')](_0x53248c['Agent'])?undefined:_0x53248c[_0xd8aa('0xa')][_0xd8aa('0x6')];this[_0xd8aa('0xb')]=this[_0xd8aa('0x9')]?util[_0xd8aa('0xc')](_0xd8aa('0xd'),this[_0xd8aa('0x9')]):_0x16ea12||undefined;this[_0xd8aa('0xe')]=checkNameSurname(_0x53248c[_0xd8aa('0xf')][_0xd8aa('0x10')],_0x53248c['Contact']['firstName'],_0x53248c[_0xd8aa('0xf')][_0xd8aa('0x11')]);this[_0xd8aa('0x12')]=_0x53248c['active']||![];this[_0xd8aa('0x13')]=_0x53248c[_0xd8aa('0x10')];this[_0xd8aa('0x14')]=_0x53248c[_0xd8aa('0x14')];this['countbusyretry']=_0x53248c[_0xd8aa('0x15')]||0x0;this[_0xd8aa('0x16')]=_0x53248c['countcongestionretry']||0x0;this[_0xd8aa('0x17')]=_0x53248c[_0xd8aa('0x17')]||0x0;this[_0xd8aa('0x18')]=(_0x53248c[_0xd8aa('0x15')]||0x0)+(_0x53248c[_0xd8aa('0x16')]||0x0)+(_0x53248c['countnoanswerretry']||0x0)+(_0x53248c[_0xd8aa('0x19')]||0x0)+(_0x53248c[_0xd8aa('0x1a')]||0x0)+(_0x53248c[_0xd8aa('0x1b')]||0x0)+(_0x53248c[_0xd8aa('0x1c')]||0x0)+(_0x53248c['countagentrejectretry']||0x0);this[_0xd8aa('0x19')]=_0x53248c[_0xd8aa('0x19')]||0x0;this[_0xd8aa('0x1a')]=_0x53248c[_0xd8aa('0x1a')]||0x0;this[_0xd8aa('0x1b')]=_0x53248c['countabandonedretry']||0x0;this[_0xd8aa('0x1c')]=_0x53248c[_0xd8aa('0x1c')]||0x0;this[_0xd8aa('0x1d')]=_0x53248c['countagentrejectretry']||0x0;this[_0xd8aa('0x1e')]=_0x53248c[_0xd8aa('0x1e')];this[_0xd8aa('0x1f')]=_0x53248c[_0xd8aa('0x1f')];this[_0xd8aa('0x20')]=_0x53248c[_0xd8aa('0x20')];this[_0xd8aa('0x21')]=_0x53248c[_0xd8aa('0x21')];this[_0xd8aa('0x22')]=_0x53248c[_0xd8aa('0x22')];this[_0xd8aa('0x23')]=_0x53248c[_0xd8aa('0x23')];this[_0xd8aa('0x24')]=_['isNil'](_0x53248c[_0xd8aa('0xa')])?_0x53248c[_0xd8aa('0x24')]:_0x53248c[_0xd8aa('0xa')]['id'];this[_0xd8aa('0x25')]=_0x53248c[_0xd8aa('0x25')];this[_0xd8aa('0x26')]='';this[_0xd8aa('0x27')]='';}Action[_0xd8aa('0x28')][_0xd8aa('0x29')]=function(){return util[_0xd8aa('0xc')]('\x22%s\x22\x20<%s>',this[_0xd8aa('0xe')],this[_0xd8aa('0x2a')]);};module[_0xd8aa('0x2b')]=Action;
\ No newline at end of file
index 8d28960..771ba8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe015=['blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','type','outbound','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','talking','total','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','available','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','dialMethod','booked','clearZombieChannels','hasOwnProperty','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','enqueue','info','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','loggerError','[action]','size','getContactRecallMe','agentReadyId','then','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','YYYY-MM-DD\x20HH:mm:ss','logCustomer','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','NoSuchNumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','swapAdditionalPhones','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','buildObj','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','totalGlobal','Answer','[callProgressDetectingCustomer][logAnswer]','talktime','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','additional','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','unlockAgent','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','originated:\x20','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','checkInBlack','isNil','Contact','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','phone','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdName','originatecalleridname','extractCalleridName','originatecalleridnum','addVariables','merge','toLowerVariables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','channel','lookAgent','logLookAgent','clone','isFailure','response','starttime','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','statedesc','channelstate','transfer','callProgressDetectingAgent','syncDialEnd','destuniqueid','addVariable','variables','filterKey','keys','variable','value','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','bluebird','md5','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','sequence','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','syncHangup','bind','syncHangupRequest','dialend','syncNewExten','syncVarSet','syncAttendedTransfer'];(function(_0x5d115e,_0x35ce96){var _0x420939=function(_0x597832){while(--_0x597832){_0x5d115e['push'](_0x5d115e['shift']());}};_0x420939(++_0x35ce96);}(_0xe015,0x13b));var _0x5e01=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xe015[_0x2be8c2];return _0x97f531;};'use strict';var util=require(_0x5e01('0x0'));var _=require(_0x5e01('0x1'));var BPromise=require(_0x5e01('0x2'));var uuid=require('uuid');var moment=require('moment');var md5=require(_0x5e01('0x3'));var Redis=require('ioredis');var config=require(_0x5e01('0x4'));var logger=require(_0x5e01('0x5'))(_0x5e01('0x6'));var loggerAction=require(_0x5e01('0x5'))('actionPreview');var ami=require(_0x5e01('0x7'));var rpcDb=require(_0x5e01('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require('./action');var ut=require(_0x5e01('0x9'));config[_0x5e01('0xa')]=_[_0x5e01('0xb')](config[_0x5e01('0xa')],{'host':_0x5e01('0xc'),'port':0x18eb});var io=require(_0x5e01('0xd'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x5e01('0xe')]['enqueue']=function(_0x3859e8){this['tail']=this[_0x5e01('0xf')]?this[_0x5e01('0xf')]['finally'](_0x3859e8):_0x3859e8();};function Preview(_0x19bc01){this[_0x5e01('0x10')]=new Sequence();this['campaignsPreview']=_0x19bc01['voiceQueues'];this[_0x5e01('0x11')]=_0x19bc01[_0x5e01('0x11')];this[_0x5e01('0x12')]={};this[_0x5e01('0x13')]=_0x19bc01[_0x5e01('0x13')];this[_0x5e01('0x14')]=0x0;ami['on']('originateresponse',this[_0x5e01('0x15')]['bind'](this));ami['on']('hangup',this[_0x5e01('0x16')][_0x5e01('0x17')](this));ami['on']('hanguprequest',this[_0x5e01('0x18')]['bind'](this));ami['on'](_0x5e01('0x19'),this['syncDialEnd'][_0x5e01('0x17')](this));ami['on']('newexten',this[_0x5e01('0x1a')]['bind'](this));ami['on']('varset',this[_0x5e01('0x1b')][_0x5e01('0x17')](this));ami['on']('attendedtransfer',this[_0x5e01('0x1c')][_0x5e01('0x17')](this));ami['on'](_0x5e01('0x1d'),this[_0x5e01('0x1e')][_0x5e01('0x17')](this));this[_0x5e01('0x1f')](this[_0x5e01('0x20')]);}function emit(_0x153eb1,_0x5f04f1,_0x150ebf){io['to'](_0x153eb1)[_0x5e01('0x21')](_0x5f04f1,_0x150ebf);}function emitCampaignPreview(_0x4b28ca){if(_0x4b28ca[_0x5e01('0x22')]===_0x5e01('0x23')){var _0x337ad2={'id':_0x4b28ca['id'],'name':_0x4b28ca[_0x5e01('0x24')],'strategy':_0x4b28ca[_0x5e01('0x25')],'answered':_0x4b28ca[_0x5e01('0x26')],'available':_0x4b28ca['available'],'loggedIn':_0x4b28ca[_0x5e01('0x27')],'pTalking':_0x4b28ca[_0x5e01('0x28')],'sumBillable':_0x4b28ca[_0x5e01('0x29')],'sumDuration':_0x4b28ca[_0x5e01('0x2a')],'sumHoldTime':_0x4b28ca['sumHoldTime']||0x0,'talking':_0x4b28ca[_0x5e01('0x2b')],'total':_0x4b28ca[_0x5e01('0x2c')],'type':_0x4b28ca[_0x5e01('0x22')],'unmanaged':_0x4b28ca['unmanaged'],'abandoned':_0x4b28ca[_0x5e01('0x2d')],'waiting':_0x4b28ca[_0x5e01('0x2e')],'loggedInDb':_0x4b28ca[_0x5e01('0x2f')],'dialActive':_0x4b28ca[_0x5e01('0x30')],'dialMethod':_0x4b28ca['dialMethod'],'dialOriginateCallerIdName':_0x4b28ca['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x4b28ca[_0x5e01('0x31')],'dialOriginateTimeout':_0x4b28ca['dialOriginateTimeout'],'dialPrefix':_0x4b28ca[_0x5e01('0x32')],'outboundAnswerAgiCallsDay':_0x4b28ca[_0x5e01('0x33')],'outboundAnswerCallsDay':_0x4b28ca[_0x5e01('0x34')],'outboundBlacklistCallsDay':_0x4b28ca[_0x5e01('0x35')],'outboundBusyCallsDay':_0x4b28ca['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x4b28ca['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x4b28ca['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x4b28ca['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x4b28ca[_0x5e01('0x36')],'outboundNoAnswerCallsDay':_0x4b28ca['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x4b28ca[_0x5e01('0x37')],'outboundOriginateFailureCallsDay':_0x4b28ca[_0x5e01('0x38')],'outboundReCallsDay':_0x4b28ca[_0x5e01('0x39')],'outboundRejectCallsDay':_0x4b28ca['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x4b28ca[_0x5e01('0x3a')],'outboundAbandonedCallsDay':_0x4b28ca[_0x5e01('0x3b')],'predictiveIntervalAnsweredCalls':_0x4b28ca[_0x5e01('0x3c')],'predictiveIntervalAvgHoldtime':_0x4b28ca[_0x5e01('0x3d')],'predictiveIntervalAvgTalktime':_0x4b28ca['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x4b28ca['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x4b28ca[_0x5e01('0x3e')],'predictiveIntervalErlangCalls':_0x4b28ca[_0x5e01('0x3f')],'predictiveIntervalErlangCallsDroppedCalls':_0x4b28ca[_0x5e01('0x40')],'predictiveIntervalHitRate':_0x4b28ca[_0x5e01('0x41')],'predictiveIntervalMultiplicativeFactor':_0x4b28ca[_0x5e01('0x42')],'predictiveIntervalPauses':_0x4b28ca[_0x5e01('0x43')],'predictiveIntervalAvailable':_0x4b28ca[_0x5e01('0x44')],'predictiveIntervalTotalCalls':_0x4b28ca[_0x5e01('0x45')],'message':_0x4b28ca[_0x5e01('0x46')],'originated':_0x4b28ca[_0x5e01('0x47')],'erlangCalls':_0x4b28ca[_0x5e01('0x48')],'erlangCallToSecond':_0x4b28ca[_0x5e01('0x49')],'erlangAbandonmentRate':_0x4b28ca['erlangAbandonmentRate'],'erlangBusyFactor':_0x4b28ca[_0x5e01('0x4a')],'startPredictive':_0x4b28ca[_0x5e01('0x4b')],'startProgressive':_0x4b28ca[_0x5e01('0x4c')]};if(_0x4b28ca['Trunk']){_0x337ad2[_0x5e01('0x4d')]={'id':_0x4b28ca[_0x5e01('0x4d')]['id'],'name':_0x4b28ca['Trunk'][_0x5e01('0x24')],'active':_0x4b28ca[_0x5e01('0x4d')][_0x5e01('0x4e')],'callerid':_0x4b28ca['Trunk'][_0x5e01('0x4f')]};}if(_0x4b28ca[_0x5e01('0x50')]){_0x337ad2[_0x5e01('0x50')]={'id':_0x4b28ca[_0x5e01('0x50')]['id'],'name':_0x4b28ca[_0x5e01('0x50')][_0x5e01('0x24')]};}var _0x1952fb=md5(JSON[_0x5e01('0x51')](_0x337ad2));if(_0x4b28ca[_0x5e01('0x3')]!==_0x1952fb){_0x4b28ca[_0x5e01('0x3')]=_0x1952fb;emit(util[_0x5e01('0x52')](_0x5e01('0x53'),_0x337ad2[_0x5e01('0x24')]),_0x5e01('0x54'),_0x337ad2);}}}function emitVoiceQueueChannelRemove(_0x260901){logger['info'](_0x5e01('0x55'),JSON['stringify'](_0x260901));emit(util['format'](_0x5e01('0x53'),_0x260901[_0x5e01('0x24')]),_0x5e01('0x56'),_0x260901);io[_0x5e01('0x21')](_0x5e01('0x57'),_0x260901);}function notSendMessagesQueue(_0x4b8523){if(_0x4b8523[_0x5e01('0x58')]){if(_0x4b8523[_0x5e01('0x47')]===0x0&&_0x4b8523['pTalking']===0x0){_0x4b8523[_0x5e01('0x58')]=![];_0x4b8523[_0x5e01('0x59')]=0x0;_0x4b8523[_0x5e01('0x5a')]=0x0;_0x4b8523['message']=_0x5e01('0x5b');ut[_0x5e01('0x5c')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x4b8523[_0x5e01('0x24')]+_0x5e01('0x5d'));}else{_0x4b8523['message']='DEACTIVATED';ut[_0x5e01('0x5c')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x4b8523[_0x5e01('0x24')]+_0x5e01('0x5e'));}emitCampaignPreview(_0x4b8523);}}Preview[_0x5e01('0xe')][_0x5e01('0x1f')]=function(){var _0x5c471d=this;setInterval(function(){_0x5c471d[_0x5e01('0x5f')]();},0x7cf);};Preview[_0x5e01('0xe')][_0x5e01('0x5f')]=function(){var _0x44a5e4=this[_0x5e01('0x20')];this[_0x5e01('0x14')]+=0x1;for(var _0x3e6c8c in _0x44a5e4){if(_0x44a5e4['hasOwnProperty'](_0x3e6c8c)&&(_0x44a5e4[_0x3e6c8c][_0x5e01('0x60')]===_0x5e01('0x6')||_0x44a5e4[_0x3e6c8c][_0x5e01('0x60')]===_0x5e01('0x61'))&&_0x44a5e4[_0x3e6c8c][_0x5e01('0x22')]==='outbound'){if(this[_0x5e01('0x14')]>0x7){this[_0x5e01('0x14')]=0x0;this[_0x5e01('0x62')]();}}if(_0x44a5e4[_0x5e01('0x63')](_0x3e6c8c)&&_0x44a5e4[_0x3e6c8c][_0x5e01('0x60')]===_0x5e01('0x6')&&_0x44a5e4[_0x3e6c8c][_0x5e01('0x22')]==='outbound'){if(_0x44a5e4[_0x3e6c8c][_0x5e01('0x30')]){this['setMessage'](_0x44a5e4[_0x3e6c8c]);if(_0x44a5e4[_0x3e6c8c][_0x5e01('0x64')])this[_0x5e01('0x65')](_0x44a5e4[_0x3e6c8c]);}else{notSendMessagesQueue(_0x44a5e4[_0x3e6c8c]);}}}};Preview[_0x5e01('0xe')][_0x5e01('0x66')]=function(_0xf50000){var _0x3e4dd6=this;this['sequence'][_0x5e01('0x67')](function(){if(!_['isNil'](_0x3e4dd6[_0x5e01('0x12')][_0xf50000])){loggerAction[_0x5e01('0x68')](_0x5e01('0x69'),_0xf50000,_0x5e01('0x6a'),_0x3e4dd6[_0x5e01('0x12')][_0xf50000][_0x5e01('0x6b')],'originated:\x20',JSON['stringify'](_0x3e4dd6[_0x5e01('0x20')][_0x3e4dd6[_0x5e01('0x12')][_0xf50000][_0x5e01('0x6b')]][_0x5e01('0x47')]),_0x5e01('0x6c'),JSON[_0x5e01('0x51')](_0x3e4dd6[_0x5e01('0x20')][_0x3e4dd6[_0x5e01('0x12')][_0xf50000][_0x5e01('0x6b')]][_0x5e01('0x28')]),JSON[_0x5e01('0x51')](_0x3e4dd6['actions'][_0xf50000][_0x5e01('0x6d')]),JSON[_0x5e01('0x51')](_[_0x5e01('0x6e')](_0x3e4dd6['actions'][_0xf50000],[_0x5e01('0x6f'),_0x5e01('0x70'),_0x5e01('0x71'),_0x5e01('0x72')])));return ami[_0x5e01('0x73')]({'action':'status','channel':_0x3e4dd6[_0x5e01('0x12')][_0xf50000]['channel']})[_0x5e01('0x74')](function(_0x13c787){if(_0x13c787[_0x5e01('0x46')]===_0x5e01('0x75')){setTimeout(function(){if(_0x3e4dd6[_0x5e01('0x12')][_0xf50000]){ut[_0x5e01('0x76')](_0x3e4dd6[_0x5e01('0x20')][_0x3e4dd6[_0x5e01('0x12')][_0xf50000][_0x5e01('0x6b')]],'[clearZombieChannel]');if(_0x3e4dd6[_0x5e01('0x12')][_0xf50000][_0x5e01('0x6d')]===!![]){ut[_0x5e01('0x77')](_0x3e4dd6[_0x5e01('0x20')][_0x3e4dd6[_0x5e01('0x12')][_0xf50000][_0x5e01('0x6b')]],'[clearZombieChannel]');ut[_0x5e01('0x78')]('[Dialer][checkChannel][pTalking][Preview]'+_0xf50000,_0x3e4dd6[_0x5e01('0x12')][_0xf50000][_0x5e01('0x6b')]);}ut[_0x5e01('0x78')]('[Dialer][checkChannel][Preview]'+_0xf50000,_0x3e4dd6[_0x5e01('0x12')][_0xf50000][_0x5e01('0x6b')]);delete _0x3e4dd6['actions'][_0xf50000];}},0x2328);}});}});};Preview[_0x5e01('0xe')]['clearZombieChannels']=function(){var _0x6180c9=this;loggerAction[_0x5e01('0x68')](_0x5e01('0x79'),_[_0x5e01('0x7a')](this['actions']));for(var _0x1d77a1 in this['actions']){if(_0x6180c9['actions'][_0x5e01('0x63')](_0x1d77a1)){_0x6180c9['clearZombieChannel'](_0x1d77a1);}}};Preview['prototype'][_0x5e01('0x65')]=function(_0x119962){var _0x1feb51=this;rpcDb[_0x5e01('0x7b')](_0x119962['id'],ut[_0x5e01('0x7c')](this[_0x5e01('0x13')]))[_0x5e01('0x7d')](function(_0x2013a8){if(!_['isNil'](_0x2013a8)){for(var _0x15c7bb=0x0;_0x15c7bb<_0x2013a8[_0x5e01('0x7e')];_0x15c7bb+=0x1){if(ut['getDiff'](_0x2013a8[_0x15c7bb][_0x5e01('0x7f')])<_0x119962[_0x5e01('0x80')]*0x3c){if(_0x2013a8[_0x15c7bb]['Agent']&&!_0x2013a8[_0x15c7bb][_0x5e01('0x81')][_0x5e01('0x82')]){_0x1feb51[_0x5e01('0x83')](_0x2013a8[_0x15c7bb]['id'])[_0x5e01('0x7d')](ut[_0x5e01('0x84')]('[RecallMe]'))[_0x5e01('0x74')](ut[_0x5e01('0x84')](_0x5e01('0x85')));}else{rpcDb['disableContact'](_0x2013a8[_0x15c7bb]['id']);}}else{var _0x45a7d4=new Action(_0x2013a8[_0x15c7bb],_0x119962);_0x45a7d4['starttime']=moment()[_0x5e01('0x52')](_0x5e01('0x86'));_0x119962[_0x5e01('0x39')]+=0x1;ut[_0x5e01('0x87')](_0x45a7d4,0x17,'RecallInQueue');if(_0x119962['dialRecallInQueue']){rpcDb[_0x5e01('0x88')](ut[_0x5e01('0x89')](_0x2013a8[_0x15c7bb]));rpcDb['createCustomerHistory'](_0x45a7d4,_0x5e01('0x8a'));}else{ut[_0x5e01('0x87')](_0x45a7d4,0x16,'RecallFailedTimeout');rpcDb[_0x5e01('0x8b')](_0x45a7d4,_0x5e01('0x8c'));rpcDb[_0x5e01('0x8d')](_0x45a7d4,_0x5e01('0x8c'));}}}}})[_0x5e01('0x74')](ut['logger2']('[getContactRecallMe]'));};Preview[_0x5e01('0xe')][_0x5e01('0x8e')]=function(_0x45ddb8){_0x45ddb8['sendMessageOneNotActive']=!![];if(ut[_0x5e01('0x8f')](_0x45ddb8['loggedIn'])){_0x45ddb8[_0x5e01('0x46')]=_0x5e01('0x90');}else if(!ut[_0x5e01('0x91')](_0x45ddb8[_0x5e01('0x30')])){_0x45ddb8['message']=_0x5e01('0x5b');}else if(!this[_0x5e01('0x92')](_0x45ddb8[_0x5e01('0x4d')])){if(!this['isTrunkReachable'](_0x45ddb8['TrunkBackup'])){_0x45ddb8[_0x5e01('0x46')]=_0x5e01('0x93');}else{_0x45ddb8['message']=_0x5e01('0x94');}}else{_0x45ddb8['message']=_0x5e01('0x94');}emitCampaignPreview(_0x45ddb8);};Preview[_0x5e01('0xe')][_0x5e01('0x95')]=function(_0x483874,_0x439ffb,_0x1260b3){var _0x3c7d89=this;var _0x482dbc=this[_0x5e01('0x12')][_0x439ffb];var _0x2b21c2=this[_0x5e01('0x20')][_0x482dbc['queue']];var _0x4d436c;var _0x4030f8=![];var _0x487795=0x2;var _0x11555b=0x3;if(_0x2b21c2){switch(_0x1260b3){case'1':_0x2b21c2[_0x5e01('0x37')]+=0x1;_0x482dbc[_0x5e01('0x96')]+=0x1;_0x482dbc[_0x5e01('0x97')]=ut['totalGlobal'](_0x482dbc);ut['logCustomer'](_0x482dbc,0x0,_0x5e01('0x98'));ami['emit']('custom:agentnosuchnumber',ut['buildObj'](_0x482dbc,_0x5e01('0x99')));rpcDb[_0x5e01('0x8b')](_0x482dbc,_0x5e01('0x9a'));_0x3c7d89[_0x5e01('0x9b')](_0x482dbc,'0',_0x2b21c2)[_0x5e01('0x7d')](function(_0x54b72e){_0x4030f8=_0x54b72e['additional']==0x1;_0x487795=_0x2b21c2[_0x5e01('0x9c')];_0x11555b=_0x2b21c2[_0x5e01('0x9d')];if(!_0x4030f8){if(ut['totalGlobal'](_0x482dbc)>=_0x2b21c2[_0x5e01('0x9e')]){_0x4d436c=ut[_0x5e01('0x9f')](_0x482dbc,0xf,_0x5e01('0xa0'));rpcDb[_0x5e01('0x8d')](_0x4d436c,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x482dbc['countnosuchnumberretry']>=_0x2b21c2[_0x5e01('0xa1')]){rpcDb[_0x5e01('0x8d')](_0x482dbc,_0x5e01('0xa2'));}else{rpcDb[_0x5e01('0xa3')](ut[_0x5e01('0xa4')](_0x482dbc,'countnosuchnumberretry',_0x2b21c2[_0x5e01('0x9c')]),_0x482dbc['unlockAgent'],_0x482dbc[_0x5e01('0xa5')]);}}delete this['actions'][_0x483874[_0x5e01('0xa6')]];}else{_0x482dbc[_0x5e01('0x96')]++;logger[_0x5e01('0x68')](_0x5e01('0xa7'),_0x482dbc[_0x5e01('0x96')]);logger['info']('id',_0x482dbc[_0x5e01('0xa8')]);_0x3c7d89[_0x5e01('0xa9')]({'id':_0x482dbc[_0x5e01('0xa8')],'field':{'countnosuchnumberretry':_0x482dbc[_0x5e01('0x96')]}})[_0x5e01('0x7d')](function(){_0x3c7d89[_0x5e01('0xaa')](_0x482dbc,_0x487795,_0x11555b)[_0x5e01('0x7d')](function(){});});}});break;case'ANSWER':var _0x57a8e3=moment()[_0x5e01('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x482dbc[_0x5e01('0xab')]=_0x57a8e3;_0x482dbc[_0x5e01('0xac')]=_0x57a8e3;_0x482dbc[_0x5e01('0x6d')]=!![];_0x2b21c2[_0x5e01('0x28')]+=0x1;logger['info'](_0x5e01('0xad'),_0x482dbc[_0x5e01('0xae')],_0x5e01('0xaf'),_0x2b21c2[_0x5e01('0x24')],_0x5e01('0x6c'),_0x2b21c2[_0x5e01('0x28')]);ami[_0x5e01('0x21')](_0x5e01('0xb0'),ut[_0x5e01('0xb1')](_0x482dbc,'connect',this[_0x5e01('0x20')][_0x482dbc[_0x5e01('0x6b')]]));if(_0x2b21c2[_0x5e01('0xb2')]){ami['emit'](_0x5e01('0xb3'),ut[_0x5e01('0xb4')](_0x482dbc));}break;case'16':ami[_0x5e01('0x21')](_0x5e01('0xb5'),ut[_0x5e01('0xb1')](_0x482dbc,'complete',this['campaignsPreview'][_0x482dbc[_0x5e01('0x6b')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x482dbc,_0x5e01('0xb6')));_0x2b21c2['outboundAnswerCallsDay']+=0x1;_0x2b21c2[_0x5e01('0x2c')]+=0x1;_0x2b21c2[_0x5e01('0x26')]+=0x1;ut['decrementTalkink'](_0x2b21c2,_0x5e01('0xb7'));_0x482dbc['countglobal']=ut[_0x5e01('0xb8')](_0x482dbc);ut[_0x5e01('0x87')](_0x482dbc,0x4,_0x5e01('0xb9'));rpcDb[_0x5e01('0x8b')](_0x482dbc,_0x5e01('0xba'));rpcDb['createCustomerFinal'](_0x482dbc,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x482dbc);_0x2b21c2[_0x5e01('0x2a')]+=_0x482dbc[_0x5e01('0xbb')];_0x2b21c2[_0x5e01('0x29')]+=_0x482dbc[_0x5e01('0xbb')];logger[_0x5e01('0x68')](_0x5e01('0xbc'),_0x482dbc[_0x5e01('0xae')],'\x20Queue',_0x2b21c2[_0x5e01('0x24')],_0x5e01('0x6c'),_0x2b21c2[_0x5e01('0x28')]);delete this[_0x5e01('0x12')][_0x483874[_0x5e01('0xa6')]];break;case _0x5e01('0xbd'):_0x2b21c2[_0x5e01('0xbe')]+=0x1;_0x482dbc[_0x5e01('0xbf')]+=0x1;_0x482dbc[_0x5e01('0x97')]=ut['totalGlobal'](_0x482dbc);ut[_0x5e01('0x87')](_0x482dbc,0x5,_0x5e01('0xc0'));_0x487795=_0x2b21c2[_0x5e01('0xc1')];_0x11555b=_0x2b21c2[_0x5e01('0x9d')];ami[_0x5e01('0x21')](_0x5e01('0xc2'),ut[_0x5e01('0xb1')](_0x482dbc,_0x5e01('0xc3')));rpcDb[_0x5e01('0x8b')](_0x482dbc,_0x5e01('0xc4'));_0x3c7d89[_0x5e01('0x9b')](_0x482dbc,'5',_0x2b21c2)[_0x5e01('0x7d')](function(_0x26653f){_0x4030f8=_0x26653f[_0x5e01('0xc5')]==0x1;if(!_0x4030f8){if(ut[_0x5e01('0xb8')](_0x482dbc)>=_0x2b21c2[_0x5e01('0x9e')]){_0x4d436c=ut[_0x5e01('0x9f')](_0x482dbc,0xf,'Global');rpcDb[_0x5e01('0x8d')](_0x4d436c,_0x5e01('0xc6'));}else{if(_0x482dbc[_0x5e01('0xbf')]>=_0x2b21c2[_0x5e01('0xc7')]){rpcDb['createCustomerFinal'](_0x482dbc,_0x5e01('0xc4'));}else{rpcDb[_0x5e01('0xa3')](ut[_0x5e01('0xa4')](_0x482dbc,_0x5e01('0xbf'),_0x2b21c2['dialBusyRetryFrequency']),_0x482dbc['unlockAgent'],_0x482dbc['activeContact']);}}}else{_0x482dbc[_0x5e01('0xbf')]++;_0x3c7d89[_0x5e01('0xa9')]({'id':_0x482dbc[_0x5e01('0xa8')],'field':{'countbusyretry':_0x482dbc[_0x5e01('0xbf')]}})[_0x5e01('0x7d')](function(){_0x3c7d89['swapAdditionalPhones'](_0x482dbc,_0x487795,_0x11555b)[_0x5e01('0x7d')](function(){});});}});break;case _0x5e01('0xc8'):_0x2b21c2['outboundNoAnswerCallsDay']+=0x1;_0x482dbc[_0x5e01('0xc9')]+=0x1;_0x482dbc[_0x5e01('0x97')]=ut['totalGlobal'](_0x482dbc);ut[_0x5e01('0x87')](_0x482dbc,0x3,_0x5e01('0xca'));_0x487795=_0x2b21c2['dialNoAnswerRetryFrequency'];_0x11555b=_0x2b21c2[_0x5e01('0x9d')];ami['emit'](_0x5e01('0xcb'),ut[_0x5e01('0xb1')](_0x482dbc,_0x5e01('0xcc')));rpcDb[_0x5e01('0x8b')](_0x482dbc,'[callProgressDetectingCustomer][logNoAnswer]');_0x3c7d89[_0x5e01('0x9b')](_0x482dbc,'3',_0x2b21c2)[_0x5e01('0x7d')](function(_0x19b94d){_0x4030f8=_0x19b94d[_0x5e01('0xc5')]==0x1;if(!_0x4030f8){if(ut['totalGlobal'](_0x482dbc)>=_0x2b21c2[_0x5e01('0x9e')]){_0x4d436c=ut[_0x5e01('0x9f')](_0x482dbc,0xf,_0x5e01('0xa0'));rpcDb[_0x5e01('0x8d')](_0x4d436c,_0x5e01('0xcd'));}else{if(_0x482dbc[_0x5e01('0xc9')]>=_0x2b21c2[_0x5e01('0xce')]){rpcDb[_0x5e01('0x8d')](_0x482dbc,_0x5e01('0xcf'));}else{rpcDb[_0x5e01('0xa3')](ut[_0x5e01('0xa4')](_0x482dbc,_0x5e01('0xc9'),_0x2b21c2[_0x5e01('0xd0')]),_0x482dbc['unlockAgent'],_0x482dbc[_0x5e01('0xa5')]);}}}else{_0x482dbc[_0x5e01('0xc9')]++;_0x3c7d89[_0x5e01('0xa9')]({'id':_0x482dbc[_0x5e01('0xa8')],'field':{'countnoanswerretry':_0x482dbc['countnoanswerretry']}})['then'](function(){_0x3c7d89[_0x5e01('0xaa')](_0x482dbc,_0x487795,_0x11555b)[_0x5e01('0x7d')](function(){});});}});break;case _0x5e01('0xd1'):_0x2b21c2[_0x5e01('0xd2')]+=0x1;_0x482dbc[_0x5e01('0xd3')]+=0x1;_0x482dbc[_0x5e01('0x97')]=ut['totalGlobal'](_0x482dbc);ut[_0x5e01('0x87')](_0x482dbc,0x8,_0x5e01('0xd4'));_0x487795=_0x2b21c2[_0x5e01('0xd5')];_0x11555b=_0x2b21c2[_0x5e01('0x9d')];ami[_0x5e01('0x21')]('custom:agentcongestion',ut[_0x5e01('0xb1')](_0x482dbc,'congestion'));rpcDb[_0x5e01('0x8b')](_0x482dbc,_0x5e01('0xd6'));_0x3c7d89[_0x5e01('0x9b')](_0x482dbc,'8',_0x2b21c2)['then'](function(_0x536fbb){_0x4030f8=_0x536fbb[_0x5e01('0xc5')]==0x1;if(!_0x4030f8){if(ut[_0x5e01('0xb8')](_0x482dbc)>=_0x2b21c2[_0x5e01('0x9e')]){_0x4d436c=ut[_0x5e01('0x9f')](_0x482dbc,0xf,_0x5e01('0xa0'));rpcDb['createCustomerFinal'](_0x4d436c,_0x5e01('0xd7'));}else{if(_0x482dbc[_0x5e01('0xd3')]>=_0x2b21c2[_0x5e01('0xd8')]){rpcDb['createCustomerFinal'](_0x482dbc,_0x5e01('0xd6'));}else{rpcDb['rescheduleContact'](ut[_0x5e01('0xa4')](_0x482dbc,_0x5e01('0xd3'),_0x2b21c2[_0x5e01('0xc1')]),_0x482dbc[_0x5e01('0xd9')],_0x482dbc['activeContact']);}}}else{_0x482dbc[_0x5e01('0xd3')]++;_0x3c7d89['incrementPreviewCounters']({'id':_0x482dbc[_0x5e01('0xa8')],'field':{'countcongestionretry':_0x482dbc[_0x5e01('0xd3')]}})['then'](function(){_0x3c7d89['swapAdditionalPhones'](_0x482dbc,_0x487795,_0x11555b)[_0x5e01('0x7d')](function(){});});}});break;case'CANCEL':_0x2b21c2[_0x5e01('0xda')]+=0x1;_0x482dbc[_0x5e01('0xdb')]+=0x1;_0x482dbc[_0x5e01('0x97')]=ut[_0x5e01('0xb8')](_0x482dbc);ut[_0x5e01('0x87')](_0x482dbc,0x14,_0x5e01('0xdc'));_0x487795=_0x2b21c2['dialAgentRejectRetryFrequency'];_0x11555b=_0x2b21c2[_0x5e01('0x9d')];ami[_0x5e01('0x21')](_0x5e01('0xdd'),ut[_0x5e01('0xb1')](_0x482dbc,_0x5e01('0xde')));rpcDb[_0x5e01('0x8b')](_0x482dbc,_0x5e01('0xdf'));_0x3c7d89['verifyAdditionalPhones'](_0x482dbc,'20',_0x2b21c2)['then'](function(_0x63175f){_0x4030f8=_0x63175f[_0x5e01('0xc5')]==0x1;if(!_0x4030f8){if(ut[_0x5e01('0xb8')](_0x482dbc)>=_0x2b21c2[_0x5e01('0x9e')]){_0x4d436c=ut[_0x5e01('0x9f')](_0x482dbc,0x14,_0x5e01('0xdc'));rpcDb[_0x5e01('0x8d')](_0x4d436c,_0x5e01('0xe0'));}else{if(_0x482dbc[_0x5e01('0xdb')]>=_0x2b21c2[_0x5e01('0xe1')]){rpcDb[_0x5e01('0x8d')](_0x482dbc,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut[_0x5e01('0xa4')](_0x482dbc,_0x5e01('0xdb'),_0x2b21c2[_0x5e01('0xe2')]),_0x482dbc[_0x5e01('0xd9')],_0x482dbc[_0x5e01('0xa5')]);}}}else{_0x482dbc['countnoanswerretry']++;_0x3c7d89[_0x5e01('0xa9')]({'id':_0x482dbc['idContact'],'field':{'countnoanswerretry':_0x482dbc['countnoanswerretry']}})[_0x5e01('0x7d')](function(){_0x3c7d89[_0x5e01('0xaa')](_0x482dbc,_0x487795,_0x11555b)[_0x5e01('0x7d')](function(){});});}});break;case'ABANDONED':_0x2b21c2[_0x5e01('0x3b')]+=0x1;_0x482dbc[_0x5e01('0xe3')]+=0x1;_0x482dbc['countglobal']=ut[_0x5e01('0xb8')](_0x482dbc);ut[_0x5e01('0x87')](_0x482dbc,0xb,_0x5e01('0xe4'));rpcDb['createCustomerHistory'](_0x482dbc,_0x5e01('0xe5'));_0x3c7d89[_0x5e01('0x9b')](_0x482dbc,'11',_0x2b21c2)[_0x5e01('0x7d')](function(_0x4bc324){_0x4030f8=_0x4bc324[_0x5e01('0xc5')]==0x1;if(!_0x4030f8){if(ut['totalGlobal'](_0x482dbc)>=_0x2b21c2[_0x5e01('0x9e')]){_0x4d436c=ut[_0x5e01('0x9f')](_0x482dbc,0xf,_0x5e01('0xa0'));rpcDb[_0x5e01('0x8d')](_0x4d436c,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x482dbc[_0x5e01('0xe6')]>=_0x2b21c2[_0x5e01('0xe7')]){rpcDb[_0x5e01('0x8d')](_0x482dbc,_0x5e01('0xe5'));}else{rpcDb[_0x5e01('0xa3')](ut[_0x5e01('0xa4')](_0x482dbc,_0x5e01('0xe3'),_0x2b21c2[_0x5e01('0xe8')]),_0x482dbc[_0x5e01('0xd9')],_0x482dbc['activeContact']);}}}else{_0x482dbc[_0x5e01('0xc9')]++;_0x3c7d89[_0x5e01('0xa9')]({'id':_0x482dbc[_0x5e01('0xa8')],'field':{'countnoanswerretry':_0x482dbc[_0x5e01('0xc9')]}})[_0x5e01('0x7d')](function(){_0x3c7d89[_0x5e01('0xaa')](_0x482dbc,_0x487795,_0x11555b)[_0x5e01('0x7d')](function(){});});}});break;case'18':_0x2b21c2['outboundUnknownCallsDay']+=0x1;_0x482dbc['countmachineretry']+=0x1;_0x482dbc[_0x5e01('0x97')]=ut['totalGlobal'](_0x482dbc);ut[_0x5e01('0x87')](_0x482dbc,0x12,_0x483874[_0x5e01('0xe9')]||_0x483874[_0x5e01('0xea')]);ami[_0x5e01('0x21')](_0x5e01('0xeb'),ut['buildObj'](_0x482dbc,_0x5e01('0xec')));rpcDb[_0x5e01('0x8b')](_0x482dbc,_0x5e01('0xed'));_0x3c7d89[_0x5e01('0x9b')](_0x482dbc,'18',_0x2b21c2)[_0x5e01('0x7d')](function(_0x35e6ed){_0x4030f8=_0x35e6ed[_0x5e01('0xc5')]==0x1;if(!_0x4030f8){if(ut[_0x5e01('0xb8')](_0x482dbc)>=_0x2b21c2[_0x5e01('0x9e')]){_0x4d436c=ut['cloneAction'](_0x482dbc,0x12,'Global');rpcDb['createCustomerFinal'](_0x4d436c,_0x5e01('0xed'));}else{rpcDb[_0x5e01('0x8d')](_0x482dbc,_0x5e01('0xed'));}}else{_0x482dbc[_0x5e01('0xc9')]++;_0x3c7d89['incrementPreviewCounters']({'id':_0x482dbc[_0x5e01('0xa8')],'field':{'countnoanswerretry':_0x482dbc['countnoanswerretry']}})['then'](function(){_0x3c7d89['swapAdditionalPhones'](_0x482dbc,_0x487795,_0x11555b)[_0x5e01('0x7d')](function(){});});}});delete this[_0x5e01('0x12')][_0x483874[_0x5e01('0xa6')]];break;case'19':_0x2b21c2[_0x5e01('0x3a')]+=0x1;_0x482dbc[_0x5e01('0x97')]=ut[_0x5e01('0xb8')](_0x482dbc);ut[_0x5e01('0x87')](_0x482dbc,0x13,_0x483874[_0x5e01('0xe9')]||_0x483874[_0x5e01('0xea')]);ami[_0x5e01('0x21')]('custom:amd',ut['buildObj'](_0x482dbc,'amd'));rpcDb[_0x5e01('0x8b')](_0x482dbc,_0x5e01('0xee'));_0x3c7d89[_0x5e01('0x9b')](_0x482dbc,'18',_0x2b21c2)[_0x5e01('0x7d')](function(_0x5a3ad3){_0x4030f8=_0x5a3ad3[_0x5e01('0xc5')]==0x1;if(!_0x4030f8){if(ut[_0x5e01('0xb8')](_0x482dbc)>=_0x2b21c2[_0x5e01('0x9e')]){_0x4d436c=ut[_0x5e01('0x9f')](_0x482dbc,0xf,_0x5e01('0xa0'));rpcDb[_0x5e01('0x8d')](_0x4d436c,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0x5e01('0x8d')](_0x482dbc,'[callProgressDetectingCustomer][machine]');}}else{_0x482dbc[_0x5e01('0xc9')]++;_0x3c7d89['incrementPreviewCounters']({'id':_0x482dbc[_0x5e01('0xa8')],'field':{'countnoanswerretry':_0x482dbc[_0x5e01('0xc9')]}})[_0x5e01('0x7d')](function(){_0x3c7d89[_0x5e01('0xaa')](_0x482dbc,_0x487795,_0x11555b)[_0x5e01('0x7d')](function(){});});}});delete this[_0x5e01('0x12')][_0x483874[_0x5e01('0xa6')]];break;default:if(_0x482dbc[_0x5e01('0x6d')]){ut[_0x5e01('0x77')](_0x2b21c2,_0x5e01('0xef'));ut[_0x5e01('0x78')](_0x5e01('0xf0')+_0x2b21c2[_0x5e01('0x24')],_0x483874);}_0x2b21c2['outboundUnknownCallsDay']+=0x1;_0x482dbc[_0x5e01('0x97')]=ut[_0x5e01('0xb8')](_0x482dbc);ut[_0x5e01('0x87')](_0x482dbc,0xc,_0x483874[_0x5e01('0xe9')]||_0x483874[_0x5e01('0xea')]);_0x487795=_0x2b21c2[_0x5e01('0xe2')];_0x11555b=_0x2b21c2[_0x5e01('0x9d')];rpcDb[_0x5e01('0x8b')](_0x482dbc,_0x5e01('0xf1'));_0x3c7d89[_0x5e01('0x9b')](_0x482dbc,'20',_0x2b21c2)[_0x5e01('0x7d')](function(_0x1bbaf5){_0x4030f8=_0x1bbaf5[_0x5e01('0xc5')]==0x1;if(!_0x4030f8){if(ut[_0x5e01('0xb8')](_0x482dbc)>=_0x2b21c2[_0x5e01('0x9e')]){_0x4d436c=ut[_0x5e01('0x9f')](_0x482dbc,0xf,_0x5e01('0xa0'));rpcDb[_0x5e01('0x8d')](_0x4d436c,_0x5e01('0xf2'));}else{rpcDb[_0x5e01('0x8d')](_0x482dbc,_0x5e01('0xf2'));}delete this[_0x5e01('0x12')][_0x483874[_0x5e01('0xa6')]];}else{_0x3c7d89[_0x5e01('0xaa')](_0x482dbc,_0x487795,_0x11555b)[_0x5e01('0x7d')](function(_0xd88405){});}});}if(!(_0x482dbc[_0x5e01('0x6d')]&&_0x1260b3==='16')){ut[_0x5e01('0x76')](_0x2b21c2,_0x5e01('0xf3'));logger['info'](_0x5e01('0xf4'),_0x482dbc['uniqueid'],_0x5e01('0xaf'),_0x2b21c2[_0x5e01('0x24')],'originated:\x20',_0x2b21c2[_0x5e01('0x47')]);}if(_0x1260b3!=='ANSWER'){delete this[_0x5e01('0x12')][_0x483874[_0x5e01('0xa6')]];delete this['actions'][_0x483874[_0x5e01('0xf5')]];}}};Preview[_0x5e01('0xe')]['callProgressDetectingAgent']=function(_0x477401,_0x31d488,_0x31c365){if(_['isUndefined'](_0x31d488)&&'object'!==typeof _0x31d488){return;}if(_[_0x5e01('0xf6')](_0x31c365)&&_0x5e01('0xf7')!==typeof _0x31c365){return;}switch(_0x31c365[_0x5e01('0xf8')]){case'0':ut['logAgent'](_0x477401,0x0,_0x5e01('0x98'));rpcDb[_0x5e01('0xf9')](_0x477401,_0x5e01('0xfa'));break;case'3':ut[_0x5e01('0xfb')](_0x477401,0x3,_0x5e01('0xca'));rpcDb[_0x5e01('0xf9')](_0x477401,_0x5e01('0xfc'));break;case'5':ut[_0x5e01('0xfb')](_0x477401,0x5,_0x5e01('0xc0'));rpcDb[_0x5e01('0xf9')](_0x477401,_0x5e01('0xfd'));break;case'8':ut[_0x5e01('0xfb')](_0x477401,0x8,_0x5e01('0xd4'));rpcDb['createAgentHistory'](_0x477401,_0x5e01('0xfe'));break;case'22':ut['logAgent'](_0x477401,0x16,'AnswerAGI');rpcDb[_0x5e01('0xf9')](_0x477401,_0x5e01('0xff'));break;default:ut['logAgent'](_0x477401,0xc,_0x31c365[_0x5e01('0xf8')]);rpcDb['createAgentHistory'](_0x477401,'[callProgressDetectingAgent][logCongestion]');}ut[_0x5e01('0x76')](_0x31d488,_0x5e01('0x100'));logger[_0x5e01('0x68')](_0x5e01('0x101'),_0x477401['uniqueid'],_0x5e01('0xaf'),_0x31d488[_0x5e01('0x24')],_0x5e01('0x102'),_0x31d488[_0x5e01('0x47')]);delete this[_0x5e01('0x12')][_0x477401[_0x5e01('0xae')]];};Preview[_0x5e01('0xe')][_0x5e01('0x9b')]=function(_0x57bca7,_0x1e7a4d,_0x5b66aa){return BPromise[_0x5e01('0x103')]()[_0x5e01('0x7d')](cmHopperAdditionalPhone[_0x5e01('0x9b')](_0x57bca7,_0x1e7a4d,_0x5b66aa))[_0x5e01('0x74')](logger['info'](_0x5e01('0x104')));};Preview[_0x5e01('0xe')]['swapAdditionalPhones']=function(_0x577e59,_0x273c6b,_0x229d6b){return BPromise['resolve']()['then'](cmHopperAdditionalPhone[_0x5e01('0xaa')](_0x577e59,_0x273c6b,_0x229d6b))[_0x5e01('0x74')](logger[_0x5e01('0x68')](_0x5e01('0x105')));};Preview['prototype'][_0x5e01('0xa9')]=function(_0x30c8d4){return BPromise[_0x5e01('0x103')]()[_0x5e01('0x7d')](cmHopperAdditionalPhone[_0x5e01('0xa9')](_0x30c8d4))[_0x5e01('0x74')](logger[_0x5e01('0x68')]('[incrementPreviewCounters]\x20'));};Preview[_0x5e01('0xe')][_0x5e01('0x106')]=function(_0x2cb4a7,_0x10fc68,_0x88de7,_0x299338,_0x5cbb55){var _0xa1e2fe=this;return new BPromise(function(_0x1780e9,_0x387182){if(_[_0x5e01('0x107')](_0x10fc68)||_[_0x5e01('0x107')](_0x10fc68[_0x5e01('0x108')])||_[_0x5e01('0x107')](_0x10fc68['phone'])||_[_0x5e01('0x107')](_0x10fc68['VoiceQueueId'])){_0x387182(ut['message'](_0x5e01('0x109'),_0x299338,_0x5cbb55));return;}var _0xe52373=uuid['v4']();var _0x5a4c3f=_0xa1e2fe[_0x5e01('0x20')][_0x10fc68[_0x5e01('0x6a')]['name']];var _0x4cd2ed=_0x88de7?_0xa1e2fe[_0x5e01('0x13')][_0x88de7]['id']:undefined;_0xa1e2fe[_0x5e01('0x12')][_0xe52373]=new Action(_0x10fc68,_0x5a4c3f,_0xe52373,_0x88de7,_0x4cd2ed);var _0x1eb4db=_0xa1e2fe[_0x5e01('0x12')][_0xe52373];_0x1eb4db['unlockAgent']=_0x299338;_0x1eb4db[_0x5e01('0xa5')]=_0x5cbb55;_0x1eb4db['lookAgent']=_0x88de7;if(_[_0x5e01('0x10a')](_0x2cb4a7)){_0xa1e2fe[_0x5e01('0x10b')](_0x1eb4db,_0x5a4c3f,_0x10fc68,_0x88de7)[_0x5e01('0x7d')](function(_0x35ea45){logger['info'](_0x5e01('0x10c'),_0x5e01('0x10d')+_0x1eb4db[_0x5e01('0x6b')]+_0x5e01('0x10e')+_0x1eb4db[_0x5e01('0xa8')],JSON[_0x5e01('0x51')](_0x35ea45));ami['emit'](_0x5e01('0x10f'),ut[_0x5e01('0xb1')](_0x1eb4db,'called',_0xa1e2fe['campaignsPreview'][_0x1eb4db['queue']]));_0x1780e9(ut[_0x5e01('0x46')]('Calling'));})[_0x5e01('0x74')](function(_0x5edfb4){ut[_0x5e01('0x5c')](_0x5e01('0x110'),_0x5edfb4);_0x387182(ut[_0x5e01('0x46')]('Call\x20failed',_0x299338,_0x5cbb55));});}else{_0x5a4c3f[_0x5e01('0x35')]+=0x1;ut[_0x5e01('0x111')](_0x1eb4db);rpcDb[_0x5e01('0x112')](_0x1eb4db,_0x5e01('0x113'));delete _0xa1e2fe['actions'][_0xe52373];_0x387182(ut[_0x5e01('0x46')]('Contact\x20in\x20black\x20List',_0x299338,_0x5cbb55));}});};Preview[_0x5e01('0xe')][_0x5e01('0x92')]=function(_0x29279d){return!_[_0x5e01('0x107')](_0x29279d)&&!_[_0x5e01('0x107')](_0x29279d[_0x5e01('0x24')])&&!_[_0x5e01('0x107')](_0x29279d[_0x5e01('0x4e')])&&_0x29279d[_0x5e01('0x4e')]&&!_[_0x5e01('0x107')](this[_0x5e01('0x11')][util[_0x5e01('0x52')](_0x5e01('0x114'),_0x29279d[_0x5e01('0x24')])])&&!_[_0x5e01('0x107')](this[_0x5e01('0x11')][util['format'](_0x5e01('0x114'),_0x29279d['name'])][_0x5e01('0x115')])&&(this['trunks'][util[_0x5e01('0x52')]('SIP/%s',_0x29279d[_0x5e01('0x24')])][_0x5e01('0x115')]===_0x5e01('0x116')||this[_0x5e01('0x11')][util[_0x5e01('0x52')](_0x5e01('0x114'),_0x29279d[_0x5e01('0x24')])][_0x5e01('0x115')]===_0x5e01('0x117'));};Preview[_0x5e01('0xe')][_0x5e01('0x83')]=function(_0x3c786d,_0x3c5b43){var _0x1d91b3=this;return new BPromise(function(_0xd94525,_0x5cdf51){_0x1d91b3[_0x5e01('0x118')](_0x3c786d,_0x3c5b43)[_0x5e01('0x7d')](function(_0x4247fd){_0xd94525(_[_0x5e01('0x6e')](_0x4247fd,[_0x5e01('0x46')]));})['catch'](function(_0x4b9011){if(_0x4b9011[_0x5e01('0x119')]){rpcDb[_0x5e01('0x11a')](_0x3c786d);}if(_0x4b9011[_0x5e01('0x4e')]){rpcDb['disableContact'](_0x3c786d);}_0x5cdf51(_['pick'](_0x4b9011,[_0x5e01('0x46')]));});});};Preview[_0x5e01('0xe')]['execRun']=function(_0x596417,_0x5db645){var _0x39e40=this;return new BPromise(function(_0x2ad481,_0x41dc76){var _0x261dfb,_0x179131;rpcDb[_0x5e01('0x11b')](_0x596417)[_0x5e01('0x7d')](function(_0x3721f8){if(!_[_0x5e01('0x107')](_0x3721f8[0x0])){_0x179131=_0x3721f8[0x0][_0x5e01('0x11c')]?![]:!![];_0x261dfb=_0x3721f8[0x0][_0x5e01('0x11c')]?!![]:![];_0x261dfb=_0x5db645?!![]:_0x261dfb;}var _0x3dc16c=_0x39e40[_0x5e01('0x11d')](_0x3721f8);if(_0x3dc16c[_0x5e01('0x11e')]){rpcDb[_0x5e01('0x11f')](_[_0x5e01('0x6e')](_0x3721f8[0x0],['VoiceQueueId','phone']))[_0x5e01('0x7d')](function(_0x217ad3){_0x39e40['checkInBlack'](_0x217ad3,_0x3721f8[0x0],_0x5db645,_0x179131,_0x261dfb)[_0x5e01('0x7d')](function(_0x5ab1b8){_0x2ad481(_0x5ab1b8);})['catch'](function(_0x147820){_0x41dc76(_0x147820);});})[_0x5e01('0x74')](function(_0x5194f7){ut[_0x5e01('0x5c')](_0x5e01('0x120'),_0x5194f7);_0x41dc76(ut['message'](_0x5e01('0x121'),_0x179131,_0x261dfb));});}else{_0x41dc76(ut[_0x5e01('0x46')](_0x3dc16c['message'],_0x179131,_0x261dfb));}})['catch'](function(_0x520921){ut[_0x5e01('0x5c')]('[Preview][getContactPreview]',_0x520921);_0x41dc76(ut[_0x5e01('0x46')]('Call\x20unsuccessful',![],!![]));});});};Preview['prototype'][_0x5e01('0x11d')]=function(_0x3e09ba){if(_[_0x5e01('0x107')](_0x3e09ba)||_[_0x5e01('0x10a')](_0x3e09ba)||!_[_0x5e01('0x107')](_0x3e09ba[0x0][_0x5e01('0x81')])&&_[_0x5e01('0x107')](_0x3e09ba[0x0][_0x5e01('0x81')][_0x5e01('0x24')])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x3e09ba);return{'isValid':![],'message':_0x5e01('0x122')};}var _0x56ef24=this[_0x5e01('0x20')][_0x3e09ba[0x0][_0x5e01('0x6a')][_0x5e01('0x24')]];_0x56ef24[_0x5e01('0x46')]='ACTIVE';if(_[_0x5e01('0x107')](_0x56ef24)){ut[_0x5e01('0x5c')](_0x5e01('0x123'),_0x56ef24);return{'isValid':![],'message':_0x5e01('0x124')};}if(!this['isTrunkReachable'](_0x56ef24['Trunk'])){ut[_0x5e01('0x5c')](_0x5e01('0x125'),_0x5e01('0x126')+_0x56ef24['name']+_0x5e01('0x127'));if(!this[_0x5e01('0x92')](_0x56ef24[_0x5e01('0x128')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x56ef24[_0x5e01('0x24')]+_0x5e01('0x129'));return{'isValid':![],'message':_0x5e01('0x12a')};}}if(!ut[_0x5e01('0x91')](_0x56ef24[_0x5e01('0x30')])){ut[_0x5e01('0x5c')](_0x5e01('0x12b'),_0x56ef24[_0x5e01('0x24')]+_0x5e01('0x12c'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x56ef24[_0x5e01('0x24')]+_0x5e01('0x12c')};}return{'isValid':!![],'message':_0x5e01('0x12d')};};Preview[_0x5e01('0xe')][_0x5e01('0x10b')]=function(_0x4d5530,_0x612fe0,_0x13b822,_0x2ce9f1){var _0x37f6f4=this;return new BPromise(function(_0x355c73,_0x2fce76){var _0x53e739=_0x4d5530[_0x5e01('0xae')];var _0x151eb5=_0x37f6f4[_0x5e01('0x92')](_0x612fe0['Trunk'])?util['format'](_0x5e01('0x12e'),_0x612fe0[_0x5e01('0x4d')][_0x5e01('0x24')],_['isNil'](_0x612fe0['dialPrefix'])?'':_0x612fe0[_0x5e01('0x32')]['trim']()||'',_0x612fe0[_0x5e01('0x12f')]>0x0?_0x13b822[_0x5e01('0x130')]['substring'](_0x612fe0[_0x5e01('0x12f')]):_0x13b822['phone']):util['format'](_0x5e01('0x12e'),_[_0x5e01('0x107')](_0x612fe0[_0x5e01('0x128')])?_0x612fe0[_0x5e01('0x4d')][_0x5e01('0x24')]:_0x612fe0[_0x5e01('0x128')][_0x5e01('0x24')],_['isNil'](_0x612fe0[_0x5e01('0x32')])?'':_0x612fe0[_0x5e01('0x32')]['trim']()||'',_0x612fe0[_0x5e01('0x12f')]>0x0?_0x13b822[_0x5e01('0x130')][_0x5e01('0x131')](_0x612fe0['dialCutDigit']):_0x13b822['phone']);var _0x2a02c9=_0x37f6f4[_0x5e01('0x92')](_0x612fe0[_0x5e01('0x4d')])?ut[_0x5e01('0x132')](_0x612fe0[_0x5e01('0x4d')][_0x5e01('0x4f')],_0x612fe0['dialOriginateCallerIdName'],_0x612fe0[_0x5e01('0x133')]>0x0?ut[_0x5e01('0x134')](_0x612fe0[_0x5e01('0x31')],_0x612fe0[_0x5e01('0x133')]):_0x612fe0[_0x5e01('0x31')]):ut[_0x5e01('0x132')](_['isNil'](_0x612fe0[_0x5e01('0x128')])?_0x612fe0[_0x5e01('0x4d')]['callerid']:_0x612fe0[_0x5e01('0x128')][_0x5e01('0x4f')],_0x612fe0[_0x5e01('0x135')],_0x612fe0[_0x5e01('0x133')]>0x0?ut[_0x5e01('0x134')](_0x612fe0[_0x5e01('0x31')],_0x612fe0[_0x5e01('0x133')]):_0x612fe0['dialOriginateCallerIdNumber']);if(_0x2a02c9){_0x4d5530[_0x5e01('0x136')]=ut[_0x5e01('0x137')](_0x2a02c9);_0x4d5530[_0x5e01('0x138')]=ut['extractCalleridNumber'](_0x2a02c9);}var _0x33cfba=ut[_0x5e01('0x139')](_0x612fe0,_0x13b822,_0x151eb5,_0x2a02c9,_0x53e739,_0x4d5530);_[_0x5e01('0x13a')](_0x4d5530,ut[_0x5e01('0x13b')](_0x33cfba));_0x4d5530['starttime']=moment()[_0x5e01('0x52')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x5e01('0x73')](ut['variablesAction'](_0x4d5530,_0x612fe0,_0x33cfba,_0x4d5530[_0x5e01('0xa5')],_0x2ce9f1))[_0x5e01('0x7d')](function(_0x575775){_0x612fe0[_0x5e01('0x47')]+=0x1;logger['info'](_0x5e01('0x13c'),_0x53e739,_0x5e01('0xaf'),_0x612fe0['name'],_0x5e01('0x102'),_0x612fe0[_0x5e01('0x47')]);_0x355c73(_0x575775);})[_0x5e01('0x74')](function(_0x5617b0){ut[_0x5e01('0xfb')](_0x4d5530,0xe,_0x5e01('0x13d'));rpcDb[_0x5e01('0xf9')](_0x4d5530,_0x5e01('0x13e'));_0x2fce76(_0x5617b0);});});};Preview[_0x5e01('0xe')]['syncNewExten']=function(_0x400c0a){if(this[_0x5e01('0x12')][_0x400c0a[_0x5e01('0xa6')]]){this[_0x5e01('0x12')][_0x400c0a[_0x5e01('0xa6')]]['channel']=_0x400c0a[_0x5e01('0x13f')];}};Preview[_0x5e01('0xe')][_0x5e01('0x15')]=function(_0xd15abc){var _0x1523f1=this;var _0xa7dd17=this[_0x5e01('0x12')][_0xd15abc['actionid']];if(_0xa7dd17){if(_0xa7dd17[_0x5e01('0x140')]&&this[_0x5e01('0x13')][_0xa7dd17['lookAgent']]){ut[_0x5e01('0x141')](_0xa7dd17,this['agents'][_0xa7dd17[_0x5e01('0x140')]]['name'],this[_0x5e01('0x13')][_0xa7dd17[_0x5e01('0x140')]]['id']);}var _0x2c15f5=_[_0x5e01('0x142')](_0xa7dd17);_0x2c15f5[_0x5e01('0xab')]=moment()[_0x5e01('0x52')](_0x5e01('0x86'));var _0x42b155=_0x1523f1[_0x5e01('0x20')][_0xa7dd17[_0x5e01('0x6b')]];if(ut[_0x5e01('0x143')](_0xd15abc[_0x5e01('0x144')])){if(_0xa7dd17[_0x5e01('0xd9')]){rpcDb[_0x5e01('0x11a')](_0xa7dd17['idContact']);}if(_0xa7dd17[_0x5e01('0xa5')]){rpcDb['disableContact'](_0xa7dd17['idContact']);}ami[_0x5e01('0x21')]('custom:agentringnoanswer',ut[_0x5e01('0xb1')](_0xa7dd17,'rejected',this[_0x5e01('0x20')][_0xa7dd17[_0x5e01('0x6b')]]));this['callProgressDetectingAgent'](_0x2c15f5,_0x42b155,_0xd15abc);}else{_0xa7dd17[_0x5e01('0x145')]=moment()[_0x5e01('0x52')](_0x5e01('0x86'));ut[_0x5e01('0xfb')](_0x2c15f5,0x4,_0x5e01('0xb9'));rpcDb['createAgentHistory'](_0x2c15f5,_0x5e01('0x146'));}}};Preview['prototype'][_0x5e01('0x16')]=function(_0x1bebac){var _0x4e8f4d=this;var _0x78afb4=this[_0x5e01('0x12')][_0x1bebac[_0x5e01('0xa6')]];var _0x3a1a9d;if(_0x78afb4){_0x3a1a9d=this[_0x5e01('0x20')][_0x78afb4[_0x5e01('0x6b')]];logger[_0x5e01('0x68')](_0x5e01('0x147'),_0x1bebac[_0x5e01('0xa6')],_0x5e01('0xaf'),_0x3a1a9d[_0x5e01('0x24')],'pTalking:\x20',_0x3a1a9d[_0x5e01('0x28')]);}if(this[_0x5e01('0x12')][_0x1bebac[_0x5e01('0xa6')]]&&_0x1bebac[_0x5e01('0xa6')]!==_0x1bebac[_0x5e01('0xae')]){if(_0x1bebac['cause']==='16'&&this[_0x5e01('0x12')][_0x1bebac[_0x5e01('0xa6')]][_0x5e01('0x6d')]){this[_0x5e01('0x95')](_0x1bebac,_0x1bebac['linkedid'],_0x1bebac[_0x5e01('0x148')]);}else if(this[_0x5e01('0x12')][_0x1bebac[_0x5e01('0xa6')]][_0x5e01('0x6d')]){logger['info']('[syncHangup][talking][cause]',_0x1bebac['linkedid'],_0x1bebac[_0x5e01('0x148')],_0x5e01('0xaf'),_0x3a1a9d[_0x5e01('0x24')],_0x5e01('0x6c'),_0x3a1a9d['pTalking']);this['callProgressDetectingCustomer'](_0x1bebac,_0x1bebac['linkedid'],_0x1bebac[_0x5e01('0x148')]);}}else if(_0x78afb4&&_['isNil'](_0x78afb4[_0x5e01('0x149')])&&_0x3a1a9d['dialQueueProject']&&_0x1bebac[_0x5e01('0xa6')]===_0x1bebac[_0x5e01('0xae')]&&_[_0x5e01('0x107')](_0x1bebac['reason'])&&_0x1bebac[_0x5e01('0x148')]==='16'&&_0x1bebac[_0x5e01('0x14a')]==='6'&&_['isUndefined'](_0x78afb4[_0x5e01('0x14b')])){if(_0x78afb4[_0x5e01('0xd9')]){rpcDb[_0x5e01('0x11a')](_0x78afb4[_0x5e01('0xa8')]);}if(_0x78afb4[_0x5e01('0xa5')]){rpcDb['disableContact'](_0x78afb4[_0x5e01('0xa8')]);}_0x1bebac[_0x5e01('0xf8')]='22';this[_0x5e01('0x14c')](_0x78afb4,_0x3a1a9d,_0x1bebac);}else if(_0x78afb4&&_0x78afb4[_0x5e01('0x14b')]){if(_0x1bebac[_0x5e01('0x148')]==='16'&&this[_0x5e01('0x12')][_0x1bebac[_0x5e01('0xa6')]]['dialAnswer']){logger[_0x5e01('0x68')]('[syncHangup][talking][transfer]',_0x1bebac['linkedid'],_0x1bebac[_0x5e01('0x148')],'\x20Queue',_0x3a1a9d[_0x5e01('0x24')],_0x5e01('0x6c'),_0x3a1a9d['pTalking']);this[_0x5e01('0x95')](_0x1bebac,_0x1bebac['linkedid'],_0x1bebac[_0x5e01('0x148')]);}else if(this[_0x5e01('0x12')][_0x1bebac['linkedid']][_0x5e01('0x6d')]){logger['info']('[syncHangup][talking][cause]',_0x1bebac['linkedid'],_0x1bebac[_0x5e01('0x148')],_0x5e01('0xaf'),_0x3a1a9d[_0x5e01('0x24')],'pTalking:\x20',_0x3a1a9d[_0x5e01('0x28')]);this[_0x5e01('0x95')](_0x1bebac,_0x1bebac[_0x5e01('0xa6')],_0x1bebac[_0x5e01('0x148')]);}}};Preview[_0x5e01('0xe')][_0x5e01('0x14d')]=function(_0x2e69d1){if(this[_0x5e01('0x12')][_0x2e69d1['destlinkedid']]&&_0x2e69d1['destlinkedid']!==_0x2e69d1[_0x5e01('0x14e')]){this['callProgressDetectingCustomer'](_0x2e69d1,_0x2e69d1['destlinkedid'],_0x2e69d1[_0x5e01('0xea')]);}};Preview[_0x5e01('0xe')][_0x5e01('0x18')]=function(_0x3195db){if(this[_0x5e01('0x12')][_0x3195db[_0x5e01('0xa6')]]&&_0x3195db[_0x5e01('0xa6')]!==_0x3195db['uniqueid']&&!this[_0x5e01('0x12')][_0x3195db[_0x5e01('0xa6')]][_0x5e01('0x6d')]){if(_0x3195db[_0x5e01('0x148')]==='1'){this[_0x5e01('0x95')](_0x3195db,_0x3195db[_0x5e01('0xa6')],_0x3195db[_0x5e01('0x148')]);}}};Preview['prototype'][_0x5e01('0x14f')]=function(_0xe094cd,_0x5d30d4,_0x3f9eac){if(this[_0x5e01('0x12')][_0xe094cd]){if(_[_0x5e01('0x107')](this['actions'][_0xe094cd][_0x5e01('0x150')])){this['actions'][_0xe094cd]['variables']={};}this[_0x5e01('0x12')][_0xe094cd][_0x5e01('0x150')][_0x5d30d4]=_0x3f9eac;}};Preview[_0x5e01('0xe')]['syncVarSet']=function(_0x1bafae){try{if(!_[_0x5e01('0x107')](_0x1bafae)){if(ut[_0x5e01('0x151')](_[_0x5e01('0x152')](_0x1bafae['variable'])[0x0])){this[_0x5e01('0x14f')](_0x1bafae['uniqueid'],_[_0x5e01('0x152')](_0x1bafae[_0x5e01('0x153')])[0x0],_0x1bafae[_0x5e01('0x154')]);}}}catch(_0x2b80f0){logger['error']('[syncVarSet][Preview]',util[_0x5e01('0x155')](_0x2b80f0,{'showHidden':![],'depth':null}));}};Preview[_0x5e01('0xe')][_0x5e01('0x1c')]=function(_0x152e24){if(_0x152e24){if(this[_0x5e01('0x12')][_0x152e24['transfertargetlinkedid']]){this[_0x5e01('0x12')][_0x152e24[_0x5e01('0x156')]][_0x5e01('0x14b')]=!![];}}};Preview[_0x5e01('0xe')][_0x5e01('0x1e')]=function(_0x40c025){if(_0x40c025){if(this['actions'][_0x40c025[_0x5e01('0x157')]]){this[_0x5e01('0x12')][_0x40c025['transfererlinkedid']][_0x5e01('0x14b')]=!![];}}};module['exports']=Preview;
\ No newline at end of file
+var _0x207c=['dialBusyMaxRetry','rescheduleContact','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','incrementPreviewCounters','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][machine]','decrementTalkink','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','object','isUndefined','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','resolve','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','unmonitored','run','unlock','execRun','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','getCallerIdRandom','originatecalleridnum','toLowerVariables','Action','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','unlockContact','custom:agentringnoanswer','rejected','callProgressDetectingAgent','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','syncHangupRequest','variables','filterKey','keys','variable','addVariable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','preview','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','redis','defaults','socket.io-emitter','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','dialend','syncDialEnd','syncNewExten','varset','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','name','stringify','format','info','voice:queue:%s','voice_queue_presence:remove','sendMessageOneNotActive','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','outbound','dialActive','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','sequence','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','setMessage','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','custom:agentnosuchnumber','buildObj','verifyAdditionalPhones','additional','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','scheduledAt','countnosuchnumberretry','unlockAgent','activeContact','linkedid','actioncountonusuch','idContact','swapAdditionalPhones','responsetime','answertime','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','complete','[16]','Answer','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','outboundBusyCallsDay','countbusyretry','dialBusyRetryFrequency','custom:agentbusy','[callProgressDetectingCustomer][logBusyGlobal]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x207c,0x1e8));var _0xc207=function(_0x2afccc,_0x443a1a){_0x2afccc=_0x2afccc-0x0;var _0x485666=_0x207c[_0x2afccc];return _0x485666;};'use strict';var util=require('util');var _=require(_0xc207('0x0'));var BPromise=require(_0xc207('0x1'));var uuid=require(_0xc207('0x2'));var moment=require(_0xc207('0x3'));var md5=require(_0xc207('0x4'));var Redis=require(_0xc207('0x5'));var config=require(_0xc207('0x6'));var logger=require('../../../config/logger')(_0xc207('0x7'));var loggerAction=require('../../../config/logger')('actionPreview');var ami=require('../ami');var rpcDb=require(_0xc207('0x8'));var cmHopperAdditionalPhone=require(_0xc207('0x9'));var Action=require(_0xc207('0xa'));var ut=require('./util/util');config[_0xc207('0xb')]=_[_0xc207('0xc')](config[_0xc207('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0xc207('0xd'))(new Redis(config[_0xc207('0xb')]));var Sequence=function(){};Sequence[_0xc207('0xe')][_0xc207('0xf')]=function(_0x201162){this[_0xc207('0x10')]=this['tail']?this['tail']['finally'](_0x201162):_0x201162();};function Preview(_0x19b297){this['sequence']=new Sequence();this[_0xc207('0x11')]=_0x19b297[_0xc207('0x12')];this['trunks']=_0x19b297[_0xc207('0x13')];this[_0xc207('0x14')]={};this[_0xc207('0x15')]=_0x19b297[_0xc207('0x15')];this[_0xc207('0x16')]=0x0;ami['on']('originateresponse',this[_0xc207('0x17')][_0xc207('0x18')](this));ami['on'](_0xc207('0x19'),this[_0xc207('0x1a')]['bind'](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0xc207('0x18')](this));ami['on'](_0xc207('0x1b'),this[_0xc207('0x1c')][_0xc207('0x18')](this));ami['on']('newexten',this[_0xc207('0x1d')][_0xc207('0x18')](this));ami['on'](_0xc207('0x1e'),this['syncVarSet'][_0xc207('0x18')](this));ami['on']('attendedtransfer',this[_0xc207('0x1f')][_0xc207('0x18')](this));ami['on'](_0xc207('0x20'),this[_0xc207('0x21')][_0xc207('0x18')](this));this[_0xc207('0x22')](this[_0xc207('0x11')]);}function emit(_0x464dea,_0x212005,_0x2bd2eb){io['to'](_0x464dea)[_0xc207('0x23')](_0x212005,_0x2bd2eb);}function emitCampaignPreview(_0xe227a){if(_0xe227a[_0xc207('0x24')]==='outbound'){var _0x163b36={'id':_0xe227a['id'],'name':_0xe227a['name'],'strategy':_0xe227a[_0xc207('0x25')],'answered':_0xe227a[_0xc207('0x26')],'available':_0xe227a[_0xc207('0x27')],'loggedIn':_0xe227a[_0xc207('0x28')],'pTalking':_0xe227a[_0xc207('0x29')],'sumBillable':_0xe227a[_0xc207('0x2a')],'sumDuration':_0xe227a[_0xc207('0x2b')],'sumHoldTime':_0xe227a[_0xc207('0x2c')]||0x0,'talking':_0xe227a[_0xc207('0x2d')],'total':_0xe227a[_0xc207('0x2e')],'type':_0xe227a[_0xc207('0x24')],'unmanaged':_0xe227a[_0xc207('0x2f')],'abandoned':_0xe227a[_0xc207('0x30')],'waiting':_0xe227a[_0xc207('0x31')],'loggedInDb':_0xe227a[_0xc207('0x32')],'dialActive':_0xe227a['dialActive'],'dialMethod':_0xe227a[_0xc207('0x33')],'dialOriginateCallerIdName':_0xe227a['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0xe227a['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0xe227a[_0xc207('0x34')],'dialPrefix':_0xe227a[_0xc207('0x35')],'outboundAnswerAgiCallsDay':_0xe227a[_0xc207('0x36')],'outboundAnswerCallsDay':_0xe227a[_0xc207('0x37')],'outboundBlacklistCallsDay':_0xe227a[_0xc207('0x38')],'outboundBusyCallsDay':_0xe227a['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0xe227a[_0xc207('0x39')],'outboundDropCallsDayACS':_0xe227a[_0xc207('0x3a')],'outboundDropCallsDayCallersExit':_0xe227a[_0xc207('0x3b')],'outboundDropCallsDayTimeout':_0xe227a[_0xc207('0x3c')],'outboundNoAnswerCallsDay':_0xe227a[_0xc207('0x3d')],'outboundNoSuchCallsDay':_0xe227a[_0xc207('0x3e')],'outboundOriginateFailureCallsDay':_0xe227a[_0xc207('0x3f')],'outboundReCallsDay':_0xe227a[_0xc207('0x40')],'outboundRejectCallsDay':_0xe227a[_0xc207('0x41')],'outboundUnknownCallsDay':_0xe227a[_0xc207('0x42')],'outboundAbandonedCallsDay':_0xe227a[_0xc207('0x43')],'predictiveIntervalAnsweredCalls':_0xe227a[_0xc207('0x44')],'predictiveIntervalAvgHoldtime':_0xe227a[_0xc207('0x45')],'predictiveIntervalAvgTalktime':_0xe227a['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0xe227a[_0xc207('0x46')],'predictiveIntervalDroppedCallsTimeout':_0xe227a[_0xc207('0x47')],'predictiveIntervalErlangCalls':_0xe227a[_0xc207('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0xe227a[_0xc207('0x49')],'predictiveIntervalHitRate':_0xe227a[_0xc207('0x4a')],'predictiveIntervalMultiplicativeFactor':_0xe227a[_0xc207('0x4b')],'predictiveIntervalPauses':_0xe227a['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0xe227a[_0xc207('0x4c')],'predictiveIntervalTotalCalls':_0xe227a[_0xc207('0x4d')],'message':_0xe227a[_0xc207('0x4e')],'originated':_0xe227a[_0xc207('0x4f')],'erlangCalls':_0xe227a['erlangCalls'],'erlangCallToSecond':_0xe227a[_0xc207('0x50')],'erlangAbandonmentRate':_0xe227a[_0xc207('0x51')],'erlangBusyFactor':_0xe227a[_0xc207('0x52')],'startPredictive':_0xe227a[_0xc207('0x53')],'startProgressive':_0xe227a[_0xc207('0x54')]};if(_0xe227a[_0xc207('0x55')]){_0x163b36[_0xc207('0x55')]={'id':_0xe227a[_0xc207('0x55')]['id'],'name':_0xe227a[_0xc207('0x55')]['name'],'active':_0xe227a['Trunk'][_0xc207('0x56')],'callerid':_0xe227a[_0xc207('0x55')][_0xc207('0x57')]};}if(_0xe227a[_0xc207('0x58')]){_0x163b36['Interval']={'id':_0xe227a[_0xc207('0x58')]['id'],'name':_0xe227a[_0xc207('0x58')][_0xc207('0x59')]};}var _0x2a1c60=md5(JSON[_0xc207('0x5a')](_0x163b36));if(_0xe227a['md5']!==_0x2a1c60){_0xe227a[_0xc207('0x4')]=_0x2a1c60;emit(util[_0xc207('0x5b')]('voice:queue:%s',_0x163b36[_0xc207('0x59')]),'voice_queue:save',_0x163b36);}}}function emitVoiceQueueChannelRemove(_0x297c84){logger[_0xc207('0x5c')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0xc207('0x5a')](_0x297c84));emit(util[_0xc207('0x5b')](_0xc207('0x5d'),_0x297c84['name']),'voice_queue_channel:remove',_0x297c84);io[_0xc207('0x23')](_0xc207('0x5e'),_0x297c84);}function notSendMessagesQueue(_0x41d66c){if(_0x41d66c[_0xc207('0x5f')]){if(_0x41d66c['originated']===0x0&&_0x41d66c[_0xc207('0x29')]===0x0){_0x41d66c['sendMessageOneNotActive']=![];_0x41d66c['available']=0x0;_0x41d66c['paused']=0x0;_0x41d66c['message']=_0xc207('0x60');ut[_0xc207('0x61')](_0xc207('0x62'),_0x41d66c['name']+_0xc207('0x63'));}else{_0x41d66c[_0xc207('0x4e')]=_0xc207('0x64');ut[_0xc207('0x61')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x41d66c[_0xc207('0x59')]+_0xc207('0x65'));}emitCampaignPreview(_0x41d66c);}}Preview[_0xc207('0xe')][_0xc207('0x22')]=function(){var _0x2d6d8b=this;setInterval(function(){_0x2d6d8b['syncCampaigns']();},0x7cf);};Preview[_0xc207('0xe')][_0xc207('0x66')]=function(){var _0x3a935a=this[_0xc207('0x11')];this[_0xc207('0x16')]+=0x1;for(var _0x477c22 in _0x3a935a){if(_0x3a935a[_0xc207('0x67')](_0x477c22)&&(_0x3a935a[_0x477c22][_0xc207('0x33')]===_0xc207('0x7')||_0x3a935a[_0x477c22]['dialMethod']===_0xc207('0x68'))&&_0x3a935a[_0x477c22][_0xc207('0x24')]==='outbound'){if(this[_0xc207('0x16')]>0x7){this[_0xc207('0x16')]=0x0;this[_0xc207('0x69')]();}}if(_0x3a935a[_0xc207('0x67')](_0x477c22)&&_0x3a935a[_0x477c22][_0xc207('0x33')]==='preview'&&_0x3a935a[_0x477c22][_0xc207('0x24')]===_0xc207('0x6a')){if(_0x3a935a[_0x477c22][_0xc207('0x6b')]){this['setMessage'](_0x3a935a[_0x477c22]);if(_0x3a935a[_0x477c22][_0xc207('0x6c')])this[_0xc207('0x6d')](_0x3a935a[_0x477c22]);}else{notSendMessagesQueue(_0x3a935a[_0x477c22]);}}}};Preview[_0xc207('0xe')][_0xc207('0x6e')]=function(_0x593326){var _0x4ebccf=this;this[_0xc207('0x6f')][_0xc207('0xf')](function(){if(!_[_0xc207('0x70')](_0x4ebccf[_0xc207('0x14')][_0x593326])){loggerAction[_0xc207('0x5c')](_0xc207('0x71'),_0x593326,_0xc207('0x72'),_0x4ebccf[_0xc207('0x14')][_0x593326][_0xc207('0x73')],_0xc207('0x74'),JSON[_0xc207('0x5a')](_0x4ebccf[_0xc207('0x11')][_0x4ebccf['actions'][_0x593326]['queue']][_0xc207('0x4f')]),_0xc207('0x75'),JSON[_0xc207('0x5a')](_0x4ebccf['campaignsPreview'][_0x4ebccf[_0xc207('0x14')][_0x593326][_0xc207('0x73')]][_0xc207('0x29')]),JSON[_0xc207('0x5a')](_0x4ebccf['actions'][_0x593326][_0xc207('0x76')]),JSON['stringify'](_[_0xc207('0x77')](_0x4ebccf['actions'][_0x593326],['contactId',_0xc207('0x78'),_0xc207('0x79'),'ListId'])));return ami['Action']({'action':'status','channel':_0x4ebccf[_0xc207('0x14')][_0x593326][_0xc207('0x7a')]})[_0xc207('0x7b')](function(_0x1acc33){if(_0x1acc33[_0xc207('0x4e')]===_0xc207('0x7c')){setTimeout(function(){if(_0x4ebccf[_0xc207('0x14')][_0x593326]){ut[_0xc207('0x7d')](_0x4ebccf['campaignsPreview'][_0x4ebccf[_0xc207('0x14')][_0x593326][_0xc207('0x73')]],'[clearZombieChannel]');if(_0x4ebccf['actions'][_0x593326][_0xc207('0x76')]===!![]){ut['decrementTalkink'](_0x4ebccf['campaignsPreview'][_0x4ebccf[_0xc207('0x14')][_0x593326][_0xc207('0x73')]],_0xc207('0x7e'));ut[_0xc207('0x7f')](_0xc207('0x80')+_0x593326,_0x4ebccf[_0xc207('0x14')][_0x593326][_0xc207('0x73')]);}ut[_0xc207('0x7f')](_0xc207('0x81')+_0x593326,_0x4ebccf[_0xc207('0x14')][_0x593326][_0xc207('0x73')]);delete _0x4ebccf['actions'][_0x593326];}},0x2328);}});}});};Preview['prototype'][_0xc207('0x69')]=function(){var _0x246f5b=this;loggerAction[_0xc207('0x5c')](_0xc207('0x82'),_[_0xc207('0x83')](this[_0xc207('0x14')]));for(var _0x1fc073 in this[_0xc207('0x14')]){if(_0x246f5b[_0xc207('0x14')]['hasOwnProperty'](_0x1fc073)){_0x246f5b[_0xc207('0x6e')](_0x1fc073);}}};Preview[_0xc207('0xe')][_0xc207('0x6d')]=function(_0x6d387e){var _0x569c85=this;rpcDb[_0xc207('0x84')](_0x6d387e['id'],ut[_0xc207('0x85')](this[_0xc207('0x15')]))[_0xc207('0x86')](function(_0x464263){if(!_[_0xc207('0x70')](_0x464263)){for(var _0x3eb832=0x0;_0x3eb832<_0x464263['length'];_0x3eb832+=0x1){if(ut[_0xc207('0x87')](_0x464263[_0x3eb832][_0xc207('0x88')])<_0x6d387e[_0xc207('0x89')]*0x3c){if(_0x464263[_0x3eb832][_0xc207('0x8a')]&&!_0x464263[_0x3eb832]['Agent'][_0xc207('0x8b')]){_0x569c85['run'](_0x464263[_0x3eb832]['id'])['then'](ut[_0xc207('0x8c')](_0xc207('0x8d')))[_0xc207('0x7b')](ut[_0xc207('0x8c')](_0xc207('0x8d')));}else{rpcDb[_0xc207('0x8e')](_0x464263[_0x3eb832]['id']);}}else{var _0x35a0d8=new Action(_0x464263[_0x3eb832],_0x6d387e);_0x35a0d8[_0xc207('0x8f')]=moment()[_0xc207('0x5b')](_0xc207('0x90'));_0x6d387e[_0xc207('0x40')]+=0x1;ut[_0xc207('0x91')](_0x35a0d8,0x17,_0xc207('0x92'));if(_0x6d387e[_0xc207('0x93')]){rpcDb[_0xc207('0x94')](ut['createBody'](_0x464263[_0x3eb832]));rpcDb[_0xc207('0x95')](_0x35a0d8,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xc207('0x91')](_0x35a0d8,0x16,_0xc207('0x96'));rpcDb[_0xc207('0x95')](_0x35a0d8,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x35a0d8,_0xc207('0x97'));}}}}})[_0xc207('0x7b')](ut[_0xc207('0x8c')]('[getContactRecallMe]'));};Preview[_0xc207('0xe')][_0xc207('0x98')]=function(_0x3509d8){_0x3509d8['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0x3509d8[_0xc207('0x28')])){_0x3509d8['message']=_0xc207('0x99');}else if(!ut[_0xc207('0x9a')](_0x3509d8[_0xc207('0x6b')])){_0x3509d8[_0xc207('0x4e')]=_0xc207('0x60');}else if(!this[_0xc207('0x9b')](_0x3509d8[_0xc207('0x55')])){if(!this[_0xc207('0x9b')](_0x3509d8['TrunkBackup'])){_0x3509d8[_0xc207('0x4e')]=_0xc207('0x9c');}else{_0x3509d8[_0xc207('0x4e')]=_0xc207('0x9d');}}else{_0x3509d8[_0xc207('0x4e')]=_0xc207('0x9d');}emitCampaignPreview(_0x3509d8);};Preview[_0xc207('0xe')][_0xc207('0x9e')]=function(_0x28a45d,_0x28f467,_0x203686){var _0x53a210=this;var _0x20e130=this[_0xc207('0x14')][_0x28f467];var _0x45b4fb=this[_0xc207('0x11')][_0x20e130['queue']];var _0x586c41;var _0x416a72=![];var _0x375518=0x2;var _0x34f784=0x3;if(_0x45b4fb){switch(_0x203686){case'1':_0x45b4fb[_0xc207('0x3e')]+=0x1;_0x20e130['countnosuchnumberretry']+=0x1;_0x20e130[_0xc207('0x9f')]=ut[_0xc207('0xa0')](_0x20e130);ut[_0xc207('0x91')](_0x20e130,0x0,'NoSuchNumber');ami[_0xc207('0x23')](_0xc207('0xa1'),ut[_0xc207('0xa2')](_0x20e130,'nosuchnumber'));rpcDb[_0xc207('0x95')](_0x20e130,'[callProgressDetectingCustomer][logNoSuch]');_0x53a210[_0xc207('0xa3')](_0x20e130,'0',_0x45b4fb)['then'](function(_0xf68aae){_0x416a72=_0xf68aae[_0xc207('0xa4')]==0x1;_0x375518=_0x45b4fb['dialNoSuchNumberRetryFrequency'];_0x34f784=_0x45b4fb[_0xc207('0xa5')];if(!_0x416a72){if(ut['totalGlobal'](_0x20e130)>=_0x45b4fb[_0xc207('0xa6')]){_0x586c41=ut[_0xc207('0xa7')](_0x20e130,0xf,_0xc207('0xa8'));rpcDb[_0xc207('0xa9')](_0x586c41,_0xc207('0xaa'));}else{if(_0x20e130['countnosuchnumberretry']>=_0x45b4fb['dialNoSuchNumberMaxRetry']){rpcDb[_0xc207('0xa9')](_0x20e130,_0xc207('0xaa'));}else{rpcDb['rescheduleContact'](ut[_0xc207('0xab')](_0x20e130,_0xc207('0xac'),_0x45b4fb['dialNoSuchNumberRetryFrequency']),_0x20e130[_0xc207('0xad')],_0x20e130[_0xc207('0xae')]);}}delete this['actions'][_0x28a45d[_0xc207('0xaf')]];}else{_0x20e130[_0xc207('0xac')]++;logger[_0xc207('0x5c')](_0xc207('0xb0'),_0x20e130[_0xc207('0xac')]);logger[_0xc207('0x5c')]('id',_0x20e130['idContact']);_0x53a210['incrementPreviewCounters']({'id':_0x20e130[_0xc207('0xb1')],'field':{'countnosuchnumberretry':_0x20e130[_0xc207('0xac')]}})[_0xc207('0x86')](function(){_0x53a210[_0xc207('0xb2')](_0x20e130,_0x375518,_0x34f784)[_0xc207('0x86')](function(){});});}});break;case'ANSWER':var _0x32e092=moment()['format'](_0xc207('0x90'));_0x20e130[_0xc207('0xb3')]=_0x32e092;_0x20e130[_0xc207('0xb4')]=_0x32e092;_0x20e130[_0xc207('0x76')]=!![];_0x45b4fb[_0xc207('0x29')]+=0x1;logger[_0xc207('0x5c')]('[syncHangup][talking][increment]',_0x20e130[_0xc207('0xb5')],_0xc207('0xb6'),_0x45b4fb['name'],_0xc207('0x75'),_0x45b4fb[_0xc207('0x29')]);ami[_0xc207('0x23')](_0xc207('0xb7'),ut[_0xc207('0xa2')](_0x20e130,_0xc207('0xb8'),this[_0xc207('0x11')][_0x20e130[_0xc207('0x73')]]));if(_0x45b4fb[_0xc207('0xb9')]){ami[_0xc207('0x23')](_0xc207('0xba'),ut[_0xc207('0xbb')](_0x20e130));}break;case'16':ami[_0xc207('0x23')]('custom:agentcomplete',ut[_0xc207('0xa2')](_0x20e130,_0xc207('0xbc'),this[_0xc207('0x11')][_0x20e130[_0xc207('0x73')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x20e130,_0xc207('0xbc')));_0x45b4fb['outboundAnswerCallsDay']+=0x1;_0x45b4fb[_0xc207('0x2e')]+=0x1;_0x45b4fb['answered']+=0x1;ut['decrementTalkink'](_0x45b4fb,_0xc207('0xbd'));_0x20e130[_0xc207('0x9f')]=ut[_0xc207('0xa0')](_0x20e130);ut[_0xc207('0x91')](_0x20e130,0x4,_0xc207('0xbe'));rpcDb[_0xc207('0x95')](_0x20e130,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xc207('0xa9')](_0x20e130,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xc207('0xbf')](_0x20e130);_0x45b4fb[_0xc207('0x2b')]+=_0x20e130[_0xc207('0xc0')];_0x45b4fb[_0xc207('0x2a')]+=_0x20e130['talktime'];logger[_0xc207('0x5c')](_0xc207('0xc1'),_0x20e130['uniqueid'],_0xc207('0xb6'),_0x45b4fb[_0xc207('0x59')],_0xc207('0x75'),_0x45b4fb[_0xc207('0x29')]);delete this['actions'][_0x28a45d[_0xc207('0xaf')]];break;case _0xc207('0xc2'):_0x45b4fb[_0xc207('0xc3')]+=0x1;_0x20e130[_0xc207('0xc4')]+=0x1;_0x20e130['countglobal']=ut['totalGlobal'](_0x20e130);ut['logCustomer'](_0x20e130,0x5,'Busy');_0x375518=_0x45b4fb[_0xc207('0xc5')];_0x34f784=_0x45b4fb[_0xc207('0xa5')];ami[_0xc207('0x23')](_0xc207('0xc6'),ut['buildObj'](_0x20e130,'busy'));rpcDb[_0xc207('0x95')](_0x20e130,'[callProgressDetectingCustomer][logBusy]');_0x53a210['verifyAdditionalPhones'](_0x20e130,'5',_0x45b4fb)[_0xc207('0x86')](function(_0x4167bc){_0x416a72=_0x4167bc[_0xc207('0xa4')]==0x1;if(!_0x416a72){if(ut[_0xc207('0xa0')](_0x20e130)>=_0x45b4fb[_0xc207('0xa6')]){_0x586c41=ut['cloneAction'](_0x20e130,0xf,_0xc207('0xa8'));rpcDb['createCustomerFinal'](_0x586c41,_0xc207('0xc7'));}else{if(_0x20e130[_0xc207('0xc4')]>=_0x45b4fb[_0xc207('0xc8')]){rpcDb['createCustomerFinal'](_0x20e130,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xc207('0xc9')](ut[_0xc207('0xab')](_0x20e130,_0xc207('0xc4'),_0x45b4fb[_0xc207('0xc5')]),_0x20e130['unlockAgent'],_0x20e130['activeContact']);}}}else{_0x20e130[_0xc207('0xc4')]++;_0x53a210['incrementPreviewCounters']({'id':_0x20e130[_0xc207('0xb1')],'field':{'countbusyretry':_0x20e130[_0xc207('0xc4')]}})[_0xc207('0x86')](function(){_0x53a210[_0xc207('0xb2')](_0x20e130,_0x375518,_0x34f784)[_0xc207('0x86')](function(){});});}});break;case'NOANSWER':_0x45b4fb[_0xc207('0x3d')]+=0x1;_0x20e130[_0xc207('0xca')]+=0x1;_0x20e130[_0xc207('0x9f')]=ut[_0xc207('0xa0')](_0x20e130);ut[_0xc207('0x91')](_0x20e130,0x3,_0xc207('0xcb'));_0x375518=_0x45b4fb[_0xc207('0xcc')];_0x34f784=_0x45b4fb[_0xc207('0xa5')];ami[_0xc207('0x23')](_0xc207('0xcd'),ut['buildObj'](_0x20e130,_0xc207('0xce')));rpcDb['createCustomerHistory'](_0x20e130,'[callProgressDetectingCustomer][logNoAnswer]');_0x53a210[_0xc207('0xa3')](_0x20e130,'3',_0x45b4fb)[_0xc207('0x86')](function(_0x5df85d){_0x416a72=_0x5df85d['additional']==0x1;if(!_0x416a72){if(ut[_0xc207('0xa0')](_0x20e130)>=_0x45b4fb[_0xc207('0xa6')]){_0x586c41=ut[_0xc207('0xa7')](_0x20e130,0xf,_0xc207('0xa8'));rpcDb['createCustomerFinal'](_0x586c41,_0xc207('0xcf'));}else{if(_0x20e130['countnoanswerretry']>=_0x45b4fb[_0xc207('0xd0')]){rpcDb[_0xc207('0xa9')](_0x20e130,_0xc207('0xd1'));}else{rpcDb[_0xc207('0xc9')](ut[_0xc207('0xab')](_0x20e130,_0xc207('0xca'),_0x45b4fb['dialNoAnswerRetryFrequency']),_0x20e130[_0xc207('0xad')],_0x20e130[_0xc207('0xae')]);}}}else{_0x20e130['countnoanswerretry']++;_0x53a210['incrementPreviewCounters']({'id':_0x20e130['idContact'],'field':{'countnoanswerretry':_0x20e130['countnoanswerretry']}})['then'](function(){_0x53a210[_0xc207('0xb2')](_0x20e130,_0x375518,_0x34f784)[_0xc207('0x86')](function(){});});}});break;case _0xc207('0xd2'):_0x45b4fb['outboundCongestionCallsDay']+=0x1;_0x20e130[_0xc207('0xd3')]+=0x1;_0x20e130['countglobal']=ut[_0xc207('0xa0')](_0x20e130);ut[_0xc207('0x91')](_0x20e130,0x8,_0xc207('0xd4'));_0x375518=_0x45b4fb['dialCongestionRetryFrequency'];_0x34f784=_0x45b4fb[_0xc207('0xa5')];ami[_0xc207('0x23')]('custom:agentcongestion',ut[_0xc207('0xa2')](_0x20e130,'congestion'));rpcDb[_0xc207('0x95')](_0x20e130,'[callProgressDetectingCustomer][logCongestion]');_0x53a210[_0xc207('0xa3')](_0x20e130,'8',_0x45b4fb)['then'](function(_0x24efae){_0x416a72=_0x24efae[_0xc207('0xa4')]==0x1;if(!_0x416a72){if(ut[_0xc207('0xa0')](_0x20e130)>=_0x45b4fb[_0xc207('0xa6')]){_0x586c41=ut[_0xc207('0xa7')](_0x20e130,0xf,_0xc207('0xa8'));rpcDb['createCustomerFinal'](_0x586c41,_0xc207('0xd5'));}else{if(_0x20e130[_0xc207('0xd3')]>=_0x45b4fb[_0xc207('0xd6')]){rpcDb[_0xc207('0xa9')](_0x20e130,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xc207('0xc9')](ut[_0xc207('0xab')](_0x20e130,'countcongestionretry',_0x45b4fb[_0xc207('0xc5')]),_0x20e130[_0xc207('0xad')],_0x20e130[_0xc207('0xae')]);}}}else{_0x20e130[_0xc207('0xd3')]++;_0x53a210['incrementPreviewCounters']({'id':_0x20e130[_0xc207('0xb1')],'field':{'countcongestionretry':_0x20e130[_0xc207('0xd3')]}})[_0xc207('0x86')](function(){_0x53a210[_0xc207('0xb2')](_0x20e130,_0x375518,_0x34f784)['then'](function(){});});}});break;case _0xc207('0xd7'):_0x45b4fb['outboundRejectCallsDay']+=0x1;_0x20e130[_0xc207('0xd8')]+=0x1;_0x20e130[_0xc207('0x9f')]=ut[_0xc207('0xa0')](_0x20e130);ut['logCustomer'](_0x20e130,0x14,_0xc207('0xd9'));_0x375518=_0x45b4fb[_0xc207('0xda')];_0x34f784=_0x45b4fb[_0xc207('0xa5')];ami[_0xc207('0x23')](_0xc207('0xdb'),ut[_0xc207('0xa2')](_0x20e130,_0xc207('0xdc')));rpcDb[_0xc207('0x95')](_0x20e130,'[syncHangupRequest][logAgentReject]');_0x53a210[_0xc207('0xa3')](_0x20e130,'20',_0x45b4fb)[_0xc207('0x86')](function(_0x5022f5){_0x416a72=_0x5022f5[_0xc207('0xa4')]==0x1;if(!_0x416a72){if(ut[_0xc207('0xa0')](_0x20e130)>=_0x45b4fb[_0xc207('0xa6')]){_0x586c41=ut[_0xc207('0xa7')](_0x20e130,0x14,_0xc207('0xd9'));rpcDb[_0xc207('0xa9')](_0x586c41,_0xc207('0xdd'));}else{if(_0x20e130['countagentrejectretry']>=_0x45b4fb[_0xc207('0xde')]){rpcDb[_0xc207('0xa9')](_0x20e130,_0xc207('0xdd'));}else{rpcDb[_0xc207('0xc9')](ut[_0xc207('0xab')](_0x20e130,_0xc207('0xd8'),_0x45b4fb[_0xc207('0xda')]),_0x20e130[_0xc207('0xad')],_0x20e130[_0xc207('0xae')]);}}}else{_0x20e130[_0xc207('0xca')]++;_0x53a210[_0xc207('0xdf')]({'id':_0x20e130[_0xc207('0xb1')],'field':{'countnoanswerretry':_0x20e130[_0xc207('0xca')]}})['then'](function(){_0x53a210[_0xc207('0xb2')](_0x20e130,_0x375518,_0x34f784)['then'](function(){});});}});break;case'ABANDONED':_0x45b4fb[_0xc207('0x43')]+=0x1;_0x20e130[_0xc207('0xe0')]+=0x1;_0x20e130['countglobal']=ut[_0xc207('0xa0')](_0x20e130);ut[_0xc207('0x91')](_0x20e130,0xb,'Abandoned');rpcDb[_0xc207('0x95')](_0x20e130,_0xc207('0xe1'));_0x53a210['verifyAdditionalPhones'](_0x20e130,'11',_0x45b4fb)['then'](function(_0x3fa014){_0x416a72=_0x3fa014[_0xc207('0xa4')]==0x1;if(!_0x416a72){if(ut[_0xc207('0xa0')](_0x20e130)>=_0x45b4fb[_0xc207('0xa6')]){_0x586c41=ut[_0xc207('0xa7')](_0x20e130,0xf,_0xc207('0xa8'));rpcDb[_0xc207('0xa9')](_0x586c41,_0xc207('0xe1'));}else{if(_0x20e130['countabandonedetry']>=_0x45b4fb[_0xc207('0xe2')]){rpcDb[_0xc207('0xa9')](_0x20e130,_0xc207('0xe1'));}else{rpcDb[_0xc207('0xc9')](ut[_0xc207('0xab')](_0x20e130,_0xc207('0xe0'),_0x45b4fb[_0xc207('0xe3')]),_0x20e130[_0xc207('0xad')],_0x20e130[_0xc207('0xae')]);}}}else{_0x20e130['countnoanswerretry']++;_0x53a210[_0xc207('0xdf')]({'id':_0x20e130['idContact'],'field':{'countnoanswerretry':_0x20e130['countnoanswerretry']}})[_0xc207('0x86')](function(){_0x53a210[_0xc207('0xb2')](_0x20e130,_0x375518,_0x34f784)[_0xc207('0x86')](function(){});});}});break;case'18':_0x45b4fb[_0xc207('0x42')]+=0x1;_0x20e130[_0xc207('0xe4')]+=0x1;_0x20e130['countglobal']=ut[_0xc207('0xa0')](_0x20e130);ut[_0xc207('0x91')](_0x20e130,0x12,_0x28a45d['cause-txt']||_0x28a45d['dialstatus']);ami[_0xc207('0x23')]('custom:amd',ut[_0xc207('0xa2')](_0x20e130,_0xc207('0xe5')));rpcDb[_0xc207('0x95')](_0x20e130,'[callProgressDetectingCustomer][hangupInAMD]');_0x53a210[_0xc207('0xa3')](_0x20e130,'18',_0x45b4fb)[_0xc207('0x86')](function(_0x28900f){_0x416a72=_0x28900f[_0xc207('0xa4')]==0x1;if(!_0x416a72){if(ut['totalGlobal'](_0x20e130)>=_0x45b4fb[_0xc207('0xa6')]){_0x586c41=ut[_0xc207('0xa7')](_0x20e130,0x12,'Global');rpcDb[_0xc207('0xa9')](_0x586c41,_0xc207('0xe6'));}else{rpcDb['createCustomerFinal'](_0x20e130,_0xc207('0xe6'));}}else{_0x20e130[_0xc207('0xca')]++;_0x53a210[_0xc207('0xdf')]({'id':_0x20e130[_0xc207('0xb1')],'field':{'countnoanswerretry':_0x20e130[_0xc207('0xca')]}})[_0xc207('0x86')](function(){_0x53a210[_0xc207('0xb2')](_0x20e130,_0x375518,_0x34f784)[_0xc207('0x86')](function(){});});}});delete this[_0xc207('0x14')][_0x28a45d['linkedid']];break;case'19':_0x45b4fb[_0xc207('0x42')]+=0x1;_0x20e130[_0xc207('0x9f')]=ut[_0xc207('0xa0')](_0x20e130);ut[_0xc207('0x91')](_0x20e130,0x13,_0x28a45d[_0xc207('0xe7')]||_0x28a45d[_0xc207('0xe8')]);ami[_0xc207('0x23')](_0xc207('0xe9'),ut[_0xc207('0xa2')](_0x20e130,_0xc207('0xe5')));rpcDb[_0xc207('0x95')](_0x20e130,'[callProgressDetectingCustomer][machine]');_0x53a210[_0xc207('0xa3')](_0x20e130,'18',_0x45b4fb)['then'](function(_0x2414cc){_0x416a72=_0x2414cc[_0xc207('0xa4')]==0x1;if(!_0x416a72){if(ut[_0xc207('0xa0')](_0x20e130)>=_0x45b4fb[_0xc207('0xa6')]){_0x586c41=ut['cloneAction'](_0x20e130,0xf,'Global');rpcDb[_0xc207('0xa9')](_0x586c41,_0xc207('0xea'));}else{rpcDb[_0xc207('0xa9')](_0x20e130,_0xc207('0xea'));}}else{_0x20e130[_0xc207('0xca')]++;_0x53a210[_0xc207('0xdf')]({'id':_0x20e130[_0xc207('0xb1')],'field':{'countnoanswerretry':_0x20e130[_0xc207('0xca')]}})[_0xc207('0x86')](function(){_0x53a210[_0xc207('0xb2')](_0x20e130,_0x375518,_0x34f784)[_0xc207('0x86')](function(){});});}});delete this[_0xc207('0x14')][_0x28a45d[_0xc207('0xaf')]];break;default:if(_0x20e130[_0xc207('0x76')]){ut[_0xc207('0xeb')](_0x45b4fb,_0xc207('0xec'));ut[_0xc207('0x7f')](_0xc207('0xed')+_0x45b4fb[_0xc207('0x59')],_0x28a45d);}_0x45b4fb[_0xc207('0x42')]+=0x1;_0x20e130[_0xc207('0x9f')]=ut[_0xc207('0xa0')](_0x20e130);ut['logCustomer'](_0x20e130,0xc,_0x28a45d[_0xc207('0xe7')]||_0x28a45d[_0xc207('0xe8')]);_0x375518=_0x45b4fb['dialAgentRejectRetryFrequency'];_0x34f784=_0x45b4fb[_0xc207('0xa5')];rpcDb[_0xc207('0x95')](_0x20e130,_0xc207('0xee'));_0x53a210['verifyAdditionalPhones'](_0x20e130,'20',_0x45b4fb)[_0xc207('0x86')](function(_0x35d275){_0x416a72=_0x35d275[_0xc207('0xa4')]==0x1;if(!_0x416a72){if(ut[_0xc207('0xa0')](_0x20e130)>=_0x45b4fb[_0xc207('0xa6')]){_0x586c41=ut[_0xc207('0xa7')](_0x20e130,0xf,_0xc207('0xa8'));rpcDb[_0xc207('0xa9')](_0x586c41,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xc207('0xa9')](_0x20e130,_0xc207('0xef'));}delete this[_0xc207('0x14')][_0x28a45d[_0xc207('0xaf')]];}else{_0x53a210['swapAdditionalPhones'](_0x20e130,_0x375518,_0x34f784)[_0xc207('0x86')](function(_0x54165d){});}});}if(!(_0x20e130[_0xc207('0x76')]&&_0x203686==='16')){ut[_0xc207('0x7d')](_0x45b4fb,_0xc207('0xf0'));logger['info'](_0xc207('0xf1'),_0x20e130[_0xc207('0xb5')],_0xc207('0xb6'),_0x45b4fb[_0xc207('0x59')],_0xc207('0x74'),_0x45b4fb[_0xc207('0x4f')]);}if(_0x203686!==_0xc207('0xf2')){delete this[_0xc207('0x14')][_0x28a45d[_0xc207('0xaf')]];delete this[_0xc207('0x14')][_0x28a45d[_0xc207('0xf3')]];}}};Preview['prototype']['callProgressDetectingAgent']=function(_0x6aec02,_0x2a3af7,_0x331e0f){if(_['isUndefined'](_0x2a3af7)&&_0xc207('0xf4')!==typeof _0x2a3af7){return;}if(_[_0xc207('0xf5')](_0x331e0f)&&_0xc207('0xf4')!==typeof _0x331e0f){return;}switch(_0x331e0f[_0xc207('0xf6')]){case'0':ut[_0xc207('0xf7')](_0x6aec02,0x0,_0xc207('0xf8'));rpcDb[_0xc207('0xf9')](_0x6aec02,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0xc207('0xf7')](_0x6aec02,0x3,_0xc207('0xcb'));rpcDb['createAgentHistory'](_0x6aec02,_0xc207('0xfa'));break;case'5':ut['logAgent'](_0x6aec02,0x5,_0xc207('0xfb'));rpcDb['createAgentHistory'](_0x6aec02,'[callProgressDetectingAgent][logBusy]');break;case'8':ut['logAgent'](_0x6aec02,0x8,'Congestion');rpcDb[_0xc207('0xf9')](_0x6aec02,_0xc207('0xfc'));break;case'22':ut[_0xc207('0xf7')](_0x6aec02,0x16,'AnswerAGI');rpcDb[_0xc207('0xf9')](_0x6aec02,_0xc207('0xfd'));break;default:ut['logAgent'](_0x6aec02,0xc,_0x331e0f[_0xc207('0xf6')]);rpcDb[_0xc207('0xf9')](_0x6aec02,_0xc207('0xfc'));}ut['updateOriginated'](_0x2a3af7,_0xc207('0xfe'));logger['info'](_0xc207('0xff'),_0x6aec02[_0xc207('0xb5')],'\x20Queue',_0x2a3af7[_0xc207('0x59')],'originated:\x20',_0x2a3af7[_0xc207('0x4f')]);delete this['actions'][_0x6aec02['uniqueid']];};Preview[_0xc207('0xe')][_0xc207('0xa3')]=function(_0x1e2d78,_0xd6227d,_0x48cf60){return BPromise['resolve']()[_0xc207('0x86')](cmHopperAdditionalPhone[_0xc207('0xa3')](_0x1e2d78,_0xd6227d,_0x48cf60))[_0xc207('0x7b')](logger[_0xc207('0x5c')](_0xc207('0x100')));};Preview['prototype'][_0xc207('0xb2')]=function(_0x5b461d,_0x503b3a,_0x387476){return BPromise[_0xc207('0x101')]()['then'](cmHopperAdditionalPhone['swapAdditionalPhones'](_0x5b461d,_0x503b3a,_0x387476))['catch'](logger[_0xc207('0x5c')](_0xc207('0x102')));};Preview[_0xc207('0xe')][_0xc207('0xdf')]=function(_0x57eff2){return BPromise[_0xc207('0x101')]()[_0xc207('0x86')](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x57eff2))[_0xc207('0x7b')](logger[_0xc207('0x5c')](_0xc207('0x103')));};Preview[_0xc207('0xe')][_0xc207('0x104')]=function(_0x40b692,_0x24338a,_0x1756eb,_0x3e0480,_0x533e84){var _0x4cee5a=this;return new BPromise(function(_0x11f4e1,_0x1f9a6d){if(_['isNil'](_0x24338a)||_['isNil'](_0x24338a[_0xc207('0x105')])||_['isNil'](_0x24338a[_0xc207('0x106')])||_[_0xc207('0x70')](_0x24338a['VoiceQueueId'])){_0x1f9a6d(ut[_0xc207('0x4e')](_0xc207('0x107'),_0x3e0480,_0x533e84));return;}var _0x4fd753=uuid['v4']();var _0x581d54=_0x4cee5a[_0xc207('0x11')][_0x24338a[_0xc207('0x72')][_0xc207('0x59')]];var _0x552239=_0x1756eb?_0x4cee5a[_0xc207('0x15')][_0x1756eb]['id']:undefined;_0x4cee5a[_0xc207('0x14')][_0x4fd753]=new Action(_0x24338a,_0x581d54,_0x4fd753,_0x1756eb,_0x552239);var _0x1e2238=_0x4cee5a[_0xc207('0x14')][_0x4fd753];_0x1e2238['unlockAgent']=_0x3e0480;_0x1e2238[_0xc207('0xae')]=_0x533e84;_0x1e2238[_0xc207('0x108')]=_0x1756eb;if(_[_0xc207('0x109')](_0x40b692)){_0x4cee5a[_0xc207('0x10a')](_0x1e2238,_0x581d54,_0x24338a,_0x1756eb)[_0xc207('0x86')](function(_0x3dcc0e){logger[_0xc207('0x5c')](_0xc207('0x10b'),'Queue:\x20'+_0x1e2238[_0xc207('0x73')]+'\x20IdHopper:\x20'+_0x1e2238[_0xc207('0xb1')],JSON[_0xc207('0x5a')](_0x3dcc0e));ami[_0xc207('0x23')]('custom:agentcalled',ut[_0xc207('0xa2')](_0x1e2238,_0xc207('0x10c'),_0x4cee5a['campaignsPreview'][_0x1e2238['queue']]));_0x11f4e1(ut['message'](_0xc207('0x10d')));})[_0xc207('0x7b')](function(_0x32947f){ut[_0xc207('0x61')](_0xc207('0x10e'),_0x32947f);_0x1f9a6d(ut[_0xc207('0x4e')](_0xc207('0x10f'),_0x3e0480,_0x533e84));});}else{_0x581d54[_0xc207('0x38')]+=0x1;ut[_0xc207('0x110')](_0x1e2238);rpcDb[_0xc207('0x111')](_0x1e2238,_0xc207('0x112'));delete _0x4cee5a[_0xc207('0x14')][_0x4fd753];_0x1f9a6d(ut[_0xc207('0x4e')](_0xc207('0x113'),_0x3e0480,_0x533e84));}});};Preview[_0xc207('0xe')][_0xc207('0x9b')]=function(_0xaebd6f){return!_[_0xc207('0x70')](_0xaebd6f)&&!_[_0xc207('0x70')](_0xaebd6f[_0xc207('0x59')])&&!_['isNil'](_0xaebd6f[_0xc207('0x56')])&&_0xaebd6f[_0xc207('0x56')]&&!_[_0xc207('0x70')](this['trunks'][util[_0xc207('0x5b')]('SIP/%s',_0xaebd6f[_0xc207('0x59')])])&&!_[_0xc207('0x70')](this[_0xc207('0x13')][util[_0xc207('0x5b')](_0xc207('0x114'),_0xaebd6f['name'])][_0xc207('0x115')])&&(this[_0xc207('0x13')][util[_0xc207('0x5b')](_0xc207('0x114'),_0xaebd6f['name'])]['status']===_0xc207('0x116')||this[_0xc207('0x13')][util[_0xc207('0x5b')](_0xc207('0x114'),_0xaebd6f[_0xc207('0x59')])][_0xc207('0x115')]===_0xc207('0x117'));};Preview[_0xc207('0xe')][_0xc207('0x118')]=function(_0x370e6b,_0xc25d88){var _0x474d33=this;return new BPromise(function(_0x2d7130,_0x101510){_0x474d33['execRun'](_0x370e6b,_0xc25d88)['then'](function(_0x172d6d){_0x2d7130(_[_0xc207('0x77')](_0x172d6d,[_0xc207('0x4e')]));})[_0xc207('0x7b')](function(_0x407819){if(_0x407819[_0xc207('0x119')]){rpcDb['unlockContact'](_0x370e6b);}if(_0x407819['active']){rpcDb['disableContact'](_0x370e6b);}_0x101510(_['pick'](_0x407819,[_0xc207('0x4e')]));});});};Preview['prototype'][_0xc207('0x11a')]=function(_0x36f913,_0x217a60){var _0x32b03f=this;return new BPromise(function(_0x2b3c50,_0x2fff10){var _0x896bba,_0x46dbdb;rpcDb[_0xc207('0x11b')](_0x36f913)['then'](function(_0x49a49c){if(!_[_0xc207('0x70')](_0x49a49c[0x0])){_0x46dbdb=_0x49a49c[0x0]['recallme']?![]:!![];_0x896bba=_0x49a49c[0x0][_0xc207('0x11c')]?!![]:![];_0x896bba=_0x217a60?!![]:_0x896bba;}var _0x4b9828=_0x32b03f[_0xc207('0x11d')](_0x49a49c);if(_0x4b9828[_0xc207('0x11e')]){rpcDb[_0xc207('0x11f')](_[_0xc207('0x77')](_0x49a49c[0x0],['VoiceQueueId','phone']))[_0xc207('0x86')](function(_0x391a3c){_0x32b03f['checkInBlack'](_0x391a3c,_0x49a49c[0x0],_0x217a60,_0x46dbdb,_0x896bba)[_0xc207('0x86')](function(_0x2158c8){_0x2b3c50(_0x2158c8);})[_0xc207('0x7b')](function(_0x51b38b){_0x2fff10(_0x51b38b);});})[_0xc207('0x7b')](function(_0x1a4916){ut[_0xc207('0x61')](_0xc207('0x120'),_0x1a4916);_0x2fff10(ut['message'](_0xc207('0x121'),_0x46dbdb,_0x896bba));});}else{_0x2fff10(ut[_0xc207('0x4e')](_0x4b9828[_0xc207('0x4e')],_0x46dbdb,_0x896bba));}})[_0xc207('0x7b')](function(_0x199b24){ut['logger'](_0xc207('0x122'),_0x199b24);_0x2fff10(ut[_0xc207('0x4e')](_0xc207('0x121'),![],!![]));});});};Preview[_0xc207('0xe')]['validateContact']=function(_0x31c419){if(_['isNil'](_0x31c419)||_[_0xc207('0x109')](_0x31c419)||!_[_0xc207('0x70')](_0x31c419[0x0]['Agent'])&&_[_0xc207('0x70')](_0x31c419[0x0][_0xc207('0x8a')][_0xc207('0x59')])){ut['logger'](_0xc207('0x123'),_0x31c419);return{'isValid':![],'message':_0xc207('0x124')};}var _0x5d7fb4=this['campaignsPreview'][_0x31c419[0x0]['Queue']['name']];_0x5d7fb4[_0xc207('0x4e')]=_0xc207('0x9d');if(_[_0xc207('0x70')](_0x5d7fb4)){ut['logger']('[Preview][validateContact][Empty\x20Campaign]',_0x5d7fb4);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xc207('0x9b')](_0x5d7fb4['Trunk'])){ut[_0xc207('0x61')](_0xc207('0x125'),_0xc207('0x126')+_0x5d7fb4['name']+_0xc207('0x127'));if(!this[_0xc207('0x9b')](_0x5d7fb4[_0xc207('0x128')])){ut[_0xc207('0x61')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x5d7fb4[_0xc207('0x59')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0xc207('0x9a')](_0x5d7fb4[_0xc207('0x6b')])){ut[_0xc207('0x61')](_0xc207('0x129'),_0x5d7fb4[_0xc207('0x59')]+_0xc207('0x12a'));return{'isValid':![],'message':_0xc207('0x126')+_0x5d7fb4[_0xc207('0x59')]+_0xc207('0x12a')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0xc207('0xe')]['execCall']=function(_0x4252c4,_0x50bfed,_0x18c08b,_0x444b35){var _0x121fd8=this;return new BPromise(function(_0x3334a2,_0x3a48c1){var _0x3be7b1=_0x4252c4[_0xc207('0xb5')];var _0x2d0941=_0x121fd8['isTrunkReachable'](_0x50bfed['Trunk'])?util[_0xc207('0x5b')]('SIP/%s/%s%s',_0x50bfed[_0xc207('0x55')]['name'],_[_0xc207('0x70')](_0x50bfed[_0xc207('0x35')])?'':_0x50bfed['dialPrefix'][_0xc207('0x12b')]()||'',_0x50bfed[_0xc207('0x12c')]>0x0?_0x18c08b['phone'][_0xc207('0x12d')](_0x50bfed[_0xc207('0x12c')]):_0x18c08b['phone']):util[_0xc207('0x5b')]('SIP/%s/%s%s',_[_0xc207('0x70')](_0x50bfed[_0xc207('0x128')])?_0x50bfed[_0xc207('0x55')]['name']:_0x50bfed[_0xc207('0x128')][_0xc207('0x59')],_[_0xc207('0x70')](_0x50bfed[_0xc207('0x35')])?'':_0x50bfed[_0xc207('0x35')]['trim']()||'',_0x50bfed[_0xc207('0x12c')]>0x0?_0x18c08b['phone'][_0xc207('0x12d')](_0x50bfed['dialCutDigit']):_0x18c08b[_0xc207('0x106')]);var _0x3ee952=_0x121fd8[_0xc207('0x9b')](_0x50bfed[_0xc207('0x55')])?ut[_0xc207('0x12e')](_0x50bfed['Trunk'][_0xc207('0x57')],_0x50bfed['dialOriginateCallerIdName'],_0x50bfed['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x50bfed[_0xc207('0x12f')],_0x50bfed[_0xc207('0x130')]):_0x50bfed[_0xc207('0x12f')]):ut[_0xc207('0x12e')](_[_0xc207('0x70')](_0x50bfed[_0xc207('0x128')])?_0x50bfed['Trunk'][_0xc207('0x57')]:_0x50bfed[_0xc207('0x128')][_0xc207('0x57')],_0x50bfed[_0xc207('0x131')],_0x50bfed[_0xc207('0x130')]>0x0?ut[_0xc207('0x132')](_0x50bfed[_0xc207('0x12f')],_0x50bfed['dialRandomLastDigitCallerIdNumber']):_0x50bfed['dialOriginateCallerIdNumber']);if(_0x3ee952){_0x4252c4['originatecalleridname']=ut['extractCalleridName'](_0x3ee952);_0x4252c4[_0xc207('0x133')]=ut['extractCalleridNumber'](_0x3ee952);}var _0x1be191=ut['addVariables'](_0x50bfed,_0x18c08b,_0x2d0941,_0x3ee952,_0x3be7b1,_0x4252c4);_['merge'](_0x4252c4,ut[_0xc207('0x134')](_0x1be191));_0x4252c4['starttime']=moment()[_0xc207('0x5b')](_0xc207('0x90'));ami[_0xc207('0x135')](ut[_0xc207('0x136')](_0x4252c4,_0x50bfed,_0x1be191,_0x4252c4[_0xc207('0xae')],_0x444b35))[_0xc207('0x86')](function(_0x2dd537){_0x50bfed[_0xc207('0x4f')]+=0x1;logger['info'](_0xc207('0x137'),_0x3be7b1,_0xc207('0xb6'),_0x50bfed[_0xc207('0x59')],'originated:\x20',_0x50bfed[_0xc207('0x4f')]);_0x3334a2(_0x2dd537);})[_0xc207('0x7b')](function(_0x6f0d50){ut['logAgent'](_0x4252c4,0xe,_0xc207('0x138'));rpcDb[_0xc207('0xf9')](_0x4252c4,_0xc207('0x139'));_0x3a48c1(_0x6f0d50);});});};Preview[_0xc207('0xe')]['syncNewExten']=function(_0x2f1069){if(this['actions'][_0x2f1069[_0xc207('0xaf')]]){this[_0xc207('0x14')][_0x2f1069['linkedid']][_0xc207('0x7a')]=_0x2f1069[_0xc207('0x7a')];}};Preview[_0xc207('0xe')][_0xc207('0x17')]=function(_0x267ec0){var _0x3a1b5f=this;var _0xa49cc6=this[_0xc207('0x14')][_0x267ec0[_0xc207('0x13a')]];if(_0xa49cc6){if(_0xa49cc6['lookAgent']&&this[_0xc207('0x15')][_0xa49cc6['lookAgent']]){ut[_0xc207('0x13b')](_0xa49cc6,this[_0xc207('0x15')][_0xa49cc6[_0xc207('0x108')]][_0xc207('0x59')],this[_0xc207('0x15')][_0xa49cc6[_0xc207('0x108')]]['id']);}var _0x28193e=_[_0xc207('0x13c')](_0xa49cc6);_0x28193e[_0xc207('0xb3')]=moment()['format'](_0xc207('0x90'));var _0x2212a0=_0x3a1b5f[_0xc207('0x11')][_0xa49cc6[_0xc207('0x73')]];if(ut[_0xc207('0x13d')](_0x267ec0[_0xc207('0x13e')])){if(_0xa49cc6['unlockAgent']){rpcDb[_0xc207('0x13f')](_0xa49cc6[_0xc207('0xb1')]);}if(_0xa49cc6['activeContact']){rpcDb[_0xc207('0x8e')](_0xa49cc6[_0xc207('0xb1')]);}ami[_0xc207('0x23')](_0xc207('0x140'),ut[_0xc207('0xa2')](_0xa49cc6,_0xc207('0x141'),this[_0xc207('0x11')][_0xa49cc6['queue']]));this[_0xc207('0x142')](_0x28193e,_0x2212a0,_0x267ec0);}else{_0xa49cc6['starttime']=moment()[_0xc207('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x28193e,0x4,_0xc207('0xbe'));rpcDb[_0xc207('0xf9')](_0x28193e,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype']['syncHangup']=function(_0x5f4e49){var _0x501053=this;var _0x46ba65=this[_0xc207('0x14')][_0x5f4e49[_0xc207('0xaf')]];var _0x306201;if(_0x46ba65){_0x306201=this[_0xc207('0x11')][_0x46ba65[_0xc207('0x73')]];logger[_0xc207('0x5c')](_0xc207('0x143'),_0x5f4e49[_0xc207('0xaf')],_0xc207('0xb6'),_0x306201['name'],_0xc207('0x75'),_0x306201[_0xc207('0x29')]);}if(this[_0xc207('0x14')][_0x5f4e49[_0xc207('0xaf')]]&&_0x5f4e49['linkedid']!==_0x5f4e49['uniqueid']){if(_0x5f4e49[_0xc207('0x144')]==='16'&&this[_0xc207('0x14')][_0x5f4e49[_0xc207('0xaf')]][_0xc207('0x76')]){this[_0xc207('0x9e')](_0x5f4e49,_0x5f4e49[_0xc207('0xaf')],_0x5f4e49[_0xc207('0x144')]);}else if(this[_0xc207('0x14')][_0x5f4e49[_0xc207('0xaf')]][_0xc207('0x76')]){logger[_0xc207('0x5c')](_0xc207('0x145'),_0x5f4e49['linkedid'],_0x5f4e49[_0xc207('0x144')],_0xc207('0xb6'),_0x306201[_0xc207('0x59')],'pTalking:\x20',_0x306201[_0xc207('0x29')]);this[_0xc207('0x9e')](_0x5f4e49,_0x5f4e49['linkedid'],_0x5f4e49['cause']);}}else if(_0x46ba65&&_[_0xc207('0x70')](_0x46ba65[_0xc207('0x146')])&&_0x306201[_0xc207('0x147')]&&_0x5f4e49[_0xc207('0xaf')]===_0x5f4e49[_0xc207('0xb5')]&&_[_0xc207('0x70')](_0x5f4e49[_0xc207('0xf6')])&&_0x5f4e49['cause']==='16'&&_0x5f4e49[_0xc207('0x148')]==='6'&&_['isUndefined'](_0x46ba65[_0xc207('0x149')])){if(_0x46ba65[_0xc207('0xad')]){rpcDb[_0xc207('0x13f')](_0x46ba65[_0xc207('0xb1')]);}if(_0x46ba65[_0xc207('0xae')]){rpcDb['disableContact'](_0x46ba65[_0xc207('0xb1')]);}_0x5f4e49['reason']='22';this[_0xc207('0x142')](_0x46ba65,_0x306201,_0x5f4e49);}else if(_0x46ba65&&_0x46ba65[_0xc207('0x149')]){if(_0x5f4e49[_0xc207('0x144')]==='16'&&this['actions'][_0x5f4e49['linkedid']][_0xc207('0x76')]){logger[_0xc207('0x5c')](_0xc207('0x14a'),_0x5f4e49[_0xc207('0xaf')],_0x5f4e49['cause'],_0xc207('0xb6'),_0x306201[_0xc207('0x59')],_0xc207('0x75'),_0x306201[_0xc207('0x29')]);this[_0xc207('0x9e')](_0x5f4e49,_0x5f4e49[_0xc207('0xaf')],_0x5f4e49[_0xc207('0x144')]);}else if(this[_0xc207('0x14')][_0x5f4e49[_0xc207('0xaf')]][_0xc207('0x76')]){logger[_0xc207('0x5c')]('[syncHangup][talking][cause]',_0x5f4e49[_0xc207('0xaf')],_0x5f4e49[_0xc207('0x144')],_0xc207('0xb6'),_0x306201[_0xc207('0x59')],_0xc207('0x75'),_0x306201['pTalking']);this[_0xc207('0x9e')](_0x5f4e49,_0x5f4e49['linkedid'],_0x5f4e49[_0xc207('0x144')]);}}};Preview[_0xc207('0xe')][_0xc207('0x1c')]=function(_0x1009a8){if(this[_0xc207('0x14')][_0x1009a8[_0xc207('0xf3')]]&&_0x1009a8['destlinkedid']!==_0x1009a8[_0xc207('0x14b')]){this[_0xc207('0x9e')](_0x1009a8,_0x1009a8['destlinkedid'],_0x1009a8[_0xc207('0xe8')]);}};Preview[_0xc207('0xe')][_0xc207('0x14c')]=function(_0x3b3045){if(this[_0xc207('0x14')][_0x3b3045[_0xc207('0xaf')]]&&_0x3b3045[_0xc207('0xaf')]!==_0x3b3045[_0xc207('0xb5')]&&!this[_0xc207('0x14')][_0x3b3045[_0xc207('0xaf')]][_0xc207('0x76')]){if(_0x3b3045[_0xc207('0x144')]==='1'){this[_0xc207('0x9e')](_0x3b3045,_0x3b3045['linkedid'],_0x3b3045[_0xc207('0x144')]);}}};Preview[_0xc207('0xe')]['addVariable']=function(_0x31e461,_0x31e79a,_0x65304b){if(this[_0xc207('0x14')][_0x31e461]){if(_[_0xc207('0x70')](this['actions'][_0x31e461][_0xc207('0x14d')])){this['actions'][_0x31e461][_0xc207('0x14d')]={};}this[_0xc207('0x14')][_0x31e461]['variables'][_0x31e79a]=_0x65304b;}};Preview[_0xc207('0xe')]['syncVarSet']=function(_0x383360){try{if(!_['isNil'](_0x383360)){if(ut[_0xc207('0x14e')](_[_0xc207('0x14f')](_0x383360[_0xc207('0x150')])[0x0])){this[_0xc207('0x151')](_0x383360[_0xc207('0xb5')],_[_0xc207('0x14f')](_0x383360[_0xc207('0x150')])[0x0],_0x383360[_0xc207('0x152')]);}}}catch(_0x4f3dc3){logger[_0xc207('0x153')](_0xc207('0x154'),util[_0xc207('0x155')](_0x4f3dc3,{'showHidden':![],'depth':null}));}};Preview[_0xc207('0xe')][_0xc207('0x1f')]=function(_0x478c39){if(_0x478c39){if(this[_0xc207('0x14')][_0x478c39[_0xc207('0x156')]]){this['actions'][_0x478c39[_0xc207('0x156')]][_0xc207('0x149')]=!![];}}};Preview[_0xc207('0xe')][_0xc207('0x21')]=function(_0x172161){if(_0x172161){if(this[_0xc207('0x14')][_0x172161[_0xc207('0x157')]]){this[_0xc207('0x14')][_0x172161[_0xc207('0x157')]][_0xc207('0x149')]=!![];}}};module['exports']=Preview;
\ No newline at end of file
index 90b866e..8649b44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb95c=['createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','membername','from-sip','exten','xcally-motion-preview','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','inspect','resolve','then','createHistory','catch','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20'];(function(_0x3b6baf,_0x158315){var _0x1e244b=function(_0x241353){while(--_0x241353){_0x3b6baf['push'](_0x3b6baf['shift']());}};_0x1e244b(++_0x158315);}(_0xb95c,0x16f));var _0xcb95=function(_0x41dd48,_0x17874b){_0x41dd48=_0x41dd48-0x0;var _0xc79df5=_0xb95c[_0x41dd48];return _0xc79df5;};'use strict';var util=require(_0xcb95('0x0'));var BPromise=require(_0xcb95('0x1'));var logger=require('../../../config/logger')('preview');var _=require(_0xcb95('0x2'));var cmHopper=require(_0xcb95('0x3'));var cmHopperFinal=require(_0xcb95('0x4'));var cmHopperHistory=require(_0xcb95('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xcb95('0x6'));var agentReportPreview=require(_0xcb95('0x7'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x506e96){return function(_0x80286c){logger['error'](_0x506e96,util[_0xcb95('0x8')](_0x80286c,{'showHidden':![],'depth':null}));};}function create(_0x8aa472){return BPromise[_0xcb95('0x9')]()[_0xcb95('0xa')](cmHopperHistory[_0xcb95('0xb')](_0x8aa472))[_0xcb95('0xc')](loggerCatch(_0xcb95('0xd')));}function createAgent(_0x4d36de){return BPromise['resolve']()['then'](agentReportPreview[_0xcb95('0xb')](_0x4d36de))['catch'](loggerCatch(_0xcb95('0xd')));}function moveContact(_0x55e74e){return BPromise[_0xcb95('0x9')]()[_0xcb95('0xa')](cmHopper['moveContactManagedDialer'](_0x55e74e,!![]))[_0xcb95('0xc')](loggerCatch(_0xcb95('0xe')));}exports[_0xcb95('0xf')]=function(_0x279849){return BPromise[_0xcb95('0x9')]()[_0xcb95('0xa')](cmHopperBlack[_0xcb95('0xf')](_0x279849))[_0xcb95('0xc')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xcb95('0x10')]=function(_0x20500c){return BPromise[_0xcb95('0x9')]()['then'](cmHopper['getContactPreview'](_0x20500c))[_0xcb95('0xc')](loggerCatch(_0xcb95('0x11')));};exports[_0xcb95('0xb')]=function(_0x46eb65,_0x5e2ff1){create(_0x46eb65)[_0xcb95('0xc')](loggerCatch(_0x5e2ff1));moveContact(_0x46eb65)[_0xcb95('0xc')](loggerCatch(_0x5e2ff1));};exports[_0xcb95('0x12')]=function(_0x13e2bb,_0x4bad0d){createAgent(_0x13e2bb)[_0xcb95('0xc')](loggerCatch(_0x4bad0d));};exports[_0xcb95('0x13')]=function(_0x3accfb,_0x4e88a0){create(_0x3accfb)[_0xcb95('0xc')](loggerCatch(_0x4e88a0));};exports[_0xcb95('0x14')]=function(_0x1e843c,_0x42ba4f){moveContact(_0x1e843c)['catch'](loggerCatch(_0x42ba4f));};exports[_0xcb95('0x15')]=function(_0x596cd6,_0x3f128d,_0x102090){if(_0x3f128d){_0x596cd6[_0xcb95('0x16')]=null;}if(_0x102090){_0x596cd6[_0xcb95('0x17')]=![];}return BPromise[_0xcb95('0x9')]()[_0xcb95('0xa')](cmHopper[_0xcb95('0x15')](_0x596cd6))[_0xcb95('0xc')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xcb95('0x18')]=function(_0x17819b){return BPromise[_0xcb95('0x9')]()[_0xcb95('0xa')](cmHopper[_0xcb95('0x18')](_0x17819b))[_0xcb95('0xc')](loggerCatch(_0xcb95('0x19')));};exports[_0xcb95('0x1a')]=function(_0x18bfd1){return BPromise[_0xcb95('0x9')]()[_0xcb95('0xa')](cmHopper[_0xcb95('0x1a')]({'UserId':null},_0x18bfd1,0x1))[_0xcb95('0xc')](loggerCatch('[unlockContact]\x20'));};exports[_0xcb95('0x1b')]=function(_0x172efb){return BPromise[_0xcb95('0x9')]()[_0xcb95('0xa')](cmHopper[_0xcb95('0x1a')]({'active':![]},_0x172efb,0x1))[_0xcb95('0xc')](loggerCatch(_0xcb95('0x1c')));};exports[_0xcb95('0x1d')]=function(_0x4df0a3){var _0x4808d2={};_0x4808d2[_0xcb95('0x1e')]=_0x4df0a3['type'];_0x4808d2[_0xcb95('0x1f')]=_0x4df0a3[_0xcb95('0x1f')];_0x4808d2[_0xcb95('0x20')]=_0x4df0a3['calleridnum'];_0x4808d2[_0xcb95('0x21')]=_0x4df0a3['calleridname'];_0x4808d2[_0xcb95('0x22')]=_0x4df0a3['queue'];_0x4808d2[_0xcb95('0x23')]=_0x4df0a3[_0xcb95('0x24')];_0x4808d2[_0xcb95('0x25')]=_0x4df0a3['answertime'];_0x4808d2[_0xcb95('0x26')]=0x1;_0x4808d2[_0xcb95('0x27')]=_0x4df0a3[_0xcb95('0x28')];_0x4808d2['connectedlinename']=_0x4df0a3[_0xcb95('0x29')];_0x4808d2['context']=_0xcb95('0x2a');_0x4808d2[_0xcb95('0x2b')]=_0xcb95('0x2c');_0x4808d2[_0xcb95('0x2d')]=0x0;_0x4808d2['assigned']=0x1;_0x4808d2[_0xcb95('0x2e')]=_0x4df0a3[_0xcb95('0x29')];_0x4808d2[_0xcb95('0x2f')]=_0xcb95('0x30');return BPromise[_0xcb95('0x9')]()['then'](voiceQueueReport[_0xcb95('0x31')](_0x4808d2))['catch'](loggerCatch(_0xcb95('0x32')));};exports[_0xcb95('0x33')]=function(_0x103fa4,_0x2eeb80){return BPromise['resolve']()['then'](cmHopper[_0xcb95('0x33')](_0x103fa4,_0x2eeb80))[_0xcb95('0xc')](loggerCatch(_0xcb95('0x34')));};exports[_0xcb95('0x35')]=function(_0x2e7b86){return BPromise[_0xcb95('0x9')]()['then'](cmHopper[_0xcb95('0x15')](_0x2e7b86,!![],!![]))[_0xcb95('0xc')](loggerCatch(_0xcb95('0x36')));};
\ No newline at end of file
+var _0x7732=['queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','context','from-sip','exten','xcally-motion-preview','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','calleridnum','calleridname','queue','queuecallerjoinAt','answertime'];(function(_0x234020,_0x5ccf3a){var _0x24b887=function(_0x209625){while(--_0x209625){_0x234020['push'](_0x234020['shift']());}};_0x24b887(++_0x5ccf3a);}(_0x7732,0xc0));var _0x2773=function(_0x4fc80b,_0xfe1b3d){_0x4fc80b=_0x4fc80b-0x0;var _0x119dba=_0x7732[_0x4fc80b];return _0x119dba;};'use strict';var util=require(_0x2773('0x0'));var BPromise=require(_0x2773('0x1'));var logger=require(_0x2773('0x2'))(_0x2773('0x3'));var _=require(_0x2773('0x4'));var cmHopper=require(_0x2773('0x5'));var cmHopperFinal=require(_0x2773('0x6'));var cmHopperHistory=require(_0x2773('0x7'));var cmHopperBlack=require(_0x2773('0x8'));var voiceQueueRt=require(_0x2773('0x9'));var agentReportPreview=require(_0x2773('0xa'));var voiceQueueReport=require(_0x2773('0xb'));function loggerCatch(_0x621c03){return function(_0x74ddf6){logger[_0x2773('0xc')](_0x621c03,util['inspect'](_0x74ddf6,{'showHidden':![],'depth':null}));};}function create(_0x2bbaf2){return BPromise[_0x2773('0xd')]()[_0x2773('0xe')](cmHopperHistory[_0x2773('0xf')](_0x2bbaf2))[_0x2773('0x10')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x330ebf){return BPromise['resolve']()[_0x2773('0xe')](agentReportPreview['createHistory'](_0x330ebf))[_0x2773('0x10')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x20b3e8){return BPromise['resolve']()[_0x2773('0xe')](cmHopper[_0x2773('0x11')](_0x20b3e8,!![]))[_0x2773('0x10')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x2773('0x12')]=function(_0xe95b0a){return BPromise[_0x2773('0xd')]()['then'](cmHopperBlack[_0x2773('0x12')](_0xe95b0a))[_0x2773('0x10')](loggerCatch(_0x2773('0x13')));};exports[_0x2773('0x14')]=function(_0x2ed91f){return BPromise[_0x2773('0xd')]()[_0x2773('0xe')](cmHopper[_0x2773('0x14')](_0x2ed91f))['catch'](loggerCatch('[getContactPreview]\x20'));};exports[_0x2773('0xf')]=function(_0x43dac5,_0x24fda7){create(_0x43dac5)['catch'](loggerCatch(_0x24fda7));moveContact(_0x43dac5)[_0x2773('0x10')](loggerCatch(_0x24fda7));};exports[_0x2773('0x15')]=function(_0x170c9d,_0x55c2b6){createAgent(_0x170c9d)['catch'](loggerCatch(_0x55c2b6));};exports[_0x2773('0x16')]=function(_0x51ee89,_0x3115fd){create(_0x51ee89)['catch'](loggerCatch(_0x3115fd));};exports[_0x2773('0x17')]=function(_0x3d7a00,_0xdbcc81){moveContact(_0x3d7a00)[_0x2773('0x10')](loggerCatch(_0xdbcc81));};exports[_0x2773('0x18')]=function(_0x50adbc,_0x4af8c6,_0x138227){if(_0x4af8c6){_0x50adbc[_0x2773('0x19')]=null;}if(_0x138227){_0x50adbc[_0x2773('0x1a')]=![];}return BPromise[_0x2773('0xd')]()['then'](cmHopper[_0x2773('0x18')](_0x50adbc))[_0x2773('0x10')](loggerCatch(_0x2773('0x1b')));};exports[_0x2773('0x1c')]=function(_0x28d384){return BPromise[_0x2773('0xd')]()['then'](cmHopper[_0x2773('0x1c')](_0x28d384))['catch'](loggerCatch(_0x2773('0x1d')));};exports[_0x2773('0x1e')]=function(_0x241401){return BPromise['resolve']()[_0x2773('0xe')](cmHopper['unlockContact']({'UserId':null},_0x241401,0x1))['catch'](loggerCatch(_0x2773('0x1f')));};exports[_0x2773('0x20')]=function(_0x3dcf31){return BPromise[_0x2773('0xd')]()[_0x2773('0xe')](cmHopper[_0x2773('0x1e')]({'active':![]},_0x3dcf31,0x1))[_0x2773('0x10')](loggerCatch(_0x2773('0x21')));};exports['crateCustomerReportQueue']=function(_0x118728){var _0xf82c48={};_0xf82c48[_0x2773('0x22')]=_0x118728[_0x2773('0x22')];_0xf82c48['uniqueid']=_0x118728['uniqueid'];_0xf82c48['calleridnum']=_0x118728[_0x2773('0x23')];_0xf82c48[_0x2773('0x24')]=_0x118728[_0x2773('0x24')];_0xf82c48['queue']=_0x118728[_0x2773('0x25')];_0xf82c48[_0x2773('0x26')]=_0x118728[_0x2773('0x27')];_0xf82c48[_0x2773('0x28')]=_0x118728[_0x2773('0x27')];_0xf82c48[_0x2773('0x29')]=0x1;_0xf82c48['queuecallercompleteAt']=_0x118728[_0x2773('0x2a')];_0xf82c48[_0x2773('0x2b')]=_0x118728['membername'];_0xf82c48[_0x2773('0x2c')]=_0x2773('0x2d');_0xf82c48[_0x2773('0x2e')]=_0x2773('0x2f');_0xf82c48['holdtime']=0x0;_0xf82c48[_0x2773('0x30')]=0x1;_0xf82c48[_0x2773('0x31')]=_0x118728[_0x2773('0x32')];_0xf82c48[_0x2773('0x33')]=_0x2773('0x34');return BPromise['resolve']()[_0x2773('0xe')](voiceQueueReport[_0x2773('0x35')](_0xf82c48))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0xcacda8,_0x5f4dfd){return BPromise['resolve']()['then'](cmHopper[_0x2773('0x36')](_0xcacda8,_0x5f4dfd))[_0x2773('0x10')](loggerCatch(_0x2773('0x37')));};exports[_0x2773('0x38')]=function(_0x517198){return BPromise[_0x2773('0xd')]()[_0x2773('0xe')](cmHopper[_0x2773('0x18')](_0x517198,!![],!![]))[_0x2773('0x10')](loggerCatch(_0x2773('0x39')));};
\ No newline at end of file
index eb00eb1..25a1271 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20d2=['countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','preview','env','127.0.0.1','diff','loggerCatch','error','inspect','logger','info','loggerError','logger2','getCallerId','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','addVariables','Queue','calleridnum','ContactId','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','toUpper','toLowerVariables','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','Blacklist','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','ringtime','starttime','logLookAgent','membername','UserId','logCustomer','talktime','answertime','variablesAction','RECALL','calleridname','BOOKED','uniqueid','originate','xcally-motion-preview','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','scheduledat','add','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','name','queue','interface','voice','mandatoryDisposition','buildAcw','channelAgent','status','reachable','push','getDiff','milliseconds','seconds','createBody','CampaignId','idContact','campaigntype','dialAnswer','active'];(function(_0x529c6d,_0x2e7d0e){var _0xfebd71=function(_0x3ff0d3){while(--_0x3ff0d3){_0x529c6d['push'](_0x529c6d['shift']());}};_0xfebd71(++_0x2e7d0e);}(_0x20d2,0x1c1));var _0x220d=function(_0x5b29f7,_0x335b71){_0x5b29f7=_0x5b29f7-0x0;var _0x47d235=_0x20d2[_0x5b29f7];return _0x47d235;};'use strict';var util=require(_0x220d('0x0'));var _=require(_0x220d('0x1'));var moment=require(_0x220d('0x2'));var logger=require('../../../../config/logger')(_0x220d('0x3'));var ipAgi=process[_0x220d('0x4')]['XCALLY_IP_AGI']||_0x220d('0x5');function getSeconds(_0x3e97d5,_0x53d8c9){var _0x4d5da7=moment(_0x3e97d5)['milliseconds'](0x0);var _0x424c9a=moment(_0x53d8c9)['milliseconds'](0x0);return _0x4d5da7[_0x220d('0x6')](_0x424c9a,'seconds');}exports[_0x220d('0x7')]=function(_0x1f1154){return function(_0x67b820){logger[_0x220d('0x8')](_0x1f1154,util[_0x220d('0x9')](_0x67b820,{'showHidden':![],'depth':null}));};};exports[_0x220d('0xa')]=function(_0x2a1954,_0x4de5b9){logger[_0x220d('0xb')](_0x2a1954,util['inspect'](_0x4de5b9,{'showHidden':![],'depth':null}));};exports[_0x220d('0xc')]=function(_0x3980d0,_0x387172){logger[_0x220d('0x8')](_0x3980d0,util[_0x220d('0x9')](_0x387172,{'showHidden':![],'depth':null}));};exports[_0x220d('0xd')]=function(_0x1de0b6){return function(_0x28193a){logger[_0x220d('0xb')](_0x1de0b6,util[_0x220d('0x9')](_0x28193a,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x2f6cc4,_0x55e46b,_0x753a7f){return{'message':_0x2f6cc4,'unlock':_0x55e46b,'active':_0x753a7f};};exports[_0x220d('0xe')]=function(_0x58736d,_0x546ef6,_0x23ab85){if(!_['isUndefined'](_0x23ab85)&&'string'===typeof _0x23ab85&&!_[_0x220d('0xf')](_0x23ab85)){if(!_['isUndefined'](_0x546ef6)&&_0x220d('0x10')===typeof _0x546ef6&&!_[_0x220d('0xf')](_0x546ef6)){return util[_0x220d('0x11')](_0x220d('0x12'),_0x546ef6,_0x23ab85);}return util['format'](_0x220d('0x12'),_0x23ab85,_0x23ab85);}if(!_['isUndefined'](_0x58736d)&&_0x220d('0x10')===typeof _0x58736d&&!_[_0x220d('0xf')](_0x58736d)){return _0x58736d;}return _0x220d('0x13');};exports['isActive']=function(_0x5766a2){if(_[_0x220d('0x14')](_0x5766a2)){return![];}return _0x5766a2;};exports[_0x220d('0x15')]=function(_0x290417,_0x131d8d,_0x32a9ed,_0x5bb4d4,_0x4438ff,_0x3795c7){var _0x43b64f={'XMD-QUEUE':_0x131d8d[_0x220d('0x16')]?_0x131d8d[_0x220d('0x16')]['name']:'','XMD-CALLERID':_0x5bb4d4,'XMD-CALLERID-PREVIEW':_0x3795c7?util[_0x220d('0x11')](_0x220d('0x12'),_0x3795c7['calleridname'],_0x3795c7[_0x220d('0x17')]):_0x5bb4d4,'XMD-DIALID':_0x4438ff,'XMD-CONTACTID':_0x131d8d[_0x220d('0x18')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x5bb4d4,'XMD-VOICEQUEUEID':_0x131d8d[_0x220d('0x19')],'XMD-DIALCHANNEL':_0x32a9ed,'XMD-DIALTIMEOUT':_0x290417[_0x220d('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0x220d('0x11')]('\x22rtTxX%s%s\x22',_0x290417[_0x220d('0x1b')]?'g':'',_[_0x220d('0xf')](_0x290417[_0x220d('0x1c')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x290417[_0x220d('0x1d')]||'','XMD-AGI':_0x290417[_0x220d('0x1e')]?util[_0x220d('0x11')](_0x220d('0x1f'),ipAgi,_0x290417[_0x220d('0x1e')]):_0x220d('0x20'),'XMD-AGIAFTER':_0x290417[_0x220d('0x1b')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x290417[_0x220d('0x1b')]):_0x220d('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x3795c7?_0x3795c7[_0x220d('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x3795c7?_0x3795c7['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x220d('0x22')};if(!_[_0x220d('0xf')](_0x290417[_0x220d('0x1c')])){_0x43b64f[util[_0x220d('0x11')]('%s',_0x220d('0x23'))]=_0x290417['monitor_format'];_0x43b64f[util[_0x220d('0x11')]('%s',_0x220d('0x24'))]=_0x4438ff;}if(_0x131d8d&&_0x131d8d[_0x220d('0x25')]){for(var _0x13af73 in _0x131d8d[_0x220d('0x25')]){if(_0x131d8d['Contact'][_0x220d('0x26')](_0x13af73)){if(!_[_0x220d('0x14')](_0x131d8d[_0x220d('0x25')][_0x13af73])&&_0x13af73!=='id'&&_0x13af73!==_0x220d('0x27')&&_0x13af73!==_0x220d('0x28')&&_0x13af73!=='updatedAt'){_0x43b64f[util[_0x220d('0x11')](_0x220d('0x29'),'XMD-',_[_0x220d('0x2a')](_0x13af73))]=_0x131d8d[_0x220d('0x25')][_0x13af73];}}}}return _0x43b64f;};exports[_0x220d('0x2b')]=function(_0x40599d){var _0x492e93={};for(var _0x8ad2c3 in _0x40599d){if(_0x40599d[_0x220d('0x26')](_0x8ad2c3)){_0x492e93[util[_0x220d('0x11')]('%s',_['toLower'](_0x8ad2c3))]=_0x40599d[_0x8ad2c3];}}return{'variables':_0x492e93};};exports['updateOriginated']=function(_0x2f9a1e,_0x4c4a70){if(!_['isNil'](_0x2f9a1e)){if(_0x2f9a1e['hasOwnProperty'](_0x220d('0x2c'))){if(_0x2f9a1e[_0x220d('0x2c')]>0x0){_0x2f9a1e['originated']-=0x1;}else{logger[_0x220d('0x8')](_0x220d('0x2d'),_0x4c4a70);}}}else{logger[_0x220d('0x8')](_0x220d('0x2e'),_0x4c4a70);}};exports[_0x220d('0x2f')]=function(_0xe94f47){var _0x598f1e=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xe94f47['state']=0xd;_0xe94f47['statedesc']=_0x220d('0x30');_0xe94f47['starttime']=_0x598f1e;_0xe94f47[_0x220d('0x31')]=_0x598f1e;_0xe94f47[_0x220d('0x32')]=_0x598f1e;};exports['logAgent']=function(_0x277b39,_0x130d80,_0x1e89f4){var _0x25e0ad=moment()[_0x220d('0x11')](_0x220d('0x33'));_0x277b39[_0x220d('0x34')]=_0x130d80;_0x277b39[_0x220d('0x35')]=_0x1e89f4;_0x277b39[_0x220d('0x31')]=_0x25e0ad;_0x277b39[_0x220d('0x36')]=getSeconds(_0x277b39[_0x220d('0x31')],_0x277b39[_0x220d('0x37')]);};exports[_0x220d('0x38')]=function(_0x439eff,_0x3413a8,_0x2d381f){_0x439eff[_0x220d('0x39')]=_0x3413a8;_0x439eff[_0x220d('0x3a')]=_0x2d381f;};exports[_0x220d('0x3b')]=function(_0x2753db,_0x2e53ad,_0x19c983){var _0x528a9c=moment()[_0x220d('0x11')](_0x220d('0x33'));_0x2753db[_0x220d('0x34')]=_0x2e53ad;_0x2753db[_0x220d('0x35')]=_0x19c983;_0x2753db[_0x220d('0x31')]=_0x2753db[_0x220d('0x31')]?_0x2753db[_0x220d('0x31')]:_0x528a9c;_0x2753db[_0x220d('0x32')]=_0x2753db[_0x220d('0x32')]?_0x2753db['endtime']:_0x528a9c;_0x2753db[_0x220d('0x36')]=getSeconds(_0x2753db[_0x220d('0x31')]||0x0,_0x2753db[_0x220d('0x37')]||0x0);_0x2753db[_0x220d('0x3c')]=_0x2753db['answertime']?getSeconds(_0x2753db[_0x220d('0x32')],_0x2753db[_0x220d('0x3d')]):0x0;};exports['isFailure']=function(_0x3675f4){return _0x3675f4==='Failure';};exports[_0x220d('0x3e')]=function(_0x49b7ca,_0x2cfdc2,_0x353b9f,_0x5d87b3,_0x43a52c){var _0x447933=_0x5d87b3?_0x220d('0x3f'):_0x49b7ca[_0x220d('0x40')];_0x447933=_0x43a52c?_0x220d('0x41'):_0x447933;return{'actionid':_0x49b7ca[_0x220d('0x42')],'action':_0x220d('0x43'),'channel':_0x49b7ca['channelAgent'],'callerid':util[_0x220d('0x11')](_0x220d('0x12'),_0x447933,_0x49b7ca[_0x220d('0x17')]),'Exten':_0x220d('0x44'),'Context':_0x220d('0x45'),'Priority':'1','variable':_0x353b9f,'timeout':(_0x2cfdc2[_0x220d('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x49b7ca['uniqueid']};};exports[_0x220d('0x47')]=function(_0x4f54fc){return _0x4f54fc[_0x220d('0x48')]+_0x4f54fc[_0x220d('0x49')]+_0x4f54fc[_0x220d('0x4a')]+_0x4f54fc[_0x220d('0x4b')]+_0x4f54fc[_0x220d('0x4c')];};exports[_0x220d('0x4d')]=function(_0x5030f5){var _0xc04fcf=_[_0x220d('0x4e')](_0x5030f5);_0xc04fcf['state']=0xf;_0xc04fcf[_0x220d('0x35')]=_0x220d('0x4f');return _0xc04fcf;};exports[_0x220d('0x50')]=function(_0x28e397,_0x1b8c7b,_0x38284a){var _0xb9b433={};_0xb9b433[_0x1b8c7b]=_0x28e397[_0x1b8c7b];_0xb9b433['active']=![];_0xb9b433[_0x220d('0x51')]=moment()[_0x220d('0x52')](_0x38284a,'minutes')[_0x220d('0x11')](_0x220d('0x33'));_0xb9b433[_0x220d('0x18')]=_0x28e397['ContactId'];_0xb9b433[_0x220d('0x53')]=_0x28e397[_0x220d('0x53')];_0xb9b433[_0x220d('0x19')]=_0x28e397[_0x220d('0x19')]||undefined;return _0xb9b433;};exports['decrementTalkink']=function(_0x2ace43,_0xb55ca6){if(!_['isNil'](_0x2ace43)){if(_0x2ace43[_0x220d('0x54')]>0x0){_0x2ace43[_0x220d('0x54')]-=0x1;}else{logger['error'](_0xb55ca6,_0x220d('0x55'));}}else{logger[_0x220d('0x8')](_0xb55ca6,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x220d('0x56')]=function(_0x456efa){if(_0x456efa<=0x0){return!![];}return![];};exports['buildObj']=function(_0x2d8339,_0x380ce8,_0x247bba){_0x2d8339[_0x220d('0x57')]=_0x380ce8;_0x2d8339[_0x220d('0x58')]=_0x2d8339[_0x220d('0x59')];_0x2d8339[_0x220d('0x5a')]=_0x2d8339['channelAgent'];_0x2d8339['motionChannel']=_0x220d('0x5b');if(_0x247bba){_0x2d8339[_0x220d('0x5c')]=_0x247bba[_0x220d('0x5c')];}return _0x2d8339;};exports[_0x220d('0x5d')]=function(_0x32af9a){var _0x5b76e5={};_0x5b76e5['queue']=_0x32af9a['queue'];_0x5b76e5[_0x220d('0x5a')]=_0x32af9a[_0x220d('0x5e')];_0x5b76e5[_0x220d('0x42')]=_0x32af9a[_0x220d('0x42')];return _0x5b76e5;};exports['agentReadyId']=function(_0x36b7f7){var _0x1c15eb=[];for(var _0x2b6fd7 in _0x36b7f7){if(_0x36b7f7[_0x220d('0x26')](_0x2b6fd7)){if(!_[_0x220d('0x14')](_0x36b7f7[_0x2b6fd7])&&_0x36b7f7[_0x2b6fd7]['state']==='not_inuse'&&_0x36b7f7[_0x2b6fd7][_0x220d('0x5f')]===_0x220d('0x60')){_0x1c15eb[_0x220d('0x61')](_0x36b7f7[_0x2b6fd7]['id']);}}}return _0x1c15eb;};exports[_0x220d('0x62')]=function(_0x1bcf52){var _0x2c035a=moment()[_0x220d('0x63')](0x0);var _0x4a3f5d=moment(_0x1bcf52)['milliseconds'](0x0);return _0x2c035a[_0x220d('0x6')](_0x4a3f5d,_0x220d('0x64'));};exports[_0x220d('0x65')]=function(_0x49da84){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x49da84[_0x220d('0x18')],'ListId':_0x49da84[_0x220d('0x53')],'VoiceQueueId':_0x49da84[_0x220d('0x19')]||undefined,'CampaignId':_0x49da84[_0x220d('0x66')]||undefined};};exports['filterKey']=function(_0x5b705b){if(_0x5b705b===_0x220d('0x42')||_0x5b705b===_0x220d('0x67')||_0x5b705b===_0x220d('0x59')||_0x5b705b==='type'||_0x5b705b===_0x220d('0x68')||_0x5b705b===_0x220d('0x69')||_0x5b705b===_0x220d('0x39')||_0x5b705b===_0x220d('0x5e')||_0x5b705b===_0x220d('0x40')||_0x5b705b===_0x220d('0x6a')||_0x5b705b===_0x220d('0x17')||_0x5b705b===_0x220d('0x51')||_0x5b705b===_0x220d('0x48')||_0x5b705b==='countcongestionretry'||_0x5b705b===_0x220d('0x4a')||_0x5b705b===_0x220d('0x6b')||_0x5b705b===_0x220d('0x6c')||_0x5b705b===_0x220d('0x6d')||_0x5b705b===_0x220d('0x6e')||_0x5b705b==='recallme'||_0x5b705b===_0x220d('0x18')||_0x5b705b===_0x220d('0x53')||_0x5b705b===_0x220d('0x3a')||_0x5b705b===_0x220d('0x19')||_0x5b705b===_0x220d('0x6f')||_0x5b705b==='xmd-voicequeueid'||_0x5b705b===_0x220d('0x70')||_0x5b705b===_0x220d('0x71')||_0x5b705b===_0x220d('0x72')||_0x5b705b===_0x220d('0x73')||_0x5b705b===_0x220d('0x74')||_0x5b705b===_0x220d('0x75')||_0x5b705b==='xmd-dialid'||_0x5b705b===_0x220d('0x76')||_0x5b705b==='xmd-contactid'||_0x5b705b===_0x220d('0x77')||_0x5b705b===_0x220d('0x78')||_0x5b705b===_0x220d('0x79')||_0x5b705b==='xmd-agi'||_0x5b705b===_0x220d('0x7a')||_0x5b705b==='rtpaudioqosbridged'||_0x5b705b===_0x220d('0x7b')||_0x5b705b===_0x220d('0x7c')||_0x5b705b===_0x220d('0x7d')||_0x5b705b===_0x220d('0x7e')||_0x5b705b===_0x220d('0x7f')||_0x5b705b===_0x220d('0x80')||_0x5b705b===_0x220d('0x7a')||_0x5b705b===_0x220d('0x81')||_0x5b705b==='rtpaudioqosjitter'||_0x5b705b==='rtpaudioqosjitterbridged'||_0x5b705b===_0x220d('0x7d')||_0x5b705b==='rtpaudioqoslossbridged'||_0x5b705b===_0x220d('0x7f')||_0x5b705b==='rtpaudioqosrttbridged'||_0x5b705b===_0x220d('0x82')||_0x5b705b==='bridgepvtcallid'||_0x5b705b===_0x220d('0x34')||_0x5b705b===_0x220d('0x35')){return![];}return!![];};exports[_0x220d('0x83')]=function(_0x37861b,_0x125a98){var _0x44da97,_0x3fdd05,_0x4ec6be;if(_0x125a98<=0x0){_0x125a98=0x1;}_0x44da97=new RegExp(_0x220d('0x84')+_0x125a98+'}$');_0x3fdd05=Math[_0x220d('0x85')](0xa,_0x125a98-0x1);_0x4ec6be=Math[_0x220d('0x85')](0xa,_0x125a98)-0x1;return util[_0x220d('0x11')]('%s',_[_0x220d('0x86')](_0x37861b,_0x44da97,_[_0x220d('0x87')](_0x3fdd05,_0x4ec6be)));};exports[_0x220d('0x88')]=function(_0x47bf0c){var _0x11f897=_0x47bf0c[_0x220d('0x89')](/"(.*?)"/);return _0x11f897?_0x11f897[0x1]:_0x47bf0c;};exports[_0x220d('0x8a')]=function(_0xd809e5){var _0x250714=_0xd809e5[_0x220d('0x89')](/<(.*?)>/);return _0x250714?_0x250714[0x1]:_0xd809e5;};
\ No newline at end of file
+var _0x2c67=['dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','ringtime','logLookAgent','UserId','logCustomer','endtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','originate','channelAgent','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','active','scheduledat','add','minutes','ContactId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','motionChannel','buildAcw','agentReadyId','not_inuse','status','getDiff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','membername','countcongestionretry','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','extractCalleridNumber','match','util','lodash','moment','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','loggerCatch','error','inspect','logger','info','loggerError','message','getCallerId','isEmpty','format','\x22%s\x22\x20<%s>','isUndefined','isActive','isNil','addVariables','Queue','calleridname','calleridnum','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x2c67,0x101));var _0x72c6=function(_0x20803b,_0x2c0caa){_0x20803b=_0x20803b-0x0;var _0x2fe307=_0x2c67[_0x20803b];return _0x2fe307;};'use strict';var util=require(_0x72c6('0x0'));var _=require(_0x72c6('0x1'));var moment=require(_0x72c6('0x2'));var logger=require('../../../../config/logger')(_0x72c6('0x3'));var ipAgi=process[_0x72c6('0x4')][_0x72c6('0x5')]||_0x72c6('0x6');function getSeconds(_0x359bb5,_0xc4431c){var _0x36a224=moment(_0x359bb5)[_0x72c6('0x7')](0x0);var _0x1f817e=moment(_0xc4431c)[_0x72c6('0x7')](0x0);return _0x36a224[_0x72c6('0x8')](_0x1f817e,'seconds');}exports[_0x72c6('0x9')]=function(_0x2b8409){return function(_0x30021b){logger[_0x72c6('0xa')](_0x2b8409,util[_0x72c6('0xb')](_0x30021b,{'showHidden':![],'depth':null}));};};exports[_0x72c6('0xc')]=function(_0x4ecc42,_0x521084){logger[_0x72c6('0xd')](_0x4ecc42,util[_0x72c6('0xb')](_0x521084,{'showHidden':![],'depth':null}));};exports[_0x72c6('0xe')]=function(_0x36bf40,_0x2dfa3){logger['error'](_0x36bf40,util[_0x72c6('0xb')](_0x2dfa3,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x32cde1){return function(_0x550162){logger['info'](_0x32cde1,util[_0x72c6('0xb')](_0x550162,{'showHidden':![],'depth':null}));};};exports[_0x72c6('0xf')]=function(_0x4a4e48,_0x1673ed,_0x182285){return{'message':_0x4a4e48,'unlock':_0x1673ed,'active':_0x182285};};exports[_0x72c6('0x10')]=function(_0x2caf18,_0x1385e7,_0x1837c9){if(!_['isUndefined'](_0x1837c9)&&'string'===typeof _0x1837c9&&!_[_0x72c6('0x11')](_0x1837c9)){if(!_['isUndefined'](_0x1385e7)&&'string'===typeof _0x1385e7&&!_[_0x72c6('0x11')](_0x1385e7)){return util[_0x72c6('0x12')](_0x72c6('0x13'),_0x1385e7,_0x1837c9);}return util[_0x72c6('0x12')](_0x72c6('0x13'),_0x1837c9,_0x1837c9);}if(!_[_0x72c6('0x14')](_0x2caf18)&&'string'===typeof _0x2caf18&&!_['isEmpty'](_0x2caf18)){return _0x2caf18;}return'\x22\x22\x20<>';};exports[_0x72c6('0x15')]=function(_0x38a293){if(_[_0x72c6('0x16')](_0x38a293)){return![];}return _0x38a293;};exports[_0x72c6('0x17')]=function(_0x552efc,_0x46b3ce,_0x2f352c,_0x15738f,_0x119493,_0x4e6892){var _0x4ed440={'XMD-QUEUE':_0x46b3ce[_0x72c6('0x18')]?_0x46b3ce[_0x72c6('0x18')]['name']:'','XMD-CALLERID':_0x15738f,'XMD-CALLERID-PREVIEW':_0x4e6892?util[_0x72c6('0x12')](_0x72c6('0x13'),_0x4e6892[_0x72c6('0x19')],_0x4e6892[_0x72c6('0x1a')]):_0x15738f,'XMD-DIALID':_0x119493,'XMD-CONTACTID':_0x46b3ce['ContactId'],'XMD-CDRTYPE':_0x72c6('0x1b'),'CALLERID(all)':_0x15738f,'XMD-VOICEQUEUEID':_0x46b3ce[_0x72c6('0x1c')],'XMD-DIALCHANNEL':_0x2f352c,'XMD-DIALTIMEOUT':_0x552efc[_0x72c6('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x72c6('0x12')](_0x72c6('0x1e'),_0x552efc[_0x72c6('0x1f')]?'g':'',_[_0x72c6('0x11')](_0x552efc[_0x72c6('0x20')])?'':_0x72c6('0x21')),'XMD-DIALURL':_0x552efc[_0x72c6('0x22')]||'','XMD-AGI':_0x552efc[_0x72c6('0x23')]?util[_0x72c6('0x12')](_0x72c6('0x24'),ipAgi,_0x552efc[_0x72c6('0x23')]):_0x72c6('0x25'),'XMD-AGIAFTER':_0x552efc['dialQueueProject2']?util['format'](_0x72c6('0x24'),ipAgi,_0x552efc[_0x72c6('0x1f')]):_0x72c6('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x4e6892?_0x4e6892['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x4e6892?_0x4e6892[_0x72c6('0x26')]:'','XMD-DESTINATION':_0x72c6('0x27'),'SIPADDHEADER':_0x72c6('0x28')};if(!_[_0x72c6('0x11')](_0x552efc[_0x72c6('0x20')])){_0x4ed440[util[_0x72c6('0x12')]('%s',_0x72c6('0x29'))]=_0x552efc[_0x72c6('0x20')];_0x4ed440[util[_0x72c6('0x12')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x119493;}if(_0x46b3ce&&_0x46b3ce['Contact']){for(var _0x5ebb92 in _0x46b3ce[_0x72c6('0x2a')]){if(_0x46b3ce[_0x72c6('0x2a')][_0x72c6('0x2b')](_0x5ebb92)){if(!_[_0x72c6('0x16')](_0x46b3ce[_0x72c6('0x2a')][_0x5ebb92])&&_0x5ebb92!=='id'&&_0x5ebb92!=='tags'&&_0x5ebb92!==_0x72c6('0x2c')&&_0x5ebb92!==_0x72c6('0x2d')){_0x4ed440[util[_0x72c6('0x12')](_0x72c6('0x2e'),_0x72c6('0x2f'),_[_0x72c6('0x30')](_0x5ebb92))]=_0x46b3ce[_0x72c6('0x2a')][_0x5ebb92];}}}}return _0x4ed440;};exports[_0x72c6('0x31')]=function(_0x4aecac){var _0x102432={};for(var _0x3b4fc8 in _0x4aecac){if(_0x4aecac[_0x72c6('0x2b')](_0x3b4fc8)){_0x102432[util['format']('%s',_['toLower'](_0x3b4fc8))]=_0x4aecac[_0x3b4fc8];}}return{'variables':_0x102432};};exports[_0x72c6('0x32')]=function(_0x244524,_0x4ef686){if(!_[_0x72c6('0x16')](_0x244524)){if(_0x244524[_0x72c6('0x2b')]('originated')){if(_0x244524[_0x72c6('0x33')]>0x0){_0x244524[_0x72c6('0x33')]-=0x1;}else{logger[_0x72c6('0xa')](_0x72c6('0x34'),_0x4ef686);}}}else{logger['error'](_0x72c6('0x35'),_0x4ef686);}};exports[_0x72c6('0x36')]=function(_0x2d2500){var _0x51a900=moment()[_0x72c6('0x12')](_0x72c6('0x37'));_0x2d2500[_0x72c6('0x38')]=0xd;_0x2d2500[_0x72c6('0x39')]=_0x72c6('0x3a');_0x2d2500[_0x72c6('0x3b')]=_0x51a900;_0x2d2500[_0x72c6('0x3c')]=_0x51a900;_0x2d2500['endtime']=_0x51a900;};exports['logAgent']=function(_0x1aabd2,_0x2cc958,_0x5f036f){var _0x5ceaab=moment()[_0x72c6('0x12')](_0x72c6('0x37'));_0x1aabd2['state']=_0x2cc958;_0x1aabd2[_0x72c6('0x39')]=_0x5f036f;_0x1aabd2['responsetime']=_0x5ceaab;_0x1aabd2[_0x72c6('0x3d')]=getSeconds(_0x1aabd2[_0x72c6('0x3c')],_0x1aabd2[_0x72c6('0x3b')]);};exports[_0x72c6('0x3e')]=function(_0xa573d9,_0x4f7df2,_0x1e7bfc){_0xa573d9['membername']=_0x4f7df2;_0xa573d9[_0x72c6('0x3f')]=_0x1e7bfc;};exports[_0x72c6('0x40')]=function(_0x502238,_0x4492dd,_0x10a11a){var _0x2580ff=moment()[_0x72c6('0x12')](_0x72c6('0x37'));_0x502238[_0x72c6('0x38')]=_0x4492dd;_0x502238[_0x72c6('0x39')]=_0x10a11a;_0x502238['responsetime']=_0x502238[_0x72c6('0x3c')]?_0x502238[_0x72c6('0x3c')]:_0x2580ff;_0x502238[_0x72c6('0x41')]=_0x502238[_0x72c6('0x41')]?_0x502238[_0x72c6('0x41')]:_0x2580ff;_0x502238['ringtime']=getSeconds(_0x502238[_0x72c6('0x3c')]||0x0,_0x502238[_0x72c6('0x3b')]||0x0);_0x502238[_0x72c6('0x42')]=_0x502238[_0x72c6('0x43')]?getSeconds(_0x502238[_0x72c6('0x41')],_0x502238[_0x72c6('0x43')]):0x0;};exports[_0x72c6('0x44')]=function(_0x293e30){return _0x293e30===_0x72c6('0x45');};exports[_0x72c6('0x46')]=function(_0x347890,_0x59ad9d,_0x1a286e,_0xe9b6e6,_0x3dfdd8){var _0x260cd3=_0xe9b6e6?_0x72c6('0x47'):_0x347890[_0x72c6('0x19')];_0x260cd3=_0x3dfdd8?'BOOKED':_0x260cd3;return{'actionid':_0x347890['uniqueid'],'action':_0x72c6('0x48'),'channel':_0x347890[_0x72c6('0x49')],'callerid':util['format'](_0x72c6('0x13'),_0x260cd3,_0x347890[_0x72c6('0x1a')]),'Exten':_0x72c6('0x27'),'Context':_0x72c6('0x4a'),'Priority':'1','variable':_0x1a286e,'timeout':(_0x59ad9d[_0x72c6('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x347890[_0x72c6('0x4c')]};};exports[_0x72c6('0x4d')]=function(_0x2624a3){return _0x2624a3[_0x72c6('0x4e')]+_0x2624a3['countcongestionretry']+_0x2624a3[_0x72c6('0x4f')]+_0x2624a3[_0x72c6('0x50')]+_0x2624a3['countnosuchnumberretry'];};exports[_0x72c6('0x51')]=function(_0x36a425){var _0x574c80=_[_0x72c6('0x52')](_0x36a425);_0x574c80[_0x72c6('0x38')]=0xf;_0x574c80['statedesc']='Global';return _0x574c80;};exports['scheduledAt']=function(_0x5e2499,_0x352b68,_0x5495bb){var _0x36dfc1={};_0x36dfc1[_0x352b68]=_0x5e2499[_0x352b68];_0x36dfc1[_0x72c6('0x53')]=![];_0x36dfc1[_0x72c6('0x54')]=moment()[_0x72c6('0x55')](_0x5495bb,_0x72c6('0x56'))[_0x72c6('0x12')](_0x72c6('0x37'));_0x36dfc1['ContactId']=_0x5e2499[_0x72c6('0x57')];_0x36dfc1['ListId']=_0x5e2499['ListId'];_0x36dfc1[_0x72c6('0x1c')]=_0x5e2499['VoiceQueueId']||undefined;return _0x36dfc1;};exports[_0x72c6('0x58')]=function(_0x5e1ac3,_0x1ccb77){if(!_[_0x72c6('0x16')](_0x5e1ac3)){if(_0x5e1ac3[_0x72c6('0x59')]>0x0){_0x5e1ac3['pTalking']-=0x1;}else{logger[_0x72c6('0xa')](_0x1ccb77,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x72c6('0xa')](_0x1ccb77,_0x72c6('0x5a'));}};exports[_0x72c6('0x5b')]=function(_0x6a2a0f){if(_0x6a2a0f<=0x0){return!![];}return![];};exports[_0x72c6('0x5c')]=function(_0x19e403,_0x149c0d,_0x23e19f){_0x19e403[_0x72c6('0x5d')]=_0x149c0d;_0x19e403['name']=_0x19e403[_0x72c6('0x5e')];_0x19e403[_0x72c6('0x5f')]=_0x19e403[_0x72c6('0x49')];_0x19e403[_0x72c6('0x60')]='voice';if(_0x23e19f){_0x19e403['mandatoryDisposition']=_0x23e19f['mandatoryDisposition'];}return _0x19e403;};exports[_0x72c6('0x61')]=function(_0x2f6496){var _0x5bba93={};_0x5bba93['queue']=_0x2f6496[_0x72c6('0x5e')];_0x5bba93[_0x72c6('0x5f')]=_0x2f6496[_0x72c6('0x49')];_0x5bba93['uniqueid']=_0x2f6496['uniqueid'];return _0x5bba93;};exports[_0x72c6('0x62')]=function(_0x4270ba){var _0x530122=[];for(var _0x2359c6 in _0x4270ba){if(_0x4270ba['hasOwnProperty'](_0x2359c6)){if(!_[_0x72c6('0x16')](_0x4270ba[_0x2359c6])&&_0x4270ba[_0x2359c6]['state']===_0x72c6('0x63')&&_0x4270ba[_0x2359c6][_0x72c6('0x64')]==='reachable'){_0x530122['push'](_0x4270ba[_0x2359c6]['id']);}}}return _0x530122;};exports[_0x72c6('0x65')]=function(_0x5048b9){var _0x235d6e=moment()['milliseconds'](0x0);var _0x2af355=moment(_0x5048b9)['milliseconds'](0x0);return _0x235d6e['diff'](_0x2af355,_0x72c6('0x66'));};exports[_0x72c6('0x67')]=function(_0x5785ad){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5785ad[_0x72c6('0x57')],'ListId':_0x5785ad['ListId'],'VoiceQueueId':_0x5785ad[_0x72c6('0x1c')]||undefined,'CampaignId':_0x5785ad[_0x72c6('0x68')]||undefined};};exports[_0x72c6('0x69')]=function(_0x50d775){if(_0x50d775===_0x72c6('0x4c')||_0x50d775===_0x72c6('0x6a')||_0x50d775===_0x72c6('0x5e')||_0x50d775===_0x72c6('0x6b')||_0x50d775===_0x72c6('0x6c')||_0x50d775==='dialAnswer'||_0x50d775===_0x72c6('0x6d')||_0x50d775===_0x72c6('0x49')||_0x50d775===_0x72c6('0x19')||_0x50d775===_0x72c6('0x53')||_0x50d775==='calleridnum'||_0x50d775===_0x72c6('0x54')||_0x50d775===_0x72c6('0x4e')||_0x50d775===_0x72c6('0x6e')||_0x50d775===_0x72c6('0x4f')||_0x50d775==='countglobal'||_0x50d775===_0x72c6('0x6f')||_0x50d775===_0x72c6('0x70')||_0x50d775===_0x72c6('0x71')||_0x50d775===_0x72c6('0x72')||_0x50d775===_0x72c6('0x57')||_0x50d775==='ListId'||_0x50d775===_0x72c6('0x3f')||_0x50d775===_0x72c6('0x1c')||_0x50d775===_0x72c6('0x73')||_0x50d775===_0x72c6('0x74')||_0x50d775===_0x72c6('0x75')||_0x50d775===_0x72c6('0x76')||_0x50d775===_0x72c6('0x77')||_0x50d775===_0x72c6('0x78')||_0x50d775===_0x72c6('0x79')||_0x50d775===_0x72c6('0x7a')||_0x50d775===_0x72c6('0x7b')||_0x50d775===_0x72c6('0x7c')||_0x50d775===_0x72c6('0x7d')||_0x50d775===_0x72c6('0x7e')||_0x50d775===_0x72c6('0x7f')||_0x50d775===_0x72c6('0x80')||_0x50d775===_0x72c6('0x81')||_0x50d775===_0x72c6('0x82')||_0x50d775==='rtpaudioqosbridged'||_0x50d775===_0x72c6('0x83')||_0x50d775===_0x72c6('0x84')||_0x50d775==='rtpaudioqosloss'||_0x50d775==='rtpaudioqoslossbridged'||_0x50d775===_0x72c6('0x85')||_0x50d775===_0x72c6('0x86')||_0x50d775==='rtpaudioqos'||_0x50d775===_0x72c6('0x87')||_0x50d775===_0x72c6('0x83')||_0x50d775==='rtpaudioqosjitterbridged'||_0x50d775===_0x72c6('0x88')||_0x50d775===_0x72c6('0x89')||_0x50d775===_0x72c6('0x85')||_0x50d775==='rtpaudioqosrttbridged'||_0x50d775==='bridgepeer'||_0x50d775===_0x72c6('0x8a')||_0x50d775==='state'||_0x50d775===_0x72c6('0x39')){return![];}return!![];};exports[_0x72c6('0x8b')]=function(_0x130e25,_0x5c9bde){var _0x57739b,_0x44411b,_0x4aa10c;if(_0x5c9bde<=0x0){_0x5c9bde=0x1;}_0x57739b=new RegExp(_0x72c6('0x8c')+_0x5c9bde+'}$');_0x44411b=Math[_0x72c6('0x8d')](0xa,_0x5c9bde-0x1);_0x4aa10c=Math[_0x72c6('0x8d')](0xa,_0x5c9bde)-0x1;return util['format']('%s',_[_0x72c6('0x8e')](_0x130e25,_0x57739b,_['random'](_0x44411b,_0x4aa10c)));};exports[_0x72c6('0x8f')]=function(_0x2b13ef){var _0x259ed6=_0x2b13ef['match'](/"(.*?)"/);return _0x259ed6?_0x259ed6[0x1]:_0x2b13ef;};exports[_0x72c6('0x90')]=function(_0x174bee){var _0x34f982=_0x174bee[_0x72c6('0x91')](/<(.*?)>/);return _0x34f982?_0x34f982[0x1]:_0x174bee;};
\ No newline at end of file
index 5ddd921..bd7e024 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8134=['queueremove','reload','voicequeuechannel','voicequeuechannelredirect','queueadd','string','number','boolean'];(function(_0x313d03,_0x5aea9d){var _0x249129=function(_0x1524f1){while(--_0x1524f1){_0x313d03['push'](_0x313d03['shift']());}};_0x249129(++_0x5aea9d);}(_0x8134,0x74));var _0x4813=function(_0x13a60c,_0x5429f4){_0x13a60c=_0x13a60c-0x0;var _0x3a7a11=_0x8134[_0x13a60c];return _0x3a7a11;};'use strict';exports[_0x4813('0x0')]={'queue':{'type':_0x4813('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x4813('0x1'),'required':!![]},'penalty':{'type':_0x4813('0x2'),'required':![]},'paused':{'type':_0x4813('0x3'),'required':![]}};exports[_0x4813('0x4')]={'queue':{'type':_0x4813('0x1'),'required':!![]},'interface':{'type':_0x4813('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x4813('0x1'),'required':!![]},'paused':{'type':_0x4813('0x3')},'reason':{'type':_0x4813('0x1'),'required':![]}};exports[_0x4813('0x5')]={'module':{'type':_0x4813('0x1'),'required':![]}};exports[_0x4813('0x6')]={'uniqueid':{'type':_0x4813('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x4813('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':_0x4813('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x4813('0x1'),'required':!![]}};exports[_0x4813('0x7')]={'uniqueid':{'type':_0x4813('0x1'),'required':!![]},'exten':{'type':_0x4813('0x1'),'required':!![]},'context':{'type':'string'}};
\ No newline at end of file
+var _0xc6a6=['queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelredirect','string','number','boolean'];(function(_0x3609dc,_0x37acad){var _0x1d8f16=function(_0x142219){while(--_0x142219){_0x3609dc['push'](_0x3609dc['shift']());}};_0x1d8f16(++_0x37acad);}(_0xc6a6,0x12f));var _0x6c6a=function(_0x4e133b,_0x5b5040){_0x4e133b=_0x4e133b-0x0;var _0x5e5bc1=_0xc6a6[_0x4e133b];return _0x5e5bc1;};'use strict';exports['queueadd']={'queue':{'type':_0x6c6a('0x0'),'required':!![]},'interface':{'type':_0x6c6a('0x0'),'required':!![]},'membername':{'type':_0x6c6a('0x0'),'required':!![]},'penalty':{'type':_0x6c6a('0x1'),'required':![]},'paused':{'type':_0x6c6a('0x2'),'required':![]}};exports[_0x6c6a('0x3')]={'queue':{'type':_0x6c6a('0x0'),'required':!![]},'interface':{'type':_0x6c6a('0x0'),'required':!![]}};exports[_0x6c6a('0x4')]={'interface':{'type':_0x6c6a('0x0'),'required':!![]},'paused':{'type':_0x6c6a('0x2')},'reason':{'type':'string','required':![]}};exports[_0x6c6a('0x5')]={'module':{'type':'string','required':![]}};exports[_0x6c6a('0x6')]={'uniqueid':{'type':_0x6c6a('0x0'),'required':!![]}};exports[_0x6c6a('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x6c6a('0x0')},'format':{'type':_0x6c6a('0x0')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x6c6a('0x0'),'required':!![]}};exports[_0x6c6a('0x8')]={'uniqueid':{'type':_0x6c6a('0x0'),'required':!![]},'exten':{'type':_0x6c6a('0x0'),'required':!![]},'context':{'type':_0x6c6a('0x0')}};
\ No newline at end of file
index 871b42b..fa43476 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e76=['timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','SIP/%s','name','interface','format','total','answered','sumDuration','sumBillable','isEmpty','hasOwnProperty','ivrTotalCallsDays','unmanaged','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isNil','isUndefined','initTelephones','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initZohoAccounts','initDeskAccounts','initVtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallerleaveAt','initVoiceCallReports','outbound','duration','billableseconds','dialQueueProject','SquareProject','initCampaignHopperHistory','initFaxAccounts','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','voiceExtensions','channels','queueChannels','outboundChannels'];(function(_0x42cf3e,_0x50abbe){var _0x184386=function(_0x35abf4){while(--_0x35abf4){_0x42cf3e['push'](_0x42cf3e['shift']());}};_0x184386(++_0x50abbe);}(_0x9e76,0x125));var _0x69e7=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0x9e76[_0x119d5a];return _0x15bff4;};'use strict';var BPromise=require(_0x69e7('0x0'));var util=require(_0x69e7('0x1'));var _=require(_0x69e7('0x2'));var moment=require(_0x69e7('0x3'));var Agent=require(_0x69e7('0x4'));var Telephone=require(_0x69e7('0x5'));var Trunk=require(_0x69e7('0x6'));var VoiceQueue=require(_0x69e7('0x7'));var Trigger=require(_0x69e7('0x8'));var Template=require(_0x69e7('0x9'));var Campaign=require(_0x69e7('0xa'));var VoiceExtension=require(_0x69e7('0xb'));var ZendeskAccount=require(_0x69e7('0xc'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x69e7('0xd'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x69e7('0xe'));var DeskAccount=require(_0x69e7('0xf'));var VtigerAccount=require(_0x69e7('0x10'));var ServicenowAccount=require(_0x69e7('0x11'));var Dynamics365Account=require(_0x69e7('0x12'));var FreshsalesAccount=require(_0x69e7('0x13'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x69e7('0x14')]={};this[_0x69e7('0x15')]={};this[_0x69e7('0x16')]={};this[_0x69e7('0x17')]={};this[_0x69e7('0x18')]={};this[_0x69e7('0x19')]={};this[_0x69e7('0x1a')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x69e7('0x1b')]={};this[_0x69e7('0x1c')]={};this[_0x69e7('0x1d')]={};this[_0x69e7('0x1e')]={};this[_0x69e7('0x1f')]={};this[_0x69e7('0x20')]={};this[_0x69e7('0x21')]={};this[_0x69e7('0x22')]={};this[_0x69e7('0x23')]={};this[_0x69e7('0x24')]={};this[_0x69e7('0x25')]={};this[_0x69e7('0x26')]={};this[_0x69e7('0x27')]={};this[_0x69e7('0x28')]={};this['dynamics365Accounts']={};this[_0x69e7('0x29')]={};this[_0x69e7('0x2a')]={};};function freeIsNotKey(_0x19c67b,_0x5b4284,_0x2cc92a){var _0xe5dc7=_['mapKeys'](_0x19c67b,function(_0xe6ae08,_0x447326){return _0xe6ae08[_0x2cc92a];});for(var _0x42a779 in _0x5b4284){if(_0x5b4284['hasOwnProperty'](_0x42a779)){if(!_0xe5dc7[_0x42a779]){delete _0x5b4284[_0x42a779];}}}}function freeIsNotKeySip(_0x76c6f5,_0x794c5b){var _0x5083d1=_[_0x69e7('0x2b')](_0x76c6f5,function(_0x44260a,_0x46509f){return util['format'](_0x69e7('0x2c'),_0x44260a[_0x69e7('0x2d')]);});for(var _0x5e8885 in _0x794c5b){if(_0x794c5b['hasOwnProperty'](_0x5e8885)){if(!_0x5083d1[_0x5e8885]){delete _0x794c5b[_0x5e8885];}}}}function freeIsNotKeyAgent(_0x2a7e8c,_0x5a5c06){var _0x1d6f37=_['mapKeys'](_0x2a7e8c,function(_0x289386,_0x4307c6){var _0x2b08d7=_['isNil'](_0x289386[_0x69e7('0x2e')])?util[_0x69e7('0x2f')]('SIP/%s',_0x289386[_0x69e7('0x2d')]):_0x289386[_0x69e7('0x2e')];return _0x2b08d7;});for(var _0xf53f5d in _0x5a5c06){if(_0x5a5c06['hasOwnProperty'](_0xf53f5d)){if(!_0x1d6f37[_0xf53f5d]){delete _0x5a5c06[_0xf53f5d];}}}}function clearVoiceCallReports(_0x5ca1fc){_0x5ca1fc[_0x69e7('0x30')]=0x0;_0x5ca1fc[_0x69e7('0x31')]=0x0;_0x5ca1fc['sumHoldTime']=0x0;_0x5ca1fc[_0x69e7('0x32')]=0x0;_0x5ca1fc[_0x69e7('0x33')]=0x0;}function clearCampaigns(_0x436b93){if(!_[_0x69e7('0x34')](_0x436b93)){for(var _0x16a2f5 in _0x436b93){if(_0x436b93[_0x69e7('0x35')](_0x16a2f5)){_0x436b93[_0x16a2f5][_0x69e7('0x36')]=0x0;_0x436b93[_0x16a2f5]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x57fa01){if(!_['isEmpty'](_0x57fa01)){for(var _0x76f941 in _0x57fa01){if(_0x57fa01[_0x69e7('0x35')](_0x76f941)){_0x57fa01[_0x76f941][_0x69e7('0x30')]=0x0;_0x57fa01[_0x76f941][_0x69e7('0x31')]=0x0;_0x57fa01[_0x76f941][_0x69e7('0x37')]=0x0;_0x57fa01[_0x76f941][_0x69e7('0x38')]=0x0;_0x57fa01[_0x76f941][_0x69e7('0x39')]=0x0;_0x57fa01[_0x76f941][_0x69e7('0x32')]=0x0;_0x57fa01[_0x76f941][_0x69e7('0x33')]=0x0;_0x57fa01[_0x76f941][_0x69e7('0x3a')]=0x0;_0x57fa01[_0x76f941][_0x69e7('0x3b')]=0x0;_0x57fa01[_0x76f941][_0x69e7('0x3c')]=0x0;_0x57fa01[_0x76f941][_0x69e7('0x3d')]=0x0;_0x57fa01[_0x76f941][_0x69e7('0x3e')]=0x0;_0x57fa01[_0x76f941][_0x69e7('0x3f')]=0x0;_0x57fa01[_0x76f941]['outboundDropCallsDayTimeout']=0x0;_0x57fa01[_0x76f941][_0x69e7('0x40')]=0x0;_0x57fa01[_0x76f941][_0x69e7('0x41')]=0x0;_0x57fa01[_0x76f941]['outboundOriginateFailureCallsDay']=0x0;_0x57fa01[_0x76f941][_0x69e7('0x42')]=0x0;_0x57fa01[_0x76f941][_0x69e7('0x43')]=0x0;_0x57fa01[_0x76f941][_0x69e7('0x3a')]=0x0;_0x57fa01[_0x76f941]['outboundAnswerCallsDay']=0x0;_0x57fa01[_0x76f941][_0x69e7('0x44')]=!![];}}}}Realtime[_0x69e7('0x45')][_0x69e7('0x46')]=function(_0x477a12,_0xf3e97d){for(var _0x39411f in _0xf3e97d){if(_0x477a12[_0x69e7('0x35')](_0x39411f)){_0x477a12[_0x39411f]=_0xf3e97d[_0x39411f];}}};Realtime[_0x69e7('0x45')][_0x69e7('0x47')]=function(){var _0xd0e52e=this;return function(_0x56a44d){if(_0x56a44d){freeIsNotKeyAgent(_0x56a44d,_0xd0e52e[_0x69e7('0x14')]);for(var _0x400f9c=0x0,_0x2c6e62={},_0x4559a3={};_0x400f9c<_0x56a44d[_0x69e7('0x48')];_0x400f9c+=0x1){_0x2c6e62=_0x56a44d[_0x400f9c];var _0x26940b=_[_0x69e7('0x49')](_0x2c6e62[_0x69e7('0x2e')])?util['format']('SIP/%s',_0x2c6e62['name']):_0x2c6e62['interface'];if(_[_0x69e7('0x4a')](_0xd0e52e[_0x69e7('0x14')][_0x26940b])){_0xd0e52e['agents'][_0x26940b]=new Agent(_0x2c6e62);}else{_0xd0e52e[_0x69e7('0x46')](_0xd0e52e[_0x69e7('0x14')][_0x26940b],_0x2c6e62);}}}return _0xd0e52e[_0x69e7('0x14')];};};Realtime['prototype'][_0x69e7('0x4b')]=function(){var _0x84a9ca=this;return function(_0x287f0e){if(_0x287f0e){freeIsNotKeySip(_0x287f0e,_0x84a9ca[_0x69e7('0x15')]);for(var _0x1de560=0x0,_0x5cfbda={},_0x208598={};_0x1de560<_0x287f0e['length'];_0x1de560+=0x1){_0x5cfbda=_0x287f0e[_0x1de560];if(_[_0x69e7('0x4a')](_0x84a9ca[_0x69e7('0x15')][util[_0x69e7('0x2f')]('SIP/%s',_0x5cfbda[_0x69e7('0x2d')])])){_0x84a9ca['telephones'][util[_0x69e7('0x2f')]('SIP/%s',_0x5cfbda[_0x69e7('0x2d')])]=new Telephone(_0x5cfbda);}else{_0x84a9ca[_0x69e7('0x46')](_0x84a9ca[_0x69e7('0x15')][util[_0x69e7('0x2f')](_0x69e7('0x2c'),_0x5cfbda[_0x69e7('0x2d')])],_0x5cfbda);}}}return _0x84a9ca[_0x69e7('0x15')];};};Realtime[_0x69e7('0x45')][_0x69e7('0x4c')]=function(){var _0x19420e=this;return function(_0x5254ce){if(_0x5254ce){freeIsNotKeySip(_0x5254ce,_0x19420e[_0x69e7('0x16')]);for(var _0x16e478=0x0,_0x33e6b2={},_0x3030f2={};_0x16e478<_0x5254ce[_0x69e7('0x48')];_0x16e478+=0x1){_0x33e6b2=_0x5254ce[_0x16e478];if(_['isUndefined'](_0x19420e[_0x69e7('0x16')][util[_0x69e7('0x2f')]('SIP/%s',_0x33e6b2[_0x69e7('0x2d')])])){_0x19420e[_0x69e7('0x16')][util['format'](_0x69e7('0x2c'),_0x33e6b2[_0x69e7('0x2d')])]=new Trunk(_0x33e6b2);}else{_0x19420e[_0x69e7('0x46')](_0x19420e['trunks'][util['format'](_0x69e7('0x2c'),_0x33e6b2[_0x69e7('0x2d')])],_0x33e6b2);}}}return _0x19420e[_0x69e7('0x16')];};};Realtime[_0x69e7('0x45')][_0x69e7('0x4d')]=function(){var _0xbb9b8a=this;return function(_0x29af1a){if(_0x29af1a){freeIsNotKey(_0x29af1a,_0xbb9b8a[_0x69e7('0x17')],'name');for(var _0x5ba65c=0x0,_0x1aefc3={},_0x2a3db1={};_0x5ba65c<_0x29af1a[_0x69e7('0x48')];_0x5ba65c+=0x1){_0x1aefc3=_0x29af1a[_0x5ba65c];if(_[_0x69e7('0x4a')](_0xbb9b8a[_0x69e7('0x17')][_0x1aefc3['name']])){_0xbb9b8a[_0x69e7('0x17')][_0x1aefc3[_0x69e7('0x2d')]]=new VoiceQueue(_0x1aefc3);}else{_0xbb9b8a[_0x69e7('0x46')](_0xbb9b8a[_0x69e7('0x17')][_0x1aefc3['name']],_0x1aefc3);}}}return _0xbb9b8a['voiceQueues'];};};Realtime[_0x69e7('0x45')][_0x69e7('0x4e')]=function(){var _0x39c8ef=this;return function(_0x32815b){if(_0x32815b){freeIsNotKey(_0x32815b,_0x39c8ef[_0x69e7('0x18')],'id');for(var _0x240601=0x0,_0x1e3613={},_0xd3aa8b={};_0x240601<_0x32815b['length'];_0x240601+=0x1){_0x1e3613=_0x32815b[_0x240601];if(_['isUndefined'](_0x39c8ef[_0x69e7('0x18')][_0x1e3613['id']])){_0x39c8ef[_0x69e7('0x18')][_0x1e3613['id']]=new Trigger(_0x1e3613);}else{_0x39c8ef[_0x69e7('0x46')](_0x39c8ef[_0x69e7('0x18')][_0x1e3613['id']],_0x1e3613);}}}return _0x39c8ef[_0x69e7('0x18')];};};Realtime[_0x69e7('0x45')][_0x69e7('0x4f')]=function(){var _0x320985=this;return function(_0x33b7a){if(_0x33b7a){freeIsNotKey(_0x33b7a,_0x320985[_0x69e7('0x1a')],'id');for(var _0x16eee3=0x0,_0xf7194f={},_0x560663={};_0x16eee3<_0x33b7a[_0x69e7('0x48')];_0x16eee3+=0x1){_0xf7194f=_0x33b7a[_0x16eee3];if(_[_0x69e7('0x4a')](_0x320985[_0x69e7('0x1a')][_0xf7194f['id']])){_0x320985[_0x69e7('0x1a')][_0xf7194f['id']]=new Template(_0xf7194f);}else{_0x320985['mergeFromDatabase'](_0x320985[_0x69e7('0x1a')][_0xf7194f['id']],_0xf7194f);}}}return _0x320985[_0x69e7('0x1a')];};};Realtime[_0x69e7('0x45')][_0x69e7('0x50')]=function(){var _0x594c7a=this;return function(_0x4ef0c5){if(_0x4ef0c5){freeIsNotKey(_0x4ef0c5,_0x594c7a[_0x69e7('0x21')],'id');for(var _0x345849=0x0,_0x503719={},_0xe33145={};_0x345849<_0x4ef0c5[_0x69e7('0x48')];_0x345849+=0x1){_0x503719=_0x4ef0c5[_0x345849];if(_[_0x69e7('0x4a')](_0x594c7a[_0x69e7('0x21')][_0x503719['id']])){_0x594c7a[_0x69e7('0x21')][_0x503719['id']]=new ZendeskAccount(_0x503719);}else{_0x594c7a[_0x69e7('0x46')](_0x594c7a[_0x69e7('0x21')][_0x503719['id']],_0x503719);}}}return _0x594c7a[_0x69e7('0x21')];};};Realtime[_0x69e7('0x45')]['initSalesforceAccounts']=function(){var _0x2a5caa=this;return function(_0x4e48e3){if(_0x4e48e3){freeIsNotKey(_0x4e48e3,_0x2a5caa[_0x69e7('0x22')],'id');for(var _0x34df0b=0x0,_0x9d0b1d={},_0x587288={};_0x34df0b<_0x4e48e3['length'];_0x34df0b+=0x1){_0x9d0b1d=_0x4e48e3[_0x34df0b];if(_[_0x69e7('0x4a')](_0x2a5caa[_0x69e7('0x22')][_0x9d0b1d['id']])){_0x2a5caa[_0x69e7('0x22')][_0x9d0b1d['id']]=new SalesforceAccount(_0x9d0b1d);}else{_0x2a5caa[_0x69e7('0x46')](_0x2a5caa[_0x69e7('0x22')][_0x9d0b1d['id']],_0x9d0b1d);}}}return _0x2a5caa[_0x69e7('0x22')];};};Realtime[_0x69e7('0x45')]['initFreshdeskAccounts']=function(){var _0x531d0d=this;return function(_0x4d643c){if(_0x4d643c){freeIsNotKey(_0x4d643c,_0x531d0d[_0x69e7('0x24')],'id');for(var _0x3961c9=0x0,_0x37ce9f={},_0x3abb82={};_0x3961c9<_0x4d643c['length'];_0x3961c9+=0x1){_0x37ce9f=_0x4d643c[_0x3961c9];if(_[_0x69e7('0x4a')](_0x531d0d[_0x69e7('0x24')][_0x37ce9f['id']])){_0x531d0d[_0x69e7('0x24')][_0x37ce9f['id']]=new FreshdeskAccount(_0x37ce9f);}else{_0x531d0d[_0x69e7('0x46')](_0x531d0d['freshdeskAccounts'][_0x37ce9f['id']],_0x37ce9f);}}}return _0x531d0d['freshdeskAccounts'];};};Realtime[_0x69e7('0x45')][_0x69e7('0x51')]=function(){var _0x22f3fc=this;return function(_0x373f2c){if(_0x373f2c){freeIsNotKey(_0x373f2c,_0x22f3fc['zohoAccounts'],'id');for(var _0x483483=0x0,_0x282368={},_0x39ce28={};_0x483483<_0x373f2c[_0x69e7('0x48')];_0x483483+=0x1){_0x282368=_0x373f2c[_0x483483];if(_[_0x69e7('0x4a')](_0x22f3fc[_0x69e7('0x25')][_0x282368['id']])){_0x22f3fc[_0x69e7('0x25')][_0x282368['id']]=new ZohoAccount(_0x282368);}else{_0x22f3fc[_0x69e7('0x46')](_0x22f3fc[_0x69e7('0x25')][_0x282368['id']],_0x282368);}}}return _0x22f3fc[_0x69e7('0x25')];};};Realtime[_0x69e7('0x45')][_0x69e7('0x52')]=function(){var _0x554663=this;return function(_0x53b843){if(_0x53b843){freeIsNotKey(_0x53b843,_0x554663[_0x69e7('0x26')],'id');for(var _0xce8e8f=0x0,_0x4295f3={},_0x4d86c={};_0xce8e8f<_0x53b843[_0x69e7('0x48')];_0xce8e8f+=0x1){_0x4295f3=_0x53b843[_0xce8e8f];if(_[_0x69e7('0x4a')](_0x554663['deskAccounts'][_0x4295f3['id']])){_0x554663[_0x69e7('0x26')][_0x4295f3['id']]=new DeskAccount(_0x4295f3);}else{_0x554663[_0x69e7('0x46')](_0x554663[_0x69e7('0x26')][_0x4295f3['id']],_0x4295f3);}}}return _0x554663[_0x69e7('0x26')];};};Realtime['prototype']['initSugarcrmAccounts']=function(){var _0x20960f=this;return function(_0x56e791){if(_0x56e791){freeIsNotKey(_0x56e791,_0x20960f[_0x69e7('0x23')],'id');for(var _0x220a55=0x0,_0x3c976a={},_0x357a16={};_0x220a55<_0x56e791[_0x69e7('0x48')];_0x220a55+=0x1){_0x3c976a=_0x56e791[_0x220a55];if(_[_0x69e7('0x4a')](_0x20960f['sugarcrmAccounts'][_0x3c976a['id']])){_0x20960f[_0x69e7('0x23')][_0x3c976a['id']]=new SugarcrmAccount(_0x3c976a);}else{_0x20960f[_0x69e7('0x46')](_0x20960f[_0x69e7('0x23')][_0x3c976a['id']],_0x3c976a);}}}return _0x20960f[_0x69e7('0x23')];};};Realtime[_0x69e7('0x45')][_0x69e7('0x53')]=function(){var _0x7e4174=this;return function(_0x658212){if(_0x658212){freeIsNotKey(_0x658212,_0x7e4174[_0x69e7('0x27')],'id');for(var _0xfc97fc=0x0,_0x371485={},_0x45d027={};_0xfc97fc<_0x658212[_0x69e7('0x48')];_0xfc97fc+=0x1){_0x371485=_0x658212[_0xfc97fc];if(_['isUndefined'](_0x7e4174[_0x69e7('0x27')][_0x371485['id']])){_0x7e4174[_0x69e7('0x27')][_0x371485['id']]=new VtigerAccount(_0x371485);}else{_0x7e4174['mergeFromDatabase'](_0x7e4174[_0x69e7('0x27')][_0x371485['id']],_0x371485);}}}return _0x7e4174[_0x69e7('0x27')];};};Realtime[_0x69e7('0x45')][_0x69e7('0x54')]=function(){var _0x56d813=this;return function(_0x1a6bc7){if(_0x1a6bc7){freeIsNotKey(_0x1a6bc7,_0x56d813[_0x69e7('0x28')],'id');for(var _0x26922b=0x0,_0x14f461={},_0x3b931b={};_0x26922b<_0x1a6bc7[_0x69e7('0x48')];_0x26922b+=0x1){_0x14f461=_0x1a6bc7[_0x26922b];if(_[_0x69e7('0x4a')](_0x56d813[_0x69e7('0x28')][_0x14f461['id']])){_0x56d813[_0x69e7('0x28')][_0x14f461['id']]=new ServicenowAccount(_0x14f461);}else{_0x56d813[_0x69e7('0x46')](_0x56d813[_0x69e7('0x28')][_0x14f461['id']],_0x14f461);}}}return _0x56d813['servicenowAccounts'];};};Realtime[_0x69e7('0x45')]['initDynamics365Accounts']=function(){var _0xd6b92b=this;return function(_0x3fdec8){if(_0x3fdec8){freeIsNotKey(_0x3fdec8,_0xd6b92b['dynamics365Accounts'],'id');for(var _0x1d5b15=0x0,_0x272a0a={},_0x2349c6={};_0x1d5b15<_0x3fdec8[_0x69e7('0x48')];_0x1d5b15+=0x1){_0x272a0a=_0x3fdec8[_0x1d5b15];if(_['isUndefined'](_0xd6b92b[_0x69e7('0x55')][_0x272a0a['id']])){_0xd6b92b[_0x69e7('0x55')][_0x272a0a['id']]=new Dynamics365Account(_0x272a0a);}else{_0xd6b92b['mergeFromDatabase'](_0xd6b92b[_0x69e7('0x55')][_0x272a0a['id']],_0x272a0a);}}}return _0xd6b92b['dynamics365Accounts'];};};Realtime[_0x69e7('0x45')][_0x69e7('0x56')]=function(){var _0x392c38=this;return function(_0x1edf28){if(_0x1edf28){freeIsNotKey(_0x1edf28,_0x392c38[_0x69e7('0x29')],'id');for(var _0x52969f=0x0,_0x5295d2={},_0x1a4097={};_0x52969f<_0x1edf28[_0x69e7('0x48')];_0x52969f+=0x1){_0x5295d2=_0x1edf28[_0x52969f];if(_[_0x69e7('0x4a')](_0x392c38['freshsalesAccounts'][_0x5295d2['id']])){_0x392c38['freshsalesAccounts'][_0x5295d2['id']]=new FreshsalesAccount(_0x5295d2);}else{_0x392c38['mergeFromDatabase'](_0x392c38['freshsalesAccounts'][_0x5295d2['id']],_0x5295d2);}}}return _0x392c38[_0x69e7('0x29')];};};Realtime[_0x69e7('0x45')][_0x69e7('0x57')]=function(){var _0x5eb63d=this;return function(_0x126d63){for(var _0x47c3d=0x0;_0x47c3d<_0x126d63['length'];_0x47c3d+=0x1){_[_0x69e7('0x58')](_0x5eb63d['voiceQueues'][_0x126d63[_0x47c3d][_0x69e7('0x2d')]],_0x126d63[_0x47c3d]);}return _0x5eb63d[_0x69e7('0x17')];};};Realtime[_0x69e7('0x45')][_0x69e7('0x59')]=function(){var _0x26ae35=this;return function(_0x35b033){clearVoiceQueues(_0x26ae35[_0x69e7('0x17')]);if(_0x35b033){_0x35b033=_[_0x69e7('0x5a')](_0x35b033,_0x69e7('0x5b'));for(var _0x4d2d03 in _0x35b033){if(_0x35b033[_0x69e7('0x35')](_0x4d2d03)){var _0xb77290={};for(var _0x22bf8e=0x0;_0x22bf8e<_0x35b033[_0x4d2d03][_0x69e7('0x48')];_0x22bf8e+=0x1){var _0x5146f8=_0x35b033[_0x4d2d03][_0x22bf8e][_0x69e7('0x5c')];if(_0x26ae35[_0x69e7('0x17')][_0x5146f8]){if(_0x35b033[_0x4d2d03][_0x22bf8e]['queuecallerexit']){_0x26ae35[_0x69e7('0x17')][_0x5146f8]['unmanaged']+=0x1;}if(_0x35b033[_0x4d2d03][_0x22bf8e]['queuecallerabandon']){_0x26ae35[_0x69e7('0x17')][_0x5146f8][_0x69e7('0x38')]+=0x1;}_0x26ae35[_0x69e7('0x17')][_0x5146f8][_0x69e7('0x39')]+=moment(_0x35b033[_0x4d2d03][_0x22bf8e]['queuecallerleaveAt'])[_0x69e7('0x5d')](moment(_0x35b033[_0x4d2d03][_0x22bf8e][_0x69e7('0x5e')]),_0x69e7('0x5f'))||0x0;if(_0x22bf8e===_0x35b033[_0x4d2d03][_0x69e7('0x48')]-0x1){_0x26ae35['voiceQueues'][_0x5146f8]['sumDuration']+=moment(_0x35b033[_0x4d2d03][_0x22bf8e][_0x69e7('0x60')]||_0x35b033[_0x4d2d03][_0x22bf8e][_0x69e7('0x61')]||_0x35b033[_0x4d2d03][_0x22bf8e][_0x69e7('0x62')])[_0x69e7('0x5d')](moment(_0x35b033[_0x4d2d03][_0x22bf8e][_0x69e7('0x5e')]),'seconds')||0x0;_0x26ae35[_0x69e7('0x17')][_0x5146f8]['total']+=0x1;if(_0x35b033[_0x4d2d03][_0x22bf8e]['queuecallercomplete']){_0x26ae35[_0x69e7('0x17')][_0x5146f8][_0x69e7('0x31')]+=0x1;_0x26ae35['voiceQueues'][_0x5146f8][_0x69e7('0x33')]+=moment(_0x35b033[_0x4d2d03][_0x22bf8e][_0x69e7('0x60')])[_0x69e7('0x5d')](moment(_0x35b033[_0x4d2d03][_0x22bf8e][_0x69e7('0x63')]),_0x69e7('0x5f'))||0x0;}}else{_0x26ae35[_0x69e7('0x17')][_0x5146f8][_0x69e7('0x32')]+=_0x26ae35[_0x69e7('0x17')][_0x5146f8][_0x69e7('0x39')]||0x0;}}}}}}return _0x26ae35[_0x69e7('0x17')];};};Realtime[_0x69e7('0x45')][_0x69e7('0x64')]=function(){var _0x45a8d7=this;return function(_0x2a1848){clearVoiceCallReports(_0x45a8d7[_0x69e7('0x65')]);if(_0x2a1848){for(var _0x16ff9b=0x0;_0x16ff9b<_0x2a1848[_0x69e7('0x48')];_0x16ff9b+=0x1){_0x45a8d7[_0x69e7('0x65')][_0x69e7('0x30')]+=0x1;_0x45a8d7[_0x69e7('0x65')][_0x69e7('0x32')]+=_0x2a1848[_0x16ff9b][_0x69e7('0x66')];if(_0x2a1848[_0x16ff9b]['disposition']==='ANSWERED'){_0x45a8d7['outbound'][_0x69e7('0x31')]+=0x1;_0x45a8d7[_0x69e7('0x65')][_0x69e7('0x39')]+=_0x2a1848[_0x16ff9b][_0x69e7('0x66')]-_0x2a1848[_0x16ff9b][_0x69e7('0x67')]||0x0;_0x45a8d7[_0x69e7('0x65')][_0x69e7('0x33')]+=_0x2a1848[_0x16ff9b]['billableseconds'];}}}return _0x45a8d7[_0x69e7('0x65')];};};Realtime[_0x69e7('0x45')]['initCampaigns']=function(){var _0x2c9da6=this;return function(_0x408657){if(_0x408657){freeIsNotKey(_0x408657,_0x2c9da6[_0x69e7('0x19')],_0x69e7('0x2d'));for(var _0x28d81e=0x0,_0x5cf59d={};_0x28d81e<_0x408657[_0x69e7('0x48')];_0x28d81e+=0x1){_0x5cf59d=_0x408657[_0x28d81e];if(_[_0x69e7('0x4a')](_0x2c9da6['campaigns'][_0x5cf59d[_0x69e7('0x2d')]])){_0x2c9da6[_0x69e7('0x19')][_0x5cf59d[_0x69e7('0x2d')]]=new Campaign(_0x5cf59d);}else{_0x2c9da6[_0x69e7('0x46')](_0x2c9da6[_0x69e7('0x19')][_0x5cf59d[_0x69e7('0x2d')]],_0x5cf59d);_0x2c9da6[_0x69e7('0x19')][_0x5cf59d[_0x69e7('0x2d')]][_0x69e7('0x68')]=_0x5cf59d[_0x69e7('0x69')]?_0x5cf59d['SquareProject'][_0x69e7('0x2d')]:undefined;}}}return _0x2c9da6['campaigns'];};};Realtime[_0x69e7('0x45')]['initVoiceExtensions']=function(){var _0xdf08e5=this;return function(_0x11333d){if(_0x11333d){freeIsNotKey(_0x11333d,_0xdf08e5[_0x69e7('0x1b')],'id');for(var _0x5afe45=0x0,_0x415d8a={};_0x5afe45<_0x11333d[_0x69e7('0x48')];_0x5afe45+=0x1){_0x415d8a=_0x11333d[_0x5afe45];if(_[_0x69e7('0x4a')](_0xdf08e5[_0x69e7('0x1b')][_0x415d8a['id']])){_0xdf08e5[_0x69e7('0x1b')][_0x415d8a['id']]=new VoiceExtension(_0x415d8a);}else{_0xdf08e5['mergeFromDatabase'](_0xdf08e5[_0x69e7('0x1b')][_0x415d8a['id']],_0x415d8a);}}}return _0xdf08e5[_0x69e7('0x1b')];};};Realtime[_0x69e7('0x45')][_0x69e7('0x6a')]=function(){var _0x462c7c=this;return function(_0x906c7f){clearCampaigns(_0x462c7c[_0x69e7('0x19')]);for(var _0x1f9a97=0x0;_0x1f9a97<_0x906c7f[_0x69e7('0x48')];_0x1f9a97+=0x1){_['merge'](_0x462c7c[_0x69e7('0x19')][_0x906c7f[_0x1f9a97]['name']],_0x906c7f[_0x1f9a97]);}return _0x462c7c['campaigns'];};};Realtime[_0x69e7('0x45')][_0x69e7('0x6b')]=function(){var _0x2e7ce1=this;return function(_0xd14820){if(_0xd14820){freeIsNotKey(_0xd14820,_0x2e7ce1[_0x69e7('0x2a')],'id');for(var _0x4da965=0x0,_0x5745b5={},_0x5a6243={};_0x4da965<_0xd14820[_0x69e7('0x48')];_0x4da965+=0x1){_0x5745b5=_0xd14820[_0x4da965];if(_[_0x69e7('0x4a')](_0x2e7ce1[_0x69e7('0x2a')][_0x5745b5['id']])){_0x2e7ce1[_0x69e7('0x2a')][_0x5745b5['id']]=new FaxAccount(_0x5745b5);}else{_0x2e7ce1[_0x69e7('0x46')](_0x2e7ce1[_0x69e7('0x2a')][_0x5745b5['id']],_0x5745b5);}}}return _0x2e7ce1[_0x69e7('0x2a')];};};module['exports']=Realtime;
\ No newline at end of file
+var _0x42a7=['ANSWERED','billableseconds','initCampaigns','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','util','lodash','moment','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','timers','sugarcrmAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','format','interface','total','answered','sumHoldTime','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isNil','isUndefined','initTelephones','telephones','initTrunks','trunks','initTriggers','initTemplates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','uniqueid','queuecallerexit','queuecallerabandon','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','seconds','queuecallercomplete','diff','queuecallerleaveAt','duration','disposition'];(function(_0x2f871b,_0x4ebdad){var _0x2096c4=function(_0x2ce1d9){while(--_0x2ce1d9){_0x2f871b['push'](_0x2f871b['shift']());}};_0x2096c4(++_0x4ebdad);}(_0x42a7,0xdd));var _0x742a=function(_0x586501,_0xe684ec){_0x586501=_0x586501-0x0;var _0x728660=_0x42a7[_0x586501];return _0x728660;};'use strict';var BPromise=require('bluebird');var util=require(_0x742a('0x0'));var _=require(_0x742a('0x1'));var moment=require(_0x742a('0x2'));var Agent=require('../model/agent');var Telephone=require(_0x742a('0x3'));var Trunk=require(_0x742a('0x4'));var VoiceQueue=require(_0x742a('0x5'));var Trigger=require(_0x742a('0x6'));var Template=require(_0x742a('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x742a('0x8'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x742a('0x9'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x742a('0xa'));var DeskAccount=require(_0x742a('0xb'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x742a('0xc'));var Dynamics365Account=require(_0x742a('0xd'));var FreshsalesAccount=require(_0x742a('0xe'));var FaxAccount=require(_0x742a('0xf'));var Realtime=function(){this[_0x742a('0x10')]={};this['telephones']={};this['trunks']={};this[_0x742a('0x11')]={};this[_0x742a('0x12')]={};this[_0x742a('0x13')]={};this[_0x742a('0x14')]={};this[_0x742a('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x742a('0x16')]={};this[_0x742a('0x17')]={};this[_0x742a('0x18')]={};this['outboundChannels']={};this[_0x742a('0x19')]={};this['settings']={};this['zendeskAccounts']={};this['salesforceAccounts']={};this[_0x742a('0x1a')]={};this[_0x742a('0x1b')]={};this['zohoAccounts']={};this[_0x742a('0x1c')]={};this[_0x742a('0x1d')]={};this[_0x742a('0x1e')]={};this[_0x742a('0x1f')]={};this[_0x742a('0x20')]={};this[_0x742a('0x21')]={};};function freeIsNotKey(_0x4650a7,_0x3b0a87,_0x30f8e2){var _0x354d25=_[_0x742a('0x22')](_0x4650a7,function(_0x582932,_0x30bed3){return _0x582932[_0x30f8e2];});for(var _0x52e33a in _0x3b0a87){if(_0x3b0a87[_0x742a('0x23')](_0x52e33a)){if(!_0x354d25[_0x52e33a]){delete _0x3b0a87[_0x52e33a];}}}}function freeIsNotKeySip(_0x525e61,_0x1d755e){var _0x62cce5=_[_0x742a('0x22')](_0x525e61,function(_0x3a6c19,_0x1dd585){return util['format'](_0x742a('0x24'),_0x3a6c19[_0x742a('0x25')]);});for(var _0x57a1c6 in _0x1d755e){if(_0x1d755e['hasOwnProperty'](_0x57a1c6)){if(!_0x62cce5[_0x57a1c6]){delete _0x1d755e[_0x57a1c6];}}}}function freeIsNotKeyAgent(_0x26c942,_0x2d7ed8){var _0x2cac39=_['mapKeys'](_0x26c942,function(_0x2133ad,_0x4c9184){var _0x332eaf=_['isNil'](_0x2133ad['interface'])?util[_0x742a('0x26')](_0x742a('0x24'),_0x2133ad[_0x742a('0x25')]):_0x2133ad[_0x742a('0x27')];return _0x332eaf;});for(var _0x112abb in _0x2d7ed8){if(_0x2d7ed8[_0x742a('0x23')](_0x112abb)){if(!_0x2cac39[_0x112abb]){delete _0x2d7ed8[_0x112abb];}}}}function clearVoiceCallReports(_0x48d633){_0x48d633[_0x742a('0x28')]=0x0;_0x48d633[_0x742a('0x29')]=0x0;_0x48d633[_0x742a('0x2a')]=0x0;_0x48d633['sumDuration']=0x0;_0x48d633[_0x742a('0x2b')]=0x0;}function clearCampaigns(_0x127c9a){if(!_['isEmpty'](_0x127c9a)){for(var _0x42e797 in _0x127c9a){if(_0x127c9a[_0x742a('0x23')](_0x42e797)){_0x127c9a[_0x42e797][_0x742a('0x2c')]=0x0;_0x127c9a[_0x42e797][_0x742a('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x489959){if(!_[_0x742a('0x2e')](_0x489959)){for(var _0x1137b5 in _0x489959){if(_0x489959['hasOwnProperty'](_0x1137b5)){_0x489959[_0x1137b5][_0x742a('0x28')]=0x0;_0x489959[_0x1137b5][_0x742a('0x29')]=0x0;_0x489959[_0x1137b5][_0x742a('0x2f')]=0x0;_0x489959[_0x1137b5][_0x742a('0x30')]=0x0;_0x489959[_0x1137b5][_0x742a('0x2a')]=0x0;_0x489959[_0x1137b5][_0x742a('0x31')]=0x0;_0x489959[_0x1137b5][_0x742a('0x2b')]=0x0;_0x489959[_0x1137b5][_0x742a('0x32')]=0x0;_0x489959[_0x1137b5]['outboundNoAnswerCallsDay']=0x0;_0x489959[_0x1137b5][_0x742a('0x33')]=0x0;_0x489959[_0x1137b5][_0x742a('0x34')]=0x0;_0x489959[_0x1137b5][_0x742a('0x35')]=0x0;_0x489959[_0x1137b5]['outboundUnknownCallsDay']=0x0;_0x489959[_0x1137b5][_0x742a('0x36')]=0x0;_0x489959[_0x1137b5][_0x742a('0x37')]=0x0;_0x489959[_0x1137b5][_0x742a('0x38')]=0x0;_0x489959[_0x1137b5][_0x742a('0x39')]=0x0;_0x489959[_0x1137b5]['outboundRejectCallsDay']=0x0;_0x489959[_0x1137b5][_0x742a('0x3a')]=0x0;_0x489959[_0x1137b5]['outboundAnswerAgiCallsDay']=0x0;_0x489959[_0x1137b5][_0x742a('0x3b')]=0x0;_0x489959[_0x1137b5][_0x742a('0x3c')]=!![];}}}}Realtime[_0x742a('0x3d')][_0x742a('0x3e')]=function(_0xe8f55d,_0x4905ae){for(var _0x157b2f in _0x4905ae){if(_0xe8f55d['hasOwnProperty'](_0x157b2f)){_0xe8f55d[_0x157b2f]=_0x4905ae[_0x157b2f];}}};Realtime[_0x742a('0x3d')][_0x742a('0x3f')]=function(){var _0x56ca2b=this;return function(_0x10dca8){if(_0x10dca8){freeIsNotKeyAgent(_0x10dca8,_0x56ca2b[_0x742a('0x10')]);for(var _0x52ca6d=0x0,_0x414f99={},_0x3d584a={};_0x52ca6d<_0x10dca8[_0x742a('0x40')];_0x52ca6d+=0x1){_0x414f99=_0x10dca8[_0x52ca6d];var _0x103f91=_[_0x742a('0x41')](_0x414f99[_0x742a('0x27')])?util[_0x742a('0x26')](_0x742a('0x24'),_0x414f99[_0x742a('0x25')]):_0x414f99[_0x742a('0x27')];if(_[_0x742a('0x42')](_0x56ca2b['agents'][_0x103f91])){_0x56ca2b[_0x742a('0x10')][_0x103f91]=new Agent(_0x414f99);}else{_0x56ca2b['mergeFromDatabase'](_0x56ca2b['agents'][_0x103f91],_0x414f99);}}}return _0x56ca2b[_0x742a('0x10')];};};Realtime[_0x742a('0x3d')][_0x742a('0x43')]=function(){var _0x5c2bda=this;return function(_0x4d7a68){if(_0x4d7a68){freeIsNotKeySip(_0x4d7a68,_0x5c2bda[_0x742a('0x44')]);for(var _0x325871=0x0,_0xab19c6={},_0x2f1442={};_0x325871<_0x4d7a68[_0x742a('0x40')];_0x325871+=0x1){_0xab19c6=_0x4d7a68[_0x325871];if(_[_0x742a('0x42')](_0x5c2bda['telephones'][util[_0x742a('0x26')](_0x742a('0x24'),_0xab19c6[_0x742a('0x25')])])){_0x5c2bda[_0x742a('0x44')][util[_0x742a('0x26')](_0x742a('0x24'),_0xab19c6['name'])]=new Telephone(_0xab19c6);}else{_0x5c2bda[_0x742a('0x3e')](_0x5c2bda['telephones'][util['format'](_0x742a('0x24'),_0xab19c6['name'])],_0xab19c6);}}}return _0x5c2bda[_0x742a('0x44')];};};Realtime[_0x742a('0x3d')][_0x742a('0x45')]=function(){var _0xe65e48=this;return function(_0x231f99){if(_0x231f99){freeIsNotKeySip(_0x231f99,_0xe65e48[_0x742a('0x46')]);for(var _0x37db8d=0x0,_0x240ac4={},_0x36f163={};_0x37db8d<_0x231f99['length'];_0x37db8d+=0x1){_0x240ac4=_0x231f99[_0x37db8d];if(_[_0x742a('0x42')](_0xe65e48[_0x742a('0x46')][util[_0x742a('0x26')](_0x742a('0x24'),_0x240ac4['name'])])){_0xe65e48[_0x742a('0x46')][util[_0x742a('0x26')](_0x742a('0x24'),_0x240ac4[_0x742a('0x25')])]=new Trunk(_0x240ac4);}else{_0xe65e48[_0x742a('0x3e')](_0xe65e48[_0x742a('0x46')][util[_0x742a('0x26')]('SIP/%s',_0x240ac4[_0x742a('0x25')])],_0x240ac4);}}}return _0xe65e48['trunks'];};};Realtime[_0x742a('0x3d')]['initVoiceQueues']=function(){var _0x501ec7=this;return function(_0x59c8f6){if(_0x59c8f6){freeIsNotKey(_0x59c8f6,_0x501ec7['voiceQueues'],'name');for(var _0xfd334d=0x0,_0x1e7cb6={},_0xe8489e={};_0xfd334d<_0x59c8f6['length'];_0xfd334d+=0x1){_0x1e7cb6=_0x59c8f6[_0xfd334d];if(_[_0x742a('0x42')](_0x501ec7[_0x742a('0x11')][_0x1e7cb6[_0x742a('0x25')]])){_0x501ec7[_0x742a('0x11')][_0x1e7cb6[_0x742a('0x25')]]=new VoiceQueue(_0x1e7cb6);}else{_0x501ec7[_0x742a('0x3e')](_0x501ec7[_0x742a('0x11')][_0x1e7cb6[_0x742a('0x25')]],_0x1e7cb6);}}}return _0x501ec7['voiceQueues'];};};Realtime['prototype'][_0x742a('0x47')]=function(){var _0x5f4827=this;return function(_0x4d60f1){if(_0x4d60f1){freeIsNotKey(_0x4d60f1,_0x5f4827[_0x742a('0x12')],'id');for(var _0xdb1047=0x0,_0x119e3b={},_0x27e168={};_0xdb1047<_0x4d60f1[_0x742a('0x40')];_0xdb1047+=0x1){_0x119e3b=_0x4d60f1[_0xdb1047];if(_['isUndefined'](_0x5f4827[_0x742a('0x12')][_0x119e3b['id']])){_0x5f4827[_0x742a('0x12')][_0x119e3b['id']]=new Trigger(_0x119e3b);}else{_0x5f4827[_0x742a('0x3e')](_0x5f4827[_0x742a('0x12')][_0x119e3b['id']],_0x119e3b);}}}return _0x5f4827[_0x742a('0x12')];};};Realtime[_0x742a('0x3d')][_0x742a('0x48')]=function(){var _0x333e3e=this;return function(_0x983e30){if(_0x983e30){freeIsNotKey(_0x983e30,_0x333e3e['templates'],'id');for(var _0x6ac5a2=0x0,_0x588ecd={},_0x54c220={};_0x6ac5a2<_0x983e30[_0x742a('0x40')];_0x6ac5a2+=0x1){_0x588ecd=_0x983e30[_0x6ac5a2];if(_[_0x742a('0x42')](_0x333e3e[_0x742a('0x14')][_0x588ecd['id']])){_0x333e3e['templates'][_0x588ecd['id']]=new Template(_0x588ecd);}else{_0x333e3e['mergeFromDatabase'](_0x333e3e[_0x742a('0x14')][_0x588ecd['id']],_0x588ecd);}}}return _0x333e3e[_0x742a('0x14')];};};Realtime[_0x742a('0x3d')][_0x742a('0x49')]=function(){var _0x4bc2e1=this;return function(_0x1f8e55){if(_0x1f8e55){freeIsNotKey(_0x1f8e55,_0x4bc2e1[_0x742a('0x4a')],'id');for(var _0x247621=0x0,_0x58e4f3={},_0xdba5f1={};_0x247621<_0x1f8e55[_0x742a('0x40')];_0x247621+=0x1){_0x58e4f3=_0x1f8e55[_0x247621];if(_[_0x742a('0x42')](_0x4bc2e1['zendeskAccounts'][_0x58e4f3['id']])){_0x4bc2e1[_0x742a('0x4a')][_0x58e4f3['id']]=new ZendeskAccount(_0x58e4f3);}else{_0x4bc2e1[_0x742a('0x3e')](_0x4bc2e1[_0x742a('0x4a')][_0x58e4f3['id']],_0x58e4f3);}}}return _0x4bc2e1[_0x742a('0x4a')];};};Realtime[_0x742a('0x3d')][_0x742a('0x4b')]=function(){var _0x1bf8be=this;return function(_0x38a197){if(_0x38a197){freeIsNotKey(_0x38a197,_0x1bf8be[_0x742a('0x4c')],'id');for(var _0x4da09f=0x0,_0x109e83={},_0x26b04d={};_0x4da09f<_0x38a197[_0x742a('0x40')];_0x4da09f+=0x1){_0x109e83=_0x38a197[_0x4da09f];if(_['isUndefined'](_0x1bf8be[_0x742a('0x4c')][_0x109e83['id']])){_0x1bf8be[_0x742a('0x4c')][_0x109e83['id']]=new SalesforceAccount(_0x109e83);}else{_0x1bf8be['mergeFromDatabase'](_0x1bf8be['salesforceAccounts'][_0x109e83['id']],_0x109e83);}}}return _0x1bf8be[_0x742a('0x4c')];};};Realtime[_0x742a('0x3d')][_0x742a('0x4d')]=function(){var _0x1b6008=this;return function(_0x4b14dd){if(_0x4b14dd){freeIsNotKey(_0x4b14dd,_0x1b6008[_0x742a('0x1b')],'id');for(var _0x40d405=0x0,_0x24a5ec={},_0x30a16f={};_0x40d405<_0x4b14dd[_0x742a('0x40')];_0x40d405+=0x1){_0x24a5ec=_0x4b14dd[_0x40d405];if(_[_0x742a('0x42')](_0x1b6008[_0x742a('0x1b')][_0x24a5ec['id']])){_0x1b6008[_0x742a('0x1b')][_0x24a5ec['id']]=new FreshdeskAccount(_0x24a5ec);}else{_0x1b6008[_0x742a('0x3e')](_0x1b6008['freshdeskAccounts'][_0x24a5ec['id']],_0x24a5ec);}}}return _0x1b6008[_0x742a('0x1b')];};};Realtime[_0x742a('0x3d')][_0x742a('0x4e')]=function(){var _0x20833a=this;return function(_0x413728){if(_0x413728){freeIsNotKey(_0x413728,_0x20833a[_0x742a('0x4f')],'id');for(var _0x1e1836=0x0,_0x4dfaf3={},_0x75b8e9={};_0x1e1836<_0x413728['length'];_0x1e1836+=0x1){_0x4dfaf3=_0x413728[_0x1e1836];if(_[_0x742a('0x42')](_0x20833a['zohoAccounts'][_0x4dfaf3['id']])){_0x20833a[_0x742a('0x4f')][_0x4dfaf3['id']]=new ZohoAccount(_0x4dfaf3);}else{_0x20833a['mergeFromDatabase'](_0x20833a[_0x742a('0x4f')][_0x4dfaf3['id']],_0x4dfaf3);}}}return _0x20833a[_0x742a('0x4f')];};};Realtime[_0x742a('0x3d')]['initDeskAccounts']=function(){var _0x16e4af=this;return function(_0x396034){if(_0x396034){freeIsNotKey(_0x396034,_0x16e4af[_0x742a('0x1c')],'id');for(var _0x504f47=0x0,_0x3ac463={},_0x394ed6={};_0x504f47<_0x396034[_0x742a('0x40')];_0x504f47+=0x1){_0x3ac463=_0x396034[_0x504f47];if(_[_0x742a('0x42')](_0x16e4af[_0x742a('0x1c')][_0x3ac463['id']])){_0x16e4af['deskAccounts'][_0x3ac463['id']]=new DeskAccount(_0x3ac463);}else{_0x16e4af[_0x742a('0x3e')](_0x16e4af[_0x742a('0x1c')][_0x3ac463['id']],_0x3ac463);}}}return _0x16e4af['deskAccounts'];};};Realtime[_0x742a('0x3d')][_0x742a('0x50')]=function(){var _0x57faae=this;return function(_0x207317){if(_0x207317){freeIsNotKey(_0x207317,_0x57faae[_0x742a('0x1a')],'id');for(var _0x4b8a56=0x0,_0x2fd1fd={},_0x1720bc={};_0x4b8a56<_0x207317[_0x742a('0x40')];_0x4b8a56+=0x1){_0x2fd1fd=_0x207317[_0x4b8a56];if(_[_0x742a('0x42')](_0x57faae['sugarcrmAccounts'][_0x2fd1fd['id']])){_0x57faae[_0x742a('0x1a')][_0x2fd1fd['id']]=new SugarcrmAccount(_0x2fd1fd);}else{_0x57faae[_0x742a('0x3e')](_0x57faae[_0x742a('0x1a')][_0x2fd1fd['id']],_0x2fd1fd);}}}return _0x57faae[_0x742a('0x1a')];};};Realtime[_0x742a('0x3d')][_0x742a('0x51')]=function(){var _0x1da76c=this;return function(_0xd379db){if(_0xd379db){freeIsNotKey(_0xd379db,_0x1da76c['vtigerAccounts'],'id');for(var _0x4e9e15=0x0,_0x19659e={},_0x430c22={};_0x4e9e15<_0xd379db['length'];_0x4e9e15+=0x1){_0x19659e=_0xd379db[_0x4e9e15];if(_[_0x742a('0x42')](_0x1da76c['vtigerAccounts'][_0x19659e['id']])){_0x1da76c[_0x742a('0x1d')][_0x19659e['id']]=new VtigerAccount(_0x19659e);}else{_0x1da76c[_0x742a('0x3e')](_0x1da76c[_0x742a('0x1d')][_0x19659e['id']],_0x19659e);}}}return _0x1da76c['vtigerAccounts'];};};Realtime[_0x742a('0x3d')][_0x742a('0x52')]=function(){var _0xaa00e9=this;return function(_0x23cc94){if(_0x23cc94){freeIsNotKey(_0x23cc94,_0xaa00e9[_0x742a('0x1e')],'id');for(var _0x45162d=0x0,_0x2a8fb2={},_0x565a05={};_0x45162d<_0x23cc94['length'];_0x45162d+=0x1){_0x2a8fb2=_0x23cc94[_0x45162d];if(_[_0x742a('0x42')](_0xaa00e9[_0x742a('0x1e')][_0x2a8fb2['id']])){_0xaa00e9[_0x742a('0x1e')][_0x2a8fb2['id']]=new ServicenowAccount(_0x2a8fb2);}else{_0xaa00e9[_0x742a('0x3e')](_0xaa00e9[_0x742a('0x1e')][_0x2a8fb2['id']],_0x2a8fb2);}}}return _0xaa00e9[_0x742a('0x1e')];};};Realtime['prototype'][_0x742a('0x53')]=function(){var _0x52a4a8=this;return function(_0x12d955){if(_0x12d955){freeIsNotKey(_0x12d955,_0x52a4a8['dynamics365Accounts'],'id');for(var _0x1f0ed3=0x0,_0x53640f={},_0x4a74eb={};_0x1f0ed3<_0x12d955[_0x742a('0x40')];_0x1f0ed3+=0x1){_0x53640f=_0x12d955[_0x1f0ed3];if(_[_0x742a('0x42')](_0x52a4a8[_0x742a('0x1f')][_0x53640f['id']])){_0x52a4a8[_0x742a('0x1f')][_0x53640f['id']]=new Dynamics365Account(_0x53640f);}else{_0x52a4a8[_0x742a('0x3e')](_0x52a4a8['dynamics365Accounts'][_0x53640f['id']],_0x53640f);}}}return _0x52a4a8['dynamics365Accounts'];};};Realtime[_0x742a('0x3d')][_0x742a('0x54')]=function(){var _0xde686f=this;return function(_0x41990e){if(_0x41990e){freeIsNotKey(_0x41990e,_0xde686f['freshsalesAccounts'],'id');for(var _0x3813be=0x0,_0xd746b3={},_0x1dd2a0={};_0x3813be<_0x41990e[_0x742a('0x40')];_0x3813be+=0x1){_0xd746b3=_0x41990e[_0x3813be];if(_[_0x742a('0x42')](_0xde686f[_0x742a('0x20')][_0xd746b3['id']])){_0xde686f[_0x742a('0x20')][_0xd746b3['id']]=new FreshsalesAccount(_0xd746b3);}else{_0xde686f[_0x742a('0x3e')](_0xde686f[_0x742a('0x20')][_0xd746b3['id']],_0xd746b3);}}}return _0xde686f[_0x742a('0x20')];};};Realtime[_0x742a('0x3d')][_0x742a('0x55')]=function(){var _0x6374f2=this;return function(_0x461c46){for(var _0x37e86f=0x0;_0x37e86f<_0x461c46[_0x742a('0x40')];_0x37e86f+=0x1){_['merge'](_0x6374f2[_0x742a('0x11')][_0x461c46[_0x37e86f][_0x742a('0x25')]],_0x461c46[_0x37e86f]);}return _0x6374f2['voiceQueues'];};};Realtime['prototype'][_0x742a('0x56')]=function(){var _0x58efb1=this;return function(_0x4848a7){clearVoiceQueues(_0x58efb1[_0x742a('0x11')]);if(_0x4848a7){_0x4848a7=_['groupBy'](_0x4848a7,_0x742a('0x57'));for(var _0xb2797d in _0x4848a7){if(_0x4848a7[_0x742a('0x23')](_0xb2797d)){var _0x2909be={};for(var _0x10cf91=0x0;_0x10cf91<_0x4848a7[_0xb2797d]['length'];_0x10cf91+=0x1){var _0xfbbfe9=_0x4848a7[_0xb2797d][_0x10cf91]['queue'];if(_0x58efb1['voiceQueues'][_0xfbbfe9]){if(_0x4848a7[_0xb2797d][_0x10cf91][_0x742a('0x58')]){_0x58efb1[_0x742a('0x11')][_0xfbbfe9][_0x742a('0x2f')]+=0x1;}if(_0x4848a7[_0xb2797d][_0x10cf91][_0x742a('0x59')]){_0x58efb1[_0x742a('0x11')][_0xfbbfe9]['abandoned']+=0x1;}_0x58efb1[_0x742a('0x11')][_0xfbbfe9][_0x742a('0x2a')]+=moment(_0x4848a7[_0xb2797d][_0x10cf91]['queuecallerleaveAt'])['diff'](moment(_0x4848a7[_0xb2797d][_0x10cf91][_0x742a('0x5a')]),'seconds')||0x0;if(_0x10cf91===_0x4848a7[_0xb2797d][_0x742a('0x40')]-0x1){_0x58efb1[_0x742a('0x11')][_0xfbbfe9][_0x742a('0x31')]+=moment(_0x4848a7[_0xb2797d][_0x10cf91][_0x742a('0x5b')]||_0x4848a7[_0xb2797d][_0x10cf91][_0x742a('0x5c')]||_0x4848a7[_0xb2797d][_0x10cf91][_0x742a('0x5d')])['diff'](moment(_0x4848a7[_0xb2797d][_0x10cf91][_0x742a('0x5a')]),_0x742a('0x5e'))||0x0;_0x58efb1[_0x742a('0x11')][_0xfbbfe9][_0x742a('0x28')]+=0x1;if(_0x4848a7[_0xb2797d][_0x10cf91][_0x742a('0x5f')]){_0x58efb1[_0x742a('0x11')][_0xfbbfe9][_0x742a('0x29')]+=0x1;_0x58efb1[_0x742a('0x11')][_0xfbbfe9][_0x742a('0x2b')]+=moment(_0x4848a7[_0xb2797d][_0x10cf91]['queuecallercompleteAt'])[_0x742a('0x60')](moment(_0x4848a7[_0xb2797d][_0x10cf91][_0x742a('0x61')]),_0x742a('0x5e'))||0x0;}}else{_0x58efb1['voiceQueues'][_0xfbbfe9]['sumDuration']+=_0x58efb1['voiceQueues'][_0xfbbfe9][_0x742a('0x2a')]||0x0;}}}}}}return _0x58efb1[_0x742a('0x11')];};};Realtime[_0x742a('0x3d')]['initVoiceCallReports']=function(){var _0x226f13=this;return function(_0x83827f){clearVoiceCallReports(_0x226f13[_0x742a('0x15')]);if(_0x83827f){for(var _0x34fcce=0x0;_0x34fcce<_0x83827f[_0x742a('0x40')];_0x34fcce+=0x1){_0x226f13[_0x742a('0x15')]['total']+=0x1;_0x226f13['outbound']['sumDuration']+=_0x83827f[_0x34fcce][_0x742a('0x62')];if(_0x83827f[_0x34fcce][_0x742a('0x63')]===_0x742a('0x64')){_0x226f13['outbound']['answered']+=0x1;_0x226f13['outbound'][_0x742a('0x2a')]+=_0x83827f[_0x34fcce]['duration']-_0x83827f[_0x34fcce][_0x742a('0x65')]||0x0;_0x226f13['outbound'][_0x742a('0x2b')]+=_0x83827f[_0x34fcce][_0x742a('0x65')];}}}return _0x226f13[_0x742a('0x15')];};};Realtime[_0x742a('0x3d')][_0x742a('0x66')]=function(){var _0x5378c5=this;return function(_0x3e24ac){if(_0x3e24ac){freeIsNotKey(_0x3e24ac,_0x5378c5[_0x742a('0x13')],_0x742a('0x25'));for(var _0x95cf6a=0x0,_0x208e85={};_0x95cf6a<_0x3e24ac['length'];_0x95cf6a+=0x1){_0x208e85=_0x3e24ac[_0x95cf6a];if(_[_0x742a('0x42')](_0x5378c5['campaigns'][_0x208e85[_0x742a('0x25')]])){_0x5378c5[_0x742a('0x13')][_0x208e85[_0x742a('0x25')]]=new Campaign(_0x208e85);}else{_0x5378c5[_0x742a('0x3e')](_0x5378c5['campaigns'][_0x208e85['name']],_0x208e85);_0x5378c5['campaigns'][_0x208e85['name']]['dialQueueProject']=_0x208e85['SquareProject']?_0x208e85[_0x742a('0x67')][_0x742a('0x25')]:undefined;}}}return _0x5378c5[_0x742a('0x13')];};};Realtime[_0x742a('0x3d')][_0x742a('0x68')]=function(){var _0x4fb677=this;return function(_0xd0cda8){if(_0xd0cda8){freeIsNotKey(_0xd0cda8,_0x4fb677[_0x742a('0x16')],'id');for(var _0xb7f4d2=0x0,_0x3f34f8={};_0xb7f4d2<_0xd0cda8['length'];_0xb7f4d2+=0x1){_0x3f34f8=_0xd0cda8[_0xb7f4d2];if(_[_0x742a('0x42')](_0x4fb677[_0x742a('0x16')][_0x3f34f8['id']])){_0x4fb677[_0x742a('0x16')][_0x3f34f8['id']]=new VoiceExtension(_0x3f34f8);}else{_0x4fb677['mergeFromDatabase'](_0x4fb677[_0x742a('0x16')][_0x3f34f8['id']],_0x3f34f8);}}}return _0x4fb677[_0x742a('0x16')];};};Realtime[_0x742a('0x3d')][_0x742a('0x69')]=function(){var _0x296d4d=this;return function(_0x56cd59){clearCampaigns(_0x296d4d['campaigns']);for(var _0x4787f0=0x0;_0x4787f0<_0x56cd59[_0x742a('0x40')];_0x4787f0+=0x1){_['merge'](_0x296d4d[_0x742a('0x13')][_0x56cd59[_0x4787f0][_0x742a('0x25')]],_0x56cd59[_0x4787f0]);}return _0x296d4d[_0x742a('0x13')];};};Realtime[_0x742a('0x3d')][_0x742a('0x6a')]=function(){var _0x21873e=this;return function(_0x24890c){if(_0x24890c){freeIsNotKey(_0x24890c,_0x21873e['faxAccounts'],'id');for(var _0x2d535a=0x0,_0x2c2b42={},_0x2bccd0={};_0x2d535a<_0x24890c[_0x742a('0x40')];_0x2d535a+=0x1){_0x2c2b42=_0x24890c[_0x2d535a];if(_[_0x742a('0x42')](_0x21873e[_0x742a('0x21')][_0x2c2b42['id']])){_0x21873e[_0x742a('0x21')][_0x2c2b42['id']]=new FaxAccount(_0x2c2b42);}else{_0x21873e[_0x742a('0x3e')](_0x21873e[_0x742a('0x21')][_0x2c2b42['id']],_0x2c2b42);}}}return _0x21873e[_0x742a('0x21')];};};module['exports']=Realtime;
\ No newline at end of file
index 78520e8..3c00346 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dc3=['indexOf','lastIndexOf','membername','lodash','moment','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','prototype','sync','xdr','disabled','voiceQueueReport','custom:voiceCallReport','voiceCallReport','voiceAgentReport','bind','custom:voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','isNil','telephones','name','find','format','SIP/%s','length','connectedlinenum','lastAssignedTo','interface','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','keys','getCallType','channel','split','calleridnum','outbound','internal','destination','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','callerid','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','getAgentByInternal','monitor','monitors','monitorFilename','createdAt','exten','connectedlinename','xcally-motion-dialer','isArray','forEach','voiceDialReport','startsWith','substring','phone'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x2dc3,0x10b));var _0x32dc=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x2dc3[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x32dc('0x0'));var moment=require(_0x32dc('0x1'));var util=require('util');var config=require(_0x32dc('0x2'));var ami=require(_0x32dc('0x3'));var RpcVoiceAgentReport=require(_0x32dc('0x4'));var RpcVoiceCallReport=require(_0x32dc('0x5'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x32dc('0x6'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x32dc('0x7'));var RpcVoiceTransferReport=require(_0x32dc('0x8'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x32dc('0x9'));var VoiceDialReport=require(_0x32dc('0xa'));var UserReport=require(_0x32dc('0xb'));function Report(_0x15abcb){this[_0x32dc('0xc')]=_0x15abcb;this[_0x32dc('0xd')]=_0x15abcb[_0x32dc('0xd')];this['telephones']=_0x15abcb['telephones'];}Report[_0x32dc('0xe')][_0x32dc('0xf')]=function(_0x7651eb){var _0xbb8882=new VoiceQueueReport(this['realtime']);var _0x1136c3=new VoiceAgentReport(this[_0x32dc('0xc')]);var _0x1e82f2=new VoiceDialReport(this[_0x32dc('0xc')]);var _0x37468f=new VoiceCallReport(this[_0x32dc('0xc')]);var _0x4cdf7a=new UserReport(this[_0x32dc('0xc')]);if(config[_0x32dc('0x10')]&&config['xdr'][_0x32dc('0x11')]){ami['on']('custom:voiceQueueReport',this[_0x32dc('0x12')]['bind'](this));ami['on'](_0x32dc('0x13'),this[_0x32dc('0x14')]['bind'](this));ami['on']('custom:voiceAgentReport',this[_0x32dc('0x15')][_0x32dc('0x16')](this));ami['on'](_0x32dc('0x17'),this['voiceDialReport'][_0x32dc('0x16')](this));ami['on']('blindtransfer',this[_0x32dc('0x18')][_0x32dc('0x16')](this));ami['on'](_0x32dc('0x19'),this[_0x32dc('0x1a')][_0x32dc('0x16')](this));}};Report['prototype'][_0x32dc('0x1b')]=function(_0x112696){var _0x445d7c;_0x445d7c=_['find'](this[_0x32dc('0xd')],function(_0x3cc39f){return _0x3cc39f[_0x32dc('0x1c')]==_0x112696||_0x3cc39f['name']==_0x112696;});if(_[_0x32dc('0x1d')](_0x445d7c)){var _0xe543df=_['find'](this[_0x32dc('0x1e')],function(_0x593f56){return _0x593f56[_0x32dc('0x1c')]==_0x112696||_0x593f56[_0x32dc('0x1f')]==_0x112696;});if(_0xe543df){_0x445d7c=_[_0x32dc('0x20')](this[_0x32dc('0xd')],function(_0x41f63c){return _0x41f63c['interface']==util[_0x32dc('0x21')](_0x32dc('0x22'),_0xe543df[_0x32dc('0x1f')]);});}}return _0x445d7c;};Report['prototype'][_0x32dc('0x12')]=function(_0xde3fb4){for(var _0x441be6=0x0;_0x441be6<_0xde3fb4[_0x32dc('0x23')];_0x441be6+=0x1){var _0x2e8b75=this[_0x32dc('0x1b')](_0xde3fb4[_0x441be6][_0x32dc('0x24')]);if(_0x2e8b75){_0xde3fb4[_0x441be6]['accountcode']=_0x2e8b75[_0x32dc('0x1c')];_0xde3fb4[_0x441be6]['assigned']=!![];_0xde3fb4[_0x441be6][_0x32dc('0x25')]=_0x2e8b75[_0x32dc('0x1f')];_0xde3fb4[_0x441be6]['interface']=_[_0x32dc('0x1d')](_0x2e8b75[_0x32dc('0x26')])?util[_0x32dc('0x21')](_0x32dc('0x22'),_0x2e8b75[_0x32dc('0x1f')]):_0x2e8b75[_0x32dc('0x26')];if(_0xde3fb4[_0x441be6][_0x32dc('0x27')]){_0xde3fb4[_0x441be6][_0x32dc('0x28')]=moment()[_0x32dc('0x21')](_0x32dc('0x29'));}if(_0xde3fb4[_0x441be6][_0x32dc('0x2a')]){_0xde3fb4[_0x441be6][_0x32dc('0x2b')]=moment()['format'](_0x32dc('0x29'));}RpcMemberReport[_0x32dc('0x12')](_0xde3fb4[_0x441be6]);}RpcVoiceQueueReport[_0x32dc('0x2c')](_0xde3fb4[_0x441be6]);}};function extractCalleridNumber(_0x3932f0){var _0x7c14f9=_0x3932f0[_0x32dc('0x2d')](/<(.*?)>/);return _0x7c14f9?_0x7c14f9[0x1]:_0x3932f0;}Report[_0x32dc('0xe')]['getAgentByInternal']=function(_0x79f74d){for(var _0x3d0bb1=0x0;_0x3d0bb1<Object[_0x32dc('0x2e')](this[_0x32dc('0xd')])[_0x32dc('0x23')];_0x3d0bb1++){var _0x1ba27c=Object[_0x32dc('0x2e')](this[_0x32dc('0xd')])[_0x3d0bb1];var _0x30f676=this['agents'][_0x1ba27c];if(_0x30f676['accountcode']===Number(_0x79f74d))return _0x30f676;}return null;};Report[_0x32dc('0xe')][_0x32dc('0x2f')]=function(_0x8dfc32){var _0x4dc5a4=_0x8dfc32[_0x32dc('0x30')][_0x32dc('0x31')]('-')[0x0];var _0x40bf02=this[_0x32dc('0xd')][_0x4dc5a4];if(!_0x40bf02)_0x40bf02=this['getAgentByInternal'](_0x8dfc32[_0x32dc('0x32')]);return!_0x40bf02?_0x32dc('0x33'):_0x32dc('0x34');};Report[_0x32dc('0xe')][_0x32dc('0x14')]=function(_0x38c0f5){_0x38c0f5[_0x32dc('0x35')]=_0x38c0f5['destination']||_0x38c0f5['exten'];if(_0x38c0f5[_0x32dc('0x36')]==_0x32dc('0x37')){_0x38c0f5[_0x32dc('0x38')]=_0x32dc('0x39');_0x38c0f5[_0x32dc('0x3a')]=_0x38c0f5[_0x32dc('0x39')];if(_0x38c0f5[_0x32dc('0x3b')]==_0x32dc('0x3c')){_0x38c0f5['accountcode']='';_0x38c0f5['destination']=extractCalleridNumber(_0x38c0f5['callerid']);}else if(_0x38c0f5[_0x32dc('0x3b')]=='from-sip'){if(_0x38c0f5[_0x32dc('0x35')]==_0x32dc('0x3d')){_0x38c0f5[_0x32dc('0x35')]=extractCalleridNumber(_0x38c0f5[_0x32dc('0x3e')]);_0x38c0f5[_0x32dc('0x32')]=_0x38c0f5[_0x32dc('0x3f')];_0x38c0f5['destinationchannel']=[_0x38c0f5['channel'],_0x38c0f5[_0x32dc('0x30')]=_0x38c0f5[_0x32dc('0x40')]][0x0];_0x38c0f5[_0x32dc('0x41')]=_0x38c0f5[_0x32dc('0x3e')];}else{_0x38c0f5[_0x32dc('0x35')]=_0x38c0f5['calleridnum'];_0x38c0f5[_0x32dc('0x32')]=_0x38c0f5[_0x32dc('0x3f')];if(_0x38c0f5['disposition']=='ANSWERED'){_0x38c0f5[_0x32dc('0x1c')]=_0x38c0f5['connectedlinenum'];}else{_0x38c0f5['accountcode']='';}}}}else{_0x38c0f5['callerid']=util[_0x32dc('0x21')](_0x32dc('0x42'),_0x38c0f5[_0x32dc('0x43')],_0x38c0f5[_0x32dc('0x32')]);}if(RpcVoiceTransferReport[_0x32dc('0x44')][_0x38c0f5[_0x32dc('0x45')]]){var _0x2b5d7e=RpcVoiceTransferReport[_0x32dc('0x44')][_0x38c0f5[_0x32dc('0x45')]];_0x2b5d7e[_0x32dc('0x46')]=_0x38c0f5['uniqueid'];RpcVoiceTransferReport['blindTransfer'](_0x2b5d7e);delete RpcVoiceTransferReport['transfers'][_0x38c0f5[_0x32dc('0x45')]];}if(_[_0x32dc('0x1d')](_0x38c0f5[_0x32dc('0x36')])){_0x38c0f5[_0x32dc('0x36')]=this[_0x32dc('0x2f')](_0x38c0f5);}if(_['isNil'](_0x38c0f5['UserId'])){var _0x5d8752=_0x38c0f5[_0x32dc('0x30')][_0x32dc('0x31')]('-')[0x0];var _0x2c21cd=this[_0x32dc('0xd')][_0x5d8752];if(!_0x2c21cd)_0x2c21cd=this[_0x32dc('0x47')](_0x38c0f5[_0x32dc('0x1c')]);if(_0x2c21cd){_0x38c0f5['UserId']=_0x2c21cd['id'];_0x38c0f5['membername']=_0x2c21cd['name'];}}RpcVoiceCallReport['create'](_0x38c0f5);if(_0x38c0f5[_0x32dc('0x48')]){for(var _0x25857f=0x0;_0x25857f<_0x38c0f5[_0x32dc('0x49')]['length'];_0x25857f+=0x1){_0x38c0f5[_0x32dc('0x4a')]=_0x38c0f5[_0x32dc('0x49')][_0x25857f]['filename'];_0x38c0f5[_0x32dc('0x4b')]=_0x38c0f5[_0x32dc('0x49')][_0x25857f][_0x32dc('0x4b')];if(_0x38c0f5[_0x32dc('0x4c')]=='xcally-motion-preview'){_0x38c0f5[_0x32dc('0x32')]=_0x38c0f5[_0x32dc('0x24')];_0x38c0f5['calleridname']=_0x38c0f5[_0x32dc('0x4d')];_0x38c0f5[_0x32dc('0x24')]=_0x38c0f5[_0x32dc('0x1c')];_0x38c0f5[_0x32dc('0x4d')]=_0x38c0f5['membername'];_0x38c0f5[_0x32dc('0x4c')]=_0x38c0f5['originatecalleridnum'];}else if(_0x38c0f5[_0x32dc('0x4c')]==_0x32dc('0x4e')){_0x38c0f5[_0x32dc('0x32')]=_0x38c0f5[_0x32dc('0x35')];_0x38c0f5[_0x32dc('0x4c')]=_0x38c0f5[_0x32dc('0x3f')];}RpcVoiceRecording[_0x32dc('0x2c')](_0x38c0f5);}}};Report[_0x32dc('0xe')][_0x32dc('0x15')]=function(_0x36bc72){if(_[_0x32dc('0x4f')](_0x36bc72)){_0x36bc72[_0x32dc('0x50')](function(_0x26f2d9){RpcVoiceAgentReport['create'](_0x26f2d9);});}else{RpcVoiceAgentReport[_0x32dc('0x2c')](_0x36bc72);}};Report[_0x32dc('0xe')][_0x32dc('0x51')]=function(_0x322350){RpcVoiceDialReport['create'](_0x322350);var _0x529552;var _0xcafaa3;var _0x3e9b76=_0x322350['channel'];if(_[_0x32dc('0x52')](_0x3e9b76,'Local')){_0xcafaa3=_0x3e9b76[_0x32dc('0x53')](_0x3e9b76['indexOf']('/')+0x1,_0x3e9b76['indexOf']('@'));_0x529552=_[_0x32dc('0x20')](this[_0x32dc('0xd')],function(_0x14bb72){return _0x14bb72['mobile']==_0xcafaa3||_0x14bb72[_0x32dc('0x54')]==_0xcafaa3||_0x14bb72[_0x32dc('0x1c')]==_0xcafaa3;});}else{_0xcafaa3=_0x3e9b76[_0x32dc('0x53')](_0x3e9b76[_0x32dc('0x55')]('/')+0x1,_0x3e9b76[_0x32dc('0x56')]('-'));_0x529552=this['findAgent'](_0xcafaa3);}if(_0x529552){_0x322350[_0x32dc('0x26')]=_[_0x32dc('0x1d')](_0x529552['interface'])?util[_0x32dc('0x21')](_0x32dc('0x22'),_0x529552[_0x32dc('0x1f')]):_0x529552[_0x32dc('0x26')];_0x322350[_0x32dc('0x57')]=_0x529552[_0x32dc('0x1f')];_0x322350[_0x32dc('0x1c')]=_0x529552[_0x32dc('0x1c')];RpcMemberReport[_0x32dc('0x51')](_0x322350);}};Report[_0x32dc('0xe')][_0x32dc('0x18')]=function(_0x2dacad){RpcVoiceTransferReport[_0x32dc('0x44')][_0x2dacad['transfererlinkedid']]=_0x2dacad;};Report[_0x32dc('0xe')][_0x32dc('0x1a')]=function(_0x682c94){RpcVoiceTransferReport['attendedTransfer'](_0x682c94);};module['exports']=Report;
\ No newline at end of file
+var _0x7dce=['disposition','ANSWERED','\x22%s\x22\x20<%s>','linkedid','transfers','transfereelinkedid','uniqueid','blindTransfer','UserId','membername','monitor','monitors','monitorFilename','createdAt','calleridname','connectedlinename','xcally-motion-dialer','isArray','forEach','substring','mobile','indexOf','transfererlinkedid','exports','lodash','moment','util','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','accountcode','isNil','name','interface','format','SIP/%s','length','connectedlinenum','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','channel','split','calleridnum','outbound','internal','destination','exten','type','dialer','queue','lastdata','context','callerid','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel'];(function(_0x518690,_0x3bd348){var _0x50fef2=function(_0x3a2440){while(--_0x3a2440){_0x518690['push'](_0x518690['shift']());}};_0x50fef2(++_0x3bd348);}(_0x7dce,0x18c));var _0xe7dc=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x7dce[_0x2160a9];return _0xa88cf7;};'use strict';var _=require(_0xe7dc('0x0'));var moment=require(_0xe7dc('0x1'));var util=require(_0xe7dc('0x2'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require(_0xe7dc('0x3'));var RpcVoiceCallReport=require(_0xe7dc('0x4'));var RpcVoiceDialReport=require(_0xe7dc('0x5'));var RpcMemberReport=require(_0xe7dc('0x6'));var RpcVoiceQueueReport=require(_0xe7dc('0x7'));var RpcVoiceRecording=require(_0xe7dc('0x8'));var RpcVoiceTransferReport=require(_0xe7dc('0x9'));var VoiceQueueReport=require(_0xe7dc('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xe7dc('0xb'));var UserReport=require(_0xe7dc('0xc'));function Report(_0x5ceaf9){this[_0xe7dc('0xd')]=_0x5ceaf9;this[_0xe7dc('0xe')]=_0x5ceaf9[_0xe7dc('0xe')];this['telephones']=_0x5ceaf9[_0xe7dc('0xf')];}Report['prototype'][_0xe7dc('0x10')]=function(_0x946352){var _0x5dec13=new VoiceQueueReport(this[_0xe7dc('0xd')]);var _0x586ce3=new VoiceAgentReport(this[_0xe7dc('0xd')]);var _0x4c643f=new VoiceDialReport(this[_0xe7dc('0xd')]);var _0x19b9c2=new VoiceCallReport(this[_0xe7dc('0xd')]);var _0x43d838=new UserReport(this[_0xe7dc('0xd')]);if(config['xdr']&&config[_0xe7dc('0x11')][_0xe7dc('0x12')]){ami['on'](_0xe7dc('0x13'),this[_0xe7dc('0x14')]['bind'](this));ami['on']('custom:voiceCallReport',this[_0xe7dc('0x15')][_0xe7dc('0x16')](this));ami['on'](_0xe7dc('0x17'),this[_0xe7dc('0x18')][_0xe7dc('0x16')](this));ami['on'](_0xe7dc('0x19'),this[_0xe7dc('0x1a')][_0xe7dc('0x16')](this));ami['on'](_0xe7dc('0x1b'),this['blindTransfer'][_0xe7dc('0x16')](this));ami['on'](_0xe7dc('0x1c'),this[_0xe7dc('0x1d')]['bind'](this));}};Report[_0xe7dc('0x1e')][_0xe7dc('0x1f')]=function(_0x56a39f){var _0x414054;_0x414054=_[_0xe7dc('0x20')](this[_0xe7dc('0xe')],function(_0x543176){return _0x543176[_0xe7dc('0x21')]==_0x56a39f||_0x543176['name']==_0x56a39f;});if(_[_0xe7dc('0x22')](_0x414054)){var _0x2db26c=_[_0xe7dc('0x20')](this[_0xe7dc('0xf')],function(_0x3eaea8){return _0x3eaea8['accountcode']==_0x56a39f||_0x3eaea8[_0xe7dc('0x23')]==_0x56a39f;});if(_0x2db26c){_0x414054=_['find'](this[_0xe7dc('0xe')],function(_0x38cf0d){return _0x38cf0d[_0xe7dc('0x24')]==util[_0xe7dc('0x25')](_0xe7dc('0x26'),_0x2db26c['name']);});}}return _0x414054;};Report[_0xe7dc('0x1e')]['voiceQueueReport']=function(_0x29e123){for(var _0x46a6d9=0x0;_0x46a6d9<_0x29e123[_0xe7dc('0x27')];_0x46a6d9+=0x1){var _0x42674d=this[_0xe7dc('0x1f')](_0x29e123[_0x46a6d9][_0xe7dc('0x28')]);if(_0x42674d){_0x29e123[_0x46a6d9][_0xe7dc('0x21')]=_0x42674d[_0xe7dc('0x21')];_0x29e123[_0x46a6d9]['assigned']=!![];_0x29e123[_0x46a6d9][_0xe7dc('0x29')]=_0x42674d[_0xe7dc('0x23')];_0x29e123[_0x46a6d9][_0xe7dc('0x24')]=_['isNil'](_0x42674d[_0xe7dc('0x24')])?util[_0xe7dc('0x25')]('SIP/%s',_0x42674d[_0xe7dc('0x23')]):_0x42674d[_0xe7dc('0x24')];if(_0x29e123[_0x46a6d9][_0xe7dc('0x2a')]){_0x29e123[_0x46a6d9][_0xe7dc('0x2b')]=moment()['format'](_0xe7dc('0x2c'));}if(_0x29e123[_0x46a6d9]['queuecallerexit']){_0x29e123[_0x46a6d9][_0xe7dc('0x2d')]=moment()[_0xe7dc('0x25')](_0xe7dc('0x2c'));}RpcMemberReport[_0xe7dc('0x14')](_0x29e123[_0x46a6d9]);}RpcVoiceQueueReport[_0xe7dc('0x2e')](_0x29e123[_0x46a6d9]);}};function extractCalleridNumber(_0x334acb){var _0x4d5deb=_0x334acb[_0xe7dc('0x2f')](/<(.*?)>/);return _0x4d5deb?_0x4d5deb[0x1]:_0x334acb;}Report[_0xe7dc('0x1e')][_0xe7dc('0x30')]=function(_0x5cf3a9){for(var _0x3dd855=0x0;_0x3dd855<Object[_0xe7dc('0x31')](this[_0xe7dc('0xe')])[_0xe7dc('0x27')];_0x3dd855++){var _0x3cb8b3=Object['keys'](this[_0xe7dc('0xe')])[_0x3dd855];var _0x9f6ccc=this['agents'][_0x3cb8b3];if(_0x9f6ccc[_0xe7dc('0x21')]===Number(_0x5cf3a9))return _0x9f6ccc;}return null;};Report[_0xe7dc('0x1e')][_0xe7dc('0x32')]=function(_0x105b93){var _0x3bad08=_0x105b93[_0xe7dc('0x33')][_0xe7dc('0x34')]('-')[0x0];var _0x299732=this[_0xe7dc('0xe')][_0x3bad08];if(!_0x299732)_0x299732=this['getAgentByInternal'](_0x105b93[_0xe7dc('0x35')]);return!_0x299732?_0xe7dc('0x36'):_0xe7dc('0x37');};Report[_0xe7dc('0x1e')][_0xe7dc('0x15')]=function(_0x34a75f){_0x34a75f[_0xe7dc('0x38')]=_0x34a75f[_0xe7dc('0x38')]||_0x34a75f[_0xe7dc('0x39')];if(_0x34a75f[_0xe7dc('0x3a')]==_0xe7dc('0x3b')){_0x34a75f['lastapplication']=_0xe7dc('0x3c');_0x34a75f[_0xe7dc('0x3d')]=_0x34a75f['queue'];if(_0x34a75f[_0xe7dc('0x3e')]=='from-voip-provider'){_0x34a75f[_0xe7dc('0x21')]='';_0x34a75f[_0xe7dc('0x38')]=extractCalleridNumber(_0x34a75f[_0xe7dc('0x3f')]);}else if(_0x34a75f[_0xe7dc('0x3e')]==_0xe7dc('0x40')){if(_0x34a75f[_0xe7dc('0x38')]==_0xe7dc('0x41')){_0x34a75f[_0xe7dc('0x38')]=extractCalleridNumber(_0x34a75f[_0xe7dc('0x42')]);_0x34a75f[_0xe7dc('0x35')]=_0x34a75f[_0xe7dc('0x43')];_0x34a75f['destinationchannel']=[_0x34a75f['channel'],_0x34a75f['channel']=_0x34a75f[_0xe7dc('0x44')]][0x0];_0x34a75f[_0xe7dc('0x3f')]=_0x34a75f[_0xe7dc('0x42')];}else{_0x34a75f['destination']=_0x34a75f[_0xe7dc('0x35')];_0x34a75f[_0xe7dc('0x35')]=_0x34a75f['originatecalleridnum'];if(_0x34a75f[_0xe7dc('0x45')]==_0xe7dc('0x46')){_0x34a75f[_0xe7dc('0x21')]=_0x34a75f['connectedlinenum'];}else{_0x34a75f[_0xe7dc('0x21')]='';}}}}else{_0x34a75f[_0xe7dc('0x3f')]=util[_0xe7dc('0x25')](_0xe7dc('0x47'),_0x34a75f['calleridname'],_0x34a75f[_0xe7dc('0x35')]);}if(RpcVoiceTransferReport['transfers'][_0x34a75f[_0xe7dc('0x48')]]){var _0x2d12ac=RpcVoiceTransferReport[_0xe7dc('0x49')][_0x34a75f['linkedid']];_0x2d12ac[_0xe7dc('0x4a')]=_0x34a75f[_0xe7dc('0x4b')];RpcVoiceTransferReport[_0xe7dc('0x4c')](_0x2d12ac);delete RpcVoiceTransferReport[_0xe7dc('0x49')][_0x34a75f[_0xe7dc('0x48')]];}if(_[_0xe7dc('0x22')](_0x34a75f[_0xe7dc('0x3a')])){_0x34a75f['type']=this[_0xe7dc('0x32')](_0x34a75f);}if(_['isNil'](_0x34a75f['UserId'])){var _0x1a0157=_0x34a75f[_0xe7dc('0x33')]['split']('-')[0x0];var _0x3adda8=this[_0xe7dc('0xe')][_0x1a0157];if(!_0x3adda8)_0x3adda8=this['getAgentByInternal'](_0x34a75f['accountcode']);if(_0x3adda8){_0x34a75f[_0xe7dc('0x4d')]=_0x3adda8['id'];_0x34a75f[_0xe7dc('0x4e')]=_0x3adda8[_0xe7dc('0x23')];}}RpcVoiceCallReport[_0xe7dc('0x2e')](_0x34a75f);if(_0x34a75f[_0xe7dc('0x4f')]){for(var _0x4b3761=0x0;_0x4b3761<_0x34a75f[_0xe7dc('0x50')][_0xe7dc('0x27')];_0x4b3761+=0x1){_0x34a75f[_0xe7dc('0x51')]=_0x34a75f['monitors'][_0x4b3761]['filename'];_0x34a75f[_0xe7dc('0x52')]=_0x34a75f[_0xe7dc('0x50')][_0x4b3761]['createdAt'];if(_0x34a75f['exten']==_0xe7dc('0x41')){_0x34a75f[_0xe7dc('0x35')]=_0x34a75f['connectedlinenum'];_0x34a75f[_0xe7dc('0x53')]=_0x34a75f['connectedlinename'];_0x34a75f[_0xe7dc('0x28')]=_0x34a75f[_0xe7dc('0x21')];_0x34a75f[_0xe7dc('0x54')]=_0x34a75f[_0xe7dc('0x4e')];_0x34a75f['exten']=_0x34a75f['originatecalleridnum'];}else if(_0x34a75f['exten']==_0xe7dc('0x55')){_0x34a75f[_0xe7dc('0x35')]=_0x34a75f[_0xe7dc('0x38')];_0x34a75f[_0xe7dc('0x39')]=_0x34a75f[_0xe7dc('0x43')];}RpcVoiceRecording[_0xe7dc('0x2e')](_0x34a75f);}}};Report[_0xe7dc('0x1e')]['voiceAgentReport']=function(_0xec0898){if(_[_0xe7dc('0x56')](_0xec0898)){_0xec0898[_0xe7dc('0x57')](function(_0x296832){RpcVoiceAgentReport[_0xe7dc('0x2e')](_0x296832);});}else{RpcVoiceAgentReport[_0xe7dc('0x2e')](_0xec0898);}};Report[_0xe7dc('0x1e')][_0xe7dc('0x1a')]=function(_0xc25c2f){RpcVoiceDialReport[_0xe7dc('0x2e')](_0xc25c2f);var _0x597631;var _0xc5896b;var _0x37b248=_0xc25c2f[_0xe7dc('0x33')];if(_['startsWith'](_0x37b248,'Local')){_0xc5896b=_0x37b248[_0xe7dc('0x58')](_0x37b248['indexOf']('/')+0x1,_0x37b248['indexOf']('@'));_0x597631=_[_0xe7dc('0x20')](this[_0xe7dc('0xe')],function(_0x21c30a){return _0x21c30a[_0xe7dc('0x59')]==_0xc5896b||_0x21c30a['phone']==_0xc5896b||_0x21c30a[_0xe7dc('0x21')]==_0xc5896b;});}else{_0xc5896b=_0x37b248['substring'](_0x37b248[_0xe7dc('0x5a')]('/')+0x1,_0x37b248['lastIndexOf']('-'));_0x597631=this[_0xe7dc('0x1f')](_0xc5896b);}if(_0x597631){_0xc25c2f[_0xe7dc('0x24')]=_['isNil'](_0x597631[_0xe7dc('0x24')])?util[_0xe7dc('0x25')](_0xe7dc('0x26'),_0x597631[_0xe7dc('0x23')]):_0x597631[_0xe7dc('0x24')];_0xc25c2f[_0xe7dc('0x4e')]=_0x597631[_0xe7dc('0x23')];_0xc25c2f[_0xe7dc('0x21')]=_0x597631[_0xe7dc('0x21')];RpcMemberReport['voiceDialReport'](_0xc25c2f);}};Report[_0xe7dc('0x1e')][_0xe7dc('0x4c')]=function(_0x22904a){RpcVoiceTransferReport[_0xe7dc('0x49')][_0x22904a[_0xe7dc('0x5b')]]=_0x22904a;};Report[_0xe7dc('0x1e')]['attendedTransfer']=function(_0x21a258){RpcVoiceTransferReport[_0xe7dc('0x1d')](_0x21a258);};module[_0xe7dc('0x5c')]=Report;
\ No newline at end of file
index 237ca4c..33a3ef3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7898=['catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isUndefined','emit','isNotNull','info','username','state','debug','[userReport][registry]','find','merge','omit','actionid','format','trunk:%s','name','trunk:save','syncDeviceState','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','local','toLowerCase','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','phone','accountcode','[userReport][devicestatechange]','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','util','ioredis','bluebird','../../../config/environment','../../../config/logger','redis','defaults','localhost','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry'];(function(_0x54de5d,_0x1f8b26){var _0x1b349e=function(_0xe199cc){while(--_0xe199cc){_0x54de5d['push'](_0x54de5d['shift']());}};_0x1b349e(++_0x1f8b26);}(_0x7898,0x160));var _0x8789=function(_0x4316f9,_0x3dd19b){_0x4316f9=_0x4316f9-0x0;var _0x1823bb=_0x7898[_0x4316f9];return _0x1823bb;};'use strict';var _=require(_0x8789('0x0'));var moment=require('moment');var util=require(_0x8789('0x1'));var Redis=require(_0x8789('0x2'));var BPromise=require(_0x8789('0x3'));var config=require(_0x8789('0x4'));var logger=require(_0x8789('0x5'))('ami');var ami=require('../ami');config[_0x8789('0x6')]=_[_0x8789('0x7')](config[_0x8789('0x6')],{'host':_0x8789('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8789('0x6')]));function UserReport(_0x12119b){this[_0x8789('0x9')]=_0x12119b[_0x8789('0x9')];this[_0x8789('0xa')]=_0x12119b[_0x8789('0xa')];this[_0x8789('0xb')]=_0x12119b[_0x8789('0xb')];ami['on'](_0x8789('0xc'),this[_0x8789('0xd')][_0x8789('0xe')](this));ami['on'](_0x8789('0xf'),this[_0x8789('0xd')]['bind'](this));ami['on'](_0x8789('0x10'),this['syncDeviceState']['bind'](this));ami['on'](_0x8789('0x11'),this[_0x8789('0x12')][_0x8789('0xe')](this));return this[_0x8789('0x13')]();}function showSipRegistrations(){Promise[_0x8789('0x14')]()[_0x8789('0x15')](ami[_0x8789('0x16')]())[_0x8789('0x17')](function(_0x548dc7){logger[_0x8789('0x18')](_0x8789('0x19'),util[_0x8789('0x1a')](_0x548dc7,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x8789('0x14')]()[_0x8789('0x15')](ami[_0x8789('0x1b')]())[_0x8789('0x17')](function(_0x1682ee){logger[_0x8789('0x18')]('[userReport][devicestatelist]',util[_0x8789('0x1a')](_0x1682ee,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x8789('0x15')](ami[_0x8789('0x1c')]())[_0x8789('0x17')](function(_0x1c0a9a){logger[_0x8789('0x18')](_0x8789('0x1d'),util['inspect'](_0x1c0a9a,{'showHidden':![],'depth':null}));});}UserReport[_0x8789('0x1e')]['syncRealtimeShow']=function(){setInterval(function(){BPromise['resolve']()['then'](showSipRegistrations())['then'](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport['prototype']['isNotNull']=function(_0x39e306){return _0x39e306!==null&&!_[_0x8789('0x1f')](_0x39e306);};UserReport['prototype'][_0x8789('0x20')]=function(_0x487922,_0x3fc42f,_0x1d85a8){io['to'](_0x487922)[_0x8789('0x20')](_0x3fc42f,_0x1d85a8);};UserReport[_0x8789('0x1e')]['syncRegistry']=function(_0x5f0b7e){try{if(this[_0x8789('0x21')](_0x5f0b7e)){logger[_0x8789('0x22')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x5f0b7e[_0x8789('0x23')],_0x5f0b7e[_0x8789('0x24')]);logger[_0x8789('0x25')](_0x8789('0x26'),util[_0x8789('0x1a')](_0x5f0b7e,{'showHidden':![],'depth':null}));var _0x5093b8=_[_0x8789('0x27')](this[_0x8789('0x9')],{'defaultuser':_0x5f0b7e[_0x8789('0x23')]});if(_0x5093b8){_0x5f0b7e['stateRegistry']=_0x5f0b7e[_0x8789('0x24')];_[_0x8789('0x28')](_0x5093b8,_[_0x8789('0x29')](_0x5f0b7e,['event',_0x8789('0x2a'),_0x8789('0x23'),_0x8789('0x24')]));logger[_0x8789('0x25')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x8789('0x1a')](_0x5093b8,{'showHidden':![],'depth':null}));this['emit'](util[_0x8789('0x2b')](_0x8789('0x2c'),_0x5093b8[_0x8789('0x2d')]),_0x8789('0x2e'),_0x5093b8);}}}catch(_0x47933c){logger[_0x8789('0x18')](_0x8789('0x26'),util['inspect'](_0x47933c,{'showHidden':![],'depth':null}));}};UserReport[_0x8789('0x1e')][_0x8789('0x2f')]=function(_0x4acac0){try{if(this[_0x8789('0x21')](_0x4acac0)){logger['info'](_0x8789('0x30'),_0x4acac0[_0x8789('0x31')],_0x4acac0[_0x8789('0x24')]);logger['debug']('[userReport][devicestatechange]',util[_0x8789('0x1a')](_0x4acac0,{'showHidden':![],'depth':null}));if(this[_0x8789('0xa')][_0x4acac0['device']]){if(!this[_0x8789('0xa')][_0x4acac0[_0x8789('0x31')]][_0x8789('0x32')]||_0x4acac0['state'][_0x8789('0x33')]()=='inuse'){this[_0x8789('0xa')][_0x4acac0['device']]['local']=![];if(this[_0x8789('0xa')][_0x4acac0[_0x8789('0x31')]][_0x8789('0x24')]!==_0x4acac0[_0x8789('0x24')]['toLowerCase']()){this['agents'][_0x4acac0[_0x8789('0x31')]][_0x8789('0x34')]=_[_0x8789('0x35')](moment()[_0x8789('0x2b')]('x'));}this[_0x8789('0xa')][_0x4acac0[_0x8789('0x31')]][_0x8789('0x24')]=_0x4acac0[_0x8789('0x24')][_0x8789('0x33')]();this['agents'][_0x4acac0[_0x8789('0x31')]][_0x8789('0x36')](_0x4acac0);}}else if(this['telephones'][_0x4acac0[_0x8789('0x31')]]){if(this[_0x8789('0xb')][_0x4acac0[_0x8789('0x31')]][_0x8789('0x24')]!==_0x4acac0[_0x8789('0x24')][_0x8789('0x33')]()){this[_0x8789('0xb')][_0x4acac0[_0x8789('0x31')]]['stateTime']=_[_0x8789('0x35')](moment()[_0x8789('0x2b')]('x'));}this[_0x8789('0xb')][_0x4acac0[_0x8789('0x31')]]['state']=_0x4acac0['state']['toLowerCase']();logger[_0x8789('0x25')](_0x8789('0x37'),util[_0x8789('0x1a')](this[_0x8789('0xb')][_0x4acac0[_0x8789('0x31')]],{'showHidden':![],'depth':null}));this[_0x8789('0x20')](util['format'](_0x8789('0x38'),this[_0x8789('0xb')][_0x4acac0[_0x8789('0x31')]][_0x8789('0x2d')]),_0x8789('0x39'),this[_0x8789('0xb')][_0x4acac0['device']]);}else if(this[_0x8789('0x9')][_0x4acac0[_0x8789('0x31')]]){if(this[_0x8789('0x9')][_0x4acac0[_0x8789('0x31')]][_0x8789('0x24')]!==_0x4acac0[_0x8789('0x24')][_0x8789('0x33')]()){this[_0x8789('0x9')][_0x4acac0[_0x8789('0x31')]][_0x8789('0x34')]=_[_0x8789('0x35')](moment()[_0x8789('0x2b')]('x'));}this['trunks'][_0x4acac0['device']][_0x8789('0x24')]=_0x4acac0[_0x8789('0x24')][_0x8789('0x33')]();logger[_0x8789('0x25')](_0x8789('0x3a'),util['inspect'](this[_0x8789('0x9')][_0x4acac0[_0x8789('0x31')]],{'showHidden':![],'depth':null}));this[_0x8789('0x20')](util[_0x8789('0x2b')](_0x8789('0x2c'),this['trunks'][_0x4acac0[_0x8789('0x31')]][_0x8789('0x2d')]),_0x8789('0x2e'),this[_0x8789('0x9')][_0x4acac0[_0x8789('0x31')]]);}else if(_[_0x8789('0x3b')](_0x4acac0['device'],_0x8789('0x3c'))){var _0x9b0e6=_0x4acac0[_0x8789('0x31')];var _0x20aa4c=_0x9b0e6[_0x8789('0x3d')](_0x9b0e6[_0x8789('0x3e')]('/')+0x1,_0x9b0e6[_0x8789('0x3e')]('@'));var _0x309e7b=_[_0x8789('0x27')](this[_0x8789('0xa')],function(_0x1dec1d){return _0x1dec1d['mobile']==_0x20aa4c||_0x1dec1d[_0x8789('0x3f')]==_0x20aa4c||_0x1dec1d[_0x8789('0x40')]==_0x20aa4c;});if(_0x309e7b){if(_0x309e7b[_0x8789('0x24')]!==_0x4acac0[_0x8789('0x24')][_0x8789('0x33')]()){_0x309e7b[_0x8789('0x34')]=_['toNumber'](moment()[_0x8789('0x2b')]('x'));}_0x309e7b[_0x8789('0x24')]=_0x4acac0['state'][_0x8789('0x33')]();_0x309e7b[_0x8789('0x32')]=!![];_0x309e7b[_0x8789('0x36')](_0x4acac0);}}}}catch(_0x198036){logger['error'](_0x8789('0x41'),util[_0x8789('0x1a')](_0x198036,{'showHidden':![],'depth':null}));}};UserReport[_0x8789('0x1e')]['syncPeerStatus']=function(_0x6707eb){try{if(this['isNotNull'](_0x6707eb)&&this[_0x8789('0x21')](_0x6707eb[_0x8789('0x11')])){logger[_0x8789('0x22')](_0x8789('0x42'),_0x6707eb[_0x8789('0x43')],_0x6707eb[_0x8789('0x44')],_0x6707eb[_0x8789('0x11')]);logger[_0x8789('0x25')](_0x8789('0x45'),util[_0x8789('0x1a')](_0x6707eb,{'showHidden':![],'depth':null}));if(this[_0x8789('0xa')][_0x6707eb[_0x8789('0x43')]]){if(!this[_0x8789('0xa')][_0x6707eb[_0x8789('0x43')]][_0x8789('0x32')]||_0x6707eb[_0x8789('0x11')]['toLowerCase']()==_0x8789('0x46')){this[_0x8789('0xa')][_0x6707eb['peer']]['local']=![];this[_0x8789('0xa')][_0x6707eb['peer']][_0x8789('0x47')]=_0x6707eb['peerstatus'][_0x8789('0x33')]();this[_0x8789('0xa')][_0x6707eb[_0x8789('0x43')]][_0x8789('0x44')]=_0x6707eb[_0x8789('0x44')];this['agents'][_0x6707eb[_0x8789('0x43')]]['updateStatusRealtime'](_0x6707eb);}}else if(this[_0x8789('0xb')][_0x6707eb[_0x8789('0x43')]]){this[_0x8789('0xb')][_0x6707eb['peer']]['status']=_0x6707eb[_0x8789('0x11')][_0x8789('0x33')]();this['telephones'][_0x6707eb[_0x8789('0x43')]][_0x8789('0x44')]=_0x6707eb['address'];logger[_0x8789('0x25')](_0x8789('0x48'),util[_0x8789('0x1a')](this[_0x8789('0xb')][_0x6707eb['peer']],{'showHidden':![],'depth':null}));this[_0x8789('0x20')](util['format'](_0x8789('0x38'),this[_0x8789('0xb')][_0x6707eb[_0x8789('0x43')]][_0x8789('0x2d')]),_0x8789('0x39'),this[_0x8789('0xb')][_0x6707eb['peer']]);}else if(this[_0x8789('0x9')][_0x6707eb[_0x8789('0x43')]]){this[_0x8789('0x9')][_0x6707eb[_0x8789('0x43')]][_0x8789('0x47')]=_0x6707eb[_0x8789('0x11')][_0x8789('0x33')]();this['trunks'][_0x6707eb['peer']]['address']=_0x6707eb['address'];logger['debug'](_0x8789('0x49'),util[_0x8789('0x1a')](this['trunks'][_0x6707eb[_0x8789('0x43')]],{'showHidden':![],'depth':null}));this[_0x8789('0x20')](util[_0x8789('0x2b')]('trunk:%s',this[_0x8789('0x9')][_0x6707eb[_0x8789('0x43')]][_0x8789('0x2d')]),_0x8789('0x2e'),this[_0x8789('0x9')][_0x6707eb[_0x8789('0x43')]]);}}}catch(_0x5c63a3){logger[_0x8789('0x18')]('[userReport][peerstatus]',util[_0x8789('0x1a')](_0x5c63a3,{'showHidden':![],'depth':null}));}};module[_0x8789('0x4a')]=UserReport;
\ No newline at end of file
+var _0x793b=['[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','stateRegistry','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','toLowerCase','inuse','local','toNumber','format','stateTime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','startsWith','Local','substring','indexOf','find','mobile','updateStatusRealtime','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','registered','status','address','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','[userReport][peerstatus]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','error','inspect','then','actionDeviceStateList','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info'];(function(_0xee1455,_0x24b625){var _0x395717=function(_0x3362cd){while(--_0x3362cd){_0xee1455['push'](_0xee1455['shift']());}};_0x395717(++_0x24b625);}(_0x793b,0x10c));var _0xb793=function(_0x102a37,_0x881f9){_0x102a37=_0x102a37-0x0;var _0x2fa196=_0x793b[_0x102a37];return _0x2fa196;};'use strict';var _=require(_0xb793('0x0'));var moment=require(_0xb793('0x1'));var util=require(_0xb793('0x2'));var Redis=require(_0xb793('0x3'));var BPromise=require('bluebird');var config=require(_0xb793('0x4'));var logger=require(_0xb793('0x5'))(_0xb793('0x6'));var ami=require(_0xb793('0x7'));config[_0xb793('0x8')]=_['defaults'](config[_0xb793('0x8')],{'host':_0xb793('0x9'),'port':0x18eb});var io=require(_0xb793('0xa'))(new Redis(config[_0xb793('0x8')]));function UserReport(_0x286431){this[_0xb793('0xb')]=_0x286431[_0xb793('0xb')];this[_0xb793('0xc')]=_0x286431[_0xb793('0xc')];this['telephones']=_0x286431[_0xb793('0xd')];ami['on'](_0xb793('0xe'),this[_0xb793('0xf')]['bind'](this));ami['on'](_0xb793('0x10'),this[_0xb793('0xf')][_0xb793('0x11')](this));ami['on']('devicestatechange',this[_0xb793('0x12')][_0xb793('0x11')](this));ami['on'](_0xb793('0x13'),this[_0xb793('0x14')][_0xb793('0x11')](this));return this[_0xb793('0x15')]();}function showSipRegistrations(){Promise[_0xb793('0x16')]()['then'](ami[_0xb793('0x17')]())[_0xb793('0x18')](function(_0x195d3c){logger[_0xb793('0x19')]('[userReport][sipshowregistry]',util[_0xb793('0x1a')](_0x195d3c,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xb793('0x16')]()[_0xb793('0x1b')](ami[_0xb793('0x1c')]())[_0xb793('0x18')](function(_0x4d3067){logger[_0xb793('0x19')]('[userReport][devicestatelist]',util[_0xb793('0x1a')](_0x4d3067,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xb793('0x16')]()[_0xb793('0x1b')](ami[_0xb793('0x1d')]())[_0xb793('0x18')](function(_0x3bcbc1){logger[_0xb793('0x19')](_0xb793('0x1e'),util['inspect'](_0x3bcbc1,{'showHidden':![],'depth':null}));});}UserReport['prototype'][_0xb793('0x15')]=function(){setInterval(function(){BPromise[_0xb793('0x16')]()[_0xb793('0x1b')](showSipRegistrations())[_0xb793('0x1b')](listDeviceStates())[_0xb793('0x1b')](showPeersStatus());},0x32c8);};UserReport[_0xb793('0x1f')][_0xb793('0x20')]=function(_0x4f1dbb){return _0x4f1dbb!==null&&!_[_0xb793('0x21')](_0x4f1dbb);};UserReport[_0xb793('0x1f')][_0xb793('0x22')]=function(_0x2bbada,_0x4fa471,_0x2b5630){io['to'](_0x2bbada)[_0xb793('0x22')](_0x4fa471,_0x2b5630);};UserReport['prototype']['syncRegistry']=function(_0x1acbb9){try{if(this[_0xb793('0x20')](_0x1acbb9)){logger[_0xb793('0x23')](_0xb793('0x24'),_0x1acbb9[_0xb793('0x25')],_0x1acbb9[_0xb793('0x26')]);logger[_0xb793('0x27')]('[userReport][registry]',util['inspect'](_0x1acbb9,{'showHidden':![],'depth':null}));var _0x2a46be=_['find'](this[_0xb793('0xb')],{'defaultuser':_0x1acbb9['username']});if(_0x2a46be){_0x1acbb9[_0xb793('0x28')]=_0x1acbb9[_0xb793('0x26')];_['merge'](_0x2a46be,_[_0xb793('0x29')](_0x1acbb9,[_0xb793('0x2a'),_0xb793('0x2b'),'username',_0xb793('0x26')]));logger[_0xb793('0x27')](_0xb793('0x2c'),util['inspect'](_0x2a46be,{'showHidden':![],'depth':null}));this[_0xb793('0x22')](util['format']('trunk:%s',_0x2a46be[_0xb793('0x2d')]),_0xb793('0x2e'),_0x2a46be);}}}catch(_0x1c7cf4){logger[_0xb793('0x19')]('[userReport][registry]',util[_0xb793('0x1a')](_0x1c7cf4,{'showHidden':![],'depth':null}));}};UserReport[_0xb793('0x1f')]['syncDeviceState']=function(_0x38aa0d){try{if(this[_0xb793('0x20')](_0x38aa0d)){logger[_0xb793('0x23')](_0xb793('0x2f'),_0x38aa0d[_0xb793('0x30')],_0x38aa0d['state']);logger['debug'](_0xb793('0x31'),util[_0xb793('0x1a')](_0x38aa0d,{'showHidden':![],'depth':null}));if(this[_0xb793('0xc')][_0x38aa0d[_0xb793('0x30')]]){if(!this[_0xb793('0xc')][_0x38aa0d['device']]['local']||_0x38aa0d[_0xb793('0x26')][_0xb793('0x32')]()==_0xb793('0x33')){this[_0xb793('0xc')][_0x38aa0d['device']][_0xb793('0x34')]=![];if(this[_0xb793('0xc')][_0x38aa0d[_0xb793('0x30')]][_0xb793('0x26')]!==_0x38aa0d[_0xb793('0x26')]['toLowerCase']()){this[_0xb793('0xc')][_0x38aa0d[_0xb793('0x30')]]['stateTime']=_[_0xb793('0x35')](moment()[_0xb793('0x36')]('x'));}this[_0xb793('0xc')][_0x38aa0d['device']][_0xb793('0x26')]=_0x38aa0d[_0xb793('0x26')][_0xb793('0x32')]();this[_0xb793('0xc')][_0x38aa0d[_0xb793('0x30')]]['updateStatusRealtime'](_0x38aa0d);}}else if(this['telephones'][_0x38aa0d[_0xb793('0x30')]]){if(this[_0xb793('0xd')][_0x38aa0d[_0xb793('0x30')]][_0xb793('0x26')]!==_0x38aa0d[_0xb793('0x26')][_0xb793('0x32')]()){this['telephones'][_0x38aa0d[_0xb793('0x30')]][_0xb793('0x37')]=_[_0xb793('0x35')](moment()[_0xb793('0x36')]('x'));}this[_0xb793('0xd')][_0x38aa0d['device']]['state']=_0x38aa0d[_0xb793('0x26')]['toLowerCase']();logger['debug'](_0xb793('0x38'),util['inspect'](this['telephones'][_0x38aa0d[_0xb793('0x30')]],{'showHidden':![],'depth':null}));this[_0xb793('0x22')](util[_0xb793('0x36')](_0xb793('0x39'),this['telephones'][_0x38aa0d[_0xb793('0x30')]][_0xb793('0x2d')]),_0xb793('0x3a'),this[_0xb793('0xd')][_0x38aa0d[_0xb793('0x30')]]);}else if(this[_0xb793('0xb')][_0x38aa0d['device']]){if(this[_0xb793('0xb')][_0x38aa0d[_0xb793('0x30')]][_0xb793('0x26')]!==_0x38aa0d['state'][_0xb793('0x32')]()){this[_0xb793('0xb')][_0x38aa0d[_0xb793('0x30')]][_0xb793('0x37')]=_[_0xb793('0x35')](moment()['format']('x'));}this[_0xb793('0xb')][_0x38aa0d[_0xb793('0x30')]]['state']=_0x38aa0d['state']['toLowerCase']();logger[_0xb793('0x27')](_0xb793('0x3b'),util[_0xb793('0x1a')](this['trunks'][_0x38aa0d['device']],{'showHidden':![],'depth':null}));this[_0xb793('0x22')](util[_0xb793('0x36')](_0xb793('0x3c'),this[_0xb793('0xb')][_0x38aa0d['device']]['name']),_0xb793('0x2e'),this[_0xb793('0xb')][_0x38aa0d[_0xb793('0x30')]]);}else if(_[_0xb793('0x3d')](_0x38aa0d[_0xb793('0x30')],_0xb793('0x3e'))){var _0x55a52f=_0x38aa0d[_0xb793('0x30')];var _0x270f7e=_0x55a52f[_0xb793('0x3f')](_0x55a52f['indexOf']('/')+0x1,_0x55a52f[_0xb793('0x40')]('@'));var _0x4aab94=_[_0xb793('0x41')](this[_0xb793('0xc')],function(_0xfa3b46){return _0xfa3b46[_0xb793('0x42')]==_0x270f7e||_0xfa3b46['phone']==_0x270f7e||_0xfa3b46['accountcode']==_0x270f7e;});if(_0x4aab94){if(_0x4aab94[_0xb793('0x26')]!==_0x38aa0d[_0xb793('0x26')][_0xb793('0x32')]()){_0x4aab94[_0xb793('0x37')]=_[_0xb793('0x35')](moment()['format']('x'));}_0x4aab94[_0xb793('0x26')]=_0x38aa0d[_0xb793('0x26')][_0xb793('0x32')]();_0x4aab94['local']=!![];_0x4aab94[_0xb793('0x43')](_0x38aa0d);}}}}catch(_0x1c0675){logger['error'](_0xb793('0x31'),util[_0xb793('0x1a')](_0x1c0675,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncPeerStatus']=function(_0x4d746d){try{if(this['isNotNull'](_0x4d746d)&&this['isNotNull'](_0x4d746d[_0xb793('0x13')])){logger[_0xb793('0x23')](_0xb793('0x44'),_0x4d746d[_0xb793('0x45')],_0x4d746d['address'],_0x4d746d[_0xb793('0x13')]);logger[_0xb793('0x27')]('[userReport][peerstatus]',util[_0xb793('0x1a')](_0x4d746d,{'showHidden':![],'depth':null}));if(this['agents'][_0x4d746d[_0xb793('0x45')]]){if(!this[_0xb793('0xc')][_0x4d746d[_0xb793('0x45')]][_0xb793('0x34')]||_0x4d746d[_0xb793('0x13')]['toLowerCase']()==_0xb793('0x46')){this['agents'][_0x4d746d[_0xb793('0x45')]][_0xb793('0x34')]=![];this[_0xb793('0xc')][_0x4d746d['peer']][_0xb793('0x47')]=_0x4d746d[_0xb793('0x13')][_0xb793('0x32')]();this[_0xb793('0xc')][_0x4d746d[_0xb793('0x45')]][_0xb793('0x48')]=_0x4d746d[_0xb793('0x48')];this[_0xb793('0xc')][_0x4d746d['peer']][_0xb793('0x43')](_0x4d746d);}}else if(this[_0xb793('0xd')][_0x4d746d['peer']]){this[_0xb793('0xd')][_0x4d746d[_0xb793('0x45')]][_0xb793('0x47')]=_0x4d746d[_0xb793('0x13')]['toLowerCase']();this[_0xb793('0xd')][_0x4d746d[_0xb793('0x45')]]['address']=_0x4d746d['address'];logger[_0xb793('0x27')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0xb793('0x1a')](this['telephones'][_0x4d746d[_0xb793('0x45')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xb793('0x36')](_0xb793('0x39'),this[_0xb793('0xd')][_0x4d746d[_0xb793('0x45')]][_0xb793('0x2d')]),'telephone:save',this['telephones'][_0x4d746d[_0xb793('0x45')]]);}else if(this[_0xb793('0xb')][_0x4d746d[_0xb793('0x45')]]){this[_0xb793('0xb')][_0x4d746d[_0xb793('0x45')]][_0xb793('0x47')]=_0x4d746d['peerstatus']['toLowerCase']();this['trunks'][_0x4d746d[_0xb793('0x45')]][_0xb793('0x48')]=_0x4d746d['address'];logger[_0xb793('0x27')](_0xb793('0x49'),util[_0xb793('0x1a')](this[_0xb793('0xb')][_0x4d746d[_0xb793('0x45')]],{'showHidden':![],'depth':null}));this[_0xb793('0x22')](util['format'](_0xb793('0x3c'),this['trunks'][_0x4d746d['peer']]['name']),_0xb793('0x2e'),this['trunks'][_0x4d746d[_0xb793('0x45')]]);}}}catch(_0x400209){logger[_0xb793('0x19')](_0xb793('0x4a'),util[_0xb793('0x1a')](_0x400209,{'showHidden':![],'depth':null}));}};module[_0xb793('0x4b')]=UserReport;
\ No newline at end of file
index 5f73d06..eb48d0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf992=['[%s][voiceAgentReport][varset]','addVariable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','isNil','syncHangup','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','agentcompleteAt','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','diff','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','lastIndexOf','onhold','[%s][voiceAgentReport][musiconholdstart]','substring','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','ami','defaults','redis','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','emit','isUndefined','syncAgentCalled','isNotNull','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','queue','inbound','voice','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','inspect','custom:agentcalled','interface','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','error','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','routealias','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentconnectAt','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','reason','agent','talktime','acw','acwtime','agentacw','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s'];(function(_0x5b8fe2,_0x9aabd0){var _0x3f2030=function(_0x280531){while(--_0x280531){_0x5b8fe2['push'](_0x5b8fe2['shift']());}};_0x3f2030(++_0x9aabd0);}(_0xf992,0x1f3));var _0x2f99=function(_0x57fb77,_0x45a8de){_0x57fb77=_0x57fb77-0x0;var _0x5983da=_0xf992[_0x57fb77];return _0x5983da;};'use strict';var _=require(_0x2f99('0x0'));var moment=require(_0x2f99('0x1'));var util=require(_0x2f99('0x2'));var Redis=require(_0x2f99('0x3'));var config=require(_0x2f99('0x4'));var logger=require('../../../config/logger')(_0x2f99('0x5'));var ami=require('../ami');config['redis']=_[_0x2f99('0x6')](config[_0x2f99('0x7')],{'host':_0x2f99('0x8'),'port':0x18eb});var io=require(_0x2f99('0x9'))(new Redis(config[_0x2f99('0x7')]));function VoiceAgentReport(_0xcbe3d2){this[_0x2f99('0xa')]={};this[_0x2f99('0xb')]=_0xcbe3d2[_0x2f99('0xa')];this['voiceQueues']=_0xcbe3d2[_0x2f99('0xc')];this[_0x2f99('0xd')]=_0xcbe3d2['agents'];this[_0x2f99('0xe')]={};ami['on'](_0x2f99('0xf'),this['syncAgentCalled'][_0x2f99('0x10')](this));ami['on']('agentconnect',this[_0x2f99('0x11')][_0x2f99('0x10')](this));ami['on'](_0x2f99('0x12'),this[_0x2f99('0x13')][_0x2f99('0x10')](this));ami['on']('queuecallerabandon',this[_0x2f99('0x14')]['bind'](this));ami['on'](_0x2f99('0x15'),this[_0x2f99('0x16')][_0x2f99('0x10')](this));ami['on'](_0x2f99('0x17'),this[_0x2f99('0x18')][_0x2f99('0x10')](this));ami['on']('hangup',this['syncHangup'][_0x2f99('0x10')](this));ami['on']('musiconholdstart',this[_0x2f99('0x19')][_0x2f99('0x10')](this));ami['on'](_0x2f99('0x1a'),this[_0x2f99('0x1b')][_0x2f99('0x10')](this));ami['on'](_0x2f99('0x1c'),this[_0x2f99('0x1d')]['bind'](this));ami['on']('blindtransfer',this[_0x2f99('0x1e')][_0x2f99('0x10')](this));}VoiceAgentReport[_0x2f99('0x1f')][_0x2f99('0x20')]=function(_0x58324e,_0x52caf8,_0x2a5842){io['to'](_0x58324e)[_0x2f99('0x20')](_0x52caf8,_0x2a5842);};VoiceAgentReport[_0x2f99('0x1f')]['isNotNull']=function(_0x1d57f4){return _0x1d57f4!==null&&!_[_0x2f99('0x21')](_0x1d57f4);};VoiceAgentReport[_0x2f99('0x1f')][_0x2f99('0x22')]=function(_0x368420){try{if(this[_0x2f99('0x23')](_0x368420)){logger[_0x2f99('0x24')](_0x2f99('0x25'),_0x368420['uniqueid'],_0x368420[_0x2f99('0x26')],_0x368420[_0x2f99('0x27')]);logger[_0x2f99('0x28')](_0x2f99('0x29'),_0x368420['uniqueid'],util['inspect'](_0x368420,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x2f99('0xa')][_0x368420[_0x2f99('0x2a')]])){this[_0x2f99('0xa')][_0x368420['uniqueid']]={};}if(_['isUndefined'](this[_0x2f99('0xa')][_0x368420[_0x2f99('0x2a')]][_0x368420[_0x2f99('0x27')]])){this[_0x2f99('0xa')][_0x368420[_0x2f99('0x2a')]][_0x368420['destuniqueid']]={'agentcalledAt':moment()[_0x2f99('0x2b')](_0x2f99('0x2c')),'lastevent':'called','mandatoryDisposition':this[_0x2f99('0xc')][_0x368420[_0x2f99('0x2d')]]?this[_0x2f99('0xc')][_0x368420[_0x2f99('0x2d')]]['mandatoryDisposition']||![]:![],'type':this[_0x2f99('0xc')][_0x368420[_0x2f99('0x2d')]]?this[_0x2f99('0xc')][_0x368420[_0x2f99('0x2d')]]['type']||_0x2f99('0x2e'):_0x2f99('0x2e'),'variables':this[_0x2f99('0xe')][_0x368420[_0x2f99('0x2a')]],'motionChannel':_0x2f99('0x2f')};}_[_0x2f99('0x30')](this['channels'][_0x368420['uniqueid']][_0x368420[_0x2f99('0x27')]],_[_0x2f99('0x31')](_0x368420,[_0x2f99('0x32'),_0x2f99('0x33')]));logger[_0x2f99('0x28')](_0x2f99('0x34'),_0x368420[_0x2f99('0x2a')],util[_0x2f99('0x35')](this[_0x2f99('0xa')][_0x368420[_0x2f99('0x2a')]][_0x368420['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x2f99('0x20')](_0x2f99('0x36'),this['channels'][_0x368420['uniqueid']][_0x368420[_0x2f99('0x27')]]);var _0x57899a={'id':this[_0x2f99('0xd')][_0x368420[_0x2f99('0x37')]]['id'],'calleridnum':this[_0x2f99('0xa')][_0x368420['uniqueid']][_0x368420[_0x2f99('0x27')]][_0x2f99('0x38')],'queue':this[_0x2f99('0xa')][_0x368420['uniqueid']][_0x368420['destuniqueid']][_0x2f99('0x2d')],'variables':this[_0x2f99('0xa')][_0x368420[_0x2f99('0x2a')]][_0x368420[_0x2f99('0x27')]]['variables']};logger['debug'](_0x2f99('0x39'),_0x368420['uniqueid'],util[_0x2f99('0x35')](_0x57899a,{'showHidden':![],'depth':null}));this[_0x2f99('0x20')](util[_0x2f99('0x2b')](_0x2f99('0x3a'),_0x368420[_0x2f99('0x26')]),'user:called',_0x57899a);}}catch(_0x5b2109){logger[_0x2f99('0x3b')]('[%s][voiceAgentReport][agentcalled]',_0x368420['uniqueid'],util[_0x2f99('0x35')](_0x5b2109,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2f99('0x1f')][_0x2f99('0x11')]=function(_0x1d7832){try{if(this['isNotNull'](_0x1d7832)){if(this[_0x2f99('0xa')][_0x1d7832[_0x2f99('0x2a')]]){logger[_0x2f99('0x28')]('[%s][voiceAgentReport][agentconnect]\x20event:',_0x1d7832[_0x2f99('0x2a')],util[_0x2f99('0x35')](_0x1d7832,{'showHidden':![],'depth':null}));for(var _0x27d8d0 in this[_0x2f99('0xa')][_0x1d7832[_0x2f99('0x2a')]]){if(this[_0x2f99('0xa')][_0x1d7832[_0x2f99('0x2a')]][_0x2f99('0x3c')](_0x27d8d0)){if(_0x1d7832[_0x2f99('0x27')]===_0x27d8d0){logger[_0x2f99('0x24')](_0x2f99('0x3d'),_0x1d7832[_0x2f99('0x2a')],_0x1d7832[_0x2f99('0x26')],_0x1d7832[_0x2f99('0x27')]);this[_0x2f99('0xa')][_0x1d7832['uniqueid']][_0x27d8d0]['agentconnectAt']=moment()[_0x2f99('0x2b')](_0x2f99('0x2c'));this[_0x2f99('0xa')][_0x1d7832[_0x2f99('0x2a')]][_0x27d8d0][_0x2f99('0x3e')]=_0x1d7832[_0x2f99('0x3e')];this[_0x2f99('0xa')][_0x1d7832['uniqueid']][_0x27d8d0][_0x2f99('0x3f')]=_0x1d7832[_0x2f99('0x3f')];this[_0x2f99('0xa')][_0x1d7832[_0x2f99('0x2a')]][_0x27d8d0][_0x2f99('0x40')]=_0x1d7832['destchannelstate'];this['channels'][_0x1d7832[_0x2f99('0x2a')]][_0x27d8d0][_0x2f99('0x41')]=_0x1d7832[_0x2f99('0x41')];this[_0x2f99('0xa')][_0x1d7832['uniqueid']][_0x27d8d0][_0x2f99('0x42')]=_0x1d7832[_0x2f99('0x42')];this[_0x2f99('0xa')][_0x1d7832['uniqueid']][_0x27d8d0][_0x2f99('0x43')]='connect';if(this[_0x2f99('0xb')][this['channels'][_0x1d7832[_0x2f99('0x2a')]][_0x27d8d0][_0x2f99('0x2a')]]){var _0x183211=this[_0x2f99('0xb')][this[_0x2f99('0xa')][_0x1d7832[_0x2f99('0x2a')]][_0x27d8d0]['uniqueid']]['routealias'];this[_0x2f99('0xa')][_0x1d7832[_0x2f99('0x2a')]][_0x27d8d0][_0x2f99('0x44')]=_0x183211;_0x1d7832[_0x2f99('0x44')]=_0x183211;}_[_0x2f99('0x30')](this[_0x2f99('0xd')][_0x1d7832[_0x2f99('0x37')]],_[_0x2f99('0x45')](_0x1d7832,['queue',_0x2f99('0x46'),_0x2f99('0x44')]));logger[_0x2f99('0x28')](_0x2f99('0x47'),_0x1d7832[_0x2f99('0x2a')],util[_0x2f99('0x35')](this['channels'][_0x1d7832[_0x2f99('0x2a')]][_0x1d7832[_0x2f99('0x27')]],{'showHidden':![],'depth':null}));ami[_0x2f99('0x20')](_0x2f99('0x48'),this[_0x2f99('0xa')][_0x1d7832['uniqueid']][_0x1d7832[_0x2f99('0x27')]]);logger['debug'](_0x2f99('0x49'),_0x1d7832[_0x2f99('0x2a')],util['inspect'](this[_0x2f99('0xa')][_0x1d7832[_0x2f99('0x2a')]][_0x1d7832[_0x2f99('0x27')]],{'showHidden':![],'depth':null}));this[_0x2f99('0x20')](util[_0x2f99('0x2b')](_0x2f99('0x3a'),_0x1d7832[_0x2f99('0x26')]),_0x2f99('0x4a'),this['channels'][_0x1d7832[_0x2f99('0x2a')]][_0x1d7832['destuniqueid']]);}else if(!this[_0x2f99('0xa')][_0x1d7832[_0x2f99('0x2a')]][_0x27d8d0][_0x2f99('0x12')]&&!this[_0x2f99('0xa')][_0x1d7832['uniqueid']][_0x27d8d0][_0x2f99('0x15')]){logger[_0x2f99('0x24')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x1d7832[_0x2f99('0x2a')],this[_0x2f99('0xa')][_0x1d7832[_0x2f99('0x2a')]][_0x27d8d0][_0x2f99('0x26')],_0x27d8d0);this[_0x2f99('0xa')][_0x1d7832['uniqueid']][_0x27d8d0]['agentringnoanswer']=!![];this['channels'][_0x1d7832[_0x2f99('0x2a')]][_0x27d8d0][_0x2f99('0x4b')]=moment()[_0x2f99('0x2b')](_0x2f99('0x2c'));this[_0x2f99('0xa')][_0x1d7832[_0x2f99('0x2a')]][_0x27d8d0][_0x2f99('0x4c')]=_0x1d7832[_0x2f99('0x27')];this[_0x2f99('0xa')][_0x1d7832['uniqueid']][_0x27d8d0]['answeredelsewheremembername']=_0x1d7832[_0x2f99('0x26')];this[_0x2f99('0xa')][_0x1d7832[_0x2f99('0x2a')]][_0x27d8d0]['lastevent']='answered_elsewhere';this[_0x2f99('0xa')][_0x1d7832['uniqueid']][_0x27d8d0]['reason']=_0x2f99('0x4d');logger['debug'](_0x2f99('0x4e'),_0x1d7832['uniqueid'],util['inspect'](this['channels'][_0x1d7832[_0x2f99('0x2a')]][_0x27d8d0],{'showHidden':![],'depth':null}));ami[_0x2f99('0x20')](_0x2f99('0x4f'),this[_0x2f99('0xa')][_0x1d7832[_0x2f99('0x2a')]][_0x27d8d0]);}}}}}}catch(_0x3d46e9){logger[_0x2f99('0x3b')](_0x2f99('0x50'),_0x1d7832[_0x2f99('0x2a')],util[_0x2f99('0x35')](_0x3d46e9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2f99('0x1f')][_0x2f99('0x13')]=function(_0x3c593c){try{if(this[_0x2f99('0x23')](_0x3c593c)){logger[_0x2f99('0x28')](_0x2f99('0x51'),_0x3c593c[_0x2f99('0x2a')],util[_0x2f99('0x35')](_0x3c593c,{'showHidden':![],'depth':null}));if(this[_0x2f99('0xa')][_0x3c593c[_0x2f99('0x2a')]]&&this[_0x2f99('0xa')][_0x3c593c[_0x2f99('0x2a')]][_0x3c593c[_0x2f99('0x27')]]){logger[_0x2f99('0x24')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x3c593c[_0x2f99('0x2a')],_0x3c593c[_0x2f99('0x26')],_0x3c593c[_0x2f99('0x27')]);this['channels'][_0x3c593c['uniqueid']][_0x3c593c['destuniqueid']][_0x2f99('0x12')]=!![];this[_0x2f99('0xa')][_0x3c593c['uniqueid']][_0x3c593c[_0x2f99('0x27')]][_0x2f99('0x4b')]=moment()[_0x2f99('0x2b')](_0x2f99('0x2c'));this['channels'][_0x3c593c[_0x2f99('0x2a')]][_0x3c593c[_0x2f99('0x27')]][_0x2f99('0x43')]=_0x2f99('0x52');this[_0x2f99('0xa')][_0x3c593c[_0x2f99('0x2a')]][_0x3c593c[_0x2f99('0x27')]]['reason']=_0x2f99('0x52');logger[_0x2f99('0x28')](_0x2f99('0x53'),_0x3c593c['uniqueid'],util[_0x2f99('0x35')](this[_0x2f99('0xa')][_0x3c593c[_0x2f99('0x2a')]][_0x3c593c[_0x2f99('0x27')]],{'showHidden':![],'depth':null}));ami[_0x2f99('0x20')]('custom:agentringnoanswer',this[_0x2f99('0xa')][_0x3c593c[_0x2f99('0x2a')]][_0x3c593c[_0x2f99('0x27')]]);}}}catch(_0x169502){logger['error'](_0x2f99('0x54'),_0x3c593c[_0x2f99('0x2a')],util[_0x2f99('0x35')](_0x169502,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2f99('0x1f')][_0x2f99('0x14')]=function(_0x596e35){try{if(this[_0x2f99('0x23')](_0x596e35)){logger[_0x2f99('0x28')](_0x2f99('0x55'),_0x596e35[_0x2f99('0x2a')],util[_0x2f99('0x35')](_0x596e35,{'showHidden':![],'depth':null}));if(this[_0x2f99('0xa')][_0x596e35[_0x2f99('0x2a')]]){for(var _0x40523e in this[_0x2f99('0xa')][_0x596e35[_0x2f99('0x2a')]]){if(this[_0x2f99('0xa')][_0x596e35[_0x2f99('0x2a')]][_0x2f99('0x3c')](_0x40523e)&&!this['channels'][_0x596e35[_0x2f99('0x2a')]][_0x40523e][_0x2f99('0x12')]&&!this[_0x2f99('0xa')][_0x596e35[_0x2f99('0x2a')]][_0x40523e][_0x2f99('0x15')]){logger[_0x2f99('0x24')](_0x2f99('0x56'),_0x596e35[_0x2f99('0x2a')],this[_0x2f99('0xa')][_0x596e35['uniqueid']][_0x40523e][_0x2f99('0x26')],_0x40523e);this[_0x2f99('0xa')][_0x596e35[_0x2f99('0x2a')]][_0x40523e][_0x2f99('0x12')]=!![];this[_0x2f99('0xa')][_0x596e35['uniqueid']][_0x40523e][_0x2f99('0x4b')]=moment()['format'](_0x2f99('0x2c'));this['channels'][_0x596e35[_0x2f99('0x2a')]][_0x40523e][_0x2f99('0x43')]=_0x2f99('0x57');this[_0x2f99('0xa')][_0x596e35[_0x2f99('0x2a')]][_0x40523e]['reason']='abandoned';logger[_0x2f99('0x28')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x596e35[_0x2f99('0x2a')],util[_0x2f99('0x35')](this[_0x2f99('0xa')][_0x596e35[_0x2f99('0x2a')]][_0x40523e],{'showHidden':![],'depth':null}));ami['emit'](_0x2f99('0x58'),this[_0x2f99('0xa')][_0x596e35['uniqueid']][_0x40523e]);}}}}}catch(_0x4073c4){logger[_0x2f99('0x3b')](_0x2f99('0x59'),_0x596e35[_0x2f99('0x2a')],util[_0x2f99('0x35')](_0x4073c4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2f99('0x1f')]['syncAgentComplete']=function(_0x5daab9){try{if(this[_0x2f99('0x23')](_0x5daab9)){logger[_0x2f99('0x28')](_0x2f99('0x5a'),_0x5daab9['uniqueid'],util['inspect'](_0x5daab9,{'showHidden':![],'depth':null}));if(this['channels'][_0x5daab9[_0x2f99('0x2a')]]){for(var _0x5f1162 in this['channels'][_0x5daab9[_0x2f99('0x2a')]]){if(this[_0x2f99('0xa')][_0x5daab9[_0x2f99('0x2a')]][_0x2f99('0x3c')](_0x5f1162)){if(this[_0x2f99('0xa')][_0x5daab9[_0x2f99('0x2a')]][_0x5f1162][_0x2f99('0x5b')]&&!this[_0x2f99('0xa')][_0x5daab9[_0x2f99('0x2a')]][_0x5f1162][_0x2f99('0x15')]){logger[_0x2f99('0x24')](_0x2f99('0x5c'),_0x5daab9[_0x2f99('0x2a')],this[_0x2f99('0xa')][_0x5daab9[_0x2f99('0x2a')]][_0x5f1162][_0x2f99('0x26')],_0x5f1162);this[_0x2f99('0xa')][_0x5daab9[_0x2f99('0x2a')]][_0x5f1162][_0x2f99('0x15')]=!![];this[_0x2f99('0xa')][_0x5daab9[_0x2f99('0x2a')]][_0x5f1162]['agentcompleteAt']=moment()[_0x2f99('0x2b')](_0x2f99('0x2c'));this[_0x2f99('0xa')][_0x5daab9[_0x2f99('0x2a')]][_0x5f1162][_0x2f99('0x43')]=_0x2f99('0x5d');this[_0x2f99('0xa')][_0x5daab9['uniqueid']][_0x5f1162][_0x2f99('0x5e')]=_0x5daab9[_0x2f99('0x5e')]=='transfer'?_0x2f99('0x5f'):_0x5daab9[_0x2f99('0x5e')];this[_0x2f99('0xa')][_0x5daab9[_0x2f99('0x2a')]][_0x5f1162][_0x2f99('0x60')]=_0x5daab9[_0x2f99('0x60')];if(this[_0x2f99('0xc')][_0x5daab9[_0x2f99('0x2d')]]&&this[_0x2f99('0xc')][_0x5daab9[_0x2f99('0x2d')]][_0x2f99('0x61')]){this[_0x2f99('0xa')][_0x5daab9[_0x2f99('0x2a')]][_0x5f1162][_0x2f99('0x62')]=this[_0x2f99('0xc')][_0x5daab9[_0x2f99('0x2d')]]['acwTimeout'];this[_0x2f99('0xa')][_0x5daab9[_0x2f99('0x2a')]][_0x5f1162][_0x2f99('0x63')]=!![];}this[_0x2f99('0xd')][_0x5daab9[_0x2f99('0x37')]]=_['omit'](this[_0x2f99('0xd')][_0x5daab9['interface']],['queue',_0x2f99('0x46')]);logger['debug']('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x5daab9[_0x2f99('0x2a')],util['inspect'](this[_0x2f99('0xa')][_0x5daab9[_0x2f99('0x2a')]][_0x5f1162],{'showHidden':![],'depth':null}));ami[_0x2f99('0x20')](_0x2f99('0x64'),this['channels'][_0x5daab9['uniqueid']][_0x5f1162]);logger[_0x2f99('0x28')](_0x2f99('0x65'),_0x5daab9[_0x2f99('0x2a')],util[_0x2f99('0x35')]({'id':this['agents'][_0x5daab9[_0x2f99('0x37')]]['id'],'destaccountcode':_0x5daab9[_0x2f99('0x66')]},{'showHidden':![],'depth':null}));this[_0x2f99('0x20')](util[_0x2f99('0x2b')](_0x2f99('0x3a'),_0x5daab9[_0x2f99('0x26')]),_0x2f99('0x67'),{'id':this[_0x2f99('0xd')][_0x5daab9[_0x2f99('0x37')]]['id'],'destaccountcode':_0x5daab9[_0x2f99('0x66')]});}}}}}}catch(_0x43d65a){logger['error'](_0x2f99('0x68'),_0x5daab9[_0x2f99('0x2a')],util['inspect'](_0x43d65a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2f99('0x1f')][_0x2f99('0x18')]=function(_0x419654){try{if(this[_0x2f99('0x23')](_0x419654)){logger[_0x2f99('0x28')]('[%s][voiceAgentReport][varset]\x20event:',_0x419654[_0x2f99('0x2a')],util[_0x2f99('0x35')](_0x419654,{'showHidden':![],'depth':null}));this['addVariable'](_0x419654[_0x2f99('0x2a')],_[_0x2f99('0x69')](_0x419654[_0x2f99('0x6a')])[0x0],_0x419654[_0x2f99('0x6b')]);if(this[_0x2f99('0xa')][_0x419654[_0x2f99('0x2a')]]){for(var _0x6fcf8f in this[_0x2f99('0xa')][_0x419654[_0x2f99('0x2a')]]){if(this['channels'][_0x419654['uniqueid']]['hasOwnProperty'](_0x6fcf8f)){logger['info'](_0x2f99('0x6c'),_0x419654[_0x2f99('0x2a')],_0x6fcf8f,_[_0x2f99('0x69')](_0x419654[_0x2f99('0x6a')])[0x0],_0x419654[_0x2f99('0x6b')]);if(_[_0x2f99('0x21')](this[_0x2f99('0xa')][_0x419654[_0x2f99('0x2a')]][_0x6fcf8f][_0x2f99('0xe')])){this[_0x2f99('0xa')][_0x419654[_0x2f99('0x2a')]][_0x6fcf8f][_0x2f99('0xe')]={};}this['channels'][_0x419654[_0x2f99('0x2a')]][_0x6fcf8f][_0x2f99('0xe')]=this[_0x2f99('0xe')][_0x419654[_0x2f99('0x2a')]];}}}}}catch(_0x563e43){logger[_0x2f99('0x3b')](_0x2f99('0x6d'),_0x419654[_0x2f99('0x2a')],util['inspect'](_0x563e43,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2f99('0x1f')][_0x2f99('0x6e')]=function(_0x552124,_0x139af9,_0x217bb8){var _0x1940a3=['rtpaudioqos',_0x2f99('0x6f'),_0x2f99('0x70'),_0x2f99('0x71'),_0x2f99('0x72'),_0x2f99('0x73'),_0x2f99('0x74'),'rtpaudioqosrttbridged',_0x2f99('0x75'),_0x2f99('0x76'),'bridgepeer',_0x2f99('0x77'),_0x2f99('0x78'),_0x2f99('0x79'),_0x2f99('0x7a'),'memberlastcall',_0x2f99('0x26'),_0x2f99('0x7b'),'memberrealtime'];if(!_[_0x2f99('0x7c')](_0x139af9)&&!_['includes'](_0x1940a3,_0x139af9)){if(_[_0x2f99('0x21')](this[_0x2f99('0xe')][_0x552124])){this[_0x2f99('0xe')][_0x552124]={};}this['variables'][_0x552124][_0x139af9]=_0x217bb8;}};VoiceAgentReport[_0x2f99('0x1f')][_0x2f99('0x7d')]=function(_0x17b757){try{if(this[_0x2f99('0x23')](_0x17b757)){logger[_0x2f99('0x28')]('[%s][voiceAgentReport][hangup]\x20event:',_0x17b757[_0x2f99('0x2a')],util[_0x2f99('0x35')](_0x17b757,{'showHidden':![],'depth':null}));if(this[_0x2f99('0xa')][_0x17b757[_0x2f99('0x2a')]]){for(var _0x52c7f6 in this[_0x2f99('0xa')][_0x17b757[_0x2f99('0x2a')]]){if(this[_0x2f99('0xa')][_0x17b757[_0x2f99('0x2a')]]['hasOwnProperty'](_0x52c7f6)){if(this['channels'][_0x17b757[_0x2f99('0x2a')]][_0x52c7f6][_0x2f99('0x5e')]==_0x2f99('0x7e')&&this[_0x2f99('0xa')][_0x17b757[_0x2f99('0x2a')]][_0x52c7f6][_0x2f99('0x15')]){logger[_0x2f99('0x24')](_0x2f99('0x7f'),_0x17b757[_0x2f99('0x2a')],_0x52c7f6);this[_0x2f99('0xa')][_0x17b757[_0x2f99('0x2a')]][_0x52c7f6][_0x2f99('0x80')]=moment()[_0x2f99('0x2b')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x2f99('0x81'),_0x17b757[_0x2f99('0x2a')],util[_0x2f99('0x35')](_[_0x2f99('0x82')](this[_0x2f99('0xa')][_0x17b757['uniqueid']]),{'showHidden':![],'depth':null}));ami['emit'](_0x2f99('0x83'),_['values'](this[_0x2f99('0xa')][_0x17b757[_0x2f99('0x2a')]]));delete this['channels'][_0x17b757[_0x2f99('0x2a')]];}if(this[_0x2f99('0xe')][_0x17b757['uniqueid']]){delete this[_0x2f99('0xe')][_0x17b757[_0x2f99('0x2a')]];}}}catch(_0x659477){logger[_0x2f99('0x3b')](_0x2f99('0x84'),_0x17b757[_0x2f99('0x2a')],util['inspect'](_0x659477,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2f99('0x1f')]['syncAttendedTransfer']=function(_0x2bd0f9){try{if(this['isNotNull'](_0x2bd0f9)){logger[_0x2f99('0x28')](_0x2f99('0x85'),_0x2bd0f9[_0x2f99('0x2a')],util[_0x2f99('0x35')](_0x2bd0f9,{'showHidden':![],'depth':null}));if(this[_0x2f99('0xa')][_0x2bd0f9[_0x2f99('0x86')]]){for(var _0x51d6f5 in this[_0x2f99('0xa')][_0x2bd0f9['transfereeuniqueid']]){if(this[_0x2f99('0xa')][_0x2bd0f9[_0x2f99('0x86')]]['hasOwnProperty'](_0x51d6f5)){if(_0x2bd0f9[_0x2f99('0x87')]===_0x51d6f5){logger[_0x2f99('0x24')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2bd0f9[_0x2f99('0x2a')],this[_0x2f99('0xa')][_0x2bd0f9[_0x2f99('0x86')]][_0x51d6f5][_0x2f99('0x26')],_0x51d6f5);var _0x5557e1=moment();this[_0x2f99('0xa')][_0x2bd0f9[_0x2f99('0x86')]][_0x51d6f5][_0x2f99('0x15')]=!![];this[_0x2f99('0xa')][_0x2bd0f9[_0x2f99('0x86')]][_0x51d6f5]['agentcompleteAt']=moment()[_0x2f99('0x2b')](_0x2f99('0x2c'));this[_0x2f99('0xa')][_0x2bd0f9['transfereeuniqueid']][_0x51d6f5]['lastevent']=_0x2f99('0x5d');this[_0x2f99('0xa')][_0x2bd0f9[_0x2f99('0x86')]][_0x51d6f5][_0x2f99('0x5e')]='transfer';this['channels'][_0x2bd0f9[_0x2f99('0x86')]][_0x51d6f5][_0x2f99('0x60')]=_0x5557e1[_0x2f99('0x88')](this[_0x2f99('0xa')][_0x2bd0f9['transfereeuniqueid']][_0x51d6f5][_0x2f99('0x5b')],'seconds');}}}}if(this[_0x2f99('0xa')][_0x2bd0f9['secondtransfereruniqueid']]){var _0x29e40d=this[_0x2f99('0xa')][_0x2bd0f9[_0x2f99('0x89')]];this[_0x2f99('0xa')][_0x2bd0f9[_0x2f99('0x89')]]=this[_0x2f99('0xa')][_0x2bd0f9['transfereeuniqueid']];this[_0x2f99('0xa')][_0x2bd0f9[_0x2f99('0x86')]]=_0x29e40d;}}}catch(_0x4f75cd){logger[_0x2f99('0x3b')](_0x2f99('0x8a'),_0x2bd0f9[_0x2f99('0x2a')],util[_0x2f99('0x35')](_0x4f75cd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2f99('0x1f')][_0x2f99('0x1e')]=function(_0x50020a){try{if(this[_0x2f99('0x23')](_0x50020a)){logger[_0x2f99('0x28')](_0x2f99('0x8b'),_0x50020a['uniqueid'],util['inspect'](_0x50020a,{'showHidden':![],'depth':null}));if(this[_0x2f99('0xa')][_0x50020a[_0x2f99('0x86')]]){for(var _0xa8b9f0 in this[_0x2f99('0xa')][_0x50020a[_0x2f99('0x86')]]){if(this[_0x2f99('0xa')][_0x50020a[_0x2f99('0x86')]][_0x2f99('0x3c')](_0xa8b9f0)){if(_0x50020a[_0x2f99('0x8c')]===_0xa8b9f0){logger[_0x2f99('0x24')](_0x2f99('0x8d'),_0x50020a[_0x2f99('0x2a')],this['channels'][_0x50020a['transfereeuniqueid']][_0xa8b9f0][_0x2f99('0x26')],_0xa8b9f0);var _0x2422bc=moment();this[_0x2f99('0xa')][_0x50020a['transfereeuniqueid']][_0xa8b9f0]['agentcomplete']=!![];this[_0x2f99('0xa')][_0x50020a['transfereeuniqueid']][_0xa8b9f0][_0x2f99('0x80')]=_0x2422bc;this[_0x2f99('0xa')][_0x50020a['transfereeuniqueid']][_0xa8b9f0][_0x2f99('0x43')]='complete';this[_0x2f99('0xa')][_0x50020a['transfereeuniqueid']][_0xa8b9f0][_0x2f99('0x5e')]='transfer';this[_0x2f99('0xa')][_0x50020a[_0x2f99('0x86')]][_0xa8b9f0][_0x2f99('0x60')]=_0x2422bc[_0x2f99('0x88')](this['channels'][_0x50020a[_0x2f99('0x86')]][_0xa8b9f0][_0x2f99('0x5b')],_0x2f99('0x8e'));}}}}}}catch(_0x5b188f){logger[_0x2f99('0x3b')]('[%s][voiceAgentReport][blindtransfer]',_0x50020a[_0x2f99('0x2a')],util[_0x2f99('0x35')](_0x5b188f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2f99('0x1f')][_0x2f99('0x19')]=function(_0x54a062){var _0x43d5d9='';try{if(this[_0x2f99('0x23')](_0x54a062)){logger[_0x2f99('0x28')](_0x2f99('0x8f'),_0x54a062[_0x2f99('0x2a')],util[_0x2f99('0x35')](_0x54a062,{'showHidden':![],'depth':null}));if(_0x54a062['channel']){_0x43d5d9=_0x54a062[_0x2f99('0x90')]['substring'](0x0,_0x54a062[_0x2f99('0x90')][_0x2f99('0x91')]('-'));if(this[_0x2f99('0xd')][_0x43d5d9]){logger['info']('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x54a062[_0x2f99('0x2a')],_0x43d5d9);this[_0x2f99('0xd')][_0x43d5d9][_0x2f99('0x92')]=!![];}}}}catch(_0x3f855e){logger[_0x2f99('0x3b')](_0x2f99('0x93'),_0x54a062[_0x2f99('0x2a')],util[_0x2f99('0x35')](_0x3f855e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2f99('0x1f')][_0x2f99('0x1b')]=function(_0x2df581){var _0x5b6b2b='';try{if(this[_0x2f99('0x23')](_0x2df581)){logger['debug']('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x2df581[_0x2f99('0x2a')],util[_0x2f99('0x35')](_0x2df581,{'showHidden':![],'depth':null}));if(_0x2df581[_0x2f99('0x90')]){_0x5b6b2b=_0x2df581[_0x2f99('0x90')][_0x2f99('0x94')](0x0,_0x2df581[_0x2f99('0x90')][_0x2f99('0x91')]('-'));if(this[_0x2f99('0xd')][_0x5b6b2b]){logger[_0x2f99('0x24')](_0x2f99('0x95'),_0x2df581['uniqueid'],_0x5b6b2b);this[_0x2f99('0xd')][_0x5b6b2b][_0x2f99('0x92')]=![];}}}}catch(_0x1183df){logger[_0x2f99('0x3b')](_0x2f99('0x96'),_0x2df581[_0x2f99('0x2a')],util['inspect'](_0x1183df,{'showHidden':![],'depth':null}));}};module[_0x2f99('0x97')]=VoiceAgentReport;
\ No newline at end of file
+var _0x8a85=['[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','onhold','[%s][voiceAgentReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','ami','../ami','defaults','redis','socket.io-emitter','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','syncAgentComplete','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','prototype','emit','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','channels','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','voice','event','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:%s','user:called','error','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','reason','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','transfer','agent','talktime','agentacw','omit','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','syncVarSet','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','value','[%s][voiceAgentReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','agentcompleteAt','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','custom:voiceAgentReport','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','diff','secondtransfereruniqueid','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete'];(function(_0x56c679,_0x3ac6c4){var _0x5c8ef3=function(_0x12982c){while(--_0x12982c){_0x56c679['push'](_0x56c679['shift']());}};_0x5c8ef3(++_0x3ac6c4);}(_0x8a85,0x139));var _0x58a8=function(_0x30da4e,_0x9bd90){_0x30da4e=_0x30da4e-0x0;var _0x270ba9=_0x8a85[_0x30da4e];return _0x270ba9;};'use strict';var _=require(_0x58a8('0x0'));var moment=require(_0x58a8('0x1'));var util=require(_0x58a8('0x2'));var Redis=require(_0x58a8('0x3'));var config=require(_0x58a8('0x4'));var logger=require('../../../config/logger')(_0x58a8('0x5'));var ami=require(_0x58a8('0x6'));config['redis']=_[_0x58a8('0x7')](config[_0x58a8('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x58a8('0x9'))(new Redis(config[_0x58a8('0x8')]));function VoiceAgentReport(_0x23ef95){this['channels']={};this['voiceChannels']=_0x23ef95['channels'];this[_0x58a8('0xa')]=_0x23ef95[_0x58a8('0xa')];this[_0x58a8('0xb')]=_0x23ef95[_0x58a8('0xb')];this[_0x58a8('0xc')]={};ami['on'](_0x58a8('0xd'),this[_0x58a8('0xe')][_0x58a8('0xf')](this));ami['on'](_0x58a8('0x10'),this[_0x58a8('0x11')]['bind'](this));ami['on'](_0x58a8('0x12'),this[_0x58a8('0x13')][_0x58a8('0xf')](this));ami['on'](_0x58a8('0x14'),this['syncQueueCallerAbandon'][_0x58a8('0xf')](this));ami['on'](_0x58a8('0x15'),this[_0x58a8('0x16')]['bind'](this));ami['on']('varset',this['syncVarSet'][_0x58a8('0xf')](this));ami['on'](_0x58a8('0x17'),this[_0x58a8('0x18')][_0x58a8('0xf')](this));ami['on']('musiconholdstart',this[_0x58a8('0x19')][_0x58a8('0xf')](this));ami['on'](_0x58a8('0x1a'),this['syncMusicOnHoldStop'][_0x58a8('0xf')](this));ami['on'](_0x58a8('0x1b'),this[_0x58a8('0x1c')]['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x58a8('0xf')](this));}VoiceAgentReport[_0x58a8('0x1d')][_0x58a8('0x1e')]=function(_0x290517,_0x5c8395,_0x46e3e9){io['to'](_0x290517)[_0x58a8('0x1e')](_0x5c8395,_0x46e3e9);};VoiceAgentReport[_0x58a8('0x1d')][_0x58a8('0x1f')]=function(_0x44f39e){return _0x44f39e!==null&&!_[_0x58a8('0x20')](_0x44f39e);};VoiceAgentReport[_0x58a8('0x1d')][_0x58a8('0xe')]=function(_0x2e7bc9){try{if(this['isNotNull'](_0x2e7bc9)){logger[_0x58a8('0x21')](_0x58a8('0x22'),_0x2e7bc9[_0x58a8('0x23')],_0x2e7bc9[_0x58a8('0x24')],_0x2e7bc9[_0x58a8('0x25')]);logger[_0x58a8('0x26')](_0x58a8('0x27'),_0x2e7bc9[_0x58a8('0x23')],util[_0x58a8('0x28')](_0x2e7bc9,{'showHidden':![],'depth':null}));if(_[_0x58a8('0x20')](this[_0x58a8('0x29')][_0x2e7bc9[_0x58a8('0x23')]])){this[_0x58a8('0x29')][_0x2e7bc9[_0x58a8('0x23')]]={};}if(_['isUndefined'](this['channels'][_0x2e7bc9['uniqueid']][_0x2e7bc9[_0x58a8('0x25')]])){this['channels'][_0x2e7bc9[_0x58a8('0x23')]][_0x2e7bc9[_0x58a8('0x25')]]={'agentcalledAt':moment()['format'](_0x58a8('0x2a')),'lastevent':_0x58a8('0x2b'),'mandatoryDisposition':this[_0x58a8('0xa')][_0x2e7bc9[_0x58a8('0x2c')]]?this[_0x58a8('0xa')][_0x2e7bc9[_0x58a8('0x2c')]][_0x58a8('0x2d')]||![]:![],'type':this[_0x58a8('0xa')][_0x2e7bc9['queue']]?this[_0x58a8('0xa')][_0x2e7bc9['queue']][_0x58a8('0x2e')]||_0x58a8('0x2f'):_0x58a8('0x2f'),'variables':this['variables'][_0x2e7bc9[_0x58a8('0x23')]],'motionChannel':_0x58a8('0x30')};}_['merge'](this[_0x58a8('0x29')][_0x2e7bc9[_0x58a8('0x23')]][_0x2e7bc9['destuniqueid']],_['omit'](_0x2e7bc9,[_0x58a8('0x31'),'privilege']));logger[_0x58a8('0x26')](_0x58a8('0x32'),_0x2e7bc9['uniqueid'],util['inspect'](this['channels'][_0x2e7bc9[_0x58a8('0x23')]][_0x2e7bc9['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x58a8('0x1e')](_0x58a8('0x33'),this[_0x58a8('0x29')][_0x2e7bc9[_0x58a8('0x23')]][_0x2e7bc9[_0x58a8('0x25')]]);var _0x1bdb1d={'id':this[_0x58a8('0xb')][_0x2e7bc9['interface']]['id'],'calleridnum':this[_0x58a8('0x29')][_0x2e7bc9[_0x58a8('0x23')]][_0x2e7bc9[_0x58a8('0x25')]][_0x58a8('0x34')],'queue':this[_0x58a8('0x29')][_0x2e7bc9[_0x58a8('0x23')]][_0x2e7bc9['destuniqueid']][_0x58a8('0x2c')],'variables':this[_0x58a8('0x29')][_0x2e7bc9[_0x58a8('0x23')]][_0x2e7bc9[_0x58a8('0x25')]]['variables']};logger['debug'](_0x58a8('0x35'),_0x2e7bc9['uniqueid'],util[_0x58a8('0x28')](_0x1bdb1d,{'showHidden':![],'depth':null}));this[_0x58a8('0x1e')](util[_0x58a8('0x36')](_0x58a8('0x37'),_0x2e7bc9[_0x58a8('0x24')]),_0x58a8('0x38'),_0x1bdb1d);}}catch(_0x8e12af){logger[_0x58a8('0x39')]('[%s][voiceAgentReport][agentcalled]',_0x2e7bc9['uniqueid'],util[_0x58a8('0x28')](_0x8e12af,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x58a8('0x11')]=function(_0x3e0a30){try{if(this[_0x58a8('0x1f')](_0x3e0a30)){if(this[_0x58a8('0x29')][_0x3e0a30[_0x58a8('0x23')]]){logger[_0x58a8('0x26')]('[%s][voiceAgentReport][agentconnect]\x20event:',_0x3e0a30[_0x58a8('0x23')],util[_0x58a8('0x28')](_0x3e0a30,{'showHidden':![],'depth':null}));for(var _0xccfe3a in this['channels'][_0x3e0a30['uniqueid']]){if(this[_0x58a8('0x29')][_0x3e0a30[_0x58a8('0x23')]][_0x58a8('0x3a')](_0xccfe3a)){if(_0x3e0a30[_0x58a8('0x25')]===_0xccfe3a){logger[_0x58a8('0x21')](_0x58a8('0x3b'),_0x3e0a30[_0x58a8('0x23')],_0x3e0a30[_0x58a8('0x24')],_0x3e0a30[_0x58a8('0x25')]);this[_0x58a8('0x29')][_0x3e0a30[_0x58a8('0x23')]][_0xccfe3a][_0x58a8('0x3c')]=moment()[_0x58a8('0x36')](_0x58a8('0x2a'));this['channels'][_0x3e0a30[_0x58a8('0x23')]][_0xccfe3a][_0x58a8('0x3d')]=_0x3e0a30[_0x58a8('0x3d')];this[_0x58a8('0x29')][_0x3e0a30[_0x58a8('0x23')]][_0xccfe3a][_0x58a8('0x3e')]=_0x3e0a30[_0x58a8('0x3e')];this[_0x58a8('0x29')][_0x3e0a30[_0x58a8('0x23')]][_0xccfe3a][_0x58a8('0x3f')]=_0x3e0a30[_0x58a8('0x3f')];this[_0x58a8('0x29')][_0x3e0a30[_0x58a8('0x23')]][_0xccfe3a][_0x58a8('0x40')]=_0x3e0a30[_0x58a8('0x40')];this['channels'][_0x3e0a30[_0x58a8('0x23')]][_0xccfe3a]['holdtime']=_0x3e0a30[_0x58a8('0x41')];this[_0x58a8('0x29')][_0x3e0a30[_0x58a8('0x23')]][_0xccfe3a][_0x58a8('0x42')]=_0x58a8('0x43');if(this['voiceChannels'][this[_0x58a8('0x29')][_0x3e0a30[_0x58a8('0x23')]][_0xccfe3a][_0x58a8('0x23')]]){var _0x12aa5c=this['voiceChannels'][this[_0x58a8('0x29')][_0x3e0a30['uniqueid']][_0xccfe3a][_0x58a8('0x23')]][_0x58a8('0x44')];this[_0x58a8('0x29')][_0x3e0a30[_0x58a8('0x23')]][_0xccfe3a][_0x58a8('0x44')]=_0x12aa5c;_0x3e0a30[_0x58a8('0x44')]=_0x12aa5c;}_['merge'](this[_0x58a8('0xb')][_0x3e0a30[_0x58a8('0x45')]],_[_0x58a8('0x46')](_0x3e0a30,[_0x58a8('0x2c'),_0x58a8('0x47'),'routealias']));logger[_0x58a8('0x26')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x3e0a30[_0x58a8('0x23')],util['inspect'](this[_0x58a8('0x29')][_0x3e0a30[_0x58a8('0x23')]][_0x3e0a30[_0x58a8('0x25')]],{'showHidden':![],'depth':null}));ami[_0x58a8('0x1e')](_0x58a8('0x48'),this['channels'][_0x3e0a30[_0x58a8('0x23')]][_0x3e0a30[_0x58a8('0x25')]]);logger[_0x58a8('0x26')](_0x58a8('0x49'),_0x3e0a30[_0x58a8('0x23')],util[_0x58a8('0x28')](this[_0x58a8('0x29')][_0x3e0a30[_0x58a8('0x23')]][_0x3e0a30['destuniqueid']],{'showHidden':![],'depth':null}));this[_0x58a8('0x1e')](util[_0x58a8('0x36')](_0x58a8('0x37'),_0x3e0a30['membername']),_0x58a8('0x4a'),this['channels'][_0x3e0a30[_0x58a8('0x23')]][_0x3e0a30[_0x58a8('0x25')]]);}else if(!this[_0x58a8('0x29')][_0x3e0a30[_0x58a8('0x23')]][_0xccfe3a][_0x58a8('0x12')]&&!this[_0x58a8('0x29')][_0x3e0a30[_0x58a8('0x23')]][_0xccfe3a]['agentcomplete']){logger[_0x58a8('0x21')](_0x58a8('0x4b'),_0x3e0a30[_0x58a8('0x23')],this[_0x58a8('0x29')][_0x3e0a30['uniqueid']][_0xccfe3a]['membername'],_0xccfe3a);this[_0x58a8('0x29')][_0x3e0a30[_0x58a8('0x23')]][_0xccfe3a][_0x58a8('0x12')]=!![];this['channels'][_0x3e0a30[_0x58a8('0x23')]][_0xccfe3a][_0x58a8('0x4c')]=moment()[_0x58a8('0x36')](_0x58a8('0x2a'));this[_0x58a8('0x29')][_0x3e0a30['uniqueid']][_0xccfe3a][_0x58a8('0x4d')]=_0x3e0a30['destuniqueid'];this[_0x58a8('0x29')][_0x3e0a30['uniqueid']][_0xccfe3a][_0x58a8('0x4e')]=_0x3e0a30['membername'];this[_0x58a8('0x29')][_0x3e0a30['uniqueid']][_0xccfe3a][_0x58a8('0x42')]=_0x58a8('0x4f');this[_0x58a8('0x29')][_0x3e0a30[_0x58a8('0x23')]][_0xccfe3a]['reason']='answered_elsewhere';logger[_0x58a8('0x26')](_0x58a8('0x50'),_0x3e0a30[_0x58a8('0x23')],util['inspect'](this[_0x58a8('0x29')][_0x3e0a30[_0x58a8('0x23')]][_0xccfe3a],{'showHidden':![],'depth':null}));ami[_0x58a8('0x1e')](_0x58a8('0x51'),this[_0x58a8('0x29')][_0x3e0a30[_0x58a8('0x23')]][_0xccfe3a]);}}}}}}catch(_0x4219b6){logger[_0x58a8('0x39')](_0x58a8('0x52'),_0x3e0a30[_0x58a8('0x23')],util[_0x58a8('0x28')](_0x4219b6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x58a8('0x1d')][_0x58a8('0x13')]=function(_0xe9f98b){try{if(this[_0x58a8('0x1f')](_0xe9f98b)){logger[_0x58a8('0x26')](_0x58a8('0x53'),_0xe9f98b[_0x58a8('0x23')],util[_0x58a8('0x28')](_0xe9f98b,{'showHidden':![],'depth':null}));if(this['channels'][_0xe9f98b[_0x58a8('0x23')]]&&this[_0x58a8('0x29')][_0xe9f98b['uniqueid']][_0xe9f98b[_0x58a8('0x25')]]){logger[_0x58a8('0x21')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0xe9f98b[_0x58a8('0x23')],_0xe9f98b[_0x58a8('0x24')],_0xe9f98b['destuniqueid']);this[_0x58a8('0x29')][_0xe9f98b[_0x58a8('0x23')]][_0xe9f98b[_0x58a8('0x25')]][_0x58a8('0x12')]=!![];this[_0x58a8('0x29')][_0xe9f98b[_0x58a8('0x23')]][_0xe9f98b[_0x58a8('0x25')]][_0x58a8('0x4c')]=moment()[_0x58a8('0x36')](_0x58a8('0x2a'));this[_0x58a8('0x29')][_0xe9f98b['uniqueid']][_0xe9f98b['destuniqueid']][_0x58a8('0x42')]=_0x58a8('0x54');this[_0x58a8('0x29')][_0xe9f98b[_0x58a8('0x23')]][_0xe9f98b[_0x58a8('0x25')]][_0x58a8('0x55')]=_0x58a8('0x54');logger['debug'](_0x58a8('0x56'),_0xe9f98b[_0x58a8('0x23')],util[_0x58a8('0x28')](this['channels'][_0xe9f98b[_0x58a8('0x23')]][_0xe9f98b[_0x58a8('0x25')]],{'showHidden':![],'depth':null}));ami['emit'](_0x58a8('0x57'),this[_0x58a8('0x29')][_0xe9f98b['uniqueid']][_0xe9f98b[_0x58a8('0x25')]]);}}}catch(_0xa4c02){logger[_0x58a8('0x39')]('[%s][voiceAgentReport][agentringnoanswer]',_0xe9f98b[_0x58a8('0x23')],util[_0x58a8('0x28')](_0xa4c02,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x58a8('0x1d')][_0x58a8('0x58')]=function(_0x4589ab){try{if(this[_0x58a8('0x1f')](_0x4589ab)){logger[_0x58a8('0x26')]('[%s][voiceAgentReport][queuecallerabandon]\x20event:',_0x4589ab['uniqueid'],util[_0x58a8('0x28')](_0x4589ab,{'showHidden':![],'depth':null}));if(this[_0x58a8('0x29')][_0x4589ab[_0x58a8('0x23')]]){for(var _0x4dc72f in this[_0x58a8('0x29')][_0x4589ab['uniqueid']]){if(this[_0x58a8('0x29')][_0x4589ab[_0x58a8('0x23')]]['hasOwnProperty'](_0x4dc72f)&&!this[_0x58a8('0x29')][_0x4589ab['uniqueid']][_0x4dc72f][_0x58a8('0x12')]&&!this['channels'][_0x4589ab['uniqueid']][_0x4dc72f][_0x58a8('0x15')]){logger[_0x58a8('0x21')](_0x58a8('0x59'),_0x4589ab[_0x58a8('0x23')],this[_0x58a8('0x29')][_0x4589ab[_0x58a8('0x23')]][_0x4dc72f][_0x58a8('0x24')],_0x4dc72f);this[_0x58a8('0x29')][_0x4589ab['uniqueid']][_0x4dc72f][_0x58a8('0x12')]=!![];this[_0x58a8('0x29')][_0x4589ab[_0x58a8('0x23')]][_0x4dc72f][_0x58a8('0x4c')]=moment()[_0x58a8('0x36')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x58a8('0x29')][_0x4589ab[_0x58a8('0x23')]][_0x4dc72f][_0x58a8('0x42')]=_0x58a8('0x5a');this[_0x58a8('0x29')][_0x4589ab['uniqueid']][_0x4dc72f][_0x58a8('0x55')]=_0x58a8('0x5a');logger[_0x58a8('0x26')](_0x58a8('0x5b'),_0x4589ab[_0x58a8('0x23')],util['inspect'](this['channels'][_0x4589ab[_0x58a8('0x23')]][_0x4dc72f],{'showHidden':![],'depth':null}));ami['emit'](_0x58a8('0x5c'),this[_0x58a8('0x29')][_0x4589ab[_0x58a8('0x23')]][_0x4dc72f]);}}}}}catch(_0x40c492){logger['error']('[%s][voiceAgentReport][queuecallerabandon]',_0x4589ab['uniqueid'],util[_0x58a8('0x28')](_0x40c492,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x58a8('0x1d')][_0x58a8('0x16')]=function(_0x28d8e5){try{if(this['isNotNull'](_0x28d8e5)){logger[_0x58a8('0x26')](_0x58a8('0x5d'),_0x28d8e5['uniqueid'],util['inspect'](_0x28d8e5,{'showHidden':![],'depth':null}));if(this['channels'][_0x28d8e5[_0x58a8('0x23')]]){for(var _0x145c20 in this[_0x58a8('0x29')][_0x28d8e5[_0x58a8('0x23')]]){if(this[_0x58a8('0x29')][_0x28d8e5[_0x58a8('0x23')]][_0x58a8('0x3a')](_0x145c20)){if(this[_0x58a8('0x29')][_0x28d8e5[_0x58a8('0x23')]][_0x145c20][_0x58a8('0x3c')]&&!this['channels'][_0x28d8e5[_0x58a8('0x23')]][_0x145c20][_0x58a8('0x15')]){logger[_0x58a8('0x21')](_0x58a8('0x5e'),_0x28d8e5[_0x58a8('0x23')],this[_0x58a8('0x29')][_0x28d8e5[_0x58a8('0x23')]][_0x145c20][_0x58a8('0x24')],_0x145c20);this[_0x58a8('0x29')][_0x28d8e5['uniqueid']][_0x145c20][_0x58a8('0x15')]=!![];this[_0x58a8('0x29')][_0x28d8e5[_0x58a8('0x23')]][_0x145c20]['agentcompleteAt']=moment()[_0x58a8('0x36')](_0x58a8('0x2a'));this[_0x58a8('0x29')][_0x28d8e5['uniqueid']][_0x145c20][_0x58a8('0x42')]='complete';this[_0x58a8('0x29')][_0x28d8e5[_0x58a8('0x23')]][_0x145c20][_0x58a8('0x55')]=_0x28d8e5[_0x58a8('0x55')]==_0x58a8('0x5f')?_0x58a8('0x60'):_0x28d8e5[_0x58a8('0x55')];this[_0x58a8('0x29')][_0x28d8e5['uniqueid']][_0x145c20][_0x58a8('0x61')]=_0x28d8e5[_0x58a8('0x61')];if(this[_0x58a8('0xa')][_0x28d8e5[_0x58a8('0x2c')]]&&this['voiceQueues'][_0x28d8e5['queue']]['acw']){this[_0x58a8('0x29')][_0x28d8e5[_0x58a8('0x23')]][_0x145c20]['acwtime']=this[_0x58a8('0xa')][_0x28d8e5[_0x58a8('0x2c')]]['acwTimeout'];this['channels'][_0x28d8e5[_0x58a8('0x23')]][_0x145c20][_0x58a8('0x62')]=!![];}this[_0x58a8('0xb')][_0x28d8e5[_0x58a8('0x45')]]=_[_0x58a8('0x63')](this[_0x58a8('0xb')][_0x28d8e5[_0x58a8('0x45')]],[_0x58a8('0x2c'),_0x58a8('0x47')]);logger[_0x58a8('0x26')](_0x58a8('0x64'),_0x28d8e5[_0x58a8('0x23')],util[_0x58a8('0x28')](this[_0x58a8('0x29')][_0x28d8e5['uniqueid']][_0x145c20],{'showHidden':![],'depth':null}));ami['emit'](_0x58a8('0x65'),this[_0x58a8('0x29')][_0x28d8e5[_0x58a8('0x23')]][_0x145c20]);logger[_0x58a8('0x26')](_0x58a8('0x66'),_0x28d8e5[_0x58a8('0x23')],util[_0x58a8('0x28')]({'id':this[_0x58a8('0xb')][_0x28d8e5['interface']]['id'],'destaccountcode':_0x28d8e5[_0x58a8('0x67')]},{'showHidden':![],'depth':null}));this[_0x58a8('0x1e')](util['format']('user:%s',_0x28d8e5[_0x58a8('0x24')]),_0x58a8('0x68'),{'id':this[_0x58a8('0xb')][_0x28d8e5[_0x58a8('0x45')]]['id'],'destaccountcode':_0x28d8e5[_0x58a8('0x67')]});}}}}}}catch(_0x34f0a1){logger['error'](_0x58a8('0x69'),_0x28d8e5[_0x58a8('0x23')],util[_0x58a8('0x28')](_0x34f0a1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x58a8('0x1d')][_0x58a8('0x6a')]=function(_0x3a24c5){try{if(this[_0x58a8('0x1f')](_0x3a24c5)){logger[_0x58a8('0x26')](_0x58a8('0x6b'),_0x3a24c5['uniqueid'],util['inspect'](_0x3a24c5,{'showHidden':![],'depth':null}));this[_0x58a8('0x6c')](_0x3a24c5['uniqueid'],_[_0x58a8('0x6d')](_0x3a24c5[_0x58a8('0x6e')])[0x0],_0x3a24c5['value']);if(this['channels'][_0x3a24c5['uniqueid']]){for(var _0x902a99 in this[_0x58a8('0x29')][_0x3a24c5[_0x58a8('0x23')]]){if(this[_0x58a8('0x29')][_0x3a24c5[_0x58a8('0x23')]][_0x58a8('0x3a')](_0x902a99)){logger[_0x58a8('0x21')](_0x58a8('0x6f'),_0x3a24c5[_0x58a8('0x23')],_0x902a99,_[_0x58a8('0x6d')](_0x3a24c5[_0x58a8('0x6e')])[0x0],_0x3a24c5[_0x58a8('0x70')]);if(_[_0x58a8('0x20')](this['channels'][_0x3a24c5['uniqueid']][_0x902a99][_0x58a8('0xc')])){this[_0x58a8('0x29')][_0x3a24c5['uniqueid']][_0x902a99]['variables']={};}this[_0x58a8('0x29')][_0x3a24c5['uniqueid']][_0x902a99][_0x58a8('0xc')]=this[_0x58a8('0xc')][_0x3a24c5['uniqueid']];}}}}}catch(_0x4c24ef){logger['error'](_0x58a8('0x71'),_0x3a24c5[_0x58a8('0x23')],util[_0x58a8('0x28')](_0x4c24ef,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x58a8('0x1d')][_0x58a8('0x6c')]=function(_0x35da1e,_0x4e7d3c,_0x97e53){var _0x83a798=['rtpaudioqos',_0x58a8('0x72'),_0x58a8('0x73'),'rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged',_0x58a8('0x74'),_0x58a8('0x75'),_0x58a8('0x76'),'sipuri','bridgepeer',_0x58a8('0x77'),_0x58a8('0x78'),_0x58a8('0x79'),_0x58a8('0x7a'),_0x58a8('0x7b'),_0x58a8('0x24'),'memberpenalty',_0x58a8('0x7c')];if(!_[_0x58a8('0x7d')](_0x4e7d3c)&&!_[_0x58a8('0x7e')](_0x83a798,_0x4e7d3c)){if(_[_0x58a8('0x20')](this[_0x58a8('0xc')][_0x35da1e])){this['variables'][_0x35da1e]={};}this[_0x58a8('0xc')][_0x35da1e][_0x4e7d3c]=_0x97e53;}};VoiceAgentReport['prototype']['syncHangup']=function(_0x1b3338){try{if(this[_0x58a8('0x1f')](_0x1b3338)){logger[_0x58a8('0x26')](_0x58a8('0x7f'),_0x1b3338[_0x58a8('0x23')],util[_0x58a8('0x28')](_0x1b3338,{'showHidden':![],'depth':null}));if(this[_0x58a8('0x29')][_0x1b3338[_0x58a8('0x23')]]){for(var _0x27ac3e in this[_0x58a8('0x29')][_0x1b3338[_0x58a8('0x23')]]){if(this[_0x58a8('0x29')][_0x1b3338[_0x58a8('0x23')]][_0x58a8('0x3a')](_0x27ac3e)){if(this[_0x58a8('0x29')][_0x1b3338[_0x58a8('0x23')]][_0x27ac3e][_0x58a8('0x55')]==_0x58a8('0x5f')&&this[_0x58a8('0x29')][_0x1b3338[_0x58a8('0x23')]][_0x27ac3e][_0x58a8('0x15')]){logger['info'](_0x58a8('0x80'),_0x1b3338[_0x58a8('0x23')],_0x27ac3e);this['channels'][_0x1b3338[_0x58a8('0x23')]][_0x27ac3e][_0x58a8('0x81')]=moment()[_0x58a8('0x36')](_0x58a8('0x2a'));}}}logger[_0x58a8('0x26')](_0x58a8('0x82'),_0x1b3338[_0x58a8('0x23')],util[_0x58a8('0x28')](_['values'](this[_0x58a8('0x29')][_0x1b3338[_0x58a8('0x23')]]),{'showHidden':![],'depth':null}));ami['emit'](_0x58a8('0x83'),_['values'](this[_0x58a8('0x29')][_0x1b3338['uniqueid']]));delete this[_0x58a8('0x29')][_0x1b3338[_0x58a8('0x23')]];}if(this['variables'][_0x1b3338[_0x58a8('0x23')]]){delete this[_0x58a8('0xc')][_0x1b3338[_0x58a8('0x23')]];}}}catch(_0x290f2a){logger['error']('[%s][voiceAgentReport][hangup]',_0x1b3338['uniqueid'],util[_0x58a8('0x28')](_0x290f2a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x58a8('0x1d')][_0x58a8('0x1c')]=function(_0x4ea9b1){try{if(this[_0x58a8('0x1f')](_0x4ea9b1)){logger[_0x58a8('0x26')]('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0x4ea9b1[_0x58a8('0x23')],util[_0x58a8('0x28')](_0x4ea9b1,{'showHidden':![],'depth':null}));if(this[_0x58a8('0x29')][_0x4ea9b1[_0x58a8('0x84')]]){for(var _0x275e97 in this[_0x58a8('0x29')][_0x4ea9b1[_0x58a8('0x84')]]){if(this[_0x58a8('0x29')][_0x4ea9b1['transfereeuniqueid']][_0x58a8('0x3a')](_0x275e97)){if(_0x4ea9b1[_0x58a8('0x85')]===_0x275e97){logger['info'](_0x58a8('0x86'),_0x4ea9b1[_0x58a8('0x23')],this['channels'][_0x4ea9b1[_0x58a8('0x84')]][_0x275e97][_0x58a8('0x24')],_0x275e97);var _0x2117b8=moment();this[_0x58a8('0x29')][_0x4ea9b1[_0x58a8('0x84')]][_0x275e97][_0x58a8('0x15')]=!![];this[_0x58a8('0x29')][_0x4ea9b1[_0x58a8('0x84')]][_0x275e97][_0x58a8('0x81')]=moment()['format'](_0x58a8('0x2a'));this[_0x58a8('0x29')][_0x4ea9b1['transfereeuniqueid']][_0x275e97]['lastevent']=_0x58a8('0x87');this[_0x58a8('0x29')][_0x4ea9b1[_0x58a8('0x84')]][_0x275e97][_0x58a8('0x55')]=_0x58a8('0x5f');this[_0x58a8('0x29')][_0x4ea9b1[_0x58a8('0x84')]][_0x275e97][_0x58a8('0x61')]=_0x2117b8[_0x58a8('0x88')](this[_0x58a8('0x29')][_0x4ea9b1[_0x58a8('0x84')]][_0x275e97]['agentconnectAt'],'seconds');}}}}if(this['channels'][_0x4ea9b1[_0x58a8('0x89')]]){var _0x221350=this['channels'][_0x4ea9b1[_0x58a8('0x89')]];this[_0x58a8('0x29')][_0x4ea9b1[_0x58a8('0x89')]]=this['channels'][_0x4ea9b1['transfereeuniqueid']];this[_0x58a8('0x29')][_0x4ea9b1[_0x58a8('0x84')]]=_0x221350;}}}catch(_0x39a494){logger[_0x58a8('0x39')]('[%s][voiceAgentReport][attendedtransfer]',_0x4ea9b1[_0x58a8('0x23')],util[_0x58a8('0x28')](_0x39a494,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x58a8('0x1d')]['syncBlindTransfer']=function(_0x2176b7){try{if(this[_0x58a8('0x1f')](_0x2176b7)){logger[_0x58a8('0x26')]('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x2176b7['uniqueid'],util[_0x58a8('0x28')](_0x2176b7,{'showHidden':![],'depth':null}));if(this['channels'][_0x2176b7[_0x58a8('0x84')]]){for(var _0x2e2ec3 in this[_0x58a8('0x29')][_0x2176b7[_0x58a8('0x84')]]){if(this[_0x58a8('0x29')][_0x2176b7[_0x58a8('0x84')]][_0x58a8('0x3a')](_0x2e2ec3)){if(_0x2176b7[_0x58a8('0x8a')]===_0x2e2ec3){logger[_0x58a8('0x21')](_0x58a8('0x8b'),_0x2176b7[_0x58a8('0x23')],this['channels'][_0x2176b7[_0x58a8('0x84')]][_0x2e2ec3]['membername'],_0x2e2ec3);var _0x34560a=moment();this[_0x58a8('0x29')][_0x2176b7['transfereeuniqueid']][_0x2e2ec3]['agentcomplete']=!![];this[_0x58a8('0x29')][_0x2176b7[_0x58a8('0x84')]][_0x2e2ec3]['agentcompleteAt']=_0x34560a;this[_0x58a8('0x29')][_0x2176b7[_0x58a8('0x84')]][_0x2e2ec3]['lastevent']=_0x58a8('0x87');this[_0x58a8('0x29')][_0x2176b7[_0x58a8('0x84')]][_0x2e2ec3]['reason']=_0x58a8('0x5f');this[_0x58a8('0x29')][_0x2176b7[_0x58a8('0x84')]][_0x2e2ec3][_0x58a8('0x61')]=_0x34560a[_0x58a8('0x88')](this[_0x58a8('0x29')][_0x2176b7[_0x58a8('0x84')]][_0x2e2ec3][_0x58a8('0x3c')],'seconds');}}}}}}catch(_0x43eddc){logger[_0x58a8('0x39')](_0x58a8('0x8c'),_0x2176b7[_0x58a8('0x23')],util['inspect'](_0x43eddc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x58a8('0x1d')]['syncMusicOnHoldStart']=function(_0x4c4ed0){var _0x3608d1='';try{if(this[_0x58a8('0x1f')](_0x4c4ed0)){logger['debug'](_0x58a8('0x8d'),_0x4c4ed0[_0x58a8('0x23')],util['inspect'](_0x4c4ed0,{'showHidden':![],'depth':null}));if(_0x4c4ed0['channel']){_0x3608d1=_0x4c4ed0[_0x58a8('0x8e')][_0x58a8('0x8f')](0x0,_0x4c4ed0[_0x58a8('0x8e')][_0x58a8('0x90')]('-'));if(this[_0x58a8('0xb')][_0x3608d1]){logger[_0x58a8('0x21')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x4c4ed0['uniqueid'],_0x3608d1);this['agents'][_0x3608d1][_0x58a8('0x91')]=!![];}}}}catch(_0x38ab55){logger[_0x58a8('0x39')](_0x58a8('0x92'),_0x4c4ed0['uniqueid'],util[_0x58a8('0x28')](_0x38ab55,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x58a8('0x1d')][_0x58a8('0x93')]=function(_0x52c1f8){var _0x2b7126='';try{if(this[_0x58a8('0x1f')](_0x52c1f8)){logger[_0x58a8('0x26')](_0x58a8('0x94'),_0x52c1f8['uniqueid'],util['inspect'](_0x52c1f8,{'showHidden':![],'depth':null}));if(_0x52c1f8[_0x58a8('0x8e')]){_0x2b7126=_0x52c1f8['channel'][_0x58a8('0x8f')](0x0,_0x52c1f8[_0x58a8('0x8e')][_0x58a8('0x90')]('-'));if(this['agents'][_0x2b7126]){logger[_0x58a8('0x21')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x52c1f8[_0x58a8('0x23')],_0x2b7126);this[_0x58a8('0xb')][_0x2b7126]['onhold']=![];}}}}catch(_0x293de1){logger[_0x58a8('0x39')](_0x58a8('0x95'),_0x52c1f8[_0x58a8('0x23')],util[_0x58a8('0x28')](_0x293de1,{'showHidden':![],'depth':null}));}};module[_0x58a8('0x96')]=VoiceAgentReport;
\ No newline at end of file
index 303564f..1991130 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa75b=['bind','newchannel','syncNewChannel','syncNewState','varset','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','syncMusicOnHoldStop','info','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','debug','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','linkedid','channels','pick','keys','from-sip','split','exten','xcally-motion-preview','destconnectedlinenum','format','user:%s','channel','name','user:agentconnect','[%s][voiceCallReport][newcallerid]','isNotNull','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','context','starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','merge','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','toLowerCase','appdata','applicationdata','startsWith','application','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','subtract','duration','seconds','disposition','includes','lastapplication','lastdata','cdr(','match','type','isNil','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridnum','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','holdtime','diff','connectedlinenum','destinationchannel','UserId','membername','connectedlinename','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','monitorFilename','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','variable','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','calleridpreview','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','answertime','cause-txt','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','then','undefined','isEmpty','getSettings','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','catch','event','BlindTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','outbound','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','lodash','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','set','queue','agi','dial','playback','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','agents','blindTransfers','coreshowchannel','syncNewExten'];(function(_0x226f94,_0x111cb2){var _0xb4249f=function(_0x3754f9){while(--_0x3754f9){_0x226f94['push'](_0x226f94['shift']());}};_0xb4249f(++_0x111cb2);}(_0xa75b,0x170));var _0xba75=function(_0x48285c,_0x3ee6db){_0x48285c=_0x48285c-0x0;var _0x5fe688=_0xa75b[_0x48285c];return _0x5fe688;};'use strict';var _=require(_0xba75('0x0'));var moment=require('moment');var util=require('util');var path=require(_0xba75('0x1'));var Redis=require(_0xba75('0x2'));var config=require(_0xba75('0x3'));var logger=require(_0xba75('0x4'))(_0xba75('0x5'));var ami=require(_0xba75('0x6'));var Channel=require(_0xba75('0x7'));var RpcSetting=require(_0xba75('0x8'));var applications=[_0xba75('0x9'),_0xba75('0xa'),_0xba75('0xb'),_0xba75('0xc'),_0xba75('0xd'),'voicemail'];var dispositions=['NO\x20ANSWER',_0xba75('0xe'),'FAILED','NO\x20ANSWER',_0xba75('0xf'),'NO\x20ANSWER',_0xba75('0x10'),_0xba75('0x11'),_0xba75('0xe'),_0xba75('0xe'),_0xba75('0xe')];config[_0xba75('0x12')]=_[_0xba75('0x13')](config[_0xba75('0x12')],{'host':_0xba75('0x14'),'port':0x18eb});var io=require(_0xba75('0x15'))(new Redis(config[_0xba75('0x12')]));function VoiceCallReport(_0x1ed697){this['channels']=_0x1ed697['channels'];this[_0xba75('0x16')]=_0x1ed697['agents'];this[_0xba75('0x17')]={};ami['on'](_0xba75('0x18'),this[_0xba75('0x19')][_0xba75('0x1a')](this));ami['on']('newexten',this[_0xba75('0x19')][_0xba75('0x1a')](this));ami['on'](_0xba75('0x1b'),this[_0xba75('0x1c')][_0xba75('0x1a')](this));ami['on']('newstate',this[_0xba75('0x1d')][_0xba75('0x1a')](this));ami['on'](_0xba75('0x1e'),this['syncVarSet'][_0xba75('0x1a')](this));ami['on'](_0xba75('0x1f'),this[_0xba75('0x20')][_0xba75('0x1a')](this));ami['on'](_0xba75('0x21'),this[_0xba75('0x22')]['bind'](this));ami['on'](_0xba75('0x23'),this[_0xba75('0x24')]['bind'](this));ami['on']('blindtransfer',this[_0xba75('0x25')][_0xba75('0x1a')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0xba75('0x1a')](this));ami['on']('musiconholdstop',this[_0xba75('0x26')][_0xba75('0x1a')](this));try{logger[_0xba75('0x27')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0xba75('0x28')]();}catch(_0x221d5e){logger[_0xba75('0x29')](_0xba75('0x2a'),util[_0xba75('0x2b')](_0x221d5e,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xba75('0x2c')]['isNotNull']=function(_0x246c48){return _0x246c48!==null&&!_[_0xba75('0x2d')](_0x246c48);};VoiceCallReport[_0xba75('0x2c')][_0xba75('0x2e')]=function(_0x1caa6,_0x44b1d4,_0x26dd53){io['to'](_0x1caa6)[_0xba75('0x2e')](_0x44b1d4,_0x26dd53);};VoiceCallReport[_0xba75('0x2c')][_0xba75('0x22')]=function(_0x47ddff){try{if(this['isNotNull'](_0x47ddff)){logger['info'](_0xba75('0x2f'),_0x47ddff['uniqueid'],_0x47ddff[_0xba75('0x30')],_0x47ddff['calleridnum']);logger[_0xba75('0x31')](_0xba75('0x32'),_0x47ddff[_0xba75('0x33')],util['inspect'](_0x47ddff,{'showHidden':![],'depth':null}));if(_0x47ddff[_0xba75('0x33')]===_0x47ddff[_0xba75('0x34')]){if(!_[_0xba75('0x2d')](this[_0xba75('0x35')][_0x47ddff['uniqueid']])){_['merge'](this[_0xba75('0x35')][_0x47ddff['uniqueid']],_[_0xba75('0x36')](_0x47ddff,_[_0xba75('0x37')](this[_0xba75('0x35')][_0x47ddff[_0xba75('0x33')]])));}}if(_0x47ddff['context']===_0xba75('0x38')){if(this[_0xba75('0x16')][_0x47ddff['channel'][_0xba75('0x39')]('-')[0x0]]){if(_0x47ddff[_0xba75('0x3a')]==_0xba75('0x3b')){this[_0xba75('0x16')][_0x47ddff['channel'][_0xba75('0x39')]('-')[0x0]][_0xba75('0x3c')]=_0x47ddff['connectedlinenum'];this[_0xba75('0x2e')](util[_0xba75('0x3d')](_0xba75('0x3e'),this['agents'][_0x47ddff[_0xba75('0x3f')][_0xba75('0x39')]('-')[0x0]][_0xba75('0x40')]),_0xba75('0x41'),{'destaccountcode':this[_0xba75('0x16')][_0x47ddff[_0xba75('0x3f')][_0xba75('0x39')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x47ddff['connectedlinenum']});}}}}}catch(_0x80e933){logger[_0xba75('0x29')](_0xba75('0x42'),_0x47ddff['uniqueid'],util[_0xba75('0x2b')](_0x80e933,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xba75('0x2c')]['syncNewChannel']=function(_0x49d0c3){try{if(this[_0xba75('0x43')](_0x49d0c3)){logger[_0xba75('0x31')](_0xba75('0x44'),_0x49d0c3[_0xba75('0x33')],util[_0xba75('0x2b')](_0x49d0c3,{'showHidden':![],'depth':null}));if(this['channels'][_0x49d0c3['uniqueid']])return;if(_0x49d0c3[_0xba75('0x3f')]===_0xba75('0x45'))return;if(_0x49d0c3[_0xba75('0x33')]!==_0x49d0c3[_0xba75('0x34')]&&!this[_0xba75('0x17')][_0x49d0c3[_0xba75('0x34')]])return;logger[_0xba75('0x27')]('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x49d0c3[_0xba75('0x33')],_0x49d0c3[_0xba75('0x46')],_0x49d0c3['exten']);this[_0xba75('0x35')][_0x49d0c3[_0xba75('0x33')]]=new Channel();this[_0xba75('0x35')][_0x49d0c3[_0xba75('0x33')]][_0xba75('0x47')]=moment()[_0xba75('0x3d')](_0xba75('0x48'));this['channels'][_0x49d0c3[_0xba75('0x33')]]['disposition']=dispositions[_[_0xba75('0x49')](_0x49d0c3['channelstate'])];_[_0xba75('0x4a')](this[_0xba75('0x35')][_0x49d0c3[_0xba75('0x33')]],_[_0xba75('0x36')](_0x49d0c3,_[_0xba75('0x37')](this[_0xba75('0x35')][_0x49d0c3[_0xba75('0x33')]])));if(_0x49d0c3[_0xba75('0x46')]===_0xba75('0x38')){if(this['agents'][_0x49d0c3[_0xba75('0x3f')][_0xba75('0x39')]('-')[0x0]]){if(_['isUndefined'](this[_0xba75('0x16')][_0x49d0c3[_0xba75('0x3f')][_0xba75('0x39')]('-')[0x0]]['destconnectedlinenum'])){this['agents'][_0x49d0c3['channel']['split']('-')[0x0]][_0xba75('0x3c')]=_0x49d0c3['exten'];logger[_0xba75('0x31')](_0xba75('0x4b'),_0x49d0c3[_0xba75('0x33')],util[_0xba75('0x2b')]({'id':this[_0xba75('0x16')][_0x49d0c3['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0xba75('0x16')][_0x49d0c3['channel'][_0xba75('0x39')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x49d0c3[_0xba75('0x3a')]},{'showHidden':![],'depth':null}));this[_0xba75('0x2e')](util[_0xba75('0x3d')](_0xba75('0x3e'),this['agents'][_0x49d0c3[_0xba75('0x3f')][_0xba75('0x39')]('-')[0x0]][_0xba75('0x40')]),_0xba75('0x41'),{'id':this[_0xba75('0x16')][_0x49d0c3[_0xba75('0x3f')][_0xba75('0x39')]('-')[0x0]]['id'],'destaccountcode':this[_0xba75('0x16')][_0x49d0c3['channel'][_0xba75('0x39')]('-')[0x0]][_0xba75('0x4c')],'destconnectedlinenum':_0x49d0c3[_0xba75('0x3a')]});}}}}}catch(_0x27917d){logger[_0xba75('0x29')]('[%s][voiceCallReport][newchannel]',_0x49d0c3[_0xba75('0x33')],util[_0xba75('0x2b')](_0x27917d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xba75('0x2c')][_0xba75('0x19')]=function(_0x174abe){try{if(this[_0xba75('0x43')](_0x174abe)){logger[_0xba75('0x31')]('[%s][voiceCallReport][newexten]\x20event:',_0x174abe[_0xba75('0x33')],util[_0xba75('0x2b')](_0x174abe,{'showHidden':![],'depth':null}));if(_0x174abe[_0xba75('0x3f')]==='OutgoingSpoolFailed'||_0x174abe[_0xba75('0x3a')]==='h')return;if(_0x174abe[_0xba75('0x33')]===_0x174abe['linkedid']||this['blindTransfers'][_0x174abe[_0xba75('0x34')]]){_0x174abe['application']=_0x174abe['application'][_0xba75('0x4d')]();_0x174abe['applicationdata']=_0x174abe[_0xba75('0x4e')]||_0x174abe[_0xba75('0x4f')];if(_0x174abe[_0xba75('0x4e')]&&!_0x174abe[_0xba75('0x4e')][_0xba75('0x50')]('CDR(routeAlias)')&&_0x174abe[_0xba75('0x51')]!==_0xba75('0xa')){_0x174abe['applicationdata']=_0x174abe[_0xba75('0x4f')][_0xba75('0x4d')]();}logger[_0xba75('0x27')](_0xba75('0x52'),_0x174abe[_0xba75('0x33')],_0x174abe['application'],_0x174abe[_0xba75('0x4f')]);if(_[_0xba75('0x2d')](this['channels'][_0x174abe[_0xba75('0x33')]])){this[_0xba75('0x35')][_0x174abe[_0xba75('0x33')]]=new Channel();this[_0xba75('0x35')][_0x174abe[_0xba75('0x33')]][_0xba75('0x47')]=_0x174abe['duration']?moment()[_0xba75('0x53')](moment[_0xba75('0x54')](_0x174abe[_0xba75('0x54')])[_0xba75('0x55')](),_0xba75('0x55'))[_0xba75('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'):moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x174abe[_0xba75('0x33')]][_0xba75('0x56')]=_0xba75('0xf');}_[_0xba75('0x4a')](this[_0xba75('0x35')][_0x174abe[_0xba75('0x33')]],_[_0xba75('0x36')](_0x174abe,_['keys'](this[_0xba75('0x35')][_0x174abe[_0xba75('0x33')]])));if(_[_0xba75('0x57')](applications,_0x174abe[_0xba75('0x51')])){this['channels'][_0x174abe[_0xba75('0x33')]][_0xba75('0x58')]=_0x174abe['application'];this[_0xba75('0x35')][_0x174abe['uniqueid']][_0xba75('0x59')]=_0x174abe[_0xba75('0x4f')];if(_0x174abe['application']===_0xba75('0x9')&&_[_0xba75('0x50')](_0x174abe['applicationdata']['toLowerCase'](),_0xba75('0x5a'))){var _0x47b6d9=_0x174abe[_0xba75('0x4f')]['split']('=');var _0x2225fb=_0x47b6d9[0x0][_0xba75('0x4d')]()[_0xba75('0x5b')](/cdr\((.*)\)/);if(_0x2225fb){if(_0x2225fb[0x1]===_0xba75('0x5c')&&!_[_0xba75('0x5d')](this['channels'][_0x174abe[_0xba75('0x33')]][_0x2225fb[0x1]]))return;this[_0xba75('0x35')][_0x174abe['uniqueid']][_0x2225fb[0x1]]=_0x47b6d9[0x1];}}else if(_0x174abe[_0xba75('0x51')]===_0xba75('0xa')){this[_0xba75('0x35')][_0x174abe[_0xba75('0x33')]][_0xba75('0xa')]=_0x174abe[_0xba75('0x4f')][_0xba75('0x39')](',')[0x0];}}}}}catch(_0xb6d3a2){logger[_0xba75('0x29')](_0xba75('0x5e'),_0x174abe[_0xba75('0x33')],util[_0xba75('0x2b')](_0xb6d3a2,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewState']=function(_0x46c05c){try{if(this[_0xba75('0x43')](_0x46c05c)){logger[_0xba75('0x27')](_0xba75('0x5f'),_0x46c05c[_0xba75('0x33')],_0x46c05c[_0xba75('0x34')],_0x46c05c[_0xba75('0x30')],_0x46c05c[_0xba75('0x60')]);logger[_0xba75('0x31')](_0xba75('0x61'),_0x46c05c[_0xba75('0x33')],util['inspect'](_0x46c05c,{'showHidden':![],'depth':null}));if(_0x46c05c[_0xba75('0x62')]!=='6')return;if(_0x46c05c['uniqueid']!==_0x46c05c[_0xba75('0x34')]){var _0x10ff6f=moment();if(this[_0xba75('0x35')][_0x46c05c[_0xba75('0x34')]]){if(!this[_0xba75('0x35')][_0x46c05c[_0xba75('0x34')]]['answered']){this[_0xba75('0x35')][_0x46c05c['linkedid']][_0xba75('0x63')]=!![];this[_0xba75('0x35')][_0x46c05c['linkedid']]['answertime']=_0x10ff6f[_0xba75('0x3d')](_0xba75('0x48'));if(this[_0xba75('0x35')][_0x46c05c[_0xba75('0x34')]][_0xba75('0x47')]){this[_0xba75('0x35')][_0x46c05c['linkedid']][_0xba75('0x64')]=_0x10ff6f[_0xba75('0x65')](this['channels'][_0x46c05c[_0xba75('0x34')]][_0xba75('0x47')],_0xba75('0x55'));}}this[_0xba75('0x35')][_0x46c05c[_0xba75('0x34')]]['linkedid']=_0x46c05c[_0xba75('0x33')];if(_0x46c05c['calleridnum']!==_0xba75('0x3b')){this[_0xba75('0x35')][_0x46c05c[_0xba75('0x34')]][_0xba75('0x66')]=_0x46c05c[_0xba75('0x60')];}this[_0xba75('0x35')][_0x46c05c['linkedid']]['connectedlinename']=_0x46c05c[_0xba75('0x30')];this['channels'][_0x46c05c[_0xba75('0x34')]][_0xba75('0x67')]=_0x46c05c['channel'];this[_0xba75('0x35')][_0x46c05c[_0xba75('0x34')]][_0xba75('0x56')]=dispositions[_['toNumber'](_0x46c05c['channelstate'])];if(this['agents'][_0x46c05c['channel']['split']('-')[0x0]]){this[_0xba75('0x35')][_0x46c05c['linkedid']][_0xba75('0x68')]=this[_0xba75('0x16')][_0x46c05c[_0xba75('0x3f')][_0xba75('0x39')]('-')[0x0]]['id'];this[_0xba75('0x35')][_0x46c05c[_0xba75('0x34')]][_0xba75('0x69')]=this['agents'][_0x46c05c['channel'][_0xba75('0x39')]('-')[0x0]][_0xba75('0x40')];}}if(this['channels'][_0x46c05c[_0xba75('0x33')]]){if(!this['channels'][_0x46c05c[_0xba75('0x33')]][_0xba75('0x63')]){this['channels'][_0x46c05c[_0xba75('0x33')]]['answered']=!![];this[_0xba75('0x35')][_0x46c05c[_0xba75('0x33')]]['answertime']=_0x10ff6f[_0xba75('0x3d')](_0xba75('0x48'));if(this[_0xba75('0x35')][_0x46c05c[_0xba75('0x33')]][_0xba75('0x47')]){this[_0xba75('0x35')][_0x46c05c[_0xba75('0x33')]][_0xba75('0x64')]=_0x10ff6f['diff'](this[_0xba75('0x35')][_0x46c05c[_0xba75('0x33')]]['starttime'],'seconds');}}if(_0x46c05c['calleridnum']!==_0xba75('0x3b')){this['channels'][_0x46c05c[_0xba75('0x33')]]['connectedlinenum']=_0x46c05c[_0xba75('0x60')];}this['channels'][_0x46c05c['uniqueid']][_0xba75('0x6a')]=_0x46c05c['calleridname'];this[_0xba75('0x35')][_0x46c05c['uniqueid']]['destinationchannel']=_0x46c05c[_0xba75('0x3f')];this['channels'][_0x46c05c[_0xba75('0x33')]]['disposition']=dispositions[_[_0xba75('0x49')](_0x46c05c[_0xba75('0x62')])];}}else{if(this[_0xba75('0x35')][_0x46c05c['uniqueid']]){if(this[_0xba75('0x16')][_0x46c05c[_0xba75('0x3f')]['split']('-')[0x0]]){this[_0xba75('0x35')][_0x46c05c['uniqueid']]['UserId']=this[_0xba75('0x16')][_0x46c05c['channel'][_0xba75('0x39')]('-')[0x0]]['id'];this[_0xba75('0x35')][_0x46c05c[_0xba75('0x33')]][_0xba75('0x69')]=this[_0xba75('0x16')][_0x46c05c[_0xba75('0x3f')][_0xba75('0x39')]('-')[0x0]][_0xba75('0x40')];}}}if(_0x46c05c[_0xba75('0x46')]===_0xba75('0x38')){if(this[_0xba75('0x16')][_0x46c05c['channel']['split']('-')[0x0]]){this[_0xba75('0x16')][_0x46c05c['channel'][_0xba75('0x39')]('-')[0x0]][_0xba75('0x3c')]=_0x46c05c[_0xba75('0x3a')];var _0xa3755d,_0x1713ec;if(this[_0xba75('0x35')][_0x46c05c['uniqueid']]){_0xa3755d=this['channels'][_0x46c05c[_0xba75('0x33')]]['routealias'];_0x1713ec=this[_0xba75('0x35')][_0x46c05c[_0xba75('0x33')]][_0xba75('0xa')];}else if(this[_0xba75('0x35')][_0x46c05c[_0xba75('0x34')]]){_0xa3755d=this['channels'][_0x46c05c[_0xba75('0x34')]][_0xba75('0x6b')];_0x1713ec=this[_0xba75('0x35')][_0x46c05c[_0xba75('0x34')]][_0xba75('0xa')];}logger[_0xba75('0x31')](_0xba75('0x6c'),_0x46c05c[_0xba75('0x33')],util[_0xba75('0x2b')]({'id':this['agents'][_0x46c05c[_0xba75('0x3f')][_0xba75('0x39')]('-')[0x0]]['id'],'destaccountcode':this[_0xba75('0x16')][_0x46c05c[_0xba75('0x3f')][_0xba75('0x39')]('-')[0x0]][_0xba75('0x4c')],'destconnectedlinenum':_0x46c05c[_0xba75('0x3a')],'routealias':_0xa3755d,'queue':_0x1713ec||undefined},{'showHidden':![],'depth':null}));this[_0xba75('0x2e')](util['format'](_0xba75('0x3e'),this[_0xba75('0x16')][_0x46c05c[_0xba75('0x3f')][_0xba75('0x39')]('-')[0x0]][_0xba75('0x40')]),_0xba75('0x41'),{'id':this['agents'][_0x46c05c[_0xba75('0x3f')]['split']('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0xba75('0x16')][_0x46c05c['channel'][_0xba75('0x39')]('-')[0x0]][_0xba75('0x4c')],'destconnectedlinenum':_0x46c05c[_0xba75('0x3a')],'routealias':_0xa3755d,'queue':_0x1713ec||undefined});}}}}catch(_0x4b9e30){logger['error']('[%s][voiceCallReport][newstate]',_0x46c05c[_0xba75('0x33')],util[_0xba75('0x2b')](_0x4b9e30,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xba75('0x2c')][_0xba75('0x6d')]=function(_0x50fd44,_0x43821d){try{if(this[_0xba75('0x35')][_0x50fd44]){logger[_0xba75('0x27')](_0xba75('0x6e'),_0x50fd44,_0x43821d);this[_0xba75('0x35')][_0x50fd44][_0xba75('0x6f')]=!![];if(_[_0xba75('0x70')](_0x43821d,_0xba75('0x71'))){_0x43821d=_0x43821d[_0xba75('0x72')](_0xba75('0x71'),'.WAV');}this[_0xba75('0x35')][_0x50fd44][_0xba75('0x73')]=_0x43821d;var _0x46d207=_['find'](this[_0xba75('0x35')][_0x50fd44][_0xba75('0x74')],{'filename':_0x43821d});if(_[_0xba75('0x5d')](_0x46d207)){this[_0xba75('0x35')][_0x50fd44]['monitors'][_0xba75('0x75')]({'filename':_0x43821d,'createdAt':moment()[_0xba75('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0xba75('0x76')});}}}catch(_0x1bcb90){logger[_0xba75('0x29')](_0xba75('0x77'),_0x50fd44,util[_0xba75('0x2b')](_0x1bcb90,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncVarSet']=function(_0x1d64fa){try{if(this['isNotNull'](_0x1d64fa)){logger[_0xba75('0x31')](_0xba75('0x78'),_0x1d64fa[_0xba75('0x33')],util['inspect'](_0x1d64fa,{'showHidden':![],'depth':null}));if(this[_0xba75('0x35')][_0x1d64fa[_0xba75('0x33')]]&&_0x1d64fa[_0xba75('0x3f')]!=_0xba75('0x45')){if(this[_0xba75('0x43')](_0x1d64fa['variable'])){if(this['isNotNull'](_0x1d64fa['variable'][_0xba75('0x79')])){logger['info'](_0xba75('0x7a'),_0x1d64fa['uniqueid'],_0x1d64fa[_0xba75('0x7b')]);this['syncMixMonitorFilename'](_0x1d64fa[_0xba75('0x33')],_0x1d64fa[_0xba75('0x7b')]);}else if(this[_0xba75('0x43')](_0x1d64fa[_0xba75('0x7c')][_0xba75('0x7d')])){logger[_0xba75('0x27')](_0xba75('0x7e'),_0x1d64fa[_0xba75('0x33')],_0x1d64fa['value']);this[_0xba75('0x35')][_0x1d64fa[_0xba75('0x33')]][_0xba75('0x60')]=_0x1d64fa[_0xba75('0x7b')];}else if(this[_0xba75('0x43')](_0x1d64fa['variable'][_0xba75('0x7f')])){logger[_0xba75('0x27')](_0xba75('0x80'),_0x1d64fa['uniqueid'],_0x1d64fa[_0xba75('0x7b')]);this['channels'][_0x1d64fa['uniqueid']][_0xba75('0x81')]=_0x1d64fa[_0xba75('0x7b')];}else if(this[_0xba75('0x43')](_0x1d64fa[_0xba75('0x7c')][_0xba75('0x82')])){logger[_0xba75('0x27')](_0xba75('0x83'),_0x1d64fa['uniqueid'],_0x1d64fa[_0xba75('0x7b')]);this['channels'][_0x1d64fa[_0xba75('0x33')]][_0xba75('0x5c')]=_0x1d64fa[_0xba75('0x7b')];}else if(this[_0xba75('0x43')](_0x1d64fa[_0xba75('0x7c')][_0xba75('0x84')])){logger['info'](_0xba75('0x85'),_0x1d64fa[_0xba75('0x33')],_0x1d64fa[_0xba75('0x7b')]['split'](',')[0x0]);this[_0xba75('0x35')][_0x1d64fa[_0xba75('0x33')]][_0xba75('0xa')]=_0x1d64fa[_0xba75('0x7b')][_0xba75('0x39')](',')[0x0];}else if(this[_0xba75('0x43')](_0x1d64fa[_0xba75('0x7c')][_0xba75('0x86')])){logger[_0xba75('0x27')](_0xba75('0x87'),_0x1d64fa[_0xba75('0x33')],_0x1d64fa[_0xba75('0x7b')]);this[_0xba75('0x35')][_0x1d64fa['uniqueid']][_0xba75('0x88')]=_0x1d64fa[_0xba75('0x7b')];}else if(this['isNotNull'](_0x1d64fa[_0xba75('0x7c')]['xmd-destination'])){logger[_0xba75('0x27')](_0xba75('0x89'),_0x1d64fa['uniqueid'],_0x1d64fa[_0xba75('0x7b')]);this[_0xba75('0x35')][_0x1d64fa[_0xba75('0x33')]][_0xba75('0x8a')]=_0x1d64fa['value'];}else if(this[_0xba75('0x43')](_0x1d64fa[_0xba75('0x7c')]['xmd-callerid-preview'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x1d64fa[_0xba75('0x33')],_0x1d64fa[_0xba75('0x7b')]);this['channels'][_0x1d64fa[_0xba75('0x33')]][_0xba75('0x8b')]=_0x1d64fa[_0xba75('0x7b')];}else if(this[_0xba75('0x43')](_0x1d64fa['variable']['xmcs-queue'])){logger[_0xba75('0x27')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x1d64fa[_0xba75('0x33')],_0x1d64fa[_0xba75('0x7b')]);this[_0xba75('0x35')][_0x1d64fa['uniqueid']][_0xba75('0xa')]=_0x1d64fa['value'];}else if(this[_0xba75('0x43')](_0x1d64fa[_0xba75('0x7c')][_0xba75('0x8c')])){logger[_0xba75('0x27')](_0xba75('0x8d'),_0x1d64fa[_0xba75('0x33')],_0x1d64fa[_0xba75('0x7b')]);this[_0xba75('0x35')][_0x1d64fa[_0xba75('0x33')]][_0xba75('0x8e')]=_0x1d64fa[_0xba75('0x7b')];}}}else if(this[_0xba75('0x43')](_0x1d64fa[_0xba75('0x7c')][_0xba75('0x79')])){if(_0x1d64fa[_0xba75('0x7b')]){var _0x274334=path[_0xba75('0x8f')](_0x1d64fa[_0xba75('0x7b')])[_0xba75('0x40')];logger[_0xba75('0x27')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x274334,_0x1d64fa[_0xba75('0x7b')]);this[_0xba75('0x6d')](_0x274334,_0x1d64fa[_0xba75('0x7b')]);}}else if(this[_0xba75('0x35')][_0x1d64fa[_0xba75('0x34')]]){if(this[_0xba75('0x43')](_0x1d64fa['variable'])){if(this[_0xba75('0x43')](_0x1d64fa[_0xba75('0x7c')][_0xba75('0x8c')])){logger[_0xba75('0x27')](_0xba75('0x8d'),_0x1d64fa['linkedid'],_0x1d64fa['value']);this[_0xba75('0x35')][_0x1d64fa[_0xba75('0x34')]][_0xba75('0x90')]=_0x1d64fa[_0xba75('0x7b')];}}}}}catch(_0x417f6e){logger[_0xba75('0x29')](_0xba75('0x91'),_0x1d64fa[_0xba75('0x33')],util[_0xba75('0x2b')](_0x417f6e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xba75('0x2c')][_0xba75('0x20')]=function(_0x402006){try{if(this['isNotNull'](_0x402006)){logger[_0xba75('0x31')](_0xba75('0x92'),_0x402006['uniqueid'],util[_0xba75('0x2b')](_0x402006,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x402006[_0xba75('0x34')]]){if(this[_0xba75('0x35')][this[_0xba75('0x17')][_0x402006[_0xba75('0x34')]]['linkedid']]){this[_0xba75('0x35')][this['blindTransfers'][_0x402006[_0xba75('0x34')]][_0xba75('0x34')]]['uniqueid']=_0x402006[_0xba75('0x33')];this['channels'][this[_0xba75('0x17')][_0x402006[_0xba75('0x34')]]['linkedid']]['answered']=this[_0xba75('0x35')][_0x402006[_0xba75('0x33')]][_0xba75('0x63')];this[_0xba75('0x35')][this[_0xba75('0x17')][_0x402006['linkedid']][_0xba75('0x34')]][_0xba75('0x93')]=this[_0xba75('0x35')][_0x402006[_0xba75('0x33')]][_0xba75('0x93')];this['channels'][this[_0xba75('0x17')][_0x402006['linkedid']][_0xba75('0x34')]][_0xba75('0x67')]=this[_0xba75('0x35')][this[_0xba75('0x17')][_0x402006['linkedid']]['linkedid']]['channel'];this[_0xba75('0x35')][this['blindTransfers'][_0x402006[_0xba75('0x34')]][_0xba75('0x34')]][_0xba75('0x56')]=this[_0xba75('0x35')][_0x402006['uniqueid']][_0xba75('0x56')];this[_0xba75('0x35')][_0x402006['uniqueid']]=this[_0xba75('0x35')][this[_0xba75('0x17')][_0x402006[_0xba75('0x34')]][_0xba75('0x34')]];delete this['channels'][this[_0xba75('0x17')][_0x402006['linkedid']][_0xba75('0x34')]];}else if(this[_0xba75('0x35')][this['blindTransfers'][_0x402006['linkedid']]['uniqueid']]){this['channels'][this[_0xba75('0x17')][_0x402006['linkedid']][_0xba75('0x33')]][_0xba75('0x33')]=[this[_0xba75('0x35')][this[_0xba75('0x17')][_0x402006['linkedid']]['uniqueid']][_0xba75('0x34')],this['channels'][this[_0xba75('0x17')][_0x402006['linkedid']][_0xba75('0x33')]][_0xba75('0x34')]=this[_0xba75('0x35')][this[_0xba75('0x17')][_0x402006[_0xba75('0x34')]][_0xba75('0x33')]][_0xba75('0x33')]][0x0];this[_0xba75('0x35')][this[_0xba75('0x17')][_0x402006['linkedid']][_0xba75('0x33')]][_0xba75('0x63')]=this[_0xba75('0x35')][_0x402006[_0xba75('0x33')]]['answered'];this[_0xba75('0x35')][this[_0xba75('0x17')][_0x402006[_0xba75('0x34')]]['uniqueid']][_0xba75('0x93')]=this[_0xba75('0x35')][_0x402006['uniqueid']][_0xba75('0x93')];this[_0xba75('0x35')][this['blindTransfers'][_0x402006['linkedid']][_0xba75('0x33')]][_0xba75('0x67')]=this['channels'][this[_0xba75('0x17')][_0x402006[_0xba75('0x34')]]['uniqueid']][_0xba75('0x3f')];this[_0xba75('0x35')][this[_0xba75('0x17')][_0x402006[_0xba75('0x34')]][_0xba75('0x33')]][_0xba75('0x56')]=this[_0xba75('0x35')][_0x402006[_0xba75('0x33')]]['disposition'];this[_0xba75('0x35')][_0x402006[_0xba75('0x33')]]=this['channels'][this['blindTransfers'][_0x402006[_0xba75('0x34')]]['uniqueid']];delete this[_0xba75('0x35')][this['blindTransfers'][_0x402006[_0xba75('0x34')]][_0xba75('0x33')]];}}if(this[_0xba75('0x35')][_0x402006[_0xba75('0x33')]]){logger[_0xba75('0x27')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x402006[_0xba75('0x33')],_0x402006[_0xba75('0x94')]);var _0x2de40e=moment();this[_0xba75('0x35')][_0x402006[_0xba75('0x33')]]['endtime']=_0x2de40e[_0xba75('0x3d')](_0xba75('0x48'));this[_0xba75('0x35')][_0x402006[_0xba75('0x33')]]['duration']=_0x2de40e[_0xba75('0x65')](this['channels'][_0x402006['uniqueid']][_0xba75('0x47')],'seconds');if(this['channels'][_0x402006[_0xba75('0x33')]][_0xba75('0x63')]){this[_0xba75('0x35')][_0x402006['uniqueid']][_0xba75('0x95')]=_0x2de40e['diff'](this[_0xba75('0x35')][_0x402006[_0xba75('0x33')]]['answertime'],'seconds');this[_0xba75('0x35')][_0x402006['uniqueid']][_0xba75('0x64')]=this[_0xba75('0x35')][_0x402006[_0xba75('0x33')]]['duration']-this[_0xba75('0x35')][_0x402006['uniqueid']][_0xba75('0x95')];}if(_0x402006['context']===_0xba75('0x38')){if(this['agents'][_0x402006[_0xba75('0x3f')][_0xba75('0x39')]('-')[0x0]]){this[_0xba75('0x16')][_0x402006[_0xba75('0x3f')][_0xba75('0x39')]('-')[0x0]]=_[_0xba75('0x96')](this['agents'][_0x402006['channel'][_0xba75('0x39')]('-')[0x0]],[_0xba75('0x3c')]);logger[_0xba75('0x31')](_0xba75('0x97'),_0x402006[_0xba75('0x33')],util['inspect']({'id':this[_0xba75('0x16')][_0x402006[_0xba75('0x3f')][_0xba75('0x39')]('-')[0x0]]['id'],'destaccountcode':this[_0xba75('0x16')][_0x402006['channel']['split']('-')[0x0]][_0xba75('0x4c')]},{'showHidden':![],'depth':null}));this[_0xba75('0x2e')](util[_0xba75('0x3d')](_0xba75('0x3e'),this[_0xba75('0x16')][_0x402006[_0xba75('0x3f')][_0xba75('0x39')]('-')[0x0]][_0xba75('0x40')]),_0xba75('0x98'),{'id':this['agents'][_0x402006[_0xba75('0x3f')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xba75('0x16')][_0x402006[_0xba75('0x3f')][_0xba75('0x39')]('-')[0x0]][_0xba75('0x4c')]});for(var _0x57f604=0x0;_0x57f604<Object[_0xba75('0x37')](this[_0xba75('0x16')])[_0xba75('0x99')];_0x57f604++){var _0x5b2f53=Object[_0xba75('0x37')](this[_0xba75('0x16')])[_0x57f604];var _0x2fb732=this[_0xba75('0x16')][_0x5b2f53];if(_0x2fb732[_0xba75('0x4c')]===Number(_0x402006[_0xba75('0x66')])){this[_0xba75('0x2e')](util[_0xba75('0x3d')](_0xba75('0x3e'),_0x2fb732[_0xba75('0x40')]),'user:agentcomplete',{'id':_0x2fb732['id'],'destaccountcode':_0x2fb732[_0xba75('0x4c')],'transfer':this[_0xba75('0x35')][_0x402006[_0xba75('0x33')]][_0xba75('0x9a')]});break;}}}}var _0x27d4ee=this;Promise['resolve']()[_0xba75('0x9b')](function(){var _0x569f31=_0x27d4ee[_0xba75('0x35')][_0x402006['uniqueid']];if(typeof _0x569f31[_0xba75('0x9a')]===_0xba75('0x9c'))return;if(_[_0xba75('0x9d')](_0x569f31[_0xba75('0x74')]))return;return RpcSetting[_0xba75('0x9e')]()['then'](function(_0x13f5da){if(!_0x13f5da[_0xba75('0x9f')])return;return Promise[_0xba75('0xa0')]()['then'](function(){return ami[_0xba75('0xa1')]({'action':_0xba75('0xa2'),'channel':_0x569f31[_0xba75('0x3f')]})[_0xba75('0xa3')](function(){});})['then'](function(){return ami[_0xba75('0xa1')]({'action':_0xba75('0xa2'),'channel':_0x569f31['destinationchannel']})[_0xba75('0xa3')](function(){})['finally'](function(){var _0x305b8a=_0x27d4ee['agents'][_0x569f31[_0xba75('0x67')]['split']('-')[0x0]];if(!_0x305b8a)return;io[_0xba75('0x2e')]('webbar:stopmonitors',{'agentId':_0x305b8a['id'],'uniqueid':_0x569f31[_0xba75('0x33')]});});});});})[_0xba75('0x9b')](function(){if(_0x402006[_0xba75('0xa4')]===_0xba75('0xa5')){_0x27d4ee['blindTransfers'][_0x402006['uniqueid']]=_0x402006;}else{if(_0x27d4ee[_0xba75('0x35')][_0x402006[_0xba75('0x33')]][_0xba75('0x5c')]==='outbound'&&_0x27d4ee[_0xba75('0x17')][_0x402006[_0xba75('0x33')]]){_0x27d4ee['channels'][_0x402006[_0xba75('0x33')]]['uniqueid']=[_0x27d4ee[_0xba75('0x35')][_0x402006['uniqueid']][_0xba75('0x34')],_0x27d4ee[_0xba75('0x35')][_0x402006[_0xba75('0x33')]][_0xba75('0x34')]=_0x27d4ee[_0xba75('0x35')][_0x402006[_0xba75('0x33')]]['uniqueid']][0x0];delete _0x27d4ee[_0xba75('0x17')][_0x402006[_0xba75('0x33')]];}}logger[_0xba75('0x31')]('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x402006[_0xba75('0x33')],util[_0xba75('0x2b')](_0x27d4ee[_0xba75('0x35')][_0x402006[_0xba75('0x33')]],{'showHidden':![],'depth':null}));ami[_0xba75('0x2e')]('custom:voiceCallReport',_0x27d4ee[_0xba75('0x35')][_0x402006[_0xba75('0x33')]]);delete _0x27d4ee[_0xba75('0x35')][_0x402006[_0xba75('0x33')]];});}}}catch(_0x18df5b){logger['error']('[%s][voiceCallReport][hangup]',_0x402006[_0xba75('0x33')],util['inspect'](_0x18df5b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xba75('0x2c')][_0xba75('0x24')]=function(_0x38f3fc){try{if(this[_0xba75('0x43')](_0x38f3fc)){logger[_0xba75('0x27')](_0xba75('0xa6'),_0x38f3fc['uniqueid'],_0x38f3fc[_0xba75('0xa7')],_0x38f3fc[_0xba75('0xa8')]);logger['debug'](_0xba75('0xa9'),_0x38f3fc[_0xba75('0x33')],util[_0xba75('0x2b')](_0x38f3fc,{'showHidden':![],'depth':null}));var _0xb800b8;if(this[_0xba75('0x35')][_0x38f3fc[_0xba75('0xaa')]]){this[_0xba75('0x35')][_0x38f3fc[_0xba75('0xaa')]][_0xba75('0xab')]=_0x38f3fc[_0xba75('0xa7')];this[_0xba75('0x35')][_0x38f3fc['transfereeuniqueid']][_0xba75('0xac')]=_0x38f3fc['transfertargetcalleridnum'];if(this[_0xba75('0x35')][_0x38f3fc[_0xba75('0xad')]]){_0xb800b8=this['channels'][_0x38f3fc[_0xba75('0xad')]];this[_0xba75('0x35')][_0x38f3fc[_0xba75('0xad')]]=this[_0xba75('0x35')][_0x38f3fc[_0xba75('0xaa')]];this['channels'][_0x38f3fc[_0xba75('0xaa')]]=_0xb800b8;}this[_0xba75('0x35')][_0x38f3fc[_0xba75('0xad')]][_0xba75('0x9a')]=_0xba75('0xae');}else if(this[_0xba75('0x35')][_0x38f3fc[_0xba75('0xaf')]]){this[_0xba75('0x35')][_0x38f3fc['transfertargetuniqueid']][_0xba75('0xab')]=_0x38f3fc[_0xba75('0xa7')];this[_0xba75('0x35')][_0x38f3fc[_0xba75('0xaf')]][_0xba75('0xac')]=_0x38f3fc['transfertargetcalleridnum'];if(this[_0xba75('0x35')][_0x38f3fc[_0xba75('0xb0')]]){_0xb800b8=this['channels'][_0x38f3fc[_0xba75('0xb0')]];this[_0xba75('0x35')][_0x38f3fc['origtransfereruniqueid']]=this[_0xba75('0x35')][_0x38f3fc[_0xba75('0xaf')]];this['channels'][_0x38f3fc[_0xba75('0xaf')]]=_0xb800b8;}this['channels'][_0x38f3fc[_0xba75('0xaf')]][_0xba75('0x9a')]=_0xba75('0xae');}if((this[_0xba75('0x35')][_0x38f3fc['origtransfereruniqueid']]||this['channels'][_0x38f3fc[_0xba75('0xb1')]])&&this[_0xba75('0x35')][_0x38f3fc[_0xba75('0xad')]]){var _0x510f70=_[_0xba75('0xb2')]([this[_0xba75('0x35')][_0x38f3fc[_0xba75('0xb0')]],this['channels'][_0x38f3fc[_0xba75('0xb1')]],this[_0xba75('0x35')][_0x38f3fc[_0xba75('0xad')]]],function(_0x298eaa){return _0x298eaa&&_0x298eaa['type']===_0xba75('0xb3')&&_0x298eaa['routeid'];});if(_0x510f70){if(this['channels'][_0x38f3fc[_0xba75('0xb0')]])this['channels'][_0x38f3fc[_0xba75('0xb0')]][_0xba75('0x9a')]=_0xba75('0xae');if(this[_0xba75('0x35')][_0x38f3fc['origtransfererlinkedid']])this[_0xba75('0x35')][_0x38f3fc[_0xba75('0xb1')]]['transferType']=_0xba75('0xae');this[_0xba75('0x35')][_0x38f3fc['secondtransfereruniqueid']][_0xba75('0x9a')]=_0xba75('0xae');}}}}catch(_0x21f0b0){logger[_0xba75('0x29')](_0xba75('0xb4'),_0x38f3fc[_0xba75('0x33')],util[_0xba75('0x2b')](_0x21f0b0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xba75('0x2c')][_0xba75('0x25')]=function(_0x334352){try{if(this[_0xba75('0x43')](_0x334352)){logger[_0xba75('0x27')](_0xba75('0xb5'),_0x334352[_0xba75('0x33')],_0x334352[_0xba75('0xb6')],_0x334352[_0xba75('0xb7')]);logger[_0xba75('0x31')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x334352[_0xba75('0x33')],util[_0xba75('0x2b')](_0x334352,{'showHidden':![],'depth':null}));if(this[_0xba75('0x35')][_0x334352['transfereeuniqueid']]){this[_0xba75('0x35')][_0x334352[_0xba75('0xaa')]][_0xba75('0xab')]=_0x334352[_0xba75('0xb6')];this[_0xba75('0x35')][_0x334352[_0xba75('0xaa')]][_0xba75('0xac')]=_0x334352[_0xba75('0xb7')];this['channels'][_0x334352[_0xba75('0xaa')]][_0xba75('0x9a')]=_0xba75('0xb8');this[_0xba75('0x20')]({'event':_0xba75('0xa5'),'uniqueid':_0x334352['transfereeuniqueid'],'linkedid':_0x334352[_0xba75('0xb9')],'context':_0x334352[_0xba75('0x46')],'channel':_0x334352[_0xba75('0xba')]});}else{this[_0xba75('0x35')][_0x334352[_0xba75('0xb9')]]['transferType']=_0xba75('0xb8');this[_0xba75('0x20')]({'event':_0xba75('0xa5'),'uniqueid':_0x334352[_0xba75('0xb9')],'linkedid':_0x334352['transfereeuniqueid'],'context':_0x334352['context'],'channel':_0x334352[_0xba75('0xba')]});}}}catch(_0x16bee4){logger[_0xba75('0x29')](_0xba75('0xbb'),_0x334352[_0xba75('0x33')],util['inspect'](_0x16bee4,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xba75('0xbc')]=function(_0x3faf97){try{if(this[_0xba75('0x43')](_0x3faf97)){logger['debug'](_0xba75('0xbd'),_0x3faf97[_0xba75('0x33')],util[_0xba75('0x2b')](_0x3faf97,{'showHidden':![],'depth':null}));if(this[_0xba75('0x35')][_0x3faf97[_0xba75('0x33')]]){if(!_[_0xba75('0x5d')](this['channels'][_0x3faf97[_0xba75('0x33')]][_0xba75('0x93')])){this[_0xba75('0x35')][_0x3faf97[_0xba75('0x33')]][_0xba75('0xbe')]=moment()['format'](_0xba75('0x48'));logger['info']('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x3faf97[_0xba75('0x33')],this[_0xba75('0x35')][_0x3faf97[_0xba75('0x33')]]['mohstarttime']);}}}}catch(_0x5f2843){logger[_0xba75('0x29')](_0xba75('0xbf'),_0x3faf97[_0xba75('0x33')],util[_0xba75('0x2b')](_0x5f2843,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xba75('0x2c')][_0xba75('0x26')]=function(_0xa7ccc4){try{if(this[_0xba75('0x43')](_0xa7ccc4)){logger[_0xba75('0x31')](_0xba75('0xc0'),_0xa7ccc4[_0xba75('0x33')],util[_0xba75('0x2b')](_0xa7ccc4,{'showHidden':![],'depth':null}));if(this[_0xba75('0x35')][_0xa7ccc4[_0xba75('0x33')]]){if(!_[_0xba75('0x5d')](this['channels'][_0xa7ccc4[_0xba75('0x33')]][_0xba75('0xbe')])){this[_0xba75('0x35')][_0xa7ccc4[_0xba75('0x33')]][_0xba75('0xc1')]+=moment()[_0xba75('0xc2')](0x0)[_0xba75('0x65')](this[_0xba75('0x35')][_0xa7ccc4[_0xba75('0x33')]][_0xba75('0xbe')],'seconds');logger['info'](_0xba75('0xc3'),_0xa7ccc4[_0xba75('0x33')],this[_0xba75('0x35')][_0xa7ccc4[_0xba75('0x33')]][_0xba75('0xc1')]);delete this[_0xba75('0x35')][_0xa7ccc4[_0xba75('0x33')]][_0xba75('0xbe')];}}}}catch(_0x5ef5e2){logger[_0xba75('0x29')](_0xba75('0xc4'),_0xa7ccc4[_0xba75('0x33')],util[_0xba75('0x2b')](_0x5ef5e2,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;
\ No newline at end of file
+var _0x9bde=['transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','BlindTransfer','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','moment','path','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','set','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','defaults','redis','localhost','socket.io-emitter','channels','agents','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','syncVarSet','hangup','syncHangup','newcallerid','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','prototype','isNotNull','isUndefined','emit','syncNewCallerId','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','linkedid','pick','keys','context','from-sip','channel','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','split','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','inspect','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','channelstate','debug','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','application','toLowerCase','applicationdata','appdata','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','includes','lastapplication','cdr(','match','type','queue','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answertime','diff','connectedlinename','destinationchannel','disposition','UserId','membername','answered','holdtime','toNumber','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','monitor','.wav49','.WAV','monitorFilename','find','monitors','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','sipcalluniqueid','mixmonitor_filename','sipcalllinkedid','[%s][voiceCallReport][hangup]\x20event:','blindTransfers','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','resolve','isEmpty','then','stopRecordingOnTransfer','Action','StopMixMonitor','catch','event','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum'];(function(_0x4087cb,_0x272138){var _0x489362=function(_0x41b98b){while(--_0x41b98b){_0x4087cb['push'](_0x4087cb['shift']());}};_0x489362(++_0x272138);}(_0x9bde,0xe1));var _0xe9bd=function(_0x21c51f,_0x189cd8){_0x21c51f=_0x21c51f-0x0;var _0xdbca24=_0x9bde[_0x21c51f];return _0xdbca24;};'use strict';var _=require('lodash');var moment=require(_0xe9bd('0x0'));var util=require('util');var path=require(_0xe9bd('0x1'));var Redis=require('ioredis');var config=require(_0xe9bd('0x2'));var logger=require(_0xe9bd('0x3'))(_0xe9bd('0x4'));var ami=require(_0xe9bd('0x5'));var Channel=require(_0xe9bd('0x6'));var RpcSetting=require(_0xe9bd('0x7'));var applications=[_0xe9bd('0x8'),'queue',_0xe9bd('0x9'),_0xe9bd('0xa'),_0xe9bd('0xb'),_0xe9bd('0xc')];var dispositions=[_0xe9bd('0xd'),_0xe9bd('0xe'),_0xe9bd('0xe'),_0xe9bd('0xd'),_0xe9bd('0xd'),_0xe9bd('0xd'),'ANSWERED','BUSY',_0xe9bd('0xe'),_0xe9bd('0xe'),_0xe9bd('0xe')];config['redis']=_[_0xe9bd('0xf')](config[_0xe9bd('0x10')],{'host':_0xe9bd('0x11'),'port':0x18eb});var io=require(_0xe9bd('0x12'))(new Redis(config['redis']));function VoiceCallReport(_0x2c1d98){this['channels']=_0x2c1d98[_0xe9bd('0x13')];this[_0xe9bd('0x14')]=_0x2c1d98[_0xe9bd('0x14')];this['blindTransfers']={};ami['on']('coreshowchannel',this[_0xe9bd('0x15')][_0xe9bd('0x16')](this));ami['on'](_0xe9bd('0x17'),this[_0xe9bd('0x15')][_0xe9bd('0x16')](this));ami['on'](_0xe9bd('0x18'),this[_0xe9bd('0x19')]['bind'](this));ami['on'](_0xe9bd('0x1a'),this[_0xe9bd('0x1b')][_0xe9bd('0x16')](this));ami['on']('varset',this[_0xe9bd('0x1c')][_0xe9bd('0x16')](this));ami['on'](_0xe9bd('0x1d'),this[_0xe9bd('0x1e')]['bind'](this));ami['on'](_0xe9bd('0x1f'),this['syncNewCallerId'][_0xe9bd('0x16')](this));ami['on']('attendedtransfer',this[_0xe9bd('0x20')][_0xe9bd('0x16')](this));ami['on'](_0xe9bd('0x21'),this[_0xe9bd('0x22')][_0xe9bd('0x16')](this));ami['on'](_0xe9bd('0x23'),this[_0xe9bd('0x24')]['bind'](this));ami['on'](_0xe9bd('0x25'),this[_0xe9bd('0x26')]['bind'](this));try{logger[_0xe9bd('0x27')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0xe9bd('0x28')]();}catch(_0x1b9cc9){logger[_0xe9bd('0x29')](_0xe9bd('0x2a'),util['inspect'](_0x1b9cc9,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xe9bd('0x2b')][_0xe9bd('0x2c')]=function(_0x2c9a57){return _0x2c9a57!==null&&!_[_0xe9bd('0x2d')](_0x2c9a57);};VoiceCallReport[_0xe9bd('0x2b')][_0xe9bd('0x2e')]=function(_0x399f3c,_0x43ea90,_0x1ae889){io['to'](_0x399f3c)['emit'](_0x43ea90,_0x1ae889);};VoiceCallReport[_0xe9bd('0x2b')][_0xe9bd('0x2f')]=function(_0x5ba1d6){try{if(this[_0xe9bd('0x2c')](_0x5ba1d6)){logger[_0xe9bd('0x27')](_0xe9bd('0x30'),_0x5ba1d6[_0xe9bd('0x31')],_0x5ba1d6[_0xe9bd('0x32')],_0x5ba1d6[_0xe9bd('0x33')]);logger['debug']('[%s][voiceCallReport][newcallerid]\x20event:',_0x5ba1d6[_0xe9bd('0x31')],util['inspect'](_0x5ba1d6,{'showHidden':![],'depth':null}));if(_0x5ba1d6[_0xe9bd('0x31')]===_0x5ba1d6[_0xe9bd('0x34')]){if(!_[_0xe9bd('0x2d')](this[_0xe9bd('0x13')][_0x5ba1d6[_0xe9bd('0x31')]])){_['merge'](this['channels'][_0x5ba1d6[_0xe9bd('0x31')]],_[_0xe9bd('0x35')](_0x5ba1d6,_[_0xe9bd('0x36')](this[_0xe9bd('0x13')][_0x5ba1d6[_0xe9bd('0x31')]])));}}if(_0x5ba1d6[_0xe9bd('0x37')]===_0xe9bd('0x38')){if(this[_0xe9bd('0x14')][_0x5ba1d6[_0xe9bd('0x39')]['split']('-')[0x0]]){if(_0x5ba1d6[_0xe9bd('0x3a')]==_0xe9bd('0x3b')){this[_0xe9bd('0x14')][_0x5ba1d6['channel']['split']('-')[0x0]][_0xe9bd('0x3c')]=_0x5ba1d6[_0xe9bd('0x3d')];this[_0xe9bd('0x2e')](util[_0xe9bd('0x3e')](_0xe9bd('0x3f'),this[_0xe9bd('0x14')][_0x5ba1d6[_0xe9bd('0x39')][_0xe9bd('0x40')]('-')[0x0]][_0xe9bd('0x41')]),_0xe9bd('0x42'),{'destaccountcode':this[_0xe9bd('0x14')][_0x5ba1d6[_0xe9bd('0x39')][_0xe9bd('0x40')]('-')[0x0]][_0xe9bd('0x43')],'destconnectedlinenum':_0x5ba1d6[_0xe9bd('0x3d')]});}}}}}catch(_0x8ff624){logger[_0xe9bd('0x29')](_0xe9bd('0x44'),_0x5ba1d6['uniqueid'],util[_0xe9bd('0x45')](_0x8ff624,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe9bd('0x2b')]['syncNewChannel']=function(_0x404a7d){try{if(this[_0xe9bd('0x2c')](_0x404a7d)){logger['debug']('[%s][voiceCallReport][newchannel]\x20event:',_0x404a7d[_0xe9bd('0x31')],util[_0xe9bd('0x45')](_0x404a7d,{'showHidden':![],'depth':null}));if(this['channels'][_0x404a7d[_0xe9bd('0x31')]])return;if(_0x404a7d[_0xe9bd('0x39')]===_0xe9bd('0x46'))return;if(_0x404a7d['uniqueid']!==_0x404a7d[_0xe9bd('0x34')]&&!this['blindTransfers'][_0x404a7d[_0xe9bd('0x34')]])return;logger[_0xe9bd('0x27')](_0xe9bd('0x47'),_0x404a7d[_0xe9bd('0x31')],_0x404a7d['context'],_0x404a7d[_0xe9bd('0x3a')]);this[_0xe9bd('0x13')][_0x404a7d[_0xe9bd('0x31')]]=new Channel();this[_0xe9bd('0x13')][_0x404a7d[_0xe9bd('0x31')]][_0xe9bd('0x48')]=moment()[_0xe9bd('0x3e')](_0xe9bd('0x49'));this[_0xe9bd('0x13')][_0x404a7d[_0xe9bd('0x31')]]['disposition']=dispositions[_['toNumber'](_0x404a7d[_0xe9bd('0x4a')])];_['merge'](this[_0xe9bd('0x13')][_0x404a7d[_0xe9bd('0x31')]],_[_0xe9bd('0x35')](_0x404a7d,_['keys'](this[_0xe9bd('0x13')][_0x404a7d[_0xe9bd('0x31')]])));if(_0x404a7d[_0xe9bd('0x37')]==='from-sip'){if(this[_0xe9bd('0x14')][_0x404a7d[_0xe9bd('0x39')][_0xe9bd('0x40')]('-')[0x0]]){if(_[_0xe9bd('0x2d')](this[_0xe9bd('0x14')][_0x404a7d[_0xe9bd('0x39')][_0xe9bd('0x40')]('-')[0x0]][_0xe9bd('0x3c')])){this[_0xe9bd('0x14')][_0x404a7d[_0xe9bd('0x39')][_0xe9bd('0x40')]('-')[0x0]][_0xe9bd('0x3c')]=_0x404a7d[_0xe9bd('0x3a')];logger[_0xe9bd('0x4b')](_0xe9bd('0x4c'),_0x404a7d['uniqueid'],util['inspect']({'id':this[_0xe9bd('0x14')][_0x404a7d[_0xe9bd('0x39')][_0xe9bd('0x40')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x404a7d['channel'][_0xe9bd('0x40')]('-')[0x0]][_0xe9bd('0x43')],'destconnectedlinenum':_0x404a7d[_0xe9bd('0x3a')]},{'showHidden':![],'depth':null}));this[_0xe9bd('0x2e')](util[_0xe9bd('0x3e')](_0xe9bd('0x3f'),this[_0xe9bd('0x14')][_0x404a7d['channel'][_0xe9bd('0x40')]('-')[0x0]]['name']),_0xe9bd('0x42'),{'id':this[_0xe9bd('0x14')][_0x404a7d[_0xe9bd('0x39')][_0xe9bd('0x40')]('-')[0x0]]['id'],'destaccountcode':this[_0xe9bd('0x14')][_0x404a7d['channel'][_0xe9bd('0x40')]('-')[0x0]][_0xe9bd('0x43')],'destconnectedlinenum':_0x404a7d[_0xe9bd('0x3a')]});}}}}}catch(_0x58dc3b){logger[_0xe9bd('0x29')](_0xe9bd('0x4d'),_0x404a7d[_0xe9bd('0x31')],util['inspect'](_0x58dc3b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe9bd('0x2b')][_0xe9bd('0x15')]=function(_0x2e634d){try{if(this[_0xe9bd('0x2c')](_0x2e634d)){logger[_0xe9bd('0x4b')]('[%s][voiceCallReport][newexten]\x20event:',_0x2e634d[_0xe9bd('0x31')],util['inspect'](_0x2e634d,{'showHidden':![],'depth':null}));if(_0x2e634d[_0xe9bd('0x39')]===_0xe9bd('0x46')||_0x2e634d[_0xe9bd('0x3a')]==='h')return;if(_0x2e634d[_0xe9bd('0x31')]===_0x2e634d[_0xe9bd('0x34')]||this['blindTransfers'][_0x2e634d[_0xe9bd('0x34')]]){_0x2e634d['application']=_0x2e634d[_0xe9bd('0x4e')][_0xe9bd('0x4f')]();_0x2e634d['applicationdata']=_0x2e634d['appdata']||_0x2e634d[_0xe9bd('0x50')];if(_0x2e634d['appdata']&&!_0x2e634d[_0xe9bd('0x51')]['startsWith'](_0xe9bd('0x52'))&&_0x2e634d[_0xe9bd('0x4e')]!=='queue'){_0x2e634d[_0xe9bd('0x50')]=_0x2e634d['applicationdata'][_0xe9bd('0x4f')]();}logger[_0xe9bd('0x27')](_0xe9bd('0x53'),_0x2e634d['uniqueid'],_0x2e634d[_0xe9bd('0x4e')],_0x2e634d[_0xe9bd('0x50')]);if(_[_0xe9bd('0x2d')](this[_0xe9bd('0x13')][_0x2e634d['uniqueid']])){this['channels'][_0x2e634d[_0xe9bd('0x31')]]=new Channel();this['channels'][_0x2e634d[_0xe9bd('0x31')]][_0xe9bd('0x48')]=_0x2e634d[_0xe9bd('0x54')]?moment()[_0xe9bd('0x55')](moment[_0xe9bd('0x54')](_0x2e634d[_0xe9bd('0x54')])[_0xe9bd('0x56')](),_0xe9bd('0x56'))[_0xe9bd('0x3e')](_0xe9bd('0x49')):moment()[_0xe9bd('0x3e')](_0xe9bd('0x49'));this['channels'][_0x2e634d['uniqueid']]['disposition']=_0xe9bd('0xd');}_['merge'](this[_0xe9bd('0x13')][_0x2e634d[_0xe9bd('0x31')]],_[_0xe9bd('0x35')](_0x2e634d,_[_0xe9bd('0x36')](this[_0xe9bd('0x13')][_0x2e634d[_0xe9bd('0x31')]])));if(_[_0xe9bd('0x57')](applications,_0x2e634d[_0xe9bd('0x4e')])){this[_0xe9bd('0x13')][_0x2e634d['uniqueid']][_0xe9bd('0x58')]=_0x2e634d[_0xe9bd('0x4e')];this[_0xe9bd('0x13')][_0x2e634d[_0xe9bd('0x31')]]['lastdata']=_0x2e634d[_0xe9bd('0x50')];if(_0x2e634d[_0xe9bd('0x4e')]===_0xe9bd('0x8')&&_['startsWith'](_0x2e634d[_0xe9bd('0x50')][_0xe9bd('0x4f')](),_0xe9bd('0x59'))){var _0xfe82f7=_0x2e634d['applicationdata']['split']('=');var _0x3e0de9=_0xfe82f7[0x0][_0xe9bd('0x4f')]()[_0xe9bd('0x5a')](/cdr\((.*)\)/);if(_0x3e0de9){if(_0x3e0de9[0x1]===_0xe9bd('0x5b')&&!_['isNil'](this['channels'][_0x2e634d[_0xe9bd('0x31')]][_0x3e0de9[0x1]]))return;this[_0xe9bd('0x13')][_0x2e634d[_0xe9bd('0x31')]][_0x3e0de9[0x1]]=_0xfe82f7[0x1];}}else if(_0x2e634d[_0xe9bd('0x4e')]===_0xe9bd('0x5c')){this[_0xe9bd('0x13')][_0x2e634d['uniqueid']][_0xe9bd('0x5c')]=_0x2e634d['applicationdata'][_0xe9bd('0x40')](',')[0x0];}}}}}catch(_0x28dd03){logger[_0xe9bd('0x29')](_0xe9bd('0x5d'),_0x2e634d['uniqueid'],util[_0xe9bd('0x45')](_0x28dd03,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe9bd('0x2b')][_0xe9bd('0x1b')]=function(_0x4f35c4){try{if(this[_0xe9bd('0x2c')](_0x4f35c4)){logger[_0xe9bd('0x27')](_0xe9bd('0x5e'),_0x4f35c4[_0xe9bd('0x31')],_0x4f35c4[_0xe9bd('0x34')],_0x4f35c4[_0xe9bd('0x32')],_0x4f35c4[_0xe9bd('0x33')]);logger[_0xe9bd('0x4b')](_0xe9bd('0x5f'),_0x4f35c4[_0xe9bd('0x31')],util[_0xe9bd('0x45')](_0x4f35c4,{'showHidden':![],'depth':null}));if(_0x4f35c4[_0xe9bd('0x4a')]!=='6')return;if(_0x4f35c4['uniqueid']!==_0x4f35c4[_0xe9bd('0x34')]){var _0x9d0603=moment();if(this['channels'][_0x4f35c4[_0xe9bd('0x34')]]){if(!this[_0xe9bd('0x13')][_0x4f35c4['linkedid']]['answered']){this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x34')]]['answered']=!![];this['channels'][_0x4f35c4['linkedid']][_0xe9bd('0x60')]=_0x9d0603['format']('YYYY-MM-DD\x20HH:mm:ss');if(this['channels'][_0x4f35c4['linkedid']][_0xe9bd('0x48')]){this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x34')]]['holdtime']=_0x9d0603[_0xe9bd('0x61')](this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x34')]][_0xe9bd('0x48')],'seconds');}}this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x34')]][_0xe9bd('0x34')]=_0x4f35c4['uniqueid'];if(_0x4f35c4['calleridnum']!==_0xe9bd('0x3b')){this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x34')]][_0xe9bd('0x3d')]=_0x4f35c4[_0xe9bd('0x33')];}this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x34')]][_0xe9bd('0x62')]=_0x4f35c4['calleridname'];this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x34')]][_0xe9bd('0x63')]=_0x4f35c4[_0xe9bd('0x39')];this[_0xe9bd('0x13')][_0x4f35c4['linkedid']][_0xe9bd('0x64')]=dispositions[_['toNumber'](_0x4f35c4['channelstate'])];if(this[_0xe9bd('0x14')][_0x4f35c4[_0xe9bd('0x39')]['split']('-')[0x0]]){this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x34')]][_0xe9bd('0x65')]=this[_0xe9bd('0x14')][_0x4f35c4['channel'][_0xe9bd('0x40')]('-')[0x0]]['id'];this[_0xe9bd('0x13')][_0x4f35c4['linkedid']][_0xe9bd('0x66')]=this[_0xe9bd('0x14')][_0x4f35c4[_0xe9bd('0x39')][_0xe9bd('0x40')]('-')[0x0]][_0xe9bd('0x41')];}}if(this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x31')]]){if(!this['channels'][_0x4f35c4[_0xe9bd('0x31')]][_0xe9bd('0x67')]){this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x31')]][_0xe9bd('0x67')]=!![];this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x31')]][_0xe9bd('0x60')]=_0x9d0603[_0xe9bd('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x31')]][_0xe9bd('0x48')]){this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x31')]][_0xe9bd('0x68')]=_0x9d0603[_0xe9bd('0x61')](this['channels'][_0x4f35c4[_0xe9bd('0x31')]][_0xe9bd('0x48')],'seconds');}}if(_0x4f35c4[_0xe9bd('0x33')]!==_0xe9bd('0x3b')){this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x31')]][_0xe9bd('0x3d')]=_0x4f35c4[_0xe9bd('0x33')];}this[_0xe9bd('0x13')][_0x4f35c4['uniqueid']]['connectedlinename']=_0x4f35c4[_0xe9bd('0x32')];this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x31')]][_0xe9bd('0x63')]=_0x4f35c4[_0xe9bd('0x39')];this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x31')]]['disposition']=dispositions[_[_0xe9bd('0x69')](_0x4f35c4[_0xe9bd('0x4a')])];}}else{if(this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x31')]]){if(this[_0xe9bd('0x14')][_0x4f35c4[_0xe9bd('0x39')][_0xe9bd('0x40')]('-')[0x0]]){this['channels'][_0x4f35c4['uniqueid']]['UserId']=this[_0xe9bd('0x14')][_0x4f35c4['channel']['split']('-')[0x0]]['id'];this['channels'][_0x4f35c4[_0xe9bd('0x31')]][_0xe9bd('0x66')]=this[_0xe9bd('0x14')][_0x4f35c4[_0xe9bd('0x39')][_0xe9bd('0x40')]('-')[0x0]][_0xe9bd('0x41')];}}}if(_0x4f35c4[_0xe9bd('0x37')]===_0xe9bd('0x38')){if(this[_0xe9bd('0x14')][_0x4f35c4['channel'][_0xe9bd('0x40')]('-')[0x0]]){this['agents'][_0x4f35c4[_0xe9bd('0x39')][_0xe9bd('0x40')]('-')[0x0]][_0xe9bd('0x3c')]=_0x4f35c4[_0xe9bd('0x3a')];var _0x416938,_0x5d8c24;if(this['channels'][_0x4f35c4['uniqueid']]){_0x416938=this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x31')]]['routealias'];_0x5d8c24=this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x31')]][_0xe9bd('0x5c')];}else if(this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x34')]]){_0x416938=this['channels'][_0x4f35c4[_0xe9bd('0x34')]][_0xe9bd('0x6a')];_0x5d8c24=this[_0xe9bd('0x13')][_0x4f35c4[_0xe9bd('0x34')]][_0xe9bd('0x5c')];}logger[_0xe9bd('0x4b')](_0xe9bd('0x6b'),_0x4f35c4[_0xe9bd('0x31')],util[_0xe9bd('0x45')]({'id':this[_0xe9bd('0x14')][_0x4f35c4['channel']['split']('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x4f35c4['channel'][_0xe9bd('0x40')]('-')[0x0]][_0xe9bd('0x43')],'destconnectedlinenum':_0x4f35c4[_0xe9bd('0x3a')],'routealias':_0x416938,'queue':_0x5d8c24||undefined},{'showHidden':![],'depth':null}));this['emit'](util[_0xe9bd('0x3e')](_0xe9bd('0x3f'),this['agents'][_0x4f35c4['channel'][_0xe9bd('0x40')]('-')[0x0]][_0xe9bd('0x41')]),_0xe9bd('0x42'),{'id':this[_0xe9bd('0x14')][_0x4f35c4[_0xe9bd('0x39')]['split']('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this['agents'][_0x4f35c4['channel'][_0xe9bd('0x40')]('-')[0x0]][_0xe9bd('0x43')],'destconnectedlinenum':_0x4f35c4[_0xe9bd('0x3a')],'routealias':_0x416938,'queue':_0x5d8c24||undefined});}}}}catch(_0x140678){logger[_0xe9bd('0x29')](_0xe9bd('0x6c'),_0x4f35c4[_0xe9bd('0x31')],util[_0xe9bd('0x45')](_0x140678,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe9bd('0x2b')][_0xe9bd('0x6d')]=function(_0x59a31e,_0xb1203d){try{if(this['channels'][_0x59a31e]){logger[_0xe9bd('0x27')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x59a31e,_0xb1203d);this['channels'][_0x59a31e][_0xe9bd('0x6e')]=!![];if(_['endsWith'](_0xb1203d,_0xe9bd('0x6f'))){_0xb1203d=_0xb1203d['replace'](_0xe9bd('0x6f'),_0xe9bd('0x70'));}this[_0xe9bd('0x13')][_0x59a31e][_0xe9bd('0x71')]=_0xb1203d;var _0x3f1e3a=_[_0xe9bd('0x72')](this['channels'][_0x59a31e][_0xe9bd('0x73')],{'filename':_0xb1203d});if(_[_0xe9bd('0x74')](_0x3f1e3a)){this['channels'][_0x59a31e][_0xe9bd('0x73')][_0xe9bd('0x75')]({'filename':_0xb1203d,'createdAt':moment()[_0xe9bd('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0xe9bd('0x76')});}}}catch(_0x440495){logger[_0xe9bd('0x29')](_0xe9bd('0x77'),_0x59a31e,util[_0xe9bd('0x45')](_0x440495,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xe9bd('0x1c')]=function(_0x157b8e){try{if(this['isNotNull'](_0x157b8e)){logger[_0xe9bd('0x4b')](_0xe9bd('0x78'),_0x157b8e[_0xe9bd('0x31')],util[_0xe9bd('0x45')](_0x157b8e,{'showHidden':![],'depth':null}));if(this['channels'][_0x157b8e[_0xe9bd('0x31')]]&&_0x157b8e[_0xe9bd('0x39')]!=_0xe9bd('0x46')){if(this[_0xe9bd('0x2c')](_0x157b8e[_0xe9bd('0x79')])){if(this[_0xe9bd('0x2c')](_0x157b8e[_0xe9bd('0x79')]['mixmonitor_filename'])){logger[_0xe9bd('0x27')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x157b8e[_0xe9bd('0x31')],_0x157b8e[_0xe9bd('0x7a')]);this[_0xe9bd('0x6d')](_0x157b8e['uniqueid'],_0x157b8e[_0xe9bd('0x7a')]);}else if(this['isNotNull'](_0x157b8e[_0xe9bd('0x79')][_0xe9bd('0x7b')])){logger[_0xe9bd('0x27')](_0xe9bd('0x7c'),_0x157b8e[_0xe9bd('0x31')],_0x157b8e[_0xe9bd('0x7a')]);this[_0xe9bd('0x13')][_0x157b8e[_0xe9bd('0x31')]][_0xe9bd('0x33')]=_0x157b8e[_0xe9bd('0x7a')];}else if(this[_0xe9bd('0x2c')](_0x157b8e['variable'][_0xe9bd('0x7d')])){logger[_0xe9bd('0x27')](_0xe9bd('0x7e'),_0x157b8e['uniqueid'],_0x157b8e[_0xe9bd('0x7a')]);this[_0xe9bd('0x13')][_0x157b8e['uniqueid']]['callerid']=_0x157b8e['value'];}else if(this['isNotNull'](_0x157b8e[_0xe9bd('0x79')][_0xe9bd('0x7f')])){logger[_0xe9bd('0x27')]('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x157b8e[_0xe9bd('0x31')],_0x157b8e[_0xe9bd('0x7a')]);this['channels'][_0x157b8e[_0xe9bd('0x31')]][_0xe9bd('0x5b')]=_0x157b8e[_0xe9bd('0x7a')];}else if(this[_0xe9bd('0x2c')](_0x157b8e[_0xe9bd('0x79')]['xmd-queue'])){logger[_0xe9bd('0x27')](_0xe9bd('0x80'),_0x157b8e['uniqueid'],_0x157b8e['value']['split'](',')[0x0]);this['channels'][_0x157b8e[_0xe9bd('0x31')]][_0xe9bd('0x5c')]=_0x157b8e[_0xe9bd('0x7a')][_0xe9bd('0x40')](',')[0x0];}else if(this['isNotNull'](_0x157b8e['variable'][_0xe9bd('0x81')])){logger[_0xe9bd('0x27')](_0xe9bd('0x82'),_0x157b8e['uniqueid'],_0x157b8e[_0xe9bd('0x7a')]);this[_0xe9bd('0x13')][_0x157b8e['uniqueid']]['originatecalleridnum']=_0x157b8e[_0xe9bd('0x7a')];}else if(this[_0xe9bd('0x2c')](_0x157b8e[_0xe9bd('0x79')][_0xe9bd('0x83')])){logger[_0xe9bd('0x27')](_0xe9bd('0x84'),_0x157b8e[_0xe9bd('0x31')],_0x157b8e[_0xe9bd('0x7a')]);this[_0xe9bd('0x13')][_0x157b8e['uniqueid']][_0xe9bd('0x85')]=_0x157b8e[_0xe9bd('0x7a')];}else if(this[_0xe9bd('0x2c')](_0x157b8e[_0xe9bd('0x79')][_0xe9bd('0x86')])){logger[_0xe9bd('0x27')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x157b8e[_0xe9bd('0x31')],_0x157b8e['value']);this[_0xe9bd('0x13')][_0x157b8e['uniqueid']][_0xe9bd('0x87')]=_0x157b8e[_0xe9bd('0x7a')];}else if(this['isNotNull'](_0x157b8e[_0xe9bd('0x79')][_0xe9bd('0x88')])){logger['info'](_0xe9bd('0x89'),_0x157b8e[_0xe9bd('0x31')],_0x157b8e[_0xe9bd('0x7a')]);this[_0xe9bd('0x13')][_0x157b8e['uniqueid']][_0xe9bd('0x5c')]=_0x157b8e[_0xe9bd('0x7a')];}else if(this['isNotNull'](_0x157b8e[_0xe9bd('0x79')][_0xe9bd('0x8a')])){logger[_0xe9bd('0x27')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x157b8e[_0xe9bd('0x31')],_0x157b8e[_0xe9bd('0x7a')]);this[_0xe9bd('0x13')][_0x157b8e[_0xe9bd('0x31')]][_0xe9bd('0x8b')]=_0x157b8e[_0xe9bd('0x7a')];}}}else if(this[_0xe9bd('0x2c')](_0x157b8e['variable'][_0xe9bd('0x8c')])){if(_0x157b8e[_0xe9bd('0x7a')]){var _0x176c7a=path['parse'](_0x157b8e[_0xe9bd('0x7a')])['name'];logger['info']('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x176c7a,_0x157b8e[_0xe9bd('0x7a')]);this['syncMixMonitorFilename'](_0x176c7a,_0x157b8e['value']);}}else if(this[_0xe9bd('0x13')][_0x157b8e[_0xe9bd('0x34')]]){if(this['isNotNull'](_0x157b8e[_0xe9bd('0x79')])){if(this[_0xe9bd('0x2c')](_0x157b8e['variable']['sipcallid'])){logger[_0xe9bd('0x27')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x157b8e['linkedid'],_0x157b8e[_0xe9bd('0x7a')]);this[_0xe9bd('0x13')][_0x157b8e[_0xe9bd('0x34')]][_0xe9bd('0x8d')]=_0x157b8e[_0xe9bd('0x7a')];}}}}}catch(_0xb21467){logger[_0xe9bd('0x29')]('[%s][voiceCallReport][varset]',_0x157b8e[_0xe9bd('0x31')],util['inspect'](_0xb21467,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xe9bd('0x1e')]=function(_0x3c9825){try{if(this[_0xe9bd('0x2c')](_0x3c9825)){logger[_0xe9bd('0x4b')](_0xe9bd('0x8e'),_0x3c9825['uniqueid'],util[_0xe9bd('0x45')](_0x3c9825,{'showHidden':![],'depth':null}));if(this[_0xe9bd('0x8f')][_0x3c9825[_0xe9bd('0x34')]]){if(this[_0xe9bd('0x13')][this[_0xe9bd('0x8f')][_0x3c9825[_0xe9bd('0x34')]]['linkedid']]){this[_0xe9bd('0x13')][this[_0xe9bd('0x8f')][_0x3c9825[_0xe9bd('0x34')]][_0xe9bd('0x34')]][_0xe9bd('0x31')]=_0x3c9825[_0xe9bd('0x31')];this['channels'][this[_0xe9bd('0x8f')][_0x3c9825[_0xe9bd('0x34')]]['linkedid']][_0xe9bd('0x67')]=this[_0xe9bd('0x13')][_0x3c9825[_0xe9bd('0x31')]][_0xe9bd('0x67')];this['channels'][this[_0xe9bd('0x8f')][_0x3c9825[_0xe9bd('0x34')]][_0xe9bd('0x34')]][_0xe9bd('0x60')]=this[_0xe9bd('0x13')][_0x3c9825[_0xe9bd('0x31')]][_0xe9bd('0x60')];this[_0xe9bd('0x13')][this[_0xe9bd('0x8f')][_0x3c9825['linkedid']][_0xe9bd('0x34')]][_0xe9bd('0x63')]=this[_0xe9bd('0x13')][this[_0xe9bd('0x8f')][_0x3c9825[_0xe9bd('0x34')]][_0xe9bd('0x34')]][_0xe9bd('0x39')];this['channels'][this[_0xe9bd('0x8f')][_0x3c9825['linkedid']][_0xe9bd('0x34')]][_0xe9bd('0x64')]=this[_0xe9bd('0x13')][_0x3c9825[_0xe9bd('0x31')]][_0xe9bd('0x64')];this[_0xe9bd('0x13')][_0x3c9825['uniqueid']]=this[_0xe9bd('0x13')][this[_0xe9bd('0x8f')][_0x3c9825[_0xe9bd('0x34')]]['linkedid']];delete this[_0xe9bd('0x13')][this[_0xe9bd('0x8f')][_0x3c9825[_0xe9bd('0x34')]][_0xe9bd('0x34')]];}else if(this[_0xe9bd('0x13')][this[_0xe9bd('0x8f')][_0x3c9825[_0xe9bd('0x34')]][_0xe9bd('0x31')]]){this[_0xe9bd('0x13')][this[_0xe9bd('0x8f')][_0x3c9825['linkedid']][_0xe9bd('0x31')]][_0xe9bd('0x31')]=[this[_0xe9bd('0x13')][this['blindTransfers'][_0x3c9825[_0xe9bd('0x34')]][_0xe9bd('0x31')]][_0xe9bd('0x34')],this['channels'][this['blindTransfers'][_0x3c9825[_0xe9bd('0x34')]][_0xe9bd('0x31')]][_0xe9bd('0x34')]=this[_0xe9bd('0x13')][this[_0xe9bd('0x8f')][_0x3c9825[_0xe9bd('0x34')]][_0xe9bd('0x31')]]['uniqueid']][0x0];this[_0xe9bd('0x13')][this[_0xe9bd('0x8f')][_0x3c9825['linkedid']][_0xe9bd('0x31')]][_0xe9bd('0x67')]=this[_0xe9bd('0x13')][_0x3c9825[_0xe9bd('0x31')]][_0xe9bd('0x67')];this[_0xe9bd('0x13')][this[_0xe9bd('0x8f')][_0x3c9825[_0xe9bd('0x34')]][_0xe9bd('0x31')]][_0xe9bd('0x60')]=this[_0xe9bd('0x13')][_0x3c9825[_0xe9bd('0x31')]][_0xe9bd('0x60')];this[_0xe9bd('0x13')][this[_0xe9bd('0x8f')][_0x3c9825['linkedid']][_0xe9bd('0x31')]][_0xe9bd('0x63')]=this[_0xe9bd('0x13')][this[_0xe9bd('0x8f')][_0x3c9825[_0xe9bd('0x34')]]['uniqueid']][_0xe9bd('0x39')];this[_0xe9bd('0x13')][this[_0xe9bd('0x8f')][_0x3c9825[_0xe9bd('0x34')]][_0xe9bd('0x31')]][_0xe9bd('0x64')]=this[_0xe9bd('0x13')][_0x3c9825[_0xe9bd('0x31')]][_0xe9bd('0x64')];this[_0xe9bd('0x13')][_0x3c9825[_0xe9bd('0x31')]]=this[_0xe9bd('0x13')][this[_0xe9bd('0x8f')][_0x3c9825['linkedid']][_0xe9bd('0x31')]];delete this[_0xe9bd('0x13')][this[_0xe9bd('0x8f')][_0x3c9825[_0xe9bd('0x34')]][_0xe9bd('0x31')]];}}if(this[_0xe9bd('0x13')][_0x3c9825[_0xe9bd('0x31')]]){logger[_0xe9bd('0x27')](_0xe9bd('0x90'),_0x3c9825[_0xe9bd('0x31')],_0x3c9825[_0xe9bd('0x91')]);var _0x2abe2a=moment();this['channels'][_0x3c9825[_0xe9bd('0x31')]][_0xe9bd('0x92')]=_0x2abe2a[_0xe9bd('0x3e')](_0xe9bd('0x49'));this[_0xe9bd('0x13')][_0x3c9825['uniqueid']][_0xe9bd('0x54')]=_0x2abe2a[_0xe9bd('0x61')](this[_0xe9bd('0x13')][_0x3c9825['uniqueid']][_0xe9bd('0x48')],_0xe9bd('0x56'));if(this['channels'][_0x3c9825['uniqueid']]['answered']){this[_0xe9bd('0x13')][_0x3c9825[_0xe9bd('0x31')]]['billableseconds']=_0x2abe2a[_0xe9bd('0x61')](this[_0xe9bd('0x13')][_0x3c9825[_0xe9bd('0x31')]]['answertime'],_0xe9bd('0x56'));this[_0xe9bd('0x13')][_0x3c9825[_0xe9bd('0x31')]][_0xe9bd('0x68')]=this['channels'][_0x3c9825[_0xe9bd('0x31')]][_0xe9bd('0x54')]-this['channels'][_0x3c9825[_0xe9bd('0x31')]][_0xe9bd('0x93')];}if(_0x3c9825[_0xe9bd('0x37')]===_0xe9bd('0x38')){if(this['agents'][_0x3c9825['channel']['split']('-')[0x0]]){this[_0xe9bd('0x14')][_0x3c9825['channel'][_0xe9bd('0x40')]('-')[0x0]]=_[_0xe9bd('0x94')](this[_0xe9bd('0x14')][_0x3c9825[_0xe9bd('0x39')][_0xe9bd('0x40')]('-')[0x0]],[_0xe9bd('0x3c')]);logger['debug'](_0xe9bd('0x95'),_0x3c9825[_0xe9bd('0x31')],util[_0xe9bd('0x45')]({'id':this[_0xe9bd('0x14')][_0x3c9825[_0xe9bd('0x39')][_0xe9bd('0x40')]('-')[0x0]]['id'],'destaccountcode':this[_0xe9bd('0x14')][_0x3c9825['channel'][_0xe9bd('0x40')]('-')[0x0]][_0xe9bd('0x43')]},{'showHidden':![],'depth':null}));this[_0xe9bd('0x2e')](util[_0xe9bd('0x3e')]('user:%s',this[_0xe9bd('0x14')][_0x3c9825[_0xe9bd('0x39')][_0xe9bd('0x40')]('-')[0x0]][_0xe9bd('0x41')]),_0xe9bd('0x96'),{'id':this[_0xe9bd('0x14')][_0x3c9825[_0xe9bd('0x39')][_0xe9bd('0x40')]('-')[0x0]]['id'],'destaccountcode':this[_0xe9bd('0x14')][_0x3c9825[_0xe9bd('0x39')][_0xe9bd('0x40')]('-')[0x0]][_0xe9bd('0x43')]});for(var _0x11a03d=0x0;_0x11a03d<Object['keys'](this[_0xe9bd('0x14')])[_0xe9bd('0x97')];_0x11a03d++){var _0x571328=Object[_0xe9bd('0x36')](this[_0xe9bd('0x14')])[_0x11a03d];var _0x106e0e=this['agents'][_0x571328];if(_0x106e0e[_0xe9bd('0x43')]===Number(_0x3c9825[_0xe9bd('0x3d')])){this[_0xe9bd('0x2e')](util[_0xe9bd('0x3e')]('user:%s',_0x106e0e[_0xe9bd('0x41')]),_0xe9bd('0x96'),{'id':_0x106e0e['id'],'destaccountcode':_0x106e0e[_0xe9bd('0x43')],'transfer':this[_0xe9bd('0x13')][_0x3c9825[_0xe9bd('0x31')]][_0xe9bd('0x98')]});break;}}}}var _0x58f73d=this;Promise[_0xe9bd('0x99')]()['then'](function(){var _0x4af2eb=_0x58f73d[_0xe9bd('0x13')][_0x3c9825['uniqueid']];if(typeof _0x4af2eb[_0xe9bd('0x98')]==='undefined')return;if(_[_0xe9bd('0x9a')](_0x4af2eb[_0xe9bd('0x73')]))return;return RpcSetting['getSettings']()[_0xe9bd('0x9b')](function(_0x1feb09){if(!_0x1feb09[_0xe9bd('0x9c')])return;return Promise[_0xe9bd('0x99')]()[_0xe9bd('0x9b')](function(){return ami[_0xe9bd('0x9d')]({'action':_0xe9bd('0x9e'),'channel':_0x4af2eb['channel']})[_0xe9bd('0x9f')](function(){});})[_0xe9bd('0x9b')](function(){return ami[_0xe9bd('0x9d')]({'action':_0xe9bd('0x9e'),'channel':_0x4af2eb[_0xe9bd('0x63')]})[_0xe9bd('0x9f')](function(){})['finally'](function(){var _0xb82cb2=_0x58f73d[_0xe9bd('0x14')][_0x4af2eb[_0xe9bd('0x63')][_0xe9bd('0x40')]('-')[0x0]];if(!_0xb82cb2)return;io[_0xe9bd('0x2e')]('webbar:stopmonitors',{'agentId':_0xb82cb2['id'],'uniqueid':_0x4af2eb['uniqueid']});});});});})['then'](function(){if(_0x3c9825[_0xe9bd('0xa0')]==='BlindTransfer'){_0x58f73d[_0xe9bd('0x8f')][_0x3c9825[_0xe9bd('0x31')]]=_0x3c9825;}else{if(_0x58f73d['channels'][_0x3c9825[_0xe9bd('0x31')]][_0xe9bd('0x5b')]===_0xe9bd('0xa1')&&_0x58f73d[_0xe9bd('0x8f')][_0x3c9825[_0xe9bd('0x31')]]){_0x58f73d[_0xe9bd('0x13')][_0x3c9825[_0xe9bd('0x31')]]['uniqueid']=[_0x58f73d['channels'][_0x3c9825[_0xe9bd('0x31')]]['linkedid'],_0x58f73d['channels'][_0x3c9825[_0xe9bd('0x31')]][_0xe9bd('0x34')]=_0x58f73d[_0xe9bd('0x13')][_0x3c9825[_0xe9bd('0x31')]][_0xe9bd('0x31')]][0x0];delete _0x58f73d[_0xe9bd('0x8f')][_0x3c9825[_0xe9bd('0x31')]];}}logger[_0xe9bd('0x4b')](_0xe9bd('0xa2'),_0x3c9825[_0xe9bd('0x31')],util[_0xe9bd('0x45')](_0x58f73d['channels'][_0x3c9825[_0xe9bd('0x31')]],{'showHidden':![],'depth':null}));ami['emit'](_0xe9bd('0xa3'),_0x58f73d[_0xe9bd('0x13')][_0x3c9825[_0xe9bd('0x31')]]);delete _0x58f73d[_0xe9bd('0x13')][_0x3c9825['uniqueid']];});}}}catch(_0x22ca72){logger[_0xe9bd('0x29')](_0xe9bd('0xa4'),_0x3c9825['uniqueid'],util['inspect'](_0x22ca72,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe9bd('0x2b')][_0xe9bd('0x20')]=function(_0x6e1fd3){try{if(this[_0xe9bd('0x2c')](_0x6e1fd3)){logger[_0xe9bd('0x27')](_0xe9bd('0xa5'),_0x6e1fd3['uniqueid'],_0x6e1fd3[_0xe9bd('0xa6')],_0x6e1fd3[_0xe9bd('0xa7')]);logger[_0xe9bd('0x4b')](_0xe9bd('0xa8'),_0x6e1fd3['uniqueid'],util[_0xe9bd('0x45')](_0x6e1fd3,{'showHidden':![],'depth':null}));var _0xddd7aa;if(this[_0xe9bd('0x13')][_0x6e1fd3['transfereeuniqueid']]){this[_0xe9bd('0x13')][_0x6e1fd3[_0xe9bd('0xa9')]][_0xe9bd('0xaa')]=_0x6e1fd3[_0xe9bd('0xa6')];this[_0xe9bd('0x13')][_0x6e1fd3[_0xe9bd('0xa9')]][_0xe9bd('0xab')]=_0x6e1fd3['transfertargetcalleridnum'];if(this['channels'][_0x6e1fd3[_0xe9bd('0xac')]]){_0xddd7aa=this[_0xe9bd('0x13')][_0x6e1fd3[_0xe9bd('0xac')]];this['channels'][_0x6e1fd3['secondtransfereruniqueid']]=this[_0xe9bd('0x13')][_0x6e1fd3[_0xe9bd('0xa9')]];this[_0xe9bd('0x13')][_0x6e1fd3['transfereeuniqueid']]=_0xddd7aa;}this[_0xe9bd('0x13')][_0x6e1fd3['secondtransfereruniqueid']][_0xe9bd('0x98')]=_0xe9bd('0xad');}else if(this[_0xe9bd('0x13')][_0x6e1fd3[_0xe9bd('0xae')]]){this[_0xe9bd('0x13')][_0x6e1fd3[_0xe9bd('0xae')]][_0xe9bd('0xaa')]=_0x6e1fd3[_0xe9bd('0xa6')];this[_0xe9bd('0x13')][_0x6e1fd3['transfertargetuniqueid']]['transferconnectedlinenum']=_0x6e1fd3[_0xe9bd('0xa7')];if(this[_0xe9bd('0x13')][_0x6e1fd3[_0xe9bd('0xaf')]]){_0xddd7aa=this[_0xe9bd('0x13')][_0x6e1fd3[_0xe9bd('0xaf')]];this[_0xe9bd('0x13')][_0x6e1fd3[_0xe9bd('0xaf')]]=this[_0xe9bd('0x13')][_0x6e1fd3['transfertargetuniqueid']];this[_0xe9bd('0x13')][_0x6e1fd3[_0xe9bd('0xae')]]=_0xddd7aa;}this['channels'][_0x6e1fd3[_0xe9bd('0xae')]]['transferType']=_0xe9bd('0xad');}if((this[_0xe9bd('0x13')][_0x6e1fd3[_0xe9bd('0xaf')]]||this['channels'][_0x6e1fd3[_0xe9bd('0xb0')]])&&this[_0xe9bd('0x13')][_0x6e1fd3['secondtransfereruniqueid']]){var _0x10d9ed=_[_0xe9bd('0xb1')]([this[_0xe9bd('0x13')][_0x6e1fd3[_0xe9bd('0xaf')]],this[_0xe9bd('0x13')][_0x6e1fd3['origtransfererlinkedid']],this[_0xe9bd('0x13')][_0x6e1fd3[_0xe9bd('0xac')]]],function(_0x993518){return _0x993518&&_0x993518[_0xe9bd('0x5b')]===_0xe9bd('0xa1')&&_0x993518[_0xe9bd('0xb2')];});if(_0x10d9ed){if(this['channels'][_0x6e1fd3[_0xe9bd('0xaf')]])this['channels'][_0x6e1fd3[_0xe9bd('0xaf')]]['transferType']=_0xe9bd('0xad');if(this[_0xe9bd('0x13')][_0x6e1fd3['origtransfererlinkedid']])this[_0xe9bd('0x13')][_0x6e1fd3[_0xe9bd('0xb0')]]['transferType']=_0xe9bd('0xad');this['channels'][_0x6e1fd3['secondtransfereruniqueid']]['transferType']=_0xe9bd('0xad');}}}}catch(_0x51550e){logger['error']('[%s][voiceCallReport][attendedtransfer]',_0x6e1fd3[_0xe9bd('0x31')],util['inspect'](_0x51550e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe9bd('0x2b')][_0xe9bd('0x22')]=function(_0x535249){try{if(this[_0xe9bd('0x2c')](_0x535249)){logger[_0xe9bd('0x27')](_0xe9bd('0xb3'),_0x535249[_0xe9bd('0x31')],_0x535249[_0xe9bd('0xb4')],_0x535249[_0xe9bd('0xb5')]);logger[_0xe9bd('0x4b')](_0xe9bd('0xb6'),_0x535249[_0xe9bd('0x31')],util[_0xe9bd('0x45')](_0x535249,{'showHidden':![],'depth':null}));if(this[_0xe9bd('0x13')][_0x535249[_0xe9bd('0xa9')]]){this[_0xe9bd('0x13')][_0x535249['transfereeuniqueid']][_0xe9bd('0xaa')]=_0x535249[_0xe9bd('0xb4')];this[_0xe9bd('0x13')][_0x535249[_0xe9bd('0xa9')]][_0xe9bd('0xab')]=_0x535249['extension'];this[_0xe9bd('0x13')][_0x535249[_0xe9bd('0xa9')]][_0xe9bd('0x98')]=_0xe9bd('0xb7');this[_0xe9bd('0x1e')]({'event':_0xe9bd('0xb8'),'uniqueid':_0x535249[_0xe9bd('0xa9')],'linkedid':_0x535249['transfereruniqueid'],'context':_0x535249[_0xe9bd('0x37')],'channel':_0x535249[_0xe9bd('0xb9')]});}else{this['channels'][_0x535249[_0xe9bd('0xba')]][_0xe9bd('0x98')]=_0xe9bd('0xb7');this[_0xe9bd('0x1e')]({'event':_0xe9bd('0xb8'),'uniqueid':_0x535249[_0xe9bd('0xba')],'linkedid':_0x535249[_0xe9bd('0xa9')],'context':_0x535249[_0xe9bd('0x37')],'channel':_0x535249['transfererchannel']});}}}catch(_0x3e445d){logger[_0xe9bd('0x29')](_0xe9bd('0xbb'),_0x535249['uniqueid'],util[_0xe9bd('0x45')](_0x3e445d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xe9bd('0x2b')]['syncMusicOnHoldStart']=function(_0x48dc13){try{if(this[_0xe9bd('0x2c')](_0x48dc13)){logger['debug'](_0xe9bd('0xbc'),_0x48dc13[_0xe9bd('0x31')],util[_0xe9bd('0x45')](_0x48dc13,{'showHidden':![],'depth':null}));if(this[_0xe9bd('0x13')][_0x48dc13[_0xe9bd('0x31')]]){if(!_[_0xe9bd('0x74')](this[_0xe9bd('0x13')][_0x48dc13[_0xe9bd('0x31')]]['answertime'])){this[_0xe9bd('0x13')][_0x48dc13[_0xe9bd('0x31')]][_0xe9bd('0xbd')]=moment()[_0xe9bd('0x3e')](_0xe9bd('0x49'));logger[_0xe9bd('0x27')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0x48dc13[_0xe9bd('0x31')],this[_0xe9bd('0x13')][_0x48dc13[_0xe9bd('0x31')]][_0xe9bd('0xbd')]);}}}}catch(_0x458fe0){logger[_0xe9bd('0x29')](_0xe9bd('0xbe'),_0x48dc13[_0xe9bd('0x31')],util['inspect'](_0x458fe0,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xe9bd('0x26')]=function(_0x203a9b){try{if(this[_0xe9bd('0x2c')](_0x203a9b)){logger[_0xe9bd('0x4b')](_0xe9bd('0xbf'),_0x203a9b[_0xe9bd('0x31')],util[_0xe9bd('0x45')](_0x203a9b,{'showHidden':![],'depth':null}));if(this[_0xe9bd('0x13')][_0x203a9b[_0xe9bd('0x31')]]){if(!_[_0xe9bd('0x74')](this['channels'][_0x203a9b[_0xe9bd('0x31')]][_0xe9bd('0xbd')])){this[_0xe9bd('0x13')][_0x203a9b[_0xe9bd('0x31')]][_0xe9bd('0xc0')]+=moment()[_0xe9bd('0xc1')](0x0)[_0xe9bd('0x61')](this['channels'][_0x203a9b[_0xe9bd('0x31')]][_0xe9bd('0xbd')],_0xe9bd('0x56'));logger[_0xe9bd('0x27')](_0xe9bd('0xc2'),_0x203a9b['uniqueid'],this[_0xe9bd('0x13')][_0x203a9b[_0xe9bd('0x31')]][_0xe9bd('0xc0')]);delete this[_0xe9bd('0x13')][_0x203a9b[_0xe9bd('0x31')]]['mohstarttime'];}}}}catch(_0x302497){logger['error'](_0xe9bd('0xc3'),_0x203a9b[_0xe9bd('0x31')],util[_0xe9bd('0x45')](_0x302497,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport;
\ No newline at end of file
index 1ef09c7..8358226 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc97=['emit','syncDialBegin','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','channels','format','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','privilege','info','membername','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','variable','outboundrouteid','isUndefined','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','keys','value','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','syncHangup','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','diff','complete','answered','holdtime','seconds','billableseconds','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','linkedid','destuniqueid','error','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','exports','lodash','moment','util','../../../config/environment','ami','../ami','defaults','redis','localhost','socket.io-emitter','outbound','applications','variables','dialbegin','bind','dialend','syncDialEnd','varset','syncVarSet','isNotNull','prototype'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc97,0x13b));var _0x7dc9=function(_0x4a08a5,_0x4d1397){_0x4a08a5=_0x4a08a5-0x0;var _0x509b5d=_0xdc97[_0x4a08a5];return _0x509b5d;};'use strict';var _=require(_0x7dc9('0x0'));var moment=require(_0x7dc9('0x1'));var util=require(_0x7dc9('0x2'));var Redis=require('ioredis');var config=require(_0x7dc9('0x3'));var logger=require('../../../config/logger')(_0x7dc9('0x4'));var ami=require(_0x7dc9('0x5'));config['redis']=_[_0x7dc9('0x6')](config[_0x7dc9('0x7')],{'host':_0x7dc9('0x8'),'port':0x18eb});var io=require(_0x7dc9('0x9'))(new Redis(config['redis']));function VoiceDialReport(_0x2636ef){this['channels']=_0x2636ef['outboundChannels'];this[_0x7dc9('0xa')]=_0x2636ef[_0x7dc9('0xa')];this[_0x7dc9('0xb')]={};this[_0x7dc9('0xc')]={};ami['on'](_0x7dc9('0xd'),this['syncDialBegin'][_0x7dc9('0xe')](this));ami['on'](_0x7dc9('0xf'),this[_0x7dc9('0x10')][_0x7dc9('0xe')](this));ami['on'](_0x7dc9('0x11'),this[_0x7dc9('0x12')][_0x7dc9('0xe')](this));ami['on']('hangup',this['syncHangup']['bind'](this));}VoiceDialReport['prototype'][_0x7dc9('0x13')]=function(_0x14e5db){return _0x14e5db!==null&&!_['isUndefined'](_0x14e5db);};VoiceDialReport[_0x7dc9('0x14')][_0x7dc9('0x15')]=function(_0xaadf2,_0xf37bc7,_0x31d43d){io['to'](_0xaadf2)[_0x7dc9('0x15')](_0xf37bc7,_0x31d43d);};VoiceDialReport['prototype'][_0x7dc9('0x16')]=function(_0x278191){try{if(this[_0x7dc9('0x13')](_0x278191)){logger[_0x7dc9('0x17')](_0x7dc9('0x18'),_0x278191[_0x7dc9('0x19')],util[_0x7dc9('0x1a')](_0x278191,{'showHidden':![],'depth':null}));if(this[_0x7dc9('0x1b')][_0x278191[_0x7dc9('0x19')]]){_['merge'](this[_0x7dc9('0x1b')][_0x278191['uniqueid']],{'starttime':moment()[_0x7dc9('0x1c')](_0x7dc9('0x1d')),'lastevent':'called','interface':_0x278191[_0x7dc9('0x1e')][_0x7dc9('0x1f')](0x0,_0x278191[_0x7dc9('0x1e')][_0x7dc9('0x20')]('-')),'membername':_0x278191[_0x7dc9('0x1e')][_0x7dc9('0x1f')](_0x278191[_0x7dc9('0x1e')][_0x7dc9('0x20')]('/')+0x1,_0x278191[_0x7dc9('0x1e')][_0x7dc9('0x20')]('-'))},_['omit'](_0x278191,['event',_0x7dc9('0x21')]));logger[_0x7dc9('0x22')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x278191[_0x7dc9('0x19')],this[_0x7dc9('0x1b')][_0x278191['uniqueid']][_0x7dc9('0x23')],this[_0x7dc9('0x1b')][_0x278191[_0x7dc9('0x19')]]['interface']);logger[_0x7dc9('0x17')](_0x7dc9('0x24'),_0x278191[_0x7dc9('0x19')],util['inspect'](this['channels'][_0x278191['uniqueid']],{'showHidden':![],'depth':null}));if(this[_0x7dc9('0xb')][_0x278191[_0x7dc9('0x19')]])_['merge'](this['channels'][_0x278191[_0x7dc9('0x19')]],this['applications'][_0x278191[_0x7dc9('0x19')]]);this[_0x7dc9('0x15')](_0x7dc9('0x25'),_0x7dc9('0x26'),this[_0x7dc9('0x1b')][_0x278191[_0x7dc9('0x19')]]);logger[_0x7dc9('0x17')](_0x7dc9('0x27'),_0x278191[_0x7dc9('0x19')],util[_0x7dc9('0x1a')](this[_0x7dc9('0x1b')][_0x278191[_0x7dc9('0x19')]],{'showHidden':![],'depth':null}));ami['emit']('custom:dialbegin',this['channels'][_0x278191['uniqueid']]);}}}catch(_0x4a68f0){logger['error']('[%s][voiceDialReport][dialbegin]',_0x278191['uniqueid'],util[_0x7dc9('0x1a')](_0x4a68f0,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7dc9('0x14')][_0x7dc9('0x10')]=function(_0x225410){try{if(this[_0x7dc9('0x13')](_0x225410)){logger[_0x7dc9('0x17')]('[%s][voiceDialReport][dialend]\x20event:',_0x225410['uniqueid'],util['inspect'](_0x225410,{'showHidden':![],'depth':null}));if(this[_0x7dc9('0x1b')][_0x225410['uniqueid']]){this[_0x7dc9('0x1b')][_0x225410[_0x7dc9('0x19')]][_0x7dc9('0x28')]=_0x225410[_0x7dc9('0x28')];if(_0x225410[_0x7dc9('0x28')]===_0x7dc9('0x29')){this[_0x7dc9('0x1b')][_0x225410[_0x7dc9('0x19')]]['connectedlinenum']=_0x225410[_0x7dc9('0x2a')];this['channels'][_0x225410[_0x7dc9('0x19')]][_0x7dc9('0x2b')]=_0x225410[_0x7dc9('0x2b')];this[_0x7dc9('0x1b')][_0x225410['uniqueid']][_0x7dc9('0x2c')]=moment()['format'](_0x7dc9('0x1d'));this['channels'][_0x225410['uniqueid']][_0x7dc9('0x2d')]=_0x7dc9('0x2e');logger[_0x7dc9('0x22')](_0x7dc9('0x2f'),_0x225410['uniqueid'],_0x225410[_0x7dc9('0x1e')][_0x7dc9('0x1f')](_0x225410[_0x7dc9('0x1e')][_0x7dc9('0x20')]('/')+0x1,_0x225410[_0x7dc9('0x1e')][_0x7dc9('0x20')]('-')));logger[_0x7dc9('0x17')](_0x7dc9('0x30'),_0x225410[_0x7dc9('0x19')],util[_0x7dc9('0x1a')](this[_0x7dc9('0x1b')][_0x225410[_0x7dc9('0x19')]],{'showHidden':![],'depth':null}));ami['emit'](_0x7dc9('0x31'),this[_0x7dc9('0x1b')][_0x225410[_0x7dc9('0x19')]]);}logger[_0x7dc9('0x17')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x225410[_0x7dc9('0x19')],util[_0x7dc9('0x1a')](this[_0x7dc9('0x1b')][_0x225410[_0x7dc9('0x19')]],{'showHidden':![],'depth':null}));this[_0x7dc9('0x15')](_0x7dc9('0x25'),'voice_outbound_channel:save',this['channels'][_0x225410[_0x7dc9('0x19')]]);}}}catch(_0x36a965){logger['error'](_0x7dc9('0x32'),_0x225410['uniqueid'],util[_0x7dc9('0x1a')](_0x36a965,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7dc9('0x14')][_0x7dc9('0x12')]=function(_0x5e056e){try{if(this[_0x7dc9('0x13')](_0x5e056e)){logger[_0x7dc9('0x17')](_0x7dc9('0x33'),_0x5e056e[_0x7dc9('0x19')],util[_0x7dc9('0x1a')](_0x5e056e,{'showHidden':![],'depth':null}));this[_0x7dc9('0x34')](_0x5e056e[_0x7dc9('0x19')],_['keys'](_0x5e056e[_0x7dc9('0x35')])[0x0],_0x5e056e['value']);if(this['isNotNull'](_0x5e056e[_0x7dc9('0x35')])&&this[_0x7dc9('0x13')](_0x5e056e[_0x7dc9('0x35')][_0x7dc9('0x36')])){if(_[_0x7dc9('0x37')](this[_0x7dc9('0x1b')][_0x5e056e[_0x7dc9('0x19')]])){this[_0x7dc9('0x1b')][_0x5e056e[_0x7dc9('0x19')]]={'routeId':_0x5e056e['value'],'variables':this[_0x7dc9('0xc')][_0x5e056e[_0x7dc9('0x19')]],'motionChannel':_0x7dc9('0x38')};logger[_0x7dc9('0x22')](_0x7dc9('0x39'),_0x5e056e[_0x7dc9('0x19')],_0x5e056e['variable'][_0x7dc9('0x36')],_[_0x7dc9('0x3a')](_0x5e056e['variable'])[0x0],_0x5e056e[_0x7dc9('0x3b')]);logger[_0x7dc9('0x17')](_0x7dc9('0x3c'),_0x5e056e['uniqueid'],util[_0x7dc9('0x1a')](this['channels'][_0x5e056e['uniqueid']],{'showHidden':![],'depth':null}));this[_0x7dc9('0x15')](_0x7dc9('0x25'),_0x7dc9('0x26'),this['channels'][_0x5e056e['uniqueid']]);}}}}catch(_0x415ebd){logger['error'](_0x7dc9('0x3d'),_0x5e056e[_0x7dc9('0x19')],util['inspect'](_0x415ebd,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7dc9('0x14')][_0x7dc9('0x34')]=function(_0x1f2a6e,_0x154e2d,_0x414bf4){var _0x113087=[_0x7dc9('0x3e'),_0x7dc9('0x3f'),_0x7dc9('0x40'),_0x7dc9('0x41'),_0x7dc9('0x42'),_0x7dc9('0x43'),_0x7dc9('0x44'),'rtpaudioqosrttbridged',_0x7dc9('0x45'),'sipuri','bridgepeer',_0x7dc9('0x46'),_0x7dc9('0x47'),_0x7dc9('0x48'),_0x7dc9('0x49'),_0x7dc9('0x4a'),'membername',_0x7dc9('0x4b'),_0x7dc9('0x4c')];if(!_[_0x7dc9('0x4d')](_0x154e2d)&&!_['includes'](_0x113087,_0x154e2d)){if(_[_0x7dc9('0x37')](this[_0x7dc9('0xc')][_0x1f2a6e])){this[_0x7dc9('0xc')][_0x1f2a6e]={};}this[_0x7dc9('0xc')][_0x1f2a6e][_0x154e2d]=_0x414bf4;}};VoiceDialReport[_0x7dc9('0x14')][_0x7dc9('0x4e')]=function(_0x593132){try{if(this[_0x7dc9('0x13')](_0x593132)){logger[_0x7dc9('0x17')](_0x7dc9('0x4f'),_0x593132[_0x7dc9('0x19')],util[_0x7dc9('0x1a')](_0x593132,{'showHidden':![],'depth':null}));if(this[_0x7dc9('0x1b')][_0x593132[_0x7dc9('0x19')]]){logger[_0x7dc9('0x22')](_0x7dc9('0x50'),_0x593132[_0x7dc9('0x19')],_0x593132[_0x7dc9('0x51')]);this[_0x7dc9('0x1b')][_0x593132['uniqueid']][_0x7dc9('0x52')]=moment()[_0x7dc9('0x1c')](_0x7dc9('0x1d'));this[_0x7dc9('0x1b')][_0x593132[_0x7dc9('0x19')]]['duration']=moment(this[_0x7dc9('0x1b')][_0x593132[_0x7dc9('0x19')]][_0x7dc9('0x52')])[_0x7dc9('0x53')](this[_0x7dc9('0x1b')][_0x593132[_0x7dc9('0x19')]]['starttime'],'seconds');this['channels'][_0x593132[_0x7dc9('0x19')]][_0x7dc9('0x2d')]=_0x7dc9('0x54');this[_0x7dc9('0xa')]['total']+=0x1;if(this['channels'][_0x593132[_0x7dc9('0x19')]][_0x7dc9('0x2c')]){this[_0x7dc9('0xa')][_0x7dc9('0x55')]+=0x1;this[_0x7dc9('0x1b')][_0x593132[_0x7dc9('0x19')]][_0x7dc9('0x56')]=moment(this['channels'][_0x593132[_0x7dc9('0x19')]][_0x7dc9('0x2c')])[_0x7dc9('0x53')](this[_0x7dc9('0x1b')][_0x593132[_0x7dc9('0x19')]]['starttime'],_0x7dc9('0x57'));this[_0x7dc9('0x1b')][_0x593132[_0x7dc9('0x19')]][_0x7dc9('0x58')]=moment(this[_0x7dc9('0x1b')][_0x593132[_0x7dc9('0x19')]][_0x7dc9('0x52')])[_0x7dc9('0x53')](this[_0x7dc9('0x1b')][_0x593132[_0x7dc9('0x19')]][_0x7dc9('0x2c')],_0x7dc9('0x57'));this[_0x7dc9('0xa')]['sumHoldTime']+=this[_0x7dc9('0x1b')][_0x593132['uniqueid']][_0x7dc9('0x56')]||0x0;this[_0x7dc9('0xa')]['sumBillable']+=this[_0x7dc9('0x1b')][_0x593132[_0x7dc9('0x19')]]['billableseconds'];}this[_0x7dc9('0xa')][_0x7dc9('0x59')]+=this[_0x7dc9('0x1b')][_0x593132['uniqueid']]['duration'];logger[_0x7dc9('0x17')](_0x7dc9('0x5a'),_0x593132[_0x7dc9('0x19')],util[_0x7dc9('0x1a')](this[_0x7dc9('0x1b')][_0x593132[_0x7dc9('0x19')]],{'showHidden':![],'depth':null}));ami[_0x7dc9('0x15')](_0x7dc9('0x5b'),this[_0x7dc9('0x1b')][_0x593132['uniqueid']]);logger[_0x7dc9('0x17')](_0x7dc9('0x5c'),_0x593132[_0x7dc9('0x19')],util['inspect'](this['channels'][_0x593132[_0x7dc9('0x19')]],{'showHidden':![],'depth':null}));ami[_0x7dc9('0x15')](_0x7dc9('0x5d'),this[_0x7dc9('0x1b')][_0x593132['uniqueid']]);logger['debug'](_0x7dc9('0x5e'),_0x593132[_0x7dc9('0x19')],util[_0x7dc9('0x1a')](this[_0x7dc9('0x1b')][_0x593132['uniqueid']],{'showHidden':![],'depth':null}));this[_0x7dc9('0x15')](_0x7dc9('0x25'),_0x7dc9('0x5f'),this[_0x7dc9('0xa')]);logger[_0x7dc9('0x22')](_0x7dc9('0x60'),JSON[_0x7dc9('0x61')](this['channels'][_0x593132[_0x7dc9('0x19')]]));logger[_0x7dc9('0x17')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x593132['uniqueid'],util[_0x7dc9('0x1a')](this['channels'][_0x593132[_0x7dc9('0x19')]],{'showHidden':![],'depth':null}));this[_0x7dc9('0x15')](_0x7dc9('0x25'),_0x7dc9('0x62'),this[_0x7dc9('0x1b')][_0x593132[_0x7dc9('0x19')]]);delete this[_0x7dc9('0x1b')][_0x593132[_0x7dc9('0x19')]];}else if(this[_0x7dc9('0x1b')][_0x593132[_0x7dc9('0x63')]]){this['channels'][_0x593132[_0x7dc9('0x63')]][_0x7dc9('0x19')]=this[_0x7dc9('0x1b')][_0x593132['linkedid']][_0x7dc9('0x64')];}if(this['variables'][_0x593132['uniqueid']]){delete this[_0x7dc9('0xc')][_0x593132[_0x7dc9('0x19')]];}}}catch(_0x4db3cc){logger[_0x7dc9('0x65')]('[%s][voiceDialReport][hangup]',_0x593132['uniqueid'],util[_0x7dc9('0x1a')](_0x4db3cc,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7dc9('0x14')][_0x7dc9('0x66')]=function(_0xb8be9){try{if(this['isNotNull'](_0xb8be9)){logger[_0x7dc9('0x17')](_0x7dc9('0x67'),_0xb8be9[_0x7dc9('0x19')],util[_0x7dc9('0x1a')](_0xb8be9,{'showHidden':![],'depth':null}));if(_0xb8be9[_0x7dc9('0x68')][_0x7dc9('0x69')]()===_0x7dc9('0x6a')){_0xb8be9[_0x7dc9('0x6b')]=(_0xb8be9['appdata']||_0xb8be9['applicationdata'])[_0x7dc9('0x69')]();if(_['startsWith'](_0xb8be9[_0x7dc9('0x6b')],_0x7dc9('0x6c'))){if(_[_0x7dc9('0x37')](this[_0x7dc9('0xb')][_0xb8be9['uniqueid']]))this[_0x7dc9('0xb')][_0xb8be9[_0x7dc9('0x19')]]={};logger['info'](_0x7dc9('0x6d'),_0xb8be9[_0x7dc9('0x19')],_0xb8be9[_0x7dc9('0x68')],_0xb8be9[_0x7dc9('0x6b')]);var _0x5bc1c3=_0xb8be9[_0x7dc9('0x6b')][_0x7dc9('0x6e')]('=');var _0x4bc69b=_0x5bc1c3[0x0]['match'](/cdr\((.*)\)/);if(_0x4bc69b)this[_0x7dc9('0xb')][_0xb8be9[_0x7dc9('0x19')]][_0x4bc69b[0x1]]=_0x5bc1c3[0x1];}}}}catch(_0x49d7ef){logger[_0x7dc9('0x65')]('[%s][voiceDialReport][newexten]',_0xb8be9[_0x7dc9('0x19')],util[_0x7dc9('0x1a')](_0x49d7ef,{'showHidden':![],'depth':null}));}};module[_0x7dc9('0x6f')]=VoiceDialReport;
\ No newline at end of file
+var _0x2eb2=['rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','syncHangup','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','starttime','seconds','lastevent','complete','total','answered','holdtime','billableseconds','sumHoldTime','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][newexten]\x20event:','toLowerCase','set','applicationdata','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','application','split','match','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','dialbegin','syncDialBegin','dialend','varset','bind','hangup','prototype','isNotNull','isUndefined','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','substring','channel','lastIndexOf','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','merge','emit','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','inspect','custom:dialbegin','error','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','syncVarSet','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','outboundrouteid','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged'];(function(_0x3a4906,_0xcce339){var _0x1c099d=function(_0x53d0a4){while(--_0x53d0a4){_0x3a4906['push'](_0x3a4906['shift']());}};_0x1c099d(++_0xcce339);}(_0x2eb2,0x19f));var _0x22eb=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x2eb2[_0x4709c0];return _0x13348b;};'use strict';var _=require('lodash');var moment=require(_0x22eb('0x0'));var util=require(_0x22eb('0x1'));var Redis=require(_0x22eb('0x2'));var config=require(_0x22eb('0x3'));var logger=require(_0x22eb('0x4'))(_0x22eb('0x5'));var ami=require('../ami');config[_0x22eb('0x6')]=_['defaults'](config['redis'],{'host':_0x22eb('0x7'),'port':0x18eb});var io=require(_0x22eb('0x8'))(new Redis(config[_0x22eb('0x6')]));function VoiceDialReport(_0x2a9850){this[_0x22eb('0x9')]=_0x2a9850[_0x22eb('0xa')];this[_0x22eb('0xb')]=_0x2a9850[_0x22eb('0xb')];this[_0x22eb('0xc')]={};this[_0x22eb('0xd')]={};ami['on'](_0x22eb('0xe'),this[_0x22eb('0xf')]['bind'](this));ami['on'](_0x22eb('0x10'),this['syncDialEnd']['bind'](this));ami['on'](_0x22eb('0x11'),this['syncVarSet'][_0x22eb('0x12')](this));ami['on'](_0x22eb('0x13'),this['syncHangup']['bind'](this));}VoiceDialReport[_0x22eb('0x14')][_0x22eb('0x15')]=function(_0x128d43){return _0x128d43!==null&&!_[_0x22eb('0x16')](_0x128d43);};VoiceDialReport[_0x22eb('0x14')]['emit']=function(_0x350ade,_0x53f14e,_0x1f5089){io['to'](_0x350ade)['emit'](_0x53f14e,_0x1f5089);};VoiceDialReport[_0x22eb('0x14')][_0x22eb('0xf')]=function(_0x53abbf){try{if(this['isNotNull'](_0x53abbf)){logger['debug'](_0x22eb('0x17'),_0x53abbf['uniqueid'],util['inspect'](_0x53abbf,{'showHidden':![],'depth':null}));if(this[_0x22eb('0x9')][_0x53abbf['uniqueid']]){_['merge'](this[_0x22eb('0x9')][_0x53abbf[_0x22eb('0x18')]],{'starttime':moment()[_0x22eb('0x19')](_0x22eb('0x1a')),'lastevent':_0x22eb('0x1b'),'interface':_0x53abbf['channel'][_0x22eb('0x1c')](0x0,_0x53abbf[_0x22eb('0x1d')][_0x22eb('0x1e')]('-')),'membername':_0x53abbf[_0x22eb('0x1d')][_0x22eb('0x1c')](_0x53abbf['channel'][_0x22eb('0x1e')]('/')+0x1,_0x53abbf[_0x22eb('0x1d')][_0x22eb('0x1e')]('-'))},_['omit'](_0x53abbf,['event',_0x22eb('0x1f')]));logger[_0x22eb('0x20')](_0x22eb('0x21'),_0x53abbf[_0x22eb('0x18')],this[_0x22eb('0x9')][_0x53abbf[_0x22eb('0x18')]][_0x22eb('0x22')],this['channels'][_0x53abbf[_0x22eb('0x18')]][_0x22eb('0x23')]);logger[_0x22eb('0x24')](_0x22eb('0x25'),_0x53abbf[_0x22eb('0x18')],util['inspect'](this[_0x22eb('0x9')][_0x53abbf[_0x22eb('0x18')]],{'showHidden':![],'depth':null}));if(this[_0x22eb('0xc')][_0x53abbf['uniqueid']])_[_0x22eb('0x26')](this[_0x22eb('0x9')][_0x53abbf['uniqueid']],this[_0x22eb('0xc')][_0x53abbf[_0x22eb('0x18')]]);this[_0x22eb('0x27')](_0x22eb('0x28'),_0x22eb('0x29'),this['channels'][_0x53abbf['uniqueid']]);logger[_0x22eb('0x24')](_0x22eb('0x2a'),_0x53abbf[_0x22eb('0x18')],util[_0x22eb('0x2b')](this[_0x22eb('0x9')][_0x53abbf[_0x22eb('0x18')]],{'showHidden':![],'depth':null}));ami[_0x22eb('0x27')](_0x22eb('0x2c'),this[_0x22eb('0x9')][_0x53abbf[_0x22eb('0x18')]]);}}}catch(_0x24e9dc){logger[_0x22eb('0x2d')]('[%s][voiceDialReport][dialbegin]',_0x53abbf[_0x22eb('0x18')],util['inspect'](_0x24e9dc,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x22eb('0x14')][_0x22eb('0x2e')]=function(_0xd564a9){try{if(this[_0x22eb('0x15')](_0xd564a9)){logger[_0x22eb('0x24')](_0x22eb('0x2f'),_0xd564a9[_0x22eb('0x18')],util[_0x22eb('0x2b')](_0xd564a9,{'showHidden':![],'depth':null}));if(this[_0x22eb('0x9')][_0xd564a9[_0x22eb('0x18')]]){this['channels'][_0xd564a9['uniqueid']][_0x22eb('0x30')]=_0xd564a9['dialstatus'];if(_0xd564a9['dialstatus']===_0x22eb('0x31')){this[_0x22eb('0x9')][_0xd564a9[_0x22eb('0x18')]][_0x22eb('0x32')]=_0xd564a9[_0x22eb('0x32')];this[_0x22eb('0x9')][_0xd564a9[_0x22eb('0x18')]][_0x22eb('0x33')]=_0xd564a9[_0x22eb('0x33')];this[_0x22eb('0x9')][_0xd564a9['uniqueid']][_0x22eb('0x34')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x22eb('0x9')][_0xd564a9[_0x22eb('0x18')]]['lastevent']=_0x22eb('0x35');logger[_0x22eb('0x20')](_0x22eb('0x36'),_0xd564a9[_0x22eb('0x18')],_0xd564a9[_0x22eb('0x1d')]['substring'](_0xd564a9[_0x22eb('0x1d')][_0x22eb('0x1e')]('/')+0x1,_0xd564a9['channel'][_0x22eb('0x1e')]('-')));logger[_0x22eb('0x24')](_0x22eb('0x37'),_0xd564a9[_0x22eb('0x18')],util[_0x22eb('0x2b')](this['channels'][_0xd564a9['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x22eb('0x27')](_0x22eb('0x38'),this['channels'][_0xd564a9[_0x22eb('0x18')]]);}logger[_0x22eb('0x24')](_0x22eb('0x39'),_0xd564a9['uniqueid'],util[_0x22eb('0x2b')](this[_0x22eb('0x9')][_0xd564a9[_0x22eb('0x18')]],{'showHidden':![],'depth':null}));this[_0x22eb('0x27')](_0x22eb('0x28'),_0x22eb('0x29'),this['channels'][_0xd564a9[_0x22eb('0x18')]]);}}}catch(_0x3d2d1d){logger['error'](_0x22eb('0x3a'),_0xd564a9[_0x22eb('0x18')],util[_0x22eb('0x2b')](_0x3d2d1d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x22eb('0x14')][_0x22eb('0x3b')]=function(_0x3e8974){try{if(this[_0x22eb('0x15')](_0x3e8974)){logger[_0x22eb('0x24')](_0x22eb('0x3c'),_0x3e8974[_0x22eb('0x18')],util[_0x22eb('0x2b')](_0x3e8974,{'showHidden':![],'depth':null}));this[_0x22eb('0x3d')](_0x3e8974[_0x22eb('0x18')],_[_0x22eb('0x3e')](_0x3e8974[_0x22eb('0x3f')])[0x0],_0x3e8974[_0x22eb('0x40')]);if(this[_0x22eb('0x15')](_0x3e8974[_0x22eb('0x3f')])&&this['isNotNull'](_0x3e8974[_0x22eb('0x3f')][_0x22eb('0x41')])){if(_['isUndefined'](this[_0x22eb('0x9')][_0x3e8974[_0x22eb('0x18')]])){this['channels'][_0x3e8974['uniqueid']]={'routeId':_0x3e8974['value'],'variables':this[_0x22eb('0xd')][_0x3e8974[_0x22eb('0x18')]],'motionChannel':'voice'};logger['info'](_0x22eb('0x42'),_0x3e8974[_0x22eb('0x18')],_0x3e8974[_0x22eb('0x3f')][_0x22eb('0x41')],_[_0x22eb('0x3e')](_0x3e8974[_0x22eb('0x3f')])[0x0],_0x3e8974[_0x22eb('0x40')]);logger[_0x22eb('0x24')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x3e8974['uniqueid'],util[_0x22eb('0x2b')](this['channels'][_0x3e8974[_0x22eb('0x18')]],{'showHidden':![],'depth':null}));this['emit'](_0x22eb('0x28'),'voice_outbound_channel:save',this['channels'][_0x3e8974['uniqueid']]);}}}}catch(_0x517784){logger[_0x22eb('0x2d')]('[%s][voiceDialReport][varset]',_0x3e8974[_0x22eb('0x18')],util[_0x22eb('0x2b')](_0x517784,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x22eb('0x3d')]=function(_0x5df756,_0x109fc7,_0x9c490b){var _0x1df219=[_0x22eb('0x43'),_0x22eb('0x44'),_0x22eb('0x45'),_0x22eb('0x46'),_0x22eb('0x47'),_0x22eb('0x48'),'rtpaudioqosrtt',_0x22eb('0x49'),_0x22eb('0x4a'),'sipuri',_0x22eb('0x4b'),_0x22eb('0x4c'),_0x22eb('0x4d'),_0x22eb('0x4e'),'memberinterface',_0x22eb('0x4f'),_0x22eb('0x22'),_0x22eb('0x50'),_0x22eb('0x51')];if(!_[_0x22eb('0x52')](_0x109fc7)&&!_[_0x22eb('0x53')](_0x1df219,_0x109fc7)){if(_['isUndefined'](this[_0x22eb('0xd')][_0x5df756])){this['variables'][_0x5df756]={};}this[_0x22eb('0xd')][_0x5df756][_0x109fc7]=_0x9c490b;}};VoiceDialReport['prototype'][_0x22eb('0x54')]=function(_0x254b53){try{if(this[_0x22eb('0x15')](_0x254b53)){logger[_0x22eb('0x24')](_0x22eb('0x55'),_0x254b53['uniqueid'],util['inspect'](_0x254b53,{'showHidden':![],'depth':null}));if(this[_0x22eb('0x9')][_0x254b53[_0x22eb('0x18')]]){logger['info'](_0x22eb('0x56'),_0x254b53[_0x22eb('0x18')],_0x254b53[_0x22eb('0x57')]);this[_0x22eb('0x9')][_0x254b53[_0x22eb('0x18')]][_0x22eb('0x58')]=moment()[_0x22eb('0x19')](_0x22eb('0x1a'));this[_0x22eb('0x9')][_0x254b53[_0x22eb('0x18')]][_0x22eb('0x59')]=moment(this['channels'][_0x254b53[_0x22eb('0x18')]][_0x22eb('0x58')])[_0x22eb('0x5a')](this[_0x22eb('0x9')][_0x254b53[_0x22eb('0x18')]][_0x22eb('0x5b')],_0x22eb('0x5c'));this[_0x22eb('0x9')][_0x254b53[_0x22eb('0x18')]][_0x22eb('0x5d')]=_0x22eb('0x5e');this[_0x22eb('0xb')][_0x22eb('0x5f')]+=0x1;if(this[_0x22eb('0x9')][_0x254b53['uniqueid']]['answertime']){this[_0x22eb('0xb')][_0x22eb('0x60')]+=0x1;this[_0x22eb('0x9')][_0x254b53[_0x22eb('0x18')]][_0x22eb('0x61')]=moment(this['channels'][_0x254b53[_0x22eb('0x18')]][_0x22eb('0x34')])['diff'](this['channels'][_0x254b53[_0x22eb('0x18')]][_0x22eb('0x5b')],_0x22eb('0x5c'));this[_0x22eb('0x9')][_0x254b53[_0x22eb('0x18')]][_0x22eb('0x62')]=moment(this[_0x22eb('0x9')][_0x254b53[_0x22eb('0x18')]][_0x22eb('0x58')])[_0x22eb('0x5a')](this[_0x22eb('0x9')][_0x254b53[_0x22eb('0x18')]][_0x22eb('0x34')],_0x22eb('0x5c'));this['outbound'][_0x22eb('0x63')]+=this[_0x22eb('0x9')][_0x254b53[_0x22eb('0x18')]]['holdtime']||0x0;this[_0x22eb('0xb')]['sumBillable']+=this[_0x22eb('0x9')][_0x254b53['uniqueid']][_0x22eb('0x62')];}this[_0x22eb('0xb')]['sumDuration']+=this[_0x22eb('0x9')][_0x254b53[_0x22eb('0x18')]]['duration'];logger['debug'](_0x22eb('0x64'),_0x254b53[_0x22eb('0x18')],util[_0x22eb('0x2b')](this[_0x22eb('0x9')][_0x254b53[_0x22eb('0x18')]],{'showHidden':![],'depth':null}));ami[_0x22eb('0x27')]('custom:voiceDialReport',this[_0x22eb('0x9')][_0x254b53['uniqueid']]);logger['debug'](_0x22eb('0x65'),_0x254b53[_0x22eb('0x18')],util[_0x22eb('0x2b')](this[_0x22eb('0x9')][_0x254b53[_0x22eb('0x18')]],{'showHidden':![],'depth':null}));ami[_0x22eb('0x27')](_0x22eb('0x66'),this[_0x22eb('0x9')][_0x254b53['uniqueid']]);logger['debug'](_0x22eb('0x67'),_0x254b53[_0x22eb('0x18')],util['inspect'](this[_0x22eb('0x9')][_0x254b53[_0x22eb('0x18')]],{'showHidden':![],'depth':null}));this[_0x22eb('0x27')](_0x22eb('0x28'),_0x22eb('0x68'),this[_0x22eb('0xb')]);logger['info'](_0x22eb('0x69'),JSON[_0x22eb('0x6a')](this[_0x22eb('0x9')][_0x254b53['uniqueid']]));logger['debug'](_0x22eb('0x6b'),_0x254b53[_0x22eb('0x18')],util[_0x22eb('0x2b')](this['channels'][_0x254b53[_0x22eb('0x18')]],{'showHidden':![],'depth':null}));this['emit'](_0x22eb('0x28'),_0x22eb('0x6c'),this[_0x22eb('0x9')][_0x254b53[_0x22eb('0x18')]]);delete this['channels'][_0x254b53[_0x22eb('0x18')]];}else if(this[_0x22eb('0x9')][_0x254b53[_0x22eb('0x6d')]]){this[_0x22eb('0x9')][_0x254b53[_0x22eb('0x6d')]][_0x22eb('0x18')]=this[_0x22eb('0x9')][_0x254b53[_0x22eb('0x6d')]][_0x22eb('0x6e')];}if(this[_0x22eb('0xd')][_0x254b53[_0x22eb('0x18')]]){delete this['variables'][_0x254b53[_0x22eb('0x18')]];}}}catch(_0x3d8abf){logger['error']('[%s][voiceDialReport][hangup]',_0x254b53['uniqueid'],util[_0x22eb('0x2b')](_0x3d8abf,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x22eb('0x14')]['syncNewExten']=function(_0x10726f){try{if(this[_0x22eb('0x15')](_0x10726f)){logger[_0x22eb('0x24')](_0x22eb('0x6f'),_0x10726f[_0x22eb('0x18')],util['inspect'](_0x10726f,{'showHidden':![],'depth':null}));if(_0x10726f['application'][_0x22eb('0x70')]()===_0x22eb('0x71')){_0x10726f[_0x22eb('0x72')]=(_0x10726f['appdata']||_0x10726f['applicationdata'])[_0x22eb('0x70')]();if(_['startsWith'](_0x10726f['applicationdata'],_0x22eb('0x73'))){if(_[_0x22eb('0x16')](this['applications'][_0x10726f['uniqueid']]))this[_0x22eb('0xc')][_0x10726f[_0x22eb('0x18')]]={};logger['info'](_0x22eb('0x74'),_0x10726f[_0x22eb('0x18')],_0x10726f[_0x22eb('0x75')],_0x10726f['applicationdata']);var _0x464f4f=_0x10726f[_0x22eb('0x72')][_0x22eb('0x76')]('=');var _0x2a0c73=_0x464f4f[0x0][_0x22eb('0x77')](/cdr\((.*)\)/);if(_0x2a0c73)this['applications'][_0x10726f[_0x22eb('0x18')]][_0x2a0c73[0x1]]=_0x464f4f[0x1];}}}}catch(_0x2ecc24){logger[_0x22eb('0x2d')]('[%s][voiceDialReport][newexten]',_0x10726f['uniqueid'],util[_0x22eb('0x2b')](_0x2ecc24,{'showHidden':![],'depth':null}));}};module[_0x22eb('0x78')]=VoiceDialReport;
\ No newline at end of file
index 0f3293a..f26a83e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63a2=['[FullyBooted]\x20clear\x20realtime','voiceQueues','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','voice_queue_channel:save','voice_queue_presence:save','debug',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','loggedIn','sumBillable','sumDuration','abandoned','waiting','Trunk','name','callerid','Interval',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','clearZombieChannels','Action','queues','[voiceQueueReport][queues]','queuesummary','then','[voiceQueueReport][queuesummary]\x20event:','queue','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','toNumber','available','callers','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','keys','push','syncQueueCallerAbandon','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','connectedlinenum','connectedlinename','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','toLowerCase','linkedid','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','syncVarSet','[%s][voiceQueueReport][varset]','variable','value','CONTINUE','TIMEOUT','lastevent','timeout','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','handleHangup','length','sumHoldTime','diff','seconds','milliseconds','total','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','[%s][voiceQueueReport][hangup]','cause','cause-txt','transferid','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','startsWith','CDR(routeAlias)','cdr(','match','[%s][voiceQueueReport][newexten]','exports','lodash','util','md5','ioredis','../../../config/environment','../../../config/logger','redis','localhost','enqueue','tail','finally','sequence','agents','channels','flagQueueSummary','campaigns','variables','syncQueueSummary','bind','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','hangup','syncHangup','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','queueStatusComplete','unlockRR','prototype','isNil','status','channel','catch','message','error','inspect','queueReports','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]'];(function(_0x40c630,_0x35863d){var _0x5579f6=function(_0x1cc616){while(--_0x1cc616){_0x40c630['push'](_0x40c630['shift']());}};_0x5579f6(++_0x35863d);}(_0x63a2,0x1aa));var _0x263a=function(_0x435b2a,_0x190d6d){_0x435b2a=_0x435b2a-0x0;var _0x116d5f=_0x63a2[_0x435b2a];return _0x116d5f;};'use strict';var _=require(_0x263a('0x0'));var moment=require('moment');var util=require(_0x263a('0x1'));var md5=require(_0x263a('0x2'));var Redis=require(_0x263a('0x3'));var config=require(_0x263a('0x4'));var logger=require(_0x263a('0x5'))('ami');var ami=require('../ami');var QueueReport=require('../model/queueReport');config[_0x263a('0x6')]=_['defaults'](config['redis'],{'host':_0x263a('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0x263a('0x8')]=function(_0x2df602){this[_0x263a('0x9')]=this[_0x263a('0x9')]?this[_0x263a('0x9')][_0x263a('0xa')](_0x2df602):_0x2df602();};function VoiceQueueReport(_0x579e10){this[_0x263a('0xb')]=new Sequence();this['queueReports']={};this[_0x263a('0xc')]=_0x579e10[_0x263a('0xc')];this[_0x263a('0xd')]=_0x579e10['queueChannels'];this['voiceQueues']=_0x579e10['voiceQueues'];this[_0x263a('0xe')]=!![];this[_0x263a('0xf')]=_0x579e10[_0x263a('0xf')];this[_0x263a('0x10')]={};ami['on']('queuesummary',this[_0x263a('0x11')][_0x263a('0x12')](this));ami['on']('queuesummarycomplete',this[_0x263a('0x13')][_0x263a('0x12')](this));ami['on'](_0x263a('0x14'),this[_0x263a('0x15')]['bind'](this));ami['on'](_0x263a('0x16'),this['syncQueueCallerAbandon'][_0x263a('0x12')](this));ami['on'](_0x263a('0x17'),this[_0x263a('0x18')]['bind'](this));ami['on'](_0x263a('0x19'),this[_0x263a('0x1a')][_0x263a('0x12')](this));ami['on'](_0x263a('0x1b'),this[_0x263a('0x1c')][_0x263a('0x12')](this));ami['on'](_0x263a('0x1d'),this['syncVarSet']['bind'](this));ami['on'](_0x263a('0x1e'),this[_0x263a('0x1f')][_0x263a('0x12')](this));ami['on']('fullybooted',this[_0x263a('0x20')]['bind'](this));ami['on'](_0x263a('0x21'),this[_0x263a('0x22')][_0x263a('0x12')](this));ami['on'](_0x263a('0x23'),this[_0x263a('0x24')][_0x263a('0x12')](this));ami['on'](_0x263a('0x25'),this[_0x263a('0x26')][_0x263a('0x12')](this));ami['on'](_0x263a('0x27'),this['syncBlindTransfer'][_0x263a('0x12')](this));this[_0x263a('0x28')]();this[_0x263a('0x29')]();}function clearChannels(_0x4629da){if(!_[_0x263a('0x2a')](_0x4629da)){for(var _0x201d9a in _0x4629da){if(_0x4629da[_0x263a('0x2b')](_0x201d9a)){delete _0x4629da[_0x201d9a];}}}}function clearCampaigns(_0x36236d){if(!_[_0x263a('0x2a')](_0x36236d)){for(var _0x2ac874 in _0x36236d){if(_0x36236d[_0x263a('0x2b')](_0x2ac874)){_0x36236d[_0x2ac874]['originated']=0x0;}}}}function clearVoiceQueues(_0x522f87){if(!_[_0x263a('0x2a')](_0x522f87)){for(var _0x2ef204 in _0x522f87){if(_0x522f87[_0x263a('0x2b')](_0x2ef204)){_0x522f87[_0x2ef204][_0x263a('0x2c')]=0x0;_0x522f87[_0x2ef204][_0x263a('0x2d')]=0x0;_0x522f87[_0x2ef204][_0x263a('0x2e')]=0x0;_0x522f87[_0x2ef204]['waiting']=0x0;_0x522f87[_0x2ef204][_0x263a('0x2f')]=!![];}}}}function clearAgentBooked(_0x92668a){if(!_[_0x263a('0x2a')](_0x92668a)){for(var _0x3aa18c in _0x92668a){if(_0x92668a[_0x263a('0x2b')](_0x3aa18c)){_0x92668a[_0x3aa18c][_0x263a('0x30')]=!![];}}}}VoiceQueueReport[_0x263a('0x31')]['clearZombieChannels']=function(){var _0x213142=this;for(var _0x4f529c in this[_0x263a('0xd')]){if(this[_0x263a('0xd')][_0x263a('0x2b')](_0x4f529c)&&!this[_0x263a('0xd')][_0x4f529c]['switch']){this[_0x263a('0xb')][_0x263a('0x8')](function(){if(!_[_0x263a('0x32')](_0x213142['channels'][_0x4f529c])){return ami['Action']({'action':_0x263a('0x33'),'channel':_0x213142[_0x263a('0xd')][_0x4f529c][_0x263a('0x34')]})[_0x263a('0x35')](function(_0x1e24c9){if(_0x1e24c9[_0x263a('0x36')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x213142[_0x263a('0xd')][_0x4f529c]){delete _0x213142['channels'][_0x4f529c];logger[_0x263a('0x37')]('[%s][voiceQueueReport][checkChannel]',_0x4f529c,util[_0x263a('0x38')](_0x1e24c9,{'showHidden':![],'depth':null}));}if(_0x213142[_0x263a('0x39')][_0x4f529c]){delete _0x213142['queueReports'][_0x4f529c];logger[_0x263a('0x37')](_0x263a('0x3a'),_0x4f529c,util['inspect'](_0x1e24c9,{'showHidden':![],'depth':null}));}if(_0x213142[_0x263a('0x10')][_0x4f529c]){delete _0x213142['variables'][_0x4f529c];logger[_0x263a('0x37')](_0x263a('0x3b'),_0x4f529c,util['inspect'](_0x1e24c9,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x263a('0x31')][_0x263a('0x20')]=function(){logger[_0x263a('0x37')](_0x263a('0x3c'));clearChannels(this[_0x263a('0xd')]);this['clearQueueReport'](this[_0x263a('0x39')]);clearAgentBooked(this[_0x263a('0xc')]);clearVoiceQueues(this[_0x263a('0x3d')]);clearCampaigns(this[_0x263a('0xf')]);};VoiceQueueReport[_0x263a('0x31')][_0x263a('0x3e')]=function(_0x57c35c){var _0x5acbaa=this;if(!_[_0x263a('0x2a')](_0x57c35c)){for(var _0x3dc25e in _0x57c35c){if(_0x57c35c[_0x263a('0x2b')](_0x3dc25e)){_0x5acbaa[_0x263a('0x3f')](_0x57c35c[_0x3dc25e],_0x263a('0x40'));delete _0x57c35c[_0x3dc25e];}}}};VoiceQueueReport['prototype'][_0x263a('0x41')]=function(_0x446092,_0x1069a2,_0x285a23){io['to'](_0x446092)[_0x263a('0x41')](_0x1069a2,_0x285a23);};VoiceQueueReport[_0x263a('0x31')][_0x263a('0x42')]=function(_0x3f9d3d,_0x167bf8){logger['debug'](_0x263a('0x43')+_0x167bf8+_0x263a('0x44'),_0x3f9d3d[_0x263a('0x45')],util[_0x263a('0x38')](_0x3f9d3d,{'showHidden':![],'depth':null}));this['emit'](util[_0x263a('0x46')](_0x263a('0x47'),_0x3f9d3d['name']),_0x263a('0x48'),_0x3f9d3d);io['emit'](_0x263a('0x49'),_0x3f9d3d);};VoiceQueueReport[_0x263a('0x31')][_0x263a('0x3f')]=function(_0x6f8eb7,_0x5e3e55){logger[_0x263a('0x4a')](_0x263a('0x43')+_0x5e3e55+_0x263a('0x4b'),_0x6f8eb7[_0x263a('0x45')],util[_0x263a('0x38')](_0x6f8eb7,{'showHidden':![],'depth':null}));if(_0x6f8eb7[_0x263a('0x4c')]===_0x263a('0x4d'))return;this['emit'](util[_0x263a('0x46')](_0x263a('0x47'),_0x6f8eb7['name']),_0x263a('0x4e'),_0x6f8eb7);io[_0x263a('0x41')](_0x263a('0x4f'),_0x6f8eb7);};VoiceQueueReport[_0x263a('0x31')][_0x263a('0x50')]=function(_0x2802d8,_0x4e29b1){if(_0x2802d8[_0x263a('0x51')]===_0x263a('0x52')){var _0x1bd6d9={'id':_0x2802d8['id'],'name':_0x2802d8['name'],'strategy':_0x2802d8[_0x263a('0x53')],'answered':_0x2802d8[_0x263a('0x54')],'available':_0x2802d8['available'],'loggedIn':_0x2802d8[_0x263a('0x55')],'pTalking':_0x2802d8[_0x263a('0x2e')],'sumBillable':_0x2802d8[_0x263a('0x56')],'sumDuration':_0x2802d8[_0x263a('0x57')],'sumHoldTime':_0x2802d8['sumHoldTime']||0x0,'talking':_0x2802d8[_0x263a('0x2d')],'total':_0x2802d8['total'],'type':_0x2802d8[_0x263a('0x51')],'unmanaged':_0x2802d8['unmanaged'],'abandoned':_0x2802d8[_0x263a('0x58')],'waiting':_0x2802d8[_0x263a('0x59')]};if(_0x2802d8[_0x263a('0x5a')]){_0x1bd6d9[_0x263a('0x5a')]={'id':_0x2802d8[_0x263a('0x5a')]['id'],'name':_0x2802d8['Trunk'][_0x263a('0x5b')],'active':_0x2802d8[_0x263a('0x5a')]['active'],'callerid':_0x2802d8[_0x263a('0x5a')][_0x263a('0x5c')]};}if(_0x2802d8['Interval']){_0x1bd6d9['Interval']={'id':_0x2802d8['Interval']['id'],'name':_0x2802d8[_0x263a('0x5d')][_0x263a('0x5b')]};}var _0x321ec1=md5(JSON['stringify'](_0x1bd6d9));if(_0x2802d8['md5']!==_0x321ec1){_0x2802d8[_0x263a('0x2')]=_0x321ec1;logger[_0x263a('0x4a')]('[voiceQueueReport]['+_0x4e29b1+_0x263a('0x5e'),util[_0x263a('0x38')](_0x1bd6d9,{'showHidden':![],'depth':null}));this[_0x263a('0x41')](util[_0x263a('0x46')](_0x263a('0x47'),_0x1bd6d9[_0x263a('0x5b')]),_0x263a('0x5f'),_0x1bd6d9);}}};VoiceQueueReport[_0x263a('0x31')][_0x263a('0x60')]=function(_0x442554){return _0x442554!==null&&!_['isUndefined'](_0x442554);};VoiceQueueReport['prototype'][_0x263a('0x29')]=function(){var _0x21afd7=this;setInterval(function(){_0x21afd7[_0x263a('0x61')]();ami[_0x263a('0x62')]({'action':_0x263a('0x63')})[_0x263a('0x35')](function(_0x1770bb){logger[_0x263a('0x37')](_0x263a('0x64'),util['inspect'](_0x1770bb,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype'][_0x263a('0x28')]=function(){var _0x1ecd9e=this;setInterval(function(){if(_0x1ecd9e[_0x263a('0xe')]){return ami['Action']({'action':_0x263a('0x65')})[_0x263a('0x66')](function(){_0x1ecd9e['flagQueueSummary']=![];})['catch'](function(_0x5d5f8e){logger['error']('[voiceQueueReport][queuesummary]',util[_0x263a('0x38')](_0x5d5f8e,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0x263a('0x11')]=function(_0x27d3aa){try{if(this[_0x263a('0x60')](_0x27d3aa)&&this[_0x263a('0x60')](_0x27d3aa['queue'])){logger[_0x263a('0x4a')](_0x263a('0x67'),util[_0x263a('0x38')](_0x27d3aa,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x27d3aa[_0x263a('0x68')]]){logger[_0x263a('0x69')](_0x263a('0x6a'),_0x27d3aa[_0x263a('0x68')]);var _0x1e37fa=_[_0x263a('0x6b')](this[_0x263a('0xd')],'queue')[_0x27d3aa[_0x263a('0x68')]]||0x0;var _0x47b75a=_0x1e37fa-_0x27d3aa['callers'];if(this[_0x263a('0x3d')][_0x27d3aa[_0x263a('0x68')]][_0x263a('0x59')]!==_[_0x263a('0x6c')](_0x27d3aa['callers'])||this[_0x263a('0x3d')][_0x27d3aa[_0x263a('0x68')]][_0x263a('0x55')]!==_[_0x263a('0x6c')](_0x27d3aa['loggedin'])||this[_0x263a('0x3d')][_0x27d3aa[_0x263a('0x68')]][_0x263a('0x6d')]!==_['toNumber'](_0x27d3aa[_0x263a('0x6d')])||this[_0x263a('0x3d')][_0x27d3aa[_0x263a('0x68')]][_0x263a('0x2d')]!==_0x47b75a){this['voiceQueues'][_0x27d3aa['queue']]['waiting']=_[_0x263a('0x6c')](_0x27d3aa[_0x263a('0x6e')]);this[_0x263a('0x3d')][_0x27d3aa[_0x263a('0x68')]]['loggedIn']=_['toNumber'](_0x27d3aa[_0x263a('0x6f')]);this[_0x263a('0x3d')][_0x27d3aa['queue']][_0x263a('0x6d')]=_[_0x263a('0x6c')](_0x27d3aa[_0x263a('0x6d')]);this[_0x263a('0x3d')][_0x27d3aa['queue']]['talking']=_0x47b75a>0x0?_0x47b75a:0x0;this['voiceQueues'][_0x27d3aa[_0x263a('0x68')]][_0x263a('0x2d')]=this[_0x263a('0x3d')][_0x27d3aa[_0x263a('0x68')]][_0x263a('0x2d')]>_[_0x263a('0x6c')](_0x27d3aa[_0x263a('0x6f')])?_[_0x263a('0x6c')](_0x27d3aa[_0x263a('0x6f')]):this[_0x263a('0x3d')][_0x27d3aa[_0x263a('0x68')]]['talking'];this[_0x263a('0x50')](this[_0x263a('0x3d')][_0x27d3aa['queue']],_0x263a('0x65'));}logger[_0x263a('0x4a')](_0x263a('0x70'),util['inspect'](this[_0x263a('0x3d')][_0x27d3aa[_0x263a('0x68')]],{'showHidden':![],'depth':null}));ami['emit'](_0x263a('0x71'),this[_0x263a('0x3d')][_0x27d3aa[_0x263a('0x68')]]);}}}catch(_0x665789){logger[_0x263a('0x37')](_0x263a('0x72'),util['inspect'](_0x665789,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x263a('0x31')][_0x263a('0x13')]=function(_0xd74e4f){logger[_0x263a('0x4a')](_0x263a('0x73'),util['inspect'](_0xd74e4f,{'showHidden':![],'depth':null}));ami[_0x263a('0x41')](_0x263a('0x74'),{});this[_0x263a('0xe')]=!![];};VoiceQueueReport[_0x263a('0x31')]['syncQueueCallerJoin']=function(_0x40b227){try{if(this[_0x263a('0x60')](_0x40b227)){logger[_0x263a('0x4a')](_0x263a('0x75'),_0x40b227[_0x263a('0x45')],util[_0x263a('0x38')](_0x40b227,{'showHidden':![],'depth':null}));if(_[_0x263a('0x76')](this['queueReports'][_0x40b227['uniqueid']]))this['queueReports'][_0x40b227[_0x263a('0x45')]]=[];if(_[_0x263a('0x76')](this[_0x263a('0xd')][_0x40b227[_0x263a('0x45')]]))this[_0x263a('0xd')][_0x40b227[_0x263a('0x45')]]={};var _0x13248b=new QueueReport();_0x13248b[_0x263a('0x5b')]=_0x40b227['queue'];_0x13248b[_0x263a('0x51')]=this['voiceQueues'][_0x13248b[_0x263a('0x5b')]]&&this[_0x263a('0x3d')][_0x13248b['name']][_0x263a('0x51')]?this[_0x263a('0x3d')][_0x13248b[_0x263a('0x5b')]][_0x263a('0x51')]||_0x263a('0x52'):_0x263a('0x52');_0x13248b[_0x263a('0x68')]=_0x40b227[_0x263a('0x68')];_0x13248b[_0x263a('0x77')]=moment()[_0x263a('0x46')](_0x263a('0x78'));_0x13248b[_0x263a('0x79')]=_0x40b227['position'];_0x13248b[_0x263a('0x7a')]=_0x40b227['count'];_0x13248b['uniqueid']=_0x40b227[_0x263a('0x45')];_0x13248b[_0x263a('0x7b')]=this[_0x263a('0xd')][_0x40b227[_0x263a('0x45')]][_0x263a('0x7b')];logger['info'](_0x263a('0x7c'),_0x13248b[_0x263a('0x5b')],_0x13248b[_0x263a('0x51')]);_['merge'](_0x13248b,_[_0x263a('0x7d')](_0x40b227,_[_0x263a('0x7e')](_0x13248b)));this[_0x263a('0x39')][_0x40b227['uniqueid']][_0x263a('0x7f')](_0x13248b);this[_0x263a('0xd')][_0x40b227[_0x263a('0x45')]]=_0x13248b;this[_0x263a('0x42')](_0x13248b,_0x263a('0x14'));}}catch(_0x173a29){logger[_0x263a('0x37')](_0x263a('0x75'),_0x40b227[_0x263a('0x45')],util[_0x263a('0x38')](_0x173a29,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x263a('0x80')]=function(_0xfdaab3){try{if(this[_0x263a('0x60')](_0xfdaab3)){logger[_0x263a('0x4a')](_0x263a('0x81'),_0xfdaab3[_0x263a('0x45')],util[_0x263a('0x38')](_0xfdaab3,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xfdaab3[_0x263a('0x45')]]){var _0x1fde8c=_[_0x263a('0x82')](this[_0x263a('0x39')][_0xfdaab3[_0x263a('0x45')]]);_0x1fde8c[_0x263a('0x83')]=![];_0x1fde8c[_0x263a('0x84')]=null;_0x1fde8c[_0x263a('0x85')]=_0xfdaab3[_0x263a('0x85')];_0x1fde8c['originalposition']=_0xfdaab3[_0x263a('0x86')];_0x1fde8c[_0x263a('0x16')]=!![];_0x1fde8c[_0x263a('0x87')]=moment()[_0x263a('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x1fde8c['queuecallerexitreason']=_0x263a('0x88');_0x1fde8c[_0x263a('0x89')]=null;logger[_0x263a('0x69')](_0x263a('0x8a'),_0x1fde8c[_0x263a('0x5b')],_0x1fde8c[_0x263a('0x51')]);this[_0x263a('0xd')][_0xfdaab3[_0x263a('0x45')]]=_0x1fde8c;this[_0x263a('0x3f')](_0x1fde8c,'queuecallerabandon');}}}catch(_0x8e5d3b){logger[_0x263a('0x37')](_0x263a('0x81'),_0xfdaab3[_0x263a('0x45')],util['inspect'](_0x8e5d3b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x263a('0x31')][_0x263a('0x18')]=function(_0x2dc74a){try{if(this[_0x263a('0x60')](_0x2dc74a)){logger[_0x263a('0x4a')](_0x263a('0x8b'),_0x2dc74a[_0x263a('0x45')],util[_0x263a('0x38')](_0x2dc74a,{'showHidden':![],'depth':null}));if(this[_0x263a('0x39')][_0x2dc74a[_0x263a('0x45')]]){var _0x30fdff=_[_0x263a('0x82')](this['queueReports'][_0x2dc74a['uniqueid']]);_0x30fdff['queuecallerleaveAt']=moment()[_0x263a('0x46')](_0x263a('0x78'));_0x30fdff[_0x263a('0x8c')]=_0x2dc74a[_0x263a('0x8c')];_0x30fdff[_0x263a('0x8d')]=_0x2dc74a[_0x263a('0x8d')];logger[_0x263a('0x69')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x30fdff[_0x263a('0x5b')],_0x30fdff[_0x263a('0x51')],_0x2dc74a['connectedlinenum'],_0x2dc74a[_0x263a('0x8d')]);this[_0x263a('0xd')][_0x2dc74a[_0x263a('0x45')]]=_0x30fdff;this['emitVoiceQueueChannelSave'](_0x30fdff,_0x263a('0x17'));}}}catch(_0x7c2b02){logger['error'](_0x263a('0x8b'),_0x2dc74a[_0x263a('0x45')],util[_0x263a('0x38')](_0x7c2b02,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x263a('0x31')][_0x263a('0x1c')]=function(_0xf1ca28){try{if(this[_0x263a('0x60')](_0xf1ca28)){logger[_0x263a('0x4a')](_0x263a('0x8e'),_0xf1ca28[_0x263a('0x45')],util[_0x263a('0x38')](_0xf1ca28,{'showHidden':![],'depth':null}));if(this[_0x263a('0x39')][_0xf1ca28[_0x263a('0x45')]]){var _0x2558a7=_[_0x263a('0x82')](this[_0x263a('0x39')][_0xf1ca28[_0x263a('0x45')]]);_0x2558a7[_0x263a('0x83')]=!![];_0x2558a7[_0x263a('0x4c')]=_0x263a('0x8f');logger['info'](_0x263a('0x90'),_0x2558a7['name'],_0x2558a7['type']);}}}catch(_0x48c9bf){logger[_0x263a('0x37')](_0x263a('0x8e'),_0xf1ca28[_0x263a('0x45')],util[_0x263a('0x38')](_0x48c9bf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x263a('0x31')][_0x263a('0x1a')]=function(_0x5063d1){try{if(this[_0x263a('0x60')](_0x5063d1)){logger[_0x263a('0x4a')]('[%s][voiceQueueReport][agentcomplete]',_0x5063d1[_0x263a('0x45')],util[_0x263a('0x38')](_0x5063d1,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5063d1[_0x263a('0x45')]]){var _0x5216d1=_[_0x263a('0x82')](this['queueReports'][_0x5063d1[_0x263a('0x45')]]);_0x5216d1[_0x263a('0x16')]=![];_0x5216d1[_0x263a('0x87')]=null;_0x5216d1[_0x263a('0x91')]=!![];_0x5216d1[_0x263a('0x89')]=_0x5063d1[_0x263a('0x92')];_0x5216d1[_0x263a('0x85')]=_0x5063d1[_0x263a('0x85')];_0x5216d1[_0x263a('0x83')]=!![];_0x5216d1[_0x263a('0x93')]=![];_0x5216d1[_0x263a('0x94')]=null;if(!_0x5216d1[_0x263a('0x95')]){if(_0x5063d1[_0x263a('0x96')]==_0x263a('0x95')){_0x5216d1[_0x263a('0x4c')]=_0x263a('0x97');logger[_0x263a('0x69')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x5216d1['name'],_0x5216d1[_0x263a('0x51')]);}else{if(_['startsWith'](_0x5063d1[_0x263a('0x34')][_0x263a('0x98')](),'local/')){if(this['queueReports'][_0x5063d1[_0x263a('0x99')]]){var _0x592fc7=_[_0x263a('0x82')](this[_0x263a('0x39')][_0x5063d1[_0x263a('0x99')]]);_0x592fc7[_0x263a('0x83')]=![];_0x592fc7[_0x263a('0x93')]=!![];_0x592fc7['queuecallerexitAt']=moment(_0x5216d1['queuecallerjoinAt'])['add'](_0x5063d1[_0x263a('0x85')],'seconds')[_0x263a('0x46')](_0x263a('0x78'));_0x592fc7['queuecallerexitreason']=_0x263a('0x9a');_0x592fc7[_0x263a('0x95')]=!![];_0x592fc7[_0x263a('0x9b')]=_0x263a('0x9c');_0x592fc7[_0x263a('0x9d')]=_0x5063d1[_0x263a('0x9e')];_0x592fc7[_0x263a('0x9f')]=_0x5063d1[_0x263a('0x45')];logger[_0x263a('0x69')](_0x263a('0xa0'),_0x592fc7[_0x263a('0x5b')],_0x592fc7[_0x263a('0x51')]);var _0x492bc6=this[_0x263a('0x39')][_0x5063d1[_0x263a('0x99')]];this[_0x263a('0x39')][_0x5063d1[_0x263a('0x99')]]=this[_0x263a('0x39')][_0x5063d1['uniqueid']];this[_0x263a('0x39')][_0x5063d1[_0x263a('0x45')]]=_0x492bc6;}}else{_0x5216d1['queuecallerexitreason']=_0x263a('0xa1')+_0x5063d1[_0x263a('0x96')][_0x263a('0xa2')]();logger[_0x263a('0x69')](_0x263a('0xa3'),_0x5216d1[_0x263a('0x5b')],_0x5216d1['type'],_0x5216d1[_0x263a('0x4c')]);}}}this['channels'][_0x5063d1['uniqueid']]=_0x5216d1;this[_0x263a('0x3f')](_0x5216d1,_0x263a('0x19'));}}}catch(_0x3778a1){logger[_0x263a('0x37')]('[%s][voiceQueueReport][agentcomplete]',_0x5063d1[_0x263a('0x45')],util[_0x263a('0x38')](_0x3778a1,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x263a('0xa4')]=function(_0x5b460e){try{if(this[_0x263a('0x60')](_0x5b460e)){logger[_0x263a('0x4a')](_0x263a('0xa5'),_0x5b460e[_0x263a('0x45')],util[_0x263a('0x38')](_0x5b460e,{'showHidden':![],'depth':null}));this['addVariable'](_0x5b460e[_0x263a('0x45')],_[_0x263a('0x7e')](_0x5b460e[_0x263a('0xa6')])[0x0],_0x5b460e['value']);if(this['queueReports'][_0x5b460e['uniqueid']]){var _0x4a022e=_[_0x263a('0x82')](this[_0x263a('0x39')][_0x5b460e[_0x263a('0x45')]]);if(_0x4a022e){if(this[_0x263a('0x60')](_0x5b460e[_0x263a('0xa6')])&&this[_0x263a('0x60')](_0x5b460e[_0x263a('0xa6')]['queuestatus'])){switch(_0x5b460e[_0x263a('0xa7')]){case _0x263a('0xa8'):_0x4a022e[_0x263a('0x93')]=![];_0x4a022e[_0x263a('0x94')]=null;break;case _0x263a('0xa9'):_0x4a022e[_0x263a('0xaa')]=_0x263a('0xab');_0x4a022e[_0x263a('0x93')]=!![];_0x4a022e[_0x263a('0x94')]=moment()[_0x263a('0x46')](_0x263a('0x78'));_0x4a022e[_0x263a('0xac')]=moment()[_0x263a('0x46')](_0x263a('0x78'));logger[_0x263a('0x4a')](_0x263a('0xad'),_0x5b460e['uniqueid'],util[_0x263a('0x38')](_0x4a022e,{'showHidden':![],'depth':null}));ami['emit'](_0x263a('0xae'),_0x4a022e);break;default:_0x4a022e[_0x263a('0x93')]=!![];_0x4a022e['queuecallerexitAt']=moment()[_0x263a('0x46')](_0x263a('0x78'));_0x4a022e[_0x263a('0xac')]=moment()[_0x263a('0x46')](_0x263a('0x78'));}_0x4a022e['queuecallerabandon']=![];_0x4a022e[_0x263a('0x87')]=null;_0x4a022e[_0x263a('0x4c')]=_0x5b460e[_0x263a('0xa7')];this[_0x263a('0xd')][_0x5b460e['uniqueid']]=_0x4a022e;this['emitVoiceQueueChannelRemove'](_0x4a022e,_0x263a('0x1d'));}else if(this[_0x263a('0x60')](_0x5b460e[_0x263a('0xa6')])&&this['isNotNull'](_0x5b460e['variable'][_0x263a('0xaf')])){if(!_0x4a022e[_0x263a('0x16')]){_0x4a022e[_0x263a('0x93')]=!![];_0x4a022e[_0x263a('0x94')]=moment()[_0x263a('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a022e['queuecallerexitreason']='EXITWITHKEY';_0x4a022e[_0x263a('0xac')]=moment()[_0x263a('0x46')](_0x263a('0x78'));this['channels'][_0x5b460e[_0x263a('0x45')]]=_0x4a022e;}}logger[_0x263a('0x69')](_0x263a('0xb0'),_0x5b460e[_0x263a('0x45')],_0x4a022e[_0x263a('0x5b')],_0x4a022e['type'],_[_0x263a('0x7e')](_0x5b460e['variable'])[0x0],_0x5b460e[_0x263a('0xa7')]);_0x4a022e['variables']=this[_0x263a('0x10')][_0x5b460e[_0x263a('0x45')]];}}}}catch(_0x3f3d72){logger[_0x263a('0x37')](_0x263a('0xa5'),_0x5b460e[_0x263a('0x45')],util['inspect'](_0x3f3d72,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x263a('0x31')][_0x263a('0xb1')]=function(_0x5d0296,_0x34a505,_0x452424){var _0x4e1a46=[_0x263a('0xb2'),_0x263a('0xb3'),_0x263a('0xb4'),_0x263a('0xb5'),_0x263a('0xb6'),_0x263a('0xb7'),_0x263a('0xb8'),'rtpaudioqosrttbridged',_0x263a('0xb9'),_0x263a('0xba'),_0x263a('0xbb'),_0x263a('0xbc'),_0x263a('0xbd'),'memberdynamic',_0x263a('0xbe'),_0x263a('0xbf'),_0x263a('0x92'),_0x263a('0xc0'),'memberrealtime'];if(!_['isNil'](_0x34a505)&&!_['includes'](_0x4e1a46,_0x34a505)){if(_['isUndefined'](this['variables'][_0x5d0296])){this[_0x263a('0x10')][_0x5d0296]={};}this[_0x263a('0x10')][_0x5d0296][_0x34a505]=_0x452424;}};VoiceQueueReport[_0x263a('0x31')][_0x263a('0xc1')]=function(_0x2553d6,_0x31fc66,_0x4d25bb){var _0x701def={};for(var _0x1ff5cb=0x0;_0x1ff5cb<this[_0x263a('0x39')][_0x2553d6][_0x263a('0xc2')];_0x1ff5cb+=0x1){_0x701def=this[_0x263a('0x39')][_0x2553d6][_0x1ff5cb];if(this[_0x263a('0x3d')][_0x701def['queue']]){if(_0x701def[_0x263a('0x93')]&&_0x701def[_0x263a('0x95')]!=!![]){this['voiceQueues'][_0x701def[_0x263a('0x68')]]['unmanaged']+=0x1;}if(_0x701def[_0x263a('0x16')]){this['voiceQueues'][_0x701def[_0x263a('0x68')]][_0x263a('0x58')]+=0x1;}this[_0x263a('0x3d')][_0x701def['queue']][_0x263a('0xc3')]+=moment(_0x701def['queuecallerleaveAt'])[_0x263a('0xc4')](_0x701def[_0x263a('0x77')],_0x263a('0xc5'))||0x0;if(_0x1ff5cb===this[_0x263a('0x39')][_0x2553d6][_0x263a('0xc2')]-0x1){this[_0x263a('0x3d')][_0x701def[_0x263a('0x68')]][_0x263a('0x57')]+=moment()[_0x263a('0xc6')](0x0)['diff'](_0x701def[_0x263a('0x77')],'seconds');this[_0x263a('0x3d')][_0x701def[_0x263a('0x68')]][_0x263a('0xc7')]+=0x1;if(_0x701def[_0x263a('0x83')]){this[_0x263a('0x3d')][_0x701def['queue']]['answered']+=0x1;this[_0x263a('0x3d')][_0x701def[_0x263a('0x68')]][_0x263a('0x56')]+=moment()[_0x263a('0xc6')](0x0)[_0x263a('0xc4')](_0x701def[_0x263a('0xac')],_0x263a('0xc5'));_0x701def[_0x263a('0x84')]=moment()[_0x263a('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x701def[_0x263a('0x93')]=![];_0x701def[_0x263a('0x94')]=null;}if(_0x701def[_0x263a('0x93')]&&_0x701def['transfer']!=!![]){_0x701def[_0x263a('0xaa')]=_0x263a('0xc8');logger[_0x263a('0x4a')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x2553d6,util['inspect'](_0x701def,{'showHidden':![],'depth':null}));ami[_0x263a('0x41')]('custom:queuecallerunmanaged',_0x701def);}if(_0x701def['queuecallerabandon']){_0x701def[_0x263a('0xaa')]='abandoned';logger[_0x263a('0x4a')](_0x263a('0xc9'),_0x2553d6,util[_0x263a('0x38')](_0x701def,{'showHidden':![],'depth':null}));ami['emit']('custom:queuecallerabandon',_0x701def);}}else{this['voiceQueues'][_0x701def[_0x263a('0x68')]][_0x263a('0x57')]+=this[_0x263a('0x3d')][_0x701def['queue']]['sumHoldTime'];}logger[_0x263a('0x69')](_0x263a('0xca'),_0x2553d6,_0x701def[_0x263a('0x5b')],_0x701def[_0x263a('0x51')],_0x31fc66);if(_0x4d25bb&&_0x701def[_0x263a('0x4c')]==='ATTENDEDTRANSFER'){_0x701def['queuecallerexitreason']=_0x263a('0x8f');}this[_0x263a('0xd')][_0x2553d6]=_0x701def;this['emitVoiceQueueChannelRemove'](_0x701def,_0x263a('0x1e'));this[_0x263a('0x50')](this[_0x263a('0x3d')][_0x701def[_0x263a('0x68')]],_0x263a('0x1e'));}}logger[_0x263a('0x4a')](_0x263a('0xcb'),_0x2553d6,util[_0x263a('0x38')](this[_0x263a('0x39')][_0x2553d6],{'showHidden':![],'depth':null}));ami[_0x263a('0x41')]('custom:voiceQueueReport',this['queueReports'][_0x2553d6]);if(_0x701def[_0x263a('0x4c')]===_0x263a('0x4d'))return;delete this[_0x263a('0x39')][_0x2553d6];delete this[_0x263a('0xd')][_0x2553d6];if(this[_0x263a('0x10')][_0x2553d6]){delete this[_0x263a('0x10')][_0x2553d6];}};VoiceQueueReport[_0x263a('0x31')]['syncHangup']=function(_0x23a12c){try{if(this[_0x263a('0x60')](_0x23a12c)){logger['debug'](_0x263a('0xcc'),_0x23a12c[_0x263a('0x45')],util[_0x263a('0x38')](_0x23a12c,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x23a12c[_0x263a('0x45')]]){return this[_0x263a('0xc1')](_0x23a12c[_0x263a('0x45')],_0x23a12c['cause-txt']);}if(this['queueReports'][_0x23a12c['linkedid']]){if(_0x23a12c[_0x263a('0xcd')]==='21'){return;}return this['handleHangup'](_0x23a12c[_0x263a('0x99')],_0x23a12c[_0x263a('0xce')],!![]);}var _0x540b09=Object[_0x263a('0x7e')](this[_0x263a('0x39')]);for(var _0x5a49b0=0x0;_0x5a49b0<_0x540b09[_0x263a('0xc2')];_0x5a49b0++){var _0x45cac4=_[_0x263a('0x82')](this[_0x263a('0x39')][_0x540b09[_0x5a49b0]]);if(_0x45cac4&&_0x45cac4[_0x263a('0xcf')]===_0x23a12c['uniqueid']){return this[_0x263a('0xc1')](_0x45cac4[_0x263a('0x45')],_0x23a12c[_0x263a('0xce')],!![]);}}}}catch(_0x3c0642){logger[_0x263a('0x37')]('[%s][voiceQueueReport][hangup]',_0x23a12c[_0x263a('0x45')],util['inspect'](_0x3c0642,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x263a('0x31')][_0x263a('0x26')]=function(_0x27b209){try{if(this[_0x263a('0x60')](_0x27b209)){logger[_0x263a('0x4a')](_0x263a('0xd0'),_0x27b209[_0x263a('0x45')],util[_0x263a('0x38')](_0x27b209,{'showHidden':![],'depth':null}));var _0x15363d;var _0x289501;var _0x1f0da9;if(this['queueReports'][_0x27b209[_0x263a('0xd1')]]){_0x15363d=_[_0x263a('0x82')](this[_0x263a('0x39')][_0x27b209[_0x263a('0xd1')]]);_0x15363d[_0x263a('0x9d')]=_0x27b209[_0x263a('0xd2')];_0x15363d[_0x263a('0x9f')]=_0x27b209[_0x263a('0xd3')];_0x15363d[_0x263a('0x4c')]=_0x263a('0x4d');_0x15363d['transfer']=!![];_0x15363d[_0x263a('0x9b')]=_0x263a('0xd4');if(this[_0x263a('0x39')][_0x27b209[_0x263a('0xd3')]]){_0x1f0da9=this[_0x263a('0x39')][_0x27b209[_0x263a('0xd3')]];this[_0x263a('0x39')][_0x27b209[_0x263a('0xd3')]]=this['queueReports'][_0x27b209[_0x263a('0xd1')]];this['queueReports'][_0x27b209[_0x263a('0xd1')]]=_0x1f0da9;_0x289501=_['last'](this['queueReports'][_0x27b209[_0x263a('0xd1')]]);_0x289501[_0x263a('0xd5')]=!![];}logger[_0x263a('0x69')](_0x263a('0xd6'),_0x27b209[_0x263a('0x45')],_0x15363d[_0x263a('0x5b')],_0x15363d[_0x263a('0x51')],_0x15363d[_0x263a('0x9d')],_0x15363d[_0x263a('0x9f')]);}else if(this['queueReports'][_0x27b209[_0x263a('0xd7')]]){_0x15363d=_[_0x263a('0x82')](this[_0x263a('0x39')][_0x27b209['transfertargetuniqueid']]);_0x15363d['transferexten']=_0x27b209[_0x263a('0xd8')];_0x15363d[_0x263a('0x9f')]=_0x27b209['origtransfereruniqueid'];_0x15363d[_0x263a('0x4c')]=_0x263a('0x4d');_0x15363d[_0x263a('0x95')]=!![];_0x15363d[_0x263a('0x9b')]=_0x263a('0xd4');if(this[_0x263a('0x39')][_0x27b209['origtransfereruniqueid']]){_0x1f0da9=this[_0x263a('0x39')][_0x27b209['origtransfereruniqueid']];this[_0x263a('0x39')][_0x27b209[_0x263a('0xd9')]]=this[_0x263a('0x39')][_0x27b209[_0x263a('0xd7')]];this[_0x263a('0x39')][_0x27b209[_0x263a('0xd7')]]=_0x1f0da9;_0x289501=_[_0x263a('0x82')](this[_0x263a('0x39')][_0x27b209[_0x263a('0xd7')]]);_0x289501[_0x263a('0xd5')]=!![];}logger[_0x263a('0x69')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x27b209['uniqueid'],_0x15363d['name'],_0x15363d[_0x263a('0x51')],_0x15363d['transferexten'],_0x15363d['transferuniqueid']);}else if(this['queueReports'][_0x27b209[_0x263a('0xd9')]]){_0x15363d=_['last'](this[_0x263a('0x39')][_0x27b209[_0x263a('0xd9')]]);_0x15363d[_0x263a('0x9d')]=_0x27b209[_0x263a('0xd8')];_0x15363d['transferuniqueid']=_0x27b209[_0x263a('0xd9')];_0x15363d[_0x263a('0x4c')]='ATTENDEDTRANSFER';_0x15363d[_0x263a('0x95')]=!![];_0x15363d['transfertype']=_0x263a('0xd4');_0x15363d[_0x263a('0xd5')]=!![];_0x15363d[_0x263a('0xcf')]=_0x27b209[_0x263a('0xd1')];}else if(this['queueReports'][_0x27b209[_0x263a('0xd3')]]){_0x15363d=_[_0x263a('0x82')](this[_0x263a('0x39')][_0x27b209[_0x263a('0xd3')]]);_0x15363d[_0x263a('0x9d')]=_0x27b209[_0x263a('0xd2')];_0x15363d[_0x263a('0x9f')]=_0x27b209[_0x263a('0xd3')];_0x15363d[_0x263a('0x4c')]=_0x263a('0x4d');_0x15363d[_0x263a('0x95')]=!![];_0x15363d['transfertype']=_0x263a('0xd4');_0x15363d[_0x263a('0xd5')]=!![];_0x15363d['transferid']=_0x27b209[_0x263a('0xd7')];}}}catch(_0x4782e5){logger[_0x263a('0x37')](_0x263a('0xd0'),_0x27b209['uniqueid'],util['inspect'](_0x4782e5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x263a('0xda')]=function(_0x90a8de){try{if(this[_0x263a('0x60')](_0x90a8de)){logger[_0x263a('0x4a')](_0x263a('0xdb'),_0x90a8de[_0x263a('0x45')],util['inspect'](_0x90a8de,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x90a8de['transfereeuniqueid']]){var _0x1e253f=_['last'](this[_0x263a('0x39')][_0x90a8de[_0x263a('0xd1')]]);_0x1e253f['queuecallerexitreason']=_0x263a('0xdc');_0x1e253f[_0x263a('0x95')]=!![];_0x1e253f[_0x263a('0x9b')]=_0x263a('0xdd');_0x1e253f['transferexten']=_0x90a8de[_0x263a('0xde')];_0x1e253f[_0x263a('0x9f')]=_0x90a8de[_0x263a('0xd1')];logger['info'](_0x263a('0xdf'),_0x90a8de[_0x263a('0x45')],_0x1e253f[_0x263a('0x5b')],_0x1e253f[_0x263a('0x51')],_0x1e253f['transferexten'],_0x1e253f[_0x263a('0x9f')]);this[_0x263a('0x1f')]({'event':_0x263a('0xe0'),'uniqueid':_0x90a8de[_0x263a('0xd1')],'context':_0x90a8de[_0x263a('0xe1')],'channel':_0x90a8de[_0x263a('0xe2')]});}}}catch(_0x4f4a1f){logger[_0x263a('0x37')](_0x263a('0xdb'),_0x90a8de['uniqueid'],util['inspect'](_0x4f4a1f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x263a('0x31')][_0x263a('0x22')]=function(_0x5c0214){try{if(this['isNotNull'](_0x5c0214)){logger[_0x263a('0x4a')]('[%s][voiceQueueReport][musiconholdstart]',_0x5c0214['uniqueid'],util[_0x263a('0x38')](_0x5c0214,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5c0214[_0x263a('0x45')]]){var _0x2fe8dd=_[_0x263a('0x82')](this[_0x263a('0x39')][_0x5c0214[_0x263a('0x45')]]);if(!_['isNil'](_0x2fe8dd[_0x263a('0xac')])){_0x2fe8dd[_0x263a('0xe3')]=moment()[_0x263a('0x46')](_0x263a('0x78'));logger[_0x263a('0x69')](_0x263a('0xe4'),_0x5c0214[_0x263a('0x45')],_0x2fe8dd[_0x263a('0xe3')]);}}}}catch(_0x5bea5c){logger[_0x263a('0x37')]('[%s][voiceQueueReport][musiconholdstart]',_0x5c0214[_0x263a('0x45')],util['inspect'](_0x5bea5c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x263a('0x31')][_0x263a('0x24')]=function(_0x4f90c2){try{if(this['isNotNull'](_0x4f90c2)){logger[_0x263a('0x4a')](_0x263a('0xe5'),_0x4f90c2[_0x263a('0x45')],util[_0x263a('0x38')](_0x4f90c2,{'showHidden':![],'depth':null}));if(this[_0x263a('0x39')][_0x4f90c2['uniqueid']]){var _0x13f8df=_[_0x263a('0x82')](this[_0x263a('0x39')][_0x4f90c2[_0x263a('0x45')]]);if(!_[_0x263a('0x32')](_0x13f8df[_0x263a('0xe3')])){_0x13f8df['mohtime']+=moment()['milliseconds'](0x0)[_0x263a('0xc4')](_0x13f8df[_0x263a('0xe3')],_0x263a('0xc5'));logger[_0x263a('0x69')]('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x4f90c2[_0x263a('0x45')],_0x13f8df[_0x263a('0xe6')]);delete _0x13f8df[_0x263a('0xe3')];}}}}catch(_0x17be1e){logger[_0x263a('0x37')](_0x263a('0xe5'),_0x4f90c2[_0x263a('0x45')],util[_0x263a('0x38')](_0x17be1e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x263a('0xe7')]=function(_0x1074bd){try{if(this[_0x263a('0x60')](_0x1074bd)){logger[_0x263a('0x4a')](_0x263a('0xe8'),_0x1074bd[_0x263a('0x45')],util[_0x263a('0x38')](_0x1074bd,{'showHidden':![],'depth':null}));if(_0x1074bd[_0x263a('0xe9')]['toLowerCase']()===_0x263a('0xea')){_0x1074bd[_0x263a('0xeb')]=_0x1074bd[_0x263a('0xec')]&&_0x1074bd[_0x263a('0xec')][_0x263a('0xed')](_0x263a('0xee'))?_0x1074bd['appdata']:(_0x1074bd[_0x263a('0xec')]||_0x1074bd[_0x263a('0xeb')])[_0x263a('0x98')]();if(_[_0x263a('0xed')](_0x1074bd['applicationdata'][_0x263a('0x98')](),_0x263a('0xef'))){logger['info']('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x1074bd[_0x263a('0x45')],_0x1074bd[_0x263a('0xe9')],_0x1074bd[_0x263a('0xeb')]);if(_[_0x263a('0x76')](this['channels'][_0x1074bd['uniqueid']]))this['channels'][_0x1074bd[_0x263a('0x45')]]={};var _0x32d5d7=_0x1074bd[_0x263a('0xeb')]['split']('=');var _0x32134e=_0x32d5d7[0x0][_0x263a('0x98')]()[_0x263a('0xf0')](/cdr\((.*)\)/);if(_0x32134e)this[_0x263a('0xd')][_0x1074bd[_0x263a('0x45')]][_0x32134e[0x1]]=_0x32d5d7[0x1];}}}}catch(_0x58fdea){logger[_0x263a('0x37')](_0x263a('0xf1'),_0x1074bd['uniqueid'],util[_0x263a('0x38')](_0x58fdea,{'showHidden':![],'depth':null}));}};module[_0x263a('0xf2')]=VoiceQueueReport;
\ No newline at end of file
+var _0x6091=['debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','emit','format','name','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','ATTENDEDTRANSFER','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','available','sumBillable','sumDuration','sumHoldTime','total','Trunk','Interval','stringify','md5','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isUndefined','catch','[voiceQueueReport][queues]','Action','queuesummary','then','[voiceQueueReport][queuesummary]','isNotNull','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','loggedIn','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','holdtime','originalposition','queuecallerexitreason','ABANDONED','syncQueueCallerLeave','connectedlinenum','connectedlinename','[%s][voiceQueueReport][queuecallerleave]','[%s][voiceQueueReport][agentconnect]','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','assigned','lastAssignedTo','membername','queuecallerexitAt','transfer','reason','COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','agentcomplete','[%s][voiceQueueReport][varset]','addVariable','variable','value','queuestatus','queuecallerexit','TIMEOUT','lastevent','timeout','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','membercalls','memberlastcall','includes','handleHangup','unmanaged','abandoned','diff','length','milliseconds','answered','queuecallercompleteAt','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','COMPLETEDBYAGENT','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','cause-txt','cause','transferid','[%s][voiceQueueReport][hangup]','syncAttendedTransfer','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','switch','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','mohtime','syncNewExten','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','ioredis','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','syncQueueSummary','bind','syncQueueSummaryComplete','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','sequence','isNil','channel','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','variables','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emitVoiceQueueChannelSave'];(function(_0x81267,_0x37ec90){var _0x351340=function(_0x2dee82){while(--_0x2dee82){_0x81267['push'](_0x81267['shift']());}};_0x351340(++_0x37ec90);}(_0x6091,0x1aa));var _0x1609=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x6091[_0x2405bc];return _0x5272d4;};'use strict';var _=require(_0x1609('0x0'));var moment=require(_0x1609('0x1'));var util=require('util');var md5=require('md5');var Redis=require(_0x1609('0x2'));var config=require('../../../config/environment');var logger=require(_0x1609('0x3'))(_0x1609('0x4'));var ami=require(_0x1609('0x5'));var QueueReport=require(_0x1609('0x6'));config[_0x1609('0x7')]=_[_0x1609('0x8')](config[_0x1609('0x7')],{'host':_0x1609('0x9'),'port':0x18eb});var io=require(_0x1609('0xa'))(new Redis(config[_0x1609('0x7')]));var Sequence=function(){};Sequence[_0x1609('0xb')]['enqueue']=function(_0x583d16){this[_0x1609('0xc')]=this[_0x1609('0xc')]?this['tail'][_0x1609('0xd')](_0x583d16):_0x583d16();};function VoiceQueueReport(_0x4ca043){this['sequence']=new Sequence();this[_0x1609('0xe')]={};this[_0x1609('0xf')]=_0x4ca043['agents'];this[_0x1609('0x10')]=_0x4ca043[_0x1609('0x11')];this[_0x1609('0x12')]=_0x4ca043[_0x1609('0x12')];this[_0x1609('0x13')]=!![];this[_0x1609('0x14')]=_0x4ca043[_0x1609('0x14')];this['variables']={};ami['on']('queuesummary',this[_0x1609('0x15')][_0x1609('0x16')](this));ami['on']('queuesummarycomplete',this[_0x1609('0x17')][_0x1609('0x16')](this));ami['on'](_0x1609('0x18'),this['syncQueueCallerJoin']['bind'](this));ami['on'](_0x1609('0x19'),this[_0x1609('0x1a')]['bind'](this));ami['on'](_0x1609('0x1b'),this['syncQueueCallerLeave'][_0x1609('0x16')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x1609('0x16')](this));ami['on'](_0x1609('0x1c'),this[_0x1609('0x1d')][_0x1609('0x16')](this));ami['on'](_0x1609('0x1e'),this[_0x1609('0x1f')][_0x1609('0x16')](this));ami['on'](_0x1609('0x20'),this[_0x1609('0x21')][_0x1609('0x16')](this));ami['on'](_0x1609('0x22'),this['syncFullyBooted']['bind'](this));ami['on'](_0x1609('0x23'),this[_0x1609('0x24')][_0x1609('0x16')](this));ami['on'](_0x1609('0x25'),this[_0x1609('0x26')][_0x1609('0x16')](this));ami['on'](_0x1609('0x27'),this['syncAttendedTransfer'][_0x1609('0x16')](this));ami['on'](_0x1609('0x28'),this[_0x1609('0x29')][_0x1609('0x16')](this));this[_0x1609('0x2a')]();this[_0x1609('0x2b')]();}function clearChannels(_0x23886a){if(!_[_0x1609('0x2c')](_0x23886a)){for(var _0x50bd65 in _0x23886a){if(_0x23886a[_0x1609('0x2d')](_0x50bd65)){delete _0x23886a[_0x50bd65];}}}}function clearCampaigns(_0xb63e28){if(!_['isEmpty'](_0xb63e28)){for(var _0x3d9ea7 in _0xb63e28){if(_0xb63e28[_0x1609('0x2d')](_0x3d9ea7)){_0xb63e28[_0x3d9ea7][_0x1609('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x2122bd){if(!_[_0x1609('0x2c')](_0x2122bd)){for(var _0x159b75 in _0x2122bd){if(_0x2122bd[_0x1609('0x2d')](_0x159b75)){_0x2122bd[_0x159b75][_0x1609('0x2e')]=0x0;_0x2122bd[_0x159b75][_0x1609('0x2f')]=0x0;_0x2122bd[_0x159b75][_0x1609('0x30')]=0x0;_0x2122bd[_0x159b75][_0x1609('0x31')]=0x0;_0x2122bd[_0x159b75][_0x1609('0x32')]=!![];}}}}function clearAgentBooked(_0x72df12){if(!_[_0x1609('0x2c')](_0x72df12)){for(var _0x570822 in _0x72df12){if(_0x72df12[_0x1609('0x2d')](_0x570822)){_0x72df12[_0x570822][_0x1609('0x33')]=!![];}}}}VoiceQueueReport[_0x1609('0xb')][_0x1609('0x34')]=function(){var _0xdc551e=this;for(var _0x58ba3f in this['channels']){if(this['channels'][_0x1609('0x2d')](_0x58ba3f)&&!this[_0x1609('0x10')][_0x58ba3f]['switch']){this[_0x1609('0x35')]['enqueue'](function(){if(!_[_0x1609('0x36')](_0xdc551e[_0x1609('0x10')][_0x58ba3f])){return ami['Action']({'action':'status','channel':_0xdc551e[_0x1609('0x10')][_0x58ba3f][_0x1609('0x37')]})['catch'](function(_0xc3db76){if(_0xc3db76[_0x1609('0x38')]===_0x1609('0x39')){setTimeout(function(){if(_0xdc551e['channels'][_0x58ba3f]){delete _0xdc551e[_0x1609('0x10')][_0x58ba3f];logger[_0x1609('0x3a')](_0x1609('0x3b'),_0x58ba3f,util[_0x1609('0x3c')](_0xc3db76,{'showHidden':![],'depth':null}));}if(_0xdc551e[_0x1609('0xe')][_0x58ba3f]){delete _0xdc551e[_0x1609('0xe')][_0x58ba3f];logger[_0x1609('0x3a')]('[%s][voiceQueueReport][checkQueueReport]',_0x58ba3f,util[_0x1609('0x3c')](_0xc3db76,{'showHidden':![],'depth':null}));}if(_0xdc551e[_0x1609('0x3d')][_0x58ba3f]){delete _0xdc551e[_0x1609('0x3d')][_0x58ba3f];logger[_0x1609('0x3a')]('[%s][voiceQueueReport][checkVariables]',_0x58ba3f,util[_0x1609('0x3c')](_0xc3db76,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x1609('0xb')][_0x1609('0x3e')]=function(){logger[_0x1609('0x3a')](_0x1609('0x3f'));clearChannels(this[_0x1609('0x10')]);this['clearQueueReport'](this[_0x1609('0xe')]);clearAgentBooked(this[_0x1609('0xf')]);clearVoiceQueues(this[_0x1609('0x12')]);clearCampaigns(this[_0x1609('0x14')]);};VoiceQueueReport[_0x1609('0xb')][_0x1609('0x40')]=function(_0x5f3715){var _0x4e110f=this;if(!_['isEmpty'](_0x5f3715)){for(var _0x57d0c5 in _0x5f3715){if(_0x5f3715[_0x1609('0x2d')](_0x57d0c5)){_0x4e110f[_0x1609('0x41')](_0x5f3715[_0x57d0c5],_0x1609('0x42'));delete _0x5f3715[_0x57d0c5];}}}};VoiceQueueReport[_0x1609('0xb')]['emit']=function(_0x42f150,_0x369976,_0x457b1b){io['to'](_0x42f150)['emit'](_0x369976,_0x457b1b);};VoiceQueueReport[_0x1609('0xb')][_0x1609('0x43')]=function(_0x5ab0f0,_0x57a2bd){logger[_0x1609('0x44')](_0x1609('0x45')+_0x57a2bd+_0x1609('0x46'),_0x5ab0f0[_0x1609('0x47')],util[_0x1609('0x3c')](_0x5ab0f0,{'showHidden':![],'depth':null}));this[_0x1609('0x48')](util[_0x1609('0x49')]('voice:queue:%s',_0x5ab0f0[_0x1609('0x4a')]),_0x1609('0x4b'),_0x5ab0f0);io[_0x1609('0x48')](_0x1609('0x4c'),_0x5ab0f0);};VoiceQueueReport[_0x1609('0xb')][_0x1609('0x41')]=function(_0x58d537,_0x2fdf07){logger[_0x1609('0x44')](_0x1609('0x45')+_0x2fdf07+_0x1609('0x4d'),_0x58d537['uniqueid'],util[_0x1609('0x3c')](_0x58d537,{'showHidden':![],'depth':null}));if(_0x58d537['queuecallerexitreason']===_0x1609('0x4e'))return;this[_0x1609('0x48')](util[_0x1609('0x49')](_0x1609('0x4f'),_0x58d537[_0x1609('0x4a')]),_0x1609('0x50'),_0x58d537);io[_0x1609('0x48')](_0x1609('0x51'),_0x58d537);};VoiceQueueReport['prototype'][_0x1609('0x52')]=function(_0x44b0ad,_0x20e099){if(_0x44b0ad[_0x1609('0x53')]===_0x1609('0x54')){var _0x36b0a7={'id':_0x44b0ad['id'],'name':_0x44b0ad[_0x1609('0x4a')],'strategy':_0x44b0ad[_0x1609('0x55')],'answered':_0x44b0ad['answered'],'available':_0x44b0ad[_0x1609('0x56')],'loggedIn':_0x44b0ad['loggedIn'],'pTalking':_0x44b0ad[_0x1609('0x30')],'sumBillable':_0x44b0ad[_0x1609('0x57')],'sumDuration':_0x44b0ad[_0x1609('0x58')],'sumHoldTime':_0x44b0ad[_0x1609('0x59')]||0x0,'talking':_0x44b0ad[_0x1609('0x2f')],'total':_0x44b0ad[_0x1609('0x5a')],'type':_0x44b0ad[_0x1609('0x53')],'unmanaged':_0x44b0ad['unmanaged'],'abandoned':_0x44b0ad['abandoned'],'waiting':_0x44b0ad[_0x1609('0x31')]};if(_0x44b0ad[_0x1609('0x5b')]){_0x36b0a7['Trunk']={'id':_0x44b0ad[_0x1609('0x5b')]['id'],'name':_0x44b0ad[_0x1609('0x5b')][_0x1609('0x4a')],'active':_0x44b0ad[_0x1609('0x5b')]['active'],'callerid':_0x44b0ad[_0x1609('0x5b')]['callerid']};}if(_0x44b0ad[_0x1609('0x5c')]){_0x36b0a7[_0x1609('0x5c')]={'id':_0x44b0ad[_0x1609('0x5c')]['id'],'name':_0x44b0ad[_0x1609('0x5c')][_0x1609('0x4a')]};}var _0x354385=md5(JSON[_0x1609('0x5d')](_0x36b0a7));if(_0x44b0ad['md5']!==_0x354385){_0x44b0ad[_0x1609('0x5e')]=_0x354385;logger[_0x1609('0x44')](_0x1609('0x5f')+_0x20e099+_0x1609('0x60'),util[_0x1609('0x3c')](_0x36b0a7,{'showHidden':![],'depth':null}));this[_0x1609('0x48')](util['format'](_0x1609('0x4f'),_0x36b0a7[_0x1609('0x4a')]),_0x1609('0x61'),_0x36b0a7);}}};VoiceQueueReport[_0x1609('0xb')]['isNotNull']=function(_0x13eb60){return _0x13eb60!==null&&!_[_0x1609('0x62')](_0x13eb60);};VoiceQueueReport[_0x1609('0xb')]['loopQueueShow']=function(){var _0x5c025e=this;setInterval(function(){_0x5c025e[_0x1609('0x34')]();ami['Action']({'action':'queues'})[_0x1609('0x63')](function(_0x1e4dba){logger[_0x1609('0x3a')](_0x1609('0x64'),util[_0x1609('0x3c')](_0x1e4dba,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x1609('0xb')][_0x1609('0x2a')]=function(){var _0x154360=this;setInterval(function(){if(_0x154360[_0x1609('0x13')]){return ami[_0x1609('0x65')]({'action':_0x1609('0x66')})[_0x1609('0x67')](function(){_0x154360[_0x1609('0x13')]=![];})[_0x1609('0x63')](function(_0x4b1153){logger[_0x1609('0x3a')](_0x1609('0x68'),util['inspect'](_0x4b1153,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0x1609('0x15')]=function(_0xd69bb4){try{if(this[_0x1609('0x69')](_0xd69bb4)&&this[_0x1609('0x69')](_0xd69bb4[_0x1609('0x6a')])){logger[_0x1609('0x44')](_0x1609('0x6b'),util[_0x1609('0x3c')](_0xd69bb4,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0xd69bb4[_0x1609('0x6a')]]){logger[_0x1609('0x6c')](_0x1609('0x6d'),_0xd69bb4[_0x1609('0x6a')]);var _0xfe8517=_[_0x1609('0x6e')](this[_0x1609('0x10')],_0x1609('0x6a'))[_0xd69bb4['queue']]||0x0;var _0x9b6f04=_0xfe8517-_0xd69bb4[_0x1609('0x6f')];if(this['voiceQueues'][_0xd69bb4['queue']][_0x1609('0x31')]!==_[_0x1609('0x70')](_0xd69bb4[_0x1609('0x6f')])||this[_0x1609('0x12')][_0xd69bb4[_0x1609('0x6a')]]['loggedIn']!==_[_0x1609('0x70')](_0xd69bb4[_0x1609('0x71')])||this['voiceQueues'][_0xd69bb4[_0x1609('0x6a')]]['available']!==_[_0x1609('0x70')](_0xd69bb4['available'])||this['voiceQueues'][_0xd69bb4[_0x1609('0x6a')]][_0x1609('0x2f')]!==_0x9b6f04){this[_0x1609('0x12')][_0xd69bb4[_0x1609('0x6a')]][_0x1609('0x31')]=_[_0x1609('0x70')](_0xd69bb4['callers']);this[_0x1609('0x12')][_0xd69bb4[_0x1609('0x6a')]][_0x1609('0x72')]=_['toNumber'](_0xd69bb4[_0x1609('0x71')]);this[_0x1609('0x12')][_0xd69bb4[_0x1609('0x6a')]]['available']=_['toNumber'](_0xd69bb4[_0x1609('0x56')]);this[_0x1609('0x12')][_0xd69bb4[_0x1609('0x6a')]][_0x1609('0x2f')]=_0x9b6f04>0x0?_0x9b6f04:0x0;this['voiceQueues'][_0xd69bb4[_0x1609('0x6a')]][_0x1609('0x2f')]=this['voiceQueues'][_0xd69bb4[_0x1609('0x6a')]][_0x1609('0x2f')]>_['toNumber'](_0xd69bb4[_0x1609('0x71')])?_['toNumber'](_0xd69bb4['loggedin']):this[_0x1609('0x12')][_0xd69bb4[_0x1609('0x6a')]][_0x1609('0x2f')];this[_0x1609('0x52')](this[_0x1609('0x12')][_0xd69bb4[_0x1609('0x6a')]],_0x1609('0x66'));}logger[_0x1609('0x44')](_0x1609('0x73'),util[_0x1609('0x3c')](this['voiceQueues'][_0xd69bb4[_0x1609('0x6a')]],{'showHidden':![],'depth':null}));ami[_0x1609('0x48')]('custom:queuesummary',this[_0x1609('0x12')][_0xd69bb4[_0x1609('0x6a')]]);}}}catch(_0x23f220){logger['error'](_0x1609('0x68'),util[_0x1609('0x3c')](_0x23f220,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0xde92f0){logger[_0x1609('0x44')](_0x1609('0x74'),util[_0x1609('0x3c')](_0xde92f0,{'showHidden':![],'depth':null}));ami[_0x1609('0x48')](_0x1609('0x75'),{});this[_0x1609('0x13')]=!![];};VoiceQueueReport[_0x1609('0xb')][_0x1609('0x76')]=function(_0xa305a2){try{if(this[_0x1609('0x69')](_0xa305a2)){logger['debug'](_0x1609('0x77'),_0xa305a2[_0x1609('0x47')],util['inspect'](_0xa305a2,{'showHidden':![],'depth':null}));if(_[_0x1609('0x62')](this['queueReports'][_0xa305a2[_0x1609('0x47')]]))this['queueReports'][_0xa305a2['uniqueid']]=[];if(_[_0x1609('0x62')](this[_0x1609('0x10')][_0xa305a2[_0x1609('0x47')]]))this[_0x1609('0x10')][_0xa305a2[_0x1609('0x47')]]={};var _0x125aa9=new QueueReport();_0x125aa9[_0x1609('0x4a')]=_0xa305a2['queue'];_0x125aa9[_0x1609('0x53')]=this[_0x1609('0x12')][_0x125aa9[_0x1609('0x4a')]]&&this[_0x1609('0x12')][_0x125aa9[_0x1609('0x4a')]][_0x1609('0x53')]?this[_0x1609('0x12')][_0x125aa9[_0x1609('0x4a')]][_0x1609('0x53')]||'inbound':_0x1609('0x54');_0x125aa9[_0x1609('0x6a')]=_0xa305a2[_0x1609('0x6a')];_0x125aa9[_0x1609('0x78')]=moment()[_0x1609('0x49')](_0x1609('0x79'));_0x125aa9[_0x1609('0x7a')]=_0xa305a2[_0x1609('0x7a')];_0x125aa9['count']=_0xa305a2[_0x1609('0x7b')];_0x125aa9[_0x1609('0x47')]=_0xa305a2['uniqueid'];_0x125aa9[_0x1609('0x7c')]=this[_0x1609('0x10')][_0xa305a2[_0x1609('0x47')]][_0x1609('0x7c')];logger['info'](_0x1609('0x7d'),_0x125aa9[_0x1609('0x4a')],_0x125aa9[_0x1609('0x53')]);_[_0x1609('0x7e')](_0x125aa9,_[_0x1609('0x7f')](_0xa305a2,_[_0x1609('0x80')](_0x125aa9)));this['queueReports'][_0xa305a2['uniqueid']][_0x1609('0x81')](_0x125aa9);this['channels'][_0xa305a2[_0x1609('0x47')]]=_0x125aa9;this['emitVoiceQueueChannelSave'](_0x125aa9,_0x1609('0x18'));}}catch(_0x43d3db){logger[_0x1609('0x3a')](_0x1609('0x77'),_0xa305a2['uniqueid'],util[_0x1609('0x3c')](_0x43d3db,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x57216b){try{if(this[_0x1609('0x69')](_0x57216b)){logger[_0x1609('0x44')](_0x1609('0x82'),_0x57216b[_0x1609('0x47')],util[_0x1609('0x3c')](_0x57216b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x57216b[_0x1609('0x47')]]){var _0x1f6ee5=_[_0x1609('0x83')](this['queueReports'][_0x57216b['uniqueid']]);_0x1f6ee5[_0x1609('0x84')]=![];_0x1f6ee5['queuecallercompleteAt']=null;_0x1f6ee5[_0x1609('0x85')]=_0x57216b['holdtime'];_0x1f6ee5['originalposition']=_0x57216b[_0x1609('0x86')];_0x1f6ee5[_0x1609('0x19')]=!![];_0x1f6ee5['queuecallerabandonAt']=moment()[_0x1609('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x1f6ee5[_0x1609('0x87')]=_0x1609('0x88');_0x1f6ee5['lastAssignedTo']=null;logger[_0x1609('0x6c')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x1f6ee5[_0x1609('0x4a')],_0x1f6ee5[_0x1609('0x53')]);this[_0x1609('0x10')][_0x57216b[_0x1609('0x47')]]=_0x1f6ee5;this[_0x1609('0x41')](_0x1f6ee5,_0x1609('0x19'));}}}catch(_0x2596ad){logger[_0x1609('0x3a')]('[%s][voiceQueueReport][queuecallerabandon]',_0x57216b[_0x1609('0x47')],util[_0x1609('0x3c')](_0x2596ad,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1609('0xb')][_0x1609('0x89')]=function(_0x5b4aaf){try{if(this[_0x1609('0x69')](_0x5b4aaf)){logger[_0x1609('0x44')]('[%s][voiceQueueReport][queuecallerleave]',_0x5b4aaf[_0x1609('0x47')],util['inspect'](_0x5b4aaf,{'showHidden':![],'depth':null}));if(this[_0x1609('0xe')][_0x5b4aaf[_0x1609('0x47')]]){var _0x5e7671=_[_0x1609('0x83')](this[_0x1609('0xe')][_0x5b4aaf[_0x1609('0x47')]]);_0x5e7671['queuecallerleaveAt']=moment()['format'](_0x1609('0x79'));_0x5e7671[_0x1609('0x8a')]=_0x5b4aaf[_0x1609('0x8a')];_0x5e7671[_0x1609('0x8b')]=_0x5b4aaf[_0x1609('0x8b')];logger[_0x1609('0x6c')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x5e7671['name'],_0x5e7671['type'],_0x5b4aaf['connectedlinenum'],_0x5b4aaf[_0x1609('0x8b')]);this[_0x1609('0x10')][_0x5b4aaf[_0x1609('0x47')]]=_0x5e7671;this[_0x1609('0x43')](_0x5e7671,_0x1609('0x1b'));}}}catch(_0x629649){logger[_0x1609('0x3a')](_0x1609('0x8c'),_0x5b4aaf['uniqueid'],util[_0x1609('0x3c')](_0x629649,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1609('0xb')][_0x1609('0x1d')]=function(_0x12ff57){try{if(this['isNotNull'](_0x12ff57)){logger[_0x1609('0x44')](_0x1609('0x8d'),_0x12ff57['uniqueid'],util[_0x1609('0x3c')](_0x12ff57,{'showHidden':![],'depth':null}));if(this[_0x1609('0xe')][_0x12ff57[_0x1609('0x47')]]){var _0x14a0a0=_['last'](this['queueReports'][_0x12ff57[_0x1609('0x47')]]);_0x14a0a0['queuecallercomplete']=!![];_0x14a0a0[_0x1609('0x87')]='COMPLETEDBYAGENT';logger[_0x1609('0x6c')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x14a0a0[_0x1609('0x4a')],_0x14a0a0['type']);}}}catch(_0x374723){logger[_0x1609('0x3a')]('[%s][voiceQueueReport][agentconnect]',_0x12ff57[_0x1609('0x47')],util[_0x1609('0x3c')](_0x374723,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1609('0xb')][_0x1609('0x8e')]=function(_0x548254){try{if(this['isNotNull'](_0x548254)){logger[_0x1609('0x44')](_0x1609('0x8f'),_0x548254['uniqueid'],util[_0x1609('0x3c')](_0x548254,{'showHidden':![],'depth':null}));if(this[_0x1609('0xe')][_0x548254[_0x1609('0x47')]]){var _0x2c98cc=_[_0x1609('0x83')](this[_0x1609('0xe')][_0x548254[_0x1609('0x47')]]);_0x2c98cc[_0x1609('0x19')]=![];_0x2c98cc[_0x1609('0x90')]=null;_0x2c98cc[_0x1609('0x91')]=!![];_0x2c98cc[_0x1609('0x92')]=_0x548254[_0x1609('0x93')];_0x2c98cc[_0x1609('0x85')]=_0x548254[_0x1609('0x85')];_0x2c98cc[_0x1609('0x84')]=!![];_0x2c98cc['queuecallerexit']=![];_0x2c98cc[_0x1609('0x94')]=null;if(!_0x2c98cc[_0x1609('0x95')]){if(_0x548254[_0x1609('0x96')]=='transfer'){_0x2c98cc[_0x1609('0x87')]=_0x1609('0x97');logger[_0x1609('0x6c')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x2c98cc['name'],_0x2c98cc[_0x1609('0x53')]);}else{if(_[_0x1609('0x98')](_0x548254[_0x1609('0x37')][_0x1609('0x99')](),_0x1609('0x9a'))){if(this[_0x1609('0xe')][_0x548254[_0x1609('0x9b')]]){var _0x2b215d=_['last'](this[_0x1609('0xe')][_0x548254[_0x1609('0x9b')]]);_0x2b215d[_0x1609('0x84')]=![];_0x2b215d['queuecallerexit']=!![];_0x2b215d[_0x1609('0x94')]=moment(_0x2c98cc[_0x1609('0x78')])[_0x1609('0x9c')](_0x548254[_0x1609('0x85')],_0x1609('0x9d'))['format'](_0x1609('0x79'));_0x2b215d[_0x1609('0x87')]=_0x1609('0x9e');_0x2b215d['transfer']=!![];_0x2b215d[_0x1609('0x9f')]=_0x1609('0xa0');_0x2b215d[_0x1609('0xa1')]=_0x548254[_0x1609('0xa2')];_0x2b215d[_0x1609('0xa3')]=_0x548254[_0x1609('0x47')];logger[_0x1609('0x6c')](_0x1609('0xa4'),_0x2b215d[_0x1609('0x4a')],_0x2b215d[_0x1609('0x53')]);var _0x1350f0=this[_0x1609('0xe')][_0x548254['linkedid']];this[_0x1609('0xe')][_0x548254['linkedid']]=this[_0x1609('0xe')][_0x548254[_0x1609('0x47')]];this[_0x1609('0xe')][_0x548254[_0x1609('0x47')]]=_0x1350f0;}}else{_0x2c98cc['queuecallerexitreason']=_0x1609('0xa5')+_0x548254[_0x1609('0x96')][_0x1609('0xa6')]();logger[_0x1609('0x6c')](_0x1609('0xa7'),_0x2c98cc[_0x1609('0x4a')],_0x2c98cc[_0x1609('0x53')],_0x2c98cc[_0x1609('0x87')]);}}}this[_0x1609('0x10')][_0x548254['uniqueid']]=_0x2c98cc;this['emitVoiceQueueChannelRemove'](_0x2c98cc,_0x1609('0xa8'));}}}catch(_0xf32f8f){logger[_0x1609('0x3a')]('[%s][voiceQueueReport][agentcomplete]',_0x548254['uniqueid'],util[_0x1609('0x3c')](_0xf32f8f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1609('0xb')][_0x1609('0x1f')]=function(_0x109794){try{if(this[_0x1609('0x69')](_0x109794)){logger[_0x1609('0x44')](_0x1609('0xa9'),_0x109794[_0x1609('0x47')],util[_0x1609('0x3c')](_0x109794,{'showHidden':![],'depth':null}));this[_0x1609('0xaa')](_0x109794['uniqueid'],_[_0x1609('0x80')](_0x109794[_0x1609('0xab')])[0x0],_0x109794[_0x1609('0xac')]);if(this[_0x1609('0xe')][_0x109794[_0x1609('0x47')]]){var _0x158ad8=_[_0x1609('0x83')](this[_0x1609('0xe')][_0x109794[_0x1609('0x47')]]);if(_0x158ad8){if(this[_0x1609('0x69')](_0x109794[_0x1609('0xab')])&&this[_0x1609('0x69')](_0x109794[_0x1609('0xab')][_0x1609('0xad')])){switch(_0x109794[_0x1609('0xac')]){case'CONTINUE':_0x158ad8[_0x1609('0xae')]=![];_0x158ad8[_0x1609('0x94')]=null;break;case _0x1609('0xaf'):_0x158ad8[_0x1609('0xb0')]=_0x1609('0xb1');_0x158ad8[_0x1609('0xae')]=!![];_0x158ad8[_0x1609('0x94')]=moment()[_0x1609('0x49')](_0x1609('0x79'));_0x158ad8[_0x1609('0xb2')]=moment()[_0x1609('0x49')](_0x1609('0x79'));logger[_0x1609('0x44')](_0x1609('0xb3'),_0x109794['uniqueid'],util[_0x1609('0x3c')](_0x158ad8,{'showHidden':![],'depth':null}));ami[_0x1609('0x48')](_0x1609('0xb4'),_0x158ad8);break;default:_0x158ad8['queuecallerexit']=!![];_0x158ad8['queuecallerexitAt']=moment()[_0x1609('0x49')](_0x1609('0x79'));_0x158ad8[_0x1609('0xb2')]=moment()[_0x1609('0x49')](_0x1609('0x79'));}_0x158ad8[_0x1609('0x19')]=![];_0x158ad8['queuecallerabandonAt']=null;_0x158ad8[_0x1609('0x87')]=_0x109794[_0x1609('0xac')];this[_0x1609('0x10')][_0x109794['uniqueid']]=_0x158ad8;this['emitVoiceQueueChannelRemove'](_0x158ad8,_0x1609('0x1e'));}else if(this['isNotNull'](_0x109794[_0x1609('0xab')])&&this[_0x1609('0x69')](_0x109794[_0x1609('0xab')][_0x1609('0xb5')])){if(!_0x158ad8['queuecallerabandon']){_0x158ad8[_0x1609('0xae')]=!![];_0x158ad8['queuecallerexitAt']=moment()[_0x1609('0x49')](_0x1609('0x79'));_0x158ad8[_0x1609('0x87')]=_0x1609('0xb6');_0x158ad8[_0x1609('0xb2')]=moment()[_0x1609('0x49')](_0x1609('0x79'));this[_0x1609('0x10')][_0x109794['uniqueid']]=_0x158ad8;}}logger[_0x1609('0x6c')](_0x1609('0xb7'),_0x109794['uniqueid'],_0x158ad8[_0x1609('0x4a')],_0x158ad8[_0x1609('0x53')],_[_0x1609('0x80')](_0x109794[_0x1609('0xab')])[0x0],_0x109794[_0x1609('0xac')]);_0x158ad8[_0x1609('0x3d')]=this['variables'][_0x109794[_0x1609('0x47')]];}}}}catch(_0x4a4536){logger[_0x1609('0x3a')]('[%s][voiceQueueReport][varset]',_0x109794['uniqueid'],util[_0x1609('0x3c')](_0x4a4536,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0x5e04e6,_0x522322,_0x43c2a9){var _0xb90b14=['rtpaudioqos',_0x1609('0xb8'),_0x1609('0xb9'),_0x1609('0xba'),'rtpaudioqosloss',_0x1609('0xbb'),_0x1609('0xbc'),_0x1609('0xbd'),_0x1609('0xbe'),'sipuri',_0x1609('0xbf'),'bridgepvtcallid',_0x1609('0xc0'),'memberdynamic','memberinterface',_0x1609('0xc1'),_0x1609('0x93'),'memberpenalty','memberrealtime'];if(!_[_0x1609('0x36')](_0x522322)&&!_[_0x1609('0xc2')](_0xb90b14,_0x522322)){if(_[_0x1609('0x62')](this[_0x1609('0x3d')][_0x5e04e6])){this['variables'][_0x5e04e6]={};}this[_0x1609('0x3d')][_0x5e04e6][_0x522322]=_0x43c2a9;}};VoiceQueueReport[_0x1609('0xb')][_0x1609('0xc3')]=function(_0x15b17c,_0x569039,_0x1b68f1){var _0x25093e={};for(var _0x26660f=0x0;_0x26660f<this[_0x1609('0xe')][_0x15b17c]['length'];_0x26660f+=0x1){_0x25093e=this[_0x1609('0xe')][_0x15b17c][_0x26660f];if(this[_0x1609('0x12')][_0x25093e[_0x1609('0x6a')]]){if(_0x25093e[_0x1609('0xae')]&&_0x25093e['transfer']!=!![]){this['voiceQueues'][_0x25093e[_0x1609('0x6a')]][_0x1609('0xc4')]+=0x1;}if(_0x25093e[_0x1609('0x19')]){this[_0x1609('0x12')][_0x25093e['queue']][_0x1609('0xc5')]+=0x1;}this[_0x1609('0x12')][_0x25093e[_0x1609('0x6a')]]['sumHoldTime']+=moment(_0x25093e[_0x1609('0xb2')])[_0x1609('0xc6')](_0x25093e['queuecallerjoinAt'],_0x1609('0x9d'))||0x0;if(_0x26660f===this[_0x1609('0xe')][_0x15b17c][_0x1609('0xc7')]-0x1){this[_0x1609('0x12')][_0x25093e[_0x1609('0x6a')]][_0x1609('0x58')]+=moment()[_0x1609('0xc8')](0x0)[_0x1609('0xc6')](_0x25093e['queuecallerjoinAt'],_0x1609('0x9d'));this[_0x1609('0x12')][_0x25093e[_0x1609('0x6a')]][_0x1609('0x5a')]+=0x1;if(_0x25093e[_0x1609('0x84')]){this[_0x1609('0x12')][_0x25093e[_0x1609('0x6a')]][_0x1609('0xc9')]+=0x1;this[_0x1609('0x12')][_0x25093e[_0x1609('0x6a')]]['sumBillable']+=moment()['milliseconds'](0x0)[_0x1609('0xc6')](_0x25093e[_0x1609('0xb2')],'seconds');_0x25093e[_0x1609('0xca')]=moment()[_0x1609('0x49')]('YYYY-MM-DD\x20HH:mm:ss');_0x25093e['queuecallerexit']=![];_0x25093e[_0x1609('0x94')]=null;}if(_0x25093e[_0x1609('0xae')]&&_0x25093e[_0x1609('0x95')]!=!![]){_0x25093e['lastevent']=_0x1609('0xc4');logger[_0x1609('0x44')](_0x1609('0xcb'),_0x15b17c,util[_0x1609('0x3c')](_0x25093e,{'showHidden':![],'depth':null}));ami[_0x1609('0x48')](_0x1609('0xcc'),_0x25093e);}if(_0x25093e['queuecallerabandon']){_0x25093e[_0x1609('0xb0')]=_0x1609('0xc5');logger[_0x1609('0x44')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x15b17c,util['inspect'](_0x25093e,{'showHidden':![],'depth':null}));ami[_0x1609('0x48')](_0x1609('0xcd'),_0x25093e);}}else{this[_0x1609('0x12')][_0x25093e[_0x1609('0x6a')]]['sumDuration']+=this['voiceQueues'][_0x25093e[_0x1609('0x6a')]]['sumHoldTime'];}logger[_0x1609('0x6c')](_0x1609('0xce'),_0x15b17c,_0x25093e[_0x1609('0x4a')],_0x25093e['type'],_0x569039);if(_0x1b68f1&&_0x25093e[_0x1609('0x87')]===_0x1609('0x4e')){_0x25093e[_0x1609('0x87')]=_0x1609('0xcf');}this['channels'][_0x15b17c]=_0x25093e;this[_0x1609('0x41')](_0x25093e,'hangup');this[_0x1609('0x52')](this[_0x1609('0x12')][_0x25093e['queue']],_0x1609('0x20'));}}logger[_0x1609('0x44')](_0x1609('0xd0'),_0x15b17c,util[_0x1609('0x3c')](this[_0x1609('0xe')][_0x15b17c],{'showHidden':![],'depth':null}));ami[_0x1609('0x48')](_0x1609('0xd1'),this['queueReports'][_0x15b17c]);if(_0x25093e['queuecallerexitreason']===_0x1609('0x4e'))return;delete this[_0x1609('0xe')][_0x15b17c];delete this['channels'][_0x15b17c];if(this[_0x1609('0x3d')][_0x15b17c]){delete this[_0x1609('0x3d')][_0x15b17c];}};VoiceQueueReport['prototype'][_0x1609('0x21')]=function(_0x23a996){try{if(this[_0x1609('0x69')](_0x23a996)){logger[_0x1609('0x44')]('[%s][voiceQueueReport][hangup]',_0x23a996['uniqueid'],util[_0x1609('0x3c')](_0x23a996,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x23a996[_0x1609('0x47')]]){return this[_0x1609('0xc3')](_0x23a996[_0x1609('0x47')],_0x23a996[_0x1609('0xd2')]);}if(this[_0x1609('0xe')][_0x23a996['linkedid']]){if(_0x23a996[_0x1609('0xd3')]==='21'){return;}return this['handleHangup'](_0x23a996[_0x1609('0x9b')],_0x23a996[_0x1609('0xd2')],!![]);}var _0x5d2b74=Object[_0x1609('0x80')](this[_0x1609('0xe')]);for(var _0x3a14f1=0x0;_0x3a14f1<_0x5d2b74[_0x1609('0xc7')];_0x3a14f1++){var _0x271455=_[_0x1609('0x83')](this['queueReports'][_0x5d2b74[_0x3a14f1]]);if(_0x271455&&_0x271455[_0x1609('0xd4')]===_0x23a996[_0x1609('0x47')]){return this['handleHangup'](_0x271455[_0x1609('0x47')],_0x23a996[_0x1609('0xd2')],!![]);}}}}catch(_0x10449f){logger[_0x1609('0x3a')](_0x1609('0xd5'),_0x23a996[_0x1609('0x47')],util[_0x1609('0x3c')](_0x10449f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1609('0xb')][_0x1609('0xd6')]=function(_0x2299e1){try{if(this['isNotNull'](_0x2299e1)){logger[_0x1609('0x44')](_0x1609('0xd7'),_0x2299e1['uniqueid'],util[_0x1609('0x3c')](_0x2299e1,{'showHidden':![],'depth':null}));var _0x530958;var _0x1b254f;var _0x379221;if(this[_0x1609('0xe')][_0x2299e1[_0x1609('0xd8')]]){_0x530958=_[_0x1609('0x83')](this[_0x1609('0xe')][_0x2299e1[_0x1609('0xd8')]]);_0x530958['transferexten']=_0x2299e1[_0x1609('0xd9')];_0x530958['transferuniqueid']=_0x2299e1[_0x1609('0xda')];_0x530958[_0x1609('0x87')]=_0x1609('0x4e');_0x530958['transfer']=!![];_0x530958[_0x1609('0x9f')]=_0x1609('0xdb');if(this[_0x1609('0xe')][_0x2299e1['secondtransfereruniqueid']]){_0x379221=this[_0x1609('0xe')][_0x2299e1[_0x1609('0xda')]];this[_0x1609('0xe')][_0x2299e1[_0x1609('0xda')]]=this[_0x1609('0xe')][_0x2299e1['transfereeuniqueid']];this['queueReports'][_0x2299e1[_0x1609('0xd8')]]=_0x379221;_0x1b254f=_[_0x1609('0x83')](this[_0x1609('0xe')][_0x2299e1['transfereeuniqueid']]);_0x1b254f['switch']=!![];}logger[_0x1609('0x6c')](_0x1609('0xdc'),_0x2299e1['uniqueid'],_0x530958[_0x1609('0x4a')],_0x530958[_0x1609('0x53')],_0x530958['transferexten'],_0x530958['transferuniqueid']);}else if(this[_0x1609('0xe')][_0x2299e1['transfertargetuniqueid']]){_0x530958=_['last'](this[_0x1609('0xe')][_0x2299e1[_0x1609('0xdd')]]);_0x530958[_0x1609('0xa1')]=_0x2299e1[_0x1609('0xde')];_0x530958[_0x1609('0xa3')]=_0x2299e1[_0x1609('0xdf')];_0x530958['queuecallerexitreason']=_0x1609('0x4e');_0x530958[_0x1609('0x95')]=!![];_0x530958[_0x1609('0x9f')]='ATTENDED';if(this[_0x1609('0xe')][_0x2299e1[_0x1609('0xdf')]]){_0x379221=this['queueReports'][_0x2299e1[_0x1609('0xdf')]];this[_0x1609('0xe')][_0x2299e1[_0x1609('0xdf')]]=this[_0x1609('0xe')][_0x2299e1[_0x1609('0xdd')]];this[_0x1609('0xe')][_0x2299e1[_0x1609('0xdd')]]=_0x379221;_0x1b254f=_[_0x1609('0x83')](this[_0x1609('0xe')][_0x2299e1[_0x1609('0xdd')]]);_0x1b254f[_0x1609('0xe0')]=!![];}logger[_0x1609('0x6c')](_0x1609('0xdc'),_0x2299e1[_0x1609('0x47')],_0x530958[_0x1609('0x4a')],_0x530958['type'],_0x530958[_0x1609('0xa1')],_0x530958[_0x1609('0xa3')]);}else if(this[_0x1609('0xe')][_0x2299e1[_0x1609('0xdf')]]){_0x530958=_[_0x1609('0x83')](this[_0x1609('0xe')][_0x2299e1['origtransfereruniqueid']]);_0x530958[_0x1609('0xa1')]=_0x2299e1[_0x1609('0xde')];_0x530958[_0x1609('0xa3')]=_0x2299e1[_0x1609('0xdf')];_0x530958['queuecallerexitreason']=_0x1609('0x4e');_0x530958[_0x1609('0x95')]=!![];_0x530958[_0x1609('0x9f')]=_0x1609('0xdb');_0x530958['switch']=!![];_0x530958[_0x1609('0xd4')]=_0x2299e1[_0x1609('0xd8')];}else if(this[_0x1609('0xe')][_0x2299e1[_0x1609('0xda')]]){_0x530958=_[_0x1609('0x83')](this[_0x1609('0xe')][_0x2299e1[_0x1609('0xda')]]);_0x530958[_0x1609('0xa1')]=_0x2299e1[_0x1609('0xd9')];_0x530958['transferuniqueid']=_0x2299e1['secondtransfereruniqueid'];_0x530958[_0x1609('0x87')]='ATTENDEDTRANSFER';_0x530958['transfer']=!![];_0x530958[_0x1609('0x9f')]='ATTENDED';_0x530958[_0x1609('0xe0')]=!![];_0x530958[_0x1609('0xd4')]=_0x2299e1[_0x1609('0xdd')];}}}catch(_0x1566a0){logger[_0x1609('0x3a')]('[%s][voiceQueueReport][attendedtransfer]',_0x2299e1[_0x1609('0x47')],util['inspect'](_0x1566a0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1609('0xb')][_0x1609('0x29')]=function(_0x54b4ba){try{if(this[_0x1609('0x69')](_0x54b4ba)){logger[_0x1609('0x44')](_0x1609('0xe1'),_0x54b4ba['uniqueid'],util[_0x1609('0x3c')](_0x54b4ba,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x54b4ba[_0x1609('0xd8')]]){var _0x1d2d14=_['last'](this[_0x1609('0xe')][_0x54b4ba[_0x1609('0xd8')]]);_0x1d2d14['queuecallerexitreason']=_0x1609('0xe2');_0x1d2d14['transfer']=!![];_0x1d2d14[_0x1609('0x9f')]=_0x1609('0xe3');_0x1d2d14[_0x1609('0xa1')]=_0x54b4ba['extension'];_0x1d2d14[_0x1609('0xa3')]=_0x54b4ba[_0x1609('0xd8')];logger['info'](_0x1609('0xe4'),_0x54b4ba[_0x1609('0x47')],_0x1d2d14['name'],_0x1d2d14[_0x1609('0x53')],_0x1d2d14[_0x1609('0xa1')],_0x1d2d14[_0x1609('0xa3')]);this[_0x1609('0x21')]({'event':_0x1609('0xe5'),'uniqueid':_0x54b4ba[_0x1609('0xd8')],'context':_0x54b4ba[_0x1609('0xe6')],'channel':_0x54b4ba[_0x1609('0xe7')]});}}}catch(_0x4287d){logger['error'](_0x1609('0xe1'),_0x54b4ba['uniqueid'],util[_0x1609('0x3c')](_0x4287d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1609('0xb')][_0x1609('0x24')]=function(_0x2c04a1){try{if(this['isNotNull'](_0x2c04a1)){logger[_0x1609('0x44')](_0x1609('0xe8'),_0x2c04a1[_0x1609('0x47')],util[_0x1609('0x3c')](_0x2c04a1,{'showHidden':![],'depth':null}));if(this[_0x1609('0xe')][_0x2c04a1[_0x1609('0x47')]]){var _0x44b8f8=_[_0x1609('0x83')](this[_0x1609('0xe')][_0x2c04a1['uniqueid']]);if(!_[_0x1609('0x36')](_0x44b8f8[_0x1609('0xb2')])){_0x44b8f8[_0x1609('0xe9')]=moment()[_0x1609('0x49')](_0x1609('0x79'));logger[_0x1609('0x6c')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x2c04a1[_0x1609('0x47')],_0x44b8f8[_0x1609('0xe9')]);}}}}catch(_0x143a05){logger[_0x1609('0x3a')](_0x1609('0xe8'),_0x2c04a1['uniqueid'],util[_0x1609('0x3c')](_0x143a05,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1609('0xb')][_0x1609('0x26')]=function(_0x347862){try{if(this['isNotNull'](_0x347862)){logger[_0x1609('0x44')]('[%s][voiceQueueReport][musiconholdstop]',_0x347862[_0x1609('0x47')],util[_0x1609('0x3c')](_0x347862,{'showHidden':![],'depth':null}));if(this[_0x1609('0xe')][_0x347862[_0x1609('0x47')]]){var _0x2ae5dc=_[_0x1609('0x83')](this[_0x1609('0xe')][_0x347862[_0x1609('0x47')]]);if(!_[_0x1609('0x36')](_0x2ae5dc[_0x1609('0xe9')])){_0x2ae5dc[_0x1609('0xea')]+=moment()[_0x1609('0xc8')](0x0)[_0x1609('0xc6')](_0x2ae5dc[_0x1609('0xe9')],_0x1609('0x9d'));logger['info']('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x347862[_0x1609('0x47')],_0x2ae5dc[_0x1609('0xea')]);delete _0x2ae5dc['mohstarttime'];}}}}catch(_0x14dfa6){logger[_0x1609('0x3a')]('[%s][voiceQueueReport][musiconholdstop]',_0x347862[_0x1609('0x47')],util[_0x1609('0x3c')](_0x14dfa6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1609('0xb')][_0x1609('0xeb')]=function(_0x5c4e25){try{if(this[_0x1609('0x69')](_0x5c4e25)){logger[_0x1609('0x44')]('[%s][voiceQueueReport][newexten]\x20event:',_0x5c4e25[_0x1609('0x47')],util[_0x1609('0x3c')](_0x5c4e25,{'showHidden':![],'depth':null}));if(_0x5c4e25[_0x1609('0xec')][_0x1609('0x99')]()===_0x1609('0xed')){_0x5c4e25[_0x1609('0xee')]=_0x5c4e25[_0x1609('0xef')]&&_0x5c4e25[_0x1609('0xef')]['startsWith'](_0x1609('0xf0'))?_0x5c4e25[_0x1609('0xef')]:(_0x5c4e25[_0x1609('0xef')]||_0x5c4e25[_0x1609('0xee')])['toLowerCase']();if(_[_0x1609('0x98')](_0x5c4e25[_0x1609('0xee')][_0x1609('0x99')](),_0x1609('0xf1'))){logger['info'](_0x1609('0xf2'),_0x5c4e25[_0x1609('0x47')],_0x5c4e25[_0x1609('0xec')],_0x5c4e25[_0x1609('0xee')]);if(_[_0x1609('0x62')](this[_0x1609('0x10')][_0x5c4e25[_0x1609('0x47')]]))this[_0x1609('0x10')][_0x5c4e25['uniqueid']]={};var _0x13aac9=_0x5c4e25[_0x1609('0xee')][_0x1609('0xf3')]('=');var _0xcd270f=_0x13aac9[0x0]['toLowerCase']()[_0x1609('0xf4')](/cdr\((.*)\)/);if(_0xcd270f)this[_0x1609('0x10')][_0x5c4e25['uniqueid']][_0xcd270f[0x1]]=_0x13aac9[0x1];}}}}catch(_0x34af27){logger[_0x1609('0x3a')](_0x1609('0xf5'),_0x5c4e25[_0x1609('0x47')],util[_0x1609('0x3c')](_0x34af27,{'showHidden':![],'depth':null}));}};module[_0x1609('0xf6')]=VoiceQueueReport;
\ No newline at end of file
index ea33f59..abcb040 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8dd=['../client','campaign','queue','Request','CreateReportAgentPreview'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd8dd,0x172));var _0xdd8d=function(_0x2f52d1,_0x3d3f0f){_0x2f52d1=_0x2f52d1-0x0;var _0x48b238=_0xd8dd[_0x2f52d1];return _0x48b238;};'use strict';var client=require(_0xdd8d('0x0'));exports['createHistory']=function(_0x2c658a){return function(){_0x2c658a[_0xdd8d('0x1')]=_0x2c658a[_0xdd8d('0x2')];return client[_0xdd8d('0x3')](_0xdd8d('0x4'),{'body':_0x2c658a,'log':_0xdd8d('0x4')});};};
\ No newline at end of file
+var _0x7a8f=['campaign','queue','Request','CreateReportAgentPreview','../client'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x7a8f,0x10d));var _0xf7a8=function(_0x2c7f00,_0x57e2c3){_0x2c7f00=_0x2c7f00-0x0;var _0x2bcf8f=_0x7a8f[_0x2c7f00];return _0x2bcf8f;};'use strict';var client=require(_0xf7a8('0x0'));exports['createHistory']=function(_0x4ec9d1){return function(){_0x4ec9d1[_0xf7a8('0x1')]=_0x4ec9d1[_0xf7a8('0x2')];return client[_0xf7a8('0x3')](_0xf7a8('0x4'),{'body':_0x4ec9d1,'log':_0xf7a8('0x4')});};};
\ No newline at end of file
index cf4906e..3363af2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';var client=require('../client');exports['create']=function(_0x216499){return client['Request']('CreateAttachment',{'body':_0x216499,'log':'CreateAttachment'});};
\ No newline at end of file
+var _0xaa61=['../client','create','Request','CreateAttachment'];(function(_0x1daaa9,_0x220393){var _0x1dd221=function(_0x492c61){while(--_0x492c61){_0x1daaa9['push'](_0x1daaa9['shift']());}};_0x1dd221(++_0x220393);}(_0xaa61,0x1cc));var _0x1aa6=function(_0x5d1c8c,_0x4b4bdb){_0x5d1c8c=_0x5d1c8c-0x0;var _0x40dc42=_0xaa61[_0x5d1c8c];return _0x40dc42;};'use strict';var client=require(_0x1aa6('0x0'));exports[_0x1aa6('0x1')]=function(_0x294d64){return client[_0x1aa6('0x2')]('CreateAttachment',{'body':_0x294d64,'log':_0x1aa6('0x3')});};
\ No newline at end of file
index d401f4d..fec45af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['Trunk','active','TrunkBackup','callerid','Interval','Intervals','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','name','type','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalInterval','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit'];(function(_0x13dc4b,_0x4635e8){var _0x25626d=function(_0x21b6e1){while(--_0x21b6e1){_0x13dc4b['push'](_0x13dc4b['shift']());}};_0x25626d(++_0x4635e8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0xc4aa[_0x4ff09b];return _0x3f5c2e;};'use strict';var client=require(_0xac4a('0x0'));exports[_0xac4a('0x1')]=function(){return function(){return client[_0xac4a('0x2')](_0xac4a('0x3'),{'options':{'raw':![],'attributes':['id',_0xac4a('0x4'),_0xac4a('0x5'),'active','limitCalls','dialOriginateCallerIdName',_0xac4a('0x6'),_0xac4a('0x7'),_0xac4a('0x8'),_0xac4a('0x9'),_0xac4a('0xa'),_0xac4a('0xb'),_0xac4a('0xc'),_0xac4a('0xd'),'dialGlobalMaxRetry','dialNoSuchNumberMaxRetry',_0xac4a('0xe'),_0xac4a('0xf'),_0xac4a('0x10'),'dialAbandonedMaxRetry',_0xac4a('0x11'),_0xac4a('0x12'),_0xac4a('0x13'),'dialAgentRejectMaxRetry',_0xac4a('0x14'),'dialTimezone',_0xac4a('0x15'),'dialAMDActive',_0xac4a('0x16'),_0xac4a('0x17'),_0xac4a('0x18'),'dialAMDTotalAnalysisTime',_0xac4a('0x19'),_0xac4a('0x1a'),_0xac4a('0x1b'),_0xac4a('0x1c'),_0xac4a('0x1d'),_0xac4a('0x1e'),_0xac4a('0x1f'),_0xac4a('0x20'),_0xac4a('0x21')],'include':[{'model':_0xac4a('0x22'),'as':_0xac4a('0x22'),'attributes':['id',_0xac4a('0x4'),'callerid',_0xac4a('0x23')]},{'model':_0xac4a('0x22'),'as':_0xac4a('0x24'),'attributes':['id',_0xac4a('0x4'),_0xac4a('0x25'),_0xac4a('0x23')]},{'model':_0xac4a('0x26'),'as':_0xac4a('0x26'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0xac4a('0x27'),'attributes':['id',_0xac4a('0x4'),_0xac4a('0x28')]}]},{'model':'SquareProject','as':_0xac4a('0x29'),'attributes':['id',_0xac4a('0x4')]}]},'log':_0xac4a('0x2a')});};};
\ No newline at end of file
+var _0x1261=['Interval','interval','SquareProject','getCampaign','getCampaigns','Request','GetCampaign','name','type','active','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialGlobalInterval','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','TrunkBackup','callerid'];(function(_0x2c30a2,_0x52d5f7){var _0x4c6d5b=function(_0xd1bc1e){while(--_0xd1bc1e){_0x2c30a2['push'](_0x2c30a2['shift']());}};_0x4c6d5b(++_0x52d5f7);}(_0x1261,0x144));var _0x1126=function(_0x1c33dc,_0x177c7e){_0x1c33dc=_0x1c33dc-0x0;var _0x405580=_0x1261[_0x1c33dc];return _0x405580;};'use strict';var client=require('../client');exports[_0x1126('0x0')]=function(){return function(){return client[_0x1126('0x1')](_0x1126('0x2'),{'options':{'raw':![],'attributes':['id',_0x1126('0x3'),_0x1126('0x4'),_0x1126('0x5'),_0x1126('0x6'),_0x1126('0x7'),_0x1126('0x8'),_0x1126('0x9'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x1126('0xa'),_0x1126('0xb'),'dialNoAnswerMaxRetry',_0x1126('0xc'),_0x1126('0xd'),_0x1126('0xe'),_0x1126('0xf'),_0x1126('0x10'),'dialDropRetryFrequency',_0x1126('0x11'),_0x1126('0x12'),_0x1126('0x13'),'dialMachineRetryFrequency',_0x1126('0x14'),'dialAgentRejectRetryFrequency','dialTimezone',_0x1126('0x15'),'dialAMDActive',_0x1126('0x16'),_0x1126('0x17'),_0x1126('0x18'),_0x1126('0x19'),_0x1126('0x1a'),_0x1126('0x1b'),_0x1126('0x1c'),_0x1126('0x1d'),_0x1126('0x1e'),'dialOrderByScheduledAt','dialPrefix',_0x1126('0x1f'),_0x1126('0x20')],'include':[{'model':_0x1126('0x21'),'as':'Trunk','attributes':['id',_0x1126('0x3'),'callerid',_0x1126('0x5')]},{'model':_0x1126('0x21'),'as':_0x1126('0x22'),'attributes':['id','name',_0x1126('0x23'),_0x1126('0x5')]},{'model':'Interval','as':'Interval','attributes':['id',_0x1126('0x3')],'include':[{'model':_0x1126('0x24'),'as':'Intervals','attributes':['id','name',_0x1126('0x25')]}]},{'model':'SquareProject','as':_0x1126('0x26'),'attributes':['id',_0x1126('0x3')]}]},'log':_0x1126('0x27')});};};
\ No newline at end of file
index bd6efd8..3ddfea2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae01=['getContacts','GetCmContact','../client','createContact','Request','CreateCmContact'];(function(_0x1ca6a9,_0x36788d){var _0x213a50=function(_0x1db8b5){while(--_0x1db8b5){_0x1ca6a9['push'](_0x1ca6a9['shift']());}};_0x213a50(++_0x36788d);}(_0xae01,0x122));var _0x1ae0=function(_0x1fb699,_0x280673){_0x1fb699=_0x1fb699-0x0;var _0x5272bb=_0xae01[_0x1fb699];return _0x5272bb;};'use strict';var client=require(_0x1ae0('0x0'));exports[_0x1ae0('0x1')]=function(_0x494823){return function(){return client[_0x1ae0('0x2')](_0x1ae0('0x3'),{'body':_0x494823,'log':_0x1ae0('0x3')});};};exports[_0x1ae0('0x4')]=function(_0x16a981){return function(){return client[_0x1ae0('0x2')](_0x1ae0('0x5'),{'options':_0x16a981,'log':'GetCmContact'});};};
\ No newline at end of file
+var _0xb82a=['createContact','Request','CreateCmContact','getContacts','GetCmContact','../client'];(function(_0x242f4d,_0x5ee66c){var _0x281b98=function(_0xacdcda){while(--_0xacdcda){_0x242f4d['push'](_0x242f4d['shift']());}};_0x281b98(++_0x5ee66c);}(_0xb82a,0x149));var _0xab82=function(_0x4eadd3,_0x41e40d){_0x4eadd3=_0x4eadd3-0x0;var _0x167e9d=_0xb82a[_0x4eadd3];return _0x167e9d;};'use strict';var client=require(_0xab82('0x0'));exports[_0xab82('0x1')]=function(_0x47af66){return function(){return client[_0xab82('0x2')]('CreateCmContact',{'body':_0x47af66,'log':_0xab82('0x3')});};};exports[_0xab82('0x4')]=function(_0x55f61d){return function(){return client[_0xab82('0x2')](_0xab82('0x5'),{'options':_0x55f61d,'log':_0xab82('0x5')});};};
\ No newline at end of file
index 6b3545b..563038a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc208=['getContactDialerIvr','CmContact','Contact','GetContactDialerIvr','moveContactManagedDialer','MoveContactManagedDialer','VoiceQueueId','CampaignId','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview','User','Agent','name','VoiceQueue','Queue','getCmHopper','getContactRecallMe','GetContactRecallMe','ASC','voicePause','db.CmHopper.UserId','resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','../client','moment','getContacts','GetCmHopper','Request','UpdateCmHopper','format','rescheduleContact','ContactId','ListId','DestroyCmHopper','getContactDialer','GetContactDialer','YYYY-MM-DD\x20HH:mm:ss','priority','DESC','scheduledat'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xc208,0x147));var _0x8c20=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc208[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x8c20('0x0'));var moment=require(_0x8c20('0x1'));exports[_0x8c20('0x2')]=function(_0x4b295c,_0x58da0c){return function(){return client['Request'](_0x8c20('0x3'),{'options':{'where':{'VoiceQueueId':_0x4b295c},'include':[{'model':'CmContact','as':'Contact'}],'limit':_0x58da0c,'raw':![]},'log':'getCmHopper'});};};exports['updateContacts']=function(_0x55fbf9,_0x252300,_0x410a32){return function(){return client[_0x8c20('0x4')](_0x8c20('0x5'),{'body':_0x55fbf9,'options':{'where':{'VoiceQueueId':_0x252300,'scheduledat':{'$lte':moment()[_0x8c20('0x6')]('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x410a32},'log':_0x8c20('0x5')});};};exports[_0x8c20('0x7')]=function(_0x2d6bee){return function(){return client[_0x8c20('0x4')]('UpdateCmHopper',{'body':_0x2d6bee,'options':{'where':{'ContactId':_0x2d6bee[_0x8c20('0x8')],'ListId':_0x2d6bee[_0x8c20('0x9')],'VoiceQueueId':_0x2d6bee['VoiceQueueId'],'CampaignId':_0x2d6bee['CampaignId']}},'log':_0x8c20('0x7')});};};exports['destroyContact']=function(_0x31b920,_0x568cf6,_0x1fb2c5){return function(){return client[_0x8c20('0x4')](_0x8c20('0xa'),{'options':{'where':{'VoiceQueueId':_0x31b920,'ListId':_0x568cf6,'ContactId':_0x1fb2c5}},'log':'DestroyCmHopper'});};};exports[_0x8c20('0xb')]=function(_0x3dac30,_0x18d7ec,_0x492f7f,_0x78dd3d){return function(){return client[_0x8c20('0x4')](_0x8c20('0xc'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x3dac30,'active':![],'scheduledat':{'$lte':moment()[_0x8c20('0x6')](_0x8c20('0xd'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x18d7ec}}]},'order':[[_0x8c20('0xe'),_0x8c20('0xf')],[_0x8c20('0x10'),_0x78dd3d],['id','ASC']],'raw':!![],'limit':_0x492f7f},'log':'GetContactDialer'});};};exports[_0x8c20('0x11')]=function(_0x2719bf,_0x4099be,_0x43e0dd){return function(){return client['Request'](_0x8c20('0xc'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x2719bf,'active':![],'scheduledat':{'$lte':moment()[_0x8c20('0x6')]('YYYY-MM-DD\x20HH:mm:ss')}},'include':[{'model':_0x8c20('0x12'),'as':_0x8c20('0x13')}],'order':[[_0x8c20('0xe'),_0x8c20('0xf')],['scheduledat',_0x43e0dd],['id','ASC']],'raw':!![],'limit':_0x4099be},'log':_0x8c20('0x14')});};};exports[_0x8c20('0x15')]=function(_0x1740f3,_0xe8f271){return function(){_0x1740f3['campaign']=_0x1740f3['queue'];return client['Request'](_0x8c20('0x16'),{'body':_0x1740f3,'options':{'where':{'ContactId':_0x1740f3[_0x8c20('0x8')],'ListId':_0x1740f3[_0x8c20('0x9')],'VoiceQueueId':_0x1740f3[_0x8c20('0x17')],'CampaignId':_0x1740f3[_0x8c20('0x18')],'active':_0xe8f271?undefined:!![]}},'log':'MoveContactManagedDialer'});};};exports[_0x8c20('0x19')]=function(_0x3cde01){return function(){return client[_0x8c20('0x4')](_0x8c20('0x1a'),{'options':{'where':{'VoiceQueueId':_0x3cde01['id']?_0x3cde01['id']||null:null}},'log':_0x8c20('0x19')});};};exports[_0x8c20('0x1b')]=function(_0x2670a7){return function(){return client[_0x8c20('0x4')](_0x8c20('0x1c'),{'options':{'where':{'id':_0x2670a7},'include':[{'model':_0x8c20('0x12'),'as':_0x8c20('0x13')},{'model':_0x8c20('0x1d'),'as':_0x8c20('0x1e'),'attributes':['id',_0x8c20('0x1f')]},{'model':_0x8c20('0x20'),'as':_0x8c20('0x21'),'attributes':['id',_0x8c20('0x1f')]}],'raw':!![]},'log':_0x8c20('0x22')});};};exports['unlockContact']=function(_0x2e2a21,_0x46e2f7,_0xdc33ef){return function(){return client['Request']('UpdateCmHopper',{'body':_0x2e2a21,'options':{'where':{'id':_0x46e2f7},'limit':_0xdc33ef},'log':_0x8c20('0x5')});};};exports[_0x8c20('0x23')]=function(_0x568095,_0x16b713){return function(){return client['Request'](_0x8c20('0x24'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x568095,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x8c20('0x6')](_0x8c20('0xd'))},'UserId':{'$in':_0x16b713}},'order':[[_0x8c20('0xe'),_0x8c20('0xf')],['scheduledat',_0x8c20('0xf')],['id',_0x8c20('0x25')]],'include':[{'model':_0x8c20('0x12'),'as':_0x8c20('0x13')},{'model':_0x8c20('0x1d'),'as':_0x8c20('0x1e'),'attributes':['id','name',_0x8c20('0x26')]}],'group':_0x8c20('0x27'),'raw':!![]},'log':_0x8c20('0xc')});};};exports[_0x8c20('0x28')]=function(_0x3ea857){return function(){return client[_0x8c20('0x4')](_0x8c20('0x29'),{'body':_0x3ea857,'options':{},'log':_0x8c20('0x29')});};};exports['handlePreviewRecallNotifications']=function(_0x39c42a,_0x42c9dc,_0x2888c8){return function(){return client[_0x8c20('0x4')]('CmHopperHandlePreviewRecallNotifications',{'body':{'where':{'voiceQueueIds':_0x39c42a,'interval':_0x42c9dc,'availableAgentsIds':_0x2888c8}},'log':_0x8c20('0x2a')});};};
\ No newline at end of file
+var _0x5728=['ContactId','ListId','CampaignId','DestroyCmHopper','getContactDialer','GetContactDialer','YYYY-MM-DD\x20HH:mm:ss','priority','DESC','ASC','getContactDialerIvr','CmContact','GetContactDialerIvr','moveContactManagedDialer','campaign','MoveContactManagedDialer','VoiceQueueId','CountReScheduled','countReScheduled','getContactPreview','GetCmHopperPreview','User','Agent','VoiceQueue','Queue','name','getContactRecallMe','GetContactRecallMe','scheduledat','db.CmHopper.UserId','resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','moment','getContacts','Request','Contact','getCmHopper','updateContacts','UpdateCmHopper','format','rescheduleContact'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0x5728,0x1c5));var _0x8572=function(_0xffc015,_0x4f2505){_0xffc015=_0xffc015-0x0;var _0x53b726=_0x5728[_0xffc015];return _0x53b726;};'use strict';var client=require('../client');var moment=require(_0x8572('0x0'));exports[_0x8572('0x1')]=function(_0x27e455,_0x484dce){return function(){return client[_0x8572('0x2')]('GetCmHopper',{'options':{'where':{'VoiceQueueId':_0x27e455},'include':[{'model':'CmContact','as':_0x8572('0x3')}],'limit':_0x484dce,'raw':![]},'log':_0x8572('0x4')});};};exports[_0x8572('0x5')]=function(_0x232277,_0x3ac3ce,_0x1fc9b4){return function(){return client[_0x8572('0x2')](_0x8572('0x6'),{'body':_0x232277,'options':{'where':{'VoiceQueueId':_0x3ac3ce,'scheduledat':{'$lte':moment()[_0x8572('0x7')]('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x1fc9b4},'log':_0x8572('0x6')});};};exports[_0x8572('0x8')]=function(_0x5b07ad){return function(){return client[_0x8572('0x2')]('UpdateCmHopper',{'body':_0x5b07ad,'options':{'where':{'ContactId':_0x5b07ad[_0x8572('0x9')],'ListId':_0x5b07ad[_0x8572('0xa')],'VoiceQueueId':_0x5b07ad['VoiceQueueId'],'CampaignId':_0x5b07ad[_0x8572('0xb')]}},'log':_0x8572('0x8')});};};exports['destroyContact']=function(_0x197891,_0x13af27,_0x24ce44){return function(){return client['Request'](_0x8572('0xc'),{'options':{'where':{'VoiceQueueId':_0x197891,'ListId':_0x13af27,'ContactId':_0x24ce44}},'log':_0x8572('0xc')});};};exports[_0x8572('0xd')]=function(_0x464e14,_0x44dc18,_0x236402,_0x57787d){return function(){return client[_0x8572('0x2')](_0x8572('0xe'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x464e14,'active':![],'scheduledat':{'$lte':moment()[_0x8572('0x7')](_0x8572('0xf'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x44dc18}}]},'order':[[_0x8572('0x10'),_0x8572('0x11')],['scheduledat',_0x57787d],['id',_0x8572('0x12')]],'raw':!![],'limit':_0x236402},'log':_0x8572('0xe')});};};exports[_0x8572('0x13')]=function(_0x34af89,_0x279141,_0x43dc49){return function(){return client[_0x8572('0x2')](_0x8572('0xe'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x34af89,'active':![],'scheduledat':{'$lte':moment()['format'](_0x8572('0xf'))}},'include':[{'model':_0x8572('0x14'),'as':'Contact'}],'order':[[_0x8572('0x10'),'DESC'],['scheduledat',_0x43dc49],['id',_0x8572('0x12')]],'raw':!![],'limit':_0x279141},'log':_0x8572('0x15')});};};exports[_0x8572('0x16')]=function(_0x11abcb,_0x47e122){return function(){_0x11abcb[_0x8572('0x17')]=_0x11abcb['queue'];return client[_0x8572('0x2')](_0x8572('0x18'),{'body':_0x11abcb,'options':{'where':{'ContactId':_0x11abcb['ContactId'],'ListId':_0x11abcb['ListId'],'VoiceQueueId':_0x11abcb[_0x8572('0x19')],'CampaignId':_0x11abcb['CampaignId'],'active':_0x47e122?undefined:!![]}},'log':_0x8572('0x18')});};};exports['countReScheduled']=function(_0x194c10){return function(){return client[_0x8572('0x2')](_0x8572('0x1a'),{'options':{'where':{'VoiceQueueId':_0x194c10['id']?_0x194c10['id']||null:null}},'log':_0x8572('0x1b')});};};exports[_0x8572('0x1c')]=function(_0x233b02){return function(){return client['Request'](_0x8572('0x1d'),{'options':{'where':{'id':_0x233b02},'include':[{'model':_0x8572('0x14'),'as':_0x8572('0x3')},{'model':_0x8572('0x1e'),'as':_0x8572('0x1f'),'attributes':['id','name']},{'model':_0x8572('0x20'),'as':_0x8572('0x21'),'attributes':['id',_0x8572('0x22')]}],'raw':!![]},'log':_0x8572('0x4')});};};exports['unlockContact']=function(_0x4c0267,_0x308b49,_0x3f11f2){return function(){return client['Request'](_0x8572('0x6'),{'body':_0x4c0267,'options':{'where':{'id':_0x308b49},'limit':_0x3f11f2},'log':_0x8572('0x6')});};};exports[_0x8572('0x23')]=function(_0x38420e,_0x56dd41){return function(){return client['Request'](_0x8572('0x24'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x38420e,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x8572('0x7')](_0x8572('0xf'))},'UserId':{'$in':_0x56dd41}},'order':[['priority','DESC'],[_0x8572('0x25'),'DESC'],['id',_0x8572('0x12')]],'include':[{'model':_0x8572('0x14'),'as':_0x8572('0x3')},{'model':'User','as':_0x8572('0x1f'),'attributes':['id',_0x8572('0x22'),'voicePause']}],'group':_0x8572('0x26'),'raw':!![]},'log':_0x8572('0xe')});};};exports[_0x8572('0x27')]=function(_0x4d5a9e){return function(){return client['Request'](_0x8572('0x28'),{'body':_0x4d5a9e,'options':{},'log':_0x8572('0x28')});};};exports[_0x8572('0x29')]=function(_0x47367f,_0x2e5838,_0x4b7f8b){return function(){return client[_0x8572('0x2')]('CmHopperHandlePreviewRecallNotifications',{'body':{'where':{'voiceQueueIds':_0x47367f,'interval':_0x2e5838,'availableAgentsIds':_0x4b7f8b}},'log':_0x8572('0x29')});};};
\ No newline at end of file
index 37ad6cf..ad5f4b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb860=['Request','VerifyAdditionalPhones','swapAdditionalPhones','SwapAdditionalPhones','incrementPreviewCounters','IncrementPreviewCounters','moment','verifyAdditionalPhones'];(function(_0x44786e,_0x29ea66){var _0x4832f1=function(_0x11bd1d){while(--_0x11bd1d){_0x44786e['push'](_0x44786e['shift']());}};_0x4832f1(++_0x29ea66);}(_0xb860,0x166));var _0x0b86=function(_0x4ed546,_0x244bd0){_0x4ed546=_0x4ed546-0x0;var _0x10bfcc=_0xb860[_0x4ed546];return _0x10bfcc;};'use strict';var client=require('../client');var moment=require(_0x0b86('0x0'));exports[_0x0b86('0x1')]=function(_0x131e23,_0x2dfff8,_0x5c73aa){return function(){return client[_0x0b86('0x2')]('VerifyAdditionalPhones',{'body':_0x131e23,'reason':_0x2dfff8,'entity':_0x5c73aa,'log':_0x0b86('0x3')});};};exports[_0x0b86('0x4')]=function(_0x457cd5,_0x5cf6e1,_0x18816b){return function(){return client[_0x0b86('0x2')](_0x0b86('0x5'),{'body':_0x457cd5,'duration':_0x5cf6e1,'waitTime':_0x18816b,'log':_0x0b86('0x5')});};};exports[_0x0b86('0x6')]=function(_0x203ea3){return function(){return client[_0x0b86('0x2')](_0x0b86('0x7'),{'body':_0x203ea3,'log':_0x0b86('0x7')});};};
\ No newline at end of file
+var _0x887d=['IncrementPreviewCounters','moment','verifyAdditionalPhones','Request','SwapAdditionalPhones','incrementPreviewCounters'];(function(_0x22456f,_0x1e4a19){var _0x27cff7=function(_0x3c4658){while(--_0x3c4658){_0x22456f['push'](_0x22456f['shift']());}};_0x27cff7(++_0x1e4a19);}(_0x887d,0x187));var _0xd887=function(_0x1e2ef1,_0x3ff54b){_0x1e2ef1=_0x1e2ef1-0x0;var _0x1d84c2=_0x887d[_0x1e2ef1];return _0x1d84c2;};'use strict';var client=require('../client');var moment=require(_0xd887('0x0'));exports[_0xd887('0x1')]=function(_0x867150,_0x554669,_0x2cef11){return function(){return client[_0xd887('0x2')]('VerifyAdditionalPhones',{'body':_0x867150,'reason':_0x554669,'entity':_0x2cef11,'log':'VerifyAdditionalPhones'});};};exports['swapAdditionalPhones']=function(_0x5456b0,_0x577b1d,_0x87fd47){return function(){return client[_0xd887('0x2')]('SwapAdditionalPhones',{'body':_0x5456b0,'duration':_0x577b1d,'waitTime':_0x87fd47,'log':_0xd887('0x3')});};};exports[_0xd887('0x4')]=function(_0x291289){return function(){return client[_0xd887('0x2')](_0xd887('0x5'),{'body':_0x291289,'log':_0xd887('0x5')});};};
\ No newline at end of file
index 21ccebe..9f02093 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3846=['checkIsBlackListIvr','CampaignId','phone','GetCmHopperBlackIvr','../client','checkIsBlackList','Request','VoiceQueueId','GetCmHopperBlack'];(function(_0x14f83c,_0x5d38d6){var _0x746406=function(_0x393b9d){while(--_0x393b9d){_0x14f83c['push'](_0x14f83c['shift']());}};_0x746406(++_0x5d38d6);}(_0x3846,0xee));var _0x6384=function(_0x4df85c,_0x248dfb){_0x4df85c=_0x4df85c-0x0;var _0x4e2a61=_0x3846[_0x4df85c];return _0x4e2a61;};'use strict';var client=require(_0x6384('0x0'));exports[_0x6384('0x1')]=function(_0x3958ae){return function(){return client[_0x6384('0x2')]('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x3958ae[_0x6384('0x3')],'phone':_0x3958ae['phone']},'raw':![]},'log':_0x6384('0x4')});};};exports[_0x6384('0x5')]=function(_0x58676b){return function(){return client[_0x6384('0x2')](_0x6384('0x4'),{'options':{'where':{'CampaignId':_0x58676b[_0x6384('0x6')],'phone':_0x58676b[_0x6384('0x7')]},'raw':![]},'log':_0x6384('0x8')});};};
\ No newline at end of file
+var _0xbc7b=['GetCmHopperBlack','VoiceQueueId','phone','checkIsBlackListIvr','Request','../client','checkIsBlackList'];(function(_0x51552f,_0x29c065){var _0x988c9c=function(_0x3f528d){while(--_0x3f528d){_0x51552f['push'](_0x51552f['shift']());}};_0x988c9c(++_0x29c065);}(_0xbc7b,0x140));var _0xbbc7=function(_0x8c2726,_0x5ee3f3){_0x8c2726=_0x8c2726-0x0;var _0x2f188c=_0xbc7b[_0x8c2726];return _0x2f188c;};'use strict';var client=require(_0xbbc7('0x0'));exports[_0xbbc7('0x1')]=function(_0x465b4d){return function(){return client['Request'](_0xbbc7('0x2'),{'options':{'where':{'VoiceQueueId':_0x465b4d[_0xbbc7('0x3')],'phone':_0x465b4d[_0xbbc7('0x4')]},'raw':![]},'log':_0xbbc7('0x2')});};};exports[_0xbbc7('0x5')]=function(_0x4496f4){return function(){return client[_0xbbc7('0x6')](_0xbbc7('0x2'),{'options':{'where':{'CampaignId':_0x4496f4['CampaignId'],'phone':_0x4496f4['phone']},'raw':![]},'log':'GetCmHopperBlackIvr'});};};
\ No newline at end of file
index 8a61de1..9f8712f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa480=['Request','CreateCmHopperFinal','../client','createContact','campaign','queue'];(function(_0xbac1ec,_0x2f59dc){var _0x1d5ce9=function(_0x18c604){while(--_0x18c604){_0xbac1ec['push'](_0xbac1ec['shift']());}};_0x1d5ce9(++_0x2f59dc);}(_0xa480,0x188));var _0x0a48=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0xa480[_0x3afe18];return _0x19ed1f;};'use strict';var client=require(_0x0a48('0x0'));exports[_0x0a48('0x1')]=function(_0x5846f0){return function(){_0x5846f0[_0x0a48('0x2')]=_0x5846f0[_0x0a48('0x3')];return client[_0x0a48('0x4')](_0x0a48('0x5'),{'body':_0x5846f0,'log':_0x0a48('0x5')});};};
\ No newline at end of file
+var _0x6b2c=['createContact','queue','Request','CreateCmHopperFinal','../client'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x6b2c,0x1da));var _0xc6b2=function(_0x4e059d,_0x4f7645){_0x4e059d=_0x4e059d-0x0;var _0x31b224=_0x6b2c[_0x4e059d];return _0x31b224;};'use strict';var client=require(_0xc6b2('0x0'));exports[_0xc6b2('0x1')]=function(_0x36b617){return function(){_0x36b617['campaign']=_0x36b617[_0xc6b2('0x2')];return client[_0xc6b2('0x3')](_0xc6b2('0x4'),{'body':_0x36b617,'log':_0xc6b2('0x4')});};};
\ No newline at end of file
index e439939..b1182f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x821e=['YYYY-MM-DD\x20HH:mm:ss','format','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','day','endOf','getCampaignHopperHistory','startOf','GetCampaignHopperHistory','createHistory','campaign','queue','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime','subtract','minutes'];(function(_0x1d90ca,_0x3bab16){var _0x28872b=function(_0x3ea71b){while(--_0x3ea71b){_0x1d90ca['push'](_0x1d90ca['shift']());}};_0x28872b(++_0x3bab16);}(_0x821e,0x1b9));var _0xe821=function(_0x311909,_0x414bf7){_0x311909=_0x311909-0x0;var _0x8d3163=_0x821e[_0x311909];return _0x8d3163;};'use strict';var client=require('../client');var moment=require('moment');exports[_0xe821('0x0')]=function(_0x3bd827){return function(){_0x3bd827[_0xe821('0x1')]=_0x3bd827[_0xe821('0x2')];return client[_0xe821('0x3')](_0xe821('0x4'),{'body':_0x3bd827,'log':_0xe821('0x4')});};};exports[_0xe821('0x5')]=function(_0x138298){return function(){return client['Request'](_0xe821('0x6'),{'options':{'where':{'endtime':{'$between':[moment()[_0xe821('0x7')](_0x138298,_0xe821('0x8'))['format'](_0xe821('0x9')),moment()[_0xe821('0xa')](_0xe821('0x9'))]}},'raw':![]},'log':'GetCmHopperHistory'});};};exports[_0xe821('0xb')]=function(_0x2fb177){return function(){return client['Request'](_0xe821('0xc'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xe821('0xd'))[_0xe821('0xa')](_0xe821('0x9')),moment()[_0xe821('0xe')](_0xe821('0xd'))[_0xe821('0xa')](_0xe821('0x9'))]},'campaigntype':'queue'},'raw':![]},'log':'GetVoiceQueueHopperHistory'});};};exports[_0xe821('0xf')]=function(_0x7395e8){return function(){return client[_0xe821('0x3')]('GetCampaignHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0xe821('0x10')](_0xe821('0xd'))[_0xe821('0xa')](_0xe821('0x9')),moment()[_0xe821('0xe')]('day')['format'](_0xe821('0x9'))]},'campaigntype':'ivr'},'raw':![]},'log':_0xe821('0x11')});};};
\ No newline at end of file
+var _0xa682=['GetVoiceQueueHopperHistory','startOf','day','queue','GetCampaignHopperHistory','endOf','campaign','Request','CreateCmHopperHistory','avgHandleTime','subtract','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory'];(function(_0x47f7ec,_0x369f9d){var _0x415101=function(_0x41317a){while(--_0x41317a){_0x47f7ec['push'](_0x47f7ec['shift']());}};_0x415101(++_0x369f9d);}(_0xa682,0x19b));var _0x2a68=function(_0x3ddd01,_0x172edc){_0x3ddd01=_0x3ddd01-0x0;var _0x10ed80=_0xa682[_0x3ddd01];return _0x10ed80;};'use strict';var client=require('../client');var moment=require('moment');exports['createHistory']=function(_0x45183d){return function(){_0x45183d[_0x2a68('0x0')]=_0x45183d['queue'];return client[_0x2a68('0x1')](_0x2a68('0x2'),{'body':_0x45183d,'log':_0x2a68('0x2')});};};exports[_0x2a68('0x3')]=function(_0x4d967d){return function(){return client[_0x2a68('0x1')]('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()[_0x2a68('0x4')](_0x4d967d,'minutes')[_0x2a68('0x5')](_0x2a68('0x6')),moment()[_0x2a68('0x5')](_0x2a68('0x6'))]}},'raw':![]},'log':_0x2a68('0x7')});};};exports[_0x2a68('0x8')]=function(_0x4b0e2b){return function(){return client['Request'](_0x2a68('0x9'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x2a68('0xa')](_0x2a68('0xb'))[_0x2a68('0x5')](_0x2a68('0x6')),moment()['endOf'](_0x2a68('0xb'))[_0x2a68('0x5')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0x2a68('0xc')},'raw':![]},'log':_0x2a68('0x9')});};};exports['getCampaignHopperHistory']=function(_0x18cd58){return function(){return client[_0x2a68('0x1')](_0x2a68('0xd'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x2a68('0xa')](_0x2a68('0xb'))['format'](_0x2a68('0x6')),moment()[_0x2a68('0xe')](_0x2a68('0xb'))[_0x2a68('0x5')](_0x2a68('0x6'))]},'campaigntype':'ivr'},'raw':![]},'log':'GetCampaignHopperHistory'});};};
\ No newline at end of file
index 61ff691..a613942 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f4c=['Trunk','active','getFaxAccount','notify','NotifyFaxAccount','../client','getFaxAccounts','Request','GetFaxAccount','name','description','headerinfo','localstationid','minrate','modem','tech','ListId','key'];(function(_0x5067b8,_0x574bda){var _0x2a55e6=function(_0xa51a55){while(--_0xa51a55){_0x5067b8['push'](_0x5067b8['shift']());}};_0x2a55e6(++_0x574bda);}(_0x8f4c,0x113));var _0xc8f4=function(_0x1bdc27,_0x2c318a){_0x1bdc27=_0x1bdc27-0x0;var _0x914a74=_0x8f4c[_0x1bdc27];return _0x914a74;};'use strict';var client=require(_0xc8f4('0x0'));exports[_0xc8f4('0x1')]=function(){return function(){return client[_0xc8f4('0x2')](_0xc8f4('0x3'),{'options':{'raw':![],'attributes':['id',_0xc8f4('0x4'),_0xc8f4('0x5'),'ecm',_0xc8f4('0x6'),_0xc8f4('0x7'),_0xc8f4('0x8'),'maxrate',_0xc8f4('0x9'),'gateway','faxdetect','t38timeout',_0xc8f4('0xa'),'TrunkId',_0xc8f4('0xb'),_0xc8f4('0xc')],'include':[{'model':_0xc8f4('0xd'),'as':_0xc8f4('0xd'),'attributes':['id',_0xc8f4('0x4'),'callerid',_0xc8f4('0xe')]}]},'log':_0xc8f4('0xf')});};};exports[_0xc8f4('0x10')]=function(_0x3a2f8a,_0x4fd453){return client[_0xc8f4('0x2')]('NotifyFaxAccount',{'account':{'id':_0x3a2f8a},'body':_0x4fd453,'log':_0xc8f4('0x11')});};
\ No newline at end of file
+var _0x7708=['t38timeout','tech','TrunkId','ListId','key','Trunk','name','callerid','active','notify','Request','NotifyFaxAccount','../client','getFaxAccounts','GetFaxAccount','localstationid','minrate','modem','faxdetect'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x7708,0x188));var _0x8770=function(_0x592d48,_0x23f1ba){_0x592d48=_0x592d48-0x0;var _0x5d789e=_0x7708[_0x592d48];return _0x5d789e;};'use strict';var client=require(_0x8770('0x0'));exports[_0x8770('0x1')]=function(){return function(){return client['Request'](_0x8770('0x2'),{'options':{'raw':![],'attributes':['id','name','description','ecm','headerinfo',_0x8770('0x3'),_0x8770('0x4'),'maxrate',_0x8770('0x5'),'gateway',_0x8770('0x6'),_0x8770('0x7'),_0x8770('0x8'),_0x8770('0x9'),_0x8770('0xa'),_0x8770('0xb')],'include':[{'model':_0x8770('0xc'),'as':'Trunk','attributes':['id',_0x8770('0xd'),_0x8770('0xe'),_0x8770('0xf')]}]},'log':'getFaxAccount'});};};exports[_0x8770('0x10')]=function(_0x10e4a3,_0x3bbee2){return client[_0x8770('0x11')]('NotifyFaxAccount',{'account':{'id':_0x10e4a3},'body':_0x3bbee2,'log':_0x8770('0x12')});};
\ No newline at end of file
index e9452ad..b579174 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb930=['../client','update','Request','UpdateFaxMessage'];(function(_0x32e5b4,_0x89df97){var _0x50e8fa=function(_0x5778c9){while(--_0x5778c9){_0x32e5b4['push'](_0x32e5b4['shift']());}};_0x50e8fa(++_0x89df97);}(_0xb930,0x1cc));var _0x0b93=function(_0xc6588b,_0x30f2ee){_0xc6588b=_0xc6588b-0x0;var _0xae9545=_0xb930[_0xc6588b];return _0xae9545;};'use strict';var client=require(_0x0b93('0x0'));exports[_0x0b93('0x1')]=function(_0x238a24,_0x5a09bf){return client[_0x0b93('0x2')](_0x0b93('0x3'),{'body':_0x5a09bf,'options':{'where':{'AttachmentId':_0x238a24}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
+var _0xe957=['../client','Request','UpdateFaxMessage'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xe957,0xf6));var _0x7e95=function(_0x1e9900,_0x4e1036){_0x1e9900=_0x1e9900-0x0;var _0x57c002=_0xe957[_0x1e9900];return _0x57c002;};'use strict';var client=require(_0x7e95('0x0'));exports['update']=function(_0xe13db9,_0x2bfce2){return client[_0x7e95('0x1')](_0x7e95('0x2'),{'body':_0x2bfce2,'options':{'where':{'AttachmentId':_0xe13db9}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
index 08fb520..b3c5bc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a29=['content','Variable','Descriptions','key','keyType','keyContent','variableName','idField','nameField','Tag','Tags','../../client','getDeskAccounts','Request','GetDeskAccount','name','description','username','password','remoteUri','authType','serverUrl','Configurations','DeskField','type'];(function(_0x7075e7,_0x31ddb1){var _0x1051bc=function(_0x1011bf){while(--_0x1011bf){_0x7075e7['push'](_0x7075e7['shift']());}};_0x1051bc(++_0x31ddb1);}(_0x3a29,0xd3));var _0x93a2=function(_0x2c5ab3,_0x170448){_0x2c5ab3=_0x2c5ab3-0x0;var _0x23f024=_0x3a29[_0x2c5ab3];return _0x23f024;};'use strict';var client=require(_0x93a2('0x0'));exports[_0x93a2('0x1')]=function(){return function(_0x4c8e24){return client[_0x93a2('0x2')](_0x93a2('0x3'),{'options':{'raw':![],'attributes':['id',_0x93a2('0x4'),_0x93a2('0x5'),_0x93a2('0x6'),_0x93a2('0x7'),_0x93a2('0x8'),_0x93a2('0x9'),'type',_0x93a2('0xa')],'include':[{'model':'DeskConfiguration','as':_0x93a2('0xb'),'attributes':['id','name'],'include':[{'model':_0x93a2('0xc'),'as':'Subjects','attributes':['id',_0x93a2('0xd'),_0x93a2('0xe'),'variableName'],'include':[{'model':_0x93a2('0xf'),'as':_0x93a2('0xf'),'attributes':['id','name']}]},{'model':_0x93a2('0xc'),'as':_0x93a2('0x10'),'attributes':['id',_0x93a2('0xd'),_0x93a2('0xe'),_0x93a2('0x11'),_0x93a2('0x12'),_0x93a2('0x13'),_0x93a2('0x14')],'include':[{'model':_0x93a2('0xf'),'as':_0x93a2('0xf'),'attributes':['id','name']}]},{'model':_0x93a2('0xc'),'as':'Fields','attributes':['id','type','content',_0x93a2('0x15'),_0x93a2('0x16'),'customField',_0x93a2('0x14')],'include':[{'model':_0x93a2('0xf'),'as':_0x93a2('0xf'),'attributes':['id',_0x93a2('0x4')]}]},{'model':_0x93a2('0x17'),'as':_0x93a2('0x18'),'attributes':['id',_0x93a2('0x4')]}]}]},'log':'GetDeskAccount'});};};
\ No newline at end of file
+var _0x861f=['authType','serverUrl','DeskConfiguration','Configurations','Subjects','type','content','variableName','Variable','DeskField','key','keyType','keyContent','Fields','customField','Tag','Tags','Request','GetDeskAccount','name','description','username','remoteUri'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x861f,0xc9));var _0xf861=function(_0x19e928,_0x26a0e4){_0x19e928=_0x19e928-0x0;var _0x4e941f=_0x861f[_0x19e928];return _0x4e941f;};'use strict';var client=require('../../client');exports['getDeskAccounts']=function(){return function(_0x3a962c){return client[_0xf861('0x0')](_0xf861('0x1'),{'options':{'raw':![],'attributes':['id',_0xf861('0x2'),_0xf861('0x3'),_0xf861('0x4'),'password',_0xf861('0x5'),_0xf861('0x6'),'type',_0xf861('0x7')],'include':[{'model':_0xf861('0x8'),'as':_0xf861('0x9'),'attributes':['id','name'],'include':[{'model':'DeskField','as':_0xf861('0xa'),'attributes':['id',_0xf861('0xb'),_0xf861('0xc'),_0xf861('0xd')],'include':[{'model':_0xf861('0xe'),'as':'Variable','attributes':['id',_0xf861('0x2')]}]},{'model':_0xf861('0xf'),'as':'Descriptions','attributes':['id','type',_0xf861('0xc'),_0xf861('0x10'),_0xf861('0x11'),_0xf861('0x12'),_0xf861('0xd')],'include':[{'model':_0xf861('0xe'),'as':_0xf861('0xe'),'attributes':['id',_0xf861('0x2')]}]},{'model':_0xf861('0xf'),'as':_0xf861('0x13'),'attributes':['id',_0xf861('0xb'),_0xf861('0xc'),'idField','nameField',_0xf861('0x14'),_0xf861('0xd')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]},{'model':_0xf861('0x15'),'as':_0xf861('0x16'),'attributes':['id',_0xf861('0x2')]}]}]},'log':_0xf861('0x1')});};};
\ No newline at end of file
index 2998d37..359cd1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x236c=['clientId','clientSecret','serverUrl','description','Dynamics365Configuration','Configurations','additionalSearchContact','Dynamics365Field','Subjects','type','content','variableName','Variable','Descriptions','key','Fields','idField','nameField','customField','CloudProvider','data2','data5','../../client','Request','GetDynamics365Account','name','username','remoteUri','tenantId'];(function(_0x3daca2,_0x5aa82d){var _0x55ef2e=function(_0x3e85d7){while(--_0x3e85d7){_0x3daca2['push'](_0x3daca2['shift']());}};_0x55ef2e(++_0x5aa82d);}(_0x236c,0x155));var _0xc236=function(_0x10bc29,_0x565e36){_0x10bc29=_0x10bc29-0x0;var _0x4a3913=_0x236c[_0x10bc29];return _0x4a3913;};'use strict';var client=require(_0xc236('0x0'));exports['getDynamics365Accounts']=function(){return function(_0x2ce95a){return client[_0xc236('0x1')](_0xc236('0x2'),{'options':{'raw':![],'attributes':['id',_0xc236('0x3'),_0xc236('0x4'),'password',_0xc236('0x5'),_0xc236('0x6'),_0xc236('0x7'),_0xc236('0x8'),_0xc236('0x9'),_0xc236('0xa'),'modernAuthentication'],'include':[{'model':_0xc236('0xb'),'as':_0xc236('0xc'),'attributes':['id','name','ticketType','moduleCreate',_0xc236('0xd'),'openNewTab'],'include':[{'model':_0xc236('0xe'),'as':_0xc236('0xf'),'attributes':['id',_0xc236('0x10'),_0xc236('0x11'),_0xc236('0x12')],'include':[{'model':'Variable','as':_0xc236('0x13'),'attributes':['id',_0xc236('0x3')]}]},{'model':'Dynamics365Field','as':_0xc236('0x14'),'attributes':['id',_0xc236('0x10'),'content',_0xc236('0x15'),'keyType','keyContent',_0xc236('0x12')],'include':[{'model':_0xc236('0x13'),'as':_0xc236('0x13'),'attributes':['id',_0xc236('0x3')]}]},{'model':'Dynamics365Field','as':_0xc236('0x16'),'attributes':['id','type','content',_0xc236('0x17'),_0xc236('0x18'),_0xc236('0x19'),_0xc236('0x12')],'include':[{'model':_0xc236('0x13'),'as':'Variable','attributes':['id','name']}]}]},{'model':'CloudProvider','as':_0xc236('0x1a'),'attributes':['id',_0xc236('0x1b'),_0xc236('0x1c'),'data7']}]},'log':_0xc236('0x2')});};};
\ No newline at end of file
+var _0x33d2=['keyType','keyContent','Fields','nameField','CloudProvider','data5','data7','../../client','getDynamics365Accounts','GetDynamics365Account','name','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','description','modernAuthentication','Configurations','ticketType','moduleCreate','additionalSearchContact','Dynamics365Field','type','variableName','Variable','Descriptions','content','key'];(function(_0x44ac82,_0x56b865){var _0x28126a=function(_0x527226){while(--_0x527226){_0x44ac82['push'](_0x44ac82['shift']());}};_0x28126a(++_0x56b865);}(_0x33d2,0x7f));var _0x233d=function(_0x180297,_0x56bb6d){_0x180297=_0x180297-0x0;var _0x1f7aae=_0x33d2[_0x180297];return _0x1f7aae;};'use strict';var client=require(_0x233d('0x0'));exports[_0x233d('0x1')]=function(){return function(_0x54d233){return client['Request'](_0x233d('0x2'),{'options':{'raw':![],'attributes':['id',_0x233d('0x3'),'username',_0x233d('0x4'),_0x233d('0x5'),_0x233d('0x6'),_0x233d('0x7'),_0x233d('0x8'),_0x233d('0x9'),_0x233d('0xa'),_0x233d('0xb')],'include':[{'model':'Dynamics365Configuration','as':_0x233d('0xc'),'attributes':['id','name',_0x233d('0xd'),_0x233d('0xe'),_0x233d('0xf'),'openNewTab'],'include':[{'model':_0x233d('0x10'),'as':'Subjects','attributes':['id',_0x233d('0x11'),'content',_0x233d('0x12')],'include':[{'model':_0x233d('0x13'),'as':_0x233d('0x13'),'attributes':['id','name']}]},{'model':_0x233d('0x10'),'as':_0x233d('0x14'),'attributes':['id','type',_0x233d('0x15'),_0x233d('0x16'),_0x233d('0x17'),_0x233d('0x18'),_0x233d('0x12')],'include':[{'model':_0x233d('0x13'),'as':'Variable','attributes':['id',_0x233d('0x3')]}]},{'model':_0x233d('0x10'),'as':_0x233d('0x19'),'attributes':['id',_0x233d('0x11'),_0x233d('0x15'),'idField',_0x233d('0x1a'),'customField',_0x233d('0x12')],'include':[{'model':_0x233d('0x13'),'as':_0x233d('0x13'),'attributes':['id',_0x233d('0x3')]}]}]},{'model':_0x233d('0x1b'),'as':'CloudProvider','attributes':['id','data2',_0x233d('0x1c'),_0x233d('0x1d')]}]},'log':_0x233d('0x2')});};};
\ No newline at end of file
index abd5986..d5b7179 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x351d=['username','remoteUri','serverUrl','Configurations','name','Tag','FreshdeskField','Subjects','content','variableName','Descriptions','type','key','keyType','Fields','idField','nameField','Variable','../../client','Request','GetFreshdeskAccount'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x351d,0x90));var _0xd351=function(_0x201181,_0x378b10){_0x201181=_0x201181-0x0;var _0x3762b4=_0x351d[_0x201181];return _0x3762b4;};'use strict';var client=require(_0xd351('0x0'));exports['getFreshdeskAccounts']=function(){return function(_0x109108){return client[_0xd351('0x1')](_0xd351('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xd351('0x3'),'apiKey',_0xd351('0x4'),_0xd351('0x5')],'include':[{'model':'FreshdeskConfiguration','as':_0xd351('0x6'),'attributes':['id',_0xd351('0x7')],'include':[{'model':_0xd351('0x8'),'attributes':['id','name']},{'model':_0xd351('0x9'),'as':_0xd351('0xa'),'attributes':['id','type',_0xd351('0xb'),_0xd351('0xc')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xd351('0x7')]}]},{'model':'FreshdeskField','as':_0xd351('0xd'),'attributes':['id',_0xd351('0xe'),'content',_0xd351('0xf'),_0xd351('0x10'),'keyContent',_0xd351('0xc')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xd351('0x7')]}]},{'model':_0xd351('0x9'),'as':_0xd351('0x11'),'attributes':['id',_0xd351('0xe'),'content',_0xd351('0x12'),_0xd351('0x13'),'customField',_0xd351('0xc')],'include':[{'model':_0xd351('0x14'),'as':_0xd351('0x14'),'attributes':['id',_0xd351('0x7')]}]}]}]},'log':_0xd351('0x2')});};};
\ No newline at end of file
+var _0x32d5=['key','keyType','keyContent','variableName','Fields','nameField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','name','username','remoteUri','serverUrl','Configurations','Tag','FreshdeskField','content','Variable','Descriptions','type'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x32d5,0x1aa));var _0x532d=function(_0x839da5,_0x48392d){_0x839da5=_0x839da5-0x0;var _0x42156e=_0x32d5[_0x839da5];return _0x42156e;};'use strict';var client=require(_0x532d('0x0'));exports[_0x532d('0x1')]=function(){return function(_0x255bb5){return client[_0x532d('0x2')](_0x532d('0x3'),{'options':{'raw':![],'attributes':['id',_0x532d('0x4'),_0x532d('0x5'),'apiKey',_0x532d('0x6'),_0x532d('0x7')],'include':[{'model':'FreshdeskConfiguration','as':_0x532d('0x8'),'attributes':['id',_0x532d('0x4')],'include':[{'model':_0x532d('0x9'),'attributes':['id',_0x532d('0x4')]},{'model':_0x532d('0xa'),'as':'Subjects','attributes':['id','type',_0x532d('0xb'),'variableName'],'include':[{'model':_0x532d('0xc'),'as':_0x532d('0xc'),'attributes':['id',_0x532d('0x4')]}]},{'model':_0x532d('0xa'),'as':_0x532d('0xd'),'attributes':['id',_0x532d('0xe'),_0x532d('0xb'),_0x532d('0xf'),_0x532d('0x10'),_0x532d('0x11'),_0x532d('0x12')],'include':[{'model':_0x532d('0xc'),'as':'Variable','attributes':['id',_0x532d('0x4')]}]},{'model':_0x532d('0xa'),'as':_0x532d('0x13'),'attributes':['id',_0x532d('0xe'),_0x532d('0xb'),'idField',_0x532d('0x14'),'customField',_0x532d('0x12')],'include':[{'model':_0x532d('0xc'),'as':_0x532d('0xc'),'attributes':['id',_0x532d('0x4')]}]}]}]},'log':_0x532d('0x3')});};};
\ No newline at end of file
index 867e6e9..977b243 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb46f=['keyContent','GetFreshsalesccount','../../client','getFreshsalesAccounts','Request','GetFreshsalesAccount','name','username','apiKey','serverUrl','Configurations','FreshsalesField','Subjects','type','variableName','Variable','key','keyType'];(function(_0x38382f,_0x51183d){var _0x152e8b=function(_0x45dc28){while(--_0x45dc28){_0x38382f['push'](_0x38382f['shift']());}};_0x152e8b(++_0x51183d);}(_0xb46f,0xb6));var _0xfb46=function(_0x483b68,_0x486770){_0x483b68=_0x483b68-0x0;var _0x4aa556=_0xb46f[_0x483b68];return _0x4aa556;};'use strict';var client=require(_0xfb46('0x0'));exports[_0xfb46('0x1')]=function(){return function(_0x5f2971){return client[_0xfb46('0x2')](_0xfb46('0x3'),{'options':{'raw':![],'attributes':['id',_0xfb46('0x4'),_0xfb46('0x5'),_0xfb46('0x6'),'remoteUri',_0xfb46('0x7')],'include':[{'model':'FreshsalesConfiguration','as':_0xfb46('0x8'),'attributes':['id',_0xfb46('0x4')],'include':[{'model':_0xfb46('0x9'),'as':_0xfb46('0xa'),'attributes':['id',_0xfb46('0xb'),'content',_0xfb46('0xc')],'include':[{'model':_0xfb46('0xd'),'as':'Variable','attributes':['id','name']}]},{'model':'FreshsalesField','as':'Descriptions','attributes':['id',_0xfb46('0xb'),'content',_0xfb46('0xe'),_0xfb46('0xf'),_0xfb46('0x10'),_0xfb46('0xc')],'include':[{'model':_0xfb46('0xd'),'as':_0xfb46('0xd'),'attributes':['id',_0xfb46('0x4')]}]}]}]},'log':_0xfb46('0x11')});};};
\ No newline at end of file
+var _0xdf98=['type','content','variableName','Descriptions','key','keyType','keyContent','Variable','GetFreshsalesccount','../../client','name','username','apiKey','remoteUri','serverUrl','FreshsalesConfiguration','Configurations','FreshsalesField'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0xdf98,0xcf));var _0x8df9=function(_0x4178af,_0x388652){_0x4178af=_0x4178af-0x0;var _0x20f4b1=_0xdf98[_0x4178af];return _0x20f4b1;};'use strict';var client=require(_0x8df9('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0x1f9abd){return client['Request']('GetFreshsalesAccount',{'options':{'raw':![],'attributes':['id',_0x8df9('0x1'),_0x8df9('0x2'),_0x8df9('0x3'),_0x8df9('0x4'),_0x8df9('0x5')],'include':[{'model':_0x8df9('0x6'),'as':_0x8df9('0x7'),'attributes':['id',_0x8df9('0x1')],'include':[{'model':_0x8df9('0x8'),'as':'Subjects','attributes':['id',_0x8df9('0x9'),_0x8df9('0xa'),_0x8df9('0xb')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x8df9('0x1')]}]},{'model':'FreshsalesField','as':_0x8df9('0xc'),'attributes':['id',_0x8df9('0x9'),_0x8df9('0xa'),_0x8df9('0xd'),_0x8df9('0xe'),_0x8df9('0xf'),_0x8df9('0xb')],'include':[{'model':_0x8df9('0x10'),'as':'Variable','attributes':['id',_0x8df9('0x1')]}]}]}]},'log':_0x8df9('0x11')});};};
\ No newline at end of file
index df678e3..dc744fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b72=['Request','name','username','clientId','clientSecret','securityToken','serverUrl','type','SalesforceConfiguration','Configurations','moduleSearch','moduleCreate','ticketType','additionalSearchAccount','additionalSearchContact','additionalSearchLead','Subjects','Variable','SalesforceField','Descriptions','Fields','GetSalesforceAccount','../../client'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x6b72,0x19d));var _0x26b7=function(_0x78acfe,_0x5101d0){_0x78acfe=_0x78acfe-0x0;var _0x13359f=_0x6b72[_0x78acfe];return _0x13359f;};'use strict';var client=require(_0x26b7('0x0'));exports['getSalesforceAccounts']=function(){return function(_0x1d6896){return client[_0x26b7('0x1')]('GetSalesforceAccount',{'options':{'raw':![],'attributes':['id',_0x26b7('0x2'),_0x26b7('0x3'),'password','remoteUri',_0x26b7('0x4'),_0x26b7('0x5'),_0x26b7('0x6'),_0x26b7('0x7'),_0x26b7('0x8')],'include':[{'model':_0x26b7('0x9'),'as':_0x26b7('0xa'),'attributes':['id',_0x26b7('0x2'),_0x26b7('0xb'),_0x26b7('0xc'),_0x26b7('0xd'),'leadId',_0x26b7('0xe'),_0x26b7('0xf'),_0x26b7('0x10')],'include':[{'model':'SalesforceField','as':_0x26b7('0x11'),'include':[{'model':'Variable','as':_0x26b7('0x12'),'attributes':['id','name']}]},{'model':_0x26b7('0x13'),'as':_0x26b7('0x14'),'include':[{'model':_0x26b7('0x12'),'as':_0x26b7('0x12'),'attributes':['id','name']}]},{'model':_0x26b7('0x13'),'as':_0x26b7('0x15'),'include':[{'model':_0x26b7('0x12'),'as':_0x26b7('0x12'),'attributes':['id',_0x26b7('0x2')]}]}]}]},'log':_0x26b7('0x16')});};};
\ No newline at end of file
+var _0xc359=['password','clientId','clientSecret','type','SalesforceConfiguration','moduleSearch','moduleCreate','ticketType','additionalSearchContact','SalesforceField','Subjects','Descriptions','Variable','Fields','../../client','Request','GetSalesforceAccount','name','username'];(function(_0x5b3a97,_0x2d86cf){var _0x4b1e17=function(_0x28f039){while(--_0x28f039){_0x5b3a97['push'](_0x5b3a97['shift']());}};_0x4b1e17(++_0x2d86cf);}(_0xc359,0x93));var _0x9c35=function(_0x1c8cc6,_0x411e5c){_0x1c8cc6=_0x1c8cc6-0x0;var _0x522936=_0xc359[_0x1c8cc6];return _0x522936;};'use strict';var client=require(_0x9c35('0x0'));exports['getSalesforceAccounts']=function(){return function(_0x37ad0c){return client[_0x9c35('0x1')](_0x9c35('0x2'),{'options':{'raw':![],'attributes':['id',_0x9c35('0x3'),_0x9c35('0x4'),_0x9c35('0x5'),'remoteUri',_0x9c35('0x6'),_0x9c35('0x7'),'securityToken','serverUrl',_0x9c35('0x8')],'include':[{'model':_0x9c35('0x9'),'as':'Configurations','attributes':['id',_0x9c35('0x3'),_0x9c35('0xa'),_0x9c35('0xb'),_0x9c35('0xc'),'leadId','additionalSearchAccount',_0x9c35('0xd'),'additionalSearchLead'],'include':[{'model':_0x9c35('0xe'),'as':_0x9c35('0xf'),'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x9c35('0x3')]}]},{'model':_0x9c35('0xe'),'as':_0x9c35('0x10'),'include':[{'model':'Variable','as':_0x9c35('0x11'),'attributes':['id',_0x9c35('0x3')]}]},{'model':_0x9c35('0xe'),'as':_0x9c35('0x12'),'include':[{'model':_0x9c35('0x11'),'as':_0x9c35('0x11'),'attributes':['id','name']}]}]}]},'log':_0x9c35('0x2')});};};
\ No newline at end of file
index 8026b3f..92f17f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['variableName','GetServicenowkAccount','../../client','Request','GetServicenowAccount','name','description','username','password','email','remoteUri','serverUrl','ServicenowConfiguration','ServicenowField','Subjects','type','Variable','Descriptions','key','keyContent','content','idField','nameField'];(function(_0x3a2e49,_0x21ebea){var _0x257140=function(_0x5a2362){while(--_0x5a2362){_0x3a2e49['push'](_0x3a2e49['shift']());}};_0x257140(++_0x21ebea);}(_0x326f,0xd1));var _0xf326=function(_0x381493,_0x5a3dc0){_0x381493=_0x381493-0x0;var _0x523bda=_0x326f[_0x381493];return _0x523bda;};'use strict';var client=require(_0xf326('0x0'));exports['getServicenowAccounts']=function(){return function(_0x5452cc){return client[_0xf326('0x1')](_0xf326('0x2'),{'options':{'raw':![],'attributes':['id',_0xf326('0x3'),_0xf326('0x4'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x7'),_0xf326('0x8'),_0xf326('0x9')],'include':[{'model':_0xf326('0xa'),'as':'Configurations','attributes':['id',_0xf326('0x3')],'include':[{'model':_0xf326('0xb'),'as':_0xf326('0xc'),'attributes':['id',_0xf326('0xd'),'content','variableName'],'include':[{'model':'Variable','as':_0xf326('0xe'),'attributes':['id',_0xf326('0x3')]}]},{'model':_0xf326('0xb'),'as':_0xf326('0xf'),'attributes':['id',_0xf326('0xd'),'content',_0xf326('0x10'),'keyType',_0xf326('0x11'),'variableName'],'include':[{'model':_0xf326('0xe'),'as':'Variable','attributes':['id',_0xf326('0x3')]}]},{'model':_0xf326('0xb'),'as':'Fields','attributes':['id',_0xf326('0xd'),_0xf326('0x12'),_0xf326('0x13'),_0xf326('0x14'),'customField',_0xf326('0x15')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xf326('0x3')]}]}]}]},'log':_0xf326('0x16')});};};
\ No newline at end of file
+var _0x6d38=['ServicenowField','content','variableName','Variable','Descriptions','key','keyType','Fields','type','idField','nameField','GetServicenowkAccount','getServicenowAccounts','Request','description','password','email','remoteUri','ServicenowConfiguration','Configurations','name'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0x6d38,0x1ef));var _0x86d3=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x6d38[_0x580576];return _0x3f55a0;};'use strict';var client=require('../../client');exports[_0x86d3('0x0')]=function(){return function(_0x4c9c06){return client[_0x86d3('0x1')]('GetServicenowAccount',{'options':{'raw':![],'attributes':['id','name',_0x86d3('0x2'),'username',_0x86d3('0x3'),_0x86d3('0x4'),_0x86d3('0x5'),'serverUrl'],'include':[{'model':_0x86d3('0x6'),'as':_0x86d3('0x7'),'attributes':['id',_0x86d3('0x8')],'include':[{'model':_0x86d3('0x9'),'as':'Subjects','attributes':['id','type',_0x86d3('0xa'),_0x86d3('0xb')],'include':[{'model':_0x86d3('0xc'),'as':'Variable','attributes':['id','name']}]},{'model':_0x86d3('0x9'),'as':_0x86d3('0xd'),'attributes':['id','type','content',_0x86d3('0xe'),_0x86d3('0xf'),'keyContent',_0x86d3('0xb')],'include':[{'model':'Variable','as':_0x86d3('0xc'),'attributes':['id',_0x86d3('0x8')]}]},{'model':_0x86d3('0x9'),'as':_0x86d3('0x10'),'attributes':['id',_0x86d3('0x11'),_0x86d3('0xa'),_0x86d3('0x12'),_0x86d3('0x13'),'customField',_0x86d3('0xb')],'include':[{'model':_0x86d3('0xc'),'as':_0x86d3('0xc'),'attributes':['id',_0x86d3('0x8')]}]}]}]},'log':_0x86d3('0x14')});};};
\ No newline at end of file
index 6c97cf7..144a250 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda2d=['Subjects','type','content','variableName','Variable','key','keyType','keyContent','idField','nameField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','serverUrl','SugarcrmConfiguration','Configurations','SugarcrmField'];(function(_0xec034,_0x16c358){var _0x2c5a19=function(_0xec401c){while(--_0xec401c){_0xec034['push'](_0xec034['shift']());}};_0x2c5a19(++_0x16c358);}(_0xda2d,0x102));var _0xdda2=function(_0x7093b6,_0x2d4198){_0x7093b6=_0x7093b6-0x0;var _0x7e101e=_0xda2d[_0x7093b6];return _0x7e101e;};'use strict';var client=require('../../client');exports[_0xdda2('0x0')]=function(){return function(_0x35f029){return client[_0xdda2('0x1')](_0xdda2('0x2'),{'options':{'raw':![],'attributes':['id',_0xdda2('0x3'),'username','password','remoteUri',_0xdda2('0x4')],'include':[{'model':_0xdda2('0x5'),'as':_0xdda2('0x6'),'attributes':['id',_0xdda2('0x3')],'include':[{'model':_0xdda2('0x7'),'as':_0xdda2('0x8'),'attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]},{'model':_0xdda2('0x7'),'as':'Descriptions','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xd'),_0xdda2('0xe'),_0xdda2('0xf'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':_0xdda2('0xc'),'attributes':['id','name']}]},{'model':'SugarcrmField','as':'Fields','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0x10'),_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]}]}]},'log':'GetSugarcrmAccount'});};};
\ No newline at end of file
+var _0xdb28=['customField','GetSugarcrmAccount','../../client','getSugarcrmAccounts','Request','name','username','password','remoteUri','serverUrl','Configurations','type','content','variableName','Variable','SugarcrmField','key','keyContent','Fields','nameField'];(function(_0x482393,_0x355061){var _0x4c07ae=function(_0x139328){while(--_0x139328){_0x482393['push'](_0x482393['shift']());}};_0x4c07ae(++_0x355061);}(_0xdb28,0x106));var _0x8db2=function(_0x294066,_0x151117){_0x294066=_0x294066-0x0;var _0x5130e=_0xdb28[_0x294066];return _0x5130e;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(){return function(_0x1dc797){return client[_0x8db2('0x2')]('GetSugarcrmAccount',{'options':{'raw':![],'attributes':['id',_0x8db2('0x3'),_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7')],'include':[{'model':'SugarcrmConfiguration','as':_0x8db2('0x8'),'attributes':['id',_0x8db2('0x3')],'include':[{'model':'SugarcrmField','as':'Subjects','attributes':['id',_0x8db2('0x9'),_0x8db2('0xa'),_0x8db2('0xb')],'include':[{'model':_0x8db2('0xc'),'as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]},{'model':_0x8db2('0xd'),'as':'Descriptions','attributes':['id',_0x8db2('0x9'),_0x8db2('0xa'),_0x8db2('0xe'),'keyType',_0x8db2('0xf'),_0x8db2('0xb')],'include':[{'model':'Variable','as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]},{'model':_0x8db2('0xd'),'as':_0x8db2('0x10'),'attributes':['id',_0x8db2('0x9'),'content','idField',_0x8db2('0x11'),_0x8db2('0x12'),_0x8db2('0xb')],'include':[{'model':_0x8db2('0xc'),'as':_0x8db2('0xc'),'attributes':['id',_0x8db2('0x3')]}]}]}]},'log':_0x8db2('0x13')});};};
\ No newline at end of file
index 534e975..7d0f15d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3742=['nameField','customField','Request','GetVtigerAccount','name','username','accessKey','VtigerField','type','content','Variable','Descriptions','key','keyType','keyContent','variableName','idField'];(function(_0x3cc1a1,_0x5dbc52){var _0x4efed7=function(_0x9401b1){while(--_0x9401b1){_0x3cc1a1['push'](_0x3cc1a1['shift']());}};_0x4efed7(++_0x5dbc52);}(_0x3742,0xf0));var _0x2374=function(_0x14416e,_0x392611){_0x14416e=_0x14416e-0x0;var _0x45ede9=_0x3742[_0x14416e];return _0x45ede9;};'use strict';var client=require('../../client');exports['getVtigerAccounts']=function(){return function(_0x2894a7){return client[_0x2374('0x0')](_0x2374('0x1'),{'options':{'raw':![],'attributes':['id',_0x2374('0x2'),'description',_0x2374('0x3'),_0x2374('0x4'),'remoteUri','serverUrl'],'include':[{'model':'VtigerConfiguration','as':'Configurations','attributes':['id',_0x2374('0x2')],'include':[{'model':_0x2374('0x5'),'as':'Subjects','attributes':['id',_0x2374('0x6'),_0x2374('0x7'),'variableName'],'include':[{'model':_0x2374('0x8'),'as':_0x2374('0x8'),'attributes':['id','name']}]},{'model':_0x2374('0x5'),'as':_0x2374('0x9'),'attributes':['id',_0x2374('0x6'),'content',_0x2374('0xa'),_0x2374('0xb'),_0x2374('0xc'),_0x2374('0xd')],'include':[{'model':_0x2374('0x8'),'as':_0x2374('0x8'),'attributes':['id',_0x2374('0x2')]}]},{'model':'VtigerField','as':'Fields','attributes':['id','type',_0x2374('0x7'),_0x2374('0xe'),_0x2374('0xf'),_0x2374('0x10'),_0x2374('0xd')],'include':[{'model':_0x2374('0x8'),'as':'Variable','attributes':['id',_0x2374('0x2')]}]}]}]},'log':'GetVtigerAccount'});};};
\ No newline at end of file
+var _0xc382=['customField','getVtigerAccounts','GetVtigerAccount','name','description','username','accessKey','remoteUri','serverUrl','VtigerConfiguration','Configurations','VtigerField','Subjects','type','content','variableName','Variable','keyType','keyContent','Fields','idField','nameField'];(function(_0x336376,_0xe4b28d){var _0x1d2a8e=function(_0x3afe68){while(--_0x3afe68){_0x336376['push'](_0x336376['shift']());}};_0x1d2a8e(++_0xe4b28d);}(_0xc382,0x135));var _0x2c38=function(_0x13ee83,_0x456ca6){_0x13ee83=_0x13ee83-0x0;var _0x43c870=_0xc382[_0x13ee83];return _0x43c870;};'use strict';var client=require('../../client');exports[_0x2c38('0x0')]=function(){return function(_0x58bc6c){return client['Request'](_0x2c38('0x1'),{'options':{'raw':![],'attributes':['id',_0x2c38('0x2'),_0x2c38('0x3'),_0x2c38('0x4'),_0x2c38('0x5'),_0x2c38('0x6'),_0x2c38('0x7')],'include':[{'model':_0x2c38('0x8'),'as':_0x2c38('0x9'),'attributes':['id','name'],'include':[{'model':_0x2c38('0xa'),'as':_0x2c38('0xb'),'attributes':['id',_0x2c38('0xc'),_0x2c38('0xd'),_0x2c38('0xe')],'include':[{'model':_0x2c38('0xf'),'as':_0x2c38('0xf'),'attributes':['id',_0x2c38('0x2')]}]},{'model':'VtigerField','as':'Descriptions','attributes':['id','type',_0x2c38('0xd'),'key',_0x2c38('0x10'),_0x2c38('0x11'),_0x2c38('0xe')],'include':[{'model':'Variable','as':_0x2c38('0xf'),'attributes':['id',_0x2c38('0x2')]}]},{'model':'VtigerField','as':_0x2c38('0x12'),'attributes':['id','type','content',_0x2c38('0x13'),_0x2c38('0x14'),_0x2c38('0x15'),_0x2c38('0xe')],'include':[{'model':_0x2c38('0xf'),'as':'Variable','attributes':['id','name']}]}]}]},'log':'GetVtigerAccount'});};};
\ No newline at end of file
index 46c62cf..e2b035b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ba4=['key','keyType','keyContent','variableName','idField','nameField','customField','../../client','getZendeskAccounts','Request','GetZendeskAccount','name','username','password','remoteUri','serverUrl','type','ZendeskConfiguration','Tag','ZendeskField','Subjects','content','Variable','Descriptions'];(function(_0x167bc9,_0x1c73d9){var _0xd8527b=function(_0x14918c){while(--_0x14918c){_0x167bc9['push'](_0x167bc9['shift']());}};_0xd8527b(++_0x1c73d9);}(_0x0ba4,0xdf));var _0x40ba=function(_0xa12849,_0x4c938d){_0xa12849=_0xa12849-0x0;var _0x58c237=_0x0ba4[_0xa12849];return _0x58c237;};'use strict';var client=require(_0x40ba('0x0'));exports[_0x40ba('0x1')]=function(){return function(_0x4621c1){return client[_0x40ba('0x2')](_0x40ba('0x3'),{'options':{'raw':![],'attributes':['id',_0x40ba('0x4'),_0x40ba('0x5'),_0x40ba('0x6'),'token',_0x40ba('0x7'),'authType',_0x40ba('0x8'),_0x40ba('0x9')],'include':[{'model':_0x40ba('0xa'),'as':'Configurations','attributes':['id',_0x40ba('0x4')],'include':[{'model':_0x40ba('0xb'),'attributes':['id',_0x40ba('0x4')]},{'model':_0x40ba('0xc'),'as':_0x40ba('0xd'),'attributes':['id','type',_0x40ba('0xe'),'variableName'],'include':[{'model':_0x40ba('0xf'),'as':'Variable','attributes':['id',_0x40ba('0x4')]}]},{'model':_0x40ba('0xc'),'as':_0x40ba('0x10'),'attributes':['id',_0x40ba('0x9'),_0x40ba('0xe'),_0x40ba('0x11'),_0x40ba('0x12'),_0x40ba('0x13'),_0x40ba('0x14')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]},{'model':_0x40ba('0xc'),'as':'Fields','attributes':['id',_0x40ba('0x9'),'content',_0x40ba('0x15'),_0x40ba('0x16'),_0x40ba('0x17'),_0x40ba('0x14')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x40ba('0x4')]}]}]}]},'log':_0x40ba('0x3')});};};
\ No newline at end of file
+var _0x2396=['content','variableName','Variable','Descriptions','keyContent','idField','nameField','customField','../../client','getZendeskAccounts','Request','GetZendeskAccount','name','username','password','serverUrl','type','ZendeskConfiguration','Configurations','Tag','ZendeskField'];(function(_0x1c4aa6,_0x4abe50){var _0x32a6a6=function(_0x364237){while(--_0x364237){_0x1c4aa6['push'](_0x1c4aa6['shift']());}};_0x32a6a6(++_0x4abe50);}(_0x2396,0x1c1));var _0x6239=function(_0x1cd577,_0x180f2a){_0x1cd577=_0x1cd577-0x0;var _0x790837=_0x2396[_0x1cd577];return _0x790837;};'use strict';var client=require(_0x6239('0x0'));exports[_0x6239('0x1')]=function(){return function(_0x160873){return client[_0x6239('0x2')](_0x6239('0x3'),{'options':{'raw':![],'attributes':['id',_0x6239('0x4'),_0x6239('0x5'),_0x6239('0x6'),'token','remoteUri','authType',_0x6239('0x7'),_0x6239('0x8')],'include':[{'model':_0x6239('0x9'),'as':_0x6239('0xa'),'attributes':['id',_0x6239('0x4')],'include':[{'model':_0x6239('0xb'),'attributes':['id',_0x6239('0x4')]},{'model':_0x6239('0xc'),'as':'Subjects','attributes':['id',_0x6239('0x8'),_0x6239('0xd'),_0x6239('0xe')],'include':[{'model':'Variable','as':_0x6239('0xf'),'attributes':['id',_0x6239('0x4')]}]},{'model':_0x6239('0xc'),'as':_0x6239('0x10'),'attributes':['id',_0x6239('0x8'),_0x6239('0xd'),'key','keyType',_0x6239('0x11'),_0x6239('0xe')],'include':[{'model':_0x6239('0xf'),'as':_0x6239('0xf'),'attributes':['id',_0x6239('0x4')]}]},{'model':_0x6239('0xc'),'as':'Fields','attributes':['id',_0x6239('0x8'),_0x6239('0xd'),_0x6239('0x12'),_0x6239('0x13'),_0x6239('0x14'),'variableName'],'include':[{'model':_0x6239('0xf'),'as':'Variable','attributes':['id',_0x6239('0x4')]}]}]}]},'log':_0x6239('0x3')});};};
\ No newline at end of file
index 8d6cde4..d4a3fc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5da=['description','host','zone','clientId','clientSecret','serverUrl','refreshToken','Configurations','moduleCreate','moduleSearch','ZohoField','type','variableName','Variable','Descriptions','content','keyType','Fields','idField','customField','../../client','getZohoAccounts','Request','GetZohoAccount','name'];(function(_0x5f0290,_0x195613){var _0x46157a=function(_0x5a1ae0){while(--_0x5a1ae0){_0x5f0290['push'](_0x5f0290['shift']());}};_0x46157a(++_0x195613);}(_0xd5da,0x140));var _0xad5d=function(_0x494d64,_0x43cd94){_0x494d64=_0x494d64-0x0;var _0x80650c=_0xd5da[_0x494d64];return _0x80650c;};'use strict';var client=require(_0xad5d('0x0'));exports[_0xad5d('0x1')]=function(){return function(_0x5ea0e3){return client[_0xad5d('0x2')](_0xad5d('0x3'),{'options':{'raw':![],'attributes':['id',_0xad5d('0x4'),_0xad5d('0x5'),_0xad5d('0x6'),_0xad5d('0x7'),_0xad5d('0x8'),_0xad5d('0x9'),_0xad5d('0xa'),'code',_0xad5d('0xb')],'include':[{'model':'ZohoConfiguration','as':_0xad5d('0xc'),'attributes':['id','name',_0xad5d('0xd'),_0xad5d('0xe'),'description'],'include':[{'model':_0xad5d('0xf'),'as':'Subjects','attributes':['id',_0xad5d('0x10'),'content',_0xad5d('0x11')],'include':[{'model':_0xad5d('0x12'),'as':'Variable','attributes':['id',_0xad5d('0x4')]}]},{'model':_0xad5d('0xf'),'as':_0xad5d('0x13'),'attributes':['id',_0xad5d('0x10'),_0xad5d('0x14'),'key',_0xad5d('0x15'),'keyContent','variableName'],'include':[{'model':'Variable','as':_0xad5d('0x12'),'attributes':['id',_0xad5d('0x4')]}]},{'model':_0xad5d('0xf'),'as':_0xad5d('0x16'),'attributes':['id',_0xad5d('0x10'),_0xad5d('0x14'),_0xad5d('0x17'),'nameField',_0xad5d('0x18'),_0xad5d('0x11')],'include':[{'model':_0xad5d('0x12'),'as':_0xad5d('0x12'),'attributes':['id','name']}]}]}]},'log':_0xad5d('0x3')});};};
\ No newline at end of file
+var _0x2ae5=['idField','nameField','GetZohoAccount','../../client','getZohoAccounts','Request','description','clientSecret','serverUrl','code','refreshToken','ZohoConfiguration','Configurations','moduleCreate','ZohoField','Subjects','type','variableName','name','Descriptions','content','key','keyContent','Variable','Fields'];(function(_0x50224a,_0x225d85){var _0x248354=function(_0x46a4e7){while(--_0x46a4e7){_0x50224a['push'](_0x50224a['shift']());}};_0x248354(++_0x225d85);}(_0x2ae5,0x67));var _0x52ae=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x2ae5[_0x47aa64];return _0x549c7a;};'use strict';var client=require(_0x52ae('0x0'));exports[_0x52ae('0x1')]=function(){return function(_0x1e8dc7){return client[_0x52ae('0x2')]('GetZohoAccount',{'options':{'raw':![],'attributes':['id','name',_0x52ae('0x3'),'host','zone','clientId',_0x52ae('0x4'),_0x52ae('0x5'),_0x52ae('0x6'),_0x52ae('0x7')],'include':[{'model':_0x52ae('0x8'),'as':_0x52ae('0x9'),'attributes':['id','name',_0x52ae('0xa'),'moduleSearch',_0x52ae('0x3')],'include':[{'model':_0x52ae('0xb'),'as':_0x52ae('0xc'),'attributes':['id',_0x52ae('0xd'),'content',_0x52ae('0xe')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x52ae('0xf')]}]},{'model':_0x52ae('0xb'),'as':_0x52ae('0x10'),'attributes':['id',_0x52ae('0xd'),_0x52ae('0x11'),_0x52ae('0x12'),'keyType',_0x52ae('0x13'),_0x52ae('0xe')],'include':[{'model':_0x52ae('0x14'),'as':_0x52ae('0x14'),'attributes':['id',_0x52ae('0xf')]}]},{'model':'ZohoField','as':_0x52ae('0x15'),'attributes':['id','type',_0x52ae('0x11'),_0x52ae('0x16'),_0x52ae('0x17'),'customField',_0x52ae('0xe')],'include':[{'model':_0x52ae('0x14'),'as':_0x52ae('0x14'),'attributes':['id',_0x52ae('0xf')]}]}]}]},'log':_0x52ae('0x18')});};};
\ No newline at end of file
index 7433c5b..99eda4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc405=['uniqueid','voiceDialReport','TALKING','starttime','endtime','outbound','lodash','util','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','SIP/%s','interface','diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','queue','agent','accountcode','toNumber'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xc405,0x165));var _0x5c40=function(_0x1d6eb4,_0x2a20d7){_0x1d6eb4=_0x1d6eb4-0x0;var _0x1277f0=_0xc405[_0x1d6eb4];return _0x1277f0;};'use strict';var moment=require('moment');var _=require(_0x5c40('0x0'));var util=require(_0x5c40('0x1'));var client=require('../client');exports[_0x5c40('0x2')]=function(_0x3a78fc){var _0x4ecee1=_0x3a78fc['queuecallercompleteAt']||_0x3a78fc[_0x5c40('0x3')];return client[_0x5c40('0x4')](_0x5c40('0x5'),{'body':{'channel':_0x5c40('0x6'),'membername':_0x3a78fc[_0x5c40('0x7')],'interface':_[_0x5c40('0x8')](_0x3a78fc['interface'])?util['format'](_0x5c40('0x9'),_0x3a78fc[_0x5c40('0x7')]):_0x3a78fc[_0x5c40('0xa')],'type':'TALKING','enterAt':_0x3a78fc['queuecallerleaveAt'],'exitAt':_0x4ecee1,'duration':moment(_0x4ecee1)[_0x5c40('0xb')](_0x3a78fc[_0x5c40('0xc')],_0x5c40('0xd')),'data1':_0x5c40('0xe'),'data2':_0x3a78fc[_0x5c40('0xf')],'data3':_0x3a78fc[_0x5c40('0x10')],'data4':null,'data5':_0x3a78fc[_0x5c40('0x11')],'role':_0x5c40('0x12'),'internal':_0x3a78fc[_0x5c40('0x13')]?_[_0x5c40('0x14')](_0x3a78fc[_0x5c40('0x13')]):undefined,'uniqueid':_0x3a78fc[_0x5c40('0x15')]},'log':_0x5c40('0x5')});};exports[_0x5c40('0x16')]=function(_0x4d9f32){return client[_0x5c40('0x4')](_0x5c40('0x5'),{'body':{'channel':_0x5c40('0x6'),'membername':_0x4d9f32['membername'],'interface':_0x4d9f32[_0x5c40('0xa')],'type':_0x5c40('0x17'),'enterAt':_0x4d9f32[_0x5c40('0x18')],'exitAt':_0x4d9f32['endtime'],'duration':moment(_0x4d9f32[_0x5c40('0x19')])['diff'](_0x4d9f32['starttime'],_0x5c40('0xd'))>=0x0?moment(_0x4d9f32['endtime'])[_0x5c40('0xb')](_0x4d9f32[_0x5c40('0x18')],_0x5c40('0xd')):null,'data1':_0x5c40('0x1a'),'data2':_0x4d9f32[_0x5c40('0x13')],'data3':_0x4d9f32['exten'],'data4':_0x4d9f32['dialstring']||null,'role':_0x5c40('0x12'),'internal':_0x4d9f32[_0x5c40('0x13')]?_[_0x5c40('0x14')](_0x4d9f32[_0x5c40('0x13')]):undefined,'uniqueid':_0x4d9f32[_0x5c40('0x15')]},'log':_0x5c40('0x5')});};
\ No newline at end of file
+var _0x52e5=['interface','TALKING','queuecallerleaveAt','seconds','inbound','calleridnum','exten','accountcode','toNumber','uniqueid','voiceDialReport','membername','starttime','endtime','diff','outbound','dialstring','agent','moment','lodash','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice','format','SIP/%s','lastAssignedTo'];(function(_0x5d4b12,_0x10e021){var _0x3878a6=function(_0x4b9b22){while(--_0x4b9b22){_0x5d4b12['push'](_0x5d4b12['shift']());}};_0x3878a6(++_0x10e021);}(_0x52e5,0x17e));var _0x552e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x52e5[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x552e('0x0'));var _=require(_0x552e('0x1'));var util=require('util');var client=require('../client');exports[_0x552e('0x2')]=function(_0x57d74a){var _0x11e7c9=_0x57d74a['queuecallercompleteAt']||_0x57d74a[_0x552e('0x3')];return client[_0x552e('0x4')](_0x552e('0x5'),{'body':{'channel':_0x552e('0x6'),'membername':_0x57d74a['lastAssignedTo'],'interface':_['isNil'](_0x57d74a['interface'])?util[_0x552e('0x7')](_0x552e('0x8'),_0x57d74a[_0x552e('0x9')]):_0x57d74a[_0x552e('0xa')],'type':_0x552e('0xb'),'enterAt':_0x57d74a[_0x552e('0xc')],'exitAt':_0x11e7c9,'duration':moment(_0x11e7c9)['diff'](_0x57d74a[_0x552e('0xc')],_0x552e('0xd')),'data1':_0x552e('0xe'),'data2':_0x57d74a[_0x552e('0xf')],'data3':_0x57d74a[_0x552e('0x10')],'data4':null,'data5':_0x57d74a['queue'],'role':'agent','internal':_0x57d74a[_0x552e('0x11')]?_[_0x552e('0x12')](_0x57d74a['accountcode']):undefined,'uniqueid':_0x57d74a[_0x552e('0x13')]},'log':_0x552e('0x5')});};exports[_0x552e('0x14')]=function(_0x28d5e5){return client[_0x552e('0x4')](_0x552e('0x5'),{'body':{'channel':_0x552e('0x6'),'membername':_0x28d5e5[_0x552e('0x15')],'interface':_0x28d5e5[_0x552e('0xa')],'type':'TALKING','enterAt':_0x28d5e5[_0x552e('0x16')],'exitAt':_0x28d5e5['endtime'],'duration':moment(_0x28d5e5[_0x552e('0x17')])['diff'](_0x28d5e5['starttime'],_0x552e('0xd'))>=0x0?moment(_0x28d5e5[_0x552e('0x17')])[_0x552e('0x18')](_0x28d5e5[_0x552e('0x16')],'seconds'):null,'data1':_0x552e('0x19'),'data2':_0x28d5e5[_0x552e('0x11')],'data3':_0x28d5e5[_0x552e('0x10')],'data4':_0x28d5e5[_0x552e('0x1a')]||null,'role':_0x552e('0x1b'),'internal':_0x28d5e5['accountcode']?_['toNumber'](_0x28d5e5['accountcode']):undefined,'uniqueid':_0x28d5e5[_0x552e('0x13')]},'log':_0x552e('0x5')});};
\ No newline at end of file
index 67932b0..e92d4d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa56c=['../client','getSettings','ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval'];(function(_0x40b493,_0x4050de){var _0x548365=function(_0x8ceba7){while(--_0x8ceba7){_0x40b493['push'](_0x40b493['shift']());}};_0x548365(++_0x4050de);}(_0xa56c,0x1f4));var _0xca56=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0xa56c[_0x4a3898];return _0x25ceb0;};'use strict';var client=require(_0xca56('0x0'));exports[_0xca56('0x1')]=function(){return client['Request'](_0xca56('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xca56('0x3'),_0xca56('0x4')]},'log':'GetSettings'});};
\ No newline at end of file
+var _0x3f7c=['stopRecordingOnTransfer','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x15606a,_0x562872){var _0x16a540=function(_0x5ce54b){while(--_0x5ce54b){_0x15606a['push'](_0x15606a['shift']());}};_0x16a540(++_0x562872);}(_0x3f7c,0xaa));var _0xc3f7=function(_0x846d7c,_0x37a8cc){_0x846d7c=_0x846d7c-0x0;var _0x1137e0=_0x3f7c[_0x846d7c];return _0x1137e0;};'use strict';var client=require(_0xc3f7('0x0'));exports[_0xc3f7('0x1')]=function(){return client[_0xc3f7('0x2')](_0xc3f7('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc3f7('0x4'),'previewRecallmeReminderInterval']},'log':_0xc3f7('0x5')});};
\ No newline at end of file
index 37b1653..004d6fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x038f=['Request','GetTemplate','name','html','../client','getTemplates'];(function(_0x6c27a6,_0x25a43d){var _0x3f477f=function(_0x4c3389){while(--_0x4c3389){_0x6c27a6['push'](_0x6c27a6['shift']());}};_0x3f477f(++_0x25a43d);}(_0x038f,0x106));var _0xf038=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0x038f[_0x2ae2ad];return _0x26dbd7;};'use strict';var client=require(_0xf038('0x0'));exports[_0xf038('0x1')]=function(_0x2b362b){return function(_0x52e3d8){return client[_0xf038('0x2')](_0xf038('0x3'),{'options':{'raw':!![],'attributes':['id',_0xf038('0x4'),_0xf038('0x5')]},'log':'GetTemplate'});};};
\ No newline at end of file
+var _0x2426=['name','../client','getTemplates','Request','GetTemplate'];(function(_0x293866,_0x33ab3e){var _0x4b33c8=function(_0x26a041){while(--_0x26a041){_0x293866['push'](_0x293866['shift']());}};_0x4b33c8(++_0x33ab3e);}(_0x2426,0x155));var _0x6242=function(_0x285ade,_0x443002){_0x285ade=_0x285ade-0x0;var _0xf354cd=_0x2426[_0x285ade];return _0xf354cd;};'use strict';var client=require(_0x6242('0x0'));exports[_0x6242('0x1')]=function(_0xa09a37){return function(_0x4179a3){return client[_0x6242('0x2')](_0x6242('0x3'),{'options':{'raw':!![],'attributes':['id',_0x6242('0x4'),'html']},'log':_0x6242('0x3')});};};
\ No newline at end of file
index d5cf971..d98b04b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3607=['../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data1','data2','data3','data7'];(function(_0x2b4c49,_0x5a3e8a){var _0x18b246=function(_0x1d4c2f){while(--_0x1d4c2f){_0x2b4c49['push'](_0x2b4c49['shift']());}};_0x18b246(++_0x5a3e8a);}(_0x3607,0x8c));var _0x7360=function(_0x39c564,_0x1aff10){_0x39c564=_0x39c564-0x0;var _0x564453=_0x3607[_0x39c564];return _0x564453;};'use strict';var client=require(_0x7360('0x0'));exports[_0x7360('0x1')]=function(_0x21cb53){return function(_0x23a3ab){return client[_0x7360('0x2')](_0x7360('0x3'),{'options':{'raw':![],'attributes':['id',_0x7360('0x4'),_0x7360('0x5'),_0x7360('0x6')],'include':[{'model':_0x7360('0x7'),'as':_0x7360('0x8'),'attributes':['id',_0x7360('0x9'),_0x7360('0xa'),_0x7360('0xb')]},{'model':'Condition','as':_0x7360('0xc'),'attributes':['id',_0x7360('0x9'),_0x7360('0xa'),_0x7360('0xb')]},{'model':_0x7360('0xd'),'as':_0x7360('0xe'),'attributes':['id',_0x7360('0xf'),_0x7360('0x10'),_0x7360('0x11'),_0x7360('0x12'),'data4','data5','data6',_0x7360('0x13')]}]},'log':_0x7360('0x3')});};};
\ No newline at end of file
+var _0xc10b=['action','data2','data6','data7','GetTrigger','../client','getTriggers','Request','name','channel','status','AllConditions','field','operator','value','AnyConditions','Action','Actions'];(function(_0x1c1417,_0x4565a9){var _0x1519fd=function(_0x536061){while(--_0x536061){_0x1c1417['push'](_0x1c1417['shift']());}};_0x1519fd(++_0x4565a9);}(_0xc10b,0x71));var _0xbc10=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xc10b[_0x411017];return _0x2adeea;};'use strict';var client=require(_0xbc10('0x0'));exports[_0xbc10('0x1')]=function(_0x2dff21){return function(_0x10b680){return client[_0xbc10('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xbc10('0x3'),_0xbc10('0x4'),_0xbc10('0x5')],'include':[{'model':'Condition','as':_0xbc10('0x6'),'attributes':['id',_0xbc10('0x7'),_0xbc10('0x8'),_0xbc10('0x9')]},{'model':'Condition','as':_0xbc10('0xa'),'attributes':['id',_0xbc10('0x7'),_0xbc10('0x8'),_0xbc10('0x9')]},{'model':_0xbc10('0xb'),'as':_0xbc10('0xc'),'attributes':['id',_0xbc10('0xd'),'data1',_0xbc10('0xe'),'data3','data4','data5',_0xbc10('0xf'),_0xbc10('0x10')]}]},'log':_0xbc10('0x11')});};};
\ No newline at end of file
index c54b034..86217b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2af3=['../client','Request','GetTrunk','registry'];(function(_0x3a1c5b,_0x59c3f9){var _0x1fad5b=function(_0x253ffb){while(--_0x253ffb){_0x3a1c5b['push'](_0x3a1c5b['shift']());}};_0x1fad5b(++_0x59c3f9);}(_0x2af3,0xbc));var _0x32af=function(_0x19a8d0,_0x22d91e){_0x19a8d0=_0x19a8d0-0x0;var _0x1e1dc8=_0x2af3[_0x19a8d0];return _0x1e1dc8;};'use strict';var client=require(_0x32af('0x0'));exports['getTrunks']=function(_0x3fa2c1){return function(_0x2cbf01){return client[_0x32af('0x1')](_0x32af('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x32af('0x3'),'defaultuser']},'log':'GetTrunk'});};};
\ No newline at end of file
+var _0xfb09=['registry','../client','GetTrunk','name'];(function(_0x4bad01,_0x22a996){var _0x7902=function(_0x3f7176){while(--_0x3f7176){_0x4bad01['push'](_0x4bad01['shift']());}};_0x7902(++_0x22a996);}(_0xfb09,0x19d));var _0x9fb0=function(_0x281adb,_0xb6aeed){_0x281adb=_0x281adb-0x0;var _0x30b690=_0xfb09[_0x281adb];return _0x30b690;};'use strict';var client=require(_0x9fb0('0x0'));exports['getTrunks']=function(_0x432019){return function(_0x5d5011){return client['Request'](_0x9fb0('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x9fb0('0x2'),_0x9fb0('0x3'),'defaultuser']},'log':_0x9fb0('0x1')});};};
\ No newline at end of file
index 508fcb5..e5546c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x1d3b56,_0x6bc6c0){var _0xcd95c2=function(_0x36b097){while(--_0x36b097){_0x1d3b56['push'](_0x1d3b56['shift']());}};_0xcd95c2(++_0x6bc6c0);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});};
\ No newline at end of file
+var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x5d02e3,_0x5b769f){var _0x2b218b=function(_0x3ae068){while(--_0x3ae068){_0x5d02e3['push'](_0x5d02e3['shift']());}};_0x2b218b(++_0x5b769f);}(_0x9c44,0x178));var _0x49c4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});};
\ No newline at end of file
index e5e4b5e..5e528e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b1b=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x10683c,_0x867950){var _0x15ecf0=function(_0x9e46e3){while(--_0x9e46e3){_0x10683c['push'](_0x10683c['shift']());}};_0x15ecf0(++_0x867950);}(_0x3b1b,0x137));var _0xb3b1=function(_0xc70507,_0x3d368d){_0xc70507=_0xc70507-0x0;var _0x5189c4=_0x3b1b[_0xc70507];return _0x5189c4;};'use strict';var client=require(_0xb3b1('0x0'));exports[_0xb3b1('0x1')]=function(_0x3567c1){return client[_0xb3b1('0x2')](_0xb3b1('0x3'),{'body':_0x3567c1,'log':'CreateVoiceAgentReport'});};exports[_0xb3b1('0x4')]=function(_0x3dd58f,_0x2d28ac,_0xcc1194){return client['Request']('UpdateVoiceAgentReport',{'body':_0x3dd58f,'options':{'where':{'uniqueid':_0x2d28ac,'interface':_0xcc1194,'agentcomplete':!![]}},'log':_0xb3b1('0x5')});};
\ No newline at end of file
+var _0x5bb2=['../client','create','Request','update','UpdateVoiceAgentReport'];(function(_0x5e704b,_0x5edb54){var _0x20e55e=function(_0x318863){while(--_0x318863){_0x5e704b['push'](_0x5e704b['shift']());}};_0x20e55e(++_0x5edb54);}(_0x5bb2,0x1b3));var _0x25bb=function(_0x4aebae,_0x547eb0){_0x4aebae=_0x4aebae-0x0;var _0x3a7db9=_0x5bb2[_0x4aebae];return _0x3a7db9;};'use strict';var client=require(_0x25bb('0x0'));exports[_0x25bb('0x1')]=function(_0x3f7a6a){return client[_0x25bb('0x2')]('CreateVoiceAgentReport',{'body':_0x3f7a6a,'log':'CreateVoiceAgentReport'});};exports[_0x25bb('0x3')]=function(_0x5dade5,_0x510bf4,_0x267368){return client[_0x25bb('0x2')](_0x25bb('0x4'),{'body':_0x5dade5,'options':{'where':{'uniqueid':_0x510bf4,'interface':_0x267368,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});};
\ No newline at end of file
index a9cda02..2a4537d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86d7=['YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','billableseconds','util','lodash','../client','create','Request','calleridnum','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format'];(function(_0x49d280,_0x33d68f){var _0x25274a=function(_0x8ace90){while(--_0x8ace90){_0x49d280['push'](_0x49d280['shift']());}};_0x25274a(++_0x33d68f);}(_0x86d7,0xa5));var _0x786d=function(_0x33370f,_0x26ed75){_0x33370f=_0x33370f-0x0;var _0x39965f=_0x86d7[_0x33370f];return _0x39965f;};'use strict';var moment=require('moment');var util=require(_0x786d('0x0'));var _=require(_0x786d('0x1'));var client=require(_0x786d('0x2'));exports[_0x786d('0x3')]=function(_0xa7ef94){return client[_0x786d('0x4')]('CreateVoiceCallReport',{'body':_['merge'](_0xa7ef94,{'source':_0xa7ef94[_0x786d('0x5')],'destinationcontext':_0xa7ef94['context'],'callerid':_0xa7ef94[_0x786d('0x6')],'amaflags':_0x786d('0x7')}),'log':_0x786d('0x8')});};exports[_0x786d('0x9')]=function(){return function(){return client[_0x786d('0x4')](_0x786d('0xa'),{'options':{'where':{'type':[_0x786d('0xb')],'createdAt':{'$between':[moment()[_0x786d('0xc')](_0x786d('0xd'))[_0x786d('0xe')](_0x786d('0xf')),moment()[_0x786d('0x10')](_0x786d('0xd'))[_0x786d('0xe')](_0x786d('0xf'))]}},'attributes':[_0x786d('0x11'),'disposition',_0x786d('0x12'),_0x786d('0x13')]},'log':'GetVoiceCallReports'});};};
\ No newline at end of file
+var _0xb28e=['Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create'];(function(_0x3be8e8,_0x246a8f){var _0x5f7c64=function(_0x14b674){while(--_0x14b674){_0x3be8e8['push'](_0x3be8e8['shift']());}};_0x5f7c64(++_0x246a8f);}(_0xb28e,0x19f));var _0xeb28=function(_0x1a77e8,_0x374c98){_0x1a77e8=_0x1a77e8-0x0;var _0x1ea975=_0xb28e[_0x1a77e8];return _0x1ea975;};'use strict';var moment=require(_0xeb28('0x0'));var util=require(_0xeb28('0x1'));var _=require(_0xeb28('0x2'));var client=require(_0xeb28('0x3'));exports[_0xeb28('0x4')]=function(_0x4f1247){return client[_0xeb28('0x5')](_0xeb28('0x6'),{'body':_[_0xeb28('0x7')](_0x4f1247,{'source':_0x4f1247[_0xeb28('0x8')],'destinationcontext':_0x4f1247[_0xeb28('0x9')],'callerid':_0x4f1247[_0xeb28('0xa')],'amaflags':'DOCUMENTATION'}),'log':_0xeb28('0x6')});};exports[_0xeb28('0xb')]=function(){return function(){return client['Request'](_0xeb28('0xc'),{'options':{'where':{'type':[_0xeb28('0xd')],'createdAt':{'$between':[moment()['startOf'](_0xeb28('0xe'))[_0xeb28('0xf')](_0xeb28('0x10')),moment()[_0xeb28('0x11')]('day')[_0xeb28('0xf')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xeb28('0x12'),'disposition','duration',_0xeb28('0x13')]},'log':_0xeb28('0x14')});};};
\ No newline at end of file
index cc3e268..8dd2746 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x666b=['CreateVoiceDialReport'];(function(_0x5295a5,_0x2f106a){var _0x499291=function(_0x5e2f29){while(--_0x5e2f29){_0x5295a5['push'](_0x5295a5['shift']());}};_0x499291(++_0x2f106a);}(_0x666b,0x11a));var _0xb666=function(_0x46ab02,_0x46f430){_0x46ab02=_0x46ab02-0x0;var _0x39d9a4=_0x666b[_0x46ab02];return _0x39d9a4;};'use strict';var client=require('../client');exports['create']=function(_0x2a6639){return client['Request'](_0xb666('0x0'),{'body':_0x2a6639,'log':_0xb666('0x0')});};
\ No newline at end of file
+var _0x85ed=['Request','CreateVoiceDialReport','../client','create'];(function(_0x350ed4,_0x44d1f4){var _0x21ab85=function(_0x1cc02d){while(--_0x1cc02d){_0x350ed4['push'](_0x350ed4['shift']());}};_0x21ab85(++_0x44d1f4);}(_0x85ed,0xda));var _0xd85e=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x85ed[_0x341e0f];return _0x59555a;};'use strict';var client=require(_0xd85e('0x0'));exports[_0xd85e('0x1')]=function(_0x5f20bf){return client[_0xd85e('0x2')](_0xd85e('0x3'),{'body':_0x5f20bf,'log':'CreateVoiceDialReport'});};
\ No newline at end of file
index 998f875..f808887 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1789=['recordingFormat','../client','getVoiceExtensions','Request','exten'];(function(_0x5548be,_0x38f424){var _0x225396=function(_0x39f972){while(--_0x39f972){_0x5548be['push'](_0x5548be['shift']());}};_0x225396(++_0x38f424);}(_0x1789,0x92));var _0x9178=function(_0x53f005,_0xfae300){_0x53f005=_0x53f005-0x0;var _0x3c3464=_0x1789[_0x53f005];return _0x3c3464;};'use strict';var client=require(_0x9178('0x0'));exports[_0x9178('0x1')]=function(){return function(){return client[_0x9178('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x9178('0x3'),_0x9178('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x9178('0x1')});};};
\ No newline at end of file
+var _0x91a7=['Request','GetVoiceExtension','recordingFormat','getVoiceExtensions'];(function(_0x199627,_0xbf0da7){var _0x3c4801=function(_0x4af842){while(--_0x4af842){_0x199627['push'](_0x199627['shift']());}};_0x3c4801(++_0xbf0da7);}(_0x91a7,0xe7));var _0x791a=function(_0x2060ea,_0x2cd466){_0x2060ea=_0x2060ea-0x0;var _0x30f1cb=_0x91a7[_0x2060ea];return _0x30f1cb;};'use strict';var client=require('../client');exports[_0x791a('0x0')]=function(){return function(){return client[_0x791a('0x1')](_0x791a('0x2'),{'options':{'raw':!![],'attributes':['id','exten',_0x791a('0x3')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};};
\ No newline at end of file
index b27ca07..f3e6500 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b13=['dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','callAdditionalPhoneAfterMin','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x368027,_0x48d604){var _0x1c3689=function(_0x5b8603){while(--_0x5b8603){_0x368027['push'](_0x368027['shift']());}};_0x1c3689(++_0x48d604);}(_0x1b13,0xcf));var _0x31b1=function(_0x1d36ad,_0x91b0b2){_0x1d36ad=_0x1d36ad-0x0;var _0x175a94=_0x1b13[_0x1d36ad];return _0x175a94;};'use strict';var client=require('../client');exports[_0x31b1('0x0')]=function(){return function(){return client[_0x31b1('0x1')](_0x31b1('0x2'),{'options':{'raw':![],'attributes':['id',_0x31b1('0x3'),_0x31b1('0x4'),_0x31b1('0x5'),_0x31b1('0x6'),_0x31b1('0x7'),_0x31b1('0x8'),'dialActive',_0x31b1('0x9'),_0x31b1('0xa'),'dialLimitQueue',_0x31b1('0xb'),'dialPredictiveOptimization',_0x31b1('0xc'),_0x31b1('0xd'),_0x31b1('0xe'),_0x31b1('0xf'),'dialOriginateTimeout',_0x31b1('0x10'),_0x31b1('0x11'),'dialQueueProject',_0x31b1('0x12'),_0x31b1('0x13'),_0x31b1('0x14'),_0x31b1('0x15'),_0x31b1('0x16'),_0x31b1('0x17'),_0x31b1('0x18'),'dialTimezone',_0x31b1('0x19'),_0x31b1('0x1a'),_0x31b1('0x1b'),_0x31b1('0x1c'),_0x31b1('0x1d'),_0x31b1('0x1e'),_0x31b1('0x1f'),'dialAMDTotalAnalysisTime',_0x31b1('0x20'),'dialAMDBetweenWordsSilence',_0x31b1('0x21'),_0x31b1('0x22'),_0x31b1('0x23'),_0x31b1('0x24'),'dialRecallMeTimeout','dialRecallInQueue',_0x31b1('0x25'),_0x31b1('0x26'),'dialAgiAfterHangupClient',_0x31b1('0x27'),_0x31b1('0x7'),_0x31b1('0x28'),_0x31b1('0x29'),_0x31b1('0x2a'),_0x31b1('0x2b'),'dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry',_0x31b1('0x2c'),'dialAgentRejectMaxRetry',_0x31b1('0x2d'),_0x31b1('0x2e'),_0x31b1('0x2f'),'dialPredictiveIntervalMinThreshold',_0x31b1('0x30'),'dialPreviewRecallmeReminder',_0x31b1('0x31')],'include':[{'model':_0x31b1('0x32'),'as':'Trunk','attributes':['id',_0x31b1('0x3'),_0x31b1('0x33'),_0x31b1('0x34')]},{'model':_0x31b1('0x35'),'as':_0x31b1('0x36'),'attributes':['id','name']},{'model':_0x31b1('0x32'),'as':'TrunkBackup','attributes':['id',_0x31b1('0x3'),_0x31b1('0x33'),_0x31b1('0x34')]},{'model':_0x31b1('0x37'),'as':_0x31b1('0x37'),'attributes':['id','name'],'include':[{'model':_0x31b1('0x37'),'as':_0x31b1('0x38'),'attributes':['id',_0x31b1('0x3'),_0x31b1('0x39')]}]}]},'log':_0x31b1('0x0')});};};
\ No newline at end of file
+var _0x278c=['callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','../client','getVoiceQueues','GetVoiceQueue','name','acwTimeout','monitor_format','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialOrderByScheduledAt','dialQueueProject2','strategy','dialCutDigit','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk'];(function(_0x312d3f,_0x1b1c8e){var _0x1a22f2=function(_0x32ec49){while(--_0x32ec49){_0x312d3f['push'](_0x312d3f['shift']());}};_0x1a22f2(++_0x1b1c8e);}(_0x278c,0x77));var _0xc278=function(_0x487496,_0x249683){_0x487496=_0x487496-0x0;var _0x539dc8=_0x278c[_0x487496];return _0x539dc8;};'use strict';var client=require(_0xc278('0x0'));exports[_0xc278('0x1')]=function(){return function(){return client['Request'](_0xc278('0x2'),{'options':{'raw':![],'attributes':['id',_0xc278('0x3'),'acw',_0xc278('0x4'),'autopause',_0xc278('0x5'),'type',_0xc278('0x6'),'dialMethod',_0xc278('0x7'),_0xc278('0x8'),_0xc278('0x9'),'dialPredictiveOptimization',_0xc278('0xa'),_0xc278('0xb'),_0xc278('0xc'),_0xc278('0xd'),_0xc278('0xe'),_0xc278('0xf'),'dialQueueTimeout','dialQueueProject',_0xc278('0x10'),_0xc278('0x11'),_0xc278('0x12'),_0xc278('0x13'),_0xc278('0x14'),'dialNoAnswerRetryFrequency',_0xc278('0x15'),_0xc278('0x16'),'dialGlobalInterval',_0xc278('0x17'),_0xc278('0x18'),_0xc278('0x19'),_0xc278('0x1a'),'dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0xc278('0x1b'),_0xc278('0x1c'),_0xc278('0x1d'),_0xc278('0x1e'),_0xc278('0x1f'),'timeout',_0xc278('0x20'),'dialRecallInQueue',_0xc278('0x21'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0xc278('0x22'),_0xc278('0x5'),_0xc278('0x23'),'dialRandomLastDigitCallerIdNumber',_0xc278('0x24'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency',_0xc278('0x25'),'dialDropRetryFrequency',_0xc278('0x26'),_0xc278('0x27'),'dialMachineMaxRetry',_0xc278('0x28'),_0xc278('0x29'),_0xc278('0x2a'),_0xc278('0x2b'),_0xc278('0x2c'),'dialPredictiveIntervalMinThreshold',_0xc278('0x2d'),_0xc278('0x2e'),_0xc278('0x2f')],'include':[{'model':_0xc278('0x30'),'as':_0xc278('0x30'),'attributes':['id',_0xc278('0x3'),_0xc278('0x31'),_0xc278('0x32')]},{'model':_0xc278('0x33'),'as':_0xc278('0x34'),'attributes':['id',_0xc278('0x3')]},{'model':_0xc278('0x30'),'as':_0xc278('0x35'),'attributes':['id',_0xc278('0x3'),'callerid','active']},{'model':_0xc278('0x36'),'as':_0xc278('0x36'),'attributes':['id',_0xc278('0x3')],'include':[{'model':_0xc278('0x36'),'as':'Intervals','attributes':['id',_0xc278('0x3'),_0xc278('0x37')]}]}]},'log':'getVoiceQueues'});};};
\ No newline at end of file
index 28595db..daa150b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x1e7b62,_0x33930e){var _0x4787e6=function(_0x4a652b){while(--_0x4a652b){_0x1e7b62['push'](_0x1e7b62['shift']());}};_0x4787e6(++_0x33930e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
+var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x3b5b1b,_0x4b49ed){var _0x2a9d66=function(_0x4a1be2){while(--_0x4a1be2){_0x3b5b1b['push'](_0x3b5b1b['shift']());}};_0x2a9d66(++_0x4b49ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
index d009f74..bcef09b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbcd=['GetVoiceQueueRtPauses','getVoiceQueueRtPauses','Request'];(function(_0x21ddb4,_0x2a9ab2){var _0xaf1b4c=function(_0x12e145){while(--_0x12e145){_0x21ddb4['push'](_0x21ddb4['shift']());}};_0xaf1b4c(++_0x2a9ab2);}(_0xcbcd,0x1c4));var _0xdcbc=function(_0x441f7a,_0x576321){_0x441f7a=_0x441f7a-0x0;var _0x4821da=_0xcbcd[_0x441f7a];return _0x4821da;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0x5aed1){return function(){return client[_0xdcbc('0x0')](_0xdcbc('0x1'),{'options':{'where':{'VoiceQueueId':_0x5aed1,'paused':!![]},'raw':!![]},'log':_0xdcbc('0x2')});};};
\ No newline at end of file
+var _0xe36d=['../client','getVoiceQueueRtPauses'];(function(_0x58d377,_0x2be35c){var _0x558340=function(_0x3aaf7e){while(--_0x3aaf7e){_0x58d377['push'](_0x58d377['shift']());}};_0x558340(++_0x2be35c);}(_0xe36d,0xd6));var _0xde36=function(_0x2711b2,_0x187b7d){_0x2711b2=_0x2711b2-0x0;var _0x33cdef=_0xe36d[_0x2711b2];return _0x33cdef;};'use strict';var client=require(_0xde36('0x0'));exports[_0xde36('0x1')]=function(_0x1e6522){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x1e6522,'paused':!![]},'raw':!![]},'log':_0xde36('0x1')});};};
\ No newline at end of file
index 2cfa95c..292c955 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x3d6d1d,_0x2925c5){var _0x4ed57b=function(_0x2a2c45){while(--_0x2a2c45){_0x3d6d1d['push'](_0x3d6d1d['shift']());}};_0x4ed57b(++_0x2925c5);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
+var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x4561be,_0xdbdb12){var _0x2d9ef9=function(_0x4b34f9){while(--_0x4b34f9){_0x4561be['push'](_0x4561be['shift']());}};_0x2d9ef9(++_0xdbdb12);}(_0x7a54,0x106));var _0x47a5=function(_0x4d7a9b,_0x4d4381){_0x4d7a9b=_0x4d7a9b-0x0;var _0x30e600=_0x7a54[_0x4d7a9b];return _0x30e600;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});};
\ No newline at end of file
index 2a63f87..2c06578 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b7e=['secondtransfererconnectedlinenum','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinename','transfereeexten','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname'];(function(_0x54c41c,_0xfdeaab){var _0x4bb4a6=function(_0x224ca3){while(--_0x224ca3){_0x54c41c['push'](_0x54c41c['shift']());}};_0x4bb4a6(++_0xfdeaab);}(_0x8b7e,0x199));var _0xe8b7=function(_0x3ec19d,_0x401dc8){_0x3ec19d=_0x3ec19d-0x0;var _0x3260b2=_0x8b7e[_0x3ec19d];return _0x3260b2;};'use strict';var client=require('../client');exports[_0xe8b7('0x0')]={};exports[_0xe8b7('0x1')]=function(_0x4618d7){return client[_0xe8b7('0x2')](_0xe8b7('0x3'),{'body':{'result':_0x4618d7[_0xe8b7('0x4')],'transfererchannel':_0x4618d7[_0xe8b7('0x5')],'transferercalleridnum':_0x4618d7['transferercalleridnum'],'transferercalleridname':_0x4618d7[_0xe8b7('0x6')],'transfererconnectedlinenum':_0x4618d7[_0xe8b7('0x7')],'transfererconnectedlinename':_0x4618d7['transfererconnectedlinename'],'transfereraccountcode':_0x4618d7[_0xe8b7('0x8')],'transferercontext':_0x4618d7[_0xe8b7('0x9')],'transfererexten':_0x4618d7['transfererexten'],'transfererlinkedid':_0x4618d7[_0xe8b7('0xa')],'transfereechannel':_0x4618d7[_0xe8b7('0xb')],'transfereecalleridnum':_0x4618d7['transfereecalleridnum'],'transfereecalleridname':_0x4618d7[_0xe8b7('0xc')],'transfereeconnectedlinenum':_0x4618d7['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x4618d7[_0xe8b7('0xd')],'transfereeaccountcode':_0x4618d7['transfereeaccountcode'],'transfereecontext':_0x4618d7['transfereecontext'],'transfereeexten':_0x4618d7[_0xe8b7('0xe')],'transfereelinkedid':_0x4618d7['transfereelinkedid'],'isexternal':_0x4618d7[_0xe8b7('0xf')],'context':_0x4618d7[_0xe8b7('0x10')],'extension':_0x4618d7[_0xe8b7('0x11')],'type':_0xe8b7('0x12')},'log':'CreateVoiceTransferReport'});};exports[_0xe8b7('0x13')]=function(_0x2b6ad4){return client[_0xe8b7('0x2')](_0xe8b7('0x3'),{'body':{'result':_0x2b6ad4['result'],'transfererchannel':_0x2b6ad4[_0xe8b7('0x14')],'transferercalleridnum':_0x2b6ad4[_0xe8b7('0x15')],'transferercalleridname':_0x2b6ad4[_0xe8b7('0x16')],'transfererconnectedlinenum':_0x2b6ad4[_0xe8b7('0x17')],'transfererconnectedlinename':_0x2b6ad4['secondtransfererconnectedlinename'],'transfereraccountcode':_0x2b6ad4['origtransfereraccountcode'],'transferercontext':_0x2b6ad4[_0xe8b7('0x18')],'transfererexten':_0x2b6ad4[_0xe8b7('0x19')],'transfererlinkedid':_0x2b6ad4[_0xe8b7('0x1a')],'transfereechannel':_0x2b6ad4['transfertargetchannel'],'transfereecalleridnum':_0x2b6ad4[_0xe8b7('0x1b')],'transfereecalleridname':_0x2b6ad4[_0xe8b7('0x1c')],'transfereeconnectedlinenum':_0x2b6ad4[_0xe8b7('0x1d')],'transfereeconnectedlinename':_0x2b6ad4[_0xe8b7('0x1e')],'transfereeaccountcode':_0x2b6ad4['transfertargetaccountcode'],'transfereecontext':_0x2b6ad4[_0xe8b7('0x1f')],'transfereeexten':_0x2b6ad4[_0xe8b7('0x20')],'transfereelinkedid':_0x2b6ad4['transfertargetlinkedid'],'isexternal':_0x2b6ad4[_0xe8b7('0xf')],'context':_0x2b6ad4[_0xe8b7('0x21')],'extension':_0x2b6ad4[_0xe8b7('0x22')],'type':_0xe8b7('0x23')},'log':_0xe8b7('0x3')});};
\ No newline at end of file
+var _0x6c60=['../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','Request','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','origtransferercontext','origtransfererexten','attended'];(function(_0x44ea1b,_0x36bbd3){var _0x239690=function(_0x3ec34b){while(--_0x3ec34b){_0x44ea1b['push'](_0x44ea1b['shift']());}};_0x239690(++_0x36bbd3);}(_0x6c60,0xf6));var _0x06c6=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x6c60[_0x2dea24];return _0x309d58;};'use strict';var client=require(_0x06c6('0x0'));exports[_0x06c6('0x1')]={};exports[_0x06c6('0x2')]=function(_0x4fe0df){return client['Request'](_0x06c6('0x3'),{'body':{'result':_0x4fe0df[_0x06c6('0x4')],'transfererchannel':_0x4fe0df[_0x06c6('0x5')],'transferercalleridnum':_0x4fe0df[_0x06c6('0x6')],'transferercalleridname':_0x4fe0df[_0x06c6('0x7')],'transfererconnectedlinenum':_0x4fe0df['transfererconnectedlinenum'],'transfererconnectedlinename':_0x4fe0df['transfererconnectedlinename'],'transfereraccountcode':_0x4fe0df[_0x06c6('0x8')],'transferercontext':_0x4fe0df[_0x06c6('0x9')],'transfererexten':_0x4fe0df[_0x06c6('0xa')],'transfererlinkedid':_0x4fe0df[_0x06c6('0xb')],'transfereechannel':_0x4fe0df[_0x06c6('0xc')],'transfereecalleridnum':_0x4fe0df['transfereecalleridnum'],'transfereecalleridname':_0x4fe0df[_0x06c6('0xd')],'transfereeconnectedlinenum':_0x4fe0df['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x4fe0df[_0x06c6('0xe')],'transfereeaccountcode':_0x4fe0df['transfereeaccountcode'],'transfereecontext':_0x4fe0df[_0x06c6('0xf')],'transfereeexten':_0x4fe0df[_0x06c6('0x10')],'transfereelinkedid':_0x4fe0df[_0x06c6('0x11')],'isexternal':_0x4fe0df[_0x06c6('0x12')],'context':_0x4fe0df[_0x06c6('0x13')],'extension':_0x4fe0df[_0x06c6('0x14')],'type':_0x06c6('0x15')},'log':_0x06c6('0x3')});};exports[_0x06c6('0x16')]=function(_0x2e4d86){return client[_0x06c6('0x17')]('CreateVoiceTransferReport',{'body':{'result':_0x2e4d86[_0x06c6('0x4')],'transfererchannel':_0x2e4d86[_0x06c6('0x18')],'transferercalleridnum':_0x2e4d86['origtransferercalleridnum'],'transferercalleridname':_0x2e4d86[_0x06c6('0x19')],'transfererconnectedlinenum':_0x2e4d86[_0x06c6('0x1a')],'transfererconnectedlinename':_0x2e4d86[_0x06c6('0x1b')],'transfereraccountcode':_0x2e4d86[_0x06c6('0x1c')],'transferercontext':_0x2e4d86[_0x06c6('0x1d')],'transfererexten':_0x2e4d86[_0x06c6('0x1e')],'transfererlinkedid':_0x2e4d86['origtransfererlinkedid'],'transfereechannel':_0x2e4d86[_0x06c6('0x1f')],'transfereecalleridnum':_0x2e4d86[_0x06c6('0x20')],'transfereecalleridname':_0x2e4d86[_0x06c6('0x21')],'transfereeconnectedlinenum':_0x2e4d86[_0x06c6('0x22')],'transfereeconnectedlinename':_0x2e4d86[_0x06c6('0x23')],'transfereeaccountcode':_0x2e4d86[_0x06c6('0x24')],'transfereecontext':_0x2e4d86[_0x06c6('0x25')],'transfereeexten':_0x2e4d86['transfertargetexten'],'transfereelinkedid':_0x2e4d86['transfertargetlinkedid'],'isexternal':_0x2e4d86[_0x06c6('0x12')],'context':_0x2e4d86[_0x06c6('0x26')],'extension':_0x2e4d86[_0x06c6('0x27')],'type':_0x06c6('0x28')},'log':_0x06c6('0x3')});};
\ No newline at end of file
index 08a6c49..726e33a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e24=['unmanaged','abandoned','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','length','find','undefined','values','uniqueid','channel','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','Channel\x20doesn\x27t\x20exist','map','channels','resolve','StopMixMonitor','destinationchannel','status','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','context','telephones','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','lodash','util','jayson/promise','validate','bluebird','../../../config/environment','../properties','listen','format','%s/%s','name','timers','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','talking','total','type'];(function(_0x3c5de4,_0x5be86f){var _0x1a360c=function(_0x846d46){while(--_0x846d46){_0x3c5de4['push'](_0x3c5de4['shift']());}};_0x1a360c(++_0x5be86f);}(_0x3e24,0x167));var _0x43e2=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x3e24[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var jayson=require(_0x43e2('0x2'));var schema=require(_0x43e2('0x3'));var BPromise=require(_0x43e2('0x4'));var moment=require('moment');var config=require(_0x43e2('0x5'));var properties=require(_0x43e2('0x6'));var ami=require('../ami');exports[_0x43e2('0x7')]=function(_0x18629c,_0x1a89fc,_0x28b144){return new BPromise(function(_0x43b5a7,_0x121e2e){var _0x23b2d8={'QueuePause':function(_0x59956d){return new Promise(function(_0xb75b,_0x2357bc){var _0x4bd2ce=util[_0x43e2('0x8')](_0x43e2('0x9'),'SIP',_0x59956d[_0x43e2('0xa')]);if(_0x18629c[_0x43e2('0xb')]&&_0x18629c['timers'][_0x4bd2ce]&&_0x18629c[_0x43e2('0xb')][_0x4bd2ce]['timer']){_0x18629c['timers'][_0x4bd2ce]['updateAcw']();}if(_0x18629c[_0x43e2('0xc')][_0x4bd2ce]){_0x18629c[_0x43e2('0xc')][_0x4bd2ce][_0x43e2('0xd')]({'statePause':_0x59956d[_0x43e2('0xe')]?!![]:![]});}_0xb75b({'code':0xc8,'message':_0x43e2('0xf')});});},'Reload':function(_0x68e82d){var _0x131bef=this;return new Promise(function(_0x802e2d,_0x10d166){if(ami[_0x43e2('0x10')]()==![]){return _0x10d166(_0x131bef[_0x43e2('0x11')](0x1f4,[config[_0x43e2('0x12')]['ip'],config['asterisk'][_0x43e2('0x13')],_0x43e2('0x14')][_0x43e2('0x15')]('\x20')));}_0x68e82d=_[_0x43e2('0x16')](_0x68e82d,_['keys'](properties['module']));_0x68e82d[_0x43e2('0x17')]=_0x43e2('0x18');return ami[_0x43e2('0x19')](_0x68e82d)[_0x43e2('0x1a')](function(_0x105cb8){_0x802e2d({'code':0xc8,'message':_0x105cb8[_0x43e2('0x1b')]});})[_0x43e2('0x1c')](function(_0x15ecb5){_0x10d166(_0x131bef[_0x43e2('0x11')](0x1f5,_0x15ecb5[_0x43e2('0x1b')]));});});},'Command':function(_0x4879e9){var _0x3ee34c=this;return new Promise(function(_0xb99e5d,_0x4de509){if(ami[_0x43e2('0x10')]()==![]){return _0x4de509(_0x3ee34c['error'](0x1f4,[config[_0x43e2('0x12')]['ip'],config[_0x43e2('0x12')][_0x43e2('0x13')],_0x43e2('0x14')][_0x43e2('0x15')]('\x20')));}_0x4879e9=_['pick'](_0x4879e9,_0x43e2('0x1d'));_0x4879e9[_0x43e2('0x17')]=_0x43e2('0x1e');return ami['Action'](_0x4879e9)[_0x43e2('0x1a')](function(_0x32f048){_0xb99e5d({'code':0xc8,'message':_0x32f048[_0x43e2('0x1f')]});})[_0x43e2('0x1c')](function(_0x4f20e6){_0x4de509(_0x3ee34c[_0x43e2('0x11')](0x1f5,_0x4f20e6[_0x43e2('0x1b')]));});});},'VoiceQueues':function(_0x215cb7){return new Promise(function(_0x3b7b22,_0x178223){var _0x2a593e=[];for(var _0x3ca16b in _0x18629c[_0x43e2('0x20')]){if(_0x18629c[_0x43e2('0x20')][_0x43e2('0x21')](_0x3ca16b)){var _0x1ea844=_0x18629c[_0x43e2('0x20')][_0x3ca16b];var _0x52ed49={'id':_0x1ea844['id'],'name':_0x1ea844[_0x43e2('0xa')],'strategy':_0x1ea844[_0x43e2('0x22')],'answered':_0x1ea844['answered'],'available':_0x1ea844[_0x43e2('0x23')],'loggedIn':_0x1ea844[_0x43e2('0x24')],'pTalking':_0x1ea844[_0x43e2('0x25')],'sumBillable':_0x1ea844[_0x43e2('0x26')],'sumDuration':_0x1ea844[_0x43e2('0x27')],'sumHoldTime':_0x1ea844['sumHoldTime']||0x0,'talking':_0x1ea844[_0x43e2('0x28')],'total':_0x1ea844[_0x43e2('0x29')],'type':_0x1ea844[_0x43e2('0x2a')],'unmanaged':_0x1ea844[_0x43e2('0x2b')],'abandoned':_0x1ea844[_0x43e2('0x2c')],'waiting':_0x1ea844[_0x43e2('0x2d')],'loggedInDb':_0x1ea844['loggedInDb']};if(_0x1ea844['type']===_0x43e2('0x2e')){_0x52ed49[_0x43e2('0x2f')]=_0x1ea844[_0x43e2('0x2f')];_0x52ed49[_0x43e2('0x30')]=_0x1ea844[_0x43e2('0x30')];_0x52ed49['dialOriginateCallerIdName']=_0x1ea844[_0x43e2('0x31')];_0x52ed49[_0x43e2('0x32')]=_0x1ea844[_0x43e2('0x32')];_0x52ed49[_0x43e2('0x33')]=_0x1ea844[_0x43e2('0x33')];_0x52ed49[_0x43e2('0x34')]=_0x1ea844[_0x43e2('0x34')];_0x52ed49['temp']=_0x1ea844['temp'];_0x52ed49[_0x43e2('0x35')]=_0x1ea844[_0x43e2('0x35')];_0x52ed49['outboundAnswerCallsDay']=_0x1ea844[_0x43e2('0x36')];_0x52ed49[_0x43e2('0x37')]=_0x1ea844['outboundBlacklistCallsDay'];_0x52ed49[_0x43e2('0x38')]=_0x1ea844['outboundBusyCallsDay'];_0x52ed49['outboundCongestionCallsDay']=_0x1ea844['outboundCongestionCallsDay'];_0x52ed49[_0x43e2('0x39')]=_0x1ea844['outboundDropCallsDayACS'];_0x52ed49[_0x43e2('0x3a')]=_0x1ea844[_0x43e2('0x3a')];_0x52ed49[_0x43e2('0x3b')]=_0x1ea844[_0x43e2('0x3b')];_0x52ed49[_0x43e2('0x3c')]=_0x1ea844[_0x43e2('0x3c')];_0x52ed49[_0x43e2('0x3d')]=_0x1ea844[_0x43e2('0x3d')];_0x52ed49[_0x43e2('0x3e')]=_0x1ea844[_0x43e2('0x3e')];_0x52ed49[_0x43e2('0x3f')]=_0x1ea844[_0x43e2('0x3f')];_0x52ed49[_0x43e2('0x40')]=_0x1ea844[_0x43e2('0x40')];_0x52ed49[_0x43e2('0x41')]=_0x1ea844[_0x43e2('0x41')];_0x52ed49[_0x43e2('0x42')]=_0x1ea844['predictiveIntervalAnsweredCalls'];_0x52ed49['predictiveIntervalAvgHoldtime']=_0x1ea844['predictiveIntervalAvgHoldtime'];_0x52ed49[_0x43e2('0x43')]=_0x1ea844[_0x43e2('0x43')];_0x52ed49['predictiveIntervalDroppedCallsCallersExit']=_0x1ea844['predictiveIntervalDroppedCallsCallersExit'];_0x52ed49[_0x43e2('0x44')]=_0x1ea844[_0x43e2('0x44')];_0x52ed49[_0x43e2('0x45')]=_0x1ea844[_0x43e2('0x45')];_0x52ed49[_0x43e2('0x46')]=_0x1ea844[_0x43e2('0x46')];_0x52ed49[_0x43e2('0x47')]=_0x1ea844[_0x43e2('0x47')];_0x52ed49[_0x43e2('0x48')]=_0x1ea844[_0x43e2('0x48')];_0x52ed49[_0x43e2('0x49')]=_0x1ea844[_0x43e2('0x49')];_0x52ed49[_0x43e2('0x4a')]=_0x1ea844[_0x43e2('0x4a')];_0x52ed49['predictiveIntervalTotalCalls']=_0x1ea844[_0x43e2('0x4b')];_0x52ed49['message']=_0x1ea844[_0x43e2('0x1b')];_0x52ed49['originated']=_0x1ea844[_0x43e2('0x4c')];_0x52ed49[_0x43e2('0x4d')]=_0x1ea844[_0x43e2('0x4d')];_0x52ed49['erlangCallToSecond']=_0x1ea844[_0x43e2('0x4e')];_0x52ed49['erlangAbandonmentRate']=_0x1ea844[_0x43e2('0x4f')];_0x52ed49[_0x43e2('0x50')]=_0x1ea844[_0x43e2('0x50')];_0x52ed49[_0x43e2('0x51')]=_0x1ea844['startPredictive'];_0x52ed49['startProgressive']=_0x1ea844[_0x43e2('0x52')];}if(_0x1ea844[_0x43e2('0x53')]){_0x52ed49[_0x43e2('0x53')]={'id':_0x1ea844[_0x43e2('0x53')]['id'],'name':_0x1ea844['Trunk'][_0x43e2('0xa')],'active':_0x1ea844[_0x43e2('0x53')][_0x43e2('0x54')],'callerid':_0x1ea844[_0x43e2('0x53')][_0x43e2('0x55')]};}if(_0x1ea844['Interval']){_0x52ed49[_0x43e2('0x56')]={'id':_0x1ea844['Interval']['id'],'name':_0x1ea844[_0x43e2('0x56')][_0x43e2('0xa')]};}_0x2a593e['push'](_0x52ed49);}}_0x3b7b22({'count':_0x2a593e[_0x43e2('0x57')],'rows':_0x2a593e});});},'UpdateVoiceQueue':function(_0x5cfa34){return new Promise(function(_0x4b4e68,_0x44d036){var _0x3f61c6=_[_0x43e2('0x58')](_0x18629c[_0x43e2('0x20')],{'id':parseInt(_0x5cfa34['id'])});var _0x13154c=_['omit'](_0x5cfa34,['id']);if(_0x3f61c6){for(var _0x1b001d in _0x13154c){if(typeof _0x13154c[_0x1b001d]!==_0x43e2('0x59')&&typeof _0x3f61c6[_0x1b001d]!==_0x43e2('0x59')){_0x3f61c6[_0x1b001d]=_0x13154c[_0x1b001d];}}_0x4b4e68(_0x3f61c6);}else{_0x44d036();}});},'VoiceChannels':function(_0xe5c04){return new Promise(function(_0x466448,_0x4114ce){var _0x29a9ef=_[_0x43e2('0x5a')](_0x18629c['channels']);_0x466448({'count':_0x29a9ef[_0x43e2('0x57')],'rows':_0x29a9ef});});},'VoiceChannelMixMonitor':function(_0x2832a4){var _0x497e12=this;return new Promise(function(_0x1af22d,_0x2b82be){if(ami[_0x43e2('0x10')]()==![]){return _0x2b82be(_0x497e12[_0x43e2('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x43e2('0x12')][_0x43e2('0x13')],_0x43e2('0x14')][_0x43e2('0x15')]('\x20')));}var _0x42f27d=schema(properties['voicechannel'])['validate'](_0x2832a4);if(_0x42f27d[_0x43e2('0x57')]>0x0){return _0x2b82be(_0x497e12[_0x43e2('0x11')](0x1f4,_['map'](_0x42f27d,_0x43e2('0x1b'))[_0x43e2('0x15')](',\x20')));}var _0x3888e8=_['find'](_0x18629c['channels'],{'uniqueid':_0x2832a4[_0x43e2('0x5b')]});if(_0x3888e8&&_0x3888e8[_0x43e2('0x5c')]){var _0x32148b=util[_0x43e2('0x8')](_0x43e2('0x5d'),_0x2832a4[_0x43e2('0x5e')]||_0x2832a4[_0x43e2('0x5b')],_0x2832a4[_0x43e2('0x8')]||_0x43e2('0x5f'));return ami['Action']({'action':_0x43e2('0x60'),'channel':_0x3888e8['channel'],'file':_0x32148b,'options':_0x43e2('0x61')})[_0x43e2('0x1a')](function(_0x2f8894){var _0x5a5b32=_[_0x43e2('0x58')](_0x3888e8[_0x43e2('0x62')],{'filename':_0x43e2('0x63')+_0x32148b[_0x43e2('0x64')]()});if(_[_0x43e2('0x65')](_0x5a5b32)){_0x3888e8[_0x43e2('0x62')][_0x43e2('0x66')]({'filename':_0x43e2('0x63')+_0x32148b[_0x43e2('0x64')](),'createdAt':moment()[_0x43e2('0x8')](_0x43e2('0x67')),'mixmonitorid':_0x2f8894[_0x43e2('0x68')],'status':_0x43e2('0x69')});}else{_0x5a5b32['mixmonitorid']=_0x2f8894['mixmonitorid'];_0x5a5b32['status']='rec';}_0x1af22d({'code':0xc8,'message':[_0x2832a4['uniqueid'],'MixMonitor\x20Success',_0x2f8894[_0x43e2('0x68')]]['join']('\x20'),'mixmonitorid':_0x2f8894['mixmonitorid']});})[_0x43e2('0x1c')](function(_0x4c6bb9){_0x2b82be(_0x497e12[_0x43e2('0x11')](0x1f5,[_0x2832a4['uniqueid'],_0x4c6bb9[_0x43e2('0x1b')][_0x43e2('0x64')]()][_0x43e2('0x15')]('\x20')));});}else{return _0x2b82be(_0x497e12[_0x43e2('0x11')](0x1f5,_0x43e2('0x6a')));}});},'VoiceChannelStopMixMonitor':function(_0x13685a){var _0x129bd0=this;return new Promise(function(_0x211b9c,_0x40d99b){if(ami[_0x43e2('0x10')]()==![]){return _0x40d99b(_0x129bd0['error'](0x1f4,[config[_0x43e2('0x12')]['ip'],config[_0x43e2('0x12')]['username'],_0x43e2('0x14')]['join']('\x20')));}var _0x5d6c3d=schema(properties['voicechannel'])['validate'](_0x13685a);if(_0x5d6c3d['length']>0x0){return _0x40d99b(_0x129bd0[_0x43e2('0x11')](0x1f4,_[_0x43e2('0x6b')](_0x5d6c3d,_0x43e2('0x1b'))[_0x43e2('0x15')](',\x20')));}var _0x49fc77=_['find'](_0x18629c[_0x43e2('0x6c')],{'uniqueid':_0x13685a[_0x43e2('0x5b')]});if(_0x49fc77){return BPromise[_0x43e2('0x6d')]()[_0x43e2('0x1a')](function(){if(_0x49fc77[_0x43e2('0x5c')]){return ami[_0x43e2('0x19')]({'action':_0x43e2('0x6e'),'channel':_0x49fc77[_0x43e2('0x5c')],'mixmonitorid':_0x13685a[_0x43e2('0x68')]})[_0x43e2('0x1c')](function(_0x1dd8c8){});}})['then'](function(){if(_0x49fc77[_0x43e2('0x6f')]){return ami[_0x43e2('0x19')]({'action':_0x43e2('0x6e'),'channel':_0x49fc77[_0x43e2('0x6f')],'mixmonitorid':_0x13685a[_0x43e2('0x68')]})['catch'](function(_0x39eded){});}})[_0x43e2('0x1a')](function(_0x4b06b8){var _0x137d0c=_['find'](_0x49fc77[_0x43e2('0x62')],{'mixmonitorid':_0x13685a[_0x43e2('0x68')]});if(_0x137d0c){_0x137d0c[_0x43e2('0x70')]=_0x43e2('0x71');}})[_0x43e2('0x1a')](function(){var _0x2bac5a=util[_0x43e2('0x8')](_0x43e2('0x5d'),_0x13685a[_0x43e2('0x5e')]||_0x13685a['uniqueid'],_0x13685a['format']||_0x43e2('0x5f'));var _0x2d93d6=_[_0x43e2('0x58')](_0x49fc77[_0x43e2('0x62')],{'filename':'/var/spool/asterisk/monitor/'+_0x2bac5a[_0x43e2('0x64')]()});if(_0x2d93d6){_0x2d93d6[_0x43e2('0x70')]=_0x43e2('0x71');}})['then'](function(){_0x211b9c({'code':0xc8,'message':[_0x13685a[_0x43e2('0x5b')],_0x43e2('0x72')][_0x43e2('0x15')]('\x20')});})[_0x43e2('0x1c')](function(_0x533967){_0x40d99b(_0x129bd0[_0x43e2('0x11')](0x1f5,[_0x13685a[_0x43e2('0x5b')],_0x533967[_0x43e2('0x1b')]['toLowerCase']()]['join']('\x20')));});}else{return _0x40d99b(_0x129bd0[_0x43e2('0x11')](0x1f5,_0x43e2('0x6a')));}});},'VoiceQueuesChannels':function(_0x518aa1){return new Promise(function(_0x361923,_0x419e85){var _0x3e317e=_['values'](_0x18629c[_0x43e2('0x73')]);_0x361923({'count':_0x3e317e['length'],'rows':_0x3e317e});});},'VoiceQueuesChannel':function(_0x24c1ff){var _0x471730=this;return new Promise(function(_0x4363da,_0x181d39){var _0x39c9b6=schema(properties[_0x43e2('0x74')])[_0x43e2('0x3')](_0x24c1ff);if(_0x39c9b6[_0x43e2('0x57')]>0x0){return _0x181d39(_0x471730['error'](0x1f4,_[_0x43e2('0x6b')](_0x39c9b6,_0x43e2('0x1b'))[_0x43e2('0x15')](',\x20')));}var _0x2e2d61=_[_0x43e2('0x58')](_0x18629c[_0x43e2('0x73')],{'uniqueid':_0x24c1ff[_0x43e2('0x5b')]});if(_0x2e2d61){_0x4363da(_0x2e2d61);}else{return _0x181d39(_0x471730[_0x43e2('0x11')](0x1f5,_0x43e2('0x6a')));}});},'VoiceQueuesChannelHangup':function(_0x1d4d7c){var _0x4602ae=this;return new Promise(function(_0x5dd68f,_0x222ab8){if(ami[_0x43e2('0x10')]()==![]){return _0x222ab8(_0x4602ae[_0x43e2('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x43e2('0x12')][_0x43e2('0x13')],_0x43e2('0x14')][_0x43e2('0x15')]('\x20')));}var _0x4ecbd5=schema(properties[_0x43e2('0x75')])['validate'](_0x1d4d7c);if(_0x4ecbd5[_0x43e2('0x57')]>0x0){return _0x222ab8(_0x4602ae[_0x43e2('0x11')](0x1f4,_[_0x43e2('0x6b')](_0x4ecbd5,'message')[_0x43e2('0x15')](',\x20')));}var _0x282876=_[_0x43e2('0x58')](_0x18629c[_0x43e2('0x73')],{'uniqueid':_0x1d4d7c[_0x43e2('0x5b')]});if(_0x282876&&_0x282876[_0x43e2('0x5c')]){return ami[_0x43e2('0x19')]({'action':_0x43e2('0x76'),'channel':_0x282876[_0x43e2('0x5c')]})[_0x43e2('0x1a')](function(_0x2ccaef){_0x5dd68f({'code':0xc8,'message':[_0x1d4d7c['uniqueid'],_0x2ccaef[_0x43e2('0x1b')][_0x43e2('0x64')]()][_0x43e2('0x15')]('\x20')});})[_0x43e2('0x1c')](function(_0x4e34a9){_0x222ab8(_0x4602ae[_0x43e2('0x11')](0x1f5,[_0x1d4d7c[_0x43e2('0x5b')],_0x4e34a9[_0x43e2('0x1b')][_0x43e2('0x64')]()][_0x43e2('0x15')]('\x20')));});}else{return _0x222ab8(_0x4602ae[_0x43e2('0x11')](0x1f5,_0x43e2('0x6a')));}});},'VoiceQueuesChannelRedirect':function(_0x248b2d){var _0x5a7b28=this;return new Promise(function(_0x19d3ec,_0x29c24d){if(ami[_0x43e2('0x10')]()==![]){return _0x29c24d(_0x5a7b28[_0x43e2('0x11')](0x1f4,[config[_0x43e2('0x12')]['ip'],config[_0x43e2('0x12')][_0x43e2('0x13')],'ami\x20disconnected'][_0x43e2('0x15')]('\x20')));}var _0x439b78=schema(properties[_0x43e2('0x77')])[_0x43e2('0x3')](_0x248b2d);if(_0x439b78[_0x43e2('0x57')]>0x0){return _0x29c24d(_0x5a7b28[_0x43e2('0x11')](0x1f4,_['map'](_0x439b78,_0x43e2('0x1b'))[_0x43e2('0x15')](',\x20')));}var _0xf6d220=_[_0x43e2('0x58')](_0x18629c[_0x43e2('0x73')],{'uniqueid':_0x248b2d[_0x43e2('0x5b')]});if(_0xf6d220&&_0xf6d220['channel']){return ami[_0x43e2('0x19')]({'action':_0x43e2('0x78'),'channel':_0xf6d220[_0x43e2('0x5c')],'exten':_0x248b2d['exten'],'context':_0x248b2d['context']||_0xf6d220[_0x43e2('0x79')],'priority':0x1})['then'](function(_0x5bd1a9){_0x19d3ec({'code':0xc8,'message':[_0x248b2d[_0x43e2('0x5b')],_0x5bd1a9[_0x43e2('0x1b')][_0x43e2('0x64')]()]['join']('\x20')});})[_0x43e2('0x1c')](function(_0x5cdf92){_0x29c24d(_0x5a7b28[_0x43e2('0x11')](0x1f5,[_0x248b2d[_0x43e2('0x5b')],_0x5cdf92[_0x43e2('0x1b')]['toLowerCase']()]['join']('\x20')));});}else{return _0x29c24d(_0x5a7b28['error'](0x1f5,_0x43e2('0x6a')));}});},'Agents':function(_0xa309da){return new Promise(function(_0x403fb1,_0x12fd99){var _0xd56111=_[_0x43e2('0x5a')](_0x18629c[_0x43e2('0xc')]);_0x403fb1({'count':_0xd56111[_0x43e2('0x57')],'rows':_0xd56111});});},'Telephones':function(_0x16bb5f){return new Promise(function(_0x2346ee,_0x38e95c){var _0x48f054=_[_0x43e2('0x5a')](_0x18629c[_0x43e2('0x7a')]);_0x2346ee({'count':_0x48f054['length'],'rows':_0x48f054});});},'Trunks':function(_0x2b1a80){return new Promise(function(_0x57fbac,_0x2ea250){var _0x319292=_[_0x43e2('0x5a')](_0x18629c['trunks']);_0x57fbac({'count':_0x319292[_0x43e2('0x57')],'rows':_0x319292});});},'OutboundChannels':function(_0x13cd38){return new Promise(function(_0x5043f1,_0x4f83e3){var _0x5c5a59=_[_0x43e2('0x5a')](_0x18629c[_0x43e2('0x7b')]);_0x5043f1({'count':_0x5c5a59[_0x43e2('0x57')],'rows':_0x5c5a59});});},'Outbound':function(_0x3600c4){return new Promise(function(_0x15a507,_0x19b134){_0x15a507(_0x18629c[_0x43e2('0x2e')]);});},'Campaigns':function(_0x51f61b){return new Promise(function(_0x50de17,_0x20157d){var _0x44b751=_['values'](_0x18629c[_0x43e2('0x7c')]);_0x50de17({'count':_0x44b751[_0x43e2('0x57')],'rows':_0x44b751});});},'VoiceQueuesPreview':function(_0x343d7e){var _0x5033ff=this;return new Promise(function(_0x268955,_0xe02c94){_0x1a89fc[_0x43e2('0x7d')](_0x343d7e['id'])[_0x43e2('0x1a')](function(_0x1eae84){_0x268955({'code':0xc8,'message':_0x1eae84[_0x43e2('0x1b')]});})[_0x43e2('0x1c')](function(_0x41ae38){_0xe02c94(_0x5033ff[_0x43e2('0x11')](0x1f4,_0x41ae38[_0x43e2('0x1b')]));});});},'EventManager':function(_0x3bfdb6){var _0x259160=this;return new Promise(function(_0x1cf109,_0x27cfdb){if(!_0x3bfdb6['event']){return _0x27cfdb(_0x259160[_0x43e2('0x11')](0x1f4,_0x43e2('0x7e')));}ami[_0x43e2('0x7f')]('custom:'+_0x3bfdb6['event'],_0x3bfdb6[_0x43e2('0x1b')]);_0x1cf109({'code':0xc8,'message':_0x3bfdb6});});},'FaxAccounts':function(_0x23c490){return new Promise(function(_0x35e117,_0x54e5fe){var _0x5ef6f4=_[_0x43e2('0x5a')](_0x18629c[_0x43e2('0x80')]);_0x35e117({'count':_0x5ef6f4[_0x43e2('0x57')],'rows':_0x5ef6f4});});},'SendFax':function(_0x3ed240){var _0x1d48ce=this;return new Promise(function(_0x3c273d,_0x3ff1c9){_0x28b144[_0x43e2('0x81')](_0x3ed240)[_0x43e2('0x1a')](function(_0x11a897){_0x3c273d({'code':0xc8,'message':_0x11a897[_0x43e2('0x1b')]});})[_0x43e2('0x1c')](function(_0x440ee8){_0x3ff1c9(_0x1d48ce[_0x43e2('0x11')](0x1f4,_0x440ee8[_0x43e2('0x1b')]));});});},'CheckAfterSend':function(_0x2a21fd){var _0x1e8aeb=this;return new Promise(function(_0x1522d7,_0x36adb7){_0x28b144[_0x43e2('0x82')](_0x2a21fd)[_0x43e2('0x1a')](function(_0x39d587){_0x1522d7({'code':0xc8,'message':_0x39d587[_0x43e2('0x1b')]});})[_0x43e2('0x1c')](function(_0x120070){_0x36adb7(_0x1e8aeb['error'](0x1f4,_0x120070['message']));});});}};var _0x321510=jayson[_0x43e2('0x83')](_0x23b2d8)[_0x43e2('0x84')]();_0x321510['on']('error',function(_0x8daf6c){return _0x121e2e(_0x8daf6c);});_0x321510[_0x43e2('0x7')](0x232a,_0x43e2('0x85'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x43b5a7('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file
+var _0xfb65=['SIP','timers','timer','updateAcw','agents','pause','QueuePause','isConnected','error','username','ami\x20disconnected','pick','keys','module','Reload','Action','then','message','catch','asterisk','command','Command','voiceQueues','hasOwnProperty','strategy','answered','available','pTalking','sumBillable','sumHoldTime','talking','type','abandoned','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','Interval','push','length','undefined','channels','join','validate','map','find','channel','filename','uniqueid','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','wav','status','StopMixMonitor\x20Success','voicequeuechannel','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','context','values','telephones','trunks','outboundChannels','campaigns','run','Event\x20name\x20mandatory','emit','event','send','checkAfterSend','server','http','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','bluebird','../../../config/environment','../properties','../ami','listen','format','%s/%s'];(function(_0x3b6aaf,_0x4aef36){var _0x295fa9=function(_0x4320d3){while(--_0x4320d3){_0x3b6aaf['push'](_0x3b6aaf['shift']());}};_0x295fa9(++_0x4aef36);}(_0xfb65,0x82));var _0x5fb6=function(_0x2efa92,_0x2557f6){_0x2efa92=_0x2efa92-0x0;var _0x32704b=_0xfb65[_0x2efa92];return _0x32704b;};'use strict';var _=require('lodash');var util=require(_0x5fb6('0x0'));var jayson=require(_0x5fb6('0x1'));var schema=require('validate');var BPromise=require(_0x5fb6('0x2'));var moment=require('moment');var config=require(_0x5fb6('0x3'));var properties=require(_0x5fb6('0x4'));var ami=require(_0x5fb6('0x5'));exports[_0x5fb6('0x6')]=function(_0x3a3b1b,_0x1fefe3,_0x4dec8f){return new BPromise(function(_0x50782b,_0x238914){var _0x1b586b={'QueuePause':function(_0x1f99b8){return new Promise(function(_0x840390,_0x56d6e1){var _0x381710=util[_0x5fb6('0x7')](_0x5fb6('0x8'),_0x5fb6('0x9'),_0x1f99b8['name']);if(_0x3a3b1b[_0x5fb6('0xa')]&&_0x3a3b1b[_0x5fb6('0xa')][_0x381710]&&_0x3a3b1b['timers'][_0x381710][_0x5fb6('0xb')]){_0x3a3b1b[_0x5fb6('0xa')][_0x381710][_0x5fb6('0xc')]();}if(_0x3a3b1b[_0x5fb6('0xd')][_0x381710]){_0x3a3b1b[_0x5fb6('0xd')][_0x381710]['updateStatusRealtime']({'statePause':_0x1f99b8[_0x5fb6('0xe')]?!![]:![]});}_0x840390({'code':0xc8,'message':_0x5fb6('0xf')});});},'Reload':function(_0x42285b){var _0x41d503=this;return new Promise(function(_0x6b58a2,_0x1bab1f){if(ami[_0x5fb6('0x10')]()==![]){return _0x1bab1f(_0x41d503[_0x5fb6('0x11')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x5fb6('0x12')],_0x5fb6('0x13')]['join']('\x20')));}_0x42285b=_[_0x5fb6('0x14')](_0x42285b,_[_0x5fb6('0x15')](properties[_0x5fb6('0x16')]));_0x42285b['action']=_0x5fb6('0x17');return ami[_0x5fb6('0x18')](_0x42285b)[_0x5fb6('0x19')](function(_0x182af5){_0x6b58a2({'code':0xc8,'message':_0x182af5[_0x5fb6('0x1a')]});})[_0x5fb6('0x1b')](function(_0x50bca8){_0x1bab1f(_0x41d503[_0x5fb6('0x11')](0x1f5,_0x50bca8['message']));});});},'Command':function(_0x32f58a){var _0x54c319=this;return new Promise(function(_0x43a252,_0x3ec3b0){if(ami[_0x5fb6('0x10')]()==![]){return _0x3ec3b0(_0x54c319[_0x5fb6('0x11')](0x1f4,[config[_0x5fb6('0x1c')]['ip'],config[_0x5fb6('0x1c')][_0x5fb6('0x12')],'ami\x20disconnected']['join']('\x20')));}_0x32f58a=_[_0x5fb6('0x14')](_0x32f58a,_0x5fb6('0x1d'));_0x32f58a['action']=_0x5fb6('0x1e');return ami[_0x5fb6('0x18')](_0x32f58a)[_0x5fb6('0x19')](function(_0x36457e){_0x43a252({'code':0xc8,'message':_0x36457e['content']});})[_0x5fb6('0x1b')](function(_0x44aebe){_0x3ec3b0(_0x54c319[_0x5fb6('0x11')](0x1f5,_0x44aebe[_0x5fb6('0x1a')]));});});},'VoiceQueues':function(_0x1b6953){return new Promise(function(_0x1c1b96,_0x4e2bff){var _0x4cbdaf=[];for(var _0x298b44 in _0x3a3b1b[_0x5fb6('0x1f')]){if(_0x3a3b1b[_0x5fb6('0x1f')][_0x5fb6('0x20')](_0x298b44)){var _0x2731a3=_0x3a3b1b[_0x5fb6('0x1f')][_0x298b44];var _0x36ac58={'id':_0x2731a3['id'],'name':_0x2731a3['name'],'strategy':_0x2731a3[_0x5fb6('0x21')],'answered':_0x2731a3[_0x5fb6('0x22')],'available':_0x2731a3[_0x5fb6('0x23')],'loggedIn':_0x2731a3['loggedIn'],'pTalking':_0x2731a3[_0x5fb6('0x24')],'sumBillable':_0x2731a3[_0x5fb6('0x25')],'sumDuration':_0x2731a3['sumDuration'],'sumHoldTime':_0x2731a3[_0x5fb6('0x26')]||0x0,'talking':_0x2731a3[_0x5fb6('0x27')],'total':_0x2731a3['total'],'type':_0x2731a3[_0x5fb6('0x28')],'unmanaged':_0x2731a3['unmanaged'],'abandoned':_0x2731a3[_0x5fb6('0x29')],'waiting':_0x2731a3['waiting'],'loggedInDb':_0x2731a3['loggedInDb']};if(_0x2731a3[_0x5fb6('0x28')]===_0x5fb6('0x2a')){_0x36ac58[_0x5fb6('0x2b')]=_0x2731a3[_0x5fb6('0x2b')];_0x36ac58[_0x5fb6('0x2c')]=_0x2731a3[_0x5fb6('0x2c')];_0x36ac58['dialOriginateCallerIdName']=_0x2731a3[_0x5fb6('0x2d')];_0x36ac58[_0x5fb6('0x2e')]=_0x2731a3[_0x5fb6('0x2e')];_0x36ac58[_0x5fb6('0x2f')]=_0x2731a3[_0x5fb6('0x2f')];_0x36ac58[_0x5fb6('0x30')]=_0x2731a3[_0x5fb6('0x30')];_0x36ac58[_0x5fb6('0x31')]=_0x2731a3[_0x5fb6('0x31')];_0x36ac58[_0x5fb6('0x32')]=_0x2731a3[_0x5fb6('0x32')];_0x36ac58['outboundAnswerCallsDay']=_0x2731a3[_0x5fb6('0x33')];_0x36ac58[_0x5fb6('0x34')]=_0x2731a3['outboundBlacklistCallsDay'];_0x36ac58[_0x5fb6('0x35')]=_0x2731a3['outboundBusyCallsDay'];_0x36ac58['outboundCongestionCallsDay']=_0x2731a3[_0x5fb6('0x36')];_0x36ac58[_0x5fb6('0x37')]=_0x2731a3[_0x5fb6('0x37')];_0x36ac58['outboundDropCallsDayCallersExit']=_0x2731a3[_0x5fb6('0x38')];_0x36ac58['outboundDropCallsDayTimeout']=_0x2731a3['outboundDropCallsDayTimeout'];_0x36ac58[_0x5fb6('0x39')]=_0x2731a3[_0x5fb6('0x39')];_0x36ac58[_0x5fb6('0x3a')]=_0x2731a3[_0x5fb6('0x3a')];_0x36ac58[_0x5fb6('0x3b')]=_0x2731a3[_0x5fb6('0x3b')];_0x36ac58[_0x5fb6('0x3c')]=_0x2731a3[_0x5fb6('0x3c')];_0x36ac58[_0x5fb6('0x3d')]=_0x2731a3[_0x5fb6('0x3d')];_0x36ac58[_0x5fb6('0x3e')]=_0x2731a3[_0x5fb6('0x3e')];_0x36ac58['predictiveIntervalAnsweredCalls']=_0x2731a3[_0x5fb6('0x3f')];_0x36ac58[_0x5fb6('0x40')]=_0x2731a3[_0x5fb6('0x40')];_0x36ac58['predictiveIntervalAvgTalktime']=_0x2731a3[_0x5fb6('0x41')];_0x36ac58['predictiveIntervalDroppedCallsCallersExit']=_0x2731a3[_0x5fb6('0x42')];_0x36ac58['predictiveIntervalDroppedCallsTimeout']=_0x2731a3[_0x5fb6('0x43')];_0x36ac58[_0x5fb6('0x44')]=_0x2731a3[_0x5fb6('0x44')];_0x36ac58[_0x5fb6('0x45')]=_0x2731a3[_0x5fb6('0x45')];_0x36ac58['predictiveIntervalHitRate']=_0x2731a3[_0x5fb6('0x46')];_0x36ac58[_0x5fb6('0x47')]=_0x2731a3[_0x5fb6('0x47')];_0x36ac58[_0x5fb6('0x48')]=_0x2731a3['predictiveIntervalPauses'];_0x36ac58[_0x5fb6('0x49')]=_0x2731a3[_0x5fb6('0x49')];_0x36ac58[_0x5fb6('0x4a')]=_0x2731a3[_0x5fb6('0x4a')];_0x36ac58[_0x5fb6('0x1a')]=_0x2731a3[_0x5fb6('0x1a')];_0x36ac58['originated']=_0x2731a3[_0x5fb6('0x4b')];_0x36ac58[_0x5fb6('0x4c')]=_0x2731a3[_0x5fb6('0x4c')];_0x36ac58[_0x5fb6('0x4d')]=_0x2731a3[_0x5fb6('0x4d')];_0x36ac58[_0x5fb6('0x4e')]=_0x2731a3[_0x5fb6('0x4e')];_0x36ac58[_0x5fb6('0x4f')]=_0x2731a3[_0x5fb6('0x4f')];_0x36ac58[_0x5fb6('0x50')]=_0x2731a3[_0x5fb6('0x50')];_0x36ac58['startProgressive']=_0x2731a3[_0x5fb6('0x51')];}if(_0x2731a3['Trunk']){_0x36ac58[_0x5fb6('0x52')]={'id':_0x2731a3[_0x5fb6('0x52')]['id'],'name':_0x2731a3['Trunk'][_0x5fb6('0x53')],'active':_0x2731a3[_0x5fb6('0x52')][_0x5fb6('0x54')],'callerid':_0x2731a3['Trunk']['callerid']};}if(_0x2731a3[_0x5fb6('0x55')]){_0x36ac58[_0x5fb6('0x55')]={'id':_0x2731a3[_0x5fb6('0x55')]['id'],'name':_0x2731a3[_0x5fb6('0x55')][_0x5fb6('0x53')]};}_0x4cbdaf[_0x5fb6('0x56')](_0x36ac58);}}_0x1c1b96({'count':_0x4cbdaf[_0x5fb6('0x57')],'rows':_0x4cbdaf});});},'UpdateVoiceQueue':function(_0x3fe007){return new Promise(function(_0x29ac9f,_0x1cd003){var _0xb32da8=_['find'](_0x3a3b1b[_0x5fb6('0x1f')],{'id':parseInt(_0x3fe007['id'])});var _0x5513dd=_['omit'](_0x3fe007,['id']);if(_0xb32da8){for(var _0x2d8b10 in _0x5513dd){if(typeof _0x5513dd[_0x2d8b10]!==_0x5fb6('0x58')&&typeof _0xb32da8[_0x2d8b10]!==_0x5fb6('0x58')){_0xb32da8[_0x2d8b10]=_0x5513dd[_0x2d8b10];}}_0x29ac9f(_0xb32da8);}else{_0x1cd003();}});},'VoiceChannels':function(_0x2a751e){return new Promise(function(_0x45b244,_0x19f7da){var _0x45ba31=_['values'](_0x3a3b1b[_0x5fb6('0x59')]);_0x45b244({'count':_0x45ba31[_0x5fb6('0x57')],'rows':_0x45ba31});});},'VoiceChannelMixMonitor':function(_0x59c923){var _0x1f5a28=this;return new Promise(function(_0x7934fd,_0x1d6188){if(ami[_0x5fb6('0x10')]()==![]){return _0x1d6188(_0x1f5a28[_0x5fb6('0x11')](0x1f4,[config[_0x5fb6('0x1c')]['ip'],config[_0x5fb6('0x1c')][_0x5fb6('0x12')],'ami\x20disconnected'][_0x5fb6('0x5a')]('\x20')));}var _0xef30cc=schema(properties['voicechannel'])[_0x5fb6('0x5b')](_0x59c923);if(_0xef30cc[_0x5fb6('0x57')]>0x0){return _0x1d6188(_0x1f5a28[_0x5fb6('0x11')](0x1f4,_[_0x5fb6('0x5c')](_0xef30cc,'message')['join'](',\x20')));}var _0xd287ab=_[_0x5fb6('0x5d')](_0x3a3b1b[_0x5fb6('0x59')],{'uniqueid':_0x59c923['uniqueid']});if(_0xd287ab&&_0xd287ab[_0x5fb6('0x5e')]){var _0x5b429d=util[_0x5fb6('0x7')]('%s.%s',_0x59c923[_0x5fb6('0x5f')]||_0x59c923[_0x5fb6('0x60')],_0x59c923[_0x5fb6('0x7')]||'wav');return ami[_0x5fb6('0x18')]({'action':_0x5fb6('0x61'),'channel':_0xd287ab[_0x5fb6('0x5e')],'file':_0x5b429d,'options':_0x5fb6('0x62')})[_0x5fb6('0x19')](function(_0x39b672){var _0x108622=_[_0x5fb6('0x5d')](_0xd287ab[_0x5fb6('0x63')],{'filename':_0x5fb6('0x64')+_0x5b429d[_0x5fb6('0x65')]()});if(_['isNil'](_0x108622)){_0xd287ab[_0x5fb6('0x63')]['push']({'filename':_0x5fb6('0x64')+_0x5b429d[_0x5fb6('0x65')](),'createdAt':moment()[_0x5fb6('0x7')](_0x5fb6('0x66')),'mixmonitorid':_0x39b672[_0x5fb6('0x67')],'status':_0x5fb6('0x68')});}else{_0x108622['mixmonitorid']=_0x39b672['mixmonitorid'];_0x108622['status']='rec';}_0x7934fd({'code':0xc8,'message':[_0x59c923[_0x5fb6('0x60')],_0x5fb6('0x69'),_0x39b672[_0x5fb6('0x67')]][_0x5fb6('0x5a')]('\x20'),'mixmonitorid':_0x39b672['mixmonitorid']});})[_0x5fb6('0x1b')](function(_0x17451b){_0x1d6188(_0x1f5a28['error'](0x1f5,[_0x59c923[_0x5fb6('0x60')],_0x17451b['message'][_0x5fb6('0x65')]()][_0x5fb6('0x5a')]('\x20')));});}else{return _0x1d6188(_0x1f5a28['error'](0x1f5,_0x5fb6('0x6a')));}});},'VoiceChannelStopMixMonitor':function(_0x43919b){var _0x1b9bd8=this;return new Promise(function(_0x4da260,_0x300225){if(ami[_0x5fb6('0x10')]()==![]){return _0x300225(_0x1b9bd8[_0x5fb6('0x11')](0x1f4,[config[_0x5fb6('0x1c')]['ip'],config[_0x5fb6('0x1c')][_0x5fb6('0x12')],_0x5fb6('0x13')]['join']('\x20')));}var _0x39ff48=schema(properties[_0x5fb6('0x6b')])[_0x5fb6('0x5b')](_0x43919b);if(_0x39ff48[_0x5fb6('0x57')]>0x0){return _0x300225(_0x1b9bd8[_0x5fb6('0x11')](0x1f4,_[_0x5fb6('0x5c')](_0x39ff48,'message')[_0x5fb6('0x5a')](',\x20')));}var _0x4e6aaf=_[_0x5fb6('0x5d')](_0x3a3b1b[_0x5fb6('0x59')],{'uniqueid':_0x43919b[_0x5fb6('0x60')]});if(_0x4e6aaf){return BPromise[_0x5fb6('0x6c')]()[_0x5fb6('0x19')](function(){if(_0x4e6aaf[_0x5fb6('0x5e')]){return ami[_0x5fb6('0x18')]({'action':_0x5fb6('0x6d'),'channel':_0x4e6aaf['channel'],'mixmonitorid':_0x43919b['mixmonitorid']})[_0x5fb6('0x1b')](function(_0x3f6762){});}})[_0x5fb6('0x19')](function(){if(_0x4e6aaf[_0x5fb6('0x6e')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x4e6aaf[_0x5fb6('0x6e')],'mixmonitorid':_0x43919b['mixmonitorid']})['catch'](function(_0x3038d1){});}})[_0x5fb6('0x19')](function(_0x236d8b){var _0x186744=_[_0x5fb6('0x5d')](_0x4e6aaf['monitors'],{'mixmonitorid':_0x43919b[_0x5fb6('0x67')]});if(_0x186744){_0x186744['status']=_0x5fb6('0x6f');}})[_0x5fb6('0x19')](function(){var _0x5484e0=util[_0x5fb6('0x7')](_0x5fb6('0x70'),_0x43919b[_0x5fb6('0x5f')]||_0x43919b['uniqueid'],_0x43919b[_0x5fb6('0x7')]||_0x5fb6('0x71'));var _0x3c9a55=_['find'](_0x4e6aaf['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x5484e0[_0x5fb6('0x65')]()});if(_0x3c9a55){_0x3c9a55[_0x5fb6('0x72')]=_0x5fb6('0x6f');}})[_0x5fb6('0x19')](function(){_0x4da260({'code':0xc8,'message':[_0x43919b[_0x5fb6('0x60')],_0x5fb6('0x73')][_0x5fb6('0x5a')]('\x20')});})['catch'](function(_0x3c4a38){_0x300225(_0x1b9bd8[_0x5fb6('0x11')](0x1f5,[_0x43919b[_0x5fb6('0x60')],_0x3c4a38[_0x5fb6('0x1a')][_0x5fb6('0x65')]()]['join']('\x20')));});}else{return _0x300225(_0x1b9bd8['error'](0x1f5,_0x5fb6('0x6a')));}});},'VoiceQueuesChannels':function(_0x547006){return new Promise(function(_0x5cda26,_0x360170){var _0x539301=_['values'](_0x3a3b1b['queueChannels']);_0x5cda26({'count':_0x539301[_0x5fb6('0x57')],'rows':_0x539301});});},'VoiceQueuesChannel':function(_0x5b95b2){var _0x11ec8a=this;return new Promise(function(_0x39e103,_0x284e09){var _0x28eecc=schema(properties[_0x5fb6('0x74')])[_0x5fb6('0x5b')](_0x5b95b2);if(_0x28eecc[_0x5fb6('0x57')]>0x0){return _0x284e09(_0x11ec8a[_0x5fb6('0x11')](0x1f4,_[_0x5fb6('0x5c')](_0x28eecc,_0x5fb6('0x1a'))[_0x5fb6('0x5a')](',\x20')));}var _0x26dc0e=_[_0x5fb6('0x5d')](_0x3a3b1b[_0x5fb6('0x75')],{'uniqueid':_0x5b95b2[_0x5fb6('0x60')]});if(_0x26dc0e){_0x39e103(_0x26dc0e);}else{return _0x284e09(_0x11ec8a[_0x5fb6('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x5af783){var _0x377d13=this;return new Promise(function(_0x55d588,_0x5afa87){if(ami[_0x5fb6('0x10')]()==![]){return _0x5afa87(_0x377d13[_0x5fb6('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x5fb6('0x1c')][_0x5fb6('0x12')],_0x5fb6('0x13')]['join']('\x20')));}var _0x3ce1ad=schema(properties[_0x5fb6('0x76')])[_0x5fb6('0x5b')](_0x5af783);if(_0x3ce1ad[_0x5fb6('0x57')]>0x0){return _0x5afa87(_0x377d13[_0x5fb6('0x11')](0x1f4,_['map'](_0x3ce1ad,'message')['join'](',\x20')));}var _0x170358=_[_0x5fb6('0x5d')](_0x3a3b1b[_0x5fb6('0x75')],{'uniqueid':_0x5af783[_0x5fb6('0x60')]});if(_0x170358&&_0x170358[_0x5fb6('0x5e')]){return ami[_0x5fb6('0x18')]({'action':_0x5fb6('0x77'),'channel':_0x170358[_0x5fb6('0x5e')]})[_0x5fb6('0x19')](function(_0x25b4c2){_0x55d588({'code':0xc8,'message':[_0x5af783[_0x5fb6('0x60')],_0x25b4c2['message']['toLowerCase']()]['join']('\x20')});})[_0x5fb6('0x1b')](function(_0xf96e9f){_0x5afa87(_0x377d13[_0x5fb6('0x11')](0x1f5,[_0x5af783[_0x5fb6('0x60')],_0xf96e9f[_0x5fb6('0x1a')]['toLowerCase']()][_0x5fb6('0x5a')]('\x20')));});}else{return _0x5afa87(_0x377d13['error'](0x1f5,_0x5fb6('0x6a')));}});},'VoiceQueuesChannelRedirect':function(_0x1d5642){var _0x5ebaf6=this;return new Promise(function(_0x151343,_0x5a66f7){if(ami[_0x5fb6('0x10')]()==![]){return _0x5a66f7(_0x5ebaf6[_0x5fb6('0x11')](0x1f4,[config[_0x5fb6('0x1c')]['ip'],config[_0x5fb6('0x1c')]['username'],_0x5fb6('0x13')][_0x5fb6('0x5a')]('\x20')));}var _0x34a69a=schema(properties[_0x5fb6('0x78')])[_0x5fb6('0x5b')](_0x1d5642);if(_0x34a69a[_0x5fb6('0x57')]>0x0){return _0x5a66f7(_0x5ebaf6[_0x5fb6('0x11')](0x1f4,_[_0x5fb6('0x5c')](_0x34a69a,_0x5fb6('0x1a'))[_0x5fb6('0x5a')](',\x20')));}var _0x2809a2=_[_0x5fb6('0x5d')](_0x3a3b1b['queueChannels'],{'uniqueid':_0x1d5642[_0x5fb6('0x60')]});if(_0x2809a2&&_0x2809a2[_0x5fb6('0x5e')]){return ami[_0x5fb6('0x18')]({'action':_0x5fb6('0x79'),'channel':_0x2809a2[_0x5fb6('0x5e')],'exten':_0x1d5642['exten'],'context':_0x1d5642[_0x5fb6('0x7a')]||_0x2809a2['context'],'priority':0x1})['then'](function(_0x55b06e){_0x151343({'code':0xc8,'message':[_0x1d5642[_0x5fb6('0x60')],_0x55b06e[_0x5fb6('0x1a')][_0x5fb6('0x65')]()]['join']('\x20')});})[_0x5fb6('0x1b')](function(_0x5793c8){_0x5a66f7(_0x5ebaf6['error'](0x1f5,[_0x1d5642[_0x5fb6('0x60')],_0x5793c8[_0x5fb6('0x1a')][_0x5fb6('0x65')]()][_0x5fb6('0x5a')]('\x20')));});}else{return _0x5a66f7(_0x5ebaf6[_0x5fb6('0x11')](0x1f5,_0x5fb6('0x6a')));}});},'Agents':function(_0x198e9e){return new Promise(function(_0x469bfb,_0xbbeca5){var _0x24cc41=_['values'](_0x3a3b1b['agents']);_0x469bfb({'count':_0x24cc41[_0x5fb6('0x57')],'rows':_0x24cc41});});},'Telephones':function(_0x817cec){return new Promise(function(_0x1fc37b,_0x419159){var _0x15b8f3=_[_0x5fb6('0x7b')](_0x3a3b1b[_0x5fb6('0x7c')]);_0x1fc37b({'count':_0x15b8f3[_0x5fb6('0x57')],'rows':_0x15b8f3});});},'Trunks':function(_0xfc13a5){return new Promise(function(_0x2eda7e,_0x2789d0){var _0x2407d0=_[_0x5fb6('0x7b')](_0x3a3b1b[_0x5fb6('0x7d')]);_0x2eda7e({'count':_0x2407d0[_0x5fb6('0x57')],'rows':_0x2407d0});});},'OutboundChannels':function(_0x498b66){return new Promise(function(_0x4dd7af,_0x4c2682){var _0xacdd1b=_[_0x5fb6('0x7b')](_0x3a3b1b[_0x5fb6('0x7e')]);_0x4dd7af({'count':_0xacdd1b[_0x5fb6('0x57')],'rows':_0xacdd1b});});},'Outbound':function(_0x4d6017){return new Promise(function(_0x4b1f02,_0x1b4f87){_0x4b1f02(_0x3a3b1b[_0x5fb6('0x2a')]);});},'Campaigns':function(_0x4bb44e){return new Promise(function(_0xc4635a,_0x12e012){var _0x1b15ae=_[_0x5fb6('0x7b')](_0x3a3b1b[_0x5fb6('0x7f')]);_0xc4635a({'count':_0x1b15ae[_0x5fb6('0x57')],'rows':_0x1b15ae});});},'VoiceQueuesPreview':function(_0x39e7f6){var _0x421ecf=this;return new Promise(function(_0xe1df32,_0x5057f4){_0x1fefe3[_0x5fb6('0x80')](_0x39e7f6['id'])[_0x5fb6('0x19')](function(_0x53d3c6){_0xe1df32({'code':0xc8,'message':_0x53d3c6[_0x5fb6('0x1a')]});})[_0x5fb6('0x1b')](function(_0x21591b){_0x5057f4(_0x421ecf[_0x5fb6('0x11')](0x1f4,_0x21591b[_0x5fb6('0x1a')]));});});},'EventManager':function(_0x29a18d){var _0x3181f1=this;return new Promise(function(_0x1c184c,_0x4f7c71){if(!_0x29a18d['event']){return _0x4f7c71(_0x3181f1[_0x5fb6('0x11')](0x1f4,_0x5fb6('0x81')));}ami[_0x5fb6('0x82')]('custom:'+_0x29a18d[_0x5fb6('0x83')],_0x29a18d[_0x5fb6('0x1a')]);_0x1c184c({'code':0xc8,'message':_0x29a18d});});},'FaxAccounts':function(_0x402a3c){return new Promise(function(_0x48459d,_0x1536c2){var _0x1d1416=_['values'](_0x3a3b1b['faxAccounts']);_0x48459d({'count':_0x1d1416[_0x5fb6('0x57')],'rows':_0x1d1416});});},'SendFax':function(_0x8c4c3){var _0x5a585f=this;return new Promise(function(_0x4610bb,_0x1cab91){_0x4dec8f[_0x5fb6('0x84')](_0x8c4c3)['then'](function(_0x595f06){_0x4610bb({'code':0xc8,'message':_0x595f06[_0x5fb6('0x1a')]});})[_0x5fb6('0x1b')](function(_0x3ee340){_0x1cab91(_0x5a585f[_0x5fb6('0x11')](0x1f4,_0x3ee340[_0x5fb6('0x1a')]));});});},'CheckAfterSend':function(_0x21a67a){var _0x127787=this;return new Promise(function(_0x1bed3c,_0x50513a){_0x4dec8f[_0x5fb6('0x85')](_0x21a67a)[_0x5fb6('0x19')](function(_0x401efd){_0x1bed3c({'code':0xc8,'message':_0x401efd[_0x5fb6('0x1a')]});})[_0x5fb6('0x1b')](function(_0x4582cc){_0x50513a(_0x127787['error'](0x1f4,_0x4582cc[_0x5fb6('0x1a')]));});});}};var _0x5e91c2=jayson[_0x5fb6('0x86')](_0x1b586b)[_0x5fb6('0x87')]();_0x5e91c2['on'](_0x5fb6('0x11'),function(_0x4d8c54){return _0x238914(_0x4d8c54);});_0x5e91c2[_0x5fb6('0x6')](0x232a,_0x5fb6('0x88'),function(){console['log'](_0x5fb6('0x89'),0x232a);return _0x50782b(_0x5fb6('0x8a')+0x232a);});});};
\ No newline at end of file
index 64baf72..cd0e31a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19cb=['redis','localhost','[CM][%s][%s]','stringify','emit','exec','data2','isNil','data5','xmd-contactid','data3','split','phone','map','routeId','destcalleridnum','calleridnum','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','length','[CM][%s][%s]\x20Contact\x20found:%s','info','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','firstName','calleridname','<unknown>','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','merge','bluebird','ioredis','../../../../config/environment','trigger'];(function(_0x6962df,_0x54ac2d){var _0x3234c5=function(_0x400cce){while(--_0x400cce){_0x6962df['push'](_0x6962df['shift']());}};_0x3234c5(++_0x54ac2d);}(_0x19cb,0x146));var _0xb19c=function(_0x4333c7,_0x5a6c15){_0x4333c7=_0x4333c7-0x0;var _0x51009d=_0x19cb[_0x4333c7];return _0x51009d;};'use strict';var _=require('lodash');var BPromise=require(_0xb19c('0x0'));var Redis=require(_0xb19c('0x1'));var util=require('util');var config=require(_0xb19c('0x2'));var logger=require('../../../../config/logger')(_0xb19c('0x3'));var cmContactRpc=require('../../rpc/cmContact');config['redis']=_['defaults'](config[_0xb19c('0x4')],{'host':_0xb19c('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x2d6a30,_0x477ac1,_0x35c200,_0x262354,_0x5d50d4){logger['info'](_0xb19c('0x6'),_0x2d6a30,_0x477ac1['id'],_0x35c200,_0x262354,JSON[_0xb19c('0x7')](_0x5d50d4));io['to'](_0x35c200)[_0xb19c('0x8')](_0x262354,_0x5d50d4);}exports[_0xb19c('0x9')]=function(_0x3b5682,_0x4de417,_0x14d90d,_0xcc851f){var _0x13e3c2,_0x3b7448;var _0x436857={};var _0x258e00;var _0x516592=Number(_0x14d90d['data1']);var _0x58e545=_0x14d90d[_0xb19c('0xa')]?Boolean(Number(_0x14d90d[_0xb19c('0xa')])):![];var _0x4330b5;var _0x52098d=![];if(!_[_0xb19c('0xb')](_0x14d90d[_0xb19c('0xc')])){if(_0x14d90d[_0xb19c('0xc')]=='1')_0x52098d=!![];}if(!_0x52098d){if(_0xcc851f['xmd-contactid']){_0x436857['id']=_0xcc851f[_0xb19c('0xd')];}}if(!_0x436857['id']){_0x436857['ListId']=_0x516592;_0x4330b5=_0x14d90d[_0xb19c('0xe')]&&_0x14d90d[_0xb19c('0xe')]!=='0'?_0x14d90d[_0xb19c('0xe')][_0xb19c('0xf')](','):[_0xb19c('0x10')];_0x436857['$or']=_[_0xb19c('0x11')](_0x4330b5,function(_0x3b598c){var _0xf3a2fa={};_0xf3a2fa[_0x3b598c]=_0xcc851f[_0xb19c('0x12')]?_0xcc851f[_0xb19c('0x13')]:_0xcc851f['calleridnum'];return _0xf3a2fa;});_0x258e00=_0xcc851f['routeId']?_0xcc851f[_0xb19c('0x13')]:_0xcc851f[_0xb19c('0x14')];}var _0x547809=['id','firstName',_0xb19c('0x15'),_0xb19c('0x10'),_0xb19c('0x16'),_0xb19c('0x17'),'ListId',_0xb19c('0x18'),_0xb19c('0x19'),_0xb19c('0x1a')];var _0x595773=_[_0xb19c('0x1b')](_0x547809,_0x4330b5);BPromise[_0xb19c('0x1c')]()[_0xb19c('0x1d')](cmContactRpc[_0xb19c('0x1e')]({'attributes':_0x595773,'where':_0x436857,'phone':_0x258e00}))[_0xb19c('0x1d')](function(_0x5aaf38){_0x3b7448=_0x5aaf38;if(!_['isEmpty'](_0x3b7448)){if(_0x3b7448[_0xb19c('0x1f')]===0x1){_0x13e3c2=_0x3b7448[0x0];logger['info'](_0xb19c('0x20'),_0xcc851f['uniqueid'],_0x4de417['id'],_0x13e3c2['id']);}else{logger[_0xb19c('0x21')](_0xb19c('0x22'),_0xcc851f[_0xb19c('0x23')],_0x4de417['id'],_[_0xb19c('0x11')](_0x3b7448,'id')[_0xb19c('0x24')](','));}return;}else{logger[_0xb19c('0x21')](_0xb19c('0x25'),_0xcc851f[_0xb19c('0x23')],_0x4de417['id']);var _0x4bbb72={'ListId':_0x516592};var _0x22db02=_0x14d90d[_0xb19c('0x26')]&&_0x14d90d[_0xb19c('0x26')]!=='0'?_0x14d90d[_0xb19c('0x26')]:'phone';if(_0x58e545){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0xcc851f[_0xb19c('0x23')],_0x4de417['id']);_0x4bbb72[_0x22db02]=_[_0xb19c('0xb')](_0xcc851f[_0xb19c('0x12')])?_0xcc851f[_0xb19c('0x14')]:_0xcc851f[_0xb19c('0x13')];if(_['isNil'](_0xcc851f[_0xb19c('0x12')])){_0x4bbb72[_0xb19c('0x27')]=_0xcc851f[_0xb19c('0x28')]&&_0xcc851f[_0xb19c('0x28')]!==_0xb19c('0x29')?_0xcc851f[_0xb19c('0x28')]:_0xb19c('0x2a');}else{_0x4bbb72['firstName']=_0xcc851f[_0xb19c('0x2b')]&&_0xcc851f[_0xb19c('0x2b')]!=='<unknown>'?_0xcc851f[_0xb19c('0x2b')]:_0xb19c('0x2a');}return BPromise[_0xb19c('0x1c')]()[_0xb19c('0x1d')](cmContactRpc[_0xb19c('0x2c')](_0x4bbb72))['then'](function(_0x55b55f){_0x13e3c2=_0x55b55f;_0x3b7448[_0xb19c('0x2d')](_0x55b55f);if(_0x13e3c2){logger[_0xb19c('0x21')](_0xb19c('0x2e'),_0xcc851f['uniqueid'],_0x4de417['id'],_0x13e3c2['id']);}return;});}else{logger[_0xb19c('0x21')](_0xb19c('0x2f'),_0xcc851f[_0xb19c('0x23')],_0x4de417['id']);_0x4bbb72[_0x22db02]=_[_0xb19c('0xb')](_0xcc851f[_0xb19c('0x12')])?_0xcc851f[_0xb19c('0x14')]:_0xcc851f[_0xb19c('0x13')];if(_[_0xb19c('0xb')](_0xcc851f[_0xb19c('0x12')])){_0x4bbb72['firstName']=_0xcc851f[_0xb19c('0x28')]&&_0xcc851f[_0xb19c('0x28')]!=='<unknown>'?_0xcc851f['calleridname']:_0xb19c('0x2a');}else{_0x4bbb72[_0xb19c('0x27')]=_0xcc851f[_0xb19c('0x2b')]&&_0xcc851f['destcalleridname']!==_0xb19c('0x29')?_0xcc851f['destcalleridname']:_0xb19c('0x2a');}_0x13e3c2=_0x4bbb72;_0x3b7448['push'](_0x4bbb72);return;}}})[_0xb19c('0x1d')](function(){if(_0x3b5682){emit(_0xcc851f[_0xb19c('0x23')],_0x4de417,util[_0xb19c('0x30')](_0xb19c('0x31'),_0x3b5682[_0xb19c('0x32')]),util[_0xb19c('0x30')](_0xb19c('0x33'),_0x14d90d[_0xb19c('0x34')][_0xb19c('0x35')]()),{'evt':_[_0xb19c('0x36')](_0xcc851f,{'autoCreate':_0x58e545}),'contact':_0x13e3c2===undefined?{}:_0x13e3c2,'contacts':_0x3b7448[_0xb19c('0x1f')]===0x0?undefined:_0x3b7448});}});};
\ No newline at end of file
+var _0x677a=['bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','emit','exec','data1','data2','isNil','data5','ListId','data3','split','phone','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','createdAt','scheduledAt','union','resolve','then','isEmpty','length','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','<unknown>','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','toLowerCase','merge'];(function(_0x53e005,_0x50ce3b){var _0x47d085=function(_0x341597){while(--_0x341597){_0x53e005['push'](_0x53e005['shift']());}};_0x47d085(++_0x50ce3b);}(_0x677a,0x6e));var _0xa677=function(_0x49df9d,_0x18a8ed){_0x49df9d=_0x49df9d-0x0;var _0x460ad4=_0x677a[_0x49df9d];return _0x460ad4;};'use strict';var _=require('lodash');var BPromise=require(_0xa677('0x0'));var Redis=require(_0xa677('0x1'));var util=require(_0xa677('0x2'));var config=require(_0xa677('0x3'));var logger=require(_0xa677('0x4'))(_0xa677('0x5'));var cmContactRpc=require(_0xa677('0x6'));config[_0xa677('0x7')]=_[_0xa677('0x8')](config[_0xa677('0x7')],{'host':_0xa677('0x9'),'port':0x18eb});var io=require(_0xa677('0xa'))(new Redis(config['redis']));function emit(_0x169d7e,_0xd6376b,_0x3aaf6e,_0x9cc0b4,_0x596d41){logger[_0xa677('0xb')](_0xa677('0xc'),_0x169d7e,_0xd6376b['id'],_0x3aaf6e,_0x9cc0b4,JSON['stringify'](_0x596d41));io['to'](_0x3aaf6e)[_0xa677('0xd')](_0x9cc0b4,_0x596d41);}exports[_0xa677('0xe')]=function(_0x11dc71,_0x51b255,_0x4b896f,_0x3628a9){var _0x3446fa,_0x1d7894;var _0xa824d7={};var _0x39aae8;var _0x562295=Number(_0x4b896f[_0xa677('0xf')]);var _0x2edfed=_0x4b896f['data2']?Boolean(Number(_0x4b896f[_0xa677('0x10')])):![];var _0x2355c5;var _0x58b344=![];if(!_[_0xa677('0x11')](_0x4b896f[_0xa677('0x12')])){if(_0x4b896f['data5']=='1')_0x58b344=!![];}if(!_0x58b344){if(_0x3628a9['xmd-contactid']){_0xa824d7['id']=_0x3628a9['xmd-contactid'];}}if(!_0xa824d7['id']){_0xa824d7[_0xa677('0x13')]=_0x562295;_0x2355c5=_0x4b896f[_0xa677('0x14')]&&_0x4b896f[_0xa677('0x14')]!=='0'?_0x4b896f[_0xa677('0x14')][_0xa677('0x15')](','):[_0xa677('0x16')];_0xa824d7['$or']=_[_0xa677('0x17')](_0x2355c5,function(_0x5b71b8){var _0x13cde0={};_0x13cde0[_0x5b71b8]=_0x3628a9[_0xa677('0x18')]?_0x3628a9[_0xa677('0x19')]:_0x3628a9['calleridnum'];return _0x13cde0;});_0x39aae8=_0x3628a9[_0xa677('0x18')]?_0x3628a9[_0xa677('0x19')]:_0x3628a9[_0xa677('0x1a')];}var _0x541643=['id',_0xa677('0x1b'),_0xa677('0x1c'),_0xa677('0x16'),_0xa677('0x1d'),'fax',_0xa677('0x13'),_0xa677('0x1e'),_0xa677('0x1f'),'updatedAt'];var _0x10da9=_[_0xa677('0x20')](_0x541643,_0x2355c5);BPromise[_0xa677('0x21')]()[_0xa677('0x22')](cmContactRpc['getContacts']({'attributes':_0x10da9,'where':_0xa824d7,'phone':_0x39aae8}))[_0xa677('0x22')](function(_0x140eab){_0x1d7894=_0x140eab;if(!_[_0xa677('0x23')](_0x1d7894)){if(_0x1d7894[_0xa677('0x24')]===0x1){_0x3446fa=_0x1d7894[0x0];logger[_0xa677('0xb')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x3628a9[_0xa677('0x25')],_0x51b255['id'],_0x3446fa['id']);}else{logger[_0xa677('0xb')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x3628a9[_0xa677('0x25')],_0x51b255['id'],_[_0xa677('0x17')](_0x1d7894,'id')[_0xa677('0x26')](','));}return;}else{logger['info'](_0xa677('0x27'),_0x3628a9[_0xa677('0x25')],_0x51b255['id']);var _0x53ded1={'ListId':_0x562295};var _0x3f435d=_0x4b896f['data4']&&_0x4b896f[_0xa677('0x28')]!=='0'?_0x4b896f[_0xa677('0x28')]:_0xa677('0x16');if(_0x2edfed){logger[_0xa677('0xb')](_0xa677('0x29'),_0x3628a9[_0xa677('0x25')],_0x51b255['id']);_0x53ded1[_0x3f435d]=_[_0xa677('0x11')](_0x3628a9[_0xa677('0x18')])?_0x3628a9[_0xa677('0x1a')]:_0x3628a9[_0xa677('0x19')];if(_[_0xa677('0x11')](_0x3628a9['routeId'])){_0x53ded1[_0xa677('0x1b')]=_0x3628a9[_0xa677('0x2a')]&&_0x3628a9[_0xa677('0x2a')]!==_0xa677('0x2b')?_0x3628a9[_0xa677('0x2a')]:_0xa677('0x2c');}else{_0x53ded1['firstName']=_0x3628a9[_0xa677('0x2d')]&&_0x3628a9['destcalleridname']!==_0xa677('0x2b')?_0x3628a9['destcalleridname']:'Unknown';}return BPromise[_0xa677('0x21')]()[_0xa677('0x22')](cmContactRpc[_0xa677('0x2e')](_0x53ded1))['then'](function(_0x172fa6){_0x3446fa=_0x172fa6;_0x1d7894[_0xa677('0x2f')](_0x172fa6);if(_0x3446fa){logger[_0xa677('0xb')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x3628a9[_0xa677('0x25')],_0x51b255['id'],_0x3446fa['id']);}return;});}else{logger[_0xa677('0xb')](_0xa677('0x30'),_0x3628a9['uniqueid'],_0x51b255['id']);_0x53ded1[_0x3f435d]=_[_0xa677('0x11')](_0x3628a9[_0xa677('0x18')])?_0x3628a9['calleridnum']:_0x3628a9['destcalleridnum'];if(_['isNil'](_0x3628a9[_0xa677('0x18')])){_0x53ded1['firstName']=_0x3628a9[_0xa677('0x2a')]&&_0x3628a9[_0xa677('0x2a')]!=='<unknown>'?_0x3628a9[_0xa677('0x2a')]:_0xa677('0x2c');}else{_0x53ded1[_0xa677('0x1b')]=_0x3628a9[_0xa677('0x2d')]&&_0x3628a9['destcalleridname']!==_0xa677('0x2b')?_0x3628a9[_0xa677('0x2d')]:'Unknown';}_0x3446fa=_0x53ded1;_0x1d7894['push'](_0x53ded1);return;}}})[_0xa677('0x22')](function(){if(_0x11dc71){emit(_0x3628a9[_0xa677('0x25')],_0x51b255,util[_0xa677('0x31')](_0xa677('0x32'),_0x11dc71[_0xa677('0x33')]),util[_0xa677('0x31')](_0xa677('0x34'),_0x4b896f['action'][_0xa677('0x35')]()),{'evt':_[_0xa677('0x36')](_0x3628a9,{'autoCreate':_0x2edfed}),'contact':_0x3446fa===undefined?{}:_0x3446fa,'contacts':_0x1d7894[_0xa677('0x24')]===0x0?undefined:_0x1d7894});}});};
\ No newline at end of file
index 71ed73c..564a88f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x124a=['socket.io-emitter','redis','popup','winapp','triggers','agents','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','bind','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialend','custom:newinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','motionChannel','undefined','voice','checkTriggers','hasOwnProperty','status','checkTrigger','Actions','length','contactmanager','motionbar','browser','data1','TemplateId','html','data2','render','buildUri','isNil','data3','location','uriLocation','data4','windowWidth','data5','800','windowHeight','600','data6','winApplication','winArguments','interface','name','format','trigger:%s:%s','toLowerCase','merge','user:%s','action','exec','integration','queue','urlforward','parse','search','replace','AllConditions','every','checkConditions','AnyConditions','some','channel','account','chat','ChatWebsiteId','value','upperFirst','AccountId','operator','interaction','message','agent','membername','lastevent','routeId','null','substatus','offlineMessage','equals','exports','util','lodash','url','mustache','ioredis','./cmContact','./script','../../../config/logger','trigger','../ami','defaults','localhost'];(function(_0x5f17c4,_0x893d66){var _0x4107a0=function(_0x5048d0){while(--_0x5048d0){_0x5f17c4['push'](_0x5f17c4['shift']());}};_0x4107a0(++_0x893d66);}(_0x124a,0x171));var _0xa124=function(_0x156dba,_0x4e513e){_0x156dba=_0x156dba-0x0;var _0xa401c=_0x124a[_0x156dba];return _0xa401c;};'use strict';var util=require(_0xa124('0x0'));var _=require(_0xa124('0x1'));var url=require(_0xa124('0x2'));var Mustache=require(_0xa124('0x3'));var Redis=require(_0xa124('0x4'));var urlforward=require('./urlforward');var integration=require('./integration');var cmContact=require(_0xa124('0x5'));var script=require(_0xa124('0x6'));var config=require('../../../config/environment');var logger=require(_0xa124('0x7'))(_0xa124('0x8'));var ami=require(_0xa124('0x9'));config['redis']=_[_0xa124('0xa')](config['redis'],{'host':_0xa124('0xb'),'port':0x18eb});var io=require(_0xa124('0xc'))(new Redis(config[_0xa124('0xd')]));var operators={'equals':function(_0x1d5770,_0x30bc29){return _0x1d5770==_0x30bc29;},'not_equals':function(_0x253ef8,_0x33ae07){return _0x253ef8!=_0x33ae07;}};var barAndWebActions=[_0xa124('0xe'),_0xa124('0x2'),_0xa124('0xf')];function Trigger(_0x49241a){this[_0xa124('0x10')]=_0x49241a[_0xa124('0x10')];this[_0xa124('0x11')]=_0x49241a[_0xa124('0x11')];this['voiceQueues']=_0x49241a['voiceQueues'];this[_0xa124('0x12')]=_0x49241a[_0xa124('0x12')];this[_0xa124('0x13')]=_0x49241a[_0xa124('0x13')];this['zendeskAccounts']=_0x49241a[_0xa124('0x14')];this[_0xa124('0x15')]=_0x49241a[_0xa124('0x15')];this['salesforceAccounts']=_0x49241a[_0xa124('0x16')];this[_0xa124('0x17')]=_0x49241a[_0xa124('0x17')];this[_0xa124('0x18')]=_0x49241a['zohoAccounts'];this[_0xa124('0x19')]=_0x49241a[_0xa124('0x19')];this['vtigerAccounts']=_0x49241a[_0xa124('0x1a')];this[_0xa124('0x1b')]=_0x49241a[_0xa124('0x1b')];this[_0xa124('0x1c')]=_0x49241a[_0xa124('0x1c')];this['freshsalesAccounts']=_0x49241a[_0xa124('0x1d')];this[_0xa124('0x1e')]={'zendesk':this[_0xa124('0x14')],'salesforce':this[_0xa124('0x16')],'freshdesk':this[_0xa124('0x15')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this['zohoAccounts'],'desk':this[_0xa124('0x19')],'vtiger':this[_0xa124('0x1a')],'dynamics365':this[_0xa124('0x1c')],'freshsales':this[_0xa124('0x1d')],'servicenow':this[_0xa124('0x1b')]};ami['on'](_0xa124('0x1f'),this['syncCustomEvent'][_0xa124('0x20')](this));ami['on'](_0xa124('0x21'),this[_0xa124('0x22')]['bind'](this));ami['on'](_0xa124('0x23'),this[_0xa124('0x22')]['bind'](this));ami['on'](_0xa124('0x24'),this['syncCustomEvent'][_0xa124('0x20')](this));ami['on'](_0xa124('0x25'),this['syncCustomEvent'][_0xa124('0x20')](this));ami['on'](_0xa124('0x26'),this[_0xa124('0x22')][_0xa124('0x20')](this));ami['on'](_0xa124('0x27'),this[_0xa124('0x22')][_0xa124('0x20')](this));ami['on'](_0xa124('0x28'),this[_0xa124('0x22')][_0xa124('0x20')](this));ami['on']('custom:agentreject',this['syncCustomEvent'][_0xa124('0x20')](this));ami['on'](_0xa124('0x29'),this[_0xa124('0x22')][_0xa124('0x20')](this));ami['on'](_0xa124('0x2a'),this['syncCustomEvent']['bind'](this));ami['on'](_0xa124('0x2b'),this[_0xa124('0x22')][_0xa124('0x20')](this));ami['on'](_0xa124('0x2c'),this['syncAgentDial']['bind'](this));ami['on']('custom:dialconnect',this['syncAgentDial'][_0xa124('0x20')](this));ami['on'](_0xa124('0x2d'),this['syncAgentDial'][_0xa124('0x20')](this));ami['on'](_0xa124('0x2e'),this['syncCustomEvent'][_0xa124('0x20')](this));ami['on']('custom:closedinteraction',this[_0xa124('0x22')][_0xa124('0x20')](this));ami['on'](_0xa124('0x2f'),this['syncCustomEvent'][_0xa124('0x20')](this));ami['on'](_0xa124('0x30'),this[_0xa124('0x22')]['bind'](this));ami['on'](_0xa124('0x31'),this[_0xa124('0x22')][_0xa124('0x20')](this));ami['on'](_0xa124('0x32'),this['syncCustomEvent']['bind'](this));ami['on'](_0xa124('0x33'),this[_0xa124('0x22')][_0xa124('0x20')](this));ami['on'](_0xa124('0x34'),this[_0xa124('0x22')][_0xa124('0x20')](this));}Trigger[_0xa124('0x35')][_0xa124('0x36')]=function(_0x219984,_0x366503,_0x147858){logger[_0xa124('0x37')](_0x219984,_0x366503,JSON[_0xa124('0x38')](_0x147858));io['to'](_0x219984)[_0xa124('0x36')](_0x366503,_0x147858);};Trigger['prototype'][_0xa124('0x22')]=function(_0x59126){var _0x2f6680=_['clone'](_0x59126);if(typeof _0x2f6680[_0xa124('0x39')]===_0xa124('0x3a')){_0x2f6680[_0xa124('0x39')]=_0xa124('0x3b');}this[_0xa124('0x3c')](_0x2f6680);};Trigger['prototype']['syncAgentDial']=function(_0x55215b){if(this[_0xa124('0x11')][_0x55215b['interface']]){this['syncCustomEvent'](_0x55215b);}};Trigger[_0xa124('0x35')][_0xa124('0x3c')]=function(_0x2ab53b){var _0x253d14;for(var _0x1ccb2f in this[_0xa124('0x10')]){if(this[_0xa124('0x10')][_0xa124('0x3d')](_0x1ccb2f)){if(this[_0xa124('0x10')][_0x1ccb2f][_0xa124('0x3e')]){_0x253d14=this[_0xa124('0x3f')](this[_0xa124('0x10')][_0x1ccb2f],_0x2ab53b);if(_0x253d14){_['merge'](_0x2ab53b,_0x2ab53b['variables']);for(var _0x4f68d6=0x0,_0x2b9f53,_0x1c19be,_0x3e0e41;_0x4f68d6<this['triggers'][_0x1ccb2f][_0xa124('0x40')][_0xa124('0x41')];_0x4f68d6+=0x1){_0x2b9f53=this['triggers'][_0x1ccb2f][_0xa124('0x40')][_0x4f68d6];if(this[_0xa124('0x11')][_0x2ab53b['interface']]){switch(_0x2b9f53['action']['toLowerCase']()){case _0xa124('0x42'):break;case _0xa124('0x43'):case _0xa124('0x44'):var _0x28d387={};switch(barAndWebActions[_0x2b9f53[_0xa124('0x45')]]){case _0xa124('0xe'):_0x28d387[_0xa124('0x46')]=_0x2b9f53['data2'];_0x28d387[_0xa124('0x47')]=this[_0xa124('0x12')][_0x2b9f53[_0xa124('0x48')]]?Mustache[_0xa124('0x49')](this[_0xa124('0x12')][_0x2b9f53['data2']][_0xa124('0x47')],_0x2ab53b):'template\x20not\x20found';break;case _0xa124('0x2'):_0x28d387['uri']=this[_0xa124('0x4a')](_0x2b9f53['data2'],_0x2ab53b,_[_0xa124('0x4b')](_0x2b9f53['data3'])?!![]:parseInt(_0x2b9f53[_0xa124('0x4c')],0xa));if(_['isNil'](_0x2b9f53['data4'])){_0x28d387[_0xa124('0x4d')]='0';}else{_0x28d387[_0xa124('0x4e')]=_0x2b9f53[_0xa124('0x4f')];_0x28d387[_0xa124('0x50')]=_[_0xa124('0x4b')](_0x2b9f53[_0xa124('0x51')])?_0xa124('0x52'):_0x2b9f53[_0xa124('0x51')];_0x28d387[_0xa124('0x53')]=_['isNil'](_0x2b9f53['data6'])?_0xa124('0x54'):_0x2b9f53[_0xa124('0x55')];}break;case _0xa124('0xf'):_0x28d387[_0xa124('0x56')]=_0x2b9f53[_0xa124('0x48')]?Mustache[_0xa124('0x49')](_0x2b9f53[_0xa124('0x48')],_0x2ab53b):'';_0x28d387[_0xa124('0x57')]=_0x2b9f53['data3']?Mustache[_0xa124('0x49')](_0x2b9f53[_0xa124('0x4c')],_0x2ab53b):'';break;}this['emit'](util['format']('user:%s',this[_0xa124('0x11')][_0x2ab53b[_0xa124('0x58')]][_0xa124('0x59')]),util[_0xa124('0x5a')](_0xa124('0x5b'),_0x2b9f53['action'][_0xa124('0x5c')](),barAndWebActions[_0x2b9f53[_0xa124('0x45')]]),_[_0xa124('0x5d')](_0x28d387,_0x2ab53b));break;case'jscripty':this[_0xa124('0x36')](util['format'](_0xa124('0x5e'),this[_0xa124('0x11')][_0x2ab53b['interface']][_0xa124('0x59')]),util['format']('trigger:%s',_0x2b9f53[_0xa124('0x5f')][_0xa124('0x5c')]()),_[_0xa124('0x5d')]({'ProjectId':parseInt(_0x2b9f53[_0xa124('0x45')],0xa)},_0x2ab53b));break;default:this['emit'](util[_0xa124('0x5a')](_0xa124('0x5e'),this[_0xa124('0x11')][_0x2ab53b[_0xa124('0x58')]][_0xa124('0x59')]),util['format']('trigger:%s',_0x2b9f53[_0xa124('0x5f')]['toLowerCase']()),_[_0xa124('0x5d')]({},_0x2b9f53,_0x2ab53b));}}switch(_0x2b9f53['action'][_0xa124('0x5c')]()){case _0xa124('0x42'):cmContact[_0xa124('0x60')](this[_0xa124('0x11')][_0x2ab53b['interface']],this[_0xa124('0x10')][_0x1ccb2f],_0x2b9f53,_0x2ab53b);break;case _0xa124('0x61'):integration[_0xa124('0x60')](_0x2b9f53,_0x2ab53b,this[_0xa124('0x1e')],this[_0xa124('0x11')][_0x2ab53b[_0xa124('0x58')]],this['voiceQueues'][_0x2ab53b[_0xa124('0x62')]],this[_0xa124('0x13')][_0x2ab53b['routeId']]);break;case _0xa124('0x63'):urlforward[_0xa124('0x60')](_0x2b9f53,_0x2ab53b);break;case'script':script['exec'](_0x2b9f53,_0x2ab53b);break;}}}}}}};Trigger[_0xa124('0x35')][_0xa124('0x4a')]=function(_0x255ffe,_0x15c5e5,_0x4db80a){var _0x2f8ebe=url[_0xa124('0x64')](Mustache['render'](_0x255ffe,_0x15c5e5),!![]);if(_0x4db80a){_[_0xa124('0x5d')](_0x2f8ebe['query'],_0x15c5e5);}delete _0x2f8ebe[_0xa124('0x65')];var _0x253b96=url[_0xa124('0x5a')](_0x2f8ebe);_0x253b96=_0x253b96[_0xa124('0x66')](/\/\?/g,'?');return _0x253b96;};Trigger[_0xa124('0x35')][_0xa124('0x3f')]=function(_0x19df55,_0x21be4a){var _0xb91add=!![];var _0x1460bd=!![];var _0x5365d3=![];if(_0x19df55['channel']===_0x21be4a[_0xa124('0x39')]){_0x5365d3=!![];}if(_0x19df55[_0xa124('0x67')][_0xa124('0x41')]){_0xb91add=_[_0xa124('0x68')](_0x19df55[_0xa124('0x67')],this[_0xa124('0x69')](_0x21be4a,_0x19df55['channel']));}if(_0x19df55[_0xa124('0x6a')][_0xa124('0x41')]){_0x1460bd=_[_0xa124('0x6b')](_0x19df55[_0xa124('0x6a')],this['checkConditions'](_0x21be4a,_0x19df55[_0xa124('0x6c')]));}return _0x5365d3&&_0xb91add&&_0x1460bd;};Trigger[_0xa124('0x35')][_0xa124('0x69')]=function(_0xfdb09b,_0x472e2c){return function(_0x52a8ee){switch(_0x52a8ee['field']){case _0xa124('0x6d'):if(_0xfdb09b[_0xa124('0x6c')]===_0x472e2c){if(_0x472e2c===_0xa124('0x6e')){return _0xfdb09b[_0xa124('0x6f')]?operators[_0x52a8ee['operator']](Number(_0x52a8ee[_0xa124('0x70')]),_0xfdb09b[_0xa124('0x6f')]):![];}else{return _0xfdb09b[_[_0xa124('0x71')](_0x472e2c)+_0xa124('0x72')]?operators[_0x52a8ee[_0xa124('0x73')]](Number(_0x52a8ee['value']),_0xfdb09b[_[_0xa124('0x71')](_0x472e2c)+'AccountId']):![];}}break;case _0xa124('0x74'):case _0xa124('0x75'):if(_0xfdb09b['channel']===_0x472e2c){return _0xfdb09b['event']?operators[_0x52a8ee['operator']](_0x52a8ee[_0xa124('0x70')],_0xfdb09b['event']):![];}break;case _0xa124('0x62'):return _0xfdb09b[_0xa124('0x62')]?operators[_0x52a8ee[_0xa124('0x73')]](_0x52a8ee[_0xa124('0x70')],_0xfdb09b[_0xa124('0x62')]):![];case _0xa124('0x76'):return _0xfdb09b[_0xa124('0x77')]?operators[_0x52a8ee[_0xa124('0x73')]](_0x52a8ee[_0xa124('0x70')],_0xfdb09b[_0xa124('0x77')]):![];case _0xa124('0x78'):return _0xfdb09b[_0xa124('0x78')]?operators[_0x52a8ee[_0xa124('0x73')]](_0x52a8ee[_0xa124('0x70')],_0xfdb09b[_0xa124('0x78')]):![];case'routeId':return _0xfdb09b[_0xa124('0x79')]?operators[_0x52a8ee['operator']](_0x52a8ee[_0xa124('0x70')],_0xfdb09b[_0xa124('0x79')]):![];case'mailSubstatus':if(_0x52a8ee[_0xa124('0x70')]===_0xa124('0x7a'))_0x52a8ee[_0xa124('0x70')]=null;return typeof _0xfdb09b[_0xa124('0x7b')]!==_0xa124('0x3a')?operators[_0x52a8ee[_0xa124('0x73')]](_0x52a8ee[_0xa124('0x70')],_0xfdb09b['substatus']):![];case _0xa124('0x7c'):if(_0xfdb09b[_0xa124('0x6c')]===_0x472e2c){return _0x52a8ee[_0xa124('0x70')]==='created'&&_0x52a8ee['operator']===_0xa124('0x7d')?!![]:![];}break;}return![];};};module[_0xa124('0x7e')]=Trigger;
\ No newline at end of file
+var _0x68c3=['agent','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','created','equals','util','url','mustache','ioredis','./urlforward','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','socket.io-emitter','popup','winapp','triggers','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','vtigerAccounts','custom:agentcalled','syncCustomEvent','custom:agentconnect','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','emit','stringify','clone','motionChannel','undefined','voice','agents','prototype','hasOwnProperty','merge','variables','Actions','length','interface','action','toLowerCase','motionbar','browser','data1','TemplateId','data2','html','render','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','winApplication','format','user:%s','trigger:%s:%s','jscripty','name','contactmanager','exec','queue','routeId','script','parse','query','search','checkTrigger','channel','AllConditions','every','checkConditions','AnyConditions','field','chat','ChatWebsiteId','upperFirst','AccountId','operator','value','message','event'];(function(_0x555f6b,_0x52ffcf){var _0x1c5c51=function(_0x3a5fe5){while(--_0x3a5fe5){_0x555f6b['push'](_0x555f6b['shift']());}};_0x1c5c51(++_0x52ffcf);}(_0x68c3,0x8b));var _0x368c=function(_0x4374d2,_0x9133db){_0x4374d2=_0x4374d2-0x0;var _0xbd521=_0x68c3[_0x4374d2];return _0xbd521;};'use strict';var util=require(_0x368c('0x0'));var _=require('lodash');var url=require(_0x368c('0x1'));var Mustache=require(_0x368c('0x2'));var Redis=require(_0x368c('0x3'));var urlforward=require(_0x368c('0x4'));var integration=require('./integration');var cmContact=require(_0x368c('0x5'));var script=require(_0x368c('0x6'));var config=require(_0x368c('0x7'));var logger=require(_0x368c('0x8'))(_0x368c('0x9'));var ami=require(_0x368c('0xa'));config[_0x368c('0xb')]=_[_0x368c('0xc')](config[_0x368c('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x368c('0xd'))(new Redis(config[_0x368c('0xb')]));var operators={'equals':function(_0x3b2307,_0x181501){return _0x3b2307==_0x181501;},'not_equals':function(_0x5d5a69,_0x32d291){return _0x5d5a69!=_0x32d291;}};var barAndWebActions=[_0x368c('0xe'),'url',_0x368c('0xf')];function Trigger(_0x488b4a){this[_0x368c('0x10')]=_0x488b4a[_0x368c('0x10')];this['agents']=_0x488b4a['agents'];this[_0x368c('0x11')]=_0x488b4a[_0x368c('0x11')];this[_0x368c('0x12')]=_0x488b4a[_0x368c('0x12')];this[_0x368c('0x13')]=_0x488b4a[_0x368c('0x13')];this['zendeskAccounts']=_0x488b4a[_0x368c('0x14')];this[_0x368c('0x15')]=_0x488b4a[_0x368c('0x15')];this['salesforceAccounts']=_0x488b4a[_0x368c('0x16')];this[_0x368c('0x17')]=_0x488b4a[_0x368c('0x17')];this[_0x368c('0x18')]=_0x488b4a[_0x368c('0x18')];this[_0x368c('0x19')]=_0x488b4a[_0x368c('0x19')];this['vtigerAccounts']=_0x488b4a['vtigerAccounts'];this[_0x368c('0x1a')]=_0x488b4a[_0x368c('0x1a')];this[_0x368c('0x1b')]=_0x488b4a[_0x368c('0x1b')];this['freshsalesAccounts']=_0x488b4a[_0x368c('0x1c')];this[_0x368c('0x1d')]={'zendesk':this[_0x368c('0x14')],'salesforce':this[_0x368c('0x16')],'freshdesk':this[_0x368c('0x15')],'sugarcrm':this[_0x368c('0x17')],'zoho':this[_0x368c('0x18')],'desk':this[_0x368c('0x19')],'vtiger':this[_0x368c('0x1e')],'dynamics365':this[_0x368c('0x1b')],'freshsales':this['freshsalesAccounts'],'servicenow':this['servicenowAccounts']};ami['on'](_0x368c('0x1f'),this[_0x368c('0x20')]['bind'](this));ami['on'](_0x368c('0x21'),this[_0x368c('0x20')][_0x368c('0x22')](this));ami['on'](_0x368c('0x23'),this[_0x368c('0x20')][_0x368c('0x22')](this));ami['on'](_0x368c('0x24'),this[_0x368c('0x20')][_0x368c('0x22')](this));ami['on'](_0x368c('0x25'),this['syncCustomEvent'][_0x368c('0x22')](this));ami['on'](_0x368c('0x26'),this[_0x368c('0x20')][_0x368c('0x22')](this));ami['on'](_0x368c('0x27'),this[_0x368c('0x20')][_0x368c('0x22')](this));ami['on'](_0x368c('0x28'),this['syncCustomEvent']['bind'](this));ami['on'](_0x368c('0x29'),this[_0x368c('0x20')][_0x368c('0x22')](this));ami['on'](_0x368c('0x2a'),this[_0x368c('0x20')][_0x368c('0x22')](this));ami['on'](_0x368c('0x2b'),this[_0x368c('0x20')]['bind'](this));ami['on'](_0x368c('0x2c'),this[_0x368c('0x20')][_0x368c('0x22')](this));ami['on'](_0x368c('0x2d'),this[_0x368c('0x2e')][_0x368c('0x22')](this));ami['on'](_0x368c('0x2f'),this[_0x368c('0x2e')][_0x368c('0x22')](this));ami['on'](_0x368c('0x30'),this['syncAgentDial'][_0x368c('0x22')](this));ami['on'](_0x368c('0x31'),this[_0x368c('0x20')]['bind'](this));ami['on'](_0x368c('0x32'),this['syncCustomEvent'][_0x368c('0x22')](this));ami['on'](_0x368c('0x33'),this[_0x368c('0x20')][_0x368c('0x22')](this));ami['on'](_0x368c('0x34'),this['syncCustomEvent']['bind'](this));ami['on'](_0x368c('0x35'),this[_0x368c('0x20')][_0x368c('0x22')](this));ami['on'](_0x368c('0x36'),this[_0x368c('0x20')][_0x368c('0x22')](this));ami['on'](_0x368c('0x37'),this['syncCustomEvent']['bind'](this));ami['on'](_0x368c('0x38'),this[_0x368c('0x20')][_0x368c('0x22')](this));}Trigger['prototype'][_0x368c('0x39')]=function(_0x1304b1,_0x574d4e,_0x537410){logger['info'](_0x1304b1,_0x574d4e,JSON[_0x368c('0x3a')](_0x537410));io['to'](_0x1304b1)[_0x368c('0x39')](_0x574d4e,_0x537410);};Trigger['prototype']['syncCustomEvent']=function(_0x26d4d6){var _0x2b9271=_[_0x368c('0x3b')](_0x26d4d6);if(typeof _0x2b9271[_0x368c('0x3c')]===_0x368c('0x3d')){_0x2b9271[_0x368c('0x3c')]=_0x368c('0x3e');}this['checkTriggers'](_0x2b9271);};Trigger['prototype'][_0x368c('0x2e')]=function(_0x44038f){if(this[_0x368c('0x3f')][_0x44038f['interface']]){this[_0x368c('0x20')](_0x44038f);}};Trigger[_0x368c('0x40')]['checkTriggers']=function(_0x4a1c44){var _0x5797d8;for(var _0x34de43 in this[_0x368c('0x10')]){if(this['triggers'][_0x368c('0x41')](_0x34de43)){if(this[_0x368c('0x10')][_0x34de43]['status']){_0x5797d8=this['checkTrigger'](this[_0x368c('0x10')][_0x34de43],_0x4a1c44);if(_0x5797d8){_[_0x368c('0x42')](_0x4a1c44,_0x4a1c44[_0x368c('0x43')]);for(var _0x48fe1a=0x0,_0x365b32,_0x4b9ecb,_0x477bd7;_0x48fe1a<this[_0x368c('0x10')][_0x34de43][_0x368c('0x44')][_0x368c('0x45')];_0x48fe1a+=0x1){_0x365b32=this['triggers'][_0x34de43]['Actions'][_0x48fe1a];if(this[_0x368c('0x3f')][_0x4a1c44[_0x368c('0x46')]]){switch(_0x365b32[_0x368c('0x47')][_0x368c('0x48')]()){case'contactmanager':break;case _0x368c('0x49'):case _0x368c('0x4a'):var _0x39510c={};switch(barAndWebActions[_0x365b32[_0x368c('0x4b')]]){case'popup':_0x39510c[_0x368c('0x4c')]=_0x365b32[_0x368c('0x4d')];_0x39510c[_0x368c('0x4e')]=this[_0x368c('0x12')][_0x365b32['data2']]?Mustache[_0x368c('0x4f')](this['templates'][_0x365b32[_0x368c('0x4d')]][_0x368c('0x4e')],_0x4a1c44):'template\x20not\x20found';break;case _0x368c('0x1'):_0x39510c[_0x368c('0x50')]=this[_0x368c('0x51')](_0x365b32['data2'],_0x4a1c44,_[_0x368c('0x52')](_0x365b32[_0x368c('0x53')])?!![]:parseInt(_0x365b32['data3'],0xa));if(_[_0x368c('0x52')](_0x365b32[_0x368c('0x54')])){_0x39510c[_0x368c('0x55')]='0';}else{_0x39510c[_0x368c('0x56')]=_0x365b32[_0x368c('0x54')];_0x39510c[_0x368c('0x57')]=_[_0x368c('0x52')](_0x365b32[_0x368c('0x58')])?_0x368c('0x59'):_0x365b32[_0x368c('0x58')];_0x39510c[_0x368c('0x5a')]=_['isNil'](_0x365b32[_0x368c('0x5b')])?'600':_0x365b32[_0x368c('0x5b')];}break;case _0x368c('0xf'):_0x39510c[_0x368c('0x5c')]=_0x365b32[_0x368c('0x4d')]?Mustache[_0x368c('0x4f')](_0x365b32['data2'],_0x4a1c44):'';_0x39510c['winArguments']=_0x365b32[_0x368c('0x53')]?Mustache[_0x368c('0x4f')](_0x365b32[_0x368c('0x53')],_0x4a1c44):'';break;}this[_0x368c('0x39')](util[_0x368c('0x5d')](_0x368c('0x5e'),this[_0x368c('0x3f')][_0x4a1c44[_0x368c('0x46')]]['name']),util[_0x368c('0x5d')](_0x368c('0x5f'),_0x365b32['action'][_0x368c('0x48')](),barAndWebActions[_0x365b32['data1']]),_['merge'](_0x39510c,_0x4a1c44));break;case _0x368c('0x60'):this['emit'](util[_0x368c('0x5d')]('user:%s',this[_0x368c('0x3f')][_0x4a1c44[_0x368c('0x46')]]['name']),util['format']('trigger:%s',_0x365b32['action'][_0x368c('0x48')]()),_['merge']({'ProjectId':parseInt(_0x365b32[_0x368c('0x4b')],0xa)},_0x4a1c44));break;default:this[_0x368c('0x39')](util['format'](_0x368c('0x5e'),this[_0x368c('0x3f')][_0x4a1c44[_0x368c('0x46')]][_0x368c('0x61')]),util[_0x368c('0x5d')]('trigger:%s',_0x365b32[_0x368c('0x47')][_0x368c('0x48')]()),_[_0x368c('0x42')]({},_0x365b32,_0x4a1c44));}}switch(_0x365b32[_0x368c('0x47')]['toLowerCase']()){case _0x368c('0x62'):cmContact[_0x368c('0x63')](this[_0x368c('0x3f')][_0x4a1c44[_0x368c('0x46')]],this[_0x368c('0x10')][_0x34de43],_0x365b32,_0x4a1c44);break;case'integration':integration[_0x368c('0x63')](_0x365b32,_0x4a1c44,this['accounts'],this['agents'][_0x4a1c44[_0x368c('0x46')]],this[_0x368c('0x11')][_0x4a1c44[_0x368c('0x64')]],this[_0x368c('0x13')][_0x4a1c44[_0x368c('0x65')]]);break;case'urlforward':urlforward[_0x368c('0x63')](_0x365b32,_0x4a1c44);break;case _0x368c('0x66'):script[_0x368c('0x63')](_0x365b32,_0x4a1c44);break;}}}}}}};Trigger['prototype'][_0x368c('0x51')]=function(_0x5a9c72,_0x1b671e,_0x351a2e){var _0x306772=url[_0x368c('0x67')](Mustache['render'](_0x5a9c72,_0x1b671e),!![]);if(_0x351a2e){_[_0x368c('0x42')](_0x306772[_0x368c('0x68')],_0x1b671e);}delete _0x306772[_0x368c('0x69')];var _0x4f5f72=url[_0x368c('0x5d')](_0x306772);_0x4f5f72=_0x4f5f72['replace'](/\/\?/g,'?');return _0x4f5f72;};Trigger[_0x368c('0x40')][_0x368c('0x6a')]=function(_0x3fbb2d,_0x2fdbc6){var _0x52cccb=!![];var _0x2f201e=!![];var _0x3cff46=![];if(_0x3fbb2d[_0x368c('0x6b')]===_0x2fdbc6[_0x368c('0x3c')]){_0x3cff46=!![];}if(_0x3fbb2d[_0x368c('0x6c')][_0x368c('0x45')]){_0x52cccb=_[_0x368c('0x6d')](_0x3fbb2d[_0x368c('0x6c')],this[_0x368c('0x6e')](_0x2fdbc6,_0x3fbb2d['channel']));}if(_0x3fbb2d['AnyConditions']['length']){_0x2f201e=_['some'](_0x3fbb2d[_0x368c('0x6f')],this[_0x368c('0x6e')](_0x2fdbc6,_0x3fbb2d[_0x368c('0x6b')]));}return _0x3cff46&&_0x52cccb&&_0x2f201e;};Trigger[_0x368c('0x40')][_0x368c('0x6e')]=function(_0x50df57,_0x41fda6){return function(_0x3f534c){switch(_0x3f534c[_0x368c('0x70')]){case'account':if(_0x50df57[_0x368c('0x6b')]===_0x41fda6){if(_0x41fda6===_0x368c('0x71')){return _0x50df57[_0x368c('0x72')]?operators[_0x3f534c['operator']](Number(_0x3f534c['value']),_0x50df57[_0x368c('0x72')]):![];}else{return _0x50df57[_[_0x368c('0x73')](_0x41fda6)+_0x368c('0x74')]?operators[_0x3f534c[_0x368c('0x75')]](Number(_0x3f534c[_0x368c('0x76')]),_0x50df57[_[_0x368c('0x73')](_0x41fda6)+_0x368c('0x74')]):![];}}break;case'interaction':case _0x368c('0x77'):if(_0x50df57['channel']===_0x41fda6){return _0x50df57[_0x368c('0x78')]?operators[_0x3f534c[_0x368c('0x75')]](_0x3f534c[_0x368c('0x76')],_0x50df57[_0x368c('0x78')]):![];}break;case _0x368c('0x64'):return _0x50df57[_0x368c('0x64')]?operators[_0x3f534c[_0x368c('0x75')]](_0x3f534c[_0x368c('0x76')],_0x50df57[_0x368c('0x64')]):![];case _0x368c('0x79'):return _0x50df57[_0x368c('0x7a')]?operators[_0x3f534c[_0x368c('0x75')]](_0x3f534c[_0x368c('0x76')],_0x50df57[_0x368c('0x7a')]):![];case _0x368c('0x7b'):return _0x50df57[_0x368c('0x7b')]?operators[_0x3f534c[_0x368c('0x75')]](_0x3f534c[_0x368c('0x76')],_0x50df57[_0x368c('0x7b')]):![];case _0x368c('0x65'):return _0x50df57['routeId']?operators[_0x3f534c[_0x368c('0x75')]](_0x3f534c[_0x368c('0x76')],_0x50df57['routeId']):![];case _0x368c('0x7c'):if(_0x3f534c[_0x368c('0x76')]===_0x368c('0x7d'))_0x3f534c[_0x368c('0x76')]=null;return typeof _0x50df57[_0x368c('0x7e')]!==_0x368c('0x3d')?operators[_0x3f534c['operator']](_0x3f534c['value'],_0x50df57['substatus']):![];case _0x368c('0x7f'):if(_0x50df57[_0x368c('0x6b')]===_0x41fda6){return _0x3f534c[_0x368c('0x76')]===_0x368c('0x80')&&_0x3f534c[_0x368c('0x75')]===_0x368c('0x81')?!![]:![];}break;}return![];};};module['exports']=Trigger;
\ No newline at end of file
index 7554f14..50ccc6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','%s/customers/%d/cases','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','integrationTab','newTab','catch','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','ioredis','./util','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','validateEmail','format','%s/users','then','total_entries','find','_embedded','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','%s/customers','remoteUri','POST','length','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variableName','custom_fields','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe14b,0x93));var _0xbe14=function(_0x1ed618,_0x26a9f0){_0x1ed618=_0x1ed618-0x0;var _0x5f5978=_0xe14b[_0x1ed618];return _0x5f5978;};'use strict';var _=require(_0xbe14('0x0'));var rp=require(_0xbe14('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xbe14('0x2'));var intUtil=require(_0xbe14('0x3'));var config=require('../../../../config/environment');var logger=require(_0xbe14('0x4'))('desk');config['redis']=_[_0xbe14('0x5')](config[_0xbe14('0x6')],{'host':_0xbe14('0x7'),'port':0x18eb});var io=require(_0xbe14('0x8'))(new Redis(config[_0xbe14('0x6')]));function emit(_0x39387e,_0x196fca,_0x566ae7){io['to'](_0x39387e)['emit'](_0x196fca,_0x566ae7);}var headers={'Content-Type':'application/json','Accept':_0xbe14('0x9')};function getUser(_0x6fceff,_0xd68cd7){if(intUtil[_0xbe14('0xa')](_0xd68cd7)===!![]){logger['info']('Getting\x20agent\x20with\x20email',_0xd68cd7);return request({'uri':util[_0xbe14('0xb')](_0xbe14('0xc'),_0x6fceff['remoteUri'])})[_0xbe14('0xd')](function(_0x35aa19){if(_0x35aa19[_0xbe14('0xe')]){return _[_0xbe14('0xf')](_0x35aa19[_0xbe14('0x10')][_0xbe14('0x11')],{'email':_0xd68cd7});}})[_0xbe14('0xd')](function(_0x2850cb){if(_0x2850cb){logger[_0xbe14('0x12')](_0xbe14('0x13'));return _0x2850cb;}else{logger[_0xbe14('0x12')](_0xbe14('0x14'));return request({'uri':util[_0xbe14('0xb')]('%s/users/me',_0x6fceff['remoteUri'])});}});}else{logger[_0xbe14('0x12')](_0xbe14('0x15'));return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x16'),_0x6fceff['remoteUri'])});}}function request(_0x21c789){logger[_0xbe14('0x17')](_0xbe14('0x18'),JSON[_0xbe14('0x19')](_0x21c789));return rp(_[_0xbe14('0x5')](_0x21c789,{'method':_0xbe14('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x17ae86){var _0x5ea1f8;if(_0x17ae86[_0xbe14('0x1b')]===_0xbe14('0x1c')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x1d'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x1f')]);}else if(_0x17ae86['authType']===_0xbe14('0x20')){_0x5ea1f8=util[_0xbe14('0xb')](_0xbe14('0x21'),_0x17ae86[_0xbe14('0x1e')],_0x17ae86[_0xbe14('0x20')]);}return util['format'](_0xbe14('0x22'),new Buffer(_0x5ea1f8)['toString'](_0xbe14('0x23')));}function getEndUser(_0x56e80c,_0x32e8eb,_0x4a25fa){logger[_0xbe14('0x12')](_0xbe14('0x24'),_0x4a25fa);return request({'uri':util['format'](_0xbe14('0x25'),_0x56e80c['remoteUri']),'qs':{'phone':_0x4a25fa}})[_0xbe14('0xd')](function(_0x4851f8){if(_0x4851f8[_0xbe14('0xe')]){logger[_0xbe14('0x12')](_0xbe14('0x26'));return _0x4851f8[_0xbe14('0x10')][_0xbe14('0x11')][0x0];}else{logger[_0xbe14('0x12')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xbe14('0xb')](_0xbe14('0x27'),_0x56e80c[_0xbe14('0x28')]),'method':_0xbe14('0x29'),'body':{'first_name':_0x32e8eb,'title':_0x32e8eb,'phone_numbers':[{'type':'work','value':_0x4a25fa}]}});}});}function getTags(_0x16f884,_0x29fc64){var _0x59bf34=[];if(_0x16f884&&_0x16f884[_0xbe14('0x2a')]>0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});};
\ No newline at end of file
+var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x4a7de4,_0x3c759a){var _0x428672=function(_0x4f579c){while(--_0x4f579c){_0x4a7de4['push'](_0x4a7de4['shift']());}};_0x428672(++_0x3c759a);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});};
\ No newline at end of file
index 4029097..18a654c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67ed=['lodash','request-promise','util','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','modernAuthentication','data7','tenantId','CloudProvider','data2','resolve','data5','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','outbound','destcalleridnum','calleridnum','POST','contacts','/systemusers(','userId','body','headers','odata-entityid','substring','lastIndexOf','enduserId','toLowerCase','telephone1','contacts?$select=','%2b','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','Fields','callDirection','queue','phonecalls','/contacts(','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','stripTrailingSlash','serverUrl','unmanaged','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x67ed,0x13e));var _0xd67e=function(_0x47dba5,_0x3c1d55){_0x47dba5=_0x47dba5-0x0;var _0x503bb0=_0x67ed[_0x47dba5];return _0x503bb0;};'use strict';var _=require(_0xd67e('0x0'));var rp=require(_0xd67e('0x1'));var util=require(_0xd67e('0x2'));var intUtil=require('./util');var md5=require(_0xd67e('0x3'));var Redis=require(_0xd67e('0x4'));var logger=require('../../../../config/logger')(_0xd67e('0x5'));var config=require(_0xd67e('0x6'));config[_0xd67e('0x7')]=_[_0xd67e('0x8')](config[_0xd67e('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xd67e('0x9'))(new Redis(config[_0xd67e('0x7')]));function getAuthToken(_0x2afbc3,_0x2e07bb,_0x539c2d){if(_0x2afbc3[_0xd67e('0xa')]){_0x2afbc3['remoteUri']=_0x2afbc3['CloudProvider'][_0xd67e('0xb')];_0x2afbc3[_0xd67e('0xc')]=_0x2afbc3[_0xd67e('0xd')][_0xd67e('0xe')];return Promise[_0xd67e('0xf')](_0x2afbc3[_0xd67e('0xd')][_0xd67e('0x10')]);}var _0x2cdf9b={'method':'POST','uri':_0x2e07bb,'form':{'client_id':_0x2afbc3[_0xd67e('0x11')],'resource':_0x2afbc3[_0xd67e('0x12')],'username':_0x2afbc3[_0xd67e('0x13')],'password':_0x2afbc3[_0xd67e('0x14')],'grant_type':_0xd67e('0x14'),'client_secret':_0x2afbc3[_0xd67e('0x15')]},'json':!![]};return rp(_0x2cdf9b)[_0xd67e('0x16')](function(_0x201d16){return _0x201d16[_0xd67e('0x17')];})[_0xd67e('0x18')](function(_0xba3910){logger[_0xd67e('0x19')]('['+[_0x539c2d[_0xd67e('0x1a')]()]+']\x20Wrong\x20credentials!');return _0xba3910[_0xd67e('0x1b')];});}function getUser(_0xe8294b,_0x420b43,_0x4f59b4,_0x43da68,_0x5868eb,_0x377c76){return new Promise(function(_0x9e4921,_0x5a79ac){return getAuthToken(_0x420b43,_0x43da68,_0x377c76)[_0xd67e('0x16')](function(_0x1a29cc){var _0xa7e1bf={'method':_0xd67e('0x1c'),'uri':_0x5868eb+_0xd67e('0x1d'),'headers':{'Authorization':_0xd67e('0x1e')+_0x1a29cc,'OData-Version':_0xd67e('0x1f')},'json':!![]};return rp(_0xa7e1bf);})[_0xd67e('0x16')](function(_0x400e30){var _0x3d9767=_0x400e30[_0xd67e('0x20')];var _0x47b28a=![];var _0x4af0d6=null;if(!_[_0xd67e('0x21')](_0x4f59b4)){if(intUtil[_0xd67e('0x22')](_0x4f59b4[_0xd67e('0x23')])){_0xe8294b['userEmail']=_0x4f59b4[_0xd67e('0x23')];for(_0x4af0d6=0x0;_0x4af0d6<_0x3d9767[_0xd67e('0x24')];_0x4af0d6++){if(_0x3d9767[_0x4af0d6][_0xd67e('0x25')]===_0x4f59b4[_0xd67e('0x23')]&&!_0x3d9767[_0x4af0d6][_0xd67e('0x26')]){_0x47b28a=!![];logger[_0xd67e('0x27')]('['+[_0x377c76['toUpperCase']()]+_0xd67e('0x28')+_0x3d9767[_0x4af0d6]['systemuserid']+'!');_0xe8294b['userId']=_0x3d9767[_0x4af0d6][_0xd67e('0x29')];}}}}if(!_0x47b28a){logger[_0xd67e('0x27')]('['+[_0x377c76[_0xd67e('0x1a')]()]+_0xd67e('0x2a'));_0xe8294b[_0xd67e('0x2b')]=_0x420b43[_0xd67e('0x13')];for(_0x4af0d6=0x0;_0x4af0d6<_0x3d9767[_0xd67e('0x24')];_0x4af0d6++){if(_0x3d9767[_0x4af0d6][_0xd67e('0x25')]===_0x420b43['username']){_0xe8294b['userId']=_0x3d9767[_0x4af0d6]['systemuserid'];}}}_0x9e4921(_0xe8294b);})[_0xd67e('0x18')](function(_0x5bcbce){_0x5a79ac(_0x5bcbce[_0xd67e('0x1b')]);});});}function createEndUser(_0x17d03d,_0x526d59,_0x23de7f,_0x4fc7e5,_0x8ee72a,_0x4bf6b9,_0x347807){return new Promise(function(_0x5c67af,_0x35a1fc){return getAuthToken(_0x526d59,_0x23de7f,_0x4bf6b9)['then'](function(_0x423a8e){var _0x5073ff=_0x4bf6b9['toLowerCase']()===_0xd67e('0x2c')?_0x8ee72a[_0xd67e('0x2d')]:_0x8ee72a[_0xd67e('0x2e')];var _0x491912={'method':_0xd67e('0x2f'),'uri':_0x4fc7e5+_0xd67e('0x30'),'body':{'fullname':_0x5073ff,'firstname':_0x5073ff,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xd67e('0x31')+_0x17d03d[_0xd67e('0x32')]+')'},'headers':{'Authorization':_0xd67e('0x1e')+_0x423a8e,'OData-Version':_0xd67e('0x1f')},'json':!![],'resolveWithFullResponse':!![]};_0x491912[_0xd67e('0x33')][_0x347807]=_0x5073ff;return rp(_0x491912);})[_0xd67e('0x16')](function(_0x389257){var _0x3ecf97=_0x389257[_0xd67e('0x34')][_0xd67e('0x35')];var _0x1885c8=_0x3ecf97[_0xd67e('0x36')](_0x3ecf97[_0xd67e('0x37')]('(')+0x1,_0x3ecf97[_0xd67e('0x37')](')'));_0x17d03d[_0xd67e('0x38')]=_0x1885c8;_0x5c67af(_0x17d03d);})[_0xd67e('0x18')](function(_0x5caffb){_0x35a1fc(_0x5caffb['message']);});});}function getEndUser(_0x1427fe,_0x386690,_0x533e23,_0xc2a1c2,_0x4b00b9,_0x341d98,_0x35f4a0,_0x523170){var _0x5553c1=_0x341d98[_0xd67e('0x39')]()==='outbound'?_0x4b00b9[_0xd67e('0x2d')]:_0x4b00b9[_0xd67e('0x2e')];return getAuthToken(_0x386690,_0x533e23,_0x341d98)[_0xd67e('0x16')](function(_0x1c5cf4){_0x523170=_0x523170?_0x523170:_0xd67e('0x3a');var _0x56adf2={'method':_0xd67e('0x1c'),'uri':_0xc2a1c2+_0xd67e('0x3b')+_0x523170+'&$filter='+_0x523170+'\x20eq\x20\x27'+_0x5553c1['replace']('+',_0xd67e('0x3c'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x1c5cf4,'If-None-Match':null,'OData-Version':_0xd67e('0x1f')},'json':!![]};return rp(_0x56adf2);})[_0xd67e('0x16')](function(_0x4cbd99){var _0x5a622b=![];if(!_0x4cbd99)return _0x5a622b;var _0x42b8d6=_0x4cbd99['value'];for(var _0x5ba7a7=0x0;_0x5ba7a7<_0x42b8d6[_0xd67e('0x24')];_0x5ba7a7++){if(_0x42b8d6[_0x5ba7a7][_0x523170]===_0x5553c1){_0x5a622b=!![];_0x1427fe[_0xd67e('0x38')]=_0x42b8d6[_0x5ba7a7]['contactid'];}}return _0x5a622b;})['then'](function(_0x5eb476){if(_0x5eb476)return _0x1427fe;if(_0x35f4a0===_0xd67e('0x3d')){logger['info']('['+[_0x341d98['toUpperCase']()]+_0xd67e('0x3e'));return _0x1427fe;}return createEndUser(_0x1427fe,_0x386690,_0x533e23,_0xc2a1c2,_0x4b00b9,_0x341d98,_0x523170)[_0xd67e('0x16')](function(_0x117593){logger['info']('['+[_0x341d98[_0xd67e('0x1a')]()]+_0xd67e('0x3f'),_0x117593[_0xd67e('0x38')]);return _0x117593;});});}function getCustomFields(_0x4d004d,_0x2ca322,_0x50fbf2){var _0x27a636={};if(_0x4d004d['length']>0x0){_[_0xd67e('0x40')](_0x4d004d,function(_0x2cd3e8){if(_[_0xd67e('0x41')]([_0xd67e('0x42'),_0xd67e('0x43')],_0x2cd3e8[_0xd67e('0x44')])&&_0x2cd3e8[_0xd67e('0x45')]&&!_0x2cd3e8[_0xd67e('0x46')]){var _0xc8d268=_0x2cd3e8[_0xd67e('0x47')]['toLowerCase']();var _0x5c7f17=_0xc8d268[_0xd67e('0x36')](0x0,_0xc8d268[_0xd67e('0x48')]('_'));var _0x2d6a13=_0xc8d268[_0xd67e('0x36')](_0xc8d268['indexOf']('_')+0x1);if(_0x5c7f17===_0x50fbf2){_0x27a636[_0x2d6a13]=_0x2cd3e8[_0xd67e('0x49')];}}});}return _0x27a636;}function getTicket(_0x35dcbc,_0xc39178,_0x4ed5a5,_0x586ba2,_0x4229b5,_0x27b579,_0x3b422a){return new Promise(function(_0x5ab94e,_0x4445a0){var _0x3c663c;return getAuthToken(_0xc39178,_0x4ed5a5,_0x3b422a)['then'](function(_0x427a02){if(_0x27b579[_0xd67e('0x4a')]===_0xd67e('0x4b')){_0x3c663c={'method':_0xd67e('0x2f'),'uri':_0x586ba2+_0xd67e('0x4c'),'body':Object[_0xd67e('0x4d')]({},{'title':intUtil[_0xd67e('0x4e')](_0x27b579[_0xd67e('0x4f')],_0x4229b5,'\x20'),'description':intUtil[_0xd67e('0x4e')](_0x27b579[_0xd67e('0x50')],_0x4229b5,'\x0a'),'customerid_contact@odata.bind':_0x35dcbc[_0xd67e('0x38')]?'/contacts('+_0x35dcbc[_0xd67e('0x38')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x35dcbc[_0xd67e('0x32')]+')','caseorigincode':'1'},getCustomFields(_0x27b579[_0xd67e('0x51')],_0x4229b5,_0x27b579['ticketType'])),'headers':{'Authorization':_0xd67e('0x1e')+_0x427a02,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x27b579[_0xd67e('0x4a')]==='phonecall'){var _0x3c727d=_0x35dcbc[_0xd67e('0x38')]?[{'partyid_systemuser@odata.bind':_0xd67e('0x31')+_0x35dcbc[_0xd67e('0x32')]+')','participationtypemask':_0x35dcbc[_0xd67e('0x52')]===_0xd67e('0x53')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x35dcbc['enduserId']+')','participationtypemask':_0x35dcbc[_0xd67e('0x52')]===_0xd67e('0x53')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xd67e('0x31')+_0x35dcbc[_0xd67e('0x32')]+')','participationtypemask':_0x35dcbc[_0xd67e('0x52')]===_0xd67e('0x53')?0x2:0x1}];_0x3c663c={'method':_0xd67e('0x2f'),'uri':_0x586ba2+_0xd67e('0x54'),'body':Object[_0xd67e('0x4d')]({},{'subject':intUtil[_0xd67e('0x4e')](_0x27b579[_0xd67e('0x4f')],_0x4229b5,'\x20'),'phonenumber':String(_0x4229b5[_0xd67e('0x2e')]),'description':intUtil['getString'](_0x27b579[_0xd67e('0x50')],_0x4229b5,'\x0a'),'regardingobjectid_contact@odata.bind':_0x35dcbc[_0xd67e('0x38')]?_0xd67e('0x55')+_0x35dcbc[_0xd67e('0x38')]+')':undefined,'ownerid@odata.bind':_0xd67e('0x31')+_0x35dcbc[_0xd67e('0x32')]+')','directioncode':_0x35dcbc['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':_0x3c727d},getCustomFields(_0x27b579[_0xd67e('0x51')],_0x4229b5,_0x27b579[_0xd67e('0x4a')])),'headers':{'Authorization':'Bearer\x20'+_0x427a02,'OData-Version':_0xd67e('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3c663c);})['then'](function(_0x50db96){var _0x552500=_0x50db96[_0xd67e('0x34')]['odata-entityid'];var _0x437578=_0x552500[_0xd67e('0x36')](_0x552500[_0xd67e('0x37')]('(')+0x1,_0x552500[_0xd67e('0x37')](')'));_0x35dcbc[_0xd67e('0x56')]=_0x437578;_0x5ab94e(_0x35dcbc);})[_0xd67e('0x18')](function(_0x6735c6){_0x4445a0(_0x6735c6[_0xd67e('0x1b')]);});});}function emit(_0x3aceda,_0xdbab81,_0x6d6c21,_0x54e298){var _0x35ed4e={'uri':util[_0xd67e('0x57')](_0xd67e('0x58'),_0x3aceda,_0x6d6c21,_0x54e298)};io['to'](util['format']('user:%s',_0xdbab81))[_0xd67e('0x59')]('trigger:browser:url',_0x35ed4e);}exports['cs']=function(_0x248b2a,_0x2aa07d,_0x5eaaf4,_0x303971,_0x4b2840,_0x45456c,_0x47e7a1,_0x4c5ba0){var _0x3e6d01={};_0x45456c[_0xd67e('0x12')]=_0x45456c[_0xd67e('0xa')]?intUtil[_0xd67e('0x5a')](_0x45456c[_0xd67e('0xd')][_0xd67e('0xb')]):intUtil['stripTrailingSlash'](_0x45456c[_0xd67e('0x12')]);_0x45456c[_0xd67e('0x5b')]=intUtil[_0xd67e('0x5a')](_0x45456c[_0xd67e('0x5b')]);_0x3e6d01['callDirection']=_0x4c5ba0===_0xd67e('0x53')||_0x4c5ba0===_0xd67e('0x5c')?_0xd67e('0x53'):'outbound';var _0x392cdf=_0x45456c['modernAuthentication']?util['format']('%s/api/data/v9.0/',_0x45456c[_0xd67e('0xd')][_0xd67e('0xb')]):util[_0xd67e('0x57')]('%s/api/data/v9.0/',_0x45456c[_0xd67e('0x12')]);var _0x43c15c=util[_0xd67e('0x57')](_0xd67e('0x5d'),_0x45456c[_0xd67e('0xc')]);var _0x3f39a=util[_0xd67e('0x57')](_0xd67e('0x5e'),_0x45456c[_0xd67e('0x5b')],_0x2aa07d[_0xd67e('0x5f')],md5(_0x2aa07d[_0xd67e('0x5f')]));if(_0x4b2840&&_0x4b2840['monitor_format']){logger['info']('[QUEUE]',_0xd67e('0x60'));_0x2aa07d[_0xd67e('0x61')]=_0x3f39a;}else if(_0x47e7a1&&_0x47e7a1['recordingFormat']&&_0x47e7a1['recordingFormat']!=='none'){logger[_0xd67e('0x27')](_0xd67e('0x62'),_0xd67e('0x60'));_0x2aa07d[_0xd67e('0x61')]=_0x3f39a;}else{_0x2aa07d[_0xd67e('0x61')]='';}return getUser(_0x3e6d01,_0x45456c,_0x303971,_0x43c15c,_0x392cdf,_0x4c5ba0)[_0xd67e('0x16')](function(_0x464aa0){logger[_0xd67e('0x27')]('['+_0x4c5ba0[_0xd67e('0x1a')]()+_0xd67e('0x63'),_0x464aa0[_0xd67e('0x32')]);logger[_0xd67e('0x27')]('['+_0x4c5ba0[_0xd67e('0x1a')]()+_0xd67e('0x64'),_0x464aa0['userEmail']);return getEndUser(_0x464aa0,_0x45456c,_0x43c15c,_0x392cdf,_0x2aa07d,_0x4c5ba0,_0x5eaaf4[_0xd67e('0x65')],_0x5eaaf4[_0xd67e('0x66')]);})['then'](function(_0x352727){logger[_0xd67e('0x27')]('['+_0x4c5ba0[_0xd67e('0x1a')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x352727[_0xd67e('0x38')]);logger['info']('['+_0x4c5ba0['toUpperCase']()+_0xd67e('0x67'),_0x2aa07d[_0xd67e('0x2e')]);return getTicket(_0x352727,_0x45456c,_0x43c15c,_0x392cdf,_0x2aa07d,_0x5eaaf4,_0x4c5ba0);})['then'](function(_0x2f19a0){logger['info'](util['format']('['+_0x4c5ba0['toUpperCase']()+_0xd67e('0x68'),_0x5eaaf4[_0xd67e('0x4a')],_0x2f19a0[_0xd67e('0x56')]));logger[_0xd67e('0x27')](util[_0xd67e('0x57')]('['+_0x4c5ba0['toUpperCase']()+_0xd67e('0x69'),_0x4c5ba0));if(_0x4c5ba0!==_0xd67e('0x5c')&&_0x5eaaf4['openNewTab']){logger[_0xd67e('0x27')]('['+_0x4c5ba0['toUpperCase']()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x45456c[_0xd67e('0x12')],_0x303971['name'],_0x5eaaf4[_0xd67e('0x4a')],_0x2f19a0[_0xd67e('0x56')]);}})['catch'](function(_0x20c825){logger['error']('['+_0x4c5ba0['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x20c825[_0xd67e('0x1b')]);console[_0xd67e('0x19')]('Error\x20running\x20Dynamics365\x20integration',_0x20c825);});};
\ No newline at end of file
+var _0x31e8=['assign','Subjects','getString','Descriptions','/contacts(','userId','Fields','phonecall','callDirection','queue','phonecalls','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','modernAuthentication','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','request-promise','util','./util','md5','ioredis','dynamics365','../../../../config/environment','defaults','redis','socket.io-emitter','remoteUri','CloudProvider','data7','tenantId','data2','resolve','data5','POST','clientId','username','password','clientSecret','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','4.0','value','isNil','email','userEmail','length','internalemailaddress',']\x20Agent\x20found\x20','systemuserid','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','%2b','contactid','nothing','info',']\x20Enduser\x20created!','forEach','includes','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','incidents'];(function(_0x4698cf,_0x25589a){var _0x3e2229=function(_0x230490){while(--_0x230490){_0x4698cf['push'](_0x4698cf['shift']());}};_0x3e2229(++_0x25589a);}(_0x31e8,0x10b));var _0x831e=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x31e8[_0x199572];return _0x13cfa3;};'use strict';var _=require('lodash');var rp=require(_0x831e('0x0'));var util=require(_0x831e('0x1'));var intUtil=require(_0x831e('0x2'));var md5=require(_0x831e('0x3'));var Redis=require(_0x831e('0x4'));var logger=require('../../../../config/logger')(_0x831e('0x5'));var config=require(_0x831e('0x6'));config['redis']=_[_0x831e('0x7')](config[_0x831e('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x831e('0x9'))(new Redis(config[_0x831e('0x8')]));function getAuthToken(_0x55b2ff,_0x567808,_0x1206ed){if(_0x55b2ff['modernAuthentication']){_0x55b2ff[_0x831e('0xa')]=_0x55b2ff[_0x831e('0xb')][_0x831e('0xc')];_0x55b2ff[_0x831e('0xd')]=_0x55b2ff[_0x831e('0xb')][_0x831e('0xe')];return Promise[_0x831e('0xf')](_0x55b2ff[_0x831e('0xb')][_0x831e('0x10')]);}var _0x575d2f={'method':_0x831e('0x11'),'uri':_0x567808,'form':{'client_id':_0x55b2ff[_0x831e('0x12')],'resource':_0x55b2ff['remoteUri'],'username':_0x55b2ff[_0x831e('0x13')],'password':_0x55b2ff[_0x831e('0x14')],'grant_type':_0x831e('0x14'),'client_secret':_0x55b2ff[_0x831e('0x15')]},'json':!![]};return rp(_0x575d2f)[_0x831e('0x16')](function(_0x24261b){return _0x24261b['access_token'];})[_0x831e('0x17')](function(_0x20f175){logger[_0x831e('0x18')]('['+[_0x1206ed[_0x831e('0x19')]()]+_0x831e('0x1a'));return _0x20f175[_0x831e('0x1b')];});}function getUser(_0x383471,_0x3a51a1,_0x586b6d,_0x5b4d47,_0x4ac6a2,_0x12ca1f){return new Promise(function(_0x52373c,_0x3ab7c9){return getAuthToken(_0x3a51a1,_0x5b4d47,_0x12ca1f)[_0x831e('0x16')](function(_0x43a6b9){var _0x27e6a5={'method':_0x831e('0x1c'),'uri':_0x4ac6a2+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x831e('0x1d')+_0x43a6b9,'OData-Version':_0x831e('0x1e')},'json':!![]};return rp(_0x27e6a5);})[_0x831e('0x16')](function(_0x33b1df){var _0x3f01e0=_0x33b1df[_0x831e('0x1f')];var _0x34a0f1=![];var _0x3db6ff=null;if(!_[_0x831e('0x20')](_0x586b6d)){if(intUtil['validateEmail'](_0x586b6d[_0x831e('0x21')])){_0x383471[_0x831e('0x22')]=_0x586b6d[_0x831e('0x21')];for(_0x3db6ff=0x0;_0x3db6ff<_0x3f01e0[_0x831e('0x23')];_0x3db6ff++){if(_0x3f01e0[_0x3db6ff][_0x831e('0x24')]===_0x586b6d[_0x831e('0x21')]&&!_0x3f01e0[_0x3db6ff]['isdisabled']){_0x34a0f1=!![];logger['info']('['+[_0x12ca1f[_0x831e('0x19')]()]+_0x831e('0x25')+_0x3f01e0[_0x3db6ff][_0x831e('0x26')]+'!');_0x383471['userId']=_0x3f01e0[_0x3db6ff]['systemuserid'];}}}}if(!_0x34a0f1){logger['info']('['+[_0x12ca1f['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x383471[_0x831e('0x22')]=_0x3a51a1[_0x831e('0x13')];for(_0x3db6ff=0x0;_0x3db6ff<_0x3f01e0[_0x831e('0x23')];_0x3db6ff++){if(_0x3f01e0[_0x3db6ff][_0x831e('0x24')]===_0x3a51a1['username']){_0x383471['userId']=_0x3f01e0[_0x3db6ff]['systemuserid'];}}}_0x52373c(_0x383471);})[_0x831e('0x17')](function(_0x4ab820){_0x3ab7c9(_0x4ab820[_0x831e('0x1b')]);});});}function createEndUser(_0x2dada8,_0x58bdb0,_0x179cca,_0x2181e7,_0x54575f,_0x2fd0e6,_0x405d2e){return new Promise(function(_0x3d57c9,_0x436aee){return getAuthToken(_0x58bdb0,_0x179cca,_0x2fd0e6)[_0x831e('0x16')](function(_0x29528a){var _0x279903=_0x2fd0e6[_0x831e('0x27')]()===_0x831e('0x28')?_0x54575f[_0x831e('0x29')]:_0x54575f[_0x831e('0x2a')];var _0x53367e={'method':_0x831e('0x11'),'uri':_0x2181e7+_0x831e('0x2b'),'body':{'fullname':_0x279903,'firstname':_0x279903,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x831e('0x2c')+_0x2dada8['userId']+')'},'headers':{'Authorization':_0x831e('0x1d')+_0x29528a,'OData-Version':_0x831e('0x1e')},'json':!![],'resolveWithFullResponse':!![]};_0x53367e[_0x831e('0x2d')][_0x405d2e]=_0x279903;return rp(_0x53367e);})['then'](function(_0x511f95){var _0x2cb037=_0x511f95[_0x831e('0x2e')][_0x831e('0x2f')];var _0x4c1807=_0x2cb037[_0x831e('0x30')](_0x2cb037[_0x831e('0x31')]('(')+0x1,_0x2cb037[_0x831e('0x31')](')'));_0x2dada8[_0x831e('0x32')]=_0x4c1807;_0x3d57c9(_0x2dada8);})[_0x831e('0x17')](function(_0x1131c4){_0x436aee(_0x1131c4[_0x831e('0x1b')]);});});}function getEndUser(_0x1291b9,_0x525f9a,_0x3b3def,_0x5db757,_0x4bf042,_0x210a09,_0x49aa53,_0x4dad41){var _0x116909=_0x210a09[_0x831e('0x27')]()===_0x831e('0x28')?_0x4bf042[_0x831e('0x29')]:_0x4bf042[_0x831e('0x2a')];return getAuthToken(_0x525f9a,_0x3b3def,_0x210a09)[_0x831e('0x16')](function(_0x55f33d){_0x4dad41=_0x4dad41?_0x4dad41:_0x831e('0x33');var _0x48e7a8={'method':_0x831e('0x1c'),'uri':_0x5db757+_0x831e('0x34')+_0x4dad41+_0x831e('0x35')+_0x4dad41+_0x831e('0x36')+_0x116909['replace']('+',_0x831e('0x37'))+'\x27','headers':{'Authorization':_0x831e('0x1d')+_0x55f33d,'If-None-Match':null,'OData-Version':_0x831e('0x1e')},'json':!![]};return rp(_0x48e7a8);})['then'](function(_0xcc2183){var _0x4fed41=![];if(!_0xcc2183)return _0x4fed41;var _0x19ffe3=_0xcc2183[_0x831e('0x1f')];for(var _0x1d2afe=0x0;_0x1d2afe<_0x19ffe3[_0x831e('0x23')];_0x1d2afe++){if(_0x19ffe3[_0x1d2afe][_0x4dad41]===_0x116909){_0x4fed41=!![];_0x1291b9[_0x831e('0x32')]=_0x19ffe3[_0x1d2afe][_0x831e('0x38')];}}return _0x4fed41;})['then'](function(_0x15a891){if(_0x15a891)return _0x1291b9;if(_0x49aa53===_0x831e('0x39')){logger[_0x831e('0x3a')]('['+[_0x210a09['toUpperCase']()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x1291b9;}return createEndUser(_0x1291b9,_0x525f9a,_0x3b3def,_0x5db757,_0x4bf042,_0x210a09,_0x4dad41)[_0x831e('0x16')](function(_0x33dcdc){logger['info']('['+[_0x210a09[_0x831e('0x19')]()]+_0x831e('0x3b'),_0x33dcdc[_0x831e('0x32')]);return _0x33dcdc;});});}function getCustomFields(_0x2ff036,_0x5de73f,_0x18efbb){var _0x561b90={};if(_0x2ff036[_0x831e('0x23')]>0x0){_[_0x831e('0x3c')](_0x2ff036,function(_0x67ddf){if(_[_0x831e('0x3d')](['string',_0x831e('0x3e')],_0x67ddf[_0x831e('0x3f')])&&_0x67ddf[_0x831e('0x40')]&&!_0x67ddf[_0x831e('0x41')]){var _0xe8a1d1=_0x67ddf[_0x831e('0x42')][_0x831e('0x27')]();var _0x4a4575=_0xe8a1d1[_0x831e('0x30')](0x0,_0xe8a1d1['indexOf']('_'));var _0x4ec65d=_0xe8a1d1[_0x831e('0x30')](_0xe8a1d1[_0x831e('0x43')]('_')+0x1);if(_0x4a4575===_0x18efbb){_0x561b90[_0x4ec65d]=_0x67ddf[_0x831e('0x44')];}}});}return _0x561b90;}function getTicket(_0x39b813,_0x22d718,_0x1c9d33,_0x2562c1,_0x2ae86c,_0x80f55c,_0x20c3a2){return new Promise(function(_0x262280,_0xa4cfd3){var _0x137f7d;return getAuthToken(_0x22d718,_0x1c9d33,_0x20c3a2)[_0x831e('0x16')](function(_0x49615c){if(_0x80f55c[_0x831e('0x45')]===_0x831e('0x46')){_0x137f7d={'method':_0x831e('0x11'),'uri':_0x2562c1+_0x831e('0x47'),'body':Object[_0x831e('0x48')]({},{'title':intUtil['getString'](_0x80f55c[_0x831e('0x49')],_0x2ae86c,'\x20'),'description':intUtil[_0x831e('0x4a')](_0x80f55c[_0x831e('0x4b')],_0x2ae86c,'\x0a'),'customerid_contact@odata.bind':_0x39b813[_0x831e('0x32')]?_0x831e('0x4c')+_0x39b813[_0x831e('0x32')]+')':undefined,'ownerid@odata.bind':_0x831e('0x2c')+_0x39b813[_0x831e('0x4d')]+')','caseorigincode':'1'},getCustomFields(_0x80f55c[_0x831e('0x4e')],_0x2ae86c,_0x80f55c[_0x831e('0x45')])),'headers':{'Authorization':'Bearer\x20'+_0x49615c,'OData-Version':_0x831e('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x80f55c[_0x831e('0x45')]===_0x831e('0x4f')){var _0x8e2d27=_0x39b813[_0x831e('0x32')]?[{'partyid_systemuser@odata.bind':_0x831e('0x2c')+_0x39b813['userId']+')','participationtypemask':_0x39b813[_0x831e('0x50')]===_0x831e('0x51')?0x2:0x1},{'partyid_contact@odata.bind':_0x831e('0x4c')+_0x39b813[_0x831e('0x32')]+')','participationtypemask':_0x39b813['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x39b813[_0x831e('0x4d')]+')','participationtypemask':_0x39b813['callDirection']==='queue'?0x2:0x1}];_0x137f7d={'method':_0x831e('0x11'),'uri':_0x2562c1+_0x831e('0x52'),'body':Object[_0x831e('0x48')]({},{'subject':intUtil[_0x831e('0x4a')](_0x80f55c[_0x831e('0x49')],_0x2ae86c,'\x20'),'phonenumber':String(_0x2ae86c[_0x831e('0x2a')]),'description':intUtil[_0x831e('0x4a')](_0x80f55c['Descriptions'],_0x2ae86c,'\x0a'),'regardingobjectid_contact@odata.bind':_0x39b813[_0x831e('0x32')]?_0x831e('0x4c')+_0x39b813[_0x831e('0x32')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x39b813['userId']+')','directioncode':_0x39b813[_0x831e('0x50')]===_0x831e('0x51')?![]:!![],'phonecall_activity_parties':_0x8e2d27},getCustomFields(_0x80f55c[_0x831e('0x4e')],_0x2ae86c,_0x80f55c[_0x831e('0x45')])),'headers':{'Authorization':_0x831e('0x1d')+_0x49615c,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x137f7d);})[_0x831e('0x16')](function(_0x31b182){var _0x4f20ea=_0x31b182[_0x831e('0x2e')][_0x831e('0x2f')];var _0x5e7ff3=_0x4f20ea['substring'](_0x4f20ea[_0x831e('0x31')]('(')+0x1,_0x4f20ea['lastIndexOf'](')'));_0x39b813[_0x831e('0x53')]=_0x5e7ff3;_0x262280(_0x39b813);})[_0x831e('0x17')](function(_0x3c04bf){_0xa4cfd3(_0x3c04bf[_0x831e('0x1b')]);});});}function emit(_0x4211a9,_0x5cf831,_0x50dd61,_0x138977){var _0x204339={'uri':util[_0x831e('0x54')](_0x831e('0x55'),_0x4211a9,_0x50dd61,_0x138977)};io['to'](util[_0x831e('0x54')]('user:%s',_0x5cf831))[_0x831e('0x56')](_0x831e('0x57'),_0x204339);}exports['cs']=function(_0x57db7a,_0x1f60d4,_0x23337d,_0x1cfe67,_0x4fd529,_0x2fbaa3,_0x513b30,_0x1efc2a){var _0x57e5f9={};_0x2fbaa3[_0x831e('0xa')]=_0x2fbaa3[_0x831e('0x58')]?intUtil[_0x831e('0x59')](_0x2fbaa3[_0x831e('0xb')]['data7']):intUtil[_0x831e('0x59')](_0x2fbaa3['remoteUri']);_0x2fbaa3[_0x831e('0x5a')]=intUtil[_0x831e('0x59')](_0x2fbaa3[_0x831e('0x5a')]);_0x57e5f9[_0x831e('0x50')]=_0x1efc2a===_0x831e('0x51')||_0x1efc2a===_0x831e('0x5b')?'queue':'outbound';var _0x1c2e55=_0x2fbaa3['modernAuthentication']?util[_0x831e('0x54')]('%s/api/data/v9.0/',_0x2fbaa3[_0x831e('0xb')][_0x831e('0xc')]):util[_0x831e('0x54')](_0x831e('0x5c'),_0x2fbaa3[_0x831e('0xa')]);var _0x148b19=util[_0x831e('0x54')](_0x831e('0x5d'),_0x2fbaa3[_0x831e('0xd')]);var _0x594e30=util[_0x831e('0x54')](_0x831e('0x5e'),_0x2fbaa3[_0x831e('0x5a')],_0x1f60d4[_0x831e('0x5f')],md5(_0x1f60d4[_0x831e('0x5f')]));if(_0x4fd529&&_0x4fd529[_0x831e('0x60')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x1f60d4[_0x831e('0x61')]=_0x594e30;}else if(_0x513b30&&_0x513b30['recordingFormat']&&_0x513b30[_0x831e('0x62')]!==_0x831e('0x63')){logger['info'](_0x831e('0x64'),_0x831e('0x65'));_0x1f60d4[_0x831e('0x61')]=_0x594e30;}else{_0x1f60d4[_0x831e('0x61')]='';}return getUser(_0x57e5f9,_0x2fbaa3,_0x1cfe67,_0x148b19,_0x1c2e55,_0x1efc2a)[_0x831e('0x16')](function(_0x52caa6){logger[_0x831e('0x3a')]('['+_0x1efc2a[_0x831e('0x19')]()+_0x831e('0x66'),_0x52caa6['userId']);logger[_0x831e('0x3a')]('['+_0x1efc2a[_0x831e('0x19')]()+_0x831e('0x67'),_0x52caa6[_0x831e('0x22')]);return getEndUser(_0x52caa6,_0x2fbaa3,_0x148b19,_0x1c2e55,_0x1f60d4,_0x1efc2a,_0x23337d[_0x831e('0x68')],_0x23337d[_0x831e('0x69')]);})['then'](function(_0x454309){logger['info']('['+_0x1efc2a['toUpperCase']()+_0x831e('0x6a'),_0x454309[_0x831e('0x32')]);logger[_0x831e('0x3a')]('['+_0x1efc2a[_0x831e('0x19')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x1f60d4[_0x831e('0x2a')]);return getTicket(_0x454309,_0x2fbaa3,_0x148b19,_0x1c2e55,_0x1f60d4,_0x23337d,_0x1efc2a);})[_0x831e('0x16')](function(_0x54dfb2){logger[_0x831e('0x3a')](util[_0x831e('0x54')]('['+_0x1efc2a[_0x831e('0x19')]()+_0x831e('0x6b'),_0x23337d[_0x831e('0x45')],_0x54dfb2['ticketId']));logger[_0x831e('0x3a')](util[_0x831e('0x54')]('['+_0x1efc2a[_0x831e('0x19')]()+_0x831e('0x6c'),_0x1efc2a));if(_0x1efc2a!==_0x831e('0x5b')&&_0x23337d[_0x831e('0x6d')]){logger[_0x831e('0x3a')]('['+_0x1efc2a['toUpperCase']()+']',_0x831e('0x6e'));emit(_0x2fbaa3[_0x831e('0xa')],_0x1cfe67[_0x831e('0x6f')],_0x23337d[_0x831e('0x45')],_0x54dfb2[_0x831e('0x53')]);}})['catch'](function(_0x2c58d6){logger[_0x831e('0x18')]('['+_0x1efc2a[_0x831e('0x19')]()+_0x831e('0x70'),_0x2c58d6[_0x831e('0x1b')]);console[_0x831e('0x18')]('Error\x20running\x20Dynamics365\x20integration',_0x2c58d6);});};
\ No newline at end of file
index ac9c9f9..cf9e418 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6a2=['calleridname','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','trigger:browser:url','monitor_format','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridnum','Subjects','Descriptions','<br>','Tags','name','Fields','custom_fields','mapValues','keyBy','value','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','stringify','map','includes','string','picklist','customField','nameField','toLowerCase','type','idField','push','content','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:'];(function(_0x28fca4,_0x11e78b){var _0x42fd01=function(_0x33a97e){while(--_0x33a97e){_0x28fca4['push'](_0x28fca4['shift']());}};_0x42fd01(++_0x11e78b);}(_0xc6a2,0x1d9));var _0x2c6a=function(_0x6c57b9,_0xded5c1){_0x6c57b9=_0x6c57b9-0x0;var _0x4d5820=_0xc6a2[_0x6c57b9];return _0x4d5820;};'use strict';var _=require(_0x2c6a('0x0'));var rp=require(_0x2c6a('0x1'));var md5=require(_0x2c6a('0x2'));var util=require(_0x2c6a('0x3'));var Redis=require(_0x2c6a('0x4'));var intUtil=require('./util');var config=require(_0x2c6a('0x5'));var logger=require(_0x2c6a('0x6'))('freshdesk');config[_0x2c6a('0x7')]=_[_0x2c6a('0x8')](config[_0x2c6a('0x7')],{'host':_0x2c6a('0x9'),'port':0x18eb});var io=require(_0x2c6a('0xa'))(new Redis(config[_0x2c6a('0x7')]));var headers={'Content-Type':_0x2c6a('0xb'),'Accept':_0x2c6a('0xb')};function emit(_0x20ef44,_0x27ab3a,_0x1f066a){io['to'](_0x20ef44)['emit'](_0x27ab3a,_0x1f066a);}function getTicket(_0x4bcdfd,_0x75abde,_0x4bc907,_0x1de941,_0x561071){logger[_0x2c6a('0xc')](_0x2c6a('0xd'));var _0x52af71=_['merge']({'responder_id':_0x75abde['id'],'requester_id':_0x4bc907['id'],'name':util[_0x2c6a('0xe')](_0x2c6a('0xf'),_0x561071['calleridname']),'phone':_0x561071[_0x2c6a('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x1de941[_0x2c6a('0x11')],_0x561071,'\x20'),'description':intUtil['getString'](_0x1de941[_0x2c6a('0x12')],_0x561071,_0x2c6a('0x13')),'tags':getTags(_0x1de941[_0x2c6a('0x14')],_0x2c6a('0x15'))},getCustomFields(_0x1de941[_0x2c6a('0x16')],_0x561071));_0x52af71[_0x2c6a('0x17')]=_[_0x2c6a('0x18')](_[_0x2c6a('0x19')](_0x52af71[_0x2c6a('0x17')],'id'),_0x2c6a('0x1a'));return request({'uri':util[_0x2c6a('0xe')]('%s/api/v2/tickets',_0x4bcdfd[_0x2c6a('0x1b')]),'method':_0x2c6a('0x1c'),'body':_0x52af71})[_0x2c6a('0x1d')](function(_0x4fc28e){logger[_0x2c6a('0xc')](_0x2c6a('0x1e'));return _0x4fc28e;});}function getUser(_0x32bb6e,_0x36518d){if(intUtil[_0x2c6a('0x1f')](_0x36518d)){return request({'uri':util['format'](_0x2c6a('0x20'),_0x32bb6e[_0x2c6a('0x1b')]),'qs':{'email':_0x36518d}})['then'](function(_0x2bef4d){if(_0x2bef4d[_0x2c6a('0x21')]){logger[_0x2c6a('0xc')]('Agent\x20found!');return _[_0x2c6a('0x22')](_0x2bef4d,function(_0x5beef9){return _0x5beef9[_0x2c6a('0x23')]['email']===_0x36518d;});}else{logger[_0x2c6a('0xc')](_0x2c6a('0x24'));return request({'uri':util[_0x2c6a('0xe')](_0x2c6a('0x25'),_0x32bb6e[_0x2c6a('0x1b')])})[_0x2c6a('0x1d')](function(_0x7df981){logger[_0x2c6a('0xc')](_0x2c6a('0x26'));return _0x7df981;});}});}else{logger['info'](_0x2c6a('0x27'));return request({'uri':util[_0x2c6a('0xe')](_0x2c6a('0x25'),_0x32bb6e[_0x2c6a('0x1b')])})['then'](function(_0x18048a){logger[_0x2c6a('0xc')](_0x2c6a('0x26'));return _0x18048a;});}}function getEndUser(_0x4540a2,_0x3eee43,_0x2c1274){logger[_0x2c6a('0xc')](_0x2c6a('0x28'),_0x2c1274);return request({'uri':util['format']('%s/api/v2/contacts',_0x4540a2['remoteUri']),'qs':{'phone':_0x2c1274}})[_0x2c6a('0x1d')](function(_0x1d0860){if(_0x1d0860[_0x2c6a('0x21')]){logger['info']('Enduser\x20found!');return _[_0x2c6a('0x22')](_0x1d0860,{'phone':_0x2c1274});}else{logger[_0x2c6a('0xc')](_0x2c6a('0x29'));return request({'uri':util[_0x2c6a('0xe')](_0x2c6a('0x2a'),_0x4540a2[_0x2c6a('0x1b')]),'method':_0x2c6a('0x1c'),'body':{'name':_0x3eee43,'phone':_0x2c1274}})[_0x2c6a('0x1d')](function(_0xd05d8d){logger['info'](_0x2c6a('0x2b'));return _0xd05d8d;});}});}function getAuth(_0x1509e9){return util[_0x2c6a('0xe')](_0x2c6a('0x2c'),new Buffer(_0x1509e9[_0x2c6a('0x2d')]+':X')[_0x2c6a('0x2e')](_0x2c6a('0x2f')));}function request(_0x1e7784){logger[_0x2c6a('0x30')]('[HTTP]',JSON[_0x2c6a('0x31')](_0x1e7784));return rp(_[_0x2c6a('0x8')](_0x1e7784,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x428346,_0x3536bc){var _0x3691cf=[];if(_0x428346&&_0x428346[_0x2c6a('0x21')]>0x0){_0x3691cf=_[_0x2c6a('0x32')](_0x428346,_0x3536bc);}return _0x3691cf;}function getCustomFields(_0x9dae03,_0x2ce543){var _0x29fa4f=[];var _0x510035={'custom_fields':[]};if(_0x9dae03[_0x2c6a('0x21')]>0x0){_['forEach'](_0x9dae03,function(_0x454311){if(_[_0x2c6a('0x33')]([_0x2c6a('0x34'),_0x2c6a('0x35')],_0x454311['type'])&&_0x454311['nameField']&&!_0x454311[_0x2c6a('0x36')]){_0x510035[_0x454311[_0x2c6a('0x37')][_0x2c6a('0x38')]()]=_0x454311['content']['toString']();}else if(_['includes']([_0x2c6a('0x34'),_0x2c6a('0x35')],_0x454311[_0x2c6a('0x39')])&&_0x454311[_0x2c6a('0x3a')]&&_0x454311[_0x2c6a('0x36')]){_0x510035[_0x2c6a('0x17')][_0x2c6a('0x3b')]({'id':_0x454311['idField'],'value':_0x454311[_0x2c6a('0x3c')][_0x2c6a('0x2e')]()});}else if(_0x454311[_0x2c6a('0x39')]===_0x2c6a('0x3d')&&_0x454311[_0x2c6a('0x3e')]&&_0x454311[_0x2c6a('0x3a')]&&_0x454311[_0x2c6a('0x36')]){_0x2ce543[_0x454311['variableName']]&&_0x510035[_0x2c6a('0x17')][_0x2c6a('0x3b')]({'id':_0x454311[_0x2c6a('0x3a')],'value':_0x2ce543[_0x454311[_0x2c6a('0x3e')]][_0x2c6a('0x2e')]()});}else if(_0x454311[_0x2c6a('0x39')]===_0x2c6a('0x3f')&&_0x454311[_0x2c6a('0x40')]&&_0x454311['Variable']['name']&&_0x454311[_0x2c6a('0x3a')]&&_0x454311['customField']){_0x2ce543[_0x454311[_0x2c6a('0x40')][_0x2c6a('0x15')][_0x2c6a('0x38')]()]&&_0x510035['custom_fields'][_0x2c6a('0x3b')]({'id':_0x454311[_0x2c6a('0x3a')],'value':_0x2ce543[_0x454311[_0x2c6a('0x40')][_0x2c6a('0x15')][_0x2c6a('0x38')]()][_0x2c6a('0x2e')]()});}});}return _0x510035;}exports['queue']=function(_0x429c99,_0x480e9c,_0x2edea5,_0x43cfd2,_0x4bb30e,_0x31859d){var _0x52f23e,_0x5dff22;_0x31859d[_0x2c6a('0x1b')]=intUtil[_0x2c6a('0x41')](_0x31859d['remoteUri']);_0x31859d[_0x2c6a('0x42')]=intUtil['stripTrailingSlash'](_0x31859d[_0x2c6a('0x42')]);if(_0x4bb30e&&_0x4bb30e['monitor_format']){logger['info'](_0x2c6a('0x43'),'Recording\x20is\x20enabled!');_0x480e9c[_0x2c6a('0x44')]=util[_0x2c6a('0xe')](_0x2c6a('0x45'),_0x31859d[_0x2c6a('0x42')],_0x480e9c[_0x2c6a('0x46')],md5(_0x480e9c[_0x2c6a('0x46')]));}else{_0x480e9c[_0x2c6a('0x44')]='';}headers[_0x2c6a('0x47')]=getAuth(_0x31859d);return getUser(_0x31859d,_0x43cfd2['email'])[_0x2c6a('0x1d')](function(_0x236e67){_0x52f23e=_0x236e67;logger[_0x2c6a('0xc')](_0x2c6a('0x48'),_0x52f23e['id']);return getEndUser(_0x31859d,_0x480e9c[_0x2c6a('0x49')],_0x480e9c['calleridnum']);})['then'](function(_0x129862){_0x5dff22=_0x129862;logger['info']('The\x20Enduser\x20ID\x20is:',_0x5dff22['id']);return getTicket(_0x31859d,_0x52f23e,_0x5dff22,_0x2edea5,_0x480e9c);})[_0x2c6a('0x1d')](function(_0x34e766){if(_0x34e766&&_0x34e766['id']){logger[_0x2c6a('0xc')](_0x2c6a('0x1e'));logger[_0x2c6a('0xc')]('The\x20Ticket\x20ID\x20is:',_0x34e766['id']);logger[_0x2c6a('0xc')]('[QUEUE]',_0x2c6a('0x4a'));emit(util[_0x2c6a('0xe')]('user:%s',_0x43cfd2[_0x2c6a('0x15')]),'trigger:browser:url',{'uri':util['format'](_0x2c6a('0x4b'),_0x31859d[_0x2c6a('0x1b')],_0x34e766['id'])});}})[_0x2c6a('0x4c')](function(_0x8f016b){logger[_0x2c6a('0x4d')](_0x2c6a('0x43'),JSON[_0x2c6a('0x31')](_0x8f016b));});};exports[_0x2c6a('0x4e')]=function(_0x515c21,_0x395f3d,_0x86d5d0,_0x3c7199,_0xb27942,_0x39dc19,_0x598867){var _0x3f5aad,_0x40da4f;_0x39dc19[_0x2c6a('0x1b')]=intUtil[_0x2c6a('0x41')](_0x39dc19[_0x2c6a('0x1b')]);_0x39dc19[_0x2c6a('0x42')]=intUtil[_0x2c6a('0x41')](_0x39dc19[_0x2c6a('0x42')]);if(_0x598867&&_0x598867[_0x2c6a('0x4f')]&&_0x598867[_0x2c6a('0x4f')]!==_0x2c6a('0x50')){logger[_0x2c6a('0xc')](_0x2c6a('0x51'),_0x2c6a('0x52'));_0x395f3d[_0x2c6a('0x44')]=util[_0x2c6a('0xe')](_0x2c6a('0x45'),_0x39dc19[_0x2c6a('0x42')],_0x395f3d[_0x2c6a('0x46')],md5(_0x395f3d[_0x2c6a('0x46')]));}headers[_0x2c6a('0x47')]=getAuth(_0x39dc19);return getUser(_0x39dc19,_0x3c7199[_0x2c6a('0x53')])[_0x2c6a('0x1d')](function(_0x4fbd42){_0x3f5aad=_0x4fbd42;logger[_0x2c6a('0xc')](_0x2c6a('0x48'),_0x3f5aad['id']);return getEndUser(_0x39dc19,_0x395f3d[_0x2c6a('0x54')],_0x395f3d['destcalleridnum']);})[_0x2c6a('0x1d')](function(_0x2692dd){_0x40da4f=_0x2692dd;logger[_0x2c6a('0xc')](_0x2c6a('0x55'),_0x40da4f['id']);return getTicket(_0x39dc19,_0x3f5aad,_0x40da4f,_0x86d5d0,_0x395f3d);})[_0x2c6a('0x1d')](function(_0x3a37bc){if(_0x3a37bc&&_0x3a37bc['id']){logger[_0x2c6a('0xc')]('Ticket\x20created!');logger['info'](_0x2c6a('0x56'),_0x3a37bc['id']);logger[_0x2c6a('0xc')]('[OUTBOUND]',_0x2c6a('0x4a'));emit(util[_0x2c6a('0xe')]('user:%s',_0x3c7199['name']),_0x2c6a('0x57'),{'uri':util[_0x2c6a('0xe')](_0x2c6a('0x4b'),_0x39dc19[_0x2c6a('0x1b')],_0x3a37bc['id'])});}})['catch'](function(_0x1bb93f){logger[_0x2c6a('0x4d')](_0x2c6a('0x51'),JSON[_0x2c6a('0x31')](_0x1bb93f));});};exports['unmanaged']=function(_0x4d73c1,_0x2d881,_0x15158b,_0x2fde1a,_0x4f0e13,_0x4ac129){var _0x542fe0,_0x498381;_0x4ac129[_0x2c6a('0x1b')]=intUtil[_0x2c6a('0x41')](_0x4ac129['remoteUri']);_0x4ac129[_0x2c6a('0x42')]=intUtil['stripTrailingSlash'](_0x4ac129[_0x2c6a('0x42')]);if(_0x4f0e13&&_0x4f0e13[_0x2c6a('0x58')]){logger['info']('['+_0x2d881[_0x2c6a('0x59')]['toUpperCase']()+']',_0x2c6a('0x52'));_0x2d881[_0x2c6a('0x44')]=util[_0x2c6a('0xe')](_0x2c6a('0x45'),_0x4ac129[_0x2c6a('0x42')],_0x2d881[_0x2c6a('0x46')],md5(_0x2d881['uniqueid']));}else{_0x2d881['recordingURL']='';}headers[_0x2c6a('0x47')]=getAuth(_0x4ac129);return getUser(_0x4ac129,'')['then'](function(_0x35003f){_0x542fe0=_0x35003f;logger['info'](_0x2c6a('0x48'),_0x542fe0['id']);return getEndUser(_0x4ac129,_0x2d881[_0x2c6a('0x49')],_0x2d881[_0x2c6a('0x10')]);})['then'](function(_0x2d9caa){_0x498381=_0x2d9caa;logger[_0x2c6a('0xc')](_0x2c6a('0x55'),_0x498381['id']);return getTicket(_0x4ac129,_0x542fe0,_0x498381,_0x15158b,_0x2d881);})['then'](function(_0x3eecb5){if(_0x3eecb5){logger[_0x2c6a('0xc')](_0x2c6a('0x1e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x3eecb5['id']);}})[_0x2c6a('0x4c')](function(_0x254496){logger[_0x2c6a('0x4d')]('['+_0x2d881[_0x2c6a('0x59')][_0x2c6a('0x5a')]()+']',JSON[_0x2c6a('0x31')](_0x254496));});};
\ No newline at end of file
+var _0xcfdd=['The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','unmanaged','toUpperCase','lastevent','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','getString','Descriptions','<br>','Tags','name','Fields','custom_fields','mapValues','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','contact','email','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','includes','string','picklist','type','nameField','customField','content','toString','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','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum'];(function(_0xfb9f58,_0x2352b6){var _0x47e49b=function(_0x47fe8f){while(--_0x47fe8f){_0xfb9f58['push'](_0xfb9f58['shift']());}};_0x47e49b(++_0x2352b6);}(_0xcfdd,0x67));var _0xdcfd=function(_0x5db59c,_0x11cc79){_0x5db59c=_0x5db59c-0x0;var _0x2a1f41=_0xcfdd[_0x5db59c];return _0x2a1f41;};'use strict';var _=require(_0xdcfd('0x0'));var rp=require(_0xdcfd('0x1'));var md5=require('md5');var util=require(_0xdcfd('0x2'));var Redis=require(_0xdcfd('0x3'));var intUtil=require(_0xdcfd('0x4'));var config=require(_0xdcfd('0x5'));var logger=require(_0xdcfd('0x6'))(_0xdcfd('0x7'));config[_0xdcfd('0x8')]=_['defaults'](config[_0xdcfd('0x8')],{'host':_0xdcfd('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0xdcfd('0xa'),'Accept':_0xdcfd('0xa')};function emit(_0x3aa280,_0x24d277,_0x1486f8){io['to'](_0x3aa280)[_0xdcfd('0xb')](_0x24d277,_0x1486f8);}function getTicket(_0x54c744,_0x202571,_0x785de5,_0x1e9c6f,_0x431df8){logger[_0xdcfd('0xc')](_0xdcfd('0xd'));var _0x2f0b3f=_[_0xdcfd('0xe')]({'responder_id':_0x202571['id'],'requester_id':_0x785de5['id'],'name':util[_0xdcfd('0xf')](_0xdcfd('0x10'),_0x431df8[_0xdcfd('0x11')]),'phone':_0x431df8['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xdcfd('0x12')](_0x1e9c6f['Subjects'],_0x431df8,'\x20'),'description':intUtil[_0xdcfd('0x12')](_0x1e9c6f[_0xdcfd('0x13')],_0x431df8,_0xdcfd('0x14')),'tags':getTags(_0x1e9c6f[_0xdcfd('0x15')],_0xdcfd('0x16'))},getCustomFields(_0x1e9c6f[_0xdcfd('0x17')],_0x431df8));_0x2f0b3f[_0xdcfd('0x18')]=_[_0xdcfd('0x19')](_['keyBy'](_0x2f0b3f['custom_fields'],'id'),_0xdcfd('0x1a'));return request({'uri':util[_0xdcfd('0xf')](_0xdcfd('0x1b'),_0x54c744[_0xdcfd('0x1c')]),'method':_0xdcfd('0x1d'),'body':_0x2f0b3f})[_0xdcfd('0x1e')](function(_0x25472d){logger[_0xdcfd('0xc')](_0xdcfd('0x1f'));return _0x25472d;});}function getUser(_0x21e265,_0x4364a7){if(intUtil[_0xdcfd('0x20')](_0x4364a7)){return request({'uri':util[_0xdcfd('0xf')](_0xdcfd('0x21'),_0x21e265['remoteUri']),'qs':{'email':_0x4364a7}})['then'](function(_0x1e4b86){if(_0x1e4b86[_0xdcfd('0x22')]){logger[_0xdcfd('0xc')](_0xdcfd('0x23'));return _['find'](_0x1e4b86,function(_0x73b7ec){return _0x73b7ec[_0xdcfd('0x24')][_0xdcfd('0x25')]===_0x4364a7;});}else{logger[_0xdcfd('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xdcfd('0xf')]('%s/api/v2/agents/me',_0x21e265[_0xdcfd('0x1c')])})['then'](function(_0x35f967){logger['info'](_0xdcfd('0x26'));return _0x35f967;});}});}else{logger[_0xdcfd('0xc')](_0xdcfd('0x27'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x21e265[_0xdcfd('0x1c')])})[_0xdcfd('0x1e')](function(_0x27d985){logger[_0xdcfd('0xc')](_0xdcfd('0x26'));return _0x27d985;});}}function getEndUser(_0x10310a,_0x3e83fe,_0x543597){logger['info'](_0xdcfd('0x28'),_0x543597);return request({'uri':util[_0xdcfd('0xf')](_0xdcfd('0x29'),_0x10310a[_0xdcfd('0x1c')]),'qs':{'phone':_0x543597}})[_0xdcfd('0x1e')](function(_0x15a6c4){if(_0x15a6c4['length']){logger[_0xdcfd('0xc')](_0xdcfd('0x2a'));return _['find'](_0x15a6c4,{'phone':_0x543597});}else{logger[_0xdcfd('0xc')](_0xdcfd('0x2b'));return request({'uri':util[_0xdcfd('0xf')](_0xdcfd('0x29'),_0x10310a['remoteUri']),'method':_0xdcfd('0x1d'),'body':{'name':_0x3e83fe,'phone':_0x543597}})[_0xdcfd('0x1e')](function(_0xededd4){logger[_0xdcfd('0xc')](_0xdcfd('0x2c'));return _0xededd4;});}});}function getAuth(_0x4c481f){return util['format'](_0xdcfd('0x2d'),new Buffer(_0x4c481f['apiKey']+':X')['toString'](_0xdcfd('0x2e')));}function request(_0x2561d8){logger[_0xdcfd('0x2f')](_0xdcfd('0x30'),JSON[_0xdcfd('0x31')](_0x2561d8));return rp(_[_0xdcfd('0x32')](_0x2561d8,{'method':_0xdcfd('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x43d9a0,_0x1bdb48){var _0x2eecd8=[];if(_0x43d9a0&&_0x43d9a0[_0xdcfd('0x22')]>0x0){_0x2eecd8=_[_0xdcfd('0x34')](_0x43d9a0,_0x1bdb48);}return _0x2eecd8;}function getCustomFields(_0x3b0ce6,_0x190ecd){var _0x4b8060=[];var _0x2dfb74={'custom_fields':[]};if(_0x3b0ce6[_0xdcfd('0x22')]>0x0){_[_0xdcfd('0x35')](_0x3b0ce6,function(_0x22aa8b){if(_[_0xdcfd('0x36')]([_0xdcfd('0x37'),_0xdcfd('0x38')],_0x22aa8b[_0xdcfd('0x39')])&&_0x22aa8b[_0xdcfd('0x3a')]&&!_0x22aa8b[_0xdcfd('0x3b')]){_0x2dfb74[_0x22aa8b[_0xdcfd('0x3a')]['toLowerCase']()]=_0x22aa8b[_0xdcfd('0x3c')][_0xdcfd('0x3d')]();}else if(_['includes']([_0xdcfd('0x37'),_0xdcfd('0x38')],_0x22aa8b['type'])&&_0x22aa8b[_0xdcfd('0x3e')]&&_0x22aa8b['customField']){_0x2dfb74[_0xdcfd('0x18')][_0xdcfd('0x3f')]({'id':_0x22aa8b[_0xdcfd('0x3e')],'value':_0x22aa8b[_0xdcfd('0x3c')]['toString']()});}else if(_0x22aa8b[_0xdcfd('0x39')]===_0xdcfd('0x40')&&_0x22aa8b[_0xdcfd('0x41')]&&_0x22aa8b[_0xdcfd('0x3e')]&&_0x22aa8b[_0xdcfd('0x3b')]){_0x190ecd[_0x22aa8b[_0xdcfd('0x41')]]&&_0x2dfb74['custom_fields'][_0xdcfd('0x3f')]({'id':_0x22aa8b['idField'],'value':_0x190ecd[_0x22aa8b[_0xdcfd('0x41')]]['toString']()});}else if(_0x22aa8b[_0xdcfd('0x39')]==='customVariable'&&_0x22aa8b[_0xdcfd('0x42')]&&_0x22aa8b[_0xdcfd('0x42')][_0xdcfd('0x16')]&&_0x22aa8b[_0xdcfd('0x3e')]&&_0x22aa8b['customField']){_0x190ecd[_0x22aa8b[_0xdcfd('0x42')][_0xdcfd('0x16')][_0xdcfd('0x43')]()]&&_0x2dfb74[_0xdcfd('0x18')]['push']({'id':_0x22aa8b['idField'],'value':_0x190ecd[_0x22aa8b['Variable'][_0xdcfd('0x16')][_0xdcfd('0x43')]()][_0xdcfd('0x3d')]()});}});}return _0x2dfb74;}exports[_0xdcfd('0x44')]=function(_0x20f439,_0x3fda5c,_0x148b72,_0x522125,_0x4d6633,_0x597ff7){var _0x59f078,_0x1b929a;_0x597ff7[_0xdcfd('0x1c')]=intUtil['stripTrailingSlash'](_0x597ff7[_0xdcfd('0x1c')]);_0x597ff7[_0xdcfd('0x45')]=intUtil[_0xdcfd('0x46')](_0x597ff7[_0xdcfd('0x45')]);if(_0x4d6633&&_0x4d6633[_0xdcfd('0x47')]){logger['info'](_0xdcfd('0x48'),_0xdcfd('0x49'));_0x3fda5c[_0xdcfd('0x4a')]=util['format'](_0xdcfd('0x4b'),_0x597ff7['serverUrl'],_0x3fda5c['uniqueid'],md5(_0x3fda5c[_0xdcfd('0x4c')]));}else{_0x3fda5c['recordingURL']='';}headers['Authorization']=getAuth(_0x597ff7);return getUser(_0x597ff7,_0x522125['email'])[_0xdcfd('0x1e')](function(_0x9c5977){_0x59f078=_0x9c5977;logger['info'](_0xdcfd('0x4d'),_0x59f078['id']);return getEndUser(_0x597ff7,_0x3fda5c[_0xdcfd('0x11')],_0x3fda5c[_0xdcfd('0x4e')]);})['then'](function(_0x523443){_0x1b929a=_0x523443;logger['info'](_0xdcfd('0x4f'),_0x1b929a['id']);return getTicket(_0x597ff7,_0x59f078,_0x1b929a,_0x148b72,_0x3fda5c);})[_0xdcfd('0x1e')](function(_0x4765b6){if(_0x4765b6&&_0x4765b6['id']){logger[_0xdcfd('0xc')](_0xdcfd('0x1f'));logger[_0xdcfd('0xc')]('The\x20Ticket\x20ID\x20is:',_0x4765b6['id']);logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xdcfd('0xf')]('user:%s',_0x522125['name']),'trigger:browser:url',{'uri':util[_0xdcfd('0xf')](_0xdcfd('0x50'),_0x597ff7[_0xdcfd('0x1c')],_0x4765b6['id'])});}})[_0xdcfd('0x51')](function(_0x18ff85){logger['error'](_0xdcfd('0x48'),JSON[_0xdcfd('0x31')](_0x18ff85));});};exports[_0xdcfd('0x52')]=function(_0x220da5,_0x21b4c1,_0xe0bb8b,_0x586327,_0x246676,_0x369061,_0x312768){var _0x30cae8,_0xf63734;_0x369061['remoteUri']=intUtil[_0xdcfd('0x46')](_0x369061['remoteUri']);_0x369061['serverUrl']=intUtil['stripTrailingSlash'](_0x369061[_0xdcfd('0x45')]);if(_0x312768&&_0x312768[_0xdcfd('0x53')]&&_0x312768[_0xdcfd('0x53')]!==_0xdcfd('0x54')){logger[_0xdcfd('0xc')](_0xdcfd('0x55'),_0xdcfd('0x49'));_0x21b4c1[_0xdcfd('0x4a')]=util[_0xdcfd('0xf')](_0xdcfd('0x4b'),_0x369061[_0xdcfd('0x45')],_0x21b4c1[_0xdcfd('0x4c')],md5(_0x21b4c1['uniqueid']));}headers[_0xdcfd('0x56')]=getAuth(_0x369061);return getUser(_0x369061,_0x586327[_0xdcfd('0x25')])[_0xdcfd('0x1e')](function(_0x59c99f){_0x30cae8=_0x59c99f;logger[_0xdcfd('0xc')]('The\x20User\x20ID\x20is:',_0x30cae8['id']);return getEndUser(_0x369061,_0x21b4c1[_0xdcfd('0x57')],_0x21b4c1[_0xdcfd('0x58')]);})[_0xdcfd('0x1e')](function(_0x446937){_0xf63734=_0x446937;logger['info']('The\x20Enduser\x20ID\x20is:',_0xf63734['id']);return getTicket(_0x369061,_0x30cae8,_0xf63734,_0xe0bb8b,_0x21b4c1);})[_0xdcfd('0x1e')](function(_0x38e0f0){if(_0x38e0f0&&_0x38e0f0['id']){logger['info'](_0xdcfd('0x1f'));logger[_0xdcfd('0xc')](_0xdcfd('0x59'),_0x38e0f0['id']);logger[_0xdcfd('0xc')](_0xdcfd('0x55'),_0xdcfd('0x5a'));emit(util['format']('user:%s',_0x586327['name']),_0xdcfd('0x5b'),{'uri':util[_0xdcfd('0xf')](_0xdcfd('0x50'),_0x369061[_0xdcfd('0x1c')],_0x38e0f0['id'])});}})[_0xdcfd('0x51')](function(_0x3012f2){logger[_0xdcfd('0x5c')](_0xdcfd('0x55'),JSON['stringify'](_0x3012f2));});};exports[_0xdcfd('0x5d')]=function(_0x45164b,_0x495e63,_0x5d857d,_0x2ad1aa,_0x554699,_0x1872e6){var _0x393663,_0x369c9e;_0x1872e6[_0xdcfd('0x1c')]=intUtil[_0xdcfd('0x46')](_0x1872e6[_0xdcfd('0x1c')]);_0x1872e6[_0xdcfd('0x45')]=intUtil[_0xdcfd('0x46')](_0x1872e6[_0xdcfd('0x45')]);if(_0x554699&&_0x554699[_0xdcfd('0x47')]){logger[_0xdcfd('0xc')]('['+_0x495e63['lastevent'][_0xdcfd('0x5e')]()+']','Recording\x20is\x20enabled!');_0x495e63[_0xdcfd('0x4a')]=util[_0xdcfd('0xf')](_0xdcfd('0x4b'),_0x1872e6[_0xdcfd('0x45')],_0x495e63[_0xdcfd('0x4c')],md5(_0x495e63['uniqueid']));}else{_0x495e63[_0xdcfd('0x4a')]='';}headers[_0xdcfd('0x56')]=getAuth(_0x1872e6);return getUser(_0x1872e6,'')[_0xdcfd('0x1e')](function(_0x3bf715){_0x393663=_0x3bf715;logger[_0xdcfd('0xc')](_0xdcfd('0x4d'),_0x393663['id']);return getEndUser(_0x1872e6,_0x495e63['calleridname'],_0x495e63['calleridnum']);})[_0xdcfd('0x1e')](function(_0x2a3f12){_0x369c9e=_0x2a3f12;logger['info'](_0xdcfd('0x4f'),_0x369c9e['id']);return getTicket(_0x1872e6,_0x393663,_0x369c9e,_0x5d857d,_0x495e63);})[_0xdcfd('0x1e')](function(_0x27f37){if(_0x27f37){logger[_0xdcfd('0xc')](_0xdcfd('0x1f'));logger[_0xdcfd('0xc')](_0xdcfd('0x59'),_0x27f37['id']);}})[_0xdcfd('0x51')](function(_0x3df48c){logger['error']('['+_0x495e63[_0xdcfd('0x5f')][_0xdcfd('0x5e')]()+']',JSON[_0xdcfd('0x31')](_0x3df48c));});};
\ No newline at end of file
index d294ca8..cd3068d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa177=['userEmail','userId','adminEmail','&entities=contact','contacts','catch','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','endUserId','work_number','contactNumber','Contact\x20found\x20work_number:','Contact\x20created:','POST','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Subjects','Descriptions','Contact','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','calleridnum','callDirection','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','request-promise','md5','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','length','adminId','Requested\x20Resource\x20not\x20Found','error','toUpperCase','message','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email'];(function(_0x138ef2,_0x476eb6){var _0x12e139=function(_0x3c886c){while(--_0x3c886c){_0x138ef2['push'](_0x138ef2['shift']());}};_0x12e139(++_0x476eb6);}(_0xa177,0x175));var _0x7a17=function(_0x53f1d2,_0x4adb9b){_0x53f1d2=_0x53f1d2-0x0;var _0x16bee4=_0xa177[_0x53f1d2];return _0x16bee4;};'use strict';var _=require('lodash');var rp=require(_0x7a17('0x0'));var md5=require(_0x7a17('0x1'));var util=require('util');var moment=require('moment');var Promise=require(_0x7a17('0x2'));var Redis=require(_0x7a17('0x3'));var intUtil=require(_0x7a17('0x4'));var config=require(_0x7a17('0x5'));var logger=require(_0x7a17('0x6'))(_0x7a17('0x7'));config['redis']=_['defaults'](config[_0x7a17('0x8')],{'host':_0x7a17('0x9'),'port':0x18eb});var io=require(_0x7a17('0xa'))(new Redis(config[_0x7a17('0x8')]));function getAdminId(_0x4f50eb,_0x40a25b,_0x38f805,_0x4956f1){return new Promise(function(_0x3f9858,_0x591685){var _0x3d6b33=![];var _0x1f6616={'method':_0x7a17('0xb'),'uri':_0x4956f1+_0x7a17('0xc'),'json':!![]};_0x1f6616[_0x7a17('0xd')]=_0x38f805;logger[_0x7a17('0xe')](_0x7a17('0xf'));return rp(_0x1f6616)[_0x7a17('0x10')](function(_0x3f9a19){if(_0x3f9a19){var _0x55c6dd=_0x3f9a19['users'];var _0x1d0faa=null;for(_0x1d0faa=0x0;_0x1d0faa<_0x55c6dd[_0x7a17('0x11')];_0x1d0faa++){if(_0x55c6dd[_0x1d0faa]['email']===_0x4f50eb['adminEmail']){_0x4f50eb[_0x7a17('0x12')]=_0x55c6dd[_0x1d0faa]['id'];_0x3d6b33=!![];}}if(_0x3d6b33){logger['info']('Admin\x20found:',_0x4f50eb[_0x7a17('0x12')]);_0x3f9858(_0x4f50eb);}else{_0x591685({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x591685({'statusCode':0x194,'message':_0x7a17('0x13')});}})['catch'](function(_0x1dbe41){logger[_0x7a17('0x14')]('['+[_0x40a25b[_0x7a17('0x15')]()]+']',_0x1dbe41[_0x7a17('0x16')]);_0x591685(_0x1dbe41);});});}function getUser(_0x1b071f,_0x4f5671,_0x15670e){return function(_0x19ae8f){return new Promise(function(_0x5acf5e,_0x139804){var _0x57cfb2={'method':'GET','uri':_0x15670e+_0x7a17('0xc'),'json':!![]};_0x57cfb2[_0x7a17('0xd')]=_0x4f5671;logger[_0x7a17('0xe')](_0x7a17('0x17'));return rp(_0x57cfb2)[_0x7a17('0x10')](function(_0x5f32dc){if(_0x5f32dc){var _0x5b49e3=_0x5f32dc[_0x7a17('0x18')];var _0xcb126a=![];var _0x10e460=null;if(_0x19ae8f[_0x7a17('0x19')]!==null){logger['info'](_0x7a17('0x1a'),_0x19ae8f[_0x7a17('0x19')]);_0x19ae8f[_0x7a17('0x1b')]=_0x19ae8f[_0x7a17('0x19')];for(_0x10e460=0x0;_0x10e460<_0x5b49e3['length'];_0x10e460++){if(_0x5b49e3[_0x10e460]['email']===_0x19ae8f['agentEmail']){_0xcb126a=!![];_0x19ae8f['userId']=_0x5b49e3[_0x10e460]['id'];logger[_0x7a17('0xe')]('User\x20found:',_0x19ae8f[_0x7a17('0x1c')]);}}}if(!_0xcb126a){logger[_0x7a17('0xe')]('Admin\x20selected');_0x19ae8f[_0x7a17('0x1b')]=_0x19ae8f[_0x7a17('0x1d')];_0x19ae8f[_0x7a17('0x1c')]=_0x19ae8f['adminId'];_0xcb126a=!![];}if(_0xcb126a){_0x5acf5e(_0x19ae8f);}else{_0x139804({'statusCode':0x194,'message':_0x7a17('0x13')});}}else{_0x139804({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x168891){logger['error']('['+[_0x1b071f[_0x7a17('0x15')]()]+']',_0x168891[_0x7a17('0x16')]);_0x139804(_0x168891);});});};}function searchContact(_0x253644,_0x567273,_0x1190ba,_0x5c1f35){return new Promise(function(_0x1baf4f,_0xf4fc7f){var _0x435393={'method':_0x7a17('0xb'),'headers':_0x567273,'uri':_0x253644+'/api/lookup?q='+_0x5c1f35+'&f='+_0x1190ba+_0x7a17('0x1e'),'json':!![]};rp(_0x435393)[_0x7a17('0x10')](function(_0x1c9cde){var _0x456e91=_['find'](_0x1c9cde[_0x7a17('0x1f')]['contacts'],[_0x1190ba,_0x5c1f35]);_0x1baf4f(_0x456e91);})[_0x7a17('0x20')](function(_0x2ac2ea){_0xf4fc7f(_0x2ac2ea);});});}function getEndUser(_0x232167,_0x3e3705,_0x3c51b1){return function(_0x2d1aad){return new Promise(function(_0x20c9ea,_0x1938c0){logger[_0x7a17('0xe')](util[_0x7a17('0x21')](_0x7a17('0x22'),_0x2d1aad['contactNumber']));searchContact(_0x3c51b1,_0x3e3705,_0x7a17('0x23'),_0x2d1aad['contactNumber'])['then'](function(_0x85712d){if(_0x85712d){_0x2d1aad[_0x7a17('0x24')]=_0x85712d['id'];logger['info']('Contact\x20found\x20mobile_number:',_0x2d1aad[_0x7a17('0x24')]);return _0x20c9ea(_0x2d1aad);}searchContact(_0x3c51b1,_0x3e3705,_0x7a17('0x25'),_0x2d1aad[_0x7a17('0x26')])[_0x7a17('0x10')](function(_0x11dba6){if(_0x11dba6){_0x2d1aad[_0x7a17('0x24')]=_0x11dba6['id'];logger[_0x7a17('0xe')](_0x7a17('0x27'),_0x2d1aad[_0x7a17('0x24')]);return _0x20c9ea(_0x2d1aad);}createEndUser(_0x2d1aad,_0x232167,_0x3e3705,_0x3c51b1)[_0x7a17('0x10')](function(_0x1709f2){logger['info'](_0x7a17('0x28'),_0x1709f2['endUserId']);return _0x20c9ea(_0x1709f2);});});})[_0x7a17('0x20')](function(_0x1d932a){_0x1938c0(_0x1d932a);});});};}function createEndUser(_0x358c60,_0x2c18ab,_0x48133a,_0x4145bf){return new Promise(function(_0xc3762f,_0x33a653){var _0x47f03f=moment();var _0x1d1b7f={'method':_0x7a17('0x29'),'uri':_0x4145bf+'/api/contacts','body':{'contact':{'last_name':_0x358c60[_0x7a17('0x26')],'work_number':_0x358c60[_0x7a17('0x26')],'mobile_number':_0x358c60[_0x7a17('0x26')],'owner_id':_0x358c60[_0x7a17('0x1c')],'created_at':_0x47f03f['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x1d1b7f[_0x7a17('0xd')]=_0x48133a;logger[_0x7a17('0xe')](_0x7a17('0x2a'));return rp(_0x1d1b7f)['then'](function(_0x22213f){_0x358c60['endUserId']=_0x22213f[_0x7a17('0x2b')]['id'];_0xc3762f(_0x358c60);})['catch'](function(_0x3c45a4){logger[_0x7a17('0x14')]('['+[_0x2c18ab[_0x7a17('0x15')]()]+']',_0x3c45a4[_0x7a17('0x16')]);_0x33a653(_0x3c45a4[_0x7a17('0x16')]);});});}function getTicket(_0x43ea7c,_0x2e4464,_0x4936a9,_0x1bc3d9,_0x39725a){return function(_0x4fe76b){logger[_0x7a17('0xe')]('Creating\x20new\x20task');return new Promise(function(_0x457c22,_0x34de4a){var _0x243162=moment();var _0x2fd59f={'method':'POST','uri':_0x4936a9+_0x7a17('0x2c'),'body':{'title':intUtil[_0x7a17('0x2d')](_0x1bc3d9[_0x7a17('0x2e')],_0x39725a,'\x20'),'description':intUtil[_0x7a17('0x2d')](_0x1bc3d9[_0x7a17('0x2f')],_0x39725a,'\x0a'),'owner_id':_0x4fe76b[_0x7a17('0x1c')],'creater_id':_0x4fe76b[_0x7a17('0x12')],'targetable_id':_0x4fe76b[_0x7a17('0x24')],'targetable_type':_0x7a17('0x30'),'created_at':_0x243162['format'](_0x7a17('0x31')),'due_date':_0x243162[_0x7a17('0x32')](0x1e,'m')[_0x7a17('0x21')](_0x7a17('0x31'))},'json':!![]};_0x2fd59f['headers']=_0x2e4464;return rp(_0x2fd59f)[_0x7a17('0x10')](function(_0x1d324d){_0x4fe76b[_0x7a17('0x33')]=_0x1d324d[_0x7a17('0x34')]['id'];logger['info'](_0x7a17('0x35'),_0x4fe76b[_0x7a17('0x33')]);_0x457c22(_0x4fe76b);})[_0x7a17('0x20')](function(_0x443346){logger[_0x7a17('0x14')]('['+[_0x43ea7c[_0x7a17('0x15')]()]+']',_0x443346[_0x7a17('0x16')]);_0x34de4a(_0x443346[_0x7a17('0x16')]);});});};}function emit(_0x47c372,_0x50c812,_0x1401c4){var _0xbb863a={'uri':_0x47c372+_0x7a17('0x36')+_0x1401c4};io['to'](util['format']('user:%s',_0x50c812))[_0x7a17('0x37')](_0x7a17('0x38'),_0xbb863a);}exports['cs']=function(_0x2ec235,_0x1c5309,_0x1aeec9,_0x31fac9,_0x54bcc0,_0x4d4840,_0x47c2a0,_0x4206cb){var _0x255be4={};var _0x1fba70={'Authorization':_0x7a17('0x39')+_0x4d4840[_0x7a17('0x3a')]};_0x4d4840[_0x7a17('0x3b')]=intUtil[_0x7a17('0x3c')](_0x4d4840['remoteUri']);_0x4d4840['serverUrl']=intUtil[_0x7a17('0x3c')](_0x4d4840[_0x7a17('0x3d')]);var _0x2d848a=_0x4d4840[_0x7a17('0x3b')];_0x255be4[_0x7a17('0x1d')]=_0x4d4840[_0x7a17('0x3e')];_0x255be4[_0x7a17('0x26')]=_0x4206cb[_0x7a17('0x3f')]()==='outbound'?_0x1c5309['destcalleridnum']:_0x1c5309[_0x7a17('0x40')];_0x255be4[_0x7a17('0x41')]=_0x4206cb==='queue'||_0x4206cb==='unmanaged'?_0x7a17('0x42'):_0x7a17('0x43');if(_0x31fac9){_0x255be4['agentEmail']=_0x31fac9['email'];}var _0xbb502c=util['format'](_0x7a17('0x44'),_0x4d4840[_0x7a17('0x3d')],_0x1c5309['uniqueid'],md5(_0x1c5309['uniqueid']));if(_0x54bcc0&&_0x54bcc0[_0x7a17('0x45')]){logger[_0x7a17('0xe')](_0x7a17('0x46'),_0x7a17('0x47'));_0x1c5309[_0x7a17('0x48')]=_0xbb502c;}else if(_0x47c2a0&&_0x47c2a0[_0x7a17('0x49')]&&_0x47c2a0[_0x7a17('0x49')]!=='none'){logger[_0x7a17('0xe')](_0x7a17('0x4a'),_0x7a17('0x47'));_0x1c5309[_0x7a17('0x48')]=_0xbb502c;}else{_0x1c5309[_0x7a17('0x48')]='';}return getAdminId(_0x255be4,_0x4206cb,_0x1fba70,_0x2d848a)[_0x7a17('0x10')](getUser(_0x4206cb,_0x1fba70,_0x2d848a))[_0x7a17('0x10')](getEndUser(_0x4206cb,_0x1fba70,_0x2d848a))[_0x7a17('0x10')](getTicket(_0x4206cb,_0x1fba70,_0x2d848a,_0x1aeec9,_0x1c5309))[_0x7a17('0x10')](function(_0x369ebe){logger[_0x7a17('0xe')](util[_0x7a17('0x21')](_0x7a17('0x4b'),_0x369ebe[_0x7a17('0x33')]));if(_0x4206cb!==_0x7a17('0x4c')){logger[_0x7a17('0xe')]('['+[_0x4206cb[_0x7a17('0x15')]()]+']',_0x7a17('0x4d'));emit(_0x2d848a,_0x31fac9[_0x7a17('0x4e')],_0x369ebe['endUserId']);}})[_0x7a17('0x20')](function(_0x4c3a1d){logger[_0x7a17('0x14')]('['+[_0x4206cb['toUpperCase']()]+_0x7a17('0x4f'),util['inspect'](_0x4c3a1d,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xb169=['queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','recordingFormat','Recording\x20is\x20enabled!','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','Getting\x20admin\x20information','then','users','length','email','info','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','User\x20found:','adminEmail','userId','toUpperCase','&f=','find','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','catch','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','error','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','add','ticketId','task','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','calleridnum'];(function(_0x357a52,_0xa8e98d){var _0x3d9eb6=function(_0x136496){while(--_0x136496){_0x357a52['push'](_0x357a52['shift']());}};_0x3d9eb6(++_0xa8e98d);}(_0xb169,0xfa));var _0x9b16=function(_0x2900bf,_0x396900){_0x2900bf=_0x2900bf-0x0;var _0x4ff896=_0xb169[_0x2900bf];return _0x4ff896;};'use strict';var _=require(_0x9b16('0x0'));var rp=require('request-promise');var md5=require(_0x9b16('0x1'));var util=require(_0x9b16('0x2'));var moment=require(_0x9b16('0x3'));var Promise=require(_0x9b16('0x4'));var Redis=require(_0x9b16('0x5'));var intUtil=require(_0x9b16('0x6'));var config=require(_0x9b16('0x7'));var logger=require(_0x9b16('0x8'))('freshsales');config['redis']=_[_0x9b16('0x9')](config[_0x9b16('0xa')],{'host':_0x9b16('0xb'),'port':0x18eb});var io=require(_0x9b16('0xc'))(new Redis(config[_0x9b16('0xa')]));function getAdminId(_0x2d19dc,_0x12b84d,_0xc2d8d1,_0x525457){return new Promise(function(_0x530761,_0xb33049){var _0x571134=![];var _0x5d0c56={'method':_0x9b16('0xd'),'uri':_0x525457+_0x9b16('0xe'),'json':!![]};_0x5d0c56[_0x9b16('0xf')]=_0xc2d8d1;logger['info'](_0x9b16('0x10'));return rp(_0x5d0c56)[_0x9b16('0x11')](function(_0xfd7204){if(_0xfd7204){var _0x4932f0=_0xfd7204[_0x9b16('0x12')];var _0x5476d3=null;for(_0x5476d3=0x0;_0x5476d3<_0x4932f0[_0x9b16('0x13')];_0x5476d3++){if(_0x4932f0[_0x5476d3][_0x9b16('0x14')]===_0x2d19dc['adminEmail']){_0x2d19dc['adminId']=_0x4932f0[_0x5476d3]['id'];_0x571134=!![];}}if(_0x571134){logger[_0x9b16('0x15')](_0x9b16('0x16'),_0x2d19dc[_0x9b16('0x17')]);_0x530761(_0x2d19dc);}else{_0xb33049({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0xb33049({'statusCode':0x194,'message':_0x9b16('0x18')});}})['catch'](function(_0x1c8426){logger['error']('['+[_0x12b84d['toUpperCase']()]+']',_0x1c8426[_0x9b16('0x19')]);_0xb33049(_0x1c8426);});});}function getUser(_0x107a8c,_0x109597,_0x322024){return function(_0x29149f){return new Promise(function(_0x15f997,_0x5099f2){var _0x21e09d={'method':_0x9b16('0xd'),'uri':_0x322024+'/api/selector/owners','json':!![]};_0x21e09d['headers']=_0x109597;logger['info']('Getting\x20user\x20list');return rp(_0x21e09d)[_0x9b16('0x11')](function(_0x4badb9){if(_0x4badb9){var _0x4649c9=_0x4badb9[_0x9b16('0x12')];var _0x5968fc=![];var _0x2436f3=null;if(_0x29149f[_0x9b16('0x1a')]!==null){logger[_0x9b16('0x15')](_0x9b16('0x1b'),_0x29149f[_0x9b16('0x1a')]);_0x29149f[_0x9b16('0x1c')]=_0x29149f[_0x9b16('0x1a')];for(_0x2436f3=0x0;_0x2436f3<_0x4649c9[_0x9b16('0x13')];_0x2436f3++){if(_0x4649c9[_0x2436f3][_0x9b16('0x14')]===_0x29149f['agentEmail']){_0x5968fc=!![];_0x29149f['userId']=_0x4649c9[_0x2436f3]['id'];logger[_0x9b16('0x15')](_0x9b16('0x1d'),_0x29149f['userId']);}}}if(!_0x5968fc){logger[_0x9b16('0x15')]('Admin\x20selected');_0x29149f[_0x9b16('0x1c')]=_0x29149f[_0x9b16('0x1e')];_0x29149f[_0x9b16('0x1f')]=_0x29149f[_0x9b16('0x17')];_0x5968fc=!![];}if(_0x5968fc){_0x15f997(_0x29149f);}else{_0x5099f2({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x5099f2({'statusCode':0x194,'message':_0x9b16('0x18')});}})['catch'](function(_0x387235){logger['error']('['+[_0x107a8c[_0x9b16('0x20')]()]+']',_0x387235[_0x9b16('0x19')]);_0x5099f2(_0x387235);});});};}function searchContact(_0x2c89f8,_0x28119a,_0x22b955,_0x5a591b){return new Promise(function(_0x45ab4a,_0x192f0f){var _0x4d01c9={'method':_0x9b16('0xd'),'headers':_0x28119a,'uri':_0x2c89f8+'/api/lookup?q='+_0x5a591b+_0x9b16('0x21')+_0x22b955+'&entities=contact','json':!![]};rp(_0x4d01c9)[_0x9b16('0x11')](function(_0xe02086){var _0xfb2e57=_[_0x9b16('0x22')](_0xe02086[_0x9b16('0x23')][_0x9b16('0x23')],[_0x22b955,_0x5a591b]);_0x45ab4a(_0xfb2e57);})['catch'](function(_0x413355){_0x192f0f(_0x413355);});});}function getEndUser(_0x3ff776,_0x55ef7c,_0x41ad97){return function(_0x33c9fc){return new Promise(function(_0x1962e0,_0x2148cc){logger['info'](util[_0x9b16('0x24')]('Searching\x20contact\x20with\x20phone\x20%s',_0x33c9fc[_0x9b16('0x25')]));searchContact(_0x41ad97,_0x55ef7c,_0x9b16('0x26'),_0x33c9fc[_0x9b16('0x25')])['then'](function(_0x146cfe){if(_0x146cfe){_0x33c9fc[_0x9b16('0x27')]=_0x146cfe['id'];logger['info'](_0x9b16('0x28'),_0x33c9fc[_0x9b16('0x27')]);return _0x1962e0(_0x33c9fc);}searchContact(_0x41ad97,_0x55ef7c,_0x9b16('0x29'),_0x33c9fc[_0x9b16('0x25')])[_0x9b16('0x11')](function(_0x29c1bf){if(_0x29c1bf){_0x33c9fc[_0x9b16('0x27')]=_0x29c1bf['id'];logger[_0x9b16('0x15')](_0x9b16('0x2a'),_0x33c9fc['endUserId']);return _0x1962e0(_0x33c9fc);}createEndUser(_0x33c9fc,_0x3ff776,_0x55ef7c,_0x41ad97)[_0x9b16('0x11')](function(_0x5dd23b){logger[_0x9b16('0x15')](_0x9b16('0x2b'),_0x5dd23b[_0x9b16('0x27')]);return _0x1962e0(_0x5dd23b);});});})[_0x9b16('0x2c')](function(_0x1b1954){_0x2148cc(_0x1b1954);});});};}function createEndUser(_0x51ceb9,_0x3ea0de,_0x24376c,_0x106bbf){return new Promise(function(_0x262b10,_0xe96586){var _0x57b49c=moment();var _0x53a5d9={'method':_0x9b16('0x2d'),'uri':_0x106bbf+_0x9b16('0x2e'),'body':{'contact':{'last_name':_0x51ceb9['contactNumber'],'work_number':_0x51ceb9[_0x9b16('0x25')],'mobile_number':_0x51ceb9[_0x9b16('0x25')],'owner_id':_0x51ceb9[_0x9b16('0x1f')],'created_at':_0x57b49c[_0x9b16('0x24')](_0x9b16('0x2f'))}},'json':!![]};_0x53a5d9[_0x9b16('0xf')]=_0x24376c;logger[_0x9b16('0x15')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x53a5d9)[_0x9b16('0x11')](function(_0x2fab53){_0x51ceb9[_0x9b16('0x27')]=_0x2fab53['contact']['id'];_0x262b10(_0x51ceb9);})[_0x9b16('0x2c')](function(_0x592c9b){logger[_0x9b16('0x30')]('['+[_0x3ea0de['toUpperCase']()]+']',_0x592c9b['message']);_0xe96586(_0x592c9b['message']);});});}function getTicket(_0x1c131e,_0x11e50f,_0x47c034,_0x31498e,_0x5ae358){return function(_0xae4055){logger[_0x9b16('0x15')](_0x9b16('0x31'));return new Promise(function(_0x452500,_0x2bf95f){var _0x3c3d1a=moment();var _0x20d788={'method':'POST','uri':_0x47c034+_0x9b16('0x32'),'body':{'title':intUtil[_0x9b16('0x33')](_0x31498e['Subjects'],_0x5ae358,'\x20'),'description':intUtil[_0x9b16('0x33')](_0x31498e[_0x9b16('0x34')],_0x5ae358,'\x0a'),'owner_id':_0xae4055[_0x9b16('0x1f')],'creater_id':_0xae4055[_0x9b16('0x17')],'targetable_id':_0xae4055[_0x9b16('0x27')],'targetable_type':_0x9b16('0x35'),'created_at':_0x3c3d1a[_0x9b16('0x24')](_0x9b16('0x2f')),'due_date':_0x3c3d1a[_0x9b16('0x36')](0x1e,'m')[_0x9b16('0x24')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x20d788['headers']=_0x11e50f;return rp(_0x20d788)[_0x9b16('0x11')](function(_0xc28565){_0xae4055[_0x9b16('0x37')]=_0xc28565[_0x9b16('0x38')]['id'];logger['info'](_0x9b16('0x39'),_0xae4055['ticketId']);_0x452500(_0xae4055);})[_0x9b16('0x2c')](function(_0x2c3ccb){logger[_0x9b16('0x30')]('['+[_0x1c131e['toUpperCase']()]+']',_0x2c3ccb[_0x9b16('0x19')]);_0x2bf95f(_0x2c3ccb[_0x9b16('0x19')]);});});};}function emit(_0x46b388,_0x543c68,_0x52cc83){var _0x5e6ed2={'uri':_0x46b388+'/contacts/'+_0x52cc83};io['to'](util['format'](_0x9b16('0x3a'),_0x543c68))[_0x9b16('0x3b')](_0x9b16('0x3c'),_0x5e6ed2);}exports['cs']=function(_0xde6e43,_0x23463b,_0x4a76ef,_0x16978e,_0x4aa7dc,_0x6f4179,_0x45b057,_0x2d6978){var _0x406b24={};var _0x2a7b18={'Authorization':_0x9b16('0x3d')+_0x6f4179[_0x9b16('0x3e')]};_0x6f4179[_0x9b16('0x3f')]=intUtil[_0x9b16('0x40')](_0x6f4179[_0x9b16('0x3f')]);_0x6f4179[_0x9b16('0x41')]=intUtil[_0x9b16('0x40')](_0x6f4179[_0x9b16('0x41')]);var _0x23347f=_0x6f4179['remoteUri'];_0x406b24[_0x9b16('0x1e')]=_0x6f4179[_0x9b16('0x42')];_0x406b24[_0x9b16('0x25')]=_0x2d6978[_0x9b16('0x43')]()===_0x9b16('0x44')?_0x23463b['destcalleridnum']:_0x23463b[_0x9b16('0x45')];_0x406b24['callDirection']=_0x2d6978===_0x9b16('0x46')||_0x2d6978===_0x9b16('0x47')?_0x9b16('0x46'):_0x9b16('0x44');if(_0x16978e){_0x406b24['agentEmail']=_0x16978e['email'];}var _0x217d0d=util[_0x9b16('0x24')](_0x9b16('0x48'),_0x6f4179[_0x9b16('0x41')],_0x23463b['uniqueid'],md5(_0x23463b[_0x9b16('0x49')]));if(_0x4aa7dc&&_0x4aa7dc['monitor_format']){logger[_0x9b16('0x15')]('[QUEUE]','Recording\x20is\x20enabled!');_0x23463b[_0x9b16('0x4a')]=_0x217d0d;}else if(_0x45b057&&_0x45b057[_0x9b16('0x4b')]&&_0x45b057[_0x9b16('0x4b')]!=='none'){logger[_0x9b16('0x15')]('[OUTBOUND]',_0x9b16('0x4c'));_0x23463b[_0x9b16('0x4a')]=_0x217d0d;}else{_0x23463b[_0x9b16('0x4a')]='';}return getAdminId(_0x406b24,_0x2d6978,_0x2a7b18,_0x23347f)['then'](getUser(_0x2d6978,_0x2a7b18,_0x23347f))[_0x9b16('0x11')](getEndUser(_0x2d6978,_0x2a7b18,_0x23347f))[_0x9b16('0x11')](getTicket(_0x2d6978,_0x2a7b18,_0x23347f,_0x4a76ef,_0x23463b))[_0x9b16('0x11')](function(_0x4871f1){logger['info'](util[_0x9b16('0x24')]('The\x20ticket\x20ID\x20is:\x20%s',_0x4871f1['ticketId']));if(_0x2d6978!==_0x9b16('0x47')){logger[_0x9b16('0x15')]('['+[_0x2d6978[_0x9b16('0x20')]()]+']',_0x9b16('0x4d'));emit(_0x23347f,_0x16978e[_0x9b16('0x4e')],_0x4871f1['endUserId']);}})['catch'](function(_0x16ba4e){logger[_0x9b16('0x30')]('['+[_0x2d6978[_0x9b16('0x20')]()]+_0x9b16('0x4f'),util['inspect'](_0x16ba4e,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 0db1959..730c93c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b72=['freshdesk','desk','dynamics365','freshsales','servicenow','exec','data1','toLowerCase','data2','find','Configurations','queue','routeId','outbound','zoho','unknown\x20integration','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','data3','./zendesk','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm'];(function(_0x23584a,_0x7abb50){var _0x5bd540=function(_0xad0452){while(--_0xad0452){_0x23584a['push'](_0x23584a['shift']());}};_0x5bd540(++_0x7abb50);}(_0x3b72,0xd5));var _0x23b7=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3b72[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require(_0x23b7('0x0'));var salesforce=require('./salesforce');var sugarcrm=require(_0x23b7('0x1'));var freshdesk=require(_0x23b7('0x2'));var zoho=require(_0x23b7('0x3'));var desk=require(_0x23b7('0x4'));var vtiger=require(_0x23b7('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0x23b7('0x6'));var freshsales=require(_0x23b7('0x7'));var integrations=[_0x23b7('0x8'),_0x23b7('0x9'),_0x23b7('0xa'),_0x23b7('0xb'),'zoho',_0x23b7('0xc'),'vtiger',_0x23b7('0xd'),_0x23b7('0xe'),_0x23b7('0xf')];exports[_0x23b7('0x10')]=function(_0x183c34,_0x1bc197,_0x80b420,_0x54e9a8,_0x582819,_0x1a4389){if(_0x80b420){if(_['includes'](integrations,_0x183c34[_0x23b7('0x11')][_0x23b7('0x12')]())){try{var _0xba15c5=null;var _0x221a1d='';var _0x1b7ece=_0x80b420[_0x183c34['data1'][_0x23b7('0x12')]()];if(_0x1b7ece){var _0x4dfdf0=_0x1b7ece[_0x183c34[_0x23b7('0x13')]];if(_0x4dfdf0){var _0x2678d1=_[_0x23b7('0x14')](_0x4dfdf0[_0x23b7('0x15')],{'id':parseInt(_0x183c34['data3'],0xa)});if(_0x2678d1){if(_0x54e9a8){if(_0x582819&&_0x1bc197[_0x23b7('0x16')]){_0x221a1d='queue';}else if(_0x1bc197[_0x23b7('0x17')]){_0x221a1d=_0x23b7('0x18');}else{console['log']('EVENT\x20UNKNOWN',_0x1bc197);}}else{_0x221a1d='unmanaged';}switch(_0x183c34['data1'][_0x23b7('0x12')]()){case'zendesk':zendesk[_0x221a1d](_0x183c34,_0x1bc197,_0x2678d1,_0x54e9a8,_0x582819,_0x4dfdf0,_0x1a4389);break;case'salesforce':salesforce[_0x221a1d](_0x183c34,_0x1bc197,_0x2678d1,_0x54e9a8,_0x582819,_0x4dfdf0,_0x1a4389);break;case _0x23b7('0xa'):sugarcrm[_0x221a1d](_0x183c34,_0x1bc197,_0x2678d1,_0x54e9a8,_0x582819,_0x4dfdf0,_0x1a4389);break;case'freshdesk':freshdesk[_0x221a1d](_0x183c34,_0x1bc197,_0x2678d1,_0x54e9a8,_0x582819,_0x4dfdf0,_0x1a4389);break;case _0x23b7('0x19'):zoho[_0x221a1d](_0x183c34,_0x1bc197,_0x2678d1,_0x54e9a8,_0x582819,_0x4dfdf0,_0x1a4389);break;case _0x23b7('0xc'):desk[_0x221a1d](_0x183c34,_0x1bc197,_0x2678d1,_0x54e9a8,_0x582819,_0x4dfdf0,_0x1a4389);break;case'vtiger':vtiger[_0x221a1d](_0x183c34,_0x1bc197,_0x2678d1,_0x54e9a8,_0x582819,_0x4dfdf0,_0x1a4389);break;case _0x23b7('0xe'):freshsales['cs'](_0x183c34,_0x1bc197,_0x2678d1,_0x54e9a8,_0x582819,_0x4dfdf0,_0x1a4389,_0x221a1d);break;case _0x23b7('0xf'):servicenow['cs'](_0x183c34,_0x1bc197,_0x2678d1,_0x54e9a8,_0x582819,_0x4dfdf0,_0x1a4389,_0x221a1d);break;case _0x23b7('0xd'):dynamics365['cs'](_0x183c34,_0x1bc197,_0x2678d1,_0x54e9a8,_0x582819,_0x4dfdf0,_0x1a4389,_0x221a1d);break;default:console['log'](_0x23b7('0x1a'));}}else{_0xba15c5=require(_0x23b7('0x1b'))(_0x183c34[_0x23b7('0x11')][_0x23b7('0x12')]());_0xba15c5[_0x23b7('0x1c')]('[EXEC]',util[_0x23b7('0x1d')](_0x23b7('0x1e'),_0x183c34[_0x23b7('0x11')][_0x23b7('0x12')](),_0x183c34[_0x23b7('0x1f')]));}}else{_0xba15c5=require(_0x23b7('0x1b'))(_0x183c34['data1']['toLowerCase']());_0xba15c5[_0x23b7('0x1c')]('[EXEC]',util['format']('%s\x20account\x20#%s\x20not\x20found',_0x183c34[_0x23b7('0x11')]['toLowerCase'](),_0x183c34[_0x23b7('0x13')]));}}else{}}catch(_0x134d1e){console[_0x23b7('0x1c')](_0x134d1e);}}}};
\ No newline at end of file
+var _0xdede=['data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','desk','dynamics365','unknown\x20integration','../../../../config/logger','format','error','[EXEC]','%s\x20account\x20#%s\x20not\x20found','util','./salesforce','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','vtiger','freshsales','servicenow','includes'];(function(_0xb47e42,_0x172fbb){var _0xcf673a=function(_0x4fb7e6){while(--_0x4fb7e6){_0xb47e42['push'](_0xb47e42['shift']());}};_0xcf673a(++_0x172fbb);}(_0xdede,0xd2));var _0xeded=function(_0x5d9e78,_0x9eb295){_0x5d9e78=_0x5d9e78-0x0;var _0x43f574=_0xdede[_0x5d9e78];return _0x43f574;};'use strict';var _=require('lodash');var util=require(_0xeded('0x0'));var zendesk=require('./zendesk');var salesforce=require(_0xeded('0x1'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xeded('0x2'));var zoho=require(_0xeded('0x3'));var desk=require(_0xeded('0x4'));var vtiger=require(_0xeded('0x5'));var servicenow=require(_0xeded('0x6'));var dynamics365=require(_0xeded('0x7'));var freshsales=require(_0xeded('0x8'));var integrations=[_0xeded('0x9'),_0xeded('0xa'),_0xeded('0xb'),_0xeded('0xc'),_0xeded('0xd'),'desk',_0xeded('0xe'),'dynamics365',_0xeded('0xf'),_0xeded('0x10')];exports['exec']=function(_0x452dad,_0x40653f,_0x47f0f4,_0x24c858,_0xe4fb7d,_0x22708b){if(_0x47f0f4){if(_[_0xeded('0x11')](integrations,_0x452dad[_0xeded('0x12')][_0xeded('0x13')]())){try{var _0x164570=null;var _0x5a0258='';var _0x3f7241=_0x47f0f4[_0x452dad['data1'][_0xeded('0x13')]()];if(_0x3f7241){var _0x1dbe45=_0x3f7241[_0x452dad[_0xeded('0x14')]];if(_0x1dbe45){var _0x5b31f1=_[_0xeded('0x15')](_0x1dbe45[_0xeded('0x16')],{'id':parseInt(_0x452dad[_0xeded('0x17')],0xa)});if(_0x5b31f1){if(_0x24c858){if(_0xe4fb7d&&_0x40653f[_0xeded('0x18')]){_0x5a0258=_0xeded('0x18');}else if(_0x40653f[_0xeded('0x19')]){_0x5a0258=_0xeded('0x1a');}else{console[_0xeded('0x1b')](_0xeded('0x1c'),_0x40653f);}}else{_0x5a0258=_0xeded('0x1d');}switch(_0x452dad['data1'][_0xeded('0x13')]()){case _0xeded('0x9'):zendesk[_0x5a0258](_0x452dad,_0x40653f,_0x5b31f1,_0x24c858,_0xe4fb7d,_0x1dbe45,_0x22708b);break;case _0xeded('0xa'):salesforce[_0x5a0258](_0x452dad,_0x40653f,_0x5b31f1,_0x24c858,_0xe4fb7d,_0x1dbe45,_0x22708b);break;case'sugarcrm':sugarcrm[_0x5a0258](_0x452dad,_0x40653f,_0x5b31f1,_0x24c858,_0xe4fb7d,_0x1dbe45,_0x22708b);break;case'freshdesk':freshdesk[_0x5a0258](_0x452dad,_0x40653f,_0x5b31f1,_0x24c858,_0xe4fb7d,_0x1dbe45,_0x22708b);break;case'zoho':zoho[_0x5a0258](_0x452dad,_0x40653f,_0x5b31f1,_0x24c858,_0xe4fb7d,_0x1dbe45,_0x22708b);break;case _0xeded('0x1e'):desk[_0x5a0258](_0x452dad,_0x40653f,_0x5b31f1,_0x24c858,_0xe4fb7d,_0x1dbe45,_0x22708b);break;case _0xeded('0xe'):vtiger[_0x5a0258](_0x452dad,_0x40653f,_0x5b31f1,_0x24c858,_0xe4fb7d,_0x1dbe45,_0x22708b);break;case'freshsales':freshsales['cs'](_0x452dad,_0x40653f,_0x5b31f1,_0x24c858,_0xe4fb7d,_0x1dbe45,_0x22708b,_0x5a0258);break;case _0xeded('0x10'):servicenow['cs'](_0x452dad,_0x40653f,_0x5b31f1,_0x24c858,_0xe4fb7d,_0x1dbe45,_0x22708b,_0x5a0258);break;case _0xeded('0x1f'):dynamics365['cs'](_0x452dad,_0x40653f,_0x5b31f1,_0x24c858,_0xe4fb7d,_0x1dbe45,_0x22708b,_0x5a0258);break;default:console[_0xeded('0x1b')](_0xeded('0x20'));}}else{_0x164570=require(_0xeded('0x21'))(_0x452dad[_0xeded('0x12')][_0xeded('0x13')]());_0x164570['error']('[EXEC]',util[_0xeded('0x22')]('%s\x20configuration\x20#%s\x20not\x20found',_0x452dad[_0xeded('0x12')]['toLowerCase'](),_0x452dad[_0xeded('0x17')]));}}else{_0x164570=require(_0xeded('0x21'))(_0x452dad[_0xeded('0x12')][_0xeded('0x13')]());_0x164570[_0xeded('0x23')](_0xeded('0x24'),util[_0xeded('0x22')](_0xeded('0x25'),_0x452dad[_0xeded('0x12')][_0xeded('0x13')](),_0x452dad[_0xeded('0x14')]));}}else{}}catch(_0x3db502){console[_0xeded('0x23')](_0x3db502);}}}};
\ No newline at end of file
index 6228ccf..c5c8f89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c4a=['sobject','create','isNil','validateEmail','User','find','then','length','Email','Agent\x20%s\x20found.','resolve','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','Contact','execute','additionalSearchLead','account_contact_lead','additionalSearchAccount','Lead','first','Name','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','<unknown>','format','Caller\x20-\x20%s','Company','No\x20Company','forEach','includes','string','idField','variable','variableName','customVariable','Variable','name','password','concat','Connection','remoteUri','https://login.salesforce.com','clientSecret','login','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','user:%s','instanceUrl','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','newTab','%s/%s/e','error','Salesforce\x20account\x20type\x20not\x20recognized','monitor_format','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','util','./util','redis','defaults','localhost','emit','assign','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','Case','ContactId','leadId'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x2c4a,0xd5));var _0xa2c4=function(_0x106160,_0x56d1e1){_0x106160=_0x106160-0x0;var _0x44a270=_0x2c4a[_0x106160];return _0x44a270;};'use strict';var _=require(_0xa2c4('0x0'));var rp=require(_0xa2c4('0x1'));var moment=require(_0xa2c4('0x2'));var BPromise=require(_0xa2c4('0x3'));var md5=require('md5');var jsforce=require('jsforce');var util=require(_0xa2c4('0x4'));var Redis=require('ioredis');var intUtil=require(_0xa2c4('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('salesforce');config[_0xa2c4('0x6')]=_[_0xa2c4('0x7')](config[_0xa2c4('0x6')],{'host':_0xa2c4('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa2c4('0x6')]));function emit(_0x2e4d32,_0x1e9c09,_0x174819){io['to'](_0x2e4d32)[_0xa2c4('0x9')](_0x1e9c09,_0x174819);}function getTicket(_0x1c4893,_0x1b1755,_0x543921,_0x118fe3,_0x1f8c7e,_0xe561b,_0x270075,_0x58577c){var _0x495abf=Object[_0xa2c4('0xa')]({},{'OwnerId':_0x1b1755['id'],'Subject':intUtil['getString'](_0x118fe3[_0xa2c4('0xb')],_0x1f8c7e,'\x20'),'Description':intUtil['getString'](_0x118fe3[_0xa2c4('0xc')],_0x1f8c7e,'\x0a')},getCustomFields(_0xe561b,_0x1f8c7e));if(_0x543921){if(_0x118fe3[_0xa2c4('0xd')]===_0xa2c4('0xe')){_0x495abf[_0xa2c4('0xf')]=moment[_0xa2c4('0x10')]();_0x495abf[_0xa2c4('0x11')]=![];_0x495abf[_0xa2c4('0x12')]=![];if(_0x543921[_0xa2c4('0x13')]===_0xa2c4('0x14')||_0x543921['endUserType']===_0xa2c4('0x15')){_0x495abf[_0xa2c4('0x16')]=_0x543921['id'];}else if(_0x543921['endUserType']===_0xa2c4('0x17')){_0x495abf['WhatId']=_0x543921['id'];}}else if(_0x118fe3[_0xa2c4('0xd')]===_0xa2c4('0x18')){if(_0x543921[_0xa2c4('0x13')]===_0xa2c4('0x14')){_0x495abf[_0xa2c4('0x19')]=_0x543921['id'];}else if(_0x543921[_0xa2c4('0x13')]==='account'){_0x495abf['AccountId']=_0x543921['id'];}else if(_0x543921[_0xa2c4('0x13')]==='lead'&&_0x118fe3[_0xa2c4('0x1a')]){_0x495abf[_0x118fe3['leadId']]=_0x543921['id'];}else{logger['info']('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x270075[_0xa2c4('0x1b')](_0x118fe3[_0xa2c4('0xd')])[_0xa2c4('0x1c')](_0x495abf);}function getUser(_0x37d8db,_0x540fdc,_0x2fbaa5){if(!_[_0xa2c4('0x1d')](_0x540fdc)&&intUtil[_0xa2c4('0x1e')](_0x540fdc)){var _0x21575d={'Email':_0x540fdc};var _0x36c469={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x2fbaa5['sobject'](_0xa2c4('0x1f'))[_0xa2c4('0x20')](_0x21575d,_0x36c469)['execute']()[_0xa2c4('0x21')](function(_0x18d099){if(_0x18d099[_0xa2c4('0x22')]){var _0x1486a6=_[_0xa2c4('0x20')](_0x18d099,function(_0x229489){return _0x229489[_0xa2c4('0x23')]===_0x540fdc;});if(_0x1486a6){logger['info'](_0xa2c4('0x24'),_0x540fdc);return BPromise[_0xa2c4('0x25')]({'id':_0x1486a6['Id'],'name':_0x1486a6['Name']});}}else{logger[_0xa2c4('0x26')](_0xa2c4('0x27'),_0x540fdc);return _0x2fbaa5[_0xa2c4('0x28')]()[_0xa2c4('0x21')](function(_0xc8bb97){return BPromise[_0xa2c4('0x25')]({'id':_0xc8bb97[_0xa2c4('0x29')],'name':_0xc8bb97[_0xa2c4('0x2a')]});});}});}else{logger[_0xa2c4('0x26')](_0xa2c4('0x27'),_0x540fdc);return _0x2fbaa5[_0xa2c4('0x28')]()[_0xa2c4('0x21')](function(_0xa3c671){return BPromise[_0xa2c4('0x25')]({'id':_0xa3c671[_0xa2c4('0x29')],'name':_0xa3c671[_0xa2c4('0x2a')]});});}}function getEndUser(_0x2e3fca,_0x1a82ae,_0x217b1e,_0x12a33a,_0x39959e){var _0x38598f={'$or':{'Phone':_0x12a33a}};var _0xc19b6c={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xa2c4('0x25')]()['then'](function(){logger[_0xa2c4('0x26')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x12a33a,_0x1a82ae[_0xa2c4('0x2b')]);switch(_0x1a82ae[_0xa2c4('0x2b')]){case'contact_lead':var _0x135ab5=_[_0xa2c4('0x2c')](_0x38598f);if(_0x1a82ae['additionalSearchContact']){var _0x2b6a3e={};_0x2b6a3e[_0x1a82ae[_0xa2c4('0x2d')]]=_0x12a33a;_[_0xa2c4('0x2e')](_0x135ab5[_0xa2c4('0x2f')],_0x2b6a3e);}return _0x39959e[_0xa2c4('0x1b')](_0xa2c4('0x30'))[_0xa2c4('0x20')](_0x135ab5,_0xc19b6c)[_0xa2c4('0x31')]()[_0xa2c4('0x21')](function(_0x52ed1e){if(_0x52ed1e&&_0x52ed1e['length']){return _0x52ed1e;}else{var _0x17b62a=_[_0xa2c4('0x2c')](_0x38598f);if(_0x1a82ae[_0xa2c4('0x32')]){var _0x2713b5={};_0x2713b5[_0x1a82ae['additionalSearchLead']]=_0x12a33a;_[_0xa2c4('0x2e')](_0x17b62a[_0xa2c4('0x2f')],_0x2713b5);}return _0x39959e[_0xa2c4('0x1b')]('Lead')[_0xa2c4('0x20')](_0x17b62a,_0xc19b6c);}});case _0xa2c4('0x33'):var _0x70918e=_[_0xa2c4('0x2c')](_0x38598f);if(_0x1a82ae['additionalSearchAccount']){var _0x2b6a3e={};_0x2b6a3e[_0x1a82ae[_0xa2c4('0x34')]]=_0x12a33a;_[_0xa2c4('0x2e')](_0x70918e[_0xa2c4('0x2f')],_0x2b6a3e);}return _0x39959e[_0xa2c4('0x1b')]('Account')['find'](_0x70918e,_0xc19b6c)[_0xa2c4('0x31')]()[_0xa2c4('0x21')](function(_0xb32536){if(_0xb32536&&_0xb32536['length']){return _0xb32536;}else{var _0x36eb37=_[_0xa2c4('0x2c')](_0x38598f);if(_0x1a82ae[_0xa2c4('0x2d')]){var _0x3a9f68={};_0x3a9f68[_0x1a82ae['additionalSearchContact']]=_0x12a33a;_[_0xa2c4('0x2e')](_0x36eb37[_0xa2c4('0x2f')],_0x3a9f68);}return _0x39959e[_0xa2c4('0x1b')]('Contact')['find'](_0x36eb37,_0xc19b6c)[_0xa2c4('0x21')](function(_0x57ee8b){if(_0x57ee8b&&_0x57ee8b[_0xa2c4('0x22')]){return _0x57ee8b;}else{var _0x19a96f=_[_0xa2c4('0x2c')](_0x38598f);if(_0x1a82ae['additionalSearchLead']){var _0x411bd2={};_0x411bd2[_0x1a82ae[_0xa2c4('0x32')]]=_0x12a33a;_[_0xa2c4('0x2e')](_0x19a96f[_0xa2c4('0x2f')],_0x411bd2);}return _0x39959e[_0xa2c4('0x1b')](_0xa2c4('0x35'))[_0xa2c4('0x20')](_0x19a96f,_0xc19b6c);}});}});case _0xa2c4('0x14'):var _0x135ab5=_[_0xa2c4('0x2c')](_0x38598f);if(_0x1a82ae[_0xa2c4('0x2d')]){var _0x2b6a3e={};_0x2b6a3e[_0x1a82ae['additionalSearchContact']]=_0x12a33a;_[_0xa2c4('0x2e')](_0x135ab5[_0xa2c4('0x2f')],_0x2b6a3e);}return _0x39959e[_0xa2c4('0x1b')]('Contact')[_0xa2c4('0x20')](_0x135ab5,_0xc19b6c)[_0xa2c4('0x31')]();case _0xa2c4('0x15'):var _0x20878f=_[_0xa2c4('0x2c')](_0x38598f);if(_0x1a82ae['additionalSearchLead']){var _0x2b6a3e={};_0x2b6a3e[_0x1a82ae[_0xa2c4('0x32')]]=_0x12a33a;_[_0xa2c4('0x2e')](_0x20878f[_0xa2c4('0x2f')],_0x2b6a3e);}return _0x39959e[_0xa2c4('0x1b')](_0xa2c4('0x35'))[_0xa2c4('0x20')](_0x20878f,_0xc19b6c);case _0xa2c4('0x17'):var _0x70918e=_['cloneDeep'](_0x38598f);if(_0x1a82ae[_0xa2c4('0x34')]){var _0x2b6a3e={};_0x2b6a3e[_0x1a82ae[_0xa2c4('0x34')]]=_0x12a33a;_[_0xa2c4('0x2e')](_0x70918e['$or'],_0x2b6a3e);}return _0x39959e[_0xa2c4('0x1b')]('Account')[_0xa2c4('0x20')](_0x70918e,_0xc19b6c);default:return null;}})[_0xa2c4('0x21')](function(_0x315c5f){if(_0x315c5f&&_0x315c5f['length']){var _0x8edebe=_[_0xa2c4('0x36')](_0x315c5f);if(_0x8edebe){return BPromise[_0xa2c4('0x25')]({'id':_0x8edebe['Id'],'name':_0x8edebe[_0xa2c4('0x37')],'phone':_0x8edebe[_0xa2c4('0x38')],'endUserType':_0x8edebe[_0xa2c4('0x39')][_0xa2c4('0x3a')][_0xa2c4('0x3b')]()});}}})[_0xa2c4('0x21')](function(_0x4aeffc){if(_0x4aeffc){logger[_0xa2c4('0x26')](_0xa2c4('0x3c'),_0x4aeffc[_0xa2c4('0x13')],_0x12a33a);return BPromise[_0xa2c4('0x25')](_0x4aeffc);}else{logger['info'](_0xa2c4('0x3d'),_0x12a33a);var _0x18dd04={'Phone':_0x12a33a};if(_0x1a82ae[_0xa2c4('0x3e')]){if(_0x1a82ae[_0xa2c4('0x3e')]===_0xa2c4('0x14')){logger['info'](_0xa2c4('0x3f'),_0x12a33a,_0x1a82ae['moduleCreate']);_0x18dd04[_0xa2c4('0x40')]=_0x217b1e!==_0xa2c4('0x41')?_0x217b1e:util[_0xa2c4('0x42')]('Caller\x20-\x20%s',_0x12a33a);}else if(_0x1a82ae['moduleCreate']===_0xa2c4('0x15')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x12a33a,_0x1a82ae[_0xa2c4('0x3e')]);_0x18dd04[_0xa2c4('0x40')]=_0x217b1e!=='<unknown>'?_0x217b1e:util[_0xa2c4('0x42')](_0xa2c4('0x43'),_0x12a33a);_0x18dd04[_0xa2c4('0x44')]=_0xa2c4('0x45');}else if(_0x1a82ae['moduleCreate']==='account'){logger[_0xa2c4('0x26')](_0xa2c4('0x3f'),_0x12a33a,_0x1a82ae[_0xa2c4('0x3e')]);_0x18dd04[_0xa2c4('0x37')]=_0x217b1e!==_0xa2c4('0x41')?_0x217b1e:util[_0xa2c4('0x42')](_0xa2c4('0x43'),_0x12a33a);}else{return null;}}return _0x39959e[_0xa2c4('0x1b')](_['upperFirst'](_0x1a82ae[_0xa2c4('0x3e')]))[_0xa2c4('0x1c')](_0x18dd04)[_0xa2c4('0x21')](function(_0x527d71){return BPromise[_0xa2c4('0x25')]({'id':_0x527d71['id'],'endUserType':_0x1a82ae['moduleCreate']});});}});}function getCustomFields(_0x36cb50,_0x5be894){var _0x37ab81={};if(_0x36cb50[_0xa2c4('0x22')]>0x0){_[_0xa2c4('0x46')](_0x36cb50,function(_0x416d76){if(_[_0xa2c4('0x47')]([_0xa2c4('0x48'),'picklist'],_0x416d76['type'])&&_0x416d76[_0xa2c4('0x49')]){_0x37ab81[_0x416d76[_0xa2c4('0x49')]]=_0x416d76['content']['toString']();}else if(_0x416d76[_0xa2c4('0x3a')]===_0xa2c4('0x4a')&&_0x416d76[_0xa2c4('0x4b')]&&_0x416d76[_0xa2c4('0x49')]){_0x5be894[_0x416d76[_0xa2c4('0x4b')]]&&(_0x37ab81[_0x416d76[_0xa2c4('0x49')]]=_0x5be894[_0x416d76[_0xa2c4('0x4b')]]['toString']());}else if(_0x416d76[_0xa2c4('0x3a')]===_0xa2c4('0x4c')&&_0x416d76['Variable']&&_0x416d76[_0xa2c4('0x4d')][_0xa2c4('0x4e')]&&_0x416d76[_0xa2c4('0x49')]){_0x5be894[_0x416d76['Variable'][_0xa2c4('0x4e')][_0xa2c4('0x3b')]()]&&(_0x37ab81[_0x416d76['idField']]=_0x5be894[_0x416d76['Variable'][_0xa2c4('0x4e')][_0xa2c4('0x3b')]()]['toString']());}});}return _0x37ab81;}function getConnection(_0x1c2dcb){var _0x216c98=_0x1c2dcb[_0xa2c4('0x4f')][_0xa2c4('0x50')](_0x1c2dcb['securityToken']);var _0x3e29cd=new jsforce[(_0xa2c4('0x51'))]({'oauth2':{'loginUrl':_0x1c2dcb[_0xa2c4('0x52')]||_0xa2c4('0x53'),'clientId':_0x1c2dcb['clientId'],'clientSecret':_0x1c2dcb[_0xa2c4('0x54')]}});return _0x3e29cd[_0xa2c4('0x55')](_0x1c2dcb['username'],_0x216c98)[_0xa2c4('0x21')](function(){logger[_0xa2c4('0x26')]('Connection\x20established.');return _0x3e29cd;});}exports[_0xa2c4('0x56')]=function(_0x5d1474,_0x5cdd77,_0x3bbe7b,_0x4fa092,_0x4aa114,_0x52d9df){var _0x2403a5,_0x3cf527,_0x183df8,_0x2811cb;_0x52d9df[_0xa2c4('0x57')]=intUtil['stripTrailingSlash'](_0x52d9df[_0xa2c4('0x57')]);_0x52d9df['remoteUri']=intUtil[_0xa2c4('0x58')](_0x52d9df[_0xa2c4('0x52')]);if(_0x4aa114&&_0x4aa114['monitor_format']){logger[_0xa2c4('0x26')](_0xa2c4('0x59'),_0xa2c4('0x5a'));_0x5cdd77[_0xa2c4('0x5b')]=util['format'](_0xa2c4('0x5c'),_0x52d9df['serverUrl'],_0x5cdd77[_0xa2c4('0x5d')],md5(_0x5cdd77[_0xa2c4('0x5d')]));}else{_0x5cdd77[_0xa2c4('0x5b')]='';}return getConnection(_0x52d9df)[_0xa2c4('0x21')](function(_0x487a1f){_0x2811cb=_0x487a1f;return getUser(_0x52d9df,_0x4fa092[_0xa2c4('0x5e')],_0x2811cb);})[_0xa2c4('0x21')](function(_0x1d2d38){_0x2403a5=_0x1d2d38;return getEndUser(_0x52d9df,_0x3bbe7b,_0x5cdd77[_0xa2c4('0x5f')],_0x5cdd77[_0xa2c4('0x60')],_0x2811cb);})[_0xa2c4('0x21')](function(_0x3880a9){_0x3cf527=_0x3880a9;return getTicket(_0x52d9df,_0x2403a5,_0x3cf527,_0x3bbe7b,_0x5cdd77,_0x3bbe7b[_0xa2c4('0x61')],_0x2811cb,_0xa2c4('0x56'));})[_0xa2c4('0x21')](function(_0xb47d7a){_0x183df8=_0xb47d7a;logger[_0xa2c4('0x26')](_0xa2c4('0x62'),_0x183df8['id']);logger[_0xa2c4('0x26')](_0xa2c4('0x63'),_0x183df8['id'],_0x4fa092[_0xa2c4('0x4e')],_0x52d9df[_0xa2c4('0x3a')]);switch(_0x52d9df[_0xa2c4('0x3a')]){case _0xa2c4('0x64'):emit(util[_0xa2c4('0x42')]('user:%s',_0x4fa092[_0xa2c4('0x4e')]),_0xa2c4('0x65'),{'recordId':_0x183df8['id']});break;case'newTab':emit(util[_0xa2c4('0x42')](_0xa2c4('0x66'),_0x4fa092[_0xa2c4('0x4e')]),'trigger:browser:url',{'uri':util[_0xa2c4('0x42')]('%s/%s/e',_0x2811cb[_0xa2c4('0x67')],_0x183df8['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xa2c4('0x68')](function(_0x49605f){logger['error'](_0xa2c4('0x59'),_0x49605f);});};exports[_0xa2c4('0x69')]=function(_0x5207c4,_0x58d676,_0x5e5d9e,_0x286545,_0x15c59c,_0x49c724,_0x56560d){var _0x48f7f7,_0x2a7a7e,_0x2d3c5e,_0x147f00;_0x49c724[_0xa2c4('0x57')]=intUtil[_0xa2c4('0x58')](_0x49c724[_0xa2c4('0x57')]);_0x49c724[_0xa2c4('0x52')]=intUtil[_0xa2c4('0x58')](_0x49c724['remoteUri']);if(_0x56560d&&_0x56560d[_0xa2c4('0x6a')]&&_0x56560d[_0xa2c4('0x6a')]!==_0xa2c4('0x6b')){logger['info'](_0xa2c4('0x6c'),_0xa2c4('0x5a'));_0x58d676['recordingURL']=util['format'](_0xa2c4('0x5c'),_0x49c724[_0xa2c4('0x57')],_0x58d676[_0xa2c4('0x5d')],md5(_0x58d676[_0xa2c4('0x5d')]));}return getConnection(_0x49c724)[_0xa2c4('0x21')](function(_0x146239){_0x147f00=_0x146239;return getUser(_0x49c724,_0x286545['email'],_0x147f00);})[_0xa2c4('0x21')](function(_0x4c095c){_0x48f7f7=_0x4c095c;return getEndUser(_0x49c724,_0x5e5d9e,_0x58d676[_0xa2c4('0x6d')],_0x58d676[_0xa2c4('0x6e')],_0x147f00);})[_0xa2c4('0x21')](function(_0x6ff98b){_0x2a7a7e=_0x6ff98b;return getTicket(_0x49c724,_0x48f7f7,_0x2a7a7e,_0x5e5d9e,_0x58d676,_0x5e5d9e[_0xa2c4('0x61')],_0x147f00,'outbound');})[_0xa2c4('0x21')](function(_0x28c9f4){_0x2d3c5e=_0x28c9f4;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x2d3c5e['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2d3c5e['id'],_0x286545[_0xa2c4('0x4e')],_0x49c724[_0xa2c4('0x3a')]);switch(_0x49c724[_0xa2c4('0x3a')]){case _0xa2c4('0x64'):emit(util['format'](_0xa2c4('0x66'),_0x286545['name']),_0xa2c4('0x65'),{'recordId':_0x2d3c5e['id']});break;case _0xa2c4('0x6f'):emit(util[_0xa2c4('0x42')](_0xa2c4('0x66'),_0x286545[_0xa2c4('0x4e')]),'trigger:browser:url',{'uri':util[_0xa2c4('0x42')](_0xa2c4('0x70'),_0x147f00[_0xa2c4('0x67')],_0x2d3c5e['id'])});break;default:logger[_0xa2c4('0x71')](_0xa2c4('0x6c'),_0xa2c4('0x72'));}})['catch'](function(_0x2e2284){logger[_0xa2c4('0x71')](_0xa2c4('0x6c'),_0x2e2284);});};exports['unmanaged']=function(_0x265813,_0x524319,_0x4d8f8d,_0x99cb10,_0x1570fb,_0x5caaf3){var _0x151929,_0x38dc1f,_0x4f506f,_0xb66d17;_0x5caaf3[_0xa2c4('0x57')]=intUtil['stripTrailingSlash'](_0x5caaf3[_0xa2c4('0x57')]);_0x5caaf3['remoteUri']=intUtil['stripTrailingSlash'](_0x5caaf3['remoteUri']);if(_0x1570fb&&_0x1570fb[_0xa2c4('0x73')]){logger[_0xa2c4('0x26')]('['+_0x524319[_0xa2c4('0x74')][_0xa2c4('0x75')]()+']',_0xa2c4('0x5a'));_0x524319[_0xa2c4('0x5b')]=util[_0xa2c4('0x42')](_0xa2c4('0x5c'),_0x5caaf3[_0xa2c4('0x57')],_0x524319[_0xa2c4('0x5d')],md5(_0x524319[_0xa2c4('0x5d')]));}else{_0x524319['recordingURL']='';}return getConnection(_0x5caaf3)['then'](function(_0x30ecbe){_0xb66d17=_0x30ecbe;if(!_[_0xa2c4('0x1d')](_0x99cb10)){return getUser(_0x5caaf3,_0x99cb10[_0xa2c4('0x4e')],_0xb66d17);}else{return getUser(_0x5caaf3,null,_0xb66d17);}})[_0xa2c4('0x21')](function(_0x372d39){_0x151929=_0x372d39;return getEndUser(_0x5caaf3,_0x4d8f8d,_0x524319[_0xa2c4('0x5f')],_0x524319[_0xa2c4('0x60')],_0xb66d17);})[_0xa2c4('0x21')](function(_0x5d53d1){_0x38dc1f=_0x5d53d1;return getTicket(_0x5caaf3,_0x151929,_0x38dc1f,_0x4d8f8d,_0x524319,_0x4d8f8d['Fields'],_0xb66d17);})[_0xa2c4('0x21')](function(_0x1c11f5){_0x4f506f=_0x1c11f5;logger[_0xa2c4('0x26')]('['+_0x524319[_0xa2c4('0x74')][_0xa2c4('0x75')]()+_0xa2c4('0x76'),_0x4f506f['id']);logger[_0xa2c4('0x26')]('['+_0x524319[_0xa2c4('0x74')][_0xa2c4('0x75')]()+_0xa2c4('0x77'),_0x5caaf3[_0xa2c4('0x3a')]);})[_0xa2c4('0x68')](function(_0x4619e2){logger[_0xa2c4('0x71')]('['+_0x524319[_0xa2c4('0x74')][_0xa2c4('0x75')]()+']',_0x4619e2);});};
\ No newline at end of file
+var _0x721e=['assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil','validateEmail','sobject','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','cloneDeep','additionalSearchContact','merge','Contact','additionalSearchLead','Lead','account_contact_lead','$or','Account','additionalSearchAccount','attributes','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','<unknown>','format','LastName','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','string','type','idField','toString','variable','variableName','customVariable','Variable','name','concat','Connection','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','remoteUri','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','queue','[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','error','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','Fields',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','util','ioredis','../../../../config/logger','salesforce','defaults','redis','localhost','socket.io-emitter','emit'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x721e,0x173));var _0xe721=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x721e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var rp=require(_0xe721('0x0'));var moment=require(_0xe721('0x1'));var BPromise=require(_0xe721('0x2'));var md5=require(_0xe721('0x3'));var jsforce=require('jsforce');var util=require(_0xe721('0x4'));var Redis=require(_0xe721('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xe721('0x6'))(_0xe721('0x7'));config['redis']=_[_0xe721('0x8')](config[_0xe721('0x9')],{'host':_0xe721('0xa'),'port':0x18eb});var io=require(_0xe721('0xb'))(new Redis(config[_0xe721('0x9')]));function emit(_0x32d6b7,_0x3b9f79,_0x55ad0e){io['to'](_0x32d6b7)[_0xe721('0xc')](_0x3b9f79,_0x55ad0e);}function getTicket(_0x331d7e,_0x3cf9e1,_0x344d67,_0x33399a,_0x39d3f1,_0x5966e2,_0x38cdda,_0x39fa0f){var _0x412ab4=Object[_0xe721('0xd')]({},{'OwnerId':_0x3cf9e1['id'],'Subject':intUtil[_0xe721('0xe')](_0x33399a[_0xe721('0xf')],_0x39d3f1,'\x20'),'Description':intUtil[_0xe721('0xe')](_0x33399a[_0xe721('0x10')],_0x39d3f1,'\x0a')},getCustomFields(_0x5966e2,_0x39d3f1));if(_0x344d67){if(_0x33399a[_0xe721('0x11')]===_0xe721('0x12')){_0x412ab4[_0xe721('0x13')]=moment[_0xe721('0x14')]();_0x412ab4[_0xe721('0x15')]=![];_0x412ab4[_0xe721('0x16')]=![];if(_0x344d67[_0xe721('0x17')]===_0xe721('0x18')||_0x344d67['endUserType']===_0xe721('0x19')){_0x412ab4[_0xe721('0x1a')]=_0x344d67['id'];}else if(_0x344d67[_0xe721('0x17')]===_0xe721('0x1b')){_0x412ab4[_0xe721('0x1c')]=_0x344d67['id'];}}else if(_0x33399a['ticketType']===_0xe721('0x1d')){if(_0x344d67['endUserType']===_0xe721('0x18')){_0x412ab4[_0xe721('0x1e')]=_0x344d67['id'];}else if(_0x344d67[_0xe721('0x17')]===_0xe721('0x1b')){_0x412ab4[_0xe721('0x1f')]=_0x344d67['id'];}else if(_0x344d67[_0xe721('0x17')]===_0xe721('0x19')&&_0x33399a['leadId']){_0x412ab4[_0x33399a[_0xe721('0x20')]]=_0x344d67['id'];}else{logger[_0xe721('0x21')](_0xe721('0x22'));}}}return _0x38cdda['sobject'](_0x33399a[_0xe721('0x11')])[_0xe721('0x23')](_0x412ab4);}function getUser(_0x1cec87,_0x3aab62,_0x52107a){if(!_[_0xe721('0x24')](_0x3aab62)&&intUtil[_0xe721('0x25')](_0x3aab62)){var _0x166d38={'Email':_0x3aab62};var _0x483cb1={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x52107a[_0xe721('0x26')](_0xe721('0x27'))[_0xe721('0x28')](_0x166d38,_0x483cb1)[_0xe721('0x29')]()[_0xe721('0x2a')](function(_0x32040f){if(_0x32040f[_0xe721('0x2b')]){var _0x146044=_[_0xe721('0x28')](_0x32040f,function(_0x249c92){return _0x249c92[_0xe721('0x2c')]===_0x3aab62;});if(_0x146044){logger[_0xe721('0x21')](_0xe721('0x2d'),_0x3aab62);return BPromise[_0xe721('0x2e')]({'id':_0x146044['Id'],'name':_0x146044[_0xe721('0x2f')]});}}else{logger[_0xe721('0x21')](_0xe721('0x30'),_0x3aab62);return _0x52107a[_0xe721('0x31')]()['then'](function(_0x204456){return BPromise[_0xe721('0x2e')]({'id':_0x204456[_0xe721('0x32')],'name':_0x204456[_0xe721('0x33')]});});}});}else{logger[_0xe721('0x21')](_0xe721('0x30'),_0x3aab62);return _0x52107a['identity']()[_0xe721('0x2a')](function(_0x43d1ac){return BPromise['resolve']({'id':_0x43d1ac[_0xe721('0x32')],'name':_0x43d1ac[_0xe721('0x33')]});});}}function getEndUser(_0x3278b4,_0x488a09,_0x229633,_0x2c886d,_0x4a6404){var _0x1771bc={'$or':{'Phone':_0x2c886d}};var _0x4c3d5e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xe721('0x2e')]()[_0xe721('0x2a')](function(){logger['info'](_0xe721('0x34'),_0x2c886d,_0x488a09['moduleSearch']);switch(_0x488a09['moduleSearch']){case'contact_lead':var _0x8a6332=_[_0xe721('0x35')](_0x1771bc);if(_0x488a09[_0xe721('0x36')]){var _0x5a4699={};_0x5a4699[_0x488a09[_0xe721('0x36')]]=_0x2c886d;_[_0xe721('0x37')](_0x8a6332['$or'],_0x5a4699);}return _0x4a6404[_0xe721('0x26')](_0xe721('0x38'))['find'](_0x8a6332,_0x4c3d5e)['execute']()[_0xe721('0x2a')](function(_0x3003ef){if(_0x3003ef&&_0x3003ef[_0xe721('0x2b')]){return _0x3003ef;}else{var _0x3b871c=_[_0xe721('0x35')](_0x1771bc);if(_0x488a09[_0xe721('0x39')]){var _0x457ef7={};_0x457ef7[_0x488a09[_0xe721('0x39')]]=_0x2c886d;_[_0xe721('0x37')](_0x3b871c['$or'],_0x457ef7);}return _0x4a6404[_0xe721('0x26')](_0xe721('0x3a'))['find'](_0x3b871c,_0x4c3d5e);}});case _0xe721('0x3b'):var _0x39ea75=_['cloneDeep'](_0x1771bc);if(_0x488a09['additionalSearchAccount']){var _0x5a4699={};_0x5a4699[_0x488a09['additionalSearchAccount']]=_0x2c886d;_[_0xe721('0x37')](_0x39ea75[_0xe721('0x3c')],_0x5a4699);}return _0x4a6404[_0xe721('0x26')](_0xe721('0x3d'))[_0xe721('0x28')](_0x39ea75,_0x4c3d5e)[_0xe721('0x29')]()['then'](function(_0x195478){if(_0x195478&&_0x195478[_0xe721('0x2b')]){return _0x195478;}else{var _0x3bbc80=_[_0xe721('0x35')](_0x1771bc);if(_0x488a09['additionalSearchContact']){var _0x131ee0={};_0x131ee0[_0x488a09[_0xe721('0x36')]]=_0x2c886d;_[_0xe721('0x37')](_0x3bbc80[_0xe721('0x3c')],_0x131ee0);}return _0x4a6404['sobject'](_0xe721('0x38'))['find'](_0x3bbc80,_0x4c3d5e)[_0xe721('0x2a')](function(_0x27d913){if(_0x27d913&&_0x27d913[_0xe721('0x2b')]){return _0x27d913;}else{var _0x243007=_[_0xe721('0x35')](_0x1771bc);if(_0x488a09[_0xe721('0x39')]){var _0x37841e={};_0x37841e[_0x488a09['additionalSearchLead']]=_0x2c886d;_['merge'](_0x243007['$or'],_0x37841e);}return _0x4a6404[_0xe721('0x26')](_0xe721('0x3a'))[_0xe721('0x28')](_0x243007,_0x4c3d5e);}});}});case _0xe721('0x18'):var _0x8a6332=_['cloneDeep'](_0x1771bc);if(_0x488a09['additionalSearchContact']){var _0x5a4699={};_0x5a4699[_0x488a09[_0xe721('0x36')]]=_0x2c886d;_[_0xe721('0x37')](_0x8a6332[_0xe721('0x3c')],_0x5a4699);}return _0x4a6404[_0xe721('0x26')](_0xe721('0x38'))[_0xe721('0x28')](_0x8a6332,_0x4c3d5e)[_0xe721('0x29')]();case _0xe721('0x19'):var _0x40dc44=_[_0xe721('0x35')](_0x1771bc);if(_0x488a09[_0xe721('0x39')]){var _0x5a4699={};_0x5a4699[_0x488a09[_0xe721('0x39')]]=_0x2c886d;_['merge'](_0x40dc44['$or'],_0x5a4699);}return _0x4a6404[_0xe721('0x26')](_0xe721('0x3a'))[_0xe721('0x28')](_0x40dc44,_0x4c3d5e);case _0xe721('0x1b'):var _0x39ea75=_[_0xe721('0x35')](_0x1771bc);if(_0x488a09[_0xe721('0x3e')]){var _0x5a4699={};_0x5a4699[_0x488a09[_0xe721('0x3e')]]=_0x2c886d;_[_0xe721('0x37')](_0x39ea75[_0xe721('0x3c')],_0x5a4699);}return _0x4a6404[_0xe721('0x26')](_0xe721('0x3d'))['find'](_0x39ea75,_0x4c3d5e);default:return null;}})[_0xe721('0x2a')](function(_0x2e6ad1){if(_0x2e6ad1&&_0x2e6ad1[_0xe721('0x2b')]){var _0x357eef=_['first'](_0x2e6ad1);if(_0x357eef){return BPromise[_0xe721('0x2e')]({'id':_0x357eef['Id'],'name':_0x357eef['Name'],'phone':_0x357eef['Phone'],'endUserType':_0x357eef[_0xe721('0x3f')]['type'][_0xe721('0x40')]()});}}})['then'](function(_0x5c0a41){if(_0x5c0a41){logger[_0xe721('0x21')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x5c0a41[_0xe721('0x17')],_0x2c886d);return BPromise['resolve'](_0x5c0a41);}else{logger[_0xe721('0x21')](_0xe721('0x41'),_0x2c886d);var _0x3e2839={'Phone':_0x2c886d};if(_0x488a09['moduleCreate']){if(_0x488a09[_0xe721('0x42')]===_0xe721('0x18')){logger[_0xe721('0x21')](_0xe721('0x43'),_0x2c886d,_0x488a09[_0xe721('0x42')]);_0x3e2839['LastName']=_0x229633!==_0xe721('0x44')?_0x229633:util[_0xe721('0x45')]('Caller\x20-\x20%s',_0x2c886d);}else if(_0x488a09['moduleCreate']===_0xe721('0x19')){logger[_0xe721('0x21')](_0xe721('0x43'),_0x2c886d,_0x488a09[_0xe721('0x42')]);_0x3e2839[_0xe721('0x46')]=_0x229633!=='<unknown>'?_0x229633:util[_0xe721('0x45')](_0xe721('0x47'),_0x2c886d);_0x3e2839[_0xe721('0x48')]=_0xe721('0x49');}else if(_0x488a09['moduleCreate']==='account'){logger[_0xe721('0x21')](_0xe721('0x43'),_0x2c886d,_0x488a09['moduleCreate']);_0x3e2839['Name']=_0x229633!==_0xe721('0x44')?_0x229633:util[_0xe721('0x45')]('Caller\x20-\x20%s',_0x2c886d);}else{return null;}}return _0x4a6404[_0xe721('0x26')](_[_0xe721('0x4a')](_0x488a09[_0xe721('0x42')]))['create'](_0x3e2839)[_0xe721('0x2a')](function(_0x124e0d){return BPromise[_0xe721('0x2e')]({'id':_0x124e0d['id'],'endUserType':_0x488a09[_0xe721('0x42')]});});}});}function getCustomFields(_0x6aa0b7,_0x34cf88){var _0x410cde={};if(_0x6aa0b7[_0xe721('0x2b')]>0x0){_[_0xe721('0x4b')](_0x6aa0b7,function(_0x247c82){if(_['includes']([_0xe721('0x4c'),'picklist'],_0x247c82[_0xe721('0x4d')])&&_0x247c82[_0xe721('0x4e')]){_0x410cde[_0x247c82['idField']]=_0x247c82['content'][_0xe721('0x4f')]();}else if(_0x247c82['type']===_0xe721('0x50')&&_0x247c82['variableName']&&_0x247c82['idField']){_0x34cf88[_0x247c82[_0xe721('0x51')]]&&(_0x410cde[_0x247c82[_0xe721('0x4e')]]=_0x34cf88[_0x247c82[_0xe721('0x51')]][_0xe721('0x4f')]());}else if(_0x247c82[_0xe721('0x4d')]===_0xe721('0x52')&&_0x247c82[_0xe721('0x53')]&&_0x247c82[_0xe721('0x53')]['name']&&_0x247c82['idField']){_0x34cf88[_0x247c82['Variable'][_0xe721('0x54')]['toLowerCase']()]&&(_0x410cde[_0x247c82[_0xe721('0x4e')]]=_0x34cf88[_0x247c82[_0xe721('0x53')][_0xe721('0x54')][_0xe721('0x40')]()][_0xe721('0x4f')]());}});}return _0x410cde;}function getConnection(_0x15f4eb){var _0x92256f=_0x15f4eb['password'][_0xe721('0x55')](_0x15f4eb['securityToken']);var _0x1656b4=new jsforce[(_0xe721('0x56'))]({'oauth2':{'loginUrl':_0x15f4eb['remoteUri']||'https://login.salesforce.com','clientId':_0x15f4eb[_0xe721('0x57')],'clientSecret':_0x15f4eb[_0xe721('0x58')]}});return _0x1656b4[_0xe721('0x59')](_0x15f4eb[_0xe721('0x5a')],_0x92256f)[_0xe721('0x2a')](function(){logger['info'](_0xe721('0x5b'));return _0x1656b4;});}exports['queue']=function(_0xd45ed4,_0xd74e19,_0x3a3523,_0x1669e4,_0xc26529,_0x1eae35){var _0x59f8b0,_0x155f2f,_0x5f0548,_0x1a6236;_0x1eae35[_0xe721('0x5c')]=intUtil[_0xe721('0x5d')](_0x1eae35['serverUrl']);_0x1eae35[_0xe721('0x5e')]=intUtil[_0xe721('0x5d')](_0x1eae35[_0xe721('0x5e')]);if(_0xc26529&&_0xc26529['monitor_format']){logger['info'](_0xe721('0x5f'),_0xe721('0x60'));_0xd74e19[_0xe721('0x61')]=util[_0xe721('0x45')](_0xe721('0x62'),_0x1eae35[_0xe721('0x5c')],_0xd74e19[_0xe721('0x63')],md5(_0xd74e19[_0xe721('0x63')]));}else{_0xd74e19[_0xe721('0x61')]='';}return getConnection(_0x1eae35)['then'](function(_0x12e52e){_0x1a6236=_0x12e52e;return getUser(_0x1eae35,_0x1669e4[_0xe721('0x64')],_0x1a6236);})[_0xe721('0x2a')](function(_0x50cfce){_0x59f8b0=_0x50cfce;return getEndUser(_0x1eae35,_0x3a3523,_0xd74e19[_0xe721('0x65')],_0xd74e19['calleridnum'],_0x1a6236);})[_0xe721('0x2a')](function(_0x16c7ee){_0x155f2f=_0x16c7ee;return getTicket(_0x1eae35,_0x59f8b0,_0x155f2f,_0x3a3523,_0xd74e19,_0x3a3523['Fields'],_0x1a6236,_0xe721('0x66'));})[_0xe721('0x2a')](function(_0x49ca42){_0x5f0548=_0x49ca42;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x5f0548['id']);logger[_0xe721('0x21')](_0xe721('0x67'),_0x5f0548['id'],_0x1669e4[_0xe721('0x54')],_0x1eae35[_0xe721('0x4d')]);switch(_0x1eae35[_0xe721('0x4d')]){case'integrationTab':emit(util[_0xe721('0x45')](_0xe721('0x68'),_0x1669e4[_0xe721('0x54')]),_0xe721('0x69'),{'recordId':_0x5f0548['id']});break;case'newTab':emit(util[_0xe721('0x45')](_0xe721('0x68'),_0x1669e4[_0xe721('0x54')]),_0xe721('0x6a'),{'uri':util[_0xe721('0x45')](_0xe721('0x6b'),_0x1a6236[_0xe721('0x6c')],_0x5f0548['id'])});break;default:logger[_0xe721('0x6d')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0xe721('0x6e')](function(_0x492819){logger[_0xe721('0x6d')](_0xe721('0x5f'),_0x492819);});};exports[_0xe721('0x6f')]=function(_0x388a53,_0x563391,_0x1cba2e,_0x373adb,_0x5f5c42,_0x49018b,_0x707c02){var _0x1f4418,_0x25721a,_0x403491,_0x5589eb;_0x49018b[_0xe721('0x5c')]=intUtil[_0xe721('0x5d')](_0x49018b['serverUrl']);_0x49018b[_0xe721('0x5e')]=intUtil[_0xe721('0x5d')](_0x49018b[_0xe721('0x5e')]);if(_0x707c02&&_0x707c02[_0xe721('0x70')]&&_0x707c02[_0xe721('0x70')]!==_0xe721('0x71')){logger[_0xe721('0x21')](_0xe721('0x72'),_0xe721('0x60'));_0x563391[_0xe721('0x61')]=util['format'](_0xe721('0x62'),_0x49018b['serverUrl'],_0x563391['uniqueid'],md5(_0x563391['uniqueid']));}return getConnection(_0x49018b)['then'](function(_0x3976a1){_0x5589eb=_0x3976a1;return getUser(_0x49018b,_0x373adb[_0xe721('0x64')],_0x5589eb);})['then'](function(_0x50f18b){_0x1f4418=_0x50f18b;return getEndUser(_0x49018b,_0x1cba2e,_0x563391[_0xe721('0x73')],_0x563391[_0xe721('0x74')],_0x5589eb);})[_0xe721('0x2a')](function(_0x5ec70f){_0x25721a=_0x5ec70f;return getTicket(_0x49018b,_0x1f4418,_0x25721a,_0x1cba2e,_0x563391,_0x1cba2e['Fields'],_0x5589eb,_0xe721('0x6f'));})[_0xe721('0x2a')](function(_0xe6c389){_0x403491=_0xe6c389;logger[_0xe721('0x21')](_0xe721('0x75'),_0x403491['id']);logger[_0xe721('0x21')](_0xe721('0x76'),_0x403491['id'],_0x373adb[_0xe721('0x54')],_0x49018b[_0xe721('0x4d')]);switch(_0x49018b['type']){case _0xe721('0x77'):emit(util[_0xe721('0x45')](_0xe721('0x68'),_0x373adb[_0xe721('0x54')]),_0xe721('0x69'),{'recordId':_0x403491['id']});break;case'newTab':emit(util['format'](_0xe721('0x68'),_0x373adb[_0xe721('0x54')]),_0xe721('0x6a'),{'uri':util[_0xe721('0x45')](_0xe721('0x6b'),_0x5589eb[_0xe721('0x6c')],_0x403491['id'])});break;default:logger[_0xe721('0x6d')](_0xe721('0x72'),_0xe721('0x78'));}})['catch'](function(_0x4a29f7){logger[_0xe721('0x6d')](_0xe721('0x72'),_0x4a29f7);});};exports[_0xe721('0x79')]=function(_0x32f22f,_0x1e0197,_0x5b66ff,_0x32e38a,_0x455d92,_0x1dc114){var _0x2166ac,_0x1e7b94,_0x2d3394,_0x4abb48;_0x1dc114['serverUrl']=intUtil['stripTrailingSlash'](_0x1dc114[_0xe721('0x5c')]);_0x1dc114[_0xe721('0x5e')]=intUtil[_0xe721('0x5d')](_0x1dc114[_0xe721('0x5e')]);if(_0x455d92&&_0x455d92[_0xe721('0x7a')]){logger[_0xe721('0x21')]('['+_0x1e0197[_0xe721('0x7b')][_0xe721('0x7c')]()+']',_0xe721('0x60'));_0x1e0197[_0xe721('0x61')]=util[_0xe721('0x45')](_0xe721('0x62'),_0x1dc114[_0xe721('0x5c')],_0x1e0197[_0xe721('0x63')],md5(_0x1e0197['uniqueid']));}else{_0x1e0197[_0xe721('0x61')]='';}return getConnection(_0x1dc114)[_0xe721('0x2a')](function(_0x491c3e){_0x4abb48=_0x491c3e;if(!_[_0xe721('0x24')](_0x32e38a)){return getUser(_0x1dc114,_0x32e38a['name'],_0x4abb48);}else{return getUser(_0x1dc114,null,_0x4abb48);}})[_0xe721('0x2a')](function(_0xc06137){_0x2166ac=_0xc06137;return getEndUser(_0x1dc114,_0x5b66ff,_0x1e0197[_0xe721('0x65')],_0x1e0197[_0xe721('0x7d')],_0x4abb48);})[_0xe721('0x2a')](function(_0x14077b){_0x1e7b94=_0x14077b;return getTicket(_0x1dc114,_0x2166ac,_0x1e7b94,_0x5b66ff,_0x1e0197,_0x5b66ff[_0xe721('0x7e')],_0x4abb48);})[_0xe721('0x2a')](function(_0x221591){_0x2d3394=_0x221591;logger[_0xe721('0x21')]('['+_0x1e0197['lastevent'][_0xe721('0x7c')]()+']\x20Ticket\x20%s\x20created.',_0x2d3394['id']);logger[_0xe721('0x21')]('['+_0x1e0197['lastevent']['toUpperCase']()+_0xe721('0x7f'),_0x1dc114[_0xe721('0x4d')]);})[_0xe721('0x6e')](function(_0x5de1e5){logger['error']('['+_0x1e0197[_0xe721('0x7b')][_0xe721('0x7c')]()+']',_0x5de1e5);});};
\ No newline at end of file
index 92c8d1c..32d58dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ca5=['label_entry','Incident','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','Tags','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','inspect','bluebird','util','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','],\x20getAdminUser\x20crm','error','message','info','toUpperCase','validateEmail','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','length','active','userId','adminEmail','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','POST','sys_user?','user','endUserNumber','true','System','endUserId','],\x20getEndUser\x20crm','forEach','picklist','type','nameField','toLowerCase','content','toString','string','idField','customField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D'];(function(_0x5e52b6,_0x244489){var _0x19930f=function(_0x5b028e){while(--_0x5b028e){_0x5e52b6['push'](_0x5e52b6['shift']());}};_0x19930f(++_0x244489);}(_0x6ca5,0x1ca));var _0x56ca=function(_0x4d6a12,_0x58f2a5){_0x4d6a12=_0x4d6a12-0x0;var _0x4162ee=_0x6ca5[_0x4d6a12];return _0x4162ee;};'use strict';var _=require('lodash');var Promise=require(_0x56ca('0x0'));var rp=require('request-promise');var util=require(_0x56ca('0x1'));var md5=require('md5');var Redis=require(_0x56ca('0x2'));var intUtil=require('./util');var config=require(_0x56ca('0x3'));var logger=require(_0x56ca('0x4'))(_0x56ca('0x5'));config[_0x56ca('0x6')]=_[_0x56ca('0x7')](config[_0x56ca('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x56ca('0x8'))(new Redis(config['redis']));function getAdminUser(_0x5a7733,_0x3931e9,_0x4ea0c6,_0x59af13,_0x136d2e,_0x445c3b){return new Promise(function(_0x151274,_0x4046fa){var _0x35d66f={'method':_0x56ca('0x9'),'uri':_0x59af13+_0x56ca('0xa')+'&'+_0x136d2e+'&'+_0x445c3b,'auth':_0x3931e9,'json':!![]};return rp(_0x35d66f)[_0x56ca('0xb')](function(_0x86c236){if(_0x86c236[_0x56ca('0xc')]['length']>0x0){_0x4ea0c6[_0x56ca('0xd')]=_0x86c236[_0x56ca('0xc')][0x0][_0x56ca('0xe')];}logger['info']('['+[_0x5a7733['toUpperCase']()]+_0x56ca('0xf'),_0x4ea0c6);_0x151274(_0x4ea0c6);})['catch'](function(_0x4bd158){logger[_0x56ca('0x10')]('['+[_0x5a7733['toUpperCase']()]+']',_0x4bd158[_0x56ca('0x11')]);_0x4046fa(_0x4bd158[_0x56ca('0x11')]);});});}function getUser(_0x5a3a66,_0x2657ab,_0x103d86,_0x1ac400,_0x30f6b2){return function(_0x5b1412){logger[_0x56ca('0x12')]('['+[_0x5a3a66[_0x56ca('0x13')]()]+'],\x20getUser\x20input\x20crm',_0x5b1412);return new Promise(function(_0x5c90e7,_0x587e60){if(intUtil[_0x56ca('0x14')](_0x5b1412['userEmail'])){var _0xf11122={'method':'GET','uri':_0x103d86+_0x56ca('0x15')+_0x5b1412[_0x56ca('0x16')]+'&'+_0x1ac400+'&'+_0x30f6b2,'auth':_0x2657ab,'json':!![]};logger[_0x56ca('0x12')]('['+[_0x5a3a66[_0x56ca('0x13')]()]+_0x56ca('0x17'),_0xf11122);return rp(_0xf11122)[_0x56ca('0xb')](function(_0x27abfc){logger[_0x56ca('0x12')]('['+[_0x5a3a66['toUpperCase']()]+'],\x20getUser\x20entity',_0x27abfc);if(_0x27abfc[_0x56ca('0xc')][_0x56ca('0x18')]>0x0&&String(_0x27abfc[_0x56ca('0xc')][0x0][_0x56ca('0x19')])==='true'){_0x5b1412[_0x56ca('0x1a')]=_0x27abfc[_0x56ca('0xc')][0x0][_0x56ca('0xe')];}else{_0x5b1412['userId']=_0x5b1412[_0x56ca('0xd')];_0x5b1412['userEmail']=_0x5b1412[_0x56ca('0x1b')];}logger[_0x56ca('0x12')]('['+[_0x5a3a66[_0x56ca('0x13')]()]+_0x56ca('0x1c'),_0x5b1412);_0x5c90e7(_0x5b1412);})[_0x56ca('0x1d')](function(_0xfccb65){logger[_0x56ca('0x10')]('['+[_0x5a3a66[_0x56ca('0x13')]()]+']',_0xfccb65['message']);_0x587e60(_0xfccb65[_0x56ca('0x11')]);});}else{logger[_0x56ca('0x12')]('['+[_0x5a3a66[_0x56ca('0x13')]()]+_0x56ca('0x1e'));_0x5b1412['userId']=_0x5b1412['adminId'];_0x5b1412[_0x56ca('0x16')]=_0x5b1412[_0x56ca('0x1b')];_0x5c90e7(_0x5b1412);}});};}function createEndUser(_0x347a23,_0x48d8bc,_0x47475f,_0x4be923,_0x4c4519){logger[_0x56ca('0x12')]('['+[_0x347a23['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x47475f);return new Promise(function(_0x260a6b,_0x44f5e9){var _0x3777e2={'method':_0x56ca('0x1f'),'uri':_0x4be923+_0x56ca('0x20')+_0x4c4519,'body':{'user_name':_0x47475f['endUserNumber'],'roles':_0x56ca('0x21'),'first_name':_0x47475f[_0x56ca('0x22')],'active':_0x56ca('0x23'),'date_format':_0x56ca('0x24'),'phone':_0x47475f[_0x56ca('0x22')]},'auth':_0x48d8bc,'json':!![]};return rp(_0x3777e2)['then'](function(_0x2d50a5){logger['info']('['+[_0x347a23[_0x56ca('0x13')]()]+'],\x20EndUser\x20schema',_0x2d50a5[_0x56ca('0xc')]);_0x47475f[_0x56ca('0x25')]=_0x2d50a5[_0x56ca('0xc')][_0x56ca('0xe')];_0x260a6b(_0x47475f);})[_0x56ca('0x1d')](function(_0x4266b4){logger[_0x56ca('0x10')]('['+[_0x347a23[_0x56ca('0x13')]()]+']',_0x4266b4[_0x56ca('0x11')]);_0x44f5e9(_0x4266b4[_0x56ca('0x11')]);});});}function getEndUser(_0x212025,_0x407386,_0x31c733,_0x56b474,_0x36c485){return function(_0x3037bd){logger[_0x56ca('0x12')]('['+[_0x212025[_0x56ca('0x13')]()]+'],\x20getEndUser\x20input\x20crm',_0x3037bd);return new Promise(function(_0x57bc23,_0x56814a){var _0x2712f1={'method':_0x56ca('0x9'),'uri':_0x31c733+'sys_user?sysparm_query=phone%3D'+_0x3037bd[_0x56ca('0x22')]+'&'+_0x56b474+'&'+_0x36c485,'auth':_0x407386,'json':!![]};return rp(_0x2712f1)[_0x56ca('0xb')](function(_0x3b8e23){if(_0x3b8e23[_0x56ca('0xc')][_0x56ca('0x18')]>0x0){_0x3037bd[_0x56ca('0x25')]=_0x3b8e23[_0x56ca('0xc')][0x0][_0x56ca('0xe')];logger[_0x56ca('0x12')]('['+[_0x212025[_0x56ca('0x13')]()]+_0x56ca('0x26'),_0x3037bd);_0x57bc23(_0x3037bd);}else{return createEndUser(_0x212025,_0x407386,_0x3037bd,_0x31c733,_0x56b474)[_0x56ca('0xb')](function(_0x5c8f95){logger[_0x56ca('0x12')]('['+[_0x212025[_0x56ca('0x13')]()]+'],\x20createEndUser\x20crm',_0x5c8f95);_0x57bc23(_0x5c8f95);});}})[_0x56ca('0x1d')](function(_0xaa92c7){logger['error']('['+[_0x212025[_0x56ca('0x13')]()]+']',_0xaa92c7[_0x56ca('0x11')]);_0x56814a(_0xaa92c7['message']);});});};}function getCustomFields(_0x19f8f8,_0x5d88a3){var _0x2b1ada={};if(_0x19f8f8['length']>0x0){_[_0x56ca('0x27')](_0x19f8f8,function(_0x2cdc6d){if(_['includes'](['string',_0x56ca('0x28')],_0x2cdc6d[_0x56ca('0x29')])&&_0x2cdc6d[_0x56ca('0x2a')]&&!_0x2cdc6d['customField']){_0x2b1ada[_0x2cdc6d[_0x56ca('0x2a')][_0x56ca('0x2b')]()]=_0x2cdc6d[_0x56ca('0x2c')][_0x56ca('0x2d')]();}else if(_['includes']([_0x56ca('0x2e'),_0x56ca('0x28')],_0x2cdc6d['type'])&&_0x2cdc6d[_0x56ca('0x2f')]&&_0x2cdc6d[_0x56ca('0x30')]){_0x2b1ada[_0x2cdc6d[_0x56ca('0x2f')][_0x56ca('0x2b')]()]=_0x2cdc6d[_0x56ca('0x2c')][_0x56ca('0x2d')]();}else if(_0x2cdc6d[_0x56ca('0x29')]===_0x56ca('0x31')&&_0x2cdc6d[_0x56ca('0x32')]&&_0x2cdc6d[_0x56ca('0x2f')]&&_0x2cdc6d[_0x56ca('0x30')]){_0x2b1ada[_0x2cdc6d[_0x56ca('0x2f')][_0x56ca('0x2b')]()]=_0x5d88a3[_0x2cdc6d['variableName']]['toString']();}else if(_0x2cdc6d[_0x56ca('0x29')]===_0x56ca('0x33')&&_0x2cdc6d[_0x56ca('0x34')]&&_0x2cdc6d[_0x56ca('0x34')][_0x56ca('0x35')]&&_0x2cdc6d[_0x56ca('0x2f')]&&_0x2cdc6d[_0x56ca('0x30')]){_0x2b1ada[_0x2cdc6d[_0x56ca('0x2f')][_0x56ca('0x2b')]()]=_0x5d88a3[_0x2cdc6d['Variable']['name']['toLowerCase']()][_0x56ca('0x2d')]();}});}return _0x2b1ada;}function getTicket(_0x5d5bbd,_0x465bbb,_0x172b0c,_0x842f97,_0x5297bd,_0x1f7322){return function(_0x5d6838){logger[_0x56ca('0x12')]('['+[_0x5d5bbd[_0x56ca('0x13')]()]+_0x56ca('0x36'),_0x5d6838);return new Promise(function(_0x363c8b,_0x79e0e8){var _0x5c44bc=_0x5d5bbd[_0x56ca('0x2b')]()==='outbound'?_0x5d6838[_0x56ca('0x1a')]:_0x5d6838['endUserId'];var _0x329b40={'method':_0x56ca('0x1f'),'uri':_0x172b0c+_0x56ca('0x37')+'?'+_0x1f7322,'body':Object[_0x56ca('0x38')]({},{'active':_0x56ca('0x23'),'caller_id':_0x5c44bc,'assigned_to':_0x5d6838[_0x56ca('0x1a')],'short_description':intUtil['getString'](_0x842f97[_0x56ca('0x39')],_0x5297bd,'\x20'),'description':intUtil['getString'](_0x842f97[_0x56ca('0x3a')],_0x5297bd,'\x0a')},getCustomFields(_0x842f97[_0x56ca('0x3b')],_0x5297bd)),'auth':_0x465bbb,'json':!![]};return rp(_0x329b40)[_0x56ca('0xb')](function(_0x3aaab2){logger[_0x56ca('0x12')]('['+[_0x5d5bbd[_0x56ca('0x13')]()]+_0x56ca('0x3c'),_0x3aaab2['result']);_0x5d6838[_0x56ca('0x3d')]=_0x3aaab2[_0x56ca('0xc')][_0x56ca('0xe')];_0x5d6838[_0x56ca('0x3e')]=_0x3aaab2[_0x56ca('0xc')][_0x56ca('0x3f')];logger['info']('['+[_0x5d5bbd['toUpperCase']()]+_0x56ca('0x40'),_0x5d6838);_0x363c8b(_0x5d6838);})[_0x56ca('0x1d')](function(_0x2f75fc){logger[_0x56ca('0x10')]('['+[_0x5d5bbd[_0x56ca('0x13')]()]+']',_0x2f75fc[_0x56ca('0x11')]);_0x79e0e8(_0x2f75fc[_0x56ca('0x11')]);});});};}function createRemoteTag(_0x1a72b1,_0x55c1be,_0x9e63aa,_0x265a00){return new Promise(function(_0x52ab73,_0x39cf50){var _0x4ea8dd={'method':_0x56ca('0x1f'),'uri':_0x9e63aa+_0x56ca('0x41')+'?'+_0x265a00,'body':{'short_description':_0x1a72b1,'global':!![],'active':!![],'name':_0x1a72b1},'auth':_0x55c1be,'json':!![]};return rp(_0x4ea8dd)[_0x56ca('0xb')](function(_0x5b9f9d){var _0x36014e=_0x5b9f9d[_0x56ca('0xc')][_0x56ca('0xe')];_0x52ab73(_0x36014e);});});}function getRemoteTag(_0x1184bc,_0x1a8e19,_0x2fb59c,_0x1661f8,_0x36f167){return new Promise(function(_0x2b6a69,_0x1d0105){var _0x12bedd={'method':_0x56ca('0x9'),'uri':_0x2fb59c+_0x56ca('0x41')+_0x56ca('0x42')+_0x1184bc+'&'+_0x1661f8,'auth':_0x1a8e19,'json':!![]};return rp(_0x12bedd)[_0x56ca('0xb')](function(_0x2b6b87){if(_0x2b6b87[_0x56ca('0xc')][_0x56ca('0x18')]>0x0){var _0x404474=_0x2b6b87[_0x56ca('0xc')][0x0][_0x56ca('0xe')];_0x2b6a69(_0x404474);}else{return createRemoteTag(_0x1184bc,_0x1a8e19,_0x2fb59c,_0x1661f8)[_0x56ca('0xb')](function(_0xb450ba){_0x2b6a69(_0xb450ba);});}});});}function assignTagToIncident(_0x551dae,_0x4f7f1f,_0x5a530b,_0x4c46e6,_0x4bc7c4){return new Promise(function(_0x4c4dfa,_0x40c256){var _0x27fc3f={'method':'POST','uri':_0x5a530b+_0x56ca('0x43')+'?'+_0x4bc7c4,'body':{'label':_0x551dae,'table':_0x56ca('0x37'),'id_type':_0x56ca('0x44'),'table_key':_0x4c46e6[_0x56ca('0x3d')],'title':'Incident\x20-\x20'+_0x4c46e6[_0x56ca('0x3e')],'id_display':_0x4c46e6[_0x56ca('0x3e')]},'auth':_0x4f7f1f,'json':!![]};return rp(_0x27fc3f)['then'](function(_0x12a652){_0x4c4dfa();})[_0x56ca('0x1d')](function(){_0x4c4dfa();});});}function manageTags(_0x33dfe7,_0xb9e2cf,_0x33c03c,_0x270267,_0xa7bba0,_0x45251c,_0x5e16fe){return new Promise(function(_0x7ab5ca,_0x319f66){var _0x272212=[];_0xb9e2cf[_0x56ca('0x27')](function(_0x4502a7){_0x272212['push'](getRemoteTag(_0x4502a7,_0x33c03c,_0x270267,_0x45251c,_0x5e16fe));});return Promise[_0x56ca('0x45')](_0x272212)[_0x56ca('0xb')](function(_0x118d8a){if(_0x118d8a['length']){logger[_0x56ca('0x12')]('['+[_0x33dfe7[_0x56ca('0x13')]()]+_0x56ca('0x46'),_0x118d8a);var _0x929c6=[];_0x118d8a[_0x56ca('0x27')](function(_0x13ba32){_0x929c6[_0x56ca('0x47')](assignTagToIncident(_0x13ba32,_0x33c03c,_0x270267,_0xa7bba0,_0x45251c));});return Promise[_0x56ca('0x45')](_0x929c6)[_0x56ca('0xb')](function(){_0x7ab5ca();})[_0x56ca('0x1d')](function(){_0x7ab5ca();});}else{_0x7ab5ca();}});});}function getTags(_0xf74edf,_0x2fd4b3,_0x310e3d,_0x2723f6,_0x2ba257,_0x2b1d1e){return function(_0xb3f9bc){return new Promise(function(_0xf9e7d9,_0xb1c5d1){var _0x583f5b=[];var _0x351cb8=_0x2723f6[_0x56ca('0x48')];if(_0x351cb8&&_0x351cb8[_0x56ca('0x18')]>0x0){_0x583f5b=_[_0x56ca('0x49')](_0x351cb8,_0x56ca('0x35'));}if(_0x583f5b[_0x56ca('0x18')]>0x0){return manageTags(_0xf74edf,_0x583f5b,_0x2fd4b3,_0x310e3d,_0xb3f9bc,_0x2ba257,_0x2b1d1e)[_0x56ca('0xb')](function(){_0xf9e7d9(_0xb3f9bc);});}else{_0xf9e7d9(_0xb3f9bc);}});};}function emit(_0x47fcf7,_0x41b5b5,_0x2da790){var _0x49ffc4='%26sysparm_record_target%3Dincident'+_0x56ca('0x4a')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x56ca('0x4b');var _0x230db0={'uri':_0x47fcf7+_0x56ca('0x4c')+_0x2da790+_0x49ffc4};io['to'](util[_0x56ca('0x4d')](_0x56ca('0x4e'),_0x41b5b5))[_0x56ca('0x4f')](_0x56ca('0x50'),_0x230db0);}exports['cs']=function(_0xa704eb,_0x23aac0,_0x2fdb04,_0x6890df,_0x4de74a,_0xaba1d1,_0x130b1d,_0x552484){var _0x59867f={};var _0x14b3eb={'user':_0xaba1d1[_0x56ca('0x51')],'pass':_0xaba1d1['password']};var _0x40408b='sysparm_limit=1';var _0x420a73='sysparm_display_value=true';_0xaba1d1[_0x56ca('0x52')]=intUtil[_0x56ca('0x53')](_0xaba1d1[_0x56ca('0x52')]);_0xaba1d1[_0x56ca('0x54')]=intUtil[_0x56ca('0x53')](_0xaba1d1[_0x56ca('0x54')]);var _0x17a84e=util[_0x56ca('0x4d')](_0x56ca('0x55'),_0xaba1d1[_0x56ca('0x52')]);_0x59867f[_0x56ca('0x16')]=!_[_0x56ca('0x56')](_0x6890df)?_0x6890df['email']:null;_0x59867f[_0x56ca('0x1b')]=_0xaba1d1[_0x56ca('0x57')];_0x59867f[_0x56ca('0x22')]=_0x552484[_0x56ca('0x2b')]()===_0x56ca('0x58')?_0x23aac0[_0x56ca('0x59')]:_0x23aac0[_0x56ca('0x5a')];_0x59867f[_0x56ca('0x5b')]=_0x552484==='queue'||_0x552484==='unmanaged'?_0x56ca('0x5c'):_0x56ca('0x58');var _0x1e34da=util[_0x56ca('0x4d')](_0x56ca('0x5d'),_0xaba1d1[_0x56ca('0x54')],_0x23aac0[_0x56ca('0x5e')],md5(_0x23aac0['uniqueid']));if(_0x4de74a&&_0x4de74a[_0x56ca('0x5f')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x23aac0[_0x56ca('0x60')]=_0x1e34da;}else if(_0x130b1d&&_0x130b1d[_0x56ca('0x61')]&&_0x130b1d[_0x56ca('0x61')]!==_0x56ca('0x62')){logger[_0x56ca('0x12')](_0x56ca('0x63'),_0x56ca('0x64'));_0x23aac0['recordingURL']=_0x1e34da;}else{_0x23aac0[_0x56ca('0x60')]='';}return getAdminUser(_0x552484,_0x14b3eb,_0x59867f,_0x17a84e,_0x420a73,_0x40408b)[_0x56ca('0xb')](getUser(_0x552484,_0x14b3eb,_0x17a84e,_0x420a73,_0x40408b))[_0x56ca('0xb')](getEndUser(_0x552484,_0x14b3eb,_0x17a84e,_0x420a73,_0x40408b))[_0x56ca('0xb')](getTicket(_0x552484,_0x14b3eb,_0x17a84e,_0x2fdb04,_0x23aac0,_0x420a73))['then'](function(_0x3bd6ac){logger[_0x56ca('0x12')](util['format'](_0x56ca('0x65'),_0x3bd6ac['ticketId']));logger['info'](util['format'](_0x56ca('0x66'),_0x552484));if(_0x552484!==_0x56ca('0x67')){logger[_0x56ca('0x12')]('['+[_0x552484[_0x56ca('0x13')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0xaba1d1[_0x56ca('0x52')],_0x6890df[_0x56ca('0x35')],_0x3bd6ac[_0x56ca('0x3d')]);}})[_0x56ca('0x1d')](function(_0x2c2f9f){logger[_0x56ca('0x10')]('['+[_0x552484[_0x56ca('0x13')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x56ca('0x68')](_0x2c2f9f,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x71ae=['push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','/nav_to.do?uri=incident.do?sys_id%3D','format','trigger:browser:url','username','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','./util','../../../../config/environment','servicenow','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','validateEmail','userEmail','GET','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string','type','nameField','customField','content','toString','picklist','idField','toLowerCase','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20'];(function(_0x3a38f5,_0x59ae64){var _0x23c891=function(_0x2fac02){while(--_0x2fac02){_0x3a38f5['push'](_0x3a38f5['shift']());}};_0x23c891(++_0x59ae64);}(_0x71ae,0x8c));var _0xe71a=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0x71ae[_0x215e65];return _0xa85842;};'use strict';var _=require(_0xe71a('0x0'));var Promise=require(_0xe71a('0x1'));var rp=require(_0xe71a('0x2'));var util=require('util');var md5=require('md5');var Redis=require('ioredis');var intUtil=require(_0xe71a('0x3'));var config=require(_0xe71a('0x4'));var logger=require('../../../../config/logger')(_0xe71a('0x5'));config[_0xe71a('0x6')]=_[_0xe71a('0x7')](config['redis'],{'host':_0xe71a('0x8'),'port':0x18eb});var io=require(_0xe71a('0x9'))(new Redis(config[_0xe71a('0x6')]));function getAdminUser(_0x117397,_0x5db307,_0x47dc8b,_0xa8515e,_0x596f7b,_0x1a64bb){return new Promise(function(_0x3ec51c,_0x51d467){var _0x2a1c0b={'method':'GET','uri':_0xa8515e+_0xe71a('0xa')+'&'+_0x596f7b+'&'+_0x1a64bb,'auth':_0x5db307,'json':!![]};return rp(_0x2a1c0b)[_0xe71a('0xb')](function(_0x11070f){if(_0x11070f[_0xe71a('0xc')][_0xe71a('0xd')]>0x0){_0x47dc8b[_0xe71a('0xe')]=_0x11070f[_0xe71a('0xc')][0x0][_0xe71a('0xf')];}logger[_0xe71a('0x10')]('['+[_0x117397[_0xe71a('0x11')]()]+_0xe71a('0x12'),_0x47dc8b);_0x3ec51c(_0x47dc8b);})[_0xe71a('0x13')](function(_0x2574f0){logger[_0xe71a('0x14')]('['+[_0x117397['toUpperCase']()]+']',_0x2574f0[_0xe71a('0x15')]);_0x51d467(_0x2574f0['message']);});});}function getUser(_0x39cbfc,_0x17d661,_0x6d6c59,_0x42c282,_0x2add5a){return function(_0x2d8f89){logger[_0xe71a('0x10')]('['+[_0x39cbfc[_0xe71a('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x2d8f89);return new Promise(function(_0x50701f,_0x5968b9){if(intUtil[_0xe71a('0x16')](_0x2d8f89[_0xe71a('0x17')])){var _0x2069d6={'method':_0xe71a('0x18'),'uri':_0x6d6c59+'sys_user?sysparm_query=email%3D'+_0x2d8f89['userEmail']+'&'+_0x42c282+'&'+_0x2add5a,'auth':_0x17d661,'json':!![]};logger[_0xe71a('0x10')]('['+[_0x39cbfc[_0xe71a('0x11')]()]+_0xe71a('0x19'),_0x2069d6);return rp(_0x2069d6)['then'](function(_0x3131a8){logger['info']('['+[_0x39cbfc[_0xe71a('0x11')]()]+_0xe71a('0x1a'),_0x3131a8);if(_0x3131a8[_0xe71a('0xc')][_0xe71a('0xd')]>0x0&&String(_0x3131a8['result'][0x0]['active'])===_0xe71a('0x1b')){_0x2d8f89[_0xe71a('0x1c')]=_0x3131a8[_0xe71a('0xc')][0x0][_0xe71a('0xf')];}else{_0x2d8f89[_0xe71a('0x1c')]=_0x2d8f89['adminId'];_0x2d8f89['userEmail']=_0x2d8f89[_0xe71a('0x1d')];}logger[_0xe71a('0x10')]('['+[_0x39cbfc['toUpperCase']()]+_0xe71a('0x1e'),_0x2d8f89);_0x50701f(_0x2d8f89);})[_0xe71a('0x13')](function(_0xcc94ce){logger['error']('['+[_0x39cbfc[_0xe71a('0x11')]()]+']',_0xcc94ce[_0xe71a('0x15')]);_0x5968b9(_0xcc94ce[_0xe71a('0x15')]);});}else{logger[_0xe71a('0x10')]('['+[_0x39cbfc[_0xe71a('0x11')]()]+_0xe71a('0x1f'));_0x2d8f89['userId']=_0x2d8f89['adminId'];_0x2d8f89[_0xe71a('0x17')]=_0x2d8f89[_0xe71a('0x1d')];_0x50701f(_0x2d8f89);}});};}function createEndUser(_0x321d27,_0x2d15c9,_0x51eab8,_0x55508e,_0x36f6be){logger[_0xe71a('0x10')]('['+[_0x321d27[_0xe71a('0x11')]()]+_0xe71a('0x20'),_0x51eab8);return new Promise(function(_0x4421cd,_0x7a4245){var _0x11c012={'method':_0xe71a('0x21'),'uri':_0x55508e+_0xe71a('0x22')+_0x36f6be,'body':{'user_name':_0x51eab8[_0xe71a('0x23')],'roles':_0xe71a('0x24'),'first_name':_0x51eab8[_0xe71a('0x23')],'active':_0xe71a('0x1b'),'date_format':_0xe71a('0x25'),'phone':_0x51eab8[_0xe71a('0x23')]},'auth':_0x2d15c9,'json':!![]};return rp(_0x11c012)[_0xe71a('0xb')](function(_0x1ad52b){logger[_0xe71a('0x10')]('['+[_0x321d27[_0xe71a('0x11')]()]+_0xe71a('0x26'),_0x1ad52b[_0xe71a('0xc')]);_0x51eab8[_0xe71a('0x27')]=_0x1ad52b[_0xe71a('0xc')][_0xe71a('0xf')];_0x4421cd(_0x51eab8);})['catch'](function(_0x3fb22a){logger[_0xe71a('0x14')]('['+[_0x321d27[_0xe71a('0x11')]()]+']',_0x3fb22a[_0xe71a('0x15')]);_0x7a4245(_0x3fb22a[_0xe71a('0x15')]);});});}function getEndUser(_0x259b10,_0x8bec8,_0x558a21,_0x225e8a,_0x27f119){return function(_0x350edd){logger['info']('['+[_0x259b10['toUpperCase']()]+_0xe71a('0x28'),_0x350edd);return new Promise(function(_0xeef885,_0x27e341){var _0x5d4e33={'method':_0xe71a('0x18'),'uri':_0x558a21+_0xe71a('0x29')+_0x350edd['endUserNumber']+'&'+_0x225e8a+'&'+_0x27f119,'auth':_0x8bec8,'json':!![]};return rp(_0x5d4e33)['then'](function(_0x1c56ff){if(_0x1c56ff['result']['length']>0x0){_0x350edd[_0xe71a('0x27')]=_0x1c56ff[_0xe71a('0xc')][0x0][_0xe71a('0xf')];logger[_0xe71a('0x10')]('['+[_0x259b10['toUpperCase']()]+_0xe71a('0x2a'),_0x350edd);_0xeef885(_0x350edd);}else{return createEndUser(_0x259b10,_0x8bec8,_0x350edd,_0x558a21,_0x225e8a)[_0xe71a('0xb')](function(_0x33091d){logger[_0xe71a('0x10')]('['+[_0x259b10[_0xe71a('0x11')]()]+_0xe71a('0x2b'),_0x33091d);_0xeef885(_0x33091d);});}})['catch'](function(_0x5aa17d){logger[_0xe71a('0x14')]('['+[_0x259b10[_0xe71a('0x11')]()]+']',_0x5aa17d['message']);_0x27e341(_0x5aa17d[_0xe71a('0x15')]);});});};}function getCustomFields(_0x2f5cc0,_0x5d5a4f){var _0x5f1c25={};if(_0x2f5cc0[_0xe71a('0xd')]>0x0){_[_0xe71a('0x2c')](_0x2f5cc0,function(_0x1439d3){if(_[_0xe71a('0x2d')]([_0xe71a('0x2e'),'picklist'],_0x1439d3[_0xe71a('0x2f')])&&_0x1439d3[_0xe71a('0x30')]&&!_0x1439d3[_0xe71a('0x31')]){_0x5f1c25[_0x1439d3[_0xe71a('0x30')]['toLowerCase']()]=_0x1439d3[_0xe71a('0x32')][_0xe71a('0x33')]();}else if(_[_0xe71a('0x2d')](['string',_0xe71a('0x34')],_0x1439d3[_0xe71a('0x2f')])&&_0x1439d3[_0xe71a('0x35')]&&_0x1439d3['customField']){_0x5f1c25[_0x1439d3[_0xe71a('0x35')][_0xe71a('0x36')]()]=_0x1439d3['content']['toString']();}else if(_0x1439d3[_0xe71a('0x2f')]==='variable'&&_0x1439d3[_0xe71a('0x37')]&&_0x1439d3[_0xe71a('0x35')]&&_0x1439d3['customField']){_0x5f1c25[_0x1439d3[_0xe71a('0x35')]['toLowerCase']()]=_0x5d5a4f[_0x1439d3['variableName']][_0xe71a('0x33')]();}else if(_0x1439d3[_0xe71a('0x2f')]==='customVariable'&&_0x1439d3[_0xe71a('0x38')]&&_0x1439d3[_0xe71a('0x38')][_0xe71a('0x39')]&&_0x1439d3[_0xe71a('0x35')]&&_0x1439d3[_0xe71a('0x31')]){_0x5f1c25[_0x1439d3[_0xe71a('0x35')][_0xe71a('0x36')]()]=_0x5d5a4f[_0x1439d3[_0xe71a('0x38')][_0xe71a('0x39')][_0xe71a('0x36')]()][_0xe71a('0x33')]();}});}return _0x5f1c25;}function getTicket(_0x562f8a,_0x12762d,_0x3202ac,_0x607e11,_0x4d2176,_0x5cd490){return function(_0x4b53f3){logger[_0xe71a('0x10')]('['+[_0x562f8a[_0xe71a('0x11')]()]+_0xe71a('0x3a'),_0x4b53f3);return new Promise(function(_0x377dcb,_0x5ef804){var _0x2ae739=_0x562f8a['toLowerCase']()===_0xe71a('0x3b')?_0x4b53f3['userId']:_0x4b53f3['endUserId'];var _0x1b19f0={'method':_0xe71a('0x21'),'uri':_0x3202ac+_0xe71a('0x3c')+'?'+_0x5cd490,'body':Object[_0xe71a('0x3d')]({},{'active':'true','caller_id':_0x2ae739,'assigned_to':_0x4b53f3[_0xe71a('0x1c')],'short_description':intUtil[_0xe71a('0x3e')](_0x607e11[_0xe71a('0x3f')],_0x4d2176,'\x20'),'description':intUtil[_0xe71a('0x3e')](_0x607e11['Descriptions'],_0x4d2176,'\x0a')},getCustomFields(_0x607e11['Fields'],_0x4d2176)),'auth':_0x12762d,'json':!![]};return rp(_0x1b19f0)['then'](function(_0x3b6f67){logger[_0xe71a('0x10')]('['+[_0x562f8a[_0xe71a('0x11')]()]+_0xe71a('0x40'),_0x3b6f67[_0xe71a('0xc')]);_0x4b53f3[_0xe71a('0x41')]=_0x3b6f67[_0xe71a('0xc')][_0xe71a('0xf')];_0x4b53f3[_0xe71a('0x42')]=_0x3b6f67['result'][_0xe71a('0x43')];logger[_0xe71a('0x10')]('['+[_0x562f8a[_0xe71a('0x11')]()]+_0xe71a('0x44'),_0x4b53f3);_0x377dcb(_0x4b53f3);})[_0xe71a('0x13')](function(_0x7138d6){logger[_0xe71a('0x14')]('['+[_0x562f8a[_0xe71a('0x11')]()]+']',_0x7138d6[_0xe71a('0x15')]);_0x5ef804(_0x7138d6[_0xe71a('0x15')]);});});};}function createRemoteTag(_0x1ba6f6,_0x52b888,_0x55e8d5,_0x4ade5a){return new Promise(function(_0x48acec,_0x279977){var _0x193084={'method':_0xe71a('0x21'),'uri':_0x55e8d5+_0xe71a('0x45')+'?'+_0x4ade5a,'body':{'short_description':_0x1ba6f6,'global':!![],'active':!![],'name':_0x1ba6f6},'auth':_0x52b888,'json':!![]};return rp(_0x193084)[_0xe71a('0xb')](function(_0x111ba6){var _0x56c76c=_0x111ba6[_0xe71a('0xc')]['sys_id'];_0x48acec(_0x56c76c);});});}function getRemoteTag(_0x10414e,_0x53d9db,_0x3b8567,_0x394896,_0x3b6766){return new Promise(function(_0x1366bf,_0x12fd2c){var _0x31544f={'method':_0xe71a('0x18'),'uri':_0x3b8567+'label'+_0xe71a('0x46')+_0x10414e+'&'+_0x394896,'auth':_0x53d9db,'json':!![]};return rp(_0x31544f)['then'](function(_0x198460){if(_0x198460[_0xe71a('0xc')][_0xe71a('0xd')]>0x0){var _0x3cdecb=_0x198460[_0xe71a('0xc')][0x0][_0xe71a('0xf')];_0x1366bf(_0x3cdecb);}else{return createRemoteTag(_0x10414e,_0x53d9db,_0x3b8567,_0x394896)['then'](function(_0x225503){_0x1366bf(_0x225503);});}});});}function assignTagToIncident(_0x3ec3b9,_0x4a2393,_0x10cd23,_0x7db580,_0x48c82a){return new Promise(function(_0x2779b8,_0x2508e6){var _0x363013={'method':_0xe71a('0x21'),'uri':_0x10cd23+_0xe71a('0x47')+'?'+_0x48c82a,'body':{'label':_0x3ec3b9,'table':'incident','id_type':_0xe71a('0x48'),'table_key':_0x7db580[_0xe71a('0x41')],'title':_0xe71a('0x49')+_0x7db580['ticketNumber'],'id_display':_0x7db580[_0xe71a('0x42')]},'auth':_0x4a2393,'json':!![]};return rp(_0x363013)[_0xe71a('0xb')](function(_0x15a84f){_0x2779b8();})[_0xe71a('0x13')](function(){_0x2779b8();});});}function manageTags(_0x31a793,_0x3d994b,_0x599adc,_0x4df4b2,_0x363428,_0x444251,_0x40c2cc){return new Promise(function(_0x4739bd,_0x4a99f8){var _0x4f9c96=[];_0x3d994b['forEach'](function(_0x251ad4){_0x4f9c96[_0xe71a('0x4a')](getRemoteTag(_0x251ad4,_0x599adc,_0x4df4b2,_0x444251,_0x40c2cc));});return Promise[_0xe71a('0x4b')](_0x4f9c96)[_0xe71a('0xb')](function(_0xe9c51d){if(_0xe9c51d['length']){logger[_0xe71a('0x10')]('['+[_0x31a793['toUpperCase']()]+_0xe71a('0x4c'),_0xe9c51d);var _0x4baa37=[];_0xe9c51d[_0xe71a('0x2c')](function(_0x380b78){_0x4baa37[_0xe71a('0x4a')](assignTagToIncident(_0x380b78,_0x599adc,_0x4df4b2,_0x363428,_0x444251));});return Promise[_0xe71a('0x4b')](_0x4baa37)[_0xe71a('0xb')](function(){_0x4739bd();})[_0xe71a('0x13')](function(){_0x4739bd();});}else{_0x4739bd();}});});}function getTags(_0x148b7e,_0x5b719e,_0x359031,_0x2b040f,_0x3c6303,_0x2a7ca2){return function(_0x3b8d58){return new Promise(function(_0x4b9b64,_0x5e2230){var _0xd643ba=[];var _0x17c960=_0x2b040f[_0xe71a('0x4d')];if(_0x17c960&&_0x17c960[_0xe71a('0xd')]>0x0){_0xd643ba=_[_0xe71a('0x4e')](_0x17c960,_0xe71a('0x39'));}if(_0xd643ba[_0xe71a('0xd')]>0x0){return manageTags(_0x148b7e,_0xd643ba,_0x5b719e,_0x359031,_0x3b8d58,_0x3c6303,_0x2a7ca2)[_0xe71a('0xb')](function(){_0x4b9b64(_0x3b8d58);});}else{_0x4b9b64(_0x3b8d58);}});};}function emit(_0x204a1c,_0x3873d1,_0x5e5b76){var _0xc197bd=_0xe71a('0x4f')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0xe1c17c={'uri':_0x204a1c+_0xe71a('0x50')+_0x5e5b76+_0xc197bd};io['to'](util[_0xe71a('0x51')]('user:%s',_0x3873d1))['emit'](_0xe71a('0x52'),_0xe1c17c);}exports['cs']=function(_0x3524eb,_0x18d01d,_0x589761,_0x23fd2e,_0x2b7354,_0x5820e4,_0x31a7ac,_0x2e327e){var _0x2ce7d9={};var _0x5a7ba4={'user':_0x5820e4[_0xe71a('0x53')],'pass':_0x5820e4['password']};var _0x3b8998=_0xe71a('0x54');var _0x25d423=_0xe71a('0x55');_0x5820e4[_0xe71a('0x56')]=intUtil[_0xe71a('0x57')](_0x5820e4[_0xe71a('0x56')]);_0x5820e4[_0xe71a('0x58')]=intUtil[_0xe71a('0x57')](_0x5820e4['serverUrl']);var _0x32f34f=util['format'](_0xe71a('0x59'),_0x5820e4[_0xe71a('0x56')]);_0x2ce7d9[_0xe71a('0x17')]=!_['isNil'](_0x23fd2e)?_0x23fd2e[_0xe71a('0x5a')]:null;_0x2ce7d9['adminEmail']=_0x5820e4[_0xe71a('0x5a')];_0x2ce7d9[_0xe71a('0x23')]=_0x2e327e[_0xe71a('0x36')]()===_0xe71a('0x3b')?_0x18d01d[_0xe71a('0x5b')]:_0x18d01d[_0xe71a('0x5c')];_0x2ce7d9[_0xe71a('0x5d')]=_0x2e327e===_0xe71a('0x5e')||_0x2e327e===_0xe71a('0x5f')?'queue':_0xe71a('0x3b');var _0x13a68e=util[_0xe71a('0x51')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5820e4[_0xe71a('0x58')],_0x18d01d[_0xe71a('0x60')],md5(_0x18d01d['uniqueid']));if(_0x2b7354&&_0x2b7354['monitor_format']){logger[_0xe71a('0x10')](_0xe71a('0x61'),'Recording\x20is\x20enabled!');_0x18d01d[_0xe71a('0x62')]=_0x13a68e;}else if(_0x31a7ac&&_0x31a7ac['recordingFormat']&&_0x31a7ac[_0xe71a('0x63')]!=='none'){logger[_0xe71a('0x10')](_0xe71a('0x64'),_0xe71a('0x65'));_0x18d01d[_0xe71a('0x62')]=_0x13a68e;}else{_0x18d01d['recordingURL']='';}return getAdminUser(_0x2e327e,_0x5a7ba4,_0x2ce7d9,_0x32f34f,_0x25d423,_0x3b8998)['then'](getUser(_0x2e327e,_0x5a7ba4,_0x32f34f,_0x25d423,_0x3b8998))[_0xe71a('0xb')](getEndUser(_0x2e327e,_0x5a7ba4,_0x32f34f,_0x25d423,_0x3b8998))[_0xe71a('0xb')](getTicket(_0x2e327e,_0x5a7ba4,_0x32f34f,_0x589761,_0x18d01d,_0x25d423))['then'](function(_0x4d5735){logger['info'](util[_0xe71a('0x51')](_0xe71a('0x66'),_0x4d5735['ticketId']));logger[_0xe71a('0x10')](util[_0xe71a('0x51')](_0xe71a('0x67'),_0x2e327e));if(_0x2e327e!==_0xe71a('0x5f')){logger[_0xe71a('0x10')]('['+[_0x2e327e['toUpperCase']()]+']',_0xe71a('0x68'));emit(_0x5820e4[_0xe71a('0x56')],_0x23fd2e[_0xe71a('0x39')],_0x4d5735['ticketId']);}})[_0xe71a('0x13')](function(_0x4e8c89){logger[_0xe71a('0x14')]('['+[_0x2e327e[_0xe71a('0x11')]()]+_0xe71a('0x69'),util[_0xe71a('0x6a')](_0x4e8c89,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index c52a3f2..d1cde25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0574=['PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','%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','error','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Fields','Outbound','version','charAt','[OUTBOUND]','trigger:browser:url','unmanaged','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','Descriptions','toISOString','slice','duration_hours','duration_minutes','parent_id','parent_type','length','push','idField','variableName','JSON','Calls','format','base64','get_server_info','isNil','info','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','Agent\x20found!','resolve','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','stringify','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','type','string','nameField','customField','content','custom_fields','toString','variable','customVariable','Variable','toLowerCase','login','username','password'];(function(_0x34b779,_0x62dad0){var _0x344064=function(_0x172c26){while(--_0x172c26){_0x34b779['push'](_0x34b779['shift']());}};_0x344064(++_0x62dad0);}(_0x0574,0x1a3));var _0x4057=function(_0x221244,_0x206702){_0x221244=_0x221244-0x0;var _0x209ee2=_0x0574[_0x221244];return _0x209ee2;};'use strict';var _=require(_0x4057('0x0'));var rp=require(_0x4057('0x1'));var BPromise=require(_0x4057('0x2'));var md5=require(_0x4057('0x3'));var util=require(_0x4057('0x4'));var Redis=require(_0x4057('0x5'));var intUtil=require(_0x4057('0x6'));var config=require(_0x4057('0x7'));var logger=require(_0x4057('0x8'))(_0x4057('0x9'));config[_0x4057('0xa')]=_[_0x4057('0xb')](config[_0x4057('0xa')],{'host':_0x4057('0xc'),'port':0x18eb});var io=require(_0x4057('0xd'))(new Redis(config[_0x4057('0xa')]));var def={'method':_0x4057('0xe'),'json':!![]};function emit(_0x597618,_0x1d558c,_0x2d58f7){io['to'](_0x597618)[_0x4057('0xf')](_0x1d558c,_0x2d58f7);}function getTicket(_0x3dc439,_0x2a8ce9,_0x4c3e75,_0x25d80d,_0xbff5e2,_0x4c7bfd,_0x219662,_0x1e3660){logger['info'](_0x4057('0x10'));var _0x1d81ab=new Date();var _0x26e136=[{'name':_0x4057('0x11'),'value':intUtil[_0x4057('0x12')](_0x25d80d[_0x4057('0x13')],_0xbff5e2,'\x20')},{'name':_0x4057('0x14'),'value':_0x2a8ce9['id']},{'name':_0x4057('0x15'),'value':_0x2a8ce9['id']},{'name':'description','value':intUtil[_0x4057('0x12')](_0x25d80d[_0x4057('0x16')],_0xbff5e2,'\x0a')},{'name':'date_start','value':_0x1d81ab[_0x4057('0x17')]()[_0x4057('0x18')](0x0,0x13)['replace']('T','\x20')},{'name':_0x4057('0x19'),'value':'0'},{'name':_0x4057('0x1a'),'value':'15'},{'name':_0x4057('0x1b'),'value':_0x4c3e75['id']},{'name':_0x4057('0x1c'),'value':'Contacts'},{'name':'parent_name','value':_0x4c3e75[_0x4057('0x11')]},{'name':'direction','value':_0x1e3660}];if(_0x4c7bfd[_0x4057('0x1d')]){_['forEach'](_0x4c7bfd,function(_0x3b4cb5){if(_0xbff5e2[_0x3b4cb5['variableName']]){_0x26e136[_0x4057('0x1e')]({'name':_0x3b4cb5[_0x4057('0x1f')],'value':_0xbff5e2[_0x3b4cb5[_0x4057('0x20')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x4057('0x21'),'response_type':_0x4057('0x21'),'rest_data':JSON['stringify']({'session':_0x219662['id'],'module_name':_0x4057('0x22'),'name_value_list':_0x26e136})}});}function getAuth(_0xabf1b9){return util[_0x4057('0x23')]('Basic\x20%s',new Buffer(_0xabf1b9['apiKey']+':X')['toString'](_0x4057('0x24')));}function getServerInfo(_0x2b75d4){return request({'form':{'method':_0x4057('0x25'),'input_type':_0x4057('0x21'),'response_type':_0x4057('0x21'),'rest_data':JSON['stringify']({'session':_0x2b75d4['id']})}});}function getUser(_0xd87415,_0x111789,_0x55250f){if(!_[_0x4057('0x26')](_0x111789)){logger[_0x4057('0x27')](_0x4057('0x28'),_0x111789);return request({'form':{'method':_0x4057('0x29'),'input_type':_0x4057('0x21'),'response_type':_0x4057('0x21'),'rest_data':JSON['stringify']({'session':_0x55250f['id'],'module_name':'Employees','query':util[_0x4057('0x23')](_0x4057('0x2a'),_0x111789),'order_by':'','offset':'0','select_fields':['id','name',_0x4057('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4057('0x2c')](function(_0x3d3b6c){if(_0x3d3b6c[_0x4057('0x2d')][_0x4057('0x1d')]){var _0x4a5e58=_[_0x4057('0x2e')](_0x3d3b6c[_0x4057('0x2d')],function(_0x1c9586){return _0x1c9586[_0x4057('0x2f')][_0x4057('0x2b')]['value']===_0x111789;});if(_0x4a5e58){logger[_0x4057('0x27')](_0x4057('0x30'));return BPromise[_0x4057('0x31')]({'id':_0x4a5e58[_0x4057('0x2f')]['id'][_0x4057('0x32')],'name':_0x4a5e58['name_value_list'][_0x4057('0x11')][_0x4057('0x32')]});}}logger[_0x4057('0x27')](_0x4057('0x33'));return BPromise['resolve']({'id':_0x55250f[_0x4057('0x2f')]['user_id'][_0x4057('0x32')],'name':_0x55250f['name_value_list'][_0x4057('0x2b')][_0x4057('0x32')]});});}else{logger[_0x4057('0x27')](_0x4057('0x34'));return BPromise[_0x4057('0x31')]({'id':_0x55250f[_0x4057('0x2f')][_0x4057('0x35')][_0x4057('0x32')],'name':_0x55250f[_0x4057('0x2f')][_0x4057('0x2b')][_0x4057('0x32')]});}}function getEndUser(_0x15f664,_0xe54780,_0x59f0de,_0x3189ea){logger[_0x4057('0x27')]('Searching\x20enduser\x20with\x20phone',_0x59f0de);return request({'form':{'method':_0x4057('0x29'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x4057('0x36')]({'session':_0x3189ea['id'],'module_name':_0x4057('0x37'),'query':util[_0x4057('0x23')](_0x4057('0x38'),_0x59f0de),'order_by':'','offset':'0','select_fields':['id',_0x4057('0x11'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4057('0x2c')](function(_0x56da2b){if(_0x56da2b['entry_list'][_0x4057('0x1d')]){var _0x101e87=_['find'](_0x56da2b[_0x4057('0x2d')],function(_0x317b40){return _0x317b40['name_value_list'][_0x4057('0x39')][_0x4057('0x32')]===_0x59f0de;});if(_0x101e87){logger[_0x4057('0x27')](_0x4057('0x3a'));return BPromise[_0x4057('0x31')]({'id':_0x101e87[_0x4057('0x2f')]['id'][_0x4057('0x32')],'name':_0x101e87[_0x4057('0x2f')][_0x4057('0x11')]['value'],'phone':_0x101e87[_0x4057('0x2f')][_0x4057('0x39')][_0x4057('0x32')]});}}else{logger[_0x4057('0x27')](_0x4057('0x3b'));return request({'form':{'method':_0x4057('0x3c'),'input_type':_0x4057('0x21'),'response_type':_0x4057('0x21'),'rest_data':JSON[_0x4057('0x36')]({'session':_0x3189ea['id'],'module_name':_0x4057('0x37'),'name_value_list':[{'name':_0x4057('0x3d'),'value':_0xe54780!==_0x4057('0x3e')?_0xe54780:util[_0x4057('0x23')](_0x4057('0x3f'),_0x59f0de)},{'name':_0x4057('0x39'),'value':_0x59f0de}]})}})[_0x4057('0x2c')](function(_0x3bd9bc){logger[_0x4057('0x27')](_0x4057('0x40'));return BPromise[_0x4057('0x31')]({'id':_0x3bd9bc['id'],'name':_0x3bd9bc['entry_list'][_0x4057('0x3d')][_0x4057('0x32')],'phone':_0x3bd9bc['entry_list']['phone_home']['value']});});}});}function request(_0x422e5b){logger[_0x4057('0x41')]('[HTTP]',JSON[_0x4057('0x36')](_0x422e5b));return rp(_[_0x4057('0x42')](def,_0x422e5b));}function getTags(_0x18a71c,_0x4cc182){var _0x46698e=[];if(_0x18a71c&&_0x18a71c[_0x4057('0x1d')]>0x0){_0x46698e=_['map'](_0x18a71c,_0x4cc182);}return _0x46698e;}function getCustomFields(_0xb83eba,_0x17b41b){var _0x4f6f49=[];var _0x24e448={'custom_fields':[]};if(_0xb83eba[_0x4057('0x1d')]>0x0){_['forEach'](_0xb83eba,function(_0x2f3956){if(_0x2f3956[_0x4057('0x43')]===_0x4057('0x44')&&_0x2f3956[_0x4057('0x45')]&&!_0x2f3956[_0x4057('0x46')]){_0x24e448[_0x2f3956[_0x4057('0x45')]['toLowerCase']()]=_0x2f3956[_0x4057('0x47')]['toString']();}else if(_0x2f3956[_0x4057('0x43')]===_0x4057('0x44')&&_0x2f3956[_0x4057('0x1f')]&&_0x2f3956[_0x4057('0x46')]){_0x24e448[_0x4057('0x48')][_0x4057('0x1e')]({'id':_0x2f3956[_0x4057('0x1f')],'value':_0x2f3956['content'][_0x4057('0x49')]()});}else if(_0x2f3956[_0x4057('0x43')]===_0x4057('0x4a')&&_0x2f3956[_0x4057('0x20')]&&_0x2f3956[_0x4057('0x1f')]&&_0x2f3956[_0x4057('0x46')]){_0x17b41b[_0x2f3956[_0x4057('0x20')]]&&_0x24e448['custom_fields'][_0x4057('0x1e')]({'id':_0x2f3956[_0x4057('0x1f')],'value':_0x17b41b[_0x2f3956[_0x4057('0x20')]][_0x4057('0x49')]()});}else if(_0x2f3956['type']===_0x4057('0x4b')&&_0x2f3956[_0x4057('0x4c')]&&_0x2f3956['Variable'][_0x4057('0x11')]&&_0x2f3956['idField']&&_0x2f3956[_0x4057('0x46')]){_0x17b41b[_0x2f3956[_0x4057('0x4c')][_0x4057('0x11')][_0x4057('0x4d')]()]&&_0x24e448[_0x4057('0x48')]['push']({'id':_0x2f3956[_0x4057('0x1f')],'value':_0x17b41b[_0x2f3956[_0x4057('0x4c')][_0x4057('0x11')][_0x4057('0x4d')]()][_0x4057('0x49')]()});}});}return _0x24e448;}function getConnection(_0x36fadc){return request({'method':'POST','form':{'method':_0x4057('0x4e'),'input_type':_0x4057('0x21'),'response_type':_0x4057('0x21'),'rest_data':JSON[_0x4057('0x36')]({'user_auth':{'user_name':_0x36fadc[_0x4057('0x4f')],'password':_0x36fadc[_0x4057('0x50')],'encryption':_0x4057('0x51')},'application':_0x4057('0x52')})}})[_0x4057('0x2c')](function(_0x34afa1){var _0x1610f1=_0x34afa1;if(_0x1610f1['id']){def[_0x4057('0x53')]=_0x1610f1['id'];return BPromise['resolve'](_0x1610f1);}else{throw new Error(util[_0x4057('0x23')](_0x4057('0x54'),_0x36fadc['id']));}});}function setRelationship(_0x32534a,_0x57244f,_0x2ed62a,_0x12f7bd){return request({'form':{'method':_0x4057('0x55'),'input_type':_0x4057('0x21'),'response_type':_0x4057('0x21'),'rest_data':JSON[_0x4057('0x36')]({'session':_0x32534a['id'],'module_name':_0x4057('0x22'),'module_id':_0x2ed62a['id'],'link_field_name':_0x12f7bd,'related_ids':[_0x57244f['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x22937e,_0x370a34,_0x7b8b9b,_0x3eceae,_0x45f9d8,_0x587d26){var _0x9e24b,_0x249247,_0x34e5f8,_0x19b975;_0x587d26[_0x4057('0x56')]=intUtil['stripTrailingSlash'](_0x587d26[_0x4057('0x56')]);_0x587d26[_0x4057('0x57')]=intUtil[_0x4057('0x58')](_0x587d26['serverUrl']);def[_0x4057('0x59')]=util[_0x4057('0x23')](_0x4057('0x5a'),_0x587d26['remoteUri']);if(_0x45f9d8&&_0x45f9d8[_0x4057('0x5b')]){logger[_0x4057('0x27')](_0x4057('0x5c'),'Recording\x20is\x20enabled!');_0x370a34[_0x4057('0x5d')]=util['format'](_0x4057('0x5e'),_0x587d26[_0x4057('0x57')],_0x370a34[_0x4057('0x5f')],md5(_0x370a34[_0x4057('0x5f')]));}else{_0x370a34[_0x4057('0x5d')]='';}return getConnection(_0x587d26)[_0x4057('0x2c')](function(_0x4b2b90){_0x19b975=_0x4b2b90;return getUser(_0x587d26,_0x3eceae[_0x4057('0x11')],_0x19b975);})[_0x4057('0x2c')](function(_0x12e0d3){_0x9e24b=_0x12e0d3;logger[_0x4057('0x27')](_0x4057('0x60'),_0x9e24b['id']);return getEndUser(_0x587d26,_0x370a34['calleridname'],_0x370a34[_0x4057('0x61')],_0x19b975);})[_0x4057('0x2c')](function(_0x1ab0b7){_0x249247=_0x1ab0b7;logger[_0x4057('0x27')](_0x4057('0x62'),_0x249247['id']);return getTicket(_0x587d26,_0x9e24b,_0x249247,_0x7b8b9b,_0x370a34,_0x7b8b9b['Fields'],_0x19b975,_0x4057('0x63'));})[_0x4057('0x2c')](function(_0x3206df){_0x34e5f8=_0x3206df;logger[_0x4057('0x27')](_0x4057('0x64'));logger[_0x4057('0x27')](_0x4057('0x65'),_0x34e5f8['id']);return setRelationship(_0x19b975,_0x9e24b,_0x34e5f8,_0x4057('0x66'));})[_0x4057('0x2c')](function(){return setRelationship(_0x19b975,_0x249247,_0x34e5f8,_0x4057('0x67'));})[_0x4057('0x2c')](function(){return getServerInfo(_0x19b975);})[_0x4057('0x2c')](function(_0x1e3bc1){var _0x303783=parseInt(_0x1e3bc1['version']['charAt'](0x0));var _0x4b1007=util['format'](_0x4057('0x68'),_0x587d26[_0x4057('0x56')],_0x34e5f8['id']);if(_0x303783>0x6){_0x4b1007=util[_0x4057('0x23')](_0x4057('0x69'),_0x587d26[_0x4057('0x56')],_0x34e5f8['id']);}logger[_0x4057('0x27')](_0x4057('0x5c'),_0x4057('0x6a'));emit(util[_0x4057('0x23')](_0x4057('0x6b'),_0x3eceae['name']),'trigger:browser:url',{'uri':_0x4b1007});})[_0x4057('0x6c')](function(_0x56fd58){logger[_0x4057('0x6d')](_0x4057('0x5c'),JSON[_0x4057('0x36')](_0x56fd58));});};exports['outbound']=function(_0x1aa032,_0x526f1b,_0x465cf3,_0x3b1c1f,_0x218033,_0x4f8545,_0x35cf01){var _0x4b055c,_0x52c60a,_0x5ac2c4,_0x16a486;_0x4f8545[_0x4057('0x56')]=intUtil[_0x4057('0x58')](_0x4f8545[_0x4057('0x56')]);_0x4f8545['serverUrl']=intUtil[_0x4057('0x58')](_0x4f8545[_0x4057('0x57')]);def['uri']=util['format']('%s/service/v4_1/rest.php',_0x4f8545[_0x4057('0x56')]);if(_0x35cf01&&_0x35cf01[_0x4057('0x6e')]&&_0x35cf01['recordingFormat']!==_0x4057('0x6f')){logger[_0x4057('0x27')]('[OUTBOUND]',_0x4057('0x70'));_0x526f1b[_0x4057('0x5d')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4f8545[_0x4057('0x57')],_0x526f1b['uniqueid'],md5(_0x526f1b[_0x4057('0x5f')]));}return getConnection(_0x4f8545)['then'](function(_0x2f0b7d){_0x16a486=_0x2f0b7d;return getUser(_0x4f8545,_0x3b1c1f['name'],_0x16a486);})[_0x4057('0x2c')](function(_0x43a198){_0x4b055c=_0x43a198;logger[_0x4057('0x27')](_0x4057('0x60'),_0x4b055c['id']);return getEndUser(_0x4f8545,_0x526f1b[_0x4057('0x71')],_0x526f1b[_0x4057('0x72')],_0x16a486);})['then'](function(_0x6a70b7){_0x52c60a=_0x6a70b7;logger[_0x4057('0x27')](_0x4057('0x62'),_0x52c60a['id']);return getTicket(_0x4f8545,_0x4b055c,_0x52c60a,_0x465cf3,_0x526f1b,_0x465cf3[_0x4057('0x73')],_0x16a486,_0x4057('0x74'));})['then'](function(_0x4f3c6d){_0x5ac2c4=_0x4f3c6d;logger[_0x4057('0x27')]('Ticket\x20created!');logger[_0x4057('0x27')](_0x4057('0x65'),_0x5ac2c4['id']);return setRelationship(_0x16a486,_0x4b055c,_0x5ac2c4,'users');})[_0x4057('0x2c')](function(){return setRelationship(_0x16a486,_0x52c60a,_0x5ac2c4,_0x4057('0x67'));})[_0x4057('0x2c')](function(){return getServerInfo(_0x16a486);})[_0x4057('0x2c')](function(_0x51427c){var _0x309df8=parseInt(_0x51427c[_0x4057('0x75')][_0x4057('0x76')](0x0));var _0x272825=util[_0x4057('0x23')](_0x4057('0x68'),_0x4f8545[_0x4057('0x56')],_0x5ac2c4['id']);if(_0x309df8>0x6){_0x272825=util['format'](_0x4057('0x69'),_0x4f8545['remoteUri'],_0x5ac2c4['id']);}logger[_0x4057('0x27')](_0x4057('0x77'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4057('0x23')]('user:%s',_0x3b1c1f[_0x4057('0x11')]),_0x4057('0x78'),{'uri':_0x272825});})['catch'](function(_0x21981e){logger[_0x4057('0x6d')](_0x4057('0x77'),JSON[_0x4057('0x36')](_0x21981e));});};exports[_0x4057('0x79')]=function(_0x136b92,_0x52bf88,_0xd6309,_0x387cf7,_0x25de6d,_0x2b3ca7){var _0xdaf062,_0x39e243,_0x33e258,_0x4ab8d4;_0x2b3ca7[_0x4057('0x56')]=intUtil['stripTrailingSlash'](_0x2b3ca7[_0x4057('0x56')]);_0x2b3ca7[_0x4057('0x57')]=intUtil[_0x4057('0x58')](_0x2b3ca7[_0x4057('0x57')]);def[_0x4057('0x59')]=util[_0x4057('0x23')](_0x4057('0x5a'),_0x2b3ca7[_0x4057('0x56')]);if(_0x25de6d&&_0x25de6d[_0x4057('0x5b')]){logger[_0x4057('0x27')]('['+_0x52bf88['lastevent'][_0x4057('0x7a')]()+']',_0x4057('0x70'));_0x52bf88[_0x4057('0x5d')]=util['format'](_0x4057('0x5e'),_0x2b3ca7[_0x4057('0x57')],_0x52bf88[_0x4057('0x5f')],md5(_0x52bf88[_0x4057('0x5f')]));}else{_0x52bf88[_0x4057('0x5d')]='';}return getConnection(_0x2b3ca7)[_0x4057('0x2c')](function(_0x2b6596){_0x4ab8d4=_0x2b6596;if(!_[_0x4057('0x26')](_0x387cf7)){return getUser(_0x2b3ca7,_0x387cf7[_0x4057('0x11')],_0x4ab8d4);}else{return getUser(_0x2b3ca7,null,_0x4ab8d4);}})['then'](function(_0x23d299){_0xdaf062=_0x23d299;logger['info'](_0x4057('0x60'),_0xdaf062['id']);return getEndUser(_0x2b3ca7,_0x52bf88[_0x4057('0x7b')],_0x52bf88[_0x4057('0x61')],_0x4ab8d4);})['then'](function(_0x4d8d94){_0x39e243=_0x4d8d94;logger[_0x4057('0x27')](_0x4057('0x62'),_0x39e243['id']);return getTicket(_0x2b3ca7,_0xdaf062,_0x39e243,_0xd6309,_0x52bf88,_0xd6309[_0x4057('0x73')],_0x4ab8d4,_0x4057('0x63'));})[_0x4057('0x2c')](function(_0x50c3ee){_0x33e258=_0x50c3ee;logger['info']('Ticket\x20created!');logger[_0x4057('0x27')](_0x4057('0x65'),_0x33e258['id']);return setRelationship(_0x4ab8d4,_0xdaf062,_0x33e258,_0x4057('0x66'));})[_0x4057('0x2c')](function(){return setRelationship(_0x4ab8d4,_0x39e243,_0x33e258,_0x4057('0x67'));})[_0x4057('0x2c')](function(){return getServerInfo(_0x4ab8d4);})[_0x4057('0x6c')](function(_0x29b319){logger[_0x4057('0x6d')]('['+_0x52bf88[_0x4057('0x7c')][_0x4057('0x7a')]()+']',JSON[_0x4057('0x36')](_0x29b319));});};
\ No newline at end of file
+var _0x6444=['PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL','uniqueid','calleridname','calleridnum','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','request-promise','bluebird','md5','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','Descriptions','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','direction','length','push','idField','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','then','find','entry_list','name_value_list','user_name','Agent\x20found!','resolve','value','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','<unknown>','Caller\x20-\x20%s','first_name','[HTTP]','merge','type','string','nameField','customField','content','variable','custom_fields','Variable','toLowerCase','login','username','password'];(function(_0x5d860f,_0x467498){var _0x236490=function(_0x5e045c){while(--_0x5e045c){_0x5d860f['push'](_0x5d860f['shift']());}};_0x236490(++_0x467498);}(_0x6444,0x11a));var _0x4644=function(_0x1e94f7,_0x4e42e9){_0x1e94f7=_0x1e94f7-0x0;var _0x571dfb=_0x6444[_0x1e94f7];return _0x571dfb;};'use strict';var _=require('lodash');var rp=require(_0x4644('0x0'));var BPromise=require(_0x4644('0x1'));var md5=require(_0x4644('0x2'));var util=require('util');var Redis=require(_0x4644('0x3'));var intUtil=require(_0x4644('0x4'));var config=require('../../../../config/environment');var logger=require(_0x4644('0x5'))(_0x4644('0x6'));config[_0x4644('0x7')]=_[_0x4644('0x8')](config['redis'],{'host':_0x4644('0x9'),'port':0x18eb});var io=require(_0x4644('0xa'))(new Redis(config[_0x4644('0x7')]));var def={'method':_0x4644('0xb'),'json':!![]};function emit(_0x3f4ff9,_0x34f892,_0x536eea){io['to'](_0x3f4ff9)['emit'](_0x34f892,_0x536eea);}function getTicket(_0x58754f,_0x17f506,_0x12cbe4,_0x38c25f,_0x26d2c0,_0x329df7,_0x2378e,_0x35148e){logger[_0x4644('0xc')](_0x4644('0xd'));var _0x2aa6b6=new Date();var _0x365c84=[{'name':_0x4644('0xe'),'value':intUtil[_0x4644('0xf')](_0x38c25f[_0x4644('0x10')],_0x26d2c0,'\x20')},{'name':_0x4644('0x11'),'value':_0x17f506['id']},{'name':_0x4644('0x12'),'value':_0x17f506['id']},{'name':'description','value':intUtil[_0x4644('0xf')](_0x38c25f[_0x4644('0x13')],_0x26d2c0,'\x0a')},{'name':'date_start','value':_0x2aa6b6[_0x4644('0x14')]()['slice'](0x0,0x13)[_0x4644('0x15')]('T','\x20')},{'name':_0x4644('0x16'),'value':'0'},{'name':_0x4644('0x17'),'value':'15'},{'name':_0x4644('0x18'),'value':_0x12cbe4['id']},{'name':_0x4644('0x19'),'value':_0x4644('0x1a')},{'name':'parent_name','value':_0x12cbe4[_0x4644('0xe')]},{'name':_0x4644('0x1b'),'value':_0x35148e}];if(_0x329df7[_0x4644('0x1c')]){_['forEach'](_0x329df7,function(_0x1a8bf0){if(_0x26d2c0[_0x1a8bf0['variableName']]){_0x365c84[_0x4644('0x1d')]({'name':_0x1a8bf0[_0x4644('0x1e')],'value':_0x26d2c0[_0x1a8bf0[_0x4644('0x1f')]]});}});}return request({'form':{'method':_0x4644('0x20'),'input_type':'JSON','response_type':_0x4644('0x21'),'rest_data':JSON[_0x4644('0x22')]({'session':_0x2378e['id'],'module_name':_0x4644('0x23'),'name_value_list':_0x365c84})}});}function getAuth(_0x4db7a2){return util[_0x4644('0x24')](_0x4644('0x25'),new Buffer(_0x4db7a2[_0x4644('0x26')]+':X')[_0x4644('0x27')]('base64'));}function getServerInfo(_0x5af5da){return request({'form':{'method':_0x4644('0x28'),'input_type':_0x4644('0x21'),'response_type':_0x4644('0x21'),'rest_data':JSON['stringify']({'session':_0x5af5da['id']})}});}function getUser(_0x3e40dd,_0xb18668,_0x215317){if(!_['isNil'](_0xb18668)){logger['info'](_0x4644('0x29'),_0xb18668);return request({'form':{'method':_0x4644('0x2a'),'input_type':_0x4644('0x21'),'response_type':'JSON','rest_data':JSON[_0x4644('0x22')]({'session':_0x215317['id'],'module_name':_0x4644('0x2b'),'query':util[_0x4644('0x24')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0xb18668),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4644('0x2c')](function(_0x196cd7){if(_0x196cd7['entry_list'][_0x4644('0x1c')]){var _0xf66f0a=_[_0x4644('0x2d')](_0x196cd7[_0x4644('0x2e')],function(_0x4d8654){return _0x4d8654[_0x4644('0x2f')][_0x4644('0x30')]['value']===_0xb18668;});if(_0xf66f0a){logger[_0x4644('0xc')](_0x4644('0x31'));return BPromise[_0x4644('0x32')]({'id':_0xf66f0a['name_value_list']['id'][_0x4644('0x33')],'name':_0xf66f0a[_0x4644('0x2f')][_0x4644('0xe')][_0x4644('0x33')]});}}logger[_0x4644('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x4644('0x32')]({'id':_0x215317[_0x4644('0x2f')][_0x4644('0x34')]['value'],'name':_0x215317[_0x4644('0x2f')][_0x4644('0x30')][_0x4644('0x33')]});});}else{logger[_0x4644('0xc')](_0x4644('0x35'));return BPromise[_0x4644('0x32')]({'id':_0x215317[_0x4644('0x2f')][_0x4644('0x34')]['value'],'name':_0x215317[_0x4644('0x2f')]['user_name']['value']});}}function getEndUser(_0x56799b,_0x371468,_0x27acb4,_0x5661de){logger[_0x4644('0xc')](_0x4644('0x36'),_0x27acb4);return request({'form':{'method':_0x4644('0x2a'),'input_type':_0x4644('0x21'),'response_type':_0x4644('0x21'),'rest_data':JSON['stringify']({'session':_0x5661de['id'],'module_name':_0x4644('0x1a'),'query':util[_0x4644('0x24')](_0x4644('0x37'),_0x27acb4),'order_by':'','offset':'0','select_fields':['id',_0x4644('0xe'),_0x4644('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x555b64){if(_0x555b64['entry_list']['length']){var _0x101ccf=_[_0x4644('0x2d')](_0x555b64[_0x4644('0x2e')],function(_0x127f13){return _0x127f13['name_value_list'][_0x4644('0x38')][_0x4644('0x33')]===_0x27acb4;});if(_0x101ccf){logger['info']('Enduser\x20found!');return BPromise[_0x4644('0x32')]({'id':_0x101ccf[_0x4644('0x2f')]['id'][_0x4644('0x33')],'name':_0x101ccf[_0x4644('0x2f')][_0x4644('0xe')]['value'],'phone':_0x101ccf[_0x4644('0x2f')]['phone_home'][_0x4644('0x33')]});}}else{logger[_0x4644('0xc')](_0x4644('0x39'));return request({'form':{'method':_0x4644('0x20'),'input_type':_0x4644('0x21'),'response_type':'JSON','rest_data':JSON[_0x4644('0x22')]({'session':_0x5661de['id'],'module_name':_0x4644('0x1a'),'name_value_list':[{'name':'first_name','value':_0x371468!==_0x4644('0x3a')?_0x371468:util[_0x4644('0x24')](_0x4644('0x3b'),_0x27acb4)},{'name':'phone_home','value':_0x27acb4}]})}})[_0x4644('0x2c')](function(_0x505957){logger[_0x4644('0xc')]('Enduser\x20created.');return BPromise[_0x4644('0x32')]({'id':_0x505957['id'],'name':_0x505957[_0x4644('0x2e')][_0x4644('0x3c')][_0x4644('0x33')],'phone':_0x505957[_0x4644('0x2e')]['phone_home']['value']});});}});}function request(_0x5942d0){logger['debug'](_0x4644('0x3d'),JSON[_0x4644('0x22')](_0x5942d0));return rp(_[_0x4644('0x3e')](def,_0x5942d0));}function getTags(_0xecd838,_0xc1fb27){var _0x1af7bd=[];if(_0xecd838&&_0xecd838['length']>0x0){_0x1af7bd=_['map'](_0xecd838,_0xc1fb27);}return _0x1af7bd;}function getCustomFields(_0x385c17,_0x155324){var _0x287ef4=[];var _0x735c41={'custom_fields':[]};if(_0x385c17[_0x4644('0x1c')]>0x0){_['forEach'](_0x385c17,function(_0x4c0fe8){if(_0x4c0fe8[_0x4644('0x3f')]===_0x4644('0x40')&&_0x4c0fe8[_0x4644('0x41')]&&!_0x4c0fe8[_0x4644('0x42')]){_0x735c41[_0x4c0fe8[_0x4644('0x41')]['toLowerCase']()]=_0x4c0fe8[_0x4644('0x43')][_0x4644('0x27')]();}else if(_0x4c0fe8[_0x4644('0x3f')]===_0x4644('0x40')&&_0x4c0fe8[_0x4644('0x1e')]&&_0x4c0fe8[_0x4644('0x42')]){_0x735c41['custom_fields']['push']({'id':_0x4c0fe8[_0x4644('0x1e')],'value':_0x4c0fe8[_0x4644('0x43')]['toString']()});}else if(_0x4c0fe8[_0x4644('0x3f')]===_0x4644('0x44')&&_0x4c0fe8[_0x4644('0x1f')]&&_0x4c0fe8[_0x4644('0x1e')]&&_0x4c0fe8[_0x4644('0x42')]){_0x155324[_0x4c0fe8[_0x4644('0x1f')]]&&_0x735c41[_0x4644('0x45')][_0x4644('0x1d')]({'id':_0x4c0fe8[_0x4644('0x1e')],'value':_0x155324[_0x4c0fe8[_0x4644('0x1f')]][_0x4644('0x27')]()});}else if(_0x4c0fe8[_0x4644('0x3f')]==='customVariable'&&_0x4c0fe8['Variable']&&_0x4c0fe8[_0x4644('0x46')][_0x4644('0xe')]&&_0x4c0fe8[_0x4644('0x1e')]&&_0x4c0fe8[_0x4644('0x42')]){_0x155324[_0x4c0fe8['Variable']['name'][_0x4644('0x47')]()]&&_0x735c41[_0x4644('0x45')][_0x4644('0x1d')]({'id':_0x4c0fe8[_0x4644('0x1e')],'value':_0x155324[_0x4c0fe8[_0x4644('0x46')]['name']['toLowerCase']()]['toString']()});}});}return _0x735c41;}function getConnection(_0xe6b7ef){return request({'method':_0x4644('0xb'),'form':{'method':_0x4644('0x48'),'input_type':_0x4644('0x21'),'response_type':_0x4644('0x21'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0xe6b7ef[_0x4644('0x49')],'password':_0xe6b7ef[_0x4644('0x4a')],'encryption':_0x4644('0x4b')},'application':_0x4644('0x4c')})}})[_0x4644('0x2c')](function(_0x49b382){var _0x1edafe=_0x49b382;if(_0x1edafe['id']){def[_0x4644('0x4d')]=_0x1edafe['id'];return BPromise[_0x4644('0x32')](_0x1edafe);}else{throw new Error(util[_0x4644('0x24')](_0x4644('0x4e'),_0xe6b7ef['id']));}});}function setRelationship(_0x5604ff,_0x2578b5,_0x420814,_0x231f9a){return request({'form':{'method':_0x4644('0x4f'),'input_type':_0x4644('0x21'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x5604ff['id'],'module_name':_0x4644('0x23'),'module_id':_0x420814['id'],'link_field_name':_0x231f9a,'related_ids':[_0x2578b5['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x2b9213,_0x248edc,_0x28996a,_0x48d1ef,_0x424272,_0x1aa1ad){var _0x506ac2,_0x2a2154,_0x7c91cb,_0x594973;_0x1aa1ad[_0x4644('0x50')]=intUtil[_0x4644('0x51')](_0x1aa1ad[_0x4644('0x50')]);_0x1aa1ad[_0x4644('0x52')]=intUtil['stripTrailingSlash'](_0x1aa1ad[_0x4644('0x52')]);def[_0x4644('0x53')]=util[_0x4644('0x24')](_0x4644('0x54'),_0x1aa1ad[_0x4644('0x50')]);if(_0x424272&&_0x424272[_0x4644('0x55')]){logger[_0x4644('0xc')](_0x4644('0x56'),'Recording\x20is\x20enabled!');_0x248edc[_0x4644('0x57')]=util[_0x4644('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1aa1ad[_0x4644('0x52')],_0x248edc[_0x4644('0x58')],md5(_0x248edc[_0x4644('0x58')]));}else{_0x248edc[_0x4644('0x57')]='';}return getConnection(_0x1aa1ad)[_0x4644('0x2c')](function(_0x3d2784){_0x594973=_0x3d2784;return getUser(_0x1aa1ad,_0x48d1ef[_0x4644('0xe')],_0x594973);})['then'](function(_0x450e82){_0x506ac2=_0x450e82;logger[_0x4644('0xc')]('The\x20User\x20ID\x20is:',_0x506ac2['id']);return getEndUser(_0x1aa1ad,_0x248edc[_0x4644('0x59')],_0x248edc[_0x4644('0x5a')],_0x594973);})['then'](function(_0x5cdedd){_0x2a2154=_0x5cdedd;logger[_0x4644('0xc')]('The\x20Enduser\x20ID\x20is:',_0x2a2154['id']);return getTicket(_0x1aa1ad,_0x506ac2,_0x2a2154,_0x28996a,_0x248edc,_0x28996a[_0x4644('0x5b')],_0x594973,_0x4644('0x5c'));})['then'](function(_0x4b1ca1){_0x7c91cb=_0x4b1ca1;logger['info'](_0x4644('0x5d'));logger['info'](_0x4644('0x5e'),_0x7c91cb['id']);return setRelationship(_0x594973,_0x506ac2,_0x7c91cb,_0x4644('0x5f'));})[_0x4644('0x2c')](function(){return setRelationship(_0x594973,_0x2a2154,_0x7c91cb,_0x4644('0x60'));})['then'](function(){return getServerInfo(_0x594973);})['then'](function(_0x130528){var _0x5285d6=parseInt(_0x130528['version'][_0x4644('0x61')](0x0));var _0x1b0d9d=util[_0x4644('0x24')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x1aa1ad['remoteUri'],_0x7c91cb['id']);if(_0x5285d6>0x6){_0x1b0d9d=util[_0x4644('0x24')](_0x4644('0x62'),_0x1aa1ad['remoteUri'],_0x7c91cb['id']);}logger['info']('[QUEUE]',_0x4644('0x63'));emit(util['format'](_0x4644('0x64'),_0x48d1ef['name']),_0x4644('0x65'),{'uri':_0x1b0d9d});})[_0x4644('0x66')](function(_0x24ffac){logger[_0x4644('0x67')](_0x4644('0x56'),JSON[_0x4644('0x22')](_0x24ffac));});};exports[_0x4644('0x68')]=function(_0x359d13,_0x38ff8f,_0xc9947c,_0x45f499,_0x5081c9,_0x4d0988,_0xcd1e51){var _0xe2c7a7,_0x10f4aa,_0x5c9c2e,_0x5cc670;_0x4d0988['remoteUri']=intUtil[_0x4644('0x51')](_0x4d0988[_0x4644('0x50')]);_0x4d0988[_0x4644('0x52')]=intUtil[_0x4644('0x51')](_0x4d0988[_0x4644('0x52')]);def[_0x4644('0x53')]=util[_0x4644('0x24')](_0x4644('0x54'),_0x4d0988['remoteUri']);if(_0xcd1e51&&_0xcd1e51[_0x4644('0x69')]&&_0xcd1e51[_0x4644('0x69')]!=='none'){logger['info'](_0x4644('0x6a'),'Recording\x20is\x20enabled!');_0x38ff8f[_0x4644('0x57')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d0988[_0x4644('0x52')],_0x38ff8f[_0x4644('0x58')],md5(_0x38ff8f[_0x4644('0x58')]));}return getConnection(_0x4d0988)[_0x4644('0x2c')](function(_0x530532){_0x5cc670=_0x530532;return getUser(_0x4d0988,_0x45f499[_0x4644('0xe')],_0x5cc670);})[_0x4644('0x2c')](function(_0x3c6c20){_0xe2c7a7=_0x3c6c20;logger[_0x4644('0xc')](_0x4644('0x6b'),_0xe2c7a7['id']);return getEndUser(_0x4d0988,_0x38ff8f[_0x4644('0x6c')],_0x38ff8f[_0x4644('0x6d')],_0x5cc670);})[_0x4644('0x2c')](function(_0x4cf9fc){_0x10f4aa=_0x4cf9fc;logger[_0x4644('0xc')](_0x4644('0x6e'),_0x10f4aa['id']);return getTicket(_0x4d0988,_0xe2c7a7,_0x10f4aa,_0xc9947c,_0x38ff8f,_0xc9947c[_0x4644('0x5b')],_0x5cc670,_0x4644('0x6f'));})['then'](function(_0x3898b0){_0x5c9c2e=_0x3898b0;logger[_0x4644('0xc')](_0x4644('0x5d'));logger[_0x4644('0xc')]('The\x20Ticket\x20ID\x20is:',_0x5c9c2e['id']);return setRelationship(_0x5cc670,_0xe2c7a7,_0x5c9c2e,_0x4644('0x5f'));})[_0x4644('0x2c')](function(){return setRelationship(_0x5cc670,_0x10f4aa,_0x5c9c2e,_0x4644('0x60'));})[_0x4644('0x2c')](function(){return getServerInfo(_0x5cc670);})[_0x4644('0x2c')](function(_0x28a555){var _0x1cbadb=parseInt(_0x28a555[_0x4644('0x70')][_0x4644('0x61')](0x0));var _0x37c051=util['format'](_0x4644('0x71'),_0x4d0988[_0x4644('0x50')],_0x5c9c2e['id']);if(_0x1cbadb>0x6){_0x37c051=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4d0988['remoteUri'],_0x5c9c2e['id']);}logger['info'](_0x4644('0x6a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x4644('0x64'),_0x45f499[_0x4644('0xe')]),_0x4644('0x65'),{'uri':_0x37c051});})['catch'](function(_0x4cb7a6){logger[_0x4644('0x67')]('[OUTBOUND]',JSON[_0x4644('0x22')](_0x4cb7a6));});};exports[_0x4644('0x72')]=function(_0x11302e,_0x21a21c,_0x3fe125,_0x595fe7,_0x28ad82,_0x2c46fe){var _0x39773b,_0x298f25,_0x2671e4,_0x125665;_0x2c46fe[_0x4644('0x50')]=intUtil[_0x4644('0x51')](_0x2c46fe['remoteUri']);_0x2c46fe['serverUrl']=intUtil[_0x4644('0x51')](_0x2c46fe[_0x4644('0x52')]);def[_0x4644('0x53')]=util[_0x4644('0x24')](_0x4644('0x54'),_0x2c46fe[_0x4644('0x50')]);if(_0x28ad82&&_0x28ad82[_0x4644('0x55')]){logger['info']('['+_0x21a21c[_0x4644('0x73')][_0x4644('0x74')]()+']',_0x4644('0x75'));_0x21a21c['recordingURL']=util[_0x4644('0x24')](_0x4644('0x76'),_0x2c46fe[_0x4644('0x52')],_0x21a21c['uniqueid'],md5(_0x21a21c[_0x4644('0x58')]));}else{_0x21a21c[_0x4644('0x57')]='';}return getConnection(_0x2c46fe)[_0x4644('0x2c')](function(_0x18701c){_0x125665=_0x18701c;if(!_['isNil'](_0x595fe7)){return getUser(_0x2c46fe,_0x595fe7[_0x4644('0xe')],_0x125665);}else{return getUser(_0x2c46fe,null,_0x125665);}})[_0x4644('0x2c')](function(_0x3f8be0){_0x39773b=_0x3f8be0;logger['info'](_0x4644('0x6b'),_0x39773b['id']);return getEndUser(_0x2c46fe,_0x21a21c[_0x4644('0x59')],_0x21a21c[_0x4644('0x5a')],_0x125665);})['then'](function(_0x1c9be5){_0x298f25=_0x1c9be5;logger[_0x4644('0xc')]('The\x20Enduser\x20ID\x20is:',_0x298f25['id']);return getTicket(_0x2c46fe,_0x39773b,_0x298f25,_0x3fe125,_0x21a21c,_0x3fe125[_0x4644('0x5b')],_0x125665,_0x4644('0x5c'));})[_0x4644('0x2c')](function(_0x1b43be){_0x2671e4=_0x1b43be;logger[_0x4644('0xc')](_0x4644('0x5d'));logger[_0x4644('0xc')](_0x4644('0x5e'),_0x2671e4['id']);return setRelationship(_0x125665,_0x39773b,_0x2671e4,_0x4644('0x5f'));})[_0x4644('0x2c')](function(){return setRelationship(_0x125665,_0x298f25,_0x2671e4,_0x4644('0x60'));})['then'](function(){return getServerInfo(_0x125665);})[_0x4644('0x66')](function(_0x316fbb){logger[_0x4644('0x67')]('['+_0x21a21c[_0x4644('0x73')][_0x4644('0x74')]()+']',JSON[_0x4644('0x22')](_0x316fbb));});};
\ No newline at end of file
index ed6c285..6d437f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4cf=['%s:\x20%s','key','keyContent','variable','format','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','test','lodash','util','length','string','content','type','variableName','push','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType'];(function(_0x18de6c,_0x4cb805){var _0x54b14d=function(_0xc9b32b){while(--_0xc9b32b){_0x18de6c['push'](_0x18de6c['shift']());}};_0x54b14d(++_0x4cb805);}(_0xa4cf,0x150));var _0xfa4c=function(_0x513070,_0x423fad){_0x513070=_0x513070-0x0;var _0x3b2b48=_0xa4cf[_0x513070];return _0x3b2b48;};'use strict';var _=require(_0xfa4c('0x0'));var util=require(_0xfa4c('0x1'));exports['getString']=function(_0x4e1e92,_0x31eb7a,_0x1bed8f){var _0x56be14=[];if(_0x4e1e92[_0xfa4c('0x2')]>0x0){var _0x33b3d3=_['sortBy'](_0x4e1e92,['id']);for(var _0x588054=0x0;_0x588054<_0x33b3d3[_0xfa4c('0x2')];_0x588054++){var _0x20e6ba=_0x33b3d3[_0x588054];if(_0x20e6ba['type']===_0xfa4c('0x3')){_0x56be14['push'](_0x20e6ba[_0xfa4c('0x4')]);}else if(_0x20e6ba[_0xfa4c('0x5')]==='variable'&&_0x20e6ba[_0xfa4c('0x6')]){_0x31eb7a[_0x20e6ba[_0xfa4c('0x6')]]&&_0x56be14[_0xfa4c('0x7')](_0x31eb7a[_0x20e6ba['variableName']][_0xfa4c('0x8')]());}else if(_0x20e6ba[_0xfa4c('0x5')]===_0xfa4c('0x9')&&_0x20e6ba[_0xfa4c('0xa')]&&_0x20e6ba['Variable'][_0xfa4c('0xb')]){_0x31eb7a[_0x20e6ba[_0xfa4c('0xa')]['name']['toLowerCase']()]&&_0x56be14[_0xfa4c('0x7')](_0x31eb7a[_0x20e6ba[_0xfa4c('0xa')][_0xfa4c('0xb')][_0xfa4c('0xc')]()]['toString']());}else if(_0x20e6ba[_0xfa4c('0x5')]===_0xfa4c('0xd')){if(_0x20e6ba[_0xfa4c('0xe')]===_0xfa4c('0x3')&&_0x20e6ba['key']){_0x56be14[_0xfa4c('0x7')](util['format'](_0xfa4c('0xf'),_0x20e6ba[_0xfa4c('0x10')],_0x20e6ba[_0xfa4c('0x11')]));}else if(_0x20e6ba[_0xfa4c('0xe')]===_0xfa4c('0x12')&&_0x20e6ba[_0xfa4c('0x6')]&&_0x20e6ba[_0xfa4c('0x10')]){_0x31eb7a[_0x20e6ba['variableName']]&&_0x56be14[_0xfa4c('0x7')](util['format'](_0xfa4c('0xf'),_0x20e6ba[_0xfa4c('0x10')],_0x31eb7a[_0x20e6ba[_0xfa4c('0x6')]]));}else if(_0x20e6ba[_0xfa4c('0xe')]===_0xfa4c('0x9')&&_0x20e6ba[_0xfa4c('0xa')]&&_0x20e6ba[_0xfa4c('0xa')][_0xfa4c('0xb')]&&_0x20e6ba[_0xfa4c('0x10')]){_0x31eb7a[_0x20e6ba[_0xfa4c('0xa')]['name'][_0xfa4c('0xc')]()]&&_0x56be14[_0xfa4c('0x7')](util[_0xfa4c('0x13')]('%s:\x20%s',_0x20e6ba[_0xfa4c('0x10')],_0x31eb7a[_0x20e6ba[_0xfa4c('0xa')][_0xfa4c('0xb')][_0xfa4c('0xc')]()]));}}}}return _0x56be14[_0xfa4c('0x14')](_0x1bed8f);};exports[_0xfa4c('0x15')]=function(_0x1667cc){var _0x297428=_0x1667cc[_0xfa4c('0x16')](-0x1);if(_0x297428==='/'){_0x1667cc=_0x1667cc['substring'](0x0,_0x1667cc[_0xfa4c('0x17')](_0x297428));}return _0x1667cc;};exports[_0xfa4c('0x18')]=function(_0x5af0dd){if(!_[_0xfa4c('0x19')](_0x5af0dd)&&_0x5af0dd!==''){var _0x4e13df=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x4e13df[_0xfa4c('0x1a')](String(_0x5af0dd)['toLowerCase']());}else{return![];}};
\ No newline at end of file
+var _0x5a33=['variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','%s:\x20%s','keyContent','format','join','stripTrailingSlash','slice','validateEmail','isNil','lodash','getString','length','type','string','push','content'];(function(_0x46e6f3,_0x1007d7){var _0x273649=function(_0x50bd8b){while(--_0x50bd8b){_0x46e6f3['push'](_0x46e6f3['shift']());}};_0x273649(++_0x1007d7);}(_0x5a33,0x170));var _0x35a3=function(_0x2a10fa,_0x5ad4b0){_0x2a10fa=_0x2a10fa-0x0;var _0x5e105b=_0x5a33[_0x2a10fa];return _0x5e105b;};'use strict';var _=require(_0x35a3('0x0'));var util=require('util');exports[_0x35a3('0x1')]=function(_0x3f9835,_0x123834,_0x1fcc41){var _0x5bfb10=[];if(_0x3f9835[_0x35a3('0x2')]>0x0){var _0xfdebff=_['sortBy'](_0x3f9835,['id']);for(var _0x12bc41=0x0;_0x12bc41<_0xfdebff[_0x35a3('0x2')];_0x12bc41++){var _0x475266=_0xfdebff[_0x12bc41];if(_0x475266[_0x35a3('0x3')]===_0x35a3('0x4')){_0x5bfb10[_0x35a3('0x5')](_0x475266[_0x35a3('0x6')]);}else if(_0x475266[_0x35a3('0x3')]===_0x35a3('0x7')&&_0x475266[_0x35a3('0x8')]){_0x123834[_0x475266[_0x35a3('0x8')]]&&_0x5bfb10[_0x35a3('0x5')](_0x123834[_0x475266[_0x35a3('0x8')]][_0x35a3('0x9')]());}else if(_0x475266['type']===_0x35a3('0xa')&&_0x475266[_0x35a3('0xb')]&&_0x475266[_0x35a3('0xb')][_0x35a3('0xc')]){_0x123834[_0x475266[_0x35a3('0xb')][_0x35a3('0xc')][_0x35a3('0xd')]()]&&_0x5bfb10[_0x35a3('0x5')](_0x123834[_0x475266[_0x35a3('0xb')][_0x35a3('0xc')][_0x35a3('0xd')]()][_0x35a3('0x9')]());}else if(_0x475266[_0x35a3('0x3')]===_0x35a3('0xe')){if(_0x475266[_0x35a3('0xf')]===_0x35a3('0x4')&&_0x475266[_0x35a3('0x10')]){_0x5bfb10[_0x35a3('0x5')](util['format'](_0x35a3('0x11'),_0x475266[_0x35a3('0x10')],_0x475266[_0x35a3('0x12')]));}else if(_0x475266['keyType']===_0x35a3('0x7')&&_0x475266['variableName']&&_0x475266[_0x35a3('0x10')]){_0x123834[_0x475266['variableName']]&&_0x5bfb10[_0x35a3('0x5')](util[_0x35a3('0x13')](_0x35a3('0x11'),_0x475266['key'],_0x123834[_0x475266[_0x35a3('0x8')]]));}else if(_0x475266[_0x35a3('0xf')]===_0x35a3('0xa')&&_0x475266['Variable']&&_0x475266['Variable']['name']&&_0x475266[_0x35a3('0x10')]){_0x123834[_0x475266[_0x35a3('0xb')][_0x35a3('0xc')][_0x35a3('0xd')]()]&&_0x5bfb10[_0x35a3('0x5')](util[_0x35a3('0x13')](_0x35a3('0x11'),_0x475266[_0x35a3('0x10')],_0x123834[_0x475266[_0x35a3('0xb')]['name']['toLowerCase']()]));}}}}return _0x5bfb10[_0x35a3('0x14')](_0x1fcc41);};exports[_0x35a3('0x15')]=function(_0x33eb49){var _0x7ad45d=_0x33eb49[_0x35a3('0x16')](-0x1);if(_0x7ad45d==='/'){_0x33eb49=_0x33eb49['substring'](0x0,_0x33eb49['lastIndexOf'](_0x7ad45d));}return _0x33eb49;};exports[_0x35a3('0x17')]=function(_0x2f969d){if(!_[_0x35a3('0x18')](_0x2f969d)&&_0x2f969d!==''){var _0x2a6db6=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return _0x2a6db6['test'](String(_0x2f969d)[_0x35a3('0xd')]());}else{return![];}};
\ No newline at end of file
index 8d10d24..8e81fa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0xd7fb0e,_0x8a3a75){var _0x189a4a=function(_0x49db26){while(--_0x49db26){_0xd7fb0e['push'](_0xd7fb0e['shift']());}};_0x189a4a(++_0x8a3a75);}(_0x9c44,0x178));var _0x49c4=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x9c44[_0x543084];return _0x306a57;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});};
\ No newline at end of file
+var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x11b19f,_0x5807af){var _0x3d99ff=function(_0x2f96bc){while(--_0x2f96bc){_0x11b19f['push'](_0x11b19f['shift']());}};_0x3d99ff(++_0x5807af);}(_0xe706,0xa3));var _0x6e70=function(_0x4da462,_0x2aac46){_0x4da462=_0x4da462-0x0;var _0x2a001a=_0xe706[_0x4da462];return _0x2a001a;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});};
\ No newline at end of file
index c4aeab2..ed16c9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ca0=['application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','results','length','first','Enduser\x20found!','end-user','Caller\x20-\x20%s','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]','GET','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','idField','custom_fields','push','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','%s/agent/tickets/%s','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit'];(function(_0x2f2ffd,_0x62f213){var _0x4a8622=function(_0xcd43d2){while(--_0xcd43d2){_0x2f2ffd['push'](_0x2f2ffd['shift']());}};_0x4a8622(++_0x62f213);}(_0x5ca0,0xce));var _0x05ca=function(_0x23d17a,_0x18368a){_0x23d17a=_0x23d17a-0x0;var _0x14ba1f=_0x5ca0[_0x23d17a];return _0x14ba1f;};'use strict';var _=require(_0x05ca('0x0'));var rp=require(_0x05ca('0x1'));var md5=require(_0x05ca('0x2'));var util=require(_0x05ca('0x3'));var Redis=require(_0x05ca('0x4'));var intUtil=require(_0x05ca('0x5'));var config=require(_0x05ca('0x6'));var logger=require(_0x05ca('0x7'))(_0x05ca('0x8'));config[_0x05ca('0x9')]=_[_0x05ca('0xa')](config[_0x05ca('0x9')],{'host':_0x05ca('0xb'),'port':0x18eb});var io=require(_0x05ca('0xc'))(new Redis(config[_0x05ca('0x9')]));function emit(_0x3f7e58,_0x4c4d2d,_0x1148fe){io['to'](_0x3f7e58)[_0x05ca('0xd')](_0x4c4d2d,_0x1148fe);}var headers={'Content-Type':_0x05ca('0xe'),'Accept':_0x05ca('0xe')};function getTicket(_0x594266,_0x394af7,_0x2f3259,_0x52f8e7,_0x48ff12){logger[_0x05ca('0xf')](_0x05ca('0x10'));return request({'uri':util[_0x05ca('0x11')](_0x05ca('0x12'),_0x594266[_0x05ca('0x13')]),'method':_0x05ca('0x14'),'body':{'ticket':_[_0x05ca('0x15')]({'requester_id':_0x2f3259['id'],'submitter_id':_0x394af7?_0x394af7['id']:undefined,'assignee_id':_0x394af7?_0x394af7['id']:undefined,'tags':getTags(_0x52f8e7[_0x05ca('0x16')],_0x05ca('0x17')),'subject':intUtil[_0x05ca('0x18')](_0x52f8e7[_0x05ca('0x19')],_0x48ff12,'\x20'),'description':intUtil[_0x05ca('0x18')](_0x52f8e7[_0x05ca('0x1a')],_0x48ff12,'\x0a'),'comment':{'public':![],'body':intUtil[_0x05ca('0x18')](_0x52f8e7['Descriptions'],_0x48ff12,'\x0a')}},getCustomFields(_0x52f8e7[_0x05ca('0x1b')],_0x48ff12))}})[_0x05ca('0x1c')](function(_0x3b8802){logger[_0x05ca('0xf')](_0x05ca('0x1d'));return _0x3b8802[_0x05ca('0x1e')];});}function getUser(_0x4a8dbf,_0x1cafd8){if(intUtil[_0x05ca('0x1f')](_0x1cafd8)){logger[_0x05ca('0xf')](_0x05ca('0x20'),_0x1cafd8);return request({'uri':util[_0x05ca('0x11')](_0x05ca('0x21'),_0x4a8dbf[_0x05ca('0x13')]),'qs':{'query':util[_0x05ca('0x11')](_0x05ca('0x22'),_0x1cafd8)}})[_0x05ca('0x1c')](function(_0x4a73b1){if(_0x4a73b1['count']){logger[_0x05ca('0xf')](_0x05ca('0x23'));return _[_0x05ca('0x24')](_0x4a73b1['results'],{'email':_0x1cafd8,'role':'agent'});}else{logger[_0x05ca('0xf')](_0x05ca('0x25'));return request({'uri':util[_0x05ca('0x11')]('%s/users/me.json',_0x4a8dbf['remoteUri'])})[_0x05ca('0x1c')](function(_0x534f7e){logger['info'](_0x05ca('0x26'));return _0x534f7e[_0x05ca('0x27')];});}});}else{logger[_0x05ca('0xf')](_0x05ca('0x25'));return request({'uri':util[_0x05ca('0x11')](_0x05ca('0x28'),_0x4a8dbf[_0x05ca('0x13')])})[_0x05ca('0x1c')](function(_0x2aba86){logger[_0x05ca('0xf')](_0x05ca('0x26'));return _0x2aba86[_0x05ca('0x27')];});}}function getEndUser(_0x4cdebd,_0x2df305,_0x5ba385){logger[_0x05ca('0xf')](_0x05ca('0x29'),_0x5ba385);return request({'uri':util['format'](_0x05ca('0x21'),_0x4cdebd[_0x05ca('0x13')]),'qs':{'query':util[_0x05ca('0x11')](_0x05ca('0x2a'),_0x5ba385)}})[_0x05ca('0x1c')](function(_0x3b20ec){var _0x4c1a1c;if(_0x3b20ec[_0x05ca('0x2b')][_0x05ca('0x2c')]){_0x3b20ec['results']=_['filter'](_0x3b20ec[_0x05ca('0x2b')],{'suspended':![],'role':'end-user'});if(_0x3b20ec['results'][_0x05ca('0x2c')]){_0x4c1a1c=_[_0x05ca('0x2d')](_0x3b20ec[_0x05ca('0x2b')]);}}if(_0x4c1a1c){logger['info'](_0x05ca('0x2e'));return _0x4c1a1c;}else{logger[_0x05ca('0xf')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x05ca('0x11')]('%s/users.json',_0x4cdebd['remoteUri']),'method':_0x05ca('0x14'),'body':{'user':{'role':_0x05ca('0x2f'),'name':util[_0x05ca('0x11')](_0x05ca('0x30'),_0x2df305||_0x5ba385),'phone':_0x5ba385}}})[_0x05ca('0x1c')](function(_0x1d0dd9){logger[_0x05ca('0xf')]('Enduser\x20created.');return _0x1d0dd9[_0x05ca('0x27')];});}});}function getAuth(_0x5d7ccf){var _0x306994;if(_0x5d7ccf['authType']===_0x05ca('0x31')){_0x306994=util[_0x05ca('0x11')](_0x05ca('0x32'),_0x5d7ccf[_0x05ca('0x33')],_0x5d7ccf['password']);}else if(_0x5d7ccf[_0x05ca('0x34')]===_0x05ca('0x35')){_0x306994=util[_0x05ca('0x11')](_0x05ca('0x36'),_0x5d7ccf[_0x05ca('0x33')],_0x5d7ccf['token']);}return util[_0x05ca('0x11')](_0x05ca('0x37'),new Buffer(_0x306994)[_0x05ca('0x38')](_0x05ca('0x39')));}function request(_0x3ef732){logger['debug'](_0x05ca('0x3a'),JSON['stringify'](_0x3ef732));return rp(_[_0x05ca('0xa')](_0x3ef732,{'method':_0x05ca('0x3b'),'headers':headers,'json':!![]}));}function getTags(_0x31e139,_0x4021eb){var _0xa8d5e0=[];if(_0x31e139&&_0x31e139[_0x05ca('0x2c')]>0x0){_0xa8d5e0=_['map'](_0x31e139,_0x4021eb);}return _0xa8d5e0;}function getCustomFields(_0x2b0386,_0x24f0e4){var _0x49a29b=[];var _0x2c1ea7={'custom_fields':[]};if(_0x2b0386['length']>0x0){_[_0x05ca('0x3c')](_0x2b0386,function(_0x3a1705){if(_[_0x05ca('0x3d')]([_0x05ca('0x3e'),_0x05ca('0x3f')],_0x3a1705[_0x05ca('0x40')])&&_0x3a1705[_0x05ca('0x41')]&&!_0x3a1705[_0x05ca('0x42')]){_0x2c1ea7[_0x3a1705[_0x05ca('0x41')][_0x05ca('0x43')]()]=_0x3a1705['content'][_0x05ca('0x38')]();}else if(_['includes']([_0x05ca('0x3e'),_0x05ca('0x3f')],_0x3a1705[_0x05ca('0x40')])&&_0x3a1705[_0x05ca('0x44')]&&_0x3a1705[_0x05ca('0x42')]){_0x2c1ea7[_0x05ca('0x45')][_0x05ca('0x46')]({'id':_0x3a1705[_0x05ca('0x44')],'value':_0x3a1705['content'][_0x05ca('0x38')]()});}else if(_0x3a1705[_0x05ca('0x40')]===_0x05ca('0x47')&&_0x3a1705[_0x05ca('0x48')]&&_0x3a1705[_0x05ca('0x44')]&&_0x3a1705[_0x05ca('0x42')]){_0x24f0e4[_0x3a1705[_0x05ca('0x48')]]&&_0x2c1ea7[_0x05ca('0x45')][_0x05ca('0x46')]({'id':_0x3a1705[_0x05ca('0x44')],'value':_0x24f0e4[_0x3a1705['variableName']][_0x05ca('0x38')]()});}else if(_0x3a1705[_0x05ca('0x40')]==='customVariable'&&_0x3a1705[_0x05ca('0x49')]&&_0x3a1705[_0x05ca('0x49')]['name']&&_0x3a1705['idField']&&_0x3a1705[_0x05ca('0x42')]){_0x24f0e4[_0x3a1705[_0x05ca('0x49')][_0x05ca('0x17')][_0x05ca('0x43')]()]&&_0x2c1ea7['custom_fields'][_0x05ca('0x46')]({'id':_0x3a1705['idField'],'value':_0x24f0e4[_0x3a1705[_0x05ca('0x49')][_0x05ca('0x17')][_0x05ca('0x43')]()][_0x05ca('0x38')]()});}});}return _0x2c1ea7;}exports[_0x05ca('0x4a')]=function(_0x4bada5,_0x413b07,_0x5d8988,_0x1405da,_0x21eb13,_0x560c6b){var _0x398315,_0x5aa027;_0x560c6b['remoteUri']=intUtil[_0x05ca('0x4b')](_0x560c6b['remoteUri']);_0x560c6b[_0x05ca('0x4c')]=intUtil['stripTrailingSlash'](_0x560c6b['serverUrl']);if(_0x21eb13&&_0x21eb13[_0x05ca('0x4d')]){logger[_0x05ca('0xf')](_0x05ca('0x4e'),_0x05ca('0x4f'));_0x413b07[_0x05ca('0x50')]=util['format'](_0x05ca('0x51'),_0x560c6b[_0x05ca('0x4c')],_0x413b07['uniqueid'],md5(_0x413b07[_0x05ca('0x52')]));}else{_0x413b07[_0x05ca('0x50')]='';}headers['Authorization']=getAuth(_0x560c6b);return getUser(_0x560c6b,_0x1405da[_0x05ca('0x53')])[_0x05ca('0x1c')](function(_0x5b6611){_0x398315=_0x5b6611;logger[_0x05ca('0xf')](_0x05ca('0x54'),_0x398315['id']);return getEndUser(_0x560c6b,_0x413b07[_0x05ca('0x55')],_0x413b07[_0x05ca('0x56')]);})[_0x05ca('0x1c')](function(_0x326484){_0x5aa027=_0x326484;logger['info'](_0x05ca('0x57'),_0x5aa027['id']);return getTicket(_0x560c6b,_0x398315,_0x5aa027,_0x5d8988,_0x413b07);})[_0x05ca('0x1c')](function(_0xa27540){if(_0xa27540){logger[_0x05ca('0xf')](_0x05ca('0x58'),_0xa27540['id']);switch(_0x560c6b[_0x05ca('0x40')]){case _0x05ca('0x59'):logger[_0x05ca('0xf')](_0x05ca('0x4e'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x05ca('0x11')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x560c6b[_0x05ca('0x13')],_0x398315['id'],_0xa27540['id']),'method':_0x05ca('0x14')});case _0x05ca('0x5a'):logger[_0x05ca('0xf')](_0x05ca('0x4e'),_0x05ca('0x5b'));emit(util[_0x05ca('0x11')](_0x05ca('0x5c'),_0x1405da[_0x05ca('0x17')]),_0x05ca('0x5d'),{'uri':util[_0x05ca('0x11')]('%s/agent/tickets/%s',_0x560c6b[_0x05ca('0x13')][_0x05ca('0x5e')](_0x05ca('0x5f'),''),_0xa27540['id'])});break;default:logger[_0x05ca('0x60')](_0x05ca('0x4e'),_0x05ca('0x61'));}}})['catch'](function(_0x2c2f2c){logger[_0x05ca('0x60')](_0x05ca('0x62'),util[_0x05ca('0x63')](_0x2c2f2c,{'showHidden':!![],'depth':null}));});};exports[_0x05ca('0x64')]=function(_0xd6860d,_0x163a16,_0x4082fb,_0x2d7d59,_0x55de3d,_0x1bf3e4,_0x195694){var _0x50c362,_0x2a7252;_0x1bf3e4[_0x05ca('0x13')]=intUtil[_0x05ca('0x4b')](_0x1bf3e4['remoteUri']);_0x1bf3e4[_0x05ca('0x4c')]=intUtil[_0x05ca('0x4b')](_0x1bf3e4[_0x05ca('0x4c')]);if(_0x195694&&_0x195694[_0x05ca('0x65')]&&_0x195694[_0x05ca('0x65')]!==_0x05ca('0x66')){logger[_0x05ca('0xf')]('[OUTBOUND]',_0x05ca('0x4f'));_0x163a16[_0x05ca('0x50')]=util[_0x05ca('0x11')](_0x05ca('0x51'),_0x1bf3e4[_0x05ca('0x4c')],_0x163a16['uniqueid'],md5(_0x163a16[_0x05ca('0x52')]));}headers['Authorization']=getAuth(_0x1bf3e4);return getUser(_0x1bf3e4,_0x2d7d59[_0x05ca('0x53')])[_0x05ca('0x1c')](function(_0x499c88){_0x50c362=_0x499c88;logger[_0x05ca('0xf')](_0x05ca('0x54'),_0x50c362['id']);return getEndUser(_0x1bf3e4,_0x163a16['destcalleridname'],_0x163a16['destcalleridnum']);})['then'](function(_0x164a69){_0x2a7252=_0x164a69;logger[_0x05ca('0xf')](_0x05ca('0x57'),_0x2a7252['id']);return getTicket(_0x1bf3e4,_0x50c362,_0x2a7252,_0x4082fb,_0x163a16);})[_0x05ca('0x1c')](function(_0x30dbde){if(_0x30dbde){logger['info'](_0x05ca('0x58'),_0x30dbde['id']);switch(_0x1bf3e4[_0x05ca('0x40')]){case _0x05ca('0x59'):logger[_0x05ca('0xf')](_0x05ca('0x67'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x1bf3e4[_0x05ca('0x13')],_0x50c362['id'],_0x30dbde['id']),'method':'POST'});case'newTab':logger['info'](_0x05ca('0x67'),_0x05ca('0x5b'));emit(util['format'](_0x05ca('0x5c'),_0x2d7d59[_0x05ca('0x17')]),_0x05ca('0x5d'),{'uri':util[_0x05ca('0x11')](_0x05ca('0x68'),_0x1bf3e4['remoteUri']['replace'](_0x05ca('0x5f'),''),_0x30dbde['id'])});break;default:logger[_0x05ca('0x60')]('[OUTBOUND]',_0x05ca('0x61'));}}})[_0x05ca('0x69')](function(_0x5c5521){logger[_0x05ca('0x60')](_0x05ca('0x6a'),util[_0x05ca('0x63')](_0x5c5521,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x49db1f,_0x332906,_0x5b4e0c,_0x1026f9,_0x3089f2,_0x3874a5){var _0x2154d4,_0x2ff72b;_0x3874a5[_0x05ca('0x13')]=intUtil[_0x05ca('0x4b')](_0x3874a5[_0x05ca('0x13')]);_0x3874a5[_0x05ca('0x4c')]=intUtil[_0x05ca('0x4b')](_0x3874a5['serverUrl']);if(_0x3089f2&&_0x3089f2[_0x05ca('0x4d')]){logger[_0x05ca('0xf')]('['+_0x332906[_0x05ca('0x6b')][_0x05ca('0x6c')]()+']',_0x05ca('0x4f'));_0x332906[_0x05ca('0x50')]=util[_0x05ca('0x11')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3874a5[_0x05ca('0x4c')],_0x332906[_0x05ca('0x52')],md5(_0x332906['uniqueid']));}else{_0x332906['recordingURL']='';}headers['Authorization']=getAuth(_0x3874a5);return getUser(_0x3874a5)['then'](function(_0x3b176f){_0x2154d4=_0x3b176f;logger[_0x05ca('0xf')](_0x05ca('0x54'),_0x2154d4['id']);return getEndUser(_0x3874a5,_0x332906[_0x05ca('0x55')],_0x332906[_0x05ca('0x56')]);})[_0x05ca('0x1c')](function(_0x311d5b){_0x2ff72b=_0x311d5b;logger[_0x05ca('0xf')](_0x05ca('0x57'),_0x2ff72b['id']);return getTicket(_0x3874a5,_0x2154d4,_0x2ff72b,_0x5b4e0c,_0x332906);})[_0x05ca('0x1c')](function(_0x59c67c){if(_0x59c67c){logger[_0x05ca('0xf')]('The\x20Ticket\x20ID\x20is:',_0x59c67c['id']);}})[_0x05ca('0x69')](function(_0x2439cb){logger[_0x05ca('0x60')]('['+_0x332906[_0x05ca('0x6b')][_0x05ca('0x6c')]()+']'+_0x05ca('0x6d'),util['inspect'](_0x2439cb,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x8d51=['info','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','password','%s:%s','username','authType','%s/token:%s','toString','base64','debug','[HTTP]','stringify','GET','forEach','includes','string','type','customField','nameField','toLowerCase','content','picklist','idField','custom_fields','push','variable','variableName','Variable','queue','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Authorization','email','calleridname','The\x20Enduser\x20ID\x20is:','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','calleridnum','The\x20Ticket\x20ID\x20is:','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','Subjects','Descriptions','getString','then'];(function(_0x165c96,_0x2269de){var _0x5c2420=function(_0x4e9a1e){while(--_0x4e9a1e){_0x165c96['push'](_0x165c96['shift']());}};_0x5c2420(++_0x2269de);}(_0x8d51,0x123));var _0x18d5=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x8d51[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x18d5('0x0'));var rp=require(_0x18d5('0x1'));var md5=require(_0x18d5('0x2'));var util=require(_0x18d5('0x3'));var Redis=require(_0x18d5('0x4'));var intUtil=require('./util');var config=require(_0x18d5('0x5'));var logger=require(_0x18d5('0x6'))(_0x18d5('0x7'));config[_0x18d5('0x8')]=_[_0x18d5('0x9')](config[_0x18d5('0x8')],{'host':_0x18d5('0xa'),'port':0x18eb});var io=require(_0x18d5('0xb'))(new Redis(config[_0x18d5('0x8')]));function emit(_0x5e2c8c,_0x452ea3,_0x417282){io['to'](_0x5e2c8c)['emit'](_0x452ea3,_0x417282);}var headers={'Content-Type':'application/json','Accept':_0x18d5('0xc')};function getTicket(_0x5d0265,_0xe22319,_0x10a1b7,_0x18fef3,_0x2e7078){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0x18d5('0xd')](_0x18d5('0xe'),_0x5d0265[_0x18d5('0xf')]),'method':_0x18d5('0x10'),'body':{'ticket':_[_0x18d5('0x11')]({'requester_id':_0x10a1b7['id'],'submitter_id':_0xe22319?_0xe22319['id']:undefined,'assignee_id':_0xe22319?_0xe22319['id']:undefined,'tags':getTags(_0x18fef3[_0x18d5('0x12')],_0x18d5('0x13')),'subject':intUtil['getString'](_0x18fef3[_0x18d5('0x14')],_0x2e7078,'\x20'),'description':intUtil['getString'](_0x18fef3[_0x18d5('0x15')],_0x2e7078,'\x0a'),'comment':{'public':![],'body':intUtil[_0x18d5('0x16')](_0x18fef3['Descriptions'],_0x2e7078,'\x0a')}},getCustomFields(_0x18fef3['Fields'],_0x2e7078))}})[_0x18d5('0x17')](function(_0xbaf0e2){logger[_0x18d5('0x18')]('Ticket\x20created!');return _0xbaf0e2[_0x18d5('0x19')];});}function getUser(_0x3dddd8,_0xd747c1){if(intUtil[_0x18d5('0x1a')](_0xd747c1)){logger[_0x18d5('0x18')](_0x18d5('0x1b'),_0xd747c1);return request({'uri':util['format'](_0x18d5('0x1c'),_0x3dddd8[_0x18d5('0xf')]),'qs':{'query':util[_0x18d5('0xd')]('type:user\x20role:agent\x20email:%s',_0xd747c1)}})[_0x18d5('0x17')](function(_0x4171eb){if(_0x4171eb['count']){logger[_0x18d5('0x18')](_0x18d5('0x1d'));return _[_0x18d5('0x1e')](_0x4171eb[_0x18d5('0x1f')],{'email':_0xd747c1,'role':_0x18d5('0x20')});}else{logger[_0x18d5('0x18')](_0x18d5('0x21'));return request({'uri':util[_0x18d5('0xd')](_0x18d5('0x22'),_0x3dddd8['remoteUri'])})[_0x18d5('0x17')](function(_0x205ce2){logger[_0x18d5('0x18')](_0x18d5('0x23'));return _0x205ce2['user'];});}});}else{logger[_0x18d5('0x18')](_0x18d5('0x21'));return request({'uri':util['format'](_0x18d5('0x22'),_0x3dddd8[_0x18d5('0xf')])})[_0x18d5('0x17')](function(_0x3610d5){logger[_0x18d5('0x18')](_0x18d5('0x23'));return _0x3610d5['user'];});}}function getEndUser(_0x1ba950,_0x4ebec8,_0xa24a85){logger[_0x18d5('0x18')]('Searching\x20enduser\x20with\x20phone',_0xa24a85);return request({'uri':util[_0x18d5('0xd')](_0x18d5('0x1c'),_0x1ba950[_0x18d5('0xf')]),'qs':{'query':util['format'](_0x18d5('0x24'),_0xa24a85)}})[_0x18d5('0x17')](function(_0x57c0e1){var _0x19ae2e;if(_0x57c0e1['results']['length']){_0x57c0e1[_0x18d5('0x1f')]=_[_0x18d5('0x25')](_0x57c0e1[_0x18d5('0x1f')],{'suspended':![],'role':_0x18d5('0x26')});if(_0x57c0e1[_0x18d5('0x1f')][_0x18d5('0x27')]){_0x19ae2e=_[_0x18d5('0x28')](_0x57c0e1['results']);}}if(_0x19ae2e){logger['info'](_0x18d5('0x29'));return _0x19ae2e;}else{logger[_0x18d5('0x18')](_0x18d5('0x2a'));return request({'uri':util[_0x18d5('0xd')](_0x18d5('0x2b'),_0x1ba950[_0x18d5('0xf')]),'method':_0x18d5('0x10'),'body':{'user':{'role':'end-user','name':util['format']('Caller\x20-\x20%s',_0x4ebec8||_0xa24a85),'phone':_0xa24a85}}})[_0x18d5('0x17')](function(_0x397274){logger[_0x18d5('0x18')](_0x18d5('0x2c'));return _0x397274['user'];});}});}function getAuth(_0x181d94){var _0xac57b8;if(_0x181d94['authType']===_0x18d5('0x2d')){_0xac57b8=util[_0x18d5('0xd')](_0x18d5('0x2e'),_0x181d94[_0x18d5('0x2f')],_0x181d94['password']);}else if(_0x181d94[_0x18d5('0x30')]==='token'){_0xac57b8=util[_0x18d5('0xd')](_0x18d5('0x31'),_0x181d94[_0x18d5('0x2f')],_0x181d94['token']);}return util[_0x18d5('0xd')]('Basic\x20%s',new Buffer(_0xac57b8)[_0x18d5('0x32')](_0x18d5('0x33')));}function request(_0x29a94a){logger[_0x18d5('0x34')](_0x18d5('0x35'),JSON[_0x18d5('0x36')](_0x29a94a));return rp(_[_0x18d5('0x9')](_0x29a94a,{'method':_0x18d5('0x37'),'headers':headers,'json':!![]}));}function getTags(_0xfd8878,_0x4e6a7f){var _0xb00f84=[];if(_0xfd8878&&_0xfd8878[_0x18d5('0x27')]>0x0){_0xb00f84=_['map'](_0xfd8878,_0x4e6a7f);}return _0xb00f84;}function getCustomFields(_0x75b4be,_0x5ab39d){var _0x25f848=[];var _0x2ad116={'custom_fields':[]};if(_0x75b4be['length']>0x0){_[_0x18d5('0x38')](_0x75b4be,function(_0xf8b68e){if(_[_0x18d5('0x39')]([_0x18d5('0x3a'),'picklist'],_0xf8b68e[_0x18d5('0x3b')])&&_0xf8b68e['nameField']&&!_0xf8b68e[_0x18d5('0x3c')]){_0x2ad116[_0xf8b68e[_0x18d5('0x3d')][_0x18d5('0x3e')]()]=_0xf8b68e[_0x18d5('0x3f')][_0x18d5('0x32')]();}else if(_['includes'](['string',_0x18d5('0x40')],_0xf8b68e['type'])&&_0xf8b68e[_0x18d5('0x41')]&&_0xf8b68e[_0x18d5('0x3c')]){_0x2ad116[_0x18d5('0x42')][_0x18d5('0x43')]({'id':_0xf8b68e['idField'],'value':_0xf8b68e[_0x18d5('0x3f')][_0x18d5('0x32')]()});}else if(_0xf8b68e['type']===_0x18d5('0x44')&&_0xf8b68e[_0x18d5('0x45')]&&_0xf8b68e[_0x18d5('0x41')]&&_0xf8b68e[_0x18d5('0x3c')]){_0x5ab39d[_0xf8b68e[_0x18d5('0x45')]]&&_0x2ad116[_0x18d5('0x42')][_0x18d5('0x43')]({'id':_0xf8b68e[_0x18d5('0x41')],'value':_0x5ab39d[_0xf8b68e[_0x18d5('0x45')]][_0x18d5('0x32')]()});}else if(_0xf8b68e['type']==='customVariable'&&_0xf8b68e[_0x18d5('0x46')]&&_0xf8b68e['Variable'][_0x18d5('0x13')]&&_0xf8b68e['idField']&&_0xf8b68e[_0x18d5('0x3c')]){_0x5ab39d[_0xf8b68e[_0x18d5('0x46')][_0x18d5('0x13')][_0x18d5('0x3e')]()]&&_0x2ad116['custom_fields'][_0x18d5('0x43')]({'id':_0xf8b68e[_0x18d5('0x41')],'value':_0x5ab39d[_0xf8b68e['Variable'][_0x18d5('0x13')][_0x18d5('0x3e')]()]['toString']()});}});}return _0x2ad116;}exports[_0x18d5('0x47')]=function(_0x1b96a6,_0x5d7793,_0x635838,_0x4db70d,_0x1e6784,_0x57ce09){var _0x4ea894,_0x29da6c;_0x57ce09[_0x18d5('0xf')]=intUtil[_0x18d5('0x48')](_0x57ce09[_0x18d5('0xf')]);_0x57ce09['serverUrl']=intUtil[_0x18d5('0x48')](_0x57ce09['serverUrl']);if(_0x1e6784&&_0x1e6784[_0x18d5('0x49')]){logger[_0x18d5('0x18')](_0x18d5('0x4a'),'Recording\x20is\x20enabled!');_0x5d7793[_0x18d5('0x4b')]=util[_0x18d5('0xd')](_0x18d5('0x4c'),_0x57ce09[_0x18d5('0x4d')],_0x5d7793[_0x18d5('0x4e')],md5(_0x5d7793[_0x18d5('0x4e')]));}else{_0x5d7793['recordingURL']='';}headers[_0x18d5('0x4f')]=getAuth(_0x57ce09);return getUser(_0x57ce09,_0x4db70d[_0x18d5('0x50')])['then'](function(_0x24cca9){_0x4ea894=_0x24cca9;logger['info']('The\x20User\x20ID\x20is:',_0x4ea894['id']);return getEndUser(_0x57ce09,_0x5d7793[_0x18d5('0x51')],_0x5d7793['calleridnum']);})['then'](function(_0x43c4c0){_0x29da6c=_0x43c4c0;logger['info'](_0x18d5('0x52'),_0x29da6c['id']);return getTicket(_0x57ce09,_0x4ea894,_0x29da6c,_0x635838,_0x5d7793);})['then'](function(_0x5a02d2){if(_0x5a02d2){logger[_0x18d5('0x18')]('The\x20Ticket\x20ID\x20is:',_0x5a02d2['id']);switch(_0x57ce09[_0x18d5('0x3b')]){case _0x18d5('0x53'):logger[_0x18d5('0x18')](_0x18d5('0x4a'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x18d5('0xd')](_0x18d5('0x54'),_0x57ce09[_0x18d5('0xf')],_0x4ea894['id'],_0x5a02d2['id']),'method':'POST'});case _0x18d5('0x55'):logger[_0x18d5('0x18')](_0x18d5('0x4a'),_0x18d5('0x56'));emit(util[_0x18d5('0xd')](_0x18d5('0x57'),_0x4db70d[_0x18d5('0x13')]),_0x18d5('0x58'),{'uri':util[_0x18d5('0xd')](_0x18d5('0x59'),_0x57ce09[_0x18d5('0xf')][_0x18d5('0x5a')]('/api/v2',''),_0x5a02d2['id'])});break;default:logger[_0x18d5('0x5b')](_0x18d5('0x4a'),_0x18d5('0x5c'));}}})[_0x18d5('0x5d')](function(_0x181e2f){logger[_0x18d5('0x5b')](_0x18d5('0x5e'),util['inspect'](_0x181e2f,{'showHidden':!![],'depth':null}));});};exports[_0x18d5('0x5f')]=function(_0x244f90,_0x54f85d,_0x2ca73b,_0x1607f3,_0x42d32e,_0x1b56cc,_0x2131c7){var _0x3edc1a,_0x537679;_0x1b56cc[_0x18d5('0xf')]=intUtil[_0x18d5('0x48')](_0x1b56cc[_0x18d5('0xf')]);_0x1b56cc['serverUrl']=intUtil[_0x18d5('0x48')](_0x1b56cc[_0x18d5('0x4d')]);if(_0x2131c7&&_0x2131c7['recordingFormat']&&_0x2131c7['recordingFormat']!=='none'){logger[_0x18d5('0x18')](_0x18d5('0x60'),_0x18d5('0x61'));_0x54f85d['recordingURL']=util[_0x18d5('0xd')](_0x18d5('0x4c'),_0x1b56cc[_0x18d5('0x4d')],_0x54f85d['uniqueid'],md5(_0x54f85d[_0x18d5('0x4e')]));}headers['Authorization']=getAuth(_0x1b56cc);return getUser(_0x1b56cc,_0x1607f3[_0x18d5('0x50')])[_0x18d5('0x17')](function(_0x4eb0be){_0x3edc1a=_0x4eb0be;logger[_0x18d5('0x18')](_0x18d5('0x62'),_0x3edc1a['id']);return getEndUser(_0x1b56cc,_0x54f85d['destcalleridname'],_0x54f85d['destcalleridnum']);})[_0x18d5('0x17')](function(_0xf1aae1){_0x537679=_0xf1aae1;logger['info'](_0x18d5('0x52'),_0x537679['id']);return getTicket(_0x1b56cc,_0x3edc1a,_0x537679,_0x2ca73b,_0x54f85d);})[_0x18d5('0x17')](function(_0x3a60d4){if(_0x3a60d4){logger[_0x18d5('0x18')]('The\x20Ticket\x20ID\x20is:',_0x3a60d4['id']);switch(_0x1b56cc[_0x18d5('0x3b')]){case'integrationTab':logger[_0x18d5('0x18')](_0x18d5('0x60'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x18d5('0xd')](_0x18d5('0x54'),_0x1b56cc['remoteUri'],_0x3edc1a['id'],_0x3a60d4['id']),'method':_0x18d5('0x10')});case _0x18d5('0x55'):logger[_0x18d5('0x18')](_0x18d5('0x60'),_0x18d5('0x56'));emit(util[_0x18d5('0xd')](_0x18d5('0x57'),_0x1607f3[_0x18d5('0x13')]),_0x18d5('0x58'),{'uri':util[_0x18d5('0xd')]('%s/agent/tickets/%s',_0x1b56cc['remoteUri'][_0x18d5('0x5a')]('/api/v2',''),_0x3a60d4['id'])});break;default:logger[_0x18d5('0x5b')](_0x18d5('0x60'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x18d5('0x5d')](function(_0x46a0b4){logger['error'](_0x18d5('0x63'),util[_0x18d5('0x64')](_0x46a0b4,{'showHidden':!![],'depth':null}));});};exports[_0x18d5('0x65')]=function(_0x58c6f1,_0x4ce7d5,_0x2f66f1,_0x55947d,_0x3b6c5e,_0x221a6d){var _0x8751fd,_0x132f87;_0x221a6d['remoteUri']=intUtil[_0x18d5('0x48')](_0x221a6d[_0x18d5('0xf')]);_0x221a6d[_0x18d5('0x4d')]=intUtil['stripTrailingSlash'](_0x221a6d[_0x18d5('0x4d')]);if(_0x3b6c5e&&_0x3b6c5e[_0x18d5('0x49')]){logger[_0x18d5('0x18')]('['+_0x4ce7d5[_0x18d5('0x66')]['toUpperCase']()+']',_0x18d5('0x61'));_0x4ce7d5[_0x18d5('0x4b')]=util[_0x18d5('0xd')](_0x18d5('0x4c'),_0x221a6d[_0x18d5('0x4d')],_0x4ce7d5['uniqueid'],md5(_0x4ce7d5[_0x18d5('0x4e')]));}else{_0x4ce7d5[_0x18d5('0x4b')]='';}headers[_0x18d5('0x4f')]=getAuth(_0x221a6d);return getUser(_0x221a6d)[_0x18d5('0x17')](function(_0x39cbb1){_0x8751fd=_0x39cbb1;logger['info']('The\x20User\x20ID\x20is:',_0x8751fd['id']);return getEndUser(_0x221a6d,_0x4ce7d5[_0x18d5('0x51')],_0x4ce7d5[_0x18d5('0x67')]);})[_0x18d5('0x17')](function(_0x702611){_0x132f87=_0x702611;logger[_0x18d5('0x18')](_0x18d5('0x52'),_0x132f87['id']);return getTicket(_0x221a6d,_0x8751fd,_0x132f87,_0x2f66f1,_0x4ce7d5);})[_0x18d5('0x17')](function(_0x168a3f){if(_0x168a3f){logger['info'](_0x18d5('0x68'),_0x168a3f['id']);}})[_0x18d5('0x5d')](function(_0x517db6){logger[_0x18d5('0x5b')]('['+_0x4ce7d5[_0x18d5('0x66')]['toUpperCase']()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x18d5('0x64')](_0x517db6,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 68e5ff4..2ace8e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6153=['stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','error','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','then','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','SUCCESS','details','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','nothing','Creating\x20new\x20call...','administrator','Description','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','connect','Call_Result','Answered','rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','code','err','log','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','host','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','recordingFormat','none','destcalleridname','Outbound','[OUTBOUND]','unmanaged','toUpperCase','calleridname','lodash','request-promise','md5','util','./util','moment','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','length','forEach','includes','idField','content','toString','type','variable','variableName','customVariable','name','Variable','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','seconds','catch'];(function(_0x22583c,_0x3a91fa){var _0x38767a=function(_0x5346f6){while(--_0x5346f6){_0x22583c['push'](_0x22583c['shift']());}};_0x38767a(++_0x3a91fa);}(_0x6153,0x6c));var _0x3615=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x6153[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x3615('0x0'));var rp=require(_0x3615('0x1'));var md5=require(_0x3615('0x2'));var util=require(_0x3615('0x3'));var intUtil=require(_0x3615('0x4'));var moment=require(_0x3615('0x5'));var Redis=require('ioredis');var BPromise=require('bluebird');var config=require(_0x3615('0x6'));var logger=require(_0x3615('0x7'))('zoho');config[_0x3615('0x8')]=_[_0x3615('0x9')](config[_0x3615('0x8')],{'host':_0x3615('0xa'),'port':0x18eb});var io=require(_0x3615('0xb'))(new Redis(config[_0x3615('0x8')]));function emit(_0x1160c8,_0x2d63df,_0x4a9dd2){io['to'](_0x1160c8)[_0x3615('0xc')](_0x2d63df,_0x4a9dd2);}function request(_0x566a3a){logger[_0x3615('0xd')](_0x3615('0xe'),JSON['stringify'](_0x566a3a));return rp(_0x566a3a);}function getCustomFields(_0x4e6d48,_0x2d888e){var _0x4f3c3d={};if(_0x4e6d48[_0x3615('0xf')]>0x0){_[_0x3615('0x10')](_0x4e6d48,function(_0x52f054){if(_[_0x3615('0x11')](['string','picklist'],_0x52f054['type'])&&_0x52f054[_0x3615('0x12')]){_0x4f3c3d[_0x52f054[_0x3615('0x12')]]=_0x52f054[_0x3615('0x13')][_0x3615('0x14')]();}else if(_0x52f054[_0x3615('0x15')]===_0x3615('0x16')&&_0x52f054[_0x3615('0x17')]&&_0x52f054['idField']&&_0x2d888e[_0x52f054[_0x3615('0x17')]]){_0x4f3c3d[_0x52f054[_0x3615('0x12')]]=_0x2d888e[_0x52f054[_0x3615('0x17')]]['toString']();}else if(_0x52f054[_0x3615('0x15')]===_0x3615('0x18')&&_0x52f054['Variable']&&_0x52f054['Variable'][_0x3615('0x19')]&&_0x52f054[_0x3615('0x12')]&&_0x2d888e[_0x52f054[_0x3615('0x1a')]['name'][_0x3615('0x1b')]()]){_0x4f3c3d[_0x52f054['idField']]=_0x2d888e[_0x52f054['Variable'][_0x3615('0x19')][_0x3615('0x1b')]()][_0x3615('0x14')]();}});}return _0x4f3c3d;}function getName(_0x27a2b9){if(_0x27a2b9[_0x3615('0x1c')]('\x20')>0x0){var _0x4f9749=_0x27a2b9[_0x3615('0x1d')](/ (.+)/);if(_0x4f9749[0x1]){return _0x4f9749;}}return[_0x27a2b9,_0x27a2b9];}var accountsTokens={};function getAccessToken(_0x15c6c7){return new Promise(function(_0x5d9641,_0x3fbd95){if(!_[_0x3615('0x1e')](accountsTokens[_0x15c6c7['id']])&&!_[_0x3615('0x1e')](accountsTokens[_0x15c6c7['id']][_0x3615('0x1f')])){if(moment()[_0x3615('0x20')](accountsTokens[_0x15c6c7['id']][_0x3615('0x21')])){_0x5d9641(accountsTokens[_0x15c6c7['id']]['access_token']);}}var _0x26fd88;switch(_0x15c6c7[_0x3615('0x22')]){case'US':_0x26fd88=_0x3615('0x23');break;case'AU':_0x26fd88=_0x3615('0x24');break;case'EU':_0x26fd88=_0x3615('0x25');break;case'IN':_0x26fd88=_0x3615('0x26');break;case'CN':_0x26fd88='https://accounts.zoho.com.cn';break;default:_0x26fd88=_0x3615('0x25');break;}var _0x5c67b5={'method':_0x3615('0x27'),'uri':_0x26fd88+_0x3615('0x28'),'qs':{'refresh_token':_0x15c6c7[_0x3615('0x29')],'client_id':_0x15c6c7[_0x3615('0x2a')],'client_secret':_0x15c6c7[_0x3615('0x2b')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x5c67b5)['then'](function(_0x443458){accountsTokens[_0x15c6c7['id']]={'access_token':_0x443458[_0x3615('0x1f')],'expires_in':moment()['add'](_0x443458[_0x3615('0x21')],_0x3615('0x2c'))};_0x5d9641(_0x443458[_0x3615('0x1f')]);})[_0x3615('0x2d')](function(_0x3517e8){logger['error']('Failing\x20creating\x20the\x20access_token',_0x3517e8[_0x3615('0x2e')]);_0x3fbd95(_0x3517e8);});});}function getUser(_0x4a689c,_0xa70184,_0x221ef1,_0x168fb8){logger[_0x3615('0x2f')](_0x3615('0x30'));return request({'method':_0x3615('0x31'),'uri':util[_0x3615('0x32')](_0x3615('0x33'),_0xa70184),'qs':{'type':_0x3615('0x34')},'headers':{'Authorization':_0x3615('0x35')+_0x4a689c},'json':!![]})['then'](function(_0x158b7c){if(_0x158b7c[_0x3615('0x36')]){var _0x22d1a6=-0x1;if(_[_0x3615('0x37')](_0x158b7c[_0x3615('0x36')])){if(!_[_0x3615('0x1e')](_0x168fb8)){_0x22d1a6=_[_0x3615('0x38')](_0x158b7c[_0x3615('0x36')],function(_0xadf3c9){return _0xadf3c9[_0x3615('0x39')]===_0x168fb8;});}if(_0x22d1a6>=0x0){logger[_0x3615('0x2f')](_0x3615('0x3a'));}else{logger[_0x3615('0x2f')](_0x3615('0x3b'));_0x22d1a6=_[_0x3615('0x38')](_0x158b7c['users'],function(_0x34e5a4){return _0x34e5a4[_0x3615('0x3c')]['name']===_0x3615('0x3d');});}return _0x158b7c['users'][_0x22d1a6];}else{if(_0x158b7c['user'][_0x3615('0x3c')]['name']===_0x3615('0x3d')){logger[_0x3615('0x2f')](_0x3615('0x3b'));user=_0x158b7c[_0x3615('0x3e')];return user;}else{logger[_0x3615('0x3f')](_0x3615('0x40'),JSON[_0x3615('0x41')](_0x158b7c));throw new Error(_0x3615('0x42')+JSON['stringify'](_0x158b7c));}}}else{logger[_0x3615('0x3f')]('The\x20failing\x20result\x20is',JSON[_0x3615('0x41')](_0x158b7c));throw new Error(_0x3615('0x42')+JSON[_0x3615('0x41')](_0x158b7c));}})[_0x3615('0x2d')](function(_0x47b7c3){console['error'](_0x47b7c3);});}function getZohoUser(_0x10c77f,_0x349ebf){return new BPromise(function(_0x491587,_0x19d48d){request(_0x10c77f)[_0x3615('0x43')](function(_0x7ea398){var _0x5d2b4e=null;if(_0x7ea398){_0x5d2b4e=_0x7ea398[_0x3615('0x44')][0x0];_0x5d2b4e[_0x3615('0x45')]=_0x349ebf;}_0x491587(_0x5d2b4e);})[_0x3615('0x2d')](function(_0x4a7407){_0x19d48d(_0x4a7407);});});}function createEndUser(_0x194ac8,_0x33f969,_0x2eda32,_0x37571f,_0x31127b,_0x3a50a4){var _0x2eda32=getName(_0x2eda32);return request({'method':'POST','uri':_0x3615('0x46')+_0x33f969+_0x3615('0x47')+_[_0x3615('0x48')](_0x3a50a4[_0x3615('0x49')])+'s','body':{'data':[{'Last_Name':_0x2eda32[0x1],'First_Name':_0x2eda32[0x0],'Phone':_0x37571f,'Owner':{'name':!_['isNil'](_0x31127b[_0x3615('0x4a')][_0x3615('0x19')])?_0x31127b[_0x3615('0x4a')][_0x3615('0x19')]:!_['isNil'](_0x31127b[_0x3615('0x4b')])?_0x31127b['first_name']+'\x20'+_0x31127b['last_name']:_0x31127b[_0x3615('0x4c')],'id':_0x31127b['id']}}]},'headers':{'Authorization':_0x3615('0x35')+_0x194ac8},'json':!![]})['then'](function(_0x3aca44){if(_0x3aca44&&_0x3aca44[_0x3615('0x44')][0x0]['code']===_0x3615('0x4d')){var _0x3309b5=_0x3aca44[_0x3615('0x44')][0x0][_0x3615('0x4e')];_0x3309b5[_0x3615('0x45')]=_['startCase'](_0x3a50a4['moduleCreate'])+'s';return _0x3309b5;}logger[_0x3615('0x3f')](_0x3615('0x40'),JSON[_0x3615('0x41')](data));throw new Error(_0x3615('0x4f')+JSON[_0x3615('0x41')](data));})[_0x3615('0x2d')](function(_0x51ef23){console['log'](_0x3615('0x50'),_0x51ef23);});}function getEndUser(_0x15e49c,_0x28d089,_0x2383c7,_0x257a21,_0x151707,_0x4d648d,_0x2eee6e){var _0x3d7efb={'method':'GET','uri':'','headers':{'Authorization':_0x3615('0x35')+_0x15e49c},'json':!![]};switch(_0x2eee6e[_0x3615('0x51')]){case _0x3615('0x52'):_0x3d7efb[_0x3615('0x53')]=_0x3615('0x46')+_0x28d089+_0x3615('0x54')+_0x151707+'))';return getZohoUser(_0x3d7efb,_0x3615('0x55'))[_0x3615('0x43')](function(_0x545339){if(_0x545339)return _0x545339;_0x3d7efb[_0x3615('0x53')]=_0x3615('0x46')+_0x28d089+_0x3615('0x56')+_0x151707+'))';return getZohoUser(_0x3d7efb,_0x3615('0x57'))[_0x3615('0x43')](function(_0x1fdc74){if(_0x1fdc74)return _0x1fdc74;if(_0x2eee6e[_0x3615('0x49')]!='nothing'){return createEndUser(_0x15e49c,_0x28d089,_0x257a21,_0x151707,_0x4d648d,_0x2eee6e);}else{return{};}});});break;case _0x3615('0x58'):_0x3d7efb[_0x3615('0x53')]=_0x3615('0x46')+_0x28d089+_0x3615('0x54')+_0x151707+'))';return getZohoUser(_0x3d7efb,'Contacts')['then'](function(_0x244b72){if(_0x244b72)return _0x244b72;if(_0x2eee6e[_0x3615('0x49')]!=_0x3615('0x59')){return createEndUser(_0x15e49c,_0x28d089,_0x257a21,_0x151707,_0x4d648d,_0x2eee6e);}else{return{};}});break;case'lead':_0x3d7efb['uri']=_0x3615('0x46')+_0x28d089+_0x3615('0x56')+_0x151707+'))';return getZohoUser(_0x3d7efb,_0x3615('0x57'))[_0x3615('0x43')](function(_0x5676d1){if(_0x5676d1)return _0x5676d1;if(_0x2eee6e['moduleCreate']!='nothing'){return createEndUser(_0x15e49c,_0x28d089,_0x257a21,_0x151707,_0x4d648d,_0x2eee6e);}else{return{};}});break;}}function getCall(_0x28b78e,_0x3f1302,_0x4ad985,_0x4fc315,_0x58bf4b,_0x526039,_0x33aabf,_0xe9675a){logger[_0x3615('0x2f')](_0x3615('0x5a'));var _0x3bb0a2={};_0x3bb0a2['Owner']={'name':!_[_0x3615('0x1e')](_0x4fc315[_0x3615('0x4a')][_0x3615('0x19')])&&!_[_0x3615('0x1e')](_0x4fc315[_0x3615('0x3c')][_0x3615('0x19')])&&_0x4fc315[_0x3615('0x3c')]['name']===_0x3615('0x5b')?_0x4fc315[_0x3615('0x4a')][_0x3615('0x19')]:!_[_0x3615('0x1e')](_0x4fc315['first_name'])?_0x4fc315['first_name']+'\x20'+_0x4fc315[_0x3615('0x4c')]:_0x4fc315['last_name'],'id':_0x4fc315['id']};_0x3bb0a2['Subject']=intUtil['getString'](_0x526039['Subjects'],_0x33aabf,'\x20');_0x3bb0a2[_0x3615('0x5c')]=intUtil['getString'](_0x526039['Descriptions'],_0x33aabf,'\x0a');if(_0x58bf4b['enduserType']===_0x3615('0x55')){_0x3bb0a2[_0x3615('0x5d')]={'name':!_[_0x3615('0x1e')](_0x58bf4b[_0x3615('0x5e')])?_0x58bf4b[_0x3615('0x5e')]:!_[_0x3615('0x1e')](_0x58bf4b[_0x3615('0x5f')])?_0x58bf4b['First_Name']+'\x20'+_0x58bf4b[_0x3615('0x60')]:_0x58bf4b[_0x3615('0x60')],'id':_0x58bf4b['id']};}if(_0x58bf4b['enduserType']===_0x3615('0x57')){_0x3bb0a2[_0x3615('0x61')]={'name':!_[_0x3615('0x1e')](_0x58bf4b[_0x3615('0x5e')])?_0x58bf4b[_0x3615('0x5e')]:!_[_0x3615('0x1e')](_0x58bf4b[_0x3615('0x5f')])?_0x58bf4b['First_Name']+'\x20'+_0x58bf4b[_0x3615('0x60')]:_0x58bf4b[_0x3615('0x60')],'id':_0x58bf4b['id']};_0x3bb0a2[_0x3615('0x62')]=_[_0x3615('0x48')](_0x58bf4b[_0x3615('0x45')]);}if(_0x33aabf['talktime']){_0x3bb0a2[_0x3615('0x63')]=moment[_0x3615('0x64')](parseInt(_0x33aabf['talktime'])*0x3e8)[_0x3615('0x32')](_0x3615('0x65'));}else if(_0x33aabf[_0x3615('0x66')]&&_0x33aabf[_0x3615('0x67')]){_0x3bb0a2[_0x3615('0x63')]=moment[_0x3615('0x64')](moment(_0x33aabf[_0x3615('0x67')],_0x3615('0x68'))['diff'](moment(_0x33aabf[_0x3615('0x69')],_0x3615('0x68'))))[_0x3615('0x32')](_0x3615('0x65'));}switch(_0x33aabf[_0x3615('0x6a')]){case _0x3615('0x6b'):_0x3bb0a2['Call_Result']='Called';break;case'complete':case _0x3615('0x6c'):_0x3bb0a2[_0x3615('0x6d')]=_0x3615('0x6e');break;case _0x3615('0x6f'):_0x3bb0a2[_0x3615('0x6d')]='Rejected';break;case _0x3615('0x70'):_0x3bb0a2[_0x3615('0x6d')]=_0x3615('0x71');break;case _0x3615('0x72'):_0x3bb0a2[_0x3615('0x6d')]=_0x3615('0x73');default:}_0x3bb0a2[_0x3615('0x74')]=(_0xe9675a==='outbound'?moment(_0x33aabf[_0x3615('0x69')])[_0x3615('0x32')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x33aabf[_0x3615('0x75')])[_0x3615('0x32')]('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x3615('0x32')]('YYYY-MM-DDTHH:mm:ss');_0x3bb0a2['Call_Type']=_0xe9675a||_0x3615('0x76');_0x3bb0a2=_[_0x3615('0x77')](_0x3bb0a2,getCustomFields(_0x526039[_0x3615('0x78')],_0x33aabf));return request({'method':_0x3615('0x27'),'uri':_0x3615('0x46')+_0x3f1302+_0x3615('0x79'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x28b78e},'body':{'data':[_0x3bb0a2]},'json':!![]})[_0x3615('0x43')](function(_0xcb04a7){if(_0xcb04a7&&_0xcb04a7['data'][0x0][_0x3615('0x7a')]==='SUCCESS'){logger[_0x3615('0x2f')]('Call\x20created!');return{'id':_0xcb04a7[_0x3615('0x44')][0x0]['details']['id']};}})[_0x3615('0x2d')](function(_0x3e3354){logger[_0x3615('0x2f')](_0x3615('0x7b'),_0x3e3354['stack']);console[_0x3615('0x7c')](_0x3615('0x7b'),_0x3e3354);});}exports['queue']=function(_0x59ce29,_0x1f9909,_0x542801,_0x36d176,_0x40c16c,_0x1a3472){var _0x22060d,_0x5ab29b,_0x25b10e;_0x1a3472['host']=intUtil[_0x3615('0x7d')](_0x1a3472['host']);_0x1a3472[_0x3615('0x7e')]=intUtil[_0x3615('0x7d')](_0x1a3472['serverUrl']);if(_0x40c16c&&_0x40c16c[_0x3615('0x7f')]){logger[_0x3615('0x2f')](_0x3615('0x80'),_0x3615('0x81'));_0x1f9909[_0x3615('0x82')]=_0x1a3472['serverUrl']+_0x3615('0x83')+_0x1f9909[_0x3615('0x84')]+_0x3615('0x85')+md5(_0x1f9909[_0x3615('0x84')]);}else{_0x1f9909['recordingURL']='';}var _0x1086e9=_0x1a3472[_0x3615('0x86')]===_0x3615('0x87')?'eu':_0x3615('0x88');return getAccessToken(_0x1a3472)[_0x3615('0x43')](function(_0x19d8d5){_0x25b10e=_0x19d8d5;return getUser(_0x25b10e,_0x1086e9,_0x1a3472,_0x36d176[_0x3615('0x39')]);})[_0x3615('0x43')](function(_0x559f4c){_0x22060d=_0x559f4c;logger[_0x3615('0x2f')](_0x3615('0x89'),_0x22060d['id']);return getEndUser(_0x25b10e,_0x1086e9,_0x1a3472,_0x1f9909['calleridname'],_0x1f9909[_0x3615('0x8a')],_0x22060d,_0x542801);})['then'](function(_0x28864b){_0x5ab29b=_0x28864b;return getCall(_0x25b10e,_0x1086e9,_0x1a3472,_0x22060d,_0x5ab29b,_0x542801,_0x1f9909,_0x3615('0x76'));})[_0x3615('0x43')](function(_0x1d3ee5){if(_0x1d3ee5){logger[_0x3615('0x2f')](_0x3615('0x8b'),_0x1d3ee5['id']);logger['info'](_0x3615('0x80'),_0x3615('0x8c'));emit(util[_0x3615('0x32')](_0x3615('0x8d'),_0x36d176['name']),_0x3615('0x8e'),{'uri':_0x3615('0x8f')+_0x1a3472[_0x3615('0x86')]+_0x3615('0x90')+_0x1d3ee5['id']});}})[_0x3615('0x2d')](function(_0x5c2bfc){logger[_0x3615('0x3f')]('[QUEUE]',JSON[_0x3615('0x41')](_0x5c2bfc));});};exports[_0x3615('0x91')]=function(_0x2f4f38,_0x1d4c0f,_0x4fef36,_0x4ca360,_0x2a1e6e,_0x39f1ab,_0x312e50){var _0xb0f684,_0x2a8696,_0x9594be;_0x39f1ab['host']=intUtil['stripTrailingSlash'](_0x39f1ab[_0x3615('0x86')]);_0x39f1ab[_0x3615('0x7e')]=intUtil[_0x3615('0x7d')](_0x39f1ab['serverUrl']);if(_0x312e50&&_0x312e50[_0x3615('0x92')]&&_0x312e50['recordingFormat']!==_0x3615('0x93')){logger[_0x3615('0x2f')]('[OUTBOUND]',_0x3615('0x81'));_0x1d4c0f[_0x3615('0x82')]=_0x39f1ab[_0x3615('0x7e')]+'/api/voice/recordings/'+_0x1d4c0f[_0x3615('0x84')]+'/downloads?type=uniqueid&token='+md5(_0x1d4c0f[_0x3615('0x84')]);}var _0x121e62=_0x39f1ab['host']===_0x3615('0x87')?'eu':_0x3615('0x88');return getAccessToken(_0x39f1ab)[_0x3615('0x43')](function(_0x5d2975){_0x9594be=_0x5d2975;return getUser(_0x9594be,_0x121e62,_0x39f1ab,_0x4ca360[_0x3615('0x39')]);})[_0x3615('0x43')](function(_0x3d47e2){_0xb0f684=_0x3d47e2;logger[_0x3615('0x2f')]('The\x20User\x20ID\x20is:',_0xb0f684['id']);return getEndUser(_0x9594be,_0x121e62,_0x39f1ab,_0x1d4c0f[_0x3615('0x94')],_0x1d4c0f['destcalleridnum'],_0xb0f684,_0x4fef36);})[_0x3615('0x43')](function(_0x2e8a9a){_0x2a8696=_0x2e8a9a;return getCall(_0x9594be,_0x121e62,_0x39f1ab,_0xb0f684,_0x2a8696,_0x4fef36,_0x1d4c0f,_0x3615('0x95'));})[_0x3615('0x43')](function(_0x34c282){if(_0x34c282){logger[_0x3615('0x2f')](_0x3615('0x8b'),_0x34c282['id']);logger[_0x3615('0x2f')](_0x3615('0x96'),_0x3615('0x8c'));emit(util[_0x3615('0x32')]('user:%s',_0x4ca360[_0x3615('0x19')]),'trigger:browser:url',{'uri':_0x3615('0x8f')+_0x39f1ab[_0x3615('0x86')]+_0x3615('0x90')+_0x34c282['id']});}})[_0x3615('0x2d')](function(_0x36a6da){logger[_0x3615('0x3f')](_0x3615('0x96'),JSON[_0x3615('0x41')](_0x36a6da));});};exports[_0x3615('0x97')]=function(_0x6361e1,_0x4ca8e8,_0x9e74c3,_0x2b79f6,_0x395f0b,_0x242820){var _0x293f67,_0x11e610,_0x85210d;_0x242820[_0x3615('0x86')]=intUtil[_0x3615('0x7d')](_0x242820[_0x3615('0x86')]);_0x242820['serverUrl']=intUtil['stripTrailingSlash'](_0x242820[_0x3615('0x7e')]);if(_0x395f0b&&_0x395f0b['monitor_format']){logger[_0x3615('0x2f')]('['+_0x4ca8e8['lastevent'][_0x3615('0x98')]()+']',_0x3615('0x81'));_0x4ca8e8['recordingURL']=_0x242820[_0x3615('0x7e')]+_0x3615('0x83')+_0x4ca8e8[_0x3615('0x84')]+_0x3615('0x85')+md5(_0x4ca8e8['uniqueid']);}else{_0x4ca8e8[_0x3615('0x82')]='';}var _0x5f447d=_0x242820[_0x3615('0x86')]===_0x3615('0x87')?'eu':_0x3615('0x88');return getAccessToken(_0x242820)[_0x3615('0x43')](function(_0x4a36a4){_0x85210d=_0x4a36a4;return getUser(_0x85210d,_0x5f447d,_0x242820);})['then'](function(_0x55bbec){_0x293f67=_0x55bbec;logger[_0x3615('0x2f')](_0x3615('0x89'),_0x293f67['id']);return getEndUser(_0x85210d,_0x5f447d,_0x242820,_0x4ca8e8[_0x3615('0x99')],_0x4ca8e8[_0x3615('0x8a')],_0x293f67,_0x9e74c3);})['then'](function(_0x166ed2){_0x11e610=_0x166ed2;return getCall(_0x85210d,_0x5f447d,_0x242820,_0x293f67,_0x11e610,_0x9e74c3,_0x4ca8e8,_0x3615('0x76'));})[_0x3615('0x43')](function(_0x3c4b26){if(_0x3c4b26){logger[_0x3615('0x2f')](_0x3615('0x8b'),_0x3c4b26['id']);}})[_0x3615('0x2d')](function(_0x4a8317){logger[_0x3615('0x3f')]('['+_0x4ca8e8['lastevent'][_0x3615('0x98')]()+']',JSON[_0x3615('0x41')](_0x4a8317));});};
\ No newline at end of file
+var _0x4f9d=['seconds','catch','error','Failing\x20creating\x20the\x20access_token','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','code','SUCCESS','details','moduleCreate','Error:\x20','log','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','lead','Leads','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','First_Name','Last_Name','Full_Name','$se_module','talktime','Call_Duration','mm:ss','answertime','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','complete','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','merge','Fields','/crm/v2/Calls','Call\x20created!','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','Outbound','unmanaged','toUpperCase','Inbound','lodash','request-promise','md5','./util','moment','ioredis','bluebird','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','debug','stringify','length','forEach','includes','string','type','idField','content','variable','variableName','customVariable','Variable','name','toLowerCase','toString','indexOf','split','isNil','access_token','isBefore','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','add','expires_in'];(function(_0xe139df,_0x411eea){var _0x478feb=function(_0x4dada9){while(--_0x4dada9){_0xe139df['push'](_0xe139df['shift']());}};_0x478feb(++_0x411eea);}(_0x4f9d,0x1b3));var _0xd4f9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4f9d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd4f9('0x0'));var rp=require(_0xd4f9('0x1'));var md5=require(_0xd4f9('0x2'));var util=require('util');var intUtil=require(_0xd4f9('0x3'));var moment=require(_0xd4f9('0x4'));var Redis=require(_0xd4f9('0x5'));var BPromise=require(_0xd4f9('0x6'));var config=require(_0xd4f9('0x7'));var logger=require('../../../../config/logger')('zoho');config[_0xd4f9('0x8')]=_[_0xd4f9('0x9')](config['redis'],{'host':_0xd4f9('0xa'),'port':0x18eb});var io=require(_0xd4f9('0xb'))(new Redis(config[_0xd4f9('0x8')]));function emit(_0x151221,_0x50beca,_0x448522){io['to'](_0x151221)[_0xd4f9('0xc')](_0x50beca,_0x448522);}function request(_0x419183){logger[_0xd4f9('0xd')]('[HTTP]',JSON[_0xd4f9('0xe')](_0x419183));return rp(_0x419183);}function getCustomFields(_0x2f9635,_0x280c18){var _0xe665a2={};if(_0x2f9635[_0xd4f9('0xf')]>0x0){_[_0xd4f9('0x10')](_0x2f9635,function(_0x4fc909){if(_[_0xd4f9('0x11')]([_0xd4f9('0x12'),'picklist'],_0x4fc909[_0xd4f9('0x13')])&&_0x4fc909[_0xd4f9('0x14')]){_0xe665a2[_0x4fc909[_0xd4f9('0x14')]]=_0x4fc909[_0xd4f9('0x15')]['toString']();}else if(_0x4fc909[_0xd4f9('0x13')]===_0xd4f9('0x16')&&_0x4fc909['variableName']&&_0x4fc909['idField']&&_0x280c18[_0x4fc909[_0xd4f9('0x17')]]){_0xe665a2[_0x4fc909[_0xd4f9('0x14')]]=_0x280c18[_0x4fc909[_0xd4f9('0x17')]]['toString']();}else if(_0x4fc909[_0xd4f9('0x13')]===_0xd4f9('0x18')&&_0x4fc909[_0xd4f9('0x19')]&&_0x4fc909[_0xd4f9('0x19')][_0xd4f9('0x1a')]&&_0x4fc909[_0xd4f9('0x14')]&&_0x280c18[_0x4fc909[_0xd4f9('0x19')]['name'][_0xd4f9('0x1b')]()]){_0xe665a2[_0x4fc909[_0xd4f9('0x14')]]=_0x280c18[_0x4fc909[_0xd4f9('0x19')][_0xd4f9('0x1a')][_0xd4f9('0x1b')]()][_0xd4f9('0x1c')]();}});}return _0xe665a2;}function getName(_0x59efe3){if(_0x59efe3[_0xd4f9('0x1d')]('\x20')>0x0){var _0x52cbf5=_0x59efe3[_0xd4f9('0x1e')](/ (.+)/);if(_0x52cbf5[0x1]){return _0x52cbf5;}}return[_0x59efe3,_0x59efe3];}var accountsTokens={};function getAccessToken(_0x3d26e6){return new Promise(function(_0x37ff63,_0x13af7f){if(!_['isNil'](accountsTokens[_0x3d26e6['id']])&&!_[_0xd4f9('0x1f')](accountsTokens[_0x3d26e6['id']][_0xd4f9('0x20')])){if(moment()[_0xd4f9('0x21')](accountsTokens[_0x3d26e6['id']]['expires_in'])){_0x37ff63(accountsTokens[_0x3d26e6['id']][_0xd4f9('0x20')]);}}var _0x295cce;switch(_0x3d26e6['zone']){case'US':_0x295cce=_0xd4f9('0x22');break;case'AU':_0x295cce='https://accounts.zoho.com.au';break;case'EU':_0x295cce=_0xd4f9('0x23');break;case'IN':_0x295cce=_0xd4f9('0x24');break;case'CN':_0x295cce=_0xd4f9('0x25');break;default:_0x295cce=_0xd4f9('0x23');break;}var _0x385aef={'method':_0xd4f9('0x26'),'uri':_0x295cce+_0xd4f9('0x27'),'qs':{'refresh_token':_0x3d26e6[_0xd4f9('0x28')],'client_id':_0x3d26e6[_0xd4f9('0x29')],'client_secret':_0x3d26e6[_0xd4f9('0x2a')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x385aef)['then'](function(_0x43b705){accountsTokens[_0x3d26e6['id']]={'access_token':_0x43b705[_0xd4f9('0x20')],'expires_in':moment()[_0xd4f9('0x2b')](_0x43b705[_0xd4f9('0x2c')],_0xd4f9('0x2d'))};_0x37ff63(_0x43b705[_0xd4f9('0x20')]);})[_0xd4f9('0x2e')](function(_0x42321f){logger[_0xd4f9('0x2f')](_0xd4f9('0x30'),_0x42321f['stack']);_0x13af7f(_0x42321f);});});}function getUser(_0x3b9676,_0x5937b2,_0x13d2c1,_0x350295){logger['info']('Search\x20user');return request({'method':_0xd4f9('0x31'),'uri':util[_0xd4f9('0x32')](_0xd4f9('0x33'),_0x5937b2),'qs':{'type':_0xd4f9('0x34')},'headers':{'Authorization':_0xd4f9('0x35')+_0x3b9676},'json':!![]})[_0xd4f9('0x36')](function(_0x348ee6){if(_0x348ee6[_0xd4f9('0x37')]){var _0x555f6e=-0x1;if(_[_0xd4f9('0x38')](_0x348ee6[_0xd4f9('0x37')])){if(!_[_0xd4f9('0x1f')](_0x350295)){_0x555f6e=_[_0xd4f9('0x39')](_0x348ee6[_0xd4f9('0x37')],function(_0x38f903){return _0x38f903[_0xd4f9('0x3a')]===_0x350295;});}if(_0x555f6e>=0x0){logger[_0xd4f9('0x3b')](_0xd4f9('0x3c'));}else{logger['info'](_0xd4f9('0x3d'));_0x555f6e=_[_0xd4f9('0x39')](_0x348ee6[_0xd4f9('0x37')],function(_0x44e33b){return _0x44e33b[_0xd4f9('0x3e')][_0xd4f9('0x1a')]===_0xd4f9('0x3f');});}return _0x348ee6['users'][_0x555f6e];}else{if(_0x348ee6[_0xd4f9('0x40')][_0xd4f9('0x3e')][_0xd4f9('0x1a')]===_0xd4f9('0x3f')){logger['info']('Using\x20the\x20admin\x20account!');user=_0x348ee6[_0xd4f9('0x40')];return user;}else{logger[_0xd4f9('0x2f')](_0xd4f9('0x41'),JSON[_0xd4f9('0xe')](_0x348ee6));throw new Error(_0xd4f9('0x42')+JSON[_0xd4f9('0xe')](_0x348ee6));}}}else{logger[_0xd4f9('0x2f')](_0xd4f9('0x41'),JSON['stringify'](_0x348ee6));throw new Error(_0xd4f9('0x42')+JSON['stringify'](_0x348ee6));}})[_0xd4f9('0x2e')](function(_0x28f2ee){console[_0xd4f9('0x2f')](_0x28f2ee);});}function getZohoUser(_0x44230c,_0x20648c){return new BPromise(function(_0x1baab4,_0x1429ea){request(_0x44230c)[_0xd4f9('0x36')](function(_0x5cc18d){var _0xaabd8f=null;if(_0x5cc18d){_0xaabd8f=_0x5cc18d[_0xd4f9('0x43')][0x0];_0xaabd8f[_0xd4f9('0x44')]=_0x20648c;}_0x1baab4(_0xaabd8f);})['catch'](function(_0x50761d){_0x1429ea(_0x50761d);});});}function createEndUser(_0x32bd8b,_0x9268a,_0x3eb62f,_0x1d4ff8,_0x3c5499,_0x41ad65){var _0x3eb62f=getName(_0x3eb62f);return request({'method':_0xd4f9('0x26'),'uri':_0xd4f9('0x45')+_0x9268a+_0xd4f9('0x46')+_[_0xd4f9('0x47')](_0x41ad65['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x3eb62f[0x1],'First_Name':_0x3eb62f[0x0],'Phone':_0x1d4ff8,'Owner':{'name':!_[_0xd4f9('0x1f')](_0x3c5499[_0xd4f9('0x48')][_0xd4f9('0x1a')])?_0x3c5499['role']['name']:!_[_0xd4f9('0x1f')](_0x3c5499[_0xd4f9('0x49')])?_0x3c5499[_0xd4f9('0x49')]+'\x20'+_0x3c5499[_0xd4f9('0x4a')]:_0x3c5499[_0xd4f9('0x4a')],'id':_0x3c5499['id']}}]},'headers':{'Authorization':_0xd4f9('0x35')+_0x32bd8b},'json':!![]})[_0xd4f9('0x36')](function(_0x2df27e){if(_0x2df27e&&_0x2df27e[_0xd4f9('0x43')][0x0][_0xd4f9('0x4b')]===_0xd4f9('0x4c')){var _0x3650dc=_0x2df27e[_0xd4f9('0x43')][0x0][_0xd4f9('0x4d')];_0x3650dc[_0xd4f9('0x44')]=_[_0xd4f9('0x47')](_0x41ad65[_0xd4f9('0x4e')])+'s';return _0x3650dc;}logger['error'](_0xd4f9('0x41'),JSON[_0xd4f9('0xe')](data));throw new Error(_0xd4f9('0x4f')+JSON['stringify'](data));})[_0xd4f9('0x2e')](function(_0x2d1243){console[_0xd4f9('0x50')]('CREATE\x20ERROR',_0x2d1243);});}function getEndUser(_0x34ea4e,_0x43574c,_0x380433,_0x224db3,_0x22d941,_0x39ad48,_0x3d6f4d){var _0x182394={'method':_0xd4f9('0x31'),'uri':'','headers':{'Authorization':_0xd4f9('0x35')+_0x34ea4e},'json':!![]};switch(_0x3d6f4d[_0xd4f9('0x51')]){case'contact_lead':_0x182394[_0xd4f9('0x52')]='https://www.zohoapis.'+_0x43574c+_0xd4f9('0x53')+_0x22d941+'))';return getZohoUser(_0x182394,_0xd4f9('0x54'))['then'](function(_0xfe929){if(_0xfe929)return _0xfe929;_0x182394['uri']='https://www.zohoapis.'+_0x43574c+_0xd4f9('0x55')+_0x22d941+'))';return getZohoUser(_0x182394,'Leads')[_0xd4f9('0x36')](function(_0x23034b){if(_0x23034b)return _0x23034b;if(_0x3d6f4d[_0xd4f9('0x4e')]!='nothing'){return createEndUser(_0x34ea4e,_0x43574c,_0x224db3,_0x22d941,_0x39ad48,_0x3d6f4d);}else{return{};}});});break;case'contact':_0x182394['uri']=_0xd4f9('0x45')+_0x43574c+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x22d941+'))';return getZohoUser(_0x182394,'Contacts')[_0xd4f9('0x36')](function(_0x32c89f){if(_0x32c89f)return _0x32c89f;if(_0x3d6f4d['moduleCreate']!=_0xd4f9('0x56')){return createEndUser(_0x34ea4e,_0x43574c,_0x224db3,_0x22d941,_0x39ad48,_0x3d6f4d);}else{return{};}});break;case _0xd4f9('0x57'):_0x182394['uri']=_0xd4f9('0x45')+_0x43574c+_0xd4f9('0x55')+_0x22d941+'))';return getZohoUser(_0x182394,_0xd4f9('0x58'))[_0xd4f9('0x36')](function(_0x4eb65c){if(_0x4eb65c)return _0x4eb65c;if(_0x3d6f4d[_0xd4f9('0x4e')]!=_0xd4f9('0x56')){return createEndUser(_0x34ea4e,_0x43574c,_0x224db3,_0x22d941,_0x39ad48,_0x3d6f4d);}else{return{};}});break;}}function getCall(_0x43ab8c,_0x13e80,_0x24a5da,_0x5eb246,_0x5b5998,_0x9f3ca6,_0x5ba300,_0x388f99){logger[_0xd4f9('0x3b')](_0xd4f9('0x59'));var _0x110ba0={};_0x110ba0[_0xd4f9('0x5a')]={'name':!_[_0xd4f9('0x1f')](_0x5eb246[_0xd4f9('0x48')][_0xd4f9('0x1a')])&&!_['isNil'](_0x5eb246[_0xd4f9('0x3e')][_0xd4f9('0x1a')])&&_0x5eb246[_0xd4f9('0x3e')][_0xd4f9('0x1a')]===_0xd4f9('0x5b')?_0x5eb246[_0xd4f9('0x48')][_0xd4f9('0x1a')]:!_['isNil'](_0x5eb246[_0xd4f9('0x49')])?_0x5eb246['first_name']+'\x20'+_0x5eb246[_0xd4f9('0x4a')]:_0x5eb246['last_name'],'id':_0x5eb246['id']};_0x110ba0[_0xd4f9('0x5c')]=intUtil[_0xd4f9('0x5d')](_0x9f3ca6[_0xd4f9('0x5e')],_0x5ba300,'\x20');_0x110ba0[_0xd4f9('0x5f')]=intUtil[_0xd4f9('0x5d')](_0x9f3ca6[_0xd4f9('0x60')],_0x5ba300,'\x0a');if(_0x5b5998[_0xd4f9('0x44')]===_0xd4f9('0x54')){_0x110ba0[_0xd4f9('0x61')]={'name':!_[_0xd4f9('0x1f')](_0x5b5998['Full_Name'])?_0x5b5998['Full_Name']:!_[_0xd4f9('0x1f')](_0x5b5998[_0xd4f9('0x62')])?_0x5b5998[_0xd4f9('0x62')]+'\x20'+_0x5b5998[_0xd4f9('0x63')]:_0x5b5998[_0xd4f9('0x63')],'id':_0x5b5998['id']};}if(_0x5b5998[_0xd4f9('0x44')]===_0xd4f9('0x58')){_0x110ba0['What_Id']={'name':!_[_0xd4f9('0x1f')](_0x5b5998['Full_Name'])?_0x5b5998[_0xd4f9('0x64')]:!_['isNil'](_0x5b5998['First_Name'])?_0x5b5998[_0xd4f9('0x62')]+'\x20'+_0x5b5998[_0xd4f9('0x63')]:_0x5b5998[_0xd4f9('0x63')],'id':_0x5b5998['id']};_0x110ba0[_0xd4f9('0x65')]=_[_0xd4f9('0x47')](_0x5b5998[_0xd4f9('0x44')]);}if(_0x5ba300[_0xd4f9('0x66')]){_0x110ba0[_0xd4f9('0x67')]=moment['utc'](parseInt(_0x5ba300[_0xd4f9('0x66')])*0x3e8)[_0xd4f9('0x32')](_0xd4f9('0x68'));}else if(_0x5ba300[_0xd4f9('0x69')]&&_0x5ba300[_0xd4f9('0x6a')]){_0x110ba0[_0xd4f9('0x67')]=moment['utc'](moment(_0x5ba300[_0xd4f9('0x6a')],'YYYY-MM-DDTHH:mm:ss')[_0xd4f9('0x6b')](moment(_0x5ba300[_0xd4f9('0x6c')],_0xd4f9('0x6d'))))[_0xd4f9('0x32')](_0xd4f9('0x68'));}switch(_0x5ba300[_0xd4f9('0x6e')]){case _0xd4f9('0x6f'):_0x110ba0[_0xd4f9('0x70')]=_0xd4f9('0x71');break;case _0xd4f9('0x72'):case'connect':_0x110ba0[_0xd4f9('0x70')]=_0xd4f9('0x73');break;case _0xd4f9('0x74'):_0x110ba0[_0xd4f9('0x70')]=_0xd4f9('0x75');break;case _0xd4f9('0x76'):_0x110ba0[_0xd4f9('0x70')]=_0xd4f9('0x77');break;case _0xd4f9('0x78'):_0x110ba0[_0xd4f9('0x70')]=_0xd4f9('0x79');default:}_0x110ba0[_0xd4f9('0x7a')]=(_0x388f99===_0xd4f9('0x7b')?moment(_0x5ba300[_0xd4f9('0x6c')])[_0xd4f9('0x32')](_0xd4f9('0x6d')):moment(_0x5ba300[_0xd4f9('0x7c')])['format'](_0xd4f9('0x6d')))||moment()[_0xd4f9('0x32')](_0xd4f9('0x6d'));_0x110ba0[_0xd4f9('0x7d')]=_0x388f99||'Inbound';_0x110ba0=_[_0xd4f9('0x7e')](_0x110ba0,getCustomFields(_0x9f3ca6[_0xd4f9('0x7f')],_0x5ba300));return request({'method':'POST','uri':_0xd4f9('0x45')+_0x13e80+_0xd4f9('0x80'),'headers':{'Authorization':_0xd4f9('0x35')+_0x43ab8c},'body':{'data':[_0x110ba0]},'json':!![]})[_0xd4f9('0x36')](function(_0x2e388d){if(_0x2e388d&&_0x2e388d[_0xd4f9('0x43')][0x0][_0xd4f9('0x4b')]===_0xd4f9('0x4c')){logger[_0xd4f9('0x3b')](_0xd4f9('0x81'));return{'id':_0x2e388d[_0xd4f9('0x43')][0x0][_0xd4f9('0x4d')]['id']};}})['catch'](function(_0x470ce5){logger['info'](_0xd4f9('0x82'),_0x470ce5['stack']);console['log'](_0xd4f9('0x82'),_0x470ce5);});}exports['queue']=function(_0x2a5974,_0x3b1102,_0x68434,_0x434b79,_0x18f826,_0x432119){var _0x42ad97,_0x30b229,_0x2b9a99;_0x432119[_0xd4f9('0x83')]=intUtil[_0xd4f9('0x84')](_0x432119[_0xd4f9('0x83')]);_0x432119[_0xd4f9('0x85')]=intUtil['stripTrailingSlash'](_0x432119['serverUrl']);if(_0x18f826&&_0x18f826[_0xd4f9('0x86')]){logger[_0xd4f9('0x3b')](_0xd4f9('0x87'),'Recording\x20is\x20enabled!');_0x3b1102[_0xd4f9('0x88')]=_0x432119[_0xd4f9('0x85')]+_0xd4f9('0x89')+_0x3b1102['uniqueid']+_0xd4f9('0x8a')+md5(_0x3b1102[_0xd4f9('0x8b')]);}else{_0x3b1102[_0xd4f9('0x88')]='';}var _0x418ec9=_0x432119['host']===_0xd4f9('0x8c')?'eu':_0xd4f9('0x8d');return getAccessToken(_0x432119)[_0xd4f9('0x36')](function(_0x347a75){_0x2b9a99=_0x347a75;return getUser(_0x2b9a99,_0x418ec9,_0x432119,_0x434b79[_0xd4f9('0x3a')]);})[_0xd4f9('0x36')](function(_0x5e3ea3){_0x42ad97=_0x5e3ea3;logger['info'](_0xd4f9('0x8e'),_0x42ad97['id']);return getEndUser(_0x2b9a99,_0x418ec9,_0x432119,_0x3b1102[_0xd4f9('0x8f')],_0x3b1102[_0xd4f9('0x90')],_0x42ad97,_0x68434);})[_0xd4f9('0x36')](function(_0x1aef96){_0x30b229=_0x1aef96;return getCall(_0x2b9a99,_0x418ec9,_0x432119,_0x42ad97,_0x30b229,_0x68434,_0x3b1102,'Inbound');})[_0xd4f9('0x36')](function(_0xead88a){if(_0xead88a){logger['info'](_0xd4f9('0x91'),_0xead88a['id']);logger['info'](_0xd4f9('0x87'),_0xd4f9('0x92'));emit(util['format'](_0xd4f9('0x93'),_0x434b79[_0xd4f9('0x1a')]),_0xd4f9('0x94'),{'uri':_0xd4f9('0x95')+_0x432119['host']+_0xd4f9('0x96')+_0xead88a['id']});}})[_0xd4f9('0x2e')](function(_0x36165c){logger[_0xd4f9('0x2f')](_0xd4f9('0x87'),JSON[_0xd4f9('0xe')](_0x36165c));});};exports[_0xd4f9('0x7b')]=function(_0x44f8c4,_0x26a158,_0xf46a5b,_0x175c6f,_0x2099dc,_0x392fd2,_0x21c078){var _0x4a704d,_0x424462,_0x27071d;_0x392fd2[_0xd4f9('0x83')]=intUtil[_0xd4f9('0x84')](_0x392fd2['host']);_0x392fd2[_0xd4f9('0x85')]=intUtil[_0xd4f9('0x84')](_0x392fd2[_0xd4f9('0x85')]);if(_0x21c078&&_0x21c078[_0xd4f9('0x97')]&&_0x21c078[_0xd4f9('0x97')]!==_0xd4f9('0x98')){logger[_0xd4f9('0x3b')](_0xd4f9('0x99'),_0xd4f9('0x9a'));_0x26a158[_0xd4f9('0x88')]=_0x392fd2[_0xd4f9('0x85')]+'/api/voice/recordings/'+_0x26a158['uniqueid']+_0xd4f9('0x8a')+md5(_0x26a158[_0xd4f9('0x8b')]);}var _0x5286a0=_0x392fd2[_0xd4f9('0x83')]===_0xd4f9('0x8c')?'eu':'com';return getAccessToken(_0x392fd2)[_0xd4f9('0x36')](function(_0x1d3590){_0x27071d=_0x1d3590;return getUser(_0x27071d,_0x5286a0,_0x392fd2,_0x175c6f[_0xd4f9('0x3a')]);})[_0xd4f9('0x36')](function(_0x18d568){_0x4a704d=_0x18d568;logger[_0xd4f9('0x3b')](_0xd4f9('0x8e'),_0x4a704d['id']);return getEndUser(_0x27071d,_0x5286a0,_0x392fd2,_0x26a158['destcalleridname'],_0x26a158[_0xd4f9('0x9b')],_0x4a704d,_0xf46a5b);})[_0xd4f9('0x36')](function(_0x1fbd1f){_0x424462=_0x1fbd1f;return getCall(_0x27071d,_0x5286a0,_0x392fd2,_0x4a704d,_0x424462,_0xf46a5b,_0x26a158,_0xd4f9('0x9c'));})[_0xd4f9('0x36')](function(_0x142898){if(_0x142898){logger[_0xd4f9('0x3b')](_0xd4f9('0x91'),_0x142898['id']);logger[_0xd4f9('0x3b')]('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd4f9('0x32')](_0xd4f9('0x93'),_0x175c6f[_0xd4f9('0x1a')]),'trigger:browser:url',{'uri':'https://crm.'+_0x392fd2[_0xd4f9('0x83')]+'/crm/EntityInfo.do?module=Calls&id='+_0x142898['id']});}})['catch'](function(_0x215f0b){logger[_0xd4f9('0x2f')](_0xd4f9('0x99'),JSON['stringify'](_0x215f0b));});};exports[_0xd4f9('0x9d')]=function(_0xc115b9,_0x147656,_0x1c1fa5,_0x5a3273,_0x9a01cd,_0x4a099c){var _0x3e53f1,_0x523c87,_0x214a9f;_0x4a099c[_0xd4f9('0x83')]=intUtil[_0xd4f9('0x84')](_0x4a099c[_0xd4f9('0x83')]);_0x4a099c[_0xd4f9('0x85')]=intUtil[_0xd4f9('0x84')](_0x4a099c[_0xd4f9('0x85')]);if(_0x9a01cd&&_0x9a01cd['monitor_format']){logger[_0xd4f9('0x3b')]('['+_0x147656['lastevent'][_0xd4f9('0x9e')]()+']','Recording\x20is\x20enabled!');_0x147656[_0xd4f9('0x88')]=_0x4a099c[_0xd4f9('0x85')]+_0xd4f9('0x89')+_0x147656[_0xd4f9('0x8b')]+_0xd4f9('0x8a')+md5(_0x147656['uniqueid']);}else{_0x147656[_0xd4f9('0x88')]='';}var _0x42b965=_0x4a099c[_0xd4f9('0x83')]===_0xd4f9('0x8c')?'eu':_0xd4f9('0x8d');return getAccessToken(_0x4a099c)[_0xd4f9('0x36')](function(_0xc1b7cb){_0x214a9f=_0xc1b7cb;return getUser(_0x214a9f,_0x42b965,_0x4a099c);})[_0xd4f9('0x36')](function(_0x58c3af){_0x3e53f1=_0x58c3af;logger[_0xd4f9('0x3b')]('The\x20User\x20ID\x20is:',_0x3e53f1['id']);return getEndUser(_0x214a9f,_0x42b965,_0x4a099c,_0x147656['calleridname'],_0x147656[_0xd4f9('0x90')],_0x3e53f1,_0x1c1fa5);})[_0xd4f9('0x36')](function(_0x39e3a3){_0x523c87=_0x39e3a3;return getCall(_0x214a9f,_0x42b965,_0x4a099c,_0x3e53f1,_0x523c87,_0x1c1fa5,_0x147656,_0xd4f9('0x9f'));})[_0xd4f9('0x36')](function(_0x15f70f){if(_0x15f70f){logger[_0xd4f9('0x3b')]('The\x20Call\x20ID\x20is:',_0x15f70f['id']);}})[_0xd4f9('0x2e')](function(_0x38ebd6){logger[_0xd4f9('0x2f')]('['+_0x147656['lastevent']['toUpperCase']()+']',JSON[_0xd4f9('0xe')](_0x38ebd6));});};
\ No newline at end of file
index 2eb8cdd..ada222b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa588=['%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','../../../../config/logger','trigger','exec','data2','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0xa588,0x91));var _0x8a58=function(_0x72493a,_0x158721){_0x72493a=_0x72493a-0x0;var _0x4c6027=_0xa588[_0x72493a];return _0x4c6027;};'use strict';var util=require(_0x8a58('0x0'));var sh=require(_0x8a58('0x1'));var Mustache=require('mustache');var logger=require(_0x8a58('0x2'))(_0x8a58('0x3'));exports[_0x8a58('0x4')]=function(_0x165586,_0x4a01cc){var _0x21239b=_0x165586[_0x8a58('0x5')]?_0x165586[_0x8a58('0x5')]:'Script';var _0x5e42f2=_0x165586['data3']?Mustache[_0x8a58('0x6')](_0x165586['data3'],_0x4a01cc):_0x4a01cc;sh['exec'](_0x5e42f2,function(_0x38395c,_0xb5018,_0x260b5b){if(_0x38395c!==0x0){logger[_0x8a58('0x7')](util[_0x8a58('0x8')](_0x8a58('0x9'),_0x21239b,_0x5e42f2,_0x38395c,_0x260b5b));}else{logger[_0x8a58('0xa')](util[_0x8a58('0x8')](_0x8a58('0xb'),_0x21239b,_0x5e42f2,_0xb5018));}});};
\ No newline at end of file
+var _0x2c79=['Script','render','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','trigger','exec','data2'];(function(_0x7670a7,_0x5d628a){var _0xb6bb41=function(_0x11c7dc){while(--_0x11c7dc){_0x7670a7['push'](_0x7670a7['shift']());}};_0xb6bb41(++_0x5d628a);}(_0x2c79,0x173));var _0x92c7=function(_0x468323,_0x17aae3){_0x468323=_0x468323-0x0;var _0x21b8ad=_0x2c79[_0x468323];return _0x21b8ad;};'use strict';var util=require(_0x92c7('0x0'));var sh=require(_0x92c7('0x1'));var Mustache=require(_0x92c7('0x2'));var logger=require('../../../../config/logger')(_0x92c7('0x3'));exports[_0x92c7('0x4')]=function(_0x52ddcb,_0x2f6b97){var _0x3eb5f3=_0x52ddcb['data2']?_0x52ddcb[_0x92c7('0x5')]:_0x92c7('0x6');var _0x429208=_0x52ddcb['data3']?Mustache[_0x92c7('0x7')](_0x52ddcb[_0x92c7('0x8')],_0x2f6b97):_0x2f6b97;sh[_0x92c7('0x4')](_0x429208,function(_0x204a3a,_0xa8927c,_0x940ce9){if(_0x204a3a!==0x0){logger[_0x92c7('0x9')](util[_0x92c7('0xa')](_0x92c7('0xb'),_0x3eb5f3,_0x429208,_0x204a3a,_0x940ce9));}else{logger['info'](util[_0x92c7('0xa')](_0x92c7('0xc'),_0x3eb5f3,_0x429208,_0xa8927c));}});};
\ No newline at end of file
index 2f4df86..1690047 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ed8=['PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify',',\x20request\x20body:\x20','format','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','mustache','../../../../config/logger','trigger','data1','toUpperCase','render','data2','data5','number','headers','data6','parse','error','stack','GET','DELETE'];(function(_0x501f29,_0xc10e6f){var _0x152fc7=function(_0x3575f0){while(--_0x3575f0){_0x501f29['push'](_0x501f29['shift']());}};_0x152fc7(++_0xc10e6f);}(_0x6ed8,0x8e));var _0x86ed=function(_0x40ea18,_0x1b4b71){_0x40ea18=_0x40ea18-0x0;var _0x23af1a=_0x6ed8[_0x40ea18];return _0x23af1a;};'use strict';var rp=require(_0x86ed('0x0'));var util=require(_0x86ed('0x1'));var _=require('lodash');var Mustache=require(_0x86ed('0x2'));var logger=require(_0x86ed('0x3'))(_0x86ed('0x4'));exports['exec']=function(_0x58d8f9,_0x57824e){var _0x19abcb,_0x422c5d;var _0x3ca9e6={'method':_0x58d8f9[_0x86ed('0x5')][_0x86ed('0x6')](),'uri':Mustache[_0x86ed('0x7')](_0x58d8f9[_0x86ed('0x8')],_0x57824e),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x58d8f9[_0x86ed('0x9')])===_0x86ed('0xa')&&parseInt(_0x58d8f9['data5'])>=0x1&&parseInt(_0x58d8f9[_0x86ed('0x9')])<=0xa?parseInt(_0x58d8f9[_0x86ed('0x9')])*0x3e8:0x5*0x3e8};try{_0x3ca9e6[_0x86ed('0xb')]=_0x58d8f9[_0x86ed('0xc')]?JSON[_0x86ed('0xd')](Mustache['render'](_0x58d8f9['data6'],_0x57824e)):{};}catch(_0x4440c6){logger[_0x86ed('0xe')](_0x4440c6[_0x86ed('0xf')]);}switch(_0x58d8f9[_0x86ed('0x5')]['toUpperCase']()){case _0x86ed('0x10'):case _0x86ed('0x11'):_0x19abcb=null;_0x3ca9e6['qs']=_0x57824e;break;case'POST':case _0x86ed('0x12'):if(_0x58d8f9[_0x86ed('0x13')]){try{_0x19abcb=JSON[_0x86ed('0xd')](Mustache[_0x86ed('0x7')](_0x58d8f9['data7'],_0x57824e));_0x3ca9e6[_0x86ed('0x14')]=_0x19abcb;}catch(_0x16e688){logger[_0x86ed('0xe')](_0x16e688['stack']);logger['error'](_0x86ed('0x15'));}}else{_0x19abcb=_0x57824e;_0x3ca9e6[_0x86ed('0x14')]=_0x19abcb;}break;}logger[_0x86ed('0x16')](util['format'](_0x86ed('0x17'),_0x58d8f9[_0x86ed('0x5')],_0x58d8f9['data2'],JSON[_0x86ed('0x18')](_0x3ca9e6)));rp(_0x3ca9e6)['then'](function(_0x25570a){_0x19abcb=!_['isNil'](_0x19abcb)?_0x86ed('0x19')+_0x19abcb:'';_0x422c5d=typeof _0x25570a[_0x86ed('0x14')]==='object'?JSON[_0x86ed('0x18')](_0x25570a['body']):_0x25570a['body'];logger[_0x86ed('0x16')](util[_0x86ed('0x1a')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x58d8f9[_0x86ed('0x5')],_0x58d8f9['data2'],_0x25570a[_0x86ed('0x1b')],_0x422c5d));})[_0x86ed('0x1c')](function(_0x7f119f){logger['error'](util[_0x86ed('0x1a')](_0x86ed('0x1d'),_0x58d8f9['data1'],_0x58d8f9['data2'],_0x7f119f['statusCode'],_0x7f119f[_0x86ed('0x1e')],_0x7f119f[_0x86ed('0x1f')]));});};
\ No newline at end of file
+var _0x9a3f=['data7','parse','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util','lodash','../../../../config/logger','trigger','data1','toUpperCase','render','data2','data5','number','headers','data6','error','GET','DELETE','POST','PUT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a3f,0x19e));var _0xf9a3=function(_0x2b97f0,_0x4be83d){_0x2b97f0=_0x2b97f0-0x0;var _0x419de9=_0x9a3f[_0x2b97f0];return _0x419de9;};'use strict';var rp=require(_0xf9a3('0x0'));var util=require(_0xf9a3('0x1'));var _=require(_0xf9a3('0x2'));var Mustache=require('mustache');var logger=require(_0xf9a3('0x3'))(_0xf9a3('0x4'));exports['exec']=function(_0x5c8eed,_0x31c2c9){var _0x4a4f8c,_0x26680c;var _0x50eb66={'method':_0x5c8eed[_0xf9a3('0x5')][_0xf9a3('0x6')](),'uri':Mustache[_0xf9a3('0x7')](_0x5c8eed[_0xf9a3('0x8')],_0x31c2c9),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5c8eed[_0xf9a3('0x9')])===_0xf9a3('0xa')&&parseInt(_0x5c8eed[_0xf9a3('0x9')])>=0x1&&parseInt(_0x5c8eed[_0xf9a3('0x9')])<=0xa?parseInt(_0x5c8eed[_0xf9a3('0x9')])*0x3e8:0x5*0x3e8};try{_0x50eb66[_0xf9a3('0xb')]=_0x5c8eed[_0xf9a3('0xc')]?JSON['parse'](Mustache[_0xf9a3('0x7')](_0x5c8eed[_0xf9a3('0xc')],_0x31c2c9)):{};}catch(_0x203769){logger[_0xf9a3('0xd')](_0x203769['stack']);}switch(_0x5c8eed[_0xf9a3('0x5')][_0xf9a3('0x6')]()){case _0xf9a3('0xe'):case _0xf9a3('0xf'):_0x4a4f8c=null;_0x50eb66['qs']=_0x31c2c9;break;case _0xf9a3('0x10'):case _0xf9a3('0x11'):if(_0x5c8eed[_0xf9a3('0x12')]){try{_0x4a4f8c=JSON[_0xf9a3('0x13')](Mustache['render'](_0x5c8eed[_0xf9a3('0x12')],_0x31c2c9));_0x50eb66[_0xf9a3('0x14')]=_0x4a4f8c;}catch(_0x34b75a){logger[_0xf9a3('0xd')](_0x34b75a[_0xf9a3('0x15')]);logger[_0xf9a3('0xd')](_0xf9a3('0x16'));}}else{_0x4a4f8c=_0x31c2c9;_0x50eb66[_0xf9a3('0x14')]=_0x4a4f8c;}break;}logger[_0xf9a3('0x17')](util[_0xf9a3('0x18')](_0xf9a3('0x19'),_0x5c8eed['data1'],_0x5c8eed[_0xf9a3('0x8')],JSON[_0xf9a3('0x1a')](_0x50eb66)));rp(_0x50eb66)[_0xf9a3('0x1b')](function(_0x37f638){_0x4a4f8c=!_[_0xf9a3('0x1c')](_0x4a4f8c)?_0xf9a3('0x1d')+_0x4a4f8c:'';_0x26680c=typeof _0x37f638['body']===_0xf9a3('0x1e')?JSON[_0xf9a3('0x1a')](_0x37f638[_0xf9a3('0x14')]):_0x37f638[_0xf9a3('0x14')];logger[_0xf9a3('0x17')](util[_0xf9a3('0x18')](_0xf9a3('0x1f'),_0x5c8eed[_0xf9a3('0x5')],_0x5c8eed[_0xf9a3('0x8')],_0x37f638[_0xf9a3('0x20')],_0x26680c));})['catch'](function(_0x5d2ad3){logger['error'](util[_0xf9a3('0x18')](_0xf9a3('0x21'),_0x5c8eed[_0xf9a3('0x5')],_0x5c8eed['data2'],_0x5d2ad3[_0xf9a3('0x20')],_0x5d2ad3[_0xf9a3('0x22')],_0x5d2ad3[_0xf9a3('0x23')]));});};
\ No newline at end of file
index 525fb41..a5be0e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1b3=['bluebird','../../config/logger','routing','client','http','request','then','debug','error','rpc','message','catch','jayson/promise'];(function(_0x18b5e8,_0x51e875){var _0x25baed=function(_0x3fcdf9){while(--_0x3fcdf9){_0x18b5e8['push'](_0x18b5e8['shift']());}};_0x25baed(++_0x51e875);}(_0xa1b3,0xb5));var _0x3a1b=function(_0x1c4eb3,_0x360271){_0x1c4eb3=_0x1c4eb3-0x0;var _0x4abca5=_0xa1b3[_0x1c4eb3];return _0x4abca5;};'use strict';var jayson=require(_0x3a1b('0x0'));var BPromise=require(_0x3a1b('0x1'));var logger=require(_0x3a1b('0x2'))(_0x3a1b('0x3'));var client=jayson[_0x3a1b('0x4')][_0x3a1b('0x5')]({'port':0x2329});client['Request']=function(_0x5c4781,_0x1e0e60){return new BPromise(function(_0x48bca6,_0x353827){return client[_0x3a1b('0x6')](_0x5c4781,_0x1e0e60)[_0x3a1b('0x7')](function(_0x202243){logger[_0x3a1b('0x8')]('rpc',_0x3a1b('0x3'),_0x5c4781,_0x1e0e60,_0x202243);if(_0x202243[_0x3a1b('0x9')]){logger[_0x3a1b('0x9')](_0x3a1b('0xa'),_0x3a1b('0x3'),_0x5c4781,_0x202243[_0x3a1b('0x9')][_0x3a1b('0xb')],_0x1e0e60);return _0x353827(_0x202243[_0x3a1b('0x9')][_0x3a1b('0xb')]);}else{return _0x48bca6(_0x202243['result']);}})[_0x3a1b('0xc')](function(_0x490e35){logger[_0x3a1b('0x9')](_0x3a1b('0xa'),_0x3a1b('0x3'),_0x5c4781,_0x490e35,_0x1e0e60);return _0x353827(_0x490e35);});});};module['exports']=client;
\ No newline at end of file
+var _0xd5f2=['request','then','rpc','error','message','result','catch','exports','jayson/promise','bluebird','routing','client','http','Request'];(function(_0x243fd5,_0x295542){var _0x4cfded=function(_0x2f5e76){while(--_0x2f5e76){_0x243fd5['push'](_0x243fd5['shift']());}};_0x4cfded(++_0x295542);}(_0xd5f2,0x174));var _0x2d5f=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xd5f2[_0x413feb];return _0x40ee88;};'use strict';var jayson=require(_0x2d5f('0x0'));var BPromise=require(_0x2d5f('0x1'));var logger=require('../../config/logger')(_0x2d5f('0x2'));var client=jayson[_0x2d5f('0x3')][_0x2d5f('0x4')]({'port':0x2329});client[_0x2d5f('0x5')]=function(_0x26cbec,_0x1a87bd){return new BPromise(function(_0x2e8ef1,_0x3228e3){return client[_0x2d5f('0x6')](_0x26cbec,_0x1a87bd)[_0x2d5f('0x7')](function(_0x184c2a){logger['debug'](_0x2d5f('0x8'),_0x2d5f('0x2'),_0x26cbec,_0x1a87bd,_0x184c2a);if(_0x184c2a[_0x2d5f('0x9')]){logger[_0x2d5f('0x9')](_0x2d5f('0x8'),_0x2d5f('0x2'),_0x26cbec,_0x184c2a[_0x2d5f('0x9')]['message'],_0x1a87bd);return _0x3228e3(_0x184c2a[_0x2d5f('0x9')][_0x2d5f('0xa')]);}else{return _0x2e8ef1(_0x184c2a[_0x2d5f('0xb')]);}})[_0x2d5f('0xc')](function(_0x4746f5){logger[_0x2d5f('0x9')](_0x2d5f('0x8'),_0x2d5f('0x2'),_0x26cbec,_0x4746f5,_0x1a87bd);return _0x3228e3(_0x4746f5);});});};module[_0x2d5f('0xd')]=client;
\ No newline at end of file
index eac2a12..f22d393 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f79=['./rpc/mailAccount','../../config/logger','then','initMailAccounts','refresh','mailAccounts','getSettings','loginMailFrequency','catch','Email\x20service\x20initialization','./server','./realtime'];(function(_0xfc0fc9,_0x106ee9){var _0x5af0a8=function(_0x4ee3ce){while(--_0x4ee3ce){_0xfc0fc9['push'](_0xfc0fc9['shift']());}};_0x5af0a8(++_0x106ee9);}(_0x8f79,0x1ae));var _0x98f7=function(_0x320bcf,_0x2051fb){_0x320bcf=_0x320bcf-0x0;var _0x4c0dde=_0x8f79[_0x320bcf];return _0x4c0dde;};'use strict';var server=require(_0x98f7('0x0'));var Realtime=require(_0x98f7('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x98f7('0x2'));var setting=require('./rpc/setting');var logger=require(_0x98f7('0x3'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()['then'](mailAccount['getMailAccounts']())[_0x98f7('0x4')](realtime[_0x98f7('0x5')]())['then'](function(){email[_0x98f7('0x6')](realtime[_0x98f7('0x7')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x98f7('0x4')](function(){return initRealtime();})[_0x98f7('0x4')](function(){return setting[_0x98f7('0x8')]();})[_0x98f7('0x4')](function(_0x429b39){return setInterval(initRealtime,_0x429b39[_0x98f7('0x9')]*0x3e8);})[_0x98f7('0xa')](function(_0x4f3a06){logger['error'](_0x98f7('0xb'),_0x4f3a06);});}main();
\ No newline at end of file
+var _0x13c6=['loginMailFrequency','error','Email\x20service\x20initialization','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen'];(function(_0x10791d,_0x2562b6){var _0x1b4f9c=function(_0x3b2815){while(--_0x3b2815){_0x10791d['push'](_0x10791d['shift']());}};_0x1b4f9c(++_0x2562b6);}(_0x13c6,0x145));var _0x613c=function(_0x88281e,_0x502f0b){_0x88281e=_0x88281e-0x0;var _0x4c8edf=_0x13c6[_0x88281e];return _0x4c8edf;};'use strict';var server=require('./server');var Realtime=require('./realtime');var EmailChannel=require('./lib/email');var mailAccount=require(_0x613c('0x0'));var setting=require(_0x613c('0x1'));var logger=require(_0x613c('0x2'))(_0x613c('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x613c('0x4')]()[_0x613c('0x5')](mailAccount[_0x613c('0x6')]())[_0x613c('0x5')](realtime[_0x613c('0x7')]())[_0x613c('0x5')](function(){email[_0x613c('0x8')](realtime[_0x613c('0x9')]);return realtime;});}function main(){return server[_0x613c('0xa')](realtime,email)[_0x613c('0x5')](function(){return initRealtime();})[_0x613c('0x5')](function(){return setting['getSettings']();})[_0x613c('0x5')](function(_0x15d694){return setInterval(initRealtime,_0x15d694[_0x613c('0xb')]*0x3e8);})['catch'](function(_0x52694a){logger[_0x613c('0xc')](_0x613c('0xd'),_0x52694a);});}main();
\ No newline at end of file
index dc6a050..accd70a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cb7=['md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter','start\x20email\x20channel','mailAccounts','smtp','prototype','name','active','status','Imap','messageStatus','total','isNil','emit','mailAccount:update','refresh','hasOwnProperty','service','custom','imapAccounts','box','handleImapBox','handleImapEmail','bind','end','handleImapEnd','error','handleImapError','disabled','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','info','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','Smtp','then','verified','verify','exports','lodash','moment'];(function(_0xa2d567,_0x26abee){var _0x21663c=function(_0x3c13e9){while(--_0x3c13e9){_0xa2d567['push'](_0xa2d567['shift']());}};_0x21663c(++_0x26abee);}(_0x9cb7,0x19e));var _0x79cb=function(_0x40c3e3,_0x26fb0f){_0x40c3e3=_0x40c3e3-0x0;var _0x34caf8=_0x9cb7[_0x40c3e3];return _0x34caf8;};'use strict';var _=require(_0x79cb('0x0'));var moment=require(_0x79cb('0x1'));var BPromise=require('bluebird');var md5=require(_0x79cb('0x2'));var Redis=require(_0x79cb('0x3'));var config=require(_0x79cb('0x4'));var logger=require(_0x79cb('0x5'))(_0x79cb('0x6'));config[_0x79cb('0x7')]=_[_0x79cb('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x79cb('0x9'))(new Redis(config[_0x79cb('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x2129fe){logger['info'](_0x79cb('0xa'));this[_0x79cb('0xb')]=_0x2129fe[_0x79cb('0xb')];this['imapAccounts']={};this[_0x79cb('0xc')]=new EmailSmtp();}EmailChannel[_0x79cb('0xd')]['emit']=function(_0x826512){var _0x2d5874=this[_0x79cb('0xb')][_0x826512];var _0xe0edb={'id':_0x2d5874['id'],'name':_0x2d5874[_0x79cb('0xe')],'key':_0x2d5874['key'],'active':_0x2d5874[_0x79cb('0xf')],'Imap':{'status':_0x2d5874['Imap'][_0x79cb('0x10')],'messageStatus':_0x2d5874[_0x79cb('0x11')][_0x79cb('0x12')],'total':_0x2d5874[_0x79cb('0x11')][_0x79cb('0x13')]}};if(_[_0x79cb('0x14')](md5Accounts[_0x826512])){md5Accounts[_0x826512]={};}var _0x241729=md5(JSON['stringify'](_0xe0edb));if(md5Accounts[_0x826512][_0x79cb('0x2')]!==_0x241729){md5Accounts[_0x826512][_0x79cb('0x2')]=_0x241729;io[_0x79cb('0x15')](_0x79cb('0x16'),_0xe0edb);}};EmailChannel[_0x79cb('0xd')][_0x79cb('0x17')]=function(_0x439036){for(var _0x2fb202 in _0x439036){if(_0x439036[_0x79cb('0x18')](_0x2fb202)){if(_0x439036[_0x2fb202][_0x79cb('0x11')]&&_0x439036[_0x2fb202][_0x79cb('0xf')]){var _0x25b6ee=_0x439036[_0x2fb202][_0x79cb('0x11')];if(!_0x25b6ee[_0x79cb('0x19')]&&_0x439036[_0x2fb202]['provider']!==_0x79cb('0x1a'))_0x25b6ee['service']=_0x439036[_0x2fb202]['provider'];if(!this['imapAccounts']['hasOwnProperty'](_0x25b6ee['id'])){this[_0x79cb('0x1b')][_0x25b6ee['id']]=new EmailImap(_0x25b6ee,_0x439036[_0x2fb202][_0x79cb('0x6')]);this[_0x79cb('0x1b')][_0x25b6ee['id']]['on'](_0x79cb('0x1c'),this[_0x79cb('0x1d')]['bind'](this,_0x2fb202));this[_0x79cb('0x1b')][_0x25b6ee['id']]['on'](_0x79cb('0x6'),this[_0x79cb('0x1e')][_0x79cb('0x1f')](this,_0x2fb202));this['imapAccounts'][_0x25b6ee['id']]['on'](_0x79cb('0x20'),this[_0x79cb('0x21')][_0x79cb('0x1f')](this,_0x2fb202));this[_0x79cb('0x1b')][_0x25b6ee['id']]['on'](_0x79cb('0x22'),this[_0x79cb('0x23')]['bind'](this,_0x2fb202));}}else{if(_[_0x79cb('0x14')](this[_0x79cb('0xb')][_0x2fb202][_0x79cb('0x11')])){this[_0x79cb('0xb')][_0x2fb202][_0x79cb('0x11')]={};}this['mailAccounts'][_0x2fb202][_0x79cb('0x11')]['status']=_0x79cb('0x24');this['mailAccounts'][_0x2fb202][_0x79cb('0x11')][_0x79cb('0x12')]='';this[_0x79cb('0x15')](_0x2fb202);}}}};EmailChannel['prototype'][_0x79cb('0x1d')]=function(_0x31e6e7,_0x4f838a){if(this[_0x79cb('0xb')][_0x31e6e7]){this[_0x79cb('0xb')][_0x31e6e7][_0x79cb('0x11')][_0x79cb('0x10')]='connected';this['mailAccounts'][_0x31e6e7][_0x79cb('0x11')][_0x79cb('0x12')]=_0x4f838a[_0x79cb('0xe')];if(_0x4f838a[_0x79cb('0x25')]){this[_0x79cb('0xb')][_0x31e6e7][_0x79cb('0x11')][_0x79cb('0x13')]=_0x4f838a[_0x79cb('0x25')][_0x79cb('0x13')];}return this[_0x79cb('0x15')](_0x31e6e7);}};EmailChannel['prototype'][_0x79cb('0x1e')]=function(_0x4668f5,_0x574500){logger['info'](_0x79cb('0x26'),_0x574500[_0x79cb('0x27')],_0x574500['lastName'],_0x574500[_0x79cb('0x28')],_0x4668f5);if(this['mailAccounts'][_0x4668f5]){return mailAccount[_0x79cb('0x29')](_0x4668f5,_0x574500)['then'](function(_0x10ed47){if(_0x10ed47){logger[_0x79cb('0x2a')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x1da4de){logger[_0x79cb('0x22')](_0x79cb('0x2b'),JSON['stringify'](_0x1da4de));});}};EmailChannel[_0x79cb('0xd')][_0x79cb('0x21')]=function(_0x182ab0){if(this[_0x79cb('0xb')][_0x182ab0]&&this[_0x79cb('0xb')][_0x182ab0]['Imap']){if(this[_0x79cb('0x1b')][this[_0x79cb('0xb')][_0x182ab0][_0x79cb('0x11')]['id']]){delete this[_0x79cb('0x1b')][this['mailAccounts'][_0x182ab0]['Imap']['id']];}this[_0x79cb('0xb')][_0x182ab0][_0x79cb('0x11')][_0x79cb('0x2c')]=moment();this[_0x79cb('0x15')](_0x182ab0);}};EmailChannel[_0x79cb('0xd')]['handleImapError']=function(_0x285b75,_0x2727b1){if(this[_0x79cb('0xb')][_0x285b75]){this[_0x79cb('0xb')][_0x285b75][_0x79cb('0x11')]['status']=_0x79cb('0x22');this[_0x79cb('0xb')][_0x285b75][_0x79cb('0x11')][_0x79cb('0x12')]=_0x2727b1;return this['emit'](_0x285b75);}};EmailChannel[_0x79cb('0xd')][_0x79cb('0x2d')]=function(_0x54257f,_0x11d68d){return this[_0x79cb('0xc')][_0x79cb('0x2e')](_0x54257f,_0x11d68d);};EmailChannel[_0x79cb('0xd')]['verifySmtp']=function(_0x5c8c74){var _0x1e2542=this;if(this[_0x79cb('0xb')][_0x5c8c74['id']]){if(_[_0x79cb('0x14')](this['mailAccounts'][_0x5c8c74['id']][_0x79cb('0x2f')])){this['mailAccounts'][_0x5c8c74['id']]['Smtp']={};}this[_0x79cb('0xb')][_0x5c8c74['id']][_0x79cb('0x2f')][_0x79cb('0x2c')]=moment();return new BPromise(function(_0x355819,_0x2a18a3){return _0x1e2542['smtp']['verify'](_0x5c8c74)[_0x79cb('0x30')](function(_0x4cbab6){_0x1e2542[_0x79cb('0xb')][_0x5c8c74['id']][_0x79cb('0x2f')][_0x79cb('0x10')]=_0x79cb('0x31');_0x1e2542[_0x79cb('0xb')][_0x5c8c74['id']][_0x79cb('0x2f')][_0x79cb('0x12')]='';_0x1e2542['emit'](_0x5c8c74['id']);_0x355819(_0x4cbab6);})['catch'](function(_0xf35b70){_0x1e2542[_0x79cb('0xb')][_0x5c8c74['id']][_0x79cb('0x2f')][_0x79cb('0x10')]=_0x79cb('0x22');_0x1e2542[_0x79cb('0xb')][_0x5c8c74['id']][_0x79cb('0x2f')][_0x79cb('0x12')]=_0xf35b70;_0x1e2542[_0x79cb('0x15')](_0x5c8c74['id']);_0x2a18a3(_0xf35b70);});});}return this[_0x79cb('0xc')][_0x79cb('0x32')](_0x5c8c74);};module[_0x79cb('0x33')]=EmailChannel;
\ No newline at end of file
+var _0xf8e9=['custom','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','messageStatus','prototype','connected','messages','firstName','from','notify','Mail\x20accepted\x20from\x20routing','catch','error','lastSync','handleImapError','sendMail','smtp','verifySmtp','Smtp','verify','exports','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','imapAccounts','emit','mailAccounts','name','active','Imap','status','total','isNil','hasOwnProperty','service','provider'];(function(_0x349407,_0x1b1a22){var _0x120773=function(_0x128e6d){while(--_0x128e6d){_0x349407['push'](_0x349407['shift']());}};_0x120773(++_0x1b1a22);}(_0xf8e9,0xb5));var _0x9f8e=function(_0x44ba40,_0x2119dc){_0x44ba40=_0x44ba40-0x0;var _0x17b543=_0xf8e9[_0x44ba40];return _0x17b543;};'use strict';var _=require('lodash');var moment=require(_0x9f8e('0x0'));var BPromise=require(_0x9f8e('0x1'));var md5=require(_0x9f8e('0x2'));var Redis=require(_0x9f8e('0x3'));var config=require(_0x9f8e('0x4'));var logger=require(_0x9f8e('0x5'))(_0x9f8e('0x6'));config[_0x9f8e('0x7')]=_[_0x9f8e('0x8')](config[_0x9f8e('0x7')],{'host':_0x9f8e('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9f8e('0x7')]));var EmailImap=require(_0x9f8e('0xa'));var EmailSmtp=require(_0x9f8e('0xb'));var mailAccount=require(_0x9f8e('0xc'));var md5Accounts={};function EmailChannel(_0xdbb47b){logger[_0x9f8e('0xd')](_0x9f8e('0xe'));this['mailAccounts']=_0xdbb47b['mailAccounts'];this[_0x9f8e('0xf')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0x9f8e('0x10')]=function(_0x2f0e1d){var _0xef94b9=this[_0x9f8e('0x11')][_0x2f0e1d];var _0x142c4e={'id':_0xef94b9['id'],'name':_0xef94b9[_0x9f8e('0x12')],'key':_0xef94b9['key'],'active':_0xef94b9[_0x9f8e('0x13')],'Imap':{'status':_0xef94b9[_0x9f8e('0x14')][_0x9f8e('0x15')],'messageStatus':_0xef94b9['Imap']['messageStatus'],'total':_0xef94b9[_0x9f8e('0x14')][_0x9f8e('0x16')]}};if(_[_0x9f8e('0x17')](md5Accounts[_0x2f0e1d])){md5Accounts[_0x2f0e1d]={};}var _0x35d5de=md5(JSON['stringify'](_0x142c4e));if(md5Accounts[_0x2f0e1d][_0x9f8e('0x2')]!==_0x35d5de){md5Accounts[_0x2f0e1d][_0x9f8e('0x2')]=_0x35d5de;io[_0x9f8e('0x10')]('mailAccount:update',_0x142c4e);}};EmailChannel['prototype']['refresh']=function(_0x559d55){for(var _0xcb6531 in _0x559d55){if(_0x559d55[_0x9f8e('0x18')](_0xcb6531)){if(_0x559d55[_0xcb6531][_0x9f8e('0x14')]&&_0x559d55[_0xcb6531][_0x9f8e('0x13')]){var _0x30cd60=_0x559d55[_0xcb6531]['Imap'];if(!_0x30cd60[_0x9f8e('0x19')]&&_0x559d55[_0xcb6531][_0x9f8e('0x1a')]!==_0x9f8e('0x1b'))_0x30cd60['service']=_0x559d55[_0xcb6531]['provider'];if(!this[_0x9f8e('0xf')][_0x9f8e('0x18')](_0x30cd60['id'])){this[_0x9f8e('0xf')][_0x30cd60['id']]=new EmailImap(_0x30cd60,_0x559d55[_0xcb6531][_0x9f8e('0x6')]);this[_0x9f8e('0xf')][_0x30cd60['id']]['on'](_0x9f8e('0x1c'),this[_0x9f8e('0x1d')][_0x9f8e('0x1e')](this,_0xcb6531));this[_0x9f8e('0xf')][_0x30cd60['id']]['on'](_0x9f8e('0x6'),this[_0x9f8e('0x1f')][_0x9f8e('0x1e')](this,_0xcb6531));this[_0x9f8e('0xf')][_0x30cd60['id']]['on'](_0x9f8e('0x20'),this[_0x9f8e('0x21')]['bind'](this,_0xcb6531));this[_0x9f8e('0xf')][_0x30cd60['id']]['on']('error',this['handleImapError'][_0x9f8e('0x1e')](this,_0xcb6531));}}else{if(_[_0x9f8e('0x17')](this[_0x9f8e('0x11')][_0xcb6531]['Imap'])){this[_0x9f8e('0x11')][_0xcb6531][_0x9f8e('0x14')]={};}this[_0x9f8e('0x11')][_0xcb6531]['Imap'][_0x9f8e('0x15')]='disabled';this[_0x9f8e('0x11')][_0xcb6531]['Imap'][_0x9f8e('0x22')]='';this['emit'](_0xcb6531);}}}};EmailChannel[_0x9f8e('0x23')]['handleImapBox']=function(_0x10a845,_0x186498){if(this[_0x9f8e('0x11')][_0x10a845]){this['mailAccounts'][_0x10a845]['Imap'][_0x9f8e('0x15')]=_0x9f8e('0x24');this[_0x9f8e('0x11')][_0x10a845][_0x9f8e('0x14')]['messageStatus']=_0x186498[_0x9f8e('0x12')];if(_0x186498[_0x9f8e('0x25')]){this[_0x9f8e('0x11')][_0x10a845][_0x9f8e('0x14')][_0x9f8e('0x16')]=_0x186498['messages'][_0x9f8e('0x16')];}return this['emit'](_0x10a845);}};EmailChannel[_0x9f8e('0x23')][_0x9f8e('0x1f')]=function(_0x5af3b4,_0x49e690){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x49e690[_0x9f8e('0x26')],_0x49e690['lastName'],_0x49e690[_0x9f8e('0x27')],_0x5af3b4);if(this[_0x9f8e('0x11')][_0x5af3b4]){return mailAccount[_0x9f8e('0x28')](_0x5af3b4,_0x49e690)['then'](function(_0x4a2007){if(_0x4a2007){logger[_0x9f8e('0xd')](_0x9f8e('0x29'));}})[_0x9f8e('0x2a')](function(_0x4a7fbe){logger[_0x9f8e('0x2b')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON['stringify'](_0x4a7fbe));});}};EmailChannel['prototype'][_0x9f8e('0x21')]=function(_0xba78e6){if(this[_0x9f8e('0x11')][_0xba78e6]&&this['mailAccounts'][_0xba78e6]['Imap']){if(this[_0x9f8e('0xf')][this[_0x9f8e('0x11')][_0xba78e6]['Imap']['id']]){delete this[_0x9f8e('0xf')][this['mailAccounts'][_0xba78e6][_0x9f8e('0x14')]['id']];}this['mailAccounts'][_0xba78e6][_0x9f8e('0x14')][_0x9f8e('0x2c')]=moment();this['emit'](_0xba78e6);}};EmailChannel[_0x9f8e('0x23')][_0x9f8e('0x2d')]=function(_0x46c06d,_0x29dd05){if(this[_0x9f8e('0x11')][_0x46c06d]){this[_0x9f8e('0x11')][_0x46c06d][_0x9f8e('0x14')][_0x9f8e('0x15')]=_0x9f8e('0x2b');this[_0x9f8e('0x11')][_0x46c06d][_0x9f8e('0x14')][_0x9f8e('0x22')]=_0x29dd05;return this[_0x9f8e('0x10')](_0x46c06d);}};EmailChannel[_0x9f8e('0x23')][_0x9f8e('0x2e')]=function(_0xfa214f,_0x2d4f1a){return this[_0x9f8e('0x2f')]['send'](_0xfa214f,_0x2d4f1a);};EmailChannel['prototype'][_0x9f8e('0x30')]=function(_0x3b2277){var _0x3e94f0=this;if(this[_0x9f8e('0x11')][_0x3b2277['id']]){if(_[_0x9f8e('0x17')](this[_0x9f8e('0x11')][_0x3b2277['id']][_0x9f8e('0x31')])){this[_0x9f8e('0x11')][_0x3b2277['id']][_0x9f8e('0x31')]={};}this[_0x9f8e('0x11')][_0x3b2277['id']][_0x9f8e('0x31')][_0x9f8e('0x2c')]=moment();return new BPromise(function(_0x4d8392,_0x288820){return _0x3e94f0['smtp'][_0x9f8e('0x32')](_0x3b2277)['then'](function(_0x2a4340){_0x3e94f0[_0x9f8e('0x11')][_0x3b2277['id']][_0x9f8e('0x31')][_0x9f8e('0x15')]='verified';_0x3e94f0[_0x9f8e('0x11')][_0x3b2277['id']]['Smtp'][_0x9f8e('0x22')]='';_0x3e94f0[_0x9f8e('0x10')](_0x3b2277['id']);_0x4d8392(_0x2a4340);})[_0x9f8e('0x2a')](function(_0x4d34c2){_0x3e94f0[_0x9f8e('0x11')][_0x3b2277['id']]['Smtp'][_0x9f8e('0x15')]=_0x9f8e('0x2b');_0x3e94f0[_0x9f8e('0x11')][_0x3b2277['id']][_0x9f8e('0x31')][_0x9f8e('0x22')]=_0x4d34c2;_0x3e94f0[_0x9f8e('0x10')](_0x3b2277['id']);_0x288820(_0x4d34c2);});});}return this[_0x9f8e('0x2f')][_0x9f8e('0x32')](_0x3b2277);};module[_0x9f8e('0x33')]=EmailChannel;
\ No newline at end of file
index 677bc52..df0d7a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ccb=['handleReady','handleEnd','error','handleError','connect','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','xoauth2','CloudProvider','data5','password','host','port','tls','required','prototype','handleOpenBox','bind','emit','end','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','upperFirst','exports','lodash','util','imap','simpleParser','iconv','events','EventEmitter','./utils','email','INBOX','account','getAccount','once','ready'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x4ccb,0x196));var _0xb4cc=function(_0xf7e751,_0x2d4e68){_0xf7e751=_0xf7e751-0x0;var _0x5451eb=_0x4ccb[_0xf7e751];return _0x5451eb;};'use strict';var _=require(_0xb4cc('0x0'));var util=require(_0xb4cc('0x1'));var Imap=require(_0xb4cc('0x2'));var simpleParser=require('mailparser')[_0xb4cc('0x3')];var Iconv=require(_0xb4cc('0x4'))['Iconv'];var EventEmitter=require(_0xb4cc('0x5'))[_0xb4cc('0x6')];var utils=require(_0xb4cc('0x7'));var logger=require('../../../config/logger')(_0xb4cc('0x8'));function EmailImap(_0x2181b2,_0x1e19dd){this['mailbox']=_0xb4cc('0x9');this[_0xb4cc('0xa')]=this[_0xb4cc('0xb')](_0x2181b2,_0x1e19dd);this['imap']=new Imap(this[_0xb4cc('0xa')]);this[_0xb4cc('0x2')][_0xb4cc('0xc')](_0xb4cc('0xd'),this[_0xb4cc('0xe')]['bind'](this));this[_0xb4cc('0x2')][_0xb4cc('0xc')]('end',this[_0xb4cc('0xf')]['bind'](this));this[_0xb4cc('0x2')]['on'](_0xb4cc('0x10'),this[_0xb4cc('0x11')]['bind'](this));this['imap'][_0xb4cc('0x12')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0xb4cc('0xb')]=function(_0x58b1c2,_0x52b57d){var _0xcfdeb9={'connTimeout':_0x58b1c2[_0xb4cc('0x13')]?_0x58b1c2[_0xb4cc('0x13')]*0x3e8:0x2710,'authTimeout':_0x58b1c2['authTimeout']?_0x58b1c2[_0xb4cc('0x14')]*0x3e8:0x1388};if(_0x58b1c2[_0xb4cc('0x15')]){_0xcfdeb9[_0xb4cc('0x16')]=_0x58b1c2[_0xb4cc('0x16')];_0xcfdeb9[_0xb4cc('0x8')]=_0x52b57d||_0x58b1c2['user']||_0xb4cc('0x17');if(_0x58b1c2[_0xb4cc('0x18')]){_0xcfdeb9[_0xb4cc('0x19')]=utils['generateXOAuth2Token'](_0x58b1c2[_0xb4cc('0x1a')][_0xb4cc('0x1b')],_0x58b1c2[_0xb4cc('0x16')]);}else{_0xcfdeb9[_0xb4cc('0x1c')]=_0x58b1c2[_0xb4cc('0x1c')];}}else{if(_0x58b1c2['authentication']){_0xcfdeb9[_0xb4cc('0x16')]=_0x58b1c2[_0xb4cc('0x16')];_0xcfdeb9[_0xb4cc('0x1c')]=_0x58b1c2[_0xb4cc('0x1c')];}}_0xcfdeb9[_0xb4cc('0x1d')]=_0x58b1c2['host'];_0xcfdeb9[_0xb4cc('0x1e')]=_0x58b1c2[_0xb4cc('0x1e')]||0x3e1;if(_0x58b1c2[_0xb4cc('0x1f')]){_0xcfdeb9[_0xb4cc('0x1f')]=!![];}else{_0xcfdeb9[_0xb4cc('0x1f')]=![];_0xcfdeb9['autotls']=_0xb4cc('0x20');}return _0xcfdeb9;};EmailImap[_0xb4cc('0x21')][_0xb4cc('0xe')]=function(){this[_0xb4cc('0x2')]['openBox'](this['mailbox'],![],this[_0xb4cc('0x22')][_0xb4cc('0x23')](this));};EmailImap['prototype']['handleOpenBox']=function(_0x1f1809,_0xeb25e1){if(_0x1f1809){this[_0xb4cc('0x11')](_0x1f1809,!![]);}else{this[_0xb4cc('0x24')]('box',_0xeb25e1);this['readUnseen']();}};EmailImap[_0xb4cc('0x21')]['handleCloseBox']=function(_0x3c4079){if(_0x3c4079){this[_0xb4cc('0x11')](_0x3c4079,!![]);}else{this[_0xb4cc('0x2')][_0xb4cc('0x25')]();}};EmailImap[_0xb4cc('0x21')][_0xb4cc('0x26')]=function(){this[_0xb4cc('0x2')][_0xb4cc('0x27')]([_0xb4cc('0x28')],this['handleReadUnseen'][_0xb4cc('0x23')](this));};EmailImap[_0xb4cc('0x21')][_0xb4cc('0x29')]=function(_0x459a3c,_0x1141be){if(_0x459a3c){this['handleError'](_0x459a3c,!![]);}else{if(_0x1141be[_0xb4cc('0x2a')]){try{var _0x2957ee=this[_0xb4cc('0x2')][_0xb4cc('0x2b')](_0x1141be,{'bodies':'','markSeen':!![]});_0x2957ee['on']('message',this[_0xb4cc('0x2c')][_0xb4cc('0x23')](this));_0x2957ee['once'](_0xb4cc('0x10'),this[_0xb4cc('0x2d')]['bind'](this));_0x2957ee[_0xb4cc('0xc')](_0xb4cc('0x25'),this[_0xb4cc('0x2e')][_0xb4cc('0x23')](this));}catch(_0x2962fe){logger[_0xb4cc('0x10')](_0x2962fe);}}else{this[_0xb4cc('0x2')][_0xb4cc('0x2f')](!![],this[_0xb4cc('0x30')]['bind'](this));}}};EmailImap['prototype'][_0xb4cc('0x2c')]=function(_0x8dafaf){_0x8dafaf['on'](_0xb4cc('0x31'),this[_0xb4cc('0x32')][_0xb4cc('0x23')](this));_0x8dafaf['once'](_0xb4cc('0x33'),this[_0xb4cc('0x34')][_0xb4cc('0x23')](this));_0x8dafaf['once'](_0xb4cc('0x25'),this[_0xb4cc('0x35')][_0xb4cc('0x23')](this));};EmailImap['prototype'][_0xb4cc('0x32')]=function(_0x51155e){simpleParser(_0x51155e,{'Iconv':Iconv},this[_0xb4cc('0x36')][_0xb4cc('0x23')](this));};EmailImap[_0xb4cc('0x21')][_0xb4cc('0x34')]=function(){};EmailImap['prototype'][_0xb4cc('0x35')]=function(){};EmailImap['prototype'][_0xb4cc('0x36')]=function(_0x44b56d,_0x4490ea){if(_0x44b56d){logger[_0xb4cc('0x10')](_0x44b56d);}else{var _0x1ce892=this;utils[_0xb4cc('0x37')](this[_0xb4cc('0xa')],_0x4490ea,function(_0x4abd52){_0x1ce892[_0xb4cc('0x24')](_0xb4cc('0x8'),_0x4abd52);});}};EmailImap[_0xb4cc('0x21')]['handleFetchEnd']=function(){this['imap'][_0xb4cc('0x2f')](!![],this[_0xb4cc('0x30')][_0xb4cc('0x23')](this));};EmailImap[_0xb4cc('0x21')][_0xb4cc('0x2d')]=function(_0x50f351){this[_0xb4cc('0x11')](_0x50f351);this['imap']['closeBox'](!![],this[_0xb4cc('0x30')][_0xb4cc('0x23')](this));};EmailImap[_0xb4cc('0x21')][_0xb4cc('0xf')]=function(){this[_0xb4cc('0x24')]('end');};EmailImap[_0xb4cc('0x21')]['handleError']=function(_0x17a066,_0x194434){logger[_0xb4cc('0x10')](_0xb4cc('0x11'),this[_0xb4cc('0xa')][_0xb4cc('0x8')],JSON[_0xb4cc('0x38')](_0x17a066));var _0x2d5700='';if(_0x17a066){if(_0x17a066[_0xb4cc('0x39')]){_0x2d5700=_0x17a066[_0xb4cc('0x39')];}else{for(var _0x1a4216 in _0x17a066){if(_0x17a066['hasOwnProperty'](_0x1a4216)){_0x2d5700+=_[_0xb4cc('0x3a')](_0x1a4216)+':\x20'+_0x17a066[_0x1a4216]+'\x0a';}}}}if(_0x194434){this[_0xb4cc('0x2')][_0xb4cc('0x25')]();}else{this[_0xb4cc('0x24')]('error',_0x2d5700);this['emit'](_0xb4cc('0x25'));}};module[_0xb4cc('0x3b')]=EmailImap;
\ No newline at end of file
+var _0x39e6=['prototype','connTimeout','authTimeout','service','user','anonymous@xcally.com','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','autotls','openBox','handleOpenBox','box','readUnseen','handleCloseBox','end','search','handleReadUnseen','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','emit','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','imap','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','ready','handleReady','bind','handleEnd','error','handleError'];(function(_0x3de957,_0x46c89d){var _0x1767a6=function(_0x1edb39){while(--_0x1edb39){_0x3de957['push'](_0x3de957['shift']());}};_0x1767a6(++_0x46c89d);}(_0x39e6,0x9e));var _0x639e=function(_0x195725,_0x5c1502){_0x195725=_0x195725-0x0;var _0x175bda=_0x39e6[_0x195725];return _0x175bda;};'use strict';var _=require(_0x639e('0x0'));var util=require('util');var Imap=require(_0x639e('0x1'));var simpleParser=require('mailparser')['simpleParser'];var Iconv=require(_0x639e('0x2'))[_0x639e('0x3')];var EventEmitter=require('events')[_0x639e('0x4')];var utils=require(_0x639e('0x5'));var logger=require(_0x639e('0x6'))(_0x639e('0x7'));function EmailImap(_0x15e5df,_0x320448){this[_0x639e('0x8')]=_0x639e('0x9');this[_0x639e('0xa')]=this[_0x639e('0xb')](_0x15e5df,_0x320448);this[_0x639e('0x1')]=new Imap(this[_0x639e('0xa')]);this[_0x639e('0x1')][_0x639e('0xc')](_0x639e('0xd'),this[_0x639e('0xe')][_0x639e('0xf')](this));this[_0x639e('0x1')]['once']('end',this[_0x639e('0x10')][_0x639e('0xf')](this));this[_0x639e('0x1')]['on'](_0x639e('0x11'),this[_0x639e('0x12')][_0x639e('0xf')](this));this[_0x639e('0x1')]['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x639e('0x13')][_0x639e('0xb')]=function(_0x89302c,_0x199fb5){var _0x37b8e2={'connTimeout':_0x89302c[_0x639e('0x14')]?_0x89302c['connTimeout']*0x3e8:0x2710,'authTimeout':_0x89302c[_0x639e('0x15')]?_0x89302c[_0x639e('0x15')]*0x3e8:0x1388};if(_0x89302c[_0x639e('0x16')]){_0x37b8e2[_0x639e('0x17')]=_0x89302c['user'];_0x37b8e2[_0x639e('0x7')]=_0x199fb5||_0x89302c['user']||_0x639e('0x18');if(_0x89302c[_0x639e('0x19')]){_0x37b8e2[_0x639e('0x1a')]=utils[_0x639e('0x1b')](_0x89302c[_0x639e('0x1c')][_0x639e('0x1d')],_0x89302c['user']);}else{_0x37b8e2[_0x639e('0x1e')]=_0x89302c[_0x639e('0x1e')];}}else{if(_0x89302c[_0x639e('0x1f')]){_0x37b8e2[_0x639e('0x17')]=_0x89302c['user'];_0x37b8e2[_0x639e('0x1e')]=_0x89302c[_0x639e('0x1e')];}}_0x37b8e2[_0x639e('0x20')]=_0x89302c[_0x639e('0x20')];_0x37b8e2[_0x639e('0x21')]=_0x89302c['port']||0x3e1;if(_0x89302c[_0x639e('0x22')]){_0x37b8e2[_0x639e('0x22')]=!![];}else{_0x37b8e2['tls']=![];_0x37b8e2[_0x639e('0x23')]='required';}return _0x37b8e2;};EmailImap['prototype'][_0x639e('0xe')]=function(){this[_0x639e('0x1')][_0x639e('0x24')](this[_0x639e('0x8')],![],this[_0x639e('0x25')]['bind'](this));};EmailImap[_0x639e('0x13')][_0x639e('0x25')]=function(_0x39b44f,_0x2da264){if(_0x39b44f){this[_0x639e('0x12')](_0x39b44f,!![]);}else{this['emit'](_0x639e('0x26'),_0x2da264);this[_0x639e('0x27')]();}};EmailImap[_0x639e('0x13')][_0x639e('0x28')]=function(_0x5b5b8c){if(_0x5b5b8c){this[_0x639e('0x12')](_0x5b5b8c,!![]);}else{this[_0x639e('0x1')][_0x639e('0x29')]();}};EmailImap['prototype'][_0x639e('0x27')]=function(){this['imap'][_0x639e('0x2a')](['UNSEEN'],this['handleReadUnseen'][_0x639e('0xf')](this));};EmailImap[_0x639e('0x13')][_0x639e('0x2b')]=function(_0x124954,_0x412176){if(_0x124954){this[_0x639e('0x12')](_0x124954,!![]);}else{if(_0x412176['length']){try{var _0x213b7e=this[_0x639e('0x1')]['fetch'](_0x412176,{'bodies':'','markSeen':!![]});_0x213b7e['on']('message',this[_0x639e('0x2c')][_0x639e('0xf')](this));_0x213b7e[_0x639e('0xc')]('error',this[_0x639e('0x2d')]['bind'](this));_0x213b7e[_0x639e('0xc')](_0x639e('0x29'),this[_0x639e('0x2e')]['bind'](this));}catch(_0x157d07){logger['error'](_0x157d07);}}else{this[_0x639e('0x1')][_0x639e('0x2f')](!![],this[_0x639e('0x28')]['bind'](this));}}};EmailImap[_0x639e('0x13')][_0x639e('0x2c')]=function(_0x2d5add){_0x2d5add['on']('body',this[_0x639e('0x30')]['bind'](this));_0x2d5add[_0x639e('0xc')](_0x639e('0x31'),this[_0x639e('0x32')][_0x639e('0xf')](this));_0x2d5add[_0x639e('0xc')]('end',this[_0x639e('0x33')][_0x639e('0xf')](this));};EmailImap[_0x639e('0x13')][_0x639e('0x30')]=function(_0x4b8a3e){simpleParser(_0x4b8a3e,{'Iconv':Iconv},this[_0x639e('0x34')][_0x639e('0xf')](this));};EmailImap[_0x639e('0x13')]['handleMessageAttributes']=function(){};EmailImap[_0x639e('0x13')]['handleMessageEnd']=function(){};EmailImap[_0x639e('0x13')][_0x639e('0x34')]=function(_0x2a347e,_0x4541cc){if(_0x2a347e){logger[_0x639e('0x11')](_0x2a347e);}else{var _0x13606b=this;utils['parser'](this[_0x639e('0xa')],_0x4541cc,function(_0x1d37a0){_0x13606b['emit'](_0x639e('0x7'),_0x1d37a0);});}};EmailImap['prototype'][_0x639e('0x2e')]=function(){this[_0x639e('0x1')][_0x639e('0x2f')](!![],this[_0x639e('0x28')][_0x639e('0xf')](this));};EmailImap[_0x639e('0x13')][_0x639e('0x2d')]=function(_0x4103e2){this['handleError'](_0x4103e2);this['imap']['closeBox'](!![],this['handleCloseBox'][_0x639e('0xf')](this));};EmailImap[_0x639e('0x13')]['handleEnd']=function(){this[_0x639e('0x35')](_0x639e('0x29'));};EmailImap[_0x639e('0x13')]['handleError']=function(_0x179f82,_0x4103fc){logger[_0x639e('0x11')](_0x639e('0x12'),this[_0x639e('0xa')][_0x639e('0x7')],JSON[_0x639e('0x36')](_0x179f82));var _0x201312='';if(_0x179f82){if(_0x179f82[_0x639e('0x37')]){_0x201312=_0x179f82['textCode'];}else{for(var _0x417dd6 in _0x179f82){if(_0x179f82[_0x639e('0x38')](_0x417dd6)){_0x201312+=_[_0x639e('0x39')](_0x417dd6)+':\x20'+_0x179f82[_0x417dd6]+'\x0a';}}}}if(_0x4103fc){this[_0x639e('0x1')][_0x639e('0x29')]();}else{this[_0x639e('0x35')]('error',_0x201312);this[_0x639e('0x35')](_0x639e('0x29'));}};module[_0x639e('0x3a')]=EmailImap;
\ No newline at end of file
index 9a7f2d8..2ce32b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2d5=['verify','Not\x20verifired','exports','send','createTransport','compile','sendMail','toString','prototype'];(function(_0x14970e,_0x3dab4f){var _0x939d3c=function(_0xe26432){while(--_0xe26432){_0x14970e['push'](_0x14970e['shift']());}};_0x939d3c(++_0x3dab4f);}(_0xb2d5,0x9c));var _0x5b2d=function(_0x5f4c2b,_0x477242){_0x5f4c2b=_0x5f4c2b-0x0;var _0x2be8de=_0xb2d5[_0x5f4c2b];return _0x2be8de;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0x5b2d('0x0')]=function(_0x121b61,_0xb9c049){return new Promise(function(_0x2b5b3f,_0x156327){var _0x14f72b=nodemailer[_0x5b2d('0x1')](_0x121b61);_0x14f72b['use'](_0x5b2d('0x2'),inlineBase64());_0x14f72b[_0x5b2d('0x3')](_0xb9c049,function(_0x2499cf,_0x258200){if(_0x2499cf){_0x156327(_0x2499cf[_0x5b2d('0x4')]());}else{_0x2b5b3f(_0x258200);}});});};EmailSmtp[_0x5b2d('0x5')][_0x5b2d('0x6')]=function(_0x2c769a){return new Promise(function(_0x30548b,_0x58ebbd){var _0x99613d=nodemailer[_0x5b2d('0x1')](_0x2c769a);_0x99613d[_0x5b2d('0x6')](function(_0x1ad9f3,_0x484ac7){if(_0x1ad9f3){_0x58ebbd(_0x1ad9f3['toString']());}else{if(_0x484ac7){_0x30548b(_0x484ac7);}else{_0x58ebbd(_0x5b2d('0x7'));}}});});};module[_0x5b2d('0x8')]=EmailSmtp;
\ No newline at end of file
+var _0x16d0=['Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','send','createTransport','use','compile','toString','prototype','verify'];(function(_0x2e8c12,_0x5c0f38){var _0x5df27b=function(_0x658e){while(--_0x658e){_0x2e8c12['push'](_0x2e8c12['shift']());}};_0x5df27b(++_0x5c0f38);}(_0x16d0,0x199));var _0x016d=function(_0x13ed97,_0x4724d1){_0x13ed97=_0x13ed97-0x0;var _0x4784c2=_0x16d0[_0x13ed97];return _0x4784c2;};'use strict';var nodemailer=require(_0x016d('0x0'));var inlineBase64=require(_0x016d('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x016d('0x2')]=function(_0x20ee26,_0x8b3298){return new Promise(function(_0x5a224a,_0x15d692){var _0x1d740e=nodemailer[_0x016d('0x3')](_0x20ee26);_0x1d740e[_0x016d('0x4')](_0x016d('0x5'),inlineBase64());_0x1d740e['sendMail'](_0x8b3298,function(_0x36962d,_0x21f41b){if(_0x36962d){_0x15d692(_0x36962d[_0x016d('0x6')]());}else{_0x5a224a(_0x21f41b);}});});};EmailSmtp[_0x016d('0x7')]['verify']=function(_0x466aa9){return new Promise(function(_0x192509,_0x35da60){var _0x1801e8=nodemailer[_0x016d('0x3')](_0x466aa9);_0x1801e8[_0x016d('0x8')](function(_0x384752,_0x15ea61){if(_0x384752){_0x35da60(_0x384752['toString']());}else{if(_0x15ea61){_0x192509(_0x15ea61);}else{_0x35da60(_0x016d('0x9'));}}});});};module[_0x016d('0xa')]=EmailSmtp;
\ No newline at end of file
index 92a26fd..e76f840 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7992=['lodash','moment','path','util','node-tnef','../../../config/logger','email','../../../config/environment','address','anonymous','generate','@xcally.com','value','name','substring','indexOf','split','length','slice','join','Anonymous','head','pop','isEmpty','test','html','replace','includes','<img','attachments','forEach','filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','originTo','message','originCc','bcc','attach','attachment','attachment-','format','%s-%s','now','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','inReplyTo','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','first','BodyHTML','<p>Empty\x20message</p>','Attachments','push','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','toString','base64'];(function(_0x349915,_0x124261){var _0x8be4f3=function(_0x3a82a9){while(--_0x3a82a9){_0x349915['push'](_0x349915['shift']());}};_0x8be4f3(++_0x124261);}(_0x7992,0xf6));var _0x2799=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x7992[_0x2adbeb];return _0x5e18a6;};'use strict';var _=require(_0x2799('0x0'));var moment=require(_0x2799('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x2799('0x2'));var util=require(_0x2799('0x3'));var tnef=require(_0x2799('0x4'));var logger=require(_0x2799('0x5'))(_0x2799('0x6'));var config=require(_0x2799('0x7'));function getAddress(_0x14e7dd){var _0x5ed879=_['head'](_0x14e7dd['value']);return _0x5ed879&&_0x5ed879[_0x2799('0x8')]?_0x5ed879[_0x2799('0x8')]:_0x2799('0x9')+random[_0x2799('0xa')](0x6)+_0x2799('0xb');}function getFirstName(_0x5b00c2){var _0x3a9121=_['head'](_0x5b00c2[_0x2799('0xc')]);if(_0x3a9121&&_0x3a9121[_0x2799('0xd')]){if(_0x3a9121[_0x2799('0xd')]==_0x3a9121[_0x2799('0x8')]){return _0x3a9121[_0x2799('0xd')][_0x2799('0xe')](0x0,_0x3a9121[_0x2799('0xd')][_0x2799('0xf')]('@'));}var _0x570c43=_0x3a9121['name'][_0x2799('0x10')](/\s+/);return _0x570c43[_0x2799('0x11')]>0x1?_0x570c43[_0x2799('0x12')](0x0,-0x1)[_0x2799('0x13')]('\x20'):_0x3a9121[_0x2799('0xd')];}return _0x2799('0x14');}function getLastName(_0x43f707){var _0xa2266=_[_0x2799('0x15')](_0x43f707['value']);if(_0xa2266&&_0xa2266[_0x2799('0xd')]){var _0x1fde41=_0xa2266['name'][_0x2799('0x10')](/\s+/);return _0x1fde41[_0x2799('0x11')]>0x1?_0x1fde41[_0x2799('0x16')]():'';}return'';}function getMails(_0x335dab,_0x5d4f15){var _0x303088='';for(var _0x66424f=0x0;_0x66424f<_0x5d4f15[_0x2799('0xc')][_0x2799('0x11')];_0x66424f+=0x1){if(_0x5d4f15[_0x2799('0xc')][_0x66424f][_0x2799('0x8')]!==_0x335dab){if(!_[_0x2799('0x17')](_0x303088)){_0x303088+=',';}_0x303088+=_0x5d4f15[_0x2799('0xc')][_0x66424f][_0x2799('0xd')]||_0x5d4f15[_0x2799('0xc')][_0x66424f][_0x2799('0x8')]||'';_0x303088+='\x20<';_0x303088+=_0x5d4f15[_0x2799('0xc')][_0x66424f][_0x2799('0x8')]?_0x5d4f15['value'][_0x66424f][_0x2799('0x8')]:_0x2799('0x9')+random[_0x2799('0xa')](0x6)+_0x2799('0xb');_0x303088+='>';}}return _0x303088;}function parseEmail(_0x2f66f0,_0x239799,_0x2318c2){if(_0x239799['html']){var _0x8eee99=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x8eee99[_0x2799('0x18')](_0x239799[_0x2799('0x19')])){_0x239799[_0x2799('0x19')]=_0x239799[_0x2799('0x19')][_0x2799('0x1a')](_0x8eee99,'');}if(_0x239799[_0x2799('0x19')][_0x2799('0x1b')](_0x2799('0x1c'))){var _0x4261a9=[];_0x239799[_0x2799('0x1d')][_0x2799('0x1e')](_0x35b547=>{_0x4261a9['push'](_0x35b547[_0x2799('0x1f')]);});var _0x5a3b94=/<img.*? _SRC(.*?)[^>]+>/g;var _0x41ebb6=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x12283f=_0x239799['html']['replace'](_0x41ebb6,_0x2799('0x20'));var _0x5b1d1c=_0x12283f['replace'](_0x5a3b94,'_IMG');for(let _0x18f616=0x0;_0x18f616<_0x4261a9[_0x2799('0x11')];_0x18f616++){var _0x482aae=_0x5b1d1c[_0x2799('0x1a')](_0x2799('0x21'),_0x2799('0x22')+_0x4261a9[_0x18f616]+_0x2799('0x23'));_0x5b1d1c=_0x482aae;}_0x239799[_0x2799('0x19')]=_0x5b1d1c;}_0x2318c2['body']=_0x239799['html'];}else{_0x2318c2[_0x2799('0x24')]=_0x239799[_0x2799('0x25')];}if(_0x2318c2['body']){_0x2318c2['body']=_0x2318c2[_0x2799('0x24')][_0x2799('0x1a')](/<a\s+/gi,_0x2799('0x26'));}if(_0x239799['to']){_0x2318c2['message'][_0x2799('0x27')]=getMails(null,_0x239799['to']);var _0x199633=getMails(_0x2f66f0[_0x2799('0x6')],_0x239799['to']);if(!_['isEmpty'](_0x199633)){_0x2318c2['message']['cc']+=_0x199633;}}if(_0x239799['cc']){_0x2318c2[_0x2799('0x28')]['originCc']=getMails(null,_0x239799['cc']);var _0x14c9c0=getMails(_0x2f66f0[_0x2799('0x6')],_0x239799['cc']);if(!_[_0x2799('0x17')](_0x14c9c0)){if(!_['isEmpty'](_0x2318c2['message']['cc'])){_0x2318c2[_0x2799('0x28')]['cc']+=',';}_0x2318c2[_0x2799('0x28')]['cc']+=_0x14c9c0;}}if(!_[_0x2799('0x1b')](_0x2318c2[_0x2799('0x28')][_0x2799('0x27')],_0x2f66f0[_0x2799('0x6')])&&!_['includes'](_0x2318c2[_0x2799('0x28')][_0x2799('0x29')],_0x2f66f0['email'])){_0x2318c2['message'][_0x2799('0x2a')]=_0x2f66f0['email'];}if(_0x239799[_0x2799('0x1d')]&&_0x239799[_0x2799('0x1d')]['length']){_0x2318c2[_0x2799('0x28')][_0x2799('0x2b')]=_0x239799[_0x2799('0x1d')][_0x2799('0x11')];for(var _0xb0cc3a=0x0,_0x506621,_0x3188a3,_0x390e71;_0xb0cc3a<_0x239799[_0x2799('0x1d')][_0x2799('0x11')];_0xb0cc3a+=0x1){if(_0x239799[_0x2799('0x1d')][_0xb0cc3a]['type']===_0x2799('0x2c')){_0x390e71=_0x239799[_0x2799('0x1d')][_0xb0cc3a]['filename']||_0x2799('0x2d')+_0xb0cc3a;_0x506621=util[_0x2799('0x2e')](_0x2799('0x2f'),Date[_0x2799('0x30')](),_0x390e71);_0x3188a3=path[_0x2799('0x13')](config[_0x2799('0x31')],_0x2799('0x32'),_0x506621);fs[_0x2799('0x33')](_0x3188a3,_0x239799[_0x2799('0x1d')][_0xb0cc3a][_0x2799('0x34')]);_0x2318c2[_0x2799('0x28')][_0x2799('0x1d')]['push']({'name':_0x390e71,'basename':_0x506621,'type':_0x239799[_0x2799('0x1d')][_0xb0cc3a][_0x2799('0x35')],'filepath':_0x3188a3});}}}if(_0x239799[_0x2799('0x36')]&&_0x239799[_0x2799('0x36')][_0x2799('0x11')]>0x0){var _0x1f6907=[_0x2799('0x37'),_0x2799('0x38'),_0x2799('0x39')];for(var _0x55cd11=0x0;_0x55cd11<_0x239799['headerLines'][_0x2799('0x11')];_0x55cd11++){var _0x130a1e=_[_0x2799('0xf')](_0x1f6907,_0x239799[_0x2799('0x36')][_0x55cd11][_0x2799('0x3a')]);if(_0x130a1e>=0x0){_0x2318c2[_0x2799('0x3b')]=!![];}}}return _0x2318c2;}exports[_0x2799('0x3c')]=function(_0x4d3cff,_0x4d2100,_0x369f1f){var _0x9114d4={'from':getAddress(_0x4d2100[_0x2799('0x3d')]),'firstName':getFirstName(_0x4d2100[_0x2799('0x3d')]),'lastName':getLastName(_0x4d2100[_0x2799('0x3d')]),'mapKey':'email','message':{'from':getMails(_0x4d3cff[_0x2799('0x6')],_0x4d2100['from']),'to':_0x4d3cff[_0x2799('0x6')],'cc':'','subject':_0x4d2100[_0x2799('0x3e')]||'','messageId':_0x4d2100['messageId'],'inReplyTo':_0x4d2100[_0x2799('0x3f')],'sentAt':moment(_0x4d2100['date'])[_0x2799('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x4d2100['html']&&!_0x4d2100['textAsHtml']){var _0x18cd2b=_[_0x2799('0x40')](_0x4d2100[_0x2799('0x1d')],{'contentType':_0x2799('0x41')});if(_0x18cd2b['length']){logger[_0x2799('0x42')](util[_0x2799('0x2e')](_0x2799('0x43'),_0x4d2100[_0x2799('0x44')]));tnef[_0x2799('0x45')](_[_0x2799('0x46')](_0x18cd2b)[_0x2799('0x34')],function(_0x398d77,_0x41cf77){if(_0x41cf77){_0x4d2100[_0x2799('0x19')]=_0x41cf77[_0x2799('0x47')]||_0x2799('0x48');if(_0x41cf77[_0x2799('0x49')]){for(var _0x21e0a=0x0;_0x21e0a<_0x41cf77['Attachments']['length'];_0x21e0a++){var _0x4c6901=_0x41cf77[_0x2799('0x49')][_0x21e0a];_0x9114d4[_0x2799('0x28')][_0x2799('0x1d')][_0x2799('0x4a')]({'filename':_0x4c6901[_0x2799('0x4b')],'content':Buffer[_0x2799('0x3d')](_0x4c6901[_0x2799('0x4c')])});}}}_0x369f1f(parseEmail(_0x4d3cff,_0x4d2100,_0x9114d4));});}else{_0x4d2100[_0x2799('0x19')]=_0x2799('0x48');_0x369f1f(parseEmail(_0x4d3cff,_0x4d2100,_0x9114d4));}}else{_0x369f1f(parseEmail(_0x4d3cff,_0x4d2100,_0x9114d4));}};exports[_0x2799('0x4d')]=function(_0x3e93a4,_0x1f815c){var _0x2c6938=[_0x2799('0x4e')+(_0x1f815c||''),_0x2799('0x4f')+_0x3e93a4,'',''];return Buffer[_0x2799('0x3d')](_0x2c6938[_0x2799('0x13')]('\ 1'),'utf-8')[_0x2799('0x50')](_0x2799('0x51'));};
\ No newline at end of file
+var _0x20c3=['first','content','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','base64','moment','randomstring','util','node-tnef','../../../config/environment','head','address','anonymous','@xcally.com','value','name','substring','indexOf','split','slice','join','Anonymous','length','generate','html','test','includes','<img','attachments','forEach','replace','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','<a\x20target=\x22_blank\x22\x20','message','originTo','isEmpty','originCc','email','attach','attachment-','format','%s-%s','now','root','server/files/attachments/','push','contentType','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','isAutoreply','from','subject','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','textAsHtml','filter','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x20c3,0x12d));var _0x320c=function(_0x3b5261,_0x1ef320){_0x3b5261=_0x3b5261-0x0;var _0x477f31=_0x20c3[_0x3b5261];return _0x477f31;};'use strict';var _=require('lodash');var moment=require(_0x320c('0x0'));var random=require(_0x320c('0x1'));var fs=require('fs');var path=require('path');var util=require(_0x320c('0x2'));var tnef=require(_0x320c('0x3'));var logger=require('../../../config/logger')('email');var config=require(_0x320c('0x4'));function getAddress(_0x3b78e7){var _0x2a800f=_[_0x320c('0x5')](_0x3b78e7['value']);return _0x2a800f&&_0x2a800f[_0x320c('0x6')]?_0x2a800f[_0x320c('0x6')]:_0x320c('0x7')+random['generate'](0x6)+_0x320c('0x8');}function getFirstName(_0x4a25eb){var _0x9868f0=_[_0x320c('0x5')](_0x4a25eb[_0x320c('0x9')]);if(_0x9868f0&&_0x9868f0[_0x320c('0xa')]){if(_0x9868f0['name']==_0x9868f0[_0x320c('0x6')]){return _0x9868f0[_0x320c('0xa')][_0x320c('0xb')](0x0,_0x9868f0[_0x320c('0xa')][_0x320c('0xc')]('@'));}var _0x4a80a6=_0x9868f0[_0x320c('0xa')][_0x320c('0xd')](/\s+/);return _0x4a80a6['length']>0x1?_0x4a80a6[_0x320c('0xe')](0x0,-0x1)[_0x320c('0xf')]('\x20'):_0x9868f0['name'];}return _0x320c('0x10');}function getLastName(_0x5bafd1){var _0x5a4d13=_[_0x320c('0x5')](_0x5bafd1[_0x320c('0x9')]);if(_0x5a4d13&&_0x5a4d13[_0x320c('0xa')]){var _0x1bbe85=_0x5a4d13[_0x320c('0xa')][_0x320c('0xd')](/\s+/);return _0x1bbe85[_0x320c('0x11')]>0x1?_0x1bbe85['pop']():'';}return'';}function getMails(_0x50e2f3,_0x3a3a8e){var _0x4c7572='';for(var _0x3747ba=0x0;_0x3747ba<_0x3a3a8e['value'][_0x320c('0x11')];_0x3747ba+=0x1){if(_0x3a3a8e[_0x320c('0x9')][_0x3747ba]['address']!==_0x50e2f3){if(!_['isEmpty'](_0x4c7572)){_0x4c7572+=',';}_0x4c7572+=_0x3a3a8e[_0x320c('0x9')][_0x3747ba][_0x320c('0xa')]||_0x3a3a8e[_0x320c('0x9')][_0x3747ba][_0x320c('0x6')]||'';_0x4c7572+='\x20<';_0x4c7572+=_0x3a3a8e[_0x320c('0x9')][_0x3747ba]['address']?_0x3a3a8e['value'][_0x3747ba][_0x320c('0x6')]:_0x320c('0x7')+random[_0x320c('0x12')](0x6)+'@xcally.com';_0x4c7572+='>';}}return _0x4c7572;}function parseEmail(_0x1f2449,_0x4a5a83,_0x4f1fdb){if(_0x4a5a83[_0x320c('0x13')]){var _0x119dc8=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x119dc8[_0x320c('0x14')](_0x4a5a83[_0x320c('0x13')])){_0x4a5a83[_0x320c('0x13')]=_0x4a5a83[_0x320c('0x13')]['replace'](_0x119dc8,'');}if(_0x4a5a83['html'][_0x320c('0x15')](_0x320c('0x16'))){var _0x4a184d=[];_0x4a5a83[_0x320c('0x17')][_0x320c('0x18')](_0x3ce815=>{_0x4a184d['push'](_0x3ce815['filename']);});var _0x11cad8=/<img.*? _SRC(.*?)[^>]+>/g;var _0x9cc106=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xa9e037=_0x4a5a83[_0x320c('0x13')][_0x320c('0x19')](_0x9cc106,'_SRC');var _0x246aed=_0xa9e037['replace'](_0x11cad8,_0x320c('0x1a'));for(let _0x16314a=0x0;_0x16314a<_0x4a184d[_0x320c('0x11')];_0x16314a++){var _0xc4fe=_0x246aed[_0x320c('0x19')]('_IMG',_0x320c('0x1b')+_0x4a184d[_0x16314a]+_0x320c('0x1c'));_0x246aed=_0xc4fe;}_0x4a5a83[_0x320c('0x13')]=_0x246aed;}_0x4f1fdb[_0x320c('0x1d')]=_0x4a5a83['html'];}else{_0x4f1fdb[_0x320c('0x1d')]=_0x4a5a83['textAsHtml'];}if(_0x4f1fdb['body']){_0x4f1fdb[_0x320c('0x1d')]=_0x4f1fdb[_0x320c('0x1d')][_0x320c('0x19')](/<a\s+/gi,_0x320c('0x1e'));}if(_0x4a5a83['to']){_0x4f1fdb[_0x320c('0x1f')][_0x320c('0x20')]=getMails(null,_0x4a5a83['to']);var _0x177a26=getMails(_0x1f2449['email'],_0x4a5a83['to']);if(!_[_0x320c('0x21')](_0x177a26)){_0x4f1fdb[_0x320c('0x1f')]['cc']+=_0x177a26;}}if(_0x4a5a83['cc']){_0x4f1fdb[_0x320c('0x1f')][_0x320c('0x22')]=getMails(null,_0x4a5a83['cc']);var _0x3a88eb=getMails(_0x1f2449[_0x320c('0x23')],_0x4a5a83['cc']);if(!_[_0x320c('0x21')](_0x3a88eb)){if(!_['isEmpty'](_0x4f1fdb[_0x320c('0x1f')]['cc'])){_0x4f1fdb[_0x320c('0x1f')]['cc']+=',';}_0x4f1fdb['message']['cc']+=_0x3a88eb;}}if(!_[_0x320c('0x15')](_0x4f1fdb[_0x320c('0x1f')][_0x320c('0x20')],_0x1f2449[_0x320c('0x23')])&&!_[_0x320c('0x15')](_0x4f1fdb[_0x320c('0x1f')][_0x320c('0x22')],_0x1f2449[_0x320c('0x23')])){_0x4f1fdb['message']['bcc']=_0x1f2449['email'];}if(_0x4a5a83[_0x320c('0x17')]&&_0x4a5a83[_0x320c('0x17')][_0x320c('0x11')]){_0x4f1fdb[_0x320c('0x1f')][_0x320c('0x24')]=_0x4a5a83[_0x320c('0x17')][_0x320c('0x11')];for(var _0x3a3090=0x0,_0x26cf19,_0x47a96b,_0x13dbdb;_0x3a3090<_0x4a5a83[_0x320c('0x17')][_0x320c('0x11')];_0x3a3090+=0x1){if(_0x4a5a83[_0x320c('0x17')][_0x3a3090]['type']==='attachment'){_0x13dbdb=_0x4a5a83[_0x320c('0x17')][_0x3a3090]['filename']||_0x320c('0x25')+_0x3a3090;_0x26cf19=util[_0x320c('0x26')](_0x320c('0x27'),Date[_0x320c('0x28')](),_0x13dbdb);_0x47a96b=path[_0x320c('0xf')](config[_0x320c('0x29')],_0x320c('0x2a'),_0x26cf19);fs['writeFileSync'](_0x47a96b,_0x4a5a83[_0x320c('0x17')][_0x3a3090]['content']);_0x4f1fdb['message'][_0x320c('0x17')][_0x320c('0x2b')]({'name':_0x13dbdb,'basename':_0x26cf19,'type':_0x4a5a83['attachments'][_0x3a3090][_0x320c('0x2c')],'filepath':_0x47a96b});}}}if(_0x4a5a83[_0x320c('0x2d')]&&_0x4a5a83['headerLines'][_0x320c('0x11')]>0x0){var _0x28737c=['Auto-Submitted:\x20auto-replied',_0x320c('0x2e'),_0x320c('0x2f')];for(var _0x273995=0x0;_0x273995<_0x4a5a83[_0x320c('0x2d')]['length'];_0x273995++){var _0x217a06=_[_0x320c('0xc')](_0x28737c,_0x4a5a83[_0x320c('0x2d')][_0x273995]['line']);if(_0x217a06>=0x0){_0x4f1fdb[_0x320c('0x30')]=!![];}}}return _0x4f1fdb;}exports['parser']=function(_0xc50013,_0x646e31,_0x4deb3a){var _0x4eee90={'from':getAddress(_0x646e31[_0x320c('0x31')]),'firstName':getFirstName(_0x646e31['from']),'lastName':getLastName(_0x646e31[_0x320c('0x31')]),'mapKey':_0x320c('0x23'),'message':{'from':getMails(_0xc50013['email'],_0x646e31['from']),'to':_0xc50013[_0x320c('0x23')],'cc':'','subject':_0x646e31[_0x320c('0x32')]||'','messageId':_0x646e31['messageId'],'inReplyTo':_0x646e31[_0x320c('0x33')],'sentAt':moment(_0x646e31[_0x320c('0x34')])['format'](_0x320c('0x35')),'attach':![],'attachments':[]}};if(!_0x646e31[_0x320c('0x13')]&&!_0x646e31[_0x320c('0x36')]){var _0x47768c=_[_0x320c('0x37')](_0x646e31[_0x320c('0x17')],{'contentType':_0x320c('0x38')});if(_0x47768c[_0x320c('0x11')]){logger['info'](util[_0x320c('0x26')](_0x320c('0x39'),_0x646e31['messageId']));tnef[_0x320c('0x3a')](_[_0x320c('0x3b')](_0x47768c)[_0x320c('0x3c')],function(_0x325214,_0x2ae996){if(_0x2ae996){_0x646e31[_0x320c('0x13')]=_0x2ae996[_0x320c('0x3d')]||_0x320c('0x3e');if(_0x2ae996['Attachments']){for(var _0xccacb=0x0;_0xccacb<_0x2ae996[_0x320c('0x3f')][_0x320c('0x11')];_0xccacb++){var _0x3dbfac=_0x2ae996[_0x320c('0x3f')][_0xccacb];_0x4eee90[_0x320c('0x1f')]['attachments'][_0x320c('0x2b')]({'filename':_0x3dbfac[_0x320c('0x40')],'content':Buffer[_0x320c('0x31')](_0x3dbfac[_0x320c('0x41')])});}}}_0x4deb3a(parseEmail(_0xc50013,_0x646e31,_0x4eee90));});}else{_0x646e31['html']=_0x320c('0x3e');_0x4deb3a(parseEmail(_0xc50013,_0x646e31,_0x4eee90));}}else{_0x4deb3a(parseEmail(_0xc50013,_0x646e31,_0x4eee90));}};exports[_0x320c('0x42')]=function(_0x48ada9,_0x2f0d29){var _0x13a4ce=[_0x320c('0x43')+(_0x2f0d29||''),_0x320c('0x44')+_0x48ada9,'',''];return Buffer[_0x320c('0x31')](_0x13a4ce[_0x320c('0xf')]('\ 1'),_0x320c('0x45'))[_0x320c('0x46')](_0x320c('0x47'));};
\ No newline at end of file
index 7615127..dcdaf19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa69=['SERV','active','Imap','Smtp','lodash','name','Service','key'];(function(_0x221b20,_0x4d612d){var _0x23d251=function(_0x4e814d){while(--_0x4e814d){_0x221b20['push'](_0x221b20['shift']());}};_0x23d251(++_0x4d612d);}(_0xfa69,0x94));var _0x9fa6=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xfa69[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x9fa6('0x0'));function MailAccount(_0x3c45d7){this['id']=_0x3c45d7['id']||0x0;this[_0x9fa6('0x1')]=_0x3c45d7[_0x9fa6('0x1')]||_0x9fa6('0x2');this[_0x9fa6('0x3')]=_0x3c45d7[_0x9fa6('0x3')]||_0x9fa6('0x4');this[_0x9fa6('0x5')]=_0x3c45d7[_0x9fa6('0x5')]||![];this[_0x9fa6('0x6')]=_0x3c45d7[_0x9fa6('0x6')]||[];this[_0x9fa6('0x7')]=_0x3c45d7[_0x9fa6('0x7')]||[];}module['exports']=MailAccount;
\ No newline at end of file
+var _0xc6cf=['Imap','Smtp','lodash','name','Service','key','SERV','active'];(function(_0x130bac,_0x4f3f37){var _0x559a41=function(_0x2b8376){while(--_0x2b8376){_0x130bac['push'](_0x130bac['shift']());}};_0x559a41(++_0x4f3f37);}(_0xc6cf,0x8a));var _0xfc6c=function(_0x3d7422,_0x48a959){_0x3d7422=_0x3d7422-0x0;var _0x43a736=_0xc6cf[_0x3d7422];return _0x43a736;};'use strict';var _=require(_0xfc6c('0x0'));function MailAccount(_0x2e776e){this['id']=_0x2e776e['id']||0x0;this[_0xfc6c('0x1')]=_0x2e776e[_0xfc6c('0x1')]||_0xfc6c('0x2');this['key']=_0x2e776e[_0xfc6c('0x3')]||_0xfc6c('0x4');this[_0xfc6c('0x5')]=_0x2e776e[_0xfc6c('0x5')]||![];this['Imap']=_0x2e776e[_0xfc6c('0x6')]||[];this[_0xfc6c('0x7')]=_0x2e776e['Smtp']||[];}module['exports']=MailAccount;
\ No newline at end of file
index 0b23f26..7370db2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61af=['length','isUndefined','merge','exports','lodash','mailAccounts','mapKeys','prototype','mergeFromDatabase','initMailAccounts'];(function(_0x589b3c,_0x1ab5b8){var _0x2d2d35=function(_0x3bcc5d){while(--_0x3bcc5d){_0x589b3c['push'](_0x589b3c['shift']());}};_0x2d2d35(++_0x1ab5b8);}(_0x61af,0x18a));var _0xf61a=function(_0x33efcc,_0x2ebf86){_0x33efcc=_0x33efcc-0x0;var _0x2e9f19=_0x61af[_0x33efcc];return _0x2e9f19;};'use strict';var _=require(_0xf61a('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xf61a('0x1')]={};};function freeIsNotKey(_0x212659,_0x53427d,_0x46dadc){var _0x4efe5a=_[_0xf61a('0x2')](_0x212659,function(_0x2e2ce4,_0x5e0d2f){return _0x2e2ce4[_0x46dadc];});for(var _0x53829b in _0x53427d){if(_0x53427d['hasOwnProperty'](_0x53829b)){if(!_0x4efe5a[_0x53829b]){delete _0x53427d[_0x53829b];}}}}Realtime[_0xf61a('0x3')][_0xf61a('0x4')]=function(_0x23fd22,_0x4e09c3){for(var _0x4d4775 in _0x4e09c3){if(_0x23fd22['hasOwnProperty'](_0x4d4775)){_0x23fd22[_0x4d4775]=_0x4e09c3[_0x4d4775];}}};Realtime['prototype'][_0xf61a('0x5')]=function(){var _0x5b7a2e=this;return function(_0x250350){if(_0x250350){freeIsNotKey(_0x250350,_0x5b7a2e['mailAccounts'],'id');for(var _0x4199df=0x0,_0x2cfc46={},_0x1fcd94={};_0x4199df<_0x250350[_0xf61a('0x6')];_0x4199df+=0x1){_0x2cfc46=_0x250350[_0x4199df];if(_[_0xf61a('0x7')](_0x5b7a2e[_0xf61a('0x1')][_0x2cfc46['id']])){_0x5b7a2e[_0xf61a('0x1')][_0x2cfc46['id']]=new MailAccount(_0x2cfc46);}else{_[_0xf61a('0x8')](_0x5b7a2e[_0xf61a('0x1')][_0x2cfc46['id']],_0x2cfc46);}}}return _0x5b7a2e[_0xf61a('0x1')];};};module[_0xf61a('0x9')]=Realtime;
\ No newline at end of file
+var _0x62fc=['hasOwnProperty','mergeFromDatabase','prototype','initMailAccounts','length','isUndefined','merge','../model/mailAccount','mailAccounts'];(function(_0x2c7b86,_0x59ef3c){var _0x256735=function(_0x352e33){while(--_0x352e33){_0x2c7b86['push'](_0x2c7b86['shift']());}};_0x256735(++_0x59ef3c);}(_0x62fc,0x1ae));var _0xc62f=function(_0x1a3e64,_0x33926a){_0x1a3e64=_0x1a3e64-0x0;var _0x4a8e79=_0x62fc[_0x1a3e64];return _0x4a8e79;};'use strict';var _=require('lodash');var MailAccount=require(_0xc62f('0x0'));var Realtime=function(){this[_0xc62f('0x1')]={};};function freeIsNotKey(_0x20a534,_0x282440,_0x32dec2){var _0x564eb2=_['mapKeys'](_0x20a534,function(_0x1f4502,_0x423877){return _0x1f4502[_0x32dec2];});for(var _0x1f4740 in _0x282440){if(_0x282440[_0xc62f('0x2')](_0x1f4740)){if(!_0x564eb2[_0x1f4740]){delete _0x282440[_0x1f4740];}}}}Realtime['prototype'][_0xc62f('0x3')]=function(_0x2eb0d9,_0x1aa9f2){for(var _0x339cc7 in _0x1aa9f2){if(_0x2eb0d9['hasOwnProperty'](_0x339cc7)){_0x2eb0d9[_0x339cc7]=_0x1aa9f2[_0x339cc7];}}};Realtime[_0xc62f('0x4')][_0xc62f('0x5')]=function(){var _0x29d9b7=this;return function(_0x19b960){if(_0x19b960){freeIsNotKey(_0x19b960,_0x29d9b7[_0xc62f('0x1')],'id');for(var _0x335a84=0x0,_0x4354a8={},_0x381f4d={};_0x335a84<_0x19b960[_0xc62f('0x6')];_0x335a84+=0x1){_0x4354a8=_0x19b960[_0x335a84];if(_[_0xc62f('0x7')](_0x29d9b7[_0xc62f('0x1')][_0x4354a8['id']])){_0x29d9b7['mailAccounts'][_0x4354a8['id']]=new MailAccount(_0x4354a8);}else{_[_0xc62f('0x8')](_0x29d9b7[_0xc62f('0x1')][_0x4354a8['id']],_0x4354a8);}}}return _0x29d9b7[_0xc62f('0x1')];};};module['exports']=Realtime;
\ No newline at end of file
index da74e07..93bbda7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82c4=['CloudProvider','type','data5','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','provider','service','active','ListId','MailServerIn'];(function(_0x2fee96,_0x2f735d){var _0x2e6ad1=function(_0x2c55ad){while(--_0x2c55ad){_0x2fee96['push'](_0x2fee96['shift']());}};_0x2e6ad1(++_0x2f735d);}(_0x82c4,0x1ca));var _0x482c=function(_0x24a711,_0x2c44e7){_0x24a711=_0x24a711-0x0;var _0x24dad5=_0x82c4[_0x24a711];return _0x24dad5;};'use strict';var client=require(_0x482c('0x0'));exports[_0x482c('0x1')]=function(){return function(){return client[_0x482c('0x2')](_0x482c('0x3'),{'options':{'attributes':['id',_0x482c('0x4'),_0x482c('0x5'),_0x482c('0x6'),'email',_0x482c('0x7'),'key',_0x482c('0x8'),'TemplateId'],'raw':![],'include':[{'model':_0x482c('0x9'),'as':'Imap','include':[{'model':_0x482c('0xa'),'attributes':['id',_0x482c('0x4'),_0x482c('0x6'),_0x482c('0xb'),_0x482c('0xc')],'as':'CloudProvider'}]},{'model':_0x482c('0xd'),'as':_0x482c('0xe'),'include':[{'model':_0x482c('0xa'),'attributes':['id',_0x482c('0x4'),_0x482c('0x6'),_0x482c('0xb'),'data5'],'as':_0x482c('0xa')}]}]},'log':_0x482c('0xf')});};};exports[_0x482c('0x10')]=function(_0x5e3eea,_0x3f8ed2){return client[_0x482c('0x2')](_0x482c('0x11'),{'account':{'id':_0x5e3eea},'body':_0x3f8ed2,'log':'NotifyMailAccount'});};
\ No newline at end of file
+var _0x13f5=['type','data5','Smtp','getMailAccount','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','provider','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','name','service'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x13f5,0xc3));var _0x513f=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x13f5[_0x1cc8fe];return _0x230054;};'use strict';var client=require(_0x513f('0x0'));exports[_0x513f('0x1')]=function(){return function(){return client[_0x513f('0x2')](_0x513f('0x3'),{'options':{'attributes':['id','name',_0x513f('0x4'),'service','email',_0x513f('0x5'),_0x513f('0x6'),_0x513f('0x7'),_0x513f('0x8')],'raw':![],'include':[{'model':_0x513f('0x9'),'as':_0x513f('0xa'),'include':[{'model':_0x513f('0xb'),'attributes':['id',_0x513f('0xc'),_0x513f('0xd'),_0x513f('0xe'),_0x513f('0xf')],'as':_0x513f('0xb')}]},{'model':'MailServerOut','as':_0x513f('0x10'),'include':[{'model':_0x513f('0xb'),'attributes':['id',_0x513f('0xc'),_0x513f('0xd'),_0x513f('0xe'),'data5'],'as':_0x513f('0xb')}]}]},'log':_0x513f('0x11')});};};exports['notify']=function(_0x166a1a,_0x243f48){return client[_0x513f('0x2')](_0x513f('0x12'),{'account':{'id':_0x166a1a},'body':_0x243f48,'log':_0x513f('0x12')});};
\ No newline at end of file
index e0d1c6e..9bad881 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0f7=['../client','getSettings','Request','ShowSetting'];(function(_0x106a93,_0x5e8fd0){var _0x197296=function(_0x2fee47){while(--_0x2fee47){_0x106a93['push'](_0x106a93['shift']());}};_0x197296(++_0x5e8fd0);}(_0xa0f7,0x84));var _0x7a0f=function(_0x550e25,_0x573ace){_0x550e25=_0x550e25-0x0;var _0x52f465=_0xa0f7[_0x550e25];return _0x52f465;};'use strict';var client=require(_0x7a0f('0x0'));exports[_0x7a0f('0x1')]=function(){return client[_0x7a0f('0x2')](_0x7a0f('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':'GetSettings'});};
\ No newline at end of file
+var _0xdf6d=['Request','loginMailFrequency','GetSettings','getSettings'];(function(_0x1a4a06,_0x36a5c2){var _0x49ec08=function(_0x497f24){while(--_0x497f24){_0x1a4a06['push'](_0x1a4a06['shift']());}};_0x49ec08(++_0x36a5c2);}(_0xdf6d,0x177));var _0xddf6=function(_0x4ca5cc,_0x12ec09){_0x4ca5cc=_0x4ca5cc-0x0;var _0x98d8f9=_0xdf6d[_0x4ca5cc];return _0x98d8f9;};'use strict';var client=require('../client');exports[_0xddf6('0x0')]=function(){return client[_0xddf6('0x1')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xddf6('0x2')]},'log':_0xddf6('0x3')});};
\ No newline at end of file
index de5206b..a6c916e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
+var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
index 76d3460..354127e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23ae=['adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','timeout','listen','port','websocket','polling','redis','defaults','localhost'];(function(_0x12d48a,_0x3f85ad){var _0x3b1836=function(_0x38c3c6){while(--_0x38c3c6){_0x12d48a['push'](_0x12d48a['shift']());}};_0x3b1836(++_0x3f85ad);}(_0x23ae,0x1ea));var _0xe23a=function(_0x365c0a,_0x26dcb7){_0x365c0a=_0x365c0a-0x0;var _0x19e3e7=_0x23ae[_0x365c0a];return _0x19e3e7;};'use strict';var _=require('lodash');var http=require(_0xe23a('0x0'));var express=require(_0xe23a('0x1'));var sticky=require('sticky-session');var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http['createServer'](app);server[_0xe23a('0x2')]=0xdbba0;if(sticky[_0xe23a('0x3')](server,config[_0xe23a('0x4')])){var socketio=require('socket.io')(server,{'transports':[_0xe23a('0x5'),_0xe23a('0x6')]});config[_0xe23a('0x7')]=_[_0xe23a('0x8')](config[_0xe23a('0x7')],{'host':_0xe23a('0x9'),'port':0x18eb});socketio[_0xe23a('0xa')](require(_0xe23a('0xb'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0xe23a('0x7')])}));require(_0xe23a('0xc'))[_0xe23a('0xd')]();require(_0xe23a('0xe'))[_0xe23a('0xd')](socketio);require(_0xe23a('0xf'))[_0xe23a('0xd')](app);require(_0xe23a('0x10'))[_0xe23a('0xd')](app);}else{server[_0xe23a('0x11')]('listening',function(){console['log'](_0xe23a('0x12'),config[_0xe23a('0x4')]);});}exports=module[_0xe23a('0x13')]=app;
\ No newline at end of file
+var _0xaa88=['ioredis','../../config/environment','createServer','timeout','listen','socket.io','websocket','polling','localhost','adapter','socket.io-redis','redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','express'];(function(_0x4a9053,_0x1856fb){var _0x475a0a=function(_0x289340){while(--_0x289340){_0x4a9053['push'](_0x4a9053['shift']());}};_0x475a0a(++_0x1856fb);}(_0xaa88,0x143));var _0x8aa8=function(_0x350182,_0x2a9feb){_0x350182=_0x350182-0x0;var _0x4a0892=_0xaa88[_0x350182];return _0x4a0892;};'use strict';var _=require(_0x8aa8('0x0'));var http=require('http');var express=require(_0x8aa8('0x1'));var sticky=require('sticky-session');var Redis=require(_0x8aa8('0x2'));var config=require(_0x8aa8('0x3'));var app=express();var server=http[_0x8aa8('0x4')](app);server[_0x8aa8('0x5')]=0xdbba0;if(sticky[_0x8aa8('0x6')](server,config['port'])){var socketio=require(_0x8aa8('0x7'))(server,{'transports':[_0x8aa8('0x8'),_0x8aa8('0x9')]});config['redis']=_['defaults'](config['redis'],{'host':_0x8aa8('0xa'),'port':0x18eb});socketio[_0x8aa8('0xb')](require(_0x8aa8('0xc'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x8aa8('0xd')])}));require(_0x8aa8('0xe'))[_0x8aa8('0xf')]();require(_0x8aa8('0x10'))['default'](socketio);require(_0x8aa8('0x11'))['default'](app);require(_0x8aa8('0x12'))[_0x8aa8('0xf')](app);}else{server[_0x8aa8('0x13')](_0x8aa8('0x14'),function(){console[_0x8aa8('0x15')](_0x8aa8('0x16'),config[_0x8aa8('0x17')]);});}exports=module[_0x8aa8('0x18')]=app;
\ No newline at end of file
index fc62375..cdc7d8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x655f=['routing','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','error'];(function(_0x345841,_0x5d813e){var _0x185748=function(_0x21ce59){while(--_0x21ce59){_0x345841['push'](_0x345841['shift']());}};_0x185748(++_0x5d813e);}(_0x655f,0xd7));var _0xf655=function(_0x460214,_0xcd081d){_0x460214=_0x460214-0x0;var _0x31462e=_0x655f[_0x460214];return _0x31462e;};'use strict';var jayson=require(_0xf655('0x0'));var BPromise=require(_0xf655('0x1'));var logger=require(_0xf655('0x2'))('routing');var client=jayson[_0xf655('0x3')][_0xf655('0x4')]({'port':0x2329});client[_0xf655('0x5')]=function(_0x19d5dc,_0x4f4c0d){return new BPromise(function(_0x211843,_0x50c91b){return client[_0xf655('0x6')](_0x19d5dc,_0x4f4c0d)[_0xf655('0x7')](function(_0x3da281){logger[_0xf655('0x8')]('rpc','routing',_0x19d5dc,_0x4f4c0d,_0x3da281);if(_0x3da281[_0xf655('0x9')]){logger['error']('rpc',_0xf655('0xa'),_0x19d5dc,_0x3da281[_0xf655('0x9')][_0xf655('0xb')],_0x4f4c0d);return _0x50c91b(_0x3da281[_0xf655('0x9')][_0xf655('0xb')]);}else{return _0x211843(_0x3da281[_0xf655('0xc')]);}})[_0xf655('0xd')](function(_0x2891d6){logger['error']('rpc',_0xf655('0xa'),_0x19d5dc,_0x2891d6,_0x4f4c0d);return _0x50c91b(_0x2891d6);});});};module[_0xf655('0xe')]=client;
\ No newline at end of file
+var _0x4d67=['error','message','result','catch','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','rpc'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0x4d67,0x1f3));var _0x74d6=function(_0x39347c,_0x79842f){_0x39347c=_0x39347c-0x0;var _0x438a63=_0x4d67[_0x39347c];return _0x438a63;};'use strict';var jayson=require(_0x74d6('0x0'));var BPromise=require(_0x74d6('0x1'));var logger=require(_0x74d6('0x2'))(_0x74d6('0x3'));var client=jayson[_0x74d6('0x4')][_0x74d6('0x5')]({'port':0x2329});client[_0x74d6('0x6')]=function(_0x2432cd,_0x31e6f1){return new BPromise(function(_0x240a91,_0x14ed95){return client[_0x74d6('0x7')](_0x2432cd,_0x31e6f1)[_0x74d6('0x8')](function(_0x313567){logger[_0x74d6('0x9')](_0x74d6('0xa'),_0x74d6('0x3'),_0x2432cd,_0x31e6f1,_0x313567);if(_0x313567[_0x74d6('0xb')]){logger[_0x74d6('0xb')]('rpc',_0x74d6('0x3'),_0x2432cd,_0x313567[_0x74d6('0xb')][_0x74d6('0xc')],_0x31e6f1);return _0x14ed95(_0x313567['error'][_0x74d6('0xc')]);}else{return _0x240a91(_0x313567[_0x74d6('0xd')]);}})[_0x74d6('0xe')](function(_0x1dd552){logger['error'](_0x74d6('0xa'),_0x74d6('0x3'),_0x2432cd,_0x1dd552,_0x31e6f1);return _0x14ed95(_0x1dd552);});});};module['exports']=client;
\ No newline at end of file
index 953b93d..9de1f44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d74=['then','getAgents','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve'];(function(_0x11864a,_0x31ef75){var _0x2943f7=function(_0x4d7f95){while(--_0x4d7f95){_0x11864a['push'](_0x11864a['shift']());}};_0x2943f7(++_0x31ef75);}(_0x1d74,0x10a));var _0x41d7=function(_0x2e079d,_0x599552){_0x2e079d=_0x2e079d-0x0;var _0x45e51f=_0x1d74[_0x2e079d];return _0x45e51f;};'use strict';var BPromise=require('bluebird');var server=require(_0x41d7('0x0'));var Realtime=require(_0x41d7('0x1'));var user=require(_0x41d7('0x2'));var interval=require(_0x41d7('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x41d7('0x4'));var smsQueue=require(_0x41d7('0x5'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x41d7('0x6'));var whatsappQueue=require(_0x41d7('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x41d7('0x8')]()[_0x41d7('0x9')](user[_0x41d7('0xa')]())[_0x41d7('0x9')](realtime[_0x41d7('0xb')]())[_0x41d7('0x9')](interval[_0x41d7('0xc')]())['then'](realtime['initIntervals']())['then'](openchannelQueue[_0x41d7('0xd')]())[_0x41d7('0x9')](realtime[_0x41d7('0xe')]())[_0x41d7('0x9')](chatQueue[_0x41d7('0xf')]())[_0x41d7('0x9')](realtime[_0x41d7('0x10')]())[_0x41d7('0x9')](smsQueue[_0x41d7('0x11')]())[_0x41d7('0x9')](realtime[_0x41d7('0x12')]())[_0x41d7('0x9')](mailQueue['getMailQueues']())[_0x41d7('0x9')](realtime['initMailQueues']())[_0x41d7('0x9')](faxQueue[_0x41d7('0x13')]())['then'](realtime[_0x41d7('0x14')]())[_0x41d7('0x9')](whatsappQueue[_0x41d7('0x15')]())['then'](realtime['initWhatsappQueues']())[_0x41d7('0x9')](function(){return realtime;});}function main(){return server[_0x41d7('0x16')](realtime)['then'](function(_0x1f957f){return initRealtime();})[_0x41d7('0x9')](function(_0x2719d1){return setInterval(initRealtime,0x1388);})[_0x41d7('0x17')](function(_0x3e1943){console[_0x41d7('0x18')](_0x3e1943);});}main();
\ No newline at end of file
+var _0xe464=['./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','log','./server','./rpc/interval','./rpc/openchannelQueue'];(function(_0x2ccf12,_0x3ee89f){var _0x43ac6c=function(_0x56caaa){while(--_0x56caaa){_0x2ccf12['push'](_0x2ccf12['shift']());}};_0x43ac6c(++_0x3ee89f);}(_0xe464,0x15d));var _0x4e46=function(_0x118d80,_0x3c2a66){_0x118d80=_0x118d80-0x0;var _0x3099ce=_0xe464[_0x118d80];return _0x3099ce;};'use strict';var BPromise=require('bluebird');var server=require(_0x4e46('0x0'));var Realtime=require('./realtime');var user=require('./rpc/user');var interval=require(_0x4e46('0x1'));var openchannelQueue=require(_0x4e46('0x2'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x4e46('0x3'));var faxQueue=require(_0x4e46('0x4'));var whatsappQueue=require(_0x4e46('0x5'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x4e46('0x6')]()['then'](user['getAgents']())[_0x4e46('0x7')](realtime[_0x4e46('0x8')]())['then'](interval[_0x4e46('0x9')]())['then'](realtime[_0x4e46('0xa')]())['then'](openchannelQueue[_0x4e46('0xb')]())[_0x4e46('0x7')](realtime['initOpenchannelQueues']())['then'](chatQueue[_0x4e46('0xc')]())[_0x4e46('0x7')](realtime[_0x4e46('0xd')]())[_0x4e46('0x7')](smsQueue[_0x4e46('0xe')]())['then'](realtime['initSmsQueues']())[_0x4e46('0x7')](mailQueue[_0x4e46('0xf')]())[_0x4e46('0x7')](realtime[_0x4e46('0x10')]())[_0x4e46('0x7')](faxQueue[_0x4e46('0x11')]())['then'](realtime[_0x4e46('0x12')]())['then'](whatsappQueue[_0x4e46('0x13')]())[_0x4e46('0x7')](realtime[_0x4e46('0x14')]())[_0x4e46('0x7')](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x579d8d){return initRealtime();})[_0x4e46('0x7')](function(_0x31c674){return setInterval(initRealtime,0x1388);})['catch'](function(_0x212436){console[_0x4e46('0x15')](_0x212436);});}main();
\ No newline at end of file
index 529da47..c4fe995 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_0x36de10,_0xfe25e8){_0x36de10=_0x36de10-0x0;var _0x58100f=_0x1261[_0x36de10];return _0x58100f;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine;
\ No newline at end of file
+var _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x4da18a,_0x140da9){var _0x200f61=function(_0x2bbcd5){while(--_0x2bbcd5){_0x4da18a['push'](_0x4da18a['shift']());}};_0x200f61(++_0x140da9);}(_0x2ef3,0xba));var _0x32ef=function(_0x457b48,_0x371a78){_0x457b48=_0x457b48-0x0;var _0x30073a=_0x2ef3[_0x457b48];return _0x30073a;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine;
\ No newline at end of file
index ac5561c..51f12f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78ec=['http','then','error','message','sendMailMessage','SendMail','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x78ec,0x96));var _0xc78e=function(_0x4618fb,_0x512bb9){_0x4618fb=_0x4618fb-0x0;var _0x5e1563=_0x78ec[_0x4618fb];return _0x5e1563;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xc78e('0x0'));var client=jayson[_0xc78e('0x1')][_0xc78e('0x2')]({'port':0x232b});function request(_0xa7e6ff,_0x2c938c){return new BPromise(function(_0x3addb0,_0x20a69c){return client['request'](_0xa7e6ff,_0x2c938c)[_0xc78e('0x3')](function(_0xc303df){if(_0xc303df[_0xc78e('0x4')]){return _0x20a69c(_0xc303df[_0xc78e('0x4')][_0xc78e('0x5')]);}else{return _0x3addb0(_0xc303df['result']);}})['catch'](function(_0xb34693){return _0x20a69c(_0xb34693);});});}exports[_0xc78e('0x6')]=function(_0x3a0158,_0x24a353){return request(_0xc78e('0x7'),{'account':_0x3a0158,'message':_0x24a353});};
\ No newline at end of file
+var _0xc706=['then','error','message','result','sendMailMessage','SendMail','jayson/promise','client'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0xc706,0xb6));var _0x6c70=function(_0x174536,_0x1e8bb5){_0x174536=_0x174536-0x0;var _0xf47484=_0xc706[_0x174536];return _0xf47484;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x6c70('0x0'));var client=jayson[_0x6c70('0x1')]['http']({'port':0x232b});function request(_0x3b3113,_0x5c31a2){return new BPromise(function(_0x27b1e0,_0x312fc6){return client['request'](_0x3b3113,_0x5c31a2)[_0x6c70('0x2')](function(_0x22cc53){if(_0x22cc53[_0x6c70('0x3')]){return _0x312fc6(_0x22cc53['error'][_0x6c70('0x4')]);}else{return _0x27b1e0(_0x22cc53[_0x6c70('0x5')]);}})['catch'](function(_0x5b91c8){return _0x312fc6(_0x5b91c8);});});}exports[_0x6c70('0x6')]=function(_0x363524,_0x27bd68){return request(_0x6c70('0x7'),{'account':_0x363524,'message':_0x27bd68});};
\ No newline at end of file
index bc91af0..62515e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x256e=['getChannelStatus','toNumber','format','Status','faxCurrentCapacity','smsStatus','whatsappStatusTime','user:save','lodash','moment','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','prototype','CurrentCapacity','Capacity','maxcapacity','working','updateRealtime','mail','chat','openchannel','fax','sms','whatsapp','length'];(function(_0x4ed8d0,_0x3958df){var _0x52514e=function(_0x397a5f){while(--_0x397a5f){_0x4ed8d0['push'](_0x4ed8d0['shift']());}};_0x52514e(++_0x3958df);}(_0x256e,0x176));var _0xe256=function(_0x4972f1,_0x58f4c9){_0x4972f1=_0x4972f1-0x0;var _0x2449e7=_0x256e[_0x4972f1];return _0x2449e7;};'use strict';var _=require(_0xe256('0x0'));var moment=require(_0xe256('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0xe256('0x2'));config[_0xe256('0x3')]=_[_0xe256('0x4')](config[_0xe256('0x3')],{'host':_0xe256('0x5'),'port':0x18eb});var io=require(_0xe256('0x6'))(new Redis(config[_0xe256('0x3')]));function Agent(_0x39efbd){this['id']=_0x39efbd['id']||0x0;this[_0xe256('0x7')]=_0x39efbd[_0xe256('0x7')]||'';this[_0xe256('0x8')]=_0x39efbd[_0xe256('0x8')]||!![];this[_0xe256('0x9')]=_0x39efbd['voicePause']||![];this[_0xe256('0xa')]=_0x39efbd['chatPause']||![];this[_0xe256('0xb')]=_0x39efbd['mailPause']||![];this[_0xe256('0xc')]=_0x39efbd[_0xe256('0xc')]||![];this[_0xe256('0xd')]=_0x39efbd[_0xe256('0xd')]||![];this[_0xe256('0xe')]=_0x39efbd['openchannelPause']||![];this[_0xe256('0xf')]=_0xe256('0x10');this[_0xe256('0x11')]=0x0;this['chatCapacity']=_0x39efbd[_0xe256('0x12')]||0x0;this[_0xe256('0x13')]=0x0;this[_0xe256('0x14')]=_0xe256('0x10');this[_0xe256('0x15')]=0x0;this[_0xe256('0x16')]=_0x39efbd[_0xe256('0x16')]||0x0;this[_0xe256('0x17')]=0x0;this[_0xe256('0x18')]=_0xe256('0x10');this[_0xe256('0x19')]=0x0;this[_0xe256('0x1a')]=_0x39efbd[_0xe256('0x1a')]||0x0;this['faxCurrentCapacity']=0x0;this['smsStatus']=_0xe256('0x10');this[_0xe256('0x1b')]=0x0;this[_0xe256('0x1c')]=_0x39efbd['smsCapacity']||0x0;this[_0xe256('0x1d')]=0x0;this[_0xe256('0x1e')]=_0xe256('0x10');this['whatsappStatusTime']=0x0;this['whatsappCapacity']=_0x39efbd[_0xe256('0x1f')]||0x0;this[_0xe256('0x20')]=0x0;this[_0xe256('0x21')]=_0xe256('0x10');this[_0xe256('0x22')]=0x0;this[_0xe256('0x23')]=_0x39efbd[_0xe256('0x23')]||0x0;this[_0xe256('0x24')]=0x0;this[_0xe256('0x25')]=![];this[_0xe256('0x26')]=undefined;this[_0xe256('0x27')]='';this['updateRealtime']();}Agent[_0xe256('0x28')]['getChannelStatus']=function(_0x4a9564){if(this[_0x4a9564+_0xe256('0x29')]>0x0){if(this[_0x4a9564+'Capacity']>0x0&&this[_0x4a9564+_0xe256('0x29')]>=this[_0x4a9564+_0xe256('0x2a')]){return _0xe256('0x2b');}else{return _0xe256('0x2c');}}else{return'idle';}};Agent[_0xe256('0x28')][_0xe256('0x2d')]=function(){var _0x532d06=[_0xe256('0x2e'),_0xe256('0x2f'),_0xe256('0x30'),_0xe256('0x31'),_0xe256('0x32'),_0xe256('0x33')];for(var _0x8aa6fc=0x0;_0x8aa6fc<_0x532d06[_0xe256('0x34')];_0x8aa6fc+=0x1){var _0x4154c9=this[_0xe256('0x35')](_0x532d06[_0x8aa6fc]);if(this[_0x532d06[_0x8aa6fc]+'Status']!==_0x4154c9){this[_0x532d06[_0x8aa6fc]+'StatusTime']=_[_0xe256('0x36')](moment()[_0xe256('0x37')]('x'));}this[_0x532d06[_0x8aa6fc]+_0xe256('0x38')]=_0x4154c9;}var _0x2067b0={'id':this['id'],'name':this[_0xe256('0x7')],'online':this['online'],'voicePause':this[_0xe256('0x9')],'chatPause':this['chatPause'],'mailPause':this[_0xe256('0xb')],'smsPause':this[_0xe256('0xd')],'faxPause':this[_0xe256('0xc')],'openchannelPause':this[_0xe256('0xe')],'chatStatus':this[_0xe256('0xf')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xe256('0x12')],'chatCurrentCapacity':this[_0xe256('0x13')],'mailStatus':this[_0xe256('0x14')],'mailStatusTime':this[_0xe256('0x15')],'mailCapacity':this[_0xe256('0x16')],'mailCurrentCapacity':this[_0xe256('0x17')],'faxStatus':this[_0xe256('0x18')],'faxStatusTime':this[_0xe256('0x19')],'faxCapacity':this[_0xe256('0x1a')],'faxCurrentCapacity':this[_0xe256('0x39')],'smsStatus':this[_0xe256('0x3a')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xe256('0x1c')],'smsCurrentCapacity':this[_0xe256('0x1d')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xe256('0x3b')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0xe256('0x20')],'openchannelStatus':this[_0xe256('0x21')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xe256('0x23')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0xe256('0x25')],'busyQueue':this[_0xe256('0x26')]};var _0x3c92aa=md5(JSON['stringify'](_0x2067b0));if(this[_0xe256('0x27')]!==_0x3c92aa){this[_0xe256('0x27')]=_0x3c92aa;io['emit'](_0xe256('0x3c'),_0x2067b0);}};module['exports']=Agent;
\ No newline at end of file
+var _0x42c3=['chatStatusTime','openchannelStatusTime','busy','user:save','lodash','moment','md5','../../../config/environment','redis','defaults','localhost','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busyQueue','updateRealtime','prototype','getChannelStatus','Capacity','maxcapacity','idle','chat','openchannel','fax','sms','length','Status','toNumber','format','name','chatStatus'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x42c3,0x1bc));var _0x342c=function(_0x5502c7,_0x281b56){_0x5502c7=_0x5502c7-0x0;var _0x45d7ab=_0x42c3[_0x5502c7];return _0x45d7ab;};'use strict';var _=require(_0x342c('0x0'));var moment=require(_0x342c('0x1'));var md5=require(_0x342c('0x2'));var Redis=require('ioredis');var config=require(_0x342c('0x3'));config[_0x342c('0x4')]=_[_0x342c('0x5')](config['redis'],{'host':_0x342c('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x342c('0x4')]));function Agent(_0x429d5b){this['id']=_0x429d5b['id']||0x0;this['name']=_0x429d5b['name']||'';this[_0x342c('0x7')]=_0x429d5b[_0x342c('0x7')]||!![];this[_0x342c('0x8')]=_0x429d5b[_0x342c('0x8')]||![];this['chatPause']=_0x429d5b[_0x342c('0x9')]||![];this[_0x342c('0xa')]=_0x429d5b[_0x342c('0xa')]||![];this[_0x342c('0xb')]=_0x429d5b[_0x342c('0xb')]||![];this['smsPause']=_0x429d5b[_0x342c('0xc')]||![];this[_0x342c('0xd')]=_0x429d5b[_0x342c('0xd')]||![];this['chatStatus']='unknown';this['chatStatusTime']=0x0;this[_0x342c('0xe')]=_0x429d5b[_0x342c('0xe')]||0x0;this[_0x342c('0xf')]=0x0;this[_0x342c('0x10')]=_0x342c('0x11');this[_0x342c('0x12')]=0x0;this[_0x342c('0x13')]=_0x429d5b[_0x342c('0x13')]||0x0;this[_0x342c('0x14')]=0x0;this[_0x342c('0x15')]=_0x342c('0x11');this[_0x342c('0x16')]=0x0;this[_0x342c('0x17')]=_0x429d5b[_0x342c('0x17')]||0x0;this[_0x342c('0x18')]=0x0;this[_0x342c('0x19')]=_0x342c('0x11');this['smsStatusTime']=0x0;this[_0x342c('0x1a')]=_0x429d5b['smsCapacity']||0x0;this[_0x342c('0x1b')]=0x0;this[_0x342c('0x1c')]=_0x342c('0x11');this['whatsappStatusTime']=0x0;this[_0x342c('0x1d')]=_0x429d5b[_0x342c('0x1d')]||0x0;this[_0x342c('0x1e')]=0x0;this[_0x342c('0x1f')]=_0x342c('0x11');this['openchannelStatusTime']=0x0;this[_0x342c('0x20')]=_0x429d5b[_0x342c('0x20')]||0x0;this[_0x342c('0x21')]=0x0;this['busy']=![];this[_0x342c('0x22')]=undefined;this['md5']='';this[_0x342c('0x23')]();}Agent[_0x342c('0x24')][_0x342c('0x25')]=function(_0x1d3ebc){if(this[_0x1d3ebc+'CurrentCapacity']>0x0){if(this[_0x1d3ebc+'Capacity']>0x0&&this[_0x1d3ebc+'CurrentCapacity']>=this[_0x1d3ebc+_0x342c('0x26')]){return _0x342c('0x27');}else{return'working';}}else{return _0x342c('0x28');}};Agent['prototype']['updateRealtime']=function(){var _0xa2f270=['mail',_0x342c('0x29'),_0x342c('0x2a'),_0x342c('0x2b'),_0x342c('0x2c'),'whatsapp'];for(var _0xb76ae7=0x0;_0xb76ae7<_0xa2f270[_0x342c('0x2d')];_0xb76ae7+=0x1){var _0x13437f=this[_0x342c('0x25')](_0xa2f270[_0xb76ae7]);if(this[_0xa2f270[_0xb76ae7]+_0x342c('0x2e')]!==_0x13437f){this[_0xa2f270[_0xb76ae7]+'StatusTime']=_[_0x342c('0x2f')](moment()[_0x342c('0x30')]('x'));}this[_0xa2f270[_0xb76ae7]+_0x342c('0x2e')]=_0x13437f;}var _0x116fed={'id':this['id'],'name':this[_0x342c('0x31')],'online':this['online'],'voicePause':this[_0x342c('0x8')],'chatPause':this['chatPause'],'mailPause':this[_0x342c('0xa')],'smsPause':this[_0x342c('0xc')],'faxPause':this[_0x342c('0xb')],'openchannelPause':this[_0x342c('0xd')],'chatStatus':this[_0x342c('0x32')],'chatStatusTime':this[_0x342c('0x33')],'chatCapacity':this[_0x342c('0xe')],'chatCurrentCapacity':this[_0x342c('0xf')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x342c('0x12')],'mailCapacity':this[_0x342c('0x13')],'mailCurrentCapacity':this[_0x342c('0x14')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x342c('0x16')],'faxCapacity':this[_0x342c('0x17')],'faxCurrentCapacity':this[_0x342c('0x18')],'smsStatus':this[_0x342c('0x19')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x342c('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x342c('0x1c')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x342c('0x1e')],'openchannelStatus':this[_0x342c('0x1f')],'openchannelStatusTime':this[_0x342c('0x34')],'openchannelCapacity':this[_0x342c('0x20')],'openchannelCurrentCapacity':this[_0x342c('0x21')],'busy':this[_0x342c('0x35')],'busyQueue':this[_0x342c('0x22')]};var _0x33f21b=md5(JSON['stringify'](_0x116fed));if(this[_0x342c('0x2')]!==_0x33f21b){this[_0x342c('0x2')]=_0x33f21b;io['emit'](_0x342c('0x36'),_0x116fed);}};module['exports']=Agent;
\ No newline at end of file
index b1b6ddc..f4becec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d9e=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','paused','online','loggedIn','chatPause','available','waiting','stringify','chat:queue:%s','emit','chat_queue:save','md5','util'];(function(_0x534c8f,_0x500079){var _0x5a57f5=function(_0x38ec0a){while(--_0x38ec0a){_0x534c8f['push'](_0x534c8f['shift']());}};_0x5a57f5(++_0x500079);}(_0x6d9e,0xc2));var _0xe6d9=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6d9e[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var md5=require(_0xe6d9('0x0'));var util=require(_0xe6d9('0x1'));var Redis=require(_0xe6d9('0x2'));var config=require(_0xe6d9('0x3'));config[_0xe6d9('0x4')]=_[_0xe6d9('0x5')](config[_0xe6d9('0x4')],{'host':_0xe6d9('0x6'),'port':0x18eb});var io=require(_0xe6d9('0x7'))(new Redis(config[_0xe6d9('0x4')]));function ChatQueue(_0x12988b){this['id']=_0x12988b['id']||0x0;this[_0xe6d9('0x8')]=_0x12988b[_0xe6d9('0x8')]||'';this['timeout']=_0x12988b['timeout']||0xa;this[_0xe6d9('0x9')]=_0x12988b[_0xe6d9('0x9')]||_0xe6d9('0xa');this[_0xe6d9('0xb')]=_0x12988b[_0xe6d9('0xb')];this[_0xe6d9('0xc')]={};this['waiting']=0x0;this[_0xe6d9('0x0')]='';this[_0xe6d9('0xd')]();this[_0xe6d9('0xe')]();}ChatQueue[_0xe6d9('0xf')]['updateRouting']=function(){var _0x19a811=this[_0xe6d9('0xc')]['_rr'];this[_0xe6d9('0xc')]=_[_0xe6d9('0x10')](this[_0xe6d9('0xb')],'id');this['mapAgentsId'][_0xe6d9('0x11')]=_0x19a811;};ChatQueue[_0xe6d9('0xf')][_0xe6d9('0xe')]=function(){this['loggedIn']=0x0;this[_0xe6d9('0x12')]=0x0;for(var _0x23f51e=0x0;_0x23f51e<this[_0xe6d9('0xb')]['length'];_0x23f51e+=0x1){if(this[_0xe6d9('0xb')][_0x23f51e][_0xe6d9('0x13')]){this[_0xe6d9('0x14')]+=0x1;}if(this['Agents'][_0x23f51e][_0xe6d9('0x15')]){this['paused']+=0x1;}}this[_0xe6d9('0x16')]=this[_0xe6d9('0x14')]-this[_0xe6d9('0x12')];this[_0xe6d9('0x16')]=this[_0xe6d9('0x16')]>=0x0?this[_0xe6d9('0x16')]:0x0;var _0xa33466={'id':this['id'],'available':this[_0xe6d9('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xe6d9('0x8')],'paused':this[_0xe6d9('0x12')],'waiting':this[_0xe6d9('0x17')]};var _0x5380b8=md5(JSON[_0xe6d9('0x18')](_0xa33466));if(this[_0xe6d9('0x0')]!==_0x5380b8){this[_0xe6d9('0x0')]=_0x5380b8;io['to'](util['format'](_0xe6d9('0x19'),_0xa33466[_0xe6d9('0x8')]))[_0xe6d9('0x1a')](_0xe6d9('0x1b'),_0xa33466);}};module['exports']=ChatQueue;
\ No newline at end of file
+var _0xd58e=['paused','online','available','stringify','chat:queue:%s','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','_rr','mapAgentsId','map','loggedIn'];(function(_0x2e655a,_0x6d5799){var _0x26f13b=function(_0x2dd535){while(--_0x2dd535){_0x2e655a['push'](_0x2e655a['shift']());}};_0x26f13b(++_0x6d5799);}(_0xd58e,0x14a));var _0xed58=function(_0x4c8f64,_0x27d8c2){_0x4c8f64=_0x4c8f64-0x0;var _0x2e6893=_0xd58e[_0x4c8f64];return _0x2e6893;};'use strict';var _=require('lodash');var md5=require(_0xed58('0x0'));var util=require(_0xed58('0x1'));var Redis=require(_0xed58('0x2'));var config=require(_0xed58('0x3'));config[_0xed58('0x4')]=_[_0xed58('0x5')](config[_0xed58('0x4')],{'host':_0xed58('0x6'),'port':0x18eb});var io=require(_0xed58('0x7'))(new Redis(config[_0xed58('0x4')]));function ChatQueue(_0x27a17d){this['id']=_0x27a17d['id']||0x0;this['name']=_0x27a17d[_0xed58('0x8')]||'';this[_0xed58('0x9')]=_0x27a17d['timeout']||0xa;this[_0xed58('0xa')]=_0x27a17d[_0xed58('0xa')]||_0xed58('0xb');this[_0xed58('0xc')]=_0x27a17d[_0xed58('0xc')];this['mapAgentsId']={};this[_0xed58('0xd')]=0x0;this['md5']='';this[_0xed58('0xe')]();this['updateRealtime']();}ChatQueue[_0xed58('0xf')][_0xed58('0xe')]=function(){var _0x27db30=this['mapAgentsId'][_0xed58('0x10')];this[_0xed58('0x11')]=_[_0xed58('0x12')](this['Agents'],'id');this[_0xed58('0x11')][_0xed58('0x10')]=_0x27db30;};ChatQueue['prototype']['updateRealtime']=function(){this[_0xed58('0x13')]=0x0;this[_0xed58('0x14')]=0x0;for(var _0x20cef6=0x0;_0x20cef6<this[_0xed58('0xc')]['length'];_0x20cef6+=0x1){if(this[_0xed58('0xc')][_0x20cef6][_0xed58('0x15')]){this[_0xed58('0x13')]+=0x1;}if(this['Agents'][_0x20cef6]['chatPause']){this['paused']+=0x1;}}this[_0xed58('0x16')]=this['loggedIn']-this[_0xed58('0x14')];this['available']=this[_0xed58('0x16')]>=0x0?this[_0xed58('0x16')]:0x0;var _0x266772={'id':this['id'],'available':this[_0xed58('0x16')],'loggedIn':this[_0xed58('0x13')],'name':this[_0xed58('0x8')],'paused':this[_0xed58('0x14')],'waiting':this[_0xed58('0xd')]};var _0x47afa9=md5(JSON[_0xed58('0x17')](_0x266772));if(this[_0xed58('0x0')]!==_0x47afa9){this['md5']=_0x47afa9;io['to'](util['format'](_0xed58('0x18'),_0x266772[_0xed58('0x8')]))['emit']('chat_queue:save',_0x266772);}};module['exports']=ChatQueue;
\ No newline at end of file
index b7088c0..c0ec18f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34c8=['timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','faxPause','available','paused','stringify','format','fax:queue:%s','emit','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x33f981,_0x38244f){var _0x5a23a3=function(_0x463c5b){while(--_0x463c5b){_0x33f981['push'](_0x33f981['shift']());}};_0x5a23a3(++_0x38244f);}(_0x34c8,0xbb));var _0x834c=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x34c8[_0x1203f];return _0x365f0a;};'use strict';var _=require(_0x834c('0x0'));var md5=require(_0x834c('0x1'));var util=require('util');var Redis=require(_0x834c('0x2'));var config=require(_0x834c('0x3'));config[_0x834c('0x4')]=_[_0x834c('0x5')](config['redis'],{'host':_0x834c('0x6'),'port':0x18eb});var io=require(_0x834c('0x7'))(new Redis(config['redis']));function FaxQueue(_0x29ccb2){this['id']=_0x29ccb2['id']||0x0;this[_0x834c('0x8')]=_0x29ccb2[_0x834c('0x8')]||'';this[_0x834c('0x9')]=_0x29ccb2[_0x834c('0x9')]||0xa;this['strategy']=_0x29ccb2[_0x834c('0xa')]||'beepall';this[_0x834c('0xb')]=_0x29ccb2[_0x834c('0xb')];this[_0x834c('0xc')]={};this[_0x834c('0xd')]=0x0;this[_0x834c('0x1')]='';this[_0x834c('0xe')]();this[_0x834c('0xf')]();}FaxQueue[_0x834c('0x10')]['updateRouting']=function(){var _0x5780fb=this['mapAgentsId'][_0x834c('0x11')];this['mapAgentsId']=_[_0x834c('0x12')](this[_0x834c('0xb')],'id');this['mapAgentsId']['_rr']=_0x5780fb;};FaxQueue[_0x834c('0x10')][_0x834c('0xf')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x30b3d7=0x0;_0x30b3d7<this[_0x834c('0xb')]['length'];_0x30b3d7+=0x1){if(this[_0x834c('0xb')][_0x30b3d7]['online']){this[_0x834c('0x13')]+=0x1;}if(this[_0x834c('0xb')][_0x30b3d7][_0x834c('0x14')]){this['paused']+=0x1;}}this[_0x834c('0x15')]=this[_0x834c('0x13')]-this[_0x834c('0x16')];this['available']=this[_0x834c('0x15')]>=0x0?this[_0x834c('0x15')]:0x0;var _0x165238={'id':this['id'],'available':this[_0x834c('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x834c('0x8')],'paused':this[_0x834c('0x16')],'waiting':this[_0x834c('0xd')]};var _0x19615a=md5(JSON[_0x834c('0x17')](_0x165238));if(this['md5']!==_0x19615a){this['md5']=_0x19615a;io['to'](util[_0x834c('0x18')](_0x834c('0x19'),_0x165238[_0x834c('0x8')]))[_0x834c('0x1a')]('fax_queue:save',_0x165238);}};module[_0x834c('0x1b')]=FaxQueue;
\ No newline at end of file
+var _0x8f8d=['emit','fax_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','map','_rr','length','online','faxPause','paused','available','loggedIn','format','fax:queue:%s'];(function(_0x1be771,_0x40571b){var _0x55c806=function(_0x1ff882){while(--_0x1ff882){_0x1be771['push'](_0x1be771['shift']());}};_0x55c806(++_0x40571b);}(_0x8f8d,0x1b4));var _0xd8f8=function(_0x1e0f45,_0x5af365){_0x1e0f45=_0x1e0f45-0x0;var _0x5ce128=_0x8f8d[_0x1e0f45];return _0x5ce128;};'use strict';var _=require(_0xd8f8('0x0'));var md5=require(_0xd8f8('0x1'));var util=require(_0xd8f8('0x2'));var Redis=require(_0xd8f8('0x3'));var config=require(_0xd8f8('0x4'));config[_0xd8f8('0x5')]=_[_0xd8f8('0x6')](config[_0xd8f8('0x5')],{'host':_0xd8f8('0x7'),'port':0x18eb});var io=require(_0xd8f8('0x8'))(new Redis(config['redis']));function FaxQueue(_0x35d53b){this['id']=_0x35d53b['id']||0x0;this['name']=_0x35d53b[_0xd8f8('0x9')]||'';this[_0xd8f8('0xa')]=_0x35d53b['timeout']||0xa;this[_0xd8f8('0xb')]=_0x35d53b[_0xd8f8('0xb')]||_0xd8f8('0xc');this[_0xd8f8('0xd')]=_0x35d53b['Agents'];this[_0xd8f8('0xe')]={};this[_0xd8f8('0xf')]=0x0;this[_0xd8f8('0x1')]='';this['updateRouting']();this[_0xd8f8('0x10')]();}FaxQueue[_0xd8f8('0x11')][_0xd8f8('0x12')]=function(){var _0x2ac6a4=this[_0xd8f8('0xe')]['_rr'];this[_0xd8f8('0xe')]=_[_0xd8f8('0x13')](this['Agents'],'id');this['mapAgentsId'][_0xd8f8('0x14')]=_0x2ac6a4;};FaxQueue[_0xd8f8('0x11')]['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x3cd639=0x0;_0x3cd639<this[_0xd8f8('0xd')][_0xd8f8('0x15')];_0x3cd639+=0x1){if(this[_0xd8f8('0xd')][_0x3cd639][_0xd8f8('0x16')]){this['loggedIn']+=0x1;}if(this[_0xd8f8('0xd')][_0x3cd639][_0xd8f8('0x17')]){this[_0xd8f8('0x18')]+=0x1;}}this[_0xd8f8('0x19')]=this[_0xd8f8('0x1a')]-this[_0xd8f8('0x18')];this[_0xd8f8('0x19')]=this[_0xd8f8('0x19')]>=0x0?this['available']:0x0;var _0x241e4d={'id':this['id'],'available':this[_0xd8f8('0x19')],'loggedIn':this['loggedIn'],'name':this[_0xd8f8('0x9')],'paused':this['paused'],'waiting':this[_0xd8f8('0xf')]};var _0x352f2d=md5(JSON['stringify'](_0x241e4d));if(this['md5']!==_0x352f2d){this[_0xd8f8('0x1')]=_0x352f2d;io['to'](util[_0xd8f8('0x1b')](_0xd8f8('0x1c'),_0x241e4d['name']))[_0xd8f8('0x1d')](_0xd8f8('0x1e'),_0x241e4d);}};module['exports']=FaxQueue;
\ No newline at end of file
index e9638f2..3ff9058 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a5c=['name','Intervals','exports'];(function(_0x4d063c,_0x19da76){var _0x54f391=function(_0x1c9767){while(--_0x1c9767){_0x4d063c['push'](_0x4d063c['shift']());}};_0x54f391(++_0x19da76);}(_0x9a5c,0x1ad));var _0xc9a5=function(_0x28a9bb,_0x4d005d){_0x28a9bb=_0x28a9bb-0x0;var _0x580c58=_0x9a5c[_0x28a9bb];return _0x580c58;};'use strict';function Interval(_0x58ad32){this['id']=_0x58ad32['id']||0x0;this[_0xc9a5('0x0')]=_0x58ad32[_0xc9a5('0x0')]||'';this[_0xc9a5('0x1')]=_0x58ad32['Intervals']||{};}module[_0xc9a5('0x2')]=Interval;
\ No newline at end of file
+var _0x280b=['Intervals','exports','name'];(function(_0x2b0113,_0x2fcc52){var _0x16c5e4=function(_0x13c00d){while(--_0x13c00d){_0x2b0113['push'](_0x2b0113['shift']());}};_0x16c5e4(++_0x2fcc52);}(_0x280b,0xbc));var _0xb280=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x280b[_0x14add3];return _0x4a174f;};'use strict';function Interval(_0x19ba0c){this['id']=_0x19ba0c['id']||0x0;this[_0xb280('0x0')]=_0x19ba0c[_0xb280('0x0')]||'';this[_0xb280('0x1')]=_0x19ba0c[_0xb280('0x1')]||{};}module[_0xb280('0x2')]=Interval;
\ No newline at end of file
index 7846bf1..d58ba3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb181=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','online','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name'];(function(_0x48df04,_0x1522b1){var _0x4de5fa=function(_0x3ae6db){while(--_0x3ae6db){_0x48df04['push'](_0x48df04['shift']());}};_0x4de5fa(++_0x1522b1);}(_0xb181,0xff));var _0x1b18=function(_0x18ff48,_0x1263b0){_0x18ff48=_0x18ff48-0x0;var _0x129bf8=_0xb181[_0x18ff48];return _0x129bf8;};'use strict';var _=require(_0x1b18('0x0'));var md5=require('md5');var util=require(_0x1b18('0x1'));var Redis=require(_0x1b18('0x2'));var config=require(_0x1b18('0x3'));config[_0x1b18('0x4')]=_[_0x1b18('0x5')](config[_0x1b18('0x4')],{'host':_0x1b18('0x6'),'port':0x18eb});var io=require(_0x1b18('0x7'))(new Redis(config['redis']));function MailQueue(_0x24201d){this['id']=_0x24201d['id']||0x0;this['name']=_0x24201d[_0x1b18('0x8')]||'';this[_0x1b18('0x9')]=_0x24201d[_0x1b18('0x9')]||0xa;this[_0x1b18('0xa')]=_0x24201d[_0x1b18('0xa')]||_0x1b18('0xb');this[_0x1b18('0xc')]=_0x24201d[_0x1b18('0xc')];this[_0x1b18('0xd')]={};this[_0x1b18('0xe')]=0x0;this[_0x1b18('0xf')]='';this['updateRouting']();this[_0x1b18('0x10')]();}MailQueue[_0x1b18('0x11')][_0x1b18('0x12')]=function(){var _0x58f6ed=this['mapAgentsId'][_0x1b18('0x13')];this[_0x1b18('0xd')]=_[_0x1b18('0x14')](this['Agents'],'id');this[_0x1b18('0xd')][_0x1b18('0x13')]=_0x58f6ed;};MailQueue['prototype'][_0x1b18('0x10')]=function(){this[_0x1b18('0x15')]=0x0;this[_0x1b18('0x16')]=0x0;for(var _0x3051b3=0x0;_0x3051b3<this[_0x1b18('0xc')][_0x1b18('0x17')];_0x3051b3+=0x1){if(this[_0x1b18('0xc')][_0x3051b3][_0x1b18('0x18')]){this['loggedIn']+=0x1;}if(this[_0x1b18('0xc')][_0x3051b3][_0x1b18('0x19')]){this[_0x1b18('0x16')]+=0x1;}}this[_0x1b18('0x1a')]=this['loggedIn']-this[_0x1b18('0x16')];this['available']=this[_0x1b18('0x1a')]>=0x0?this['available']:0x0;var _0x5b5b74={'id':this['id'],'available':this[_0x1b18('0x1a')],'loggedIn':this['loggedIn'],'name':this[_0x1b18('0x8')],'paused':this[_0x1b18('0x16')],'waiting':this['waiting']};var _0x2ca625=md5(JSON[_0x1b18('0x1b')](_0x5b5b74));if(this[_0x1b18('0xf')]!==_0x2ca625){this[_0x1b18('0xf')]=_0x2ca625;io['to'](util[_0x1b18('0x1c')](_0x1b18('0x1d'),_0x5b5b74[_0x1b18('0x8')]))[_0x1b18('0x1e')](_0x1b18('0x1f'),_0x5b5b74);}};module[_0x1b18('0x20')]=MailQueue;
\ No newline at end of file
+var _0x1de3=['available','stringify','format','mail:queue:%s','mail_queue:save','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','mailPause'];(function(_0x5a67bb,_0x516504){var _0x48c706=function(_0x4f7928){while(--_0x4f7928){_0x5a67bb['push'](_0x5a67bb['shift']());}};_0x48c706(++_0x516504);}(_0x1de3,0x1aa));var _0x31de=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x1de3[_0x3f0b30];return _0x2748a5;};'use strict';var _=require('lodash');var md5=require(_0x31de('0x0'));var util=require('util');var Redis=require(_0x31de('0x1'));var config=require(_0x31de('0x2'));config[_0x31de('0x3')]=_[_0x31de('0x4')](config[_0x31de('0x3')],{'host':_0x31de('0x5'),'port':0x18eb});var io=require(_0x31de('0x6'))(new Redis(config[_0x31de('0x3')]));function MailQueue(_0x595337){this['id']=_0x595337['id']||0x0;this['name']=_0x595337[_0x31de('0x7')]||'';this[_0x31de('0x8')]=_0x595337['timeout']||0xa;this[_0x31de('0x9')]=_0x595337[_0x31de('0x9')]||_0x31de('0xa');this[_0x31de('0xb')]=_0x595337[_0x31de('0xb')];this[_0x31de('0xc')]={};this[_0x31de('0xd')]=0x0;this[_0x31de('0x0')]='';this[_0x31de('0xe')]();this[_0x31de('0xf')]();}MailQueue[_0x31de('0x10')][_0x31de('0xe')]=function(){var _0x1c8939=this['mapAgentsId'][_0x31de('0x11')];this['mapAgentsId']=_[_0x31de('0x12')](this[_0x31de('0xb')],'id');this['mapAgentsId']['_rr']=_0x1c8939;};MailQueue[_0x31de('0x10')][_0x31de('0xf')]=function(){this[_0x31de('0x13')]=0x0;this[_0x31de('0x14')]=0x0;for(var _0x2d2b98=0x0;_0x2d2b98<this['Agents'][_0x31de('0x15')];_0x2d2b98+=0x1){if(this[_0x31de('0xb')][_0x2d2b98][_0x31de('0x16')]){this[_0x31de('0x13')]+=0x1;}if(this[_0x31de('0xb')][_0x2d2b98][_0x31de('0x17')]){this[_0x31de('0x14')]+=0x1;}}this[_0x31de('0x18')]=this[_0x31de('0x13')]-this['paused'];this[_0x31de('0x18')]=this[_0x31de('0x18')]>=0x0?this['available']:0x0;var _0x13a03c={'id':this['id'],'available':this[_0x31de('0x18')],'loggedIn':this[_0x31de('0x13')],'name':this[_0x31de('0x7')],'paused':this['paused'],'waiting':this[_0x31de('0xd')]};var _0x2788f2=md5(JSON[_0x31de('0x19')](_0x13a03c));if(this[_0x31de('0x0')]!==_0x2788f2){this[_0x31de('0x0')]=_0x2788f2;io['to'](util[_0x31de('0x1a')](_0x31de('0x1b'),_0x13a03c[_0x31de('0x7')]))['emit'](_0x31de('0x1c'),_0x13a03c);}};module[_0x31de('0x1d')]=MailQueue;
\ No newline at end of file
index 6de19a6..21ce764 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x596de3,_0xf801c0){var _0xbf541f=function(_0x3b7460){while(--_0x3b7460){_0x596de3['push'](_0x596de3['shift']());}};_0xbf541f(++_0xf801c0);}(_0xadb5,0xad));var _0x5adb=function(_0x2189dd,_0x4da571){_0x2189dd=_0x2189dd-0x0;var _0x1dc818=_0xadb5[_0x2189dd];return _0x1dc818;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c<this[_0x5adb('0xa')]['length'];_0x34af2c+=0x1){if(this[_0x5adb('0xa')][_0x34af2c]['online']){this[_0x5adb('0x12')]+=0x1;}if(this[_0x5adb('0xa')][_0x34af2c][_0x5adb('0x13')]){this[_0x5adb('0x11')]+=0x1;}}this[_0x5adb('0x14')]=this[_0x5adb('0x12')]-this[_0x5adb('0x11')];this[_0x5adb('0x14')]=this[_0x5adb('0x14')]>=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue;
\ No newline at end of file
+var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x2d95ee,_0x24d2e0){var _0x313935=function(_0x333852){while(--_0x333852){_0x2d95ee['push'](_0x2d95ee['shift']());}};_0x313935(++_0x24d2e0);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3dfeb9,_0x1cc6e4){_0x3dfeb9=_0x3dfeb9-0x0;var _0x412314=_0x5fc3[_0x3dfeb9];return _0x412314;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2<this['Agents']['length'];_0x38d9f2+=0x1){if(this['Agents'][_0x38d9f2]['online']){this[_0x35fc('0x11')]+=0x1;}if(this[_0x35fc('0xa')][_0x38d9f2][_0x35fc('0x13')]){this[_0x35fc('0x12')]+=0x1;}}this[_0x35fc('0x14')]=this[_0x35fc('0x11')]-this['paused'];this[_0x35fc('0x14')]=this[_0x35fc('0x14')]>=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue;
\ No newline at end of file
index 60933ef..10d5fb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e85=['waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','loggedIn','paused','length','smsPause','available','stringify','format','sms:queue:%s','emit','exports','lodash','md5','ioredis','../../../config/environment','localhost','redis','name','timeout','strategy','beepall','Agents'];(function(_0x344e50,_0x5058d3){var _0x2bca05=function(_0x65f29b){while(--_0x65f29b){_0x344e50['push'](_0x344e50['shift']());}};_0x2bca05(++_0x5058d3);}(_0x0e85,0x7c));var _0x50e8=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x0e85[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0x50e8('0x0'));var md5=require(_0x50e8('0x1'));var util=require('util');var Redis=require(_0x50e8('0x2'));var config=require(_0x50e8('0x3'));config['redis']=_['defaults'](config['redis'],{'host':_0x50e8('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x50e8('0x5')]));function SmsQueue(_0x2401b2){this['id']=_0x2401b2['id']||0x0;this[_0x50e8('0x6')]=_0x2401b2[_0x50e8('0x6')]||'';this['timeout']=_0x2401b2[_0x50e8('0x7')]||0xa;this[_0x50e8('0x8')]=_0x2401b2[_0x50e8('0x8')]||_0x50e8('0x9');this[_0x50e8('0xa')]=_0x2401b2[_0x50e8('0xa')];this['mapAgentsId']={};this[_0x50e8('0xb')]=0x0;this[_0x50e8('0x1')]='';this[_0x50e8('0xc')]();this[_0x50e8('0xd')]();}SmsQueue[_0x50e8('0xe')][_0x50e8('0xc')]=function(){var _0x45dc6f=this[_0x50e8('0xf')]['_rr'];this['mapAgentsId']=_[_0x50e8('0x10')](this[_0x50e8('0xa')],'id');this['mapAgentsId']['_rr']=_0x45dc6f;};SmsQueue[_0x50e8('0xe')][_0x50e8('0xd')]=function(){this[_0x50e8('0x11')]=0x0;this[_0x50e8('0x12')]=0x0;for(var _0x54efd3=0x0;_0x54efd3<this[_0x50e8('0xa')][_0x50e8('0x13')];_0x54efd3+=0x1){if(this[_0x50e8('0xa')][_0x54efd3]['online']){this['loggedIn']+=0x1;}if(this[_0x50e8('0xa')][_0x54efd3][_0x50e8('0x14')]){this[_0x50e8('0x12')]+=0x1;}}this[_0x50e8('0x15')]=this[_0x50e8('0x11')]-this[_0x50e8('0x12')];this['available']=this['available']>=0x0?this[_0x50e8('0x15')]:0x0;var _0xc97063={'id':this['id'],'available':this[_0x50e8('0x15')],'loggedIn':this[_0x50e8('0x11')],'name':this[_0x50e8('0x6')],'paused':this[_0x50e8('0x12')],'waiting':this[_0x50e8('0xb')]};var _0x53e0a1=md5(JSON[_0x50e8('0x16')](_0xc97063));if(this['md5']!==_0x53e0a1){this[_0x50e8('0x1')]=_0x53e0a1;io['to'](util[_0x50e8('0x17')](_0x50e8('0x18'),_0xc97063[_0x50e8('0x6')]))[_0x50e8('0x19')]('sms_queue:save',_0xc97063);}};module[_0x50e8('0x1a')]=SmsQueue;
\ No newline at end of file
+var _0x50a6=['length','smsPause','available','stringify','format','emit','sms_queue:save','exports','lodash','md5','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','loggedIn','paused'];(function(_0x1d0bde,_0x48b9e1){var _0x284c21=function(_0x5610cf){while(--_0x5610cf){_0x1d0bde['push'](_0x1d0bde['shift']());}};_0x284c21(++_0x48b9e1);}(_0x50a6,0xa4));var _0x650a=function(_0x41d552,_0x1e59db){_0x41d552=_0x41d552-0x0;var _0x45d056=_0x50a6[_0x41d552];return _0x45d056;};'use strict';var _=require(_0x650a('0x0'));var md5=require(_0x650a('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x650a('0x2'));config['redis']=_[_0x650a('0x3')](config[_0x650a('0x4')],{'host':_0x650a('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x650a('0x4')]));function SmsQueue(_0x4c71f3){this['id']=_0x4c71f3['id']||0x0;this['name']=_0x4c71f3[_0x650a('0x6')]||'';this[_0x650a('0x7')]=_0x4c71f3[_0x650a('0x7')]||0xa;this[_0x650a('0x8')]=_0x4c71f3['strategy']||_0x650a('0x9');this['Agents']=_0x4c71f3[_0x650a('0xa')];this[_0x650a('0xb')]={};this['waiting']=0x0;this[_0x650a('0x1')]='';this[_0x650a('0xc')]();this['updateRealtime']();}SmsQueue[_0x650a('0xd')]['updateRouting']=function(){var _0x142cdb=this['mapAgentsId'][_0x650a('0xe')];this['mapAgentsId']=_[_0x650a('0xf')](this['Agents'],'id');this[_0x650a('0xb')][_0x650a('0xe')]=_0x142cdb;};SmsQueue[_0x650a('0xd')]['updateRealtime']=function(){this[_0x650a('0x10')]=0x0;this[_0x650a('0x11')]=0x0;for(var _0x2f727d=0x0;_0x2f727d<this[_0x650a('0xa')][_0x650a('0x12')];_0x2f727d+=0x1){if(this[_0x650a('0xa')][_0x2f727d]['online']){this[_0x650a('0x10')]+=0x1;}if(this['Agents'][_0x2f727d][_0x650a('0x13')]){this[_0x650a('0x11')]+=0x1;}}this[_0x650a('0x14')]=this['loggedIn']-this['paused'];this['available']=this['available']>=0x0?this[_0x650a('0x14')]:0x0;var _0x359314={'id':this['id'],'available':this[_0x650a('0x14')],'loggedIn':this[_0x650a('0x10')],'name':this[_0x650a('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0xf46674=md5(JSON[_0x650a('0x15')](_0x359314));if(this['md5']!==_0xf46674){this[_0x650a('0x1')]=_0xf46674;io['to'](util[_0x650a('0x16')]('sms:queue:%s',_0x359314[_0x650a('0x6')]))[_0x650a('0x17')](_0x650a('0x18'),_0x359314);}};module[_0x650a('0x19')]=SmsQueue;
\ No newline at end of file
index c3352dd..64dff1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7011=['timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','whatsappPause','available','waiting','stringify','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','md5','util','../../../config/environment','redis','defaults','socket.io-emitter','name'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7011,0x107));var _0x1701=function(_0x517869,_0x1f383b){_0x517869=_0x517869-0x0;var _0x2e6dd7=_0x7011[_0x517869];return _0x2e6dd7;};'use strict';var _=require('lodash');var md5=require(_0x1701('0x0'));var util=require(_0x1701('0x1'));var Redis=require('ioredis');var config=require(_0x1701('0x2'));config[_0x1701('0x3')]=_[_0x1701('0x4')](config[_0x1701('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x1701('0x5'))(new Redis(config['redis']));function WhatsappQueue(_0x42672e){this['id']=_0x42672e['id']||0x0;this[_0x1701('0x6')]=_0x42672e[_0x1701('0x6')]||'';this[_0x1701('0x7')]=_0x42672e[_0x1701('0x7')]||0xa;this[_0x1701('0x8')]=_0x42672e[_0x1701('0x8')]||_0x1701('0x9');this['Agents']=_0x42672e[_0x1701('0xa')];this[_0x1701('0xb')]={};this['waiting']=0x0;this[_0x1701('0x0')]='';this[_0x1701('0xc')]();this[_0x1701('0xd')]();}WhatsappQueue[_0x1701('0xe')][_0x1701('0xc')]=function(){var _0x24feb7=this[_0x1701('0xb')][_0x1701('0xf')];this[_0x1701('0xb')]=_[_0x1701('0x10')](this[_0x1701('0xa')],'id');this[_0x1701('0xb')][_0x1701('0xf')]=_0x24feb7;};WhatsappQueue['prototype'][_0x1701('0xd')]=function(){this[_0x1701('0x11')]=0x0;this[_0x1701('0x12')]=0x0;for(var _0x32f236=0x0;_0x32f236<this[_0x1701('0xa')]['length'];_0x32f236+=0x1){if(this[_0x1701('0xa')][_0x32f236]['online']){this['loggedIn']+=0x1;}if(this[_0x1701('0xa')][_0x32f236][_0x1701('0x13')]){this[_0x1701('0x12')]+=0x1;}}this[_0x1701('0x14')]=this[_0x1701('0x11')]-this[_0x1701('0x12')];this[_0x1701('0x14')]=this[_0x1701('0x14')]>=0x0?this[_0x1701('0x14')]:0x0;var _0x40ebc7={'id':this['id'],'available':this[_0x1701('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x1701('0x6')],'paused':this[_0x1701('0x12')],'waiting':this[_0x1701('0x15')]};var _0x230e56=md5(JSON[_0x1701('0x16')](_0x40ebc7));if(this['md5']!==_0x230e56){this[_0x1701('0x0')]=_0x230e56;io['to'](util['format'](_0x1701('0x17'),_0x40ebc7[_0x1701('0x6')]))[_0x1701('0x18')](_0x1701('0x19'),_0x40ebc7);}};module[_0x1701('0x1a')]=WhatsappQueue;
\ No newline at end of file
+var _0xfd77=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','loggedIn','paused','online','whatsappPause','available','stringify','format','whatsapp:queue:%s','lodash','util'];(function(_0x2ddfac,_0x316226){var _0x440cbc=function(_0x4f61bf){while(--_0x4f61bf){_0x2ddfac['push'](_0x2ddfac['shift']());}};_0x440cbc(++_0x316226);}(_0xfd77,0x11c));var _0x7fd7=function(_0x521779,_0x31be6d){_0x521779=_0x521779-0x0;var _0x523214=_0xfd77[_0x521779];return _0x523214;};'use strict';var _=require(_0x7fd7('0x0'));var md5=require('md5');var util=require(_0x7fd7('0x1'));var Redis=require(_0x7fd7('0x2'));var config=require(_0x7fd7('0x3'));config[_0x7fd7('0x4')]=_[_0x7fd7('0x5')](config[_0x7fd7('0x4')],{'host':_0x7fd7('0x6'),'port':0x18eb});var io=require(_0x7fd7('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x4021f7){this['id']=_0x4021f7['id']||0x0;this[_0x7fd7('0x8')]=_0x4021f7[_0x7fd7('0x8')]||'';this[_0x7fd7('0x9')]=_0x4021f7[_0x7fd7('0x9')]||0xa;this['strategy']=_0x4021f7['strategy']||_0x7fd7('0xa');this[_0x7fd7('0xb')]=_0x4021f7[_0x7fd7('0xb')];this[_0x7fd7('0xc')]={};this[_0x7fd7('0xd')]=0x0;this[_0x7fd7('0xe')]='';this[_0x7fd7('0xf')]();this[_0x7fd7('0x10')]();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x5f9cf9=this[_0x7fd7('0xc')]['_rr'];this['mapAgentsId']=_['map'](this[_0x7fd7('0xb')],'id');this['mapAgentsId']['_rr']=_0x5f9cf9;};WhatsappQueue[_0x7fd7('0x11')][_0x7fd7('0x10')]=function(){this[_0x7fd7('0x12')]=0x0;this[_0x7fd7('0x13')]=0x0;for(var _0x3512dc=0x0;_0x3512dc<this[_0x7fd7('0xb')]['length'];_0x3512dc+=0x1){if(this[_0x7fd7('0xb')][_0x3512dc][_0x7fd7('0x14')]){this['loggedIn']+=0x1;}if(this[_0x7fd7('0xb')][_0x3512dc][_0x7fd7('0x15')]){this['paused']+=0x1;}}this[_0x7fd7('0x16')]=this[_0x7fd7('0x12')]-this[_0x7fd7('0x13')];this[_0x7fd7('0x16')]=this[_0x7fd7('0x16')]>=0x0?this[_0x7fd7('0x16')]:0x0;var _0x4ff1c3={'id':this['id'],'available':this[_0x7fd7('0x16')],'loggedIn':this[_0x7fd7('0x12')],'name':this[_0x7fd7('0x8')],'paused':this[_0x7fd7('0x13')],'waiting':this[_0x7fd7('0xd')]};var _0x1a93ed=md5(JSON[_0x7fd7('0x17')](_0x4ff1c3));if(this[_0x7fd7('0xe')]!==_0x1a93ed){this[_0x7fd7('0xe')]=_0x1a93ed;io['to'](util[_0x7fd7('0x18')](_0x7fd7('0x19'),_0x4ff1c3['name']))['emit']('whatsapp_queue:save',_0x4ff1c3);}};module['exports']=WhatsappQueue;
\ No newline at end of file
index 60cbe23..b067710 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime;
\ No newline at end of file
+var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x222554,_0x27e335){var _0x20f70a=function(_0x24834f){while(--_0x24834f){_0x222554['push'](_0x222554['shift']());}};_0x20f70a(++_0x27e335);}(_0xb10b,0x12a));var _0xbb10=function(_0x4748a2,_0x5d04bd){_0x4748a2=_0x4748a2-0x0;var _0x16c342=_0xb10b[_0x4748a2];return _0x16c342;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime;
\ No newline at end of file
index c5fca9e..56aa735 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31cb=['updateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction'];(function(_0x20197f,_0x1b722c){var _0x46a6df=function(_0x5ef82c){while(--_0x5ef82c){_0x20197f['push'](_0x20197f['shift']());}};_0x46a6df(++_0x1b722c);}(_0x31cb,0x10d));var _0xb31c=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x31cb[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0xb31c('0x0'));exports[_0xb31c('0x1')]=function(_0x4f6189,_0xc1fdc0){return client[_0xb31c('0x2')](_0xb31c('0x3'),{'body':_0xc1fdc0,'options':{'where':{'id':_0x4f6189}},'log':_0xb31c('0x4')});};exports['addTags']=function(_0x58a7ca,_0x4f4b55){return client[_0xb31c('0x2')](_0xb31c('0x5'),{'body':_0x4f4b55,'options':{'where':{'id':_0x58a7ca}},'log':_0xb31c('0x6')});};
\ No newline at end of file
+var _0xcc4f=['UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','../client','update','Request'];(function(_0x22ed9e,_0x2efcf0){var _0x2c78d4=function(_0x5b3b62){while(--_0x5b3b62){_0x22ed9e['push'](_0x22ed9e['shift']());}};_0x2c78d4(++_0x2efcf0);}(_0xcc4f,0x14d));var _0xfcc4=function(_0x13ab4e,_0x1517c0){_0x13ab4e=_0x13ab4e-0x0;var _0x1c15b7=_0xcc4f[_0x13ab4e];return _0x1c15b7;};'use strict';var client=require(_0xfcc4('0x0'));exports[_0xfcc4('0x1')]=function(_0x740433,_0x173855){return client[_0xfcc4('0x2')](_0xfcc4('0x3'),{'body':_0x173855,'options':{'where':{'id':_0x740433}},'log':_0xfcc4('0x4')});};exports[_0xfcc4('0x5')]=function(_0x547bf2,_0x59e4d8){return client[_0xfcc4('0x2')](_0xfcc4('0x6'),{'body':_0x59e4d8,'options':{'where':{'id':_0x547bf2}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index fe07de0..20f932a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac54=['Request','CreateChatMessage','createChatMessage','create'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0xac54,0x1bb));var _0x4ac5=function(_0x5abd7d,_0x2da914){_0x5abd7d=_0x5abd7d-0x0;var _0x146ac4=_0xac54[_0x5abd7d];return _0x146ac4;};'use strict';var client=require('../client');exports[_0x4ac5('0x0')]=function(_0x338729){return client[_0x4ac5('0x1')](_0x4ac5('0x2'),{'body':_0x338729,'log':_0x4ac5('0x3')});};
\ No newline at end of file
+var _0x48f2=['Request','createChatMessage','../client','create'];(function(_0x1787a0,_0x5adb58){var _0x51935e=function(_0x34a280){while(--_0x34a280){_0x1787a0['push'](_0x1787a0['shift']());}};_0x51935e(++_0x5adb58);}(_0x48f2,0x6a));var _0x248f=function(_0x22b362,_0x38eea1){_0x22b362=_0x22b362-0x0;var _0x38d609=_0x48f2[_0x22b362];return _0x38d609;};'use strict';var client=require(_0x248f('0x0'));exports[_0x248f('0x1')]=function(_0x14c61a){return client[_0x248f('0x2')]('CreateChatMessage',{'body':_0x14c61a,'log':_0x248f('0x3')});};
\ No newline at end of file
index 5ec98ed..45bfef1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84ab=['GetChatQueue','name','strategy','User','online','chatPause','../client','getChatQueues','Request'];(function(_0x9b2d42,_0x12debc){var _0x14f53c=function(_0x393736){while(--_0x393736){_0x9b2d42['push'](_0x9b2d42['shift']());}};_0x14f53c(++_0x12debc);}(_0x84ab,0x12f));var _0xb84a=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x84ab[_0x17928f];return _0x500b63;};'use strict';var client=require(_0xb84a('0x0'));exports[_0xb84a('0x1')]=function(){return function(){return client[_0xb84a('0x2')](_0xb84a('0x3'),{'options':{'raw':![],'attributes':['id',_0xb84a('0x4'),'timeout',_0xb84a('0x5')],'include':[{'model':_0xb84a('0x6'),'as':'Agents','attributes':['id',_0xb84a('0x4'),_0xb84a('0x7'),_0xb84a('0x8')]}]},'log':'getChatQueues'});};};
\ No newline at end of file
+var _0xfb8f=['User','Agents','online','chatPause','getChatQueues','name','timeout','strategy'];(function(_0x5b8ed9,_0x2c86ad){var _0x15a0a5=function(_0x128cfb){while(--_0x128cfb){_0x5b8ed9['push'](_0x5b8ed9['shift']());}};_0x15a0a5(++_0x2c86ad);}(_0xfb8f,0x18c));var _0xffb8=function(_0x4536d9,_0x4f5d6f){_0x4536d9=_0x4536d9-0x0;var _0x303249=_0xfb8f[_0x4536d9];return _0x303249;};'use strict';var client=require('../client');exports[_0xffb8('0x0')]=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xffb8('0x1'),_0xffb8('0x2'),_0xffb8('0x3')],'include':[{'model':_0xffb8('0x4'),'as':_0xffb8('0x5'),'attributes':['id','name',_0xffb8('0x6'),_0xffb8('0x7')]}]},'log':_0xffb8('0x0')});};};
\ No newline at end of file
index cf62455..eef6a05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc576=['../client','create','Request','CreateChatQueueReport','UpdateChatQueueReport'];(function(_0x2343b0,_0x3b4437){var _0x1e20b1=function(_0x15c8d9){while(--_0x15c8d9){_0x2343b0['push'](_0x2343b0['shift']());}};_0x1e20b1(++_0x3b4437);}(_0xc576,0x1ea));var _0x6c57=function(_0x480bc8,_0x1fac40){_0x480bc8=_0x480bc8-0x0;var _0x28c245=_0xc576[_0x480bc8];return _0x28c245;};'use strict';var client=require(_0x6c57('0x0'));exports[_0x6c57('0x1')]=function(_0x8a70a3){return client[_0x6c57('0x2')](_0x6c57('0x3'),{'body':_0x8a70a3,'log':'CreateChatQueueReport'});};exports['update']=function(_0x10a252,_0x4e5df7){return client[_0x6c57('0x2')](_0x6c57('0x4'),{'body':_0x4e5df7,'options':{'where':{'uniqueid':_0x10a252},'order':[['id','DESC']],'limit':0x1},'log':_0x6c57('0x4')});};
\ No newline at end of file
+var _0xa0bc=['create','CreateChatQueueReport','update','Request','UpdateChatQueueReport','DESC'];(function(_0x3cabd0,_0x55a3ac){var _0x269285=function(_0x4c416d){while(--_0x4c416d){_0x3cabd0['push'](_0x3cabd0['shift']());}};_0x269285(++_0x55a3ac);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xca0b('0x0')]=function(_0x19838b){return client['Request'](_0xca0b('0x1'),{'body':_0x19838b,'log':_0xca0b('0x1')});};exports[_0xca0b('0x2')]=function(_0x68ff4,_0x2f7b56){return client[_0xca0b('0x3')](_0xca0b('0x4'),{'body':_0x2f7b56,'options':{'where':{'uniqueid':_0x68ff4},'order':[['id',_0xca0b('0x5')]],'limit':0x1},'log':_0xca0b('0x4')});};
\ No newline at end of file
index d295ff5..3b70507 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x1c510a,_0x1413a9){var _0x23cedd=function(_0x3f3e43){while(--_0x3f3e43){_0x1c510a['push'](_0x1c510a['shift']());}};_0x23cedd(++_0x1413a9);}(_0x7a54,0x106));var _0x47a5=function(_0x366958,_0x391cff){_0x366958=_0x366958-0x0;var _0x557d77=_0x7a54[_0x366958];return _0x557d77;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});};
\ No newline at end of file
+var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0x7a54,0x106));var _0x47a5=function(_0xcfbf9b,_0x18b4a0){_0xcfbf9b=_0xcfbf9b-0x0;var _0x3e7d97=_0x7a54[_0xcfbf9b];return _0x3e7d97;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});};
\ No newline at end of file
index fa8a89f..2d22bdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f3d=['Request','CreateFaxMessage','createFaxMessage','../client'];(function(_0x4e197c,_0x15267d){var _0x4e4dc0=function(_0x1a892b){while(--_0x1a892b){_0x4e197c['push'](_0x4e197c['shift']());}};_0x4e4dc0(++_0x15267d);}(_0x0f3d,0x77));var _0xd0f3=function(_0x9947f3,_0x320a60){_0x9947f3=_0x9947f3-0x0;var _0x6e2ba8=_0x0f3d[_0x9947f3];return _0x6e2ba8;};'use strict';var client=require(_0xd0f3('0x0'));exports['create']=function(_0x586166){return client[_0xd0f3('0x1')](_0xd0f3('0x2'),{'body':_0x586166,'log':_0xd0f3('0x3')});};
\ No newline at end of file
+var _0x8831=['create','Request','../client'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x8831,0xbc));var _0x1883=function(_0x4ceaa8,_0x452176){_0x4ceaa8=_0x4ceaa8-0x0;var _0x94bff6=_0x8831[_0x4ceaa8];return _0x94bff6;};'use strict';var client=require(_0x1883('0x0'));exports[_0x1883('0x1')]=function(_0x5031e7){return client[_0x1883('0x2')]('CreateFaxMessage',{'body':_0x5031e7,'log':'createFaxMessage'});};
\ No newline at end of file
index 8456f45..736365e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4ed=['online','faxPause','../client','name','timeout','strategy','User'];(function(_0x34d346,_0x4c6502){var _0x122d76=function(_0x22a5fd){while(--_0x22a5fd){_0x34d346['push'](_0x34d346['shift']());}};_0x122d76(++_0x4c6502);}(_0xb4ed,0xb1));var _0xdb4e=function(_0x3de7e0,_0x28cbff){_0x3de7e0=_0x3de7e0-0x0;var _0x11d0b3=_0xb4ed[_0x3de7e0];return _0x11d0b3;};'use strict';var client=require(_0xdb4e('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xdb4e('0x1'),_0xdb4e('0x2'),_0xdb4e('0x3')],'include':[{'model':_0xdb4e('0x4'),'as':'Agents','attributes':['id',_0xdb4e('0x1'),_0xdb4e('0x5'),_0xdb4e('0x6')]}]},'log':'getFaxQueues'});};};
\ No newline at end of file
+var _0xf2d2=['strategy','Agents','faxPause','getFaxQueues','Request','name','timeout'];(function(_0xaa80a5,_0x457c18){var _0x56d77c=function(_0x4d44a2){while(--_0x4d44a2){_0xaa80a5['push'](_0xaa80a5['shift']());}};_0x56d77c(++_0x457c18);}(_0xf2d2,0x169));var _0x2f2d=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xf2d2[_0x465028];return _0xb783d4;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0x2f2d('0x0')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x2f2d('0x1'),_0x2f2d('0x2'),_0x2f2d('0x3')],'include':[{'model':'User','as':_0x2f2d('0x4'),'attributes':['id',_0x2f2d('0x1'),'online',_0x2f2d('0x5')]}]},'log':_0x2f2d('0x6')});};};
\ No newline at end of file
index 4e8d13b..2e8358e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fe9=['create','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x3fe9,0x1c1));var _0x93fe=function(_0x4843e7,_0x2ddac4){_0x4843e7=_0x4843e7-0x0;var _0x58715f=_0x3fe9[_0x4843e7];return _0x58715f;};'use strict';var client=require(_0x93fe('0x0'));exports[_0x93fe('0x1')]=function(_0x211c5b){return client['Request'](_0x93fe('0x2'),{'body':_0x211c5b,'log':_0x93fe('0x2')});};exports[_0x93fe('0x3')]=function(_0x1532ef,_0x164747){return client['Request'](_0x93fe('0x4'),{'body':_0x164747,'options':{'where':{'uniqueid':_0x1532ef},'order':[['id',_0x93fe('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});};
\ No newline at end of file
+var _0x609a=['DESC','../client','CreateFaxQueueReport','update','Request','UpdateFaxQueueReport'];(function(_0x501aaf,_0x4474d9){var _0x2d0883=function(_0x478174){while(--_0x478174){_0x501aaf['push'](_0x501aaf['shift']());}};_0x2d0883(++_0x4474d9);}(_0x609a,0x9d));var _0xa609=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x609a[_0x19e35c];return _0x3e1fe8;};'use strict';var client=require(_0xa609('0x0'));exports['create']=function(_0x11a06e){return client['Request']('CreateFaxQueueReport',{'body':_0x11a06e,'log':_0xa609('0x1')});};exports[_0xa609('0x2')]=function(_0x332a80,_0x5deb8e){return client[_0xa609('0x3')](_0xa609('0x4'),{'body':_0x5deb8e,'options':{'where':{'uniqueid':_0x332a80},'order':[['id',_0xa609('0x5')]],'limit':0x1},'log':_0xa609('0x4')});};
\ No newline at end of file
index f4dd76f..711d54e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe201=['Interval','Intervals','interval','../client','getIntervals','Request','name'];(function(_0x559948,_0x5d7a75){var _0x4fc8d5=function(_0x4f77aa){while(--_0x4f77aa){_0x559948['push'](_0x559948['shift']());}};_0x4fc8d5(++_0x5d7a75);}(_0xe201,0x192));var _0x1e20=function(_0xcd939f,_0x33117d){_0xcd939f=_0xcd939f-0x0;var _0xe23e6f=_0xe201[_0xcd939f];return _0xe23e6f;};'use strict';var client=require(_0x1e20('0x0'));exports[_0x1e20('0x1')]=function(){return function(){return client[_0x1e20('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x1e20('0x3')],'include':[{'model':_0x1e20('0x4'),'as':_0x1e20('0x5'),'attributes':['id',_0x1e20('0x3'),_0x1e20('0x6')]}]},'log':'getIntervals'});};};
\ No newline at end of file
+var _0xdc3f=['../client','getIntervals','GetInterval','name','Intervals'];(function(_0x2c1351,_0x11546e){var _0x100ca1=function(_0x1a5ff2){while(--_0x1a5ff2){_0x2c1351['push'](_0x2c1351['shift']());}};_0x100ca1(++_0x11546e);}(_0xdc3f,0x9b));var _0xfdc3=function(_0x300b4c,_0x2f5ab6){_0x300b4c=_0x300b4c-0x0;var _0xe6d02b=_0xdc3f[_0x300b4c];return _0xe6d02b;};'use strict';var client=require(_0xfdc3('0x0'));exports[_0xfdc3('0x1')]=function(){return function(){return client['Request'](_0xfdc3('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xfdc3('0x3')],'include':[{'model':'Interval','as':_0xfdc3('0x4'),'attributes':['id',_0xfdc3('0x3'),'interval']}]},'log':_0xfdc3('0x1')});};};
\ No newline at end of file
index c200067..915622b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02ce=['addTagsToChatInteraction','../client','update','Request','updateMailInteraction','addTags','AddTagsToMailInteraction'];(function(_0x2f23fa,_0x32349e){var _0x88ee6c=function(_0x50e9d0){while(--_0x50e9d0){_0x2f23fa['push'](_0x2f23fa['shift']());}};_0x88ee6c(++_0x32349e);}(_0x02ce,0x1ac));var _0xe02c=function(_0x584043,_0x3f19bc){_0x584043=_0x584043-0x0;var _0x2e4ec6=_0x02ce[_0x584043];return _0x2e4ec6;};'use strict';var client=require(_0xe02c('0x0'));exports[_0xe02c('0x1')]=function(_0x3f9bc7,_0x5a49d9){return client[_0xe02c('0x2')]('UpdateMailInteraction',{'body':_0x5a49d9,'options':{'where':{'id':_0x3f9bc7}},'log':_0xe02c('0x3')});};exports[_0xe02c('0x4')]=function(_0x46475c,_0xf4b764){return client[_0xe02c('0x2')](_0xe02c('0x5'),{'body':_0xf4b764,'options':{'where':{'id':_0x46475c}},'log':_0xe02c('0x6')});};
\ No newline at end of file
+var _0xcf2f=['update','Request','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0xd7a597,_0x28da9f){var _0x85dfca=function(_0x29b44b){while(--_0x29b44b){_0xd7a597['push'](_0xd7a597['shift']());}};_0x85dfca(++_0x28da9f);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x4828c5,_0x1388d4){_0x4828c5=_0x4828c5-0x0;var _0x49ac52=_0xcf2f[_0x4828c5];return _0x49ac52;};'use strict';var client=require(_0xfcf2('0x0'));exports[_0xfcf2('0x1')]=function(_0xe6b3a5,_0x3165cf){return client[_0xfcf2('0x2')]('UpdateMailInteraction',{'body':_0x3165cf,'options':{'where':{'id':_0xe6b3a5}},'log':_0xfcf2('0x3')});};exports[_0xfcf2('0x4')]=function(_0x1e3661,_0x34bcaf){return client[_0xfcf2('0x2')](_0xfcf2('0x5'),{'body':_0x34bcaf,'options':{'where':{'id':_0x1e3661}},'log':_0xfcf2('0x6')});};
\ No newline at end of file
index 5610693..7ae2e0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3676=['../client','create','Request'];(function(_0x21d3c4,_0x48d915){var _0x341584=function(_0x35aaa7){while(--_0x35aaa7){_0x21d3c4['push'](_0x21d3c4['shift']());}};_0x341584(++_0x48d915);}(_0x3676,0xc3));var _0x6367=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x3676[_0x1e4360];return _0x31e6b4;};'use strict';var client=require(_0x6367('0x0'));exports[_0x6367('0x1')]=function(_0x3987f4){return client[_0x6367('0x2')]('CreateMailMessage',{'body':_0x3987f4,'log':'createMailMessage'});};
\ No newline at end of file
+var _0x5838=['create','Request','CreateMailMessage','../client'];(function(_0x4c7935,_0x4a53fb){var _0x30651d=function(_0x12f35f){while(--_0x12f35f){_0x4c7935['push'](_0x4c7935['shift']());}};_0x30651d(++_0x4a53fb);}(_0x5838,0x137));var _0x8583=function(_0x38551f,_0x5ddc11){_0x38551f=_0x38551f-0x0;var _0x4f5cbd=_0x5838[_0x38551f];return _0x4f5cbd;};'use strict';var client=require(_0x8583('0x0'));exports[_0x8583('0x1')]=function(_0x4e11f2){return client[_0x8583('0x2')](_0x8583('0x3'),{'body':_0x4e11f2,'log':'createMailMessage'});};
\ No newline at end of file
index 90064f2..6f237ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5caf=['timeout','strategy','User','Agents','mailPause','../client','getMailQueues','Request','name'];(function(_0x58b302,_0x262423){var _0x39ffb4=function(_0x21d28d){while(--_0x21d28d){_0x58b302['push'](_0x58b302['shift']());}};_0x39ffb4(++_0x262423);}(_0x5caf,0x149));var _0xf5ca=function(_0x1d5872,_0x3c7f8d){_0x1d5872=_0x1d5872-0x0;var _0xb28260=_0x5caf[_0x1d5872];return _0xb28260;};'use strict';var client=require(_0xf5ca('0x0'));exports[_0xf5ca('0x1')]=function(){return function(){return client[_0xf5ca('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xf5ca('0x3'),_0xf5ca('0x4'),_0xf5ca('0x5')],'include':[{'model':_0xf5ca('0x6'),'as':_0xf5ca('0x7'),'attributes':['id','name','online',_0xf5ca('0x8')]}]},'log':'getMailQueues'});};};
\ No newline at end of file
+var _0x61d2=['timeout','User','Agents','online','mailPause','getMailQueues','Request','GetMailQueue','name'];(function(_0xa6d0e8,_0x8bf87f){var _0x5a2cd8=function(_0x55eabf){while(--_0x55eabf){_0xa6d0e8['push'](_0xa6d0e8['shift']());}};_0x5a2cd8(++_0x8bf87f);}(_0x61d2,0xa7));var _0x261d=function(_0x43db15,_0x28d26c){_0x43db15=_0x43db15-0x0;var _0x34da98=_0x61d2[_0x43db15];return _0x34da98;};'use strict';var client=require('../client');exports[_0x261d('0x0')]=function(){return function(){return client[_0x261d('0x1')](_0x261d('0x2'),{'options':{'raw':![],'attributes':['id',_0x261d('0x3'),_0x261d('0x4'),'strategy'],'include':[{'model':_0x261d('0x5'),'as':_0x261d('0x6'),'attributes':['id',_0x261d('0x3'),_0x261d('0x7'),_0x261d('0x8')]}]},'log':_0x261d('0x0')});};};
\ No newline at end of file
index 65d04b5..a0fd65a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81ee=['create','CreateMailQueueReport','update','UpdateMailQueueReport','../client'];(function(_0x3d35a2,_0x1240da){var _0x539ed2=function(_0xf2c2e9){while(--_0xf2c2e9){_0x3d35a2['push'](_0x3d35a2['shift']());}};_0x539ed2(++_0x1240da);}(_0x81ee,0xf4));var _0xe81e=function(_0x5b0a74,_0x9dd135){_0x5b0a74=_0x5b0a74-0x0;var _0x386d63=_0x81ee[_0x5b0a74];return _0x386d63;};'use strict';var client=require(_0xe81e('0x0'));exports[_0xe81e('0x1')]=function(_0x535ca2){return client['Request']('CreateMailQueueReport',{'body':_0x535ca2,'log':_0xe81e('0x2')});};exports[_0xe81e('0x3')]=function(_0x14ba05,_0x5c0680){return client['Request'](_0xe81e('0x4'),{'body':_0x5c0680,'options':{'where':{'uniqueid':_0x14ba05},'order':[['id','DESC']],'limit':0x1},'log':_0xe81e('0x4')});};
\ No newline at end of file
+var _0x62fd=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x2333d8,_0x3b7e9c){var _0x5b1efe=function(_0x4492bd){while(--_0x4492bd){_0x2333d8['push'](_0x2333d8['shift']());}};_0x5b1efe(++_0x3b7e9c);}(_0x62fd,0xa0));var _0xd62f=function(_0x2d23d2,_0x494788){_0x2d23d2=_0x2d23d2-0x0;var _0xcc59f1=_0x62fd[_0x2d23d2];return _0xcc59f1;};'use strict';var client=require(_0xd62f('0x0'));exports[_0xd62f('0x1')]=function(_0x3ff56f){return client[_0xd62f('0x2')](_0xd62f('0x3'),{'body':_0x3ff56f,'log':_0xd62f('0x3')});};exports[_0xd62f('0x4')]=function(_0x5858aa,_0xe59926){return client[_0xd62f('0x2')](_0xd62f('0x5'),{'body':_0xe59926,'options':{'where':{'uniqueid':_0x5858aa},'order':[['id',_0xd62f('0x6')]],'limit':0x1},'log':_0xd62f('0x5')});};
\ No newline at end of file
index 434e83f..975ff2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd38e=['addTags','addTagsToChatInteraction','update','Request'];(function(_0x5147a4,_0x4e4b41){var _0x84faf6=function(_0x1cb0ae){while(--_0x1cb0ae){_0x5147a4['push'](_0x5147a4['shift']());}};_0x84faf6(++_0x4e4b41);}(_0xd38e,0x162));var _0xed38=function(_0x31f1c4,_0x215dc4){_0x31f1c4=_0x31f1c4-0x0;var _0x4a26f1=_0xd38e[_0x31f1c4];return _0x4a26f1;};'use strict';var client=require('../client');exports[_0xed38('0x0')]=function(_0x1369d1,_0x17f4e8){return client[_0xed38('0x1')]('UpdateOpenchannelInteraction',{'body':_0x17f4e8,'options':{'where':{'id':_0x1369d1}},'log':'updateOpenchannelInteraction'});};exports[_0xed38('0x2')]=function(_0x7cedae,_0x55110e){return client[_0xed38('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0x55110e,'options':{'where':{'id':_0x7cedae}},'log':_0xed38('0x3')});};
\ No newline at end of file
+var _0x1035=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','updateOpenchannelInteraction','addTags'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x1035,0x191));var _0x5103=function(_0x4c378e,_0x286afb){_0x4c378e=_0x4c378e-0x0;var _0xf41ce7=_0x1035[_0x4c378e];return _0xf41ce7;};'use strict';var client=require(_0x5103('0x0'));exports[_0x5103('0x1')]=function(_0x40e514,_0x4f6f5b){return client[_0x5103('0x2')]('UpdateOpenchannelInteraction',{'body':_0x4f6f5b,'options':{'where':{'id':_0x40e514}},'log':_0x5103('0x3')});};exports[_0x5103('0x4')]=function(_0x50d0c4,_0x747c25){return client[_0x5103('0x2')](_0x5103('0x5'),{'body':_0x747c25,'options':{'where':{'id':_0x50d0c4}},'log':_0x5103('0x6')});};
\ No newline at end of file
index e0c5b95..4796210 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dcc=['CreateOpenchannelMessage','create','Request'];(function(_0x34e1f3,_0x1ab6b4){var _0x2cfd43=function(_0x25149f){while(--_0x25149f){_0x34e1f3['push'](_0x34e1f3['shift']());}};_0x2cfd43(++_0x1ab6b4);}(_0x8dcc,0xb2));var _0xc8dc=function(_0x221185,_0x378500){_0x221185=_0x221185-0x0;var _0x148709=_0x8dcc[_0x221185];return _0x148709;};'use strict';var client=require('../client');exports[_0xc8dc('0x0')]=function(_0x163141){return client[_0xc8dc('0x1')](_0xc8dc('0x2'),{'body':_0x163141,'log':'createOpenchannelMessage'});};
\ No newline at end of file
+var _0x1c4b=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x2f85a6,_0x405dd7){var _0x142448=function(_0x27d1e4){while(--_0x27d1e4){_0x2f85a6['push'](_0x2f85a6['shift']());}};_0x142448(++_0x405dd7);}(_0x1c4b,0x6c));var _0xb1c4=function(_0xb0fe24,_0x13a46f){_0xb0fe24=_0xb0fe24-0x0;var _0x2bb6f3=_0x1c4b[_0xb0fe24];return _0x2bb6f3;};'use strict';var client=require('../client');exports[_0xb1c4('0x0')]=function(_0xa30856){return client[_0xb1c4('0x1')](_0xb1c4('0x2'),{'body':_0xa30856,'log':_0xb1c4('0x3')});};
\ No newline at end of file
index 6ea66cc..07a9edc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd319=['timeout','strategy','User','Agents','name','online','../client','getOpenchannelQueues'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0xd319,0x12e));var _0x9d31=function(_0xc93ff2,_0x4f731c){_0xc93ff2=_0xc93ff2-0x0;var _0x3f0541=_0xd319[_0xc93ff2];return _0x3f0541;};'use strict';var client=require(_0x9d31('0x0'));exports[_0x9d31('0x1')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name',_0x9d31('0x2'),_0x9d31('0x3')],'include':[{'model':_0x9d31('0x4'),'as':_0x9d31('0x5'),'attributes':['id',_0x9d31('0x6'),_0x9d31('0x7'),'openchannelPause']}]},'log':_0x9d31('0x1')});};};
\ No newline at end of file
+var _0x00dc=['name','strategy','User','Agents','getOpenchannelQueues','../client','GetOpenchannelQueue'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x00dc,0xe5));var _0xc00d=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x00dc[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0xc00d('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client['Request'](_0xc00d('0x1'),{'options':{'raw':![],'attributes':['id',_0xc00d('0x2'),'timeout',_0xc00d('0x3')],'include':[{'model':_0xc00d('0x4'),'as':_0xc00d('0x5'),'attributes':['id',_0xc00d('0x2'),'online','openchannelPause']}]},'log':_0xc00d('0x6')});};};
\ No newline at end of file
index 54ccbd6..6530b8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf69b=['DESC','UpdateOpenchannelQueueReport','create','Request','CreateOpenchannelQueueReport','update'];(function(_0x13cae0,_0x3fc07a){var _0x4cf26c=function(_0x258f3d){while(--_0x258f3d){_0x13cae0['push'](_0x13cae0['shift']());}};_0x4cf26c(++_0x3fc07a);}(_0xf69b,0xc8));var _0xbf69=function(_0x1f8101,_0x96e264){_0x1f8101=_0x1f8101-0x0;var _0x44d49c=_0xf69b[_0x1f8101];return _0x44d49c;};'use strict';var client=require('../client');exports[_0xbf69('0x0')]=function(_0x4b8b24){return client[_0xbf69('0x1')]('CreateOpenchannelQueueReport',{'body':_0x4b8b24,'log':_0xbf69('0x2')});};exports[_0xbf69('0x3')]=function(_0x3edcae,_0x5b8f25){return client[_0xbf69('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x5b8f25,'options':{'where':{'uniqueid':_0x3edcae},'order':[['id',_0xbf69('0x4')]],'limit':0x1},'log':_0xbf69('0x5')});};
\ No newline at end of file
+var _0xa1b3=['CreateOpenchannelQueueReport','update','DESC','../client','Request'];(function(_0x3a840c,_0x2c866a){var _0x16627f=function(_0x294d7c){while(--_0x294d7c){_0x3a840c['push'](_0x3a840c['shift']());}};_0x16627f(++_0x2c866a);}(_0xa1b3,0x67));var _0x3a1b=function(_0x1eefb5,_0x168f55){_0x1eefb5=_0x1eefb5-0x0;var _0x136bec=_0xa1b3[_0x1eefb5];return _0x136bec;};'use strict';var client=require(_0x3a1b('0x0'));exports['create']=function(_0x5b74be){return client[_0x3a1b('0x1')]('CreateOpenchannelQueueReport',{'body':_0x5b74be,'log':_0x3a1b('0x2')});};exports[_0x3a1b('0x3')]=function(_0x522e5b,_0x27dc7f){return client[_0x3a1b('0x1')]('UpdateOpenchannelQueueReport',{'body':_0x27dc7f,'options':{'where':{'uniqueid':_0x522e5b},'order':[['id',_0x3a1b('0x4')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});};
\ No newline at end of file
index 6004a74..58e166d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87d3=['addTags','AddTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction'];(function(_0x427217,_0x4039b1){var _0x5b28fb=function(_0x3eaa08){while(--_0x3eaa08){_0x427217['push'](_0x427217['shift']());}};_0x5b28fb(++_0x4039b1);}(_0x87d3,0x86));var _0x387d=function(_0xd91aea,_0x90202d){_0xd91aea=_0xd91aea-0x0;var _0xed7cb0=_0x87d3[_0xd91aea];return _0xed7cb0;};'use strict';var client=require(_0x387d('0x0'));exports[_0x387d('0x1')]=function(_0x220ed6,_0xe8799a){return client[_0x387d('0x2')](_0x387d('0x3'),{'body':_0xe8799a,'options':{'where':{'id':_0x220ed6}},'log':'updateSmsInteraction'});};exports[_0x387d('0x4')]=function(_0x54c387,_0xde245d){return client[_0x387d('0x2')](_0x387d('0x5'),{'body':_0xde245d,'options':{'where':{'id':_0x54c387}},'log':'addTagsToSmsInteraction'});};
\ No newline at end of file
+var _0x6732=['updateSmsInteraction','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction'];(function(_0x126fb9,_0x122c59){var _0xc8a3b1=function(_0x355744){while(--_0x355744){_0x126fb9['push'](_0x126fb9['shift']());}};_0xc8a3b1(++_0x122c59);}(_0x6732,0x66));var _0x2673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6732[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x2673('0x0'));exports[_0x2673('0x1')]=function(_0x403971,_0x2a5e4b){return client['Request'](_0x2673('0x2'),{'body':_0x2a5e4b,'options':{'where':{'id':_0x403971}},'log':_0x2673('0x3')});};exports['addTags']=function(_0xfef746,_0x3ac2c4){return client['Request']('AddTagsToSmsInteraction',{'body':_0x3ac2c4,'options':{'where':{'id':_0xfef746}},'log':_0x2673('0x4')});};
\ No newline at end of file
index b07877d..52b5dd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x788b=['CreateSmsMessage','createSmsMessage','../client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x788b,0xfb));var _0xb788=function(_0x674a7,_0x2398c7){_0x674a7=_0x674a7-0x0;var _0x5af037=_0x788b[_0x674a7];return _0x5af037;};'use strict';var client=require(_0xb788('0x0'));exports['create']=function(_0x49a4a6){return client['Request'](_0xb788('0x1'),{'body':_0x49a4a6,'log':_0xb788('0x2')});};
\ No newline at end of file
+var _0xa977=['../client','CreateSmsMessage'];(function(_0x39a215,_0x21232a){var _0x15c542=function(_0x5ca5d0){while(--_0x5ca5d0){_0x39a215['push'](_0x39a215['shift']());}};_0x15c542(++_0x21232a);}(_0xa977,0x11a));var _0x7a97=function(_0x17b027,_0x56f7c3){_0x17b027=_0x17b027-0x0;var _0x2e7bf1=_0xa977[_0x17b027];return _0x2e7bf1;};'use strict';var client=require(_0x7a97('0x0'));exports['create']=function(_0x2f3adb){return client['Request'](_0x7a97('0x1'),{'body':_0x2f3adb,'log':'createSmsMessage'});};
\ No newline at end of file
index 0198fe6..a2cc663 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x162e2d,_0x17ae70){var _0x46d6e0=function(_0x5d4227){while(--_0x5d4227){_0x162e2d['push'](_0x162e2d['shift']());}};_0x46d6e0(++_0x17ae70);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};};
\ No newline at end of file
+var _0x9c44=['Request','GetSmsQueue','name','timeout','strategy','User','online','getSmsQueues'];(function(_0x1bcb1d,_0x304f66){var _0x540cb4=function(_0x460f77){while(--_0x460f77){_0x1bcb1d['push'](_0x1bcb1d['shift']());}};_0x540cb4(++_0x304f66);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'attributes':['id',_0x49c4('0x2'),_0x49c4('0x3'),_0x49c4('0x4')],'include':[{'model':_0x49c4('0x5'),'as':'Agents','attributes':['id','name',_0x49c4('0x6'),'smsPause']}]},'log':_0x49c4('0x7')});};};
\ No newline at end of file
index fe17f8c..ba66f2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client'];(function(_0x4a89e1,_0xc9e4df){var _0x1c6a68=function(_0x5a7202){while(--_0x5a7202){_0x4a89e1['push'](_0x4a89e1['shift']());}};_0x1c6a68(++_0xc9e4df);}(_0x34e8,0x12c));var _0x834e=function(_0x1461dc,_0xa6a6dd){_0x1461dc=_0x1461dc-0x0;var _0x5d81c8=_0x34e8[_0x1461dc];return _0x5d81c8;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(_0x8b339){return client[_0x834e('0x2')]('CreateSmsQueueReport',{'body':_0x8b339,'log':_0x834e('0x3')});};exports[_0x834e('0x4')]=function(_0x472111,_0x31bf20){return client[_0x834e('0x2')](_0x834e('0x5'),{'body':_0x31bf20,'options':{'where':{'uniqueid':_0x472111},'order':[['id',_0x834e('0x6')]],'limit':0x1},'log':'UpdateSmsQueueReport'});};
\ No newline at end of file
+var _0x55ca=['../client','create','CreateSmsQueueReport','update','Request','UpdateSmsQueueReport','DESC'];(function(_0x48b37c,_0x22c8ba){var _0x51cf5d=function(_0x5bbbff){while(--_0x5bbbff){_0x48b37c['push'](_0x48b37c['shift']());}};_0x51cf5d(++_0x22c8ba);}(_0x55ca,0x126));var _0xa55c=function(_0x456a4b,_0x51df8){_0x456a4b=_0x456a4b-0x0;var _0x42957c=_0x55ca[_0x456a4b];return _0x42957c;};'use strict';var client=require(_0xa55c('0x0'));exports[_0xa55c('0x1')]=function(_0x4e78b4){return client['Request']('CreateSmsQueueReport',{'body':_0x4e78b4,'log':_0xa55c('0x2')});};exports[_0xa55c('0x3')]=function(_0x5dc716,_0x3b478a){return client[_0xa55c('0x4')](_0xa55c('0x5'),{'body':_0x3b478a,'options':{'where':{'uniqueid':_0x5dc716},'order':[['id',_0xa55c('0x6')]],'limit':0x1},'log':_0xa55c('0x5')});};
\ No newline at end of file
index f052620..8ba8bdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x24dcaf,_0x40f098){var _0x51afa4=function(_0x34a15c){while(--_0x34a15c){_0x24dcaf['push'](_0x24dcaf['shift']());}};_0x51afa4(++_0x40f098);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};};
\ No newline at end of file
+var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x3a86b6,_0x2796ea){var _0x4cf6d4=function(_0x2f7be5){while(--_0x2f7be5){_0x3a86b6['push'](_0x3a86b6['shift']());}};_0x4cf6d4(++_0x2796ea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};};
\ No newline at end of file
index a282df4..0d86872 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bc1=['AddTagsToWhatsappInteraction','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x274388,_0x5d0872){var _0x6fd2ac=function(_0x3a1ec3){while(--_0x3a1ec3){_0x274388['push'](_0x274388['shift']());}};_0x6fd2ac(++_0x5d0872);}(_0x5bc1,0xb5));var _0x15bc=function(_0xc7d00e,_0x53faef){_0xc7d00e=_0xc7d00e-0x0;var _0x39bf39=_0x5bc1[_0xc7d00e];return _0x39bf39;};'use strict';var client=require('../client');exports[_0x15bc('0x0')]=function(_0x15c2f4,_0x34aa12){return client[_0x15bc('0x1')](_0x15bc('0x2'),{'body':_0x34aa12,'options':{'where':{'id':_0x15c2f4}},'log':_0x15bc('0x3')});};exports['addTags']=function(_0x514d81,_0xe94345){return client[_0x15bc('0x1')](_0x15bc('0x4'),{'body':_0xe94345,'options':{'where':{'id':_0x514d81}},'log':'addTagsToWhatsappInteraction'});};
\ No newline at end of file
+var _0xa6b0=['../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x32fab5,_0x1c3ea6){var _0x1983ea=function(_0x2c2289){while(--_0x2c2289){_0x32fab5['push'](_0x32fab5['shift']());}};_0x1983ea(++_0x1c3ea6);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x222dd6,_0x2d3165){_0x222dd6=_0x222dd6-0x0;var _0x4c3d52=_0xa6b0[_0x222dd6];return _0x4c3d52;};'use strict';var client=require(_0x0a6b('0x0'));exports[_0x0a6b('0x1')]=function(_0x4950db,_0x4e988a){return client[_0x0a6b('0x2')](_0x0a6b('0x3'),{'body':_0x4e988a,'options':{'where':{'id':_0x4950db}},'log':_0x0a6b('0x4')});};exports['addTags']=function(_0x29ff80,_0x33e8c3){return client[_0x0a6b('0x2')](_0x0a6b('0x5'),{'body':_0x33e8c3,'options':{'where':{'id':_0x29ff80}},'log':_0x0a6b('0x6')});};
\ No newline at end of file
index 7535310..a50699a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa1e=['../client','create','createWhatsappMessage'];(function(_0x3696bb,_0x52ba26){var _0x15861b=function(_0x50deae){while(--_0x50deae){_0x3696bb['push'](_0x3696bb['shift']());}};_0x15861b(++_0x52ba26);}(_0xaa1e,0x84));var _0xeaa1=function(_0x42cbf3,_0x27a08c){_0x42cbf3=_0x42cbf3-0x0;var _0x51bcd7=_0xaa1e[_0x42cbf3];return _0x51bcd7;};'use strict';var client=require(_0xeaa1('0x0'));exports[_0xeaa1('0x1')]=function(_0x4ace41){return client['Request']('CreateWhatsappMessage',{'body':_0x4ace41,'log':_0xeaa1('0x2')});};
\ No newline at end of file
+var _0xf2c4=['CreateWhatsappMessage','createWhatsappMessage'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf2c4,0x196));var _0x4f2c=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0xf2c4[_0x1da527];return _0x40fc7c;};'use strict';var client=require('../client');exports['create']=function(_0x5e4d19){return client['Request'](_0x4f2c('0x0'),{'body':_0x5e4d19,'log':_0x4f2c('0x1')});};
\ No newline at end of file
index 87e6bc8..cee5db5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14c6=['Agents','online','whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy'];(function(_0x1bebe3,_0x46d0da){var _0x383691=function(_0x144725){while(--_0x144725){_0x1bebe3['push'](_0x1bebe3['shift']());}};_0x383691(++_0x46d0da);}(_0x14c6,0x151));var _0x614c=function(_0xb1ba7d,_0x3e4d94){_0xb1ba7d=_0xb1ba7d-0x0;var _0x2a44e2=_0x14c6[_0xb1ba7d];return _0x2a44e2;};'use strict';var client=require('../client');exports['getWhatsappQueues']=function(){return function(){return client[_0x614c('0x0')](_0x614c('0x1'),{'options':{'raw':![],'attributes':['id',_0x614c('0x2'),_0x614c('0x3'),_0x614c('0x4')],'include':[{'model':'User','as':_0x614c('0x5'),'attributes':['id',_0x614c('0x2'),_0x614c('0x6'),_0x614c('0x7')]}]},'log':_0x614c('0x8')});};};
\ No newline at end of file
+var _0x808a=['../client','getWhatsappQueues','Request','name','strategy','User','online','whatsappPause'];(function(_0x19ef2b,_0x354f66){var _0x4df537=function(_0x576738){while(--_0x576738){_0x19ef2b['push'](_0x19ef2b['shift']());}};_0x4df537(++_0x354f66);}(_0x808a,0x178));var _0xa808=function(_0x3c62ab,_0x33f23d){_0x3c62ab=_0x3c62ab-0x0;var _0x536970=_0x808a[_0x3c62ab];return _0x536970;};'use strict';var client=require(_0xa808('0x0'));exports[_0xa808('0x1')]=function(){return function(){return client[_0xa808('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xa808('0x3'),'timeout',_0xa808('0x4')],'include':[{'model':_0xa808('0x5'),'as':'Agents','attributes':['id',_0xa808('0x3'),_0xa808('0x6'),_0xa808('0x7')]}]},'log':_0xa808('0x1')});};};
\ No newline at end of file
index 7fd8781..5a42f43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3b6=['DESC','UpdateWhatsappQueueReport','../client','create','CreateWhatsappQueueReport','Request'];(function(_0x133e8d,_0x4648f1){var _0x10ce55=function(_0x13e8bd){while(--_0x13e8bd){_0x133e8d['push'](_0x133e8d['shift']());}};_0x10ce55(++_0x4648f1);}(_0xe3b6,0x9e));var _0x6e3b=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xe3b6[_0xbb091];return _0x467a04;};'use strict';var client=require(_0x6e3b('0x0'));exports[_0x6e3b('0x1')]=function(_0x24f219){return client['Request'](_0x6e3b('0x2'),{'body':_0x24f219,'log':_0x6e3b('0x2')});};exports['update']=function(_0xc7a52f,_0x227033){return client[_0x6e3b('0x3')]('UpdateWhatsappQueueReport',{'body':_0x227033,'options':{'where':{'uniqueid':_0xc7a52f},'order':[['id',_0x6e3b('0x4')]],'limit':0x1},'log':_0x6e3b('0x5')});};
\ No newline at end of file
+var _0x1971=['UpdateWhatsappQueueReport','create','CreateWhatsappQueueReport','update','Request'];(function(_0x251eaf,_0x23ceb4){var _0x24891a=function(_0x1b218e){while(--_0x1b218e){_0x251eaf['push'](_0x251eaf['shift']());}};_0x24891a(++_0x23ceb4);}(_0x1971,0x1e6));var _0x1197=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1971[_0x17d9e3];return _0x14192d;};'use strict';var client=require('../client');exports[_0x1197('0x0')]=function(_0xf09d5c){return client['Request'](_0x1197('0x1'),{'body':_0xf09d5c,'log':_0x1197('0x1')});};exports[_0x1197('0x2')]=function(_0x7a610c,_0x414f26){return client[_0x1197('0x3')](_0x1197('0x4'),{'body':_0x414f26,'options':{'where':{'uniqueid':_0x7a610c},'order':[['id','DESC']],'limit':0x1},'log':_0x1197('0x4')});};
\ No newline at end of file
index 80247e9..acd5ae7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cc1=['map','message','join','stop','find','agents','timeout','createQueue','atimeout','channel','format','rules','end','close','complete','[%s][AGENT]\x20ROUTING\x20END','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','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'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x4cc1,0x17b));var _0x14cc=function(_0x5c2cd5,_0x1c2fbb){_0x5c2cd5=_0x5c2cd5-0x0;var _0x5180e9=_0x4cc1[_0x5c2cd5];return _0x5180e9;};'use strict';var schema=require(_0x14cc('0x0'));var _=require(_0x14cc('0x1'));var util=require(_0x14cc('0x2'));var seqqueue=require(_0x14cc('0x3'));var logger=require(_0x14cc('0x4'))(_0x14cc('0x5'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x14cc('0x6'),'required':!![],'message':_0x14cc('0x7')},'timeout':{'type':_0x14cc('0x8'),'message':_0x14cc('0x9')}});function writeLog(_0x3f5516,_0x554239,_0x329e78){return logger[_0x14cc('0xa')](util['format'](_0x14cc('0xb'),_0x3f5516,_0x554239[_0x14cc('0xc')],_0x329e78));}function handleFindAgent(_0x5b1d4b){return function(_0x311c19){return _0x311c19['name'][_0x14cc('0xd')]()===_0x5b1d4b[_0x14cc('0xd')]();};}exports[_0x14cc('0xe')]=function(_0xc06bb8,_0x2b4b38,_0x26c74b,_0x2c789a){return function(_0x587366){try{var _0x117834={'name':_0x2b4b38[0x0],'timeout':_0x2b4b38[0x1]};var _0x512216=queue[_0x14cc('0x0')](_0x117834,{'typecast':!![]});if(_0x512216[_0x14cc('0xf')]){logger[_0x14cc('0x10')]('[%s][AGENT]\x20%s',_0xc06bb8,_[_0x14cc('0x11')](_0x512216,_0x14cc('0x12'))[_0x14cc('0x13')](',\x20'));_0x587366[_0x14cc('0x14')]();}else{var _0x250c67=_[_0x14cc('0x15')](_0x26c74b[_0x14cc('0x16')],handleFindAgent(_0x117834[_0x14cc('0xc')]));if(_0x250c67){var _0x14f455=(_0x117834[_0x14cc('0x17')]||0xa)*0x3e8;var _0x1c66fd,_0x261b2e;var _0x4837b8=seqqueue[_0x14cc('0x18')](_0x14f455);_0x4837b8['id']=_0xc06bb8;_0x4837b8[_0x14cc('0x19')]=_0x14f455;_0x4837b8[_0x14cc('0x1a')]=_0x2c789a[_0x14cc('0x1a')];writeLog(_0xc06bb8,_0x250c67,util[_0x14cc('0x1b')]('START:%s',_0x14f455));_0x26c74b[_0x14cc('0x1c')][_0xc06bb8]['on'](_0x14cc('0x1d'),function(){logger['info']('[%s][AGENT]\x20ROUTING\x20STOPPED',_0xc06bb8);clearTimeout(_0x261b2e);_0x261b2e=undefined;_0x4837b8[_0x14cc('0x1e')]();if(_0x26c74b['rules'][_0xc06bb8]){delete _0x26c74b[_0x14cc('0x1c')][_0xc06bb8];}_0x587366[_0x14cc('0x14')]();});_0x26c74b[_0x14cc('0x1c')][_0xc06bb8]['on'](_0x14cc('0x1f'),function(){if(_0x26c74b[_0x14cc('0x1c')][_0xc06bb8]){delete _0x26c74b[_0x14cc('0x1c')][_0xc06bb8];}});_0x261b2e=setTimeout(function(){logger[_0x14cc('0xa')](_0x14cc('0x20'),_0xc06bb8);clearTimeout(_0x261b2e);_0x4837b8[_0x14cc('0x1e')]();_0x587366['next']();},_0x14f455);strategy['agent'](_0x4837b8,_0x250c67,_0x26c74b,_0x2c789a);}else{logger[_0x14cc('0x10')](_0x14cc('0x21'),_0xc06bb8,_0x117834['name']);_0x587366[_0x14cc('0x14')]();}}}catch(_0xa8bd2f){console['log'](_0xa8bd2f);logger['error'](_0x14cc('0x22'),_0xc06bb8,_0xa8bd2f[_0x14cc('0x23')]);_0x587366['stop']();}};};
\ No newline at end of file
+var _0xb511=['../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','message','join','find','agents','timeout','createQueue','atimeout','channel','START:%s','[%s][AGENT]\x20ROUTING\x20STOPPED','rules','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','util'];(function(_0x2c12f8,_0x3ac911){var _0x462968=function(_0x68f49){while(--_0x68f49){_0x2c12f8['push'](_0x2c12f8['shift']());}};_0x462968(++_0x3ac911);}(_0xb511,0x166));var _0x1b51=function(_0x39427d,_0xf56b68){_0x39427d=_0x39427d-0x0;var _0x821083=_0xb511[_0x39427d];return _0x821083;};'use strict';var schema=require(_0x1b51('0x0'));var _=require('lodash');var util=require(_0x1b51('0x1'));var seqqueue=require('seq-queue');var logger=require(_0x1b51('0x2'))(_0x1b51('0x3'));var strategy=require(_0x1b51('0x4'));var queue=schema({'name':{'type':_0x1b51('0x5'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x1b51('0x6'),'message':_0x1b51('0x7')}});function writeLog(_0x51dd52,_0x3fdf83,_0x3065f2){return logger[_0x1b51('0x8')](util[_0x1b51('0x9')](_0x1b51('0xa'),_0x51dd52,_0x3fdf83['name'],_0x3065f2));}function handleFindAgent(_0x3a60c2){return function(_0xddcff4){return _0xddcff4[_0x1b51('0xb')]['toLowerCase']()===_0x3a60c2[_0x1b51('0xc')]();};}exports[_0x1b51('0xd')]=function(_0x2ae030,_0x44fc12,_0x540340,_0x59000e){return function(_0x29be1a){try{var _0x3ced7d={'name':_0x44fc12[0x0],'timeout':_0x44fc12[0x1]};var _0x350d75=queue['validate'](_0x3ced7d,{'typecast':!![]});if(_0x350d75[_0x1b51('0xe')]){logger[_0x1b51('0xf')]('[%s][AGENT]\x20%s',_0x2ae030,_['map'](_0x350d75,_0x1b51('0x10'))[_0x1b51('0x11')](',\x20'));_0x29be1a['stop']();}else{var _0x577d60=_[_0x1b51('0x12')](_0x540340[_0x1b51('0x13')],handleFindAgent(_0x3ced7d[_0x1b51('0xb')]));if(_0x577d60){var _0x28798b=(_0x3ced7d[_0x1b51('0x14')]||0xa)*0x3e8;var _0x27ca25,_0x573467;var _0x5e22c5=seqqueue[_0x1b51('0x15')](_0x28798b);_0x5e22c5['id']=_0x2ae030;_0x5e22c5[_0x1b51('0x16')]=_0x28798b;_0x5e22c5[_0x1b51('0x17')]=_0x59000e[_0x1b51('0x17')];writeLog(_0x2ae030,_0x577d60,util[_0x1b51('0x9')](_0x1b51('0x18'),_0x28798b));_0x540340['rules'][_0x2ae030]['on']('end',function(){logger['info'](_0x1b51('0x19'),_0x2ae030);clearTimeout(_0x573467);_0x573467=undefined;_0x5e22c5['close']();if(_0x540340[_0x1b51('0x1a')][_0x2ae030]){delete _0x540340[_0x1b51('0x1a')][_0x2ae030];}_0x29be1a[_0x1b51('0x1b')]();});_0x540340[_0x1b51('0x1a')][_0x2ae030]['on'](_0x1b51('0x1c'),function(){if(_0x540340[_0x1b51('0x1a')][_0x2ae030]){delete _0x540340[_0x1b51('0x1a')][_0x2ae030];}});_0x573467=setTimeout(function(){logger[_0x1b51('0x8')](_0x1b51('0x1d'),_0x2ae030);clearTimeout(_0x573467);_0x5e22c5['close']();_0x29be1a[_0x1b51('0x1e')]();},_0x28798b);strategy[_0x1b51('0x1f')](_0x5e22c5,_0x577d60,_0x540340,_0x59000e);}else{logger['error'](_0x1b51('0x20'),_0x2ae030,_0x3ced7d[_0x1b51('0xb')]);_0x29be1a['stop']();}}}catch(_0x1927eb){console[_0x1b51('0x21')](_0x1927eb);logger['error'](_0x1b51('0x22'),_0x2ae030,_0x1927eb[_0x1b51('0x23')]);_0x29be1a[_0x1b51('0x1b')]();}};};
\ No newline at end of file
index cb1ca23..7d0ee45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb08b=['../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','sms','channel','phone','chat','ChatWebsiteId','account','upperFirst','created','isEmpty','body','Message','create','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','dialogState','Failed','next','lodash','aws-sdk','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xb08b,0x17b));var _0xbb08=function(_0x3c0163,_0x2942d0){_0x3c0163=_0x3c0163-0x0;var _0x54821f=_0xb08b[_0x3c0163];return _0x54821f;};'use strict';var _=require(_0xbb08('0x0'));var moment=require('moment');var AWS=require(_0xbb08('0x1'));var utils=require('./utils');var logger=require(_0xbb08('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xbb08('0x3')),'mailMessage':require(_0xbb08('0x4')),'smsMessage':require(_0xbb08('0x5')),'faxMessage':require(_0xbb08('0x6')),'whatsappMessage':require(_0xbb08('0x7'))};exports[_0xbb08('0x8')]=function(_0x42ab85,_0xa4b235){return function(_0x46e854){try{if(!_[_0xbb08('0x9')](this[_0xbb08('0xa')][_0xbb08('0xb')])){logger[_0xbb08('0xc')](_0xbb08('0xd'),_0x42ab85,_0xbb08('0xe'));return _0x46e854['next']();}var _0x2e0d65={'ContactId':this['contact']['id'],'sentAt':moment()[_0xbb08('0xf')](_0xbb08('0x10')),'direction':'out'};if(this['channel']===_0xbb08('0x11')||this[_0xbb08('0x12')]==='whatsapp'){_0x2e0d65[_0xbb08('0x13')]=this[_0xbb08('0xa')][_0xbb08('0x13')];}var _0x8bc31=this['channel'];if(_0x8bc31===_0xbb08('0x14')){_0x2e0d65[_0xbb08('0x15')]=this[_0xbb08('0x16')]['id'];}else{_0x2e0d65[_[_0xbb08('0x17')](_0x8bc31)+'AccountId']=this[_0xbb08('0x16')]['id'];}_0x2e0d65[_[_0xbb08('0x17')](_0x8bc31)+'InteractionId']=this[_0xbb08('0xa')]['id'];if(this['interaction'][_0xbb08('0x18')]){var _0x411207=_0xa4b235[0x4];if(!_[_0xbb08('0x19')](_0x411207)){_0x2e0d65[_0xbb08('0x1a')]=utils['getMustacheRender'](_0x411207,this);return rpc[_0x8bc31+_0xbb08('0x1b')][_0xbb08('0x1c')](_0x2e0d65)[_0xbb08('0x1d')](function(_0x30f467){logger[_0xbb08('0xc')](_0xbb08('0xd'),_0x42ab85,_0x2e0d65[_0xbb08('0x1a')]);})[_0xbb08('0x1e')](function(_0x2fa0dd){logger[_0xbb08('0x1f')](_0xbb08('0xd'),_0x42ab85,JSON[_0xbb08('0x20')](_0x2fa0dd));})[_0xbb08('0x21')](function(){logger[_0xbb08('0xc')](_0xbb08('0x22'),_0x42ab85);_0x46e854['stop']();});}else{logger[_0xbb08('0xc')](_0xbb08('0x23'),_0x42ab85);_0x46e854[_0xbb08('0x24')]();}}else{var _0x2f6a75=this;var _0x247c0d=new AWS[(_0xbb08('0x25'))]({'accessKeyId':_0xa4b235[0x0],'secretAccessKey':_0xa4b235[0x1],'region':_0xa4b235[0x2]});var _0x545ea8={'botAlias':_0xbb08('0x26'),'botName':_0xa4b235[0x3],'inputText':this[_0xbb08('0x27')][_0xbb08('0x1a')],'userId':this[_0xbb08('0x12')]+':'+this[_0xbb08('0xa')]['id'][_0xbb08('0x28')]()};_0x247c0d[_0xbb08('0x29')](_0x545ea8,function(_0x1de8f3,_0x406812){if(_0x1de8f3){logger[_0xbb08('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x42ab85,_0x1de8f3[_0xbb08('0x27')]);_0x46e854['next']();}else if(_0x406812&&_0x406812[_0xbb08('0x27')]){_0x2f6a75['body'][_0xbb08('0x2a')]=_0x406812;_0x2e0d65['body']=_0x406812[_0xbb08('0x27')];_0x2e0d65[_0xbb08('0x2b')]=_0xbb08('0x2a');_0x2e0d65[_0xbb08('0x2c')]=JSON[_0xbb08('0x20')](_0x406812);return rpc[_0x8bc31+_0xbb08('0x1b')][_0xbb08('0x1c')](_0x2e0d65)[_0xbb08('0x1d')](function(_0x4a3092){logger[_0xbb08('0xc')](_0xbb08('0xd'),_0x42ab85,_0x2e0d65['body']);if(_0x406812[_0xbb08('0x2d')]==_0xbb08('0x2e')){_0x46e854[_0xbb08('0x2f')]();}else{_0x46e854['stop']();}})[_0xbb08('0x1e')](function(_0x5d147d){logger[_0xbb08('0x1f')](_0xbb08('0xd'),_0x42ab85,JSON[_0xbb08('0x20')](_0x5d147d));_0x46e854[_0xbb08('0x2f')]();});}else{_0x46e854['next']();}});}}catch(_0x3873cc){logger[_0xbb08('0x1f')](_0xbb08('0xd'),_0x42ab85,JSON[_0xbb08('0x20')](_0x3873cc));_0x46e854[_0xbb08('0x24')]();}};};
\ No newline at end of file
+var _0x4f59=['../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','created','isEmpty','body','create','then','error','[%s][AMAZONLEX]\x20%s','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','toString','amazonlex','providerName','providerResponse','dialogState','catch','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage'];(function(_0x53860c,_0x4e3d4e){var _0x4bc4ec=function(_0x535006){while(--_0x535006){_0x53860c['push'](_0x53860c['shift']());}};_0x4bc4ec(++_0x4e3d4e);}(_0x4f59,0x118));var _0x94f5=function(_0x3a0863,_0x4cd5ef){_0x3a0863=_0x3a0863-0x0;var _0x85c557=_0x4f59[_0x3a0863];return _0x85c557;};'use strict';var _=require(_0x94f5('0x0'));var moment=require(_0x94f5('0x1'));var AWS=require(_0x94f5('0x2'));var utils=require(_0x94f5('0x3'));var logger=require(_0x94f5('0x4'))(_0x94f5('0x5'));var rpc={'chatMessage':require(_0x94f5('0x6')),'openchannelMessage':require(_0x94f5('0x7')),'mailMessage':require(_0x94f5('0x8')),'smsMessage':require(_0x94f5('0x9')),'faxMessage':require(_0x94f5('0xa')),'whatsappMessage':require(_0x94f5('0xb'))};exports[_0x94f5('0xc')]=function(_0x175bd4,_0x413242){return function(_0x337c00){try{if(!_[_0x94f5('0xd')](this[_0x94f5('0xe')]['UserId'])){logger[_0x94f5('0xf')]('[%s][AMAZONLEX]\x20%s',_0x175bd4,_0x94f5('0x10'));return _0x337c00[_0x94f5('0x11')]();}var _0x407119={'ContactId':this[_0x94f5('0x12')]['id'],'sentAt':moment()[_0x94f5('0x13')](_0x94f5('0x14')),'direction':_0x94f5('0x15')};if(this['channel']===_0x94f5('0x16')||this[_0x94f5('0x17')]===_0x94f5('0x18')){_0x407119['phone']=this[_0x94f5('0xe')][_0x94f5('0x19')];}var _0x4eb733=this[_0x94f5('0x17')];if(_0x4eb733===_0x94f5('0x1a')){_0x407119[_0x94f5('0x1b')]=this[_0x94f5('0x1c')]['id'];}else{_0x407119[_['upperFirst'](_0x4eb733)+_0x94f5('0x1d')]=this[_0x94f5('0x1c')]['id'];}_0x407119[_['upperFirst'](_0x4eb733)+'InteractionId']=this[_0x94f5('0xe')]['id'];if(this[_0x94f5('0xe')][_0x94f5('0x1e')]){var _0x591d0f=_0x413242[0x4];if(!_[_0x94f5('0x1f')](_0x591d0f)){_0x407119[_0x94f5('0x20')]=utils['getMustacheRender'](_0x591d0f,this);return rpc[_0x4eb733+'Message'][_0x94f5('0x21')](_0x407119)[_0x94f5('0x22')](function(_0x378939){logger[_0x94f5('0xf')]('[%s][AMAZONLEX]\x20%s',_0x175bd4,_0x407119['body']);})['catch'](function(_0x1199d0){logger[_0x94f5('0x23')](_0x94f5('0x24'),_0x175bd4,JSON[_0x94f5('0x25')](_0x1199d0));})[_0x94f5('0x26')](function(){logger['info'](_0x94f5('0x27'),_0x175bd4);_0x337c00[_0x94f5('0x28')]();});}else{logger[_0x94f5('0xf')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x175bd4);_0x337c00['stop']();}}else{var _0x10f207=this;var _0xd85d8c=new AWS['LexRuntime']({'accessKeyId':_0x413242[0x0],'secretAccessKey':_0x413242[0x1],'region':_0x413242[0x2]});var _0x280ee5={'botAlias':'$LATEST','botName':_0x413242[0x3],'inputText':this[_0x94f5('0x29')][_0x94f5('0x20')],'userId':this[_0x94f5('0x17')]+':'+this[_0x94f5('0xe')]['id'][_0x94f5('0x2a')]()};_0xd85d8c['postText'](_0x280ee5,function(_0x1af523,_0xaf7dd2){if(_0x1af523){logger[_0x94f5('0x23')]('[%s][AMAZONLEX]\x20%s',_0x175bd4,_0x1af523[_0x94f5('0x29')]);_0x337c00[_0x94f5('0x11')]();}else if(_0xaf7dd2&&_0xaf7dd2[_0x94f5('0x29')]){_0x10f207[_0x94f5('0x20')][_0x94f5('0x2b')]=_0xaf7dd2;_0x407119[_0x94f5('0x20')]=_0xaf7dd2[_0x94f5('0x29')];_0x407119[_0x94f5('0x2c')]='amazonlex';_0x407119[_0x94f5('0x2d')]=JSON[_0x94f5('0x25')](_0xaf7dd2);return rpc[_0x4eb733+'Message'][_0x94f5('0x21')](_0x407119)[_0x94f5('0x22')](function(_0x1ec31f){logger[_0x94f5('0xf')](_0x94f5('0x24'),_0x175bd4,_0x407119[_0x94f5('0x20')]);if(_0xaf7dd2[_0x94f5('0x2e')]=='Failed'){_0x337c00[_0x94f5('0x11')]();}else{_0x337c00[_0x94f5('0x28')]();}})[_0x94f5('0x2f')](function(_0x843bee){logger['error'](_0x94f5('0x24'),_0x175bd4,JSON['stringify'](_0x843bee));_0x337c00[_0x94f5('0x11')]();});}else{_0x337c00[_0x94f5('0x11')]();}});}}catch(_0x31e46c){logger[_0x94f5('0x23')](_0x94f5('0x24'),_0x175bd4,JSON['stringify'](_0x31e46c));_0x337c00[_0x94f5('0x28')]();}};};
\ No newline at end of file
index 31a3353..6411681 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a05=['ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','</div>','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','messageId','create','then','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','resolve','Interaction','update','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','mail','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','out','body','getMustacheRender','message','from','channel','phone','read','subject','startsWith','Re:','Re:\x20','chat'];(function(_0x12bd95,_0x5e847a){var _0x3f6295=function(_0x1b6408){while(--_0x1b6408){_0x12bd95['push'](_0x12bd95['shift']());}};_0x3f6295(++_0x5e847a);}(_0x5a05,0xf6));var _0x55a0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5a05[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x55a0('0x0'));var moment=require(_0x55a0('0x1'));var utils=require(_0x55a0('0x2'));var logger=require(_0x55a0('0x3'))(_0x55a0('0x4'));var rpc={'chatMessage':require(_0x55a0('0x5')),'openchannelMessage':require(_0x55a0('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x55a0('0x7')),'whatsappMessage':require(_0x55a0('0x8')),'chatInteraction':require(_0x55a0('0x9')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x55a0('0xa')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x55a0('0xb'))};var mailRpc=require(_0x55a0('0xc'));exports[_0x55a0('0xd')]=function(_0x354051,_0x2f0c9d,_0x4dae1c,_0x34e5ab){return function(_0x4155ca){try{var _0x409c4e=this['channel'];if(_0x409c4e===_0x55a0('0xe')&&_0x34e5ab['body'][_0x55a0('0xf')]){logger[_0x55a0('0x10')](_0x55a0('0x11'),_0x354051,_0x55a0('0x12'));return _0x4155ca[_0x55a0('0x13')]();}if(_0x2f0c9d[0x0]==='1'&&(_[_0x55a0('0x14')](this[_0x55a0('0x15')][_0x55a0('0x16')])||!this[_0x55a0('0x15')]['created'])){logger[_0x55a0('0x10')](_0x55a0('0x11'),_0x354051,_0x55a0('0x17'));return _0x4155ca[_0x55a0('0x13')]();}if(_0x2f0c9d[0x0]==='2'&&this[_0x55a0('0x15')][_0x55a0('0x18')]){logger['info'](_0x55a0('0x19'),_0x354051,_0x55a0('0x1a'));return _0x4155ca[_0x55a0('0x13')]();}var _0xc121f0={'ContactId':this['contact']['id'],'sentAt':moment()[_0x55a0('0x1b')](_0x55a0('0x1c')),'direction':_0x55a0('0x1d')};if(this['channel']===_0x55a0('0xe')){_0xc121f0[_0x55a0('0x1e')]=utils[_0x55a0('0x1f')](_0x2f0c9d[0x2],this);}else{_0xc121f0[_0x55a0('0x1e')]=utils['getMustacheRender'](_0x2f0c9d[0x1],this);}if(this['message']){_0xc121f0['to']=this[_0x55a0('0x20')][_0x55a0('0x21')]||'';if(this[_0x55a0('0x22')]===_0x55a0('0xe')&&_0x2f0c9d[0x1]==='1'){_0xc121f0['cc']=this[_0x55a0('0x20')]['cc']||'';}_0xc121f0[_0x55a0('0x21')]=this[_0x55a0('0x20')]['to']||'';_0xc121f0['phone']=this['message'][_0x55a0('0x23')]||'';_0xc121f0[_0x55a0('0x24')]=!![];if(this[_0x55a0('0x20')][_0x55a0('0x25')]){_0xc121f0[_0x55a0('0x25')]='';_0xc121f0[_0x55a0('0x25')]+=_[_0x55a0('0x26')](this[_0x55a0('0x20')][_0x55a0('0x25')],_0x55a0('0x27'))?'':_0x55a0('0x28');_0xc121f0[_0x55a0('0x25')]+=this['message']['subject'];}}if(this[_0x55a0('0x22')]===_0x55a0('0x29')){_0xc121f0[_0x55a0('0x2a')]=this[_0x55a0('0x2b')]['id'];}else{_0xc121f0[_[_0x55a0('0x2c')](this[_0x55a0('0x22')])+_0x55a0('0x2d')]=this['account']['id'];}_0xc121f0[_[_0x55a0('0x2c')](this[_0x55a0('0x22')])+_0x55a0('0x2e')]=this[_0x55a0('0x15')]['id'];var _0x187b84=this[_0x55a0('0x15')];if(rpc[this[_0x55a0('0x22')]+_0x55a0('0x2f')]){if(this[_0x55a0('0x22')]===_0x55a0('0xe')){_0xc121f0[_0x55a0('0x30')]=this[_0x55a0('0x20')]['messageId'];_0xc121f0[_0x55a0('0x31')]=_0x55a0('0x32')+_[_0x55a0('0x33')](_0xc121f0[_0x55a0('0x1e')],_0x55a0('0x34'),'<div')+_0x55a0('0x35');_0xc121f0['headers']={'Auto-Submitted':_0x55a0('0x36'),'X-Auto-Response-Suppress':_0x55a0('0x37'),'Precedence':_0x55a0('0x38')};return mailRpc[_0x55a0('0x39')](this[_0x55a0('0x2b')][_0x55a0('0x3a')],_0xc121f0)['then'](function(_0x31eb7c){logger['info']('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x354051);_0xc121f0['messageId']=_0x31eb7c[_0x55a0('0x20')][_0x55a0('0x3b')];return rpc[_0x409c4e+_0x55a0('0x2f')][_0x55a0('0x3c')](_0xc121f0);})[_0x55a0('0x3d')](function(_0x58dc5d){logger[_0x55a0('0x10')](_0x55a0('0x11'),_0x354051,JSON['stringify'](_0x58dc5d));})['catch'](function(_0x2373e0){logger[_0x55a0('0x3e')](_0x55a0('0x3f'),_0x354051,JSON[_0x55a0('0x40')](_0x2373e0));})[_0x55a0('0x41')](function(){Promise[_0x55a0('0x42')]()['then'](function(){if(_0x2f0c9d[0x0]!=='2'||_0x187b84['autoreplyExecuted'])return;return rpc[_0x409c4e+_0x55a0('0x43')][_0x55a0('0x44')](_0x187b84['id'],{'autoreplyExecuted':!![]})[_0x55a0('0x3d')](function(_0x186218){logger[_0x55a0('0x10')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x354051,JSON['stringify'](_0x186218));})[_0x55a0('0x45')](function(_0x5c86a5){logger[_0x55a0('0x3e')](_0x55a0('0x46'),_0x354051,JSON[_0x55a0('0x40')](_0x5c86a5));});})[_0x55a0('0x3d')](function(){_0x4155ca[_0x55a0('0x13')]();});});}else{return rpc[this[_0x55a0('0x22')]+_0x55a0('0x2f')][_0x55a0('0x3c')](_0xc121f0)[_0x55a0('0x3d')](function(){logger[_0x55a0('0x10')](_0x55a0('0x11'),_0x354051,_0xc121f0[_0x55a0('0x1e')]);})[_0x55a0('0x45')](function(_0x5a7d60){logger[_0x55a0('0x3e')](_0x55a0('0x11'),_0x354051,JSON[_0x55a0('0x40')](_0x5a7d60));})[_0x55a0('0x41')](function(){Promise[_0x55a0('0x42')]()['then'](function(){if(_0x2f0c9d[0x0]!=='2'||_0x187b84['autoreplyExecuted'])return;return rpc[_0x409c4e+'Interaction'][_0x55a0('0x44')](_0x187b84['id'],{'autoreplyExecuted':!![]})[_0x55a0('0x3d')](function(_0x203053){logger['info'](_0x55a0('0x19'),_0x354051,JSON[_0x55a0('0x40')](_0x203053));})[_0x55a0('0x45')](function(_0xba0bf3){logger[_0x55a0('0x3e')](_0x55a0('0x46'),_0x354051,JSON['stringify'](_0xba0bf3));});})[_0x55a0('0x3d')](function(){_0x4155ca[_0x55a0('0x13')]();});});}}}catch(_0xe09adc){logger['error'](_0x55a0('0x11'),_0x354051,JSON[_0x55a0('0x40')](_0xe09adc));_0x4155ca[_0x55a0('0x47')]();}};};
\ No newline at end of file
+var _0xbff2=['../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','next','isNil','created','info','[%s][AUTOREPLY]\x20%s','interaction','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','out','getMustacheRender','message','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','Message','inReplyTo','messageId','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','<div','headers','All','auto_reply','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','update','error','finally','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage'];(function(_0x245327,_0x2bbe5f){var _0x4d441c=function(_0x281a13){while(--_0x281a13){_0x245327['push'](_0x245327['shift']());}};_0x4d441c(++_0x2bbe5f);}(_0xbff2,0x7e));var _0x2bff=function(_0x15f872,_0x4b7477){_0x15f872=_0x15f872-0x0;var _0x4673d6=_0xbff2[_0x15f872];return _0x4673d6;};'use strict';var _=require(_0x2bff('0x0'));var moment=require(_0x2bff('0x1'));var utils=require('./utils');var logger=require(_0x2bff('0x2'))(_0x2bff('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x2bff('0x4')),'mailMessage':require(_0x2bff('0x5')),'smsMessage':require(_0x2bff('0x6')),'faxMessage':require(_0x2bff('0x7')),'whatsappMessage':require(_0x2bff('0x8')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0x2bff('0x9')),'whatsappInteraction':require(_0x2bff('0xa'))};var mailRpc=require(_0x2bff('0xb'));exports[_0x2bff('0xc')]=function(_0x49dac4,_0x177cdc,_0x86aac9,_0x24cdc3){return function(_0x5b0aec){try{var _0x5b637c=this[_0x2bff('0xd')];if(_0x5b637c===_0x2bff('0xe')&&_0x24cdc3[_0x2bff('0xf')][_0x2bff('0x10')]){logger['info']('[%s][AUTOREPLY]\x20%s',_0x49dac4,'Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)');return _0x5b0aec[_0x2bff('0x11')]();}if(_0x177cdc[0x0]==='1'&&(_[_0x2bff('0x12')](this['interaction'][_0x2bff('0x13')])||!this['interaction'][_0x2bff('0x13')])){logger[_0x2bff('0x14')](_0x2bff('0x15'),_0x49dac4,'Autoreply\x20already\x20sent');return _0x5b0aec[_0x2bff('0x11')]();}if(_0x177cdc[0x0]==='2'&&this[_0x2bff('0x16')][_0x2bff('0x17')]){logger[_0x2bff('0x14')](_0x2bff('0x18'),_0x49dac4,_0x2bff('0x19'));return _0x5b0aec[_0x2bff('0x11')]();}var _0x1e34d6={'ContactId':this[_0x2bff('0x1a')]['id'],'sentAt':moment()[_0x2bff('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x2bff('0x1c')};if(this[_0x2bff('0xd')]===_0x2bff('0xe')){_0x1e34d6[_0x2bff('0xf')]=utils[_0x2bff('0x1d')](_0x177cdc[0x2],this);}else{_0x1e34d6[_0x2bff('0xf')]=utils[_0x2bff('0x1d')](_0x177cdc[0x1],this);}if(this[_0x2bff('0x1e')]){_0x1e34d6['to']=this[_0x2bff('0x1e')]['from']||'';if(this[_0x2bff('0xd')]===_0x2bff('0xe')&&_0x177cdc[0x1]==='1'){_0x1e34d6['cc']=this[_0x2bff('0x1e')]['cc']||'';}_0x1e34d6['from']=this[_0x2bff('0x1e')]['to']||'';_0x1e34d6[_0x2bff('0x1f')]=this[_0x2bff('0x1e')][_0x2bff('0x1f')]||'';_0x1e34d6[_0x2bff('0x20')]=!![];if(this[_0x2bff('0x1e')][_0x2bff('0x21')]){_0x1e34d6['subject']='';_0x1e34d6['subject']+=_[_0x2bff('0x22')](this[_0x2bff('0x1e')][_0x2bff('0x21')],_0x2bff('0x23'))?'':_0x2bff('0x24');_0x1e34d6[_0x2bff('0x21')]+=this[_0x2bff('0x1e')]['subject'];}}if(this['channel']===_0x2bff('0x25')){_0x1e34d6[_0x2bff('0x26')]=this[_0x2bff('0x27')]['id'];}else{_0x1e34d6[_[_0x2bff('0x28')](this['channel'])+_0x2bff('0x29')]=this[_0x2bff('0x27')]['id'];}_0x1e34d6[_[_0x2bff('0x28')](this[_0x2bff('0xd')])+'InteractionId']=this[_0x2bff('0x16')]['id'];var _0x421d51=this[_0x2bff('0x16')];if(rpc[this[_0x2bff('0xd')]+_0x2bff('0x2a')]){if(this[_0x2bff('0xd')]==='mail'){_0x1e34d6[_0x2bff('0x2b')]=this[_0x2bff('0x1e')][_0x2bff('0x2c')];_0x1e34d6['html']=_0x2bff('0x2d')+_[_0x2bff('0x2e')](_0x1e34d6[_0x2bff('0xf')],_0x2bff('0x2f'),_0x2bff('0x30'))+'</div>';_0x1e34d6[_0x2bff('0x31')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':_0x2bff('0x32'),'Precedence':_0x2bff('0x33')};return mailRpc['sendMailMessage'](this[_0x2bff('0x27')][_0x2bff('0x34')],_0x1e34d6)[_0x2bff('0x35')](function(_0x207900){logger[_0x2bff('0x14')](_0x2bff('0x36'),_0x49dac4);_0x1e34d6['messageId']=_0x207900[_0x2bff('0x1e')][_0x2bff('0x2c')];return rpc[_0x5b637c+_0x2bff('0x2a')][_0x2bff('0x37')](_0x1e34d6);})['then'](function(_0x44df4d){logger['info']('[%s][AUTOREPLY]\x20%s',_0x49dac4,JSON[_0x2bff('0x38')](_0x44df4d));})[_0x2bff('0x39')](function(_0x317028){logger['error'](_0x2bff('0x3a'),_0x49dac4,JSON[_0x2bff('0x38')](_0x317028));})['finally'](function(){Promise[_0x2bff('0x3b')]()[_0x2bff('0x35')](function(){if(_0x177cdc[0x0]!=='2'||_0x421d51[_0x2bff('0x17')])return;return rpc[_0x5b637c+_0x2bff('0x3c')][_0x2bff('0x3d')](_0x421d51['id'],{'autoreplyExecuted':!![]})[_0x2bff('0x35')](function(_0xa217b5){logger['info'](_0x2bff('0x18'),_0x49dac4,JSON[_0x2bff('0x38')](_0xa217b5));})[_0x2bff('0x39')](function(_0x357057){logger[_0x2bff('0x3e')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x49dac4,JSON[_0x2bff('0x38')](_0x357057));});})[_0x2bff('0x35')](function(){_0x5b0aec[_0x2bff('0x11')]();});});}else{return rpc[this['channel']+_0x2bff('0x2a')][_0x2bff('0x37')](_0x1e34d6)[_0x2bff('0x35')](function(){logger[_0x2bff('0x14')]('[%s][AUTOREPLY]\x20%s',_0x49dac4,_0x1e34d6[_0x2bff('0xf')]);})['catch'](function(_0x5e5eaa){logger[_0x2bff('0x3e')](_0x2bff('0x15'),_0x49dac4,JSON['stringify'](_0x5e5eaa));})[_0x2bff('0x3f')](function(){Promise['resolve']()[_0x2bff('0x35')](function(){if(_0x177cdc[0x0]!=='2'||_0x421d51[_0x2bff('0x17')])return;return rpc[_0x5b637c+_0x2bff('0x3c')]['update'](_0x421d51['id'],{'autoreplyExecuted':!![]})['then'](function(_0xc0774f){logger['info'](_0x2bff('0x18'),_0x49dac4,JSON[_0x2bff('0x38')](_0xc0774f));})[_0x2bff('0x39')](function(_0x4db0f9){logger[_0x2bff('0x3e')](_0x2bff('0x40'),_0x49dac4,JSON[_0x2bff('0x38')](_0x4db0f9));});})[_0x2bff('0x35')](function(){_0x5b0aec[_0x2bff('0x11')]();});});}}}catch(_0x472d72){logger[_0x2bff('0x3e')](_0x2bff('0x15'),_0x49dac4,JSON['stringify'](_0x472d72));_0x5b0aec[_0x2bff('0x41')]();}};};
\ No newline at end of file
index b130c3f..8ff6590 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a97=['update','interaction','then','catch','[%s][CLOSE]\x20%s','stringify','finally','stop','error','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','system','channel','Interaction'];(function(_0x142ccc,_0x120991){var _0x14232b=function(_0x2a79bb){while(--_0x2a79bb){_0x142ccc['push'](_0x142ccc['shift']());}};_0x14232b(++_0x120991);}(_0x9a97,0x179));var _0x79a9=function(_0x268753,_0xf502da){_0x268753=_0x268753-0x0;var _0x2d9c4f=_0x9a97[_0x268753];return _0x2d9c4f;};'use strict';var moment=require(_0x79a9('0x0'));var logger=require(_0x79a9('0x1'))(_0x79a9('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x79a9('0x3')),'smsInteraction':require(_0x79a9('0x4')),'mailInteraction':require(_0x79a9('0x5')),'faxInteraction':require(_0x79a9('0x6')),'whatsappInteraction':require(_0x79a9('0x7'))};exports['consequence']=function(_0x107ddc,_0x97638f,_0x26808a,_0x57265e){return function(_0x1cb5fb){try{logger[_0x79a9('0x8')](_0x79a9('0x9'),_0x107ddc,_0x97638f[0x0]);var _0x5daedb={'closed':0x1,'closedAt':moment()[_0x79a9('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0x79a9('0xb'),'disposition':_0x97638f[0x0]};if(rpc[_0x57265e[_0x79a9('0xc')]+_0x79a9('0xd')]){rpc[_0x57265e['channel']+'Interaction'][_0x79a9('0xe')](_0x57265e[_0x79a9('0xf')]['id'],_0x5daedb)[_0x79a9('0x10')](function(_0x130618){logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x107ddc,_0x57265e[_0x79a9('0xf')]['id']);})[_0x79a9('0x11')](function(_0x3d4cad){logger['error'](_0x79a9('0x12'),_0x107ddc,JSON[_0x79a9('0x13')](_0x3d4cad));})[_0x79a9('0x14')](function(){_0x1cb5fb[_0x79a9('0x15')]();});}}catch(_0x145c57){logger[_0x79a9('0x16')](_0x79a9('0x12'),_0x107ddc,JSON[_0x79a9('0x13')](_0x145c57));_0x1cb5fb[_0x79a9('0x15')]();}};};
\ No newline at end of file
+var _0xbf08=['YYYY-MM-DD\x20HH:mm:ss','system','Interaction','update','interaction','then','catch','[%s][CLOSE]\x20%s','stringify','stop','moment','routing','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf08,0xe6));var _0x8bf0=function(_0x4d2079,_0x4a3307){_0x4d2079=_0x4d2079-0x0;var _0x4a31fd=_0xbf08[_0x4d2079];return _0x4a31fd;};'use strict';var moment=require(_0x8bf0('0x0'));var logger=require('../../../../config/logger')(_0x8bf0('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x8bf0('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x8bf0('0x3')),'faxInteraction':require(_0x8bf0('0x4')),'whatsappInteraction':require(_0x8bf0('0x5'))};exports[_0x8bf0('0x6')]=function(_0x50ca34,_0x395c26,_0x2ad77d,_0x32c8e2){return function(_0x25beff){try{logger[_0x8bf0('0x7')](_0x8bf0('0x8'),_0x50ca34,_0x395c26[0x0]);var _0x5ef460={'closed':0x1,'closedAt':moment()[_0x8bf0('0x9')](_0x8bf0('0xa')),'closeReason':_0x8bf0('0xb'),'disposition':_0x395c26[0x0]};if(rpc[_0x32c8e2['channel']+_0x8bf0('0xc')]){rpc[_0x32c8e2['channel']+'Interaction'][_0x8bf0('0xd')](_0x32c8e2[_0x8bf0('0xe')]['id'],_0x5ef460)[_0x8bf0('0xf')](function(_0x2033de){logger[_0x8bf0('0x7')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x50ca34,_0x32c8e2[_0x8bf0('0xe')]['id']);})[_0x8bf0('0x10')](function(_0xd64caf){logger['error'](_0x8bf0('0x11'),_0x50ca34,JSON[_0x8bf0('0x12')](_0xd64caf));})['finally'](function(){_0x25beff[_0x8bf0('0x13')]();});}}catch(_0x459ea6){logger['error']('[%s][CLOSE]\x20%s',_0x50ca34,JSON['stringify'](_0x459ea6));_0x25beff['stop']();}};};
\ No newline at end of file
index a297c28..81ad03c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62f1=['info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','body','getMustacheRender','Message','create','then','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','providerName','providerResponse','catch','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction'];(function(_0x77fbf8,_0x31cf3f){var _0x2df250=function(_0x24b65f){while(--_0x24b65f){_0x77fbf8['push'](_0x77fbf8['shift']());}};_0x2df250(++_0x31cf3f);}(_0x62f1,0x112));var _0x162f=function(_0x22e877,_0x264861){_0x22e877=_0x22e877-0x0;var _0x5ae1bf=_0x62f1[_0x22e877];return _0x5ae1bf;};'use strict';var _=require(_0x162f('0x0'));var moment=require('moment');var apiai=require(_0x162f('0x1'));var md5=require(_0x162f('0x2'));var utils=require(_0x162f('0x3'));var logger=require(_0x162f('0x4'))(_0x162f('0x5'));var rpc={'chatMessage':require(_0x162f('0x6')),'openchannelMessage':require(_0x162f('0x7')),'mailMessage':require(_0x162f('0x8')),'smsMessage':require(_0x162f('0x9')),'faxMessage':require(_0x162f('0xa')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x162f('0xb')]=function(_0x2e763a,_0x593029){return function(_0x2b0c29){try{if(!_[_0x162f('0xc')](this[_0x162f('0xd')]['UserId'])){logger[_0x162f('0xe')](_0x162f('0xf'),_0x2e763a,_0x162f('0x10'));return _0x2b0c29[_0x162f('0x11')]();}var _0x54c970={'ContactId':this[_0x162f('0x12')]['id'],'sentAt':moment()[_0x162f('0x13')](_0x162f('0x14')),'direction':'out'};if(this['channel']==='sms'||this[_0x162f('0x15')]==='whatsapp'){_0x54c970[_0x162f('0x16')]=this[_0x162f('0xd')][_0x162f('0x16')];}var _0x2ed995=this['channel'];if(_0x2ed995===_0x162f('0x17')){_0x54c970[_0x162f('0x18')]=this[_0x162f('0x19')]['id'];}else{_0x54c970[_[_0x162f('0x1a')](_0x2ed995)+'AccountId']=this[_0x162f('0x19')]['id'];}_0x54c970[_['upperFirst'](_0x2ed995)+_0x162f('0x1b')]=this[_0x162f('0xd')]['id'];if(this[_0x162f('0xd')][_0x162f('0x1c')]){var _0x55026b=_0x593029[0x2];if(!_['isEmpty'](_0x55026b)){_0x54c970[_0x162f('0x1d')]=utils[_0x162f('0x1e')](_0x55026b,this);return rpc[_0x2ed995+_0x162f('0x1f')][_0x162f('0x20')](_0x54c970)[_0x162f('0x21')](function(_0x750506){logger[_0x162f('0xe')]('[%s][DIALOGFLOW]\x20%s',_0x2e763a,_0x54c970[_0x162f('0x1d')]);})['catch'](function(_0x441259){logger[_0x162f('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x2e763a,JSON[_0x162f('0x23')](_0x441259));})[_0x162f('0x24')](function(){logger['info'](_0x162f('0x25'),_0x2e763a);_0x2b0c29[_0x162f('0x26')]();});}else{logger[_0x162f('0xe')](_0x162f('0x27'),_0x2e763a);_0x2b0c29['stop']();}}else{var _0xdab3e=this;var _0x246aff=apiai(_0x593029[0x0],{'language':_0x593029[0x1]||'en'});return _0x246aff[_0x162f('0x28')](this[_0x162f('0x29')][_0x162f('0x1d')],{'sessionId':md5(this[_0x162f('0xd')]['id'])})[_0x162f('0x21')](function(_0x331d0d){_0xdab3e['body'][_0x162f('0x2a')]=_0x331d0d;_0x54c970[_0x162f('0x1d')]=_0x331d0d[_0x162f('0x2b')][_0x162f('0x2c')]['speech'];_0x54c970[_0x162f('0x2d')]='dialogflow';_0x54c970[_0x162f('0x2e')]=JSON['stringify'](_0x331d0d);return rpc[_0x2ed995+_0x162f('0x1f')]['create'](_0x54c970)[_0x162f('0x21')](function(_0x567175){logger[_0x162f('0xe')](_0x162f('0xf'),_0x2e763a,_0x54c970[_0x162f('0x1d')]);if(_0x331d0d['result']['metadata']['endConversation']){_0x2b0c29['next']();}else{_0x2b0c29[_0x162f('0x26')]();}})[_0x162f('0x2f')](function(_0x4c4049){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x2e763a,JSON[_0x162f('0x23')](_0x4c4049));_0x2b0c29['next']();});})[_0x162f('0x2f')](function(_0x1f1c3b){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x2e763a,_0x1f1c3b[_0x162f('0x29')]);_0x2b0c29[_0x162f('0x11')]();});}}catch(_0x34de4d){logger['error'](_0x162f('0xf'),_0x2e763a,JSON[_0x162f('0x23')](_0x34de4d));_0x2b0c29[_0x162f('0x26')]();}};};
\ No newline at end of file
+var _0x4e47=['then','catch','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','result','fulfillment','providerName','providerResponse','endConversation','error','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','created','isEmpty','body','getMustacheRender','Message','create'];(function(_0x2d982d,_0x121028){var _0x4f36b0=function(_0x11f3a9){while(--_0x11f3a9){_0x2d982d['push'](_0x2d982d['shift']());}};_0x4f36b0(++_0x121028);}(_0x4e47,0x17f));var _0x74e4=function(_0x549256,_0x311500){_0x549256=_0x549256-0x0;var _0x334fb0=_0x4e47[_0x549256];return _0x334fb0;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require(_0x74e4('0x0'));var md5=require(_0x74e4('0x1'));var utils=require(_0x74e4('0x2'));var logger=require(_0x74e4('0x3'))(_0x74e4('0x4'));var rpc={'chatMessage':require(_0x74e4('0x5')),'openchannelMessage':require(_0x74e4('0x6')),'mailMessage':require(_0x74e4('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x74e4('0x8')),'whatsappMessage':require(_0x74e4('0x9'))};exports['consequence']=function(_0x15f9e1,_0x6166e1){return function(_0x2f6f88){try{if(!_[_0x74e4('0xa')](this[_0x74e4('0xb')]['UserId'])){logger[_0x74e4('0xc')](_0x74e4('0xd'),_0x15f9e1,_0x74e4('0xe'));return _0x2f6f88[_0x74e4('0xf')]();}var _0xf13e3a={'ContactId':this['contact']['id'],'sentAt':moment()[_0x74e4('0x10')](_0x74e4('0x11')),'direction':'out'};if(this[_0x74e4('0x12')]==='sms'||this[_0x74e4('0x12')]===_0x74e4('0x13')){_0xf13e3a[_0x74e4('0x14')]=this[_0x74e4('0xb')][_0x74e4('0x14')];}var _0x3aac88=this[_0x74e4('0x12')];if(_0x3aac88===_0x74e4('0x15')){_0xf13e3a[_0x74e4('0x16')]=this[_0x74e4('0x17')]['id'];}else{_0xf13e3a[_[_0x74e4('0x18')](_0x3aac88)+'AccountId']=this['account']['id'];}_0xf13e3a[_['upperFirst'](_0x3aac88)+'InteractionId']=this[_0x74e4('0xb')]['id'];if(this[_0x74e4('0xb')][_0x74e4('0x19')]){var _0x565321=_0x6166e1[0x2];if(!_[_0x74e4('0x1a')](_0x565321)){_0xf13e3a[_0x74e4('0x1b')]=utils[_0x74e4('0x1c')](_0x565321,this);return rpc[_0x3aac88+_0x74e4('0x1d')][_0x74e4('0x1e')](_0xf13e3a)[_0x74e4('0x1f')](function(_0x330a4f){logger[_0x74e4('0xc')]('[%s][DIALOGFLOW]\x20%s',_0x15f9e1,_0xf13e3a[_0x74e4('0x1b')]);})[_0x74e4('0x20')](function(_0x4d837f){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x15f9e1,JSON[_0x74e4('0x21')](_0x4d837f));})[_0x74e4('0x22')](function(){logger[_0x74e4('0xc')](_0x74e4('0x23'),_0x15f9e1);_0x2f6f88[_0x74e4('0x24')]();});}else{logger[_0x74e4('0xc')](_0x74e4('0x25'),_0x15f9e1);_0x2f6f88[_0x74e4('0x24')]();}}else{var _0x2e991d=this;var _0x4c270f=apiai(_0x6166e1[0x0],{'language':_0x6166e1[0x1]||'en'});return _0x4c270f[_0x74e4('0x26')](this[_0x74e4('0x27')][_0x74e4('0x1b')],{'sessionId':md5(this['interaction']['id'])})[_0x74e4('0x1f')](function(_0x5b013a){_0x2e991d[_0x74e4('0x1b')]['dialogflow']=_0x5b013a;_0xf13e3a[_0x74e4('0x1b')]=_0x5b013a[_0x74e4('0x28')][_0x74e4('0x29')]['speech'];_0xf13e3a[_0x74e4('0x2a')]='dialogflow';_0xf13e3a[_0x74e4('0x2b')]=JSON[_0x74e4('0x21')](_0x5b013a);return rpc[_0x3aac88+_0x74e4('0x1d')][_0x74e4('0x1e')](_0xf13e3a)[_0x74e4('0x1f')](function(_0x59203d){logger[_0x74e4('0xc')](_0x74e4('0xd'),_0x15f9e1,_0xf13e3a[_0x74e4('0x1b')]);if(_0x5b013a[_0x74e4('0x28')]['metadata'][_0x74e4('0x2c')]){_0x2f6f88[_0x74e4('0xf')]();}else{_0x2f6f88[_0x74e4('0x24')]();}})[_0x74e4('0x20')](function(_0x268818){logger['error'](_0x74e4('0xd'),_0x15f9e1,JSON[_0x74e4('0x21')](_0x268818));_0x2f6f88[_0x74e4('0xf')]();});})[_0x74e4('0x20')](function(_0x2884ad){logger[_0x74e4('0x2d')](_0x74e4('0xd'),_0x15f9e1,_0x2884ad['message']);_0x2f6f88['next']();});}}catch(_0x144557){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x15f9e1,JSON[_0x74e4('0x21')](_0x144557));_0x2f6f88[_0x74e4('0x24')]();}};};
\ No newline at end of file
index c6b4e8a..691023d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97cd=['chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','getMustacheRender','error','finally','info','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','stringify','fulfillmentText','push','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','body','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','catch','consequence','isNil','interaction','next','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','phone'];(function(_0x11a220,_0x4e470a){var _0x20d8fe=function(_0xbedfd){while(--_0xbedfd){_0x11a220['push'](_0x11a220['shift']());}};_0x20d8fe(++_0x4e470a);}(_0x97cd,0x1e9));var _0xd97c=function(_0x17e3cf,_0x1103e1){_0x17e3cf=_0x17e3cf-0x0;var _0xfecb59=_0x97cd[_0x17e3cf];return _0xfecb59;};'use strict';var _=require(_0xd97c('0x0'));var dialogflow=require(_0xd97c('0x1'));var md5=require(_0xd97c('0x2'));var moment=require(_0xd97c('0x3'));var Promise=require(_0xd97c('0x4'));var logger=require(_0xd97c('0x5'))(_0xd97c('0x6'));var utils=require(_0xd97c('0x7'));var rpc={'chatMessage':require(_0xd97c('0x8')),'openchannelMessage':require(_0xd97c('0x9')),'mailMessage':require(_0xd97c('0xa')),'smsMessage':require(_0xd97c('0xb')),'faxMessage':require(_0xd97c('0xc')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x34695e,_0x32a493,_0x313c2f,_0x24f4ef){return new Promise(function(_0x286861,_0x389f28){var _0xb51cd0=_[_0xd97c('0xd')](_0x313c2f);_0xb51cd0[_0xd97c('0xe')]=_0x24f4ef;return rpc[_0x32a493+_0xd97c('0xf')][_0xd97c('0x10')](_0xb51cd0)[_0xd97c('0x11')](function(){logger['info'](_0xd97c('0x12'),_0x34695e,_0xb51cd0['body']);_0x286861();})[_0xd97c('0x13')](function(_0x13748f){logger['error'](_0xd97c('0x12'),_0x34695e,JSON['stringify'](_0x13748f));_0x389f28(_0x13748f);});});}exports[_0xd97c('0x14')]=function(_0x5e67e4,_0x5e7abc){return function(_0x532f06){try{if(!_[_0xd97c('0x15')](this[_0xd97c('0x16')]['UserId'])){logger['info'](_0xd97c('0x12'),_0x5e67e4,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x532f06[_0xd97c('0x17')]();}var _0x4b2d3c={'ContactId':this['contact']['id'],'sentAt':moment()[_0xd97c('0x18')](_0xd97c('0x19')),'direction':'out'};if(this[_0xd97c('0x1a')]===_0xd97c('0x1b')||this[_0xd97c('0x1a')]==='whatsapp'){_0x4b2d3c['phone']=this[_0xd97c('0x16')][_0xd97c('0x1c')];}var _0x48f70c=this[_0xd97c('0x1a')];if(_0x48f70c===_0xd97c('0x1d')){_0x4b2d3c[_0xd97c('0x1e')]=this[_0xd97c('0x1f')]['id'];}else{_0x4b2d3c[_[_0xd97c('0x20')](_0x48f70c)+_0xd97c('0x21')]=this[_0xd97c('0x1f')]['id'];}_0x4b2d3c[_[_0xd97c('0x20')](_0x48f70c)+_0xd97c('0x22')]=this[_0xd97c('0x16')]['id'];if(this[_0xd97c('0x16')][_0xd97c('0x23')]){var _0x1dddca=_0x5e7abc[0x4];if(!_[_0xd97c('0x24')](_0x1dddca)){_0x4b2d3c[_0xd97c('0xe')]=utils[_0xd97c('0x25')](_0x1dddca,this);return rpc[_0x48f70c+'Message'][_0xd97c('0x10')](_0x4b2d3c)['then'](function(_0x3e2086){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x5e67e4,_0x4b2d3c[_0xd97c('0xe')]);})['catch'](function(_0x51a91d){logger[_0xd97c('0x26')](_0xd97c('0x12'),_0x5e67e4,JSON['stringify'](_0x51a91d));})[_0xd97c('0x27')](function(){logger[_0xd97c('0x28')](_0xd97c('0x29'),_0x5e67e4);_0x532f06[_0xd97c('0x2a')]();});}else{logger[_0xd97c('0x28')](_0xd97c('0x2b'),_0x5e67e4);_0x532f06[_0xd97c('0x2a')]();}}else{var _0x595f51=this;var _0x53d13a=_0x5e7abc[0x2][_0xd97c('0x2c')](/\\n/g,'\x0a');var _0x26d8cc={'credentials':{'private_key':_0x53d13a,'client_email':_0x5e7abc[0x1]}};var _0x9bb8c=new dialogflow['SessionsClient'](_0x26d8cc);var _0x302b8b=_0x9bb8c[_0xd97c('0x2d')](_0x5e7abc[0x0],md5(_0x595f51[_0xd97c('0x16')]['id']));var _0x96a2d0={'session':_0x302b8b,'queryInput':{'text':{'text':_0x595f51[_0xd97c('0x2e')][_0xd97c('0xe')],'languageCode':_0x5e7abc[0x3]||'en'}}};return _0x9bb8c[_0xd97c('0x2f')](_0x96a2d0)['then'](function(_0x1344b6){if(_0x1344b6&&_0x1344b6[_0xd97c('0x30')]){_0x595f51[_0xd97c('0xe')][_0xd97c('0x31')]=_0x1344b6;var _0x2e71d3=_0x1344b6[0x0];var _0x5baa58=_0x2e71d3[_0xd97c('0x32')][_0xd97c('0x33')]&&_0x2e71d3['queryResult']['diagnosticInfo']['fields']?_0x2e71d3[_0xd97c('0x32')][_0xd97c('0x33')][_0xd97c('0x34')][_0xd97c('0x35')][_0xd97c('0x36')]:![];_0x595f51['body'][_0xd97c('0x37')]=_0x2e71d3['queryResult'][_0xd97c('0x38')];_0x595f51[_0xd97c('0xe')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x2e71d3[_0xd97c('0x32')][_0xd97c('0x39')];_0x595f51['body'][_0xd97c('0x3a')]=_0x2e71d3[_0xd97c('0x32')][_0xd97c('0x33')]&&_0x2e71d3[_0xd97c('0x32')][_0xd97c('0x33')]['fields']?_0x2e71d3[_0xd97c('0x32')][_0xd97c('0x33')]['fields'][_0xd97c('0x35')][_0xd97c('0x36')]:![];_0x595f51[_0xd97c('0xe')][_0xd97c('0x3b')]=_0x2e71d3[_0xd97c('0x32')][_0xd97c('0x3c')][_0xd97c('0x3d')];_0x595f51[_0xd97c('0xe')][_0xd97c('0x3e')]=_0x2e71d3[_0xd97c('0x32')][_0xd97c('0x3c')][_0xd97c('0x3f')];_0x595f51['body'][_0xd97c('0x40')]=_0x2e71d3[_0xd97c('0x32')][_0xd97c('0x3c')][_0xd97c('0x41')];_0x595f51[_0xd97c('0xe')]['DIALOGFLOWV2_LANGUAGECODE']=_0x2e71d3[_0xd97c('0x32')][_0xd97c('0x42')];_0x595f51[_0xd97c('0xe')]['DIALOGFLOWV2_QUERYTEXT']=_0x2e71d3['queryResult'][_0xd97c('0x43')];_0x595f51[_0xd97c('0xe')][_0xd97c('0x44')]=_0x2e71d3[_0xd97c('0x32')][_0xd97c('0x45')];_0x4b2d3c[_0xd97c('0x46')]=_0xd97c('0x31');_0x4b2d3c['providerResponse']=JSON[_0xd97c('0x47')](_0x1344b6);var _0x3611fa=[];for(var _0x3c0014=0x0;_0x3c0014<_0x1344b6[_0xd97c('0x30')];_0x3c0014++){var _0x4e4171=_0x1344b6[_0x3c0014];if(_0x4e4171&&_0x4e4171[_0xd97c('0x32')]&&_0x4e4171[_0xd97c('0x32')][_0xd97c('0x48')]){_0x3611fa[_0xd97c('0x49')](createMessage(_0x5e67e4,_0x48f70c,_0x4b2d3c,_0x4e4171['queryResult'][_0xd97c('0x48')]));}}return Promise['all'](_0x3611fa)[_0xd97c('0x11')](function(){if(_0x5baa58){_0x532f06[_0xd97c('0x17')]();}else{_0x532f06['stop']();}})[_0xd97c('0x13')](function(_0x419afd){logger[_0xd97c('0x26')]('[%s][DIALOGFLOWV2]\x20%s',_0x5e67e4,JSON['stringify'](_0x419afd));_0x532f06[_0xd97c('0x17')]();});}})['catch'](function(_0x1a2168){logger[_0xd97c('0x26')]('[%s][DIALOGFLOWV2]\x20%s',_0x5e67e4,_0x1a2168[_0xd97c('0x2e')]);_0x532f06[_0xd97c('0x17')]();});}}catch(_0x515f4a){logger[_0xd97c('0x26')](_0xd97c('0x12'),_0x5e67e4,JSON[_0xd97c('0x47')](_0x515f4a));_0x532f06[_0xd97c('0x2a')]();}};};
\ No newline at end of file
+var _0x40dd=['interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','getMustacheRender','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','SessionsClient','message','length','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','fulfillmentText','push','all','lodash','dialogflow','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','clone','Message','create','then','info','body','catch','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x40dd,0x18d));var _0xd40d=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x40dd[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xd40d('0x0'));var dialogflow=require(_0xd40d('0x1'));var md5=require('md5');var moment=require(_0xd40d('0x2'));var Promise=require(_0xd40d('0x3'));var logger=require(_0xd40d('0x4'))(_0xd40d('0x5'));var utils=require(_0xd40d('0x6'));var rpc={'chatMessage':require(_0xd40d('0x7')),'openchannelMessage':require(_0xd40d('0x8')),'mailMessage':require(_0xd40d('0x9')),'smsMessage':require(_0xd40d('0xa')),'faxMessage':require(_0xd40d('0xb')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x5158fd,_0x55d5f6,_0x5d5d56,_0x30bd25){return new Promise(function(_0x3d7e6e,_0x1b12b5){var _0x5f34db=_[_0xd40d('0xc')](_0x5d5d56);_0x5f34db['body']=_0x30bd25;return rpc[_0x55d5f6+_0xd40d('0xd')][_0xd40d('0xe')](_0x5f34db)[_0xd40d('0xf')](function(){logger[_0xd40d('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x5158fd,_0x5f34db[_0xd40d('0x11')]);_0x3d7e6e();})[_0xd40d('0x12')](function(_0x4230a2){logger['error'](_0xd40d('0x13'),_0x5158fd,JSON[_0xd40d('0x14')](_0x4230a2));_0x1b12b5(_0x4230a2);});});}exports[_0xd40d('0x15')]=function(_0x1fd09f,_0x4c6c14){return function(_0x60c8aa){try{if(!_[_0xd40d('0x16')](this[_0xd40d('0x17')][_0xd40d('0x18')])){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x1fd09f,_0xd40d('0x19'));return _0x60c8aa[_0xd40d('0x1a')]();}var _0x5713b4={'ContactId':this[_0xd40d('0x1b')]['id'],'sentAt':moment()[_0xd40d('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xd40d('0x1d')};if(this[_0xd40d('0x1e')]===_0xd40d('0x1f')||this[_0xd40d('0x1e')]===_0xd40d('0x20')){_0x5713b4[_0xd40d('0x21')]=this[_0xd40d('0x17')][_0xd40d('0x21')];}var _0x2eb82b=this[_0xd40d('0x1e')];if(_0x2eb82b===_0xd40d('0x22')){_0x5713b4['ChatWebsiteId']=this[_0xd40d('0x23')]['id'];}else{_0x5713b4[_[_0xd40d('0x24')](_0x2eb82b)+_0xd40d('0x25')]=this[_0xd40d('0x23')]['id'];}_0x5713b4[_['upperFirst'](_0x2eb82b)+_0xd40d('0x26')]=this['interaction']['id'];if(this[_0xd40d('0x17')][_0xd40d('0x27')]){var _0x1b8a96=_0x4c6c14[0x4];if(!_['isEmpty'](_0x1b8a96)){_0x5713b4[_0xd40d('0x11')]=utils[_0xd40d('0x28')](_0x1b8a96,this);return rpc[_0x2eb82b+'Message'][_0xd40d('0xe')](_0x5713b4)[_0xd40d('0xf')](function(_0x4cafd0){logger[_0xd40d('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x1fd09f,_0x5713b4[_0xd40d('0x11')]);})[_0xd40d('0x12')](function(_0x4be8b0){logger[_0xd40d('0x29')](_0xd40d('0x13'),_0x1fd09f,JSON[_0xd40d('0x14')](_0x4be8b0));})[_0xd40d('0x2a')](function(){logger[_0xd40d('0x10')](_0xd40d('0x2b'),_0x1fd09f);_0x60c8aa['stop']();});}else{logger[_0xd40d('0x10')](_0xd40d('0x2c'),_0x1fd09f);_0x60c8aa[_0xd40d('0x2d')]();}}else{var _0x12d773=this;var _0x8407ba=_0x4c6c14[0x2]['replace'](/\\n/g,'\x0a');var _0x895744={'credentials':{'private_key':_0x8407ba,'client_email':_0x4c6c14[0x1]}};var _0x34897e=new dialogflow[(_0xd40d('0x2e'))](_0x895744);var _0x870e53=_0x34897e['sessionPath'](_0x4c6c14[0x0],md5(_0x12d773[_0xd40d('0x17')]['id']));var _0x5519de={'session':_0x870e53,'queryInput':{'text':{'text':_0x12d773[_0xd40d('0x2f')]['body'],'languageCode':_0x4c6c14[0x3]||'en'}}};return _0x34897e['detectIntent'](_0x5519de)['then'](function(_0x3abe65){if(_0x3abe65&&_0x3abe65[_0xd40d('0x30')]){_0x12d773[_0xd40d('0x11')]['dialogflowV2']=_0x3abe65;var _0x5076f3=_0x3abe65[0x0];var _0x5207a4=_0x5076f3[_0xd40d('0x31')][_0xd40d('0x32')]&&_0x5076f3['queryResult']['diagnosticInfo'][_0xd40d('0x33')]?_0x5076f3[_0xd40d('0x31')]['diagnosticInfo'][_0xd40d('0x33')][_0xd40d('0x34')][_0xd40d('0x35')]:![];_0x12d773[_0xd40d('0x11')][_0xd40d('0x36')]=_0x5076f3[_0xd40d('0x31')][_0xd40d('0x37')];_0x12d773['body']['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x5076f3['queryResult']['allRequiredParamsPresent'];_0x12d773['body'][_0xd40d('0x38')]=_0x5076f3['queryResult']['diagnosticInfo']&&_0x5076f3[_0xd40d('0x31')][_0xd40d('0x32')][_0xd40d('0x33')]?_0x5076f3[_0xd40d('0x31')][_0xd40d('0x32')][_0xd40d('0x33')][_0xd40d('0x34')][_0xd40d('0x35')]:![];_0x12d773[_0xd40d('0x11')][_0xd40d('0x39')]=_0x5076f3[_0xd40d('0x31')]['intent'][_0xd40d('0x3a')];_0x12d773['body']['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x5076f3[_0xd40d('0x31')]['intent'][_0xd40d('0x3b')];_0x12d773[_0xd40d('0x11')][_0xd40d('0x3c')]=_0x5076f3[_0xd40d('0x31')]['intent']['isFallback'];_0x12d773[_0xd40d('0x11')][_0xd40d('0x3d')]=_0x5076f3[_0xd40d('0x31')]['languageCode'];_0x12d773['body']['DIALOGFLOWV2_QUERYTEXT']=_0x5076f3[_0xd40d('0x31')][_0xd40d('0x3e')];_0x12d773[_0xd40d('0x11')][_0xd40d('0x3f')]=_0x5076f3[_0xd40d('0x31')][_0xd40d('0x40')];_0x5713b4[_0xd40d('0x41')]=_0xd40d('0x42');_0x5713b4['providerResponse']=JSON[_0xd40d('0x14')](_0x3abe65);var _0x216a51=[];for(var _0x2b170c=0x0;_0x2b170c<_0x3abe65[_0xd40d('0x30')];_0x2b170c++){var _0x41dfe8=_0x3abe65[_0x2b170c];if(_0x41dfe8&&_0x41dfe8[_0xd40d('0x31')]&&_0x41dfe8[_0xd40d('0x31')][_0xd40d('0x43')]){_0x216a51[_0xd40d('0x44')](createMessage(_0x1fd09f,_0x2eb82b,_0x5713b4,_0x41dfe8[_0xd40d('0x31')][_0xd40d('0x43')]));}}return Promise[_0xd40d('0x45')](_0x216a51)[_0xd40d('0xf')](function(){if(_0x5207a4){_0x60c8aa['next']();}else{_0x60c8aa['stop']();}})['catch'](function(_0x4d7940){logger[_0xd40d('0x29')](_0xd40d('0x13'),_0x1fd09f,JSON[_0xd40d('0x14')](_0x4d7940));_0x60c8aa[_0xd40d('0x1a')]();});}})['catch'](function(_0x25fc57){logger['error'](_0xd40d('0x13'),_0x1fd09f,_0x25fc57[_0xd40d('0x2f')]);_0x60c8aa[_0xd40d('0x1a')]();});}}catch(_0x195c1d){logger[_0xd40d('0x29')]('[%s][DIALOGFLOWV2]\x20%s',_0x1fd09f,JSON[_0xd40d('0x14')](_0x195c1d));_0x60c8aa[_0xd40d('0x2d')]();}};};
\ No newline at end of file
index e261733..033fa2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3fa=['stringify','lodash','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','map','join','stop','condition','priorityTrue','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','error'];(function(_0x5223f0,_0x12c73c){var _0x55dd06=function(_0x4f8b1b){while(--_0x4f8b1b){_0x5223f0['push'](_0x5223f0['shift']());}};_0x55dd06(++_0x12c73c);}(_0xf3fa,0xf1));var _0xaf3f=function(_0xca54f9,_0x1d837b){_0xca54f9=_0xca54f9-0x0;var _0x183c63=_0xf3fa[_0xca54f9];return _0x183c63;};'use strict';var schema=require('validate');var _=require(_0xaf3f('0x0'));var htmlToText=require('html-to-text');var utils=require(_0xaf3f('0x1'));var logger=require(_0xaf3f('0x2'))(_0xaf3f('0x3'));var gotoif=schema({'condition':{'type':_0xaf3f('0x4'),'required':!![],'message':_0xaf3f('0x5')},'priorityTrue':{'type':_0xaf3f('0x6'),'message':_0xaf3f('0x7')},'priorityFalse':{'type':'number','message':_0xaf3f('0x8')}});exports[_0xaf3f('0x9')]=function(_0x45cca3,_0x46978a){return function(_0x58f1c8){try{var _0x4ea5d9={'condition':htmlToText[_0xaf3f('0xa')](utils[_0xaf3f('0xb')](_0x46978a[0x0],this),{'wordwrap':![]})[_0xaf3f('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x46978a[0x1],'priorityFalse':_0x46978a[0x2]};var _0x58024e=gotoif['validate'](_0x4ea5d9,{'typecast':!![]});if(_0x58024e[_0xaf3f('0xd')]){logger['error']('[%s][GOTOIF]\x20%s',_0x45cca3,_[_0xaf3f('0xe')](_0x58024e,'message')[_0xaf3f('0xf')](',\x20'));_0x58f1c8[_0xaf3f('0x10')]();}else{try{var _0x5928f1=eval('('+_0x4ea5d9[_0xaf3f('0x11')]+')');var _0x2b893a=_0x5928f1?_0x4ea5d9[_0xaf3f('0x12')]:_0x4ea5d9['priorityFalse'];logger['info'](_0xaf3f('0x13'),_0x45cca3,_0x4ea5d9['condition'],_0x5928f1,_0x2b893a||_0xaf3f('0x14'));if(_0x2b893a){var _0x3b367a=_[_0xaf3f('0x15')](_0x58f1c8[_0xaf3f('0x16')](),{'p':_0x2b893a});if(_0x3b367a>=0x0){logger[_0xaf3f('0x17')](_0xaf3f('0x18'),_0x45cca3,_0x2b893a||_0xaf3f('0x14'),_0x3b367a);_0x58f1c8[_0xaf3f('0x14')](_0x3b367a);}else{logger['info'](_0xaf3f('0x19'),_0x45cca3,_0x2b893a||_0xaf3f('0x14'));_0x58f1c8[_0xaf3f('0x10')]();}}else{_0x58f1c8[_0xaf3f('0x14')]();}}catch(_0x1a4967){logger['error'](_0xaf3f('0x1a'),_0x45cca3,_0x1a4967[_0xaf3f('0x1b')]);_0x58f1c8['stop']();}}}catch(_0x2e7a4f){logger[_0xaf3f('0x1c')]('[%s][GOTOIF]\x20%s',_0x45cca3,JSON[_0xaf3f('0x1d')](_0x2e7a4f));_0x58f1c8[_0xaf3f('0x10')]();}};};
\ No newline at end of file
+var _0xa25a=['number','priority\x20false\x20is\x20a\x20number','consequence','replace','length','error','[%s][GOTOIF]\x20%s','map','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\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','./utils','../../../../config/logger','routing','priority\x20true\x20is\x20a\x20number'];(function(_0x140f9c,_0x4f2479){var _0x53c25a=function(_0x174efb){while(--_0x174efb){_0x140f9c['push'](_0x140f9c['shift']());}};_0x53c25a(++_0x4f2479);}(_0xa25a,0xcb));var _0xaa25=function(_0x48ad8d,_0x16332b){_0x48ad8d=_0x48ad8d-0x0;var _0xe00479=_0xa25a[_0x48ad8d];return _0xe00479;};'use strict';var schema=require(_0xaa25('0x0'));var _=require('lodash');var htmlToText=require('html-to-text');var utils=require(_0xaa25('0x1'));var logger=require(_0xaa25('0x2'))(_0xaa25('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':_0xaa25('0x4')},'priorityFalse':{'type':_0xaa25('0x5'),'message':_0xaa25('0x6')}});exports[_0xaa25('0x7')]=function(_0x2ecccf,_0x45b223){return function(_0xc6651){try{var _0x59a4a6={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x45b223[0x0],this),{'wordwrap':![]})[_0xaa25('0x8')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x45b223[0x1],'priorityFalse':_0x45b223[0x2]};var _0x36aaf6=gotoif[_0xaa25('0x0')](_0x59a4a6,{'typecast':!![]});if(_0x36aaf6[_0xaa25('0x9')]){logger[_0xaa25('0xa')](_0xaa25('0xb'),_0x2ecccf,_[_0xaa25('0xc')](_0x36aaf6,'message')['join'](',\x20'));_0xc6651[_0xaa25('0xd')]();}else{try{var _0xf62dba=eval('('+_0x59a4a6[_0xaa25('0xe')]+')');var _0xadd5bc=_0xf62dba?_0x59a4a6[_0xaa25('0xf')]:_0x59a4a6[_0xaa25('0x10')];logger[_0xaa25('0x11')](_0xaa25('0x12'),_0x2ecccf,_0x59a4a6[_0xaa25('0xe')],_0xf62dba,_0xadd5bc||_0xaa25('0x13'));if(_0xadd5bc){var _0x1ccc09=_[_0xaa25('0x14')](_0xc6651[_0xaa25('0x15')](),{'p':_0xadd5bc});if(_0x1ccc09>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x2ecccf,_0xadd5bc||_0xaa25('0x13'),_0x1ccc09);_0xc6651[_0xaa25('0x13')](_0x1ccc09);}else{logger[_0xaa25('0x11')](_0xaa25('0x16'),_0x2ecccf,_0xadd5bc||_0xaa25('0x13'));_0xc6651['stop']();}}else{_0xc6651[_0xaa25('0x13')]();}}catch(_0x390881){logger['error'](_0xaa25('0x17'),_0x2ecccf,_0x390881[_0xaa25('0x18')]);_0xc6651[_0xaa25('0xd')]();}}}catch(_0x292be9){logger[_0xaa25('0xa')](_0xaa25('0xb'),_0x2ecccf,JSON[_0xaa25('0x19')](_0x292be9));_0xc6651[_0xaa25('0xd')]();}};};
\ No newline at end of file
index 279fa11..0ca67fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc996=['join','stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','map'];(function(_0x5cca50,_0x2f32ec){var _0x2449db=function(_0x24a7cb){while(--_0x24a7cb){_0x5cca50['push'](_0x5cca50['shift']());}};_0x2449db(++_0x2f32ec);}(_0xc996,0x1e4));var _0x6c99=function(_0xbf25c7,_0x284001){_0xbf25c7=_0xbf25c7-0x0;var _0x124d46=_0xc996[_0xbf25c7];return _0x124d46;};'use strict';var schema=require('validate');var _=require(_0x6c99('0x0'));var logger=require(_0x6c99('0x1'))(_0x6c99('0x2'));var gotop=schema({'priority':{'type':_0x6c99('0x3'),'required':!![],'message':_0x6c99('0x4')}});exports['consequence']=function(_0x404cf4,_0x43bdfe){return function(_0x181c46){try{var _0xe0b9e={'priority':_0x43bdfe[0x0]};var _0x3fcfc5=gotop['validate'](_0xe0b9e,{'typecast':!![]});if(_0x3fcfc5[_0x6c99('0x5')]){logger[_0x6c99('0x6')](_0x6c99('0x7'),_0x404cf4,_[_0x6c99('0x8')](_0x3fcfc5,'message')[_0x6c99('0x9')](',\x20'));_0x181c46[_0x6c99('0xa')]();}else{logger[_0x6c99('0xb')]('[%s][GOTOP]\x20priority\x20%s',_0x404cf4,_0xe0b9e['priority']);if(_0xe0b9e[_0x6c99('0xc')]){var _0x4324f7=_[_0x6c99('0xd')](_0x181c46[_0x6c99('0xe')](),{'p':_0xe0b9e[_0x6c99('0xc')]});if(_0x4324f7>=0x0){logger['info'](_0x6c99('0xf'),_0x404cf4,_0xe0b9e['priority']||_0x6c99('0x10'),_0x4324f7);_0x181c46[_0x6c99('0x10')](_0x4324f7);}else{logger[_0x6c99('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x404cf4,_0xe0b9e['priority']||_0x6c99('0x10'));_0x181c46[_0x6c99('0xa')]();}}else{_0x181c46[_0x6c99('0x10')]();}}}catch(_0x55a110){logger[_0x6c99('0x6')](_0x6c99('0x7'),_0x404cf4,JSON['stringify'](_0x55a110));_0x181c46[_0x6c99('0xa')]();}};};
\ No newline at end of file
+var _0x12ae=['next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOP]\x20%s','validate','lodash','../../../../config/logger','routing','consequence','length','map','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0x579837,_0x3b64df){var _0x3469b5=function(_0x1a70ae){while(--_0x1a70ae){_0x579837['push'](_0x579837['shift']());}};_0x3469b5(++_0x3b64df);}(_0x12ae,0x94));var _0xe12a=function(_0x5aaf84,_0x4f24df){_0x5aaf84=_0x5aaf84-0x0;var _0x31b6b0=_0x12ae[_0x5aaf84];return _0x31b6b0;};'use strict';var schema=require(_0xe12a('0x0'));var _=require(_0xe12a('0x1'));var logger=require(_0xe12a('0x2'))(_0xe12a('0x3'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xe12a('0x4')]=function(_0x656cd5,_0x1169cf){return function(_0x1573ab){try{var _0x4ab47d={'priority':_0x1169cf[0x0]};var _0x2d85dc=gotop[_0xe12a('0x0')](_0x4ab47d,{'typecast':!![]});if(_0x2d85dc[_0xe12a('0x5')]){logger['error']('[%s][GOTOP]\x20%s',_0x656cd5,_[_0xe12a('0x6')](_0x2d85dc,_0xe12a('0x7'))[_0xe12a('0x8')](',\x20'));_0x1573ab['stop']();}else{logger[_0xe12a('0x9')](_0xe12a('0xa'),_0x656cd5,_0x4ab47d[_0xe12a('0xb')]);if(_0x4ab47d[_0xe12a('0xb')]){var _0x93573d=_['findIndex'](_0x1573ab[_0xe12a('0xc')](),{'p':_0x4ab47d[_0xe12a('0xb')]});if(_0x93573d>=0x0){logger[_0xe12a('0x9')](_0xe12a('0xd'),_0x656cd5,_0x4ab47d[_0xe12a('0xb')]||_0xe12a('0xe'),_0x93573d);_0x1573ab[_0xe12a('0xe')](_0x93573d);}else{logger[_0xe12a('0x9')](_0xe12a('0xf'),_0x656cd5,_0x4ab47d[_0xe12a('0xb')]||'next');_0x1573ab[_0xe12a('0x10')]();}}else{_0x1573ab[_0xe12a('0xe')]();}}}catch(_0x333629){logger['error'](_0xe12a('0x11'),_0x656cd5,JSON['stringify'](_0x333629));_0x1573ab[_0xe12a('0x10')]();}};};
\ No newline at end of file
index dc4e765..84d8e0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b41=['body','next','catch','error','stringify','stop','lodash','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','then','info','[%s][MESSAGE]\x20%s'];(function(_0x11067d,_0x3ea3b4){var _0x1132b3=function(_0x6c26a){while(--_0x6c26a){_0x11067d['push'](_0x11067d['shift']());}};_0x1132b3(++_0x3ea3b4);}(_0x0b41,0x6a));var _0x10b4=function(_0x2d5829,_0x5cb61a){_0x2d5829=_0x2d5829-0x0;var _0x4ea64c=_0x0b41[_0x2d5829];return _0x4ea64c;};'use strict';var _=require(_0x10b4('0x0'));var utils=require('./utils');var logger=require(_0x10b4('0x1'))(_0x10b4('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x10b4('0x3')),'mailMessage':require(_0x10b4('0x4')),'smsMessage':require(_0x10b4('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x10b4('0x6'))};exports[_0x10b4('0x7')]=function(_0x1208dc,_0x277f6c){return function(_0x22f6a1){try{var _0xaa560={'body':utils[_0x10b4('0x8')](_0x277f6c[0x0],this),'ContactId':this[_0x10b4('0x9')]['id']};if(this[_0x10b4('0xa')]===_0x10b4('0xb')){_0xaa560[_0x10b4('0xc')]=this[_0x10b4('0xd')]['id'];}else{_0xaa560[_[_0x10b4('0xe')](this[_0x10b4('0xa')])+_0x10b4('0xf')]=this[_0x10b4('0xd')]['id'];}_0xaa560[_[_0x10b4('0xe')](this[_0x10b4('0xa')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x10b4('0xa')]+'Message']){return rpc[this[_0x10b4('0xa')]+'Message']['create'](_0xaa560)[_0x10b4('0x10')](function(_0x58ba27){logger[_0x10b4('0x11')](_0x10b4('0x12'),_0x1208dc,_0xaa560[_0x10b4('0x13')]);_0x22f6a1[_0x10b4('0x14')]();})[_0x10b4('0x15')](function(_0xbf5214){logger[_0x10b4('0x16')](_0x10b4('0x12'),_0x1208dc,JSON[_0x10b4('0x17')](_0xbf5214));_0x22f6a1[_0x10b4('0x18')]();});}}catch(_0x2dcdfe){logger['error'](_0x10b4('0x12'),_0x1208dc,JSON['stringify'](_0x2dcdfe));_0x22f6a1[_0x10b4('0x18')]();}};};
\ No newline at end of file
+var _0x420d=['../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','then','info','body','next','catch','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage'];(function(_0x4904af,_0x4418bc){var _0x2a2f45=function(_0x282c43){while(--_0x282c43){_0x4904af['push'](_0x4904af['shift']());}};_0x2a2f45(++_0x4418bc);}(_0x420d,0x19e));var _0xd420=function(_0x2d6eee,_0x37f314){_0x2d6eee=_0x2d6eee-0x0;var _0x1ed9d9=_0x420d[_0x2d6eee];return _0x1ed9d9;};'use strict';var _=require(_0xd420('0x0'));var utils=require(_0xd420('0x1'));var logger=require(_0xd420('0x2'))('routing');var rpc={'chatMessage':require(_0xd420('0x3')),'openchannelMessage':require(_0xd420('0x4')),'mailMessage':require(_0xd420('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xd420('0x6'))};exports[_0xd420('0x7')]=function(_0x44e2fa,_0x134951){return function(_0x1eec22){try{var _0x4056c3={'body':utils[_0xd420('0x8')](_0x134951[0x0],this),'ContactId':this[_0xd420('0x9')]['id']};if(this[_0xd420('0xa')]===_0xd420('0xb')){_0x4056c3[_0xd420('0xc')]=this[_0xd420('0xd')]['id'];}else{_0x4056c3[_[_0xd420('0xe')](this['channel'])+_0xd420('0xf')]=this[_0xd420('0xd')]['id'];}_0x4056c3[_[_0xd420('0xe')](this[_0xd420('0xa')])+_0xd420('0x10')]=this[_0xd420('0x11')]['id'];if(rpc[this[_0xd420('0xa')]+_0xd420('0x12')]){return rpc[this[_0xd420('0xa')]+_0xd420('0x12')]['create'](_0x4056c3)[_0xd420('0x13')](function(_0x196c8a){logger[_0xd420('0x14')]('[%s][MESSAGE]\x20%s',_0x44e2fa,_0x4056c3[_0xd420('0x15')]);_0x1eec22[_0xd420('0x16')]();})[_0xd420('0x17')](function(_0x1281fe){logger[_0xd420('0x18')](_0xd420('0x19'),_0x44e2fa,JSON['stringify'](_0x1281fe));_0x1eec22['stop']();});}}catch(_0x1ab7ec){logger[_0xd420('0x18')](_0xd420('0x19'),_0x44e2fa,JSON[_0xd420('0x1a')](_0x1ab7ec));_0x1eec22[_0xd420('0x1b')]();}};};
\ No newline at end of file
index 4db0b22..15ef0d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc563=['info','[%s][NOOP]\x20%s','next','error','stringify','stop','./utils','../../../../config/logger','routing'];(function(_0x4812c9,_0x154b76){var _0x4de61f=function(_0x42cd33){while(--_0x42cd33){_0x4812c9['push'](_0x4812c9['shift']());}};_0x4de61f(++_0x154b76);}(_0xc563,0x10b));var _0x3c56=function(_0x54a7e2,_0x5cfe54){_0x54a7e2=_0x54a7e2-0x0;var _0xa943ad=_0xc563[_0x54a7e2];return _0xa943ad;};'use strict';var utils=require(_0x3c56('0x0'));var logger=require(_0x3c56('0x1'))(_0x3c56('0x2'));exports['consequence']=function(_0x3f2048,_0x2623f){return function(_0x2d3557){try{logger[_0x3c56('0x3')](_0x3c56('0x4'),_0x3f2048,utils['getMustacheRender'](_0x2623f[0x0],this));_0x2d3557[_0x3c56('0x5')]();}catch(_0x5a4c76){logger[_0x3c56('0x6')](_0x3c56('0x4'),_0x3f2048,JSON[_0x3c56('0x7')](_0x5a4c76));_0x2d3557[_0x3c56('0x8')]();}};};
\ No newline at end of file
+var _0x761c=['stringify','../../../../config/logger','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x1dbaf2,_0x2c0a15){var _0x533552=function(_0x5bb24a){while(--_0x5bb24a){_0x1dbaf2['push'](_0x1dbaf2['shift']());}};_0x533552(++_0x2c0a15);}(_0x761c,0x13c));var _0xc761=function(_0x5aa05e,_0x5da3b9){_0x5aa05e=_0x5aa05e-0x0;var _0x3f3c06=_0x761c[_0x5aa05e];return _0x3f3c06;};'use strict';var utils=require('./utils');var logger=require(_0xc761('0x0'))('routing');exports['consequence']=function(_0x36ae15,_0x345401){return function(_0x28dfca){try{logger[_0xc761('0x1')](_0xc761('0x2'),_0x36ae15,utils[_0xc761('0x3')](_0x345401[0x0],this));_0x28dfca['next']();}catch(_0x3526d8){logger['error'](_0xc761('0x2'),_0x36ae15,JSON[_0xc761('0x4')](_0x3526d8));_0x28dfca['stop']();}};};
\ No newline at end of file
index 286fc42..4910431 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ef2=['toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','timeout','createQueue','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','strategy','beepall','log','stack','validate','ioredis','../../../../config/logger','./strategy','redis','defaults','localhost','queue_id','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','string','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','YYYY-MM-DD\x20HH:mm:ss','accepted','catch','error','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','update'];(function(_0x144795,_0x2de24b){var _0x30ed70=function(_0x5ad1e9){while(--_0x5ad1e9){_0x144795['push'](_0x144795['shift']());}};_0x30ed70(++_0x2de24b);}(_0x1ef2,0xed));var _0x21ef=function(_0x4512ca,_0x270a55){_0x4512ca=_0x4512ca-0x0;var _0x55d639=_0x1ef2[_0x4512ca];return _0x55d639;};'use strict';var schema=require(_0x21ef('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0x21ef('0x1'));var config=require('../../../../config/environment');var logger=require(_0x21ef('0x2'))('routing');var strategy=require(_0x21ef('0x3'));config[_0x21ef('0x4')]=_[_0x21ef('0x5')](config[_0x21ef('0x4')],{'host':_0x21ef('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x21ef('0x4')]));var attributes=['id',_0x21ef('0x7'),_0x21ef('0x8'),_0x21ef('0x9'),_0x21ef('0xa'),_0x21ef('0xb')];function emit(_0x3a6ebc,_0x1d4980,_0x2d25d3){io['to'](_0x3a6ebc)[_0x21ef('0xc')](_0x1d4980,_0x2d25d3);}function emitChannelQueueInteraction(_0x2e9f14,_0xf8d386,_0x2cae05,_0x329d9d,_0x4bede2,_0x47dccb,_0xd9cdf1,_0x364f03){var _0x5c68ca=_[_0x21ef('0xd')](_0x2cae05);_0x5c68ca[_0x21ef('0x7')]=_0x364f03;_0x5c68ca[_0x21ef('0x9')]=_0xf8d386;_0x5c68ca[_0x21ef('0x8')]=_0x329d9d;_0x5c68ca['id']=_0x4bede2;if(_0x47dccb){_0xd9cdf1[util[_0x21ef('0xe')](_0x21ef('0xf'),_0x2e9f14)][_0x4bede2]=_['pick'](_0x5c68ca,attributes);}else{delete _0xd9cdf1[util[_0x21ef('0xe')](_0x21ef('0xf'),_0x2e9f14)][_0x4bede2];}emit(util['format'](_0x21ef('0x10'),_0x2e9f14,_0xf8d386),util[_0x21ef('0xe')](_0x21ef('0x11'),_0x2e9f14,_0x47dccb?_0x21ef('0x12'):_0x21ef('0x13')),_['pick'](_0x5c68ca,attributes));}var rpc={'openchannelQueueReport':require(_0x21ef('0x14')),'mailQueueReport':require(_0x21ef('0x15')),'chatQueueReport':require(_0x21ef('0x16')),'smsQueueReport':require(_0x21ef('0x17')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x21ef('0x18'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0x21ef('0x19')}});function startRouting(_0x33e307,_0x2cbd0b,_0x1404e3,_0x1dd33a){if(_0x33e307&&_0x2cbd0b&&_0x1404e3){_0x2cbd0b[_0x21ef('0x1a')]+=0x1;var _0x307bac={'uniqueid':_0x33e307,'from':_0x1404e3[_0x21ef('0x1b')]?_0x1404e3[_0x21ef('0x1b')][_0x21ef('0xa')]:'','joinAt':moment()[_0x21ef('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1404e3[_0x21ef('0x1c')]?_0x1404e3[_0x21ef('0x1c')]['id']:null,'ListId':_0x1404e3[_0x21ef('0x1d')]?_0x1404e3['list']['id']:null};_0x307bac[_[_0x21ef('0x1e')](_0x1404e3[_0x21ef('0x1f')])+_0x21ef('0x20')]=_0x2cbd0b['id']||null;_0x307bac[_[_0x21ef('0x1e')](_0x1404e3[_0x21ef('0x1f')])+_0x21ef('0x21')]=_0x1404e3[_0x21ef('0x22')]?_0x1404e3[_0x21ef('0x22')]['id']:null;_0x307bac[_[_0x21ef('0x1e')](_0x1404e3[_0x21ef('0x1f')])+_0x21ef('0x23')]=_0x1404e3[_0x21ef('0x24')]?_0x1404e3[_0x21ef('0x24')]['id']:null;_0x307bac[_[_0x21ef('0x1e')](_0x1404e3['channel'])+(_0x1404e3[_0x21ef('0x1f')]!==_0x21ef('0x25')?_0x21ef('0x26'):_0x21ef('0x27'))]=_0x1404e3[_0x21ef('0x8')]?_0x1404e3[_0x21ef('0x8')]['id']:null;logger[_0x21ef('0x28')](util[_0x21ef('0xe')](_0x21ef('0x29'),_0x33e307,_0x2cbd0b[_0x21ef('0x2a')]));emitChannelQueueInteraction(_0x1404e3[_0x21ef('0x1f')],_0x2cbd0b[_0x21ef('0x2a')],_0x307bac,_0x1404e3[_0x21ef('0x8')][_0x21ef('0x2a')],_0x1404e3[_0x21ef('0x24')]['id'],!![],_0x1dd33a,_0x2cbd0b['id']);if(rpc[_0x1404e3[_0x21ef('0x1f')]+'QueueReport']){return rpc[_0x1404e3['channel']+_0x21ef('0x2b')]['create'](_0x307bac)['catch'](function(_0x174f01){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x5228bd,_0x4d0994,_0x51cfba,_0x257903){if(_0x5228bd&&_0x4d0994){_0x4d0994[_0x21ef('0x1a')]-=0x1;var _0x5c5c61={'leaveAt':moment()[_0x21ef('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x21ef('0xe')](_0x21ef('0x2c')),'reason':_0x21ef('0x2d')};logger[_0x21ef('0x28')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x5228bd,_0x4d0994[_0x21ef('0x2a')]));emitChannelQueueInteraction(_0x51cfba[_0x21ef('0x1f')],_0x4d0994[_0x21ef('0x2a')],_0x51cfba[_0x21ef('0x1b')],_0x51cfba[_0x21ef('0x8')][_0x21ef('0x2a')],_0x51cfba[_0x21ef('0x24')]['id'],![],_0x257903,_0x4d0994['id']);if(rpc[_0x51cfba['channel']+_0x21ef('0x2b')]){return rpc[_0x51cfba[_0x21ef('0x1f')]+_0x21ef('0x2b')]['update'](_0x5228bd,_0x5c5c61)[_0x21ef('0x2e')](function(_0x174890){logger[_0x21ef('0x2f')](_0x21ef('0x30'));});}}}function endRouting(_0x49f442,_0x2925fd,_0x82a8e3,_0x4420e3){if(_0x49f442&&_0x2925fd){_0x2925fd['waiting']-=0x1;var _0x191d7f={'leaveAt':moment()[_0x21ef('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x21ef('0xe')](_0x21ef('0x2c')),'reason':'timeout'};logger[_0x21ef('0x28')](util[_0x21ef('0xe')](_0x21ef('0x31'),_0x49f442,_0x2925fd[_0x21ef('0x2a')]));emitChannelQueueInteraction(_0x82a8e3[_0x21ef('0x1f')],_0x2925fd[_0x21ef('0x2a')],_0x82a8e3['body'],_0x82a8e3[_0x21ef('0x8')]['name'],_0x82a8e3[_0x21ef('0x24')]['id'],![],_0x4420e3);if(rpc[_0x82a8e3[_0x21ef('0x1f')]+_0x21ef('0x2b')]){return rpc[_0x82a8e3['channel']+_0x21ef('0x2b')][_0x21ef('0x32')](_0x49f442,_0x191d7f)['catch'](function(_0x3f5ea0){logger[_0x21ef('0x2f')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x294104){return function(_0x37c63f){return _0x37c63f[_0x21ef('0x2a')][_0x21ef('0x33')]()===_0x294104[_0x21ef('0x33')]();};}exports[_0x21ef('0x34')]=function(_0x3e6cd9,_0x6fd907,_0x576b53,_0x40f8a6){return function(_0xc9e5ed){try{var _0x2937f3={'name':_0x6fd907[0x0],'timeout':_0x6fd907[0x1]};var _0x115fd9=queue[_0x21ef('0x0')](_0x2937f3,{'typecast':!![]});if(_0x115fd9[_0x21ef('0x35')]){logger[_0x21ef('0x2f')](_0x21ef('0x36'),_0x3e6cd9,_['map'](_0x115fd9,'message')[_0x21ef('0x37')](',\x20'));_0xc9e5ed[_0x21ef('0x38')]();}else{var _0x23d37b=_[_0x21ef('0x39')](_0x576b53[_0x40f8a6['channel']+_0x21ef('0x3a')],handleFindQueue(_0x2937f3[_0x21ef('0x2a')]));if(_0x23d37b){startRouting(_0x3e6cd9,_0x23d37b,_0x40f8a6,_0x576b53);var _0x201ad9=(_0x23d37b[_0x21ef('0x3b')]||0xa)*0x3e8;var _0x48ecda=(_0x2937f3[_0x21ef('0x3b')]||0x14)*0x3e8;var _0x1d72dc,_0x3d55b1;if(_0x201ad9>_0x48ecda){_0x48ecda=_0x201ad9;}var _0x12ef91=seqqueue[_0x21ef('0x3c')](_0x201ad9);_0x12ef91['id']=_0x3e6cd9;_0x12ef91['atimeout']=_0x201ad9;_0x12ef91[_0x21ef('0x3d')]=_0x48ecda;_0x12ef91['channel']=_0x40f8a6[_0x21ef('0x1f')];_0x576b53[_0x21ef('0x3e')][_0x3e6cd9]['on'](_0x21ef('0x3f'),function(){logger['info'](_0x21ef('0x40'),_0x3e6cd9);stopRouting(_0x3e6cd9,_0x23d37b,_0x40f8a6,_0x576b53);clearTimeout(_0x1d72dc);_0x1d72dc=undefined;_0x12ef91[_0x21ef('0x41')](!![]);if(_0x576b53[_0x21ef('0x3e')][_0x3e6cd9]){delete _0x576b53[_0x21ef('0x3e')][_0x3e6cd9];}_0xc9e5ed[_0x21ef('0x38')]();});_0x576b53[_0x21ef('0x3e')][_0x3e6cd9]['on'](_0x21ef('0x42'),function(){if(_0x576b53['rules'][_0x3e6cd9]){delete _0x576b53[_0x21ef('0x3e')][_0x3e6cd9];}});_0x1d72dc=setTimeout(function(){logger[_0x21ef('0x28')](_0x21ef('0x43'),_0x3e6cd9);endRouting(_0x3e6cd9,_0x23d37b,_0x40f8a6,_0x576b53);clearTimeout(_0x1d72dc);_0x12ef91['close'](!![]);_0xc9e5ed['next']();},_0x48ecda);switch(_0x23d37b[_0x21ef('0x44')]){case'rrmemory':strategy['rrmemory'](_0x12ef91,_0x23d37b,_0x576b53,_0x40f8a6);break;default:strategy[_0x21ef('0x45')](_0x12ef91,_0x23d37b,_0x576b53,_0x40f8a6);}}else{logger[_0x21ef('0x2f')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x3e6cd9,_0x2937f3[_0x21ef('0x2a')]);_0xc9e5ed['stop']();}}}catch(_0x11c0b3){console[_0x21ef('0x46')](_0x11c0b3);logger[_0x21ef('0x2f')](_0x21ef('0x36'),_0x3e6cd9,_0x11c0b3[_0x21ef('0x47')]);_0xc9e5ed[_0x21ef('0x38')]();}};};
\ No newline at end of file
+var _0x247f=['joinAt','clone','format','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','catch','YYYY-MM-DD\x20HH:mm:ss','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','length','[%s][QUEUE]\x20%s','map','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from'];(function(_0x109718,_0x3e9021){var _0x1f5cd7=function(_0x30b487){while(--_0x30b487){_0x109718['push'](_0x109718['shift']());}};_0x1f5cd7(++_0x3e9021);}(_0x247f,0x129));var _0xf247=function(_0x662a1c,_0x87d68e){_0x662a1c=_0x662a1c-0x0;var _0x911d88=_0x247f[_0x662a1c];return _0x911d88;};'use strict';var schema=require(_0xf247('0x0'));var _=require(_0xf247('0x1'));var util=require('util');var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0xf247('0x2'));var config=require(_0xf247('0x3'));var logger=require(_0xf247('0x4'))(_0xf247('0x5'));var strategy=require(_0xf247('0x6'));config[_0xf247('0x7')]=_[_0xf247('0x8')](config[_0xf247('0x7')],{'host':_0xf247('0x9'),'port':0x18eb});var io=require(_0xf247('0xa'))(new Redis(config[_0xf247('0x7')]));var attributes=['id',_0xf247('0xb'),_0xf247('0xc'),_0xf247('0xd'),_0xf247('0xe'),_0xf247('0xf')];function emit(_0x2ec83d,_0x1f1b3e,_0x2d4dc5){io['to'](_0x2ec83d)['emit'](_0x1f1b3e,_0x2d4dc5);}function emitChannelQueueInteraction(_0x300e1c,_0x41eb18,_0x4e2c9e,_0x285aa5,_0x933436,_0x157d33,_0x1522e5,_0xbf647e){var _0x55c603=_[_0xf247('0x10')](_0x4e2c9e);_0x55c603[_0xf247('0xb')]=_0xbf647e;_0x55c603[_0xf247('0xd')]=_0x41eb18;_0x55c603[_0xf247('0xc')]=_0x285aa5;_0x55c603['id']=_0x933436;if(_0x157d33){_0x1522e5[util[_0xf247('0x11')](_0xf247('0x12'),_0x300e1c)][_0x933436]=_['pick'](_0x55c603,attributes);}else{delete _0x1522e5[util[_0xf247('0x11')](_0xf247('0x12'),_0x300e1c)][_0x933436];}emit(util[_0xf247('0x11')]('%s:queue:%s',_0x300e1c,_0x41eb18),util[_0xf247('0x11')](_0xf247('0x13'),_0x300e1c,_0x157d33?_0xf247('0x14'):_0xf247('0x15')),_[_0xf247('0x16')](_0x55c603,attributes));}var rpc={'openchannelQueueReport':require(_0xf247('0x17')),'mailQueueReport':require(_0xf247('0x18')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require(_0xf247('0x19')),'faxQueueReport':require(_0xf247('0x1a')),'whatsappQueueReport':require(_0xf247('0x1b'))};var queue=schema({'name':{'type':_0xf247('0x1c'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xf247('0x1d'),'message':_0xf247('0x1e')}});function startRouting(_0x46ec6d,_0x1c7fb4,_0x2ddc11,_0x33ca87){if(_0x46ec6d&&_0x1c7fb4&&_0x2ddc11){_0x1c7fb4[_0xf247('0x1f')]+=0x1;var _0x17415c={'uniqueid':_0x46ec6d,'from':_0x2ddc11[_0xf247('0x20')]?_0x2ddc11[_0xf247('0x20')][_0xf247('0xe')]:'','joinAt':moment()[_0xf247('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2ddc11[_0xf247('0x21')]?_0x2ddc11[_0xf247('0x21')]['id']:null,'ListId':_0x2ddc11[_0xf247('0x22')]?_0x2ddc11[_0xf247('0x22')]['id']:null};_0x17415c[_['upperFirst'](_0x2ddc11[_0xf247('0x23')])+_0xf247('0x24')]=_0x1c7fb4['id']||null;_0x17415c[_[_0xf247('0x25')](_0x2ddc11['channel'])+_0xf247('0x26')]=_0x2ddc11[_0xf247('0x27')]?_0x2ddc11[_0xf247('0x27')]['id']:null;_0x17415c[_[_0xf247('0x25')](_0x2ddc11[_0xf247('0x23')])+'MessageId']=_0x2ddc11[_0xf247('0x28')]?_0x2ddc11[_0xf247('0x28')]['id']:null;_0x17415c[_[_0xf247('0x25')](_0x2ddc11['channel'])+(_0x2ddc11[_0xf247('0x23')]!==_0xf247('0x29')?_0xf247('0x2a'):_0xf247('0x2b'))]=_0x2ddc11['account']?_0x2ddc11[_0xf247('0xc')]['id']:null;logger['info'](util[_0xf247('0x11')](_0xf247('0x2c'),_0x46ec6d,_0x1c7fb4['name']));emitChannelQueueInteraction(_0x2ddc11[_0xf247('0x23')],_0x1c7fb4['name'],_0x17415c,_0x2ddc11['account'][_0xf247('0x2d')],_0x2ddc11[_0xf247('0x28')]['id'],!![],_0x33ca87,_0x1c7fb4['id']);if(rpc[_0x2ddc11[_0xf247('0x23')]+_0xf247('0x2e')]){return rpc[_0x2ddc11[_0xf247('0x23')]+_0xf247('0x2e')][_0xf247('0x2f')](_0x17415c)['catch'](function(_0x1cab09){logger[_0xf247('0x30')](_0xf247('0x31'));});}}}function stopRouting(_0x3bc58e,_0x145056,_0x972aa1,_0x3d2851){if(_0x3bc58e&&_0x145056){_0x145056[_0xf247('0x1f')]-=0x1;var _0x37e7a2={'leaveAt':moment()[_0xf247('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xf247('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xf247('0x32')};logger[_0xf247('0x33')](util[_0xf247('0x11')](_0xf247('0x34'),_0x3bc58e,_0x145056[_0xf247('0x2d')]));emitChannelQueueInteraction(_0x972aa1['channel'],_0x145056[_0xf247('0x2d')],_0x972aa1[_0xf247('0x20')],_0x972aa1['account'][_0xf247('0x2d')],_0x972aa1[_0xf247('0x28')]['id'],![],_0x3d2851,_0x145056['id']);if(rpc[_0x972aa1['channel']+_0xf247('0x2e')]){return rpc[_0x972aa1['channel']+_0xf247('0x2e')][_0xf247('0x35')](_0x3bc58e,_0x37e7a2)[_0xf247('0x36')](function(_0x3857b7){logger[_0xf247('0x30')]('update\x20queue\x20report');});}}}function endRouting(_0x3efd0c,_0x194a4e,_0x125fa9,_0x16bae2){if(_0x3efd0c&&_0x194a4e){_0x194a4e[_0xf247('0x1f')]-=0x1;var _0x4b308a={'leaveAt':moment()['format'](_0xf247('0x37')),'exitAt':moment()[_0xf247('0x11')](_0xf247('0x37')),'reason':_0xf247('0x38')};logger[_0xf247('0x33')](util['format'](_0xf247('0x39'),_0x3efd0c,_0x194a4e[_0xf247('0x2d')]));emitChannelQueueInteraction(_0x125fa9[_0xf247('0x23')],_0x194a4e[_0xf247('0x2d')],_0x125fa9[_0xf247('0x20')],_0x125fa9['account'][_0xf247('0x2d')],_0x125fa9['message']['id'],![],_0x16bae2);if(rpc[_0x125fa9['channel']+_0xf247('0x2e')]){return rpc[_0x125fa9[_0xf247('0x23')]+_0xf247('0x2e')][_0xf247('0x35')](_0x3efd0c,_0x4b308a)[_0xf247('0x36')](function(_0x1dd4e7){logger[_0xf247('0x30')](_0xf247('0x3a'));});}}}function handleFindQueue(_0xcf67fe){return function(_0x402665){return _0x402665[_0xf247('0x2d')][_0xf247('0x3b')]()===_0xcf67fe[_0xf247('0x3b')]();};}exports['consequence']=function(_0x1e74da,_0x5cf19b,_0x48247b,_0x585ed6){return function(_0x22ff6f){try{var _0xb0e444={'name':_0x5cf19b[0x0],'timeout':_0x5cf19b[0x1]};var _0x5d9ac4=queue[_0xf247('0x0')](_0xb0e444,{'typecast':!![]});if(_0x5d9ac4[_0xf247('0x3c')]){logger[_0xf247('0x30')](_0xf247('0x3d'),_0x1e74da,_[_0xf247('0x3e')](_0x5d9ac4,_0xf247('0x28'))['join'](',\x20'));_0x22ff6f[_0xf247('0x3f')]();}else{var _0x2f1b0=_[_0xf247('0x40')](_0x48247b[_0x585ed6[_0xf247('0x23')]+_0xf247('0x41')],handleFindQueue(_0xb0e444[_0xf247('0x2d')]));if(_0x2f1b0){startRouting(_0x1e74da,_0x2f1b0,_0x585ed6,_0x48247b);var _0x5db37f=(_0x2f1b0['timeout']||0xa)*0x3e8;var _0x82fd8f=(_0xb0e444[_0xf247('0x38')]||0x14)*0x3e8;var _0x15c7fd,_0x1412d6;if(_0x5db37f>_0x82fd8f){_0x82fd8f=_0x5db37f;}var _0x21f95b=seqqueue[_0xf247('0x42')](_0x5db37f);_0x21f95b['id']=_0x1e74da;_0x21f95b[_0xf247('0x43')]=_0x5db37f;_0x21f95b[_0xf247('0x44')]=_0x82fd8f;_0x21f95b['channel']=_0x585ed6['channel'];_0x48247b[_0xf247('0x45')][_0x1e74da]['on'](_0xf247('0x46'),function(){logger['info']('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x1e74da);stopRouting(_0x1e74da,_0x2f1b0,_0x585ed6,_0x48247b);clearTimeout(_0x15c7fd);_0x15c7fd=undefined;_0x21f95b[_0xf247('0x47')](!![]);if(_0x48247b[_0xf247('0x45')][_0x1e74da]){delete _0x48247b[_0xf247('0x45')][_0x1e74da];}_0x22ff6f[_0xf247('0x3f')]();});_0x48247b[_0xf247('0x45')][_0x1e74da]['on']('complete',function(){if(_0x48247b['rules'][_0x1e74da]){delete _0x48247b[_0xf247('0x45')][_0x1e74da];}});_0x15c7fd=setTimeout(function(){logger[_0xf247('0x33')](_0xf247('0x48'),_0x1e74da);endRouting(_0x1e74da,_0x2f1b0,_0x585ed6,_0x48247b);clearTimeout(_0x15c7fd);_0x21f95b['close'](!![]);_0x22ff6f[_0xf247('0x49')]();},_0x82fd8f);switch(_0x2f1b0[_0xf247('0x4a')]){case _0xf247('0x4b'):strategy[_0xf247('0x4b')](_0x21f95b,_0x2f1b0,_0x48247b,_0x585ed6);break;default:strategy['beepall'](_0x21f95b,_0x2f1b0,_0x48247b,_0x585ed6);}}else{logger['error'](_0xf247('0x4c'),_0x1e74da,_0xb0e444[_0xf247('0x2d')]);_0x22ff6f['stop']();}}}catch(_0x184120){console['log'](_0x184120);logger[_0xf247('0x30')](_0xf247('0x3d'),_0x1e74da,_0x184120[_0xf247('0x4d')]);_0x22ff6f[_0xf247('0x3f')]();}};};
\ No newline at end of file
index ab603b6..d990373 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9450=['busy','showNotification','writeLog',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','busyQueue','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel'];(function(_0x33e533,_0x4a2bc8){var _0x225dd1=function(_0x481c49){while(--_0x481c49){_0x33e533['push'](_0x33e533['shift']());}};_0x225dd1(++_0x4a2bc8);}(_0x9450,0x149));var _0x0945=function(_0x54aa8b,_0x3b4e67){_0x54aa8b=_0x54aa8b-0x0;var _0x11729f=_0x9450[_0x54aa8b];return _0x11729f;};'use strict';var _=require(_0x0945('0x0'));var uuid=require('uuid');var util=require(_0x0945('0x1'));var logger=require(_0x0945('0x2'))(_0x0945('0x3'));var Agent=function(_0x4d63ae,_0x44607b,_0x256aa4,_0x3b6d0f){this[_0x0945('0x4')]=uuid['v4']();this[_0x0945('0x5')]=_0x4d63ae;this[_0x0945('0x6')]=_0x44607b;this[_0x0945('0x7')]=_0x256aa4;this[_0x0945('0x3')]=_0x3b6d0f;this[_0x0945('0x5')][_0x0945('0x8')](this[_0x0945('0x9')][_0x0945('0xa')](this),this[_0x0945('0xb')][_0x0945('0xa')](this));this[_0x0945('0x5')]['on'](_0x0945('0xc'),this[_0x0945('0xb')][_0x0945('0xa')](this));this[_0x0945('0x5')]['on']('drained',this[_0x0945('0xd')][_0x0945('0xa')](this));};Agent[_0x0945('0xe')][_0x0945('0x8')]=function(){this[_0x0945('0x5')]['push'](this[_0x0945('0x9')][_0x0945('0xa')](this),this['handleTimeout'][_0x0945('0xa')](this));};Agent[_0x0945('0xe')][_0x0945('0xd')]=function(){this[_0x0945('0xb')](!![]);};Agent[_0x0945('0xe')][_0x0945('0x9')]=function(){logger['debug'](_0x0945('0xf'),this[_0x0945('0x5')]['id'],this['agent']['id']);if(_[_0x0945('0x10')](this['realtime'][_0x0945('0x11')][this[_0x0945('0x6')]['id']])){logger[_0x0945('0x12')](_0x0945('0x13'),this[_0x0945('0x5')]['id'],this[_0x0945('0x6')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this['routing'][_0x0945('0x14')]||util[_0x0945('0x15')](this[_0x0945('0x5')]['id'],this[_0x0945('0x7')]['agents'][this[_0x0945('0x6')]['id']],this[_0x0945('0x5')][_0x0945('0x16')],![])){this['realtime'][_0x0945('0x11')][this[_0x0945('0x6')]['id']][_0x0945('0x17')]=!![];this['realtime'][_0x0945('0x11')][this[_0x0945('0x6')]['id']]['busyQueue']=undefined;util[_0x0945('0x18')](this[_0x0945('0x4')],this['squeue']['id'],this[_0x0945('0x7')][_0x0945('0x11')][this[_0x0945('0x6')]['id']],null,this['routing']);util[_0x0945('0x19')](this[_0x0945('0x5')]['id'],this['realtime'][_0x0945('0x11')][this[_0x0945('0x6')]['id']],'RINGING'+(this['routing'][_0x0945('0x14')]?_0x0945('0x1a'):''));}else{logger['debug']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x0945('0x5')]['id'],this[_0x0945('0x6')]['id']);setTimeout(this[_0x0945('0x8')][_0x0945('0xa')](this),0x3e8);}}};Agent['prototype'][_0x0945('0xb')]=function(_0x2586d7){if(_[_0x0945('0x10')](this[_0x0945('0x7')]['agents'][this[_0x0945('0x6')]['id']])){return logger['debug'](_0x0945('0x13'),this['squeue']['id'],this[_0x0945('0x6')]['id']);}else{logger['debug'](_0x0945('0x1b'),this[_0x0945('0x5')]['id'],this[_0x0945('0x6')]['id']);util['hideNotification'](this['notificationId'],this[_0x0945('0x5')]['id'],this[_0x0945('0x7')][_0x0945('0x11')][this['agent']['id']],null,this[_0x0945('0x3')]);this[_0x0945('0x7')][_0x0945('0x11')][this[_0x0945('0x6')]['id']]['busy']=![];this[_0x0945('0x7')][_0x0945('0x11')][this[_0x0945('0x6')]['id']][_0x0945('0x1c')]=undefined;util[_0x0945('0x19')](this[_0x0945('0x5')]['id'],this[_0x0945('0x7')][_0x0945('0x11')][this[_0x0945('0x6')]['id']],_0x2586d7?_0x0945('0x1d'):_0x0945('0x1e'));}if(!_0x2586d7){setTimeout(this[_0x0945('0x8')][_0x0945('0xa')](this),0x3e8);}};function agent(_0x4ba1a2,_0x454180,_0x4776a2,_0xa8096c){return new Agent(_0x4ba1a2,_0x454180,_0x4776a2,_0xa8096c);}module[_0x0945('0x1f')]=agent;
\ No newline at end of file
+var _0x2e60=['drained','handleDrained','prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','realtime','channel','busyQueue','writeLog','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','STOP','exports','uuid','routing','notificationId','squeue','push','handleRun','bind','handleTimeout','timeout'];(function(_0x4f0f6b,_0xbf181a){var _0x178803=function(_0x506416){while(--_0x506416){_0x4f0f6b['push'](_0x4f0f6b['shift']());}};_0x178803(++_0xbf181a);}(_0x2e60,0xfc));var _0x02e6=function(_0x5bd39c,_0x387b6a){_0x5bd39c=_0x5bd39c-0x0;var _0x11bda6=_0x2e60[_0x5bd39c];return _0x11bda6;};'use strict';var _=require('lodash');var uuid=require(_0x02e6('0x0'));var util=require('./util');var logger=require('../../../../../config/logger')(_0x02e6('0x1'));var Agent=function(_0xbb692d,_0x1cfb60,_0x2c34e3,_0x8d9867){this[_0x02e6('0x2')]=uuid['v4']();this[_0x02e6('0x3')]=_0xbb692d;this['agent']=_0x1cfb60;this['realtime']=_0x2c34e3;this[_0x02e6('0x1')]=_0x8d9867;this[_0x02e6('0x3')][_0x02e6('0x4')](this[_0x02e6('0x5')][_0x02e6('0x6')](this),this[_0x02e6('0x7')][_0x02e6('0x6')](this));this[_0x02e6('0x3')]['on'](_0x02e6('0x8'),this['handleTimeout'][_0x02e6('0x6')](this));this['squeue']['on'](_0x02e6('0x9'),this[_0x02e6('0xa')]['bind'](this));};Agent[_0x02e6('0xb')][_0x02e6('0x4')]=function(){this['squeue'][_0x02e6('0x4')](this[_0x02e6('0x5')][_0x02e6('0x6')](this),this[_0x02e6('0x7')][_0x02e6('0x6')](this));};Agent[_0x02e6('0xb')][_0x02e6('0xa')]=function(){this[_0x02e6('0x7')](!![]);};Agent[_0x02e6('0xb')]['handleRun']=function(){logger[_0x02e6('0xc')](_0x02e6('0xd'),this[_0x02e6('0x3')]['id'],this[_0x02e6('0xe')]['id']);if(_[_0x02e6('0xf')](this['realtime'][_0x02e6('0x10')][this[_0x02e6('0xe')]['id']])){logger[_0x02e6('0xc')](_0x02e6('0x11'),this[_0x02e6('0x3')]['id'],this[_0x02e6('0xe')]['id']);setTimeout(this[_0x02e6('0x4')]['bind'](this),0x3e8);}else{if(this[_0x02e6('0x1')][_0x02e6('0x12')]||util[_0x02e6('0x13')](this[_0x02e6('0x3')]['id'],this[_0x02e6('0x14')]['agents'][this['agent']['id']],this['squeue'][_0x02e6('0x15')],![])){this['realtime'][_0x02e6('0x10')][this[_0x02e6('0xe')]['id']]['busy']=!![];this[_0x02e6('0x14')][_0x02e6('0x10')][this[_0x02e6('0xe')]['id']][_0x02e6('0x16')]=undefined;util['showNotification'](this[_0x02e6('0x2')],this['squeue']['id'],this['realtime'][_0x02e6('0x10')][this[_0x02e6('0xe')]['id']],null,this['routing']);util[_0x02e6('0x17')](this[_0x02e6('0x3')]['id'],this[_0x02e6('0x14')][_0x02e6('0x10')][this['agent']['id']],'RINGING'+(this[_0x02e6('0x1')]['forcedOwnership']?':FORCED':''));}else{logger[_0x02e6('0xc')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x02e6('0x3')]['id'],this[_0x02e6('0xe')]['id']);setTimeout(this['push'][_0x02e6('0x6')](this),0x3e8);}}};Agent[_0x02e6('0xb')][_0x02e6('0x7')]=function(_0x218a24){if(_[_0x02e6('0xf')](this[_0x02e6('0x14')][_0x02e6('0x10')][this[_0x02e6('0xe')]['id']])){return logger[_0x02e6('0xc')](_0x02e6('0x11'),this[_0x02e6('0x3')]['id'],this[_0x02e6('0xe')]['id']);}else{logger[_0x02e6('0xc')](_0x02e6('0x18'),this[_0x02e6('0x3')]['id'],this[_0x02e6('0xe')]['id']);util[_0x02e6('0x19')](this[_0x02e6('0x2')],this[_0x02e6('0x3')]['id'],this[_0x02e6('0x14')][_0x02e6('0x10')][this['agent']['id']],null,this[_0x02e6('0x1')]);this[_0x02e6('0x14')][_0x02e6('0x10')][this[_0x02e6('0xe')]['id']][_0x02e6('0x1a')]=![];this[_0x02e6('0x14')][_0x02e6('0x10')][this[_0x02e6('0xe')]['id']][_0x02e6('0x16')]=undefined;util[_0x02e6('0x17')](this[_0x02e6('0x3')]['id'],this[_0x02e6('0x14')][_0x02e6('0x10')][this['agent']['id']],_0x218a24?_0x02e6('0x1b'):'TIMEOUT');}if(!_0x218a24){setTimeout(this[_0x02e6('0x4')][_0x02e6('0x6')](this),0x3e8);}};function agent(_0x333644,_0xdea37,_0x36b626,_0x4fc672){return new Agent(_0x333644,_0xdea37,_0x36b626,_0x4fc672);}module[_0x02e6('0x1c')]=agent;
\ No newline at end of file
index a59019b..4a1840a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2209=['name','showNotification','debug','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleRun','handleTimeout','bind','timeout','handleDrained','prototype','isNil','Agents','length','agents','isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue'];(function(_0x5b6cf1,_0x32fdcd){var _0x46278c=function(_0x53fd9b){while(--_0x53fd9b){_0x5b6cf1['push'](_0x5b6cf1['shift']());}};_0x46278c(++_0x32fdcd);}(_0x2209,0x95));var _0x9220=function(_0x3ff20c,_0x4305eb){_0x3ff20c=_0x3ff20c-0x0;var _0x374694=_0x2209[_0x3ff20c];return _0x374694;};'use strict';var _=require(_0x9220('0x0'));var uuid=require(_0x9220('0x1'));var util=require(_0x9220('0x2'));var logger=require(_0x9220('0x3'))(_0x9220('0x4'));var Beepall=function(_0x5d3fe2,_0x2b23aa,_0x5cc72c,_0x348220){this[_0x9220('0x5')]=uuid['v4']();this[_0x9220('0x6')]=_0x5d3fe2;this[_0x9220('0x7')]=_0x2b23aa;this[_0x9220('0x8')]=_0x5cc72c;this[_0x9220('0x4')]=_0x348220;this[_0x9220('0x6')][_0x9220('0x9')](this[_0x9220('0xa')]['bind'](this),this[_0x9220('0xb')][_0x9220('0xc')](this));this['squeue']['on'](_0x9220('0xd'),this[_0x9220('0xb')][_0x9220('0xc')](this));this[_0x9220('0x6')]['on']('drained',this[_0x9220('0xe')][_0x9220('0xc')](this));};Beepall[_0x9220('0xf')][_0x9220('0x9')]=function(){this[_0x9220('0x6')][_0x9220('0x9')](this[_0x9220('0xa')][_0x9220('0xc')](this),this['handleTimeout'][_0x9220('0xc')](this));};Beepall['prototype'][_0x9220('0xe')]=function(){this['handleTimeout'](!![]);};Beepall[_0x9220('0xf')]['handleRun']=function(){var _0xa13cd=!![];if(!_[_0x9220('0x10')](this[_0x9220('0x7')])&&!_[_0x9220('0x10')](this['queue'][_0x9220('0x11')])&&this[_0x9220('0x7')]['Agents']['length']>0x0){for(var _0x3c3473=0x0,_0x559581;_0x3c3473<this[_0x9220('0x7')][_0x9220('0x11')][_0x9220('0x12')];_0x3c3473+=0x1){_0x559581=this['queue'][_0x9220('0x11')][_0x3c3473]['id'];if(_[_0x9220('0x10')](this['realtime'][_0x9220('0x13')][_0x559581])){logger['debug']('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x9220('0x6')]['id'],_0x559581);}else{if(util[_0x9220('0x14')](this[_0x9220('0x6')]['id'],this[_0x9220('0x8')][_0x9220('0x13')][_0x559581],this[_0x9220('0x6')][_0x9220('0x15')],!![])){_0xa13cd=![];util[_0x9220('0x16')](this[_0x9220('0x6')]['id'],this[_0x9220('0x8')][_0x9220('0x13')][_0x559581],_0x9220('0x17'));this[_0x9220('0x8')]['agents'][_0x559581][_0x9220('0x18')]=!![];this[_0x9220('0x8')][_0x9220('0x13')][_0x559581][_0x9220('0x19')]=this['queue'][_0x9220('0x1a')];util[_0x9220('0x1b')](this[_0x9220('0x5')],this[_0x9220('0x6')]['id'],this[_0x9220('0x8')][_0x9220('0x13')][_0x559581],this['queue'],this[_0x9220('0x4')]);}}}if(_0xa13cd){logger[_0x9220('0x1c')](_0x9220('0x1d'),this[_0x9220('0x6')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}else{logger[_0x9220('0x1c')](_0x9220('0x1e'),this[_0x9220('0x6')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}};Beepall[_0x9220('0xf')][_0x9220('0xb')]=function(_0x51cf57){if(!_[_0x9220('0x10')](this[_0x9220('0x7')])&&!_[_0x9220('0x10')](this['queue'][_0x9220('0x11')])){for(var _0x21376b=0x0,_0x1e23d1;_0x21376b<this[_0x9220('0x7')][_0x9220('0x11')][_0x9220('0x12')];_0x21376b+=0x1){_0x1e23d1=this[_0x9220('0x7')][_0x9220('0x11')][_0x21376b]['id'];if(_[_0x9220('0x10')](this[_0x9220('0x8')]['agents'][_0x1e23d1])){logger[_0x9220('0x1c')](_0x9220('0x1f'),this['squeue']['id'],_0x1e23d1);}else{util['hideNotification'](this[_0x9220('0x5')],this['squeue']['id'],this[_0x9220('0x8')][_0x9220('0x13')][_0x1e23d1],this[_0x9220('0x7')],this[_0x9220('0x4')]);util[_0x9220('0x16')](this[_0x9220('0x6')]['id'],this['realtime'][_0x9220('0x13')][_0x1e23d1],_0x51cf57?_0x9220('0x20'):_0x9220('0x21'));this[_0x9220('0x8')][_0x9220('0x13')][_0x1e23d1][_0x9220('0x18')]=![];this[_0x9220('0x8')]['agents'][_0x1e23d1]['busyQueue']=undefined;}}}if(!_0x51cf57){setTimeout(this['push'][_0x9220('0xc')](this),0x3e8);}};function beepall(_0x4b1245,_0x2a92aa,_0xb61cff,_0x29122d){return new Beepall(_0x4b1245,_0x2a92aa,_0xb61cff,_0x29122d);}module[_0x9220('0x22')]=beepall;
\ No newline at end of file
+var _0xb544=['busy','name','showNotification','debug','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','TIMEOUT','busyQueue','./util','../../../../../config/logger','routing','notificationId','squeue','handleRun','handleTimeout','bind','timeout','drained','handleDrained','push','prototype','queue','length','Agents','isNil','realtime','agents','isAgentAvailable','channel','writeLog','RINGING'];(function(_0x3ae989,_0x6a16d8){var _0x9e1c4c=function(_0x15a429){while(--_0x15a429){_0x3ae989['push'](_0x3ae989['shift']());}};_0x9e1c4c(++_0x6a16d8);}(_0xb544,0xd0));var _0x4b54=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xb544[_0x3d42d8];return _0x27fc41;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0x4b54('0x0'));var logger=require(_0x4b54('0x1'))(_0x4b54('0x2'));var Beepall=function(_0x3442ff,_0xc4666b,_0x91b153,_0x3e2f2c){this[_0x4b54('0x3')]=uuid['v4']();this['squeue']=_0x3442ff;this['queue']=_0xc4666b;this['realtime']=_0x91b153;this['routing']=_0x3e2f2c;this[_0x4b54('0x4')]['push'](this[_0x4b54('0x5')]['bind'](this),this[_0x4b54('0x6')][_0x4b54('0x7')](this));this['squeue']['on'](_0x4b54('0x8'),this[_0x4b54('0x6')][_0x4b54('0x7')](this));this[_0x4b54('0x4')]['on'](_0x4b54('0x9'),this[_0x4b54('0xa')][_0x4b54('0x7')](this));};Beepall['prototype'][_0x4b54('0xb')]=function(){this[_0x4b54('0x4')][_0x4b54('0xb')](this['handleRun'][_0x4b54('0x7')](this),this[_0x4b54('0x6')]['bind'](this));};Beepall[_0x4b54('0xc')][_0x4b54('0xa')]=function(){this['handleTimeout'](!![]);};Beepall[_0x4b54('0xc')][_0x4b54('0x5')]=function(){var _0x4c0911=!![];if(!_['isNil'](this[_0x4b54('0xd')])&&!_['isNil'](this[_0x4b54('0xd')]['Agents'])&&this[_0x4b54('0xd')]['Agents'][_0x4b54('0xe')]>0x0){for(var _0x4d8aa7=0x0,_0x47a376;_0x4d8aa7<this[_0x4b54('0xd')]['Agents'][_0x4b54('0xe')];_0x4d8aa7+=0x1){_0x47a376=this[_0x4b54('0xd')][_0x4b54('0xf')][_0x4d8aa7]['id'];if(_[_0x4b54('0x10')](this[_0x4b54('0x11')][_0x4b54('0x12')][_0x47a376])){logger['debug']('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],_0x47a376);}else{if(util[_0x4b54('0x13')](this[_0x4b54('0x4')]['id'],this['realtime'][_0x4b54('0x12')][_0x47a376],this[_0x4b54('0x4')][_0x4b54('0x14')],!![])){_0x4c0911=![];util[_0x4b54('0x15')](this[_0x4b54('0x4')]['id'],this[_0x4b54('0x11')][_0x4b54('0x12')][_0x47a376],_0x4b54('0x16'));this[_0x4b54('0x11')][_0x4b54('0x12')][_0x47a376][_0x4b54('0x17')]=!![];this['realtime'][_0x4b54('0x12')][_0x47a376]['busyQueue']=this[_0x4b54('0xd')][_0x4b54('0x18')];util[_0x4b54('0x19')](this[_0x4b54('0x3')],this['squeue']['id'],this[_0x4b54('0x11')][_0x4b54('0x12')][_0x47a376],this[_0x4b54('0xd')],this[_0x4b54('0x2')]);}}}if(_0x4c0911){logger[_0x4b54('0x1a')]('[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY',this[_0x4b54('0x4')]['id']);setTimeout(this[_0x4b54('0xb')][_0x4b54('0x7')](this),0x3e8);}}else{logger[_0x4b54('0x1a')](_0x4b54('0x1b'),this[_0x4b54('0x4')]['id']);setTimeout(this[_0x4b54('0xb')][_0x4b54('0x7')](this),0x3e8);}};Beepall[_0x4b54('0xc')][_0x4b54('0x6')]=function(_0x148779){if(!_['isNil'](this['queue'])&&!_[_0x4b54('0x10')](this[_0x4b54('0xd')][_0x4b54('0xf')])){for(var _0x4b354e=0x0,_0x24f4df;_0x4b354e<this['queue']['Agents'][_0x4b54('0xe')];_0x4b354e+=0x1){_0x24f4df=this['queue']['Agents'][_0x4b354e]['id'];if(_[_0x4b54('0x10')](this[_0x4b54('0x11')][_0x4b54('0x12')][_0x24f4df])){logger[_0x4b54('0x1a')](_0x4b54('0x1c'),this[_0x4b54('0x4')]['id'],_0x24f4df);}else{util[_0x4b54('0x1d')](this['notificationId'],this[_0x4b54('0x4')]['id'],this[_0x4b54('0x11')][_0x4b54('0x12')][_0x24f4df],this[_0x4b54('0xd')],this[_0x4b54('0x2')]);util[_0x4b54('0x15')](this[_0x4b54('0x4')]['id'],this['realtime'][_0x4b54('0x12')][_0x24f4df],_0x148779?_0x4b54('0x1e'):_0x4b54('0x1f'));this[_0x4b54('0x11')][_0x4b54('0x12')][_0x24f4df][_0x4b54('0x17')]=![];this['realtime'][_0x4b54('0x12')][_0x24f4df][_0x4b54('0x20')]=undefined;}}}if(!_0x148779){setTimeout(this['push'][_0x4b54('0x7')](this),0x3e8);}};function beepall(_0x4a7359,_0x2bc3ed,_0x21b7a9,_0x54bda3){return new Beepall(_0x4a7359,_0x2bc3ed,_0x21b7a9,_0x54bda3);}module['exports']=beepall;
\ No newline at end of file
index 14b361e..aa6be18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd930=['./agent','exports','./rrmemory','./beepall'];(function(_0x1495fc,_0x5f4236){var _0x312f23=function(_0x324651){while(--_0x324651){_0x1495fc['push'](_0x1495fc['shift']());}};_0x312f23(++_0x5f4236);}(_0xd930,0x95));var _0x0d93=function(_0x149571,_0x429c6f){_0x149571=_0x149571-0x0;var _0x5f2910=_0xd930[_0x149571];return _0x5f2910;};'use strict';module[_0x0d93('0x0')]={'rrmemory':require(_0x0d93('0x1')),'beepall':require(_0x0d93('0x2')),'agent':require(_0x0d93('0x3'))};
\ No newline at end of file
+var _0xacdf=['./beepall','exports','./rrmemory'];(function(_0x5c500b,_0x4d5cb0){var _0x131440=function(_0x4296c3){while(--_0x4296c3){_0x5c500b['push'](_0x5c500b['shift']());}};_0x131440(++_0x4d5cb0);}(_0xacdf,0xa6));var _0xfacd=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xacdf[_0x4ae6ef];return _0x3cbb4e;};'use strict';module[_0xfacd('0x0')]={'rrmemory':require(_0xfacd('0x1')),'beepall':require(_0xfacd('0x2')),'agent':require('./agent')};
\ No newline at end of file
index 99c77e2..0edf51f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd0a=['prototype','handleDrained','isAgentAvailable','agents','agentId','channel','debug','[%s][QUEUE]\x20available\x20again\x20%s','done','[%s][QUEUE]\x20try\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','busyQueue','name','showNotification','RINGING','handleCheckReject','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','TIMEOUT','lodash','./util','notificationId','squeue','queue','realtime','routing','intervals','push','handleRun','bind','timeout','handleTimeout','drained'];(function(_0xe4936,_0x3cd5c0){var _0x254fee=function(_0x3a2b9f){while(--_0x3a2b9f){_0xe4936['push'](_0xe4936['shift']());}};_0x254fee(++_0x3cd5c0);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x503435,_0x214ca1){_0x503435=_0x503435-0x0;var _0x360f4b=_0xbd0a[_0x503435];return _0x360f4b;};'use strict';var rr=require('rr');var _=require(_0xabd0('0x0'));var uuid=require('uuid');var util=require(_0xabd0('0x1'));var logger=require('../../../../../config/logger')('routing');var RRMemory=function(_0x5662a9,_0x320d5f,_0x38111b,_0x41e52b){this[_0xabd0('0x2')]=uuid['v4']();this[_0xabd0('0x3')]=_0x5662a9;this[_0xabd0('0x4')]=_0x320d5f;this[_0xabd0('0x5')]=_0x38111b;this[_0xabd0('0x6')]=_0x41e52b;this[_0xabd0('0x7')]={};this['squeue'][_0xabd0('0x8')](this[_0xabd0('0x9')][_0xabd0('0xa')](this),this['handleTimeout'][_0xabd0('0xa')](this),this['module']);this[_0xabd0('0x3')]['on'](_0xabd0('0xb'),this[_0xabd0('0xc')][_0xabd0('0xa')](this));this['squeue']['on'](_0xabd0('0xd'),this['handleDrained'][_0xabd0('0xa')](this));};RRMemory[_0xabd0('0xe')][_0xabd0('0x8')]=function(){this[_0xabd0('0x3')][_0xabd0('0x8')](this[_0xabd0('0x9')]['bind'](this),this[_0xabd0('0xc')]['bind'](this));};RRMemory[_0xabd0('0xe')][_0xabd0('0xf')]=function(){this['handleTimeout'](!![]);};RRMemory['prototype']['handleCheckReject']=function(_0x53acfc){if(util[_0xabd0('0x10')](this[_0xabd0('0x3')]['id'],this[_0xabd0('0x5')][_0xabd0('0x11')][this[_0xabd0('0x12')]],this[_0xabd0('0x3')][_0xabd0('0x13')],!![])){logger[_0xabd0('0x14')](_0xabd0('0x15'),this['squeue']['id'],this[_0xabd0('0x12')]);clearInterval(this['intervals'][this['agentId']]);_0x53acfc[_0xabd0('0x16')]();setTimeout(this[_0xabd0('0x8')][_0xabd0('0xa')](this),0x3e8);}};RRMemory[_0xabd0('0xe')]['handleRun']=function(_0x862492){this[_0xabd0('0x12')]=rr(this['queue']['mapAgentsId']);logger[_0xabd0('0x14')](_0xabd0('0x17'),this['squeue']['id'],this[_0xabd0('0x12')]);if(_[_0xabd0('0x18')](this[_0xabd0('0x5')][_0xabd0('0x11')][this['agentId']])){logger[_0xabd0('0x14')](_0xabd0('0x19'),this[_0xabd0('0x3')]['id'],this[_0xabd0('0x12')]);_0x862492[_0xabd0('0x16')]();setTimeout(this[_0xabd0('0x8')][_0xabd0('0xa')](this),0x3e8);}else{if(util[_0xabd0('0x10')](this[_0xabd0('0x3')]['id'],this[_0xabd0('0x5')]['agents'][this[_0xabd0('0x12')]],this[_0xabd0('0x3')][_0xabd0('0x13')],!![])){this[_0xabd0('0x5')][_0xabd0('0x11')][this[_0xabd0('0x12')]][_0xabd0('0x1a')]=!![];this[_0xabd0('0x5')][_0xabd0('0x11')][this[_0xabd0('0x12')]][_0xabd0('0x1b')]=this[_0xabd0('0x4')][_0xabd0('0x1c')];util[_0xabd0('0x1d')](this[_0xabd0('0x2')],this[_0xabd0('0x3')]['id'],this['realtime'][_0xabd0('0x11')][this[_0xabd0('0x12')]],this[_0xabd0('0x4')],this[_0xabd0('0x6')]);util['writeLog'](this[_0xabd0('0x3')]['id'],this[_0xabd0('0x5')][_0xabd0('0x11')][this['agentId']],_0xabd0('0x1e'));this[_0xabd0('0x7')][this['agentId']]=setInterval(this[_0xabd0('0x1f')]['bind'](this,_0x862492),0x3e8);}else{logger[_0xabd0('0x14')](_0xabd0('0x20'),this[_0xabd0('0x3')]['id'],this[_0xabd0('0x12')]);_0x862492[_0xabd0('0x16')]();setTimeout(this[_0xabd0('0x8')]['bind'](this),0x3e8);}}};RRMemory[_0xabd0('0xe')][_0xabd0('0xc')]=function(_0x4018a3){logger[_0xabd0('0x14')](_0xabd0('0x21'),this[_0xabd0('0x3')]['id'],this[_0xabd0('0x12')]);if(_[_0xabd0('0x18')](this[_0xabd0('0x5')][_0xabd0('0x11')][this[_0xabd0('0x12')]])){logger[_0xabd0('0x14')](_0xabd0('0x19'),this[_0xabd0('0x3')]['id'],this[_0xabd0('0x12')]);}else{clearInterval(this['intervals'][this['agentId']]);util['hideNotification'](this[_0xabd0('0x2')],this[_0xabd0('0x3')]['id'],this[_0xabd0('0x5')][_0xabd0('0x11')][this[_0xabd0('0x12')]],this['queue'],this['routing']);util['writeLog'](this[_0xabd0('0x3')]['id'],this['realtime'][_0xabd0('0x11')][this[_0xabd0('0x12')]],_0xabd0('0x22'));this[_0xabd0('0x5')][_0xabd0('0x11')][this[_0xabd0('0x12')]][_0xabd0('0x1a')]=![];this[_0xabd0('0x5')]['agents'][this[_0xabd0('0x12')]]['busyQueue']=undefined;}if(!_0x4018a3){setTimeout(this['push'][_0xabd0('0xa')](this),0x3e8);}};function rrmemory(_0x2841f2,_0xea7d59,_0x3176c0,_0x1b8687){return new RRMemory(_0x2841f2,_0xea7d59,_0x3176c0,_0x1b8687);}module['exports']=rrmemory;
\ No newline at end of file
+var _0xf811=['../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleRun','handleTimeout','bind','drained','handleDrained','prototype','handleCheckReject','agentId','channel','debug','intervals','done','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busy','busyQueue','name','showNotification','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','exports','lodash','uuid','./util'];(function(_0x311434,_0x272cac){var _0x5eef90=function(_0x4728b4){while(--_0x4728b4){_0x311434['push'](_0x311434['shift']());}};_0x5eef90(++_0x272cac);}(_0xf811,0x6f));var _0x1f81=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xf811[_0x6cf19c];return _0xce14f3;};'use strict';var rr=require('rr');var _=require(_0x1f81('0x0'));var uuid=require(_0x1f81('0x1'));var util=require(_0x1f81('0x2'));var logger=require(_0x1f81('0x3'))(_0x1f81('0x4'));var RRMemory=function(_0x127e28,_0x3f406e,_0x1650f4,_0x18f178){this[_0x1f81('0x5')]=uuid['v4']();this[_0x1f81('0x6')]=_0x127e28;this[_0x1f81('0x7')]=_0x3f406e;this[_0x1f81('0x8')]=_0x1650f4;this[_0x1f81('0x4')]=_0x18f178;this['intervals']={};this[_0x1f81('0x6')][_0x1f81('0x9')](this[_0x1f81('0xa')]['bind'](this),this[_0x1f81('0xb')][_0x1f81('0xc')](this),this['module']);this[_0x1f81('0x6')]['on']('timeout',this[_0x1f81('0xb')][_0x1f81('0xc')](this));this[_0x1f81('0x6')]['on'](_0x1f81('0xd'),this[_0x1f81('0xe')][_0x1f81('0xc')](this));};RRMemory[_0x1f81('0xf')][_0x1f81('0x9')]=function(){this[_0x1f81('0x6')][_0x1f81('0x9')](this[_0x1f81('0xa')][_0x1f81('0xc')](this),this[_0x1f81('0xb')][_0x1f81('0xc')](this));};RRMemory[_0x1f81('0xf')][_0x1f81('0xe')]=function(){this['handleTimeout'](!![]);};RRMemory[_0x1f81('0xf')][_0x1f81('0x10')]=function(_0x576001){if(util['isAgentAvailable'](this[_0x1f81('0x6')]['id'],this[_0x1f81('0x8')]['agents'][this[_0x1f81('0x11')]],this[_0x1f81('0x6')][_0x1f81('0x12')],!![])){logger[_0x1f81('0x13')]('[%s][QUEUE]\x20available\x20again\x20%s',this['squeue']['id'],this[_0x1f81('0x11')]);clearInterval(this[_0x1f81('0x14')][this['agentId']]);_0x576001[_0x1f81('0x15')]();setTimeout(this['push'][_0x1f81('0xc')](this),0x3e8);}};RRMemory[_0x1f81('0xf')][_0x1f81('0xa')]=function(_0x4beeae){this[_0x1f81('0x11')]=rr(this[_0x1f81('0x7')][_0x1f81('0x16')]);logger[_0x1f81('0x13')](_0x1f81('0x17'),this[_0x1f81('0x6')]['id'],this['agentId']);if(_[_0x1f81('0x18')](this[_0x1f81('0x8')][_0x1f81('0x19')][this['agentId']])){logger['debug'](_0x1f81('0x1a'),this['squeue']['id'],this[_0x1f81('0x11')]);_0x4beeae['done']();setTimeout(this['push'][_0x1f81('0xc')](this),0x3e8);}else{if(util['isAgentAvailable'](this[_0x1f81('0x6')]['id'],this['realtime'][_0x1f81('0x19')][this[_0x1f81('0x11')]],this[_0x1f81('0x6')][_0x1f81('0x12')],!![])){this[_0x1f81('0x8')][_0x1f81('0x19')][this[_0x1f81('0x11')]][_0x1f81('0x1b')]=!![];this[_0x1f81('0x8')][_0x1f81('0x19')][this['agentId']][_0x1f81('0x1c')]=this['queue'][_0x1f81('0x1d')];util[_0x1f81('0x1e')](this['notificationId'],this[_0x1f81('0x6')]['id'],this[_0x1f81('0x8')][_0x1f81('0x19')][this[_0x1f81('0x11')]],this[_0x1f81('0x7')],this[_0x1f81('0x4')]);util[_0x1f81('0x1f')](this[_0x1f81('0x6')]['id'],this['realtime'][_0x1f81('0x19')][this[_0x1f81('0x11')]],_0x1f81('0x20'));this[_0x1f81('0x14')][this[_0x1f81('0x11')]]=setInterval(this[_0x1f81('0x10')][_0x1f81('0xc')](this,_0x4beeae),0x3e8);}else{logger[_0x1f81('0x13')](_0x1f81('0x21'),this[_0x1f81('0x6')]['id'],this[_0x1f81('0x11')]);_0x4beeae['done']();setTimeout(this[_0x1f81('0x9')][_0x1f81('0xc')](this),0x3e8);}}};RRMemory[_0x1f81('0xf')][_0x1f81('0xb')]=function(_0x5e591a){logger[_0x1f81('0x13')](_0x1f81('0x22'),this[_0x1f81('0x6')]['id'],this['agentId']);if(_['isNil'](this[_0x1f81('0x8')]['agents'][this[_0x1f81('0x11')]])){logger['debug'](_0x1f81('0x1a'),this[_0x1f81('0x6')]['id'],this[_0x1f81('0x11')]);}else{clearInterval(this[_0x1f81('0x14')][this[_0x1f81('0x11')]]);util[_0x1f81('0x23')](this[_0x1f81('0x5')],this['squeue']['id'],this[_0x1f81('0x8')]['agents'][this[_0x1f81('0x11')]],this[_0x1f81('0x7')],this['routing']);util[_0x1f81('0x1f')](this[_0x1f81('0x6')]['id'],this[_0x1f81('0x8')]['agents'][this[_0x1f81('0x11')]],_0x1f81('0x24'));this[_0x1f81('0x8')][_0x1f81('0x19')][this[_0x1f81('0x11')]]['busy']=![];this[_0x1f81('0x8')][_0x1f81('0x19')][this['agentId']]['busyQueue']=undefined;}if(!_0x5e591a){setTimeout(this['push'][_0x1f81('0xc')](this),0x3e8);}};function rrmemory(_0x43e8d4,_0x500b32,_0x4eb018,_0x4ec05c){return new RRMemory(_0x43e8d4,_0x500b32,_0x4eb018,_0x4ec05c);}module[_0x1f81('0x25')]=rrmemory;
\ No newline at end of file
index 4727577..90ea246 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1f=['user:save','\x20interaction','notificationSound','account','body','queue','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','notification:%s','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','name','isAgentAvailable','busy','BUSY','online','Pause','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','hideNotification','lodash','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','format','user:%s','emit'];(function(_0x5aacc8,_0x405af7){var _0x32fb1e=function(_0x44751d){while(--_0x44751d){_0x5aacc8['push'](_0x5aacc8['shift']());}};_0x32fb1e(++_0x405af7);}(_0xed1f,0x6a));var _0xfed1=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xed1f[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var utils=require(_0xfed1('0x2'));var Redis=require(_0xfed1('0x3'));var config=require(_0xfed1('0x4'));var logger=require(_0xfed1('0x5'))(_0xfed1('0x6'));config[_0xfed1('0x7')]=_[_0xfed1('0x8')](config[_0xfed1('0x7')],{'host':_0xfed1('0x9'),'port':0x18eb});var io=require(_0xfed1('0xa'))(new Redis(config[_0xfed1('0x7')]));function sendNotification(_0x42751d,_0x380e18,_0x612b38,_0x2a6082,_0x2967ef,_0x568d48){io['to'](util[_0xfed1('0xb')](_0xfed1('0xc'),_0x2a6082['name']))[_0xfed1('0xd')](_0xfed1('0xe'),_0x2a6082);var _0x4a564e=_0x568d48||{};var _0x3ce017=_0x612b38['split']('.');var _0x1c3f40={'uniqueid':_0x380e18,'channel':_0x3ce017[0x0],'id':_0x3ce017[0x1],'title':_0x3ce017[0x0]+_0xfed1('0xf'),'interactionId':_0x3ce017[0x2],'queue':_0x2967ef?_0x2967ef['name']:null,'sound':_0x4a564e['account'][_0xfed1('0x10')],'shake':_0x4a564e[_0xfed1('0x11')]['notificationShake']};try{if(!_0x4a564e[_0xfed1('0x12')]){_0x4a564e['body']={};}if(_0x2967ef){_0x4a564e['body'][_0xfed1('0x13')]=_0x2967ef;}else if(_0x4a564e[_0xfed1('0x12')]['queue']){delete _0x4a564e[_0xfed1('0x12')]['queue'];}_0x1c3f40['msg']=utils[_0xfed1('0x14')](_0x4a564e[_0xfed1('0x11')][_0xfed1('0x15')],_0x4a564e);}catch(_0x123c46){_0x1c3f40['msg']=_0xfed1('0x16');logger['error'](util[_0xfed1('0xb')](_0xfed1('0x17'),_0x380e18,_0x123c46['message']));}io['to'](util[_0xfed1('0xb')](_0xfed1('0xc'),_0x2a6082['name']))['emit'](util['format'](_0xfed1('0x18'),_0x42751d?'save':_0xfed1('0x19')),_0x1c3f40);}function writeLog(_0x34fa04,_0x51a860,_0x94cb84){return logger[_0xfed1('0x1a')](util['format'](_0xfed1('0x1b'),_0x34fa04,_0x51a860[_0xfed1('0x1c')],_0x94cb84));}exports[_0xfed1('0x1d')]=function(_0x92b92d,_0x4bac79,_0x203cec,_0x59333e){if(_0x4bac79[_0xfed1('0x1e')]){writeLog(_0x92b92d,_0x4bac79,_0xfed1('0x1f'));return![];}if(!_0x4bac79[_0xfed1('0x20')]){writeLog(_0x92b92d,_0x4bac79,'OFFLINE');return![];}if(_0x4bac79[_0x203cec+_0xfed1('0x21')]){writeLog(_0x92b92d,_0x4bac79,'PAUSE');return![];}if(_0x59333e&&_0x4bac79[_0xfed1('0x22')](_0x203cec+_0xfed1('0x23'))&&_0x4bac79[_0xfed1('0x22')](_0x203cec+_0xfed1('0x24'))){if(_0x4bac79[_0x203cec+_0xfed1('0x23')]>0x0&&_0x4bac79[_0x203cec+_0xfed1('0x24')]>=_0x4bac79[_0x203cec+'Capacity']){writeLog(_0x92b92d,_0x4bac79,_0x203cec[_0xfed1('0x25')]()+_0xfed1('0x26'));return![];}}return!![];};exports['showNotification']=function(_0x1d6c72,_0x2b9dd2,_0x1b871a,_0x1d62c5,_0x3b9122){return sendNotification(!![],_0x1d6c72,_0x2b9dd2,_0x1b871a,_0x1d62c5,_0x3b9122);};exports[_0xfed1('0x27')]=function(_0x583953,_0x4607e9,_0x5a4451,_0x3106ee,_0x4e5249){return sendNotification(![],_0x583953,_0x4607e9,_0x5a4451,_0x3106ee,_0x4e5249);};exports['writeLog']=writeLog;
\ No newline at end of file
+var _0xeda8=['debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','name','busy','BUSY','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','util','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','format','split','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','error','[%s][QUEUE]\x20%s','user:%s','notification:%s','save','remove'];(function(_0x15b086,_0x209ce4){var _0x32e24d=function(_0x3b4f11){while(--_0x3b4f11){_0x15b086['push'](_0x15b086['shift']());}};_0x32e24d(++_0x209ce4);}(_0xeda8,0x104));var _0x8eda=function(_0x4adb14,_0x523aa0){_0x4adb14=_0x4adb14-0x0;var _0x34f325=_0xeda8[_0x4adb14];return _0x34f325;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var utils=require('../utils');var Redis=require(_0x8eda('0x2'));var config=require(_0x8eda('0x3'));var logger=require(_0x8eda('0x4'))(_0x8eda('0x5'));config[_0x8eda('0x6')]=_[_0x8eda('0x7')](config[_0x8eda('0x6')],{'host':_0x8eda('0x8'),'port':0x18eb});var io=require(_0x8eda('0x9'))(new Redis(config[_0x8eda('0x6')]));function sendNotification(_0x349361,_0x32abe8,_0x4e2ebb,_0x28b721,_0x1b6a1d,_0x5aa93d){io['to'](util[_0x8eda('0xa')]('user:%s',_0x28b721['name']))['emit']('user:save',_0x28b721);var _0xe69181=_0x5aa93d||{};var _0x2d3739=_0x4e2ebb[_0x8eda('0xb')]('.');var _0x515c63={'uniqueid':_0x32abe8,'channel':_0x2d3739[0x0],'id':_0x2d3739[0x1],'title':_0x2d3739[0x0]+_0x8eda('0xc'),'interactionId':_0x2d3739[0x2],'queue':_0x1b6a1d?_0x1b6a1d['name']:null,'sound':_0xe69181[_0x8eda('0xd')][_0x8eda('0xe')],'shake':_0xe69181[_0x8eda('0xd')][_0x8eda('0xf')]};try{if(!_0xe69181[_0x8eda('0x10')]){_0xe69181[_0x8eda('0x10')]={};}if(_0x1b6a1d){_0xe69181[_0x8eda('0x10')][_0x8eda('0x11')]=_0x1b6a1d;}else if(_0xe69181['body']['queue']){delete _0xe69181[_0x8eda('0x10')][_0x8eda('0x11')];}_0x515c63['msg']=utils[_0x8eda('0x12')](_0xe69181[_0x8eda('0xd')][_0x8eda('0x13')],_0xe69181);}catch(_0x56ff8a){_0x515c63[_0x8eda('0x14')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x8eda('0x15')](util['format'](_0x8eda('0x16'),_0x32abe8,_0x56ff8a['message']));}io['to'](util[_0x8eda('0xa')](_0x8eda('0x17'),_0x28b721['name']))['emit'](util[_0x8eda('0xa')](_0x8eda('0x18'),_0x349361?_0x8eda('0x19'):_0x8eda('0x1a')),_0x515c63);}function writeLog(_0x110f36,_0x1b46ee,_0x4fb4ee){return logger[_0x8eda('0x1b')](util[_0x8eda('0xa')](_0x8eda('0x1c'),_0x110f36,_0x1b46ee[_0x8eda('0x1d')],_0x4fb4ee));}exports['isAgentAvailable']=function(_0x33143e,_0x4f8483,_0x45517e,_0x5183bc){if(_0x4f8483[_0x8eda('0x1e')]){writeLog(_0x33143e,_0x4f8483,_0x8eda('0x1f'));return![];}if(!_0x4f8483['online']){writeLog(_0x33143e,_0x4f8483,'OFFLINE');return![];}if(_0x4f8483[_0x45517e+'Pause']){writeLog(_0x33143e,_0x4f8483,_0x8eda('0x20'));return![];}if(_0x5183bc&&_0x4f8483[_0x8eda('0x21')](_0x45517e+'Capacity')&&_0x4f8483[_0x8eda('0x21')](_0x45517e+_0x8eda('0x22'))){if(_0x4f8483[_0x45517e+'Capacity']>0x0&&_0x4f8483[_0x45517e+_0x8eda('0x22')]>=_0x4f8483[_0x45517e+_0x8eda('0x23')]){writeLog(_0x33143e,_0x4f8483,_0x45517e[_0x8eda('0x24')]()+_0x8eda('0x25'));return![];}}return!![];};exports[_0x8eda('0x26')]=function(_0x5c8488,_0x41b5a9,_0x5a8bed,_0x35310c,_0x2e8b2b){return sendNotification(!![],_0x5c8488,_0x41b5a9,_0x5a8bed,_0x35310c,_0x2e8b2b);};exports[_0x8eda('0x27')]=function(_0x567f69,_0x23e892,_0x244400,_0x1dd12,_0x4cdd2e){return sendNotification(![],_0x567f69,_0x23e892,_0x244400,_0x1dd12,_0x4cdd2e);};exports[_0x8eda('0x28')]=writeLog;
\ No newline at end of file
index 3772a5b..63ff9df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3df4=['lodash','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','exec','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','shelljs'];(function(_0x37b74f,_0x260fce){var _0x35f223=function(_0x1fe893){while(--_0x1fe893){_0x37b74f['push'](_0x37b74f['shift']());}};_0x35f223(++_0x260fce);}(_0x3df4,0x137));var _0x43df=function(_0xd6cd6c,_0xb2760f){_0xd6cd6c=_0xd6cd6c-0x0;var _0x416d1c=_0x3df4[_0xd6cd6c];return _0x416d1c;};'use strict';var schema=require('validate');var sh=require(_0x43df('0x0'));var _=require(_0x43df('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x43df('0x2'));var system=schema({'command':{'type':_0x43df('0x3'),'required':!![],'message':_0x43df('0x4')}});exports[_0x43df('0x5')]=function(_0x3bf8af,_0x3b612b){return function(_0x13492b){try{var _0x469cc5={'command':_0x3b612b[0x0]};var _0x4bcdd4=system[_0x43df('0x6')](_0x469cc5,{'typecast':!![]});if(_0x4bcdd4[_0x43df('0x7')]){logger[_0x43df('0x8')](_0x43df('0x9'),_0x3bf8af,_[_0x43df('0xa')](_0x4bcdd4,_0x43df('0xb'))[_0x43df('0xc')](',\x20'));logger[_0x43df('0xd')](_0x43df('0xe'),_0x3bf8af);_0x13492b[_0x43df('0xf')]();}else{var _0x2ed825=this;var _0xeece08=utils[_0x43df('0x10')](_0x3b612b[0x0],this);logger[_0x43df('0xd')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x3bf8af,_0xeece08);sh[_0x43df('0x11')](_[_0x43df('0x12')](_0xeece08),function(_0x32116b,_0x190b37){logger[_0x43df('0xd')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x3bf8af,_0x32116b);if(_0x32116b==0x0){var _0x576c5c=_0x190b37[_0x43df('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x43df('0x14')](_0x3b612b[0x1])||_[_0x43df('0x15')](_0x3b612b[0x1])){logger[_0x43df('0xd')](_0x43df('0x16'),_0x3bf8af);_0x2ed825[_0x43df('0x17')][_0x3b612b[0x1]]=_0x576c5c;}else{logger[_0x43df('0xd')](_0x43df('0x18'),_0x3bf8af,_0x3b612b[0x1],_0x576c5c);_0x2ed825[_0x43df('0x17')][_0x3b612b[0x1]]=_0x576c5c;}}_0x13492b['next']();});}}catch(_0x1b53f8){logger['error'](_0x43df('0x9'),_0x3bf8af,_['isObject'](_0x1b53f8)?JSON[_0x43df('0x19')](_0x1b53f8):_0x1b53f8);logger[_0x43df('0xd')](_0x43df('0xe'),_0x3bf8af);_0x13492b[_0x43df('0xf')]();}};};
\ No newline at end of file
+var _0xdf71=['getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','[%s][SYSTEM]\x20no\x20variable','body','isObject','stringify','validate','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next'];(function(_0x441bcd,_0x3890b6){var _0x54619d=function(_0x4aa209){while(--_0x4aa209){_0x441bcd['push'](_0x441bcd['shift']());}};_0x54619d(++_0x3890b6);}(_0xdf71,0x1d2));var _0x1df7=function(_0x5b04a3,_0xfda4fd){_0x5b04a3=_0x5b04a3-0x0;var _0x1adf11=_0xdf71[_0x5b04a3];return _0x1adf11;};'use strict';var schema=require(_0x1df7('0x0'));var sh=require('shelljs');var _=require(_0x1df7('0x1'));var utils=require(_0x1df7('0x2'));var logger=require(_0x1df7('0x3'))(_0x1df7('0x4'));var system=schema({'command':{'type':_0x1df7('0x5'),'required':!![],'message':_0x1df7('0x6')}});exports[_0x1df7('0x7')]=function(_0x570cbd,_0xc9e362){return function(_0x3297c0){try{var _0x4bc4a8={'command':_0xc9e362[0x0]};var _0x508a68=system[_0x1df7('0x0')](_0x4bc4a8,{'typecast':!![]});if(_0x508a68[_0x1df7('0x8')]){logger['error'](_0x1df7('0x9'),_0x570cbd,_['map'](_0x508a68,_0x1df7('0xa'))[_0x1df7('0xb')](',\x20'));logger[_0x1df7('0xc')](_0x1df7('0xd'),_0x570cbd);_0x3297c0['next']();}else{var _0x3bc01a=this;var _0x3e44fd=utils[_0x1df7('0xe')](_0xc9e362[0x0],this);logger[_0x1df7('0xc')](_0x1df7('0xf'),_0x570cbd,_0x3e44fd);sh[_0x1df7('0x10')](_['trim'](_0x3e44fd),function(_0x3744d0,_0x533620){logger[_0x1df7('0xc')](_0x1df7('0x11'),_0x570cbd,_0x3744d0);if(_0x3744d0==0x0){var _0x101ba6=_0x533620[_0x1df7('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x1df7('0x13')](_0xc9e362[0x1])||_['isEmpty'](_0xc9e362[0x1])){logger[_0x1df7('0xc')](_0x1df7('0x14'),_0x570cbd);_0x3bc01a[_0x1df7('0x15')][_0xc9e362[0x1]]=_0x101ba6;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x570cbd,_0xc9e362[0x1],_0x101ba6);_0x3bc01a[_0x1df7('0x15')][_0xc9e362[0x1]]=_0x101ba6;}}_0x3297c0['next']();});}}catch(_0x10dd13){logger['error'](_0x1df7('0x9'),_0x570cbd,_[_0x1df7('0x16')](_0x10dd13)?JSON[_0x1df7('0x17')](_0x10dd13):_0x10dd13);logger[_0x1df7('0xc')](_0x1df7('0xd'),_0x570cbd);_0x3297c0['next']();}};};
\ No newline at end of file
index 9a4d485..067f18e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd08=['join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','catch','stringify','info','finally','isObject','validate','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x526fff,_0x1560e2){var _0x3aab8c=function(_0x5cd773){while(--_0x5cd773){_0x526fff['push'](_0x526fff['shift']());}};_0x3aab8c(++_0x1560e2);}(_0xdd08,0xed));var _0x8dd0=function(_0x43c8b8,_0x5e8934){_0x43c8b8=_0x43c8b8-0x0;var _0x413be3=_0xdd08[_0x43c8b8];return _0x413be3;};'use strict';var schema=require(_0x8dd0('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x8dd0('0x1')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x8dd0('0x2')),'faxInteraction':require(_0x8dd0('0x3')),'whatsappInteraction':require(_0x8dd0('0x4'))};var logger=require('../../../../config/logger')(_0x8dd0('0x5'));var tag=schema({'tag':{'type':_0x8dd0('0x6'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x8dd0('0x7')]=function(_0x520629,_0x2d1ce6,_0x5a09eb,_0x131eba){return function(_0x5d9e50){try{var _0x5935c1={'tag':_0x2d1ce6[0x0]};var _0x2bb5f6=tag[_0x8dd0('0x0')](_0x5935c1,{'typecast':!![]});if(_0x2bb5f6[_0x8dd0('0x8')]){logger[_0x8dd0('0x9')](_0x8dd0('0xa'),_0x520629,_[_0x8dd0('0xb')](_0x2bb5f6,_0x8dd0('0xc'))[_0x8dd0('0xd')](',\x20'));logger['info'](_0x8dd0('0xe'),_0x520629);_0x5d9e50[_0x8dd0('0xf')]();}else{var _0x42dd10={'ids':[_0x2d1ce6[0x0]]};if(rpc[_0x131eba[_0x8dd0('0x10')]+_0x8dd0('0x11')]){rpc[_0x131eba[_0x8dd0('0x10')]+_0x8dd0('0x11')][_0x8dd0('0x12')](_0x131eba['interaction']['id'],_0x42dd10)['then'](function(_0x391010){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x520629,_0x2d1ce6[0x1],_0x131eba['channel'],_0x131eba[_0x8dd0('0x13')]['id']);})[_0x8dd0('0x14')](function(_0x3ca75c){logger[_0x8dd0('0x9')](_0x8dd0('0xa'),_0x520629,JSON[_0x8dd0('0x15')](_0x3ca75c));logger[_0x8dd0('0x16')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x520629);})[_0x8dd0('0x17')](function(){_0x5d9e50['next']();});}}}catch(_0x5cf479){logger[_0x8dd0('0x9')](_0x8dd0('0xa'),_0x520629,_[_0x8dd0('0x18')](_0x5cf479)?JSON['stringify'](_0x5cf479):_0x5cf479);logger[_0x8dd0('0x16')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x520629);_0x5d9e50[_0x8dd0('0xf')]();}};};
\ No newline at end of file
+var _0xad5c=['[%s][TAG]\x20%s','stringify','finally','validate','lodash','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','info','next','channel','addTags','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction'];(function(_0x3b2312,_0xfe46e6){var _0x27c31e=function(_0x43af5f){while(--_0x43af5f){_0x3b2312['push'](_0x3b2312['shift']());}};_0x27c31e(++_0xfe46e6);}(_0xad5c,0x100));var _0xcad5=function(_0x685d9b,_0x22e7d2){_0x685d9b=_0x685d9b-0x0;var _0x374dab=_0xad5c[_0x685d9b];return _0x374dab;};'use strict';var schema=require(_0xcad5('0x0'));var _=require(_0xcad5('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xcad5('0x2')),'faxInteraction':require(_0xcad5('0x3')),'whatsappInteraction':require(_0xcad5('0x4'))};var logger=require('../../../../config/logger')(_0xcad5('0x5'));var tag=schema({'tag':{'type':_0xcad5('0x6'),'required':!![],'message':_0xcad5('0x7')}});exports[_0xcad5('0x8')]=function(_0x5a7542,_0x37bda9,_0x3e0aa7,_0x46ea0b){return function(_0x1a791d){try{var _0x215333={'tag':_0x37bda9[0x0]};var _0x1d021f=tag[_0xcad5('0x0')](_0x215333,{'typecast':!![]});if(_0x1d021f[_0xcad5('0x9')]){logger[_0xcad5('0xa')]('[%s][TAG]\x20%s',_0x5a7542,_[_0xcad5('0xb')](_0x1d021f,_0xcad5('0xc'))[_0xcad5('0xd')](',\x20'));logger[_0xcad5('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5a7542);_0x1a791d[_0xcad5('0xf')]();}else{var _0x458cc5={'ids':[_0x37bda9[0x0]]};if(rpc[_0x46ea0b[_0xcad5('0x10')]+'Interaction']){rpc[_0x46ea0b['channel']+'Interaction'][_0xcad5('0x11')](_0x46ea0b['interaction']['id'],_0x458cc5)['then'](function(_0x232d49){logger['info'](_0xcad5('0x12'),_0x5a7542,_0x37bda9[0x1],_0x46ea0b[_0xcad5('0x10')],_0x46ea0b[_0xcad5('0x13')]['id']);})['catch'](function(_0x1f07ce){logger[_0xcad5('0xa')](_0xcad5('0x14'),_0x5a7542,JSON[_0xcad5('0x15')](_0x1f07ce));logger[_0xcad5('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5a7542);})[_0xcad5('0x16')](function(){_0x1a791d['next']();});}}}catch(_0x3afa64){logger['error'](_0xcad5('0x14'),_0x5a7542,_['isObject'](_0x3afa64)?JSON[_0xcad5('0x15')](_0x3afa64):_0x3afa64);logger[_0xcad5('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5a7542);_0x1a791d[_0xcad5('0xf')]();}};};
\ No newline at end of file
index c2816e3..818f2b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08cb=['urlOnRing','title','jsonrpc','2.0','method','params','utf8','application/json-rpc','then','parse','logged','channelId=','&serviceId=','&sessionId=','&data=','stringify','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','routing','lodash','consequence','\x20-\x20','replace','includes','push','urlOnAnswer','?params='];(function(_0x581a60,_0x5edd11){var _0x178caa=function(_0x523c8c){while(--_0x523c8c){_0x581a60['push'](_0x581a60['shift']());}};_0x178caa(++_0x5edd11);}(_0x08cb,0x19a));var _0xb08c=function(_0x4d3b65,_0x161b34){_0x4d3b65=_0x4d3b65-0x0;var _0x59e7d5=_0x08cb[_0x4d3b65];return _0x59e7d5;};'use strict';var rp=require('request-promise');var logger=require(_0xb08c('0x0'))(_0xb08c('0x1'));var _=require(_0xb08c('0x2'));var arr=[];exports[_0xb08c('0x3')]=function(_0x2fca1d,_0xdaae13){return function(_0x33a873){var _0x57eac4=_0xdaae13[0xa];var _0x3ec76e=_0xdaae13[0xb];var _0x2813b9=_0xdaae13[0xc];var _0x3c3d4d=_0xdaae13[0xd];var _0x4c576c=_0xdaae13[0xe];var _0x2176e4=_0xdaae13[0xf]['replace'](/\n/g,_0xb08c('0x4'));var _0x4fea10=_0xdaae13[0x10][_0xb08c('0x5')](/\n/g,'\x20');if(!arr[_0xb08c('0x6')](_0x3ec76e)){arr[_0xb08c('0x7')](_0x3ec76e);var _0x31d59f=_0xdaae13[0x3];var _0x1b5608=_0xdaae13[0x4];var _0x3bf7bc=_0xdaae13[0x1];var _0x593ab6=_0xdaae13[0x0];var _0x48c4c0={};_0x48c4c0[_0xb08c('0x8')]=_0xdaae13[0x8]+_0xb08c('0x9')+_0x2813b9+'|'+_0x57eac4+'|'+_0x3c3d4d+'|'+_0x3ec76e+'|'+_0x4c576c;_0x48c4c0[_0xb08c('0xa')]=_0xdaae13[0x7]+_0xb08c('0x9')+_0x2813b9+'|'+_0x57eac4+'|'+_0x3c3d4d+'|'+_0x3ec76e+'|'+_0x4c576c+'|'+_0x2176e4+'|'+_0x4fea10;_0x48c4c0[_0xb08c('0xb')]=_0xdaae13[0x9];var _0x5dbb02={};_0x5dbb02[_0xb08c('0xc')]=_0xb08c('0xd');_0x5dbb02[_0xb08c('0xe')]='login';var _0x213eec=[];_0x213eec['push'](_0xdaae13[0x2]);_0x213eec[_0xb08c('0x7')](_0xdaae13[0x5]);_0x213eec['push'](_0xdaae13[0x6]);_0x5dbb02[_0xb08c('0xf')]=_0x213eec;_0x5dbb02['id']=0x1;var _0x4af8de=JSON['stringify'](_0x5dbb02);var _0xcba5d4={'encoding':_0xb08c('0x10'),'method':'POST','timeout':0x2710,'url':_0x31d59f,'headers':{'Content-Type':_0xb08c('0x11')},'body':_0x4af8de};return rp(_0xcba5d4)[_0xb08c('0x12')](function(_0x4d1928){const _0x1425c1=JSON[_0xb08c('0x13')](_0x4d1928);if(!_0x1425c1['result'][_0xb08c('0x14')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x298d64=_0x3ec76e;var _0x23eb90=_0xb08c('0x15')+_0x3bf7bc+_0xb08c('0x16')+_0x593ab6+_0xb08c('0x17')+_0x298d64+_0xb08c('0x18')+JSON[_0xb08c('0x19')](_0x48c4c0);var _0x2d6214=_0x1b5608+'?'+_0x23eb90;return rp(_0x2d6214);})[_0xb08c('0x12')](function(_0x4e28a2){logger[_0xb08c('0x1a')](_0xb08c('0x1b'),_0x2fca1d,_0x4e28a2);_0x33a873[_0xb08c('0x1c')]();})[_0xb08c('0x1d')](function(_0x10c72a){logger[_0xb08c('0x1e')](_0xb08c('0x1f'),_0x2fca1d,_[_0xb08c('0x20')](_0x10c72a)?JSON[_0xb08c('0x19')](_0x10c72a):_0x10c72a);_0x33a873[_0xb08c('0x1c')]();});}else{logger[_0xb08c('0x1a')](_0xb08c('0x21'),_0x2fca1d);_0x33a873[_0xb08c('0x22')]();}};};
\ No newline at end of file
+var _0x1618=['lodash','consequence','replace','\x20-\x20','includes','urlOnAnswer','?params=','title','jsonrpc','method','push','utf8','POST','application/json-rpc','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','isObject','stringify','next','request-promise','routing'];(function(_0x1a6e61,_0x218724){var _0x5b19d6=function(_0x58dd98){while(--_0x58dd98){_0x1a6e61['push'](_0x1a6e61['shift']());}};_0x5b19d6(++_0x218724);}(_0x1618,0x99));var _0x8161=function(_0x1ed555,_0x163bb2){_0x1ed555=_0x1ed555-0x0;var _0x2ade3d=_0x1618[_0x1ed555];return _0x2ade3d;};'use strict';var rp=require(_0x8161('0x0'));var logger=require('../../../../config/logger')(_0x8161('0x1'));var _=require(_0x8161('0x2'));var arr=[];exports[_0x8161('0x3')]=function(_0x5796ef,_0x3d1d89){return function(_0x3cbdb6){var _0x117c08=_0x3d1d89[0xa];var _0x2215cf=_0x3d1d89[0xb];var _0x504a83=_0x3d1d89[0xc];var _0x1e98e2=_0x3d1d89[0xd];var _0x56e972=_0x3d1d89[0xe];var _0xb8663f=_0x3d1d89[0xf][_0x8161('0x4')](/\n/g,_0x8161('0x5'));var _0x1104ba=_0x3d1d89[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x8161('0x6')](_0x2215cf)){arr['push'](_0x2215cf);var _0x4dda5c=_0x3d1d89[0x3];var _0x81f13b=_0x3d1d89[0x4];var _0x405e31=_0x3d1d89[0x1];var _0x43c34c=_0x3d1d89[0x0];var _0x37c4c2={};_0x37c4c2[_0x8161('0x7')]=_0x3d1d89[0x8]+_0x8161('0x8')+_0x504a83+'|'+_0x117c08+'|'+_0x1e98e2+'|'+_0x2215cf+'|'+_0x56e972;_0x37c4c2['urlOnRing']=_0x3d1d89[0x7]+_0x8161('0x8')+_0x504a83+'|'+_0x117c08+'|'+_0x1e98e2+'|'+_0x2215cf+'|'+_0x56e972+'|'+_0xb8663f+'|'+_0x1104ba;_0x37c4c2[_0x8161('0x9')]=_0x3d1d89[0x9];var _0x530901={};_0x530901[_0x8161('0xa')]='2.0';_0x530901[_0x8161('0xb')]='login';var _0x2ef8c9=[];_0x2ef8c9[_0x8161('0xc')](_0x3d1d89[0x2]);_0x2ef8c9[_0x8161('0xc')](_0x3d1d89[0x5]);_0x2ef8c9[_0x8161('0xc')](_0x3d1d89[0x6]);_0x530901['params']=_0x2ef8c9;_0x530901['id']=0x1;var _0x3048c2=JSON['stringify'](_0x530901);var _0x5ab557={'encoding':_0x8161('0xd'),'method':_0x8161('0xe'),'timeout':0x2710,'url':_0x4dda5c,'headers':{'Content-Type':_0x8161('0xf')},'body':_0x3048c2};return rp(_0x5ab557)[_0x8161('0x10')](function(_0x366a0d){const _0x17dfe2=JSON[_0x8161('0x11')](_0x366a0d);if(!_0x17dfe2[_0x8161('0x12')][_0x8161('0x13')]){throw new Error(_0x8161('0x14'));}var _0x2866b6=_0x2215cf;var _0x8c4ae6=_0x8161('0x15')+_0x405e31+_0x8161('0x16')+_0x43c34c+'&sessionId='+_0x2866b6+'&data='+JSON['stringify'](_0x37c4c2);var _0x21f950=_0x81f13b+'?'+_0x8c4ae6;return rp(_0x21f950);})[_0x8161('0x10')](function(_0x521022){logger[_0x8161('0x17')](_0x8161('0x18'),_0x5796ef,_0x521022);_0x3cbdb6[_0x8161('0x19')]();})[_0x8161('0x1a')](function(_0x11ca0b){logger[_0x8161('0x1b')]('[%s][TVOX]\x20%s',_0x5796ef,_[_0x8161('0x1c')](_0x11ca0b)?JSON[_0x8161('0x1d')](_0x11ca0b):_0x11ca0b);_0x3cbdb6[_0x8161('0x19')]();});}else{logger[_0x8161('0x17')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x5796ef);_0x3cbdb6[_0x8161('0x1e')]();}};};
\ No newline at end of file
index 6c07a3f..b05a74d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x242f22,_0x3d5c66){var _0x5f4186=function(_0x16928d){while(--_0x16928d){_0x242f22['push'](_0x242f22['shift']());}};_0x5f4186(++_0x3d5c66);}(_0xe706,0xa3));var _0x6e70=function(_0x28ad6c,_0x599a96){_0x28ad6c=_0x28ad6c-0x0;var _0x597de8=_0xe706[_0x28ad6c];return _0x597de8;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}};
\ No newline at end of file
+var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x43b503,_0x20cfbe){var _0x5662f3=function(_0x14be16){while(--_0x14be16){_0x43b503['push'](_0x43b503['shift']());}};_0x5662f3(++_0x20cfbe);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}};
\ No newline at end of file
index 9682406..c4bae76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['dialogflow','appdata','dialogflowv2','amazonlex','tag','TagId','tvox','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','consequence','priority','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','stringify','matchPath','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','listen','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','util','path','bluebird','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','isNil','IntervalId','map','interval','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','split','mail','push','slice'];(function(_0xca41dc,_0x22936e){var _0x3e125c=function(_0x1ef024){while(--_0x1ef024){_0xca41dc['push'](_0xca41dc['shift']());}};_0x3e125c(++_0x22936e);}(_0x54ef,0x112));var _0xf54e=function(_0xf486e8,_0xff3748){_0xf486e8=_0xf486e8-0x0;var _0x3422c6=_0x54ef[_0xf486e8];return _0x3422c6;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var path=require(_0xf54e('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xf54e('0x3'));var uuid=require(_0xf54e('0x4'));var utils=require(_0xf54e('0x5'));var config=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var rpc={'openchannelQueueReport':require(_0xf54e('0x9')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xf54e('0xa')),'faxQueueReport':require(_0xf54e('0xb')),'whatsappQueueReport':require(_0xf54e('0xc'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x27e69b,_0x57a1ce,_0x40a75d){return util[_0xf54e('0xd')]('%s.%s.%s',_0x27e69b,_0x57a1ce||0x0,_0x40a75d||0x0);}function getIntervals(_0x26fc3e,_0xefa1c0){var _0x6b9e61=[];if(!_[_0xf54e('0xe')](_0xefa1c0['IntervalId'])&&!_[_0xf54e('0xe')](_0x26fc3e[_0xefa1c0[_0xf54e('0xf')]])&&!_[_0xf54e('0xe')](_0x26fc3e[_0xefa1c0[_0xf54e('0xf')]]['Intervals'])){_0x6b9e61=_[_0xf54e('0x10')](_0x26fc3e[_0xefa1c0['IntervalId']]['Intervals'],_0xf54e('0x11'));}else if(!_[_0xf54e('0xe')](_0xefa1c0[_0xf54e('0x11')])){_0x6b9e61=[_0xefa1c0[_0xf54e('0x11')]];}return _0x6b9e61;}exports['listen']=function(_0x331732){_0x331732[_0xf54e('0x12')]={};return new BPromise(function(_0x1855fe,_0x15f639){var _0x56828e={'Start':function(_0x2366ee){var _0x389abc=this;return new Promise(function(_0x3eb415,_0x5c5d00){if(_0x2366ee){try{var _0x4af633=[];var _0xd87020=getId(_0x2366ee[_0xf54e('0x13')],_0x2366ee[_0xf54e('0x14')]?_0x2366ee[_0xf54e('0x14')]['id']:0x0,_0x2366ee[_0xf54e('0x15')]?_0x2366ee[_0xf54e('0x15')]['id']:0x0);if(_0x2366ee[_0xf54e('0x16')]&&_[_0xf54e('0x17')](_0x2366ee[_0xf54e('0x16')])&&_0x2366ee[_0xf54e('0x16')][_0xf54e('0x18')]){for(var _0x50fc66=0x0;_0x50fc66<_0x2366ee['applications'][_0xf54e('0x18')];_0x50fc66+=0x1){var _0x59f338=_0x2366ee[_0xf54e('0x16')][_0x50fc66];if(fs[_0xf54e('0x19')](path[_0xf54e('0x1a')](__dirname,_0xf54e('0x16'),_0x59f338[_0xf54e('0x1b')]+_0xf54e('0x1c')))){var _0x388aa0=[];switch(_0x59f338[_0xf54e('0x1b')][_0xf54e('0x1d')]()){case _0xf54e('0x1e'):var _0x1c58bd=_0x59f338['appdata'][_0xf54e('0x1f')](',');if(_0x2366ee['channel']===_0xf54e('0x20')){_0x388aa0[_0xf54e('0x21')](_0x1c58bd[0x0]);_0x388aa0[_0xf54e('0x21')](_0x1c58bd[0x1]);_0x388aa0[_0xf54e('0x21')](_0x1c58bd[_0xf54e('0x22')](0x2,_0x1c58bd[_0xf54e('0x18')])[_0xf54e('0x1a')](','));}else{_0x388aa0[_0xf54e('0x21')](_0x1c58bd[0x0]);_0x388aa0[_0xf54e('0x21')](_0x1c58bd[_0xf54e('0x22')](0x1,_0x1c58bd[_0xf54e('0x18')])[_0xf54e('0x1a')](','));}break;case _0xf54e('0x23'):var _0x5390b8=_0x59f338[_0xf54e('0x24')]['split'](',');_0x388aa0[_0xf54e('0x21')](_0x5390b8[0x0]);_0x388aa0['push'](_0x5390b8[0x1]);_0x388aa0[_0xf54e('0x21')](_0x5390b8[_0xf54e('0x22')](0x2,_0x5390b8[_0xf54e('0x18')])[_0xf54e('0x1a')](','));break;case _0xf54e('0x25'):var _0x3993e4=_0x59f338[_0xf54e('0x24')]['split'](',');_0x388aa0['push'](_0x3993e4[0x0]);_0x388aa0[_0xf54e('0x21')](_0x3993e4[0x1]);_0x388aa0[_0xf54e('0x21')](_0x3993e4[0x2]);_0x388aa0[_0xf54e('0x21')](_0x3993e4[0x3]);_0x388aa0[_0xf54e('0x21')](_0x3993e4[_0xf54e('0x22')](0x4,_0x3993e4[_0xf54e('0x18')])[_0xf54e('0x1a')](','));break;case _0xf54e('0x26'):var _0x3ae704=_0x59f338[_0xf54e('0x24')]['split'](',');_0x388aa0['push'](_0x3ae704[0x0]);_0x388aa0[_0xf54e('0x21')](_0x3ae704[0x1]);_0x388aa0[_0xf54e('0x21')](_0x3ae704[0x2]);_0x388aa0['push'](_0x3ae704[0x3]);_0x388aa0[_0xf54e('0x21')](_0x3ae704[_0xf54e('0x22')](0x4,_0x3ae704[_0xf54e('0x18')])[_0xf54e('0x1a')](','));break;case'message':_0x388aa0['push'](_0x59f338['appdata']);break;case _0xf54e('0x27'):_0x388aa0[_0xf54e('0x21')](_0x59f338[_0xf54e('0x28')]);_0x388aa0[_0xf54e('0x21')](_0x59f338[_0xf54e('0x24')]);break;case _0xf54e('0x29'):var _0x49ba1c=utils['getMustacheRender'](_0x2366ee['account'][_0xf54e('0x2a')],_0x2366ee);var _0x734187=_0x59f338['appdata']['split'](',');_0x388aa0[_0xf54e('0x21')](_0x734187[0x0]);_0x388aa0[_0xf54e('0x21')](_0x734187[0x1]);_0x388aa0[_0xf54e('0x21')](_0x734187[0x2]);_0x388aa0['push'](_0x734187[0x3]);_0x388aa0[_0xf54e('0x21')](_0x734187[0x4]);_0x388aa0[_0xf54e('0x21')](_0x734187[0x5]);_0x388aa0['push'](_0x734187[0x6]);_0x388aa0[_0xf54e('0x21')](_0x734187[0x7]);_0x388aa0[_0xf54e('0x21')](_0x734187[0x8]);_0x388aa0[_0xf54e('0x21')](_0x734187[0x9]);_0x388aa0[_0xf54e('0x21')](_0x734187[0xa]);_0x388aa0[_0xf54e('0x21')](_0x2366ee[_0xf54e('0x15')]['id']);_0x388aa0['push'](_0x2366ee['message']['id']);_0x388aa0[_0xf54e('0x21')](_0x59f338[_0xf54e('0x2b')]);_0x388aa0[_0xf54e('0x21')](_0x2366ee['interaction'][_0xf54e('0x2c')]);_0x388aa0[_0xf54e('0x21')](_0x2366ee[_0xf54e('0x2d')][_0xf54e('0x2d')]);_0x388aa0[_0xf54e('0x21')](_0x49ba1c);break;default:_0x388aa0=_[_0xf54e('0xe')](_0x59f338[_0xf54e('0x24')])?[]:_0x59f338[_0xf54e('0x24')][_0xf54e('0x1f')](',');}var _0x2087b3={'id':util[_0xf54e('0xd')](_0xf54e('0x2e'),_0xd87020,_0x59f338['id'],_0x59f338[_0xf54e('0x1b')]),'condition':require(_0xf54e('0x2f'))[_0xf54e('0x30')](_0xd87020,getIntervals(_0x331732['intervals'],_0x59f338),_0x331732),'consequence':require('./applications/'+_0x59f338['app'])[_0xf54e('0x31')](_0xd87020,_0x388aa0,_0x331732,_0x2366ee),'p':_0x59f338[_0xf54e('0x32')]||0x0};logger['info'](_0xf54e('0x33'),_0x2087b3['id'],_0xf54e('0x34'),getIntervals(_0x331732[_0xf54e('0x35')],_0x59f338)['join'](_0xf54e('0x36')));_0x4af633[_0xf54e('0x21')](_0x2087b3);}else{logger[_0xf54e('0x37')](_0xf54e('0x38'),path[_0xf54e('0x1a')](__dirname,_0xf54e('0x16'),_0x59f338[_0xf54e('0x1b')]+_0xf54e('0x1c')));}}_0x331732[_0xf54e('0x12')][_0xd87020]=new RuleEngine(_0x4af633);_0x331732['rules'][_0xd87020][_0xf54e('0x39')](_0x2366ee,function(_0x3447fd){logger[_0xf54e('0x3a')](_0xf54e('0x3b'),JSON[_0xf54e('0x3c')](_0x3447fd[_0xf54e('0x3d')]));if(_0x331732['rules'][_0xd87020]){_0x331732[_0xf54e('0x12')][_0xd87020]['emit'](_0xf54e('0x3e'));}});return _0x3eb415({'code':0xc8,'message':_0x2366ee});}else{logger['info'](_0xf54e('0x3f'));return _0x3eb415({'code':0xc8,'message':_0x2366ee});}}catch(_0x331b16){logger[_0xf54e('0x37')](_0x331b16['stack']);return _0x5c5d00(_0x389abc[_0xf54e('0x37')](0x1f4,_0x331b16));}}return _0x5c5d00(_0xf54e('0x40'));});},'AcceptMessage':function(_0x12971a){var _0x32fb46=this;return new Promise(function(_0x3a5a87,_0x478809){if(_0x12971a[_0xf54e('0x41')]&&_0x12971a[_0xf54e('0x41')]['id']){if(_0x331732[_0xf54e('0x42')][_0x12971a[_0xf54e('0x41')]['id']]){_0x331732['agents'][_0x12971a[_0xf54e('0x41')]['id']][_0xf54e('0x43')]=![];_0x331732['agents'][_0x12971a[_0xf54e('0x41')]['id']][_0xf54e('0x44')]=undefined;}}if(_0x12971a[_0xf54e('0x14')]&&_0x12971a[_0xf54e('0x14')]['id']){try{var _0x557964=getId(_0x12971a[_0xf54e('0x13')],_0x12971a[_0xf54e('0x14')]?_0x12971a[_0xf54e('0x14')]['id']:0x0,_0x12971a[_0xf54e('0x15')]?_0x12971a[_0xf54e('0x15')]['id']:0x0);if(_0x331732[_0xf54e('0x12')][_0x557964]){_0x331732[_0xf54e('0x12')][_0x557964][_0xf54e('0x45')](_0xf54e('0x46'));if(rpc[_0x12971a[_0xf54e('0x13')]+_0xf54e('0x47')]){rpc[_0x12971a[_0xf54e('0x13')]+_0xf54e('0x47')][_0xf54e('0x48')](_0x557964,{'UserId':_0x12971a[_0xf54e('0x14')][_0xf54e('0x49')]})[_0xf54e('0x4a')](function(_0xe9338b){logger[_0xf54e('0x37')](_0xf54e('0x4b'));});}}return _0x3a5a87({'code':0xc8,'message':_0x12971a});}catch(_0x4e25e4){logger['error'](_0x4e25e4[_0xf54e('0x4c')]);return _0x478809(_0x32fb46[_0xf54e('0x37')](0x1f4,_0x4e25e4));}}logger[_0xf54e('0x37')](_0xf54e('0x4d'));return _0x478809(_0x32fb46[_0xf54e('0x37')](0x1f4,_0xf54e('0x4d')));});},'RejectMessage':function(_0x22763f){var _0x149d0b=this;return new Promise(function(_0x89b811,_0xdf63c4){if(_0x22763f[_0xf54e('0x41')]&&_0x22763f['agent']['id']){try{if(_0x331732[_0xf54e('0x42')][_0x22763f[_0xf54e('0x41')]['id']]){_0x331732[_0xf54e('0x42')][_0x22763f[_0xf54e('0x41')]['id']][_0xf54e('0x43')]=![];_0x331732[_0xf54e('0x42')][_0x22763f[_0xf54e('0x41')]['id']]['busyQueue']=undefined;}return _0x89b811({'code':0xc8,'message':_0x22763f});}catch(_0x3ad2e3){logger[_0xf54e('0x37')](_0x3ad2e3[_0xf54e('0x4c')]);return _0xdf63c4(_0x149d0b['error'](0x1f4,_0x3ad2e3));}}logger[_0xf54e('0x37')]('message\x20is\x20empty');return _0xdf63c4(_0x149d0b[_0xf54e('0x37')](0x1f4,_0xf54e('0x4d')));});},'AbandonInteraction':function(_0x3e2fd1){var _0x5b882f=this;return new Promise(function(_0x1d8ccf,_0x30d10d){if(_0x3e2fd1[_0xf54e('0x13')]&&_0x3e2fd1[_0xf54e('0x15')]&&_0x3e2fd1[_0xf54e('0x15')]['id']){try{var _0x2ec72a=getId(_0x3e2fd1[_0xf54e('0x13')],_0x3e2fd1['message']?_0x3e2fd1['message']['id']:0x0,_0x3e2fd1[_0xf54e('0x15')]?_0x3e2fd1[_0xf54e('0x15')]['id']:0x0);if(_0x331732['rules'][_0x2ec72a]){_0x331732[_0xf54e('0x12')][_0x2ec72a]['emit'](_0xf54e('0x46'));}return _0x1d8ccf({'code':0xc8,'message':_0x3e2fd1});}catch(_0x528a64){logger[_0xf54e('0x37')](_0x528a64[_0xf54e('0x4c')]);return _0x30d10d(_0x5b882f[_0xf54e('0x37')](0x1f4,_0x528a64));}}logger[_0xf54e('0x37')](_0xf54e('0x4d'));return _0x30d10d(_0x5b882f[_0xf54e('0x37')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x479572){var _0x79345=this;return new Promise(function(_0x2b273d,_0x493011){if(_0x331732['agents'][_0xf54e('0x4e')](_0x479572['id'])){for(var _0x511a99 in _0x479572[_0xf54e('0x4f')]){if(_0x479572[_0xf54e('0x4f')][_0xf54e('0x4e')](_0x511a99)){if(_0x331732[_0xf54e('0x42')][_0x479572['id']][_0xf54e('0x4e')](_0x511a99+_0xf54e('0x50'))){_0x331732[_0xf54e('0x42')][_0x479572['id']][_0x511a99+_0xf54e('0x50')]=parseInt(_0x479572[_0xf54e('0x4f')][_0x511a99],0xa);}}}_0x331732[_0xf54e('0x42')][_0x479572['id']][_0xf54e('0x51')]();return _0x2b273d({'code':0xc8,'message':_0x331732[_0xf54e('0x42')][_0x479572['id']]});}else{return _0x493011(_0x79345[_0xf54e('0x37')](0x1f4,_0xf54e('0x52')));}});},'Agents':function(_0x55d229){return new Promise(function(_0x302f3d,_0x5d5dd7){var _0xb7ff4d=_[_0xf54e('0x53')](_0x331732[_0xf54e('0x42')]);_0x302f3d({'count':_0xb7ff4d['length'],'rows':_0xb7ff4d});});},'ChatQueues':function(_0xf50b1b){return new Promise(function(_0x1ede85,_0x577075){var _0x51ec35=[];for(var _0x2818cf in _0x331732['chatQueues']){if(_0x331732[_0xf54e('0x54')][_0xf54e('0x4e')](_0x2818cf)){var _0x105cf4=_0x331732[_0xf54e('0x54')][_0x2818cf];var _0x47a84f={'id':_0x105cf4['id'],'available':_0x105cf4[_0xf54e('0x55')],'loggedIn':_0x105cf4['loggedIn'],'name':_0x105cf4[_0xf54e('0x56')],'paused':_0x105cf4[_0xf54e('0x57')],'waiting':_0x105cf4[_0xf54e('0x58')]};_0x51ec35['push'](_0x47a84f);}}_0x1ede85({'count':_0x51ec35[_0xf54e('0x18')],'rows':_0x51ec35});});},'MailQueues':function(_0x504ec7){return new Promise(function(_0x3f7224,_0x3e2101){var _0x5500d7=[];for(var _0x380b4f in _0x331732['mailQueues']){if(_0x331732[_0xf54e('0x59')][_0xf54e('0x4e')](_0x380b4f)){var _0x33acd3=_0x331732[_0xf54e('0x59')][_0x380b4f];var _0x21159f={'id':_0x33acd3['id'],'available':_0x33acd3['available'],'loggedIn':_0x33acd3[_0xf54e('0x5a')],'name':_0x33acd3[_0xf54e('0x56')],'paused':_0x33acd3['paused'],'waiting':_0x33acd3[_0xf54e('0x58')]};_0x5500d7[_0xf54e('0x21')](_0x21159f);}}_0x3f7224({'count':_0x5500d7['length'],'rows':_0x5500d7});});},'OpenchannelQueues':function(_0x8e7a38){return new Promise(function(_0x14aaf7,_0x309895){var _0x4c72ef=[];for(var _0xf4e4d in _0x331732['openchannelQueues']){if(_0x331732[_0xf54e('0x5b')][_0xf54e('0x4e')](_0xf4e4d)){var _0x5e45e7=_0x331732[_0xf54e('0x5b')][_0xf4e4d];var _0x37acd1={'id':_0x5e45e7['id'],'available':_0x5e45e7[_0xf54e('0x55')],'loggedIn':_0x5e45e7[_0xf54e('0x5a')],'name':_0x5e45e7[_0xf54e('0x56')],'paused':_0x5e45e7[_0xf54e('0x57')],'waiting':_0x5e45e7[_0xf54e('0x58')]};_0x4c72ef[_0xf54e('0x21')](_0x37acd1);}}_0x14aaf7({'count':_0x4c72ef[_0xf54e('0x18')],'rows':_0x4c72ef});});},'SmsQueues':function(_0x10f6bb){return new Promise(function(_0x266aed,_0x57b9ba){var _0x33960a=[];for(var _0x2c20b5 in _0x331732[_0xf54e('0x5c')]){if(_0x331732['smsQueues'][_0xf54e('0x4e')](_0x2c20b5)){var _0x1f7bc4=_0x331732[_0xf54e('0x5c')][_0x2c20b5];var _0x13db3e={'id':_0x1f7bc4['id'],'available':_0x1f7bc4[_0xf54e('0x55')],'loggedIn':_0x1f7bc4[_0xf54e('0x5a')],'name':_0x1f7bc4[_0xf54e('0x56')],'paused':_0x1f7bc4['paused'],'waiting':_0x1f7bc4[_0xf54e('0x58')]};_0x33960a[_0xf54e('0x21')](_0x13db3e);}}_0x266aed({'count':_0x33960a[_0xf54e('0x18')],'rows':_0x33960a});});},'FaxQueues':function(_0x5016c5){return new Promise(function(_0x2e7e0e,_0x419ba2){var _0x57601f=[];for(var _0x247e50 in _0x331732['faxQueues']){if(_0x331732['faxQueues'][_0xf54e('0x4e')](_0x247e50)){var _0x45c5ff=_0x331732[_0xf54e('0x5d')][_0x247e50];var _0x2e35a3={'id':_0x45c5ff['id'],'available':_0x45c5ff[_0xf54e('0x55')],'loggedIn':_0x45c5ff[_0xf54e('0x5a')],'name':_0x45c5ff[_0xf54e('0x56')],'paused':_0x45c5ff[_0xf54e('0x57')],'waiting':_0x45c5ff[_0xf54e('0x58')]};_0x57601f[_0xf54e('0x21')](_0x2e35a3);}}_0x2e7e0e({'count':_0x57601f['length'],'rows':_0x57601f});});},'WhatsappQueues':function(_0x21d708){return new Promise(function(_0x124db1,_0x2b026a){var _0x42af1c=[];for(var _0x56223a in _0x331732[_0xf54e('0x5e')]){if(_0x331732[_0xf54e('0x5e')][_0xf54e('0x4e')](_0x56223a)){var _0x213206=_0x331732['whatsappQueues'][_0x56223a];var _0x394862={'id':_0x213206['id'],'available':_0x213206[_0xf54e('0x55')],'loggedIn':_0x213206[_0xf54e('0x5a')],'name':_0x213206['name'],'paused':_0x213206['paused'],'waiting':_0x213206[_0xf54e('0x58')]};_0x42af1c[_0xf54e('0x21')](_0x394862);}}_0x124db1({'count':_0x42af1c[_0xf54e('0x18')],'rows':_0x42af1c});});},'ChatQueuesWaitingInteractions':function(_0x20ed38){return new Promise(function(_0x21e9c1,_0x14b7fc){var _0x2b42f5=_[_0xf54e('0x53')](_0x331732[_0xf54e('0x5f')]);_0x21e9c1({'count':_0x2b42f5['length'],'rows':_0x2b42f5});});},'MailQueuesWaitingInteractions':function(_0xa5de47){return new Promise(function(_0x3edfa0,_0x4ce10){var _0x37a61b=_[_0xf54e('0x53')](_0x331732[_0xf54e('0x60')]);_0x3edfa0({'count':_0x37a61b[_0xf54e('0x18')],'rows':_0x37a61b});});},'OpenchannelQueuesWaitingInteractions':function(_0x9a8f4f){return new Promise(function(_0x2fa9bc,_0xe58bec){var _0x11dec2=_[_0xf54e('0x53')](_0x331732['openchannelQueuesWaitingInteractions']);_0x2fa9bc({'count':_0x11dec2[_0xf54e('0x18')],'rows':_0x11dec2});});},'SmsQueuesWaitingInteractions':function(_0x1cfa09){return new Promise(function(_0x59acbc,_0x4a0614){var _0x85b108=_[_0xf54e('0x53')](_0x331732[_0xf54e('0x61')]);_0x59acbc({'count':_0x85b108[_0xf54e('0x18')],'rows':_0x85b108});});},'FaxQueuesWaitingInteractions':function(_0x15aec1){return new Promise(function(_0x3c3a97,_0x1d1d10){var _0x403445=_[_0xf54e('0x53')](_0x331732['faxQueuesWaitingInteractions']);_0x3c3a97({'count':_0x403445[_0xf54e('0x18')],'rows':_0x403445});});},'WhatsappQueuesWaitingInteractions':function(_0x3c222a){return new Promise(function(_0x3c641b,_0x5c8b6c){var _0x40f135=_['values'](_0x331732[_0xf54e('0x62')]);_0x3c641b({'count':_0x40f135['length'],'rows':_0x40f135});});}};var _0xfe35d8=jayson[_0xf54e('0x63')](_0x56828e)['http']();_0xfe35d8['on']('error',function(_0x23533b){logger[_0xf54e('0x37')](JSON[_0xf54e('0x3c')](_0x23533b));return _0x15f639(_0x23533b);});_0xfe35d8[_0xf54e('0x64')](0x232c,_0xf54e('0x65'),function(){console['log']('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x1855fe(_0xf54e('0x66')+0x232c);});});};
\ No newline at end of file
+var _0xde2c=['QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','values','chatQueues','available','loggedIn','mailQueues','name','paused','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','./applications/utils','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','channel','message','applications','length','existsSync','.js','app','toLowerCase','autoreply','appdata','mail','push','slice','join','dialogflow','split','amazonlex','tag','TagId','tvox','getMustacheRender','account','notificationTemplate','interaction','ChatWebsiteId','ContactId','./interval','condition','intervals','./applications/','consequence','priority','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','matchPath','emit','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','end'];(function(_0x4b87af,_0x4fc94c){var _0x315777=function(_0x1e2f4c){while(--_0x1e2f4c){_0x4b87af['push'](_0x4b87af['shift']());}};_0x315777(++_0x4fc94c);}(_0xde2c,0x7f));var _0xcde2=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0xde2c[_0x30b0d8];return _0x459c09;};'use strict';var _=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var path=require(_0xcde2('0x2'));var fs=require('fs');var jayson=require(_0xcde2('0x3'));var BPromise=require(_0xcde2('0x4'));var uuid=require(_0xcde2('0x5'));var utils=require(_0xcde2('0x6'));var config=require(_0xcde2('0x7'));var logger=require('../../../config/logger')(_0xcde2('0x8'));var rpc={'openchannelQueueReport':require(_0xcde2('0x9')),'mailQueueReport':require(_0xcde2('0xa')),'chatQueueReport':require(_0xcde2('0xb')),'smsQueueReport':require(_0xcde2('0xc')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xcde2('0xd'))};var RuleEngine=require(_0xcde2('0xe'));function getId(_0x9c7036,_0x544235,_0x582a6c){return util[_0xcde2('0xf')](_0xcde2('0x10'),_0x9c7036,_0x544235||0x0,_0x582a6c||0x0);}function getIntervals(_0x4e9749,_0x181a73){var _0x29f7e0=[];if(!_[_0xcde2('0x11')](_0x181a73[_0xcde2('0x12')])&&!_['isNil'](_0x4e9749[_0x181a73['IntervalId']])&&!_[_0xcde2('0x11')](_0x4e9749[_0x181a73[_0xcde2('0x12')]][_0xcde2('0x13')])){_0x29f7e0=_[_0xcde2('0x14')](_0x4e9749[_0x181a73[_0xcde2('0x12')]][_0xcde2('0x13')],'interval');}else if(!_[_0xcde2('0x11')](_0x181a73['interval'])){_0x29f7e0=[_0x181a73[_0xcde2('0x15')]];}return _0x29f7e0;}exports['listen']=function(_0x4b0e0e){_0x4b0e0e[_0xcde2('0x16')]={};return new BPromise(function(_0x1c7103,_0x417505){var _0x19b54b={'Start':function(_0x11665c){var _0x5312c7=this;return new Promise(function(_0x39b023,_0x4c558b){if(_0x11665c){try{var _0x31b4a7=[];var _0x198840=getId(_0x11665c[_0xcde2('0x17')],_0x11665c[_0xcde2('0x18')]?_0x11665c['message']['id']:0x0,_0x11665c['interaction']?_0x11665c['interaction']['id']:0x0);if(_0x11665c[_0xcde2('0x19')]&&_['isArray'](_0x11665c[_0xcde2('0x19')])&&_0x11665c[_0xcde2('0x19')][_0xcde2('0x1a')]){for(var _0x481fc0=0x0;_0x481fc0<_0x11665c[_0xcde2('0x19')][_0xcde2('0x1a')];_0x481fc0+=0x1){var _0x208368=_0x11665c[_0xcde2('0x19')][_0x481fc0];if(fs[_0xcde2('0x1b')](path['join'](__dirname,'applications',_0x208368['app']+_0xcde2('0x1c')))){var _0x3e5170=[];switch(_0x208368[_0xcde2('0x1d')][_0xcde2('0x1e')]()){case _0xcde2('0x1f'):var _0x5a7c5c=_0x208368[_0xcde2('0x20')]['split'](',');if(_0x11665c[_0xcde2('0x17')]===_0xcde2('0x21')){_0x3e5170[_0xcde2('0x22')](_0x5a7c5c[0x0]);_0x3e5170['push'](_0x5a7c5c[0x1]);_0x3e5170['push'](_0x5a7c5c[_0xcde2('0x23')](0x2,_0x5a7c5c[_0xcde2('0x1a')])[_0xcde2('0x24')](','));}else{_0x3e5170[_0xcde2('0x22')](_0x5a7c5c[0x0]);_0x3e5170[_0xcde2('0x22')](_0x5a7c5c['slice'](0x1,_0x5a7c5c[_0xcde2('0x1a')])[_0xcde2('0x24')](','));}break;case _0xcde2('0x25'):var _0x513965=_0x208368[_0xcde2('0x20')][_0xcde2('0x26')](',');_0x3e5170[_0xcde2('0x22')](_0x513965[0x0]);_0x3e5170[_0xcde2('0x22')](_0x513965[0x1]);_0x3e5170[_0xcde2('0x22')](_0x513965[_0xcde2('0x23')](0x2,_0x513965[_0xcde2('0x1a')])[_0xcde2('0x24')](','));break;case'dialogflowv2':var _0x3c3c01=_0x208368['appdata'][_0xcde2('0x26')](',');_0x3e5170[_0xcde2('0x22')](_0x3c3c01[0x0]);_0x3e5170[_0xcde2('0x22')](_0x3c3c01[0x1]);_0x3e5170['push'](_0x3c3c01[0x2]);_0x3e5170[_0xcde2('0x22')](_0x3c3c01[0x3]);_0x3e5170[_0xcde2('0x22')](_0x3c3c01['slice'](0x4,_0x3c3c01[_0xcde2('0x1a')])[_0xcde2('0x24')](','));break;case _0xcde2('0x27'):var _0x2b2ea1=_0x208368[_0xcde2('0x20')][_0xcde2('0x26')](',');_0x3e5170[_0xcde2('0x22')](_0x2b2ea1[0x0]);_0x3e5170[_0xcde2('0x22')](_0x2b2ea1[0x1]);_0x3e5170['push'](_0x2b2ea1[0x2]);_0x3e5170[_0xcde2('0x22')](_0x2b2ea1[0x3]);_0x3e5170[_0xcde2('0x22')](_0x2b2ea1[_0xcde2('0x23')](0x4,_0x2b2ea1[_0xcde2('0x1a')])['join'](','));break;case _0xcde2('0x18'):_0x3e5170[_0xcde2('0x22')](_0x208368[_0xcde2('0x20')]);break;case _0xcde2('0x28'):_0x3e5170['push'](_0x208368[_0xcde2('0x29')]);_0x3e5170[_0xcde2('0x22')](_0x208368[_0xcde2('0x20')]);break;case _0xcde2('0x2a'):var _0x54ae78=utils[_0xcde2('0x2b')](_0x11665c[_0xcde2('0x2c')][_0xcde2('0x2d')],_0x11665c);var _0x3090b6=_0x208368[_0xcde2('0x20')]['split'](',');_0x3e5170[_0xcde2('0x22')](_0x3090b6[0x0]);_0x3e5170[_0xcde2('0x22')](_0x3090b6[0x1]);_0x3e5170[_0xcde2('0x22')](_0x3090b6[0x2]);_0x3e5170[_0xcde2('0x22')](_0x3090b6[0x3]);_0x3e5170['push'](_0x3090b6[0x4]);_0x3e5170['push'](_0x3090b6[0x5]);_0x3e5170[_0xcde2('0x22')](_0x3090b6[0x6]);_0x3e5170[_0xcde2('0x22')](_0x3090b6[0x7]);_0x3e5170[_0xcde2('0x22')](_0x3090b6[0x8]);_0x3e5170[_0xcde2('0x22')](_0x3090b6[0x9]);_0x3e5170[_0xcde2('0x22')](_0x3090b6[0xa]);_0x3e5170[_0xcde2('0x22')](_0x11665c[_0xcde2('0x2e')]['id']);_0x3e5170[_0xcde2('0x22')](_0x11665c[_0xcde2('0x18')]['id']);_0x3e5170['push'](_0x208368[_0xcde2('0x2f')]);_0x3e5170[_0xcde2('0x22')](_0x11665c[_0xcde2('0x2e')][_0xcde2('0x30')]);_0x3e5170[_0xcde2('0x22')](_0x11665c['body']['body']);_0x3e5170[_0xcde2('0x22')](_0x54ae78);break;default:_0x3e5170=_[_0xcde2('0x11')](_0x208368[_0xcde2('0x20')])?[]:_0x208368[_0xcde2('0x20')][_0xcde2('0x26')](',');}var _0x1939a0={'id':util['format']('%s:%s:%s',_0x198840,_0x208368['id'],_0x208368['app']),'condition':require(_0xcde2('0x31'))[_0xcde2('0x32')](_0x198840,getIntervals(_0x4b0e0e[_0xcde2('0x33')],_0x208368),_0x4b0e0e),'consequence':require(_0xcde2('0x34')+_0x208368[_0xcde2('0x1d')])[_0xcde2('0x35')](_0x198840,_0x3e5170,_0x4b0e0e,_0x11665c),'p':_0x208368[_0xcde2('0x36')]||0x0};logger['info']('Push\x20new\x20rule',_0x1939a0['id'],_0xcde2('0x37'),getIntervals(_0x4b0e0e['intervals'],_0x208368)[_0xcde2('0x24')]('\x20|\x20'));_0x31b4a7[_0xcde2('0x22')](_0x1939a0);}else{logger[_0xcde2('0x38')](_0xcde2('0x39'),path['join'](__dirname,_0xcde2('0x19'),_0x208368['app']+_0xcde2('0x1c')));}}_0x4b0e0e[_0xcde2('0x16')][_0x198840]=new RuleEngine(_0x31b4a7);_0x4b0e0e[_0xcde2('0x16')][_0x198840][_0xcde2('0x3a')](_0x11665c,function(_0xcafd7){logger[_0xcde2('0x3b')]('Applications\x20executed',JSON['stringify'](_0xcafd7[_0xcde2('0x3c')]));if(_0x4b0e0e['rules'][_0x198840]){_0x4b0e0e['rules'][_0x198840][_0xcde2('0x3d')]('complete');}});return _0x39b023({'code':0xc8,'message':_0x11665c});}else{logger[_0xcde2('0x3b')](_0xcde2('0x3e'));return _0x39b023({'code':0xc8,'message':_0x11665c});}}catch(_0x569d44){logger[_0xcde2('0x38')](_0x569d44['stack']);return _0x4c558b(_0x5312c7['error'](0x1f4,_0x569d44));}}return _0x4c558b(_0xcde2('0x3f'));});},'AcceptMessage':function(_0x289936){var _0x4fc9d5=this;return new Promise(function(_0x1e05a4,_0x5cd4dd){if(_0x289936[_0xcde2('0x40')]&&_0x289936[_0xcde2('0x40')]['id']){if(_0x4b0e0e[_0xcde2('0x41')][_0x289936[_0xcde2('0x40')]['id']]){_0x4b0e0e[_0xcde2('0x41')][_0x289936['agent']['id']][_0xcde2('0x42')]=![];_0x4b0e0e[_0xcde2('0x41')][_0x289936[_0xcde2('0x40')]['id']][_0xcde2('0x43')]=undefined;}}if(_0x289936['message']&&_0x289936['message']['id']){try{var _0x465fdf=getId(_0x289936['channel'],_0x289936[_0xcde2('0x18')]?_0x289936[_0xcde2('0x18')]['id']:0x0,_0x289936[_0xcde2('0x2e')]?_0x289936[_0xcde2('0x2e')]['id']:0x0);if(_0x4b0e0e[_0xcde2('0x16')][_0x465fdf]){_0x4b0e0e[_0xcde2('0x16')][_0x465fdf]['emit'](_0xcde2('0x44'));if(rpc[_0x289936['channel']+_0xcde2('0x45')]){rpc[_0x289936['channel']+_0xcde2('0x45')][_0xcde2('0x46')](_0x465fdf,{'UserId':_0x289936[_0xcde2('0x18')][_0xcde2('0x47')]})[_0xcde2('0x48')](function(_0x5071ce){logger['error'](_0xcde2('0x49'));});}}return _0x1e05a4({'code':0xc8,'message':_0x289936});}catch(_0x5aa54f){logger[_0xcde2('0x38')](_0x5aa54f[_0xcde2('0x4a')]);return _0x5cd4dd(_0x4fc9d5[_0xcde2('0x38')](0x1f4,_0x5aa54f));}}logger[_0xcde2('0x38')](_0xcde2('0x4b'));return _0x5cd4dd(_0x4fc9d5[_0xcde2('0x38')](0x1f4,_0xcde2('0x4b')));});},'RejectMessage':function(_0x28bd25){var _0x373cdc=this;return new Promise(function(_0x21585a,_0x3c5a17){if(_0x28bd25[_0xcde2('0x40')]&&_0x28bd25['agent']['id']){try{if(_0x4b0e0e['agents'][_0x28bd25['agent']['id']]){_0x4b0e0e[_0xcde2('0x41')][_0x28bd25['agent']['id']][_0xcde2('0x42')]=![];_0x4b0e0e[_0xcde2('0x41')][_0x28bd25[_0xcde2('0x40')]['id']]['busyQueue']=undefined;}return _0x21585a({'code':0xc8,'message':_0x28bd25});}catch(_0x33dc10){logger['error'](_0x33dc10[_0xcde2('0x4a')]);return _0x3c5a17(_0x373cdc['error'](0x1f4,_0x33dc10));}}logger[_0xcde2('0x38')](_0xcde2('0x4b'));return _0x3c5a17(_0x373cdc['error'](0x1f4,_0xcde2('0x4b')));});},'AbandonInteraction':function(_0x4dfabb){var _0x5e6fd3=this;return new Promise(function(_0x1e96b4,_0x2ef935){if(_0x4dfabb[_0xcde2('0x17')]&&_0x4dfabb[_0xcde2('0x2e')]&&_0x4dfabb[_0xcde2('0x2e')]['id']){try{var _0x3787b5=getId(_0x4dfabb['channel'],_0x4dfabb[_0xcde2('0x18')]?_0x4dfabb[_0xcde2('0x18')]['id']:0x0,_0x4dfabb[_0xcde2('0x2e')]?_0x4dfabb[_0xcde2('0x2e')]['id']:0x0);if(_0x4b0e0e[_0xcde2('0x16')][_0x3787b5]){_0x4b0e0e[_0xcde2('0x16')][_0x3787b5]['emit']('end');}return _0x1e96b4({'code':0xc8,'message':_0x4dfabb});}catch(_0x30dee3){logger[_0xcde2('0x38')](_0x30dee3[_0xcde2('0x4a')]);return _0x2ef935(_0x5e6fd3[_0xcde2('0x38')](0x1f4,_0x30dee3));}}logger['error'](_0xcde2('0x4b'));return _0x2ef935(_0x5e6fd3[_0xcde2('0x38')](0x1f4,_0xcde2('0x4b')));});},'AgentCapacity':function(_0x2e18f4){var _0x5e4733=this;return new Promise(function(_0x35453a,_0x50a1db){if(_0x4b0e0e[_0xcde2('0x41')][_0xcde2('0x4c')](_0x2e18f4['id'])){for(var _0x585165 in _0x2e18f4[_0xcde2('0x4d')]){if(_0x2e18f4[_0xcde2('0x4d')][_0xcde2('0x4c')](_0x585165)){if(_0x4b0e0e[_0xcde2('0x41')][_0x2e18f4['id']][_0xcde2('0x4c')](_0x585165+_0xcde2('0x4e'))){_0x4b0e0e[_0xcde2('0x41')][_0x2e18f4['id']][_0x585165+_0xcde2('0x4e')]=parseInt(_0x2e18f4[_0xcde2('0x4d')][_0x585165],0xa);}}}_0x4b0e0e[_0xcde2('0x41')][_0x2e18f4['id']]['updateRealtime']();return _0x35453a({'code':0xc8,'message':_0x4b0e0e[_0xcde2('0x41')][_0x2e18f4['id']]});}else{return _0x50a1db(_0x5e4733[_0xcde2('0x38')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x4250a8){return new Promise(function(_0x35b093,_0x2bc67c){var _0x5aaa3f=_[_0xcde2('0x4f')](_0x4b0e0e[_0xcde2('0x41')]);_0x35b093({'count':_0x5aaa3f[_0xcde2('0x1a')],'rows':_0x5aaa3f});});},'ChatQueues':function(_0x3b1ca7){return new Promise(function(_0x24ddd2,_0x3aa334){var _0x21cd07=[];for(var _0x45bd76 in _0x4b0e0e[_0xcde2('0x50')]){if(_0x4b0e0e[_0xcde2('0x50')][_0xcde2('0x4c')](_0x45bd76)){var _0x5d42f8=_0x4b0e0e['chatQueues'][_0x45bd76];var _0x39c723={'id':_0x5d42f8['id'],'available':_0x5d42f8[_0xcde2('0x51')],'loggedIn':_0x5d42f8[_0xcde2('0x52')],'name':_0x5d42f8['name'],'paused':_0x5d42f8['paused'],'waiting':_0x5d42f8['waiting']};_0x21cd07[_0xcde2('0x22')](_0x39c723);}}_0x24ddd2({'count':_0x21cd07[_0xcde2('0x1a')],'rows':_0x21cd07});});},'MailQueues':function(_0x161a8b){return new Promise(function(_0x88614f,_0x325b51){var _0x333cbb=[];for(var _0x5d9964 in _0x4b0e0e['mailQueues']){if(_0x4b0e0e[_0xcde2('0x53')][_0xcde2('0x4c')](_0x5d9964)){var _0x8c9a24=_0x4b0e0e[_0xcde2('0x53')][_0x5d9964];var _0x43f602={'id':_0x8c9a24['id'],'available':_0x8c9a24[_0xcde2('0x51')],'loggedIn':_0x8c9a24[_0xcde2('0x52')],'name':_0x8c9a24[_0xcde2('0x54')],'paused':_0x8c9a24[_0xcde2('0x55')],'waiting':_0x8c9a24[_0xcde2('0x56')]};_0x333cbb[_0xcde2('0x22')](_0x43f602);}}_0x88614f({'count':_0x333cbb[_0xcde2('0x1a')],'rows':_0x333cbb});});},'OpenchannelQueues':function(_0xa71d46){return new Promise(function(_0x16b6b3,_0x3f46ca){var _0xb5e3=[];for(var _0x3cf1aa in _0x4b0e0e[_0xcde2('0x57')]){if(_0x4b0e0e[_0xcde2('0x57')][_0xcde2('0x4c')](_0x3cf1aa)){var _0x5ee070=_0x4b0e0e[_0xcde2('0x57')][_0x3cf1aa];var _0x162ebd={'id':_0x5ee070['id'],'available':_0x5ee070[_0xcde2('0x51')],'loggedIn':_0x5ee070[_0xcde2('0x52')],'name':_0x5ee070[_0xcde2('0x54')],'paused':_0x5ee070['paused'],'waiting':_0x5ee070[_0xcde2('0x56')]};_0xb5e3['push'](_0x162ebd);}}_0x16b6b3({'count':_0xb5e3[_0xcde2('0x1a')],'rows':_0xb5e3});});},'SmsQueues':function(_0x1b8246){return new Promise(function(_0x171cee,_0x34d66d){var _0x31815f=[];for(var _0x42e629 in _0x4b0e0e[_0xcde2('0x58')]){if(_0x4b0e0e['smsQueues']['hasOwnProperty'](_0x42e629)){var _0x1ce8f9=_0x4b0e0e['smsQueues'][_0x42e629];var _0xbc4033={'id':_0x1ce8f9['id'],'available':_0x1ce8f9[_0xcde2('0x51')],'loggedIn':_0x1ce8f9[_0xcde2('0x52')],'name':_0x1ce8f9[_0xcde2('0x54')],'paused':_0x1ce8f9[_0xcde2('0x55')],'waiting':_0x1ce8f9[_0xcde2('0x56')]};_0x31815f[_0xcde2('0x22')](_0xbc4033);}}_0x171cee({'count':_0x31815f['length'],'rows':_0x31815f});});},'FaxQueues':function(_0x34fd26){return new Promise(function(_0x1822b0,_0x25ee3e){var _0x24b7b0=[];for(var _0x5f2ec6 in _0x4b0e0e[_0xcde2('0x59')]){if(_0x4b0e0e[_0xcde2('0x59')][_0xcde2('0x4c')](_0x5f2ec6)){var _0x317a84=_0x4b0e0e[_0xcde2('0x59')][_0x5f2ec6];var _0x2c3ce0={'id':_0x317a84['id'],'available':_0x317a84[_0xcde2('0x51')],'loggedIn':_0x317a84[_0xcde2('0x52')],'name':_0x317a84[_0xcde2('0x54')],'paused':_0x317a84[_0xcde2('0x55')],'waiting':_0x317a84[_0xcde2('0x56')]};_0x24b7b0[_0xcde2('0x22')](_0x2c3ce0);}}_0x1822b0({'count':_0x24b7b0[_0xcde2('0x1a')],'rows':_0x24b7b0});});},'WhatsappQueues':function(_0x505e84){return new Promise(function(_0x3a691d,_0x3a9829){var _0x17d66d=[];for(var _0x332f32 in _0x4b0e0e[_0xcde2('0x5a')]){if(_0x4b0e0e[_0xcde2('0x5a')][_0xcde2('0x4c')](_0x332f32)){var _0x9ed7e6=_0x4b0e0e[_0xcde2('0x5a')][_0x332f32];var _0x27ffe1={'id':_0x9ed7e6['id'],'available':_0x9ed7e6[_0xcde2('0x51')],'loggedIn':_0x9ed7e6[_0xcde2('0x52')],'name':_0x9ed7e6[_0xcde2('0x54')],'paused':_0x9ed7e6[_0xcde2('0x55')],'waiting':_0x9ed7e6[_0xcde2('0x56')]};_0x17d66d[_0xcde2('0x22')](_0x27ffe1);}}_0x3a691d({'count':_0x17d66d['length'],'rows':_0x17d66d});});},'ChatQueuesWaitingInteractions':function(_0x598fdd){return new Promise(function(_0x185986,_0x439714){var _0xa76992=_[_0xcde2('0x4f')](_0x4b0e0e['chatQueuesWaitingInteractions']);_0x185986({'count':_0xa76992[_0xcde2('0x1a')],'rows':_0xa76992});});},'MailQueuesWaitingInteractions':function(_0x5dbcc1){return new Promise(function(_0x78dcc4,_0x5f14a5){var _0x476e2f=_[_0xcde2('0x4f')](_0x4b0e0e['mailQueuesWaitingInteractions']);_0x78dcc4({'count':_0x476e2f[_0xcde2('0x1a')],'rows':_0x476e2f});});},'OpenchannelQueuesWaitingInteractions':function(_0x3a6f1b){return new Promise(function(_0x2e4810,_0x59d195){var _0x1bbc7e=_[_0xcde2('0x4f')](_0x4b0e0e[_0xcde2('0x5b')]);_0x2e4810({'count':_0x1bbc7e[_0xcde2('0x1a')],'rows':_0x1bbc7e});});},'SmsQueuesWaitingInteractions':function(_0x4b7e5f){return new Promise(function(_0x4a1a7d,_0xc70ceb){var _0x3fa065=_[_0xcde2('0x4f')](_0x4b0e0e[_0xcde2('0x5c')]);_0x4a1a7d({'count':_0x3fa065[_0xcde2('0x1a')],'rows':_0x3fa065});});},'FaxQueuesWaitingInteractions':function(_0xddfade){return new Promise(function(_0x4be3c3,_0x238665){var _0xcdc7f5=_[_0xcde2('0x4f')](_0x4b0e0e[_0xcde2('0x5d')]);_0x4be3c3({'count':_0xcdc7f5[_0xcde2('0x1a')],'rows':_0xcdc7f5});});},'WhatsappQueuesWaitingInteractions':function(_0x1a32c1){return new Promise(function(_0x113478,_0x5e58fa){var _0x340b52=_[_0xcde2('0x4f')](_0x4b0e0e['whatsappQueuesWaitingInteractions']);_0x113478({'count':_0x340b52[_0xcde2('0x1a')],'rows':_0x340b52});});}};var _0x43e293=jayson[_0xcde2('0x5e')](_0x19b54b)['http']();_0x43e293['on'](_0xcde2('0x38'),function(_0x27e039){logger['error'](JSON['stringify'](_0x27e039));return _0x417505(_0x27e039);});_0x43e293['listen'](0x232c,_0xcde2('0x5f'),function(){console[_0xcde2('0x60')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x1c7103(_0xcde2('0x61')+0x232c);});});};
\ No newline at end of file
index 2cdb517..67c30a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34b7=['result','catch','condition','rules','info','stop','Command','format','iftime\x20%s','indexOf','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','client','http','request','then','error','message'];(function(_0x3cd774,_0x1c01b1){var _0x1f4922=function(_0x35eccb){while(--_0x35eccb){_0x3cd774['push'](_0x3cd774['shift']());}};_0x1f4922(++_0x1c01b1);}(_0x34b7,0xfa));var _0x734b=function(_0x143896,_0x31f415){_0x143896=_0x143896-0x0;var _0x27d303=_0x34b7[_0x143896];return _0x27d303;};'use strict';var util=require(_0x734b('0x0'));var BPromise=require(_0x734b('0x1'));var jayson=require(_0x734b('0x2'));var _=require(_0x734b('0x3'));var logger=require(_0x734b('0x4'))('routing');var client=jayson[_0x734b('0x5')][_0x734b('0x6')]({'port':0x232a});function request(_0x18e392,_0xacb598){return new BPromise(function(_0xcc51fb,_0x1b4c95){return client[_0x734b('0x7')](_0x18e392,_0xacb598)[_0x734b('0x8')](function(_0x13daaa){if(_0x13daaa[_0x734b('0x9')]){return _0x1b4c95(_0x13daaa[_0x734b('0x9')][_0x734b('0xa')]);}else{return _0xcc51fb(_0x13daaa[_0x734b('0xb')]);}})[_0x734b('0xc')](function(_0x213a47){return _0x1b4c95(_0x213a47);});});}exports[_0x734b('0xd')]=function(_0x1843b2,_0x276156,_0x5db6b5){return function(_0x1c4662){if(_0x5db6b5[_0x734b('0xe')]&&!_0x5db6b5[_0x734b('0xe')][_0x1843b2]){logger[_0x734b('0xf')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x1843b2);return _0x1c4662[_0x734b('0x10')]();}var _0x10faae=[];for(var _0x253f95=0x0;_0x253f95<_0x276156['length'];_0x253f95+=0x1){_0x10faae['push'](request(_0x734b('0x11'),{'command':util[_0x734b('0x12')](_0x734b('0x13'),_0x276156[_0x253f95])})[_0x734b('0x8')](function(_0x44cda6){return _0x44cda6&&_0x44cda6[_0x734b('0xa')]&&_0x44cda6[_0x734b('0xa')][_0x734b('0x14')]('true')>=0x0?!![]:![];})[_0x734b('0xc')](function(_0x47d190){logger['error'](_0x734b('0x15'),_0x1843b2,_0x276156[_0x253f95]);}));}BPromise[_0x734b('0x16')](_0x10faae)[_0x734b('0x8')](function(_0x35927d){var _0x17e51c=_[_0x734b('0x17')](_0x35927d);logger[_0x734b('0xf')](_0x734b('0x18'),_0x1843b2,_0x276156[_0x734b('0x19')](_0x734b('0x1a')),_0x17e51c);_0x1c4662[_0x734b('0x1b')](_0x17e51c);})[_0x734b('0xc')](function(_0xbe6b9d){console['log'](_0xbe6b9d);logger[_0x734b('0x9')](_0x734b('0x18'),_0x1843b2,_0x276156['join'](_0x734b('0x1a')),_0xbe6b9d[_0x734b('0x1c')]);_0x1c4662[_0x734b('0x10')]();});};};
\ No newline at end of file
+var _0x0780=['http','request','then','error','message','result','catch','condition','rules','info','length','format','iftime\x20%s','indexOf','true','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','stack','stop','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client'];(function(_0x44dc4c,_0x357e6a){var _0x4e644e=function(_0x2f033e){while(--_0x2f033e){_0x44dc4c['push'](_0x44dc4c['shift']());}};_0x4e644e(++_0x357e6a);}(_0x0780,0x11b));var _0x0078=function(_0x2dd688,_0x22a2b9){_0x2dd688=_0x2dd688-0x0;var _0x4bd6c3=_0x0780[_0x2dd688];return _0x4bd6c3;};'use strict';var util=require(_0x0078('0x0'));var BPromise=require(_0x0078('0x1'));var jayson=require(_0x0078('0x2'));var _=require(_0x0078('0x3'));var logger=require(_0x0078('0x4'))(_0x0078('0x5'));var client=jayson[_0x0078('0x6')][_0x0078('0x7')]({'port':0x232a});function request(_0x567681,_0x50a28b){return new BPromise(function(_0x2506ef,_0x584dbf){return client[_0x0078('0x8')](_0x567681,_0x50a28b)[_0x0078('0x9')](function(_0x5281dc){if(_0x5281dc[_0x0078('0xa')]){return _0x584dbf(_0x5281dc[_0x0078('0xa')][_0x0078('0xb')]);}else{return _0x2506ef(_0x5281dc[_0x0078('0xc')]);}})[_0x0078('0xd')](function(_0x288e90){return _0x584dbf(_0x288e90);});});}exports[_0x0078('0xe')]=function(_0x2e7871,_0x54a4ce,_0x361f1e){return function(_0x4a5d23){if(_0x361f1e[_0x0078('0xf')]&&!_0x361f1e[_0x0078('0xf')][_0x2e7871]){logger[_0x0078('0x10')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x2e7871);return _0x4a5d23['stop']();}var _0x4a7266=[];for(var _0x16317b=0x0;_0x16317b<_0x54a4ce[_0x0078('0x11')];_0x16317b+=0x1){_0x4a7266['push'](request('Command',{'command':util[_0x0078('0x12')](_0x0078('0x13'),_0x54a4ce[_0x16317b])})[_0x0078('0x9')](function(_0x437322){return _0x437322&&_0x437322[_0x0078('0xb')]&&_0x437322[_0x0078('0xb')][_0x0078('0x14')](_0x0078('0x15'))>=0x0?!![]:![];})[_0x0078('0xd')](function(_0x32c039){logger[_0x0078('0xa')]('[%s][INTERVAL]\x20%s',_0x2e7871,_0x54a4ce[_0x16317b]);}));}BPromise['all'](_0x4a7266)[_0x0078('0x9')](function(_0x27fe2d){var _0x445b6b=_[_0x0078('0x16')](_0x27fe2d);logger[_0x0078('0x10')](_0x0078('0x17'),_0x2e7871,_0x54a4ce[_0x0078('0x18')](_0x0078('0x19')),_0x445b6b);_0x4a5d23['when'](_0x445b6b);})[_0x0078('0xd')](function(_0x3fb88e){console[_0x0078('0x1a')](_0x3fb88e);logger[_0x0078('0xa')](_0x0078('0x17'),_0x2e7871,_0x54a4ce[_0x0078('0x18')](_0x0078('0x19')),_0x3fb88e[_0x0078('0x1b')]);_0x4a5d23[_0x0078('0x1c')]();});};};
\ No newline at end of file
index 3b1c57d..9d363ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80ed=['secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','clone','calleridname','hangup','[%s][agents][hangup]','timeout','cause','rejected','indexOf','splice','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agent','lodash','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','calleridnum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','[%s][agents][agentcalled]','agentcalledAt','called','connectedlinenum','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','debug','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transfereeuniqueid','agententerreason'];(function(_0x5aa934,_0x5bb0dc){var _0xf8e785=function(_0x3c4919){while(--_0x3c4919){_0x5aa934['push'](_0x5aa934['shift']());}};_0xf8e785(++_0x5bb0dc);}(_0x80ed,0x11c));var _0xd80e=function(_0x4d274e,_0x2b7aaa){_0x4d274e=_0x4d274e-0x0;var _0x1457d4=_0x80ed[_0x4d274e];return _0x1457d4;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var utils=require(_0xd80e('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x182da3,_0x4329e5){utils['info'](util[_0xd80e('0x2')](_0xd80e('0x3'),_0x182da3[_0xd80e('0x4')],_0x182da3[_0xd80e('0x5')],_0x182da3['queue'],_0x182da3[_0xd80e('0x6')],_0x182da3[_0xd80e('0x7')],_0x182da3[_0xd80e('0x8')],_0x182da3['connectedlinenum'],_0x182da3[_0xd80e('0x9')]));if(_0x182da3[_0xd80e('0xa')]){utils[_0xd80e('0xb')](_0x182da3[_0xd80e('0xa')])[_0xd80e('0xc')](function(_0x298c29){if(_0x298c29){_0x182da3[_0xd80e('0xd')]=_0x298c29[_0xd80e('0xd')];_0x182da3[_0xd80e('0xe')]=_0x182da3[_0xd80e('0xf')]?_0x298c29['acw']:![];_0x182da3[_0xd80e('0x10')]=_0x182da3[_0xd80e('0xe')]?_0x298c29[_0xd80e('0x11')]:0x0;}utils[_0xd80e('0x12')](_0xd80e('0x13'),_0x182da3);});}else{utils[_0xd80e('0x12')](_0xd80e('0x13'),_0x182da3);}if(_0x4329e5){delete transfers[_0x182da3[_0xd80e('0x4')]];}else{delete agents[_0x182da3[_0xd80e('0x14')]];}}exports['agentcalled']=function(_0x5691a1){try{utils['debug'](util['format'](_0xd80e('0x15'),_0x5691a1[_0xd80e('0x4')]),_0x5691a1);agents[_0x5691a1[_0xd80e('0x14')]]=_0x5691a1;agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x16')]=utils['now']();agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x9')]=_0xd80e('0x17');agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x18')]=null;agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x19')]=null;utils[_0xd80e('0x1a')](util['format'](_0xd80e('0x1b'),_0x5691a1[_0xd80e('0x4')],agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x6')],_0x5691a1['destuniqueid']));}catch(_0x39397a){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')]('[%s][agents][agentcalled]',_0x5691a1[_0xd80e('0x4')]),_0x39397a);}};exports[_0xd80e('0x1d')]=function(_0x2765ea){try{if(!_[_0xd80e('0x1e')](agents[_0x2765ea[_0xd80e('0x14')]])){utils['debug'](util['format'](_0xd80e('0x1f'),_0x2765ea[_0xd80e('0x4')]),_0x2765ea);utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x20'),_0x2765ea[_0xd80e('0x4')],agents[_0x2765ea[_0xd80e('0x14')]]['membername'],_0x2765ea[_0xd80e('0x14')]));agents[_0x2765ea[_0xd80e('0x14')]][_0xd80e('0x1d')]=!![];agents[_0x2765ea['destuniqueid']][_0xd80e('0x21')]=utils[_0xd80e('0x22')]();agents[_0x2765ea[_0xd80e('0x14')]]['lastevent']='timeout';agents[_0x2765ea['destuniqueid']][_0xd80e('0x23')]='timeout';agents[_0x2765ea[_0xd80e('0x14')]][_0xd80e('0x24')]=_0x2765ea['ringtime']?parseInt(_0x2765ea[_0xd80e('0x25')])/0x3e8:0x0;agents[_0x2765ea[_0xd80e('0x14')]][_0xd80e('0x26')]=0x0;unanswered[_0xd80e('0x27')](_0x2765ea['destuniqueid']);}}catch(_0x15f317){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')](_0xd80e('0x1f'),_0x2765ea[_0xd80e('0x4')]),_0x15f317);}};exports[_0xd80e('0x28')]=function(_0x289685){try{_[_0xd80e('0x29')](agents,function(_0x5522dd,_0x54504e){if(_0x5522dd[_0xd80e('0x4')]==_0x289685[_0xd80e('0x4')]&&!_[_0xd80e('0x2a')](unanswered,_0x5522dd[_0xd80e('0x14')])){utils[_0xd80e('0x2b')](util[_0xd80e('0x2')]('[%s][agents][queuecallerabandon]',_0x289685['uniqueid']),_0x289685);utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x2c'),_0x289685[_0xd80e('0x4')],_0x5522dd[_0xd80e('0x6')],_0x5522dd[_0xd80e('0x14')]));_0x5522dd[_0xd80e('0x1d')]=!![];_0x5522dd[_0xd80e('0x21')]=utils['now']();_0x5522dd['lastevent']=_0xd80e('0x2d');_0x5522dd[_0xd80e('0x23')]=_0xd80e('0x2d');_0x5522dd[_0xd80e('0x24')]=_0x289685[_0xd80e('0x24')];_0x5522dd[_0xd80e('0x26')]=0x0;writeDB(_0x5522dd);}});}catch(_0x17b8c7){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')](_0xd80e('0x2e'),_0x289685['uniqueid']),_0x17b8c7);}};exports[_0xd80e('0x2f')]=function(_0x490432){try{if(agents[_0x490432[_0xd80e('0x14')]]){utils[_0xd80e('0x2b')](util[_0xd80e('0x2')](_0xd80e('0x30'),_0x490432['uniqueid']),_0x490432);utils[_0xd80e('0x1a')](util['format'](_0xd80e('0x31'),_0x490432['uniqueid'],agents[_0x490432[_0xd80e('0x14')]][_0xd80e('0x6')],_0x490432['destuniqueid']));agents[_0x490432[_0xd80e('0x14')]][_0xd80e('0x32')]=utils[_0xd80e('0x22')]();agents[_0x490432['destuniqueid']][_0xd80e('0x18')]=_0x490432[_0xd80e('0x18')];agents[_0x490432[_0xd80e('0x14')]][_0xd80e('0x19')]=_0x490432[_0xd80e('0x19')];agents[_0x490432[_0xd80e('0x14')]][_0xd80e('0x24')]=_0x490432[_0xd80e('0x25')];agents[_0x490432[_0xd80e('0x14')]]['lastevent']='connect';_['forIn'](agents,function(_0x161455,_0x3ff4b4){if(_0x161455['destuniqueid']!=_0x490432[_0xd80e('0x14')]&&_0x161455['uniqueid']==_0x490432[_0xd80e('0x4')]){_0x161455['talktime']=0x0;_0x161455[_0xd80e('0x24')]=_0x490432[_0xd80e('0x25')];_0x161455['agentringnoanswer']=!![];_0x161455['agentringnoanswerAt']=utils[_0xd80e('0x22')]();_0x161455[_0xd80e('0x9')]=_0xd80e('0x33');_0x161455[_0xd80e('0x23')]=_0xd80e('0x33');_0x161455[_0xd80e('0x34')]=_0x490432[_0xd80e('0x14')];_0x161455[_0xd80e('0x35')]=_0x490432[_0xd80e('0x6')];writeDB(_0x161455);}});}}catch(_0x2da5f5){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')](_0xd80e('0x30'),_0x490432[_0xd80e('0x4')]),_0x2da5f5);}};exports[_0xd80e('0xf')]=function(_0x7f80a){try{if(!_['isNil'](agents[_0x7f80a['destuniqueid']])){utils['debug'](util[_0xd80e('0x2')]('[%s][agents][agentcomplete]',_0x7f80a[_0xd80e('0x4')]),_0x7f80a);utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x36'),_0x7f80a[_0xd80e('0x4')],agents[_0x7f80a[_0xd80e('0x14')]]['membername'],_0x7f80a['destuniqueid']));agents[_0x7f80a['destuniqueid']][_0xd80e('0xf')]=!![];agents[_0x7f80a['destuniqueid']][_0xd80e('0x37')]=utils[_0xd80e('0x22')]();agents[_0x7f80a[_0xd80e('0x14')]][_0xd80e('0x26')]=utils[_0xd80e('0x38')](agents[_0x7f80a['destuniqueid']][_0xd80e('0x37')],agents[_0x7f80a[_0xd80e('0x14')]][_0xd80e('0x32')]);agents[_0x7f80a['destuniqueid']][_0xd80e('0x23')]=_0x7f80a[_0xd80e('0x23')];agents[_0x7f80a[_0xd80e('0x14')]]['lastevent']=_0xd80e('0x39');writeDB(agents[_0x7f80a[_0xd80e('0x14')]]);}}catch(_0xf0d5aa){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')](_0xd80e('0x3a'),_0x7f80a['uniqueid']),_0xf0d5aa);}};exports['blindtransfer']=function(_0x275985){try{if(!_[_0xd80e('0x1e')](agents[_0x275985[_0xd80e('0x3b')]])){utils['debug'](util['format'](_0xd80e('0x3c'),_0x275985[_0xd80e('0x4')]),_0x275985);utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x3d'),_0x275985['uniqueid'],agents[_0x275985[_0xd80e('0x3b')]]['membername'],agents[_0x275985[_0xd80e('0x3b')]][_0xd80e('0x4')]));agents[_0x275985['transfereruniqueid']][_0xd80e('0x3e')]=!![];agents[_0x275985[_0xd80e('0x3b')]][_0xd80e('0x3f')]=_0xd80e('0x40');agents[_0x275985[_0xd80e('0x3b')]][_0xd80e('0x41')]=_0x275985[_0xd80e('0x42')];agents[_0x275985['transfereruniqueid']][_0xd80e('0x43')]=agents[_0x275985[_0xd80e('0x3b')]][_0xd80e('0x4')];}}catch(_0x4a66ca){utils['error'](util[_0xd80e('0x2')](_0xd80e('0x3c'),_0x275985[_0xd80e('0x4')]),_0x4a66ca);}};exports[_0xd80e('0x44')]=function(_0x2f66eb){try{utils[_0xd80e('0x2b')](util[_0xd80e('0x2')](_0xd80e('0x45'),_0x2f66eb['origtransfereruniqueid']),_0x2f66eb);if(_0x2f66eb[_0xd80e('0x46')]==_0x2f66eb['origtransfererlinkedid']){if(!_[_0xd80e('0x1e')](agents[_0x2f66eb[_0xd80e('0x47')]])){utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x48'),_0x2f66eb[_0xd80e('0x46')],agents[_0x2f66eb['secondtransfereruniqueid']][_0xd80e('0x6')]));agents[_0x2f66eb['secondtransfereruniqueid']][_0xd80e('0x3e')]=!![];agents[_0x2f66eb[_0xd80e('0x47')]]['transfertype']='ATTENDED';agents[_0x2f66eb[_0xd80e('0x47')]][_0xd80e('0x41')]=_0x2f66eb[_0xd80e('0x49')];agents[_0x2f66eb['secondtransfereruniqueid']]['transferuniqueid']=_0x2f66eb[_0xd80e('0x46')];}if(_0x2f66eb[_0xd80e('0x4a')]&&agents[_0x2f66eb['transfereeuniqueid']]){agents[_0x2f66eb[_0xd80e('0x4a')]][_0xd80e('0x4b')]=0x1;transfers[_0x2f66eb[_0xd80e('0x4a')]]=_['clone'](agents[_0x2f66eb[_0xd80e('0x4a')]]);transfers[_0x2f66eb['transfereeuniqueid']][_0xd80e('0x8')]=agents[_0x2f66eb[_0xd80e('0x47')]][_0xd80e('0x8')];transfers[_0x2f66eb[_0xd80e('0x4a')]]['calleridname']=agents[_0x2f66eb[_0xd80e('0x47')]]['calleridname'];transfers[_0x2f66eb[_0xd80e('0x4a')]]['agentcalledAt']=utils[_0xd80e('0x22')]();transfers[_0x2f66eb[_0xd80e('0x4a')]][_0xd80e('0x32')]=utils[_0xd80e('0x22')]();transfers[_0x2f66eb['transfereeuniqueid']][_0xd80e('0x24')]=0x0;transfers[_0x2f66eb[_0xd80e('0x4a')]]['agententerreason']=0x2;}}else if(_0x2f66eb[_0xd80e('0x47')]==_0x2f66eb[_0xd80e('0x4c')]){if(!_[_0xd80e('0x1e')](agents[_0x2f66eb[_0xd80e('0x46')]])){utils['info'](util[_0xd80e('0x2')](_0xd80e('0x48'),_0x2f66eb['origtransfereruniqueid'],agents[_0x2f66eb[_0xd80e('0x46')]][_0xd80e('0x6')]));agents[_0x2f66eb[_0xd80e('0x46')]]['transfer']=!![];agents[_0x2f66eb['origtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x2f66eb[_0xd80e('0x46')]]['transferexten']=_0x2f66eb[_0xd80e('0x4d')];agents[_0x2f66eb[_0xd80e('0x46')]][_0xd80e('0x43')]=_0x2f66eb['secondtransfereruniqueid'];}if(_0x2f66eb[_0xd80e('0x4e')]&&agents[_0x2f66eb[_0xd80e('0x4e')]]){agents[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x4b')]=0x1;transfers[_0x2f66eb[_0xd80e('0x4e')]]=_[_0xd80e('0x4f')](agents[_0x2f66eb[_0xd80e('0x4e')]]);transfers[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x8')]=agents[_0x2f66eb['origtransfereruniqueid']]['calleridnum'];transfers[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x50')]=agents[_0x2f66eb[_0xd80e('0x46')]][_0xd80e('0x50')];transfers[_0x2f66eb['transfertargetuniqueid']][_0xd80e('0x16')]=utils[_0xd80e('0x22')]();transfers[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x32')]=utils[_0xd80e('0x22')]();transfers[_0x2f66eb['transfertargetuniqueid']][_0xd80e('0x24')]=0x0;transfers[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x4b')]=0x2;}}}catch(_0x1676c7){utils['error'](util[_0xd80e('0x2')](_0xd80e('0x45'),_0x2f66eb[_0xd80e('0x46')]),_0x1676c7);}};exports[_0xd80e('0x51')]=function(_0x433782){try{utils[_0xd80e('0x2b')](util['format'](_0xd80e('0x52'),_0x433782[_0xd80e('0x4')]),_0x433782);if(agents[_0x433782['uniqueid']]&&agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x23')]===_0xd80e('0x53')){if(_0x433782[_0xd80e('0x54')]==='21'){agents[_0x433782['uniqueid']][_0xd80e('0x23')]='rejected';agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]=_0xd80e('0x55');}utils[_0xd80e('0x1a')](util[_0xd80e('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x433782[_0xd80e('0x4')],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x6')],agents[_0x433782[_0xd80e('0x4')]]['reason'],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]));writeDB(agents[_0x433782['uniqueid']]);var _0x2597a3=unanswered[_0xd80e('0x56')](_0x433782[_0xd80e('0x4')]);if(_0x2597a3>-0x1){unanswered[_0xd80e('0x57')](_0x2597a3,0x1);}}if(transfers[_0x433782[_0xd80e('0x4')]]){transfers[_0x433782[_0xd80e('0x4')]]['agentcomplete']=!![];transfers[_0x433782['uniqueid']][_0xd80e('0x37')]=utils['now']();transfers[_0x433782['uniqueid']][_0xd80e('0x26')]=utils[_0xd80e('0x38')](transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x37')],transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x32')]);transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x23')]='agent';transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]=_0xd80e('0x39');utils[_0xd80e('0x1a')](util['format'](_0xd80e('0x58'),_0x433782[_0xd80e('0x4')],transfers[_0x433782['uniqueid']][_0xd80e('0x6')],transfers[_0x433782[_0xd80e('0x4')]]['reason'],transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]));writeDB(transfers[_0x433782[_0xd80e('0x4')]],!![]);}if(agents[_0x433782[_0xd80e('0x4')]]&&agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x32')]){agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0xf')]=!![];agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x37')]=utils['now']();agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x26')]=utils['diffTime'](agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x37')],agents[_0x433782[_0xd80e('0x4')]]['agentconnectAt']);agents[_0x433782[_0xd80e('0x4')]]['reason']=agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x3e')]?_0xd80e('0x3e'):_0xd80e('0x59');agents[_0x433782[_0xd80e('0x4')]]['lastevent']=_0xd80e('0x39');utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x58'),_0x433782[_0xd80e('0x4')],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x6')],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x23')],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]));writeDB(agents[_0x433782[_0xd80e('0x4')]]);}}catch(_0x31fd22){utils[_0xd80e('0x1c')](util['format'](_0xd80e('0x52'),_0x433782['uniqueid']),_0x31fd22);}};
\ No newline at end of file
+var _0x6324=['[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','lastevent','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','abandoned','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connect','forIn','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','complete','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','ATTENDED','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','calleridnum','connectedlinenum','queue','getVoiceQueueByName','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','uniqueid','agentcalled','debug','format','destuniqueid','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error'];(function(_0x4adb9b,_0x1a3916){var _0x1329b7=function(_0x1fec5e){while(--_0x1fec5e){_0x4adb9b['push'](_0x4adb9b['shift']());}};_0x1329b7(++_0x1a3916);}(_0x6324,0x142));var _0x4632=function(_0x2e5249,_0xa4eed1){_0x2e5249=_0x2e5249-0x0;var _0x3f59fc=_0x6324[_0x2e5249];return _0x3f59fc;};'use strict';var _=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var utils=require(_0x4632('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2fc528,_0x551054){utils[_0x4632('0x3')](util['format'](_0x4632('0x4'),_0x2fc528['uniqueid'],_0x2fc528[_0x4632('0x5')],_0x2fc528['queue'],_0x2fc528[_0x4632('0x6')],_0x2fc528[_0x4632('0x7')],_0x2fc528[_0x4632('0x8')],_0x2fc528[_0x4632('0x9')],_0x2fc528['lastevent']));if(_0x2fc528[_0x4632('0xa')]){utils[_0x4632('0xb')](_0x2fc528[_0x4632('0xa')])['then'](function(_0xc3bc9e){if(_0xc3bc9e){_0x2fc528[_0x4632('0xc')]=_0xc3bc9e['type'];_0x2fc528['agentacw']=_0x2fc528[_0x4632('0xd')]?_0xc3bc9e[_0x4632('0xe')]:![];_0x2fc528[_0x4632('0xf')]=_0x2fc528[_0x4632('0x10')]?_0xc3bc9e[_0x4632('0x11')]:0x0;}utils[_0x4632('0x12')](_0x4632('0x13'),_0x2fc528);});}else{utils[_0x4632('0x12')]('CreateVoiceAgentReport',_0x2fc528);}if(_0x551054){delete transfers[_0x2fc528[_0x4632('0x14')]];}else{delete agents[_0x2fc528['destuniqueid']];}}exports[_0x4632('0x15')]=function(_0x299073){try{utils[_0x4632('0x16')](util[_0x4632('0x17')]('[%s][agents][agentcalled]',_0x299073[_0x4632('0x14')]),_0x299073);agents[_0x299073[_0x4632('0x18')]]=_0x299073;agents[_0x299073[_0x4632('0x18')]][_0x4632('0x19')]=utils[_0x4632('0x1a')]();agents[_0x299073['destuniqueid']]['lastevent']=_0x4632('0x1b');agents[_0x299073[_0x4632('0x18')]][_0x4632('0x9')]=null;agents[_0x299073[_0x4632('0x18')]]['connectedlinename']=null;utils[_0x4632('0x3')](util[_0x4632('0x17')](_0x4632('0x1c'),_0x299073['uniqueid'],agents[_0x299073[_0x4632('0x18')]][_0x4632('0x6')],_0x299073['destuniqueid']));}catch(_0x4ec0cd){utils[_0x4632('0x1d')](util[_0x4632('0x17')](_0x4632('0x1e'),_0x299073[_0x4632('0x14')]),_0x4ec0cd);}};exports[_0x4632('0x1f')]=function(_0x3d2d23){try{if(!_[_0x4632('0x20')](agents[_0x3d2d23[_0x4632('0x18')]])){utils[_0x4632('0x16')](util[_0x4632('0x17')](_0x4632('0x21'),_0x3d2d23[_0x4632('0x14')]),_0x3d2d23);utils[_0x4632('0x3')](util[_0x4632('0x17')](_0x4632('0x22'),_0x3d2d23[_0x4632('0x14')],agents[_0x3d2d23[_0x4632('0x18')]][_0x4632('0x6')],_0x3d2d23[_0x4632('0x18')]));agents[_0x3d2d23[_0x4632('0x18')]][_0x4632('0x1f')]=!![];agents[_0x3d2d23[_0x4632('0x18')]][_0x4632('0x23')]=utils[_0x4632('0x1a')]();agents[_0x3d2d23[_0x4632('0x18')]][_0x4632('0x24')]=_0x4632('0x25');agents[_0x3d2d23[_0x4632('0x18')]][_0x4632('0x26')]=_0x4632('0x25');agents[_0x3d2d23[_0x4632('0x18')]][_0x4632('0x27')]=_0x3d2d23[_0x4632('0x28')]?parseInt(_0x3d2d23['ringtime'])/0x3e8:0x0;agents[_0x3d2d23['destuniqueid']][_0x4632('0x29')]=0x0;unanswered[_0x4632('0x2a')](_0x3d2d23[_0x4632('0x18')]);}}catch(_0x35a533){utils[_0x4632('0x1d')](util[_0x4632('0x17')](_0x4632('0x21'),_0x3d2d23['uniqueid']),_0x35a533);}};exports[_0x4632('0x2b')]=function(_0x135fd2){try{_['forIn'](agents,function(_0x216119,_0x5316f7){if(_0x216119[_0x4632('0x14')]==_0x135fd2['uniqueid']&&!_['includes'](unanswered,_0x216119[_0x4632('0x18')])){utils[_0x4632('0x16')](util[_0x4632('0x17')]('[%s][agents][queuecallerabandon]',_0x135fd2['uniqueid']),_0x135fd2);utils[_0x4632('0x3')](util[_0x4632('0x17')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x135fd2['uniqueid'],_0x216119[_0x4632('0x6')],_0x216119[_0x4632('0x18')]));_0x216119['agentringnoanswer']=!![];_0x216119[_0x4632('0x23')]=utils[_0x4632('0x1a')]();_0x216119[_0x4632('0x24')]=_0x4632('0x2c');_0x216119[_0x4632('0x26')]='abandoned';_0x216119[_0x4632('0x27')]=_0x135fd2[_0x4632('0x27')];_0x216119['talktime']=0x0;writeDB(_0x216119);}});}catch(_0x5f4f24){utils[_0x4632('0x1d')](util['format']('[%s][agents][queuecallerabandon]',_0x135fd2[_0x4632('0x14')]),_0x5f4f24);}};exports['agentconnect']=function(_0x318416){try{if(agents[_0x318416[_0x4632('0x18')]]){utils[_0x4632('0x16')](util['format'](_0x4632('0x2d'),_0x318416[_0x4632('0x14')]),_0x318416);utils[_0x4632('0x3')](util[_0x4632('0x17')](_0x4632('0x2e'),_0x318416['uniqueid'],agents[_0x318416['destuniqueid']][_0x4632('0x6')],_0x318416[_0x4632('0x18')]));agents[_0x318416[_0x4632('0x18')]]['agentconnectAt']=utils['now']();agents[_0x318416['destuniqueid']][_0x4632('0x9')]=_0x318416[_0x4632('0x9')];agents[_0x318416['destuniqueid']][_0x4632('0x2f')]=_0x318416[_0x4632('0x2f')];agents[_0x318416[_0x4632('0x18')]][_0x4632('0x27')]=_0x318416[_0x4632('0x28')];agents[_0x318416[_0x4632('0x18')]][_0x4632('0x24')]=_0x4632('0x30');_[_0x4632('0x31')](agents,function(_0x2c04a8,_0x1fd3f1){if(_0x2c04a8[_0x4632('0x18')]!=_0x318416['destuniqueid']&&_0x2c04a8[_0x4632('0x14')]==_0x318416[_0x4632('0x14')]){_0x2c04a8['talktime']=0x0;_0x2c04a8[_0x4632('0x27')]=_0x318416[_0x4632('0x28')];_0x2c04a8['agentringnoanswer']=!![];_0x2c04a8[_0x4632('0x23')]=utils['now']();_0x2c04a8[_0x4632('0x24')]=_0x4632('0x32');_0x2c04a8[_0x4632('0x26')]=_0x4632('0x32');_0x2c04a8['answeredelsewheredestinationuniqueid']=_0x318416[_0x4632('0x18')];_0x2c04a8[_0x4632('0x33')]=_0x318416[_0x4632('0x6')];writeDB(_0x2c04a8);}});}}catch(_0x279298){utils['error'](util['format'](_0x4632('0x2d'),_0x318416[_0x4632('0x14')]),_0x279298);}};exports[_0x4632('0xd')]=function(_0x512db1){try{if(!_[_0x4632('0x20')](agents[_0x512db1[_0x4632('0x18')]])){utils[_0x4632('0x16')](util[_0x4632('0x17')](_0x4632('0x34'),_0x512db1[_0x4632('0x14')]),_0x512db1);utils[_0x4632('0x3')](util['format'](_0x4632('0x35'),_0x512db1[_0x4632('0x14')],agents[_0x512db1[_0x4632('0x18')]][_0x4632('0x6')],_0x512db1[_0x4632('0x18')]));agents[_0x512db1['destuniqueid']]['agentcomplete']=!![];agents[_0x512db1[_0x4632('0x18')]][_0x4632('0x36')]=utils[_0x4632('0x1a')]();agents[_0x512db1[_0x4632('0x18')]]['talktime']=utils[_0x4632('0x37')](agents[_0x512db1[_0x4632('0x18')]][_0x4632('0x36')],agents[_0x512db1[_0x4632('0x18')]][_0x4632('0x38')]);agents[_0x512db1['destuniqueid']][_0x4632('0x26')]=_0x512db1[_0x4632('0x26')];agents[_0x512db1[_0x4632('0x18')]][_0x4632('0x24')]=_0x4632('0x39');writeDB(agents[_0x512db1[_0x4632('0x18')]]);}}catch(_0x1f72c4){utils[_0x4632('0x1d')](util[_0x4632('0x17')](_0x4632('0x34'),_0x512db1[_0x4632('0x14')]),_0x1f72c4);}};exports['blindtransfer']=function(_0xc3ffd0){try{if(!_[_0x4632('0x20')](agents[_0xc3ffd0[_0x4632('0x3a')]])){utils['debug'](util[_0x4632('0x17')](_0x4632('0x3b'),_0xc3ffd0[_0x4632('0x14')]),_0xc3ffd0);utils[_0x4632('0x3')](util[_0x4632('0x17')](_0x4632('0x3c'),_0xc3ffd0[_0x4632('0x14')],agents[_0xc3ffd0[_0x4632('0x3a')]][_0x4632('0x6')],agents[_0xc3ffd0[_0x4632('0x3a')]]['uniqueid']));agents[_0xc3ffd0[_0x4632('0x3a')]][_0x4632('0x3d')]=!![];agents[_0xc3ffd0['transfereruniqueid']][_0x4632('0x3e')]=_0x4632('0x3f');agents[_0xc3ffd0[_0x4632('0x3a')]][_0x4632('0x40')]=_0xc3ffd0[_0x4632('0x41')];agents[_0xc3ffd0[_0x4632('0x3a')]][_0x4632('0x42')]=agents[_0xc3ffd0[_0x4632('0x3a')]][_0x4632('0x14')];}}catch(_0x1b66e0){utils[_0x4632('0x1d')](util[_0x4632('0x17')](_0x4632('0x3b'),_0xc3ffd0[_0x4632('0x14')]),_0x1b66e0);}};exports[_0x4632('0x43')]=function(_0x2fe21a){try{utils[_0x4632('0x16')](util[_0x4632('0x17')](_0x4632('0x44'),_0x2fe21a[_0x4632('0x45')]),_0x2fe21a);if(_0x2fe21a['origtransfereruniqueid']==_0x2fe21a[_0x4632('0x46')]){if(!_[_0x4632('0x20')](agents[_0x2fe21a[_0x4632('0x47')]])){utils[_0x4632('0x3')](util[_0x4632('0x17')](_0x4632('0x48'),_0x2fe21a['origtransfereruniqueid'],agents[_0x2fe21a[_0x4632('0x47')]][_0x4632('0x6')]));agents[_0x2fe21a[_0x4632('0x47')]]['transfer']=!![];agents[_0x2fe21a[_0x4632('0x47')]][_0x4632('0x3e')]='ATTENDED';agents[_0x2fe21a[_0x4632('0x47')]][_0x4632('0x40')]=_0x2fe21a[_0x4632('0x49')];agents[_0x2fe21a['secondtransfereruniqueid']][_0x4632('0x42')]=_0x2fe21a[_0x4632('0x45')];}if(_0x2fe21a[_0x4632('0x4a')]&&agents[_0x2fe21a[_0x4632('0x4a')]]){agents[_0x2fe21a[_0x4632('0x4a')]][_0x4632('0x4b')]=0x1;transfers[_0x2fe21a[_0x4632('0x4a')]]=_[_0x4632('0x4c')](agents[_0x2fe21a[_0x4632('0x4a')]]);transfers[_0x2fe21a[_0x4632('0x4a')]]['calleridnum']=agents[_0x2fe21a[_0x4632('0x47')]][_0x4632('0x8')];transfers[_0x2fe21a['transfereeuniqueid']][_0x4632('0x4d')]=agents[_0x2fe21a['secondtransfereruniqueid']]['calleridname'];transfers[_0x2fe21a[_0x4632('0x4a')]][_0x4632('0x19')]=utils[_0x4632('0x1a')]();transfers[_0x2fe21a[_0x4632('0x4a')]][_0x4632('0x38')]=utils[_0x4632('0x1a')]();transfers[_0x2fe21a[_0x4632('0x4a')]][_0x4632('0x27')]=0x0;transfers[_0x2fe21a[_0x4632('0x4a')]][_0x4632('0x4b')]=0x2;}}else if(_0x2fe21a[_0x4632('0x47')]==_0x2fe21a[_0x4632('0x4e')]){if(!_[_0x4632('0x20')](agents[_0x2fe21a[_0x4632('0x45')]])){utils['info'](util['format'](_0x4632('0x48'),_0x2fe21a[_0x4632('0x45')],agents[_0x2fe21a[_0x4632('0x45')]][_0x4632('0x6')]));agents[_0x2fe21a[_0x4632('0x45')]][_0x4632('0x3d')]=!![];agents[_0x2fe21a['origtransfereruniqueid']][_0x4632('0x3e')]=_0x4632('0x4f');agents[_0x2fe21a[_0x4632('0x45')]][_0x4632('0x40')]=_0x2fe21a['secondtransfererexten'];agents[_0x2fe21a['origtransfereruniqueid']][_0x4632('0x42')]=_0x2fe21a['secondtransfereruniqueid'];}if(_0x2fe21a[_0x4632('0x50')]&&agents[_0x2fe21a[_0x4632('0x50')]]){agents[_0x2fe21a[_0x4632('0x50')]][_0x4632('0x4b')]=0x1;transfers[_0x2fe21a[_0x4632('0x50')]]=_['clone'](agents[_0x2fe21a[_0x4632('0x50')]]);transfers[_0x2fe21a[_0x4632('0x50')]]['calleridnum']=agents[_0x2fe21a['origtransfereruniqueid']][_0x4632('0x8')];transfers[_0x2fe21a[_0x4632('0x50')]][_0x4632('0x4d')]=agents[_0x2fe21a[_0x4632('0x45')]]['calleridname'];transfers[_0x2fe21a['transfertargetuniqueid']]['agentcalledAt']=utils[_0x4632('0x1a')]();transfers[_0x2fe21a['transfertargetuniqueid']][_0x4632('0x38')]=utils[_0x4632('0x1a')]();transfers[_0x2fe21a[_0x4632('0x50')]][_0x4632('0x27')]=0x0;transfers[_0x2fe21a[_0x4632('0x50')]][_0x4632('0x4b')]=0x2;}}}catch(_0x392bd4){utils[_0x4632('0x1d')](util[_0x4632('0x17')](_0x4632('0x44'),_0x2fe21a[_0x4632('0x45')]),_0x392bd4);}};exports[_0x4632('0x51')]=function(_0x1c5c49){try{utils[_0x4632('0x16')](util[_0x4632('0x17')](_0x4632('0x52'),_0x1c5c49['uniqueid']),_0x1c5c49);if(agents[_0x1c5c49[_0x4632('0x14')]]&&agents[_0x1c5c49[_0x4632('0x14')]][_0x4632('0x26')]===_0x4632('0x25')){if(_0x1c5c49[_0x4632('0x53')]==='21'){agents[_0x1c5c49[_0x4632('0x14')]][_0x4632('0x26')]=_0x4632('0x54');agents[_0x1c5c49[_0x4632('0x14')]][_0x4632('0x24')]=_0x4632('0x54');}utils[_0x4632('0x3')](util[_0x4632('0x17')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1c5c49[_0x4632('0x14')],agents[_0x1c5c49[_0x4632('0x14')]][_0x4632('0x6')],agents[_0x1c5c49[_0x4632('0x14')]][_0x4632('0x26')],agents[_0x1c5c49[_0x4632('0x14')]]['lastevent']));writeDB(agents[_0x1c5c49[_0x4632('0x14')]]);var _0x11161a=unanswered['indexOf'](_0x1c5c49[_0x4632('0x14')]);if(_0x11161a>-0x1){unanswered[_0x4632('0x55')](_0x11161a,0x1);}}if(transfers[_0x1c5c49[_0x4632('0x14')]]){transfers[_0x1c5c49[_0x4632('0x14')]][_0x4632('0xd')]=!![];transfers[_0x1c5c49['uniqueid']][_0x4632('0x36')]=utils[_0x4632('0x1a')]();transfers[_0x1c5c49[_0x4632('0x14')]]['talktime']=utils[_0x4632('0x37')](transfers[_0x1c5c49[_0x4632('0x14')]][_0x4632('0x36')],transfers[_0x1c5c49[_0x4632('0x14')]][_0x4632('0x38')]);transfers[_0x1c5c49[_0x4632('0x14')]][_0x4632('0x26')]=_0x4632('0x56');transfers[_0x1c5c49['uniqueid']][_0x4632('0x24')]=_0x4632('0x39');utils[_0x4632('0x3')](util['format'](_0x4632('0x57'),_0x1c5c49[_0x4632('0x14')],transfers[_0x1c5c49['uniqueid']]['membername'],transfers[_0x1c5c49[_0x4632('0x14')]][_0x4632('0x26')],transfers[_0x1c5c49['uniqueid']][_0x4632('0x24')]));writeDB(transfers[_0x1c5c49[_0x4632('0x14')]],!![]);}if(agents[_0x1c5c49[_0x4632('0x14')]]&&agents[_0x1c5c49[_0x4632('0x14')]][_0x4632('0x38')]){agents[_0x1c5c49[_0x4632('0x14')]][_0x4632('0xd')]=!![];agents[_0x1c5c49[_0x4632('0x14')]]['agentcompleteAt']=utils[_0x4632('0x1a')]();agents[_0x1c5c49[_0x4632('0x14')]][_0x4632('0x29')]=utils[_0x4632('0x37')](agents[_0x1c5c49['uniqueid']][_0x4632('0x36')],agents[_0x1c5c49[_0x4632('0x14')]][_0x4632('0x38')]);agents[_0x1c5c49[_0x4632('0x14')]][_0x4632('0x26')]=agents[_0x1c5c49['uniqueid']][_0x4632('0x3d')]?_0x4632('0x3d'):_0x4632('0x56');agents[_0x1c5c49[_0x4632('0x14')]][_0x4632('0x24')]=_0x4632('0x39');utils[_0x4632('0x3')](util[_0x4632('0x17')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1c5c49[_0x4632('0x14')],agents[_0x1c5c49[_0x4632('0x14')]][_0x4632('0x6')],agents[_0x1c5c49[_0x4632('0x14')]][_0x4632('0x26')],agents[_0x1c5c49[_0x4632('0x14')]]['lastevent']));writeDB(agents[_0x1c5c49[_0x4632('0x14')]]);}}catch(_0x25dbca){utils[_0x4632('0x1d')](util[_0x4632('0x17')](_0x4632('0x52'),_0x1c5c49[_0x4632('0x14')]),_0x25dbca);}};
\ No newline at end of file
index 4959160..dde6516 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49e5=['./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','calleridnum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','newstate','isNil','channelstate','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','error','hangup','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','endtime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','includes','noop','execif','gotoif','lastdata','lodash','util'];(function(_0x4991db,_0x59916a){var _0x1b297b=function(_0x5227f5){while(--_0x5227f5){_0x4991db['push'](_0x4991db['shift']());}};_0x1b297b(++_0x59916a);}(_0x49e5,0x71));var _0x549e=function(_0x21ce43,_0x54c044){_0x21ce43=_0x21ce43-0x0;var _0x2e5207=_0x49e5[_0x21ce43];return _0x2e5207;};'use strict';var _=require(_0x549e('0x0'));var util=require(_0x549e('0x1'));var utils=require(_0x549e('0x2'));var transfers=require(_0x549e('0x3'));var dispositions=[_0x549e('0x4'),'FAILED',_0x549e('0x5'),_0x549e('0x4'),_0x549e('0x4'),_0x549e('0x4'),_0x549e('0x6'),'BUSY',_0x549e('0x5'),'FAILED','FAILED'];var channels={};function writeDB(_0x44b1e3){var _0x2d83f2;if(transfers[_0x549e('0x7')][_0x44b1e3['uniqueid']]){_0x2d83f2=_0x44b1e3['uniqueid'];_0x44b1e3['uniqueid']=transfers[_0x549e('0x7')][_0x44b1e3[_0x549e('0x8')]][_0x549e('0x9')];}utils[_0x549e('0xa')](util[_0x549e('0xb')](_0x549e('0xc'),_0x44b1e3['uniqueid'],_0x44b1e3[_0x549e('0xd')],_0x44b1e3['queue'],_0x44b1e3[_0x549e('0xe')],_0x44b1e3[_0x549e('0xf')],_0x44b1e3[_0x549e('0x10')],_0x44b1e3['connectedlinenum'],_0x44b1e3[_0x549e('0x11')]));if(_0x44b1e3[_0x549e('0x12')]){utils[_0x549e('0x13')](_0x44b1e3['accountcode'])[_0x549e('0x14')](function(_0x89e3b1){if(_0x89e3b1){_0x44b1e3[_0x549e('0x15')]=_0x89e3b1['id'];}utils[_0x549e('0x16')](_0x549e('0x17'),_0x44b1e3);});}else{utils[_0x549e('0x16')](_0x549e('0x17'),_0x44b1e3);}if(channels[_0x44b1e3[_0x549e('0x8')]]){delete channels[_0x44b1e3[_0x549e('0x8')]];}else if(_0x2d83f2&&channels[_0x2d83f2]){if(!transfers[_0x549e('0x7')][_0x2d83f2][_0x549e('0x18')])delete transfers[_0x549e('0x7')][_0x2d83f2];delete channels[_0x2d83f2];}}exports[_0x549e('0x19')]=function(_0x1c5877){try{utils[_0x549e('0x1a')](util['format'](_0x549e('0x1b'),_0x1c5877[_0x549e('0x8')]),_0x1c5877);if(_0x1c5877['uniqueid']==_0x1c5877[_0x549e('0x1c')]&&_0x1c5877[_0x549e('0xd')]!=_0x549e('0x1d')){utils[_0x549e('0xa')](util[_0x549e('0xb')](_0x549e('0x1e'),_0x1c5877[_0x549e('0x8')],_0x1c5877[_0x549e('0x1f')],_0x1c5877[_0x549e('0x20')]));channels[_0x1c5877[_0x549e('0x8')]]={'uniqueid':_0x1c5877[_0x549e('0x8')],'accountcode':_0x1c5877[_0x549e('0x12')],'source':_0x1c5877[_0x549e('0x10')],'destination':_0x1c5877['exten'],'destinationcontext':_0x1c5877['context'],'channel':_0x1c5877['channel'],'starttime':utils[_0x549e('0x21')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x549e('0x4'),'amaflags':_0x549e('0x22')};}}catch(_0x5e152a){utils['error'](util[_0x549e('0xb')]('[%s][calls][newchannel]',_0x1c5877[_0x549e('0x8')]),_0x5e152a);}};exports[_0x549e('0x23')]=function(_0x473cd7){try{utils[_0x549e('0x1a')](util[_0x549e('0xb')]('[%s][calls][newstate]',_0x473cd7['uniqueid']),_0x473cd7);if(!_[_0x549e('0x24')](channels[_0x473cd7[_0x549e('0x8')]])&&_0x473cd7[_0x549e('0x25')]==0x6){utils[_0x549e('0xa')](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x473cd7[_0x549e('0x8')],_0x473cd7[_0x549e('0x1f')],_0x473cd7[_0x549e('0xd')]));if(_[_0x549e('0x24')](channels[_0x473cd7[_0x549e('0x8')]]['systemanswertime'])){channels[_0x473cd7[_0x549e('0x8')]][_0x549e('0x26')]=utils[_0x549e('0x21')]();}}else if(!_['isNil'](channels[_0x473cd7['linkedid']])&&_0x473cd7[_0x549e('0x25')]==0x6&&_0x473cd7[_0x549e('0x1f')]!=_0x549e('0x27')){utils[_0x549e('0xa')](util[_0x549e('0xb')](_0x549e('0x28'),_0x473cd7[_0x549e('0x8')],_0x473cd7[_0x549e('0x1c')],_0x473cd7[_0x549e('0x1f')],_0x473cd7[_0x549e('0xd')]));channels[_0x473cd7['linkedid']][_0x549e('0x12')]=_0x473cd7[_0x549e('0x12')];channels[_0x473cd7[_0x549e('0x1c')]][_0x549e('0x29')]=_0x473cd7[_0x549e('0xd')];if(_[_0x549e('0x24')](channels[_0x473cd7['linkedid']][_0x549e('0x2a')])){channels[_0x473cd7['linkedid']]['answertime']=utils[_0x549e('0x21')]();}channels[_0x473cd7[_0x549e('0x1c')]][_0x549e('0x2b')]=dispositions[_['toNumber'](_0x473cd7[_0x549e('0x25')])]||_0x549e('0x6');}}catch(_0x310f55){utils[_0x549e('0x2c')](util[_0x549e('0xb')]('[%s][calls][newstate]',_0x473cd7[_0x549e('0x8')]),_0x310f55);}};exports[_0x549e('0x2d')]=function(_0x1c8d06){try{if(!_[_0x549e('0x24')](channels[_0x1c8d06['uniqueid']])){utils[_0x549e('0x1a')](util[_0x549e('0xb')]('[%s][calls][hangup]',_0x1c8d06[_0x549e('0x8')]),_0x1c8d06);if(_[_0x549e('0x24')](channels[_0x1c8d06[_0x549e('0x8')]][_0x549e('0x2e')])){channels[_0x1c8d06[_0x549e('0x8')]][_0x549e('0x2e')]=_0x1c8d06[_0x549e('0x2f')]+'\x20<'+_0x1c8d06[_0x549e('0x10')]+'>';}utils['info'](util[_0x549e('0xb')](_0x549e('0x30'),_0x1c8d06[_0x549e('0x8')],channels[_0x1c8d06['uniqueid']][_0x549e('0x2e')],_0x1c8d06[_0x549e('0x31')]));channels[_0x1c8d06[_0x549e('0x8')]]['endtime']=utils[_0x549e('0x21')]();channels[_0x1c8d06['uniqueid']][_0x549e('0x32')]=utils[_0x549e('0x33')](channels[_0x1c8d06[_0x549e('0x8')]][_0x549e('0x34')],channels[_0x1c8d06[_0x549e('0x8')]][_0x549e('0x35')]);channels[_0x1c8d06['uniqueid']][_0x549e('0x36')]=channels[_0x1c8d06[_0x549e('0x8')]]['answertime']?utils[_0x549e('0x33')](channels[_0x1c8d06['uniqueid']][_0x549e('0x34')],channels[_0x1c8d06['uniqueid']][_0x549e('0x2a')]):0x0;writeDB(channels[_0x1c8d06['uniqueid']]);}}catch(_0x5e0f94){utils['error'](util[_0x549e('0xb')](_0x549e('0x37'),_0x1c8d06['uniqueid']),_0x5e0f94);}};exports[_0x549e('0x38')]=function(_0x3b4ab4){try{if(!_[_0x549e('0x24')](channels[_0x3b4ab4['localtwolinkedid']])){utils['debug'](util[_0x549e('0xb')](_0x549e('0x39'),_0x3b4ab4[_0x549e('0x3a')]),_0x3b4ab4);if(channels[_0x3b4ab4[_0x549e('0x3b')]][_0x549e('0xd')]==_0x3b4ab4['transfereechannel']){utils[_0x549e('0xa')](util['format'](_0x549e('0x3c'),_0x3b4ab4[_0x549e('0x3a')],_0x3b4ab4[_0x549e('0x3b')],_0x3b4ab4[_0x549e('0x3d')]));channels[_0x3b4ab4['localtwolinkedid']][_0x549e('0x29')]=_0x3b4ab4['secondtransfererchannel'];channels[_0x3b4ab4[_0x549e('0x3b')]][_0x549e('0x3e')]=_0x549e('0x3f');}else if(channels[_0x3b4ab4[_0x549e('0x3b')]][_0x549e('0xd')]=_0x3b4ab4[_0x549e('0x40')]){utils[_0x549e('0xa')](util[_0x549e('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x3b4ab4[_0x549e('0x3a')],_0x3b4ab4[_0x549e('0x3b')],_0x3b4ab4[_0x549e('0x41')]));channels[_0x3b4ab4[_0x549e('0x3b')]][_0x549e('0x29')]=_0x3b4ab4[_0x549e('0x41')];channels[_0x3b4ab4[_0x549e('0x3b')]][_0x549e('0x3e')]=_0x549e('0x3f');}}}catch(_0x5af085){utils[_0x549e('0x2c')](util[_0x549e('0xb')](_0x549e('0x39'),_0x3b4ab4[_0x549e('0x3a')]),_0x5af085);}};exports['musiconholdstart']=function(_0x30b6a1){try{if(!_['isNil'](channels[_0x30b6a1['uniqueid']])){utils[_0x549e('0x1a')](util[_0x549e('0xb')](_0x549e('0x42'),_0x30b6a1['uniqueid']),_0x30b6a1);channels[_0x30b6a1[_0x549e('0x8')]][_0x549e('0x43')]=utils['now']();utils[_0x549e('0xa')](util['format'](_0x549e('0x44'),_0x30b6a1[_0x549e('0x8')],channels[_0x30b6a1['uniqueid']][_0x549e('0x43')]));}}catch(_0x5038b9){utils['error'](util['format'](_0x549e('0x42'),_0x30b6a1[_0x549e('0x8')]),_0x5038b9);}};exports[_0x549e('0x45')]=function(_0x40c52c){try{if(!_[_0x549e('0x24')](channels[_0x40c52c[_0x549e('0x8')]])){utils[_0x549e('0x1a')](util[_0x549e('0xb')](_0x549e('0x46'),_0x40c52c[_0x549e('0x8')]),_0x40c52c);if(!_[_0x549e('0x24')](channels[_0x40c52c[_0x549e('0x8')]]['musiconholdstartAt'])){channels[_0x40c52c[_0x549e('0x8')]][_0x549e('0x47')]+=utils[_0x549e('0x33')](utils[_0x549e('0x21')](),channels[_0x40c52c['uniqueid']][_0x549e('0x43')]);utils['info'](util['format'](_0x549e('0x48'),_0x40c52c[_0x549e('0x8')],channels[_0x40c52c[_0x549e('0x8')]][_0x549e('0x47')]));delete channels[_0x40c52c['uniqueid']][_0x549e('0x43')];}}}catch(_0x4f5a83){utils[_0x549e('0x2c')](util[_0x549e('0xb')](_0x549e('0x46'),_0x40c52c[_0x549e('0x8')]),_0x4f5a83);}};exports[_0x549e('0x49')]=function(_0x1d6dca){try{if(!_[_0x549e('0x24')](channels[_0x1d6dca[_0x549e('0x8')]])){utils[_0x549e('0x1a')](util['format'](_0x549e('0x4a'),_0x1d6dca[_0x549e('0x8')]),_0x1d6dca);if(!_[_0x549e('0x24')](_0x1d6dca[_0x549e('0x4b')][_0x549e('0x4c')])){utils[_0x549e('0xa')](util[_0x549e('0xb')](_0x549e('0x4d'),_0x1d6dca[_0x549e('0x8')],_0x1d6dca['value']));channels[_0x1d6dca[_0x549e('0x8')]][_0x549e('0x4e')]=_0x1d6dca[_0x549e('0x4f')];}if(!_[_0x549e('0x24')](_0x1d6dca[_0x549e('0x4b')]['xmd-phone'])){utils[_0x549e('0xa')](util[_0x549e('0xb')](_0x549e('0x50'),_0x1d6dca[_0x549e('0x8')],_0x1d6dca['value']));channels[_0x1d6dca['uniqueid']][_0x549e('0x51')]=_0x1d6dca[_0x549e('0x4f')];channels[_0x1d6dca[_0x549e('0x8')]]['callerid']='\x22'+_0x1d6dca[_0x549e('0x4f')]+_0x549e('0x52')+_0x1d6dca[_0x549e('0x4f')]+'>';}if(!_[_0x549e('0x24')](_0x1d6dca[_0x549e('0x4b')][_0x549e('0x53')])||!_[_0x549e('0x24')](_0x1d6dca[_0x549e('0x4b')][_0x549e('0x54')])){utils['info'](util[_0x549e('0xb')](_0x549e('0x55'),_0x1d6dca[_0x549e('0x8')],!_[_0x549e('0x24')](_0x1d6dca[_0x549e('0x4b')][_0x549e('0x53')])?_0x549e('0x53'):_0x549e('0x54'),_0x1d6dca[_0x549e('0x4f')]));channels[_0x1d6dca[_0x549e('0x8')]][_0x549e('0x2e')]=_0x1d6dca[_0x549e('0x4f')];}if(!_[_0x549e('0x24')](_0x1d6dca[_0x549e('0x4b')][_0x549e('0x56')])||!_[_0x549e('0x24')](_0x1d6dca[_0x549e('0x4b')][_0x549e('0x57')])){utils['info'](util[_0x549e('0xb')](_0x549e('0x55'),_0x1d6dca[_0x549e('0x8')],!_[_0x549e('0x24')](_0x1d6dca[_0x549e('0x4b')][_0x549e('0x56')])?_0x549e('0x56'):_0x549e('0x57'),_0x1d6dca['value']));channels[_0x1d6dca['uniqueid']][_0x549e('0x58')]=_0x549e('0x59');channels[_0x1d6dca['uniqueid']]['lastdata']=_0x1d6dca['value'];channels[_0x1d6dca['uniqueid']][_0x549e('0x5a')]=!![];}if(!_['isNil'](_0x1d6dca['variable'][_0x549e('0x5b')])){utils[_0x549e('0xa')](util[_0x549e('0xb')](_0x549e('0x5c'),_0x1d6dca[_0x549e('0x8')],_0x1d6dca[_0x549e('0x4f')]));channels[_0x1d6dca['uniqueid']]['ContactId']=_0x1d6dca[_0x549e('0x4f')];}if(!_[_0x549e('0x24')](_0x1d6dca[_0x549e('0x4b')]['xmd-cdrtype'])){utils[_0x549e('0xa')](util[_0x549e('0xb')](_0x549e('0x5d'),_0x1d6dca['uniqueid'],_0x1d6dca[_0x549e('0x4f')]));channels[_0x1d6dca[_0x549e('0x8')]][_0x549e('0x5e')]=_0x1d6dca[_0x549e('0x4f')];}if(!_[_0x549e('0x24')](_0x1d6dca['variable'][_0x549e('0x5f')])){utils['info'](util[_0x549e('0xb')](_0x549e('0x60'),_0x1d6dca['uniqueid'],_0x1d6dca[_0x549e('0x4f')]));channels[_0x1d6dca[_0x549e('0x8')]][_0x549e('0x61')]=_0x1d6dca[_0x549e('0x4f')];}if(!_[_0x549e('0x24')](_0x1d6dca[_0x549e('0x4b')]['sipcallid'])){utils[_0x549e('0xa')](util[_0x549e('0xb')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x1d6dca[_0x549e('0x8')],_0x1d6dca[_0x549e('0x4f')]));channels[_0x1d6dca['uniqueid']][_0x549e('0x62')]=_0x1d6dca[_0x549e('0x4f')];}}}catch(_0x227b74){utils[_0x549e('0x2c')](util[_0x549e('0xb')]('[%s][calls][varset]',_0x1d6dca[_0x549e('0x8')]),_0x227b74);}};exports[_0x549e('0x63')]=function(_0x392fe5){try{if(!_[_0x549e('0x24')](channels[_0x392fe5[_0x549e('0x8')]])){utils[_0x549e('0x1a')](util[_0x549e('0xb')](_0x549e('0x64'),_0x392fe5['uniqueid']),_0x392fe5);utils[_0x549e('0xa')](util[_0x549e('0xb')](_0x549e('0x65'),_0x392fe5[_0x549e('0x8')],_0x392fe5[_0x549e('0x66')],_0x392fe5[_0x549e('0x67')]));if(_0x392fe5[_0x549e('0x66')][_0x549e('0x68')]()==_0x549e('0x69')&&_[_0x549e('0x6a')](_0x392fe5[_0x549e('0x67')][_0x549e('0x68')](),_0x549e('0x6b'))){var _0x4207a4=_0x392fe5[_0x549e('0x67')]['split']('=');var _0x421ae4=_0x4207a4[0x0][_0x549e('0x6c')](_0x4207a4[0x0][_0x549e('0x6d')]('(')+0x1,_0x4207a4[0x0]['lastIndexOf'](')'));var _0x5a422b=_0x4207a4[0x1];channels[_0x392fe5[_0x549e('0x8')]][_0x421ae4]=_0x5a422b;}if(!_[_0x549e('0x6e')]([_0x549e('0x2d'),_0x549e('0x6f'),_0x549e('0x70'),_0x549e('0x69'),_0x549e('0x71')],_0x392fe5[_0x549e('0x66')]['toLowerCase']())){channels[_0x392fe5['uniqueid']][_0x549e('0x58')]=_0x392fe5[_0x549e('0x66')];channels[_0x392fe5[_0x549e('0x8')]][_0x549e('0x72')]=_0x392fe5[_0x549e('0x67')];}}}catch(_0x4fa5d9){utils[_0x549e('0x2c')](util[_0x549e('0xb')](_0x549e('0x64'),_0x392fe5[_0x549e('0x8')]),_0x4fa5d9);}};
\ No newline at end of file
+var _0x9e9f=['newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','split','substring','lastIndexOf','includes','noop','gotoif','lodash','util','./utils','FAILED','NO\x20ANSWER','BUSY','blinds','uniqueid','transfereeuniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','queue','interface','lastevent','getUserByInternal','accountcode','then','UserId','CreateVoiceCallReport','request','recording','debug','channel','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','calleridnum','exten','DOCUMENTATION','error','newstate','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','isNil','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','destinationchannel','disposition','ANSWERED','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','duration','endtime','starttime','billableseconds','answertime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','diffTime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','variable','xmcs-queue','xmd-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9e9f,0x1cd));var _0xf9e9=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9e9f[_0x5608a3];return _0x1ed50a;};'use strict';var _=require(_0xf9e9('0x0'));var util=require(_0xf9e9('0x1'));var utils=require(_0xf9e9('0x2'));var transfers=require('./transfers.controller');var dispositions=['NO\x20ANSWER',_0xf9e9('0x3'),_0xf9e9('0x3'),'NO\x20ANSWER',_0xf9e9('0x4'),'NO\x20ANSWER','ANSWERED',_0xf9e9('0x5'),'FAILED',_0xf9e9('0x3'),_0xf9e9('0x3')];var channels={};function writeDB(_0x31e514){var _0x2e4bba;if(transfers[_0xf9e9('0x6')][_0x31e514[_0xf9e9('0x7')]]){_0x2e4bba=_0x31e514[_0xf9e9('0x7')];_0x31e514[_0xf9e9('0x7')]=transfers[_0xf9e9('0x6')][_0x31e514['uniqueid']][_0xf9e9('0x8')];}utils['info'](util[_0xf9e9('0x9')](_0xf9e9('0xa'),_0x31e514['uniqueid'],_0x31e514['channel'],_0x31e514[_0xf9e9('0xb')],_0x31e514['membername'],_0x31e514[_0xf9e9('0xc')],_0x31e514['calleridnum'],_0x31e514['connectedlinenum'],_0x31e514[_0xf9e9('0xd')]));if(_0x31e514['accountcode']){utils[_0xf9e9('0xe')](_0x31e514[_0xf9e9('0xf')])[_0xf9e9('0x10')](function(_0x4be565){if(_0x4be565){_0x31e514[_0xf9e9('0x11')]=_0x4be565['id'];}utils['request'](_0xf9e9('0x12'),_0x31e514);});}else{utils[_0xf9e9('0x13')]('CreateVoiceCallReport',_0x31e514);}if(channels[_0x31e514[_0xf9e9('0x7')]]){delete channels[_0x31e514['uniqueid']];}else if(_0x2e4bba&&channels[_0x2e4bba]){if(!transfers[_0xf9e9('0x6')][_0x2e4bba][_0xf9e9('0x14')])delete transfers[_0xf9e9('0x6')][_0x2e4bba];delete channels[_0x2e4bba];}}exports['newchannel']=function(_0x5a7dc9){try{utils[_0xf9e9('0x15')](util[_0xf9e9('0x9')]('[%s][calls][newchannel]',_0x5a7dc9[_0xf9e9('0x7')]),_0x5a7dc9);if(_0x5a7dc9[_0xf9e9('0x7')]==_0x5a7dc9['linkedid']&&_0x5a7dc9[_0xf9e9('0x16')]!=_0xf9e9('0x17')){utils[_0xf9e9('0x18')](util['format'](_0xf9e9('0x19'),_0x5a7dc9['uniqueid'],_0x5a7dc9[_0xf9e9('0x1a')],_0x5a7dc9['exten']));channels[_0x5a7dc9[_0xf9e9('0x7')]]={'uniqueid':_0x5a7dc9[_0xf9e9('0x7')],'accountcode':_0x5a7dc9['accountcode'],'source':_0x5a7dc9[_0xf9e9('0x1b')],'destination':_0x5a7dc9[_0xf9e9('0x1c')],'destinationcontext':_0x5a7dc9['context'],'channel':_0x5a7dc9['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xf9e9('0x1d')};}}catch(_0x1d9c0c){utils[_0xf9e9('0x1e')](util[_0xf9e9('0x9')]('[%s][calls][newchannel]',_0x5a7dc9[_0xf9e9('0x7')]),_0x1d9c0c);}};exports[_0xf9e9('0x1f')]=function(_0x5af98c){try{utils['debug'](util[_0xf9e9('0x9')](_0xf9e9('0x20'),_0x5af98c[_0xf9e9('0x7')]),_0x5af98c);if(!_['isNil'](channels[_0x5af98c[_0xf9e9('0x7')]])&&_0x5af98c[_0xf9e9('0x21')]==0x6){utils[_0xf9e9('0x18')](util[_0xf9e9('0x9')](_0xf9e9('0x22'),_0x5af98c[_0xf9e9('0x7')],_0x5af98c['context'],_0x5af98c[_0xf9e9('0x16')]));if(_['isNil'](channels[_0x5af98c[_0xf9e9('0x7')]][_0xf9e9('0x23')])){channels[_0x5af98c['uniqueid']][_0xf9e9('0x23')]=utils[_0xf9e9('0x24')]();}}else if(!_[_0xf9e9('0x25')](channels[_0x5af98c['linkedid']])&&_0x5af98c[_0xf9e9('0x21')]==0x6&&_0x5af98c['context']!=_0xf9e9('0x26')){utils['info'](util[_0xf9e9('0x9')](_0xf9e9('0x27'),_0x5af98c['uniqueid'],_0x5af98c['linkedid'],_0x5af98c['context'],_0x5af98c[_0xf9e9('0x16')]));channels[_0x5af98c[_0xf9e9('0x28')]][_0xf9e9('0xf')]=_0x5af98c[_0xf9e9('0xf')];channels[_0x5af98c[_0xf9e9('0x28')]][_0xf9e9('0x29')]=_0x5af98c[_0xf9e9('0x16')];if(_['isNil'](channels[_0x5af98c['linkedid']]['answertime'])){channels[_0x5af98c[_0xf9e9('0x28')]]['answertime']=utils['now']();}channels[_0x5af98c[_0xf9e9('0x28')]][_0xf9e9('0x2a')]=dispositions[_['toNumber'](_0x5af98c[_0xf9e9('0x21')])]||_0xf9e9('0x2b');}}catch(_0x25dc84){utils['error'](util[_0xf9e9('0x9')](_0xf9e9('0x20'),_0x5af98c[_0xf9e9('0x7')]),_0x25dc84);}};exports[_0xf9e9('0x2c')]=function(_0x35202a){try{if(!_['isNil'](channels[_0x35202a[_0xf9e9('0x7')]])){utils['debug'](util[_0xf9e9('0x9')](_0xf9e9('0x2d'),_0x35202a[_0xf9e9('0x7')]),_0x35202a);if(_[_0xf9e9('0x25')](channels[_0x35202a['uniqueid']][_0xf9e9('0x2e')])){channels[_0x35202a[_0xf9e9('0x7')]][_0xf9e9('0x2e')]=_0x35202a['calleridname']+'\x20<'+_0x35202a[_0xf9e9('0x1b')]+'>';}utils[_0xf9e9('0x18')](util[_0xf9e9('0x9')](_0xf9e9('0x2f'),_0x35202a[_0xf9e9('0x7')],channels[_0x35202a[_0xf9e9('0x7')]][_0xf9e9('0x2e')],_0x35202a['cause-txt']));channels[_0x35202a[_0xf9e9('0x7')]]['endtime']=utils[_0xf9e9('0x24')]();channels[_0x35202a[_0xf9e9('0x7')]][_0xf9e9('0x30')]=utils['diffTime'](channels[_0x35202a[_0xf9e9('0x7')]][_0xf9e9('0x31')],channels[_0x35202a[_0xf9e9('0x7')]][_0xf9e9('0x32')]);channels[_0x35202a[_0xf9e9('0x7')]][_0xf9e9('0x33')]=channels[_0x35202a[_0xf9e9('0x7')]][_0xf9e9('0x34')]?utils['diffTime'](channels[_0x35202a[_0xf9e9('0x7')]][_0xf9e9('0x31')],channels[_0x35202a[_0xf9e9('0x7')]][_0xf9e9('0x34')]):0x0;writeDB(channels[_0x35202a[_0xf9e9('0x7')]]);}}catch(_0x587d78){utils[_0xf9e9('0x1e')](util[_0xf9e9('0x9')]('[%s][calls][hangup]',_0x35202a[_0xf9e9('0x7')]),_0x587d78);}};exports[_0xf9e9('0x35')]=function(_0x66980c){try{if(!_[_0xf9e9('0x25')](channels[_0x66980c['localtwolinkedid']])){utils[_0xf9e9('0x15')](util['format'](_0xf9e9('0x36'),_0x66980c[_0xf9e9('0x37')]),_0x66980c);if(channels[_0x66980c[_0xf9e9('0x38')]][_0xf9e9('0x16')]==_0x66980c[_0xf9e9('0x39')]){utils[_0xf9e9('0x18')](util[_0xf9e9('0x9')](_0xf9e9('0x3a'),_0x66980c[_0xf9e9('0x37')],_0x66980c['localtwolinkedid'],_0x66980c[_0xf9e9('0x3b')]));channels[_0x66980c[_0xf9e9('0x38')]]['destinationchannel']=_0x66980c[_0xf9e9('0x3b')];channels[_0x66980c[_0xf9e9('0x38')]][_0xf9e9('0x3c')]=_0xf9e9('0x3d');}else if(channels[_0x66980c['localtwolinkedid']][_0xf9e9('0x16')]=_0x66980c[_0xf9e9('0x3e')]){utils[_0xf9e9('0x18')](util[_0xf9e9('0x9')](_0xf9e9('0x3a'),_0x66980c[_0xf9e9('0x37')],_0x66980c[_0xf9e9('0x38')],_0x66980c[_0xf9e9('0x3f')]));channels[_0x66980c[_0xf9e9('0x38')]][_0xf9e9('0x29')]=_0x66980c['origtransfererchannel'];channels[_0x66980c[_0xf9e9('0x38')]]['userfield']='_attended';}}}catch(_0x3b79bd){utils[_0xf9e9('0x1e')](util[_0xf9e9('0x9')](_0xf9e9('0x36'),_0x66980c[_0xf9e9('0x37')]),_0x3b79bd);}};exports[_0xf9e9('0x40')]=function(_0x17d848){try{if(!_[_0xf9e9('0x25')](channels[_0x17d848[_0xf9e9('0x7')]])){utils[_0xf9e9('0x15')](util['format'](_0xf9e9('0x41'),_0x17d848['uniqueid']),_0x17d848);channels[_0x17d848['uniqueid']][_0xf9e9('0x42')]=utils[_0xf9e9('0x24')]();utils[_0xf9e9('0x18')](util[_0xf9e9('0x9')](_0xf9e9('0x43'),_0x17d848[_0xf9e9('0x7')],channels[_0x17d848['uniqueid']][_0xf9e9('0x42')]));}}catch(_0x2ff362){utils[_0xf9e9('0x1e')](util[_0xf9e9('0x9')]('[%s][calls][musiconholdstart]',_0x17d848[_0xf9e9('0x7')]),_0x2ff362);}};exports[_0xf9e9('0x44')]=function(_0x125eb0){try{if(!_['isNil'](channels[_0x125eb0[_0xf9e9('0x7')]])){utils['debug'](util[_0xf9e9('0x9')](_0xf9e9('0x45'),_0x125eb0['uniqueid']),_0x125eb0);if(!_[_0xf9e9('0x25')](channels[_0x125eb0[_0xf9e9('0x7')]][_0xf9e9('0x42')])){channels[_0x125eb0[_0xf9e9('0x7')]][_0xf9e9('0x46')]+=utils[_0xf9e9('0x47')](utils[_0xf9e9('0x24')](),channels[_0x125eb0[_0xf9e9('0x7')]][_0xf9e9('0x42')]);utils[_0xf9e9('0x18')](util[_0xf9e9('0x9')](_0xf9e9('0x48'),_0x125eb0[_0xf9e9('0x7')],channels[_0x125eb0[_0xf9e9('0x7')]]['mohtime']));delete channels[_0x125eb0[_0xf9e9('0x7')]][_0xf9e9('0x42')];}}}catch(_0x92108){utils[_0xf9e9('0x1e')](util[_0xf9e9('0x9')]('[%s][calls][musiconholdstop]',_0x125eb0[_0xf9e9('0x7')]),_0x92108);}};exports['varset']=function(_0x4930ae){try{if(!_[_0xf9e9('0x25')](channels[_0x4930ae[_0xf9e9('0x7')]])){utils[_0xf9e9('0x15')](util['format'](_0xf9e9('0x49'),_0x4930ae[_0xf9e9('0x7')]),_0x4930ae);if(!_[_0xf9e9('0x25')](_0x4930ae['variable'][_0xf9e9('0x4a')])){utils[_0xf9e9('0x18')](util[_0xf9e9('0x9')](_0xf9e9('0x4b'),_0x4930ae[_0xf9e9('0x7')],_0x4930ae[_0xf9e9('0x4c')]));channels[_0x4930ae[_0xf9e9('0x7')]][_0xf9e9('0x4d')]=_0x4930ae[_0xf9e9('0x4c')];}if(!_[_0xf9e9('0x25')](_0x4930ae['variable'][_0xf9e9('0x4e')])){utils[_0xf9e9('0x18')](util[_0xf9e9('0x9')](_0xf9e9('0x4f'),_0x4930ae[_0xf9e9('0x7')],_0x4930ae[_0xf9e9('0x4c')]));channels[_0x4930ae[_0xf9e9('0x7')]][_0xf9e9('0x50')]=_0x4930ae[_0xf9e9('0x4c')];channels[_0x4930ae[_0xf9e9('0x7')]][_0xf9e9('0x2e')]='\x22'+_0x4930ae['value']+'\x22\x20<'+_0x4930ae[_0xf9e9('0x4c')]+'>';}if(!_[_0xf9e9('0x25')](_0x4930ae['variable'][_0xf9e9('0x51')])||!_[_0xf9e9('0x25')](_0x4930ae['variable'][_0xf9e9('0x52')])){utils[_0xf9e9('0x18')](util[_0xf9e9('0x9')](_0xf9e9('0x53'),_0x4930ae[_0xf9e9('0x7')],!_[_0xf9e9('0x25')](_0x4930ae[_0xf9e9('0x54')][_0xf9e9('0x51')])?'xmd-callerid-preview':'xmd-callerid',_0x4930ae[_0xf9e9('0x4c')]));channels[_0x4930ae[_0xf9e9('0x7')]]['callerid']=_0x4930ae[_0xf9e9('0x4c')];}if(!_[_0xf9e9('0x25')](_0x4930ae[_0xf9e9('0x54')]['xmd-queue'])||!_[_0xf9e9('0x25')](_0x4930ae[_0xf9e9('0x54')][_0xf9e9('0x55')])){utils[_0xf9e9('0x18')](util[_0xf9e9('0x9')](_0xf9e9('0x53'),_0x4930ae[_0xf9e9('0x7')],!_[_0xf9e9('0x25')](_0x4930ae[_0xf9e9('0x54')]['xmd-queue'])?_0xf9e9('0x56'):_0xf9e9('0x55'),_0x4930ae[_0xf9e9('0x4c')]));channels[_0x4930ae[_0xf9e9('0x7')]][_0xf9e9('0x57')]=_0xf9e9('0x58');channels[_0x4930ae[_0xf9e9('0x7')]][_0xf9e9('0x59')]=_0x4930ae['value'];channels[_0x4930ae['uniqueid']][_0xf9e9('0xb')]=!![];}if(!_[_0xf9e9('0x25')](_0x4930ae[_0xf9e9('0x54')][_0xf9e9('0x5a')])){utils[_0xf9e9('0x18')](util[_0xf9e9('0x9')](_0xf9e9('0x5b'),_0x4930ae['uniqueid'],_0x4930ae[_0xf9e9('0x4c')]));channels[_0x4930ae['uniqueid']]['ContactId']=_0x4930ae[_0xf9e9('0x4c')];}if(!_[_0xf9e9('0x25')](_0x4930ae['variable'][_0xf9e9('0x5c')])){utils['info'](util['format'](_0xf9e9('0x5d'),_0x4930ae[_0xf9e9('0x7')],_0x4930ae['value']));channels[_0x4930ae['uniqueid']][_0xf9e9('0x5e')]=_0x4930ae[_0xf9e9('0x4c')];}if(!_[_0xf9e9('0x25')](_0x4930ae['variable'][_0xf9e9('0x5f')])){utils[_0xf9e9('0x18')](util['format'](_0xf9e9('0x60'),_0x4930ae[_0xf9e9('0x7')],_0x4930ae['value']));channels[_0x4930ae[_0xf9e9('0x7')]][_0xf9e9('0x61')]=_0x4930ae[_0xf9e9('0x4c')];}if(!_[_0xf9e9('0x25')](_0x4930ae[_0xf9e9('0x54')][_0xf9e9('0x62')])){utils[_0xf9e9('0x18')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x4930ae['uniqueid'],_0x4930ae['value']));channels[_0x4930ae[_0xf9e9('0x7')]][_0xf9e9('0x62')]=_0x4930ae['value'];}}}catch(_0x121728){utils['error'](util[_0xf9e9('0x9')](_0xf9e9('0x49'),_0x4930ae[_0xf9e9('0x7')]),_0x121728);}};exports[_0xf9e9('0x63')]=function(_0x9f5b27){try{if(!_[_0xf9e9('0x25')](channels[_0x9f5b27[_0xf9e9('0x7')]])){utils[_0xf9e9('0x15')](util[_0xf9e9('0x9')](_0xf9e9('0x64'),_0x9f5b27['uniqueid']),_0x9f5b27);utils['info'](util[_0xf9e9('0x9')](_0xf9e9('0x65'),_0x9f5b27['uniqueid'],_0x9f5b27[_0xf9e9('0x66')],_0x9f5b27[_0xf9e9('0x67')]));if(_0x9f5b27[_0xf9e9('0x66')][_0xf9e9('0x68')]()==_0xf9e9('0x69')&&_['startsWith'](_0x9f5b27[_0xf9e9('0x67')][_0xf9e9('0x68')](),'cdr')){var _0x253170=_0x9f5b27[_0xf9e9('0x67')][_0xf9e9('0x6a')]('=');var _0x289e47=_0x253170[0x0][_0xf9e9('0x6b')](_0x253170[0x0]['lastIndexOf']('(')+0x1,_0x253170[0x0][_0xf9e9('0x6c')](')'));var _0x1f3323=_0x253170[0x1];channels[_0x9f5b27[_0xf9e9('0x7')]][_0x289e47]=_0x1f3323;}if(!_[_0xf9e9('0x6d')](['hangup',_0xf9e9('0x6e'),'execif',_0xf9e9('0x69'),_0xf9e9('0x6f')],_0x9f5b27[_0xf9e9('0x66')][_0xf9e9('0x68')]())){channels[_0x9f5b27[_0xf9e9('0x7')]]['lastapplication']=_0x9f5b27['application'];channels[_0x9f5b27[_0xf9e9('0x7')]][_0xf9e9('0x59')]=_0x9f5b27['appdata'];}}}catch(_0x6536ba){utils[_0xf9e9('0x1e')](util['format'](_0xf9e9('0x64'),_0x9f5b27[_0xf9e9('0x7')]),_0x6536ba);}};
\ No newline at end of file
index bcee2a4..ff62b66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e51=['managerevent','info','[core]\x20connected','shutdown','[core]\x20shutdown','[core]\x20fullybooted','error','close','[core]\x20close'];(function(_0x4fb905,_0x520717){var _0x45cbfb=function(_0x565791){while(--_0x565791){_0x4fb905['push'](_0x4fb905['shift']());}};_0x45cbfb(++_0x520717);}(_0x3e51,0xa3));var _0x13e5=function(_0x246227,_0x12bfcb){_0x246227=_0x246227-0x0;var _0x37bd4a=_0x3e51[_0x246227];return _0x37bd4a;};'use strict';var utils=require('./utils');exports['connect']=function(){utils[_0x13e5('0x0')](_0x13e5('0x1'));};exports[_0x13e5('0x2')]=function(){utils[_0x13e5('0x0')](_0x13e5('0x3'));};exports['fullybooted']=function(){utils[_0x13e5('0x0')](_0x13e5('0x4'));};exports['error']=function(_0x40bf60){utils[_0x13e5('0x5')]('[core]\x20error',_0x40bf60);};exports[_0x13e5('0x6')]=function(){utils[_0x13e5('0x0')](_0x13e5('0x7'));};exports[_0x13e5('0x8')]=function(_0x227935){};
\ No newline at end of file
+var _0x9aaa=['[core]\x20error','[core]\x20close','managerevent','./utils','[core]\x20connected','info','fullybooted','[core]\x20fullybooted','error'];(function(_0x1027fe,_0x41b8a3){var _0x5b375d=function(_0x241710){while(--_0x241710){_0x1027fe['push'](_0x1027fe['shift']());}};_0x5b375d(++_0x41b8a3);}(_0x9aaa,0xd2));var _0xa9aa=function(_0x4c4fda,_0x3b1a99){_0x4c4fda=_0x4c4fda-0x0;var _0x1a9bc4=_0x9aaa[_0x4c4fda];return _0x1a9bc4;};'use strict';var utils=require(_0xa9aa('0x0'));exports['connect']=function(){utils['info'](_0xa9aa('0x1'));};exports['shutdown']=function(){utils[_0xa9aa('0x2')]('[core]\x20shutdown');};exports[_0xa9aa('0x3')]=function(){utils[_0xa9aa('0x2')](_0xa9aa('0x4'));};exports[_0xa9aa('0x5')]=function(_0x13b7df){utils[_0xa9aa('0x5')](_0xa9aa('0x6'),_0x13b7df);};exports['close']=function(){utils['info'](_0xa9aa('0x7'));};exports[_0xa9aa('0x8')]=function(_0x41317f){};
\ No newline at end of file
index d7ad6b5..44fffec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7019=['error','varset','[%s][dials][varset]','isNil','variable','outboundrouteid','value','dialbegin','assign','starttime','now','lastevent','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','dialstatus','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','complete','diffTime','holdtime','endtime','billableseconds','lodash','util','./utils','info','format','dialstring','calleridnum','connectedlinenum','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','uniqueid','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr(routeid)'];(function(_0x1d2533,_0x41cc4a){var _0x4a81a1=function(_0x23a4e2){while(--_0x23a4e2){_0x1d2533['push'](_0x1d2533['shift']());}};_0x4a81a1(++_0x41cc4a);}(_0x7019,0x19d));var _0x9701=function(_0x4be378,_0xb7975d){_0x4be378=_0x4be378-0x0;var _0x1b159a=_0x7019[_0x4be378];return _0x1b159a;};'use strict';var _=require(_0x9701('0x0'));var util=require(_0x9701('0x1'));var utils=require(_0x9701('0x2'));var dials={};function writeDB(_0x118dab){utils[_0x9701('0x3')](util[_0x9701('0x4')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x118dab['uniqueid'],_0x118dab['channel'],_0x118dab[_0x9701('0x5')],_0x118dab[_0x9701('0x6')],_0x118dab[_0x9701('0x7')],_0x118dab['dialstatus']));utils['request'](_0x9701('0x8'),_0x118dab);delete dials[_0x118dab['uniqueid']];}exports[_0x9701('0x9')]=function(_0x6d43c5){try{utils[_0x9701('0xa')](util[_0x9701('0x4')](_0x9701('0xb'),_0x6d43c5[_0x9701('0xc')]),_0x6d43c5);utils[_0x9701('0x3')](util[_0x9701('0x4')](_0x9701('0xd'),_0x6d43c5[_0x9701('0xc')],_0x6d43c5[_0x9701('0xe')],_0x6d43c5[_0x9701('0xf')]));if(_0x6d43c5['application'][_0x9701('0x10')]()=='set'&&_[_0x9701('0x11')](_0x6d43c5[_0x9701('0xf')][_0x9701('0x10')](),_0x9701('0x12'))){var _0x422759=_0x6d43c5[_0x9701('0xf')]['split']('=');dials[_0x6d43c5[_0x9701('0xc')]]={'routeId':_0x422759[0x1]};}}catch(_0x6b1918){utils[_0x9701('0x13')](util[_0x9701('0x4')]('[%s][dials][newexten]',_0x6d43c5['uniqueid']),_0x6b1918);}};exports[_0x9701('0x14')]=function(_0x44e225){try{utils['debug'](util[_0x9701('0x4')](_0x9701('0x15'),_0x44e225['uniqueid']),_0x44e225);if(!_[_0x9701('0x16')](_0x44e225[_0x9701('0x17')][_0x9701('0x18')])){utils['info'](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x44e225[_0x9701('0xc')],_0x44e225[_0x9701('0x19')]));dials[_0x44e225[_0x9701('0xc')]]={'routeId':_0x44e225[_0x9701('0x19')]};}}catch(_0x14d5df){utils['error'](util[_0x9701('0x4')]('[%s][dials][varset]',_0x44e225[_0x9701('0xc')]),_0x14d5df);}};exports[_0x9701('0x1a')]=function(_0xeda4ad){try{if(!_[_0x9701('0x16')](dials[_0xeda4ad[_0x9701('0xc')]])){utils[_0x9701('0xa')](util[_0x9701('0x4')]('[%s][dials][dialbegin]',_0xeda4ad[_0x9701('0xc')]),_0xeda4ad);dials[_0xeda4ad[_0x9701('0xc')]]=_[_0x9701('0x1b')](dials[_0xeda4ad[_0x9701('0xc')]],_0xeda4ad);dials[_0xeda4ad[_0x9701('0xc')]][_0x9701('0x1c')]=utils[_0x9701('0x1d')]();dials[_0xeda4ad['uniqueid']][_0x9701('0x1e')]='called';utils[_0x9701('0x3')](util[_0x9701('0x4')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0xeda4ad[_0x9701('0xc')],dials[_0xeda4ad[_0x9701('0xc')]][_0x9701('0x1c')]));}}catch(_0x566e5f){utils[_0x9701('0x13')](util[_0x9701('0x4')](_0x9701('0x1f'),_0xeda4ad[_0x9701('0xc')]),_0x566e5f);}};exports[_0x9701('0x20')]=function(_0x54fc0d){try{if(!_[_0x9701('0x16')](dials[_0x54fc0d[_0x9701('0xc')]])){utils['debug'](util[_0x9701('0x4')](_0x9701('0x21'),_0x54fc0d[_0x9701('0xc')]),_0x54fc0d);dials[_0x54fc0d[_0x9701('0xc')]]['dialstatus']=_0x54fc0d['dialstatus'];if(_0x54fc0d[_0x9701('0x22')]==_0x9701('0x23')){dials[_0x54fc0d[_0x9701('0xc')]]=_['assign'](dials[_0x54fc0d[_0x9701('0xc')]],_0x54fc0d);dials[_0x54fc0d[_0x9701('0xc')]][_0x9701('0x24')]=utils[_0x9701('0x1d')]();dials[_0x54fc0d['uniqueid']]['lastevent']=_0x9701('0x25');utils[_0x9701('0x3')](util[_0x9701('0x4')](_0x9701('0x26'),_0x54fc0d[_0x9701('0xc')],_0x54fc0d['dialstatus'],dials[_0x54fc0d['uniqueid']][_0x9701('0x24')]));}else{utils[_0x9701('0x3')](util[_0x9701('0x4')](_0x9701('0x27'),_0x54fc0d['uniqueid'],_0x54fc0d['dialstatus']));}}}catch(_0x4a2891){utils[_0x9701('0x13')](util['format'](_0x9701('0x21'),_0x54fc0d[_0x9701('0xc')]),_0x4a2891);}};exports[_0x9701('0x28')]=function(_0x3491f8){try{if(!_[_0x9701('0x16')](dials[_0x3491f8['uniqueid']])){utils[_0x9701('0xa')](util[_0x9701('0x4')](_0x9701('0x29'),_0x3491f8[_0x9701('0xc')]),_0x3491f8);utils['info'](util[_0x9701('0x4')](_0x9701('0x2a'),_0x3491f8[_0x9701('0xc')],_0x3491f8[_0x9701('0x6')],_0x3491f8['calleridname'],_0x3491f8['cause-txt']));dials[_0x3491f8[_0x9701('0xc')]]=_[_0x9701('0x1b')](dials[_0x3491f8[_0x9701('0xc')]],{'endtime':utils['now'](),'lastevent':_0x9701('0x2b')});dials[_0x3491f8[_0x9701('0xc')]]['duration']=utils[_0x9701('0x2c')](dials[_0x3491f8[_0x9701('0xc')]]['endtime'],dials[_0x3491f8[_0x9701('0xc')]][_0x9701('0x1c')]);dials[_0x3491f8['uniqueid']][_0x9701('0x2d')]=utils[_0x9701('0x2c')](dials[_0x3491f8[_0x9701('0xc')]][_0x9701('0x24')]||dials[_0x3491f8[_0x9701('0xc')]][_0x9701('0x2e')],dials[_0x3491f8[_0x9701('0xc')]][_0x9701('0x1c')]);dials[_0x3491f8[_0x9701('0xc')]][_0x9701('0x2f')]=dials[_0x3491f8[_0x9701('0xc')]][_0x9701('0x24')]?utils[_0x9701('0x2c')](dials[_0x3491f8[_0x9701('0xc')]][_0x9701('0x2e')],dials[_0x3491f8['uniqueid']][_0x9701('0x24')]):0x0;writeDB(dials[_0x3491f8[_0x9701('0xc')]]);}}catch(_0x27907c){utils[_0x9701('0x13')](util[_0x9701('0x4')]('[%s][dials][hangup]',_0x3491f8[_0x9701('0xc')]),_0x27907c);}};
\ No newline at end of file
+var _0xa3c6=['[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','complete','diffTime','endtime','billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','error','[%s][dials][varset]','value','dialbegin','isNil','[%s][dials][dialbegin]','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','ANSWER','assign','answertime','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]'];(function(_0x4f12e9,_0x533059){var _0x56de6c=function(_0x4eb12c){while(--_0x4eb12c){_0x4f12e9['push'](_0x4f12e9['shift']());}};_0x56de6c(++_0x533059);}(_0xa3c6,0x1b8));var _0x6a3c=function(_0x2f3ef4,_0x3781af){_0x2f3ef4=_0x2f3ef4-0x0;var _0x3080b6=_0xa3c6[_0x2f3ef4];return _0x3080b6;};'use strict';var _=require(_0x6a3c('0x0'));var util=require(_0x6a3c('0x1'));var utils=require(_0x6a3c('0x2'));var dials={};function writeDB(_0x2ee6e9){utils[_0x6a3c('0x3')](util[_0x6a3c('0x4')](_0x6a3c('0x5'),_0x2ee6e9[_0x6a3c('0x6')],_0x2ee6e9[_0x6a3c('0x7')],_0x2ee6e9[_0x6a3c('0x8')],_0x2ee6e9['calleridnum'],_0x2ee6e9[_0x6a3c('0x9')],_0x2ee6e9[_0x6a3c('0xa')]));utils[_0x6a3c('0xb')](_0x6a3c('0xc'),_0x2ee6e9);delete dials[_0x2ee6e9['uniqueid']];}exports[_0x6a3c('0xd')]=function(_0x1bcc9c){try{utils[_0x6a3c('0xe')](util['format'](_0x6a3c('0xf'),_0x1bcc9c[_0x6a3c('0x6')]),_0x1bcc9c);utils[_0x6a3c('0x3')](util[_0x6a3c('0x4')](_0x6a3c('0x10'),_0x1bcc9c[_0x6a3c('0x6')],_0x1bcc9c[_0x6a3c('0x11')],_0x1bcc9c[_0x6a3c('0x12')]));if(_0x1bcc9c[_0x6a3c('0x11')][_0x6a3c('0x13')]()=='set'&&_[_0x6a3c('0x14')](_0x1bcc9c[_0x6a3c('0x12')][_0x6a3c('0x13')](),'cdr(routeid)')){var _0xc75ca9=_0x1bcc9c[_0x6a3c('0x12')]['split']('=');dials[_0x1bcc9c['uniqueid']]={'routeId':_0xc75ca9[0x1]};}}catch(_0x5f2f9b){utils[_0x6a3c('0x15')](util[_0x6a3c('0x4')](_0x6a3c('0xf'),_0x1bcc9c[_0x6a3c('0x6')]),_0x5f2f9b);}};exports['varset']=function(_0x72f338){try{utils['debug'](util[_0x6a3c('0x4')](_0x6a3c('0x16'),_0x72f338[_0x6a3c('0x6')]),_0x72f338);if(!_['isNil'](_0x72f338['variable']['outboundrouteid'])){utils['info'](util['format']('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x72f338[_0x6a3c('0x6')],_0x72f338[_0x6a3c('0x17')]));dials[_0x72f338[_0x6a3c('0x6')]]={'routeId':_0x72f338[_0x6a3c('0x17')]};}}catch(_0x4a8ba5){utils['error'](util[_0x6a3c('0x4')](_0x6a3c('0x16'),_0x72f338[_0x6a3c('0x6')]),_0x4a8ba5);}};exports[_0x6a3c('0x18')]=function(_0x3dae55){try{if(!_[_0x6a3c('0x19')](dials[_0x3dae55[_0x6a3c('0x6')]])){utils['debug'](util[_0x6a3c('0x4')](_0x6a3c('0x1a'),_0x3dae55[_0x6a3c('0x6')]),_0x3dae55);dials[_0x3dae55[_0x6a3c('0x6')]]=_['assign'](dials[_0x3dae55['uniqueid']],_0x3dae55);dials[_0x3dae55[_0x6a3c('0x6')]][_0x6a3c('0x1b')]=utils[_0x6a3c('0x1c')]();dials[_0x3dae55['uniqueid']]['lastevent']=_0x6a3c('0x1d');utils[_0x6a3c('0x3')](util[_0x6a3c('0x4')](_0x6a3c('0x1e'),_0x3dae55[_0x6a3c('0x6')],dials[_0x3dae55['uniqueid']][_0x6a3c('0x1b')]));}}catch(_0x10df48){utils[_0x6a3c('0x15')](util[_0x6a3c('0x4')](_0x6a3c('0x1a'),_0x3dae55[_0x6a3c('0x6')]),_0x10df48);}};exports[_0x6a3c('0x1f')]=function(_0x5eeb19){try{if(!_[_0x6a3c('0x19')](dials[_0x5eeb19[_0x6a3c('0x6')]])){utils[_0x6a3c('0xe')](util['format']('[%s][dials][dialend]',_0x5eeb19[_0x6a3c('0x6')]),_0x5eeb19);dials[_0x5eeb19[_0x6a3c('0x6')]][_0x6a3c('0xa')]=_0x5eeb19['dialstatus'];if(_0x5eeb19['dialstatus']==_0x6a3c('0x20')){dials[_0x5eeb19[_0x6a3c('0x6')]]=_[_0x6a3c('0x21')](dials[_0x5eeb19['uniqueid']],_0x5eeb19);dials[_0x5eeb19[_0x6a3c('0x6')]][_0x6a3c('0x22')]=utils[_0x6a3c('0x1c')]();dials[_0x5eeb19[_0x6a3c('0x6')]][_0x6a3c('0x23')]=_0x6a3c('0x24');utils['info'](util['format'](_0x6a3c('0x25'),_0x5eeb19[_0x6a3c('0x6')],_0x5eeb19[_0x6a3c('0xa')],dials[_0x5eeb19[_0x6a3c('0x6')]][_0x6a3c('0x22')]));}else{utils['info'](util[_0x6a3c('0x4')](_0x6a3c('0x26'),_0x5eeb19[_0x6a3c('0x6')],_0x5eeb19[_0x6a3c('0xa')]));}}}catch(_0x2c754e){utils[_0x6a3c('0x15')](util['format'](_0x6a3c('0x27'),_0x5eeb19['uniqueid']),_0x2c754e);}};exports['hangup']=function(_0x5619d8){try{if(!_[_0x6a3c('0x19')](dials[_0x5619d8[_0x6a3c('0x6')]])){utils[_0x6a3c('0xe')](util['format'](_0x6a3c('0x28'),_0x5619d8[_0x6a3c('0x6')]),_0x5619d8);utils[_0x6a3c('0x3')](util['format'](_0x6a3c('0x29'),_0x5619d8[_0x6a3c('0x6')],_0x5619d8[_0x6a3c('0x2a')],_0x5619d8[_0x6a3c('0x2b')],_0x5619d8['cause-txt']));dials[_0x5619d8[_0x6a3c('0x6')]]=_['assign'](dials[_0x5619d8['uniqueid']],{'endtime':utils[_0x6a3c('0x1c')](),'lastevent':_0x6a3c('0x2c')});dials[_0x5619d8[_0x6a3c('0x6')]]['duration']=utils[_0x6a3c('0x2d')](dials[_0x5619d8[_0x6a3c('0x6')]][_0x6a3c('0x2e')],dials[_0x5619d8[_0x6a3c('0x6')]][_0x6a3c('0x1b')]);dials[_0x5619d8[_0x6a3c('0x6')]]['holdtime']=utils[_0x6a3c('0x2d')](dials[_0x5619d8[_0x6a3c('0x6')]][_0x6a3c('0x22')]||dials[_0x5619d8[_0x6a3c('0x6')]][_0x6a3c('0x2e')],dials[_0x5619d8[_0x6a3c('0x6')]][_0x6a3c('0x1b')]);dials[_0x5619d8[_0x6a3c('0x6')]][_0x6a3c('0x2f')]=dials[_0x5619d8[_0x6a3c('0x6')]][_0x6a3c('0x22')]?utils[_0x6a3c('0x2d')](dials[_0x5619d8[_0x6a3c('0x6')]][_0x6a3c('0x2e')],dials[_0x5619d8[_0x6a3c('0x6')]][_0x6a3c('0x22')]):0x0;writeDB(dials[_0x5619d8[_0x6a3c('0x6')]]);}}catch(_0x5b6dd2){utils['error'](util[_0x6a3c('0x4')](_0x6a3c('0x28'),_0x5619d8[_0x6a3c('0x6')]),_0x5b6dd2);}};
\ No newline at end of file
index e227bac..ed778ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a7b=['[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','disabled','env','local','asterisk','port','username','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin'];(function(_0x4c81d2,_0x1b2ecb){var _0x2bcef8=function(_0xa9ff6d){while(--_0xa9ff6d){_0x4c81d2['push'](_0x4c81d2['shift']());}};_0x2bcef8(++_0x1b2ecb);}(_0x9a7b,0xa7));var _0xb9a7=function(_0x234ff8,_0x313afb){_0x234ff8=_0x234ff8-0x0;var _0x364477=_0x9a7b[_0x234ff8];return _0x364477;};var AsteriskManager=require(_0xb9a7('0x0'));var config=require('../../config/environment');var utils=require(_0xb9a7('0x1'));var util=require(_0xb9a7('0x2'));var isXDREnabled=config['xdr']&&config[_0xb9a7('0x3')][_0xb9a7('0x4')]?!config[_0xb9a7('0x3')][_0xb9a7('0x4')]:!![];var isProduction=config[_0xb9a7('0x5')]==='production'||![];var isLocalAsterisk=config[_0xb9a7('0x3')]&&config[_0xb9a7('0x3')][_0xb9a7('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0xb9a7('0x7')][_0xb9a7('0x8')],config['asterisk']['ip'],config[_0xb9a7('0x7')][_0xb9a7('0x9')],config[_0xb9a7('0x7')]['password'],!![]);ami[_0xb9a7('0xa')]();if(!isXDREnabled){utils[_0xb9a7('0xb')]('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils['info'](_0xb9a7('0xc'));}else{var agents=require(_0xb9a7('0xd'));var calls=require(_0xb9a7('0xe'));var queues=require(_0xb9a7('0xf'));var recordings=require(_0xb9a7('0x10'));var members=require(_0xb9a7('0x11'));var dials=require(_0xb9a7('0x12'));var transfers=require(_0xb9a7('0x13'));var core=require(_0xb9a7('0x14'));ami['on'](_0xb9a7('0x15'),core[_0xb9a7('0x15')]);ami['on'](_0xb9a7('0x16'),core['shutdown']);ami['on']('fullybooted',core[_0xb9a7('0x17')]);ami['on'](_0xb9a7('0x18'),core['error']);ami['on']('close',core['close']);ami['on'](_0xb9a7('0x19'),core['managerevent']);ami['on'](_0xb9a7('0x1a'),function(_0x1caf39){try{utils[_0xb9a7('0x1b')](util[_0xb9a7('0x1c')](_0xb9a7('0x1d'),_0x1caf39[_0xb9a7('0x1e')]),_0x1caf39);members[_0xb9a7('0x1a')](_0x1caf39);}catch(_0x4b60be){utils[_0xb9a7('0x18')](util[_0xb9a7('0x1c')](_0xb9a7('0x1d'),_0x1caf39[_0xb9a7('0x1e')]),_0x4b60be);}});ami['on']('agentcalled',function(_0x326710){try{utils[_0xb9a7('0x1b')](util[_0xb9a7('0x1c')](_0xb9a7('0x1f'),_0x326710[_0xb9a7('0x20')]),_0x326710);agents[_0xb9a7('0x21')](_0x326710);}catch(_0x2e25d6){utils['error'](util['format'](_0xb9a7('0x1f'),_0x326710[_0xb9a7('0x20')]),_0x2e25d6);}});ami['on'](_0xb9a7('0x22'),function(_0x1d75f5){try{utils[_0xb9a7('0x1b')](util[_0xb9a7('0x1c')](_0xb9a7('0x23'),_0x1d75f5['uniqueid']),_0x1d75f5);agents[_0xb9a7('0x22')](_0x1d75f5);}catch(_0x1806b7){utils[_0xb9a7('0x18')](util[_0xb9a7('0x1c')]('[%s][index][agentringnoanswer]',_0x1d75f5[_0xb9a7('0x20')]),_0x1806b7);}});ami['on'](_0xb9a7('0x24'),function(_0x1249d5){try{utils[_0xb9a7('0x1b')](util[_0xb9a7('0x1c')](_0xb9a7('0x25'),_0x1249d5['uniqueid']),_0x1249d5);agents['agentconnect'](_0x1249d5);queues[_0xb9a7('0x24')](_0x1249d5);}catch(_0x3d501c){utils[_0xb9a7('0x18')](util[_0xb9a7('0x1c')]('[%s][index][agentconnect]',_0x1249d5[_0xb9a7('0x20')]),_0x3d501c);}});ami['on'](_0xb9a7('0x26'),function(_0x2f2ae4){try{utils[_0xb9a7('0x1b')](util[_0xb9a7('0x1c')]('[%s][index][agentcomplete]',_0x2f2ae4[_0xb9a7('0x20')]),_0x2f2ae4);agents[_0xb9a7('0x26')](_0x2f2ae4);queues[_0xb9a7('0x26')](_0x2f2ae4);members['agentcomplete'](_0x2f2ae4);}catch(_0x232de3){utils['error'](util[_0xb9a7('0x1c')](_0xb9a7('0x27'),_0x2f2ae4['uniqueid']),_0x232de3);}});ami['on'](_0xb9a7('0x28'),function(_0x164850){try{utils[_0xb9a7('0x1b')](util[_0xb9a7('0x1c')](_0xb9a7('0x29'),_0x164850[_0xb9a7('0x20')]),_0x164850);agents['queuecallerabandon'](_0x164850);queues[_0xb9a7('0x28')](_0x164850);}catch(_0x43723a){utils[_0xb9a7('0x18')](util[_0xb9a7('0x1c')](_0xb9a7('0x29'),_0x164850[_0xb9a7('0x20')]),_0x43723a);}});ami['on'](_0xb9a7('0x2a'),function(_0x5bdf85){try{utils[_0xb9a7('0x1b')](util[_0xb9a7('0x1c')](_0xb9a7('0x2b'),_0x5bdf85[_0xb9a7('0x20')]),_0x5bdf85);queues['queuecallerjoin'](_0x5bdf85);recordings['queuecallerjoin'](_0x5bdf85);}catch(_0x5e706b){utils[_0xb9a7('0x18')](util[_0xb9a7('0x1c')](_0xb9a7('0x2b'),_0x5bdf85[_0xb9a7('0x20')]),_0x5e706b);}});ami['on']('queuecallerleave',function(_0x115bb4){try{utils[_0xb9a7('0x1b')](util[_0xb9a7('0x1c')](_0xb9a7('0x2c'),_0x115bb4['uniqueid']),_0x115bb4);queues[_0xb9a7('0x2d')](_0x115bb4);}catch(_0x4ea78a){utils[_0xb9a7('0x18')](util['format'](_0xb9a7('0x2c'),_0x115bb4[_0xb9a7('0x20')]),_0x4ea78a);}});ami['on']('musiconholdstart',function(_0x47a29e){try{utils[_0xb9a7('0x1b')](util['format']('[%s][index][musiconholdstart]',_0x47a29e[_0xb9a7('0x20')]),_0x47a29e);queues[_0xb9a7('0x2e')](_0x47a29e);calls[_0xb9a7('0x2e')](_0x47a29e);}catch(_0x44e3c4){utils[_0xb9a7('0x18')](util[_0xb9a7('0x1c')](_0xb9a7('0x2f'),_0x47a29e['uniqueid']),_0x44e3c4);}});ami['on']('musiconholdstop',function(_0x5f028e){try{utils[_0xb9a7('0x1b')](util[_0xb9a7('0x1c')](_0xb9a7('0x30'),_0x5f028e[_0xb9a7('0x20')]),_0x5f028e);queues[_0xb9a7('0x31')](_0x5f028e);calls[_0xb9a7('0x31')](_0x5f028e);}catch(_0x11232a){utils[_0xb9a7('0x18')](util[_0xb9a7('0x1c')](_0xb9a7('0x30'),_0x5f028e['uniqueid']),_0x11232a);}});ami['on'](_0xb9a7('0x32'),function(_0x36af59){try{utils[_0xb9a7('0x1b')](util[_0xb9a7('0x1c')](_0xb9a7('0x33'),_0x36af59[_0xb9a7('0x20')]),_0x36af59);calls['newstate'](_0x36af59);recordings[_0xb9a7('0x32')](_0x36af59);}catch(_0x330627){utils[_0xb9a7('0x18')](util['format']('[%s][index][newstate]',_0x36af59['uniqueid']),_0x330627);}});ami['on'](_0xb9a7('0x34'),function(_0x50bb44){try{utils['debug'](util['format'](_0xb9a7('0x35'),_0x50bb44[_0xb9a7('0x20')]),_0x50bb44);calls[_0xb9a7('0x34')](_0x50bb44);recordings[_0xb9a7('0x34')](_0x50bb44);dials[_0xb9a7('0x34')](_0x50bb44);agents[_0xb9a7('0x34')](_0x50bb44);queues['hangup'](_0x50bb44);}catch(_0x3b43d8){utils[_0xb9a7('0x18')](util[_0xb9a7('0x1c')](_0xb9a7('0x35'),_0x50bb44[_0xb9a7('0x20')]),_0x3b43d8);}});ami['on'](_0xb9a7('0x36'),function(_0x3f9b49){try{utils[_0xb9a7('0x1b')](util['format'](_0xb9a7('0x37'),_0x3f9b49[_0xb9a7('0x20')]),_0x3f9b49);members[_0xb9a7('0x36')](_0x3f9b49);}catch(_0x551ae8){utils['error'](util[_0xb9a7('0x1c')](_0xb9a7('0x37'),_0x3f9b49['uniqueid']),_0x551ae8);}});ami['on']('blindtransfer',function(_0x4cf7e5){try{utils[_0xb9a7('0x1b')](util[_0xb9a7('0x1c')](_0xb9a7('0x38'),_0x4cf7e5['uniqueid']),_0x4cf7e5);queues['blindtransfer'](_0x4cf7e5);agents[_0xb9a7('0x39')](_0x4cf7e5);transfers[_0xb9a7('0x39')](_0x4cf7e5);recordings[_0xb9a7('0x39')](_0x4cf7e5);}catch(_0x36886f){utils[_0xb9a7('0x18')](util[_0xb9a7('0x1c')](_0xb9a7('0x38'),_0x4cf7e5['uniqueid']),_0x36886f);}});ami['on'](_0xb9a7('0x3a'),function(_0x197500){try{utils['debug'](util[_0xb9a7('0x1c')](_0xb9a7('0x3b'),_0x197500[_0xb9a7('0x3c')]),_0x197500);queues['attendedtransfer'](_0x197500);transfers[_0xb9a7('0x3a')](_0x197500);agents[_0xb9a7('0x3a')](_0x197500);calls['attendedtransfer'](_0x197500);}catch(_0x1ea575){utils['error'](util[_0xb9a7('0x1c')]('[%s][index][attendedtransfer]',_0x197500[_0xb9a7('0x3c')]),_0x1ea575);}});ami['on'](_0xb9a7('0x3d'),function(_0x4a9b8a){try{utils[_0xb9a7('0x1b')](util[_0xb9a7('0x1c')](_0xb9a7('0x3e'),_0x4a9b8a[_0xb9a7('0x20')]),_0x4a9b8a);queues[_0xb9a7('0x3d')](_0x4a9b8a);recordings['varset'](_0x4a9b8a);calls[_0xb9a7('0x3d')](_0x4a9b8a);dials[_0xb9a7('0x3d')](_0x4a9b8a);}catch(_0x13b110){utils[_0xb9a7('0x18')](util[_0xb9a7('0x1c')]('[%s][index][varset]',_0x4a9b8a[_0xb9a7('0x20')]),_0x13b110);}});ami['on'](_0xb9a7('0x3f'),function(_0x541b80){try{utils[_0xb9a7('0x1b')](util[_0xb9a7('0x1c')](_0xb9a7('0x40'),_0x541b80[_0xb9a7('0x20')]),_0x541b80);calls[_0xb9a7('0x3f')](_0x541b80);recordings['newexten'](_0x541b80);dials[_0xb9a7('0x3f')](_0x541b80);}catch(_0x140c21){utils[_0xb9a7('0x18')](util[_0xb9a7('0x1c')]('[%s][index][newexten]',_0x541b80[_0xb9a7('0x20')]),_0x140c21);}});ami['on']('newchannel',function(_0x22f2f5){try{utils['debug'](util[_0xb9a7('0x1c')]('[%s][index][newchannel]',_0x22f2f5[_0xb9a7('0x20')]),_0x22f2f5);calls['newchannel'](_0x22f2f5);recordings['newchannel'](_0x22f2f5);}catch(_0x583397){utils['error'](util[_0xb9a7('0x1c')]('[%s][index][newchannel]',_0x22f2f5[_0xb9a7('0x20')]),_0x583397);}});ami['on'](_0xb9a7('0x41'),function(_0x48a929){try{utils[_0xb9a7('0x1b')](util[_0xb9a7('0x1c')](_0xb9a7('0x42'),_0x48a929[_0xb9a7('0x20')]),_0x48a929);dials[_0xb9a7('0x41')](_0x48a929);}catch(_0x421962){utils[_0xb9a7('0x18')](util[_0xb9a7('0x1c')](_0xb9a7('0x43'),_0x48a929['uniqueid']),_0x421962);}});ami['on'](_0xb9a7('0x44'),function(_0x53c78d){try{utils[_0xb9a7('0x1b')](util[_0xb9a7('0x1c')]('[%s][index][dialend]',_0x53c78d[_0xb9a7('0x20')]),_0x53c78d);dials[_0xb9a7('0x44')](_0x53c78d);}catch(_0x41fdbb){utils[_0xb9a7('0x18')](util[_0xb9a7('0x1c')](_0xb9a7('0x45'),_0x53c78d[_0xb9a7('0x20')]),_0x41fdbb);}});}
\ No newline at end of file
+var _0x5d33=['error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','asterisk','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted'];(function(_0x11b4c4,_0x2e0d25){var _0x2aae7e=function(_0x2aa406){while(--_0x2aa406){_0x11b4c4['push'](_0x11b4c4['shift']());}};_0x2aae7e(++_0x2e0d25);}(_0x5d33,0x145));var _0x35d3=function(_0x19f805,_0xcd93ee){_0x19f805=_0x19f805-0x0;var _0x70808d=_0x5d33[_0x19f805];return _0x70808d;};var AsteriskManager=require(_0x35d3('0x0'));var config=require(_0x35d3('0x1'));var utils=require(_0x35d3('0x2'));var util=require(_0x35d3('0x3'));var isXDREnabled=config[_0x35d3('0x4')]&&config[_0x35d3('0x4')][_0x35d3('0x5')]?!config['xdr'][_0x35d3('0x5')]:!![];var isProduction=config['env']==='production'||![];var isLocalAsterisk=config[_0x35d3('0x4')]&&config[_0x35d3('0x4')]['local']===!![]||![];var ami=new AsteriskManager(config[_0x35d3('0x6')]['port'],config[_0x35d3('0x6')]['ip'],config[_0x35d3('0x6')]['username'],config[_0x35d3('0x6')]['password'],!![]);ami[_0x35d3('0x7')]();if(!isXDREnabled){utils[_0x35d3('0x8')](_0x35d3('0x9'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x35d3('0x8')](_0x35d3('0xa'));}else{var agents=require('./agents.controller');var calls=require(_0x35d3('0xb'));var queues=require(_0x35d3('0xc'));var recordings=require(_0x35d3('0xd'));var members=require(_0x35d3('0xe'));var dials=require('./dials.controller');var transfers=require(_0x35d3('0xf'));var core=require(_0x35d3('0x10'));ami['on']('connect',core[_0x35d3('0x11')]);ami['on'](_0x35d3('0x12'),core[_0x35d3('0x12')]);ami['on']('fullybooted',core[_0x35d3('0x13')]);ami['on'](_0x35d3('0x14'),core[_0x35d3('0x14')]);ami['on'](_0x35d3('0x15'),core[_0x35d3('0x15')]);ami['on'](_0x35d3('0x16'),core['managerevent']);ami['on'](_0x35d3('0x17'),function(_0x5bf823){try{utils['debug'](util[_0x35d3('0x18')]('[%s][index][devicestatechange]',_0x5bf823['device']),_0x5bf823);members['devicestatechange'](_0x5bf823);}catch(_0x19903c){utils['error'](util[_0x35d3('0x18')](_0x35d3('0x19'),_0x5bf823[_0x35d3('0x1a')]),_0x19903c);}});ami['on'](_0x35d3('0x1b'),function(_0x1bb20d){try{utils[_0x35d3('0x1c')](util[_0x35d3('0x18')](_0x35d3('0x1d'),_0x1bb20d['uniqueid']),_0x1bb20d);agents[_0x35d3('0x1b')](_0x1bb20d);}catch(_0x577d76){utils[_0x35d3('0x14')](util[_0x35d3('0x18')](_0x35d3('0x1d'),_0x1bb20d[_0x35d3('0x1e')]),_0x577d76);}});ami['on'](_0x35d3('0x1f'),function(_0x48efb9){try{utils[_0x35d3('0x1c')](util[_0x35d3('0x18')]('[%s][index][agentringnoanswer]',_0x48efb9[_0x35d3('0x1e')]),_0x48efb9);agents['agentringnoanswer'](_0x48efb9);}catch(_0x4f7c25){utils[_0x35d3('0x14')](util[_0x35d3('0x18')](_0x35d3('0x20'),_0x48efb9[_0x35d3('0x1e')]),_0x4f7c25);}});ami['on'](_0x35d3('0x21'),function(_0x1df8f5){try{utils['debug'](util[_0x35d3('0x18')](_0x35d3('0x22'),_0x1df8f5['uniqueid']),_0x1df8f5);agents[_0x35d3('0x21')](_0x1df8f5);queues[_0x35d3('0x21')](_0x1df8f5);}catch(_0xf2cd91){utils[_0x35d3('0x14')](util[_0x35d3('0x18')](_0x35d3('0x22'),_0x1df8f5[_0x35d3('0x1e')]),_0xf2cd91);}});ami['on'](_0x35d3('0x23'),function(_0x214cc2){try{utils[_0x35d3('0x1c')](util[_0x35d3('0x18')](_0x35d3('0x24'),_0x214cc2[_0x35d3('0x1e')]),_0x214cc2);agents[_0x35d3('0x23')](_0x214cc2);queues[_0x35d3('0x23')](_0x214cc2);members[_0x35d3('0x23')](_0x214cc2);}catch(_0x5c67f7){utils[_0x35d3('0x14')](util[_0x35d3('0x18')](_0x35d3('0x24'),_0x214cc2[_0x35d3('0x1e')]),_0x5c67f7);}});ami['on'](_0x35d3('0x25'),function(_0x3fe716){try{utils['debug'](util['format'](_0x35d3('0x26'),_0x3fe716[_0x35d3('0x1e')]),_0x3fe716);agents[_0x35d3('0x25')](_0x3fe716);queues['queuecallerabandon'](_0x3fe716);}catch(_0x418344){utils[_0x35d3('0x14')](util[_0x35d3('0x18')](_0x35d3('0x26'),_0x3fe716[_0x35d3('0x1e')]),_0x418344);}});ami['on'](_0x35d3('0x27'),function(_0x4d6682){try{utils['debug'](util[_0x35d3('0x18')](_0x35d3('0x28'),_0x4d6682['uniqueid']),_0x4d6682);queues[_0x35d3('0x27')](_0x4d6682);recordings[_0x35d3('0x27')](_0x4d6682);}catch(_0x274bb5){utils['error'](util['format'](_0x35d3('0x28'),_0x4d6682[_0x35d3('0x1e')]),_0x274bb5);}});ami['on'](_0x35d3('0x29'),function(_0x2d67fc){try{utils[_0x35d3('0x1c')](util[_0x35d3('0x18')]('[%s][index][queuecallerleave]',_0x2d67fc[_0x35d3('0x1e')]),_0x2d67fc);queues[_0x35d3('0x29')](_0x2d67fc);}catch(_0x21d86a){utils[_0x35d3('0x14')](util[_0x35d3('0x18')](_0x35d3('0x2a'),_0x2d67fc[_0x35d3('0x1e')]),_0x21d86a);}});ami['on'](_0x35d3('0x2b'),function(_0x5ea3e6){try{utils[_0x35d3('0x1c')](util[_0x35d3('0x18')](_0x35d3('0x2c'),_0x5ea3e6[_0x35d3('0x1e')]),_0x5ea3e6);queues[_0x35d3('0x2b')](_0x5ea3e6);calls['musiconholdstart'](_0x5ea3e6);}catch(_0x2133f8){utils['error'](util['format'](_0x35d3('0x2c'),_0x5ea3e6[_0x35d3('0x1e')]),_0x2133f8);}});ami['on']('musiconholdstop',function(_0x40ce1a){try{utils[_0x35d3('0x1c')](util['format'](_0x35d3('0x2d'),_0x40ce1a['uniqueid']),_0x40ce1a);queues[_0x35d3('0x2e')](_0x40ce1a);calls[_0x35d3('0x2e')](_0x40ce1a);}catch(_0x531199){utils[_0x35d3('0x14')](util[_0x35d3('0x18')](_0x35d3('0x2d'),_0x40ce1a[_0x35d3('0x1e')]),_0x531199);}});ami['on'](_0x35d3('0x2f'),function(_0x172a5a){try{utils['debug'](util[_0x35d3('0x18')](_0x35d3('0x30'),_0x172a5a['uniqueid']),_0x172a5a);calls[_0x35d3('0x2f')](_0x172a5a);recordings[_0x35d3('0x2f')](_0x172a5a);}catch(_0x86ff4e){utils[_0x35d3('0x14')](util['format'](_0x35d3('0x30'),_0x172a5a[_0x35d3('0x1e')]),_0x86ff4e);}});ami['on']('hangup',function(_0x453b19){try{utils[_0x35d3('0x1c')](util[_0x35d3('0x18')](_0x35d3('0x31'),_0x453b19['uniqueid']),_0x453b19);calls[_0x35d3('0x32')](_0x453b19);recordings[_0x35d3('0x32')](_0x453b19);dials['hangup'](_0x453b19);agents[_0x35d3('0x32')](_0x453b19);queues['hangup'](_0x453b19);}catch(_0x350e46){utils[_0x35d3('0x14')](util['format'](_0x35d3('0x31'),_0x453b19[_0x35d3('0x1e')]),_0x350e46);}});ami['on'](_0x35d3('0x33'),function(_0xc96d9f){try{utils[_0x35d3('0x1c')](util[_0x35d3('0x18')](_0x35d3('0x34'),_0xc96d9f['uniqueid']),_0xc96d9f);members[_0x35d3('0x33')](_0xc96d9f);}catch(_0x52b1da){utils[_0x35d3('0x14')](util['format'](_0x35d3('0x34'),_0xc96d9f[_0x35d3('0x1e')]),_0x52b1da);}});ami['on']('blindtransfer',function(_0x54ff28){try{utils[_0x35d3('0x1c')](util['format'](_0x35d3('0x35'),_0x54ff28[_0x35d3('0x1e')]),_0x54ff28);queues[_0x35d3('0x36')](_0x54ff28);agents['blindtransfer'](_0x54ff28);transfers[_0x35d3('0x36')](_0x54ff28);recordings['blindtransfer'](_0x54ff28);}catch(_0x5a4caf){utils[_0x35d3('0x14')](util[_0x35d3('0x18')](_0x35d3('0x35'),_0x54ff28[_0x35d3('0x1e')]),_0x5a4caf);}});ami['on'](_0x35d3('0x37'),function(_0x3ae154){try{utils[_0x35d3('0x1c')](util[_0x35d3('0x18')](_0x35d3('0x38'),_0x3ae154['origtransfereruniqueid']),_0x3ae154);queues['attendedtransfer'](_0x3ae154);transfers[_0x35d3('0x37')](_0x3ae154);agents[_0x35d3('0x37')](_0x3ae154);calls[_0x35d3('0x37')](_0x3ae154);}catch(_0x2f299c){utils[_0x35d3('0x14')](util[_0x35d3('0x18')](_0x35d3('0x38'),_0x3ae154[_0x35d3('0x39')]),_0x2f299c);}});ami['on'](_0x35d3('0x3a'),function(_0x2380f3){try{utils[_0x35d3('0x1c')](util['format'](_0x35d3('0x3b'),_0x2380f3[_0x35d3('0x1e')]),_0x2380f3);queues['varset'](_0x2380f3);recordings['varset'](_0x2380f3);calls[_0x35d3('0x3a')](_0x2380f3);dials['varset'](_0x2380f3);}catch(_0x59cf03){utils[_0x35d3('0x14')](util[_0x35d3('0x18')](_0x35d3('0x3b'),_0x2380f3[_0x35d3('0x1e')]),_0x59cf03);}});ami['on'](_0x35d3('0x3c'),function(_0x226702){try{utils[_0x35d3('0x1c')](util['format']('[%s][index][newexten]',_0x226702[_0x35d3('0x1e')]),_0x226702);calls[_0x35d3('0x3c')](_0x226702);recordings[_0x35d3('0x3c')](_0x226702);dials[_0x35d3('0x3c')](_0x226702);}catch(_0x16ab56){utils['error'](util['format'](_0x35d3('0x3d'),_0x226702[_0x35d3('0x1e')]),_0x16ab56);}});ami['on']('newchannel',function(_0x2820a4){try{utils['debug'](util[_0x35d3('0x18')](_0x35d3('0x3e'),_0x2820a4['uniqueid']),_0x2820a4);calls['newchannel'](_0x2820a4);recordings[_0x35d3('0x3f')](_0x2820a4);}catch(_0x854aaf){utils[_0x35d3('0x14')](util['format']('[%s][index][newchannel]',_0x2820a4['uniqueid']),_0x854aaf);}});ami['on']('dialbegin',function(_0x2230a3){try{utils[_0x35d3('0x1c')](util[_0x35d3('0x18')](_0x35d3('0x40'),_0x2230a3[_0x35d3('0x1e')]),_0x2230a3);dials[_0x35d3('0x41')](_0x2230a3);}catch(_0x5e7132){utils['error'](util[_0x35d3('0x18')](_0x35d3('0x42'),_0x2230a3['uniqueid']),_0x5e7132);}});ami['on'](_0x35d3('0x43'),function(_0x4efe59){try{utils[_0x35d3('0x1c')](util['format']('[%s][index][dialend]',_0x4efe59[_0x35d3('0x1e')]),_0x4efe59);dials['dialend'](_0x4efe59);}catch(_0x1f8541){utils[_0x35d3('0x14')](util[_0x35d3('0x18')](_0x35d3('0x44'),_0x4efe59[_0x35d3('0x1e')]),_0x1f8541);}});}
\ No newline at end of file
index 91b6e75..eb0c307 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5ba=['now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','[%s][members][cdr]','data1','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','assign','destination','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface','name','internal','request','CreateMemberReport','getUserByName','split','then','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc5ba,0xb9));var _0xac5b=function(_0x496ee9,_0x4dba12){_0x496ee9=_0x496ee9-0x0;var _0xb7016a=_0xc5ba[_0x496ee9];return _0xb7016a;};'use strict';var _=require(_0xac5b('0x0'));var util=require(_0xac5b('0x1'));var utils=require(_0xac5b('0x2'));var members={};var exclude=[_0xac5b('0x3'),_0xac5b('0x4')];function writeDB(_0x34fad9){utils[_0xac5b('0x5')](util[_0xac5b('0x6')](_0xac5b('0x7'),_0x34fad9[_0xac5b('0x8')],_0x34fad9[_0xac5b('0x9')],_0x34fad9[_0xac5b('0xa')],_0x34fad9[_0xac5b('0xb')],_0x34fad9[_0xac5b('0xc')],_0x34fad9[_0xac5b('0xd')]));if(_0x34fad9[_0xac5b('0x9')]){utils[_0xac5b('0xe')](_0x34fad9['interface'])['then'](function(_0x31af86){if(_0x31af86){_0x34fad9['membername']=_0x31af86[_0xac5b('0xf')];_0x34fad9[_0xac5b('0x10')]=_0x31af86[_0xac5b('0x10')];utils[_0xac5b('0x11')](_0xac5b('0x12'),_0x34fad9);}else{utils[_0xac5b('0x13')](_0x34fad9[_0xac5b('0x9')][_0xac5b('0x14')]('/')[0x1])[_0xac5b('0x15')](function(_0x59e879){if(_0x59e879){_0x34fad9[_0xac5b('0xc')]=_0x59e879[_0xac5b('0xf')];_0x34fad9[_0xac5b('0x10')]=_0x59e879[_0xac5b('0x10')];utils[_0xac5b('0x11')](_0xac5b('0x12'),_0x34fad9);}});}})[_0xac5b('0x16')](function(_0x35eef0){utils[_0xac5b('0x17')](util[_0xac5b('0x6')](_0xac5b('0x18'),_0x34fad9[_0xac5b('0x8')]),_0x35eef0);});}delete members[_0x34fad9['interface']];}function startsWith(_0x3bad56,_0xe88a79){return _[_0xac5b('0x19')](_0x3bad56,function(_0x2e4742){return _[_0xac5b('0x1a')](_0xe88a79,_0x2e4742);});}exports[_0xac5b('0x1b')]=function(_0x363de5){try{utils[_0xac5b('0x1c')](util[_0xac5b('0x6')](_0xac5b('0x1d'),members[_0x363de5[_0xac5b('0x1e')]]?members[_0x363de5['device']][_0xac5b('0x8')]:_0x363de5['device']),_0x363de5);utils[_0xac5b('0x5')](util['format'](_0xac5b('0x1f'),members[_0x363de5[_0xac5b('0x1e')]]?members[_0x363de5['device']]['uniqueid']:_0x363de5['device'],_0x363de5[_0xac5b('0x20')],_0x363de5['device']));switch(_0x363de5[_0xac5b('0x20')]){case _0xac5b('0x21'):case _0xac5b('0x22'):if(!startsWith(exclude,_0x363de5[_0xac5b('0x1e')])){members[_0x363de5[_0xac5b('0x1e')]]={'channel':'voice','interface':_0x363de5['device'],'type':'TALKING','enterAt':utils[_0xac5b('0x23')](),'role':'agent'};}break;case _0xac5b('0x24'):if(!_[_0xac5b('0x25')](members[_0x363de5['device']])){members[_0x363de5[_0xac5b('0x1e')]][_0xac5b('0x26')]=utils[_0xac5b('0x23')]();members[_0x363de5[_0xac5b('0x1e')]][_0xac5b('0x27')]=utils[_0xac5b('0x28')](members[_0x363de5[_0xac5b('0x1e')]][_0xac5b('0x26')],members[_0x363de5[_0xac5b('0x1e')]][_0xac5b('0x29')]);if(members[_0x363de5['device']][_0xac5b('0x8')]){writeDB(members[_0x363de5[_0xac5b('0x1e')]]);}}break;default:break;}}catch(_0x351d33){utils[_0xac5b('0x17')](util[_0xac5b('0x6')](_0xac5b('0x1d'),members[_0x363de5[_0xac5b('0x1e')]]?members[_0x363de5[_0xac5b('0x1e')]][_0xac5b('0x8')]:_0x363de5[_0xac5b('0x1e')]),_0x351d33);}};exports[_0xac5b('0x2a')]=function(_0x5f07c1){try{if(!_[_0xac5b('0x25')](members[_0x5f07c1[_0xac5b('0x9')]])){utils[_0xac5b('0x1c')](util['format'](_0xac5b('0x2b'),_0x5f07c1['uniqueid']),_0x5f07c1);utils[_0xac5b('0x5')](util[_0xac5b('0x6')](_0xac5b('0x2c'),_0x5f07c1[_0xac5b('0x8')],_0x5f07c1['interface'],_0x5f07c1[_0xac5b('0x2d')]));members[_0x5f07c1['interface']]=_['assign'](members[_0x5f07c1[_0xac5b('0x9')]],{'data4':_0x5f07c1[_0xac5b('0x2d')],'uniqueid':_0x5f07c1['uniqueid']});}}catch(_0x529ec5){utils[_0xac5b('0x17')](util[_0xac5b('0x6')]('[%s][members][agentcomplete]',_0x5f07c1[_0xac5b('0x8')]),_0x529ec5);}};exports[_0xac5b('0x2e')]=function(_0x3f424d){try{utils['debug'](util['format'](_0xac5b('0x2f'),_0x3f424d[_0xac5b('0x8')]),_0x3f424d);if(_0x3f424d['channel']){var _0x2f7e7f=_0x3f424d[_0xac5b('0xa')][_0xac5b('0x14')]('-')[0x0];if(!_[_0xac5b('0x25')](members[_0x2f7e7f])){members[_0x2f7e7f]=_['assign'](members[_0x2f7e7f],{'data1':members[_0x2f7e7f][_0xac5b('0x30')]||_0x3f424d[_0xac5b('0xd')],'data2':members[_0x2f7e7f][_0xac5b('0xb')]||_0x3f424d[_0xac5b('0x31')],'data3':members[_0x2f7e7f][_0xac5b('0x32')]||_0x3f424d['destination'],'uniqueid':members[_0x2f7e7f][_0xac5b('0x8')]||_0x3f424d['uniqueid']});utils[_0xac5b('0x5')](util['format'](_0xac5b('0x33'),_0x3f424d[_0xac5b('0x8')],members[_0x2f7e7f][_0xac5b('0x30')],members[_0x2f7e7f][_0xac5b('0xb')],members[_0x2f7e7f][_0xac5b('0x32')]));if(members[_0x2f7e7f][_0xac5b('0x26')]){writeDB(members[_0x2f7e7f]);}}}if(_0x3f424d['destinationchannel']){var _0x419dfc=_0x3f424d[_0xac5b('0x34')][_0xac5b('0x14')]('-')[0x0];if(!_[_0xac5b('0x25')](members[_0x419dfc])){members[_0x419dfc]=_[_0xac5b('0x35')](members[_0x419dfc],{'data1':members[_0x419dfc][_0xac5b('0x30')]||_0x3f424d[_0xac5b('0xd')],'data2':members[_0x419dfc]['data2']||_0x3f424d[_0xac5b('0x31')],'data3':members[_0x419dfc][_0xac5b('0x32')]||_0x3f424d[_0xac5b('0x36')],'uniqueid':members[_0x419dfc][_0xac5b('0x8')]||_0x3f424d[_0xac5b('0x8')]});utils[_0xac5b('0x5')](util['format'](_0xac5b('0x33'),_0x3f424d['uniqueid'],members[_0x419dfc][_0xac5b('0x30')],members[_0x419dfc]['data2'],members[_0x419dfc][_0xac5b('0x32')]));if(members[_0x419dfc]['exitAt']){writeDB(members[_0x419dfc]);}}}}catch(_0x58d594){utils['error'](util['format']('[%s][members][cdr]',_0x3f424d['uniqueid']),_0x58d594);}};
\ No newline at end of file
+var _0xa8d3=['catch','error','[%s][members][writeDB]','uniqueid','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','state','INUSE','voice','now','isNil','duration','diffTime','exitAt','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','[%s][members][cdr]','channel','split','data1','source','data3','destination','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','interface','data2','type','getUserByInterface','then','name','internal','request','membername','CreateMemberReport'];(function(_0x4f2c3a,_0x6bde90){var _0x17d91c=function(_0xaaf630){while(--_0xaaf630){_0x4f2c3a['push'](_0x4f2c3a['shift']());}};_0x17d91c(++_0x6bde90);}(_0xa8d3,0x121));var _0x3a8d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa8d3[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3a8d('0x0'));var util=require(_0x3a8d('0x1'));var utils=require(_0x3a8d('0x2'));var members={};var exclude=[_0x3a8d('0x3'),_0x3a8d('0x4')];function writeDB(_0xc76916){utils[_0x3a8d('0x5')](util[_0x3a8d('0x6')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0xc76916['uniqueid'],_0xc76916[_0x3a8d('0x7')],_0xc76916['channel'],_0xc76916[_0x3a8d('0x8')],_0xc76916['membername'],_0xc76916[_0x3a8d('0x9')]));if(_0xc76916[_0x3a8d('0x7')]){utils[_0x3a8d('0xa')](_0xc76916['interface'])[_0x3a8d('0xb')](function(_0x49a530){if(_0x49a530){_0xc76916['membername']=_0x49a530[_0x3a8d('0xc')];_0xc76916['internal']=_0x49a530[_0x3a8d('0xd')];utils[_0x3a8d('0xe')]('CreateMemberReport',_0xc76916);}else{utils['getUserByName'](_0xc76916['interface']['split']('/')[0x1])['then'](function(_0x208fe6){if(_0x208fe6){_0xc76916[_0x3a8d('0xf')]=_0x208fe6[_0x3a8d('0xc')];_0xc76916[_0x3a8d('0xd')]=_0x208fe6[_0x3a8d('0xd')];utils[_0x3a8d('0xe')](_0x3a8d('0x10'),_0xc76916);}});}})[_0x3a8d('0x11')](function(_0x554ea4){utils[_0x3a8d('0x12')](util[_0x3a8d('0x6')](_0x3a8d('0x13'),_0xc76916[_0x3a8d('0x14')]),_0x554ea4);});}delete members[_0xc76916[_0x3a8d('0x7')]];}function startsWith(_0x2473b4,_0x25ebec){return _[_0x3a8d('0x15')](_0x2473b4,function(_0x5c376d){return _[_0x3a8d('0x16')](_0x25ebec,_0x5c376d);});}exports[_0x3a8d('0x17')]=function(_0x5b8115){try{utils[_0x3a8d('0x18')](util['format'](_0x3a8d('0x19'),members[_0x5b8115[_0x3a8d('0x1a')]]?members[_0x5b8115[_0x3a8d('0x1a')]][_0x3a8d('0x14')]:_0x5b8115[_0x3a8d('0x1a')]),_0x5b8115);utils['info'](util['format']('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x5b8115[_0x3a8d('0x1a')]]?members[_0x5b8115[_0x3a8d('0x1a')]][_0x3a8d('0x14')]:_0x5b8115['device'],_0x5b8115[_0x3a8d('0x1b')],_0x5b8115[_0x3a8d('0x1a')]));switch(_0x5b8115[_0x3a8d('0x1b')]){case _0x3a8d('0x1c'):case'BUSY':if(!startsWith(exclude,_0x5b8115[_0x3a8d('0x1a')])){members[_0x5b8115[_0x3a8d('0x1a')]]={'channel':_0x3a8d('0x1d'),'interface':_0x5b8115[_0x3a8d('0x1a')],'type':'TALKING','enterAt':utils[_0x3a8d('0x1e')](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0x3a8d('0x1f')](members[_0x5b8115['device']])){members[_0x5b8115[_0x3a8d('0x1a')]]['exitAt']=utils[_0x3a8d('0x1e')]();members[_0x5b8115['device']][_0x3a8d('0x20')]=utils[_0x3a8d('0x21')](members[_0x5b8115['device']][_0x3a8d('0x22')],members[_0x5b8115[_0x3a8d('0x1a')]][_0x3a8d('0x23')]);if(members[_0x5b8115[_0x3a8d('0x1a')]][_0x3a8d('0x14')]){writeDB(members[_0x5b8115['device']]);}}break;default:break;}}catch(_0x43e414){utils['error'](util[_0x3a8d('0x6')](_0x3a8d('0x19'),members[_0x5b8115[_0x3a8d('0x1a')]]?members[_0x5b8115[_0x3a8d('0x1a')]][_0x3a8d('0x14')]:_0x5b8115[_0x3a8d('0x1a')]),_0x43e414);}};exports[_0x3a8d('0x24')]=function(_0x3344d6){try{if(!_[_0x3a8d('0x1f')](members[_0x3344d6[_0x3a8d('0x7')]])){utils['debug'](util[_0x3a8d('0x6')](_0x3a8d('0x25'),_0x3344d6[_0x3a8d('0x14')]),_0x3344d6);utils[_0x3a8d('0x5')](util[_0x3a8d('0x6')](_0x3a8d('0x26'),_0x3344d6[_0x3a8d('0x14')],_0x3344d6[_0x3a8d('0x7')],_0x3344d6['queue']));members[_0x3344d6[_0x3a8d('0x7')]]=_[_0x3a8d('0x27')](members[_0x3344d6['interface']],{'data4':_0x3344d6[_0x3a8d('0x28')],'uniqueid':_0x3344d6[_0x3a8d('0x14')]});}}catch(_0x4e85b7){utils[_0x3a8d('0x12')](util['format'](_0x3a8d('0x25'),_0x3344d6[_0x3a8d('0x14')]),_0x4e85b7);}};exports[_0x3a8d('0x29')]=function(_0x49bbeb){try{utils[_0x3a8d('0x18')](util[_0x3a8d('0x6')](_0x3a8d('0x2a'),_0x49bbeb[_0x3a8d('0x14')]),_0x49bbeb);if(_0x49bbeb['channel']){var _0x364d81=_0x49bbeb[_0x3a8d('0x2b')][_0x3a8d('0x2c')]('-')[0x0];if(!_[_0x3a8d('0x1f')](members[_0x364d81])){members[_0x364d81]=_['assign'](members[_0x364d81],{'data1':members[_0x364d81][_0x3a8d('0x2d')]||_0x49bbeb[_0x3a8d('0x9')],'data2':members[_0x364d81][_0x3a8d('0x8')]||_0x49bbeb[_0x3a8d('0x2e')],'data3':members[_0x364d81][_0x3a8d('0x2f')]||_0x49bbeb[_0x3a8d('0x30')],'uniqueid':members[_0x364d81][_0x3a8d('0x14')]||_0x49bbeb[_0x3a8d('0x14')]});utils['info'](util[_0x3a8d('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x49bbeb[_0x3a8d('0x14')],members[_0x364d81]['data1'],members[_0x364d81]['data2'],members[_0x364d81][_0x3a8d('0x2f')]));if(members[_0x364d81][_0x3a8d('0x22')]){writeDB(members[_0x364d81]);}}}if(_0x49bbeb[_0x3a8d('0x31')]){var _0x409c5e=_0x49bbeb['destinationchannel'][_0x3a8d('0x2c')]('-')[0x0];if(!_[_0x3a8d('0x1f')](members[_0x409c5e])){members[_0x409c5e]=_['assign'](members[_0x409c5e],{'data1':members[_0x409c5e][_0x3a8d('0x2d')]||_0x49bbeb[_0x3a8d('0x9')],'data2':members[_0x409c5e]['data2']||_0x49bbeb[_0x3a8d('0x2e')],'data3':members[_0x409c5e][_0x3a8d('0x2f')]||_0x49bbeb[_0x3a8d('0x30')],'uniqueid':members[_0x409c5e][_0x3a8d('0x14')]||_0x49bbeb[_0x3a8d('0x14')]});utils['info'](util['format'](_0x3a8d('0x32'),_0x49bbeb['uniqueid'],members[_0x409c5e][_0x3a8d('0x2d')],members[_0x409c5e][_0x3a8d('0x8')],members[_0x409c5e][_0x3a8d('0x2f')]));if(members[_0x409c5e][_0x3a8d('0x22')]){writeDB(members[_0x409c5e]);}}}}catch(_0x3274f6){utils[_0x3a8d('0x12')](util['format'](_0x3a8d('0x2a'),_0x49bbeb[_0x3a8d('0x14')]),_0x3274f6);}};
\ No newline at end of file
index cec92db..3ae88e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x721f=['queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','name','queuecallerenterreason','varset','variable','value','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandonAt','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','[%s][queues][agentcomplete]','queuecallercompleteAt','transfer','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','extension','BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','transferexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','secondtransfereruniqueid','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','lodash','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt'];(function(_0x92c539,_0x325156){var _0x4fca02=function(_0x5f34da){while(--_0x5f34da){_0x92c539['push'](_0x92c539['shift']());}};_0x4fca02(++_0x325156);}(_0x721f,0x172));var _0xf721=function(_0x1c867e,_0x190add){_0x1c867e=_0x1c867e-0x0;var _0x37868b=_0x721f[_0x1c867e];return _0x37868b;};'use strict';var _=require(_0xf721('0x0'));var util=require(_0xf721('0x1'));var utils=require(_0xf721('0x2'));var queues={};function writeDB(_0x47fd0d){utils[_0xf721('0x3')](util['format'](_0xf721('0x4'),_0x47fd0d[_0xf721('0x5')],_0x47fd0d[_0xf721('0x6')],_0x47fd0d[_0xf721('0x7')],_0x47fd0d[_0xf721('0x8')],_0x47fd0d[_0xf721('0x9')],_0x47fd0d[_0xf721('0xa')],_0x47fd0d[_0xf721('0xb')]));if(_0x47fd0d['queue']){utils['getVoiceQueueByName'](_0x47fd0d[_0xf721('0x7')])[_0xf721('0xc')](function(_0x47fae2){if(_0x47fae2){_0x47fd0d[_0xf721('0xd')]=_0x47fae2[_0xf721('0xd')];}utils[_0xf721('0xe')](_0xf721('0xf'),_0x47fd0d);});}else{utils[_0xf721('0xe')](_0xf721('0xf'),_0x47fd0d);}if(_0x47fd0d[_0xf721('0x10')]){delete queues[_0x47fd0d[_0xf721('0x10')]];}else{delete queues[_0x47fd0d[_0xf721('0x5')]];}}exports[_0xf721('0x11')]=function(_0x11da18){try{utils[_0xf721('0x12')](util[_0xf721('0x13')](_0xf721('0x14'),_0x11da18['uniqueid']),_0x11da18);utils['info'](util[_0xf721('0x13')](_0xf721('0x15'),_0x11da18['uniqueid'],_0x11da18[_0xf721('0x7')],_0x11da18['position']));queues[_0x11da18[_0xf721('0x5')]]=_[_0xf721('0x16')](_0x11da18,{'originalposition':_0x11da18[_0xf721('0x17')],'queuecallerjoinAt':utils[_0xf721('0x18')](),'mohtime':0x0});}catch(_0x9bb410){utils[_0xf721('0x19')](util[_0xf721('0x13')](_0xf721('0x14'),_0x11da18[_0xf721('0x5')]),_0x9bb410);}};exports[_0xf721('0x1a')]=function(_0x59f1fa){try{if(!_[_0xf721('0x1b')](queues[_0x59f1fa[_0xf721('0x5')]])){utils[_0xf721('0x12')](util[_0xf721('0x13')](_0xf721('0x1c'),_0x59f1fa[_0xf721('0x5')]),_0x59f1fa);if(queues[_0x59f1fa[_0xf721('0x5')]][_0xf721('0x1d')]){if(!queues[_0x59f1fa['uniqueid']][_0xf721('0x1e')]&&!queues[_0x59f1fa[_0xf721('0x5')]][_0xf721('0x1f')]){queues[_0x59f1fa['uniqueid']][_0xf721('0x20')]=!![];queues[_0x59f1fa[_0xf721('0x5')]]['queuecallercompleteAt']=utils[_0xf721('0x18')]();queues[_0x59f1fa[_0xf721('0x5')]][_0xf721('0xb')]=_0xf721('0x21');}utils[_0xf721('0x3')](util['format'](_0xf721('0x22'),_0x59f1fa[_0xf721('0x5')],queues[_0x59f1fa[_0xf721('0x5')]]['name'],queues[_0x59f1fa[_0xf721('0x5')]][_0xf721('0xb')]));writeDB(queues[_0x59f1fa['uniqueid']]);}else if(queues[_0x59f1fa[_0xf721('0x5')]][_0xf721('0x10')]){utils[_0xf721('0x3')](util[_0xf721('0x13')](_0xf721('0x23'),_0x59f1fa[_0xf721('0x5')],queues[_0x59f1fa[_0xf721('0x5')]][_0xf721('0x24')],queues[_0x59f1fa[_0xf721('0x5')]][_0xf721('0x10')]));queues[queues[_0x59f1fa[_0xf721('0x5')]][_0xf721('0x10')]]=queues[_0x59f1fa[_0xf721('0x5')]];queues[queues[_0x59f1fa[_0xf721('0x5')]][_0xf721('0x10')]][_0xf721('0x25')]=0x2;delete queues[_0x59f1fa['uniqueid']];}}}catch(_0x406018){utils['error'](util[_0xf721('0x13')](_0xf721('0x1c'),_0x59f1fa['uniqueid']),_0x406018);}};exports[_0xf721('0x26')]=function(_0xdc1806){try{utils[_0xf721('0x12')](util[_0xf721('0x13')]('[%s][queues][varset]',_0xdc1806[_0xf721('0x5')]),_0xdc1806);if(!_[_0xf721('0x1b')](_0xdc1806[_0xf721('0x27')]['queuestatus'])&&_0xdc1806[_0xf721('0x28')]['toUpperCase']()!=='CONTINUE'){if(!_[_0xf721('0x1b')](queues[_0xdc1806['uniqueid']])){queues[_0xdc1806['uniqueid']][_0xf721('0x1e')]=![];queues[_0xdc1806[_0xf721('0x5')]]['queuecallerabandonAt']=null;queues[_0xdc1806[_0xf721('0x5')]][_0xf721('0x1f')]=!![];queues[_0xdc1806[_0xf721('0x5')]][_0xf721('0x29')]=utils[_0xf721('0x18')]();queues[_0xdc1806[_0xf721('0x5')]][_0xf721('0xb')]=_0xdc1806[_0xf721('0x28')][_0xf721('0x2a')]();utils[_0xf721('0x3')](util['format'](_0xf721('0x2b'),_0xdc1806[_0xf721('0x5')],queues[_0xdc1806[_0xf721('0x5')]][_0xf721('0x24')],_0xdc1806[_0xf721('0x28')],queues[_0xdc1806[_0xf721('0x5')]][_0xf721('0xb')]));writeDB(queues[_0xdc1806['uniqueid']]);}}else if(!_[_0xf721('0x1b')](_0xdc1806[_0xf721('0x27')][_0xf721('0x2c')])){if(!_[_0xf721('0x1b')](queues[_0xdc1806[_0xf721('0x5')]])&&!queues[_0xdc1806['uniqueid']]['queuecallerabandon']){queues[_0xdc1806[_0xf721('0x5')]][_0xf721('0x1e')]=![];queues[_0xdc1806[_0xf721('0x5')]][_0xf721('0x2d')]=null;queues[_0xdc1806[_0xf721('0x5')]][_0xf721('0x1f')]=!![];queues[_0xdc1806['uniqueid']][_0xf721('0x29')]=utils[_0xf721('0x18')]();queues[_0xdc1806[_0xf721('0x5')]]['queuecallerexitreason']=_0xf721('0x2e');utils[_0xf721('0x3')](util[_0xf721('0x13')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0xdc1806[_0xf721('0x5')],queues[_0xdc1806[_0xf721('0x5')]][_0xf721('0x24')],_0xdc1806['value'],queues[_0xdc1806[_0xf721('0x5')]][_0xf721('0xb')]));}}}catch(_0x209bd1){utils[_0xf721('0x19')](util[_0xf721('0x13')]('[%s][queues][varset]',_0xdc1806['uniqueid']),_0x209bd1);}};exports[_0xf721('0x1e')]=function(_0x452cdf){try{if(!_[_0xf721('0x1b')](queues[_0x452cdf[_0xf721('0x5')]])){utils['debug'](util[_0xf721('0x13')](_0xf721('0x2f'),_0x452cdf[_0xf721('0x5')]),_0x452cdf);queues[_0x452cdf[_0xf721('0x5')]]['queuecallerexit']=![];queues[_0x452cdf['uniqueid']][_0xf721('0x29')]=null;queues[_0x452cdf[_0xf721('0x5')]][_0xf721('0x1e')]=!![];queues[_0x452cdf[_0xf721('0x5')]][_0xf721('0x2d')]=utils['now']();queues[_0x452cdf[_0xf721('0x5')]]['queuecallerexitreason']=_0xf721('0x30');utils[_0xf721('0x3')](util['format'](_0xf721('0x31'),_0x452cdf[_0xf721('0x5')],queues[_0x452cdf['uniqueid']][_0xf721('0x24')],queues[_0x452cdf[_0xf721('0x5')]][_0xf721('0xb')]));}}catch(_0x3d09ea){utils[_0xf721('0x19')](util[_0xf721('0x13')](_0xf721('0x2f'),_0x452cdf[_0xf721('0x5')]),_0x3d09ea);}};exports[_0xf721('0x32')]=function(_0x240b0f){try{if(!_['isNil'](queues[_0x240b0f['uniqueid']])){utils['debug'](util[_0xf721('0x13')](_0xf721('0x33'),_0x240b0f[_0xf721('0x5')]),_0x240b0f);utils[_0xf721('0x3')](util[_0xf721('0x13')](_0xf721('0x34'),_0x240b0f[_0xf721('0x5')],queues[_0x240b0f[_0xf721('0x5')]]['name'],_0x240b0f[_0xf721('0x35')],_0x240b0f[_0xf721('0x36')]));queues[_0x240b0f['uniqueid']][_0xf721('0x32')]=!![];queues[_0x240b0f[_0xf721('0x5')]][_0xf721('0x1d')]=utils[_0xf721('0x18')]();queues[_0x240b0f[_0xf721('0x5')]]['holdtime']=utils['diffTime'](queues[_0x240b0f[_0xf721('0x5')]][_0xf721('0x1d')],queues[_0x240b0f['uniqueid']][_0xf721('0x37')]);queues[_0x240b0f['uniqueid']][_0xf721('0x17')]=_0x240b0f['position'];queues[_0x240b0f[_0xf721('0x5')]][_0xf721('0x38')]=_0x240b0f['count'];queues[_0x240b0f[_0xf721('0x5')]][_0xf721('0x35')]=_0x240b0f[_0xf721('0x35')];queues[_0x240b0f[_0xf721('0x5')]]['connectedlinename']=_0x240b0f[_0xf721('0x36')];}}catch(_0x3b265e){utils[_0xf721('0x19')](util[_0xf721('0x13')](_0xf721('0x33'),_0x240b0f['uniqueid']),_0x3b265e);}};exports[_0xf721('0x39')]=function(_0x1c5986){try{if(!_['isNil'](queues[_0x1c5986[_0xf721('0x5')]])){utils['debug'](util[_0xf721('0x13')](_0xf721('0x3a'),_0x1c5986[_0xf721('0x5')]),_0x1c5986);utils[_0xf721('0x3')](util[_0xf721('0x13')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x1c5986[_0xf721('0x5')],queues[_0x1c5986['uniqueid']]['name'],_0x1c5986[_0xf721('0x3b')],_0x1c5986[_0xf721('0x3c')]));queues[_0x1c5986['uniqueid']][_0xf721('0x1e')]=![];queues[_0x1c5986[_0xf721('0x5')]][_0xf721('0x1e')]=![];queues[_0x1c5986[_0xf721('0x5')]][_0xf721('0x2d')]=null;queues[_0x1c5986['uniqueid']][_0xf721('0x1f')]=![];queues[_0x1c5986[_0xf721('0x5')]][_0xf721('0xb')]=null;queues[_0x1c5986['uniqueid']]['queuecallerexitAt']=null;queues[_0x1c5986[_0xf721('0x5')]]['assigned']=!![];queues[_0x1c5986[_0xf721('0x5')]][_0xf721('0xa')]=_0x1c5986[_0xf721('0x3c')];queues[_0x1c5986[_0xf721('0x5')]][_0xf721('0x8')]=_0x1c5986[_0xf721('0x3b')];}}catch(_0x599cb7){utils[_0xf721('0x19')](util['format'](_0xf721('0x3a'),_0x1c5986['uniqueid']),_0x599cb7);}};exports['agentcomplete']=function(_0x5a2393){try{if(!_[_0xf721('0x1b')](queues[_0x5a2393[_0xf721('0x5')]])){if(queues[_0x5a2393[_0xf721('0x5')]][_0xf721('0x1d')]){utils['debug'](util[_0xf721('0x13')](_0xf721('0x3d'),_0x5a2393[_0xf721('0x5')]),_0x5a2393);queues[_0x5a2393[_0xf721('0x5')]][_0xf721('0x1e')]=![];queues[_0x5a2393[_0xf721('0x5')]][_0xf721('0x1e')]=![];queues[_0x5a2393[_0xf721('0x5')]][_0xf721('0x2d')]=null;queues[_0x5a2393[_0xf721('0x5')]]['queuecallerexit']=![];queues[_0x5a2393[_0xf721('0x5')]][_0xf721('0x29')]=null;queues[_0x5a2393['uniqueid']]['assigned']=!![];queues[_0x5a2393[_0xf721('0x5')]][_0xf721('0x8')]=_0x5a2393[_0xf721('0x3b')];queues[_0x5a2393['uniqueid']][_0xf721('0x20')]=!![];queues[_0x5a2393['uniqueid']][_0xf721('0x3e')]=utils[_0xf721('0x18')]();if(_0x5a2393['reason']==_0xf721('0x3f')){if(!queues[_0x5a2393[_0xf721('0x5')]][_0xf721('0x3f')]){queues[_0x5a2393[_0xf721('0x5')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x5a2393['uniqueid']]['queuecallerexitreason']=_0xf721('0x40')+_0x5a2393[_0xf721('0x41')][_0xf721('0x2a')]();}utils['info'](util[_0xf721('0x13')](_0xf721('0x42'),_0x5a2393[_0xf721('0x5')],queues[_0x5a2393[_0xf721('0x5')]][_0xf721('0x24')],_0x5a2393[_0xf721('0x3b')],queues[_0x5a2393[_0xf721('0x5')]][_0xf721('0xb')]));writeDB(queues[_0x5a2393[_0xf721('0x5')]]);}}}catch(_0x13a591){utils[_0xf721('0x19')](util['format'](_0xf721('0x3d'),_0x5a2393[_0xf721('0x5')]),_0x13a591);}};exports['blindtransfer']=function(_0x492f17){try{if(!_[_0xf721('0x1b')](queues[_0x492f17[_0xf721('0x43')]])){utils[_0xf721('0x12')](util[_0xf721('0x13')](_0xf721('0x44'),_0x492f17[_0xf721('0x5')]),_0x492f17);queues[_0x492f17['transfereeuniqueid']][_0xf721('0x3f')]=!![];queues[_0x492f17[_0xf721('0x43')]]['transfertype']=_0xf721('0x45');queues[_0x492f17['transfereeuniqueid']]['transferexten']=_0x492f17[_0xf721('0x46')];queues[_0x492f17[_0xf721('0x43')]]['transferuniqueid']=_0x492f17[_0xf721('0x43')];queues[_0x492f17[_0xf721('0x43')]][_0xf721('0xb')]=_0xf721('0x47');utils[_0xf721('0x3')](util['format']('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x492f17['uniqueid'],queues[_0x492f17[_0xf721('0x43')]][_0xf721('0x24')],_0x492f17[_0xf721('0x43')],_0x492f17['extension']));}}catch(_0x23753e){utils[_0xf721('0x19')](util[_0xf721('0x13')](_0xf721('0x44'),_0x492f17[_0xf721('0x5')]),_0x23753e);}};exports['attendedtransfer']=function(_0x3df019){try{utils[_0xf721('0x12')](util[_0xf721('0x13')](_0xf721('0x48'),_0x3df019[_0xf721('0x49')]),_0x3df019);if(_0x3df019['origtransfereruniqueid']==_0x3df019[_0xf721('0x4a')]){if(!_[_0xf721('0x1b')](queues[_0x3df019[_0xf721('0x4b')]])){utils[_0xf721('0x3')](util[_0xf721('0x13')](_0xf721('0x4c'),_0x3df019[_0xf721('0x49')],queues[_0x3df019['secondtransfererlinkedid']][_0xf721('0x24')],_0x3df019[_0xf721('0x4d')]));queues[_0x3df019[_0xf721('0x4b')]][_0xf721('0x3f')]=!![];queues[_0x3df019[_0xf721('0x4b')]][_0xf721('0x4e')]='ATTENDED';queues[_0x3df019[_0xf721('0x4b')]][_0xf721('0x4f')]=_0x3df019[_0xf721('0x4d')];queues[_0x3df019[_0xf721('0x4b')]][_0xf721('0x50')]=_0x3df019['origtransfereruniqueid'];queues[_0x3df019['secondtransfererlinkedid']][_0xf721('0xb')]=_0xf721('0x51');}if(!_[_0xf721('0x1b')](queues[_0x3df019[_0xf721('0x4a')]])){if(_0x3df019[_0xf721('0x52')]&&queues[_0x3df019[_0xf721('0x52')]]){queues[_0x3df019[_0xf721('0x52')]][_0xf721('0x25')]=0x1;queues[_0x3df019[_0xf721('0x43')]]=_[_0xf721('0x53')](queues[_0x3df019['transfereelinkedid']]);queues[_0x3df019['transfereeuniqueid']]['transfereduniqueid']=_0x3df019[_0xf721('0x54')];queues[_0x3df019[_0xf721('0x43')]][_0xf721('0x25')]=0x2;queues[_0x3df019[_0xf721('0x43')]][_0xf721('0x9')]=queues[_0x3df019['secondtransfererlinkedid']][_0xf721('0x9')];queues[_0x3df019[_0xf721('0x43')]][_0xf721('0x55')]=queues[_0x3df019[_0xf721('0x4b')]][_0xf721('0x55')];queues[_0x3df019[_0xf721('0x43')]][_0xf721('0x37')]=utils[_0xf721('0x18')]();queues[_0x3df019['transfereeuniqueid']][_0xf721('0x1d')]=utils[_0xf721('0x18')]();queues[_0x3df019[_0xf721('0x43')]][_0xf721('0x56')]=0x0;queues[_0x3df019[_0xf721('0x43')]][_0xf721('0x57')]=0x0;utils['info'](util[_0xf721('0x13')](_0xf721('0x58'),_0x3df019[_0xf721('0x49')],queues[_0x3df019[_0xf721('0x43')]]['name'],queues[_0x3df019[_0xf721('0x43')]][_0xf721('0x9')],queues[_0x3df019[_0xf721('0x43')]][_0xf721('0x55')]));}else{utils['info'](util[_0xf721('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x3df019[_0xf721('0x49')],queues[_0x3df019[_0xf721('0x4a')]][_0xf721('0x24')],_0x3df019['secondtransfererlinkedid']));queues[_0x3df019[_0xf721('0x4a')]][_0xf721('0x10')]=_0x3df019['secondtransfererlinkedid'];}}}else if(_0x3df019['secondtransfereruniqueid']==_0x3df019[_0xf721('0x4b')]){if(!_[_0xf721('0x1b')](queues[_0x3df019['origtransfererlinkedid']])){utils[_0xf721('0x3')](util[_0xf721('0x13')](_0xf721('0x59'),_0x3df019[_0xf721('0x49')],queues[_0x3df019['origtransfererlinkedid']]['name'],_0x3df019['secondtransfereruniqueid'],_0x3df019[_0xf721('0x5a')]));queues[_0x3df019[_0xf721('0x4a')]][_0xf721('0x3f')]=!![];queues[_0x3df019[_0xf721('0x4a')]]['transfertype']='ATTENDED';queues[_0x3df019[_0xf721('0x4a')]][_0xf721('0x4f')]=_0x3df019[_0xf721('0x5a')];queues[_0x3df019[_0xf721('0x4a')]][_0xf721('0x50')]=_0x3df019[_0xf721('0x5b')];queues[_0x3df019[_0xf721('0x4a')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x3df019[_0xf721('0x4b')]])){if(_0x3df019[_0xf721('0x5c')]&&queues[_0x3df019[_0xf721('0x5c')]]){queues[_0x3df019[_0xf721('0x5c')]][_0xf721('0x25')]=0x1;queues[_0x3df019[_0xf721('0x54')]]=_[_0xf721('0x53')](queues[_0x3df019['transfertargetlinkedid']]);queues[_0x3df019[_0xf721('0x54')]][_0xf721('0x10')]=_0x3df019[_0xf721('0x54')];queues[_0x3df019[_0xf721('0x54')]][_0xf721('0x25')]=0x2;queues[_0x3df019[_0xf721('0x54')]][_0xf721('0x9')]=queues[_0x3df019[_0xf721('0x4a')]][_0xf721('0x9')];queues[_0x3df019[_0xf721('0x54')]][_0xf721('0x55')]=queues[_0x3df019[_0xf721('0x4a')]][_0xf721('0x55')];queues[_0x3df019[_0xf721('0x54')]][_0xf721('0x37')]=utils[_0xf721('0x18')]();queues[_0x3df019['transfertargetuniqueid']][_0xf721('0x1d')]=utils[_0xf721('0x18')]();queues[_0x3df019[_0xf721('0x54')]]['holdtime']=0x0;queues[_0x3df019[_0xf721('0x54')]][_0xf721('0x57')]=0x0;utils[_0xf721('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x3df019[_0xf721('0x49')],queues[_0x3df019['transfertargetuniqueid']]['name'],queues[_0x3df019[_0xf721('0x54')]][_0xf721('0x10')],queues[_0x3df019['transfertargetuniqueid']]['calleridnum'],queues[_0x3df019[_0xf721('0x54')]][_0xf721('0x55')]));}else{utils[_0xf721('0x3')](util['format'](_0xf721('0x5d'),_0x3df019[_0xf721('0x49')],queues[_0x3df019[_0xf721('0x4b')]][_0xf721('0x24')],_0x3df019[_0xf721('0x4a')]));queues[_0x3df019[_0xf721('0x4b')]][_0xf721('0x10')]=_0x3df019[_0xf721('0x4a')];}}}}catch(_0x4d6e38){utils['error'](util[_0xf721('0x13')](_0xf721('0x48'),_0x3df019[_0xf721('0x49')]),_0x4d6e38);}};exports[_0xf721('0x5e')]=function(_0x3a36ee){try{if(!_[_0xf721('0x1b')](queues[_0x3a36ee[_0xf721('0x5')]])){utils[_0xf721('0x12')](util[_0xf721('0x13')](_0xf721('0x5f'),_0x3a36ee[_0xf721('0x5')]),_0x3a36ee);queues[_0x3a36ee[_0xf721('0x5')]][_0xf721('0x60')]=utils[_0xf721('0x18')]();utils[_0xf721('0x3')](util['format'](_0xf721('0x61'),_0x3a36ee['uniqueid'],queues[_0x3a36ee[_0xf721('0x5')]]['name'],queues[_0x3a36ee[_0xf721('0x5')]][_0xf721('0x60')]));}}catch(_0x55ec61){utils[_0xf721('0x19')](util[_0xf721('0x13')](_0xf721('0x5f'),_0x3a36ee[_0xf721('0x5')]),_0x55ec61);}};exports[_0xf721('0x62')]=function(_0x24fa31){try{if(!_['isNil'](queues[_0x24fa31['uniqueid']])){if(!_['isNil'](queues[_0x24fa31[_0xf721('0x5')]][_0xf721('0x60')])){utils[_0xf721('0x12')](util['format'](_0xf721('0x63'),_0x24fa31[_0xf721('0x5')]),_0x24fa31);queues[_0x24fa31[_0xf721('0x5')]]['mohtime']+=utils['diffTime'](utils['now'](),queues[_0x24fa31[_0xf721('0x5')]][_0xf721('0x60')]);utils[_0xf721('0x3')](util['format']('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x24fa31['uniqueid'],queues[_0x24fa31[_0xf721('0x5')]][_0xf721('0x24')],queues[_0x24fa31['uniqueid']][_0xf721('0x57')]));delete queues[_0x24fa31['uniqueid']][_0xf721('0x60')];}}}catch(_0x36f306){utils['error'](util[_0xf721('0x13')](_0xf721('0x63'),_0x24fa31[_0xf721('0x5')]),_0x36f306);}};
\ No newline at end of file
+var _0x10aa=['[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','error','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','varset','isNil','variable','value','CONTINUE','now','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandonAt','EXITWITHKEY','[%s][queues][varset]','[%s][queues][queuecallerabandon]','queuecallerexitAt','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','diffTime','position','count','agentconnect','destaccountcode','assigned','accountcode','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','membername','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','holdtime'];(function(_0x4828a8,_0x10ac36){var _0x21207c=function(_0x35d115){while(--_0x35d115){_0x4828a8['push'](_0x4828a8['shift']());}};_0x21207c(++_0x10ac36);}(_0x10aa,0x13e));var _0xa10a=function(_0x2cefd5,_0x4e2bdf){_0x2cefd5=_0x2cefd5-0x0;var _0x5dc052=_0x10aa[_0x2cefd5];return _0x5dc052;};'use strict';var _=require('lodash');var util=require(_0xa10a('0x0'));var utils=require(_0xa10a('0x1'));var queues={};function writeDB(_0x29016c){utils[_0xa10a('0x2')](util['format'](_0xa10a('0x3'),_0x29016c[_0xa10a('0x4')],_0x29016c[_0xa10a('0x5')],_0x29016c[_0xa10a('0x6')],_0x29016c[_0xa10a('0x7')],_0x29016c[_0xa10a('0x8')],_0x29016c['accountcode'],_0x29016c[_0xa10a('0x9')]));if(_0x29016c[_0xa10a('0x6')]){utils[_0xa10a('0xa')](_0x29016c[_0xa10a('0x6')])['then'](function(_0xdd113d){if(_0xdd113d){_0x29016c[_0xa10a('0xb')]=_0xdd113d['type'];}utils[_0xa10a('0xc')](_0xa10a('0xd'),_0x29016c);});}else{utils[_0xa10a('0xc')]('CreateVoiceQueueReport',_0x29016c);}if(_0x29016c[_0xa10a('0xe')]){delete queues[_0x29016c[_0xa10a('0xe')]];}else{delete queues[_0x29016c['uniqueid']];}}exports[_0xa10a('0xf')]=function(_0x2da8b4){try{utils[_0xa10a('0x10')](util['format'](_0xa10a('0x11'),_0x2da8b4[_0xa10a('0x4')]),_0x2da8b4);utils['info'](util[_0xa10a('0x12')](_0xa10a('0x13'),_0x2da8b4[_0xa10a('0x4')],_0x2da8b4[_0xa10a('0x6')],_0x2da8b4['position']));queues[_0x2da8b4['uniqueid']]=_[_0xa10a('0x14')](_0x2da8b4,{'originalposition':_0x2da8b4['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x3ba5c4){utils[_0xa10a('0x15')](util[_0xa10a('0x12')](_0xa10a('0x11'),_0x2da8b4[_0xa10a('0x4')]),_0x3ba5c4);}};exports['hangup']=function(_0x40f253){try{if(!_['isNil'](queues[_0x40f253[_0xa10a('0x4')]])){utils[_0xa10a('0x10')](util[_0xa10a('0x12')](_0xa10a('0x16'),_0x40f253[_0xa10a('0x4')]),_0x40f253);if(queues[_0x40f253[_0xa10a('0x4')]][_0xa10a('0x17')]){if(!queues[_0x40f253['uniqueid']][_0xa10a('0x18')]&&!queues[_0x40f253[_0xa10a('0x4')]][_0xa10a('0x19')]){queues[_0x40f253[_0xa10a('0x4')]][_0xa10a('0x1a')]=!![];queues[_0x40f253[_0xa10a('0x4')]][_0xa10a('0x1b')]=utils['now']();queues[_0x40f253[_0xa10a('0x4')]]['queuecallerexitreason']=_0xa10a('0x1c');}utils[_0xa10a('0x2')](util[_0xa10a('0x12')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x40f253[_0xa10a('0x4')],queues[_0x40f253[_0xa10a('0x4')]][_0xa10a('0x1d')],queues[_0x40f253[_0xa10a('0x4')]][_0xa10a('0x9')]));writeDB(queues[_0x40f253['uniqueid']]);}else if(queues[_0x40f253['uniqueid']][_0xa10a('0xe')]){utils[_0xa10a('0x2')](util[_0xa10a('0x12')](_0xa10a('0x1e'),_0x40f253[_0xa10a('0x4')],queues[_0x40f253['uniqueid']][_0xa10a('0x1d')],queues[_0x40f253[_0xa10a('0x4')]][_0xa10a('0xe')]));queues[queues[_0x40f253[_0xa10a('0x4')]]['transfereduniqueid']]=queues[_0x40f253['uniqueid']];queues[queues[_0x40f253['uniqueid']][_0xa10a('0xe')]]['queuecallerenterreason']=0x2;delete queues[_0x40f253[_0xa10a('0x4')]];}}}catch(_0x395fa9){utils[_0xa10a('0x15')](util[_0xa10a('0x12')]('[%s][queues][hangup]',_0x40f253['uniqueid']),_0x395fa9);}};exports[_0xa10a('0x1f')]=function(_0x450c91){try{utils[_0xa10a('0x10')](util['format']('[%s][queues][varset]',_0x450c91[_0xa10a('0x4')]),_0x450c91);if(!_[_0xa10a('0x20')](_0x450c91[_0xa10a('0x21')]['queuestatus'])&&_0x450c91[_0xa10a('0x22')]['toUpperCase']()!==_0xa10a('0x23')){if(!_[_0xa10a('0x20')](queues[_0x450c91[_0xa10a('0x4')]])){queues[_0x450c91[_0xa10a('0x4')]][_0xa10a('0x18')]=![];queues[_0x450c91[_0xa10a('0x4')]]['queuecallerabandonAt']=null;queues[_0x450c91[_0xa10a('0x4')]][_0xa10a('0x19')]=!![];queues[_0x450c91[_0xa10a('0x4')]]['queuecallerexitAt']=utils[_0xa10a('0x24')]();queues[_0x450c91[_0xa10a('0x4')]][_0xa10a('0x9')]=_0x450c91[_0xa10a('0x22')][_0xa10a('0x25')]();utils[_0xa10a('0x2')](util['format'](_0xa10a('0x26'),_0x450c91[_0xa10a('0x4')],queues[_0x450c91['uniqueid']][_0xa10a('0x1d')],_0x450c91[_0xa10a('0x22')],queues[_0x450c91[_0xa10a('0x4')]][_0xa10a('0x9')]));writeDB(queues[_0x450c91[_0xa10a('0x4')]]);}}else if(!_['isNil'](_0x450c91['variable']['queueposition'])){if(!_[_0xa10a('0x20')](queues[_0x450c91[_0xa10a('0x4')]])&&!queues[_0x450c91[_0xa10a('0x4')]][_0xa10a('0x18')]){queues[_0x450c91[_0xa10a('0x4')]][_0xa10a('0x18')]=![];queues[_0x450c91[_0xa10a('0x4')]][_0xa10a('0x27')]=null;queues[_0x450c91[_0xa10a('0x4')]][_0xa10a('0x19')]=!![];queues[_0x450c91[_0xa10a('0x4')]]['queuecallerexitAt']=utils[_0xa10a('0x24')]();queues[_0x450c91['uniqueid']][_0xa10a('0x9')]=_0xa10a('0x28');utils[_0xa10a('0x2')](util[_0xa10a('0x12')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x450c91[_0xa10a('0x4')],queues[_0x450c91['uniqueid']]['name'],_0x450c91[_0xa10a('0x22')],queues[_0x450c91['uniqueid']][_0xa10a('0x9')]));}}}catch(_0x269bf5){utils[_0xa10a('0x15')](util[_0xa10a('0x12')](_0xa10a('0x29'),_0x450c91[_0xa10a('0x4')]),_0x269bf5);}};exports[_0xa10a('0x18')]=function(_0x312223){try{if(!_['isNil'](queues[_0x312223['uniqueid']])){utils['debug'](util['format'](_0xa10a('0x2a'),_0x312223['uniqueid']),_0x312223);queues[_0x312223['uniqueid']][_0xa10a('0x19')]=![];queues[_0x312223['uniqueid']][_0xa10a('0x2b')]=null;queues[_0x312223[_0xa10a('0x4')]][_0xa10a('0x18')]=!![];queues[_0x312223[_0xa10a('0x4')]]['queuecallerabandonAt']=utils[_0xa10a('0x24')]();queues[_0x312223['uniqueid']][_0xa10a('0x9')]='ABANDONED';utils[_0xa10a('0x2')](util[_0xa10a('0x12')](_0xa10a('0x2c'),_0x312223['uniqueid'],queues[_0x312223[_0xa10a('0x4')]][_0xa10a('0x1d')],queues[_0x312223['uniqueid']][_0xa10a('0x9')]));}}catch(_0x48325f){utils[_0xa10a('0x15')](util[_0xa10a('0x12')](_0xa10a('0x2a'),_0x312223[_0xa10a('0x4')]),_0x48325f);}};exports[_0xa10a('0x2d')]=function(_0x121df9){try{if(!_[_0xa10a('0x20')](queues[_0x121df9['uniqueid']])){utils[_0xa10a('0x10')](util[_0xa10a('0x12')](_0xa10a('0x2e'),_0x121df9[_0xa10a('0x4')]),_0x121df9);utils[_0xa10a('0x2')](util[_0xa10a('0x12')](_0xa10a('0x2f'),_0x121df9[_0xa10a('0x4')],queues[_0x121df9[_0xa10a('0x4')]]['name'],_0x121df9[_0xa10a('0x30')],_0x121df9[_0xa10a('0x31')]));queues[_0x121df9[_0xa10a('0x4')]][_0xa10a('0x2d')]=!![];queues[_0x121df9[_0xa10a('0x4')]][_0xa10a('0x17')]=utils[_0xa10a('0x24')]();queues[_0x121df9[_0xa10a('0x4')]]['holdtime']=utils[_0xa10a('0x32')](queues[_0x121df9[_0xa10a('0x4')]]['queuecallerleaveAt'],queues[_0x121df9[_0xa10a('0x4')]]['queuecallerjoinAt']);queues[_0x121df9['uniqueid']][_0xa10a('0x33')]=_0x121df9['position'];queues[_0x121df9[_0xa10a('0x4')]][_0xa10a('0x34')]=_0x121df9[_0xa10a('0x34')];queues[_0x121df9[_0xa10a('0x4')]][_0xa10a('0x30')]=_0x121df9[_0xa10a('0x30')];queues[_0x121df9[_0xa10a('0x4')]]['connectedlinename']=_0x121df9[_0xa10a('0x31')];}}catch(_0x4fa700){utils['error'](util[_0xa10a('0x12')](_0xa10a('0x2e'),_0x121df9[_0xa10a('0x4')]),_0x4fa700);}};exports[_0xa10a('0x35')]=function(_0x5d8139){try{if(!_[_0xa10a('0x20')](queues[_0x5d8139[_0xa10a('0x4')]])){utils['debug'](util[_0xa10a('0x12')]('[%s][queues][agentconnect]',_0x5d8139['uniqueid']),_0x5d8139);utils[_0xa10a('0x2')](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x5d8139[_0xa10a('0x4')],queues[_0x5d8139[_0xa10a('0x4')]]['name'],_0x5d8139['membername'],_0x5d8139[_0xa10a('0x36')]));queues[_0x5d8139[_0xa10a('0x4')]][_0xa10a('0x18')]=![];queues[_0x5d8139['uniqueid']][_0xa10a('0x18')]=![];queues[_0x5d8139[_0xa10a('0x4')]]['queuecallerabandonAt']=null;queues[_0x5d8139[_0xa10a('0x4')]][_0xa10a('0x19')]=![];queues[_0x5d8139[_0xa10a('0x4')]][_0xa10a('0x9')]=null;queues[_0x5d8139[_0xa10a('0x4')]][_0xa10a('0x2b')]=null;queues[_0x5d8139['uniqueid']][_0xa10a('0x37')]=!![];queues[_0x5d8139[_0xa10a('0x4')]][_0xa10a('0x38')]=_0x5d8139[_0xa10a('0x36')];queues[_0x5d8139[_0xa10a('0x4')]]['lastAssignedTo']=_0x5d8139['membername'];}}catch(_0x2f42d7){utils[_0xa10a('0x15')](util[_0xa10a('0x12')](_0xa10a('0x39'),_0x5d8139[_0xa10a('0x4')]),_0x2f42d7);}};exports[_0xa10a('0x3a')]=function(_0x2acebc){try{if(!_[_0xa10a('0x20')](queues[_0x2acebc[_0xa10a('0x4')]])){if(queues[_0x2acebc[_0xa10a('0x4')]]['queuecallerleaveAt']){utils[_0xa10a('0x10')](util[_0xa10a('0x12')](_0xa10a('0x3b'),_0x2acebc[_0xa10a('0x4')]),_0x2acebc);queues[_0x2acebc[_0xa10a('0x4')]]['queuecallerabandon']=![];queues[_0x2acebc[_0xa10a('0x4')]][_0xa10a('0x18')]=![];queues[_0x2acebc[_0xa10a('0x4')]][_0xa10a('0x27')]=null;queues[_0x2acebc[_0xa10a('0x4')]][_0xa10a('0x19')]=![];queues[_0x2acebc['uniqueid']][_0xa10a('0x2b')]=null;queues[_0x2acebc[_0xa10a('0x4')]]['assigned']=!![];queues[_0x2acebc[_0xa10a('0x4')]][_0xa10a('0x7')]=_0x2acebc[_0xa10a('0x3c')];queues[_0x2acebc[_0xa10a('0x4')]][_0xa10a('0x1a')]=!![];queues[_0x2acebc[_0xa10a('0x4')]][_0xa10a('0x1b')]=utils[_0xa10a('0x24')]();if(_0x2acebc[_0xa10a('0x3d')]=='transfer'){if(!queues[_0x2acebc[_0xa10a('0x4')]][_0xa10a('0x3e')]){queues[_0x2acebc[_0xa10a('0x4')]][_0xa10a('0x9')]=_0xa10a('0x3f');}}else{queues[_0x2acebc[_0xa10a('0x4')]]['queuecallerexitreason']=_0xa10a('0x40')+_0x2acebc['reason']['toUpperCase']();}utils[_0xa10a('0x2')](util[_0xa10a('0x12')](_0xa10a('0x41'),_0x2acebc[_0xa10a('0x4')],queues[_0x2acebc['uniqueid']][_0xa10a('0x1d')],_0x2acebc['membername'],queues[_0x2acebc[_0xa10a('0x4')]][_0xa10a('0x9')]));writeDB(queues[_0x2acebc[_0xa10a('0x4')]]);}}}catch(_0x3960a7){utils[_0xa10a('0x15')](util[_0xa10a('0x12')](_0xa10a('0x3b'),_0x2acebc[_0xa10a('0x4')]),_0x3960a7);}};exports['blindtransfer']=function(_0x2937ce){try{if(!_['isNil'](queues[_0x2937ce['transfereeuniqueid']])){utils['debug'](util[_0xa10a('0x12')](_0xa10a('0x42'),_0x2937ce[_0xa10a('0x4')]),_0x2937ce);queues[_0x2937ce[_0xa10a('0x43')]]['transfer']=!![];queues[_0x2937ce['transfereeuniqueid']][_0xa10a('0x44')]='BLIND';queues[_0x2937ce[_0xa10a('0x43')]][_0xa10a('0x45')]=_0x2937ce[_0xa10a('0x46')];queues[_0x2937ce['transfereeuniqueid']][_0xa10a('0x47')]=_0x2937ce[_0xa10a('0x43')];queues[_0x2937ce['transfereeuniqueid']][_0xa10a('0x9')]=_0xa10a('0x48');utils[_0xa10a('0x2')](util[_0xa10a('0x12')](_0xa10a('0x49'),_0x2937ce[_0xa10a('0x4')],queues[_0x2937ce[_0xa10a('0x43')]][_0xa10a('0x1d')],_0x2937ce['transfereeuniqueid'],_0x2937ce[_0xa10a('0x46')]));}}catch(_0x5de479){utils[_0xa10a('0x15')](util[_0xa10a('0x12')](_0xa10a('0x42'),_0x2937ce['uniqueid']),_0x5de479);}};exports[_0xa10a('0x4a')]=function(_0x52b474){try{utils['debug'](util[_0xa10a('0x12')](_0xa10a('0x4b'),_0x52b474[_0xa10a('0x4c')]),_0x52b474);if(_0x52b474[_0xa10a('0x4c')]==_0x52b474[_0xa10a('0x4d')]){if(!_[_0xa10a('0x20')](queues[_0x52b474[_0xa10a('0x4e')]])){utils['info'](util['format'](_0xa10a('0x4f'),_0x52b474[_0xa10a('0x4c')],queues[_0x52b474[_0xa10a('0x4e')]][_0xa10a('0x1d')],_0x52b474[_0xa10a('0x50')]));queues[_0x52b474[_0xa10a('0x4e')]][_0xa10a('0x3e')]=!![];queues[_0x52b474[_0xa10a('0x4e')]][_0xa10a('0x44')]=_0xa10a('0x51');queues[_0x52b474[_0xa10a('0x4e')]][_0xa10a('0x45')]=_0x52b474[_0xa10a('0x50')];queues[_0x52b474[_0xa10a('0x4e')]][_0xa10a('0x47')]=_0x52b474[_0xa10a('0x4c')];queues[_0x52b474[_0xa10a('0x4e')]][_0xa10a('0x9')]=_0xa10a('0x52');}if(!_['isNil'](queues[_0x52b474[_0xa10a('0x4d')]])){if(_0x52b474[_0xa10a('0x53')]&&queues[_0x52b474[_0xa10a('0x53')]]){queues[_0x52b474['transfereelinkedid']][_0xa10a('0x54')]=0x1;queues[_0x52b474[_0xa10a('0x43')]]=_[_0xa10a('0x55')](queues[_0x52b474['transfereelinkedid']]);queues[_0x52b474[_0xa10a('0x43')]][_0xa10a('0xe')]=_0x52b474[_0xa10a('0x56')];queues[_0x52b474[_0xa10a('0x43')]]['queuecallerenterreason']=0x2;queues[_0x52b474[_0xa10a('0x43')]][_0xa10a('0x8')]=queues[_0x52b474[_0xa10a('0x4e')]]['calleridnum'];queues[_0x52b474['transfereeuniqueid']][_0xa10a('0x57')]=queues[_0x52b474[_0xa10a('0x4e')]][_0xa10a('0x57')];queues[_0x52b474['transfereeuniqueid']][_0xa10a('0x58')]=utils['now']();queues[_0x52b474[_0xa10a('0x43')]][_0xa10a('0x17')]=utils[_0xa10a('0x24')]();queues[_0x52b474[_0xa10a('0x43')]][_0xa10a('0x59')]=0x0;queues[_0x52b474['transfereeuniqueid']]['mohtime']=0x0;utils[_0xa10a('0x2')](util[_0xa10a('0x12')](_0xa10a('0x5a'),_0x52b474[_0xa10a('0x4c')],queues[_0x52b474['transfereeuniqueid']][_0xa10a('0x1d')],queues[_0x52b474['transfereeuniqueid']][_0xa10a('0x8')],queues[_0x52b474[_0xa10a('0x43')]][_0xa10a('0x57')]));}else{utils[_0xa10a('0x2')](util[_0xa10a('0x12')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x52b474[_0xa10a('0x4c')],queues[_0x52b474[_0xa10a('0x4d')]][_0xa10a('0x1d')],_0x52b474[_0xa10a('0x4e')]));queues[_0x52b474[_0xa10a('0x4d')]][_0xa10a('0xe')]=_0x52b474['secondtransfererlinkedid'];}}}else if(_0x52b474[_0xa10a('0x5b')]==_0x52b474['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x52b474[_0xa10a('0x4d')]])){utils[_0xa10a('0x2')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x52b474[_0xa10a('0x4c')],queues[_0x52b474[_0xa10a('0x4d')]][_0xa10a('0x1d')],_0x52b474['secondtransfereruniqueid'],_0x52b474['secondtransfererexten']));queues[_0x52b474[_0xa10a('0x4d')]][_0xa10a('0x3e')]=!![];queues[_0x52b474[_0xa10a('0x4d')]][_0xa10a('0x44')]='ATTENDED';queues[_0x52b474[_0xa10a('0x4d')]][_0xa10a('0x45')]=_0x52b474[_0xa10a('0x5c')];queues[_0x52b474[_0xa10a('0x4d')]][_0xa10a('0x47')]=_0x52b474[_0xa10a('0x5b')];queues[_0x52b474[_0xa10a('0x4d')]][_0xa10a('0x9')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x52b474[_0xa10a('0x4e')]])){if(_0x52b474[_0xa10a('0x5d')]&&queues[_0x52b474[_0xa10a('0x5d')]]){queues[_0x52b474[_0xa10a('0x5d')]][_0xa10a('0x54')]=0x1;queues[_0x52b474[_0xa10a('0x56')]]=_['clone'](queues[_0x52b474[_0xa10a('0x5d')]]);queues[_0x52b474['transfertargetuniqueid']][_0xa10a('0xe')]=_0x52b474[_0xa10a('0x56')];queues[_0x52b474[_0xa10a('0x56')]]['queuecallerenterreason']=0x2;queues[_0x52b474[_0xa10a('0x56')]][_0xa10a('0x8')]=queues[_0x52b474[_0xa10a('0x4d')]][_0xa10a('0x8')];queues[_0x52b474['transfertargetuniqueid']]['calleridname']=queues[_0x52b474[_0xa10a('0x4d')]]['calleridname'];queues[_0x52b474[_0xa10a('0x56')]][_0xa10a('0x58')]=utils[_0xa10a('0x24')]();queues[_0x52b474[_0xa10a('0x56')]][_0xa10a('0x17')]=utils[_0xa10a('0x24')]();queues[_0x52b474[_0xa10a('0x56')]][_0xa10a('0x59')]=0x0;queues[_0x52b474['transfertargetuniqueid']][_0xa10a('0x5e')]=0x0;utils[_0xa10a('0x2')](util[_0xa10a('0x12')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x52b474[_0xa10a('0x4c')],queues[_0x52b474[_0xa10a('0x56')]][_0xa10a('0x1d')],queues[_0x52b474[_0xa10a('0x56')]][_0xa10a('0xe')],queues[_0x52b474[_0xa10a('0x56')]]['calleridnum'],queues[_0x52b474[_0xa10a('0x56')]][_0xa10a('0x57')]));}else{utils[_0xa10a('0x2')](util['format'](_0xa10a('0x5f'),_0x52b474[_0xa10a('0x4c')],queues[_0x52b474['secondtransfererlinkedid']][_0xa10a('0x1d')],_0x52b474[_0xa10a('0x4d')]));queues[_0x52b474[_0xa10a('0x4e')]][_0xa10a('0xe')]=_0x52b474[_0xa10a('0x4d')];}}}}catch(_0x5df8d7){utils[_0xa10a('0x15')](util[_0xa10a('0x12')](_0xa10a('0x4b'),_0x52b474[_0xa10a('0x4c')]),_0x5df8d7);}};exports[_0xa10a('0x60')]=function(_0x42d451){try{if(!_[_0xa10a('0x20')](queues[_0x42d451[_0xa10a('0x4')]])){utils[_0xa10a('0x10')](util[_0xa10a('0x12')]('[%s][queues][musiconholdstart]',_0x42d451['uniqueid']),_0x42d451);queues[_0x42d451[_0xa10a('0x4')]][_0xa10a('0x61')]=utils[_0xa10a('0x24')]();utils[_0xa10a('0x2')](util[_0xa10a('0x12')](_0xa10a('0x62'),_0x42d451[_0xa10a('0x4')],queues[_0x42d451[_0xa10a('0x4')]][_0xa10a('0x1d')],queues[_0x42d451[_0xa10a('0x4')]][_0xa10a('0x61')]));}}catch(_0x3489f8){utils[_0xa10a('0x15')](util[_0xa10a('0x12')]('[%s][queues][musiconholdstart]',_0x42d451[_0xa10a('0x4')]),_0x3489f8);}};exports[_0xa10a('0x63')]=function(_0x1356e0){try{if(!_[_0xa10a('0x20')](queues[_0x1356e0[_0xa10a('0x4')]])){if(!_['isNil'](queues[_0x1356e0['uniqueid']][_0xa10a('0x61')])){utils['debug'](util['format'](_0xa10a('0x64'),_0x1356e0['uniqueid']),_0x1356e0);queues[_0x1356e0[_0xa10a('0x4')]][_0xa10a('0x5e')]+=utils[_0xa10a('0x32')](utils[_0xa10a('0x24')](),queues[_0x1356e0[_0xa10a('0x4')]][_0xa10a('0x61')]);utils[_0xa10a('0x2')](util[_0xa10a('0x12')](_0xa10a('0x65'),_0x1356e0[_0xa10a('0x4')],queues[_0x1356e0['uniqueid']][_0xa10a('0x1d')],queues[_0x1356e0[_0xa10a('0x4')]]['mohtime']));delete queues[_0x1356e0[_0xa10a('0x4')]][_0xa10a('0x61')];}}}catch(_0x8e06c0){utils[_0xa10a('0x15')](util[_0xa10a('0x12')](_0xa10a('0x64'),_0x1356e0[_0xa10a('0x4')]),_0x8e06c0);}};
\ No newline at end of file
index 1ad1090..44c554b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb87=['accountcode','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','info','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newstate]','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','type','outbound','connectedlinename','forEach','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereruniqueid','recording','[%s][recordings][blindtransfer]','lodash','util','./transfers.controller','format','[%s][recordings][writeDB]','uniqueid','blinds'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xdb87,0x119));var _0x7db8=function(_0x3ccc31,_0x489111){_0x3ccc31=_0x3ccc31-0x0;var _0x5f1618=_0xdb87[_0x3ccc31];return _0x5f1618;};'use strict';var _=require(_0x7db8('0x0'));var util=require(_0x7db8('0x1'));var utils=require('./utils');var transfers=require(_0x7db8('0x2'));var recordings={};function writeDB(_0x48282b){var _0x145681;utils['info'](util[_0x7db8('0x3')](_0x7db8('0x4'),_0x48282b[_0x7db8('0x5')]));if(transfers[_0x7db8('0x6')][_0x48282b[_0x7db8('0x5')]]){_0x145681=_0x48282b['uniqueid'];_0x48282b[_0x7db8('0x5')]=transfers[_0x7db8('0x6')][_0x48282b['uniqueid']]['transfereeuniqueid'];}if(_0x48282b[_0x7db8('0x7')]){utils[_0x7db8('0x8')](_0x48282b[_0x7db8('0x7')])[_0x7db8('0x9')](function(_0x19f026){if(_0x19f026){_0x48282b[_0x7db8('0xa')]=_0x19f026[_0x7db8('0xb')];_0x48282b[_0x7db8('0xc')]=_0x19f026['id'];}utils['request'](_0x7db8('0xd'),_0x48282b);});}else{utils[_0x7db8('0xe')]('CreateVoiceRecording',_0x48282b);}if(_0x145681)delete transfers[_0x7db8('0x6')][_0x145681];}exports[_0x7db8('0xf')]=function(_0x12cf34){try{utils[_0x7db8('0x10')](util[_0x7db8('0x3')](_0x7db8('0x11'),_0x12cf34[_0x7db8('0x5')]),_0x12cf34);if(_0x12cf34[_0x7db8('0x5')]==_0x12cf34[_0x7db8('0x12')]){utils[_0x7db8('0x13')](util[_0x7db8('0x3')](_0x7db8('0x14'),_0x12cf34[_0x7db8('0x5')],_0x12cf34[_0x7db8('0x15')],_0x12cf34[_0x7db8('0x16')]));recordings[_0x12cf34[_0x7db8('0x5')]]={'uniqueid':_0x12cf34[_0x7db8('0x5')],'accountcode':_0x12cf34[_0x7db8('0x7')],'exten':_0x12cf34['exten'],'context':_0x12cf34['context'],'channel':_0x12cf34[_0x7db8('0x17')],'monitors':[]};}}catch(_0x1dc860){utils[_0x7db8('0x18')](util[_0x7db8('0x3')]('[%s][recordings][newchannel]',_0x12cf34[_0x7db8('0x5')]),_0x1dc860);}};exports['newstate']=function(_0xa7775b){try{utils[_0x7db8('0x10')](util['format'](_0x7db8('0x19'),_0xa7775b[_0x7db8('0x5')]),_0xa7775b);if(!_[_0x7db8('0x1a')](recordings[_0xa7775b['uniqueid']])&&_0xa7775b[_0x7db8('0x1b')]==0x6){utils['info'](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0xa7775b[_0x7db8('0x5')],_0xa7775b[_0x7db8('0x15')],_0xa7775b['channel']));}else if(!_[_0x7db8('0x1a')](recordings[_0xa7775b[_0x7db8('0x12')]])&&_0xa7775b[_0x7db8('0x1b')]==0x6&&_0xa7775b[_0x7db8('0x15')]!=_0x7db8('0x1c')){utils[_0x7db8('0x13')](util[_0x7db8('0x3')](_0x7db8('0x1d'),_0xa7775b[_0x7db8('0x5')],_0xa7775b[_0x7db8('0x12')],_0xa7775b[_0x7db8('0x15')],_0xa7775b[_0x7db8('0x17')]));recordings[_0xa7775b[_0x7db8('0x12')]]['accountcode']=_0xa7775b[_0x7db8('0x7')];}}catch(_0x40bf8c){utils[_0x7db8('0x18')](util[_0x7db8('0x3')](_0x7db8('0x19'),_0xa7775b[_0x7db8('0x5')]),_0x40bf8c);}};exports[_0x7db8('0x1e')]=function(_0x87d31c){try{if(!_[_0x7db8('0x1a')](_0x87d31c[_0x7db8('0x1f')])&&!_[_0x7db8('0x1a')](_0x87d31c[_0x7db8('0x1f')][_0x7db8('0x20')])){utils[_0x7db8('0x10')](util['format'](_0x7db8('0x21'),_0x87d31c[_0x7db8('0x5')]),_0x87d31c);utils[_0x7db8('0x13')](util[_0x7db8('0x3')](_0x7db8('0x22'),_0x87d31c[_0x7db8('0x5')],_0x87d31c[_0x7db8('0x1f')],_0x87d31c[_0x7db8('0x23')]));if(_[_0x7db8('0x24')](_0x87d31c[_0x7db8('0x23')],'.wav49')){_0x87d31c[_0x7db8('0x23')]=_0x87d31c[_0x7db8('0x23')][_0x7db8('0x25')](_0x7db8('0x26'),'.WAV');}if(recordings[_0x87d31c['linkedid']]){var _0x1151db=_['find'](recordings[_0x87d31c[_0x7db8('0x12')]][_0x7db8('0x27')],{'value':_0x87d31c[_0x7db8('0x23')]});if(_['isNil'](_0x1151db)){recordings[_0x87d31c[_0x7db8('0x12')]]['monitors'][_0x7db8('0x28')]({'value':_0x87d31c[_0x7db8('0x23')]});}}}}catch(_0x1917e1){utils['error'](util['format'](_0x7db8('0x21'),_0x87d31c['uniqueid']),_0x1917e1);}};exports[_0x7db8('0x29')]=function(_0xca37ad){try{if(!_[_0x7db8('0x1a')](recordings[_0xca37ad[_0x7db8('0x5')]])){utils['debug'](util[_0x7db8('0x3')](_0x7db8('0x2a'),_0xca37ad[_0x7db8('0x5')]),_0xca37ad);utils[_0x7db8('0x13')](util['format'](_0x7db8('0x2b'),_0xca37ad[_0x7db8('0x5')],_0xca37ad[_0x7db8('0x2c')],_0xca37ad['calleridname'],_0xca37ad[_0x7db8('0x2d')]));recordings[_0xca37ad[_0x7db8('0x5')]][_0x7db8('0x2c')]=_0xca37ad[_0x7db8('0x2c')];recordings[_0xca37ad[_0x7db8('0x5')]][_0x7db8('0x2e')]=_0xca37ad['calleridname'];recordings[_0xca37ad[_0x7db8('0x5')]]['connectedlinenum']=_0xca37ad[_0x7db8('0x2f')];recordings[_0xca37ad[_0x7db8('0x5')]]['connectedlinename']=_0xca37ad['connectedlinename'];if(recordings[_0xca37ad[_0x7db8('0x5')]][_0x7db8('0x30')]==_0x7db8('0x31')&&recordings[_0xca37ad[_0x7db8('0x5')]][_0x7db8('0x7')]){recordings[_0xca37ad[_0x7db8('0x5')]][_0x7db8('0x2f')]=recordings[_0xca37ad[_0x7db8('0x5')]]['accountcode'];recordings[_0xca37ad[_0x7db8('0x5')]][_0x7db8('0x32')]='';}recordings[_0xca37ad[_0x7db8('0x5')]][_0x7db8('0x27')][_0x7db8('0x33')](function(_0x27feb5){var _0x1bb49c=_[_0x7db8('0x34')](recordings[_0xca37ad[_0x7db8('0x5')]]);_0x1bb49c[_0x7db8('0x23')]=_0x27feb5['value'];writeDB(_0x1bb49c);});delete recordings[_0xca37ad[_0x7db8('0x5')]];}}catch(_0x3b9f41){utils[_0x7db8('0x18')](util[_0x7db8('0x3')]('[%s][recordings][hangup]',_0xca37ad[_0x7db8('0x5')]),_0x3b9f41);}};exports[_0x7db8('0x35')]=function(_0x2bf7c4){try{if(!_[_0x7db8('0x1a')](recordings[_0x2bf7c4[_0x7db8('0x5')]])){utils[_0x7db8('0x10')](util[_0x7db8('0x3')]('[%s][recordings][newexten]',_0x2bf7c4[_0x7db8('0x5')]),_0x2bf7c4);utils[_0x7db8('0x13')](util[_0x7db8('0x3')](_0x7db8('0x36'),_0x2bf7c4[_0x7db8('0x5')],_0x2bf7c4[_0x7db8('0x37')],_0x2bf7c4[_0x7db8('0x38')]));if(_0x2bf7c4['application']['toLowerCase']()==_0x7db8('0x39')&&_['startsWith'](_0x2bf7c4[_0x7db8('0x38')]['toLowerCase'](),'cdr')){var _0x1759c2=_0x2bf7c4[_0x7db8('0x38')][_0x7db8('0x3a')]('=');var _0x5de8a9=_0x1759c2[0x0][_0x7db8('0x3b')](_0x1759c2[0x0][_0x7db8('0x3c')]('(')+0x1,_0x1759c2[0x0][_0x7db8('0x3c')](')'));var _0x5c4949=_0x1759c2[0x1];recordings[_0x2bf7c4[_0x7db8('0x5')]][_0x5de8a9]=_0x5c4949;}}}catch(_0x152256){utils['error'](util['format'](_0x7db8('0x3d'),_0x2bf7c4['uniqueid']),_0x152256);}};exports[_0x7db8('0x3e')]=function(_0x1491ba){try{if(!_[_0x7db8('0x1a')](recordings[_0x1491ba[_0x7db8('0x5')]])){utils[_0x7db8('0x10')](util[_0x7db8('0x3')](_0x7db8('0x3f'),_0x1491ba[_0x7db8('0x5')]),_0x1491ba);utils[_0x7db8('0x13')](util['format'](_0x7db8('0x40'),_0x1491ba[_0x7db8('0x5')],_0x1491ba[_0x7db8('0x41')]));recordings[_0x1491ba[_0x7db8('0x5')]]['queue']=_0x1491ba[_0x7db8('0x41')];}}catch(_0x1da257){utils[_0x7db8('0x18')](util[_0x7db8('0x3')]('[%s][recordings][queuecallerjoin]',_0x1491ba[_0x7db8('0x5')]),_0x1da257);}};exports['blindtransfer']=function(_0x253747){try{utils[_0x7db8('0x10')](util[_0x7db8('0x3')]('[%s][recordings][blindtransfer]',_0x253747[_0x7db8('0x5')]),_0x253747);utils['info'](util[_0x7db8('0x3')](_0x7db8('0x42'),_0x253747['uniqueid'],_0x253747[_0x7db8('0x43')],_0x253747[_0x7db8('0x44')],_0x253747['transfereecalleridnum'],_0x253747['transfereecalleridname']));if(recordings[_0x253747[_0x7db8('0x45')]]&&transfers[_0x7db8('0x6')][_0x253747['transfereruniqueid']]){transfers[_0x7db8('0x6')][_0x253747['transfereruniqueid']][_0x7db8('0x46')]=!![];}}catch(_0x24fb03){utils[_0x7db8('0x18')](util[_0x7db8('0x3')](_0x7db8('0x47'),_0x253747[_0x7db8('0x5')]),_0x24fb03);}};
\ No newline at end of file
+var _0x2051=['[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','forEach','clone','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','linkedid','context','exten','channel','error','[%s][recordings][newchannel]','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]'];(function(_0x2408bf,_0x4a19b8){var _0x5a5921=function(_0x31acc7){while(--_0x31acc7){_0x2408bf['push'](_0x2408bf['shift']());}};_0x5a5921(++_0x4a19b8);}(_0x2051,0x161));var _0x1205=function(_0xd91541,_0x3a43e2){_0xd91541=_0xd91541-0x0;var _0x167b84=_0x2051[_0xd91541];return _0x167b84;};'use strict';var _=require(_0x1205('0x0'));var util=require(_0x1205('0x1'));var utils=require(_0x1205('0x2'));var transfers=require(_0x1205('0x3'));var recordings={};function writeDB(_0x40d3e5){var _0x85dd50;utils[_0x1205('0x4')](util[_0x1205('0x5')](_0x1205('0x6'),_0x40d3e5[_0x1205('0x7')]));if(transfers[_0x1205('0x8')][_0x40d3e5['uniqueid']]){_0x85dd50=_0x40d3e5[_0x1205('0x7')];_0x40d3e5['uniqueid']=transfers['blinds'][_0x40d3e5[_0x1205('0x7')]][_0x1205('0x9')];}if(_0x40d3e5[_0x1205('0xa')]){utils[_0x1205('0xb')](_0x40d3e5['accountcode'])[_0x1205('0xc')](function(_0x15dc51){if(_0x15dc51){_0x40d3e5[_0x1205('0xd')]=_0x15dc51[_0x1205('0xe')];_0x40d3e5[_0x1205('0xf')]=_0x15dc51['id'];}utils[_0x1205('0x10')](_0x1205('0x11'),_0x40d3e5);});}else{utils[_0x1205('0x10')]('CreateVoiceRecording',_0x40d3e5);}if(_0x85dd50)delete transfers['blinds'][_0x85dd50];}exports[_0x1205('0x12')]=function(_0x39325e){try{utils[_0x1205('0x13')](util['format']('[%s][recordings][newchannel]',_0x39325e['uniqueid']),_0x39325e);if(_0x39325e['uniqueid']==_0x39325e[_0x1205('0x14')]){utils[_0x1205('0x4')](util[_0x1205('0x5')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x39325e[_0x1205('0x7')],_0x39325e[_0x1205('0x15')],_0x39325e[_0x1205('0x16')]));recordings[_0x39325e['uniqueid']]={'uniqueid':_0x39325e[_0x1205('0x7')],'accountcode':_0x39325e['accountcode'],'exten':_0x39325e['exten'],'context':_0x39325e[_0x1205('0x15')],'channel':_0x39325e[_0x1205('0x17')],'monitors':[]};}}catch(_0x2c4d6){utils[_0x1205('0x18')](util[_0x1205('0x5')](_0x1205('0x19'),_0x39325e[_0x1205('0x7')]),_0x2c4d6);}};exports[_0x1205('0x1a')]=function(_0x526d1f){try{utils[_0x1205('0x13')](util[_0x1205('0x5')](_0x1205('0x1b'),_0x526d1f[_0x1205('0x7')]),_0x526d1f);if(!_[_0x1205('0x1c')](recordings[_0x526d1f['uniqueid']])&&_0x526d1f[_0x1205('0x1d')]==0x6){utils[_0x1205('0x4')](util[_0x1205('0x5')](_0x1205('0x1e'),_0x526d1f['uniqueid'],_0x526d1f[_0x1205('0x15')],_0x526d1f['channel']));}else if(!_[_0x1205('0x1c')](recordings[_0x526d1f[_0x1205('0x14')]])&&_0x526d1f[_0x1205('0x1d')]==0x6&&_0x526d1f[_0x1205('0x15')]!=_0x1205('0x1f')){utils[_0x1205('0x4')](util[_0x1205('0x5')](_0x1205('0x20'),_0x526d1f[_0x1205('0x7')],_0x526d1f[_0x1205('0x14')],_0x526d1f[_0x1205('0x15')],_0x526d1f[_0x1205('0x17')]));recordings[_0x526d1f[_0x1205('0x14')]][_0x1205('0xa')]=_0x526d1f[_0x1205('0xa')];}}catch(_0x3dd7da){utils[_0x1205('0x18')](util[_0x1205('0x5')](_0x1205('0x1b'),_0x526d1f[_0x1205('0x7')]),_0x3dd7da);}};exports[_0x1205('0x21')]=function(_0x512352){try{if(!_[_0x1205('0x1c')](_0x512352[_0x1205('0x22')])&&!_[_0x1205('0x1c')](_0x512352[_0x1205('0x22')][_0x1205('0x23')])){utils[_0x1205('0x13')](util[_0x1205('0x5')](_0x1205('0x24'),_0x512352[_0x1205('0x7')]),_0x512352);utils['info'](util['format'](_0x1205('0x25'),_0x512352[_0x1205('0x7')],_0x512352[_0x1205('0x22')],_0x512352[_0x1205('0x26')]));if(_[_0x1205('0x27')](_0x512352[_0x1205('0x26')],_0x1205('0x28'))){_0x512352[_0x1205('0x26')]=_0x512352[_0x1205('0x26')][_0x1205('0x29')](_0x1205('0x28'),_0x1205('0x2a'));}if(recordings[_0x512352[_0x1205('0x14')]]){var _0xbdcd9d=_[_0x1205('0x2b')](recordings[_0x512352[_0x1205('0x14')]]['monitors'],{'value':_0x512352[_0x1205('0x26')]});if(_[_0x1205('0x1c')](_0xbdcd9d)){recordings[_0x512352[_0x1205('0x14')]][_0x1205('0x2c')][_0x1205('0x2d')]({'value':_0x512352[_0x1205('0x26')]});}}}}catch(_0x3753a0){utils[_0x1205('0x18')](util[_0x1205('0x5')](_0x1205('0x24'),_0x512352[_0x1205('0x7')]),_0x3753a0);}};exports[_0x1205('0x2e')]=function(_0x1293f7){try{if(!_[_0x1205('0x1c')](recordings[_0x1293f7[_0x1205('0x7')]])){utils[_0x1205('0x13')](util[_0x1205('0x5')](_0x1205('0x2f'),_0x1293f7[_0x1205('0x7')]),_0x1293f7);utils[_0x1205('0x4')](util['format'](_0x1205('0x30'),_0x1293f7['uniqueid'],_0x1293f7[_0x1205('0x31')],_0x1293f7[_0x1205('0x32')],_0x1293f7[_0x1205('0x33')]));recordings[_0x1293f7[_0x1205('0x7')]]['calleridnum']=_0x1293f7[_0x1205('0x31')];recordings[_0x1293f7[_0x1205('0x7')]]['calleridname']=_0x1293f7[_0x1205('0x32')];recordings[_0x1293f7[_0x1205('0x7')]][_0x1205('0x34')]=_0x1293f7['connectedlinenum'];recordings[_0x1293f7[_0x1205('0x7')]][_0x1205('0x35')]=_0x1293f7['connectedlinename'];if(recordings[_0x1293f7[_0x1205('0x7')]][_0x1205('0x36')]=='outbound'&&recordings[_0x1293f7['uniqueid']]['accountcode']){recordings[_0x1293f7[_0x1205('0x7')]][_0x1205('0x34')]=recordings[_0x1293f7[_0x1205('0x7')]][_0x1205('0xa')];recordings[_0x1293f7['uniqueid']][_0x1205('0x35')]='';}recordings[_0x1293f7[_0x1205('0x7')]]['monitors'][_0x1205('0x37')](function(_0x3245df){var _0x47a840=_[_0x1205('0x38')](recordings[_0x1293f7[_0x1205('0x7')]]);_0x47a840['value']=_0x3245df[_0x1205('0x26')];writeDB(_0x47a840);});delete recordings[_0x1293f7[_0x1205('0x7')]];}}catch(_0x385340){utils[_0x1205('0x18')](util[_0x1205('0x5')](_0x1205('0x2f'),_0x1293f7[_0x1205('0x7')]),_0x385340);}};exports['newexten']=function(_0x4f8e55){try{if(!_[_0x1205('0x1c')](recordings[_0x4f8e55[_0x1205('0x7')]])){utils[_0x1205('0x13')](util[_0x1205('0x5')](_0x1205('0x39'),_0x4f8e55['uniqueid']),_0x4f8e55);utils[_0x1205('0x4')](util[_0x1205('0x5')](_0x1205('0x3a'),_0x4f8e55[_0x1205('0x7')],_0x4f8e55[_0x1205('0x3b')],_0x4f8e55[_0x1205('0x3c')]));if(_0x4f8e55[_0x1205('0x3b')][_0x1205('0x3d')]()==_0x1205('0x3e')&&_['startsWith'](_0x4f8e55['appdata'][_0x1205('0x3d')](),_0x1205('0x3f'))){var _0x5c542b=_0x4f8e55['appdata'][_0x1205('0x40')]('=');var _0x48b3c0=_0x5c542b[0x0][_0x1205('0x41')](_0x5c542b[0x0]['lastIndexOf']('(')+0x1,_0x5c542b[0x0][_0x1205('0x42')](')'));var _0x571a95=_0x5c542b[0x1];recordings[_0x4f8e55[_0x1205('0x7')]][_0x48b3c0]=_0x571a95;}}}catch(_0x50ba3d){utils[_0x1205('0x18')](util[_0x1205('0x5')](_0x1205('0x39'),_0x4f8e55[_0x1205('0x7')]),_0x50ba3d);}};exports[_0x1205('0x43')]=function(_0x698461){try{if(!_['isNil'](recordings[_0x698461[_0x1205('0x7')]])){utils[_0x1205('0x13')](util[_0x1205('0x5')](_0x1205('0x44'),_0x698461[_0x1205('0x7')]),_0x698461);utils['info'](util['format'](_0x1205('0x45'),_0x698461[_0x1205('0x7')],_0x698461[_0x1205('0x46')]));recordings[_0x698461[_0x1205('0x7')]]['queue']=_0x698461[_0x1205('0x46')];}}catch(_0x55c3af){utils[_0x1205('0x18')](util['format'](_0x1205('0x44'),_0x698461['uniqueid']),_0x55c3af);}};exports['blindtransfer']=function(_0x23de9c){try{utils[_0x1205('0x13')](util['format'](_0x1205('0x47'),_0x23de9c[_0x1205('0x7')]),_0x23de9c);utils[_0x1205('0x4')](util[_0x1205('0x5')](_0x1205('0x48'),_0x23de9c[_0x1205('0x7')],_0x23de9c['transferercalleridnum'],_0x23de9c[_0x1205('0x49')],_0x23de9c[_0x1205('0x4a')],_0x23de9c[_0x1205('0x4b')]));if(recordings[_0x23de9c[_0x1205('0x4c')]]&&transfers[_0x1205('0x8')][_0x23de9c[_0x1205('0x4c')]]){transfers[_0x1205('0x8')][_0x23de9c[_0x1205('0x4c')]][_0x1205('0x4d')]=!![];}}catch(_0x27f8f0){utils[_0x1205('0x18')](util['format'](_0x1205('0x47'),_0x23de9c[_0x1205('0x7')]),_0x27f8f0);}};
\ No newline at end of file
index 5829f95..d7c1277 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd29a=['CreateVoiceTransferReport','blinds','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended','uniqueid','type'];(function(_0x27b089,_0x411b35){var _0x204dea=function(_0x246eff){while(--_0x246eff){_0x27b089['push'](_0x27b089['shift']());}};_0x204dea(++_0x411b35);}(_0xd29a,0x1bf));var _0xad29=function(_0x5dede7,_0x50d5fc){_0x5dede7=_0x5dede7-0x0;var _0x228557=_0xd29a[_0x5dede7];return _0x228557;};'use strict';var _=require(_0xad29('0x0'));var util=require(_0xad29('0x1'));var utils=require(_0xad29('0x2'));function writeDB(_0x138691){utils[_0xad29('0x3')](util[_0xad29('0x4')](_0xad29('0x5'),_0x138691['type']===_0xad29('0x6')?_0x138691['origtransfereruniqueid']:_0x138691[_0xad29('0x7')],_0x138691[_0xad29('0x8')]));utils['request'](_0xad29('0x9'),_0x138691);}exports[_0xad29('0xa')]={};exports['blindtransfer']=function(_0x211f0c){try{utils[_0xad29('0xb')](util[_0xad29('0x4')](_0xad29('0xc'),_0x211f0c[_0xad29('0x7')]),_0x211f0c);utils[_0xad29('0x3')](util[_0xad29('0x4')](_0xad29('0xd'),_0x211f0c['uniqueid'],_0x211f0c['transferercalleridnum'],_0x211f0c['transferercalleridname'],_0x211f0c['transfereecalleridnum'],_0x211f0c[_0xad29('0xe')]));_0x211f0c[_0xad29('0x8')]=_0xad29('0xf');exports[_0xad29('0xa')][_0x211f0c[_0xad29('0x10')]]=_0x211f0c;writeDB(_0x211f0c);}catch(_0x3f9b85){utils[_0xad29('0x11')](util[_0xad29('0x4')](_0xad29('0xc'),_0x211f0c[_0xad29('0x7')]),_0x3f9b85);}};exports[_0xad29('0x12')]=function(_0x1b6726){try{utils[_0xad29('0xb')](util[_0xad29('0x4')](_0xad29('0x13'),_0x1b6726[_0xad29('0x14')]),_0x1b6726);utils[_0xad29('0x3')](util[_0xad29('0x4')](_0xad29('0x15'),_0x1b6726[_0xad29('0x14')],_0x1b6726['origtransferercalleridnum'],_0x1b6726['origtransferercalleridname'],_0x1b6726[_0xad29('0x16')],_0x1b6726[_0xad29('0x17')]));_0x1b6726=_['assign'](_0x1b6726,{'transfererchannel':_0x1b6726[_0xad29('0x18')],'transferercalleridnum':_0x1b6726[_0xad29('0x19')],'transferercalleridname':_0x1b6726[_0xad29('0x1a')],'transfererconnectedlinenum':_0x1b6726[_0xad29('0x1b')],'transfererconnectedlinename':_0x1b6726[_0xad29('0x1c')],'transfereraccountcode':_0x1b6726[_0xad29('0x1d')],'transferercontext':_0x1b6726[_0xad29('0x1e')],'transfererexten':_0x1b6726['secondtransfererexten'],'transfererlinkedid':_0x1b6726[_0xad29('0x1f')],'context':_0x1b6726['origtransferercontext'],'extension':_0x1b6726['origtransfererexten'],'type':'attended'});if(_[_0xad29('0x20')](_0x1b6726[_0xad29('0x21')])){_0x1b6726=_['assign'](_0x1b6726,{'transfereechannel':_0x1b6726[_0xad29('0x22')],'transfereecalleridnum':_0x1b6726[_0xad29('0x16')],'transfereecalleridname':_0x1b6726[_0xad29('0x17')],'transfereeconnectedlinenum':_0x1b6726[_0xad29('0x23')],'transfereeconnectedlinename':_0x1b6726[_0xad29('0x24')],'transfereeaccountcode':_0x1b6726['transfertargetaccountcode'],'transfereecontext':_0x1b6726['transfertargetcontext'],'transfereeexten':_0x1b6726['transfertargetexten'],'transfereelinkedid':_0x1b6726[_0xad29('0x25')]});}writeDB(_0x1b6726);}catch(_0x23761f){utils['error'](util[_0xad29('0x4')](_0xad29('0x13'),_0x1b6726[_0xad29('0x14')]),_0x23761f);}};
\ No newline at end of file
+var _0xab1c=['transfereecalleridnum','transfereecalleridname','blind','blinds','error','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','assign','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid','type','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xab1c,0xf1));var _0xcab1=function(_0x59ad0c,_0x461a19){_0x59ad0c=_0x59ad0c-0x0;var _0x478043=_0xab1c[_0x59ad0c];return _0x478043;};'use strict';var _=require(_0xcab1('0x0'));var util=require(_0xcab1('0x1'));var utils=require(_0xcab1('0x2'));function writeDB(_0x4e60fb){utils[_0xcab1('0x3')](util[_0xcab1('0x4')](_0xcab1('0x5'),_0x4e60fb['type']===_0xcab1('0x6')?_0x4e60fb[_0xcab1('0x7')]:_0x4e60fb[_0xcab1('0x8')],_0x4e60fb[_0xcab1('0x9')]));utils['request'](_0xcab1('0xa'),_0x4e60fb);}exports['blinds']={};exports[_0xcab1('0xb')]=function(_0x14548c){try{utils[_0xcab1('0xc')](util[_0xcab1('0x4')](_0xcab1('0xd'),_0x14548c['uniqueid']),_0x14548c);utils[_0xcab1('0x3')](util[_0xcab1('0x4')](_0xcab1('0xe'),_0x14548c[_0xcab1('0x8')],_0x14548c[_0xcab1('0xf')],_0x14548c[_0xcab1('0x10')],_0x14548c[_0xcab1('0x11')],_0x14548c[_0xcab1('0x12')]));_0x14548c[_0xcab1('0x9')]=_0xcab1('0x13');exports[_0xcab1('0x14')][_0x14548c['transfereruniqueid']]=_0x14548c;writeDB(_0x14548c);}catch(_0x144535){utils[_0xcab1('0x15')](util[_0xcab1('0x4')](_0xcab1('0xd'),_0x14548c[_0xcab1('0x8')]),_0x144535);}};exports['attendedtransfer']=function(_0x24609a){try{utils['debug'](util[_0xcab1('0x4')](_0xcab1('0x16'),_0x24609a[_0xcab1('0x7')]),_0x24609a);utils['info'](util['format'](_0xcab1('0x17'),_0x24609a['origtransfereruniqueid'],_0x24609a[_0xcab1('0x18')],_0x24609a[_0xcab1('0x19')],_0x24609a[_0xcab1('0x1a')],_0x24609a[_0xcab1('0x1b')]));_0x24609a=_['assign'](_0x24609a,{'transfererchannel':_0x24609a[_0xcab1('0x1c')],'transferercalleridnum':_0x24609a['origtransferercalleridnum'],'transferercalleridname':_0x24609a['origtransferercalleridname'],'transfererconnectedlinenum':_0x24609a[_0xcab1('0x1d')],'transfererconnectedlinename':_0x24609a[_0xcab1('0x1e')],'transfereraccountcode':_0x24609a[_0xcab1('0x1f')],'transferercontext':_0x24609a[_0xcab1('0x20')],'transfererexten':_0x24609a[_0xcab1('0x21')],'transfererlinkedid':_0x24609a[_0xcab1('0x22')],'context':_0x24609a[_0xcab1('0x23')],'extension':_0x24609a[_0xcab1('0x24')],'type':'attended'});if(_[_0xcab1('0x25')](_0x24609a[_0xcab1('0x26')])){_0x24609a=_[_0xcab1('0x27')](_0x24609a,{'transfereechannel':_0x24609a['transfertargetchannel'],'transfereecalleridnum':_0x24609a['transfertargetcalleridnum'],'transfereecalleridname':_0x24609a[_0xcab1('0x1b')],'transfereeconnectedlinenum':_0x24609a['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x24609a[_0xcab1('0x28')],'transfereeaccountcode':_0x24609a['transfertargetaccountcode'],'transfereecontext':_0x24609a['transfertargetcontext'],'transfereeexten':_0x24609a[_0xcab1('0x29')],'transfereelinkedid':_0x24609a[_0xcab1('0x2a')]});}writeDB(_0x24609a);}catch(_0x4bda11){utils[_0xcab1('0x15')](util[_0xcab1('0x4')]('[%s][transfers][attendedtransfer]',_0x24609a[_0xcab1('0x7')]),_0x4bda11);}};
\ No newline at end of file
index ef62415..5b4258e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d30=['[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','seconds','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','result','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface'];(function(_0x510cd9,_0x551300){var _0x2b1f61=function(_0x345249){while(--_0x345249){_0x510cd9['push'](_0x510cd9['shift']());}};_0x2b1f61(++_0x551300);}(_0x8d30,0x128));var _0x08d3=function(_0x44c768,_0x552a5e){_0x44c768=_0x44c768-0x0;var _0x55daf5=_0x8d30[_0x44c768];return _0x55daf5;};'use strict';var BPromise=require(_0x08d3('0x0'));var jayson=require(_0x08d3('0x1'));var moment=require(_0x08d3('0x2'));var util=require(_0x08d3('0x3'));var client=jayson[_0x08d3('0x4')][_0x08d3('0x5')]({'port':0x2329});var logger=require(_0x08d3('0x6'))(_0x08d3('0x7'));exports[_0x08d3('0x8')]=function(_0x39e105,_0x2f746e){logger[_0x08d3('0x8')](_0x39e105,_0x2f746e?util[_0x08d3('0x9')](_0x2f746e,{'showHidden':![],'depth':null}):'');};exports[_0x08d3('0xa')]=function(_0x379ac0,_0x58079e){logger[_0x08d3('0xa')](_0x379ac0,_0x58079e?util[_0x08d3('0x9')](_0x58079e,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x334482,_0x5d7a3c){logger[_0x08d3('0xb')](_0x334482,_0x5d7a3c?util[_0x08d3('0x9')](_0x5d7a3c,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x411431,_0x10f16e){return client[_0x08d3('0xc')](_0x411431,{'body':_0x10f16e})[_0x08d3('0xd')](function(_0x38ced6){logger['debug'](_0x08d3('0xe'),_0x411431,_0x38ced6?util[_0x08d3('0x9')](_0x38ced6,{'showHidden':![],'depth':null}):'');})[_0x08d3('0xf')](function(_0x4c1fa1){logger['error'](_0x08d3('0xe'),_0x411431,_0x4c1fa1?util['inspect'](_0x4c1fa1,{'showHidden':![],'depth':null}):'');});};function getUser(_0xcc3578){return client['request'](_0x08d3('0x10'),{'options':{'raw':!![],'attributes':['id',_0x08d3('0x11'),_0x08d3('0x12'),_0x08d3('0x13')],'where':_0xcc3578,'limit':0x1}})[_0x08d3('0xd')](function(_0x1748d4){logger['debug'](_0x08d3('0x14'),JSON['stringify'](_0xcc3578),_0x1748d4?util[_0x08d3('0x9')](_0x1748d4,{'showHidden':![],'depth':null}):'');return _0x1748d4[_0x08d3('0x15')]['length']?_0x1748d4[_0x08d3('0x15')][0x0]:null;});}exports['getUserByInternal']=function(_0x4c5208){return new BPromise(function(_0x51c075,_0x2e116b){if(_0x4c5208){return getUser({'internal':_0x4c5208})[_0x08d3('0xd')](function(_0x54d1d6){logger['info'](_0x08d3('0x16'),_0x4c5208,_0x54d1d6?_0x08d3('0x17'):_0x08d3('0x18'));return _0x51c075(_0x54d1d6);})[_0x08d3('0xf')](function(_0x57b0f7){logger[_0x08d3('0xb')]('[utils][getUserByInternal]',_0x57b0f7?util[_0x08d3('0x9')](_0x57b0f7,{'showHidden':![],'depth':null}):'');return _0x51c075(null);});}return _0x51c075(null);});};exports[_0x08d3('0x19')]=function(_0x151bc7){return new BPromise(function(_0x8223fc,_0xa0748e){if(_0x151bc7){return getUser({'interface':_0x151bc7})[_0x08d3('0xd')](function(_0x4fd880){logger['info'](_0x08d3('0x1a'),_0x151bc7,_0x4fd880?_0x08d3('0x17'):_0x08d3('0x18'));return _0x8223fc(_0x4fd880);})['catch'](function(_0x1f4d2f){logger[_0x08d3('0xb')](_0x08d3('0x1b'),_0x1f4d2f?util[_0x08d3('0x9')](_0x1f4d2f,{'showHidden':![],'depth':null}):'');return _0x8223fc(null);});}return _0x8223fc(null);});};exports[_0x08d3('0x1c')]=function(_0x5c8ac3){return new BPromise(function(_0x29e8d5,_0x337409){if(_0x5c8ac3){return getUser({'name':_0x5c8ac3})[_0x08d3('0xd')](function(_0x1d6a1b){logger[_0x08d3('0x8')](_0x08d3('0x1d'),_0x5c8ac3,_0x1d6a1b?_0x08d3('0x17'):_0x08d3('0x18'));return _0x29e8d5(_0x1d6a1b);})[_0x08d3('0xf')](function(_0x376920){logger[_0x08d3('0xb')](_0x08d3('0x1e'),_0x376920?util[_0x08d3('0x9')](_0x376920,{'showHidden':![],'depth':null}):'');return _0x29e8d5(null);});}return _0x29e8d5(null);});};exports['getVoiceQueueByName']=function(_0x5edb2c){return new BPromise(function(_0x513c8e,_0x3a7337){if(_0x5edb2c){return client[_0x08d3('0xc')](_0x08d3('0x1f'),{'options':{'raw':!![],'attributes':['id',_0x08d3('0x12'),_0x08d3('0x20'),_0x08d3('0x21'),_0x08d3('0x22')],'where':{'name':_0x5edb2c},'limit':0x1}})[_0x08d3('0xd')](function(_0xe787d){logger[_0x08d3('0xa')]('[utils][getVoiceQueueByName]\x20name:%s',_0x5edb2c,_0xe787d?util[_0x08d3('0x9')](_0xe787d,{'showHidden':![],'depth':null}):'');logger[_0x08d3('0x8')](_0x08d3('0x23'),_0x5edb2c,_0xe787d?_0x08d3('0x17'):_0x08d3('0x18'));return _0x513c8e(_0xe787d[_0x08d3('0x15')]['length']?_0xe787d[_0x08d3('0x15')][0x0]:null);})[_0x08d3('0xf')](function(_0x4d0ee9){logger[_0x08d3('0xb')](_0x08d3('0x24'),_0x4d0ee9?util[_0x08d3('0x9')](_0x4d0ee9,{'showHidden':![],'depth':null}):'');return _0x513c8e(null);});}return _0x513c8e(null);});};exports[_0x08d3('0x25')]=function(_0x4dcdbd,_0x512072){return moment(_0x4dcdbd)['add'](_0x512072,_0x08d3('0x26'))['format'](_0x08d3('0x27'));};exports['subtractTime']=function(_0x177943,_0x384117){return moment(_0x177943)['subtract'](_0x384117,_0x08d3('0x26'))['format'](_0x08d3('0x27'));};exports[_0x08d3('0x28')]=function(_0x30a98f,_0x3d0092){return moment(_0x30a98f)[_0x08d3('0x29')](moment(_0x3d0092),_0x08d3('0x26'));};exports[_0x08d3('0x2a')]=function(_0x4fc57e,_0x52adc3){return parseInt(_0x4fc57e,0xa)+parseInt(_0x52adc3,0xa);};exports[_0x08d3('0x2b')]=function(){return moment()['format'](_0x08d3('0x27'));};exports[_0x08d3('0x2c')]=function(_0x16d942,_0x3dae10){if(_0x3dae10){return moment(_0x16d942)[_0x08d3('0x2c')](_0x3dae10);}return!![];};exports[_0x08d3('0x2d')]=function(_0x6265a6,_0x27c3d0){if(_0x27c3d0){return moment(_0x6265a6)[_0x08d3('0x2d')](_0x27c3d0);}else if(_0x6265a6){return!![];}return![];};
\ No newline at end of file
+var _0x5302=['info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','[utils][getUser]\x20where:%s','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','type','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','now','isAfter','isBefore','moment','util','../../config/logger'];(function(_0xcf8d66,_0x574796){var _0xf2c341=function(_0x40995f){while(--_0x40995f){_0xcf8d66['push'](_0xcf8d66['shift']());}};_0xf2c341(++_0x574796);}(_0x5302,0x1b5));var _0x2530=function(_0x321cb9,_0x1c3579){_0x321cb9=_0x321cb9-0x0;var _0x59c6bf=_0x5302[_0x321cb9];return _0x59c6bf;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0x2530('0x0'));var util=require(_0x2530('0x1'));var client=jayson['client']['http']({'port':0x2329});var logger=require(_0x2530('0x2'))('xdr');exports[_0x2530('0x3')]=function(_0x4ae9db,_0x371cf1){logger[_0x2530('0x3')](_0x4ae9db,_0x371cf1?util[_0x2530('0x4')](_0x371cf1,{'showHidden':![],'depth':null}):'');};exports[_0x2530('0x5')]=function(_0x9f762,_0x574655){logger[_0x2530('0x5')](_0x9f762,_0x574655?util[_0x2530('0x4')](_0x574655,{'showHidden':![],'depth':null}):'');};exports[_0x2530('0x6')]=function(_0x1070de,_0x3f7422){logger[_0x2530('0x6')](_0x1070de,_0x3f7422?util[_0x2530('0x4')](_0x3f7422,{'showHidden':![],'depth':null}):'');};exports[_0x2530('0x7')]=function(_0x2ebbb7,_0x35b948){return client[_0x2530('0x7')](_0x2ebbb7,{'body':_0x35b948})[_0x2530('0x8')](function(_0x3a8848){logger[_0x2530('0x5')](_0x2530('0x9'),_0x2ebbb7,_0x3a8848?util[_0x2530('0x4')](_0x3a8848,{'showHidden':![],'depth':null}):'');})[_0x2530('0xa')](function(_0x4d69e3){logger[_0x2530('0x6')](_0x2530('0x9'),_0x2ebbb7,_0x4d69e3?util[_0x2530('0x4')](_0x4d69e3,{'showHidden':![],'depth':null}):'');});};function getUser(_0x9df06c){return client[_0x2530('0x7')](_0x2530('0xb'),{'options':{'raw':!![],'attributes':['id',_0x2530('0xc'),'name','interface'],'where':_0x9df06c,'limit':0x1}})['then'](function(_0x4f7a1e){logger[_0x2530('0x5')](_0x2530('0xd'),JSON['stringify'](_0x9df06c),_0x4f7a1e?util[_0x2530('0x4')](_0x4f7a1e,{'showHidden':![],'depth':null}):'');return _0x4f7a1e[_0x2530('0xe')][_0x2530('0xf')]?_0x4f7a1e[_0x2530('0xe')][0x0]:null;});}exports[_0x2530('0x10')]=function(_0x1af188){return new BPromise(function(_0x3aac94,_0x117c5d){if(_0x1af188){return getUser({'internal':_0x1af188})[_0x2530('0x8')](function(_0x5a2e0c){logger[_0x2530('0x3')](_0x2530('0x11'),_0x1af188,_0x5a2e0c?_0x2530('0x12'):_0x2530('0x13'));return _0x3aac94(_0x5a2e0c);})[_0x2530('0xa')](function(_0xde715e){logger[_0x2530('0x6')](_0x2530('0x14'),_0xde715e?util[_0x2530('0x4')](_0xde715e,{'showHidden':![],'depth':null}):'');return _0x3aac94(null);});}return _0x3aac94(null);});};exports[_0x2530('0x15')]=function(_0x23bcea){return new BPromise(function(_0x5243d2,_0x1c2c2c){if(_0x23bcea){return getUser({'interface':_0x23bcea})[_0x2530('0x8')](function(_0x4a1108){logger['info'](_0x2530('0x16'),_0x23bcea,_0x4a1108?_0x2530('0x12'):_0x2530('0x13'));return _0x5243d2(_0x4a1108);})[_0x2530('0xa')](function(_0x3dcf2c){logger['error'](_0x2530('0x17'),_0x3dcf2c?util[_0x2530('0x4')](_0x3dcf2c,{'showHidden':![],'depth':null}):'');return _0x5243d2(null);});}return _0x5243d2(null);});};exports[_0x2530('0x18')]=function(_0x313252){return new BPromise(function(_0x704ca5,_0x56381d){if(_0x313252){return getUser({'name':_0x313252})[_0x2530('0x8')](function(_0x520879){logger[_0x2530('0x3')](_0x2530('0x19'),_0x313252,_0x520879?_0x2530('0x12'):'notfound');return _0x704ca5(_0x520879);})[_0x2530('0xa')](function(_0x539de1){logger['error'](_0x2530('0x1a'),_0x539de1?util[_0x2530('0x4')](_0x539de1,{'showHidden':![],'depth':null}):'');return _0x704ca5(null);});}return _0x704ca5(null);});};exports[_0x2530('0x1b')]=function(_0x502052){return new BPromise(function(_0x27e7e2,_0x5b9bd2){if(_0x502052){return client['request'](_0x2530('0x1c'),{'options':{'raw':!![],'attributes':['id',_0x2530('0x1d'),_0x2530('0x1e'),'acw','acwTimeout'],'where':{'name':_0x502052},'limit':0x1}})[_0x2530('0x8')](function(_0xe63792){logger[_0x2530('0x5')]('[utils][getVoiceQueueByName]\x20name:%s',_0x502052,_0xe63792?util['inspect'](_0xe63792,{'showHidden':![],'depth':null}):'');logger[_0x2530('0x3')](_0x2530('0x1f'),_0x502052,_0xe63792?_0x2530('0x12'):_0x2530('0x13'));return _0x27e7e2(_0xe63792['result'][_0x2530('0xf')]?_0xe63792['result'][0x0]:null);})[_0x2530('0xa')](function(_0x174ad9){logger[_0x2530('0x6')](_0x2530('0x20'),_0x174ad9?util[_0x2530('0x4')](_0x174ad9,{'showHidden':![],'depth':null}):'');return _0x27e7e2(null);});}return _0x27e7e2(null);});};exports[_0x2530('0x21')]=function(_0x13c43a,_0xf330c6){return moment(_0x13c43a)[_0x2530('0x22')](_0xf330c6,'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss');};exports['subtractTime']=function(_0x3db365,_0x4bb52a){return moment(_0x3db365)['subtract'](_0x4bb52a,_0x2530('0x23'))[_0x2530('0x24')](_0x2530('0x25'));};exports[_0x2530('0x26')]=function(_0x5313aa,_0x2219dd){return moment(_0x5313aa)[_0x2530('0x27')](moment(_0x2219dd),'seconds');};exports[_0x2530('0x28')]=function(_0x4ea40d,_0x6a3bad){return parseInt(_0x4ea40d,0xa)+parseInt(_0x6a3bad,0xa);};exports[_0x2530('0x29')]=function(){return moment()['format'](_0x2530('0x25'));};exports[_0x2530('0x2a')]=function(_0x160990,_0x452d8c){if(_0x452d8c){return moment(_0x160990)[_0x2530('0x2a')](_0x452d8c);}return!![];};exports['isBefore']=function(_0x4e2e51,_0x510e76){if(_0x510e76){return moment(_0x4e2e51)[_0x2530('0x2b')](_0x510e76);}else if(_0x4e2e51){return!![];}return![];};
\ No newline at end of file
index 20b2461..e5bd107 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3283=['connection','remoteAddress','url','statusCode','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','method','device','other','agent_name','test','setupLoggers','fs-extra','lodash','express-winston','util','./loggers','fileLogger','./mask-sensitive-data','/var','join','client','name','ensureDir','then','log','user','no-user','data','timestamp','catch','error','api','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','x-forwarded-for'];(function(_0x4d7724,_0x9ca60e){var _0x456322=function(_0x30090f){while(--_0x30090f){_0x4d7724['push'](_0x4d7724['shift']());}};_0x456322(++_0x9ca60e);}(_0x3283,0x118));var _0x3328=function(_0x5671af,_0x43d6af){_0x5671af=_0x5671af-0x0;var _0x1c9a47=_0x3283[_0x5671af];return _0x1c9a47;};var fs=require(_0x3328('0x0'));var _=require(_0x3328('0x1'));var ewinston=require(_0x3328('0x2'));var path=require('path');var util=require(_0x3328('0x3'));var fileLogger=require(_0x3328('0x4'))[_0x3328('0x5')];var safeTemplate=require('./safe-template')['safeTemplate'];var maskSensitiveData=require(_0x3328('0x6'))['maskSensitiveData'];function ClientSideLogger(){function _0x2f0dc1(_0x121ec7){var _0x4ea274=path['join'](_0x3328('0x7'),'log','xcally');var _0xe8b08e=path[_0x3328('0x8')](_0x3328('0x9'),_0x121ec7['role']+'-'+_0x121ec7[_0x3328('0xa')]);return fs[_0x3328('0xb')](path[_0x3328('0x8')](_0x4ea274,_0xe8b08e))[_0x3328('0xc')](function(){var _0xc6777=fileLogger('client',path[_0x3328('0x8')](_0x4ea274,_0xe8b08e));return _0xc6777;})['catch'](function(_0x58cfee){throw _0x58cfee;});}this[_0x3328('0xd')]=function(_0x406fdc,_0xa975a1,_0x1a8eb2,_0x33594d){return _0x2f0dc1(_0x406fdc['user'])[_0x3328('0xc')](function(_0x502074){var _0x2db1e0=_0x502074[_0xa975a1];return _0x2db1e0;})['then'](function(_0x50606f){var _0x466ab6=_0x406fdc[_0x3328('0xe')]?_0x406fdc[_0x3328('0xe')]['id']:_0x3328('0xf');var _0x4138e7=_0x33594d[_0x3328('0x10')];var _0x24cfbf=_0x33594d[_0x3328('0x11')];var _0x4a3f38=new Date(Number(_0x24cfbf));return _0x50606f(_0x466ab6,_0x4a3f38,_0x1a8eb2,_0x4138e7);})[_0x3328('0x12')](function(_0x6bb82a){fileLogger('client')[_0x3328('0x13')](_0x6bb82a);});};}function setupLoggers(_0xfb02f4){return new Promise(function(_0x3ec61b){var _0x3c20a7=new ClientSideLogger();var _0x2e57ec=fileLogger(_0x3328('0x14'));var _0x2187b7=fileLogger('auth');_0xfb02f4['set'](_0x3328('0x15'),_0x3c20a7);_0xfb02f4[_0x3328('0x16')](ewinston[_0x3328('0x17')]({'winstonInstance':_0x2e57ec,'meta':![],'statusLevels':!![],'msg':function(_0x1df092,_0x387685){var _0x1c4683=_0x3328('0x18');if(!_['isEmpty'](_0x1df092[_0x3328('0x19')])){_0x1c4683+=_0x3328('0x1a');var _0x4de0ba=_0x1df092[_0x3328('0x19')];maskSensitiveData(_0x4de0ba);}return safeTemplate(util['format'](_0x1c4683,_0x1df092['method'],_0x1df092['headers'][_0x3328('0x1b')]?_0x1df092['headers'][_0x3328('0x1b')]:_0x1df092[_0x3328('0x1c')][_0x3328('0x1d')]||_0x1df092['ip'],_0x1df092[_0x3328('0x1e')],_0x387685[_0x3328('0x1f')],_0x387685['responseTime'],_0x1df092['user']?_0x1df092[_0x3328('0xe')]['id']:null,_0x1df092[_0x3328('0xe')]?_0x1df092['user'][_0x3328('0xa')]:null,_0x1df092['user']?_0x1df092[_0x3328('0xe')][_0x3328('0x20')]:null,_0x4de0ba?util[_0x3328('0x21')](_0x4de0ba,![],null):''));}}));_0xfb02f4[_0x3328('0x16')](ewinston['logger']({'winstonInstance':_0x2187b7,'meta':![],'statusLevels':!![],'msg':function(_0x4f1f71,_0x5231fd){var _0xd3e10e=_0x3328('0x22');if(_0x4f1f71['body']&&_0x4f1f71['body']['device']&&_0x4f1f71['body'][_0x3328('0x23')]){_0xd3e10e=_0x3328('0x24');}return util[_0x3328('0x25')](_0xd3e10e,_0x4f1f71[_0x3328('0x26')],_0x4f1f71['headers'][_0x3328('0x1b')]?_0x4f1f71['headers']['x-forwarded-for']:_0x4f1f71['connection'][_0x3328('0x1d')]||_0x4f1f71['ip'],_0x4f1f71[_0x3328('0x1e')],_0x5231fd[_0x3328('0x1f')],_0x5231fd['responseTime'],_0x4f1f71[_0x3328('0xe')]?_0x4f1f71['user']['id']:null,_0x4f1f71[_0x3328('0xe')]?_0x4f1f71['user'][_0x3328('0xa')]:null,_0x4f1f71['user']?_0x4f1f71['user'][_0x3328('0x20')]:null,_0x4f1f71['body']&&_0x4f1f71[_0x3328('0x19')][_0x3328('0x27')]?_0x4f1f71['body'][_0x3328('0x27')]:_0x3328('0x28'),_0x4f1f71[_0x3328('0x19')]&&_0x4f1f71[_0x3328('0x19')][_0x3328('0x23')]?_0x4f1f71[_0x3328('0x19')][_0x3328('0x23')]:'',_0x4f1f71[_0x3328('0x19')]&&_0x4f1f71[_0x3328('0x19')]['agent_name']?_0x4f1f71[_0x3328('0x19')][_0x3328('0x29')]:'');},'ignoreRoute':function(_0x16de75){var _0x368d1f=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x368d1f[_0x3328('0x2a')](_0x16de75[_0x3328('0x1e')]);}}));return _0x3ec61b();});}exports[_0x3328('0x2b')]=setupLoggers;
\ No newline at end of file
+var _0x277b=['util','./loggers','fileLogger','./safe-template','maskSensitiveData','join','log','xcally','client','role','ensureDir','then','catch','user','no-user','data','error','auth','set','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','headers','x-forwarded-for','connection','url','statusCode','responseTime','name','inspect','device','method','remoteAddress','other','agent_id','agent_name','test','setupLoggers','lodash','express-winston','path'];(function(_0x29e36f,_0x4c645d){var _0x40dd0f=function(_0x4fff5d){while(--_0x4fff5d){_0x29e36f['push'](_0x29e36f['shift']());}};_0x40dd0f(++_0x4c645d);}(_0x277b,0x10b));var _0xb277=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x277b[_0x3d42d8];return _0x27fc41;};var fs=require('fs-extra');var _=require(_0xb277('0x0'));var ewinston=require(_0xb277('0x1'));var path=require(_0xb277('0x2'));var util=require(_0xb277('0x3'));var fileLogger=require(_0xb277('0x4'))[_0xb277('0x5')];var safeTemplate=require(_0xb277('0x6'))['safeTemplate'];var maskSensitiveData=require('./mask-sensitive-data')[_0xb277('0x7')];function ClientSideLogger(){function _0x4cdb51(_0x4540e3){var _0x2de5e1=path[_0xb277('0x8')]('/var',_0xb277('0x9'),_0xb277('0xa'));var _0x589b2b=path[_0xb277('0x8')](_0xb277('0xb'),_0x4540e3[_0xb277('0xc')]+'-'+_0x4540e3['name']);return fs[_0xb277('0xd')](path['join'](_0x2de5e1,_0x589b2b))[_0xb277('0xe')](function(){var _0x3727da=fileLogger(_0xb277('0xb'),path[_0xb277('0x8')](_0x2de5e1,_0x589b2b));return _0x3727da;})[_0xb277('0xf')](function(_0x36bad4){throw _0x36bad4;});}this[_0xb277('0x9')]=function(_0x1714fb,_0x4bf66b,_0x517f83,_0x119ae7){return _0x4cdb51(_0x1714fb['user'])[_0xb277('0xe')](function(_0x36c422){var _0x8cf6ef=_0x36c422[_0x4bf66b];return _0x8cf6ef;})[_0xb277('0xe')](function(_0x2950f7){var _0x539a21=_0x1714fb[_0xb277('0x10')]?_0x1714fb['user']['id']:_0xb277('0x11');var _0x2c4739=_0x119ae7[_0xb277('0x12')];var _0x33bd35=_0x119ae7['timestamp'];var _0x4d1c45=new Date(Number(_0x33bd35));return _0x2950f7(_0x539a21,_0x4d1c45,_0x517f83,_0x2c4739);})[_0xb277('0xf')](function(_0x7de30){fileLogger(_0xb277('0xb'))[_0xb277('0x13')](_0x7de30);});};}function setupLoggers(_0x333784){return new Promise(function(_0x1ce597){var _0x1f22a2=new ClientSideLogger();var _0x20f039=fileLogger('api');var _0x4c048c=fileLogger(_0xb277('0x14'));_0x333784[_0xb277('0x15')]('client-side-logger',_0x1f22a2);_0x333784[_0xb277('0x16')](ewinston[_0xb277('0x17')]({'winstonInstance':_0x20f039,'meta':![],'statusLevels':!![],'msg':function(_0x27d318,_0x4bd781){var _0x1d24b1=_0xb277('0x18');if(!_[_0xb277('0x19')](_0x27d318[_0xb277('0x1a')])){_0x1d24b1+=_0xb277('0x1b');var _0x300b2e=_0x27d318['body'];maskSensitiveData(_0x300b2e);}return safeTemplate(util[_0xb277('0x1c')](_0x1d24b1,_0x27d318['method'],_0x27d318[_0xb277('0x1d')][_0xb277('0x1e')]?_0x27d318[_0xb277('0x1d')][_0xb277('0x1e')]:_0x27d318[_0xb277('0x1f')]['remoteAddress']||_0x27d318['ip'],_0x27d318[_0xb277('0x20')],_0x4bd781[_0xb277('0x21')],_0x4bd781[_0xb277('0x22')],_0x27d318[_0xb277('0x10')]?_0x27d318[_0xb277('0x10')]['id']:null,_0x27d318[_0xb277('0x10')]?_0x27d318[_0xb277('0x10')][_0xb277('0x23')]:null,_0x27d318[_0xb277('0x10')]?_0x27d318['user'][_0xb277('0xc')]:null,_0x300b2e?util[_0xb277('0x24')](_0x300b2e,![],null):''));}}));_0x333784[_0xb277('0x16')](ewinston[_0xb277('0x17')]({'winstonInstance':_0x4c048c,'meta':![],'statusLevels':!![],'msg':function(_0x357a2e,_0x4cc030){var _0x18d3c1='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x357a2e[_0xb277('0x1a')]&&_0x357a2e[_0xb277('0x1a')][_0xb277('0x25')]&&_0x357a2e[_0xb277('0x1a')]['agent_id']){_0x18d3c1='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0xb277('0x1c')](_0x18d3c1,_0x357a2e[_0xb277('0x26')],_0x357a2e[_0xb277('0x1d')]['x-forwarded-for']?_0x357a2e[_0xb277('0x1d')][_0xb277('0x1e')]:_0x357a2e[_0xb277('0x1f')][_0xb277('0x27')]||_0x357a2e['ip'],_0x357a2e[_0xb277('0x20')],_0x4cc030[_0xb277('0x21')],_0x4cc030[_0xb277('0x22')],_0x357a2e['user']?_0x357a2e[_0xb277('0x10')]['id']:null,_0x357a2e[_0xb277('0x10')]?_0x357a2e[_0xb277('0x10')][_0xb277('0x23')]:null,_0x357a2e[_0xb277('0x10')]?_0x357a2e['user'][_0xb277('0xc')]:null,_0x357a2e['body']&&_0x357a2e[_0xb277('0x1a')][_0xb277('0x25')]?_0x357a2e[_0xb277('0x1a')][_0xb277('0x25')]:_0xb277('0x28'),_0x357a2e[_0xb277('0x1a')]&&_0x357a2e['body'][_0xb277('0x29')]?_0x357a2e[_0xb277('0x1a')]['agent_id']:'',_0x357a2e[_0xb277('0x1a')]&&_0x357a2e[_0xb277('0x1a')][_0xb277('0x2a')]?_0x357a2e[_0xb277('0x1a')][_0xb277('0x2a')]:'');},'ignoreRoute':function(_0xe99e1){var _0x2b9165=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2b9165[_0xb277('0x2b')](_0xe99e1[_0xb277('0x20')]);}}));return _0x1ce597();});}exports[_0xb277('0x2c')]=setupLoggers;
\ No newline at end of file
index baf6093..f1d6630 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3899=['%s-%s','error','fileLogger','path','util','moment','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','gray','bold\x20magenta','addColors','/var/log/xcally','message','replace','format','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','{{{','}}}','keys','length','stringify','Console','warn','Logger','transports','File'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3899,0x69));var _0x9389=function(_0x58815b,_0x55cf33){_0x58815b=_0x58815b-0x0;var _0x4417b1=_0x3899[_0x58815b];return _0x4417b1;};'use strict';var path=require(_0x9389('0x0'));var util=require(_0x9389('0x1'));var moment=require(_0x9389('0x2'));var winston=require('winston');var config=require(_0x9389('0x3'));var debugLevel=config[_0x9389('0x4')]?config[_0x9389('0x4')][_0x9389('0x5')]():_0x9389('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x9389('0x7'),'error':_0x9389('0x8'),'warn':_0x9389('0x9'),'info':_0x9389('0xa'),'print':'bold\x20white','success':'bold\x20green','http':_0x9389('0xb'),'verbose':_0x9389('0xc'),'debug':'bold\x20blue','silly':'bold\x20cyan'};winston[_0x9389('0xd')](XC_LOG_COLORS);function getLogFileName(_0x2d27a3,_0x5ce67c,_0xad1cf8){var _0x25da5e=_0x2d27a3||_0x9389('0xe');return path['join'](_0x25da5e,util['format']('%s-%s.log',_0x5ce67c,_0xad1cf8));}function formatter(_0x40f0e3,_0x5e6159){_0x5e6159[_0x9389('0xf')]=_0x5e6159[_0x9389('0xf')][_0x9389('0x10')](/@@{/g,'{{{')[_0x9389('0x10')](/}@@/g,'}}}')[_0x9389('0x10')](/@{/g,'{{')[_0x9389('0x10')](/}@/g,'}}');return util[_0x9389('0x11')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x9389('0x11')](_0x9389('0x12')),_0x5e6159[_0x9389('0x13')][_0x9389('0x14')](),_0x40f0e3,_0x5e6159[_0x9389('0xf')]);}function fileFormat(_0x11364a,_0x4b8778){_0x4b8778[_0x9389('0xf')]=_0x4b8778['message'][_0x9389('0x10')](/@@{/g,_0x9389('0x15'))[_0x9389('0x10')](/}@@/g,_0x9389('0x16'))[_0x9389('0x10')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x5a8e47=_0x4b8778['meta']&&Object[_0x9389('0x17')](_0x4b8778['meta'])[_0x9389('0x18')]?'\x0a\x09'+JSON[_0x9389('0x19')](_0x4b8778['meta']):'';return util[_0x9389('0x11')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x9389('0x11')](_0x9389('0x12')),_0x4b8778[_0x9389('0x13')]['toUpperCase'](),_0x11364a,_0x4b8778['message'],_0x5a8e47);}function consoleLogger(){var _0x25d744=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x9389('0x1a'))]({'level':_0x9389('0x1b'),'json':![],'formatter':function(_0x2610f0){return formatter('',_0x2610f0);}})]});return _0x25d744;}function fileLogger(_0x2f5371,_0x4f68c6){var _0x438965=new winston[(_0x9389('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x9389('0x1d'))][(_0x9389('0x1e'))]({'name':util[_0x9389('0x11')](_0x9389('0x1f'),_0x2f5371,_0x9389('0x20')),'filename':getLogFileName(_0x4f68c6,_0x2f5371,_0x9389('0x20')),'level':_0x9389('0x20'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x25cbbc){return fileFormat(_0x2f5371,_0x25cbbc);}}),new winston[(_0x9389('0x1d'))][(_0x9389('0x1e'))]({'name':util[_0x9389('0x11')]('%s-%s',_0x2f5371,debugLevel),'filename':getLogFileName(_0x4f68c6,_0x2f5371,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4f4571){return fileFormat(_0x2f5371,_0x4f4571);}}),new winston[(_0x9389('0x1d'))]['Console']({'level':_0x9389('0x1b'),'json':![],'formatter':function(_0x3df25c){return fileFormat(_0x2f5371,_0x3df25c);}})]});return _0x438965;}exports['consoleLogger']=consoleLogger;exports[_0x9389('0x21')]=fileLogger;
\ No newline at end of file
+var _0x811a=['length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','error','File','consoleLogger','fileLogger','moment','winston','../config/environment','info','redBG\x20white','bold\x20yellow','bold\x20green','gray','bold\x20cyan','addColors','join','format','%s-%s.log','message','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','{{{','meta','keys'];(function(_0x42872c,_0xb7c450){var _0x1dbbfb=function(_0x8b8abc){while(--_0x8b8abc){_0x42872c['push'](_0x42872c['shift']());}};_0x1dbbfb(++_0xb7c450);}(_0x811a,0x1ea));var _0xa811=function(_0x143759,_0x249c49){_0x143759=_0x143759-0x0;var _0x4582be=_0x811a[_0x143759];return _0x4582be;};'use strict';var path=require('path');var util=require('util');var moment=require(_0xa811('0x0'));var winston=require(_0xa811('0x1'));var config=require(_0xa811('0x2'));var debugLevel=config['debugLevel']?config['debugLevel']['toLowerCase']():_0xa811('0x3');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xa811('0x4'),'error':'red','warn':_0xa811('0x5'),'info':'white','print':'bold\x20white','success':_0xa811('0x6'),'http':_0xa811('0x7'),'verbose':'bold\x20magenta','debug':'bold\x20blue','silly':_0xa811('0x8')};winston[_0xa811('0x9')](XC_LOG_COLORS);function getLogFileName(_0x1aa1f6,_0x263d25,_0x3e38ac){var _0x353be3=_0x1aa1f6||'/var/log/xcally';return path[_0xa811('0xa')](_0x353be3,util[_0xa811('0xb')](_0xa811('0xc'),_0x263d25,_0x3e38ac));}function formatter(_0x3e5458,_0x154868){_0x154868[_0xa811('0xd')]=_0x154868['message'][_0xa811('0xe')](/@@{/g,'{{{')['replace'](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0xa811('0xe')](/}@/g,'}}');return util['format'](_0xa811('0xf'),moment()[_0xa811('0xb')](_0xa811('0x10')),_0x154868[_0xa811('0x11')][_0xa811('0x12')](),_0x3e5458,_0x154868[_0xa811('0xd')]);}function fileFormat(_0x115ef8,_0x563541){_0x563541[_0xa811('0xd')]=_0x563541['message'][_0xa811('0xe')](/@@{/g,_0xa811('0x13'))['replace'](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0xa811('0xe')](/}@/g,'}}');var _0x49a704=_0x563541[_0xa811('0x14')]&&Object[_0xa811('0x15')](_0x563541['meta'])[_0xa811('0x16')]?'\x0a\x09'+JSON['stringify'](_0x563541['meta']):'';return util[_0xa811('0xb')](_0xa811('0x17'),moment()[_0xa811('0xb')](_0xa811('0x10')),_0x563541[_0xa811('0x11')][_0xa811('0x12')](),_0x115ef8,_0x563541[_0xa811('0xd')],_0x49a704);}function consoleLogger(){var _0x2423c9=new winston[(_0xa811('0x18'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xa811('0x19'))][(_0xa811('0x1a'))]({'level':_0xa811('0x1b'),'json':![],'formatter':function(_0x4524c4){return formatter('',_0x4524c4);}})]});return _0x2423c9;}function fileLogger(_0x400dc2,_0x46b540){var _0x10857f=new winston[(_0xa811('0x18'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xa811('0x19'))]['File']({'name':util['format']('%s-%s',_0x400dc2,_0xa811('0x1c')),'filename':getLogFileName(_0x46b540,_0x400dc2,_0xa811('0x1c')),'level':_0xa811('0x1c'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x317010){return fileFormat(_0x400dc2,_0x317010);}}),new winston[(_0xa811('0x19'))][(_0xa811('0x1d'))]({'name':util[_0xa811('0xb')]('%s-%s',_0x400dc2,debugLevel),'filename':getLogFileName(_0x46b540,_0x400dc2,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x26530c){return fileFormat(_0x400dc2,_0x26530c);}}),new winston['transports'][(_0xa811('0x1a'))]({'level':_0xa811('0x1b'),'json':![],'formatter':function(_0x11cf47){return fileFormat(_0x400dc2,_0x11cf47);}})]});return _0x10857f;}exports[_0xa811('0x1e')]=consoleLogger;exports[_0xa811('0x1f')]=fileLogger;
\ No newline at end of file
index a6a3013..602fb7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['consumerSecret','membername','calleridname','exten','privateKey','secretaccesskey','user','pass','accountSid','localstationid','dsn','secret','registry','oldPassword','length','isPlainObject','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','lastName','street','mobile','email','clientId','code','accessKey','tenantId','token','channelSecret','accessToken','consumerKey'];(function(_0x5a26ac,_0x5a553e){var _0x2957d4=function(_0x1cbe71){while(--_0x1cbe71){_0x5a26ac['push'](_0x5a26ac['shift']());}};_0x2957d4(++_0x5a553e);}(_0x5f66,0x1a0));var _0x65f6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5f66[_0x20a584];return _0x4b41a8;};var _=require('lodash');var sensitiveFields=[_0x65f6('0x0'),'password',_0x65f6('0x1'),_0x65f6('0x2'),_0x65f6('0x3'),_0x65f6('0x4'),_0x65f6('0x5'),'phone',_0x65f6('0x6'),'fax',_0x65f6('0x7'),_0x65f6('0x8'),'clientSecret','securityToken',_0x65f6('0x9'),_0x65f6('0xa'),_0x65f6('0xb'),_0x65f6('0xc'),_0x65f6('0xd'),_0x65f6('0xe'),'accessTokenSecret','authToken',_0x65f6('0xf'),_0x65f6('0x10'),_0x65f6('0x11'),_0x65f6('0x12'),'calleridnum',_0x65f6('0x13'),'vidaooApiKey','clientEmail',_0x65f6('0x14'),'accesskeyid',_0x65f6('0x15'),'key',_0x65f6('0x16'),_0x65f6('0x17'),_0x65f6('0x18'),_0x65f6('0x19'),_0x65f6('0x1a'),_0x65f6('0x1b'),_0x65f6('0x1c'),_0x65f6('0x1d')];function maskSensitiveData(_0x46dbc6){const _0x3440af=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x46dbc6)){for(const _0x19b9ff in _0x46dbc6){if(_['isArray'](_0x46dbc6[_0x19b9ff])){for(let _0x5dd324=0x0;_0x5dd324<_0x46dbc6[_0x19b9ff][_0x65f6('0x1e')];_0x5dd324++){maskSensitiveData(_0x46dbc6[_0x19b9ff][_0x5dd324]);}}else if(_[_0x65f6('0x1f')](_0x46dbc6[_0x19b9ff])){maskSensitiveData(_0x46dbc6[_0x19b9ff]);}else if(_[_0x65f6('0x20')](_0x46dbc6[_0x19b9ff])){_0x46dbc6[_0x19b9ff]=_0x46dbc6[_0x19b9ff][_0x65f6('0x21')](/{{{/g,_0x65f6('0x22'))[_0x65f6('0x21')](/}}}/g,_0x65f6('0x23'))[_0x65f6('0x21')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x19b9ff)){_0x46dbc6[_0x19b9ff]=_0x46dbc6[_0x19b9ff][_0x65f6('0x21')](_0x3440af,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData;
\ No newline at end of file
+var _0x5f2f=['tenantId','token','channelSecret','accessTokenSecret','authToken','consumerKey','membername','exten','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','includes','exports','lodash','username','password','newPassword','apiKey','firstName','lastName','street','fax','email','clientId','clientSecret','securityToken','code'];(function(_0x3c68ea,_0x804049){var _0x1f99ba=function(_0x321d80){while(--_0x321d80){_0x3c68ea['push'](_0x3c68ea['shift']());}};_0x1f99ba(++_0x804049);}(_0x5f2f,0x73));var _0xf5f2=function(_0x22f38a,_0x31738e){_0x22f38a=_0x22f38a-0x0;var _0x33bb32=_0x5f2f[_0x22f38a];return _0x33bb32;};var _=require(_0xf5f2('0x0'));var sensitiveFields=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3'),_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),_0xf5f2('0x7'),'phone','mobile',_0xf5f2('0x8'),_0xf5f2('0x9'),_0xf5f2('0xa'),_0xf5f2('0xb'),_0xf5f2('0xc'),_0xf5f2('0xd'),'accessKey',_0xf5f2('0xe'),_0xf5f2('0xf'),_0xf5f2('0x10'),'accessToken',_0xf5f2('0x11'),_0xf5f2('0x12'),_0xf5f2('0x13'),'consumerSecret',_0xf5f2('0x14'),'calleridname','calleridnum',_0xf5f2('0x15'),_0xf5f2('0x16'),'clientEmail',_0xf5f2('0x17'),_0xf5f2('0x18'),_0xf5f2('0x19'),_0xf5f2('0x1a'),_0xf5f2('0x1b'),_0xf5f2('0x1c'),'accountSid',_0xf5f2('0x1d'),_0xf5f2('0x1e'),_0xf5f2('0x1f'),_0xf5f2('0x20'),_0xf5f2('0x21')];function maskSensitiveData(_0x4d97fc){const _0xafe430=/(?!^)[\s\S](?!$)/g;if(_[_0xf5f2('0x22')](_0x4d97fc)){for(const _0x17d656 in _0x4d97fc){if(_[_0xf5f2('0x23')](_0x4d97fc[_0x17d656])){for(let _0x23e23a=0x0;_0x23e23a<_0x4d97fc[_0x17d656][_0xf5f2('0x24')];_0x23e23a++){maskSensitiveData(_0x4d97fc[_0x17d656][_0x23e23a]);}}else if(_[_0xf5f2('0x22')](_0x4d97fc[_0x17d656])){maskSensitiveData(_0x4d97fc[_0x17d656]);}else if(_[_0xf5f2('0x25')](_0x4d97fc[_0x17d656])){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](/{{{/g,_0xf5f2('0x27'))[_0xf5f2('0x26')](/}}}/g,_0xf5f2('0x28'))[_0xf5f2('0x26')](/{{/g,'@{')[_0xf5f2('0x26')](/}}/g,'}@');if(_[_0xf5f2('0x29')](sensitiveFields,_0x17d656)){_0x4d97fc[_0x17d656]=_0x4d97fc[_0x17d656][_0xf5f2('0x26')](_0xafe430,'*');}}}}}module[_0xf5f2('0x2a')]['maskSensitiveData']=maskSensitiveData;
\ No newline at end of file
index e0fd011..a348038 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['\x20}\x20}','string','replace','map','isPlainObject','keys','exports','safeTemplate'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x61c60c){return _0x61c60c==='{{'?'{\x20{\x20':_0x65f6('0x0');}function safeTemplate(_0x2f06ae){var _0x3461cd=_0x2f06ae;if(typeof _0x2f06ae===_0x65f6('0x1')){_0x3461cd=_0x2f06ae[_0x65f6('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x2f06ae)){_0x3461cd=_0x2f06ae[_0x65f6('0x3')](function(_0x5150c8){return safeTemplate(_0x5150c8);});}else if(_[_0x65f6('0x4')](_0x2f06ae)){_0x3461cd=Object[_0x65f6('0x5')](_0x2f06ae)['reduce'](function(_0x4ed98f,_0x1c0e12){_0x4ed98f[_0x1c0e12]=safeTemplate(_0x2f06ae[_0x1c0e12]);return _0x4ed98f;},{});}return _0x3461cd;}module[_0x65f6('0x6')][_0x65f6('0x7')]=safeTemplate;
\ No newline at end of file
+var _0x9348=['isPlainObject','keys','reduce','exports','safeTemplate','lodash','{\x20{\x20','\x20}\x20}','string','replace','map'];(function(_0x3aadbb,_0x2ee0be){var _0x37ab9a=function(_0x47b173){while(--_0x47b173){_0x3aadbb['push'](_0x3aadbb['shift']());}};_0x37ab9a(++_0x2ee0be);}(_0x9348,0x10d));var _0x8934=function(_0x33b411,_0x1effe3){_0x33b411=_0x33b411-0x0;var _0xe3caed=_0x9348[_0x33b411];return _0xe3caed;};var _=require(_0x8934('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x23f716){return _0x23f716==='{{'?_0x8934('0x1'):_0x8934('0x2');}function safeTemplate(_0x46a231){var _0x4a2577=_0x46a231;if(typeof _0x46a231===_0x8934('0x3')){_0x4a2577=_0x46a231[_0x8934('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x46a231)){_0x4a2577=_0x46a231[_0x8934('0x5')](function(_0x923aa3){return safeTemplate(_0x923aa3);});}else if(_[_0x8934('0x6')](_0x46a231)){_0x4a2577=Object[_0x8934('0x7')](_0x46a231)[_0x8934('0x8')](function(_0x3ee9b9,_0x512f30){_0x3ee9b9[_0x512f30]=safeTemplate(_0x46a231[_0x512f30]);return _0x3ee9b9;},{});}return _0x4a2577;}module[_0x8934('0x9')][_0x8934('0xa')]=safeTemplate;
\ No newline at end of file